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],{37036:function(){"use strict"},95625:function(){"use strict"},88010:function(Un,ai){"use strict";ai.Z={lists:"lists___xhHyq",item:"item___pWJAA",children:"children___sDG61",diamond:"diamond___FwgzD",button:"button___WPN6r",mathWrap:"mathWrap___FmnMJ",mathFillWrap:"mathFillWrap___PmY3H"}},43809:function(Un,ai){"use strict";ai.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"}},42678:function(Un,ai,Le){"use strict";var ue=Le(59301),Ke=Object.defineProperty,ft=Object.getOwnPropertySymbols,yt=Object.prototype.hasOwnProperty,mt=Object.prototype.propertyIsEnumerable,Oe=(dt,Ge,Rt)=>Ge in dt?Ke(dt,Ge,{enumerable:!0,configurable:!0,writable:!0,value:Rt}):dt[Ge]=Rt,at=(dt,Ge)=>{for(var Rt in Ge||(Ge={}))yt.call(Ge,Rt)&&Oe(dt,Rt,Ge[Rt]);if(ft)for(var Rt of ft(Ge))mt.call(Ge,Rt)&&Oe(dt,Rt,Ge[Rt]);return dt};const Ct=dt=>React.createElement("svg",at({width:14,height:14,xmlns:"http://www.w3.org/2000/svg"},dt),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"})));ai.Z="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIGZpbGw9IiNGQ0IwNDEiIGN4PSI3IiBjeT0iNyIgcj0iNyIvPjxwYXRoIGQ9Ik03LjUzMSA5LjYzOGEuNjE2LjYxNiAwIDEgMS0xLjIzMSAwdi0uMDJhLjYxNi42MTYgMCAxIDEgMS4yMzEgMHYuMDJabTAtMi4yNWEuNjE2LjYxNiAwIDEgMS0xLjIzMSAwVjQuMTE3YS42MTYuNjE2IDAgMSAxIDEuMjMxIDB2My4yNzNaIiBmaWxsPSIjRkZGIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L2c+PC9zdmc+"},74413:function(){"use strict";function Un(Te,ne,te,de){te===void 0&&(te=0),de===void 0&&(de=1/0),this._name=Te,this._defaultValue=ne,this._minimum=te,this._maximum=de}Object.defineProperty(Un.prototype,"name",{get:function(){return this._name},set:function(Te){if(typeof Te!="string"||Te==="")throw new Error("Shape name must be a valid string.");this._name=Te}}),Object.defineProperty(Un.prototype,"defaultValue",{get:function(){return this._defaultValue},set:function(Te){if(typeof Te!="number"||isNaN(Te))throw new Error("The default value must be a real number, not: "+Te);this._defaultValue=Te}}),Object.defineProperty(Un.prototype,"minimum",{get:function(){return this._minimum},set:function(Te){if(typeof Te!="number"||isNaN(Te))throw new Error("Minimum must be a real number, not: "+Te);this._minimum=Te}}),Object.defineProperty(Un.prototype,"maximum",{get:function(){return this._maximum},set:function(Te){if(typeof Te!="number"||isNaN(Te))throw new Error("Maximum must be a real number, not: "+Te);this._maximum=Te}}),go.Shape._FigureParameters={},go.Shape.getFigureParameter=function(Te,ne){var te=go.Shape._FigureParameters[Te];return te?te[ne]:null},go.Shape.setFigureParameter=function(Te,ne,te){if(!(te instanceof Un))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[Te];de||(de=[],go.Shape._FigureParameters[Te]=de),de[ne]=te};var ai=[];function Le(Te,ne){var te=ai.pop();return te===void 0?new go.Point(Te,ne):(te.x=Te,te.y=ne,te)}function ue(){var Te=ai.pop();return Te===void 0?new go.Point:Te}function Ke(Te){ai.push(Te)}function ft(Te,ne,te,de,se,pe,ye,we,be){be||(be=new go.Point);var Ie=Te-te,Re=se-ye,rt=NaN,et=NaN;if(Ie===0)if(Re===0)Te===te&&(rt=Te,et=ne);else{var Ye=(pe-we)/Re,ut=pe-Ye*se;rt=Te,et=Ye*rt+ut}else if(Re===0){var tt=(ne-de)/Ie,wt=ne-tt*Te;rt=se,et=tt*rt+wt}else{var tt=(ne-de)/Ie,Ye=(pe-we)/Re,wt=ne-tt*Te,ut=pe-Ye*se;rt=(ut-wt)/(tt-Ye),et=tt*rt+wt}return be.x=rt,be.y=et,be}function yt(Te,ne,te,de,se,pe,ye,we,be,Ie,Re,rt,et,Ye){var ut=1-be,tt=be,wt=Te*ut+te*tt,St=ne*ut+de*tt,Lt=te*ut+se*tt,mn=de*ut+pe*tt,$t=se*ut+ye*tt,Pn=pe*ut+we*tt,Ot=wt*ut+Lt*tt,ct=St*ut+mn*tt,nt=Lt*ut+$t*tt,gn=mn*ut+Pn*tt,oi=Ot*ut+nt*tt,zn=ct*ut+gn*tt;Ie.x=wt,Ie.y=St,Re.x=Ot,Re.y=ct,rt.x=oi,rt.y=zn,et.x=nt,et.y=gn,Ye.x=$t,Ye.y=Pn}var mt=new go.Spot(.156,.156),Oe=new go.Spot(.844,.844),at=4*((Math.sqrt(2)-1)/3);go.Shape.setFigureParameter("RoundedRectangle",0,new Un("CornerRounding",5)),go.Shape.defineFigureGenerator("RoundedRectangle",function(Te,ne,te){var de=Te?Te.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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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=mt,se.spot2=Oe,se.defaultStretch=go.GraphObject.Uniform,se}),go.Shape.defineFigureGenerator("Line1",function(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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 Un("Indent",.1,-.99,.99)),go.Shape.defineFigureGenerator("Parallelogram1",function(Te,ne,te){var de=Te?Te.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 Un("Indent",10,-1/0,1/0)),go.Shape.defineFigureGenerator("Parallelogram2",function(Te,ne,te){var de=Te?Te.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 Un("Indent",.2,-.99,.99)),go.Shape.defineFigureGenerator("Trapezoid1",function(Te,ne,te){var de=Te?Te.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 Un("Indent",20,-1/0,1/0)),go.Shape.defineFigureGenerator("Trapezoid2",function(Te,ne,te){var de=Te?Te.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 Un("Indent",10,-1/0,1/0)),go.Shape.defineFigureGenerator("ManualOperation",function(Te,ne,te){var de=Te?Te.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 dt(){var Te=Ct.pop();return Te===void 0?[]:Te}function Ge(Te){Te.length=0,Ct.push(Te)}function Rt(Te){for(var ne=dt(),te=.5,de=.5,se=Math.PI*1.5,pe=0,ye=0;ye<Te;ye++)pe=2*Math.PI/Te*ye+se,ne[ye]=new go.Point(de+te*Math.cos(pe),de+te*Math.sin(pe));return ne.push(ne[0]),ne}function ot(Te){var ne=At(Te),te=dt();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 Ge(ne),te}function At(Te){for(var ne=Rt(Te),te=dt(),de=Math.floor(ne.length/2),se=ne.length-1,pe=Te%2===0?2:1,ye=0;ye<se;ye++){var we=ne[ye],be=ne[ye+1],Ie=ne[(de+ye-1)%se],Re=ne[(de+ye+pe)%se];te[ye*2]=we,te[ye*2+1]=ft(we.x,we.y,Ie.x,Ie.y,be.x,be.y,Re.x,Re.y,new go.Point)}return te[te.length]=te[0],Ge(ne),te}go.Shape.defineFigureGenerator("Pentagon",function(Te,ne,te){var de=Rt(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()),Ge(de),se.spot1=new go.Spot(.2,.22),se.spot2=new go.Spot(.8,.9),se}),go.Shape.defineFigureGenerator("Hexagon",function(Te,ne,te){var de=Rt(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()),Ge(de),se.spot1=new go.Spot(.07,.25),se.spot2=new go.Spot(.93,.75),se}),go.Shape.defineFigureGenerator("Heptagon",function(Te,ne,te){var de=Rt(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()),Ge(de),se.spot1=new go.Spot(.2,.15),se.spot2=new go.Spot(.8,.85),se}),go.Shape.defineFigureGenerator("Octagon",function(Te,ne,te){var de=Rt(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()),Ge(de),se.spot1=new go.Spot(.15,.15),se.spot2=new go.Spot(.85,.85),se}),go.Shape.defineFigureGenerator("Nonagon",function(Te,ne,te){var de=Rt(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()),Ge(de),se.spot1=new go.Spot(.17,.13),se.spot2=new go.Spot(.82,.82),se}),go.Shape.defineFigureGenerator("Decagon",function(Te,ne,te){var de=Rt(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()),Ge(de),se.spot1=new go.Spot(.16,.16),se.spot2=new go.Spot(.84,.84),se}),go.Shape.defineFigureGenerator("Dodecagon",function(Te,ne,te){var de=Rt(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()),Ge(de),se.spot1=new go.Spot(.16,.16),se.spot2=new go.Spot(.84,.84),se}),go.Shape.defineFigureGenerator("FivePointedStar",function(Te,ne,te){var de=At(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()),Ge(de),se.spot1=new go.Spot(.266,.333),se.spot2=new go.Spot(.733,.733),se}),go.Shape.defineFigureGenerator("SixPointedStar",function(Te,ne,te){var de=At(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()),Ge(de),se.spot1=new go.Spot(.17,.25),se.spot2=new go.Spot(.83,.75),se}),go.Shape.defineFigureGenerator("SevenPointedStar",function(Te,ne,te){var de=At(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()),Ge(de),se.spot1=new go.Spot(.222,.277),se.spot2=new go.Spot(.777,.666),se}),go.Shape.defineFigureGenerator("EightPointedStar",function(Te,ne,te){var de=At(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()),Ge(de),se.spot1=new go.Spot(.25,.25),se.spot2=new go.Spot(.75,.75),se}),go.Shape.defineFigureGenerator("NinePointedStar",function(Te,ne,te){var de=At(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()),Ge(de),se.spot1=new go.Spot(.222,.277),se.spot2=new go.Spot(.777,.666),se}),go.Shape.defineFigureGenerator("TenPointedStar",function(Te,ne,te){var de=At(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()),Ge(de),se.spot1=new go.Spot(.281,.261),se.spot2=new go.Spot(.723,.748),se}),go.Shape.defineFigureGenerator("FivePointedBurst",function(Te,ne,te){var de=ot(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(),Ge(de),se.spot1=new go.Spot(.222,.277),se.spot2=new go.Spot(.777,.777),se}),go.Shape.defineFigureGenerator("SixPointedBurst",function(Te,ne,te){var de=ot(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(),Ge(de),se.spot1=new go.Spot(.17,.222),se.spot2=new go.Spot(.833,.777),se}),go.Shape.defineFigureGenerator("SevenPointedBurst",function(Te,ne,te){var de=ot(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(),Ge(de),se.spot1=new go.Spot(.222,.222),se.spot2=new go.Spot(.777,.777),se}),go.Shape.defineFigureGenerator("EightPointedBurst",function(Te,ne,te){var de=ot(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(),Ge(de),se.spot1=new go.Spot(.222,.222),se.spot2=new go.Spot(.777,.777),se}),go.Shape.defineFigureGenerator("NinePointedBurst",function(Te,ne,te){var de=ot(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(),Ge(de),se.spot1=new go.Spot(.222,.222),se.spot2=new go.Spot(.777,.777),se}),go.Shape.defineFigureGenerator("TenPointedBurst",function(Te,ne,te){var de=ot(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(),Ge(de),se.spot1=new go.Spot(.222,.222),se.spot2=new go.Spot(.777,.777),se}),go.Shape.setFigureParameter("FramedRectangle",0,new Un("ThicknessX",8)),go.Shape.setFigureParameter("FramedRectangle",1,new Un("ThicknessY",8)),go.Shape.defineFigureGenerator("FramedRectangle",function(Te,ne,te){var de=Te?Te.parameter1:NaN,se=Te?Te.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 Un("Thickness",8)),go.Shape.defineFigureGenerator("Ring",function(Te,ne,te){var de=Te?Te.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=mt,pe.spot2=Oe,pe.defaultStretch=go.GraphObject.Uniform,pe}),go.Shape.defineFigureGenerator("Cloud",function(Te,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(Te,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 Un("Start",0,-360,360)),go.Shape.setFigureParameter("Pie",1,new Un("Sweep",315,-360,360)),go.Shape.defineFigureGenerator("Pie",function(Te,ne,te){var de=Te?Te.parameter1:NaN,se=Te?Te.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(Te,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 Un("Thickness",30)),go.Shape.defineFigureGenerator("ThickCross",function(Te,ne,te){var de=Te?Te.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 Un("Thickness",10)),go.Shape.defineFigureGenerator("ThinCross",function(Te,ne,te){var de=Te?Te.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 Un("Thickness",30)),go.Shape.defineFigureGenerator("ThickX",function(Te,ne,te){var de=Te?Te.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),be=de-Math.min(Math.cos(we)*de/2,pe),Ie=de-Math.min(Math.sin(we)*de/2,ye),se=new go.Geometry,Re=new go.PathFigure(be,0,!0);return se.add(Re),Re.add(new go.PathSegment(go.PathSegment.Line,pe,.2*te)),Re.add(new go.PathSegment(go.PathSegment.Line,ne-be,0)),Re.add(new go.PathSegment(go.PathSegment.Line,ne,Ie)),Re.add(new go.PathSegment(go.PathSegment.Line,.8*ne,ye)),Re.add(new go.PathSegment(go.PathSegment.Line,ne,te-Ie)),Re.add(new go.PathSegment(go.PathSegment.Line,ne-be,te)),Re.add(new go.PathSegment(go.PathSegment.Line,pe,.8*te)),Re.add(new go.PathSegment(go.PathSegment.Line,be,te)),Re.add(new go.PathSegment(go.PathSegment.Line,0,te-Ie)),Re.add(new go.PathSegment(go.PathSegment.Line,.2*ne,ye)),Re.add(new go.PathSegment(go.PathSegment.Line,0,Ie).close()),se}}),go.Shape.setFigureParameter("ThinX",0,new Un("Thickness",10)),go.Shape.defineFigureGenerator("ThinX",function(Te,ne,te){var de=Te?Te.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 Un("BeamWidth",.2,.1,.9)),go.Shape.defineFigureGenerator("SquareIBeam",function(Te,ne,te){var de=Te?Te.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 Un("Curviness",.5,.05,.65)),go.Shape.defineFigureGenerator("RoundedIBeam",function(Te,ne,te){var de=Te?Te.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(Te,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(Te,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(Te,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(Te,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(Te,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,be=pe*at;return se.add(new go.PathSegment(go.PathSegment.Bezier,(.5+ye)*ne,(.5+pe+we)*te,(.5-pe+ye)*ne,(.5+be+we)*te,(.5-be+ye)*ne,(.5+pe+we)*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+pe+ye)*ne,(.5+we)*te,(.5+be+ye)*ne,(.5+pe+we)*te,(.5+pe+ye)*ne,(.5+be+we)*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,(.5+ye)*ne,(.5-pe+we)*te,(1-.5+pe+ye)*ne,(.5-be+we)*te,(.5+be+ye)*ne,(.5-pe+we)*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.65*ne,.36771243*te,(.5-be+ye)*ne,(.5-pe+we)*te,(.5-pe+ye+.05)*ne,(.5-be+we-.02)*te)),pe=.2,ye=0,we=-.3,be=pe*at,se.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+pe+ye)*ne,(.5+we)*te,(.5+be+ye)*ne,(.5+pe+we)*te,(.5+pe+ye)*ne,(.5+be+we)*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,(.5+ye)*ne,(.5-pe+we)*te,(1-.5+pe+ye)*ne,(.5-be+we)*te,(.5+be+ye)*ne,(.5-pe+we)*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,(.5-pe+ye)*ne,(.5+we)*te,(.5-be+ye)*ne,(.5-pe+we)*te,(.5-pe+ye)*ne,(.5-be+we)*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,(.5-be+ye)*ne,(.5+pe+we)*te,(.5-pe+ye)*ne,(.5+be+we)*te,(.5-be+ye)*ne,(.5+pe+we)*te)),pe=.2,ye=-.3,we=0,be=pe*at,se.add(new go.PathSegment(go.PathSegment.Bezier,(.5+ye)*ne,(.5-pe+we)*te,(1-.5+pe+ye-.05)*ne,(.5-be+we-.02)*te,(.5+be+ye)*ne,(.5-pe+we)*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,(.5-pe+ye)*ne,(.5+we)*te,(.5-be+ye)*ne,(.5-pe+we)*te,(.5-pe+ye)*ne,(.5-be+we)*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,(.5+ye)*ne,(.5+pe+we)*te,(.5-pe+ye)*ne,(.5+be+we)*te,(.5-be+ye)*ne,(.5+pe+we)*te)),se.add(new go.PathSegment(go.PathSegment.Bezier,.4*ne,.6*te,(.5+be+ye)*ne,(.5+pe+we)*te,(.5+pe+ye)*ne,(.5+be+we)*te).close()),de.setSpots(.06,.33,.93,.68),de}),go.Shape.defineFigureGenerator("YinYang",function(Te,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(Te,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(Te,ne,te){var de=new go.Geometry,se=at*.5,pe=.5,ye=.5,we=.5,be=new go.PathFigure(ye*ne,(we-pe)*te);de.add(be),be.add(new go.PathSegment(go.PathSegment.Bezier,(ye-pe)*ne,we*te,(ye-se)*ne,(we-pe)*te,(ye-pe)*ne,(we-se)*te)),be.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+pe)*te,(ye-pe)*ne,(we+se)*te,(ye-se)*ne,(we+pe)*te)),be.add(new go.PathSegment(go.PathSegment.Bezier,(ye+pe)*ne,we*te,(ye+se)*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te)),be.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 Ie=ue(),Re=ue(),rt=ue(),et=ue();yt(ye,we-pe,ye+se,we-pe,ye+pe,we-se,ye+pe,we,.42,Ie,Re,rt,et,et);var Ye=ue(),ut=ue(),tt=ue();yt(ye,we-pe,ye+se,we-pe,ye+pe,we-se,ye+pe,we,.58,et,et,tt,Ye,ut);var wt=ue(),St=ue(),Lt=ue();yt(ye,we+pe,ye-se,we+pe,ye-pe,we+se,ye-pe,we,.42,wt,St,Lt,et,et);var mn=ue(),$t=ue(),Pn=ue();return yt(ye,we+pe,ye-se,we+pe,ye-pe,we+se,ye-pe,we,.58,et,et,Pn,mn,$t),be.add(new go.PathSegment(go.PathSegment.Move,Pn.x*ne,Pn.y*te)),be.add(new go.PathSegment(go.PathSegment.Bezier,(ye-pe)*ne,we*te,mn.x*ne,mn.y*te,$t.x*ne,$t.y*te)),be.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-pe)*te,(ye-pe)*ne,(we-se)*te,(ye-se)*ne,(we-pe)*te)),be.add(new go.PathSegment(go.PathSegment.Bezier,rt.x*ne,rt.y*te,Ie.x*ne,Ie.y*te,Re.x*ne,Re.y*te)),be.add(new go.PathSegment(go.PathSegment.Line,Pn.x*ne,Pn.y*te).close()),be.add(new go.PathSegment(go.PathSegment.Move,Lt.x*ne,Lt.y*te)),be.add(new go.PathSegment(go.PathSegment.Line,tt.x*ne,tt.y*te)),be.add(new go.PathSegment(go.PathSegment.Bezier,(ye+pe)*ne,we*te,Ye.x*ne,Ye.y*te,ut.x*ne,ut.y*te)),be.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te,(ye+se)*ne,(we+pe)*te)),be.add(new go.PathSegment(go.PathSegment.Bezier,Lt.x*ne,Lt.y*te,wt.x*ne,wt.y*te,St.x*ne,St.y*te).close()),Ke(Ie),Ke(Re),Ke(rt),Ke(et),Ke(Ye),Ke(ut),Ke(tt),Ke(wt),Ke(St),Ke(Lt),Ke(mn),Ke($t),Ke(Pn),de.defaultStretch=go.GraphObject.Uniform,de}),go.Shape.defineFigureGenerator("Fragile",function(Te,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 Un("Thickness",30)),go.Shape.defineFigureGenerator("HourGlass",function(Te,ne,te){var de=Te?Te.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(Te,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(Te,ne,te){var de=new go.Geometry,se=at*.4,pe=.4,ye=.5,we=.5,be=ue(),Ie=ue(),Re=ue(),rt=ue(),et=new go.PathFigure((ye-pe)*ne,we*te,!1);de.add(et),et.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-pe)*te,(ye-pe)*ne,(we-se)*te,(ye-se)*ne,(we-pe)*te)),yt(ye,we-pe,ye+se,we-pe,ye+pe,we-se,ye+pe,we,.44,Re,rt,Ie,be,be),et.add(new go.PathSegment(go.PathSegment.Bezier,Ie.x*ne,Ie.y*te,Re.x*ne,Re.y*te,rt.x*ne,rt.y*te));var Ye=Le(Ie.x,Ie.y);yt(ye,we-pe,ye+se,we-pe,ye+pe,we-se,ye+pe,we,.56,be,be,Ie,Re,rt);var ut=Le(Ie.x,Ie.y);et.add(new go.PathSegment(go.PathSegment.Line,(Ye.x*.1+.95*.9)*ne,Ye.y*.1*te)),et.add(new go.PathSegment(go.PathSegment.Line,.85*ne,Ye.y*.1*te)),et.add(new go.PathSegment(go.PathSegment.Line,.85*ne,0)),et.add(new go.PathSegment(go.PathSegment.Line,ne,0)),et.add(new go.PathSegment(go.PathSegment.Line,ne,.15*te)),et.add(new go.PathSegment(go.PathSegment.Line,(ut.x*.1+.9)*ne,.15*te)),et.add(new go.PathSegment(go.PathSegment.Line,(ut.x*.1+.9)*ne,(ut.y*.1+.05*.9)*te)),et.add(new go.PathSegment(go.PathSegment.Line,ut.x*ne,ut.y*te)),et.add(new go.PathSegment(go.PathSegment.Bezier,(ye+pe)*ne,we*te,Re.x*ne,Re.y*te,rt.x*ne,rt.y*te)),et.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te,(ye+se)*ne,(we+pe)*te)),et.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 tt=new go.PathFigure(ye*ne,(we-pe)*te,!1);de.add(tt),tt.add(new go.PathSegment(go.PathSegment.Bezier,(ye-pe)*ne,we*te,(ye-se)*ne,(we-pe)*te,(ye-pe)*ne,(we-se)*te)),tt.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+pe)*te,(ye-pe)*ne,(we+se)*te,(ye-se)*ne,(we+pe)*te)),tt.add(new go.PathSegment(go.PathSegment.Bezier,(ye+pe)*ne,we*te,(ye+se)*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te)),tt.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 wt=new go.PathFigure((ye-pe)*ne,we*te,!1);return de.add(wt),Ke(be),Ke(Ie),Ke(Re),Ke(rt),Ke(Ye),Ke(ut),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(Te,ne,te){var de=new go.Geometry,se=.375,pe=0,ye=-.125,we=se*at,be=new go.PathFigure((.525+pe)*ne,(.5+se+ye)*te,!1);de.add(be),be.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)),be.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)),be.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)),be.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)),be.add(new go.PathSegment(go.PathSegment.Line,.475*ne,.85*te)),be.add(new go.PathSegment(go.PathSegment.Line,.425*ne,.85*te)),be.add(new go.PathSegment(go.PathSegment.Line,.425*ne,.9*te)),be.add(new go.PathSegment(go.PathSegment.Line,.475*ne,.9*te)),be.add(new go.PathSegment(go.PathSegment.Line,.475*ne,te)),be.add(new go.PathSegment(go.PathSegment.Line,.525*ne,te)),be.add(new go.PathSegment(go.PathSegment.Line,.525*ne,.9*te)),be.add(new go.PathSegment(go.PathSegment.Line,.575*ne,.9*te)),be.add(new go.PathSegment(go.PathSegment.Line,.575*ne,.85*te)),be.add(new go.PathSegment(go.PathSegment.Line,.525*ne,.85*te).close()),se=.325,pe=0,ye=-.125,we=se*at;var be=new go.PathFigure((1-.5+se+pe)*ne,(.5+ye)*te,!1);de.add(be),be.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)),be.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)),be.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)),be.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 be=new go.PathFigure((.525+pe)*ne,(.5+se+ye)*te,!1);return de.add(be),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(Te,ne,te){var de=Te?Te.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(Te,ne,te){var de=Te?Te.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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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 Un("ArrowheadWidth",.3,.01,.99)),go.Shape.setFigureParameter("Arrow",1,new Un("TailHeight",.3,.01,.99)),go.Shape.defineFigureGenerator("Arrow",function(Te,ne,te){var de=Te?Te.parameter1:NaN;isNaN(de)&&(de=.3);var se=Te?Te.parameter2:NaN;isNaN(se)&&(se=.3);var pe=(1-de)*ne,ye=(.5-se/2)*te,we=(.5+se/2)*te,be=new go.Geometry,Ie=new go.PathFigure(0,ye,!0);be.add(Ie),Ie.add(new go.PathSegment(go.PathSegment.Line,pe,ye)),Ie.add(new go.PathSegment(go.PathSegment.Line,pe,0)),Ie.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),Ie.add(new go.PathSegment(go.PathSegment.Line,pe,te)),Ie.add(new go.PathSegment(go.PathSegment.Line,pe,we)),Ie.add(new go.PathSegment(go.PathSegment.Line,0,we).close()),be.spot1=new go.Spot(0,ye/te);var Re=ft(0,we/te,1,we/te,pe/ne,1,1,.5,ue());return be.spot2=new go.Spot(Re.x,Re.y),Ke(Re),be}),go.Shape.setFigureParameter("Arrow2",0,new Un("ArrowheadWidth",30)),go.Shape.setFigureParameter("Arrow2",0,new Un("TailHeight",30)),go.Shape.defineFigureGenerator("Arrow2",function(Te,ne,te){var de=Te?Te.parameter1:NaN;isNaN(de)&&(de=30),de>ne&&(de=ne);var se=Te?Te.parameter2:NaN;isNaN(se)&&(se=30),se=Math.min(se,te/2);var pe=ne-de,ye=(te-se)/2,we=ye+se,be=new go.Geometry,Ie=new go.PathFigure(0,ye,!0);be.add(Ie),Ie.add(new go.PathSegment(go.PathSegment.Line,pe,ye)),Ie.add(new go.PathSegment(go.PathSegment.Line,pe,0)),Ie.add(new go.PathSegment(go.PathSegment.Line,ne,.5*te)),Ie.add(new go.PathSegment(go.PathSegment.Line,pe,te)),Ie.add(new go.PathSegment(go.PathSegment.Line,pe,we)),Ie.add(new go.PathSegment(go.PathSegment.Line,0,we).close()),be.spot1=new go.Spot(0,ye/te);var Re=ft(0,we/te,1,we/te,pe/ne,1,1,.5,ue());return be.spot2=new go.Spot(Re.x,Re.y),Ke(Re),be}),go.Shape.defineFigureGenerator("Chevron",function(Te,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(Te,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 Un("ConnecterHeight",.3,.01,.99)),go.Shape.defineFigureGenerator("DoubleEndArrow",function(Te,ne,te){var de=Te?Te.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 be=ft(0,.5,.3,0,0,se/te,.1,se/te,ue());return ye.spot1=new go.Spot(be.x,be.y),be=ft(.7,1,1,.5,0,pe/te,1,pe/te,be),ye.spot2=new go.Spot(be.x,be.y),Ke(be),ye}),go.Shape.setFigureParameter("DoubleEndArrow2",0,new Un("ConnecterHeight",40)),go.Shape.setFigureParameter("DoubleEndArrow2",1,new Un("ArrowHeight",100)),go.Shape.defineFigureGenerator("DoubleEndArrow2",function(Te,ne,te){var de=Te?Te.parameter1:NaN;isNaN(de)&&(de=40);var se=Te?Te.parameter2:NaN;isNaN(se)&&(se=100);var pe=(te-de)/2,ye=pe+de,we=(te-se)/2,be=we+se;(de>te||se>te)&&(se>de?(de=de*te/se,pe=(te-de)/2,ye=pe+de,we=0,be=te):(pe=0,ye=te,we=0,be=te));var Ie=new go.Geometry,Re=new go.PathFigure(ne,.5*te,!0);Ie.add(Re),Re.add(new go.PathSegment(go.PathSegment.Line,.7*ne,be)),Re.add(new go.PathSegment(go.PathSegment.Line,.7*ne,ye)),Re.add(new go.PathSegment(go.PathSegment.Line,.3*ne,ye)),Re.add(new go.PathSegment(go.PathSegment.Line,.3*ne,be)),Re.add(new go.PathSegment(go.PathSegment.Line,0,.5*te)),Re.add(new go.PathSegment(go.PathSegment.Line,.3*ne,we)),Re.add(new go.PathSegment(go.PathSegment.Line,.3*ne,pe)),Re.add(new go.PathSegment(go.PathSegment.Line,.7*ne,pe)),Re.add(new go.PathSegment(go.PathSegment.Line,.7*ne,we).close());var rt=ft(0,.5,.3,we/te,0,pe/te,1,pe/te,ue());return Ie.spot1=new go.Spot(rt.x,rt.y),rt=ft(.7,be/te,1,.5,0,ye/te,1,ye/te,rt),Ie.spot2=new go.Spot(rt.x,rt.y),Ke(rt),Ie}),go.Shape.setFigureParameter("IBeamArrow",0,new Un("ConnectorHeight",.7,.51,.97)),go.Shape.defineFigureGenerator("IBeamArrow",function(Te,ne,te){var de=Te?Te.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 be=ft(.7,1,1,.5,0,pe/te,1,pe/te,ue());return ye.spot2=new go.Spot(be.x,be.y),Ke(be),ye}),go.Shape.setFigureParameter("IBeamArrow2",0,new Un("ConnectorHeight",40)),go.Shape.setFigureParameter("IBeamArrow2",1,new Un("BeamArrowHeight",100)),go.Shape.defineFigureGenerator("IBeamArrow2",function(Te,ne,te){var de=Te?Te.parameter1:NaN;isNaN(de)&&(de=40);var se=Te?Te.parameter2:NaN;isNaN(se)&&(se=100);var pe=(te-de)/2,ye=pe+de,we=(te-se)/2,be=we+se;(de>te||se>te)&&(se>de?(de=de*te/se,pe=(te-de)/2,ye=pe+de,we=0,be=te):(pe=0,ye=te,we=0,be=te));var Ie=new go.Geometry,Re=new go.PathFigure(ne,.5*te,!0);Ie.add(Re),Re.add(new go.PathSegment(go.PathSegment.Line,.7*ne,be)),Re.add(new go.PathSegment(go.PathSegment.Line,.7*ne,ye)),Re.add(new go.PathSegment(go.PathSegment.Line,.2*ne,ye)),Re.add(new go.PathSegment(go.PathSegment.Line,.2*ne,be)),Re.add(new go.PathSegment(go.PathSegment.Line,0,be)),Re.add(new go.PathSegment(go.PathSegment.Line,0,we)),Re.add(new go.PathSegment(go.PathSegment.Line,.2*ne,we)),Re.add(new go.PathSegment(go.PathSegment.Line,.2*ne,pe)),Re.add(new go.PathSegment(go.PathSegment.Line,.7*ne,pe)),Re.add(new go.PathSegment(go.PathSegment.Line,.7*ne,we).close()),Ie.spot1=new go.Spot(0,pe/te);var rt=ft(.7,be/te,1,.5,0,ye/te,1,ye/te,ue());return Ie.spot2=new go.Spot(rt.x,rt.y),Ke(rt),Ie}),go.Shape.setFigureParameter("Pointer",0,new Un("BackPoint",.1,0,.2)),go.Shape.defineFigureGenerator("Pointer",function(Te,ne,te){var de=Te?Te.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=ft(.2,.65,1,.65,0,1,1,.5,ue());return se.spot2=new go.Spot(ye.x,ye.y),Ke(ye),se}),go.Shape.setFigureParameter("RoundedPointer",0,new Un("RoundedEdge",.3,0,.5)),go.Shape.defineFigureGenerator("RoundedPointer",function(Te,ne,te){var de=Te?Te.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=ft(0,.65,1,.65,0,1,1,.5,ue());return se.spot2=new go.Spot(ye.x,ye.y),Ke(ye),se}),go.Shape.setFigureParameter("SplitEndArrow",0,new Un("TailHeight",.4,.01,.99)),go.Shape.defineFigureGenerator("SplitEndArrow",function(Te,ne,te){var de=Te?Te.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 be=ft(.7,1,1,.5,0,pe/te,1,pe/te,ue());return ye.spot2=new go.Spot(be.x,be.y),Ke(be),ye}),go.Shape.setFigureParameter("SplitEndArrow2",0,new Un("TailThickness",50)),go.Shape.defineFigureGenerator("SplitEndArrow2",function(Te,ne,te){var de=Te?Te.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 be=ft(.7,1,1,.5,0,pe/te,1,pe/te,ue());return ye.spot2=new go.Spot(be.x,be.y),Ke(be),ye}),go.Shape.setFigureParameter("SquareArrow",0,new Un("ArrowPoint",.7,.2,.9)),go.Shape.defineFigureGenerator("SquareArrow",function(Te,ne,te){var de=Te?Te.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(Te,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(Te,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(Te,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(Te,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(Te,ne,te){var de=Te?Te.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(Te,ne,te){var de=Te?Te.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(Te,ne,te){var de=Te?Te.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(Te,ne,te){var de=Te?Te.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(Te,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(Te,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(Te,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(Te,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(Te,ne,te){var de=new go.Geometry,se=.2,pe=.1,ye=at*se,we=at*pe,be=.5,Ie=.1,Re=new go.PathFigure(be*ne,(Ie+pe)*te,!0);de.add(Re),Re.add(new go.PathSegment(go.PathSegment.Bezier,(be-se)*ne,Ie*te,(be-ye)*ne,(Ie+pe)*te,(be-se)*ne,(Ie+we)*te)),Re.add(new go.PathSegment(go.PathSegment.Bezier,be*ne,(Ie-pe)*te,(be-se)*ne,(Ie-we)*te,(be-ye)*ne,(Ie-pe)*te)),Re.add(new go.PathSegment(go.PathSegment.Bezier,(be+se)*ne,Ie*te,(be+ye)*ne,(Ie-pe)*te,(be+se)*ne,(Ie-we)*te)),Re.add(new go.PathSegment(go.PathSegment.Bezier,be*ne,(Ie+pe)*te,(be+se)*ne,(Ie+we)*te,(be+ye)*ne,(Ie+pe)*te));var rt=.05,et=at*rt;be=.05,Ie=.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)),be=.95,Ie=.25,Ye.add(new go.PathSegment(go.PathSegment.Bezier,(be+rt)*ne,Ie*te,(be+et)*ne,(Ie-rt)*te,(be+rt)*ne,(Ie-et)*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)),rt=.025,et=at*rt,be=.825,Ie=.35,Ye.add(new go.PathSegment(go.PathSegment.Bezier,be*ne,(Ie-rt)*te,(be+rt)*ne,(Ie-et)*te,(be+et)*ne,(Ie-rt)*te)),Ye.add(new go.PathSegment(go.PathSegment.Bezier,(be-rt)*ne,Ie*te,(be-et)*ne,(Ie-rt)*te,(be-rt)*ne,(Ie-et)*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)),rt=.05,et=at*rt,be=.5,Ie=.7,Ye.add(new go.PathSegment(go.PathSegment.Bezier,be*ne,(Ie-rt)*te,(be+rt)*ne,(Ie-et)*te,(be+et)*ne,(Ie-rt)*te)),Ye.add(new go.PathSegment(go.PathSegment.Bezier,(be-rt)*ne,Ie*te,(be-et)*ne,(Ie-rt)*te,(be-rt)*ne,(Ie-et)*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)),rt=.025,et=at*rt,be=.175,Ie=.35,Ye.add(new go.PathSegment(go.PathSegment.Bezier,be*ne,(Ie-rt)*te,(be+rt)*ne,(Ie-et)*te,(be+et)*ne,(Ie-rt)*te)),Ye.add(new go.PathSegment(go.PathSegment.Bezier,(be-rt)*ne,Ie*te,(be-et)*ne,(Ie-rt)*te,(be-rt)*ne,(Ie-et)*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)),rt=.05,et=at*rt,be=.05,Ie=.25,Ye.add(new go.PathSegment(go.PathSegment.Bezier,be*ne,(Ie-rt)*te,(be-rt)*ne,(Ie-et)*te,(be-et)*ne,(Ie-rt)*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 Un("CornerCutoutSize",.2,.1,.9)),go.Shape.defineFigureGenerator("Card",function(Te,ne,te){var de=Te?Te.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(Te,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(Te,ne,te){var de=new go.Geometry,se=Te?Te.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(Te,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(Te,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(Te,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(Te,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(Te,ne,te){var de=new go.Geometry,se=Te?Te.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(Te,ne,te){var de=new go.Geometry,se=Te?Te.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(Te,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(Te,ne,te){var de=new go.Geometry,se=Te?Te.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(Te,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(Te,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(Te,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(Te,ne,te){var de=new go.Geometry,se=Te?Te.parameter1:NaN,pe=Te?Te.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(Te,ne,te){var de=new go.Geometry,se=1/Math.SQRT2,pe=(1-1/Math.SQRT2)/2,ye=at*.5,we=.5,be=new go.PathFigure(ne,we*te,!0);de.add(be),be.add(new go.PathSegment(go.PathSegment.Bezier,we*ne,te,ne,(we+ye)*te,(we+ye)*ne,te)),be.add(new go.PathSegment(go.PathSegment.Bezier,0,we*te,(we-ye)*ne,te,0,(we+ye)*te)),be.add(new go.PathSegment(go.PathSegment.Bezier,we*ne,0,0,(we-ye)*te,(we-ye)*ne,0)),be.add(new go.PathSegment(go.PathSegment.Bezier,ne,we*te,(we+ye)*ne,0,ne,(we-ye)*te));var Ie=new go.PathFigure((pe+se)*ne,(pe+se)*te,!1);return de.add(Ie),Ie.add(new go.PathSegment(go.PathSegment.Line,pe*ne,pe*te)),Ie.add(new go.PathSegment(go.PathSegment.Move,pe*ne,(pe+se)*te)),Ie.add(new go.PathSegment(go.PathSegment.Line,(pe+se)*ne,pe*te)),de}),go.Shape.defineFigureGenerator("LinedDocument",function(Te,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(Te,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(Te,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(Te,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(Te,ne,te){var de=new go.Geometry,se=Te?Te.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(Te,ne,te){var de=new go.Geometry,se=Te?Te.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(Te,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(Te,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(Te,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(Te,ne,te){var de=new go.Geometry,se=Te?Te.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(Te,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(Te,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(Te,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(Te,ne,te){var de=new go.Geometry,se=Te?Te.parameter1:NaN,pe=Te?Te.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(Te,ne,te){var de=new go.Geometry,se=Te?Te.parameter1:NaN,pe=Te?Te.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(Te,ne,te){var de=new go.Geometry,se=Te?Te.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(Te,ne,te){var de=new go.Geometry,se=Te?Te.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(Te,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(Te,ne,te){var de=new go.Geometry,se=Te?Te.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(Te,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(Te,ne,te){var de=new go.Geometry,se=Te?Te.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(Te,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(Te,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(Te,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 be=new go.PathFigure(.8*ne,.75*te,!1);return de.add(be),be.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.25*te)),be.add(new go.PathSegment(go.PathSegment.Line,.6*ne,.25*te)),be.add(new go.PathSegment(go.PathSegment.Line,.6*ne,.75*te)),be.add(new go.PathSegment(go.PathSegment.Line,.4*ne,.75*te)),be.add(new go.PathSegment(go.PathSegment.Line,.4*ne,.25*te)),be.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.25*te)),be.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.75*te)),de}),go.Shape.defineFigureGenerator("Ground",function(Te,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(Te,ne,te){var de=new go.Geometry,se=at*.1,pe=.1,ye=.9,we=.5,be=new go.PathFigure(.8*ne,.5*te,!0);de.add(be),be.add(new go.PathSegment(go.PathSegment.Line,0,te)),be.add(new go.PathSegment(go.PathSegment.Line,0,0)),be.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.5*te));var Ie=new go.PathFigure((ye+pe)*ne,we*te,!0);return de.add(Ie),Ie.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te,(ye+se)*ne,(we+pe)*te)),Ie.add(new go.PathSegment(go.PathSegment.Bezier,(ye-pe)*ne,we*te,(ye-se)*ne,(we+pe)*te,(ye-pe)*ne,(we+se)*te)),Ie.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-pe)*te,(ye-pe)*ne,(we-se)*te,(ye-se)*ne,(we-pe)*te)),Ie.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(Te,ne,te){var de=new go.Geometry,se=at*.5,pe=at*.4,ye=at*.1,we=.1,be=.9,Ie=.5,Re=new go.PathFigure(.8*ne,.5*te,!0);de.add(Re),Re.add(new go.PathSegment(go.PathSegment.Bezier,.4*ne,te,.8*ne,(.5+pe)*te,(.4+se)*ne,te)),Re.add(new go.PathSegment(go.PathSegment.Line,0,te)),Re.add(new go.PathSegment(go.PathSegment.Line,0,0)),Re.add(new go.PathSegment(go.PathSegment.Line,.4*ne,0)),Re.add(new go.PathSegment(go.PathSegment.Bezier,.8*ne,.5*te,(.4+se)*ne,0,.8*ne,(.5-pe)*te));var rt=new go.PathFigure((be+we)*ne,Ie*te,!0);return de.add(rt),rt.add(new go.PathSegment(go.PathSegment.Bezier,be*ne,(Ie+we)*te,(be+we)*ne,(Ie+ye)*te,(be+ye)*ne,(Ie+we)*te)),rt.add(new go.PathSegment(go.PathSegment.Bezier,(be-we)*ne,Ie*te,(be-ye)*ne,(Ie+we)*te,(be-we)*ne,(Ie+ye)*te)),rt.add(new go.PathSegment(go.PathSegment.Bezier,be*ne,(Ie-we)*te,(be-we)*ne,(Ie-ye)*te,(be-ye)*ne,(Ie-we)*te)),rt.add(new go.PathSegment(go.PathSegment.Bezier,(be+we)*ne,Ie*te,(be+ye)*ne,(Ie-we)*te,(be+we)*ne,(Ie-ye)*te)),de.spot1=new go.Spot(0,.05),de.spot2=new go.Spot(.55,.95),de}),go.Shape.defineFigureGenerator("NorGate",function(Te,ne,te){var de=new go.Geometry,se=.5,pe=at*se,ye=0,we=.5,be=new go.PathFigure(.8*ne,.5*te,!0);de.add(be),be.add(new go.PathSegment(go.PathSegment.Bezier,0,te,.7*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te)),be.add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*ne,.75*te,.25*ne,.25*te)),be.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 Ie=new go.PathFigure((ye-se)*ne,we*te,!0);return de.add(Ie),Ie.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-se)*te,(ye-se)*ne,(we-pe)*te,(ye-pe)*ne,(we-se)*te)),Ie.add(new go.PathSegment(go.PathSegment.Bezier,(ye+se)*ne,we*te,(ye+pe)*ne,(we-se)*te,(ye+se)*ne,(we-pe)*te)),Ie.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+se)*te,(ye+se)*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te)),Ie.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(Te,ne,te){var de=new go.Geometry,se=.5,pe=at*se,ye=0,we=.5,be=new go.PathFigure(0,0,!0);return de.add(be),be.add(new go.PathSegment(go.PathSegment.Bezier,ne,.5*te,(ye+pe+pe)*ne,(we-se)*te,.8*ne,(we-pe)*te)),be.add(new go.PathSegment(go.PathSegment.Bezier,0,te,.8*ne,(we+pe)*te,(ye+pe+pe)*ne,(we+se)*te)),be.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(Te,ne,te){var de=new go.Geometry,se=.5,pe=at*se,ye=.2,we=.5,be=new go.PathFigure(.1*ne,0,!1);de.add(be),be.add(new go.PathSegment(go.PathSegment.Bezier,.1*ne,te,.35*ne,.25*te,.35*ne,.75*te));var Ie=new go.PathFigure(.8*ne,.5*te,!0);de.add(Ie),Ie.add(new go.PathSegment(go.PathSegment.Bezier,.2*ne,te,.7*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te)),Ie.add(new go.PathSegment(go.PathSegment.Bezier,.2*ne,0,.45*ne,.75*te,.45*ne,.25*te)),Ie.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 Re=new go.PathFigure((ye-se)*ne,we*te,!0);return de.add(Re),Re.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-se)*te,(ye-se)*ne,(we-pe)*te,(ye-pe)*ne,(we-se)*te)),Re.add(new go.PathSegment(go.PathSegment.Bezier,(ye+se)*ne,we*te,(ye+pe)*ne,(we-se)*te,(ye+se)*ne,(we-pe)*te)),Re.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+se)*te,(ye+se)*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te)),Re.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(Te,ne,te){var de=new go.Geometry,se=.5,pe=at*se,ye=.2,we=.5,be=new go.PathFigure(.1*ne,0,!1);de.add(be),be.add(new go.PathSegment(go.PathSegment.Bezier,.1*ne,te,.35*ne,.25*te,.35*ne,.75*te));var Ie=new go.PathFigure(.2*ne,0,!0);return de.add(Ie),Ie.add(new go.PathSegment(go.PathSegment.Bezier,ne,.5*te,(ye+pe)*ne,(we-se)*te,.9*ne,(we-pe)*te)),Ie.add(new go.PathSegment(go.PathSegment.Bezier,.2*ne,te,.9*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te)),Ie.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(Te,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(Te,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(Te,ne,te){var de=new go.Geometry,se=at*.1,pe=.1,ye=.1,we=.5,be=new go.PathFigure((ye-se*.5)*ne,te,!1);return de.add(be),be.add(new go.PathSegment(go.PathSegment.Bezier,(ye+pe)*ne,0,(ye-se)*ne,te,(ye-pe)*ne,0)),ye=.3,be.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,te,(ye+pe)*ne,0,(ye+se)*ne,te)),be.add(new go.PathSegment(go.PathSegment.Bezier,(ye+pe)*ne,0,(ye-se)*ne,te,(ye-pe)*ne,0)),ye=.5,be.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,te,(ye+pe)*ne,0,(ye+se)*ne,te)),be.add(new go.PathSegment(go.PathSegment.Bezier,(ye+pe)*ne,0,(ye-se)*ne,te,(ye-pe)*ne,0)),ye=.7,be.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,te,(ye+pe)*ne,0,(ye+se)*ne,te)),be.add(new go.PathSegment(go.PathSegment.Bezier,(ye+pe)*ne,0,(ye-se)*ne,te,(ye-pe)*ne,0)),ye=.9,be.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(Te,ne,te){var de=new go.Geometry,se=at*.5,pe=.5,ye=.5,we=.5,be=new go.PathFigure((ye-pe)*ne,we*te,!1);return de.add(be),be.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-pe)*te,(ye-pe)*ne,(we-se)*te,(ye-se)*ne,(we-pe)*te)),be.add(new go.PathSegment(go.PathSegment.Bezier,(ye+pe)*ne,we*te,(ye+se)*ne,(we-pe)*te,(ye+pe)*ne,(we-se)*te)),be.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te,(ye+se)*ne,(we+pe)*te)),be.add(new go.PathSegment(go.PathSegment.Bezier,(ye-pe)*ne,we*te,(ye-se)*ne,(we+pe)*te,(ye-pe)*ne,(we+se)*te)),be.add(new go.PathSegment(go.PathSegment.Move,(ye-pe+.1)*ne,we*te)),be.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(Te,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(Te,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(Te,ne,te){var de=new go.Geometry,se=ne,pe=te;ne=ne*.38,te=te*.6;var ye=at*.8,we=.8,be=0,Ie=.5,Re=(se-ne)/2,rt=(pe-te)/2,et=new go.PathFigure(be*ne+Re,(Ie+we)*te+rt,!0);de.add(et),et.add(new go.PathSegment(go.PathSegment.Bezier,(be-we)*ne+Re,Ie*te+rt,(be-ye)*ne+Re,(Ie+we)*te+rt,(be-we)*ne+Re,(Ie+ye)*te+rt)),et.add(new go.PathSegment(go.PathSegment.Bezier,be*ne+Re,(Ie-we)*te+rt,(be-we)*ne+Re,(Ie-ye)*te+rt,(be-ye)*ne+Re,(Ie-we)*te+rt)),et.add(new go.PathSegment(go.PathSegment.Bezier,(be-we+ye*.5)*ne+Re,Ie*te+rt,be*ne+Re,(Ie-we)*te+rt,(be-we+ye*.5)*ne+Re,(Ie-ye)*te+rt)),et.add(new go.PathSegment(go.PathSegment.Bezier,be*ne+Re,(Ie+we)*te+rt,(be-we+ye*.5)*ne+Re,(Ie+ye)*te+rt,be*ne+Re,(Ie+we)*te+rt).close()),ye=at*.4,we=.4,be=.2,Ie=.5;var Ye=new go.PathFigure(be*ne+Re,(Ie+we)*te+rt,!0);de.add(Ye),Ye.add(new go.PathSegment(go.PathSegment.Bezier,(be-we)*ne+Re,Ie*te+rt,(be-ye)*ne+Re,(Ie+we)*te+rt,(be-we)*ne+Re,(Ie+ye)*te+rt)),Ye.add(new go.PathSegment(go.PathSegment.Bezier,be*ne+Re,(Ie-we)*te+rt,(be-we)*ne+Re,(Ie-ye)*te+rt,(be-ye)*ne+Re,(Ie-we)*te+rt)),Ye.add(new go.PathSegment(go.PathSegment.Bezier,(be-we+ye*.5)*ne+Re,Ie*te+rt,be*ne+Re,(Ie-we)*te+rt,(be-we+ye*.5)*ne+Re,(Ie-ye)*te+rt)),Ye.add(new go.PathSegment(go.PathSegment.Bezier,be*ne+Re,(Ie+we)*te+rt,(be-we+ye*.5)*ne+Re,(Ie+ye)*te+rt,be*ne+Re,(Ie+we)*te+rt).close()),ye=at*.2,we=.2,be=.5,Ie=.5;var ut=new go.PathFigure((be-we)*ne+Re,Ie*te+rt,!0);de.add(ut),ut.add(new go.PathSegment(go.PathSegment.Bezier,be*ne+Re,(Ie-we)*te+rt,(be-we)*ne+Re,(Ie-ye)*te+rt,(be-ye)*ne+Re,(Ie-we)*te+rt)),ut.add(new go.PathSegment(go.PathSegment.Bezier,(be+we)*ne+Re,Ie*te+rt,(be+ye)*ne+Re,(Ie-we)*te+rt,(be+we)*ne+Re,(Ie-ye)*te+rt)),ut.add(new go.PathSegment(go.PathSegment.Bezier,be*ne+Re,(Ie+we)*te+rt,(be+we)*ne+Re,(Ie+ye)*te+rt,(be+ye)*ne+Re,(Ie+we)*te+rt)),ut.add(new go.PathSegment(go.PathSegment.Bezier,(be-we)*ne+Re,Ie*te+rt,(be-ye)*ne+Re,(Ie+we)*te+rt,(be-we)*ne+Re,(Ie+ye)*te+rt)),ye=at*.4,we=.4,be=.8,Ie=.5;var tt=new go.PathFigure(be*ne+Re,(Ie-we)*te+rt,!0);de.add(tt),tt.add(new go.PathSegment(go.PathSegment.Bezier,(be+we)*ne+Re,Ie*te+rt,(be+ye)*ne+Re,(Ie-we)*te+rt,(be+we)*ne+Re,(Ie-ye)*te+rt)),tt.add(new go.PathSegment(go.PathSegment.Bezier,be*ne+Re,(Ie+we)*te+rt,(be+we)*ne+Re,(Ie+ye)*te+rt,(be+ye)*ne+Re,(Ie+we)*te+rt)),tt.add(new go.PathSegment(go.PathSegment.Bezier,(be+we-ye*.5)*ne+Re,Ie*te+rt,be*ne+Re,(Ie+we)*te+rt,(be+we-ye*.5)*ne+Re,(Ie+ye)*te+rt)),tt.add(new go.PathSegment(go.PathSegment.Bezier,be*ne+Re,(Ie-we)*te+rt,(be+we-ye*.5)*ne+Re,(Ie-ye)*te+rt,be*ne+Re,(Ie-we)*te+rt).close()),ye=at*.8,we=.8,be=1,Ie=.5;var wt=new go.PathFigure(be*ne+Re,(Ie-we)*te+rt,!0);return de.add(wt),wt.add(new go.PathSegment(go.PathSegment.Bezier,(be+we)*ne+Re,Ie*te+rt,(be+ye)*ne+Re,(Ie-we)*te+rt,(be+we)*ne+Re,(Ie-ye)*te+rt)),wt.add(new go.PathSegment(go.PathSegment.Bezier,be*ne+Re,(Ie+we)*te+rt,(be+we)*ne+Re,(Ie+ye)*te+rt,(be+ye)*ne+Re,(Ie+we)*te+rt)),wt.add(new go.PathSegment(go.PathSegment.Bezier,(be+we-ye*.5)*ne+Re,Ie*te+rt,be*ne+Re,(Ie+we)*te+rt,(be+we-ye*.5)*ne+Re,(Ie+ye)*te+rt)),wt.add(new go.PathSegment(go.PathSegment.Bezier,be*ne+Re,(Ie-we)*te+rt,(be+we-ye*.5)*ne+Re,(Ie-ye)*te+rt,be*ne+Re,(Ie-we)*te+rt).close()),de}),go.Shape.defineFigureGenerator("Email",function(Te,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(Te,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(Te,ne,te){var de=new go.Geometry,se=at*.4,pe=.4,ye=.5,we=.5,be=ue(),Ie=ue(),Re=ue(),rt=ue();yt(ye,we-pe,ye+se,we-pe,ye+pe,we-se,ye+pe,we,.5,be,be,Ie,Re,rt);var et=Le(Ie.x,Ie.y),Ye=new go.PathFigure(Ie.x*ne,Ie.y*te,!0);de.add(Ye),Ye.add(new go.PathSegment(go.PathSegment.Bezier,(ye+pe)*ne,we*te,Re.x*ne,Re.y*te,rt.x*ne,rt.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)),yt(ye-pe,we,ye-pe,we-se,ye-se,we-pe,ye,we-pe,.5,Re,rt,Ie,be,be),Ye.add(new go.PathSegment(go.PathSegment.Bezier,Ie.x*ne,Ie.y*te,Re.x*ne,Re.y*te,rt.x*ne,rt.y*te)),se=at*.3,pe=.3,yt(ye-pe,we,ye-pe,we-se,ye-se,we-pe,ye,we-pe,.5,Re,rt,Ie,be,be),Ye.add(new go.PathSegment(go.PathSegment.Line,Ie.x*ne,Ie.y*te)),Ye.add(new go.PathSegment(go.PathSegment.Bezier,(ye-pe)*ne,we*te,rt.x*ne,rt.y*te,Re.x*ne,Re.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)),yt(ye,we-pe,ye+se,we-pe,ye+pe,we-se,ye+pe,we,.5,be,be,Ie,Re,rt),Ye.add(new go.PathSegment(go.PathSegment.Bezier,Ie.x*ne,Ie.y*te,rt.x*ne,rt.y*te,Re.x*ne,Re.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()),Ke(be),Ke(Ie),Ke(Re),Ke(rt),Ke(et),de.spot1=new go.Spot(.25,.45),de.spot2=new go.Spot(.75,.8),de}),go.Shape.defineFigureGenerator("Fallout",function(Te,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,be){ye.add(new go.PathSegment(go.PathSegment.Move,(.3+we)*ne,(.8+be)*te)),ye.add(new go.PathSegment(go.PathSegment.Line,(.5+we)*ne,(.5+be)*te)),ye.add(new go.PathSegment(go.PathSegment.Line,(.1+we)*ne,(.5+be)*te)),ye.add(new go.PathSegment(go.PathSegment.Line,(.3+we)*ne,(.8+be)*te).close())}return pe(se,0,0),pe(se,.4,0),pe(se,.2,-.3),de}),go.Shape.defineFigureGenerator("IrritationHazard",function(Te,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(Te,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(Te,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(Te,ne,te){var de=new go.Geometry,se=.5,pe=0,ye=0,we=se*at,be=.4*Math.SQRT2/2+.5,Ie=.5-.5*Math.SQRT2/2,Re=1,rt=.5,et=.5,Ye=0,ut=new go.PathFigure(be*ne,(1-Ie)*te,!1);return de.add(ut),ut.add(new go.PathSegment(go.PathSegment.Bezier,Re*ne,rt*te,Re*ne,.7*te,Re*ne,rt*te)),ut.add(new go.PathSegment(go.PathSegment.Bezier,(et+pe)*ne,(Ye+pe)*te,(.5+se+pe)*ne,(.5-we+pe)*te,(.5+we+pe)*ne,(.5-se+pe)*te)),ut.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)),ut.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)),ut.add(new go.PathSegment(go.PathSegment.Move,(.25+pe)*ne,.8*te)),ut.add(new go.PathSegment(go.PathSegment.Line,(.35+pe)*ne,.9*te)),ut.add(new go.PathSegment(go.PathSegment.Line,(.2+pe)*ne,.95*te)),de}),go.Shape.defineFigureGenerator("BpmnActivityParallel",function(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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,be=ye,Ie=Math.PI/4,Re=4*(1-Math.cos(Ie))/(3*Math.sin(Ie)),rt=Re*.5,et=ye,Ye=ye,ut=Re*et,tt=Re*Ye;pe.add(new go.PathSegment(go.PathSegment.Bezier,(we-et)*ne,be*te,(we-(ut+et)/2)*ne,(be+(Ye+tt)/2)*te,(we-et)*ne,(be+tt)*te)),pe.add(new go.PathSegment(go.PathSegment.Bezier,we*ne,(be-Ye)*te,(we-et)*ne,(be-tt)*te,(we-ut)*ne,(be-Ye)*te)),pe.add(new go.PathSegment(go.PathSegment.Bezier,(we+et)*ne,be*te,(we+ut)*ne,(be-Ye)*te,(we+et)*ne,(be-tt)*te)),pe.add(new go.PathSegment(go.PathSegment.Bezier,(1-.365)*ne,(1-.595)*te,(we+et)*ne,(be+tt)*te,(we+(ut+et)/2)*ne,(be+(Ye+tt)/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 wt=new go.PathFigure(.2*ne,te,!1);de.add(wt),wt.add(new go.PathSegment(go.PathSegment.Line,.2*ne,.8*te));var St=new go.PathFigure(.8*ne,te,!1);return de.add(St),St.add(new go.PathSegment(go.PathSegment.Line,.8*ne,.8*te)),de}),go.Shape.defineFigureGenerator("BpmnEventConditional",function(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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,be=.2,Ie=.9,Re=new go.PathFigure((be-ye)*ne,Ie*te,!0);de.add(Re),Re.add(new go.PathSegment(go.PathSegment.Bezier,be*ne,(Ie-ye)*te,(be-ye)*ne,(Ie-we)*te,(be-we)*ne,(Ie-ye)*te)),Re.add(new go.PathSegment(go.PathSegment.Bezier,(be+ye)*ne,Ie*te,(be+we)*ne,(Ie-ye)*te,(be+ye)*ne,(Ie-we)*te)),Re.add(new go.PathSegment(go.PathSegment.Bezier,be*ne,(Ie+ye)*te,(be+ye)*ne,(Ie+we)*te,(be+we)*ne,(Ie+ye)*te)),Re.add(new go.PathSegment(go.PathSegment.Bezier,(be-ye)*ne,Ie*te,(be-we)*ne,(Ie+ye)*te,(be-ye)*ne,(Ie+we)*te).close()),ye=.1,we=at*.1,be=.8,Ie=.9;var rt=new go.PathFigure((be-ye)*ne,Ie*te,!0);return de.add(rt),rt.add(new go.PathSegment(go.PathSegment.Bezier,be*ne,(Ie-ye)*te,(be-ye)*ne,(Ie-we)*te,(be-we)*ne,(Ie-ye)*te)),rt.add(new go.PathSegment(go.PathSegment.Bezier,(be+ye)*ne,Ie*te,(be+we)*ne,(Ie-ye)*te,(be+ye)*ne,(Ie-we)*te)),rt.add(new go.PathSegment(go.PathSegment.Bezier,be*ne,(Ie+ye)*te,(be+ye)*ne,(Ie+we)*te,(be+we)*ne,(Ie+ye)*te)),rt.add(new go.PathSegment(go.PathSegment.Bezier,(be-ye)*ne,Ie*te,(be-we)*ne,(Ie+ye)*te,(be-ye)*ne,(Ie+we)*te).close()),de}),go.Shape.defineFigureGenerator("KanbanPost",function(Te,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(Te,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 be=.1,Ie=at*.1,Re=.1,rt=.9,et=new go.PathFigure((Re-be)*ne,rt*te,!0);de.add(et),et.add(new go.PathSegment(go.PathSegment.Bezier,Re*ne,(rt-be)*te,(Re-be)*ne,(rt-Ie)*te,(Re-Ie)*ne,(rt-be)*te)),et.add(new go.PathSegment(go.PathSegment.Bezier,(Re+be)*ne,rt*te,(Re+Ie)*ne,(rt-be)*te,(Re+be)*ne,(rt-Ie)*te)),et.add(new go.PathSegment(go.PathSegment.Bezier,Re*ne,(rt+be)*te,(Re+be)*ne,(rt+Ie)*te,(Re+Ie)*ne,(rt+be)*te)),et.add(new go.PathSegment(go.PathSegment.Bezier,(Re-be)*ne,rt*te,(Re-Ie)*ne,(rt+be)*te,(Re-be)*ne,(rt+Ie)*te)),be=.1,Ie=at*.1,Re=.4,rt=.9;var Ye=new go.PathFigure((Re-be)*ne,rt*te,!0);return de.add(Ye),Ye.add(new go.PathSegment(go.PathSegment.Bezier,Re*ne,(rt-be)*te,(Re-be)*ne,(rt-Ie)*te,(Re-Ie)*ne,(rt-be)*te)),Ye.add(new go.PathSegment(go.PathSegment.Bezier,(Re+be)*ne,rt*te,(Re+Ie)*ne,(rt-be)*te,(Re+be)*ne,(rt-Ie)*te)),Ye.add(new go.PathSegment(go.PathSegment.Bezier,Re*ne,(rt+be)*te,(Re+be)*ne,(rt+Ie)*te,(Re+Ie)*ne,(rt+be)*te)),Ye.add(new go.PathSegment(go.PathSegment.Bezier,(Re-be)*ne,rt*te,(Re-Ie)*ne,(rt+be)*te,(Re-be)*ne,(rt+Ie)*te)),de}),go.Shape.defineFigureGenerator("RailShipment",function(Te,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 Re=.05,rt=at*.05,et=.175,Ye=.95,we=new go.PathFigure((et-Re)*ne,Ye*te,!0);de.add(we),we.add(new go.PathSegment(go.PathSegment.Bezier,et*ne,(Ye-Re)*te,(et-Re)*ne,(Ye-rt)*te,(et-rt)*ne,(Ye-Re)*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,(et+Re)*ne,Ye*te,(et+rt)*ne,(Ye-Re)*te,(et+Re)*ne,(Ye-rt)*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,et*ne,(Ye+Re)*te,(et+Re)*ne,(Ye+rt)*te,(et+rt)*ne,(Ye+Re)*te)),we.add(new go.PathSegment(go.PathSegment.Bezier,(et-Re)*ne,Ye*te,(et-rt)*ne,(Ye+Re)*te,(et-Re)*ne,(Ye+rt)*te));var Re=.05,rt=at*.05,et=.375,Ye=.95,be=new go.PathFigure((et-Re)*ne,Ye*te,!0);de.add(be),be.add(new go.PathSegment(go.PathSegment.Bezier,et*ne,(Ye-Re)*te,(et-Re)*ne,(Ye-rt)*te,(et-rt)*ne,(Ye-Re)*te)),be.add(new go.PathSegment(go.PathSegment.Bezier,(et+Re)*ne,Ye*te,(et+rt)*ne,(Ye-Re)*te,(et+Re)*ne,(Ye-rt)*te)),be.add(new go.PathSegment(go.PathSegment.Bezier,et*ne,(Ye+Re)*te,(et+Re)*ne,(Ye+rt)*te,(et+rt)*ne,(Ye+Re)*te)),be.add(new go.PathSegment(go.PathSegment.Bezier,(et-Re)*ne,Ye*te,(et-rt)*ne,(Ye+Re)*te,(et-Re)*ne,(Ye+rt)*te));var Re=.05,rt=at*.05,et=.625,Ye=.95,Ie=new go.PathFigure((et-Re)*ne,Ye*te,!0);de.add(Ie),Ie.add(new go.PathSegment(go.PathSegment.Bezier,et*ne,(Ye-Re)*te,(et-Re)*ne,(Ye-rt)*te,(et-rt)*ne,(Ye-Re)*te)),Ie.add(new go.PathSegment(go.PathSegment.Bezier,(et+Re)*ne,Ye*te,(et+rt)*ne,(Ye-Re)*te,(et+Re)*ne,(Ye-rt)*te)),Ie.add(new go.PathSegment(go.PathSegment.Bezier,et*ne,(Ye+Re)*te,(et+Re)*ne,(Ye+rt)*te,(et+rt)*ne,(Ye+Re)*te)),Ie.add(new go.PathSegment(go.PathSegment.Bezier,(et-Re)*ne,Ye*te,(et-rt)*ne,(Ye+Re)*te,(et-Re)*ne,(Ye+rt)*te));var Re=.05,rt=at*.05,et=.825,Ye=.95,ut=new go.PathFigure((et-Re)*ne,Ye*te,!0);de.add(ut),ut.add(new go.PathSegment(go.PathSegment.Bezier,et*ne,(Ye-Re)*te,(et-Re)*ne,(Ye-rt)*te,(et-rt)*ne,(Ye-Re)*te)),ut.add(new go.PathSegment(go.PathSegment.Bezier,(et+Re)*ne,Ye*te,(et+rt)*ne,(Ye-Re)*te,(et+Re)*ne,(Ye-rt)*te)),ut.add(new go.PathSegment(go.PathSegment.Bezier,et*ne,(Ye+Re)*te,(et+Re)*ne,(Ye+rt)*te,(et+rt)*ne,(Ye+Re)*te)),ut.add(new go.PathSegment(go.PathSegment.Bezier,(et-Re)*ne,Ye*te,(et-rt)*ne,(Ye+Re)*te,(et-Re)*ne,(Ye+rt)*te).close());var tt=new go.PathFigure(0,te,!1);return de.add(tt),tt.add(new go.PathSegment(go.PathSegment.Line,ne,te).close()),de}),go.Shape.defineFigureGenerator("Warehouse",function(Te,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,be=at*.05,Ie=.35,Re=.775,rt=new go.PathFigure((Ie-we)*ne,Re*te,!0);return de.add(rt),rt.add(new go.PathSegment(go.PathSegment.Bezier,Ie*ne,(Re-we)*te,(Ie-we)*ne,(Re-be)*te,(Ie-be)*ne,(Re-we)*te)),rt.add(new go.PathSegment(go.PathSegment.Bezier,(Ie+we)*ne,Re*te,(Ie+be)*ne,(Re-we)*te,(Ie+we)*ne,(Re-be)*te)),rt.add(new go.PathSegment(go.PathSegment.Bezier,Ie*ne,(Re+we)*te,(Ie+we)*ne,(Re+be)*te,(Ie+be)*ne,(Re+we)*te)),rt.add(new go.PathSegment(go.PathSegment.Bezier,(Ie-we)*ne,Re*te,(Ie-be)*ne,(Re+we)*te,(Ie-we)*ne,(Re+be)*te).close()),de}),go.Shape.defineFigureGenerator("ControlCenter",function(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,ne,te){var de=new go.Geometry,se=.3,pe=at*.3,ye=.5,we=.7,be=new go.PathFigure((ye-se)*ne,we*te,!0);de.add(be),be.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-se)*te,(ye-se)*ne,(we-pe)*te,(ye-pe)*ne,(we-se)*te)),be.add(new go.PathSegment(go.PathSegment.Bezier,(ye+se)*ne,we*te,(ye+pe)*ne,(we-se)*te,(ye+se)*ne,(we-pe)*te)),be.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+se)*te,(ye+se)*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te)),be.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 Ie=new go.PathFigure(0,.7*te,!1);return de.add(Ie),Ie.add(new go.PathSegment(go.PathSegment.Bezier,ne,.7*te,0,0,ne,0)),de}),go.Shape.defineFigureGenerator("TripleFanBlades",function(Te,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(Te,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(Te,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(Te,ne,te){var de=new go.Geometry,se=.5,pe=at*.5,ye=.5,we=.5,be=new go.PathFigure((ye-se)*ne,we*te,!0);de.add(be),be.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-se)*te,(ye-se)*ne,(we-pe)*te,(ye-pe)*ne,(we-se)*te)),be.add(new go.PathSegment(go.PathSegment.Bezier,(ye+se)*ne,we*te,(ye+pe)*ne,(we-se)*te,(ye+se)*ne,(we-pe)*te)),be.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+se)*te,(ye+se)*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te)),be.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 Ie=new go.PathFigure(.15*ne,.5*te,!1);return de.add(Ie),Ie.add(new go.PathSegment(go.PathSegment.Line,.85*ne,.5*te)),de}),go.Shape.defineFigureGenerator("Flag",function(Te,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(Te,ne,te){var de=new go.Geometry,se=.5,pe=at*.5,ye=.5,we=.5,be=new go.PathFigure((ye-se)*ne,we*te,!1);de.add(be),be.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-se)*te,(ye-se)*ne,(we-pe)*te,(ye-pe)*ne,(we-se)*te)),be.add(new go.PathSegment(go.PathSegment.Bezier,(ye+se)*ne,we*te,(ye+pe)*ne,(we-se)*te,(ye+se)*ne,(we-pe)*te)),be.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+se)*te,(ye+se)*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te)),be.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 Ie=new go.PathFigure((ye-se)*ne,we*te,!1);return de.add(Ie),Ie.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we-se)*te,(ye-se)*ne,(we-pe)*te,(ye-pe)*ne,(we-se)*te)),Ie.add(new go.PathSegment(go.PathSegment.Bezier,(ye+se)*ne,we*te,(ye+pe)*ne,(we-se)*te,(ye+se)*ne,(we-pe)*te)),Ie.add(new go.PathSegment(go.PathSegment.Bezier,ye*ne,(we+se)*te,(ye+se)*ne,(we+pe)*te,(ye+pe)*ne,(we+se)*te)),Ie.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()),Ie.add(new go.PathSegment(go.PathSegment.Move,.5*ne,.7*te)),Ie.add(new go.PathSegment(go.PathSegment.Line,.5*ne,.5*te)),Ie.add(new go.PathSegment(go.PathSegment.Bezier,.5*ne,.2*te,.75*ne,.475*te,.75*ne,.225*te)),Ie.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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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 be=new go.PathFigure(.5*ne,.1*te,!1);return de.add(be),be.add(new go.PathSegment(go.PathSegment.Line,(.046+.15)*ne,.3*te)),be.add(new go.PathSegment(go.PathSegment.Line,(1-(.046+.15))*ne,.3*te).close()),de}),go.Shape.defineFigureGenerator("Staircase",function(Te,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(Te,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 be=new go.PathFigure(ne*.816,te,!0);return de.add(be),be.add(new go.PathSegment(go.PathSegment.Line,ne*.816,te*(1-.184*4))),be.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*(1-.184*5))),be.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*1).close()),de}),go.Shape.defineFigureGenerator("PC",function(Te,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 be=new go.PathFigure(ne*1,0,!0);return de.add(be),be.add(new go.PathSegment(go.PathSegment.Line,ne*.4,0)),be.add(new go.PathSegment(go.PathSegment.Line,ne*.4,te*.65)),be.add(new go.PathSegment(go.PathSegment.Line,ne*1,te*.65).close()),de}),go.Shape.defineFigureGenerator("Plane",function(Te,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(Te,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(Te,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 be=new go.PathFigure(ne*(.11+.24133333*2+.028*2),te*.1,!1);return de.add(be),be.add(new go.PathSegment(go.PathSegment.Line,ne*(.11+.24133333*3+.028*2),te*.1)),be.add(new go.PathSegment(go.PathSegment.Line,ne*(.11+.24133333*3+.028*2),te*.8)),be.add(new go.PathSegment(go.PathSegment.Line,ne*(.11+.24133333*2+.028*2),te*.8).close()),de}),go.Shape.defineFigureGenerator("FloppyDisk",function(Te,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 be=new go.PathFigure(ne*.83,te*1,!1);de.add(be),be.add(new go.PathSegment(go.PathSegment.Line,ne*.83,te*.5)),be.add(new go.PathSegment(go.PathSegment.Line,ne*.17,te*.5)),be.add(new go.PathSegment(go.PathSegment.Line,ne*.17,te*1).close());var Ie=new go.PathFigure(ne*.78,te*.05,!1);return de.add(Ie),Ie.add(new go.PathSegment(go.PathSegment.Line,ne*.66,te*.05)),Ie.add(new go.PathSegment(go.PathSegment.Line,ne*.66,te*.25)),Ie.add(new go.PathSegment(go.PathSegment.Line,ne*.78,te*.25).close()),de}),go.Shape.defineFigureGenerator("SpeechBubble",function(Te,ne,te){var de=Te?Te.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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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(Te,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")},80727:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;(function(){if(typeof window.GGBApplet=="function"){console.warn("deployggb.js was loaded twice");return}var isRenderGGBElementEnabled=!1,scriptLoadStarted=!1,html5AppletsToProcess=null,ggbHTML5LoadedCodebaseIsWebSimple=!1,ggbHTML5LoadedCodebaseVersion=null,ggbHTML5LoadedScript=null,GGBApplet=function(){"use strict";for(var Un={},ai="5.0",Le={},ue=null,Ke=!1,ft=!1,yt=null,mt=!1,Oe=null,at=null,Ct=0;Ct<arguments.length;Ct++){var dt=arguments[Ct];if(dt!==null)switch(typeof dt){case"number":ai=dt.toFixed(1);break;case"string":dt.match(new RegExp("^[0-9]\\.[0-9]+$"))?ai=dt:yt=dt;break;case"object":typeof dt.is3D!="undefined"?ue=dt:Le=dt;break;case"boolean":Ke=dt,ft=!0;break}}ue===null&&(ue={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&&!ft&&(Ke=!0)),yt!==null&&Le.id===void 0&&(Le.id=yt);var Ge="",Rt="",ot=!1,At=null,Te=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 be=function(Ht){return parseFloat(Ht)>4?parseFloat(Ht):5};Un.setHTML5Codebase=function(Ht,Fn){at=Ht,gn(Ht,Fn)},Un.setJavaCodebase=Un.setJavaCodebaseVersion=Un.isCompiledInstalled=Un.setPreCompiledScriptPath=Un.setPreCompiledResourcePath=function(){},Un.setHTML5CodebaseVersion=function(Ht,Fn){var Cn=parseFloat(Ht);if(Cn!==NaN&&Cn<5){console.log("The GeoGebra HTML5 codebase version "+Cn+" is deprecated. Using version latest instead.");return}Oe=Ht,nt(Ht,Fn)},Un.getHTML5CodebaseVersion=function(){return Te},Un.getParameters=function(){return Le},Un.setFontsCSSURL=function(Ht){ye=Ht},Un.setGiacJSURL=function(Ht){},Un.setJNLPFile=function(Ht){Ge=Ht},Un.setJNLPBaseDir=function(Ht){},Un.inject=function(){function Ht(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var Fn="auto",Cn=Le.id,ii,Wt=!1,Hn=0;Hn<arguments.length;Hn++){var lt=arguments[Hn];typeof lt=="string"?(lt=lt.toLowerCase(),lt.match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?Fn=lt:Cn=arguments[Hn]):typeof lt=="boolean"?Wt=lt:lt instanceof HTMLElement&&(ii=lt)}An();function An(){if(!mt){setTimeout(An,200);return}Fn=Ot(Fn);var Ni=ii||document.getElementById(Cn);if(!Ni){console.log("possibly bug on ajax loading? ");return}if(Un.removeExistingApplet(Ni,!1),Le.width===void 0&&Ni.clientWidth&&(Le.width=Ni.clientWidth),Le.height===void 0&&Ni.clientHeight&&(Le.height=Ni.clientHeight),!(Le.width&&Le.height)&&Fn==="html5"&&(delete Le.width,delete Le.height),At=Fn,Fn==="screenshot")St(Ni,Le);else{var je=!1;Le.hasOwnProperty("playButton")&&Le.playButton||Le.hasOwnProperty("clickToLoad")&&Le.clickToLoad?je=!0:Le.hasOwnProperty("playButtonAutoDecide")&&Le.playButtonAutoDecide&&(je=(!Ie()||Ht())&&Re()),je?(At="screenshot",mn(Ni,Le,Wt,Fn)):wt(Ni,Le,Wt)}}};function Ie(){try{return window.self!==window.top}catch(Ht){return!0}}function Re(){return Le.hasOwnProperty("screenshotGenerator")&&Le.screenshotGenerator?!1:Math.max(screen.width,screen.height)<800}Un.getViews=function(){return ue},Un.isJavaInstalled=function(){return!1};var rt=function(Ht){var Fn=function(Hn){var lt=JSON.parse(Hn),An=function(Me){return Me.type=="G"||Me.type=="E"},Ni=lt.elements?lt.elements.filter(An)[0]:lt;if(!Ni||!Ni.url){Cn();return}Le.fileName=Ni.url,et(Ni.settings||{}),ue.is3D=!0;var je="https://www.geogebra.org/images/";Un.setPreviewImage(de||Ni.previewUrl,je+"GeoGebra_loading.png",je+"applet_play.png"),Ht()},Cn=function(){Le.onError&&Le.onError(),oi("Error: Fetching material (id "+Le.material_id+") failed.",Le)},ii=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",Wt="/materials/"+Le.material_id+"?scope=basic";Ye("https://"+ii+"/api/proxy.php?path="+encodeURIComponent(Wt),Fn,Cn)};function et(Ht){var Fn=["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"];["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach(function(Cn){Ht[Cn]=!!Ht[Cn]}),Fn.forEach(function(Cn){Le[Cn]===void 0&&Ht[Cn]!==void 0&&(Le[Cn]=Ht[Cn])}),Le.showToolBarHelp===void 0&&(Le.showToolBarHelp=Le.showToolBar)}function Ye(Ht,Fn,Cn){var ii=new XMLHttpRequest;ii.open("GET",Ht),ii.onload=function(){Fn(ii.responseText)},ii.onerror=Cn,ii.send()}Un.isHTML5Installed=function(){return!0},Un.getLoadedAppletType=function(){return At},Un.setPreviewImage=function(Ht,Fn,Cn){de=Ht,se=Fn,pe=Cn},Un.removeExistingApplet=function(Ht,Fn){var Cn;typeof Ht=="string"&&(Ht=document.getElementById(Ht)),At=null;var ii=null;for(Cn=0;Cn<Ht.childNodes.length;Cn++){var Wt=Ht.childNodes[Cn],Hn=Wt.className;Hn==="applet_screenshot"?Fn?(Wt.style.display="block",At="screenshot"):Wt.style.display="none":Hn!=="applet_scaler prerender"&&(Ht.removeChild(Wt),ii=Hn&&Hn.indexOf("appletParameters")!=-1?Wt.id:null,Cn--)}var lt=Le.id!==void 0?Le.id:ii,An=window[lt];An&&typeof An.getBase64=="function"&&(An.remove(),window[lt]=null)},Un.refreshHitPoints=function(){if(be(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var Ht=Un.getAppletObject();return Ht&&typeof Ht.recalculateEnvironments=="function"?(Ht.recalculateEnvironments(),!0):!1},Un.startAnimation=function(){var Ht=Un.getAppletObject();return Ht&&typeof Ht.startAnimation=="function"?(Ht.startAnimation(),!0):!1},Un.stopAnimation=function(){var Ht=Un.getAppletObject();return Ht&&typeof Ht.stopAnimation=="function"?(Ht.stopAnimation(),!0):!1},Un.getAppletObject=function(){var Ht=Le.id!==void 0?Le.id:"ggbApplet";return window[Ht]},Un.resize=function(){};var ut=function(Ht,Fn,Cn){var ii=document.createElement("param");ii.setAttribute("name",Fn),ii.setAttribute("value",Cn),Ht.appendChild(ii)},tt=function(Ht){return Ht&&Ht!=="false"},wt=function(Ht,Fn,Cn){be(Te)<=4.2&&(Cn=!0);var ii=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==Te||ggbHTML5LoadedCodebaseIsWebSimple&&!te)&&(ii=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var Wt=document.createElement("div");Wt.classList.add("appletParameters","notranslate");var Hn=Fn.width,lt=Fn.height;if(Fn.disableAutoScale=Fn.disableAutoScale===void 0?GGBAppletUtils.isFlexibleWorksheetEditor():Fn.disableAutoScale,Fn.width!==void 0)if(be(Te)<=4.4)tt(Fn.showToolBar)&&(Fn.height-=7),tt(Fn.showAlgebraInput)&&(Fn.height-=37),Fn.width<605&&tt(Fn.showToolBar)&&(Fn.width=605,Hn=605);else{var An=100;(tt(Fn.showToolBar)||tt(Fn.showMenuBar))&&(Fn.hasOwnProperty("customToolBar")&&(Fn.customToolbar=Fn.customToolBar),An=tt(Fn.showMenuBar)?245:155),Hn<An&&(Fn.width=An,Hn=An)}Wt.style.border="none",Wt.style.display="inline-block";for(var Ni in Fn)Fn.hasOwnProperty(Ni)&&Ni!=="appletOnLoad"&&Wt.setAttribute("data-param-"+Ni,Fn[Ni]);ye&&Wt.setAttribute("data-param-fontscssurl",ye),Un.resize=function(){GGBAppletUtils.responsiveResize(Ht,Fn)},window.addEventListener("resize",function(jt){Un.resize()});var je=typeof Fn.appletOnLoad=="function"?Fn.appletOnLoad:function(){};if(!Cn&&Fn.width!==void 0){Fn.hasOwnProperty("showSplash")||Wt.setAttribute("data-param-showSplash","false");var Me=Ht.querySelector(".applet_scaler.prerender"),Ee=Me!==null;if(Ee)var De=Me.querySelector(".ggb_preview");else{var De=Pn(Hn,lt,Fn.borderColor,!1);Me=document.createElement("div"),Me.className="applet_scaler",Me.style.position="relative",Me.style.display="block",Me.style.width=Hn+"px",Me.style.height=lt+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(Me,"66%"),be(Te)>=5?(Fn.appletOnLoad=function(jt){var pn=Ht.querySelector(".ggb_preview");pn&&pn.parentNode.removeChild(pn),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(Me),window.GGBT_wsf_view&&$(window).trigger("resize"),je(jt)},Ee||Me.appendChild(De)):Wt.appendChild(De),Me.appendChild(Wt),Ee||Ht.appendChild(Me),setTimeout(function(){Un.resize()},1)}else{var We=document.createElement("div");We.className="applet_scaler",We.style.position="relative",We.style.display="block",We.appendChild(Wt),Ht.appendChild(We),Fn.appletOnLoad=function(jt){Un.resize(),je(jt)}}function Ae(jt,pn){pn&&typeof pn.appletOnLoad=="function"&&typeof renderGGBElement=="function"?renderGGBElement(jt,pn.appletOnLoad):renderGGBElement(jt),oi("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",pn)}function Je(jt,pn){typeof renderGGBElement=="undefined"?(html5AppletsToProcess===null&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:jt,params:pn}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,html5AppletsToProcess!==null&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach(function(jn){Ae(jn.article,jn.params)}),html5AppletsToProcess=null)},be(Te)<5&&(jt.className+=" geogebraweb")):Ae(jt,pn)}if(ii){scriptLoadStarted=!0;for(var Nt=0;Nt<Wt.childNodes.length;Nt++){var fn=Wt.childNodes[Nt].tagName;fn==="TABLE"&&(Wt.removeChild(Wt.childNodes[Nt]),Nt--)}if(ggbHTML5LoadedScript!==null){var vn=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');vn!=null&&vn.parentNode.removeChild(vn)}var Ft=document.createElement("script"),Jt=function(){Je(Wt,Fn)};Ft.src=Rt+ne,ggbHTML5LoadedCodebaseIsWebSimple=te,ggbHTML5LoadedCodebaseVersion=Te,ggbHTML5LoadedScript=Ft.src,oi("GeoGebra HTML5 codebase loaded: '"+Rt+"'.",Fn),!at&&(!Oe||Oe=="5.0")?(te?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),Jt()):Rt.requirejs?__webpack_require__.e(4184).then(function(){var jt=[__webpack_require__(74620)];Jt.apply(null,jt)}.bind(this)).catch(__webpack_require__.oe):(Ft.onload=Jt,Ht.appendChild(Ft))}else Je(Wt,Fn);Fn.height=lt,Fn.width=Hn},St=function(Ht,Fn,Cn){var ii=Pn(Fn.width,Fn.height,Fn.borderColor,Cn),Wt=document.createElement("div");Wt.style.position="relative",Wt.style.display="block",Wt.style.width=Fn.width+"px",Wt.style.height=Fn.height+"px",Wt.className="applet_screenshot applet_scaler"+(Cn?" applet_screenshot_play":""),Wt.appendChild(ii);var Hn=GGBAppletUtils.getScale(Fn,Ht,Cn);Cn?(Ht.appendChild($t()),window.GGBT_wsf_view||(Ht.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(Wt,"66%"),Ht.appendChild(Wt),Hn!==1&&!isNaN(Hn)&&(GGBAppletUtils.scaleElement(Wt,Hn),Wt.style.width=Fn.width+"px",Wt.style.height=Fn.height+"px",Wt.parentNode.style.width=Fn.width*Hn+"px",Wt.parentNode.style.height=Fn.height*Hn+"px"),Un.resize=function(){Lt(Ht,ii,Wt,Cn)},window.addEventListener("resize",function(lt){Un.resize()}),Un.resize()};function Lt(Ht,Fn,Cn,ii){if(Ht.contains(Fn)){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(Ht.id!=="fullscreencontent")return;window.GGBT_wsf_view.setCloseBtnPosition(Ht)}var Wt=GGBAppletUtils.getScale(Le,Ht,ii);Cn.parentNode!==null&&(!isNaN(Wt)&&Wt!==1?(GGBAppletUtils.scaleElement(Cn,Wt),Cn.parentNode.style.width=Le.width*Wt+"px",Cn.parentNode.style.height=Le.height*Wt+"px"):(GGBAppletUtils.scaleElement(Cn,1),Cn.parentNode.style.width=Le.width+"px",Cn.parentNode.style.height=Le.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(Ht),typeof window.GGBT_ws_header_footer=="object"&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}Un.onExitFullscreen=function(Ht,Fn){Fn.appendChild(Ht)};var mn=function(Ht,Fn,Cn,ii){St(Ht,Fn,!0);for(var Wt=function(){var An=[];for(lt=0;lt<Ht.childNodes.length;lt++)An.push(Ht.childNodes[lt]);if(window.GGBT_wsf_view){var Ni=window.GGBT_wsf_view.renderFullScreen(Ht,Fn.id),je=document.getElementById("fullscreencontainer"),Me=jQuery(Ht).find(".fullscreencontent");Me.length>0?(Ni.remove(),Me.attr("id","fullscreencontent").show(),jQuery(je).append(Me),window.dispatchEvent(new Event("resize"))):wt(Ni,Fn,!1),window.GGBT_wsf_view.launchFullScreen(je)}else At=ii,wt(Ht,Fn,!1);if(!window.GGBT_wsf_view)for(lt=0;lt<An.length;lt++)Ht.removeChild(An[lt])},Hn=Ht.getElementsByClassName("ggb_preview_play"),lt=0;lt<Hn.length;lt++)Hn[lt].addEventListener("click",Wt,!1),Hn[lt].addEventListener("ontouchstart",Wt,!1);typeof window.ggbAppletPlayerOnload=="function"&&window.ggbAppletPlayerOnload(Ht),Re()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},$t=function(){var Ht=document.createElement("div");if(Ht.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var Fn='.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");}',Cn=document.createElement("style");Cn.styleSheet?Cn.styleSheet.cssText=Fn:Cn.appendChild(document.createTextNode(Fn)),document.getElementsByTagName("head")[0].appendChild(Cn)}return Ht},Pn=function(Ht,Fn,Cn,ii){var Wt=document.createElement("div");Wt.className="ggb_preview",Wt.style.position="absolute",Wt.style.zIndex="90",Wt.style.width=Ht-2+"px",Wt.style.height=Fn-2+"px",Wt.style.top="0px",Wt.style.left="0px",Wt.style.overflow="hidden",Wt.style.backgroundColor="white";var Hn="lightgrey";Cn!==void 0&&(Cn==="none"?Hn="transparent":Hn=Cn),Wt.style.border="1px solid "+Hn;var lt=document.createElement("img");if(lt.style.position="relative",lt.style.zIndex="1000",lt.style.top="-1px",lt.style.left="-1px",de!==null&<.setAttribute("src",de),lt.style.opacity=.7,se!==null){var An,Ni,je;if(!ii){An=document.createElement("img"),An.style.position="absolute",An.style.zIndex="1001",An.style.opacity=1,lt.style.opacity=.3,Ni=360,Ni>Ht/4*3&&(Ni=Ht/4*3),je=Ni/5.8,An.setAttribute("src",se),An.setAttribute("width",Ni),An.setAttribute("height",je);var Me=(Ht-Ni)/2,Ee=(Fn-je)/2;An.style.left=Me+"px",An.style.top=Ee+"px",Wt.appendChild(An)}}return Wt.appendChild(lt),Wt},Ot=function(Ht){return Ht=Ht.toLowerCase(),Ht==="html5"||Ht==="screenshot"?Ht:"html5"},ct=["web","webSimple","web3d","tablet","tablet3d","phone"],nt=function(Ht,Fn){if(Te=Ht,Fn){gn(Te,!0);return}var Cn=!Ke;if(Cn){var ii=be(Te);!isNaN(ii)&&ii<4.4&&(Cn=!1)}var Wt,Hn;window.location.protocol.substr(0,4)==="http"?Wt=window.location.protocol:Wt="http:";var lt=Te.indexOf("//");lt>0?Hn=Te:lt===0?Hn=Wt+Te:Hn="https://www.geogebra.org/apps/5.2.814.0/";for(var An in ct)if(Te.slice(ct[An].length*-1)===ct[An]||Te.slice((ct[An].length+1)*-1)===ct[An]+"/"){gn(Hn,!1);return}!GGBAppletUtils.isFlexibleWorksheetEditor()&&Cn&&!ue.is3D&&!ue.AV&&!ue.SV&&!ue.CV&&!ue.EV2&&!ue.CP&&!ue.PC&&!ue.DA&&!ue.FI&&!ue.PV&&!tt(Le.showToolBar)&&!tt(Le.showMenuBar)&&!tt(Le.showAlgebraInput)&&!tt(Le.enableRightClick)&&(!Le.appName||Le.appName=="classic")?Hn+="webSimple/":Hn+="web3d/",gn(Hn,!1)},gn=function(Ht,Fn){if(Ht.requirejs){Rt=Ht;return}Ht.slice(-1)!=="/"&&(Ht+="/"),Rt=Ht,Fn===null&&(Fn=Ht.indexOf("http")===-1),ot=Fn,ne="web.nocache.js",te=!1;var Cn=Rt.split("/");Cn.length>1&&(!Fn&&Cn[Cn.length-2]==="webSimple"?(ne="webSimple.nocache.js",te=!0):ct.indexOf(Cn[Cn.length-2])>=0&&(ne=Cn[Cn.length-2]+".nocache.js")),Cn=Ht.split("/"),Te=Cn[Cn.length-3],Te.substr(0,4)==="test"?Te=Te.substr(4,1)+"."+Te.substr(5,1):(Te.substr(0,3)==="war"||Te.substr(0,4)==="beta")&&(Te="5.0");var ii=parseFloat(Te);ii!==NaN&&ii<5&&Ht.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+ii+" is deprecated. Using version latest instead."),nt("5.0",Fn))},oi=function(Ht,Fn){window.console&&window.console.log&&(!Fn||typeof Fn.showLogging=="undefined"||Fn.showLogging&&Fn.showLogging!=="false")&&console.log(Ht)};Le.material_id!==void 0?rt(zn):zn();function zn(){var Ht=ai;Oe!==null?Ht=Oe:parseFloat(Ht)<5&&(Ht="5.0"),nt(Ht,!1),at!==null&&gn(at,ot),mt=!0}return Un},GGBAppletUtils=function(){"use strict";function Un(){return window.GGBT_wsf_edit!==void 0}function ai(mt,Oe){Oe!=1?(mt.style.transformOrigin="0% 0% 0px",mt.style.webkitTransformOrigin="0% 0% 0px",mt.style.transform="scale("+Oe+","+Oe+")",mt.style.webkitTransform="scale("+Oe+","+Oe+")",mt.style.maxWidth="initial",mt.querySelector(".ggb_preview")!==null&&(mt.querySelector(".ggb_preview").style.maxWidth="initial"),mt.querySelectorAll(".ggb_preview img")[0]!==void 0&&(mt.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),mt.querySelectorAll(".ggb_preview img")[1]!==void 0&&(mt.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(mt.style.transform="none",mt.style.webkitTransform="none")}function Le(mt,Oe,at,Ct,dt,Ge){var Rt=null;if(Ge!=null&&Ge!="")for(var ot=mt.parentNode;ot!=null;)if((" "+ot.className+" ").indexOf(" "+Ge+" ")>-1){Rt=ot;break}else ot=ot.parentNode;var At=0,Te=0,ne=0,te=0,de=0,se=0,pe=0;if(Rt)At=Rt.offsetWidth,Te=Math.max(Ct?Rt.offsetWidth:0,Rt.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(At=Math.min(window.innerWidth,document.documentElement.clientWidth),Te=Math.min(window.innerHeight,document.documentElement.clientHeight),ne=At):(At=window.innerWidth,Te=window.innerHeight,ne=window.innerWidth),mt){var ye=mt.getBoundingClientRect();ye.left>0&&ye.left<=At&&(dt===void 0||!dt)&&(document.dir==="rtl"?(de=At-ye.width-ye.left,se=ne<=480?10:30):(se=ye.left,de=ne<=480?10:30),te=se+de)}if(mt&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){var we=mt.getBoundingClientRect();window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(te=40,pe=0):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(te=0,pe=40)}}return mt&&((at===void 0||!at)&&Oe>0&&Oe+te<At?At=Oe:At-=te,typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(at===void 0||!at)&&(Te-=pe)),{width:At,height:Te}}function ue(mt,Oe,at,Ct,dt){if(mt.isScreenshoGenerator)return 1;var Ge=Ct!==void 0&&Ct,Rt=mt.noScaleMargin!=null&&mt.noScaleMargin,ot=function(we){return we&&we!=="false"},At=ot(mt.autoHeight),Te=Le(Oe,mt.width,at,At,Ge&&window.GGBT_wsf_view||Rt,dt),ne=parseInt(Te.width),te=mt.width,de=mt.height;if(te===void 0){var se=Oe.querySelector(".appletParameters");se&&(te=se.offsetWidth,de=se.offsetHeight)}var pe=ne/te,ye=Ge?1:Te.height/de;return at!==void 0&&!at&&(pe=Math.min(1,pe),ye=Math.min(1,ye)),Math.min(pe,ye)}function Ke(mt,Oe,at){var Ct=1,dt,Ge=!1;if(mt.hasOwnProperty("allowUpscale")&&(Ge=mt.allowUpscale),mt.hasOwnProperty("scale")&&(Ct=parseFloat(mt.scale),(isNaN(Ct)||Ct===null||Ct===0)&&(Ct=1),Ct>1&&(Ge=!0)),Oe&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(Ge=!0),!(mt.hasOwnProperty("disableAutoScale")&&mt.disableAutoScale))dt=ue(mt,Oe,Ge,at,mt.scaleContainerClass);else return Ct;return Ge&&(!mt.hasOwnProperty("scale")||Ct===1)?dt:Math.min(Ct,dt)}function ft(mt){var Oe=Math.min(window.innerWidth,document.documentElement.clientWidth),at=Math.min(window.innerHeight,document.documentElement.clientHeight),Ct=mt.getBoundingClientRect(),dt=(Oe-Ct.width)/2,Ge=(at-Ct.height)/2;Ge<0&&(Ge=0),mt.style.position="relative",window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(dt<40?mt.style.left="40px":mt.style.left=dt+"px",mt.style.top=Ge+"px"):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(Ge<40?mt.style.top="40px":mt.style.top=Ge+"px",mt.style.left=dt+"px")}function yt(mt,Oe){var at=mt.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(mt)}if(at.parentElement&&/fullscreen/.test(at.parentElement.className))return;var Ct=Ke(Oe,mt);Un()&&at.setAttribute("data-param-scale",Ct);for(var dt=null,Ge=0;Ge<mt.childNodes.length;Ge++)if(mt.childNodes[Ge].className!==void 0&&mt.childNodes[Ge].className.match(/^applet_scaler/)){dt=mt.childNodes[Ge];break}if(dt!==null&&dt.querySelector(".noscale")!==null)return;var Rt=Oe.id!==void 0?Oe.id:"ggbApplet",ot=window[Rt];(ot==null||!ot.recalculateEnvironments)&&dt!==null&&!dt.className.match(/fullscreen/)&&(dt.parentNode.style.transform="",!isNaN(Ct)&&Ct!==1?(dt.parentNode.style.width=Oe.width*Ct+"px",dt.parentNode.style.height=Oe.height*Ct+"px",ai(dt,Ct)):(ai(dt,1),dt.parentNode.style.width=Oe.width+"px",dt.parentNode.style.height=Oe.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&ft(mt),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($(at).parents(".content-added-content"))}}return{responsiveResize:yt,isFlexibleWorksheetEditor:Un,positionCenter:ft,getScale:Ke,scaleElement:ai}}();__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_RESULT__=function(){return GGBApplet}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__),__WEBPACK_AMD_DEFINE_RESULT__!==void 0&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__),GGBAppletUtils.makeModule=function(name,permutation){function webModule(){var H="bootstrap",I="begin",J="gwt.codesvr."+name+"=",K="gwt.codesvr=",L=name,M="startup",N="DUMMY",O=0,P=1,Q="iframe",R="position:absolute; width:0; height:0; border:none; left: -1000px;",S=" top: -1000px;",T="Chrome",U="CSS1Compat",V="<!doctype html>",W="",X="<html><head></head><body></body></html>",Y="undefined",Z="readystatechange",$=10,_="script",ab="javascript",bb="Failed to load ",cb="moduleStartup",db="scriptTagAdded",eb="moduleRequested",fb="meta",gb="name",hb=name+"::",ib="::",jb="gwt:property",kb="content",lb="=",mb="gwt:onPropertyErrorFn",nb='Bad handler "',ob='" for "gwt:onPropertyErrorFn"',pb="gwt:onLoadErrorFn",qb='" for "gwt:onLoadErrorFn"',rb="#",sb="?",tb="/",ub="img",vb="clear.cache.gif",wb="baseUrl",xb=name+".nocache.js",yb="base",zb="//",Ab="selectingPermutation",Bb=name+".devmode.js",Cb=permutation,Db=":",Eb=".cache.js",Fb="loadExternalRefs",Gb="end",n=window,o=document;function p(){var Un=n.location.search;return Un.indexOf(J)!=-1||Un.indexOf(K)!=-1}function q(Un,ai){}webModule.__sendStats=q,webModule.__moduleName=L,webModule.__errFn=null,webModule.__moduleBase=N,webModule.__softPermutationId=O,webModule.__computePropValue=null,webModule.__getPropMap=null,webModule.__installRunAsyncCode=function(){},webModule.__gwtStartLoadingFragment=function(){return null},webModule.__gwt_isKnownPropertyValue=function(){return!1},webModule.__gwt_getMetaProperty=function(){return null};var r=null,s=n.__gwt_activeModules=n.__gwt_activeModules||{};s[L]={moduleName:L},webModule.__moduleStartupDone=function(Un){var ai=s[L].bindings;s[L].bindings=function(){for(var Le=ai?ai():{},ue=Un[webModule.__softPermutationId],Ke=O;Ke<ue.length;Ke++){var ft=ue[Ke];Le[ft[O]]=ft[P]}return Le}};var t;function u(){return v(),t}function v(){if(!t){var Un=o.createElement(Q);if(Un.id=L,Un.style.cssText=R+S,Un.tabIndex=-1,o.body.appendChild(Un),t=Un.contentWindow.document,navigator.userAgent.indexOf(T)==-1){t.open();var ai=document.compatMode==U?V:W;t.write(ai+X),t.close()}}}function w(Un){function ai(ue){function Ke(){return typeof o.readyState==Y?typeof o.body!=Y&&o.body!=null:/loaded|complete/.test(o.readyState)}var ft=Ke();if(ft){ue();return}function yt(){if(!ft){if(!Ke())return;ft=!0,ue(),o.removeEventListener&&o.removeEventListener(Z,yt,!1),mt&&clearInterval(mt)}}o.addEventListener&&o.addEventListener(Z,yt,!1);var mt=setInterval(function(){yt()},$)}function Le(ue){var Ke=u(),ft=Ke.body,yt=Ke.createElement(_);yt.language=ab,yt.crossOrigin=W,yt.src=ue,webModule.__errFn&&(yt.onerror=function(){webModule.__errFn(L,new Error(bb+ue))}),ft.appendChild(yt)}ai(function(){Le(Un)})}webModule.__startLoadingFragment=function(Un){return C(Un)},webModule.__installRunAsyncCode=function(Un){var ai=u(),Le=ai.body,ue=ai.createElement(_);ue.language=ab,ue.text=Un,Le.appendChild(ue),Le.removeChild(ue)};function A(){for(var c={},d,e,f=o.getElementsByTagName(fb),g=O,h=f.length;g<h;++g){var i=f[g],j=i.getAttribute(gb),k;if(j){if(j=j.replace(hb,W),j.indexOf(ib)>=O)continue;if(j==jb){if(k=i.getAttribute(kb),k){var l,m=k.indexOf(lb);m>=O?(j=k.substring(O,m),l=k.substring(m+P)):(j=k,l=W),c[j]=l}}else if(j==mb){if(k=i.getAttribute(kb),k)try{d=eval(k)}catch(Un){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(Un){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(Un){var ai=c[Un];return ai==null?null:ai},r=d,webModule.__errFn=e}function B(){function Un(mt){var Oe=mt.lastIndexOf(rb);Oe==-1&&(Oe=mt.length);var at=mt.indexOf(sb);at==-1&&(at=mt.length);var Ct=mt.lastIndexOf(tb,Math.min(at,Oe));return Ct>=O?mt.substring(O,Ct+P):W}function ai(mt){if(!mt.match(/^\w+:\/\//)){var Oe=o.createElement(ub);Oe.src=mt+vb,mt=Un(Oe.src)}return mt}function Le(){var mt=__gwt_getMetaProperty(wb);return mt!=null?mt:W}function ue(){for(var mt=o.getElementsByTagName(_),Oe=O;Oe<mt.length;++Oe)if(mt[Oe].src.indexOf(xb)!=-1)return Un(mt[Oe].src);return W}function Ke(){var mt=o.getElementsByTagName(yb);return mt.length>O?mt[mt.length-P].href:W}function ft(){var mt=o.location;return mt.href==mt.protocol+zb+mt.host+mt.pathname+mt.search+mt.hash}var yt=Le();return yt==W&&(yt=ue()),yt==W&&(yt=Ke()),yt==W&&ft()&&(yt=Un(o.location.href)),yt=ai(yt),yt}function C(Un){return Un.match(/^\//)||Un.match(/^[a-zA-Z]+:\/\//)?Un:webModule.__moduleBase+Un}function D(){var Un=[],ai=O,Le=[],ue=[];function Ke(mt){var Oe=ue[mt](),at=Le[mt];if(Oe in at)return Oe;var Ct=[];for(var dt in at)Ct[at[dt]]=dt;throw r&&r(mt,Ct,Oe),null}if(__gwt_isKnownPropertyValue=function(mt,Oe){return Oe in Le[mt]},webModule.__getPropMap=function(){var mt={};for(var Oe in Le)Le.hasOwnProperty(Oe)&&(mt[Oe]=Ke(Oe));return mt},webModule.__computePropValue=Ke,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);var ft;try{ft=Cb;var yt=ft.indexOf(Db);yt!=-1&&(ai=parseInt(ft.substring(yt+P),$),ft=ft.substring(O,yt))}catch(mt){}return webModule.__softPermutationId=ai,C(ft+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})()},77903:function(Un,ai,Le){"use strict";Le.d(ai,{Ax:function(){return yt},Ds:function(){return mt},KI:function(){return at},SI:function(){return ft},f1:function(){return Ke}});var ue=Le(3294);function Ke(Ct){let dt=!0;if(Ct.length>0){for(let Ge=0;Ge<Ct.length;Ge++)if(Ct[Ge].compile_success==0||!Ct[Ge].compile_success){dt=!1;break}}else dt=!1;return dt}function ft(Ct,dt=""){let Ge=[];for(let Rt=0;Rt<Ct.length;Rt++){let ot=Ct[Rt],At=dt?`${dt}/${ot.name}`:`${ot.name}`;Ge.push({title:ot.name,type:ot.type,isLeaf:ot.type!=="tree",key:At})}return Ge}function yt(Ct,dt,Ge){for(let Rt=0;Rt<Ct.length;Rt++){let ot=Ct[Rt];if(ot.key===dt){ot.children=Ge;break}ot.children&&yt(ot.children,dt,Ge)}return Ct}function mt(Ct,dt,Ge){let Rt;return function(){let ot=this,At=arguments,Te=function(){Rt=null,Ge||Ct.apply(ot,At)},ne=Ge&&!Rt;clearTimeout(Rt),Rt=setTimeout(Te,dt),ne&&Ct.apply(ot,At)}}const Oe=!0,at=ue.Z.API_SERVER},6021:function(Un,ai,Le){"use strict";Le.d(ai,{Z:function(){return Te}});var ue=Le(99571),Ke=Le(59301),ft=Object.defineProperty,yt=Object.defineProperties,mt=Object.getOwnPropertyDescriptors,Oe=Object.getOwnPropertySymbols,at=Object.prototype.hasOwnProperty,Ct=Object.prototype.propertyIsEnumerable,dt=(ne,te,de)=>te in ne?ft(ne,te,{enumerable:!0,configurable:!0,writable:!0,value:de}):ne[te]=de,Ge=(ne,te)=>{for(var de in te||(te={}))at.call(te,de)&&dt(ne,de,te[de]);if(Oe)for(var de of Oe(te))Ct.call(te,de)&&dt(ne,de,te[de]);return ne},Rt=(ne,te)=>yt(ne,mt(te)),ot=(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},At=(ne,te,de)=>new Promise((se,pe)=>{var ye=Ie=>{try{be(de.next(Ie))}catch(Re){pe(Re)}},we=Ie=>{try{be(de.throw(Ie))}catch(Re){pe(Re)}},be=Ie=>Ie.done?se(Ie.value):Promise.resolve(Ie.value).then(ye,we);be((de=de.apply(ne,te)).next())});const Te=ne=>{var te=ne,{children:de}=te,se=ot(te,["children"]);const[pe,ye]=(0,Ke.useState)(!1);return Ke.createElement(ue.ZP,Rt(Ge({},se),{loading:pe,onClick:we=>At(void 0,null,function*(){try{ye(!0),yield se.onClick(we),ye(!1)}catch(be){console.error(be),ye(!1)}})}),de)}},59155:function(Un,ai,Le){"use strict";Le.d(ai,{Z:function(){return At}});var ue=Le(59301),Ke=Le(6767),ft=Le(37568),yt={codeBox:"codeBox___WpkVl"},mt=Le(92310),Oe=Le.n(mt),at=Object.defineProperty,Ct=(Te,ne,te)=>ne in Te?at(Te,ne,{enumerable:!0,configurable:!0,writable:!0,value:te}):Te[ne]=te,dt=(Te,ne,te)=>Ct(Te,typeof ne!="symbol"?ne+"":ne,te),Ge=(Te,ne,te)=>new Promise((de,se)=>{var pe=be=>{try{we(te.next(be))}catch(Ie){se(Ie)}},ye=be=>{try{we(te.throw(be))}catch(Ie){se(Ie)}},we=be=>be.done?de(be.value):Promise.resolve(be.value).then(pe,ye);we((te=te.apply(Te,ne)).next())});class Rt extends ue.Component{constructor(ne){super(ne),dt(this,"canvas"),dt(this,"randomNum",(te,de)=>Math.floor(Math.random()*(de-te)+te)),dt(this,"drawPic",()=>{this.randomCode()}),dt(this,"reloadPic",()=>{this.drawPic()}),dt(this,"changeCode",te=>{console.log(te.target.value,222),this.setState({value:te.target.value,showError:!1})}),dt(this,"onVerify",()=>{let te;return this.state.value.toLowerCase()!==""&&this.state.value.toLowerCase()!==this.state.code.toLowerCase()?(te=!0,Ke.ZP.error("\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u9A8C\u8BC1\u7801"),this.reloadPic()):this.state.value.toLowerCase()===""?(te=!0,Ke.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=ue.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 be=this.randomNum(this.state.fontSizeMax,this.state.contentHeight-5);se>40&&(be=40);const Ie=this.randomNum(-10,10);ne.translate(we,be),ne.rotate(Ie*Math.PI/180),ne.fillText(te,0,0),ne.rotate(-Ie*Math.PI/180),ne.translate(-we,-be)}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 ue.createElement("div",{className:Oe()(yt.codeBox,ne),style:{width:te}},ue.createElement("aside",null,ue.createElement(ft.default,{value:this.state.value,onChange:this.changeCode,placeholder:"\u8BF7\u8F93\u5165\u56FE\u7247\u4E2D\u7684\u9A8C\u8BC1\u7801"})),ue.createElement("div",null,ue.createElement("canvas",{onClick:this.reloadPic,ref:this.canvas,width:"100",height:"30"}),ue.createElement("div",{className:"current",onClick:this.reloadPic},"\u770B\u4E0D\u6E05\uFF1F\u6362\u4E00\u5F20")))}}const ot=(Te,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(Rt,{ref:de=>te=de})),onOk:()=>Ge(void 0,null,function*(){if(te.onVerify())return Promise.reject();Te()})})};var At=Rt},10672:function(Un,ai,Le){"use strict";Le.d(ai,{Z:function(){return dt}});var ue=Le(59301),Ke=Le(37568),ft=Le(96599),yt=Le(6767),mt={flex:"flex___eLcnP",flex1:"flex1___yUTT7",color666:"color666___TiUhG",error:"error___gTTtv",deleteIcon:"deleteIcon___mnZW1",addIcon:"addIcon___JC5NS"},Oe=Le(62772);const{TextArea:at}=Ke.default;class Ct extends ue.Component{constructor(Rt){super(Rt),this.state={inputVisible:!1,EditInputIndex:-1}}render(){let{index:Rt,onAnswerChange:ot,addChildAnswer:At,exerciseIsPublish:Te,answers:ne,activeOptionErrorIndex:te,flex:de="0 0 1000px"}=this.props;console.log("----",ne);let{inputVisible:se,EditInputIndex:pe}=this.state;return ue.createElement("div",{className:mt.flex},ue.createElement("div",{className:`${mt.color666} mb5 mt6`,style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",Rt+1,"):"),ue.createElement("div",{style:{border:"1px solid #f6f6f6",flex:1,padding:10}},ne==null?void 0:ne.map((ye,we)=>ue.createElement(ue.Fragment,null,pe!==we?(ye==null?void 0:ye.length)>0?ue.createElement(ft.default,{className:"edit-tag",key:ye,closable:!((ne==null?void 0:ne.length)===1&&we===0),onClose:be=>{be.preventDefault(),(ne==null?void 0:ne.length)===1&&we===0?this.props.deleteChildAnswermain(Rt,we):this.props.deleteChildAnswer(Rt,we)}},ue.createElement("span",{onDoubleClick:be=>{this.setState({EditInputIndex:we}),be.preventDefault()}},ye)):ue.createElement(Ke.default,{defaultValue:ye,style:{width:78,marginRight:8,height:24,verticalAlign:"top"},onBlur:be=>{if(be.target.value.replaceAll(" ","").length<=0){yt.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7EAF\u7A7A\u683C");return}ot(Rt,we,be.target.value),this.setState({EditInputIndex:-1,inputVisible:!1})}}):ue.createElement(Ke.default,{defaultValue:ye,style:{width:78,marginRight:8,height:24,verticalAlign:"top"},onBlur:be=>{if(be.target.value.replaceAll(" ","").length<=0){yt.ZP.info("\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7EAF\u7A7A\u683C");return}ot(Rt,we,be.target.value),this.setState({EditInputIndex:-1,inputVisible:!1})}}))),!se&&ue.createElement(ft.default,{className:"site-tag-plus",onClick:()=>{At(Rt),this.setState({inputVisible:!0})}},ue.createElement(Oe.Z,null)," \u65B0\u589E\u7B54\u6848")))}}var dt=Ct},65158:function(Un,ai,Le){"use strict";Le.d(ai,{Z:function(){return Te}});var ue=Le(59301),Ke=Le(12290),ft=Object.defineProperty,yt=Object.defineProperties,mt=Object.getOwnPropertyDescriptors,Oe=Object.getOwnPropertySymbols,at=Object.prototype.hasOwnProperty,Ct=Object.prototype.propertyIsEnumerable,dt=(ne,te,de)=>te in ne?ft(ne,te,{enumerable:!0,configurable:!0,writable:!0,value:de}):ne[te]=de,Ge=(ne,te)=>{for(var de in te||(te={}))at.call(te,de)&&dt(ne,de,te[de]);if(Oe)for(var de of Oe(te))Ct.call(te,de)&&dt(ne,de,te[de]);return ne},Rt=(ne,te)=>yt(ne,mt(te)),ot=(ne,te,de)=>dt(ne,typeof te!="symbol"?te+"":te,de);const At="\u2581";class Te extends ue.Component{constructor(){super(...arguments),ot(this,"getChCountBeforeCursor",(te,de)=>{const se=de.line;let pe=0;for(let we=0;we<se;we++)pe+=te.getLine(we).split(At).length-1;const ye=te.getLine(se).substring(0,de.ch);return pe+=ye.split(At).length-1,pe}),ot(this,"onCMBeforeChange",(te,de)=>{const se=te.getRange(de.from,de.to);let pe=0;if(de.text.forEach(ye=>{pe+=ye.split(At).length-1}),se&&se.indexOf(At)!=-1){const ye=se.split(At).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 ue.createElement(Ke.Z,Rt(Ge({},this.props),{onCMBeforeChange:this.onCMBeforeChange}))}}},32441:function(Un,ai,Le){"use strict";Le.d(ai,{d4:function(){return At},VP:function(){return dt}});var ue=Le(59301),Ke={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 ft=({number:Te,active:ne,className:te})=>ue.createElement("div",{className:`${Ke.digitalLabel} ${ne?Ke.active:""} ${te}`},Te);var yt=Le(25399),mt=Le(37568),Oe=Le(6767),at=Le(59301),Ct=(Te,ne,te)=>new Promise((de,se)=>{var pe=be=>{try{we(te.next(be))}catch(Ie){se(Ie)}},ye=be=>{try{we(te.throw(be))}catch(Ie){se(Ie)}},we=be=>be.done?de(be.value):Promise.resolve(be.value).then(pe,ye);we((te=te.apply(Te,ne)).next())});const dt=({defaultValue:Te,onFinish:ne})=>{const[te,de]=(0,ue.useState)(!1),[se,pe]=(0,ue.useState)(Te);return(0,ue.useEffect)(()=>{pe(Te)},[Te]),at.createElement("div",{className:Ke.titleEditor},te?at.createElement(mt.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:Ke.title,onDoubleClick:()=>de(!0)},se,at.createElement(yt.Z,{title:"\u7F16\u8F91\u8BD5\u5377\u540D\u79F0"},at.createElement("i",{className:`${Ke.editIcon} iconfont icon-bianji_Hover`,onClick:()=>de(!0)}))))};var Ge=Le(77019),Rt=Le(5269),ot=(Te,ne,te)=>new Promise((de,se)=>{var pe=be=>{try{we(te.next(be))}catch(Ie){se(Ie)}},ye=be=>{try{we(te.throw(be))}catch(Ie){se(Ie)}},we=be=>be.done?de(be.value):Promise.resolve(be.value).then(pe,ye);we((te=te.apply(Te,ne)).next())});const At=({onChange:Te=()=>ot(void 0,null,function*(){}),tabs:ne,activeKey:te,defaultActiveKey:de,className:se=""})=>{var pe,ye,we,be,Ie,Re,rt;const[et,Ye]=(0,ue.useState)(de===void 0?(pe=ne[0])==null?void 0:pe.key:de);return(0,ue.useEffect)(()=>{te!==void 0&&Ye(te)},[te]),ue.createElement(Ge.Z,{justify:"center",align:"middle",className:`${Ke.paperTab} ${se}`},ue.createElement(Rt.Z,{className:`${Ke.tabItem} ${et===((ye=ne[0])==null?void 0:ye.key)?Ke.active:""}`,onClick:()=>ot(void 0,null,function*(){var ut;yield Te(ne[0].key),Ye((ut=ne[0])==null?void 0:ut.key)})},ue.createElement(ft,{number:1,active:et===((we=ne[0])==null?void 0:we.key),className:"mr10"}),ue.createElement("span",null,(be=ne[0])==null?void 0:be.label)),ue.createElement(Rt.Z,{flex:"188px",className:`${Ke.dottedLine} ml30 mr30`}),ue.createElement(Rt.Z,{className:`${Ke.tabItem} ${et===((Ie=ne[1])==null?void 0:Ie.key)?Ke.active:""}`,onClick:()=>ot(void 0,null,function*(){var ut,tt;yield Te((ut=ne[1])==null?void 0:ut.key),Ye((tt=ne[1])==null?void 0:tt.key)})},ue.createElement(ft,{number:2,active:et===((Re=ne[1])==null?void 0:Re.key),className:"mr10"}),ue.createElement("span",null,(rt=ne[1])==null?void 0:rt.label)))}},32570:function(Un,ai,Le){"use strict";Le.d(ai,{Z:function(){return Oe}});var ue=Le(37639),Ke={text:"text___FxbAX",wrap:"wrap___UlBQ1",contact:"contact____pUDq",img:"img___BapAv"},ft=Le(32637),yt=Le(59301),Oe=({type:at,style:Ct})=>{const dt=yt.createElement("div",{className:Ke.wrap,onClick:Ge=>{Ge.preventDefault(),Ge.stopPropagation()}},yt.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",yt.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"),yt.createElement("div",{className:Ke.contact},yt.createElement("div",{className:Ke.img},yt.createElement("img",{src:ft,width:"124px",height:"124px"})),yt.createElement("div",{className:"tc font14 mt10",style:{color:"#777A93"}},"\u626B\u4E00\u626B\uFF0C\u83B7\u53D6\u6388\u6743\u7801")));return yt.createElement(ue.Z,{content:dt},yt.createElement("span",{className:Ke.text,style:Ct},"\u9AD8\u6D88\u8017"))}},73524:function(Un,ai,Le){"use strict";Le.d(ai,{Z:function(){return Rt}});var ue=Le(59301),Ke={imageDimensions:"imageDimensions___a7crR",img:"img___Kroat",fullWidth:"fullWidth___c492T"},ft=Le(92310),yt=Le.n(ft),mt=Le(29787),Oe=Le(2859),at=Le(99064),Ct=Le(955),dt=(ot,At,Te)=>new Promise((ne,te)=>{var de=ye=>{try{pe(Te.next(ye))}catch(we){te(we)}},se=ye=>{try{pe(Te.throw(ye))}catch(we){te(we)}},pe=ye=>ye.done?ne(ye.value):Promise.resolve(ye.value).then(de,se);pe((Te=Te.apply(ot,At)).next())}),Rt=({data:ot,className:At,fullWidth:Te,style:ne={},onClose:te,onOk:de,showFullTools:se,noAssociationId:pe})=>{const ye=(0,ue.useRef)(null),we=(0,ue.useRef)(null),be=(0,ue.useRef)(null),Ie=(0,ue.useRef)(null),[Re,rt]=(0,ue.useState)(!1),[et,Ye]=(0,ue.useState)("\u6B63\u5728\u52A0\u8F7D\u4E2D");(0,ue.useEffect)(()=>(be.current||(be.current=document.createElement("style"),document.head.appendChild(be.current)),ot!=null&&ot.visible?(document.body.setAttribute("data-custom","y-hidden"),be.current.innerHTML=" html { overflow-y: hidden; }",ot!=null&&ot.src&&ut()):(document.body.removeAttribute("data-custom"),be.current&&(document.head.removeChild(be.current),be.current=null)),()=>{document.body.removeAttribute("data-custom"),be.current&&(document.head.removeChild(be.current),be.current=null)}),[ot==null?void 0:ot.visible]);const ut=()=>dt(void 0,null,function*(){rt(!0),Ye("\u6B63\u5728\u52A0\u8F7D\u4E2D");const Lt=yield(0,Ct.ZJ)(ot==null?void 0:ot.src);ye.current.src="",ye.current.src=Lt,ye.current.onload=function(){St()},rt(!1),Ye("")}),tt=Lt=>dt(void 0,null,function*(){rt(!0),Ye("\u6B63\u5728\u4FDD\u5B58\u4E2D");const mn=yield(0,at.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:ot.title,file:Lt.dataUrl}});mn!=null&&mn.id&&!pe?(yield(0,at.ZP)(`/api/attachments/${ot.id}/add_subitem.json`,{method:"post",body:{subitem_id:mn==null?void 0:mn.id,settings:JSON.stringify(Lt.state)}})).status===0&&de():mn!=null&&mn.id&&de(mn),rt(!1),Ye("")}),wt=()=>{const Lt=document.querySelector('a[href="https://markerjs.com/"]');Lt&&Lt.parentNode&&(Lt.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($t=>{const Pn=document.querySelector($t.name);Pn&&Pn.setAttribute("title",$t.title)})},St=()=>{we.current=new Oe.hP(ye.current),we.current.targetRoot=Ie.current,we.current.addEventListener("render",tt),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(),ot!=null&&ot.snapshotData&&we.current.restoreState(ot.snapshotData),setTimeout(()=>{window.scrollTo(0,0),wt()},300)};return ue.createElement(ue.Fragment,null,(ot==null?void 0:ot.visible)&&ue.createElement(mt.Z,{spinning:Re,tip:et,style:{position:"absolute",width:"100vw"}},ue.createElement("div",{ref:Ie,className:yt()(Ke.imageDimensions,At,Te?Ke.fullWidth:""),style:ne},ue.createElement("img",{className:Ke.img,ref:ye}))))}},59879:function(Un,ai,Le){"use strict";var ue=Le(59301),Ke=Le(88010),ft=Le(48136),yt=Le(41588),mt=Le(62957),Oe=Le(59301);const at=(0,ue.forwardRef)(({callback:Ct,width:dt,onChange:Ge,disabled:Rt,readOnly:ot,type:At="",value:Te="",style:ne={}},te)=>{const de=(0,ue.useRef)(),se=(0,ue.useRef)(),[pe,ye]=(0,ue.useState)(0),[we,be]=(0,ue.useState)(0),[Ie,Re]=(0,ue.useState)(!1),rt=()=>{var tt=document.createElement("div");tt.innerHTML=de.current.getValue();var wt=tt.innerText;return Ct&&Ct(wt),wt};(0,ue.useImperativeHandle)(te,()=>({getData:rt}));const et=tt=>{tt.preventDefault();const wt=tt.clientX-pe,St=tt.clientY-we;document.body.onmousemove=Lt=>{let mn=Lt.clientX-wt,$t=Lt.clientY-St;const Pn=document.getElementsByClassName("markdown-popup-form")[0],Ot=window.innerWidth-Pn.offsetWidth,ct=window.innerHeight-Pn.offsetHeight;mn=Math.max(0,Math.min(mn,Ot)),$t=Math.max(0,Math.min($t,ct)),Ye(Lt.clientX,Lt.clientY,wt,St)&&(ye(mn),be($t))},document.body.onmouseup=function(){document.body.onmousemove=null}},Ye=(tt,wt,St,Lt)=>{const mn=document.body.clientHeight,$t=document.body.clientWidth;return tt<20&&St>tt||tt>$t-20&&St<tt||wt<20&&Lt>wt||wt>mn-20&&Lt<wt?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};(0,ue.useEffect)(()=>{Ie&&setTimeout(()=>{const tt=document.getElementsByClassName("markdown-popup-form")[0],wt=window.innerWidth/2-tt.offsetWidth/2,St=window.innerHeight/2-tt.offsetHeight/2;ye(wt),be(St)},0)},[Ie]);const ut=()=>{Rt||ot||Re(!0)};return Oe.createElement("div",{style:ne},Oe.createElement("div",{style:{width:dt||"100%",position:"relative"},className:`${Ke.Z.mathFillWrap} ${Rt||ot?"cursorDefault":""}`,onClick:()=>ut()},Oe.createElement("math-field",{disabled:Rt,locale:"zh_cn",class:`${Ke.Z.mathField} ${At}`,readOnly:ot,placeholder:"\u8BF7\u8F93\u5165\u516C\u5F0F",ref:de,style:{width:"100%",fontSize:Te?18:14},value:Te||""})),Oe.createElement(mt.default,{maskClosable:!1,centered:!0,width:860,style:{position:"absolute",left:pe,top:we},title:Oe.createElement("div",{style:{cursor:"move"},onMouseDown:et},"\u8F93\u5165\u516C\u5F0F"),open:Ie,onOk:()=>{const tt=se.current.getData();de.current.setValue(tt),Ge(tt),Re(!1)},onCancel:()=>{Re(!1)},destroyOnClose:!0,className:"markdown-popup-form"},Oe.createElement(yt.Z,{value:Te,ref:se,onChange:Ge,showSaveButton:!1})))});ai.Z=at},41588:function(Un,ai,Le){"use strict";var ue=Le(59301),Ke=Le(77019),ft=Le(5269),yt=Le(20554),mt=Le(99571),Oe=Le(85149),at=Le(88010),Ct=Le(48136),dt=Le(59301);const Ge=(0,ue.forwardRef)(({callback:Rt,showSaveButton:ot,value:At=""},Te)=>{const ne=(0,ue.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:dt.createElement(Ke.Z,{className:at.Z.lists,gutter:[10,10]},te.map((we,be)=>dt.createElement(ft.Z,{flex:"110px",className:at.Z.item},dt.createElement("div",null,dt.createElement(Oe.Z,{value:`$$${we.value}$$`}),we.name),dt.createElement("div",{className:at.Z.children},we.children.map((Ie,Re)=>dt.createElement("div",{key:Re},dt.createElement("h1",null,Ie.name),dt.createElement(Ke.Z,{gutter:[10,10]},Ie.data.map((rt,et)=>dt.createElement(ft.Z,{key:et,onClick:()=>se(rt),className:at.Z.diamond},dt.createElement(Oe.Z,{value:"`$$"+rt.value+"$$`"}))))))))))},{key:"2",label:"\u516C\u5F0F\u6A21\u677F",children:dt.createElement(Ke.Z,{className:at.Z.lists,gutter:[10,10]},de.map((we,be)=>dt.createElement(ft.Z,{flex:"110px",className:at.Z.item},dt.createElement("div",null,dt.createElement(Oe.Z,{value:"`$$"+we.value+"$$`"}),we.name),dt.createElement("div",{className:at.Z.children},we.children.map((Ie,Re)=>dt.createElement("div",{key:Re},Ie.name&&dt.createElement("h1",null,Ie.name),dt.createElement(Ke.Z,{gutter:[10,10]},Ie.data.map((rt,et)=>dt.createElement(ft.Z,{key:et,onClick:()=>se(rt),className:at.Z.diamond},dt.createElement(Oe.Z,{value:"`$$"+rt.value+"$$`"}))))))))))}],ye=()=>{var we=document.createElement("div");we.innerHTML=ne.current.getValue();var be=we.innerText;return Rt&&Rt(be),be};return(0,ue.useImperativeHandle)(Te,()=>({getData:ye})),dt.createElement("div",{className:at.Z.mathWrap},dt.createElement(yt.default,{defaultActiveKey:"1",items:pe}),dt.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}},At||""),ot&&dt.createElement("div",{className:at.Z.button},dt.createElement(mt.ZP,{size:"large",onClick:ye,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))});ai.Z=Ge},8797:function(Un,ai,Le){"use strict";var ue=Le(59301),Ke=Le(93314),ft=Le(99571),yt=Object.defineProperty,mt=Object.defineProperties,Oe=Object.getOwnPropertyDescriptors,at=Object.getOwnPropertySymbols,Ct=Object.prototype.hasOwnProperty,dt=Object.prototype.propertyIsEnumerable,Ge=(Te,ne,te)=>ne in Te?yt(Te,ne,{enumerable:!0,configurable:!0,writable:!0,value:te}):Te[ne]=te,Rt=(Te,ne)=>{for(var te in ne||(ne={}))Ct.call(ne,te)&&Ge(Te,te,ne[te]);if(at)for(var te of at(ne))dt.call(ne,te)&&Ge(Te,te,ne[te]);return Te},ot=(Te,ne)=>mt(Te,Oe(ne));const At=({img:Te,buttonProps:ne={},styles:te={},customText:de,ButtonText:se,ButtonClick:pe,Buttonclass:ye,ButtonTwo:we,imgStyles:be,loading:Ie=!1,className:Re=""})=>ue.createElement("section",{className:`tc animated fadeIn ${Re}`,style:Rt({color:"#999",margin:"100px auto",visibility:Ie?"hidden":"visible"},te)},ue.createElement("img",{src:Te||Ke,style:ot(Rt({},be),{pointerEvents:"none",userSelect:"none"})}),ue.createElement("p",{className:"mt20 font14"},de||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),se&&ue.createElement(ft.ZP,Rt({className:ye,onClick:pe},ne),se),we&&we);ai.Z=At},23210:function(Un,ai,Le){"use strict";Le.d(ai,{Z:function(){return ye}});var ue=Le(59301),Ke={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},ft=Le(99571),yt=Le(70557),mt=Le(23954),Oe=Le(25399),at=Le(955),Ct=Le(94941),dt=Le(8797),Ge=Le(3294),Rt=Le(19381),ot=Le(59301),At=Object.defineProperty,Te=Object.getOwnPropertySymbols,ne=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable,de=(we,be,Ie)=>be in we?At(we,be,{enumerable:!0,configurable:!0,writable:!0,value:Ie}):we[be]=Ie,se=(we,be)=>{for(var Ie in be||(be={}))ne.call(be,Ie)&&de(we,Ie,be[Ie]);if(Te)for(var Ie of Te(be))te.call(be,Ie)&&de(we,Ie,be[Ie]);return we},pe=(we,be,Ie)=>new Promise((Re,rt)=>{var et=tt=>{try{ut(Ie.next(tt))}catch(wt){rt(wt)}},Ye=tt=>{try{ut(Ie.throw(tt))}catch(wt){rt(wt)}},ut=tt=>tt.done?Re(tt.value):Promise.resolve(tt.value).then(et,Ye);ut((Ie=Ie.apply(we,be)).next())}),ye=({editOffice:we="view",data:be,theme:Ie,type:Re,filename:rt,monacoEditor:et,className:Ye,style:ut,close:tt,onClose:wt,hasMask:St,disabledDownload:Lt,onImgDimensions:mn,showNodata:$t,recordInfo:Pn})=>{const[Ot,ct]=(0,ue.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[nt,gn]=(0,ue.useState)(""),[oi,zn]=(0,ue.useState)(),Ht=window.ENV==="build"?"/react/build":"",Fn=location.host.startsWith("localhost")?Ge.Z.PROXY_SERVER:Ge.Z.API_SERVER,ii=10*(1024*1024),Wt=(0,ue.useRef)();be!=null&&be.startsWith("/api")&&Re!=="txt"&&(be=Ge.Z.API_SERVER+be);const Hn=je=>je.substring(je.lastIndexOf("/")+1).split(".").pop();rt&&et&&(et.filename=rt),(0,ue.useEffect)(()=>{var je,Me;const Ee=(Me=(je=document.cookie)==null?void 0:je.replace(/\s/g,""))==null?void 0:Me.split(";");Ee==null||Ee.map(De=>{let We=De.split("=");We[0]==="_educoder_session"&&gn(We[1])})},[]),(0,ue.useEffect)(()=>{Re==="office"&&(be.indexOf("bigfilescdn.")>-1||be.indexOf("bigfiles1")>-1?zn({url:be,fileType:Hn(be),model:be.indexOf("model=edit")?"edit":"view"}):lt())},[Re,be]);const lt=()=>pe(void 0,null,function*(){console.log("data:",be);let je=be;be.startsWith("http")||(je=location.origin+je);let Me=new URL(je).pathname.split("/").pop();const Ee=yield(0,Ct.gJ)({attachment_id:Me});Ee.url=Fn+Ee.url,zn(Ee)}),An=()=>{if(be.startsWith("http")||be.startsWith("blob:")){Ni();return}(0,at.Sv)(rt||"educoder",be,rt)},Ni=()=>{Pn&&(0,Rt.fc)({id:Pn==null?void 0:Pn.id,watch_type:1,course_id:Pn==null?void 0:Pn.course_id}),(0,at.Nd)(rt||"educoder",decodeURIComponent(be))};return ot.createElement("div",{style:se({},ut||{}),className:`${St&&Ke.bgBlack} ${Re?Ke.wrp:"hide"}`},tt&&ot.createElement("div",{className:Ke.close,ref:Wt},!!mn&&ot.createElement(Oe.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>Wt.current},ot.createElement("span",{onClick:()=>{wt(),mn()}},ot.createElement("i",{className:"icon-yulanpizhu"}))),!Lt&&ot.createElement(Oe.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>Wt.current},ot.createElement("span",{onClick:Ni},ot.createElement("i",{className:"icon-quxiaozhiding"}))),ot.createElement(Oe.Z,{title:"\u5173\u95ED",getPopupContainer:()=>Wt.current},ot.createElement("span",{className:"",onClick:wt},ot.createElement("i",{className:"icon-guanbi1"})))),ot.createElement("div",{className:`${Ke[Ye]} ${Ye} ${Ke.monaco} ${Re==="txt"?"show":"hide"}`},Re==="txt"&&ot.createElement(ot.Fragment,null,ot.createElement(mt.ZP,se({},et)))),Re==="audio"&&ot.createElement("audio",{src:`${(be==null?void 0:be.indexOf("http://"))>-1||(be==null?void 0:be.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${be}`,autoPlay:!0}),Re==="video"&&ot.createElement(ot.Fragment,null,(be==null?void 0:be.indexOf("http"))>-1?ot.createElement("video",{controls:!0,src:`${be}`,autoPlay:!0}):ot.createElement("video",{controls:!0,src:`data:video/mp4;base64,${be}`,autoPlay:!0})),Re==="office"&&oi&&ot.createElement("iframe",{src:`${Ht}/office.html?key=${oi.key}&url=${btoa(oi.url)}&callbackUrl=${Fn+(oi.callbackUrl||"")}&fileType=${oi.fileType}&title=${oi.title||""}&model=${we}&officeServer=${Ge.Z.ONLYOFFICE}&disabledDownload=${!!Lt}`}),Re==="html"&&ot.createElement("iframe",{src:be+"&disposition=inline"}),Re==="pdf"&&ot.createElement("iframe",{src:`${Ht}/js/pdfview/index.html?filename=${rt||"educoder.pdf"}&url=${encodeURIComponent(be)}&disabledDownload=${!!Lt}`}),Re==="image"&&ot.createElement("img",{src:`${(be==null?void 0:be.indexOf("http://"))>-1||(be==null?void 0:be.indexOf("https://"))>-1?"":"data:image/png;base64,"}${be}`}),(Re==="other"||Re==="download")&&ot.createElement(ot.Fragment,null,$t?ot.createElement(dt.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:ot.createElement(ft.ZP,{icon:ot.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:An,disabled:Lt},"\u4E0B\u8F7D")}):ot.createElement(ft.ZP,{type:"primary",size:"middle",onClick:An,disabled:Lt},ot.createElement(yt.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")))}},90502:function(Un,ai,Le){"use strict";Le.d(ai,{t:function(){return Ee}});var ue=Le(59301),Ke=Le(37568),ft=Le(28284),yt=Le(62957),mt=Le(77019),Oe=Le(5269),at=Le(71051),Ct=Le(82326),dt=Le(47889),Ge=Le(41984),Rt=Le(89070),ot=Le(43809),At=Le(6767),Te=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(99064),pe=Le(88264),ye=Le(12290),we=Le(56102),be=Le(74440),Ie=Le(59301),Re=Object.defineProperty,rt=Object.defineProperties,et=Object.getOwnPropertyDescriptors,Ye=Object.getOwnPropertySymbols,ut=Object.prototype.hasOwnProperty,tt=Object.prototype.propertyIsEnumerable,wt=(De,We,Ae)=>We in De?Re(De,We,{enumerable:!0,configurable:!0,writable:!0,value:Ae}):De[We]=Ae,St=(De,We)=>{for(var Ae in We||(We={}))ut.call(We,Ae)&&wt(De,Ae,We[Ae]);if(Ye)for(var Ae of Ye(We))tt.call(We,Ae)&&wt(De,Ae,We[Ae]);return De},Lt=(De,We)=>rt(De,et(We)),mn=(De,We,Ae)=>new Promise((Je,Nt)=>{var fn=Jt=>{try{Ft(Ae.next(Jt))}catch(jt){Nt(jt)}},vn=Jt=>{try{Ft(Ae.throw(Jt))}catch(jt){Nt(jt)}},Ft=Jt=>Jt.done?Je(Jt.value):Promise.resolve(Jt.value).then(fn,vn);Ft((Ae=Ae.apply(De,We)).next())}),Pn=({buttonProps:De,buttonText:We,form:Ae,hackIdentifier:Je="",answerKey:Nt,data:fn})=>{const[vn,Ft]=(0,ue.useState)(!1),[Jt,jt]=(0,ue.useState)(!1),[pn,jn]=(0,ue.useState)(!1),[Nn,Mn]=(0,ue.useState)({}),[fr,nn]=(0,ue.useState)(""),[tn,hn]=(0,ue.useState)(""),di=(0,ue.useRef)(Je),Sn=(0,ue.useRef)(""),Kt=(0,ue.useRef)(!1);(0,ue.useEffect)(()=>{pn&&Ii()},[pn]),(0,ue.useEffect)(()=>()=>{sessionStorage.removeItem("projectFill")},[]);const gi=()=>new Date().getTime(),Vi=fn==null?void 0:fn.code,Pi=()=>{var In,si;let Ti=Vi?fn==null?void 0:fn.code:(In=Ae.getFieldValue("hack_codes"))==null?void 0:In.code,Oi=Vi?fn==null?void 0:fn.answer_content:Ae.getFieldValue(Nt),zi=Vi?fn==null?void 0:fn.input:(si=Ae.getFieldValue("hack_sets"))==null?void 0:si.input;Oi==null||Oi.forEach(xr=>{const Ce=xr.value||xr.answer_text||"";Ti=Ti.replace(/(@▁@|@▁▁@)/,Ce)}),hn(zi),nn(Ti),Mn({}),jn(!0)},Ii=()=>mn(void 0,null,function*(){var In,si,Ti,Oi;const zi=gi(),xr=Vi?fn==null?void 0:fn.time_limit:(In=Ae.getFieldsValue())==null?void 0:In.hack.time_limit,Ce=Vi?(si=fn==null?void 0:fn.answer_content)==null?void 0:si.length:(Oi=(Ti=Ae.getFieldsValue())==null?void 0:Ti.standard_answers)==null?void 0:Oi.length;Ft(!0),yield(0,pe.bM)(Sn.current,{test_hack_code:fr,test_input:tn});function _n(){return mn(this,null,function*(){const{status:ci,data:ar}=yield(0,pe.rX)(Sn.current,"submit"),$r=gi()-zi>(xr+3)*1e3*Ce;if(Kt.current){if($r){At.ZP.error("\u8C03\u8BD5\u4EE3\u7801\u8D85\u65F6"),Ft(!1);return}if(ci===0){Ft(!1),Mn(Lt(St({},ar),{showText:!0}));return}setTimeout(_n,1e3)}})}_n()}),Fr=()=>mn(void 0,null,function*(){var In,si,Ti,Oi,zi,xr,Ce;if(!fn){try{yield Ae.validateFields()}catch(_r){(Ti=(si=(In=_r==null?void 0:_r.errorFields)==null?void 0:In[0])==null?void 0:si.name)!=null&&Ti.includes("standard_answers")?At.ZP.error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"):At.ZP.error(_r.errorFields[0].errors[0]),Ae.scrollToField(_r.errorFields[0].name,{behavior:"smooth",block:"center"});return}jt(!0);let ci="";const ar=Ae.getFieldsValue();di.current?ci=yield(0,se.ZP)(`/api/problems/${di.current}.json`,{method:"put",body:Lt(St({},ar),{hack:Lt(St({},ar==null?void 0:ar.hack),{sub_discipline_id:(Ce=(xr=ar==null?void 0:ar.hack)==null?void 0:xr.sub_discipline_id)==null?void 0:Ce[1],difficult:ar.difficulty,item_banks_group_id:ar.item_banks_group_id}),hack_codes:Lt(St({},ar.hack_codes),{code:te.Base64.encode(ar.hack_codes.code)}),update_hack_sets:[St({},ar.hack_sets)],is_blank:!0,item_type:"BPROGRAM"})}):(ci=yield(0,se.ZP)("/api/problems.json",{method:"post",body:Lt(St({},ar),{hack:Lt(St({},ar==null?void 0:ar.hack),{sub_discipline_id:(zi=(Oi=ar==null?void 0:ar.hack)==null?void 0:Oi.sub_discipline_id)==null?void 0:zi[1],difficult:ar.difficulty,item_banks_group_id:ar.item_banks_group_id}),hack_codes:Lt(St({},ar.hack_codes),{code:te.Base64.encode(ar.hack_codes.code)}),hack_sets:[St({},ar.hack_sets)],is_blank:!0,item_type:"BPROGRAM"})}),di.current=ci==null?void 0:ci.identifier,sessionStorage.projectFill=ci==null?void 0:ci.identifier)}const _n=yield(0,se.ZP)(`/api/problems/${di.current}/start.json`,{method:"get"});if((_n==null?void 0:_n.status)===0){Sn.current=_n==null?void 0:_n.identifier,Kt.current=!0,jt(!1),Pi();return}jt(!1)}),$n=In=>{const{status:si,error_msg:Ti,execute_time:Oi,output:zi,input:xr,expected_output:Ce}=In;let _n=null;switch(si){case be.h.OK:_n=Ie.createElement(Ie.Fragment,null,Ie.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",Oi/1e3,"\u79D2"),Ie.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A\u8C03\u8BD5\u901A\u8FC7"));break;case be.h.NOMATCH:_n=Ie.createElement(Ie.Fragment,null,Ie.createElement("div",null,"\u8F93\u5165\uFF1A"),Ie.createElement("pre",{style:{fontFamily:"initial"}},xr),Ie.createElement("div",null,"\u8F93\u51FA\uFF1A"),Ie.createElement("pre",{style:{fontFamily:"initial"}},zi&&te.Base64.decode(zi)),Ie.createElement("div",null,"\u9884\u671F\u8F93\u51FA\uFF1A"),Ie.createElement("pre",{style:{fontFamily:"initial"}},Ce&&te.Base64.decode(Ce)));break;case be.h.EXECUTEFAILURE:_n=Ie.createElement(Ie.Fragment,null,Ie.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",Ie.createElement("pre",null,xr)),Ie.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),Ie.createElement("pre",{className:"error"},te.Base64.decode(Ti)));break;case be.h.COMPILEFAILURE:_n=Ie.createElement(Ie.Fragment,null,Ie.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",Ie.createElement("pre",null,xr)),Ie.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),Ie.createElement("pre",{className:"error"},te.Base64.decode(Ti)));break;case be.h.PODFAILURE:_n=Ie.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case be.h.TIMEOUT:_n=Ie.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return Ie.createElement(Ie.Fragment,null," ",_n," ")};return Ie.createElement("div",null,Ie.createElement(Te.ZP,Lt(St({loading:Jt},De),{onClick:Fr}),We),Ie.createElement(yt.default,{open:pn,title:"\u8C03\u8BD5\u4EE3\u7801",destroyOnClose:!0,width:1200,okText:"\u8FD0\u884C\u6D4B\u8BD5",confirmLoading:vn,cancelButtonProps:{style:{display:"none"}},onOk:()=>Ii(),onCancel:()=>{Kt.current=!1,jn(!1)}},Ie.createElement("div",{className:de.result},Ie.createElement("div",{className:de.left},Ie.createElement("div",{className:"mb20"},Ie.createElement("span",{className:"c-black"},"\u6267\u884C\u4EE3\u7801"),!fn&&Ie.createElement(we.CopyToClipboard,{text:fr,onCopy:()=>At.ZP.success("\u590D\u5236\u6210\u529F")},Ie.createElement("span",{style:{float:"right"},className:"current c-light-primary"},Ie.createElement("i",{className:"iconfont icon-fuzhi8 mr5"}),"\u590D\u5236"))),Ie.createElement(ye.Z,{height:510,className:"mb0",hidetoolBar:!0,defaultValue:fr,onChange:In=>nn(In)})),Ie.createElement("div",{className:de.right},Ie.createElement("div",{className:"c-black mb20"},"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B"),Ie.createElement("div",{className:de.box},Ie.createElement("div",{className:de.li},Ie.createElement(Ke.default.TextArea,{placeholder:"\u8BF7\u8F93\u5165",value:tn,onChange:In=>hn(In.target.value),bordered:!1,style:{height:180}}))),Ie.createElement("div",{className:"c-black mb20 mt30"},"\u4EE3\u7801\u6267\u884C\u7ED3\u679C"),Ie.createElement("div",{className:de.box},Ie.createElement(ne.Z,{spinning:vn,tip:"\u4EE3\u7801\u6267\u884C\u4E2D"},Ie.createElement("div",{className:de.li,style:{height:196,overflow:"auto",padding:10}},$n(Nn))))))))},Ot=Le(87169),ct=Le(59301),nt=Object.defineProperty,gn=Object.defineProperties,oi=Object.getOwnPropertyDescriptors,zn=Object.getOwnPropertySymbols,Ht=Object.prototype.hasOwnProperty,Fn=Object.prototype.propertyIsEnumerable,Cn=(De,We,Ae)=>We in De?nt(De,We,{enumerable:!0,configurable:!0,writable:!0,value:Ae}):De[We]=Ae,ii=(De,We)=>{for(var Ae in We||(We={}))Ht.call(We,Ae)&&Cn(De,Ae,We[Ae]);if(zn)for(var Ae of zn(We))Fn.call(We,Ae)&&Cn(De,Ae,We[Ae]);return De},Wt=(De,We)=>gn(De,oi(We)),Hn=(De,We)=>{var Ae={};for(var Je in De)Ht.call(De,Je)&&We.indexOf(Je)<0&&(Ae[Je]=De[Je]);if(De!=null&&zn)for(var Je of zn(De))We.indexOf(Je)<0&&Fn.call(De,Je)&&(Ae[Je]=De[Je]);return Ae};const{TextArea:lt}=Ke.default,An=[{title:"C",key:"C"},{title:"C++",key:"C++"},{title:"Python",key:"Python"},{title:"Java",key:"Java"}],Ni=({value:De,onChange:We})=>ct.createElement(Switch,{checked:De,onChange:Ae=>{We(Ae)}}),je="@\u2581@",Me="@\u2581\u2581@",Ee=({questionTitlePlaceholder:De,form:We,scoreByBlank:Ae=!1,hackidentifier:Je,answerKey:Nt})=>{const[fn,vn]=(0,ue.useState)(!1),[Ft,Jt]=(0,ue.useState)(!1),pn=(0,Rt.useParams)().type==="edit",jn=(Sn,Kt)=>{const gi=Kt.line;let Vi=0;for(let Ii=0;Ii<gi;Ii++)Vi+=Sn.getLine(Ii).split(je).length-1;for(let Ii=0;Ii<gi;Ii++)Vi+=Sn.getLine(Ii).split(Me).length-1;const Pi=Sn.getLine(gi).substring(0,Kt.ch);return Vi+=Pi.split(je).length-1,Vi+=Pi.split(Me).length-1,Vi},Nn=(Sn,Kt,gi,Vi)=>{const Pi=Sn.getRange(Kt.from,Kt.to);let Ii=0;if(Kt.text.forEach(Fr=>{Ii+=Fr.split(je).length-1}),Kt.text.forEach(Fr=>{Ii+=Fr.split(Me).length-1}),Kt.origin!=="setValue"){if(Pi&&(Pi.indexOf(je)!==-1||Pi.indexOf(Me)!==-1)){const Fr=Pi.split(je).length-1+Pi.split(Me).length-1,$n=jn(Sn,Kt.from);if(console.log(`\u5220\u9664${Fr}\u4E2A\uFF0C \u524D\u9762\u6709${$n}\u4E2A\uFF0C\u65B0\u589E${Ii}\u4E2A`),Fr>1){const In=Array.from({length:Fr},(si,Ti)=>$n+Ti);Vi(In)}else Vi($n)}else if(Ii>0){const Fr=jn(Sn,Kt.from);console.log(`\u65B0\u589E${Ii}\u4E2A\uFF0C\u4E4B\u524D\u6709${Fr}\u4E2A`),gi(Ii,Fr)}}},Mn=()=>{const Sn=We.getFieldValue(Nt);We.setFieldsValue({[Nt]:Sn==null?void 0:Sn.map((Kt,gi)=>Wt(ii({},Kt),{position:gi+1}))})},fr=(0,ue.useRef)(),nn=(Sn,Kt)=>{for(let gi=0;gi<Sn;gi++)fr.current({position:null,answer_text:""},Kt+gi);Mn()},tn=(0,ue.useRef)(),hn=Sn=>{tn.current(Sn),Mn()},di=ft.default.useWatch(Nt,We);return ct.createElement("div",{className:ot.Z.wrap},ct.createElement(ft.default.Item,{label:"\u8BD5\u9898\u63CF\u8FF0",name:["hack","description"],style:{display:"table"},className:"w100",labelCol:{span:24},rules:[{required:!0}]},ct.createElement(Ge.h,{scrollId:"name",watch:!0,height:140})),ct.createElement("div",{className:ot.Z.questionTitleEditorWrap},ct.createElement(ft.default.Item,{label:"\u7A0B\u5E8F\u4EE3\u7801",name:["hack_codes","code"],labelCol:{span:24},rules:[{required:!0}]},ct.createElement(Ge.h,{scrollId:"name",watch:!0,height:400,showNullProgramButton:!0,onChange:(Sn,Kt)=>{const gi=We.getFieldValue(Nt);console.log("--preAnswerData",gi,Kt),We.setFieldsValue({[Nt]:gi==null?void 0:gi.map((Vi,Pi)=>{var Ii;return Wt(ii({},Vi),{position:Pi+1,multi_line:(Ii=Kt==null?void 0:Kt[Pi])==null?void 0:Ii.multiLine})})})},placeholder:De,onCMBeforeChange:(Sn,Kt)=>{Nn(Sn,Kt,nn,hn)}}))),ct.createElement(ft.default.List,{name:Nt,rules:[{validator(Sn,Kt){if(!(Kt!=null&&Kt.length))return Promise.reject(new Error("\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"));for(const gi of Kt){const{answer_text:Vi}=gi||{};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()}}]},(Sn,{add:Kt,remove:gi},{errors:Vi})=>(fr.current=Kt,tn.current=gi,ct.createElement(ct.Fragment,null,ct.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},ct.createElement(ft.default.Item,{label:"\u586B\u7A7A\u9879\u7B54\u6848",required:!0,labelCol:{span:24}}),ct.createElement("div",{onClick:()=>{yt.default.warning({title:"\u7ED9\u5206\u8BF4\u660E",icon:null,width:700,centered:!0,content:ct.createElement("div",null,ct.createElement("div",null,"1.\u5B66\u751F\u586B\u5199\u7B54\u6848\u4E4B\u540E\uFF0C\u5FC5\u987B\u63D0\u4EA4\u4EE3\u7801",ct.createElement("span",{style:{color:"#e30000"}},"\u8FDB\u884C\u8BC4\u6D4B"),"\u624D\u80FD\u5F97\u5206\u3002"),ct.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"}},ct.createElement(Ot.Z,{style:{marginRight:3,color:"#3061D0"}}),ct.createElement("span",null," \u7ED9\u5206\u8BF4\u660E"))),Sn.map((Pi,Ii)=>{var Fr=Pi,{key:$n,name:In}=Fr,si=Hn(Fr,["key","name"]),Ti,Oi;return ct.createElement(mt.Z,{className:"mb20",key:$n,align:"middle",wrap:!1},ct.createElement(Oe.Z,{flex:"0 0 auto",className:`${ot.Z.blankIndex}`},"\u586B\u7A7A\u9879",Ii+1),ct.createElement(Oe.Z,{flex:1},ct.createElement(mt.Z,{align:"top",justify:"space-between",wrap:!1},ct.createElement(Oe.Z,null,ct.createElement(ft.default.Item,Wt(ii({},si),{name:[In,"answer_text"],noStyle:!0}),(Ti=di==null?void 0:di[In])!=null&&Ti.multi_line||(Oi=di==null?void 0:di[In])!=null&&Oi.multiLine?ct.createElement(lt,{spellCheck:!1,style:{marginLeft:10,width:550}}):ct.createElement(Ke.default,{style:{marginLeft:10,width:550},className:ot.Z.blankInput,size:"large",maxLength:1e3,onBlur:zi=>{}}))),Ae&&ct.createElement(Oe.Z,{flex:"224px"},ct.createElement(ft.default.Item,Wt(ii({},si),{name:[In,"score"],label:"\u5206\u503C",rules:[{required:!0}]}),ct.createElement(at.Z,{size:"large",className:ot.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5206\u503C"}))))))})))),ct.createElement("div",{onClick:()=>vn(!0)},ct.createElement(ft.default.Item,{name:["hack","analysis"],label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},ct.createElement(Ge.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:fn}))),ct.createElement(ft.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"}]},ct.createElement(Ct.default,{size:"large"},An.map(Sn=>ct.createElement(Ct.default.Option,{key:Sn.title,value:Sn.key}," ",Sn.title)))),ct.createElement(ft.default.Item,{label:"\u6700\u5927\u8BC4\u6D4B\u65F6\u957F\uFF08\u79D2\uFF09",style:{marginTop:30},labelCol:{span:24},required:!0},ct.createElement(ft.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},ct.createElement(at.Z,{precision:0,max:10,min:3,size:"large",style:{width:"97%"}})),ct.createElement("span",{className:"ml10 font14"},"\u79D2")),ct.createElement(ft.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"}]},ct.createElement(dt.ZP.Group,{style:{marginTop:-10}},ct.createElement(dt.ZP,{value:0},"\u4E0D\u5FFD\u7565\u7A7A\u683C"),ct.createElement(dt.ZP,{value:1},"\u5FFD\u7565\u9996\u5C3E\u7A7A\u683C"),ct.createElement(dt.ZP,{value:2},"\u5FFD\u7565\u6240\u6709\u7A7A\u683C"))),ct.createElement(ft.default.Item,{label:"\u6D4B\u8BD5\u7528\u4F8B",required:!0,style:{marginTop:30}}),ct.createElement("div",{style:{background:"#F6F7F9",padding:15}},ct.createElement(ft.default.Item,{label:"\u8F93\u5165",labelCol:{span:24},name:["hack_sets","input"]},ct.createElement(lt,{rows:4})),ct.createElement(ft.default.Item,{label:"\u8F93\u51FA",labelCol:{span:24},name:["hack_sets","output"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8F93\u51FA\u5185\u5BB9"}]},ct.createElement(lt,{rows:4}))),ct.createElement(Pn,{form:We,answerKey:Nt,hackIdentifier:Je,buttonText:"\u8FD0\u884C\u8C03\u8BD5",buttonProps:{ghost:!0,icon:ct.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"}}}))}},65357:function(Un,ai,Le){"use strict";Le.d(ai,{u:function(){return Ie}});var ue=Le(59301),Ke=Le(77019),ft=Le(5269),yt=Le(25399),mt=Le(28284),Oe=Le(43809),at=Le(32134),Ct=Le(12893),dt=Le(41984),Ge=Le(59301),Rt=Object.defineProperty,ot=Object.defineProperties,At=Object.getOwnPropertyDescriptors,Te=Object.getOwnPropertySymbols,ne=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable,de=(Re,rt,et)=>rt in Re?Rt(Re,rt,{enumerable:!0,configurable:!0,writable:!0,value:et}):Re[rt]=et,se=(Re,rt)=>{for(var et in rt||(rt={}))ne.call(rt,et)&&de(Re,et,rt[et]);if(Te)for(var et of Te(rt))te.call(rt,et)&&de(Re,et,rt[et]);return Re},pe=(Re,rt)=>ot(Re,At(rt)),ye=(Re,rt)=>{var et={};for(var Ye in Re)ne.call(Re,Ye)&&rt.indexOf(Ye)<0&&(et[Ye]=Re[Ye]);if(Re!=null&&Te)for(var Ye of Te(Re))rt.indexOf(Ye)<0&&te.call(Re,Ye)&&(et[Ye]=Re[Ye]);return et};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"],be=({value:Re,onChange:rt,choiceTextKey:et,answerKey:Ye,index:ut,isEdit:tt,setInputActive:wt,form:St,choiceOptionsPath:Lt,allowChangeMode:mn,showAddIcon:$t,addItem:Pn,deleteItem:Ot})=>{console.log(Re,"value");const ct=(Re==null?void 0:Re[Ye])===1,nt=()=>{const oi=St.getFieldValue(Lt);St.setFieldValue(Lt,oi.map(zn=>pe(se({},zn),{[Ye]:0})))},gn=()=>{ct?rt(pe(se({},Re),{[Ye]:0})):(mn||nt(),rt(pe(se({},Re),{[Ye]:1})))};return Ge.createElement(Ke.Z,{className:Oe.Z.choiceWrap,align:"middle",wrap:!1},Ge.createElement(ft.Z,{onClick:gn,className:`${Oe.Z.choiceIndex} ${ct?Oe.Z.activeAnswer:""}`},we[ut]),Ge.createElement(ft.Z,{flex:1,className:`${Oe.Z.editorWrap} ml15`,onClick:wt},Ge.createElement(dt.x,{height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",isEdit:tt,value:Re==null?void 0:Re[et],onChange:oi=>{rt(pe(se({},Re),{[et]:oi}))}})),Ge.createElement(ft.Z,{flex:"0 0 auto",className:"ml15"},Ge.createElement("div",{onClick:gn,className:`${Oe.Z.setAnswerBtn} ${ct?Oe.Z.activeAnswer:""}`},ct?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")),Ge.createElement(ft.Z,{className:Oe.Z.actionWrapper},Ge.createElement(yt.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},Ge.createElement(at.Z,{className:Oe.Z.addIcon,onClick:Pn,style:{visibility:$t?"visible":"hidden"}})),Ge.createElement(yt.Z,{title:"\u5220\u9664"},Ge.createElement(Ct.Z,{className:Oe.Z.deleteIcon,onClick:Ot,style:{visibility:ut>1?"visible":"hidden"}}))))},Ie=({questionTitlePlaceholder:Re,titleKey:rt,choiceKey:et,analysisKey:Ye,choiceTextKey:ut,answerKey:tt,choiceOptionsPath:wt,allowChangeMode:St=!0,form:Lt,showAnalysis:mn=!0})=>{const[$t,Pn]=(0,ue.useState)(),[Ot,ct]=(0,ue.useState)(!1);return Ge.createElement("div",{className:Oe.Z.wrap},Ge.createElement("div",{className:Oe.Z.questionTitleEditorWrap},Ge.createElement(mt.default.Item,{label:"\u9898\u5E72",name:rt,labelCol:{span:24},rules:[{required:!0}]},Ge.createElement(dt.h,{scrollId:Array.isArray(rt)?rt.join("_"):`${rt}`,watch:!0,height:140,placeholder:Re}))),Ge.createElement(mt.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}}),Ge.createElement(mt.default.List,{name:et,rules:[{validator(nt,gn){const oi=gn.some(Ht=>Ht[tt]===1),zn=gn.findIndex(Ht=>{var Fn;return((Fn=Ht[ut])==null?void 0:Fn.length)<=0});return zn!==-1?Promise.reject(new Error(`\u8BF7\u5148\u8F93\u5165${we[zn]}\u9009\u9879\u7684\u5185\u5BB9`)):oi?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},(nt,{add:gn,remove:oi})=>Ge.createElement("div",{id:Array.isArray(wt)?wt.join("_"):`${wt}`},nt.map((zn,Ht)=>{var Fn=zn,{key:Cn,name:ii}=Fn,Wt=ye(Fn,["key","name"]);const Hn=$t===Cn,lt=()=>{Pn(Cn)},An=Ht<7&&Ht===nt.length-1,Ni=()=>gn({[ut]:"",[tt]:0}),je=()=>oi(ii);return Ge.createElement(mt.default.Item,pe(se({},Wt),{key:Cn,name:ii,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[Ht]}\u9009\u9879\u7684\u5185\u5BB9`))}}]}),Ge.createElement(be,{choiceTextKey:ut,answerKey:tt,index:Ht,isEdit:Hn,setInputActive:lt,form:Lt,choiceOptionsPath:wt,allowChangeMode:St,showAddIcon:An,addItem:Ni,deleteItem:je}))}),nt.length<8&&Ge.createElement("div",{className:`${Oe.Z.addBtn} mb30`,onClick:()=>gn({[ut]:"",[tt]:0})},"\u6DFB\u52A0\u9009\u9879"))),mn&&Ge.createElement("div",{onClick:()=>ct(!0)},Ge.createElement(mt.default.Item,{name:Ye,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},Ge.createElement(dt.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Ot}))))}},70472:function(Un,ai,Le){"use strict";Le.d(ai,{u:function(){return St}});var ue=Le(59301),Ke=Le(62957),ft=Le(77019),yt=Le(5269),mt=Le(37568),Oe=Le(25399),at=Le(71411),Ct=Le(28284),dt=Le(47889),Ge=Le(71051),Rt=Le(41984),ot=Le(12893),At=Le(61485),Te=Le(43809),ne=Le(59879),te=Le(59301),de=Object.defineProperty,se=Object.defineProperties,pe=Object.getOwnPropertyDescriptors,ye=Object.getOwnPropertySymbols,we=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable,Ie=(Lt,mn,$t)=>mn in Lt?de(Lt,mn,{enumerable:!0,configurable:!0,writable:!0,value:$t}):Lt[mn]=$t,Re=(Lt,mn)=>{for(var $t in mn||(mn={}))we.call(mn,$t)&&Ie(Lt,$t,mn[$t]);if(ye)for(var $t of ye(mn))be.call(mn,$t)&&Ie(Lt,$t,mn[$t]);return Lt},rt=(Lt,mn)=>se(Lt,pe(mn)),et=(Lt,mn)=>{var $t={};for(var Pn in Lt)we.call(Lt,Pn)&&mn.indexOf(Pn)<0&&($t[Pn]=Lt[Pn]);if(Lt!=null&&ye)for(var Pn of ye(Lt))mn.indexOf(Pn)<0&&be.call(Lt,Pn)&&($t[Pn]=Lt[Pn]);return $t};const Ye=({value:Lt,onChange:mn})=>{const $t=Ot=>{Ke.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:Te.Z.modal,onOk:()=>{const ct=[...Lt];ct.splice(Ot,1),mn(ct)}})},Pn=()=>{const Ot=[...Lt];Ot.push(""),mn(Ot)};return te.createElement(ft.Z,{className:"ml20"},te.createElement(yt.Z,{flex:1},Lt==null?void 0:Lt.map((Ot,ct)=>te.createElement(ft.Z,{key:`${Ot}_${ct}`,className:"mb20"},te.createElement(mt.default.TextArea,{style:{flex:1,minHeight:44},defaultValue:Ot,autoSize:{maxRows:3},maxLength:1e3,onBlur:nt=>{const gn=[...Lt],oi=nt.target.value.trim();gn[ct]=oi,mn(gn)}}),te.createElement(Oe.Z,{title:"\u5220\u9664"},te.createElement(ot.Z,{className:Te.Z.deleteIcon,style:{marginLeft:15,visibility:ct>0?"visible":"hidden"},onClick:()=>$t(ct)}))))),te.createElement(yt.Z,null,te.createElement("div",{className:`${Te.Z.addBtn}`,onClick:()=>{Pn()}},"\u65B0\u589E\u7B54\u6848")))},ut=({value:Lt,onChange:mn})=>{const $t=Ot=>{Ke.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:Te.Z.modal,onOk:()=>{const ct=[...Lt];ct.splice(Ot,1),mn(ct)}})},Pn=()=>{const Ot=[...Lt];Ot.push(""),mn(Ot)};return te.createElement(ft.Z,{className:"ml20"},te.createElement(yt.Z,{flex:1},Lt==null?void 0:Lt.map((Ot,ct)=>te.createElement(ft.Z,{key:`${Ot}_${ct}`,align:"middle",className:"mb20"},te.createElement(ne.Z,{value:Ot,style:{flex:1},onChange:nt=>{const gn=[...Lt];gn[ct]=nt,mn(gn)}}),te.createElement(Oe.Z,{title:"\u5220\u9664"},te.createElement(ot.Z,{className:Te.Z.deleteIcon,style:{marginLeft:15,visibility:ct>0?"visible":"hidden"},onClick:()=>$t(ct)}))))),te.createElement(yt.Z,null,te.createElement("div",{className:`${Te.Z.addBtn}`,onClick:()=>{Pn()}},"\u65B0\u589E\u7B54\u6848")))},tt=({value:Lt=!0,onChange:mn})=>te.createElement(at.Z,{checked:!Lt,onChange:$t=>{mn(!$t)}}),wt="\u2581",St=({questionTitlePlaceholder:Lt,form:mn,scoreByBlank:$t=!1,answerKey:Pn})=>{const[Ot,ct]=(0,ue.useState)(!1),nt=(Wt,Hn)=>{const lt=Hn.line;let An=0;for(let je=0;je<lt;je++)An+=Wt.getLine(je).split(wt).length-1;const Ni=Wt.getLine(lt).substring(0,Hn.ch);return An+=Ni.split(wt).length-1,An},gn=(Wt,Hn,lt,An)=>{const Ni=Wt.getRange(Hn.from,Hn.to);let je=0;if(Hn.text.forEach(Me=>{je+=Me.split(wt).length-1}),Hn.origin!=="setValue"){if(Ni&&Ni.indexOf(wt)!==-1){const Me=Ni.split(wt).length-1,Ee=nt(Wt,Hn.from);if(console.log(`\u5220\u9664${Me}\u4E2A\uFF0C \u524D\u9762\u6709${Ee}\u4E2A\uFF0C\u65B0\u589E${je}\u4E2A`),Me>1){const De=Array.from({length:Me},(We,Ae)=>Ee+Ae);An(De)}else An(Ee)}else if(je>0){const Me=nt(Wt,Hn.from);console.log(`\u65B0\u589E${je}\u4E2A\uFF0C\u4E4B\u524D\u6709${Me}\u4E2A`),lt(je,Me)}}},oi=()=>{const Wt=mn.getFieldValue(Pn);mn.setFieldsValue({[Pn]:Wt.map((Hn,lt)=>rt(Re({},Hn),{position:lt+1}))})},zn=(0,ue.useRef)(),Ht=(Wt,Hn)=>{for(let lt=0;lt<Wt;lt++)zn.current({position:null,answer_text:[""],model:1},Hn+lt);oi()},Fn=(0,ue.useRef)(),Cn=Wt=>{Fn.current(Wt),oi()},ii=Ct.default.useWatch(Pn,mn);return te.createElement("div",{className:Te.Z.wrap},te.createElement("div",{className:Te.Z.questionTitleEditorWrap},te.createElement(Ct.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},te.createElement(Rt.h,{scrollId:"name",watch:!0,height:140,placeholder:Lt,showNullButton:!0,onCMBeforeChange:(Wt,Hn)=>{gn(Wt,Hn,Ht,Cn)}}))),te.createElement(Ct.default.List,{name:Pn,rules:[{validator(Wt,Hn){if(!(Hn!=null&&Hn.length))return Promise.reject(new Error("\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879"));for(const lt of Hn){const{answer_text:An}=lt||{};if(An!=null&&An.some(Ni=>(Ni==null?void 0:Ni.length)===0))return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"))}return Promise.resolve()}}]},(Wt,{add:Hn,remove:lt},{errors:An})=>(zn.current=Hn,Fn.current=lt,te.createElement(te.Fragment,null,te.createElement(Ct.default.Item,{label:te.createElement("span",null,"\u586B\u7A7A\u9879\u7B54\u6848",!(Wt!=null&&Wt.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}}),Wt.map((Ni,je)=>{var Me=Ni,{key:Ee,name:De}=Me,We=et(Me,["key","name"]),Ae,Je;return te.createElement("div",{style:{marginBottom:10},key:Ee},te.createElement(ft.Z,{className:"mb20",align:"middle",wrap:!1},te.createElement(yt.Z,{style:{marginRight:10},flex:"0 0 auto",className:`${Te.Z.blankIndex}`},"\u586B\u7A7A\u9879",je+1),te.createElement(Ct.default.Item,rt(Re({},We),{name:[De,"model"],noStyle:!0}),te.createElement(dt.ZP.Group,{onChange:()=>{const Nt=mn.getFieldValue(Pn);mn.setFieldsValue({[Pn]:Nt.map((fn,vn)=>rt(Re({},fn),{answer_text:De===vn?[""]:fn.answer_text}))})}},te.createElement(dt.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(At.Z,null))),te.createElement(dt.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(At.Z,null)))))),te.createElement(ft.Z,{style:{marginLeft:20},align:"middle",wrap:!1},te.createElement(yt.Z,{flex:1},te.createElement(ft.Z,{align:"top",justify:"space-between",wrap:!1},te.createElement(yt.Z,{flex:1},te.createElement(Ct.default.Item,rt(Re({},We),{name:[De,"answer_text"],noStyle:!0}),((Je=(Ae=mn.getFieldValue(Pn))==null?void 0:Ae[De])==null?void 0:Je.model)===1?te.createElement(Ye,null):te.createElement(ut,null))),$t&&te.createElement(yt.Z,{flex:"224px",style:{margin:"-7px 0 0 20px"}},te.createElement(Ct.default.Item,rt(Re({},We),{name:[De,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:Te.Z.blankInputNumberWrapper}),te.createElement(Ge.Z,{min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5206\u503C"})))),te.createElement(Ct.default.Item,rt(Re({},We),{name:[De,"position"],noStyle:!0}),te.createElement(mt.default,{type:"hidden"})))))})))),te.createElement(ft.Z,{align:"middle"},te.createElement(Ct.default.Item,{name:"downcase",valuePropName:"checked"},te.createElement(at.Z,null)),te.createElement(yt.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),te.createElement(ft.Z,{align:"middle"},te.createElement(Ct.default.Item,{name:"no_space",valuePropName:"checked"},te.createElement(at.Z,null)),te.createElement(yt.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),(ii==null?void 0:ii.length)>1&&te.createElement(ft.Z,{align:"middle",className:(ii==null?void 0:ii.length)>1?"mb30":`${Te.Z.hide}`},te.createElement(Ct.default.Item,{name:"is_ordered"},te.createElement(tt,null)),te.createElement(yt.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:()=>ct(!0)},te.createElement(Ct.default.Item,{name:"analysis",label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},te.createElement(Rt.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Ot}))))}},11832:function(Un,ai,Le){"use strict";Le.d(ai,{Z:function(){return ye}});var ue=Le(59301),Ke=Le(77019),ft=Le(5269),yt=Le(28284),mt=Le(43809),Oe=Le(41984),at=Le(59301),Ct=Object.defineProperty,dt=Object.defineProperties,Ge=Object.getOwnPropertyDescriptors,Rt=Object.getOwnPropertySymbols,ot=Object.prototype.hasOwnProperty,At=Object.prototype.propertyIsEnumerable,Te=(we,be,Ie)=>be in we?Ct(we,be,{enumerable:!0,configurable:!0,writable:!0,value:Ie}):we[be]=Ie,ne=(we,be)=>{for(var Ie in be||(be={}))ot.call(be,Ie)&&Te(we,Ie,be[Ie]);if(Rt)for(var Ie of Rt(be))At.call(be,Ie)&&Te(we,Ie,be[Ie]);return we},te=(we,be)=>dt(we,Ge(be)),de=(we,be)=>{var Ie={};for(var Re in we)ot.call(we,Re)&&be.indexOf(Re)<0&&(Ie[Re]=we[Re]);if(we!=null&&Rt)for(var Re of Rt(we))be.indexOf(Re)<0&&At.call(we,Re)&&(Ie[Re]=we[Re]);return Ie};const se={\u6B63\u786E:"T",\u9519\u8BEF:"F"},pe=({value:we,onChange:be,form:Ie})=>{const Re=(we==null?void 0:we.is_answer)===1,rt=we==null?void 0:we.choice_text,et=()=>{const Ye=Ie.getFieldsValue().choices.map(ut=>({choice_text:ut.choice_text,is_answer:0}));Ie.setFieldsValue({choices:Ye}),be(te(ne({},we),{is_answer:1}))};return at.createElement(Ke.Z,{className:mt.Z.choiceWrap,align:"middle",wrap:!1,style:{marginBottom:"20px"}},at.createElement(ft.Z,{onClick:et,className:`${mt.Z.choiceIndex} ${mt.Z.judgementIndex} ${Re?mt.Z.activeAnswer:""}`},se[rt]),at.createElement(ft.Z,{flex:1,className:`${mt.Z.editorWrap} ml15`},at.createElement("div",{className:`${mt.Z.inputBorder} ${mt.Z.placeholder} ${Re?mt.Z.activeJudgementAnswer:""}`},rt)),at.createElement(ft.Z,{flex:"0 0 auto",className:"ml15"},at.createElement("div",{onClick:et,className:`${mt.Z.setAnswerBtn} ${Re?mt.Z.activeAnswer:""}`},Re?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")))},ye=({questionTitlePlaceholder:we,choiceKey:be,form:Ie})=>{const[Re,rt]=(0,ue.useState)(!1);return at.createElement("div",{className:mt.Z.wrap},at.createElement("div",{className:mt.Z.questionTitleEditorWrap},at.createElement(yt.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(yt.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}},at.createElement(yt.default.List,{name:"choices",rules:[{validator(et,Ye){return Ye.some(tt=>(tt==null?void 0:tt.is_answer)===1)?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},et=>at.createElement("div",{id:"choices"},et.map(Ye=>{var ut=Ye,{key:tt,name:wt}=ut,St=de(ut,["key","name"]);return at.createElement(yt.default.Item,te(ne({},St),{key:tt,name:wt,noStyle:!0}),at.createElement(pe,{form:Ie}))})))),at.createElement("div",{onClick:()=>rt(!0)},at.createElement(yt.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:Re}))))}},41984:function(Un,ai,Le){"use strict";Le.d(ai,{h:function(){return ne},x:function(){return te}});var ue=Le(12290),Ke=Le(43809),ft=Le(85149),yt=Le(59301),mt=Object.defineProperty,Oe=Object.defineProperties,at=Object.getOwnPropertyDescriptors,Ct=Object.getOwnPropertySymbols,dt=Object.prototype.hasOwnProperty,Ge=Object.prototype.propertyIsEnumerable,Rt=(de,se,pe)=>se in de?mt(de,se,{enumerable:!0,configurable:!0,writable:!0,value:pe}):de[se]=pe,ot=(de,se)=>{for(var pe in se||(se={}))dt.call(se,pe)&&Rt(de,pe,se[pe]);if(Ct)for(var pe of Ct(se))Ge.call(se,pe)&&Rt(de,pe,se[pe]);return de},At=(de,se)=>Oe(de,at(se)),Te=(de,se)=>{var pe={};for(var ye in de)dt.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&&Ge.call(de,ye)&&(pe[ye]=de[ye]);return pe};const ne=de=>{var se=de,{value:pe,onChange:ye,scrollId:we}=se,be=Te(se,["value","onChange","scrollId"]);return yt.createElement("div",{id:we||""},yt.createElement(ue.Z,At(ot({},be),{defaultValue:pe,onChange:(Ie,Re)=>{Re!=null&&Re.length?ye(Ie,Re):ye(Ie)}})))},te=({value:de,onChange:se,placeholder:pe,height:ye=140,isEdit:we,miniToolbar:be,watch:Ie=!0})=>we?yt.createElement(ue.Z,{watch:Ie,isFocus:!0,height:ye||void 0,placeholder:pe,defaultValue:de,onChange:se,miniToolbar:be}):yt.createElement("div",{style:{cursor:"pointer"}},de?yt.createElement(ft.Z,{className:Ke.Z.inputBorder,value:de}):yt.createElement("div",{className:`${Ke.Z.inputBorder} ${Ke.Z.placeholder} inputBorderError`},pe))},35173:function(Un,ai,Le){"use strict";Le.d(ai,{W:function(){return ut}});var ue=Le(59301),Ke=Le(6767),ft=Le(96599),yt=Le(28284),mt=Le(71411),Oe=Le(77019),at=Le(5269),Ct=Le(25399),dt=Le(37568),Ge=Le(71051),Rt=Le(43809),ot=Le(41984),At=Le(12290),Te=Le(61485),ne=Object.defineProperty,te=Object.defineProperties,de=Object.getOwnPropertyDescriptors,se=Object.getOwnPropertySymbols,pe=Object.prototype.hasOwnProperty,ye=Object.prototype.propertyIsEnumerable,we=(tt,wt,St)=>wt in tt?ne(tt,wt,{enumerable:!0,configurable:!0,writable:!0,value:St}):tt[wt]=St,be=(tt,wt)=>{for(var St in wt||(wt={}))pe.call(wt,St)&&we(tt,St,wt[St]);if(se)for(var St of se(wt))ye.call(wt,St)&&we(tt,St,wt[St]);return tt},Ie=(tt,wt)=>te(tt,de(wt)),Re=(tt,wt)=>{var St={};for(var Lt in tt)pe.call(tt,Lt)&&wt.indexOf(Lt)<0&&(St[Lt]=tt[Lt]);if(tt!=null&&se)for(var Lt of se(tt))wt.indexOf(Lt)<0&&ye.call(tt,Lt)&&(St[Lt]=tt[Lt]);return St};const rt=tt=>{var wt=tt,{value:St,onChange:Lt}=wt,mn=Re(wt,["value","onChange"]);const $t=Pn=>{Lt([Pn])};return ue.createElement(At.Z,Ie(be({},mn),{defaultValue:St==null?void 0:St[0],onChange:$t}))},et=tt=>{if(!tt)return!1;if(/^s*$/.test(tt)||tt.trim()===""){Ke.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u5168\u4E3A\u7A7A\u683C");return}let wt=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 tt==="|"?(Ke.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},Ye=({value:tt=[],onClose:wt})=>ue.createElement(ft.default,{closable:!0,onClose:wt,className:Rt.Z.keywordTag},ue.createElement("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"}},tt.join(" \u6216 "))),ut=({questionTitlePlaceholder:tt,form:wt,showKeywords:St,isMustKeyWords:Lt=St})=>{const[mn,$t]=(0,ue.useState)(!1),[Pn,Ot]=(0,ue.useState)(""),ct=yt.default.useWatch("use_keywords",wt),nt=yt.default.useWatch("question_score",wt);return ue.createElement("div",{className:Rt.Z.wrap},ue.createElement("div",{className:Rt.Z.questionTitleEditorWrap},ue.createElement(yt.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},ue.createElement(ot.h,{scrollId:"name",watch:!0,height:140,placeholder:tt}))),ue.createElement(yt.default.Item,{label:"\u53C2\u8003\u7B54\u6848",name:"answer_texts",labelCol:{span:24}},ue.createElement(rt,{watch:!0,height:140,placeholder:"\u8BF7\u7F16\u8F91\u53C2\u8003\u7B54\u6848\uFF08\u975E\u5FC5\u586B\uFF09"})),St&&!Lt&&ue.createElement(yt.default.Item,{hidden:!0,name:"use_keywords",valuePropName:"checked"},ue.createElement(mt.Z,{defaultChecked:!0})),St&&Lt&&ue.createElement(Oe.Z,{align:"middle",className:"mb30"},ue.createElement(yt.default.Item,{name:"use_keywords",valuePropName:"checked"},ue.createElement(mt.Z,null)),ue.createElement(at.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),ue.createElement(at.Z,null,ue.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"},ue.createElement(Te.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),(ct||!Lt)&&ue.createElement(yt.default.List,{name:"keywords",rules:[{validator(gn,oi){return Lt?oi!=null&&oi.length?(oi==null?void 0:oi.reduce((Ht,Fn)=>Ht+Fn.score,0))>parseFloat(nt)?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()}}]},(gn,{add:oi,remove:zn})=>ue.createElement(ue.Fragment,null,ue.createElement("div",{className:`${Rt.Z.title} mb10`},Lt?"\u5173\u952E\u8BCD":ue.createElement("span",{style:{color:"#9096A3"}},"\u5224\u5206\u5173\u952E\u8BCD")),ue.createElement(Oe.Z,{align:"middle",className:"font14 mb30"},ue.createElement(at.Z,{flex:1},ue.createElement(dt.default,{value:Pn,onChange:Ht=>{Ot(Ht.target.value)},maxLength:50,allowClear:!0,onPressEnter:Ht=>{var Fn,Cn,ii,Wt;const Hn=`${(Fn=Ht.target)==null?void 0:Fn.value}`,lt=(ii=(Cn=Hn==null?void 0:Hn.split("|"))==null?void 0:Cn.filter(je=>!!je))==null?void 0:ii.map(je=>je==null?void 0:je.trim()),An=wt.getFieldValue("keywords"),Ni=((Wt=An==null?void 0:An.map(je=>je==null?void 0:je.keyword))==null?void 0:Wt.flat())||[];for(const je of lt)if(Ni.includes(je)){Ke.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}et(Hn)&&(oi({keyword:lt,score:1}),Ot(""))},className:Rt.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"})),ue.createElement(at.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),gn.map(Ht=>{var Fn=Ht,{key:Cn,name:ii}=Fn,Wt=Re(Fn,["key","name"]);return ue.createElement(Oe.Z,{key:Cn,className:"mb20",style:{marginRight:148}},ue.createElement(at.Z,{flex:1},ue.createElement(Oe.Z,{align:"middle",justify:"space-between"},ue.createElement(yt.default.Item,Ie(be({},Wt),{name:[ii,"keyword"]}),ue.createElement(Ye,{onClose:()=>zn(ii)})),Lt&&ue.createElement(yt.default.Item,Ie(be({},Wt),{name:[ii,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:Rt.Z.blankInputNumberWrapper}),ue.createElement(Ge.Z,{className:Rt.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))}))),ue.createElement("div",{onClick:()=>$t(!0)},ue.createElement(yt.default.Item,{name:"analysis",label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},ue.createElement(ot.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:mn}))))}},94734:function(Un,ai,Le){"use strict";Le.d(ai,{tc:function(){return Fr.t},uh:function(){return ue.u},rL:function(){return Ii},u8:function(){return ft.u},ZZ:function(){return Ke.Z},Wk:function(){return yt.W}});var ue=Le(65357),Ke=Le(11832),ft=Le(70472),yt=Le(35173),mt=Le(59301),Oe=Le(8848),at=Le(28284),Ct=Le(77019),dt=Le(5269),Ge=Le(71051),Rt=Le(25399),ot=Le(75727),At=Le(43809),Te=Le(12893),ne=Le(41984),te=Le(62957),de=Le(37568),se=Le(71411),pe=Le(59301),ye=Object.defineProperty,we=Object.defineProperties,be=Object.getOwnPropertyDescriptors,Ie=Object.getOwnPropertySymbols,Re=Object.prototype.hasOwnProperty,rt=Object.prototype.propertyIsEnumerable,et=($n,In,si)=>In in $n?ye($n,In,{enumerable:!0,configurable:!0,writable:!0,value:si}):$n[In]=si,Ye=($n,In)=>{for(var si in In||(In={}))Re.call(In,si)&&et($n,si,In[si]);if(Ie)for(var si of Ie(In))rt.call(In,si)&&et($n,si,In[si]);return $n},ut=($n,In)=>we($n,be(In)),tt=($n,In)=>{var si={};for(var Ti in $n)Re.call($n,Ti)&&In.indexOf(Ti)<0&&(si[Ti]=$n[Ti]);if($n!=null&&Ie)for(var Ti of Ie($n))In.indexOf(Ti)<0&&rt.call($n,Ti)&&(si[Ti]=$n[Ti]);return si};const wt=({value:$n,onChange:In})=>{const si=Oi=>{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:At.Z.modal,onOk:()=>{const zi=[...$n];zi.splice(Oi,1),In(zi)}})},Ti=()=>{const Oi=[...$n];Oi.push(""),In(Oi)};return pe.createElement(Ct.Z,{className:"ml20"},pe.createElement(dt.Z,{flex:1},$n==null?void 0:$n.map((Oi,zi)=>pe.createElement(Ct.Z,{key:`${Oi}_${zi}`,align:"middle",className:"mb20"},pe.createElement(de.default.TextArea,{style:{flex:1,minHeight:44},defaultValue:Oi,autoSize:{maxRows:3},maxLength:1e3,onBlur:xr=>{const Ce=[...$n],_n=xr.target.value.trim();Ce[zi]=_n,In(Ce)}}),pe.createElement(Rt.Z,{title:"\u5220\u9664"},pe.createElement(Te.Z,{className:At.Z.deleteIcon,style:{marginLeft:15,visibility:zi>0?"visible":"hidden"},onClick:()=>si(zi)}))))),pe.createElement(dt.Z,null,pe.createElement("div",{className:`${At.Z.addBtn}`,onClick:()=>{Ti()}},"\u65B0\u589E\u7B54\u6848")))},St=({value:$n=!0,onChange:In})=>pe.createElement(se.Z,{checked:!$n,onChange:si=>{In(!si)}}),Lt="\u2581",mn=({questionTitlePlaceholder:$n,form:In,name:si,scoreByBlank:Ti=!1,answerKey:Oi,titleKey:zi="name",analysisKey:xr="analysis",isOrdered:Ce="is_ordered"})=>{var _n,ci;const[ar,_r]=(0,mt.useState)(!1),$r=(Yn,vi)=>{const yn=vi.line;let Kn=0;for(let _t=0;_t<yn;_t++)Kn+=Yn.getLine(_t).split(Lt).length-1;const It=Yn.getLine(yn).substring(0,vi.ch);return Kn+=It.split(Lt).length-1,Kn},po=(Yn,vi,yn,Kn)=>{const It=Yn.getRange(vi.from,vi.to);let _t=0;if(vi.text.forEach(hi=>{_t+=hi.split(Lt).length-1}),vi.origin!=="setValue"){if(It&&It.indexOf(Lt)!==-1){const hi=It.split(Lt).length-1,it=$r(Yn,vi.from);if(console.log(`\u5220\u9664${hi}\u4E2A\uFF0C \u524D\u9762\u6709${it}\u4E2A\uFF0C\u65B0\u589E${_t}\u4E2A`),hi>1){const sn=Array.from({length:hi},(Dn,Di)=>it+Di);Kn(sn)}else Kn(it)}else if(_t>0){const hi=$r(Yn,vi.from);console.log(`\u65B0\u589E${_t}\u4E2A\uFF0C\u4E4B\u524D\u6709${hi}\u4E2A`),yn(_t,hi)}}},fi=()=>{const Yn=In.getFieldValue(["sub_item_banks",...Oi]);In.setFieldValue(["sub_item_banks",...Oi],Yn==null?void 0:Yn.map((vi,yn)=>ut(Ye({},vi),{position:yn+1})))},Qn=(0,mt.useRef)(),Bt=(Yn,vi)=>{for(let yn=0;yn<Yn;yn++)Qn.current({position:null,answer_text:[""]},vi+yn);fi()},Tt=(0,mt.useRef)(),kt=Yn=>{Tt.current(Yn),fi()},ui=(ci=(_n=In.getFieldValue("sub_item_banks"))==null?void 0:_n[Oi==null?void 0:Oi[0]])==null?void 0:ci[Oi==null?void 0:Oi[1]];return(0,mt.useEffect)(()=>{console.log("========",In.getFieldsValue())},[In]),pe.createElement("div",{className:At.Z.wrap},pe.createElement("div",{className:At.Z.questionTitleEditorWrap},pe.createElement(at.default.Item,{label:"\u9898\u5E72",name:zi,labelCol:{span:24},rules:[{required:!0}]},pe.createElement(ne.h,{scrollId:"name",watch:!0,height:140,placeholder:$n,showNullButton:!0,onCMBeforeChange:(Yn,vi)=>{po(Yn,vi,Bt,kt)}}))),pe.createElement(at.default.List,{name:Oi,rules:[{validator(Yn,vi){if((vi==null?void 0:vi.length)===0)return Promise.reject(new Error("\u8BF7\u5148\u5728\u9898\u5E72\u4E2D\u63D2\u5165\u586B\u7A7A\u9879"));for(const yn of vi){const{answer_text:Kn}=yn||{};if(Kn!=null&&Kn.some(It=>(It==null?void 0:It.length)===0))return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"))}return Promise.resolve()}}]},(Yn,{add:vi,remove:yn},{errors:Kn})=>(Qn.current=vi,Tt.current=yn,pe.createElement(pe.Fragment,null,pe.createElement(at.default.Item,{label:pe.createElement("span",null,"\u586B\u7A7A\u9879\u7B54\u6848",!(Yn!=null&&Yn.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}}),Yn.map((It,_t)=>{var hi=It,{key:it,name:sn}=hi,Dn=tt(hi,["key","name"]);return pe.createElement(Ct.Z,{align:"top",key:it},pe.createElement(dt.Z,{className:`${At.Z.blankIndex} pt5`},"\u586B\u7A7A\u9879",_t+1),pe.createElement(dt.Z,{flex:1},pe.createElement(Ct.Z,{align:"top",justify:"space-between"},pe.createElement(dt.Z,{flex:1},pe.createElement(at.default.Item,ut(Ye({},Dn),{name:[sn,"answer_text"],noStyle:!0}),pe.createElement(wt,null))),Ti&&pe.createElement(dt.Z,{flex:"224px"},pe.createElement(at.default.Item,ut(Ye({},Dn),{name:[sn,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:At.Z.blankInputNumberWrapper}),pe.createElement(Ge.Z,{className:At.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,ut(Ye({},Dn),{name:[sn,"position"],noStyle:!0}),pe.createElement(de.default,{type:"hidden"}))))})))),pe.createElement(Ct.Z,{align:"middle"},pe.createElement(at.default.Item,{name:[si,"downcase"],valuePropName:"checked"},pe.createElement(se.Z,null)),pe.createElement(dt.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:[si,"no_space"],valuePropName:"checked"},pe.createElement(se.Z,null)),pe.createElement(dt.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),(ui==null?void 0:ui.length)>1&&pe.createElement(Ct.Z,{align:"middle",className:(ui==null?void 0:ui.length)>1?"mb30":`${At.Z.hide}`},pe.createElement(at.default.Item,{name:Ce},pe.createElement(St,null)),pe.createElement(dt.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:()=>_r(!0)},pe.createElement(at.default.Item,{name:xr,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:ar}))))};var $t=Le(59301),Pn=Object.defineProperty,Ot=Object.defineProperties,ct=Object.getOwnPropertyDescriptors,nt=Object.getOwnPropertySymbols,gn=Object.prototype.hasOwnProperty,oi=Object.prototype.propertyIsEnumerable,zn=($n,In,si)=>In in $n?Pn($n,In,{enumerable:!0,configurable:!0,writable:!0,value:si}):$n[In]=si,Ht=($n,In)=>{for(var si in In||(In={}))gn.call(In,si)&&zn($n,si,In[si]);if(nt)for(var si of nt(In))oi.call(In,si)&&zn($n,si,In[si]);return $n},Fn=($n,In)=>Ot($n,ct(In)),Cn=($n,In)=>{var si={};for(var Ti in $n)gn.call($n,Ti)&&In.indexOf(Ti)<0&&(si[Ti]=$n[Ti]);if($n!=null&&nt)for(var Ti of nt($n))In.indexOf(Ti)<0&&oi.call($n,Ti)&&(si[Ti]=$n[Ti]);return si};const ii={\u6B63\u786E:"T",\u9519\u8BEF:"F"},Wt=({value:$n,onChange:In,form:si,choiceKey:Ti})=>{const Oi=($n==null?void 0:$n.is_answer)===1,zi=$n==null?void 0:$n.choice_text,xr=()=>{var Ce;const _n=(Ce=si==null?void 0:si.getFieldValue(["sub_item_banks",...Ti]))==null?void 0:Ce.map(ci=>({choice_text:ci.choice_text,is_answer:0}));si==null||si.setFieldValue(["sub_item_banks",...Ti],_n),In(Fn(Ht({},$n),{is_answer:1}))};return $t.createElement(Ct.Z,{className:At.Z.choiceWrap,align:"middle",wrap:!1},$t.createElement(dt.Z,{onClick:xr,className:`${At.Z.choiceIndex} ${At.Z.judgementIndex} ${Oi?At.Z.activeAnswer:""}`},ii[zi]),$t.createElement(dt.Z,{flex:1,className:`${At.Z.editorWrap} ml15`},$t.createElement("div",{className:`${At.Z.inputBorder} ${At.Z.placeholder} ${Oi?At.Z.activeJudgementAnswer:""}`},zi)),$t.createElement(dt.Z,{flex:"0 0 auto",className:"ml15"},$t.createElement("div",{onClick:xr,className:`${At.Z.setAnswerBtn} ${Oi?At.Z.activeAnswer:""}`},Oi?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")))},Hn=({questionTitlePlaceholder:$n,choiceKey:In="choices",form:si,titleKey:Ti="name",analysisKey:Oi="analysis"})=>{const[zi,xr]=(0,mt.useState)(!1);return $t.createElement("div",{className:At.Z.wrap},$t.createElement("div",{className:At.Z.questionTitleEditorWrap},$t.createElement(at.default.Item,{label:"\u9898\u5E72",name:Ti,labelCol:{span:24},rules:[{required:!0}]},$t.createElement(ne.h,{scrollId:"name",watch:!0,height:140,placeholder:$n}))),$t.createElement(at.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}},$t.createElement(at.default.List,{name:In,rules:[{validator(Ce,_n){return _n.some(ar=>(ar==null?void 0:ar.is_answer)===1)?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},Ce=>$t.createElement("div",{id:"choices",style:{display:"flex",flexDirection:"column",gap:"20px"}},Ce.map(_n=>{var ci=_n,{key:ar,name:_r}=ci,$r=Cn(ci,["key","name"]);return $t.createElement(at.default.Item,Fn(Ht({},$r),{key:ar,name:_r,noStyle:!0}),$t.createElement(Wt,{form:si,choiceKey:In}))})))),$t.createElement("div",{className:"mt30",onClick:()=>xr(!0)},$t.createElement(at.default.Item,{name:Oi,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},$t.createElement(ne.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:zi}))))};var lt=Le(6767),An=Le(96599),Ni=Le(12290),je=Le(61485),Me=Object.defineProperty,Ee=Object.defineProperties,De=Object.getOwnPropertyDescriptors,We=Object.getOwnPropertySymbols,Ae=Object.prototype.hasOwnProperty,Je=Object.prototype.propertyIsEnumerable,Nt=($n,In,si)=>In in $n?Me($n,In,{enumerable:!0,configurable:!0,writable:!0,value:si}):$n[In]=si,fn=($n,In)=>{for(var si in In||(In={}))Ae.call(In,si)&&Nt($n,si,In[si]);if(We)for(var si of We(In))Je.call(In,si)&&Nt($n,si,In[si]);return $n},vn=($n,In)=>Ee($n,De(In)),Ft=($n,In)=>{var si={};for(var Ti in $n)Ae.call($n,Ti)&&In.indexOf(Ti)<0&&(si[Ti]=$n[Ti]);if($n!=null&&We)for(var Ti of We($n))In.indexOf(Ti)<0&&Je.call($n,Ti)&&(si[Ti]=$n[Ti]);return si};const Jt=$n=>{var In=$n,{value:si,onChange:Ti}=In,Oi=Ft(In,["value","onChange"]);const zi=xr=>{Ti([xr])};return mt.createElement(Ni.Z,vn(fn({},Oi),{defaultValue:si==null?void 0:si[0],onChange:zi}))},jt=$n=>{if(!$n)return!1;let In=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 $n==="|"?(lt.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},pn=({value:$n=[],onClose:In})=>mt.createElement(An.default,{closable:!0,onClose:In,className:At.Z.keywordTag},mt.createElement("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"}},$n.join(" \u6216 "))),jn=({questionTitlePlaceholder:$n,form:In,showKeywords:si,isMustKeyWords:Ti=si,titleKey:Oi="name",analysisKey:zi="analysis",answerTexts:xr="answer_texts",keywords:Ce="keywords",useKeywords:_n="use_keywords",indexs:ci})=>{const[ar,_r]=(0,mt.useState)(!1),[$r,po]=(0,mt.useState)(""),[fi,Qn]=(0,mt.useState)(!1),Bt=at.default.useWatch("question_score",In);return mt.createElement("div",{className:At.Z.wrap},mt.createElement("div",{className:At.Z.questionTitleEditorWrap},mt.createElement(at.default.Item,{label:"\u9898\u5E72",name:Oi,labelCol:{span:24},rules:[{required:!0}]},mt.createElement(ne.h,{scrollId:"name",watch:!0,height:140,placeholder:$n}))),mt.createElement(at.default.Item,{label:"\u53C2\u8003\u7B54\u6848",name:xr,labelCol:{span:24}},mt.createElement(Jt,{watch:!0,height:140,placeholder:"\u8BF7\u7F16\u8F91\u53C2\u8003\u7B54\u6848\uFF08\u975E\u5FC5\u586B\uFF09"})),si&&!Ti&&mt.createElement(at.default.Item,{hidden:!0,name:_n,valuePropName:"checked"},mt.createElement(se.Z,{defaultChecked:!0})),si&&Ti&&mt.createElement(Ct.Z,{align:"middle",className:"mb30"},mt.createElement(at.default.Item,{name:_n,valuePropName:"checked"},mt.createElement(se.Z,{onChange:()=>{var Tt,kt,ui,Yn,vi,yn;console.log(In.getFieldsValue()),Qn((ui=(kt=(Tt=In.getFieldsValue())==null?void 0:Tt.sub_item_banks)==null?void 0:kt[ci])==null?void 0:ui.use_keywords),console.log((yn=(vi=(Yn=In.getFieldsValue())==null?void 0:Yn.sub_item_banks)==null?void 0:vi[ci])==null?void 0:yn.use_keywords),console.log(fi)}})),mt.createElement(dt.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),mt.createElement(dt.Z,null,mt.createElement(Rt.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"},mt.createElement(je.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),(fi||!Ti)&&mt.createElement(at.default.List,{name:Ce,rules:[{validator(Tt,kt){return Ti?kt!=null&&kt.length?(kt==null?void 0:kt.reduce((Yn,vi)=>Yn+vi.score,0))>parseFloat(Bt)?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()}}]},(Tt,{add:kt,remove:ui})=>mt.createElement(mt.Fragment,null,mt.createElement("div",{className:`${At.Z.title} mb10`},Ti?"\u5173\u952E\u8BCD":mt.createElement("span",{style:{color:"#9096A3"}},"\u5224\u5206\u5173\u952E\u8BCD")),mt.createElement(Ct.Z,{align:"middle",className:"font14 mb30"},mt.createElement(dt.Z,{flex:1},mt.createElement(de.default,{value:$r,onChange:Yn=>{po(Yn.target.value)},maxLength:50,allowClear:!0,onPressEnter:Yn=>{var vi,yn,Kn,It;const _t=`${(vi=Yn.target)==null?void 0:vi.value}`,hi=(Kn=(yn=_t==null?void 0:_t.split("|"))==null?void 0:yn.filter(Dn=>!!Dn))==null?void 0:Kn.map(Dn=>Dn==null?void 0:Dn.trim()),it=In.getFieldValue(["sub_item_banks",...Ce]),sn=((It=it==null?void 0:it.map(Dn=>Dn==null?void 0:Dn.keyword))==null?void 0:It.flat())||[];for(const Dn of hi)if(sn.includes(Dn)){lt.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}jt(_t)&&(kt({keyword:hi,score:1}),po(""))},className:At.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"})),mt.createElement(dt.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),Tt.map(Yn=>{var vi=Yn,{key:yn,name:Kn}=vi,It=Ft(vi,["key","name"]);return mt.createElement(Ct.Z,{key:yn,className:"mb20",style:{marginRight:148}},mt.createElement(dt.Z,{flex:1},mt.createElement(Ct.Z,{align:"middle",justify:"space-between"},mt.createElement(at.default.Item,vn(fn({},It),{name:[Kn,"keyword"]}),mt.createElement(pn,{onClose:()=>ui(Kn)})),Ti&&mt.createElement(at.default.Item,vn(fn({},It),{name:[Kn,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:At.Z.blankInputNumberWrapper}),mt.createElement(Ge.Z,{className:At.Z.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))}))),mt.createElement("div",{onClick:()=>_r(!0)},mt.createElement(at.default.Item,{name:zi,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},mt.createElement(ne.x,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:ar}))))};var Nn=Le(59301),Mn=Object.defineProperty,fr=Object.defineProperties,nn=Object.getOwnPropertyDescriptors,tn=Object.getOwnPropertySymbols,hn=Object.prototype.hasOwnProperty,di=Object.prototype.propertyIsEnumerable,Sn=($n,In,si)=>In in $n?Mn($n,In,{enumerable:!0,configurable:!0,writable:!0,value:si}):$n[In]=si,Kt=($n,In)=>{for(var si in In||(In={}))hn.call(In,si)&&Sn($n,si,In[si]);if(tn)for(var si of tn(In))di.call(In,si)&&Sn($n,si,In[si]);return $n},gi=($n,In)=>fr($n,nn(In)),Vi=($n,In)=>{var si={};for(var Ti in $n)hn.call($n,Ti)&&In.indexOf(Ti)<0&&(si[Ti]=$n[Ti]);if($n!=null&&tn)for(var Ti of tn($n))In.indexOf(Ti)<0&&di.call($n,Ti)&&(si[Ti]=$n[Ti]);return si};const{Panel:Pi}=Oe.default,Ii=({questionTitlePlaceholder:$n,choiceKey:In,form:si,withScore:Ti})=>{const[Oi,zi]=(0,mt.useState)([]),xr=Ce=>{zi(Ce)};return Nn.createElement("div",{className:At.Z.wrap},Nn.createElement("div",{className:At.Z.questionTitleEditorWrap},Nn.createElement(at.default.Item,{label:"\u9898\u5E72",name:"name",labelCol:{span:24},rules:[{required:!0}]},Nn.createElement(ne.h,{scrollId:"name",watch:!0,height:140,placeholder:$n}))),Nn.createElement(at.default.Item,{label:"\u5C0F\u9898",required:!0,labelCol:{span:24}}),Nn.createElement(at.default.List,{name:"sub_item_banks",rules:[{validator(Ce,_n){return _n?Promise.resolve():Promise.reject(new Error("\u8BF7\u6DFB\u52A0\u5C0F\u9898"))}}]},(Ce,{add:_n,remove:ci,move:ar})=>{const _r=si.getFieldValue("sub_item_banks");return Nn.createElement(Nn.Fragment,null,Nn.createElement(Oe.default,{className:Ce.length>0?At.Z.collapseWrapper:"",bordered:!1,activeKey:Oi,onChange:xr,expandIcon:({isActive:$r})=>Nn.createElement("i",{className:`iconfont icon-weizhankai ${$r?At.Z.open:At.Z.close}`,style:{fontSize:14,transition:"all .2s"}})},Ce.map(($r,po)=>{var fi=$r,{key:Qn,name:Bt}=fi,Tt=Vi(fi,["key","name"]),kt,ui,Yn,vi,yn,Kn,It,_t,hi,it;return Nn.createElement(Pi,{className:At.Z.panel,forceRender:!0,header:Nn.createElement("div",{className:At.Z.panelHeader},"\u7B2C",po+1,"\u5C0F\u9898",Nn.createElement("span",null,"\uFF08",((kt=_r==null?void 0:_r[Bt])==null?void 0:kt.item_type)=="SINGLE"?"\u5355\u9009\u9898":((ui=_r==null?void 0:_r[Bt])==null?void 0:ui.item_type)=="MULTIPLE"?"\u591A\u9009\u9898":((Yn=_r==null?void 0:_r[Bt])==null?void 0:Yn.item_type)=="COMPLETION"?"\u586B\u7A7A\u9898":((vi=_r==null?void 0:_r[Bt])==null?void 0:vi.item_type)=="JUDGMENT"?"\u5224\u65AD\u9898":"\u7B80\u7B54\u9898","\uFF09")),key:Bt,extra:Nn.createElement(Ct.Z,{align:"middle",onClick:sn=>sn.stopPropagation()},Ti&&Nn.createElement(dt.Z,null,Nn.createElement(at.default.Item,gi(Kt({},Tt),{rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5C0F\u9898\u5206\u503C"}],label:"\u5206\u503C",name:[Bt,"question_score"],className:At.Z.blankInputNumberWrapper}),Nn.createElement(Ge.Z,{className:At.Z.blankInput,placeholder:"\u8BF7\u8F93\u5165\u5F53\u524D\u5C0F\u9898\u5206\u6570",min:.1,precision:1,max:100,style:{width:150}}))),Nn.createElement(dt.Z,null,Nn.createElement(Ct.Z,{align:"middle",className:"pl40",justify:"end"},po!==0&&Nn.createElement("div",{onClick:()=>{var sn;ar(po,po-1);const Dn=(sn=si.getFieldValue("sub_item_banks"))==null?void 0:sn.map((Di,cn)=>(Ce.map((qt,an)=>{cn===an&&(Di.q_position=Number(qt.name)+1)}),Di));si.setFieldValue("sub_item_banks",Dn)}},Nn.createElement(Rt.Z,{title:"\u4E0A\u79FB"},Nn.createElement("i",{className:"iconfont icon-shangyi3 c-grey-999 primary-hover"}))),po<Ce.length-1&&Nn.createElement("div",{onClick:()=>{var sn;ar(po,po+1);const Dn=(sn=si.getFieldValue("sub_item_banks"))==null?void 0:sn.map((Di,cn)=>(Ce.map((qt,an)=>{cn===an&&(Di.q_position=Number(qt.name)+1)}),Di));si.setFieldValue("sub_item_banks",Dn)},className:po===0?"":"ml15"},Nn.createElement(Rt.Z,{title:"\u4E0B\u79FB"},Nn.createElement("i",{className:"iconfont icon-xiayi3 c-grey-999 primary-hover"}))))),Nn.createElement(dt.Z,null,Nn.createElement(Rt.Z,{title:"\u5220\u9664"},Nn.createElement(Te.Z,{className:`${At.Z.deleteIcon} ml15`,onClick:()=>ci(Bt)}))))},Nn.createElement(at.default.Item,gi(Kt({},Tt),{name:Bt}),(((yn=_r==null?void 0:_r[Bt])==null?void 0:yn.item_type)=="SINGLE"||((Kn=_r==null?void 0:_r[Bt])==null?void 0:Kn.item_type)=="MULTIPLE")&&Nn.createElement(ue.u,{questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9009\u62E9\u9898\u9898\u5E72\u5185\u5BB9",allowChangeMode:((It=_r==null?void 0:_r[Bt])==null?void 0:It.item_type)=="MULTIPLE",form:si,choiceKey:[Bt,"choices"],titleKey:[Bt,"name"],analysisKey:[Bt,"analysis"],choiceOptionsPath:["sub_item_banks",Bt,"choices"],choiceTextKey:"choice_text",answerKey:"is_answer"}),((_t=_r==null?void 0:_r[Bt])==null?void 0:_t.item_type)=="COMPLETION"&&Nn.createElement(mn,{form:si,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9898\u5E72\u5E76\u8BBE\u7F6E\u586B\u7A7A\u9879",scoreByBlank:!1,name:Bt,titleKey:[Bt,"name"],analysisKey:[Bt,"analysis"],isOrdered:[Bt,"is_ordered"],answerKey:[Bt,"standard_answers"]}),((hi=_r==null?void 0:_r[Bt])==null?void 0:hi.item_type)=="JUDGMENT"&&Nn.createElement(Hn,{form:si,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u5224\u65AD\u9898\u9898\u5E72\u5185\u5BB9",titleKey:[Bt,"name"],analysisKey:[Bt,"analysis"],choiceKey:[Bt,"choices"]}),((it=_r==null?void 0:_r[Bt])==null?void 0:it.item_type)=="SUBJECTIVE"&&Nn.createElement(jn,{showKeywords:!0,isMustKeyWords:!1,form:si,titleKey:[Bt,"name"],analysisKey:[Bt,"analysis"],answerTexts:[Bt,"answer_texts"],useKeywords:[Bt,"use_keywords"],keywords:[Bt,"keywords"],indexs:Bt,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u7B80\u7B54\u9898\u9898\u5E72\u5185\u5BB9"})))})),Ce.length<20&&Nn.createElement(ot.Z,{menu:{items:[{label:Nn.createElement("div",{onClick:()=>{_n({name:"",choices:Array.from({length:4},()=>({choice_text:"",is_answer:0})),analysis:"",item_type:"SINGLE"}),zi([Ce==null?void 0:Ce.length,...Oi])}},"\u5355\u9009\u9898"),key:"1",show:!0},{label:Nn.createElement("div",{onClick:()=>{_n({name:"",choices:Array.from({length:4},()=>({choice_text:"",is_answer:0})),analysis:"",item_type:"MULTIPLE"}),zi([Ce==null?void 0:Ce.length,...Oi])}},"\u591A\u9009\u9898"),key:"2",show:!0},{label:Nn.createElement("div",{onClick:()=>{_n({name:"",choices:[{choice_text:"\u6B63\u786E",is_answer:0},{choice_text:"\u9519\u8BEF",is_answer:0}],analysis:"",item_type:"JUDGMENT"}),zi([Ce==null?void 0:Ce.length,...Oi])}},"\u5224\u65AD\u9898"),key:"3",show:!0},{label:Nn.createElement("div",{onClick:()=>{_n({name:"",analysis:"",is_ordered:!0,standard_answers:[],item_type:"COMPLETION",downcase:!0,no_space:!0}),zi([Ce==null?void 0:Ce.length,...Oi])}},"\u586B\u7A7A\u9898"),key:"4",show:!0},{label:Nn.createElement("div",{onClick:()=>{_n({name:"",answer_texts:[],keywords:[],use_keywords:!0,analysis:"",item_type:"SUBJECTIVE"}),zi([Ce==null?void 0:Ce.length,...Oi])}},"\u7B80\u7B54\u9898"),key:"5",show:!0}].filter($r=>$r.show).map($r=>({label:$r.label,key:$r.key}))}},Nn.createElement("div",{className:`${At.Z.addBtn}`},"\u6DFB\u52A0\u5C0F\u9898")))}))};var Fr=Le(90502)},85149:function(Un,ai,Le){"use strict";Le.d(ai,{z:function(){return Re},Z:function(){return rt}});var ue=Le(59301),Ke=Le(50304),ft=Le(24768),yt=Le(64018),mt=Le(79710),Oe=Le(3294),at=Le(955),Ct=Le(15342),dt=Le(1012),Ge=Le(23210),Rt=Le(59301),At=({html:et})=>{const Ye=(0,ue.useRef)(null),ut=(0,ue.useRef)(null),tt=`.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 36px !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,ue.useEffect)(()=>{const wt=Ye.current.attachShadow({mode:"open"});ut.current=document.createElement("div"),ut.current.className="markdown-body",ut.current.innerHTML=et,wt.appendChild(ut.current);const St=document.createElement("style");return St.textContent=tt,wt.appendChild(St),()=>{wt.innerHTML=""}},[]),(0,ue.useEffect)(()=>{ut.current&&(ut.current.innerHTML=et)},[et]),Rt.createElement("div",{ref:Ye})},Te=Object.defineProperty,ne=Object.getOwnPropertySymbols,te=Object.prototype.hasOwnProperty,de=Object.prototype.propertyIsEnumerable,se=(et,Ye,ut)=>Ye in et?Te(et,Ye,{enumerable:!0,configurable:!0,writable:!0,value:ut}):et[Ye]=ut,pe=(et,Ye)=>{for(var ut in Ye||(Ye={}))te.call(Ye,ut)&&se(et,ut,Ye[ut]);if(ne)for(var ut of ne(Ye))de.call(Ye,ut)&&se(et,ut,Ye[ut]);return et};const ye="@\u2581\u2581@",we="@\u2581@",be=/<pre[^>]*>/g;function Ie(et){let Ye=document.createElement("div");return Ye.innerHTML=et,Ye.childNodes.length===0?"":Ye.childNodes[0].nodeValue}const Re=(et,Ye)=>{et=et||"";const ut=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,tt=/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,wt=/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,St=/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return Ye?et.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(ut,(Lt,mn,$t,Pn,Ot,ct,nt)=>{const gn=mn||Pn||ct,oi=$t||Ot||nt||"?";return Oe.Z.API_SERVER+"/api/attachments/"+gn+oi+"&t="+(0,at.Jn)(gn,Date.now())+(Lt.indexOf(")")>-1?")":"&")}).replaceAll('src="(','src="').replaceAll("src='(",'src="'):(et=et.replace(St,(Lt,mn,$t,Pn,Ot,ct,nt)=>{const gn=mn||Pn||ct,oi=$t||Ot||nt||"?";return Oe.Z.API_SERVER+"/attachments/download/"+gn+oi+"&t="+(0,at.Jn)(gn,Date.now())+(Lt.indexOf(")")>-1?")":"&")}).replace(ut,(Lt,mn,$t,Pn,Ot,ct,nt)=>{const gn=mn||Pn||ct,oi=$t||Ot||nt||"?";return Oe.Z.API_SERVER+"/api/attachments/"+gn+oi+"&t="+(0,at.Jn)(gn,Date.now())+(Lt.indexOf(")")>-1?")":"&")}).replace(tt,(Lt,mn,$t,Pn,Ot)=>{const ct=mn||Pn,nt=$t||Ot||"";return'"'+Oe.Z.API_SERVER+"/api/attachments/"+ct+nt+ct+nt+"&t="+(0,at.Jn)(ct,Date.now())}).replace(wt,(Lt,mn,$t,Pn,Ot)=>{const ct=mn||Pn,nt=$t||Ot||"";return"("+Oe.Z.API_SERVER+"/files/uploads/"+ct+nt+ct+nt+"&t="+(0,at.Jn)(ct,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,`
|
|
`),et)};var rt=({value:et="",className:Ye,showTextOnly:ut,showLines:tt,style:wt={},stylesPrev:St={},highlightKeywords:Lt,showProgramFill:mn,isProgramFill:$t,disabledFill:Pn=!1,programFillValue:Ot,onFillChange:ct=oi=>{},onFillBlur:nt=()=>{},onFillFocus:gn=()=>{}})=>{let oi=String(et);const[zn,Ht]=(0,ue.useState)(""),[Fn,Cn]=(0,ue.useState)("office"),[ii,Wt]=(0,ue.useState)([]),Hn=(0,ue.useRef)("a"+(0,dt.Z)()),lt={},An=(Ft,Jt,jt)=>{const pn=document.createElement(Ft===we?"input":"textarea");pn.style.width="100%",pn.style.height=Ft===we?"40px":"151px",pn.rows=5,pn.spellcheck=!1,pn.name="edu-program-fill",pn.placeholder="\u8BF7\u8F93\u5165",pn.dataset.id=Jt;const jn=Object.keys(lt).length;return lt[jn]=pn,`<span class="edu-program-fill-wrap ${Ft===we?"":"show"}" style="width:${Ft===we?"400px":"100%"}" title=${jt||""}><span>${pn.outerHTML}<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>`};function Ni(Ft){return Ft=Ft.replace(/!\[.*?\]\(.*?\)/g,""),Ft=Ft.replace(/\[.*?\]\(.*?\)/g,""),Ft=Ft.replace(new RegExp("<iframe.*?<\\/iframe>","gs"),""),Ft=Ft.replace(/<embed.*?>/g,""),Ft=Ft.replace(/<img.*?>/g,""),Ft=Ft.replace(new RegExp("<video.*?>.*?<\\/video>","gs"),""),Ft=Ft.replace(new RegExp("<audio.*?>.*?<\\/audio>","gs"),""),Ft=Ft.replace(new RegExp("<style.*?>.*?<\\/style>","gs"),""),Ft=Ft.replace(new RegExp("<script.*?>.*?<\\/script>","gs"),""),Ft}const je=Ft=>Ft.replace(/<style.*?>([\s\S]+?)<\/style>/gim,function(Jt,jt){let pn=jt.replace(/(\n|\r)/g,"").split("}"),jn=[];return pn.map(Nn=>{Nn!=""&&jn.push(`.${Hn.current} ${Nn}`)}),`<style>${jn.join("}")}</style>`}),Me=(0,ue.useMemo)(()=>{try{const pn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,jn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Nn=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,Mn=/\(\/attachments\/download\//g;oi=oi.replace(Mn,"("+Oe.Z.API_SERVER+"/attachments/download/").replace(pn,"("+Oe.Z.API_SERVER+"/api/attachments/").replace(jn,'"'+Oe.Z.API_SERVER+"/api/attachments/").replace(Nn,'"'+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(pn){}if(mn){let pn=-1;return oi=oi.replaceAll("<","<").replaceAll(">",">").replace(/(@▁▁@|@▁@)/g,function(jn,Nn,Mn){var fr;return++pn,An(jn,pn,(fr=Ot==null?void 0:Ot[pn])==null?void 0:fr.value.replaceAll("<","<").replaceAll(">",">"))}),`<pre style="background:#fff;padding:4px">${je(oi||"")}</pre>`}let Ft=je(oi);Ft=(0,ft.ZP)(Ft);const Jt=(0,ft.ez)();oi.match(/\[TOC\]/)&&(Ft=Ft.replace("<p>[TOC]</p>",(0,ft.Qv)()),(0,ft.Iy)()),Ft=Ft.replace(/(__special_katext_id_\d+__)/g,(pn,jn)=>{const{type:Nn,expression:Mn}=Jt[jn];return(0,Ct.renderToString)(Ie(Mn)||"",{displayMode:Nn==="block",throwOnError:!1,output:"html"})}),Ft=Ft.replace(/▁/g,"\u2581\u2581\u2581\u2581\u2581"),(0,ft.AL)();const jt=document.createElement("div");if(jt.innerHTML=Ft,ut)return jt.innerText;if(Lt){const pn=Lt.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return Ae(jt,pn),jt.innerHTML}return setTimeout(()=>fn(),500),jt.innerHTML},[oi,Lt]);(0,ue.useEffect)(()=>{Je.current&&Je.current.querySelectorAll(["input","textarea"]).forEach(Jt=>{Jt.oninput=Ee,Jt.onblur=De,Jt.onfocus=We})},[ii]),(0,ue.useEffect)(()=>{var Ft,Jt,jt,pn,jn;if(Ot!=null&&Ot.length)try{const Nn=Je.current.querySelectorAll(".edu-program-fill-score"),Mn=Je.current.querySelectorAll('[name="edu-program-fill"]');for(const[fr,nn]of Mn.entries())nn.value=((Ft=Ot==null?void 0:Ot[fr])==null?void 0:Ft.value)||"",((Jt=Ot==null?void 0:Ot[fr])==null?void 0:Jt.type)==="warning"?nn.className="program-fill-warning":((jt=Ot==null?void 0:Ot[fr])==null?void 0:jt.type)==="success"?nn.className="program-fill-success":nn.className="";for(const[fr,nn]of Nn.entries())nn.innerHTML=(pn=Ot==null?void 0:Ot[fr])!=null&&pn.score?`${(jn=Ot==null?void 0:Ot[fr])==null?void 0:jn.score}\u5206`:"";Wt(Ot)}catch(Nn){console.log(Nn,"error")}},[Ot]);const Ee=Ft=>{ii[Ft.target.dataset.id]=ii[Ft.target.dataset.id]||{},ii[Ft.target.dataset.id].value=Ft.target.value,Wt([...ii]),ct(ii,Ft.target.dataset.id)},De=Ft=>{ii[Ft.target.dataset.id]=ii[Ft.target.dataset.id]||{},ii[Ft.target.dataset.id].value=Ft.target.value,Wt([...ii]),nt(ii,Ft.target.dataset.id)},We=Ft=>{ii[Ft.target.dataset.id]=ii[Ft.target.dataset.id]||{},ii[Ft.target.dataset.id].value=Ft.target.value,Wt([...ii]),gn(ii,Ft.target.dataset.id)};function Ae(Ft,Jt){return Ft.childNodes.forEach(jt=>{var pn;if(jt.childNodes.length>0)Ae(jt,Jt);else if(jt.nodeName!=="IMG")if(jt.innerHTML)jt.innerHTML=(pn=jt.innerHTML)==null?void 0:pn.replace(new RegExp(Jt,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>');else{const jn=document.createElement("span");jn.innerHTML=jt.textContent.replace(new RegExp(Jt,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),jt.replaceWith(jn)}})}const Je=(0,ue.useRef)();ft.jb.WebkitLineClamp=tt,tt&&(wt=pe(pe({},wt),ft.jb));function Nt(Ft){let Jt=Ft.target;if(Jt.tagName.toUpperCase()==="A"){let jt=Jt.getAttribute("href");if(jt.indexOf("office")>-1)Ft.preventDefault(),Ht(jt),Cn("office");else if(jt.indexOf("application/pdf")>-1)Ft.preventDefault(),Ht(jt),Cn("pdf");else if(jt.indexOf("text/html")>-1)Ft.preventDefault(),Ht(jt),Cn("html");else if(jt.startsWith("#")){Ft.preventDefault();let pn=document.getElementById(jt.replace("#",""));pn&&pn.scrollIntoView(!0)}}}const fn=()=>{var Ft;const Jt=(Ft=Je.current)==null?void 0:Ft.querySelectorAll("video");Jt==null||Jt.forEach(jt=>{if(jt.oncontextmenu=()=>!1,jt.src.indexOf(".m3u8")>-1&&!jt.canPlayType("application/vnd.apple.mpegurl")){if(mt.ZP.isSupported()){var pn=new mt.ZP;pn.loadSource(jt.src),pn.attachMedia(jt)}}})};(0,ue.useEffect)(()=>{if(Je.current&&Me&&Me.match(be)&&window.PR.prettyPrint(),Je.current)return Je.current.addEventListener("click",Nt),()=>{var Ft;(Ft=Je.current)==null||Ft.removeEventListener("click",Nt),(0,ft.AL)(),(0,ft.Iy)()}},[Me,Je.current,Nt]),(0,ue.useEffect)(()=>{var Ft;const Jt=jt=>{jt.preventDefault(),jt.clipboardData.setData("text",window.getSelection().toString())};return(Ft=Je.current)==null||Ft.addEventListener("copy",Jt),()=>{var jt;(jt=Je.current)==null||jt.removeEventListener("copy",Jt)}},[Je.current]);const vn=Ft=>/<style[\s\S]*?>/i.test(Ft||"");return ue.createElement(ue.Fragment,null,ut&&ue.createElement("div",{ref:Je},Me),!ut&&!vn(Me)&&ue.createElement("div",{ref:Je,style:pe({},wt),className:`${Ye||""} ${Pn?"disabled-fill":""} markdown-body ${Hn.current}`,dangerouslySetInnerHTML:{__html:Me}}),!ut&&vn(Me)&&ue.createElement(At,{html:Me}),ue.createElement(Ge.Z,{close:!0,data:zn,type:zn!=null&&zn.length?Fn:"",style:pe({},St),onClose:()=>Ht("")}))}},68042:function(Un,ai,Le){"use strict";Le.d(ai,{C:function(){return mn}});var ue=Le(59301),Ke={recalculation:"recalculation____i9AE",tips:"tips___GoMu8",filter:"filter___Vx7VO",input:"input___OEMMv",operating:"operating___TS9iA",operatingItem:"operatingItem___AT84q"},ft=Le(92310),yt=Le.n(ft),mt=Le(62673),Oe=Le(77019),at=Le(6767),Ct=Le(25399),dt=Le(99571),Ge=Le(62957),Rt=Le(54172),ot=Le(71051),At=Le(28284),Te=Le(29787),ne=Le(955),te=Le(99064),de=Le(24065),se=Le(59155),pe=Le(85057),ye=Object.defineProperty,we=Object.defineProperties,be=Object.getOwnPropertyDescriptors,Ie=Object.getOwnPropertySymbols,Re=Object.prototype.hasOwnProperty,rt=Object.prototype.propertyIsEnumerable,et=($t,Pn,Ot)=>Pn in $t?ye($t,Pn,{enumerable:!0,configurable:!0,writable:!0,value:Ot}):$t[Pn]=Ot,Ye=($t,Pn)=>{for(var Ot in Pn||(Pn={}))Re.call(Pn,Ot)&&et($t,Ot,Pn[Ot]);if(Ie)for(var Ot of Ie(Pn))rt.call(Pn,Ot)&&et($t,Ot,Pn[Ot]);return $t},ut=($t,Pn)=>we($t,be(Pn)),tt=($t,Pn,Ot)=>new Promise((ct,nt)=>{var gn=Ht=>{try{zn(Ot.next(Ht))}catch(Fn){nt(Fn)}},oi=Ht=>{try{zn(Ot.throw(Ht))}catch(Fn){nt(Fn)}},zn=Ht=>Ht.done?ct(Ht.value):Promise.resolve(Ht.value).then(gn,oi);zn((Ot=Ot.apply($t,Pn)).next())});const wt=mt.default.Group,St=({className:$t,title:Pn,items:Ot=[],value:ct,onChange:nt})=>{const gn=(Ot==null?void 0:Ot.length)===(ct==null?void 0:ct.length),oi=(ct==null?void 0:ct.length)>0&&(ct==null?void 0:ct.length)<(Ot==null?void 0:Ot.length),zn=Ht=>{const Fn=Ot.map(Cn=>Cn.id);nt(Ht.target.checked?Fn:[])};return ue.createElement(Oe.Z,{align:"middle",className:$t},!!Pn&&ue.createElement("div",{className:"mr20",style:{color:"#5F6368"}},Pn),ue.createElement(mt.default,{indeterminate:oi,onChange:zn,checked:gn},"\u5168\u90E8"),ue.createElement(wt,{value:ct,onChange:nt},Ot.map(Ht=>ue.createElement(mt.default,{className:"ml30 c-black",key:Ht.id,value:Ht.id},Ht.name,ue.createElement("span",null,`(${Ht.count})`)))))};var mn=({className:$t,style:Pn,dataSource:Ot})=>{var ct,nt,gn,oi,zn,Ht,Fn;const[Cn,ii]=(0,ue.useState)({}),[Wt,Hn]=(0,ue.useState)(!0),[lt,An]=(0,ue.useState)(!1),[Ni,je]=(0,ue.useState)(!1),[Me,Ee]=(0,ue.useState)(null),[De,We]=(0,ue.useState)(0),[Ae,Je]=(0,ue.useState)({}),[Nt,fn]=(0,ue.useState)(!0),[vn,Ft]=(0,ue.useState)(0),[Jt,jt]=(0,ue.useState)(0),[pn,jn]=(0,ue.useState)(!1),Nn=(0,ue.useRef)(null),[Mn,fr]=(0,ue.useState)(!1),[nn,tn]=(0,ue.useState)(!0),[hn,di]=(0,ue.useState)([]),Sn={page:1,per_page:5,keyword:"",review:[],question_status:[],success_status:[],sort_by:null,direction:null},[Kt,gi]=(0,ue.useState)(Ye({},Sn));(0,ue.useEffect)(()=>{Ot!=null&&Ot.question_id&&ii(Ot)},[Ot==null?void 0:Ot.question_id]),(0,ue.useEffect)(()=>{var _n;if(((_n=Cn==null?void 0:Cn.exercise_question_resubmit)==null?void 0:_n.status)==="running"){const ci=setInterval(()=>{Ii()},3e3);return()=>clearInterval(ci)}},[(ct=Cn==null?void 0:Cn.exercise_question_resubmit)==null?void 0:ct.status]),(0,ue.useEffect)(()=>{var _n;Ni&&(Ni===1&&(Kt.question_status=Fr.map(ci=>ci.value),Kt.review=$n.map(ci=>ci.value)),Ni===2&&(Kt.exercise_question_resubmit_id=(_n=Cn==null?void 0:Cn.exercise_question_resubmit)==null?void 0:_n.id,Me===1&&(Kt.success_status=[1]),Me===2&&(Kt.success_status=[0])),gi(Ye({},Kt)),Vi(Kt),jt(Cn!=null&&Cn.is_mirror?3:10),Ft(Cn!=null&&Cn.is_mirror?1:5))},[Ni]),(0,ue.useEffect)(()=>{Mn&&Pi()},[Mn]);const Vi=_n=>tt(void 0,null,function*(){Hn(!0);const ci=yield(0,te.ZP)(`/api/exercise_questions/${Cn==null?void 0:Cn.question_id}/resubmit_student_list.json`,{method:"get",params:_n});(ci==null?void 0:ci.status)==0&&(Je(ci||[]),We(ci==null?void 0:ci.count)),Hn(!1)}),Pi=()=>tt(void 0,null,function*(){tn(!0);const _n=yield(0,te.ZP)(`/api/exercise_questions/${Cn==null?void 0:Cn.question_id}/resubmit_history.json`,{method:"get"});(_n==null?void 0:_n.status)==0&&di((_n==null?void 0:_n.data)||[]),tn(!1)}),Ii=()=>tt(void 0,null,function*(){const _n=yield(0,te.ZP)(`/api/exercise_questions/${Cn==null?void 0:Cn.question_id}/resubmit_status.json`,{method:"get"});(_n==null?void 0:_n.status)==0&&ii(ut(Ye({},Cn),{show_resubmit_history:!0,exercise_question_resubmit:(_n==null?void 0:_n.data)||{}}))}),Fr=[{label:"\u672A\u8BC4\u6D4B",value:2,color:"#9096A3"},{label:"\u672A\u901A\u5173",value:0,color:"#E30000"},{label:"\u5DF2\u901A\u5173",value:1,color:"#00B187"}],$n=[{label:"\u672A\u8BC4\u9605",value:0,color:"#9096A3"},{label:"\u8BC4\u9605\u4E2D",value:2,color:"#FF9D18"},{label:"\u5DF2\u8BC4\u9605",value:1,color:"#3061D0"}],In=[{label:"\u6210\u529F",value:1,color:"#00B187"},{label:"\u5931\u8D25",value:0,color:"#E30000"}],si=[{title:"\u5E8F\u53F7",dataIndex:"key",render:(_n,ci,ar)=>ue.createElement("span",{className:"c-black"},ar+1+(Kt.page-1)*Kt.per_page)},{title:"\u59D3\u540D",dataIndex:"user_name",render:_n=>ue.createElement("span",{className:"c-black"},_n)},{title:"\u5B66\u53F7",dataIndex:"student_id",sorter:!0,render:_n=>ue.createElement("span",{className:"c-grey-666"},_n||"--")},{title:"\u5206\u73ED",dataIndex:"group_name",render:_n=>ue.createElement("span",{className:"c-black"},_n)},{title:"\u9898\u76EE\u72B6\u6001",dataIndex:"question_status",render:_n=>{const{label:ci,color:ar}=Fr.find(_r=>_r.value===_n)||{};return ue.createElement("span",{style:{color:ar}},ci)}},{title:"\u9898\u76EE\u5F97\u5206",dataIndex:"question_score",sorter:!0,render:_n=>ue.createElement("span",{className:"c-black"},_n)},{title:"\u6700\u7EC8\u6210\u7EE9",dataIndex:"score",sorter:!0,render:_n=>ue.createElement("span",{className:"c-black"},_n)},{title:"\u8BC4\u9605\u72B6\u6001",dataIndex:"review",render:_n=>{const{label:ci,color:ar}=$n.find(_r=>_r.value===_n)||{};return ue.createElement("span",{style:{color:ar}},ci)}},Ni===2&&{title:"\u91CD\u65B0\u8BC4\u6D4B\u7ED3\u679C",dataIndex:"success_status",render:_n=>{const{label:ci,color:ar}=In.find(_r=>_r.value===_n)||{};return ue.createElement("span",{style:{color:ar}},ci)}}].filter(Boolean),Ti=(_n,ci,ar)=>{Kt.page=_n==null?void 0:_n.current,Kt.per_page=_n==null?void 0:_n.pageSize,ar!=null&&ar.order?(Kt.sort_by=ar==null?void 0:ar.field,Kt.direction=(ar==null?void 0:ar.order)==="ascend"?"asc":"desc"):(Kt.sort_by=null,Kt.direction=null),gi(Ye({},Kt)),Vi(Kt)},Oi=()=>{if(!vn){at.ZP.warning("\u8BF7\u8F93\u5165\u91CD\u65B0\u8BC4\u6D4B\u4EFB\u52A1\u5E76\u53D1\u4EBA\u6570");return}jn(!0)},zi=()=>tt(void 0,null,function*(){var _n,ci;if((_n=Nn.current)!=null&&_n.onVerify())return;An(!0);const ar=yield(0,te.ZP)(`/api/exercise_questions/${Cn==null?void 0:Cn.question_id}/resubmit.json`,{method:"post",body:{keyword:Kt.keyword,question_status:Kt.question_status,review:Kt.review_status,success_status:Kt.success_status,use_max_score:Nt,permits:vn,exercise_question_resubmit_id:Ni===1?null:(ci=Cn==null?void 0:Cn.exercise_question_resubmit)==null?void 0:ci.id}});(ar==null?void 0:ar.status)==0&&(yield Ii(),at.ZP.success("\u64CD\u4F5C\u6210\u529F"),jn(!1),je(!1)),An(!1)}),xr=(_n,ci)=>{Kt.page=1,Kt[ci]=_n,gi(Ye({},Kt)),Vi(Kt)},Ce=["","\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 ue.createElement(ue.Fragment,null,ue.createElement("div",{className:yt()(Ke.recalculation,$t),style:Pn},ue.createElement(Ct.Z,{title:Ce[(Cn==null?void 0:Cn.disable_resubmit_reason)||0]},ue.createElement(dt.ZP,{disabled:(Cn==null?void 0:Cn.disable_resubmit)||((nt=Cn==null?void 0:Cn.exercise_question_resubmit)==null?void 0:nt.status)==="running",onClick:()=>je(1),icon:ue.createElement("i",{className:"iconfont icon-zhongxinpingce font14"}),type:"primary",ghost:!0},"\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206")),(Cn==null?void 0:Cn.show_resubmit_history)&&ue.createElement(ue.Fragment,null,((gn=Cn==null?void 0:Cn.exercise_question_resubmit)==null?void 0:gn.status)==="running"?ue.createElement("div",{className:"c-grey-666"},"\u91CD\u65B0\u8BC4\u6D4B\u4E2D\uFF0C\u5F53\u524D\u8FDB\u5EA6",ue.createElement("span",{className:"c-light-primary ml3"},(oi=Cn==null?void 0:Cn.exercise_question_resubmit)==null?void 0:oi.rate)):ue.createElement("div",{className:"c-grey-666"},"\u91CD\u65B0\u8BC4\u6D4B\u6210\u529F",ue.createElement("span",{onClick:()=>{je(2),Ee(1)},className:"current",style:{color:"#3061D0",textDecoration:"underline",margin:"0 3px"}},(zn=Cn==null?void 0:Cn.exercise_question_resubmit)==null?void 0:zn.success_student_count),"\u4EBA\uFF0C\u5931\u8D25",ue.createElement("span",{onClick:()=>{je(2),Ee(2)},className:"current",style:{color:"#E30000",textDecoration:"underline",margin:"0 3px"}},(Ht=Cn==null?void 0:Cn.exercise_question_resubmit)==null?void 0:Ht.fail_count),"\u4EBA"),ue.createElement(Ct.Z,{title:"\u64CD\u4F5C\u8BB0\u5F55"},ue.createElement("i",{onClick:()=>fr(!0),className:"iconfont icon-chakanshenqingjilu c-light-primary current font14"})))),ue.createElement(Ge.default,{centered:!0,open:!!Ni,title:`\u91CD\u65B0\u8BC4\u6D4B${Ni===1?"\u7B97\u5206":"\u7ED3\u679C"}`,width:870,okText:"\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206",onCancel:()=>je(!1),onOk:Oi,afterClose:()=>{fn(!0),Ee(null),gi(Ye({},Sn))}},ue.createElement("div",{className:Ke.filter},Ni===1&&ue.createElement(ue.Fragment,null,ue.createElement("div",{className:Ke.tips},ue.createElement("div",{className:"mb5",style:{color:"#FF9D18"}},ue.createElement("i",{className:"iconfont icon-tishi9 mr10 font14"}),"\u6E29\u99A8\u63D0\u793A"),ue.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"),ue.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"),ue.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")),ue.createElement(St,{className:"mt10",title:"\u9898\u76EE\u72B6\u6001",items:(Ae==null?void 0:Ae.question_status)||[],value:Kt.question_status,onChange:_n=>xr(_n,"question_status")}),ue.createElement(St,{className:"mt10",title:"\u8BC4\u9605\u72B6\u6001",items:(Ae==null?void 0:Ae.review_status)||[],value:Kt.review,onChange:_n=>xr(_n,"review")})),Ni===2&&ue.createElement(ue.Fragment,null,ue.createElement(St,{className:"mt10",title:"\u91CD\u65B0\u8BC4\u6D4B\u7ED3\u679C",items:(Ae==null?void 0:Ae.success_status)||[],value:Kt.success_status,onChange:_n=>xr(_n,"success_status")})),ue.createElement(pe.t7,{className:Ke.input,style:{bottom:Ni===1?10:-5},value:Kt.keyword,onChange:_n=>xr(_n,"keyword"),placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D\u6216\u8005\u5B66\u53F7\u641C\u7D22"})),ue.createElement(Rt.default,{className:"mt20",columns:si,scroll:((Fn=Ae==null?void 0:Ae.data)==null?void 0:Fn.length)>7?{y:300}:{},dataSource:(Ae==null?void 0:Ae.data)||[],loading:Wt,onChange:Ti,pagination:{total:De,pageSize:Kt.per_page,current:Kt.page,hideOnSinglePage:!De,showSizeChanger:!0,pageSizeOptions:["5","10","20","50","100"],showQuickJumper:!0,size:"default",showTotal:ne.rU}}),ue.createElement(Oe.Z,{justify:"space-between",align:"middle",className:"mt10"},ue.createElement(mt.default,{className:"c-black",checked:Nt,onChange:_n=>fn(_n.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)()&&ue.createElement("div",{className:"c-black"},"\u91CD\u65B0\u8BC4\u6D4B\u4EFB\u52A1\u5E76\u53D1\u4EBA\u6570",ue.createElement(ot.Z,{className:"ml10 mr10",value:vn,max:Jt,min:1,precision:0,onChange:_n=>Ft(_n)}),"\u4EBA",ue.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"},ue.createElement("i",{style:{color:"#9096A3"},className:"iconfont icon-tishi5 font13 ml10"}))))),ue.createElement(Ge.default,{centered:!0,title:"\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206",open:pn,width:494,zIndex:1001,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",confirmLoading:lt,destroyOnClose:!0,onOk:zi,onCancel:()=>jn(!1)},ue.createElement(At.default.Item,{className:"mb0",colon:!1,label:"\u9A8C\u8BC1\u7801",name:"code",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u9A8C\u8BC1\u7801"}]},ue.createElement(se.Z,{ref:_n=>Nn.current=_n}))),ue.createElement(Ge.default,{centered:!0,title:"\u64CD\u4F5C\u8BB0\u5F55",open:Mn,width:710,onCancel:()=>fr(!1),footer:null},ue.createElement(Te.Z,{spinning:nn},ue.createElement("div",{className:Ke.operating},hn.map((_n,ci)=>ue.createElement("div",{key:ci,className:Ke.operatingItem},ue.createElement("div",{style:{flex:"0 0 180px"},className:"c-grey-666"},_n==null?void 0:_n.created_at),ue.createElement("div",{className:"c-black"},_n==null?void 0:_n.user_name,"\u64CD\u4F5C\u4E86\u91CD\u65B0\u8BC4\u6D4B\u7B97\u5206"),(_n==null?void 0:_n.status)==="running"?ue.createElement("div",{className:"c-black"},"\u91CD\u65B0\u8BC4\u6D4B\u4E2D\uFF0C\u5F53\u524D\u8FDB\u5EA6",ue.createElement("span",{className:"c-light-primary ml3"},_n==null?void 0:_n.rate)):ue.createElement("div",{className:"c-black"},"\u91CD\u65B0\u8BC4\u6D4B\u6210\u529F",ue.createElement("span",{style:{color:"#3061D0",margin:"0 3px"}},_n==null?void 0:_n.success_student_count),"\u4EBA\uFF0C\u5931\u8D25",ue.createElement("span",{style:{color:"#E30000",margin:"0 3px"}},_n==null?void 0:_n.fail_count),"\u4EBA")))),ue.createElement("div",{style:{height:20}}))))}},82438:function(Un,ai,Le){"use strict";Le.d(ai,{Z:function(){return Ct}});var ue=Le(59301),Ke={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"},ft=Le(62957),yt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAPCAYAAADUFP50AAAAAXNSR0IArs4c6QAAAUFJREFUOE+V0ktKw1AUxvH/rVqIxT4wkgwEUSmK4APRBfiYCKU7cOZEBOkadAMZiwhuwJETBQciFRTtwJkPBLW2BRGrRanU9kpN2sSYiGaWc/PjuznnCN2Qh8AkPo+AzXxKLLiPhW7ICtDqB4GzQkqM/huGFZgZcDCBBDaaicsTMKbZH2xfwdY5/ICAEGSasC0AwRYblj+gKkENwfy4WS9V4LHsgsk49EZteJKHdBa6w7AybdZzr3D64ILxGKjtNrx9gfsSRBSYtf6xZh1/u+qQClrIhtdFuHmGvhisJcz65RPsZl2Jc/3QE7FhpgDHuT80x2+O9cR1K/GiCDt3rkQ/+Ns43gDFD0YVmHIuQGOOmiGTARhxwkGd1cZ7Vwd0OppWr3911StpcV++Iwn67q/kyBMuHchErcqwFxT1XZXsfQJqo2zI6kdI4QAAAABJRU5ErkJggg==",mt="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=(dt,Ge,Rt)=>new Promise((ot,At)=>{var Te=de=>{try{te(Rt.next(de))}catch(se){At(se)}},ne=de=>{try{te(Rt.throw(de))}catch(se){At(se)}},te=de=>de.done?ot(de.value):Promise.resolve(de.value).then(Te,ne);te((Rt=Rt.apply(dt,Ge)).next())}),Ct=({type:dt,resdata:Ge,onok:Rt,oktext:ot,okloading:At})=>{const[Te,ne]=(0,ue.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:be,no_use_num:Ie,repeat_shixun_num:Re,student_count:rt,total_num:et,use_num:Ye}=Ge;let ut=de>0||dt==="exercise";(0,ue.useEffect)(()=>{(Ge==null?void 0:Ge.student_count)>0&&ne(!0)},[Ge]),console.log("---11",At),(0,ue.useEffect)(()=>{At||ne(!1)},[At]);const tt=()=>{if(dt==="exercise"&&se===1)return ue.createElement(ue.Fragment,null,"\u8BFE\u5802\u5185\u6709",ue.createElement("span",{className:Ke.orangeColor},rt),"\u540D\u5B66\u751F\u5DF2\u5728\u5176\u4ED6\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u5176\u4E2D\u7684",ue.createElement("span",{className:Ke.orangeColor},Ye),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C",ue.createElement("span",{className:Ke.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(dt==="exercise"&&se===2)return ue.createElement(ue.Fragment,null,"\u8BFE\u5802\u5185\u6709",ue.createElement("span",{className:Ke.orangeColor},rt),"\u540D\u5B66\u751F\u5DF2\u5728\u8BFE\u5802\u5B9E\u9A8C\u4E2D\u6311\u6218\u8FC7\u5176\u4E2D\u7684",ue.createElement("span",{className:Ke.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",ue.createElement("span",{className:Ke.redColor},"\u91CD\u590D\u53D1\u5E03\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(dt==="shixun"&&se===1)return ue.createElement(ue.Fragment,null,"\u8BFE\u5802\u5185\u6709",ue.createElement("span",{className:Ke.orangeColor},rt),"\u540D\u5B66\u751F\u5DF2\u5728\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u8BE5\u5B9E\u8DF5\u9879\u76EE\uFF0C",ue.createElement("span",{className:Ke.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(dt==="shixun"&&se===2)return ue.createElement(ue.Fragment,null,"\u8BFE\u5802\u5185\u6709",ue.createElement("span",{className:Ke.orangeColor},rt),"\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",ue.createElement("span",{className:Ke.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(dt==="subject"&&se===1)return ue.createElement(ue.Fragment,null,"\u8BFE\u5802\u5185\u6709",ue.createElement("span",{className:Ke.orangeColor},rt),"\u540D\u5B66\u751F\u5DF2\u5728\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u5176\u4E2D\u7684",ue.createElement("span",{className:Ke.orangeColor},Ye),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C",ue.createElement("span",{className:Ke.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(dt==="subject"&&se===2)return ue.createElement(ue.Fragment,null,"\u8BFE\u5802\u5185\u6709 ",ue.createElement("span",{className:Ke.orangeColor},rt)," \u540D\u5B66\u751F\u5DF2\u5728\u8BFE\u5802\u5B9E\u9A8C\u6311\u6218\u8FC7\u5176\u4E2D\u7684 ",ue.createElement("span",{className:Ke.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",ue.createElement("span",{className:Ke.redColor},"\u91CD\u590D\u53D1\u9001\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(dt==="exercisepush")return ue.createElement(ue.Fragment,null,"\u8BFE\u5802\u5185\u6709",ue.createElement("span",{className:Ke.orangeColor},rt),"\u540D\u5B66\u751F\u5DF2\u5728\u5176\u4ED6\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u8BD5\u5377\u4E2D\u7684",ue.createElement("span",{className:Ke.orangeColor},Ye),"\u4E2A\u5B9E\u8DF5\u9879\u76EE \uFF0C",ue.createElement("span",{className:Ke.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(dt==="shixunpush"&&se===1)return ue.createElement(ue.Fragment,null,"\u8BFE\u5802\u5185\u6709",ue.createElement("span",{className:Ke.orangeColor},rt),"\u540D\u5B66\u751F\u5DF2\u5728\u8003\u8BD5\u4E2D\u6311\u6218\u8FC7\u5176\u4E2D\u7684",ue.createElement("span",{className:Ke.orangeColor},Ye),"\u4E2A\u5B9E\u8DF5\u9879\u76EE\uFF0C",ue.createElement("span",{className:Ke.redColor},"\u91CD\u590D\u53D1\u5E03\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"));if(dt==="shixunpush"&&se===2)return ue.createElement(ue.Fragment,null,"\u8BFE\u5802\u5185\u6709",ue.createElement("span",{className:Ke.orangeColor},rt),"\u540D\u5B66\u751F\u5DF2\u5728\u8BFE\u5802\u5B9E\u9A8C\u4E2D\u6311\u6218\u8FC7",ue.createElement("span",{className:Ke.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",ue.createElement("span",{className:Ke.redColor},"\u91CD\u590D\u53D1\u5E03\u4F1A\u5BFC\u81F4\u8FD9\u90E8\u5206\u5B66\u751F\u65E0\u6CD5\u518D\u63D0\u4EA4\u4F5C\u4E1A\u3002"))},wt=()=>{if(dt==="exercise"||dt==="subject"||dt==="exercisepush"||dt==="shixunpush")return ue.createElement("div",{style:{marginTop:20}},we>0&&ue.createElement("div",null,ue.createElement("span",{className:Ke.flex},ue.createElement("img",{src:mt,style:{width:14}}),ue.createElement("span",{className:Ke.statustitle},"\u4E0D\u652F\u6301\u590D\u5236\u7684\u5B9E\u8DF5\u9879\u76EE")),ue.createElement("div",{className:Ke.statusbody},dt==="exercise"&&ue.createElement("div",{style:{marginBottom:15}},"\u6CA1\u6709\u590D\u5236\u6743\u9650\u7684\u5B9E\u8DF5\u9879\u76EE\uFF0C",ue.createElement("span",{className:Ke.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"),(dt==="subject"||dt==="exercisepush")&&ue.createElement("div",{style:{marginBottom:15}},"\u6CA1\u6709\u590D\u5236\u6743\u9650\u7684\u5B9E\u8DF5\u9879\u76EE\uFF0C",ut&&ue.createElement("span",{className:Ke.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"),dt==="shixunpush"&&ue.createElement("div",{style:{marginBottom:15}},"\u6CA1\u6709\u590D\u5236\u6743\u9650\u7684\u5B9E\u8DF5\u9879\u76EE\uFF0C",ut&&ue.createElement("span",{className:Ke.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"),ue.createElement("div",null,ye==null?void 0:ye.map((St,Lt)=>ue.createElement("a",{href:`/shixuns/${St.identifier}/challenges`,target:"_blank"},"\u300A",St==null?void 0:St.name,"\u300B",Lt+1!==we&&"\u3001"))))),de>0&&ue.createElement("div",{style:{marginTop:20}},ue.createElement("span",{className:Ke.flex},ue.createElement("img",{src:yt,style:{width:14}}),ue.createElement("span",{className:Ke.statustitle},"\u652F\u6301\u590D\u5236\u7684\u5B9E\u8DF5\u9879\u76EE")),ue.createElement("div",{className:Ke.statusbody},dt==="exercise"&&ue.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"),(dt==="subject"||dt==="exercisepush")&&ue.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"),dt==="shixunpush"&&ue.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"),ue.createElement("div",null,te==null?void 0:te.map((St,Lt)=>ue.createElement("a",{href:`/shixuns/${St.identifier}/challenges`,target:"_blank"},"\u300A",St==null?void 0:St.name,"\u300B",Lt+1!==de&&"\u3001"))))));if(dt==="shixun")return ue.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 ue.createElement(ft.default,{open:Te,onCancel:()=>{ne(!1)},cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",width:700,centered:!0,cancelButtonProps:{style:{display:!ut&&"none"}},zIndex:1003,confirmLoading:At,okText:ut?ot:"\u6211\u77E5\u9053\u4E86",onOk:()=>Oe(void 0,null,function*(){ut?yield Rt([...te,...be]):ne(!1)})},ue.createElement("div",{style:{maxHeight:600,overflow:"auto"}},tt(),wt()))}},69304:function(Un,ai,Le){"use strict";Le.d(ai,{Z:function(){return Oe}});var ue=Le(59301),Ke={btn:"btn___kReTL",redBtn:"redBtn___UFEL0"},ft=Le(92310),yt=Le.n(ft),Oe=({className:at,style:Ct,state:dt,onClick:Ge})=>{var Rt,ot;return ue.createElement("div",{onClick:Ge,className:yt()(dt?(Rt=Ke)==null?void 0:Rt.redBtn:(ot=Ke)==null?void 0:ot.btn,at),style:Ct},dt?ue.createElement(ue.Fragment,null,ue.createElement("i",{className:"iconfont icon-biaoji1"}),ue.createElement("span",null,"\u53D6\u6D88\u6807\u8BB0\u9519\u9898")):ue.createElement(ue.Fragment,null,ue.createElement("i",{className:"iconfont icon-biaojigaiti"}),ue.createElement("span",null,"\u6807\u8BB0\u9519\u9898")))}},97692:function(Un,ai,Le){"use strict";Le.d(ai,{h:function(){return we}});var ue=Le(59301),Ke=Le(82326),ft=Le(28284),yt=Le(99571),mt=Le(89780),Oe=Le.n(mt),at=Le(37036),Ct=Le(95625),dt=Object.defineProperty,Ge=Object.defineProperties,Rt=Object.getOwnPropertyDescriptors,ot=Object.getOwnPropertySymbols,At=Object.prototype.hasOwnProperty,Te=Object.prototype.propertyIsEnumerable,ne=(be,Ie,Re)=>Ie in be?dt(be,Ie,{enumerable:!0,configurable:!0,writable:!0,value:Re}):be[Ie]=Re,te=(be,Ie)=>{for(var Re in Ie||(Ie={}))At.call(Ie,Re)&&ne(be,Re,Ie[Re]);if(ot)for(var Re of ot(Ie))Te.call(Ie,Re)&&ne(be,Re,Ie[Re]);return be},de=(be,Ie)=>Ge(be,Rt(Ie));const se=Ke.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"]};ai.Z=({callback:be,onCancel:Ie})=>{const[Re,rt]=(0,ue.useState)("python");function et(ut){rt(ye[ut][1])}function Ye(ut){be(ut)}return ue.createElement(ft.default,de(te({},pe),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:Ye,style:{width:500}}),ue.createElement(ft.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},ue.createElement(Ke.default,{getPopupContainer:ut=>ut.parentNode,onChange:et},Object.keys(ye).map(ut=>ue.createElement(se,{key:ut,value:ut},ye[ut][0])))),ue.createElement(ft.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},ue.createElement(we,{mode:Re})),ue.createElement("div",{className:"flex-container flex-end"},ue.createElement(yt.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),ue.createElement(yt.ZP,{type:"ghost",onClick:Ie},"\u53D6\u6D88")))};function we({value:be,onChange:Ie,mode:Re,options:rt={}}){const et=(0,ue.useRef)(),[Ye,ut]=(0,ue.useState)();return(0,ue.useEffect)(()=>{if(Ye){let tt=function(wt){const St=wt.getValue();Ie&&Ie(St)};return Ye.on("change",tt),()=>{Ye.off("change",tt)}}},[Ye,Ie]),(0,ue.useEffect)(()=>{Ye&&Ye.setOption("mode",Re)},[Ye,Re]),(0,ue.useEffect)(()=>{Ye&&(be!==Ye.getValue()||be==="")&&setTimeout(()=>{Ye.setValue(be||"")},300)},[Ye,be]),(0,ue.useEffect)(()=>{if(et.current&&!Ye){const tt=Oe().fromTextArea(et.current,te({mode:Re,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},rt));ut(tt)}},[et.current,Ye]),ue.createElement("div",{className:"my-codemirror-container"},ue.createElement("textarea",{ref:et}))}},12290:function(Un,ai,Le){"use strict";Le.d(ai,{Z:function(){return Qn}});var ue=Le(59301),Ke=Le(89780),ft=Le.n(Ke),yt=Le(76374),mt=Le(37036),Oe=Le(6313),at=Le(25717),Ct=Le(99498),dt=Le(25419),Ge=Le(67549),Rt=Le(85149),ot=({value:Bt="",className:Tt,showTextOnly:kt,showLines:ui,style:Yn={}})=>{const vi=(0,ue.useMemo)(()=>"",[Bt]);return ue.createElement(ue.Fragment,null,ue.createElement("div",{dangerouslySetInnerHTML:{__html:vi}}))},At=Le(59301),Te=Object.defineProperty,ne=Object.defineProperties,te=Object.getOwnPropertyDescriptors,de=Object.getOwnPropertySymbols,se=Object.prototype.hasOwnProperty,pe=Object.prototype.propertyIsEnumerable,ye=(Bt,Tt,kt)=>Tt in Bt?Te(Bt,Tt,{enumerable:!0,configurable:!0,writable:!0,value:kt}):Bt[Tt]=kt,we=(Bt,Tt)=>{for(var kt in Tt||(Tt={}))se.call(Tt,kt)&&ye(Bt,kt,Tt[kt]);if(de)for(var kt of de(Tt))pe.call(Tt,kt)&&ye(Bt,kt,Tt[kt]);return Bt},be=(Bt,Tt)=>ne(Bt,te(Tt));let Ie=[{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 Re({onActionCallback:Bt,title:Tt,icon:kt,actionName:ui,className:Yn="",children:vi}){function yn(){Bt(ui)}return At.createElement("a",{title:Tt,className:Yn,onClick:yn},At.createElement("i",{className:`${kt}`}),vi)}var rt=({watch:Bt,showNullButton:Tt,showNullProgramButton:kt,onActionCallback:ui,fullScreen:Yn,insertTemp:vi,hidetoolBar:yn,extraUse:Kn})=>{const It=[...Ie,{title:`${Bt?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"}`,icon:`${Bt?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"}`,actionName:"trigger-watch"}];return At.createElement("ul",{className:"markdown-toolbar-container"},!yn&&It.map((_t,hi)=>At.createElement("li",{key:hi},_t.actionName?At.createElement(Re,be(we({},_t),{onActionCallback:ui})):At.createElement("span",{className:"v-line"}))),Tt?At.createElement("li",null,At.createElement(Re,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:ui},At.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,kt?At.createElement(At.Fragment,null,At.createElement("li",null,At.createElement(Re,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-signal",onActionCallback:ui},At.createElement("span",{className:"fill-tip"},"+\u5355\u884C\u586B\u7A7A\u9879"))),At.createElement("li",null,At.createElement(Re,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-multiple",onActionCallback:ui},At.createElement("span",{className:"fill-tip"},"+\u591A\u884C\u586B\u7A7A\u9879")))):null,vi&&At.createElement("li",null,At.createElement(Re,{icon:"md-iconfont icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:`inster-template-${vi}`,onActionCallback:ui},At.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),Kn&&At.createElement("li",null,Kn),At.createElement("li",{className:"btn-full-screen"},At.createElement(Re,{icon:`${Yn?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"}`,title:Yn?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:ui})))},et=Le(79346),Ye=Le(28284),ut=Le(37568),tt=Le(99571),wt=Object.defineProperty,St=Object.defineProperties,Lt=Object.getOwnPropertyDescriptors,mn=Object.getOwnPropertySymbols,$t=Object.prototype.hasOwnProperty,Pn=Object.prototype.propertyIsEnumerable,Ot=(Bt,Tt,kt)=>Tt in Bt?wt(Bt,Tt,{enumerable:!0,configurable:!0,writable:!0,value:kt}):Bt[Tt]=kt,ct=(Bt,Tt)=>{for(var kt in Tt||(Tt={}))$t.call(Tt,kt)&&Ot(Bt,kt,Tt[kt]);if(mn)for(var kt of mn(Tt))Pn.call(Tt,kt)&&Ot(Bt,kt,Tt[kt]);return Bt},nt=(Bt,Tt)=>St(Bt,Lt(Tt));const gn={labelCol:{span:4},wrapperCol:{span:20}};var oi=({callback:Bt,onCancel:Tt})=>{function kt(ui){Bt(ui)}return ue.createElement(Ye.default,nt(ct({},gn),{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:kt,style:{width:500}}),ue.createElement(Ye.default.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},ue.createElement(ut.default,null)),ue.createElement(Ye.default.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},ue.createElement(ut.default,null)),ue.createElement("div",{className:"flex-container flex-end"},ue.createElement(tt.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),ue.createElement(tt.ZP,{type:"ghost",onClick:Tt},"\u53D6\u6D88")))},zn=Le(97692),Ht=Le(28451),Fn=Le(62957),Cn=Le(77019),ii=Le(73524),Wt=Le(59301),Hn=({callback:Bt,onCancel:Tt})=>{const kt=document.createElement("canvas"),ui=kt.getContext("2d");kt.width=1e3,kt.height=800,ui.fillStyle="#ffffff",ui.fillRect(0,0,kt.width,kt.height);const Yn=kt.toDataURL("image/png");return Wt.createElement(Fn.default,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1},Wt.createElement(Cn.Z,{style:{height:"100vh"}},Wt.createElement(ii.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:Yn,visible:!0,title:String(Date.now())},onOk:vi=>{Bt({src:vi.url})},onClose:Tt})))},lt=Le(12378);function An(){go.CommandHandler.call(this),this._arrowKeyBehavior="move",this._pasteOffset=new go.Point(10,10),this._lastPasteOffset=new go.Point(0,0)}go.Diagram.inherit(An,go.CommandHandler),An.prototype.canAlignSelection=function(){var Bt=this.diagram;return!(Bt===null||Bt.isReadOnly||Bt.isModelReadOnly||Bt.selection.count<2)},An.prototype.alignLeft=function(){var Bt=this.diagram;Bt.startTransaction("aligning left");var Tt=1/0;Bt.selection.each(function(kt){kt instanceof go.Link||(Tt=Math.min(kt.position.x,Tt))}),Bt.selection.each(function(kt){kt instanceof go.Link||kt.move(new go.Point(Tt,kt.position.y))}),Bt.commitTransaction("aligning left")},An.prototype.alignRight=function(){var Bt=this.diagram;Bt.startTransaction("aligning right");var Tt=-1/0;Bt.selection.each(function(kt){if(!(kt instanceof go.Link)){var ui=kt.actualBounds.x+kt.actualBounds.width;Tt=Math.max(ui,Tt)}}),Bt.selection.each(function(kt){kt instanceof go.Link||kt.move(new go.Point(Tt-kt.actualBounds.width,kt.position.y))}),Bt.commitTransaction("aligning right")},An.prototype.alignTop=function(){var Bt=this.diagram;Bt.startTransaction("alignTop");var Tt=1/0;Bt.selection.each(function(kt){kt instanceof go.Link||(Tt=Math.min(kt.position.y,Tt))}),Bt.selection.each(function(kt){kt instanceof go.Link||kt.move(new go.Point(kt.position.x,Tt))}),Bt.commitTransaction("alignTop")},An.prototype.alignBottom=function(){var Bt=this.diagram;Bt.startTransaction("aligning bottom");var Tt=-1/0;Bt.selection.each(function(kt){if(!(kt instanceof go.Link)){var ui=kt.actualBounds.y+kt.actualBounds.height;Tt=Math.max(ui,Tt)}}),Bt.selection.each(function(kt){kt instanceof go.Link||kt.move(new go.Point(kt.actualBounds.x,Tt-kt.actualBounds.height))}),Bt.commitTransaction("aligning bottom")},An.prototype.alignCenterX=function(){var Bt=this.diagram,Tt=Bt.selection.first();if(Tt){Bt.startTransaction("aligning Center X");var kt=Tt.actualBounds.x+Tt.actualBounds.width/2;Bt.selection.each(function(ui){ui instanceof go.Link||ui.move(new go.Point(kt-ui.actualBounds.width/2,ui.actualBounds.y))}),Bt.commitTransaction("aligning Center X")}},An.prototype.alignCenterY=function(){var Bt=this.diagram,Tt=Bt.selection.first();if(Tt){Bt.startTransaction("aligning Center Y");var kt=Tt.actualBounds.y+Tt.actualBounds.height/2;Bt.selection.each(function(ui){ui instanceof go.Link||ui.move(new go.Point(ui.actualBounds.x,kt-ui.actualBounds.height/2))}),Bt.commitTransaction("aligning Center Y")}},An.prototype.alignColumn=function(Bt){var Tt=this.diagram;Tt.startTransaction("align Column"),Bt===void 0&&(Bt=0),Bt=parseFloat(Bt);var kt=new Array;Tt.selection.each(function(Kn){Kn instanceof go.Link||kt.push(Kn)});for(var ui=0;ui<kt.length-1;ui++){var Yn=kt[ui],vi=Yn.actualBounds.y+Yn.actualBounds.height+Bt,yn=kt[ui+1];yn.move(new go.Point(Yn.actualBounds.x,vi))}Tt.commitTransaction("align Column")},An.prototype.alignRow=function(Bt){Bt===void 0&&(Bt=0),Bt=parseFloat(Bt);var Tt=this.diagram;Tt.startTransaction("align Row");var kt=new Array;Tt.selection.each(function(Kn){Kn instanceof go.Link||kt.push(Kn)});for(var ui=0;ui<kt.length-1;ui++){var Yn=kt[ui],vi=Yn.actualBounds.x+Yn.actualBounds.width+Bt,yn=kt[ui+1];yn.move(new go.Point(vi,Yn.actualBounds.y))}Tt.commitTransaction("align Row")},An.prototype.canRotate=function(Bt){var Tt=this.diagram;return!(Tt===null||Tt.isReadOnly||Tt.isModelReadOnly||Tt.selection.count<1)},An.prototype.rotate=function(Bt){Bt===void 0&&(Bt=90);var Tt=this.diagram;Tt.startTransaction("rotate "+Bt.toString());var Tt=this.diagram;Tt.selection.each(function(kt){kt instanceof go.Link||kt instanceof go.Group||(kt.angle+=Bt)}),Tt.commitTransaction("rotate "+Bt.toString())},An.prototype.pullToFront=function(){var Bt=this.diagram;Bt.startTransaction("pullToFront");var Tt=new go.Map;Bt.selection.each(function(kt){Tt.set(kt.layer,0)}),Tt.iteratorKeys.each(function(kt){var ui=0;kt.parts.each(function(Yn){if(!Yn.isSelected){var vi=Yn.zOrder;isNaN(vi)?Yn.zOrder=0:ui=Math.max(ui,vi)}}),Tt.set(kt,ui)}),Bt.selection.each(function(kt){An._assignZOrder(kt,Tt.get(kt.layer)+1)}),Bt.commitTransaction("pullToFront")},An.prototype.pushToBack=function(){var Bt=this.diagram;Bt.startTransaction("pushToBack");var Tt=new go.Map;Bt.selection.each(function(kt){Tt.set(kt.layer,0)}),Tt.iteratorKeys.each(function(kt){var ui=0;kt.parts.each(function(Yn){if(!Yn.isSelected){var vi=Yn.zOrder;isNaN(vi)?Yn.zOrder=0:ui=Math.min(ui,vi)}}),Tt.set(kt,ui)}),Bt.selection.each(function(kt){An._assignZOrder(kt,Tt.get(kt.layer)-1-An._findGroupDepth(kt))}),Bt.commitTransaction("pushToBack")},An._assignZOrder=function(Bt,Tt,kt){kt===void 0&&(kt=Bt),Bt.layer===kt.layer&&(Bt.zOrder=Tt),Bt instanceof go.Group&&Bt.memberParts.each(function(ui){An._assignZOrder(ui,Tt+1,kt)})},An._findGroupDepth=function(Bt){if(Bt instanceof go.Group){var Tt=0;return Bt.memberParts.each(function(kt){Tt=Math.max(Tt,An._findGroupDepth(kt))}),Tt+1}else return 0},An.prototype.doKeyDown=function(){var Bt=this.diagram;if(Bt!==null){var Tt=Bt.lastInput;if(Tt.key==="Up"||Tt.key==="Down"||Tt.key==="Left"||Tt.key==="Right"){var kt=this.arrowKeyBehavior;if(kt==="none")return;if(kt==="select"){this._arrowKeySelect();return}else if(kt==="move"){this._arrowKeyMove();return}else if(kt==="tree"){this._arrowKeyTree();return}}go.CommandHandler.prototype.doKeyDown.call(this)}},An.prototype._getAllParts=function(){var Bt=new Array;return this.diagram.nodes.each(function(Tt){Bt.push(Tt)}),this.diagram.parts.each(function(Tt){Bt.push(Tt)}),Bt},An.prototype._arrowKeyMove=function(){var Bt=this.diagram,Tt=Bt.lastInput,kt=0,ui=0;if(Tt.control||Tt.meta)kt=1,ui=1;else if(Bt.grid!==null){var Yn=Bt.grid.gridCellSize;ui=Yn.width,kt=Yn.height}Bt.startTransaction("arrowKeyMove"),Bt.selection.each(function(vi){Tt.key==="Up"?vi.move(new go.Point(vi.actualBounds.x,vi.actualBounds.y-kt)):Tt.key==="Down"?vi.move(new go.Point(vi.actualBounds.x,vi.actualBounds.y+kt)):Tt.key==="Left"?vi.move(new go.Point(vi.actualBounds.x-ui,vi.actualBounds.y)):Tt.key==="Right"&&vi.move(new go.Point(vi.actualBounds.x+ui,vi.actualBounds.y))}),Bt.commitTransaction("arrowKeyMove")},An.prototype._arrowKeySelect=function(){var Bt=this.diagram,Tt=Bt.lastInput,kt=null;Tt.key==="Up"?kt=this._findNearestPartTowards(270):Tt.key==="Down"?kt=this._findNearestPartTowards(90):Tt.key==="Left"?kt=this._findNearestPartTowards(180):Tt.key==="Right"&&(kt=this._findNearestPartTowards(0)),kt!==null&&(Tt.shift?kt.isSelected=!0:Tt.control||Tt.meta?kt.isSelected=!kt.isSelected:Bt.select(kt))},An.prototype._findNearestPartTowards=function(Bt){var Tt=this.diagram.selection.first();if(Tt===null)return null;for(var kt=Tt.actualBounds.center,ui=this._getAllParts(),Yn=1/0,vi=Tt,yn=0;yn<ui.length;yn++){var Kn=ui[yn];if(Kn!==Tt&&Kn.canSelect()){var It=Kn.actualBounds.center,_t=kt.directionPoint(It),hi=this._angleCloseness(_t,Bt);if(hi<=45){var it=kt.distanceSquaredPoint(It);it*=1+Math.sin(hi*Math.PI/180),it<Yn&&(Yn=it,vi=Kn)}}}return vi},An.prototype._angleCloseness=function(Bt,Tt){return Math.min(Math.abs(Tt-Bt),Math.min(Math.abs(Tt+360-Bt),Math.abs(Tt-360-Bt)))},An.prototype._arrowKeyTree=function(){var Bt=this.diagram,Tt=Bt.selection.first();if(Tt instanceof go.Node){var kt=Bt.lastInput;if(kt.key==="Right"){if(!Tt.isTreeLeaf)if(!Tt.isTreeExpanded)Bt.commandHandler.canExpandTree(Tt)&&Bt.commandHandler.expandTree(Tt);else{var ui=this._sortTreeChildrenByY(Tt).first();ui!==null&&Bt.select(ui)}}else if(kt.key==="Left")if(!Tt.isTreeLeaf&&Tt.isTreeExpanded)Bt.commandHandler.canCollapseTree(Tt)&&Bt.commandHandler.collapseTree(Tt);else{var Yn=Tt.findTreeParentNode();Yn!==null&&Bt.select(Yn)}else if(kt.key==="Up"){var Yn=Tt.findTreeParentNode();if(Yn!==null){var vi=this._sortTreeChildrenByY(Yn),yn=vi.indexOf(Tt);if(yn>0){for(var Kn=vi.elt(yn-1);Kn!==null&&Kn.isTreeExpanded&&!Kn.isTreeLeaf;){var It=this._sortTreeChildrenByY(Kn);Kn=It.last()}Kn!==null&&Bt.select(Kn)}else Bt.select(Yn)}}else if(kt.key==="Down")if(Tt.isTreeExpanded&&!Tt.isTreeLeaf){var ui=this._sortTreeChildrenByY(Tt).first();ui!==null&&Bt.select(ui)}else for(;Tt!==null;){var Yn=Tt.findTreeParentNode();if(Yn===null)break;var vi=this._sortTreeChildrenByY(Yn),yn=vi.indexOf(Tt);if(yn<vi.length-1){Bt.select(vi.elt(yn+1));break}else Tt=Yn}var _t=Bt.selection.first();_t!==null&&Bt.scrollToRect(_t.actualBounds)}},An.prototype._sortTreeChildrenByY=function(Bt){var Tt=new go.List().addAll(Bt.findTreeChildrenNodes());return Tt.sort(function(kt,ui){var Yn=kt.location,vi=ui.location;return Yn.y<vi.y?-1:Yn.y>vi.y?1:Yn.x<vi.x?-1:Yn.x>vi.x?1:0}),Tt},An.prototype.copyToClipboard=function(Bt){go.CommandHandler.prototype.copyToClipboard.call(this,Bt),this._lastPasteOffset.set(this.pasteOffset)},An.prototype.pasteFromClipboard=function(){var Bt=go.CommandHandler.prototype.pasteFromClipboard.call(this);return this.diagram.moveParts(Bt,this._lastPasteOffset),this._lastPasteOffset.add(this.pasteOffset),Bt},Object.defineProperty(An.prototype,"arrowKeyBehavior",{get:function(){return this._arrowKeyBehavior},set:function(Bt){if(Bt!=="move"&&Bt!=="select"&&Bt!=="scroll"&&Bt!=="tree"&&Bt!=="none")throw new Error('DrawCommandHandler.arrowKeyBehavior must be either "move", "select", "scroll", "tree", or "none", not: '+Bt);this._arrowKeyBehavior=Bt}}),Object.defineProperty(An.prototype,"pasteOffset",{get:function(){return this._pasteOffset},set:function(Bt){if(!(Bt instanceof go.Point))throw new Error("DrawCommandHandler.pasteOffset must be a Point, not: "+Bt);this._pasteOffset.set(Bt)}});var Ni=An,je=Le(74413),Me=Le(5269),Ee=Le(99064),De={myPaletteDiv:"myPaletteDiv___Xjz2I",flowChartWrp:"flowChartWrp____f45r",maxH60:"maxH60___Pd4Re"},We=Le(24065),Ae=Le(59301),Je=(Bt,Tt,kt)=>new Promise((ui,Yn)=>{var vi=It=>{try{Kn(kt.next(It))}catch(_t){Yn(_t)}},yn=It=>{try{Kn(kt.throw(It))}catch(_t){Yn(_t)}},Kn=It=>It.done?ui(It.value):Promise.resolve(It.value).then(vi,yn);Kn((kt=kt.apply(Bt,Tt)).next())});function Nt({onCancel:Bt,callback:Tt}){let kt=(0,ue.useRef)(),ui=(0,ue.useRef)(),Yn=(0,ue.useRef)(),vi=(0,ue.useRef)(!1);const yn=(0,ue.useRef)(!1),[Kn,It]=(0,ue.useState)(0);function _t(){const it=lt.bx.make,sn={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"};kt.current=new lt.S0(ui.current,{padding:20,grid:it(lt.s_,"Grid",it(lt.bn,"LineH",{stroke:"lightgray",strokeWidth:.5}),it(lt.bn,"LineV",{stroke:"lightgray",strokeWidth:.5})),"draggingTool.isGridSnapEnabled":!0,handlesDragDropForTopLevelParts:!0,mouseDrop:li=>{var nr=li.diagram.commandHandler.addTopLevelParts(li.diagram.selection,!0);nr||li.diagram.currentTool.doCancel()},commandHandler:it(Ni),"clickCreatingTool.archetypeNodeData":{text:"\u672A\u547D\u540D",fill:null,stroke:null,borderColor:"rgba(0,0,0,0)"},PartCreated:li=>{var nr=li.subject;nr.location=nr.location.copy().snapToGridPoint(li.diagram.grid.gridOrigin,li.diagram.grid.gridCellSize),setTimeout(()=>{li.diagram.commandHandler.editTextBlock()},20)},"commandHandler.archetypeGroupData":{isGroup:!0,text:"NEW GROUP"},SelectionGrouped:li=>{var nr=li.subject;setTimeout(()=>{li.diagram.commandHandler.editTextBlock()})},LinkRelinked:li=>{var nr=li.parameter.part;nr.invalidateConnectedLinks();var Sr=li.subject;li.diagram.toolManager.linkingTool.isForwards?Sr.toNode.invalidateConnectedLinks():Sr.fromNode.invalidateConnectedLinks()},"undoManager.isEnabled":!0}),kt.current.nodeTemplate=it(lt.NB,"Auto",{locationSpot:lt.z6.Center,locationObjectName:"SHAPE",desiredSize:new lt.$u(120,60),minSize:new lt.$u(40,40),resizable:!0,resizeCellSize:new lt.$u(10,10),rotatable:!0},new lt.KX("location","loc",lt.E9.parse).makeTwoWay(lt.E9.stringify),new lt.KX("desiredSize","size",lt.$u.parse).makeTwoWay(lt.$u.stringify),it(lt.bn,{name:"SHAPE",fill:sn.white,cursor:"pointer",portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:lt.z6.AllSides,toSpot:lt.z6.AllSides},new lt.KX("figure"),new lt.KX("fill"),new lt.KX("stroke","borderColor"),new lt.KX("strokeWidth","thickness"),new lt.KX("strokeDashArray","dash")),it(lt.bn,{width:100,height:20,strokeWidth:0,fill:"transparent"}),it(lt.al,{margin:1,textAlign:"center",overflow:lt.al.OverflowEllipsis,editable:!0},new lt.KX("text").makeTwoWay(),new lt.KX("stroke","color"))),kt.current.nodeTemplate.toolTip=it("ToolTip",it(lt.s_,"Vertical",{maxSize:new lt.$u(200,NaN)},it(lt.al,{font:"bold 10pt sans-serif",textAlign:"center"},new lt.KX("text")),it(lt.al,{font:"10pt sans-serif",textAlign:"center"},new lt.KX("text","details"))));function Dn(li,nr){var Sr=(vr,Ir)=>{vr.handled=!0,vr.diagram.model.commit(bo=>{var fo=Ir.part.adornedPart,so=new lt.E9().setRectSpot(fo.actualBounds,li);so.subtract(fo.location),so.scale(2,2),so.x+=Math.sign(so.x)*130,so.y+=Math.sign(so.y)*130,so.add(fo.location),so.snapToGridPoint(vr.diagram.grid.gridOrigin,vr.diagram.grid.gridCellSize);var lo=bo.copyNodeData(fo.data);bo.setGroupKeyForNodeData(lo,bo.getGroupKeyForNodeData(fo.data)),bo.addNodeData(lo);var Tn={from:fo.key,to:bo.getKeyForNodeData(lo)};bo.addLinkData(Tn);var qo=vr.diagram.findNodeForData(lo);qo.location=so,vr.diagram.select(qo),setTimeout(()=>{vr.diagram.commandHandler.editTextBlock()},20)})};return it(lt.bn,{figure:nr,alignment:li,alignmentFocus:li.opposite(),width:li.equals(lt.z6.Top)||li.equals(lt.z6.Bottom)?25:18,height:li.equals(lt.z6.Top)||li.equals(lt.z6.Bottom)?18:25,fill:"orange",stroke:sn.white,strokeWidth:4,mouseEnter:(vr,Ir)=>Ir.fill="dodgerblue",mouseLeave:(vr,Ir)=>Ir.fill="orange",isActionable:!0,click:Sr,contextClick:Sr})}function Di(li){return it(lt.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:(nr,Sr)=>Sr.fill="dodgerblue",mouseLeave:(nr,Sr)=>Sr.fill="orange",click:(nr,Sr)=>{nr.diagram.commandHandler.showContextMenu(Sr.part.adornedPart)}},li||{})}kt.current.nodeTemplate.selectionAdornmentTemplate=it(lt.uz,"Spot",it(lt.Vm,{padding:10}),Dn(lt.z6.Top,"TriangleUp"),Dn(lt.z6.Left,"TriangleLeft"),Dn(lt.z6.Right,"TriangleRight"),Dn(lt.z6.Bottom,"TriangleDown"),Di({alignment:new lt.z6(.75,0)}));function cn(li,nr){return(Sr,vr)=>{Sr.handled=!0,Sr.diagram.model.commit(Ir=>{Ir.set(vr.part.adornedPart.data,li,nr)})}}function qt(li,nr){return nr||(nr="color"),it(lt.bn,{width:16,height:16,stroke:"lightgray",fill:li,margin:1,background:"transparent",mouseEnter:(Sr,vr)=>vr.stroke="dodgerblue",mouseLeave:(Sr,vr)=>vr.stroke="lightgray",click:cn(nr,li),contextClick:cn(nr,li)})}function an(){return[it("ContextMenuButton",it(lt.s_,"Horizontal",qt(sn.white,"fill"),qt(sn.beige,"fill"),qt(sn.extralightblue,"fill"),qt(sn.extralightred,"fill"))),it("ContextMenuButton",it(lt.s_,"Horizontal",qt(sn.lightgray,"fill"),qt(sn.lightgreen,"fill"),qt(sn.lightblue,"fill"),qt(sn.lightred,"fill")))]}function Gi(){return[it("ContextMenuButton",it(lt.s_,"Horizontal",qt(sn.black),qt(sn.green),qt(sn.blue),qt(sn.red))),it("ContextMenuButton",it(lt.s_,"Horizontal",qt(sn.white),qt(sn.magenta),qt(sn.purple),qt(sn.orange)))]}function ur(li,nr){return nr||(nr="thickness"),it(lt.bn,"LineH",{width:16,height:16,strokeWidth:li,margin:1,background:"transparent",mouseEnter:(Sr,vr)=>vr.background="dodgerblue",mouseLeave:(Sr,vr)=>vr.background="transparent",click:cn(nr,li),contextClick:cn(nr,li)})}function Hi(li,nr){return nr||(nr="dash"),it(lt.bn,"LineH",{width:24,height:16,strokeWidth:2,strokeDashArray:li,margin:1,background:"transparent",mouseEnter:(Sr,vr)=>vr.background="dodgerblue",mouseLeave:(Sr,vr)=>vr.background="transparent",click:cn(nr,li),contextClick:cn(nr,li)})}function Mi(){return[it("ContextMenuButton",it(lt.s_,"Horizontal",ur(1),ur(2),ur(3),ur(4))),it("ContextMenuButton",it(lt.s_,"Horizontal",Hi(null),Hi([2,4]),Hi([4,4])))]}function Ri(li,nr){return nr||(nr="figure"),it(lt.bn,{width:32,height:32,scale:.5,fill:"lightgray",figure:li,margin:1,background:"transparent",mouseEnter:(Sr,vr)=>vr.fill="dodgerblue",mouseLeave:(Sr,vr)=>vr.fill="lightgray",click:cn(nr,li),contextClick:cn(nr,li)})}kt.current.nodeTemplate.contextMenu=it("ContextMenu",it("ContextMenuButton",it(lt.s_,"Horizontal",Ri("Rectangle"),Ri("RoundedRectangle"),Ri("Ellipse"),Ri("Diamond"))),it("ContextMenuButton",it(lt.s_,"Horizontal",Ri("Parallelogram2"),Ri("ManualOperation"),Ri("Procedure"),Ri("Cylinder1"))),it("ContextMenuButton",it(lt.s_,"Horizontal",Ri("Terminator"),Ri("CreateRequest"),Ri("Document"),Ri("TriangleDown"))),an(),Gi(),Mi()),kt.current.groupTemplate=it(lt.ZA,"Spot",{layerName:"Background",ungroupable:!0,locationSpot:lt.z6.Center,selectionObjectName:"BODY",computesBoundsAfterDrag:!0,handlesDragDropForMembers:!0,mouseDrop:(li,nr)=>{var Sr=nr.addMembers(nr.diagram.selection,!0);Sr||nr.diagram.currentTool.doCancel()},avoidable:!1},new lt.KX("location","loc",lt.E9.parse).makeTwoWay(lt.E9.stringify),it(lt.s_,"Auto",{name:"BODY"},it(lt.bn,{parameter1:10,fill:sn.white,strokeWidth:2,cursor:"pointer",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:lt.z6.AllSides,toSpot:lt.z6.AllSides},new lt.KX("fill"),new lt.KX("stroke","color"),new lt.KX("strokeWidth","thickness"),new lt.KX("strokeDashArray","dash")),it(lt.Vm,{background:"transparent",margin:20})),it(lt.al,{alignment:lt.z6.Top,alignmentFocus:lt.z6.Bottom,font:"bold 12pt sans-serif",editable:!0},new lt.KX("text"),new lt.KX("stroke","color"))),kt.current.groupTemplate.selectionAdornmentTemplate=it(lt.uz,"Spot",it(lt.s_,"Auto",it(lt.bn,{fill:null,stroke:"dodgerblue",strokeWidth:3}),it(lt.Vm,{margin:1.5})),Di({alignment:lt.z6.TopRight,alignmentFocus:lt.z6.BottomRight})),kt.current.groupTemplate.contextMenu=it("ContextMenu",an(),Gi(),Mi()),kt.current.linkTemplate=it(lt.rU,{layerName:"Foreground",routing:lt.rU.AvoidsNodes,corner:10,fromShortLength:10,toShortLength:15,relinkableFrom:!0,relinkableTo:!0,reshapable:!0,resegmentable:!0},new lt.KX("fromSpot","fromSpot",lt.z6.parse),new lt.KX("toSpot","toSpot",lt.z6.parse),new lt.KX("fromShortLength","dir",li=>li>=1?10:0),new lt.KX("toShortLength","dir",li=>li>=1?10:0),new lt.KX("points").makeTwoWay(),it(lt.bn,{strokeWidth:2},new lt.KX("stroke","color"),new lt.KX("strokeWidth","thickness"),new lt.KX("strokeDashArray","dash")),it(lt.bn,{segmentIndex:0,segmentOffset:new lt.E9(15,0),segmentOrientation:lt.rU.OrientAlong,alignmentFocus:lt.z6.Right,figure:"circle",width:10,strokeWidth:0},new lt.KX("fill","color"),new lt.KX("visible","dir",li=>li===1)),it(lt.bn,{segmentIndex:-1,segmentOffset:new lt.E9(-10,6),segmentOrientation:lt.rU.OrientPlus90,alignmentFocus:lt.z6.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new lt.KX("fill","color"),new lt.KX("visible","dir",li=>li>=1),new lt.KX("width","thickness",li=>7+3*li),new lt.KX("height","thickness",li=>7+3*li),new lt.KX("segmentOffset","thickness",li=>new lt.E9(-15,4+1.5*li))),it(lt.bn,{segmentIndex:0,segmentOffset:new lt.E9(15,-6),segmentOrientation:lt.rU.OrientMinus90,alignmentFocus:lt.z6.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new lt.KX("fill","color"),new lt.KX("visible","dir",li=>li===2),new lt.KX("width","thickness",li=>7+3*li),new lt.KX("height","thickness",li=>7+3*li),new lt.KX("segmentOffset","thickness",li=>new lt.E9(-15,4+1.5*li))),it(lt.al,{alignmentFocus:new lt.z6(0,1,-4,0),editable:!0},new lt.KX("text").makeTwoWay(),new lt.KX("stroke","color"))),kt.current.linkTemplate.selectionAdornmentTemplate=it(lt.uz,it(lt.bn,{isPanelMain:!0,stroke:"transparent",strokeWidth:6,pathPattern:dr(2)},new lt.KX("pathPattern","thickness",dr)),Di({alignmentFocus:new lt.z6(0,0,-6,-4)}));function dr(li){return it(lt.bn,{stroke:"dodgerblue",strokeWidth:2,strokeCap:"square",geometryString:"M0 0 M4 2 H3 M4 "+(li+4).toString()+" H3"})}function Er(li){var nr="M0 0 M8 16 M0 8 L16 8 M12 11 L16 8 L12 5";return li===0?nr="M0 0 M16 16 M0 8 L16 8":li===2&&(nr="M0 0 M16 16 M0 8 L16 8 M12 11 L16 8 L12 5 M4 11 L0 8 L4 5"),it(lt.bn,{geometryString:nr,margin:2,background:"transparent",mouseEnter:(Sr,vr)=>vr.background="dodgerblue",mouseLeave:(Sr,vr)=>vr.background="transparent",click:cn("dir",li),contextClick:cn("dir",li)})}function Ar(li){var nr=(Sr,vr)=>{Sr.handled=!0,Sr.diagram.model.commit(Ir=>{var bo=vr.part.adornedPart;Ir.set(bo.data,li?"toSpot":"fromSpot",lt.z6.stringify(lt.z6.AllSides)),(li?bo.toNode:bo.fromNode).invalidateConnectedLinks()})};return it(lt.bn,{width:12,height:12,fill:"transparent",mouseEnter:(Sr,vr)=>vr.background="dodgerblue",mouseLeave:(Sr,vr)=>vr.background="transparent",click:nr,contextClick:nr})}function wn(li,nr){var Sr=0,vr=lt.z6.RightSide;li.equals(lt.z6.Top)?(Sr=270,vr=lt.z6.TopSide):li.equals(lt.z6.Left)?(Sr=180,vr=lt.z6.LeftSide):li.equals(lt.z6.Bottom)&&(Sr=90,vr=lt.z6.BottomSide),nr||(Sr-=180);var Ir=(bo,fo)=>{bo.handled=!0,bo.diagram.model.commit(so=>{var lo=fo.part.adornedPart;so.set(lo.data,nr?"toSpot":"fromSpot",lt.z6.stringify(vr)),(nr?lo.toNode:lo.fromNode).invalidateConnectedLinks()})};return it(lt.bn,{alignment:li,alignmentFocus:li.opposite(),geometryString:"M0 0 M12 12 M12 6 L1 6 L4 4 M1 6 L4 8",angle:Sr,background:"transparent",mouseEnter:(bo,fo)=>fo.background="dodgerblue",mouseLeave:(bo,fo)=>fo.background="transparent",click:Ir,contextClick:Ir})}kt.current.linkTemplate.contextMenu=it("ContextMenu",Gi(),Mi(),it("ContextMenuButton",it(lt.s_,"Horizontal",Er(0),Er(1),Er(2))),it("ContextMenuButton",it(lt.s_,"Horizontal",it(lt.s_,"Spot",Ar(!1),wn(lt.z6.Top,!1),wn(lt.z6.Left,!1),wn(lt.z6.Right,!1),wn(lt.z6.Bottom,!1)),it(lt.s_,"Spot",{margin:new lt.Zt(0,0,0,2)},Ar(!0),wn(lt.z6.Top,!0),wn(lt.z6.Left,!0),wn(lt.z6.Right,!0),wn(lt.z6.Bottom,!0)))));const Yo=`{ "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 zr=["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 mo(li){return console.log("shapeName:",li),zr.indexOf(li)>=0}var en=new lt.YI(Yn.current,{maxSelectionCount:1,linkTemplate:it(lt.rU,{locationSpot:lt.z6.Center,selectionAdornmentTemplate:it(lt.uz,"Link",{locationSpot:lt.z6.Center},it(lt.bn,{isPanelMain:!0,fill:null,stroke:"deepskyblue",strokeWidth:0}),it(lt.bn,{toArrow:"Standard",stroke:null}))},{routing:lt.rU.AvoidsNodes,curve:lt.rU.JumpOver,corner:5,toShortLength:4},new lt.KX("points"),it(lt.bn,{isPanelMain:!0,strokeWidth:2}),it(lt.bn,{toArrow:"Standard",stroke:null})),model:new lt.FJ([{text:"\u672A\u547D\u540D",size:"100 100",fill:null,stroke:"#000"},...lt.bn.getFigureGenerators().toArray().map(li=>({text:"\u672A\u547D\u540D",size:"100 100",figure:li.key,fill:"white",stroke:"#666",borderColor:"#000"}))])});return kt.current.addDiagramListener("TextEdited",function(li){var nr;const Sr=li.subject.part;var vr=(nr=document.activeElement)==null?void 0:nr.value;typeof vr=="string"&&vr.trim()===""&&kt.current.model.commit(function(Ir){Ir.set(Sr.data,"text","\u672A\u547D\u540D"),kt.current.commandHandler.stopCommand()},"increment")}),en.nodeTemplate=it(lt.NB,"Auto",{locationSpot:lt.z6.Center},new lt.KX("location","location",lt.E9.parse).makeTwoWay(lt.E9.stringify),it(lt.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 lt.KX("stroke").makeTwoWay(),new lt.KX("fill").makeTwoWay(),new lt.KX("figure")),it(lt.al,{margin:new lt.Zt(5,5,3,5),font:"10pt sans-serif",minSize:new lt.$u(16,16),maxSize:new lt.$u(10,NaN),textAlign:"center",editable:!0},new lt.KX("key").makeTwoWay())),setTimeout(()=>{kt.current.grid=it(lt.s_,"Grid",it(lt.bn,"LineH",{stroke:"lightgray",strokeWidth:.5}),it(lt.bn,"LineV",{stroke:"lightgray",strokeWidth:.5})),kt.current.grid.visible=!0,kt.current.grid.gridCellStroke="darkgray",kt.current.grid.gridCellStrokeWidth=1},300),window.myDiagrams=kt.current,kt.current}const hi=()=>Je(this,null,function*(){var it,sn=kt.current.makeImage();const Dn=yield(0,Ee.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Date.now(),file:sn.src,file_data:JSON.stringify({login:(it=(0,We.eY)())==null?void 0:it.login,data:JSON.parse(kt.current.model.toJson())})}});Tt({src:Dn.url})});return(0,ue.useEffect)(()=>(setTimeout(()=>{_t()},500),It(Kn+1),()=>{kt.current=null}),[]),Ae.createElement("div",{ref:yn,className:vi.current?`${De.maxH60} body-overflow-initial`:"body-overflow-initial"},Ae.createElement(Fn.default,{width:1200,icon:null,footer:null,closable:!0,visible:!!Kn,destroyOnClose:!0,maskClosable:!1,rootClassName:"zIndex-9999",title:Ae.createElement(Cn.Z,null,Ae.createElement(Me.Z,{flex:1},"\u63D2\u5165\u6D41\u7A0B\u56FE"),Ae.createElement(Me.Z,{onClick:()=>{var it,sn,Dn=kt.current.selection.first();if(vi.current=!vi.current,document.activeElement&&Dn){let Di=(sn=(it=document.activeElement)==null?void 0:it.value)==null?void 0:sn.trim();typeof Di=="string"&&kt.current.model.commit(function(cn){cn.set(Dn.data,"text",Di||"\u672A\u547D\u540D"),kt.current.commandHandler.stopCommand()},"increment")}It(Kn+1)}},Ae.createElement("span",{className:"current c-blue mr30",style:{fontWeight:400}},"\u5C55\u5F00/\u6536\u8D77"))),onCancel:Bt},Ae.createElement("div",{style:{width:"100%",height:"80vh",overflow:"hidden",position:"relative"},className:De.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:De.myPaletteDiv,ref:Yn})),Ae.createElement("div",{style:{flex:1,position:"relative"}},Ae.createElement("div",{ref:ui,style:{height:"80vh"}}))),Ae.createElement("div",{className:"tr"},Ae.createElement(tt.ZP,{size:"large",onClick:hi,style:{position:"absolute",right:0,bottom:0,zIndex:8},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))))}var fn=Nt,vn=Le(47889),Ft=Le(71051);const Jt=vn.ZP.Group,jt={margin:"0 8px"};var pn=({callback:Bt,onCancel:Tt})=>{function kt(ui){Bt(ui)}return ue.createElement(Ye.default,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:kt},ue.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},ue.createElement("span",{style:jt},"\u5355\u5143\u683C\u6570\uFF1A"),ue.createElement("span",{style:jt},"\u884C\u6570"),ue.createElement(Ye.default.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},ue.createElement(Ft.Z,null)),ue.createElement("span",{style:jt},"\u5217\u6570"),ue.createElement(Ye.default.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},ue.createElement(Ft.Z,null))),ue.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},ue.createElement("span",{style:jt},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),ue.createElement(Ye.default.Item,{name:"align"},ue.createElement(Jt,null,ue.createElement(vn.ZP,{value:"default"},ue.createElement("i",{className:"fa fa-align-justify"})),ue.createElement(vn.ZP,{value:"left"},ue.createElement("i",{className:"fa fa-align-left"})),ue.createElement(vn.ZP,{value:"center"},ue.createElement("i",{className:"fa fa-align-center"})),ue.createElement(vn.ZP,{value:"right"},ue.createElement("i",{className:"fa fa-align-right"}))))),ue.createElement("div",{className:"flex-container flex-end"},ue.createElement(tt.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),ue.createElement(tt.ZP,{type:"ghost",onClick:Tt},"\u53D6\u6D88")))},jn=Le(71411),Nn=Le(80727),Mn=Le.n(Nn),nn=(0,ue.forwardRef)(({use3d:Bt,width:Tt,height:kt,callback:ui,showSaveButton:Yn},vi)=>{const yn=(0,ue.useRef)(),Kn=(0,ue.useRef)(),[It,_t]=(0,ue.useState)(!1),hi=(0,ue.useRef)({id:yn,appName:"graphing",width:Tt||1e3,height:kt||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,ue.useEffect)(()=>{Kn.current=new(Mn())(hi.current,!0),window.onload=function(){Kn.current.inject("applet_container")}},[]);const it=()=>{var sn=window.ggbApplet.getPNGBase64(1,!0,72);return ui&&ui(sn),sn};return(0,ue.useEffect)(()=>{hi.current.appName=It?"3D":"graphing",Kn.current.inject("applet_container")},[It]),(0,ue.useEffect)(()=>{_t(Bt)},[Bt]),(0,ue.useImperativeHandle)(vi,()=>({getImgData:it})),ue.createElement(ue.Fragment,null,ue.createElement("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:yn}),ue.createElement(Cn.Z,{align:"middle"},ue.createElement(Me.Z,{flex:1},ue.createElement(jn.Z,{size:"default",checkedChildren:"\u5173\u95ED3D\u56FE\u50CF",unCheckedChildren:"\u5F00\u542F3D\u56FE\u50CF",checked:It,onChange:sn=>_t(sn)})),ue.createElement(Me.Z,null,ue.createElement(tt.ZP,{size:"large",onClick:it,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668"))))}),tn=Le(41588),hn=Le(6767);const di="link",Sn="upload-image",Kt="add-flowchart",gi="draw-image",Vi="add-flowchart",Pi="code-block",Ii="add-table",Fr="------------",$n={default:Fr,left:`:${Fr}`,center:`:${Fr}:`,right:`${Fr}:`};var In=Le(58856);function si(){}let Ti=0;const Oi=1e4,zi="\u2581",xr="@\u2581\u2581@",Ce="@\u2581@",_n=`
|
|
**\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`,ci=["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 ar(Bt){return/^\d+$/.test(Bt)?`${Bt}px`:Bt}const $r=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",po={[$r+"-B"]:"bold",[$r+"-I"]:"italic"},fi={[di]:"\u6DFB\u52A0\u94FE\u63A5",[Pi]:"\u6DFB\u52A0\u4EE3\u7801\u5757",[Sn]:"\u6DFB\u52A0\u56FE\u7247",[gi]:"\u6DFB\u52A0\u753B\u56FE",[Kt]:"\u63D2\u5165\u6D41\u7A0B\u56FE",[Ii]:"\u6DFB\u52A0\u8868\u683C","maths-latex":"\u6570\u5B66\u56FE\u50CF","inline-latex":"LATEX\u516C\u5F0F"};var Qn=({defaultValue:Bt="",onChange:Tt,width:kt="100%",height:ui=400,miniToolbar:Yn=!1,isFocus:vi=!1,watch:yn,insertTemp:Kn,mode:It="markdown",id:_t="markdown-editor-id",showResizeBar:hi=!1,noStorage:it=!1,showNullButton:sn=!1,showNullProgramButton:Dn=!1,hidetoolBar:Di=!1,fullScreen:cn=!1,onBlur:qt,onCMBeforeChange:an,onFullScreen:Gi,className:ur="",disablePaste:Hi=!1,disabled:Mi=!1,disabledFill:Ri=!1,placeholder:dr="",values:Er="",extraUse:Ar})=>{const[wn,Yo]=(0,ue.useState)(null),[zr,mo]=(0,ue.useState)(Bt),[en,li]=(0,ue.useState)(yn),[nr,Sr]=(0,ue.useState)(cn),[vr,Ir]=(0,ue.useState)(""),[bo,fo]=(0,ue.useState)(0),[so,lo]=(0,ue.useState)(ui),[Tn,qo]=(0,ue.useState)(!1),[Zn,wr]=(0,ue.useState)(0),[Or,hr]=(0,ue.useState)(0),la=(0,ue.useRef)(),ca=(0,ue.useRef)(),Qo=(0,ue.useRef)(),zo=(0,ue.useRef)();(0,ue.useEffect)(()=>{const qi=window.scrollY||window.pageYOffset;mo(Er),wn==null||wn.setValue(Er),window.scrollTo(0,qi)},[Er]),(0,ue.useEffect)(()=>{Gi==null||Gi(nr)},[nr]),(0,ue.useEffect)(()=>{if(la.current){let qi=function(bn,Yi){var rr;if(Hi){Yi.preventDefault();return}const Po=Yi.clipboardData;if(Po){const uo=Po.types.toString(),No=Po.items;if(uo==="Files"||Po.types.indexOf("Files")>-1){if(Yi.preventDefault(),It=="stex")return;try{let Do=No[1];((rr=No[0])==null?void 0:rr.kind)==="file"&&(Do=No[0]);const Io=Do.getAsFile(),fa=Io.name.split(".").pop();(0,Ht.I)(Io,na=>{var za,zt,To;na.id?((za=Io==null?void 0:Io.type)==null?void 0:za.indexOf("image"))>-1?Ui.replaceSelection(`<img width="100%" src="/api/attachments/${na.id}?type=${na.content_type})" alt="" />`):((zt=Io==null?void 0:Io.type)==null?void 0:zt.indexOf("video"))>-1?Ui.replaceSelection(`<video width="100%" controls src="/api/attachments/${na.id}"></video>`):((To=Io==null?void 0:Io.type)==null?void 0:To.indexOf("pdf"))>-1?Ui.replaceSelection(`<a href="/api/attachments/${na.id}?type=${Io.type}&disposition=inline" target="_blank">${Io.name}</a>`):ci.includes(fa)?Ui.replaceSelection(`<a href="/api/attachments/${na.id}?type=office&disposition=inline" target="_blank">${Io.name}</a>`):Ui.replaceSelection(`[${Io.name}](/api/attachments/${na.id}?type=${na.content_type})`):(na==null?void 0:na.status)===401&&(document.location.href="/user/login")})}catch(Do){hn.ZP.warning("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0};const Ui=ft().fromTextArea(la.current,{mode:It,lineNumbers:!Yn,lineWrapping:!0,value:Bt,autoCloseTags:!0,autoCloseBrackets:!0});return Ui.on("keyup",function(bn,Yi){Yi.keyCode===8&&(bn.getValue()==""?Ui.setOption("placeholder",dr):Ui.setOption("placeholder",null))}),Ui.on("keydown",function(bn,Yi){if(Yi.keyCode===8){var rr=On(bn);rr&&Yi.preventDefault()}}),vi&&Ui.focus(),Ui.on("paste",qi),Mi&&Ui.on("beforeChange",function(bn,Yi){(Yi.origin==="paste"||Yi.origin==="+input")&&Yi.cancel()}),Yo(Ui),()=>{Ui.off("paste",qi)}}},[]);const Vt=(0,ue.useCallback)(()=>{if(ca.current)try{}catch(qi){console.log(qi,"---- to set md editor body height")}},[so,ca,nr]);(0,ue.useEffect)(()=>{function qi(){let Ui=new yt.Z(bn=>{for(let Yi of bn)(Yi.target.offsetHeight>0||Yi.target.offsetWidth>0)&&(Vt(),wn.setSize("100%","100%"),wn.refresh())});return Ui.observe(la.current.parentElement),Ui}if(wn){const Ui=qi();return()=>{var bn,Yi;(bn=la.current)!=null&&bn.parentElement&&Ui.unobserve((Yi=la.current)==null?void 0:Yi.parentElement)}}},[wn,Vt]),(0,ue.useEffect)(()=>{if(wn){let qi=[];for(const[Ui,bn]of Object.entries(po)){let Yi={[Ui]:()=>{Ut(bn)}};qi.push(Yi),wn.addKeyMap(Yi)}return()=>{for(let Ui of qi)wn.removeKeyMap(Ui)}}},[wn]),(0,ue.useEffect)(()=>{cn!==nr&&Sr(cn)},[cn]),(0,In.Z)(()=>{if(!it&&bo>0){let qi=new Date().getTime(),Ui=window.sessionStorage.getItem(_t);qi>=bo+Oi&&(!Ui||Ui!==zr)&&(window.sessionStorage.setItem(_t,zr),qo(!0))}},Oi),(0,ue.useEffect)(()=>{li(yn)},[wn,yn]),(0,ue.useEffect)(()=>{wn&&vi&&wn.focus()},[wn,vi]),(0,ue.useEffect)(()=>{if(en&&wn){let qi=function(bn){let Yi=bn.target;if(zo.current){let rr=Yi.scrollTop/Yi.scrollHeight;zo.current.scrollTop=zo.current.scrollHeight*rr}};const Ui=wn.getScrollerElement();return Ui.addEventListener("scroll",qi),()=>{Ui.removeEventListener("scroll",qi)}}},[wn,en]),(0,ue.useEffect)(()=>{if(wn&&an){let qi=function(Ui,bn){an(Ui,bn)};return wn.on("beforeChange",qi),()=>{wn.off("beforeChange",qi)}}},[wn,an]),(0,ue.useEffect)(()=>{if(wn&&qt){let qi=function(){qt(wn.getValue())};return wn.on("blur",qi),()=>{wn.off("blur",qi)}}},[wn,qt]);function On(qi,Ui){var bn=qi.getDoc(),Yi=bn.getCursor(),rr=bn.getLine(Yi.line),Po=rr.charAt(Yi.ch-1),uo=rr.lastIndexOf("@\u2581@",Yi.ch),No=rr.lastIndexOf("@\u2581\u2581@",Yi.ch),Do=uo>No?uo:No,Io=uo>No?3:4;if(xr.indexOf(Po)===-1)return null;if(console.log("change1:",Ui,qi,rr,Yi,Do,uo,No,Po),Do>=0&&Yi.ch-Do<5){var fa=Do+Io;return bn.replaceRange("",{line:Yi.line,ch:Do},{line:Yi.line,ch:fa}),{line:Yi.line,ch:fa}}return null}(0,ue.useEffect)(()=>{if(wn){let qi=function(Ui,bn){const Yi=Ui.getValue();mo(Yi),fo(new Date().getTime()),Ui.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Tt&&(Dn?Tt(Yi,mi(Yi)):Tt(Yi))};return wn.on("change",qi),()=>{wn.off("change",qi)}}},[wn,Tt]),(0,ue.useEffect)(()=>{if(wn)if(Bt==null)wn.setValue(""),mo("");else{const qi=window.scrollY||window.pageYOffset;Bt!==wn.getValue()&&(wn.setValue(Bt),mo(Bt),wn.setCursor(Mi?1:wn.lineCount(),0),window.scrollTo(0,qi))}},[wn,Bt]);const Ut=(0,ue.useCallback)(qi=>{const Ui=wn.getCursor(),bn=wn.getSelection();let Yi=bn.split(`
|
|
`);switch(qi){case"bold":return wn.replaceSelection("**"+bn+"**"),bn===""&&wn.setCursor(Ui.line,Ui.ch+2),wn.focus();case"italic":return wn.replaceSelection("*"+bn+"*"),bn===""&&wn.setCursor(Ui.line,Ui.ch+1),wn.focus();case"code":return wn.replaceSelection("`"+bn+"`"),bn===""&&wn.setCursor(Ui.line,Ui.ch+1),wn.focus();case"inline-latex":return Ir("inline-latex"),wn.focus();case"latex":return wn.replaceSelection("```latex\n"+bn+"\n```"),wn.setCursor(Ui.line+1,bn.length+1),wn.focus();case"line-break":return wn.replaceSelection(`<br/>
|
|
`),wn.focus();case"list-ul":return bn===""?wn.replaceSelection("- "+bn):wn.replaceSelection(Yi.map(rr=>rr===""?"":`- ${rr}`).join(`
|
|
`)),wn.focus();case"list-ol":return bn===""?wn.replaceSelection("1. "+bn):wn.replaceSelection(Yi.map((rr,Po)=>rr===""?"":`${Po+1}. ${rr}`).join(`
|
|
`)),wn.focus();case"add-null-ch":return bn===""&&wn.setCursor(Ui.line,Ui.ch),wn.replaceSelection(zi),wn.focus();case"add-signal":return bn===""&&wn.setCursor(Ui.line,Ui.ch),wn.replaceSelection(Ce),wn.focus();case"add-multiple":return bn===""&&wn.setCursor(Ui.line,Ui.ch),wn.replaceSelection(xr),wn.focus();case"inster-template-1":return bn===""&&wn.setCursor(Ui.line,Ui.ch),wn.replaceSelection(_n),wn.focus();case"eraser":return wn.setValue(""),wn.focus();case"trigger-watch":return li(!en),wn.focus();case"trigger-full-screen":return Sr(!nr),wn.focus();case di:Ir(di);return;case Pi:Ir(Pi);return;case Sn:Ir(Sn);return;case gi:Ir(gi);return;case"maths-latex":Ir("maths-latex");return;case Kt:Ir(Kt);return;case Ii:Ir(Ii);return;default:throw new Error}},[wn,en,nr]),_e=(0,ue.useCallback)((qi,Ui)=>{var bn,Yi,rr,Po,uo,No;switch(Ir(""),vr){case di:const{title:za,link:zt}=qi;return wn.replaceSelection(`[${za}](${zt})`),wn.focus();case Pi:const{language:To,content:Pr}=qi;return wn.replaceSelection(["```"+To,Pr,"```"].join(`
|
|
`)),wn.focus();case"maths-latex":for(var Do=atob(qi),Io=new Uint8Array(Do.length),fa=0;fa<Do.length;fa++)Io[fa]=Do.charCodeAt(fa);var na=new Blob([Io],{type:"image/png"});(0,Ht.I)(na,Qa=>{Qa.id?wn.replaceSelection(``):(Qa==null?void 0:Qa.status)===401&&(document.location.href="/user/login")});break;case"inline-latex":wn.replaceSelection("`$$"+qi+"$$`");break;case Sn:case gi:case Vi:const{src:eo,alt:Zo}=qi,Wr=Ui,ba=(rr=(Yi=(bn=Wr==null?void 0:Wr.name)==null?void 0:bn.split("."))==null?void 0:Yi.pop)==null?void 0:rr.call(Yi);return((Po=Wr==null?void 0:Wr.type)==null?void 0:Po.indexOf("image"))>-1||!(Wr!=null&&Wr.type)?Wr!=null&&Wr.align||Wr!=null&&Wr.width?wn.replaceSelection(`<p style="text-align:${Wr.align||"initial"}"><img width="${Wr.width?Wr.width+"%":"initial"}" src="${eo}" alt="${Zo||""}" /></p>`):wn.replaceSelection(`<img width="100%" src="${eo}" alt="${Zo||""}" />`):((uo=Wr==null?void 0:Wr.type)==null?void 0:uo.indexOf("video"))>-1?wn.replaceSelection(`<video width="100%" controls src="${eo}"></video>`):((No=Wr==null?void 0:Wr.type)==null?void 0:No.indexOf("pdf"))>-1?wn.replaceSelection(`<a href="${eo}?type=${Wr.type}&disposition=inline" target="_blank">${Wr.name}</a>`):ci.includes(ba)?wn.replaceSelection(`<a href="${eo}?type=office&disposition=inline" target="_blank">${Wr.name}</a>`):wn.replaceSelection(`[${Wr.name}](${eo})`),wn.focus();case Ii:const{row:ga,col:Uo,align:Fo}=qi;let vs=`
|
|
`;for(let Qa=0;Qa<ga;Qa++){let ns=[],ds=[];for(let Vr=0;Vr<Uo;Vr++)Qa===1&&ds.push($n[Fo]),ns.push(" ");Qa===1&&(vs+=`| ${ds.join(" | ")} |
|
|
`),vs+=`| ${ns.join(Uo===1?"":" | ")} |
|
|
`}return wn.replaceSelection(vs+`
|
|
`),wn.focus();default:throw new Error}},[wn,vr]),pi=(0,ue.useMemo)(()=>{switch(vr){case di:return ue.createElement(oi,{callback:_e,onCancel:Vn});case Pi:return ue.createElement(zn.Z,{callback:_e,onCancel:Vn});case Sn:return ue.createElement(Ht.Z,{callback:_e,onCancel:Vn});case Kt:return ue.createElement(fn,{callback:_e,onCancel:Vn});case Ii:return ue.createElement(pn,{callback:_e,onCancel:Vn});case"maths-latex":return ue.createElement(nn,{showSaveButton:!0,callback:_e});case"inline-latex":return ue.createElement(tn.Z,{showSaveButton:!0,callback:_e});default:return null}},[vr]);function Vn(){Ir("")}(0,ue.useEffect)(()=>{if(Qo.current){let qi=function(uo){rr=!0,Po=uo.pageY},Ui=function(){rr=!1},bn=function(uo){if(rr){let No=uo.pageY-Po;No<0&&(No=0),No>300&&(No=300);let Do=ui+No+"px";lo(Do)}},Yi=Qo.current,rr=!1,Po=0;return Yi.addEventListener("mousedown",qi),document.addEventListener("mousemove",bn),document.addEventListener("mouseup",Ui),()=>{Yi.removeEventListener("mousedown",qi),document.removeEventListener("mousemove",bn),document.removeEventListener("mouseup",Ui)}}},[wn,Qo]),(0,ue.useEffect)(()=>{lo(ui)},[ui]);const qn=ar(kt),ki=ar(so),Wi={width:qn,height:ki},Wn=(0,ue.useMemo)(()=>{if(bo){let qi=new Date(bo),Ui=qi.getHours(),bn=qi.getMinutes(),Yi=qi.getSeconds();return Ui=Ui<10?"0"+Ui:Ui,bn=bn<10?"0"+bn:bn,Yi=Yi<10?"0"+Yi:Yi,`${Ui}:${bn}:${Yi}`}return 0},[bo]),mi=qi=>{const Ui=[];if(Dn){let bn=-1;qi=qi.replace(/(@▁▁@|@▁@)/g,function(Yi,rr,Po){Ui.push({multiLine:Yi!==Ce})})}return Ui};function Si(){window.sessionStorage.removeItem(_t),qo(!1),fo(0)}function Ei(){qo(!1),fo(0),wn.setValue(window.sessionStorage.getItem(_t))}(0,ue.useEffect)(()=>{fi[vr]&&vr!==gi&&vr!==Kt&&setTimeout(()=>{const qi=document.getElementsByClassName("markdown-popup-form")[0],Ui=window.innerWidth/2-qi.offsetWidth/2,bn=window.innerHeight/2-qi.offsetHeight/2;wr(Ui),hr(bn)},0)},[vr]);const bi=qi=>{qi.preventDefault();const Ui=qi.clientX-Zn,bn=qi.clientY-Or;document.body.onmousemove=Yi=>{let rr=Yi.clientX-Ui,Po=Yi.clientY-bn;const uo=document.getElementsByClassName("markdown-popup-form")[0],No=window.innerWidth-uo.offsetWidth,Do=window.innerHeight-uo.offsetHeight;rr=Math.max(0,Math.min(rr,No)),Po=Math.max(0,Math.min(Po,Do)),gr(Yi.clientX,Yi.clientY,Ui,bn)&&(wr(rr),hr(Po))},document.body.onmouseup=function(){document.body.onmousemove=null}},gr=(qi,Ui,bn,Yi)=>{const rr=document.body.clientHeight,Po=document.body.clientWidth;return qi<20&&bn>qi||qi>Po-20&&bn<qi||Ui<20&&Yi>Ui||Ui>rr-20&&Yi<Ui?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};return ue.createElement(ue.Fragment,null,ue.createElement("div",{className:"markdown-editor-wrapper",ref:ca},ue.createElement("div",{className:`markdown-editor-container ${ur} ${en?"on-preview":""} ${Yn?"mini":""} ${nr?"full-screen":""}`,style:Wi},ue.createElement(rt,{insertTemp:Kn,watch:en,fullScreen:nr,showNullButton:sn,showNullProgramButton:Dn,onActionCallback:Ut,hidetoolBar:Di,extraUse:Ar}),ue.createElement("div",{className:"markdown-editor-body"},ue.createElement("div",{className:"codemirror-container"},ue.createElement("textarea",{ref:la,placeholder:dr})),en?ue.createElement("div",{ref:zo,className:"preview-container"},It==="stex"&&ue.createElement(ot,{value:zr}),It!=="stex"&&ue.createElement(Rt.Z,{disabledFill:Ri,showProgramFill:Dn,value:zr})):null))),hi?ue.createElement("a",{ref:Qo,className:"editor-resize"}):null,vr===gi&&ue.createElement(Hn,{callback:_e,onCancel:Vn}),vr===Kt&&ue.createElement(fn,{callback:_e,onCancel:Vn}),ue.createElement(et.Z,null,fi[vr]&&vr!==gi&&vr!==Kt?ue.createElement(Fn.default,{maskClosable:!1,centered:!0,style:{position:"absolute",left:Zn,top:Or},title:ue.createElement("div",{style:{cursor:"move"},onMouseDown:bi},fi[vr]),open:!0,onCancel:Vn,footer:null,destroyOnClose:!0,width:vr===Kt?"1200px":null,height:vr===Kt?"80vh":null,className:"markdown-popup-form"},pi):null))}},28451:function(Un,ai,Le){"use strict";Le.d(ai,{Z:function(){return Ie},I:function(){return rt}});var ue=Le(28284),Ke=Le(6767),ft=Le(37568),yt=Le(77736),mt=Le(71051),Oe=Le(47889),at=Le(99571),Ct=Le(77903),dt=Le(59301),Ge=Le(59301),Rt=Object.defineProperty,ot=Object.defineProperties,At=Object.getOwnPropertyDescriptors,Te=Object.getOwnPropertySymbols,ne=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable,de=(et,Ye,ut)=>Ye in et?Rt(et,Ye,{enumerable:!0,configurable:!0,writable:!0,value:ut}):et[Ye]=ut,se=(et,Ye)=>{for(var ut in Ye||(Ye={}))ne.call(Ye,ut)&&de(et,ut,Ye[ut]);if(Te)for(var ut of Te(Ye))te.call(Ye,ut)&&de(et,ut,Ye[ut]);return et},pe=(et,Ye)=>ot(et,At(Ye));const{useForm:ye}=ue.default,we={width:280,marginRight:10},be={labelCol:{span:5},wrapperCol:{span:19}};var Ie=({callback:et,onCancel:Ye})=>{const[ut]=ye();let tt=(0,dt.useRef)();function wt(mn){tt.current.width=ut.getFieldValue("width"),tt.current.align=ut.getFieldValue("align"),et(mn,tt.current)}function St(mn,$t){if(mn.status===-1){Ke.ZP.error(mn.message);return}ut.setFieldsValue({src:`/api/attachments/${mn.id}`,type:$t.type})}function Lt(mn){let $t=mn.target.files[0];tt.current=$t,rt($t,St)}return Ge.createElement(ue.default,pe(se({form:ut},be),{className:"upload-image-panel",onFinish:wt,style:{width:470,overflow:"hidden"}}),Ge.createElement(ue.default.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},Ge.createElement("div",{className:"flex-container"},Ge.createElement(ue.default.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},Ge.createElement(ft.default,{style:we})),Ge.createElement(Re,{onFileChange:Lt}))),Ge.createElement(ue.default.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},Ge.createElement(ft.default,{style:{width:264}})),Ge.createElement(ue.default.Item,{label:"\u56FE\u7247\u5BBD\u5EA6",name:"width"},Ge.createElement(yt.Z,null,Ge.createElement(ue.default.Item,{name:"width",style:{margin:0}},Ge.createElement(mt.Z,{style:{width:264}})),Ge.createElement("span",{className:"ml8"},"%"))),Ge.createElement(ue.default.Item,{label:"\u5BF9\u9F50\u65B9\u5F0F",name:"align"},Ge.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"}]})),Ge.createElement("aside",null,Ge.createElement(ue.default.Item,{style:{textAlign:"right",position:"relative",right:-98}},Ge.createElement(at.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),Ge.createElement(at.ZP,{type:"default",onClick:Ye},"\u53D6\u6D88"))))};function Re({onFileChange:et}){return Ge.createElement("label",{className:"upload-button",style:{cursor:"pointer"}},"\u672C\u5730\u4E0A\u4F20",Ge.createElement("input",{type:"file",onChange:et}))}function rt(et,Ye){if(!et)throw new String("\u6CA1\u6709\u6587\u4EF6");let ut=new FormData;ut.append("editormd-image-file",et),ut.append("file_param_name","editormd-image-file"),ut.append("byxhr","true");var tt=new window.XMLHttpRequest;tt.withCredentials=!0,tt.addEventListener("load",function(wt){Ye(JSON.parse(wt.target.responseText),et)},!1),tt.addEventListener("error",function(wt){console.error(wt)},!1),tt.open("POST",`${Ct.KI}/api/attachments.json`),tt.send(ut)}},79346:function(Un,ai,Le){"use strict";Le.d(ai,{Z:function(){return ft}});var ue=Le(59301),Ke=Le(4676);class ft extends ue.Component{constructor(mt){super(mt);const Oe=window.document;this.node=Oe.createElement("div"),Oe.body.appendChild(this.node)}render(){const{children:mt}=this.props;return(0,Ke.createPortal)(mt,this.node)}componentWillUnmount(){window.document.body.removeChild(this.node)}}},23954:function(Un,ai,Le){"use strict";Le.d(ai,{SV:function(){return Je},ZP:function(){return Ae}});var ue=Le(59301),Ke=Le(76374);const ft={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"]},yt={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"]},mt={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),dt=Le.n(Ct),Ge=Object.defineProperty,Rt=Object.defineProperties,ot=Object.getOwnPropertyDescriptors,At=Object.getOwnPropertySymbols,Te=Object.prototype.hasOwnProperty,ne=Object.prototype.propertyIsEnumerable,te=(Nt,fn,vn)=>fn in Nt?Ge(Nt,fn,{enumerable:!0,configurable:!0,writable:!0,value:vn}):Nt[fn]=vn,de=(Nt,fn)=>{for(var vn in fn||(fn={}))Te.call(fn,vn)&&te(Nt,vn,fn[vn]);if(At)for(var vn of At(fn))ne.call(fn,vn)&&te(Nt,vn,fn[vn]);return Nt},se=(Nt,fn)=>Rt(Nt,ot(fn)),pe=(Nt,fn,vn)=>new Promise((Ft,Jt)=>{var jt=Nn=>{try{jn(vn.next(Nn))}catch(Mn){Jt(Mn)}},pn=Nn=>{try{jn(vn.throw(Nn))}catch(Mn){Jt(Mn)}},jn=Nn=>Nn.done?Ft(Nn.value):Promise.resolve(Nn.value).then(jt,pn);jn((vn=vn.apply(Nt,fn)).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=(Nt,fn)=>fn.map(vn=>({label:vn,kind:Nt.languages.CompletionItemKind.Keyword,insertText:vn})),be=Nt=>Object.keys(ye.tables).map(fn=>({label:fn,kind:Nt.languages.CompletionItemKind.Variable,insertText:fn})),Ie=(Nt,fn)=>{const vn=ye.tables[Nt];return vn?vn.map(Ft=>({label:Ft,kind:fn.languages.CompletionItemKind.Field,insertText:Ft})):[]};function Re(Nt,fn,vn,Ft,Jt){let jt=fn.getWordUntilPosition(vn),pn={startLineNumber:vn.lineNumber,endLineNumber:vn.lineNumber,startColumn:jt.startColumn,endColumn:jt.endColumn},jn=Ft.map(Nn=>({label:Nn,kind:Nt.languages.CompletionItemKind.Keyword,insertText:Nn,insertTextRules:Nt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:pn}));return Jt.map(Nn=>{jn.push(se(de({},Nn),{range:pn}))}),jn}var rt=Nt=>{ye.languages.map(Jt=>(Nt.languages.registerDocumentFormattingEditProvider(Jt,{provideDocumentFormattingEdits(jt,pn,jn){return pe(this,null,function*(){const Nn=dt()(jt.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:jt.getFullModelRange(),text:Nn}]})}}),Jt));const fn=mt.quickKey.map(Jt=>({label:Jt.label,kind:Nt.languages.CompletionItemKind.Method,insertText:Jt.content,insertTextRules:Nt.languages.CompletionItemInsertTextRule.InsertAsSnippet})),vn=Oe.quickKey.map(Jt=>({label:Jt.label,kind:Nt.languages.CompletionItemKind.Method,insertText:Jt.content,insertTextRules:Nt.languages.CompletionItemInsertTextRule.InsertAsSnippet})),Ft=yt.quickKey.map(Jt=>({label:Jt.label,kind:Nt.languages.CompletionItemKind.Method,insertText:Jt.content,insertTextRules:Nt.languages.CompletionItemInsertTextRule.InsertAsSnippet}));Nt.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Jt,jt){var pn=Jt.getWordUntilPosition(jt),jn={startLineNumber:jt.lineNumber,endLineNumber:jt.lineNumber,startColumn:pn.startColumn,endColumn:pn.endColumn},Nn=Jt.getLineContent(jt.lineNumber).substring(pn.startColumn-2,pn.endColumn);return{suggestions:[...mt.keywords.map(Mn=>({label:Mn,kind:Nt.languages.CompletionItemKind.Function,documentation:Mn,insertText:Mn,insertTextRules:Nt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:jn})),...mt.quickKey.map(Mn=>({label:Mn.label,kind:Nt.languages.CompletionItemKind.Function,documentation:Mn.content,insertText:Nn.startsWith("#")?Mn.content.replace(/#/,""):Mn.content,insertTextRules:Nt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:jn}))]}}}),Nt.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Jt,jt){var pn=Jt.getWordUntilPosition(jt),jn={startLineNumber:jt.lineNumber,endLineNumber:jt.lineNumber,startColumn:pn.startColumn,endColumn:pn.endColumn};return{suggestions:[...ft.keywords.map(Nn=>({label:Nn,kind:Nt.languages.CompletionItemKind.Function,documentation:Nn,insertText:Nn,insertTextRules:Nt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:jn}))]}}}),Nt.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Jt,jt){var pn=Jt.getWordUntilPosition(jt),jn={startLineNumber:jt.lineNumber,endLineNumber:jt.lineNumber,startColumn:pn.startColumn,endColumn:pn.endColumn},Nn=Jt.getLineContent(jt.lineNumber).substring(pn.startColumn-2,pn.endColumn);return{suggestions:[...yt.keywords.map(Mn=>({label:Mn,kind:Nt.languages.CompletionItemKind.Function,documentation:Mn,insertText:Mn,insertTextRules:Nt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:jn})),...yt.quickKey.map(Mn=>({label:Mn.label,kind:Nt.languages.CompletionItemKind.Function,documentation:Mn.content,insertText:Nn.startsWith("#")?Mn.content.replace(/#/,""):Mn.content,insertTextRules:Nt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:jn}))]}}}),Nt.languages.registerCompletionItemProvider("scala",{provideCompletionItems:function(Jt,jt){var pn=Jt.getWordUntilPosition(jt),jn={startLineNumber:jt.lineNumber,endLineNumber:jt.lineNumber,startColumn:pn.startColumn,endColumn:pn.endColumn},Nn=Jt.getLineContent(jt.lineNumber).substring(pn.startColumn-2,pn.endColumn);return{suggestions:[...at.keywords.map(Mn=>({label:Mn,kind:Nt.languages.CompletionItemKind.Function,documentation:Mn,insertText:Mn,insertTextRules:Nt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:jn})),...at.quickKey.map(Mn=>({label:Mn.label,kind:Nt.languages.CompletionItemKind.Function,documentation:Mn.content,insertText:Nn.startsWith("#")?Mn.content.replace(/#/,""):Mn.content,insertTextRules:Nt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:jn}))]}}}),Nt.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Jt,jt){var pn=Jt.getWordUntilPosition(jt),jn={startLineNumber:jt.lineNumber,endLineNumber:jt.lineNumber,startColumn:pn.startColumn,endColumn:pn.endColumn},Nn=Jt.getLineContent(jt.lineNumber).substring(pn.startColumn-2,pn.endColumn);return{suggestions:[...Oe.keywords.map(Mn=>({label:Mn,kind:Nt.languages.CompletionItemKind.Function,documentation:Mn,insertText:Mn,insertTextRules:Nt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:jn})),...Oe.quickKey.map(Mn=>({label:Mn.label,kind:Nt.languages.CompletionItemKind.Function,documentation:Mn.content,insertText:Nn.startsWith("#")?Mn.content.replace(/#/,""):Mn.content,insertTextRules:Nt.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:jn}))]}}})};const et="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var Ye=Object.defineProperty,ut=(Nt,fn,vn)=>fn in Nt?Ye(Nt,fn,{enumerable:!0,configurable:!0,writable:!0,value:vn}):Nt[fn]=vn,tt=(Nt,fn,vn)=>ut(Nt,typeof fn!="symbol"?fn+"":fn,vn);const wt=class mS{constructor(fn,vn,Ft){this.placeholder=fn,this.editor=vn,this.monaco=Ft,vn.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)}};tt(wt,"ID","editor.widget.placeholderHint");var Lt=wt,mn=Le(96236),$t=Le(6767),Pn=Le(25399),Ot=Le(89392),ct=Le(34604),nt=Le(56102),gn=Object.defineProperty,oi=Object.defineProperties,zn=Object.getOwnPropertyDescriptors,Ht=Object.getOwnPropertySymbols,Fn=Object.prototype.hasOwnProperty,Cn=Object.prototype.propertyIsEnumerable,ii=(Nt,fn,vn)=>fn in Nt?gn(Nt,fn,{enumerable:!0,configurable:!0,writable:!0,value:vn}):Nt[fn]=vn,Wt=(Nt,fn)=>{for(var vn in fn||(fn={}))Fn.call(fn,vn)&&ii(Nt,vn,fn[vn]);if(Ht)for(var vn of Ht(fn))Cn.call(fn,vn)&&ii(Nt,vn,fn[vn]);return Nt},Hn=(Nt,fn)=>oi(Nt,zn(fn)),lt=(Nt,fn)=>{var vn={};for(var Ft in Nt)Fn.call(Nt,Ft)&&fn.indexOf(Ft)<0&&(vn[Ft]=Nt[Ft]);if(Nt!=null&&Ht)for(var Ft of Ht(Nt))fn.indexOf(Ft)<0&&Cn.call(Nt,Ft)&&(vn[Ft]=Nt[Ft]);return vn},An=(Nt,fn,vn)=>new Promise((Ft,Jt)=>{var jt=Nn=>{try{jn(vn.next(Nn))}catch(Mn){Jt(Mn)}},pn=Nn=>{try{jn(vn.throw(Nn))}catch(Mn){Jt(Mn)}},jn=Nn=>Nn.done?Ft(Nn.value):Promise.resolve(Nn.value).then(jt,pn);jn((vn=vn.apply(Nt,fn)).next())});function Ni(Nt){return/^\d+$/.test(Nt)?`${Nt}px`:Nt}function je(){}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 De(Nt=[]){let fn=Nt;if(Array.isArray(Nt)){for(let vn=0;vn<Nt.length;vn++){let Ft=Ee[Nt[vn]];if(Ft)return Ft}return fn[0]}return Ee[fn]||fn}let We=null;var Ae=Nt=>{var fn=Nt,{width:vn="100%",height:Ft="100%",value:Jt,language:jt="javascript",style:pn={},options:jn={},overrideServices:Nn={},theme:Mn="vs-dark",onEditBlur:fr,isCopy:nn=!1,onSave:tn,autoHeight:hn=!1,forbidCopy:di=!1,onChange:Sn=je,editorDidMount:Kt=je,onFocus:gi=je,onBreakPoint:Vi=je,breakPointValue:Pi=[],filename:Ii="educoder.txt",errorLine:Fr,errorContent:$n="",highlightLine:In,openBreakPoint:si=!1,placeholder:Ti="",showMiniMap:Oi=!0}=fn,zi=lt(fn,["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 xr=(0,ue.useRef)(),Ce=(0,ue.useRef)({}),_n=(0,ue.useRef)(),ci=(0,ue.useRef)(),ar=(0,ue.useRef)([]),_r=(0,ue.useRef)(!1),$r=(0,ue.useRef)(),po=(0,ue.useRef)(),fi=(0,ue.useRef)(!1),[Qn,Bt]=(0,ue.useState)(!1);function Tt(){let qt;return xr.current&&(qt=new Ke.Z(an=>{for(let Gi of an)(Gi.target.offsetHeight>0||Gi.target.offsetWidth>0)&&Ce.current.instance.layout()}),qt.observe(xr.current)),qt}function kt(){$t.ZP.warning({content:decodeURIComponent(et),key:"monaco-editor-tip"})}const ui=()=>{let qt=Ce.current.instance;if(Jt!=null&&qt&&Qn){const an=qt.getModel();an&&Jt!==an.getValue()&&(Me=!0,an.setValue(Jt),qt.layout(),Me=!1)}};(0,ue.useEffect)(()=>{const qt=ct.Z.subscribe("formatDocument",an=>{var Gi;let ur=Ce.current.instance;(Gi=ur==null?void 0:ur.getAction)==null||Gi.call(ur,"editor.action.formatDocument").run()});return window.updateMonacoValue=an=>{Sn(an)},qt},[]),(0,ue.useEffect)(()=>{var qt;let an=Ce.current.instance;ci.current&&clearTimeout(ci.current),ci.current=setTimeout(()=>{ui()},500),Jt&&(Jt!=null&&Jt.length)&&((qt=an==null?void 0:an.updateOptions)==null||qt.call(an,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(Jt.split(/\r\n|\r|\n/g).length))+3,5)}))},[Jt,Qn,Ce.current]),(0,ue.useEffect)(()=>{if(Fr&&Ce.current&&Ce.current.instance){let an=Ce.current.instance;an.changeViewZones(function(Gi){var ur=document.createElement("div");ur.style.padding="10px 20px",ur.style.width="calc(100% - 20px)",ur.className="my-error-line-wrp",ur.innerHTML=$n,Gi.addZone({afterLineNumber:Fr||11,heightInLines:3,domNode:ur})});var qt={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}};an.addOverlayWidget(qt),an.revealPositionInCenter({lineNumber:20,column:1})}},[Fr,Ce.current,Qn]);const Yn=(qt="",an)=>{if(!qt||qt.trim()==="")return!0;const ur=Ce.current.instance.getModel().getLineTokens(an);let Hi=!1;for(let Mi=0;Mi<2;Mi++)ur.getStandardTokenType(Mi)===1&&(Hi=!0);return Hi};(0,ue.useEffect)(()=>{var qt;const an=(qt=Ce.current)==null?void 0:qt.instance;if(an&&Qn&&di){const Gi=an.onDidBlurEditorWidget(()=>{fi.current=!1}),ur=an.onDidFocusEditorText(()=>{fi.current=!0});return()=>{Gi.dispose(),ur.dispose()}}},[Ce.current,Qn,di]),(0,ue.useEffect)(()=>{var qt;if((qt=Ce.current)!=null&&qt.instance&&Qn&&si){let an=Ce.current.instance,Gi=an.getModel();if(!Gi)return;(()=>{var en;let li=[],nr=[];const Sr=Gi.getAllDecorations();for(let Ir of Sr)Ir.options.className==="highlighted-line"&&(li.push((en=Ir==null?void 0:Ir.range)==null?void 0:en.startLineNumber),nr.push(Ir==null?void 0:Ir.id));if(In===li[0])return;Gi.deltaDecorations(nr,[]);const vr=Gi.getLineCount();In&&In<=vr&&(an.deltaDecorations([],[{range:new We.Range(In,1,In,Gi.getLineMaxColumn(In)),options:{isWholeLine:!0,className:"highlighted-line"}}]),an.revealLineInCenter(In))})();const Hi=(en=!1)=>{var li;let nr=[],Sr=[];const vr=Gi.getAllDecorations();for(let Ir of vr)Ir.options.linesDecorationsClassName==="breakpoints-select"&&(nr.push((li=Ir==null?void 0:Ir.range)==null?void 0:li.startLineNumber),Sr.push(Ir==null?void 0:Ir.id));if(en)return{lines:nr,ids:Sr};Vi(nr)},Mi=en=>An(void 0,null,function*(){let li={range:new We.Range(en,1,en,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield Gi.deltaDecorations([],[li]),Hi()}),Ri=en=>An(void 0,null,function*(){let li=[];const nr=an.getLineDecorations(en);for(let Sr of nr)Sr.options.linesDecorationsClassName==="breakpoints-select"&&li.push(Sr.id);yield Gi.deltaDecorations(li,[]),Hi()}),dr=en=>{let li=an.getLineDecorations(en);for(let nr of li)if(nr.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,Ot.isEqual)(Pi,Hi(!0).lines)){Gi.deltaDecorations(Hi(!0).ids,[]);const en=Pi.map(li=>({range:new We.Range(li,1,li,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));Gi.deltaDecorations([],en)}const Er=an.onDidChangeModelContent(en=>{let li=an.getPosition();if(li){let nr=li.lineNumber;clearTimeout(po.current),po.current=setTimeout(()=>{Yn(Gi.getLineContent(nr),nr)?Ri(nr):dr(nr)?(Ri(nr),Mi(nr)):Hi()},100)}}),Ar=an.onMouseDown(en=>{var li,nr,Sr;if(en.target.detail&&((Sr=(nr=(li=en.target)==null?void 0:li.element)==null?void 0:nr.className)!=null&&Sr.includes("line-numbers"))){let vr=en.target.position.lineNumber;if(Yn(Gi.getLineContent(vr),vr))return;dr(vr)?Ri(vr):Mi(vr)}}),wn=en=>{let li={range:new We.Range(en,1,en,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};ar.current=an.deltaDecorations(ar.current,[li])},Yo=()=>{ar.current=an.deltaDecorations(ar.current,[])},zr=an.onMouseMove(en=>{var li,nr,Sr;if(Yo(),en.target.detail&&((Sr=(nr=(li=en.target)==null?void 0:li.element)==null?void 0:nr.className)!=null&&Sr.includes("line-numbers"))){let vr=en.target.position.lineNumber;if(Yn(Gi.getLineContent(vr),vr))return;wn(vr)}}),mo=an.onMouseLeave(()=>{Yo()});return()=>{Er.dispose(),Ar.dispose(),zr.dispose(),mo.dispose()}}},[Ce.current,Qn,Pi,In,si,jt]),(0,ue.useEffect)(()=>{var qt;(qt=Ce.current)!=null&&qt.instance&&si&&Ce.current.instance.setPosition({lineNumber:0,column:0})},[In]);function vi(){let qt=Ce.current.instance;if(qt){const an=qt.getSelection(),Gi=Ce.current.pastePos||{},ur=new We.Range(Gi.startLineNumber||an.endLineNumber,Gi.startColumn||an.endColumn,Gi.endLineNumber||an.endLineNumber,Gi.endColumn||an.endColumn);setTimeout(()=>{qt.executeEdits("",[{range:ur,text:""}])},300)}}function yn(qt){(window.navigator.platform.match("Mac")?qt.metaKey:qt.ctrlKey)&&qt.keyCode==83&&(qt.preventDefault(),tn())}const Kn=()=>{if(hn&&Ce.current.instance){const qt=Ce.current.instance.getContentHeight();Di(qt<Ft?Ft:qt)}else Di(Ft)};function It(qt){var an=document.createEvent("MouseEvents");an.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),qt.dispatchEvent(an)}const _t=qt=>{if(!fi.current)return;const{keyCode:an,ctrlKey:Gi,metaKey:ur,target:Hi,type:Mi}=qt;return(Mi==="paste"||(an===67||an===86)&&(ur||Gi))&&Hi.nodeName==="TEXTAREA"&&(kt(),qt.preventDefault()),!1};function hi(qt,an){var Gi=window.URL||window.webkitURL||window,ur=new Blob([an]),Hi=document.createElementNS("http://www.w3.org/1999/xhtml","a");Hi.href=Gi.createObjectURL(ur),Hi.download=qt,It(Hi)}(0,ue.useEffect)(()=>{Kn()},[Kn]),(0,ue.useEffect)(()=>{xr.current&&!Qn&&Promise.all([Le.e(8909),Le.e(3267)]).then(Le.bind(Le,71448)).then(qt=>{try{We=qt,Ce.current.instance=We.editor.create(xr.current,{value:Jt,language:De(jt),theme:Mn,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:Oi||!1}},Nn);const an=Ce.current.instance;let Hi=[...mn.BH._menuItems].find(Er=>Er[0]._debugName=="EditorContext")[1],Mi=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Ri=(Er,Ar)=>{var wn,Yo;let zr=Er._first;do Ar.includes((Yo=(wn=zr.element)==null?void 0:wn.command)==null?void 0:Yo.id)&&Er._remove(zr);while(zr=zr.next)};if(Kt(an,We),setTimeout(()=>{Kn(),Ce.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{hi(Ii||"educoder.txt",an.getValue())}})},500),Ce.current.subscription=an.onDidChangeModelContent(Er=>{_r.current?clearTimeout($r.current):(Kn(),Sn(an.getValue(),Er)),$r.current=setTimeout(()=>{_r.current=!1},500)}),window.Monaco||rt(We,De(jt)),di&&(Ri(Hi,Mi),xr.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",_t),window.removeEventListener("paste",_t),window.addEventListener("keydown",_t),window.addEventListener("paste",_t)),window.Monaco=We,fr&&an.onDidBlurEditorWidget(()=>{fr(an.getValue())}),gi&&an.onDidFocusEditorText(()=>{gi(an.getValue())}),di)try{an.onDidPaste(Er=>{const Ar=an.getSelection(),wn=Ce.current.pastePos||{},Yo=new We.Range(wn.startLineNumber||Ar.endLineNumber,wn.startColumn||Ar.endColumn,wn.endLineNumber||Ar.endLineNumber,wn.endColumn||Ar.endColumn);an.executeEdits("",[{range:Er.range,text:""}])})}catch(Er){}let dr=Tt();return Ti&&typeof Ti=="string"&&new Lt(Ti,an,We),Bt(!0),()=>{const Er=Ce.current.instance;Er.dispose();const Ar=Er.getModel();Ar&&Ar.dispose(),Ce.current.subscription&&Ce.current.subscription.dispose(),dr.unobserve(xr.current)}}catch(an){}})},[]),(0,ue.useEffect)(()=>{if(Ce.current.instance&&Qn)return document.addEventListener("keydown",yn,!1),()=>{document.removeEventListener("keydown",yn)}},[tn,Qn]),(0,ue.useEffect)(()=>{let qt=Ce.current.instance;if(qt&&Qn){let an=De(jt);We.editor.setModelLanguage(qt.getModel(),an)}},[jt,Qn]),(0,ue.useEffect)(()=>{Ce.current.instance&&Qn&&We.editor.setTheme(Mn)},[Mn,Qn]),(0,ue.useEffect)(()=>{let qt=Ce.current.instance;_n.current=jn,qt&&Qn&&(qt.updateOptions(Wt({},jn)),setTimeout(()=>{qt.getModel().updateOptions(Wt({},jn))},200))},[JSON.stringify(jn),Qn]),(0,ue.useEffect)(()=>{let qt=Ce.current.instance;qt&&Qn&&qt.layout()},[vn,Ft,Qn]);const[it,sn]=(0,ue.useState)(Ni(vn)),[Dn,Di]=(0,ue.useState)(Ni(Ft)),cn=Hn(Wt({},pn),{width:it,height:Dn,position:"relative"});return ue.createElement("div",{className:"my-monaco-editor",ref:xr,style:cn},nn&&ue.createElement(nt.CopyToClipboard,{text:Jt,onCopy:()=>$t.ZP.success("\u590D\u5236\u6210\u529F")},ue.createElement(Pn.Z,{title:"\u590D\u5236\u4EE3\u7801"},ue.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},ue.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function Je({width:Nt="100%",height:fn="100%",original:vn,modified:Ft,language:Jt,options:jt={}}){const pn=(0,ue.useRef)(),[jn,Nn]=(0,ue.useState)(null);function Mn(hn){let di;return pn.current&&(di=new Ke.Z(Sn=>{for(let Kt of Sn)(Kt.target.offsetHeight>0||Kt.target.offsetWidth>0)&&hn.layout()}),di.observe(pn.current)),di}(0,ue.useEffect)(()=>(pn.current&&Promise.all([Le.e(8909),Le.e(9404)]).then(Le.bind(Le,2550)).then(hn=>{We=hn;const di=We.editor.createDiffEditor(pn.current,Hn(Wt({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},jt),{wordWrap:!0}));Nn(di);let Sn=Mn(di);return()=>{di.dispose();const Kt=di.getModel();Kt&&Kt.dispose(),Sn.unobserve(pn.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,ue.useEffect)(()=>{jn&&jn.setModel({original:We.editor.createModel(vn,Jt),modified:We.editor.createModel(Ft,Jt)})},[vn,Ft,Jt,jn]);const fr=Ni(Nt),nn=Ni(fn),tn={width:fr,height:nn};return ue.createElement("div",{className:"my-diff-editor",ref:pn,style:tn})}},85057:function(Un,ai,Le){"use strict";Le.d(ai,{jL:function(){return mt},w9:function(){return Fn},QD:function(){return Sn},cQ:function(){return nt},op:function(){return Mn},O5:function(){return po},_b:function(){return Fr},t7:function(){return se},Gi:function(){return An},YG:function(){return Hn},qp:function(){return Rt},vr:function(){return Vi},qE:function(){return tn},Je:function(){return we},wb:function(){return mn},cq:function(){return We},tp:function(){return Te}});var ue=Le(59301),Ke={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"},ft="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==",mt=({dataSource:fi=[],img:Qn,imgWidth:Bt=346,title:Tt,sunTitle:kt,bannerExtraContent:ui})=>ue.createElement("div",{className:Ke.banner},ue.createElement("div",{className:Ke.content},ue.createElement("aside",null,ue.createElement("p",null,ue.createElement("b",null,Tt),ue.createElement("span",null,kt)),fi.length>0&&ue.createElement("div",{className:Ke.btns},fi.map((Yn,vi)=>ue.createElement("div",{key:vi,onClick:Yn.click},Yn.name,Yn.sign?ue.createElement("img",{src:ft,width:39}):null))),ui),Qn&&ue.createElement("img",{style:{marginTop:33,marginRight:38},src:Qn,width:Bt}))),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),dt=Le(89392),Rt=({dataSource:fi=[],value:Qn,onChange:Bt,onTitleChange:Tt,className:kt,title:ui,titleWidth:Yn=41,style:vi={},fontColor:yn="#6A7283",showCount:Kn})=>{const[It,_t]=(0,ue.useState)(0),[hi,it]=(0,ue.useState)(!1),sn=(0,ue.useRef)(null),Dn=(0,ue.useRef)(null);return(0,ue.useEffect)(()=>{var Di;fi.length!==0&&(((Di=sn==null?void 0:sn.current)==null?void 0:Di.clientHeight)>97?_t(1):_t(0)),fi.length===0&&_t(0),it(!1)},[fi]),ue.createElement("div",{className:Ct()(Oe.row,kt),style:vi},ue.createElement("div",{onClick:(0,dt.throttle)(()=>Tt==null?void 0:Tt(),2e3),style:{width:Yn,marginTop:hi?12:4},className:`${Oe.title} ${Tt?"current":""}`},ui),ue.createElement("div",{className:hi?`${Oe.tagsWrap} ${Oe.tagsBorderWrap}`:Oe.tagsWrap},ue.createElement("div",{className:Oe.bar,ref:Dn,style:It>0?{height:It===1?97:"auto",overflow:It===1?"hidden":"auto",paddingRight:55}:{paddingRight:0}},ue.createElement("div",{className:Oe.tag,ref:sn},fi==null?void 0:fi.map(Di=>ue.createElement("span",{onClick:()=>Bt(Di.id),key:Di.id,style:{color:yn},className:Qn===Di.id?Oe.active:""},ue.createElement("span",{title:Di.name,className:Oe.name},Di.name),!!Kn&&ue.createElement("span",{className:Oe.num},Di.count))))),!!It&&ue.createElement(ue.Fragment,null,It===1?ue.createElement("div",{onClick:()=>{var Di;_t(2),((Di=sn==null?void 0:sn.current)==null?void 0:Di.clientHeight)>245?it(!0):it(!1)},className:Oe.action},"\u5C55\u5F00",ue.createElement("i",{style:{transform:"translateY(1px) scale(0.6)"},className:"iconfont icon-zhankai4"})):ue.createElement("div",{onClick:()=>{Dn.current.scrollTop=0,_t(1),it(!1)},className:Oe.action},"\u6536\u8D77",ue.createElement("i",{style:{transform:"translateY(0px) scale(0.6)"},className:"iconfont icon-shouqi3"})))))},ot={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"},Te=({dataSource:fi=[],value:Qn,onChange:Bt,className:Tt,style:kt={}})=>ue.createElement("div",{style:kt,className:Ct()(ot.tabs,Tt)},fi.map(ui=>ue.createElement("span",{onClick:()=>Bt(ui.id),className:Qn===ui.id?ot.active:"",key:ui.id},ui.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:fi=[],value:Qn="",onChange:Bt,onInputChange:Tt=()=>{},className:kt,style:ui={},placeholder:Yn,allowClear:vi=!1})=>{var yn;const[Kn,It]=(0,ue.useState)(""),[_t,hi]=(0,ue.useState)("");(0,ue.useEffect)(()=>{var Dn;let Di=Qn;(Dn=JSON.stringify(Qn))!=null&&Dn.includes("{")&&(It(Qn.id),Di=Qn.value||"");try{hi(decodeURIComponent(Di||""))}catch(cn){hi(decodeURIComponent(Di||""))}},[Qn]);const it=()=>{Bt(encodeURIComponent(_t),Kn||null)},sn=Dn=>{Dn!==Kn&&(It(Dn),Bt(encodeURIComponent(_t),Dn))};return ue.createElement("div",{className:Ct()(ne.input,kt),style:ui},!!fi.length&&ue.createElement("div",{className:ne.dropdown},ue.createElement("div",{className:ne.text},(yn=fi.find(Dn=>Dn.id===Kn))==null?void 0:yn.name,ue.createElement("i",{className:"iconfont icon-zhankai4"}),ue.createElement("b",{className:ne.b1}),ue.createElement("b",{className:ne.b2})),ue.createElement("div",{className:ne.menu},fi.map((Dn,Di)=>ue.createElement("div",{key:Di,onClick:()=>sn(Dn.id)},Dn.name)))),ue.createElement(te.default,{onPressEnter:it,value:_t,onChange:Dn=>{hi(Dn.target.value),Tt(encodeURIComponent(Dn.target.value),Kn||null)},bordered:!1,placeholder:Yn}),ue.createElement("i",{onClick:it,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:fi,onChange:Qn,className:Bt,total:Tt,pageSize:kt,style:ui={}})=>{const Yn=fi<2,vi=fi>=Math.ceil(Tt/kt);return Tt<=kt?ue.createElement(ue.Fragment,null):ue.createElement("div",{className:Ct()(pe.quickPager,Bt),style:ui},ue.createElement("div",{onClick:()=>{Yn||Qn(fi-1,"prev")},className:Yn?pe.disabled:""},"\u4E0A\u4E00\u9875"),ue.createElement("div",{onClick:()=>{vi||Qn(fi+1,"next")},className:vi?pe.disabled:""},"\u4E0B\u4E00\u9875"))},be={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"},Ie=Le(29787),Re=Le(25399),rt=Le(58018),et=Le(3294),Ye=Le(955),ut=Le(96908),tt=Le(57177),wt=Le(81378),St=Le(8797),mn=({className:fi,dataSource:Qn=[],col:Bt=4,right:Tt,bottom:kt=23,precision:ui=0,wrapWidth:Yn=1200,trackEventItems:vi,loading:yn})=>{const Kn=Math.floor((Yn-(Bt-1)*Tt)/Bt);return ue.createElement(Ie.Z,{spinning:yn},ue.createElement("div",{className:Ct()(be.list,fi)},!!Qn.length&&Qn.map((It,_t)=>{const{name:hi,id:it,identifier:sn,power:Dn,cover_image_id:Di,pic:cn}=It;return ue.createElement("div",{className:be.wrap,key:it,style:{width:Kn,marginRight:(1+_t)%Bt===0?0:Tt+ui,marginBottom:kt}},ue.createElement("a",{target:"_blank",href:`/shixuns/${sn}/challenges`,className:be.li,onClick:qt=>{qt.preventDefault(),vi&&(0,Ye.L9)([vi]),Dn&&(0,Ye.xg)(`/shixuns/${sn}/challenges`)}},ue.createElement("div",{className:be.img},ue.createElement("img",{className:be.cover,src:`${cn}`}),It.is_jupyter&&ue.createElement("img",{className:be.sign,src:ut}),It.is_jupyter_lab&&ue.createElement("img",{className:be.sign,src:tt}),It.is_unity_3d&&ue.createElement("img",{className:be.sign,src:wt})),ue.createElement("div",{className:be.name},ue.createElement(Re.Z,{title:hi||"\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0-\u672A\u586B\u5199"},ue.createElement("span",{className:be.e},hi||"\u5B9E\u8DF5\u9879\u76EE\u540D\u79F0-\u672A\u586B\u5199"))),ue.createElement("div",{className:be.tags},ue.createElement(Re.Z,{placement:"bottom",title:"\u5173\u5361\u6570"},ue.createElement("span",null,ue.createElement("i",{className:"iconfont icon-shixunguanqia font14 mr2"}),ue.createElement("span",null,It.challenges_count))),!!It.myshixuns_count&&ue.createElement(Re.Z,{placement:"bottom",title:"\u5B66\u4E60\u4EBA\u6570"},ue.createElement("span",null,ue.createElement("i",{className:"iconfont icon-chengyuan font14 mr2"}),ue.createElement("span",null,It.myshixuns_count))),ue.createElement(Re.Z,{placement:"bottom",title:"\u96BE\u5EA6\u7B49\u7EA7"},ue.createElement("span",null,ue.createElement("span",null,It.level))),ue.createElement("div",{className:be.rate},ue.createElement(rt.Z,{allowHalf:!0,disabled:!0,defaultValue:It.score_info}),ue.createElement("span",null,"\xA0",It.score_info?`${It.score_info}\u5206`:"5\u5206")))),!Dn&&ue.createElement("div",{className:be.lockWrap},ue.createElement("img",{src:`${et.Z.IMG_SERVER}/images/educoder/icon/lockclose.svg`}),ue.createElement("span",{className:"mt15 font16 c-white"},"\u5B9A\u5411\u5F00\u653E\u5185\u5BB9\uFF0C\u9700\u8981\u6388\u6743")))}),!Qn.length&&ue.createElement(St.Z,null)))},$t={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"},Pn=Le(24065),Ot=Le(59301),nt=({className:fi,dataSource:Qn=[],col:Bt=4,right:Tt,bottom:kt=23,precision:ui=0,wrapWidth:Yn=1200,trackEventItems:vi,loading:yn,onRemove:Kn=()=>{},isCurrent:It=!0,showAlias:_t=!1})=>{const hi=Math.floor((Yn-(Bt-1)*Tt)/Bt),it=[{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(Ie.Z,{spinning:yn},Ot.createElement("div",{className:Ct()($t.list,fi)},!!(Qn!=null&&Qn.length)&&(Qn==null?void 0:Qn.map((sn,Dn)=>{var Di;const{name:cn,id:qt,identifier:an,featured:Gi,school_name:ur,image_url:Hi,excellent:Mi,is_plan:Ri}=sn;return Ot.createElement("div",{key:qt,className:$t.wrap,style:{width:hi,marginRight:(1+Dn)%Bt===0?0:Tt+ui,marginBottom:kt}},Ot.createElement("a",{className:$t.li,onClick:dr=>{dr.preventDefault(),dr.stopPropagation(),vi&&(0,Ye.L9)([vi]),(0,Ye.xg)(`/paths/${an}`)}},Ot.createElement("div",{className:$t.img},Ot.createElement("img",{className:$t.cover,src:`${Hi}`}),It&&(0,Pn.bg)()&&(sn==null?void 0:sn.studying)&&Ot.createElement("div",{className:`${$t.movebq} user-path-items`,onClick:dr=>{dr.stopPropagation(),Kn(sn)}},Ot.createElement("i",{className:"iconfont icon-yichu1 mr5 c-red"}),Ot.createElement("span",{className:"c-red"},"\u79FB\u9664")),(Di=sn==null?void 0:sn.subject_tags)==null?void 0:Di.map((dr,Er)=>{var Ar,wn;if(Er===0){const zr=(Ar=it.find(mo=>mo.name==dr))==null?void 0:Ar.swimg;return Ot.createElement("img",{className:$t.sign,src:zr,style:{left:"-4px"}})}const Yo=(wn=it.find(zr=>zr.name==dr))==null?void 0:wn.ptimg;return Ot.createElement("img",{className:$t.sign,src:Yo,style:{left:`${48+52*(Er-1)+2*Er}px`}})}),Ot.createElement("div",{style:{position:"absolute",top:"150px",left:"4px"}},(sn==null?void 0:sn.excellent)&&Ot.createElement("div",{className:$t.bq},"\u5F00\u653E\u8BFE\u7A0B"))),Ot.createElement("div",{className:$t.name},Ot.createElement(Re.Z,{title:_t&&(sn!=null&&sn.excellent_alias_name)?Ot.createElement("span",null,`\u8BFE\u7A0B\u539F\u540D\uFF1A${cn}`,Ot.createElement("br",null),Ot.createElement("span",null,`\u8BFE\u7A0B\u522B\u540D\uFF1A${sn==null?void 0:sn.excellent_alias_name}`)):cn},Ot.createElement("span",{className:$t.e},_t&&(sn==null?void 0:sn.excellent_alias_name)||cn))),Ot.createElement(Re.Z,{title:`\u53D1\u5E03\u5355\u4F4D\uFF1A${ur}`},Ot.createElement("div",{className:$t.unit},Ot.createElement("i",{className:"iconfont icon-danwei1 font14 mr3"}),ur)),Ot.createElement("div",{className:$t.tags},Ot.createElement("div",null,Ot.createElement(Re.Z,{placement:"bottom",title:"\u7AE0\u8282\u6570"},Ot.createElement("span",null,Ot.createElement("i",{className:"iconfont icon-zhangjie1 font14 mr3"}),Ot.createElement("span",null,sn.stages_count))),Ot.createElement(Re.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,sn.members_count)))))))})),!Qn.length&&Ot.createElement(St.Z,null)))},gn={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"},oi="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",zn=Le(59301),Fn=({className:fi,dataSource:Qn=[],col:Bt=4,right:Tt,bottom:kt=23,precision:ui=0,wrapWidth:Yn=1200,trackEventItems:vi,loading:yn,handleVery:Kn=()=>!0})=>{const It=Math.floor((Yn-(Bt-1)*Tt)/Bt);return zn.createElement(Ie.Z,{spinning:yn},zn.createElement("div",{className:Ct()(gn.list,fi)},!!Qn.length&&Qn.map((_t,hi)=>{const{subject_identifier:it,id:sn,identifier:Dn,power:Di}=_t,cn=_t.is_public!=0&&_t.is_public;return zn.createElement("div",{className:gn.wrap,key:sn,style:{width:It,marginRight:(1+hi)%Bt===0?0:Tt+ui,marginBottom:kt}},zn.createElement("a",{className:gn.li,onClick:qt=>{qt.preventDefault(),Kn(_t==null?void 0:_t.first_category_url)&&(vi&&(0,Ye.L9)([vi]),(0,Ye.xg)(_t.first_category_url))}},zn.createElement("div",{className:gn.top},zn.createElement(Re.Z,{title:_t.name},zn.createElement("div",{className:gn.name},_t.name)),zn.createElement("img",{className:gn.img,src:et.Z.IMG_SERVER+"/images/"+_t.avatar_url}),zn.createElement("div",{className:gn.text,title:_t.creator},_t.creator),it&&zn.createElement("div",{className:gn.btns},zn.createElement("div",null,"\u5F00\u653E\u8BFE\u7A0B"),zn.createElement("aside",null,"\u5F00\u653E\u8BFE\u5802")),cn&&zn.createElement("div",{className:gn.sign},"\u516C\u5F00")),zn.createElement("div",{className:gn.bottom},_t.visits>0&&zn.createElement(Re.Z,{title:"\u8BBF\u95EE\u91CF",placement:"bottom"},zn.createElement("span",null,zn.createElement("i",{className:"iconfont icon-liulanyan"}),zn.createElement("span",null,_t.visits))),_t.course_members_count>0&&zn.createElement(Re.Z,{title:"\u6210\u5458",placement:"bottom"},zn.createElement("span",null,zn.createElement("i",{className:"iconfont icon-chengyuan"}),_t.course_members_count)),_t.tasks_count>0&&zn.createElement(Re.Z,{title:"\u4F5C\u4E1A",placement:"bottom"},zn.createElement("span",null,zn.createElement("i",{className:"iconfont icon-zuoye"}),_t.tasks_count)),_t.is_end?zn.createElement("div",{style:{color:"#6B758B"}},"\u5DF2\u7ED3\u675F"):zn.createElement("div",{style:{color:"#00B187"}},"\u8FDB\u884C\u4E2D"))),!_t.is_accessible&&zn.createElement("div",{className:gn.lockWrap},zn.createElement("img",{src:`${et.Z.IMG_SERVER}/images/educoder/icon/lockclose.svg`}),zn.createElement("span",{className:"mt15 font16 c-white"},"\u975E\u8BFE\u5802\u6210\u5458\u4E0D\u53EF\u8FDB\u5165")))}),!Qn.length&&zn.createElement(St.Z,null)))},Cn={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"},ii=Le(89070),Hn=({dataSource:fi=[],value:Qn,onChange:Bt,className:Tt,style:kt={},tabBarExtraContent:ui})=>ue.createElement("div",{className:Ct()(Cn.tabs,Tt),style:kt},ue.createElement("div",{className:Cn.tabsWrap},fi.map((Yn,vi)=>!(Yn!=null&&Yn.hide)&&ue.createElement("aside",{className:Cn.tab,onClick:()=>{Bt(Yn.id),Yn.link&&ii.history.push(Yn.link)},key:vi},ue.createElement("div",{className:Qn===Yn.id?Cn.active:""},Yn.name),(Yn==null?void 0:Yn.resetCount)==null&&(Yn==null?void 0:Yn.total)!==void 0&&ue.createElement("span",null,"\uFF08",Yn==null?void 0:Yn.total,"\uFF09"),(Yn==null?void 0:Yn.resetCount)!==void 0&&(Yn==null?void 0:Yn.total)!==void 0&&ue.createElement(Re.Z,{title:(Yn==null?void 0:Yn.tip)!=null?Yn==null?void 0:Yn.tip:""},ue.createElement("span",{style:{color:"#9096A3"}},"\uFF08",ue.createElement("span",{style:{color:"#000"}},Yn==null?void 0:Yn.resetCount),"/",ue.createElement("span",null,Yn==null?void 0:Yn.total),"\uFF09"))))),ue.createElement("div",{className:Cn.tabBar},ui)),An=({className:fi,style:Qn={},children:Bt})=>ue.createElement("div",{className:Ct()(fi),style:Qn},Bt),Ni={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"},je=Le(75727),Me=Le(93041);const Ee=[{id:"updated_at",name:"\u6700\u65B0\u52A8\u6001"},{id:"created_at",name:"\u6700\u65B0\u521B\u5EFA"},{id:"name",name:"\u540D\u79F0\u6392\u5E8F"}];var We=({sortValue:fi,dropValue:Qn,className:Bt,onSort:Tt,onDrop:kt,dataSource:ui=Ee})=>{var Yn;return ue.createElement("div",{className:Ct()(Ni.orderWrap,Bt)},ue.createElement(je.Z,{dropdownRender:()=>ue.createElement(Me.default,null,ui.map((vi,yn)=>ue.createElement(Me.default.Item,{key:yn,onClick:()=>kt(vi.id)},vi.name)))},ue.createElement("span",{className:Ni.orderTextWrap},(Yn=ui.find(vi=>Qn===vi.id))==null?void 0:Yn.name)),ue.createElement("span",{className:Ni.orderIconWrap},ue.createElement("span",{className:Ni.orderAsc},ue.createElement("i",{className:fi==="asc"?`iconfont icon-sanjiaoxing-up font12 ${Ni.cursorPointer} ${Ni.active}`:`iconfont icon-sanjiaoxing-up font12 ${Ni.cursorPointer}`,onClick:()=>Tt(fi==="asc"?"desc":"asc")})),ue.createElement("span",{className:Ni.orderDesc},ue.createElement("i",{className:fi==="desc"?`iconfont icon-sanjiaoxing-down font12 ${Ni.cursorPointer} ${Ni.active}`:`iconfont icon-sanjiaoxing-down font12 ${Ni.cursorPointer}`,onClick:()=>Tt(fi==="asc"?"desc":"asc")}))))},Ae={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"},Je=Le(99571),Nt=Object.defineProperty,fn=Object.getOwnPropertySymbols,vn=Object.prototype.hasOwnProperty,Ft=Object.prototype.propertyIsEnumerable,Jt=(fi,Qn,Bt)=>Qn in fi?Nt(fi,Qn,{enumerable:!0,configurable:!0,writable:!0,value:Bt}):fi[Qn]=Bt,jt=(fi,Qn)=>{for(var Bt in Qn||(Qn={}))vn.call(Qn,Bt)&&Jt(fi,Bt,Qn[Bt]);if(fn)for(var Bt of fn(Qn))Ft.call(Qn,Bt)&&Jt(fi,Bt,Qn[Bt]);return fi},pn=(fi,Qn)=>{var Bt={};for(var Tt in fi)vn.call(fi,Tt)&&Qn.indexOf(Tt)<0&&(Bt[Tt]=fi[Tt]);if(fi!=null&&fn)for(var Tt of fn(fi))Qn.indexOf(Tt)<0&&Ft.call(fi,Tt)&&(Bt[Tt]=fi[Tt]);return Bt},jn=(fi,Qn,Bt)=>new Promise((Tt,kt)=>{var ui=yn=>{try{vi(Bt.next(yn))}catch(Kn){kt(Kn)}},Yn=yn=>{try{vi(Bt.throw(yn))}catch(Kn){kt(Kn)}},vi=yn=>yn.done?Tt(yn.value):Promise.resolve(yn.value).then(ui,Yn);vi((Bt=Bt.apply(fi,Qn)).next())}),Mn=fi=>{var Qn=fi,{className:Bt,style:Tt,children:kt,loading:ui=!1,openLoading:Yn,onClick:vi=()=>{},size:yn="middle",shape:Kn="round"}=Qn,It=pn(Qn,["className","style","children","loading","openLoading","onClick","size","shape"]);const[_t,hi]=(0,ue.useState)(!1);return ue.createElement(Je.ZP,jt({onClick:(0,dt.throttle)(it=>jn(void 0,null,function*(){Yn&&hi(!0);try{yield vi(it)}catch(sn){console.log("error",sn)}Yn&&hi(!1)}),2e3,{leading:!0,trailing:!1}),className:Ct()(Ae.btn,Ae[`${yn}-${Kn}`],Bt),style:Tt,size:yn,shape:Kn,loading:_t||ui},It),kt)},fr={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"},tn=({className:fi,style:Qn,children:Bt=null,onClick:Tt,title:kt})=>ue.createElement("div",{className:Ct()(fr.head,fi),style:Qn},ue.createElement("span",{className:"primary-hover",onClick:Tt},ue.createElement("i",{className:"iconfont icon-fanhui2 font12"}),"\u8FD4\u56DE"),ue.createElement("b",{title:kt},kt),ue.createElement("div",{className:fr.node},Bt)),hn={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"},Sn=({confirmShow:fi=!0,confirmTitle:Qn,confirmClick:Bt,cancelShow:Tt=!0,cancelTitle:kt,cancelClick:ui,className:Yn,style:vi,confirmLoading:yn=!1})=>ue.createElement("div",{className:Ct()(hn.btns,Yn),style:vi},fi&&ue.createElement(Je.ZP,{loading:yn,onClick:Bt,type:"primary",className:hn.confirm},Qn),Tt&&ue.createElement(Je.ZP,{onClick:ui,className:hn.cancel},kt)),Kt={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"},Vi=({className:fi,style:Qn={},LeftContent:Bt,children:Tt,RightContent:kt})=>ue.createElement("div",{className:Ct()(Kt.fixedBottom,fi),style:Qn},ue.createElement("div",{className:Kt.wrap},ue.createElement("div",{className:Kt.left},Bt),ue.createElement("div",{className:Kt.center},Tt),ue.createElement("div",{className:Kt.right},kt))),Pi={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"},Fr=({className:fi,style:Qn={},dataSource:Bt=[]})=>ue.createElement("div",{className:Ct()(Pi.crumbs,fi),style:Qn},Bt.map((Tt,kt)=>kt<Bt.length-1?ue.createElement(ue.Fragment,{key:kt},Tt.path||Tt.onClick?ue.createElement("span",{className:Pi.hover,onClick:Tt!=null&&Tt.onClick?Tt.onClick:()=>ii.history.push(Tt.path)},Tt.name):ue.createElement("span",null,Tt.name),ue.createElement("span",null,"\xA0",">","\xA0")):ue.createElement("span",{key:kt,style:{color:"#5F6368"}},Tt.name))),$n=Le(11938),In=Object.defineProperty,si=Object.defineProperties,Ti=Object.getOwnPropertyDescriptors,Oi=Object.getOwnPropertySymbols,zi=Object.prototype.hasOwnProperty,xr=Object.prototype.propertyIsEnumerable,Ce=(fi,Qn,Bt)=>Qn in fi?In(fi,Qn,{enumerable:!0,configurable:!0,writable:!0,value:Bt}):fi[Qn]=Bt,_n=(fi,Qn)=>{for(var Bt in Qn||(Qn={}))zi.call(Qn,Bt)&&Ce(fi,Bt,Qn[Bt]);if(Oi)for(var Bt of Oi(Qn))xr.call(Qn,Bt)&&Ce(fi,Bt,Qn[Bt]);return fi},ci=(fi,Qn)=>si(fi,Ti(Qn)),ar=(fi,Qn)=>{var Bt={};for(var Tt in fi)zi.call(fi,Tt)&&Qn.indexOf(Tt)<0&&(Bt[Tt]=fi[Tt]);if(fi!=null&&Oi)for(var Tt of Oi(fi))Qn.indexOf(Tt)<0&&xr.call(fi,Tt)&&(Bt[Tt]=fi[Tt]);return Bt};const{Countdown:_r}=$n.default;var po=fi=>{var Qn=fi,{onChange:Bt}=Qn,Tt=ar(Qn,["onChange"]);const[kt,ui]=(0,ue.useState)(null);(0,ue.useEffect)(()=>{typeof kt=="number"&&kt>=0&&Bt(kt)},[kt]);const Yn=vi=>{const yn=Math.floor(vi/1e3);ui(yn)};return ue.createElement(_r,ci(_n({},Tt),{onChange:Yn}))}},58856:function(Un,ai,Le){"use strict";Le.d(ai,{Z:function(){return Ke}});var ue=Le(59301);function Ke(ft,yt){const mt=(0,ue.useRef)();(0,ue.useEffect)(()=>{mt.current=ft}),(0,ue.useEffect)(()=>{function Oe(){mt.current()}if(yt!==null){let at=setInterval(Oe,yt);return()=>clearInterval(at)}},[yt])}},74440:function(Un,ai,Le){"use strict";Le.d(ai,{h:function(){return ue}});var ue=(Ke=>(Ke[Ke.NOMATCH=-1]="NOMATCH",Ke[Ke.OK=0]="OK",Ke[Ke.TIMEOUT=2]="TIMEOUT",Ke[Ke.PODFAILURE=3]="PODFAILURE",Ke[Ke.COMPILEFAILURE=4]="COMPILEFAILURE",Ke[Ke.EXECUTEFAILURE=5]="EXECUTEFAILURE",Ke[Ke.HIDE_COMPILE_STATUS=11]="HIDE_COMPILE_STATUS",Ke))(ue||{})},88264:function(Un,ai,Le){"use strict";Le.d(ai,{H7:function(){return ne},MK:function(){return Te},MU:function(){return Ge},X6:function(){return ot},bM:function(){return dt},fi:function(){return te},fu:function(){return Ct},n4:function(){return de},rX:function(){return At},vl:function(){return se},zO:function(){return Rt}});var ue=Le(99064),Ke=Object.defineProperty,ft=Object.getOwnPropertySymbols,yt=Object.prototype.hasOwnProperty,mt=Object.prototype.propertyIsEnumerable,Oe=(pe,ye,we)=>ye in pe?Ke(pe,ye,{enumerable:!0,configurable:!0,writable:!0,value:we}):pe[ye]=we,at=(pe,ye)=>{for(var we in ye||(ye={}))yt.call(ye,we)&&Oe(pe,we,ye[we]);if(ft)for(var we of ft(ye))mt.call(ye,we)&&Oe(pe,we,ye[we]);return pe};function Ct(pe,ye){return(0,ue.U2)(`myproblems/${pe}.json`,at({hidePopLogin:!0},ye||{}))}function dt(pe,ye){return(0,ue.v_)(`myproblems/${pe}/code_submit.json`,ye)}function Ge(pe,ye){return(0,ue.v_)(`myproblems/${pe}/code_debug.json`,ye)}function Rt(pe,ye){return ye.language&&(ye.language=encodeURIComponent(ye.language)),(0,ue.U2)(`myproblems/${pe}/submit_records.json`,ye)}function ot(pe){return(0,ue.U2)("myproblems/record_detail.json",{id:pe})}function At(pe,ye){return(0,ue.U2)(`myproblems/${pe}/result.json`,{mode:ye})}function Te(pe,ye){return(0,ue.v_)(`myproblems/${pe}/add_notes.json`,ye)}function ne(pe,ye){return(0,ue.v_)(`myproblems/${pe}/restore_initial_code.json`,ye)}function te(pe){return(0,ue.v_)(`myproblems/${pe}/sync_code.json`)}function de(pe,ye){return(0,ue.v_)(`myproblems/${pe}/update_code.json`,ye)}function se(pe,ye){return(0,ue.v_)(`discusses/${pe}/plus.json`,ye)}},92744:function(Un,ai,Le){"use strict";Le.d(ai,{Z:function(){return Ha}});var ue=Le(59301),Ke={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"},ft=Le(28284),yt=Le(25399),mt=Le(99571),Oe=Le(62957),at=Le(71051),Ct=Le(6767),dt=Le(37568),Ge=Le(37285),Rt=Le(62673),ot=Le(77019),At=Le(5269),Te=Le(13747),ne=Le(37639),te=Object.defineProperty,de=Object.getOwnPropertySymbols,se=Object.prototype.hasOwnProperty,pe=Object.prototype.propertyIsEnumerable,ye=(Mt,Pt,ln)=>Pt in Mt?te(Mt,Pt,{enumerable:!0,configurable:!0,writable:!0,value:ln}):Mt[Pt]=ln,we=(Mt,Pt)=>{for(var ln in Pt||(Pt={}))se.call(Pt,ln)&&ye(Mt,ln,Pt[ln]);if(de)for(var ln of de(Pt))pe.call(Pt,ln)&&ye(Mt,ln,Pt[ln]);return Mt};const be=Mt=>React.createElement("svg",we({width:34,height:34,xmlns:"http://www.w3.org/2000/svg"},Mt),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 Ie="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCBmaWxsPSIjRTRFNkZEIiB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIvPjxnIGZpbGwtcnVsZT0ibm9uemVybyI+PHBhdGggZD0iTTEzLjgwOCAxMS40NDhhLjU1OC41NTggMCAwIDEgMCAuNzg4bC0xLjU2NCAxLjU2NWEuNTU4LjU1OCAwIDEgMS0uNzg5LS43OWwxLjU2NC0xLjU2M2EuNTU4LjU1OCAwIDAgMSAuNzkgMFptOS44ODIgMi40NjJhLjU1OC41NTggMCAwIDEtLjc4OSAwbC0xLjU2NC0xLjU2M2EuNTU4LjU1OCAwIDEgMSAuNzg5LS43ODlsMS41NjQgMS41NjRhLjU1Ni41NTYgMCAwIDEgMCAuNzg4WiIgZmlsbD0iIzY2NzhFQiIvPjxwYXRoIGQ9Ik0yMS43NTMgMjEuNzA3YTUuOTM3IDUuOTM3IDAgMSAwLTguNTguMDE1bC0uOTM3LjkzNmEuNTU4LjU1OCAwIDEgMCAuNzg5Ljc4OGwuOTk1LS45OTRhNS45MSA1LjkxIDAgMCAwIDMuNDM2IDEuMDk1YzEuMjg3IDAgMi40OC0uNDEgMy40NTItMS4xMDZsLjk5Mi45OTJhLjU1OC41NTggMCAxIDAgLjc4OS0uNzg5bC0uOTM2LS45MzdaIiBmaWxsPSIjNjY3OEVCIi8+PHBhdGggZD0ibTIwLjg1OCAxOC45NS0zLjAyNC0xLjc0NXYtMi4wNTRhLjU1OC41NTggMCAxIDAtMS4xMTcgMHYyLjM1MWMwIC4wNjQuMDExLjEyNi4wMzEuMTg0YS41NTEuNTUxIDAgMCAwIC4yNTguMzNsMy4yOTMgMS45YS41NTcuNTU3IDAgMCAwIC41NTktLjk2NloiIGZpbGw9IiNGRkYiLz48L2c+PC9nPjwvc3ZnPg==",Re=Le(85149),rt=Le(89070),et=Le(955),Ye=Le(99064),ut=Object.defineProperty,tt=Object.getOwnPropertySymbols,wt=Object.prototype.hasOwnProperty,St=Object.prototype.propertyIsEnumerable,Lt=(Mt,Pt,ln)=>Pt in Mt?ut(Mt,Pt,{enumerable:!0,configurable:!0,writable:!0,value:ln}):Mt[Pt]=ln,mn=(Mt,Pt)=>{for(var ln in Pt||(Pt={}))wt.call(Pt,ln)&&Lt(Mt,ln,Pt[ln]);if(tt)for(var ln of tt(Pt))St.call(Pt,ln)&&Lt(Mt,ln,Pt[ln]);return Mt};const $t=Mt=>React.createElement("svg",mn({width:34,height:34,xmlns:"http://www.w3.org/2000/svg"},Mt),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 Pn="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIgZmlsbD0iI0VBRjNGNCIvPjxwYXRoIGQ9Ik0yNS45MDUgMTUuMzdhLjc3NS43NzUgMCAwIDAtLjYyNi0uNTI5bC00LjgxNC0uNy0yLjE1Mi00LjM2MmEuNzc2Ljc3NiAwIDAgMC0xLjM5MiAwbC0yLjE1MyA0LjM2My00LjgxNC42OTlhLjc3NS43NzUgMCAwIDAtLjQzIDEuMzIzbDMuNDg0IDMuMzk2LS44MjMgNC43OTRhLjc3Ny43NzcgMCAwIDAgMS4xMjYuODE4bDQuMzA2LTIuMjY0IDQuMzA1IDIuMjY0YS43NzguNzc4IDAgMCAwIC44MTctLjA1OS43NzcuNzc3IDAgMCAwIC4zMS0uNzU5bC0uODIzLTQuNzk0IDMuNDgzLTMuMzk2YS43NzcuNzc3IDAgMCAwIC4xOTYtLjc5NVoiIGZpbGw9IiMyMUMwQTYiIGZpbGwtcnVsZT0ibm9uemVybyIvPjwvZz48L3N2Zz4=",Ot=Object.defineProperty,ct=Object.getOwnPropertySymbols,nt=Object.prototype.hasOwnProperty,gn=Object.prototype.propertyIsEnumerable,oi=(Mt,Pt,ln)=>Pt in Mt?Ot(Mt,Pt,{enumerable:!0,configurable:!0,writable:!0,value:ln}):Mt[Pt]=ln,zn=(Mt,Pt)=>{for(var ln in Pt||(Pt={}))nt.call(Pt,ln)&&oi(Mt,ln,Pt[ln]);if(ct)for(var ln of ct(Pt))gn.call(Pt,ln)&&oi(Mt,ln,Pt[ln]);return Mt};const Ht=Mt=>React.createElement("svg",zn({width:34,height:34,xmlns:"http://www.w3.org/2000/svg"},Mt),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 Fn="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48cmVjdCBmaWxsPSIjRTdGM0ZGIiB3aWR0aD0iMzQiIGhlaWdodD0iMzQiIHJ4PSIxMCIvPjxnIGZpbGw9IiM0QzZGRkYiIGZpbGwtcnVsZT0ibm9uemVybyI+PHBhdGggZD0ibTIzLjcxOSAxMy4zMjUtNC4wOTgtMy45NGMtLjA5Ny0uMTMtLjIyNS0uMTYyLS4zNTUtLjE2Mi0uMTI5IDAtLjI1OC4wNjQtLjM4Ny4xNjFsLTcuNTUgNy43NTNjLS4wNjUuMDY1LS4wOTguMTYyLS4xMy4yMjdsLTEuMDMyIDUuNDI3Yy0uMDMzLjE5NC4wMzIuMzIzLjE2LjQ4NC4xMy4xMy4yMjcuMTYyLjM4OS4xNjJoLjA5Nmw0Ljc3Ni0xLjA5OWMuMDk3LS4wMzIuMTk0LS4wNjQuMjU4LS4xNjFsNy44NDEtOC4xMDhjLjE5NC0uMTYyLjE5NC0uNTE3LjAzMy0uNzQ0aC0uMDAxWm0tOC4xIDguMDQ0YS41MzQuNTM0IDAgMCAxLS4zODYuMTYyLjU2LjU2IDAgMCAxLS4zODgtLjE2MmwtMy0yLjgxYy0uMjI2LS4xOTQtLjIyNi0uNTE3LS4wMzMtLjc0My4xOTQtLjIyNy41MTctLjIyNy43NDMtLjAzM2wzIDIuODExYy4yNTkuMjI2LjI5MS41NS4wNjUuNzc2Wk0xNyAyMi45Mmg2Ljg0NHYxLjA1NUgxN3oiLz48L2c+PC9nPjwvc3ZnPg==",Cn=Le(42678),ii=Le(12290),Wt=Le(65158),Hn=Le(10672),lt={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"},An=Le(59301),Ni=Object.defineProperty,je=Object.defineProperties,Me=Object.getOwnPropertyDescriptors,Ee=Object.getOwnPropertySymbols,De=Object.prototype.hasOwnProperty,We=Object.prototype.propertyIsEnumerable,Ae=(Mt,Pt,ln)=>Pt in Mt?Ni(Mt,Pt,{enumerable:!0,configurable:!0,writable:!0,value:ln}):Mt[Pt]=ln,Je=(Mt,Pt)=>{for(var ln in Pt||(Pt={}))De.call(Pt,ln)&&Ae(Mt,ln,Pt[ln]);if(Ee)for(var ln of Ee(Pt))We.call(Pt,ln)&&Ae(Mt,ln,Pt[ln]);return Mt},Nt=(Mt,Pt)=>je(Mt,Me(Pt)),fn=(Mt,Pt)=>{var ln={};for(var He in Mt)De.call(Mt,He)&&Pt.indexOf(He)<0&&(ln[He]=Mt[He]);if(Mt!=null&&Ee)for(var He of Ee(Mt))Pt.indexOf(He)<0&&We.call(Mt,He)&&(ln[He]=Mt[He]);return ln};const vn=null,Ft=(Mt,Pt)=>{var ln=Mt,{globalSetting:He,loading:Dt,dispatch:Xi,isEdit:Mr,editData:Qi}=ln,$i=fn(ln,["globalSetting","loading","dispatch","isEdit","editData"]);const[wi,pr]=(0,ue.useState)(""),[Hr,no]=(0,ue.useState)(""),[lr,cr]=(0,ue.useState)([]),[yr,_i]=(0,ue.useState)(""),[Ci,Dr]=(0,ue.useState)(),[ko,br]=(0,ue.useState)(!1),[Cr,Nr]=(0,ue.useState)({}),[Tr,sr]=(0,ue.useState)([]);(0,ue.useEffect)(()=>{!Qi||!Mr||(pr(Qi==null?void 0:Qi.name),no(Qi==null?void 0:Qi.analysis),Dr(Qi==null?void 0:Qi.is_ordered),Nr(Qi),br(!0))},[Qi]),(0,ue.useEffect)(()=>{if(!ko)return;const kr=Qi==null?void 0:Qi.standard_answer.map(Eo=>Eo==null?void 0:Eo.answer_text);cr(kr);const $a=Qi==null?void 0:Qi.standard_answer.map(Eo=>Eo==null?void 0:Eo.score);sr($a),br(!1)},[ko]),(0,ue.useImperativeHandle)(Pt,()=>({onSave:ra,Clear:Bo}));const ra=()=>{let kr=[],$a=!1;return wi?(lr.forEach((Eo,ts)=>{kr.push({position:ts+1,answer_text:[],score:Tr[ts]}),Eo==null||Eo.forEach((ys,Ol)=>{kr[ts].answer_text.push(ys),(!ys||!(0,et.eR)(ys,1e4))&&(_i(`${ts}-${Ol}`),Ct.ZP.info(ys?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),$a=!0)})}),$a?!1:(kr==null?void 0:kr.length)>20?(Ct.ZP.warning("\u586B\u7A7A\u9898\u6807\u51C6\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A/\u4E0D\u80FD\u8D85\u8FC720\u4E2A\uFF01"),!1):{name:wi,analysis:Hr,standard_answers:kr,is_ordered:Ci,downcase:Cr==null?void 0:Cr.downcase,no_space:Cr==null?void 0:Cr.no_space,use_blank_score:Cr==null?void 0:Cr.use_blank_score}):(Ct.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1)},Bo=()=>{pr(""),no(""),cr([]),Dr(!1)},ta=(kr,$a,Eo)=>{const ts=lr.slice();if($a&&ts.splice(kr,$a),Eo)for(let ys=0;ys<Eo;ys++)ts.splice(kr+ys,0,[""]);cr(ts)},Sa=(kr,$a,Eo)=>{_i("");let ts=lr.slice();ts[kr][$a]=Eo,cr(ts)},ro=kr=>{let $a=lr.slice();$a[kr]=[...$a[kr],""],cr($a)},ha=(kr,$a)=>{let Eo=lr.slice();if(!Eo[kr][$a]){Eo[kr]=Eo[kr].filter((ts,ys)=>ys!==$a),cr(Eo);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:lt.modal,onOk:()=>{Eo[kr]=Eo[kr].filter((ts,ys)=>ys!==$a),cr(Eo)}})},As=kr=>{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:lt.modal,onOk:()=>{let $a=lr.slice();$a=lr.filter((Eo,ts)=>kr!==ts),cr($a)}})};return An.createElement("section",{className:lt.wrap},An.createElement("p",{className:lt.titleWrap},An.createElement("span",{className:lt.required},"*"),An.createElement("span",{className:lt.title},"\u9898\u5E72\uFF1A")),An.createElement("div",null,An.createElement(Wt.Z,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:wi,onChange:kr=>pr(kr),showNullButton:!0,onPlaceholderChange:ta})),An.createElement("div",{className:"mt20"},lr.map((kr,$a)=>An.createElement("div",{style:{display:"flex"}},An.createElement("div",{style:{flex:1}},An.createElement(Hn.Z,{key:$a,answers:kr,index:$a,flex:1,is_md:!0,activeOptionErrorIndex:yr,onAnswerChange:Sa,addChildAnswer:ro,deleteChildAnswer:ha,deleteChildAnswermain:As})),Cr.use_blank_score&&An.createElement("div",{style:{display:"flex",alignItems:"center",width:"165px"}},An.createElement("span",{style:{color:"red",margin:"auto 5px auto 10px"}},"*"),"\u5206\u503C\uFF1A",An.createElement(at.Z,{style:{width:"100px"},size:"large",defaultValue:Tr[$a],onBlur:Eo=>{Tr[$a]=Eo.target.value,sr([...Tr])}}))))),An.createElement("div",null,An.createElement(Rt.default,{className:`${lt.color333} font14 mt20`,checked:Cr.use_blank_score,onChange:kr=>Nr(Nt(Je({},Cr),{use_blank_score:kr.target.checked}))},"\u5224\u5206\u65F6\u6309\u7A7A\u7ED9\u5206"),An.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")),An.createElement("div",null,An.createElement(Rt.default,{className:`${lt.color333} font14 mt20`,checked:Cr.downcase,onChange:kr=>Nr(Nt(Je({},Cr),{downcase:kr.target.checked}))},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),An.createElement("div",null,An.createElement(Rt.default,{className:`${lt.color333} font14 mt20`,checked:Cr.no_space,onChange:kr=>Nr(Nt(Je({},Cr),{no_space:kr.target.checked}))},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),An.createElement("div",{className:"mt20"},(lr==null?void 0:lr.length)>1&&An.createElement("span",null,An.createElement(Rt.default,{checked:Ci,onChange:kr=>Dr(kr.target.checked),className:`${lt.color333} font14`},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),An.createElement("span",{className:`${lt.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"))),An.createElement("p",{className:lt.titleWrap},An.createElement("span",{className:lt.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),An.createElement(ii.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Hr,onChange:kr=>no(kr)}))};var Jt=(0,rt.connect)(({loading:Mt,globalSetting:Pt})=>({globalSetting:Pt,loading:Mt.effects}),null,null,{forwardRef:!0})((0,ue.forwardRef)(Ft)),jt=Le(47889),pn=Object.getOwnPropertySymbols,jn=Object.prototype.hasOwnProperty,Nn=Object.prototype.propertyIsEnumerable,Mn=(Mt,Pt)=>{var ln={};for(var He in Mt)jn.call(Mt,He)&&Pt.indexOf(He)<0&&(ln[He]=Mt[He]);if(Mt!=null&&pn)for(var He of pn(Mt))Pt.indexOf(He)<0&&Nn.call(Mt,He)&&(ln[He]=Mt[He]);return ln};const fr=null,nn=(Mt,Pt)=>{var ln=Mt,{globalSetting:He,loading:Dt,editData:Xi,dispatch:Mr,onRef:Qi=()=>{},isEdit:$i}=ln,wi=Mn(ln,["globalSetting","loading","editData","dispatch","onRef","isEdit"]);const[pr,Hr]=(0,ue.useState)(),[no,lr]=(0,ue.useState)(""),[cr,yr]=(0,ue.useState)("");(0,ue.useEffect)(()=>{if(!Xi||!$i)return;lr(Xi==null?void 0:Xi.name),yr(Xi==null?void 0:Xi.analysis);const Dr=Xi==null?void 0:Xi.choices.find(ko=>ko.is_answer);Hr(Dr.choice_text==="\u6B63\u786E"?"0":"1")},[Xi]),(0,ue.useImperativeHandle)(Pt,()=>({onSave:_i,Clear:Ci}));const _i=()=>no?pr?{name:no,choices:[{choice_text:"\u6B63\u786E",is_answer:pr==="0"?1:0},{choice_text:"\u9519\u8BEF",is_answer:pr==="1"?1:0}],analysis:cr}:(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),Ci=()=>{lr(""),yr(""),Hr("")};return ue.createElement("section",{className:lt.wrap},ue.createElement("p",{className:lt.titleWrap},ue.createElement("span",{className:lt.required},"*"),ue.createElement("span",{className:lt.title},"\u9898\u5E72\uFF1A")),ue.createElement(ii.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:no,onChange:Dr=>lr(Dr)}),ue.createElement("p",{className:lt.titleWrap},ue.createElement("span",{className:lt.required},"*"),ue.createElement("span",{className:lt.title},"\u7B54\u6848\u9009\u9879\uFF1A",ue.createElement("span",{className:lt.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),ue.createElement(jt.ZP.Group,{buttonStyle:"solid",value:pr,onChange:Dr=>Hr(Dr.target.value)},ue.createElement(jt.ZP.Button,{value:"0",className:`${lt.radio} mr40`},"\u6B63\u786E"),ue.createElement(jt.ZP.Button,{value:"1",className:lt.radio},"\u9519\u8BEF")),ue.createElement("p",{className:lt.titleWrap},ue.createElement("span",{className:lt.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),ue.createElement(ii.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:cr,onChange:Dr=>yr(Dr)}))};var tn=(0,rt.connect)(({loading:Mt,globalSetting:Pt})=>({globalSetting:Pt,loading:Mt.effects}),null,null,{forwardRef:!0})((0,ue.forwardRef)(nn)),hn=Object.getOwnPropertySymbols,di=Object.prototype.hasOwnProperty,Sn=Object.prototype.propertyIsEnumerable,Kt=(Mt,Pt)=>{var ln={};for(var He in Mt)di.call(Mt,He)&&Pt.indexOf(He)<0&&(ln[He]=Mt[He]);if(Mt!=null&&hn)for(var He of hn(Mt))Pt.indexOf(He)<0&&Sn.call(Mt,He)&&(ln[He]=Mt[He]);return ln};const gi=null,Vi=(Mt,Pt)=>{var ln=Mt,{globalSetting:He,loading:Dt,editData:Xi,dispatch:Mr,onRef:Qi=()=>{},isEdit:$i}=ln,wi=Kt(ln,["globalSetting","loading","editData","dispatch","onRef","isEdit"]);const[pr,Hr]=(0,ue.useState)([]);(0,ue.useEffect)(()=>{var yr;if(!Xi||!$i)return;const _i=(yr=Xi==null?void 0:Xi.shixun)==null?void 0:yr.challenges.map(Ci=>({id:Ci==null?void 0:Ci.id,score:Ci.score}));Hr(_i)},[Xi]),(0,ue.useImperativeHandle)(Pt,()=>({onSave:no,Clear:lr}));const no=()=>({challenges:[...pr]}),lr=()=>{Hr([])};console.log("editData--",Xi);const cr=yr=>{var _i,Ci;return ue.createElement("div",null,(Ci=(_i=yr==null?void 0:yr.shixun)==null?void 0:_i.challenges)==null?void 0:Ci.map((Dr,ko)=>{var br;return ue.createElement("div",{className:"c-grey-666 font14 ml25",style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"15px"}},ue.createElement("div",null,ue.createElement("span",{className:"mr5"},"\u7B2C",ko+1,"\u5173"),ue.createElement(yt.Z,{key:ko,title:Dr==null?void 0:Dr.challenge_name},ue.createElement("span",null,(0,et.Pq)(Dr==null?void 0:Dr.challenge_name,44)))),ue.createElement("p",{style:{marginBottom:0}},ue.createElement("span",{className:lt.required},"*"),ue.createElement("span",{className:lt.title},"\u5206\u503C\uFF1A"),ue.createElement(at.Z,{precision:1,min:1,max:100,className:lt.baseFormItem,style:{width:176},value:(br=pr.find(Cr=>Cr.id===Dr.id))==null?void 0:br.score,onChange:Cr=>{pr.find(Nr=>Nr.id===Dr.id).score=Cr,Hr([...pr])}})))}),ue.createElement("div",{style:{clear:"both"}}))};return ue.createElement("section",{className:lt.wrap},ue.createElement(Re.Z,{style:{paddingRight:10},className:lt.titleHtml,value:`${Xi==null?void 0:Xi.position}\u3001${Xi==null?void 0:Xi.name}`}),ue.createElement("p",{style:{marginBottom:"10px",marginTop:"25px"}},ue.createElement("span",{className:lt.required},"*"),ue.createElement("span",{className:lt.title},"\u5173\u5361")),cr(Xi))};var Pi=(0,rt.connect)(({loading:Mt,globalSetting:Pt})=>({globalSetting:Pt,loading:Mt.effects}),null,null,{forwardRef:!0})((0,ue.forwardRef)(Vi)),Ii=Object.getOwnPropertySymbols,Fr=Object.prototype.hasOwnProperty,$n=Object.prototype.propertyIsEnumerable,In=(Mt,Pt)=>{var ln={};for(var He in Mt)Fr.call(Mt,He)&&Pt.indexOf(He)<0&&(ln[He]=Mt[He]);if(Mt!=null&&Ii)for(var He of Ii(Mt))Pt.indexOf(He)<0&&$n.call(Mt,He)&&(ln[He]=Mt[He]);return ln};const si=["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"],Ti=(Mt,Pt)=>{var ln=Mt,{editData:He,globalSetting:Dt,loading:Xi,dispatch:Mr,onRef:Qi=()=>{},isEdit:$i}=ln,wi=In(ln,["editData","globalSetting","loading","dispatch","onRef","isEdit"]);const[pr,Hr]=(0,ue.useState)([]),[no,lr]=(0,ue.useState)(),[cr,yr]=(0,ue.useState)([]),[_i,Ci]=(0,ue.useState)(""),[Dr,ko]=(0,ue.useState)("");(0,ue.useEffect)(()=>{Hr(["","","",""])},[]),(0,ue.useEffect)(()=>{if(!He||!$i)return;Ci(He==null?void 0:He.name),ko(He==null?void 0:He.analysis),Hr(He==null?void 0:He.choices.map(Tr=>Tr.choice_text));const Nr=[];He==null||He.choices.map((Tr,sr)=>{Tr.is_answer&&Nr.push(sr)}),yr(Nr)},[He]),(0,ue.useImperativeHandle)(Pt,()=>({onSave:br,Clear:Cr}));const br=()=>{if(!_i)return Ct.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;const Nr=pr.findIndex(sr=>!sr);if(Nr>-1)return Ct.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${si[Nr]} \u9009\u9879\u7684\u5185\u5BB9`),!1;if(!cr.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(cr.length<2)return Ct.ZP.info("\u591A\u9009\u9898\u6700\u5C0F\u6B63\u786E\u9009\u9879\u4E3A2\u4E2A"),!1;const Tr=pr.map((sr,ra)=>({choice_text:sr,is_answer:cr.includes(ra)?1:0}));return{name:_i,choices:Tr,analysis:Dr}},Cr=()=>{Hr(["","","",""]),Ci(""),ko(""),yr("")};return ue.createElement("section",{className:lt.wrap},ue.createElement("p",{className:lt.titleWrap},ue.createElement("span",{className:lt.required},"*"),ue.createElement("span",{className:lt.title},"\u9898\u5E72\uFF1A")),ue.createElement(ii.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:_i,onChange:Nr=>Ci(Nr)}),ue.createElement("p",{className:lt.titleWrap},ue.createElement("span",{className:lt.required},"*"),ue.createElement("span",{className:lt.title},"\u7B54\u6848\u9009\u9879\uFF1A",ue.createElement("span",{className:lt.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),pr.map((Nr,Tr)=>ue.createElement("div",{className:lt.choiceWrap,key:Tr},ue.createElement(yt.Z,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},ue.createElement("div",{className:`${lt.answer} ${cr.includes(Tr)?lt.activeAnswer:""}`,onClick:()=>{cr.includes(Tr)?yr(cr.filter(sr=>sr!==Tr)):yr([...cr,Tr])}},si[Tr])),ue.createElement("div",{className:lt.editorWrap},no===Tr?ue.createElement(ii.Z,{id:`single-question-option-${Tr}`,watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Nr,onChange:sr=>{pr[Tr]=sr,Hr(pr)}}):ue.createElement("div",{className:lt.htmlWrap,onClick:()=>lr(Tr)},ue.createElement(Re.Z,{value:Nr}))),Tr>1&&ue.createElement(yt.Z,{title:"\u5220\u9664"},ue.createElement("i",{className:`${lt.deleteIcon} iconfont icon-htmal5icon19`,onClick:()=>{Hr(pr.filter((sr,ra)=>ra!==Tr)),cr.includes(Tr)?yr(cr.filter(sr=>sr!==Tr)):yr([...cr,Tr])}})),Tr<7&&Tr===pr.length-1&&ue.createElement(yt.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},ue.createElement("i",{className:`${lt.addIcon} iconfont icon-roundaddfill ml6`,onClick:()=>Hr([...pr,""])})))),ue.createElement("p",{className:lt.titleWrap},ue.createElement("span",{className:lt.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),ue.createElement(ii.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Dr,onChange:Nr=>ko(Nr)}))};var Oi=(0,rt.connect)(({loading:Mt,globalSetting:Pt})=>({globalSetting:Pt,loading:Mt.effects}),null,null,{forwardRef:!0})((0,ue.forwardRef)(Ti)),zi=Object.getOwnPropertySymbols,xr=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable,_n=(Mt,Pt)=>{var ln={};for(var He in Mt)xr.call(Mt,He)&&Pt.indexOf(He)<0&&(ln[He]=Mt[He]);if(Mt!=null&&zi)for(var He of zi(Mt))Pt.indexOf(He)<0&&Ce.call(Mt,He)&&(ln[He]=Mt[He]);return ln};const ci=["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=(Mt,Pt)=>{var ln=Mt,{editData:He,globalSetting:Dt,loading:Xi,dispatch:Mr,onRef:Qi=()=>{},isEdit:$i}=ln,wi=_n(ln,["editData","globalSetting","loading","dispatch","onRef","isEdit"]);const[pr,Hr]=(0,ue.useState)([]),[no,lr]=(0,ue.useState)(),[cr,yr]=(0,ue.useState)(),[_i,Ci]=(0,ue.useState)(""),[Dr,ko]=(0,ue.useState)("");(0,ue.useEffect)(()=>{Hr(["","","",""])},[]),(0,ue.useEffect)(()=>{if(!He||!$i)return;const Nr=[],Tr=[];He==null||He.choices.forEach((sr,ra)=>{Nr.push(sr.choice_text),sr.is_answer&&Tr.push(ra)}),Ci(He==null?void 0:He.name),ko(He==null?void 0:He.analysis),Hr(Nr),yr(Tr)},[He]),(0,ue.useImperativeHandle)(Pt,()=>({onSave:br,Clear:Cr}));const br=()=>{if(!_i)return Ct.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;const Nr=pr.findIndex(sr=>!sr);if(Nr>-1)return Ct.ZP.info(`\u8BF7\u5148\u8F93\u5165 ${ci[Nr]} \u9009\u9879\u7684\u5185\u5BB9`),!1;if(!Array.isArray(cr))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=pr.map((sr,ra)=>({choice_text:sr,is_answer:cr.includes(ra)?1:0}));return{name:_i,choices:Tr,analysis:Dr}},Cr=()=>{Hr(["","","",""]),Ci(""),ko(""),yr("")};return ue.createElement("section",{className:lt.wrap},ue.createElement("p",{className:lt.titleWrap},ue.createElement("span",{className:lt.required},"*"),ue.createElement("span",{className:lt.title},"\u9898\u5E72\uFF1A")),ue.createElement(ii.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:_i,onChange:Nr=>Ci(Nr)}),ue.createElement("p",{className:lt.titleWrap},ue.createElement("span",{className:lt.required},"*"),ue.createElement("span",{className:lt.title},"\u7B54\u6848\u9009\u9879\uFF1A",ue.createElement("span",{className:lt.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),pr.map((Nr,Tr)=>ue.createElement("div",{className:lt.choiceWrap,key:Tr},ue.createElement(yt.Z,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},ue.createElement("div",{className:`${lt.answer} ${cr!=null&&cr.includes(Tr)?lt.activeAnswer:""}`,onClick:()=>yr([Tr])},ci[Tr])),ue.createElement("div",{className:lt.editorWrap},no===Tr?ue.createElement(ii.Z,{id:`single-question-option-${Tr}`,watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Nr,onChange:sr=>{pr[Tr]=sr,Hr(pr)}}):ue.createElement("div",{className:lt.htmlWrap,onClick:()=>lr(Tr)},ue.createElement(Re.Z,{value:Nr}))),Tr>1&&ue.createElement(yt.Z,{title:"\u5220\u9664"},ue.createElement("i",{className:`${lt.deleteIcon} iconfont icon-htmal5icon19`,onClick:()=>{Hr(pr.filter((sr,ra)=>ra!==Tr)),Tr===cr&&yr(null)}})),Tr<7&&Tr===pr.length-1&&ue.createElement(yt.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},ue.createElement("i",{className:`${lt.addIcon} iconfont icon-roundaddfill ml6`,onClick:()=>Hr([...pr,""])})))),ue.createElement("p",{className:lt.titleWrap},ue.createElement("span",{className:lt.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),ue.createElement(ii.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Dr,onChange:Nr=>ko(Nr)}))};var _r=(0,rt.connect)(({loading:Mt,globalSetting:Pt})=>({globalSetting:Pt,loading:Mt.effects}),null,null,{forwardRef:!0})((0,ue.forwardRef)(ar)),$r=Le(96599),po=Le(71411),fi=Le(61485),Qn=Le(59301),Bt=Object.defineProperty,Tt=Object.defineProperties,kt=Object.getOwnPropertyDescriptors,ui=Object.getOwnPropertySymbols,Yn=Object.prototype.hasOwnProperty,vi=Object.prototype.propertyIsEnumerable,yn=(Mt,Pt,ln)=>Pt in Mt?Bt(Mt,Pt,{enumerable:!0,configurable:!0,writable:!0,value:ln}):Mt[Pt]=ln,Kn=(Mt,Pt)=>{for(var ln in Pt||(Pt={}))Yn.call(Pt,ln)&&yn(Mt,ln,Pt[ln]);if(ui)for(var ln of ui(Pt))vi.call(Pt,ln)&&yn(Mt,ln,Pt[ln]);return Mt},It=(Mt,Pt)=>Tt(Mt,kt(Pt)),_t=(Mt,Pt)=>{var ln={};for(var He in Mt)Yn.call(Mt,He)&&Pt.indexOf(He)<0&&(ln[He]=Mt[He]);if(Mt!=null&&ui)for(var He of ui(Mt))Pt.indexOf(He)<0&&vi.call(Mt,He)&&(ln[He]=Mt[He]);return ln},hi=(Mt,Pt,ln)=>new Promise((He,Dt)=>{var Xi=$i=>{try{Qi(ln.next($i))}catch(wi){Dt(wi)}},Mr=$i=>{try{Qi(ln.throw($i))}catch(wi){Dt(wi)}},Qi=$i=>$i.done?He($i.value):Promise.resolve($i.value).then(Xi,Mr);Qi((ln=ln.apply(Mt,Pt)).next())});const it=Mt=>{if(!Mt)return!1;if(/^s*$/.test(Mt)||Mt.trim()===""){Ct.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u5168\u4E3A\u7A7A\u683C");return}let Pt=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 Mt==="|"?(Ct.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},sn=({value:Mt=[],onClose:Pt})=>Qn.createElement($r.default,{closable:!0,onClose:Pt,className:lt.keywordTag},Qn.createElement("pre",{style:{margin:"0px",whiteSpace:"pre-wrap"}},Mt.join(" \u6216 "))),Dn=(Mt,Pt)=>{var ln=Mt,{editData:He,globalSetting:Dt,loading:Xi,dispatch:Mr,onRef:Qi=()=>{},isEdit:$i}=ln,wi=_t(ln,["editData","globalSetting","loading","dispatch","onRef","isEdit"]);const[pr,Hr]=(0,ue.useState)(""),[no,lr]=(0,ue.useState)(""),[cr,yr]=(0,ue.useState)(""),[_i,Ci]=(0,ue.useState)(""),[Dr]=ft.default.useForm(),ko=ft.default.useWatch("use_keywords",Dr);(0,ue.useEffect)(()=>{var Tr;!He||!$i||(Hr(He==null?void 0:He.name),lr(He==null?void 0:He.analysis),yr((Tr=He==null?void 0:He.answer_texts)==null?void 0:Tr[0]),Dr.setFieldsValue(Kn({},He)))},[He]),(0,ue.useImperativeHandle)(Pt,()=>({onSave:br,Clear:Cr}));const br=()=>hi(void 0,null,function*(){if(!pr)return Ct.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;try{yield Dr.validateFields()}catch(sr){Ct.ZP.error(sr.errorFields[0].errors[0]);return}const Tr=Dr.getFieldsValue();return console.log(Tr,"values"),Kn({name:pr,answer_texts:[cr],analysis:no},Tr)}),Cr=()=>{Hr(""),lr(""),yr(""),Dr.resetFields()},Nr=He==null?void 0:He.score;return Qn.createElement("section",{className:lt.wrap},Qn.createElement("p",{className:lt.titleWrap},Qn.createElement("span",{className:lt.required},"*"),Qn.createElement("span",{className:lt.title},"\u9898\u5E72\uFF1A")),Qn.createElement(ii.Z,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:pr,onChange:Tr=>Hr(Tr)}),Qn.createElement("p",{className:lt.titleWrap},Qn.createElement("span",{className:lt.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),Qn.createElement(ii.Z,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:cr,onChange:Tr=>yr(Tr)}),Qn.createElement("p",{className:lt.titleWrap},Qn.createElement("span",{className:lt.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),Qn.createElement(ii.Z,{id:"single-question-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:no,onChange:Tr=>lr(Tr)}),Qn.createElement(ft.default,{form:Dr,size:"large",onFinishFailed:Tr=>hi(void 0,null,function*(){var sr,ra;Ct.ZP.error(Tr.errorFields[0].errors[0]),Dr.scrollToField((ra=(sr=Tr==null?void 0:Tr.errorFields)==null?void 0:sr[0])==null?void 0:ra.name,{behavior:"smooth",block:"center"})})},Qn.createElement(ot.Z,{align:"middle",className:"mb30 mt20"},Qn.createElement(ft.default.Item,{noStyle:!0,name:"use_keywords",valuePropName:"checked"},Qn.createElement(po.Z,null)),Qn.createElement(At.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),Qn.createElement(At.Z,null,Qn.createElement(yt.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"},Qn.createElement(fi.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),ko&&Qn.createElement(ft.default.List,{name:"keywords",rules:[{validator(Tr,sr){return sr!=null&&sr.length?(sr==null?void 0:sr.reduce((Bo,ta)=>Bo+ta.score,0))>parseFloat(Nr)?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:sr,remove:ra})=>Qn.createElement(Qn.Fragment,null,Qn.createElement("div",{className:"mb10"},"\u5173\u952E\u8BCD"),Qn.createElement(ot.Z,{align:"middle",className:"font14 mb30"},Qn.createElement(At.Z,{flex:1},Qn.createElement(dt.default,{value:_i,onChange:Bo=>{Ci(Bo.target.value)},maxLength:50,allowClear:!0,onPressEnter:Bo=>{var ta,Sa,ro,ha;const As=`${(ta=Bo.target)==null?void 0:ta.value}`,kr=(ro=(Sa=As==null?void 0:As.split("|"))==null?void 0:Sa.filter(ts=>!!ts))==null?void 0:ro.map(ts=>ts==null?void 0:ts.trim()),$a=Dr.getFieldValue("keywords"),Eo=((ha=$a==null?void 0:$a.map(ts=>ts==null?void 0:ts.keyword))==null?void 0:ha.flat())||[];for(const ts of kr)if(Eo.includes(ts)){Ct.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}it(As)&&(sr({keyword:kr,score:1}),Ci(""))},className:lt.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"})),Qn.createElement(At.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),Tr.map(Bo=>{var ta=Bo,{key:Sa,name:ro}=ta,ha=_t(ta,["key","name"]);return Qn.createElement(ot.Z,{key:Sa,style:{marginRight:148}},Qn.createElement(At.Z,{flex:1},Qn.createElement(ot.Z,{align:"middle",justify:"space-between"},Qn.createElement(ft.default.Item,It(Kn({},ha),{name:[ro,"keyword"]}),Qn.createElement(sn,{onClose:()=>ra(ro)})),Qn.createElement(ft.default.Item,It(Kn({},ha),{name:[ro,"score"],label:"\u5206\u503C",rules:[{required:!0}]}),Qn.createElement(at.Z,{min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))})))))};var Di=(0,rt.connect)(({loading:Mt,globalSetting:Pt})=>({globalSetting:Pt,loading:Mt.effects}),null,null,{forwardRef:!0})((0,ue.forwardRef)(Dn)),cn=Le(8848),qt={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"},an=Le(32134),Gi=Le(12893),ur=Object.defineProperty,Hi=Object.defineProperties,Mi=Object.getOwnPropertyDescriptors,Ri=Object.getOwnPropertySymbols,dr=Object.prototype.hasOwnProperty,Er=Object.prototype.propertyIsEnumerable,Ar=(Mt,Pt,ln)=>Pt in Mt?ur(Mt,Pt,{enumerable:!0,configurable:!0,writable:!0,value:ln}):Mt[Pt]=ln,wn=(Mt,Pt)=>{for(var ln in Pt||(Pt={}))dr.call(Pt,ln)&&Ar(Mt,ln,Pt[ln]);if(Ri)for(var ln of Ri(Pt))Er.call(Pt,ln)&&Ar(Mt,ln,Pt[ln]);return Mt},Yo=(Mt,Pt)=>Hi(Mt,Mi(Pt)),zr=(Mt,Pt)=>{var ln={};for(var He in Mt)dr.call(Mt,He)&&Pt.indexOf(He)<0&&(ln[He]=Mt[He]);if(Mt!=null&&Ri)for(var He of Ri(Mt))Pt.indexOf(He)<0&&Er.call(Mt,He)&&(ln[He]=Mt[He]);return ln};const mo=Mt=>{var Pt=Mt,{value:ln,onChange:He,scrollId:Dt}=Pt,Xi=zr(Pt,["value","onChange","scrollId"]);return ue.createElement("div",{id:Dt||""},ue.createElement(ii.Z,Yo(wn({},Xi),{defaultValue:ln,onChange:(Mr,Qi)=>{Qi!=null&&Qi.length?He(Mr,Qi):He(Mr)}})))},en=({value:Mt,onChange:Pt,placeholder:ln,height:He=140,isEdit:Dt})=>Dt?ue.createElement(ii.Z,{watch:!0,isFocus:!0,height:He,placeholder:ln,defaultValue:Mt,onChange:Pt}):ue.createElement("div",{style:{cursor:"pointer"}},Mt?ue.createElement(Re.Z,{className:qt.inputBorder,value:Mt}):ue.createElement("div",{className:`${qt.inputBorder} ${qt.placeholder}`},ln));var li=Le(59301),nr=Object.defineProperty,Sr=Object.defineProperties,vr=Object.getOwnPropertyDescriptors,Ir=Object.getOwnPropertySymbols,bo=Object.prototype.hasOwnProperty,fo=Object.prototype.propertyIsEnumerable,so=(Mt,Pt,ln)=>Pt in Mt?nr(Mt,Pt,{enumerable:!0,configurable:!0,writable:!0,value:ln}):Mt[Pt]=ln,lo=(Mt,Pt)=>{for(var ln in Pt||(Pt={}))bo.call(Pt,ln)&&so(Mt,ln,Pt[ln]);if(Ir)for(var ln of Ir(Pt))fo.call(Pt,ln)&&so(Mt,ln,Pt[ln]);return Mt},Tn=(Mt,Pt)=>Sr(Mt,vr(Pt)),qo=(Mt,Pt)=>{var ln={};for(var He in Mt)bo.call(Mt,He)&&Pt.indexOf(He)<0&&(ln[He]=Mt[He]);if(Mt!=null&&Ir)for(var He of Ir(Mt))Pt.indexOf(He)<0&&fo.call(Mt,He)&&(ln[He]=Mt[He]);return ln};const Zn=["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"],wr=({value:Mt,onChange:Pt,choiceTextKey:ln,answerKey:He,index:Dt,isEdit:Xi,setInputActive:Mr,form:Qi,choiceOptionsPath:$i,allowChangeMode:wi,showAddIcon:pr,addItem:Hr,deleteItem:no})=>{const lr=(Mt==null?void 0:Mt[He])===!0,cr=()=>{const _i=Qi.getFieldValue($i);Qi.setFieldValue($i,_i.map(Ci=>Tn(lo({},Ci),{[He]:!1})))},yr=()=>{lr?Pt(Tn(lo({},Mt),{[He]:!1})):(wi||cr(),Pt(Tn(lo({},Mt),{[He]:!0})))};return li.createElement(ot.Z,{className:qt.choiceWrap,align:"middle",wrap:!1},li.createElement(At.Z,{onClick:yr,className:`${qt.choiceIndex} ${lr?qt.activeAnswer:""}`},Zn[Dt]),li.createElement(At.Z,{flex:1,className:`${qt.editorWrap} ml15`,onClick:Mr},li.createElement(en,{height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",isEdit:Xi,value:Mt==null?void 0:Mt[ln],onChange:_i=>{Pt(Tn(lo({},Mt),{[ln]:_i}))}})),li.createElement(At.Z,{flex:"0 0 auto",className:"ml15"},li.createElement("div",{onClick:yr,className:`${qt.setAnswerBtn} ${lr?qt.activeAnswer:""}`},lr?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")),li.createElement(At.Z,{className:qt.actionWrapper},li.createElement(yt.Z,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},li.createElement(an.Z,{className:qt.addIcon,onClick:Hr,style:{visibility:pr?"visible":"hidden"}})),li.createElement(yt.Z,{title:"\u5220\u9664"},li.createElement(Gi.Z,{className:qt.deleteIcon,onClick:no,style:{visibility:Dt>1?"visible":"hidden"}}))))},Or=({questionTitlePlaceholder:Mt,titleKey:Pt,choiceKey:ln,analysisKey:He,choiceTextKey:Dt,answerKey:Xi,choiceOptionsPath:Mr,allowChangeMode:Qi=!0,form:$i,showAnalysis:wi=!0})=>{const[pr,Hr]=(0,ue.useState)(),[no,lr]=(0,ue.useState)(!1);return li.createElement("div",{className:qt.wrap},li.createElement("div",{className:qt.questionTitleEditorWrap},li.createElement(ft.default.Item,{label:"\u9898\u5E72",name:Pt,labelCol:{span:24},rules:[{required:!0}]},li.createElement(mo,{scrollId:Array.isArray(Pt)?Pt.join("_"):`${Pt}`,watch:!0,height:140,placeholder:Mt}))),li.createElement(ft.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}}),li.createElement(ft.default.List,{name:ln,rules:[{validator(cr,yr){const _i=yr.some(Dr=>Dr[Xi]),Ci=yr.findIndex(Dr=>{var ko;return((ko=Dr[Dt])==null?void 0:ko.length)<=0});return Ci!==-1?Promise.reject(new Error(`\u8BF7\u5148\u8F93\u5165${Zn[Ci]}\u9009\u9879\u7684\u5185\u5BB9`)):_i?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},(cr,{add:yr,remove:_i})=>li.createElement("div",{id:Array.isArray(Mr)?Mr.join("_"):`${Mr}`},cr.map((Ci,Dr)=>{var ko=Ci,{key:br,name:Cr}=ko,Nr=qo(ko,["key","name"]);const Tr=pr===br,sr=()=>{Hr(br)},ra=Dr<7&&Dr===cr.length-1,Bo=()=>yr({[Dt]:"",[Xi]:0}),ta=()=>_i(Cr);return li.createElement(ft.default.Item,Tn(lo({},Nr),{key:br,name:Cr,noStyle:!0}),li.createElement(wr,{choiceTextKey:Dt,answerKey:Xi,index:Dr,isEdit:Tr,setInputActive:sr,form:$i,choiceOptionsPath:Mr,allowChangeMode:Qi,showAddIcon:ra,addItem:Bo,deleteItem:ta}))}),cr.length<8&&li.createElement("div",{className:`${qt.addBtn} mb30`,onClick:()=>yr({[Dt]:"",[Xi]:0})},"\u6DFB\u52A0\u9009\u9879"))),wi&&li.createElement("div",{onClick:()=>lr(!0)},li.createElement(ft.default.Item,{name:He,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},li.createElement(en,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:no}))))};var hr=Le(59301),la=Object.defineProperty,ca=Object.defineProperties,Qo=Object.getOwnPropertyDescriptors,zo=Object.getOwnPropertySymbols,Vt=Object.prototype.hasOwnProperty,On=Object.prototype.propertyIsEnumerable,Ut=(Mt,Pt,ln)=>Pt in Mt?la(Mt,Pt,{enumerable:!0,configurable:!0,writable:!0,value:ln}):Mt[Pt]=ln,_e=(Mt,Pt)=>{for(var ln in Pt||(Pt={}))Vt.call(Pt,ln)&&Ut(Mt,ln,Pt[ln]);if(zo)for(var ln of zo(Pt))On.call(Pt,ln)&&Ut(Mt,ln,Pt[ln]);return Mt},pi=(Mt,Pt)=>ca(Mt,Qo(Pt)),Vn=(Mt,Pt)=>{var ln={};for(var He in Mt)Vt.call(Mt,He)&&Pt.indexOf(He)<0&&(ln[He]=Mt[He]);if(Mt!=null&&zo)for(var He of zo(Mt))Pt.indexOf(He)<0&&On.call(Mt,He)&&(ln[He]=Mt[He]);return ln};const qn=({value:Mt,onChange:Pt})=>{const ln=Dt=>{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:qt.modal,onOk:()=>{const Xi=[...Mt];Xi.splice(Dt,1),Pt(Xi)}})},He=()=>{const Dt=[...Mt];Dt.push(""),Pt(Dt)};return hr.createElement(ot.Z,{align:"middle",className:"ml20",gutter:[40,20]},Mt==null?void 0:Mt.map((Dt,Xi)=>hr.createElement(At.Z,{key:`${Dt}_${Xi}`,className:qt.blankWrapper},hr.createElement(dt.default,{className:qt.blankInput,defaultValue:Dt,maxLength:1e3,onBlur:Mr=>{const Qi=[...Mt],$i=Mr.target.value.trim();Qi[Xi]=$i,Pt(Qi)}}),hr.createElement(yt.Z,{title:"\u5220\u9664"},hr.createElement(Gi.Z,{className:qt.deleteIcon,style:{marginLeft:15,visibility:Xi>0?"visible":"hidden"},onClick:()=>ln(Xi)})))),hr.createElement(At.Z,null,hr.createElement("div",{className:`${qt.addBtn}`,onClick:()=>{He()}},"\u65B0\u589E\u7B54\u6848")))},ki=({value:Mt=!0,onChange:Pt})=>hr.createElement(po.Z,{checked:!Mt,onChange:ln=>{Pt(!ln)}}),Wi="\u2581",Wn=({questionTitlePlaceholder:Mt,form:Pt,name:ln,scoreByBlank:He="use_blank_score",answerKey:Dt,titleKey:Xi="name",analysisKey:Mr="analysis",isOrdered:Qi="is_ordered"})=>{var $i,wi;const[pr,Hr]=(0,ue.useState)(!1),no=(br,Cr)=>{const Nr=Cr.line;let Tr=0;for(let ra=0;ra<Nr;ra++)Tr+=br.getLine(ra).split(Wi).length-1;const sr=br.getLine(Nr).substring(0,Cr.ch);return Tr+=sr.split(Wi).length-1,Tr},lr=(br,Cr,Nr,Tr)=>{const sr=br.getRange(Cr.from,Cr.to);let ra=0;if(Cr.text.forEach(Bo=>{ra+=Bo.split(Wi).length-1}),Cr.origin!=="setValue"){if(sr&&sr.indexOf(Wi)!==-1){const Bo=sr.split(Wi).length-1,ta=no(br,Cr.from);if(console.log(`\u5220\u9664${Bo}\u4E2A\uFF0C \u524D\u9762\u6709${ta}\u4E2A\uFF0C\u65B0\u589E${ra}\u4E2A`),Bo>1){const Sa=Array.from({length:Bo},(ro,ha)=>ta+ha);Tr(Sa)}else Tr(ta)}else if(ra>0){const Bo=no(br,Cr.from);console.log(`\u65B0\u589E${ra}\u4E2A\uFF0C\u4E4B\u524D\u6709${Bo}\u4E2A`),Nr(ra,Bo)}}},cr=()=>{const br=Pt.getFieldValue(["sub_item_banks",...Dt]);Pt.setFieldValue(["sub_item_banks",...Dt],br==null?void 0:br.map((Cr,Nr)=>pi(_e({},Cr),{position:Nr+1})))},yr=(0,ue.useRef)(),_i=(br,Cr)=>{for(let Nr=0;Nr<br;Nr++)yr.current({position:null,answer_text:[""]},Cr+Nr);cr()},Ci=(0,ue.useRef)(),Dr=br=>{Ci.current(br),cr()},ko=(wi=($i=Pt.getFieldValue("sub_item_banks"))==null?void 0:$i[Dt==null?void 0:Dt[0]])==null?void 0:wi[Dt==null?void 0:Dt[1]];return hr.createElement("div",{className:qt.wrap},hr.createElement("div",{className:qt.questionTitleEditorWrap},hr.createElement(ft.default.Item,{label:"\u9898\u5E72",name:Xi,labelCol:{span:24},rules:[{required:!0}]},hr.createElement(mo,{scrollId:"name",watch:!0,height:140,placeholder:Mt,showNullButton:!0,onCMBeforeChange:(br,Cr)=>{lr(br,Cr,_i,Dr)}}))),hr.createElement(ft.default.List,{name:Dt,rules:[{validator(br,Cr){if((Cr==null?void 0:Cr.length)===0)return Promise.reject(new Error("\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"));for(const Nr of Cr){const{answer_text:Tr}=Nr||{};if(Tr!=null&&Tr.some(sr=>(sr==null?void 0:sr.length)===0))return Promise.reject(new Error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"))}return Promise.resolve()}}]},(br,{add:Cr,remove:Nr},{errors:Tr})=>(yr.current=Cr,Ci.current=Nr,hr.createElement(hr.Fragment,null,hr.createElement(ft.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}}),br.map((sr,ra)=>{var Bo=sr,{key:ta,name:Sa}=Bo,ro=Vn(Bo,["key","name"]);return hr.createElement(ot.Z,{className:"mb20",key:ta,align:"middle",wrap:!1},hr.createElement(At.Z,{flex:"0 0 auto",className:`${qt.blankIndex}`},"\u586B\u7A7A\u9879",ra+1),hr.createElement(At.Z,{flex:1},hr.createElement(ot.Z,{align:"top",justify:"space-between",wrap:!1},hr.createElement(At.Z,null,hr.createElement(ft.default.Item,pi(_e({},ro),{name:[Sa,"answer_text"],noStyle:!0}),hr.createElement(qn,null))),(Pt==null?void 0:Pt.getFieldValue(["sub_item_banks",...He]))&&hr.createElement(At.Z,{flex:"224px"},hr.createElement(ft.default.Item,pi(_e({},ro),{name:[Sa,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:qt.blankInputNumberWrapper}),hr.createElement(at.Z,{className:qt.blankInput,min:.1,max:100,style:{width:"100%"},placeholder:"\u6309\u7A7A\u7ED9\u5206\u8BF7\u8F93\u5165\u5206\u503C"})))),hr.createElement(ft.default.Item,pi(_e({},ro),{name:[Sa,"position"],noStyle:!0}),hr.createElement(dt.default,{type:"hidden"}))))})))),hr.createElement(ot.Z,{align:"middle"},hr.createElement(ft.default.Item,{name:[ln,"downcase"],valuePropName:"checked"},hr.createElement(po.Z,null)),hr.createElement(At.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u5B57\u6BCD\u5927\u5C0F\u5199")),hr.createElement(ot.Z,{align:"middle"},hr.createElement(ft.default.Item,{name:[ln,"no_space"],valuePropName:"checked"},hr.createElement(po.Z,null)),hr.createElement(At.Z,{className:"ml10"},"\u5224\u5206\u65F6\u5FFD\u7565\u7B54\u6848\u4E2D\u7684\u7A7A\u683C")),(ko==null?void 0:ko.length)>1&&hr.createElement(ot.Z,{align:"middle",className:(ko==null?void 0:ko.length)>1?"mb30":`${qt.hide}`},hr.createElement(ft.default.Item,{name:Qi},hr.createElement(ki,null)),hr.createElement(At.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")),hr.createElement("div",{onClick:()=>Hr(!0)},hr.createElement(ft.default.Item,{name:Mr,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},hr.createElement(en,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:pr}))))};var mi=Object.defineProperty,Si=Object.defineProperties,Ei=Object.getOwnPropertyDescriptors,bi=Object.getOwnPropertySymbols,gr=Object.prototype.hasOwnProperty,qi=Object.prototype.propertyIsEnumerable,Ui=(Mt,Pt,ln)=>Pt in Mt?mi(Mt,Pt,{enumerable:!0,configurable:!0,writable:!0,value:ln}):Mt[Pt]=ln,bn=(Mt,Pt)=>{for(var ln in Pt||(Pt={}))gr.call(Pt,ln)&&Ui(Mt,ln,Pt[ln]);if(bi)for(var ln of bi(Pt))qi.call(Pt,ln)&&Ui(Mt,ln,Pt[ln]);return Mt},Yi=(Mt,Pt)=>Si(Mt,Ei(Pt)),rr=(Mt,Pt)=>{var ln={};for(var He in Mt)gr.call(Mt,He)&&Pt.indexOf(He)<0&&(ln[He]=Mt[He]);if(Mt!=null&&bi)for(var He of bi(Mt))Pt.indexOf(He)<0&&qi.call(Mt,He)&&(ln[He]=Mt[He]);return ln};const Po={\u6B63\u786E:"T",\u9519\u8BEF:"F"},uo=({value:Mt,onChange:Pt,form:ln,choiceKey:He})=>{const Dt=(Mt==null?void 0:Mt.is_answer)===!0,Xi=Mt==null?void 0:Mt.choice_text,Mr=()=>{var Qi;const $i=(Qi=ln==null?void 0:ln.getFieldValue(["sub_item_banks",...He]))==null?void 0:Qi.map(wi=>({choice_text:wi==null?void 0:wi.choice_text,is_answer:!1}));ln==null||ln.setFieldValue(["sub_item_banks",...He],$i),Pt(Yi(bn({},Mt),{is_answer:!0}))};return ue.createElement(ot.Z,{className:qt.choiceWrap,align:"middle",wrap:!1},ue.createElement(At.Z,{onClick:Mr,className:`${qt.choiceIndex} ${qt.judgementIndex} ${Dt?qt.activeAnswer:""}`},Po[Xi]),ue.createElement(At.Z,{flex:1,className:`${qt.editorWrap} ml15`},ue.createElement("div",{className:`${qt.inputBorder} ${qt.placeholder} ${Dt?qt.activeJudgementAnswer:""}`},Xi)),ue.createElement(At.Z,{flex:"0 0 auto",className:"ml15"},ue.createElement("div",{onClick:Mr,className:`${qt.setAnswerBtn} ${Dt?qt.activeAnswer:""}`},Dt?"\u6B63\u786E\u7B54\u6848":"\u8BBE\u4E3A\u7B54\u6848")))},No=({questionTitlePlaceholder:Mt,choiceKey:Pt="choices",form:ln,titleKey:He="name",analysisKey:Dt="analysis"})=>{const[Xi,Mr]=(0,ue.useState)(!1);return ue.createElement("div",{className:qt.wrap},ue.createElement("div",{className:qt.questionTitleEditorWrap},ue.createElement(ft.default.Item,{label:"\u9898\u5E72",name:He,labelCol:{span:24},rules:[{required:!0}]},ue.createElement(mo,{scrollId:"name",watch:!0,height:140,placeholder:Mt}))),ue.createElement(ft.default.Item,{label:"\u7B54\u6848\u9009\u9879",required:!0,labelCol:{span:24}},ue.createElement(ft.default.List,{name:Pt,rules:[{validator(Qi,$i){return $i.some(pr=>(pr==null?void 0:pr.is_answer)===!0)?Promise.resolve():Promise.reject(new Error("\u8BF7\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))}}]},Qi=>ue.createElement("div",{id:"choices"},Qi.map($i=>{var wi=$i,{key:pr,name:Hr}=wi,no=rr(wi,["key","name"]);return ue.createElement(ft.default.Item,Yi(bn({},no),{key:pr,name:Hr,noStyle:!0}),ue.createElement(uo,{form:ln,choiceKey:Pt}))})))),ue.createElement("div",{onClick:()=>Mr(!0)},ue.createElement(ft.default.Item,{name:Dt,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},ue.createElement(en,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:Xi}))))};var Do=Object.defineProperty,Io=Object.defineProperties,fa=Object.getOwnPropertyDescriptors,na=Object.getOwnPropertySymbols,za=Object.prototype.hasOwnProperty,zt=Object.prototype.propertyIsEnumerable,To=(Mt,Pt,ln)=>Pt in Mt?Do(Mt,Pt,{enumerable:!0,configurable:!0,writable:!0,value:ln}):Mt[Pt]=ln,Pr=(Mt,Pt)=>{for(var ln in Pt||(Pt={}))za.call(Pt,ln)&&To(Mt,ln,Pt[ln]);if(na)for(var ln of na(Pt))zt.call(Pt,ln)&&To(Mt,ln,Pt[ln]);return Mt},eo=(Mt,Pt)=>Io(Mt,fa(Pt)),Zo=(Mt,Pt)=>{var ln={};for(var He in Mt)za.call(Mt,He)&&Pt.indexOf(He)<0&&(ln[He]=Mt[He]);if(Mt!=null&&na)for(var He of na(Mt))Pt.indexOf(He)<0&&zt.call(Mt,He)&&(ln[He]=Mt[He]);return ln};const Wr=Mt=>{var Pt=Mt,{value:ln,onChange:He}=Pt,Dt=Zo(Pt,["value","onChange"]);const Xi=Mr=>{He([Mr])};return ue.createElement(ii.Z,eo(Pr({},Dt),{defaultValue:ln==null?void 0:ln[0],onChange:Xi}))},ba=Mt=>{if(!Mt)return!1;let Pt=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 Mt==="|"?(Ct.ZP.warning("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0},ga=({value:Mt=[],onClose:Pt})=>ue.createElement($r.default,{closable:!0,onClose:Pt,className:qt.keywordTag},Mt==null?void 0:Mt.join(" \u6216 ")),Uo=({questionTitlePlaceholder:Mt,form:Pt,showKeywords:ln,isMustKeyWords:He=ln,titleKey:Dt="name",analysisKey:Xi="analysis",answerTexts:Mr="answer_texts",keywords:Qi="keywords",useKeywords:$i="use_keywords",indexs:wi})=>{const[pr,Hr]=(0,ue.useState)(!1),[no,lr]=(0,ue.useState)(""),cr=ft.default.useWatch("sub_item_banks",Pt),{use_keywords:yr,score:_i}=(cr==null?void 0:cr[wi])||{};return console.log(yr,_i,"itemValues"),ue.createElement("div",{className:qt.wrap},ue.createElement("div",{className:qt.questionTitleEditorWrap},ue.createElement(ft.default.Item,{label:"\u9898\u5E72",name:Dt,labelCol:{span:24},rules:[{required:!0}]},ue.createElement(mo,{scrollId:"name",watch:!0,height:140,placeholder:Mt}))),ue.createElement(ft.default.Item,{label:"\u53C2\u8003\u7B54\u6848",name:Mr,labelCol:{span:24}},ue.createElement(Wr,{watch:!0,height:140,placeholder:"\u8BF7\u7F16\u8F91\u53C2\u8003\u7B54\u6848\uFF08\u975E\u5FC5\u586B\uFF09"})),ln&&!He&&ue.createElement(ft.default.Item,{hidden:!0,name:$i,valuePropName:"checked"},ue.createElement(po.Z,{defaultChecked:!0})),ln&&He&&ue.createElement(ot.Z,{align:"middle",className:"mb30"},ue.createElement(ft.default.Item,{name:$i,valuePropName:"checked"},ue.createElement(po.Z,null)),ue.createElement(At.Z,{className:"ml10"},"\u5F00\u542F\u5173\u952E\u8BCD\u81EA\u52A8\u5224\u5206"),ue.createElement(At.Z,null,ue.createElement(yt.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"},ue.createElement(fi.Z,{style:{color:"#3061D0",marginLeft:6,cursor:"pointer"}})))),(yr||!He)&&ue.createElement(ft.default.List,{name:Qi,rules:[{validator(Ci,Dr){return He?Dr!=null&&Dr.length?(Dr==null?void 0:Dr.reduce((br,Cr)=>br+Cr.score,0))>parseFloat(_i)?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()}}]},(Ci,{add:Dr,remove:ko})=>ue.createElement(ue.Fragment,null,ue.createElement("div",{className:`${qt.title} mb10`},He?"\u5173\u952E\u8BCD":ue.createElement("span",{style:{color:"#9096A3"}},"\u5224\u5206\u5173\u952E\u8BCD")),ue.createElement(ot.Z,{align:"middle",className:"font14 mb30"},ue.createElement(At.Z,{flex:1},ue.createElement(dt.default,{value:no,onChange:br=>{lr(br.target.value)},maxLength:50,allowClear:!0,onPressEnter:br=>{var Cr,Nr,Tr,sr;const ra=`${(Cr=br.target)==null?void 0:Cr.value}`,Bo=(Tr=(Nr=ra==null?void 0:ra.split("|"))==null?void 0:Nr.filter(ro=>!!ro))==null?void 0:Tr.map(ro=>ro==null?void 0:ro.trim()),ta=Pt.getFieldValue(["sub_item_banks",...Qi]),Sa=((sr=ta==null?void 0:ta.map(ro=>ro==null?void 0:ro.keyword))==null?void 0:sr.flat())||[];for(const ro of Bo)if(Sa.includes(ro)){Ct.ZP.error("\u4E3A\u907F\u514D\u5224\u5206\u9519\u8BEF\uFF0C\u8BF7\u52FF\u8BBE\u7F6E\u76F8\u540C\u7684\u5173\u952E\u8BCD");return}ba(ra)&&(Dr({keyword:Bo,score:1}),lr(""))},className:qt.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"})),ue.createElement(At.Z,{flex:"148px",style:{textAlign:"right",color:"#e99237"}},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),Ci.map(br=>{var Cr=br,{key:Nr,name:Tr}=Cr,sr=Zo(Cr,["key","name"]);return ue.createElement(ot.Z,{key:Nr,className:"mb20",style:{marginRight:148}},ue.createElement(At.Z,{flex:1},ue.createElement(ot.Z,{align:"middle",justify:"space-between"},ue.createElement(ft.default.Item,eo(Pr({},sr),{name:[Tr,"keyword"]}),ue.createElement(ga,{onClose:()=>ko(Tr)})),He&&ue.createElement(ft.default.Item,eo(Pr({},sr),{name:[Tr,"score"],label:"\u5206\u503C",rules:[{required:!0}],className:qt.blankInputNumberWrapper}),ue.createElement(at.Z,{className:qt.blankInput,min:.1,max:100,precision:1,style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u5206\u6570"})))))}))),ue.createElement("div",{onClick:()=>Hr(!0)},ue.createElement(ft.default.Item,{name:Xi,label:"\u9898\u76EE\u89E3\u6790",labelCol:{span:24}},ue.createElement(en,{placeholder:"\u8BF7\u7F16\u8F91\u9898\u76EE\u89E3\u6790\uFF08\u975E\u5FC5\u586B\uFF09",isEdit:pr}))))};var Fo=Le(59301),vs=Object.defineProperty,Qa=Object.defineProperties,ns=Object.getOwnPropertyDescriptors,ds=Object.getOwnPropertySymbols,Vr=Object.prototype.hasOwnProperty,wa=Object.prototype.propertyIsEnumerable,Ba=(Mt,Pt,ln)=>Pt in Mt?vs(Mt,Pt,{enumerable:!0,configurable:!0,writable:!0,value:ln}):Mt[Pt]=ln,is=(Mt,Pt)=>{for(var ln in Pt||(Pt={}))Vr.call(Pt,ln)&&Ba(Mt,ln,Pt[ln]);if(ds)for(var ln of ds(Pt))wa.call(Pt,ln)&&Ba(Mt,ln,Pt[ln]);return Mt},Vo=(Mt,Pt)=>Qa(Mt,ns(Pt)),Ko=(Mt,Pt)=>{var ln={};for(var He in Mt)Vr.call(Mt,He)&&Pt.indexOf(He)<0&&(ln[He]=Mt[He]);if(Mt!=null&&ds)for(var He of ds(Mt))Pt.indexOf(He)<0&&wa.call(Mt,He)&&(ln[He]=Mt[He]);return ln},ni=(Mt,Pt,ln)=>new Promise((He,Dt)=>{var Xi=$i=>{try{Qi(ln.next($i))}catch(wi){Dt(wi)}},Mr=$i=>{try{Qi(ln.throw($i))}catch(wi){Dt(wi)}},Qi=$i=>$i.done?He($i.value):Promise.resolve($i.value).then(Xi,Mr);Qi((ln=ln.apply(Mt,Pt)).next())});const{Panel:to}=cn.default,Xo=null,Ia=(Mt,Pt)=>{var ln=Mt,{globalSetting:He,loading:Dt,dispatch:Xi,editData:Mr,onRef:Qi=()=>{},isEdit:$i}=ln,wi=Ko(ln,["globalSetting","loading","dispatch","editData","onRef","isEdit"]);const[pr,Hr]=(0,ue.useState)(""),[no,lr]=(0,ue.useState)([]),[cr]=ft.default.useForm();(0,ue.useEffect)(()=>{!Mr||!$i||(Hr(Mr==null?void 0:Mr.name),lr(Mr==null?void 0:Mr.sub_item_banks),cr.setFieldsValue(is({},Mr)))},[Mr]),(0,ue.useEffect)(()=>{lr(cr.getFieldValue("sub_item_banks"))},[ft.default.useWatch("sub_item_banks",cr)]),(0,ue.useImperativeHandle)(Pt,()=>({onSave:yr,Clear:_i}));const yr=()=>ni(void 0,null,function*(){if(!pr)return Ct.ZP.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),!1;try{yield cr.validateFields()}catch(Nr){return console.log(Nr,"errInfo"),Ct.ZP.error(Nr.errorFields[0].errors[0]),!1}const Cr=no.map(Nr=>is({id:Nr.id>1?Nr.id:null},Nr));return{name:pr,sub_item_banks:Cr}}),_i=()=>{Hr(""),lr([])},Ci={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"},Dr=({value:Cr})=>Fo.createElement("div",{style:{textAlign:"center",color:"#DF3065",margin:"0 5px"}},Cr),[ko,br]=(0,ue.useState)();return Fo.createElement("section",{className:lt.wrap},Fo.createElement("p",{className:lt.titleWrap},Fo.createElement("span",{className:lt.required},"*"),Fo.createElement("span",{className:lt.title},"\u9898\u5E72\uFF1A")),Fo.createElement(ii.Z,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:pr,onChange:Cr=>Hr(Cr)}),Fo.createElement(ft.default,{form:cr,autoComplete:"off"},Fo.createElement(ft.default.List,{name:"sub_item_banks",rules:[{validator(Cr,Nr){return Nr?Promise.resolve():Promise.reject(new Error("\u8BF7\u6DFB\u52A0\u5C0F\u9898"))}}]},(Cr,{add:Nr,remove:Tr})=>{const sr=cr.getFieldValue("sub_item_banks");return Fo.createElement(Fo.Fragment,null,Fo.createElement(cn.default,{className:Cr.length>0?lt.collapseWrapper:"",bordered:!1,expandIcon:({isActive:ra})=>Fo.createElement("i",{className:`iconfont icon-weizhankai ${ra?lt.open:lt.close}`,style:{fontSize:14,transition:"all .2s"}})},Cr.map((ra,Bo)=>{var ta=ra,{key:Sa,name:ro}=ta,ha=Ko(ta,["key","name"]),As,kr,$a,Eo,ts,ys,Ol,ku,mu,Ll,ru,ka;return Fo.createElement(to,{className:lt.panel,forceRender:!0,header:Fo.createElement("div",{className:lt.panelHeader},"\u7B2C",Bo+1,"\u5C0F\u9898",Fo.createElement("span",null,"\uFF08",Ci[(As=sr==null?void 0:sr[ro])==null?void 0:As.item_type],"\uFF09")),extra:Fo.createElement(ot.Z,{align:"middle",onClick:tl=>tl.stopPropagation(),style:{display:"flex",alignItems:"center"}},((kr=sr==null?void 0:sr[ro])==null?void 0:kr.item_type)=="completion"&&Fo.createElement(ft.default.Item,Vo(is({},ha),{name:[ro,"score"],className:lt.blankInputNumberWrapper,style:{marginBottom:0}}),(($a=sr==null?void 0:sr[ro])==null?void 0:$a.item_type)=="completion"&&Fo.createElement("div",{style:{display:"flex",alignItems:"center",color:"#191919"}},"\u5171",Fo.createElement(Dr,{value:(Eo=sr==null?void 0:sr[ro])==null?void 0:Eo.score}),"\u5206")),((ts=sr==null?void 0:sr[ro])==null?void 0:ts.item_type)=="completion"&&Fo.createElement(Fo.Fragment,null,Fo.createElement(jt.ZP.Group,{defaultValue:(ys=sr==null?void 0:sr[ro])==null?void 0:ys.use_blank_score,className:lt.scoreByBlankRadio,style:{marginRight:10},optionType:"button",options:[{label:"\u6309\u7A7A\u7ED9\u5206",value:!0},{label:"\u6309\u9898\u7ED9\u5206",value:!1}],onChange:tl=>{var ou;console.log(cr.getFieldsValue()),cr==null||cr.setFieldValue(["sub_item_banks",ro,"use_blank_score"],(ou=tl==null?void 0:tl.target)==null?void 0:ou.value),br(new Date)}}),Fo.createElement(yt.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:Sa},Fo.createElement(ft.default.Item,Vo(is({},ha),{name:ro}),(((Ol=sr==null?void 0:sr[ro])==null?void 0:Ol.item_type)=="single"||((ku=sr==null?void 0:sr[ro])==null?void 0:ku.item_type)=="multiple")&&Fo.createElement(Or,{questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9009\u62E9\u9898\u9898\u5E72\u5185\u5BB9",allowChangeMode:((mu=sr==null?void 0:sr[ro])==null?void 0:mu.item_type)!="single",form:cr,choiceKey:[ro,"choices"],titleKey:[ro,"name"],analysisKey:[ro,"analysis"],choiceOptionsPath:["sub_item_banks",ro,"choices"],choiceTextKey:"choice_text",answerKey:"is_answer"}),((Ll=sr==null?void 0:sr[ro])==null?void 0:Ll.item_type)=="completion"&&Fo.createElement(Wn,{form:cr,name:ro,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9898\u5E72\u5E76\u8BBE\u7F6E\u586B\u7A7A\u9879",scoreByBlank:[ro,"use_blank_score"],titleKey:[ro,"name"],analysisKey:[ro,"analysis"],isOrdered:[ro,"is_ordered"],answerKey:[ro,"standard_answer"],key:ko}),((ru=sr==null?void 0:sr[ro])==null?void 0:ru.item_type)=="judgement"&&Fo.createElement(No,{form:cr,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u5224\u65AD\u9898\u9898\u5E72\u5185\u5BB9",titleKey:[ro,"name"],analysisKey:[ro,"analysis"],choiceKey:[ro,"choices"]}),((ka=sr==null?void 0:sr[ro])==null?void 0:ka.item_type)=="subjective"&&Fo.createElement(Uo,{showKeywords:!0,form:cr,titleKey:[ro,"name"],analysisKey:[ro,"analysis"],answerTexts:[ro,"answer_texts"],useKeywords:[ro,"use_keywords"],keywords:[ro,"keywords"],indexs:ro,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u7B80\u7B54\u9898\u9898\u5E72\u5185\u5BB9"})))})))})))};var ms=(0,rt.connect)(({loading:Mt,globalSetting:Pt})=>({globalSetting:Pt,loading:Mt.effects}),null,null,{forwardRef:!0})((0,ue.forwardRef)(Ia)),cs=Le(6021),yo=Le(17149),as=Le(82326),ls=Le(54172),Yt={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"},Xt=Le(85057),kn=Le(94860),Zi=Le(92365),yi=Le(83312),Ai=Le(8797),Li=Le(32570),ri=({open:Mt,onCancel:Pt,onOk:ln})=>{const He=(0,kn.g)(),[Dt,Xi,Mr,Qi]=(0,yi.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"}),[$i,wi]=(0,ue.useState)(!1);(0,ue.useEffect)(()=>{Mt&&Mr({page:1,limit:10,type:0},!0).then(cr=>{(cr==null?void 0:cr.shixuns_count)===0&&wi(!0)})},[Mt]);const[pr,Hr]=(0,ue.useState)([]),[no,lr]=(0,ue.useState)([]);return ue.createElement(Oe.default,{title:"\u9009\u62E9\u5B9E\u8BAD\u9898",open:Mt,width:948,centered:!0,closable:!0,onCancel:Pt,onOk:()=>ln(no),destroyOnClose:!0},ue.createElement(ot.Z,{justify:"space-between",className:"mb20",style:{maxHeight:650}},ue.createElement(At.Z,null,ue.createElement(yo.Z,{style:{width:160},size:"large",placeholder:"\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B",options:He,onChange:cr=>{Mr({page:1,discipline_id:cr==null?void 0:cr[0],sub_discipline_id:cr==null?void 0:cr[1]})}}),ue.createElement(as.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:cr=>Mr({page:1,diff:cr})}),ue.createElement(as.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:cr=>Mr({page:1,shixun_publish_status:cr})})),ue.createElement(Xt.t7,{placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",style:{width:290},onChange:cr=>{Mr({keyword:cr,page:1})}})),$i?ue.createElement("div",null,ue.createElement(Ai.Z,{customText:"\u6682\u65E0\u6570\u636E",ButtonText:"\u524D\u5F80\u5B9E\u8DF5\u9879\u76EE\u5E93\uFF0C\u6DFB\u52A0\u66F4\u591A\u8BD5\u9898>",ButtonClick:()=>(0,et.xg)("/shixuns")})):ue.createElement(ls.default,{loading:Xi,rowKey:"id",columns:[{title:"\u8BD5\u9898\u540D\u79F0",dataIndex:"name",width:"30%",ellipsis:{showTitle:!0},render:(cr,yr)=>ue.createElement("div",{style:{display:"flex",alignItems:"center"}},ue.createElement("div",{className:yr!=null&&yr.high_resources_consume?Yt.title:"",title:cr||"--"},ue.createElement(Re.Z,{key:1,showLines:1,showTextOnly:!0,value:cr||"--"})),(yr==null?void 0:yr.high_resources_consume)&&ue.createElement(Li.Z,{type:"shixun",style:{marginLeft:10}}))},{title:"\u96BE\u5EA6",dataIndex:"level"},{title:"\u5173\u5361\u6570\u91CF",dataIndex:"challenges_count",key:"challenges_count",render:(cr,yr,_i)=>ue.createElement("span",null,cr||"- -")},{title:"\u4F7F\u7528\u6B21\u6570",dataIndex:"study_count"},{title:ue.createElement("span",null,"\u53D1\u5E03\u72B6\u6001 ",ue.createElement(yt.Z,{title:"\u672A\u53D1\u5E03\u7684\u5B9E\u8DF5\u9879\u76EE\u4E0D\u80FD\u88AB\u9009\u7528"},ue.createElement(fi.Z,null))),dataIndex:"shixun_tag_num_name",key:"shixun_tag_num_name",width:100,render:(cr,yr,_i)=>ue.createElement("span",null,cr||"- -")},{title:"\u64CD\u4F5C",render(cr,yr){const{title:_i,challenge_names:Ci,author_name:Dr,identifier:ko,author_school_name:br,study_count:Cr}=yr||{};return ue.createElement("div",null,ue.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:ue.createElement("div",null,ue.createElement(Re.Z,{value:_i,style:{marginBottom:18}}),ue.createElement("div",{className:Yt.challengeNameWrapper},Ci.map((Nr,Tr)=>ue.createElement("div",{className:Yt.challengeName,key:Tr},"\u7B2C",(0,et.EM)(Tr+1),"\u9898\xA0",Nr))),ue.createElement(ot.Z,{className:Yt.shixunPreviewFooter,justify:"space-between",style:{alignItems:"center"}},ue.createElement(At.Z,{className:Yt.shixunInfoWrapper},ue.createElement("span",null,"\u521B\u5EFA\u8005"),ue.createElement("span",{className:Yt.shixunInfo},Dr.split("\u3001")[0]),ue.createElement("span",null,"\u6240\u5C5E\u5355\u4F4D"),ue.createElement("span",{className:Yt.shixunInfo},br),ue.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570"),ue.createElement("span",{className:Yt.shixunInfo},Cr)),ue.createElement(mt.ZP,{type:"primary",className:Yt.btnToDetail,onClick:()=>(0,et.xg)(`/shixuns/${ko}/challenges?exercise=true`)},ue.createElement("i",{className:"iconfont icon-shixunkecheng"}),"\u5B9E\u8BAD\u8BE6\u60C5")))})}},"\u67E5\u770B"),(yr==null?void 0:yr.shixun_tag_num)===1&&ue.createElement("a",{target:"_blank",href:`/shixuns/${yr==null?void 0:yr.identifier}/challenges`,style:{marginLeft:10}},"\u53BB\u53D1\u5E03"))}}],dataSource:Qi==null?void 0:Qi.items,rowSelection:{type:"radio",selectedRowKeys:pr,preserveSelectedRowKeys:!0,getCheckboxProps:cr=>({disabled:cr.shixun_tag_num===1}),onChange(cr,yr){var _i,Ci,Dr;console.log(cr),Hr(cr);const ko=[];for(const Cr of no)cr.includes(Cr.id)&&ko.push(Cr);const br=ko.map(Cr=>Cr.id);for(const Cr of yr)Cr&&cr.includes(Cr.id)&&!br.includes(Cr.id)&&ko.push({id:Cr.id,difficulty:Cr.level,identifier:Cr.identifier,name:Cr.name,real_name:(_i=Cr==null?void 0:Cr.author_name)==null?void 0:_i.split("\u3001")[0],school_name:Cr.author_school_name,challenge_names:Cr.challenge_names,challenges:(Ci=Cr.challenge_names)==null?void 0:Ci.map((Nr,Tr)=>({subject:Nr,id:Tr,score:5})),score:((Dr=Cr.challenge_names)==null?void 0:Dr.length)*5,study_count:Cr.study_count,challenges_count:Cr.challenges_count});lr(ko)}},pagination:{current:Dt.page,pageSize:Dt.limit,total:Qi==null?void 0:Qi.items_count,showTotal:cr=>ue.createElement("span",null,"\u5171\xA0",ue.createElement("span",{style:{color:"#165DFF"}},cr),"\xA0\u6761\u6570\u636E"),showQuickJumper:!0,onChange(cr,yr){Mr({page:cr,limit:yr})},size:"default"},scroll:{y:400}}))},ir=Le(82438),Rr=Le(49692),ea=(Mt,Pt,ln)=>new Promise((He,Dt)=>{var Xi=$i=>{try{Qi(ln.next($i))}catch(wi){Dt(wi)}},Mr=$i=>{try{Qi(ln.throw($i))}catch(wi){Dt(wi)}},Qi=$i=>$i.done?He($i.value):Promise.resolve($i.value).then(Xi,Mr);Qi((ln=ln.apply(Mt,Pt)).next())}),Pa=({visible:Mt,getdata:Pt,onCancel:ln,onRandomExchange:He,selectFromProblemSet:Dt,questionParams:Xi})=>{const[Mr,Qi]=(0,ue.useState)(!1),[$i,wi]=(0,ue.useState)(!1),[pr,Hr]=(0,ue.useState)({}),no=(0,rt.useParams)(),[lr,cr]=(0,ue.useState)(),yr=(_i,Ci)=>ea(void 0,null,function*(){wi(!0);const Dr=yield(0,Ye.ZP)(`/api/exercises/${no.categoryId}/toggle_random_question.json`,{method:"post",body:{question_id:Xi.id,item_bank_id:_i,shixuns_info:[{id:_i,is_copy:Ci!=1,is_use:Ci!=1}]}});wi(!1),Dr!=null&&Dr.status||(Ct.ZP.info("\u6362\u9898\u6210\u529F"),ln(),Pt())});return ue.createElement(Oe.default,{title:"\u8BF7\u9009\u62E9\u66FF\u6362\u65B9\u5F0F",open:Mt,onCancel:ln,centered:!0,maskClosable:!0,footer:null},ue.createElement(ot.Z,{justify:"center",className:"pb20"},ue.createElement(cs.Z,{onClick:He},"\u968F\u673A\u66F4\u6362"),(Xi==null?void 0:Xi.type)!=="PRACTICAL"&&ue.createElement(mt.ZP,{style:{marginLeft:24},onClick:Dt},"\u4ECE\u9898\u5E93\u4E2D\u9009\u62E9"),(Xi==null?void 0:Xi.type)==="PRACTICAL"&&ue.createElement(mt.ZP,{style:{marginLeft:24},onClick:()=>{Qi(!0)}},"\u4ECE\u9898\u5E93\u4E2D\u9009\u62E9")),ue.createElement(ri,{open:Mr,onCancel:()=>Qi(!1),onOk:_i=>ea(void 0,null,function*(){if(console.log("----selectedRows",_i,no),(_i==null?void 0:_i.length)<=0){Ct.ZP.info("\u8BF7\u9009\u62E9\u5B9E\u8BAD");return}let Ci=_i==null?void 0:_i.map(ko=>ko==null?void 0:ko.id),Dr=yield(0,Rr.Tr)({id:[...Ci],course_id:no.coursesId,type:"shixun"});(Dr==null?void 0:Dr.student_count)===0?yr(Ci==null?void 0:Ci[0],1):(cr(Ci),Hr(Dr)),Qi(!1)})}),ue.createElement(ir.Z,{resdata:pr,type:"shixun",okloading:$i,oktext:(pr==null?void 0:pr.can_copy_num)===0?"\u786E\u5B9A":"\u4E00\u952E\u590D\u5236\u5E76\u66FF\u6362",onok:_i=>ea(void 0,null,function*(){yr(lr==null?void 0:lr[0],2)})}))},xa=Le(94734),vo=Le(24334),Kr=Le(69304),er=Le(68042),ia=Le(14165),sa=Object.defineProperty,Ma=Object.defineProperties,Oa=Object.getOwnPropertyDescriptors,Oo=Object.getOwnPropertySymbols,ua=Object.prototype.hasOwnProperty,Lo=Object.prototype.propertyIsEnumerable,jr=(Mt,Pt,ln)=>Pt in Mt?sa(Mt,Pt,{enumerable:!0,configurable:!0,writable:!0,value:ln}):Mt[Pt]=ln,oo=(Mt,Pt)=>{for(var ln in Pt||(Pt={}))ua.call(Pt,ln)&&jr(Mt,ln,Pt[ln]);if(Oo)for(var ln of Oo(Pt))Lo.call(Pt,ln)&&jr(Mt,ln,Pt[ln]);return Mt},Yr=(Mt,Pt)=>Ma(Mt,Oa(Pt)),wo=(Mt,Pt,ln)=>new Promise((He,Dt)=>{var Xi=$i=>{try{Qi(ln.next($i))}catch(wi){Dt(wi)}},Mr=$i=>{try{Qi(ln.throw($i))}catch(wi){Dt(wi)}},Qi=$i=>$i.done?He($i.value):Promise.resolve($i.value).then(Xi,Mr);Qi((ln=ln.apply(Mt,Pt)).next())}),Ha=({data:Mt,submit:Pt,goBack:ln,loading:He,onTypeScore:Dt,editPreview:Xi=!1,onSkipExamination:Mr,selectValue:Qi,onExchange:$i,getdata:wi,handleMarkWrongQuestion:pr})=>{var Hr,no,lr,cr,yr,_i,Ci,Dr,ko,br,Cr;const Nr=(0,ue.useRef)(),[Tr,sr]=(0,ue.useState)(null),[ra,Bo]=(0,ue.useState)(!1),[ta,Sa]=(0,ue.useState)(!1),ro=(0,ue.useRef)(),[ha]=ft.default.useForm(),As=(0,rt.useParams)(),[kr,$a]=(0,ue.useState)(!1);(0,ue.useEffect)(()=>{Bo(!0)},[]),(0,ue.useEffect)(()=>{Xi||(0,et.Dk)("\u8BD5\u5377\u9884\u89C8")},[Xi]);const Eo=["\u5BB9\u6613","\u7B80\u5355","\u9002\u4E2D","\u56F0\u96BE"],ts={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"},ys={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"},Ol=Jn=>{var Xr;const Aa=[];return ue.createElement(ue.Fragment,null,ue.createElement("aside",{className:Ke.single},(Xr=Jn==null?void 0:Jn.choices)==null?void 0:Xr.map((Go,Lr)=>(Go.is_answer&&Aa.push(ia.k4[Lr]),ue.createElement("ul",{key:Lr},ue.createElement("li",null,ia.k4[Lr],"\u3001"),ue.createElement("li",null,ue.createElement(Re.Z,{value:Go.choice_text})))))),ue.createElement("div",{className:Ke.analysis},ue.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",Aa.join(""),ue.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",Eo[Jn.difficulty])),ue.createElement("aside",null,ue.createElement("span",{className:Ke.text},"\u89E3\u6790:"),ue.createElement(Re.Z,{value:Jn.analysis?Jn.analysis:"\u6682\u65E0\u89E3\u6790"})),ue.createElement("ul",null,ue.createElement("li",null,ue.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),`${(Jn==null?void 0:Jn.discipline_name)||"--"}/${Jn==null?void 0:Jn.sub_discipline_name}`),ue.createElement(yt.Z,{title:Jn==null?void 0:Jn.tag_discipline_name},ue.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},ue.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Jn==null?void 0:Jn.tag_discipline_name)))))},ku=(Jn,Xr)=>{var Aa;const Go=(Aa=Jn==null?void 0:Jn.standard_answer)==null?void 0:Aa.map((Lr,Wa)=>{var aa;return ue.createElement("div",{key:Wa},`\u7B54\u6848\uFF08\u586B\u7A7A${Lr==null?void 0:Lr.position}\uFF09\uFF1A${(aa=Lr==null?void 0:Lr.answer_text)==null?void 0:aa.join("\u3001")}`)});return ue.createElement(ue.Fragment,null,ue.createElement("div",{className:Ke.analysis},ue.createElement("div",{style:{display:"flex"}},ue.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A"),ue.createElement("div",null,Go)),ue.createElement("aside",null,ue.createElement("span",{className:Ke.text},"\u89E3\u6790:"),ue.createElement(Re.Z,{value:Jn.analysis?Jn.analysis:"\u6682\u65E0\u89E3\u6790"})),ue.createElement("ul",null,ue.createElement("li",null,ue.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),Xr?`${(Xr==null?void 0:Xr.discipline_name)||"--"}/${Xr==null?void 0:Xr.sub_discipline_name}`:`${(Jn==null?void 0:Jn.discipline_name)||"--"}/${Jn==null?void 0:Jn.sub_discipline_name}`),ue.createElement(yt.Z,{title:Xr?Xr==null?void 0:Xr.tag_discipline_name:Jn==null?void 0:Jn.tag_discipline_name},ue.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},ue.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Xr?Xr==null?void 0:Xr.tag_discipline_name:Jn==null?void 0:Jn.tag_discipline_name)))))},mu=Jn=>{var Xr;const Aa=(Xr=Jn==null?void 0:Jn.standard_answer)==null?void 0:Xr.map((Go,Lr)=>ue.createElement("div",{key:Lr},`\u7B54\u6848\uFF08\u586B\u7A7A${(Go==null?void 0:Go.position)||(Go==null?void 0:Go.exercise_choice_id)}\uFF09\uFF1A${Go==null?void 0:Go.answer_text}`));return ue.createElement(ue.Fragment,null,ue.createElement("div",{className:Ke.analysis},ue.createElement("div",{style:{display:"flex"}},ue.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A"),ue.createElement("div",null,Aa)),ue.createElement("aside",null,ue.createElement("span",{className:Ke.text},"\u89E3\u6790:"),ue.createElement(Re.Z,{value:Jn.analysis?Jn.analysis:"\u6682\u65E0\u89E3\u6790"})),ue.createElement("ul",null,ue.createElement("li",null,ue.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),`${(Jn==null?void 0:Jn.discipline_name)||"--"}/${Jn==null?void 0:Jn.sub_discipline_name}`),ue.createElement(yt.Z,{title:Jn==null?void 0:Jn.tag_discipline_name},ue.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},ue.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Jn==null?void 0:Jn.tag_discipline_name)))))},Ll=(Jn,Xr)=>{var Aa;return ue.createElement("div",{className:Ke.analysis},ue.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",(Aa=Jn==null?void 0:Jn.answer_texts)==null?void 0:Aa[0]),ue.createElement("aside",null,ue.createElement("span",{className:Ke.text},"\u89E3\u6790:"),ue.createElement(Re.Z,{value:Jn.analysis?Jn.analysis:"\u6682\u65E0\u89E3\u6790"})),ue.createElement("ul",null,ue.createElement("li",null,ue.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),Xr?`${(Xr==null?void 0:Xr.discipline_name)||"--"}/${Xr==null?void 0:Xr.sub_discipline_name}`:`${(Jn==null?void 0:Jn.discipline_name)||"--"}/${Jn==null?void 0:Jn.sub_discipline_name}`),ue.createElement(yt.Z,{title:Xr?Xr==null?void 0:Xr.tag_discipline_name:Jn==null?void 0:Jn.tag_discipline_name},ue.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},ue.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Xr?Xr==null?void 0:Xr.tag_discipline_name:Jn==null?void 0:Jn.tag_discipline_name))))},ru=Jn=>{var Xr,Aa;return ue.createElement("div",{className:Ke.analysis},ue.createElement("aside",null,ue.createElement("span",{className:Ke.text},"\u9884\u671F\u8F93\u51FA:"),ue.createElement(Re.Z,{value:(Xr=Jn==null?void 0:Jn.program_attr)==null?void 0:Xr.description})),ue.createElement("div",{style:{marginTop:20}},"\u6B63\u786E\u7B54\u6848\uFF1A",((Aa=Jn==null?void 0:Jn.program_attr)==null?void 0:Aa.answer_text)||"--"),ue.createElement("aside",null,ue.createElement("span",{className:Ke.text},"\u89E3\u6790:"),ue.createElement(Re.Z,{value:Jn.analysis?Jn.analysis:"\u6682\u65E0\u89E3\u6790"})),ue.createElement("ul",null,ue.createElement("li",null,ue.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),`${(Jn==null?void 0:Jn.discipline_name)||"--"}/${Jn==null?void 0:Jn.sub_discipline_name}`),ue.createElement(yt.Z,{title:Jn==null?void 0:Jn.tag_discipline_name},ue.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},ue.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Jn==null?void 0:Jn.tag_discipline_name))))},ka=(Jn,Xr)=>{var Aa;return ue.createElement("div",null,(Aa=Jn==null?void 0:Jn.sub_item_banks)==null?void 0:Aa.map((Go,Lr)=>{var Wa,aa;const qa=[];return ue.createElement(ue.Fragment,null,ue.createElement("div",{style:{marginLeft:25,fontSize:"16px",color:"#333",paddingTop:"15px"}},Xr+1+"."+(Lr+1),"\uFF08",ts[Go.item_type]||ys[Go.item_type],"\uFF09",Go.name),(Go.item_type=="SINGLE"||Go.item_type=="MULTIPLE"||Go.item_type=="JUDGMENT"||Go.item_type=="single"||Go.item_type=="multiple"||Go.item_type=="judgement")&&ue.createElement(ue.Fragment,null,ue.createElement("aside",{className:Ke.single},(Wa=Go==null?void 0:Go.choices)==null?void 0:Wa.map((xo,Va)=>(xo.is_answer&&qa.push(ia.k4[Va]),ue.createElement("ul",{key:Va},ue.createElement("li",null,ia.k4[Va],"\u3001"),ue.createElement("li",null,ue.createElement(Re.Z,{value:xo.choice_text})))))),ue.createElement("div",{className:Ke.analysis},ue.createElement("div",null,"\u6B63\u786E\u7B54\u6848\uFF1A",qa.join(""),ue.createElement("span",{className:"ml30"},"\u96BE\u5EA6\uFF1A",Eo[Go.difficulty])),ue.createElement("aside",null,ue.createElement("span",{className:Ke.text},"\u89E3\u6790:"),ue.createElement(Re.Z,{value:Go.analysis?Go.analysis:"\u6682\u65E0\u89E3\u6790"})),ue.createElement("ul",null,ue.createElement("li",null,ue.createElement("span",{style:{color:"#007AFF",marginRight:10}},"\u65B9\u5411&\u8BFE\u7A0B:"),`${(Jn==null?void 0:Jn.discipline_name)||"--"}/${Jn==null?void 0:Jn.sub_discipline_name}`),ue.createElement(yt.Z,{title:Jn==null?void 0:Jn.tag_discipline_name},ue.createElement("li",{style:{maxWidth:"400px",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},ue.createElement("span",{style:{color:"#5AB891",marginRight:10}},"\u77E5\u8BC6\u70B9:"),Jn==null?void 0:Jn.tag_discipline_name))))),(Go.item_type=="COMPLETION"||Go.item_type=="completion")&&ku(Go,Jn),(Go.item_type=="SUBJECTIVE"||Go.item_type=="subjective")&&Ll(Go,Jn),((aa=Mt==null?void 0:Mt.exam)==null?void 0:aa.exercise_status)===3&&ue.createElement("div",{className:"flex gap-20px mt20"},ue.createElement(Kr.Z,{state:Go==null?void 0:Go.is_wrong,onClick:()=>{pr==null||pr({value:Yr(oo({},Go),{question_id:Go==null?void 0:Go.id,question_score:Go==null?void 0:Go.score})})}}),Go.item_type=="single"&&ue.createElement(mt.ZP,{style:{color:"#3061D0"},onClick:()=>{vu({value:Go})}},"\u589E\u8BBE\u6B63\u786E\u7B54\u6848")))}))},tl=Jn=>{var Xr,Aa,Go;return ue.createElement("div",{style:{marginTop:"12px"}},(Aa=(Xr=Jn==null?void 0:Jn.shixun)==null?void 0:Xr.challenges)==null?void 0:Aa.map((Lr,Wa)=>ue.createElement("div",{className:"c-grey-666 font14 mb10 ml25",style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},ue.createElement("div",null,ue.createElement("span",{className:"mr5"},"\u7B2C",Wa+1,"\u5173"),ue.createElement(yt.Z,{key:Wa,title:Lr==null?void 0:Lr.challenge_name},ue.createElement("span",null,(0,et.Pq)(Lr==null?void 0:Lr.challenge_name,44)))),Xi&&ue.createElement("div",null,"\u5206\u503C\uFF1A",Lr.score,"\u5206"))),ue.createElement(rt.Link,{style:{float:"right"},target:"_blank",to:`/shixuns/${(Go=Jn==null?void 0:Jn.shixun)==null?void 0:Go.identifier}/challenges`},"\u5B9E\u8BAD\u8BE6\u60C5"),ue.createElement("div",{style:{clear:"both"}}))},ou=Jn=>{let Xr=Jn.questions_score/Jn.questions_count;Oe.default.confirm({icon:null,centered:!0,title:"\u5206\u6570\u8BBE\u7F6E",content:ue.createElement("div",{className:Ke.modalColumn},ue.createElement("div",{className:Ke.modalRow,style:{justifyContent:"flex-start"}},ue.createElement("sup",{className:Ke.sup},"*"),ue.createElement("span",null,Jn==null?void 0:Jn.name,"\uFF1A"),ue.createElement(at.Z,{min:0,precision:1,defaultValue:Xr,onChange:Aa=>{Xr=Aa}}),ue.createElement("span",{className:"ml5"},"\u5206/\u9898"))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>wo(void 0,null,function*(){var Aa;if(!Xr)return Ct.ZP.warning("\u5206\u6570\u4E0D\u80FD\u4E3A\u7A7A\u6216\u4E3A0"),Promise.reject();const Go={type:Jn==null?void 0:Jn.type,score:Xr,scoreTotal:Number((Aa=Xr*Jn.questions_count)==null?void 0:Aa.toFixed(1))};Dt(Go)})})},Bl=()=>{let Jn="";Oe.default.confirm({icon:null,centered:!0,title:"\u4FDD\u5B58\u8BD5\u5377",content:ue.createElement("div",{className:Ke.modalColumn},ue.createElement("div",{style:{color:"#676A6C",display:"flex",alignItems:"center"},className:"font14 mt20"},ue.createElement("img",{style:{marginRight:5},src:Cn.Z}),"\u4FDD\u5B58\u540E\u5355\u72EC\u751F\u6210\u4E00\u4EFD\u4EBA\u5DE5\u7EC4\u5377\u7C7B\u578B\u7684\u56FA\u5B9A\u8BD5\u5377\u3002"),ue.createElement("div",{className:Ke.modalRow,style:{marginTop:20}},ue.createElement("sup",{className:Ke.sup},"*"),ue.createElement("span",{style:{flexShrink:0}},"\u8BD5\u5377\u540D\u79F0\uFF1A"),ue.createElement(dt.default,{placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0",min:0,maxLength:60,defaultValue:Jn,onChange:Xr=>{Jn=Xr.target.value}}))),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>wo(void 0,null,function*(){var Xr;if(!Jn)return Ct.ZP.warning("\u8BD5\u5377\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A"),Promise.reject();const Aa=[],Go=[],Lr=[],Wa=[];(Xr=Mt==null?void 0:Mt.questionList)==null||Xr.forEach(qa=>{var xo;(xo=qa.questions)==null||xo.forEach(Va=>{let Ea=qa.questions_score/qa.questions_count;Ea=Ea&&Ea.toFixed(1),qa.type==="COMBINATION"&&Lr.push({id:Va.id,sub_item_bank_ids:Va.sub_item_banks.map(Cs=>Cs.id)}),qa.type==="PRACTICAL"?Wa.push(Va.id):(Aa.push(Va.id),Go.push(Ea))})}),console.log("-----",Lr),yield Pt({item_bank_ids:Aa,item_bank_scores:Go,name:Jn,combination_item_banks:Lr,shixun_ids:Wa})})})},ih=(Jn,Xr,Aa,Go)=>{var Lr;const Wa=`${location.pathname}${location.search}`,aa=(Lr=Go.questions)==null?void 0:Lr.map(qa=>qa==null?void 0:qa.id);if(Wa.includes("exercise"))ro.current={id:Jn,ids:aa,type:Xr,index:Aa},Sa(!0);else{let qa=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:()=>wo(void 0,null,function*(){qa.update({cancelButtonProps:{disabled:!0}}),yield $i({single_question_id:Jn,seleted_item_bank_ids:aa},{type:Xr,index:Aa}),qa.update({cancelButtonProps:{disabled:!1}}),Ct.ZP.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u8BD5\u9898")})})}},ul=Jn=>{var Xr;const Aa=(Xr=Jn.questions)==null?void 0:Xr.map(Wa=>Wa==null?void 0:Wa.id),Go=Jn.name;let Lr=Oe.default.confirm({icon:null,centered:!0,title:"\u6E29\u99A8\u63D0\u793A",content:`\u786E\u8BA4\u66F4\u6362${Go}\u4E2D\u7684\u6240\u6709\u8BD5\u9898\u5417\uFF1F`,cancelButtonProps:{disabled:!1},maskClosable:!1,keyboard:!1,okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:()=>wo(void 0,null,function*(){Lr.update({cancelButtonProps:{disabled:!0}}),yield $i({seleted_item_bank_ids:Aa},{type:Jn.type}),Lr.update({cancelButtonProps:{disabled:!1}}),Ct.ZP.success(`\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210${Go}\u8BD5\u9898`)})})},pa=()=>{let Jn=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:()=>wo(void 0,null,function*(){Jn.update({cancelButtonProps:{disabled:!0}}),yield $i(),Jn.update({cancelButtonProps:{disabled:!1}}),Ct.ZP.success("\u5DF2\u91CD\u65B0\u968F\u673A\u751F\u6210\u6574\u5F20\u8BD5\u9898")})})},Fa=Jn=>{console.log(Jn,"key"),Mr(Jn-1)},us=(Jn,Xr)=>{var Aa,Go;if(Xr==="SINGLE")return ue.createElement(ue.Fragment,null,ue.createElement(_r,{ref:Nr,editData:Jn,isEdit:!0}),ue.createElement(Ge.Z,null));if(Xr==="MULTIPLE")return ue.createElement(ue.Fragment,null,ue.createElement(Oi,{ref:Nr,editData:Jn,isEdit:!0}),ue.createElement(Ge.Z,null));if(Xr==="JUDGMENT")return ue.createElement(ue.Fragment,null,ue.createElement(tn,{ref:Nr,editData:Jn,isEdit:!0}),ue.createElement(Ge.Z,null));if(Xr==="COMPLETION")return ue.createElement(ue.Fragment,null,ue.createElement(Jt,{ref:Nr,editData:Jn,isEdit:!0}),ue.createElement(Ge.Z,null));if(Xr==="SUBJECTIVE")return ue.createElement(ue.Fragment,null,ue.createElement(Di,{ref:Nr,editData:Jn,isEdit:!0}),ue.createElement(Ge.Z,null));if(Xr==="COMBINATION")return ue.createElement(ue.Fragment,null,ue.createElement(ms,{ref:Nr,editData:Jn,isEdit:!0}),ue.createElement(Ge.Z,null));if(Xr==="BPROGRAM")return ue.createElement(ue.Fragment,null,ue.createElement(ft.default,{form:ha,style:{marginTop:20},onFinishFailed:Lr=>{var Wa,aa;Lr.errorFields[0].name.includes("standard_answers")?Ct.ZP.error("\u586B\u7A7A\u9879\u7B54\u6848\u4E0D\u80FD\u4E3A\u7A7A"):Ct.ZP.error(Lr.errorFields[0].errors[0]),ha.scrollToField((aa=(Wa=Lr==null?void 0:Lr.errorFields)==null?void 0:Wa[0])==null?void 0:aa.name,{behavior:"smooth",block:"center"})},onFinish:Lr=>wo(void 0,null,function*(){var Wa;let aa=Yr(oo({question_score:Jn.score},Lr),{question_type:8,hack:Yr(oo({},Lr.hack),{difficult:Jn.program_attr.difficult}),hack_codes:Yr(oo({},Lr.hack_codes),{code:vo.Base64.encode((Wa=Lr.hack_codes)==null?void 0:Wa.code)})});kr&&(aa.is_cover=1);const qa=yield(0,Ye.ZP)(`/api/exercise_questions/${Jn.id}.json`,{method:"put",body:aa});(qa==null?void 0:qa.status)===0&&(Ct.ZP.success("\u7F16\u8F91\u6210\u529F"),Fa(Qi+1)),sr(null)})},ue.createElement(xa.tc,{form:ha,questionTitlePlaceholder:"\u8BF7\u7F16\u8F91\u9898\u5E72\u5E76\u8BBE\u7F6E\u586B\u7A7A\u9879",scoreByBlank:!1,hackidentifier:(Aa=Jn==null?void 0:Jn.program_attr)==null?void 0:Aa.identifier,answerKey:"standard_answers"}),ue.createElement(Ge.Z,null)));if(Xr==="PROGRAM"&&rt.history.push(`/problems/${(Go=Jn==null?void 0:Jn.program_attr)==null?void 0:Go.identifier}/edit?type=exercises&express_id=${As.categoryId}&question_id=${Jn==null?void 0:Jn.id}&score=${Jn==null?void 0:Jn.score}&callback_url=${location.pathname}&select=${Qi}&exercise=true`),Xr==="PRACTICAL")return ue.createElement(ue.Fragment,null,ue.createElement(Pi,{ref:Nr,editData:Jn,isEdit:!0}),ue.createElement(Ge.Z,null))},Ts=(Jn,Xr)=>wo(void 0,null,function*(){var Aa,Go,Lr,Wa,aa,qa;const xo=yield(Aa=Nr.current)==null?void 0:Aa.onSave();if(!xo)return;const Va=So=>{const js=So.map(Xs=>Xs.choice_text.trim().replace(/^\s+|\s+$/g,""));return new Set(js).size!==js.length},Ea={question_score:Xr.score,analysis:xo.analysis};if(Jn==="SINGLE"||Jn==="MULTIPLE"||Jn==="JUDGMENT"){if(Jn!=="JUDGMENT"&&Va(xo==null?void 0:xo.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 So=[],js=[];Ea.question_type=Jn==="JUDGMENT"?2:1,Ea.question_title=xo==null?void 0:xo.name,(Go=xo==null?void 0:xo.choices)==null||Go.forEach((Ml,Xs)=>{So.push(Ml.choice_text),Ml!=null&&Ml.is_answer&&js.push(Xs+1)}),Ea.question_choices=So,Ea.standard_answers=js}if(Jn==="COMPLETION"){let So=(Lr=xo==null?void 0:xo.standard_answers)==null?void 0:Lr.map((Xs,Is)=>(Xs==null?void 0:Xs.score)<=0?Is+1:null).filter(Xs=>Xs!==null);if((So==null?void 0:So.length)>0)return Ct.ZP.warning(`\u7B2C${So.join("\u3001")}\u9879\u7684\u5206\u503C\u4E0D\u80FD\u4E3A\u7A7A`),!1;let js=(Wa=xo==null?void 0:xo.standard_answers)==null?void 0:Wa.reduce((Xs,Is)=>Xs+(Number(Is==null?void 0:Is.score)||0),0);if(parseFloat(js.toFixed(2))!=(Ea==null?void 0:Ea.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;Ea.is_ordered=xo.is_ordered,Ea.question_title=xo==null?void 0:xo.name,Ea.use_blank_score=xo==null?void 0:xo.use_blank_score,Ea.question_type=3;const Ml=[];(aa=xo==null?void 0:xo.standard_answers)==null||aa.forEach((Xs,Is)=>{Ml.push({choice_id:Xs.position,answer_text:Xs.answer_text,score:Xs.score})}),Ea.standard_answers=Ml,Ea.downcase=xo==null?void 0:xo.downcase,Ea.no_space=xo==null?void 0:xo.no_space}if(Jn==="SUBJECTIVE"&&(console.log("editorData"),console.log(xo),Ea.question_title=xo==null?void 0:xo.name,Ea.question_type=4,Ea.answer_texts=xo==null?void 0:xo.answer_texts,Ea.use_keywords=xo==null?void 0:xo.use_keywords,Ea.keywords=xo==null?void 0:xo.keywords),Jn==="COMBINATION"){Ea.question_title=xo==null?void 0:xo.name,Ea.question_type=7;try{Ea.sub_questions=(qa=xo==null?void 0:xo.sub_item_banks)==null?void 0:qa.map((So,js)=>{var Ml,Xs,Is;if((So==null?void 0:So.item_type)=="single"||(So==null?void 0:So.item_type)=="multiple"){if(Va(So==null?void 0:So.choices))throw new Error(`\u7B2C${js+1}\u5C0F\u9898\u9009\u9879\u5185\u5BB9\u91CD\u590D\uFF0C\u8BF7\u4FEE\u6539\u540E\u518D\u4FDD\u5B58`);const Ch=[],Ka=[];return(Ml=So==null?void 0:So.choices)==null||Ml.forEach((vl,bh)=>{Ch.push(vl.choice_text),vl!=null&&vl.is_answer&&Ka.push(bh+1)}),{id:So.id,question_id:So.id,question_title:So.name,difficulty:So.difficulty,question_type:(So==null?void 0:So.item_type)=="single"?0:(So==null?void 0:So.item_type)=="multiple"?1:2,question_choices:Ch,standard_answers:Ka,analysis:So.analysis,question_score:So==null?void 0:So.score}}else if((So==null?void 0:So.item_type)=="completion"){let Ch=(Xs=So==null?void 0:So.standard_answer)==null?void 0:Xs.reduce((vl,bh)=>vl+(Number(bh==null?void 0:bh.score)||0),0);if(parseFloat(Ch.toFixed(2))!=(So==null?void 0:So.score))throw new Error("\u5404\u586B\u7A7A\u9879\u5206\u503C\u4E4B\u548C\u5FC5\u987B\u7B49\u4E8E\u8BE5\u5C0F\u9898\u5206\u503C\uFF01");const Ka=[];return(Is=So==null?void 0:So.standard_answer)==null||Is.forEach((vl,bh)=>{Ka.push({choice_id:vl.position,answer_text:vl.answer_text,score:vl.score})}),{id:So.id,question_id:So.id,is_ordered:So.is_ordered,question_title:So.name,difficulty:So.difficulty,question_type:3,standard_answers:Ka,use_blank_score:So.use_blank_score,analysis:So.analysis,downcase:So==null?void 0:So.downcase,no_space:So==null?void 0:So.no_space,question_score:So==null?void 0:So.score}}else if((So==null?void 0:So.item_type)=="subjective")return{id:So.id,question_id:So.id,question_title:So.name,question_type:4,difficulty:So.difficulty,answer_texts:So==null?void 0:So.answer_texts,analysis:So.analysis,question_score:So==null?void 0:So.score,use_keywords:So.use_keywords,keywords:So==null?void 0:So.keywords}})}catch(So){Ct.ZP.warning(So.message);return}delete Ea.analysis}let Cs=!1;(Xr==null?void 0:Xr.is_my)===1&&(Cs=yield new Promise((js,Ml)=>{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:()=>{js(!0)},onCancel:()=>{js(!1)}})})),Cs&&(Ea.is_cover=1);const Au=Jn!=="PRACTICAL"?yield(0,Ye.ZP)(`/api/exercise_questions/${Xr.id}.json`,{method:"put",body:Ea}):yield(0,Ye.ZP)(`/api/exercise_questions/${Xr.id}/update_shixun_score.json`,{method:"post",body:oo({},xo)});(Au==null?void 0:Au.status)===0&&(Ct.ZP.success("\u7F16\u8F91\u6210\u529F"),Fa(Qi+1),sr(null))}),_s=()=>wo(void 0,null,function*(){(0,rt.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/${As.categoryId}/sync_random_question.json`,{method:"post"})).status===0&&(yield Mr(Qi),Ct.ZP.success("\u66F4\u65B0\u6210\u529F")),(0,rt.getDvaApp)()._store.dispatch({type:"globalSetting/setGlobalLoading",payload:{show:!1}})}),vu=({value:Jn}={})=>{var Xr;const Aa=[];let Go=[];const Lr=(Xr=Jn==null?void 0:Jn.choices)==null?void 0:Xr.map((aa,qa)=>{var xo;const Va=qa+1;return aa!=null&&aa.is_answer&&(Aa.push(Va),Go.push(Va)),{value:Va,label:ue.createElement(Re.Z,{className:"c-black font14",value:`${(xo=ia.k4)==null?void 0:xo[qa]}. ${aa==null?void 0:aa.choice_text}`}),disabled:aa==null?void 0:aa.origin_standard_answer}}),Wa=Oe.default.confirm({centered:!0,icon:null,title:"\u589E\u8BBE\u6B63\u786E\u7B54\u6848",width:800,content:ue.createElement(ue.Fragment,null,"\u5F53\u524D\u8BD5\u9898\u7684\u6B63\u786E\u7B54\u6848\u4E3A ",Aa==null?void 0:Aa.map(aa=>{var qa;return(qa=ia.k4)==null?void 0:qa[aa-1]}),"\uFF0C\u8BF7\u9009\u62E9\u9700\u8981\u589E\u8BBE\u4E3A\u6B63\u786E\u7B54\u6848\u7684\u9009\u9879\u3002",ue.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",ue.createElement("br",null),ue.createElement(Rt.default.Group,{className:"flex-col mt20",options:Lr,defaultValue:Go,onChange:aa=>{Go=aa}})),onOk:()=>wo(void 0,null,function*(){const aa=yield(0,Ye.ZP)(`/api/exercises/${As.categoryId}/questions/${Jn==null?void 0:Jn.id}/add_standard_answers.json`,{method:"put",body:{standard_answer:Go}});(aa==null?void 0:aa.status)===0&&(Ct.ZP.success("\u4FEE\u6539\u6210\u529F"),Fa(Qi+1))})})},Jl=(Hr=Mt==null?void 0:Mt.questionList)==null?void 0:Hr.reduce((Jn,Xr)=>Jn+Number(Xr.questions_score),0),yu=Xi&&((no=Mt==null?void 0:Mt.exam)==null?void 0:no.exercise_status)!==1;return ue.createElement("section",{className:Ke.wrap},ue.createElement("div",{id:"id_left_preview",className:Ke.left,onMouseEnter:Jn=>{const Xr=document.getElementById("id_left_preview");Xr.style.overflowY="auto"},onMouseLeave:Jn=>{const Xr=document.getElementById("id_left_preview");Xr.style.overflowY="hidden"}},ue.createElement("div",{className:Ke.title},ue.createElement("div",{className:"body-overflow-initial"},ue.createElement("b",null),ue.createElement("span",null,"\u7B54\u9898\u5361"))),ue.createElement("div",{className:Ke.total},ue.createElement("div",null,ue.createElement("img",{src:Pn}),ue.createElement("span",null,"\u9898\u6570(\u9053)"),ue.createElement("aside",null,Mt==null?void 0:Mt.all_questions_count)),ue.createElement("div",{className:"mr30 ml30"},ue.createElement("img",{src:Fn}),ue.createElement("span",null,"\u603B\u5206(\u5206)"),ue.createElement("aside",null,Jl&&Jl.toFixed(1))),ue.createElement("div",null,ue.createElement("img",{src:Ie}),ue.createElement("span",null,"\u65F6\u957F(\u5206)"),ue.createElement("aside",null,((lr=Mt==null?void 0:Mt.exam)==null?void 0:lr.time)===-1||((cr=Mt==null?void 0:Mt.exam)==null?void 0:cr.time)===null?"\u4E0D\u9650":(yr=Mt==null?void 0:Mt.exam)==null?void 0:yr.time))),(_i=Mt==null?void 0:Mt.questionList)==null?void 0:_i.map((Jn,Xr)=>{var Aa;return ue.createElement("div",{className:Ke.list,key:Xr},ue.createElement("div",{className:Ke.name},ue.createElement("b",null),ue.createElement("span",null,Jn.name)),ue.createElement("aside",null,ue.createElement("div",null,"\u5171",ue.createElement("span",{className:Ke.b},Jn.questions_count),"\u9898 ",ue.createElement("span",{className:Ke.l},"|"),"\u5171",ue.createElement("span",{className:Ke.r},Jn.questions_score),"\u5206"),ue.createElement("div",{className:Ke.answerSheet},(Aa=Jn==null?void 0:Jn.questions)==null?void 0:Aa.map((Go,Lr)=>ue.createElement("div",{onClick:()=>{const Wa=`Anchor_${Go==null?void 0:Go.id}`;let aa=document.getElementById(Wa);aa&&setTimeout(()=>aa.scrollIntoView({block:"center",behavior:"smooth"}))},key:Go==null?void 0:Go.id,className:Ke.tag},Lr+1)))))})),ue.createElement("div",{className:Ke.right},ue.createElement("div",{className:Ke.examName,id:"examName"},ue.createElement("div",{className:Ke.name},ue.createElement(yt.Z,{title:(Ci=Mt==null?void 0:Mt.exam)==null?void 0:Ci.name,getPopupContainer:Jn=>Jn.parentNode},ue.createElement("span",{className:Ke.t},(Dr=Mt==null?void 0:Mt.exam)==null?void 0:Dr.name))),Xi&&((ko=Mt==null?void 0:Mt.exam)==null?void 0:ko.exercise_status)===1&&ue.createElement(Xt.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:()=>{_s()}})},type:"primary"},"\u66F4\u65B0\u8BD5\u5377"),!Xi&&ue.createElement(mt.ZP,{onClick:pa,type:"primary"},"\u968F\u673A\u66F4\u6362")),ue.createElement("div",{className:Ke.topWarp},(br=Mt==null?void 0:Mt.questionList)==null?void 0:br.map((Jn,Xr)=>{var Aa,Go;return ue.createElement(ue.Fragment,{key:Xr},ue.createElement("div",{className:Ke.head,style:Xr===0?{border:0,marginTop:-16}:{}},ue.createElement("div",{className:Ke.name},ue.createElement("b",null),ue.createElement("span",null,Jn.name)),ue.createElement("div",{className:Ke.so},"\u5171",ue.createElement("span",{className:Ke.b},Jn.questions_count," "),"\u9898 ",Jn.type==="COMBINATION"&&`\uFF08\u5305\u542B${(Aa=Jn==null?void 0:Jn.questions)==null?void 0:Aa.map(Lr=>{var Wa;return(Wa=Lr==null?void 0:Lr.sub_item_banks)==null?void 0:Wa.length}).reduce((Lr,Wa)=>Lr+Wa)}\u5C0F\u9898\uFF09`,ue.createElement("span",{className:Ke.l},"|"),"\u5171",ue.createElement("span",{className:Ke.r},Jn.questions_score),"\u5206"),!Xi&&ue.createElement("div",{className:Ke.btn},ue.createElement(mt.ZP,{onClick:()=>{ou(Jn)},type:"primary",ghost:!0,className:"mr20"},"\u8BBE\u7F6E\u5F97\u5206"),ue.createElement(mt.ZP,{onClick:()=>ul(Jn),type:"primary",ghost:!0},"\u968F\u673A\u66F4\u6362"))),(Go=Jn==null?void 0:Jn.questions)==null?void 0:Go.map((Lr,Wa)=>{var aa,qa,xo,Va;return Tr===(Lr==null?void 0:Lr.id)?ue.createElement("div",{id:`Anchor_${Lr==null?void 0:Lr.id}`,className:Ke.content,style:{padding:0,marginTop:24},key:Lr==null?void 0:Lr.id},ue.createElement("div",{style:{float:"right",marginTop:`${(Jn==null?void 0:Jn.type)==="PRACTICAL"?"-2px":"-6px"}`}},ue.createElement(mt.ZP,{onClick:()=>sr(null),className:"mr20",type:"primary",ghost:!0},"\u53D6\u6D88"),ue.createElement(mt.ZP,{onClick:()=>{Ts(Jn==null?void 0:Jn.type,Lr)},type:"primary"},"\u4FDD\u5B58")),us(Lr,Jn.type)):ue.createElement("div",{id:`Anchor_${Lr==null?void 0:Lr.id}`,className:Ke.content,key:Lr==null?void 0:Lr.id},ue.createElement("div",{className:Ke.titleWrap},(Lr==null?void 0:Lr.item_type)==="bprogram"?ue.createElement(Re.Z,{style:{paddingRight:10},value:Wa+1+"\u3001"+((aa=Lr==null?void 0:Lr.program_attr)==null?void 0:aa.description)}):ue.createElement(Re.Z,{style:{paddingRight:10},className:Ke.titleHtml,value:Wa+1+`\u3001${(Lr==null?void 0:Lr.item_type)==="combination"?"\uFF08\u9898\u5E72\uFF09":""}`+(Lr==null?void 0:Lr.name)}),Xi&&ue.createElement(mt.ZP,{onClick:()=>{var Ea,Cs,Au;if(Tr){Ct.ZP.warning("\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u8BD5\u9898");return}ha.setFieldsValue({standard_answers:Lr==null?void 0:Lr.standard_answer,hack:oo(oo({},Lr),Lr==null?void 0:Lr.program_attr),hack_codes:Yr(oo({},Lr==null?void 0:Lr.program_attr),{code:vo.Base64.decode(((Ea=Lr==null?void 0:Lr.program_attr)==null?void 0:Ea.code)||"")}),hack_sets:oo({},(Cs=Lr==null?void 0:Lr.hack_sets)==null?void 0:Cs[0])}),(Lr==null?void 0:Lr.item_type)=="program"?rt.history.push(`/problems/newedit/${(Au=Lr==null?void 0:Lr.program_attr)==null?void 0:Au.identifier}?type=exercises&express_id=${As.categoryId}&question_id=${Lr==null?void 0:Lr.id}&score=${Lr==null?void 0:Lr.score}&exercise=true&callback_url=/classrooms/${As.coursesId}/exercise/${As.categoryId}/detail?random=true`):sr(Lr==null?void 0:Lr.id)},type:"primary",style:{marginLeft:"auto"},ghost:!0},"\u7F16\u8F91"),!yu&&ue.createElement(mt.ZP,{disabled:yu,className:"ml20",onClick:()=>ih(Lr==null?void 0:Lr.id,Jn.type,Wa,Jn),type:"primary",ghost:!0},"\u6362\u4E00\u9898")),(Lr==null?void 0:Lr.item_type)==="bprogram"&&ue.createElement(Re.Z,{style:{paddingRight:10,paddingLeft:25},showProgramFill:!0,disabledFill:!0,className:Ke.titleHtml,value:vo.Base64.decode(((qa=Lr==null?void 0:Lr.program_attr)==null?void 0:qa.code)||"")}),(Jn.type==="SINGLE"||Jn.type==="JUDGMENT"||Jn.type==="MULTIPLE")&&Ol(Lr),Jn.type==="COMPLETION"&&ku(Lr),Jn.type==="SUBJECTIVE"&&Ll(Lr),Jn.type==="PROGRAM"&&ru(Lr),Jn.type==="BPROGRAM"&&mu(Lr),Jn.type==="COMBINATION"&&ka(Lr,Wa),Jn.type==="PRACTICAL"&&tl(Lr),ue.createElement(ot.Z,{className:"mt20",wrap:!1,align:"middle",gutter:20},((xo=Mt==null?void 0:Mt.exam)==null?void 0:xo.exercise_status)===3&&!["PROGRAM","BPROGRAM","PRACTICAL","COMBINATION"].includes(Jn.type)&&ue.createElement(At.Z,null,ue.createElement(Kr.Z,{state:Lr==null?void 0:Lr.is_wrong,onClick:()=>{pr==null||pr({value:Yr(oo({},Lr),{question_id:Lr==null?void 0:Lr.id,question_score:Lr==null?void 0:Lr.score})})}})),["PROGRAM","BPROGRAM","PRACTICAL"].includes(Jn.type)&&(Lr==null?void 0:Lr.show_resubmit)&&ue.createElement(At.Z,null,ue.createElement(er.C,{dataSource:Yr(oo({},Lr),{question_id:Lr==null?void 0:Lr.id})})),((Va=Mt==null?void 0:Mt.exam)==null?void 0:Va.exercise_status)===3&&["SINGLE"].includes(Jn.type)&&ue.createElement(At.Z,null,ue.createElement(mt.ZP,{style:{color:"#3061D0"},onClick:()=>{vu({value:Lr})}},"\u589E\u8BBE\u6B63\u786E\u7B54\u6848"))))}))}))),Xi?ue.createElement(Xt.vr,null,ue.createElement(Te.Z,{showTotal:et.rU,total:(Cr=Mt==null?void 0:Mt.exam)==null?void 0:Cr.total_num,pageSize:1,current:Qi+1,showSizeChanger:!1,onChange:Fa,showQuickJumper:!1,hideOnSinglePage:!1})):ue.createElement(Xt.vr,{LeftContent:ue.createElement(Xt.op,{onClick:ln,shape:"default",style:{height:38,background:"#fff",boxShadow:"none"}},"\u8FD4\u56DE"),RightContent:ue.createElement(ot.Z,{align:"middle"},ue.createElement(ne.Z,{color:"#55575D",overlayClassName:Ke.popover,open:ra,getPopupContainer:Jn=>Jn==null?void 0:Jn.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"},ue.createElement(Xt.op,{onMouseEnter:()=>Bo(!0),onMouseLeave:()=>Bo(!1),onClick:()=>Bl(),shape:"default",style:{height:38,background:"#fff",boxShadow:"none"}},"\u4FDD\u5B58")),ue.createElement(Xt.op,{shape:"default",type:"primary",onClick:()=>Pt(),style:{height:38,marginLeft:20}},"\u63D0\u4EA4"))}),ue.createElement(Pa,{visible:ta,questionParams:ro.current,getdata:wi,onRandomExchange:()=>wo(void 0,null,function*(){const Jn=ro.current;yield $i({single_question_id:Jn.id,seleted_item_bank_ids:Jn.ids},{type:Jn.type,index:Jn.index}),Sa(!1)}),selectFromProblemSet:()=>{const Jn=ro.current,Xr=`${location.pathname}${location.search}`;Xr.includes("exercise")&&rt.history.push(`/paperlibrary/exchangequestion?type=exercise&qid=${Jn.id}&qtype=${Jn.type}&exerciseid=${As.categoryId}&from=${Xr}`)},onCancel:()=>{Sa(!1)}}))}},43794:function(Un,ai,Le){"use strict";Le.r(ai),Le.d(ai,{default:function(){return ls}});var ue=Le(59301),Ke={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"},ft=Le(6767),yt=Le(28284),mt=Le(91882),Oe=Le(89070),at=Le(32441),Ct=Le(29787),dt=Le(37568),Ge=Le(17149),Rt=Le(47889),ot=Le(77019),At=Le(71051),Te=Le(99571),ne=Le(99064),te=Object.defineProperty,de=Object.getOwnPropertySymbols,se=Object.prototype.hasOwnProperty,pe=Object.prototype.propertyIsEnumerable,ye=(Yt,Xt,kn)=>Xt in Yt?te(Yt,Xt,{enumerable:!0,configurable:!0,writable:!0,value:kn}):Yt[Xt]=kn,we=(Yt,Xt)=>{for(var kn in Xt||(Xt={}))se.call(Xt,kn)&&ye(Yt,kn,Xt[kn]);if(de)for(var kn of de(Xt))pe.call(Xt,kn)&&ye(Yt,kn,Xt[kn]);return Yt},be=(Yt,Xt,kn)=>new Promise((Zi,yi)=>{var Ai=ri=>{try{Rn(kn.next(ri))}catch(ir){yi(ir)}},Li=ri=>{try{Rn(kn.throw(ri))}catch(ir){yi(ir)}},Rn=ri=>ri.done?Zi(ri.value):Promise.resolve(ri.value).then(Ai,Li);Rn((kn=kn.apply(Yt,Xt)).next())});function Ie(Yt){return be(this,null,function*(){return(0,ne.ZP)(`/api/examination_banks/${Yt}/edit_random_exam_new.json`,{method:"get"})})}function Re(Yt,Xt){return be(this,null,function*(){return(0,ne.ZP)(`/api/examination_banks/${Yt}/update_random_exam.json`,{method:"post",body:Xt})})}function rt(Yt){return be(this,null,function*(){return(0,ne.ZP)("/api/examination_banks/create_random_exam.json",{method:"post",body:Yt})})}function et(Yt){return be(this,null,function*(){return(0,ne.ZP)("/api/disciplines.json",{method:"get",params:Yt})})}function Ye(Yt){return be(this,null,function*(){return(0,ne.ZP)("/api/item_banks/item_difficulty_count.json",{method:"get",params:Yt})})}function ut(Yt,Xt){return be(this,null,function*(){return(0,ne.ZP)(`/api/examination_banks/${Yt}/set_item_type_score.json`,{method:"post",body:Xt})})}function tt(Yt,Xt){return be(this,null,function*(){return(0,ne.ZP)(`/api/exercises/${Yt}/set_item_type_score.json`,{method:"post",body:Xt})})}function wt(Yt,Xt){return be(this,null,function*(){return(0,ne.ZP)(`/api/examination_banks/${Yt}/delete_item_type.json`,{method:"post",body:Xt})})}function St(Yt,Xt){return be(this,null,function*(){return(0,ne.ZP)(`/api/exercises/${Yt}/delete_item_type.json`,{method:"post",body:Xt})})}function Lt(Yt){return be(this,null,function*(){return(0,ne.ZP)("/api/examination_banks/preview_random_questions.json",{method:"post",body:Yt})})}function mn(Yt){return be(this,null,function*(){return(0,ne.ZP)("/api/examination_banks/toggle_random_questions.json",{method:"post",body:Yt})})}function $t(Yt){return be(this,null,function*(){return(0,ne.ZP)("/api/examination_banks/save_question_list.json",{method:"post",body:Yt})})}function Pn(Yt){return be(this,null,function*(){return(0,ne.ZP)(`/api/exercises/${Yt.categoryId}/edit.json`,{method:"get",params:we({},Yt)})})}var Ot=(Yt=>(Yt.OnlyFileFolder="1",Yt.OnlyKnowledge="2",Yt.OnlyDifficulty="3",Yt.FileFolderAndDiff="4",Yt.FileFolderAndKnowledge="5",Yt.KnowledgeAndDiff="6",Yt.All="7",Yt.Shixun="8",Yt))(Ot||{}),ct=Le(89392),nt=Object.defineProperty,gn=Object.defineProperties,oi=Object.getOwnPropertyDescriptors,zn=Object.getOwnPropertySymbols,Ht=Object.prototype.hasOwnProperty,Fn=Object.prototype.propertyIsEnumerable,Cn=(Yt,Xt,kn)=>Xt in Yt?nt(Yt,Xt,{enumerable:!0,configurable:!0,writable:!0,value:kn}):Yt[Xt]=kn,ii=(Yt,Xt)=>{for(var kn in Xt||(Xt={}))Ht.call(Xt,kn)&&Cn(Yt,kn,Xt[kn]);if(zn)for(var kn of zn(Xt))Fn.call(Xt,kn)&&Cn(Yt,kn,Xt[kn]);return Yt},Wt=(Yt,Xt)=>gn(Yt,oi(Xt)),Hn=(Yt=>(Yt[Yt.FileFolder=1]="FileFolder",Yt[Yt.Difficulty=2]="Difficulty",Yt[Yt.Knowledge=3]="Knowledge",Yt))(Hn||{});const lt=(0,ue.createContext)(null),An={[Ot.OnlyFileFolder]:[1],[Ot.OnlyKnowledge]:[3],[Ot.OnlyDifficulty]:[2],[Ot.FileFolderAndDiff]:[1,2],[Ot.FileFolderAndKnowledge]:[1,3],[Ot.KnowledgeAndDiff]:[3,2],[Ot.All]:[3,2,1]},Ni=(Yt,Xt)=>{if(Yt.length!==Xt.length)return!1;for(const kn of Xt)if(!Yt.includes(kn))return!1;return!0},je=Yt=>{for(const[Xt,kn]of Object.entries(An))if(Ni(Yt,kn))return Xt},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"}},De=Yt=>Yt&&parseFloat(Yt.toFixed(1)),We=(Yt,Xt)=>{var kn,Zi,yi;switch(Xt.type){case"init":return Xt.payload;case"updateBaseInfo":return Wt(ii({},Yt),{examination_bank:Xt.payload});case"deleteQuestionType":{const{item_types:Ai}=Yt,Li=Ai.filter(Rn=>Rn.item_type!==Xt.payload);return Yt.examination_bank.question_count=De(Li.reduce((Rn,ri)=>Rn+ri.item_bank_count,0)),Yt.examination_bank.total_score=De(Li.reduce((Rn,ri)=>Rn+ri.total_score,0)),Wt(ii({},Yt),{item_types:Li})}case"setQuestionType":{const{item_types:Ai=[]}=Yt,Li=Ai.map(ri=>ri.item_type),Rn=Ai.filter(ri=>Xt.payload.includes(ri.item_type));for(const ri of Xt.payload)Li.includes(ri)||(ri==="PRACTICAL"?Rn.push({item_type:ri,contents:[],item_banks:[],item_bank_count:0,item_bank_num:0,item_type_text:Me[ri],random_rule_type:Ot.Shixun,score:0,total_score:0}):Rn.push({item_type:ri,contents:[],item_bank_count:0,item_type_text:Me[ri],score:0,total_score:0}));return Wt(ii({},Yt),{item_types:Rn})}case"updateItemTypes":return Wt(ii({},Yt),{item_types:Xt.payload});case"deleteRule":{const Ai=(0,ct.cloneDeep)(Yt),Li=Ai.item_types.find(ri=>ri.item_type===Xt.payload.itemType),Rn=Li.contents.find(ri=>ri.id===Xt.payload.id&&ri.is_share==Xt.payload.is_share);return Li.contents=Li.contents.filter(ri=>ri!==Rn),((kn=Li.contents)==null?void 0:kn.length)===0&&(Li.random_rule_type=[]),Li.item_bank_count-=Rn==null?void 0:Rn.quanlity,Ai.examination_bank.question_count-=Rn==null?void 0:Rn.quanlity,Li.total_score-=(Rn==null?void 0:Rn.quanlity)*Li.score,Ai.examination_bank.total_score-=(Rn==null?void 0:Rn.quanlity)*Li.score,Li.total_score=De(Li.total_score),Ai.examination_bank.total_score=De(Ai.examination_bank.total_score),Ai.contents=Li.contents,Ai}case"changeQuestionNum":{const Ai=(0,ct.cloneDeep)(Yt),Li=Ai.item_types.find(ea=>ea.item_type===Xt.payload.itemType),Rn=(Zi=Li==null?void 0:Li.contents)==null?void 0:Zi.find(ea=>ea.id===Xt.payload.id);if(Xt.payload.itemType==="PRACTICAL")return Xt.payload.num&&(Ai.examination_bank.question_count=Ai.examination_bank.question_count-Li.item_bank_count+Xt.payload.num,Ai.examination_bank.total_score=De(Ai.examination_bank.total_score-Li.total_score+Xt.payload.num*Li.score)),Xt.payload.score&&(Ai.examination_bank.total_score=De(Ai.examination_bank.total_score-Li.total_score+Xt.payload.num*Li.score)),Li.item_bank_count=Xt.payload.num,Li.total_score=De(Li.item_bank_count*Li.score),Ai;Ai.examination_bank.question_count=Ai.examination_bank.question_count-(Rn==null?void 0:Rn.quanlity)+Xt.payload.num;const ri=Li.contents.find(ea=>ea.id===Xt.payload.id&&ea.teacher_group_id===Xt.payload.teacher_group_id);ri.quanlity=Xt.payload.num;let ir=0,Rr=0;for(const ea of Li.contents)ir+=ea==null?void 0:ea.quanlity,Rr+=(ea==null?void 0:ea.quanlity)*Li.score;return Ai.examination_bank.total_score=De(Ai.examination_bank.total_score-Li.total_score+Rr),Li.item_bank_count=ir,Li.total_score=De(Rr),Ai}case"changeQuestionScore":{const Ai=(0,ct.cloneDeep)(Yt),Li=Ai.item_types.find(Rn=>Rn.item_type===Xt.payload.itemType);return Li.score=Xt.payload.score,Li.total_score=De(Li.item_bank_count*Li.score),Ai.examination_bank.total_score=De(Ai.item_types.reduce((Rn,ri)=>Rn+ri.total_score,0)),Ai}case"editRule":{const Ai=(0,ct.cloneDeep)(Yt),Li=Ai.item_types.find(Rn=>Rn.item_type===Xt.payload.itemType);return Li.contents=Xt.payload.tableData.map(Rn=>Wt(ii({},Rn),{item_type:Xt.payload.itemType,random_rule_type:Xt.payload.randomRuleType})),Li.random_rule_type=Xt.payload.randomRuleType,Li.item_bank_count=Li.contents.reduce((Rn,ri)=>Rn+(ri==null?void 0:ri.quanlity),0),Li.score=Li.score||1,Li.total_score=De(Li.item_bank_count*Li.score),Ai.examination_bank.question_count=Ai.item_types.reduce((Rn,ri)=>Rn+ri.item_bank_count,0),Ai.examination_bank.total_score=De(Ai.item_types.reduce((Rn,ri)=>Rn+ri.total_score,0)),Ai}case"addShixun":{const Ai=(0,ct.cloneDeep)(Yt),Li=Ai.item_types.find(Rn=>Rn.item_type==="PRACTICAL");return Li.item_banks=Xt.payload.shixunList,Ai.examination_bank.question_count=Ai.examination_bank.question_count+1,Li.item_bank_num=Li.item_banks.length,Li.item_bank_count=Li.item_bank_count||1,Li.score=Li.score||1,Li.total_score=Li.total_score||Li.score*Li.item_bank_count,Ai.examination_bank.total_score=(yi=Ai==null?void 0:Ai.item_types)==null?void 0:yi.map(Rn=>Rn.total_score).reduce((Rn,ri)=>Rn+ri),Ai}case"deleteShixunQuestion":{const Ai=(0,ct.cloneDeep)(Yt),Li=Ai.item_types.find(Rn=>Rn.item_type==="PRACTICAL");return Li.item_banks=Li.item_banks.filter(Rn=>Rn.id!==Xt.payload.shixunId),Li.item_bank_num-=1,Li.item_bank_count>Li.item_bank_num&&(Li.item_bank_count-=1,Li.total_score-=Li.score,Li.total_score=De(Li.total_score)),Ai}}};var Ae=Le(86918),Je=Object.defineProperty,Nt=Object.defineProperties,fn=Object.getOwnPropertyDescriptors,vn=Object.getOwnPropertySymbols,Ft=Object.prototype.hasOwnProperty,Jt=Object.prototype.propertyIsEnumerable,jt=(Yt,Xt,kn)=>Xt in Yt?Je(Yt,Xt,{enumerable:!0,configurable:!0,writable:!0,value:kn}):Yt[Xt]=kn,pn=(Yt,Xt)=>{for(var kn in Xt||(Xt={}))Ft.call(Xt,kn)&&jt(Yt,kn,Xt[kn]);if(vn)for(var kn of vn(Xt))Jt.call(Xt,kn)&&jt(Yt,kn,Xt[kn]);return Yt},jn=(Yt,Xt)=>Nt(Yt,fn(Xt)),Nn=(Yt,Xt,kn)=>new Promise((Zi,yi)=>{var Ai=ri=>{try{Rn(kn.next(ri))}catch(ir){yi(ir)}},Li=ri=>{try{Rn(kn.throw(ri))}catch(ir){yi(ir)}},Rn=ri=>ri.done?Zi(ri.value):Promise.resolve(ri.value).then(Ai,Li);Rn((kn=kn.apply(Yt,Xt)).next())}),fr=({courseOptions:Yt,setCurrentKey:Xt,loading:kn,form:Zi})=>{const{data:yi,disabled:Ai,dispatch:Li}=(0,ue.useContext)(lt),Rn=(0,Oe.useParams)(),ri=(0,ue.useRef)(!0),[ir,Rr]=(0,ue.useState)(!1),ea=(0,ue.useMemo)(()=>{var _o,Pa,xa,vo,Kr;if(!Yt.length||!yi)return;const er=(_o=yi==null?void 0:yi.examination_bank)==null?void 0:_o.sub_discipline_id,ia=((Pa=yi==null?void 0:yi.examination_bank)==null?void 0:Pa.time)===-1?void 0:ri.current?Rn.id?(xa=yi==null?void 0:yi.examination_bank)==null?void 0:xa.time:((vo=yi==null?void 0:yi.examination_bank)==null?void 0:vo.time)||60:(Kr=yi==null?void 0:yi.examination_bank)==null?void 0:Kr.time;ri.current=!1;let sa=[];for(const Ma of Yt)for(const Oa of Ma.children)Oa.value===er&&(sa=[Ma.value,Oa.value]);return jn(pn({},yi.examination_bank),{time:ia,course:sa})},[yi,Yt]);return(0,ue.useEffect)(()=>{Zi.setFieldsValue(pn({},ea))},[ea]),ue.createElement(Ct.Z,{spinning:kn,size:"large",style:{position:"fixed",maxHeight:"100vh"},className:"mt30"},ue.createElement("div",{className:Ke.formWrap},ue.createElement(yt.default,{form:Zi,autoComplete:"off",colon:!1,labelCol:{span:4},wrapperCol:{span:20},initialValues:ea||{difficulty:2,time:60},onValuesChange:(_o,Pa)=>{const{course:xa=[]}=Pa,vo=jn(pn({},Pa),{sub_discipline_id:xa[1]||0});Li({type:"updateBaseInfo",payload:vo})}},ue.createElement(yt.default.Item,{name:"name",label:"\u8BD5\u5377\u540D\u79F0",className:Ke.baseLineHeight,rules:[{required:!0,validator:(_o,Pa)=>{var xa;return((xa=Pa==null?void 0:Pa.replaceAll(" ",""))==null?void 0:xa.length)>0?Promise.resolve():Promise.reject("\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0")}}]},ue.createElement(dt.default,{maxLength:60,className:Ke.baseFormItem,placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u540D\u79F0",showCount:!0})),ue.createElement(yt.default.Item,{label:"\u65B9\u5411&\u8BFE\u7A0B",name:"course",className:Ke.baseLineHeight},ue.createElement(Ge.Z,{className:Ke.baseFormItem,disabled:Ai,size:"large",allowClear:!1,placeholder:"\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B",options:Yt,dropdownMenuColumnStyle:{padding:"8px 12px",fontSize:14}})),ue.createElement("div",{className:Ke.concat},"\u6CA1\u6709\u5408\u9002\u7684\u65B9\u5411&\u8BFE\u7A0B\uFF1F",ue.createElement("span",{onClick:()=>Rr(!0)},"\u8054\u7CFB\u6559\u7814\u52A9\u7406")),ue.createElement(yt.default.Item,{label:"\u96BE\u5EA6",name:"difficulty",className:Ke.radioBtnWrapper,rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},ue.createElement(Rt.ZP.Group,{disabled:Ai,className:Ke.radiogroup},ue.createElement(Rt.ZP.Button,{className:Ke.easy,value:1},"\u7B80\u5355"),ue.createElement(Rt.ZP.Button,{className:Ke.medium,value:2},"\u9002\u4E2D"),ue.createElement(Rt.ZP.Button,{className:Ke.hard,value:3},"\u56F0\u96BE"))),ue.createElement(yt.default.Item,{label:"\u7B54\u9898\u65F6\u957F",className:Ke.baseLineHeight},ue.createElement(ot.Z,{align:"middle"},ue.createElement(yt.default.Item,{name:"time",noStyle:!0},ue.createElement(At.Z,{className:Ke.baseFormItem,min:1,disabled:Ai,size:"large",max:9999,style:{width:220},placeholder:"\u8BF7\u586B\u5199\u7B54\u9898\u65F6\u957F"})),ue.createElement("span",{style:{marginLeft:"10px",width:"40px",lineHeight:"46px",fontSize:14}},"\u5206\u949F"))),ue.createElement(yt.default.Item,{label:"\u8BD5\u5377\u987B\u77E5",name:"exam_notes"},ue.createElement(dt.default.TextArea,{rows:6,disabled:Ai,maxLength:65535,placeholder:"\u8BF7\u8F93\u5165\u8BD5\u5377\u987B\u77E5"})))),ue.createElement("div",{className:Ke.fixedBottom},ue.createElement(Te.ZP,{className:`${Ke.cancelBtn} mr5`,onClick:()=>{Rn.id||window.location.href.indexOf("randompaper")>-1?Oe.history.push("/paperlibrary"):Oe.history.push(`/classrooms/${Rn.coursesId}/exercise`)}},"\u53D6\u6D88"),ue.createElement(Te.ZP,{className:`${Ke.confirmBtn} ml15`,type:"primary",size:"large",onClick:()=>Nn(void 0,null,function*(){if(yield Zi.validateFields(),!Rn.id&&!Rn.coursesId){const _o=yield rt(yi);_o.status===0&&(Oe.history.replace(`/randompaper/edit/${_o==null?void 0:_o.examination_bank_id}?type=settings`),Xt("settings"))}else Xt("settings")})},"\u4E0B\u4E00\u6B65")),ue.createElement(Ae.Z,{open:ir,onCancel:()=>{Rr(!1)}}))},nn=Le(62957),tn=Le(5269),hn={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(8797),Sn=Le(85057),Kt=Le(62673);const gi=[{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 Pi=({open:Yt,onCancel:Xt,onOk:kn})=>{const{data:Zi,dispatch:yi}=(0,ue.useContext)(lt);(0,ue.useEffect)(()=>{if(Yt){const{item_types:Rn}=Zi||{};Li(Rn==null?void 0:Rn.map(ri=>ri.item_type))}},[Yt,Zi]);const[Ai,Li]=(0,ue.useState)([]);return ue.createElement(nn.default,{title:ue.createElement("div",null,"\u9898\u578B\u8BBE\u7F6E",ue.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:Yt,onCancel:Xt,onOk:()=>kn(Ai)},ue.createElement(Kt.default.Group,{value:Ai,onChange:Rn=>Li(Rn)},ue.createElement(ot.Z,{gutter:[0,20]},gi.map(Rn=>ue.createElement(tn.Z,{key:Rn.value,span:6},ue.createElement(Kt.default,{value:Rn.value},Rn.label))))))},Ii=Le(54172),Fr=Object.defineProperty,$n=Object.getOwnPropertySymbols,In=Object.prototype.hasOwnProperty,si=Object.prototype.propertyIsEnumerable,Ti=(Yt,Xt,kn)=>Xt in Yt?Fr(Yt,Xt,{enumerable:!0,configurable:!0,writable:!0,value:kn}):Yt[Xt]=kn,Oi=(Yt,Xt)=>{for(var kn in Xt||(Xt={}))In.call(Xt,kn)&&Ti(Yt,kn,Xt[kn]);if($n)for(var kn of $n(Xt))si.call(Xt,kn)&&Ti(Yt,kn,Xt[kn]);return Yt},xr=({open:Yt,onCancel:Xt,onOk:kn})=>{const{data:Zi}=(0,ue.useContext)(lt),[yi,Ai]=(0,ue.useState)();console.log("--xxx-",yi),(0,ue.useEffect)(()=>{Yt&&Ai((0,ct.cloneDeep)(Zi))},[Yt,Zi]);const Li=(0,ue.useMemo)(()=>{var Rn;let ri;return ri=(Rn=yi==null?void 0:yi.item_types)==null?void 0:Rn.map(ir=>ir.total_score).reduce((ir,Rr)=>parseFloat(ir)+parseFloat(Rr)),ri==null?void 0:ri.toFixed(1)},[yi]);return Yt?ue.createElement(nn.default,{title:"\u6279\u91CF\u8BBE\u7F6E\u5206\u503C",open:Yt,width:640,centered:!0,closable:!0,onCancel:Xt,onOk:()=>{kn(yi)}},ue.createElement("div",{className:"c-black mb20"},"\u603B\u5206",ue.createElement("span",{className:"ml10 c-light-primary"},Li)),ue.createElement(Ii.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(Rn,ri){const{score:ir,item_type:Rr}=ri;return ue.createElement("div",{style:{color:"#9096A3"}},"\u6BCF",((ri==null?void 0:ri.item_type)==="PRACTICAL","\u9898"),ue.createElement(At.Z,{precision:1,size:"large",className:"ml10 mr10",min:.1,disabled:(ri==null?void 0:ri.item_bank_count)===0,max:100,onChange:ea=>{const _o=yi,Pa=_o.item_types.find(vo=>vo.item_type===Rr);Pa.score=Number(ea);const xa=ea*Pa.item_bank_count;Pa.total_score=xa&&Number(xa.toFixed(1)),_o.examination_bank.total_score=_o.item_types.reduce((vo,Kr)=>Number(vo)+Number(Kr.total_score),0),Ai(Oi({},_o))}}),"\u5206")}}],className:hn.setScoreModalTable,dataSource:yi==null?void 0:yi.item_types,rowKey:"item_type",pagination:!1})):null},Ce=Le(20554),_n=Le(82326),ci=Le(18287),ar="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=",_r="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==",$r="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",po="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==",fi={ruleCheckBox:"ruleCheckBox___Onj2f",folderAreaWrapper:"folderAreaWrapper___ut2mr",folderAreaHeader:"folderAreaHeader___fOIDA",folderWrapper:"folderWrapper___IpJ50",folderIcon:"folderIcon___zBoRM",shareFolderIcon:"shareFolderIcon____5s3p",treeNodeItem:"treeNodeItem___quqla",treeNodeDifficulty:"treeNodeDifficulty___en0gk"},Qn=Le(16149),Bt=Object.defineProperty,Tt=Object.defineProperties,kt=Object.getOwnPropertyDescriptors,ui=Object.getOwnPropertySymbols,Yn=Object.prototype.hasOwnProperty,vi=Object.prototype.propertyIsEnumerable,yn=(Yt,Xt,kn)=>Xt in Yt?Bt(Yt,Xt,{enumerable:!0,configurable:!0,writable:!0,value:kn}):Yt[Xt]=kn,Kn=(Yt,Xt)=>{for(var kn in Xt||(Xt={}))Yn.call(Xt,kn)&&yn(Yt,kn,Xt[kn]);if(ui)for(var kn of ui(Xt))vi.call(Xt,kn)&&yn(Yt,kn,Xt[kn]);return Yt},It=(Yt,Xt)=>Tt(Yt,kt(Xt)),_t=(Yt,Xt,kn)=>new Promise((Zi,yi)=>{var Ai=ri=>{try{Rn(kn.next(ri))}catch(ir){yi(ir)}},Li=ri=>{try{Rn(kn.throw(ri))}catch(ir){yi(ir)}},Rn=ri=>ri.done?Zi(ri.value):Promise.resolve(ri.value).then(Ai,Li);Rn((kn=kn.apply(Yt,Xt)).next())});const hi=(Yt,Xt,kn)=>Yt.map(Zi=>Zi.key===Xt?Kn(Kn({},Zi),kn):Zi.children?It(Kn({},Zi),{children:hi(Zi.children,Xt,kn)}):Zi),it={\u7B80\u5355:1,\u9002\u4E2D:2,\u56F0\u96BE:3},sn=(Yt,Xt,kn)=>Yt.map(Zi=>{var yi;const Ai=Zi==null?void 0:Zi.tag_disciplines.map(Rn=>{const ri=Rn==null?void 0:Rn.difficulty_count.map(ir=>({label:ir==null?void 0:ir.name,value:it[ir.name]}));return{title:je(Xt)===Ot.All&&ri.length>0?ue.createElement(ot.Z,{justify:"space-between"},ue.createElement(tn.Z,null,`${Rn.name}\uFF08${Rn.child_count}\uFF09`),ue.createElement(tn.Z,null,ue.createElement("span",{className:"mr15",style:{color:"#666"}},"\u96BE\u5EA6"),ue.createElement(yt.default.Item,{noStyle:!0,name:[`${Zi.id}_${Rn.id}`,"diffValue"]},ue.createElement(Kt.default.Group,{style:{columnGap:12},options:ri})),ue.createElement(yt.default.Item,{noStyle:!0,name:[`${Zi.id}_${Rn.id}`,"diffNum"],initialValue:Rn==null?void 0:Rn.difficulty_count},ue.createElement("input",{type:"hidden"})),ue.createElement(yt.default.Item,{noStyle:!0,name:[`${Zi.id}_${Rn.id}`,"extra"],initialValue:It(Kn({},Zi),{type:kn})},ue.createElement("input",{type:"hidden"})))):`${Rn.name}\uFF08${Rn.child_count}\uFF09`,key:`${Zi.id}_${Rn.id}`,name:Rn.name,parentName:Zi.name,item_banks_count:Rn.child_count,icon:null,isLeaf:!0,checkable:je(Xt)===Ot.FileFolderAndKnowledge,disableCheckbox:Rn.child_count===0}}),Li=Zi==null?void 0:Zi.difficulty_count.map(Rn=>({label:Rn==null?void 0:Rn.name,value:it[Rn.name]}));return{title:je(Xt)===Ot.FileFolderAndDiff&&Li.length>0?ue.createElement(ot.Z,{justify:"space-between"},ue.createElement(tn.Z,null,`${Zi.name}\uFF08${Zi.item_banks_count}\uFF09`),ue.createElement(tn.Z,null,ue.createElement("span",{className:"mr15",style:{color:"#666"}},"\u96BE\u5EA6"),ue.createElement(yt.default.Item,{noStyle:!0,name:[`${Zi.id}`,"diffValue"]},ue.createElement(Kt.default.Group,{style:{columnGap:12},options:Li})),ue.createElement(yt.default.Item,{noStyle:!0,name:[`${Zi.id}`,"diffNum"],initialValue:Zi==null?void 0:Zi.difficulty_count},ue.createElement("input",{type:"hidden"})),ue.createElement(yt.default.Item,{noStyle:!0,name:[`${Zi.id}`,"extra"],initialValue:It(Kn({},Zi),{type:kn})},ue.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:Rn=>Rn.expanded?kn==="0"?ue.createElement("img",{src:_r,className:fi.folderIcon}):ue.createElement("img",{src:$r,className:fi.shareFolderIcon}):kn==="0"?ue.createElement("img",{src:ar,className:fi.folderIcon}):ue.createElement("img",{src:po,className:fi.shareFolderIcon}),isLeaf:!Zi.have_child&&!((yi=Zi.tag_disciplines)!=null&&yi.length),checkable:je(Xt)===Ot.OnlyFileFolder,disableCheckbox:Zi.item_banks_count===0,children:Zi.children.length?je(Xt)===Ot.All||je(Xt)===Ot.FileFolderAndKnowledge?[...sn(Zi.children,Xt,kn),...Ai]:sn(Zi.children,Xt,kn):[]}}),Dn=(Yt,Xt,kn)=>Yt.map(Zi=>{var yi;const Ai=Zi==null?void 0:Zi.tag_disciplines.map(Rn=>{console.log("tagItem:",Rn);const ri=Rn==null?void 0:Rn.difficulty_count.map(ir=>({label:ir==null?void 0:ir.name,value:it[ir.name]}));return{title:je(Xt)===Ot.All&&ri.length>0?ue.createElement(ot.Z,{justify:"space-between"},ue.createElement(tn.Z,null,`${Rn.name}\uFF08${Rn.child_count}\uFF09`),ue.createElement(tn.Z,null,ue.createElement("span",{className:"mr15",style:{color:"#666"}},"\u96BE\u5EA6"),ue.createElement(yt.default.Item,{noStyle:!0,name:[`${Zi.id}_${Rn.id}`,"diffValue"]},ue.createElement(Kt.default.Group,{style:{columnGap:12},options:ri})),ue.createElement(yt.default.Item,{noStyle:!0,name:[`${Zi.id}_${Rn.id}`,"diffNum"],initialValue:Rn==null?void 0:Rn.difficulty_count},ue.createElement("input",{type:"hidden"})),ue.createElement(yt.default.Item,{noStyle:!0,name:[`${Zi.id}_${Rn.id}`,"extra"],initialValue:It(Kn({},Zi),{type:kn})},ue.createElement("input",{type:"hidden"})))):`${Rn.name}\uFF08${Rn.child_count}\uFF09`,key:`${Zi.id}_${Rn.id}`,name:Rn.name,parentName:Zi.name,item_banks_count:Rn.child_count,icon:null,isLeaf:!0,checkable:je(Xt)===Ot.FileFolderAndKnowledge,disableCheckbox:Rn.child_count===0}}),Li=Zi==null?void 0:Zi.difficulty_count.map(Rn=>({label:Rn==null?void 0:Rn.name,value:it[Rn.name]}));return{title:je(Xt)===Ot.FileFolderAndDiff&&Li.length>0?ue.createElement(ot.Z,{justify:"space-between"},ue.createElement(tn.Z,null,`${Zi.name}\uFF08${Zi.item_banks_count}\uFF09`),ue.createElement(tn.Z,null,ue.createElement("span",{className:"mr15",style:{color:"#666"}},"\u96BE\u5EA6"),ue.createElement(yt.default.Item,{noStyle:!0,name:[`${Zi.id}`,"diffValue"]},ue.createElement(Kt.default.Group,{style:{columnGap:12},options:Li})),ue.createElement(yt.default.Item,{noStyle:!0,name:[`${Zi.id}`,"diffNum"],initialValue:Zi==null?void 0:Zi.difficulty_count},ue.createElement("input",{type:"hidden"})),ue.createElement(yt.default.Item,{noStyle:!0,name:[`${Zi.id}`,"extra"],initialValue:It(Kn({},Zi),{type:kn})},ue.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:Rn=>Rn.expanded?kn==="0"?ue.createElement("img",{src:_r,className:fi.folderIcon}):ue.createElement("img",{src:$r,className:fi.shareFolderIcon}):kn==="0"?ue.createElement("img",{src:ar,className:fi.folderIcon}):ue.createElement("img",{src:po,className:fi.shareFolderIcon}),isLeaf:!Zi.have_child&&!((yi=Zi.tag_disciplines)!=null&&yi.length),checkable:je(Xt)===Ot.OnlyFileFolder,disableCheckbox:Zi.item_banks_count===0,children:[...Dn(Zi.children,Xt,kn),...Ai]}});var cn=({ruleValue:Yt,defaultData:Xt,setSelectData:kn,currentItemType:Zi,selectData:yi})=>{const[Ai,Li]=(0,ue.useState)("1"),[Rn,ri]=(0,ue.useState)(!0),[ir]=yt.default.useForm(),[Rr,ea]=(0,ue.useState)([]),[_o,Pa]=(0,ue.useState)("all"),xa=(Dt,Xi,Mr)=>{const{checkedNodes:Qi}=Xi;console.log("type:",Mr,Qi,yi),Mr==="0"?(Kr(Dt),je(Yt)===Ot.OnlyFileFolder?(kn($i=>It(Kn({},$i),{my:Qi.map(wi=>({id:wi.key,group_id:wi.key,group_name:wi.name,item_bank_num:wi.item_banks_count,folderType:"0",quanlity:1}))})),He(Qi.reduce(($i,wi)=>$i+wi.item_banks_count,0))):(console.log(Qi),kn($i=>It(Kn({},$i),{my:Qi.map(wi=>{const[pr,Hr]=wi.key.split("_");return{id:wi.key,tag_discipline_name:wi.name,group_id:pr,tag_discipline_id:Hr,folderType:"0",group_name:wi.parentName,item_bank_num:wi.item_banks_count,quanlity:1}})})),He(Qi.reduce(($i,wi)=>$i+wi.item_banks_count,0)))):(ia(Dt),je(Yt)===Ot.OnlyFileFolder?kn($i=>(console.log("pre:",$i),It(Kn({},$i),{public:Qi.map(wi=>({id:wi.key==="0"?"00":wi.key,teacher_group_name:wi.name,teacher_group_id:wi.key,folderType:"3",item_bank_num:wi.item_banks_count,quanlity:1}))}))):kn($i=>It(Kn({},$i),{public:Qi.map(wi=>{const[pr,Hr]=wi.key.split("_");return{id:wi.key==="0"?"00":wi.key,tag_discipline_name:wi.name,teacher_group_id:pr,tag_discipline_id:Hr,folderType:"3",teacher_group_name:wi.parentName,item_bank_num:wi.item_banks_count,quanlity:1}})})),He(Qi.reduce(($i,wi)=>$i+wi.item_banks_count,0)))},[vo,Kr]=(0,ue.useState)([]),[er,ia]=(0,ue.useState)([]),[sa,Ma]=(0,ue.useState)([]),[Oa,Oo]=(0,ue.useState)([]),[ua,Lo]=(0,ue.useState)([]),[jr,oo]=(0,ue.useState)([]),[Yr,wo]=(0,ue.useState)(!1),[Ra,Ha]=(0,ue.useState)(!1);function Mt(){return _t(this,null,function*(){let Dt=yield(0,ne.ZP)("/api/teach_group_shares.json",{method:"get"});Dt&&ea(Dt==null?void 0:Dt.groups)})}(0,ue.useEffect)(()=>{Mt()},[]);const Pt=Dt=>_t(void 0,null,function*(){var Xi,Mr,Qi,$i,wi,pr,Hr,no,lr,cr,yr,_i;Dt.type==="0"?wo(!0):Ha(!0);const Ci=yield(0,Qn.ex)(Dt);Dt.type==="0"?wo(!1):Ha(!1),Dt.type==="0"?Lo(Ci):oo(Ci);const Dr=(Xi=Ci.navigation[0])==null?void 0:Xi.difficulty_count.map(br=>({label:br==null?void 0:br.name,value:it[br.name]})),ko=(Mr=Ci.navigation[0])==null?void 0:Mr.tag_disciplines.map(br=>{const Cr=br==null?void 0:br.difficulty_count.map(Nr=>({label:Nr==null?void 0:Nr.name,value:it[Nr.name]}));return{title:je(Yt)===Ot.All&&Cr.length>0?ue.createElement(ot.Z,{justify:"space-between",style:{color:"#232B40"}},ue.createElement(tn.Z,null,`${br.name}\uFF08${br.child_count}\uFF09`),ue.createElement(tn.Z,null,ue.createElement("span",{className:"mr15",style:{color:"#666"}},"\u96BE\u5EA6"),ue.createElement(yt.default.Item,{noStyle:!0,name:[`0_${br.id}`,"diffValue"]},ue.createElement(Kt.default.Group,{style:{columnGap:12},options:Cr})),ue.createElement(yt.default.Item,{noStyle:!0,name:[`0_${br.id}`,"diffNum"],initialValue:br==null?void 0:br.difficulty_count},ue.createElement("input",{type:"hidden"})),ue.createElement(yt.default.Item,{noStyle:!0,name:[`0_${br.id}`,"extra"],initialValue:{tag_discipline_name:br.name,name:"\u6839\u76EE\u5F55",type:Dt.type}},ue.createElement("input",{type:"hidden"})))):ue.createElement("span",{style:{color:"#232B40"}},br.name,"\uFF08",br.child_count,"\uFF09"),key:`0_${br.id}`,name:br.name,parentName:"\u6839\u76EE\u5F55",item_banks_count:br.child_count,icon:null,isLeaf:!0,checkable:je(Yt)===Ot.FileFolderAndKnowledge,disableCheckbox:br.child_count===0}});if(Dt.type==="0"){const br=sn(Ci.data,Yt,"0"),Cr=Dn(Ci.data,Yt,"0");console.log("normalChildren2:",Cr),Ma([{title:je(Yt)===Ot.FileFolderAndDiff?ue.createElement(ot.Z,{justify:"space-between",style:{color:"#232B40"}},ue.createElement(tn.Z,null,`\u6839\u76EE\u5F55\uFF08${(Qi=Ci.navigation[0])==null?void 0:Qi.child_count}\uFF09`),ue.createElement(tn.Z,null,ue.createElement("span",{className:"mr15",style:{color:"#666"}},"\u96BE\u5EA6"),ue.createElement(yt.default.Item,{noStyle:!0,name:["0","diffValue"],initialValue:[]},ue.createElement(Kt.default.Group,{style:{columnGap:12},options:Dr})),ue.createElement(yt.default.Item,{noStyle:!0,name:["0","diffNum"],initialValue:($i=Ci.navigation[0])==null?void 0:$i.difficulty_count},ue.createElement("input",{type:"hidden"})),ue.createElement(yt.default.Item,{noStyle:!0,name:["0","extra"],initialValue:{type:"0",group_id:"0",name:"\u6839\u76EE\u5F55"}},ue.createElement("input",{type:"hidden"})))):ue.createElement("span",{style:{color:"#232B40"}},`\u6839\u76EE\u5F55\uFF08${(wi=Ci.navigation[0])==null?void 0:wi.child_count}\uFF09`),key:"0",name:"\u6839\u76EE\u5F55",item_banks_count:(pr=Ci.navigation[0])==null?void 0:pr.child_count,disabled:!(((Hr=Ci.navigation[0])==null?void 0:Hr.child_count)>0),checkable:je(Yt)===Ot.OnlyFileFolder,icon:Nr=>Nr.expanded?ue.createElement("img",{src:_r,className:fi.folderIcon}):ue.createElement("img",{src:ar,className:fi.folderIcon}),isLeaf:!1,children:je(Yt)===Ot.OnlyFileFolder||je(Yt)===Ot.FileFolderAndDiff?br:[...Cr,...ko]}])}else{const br=sn(Ci.data,Yt,"3");Oo([{title:je(Yt)===Ot.FileFolderAndDiff?ue.createElement(ot.Z,{justify:"space-between"},ue.createElement(tn.Z,null,`\u6839\u76EE\u5F55\uFF08${(no=Ci.navigation[0])==null?void 0:no.child_count}\uFF09`),ue.createElement(tn.Z,null,ue.createElement("span",{className:"mr15",style:{color:"#666"}},"\u96BE\u5EA6"),ue.createElement(yt.default.Item,{noStyle:!0,name:["0","diffValue"]},ue.createElement(Kt.default.Group,{style:{columnGap:12},options:Dr})),ue.createElement(yt.default.Item,{noStyle:!0,name:["0","diffNum"],initialValue:(lr=Ci.navigation[0])==null?void 0:lr.difficulty_count},ue.createElement("input",{type:"hidden"})),ue.createElement(yt.default.Item,{noStyle:!0,name:["0","extra"],initialValue:{type:"3",group_id:"0",name:"\u6839\u76EE\u5F55"}},ue.createElement("input",{type:"hidden"})))):ue.createElement("span",{style:{color:"#232B40"}},`\u6839\u76EE\u5F55\uFF08${(cr=Ci.navigation[0])==null?void 0:cr.child_count}\uFF09`),key:"0",name:"\u6839\u76EE\u5F55",item_banks_count:(yr=Ci.navigation[0])==null?void 0:yr.child_count,checkable:je(Yt)===Ot.OnlyFileFolder,icon:Cr=>Cr.expanded?ue.createElement("img",{src:$r,className:fi.shareFolderIcon}):ue.createElement("img",{src:po,className:fi.shareFolderIcon}),isLeaf:!1,disabled:!(((_i=Ci.navigation[0])==null?void 0:_i.child_count)>0),children:je(Yt)===Ot.OnlyFileFolder||je(Yt)===Ot.FileFolderAndDiff?br:[...br,...ko]}])}});(0,ue.useEffect)(()=>{Ai==="1"?Pt({type:"0",group_id:0,item_type:Zi,show_children:!0}):Ai==="2"&&Pt({type:"3",except_mine:!0,item_type:Zi,show_children:!0,teach_group_id:_o==="all"?"":_o})},[Yt,Ai,_o]),(0,ue.useEffect)(()=>{var Dt,Xi,Mr,Qi,$i,wi,pr,Hr,no,lr,cr,yr;console.log("selectData-active:",yi,Xt,Ai),Ai==="1"?(Kr((Dt=yi==null?void 0:yi.my)==null?void 0:Dt.map(_i=>_i.id)),He(((Mr=(Xi=yi==null?void 0:yi.my)==null?void 0:Xi.reduce)==null?void 0:Mr.call(Xi,(_i,Ci)=>_i+Ci.item_bank_num,0))||0)):Ai==="2"&&(ia((Qi=yi==null?void 0:yi.public)==null?void 0:Qi.map(_i=>_i.id)),He(((wi=($i=yi==null?void 0:yi.public)==null?void 0:$i.reduce)==null?void 0:wi.call($i,(_i,Ci)=>_i+Ci.item_bank_num,0))||0)),je(Yt)===Ot.All&&(Ai==="1"?(Kr((pr=yi==null?void 0:yi.my)==null?void 0:pr.map(_i=>_i.id)),He((yi==null?void 0:yi.filter(_i=>!_i.is_share).reduce((_i,Ci)=>_i+Ci.item_bank_num,0))||0),(Hr=yi==null?void 0:yi.filter(_i=>!_i.is_share))==null||Hr.forEach(_i=>{const Ci=ir.getFieldValue([`${_i.group_id||0}_${_i.tag_discipline_id}`,"diffValue"])||[];console.log("prev:",Ci),Ci!=null&&Ci.includes[_i.difficulty]||ir.setFieldValue([`${_i.group_id||0}_${_i.tag_discipline_id}`,"diffValue"],Array.from(new Set([...Ci,_i.difficulty])))})):Ai==="2"&&(ia((no=yi==null?void 0:yi.public)==null?void 0:no.map(_i=>_i.id)),He((yi==null?void 0:yi.filter(_i=>!!_i.is_share).reduce((_i,Ci)=>_i+Ci.item_bank_num,0))||0),(lr=yi==null?void 0:yi.filter(_i=>!!_i.is_share))==null||lr.forEach(_i=>{const Ci=ir.getFieldValue([`${_i.teacher_group_id||0}_${_i.tag_discipline_id}`,"diffValue"])||[];Ci!=null&&Ci.includes[_i.difficulty]||ir.setFieldValue([`${_i.teacher_group_id||0}_${_i.tag_discipline_id}`,"diffValue"],Array.from(new Set([...Ci,_i.difficulty])))}))),je(Yt)===Ot.FileFolderAndDiff&&(ir.resetFields(),setTimeout(()=>{kn(yi)},300),Ai==="1"?(He((yi==null?void 0:yi.filter(_i=>!_i.is_share).reduce((_i,Ci)=>_i+Ci.item_bank_num,0))||0),(cr=yi==null?void 0:yi.filter(_i=>!_i.is_share))==null||cr.forEach(_i=>{const Ci=ir.getFieldValue([`${_i.group_id}`,"diffValue"])||[];console.log("prev:",Ci),Ci!=null&&Ci.includes[_i.difficulty]||ir.setFieldValue([`${_i.group_id}`,"diffValue"],Array.from(new Set([...Ci,_i.difficulty])))})):(He((yi==null?void 0:yi.filter(_i=>!!_i.is_share).reduce((_i,Ci)=>_i+Ci.item_bank_num,0))||0),(yr=yi==null?void 0:yi.filter(_i=>!!_i.is_share))==null||yr.forEach(_i=>{const Ci=ir.getFieldValue([`${_i.teacher_group_id}`,"diffValue"])||[];Ci!=null&&Ci.includes[_i.difficulty]||ir.setFieldValue([`${_i.teacher_group_id}`,"diffValue"],Array.from(new Set([...Ci,_i.difficulty])))})))},[Ai]),console.log("1111111111:",vo,er),(0,ue.useEffect)(()=>{setTimeout(()=>{var Dt,Xi,Mr,Qi,$i;switch(je(Yt)){case Ot.OnlyFileFolder:{const wi=[],pr=[];for(const Hr of yi.my||[])wi.push(Hr);for(const Hr of yi.public||[])pr.push(Hr);Kr(wi.map(Hr=>`${Hr.group_id}`)),ia(pr.map(Hr=>`${Hr.teacher_group_id}`)),He(Ai==="1"?wi.reduce((Hr,no)=>Hr+no.item_bank_num,0):pr.reduce((Hr,no)=>Hr+no.item_bank_num,0));break}case Ot.FileFolderAndKnowledge:{const wi=[],pr=[];for(const Hr of(yi==null?void 0:yi.my)||[])wi.push(Hr);for(const Hr of(yi==null?void 0:yi.public)||[])pr.push(Hr);He((Dt=Ai==="1"?wi:pr)==null?void 0:Dt.reduce((Hr,no)=>Hr+no.item_bank_num,0)),Kr(wi.map(Hr=>`${Hr.group_id}_${Hr.tag_discipline_id}`)),ia(pr.map(Hr=>`${Hr.teacher_group_id}_${Hr.tag_discipline_id}`));break}case Ot.All:{Ai==="1"?(He((yi==null?void 0:yi.filter(wi=>!wi.is_share).reduce((wi,pr)=>wi+pr.item_bank_num,0))||0),(Xi=yi==null?void 0:yi.filter(wi=>!wi.is_share))==null||Xi.forEach(wi=>{const pr=ir.getFieldValue([`${wi.group_id||0}_${wi.tag_discipline_id}`,"diffValue"])||[];console.log("prev:",pr,wi.difficulty,wi),pr!=null&&pr.includes[wi.difficulty]||ir.setFieldValue([`${wi.group_id||0}_${wi.tag_discipline_id}`,"diffValue"],Array.from(new Set([...pr,wi.difficulty])))})):(He((yi==null?void 0:yi.filter(wi=>!!wi.is_share).reduce((wi,pr)=>wi+pr.item_bank_num,0))||0),(Mr=yi==null?void 0:yi.filter(wi=>!!wi.is_share))==null||Mr.forEach(wi=>{const pr=ir.getFieldValue([`${wi.group_id||0}_${wi.tag_discipline_id}`,"diffValue"])||[];console.log("prev:",pr,wi.difficulty,wi),pr!=null&&pr.includes[wi.difficulty]||ir.setFieldValue([`${wi.group_id||0}_${wi.tag_discipline_id}`,"diffValue"],Array.from(new Set([...pr,wi.difficulty])))}));break}case Ot.FileFolderAndDiff:{Ai==="1"?(He((yi==null?void 0:yi.filter(wi=>!wi.is_share).reduce((wi,pr)=>wi+pr.item_bank_num,0))||0),(Qi=yi==null?void 0:yi.filter(wi=>!wi.is_share))==null||Qi.forEach(wi=>{const pr=ir.getFieldValue([`${wi.group_id}`,"diffValue"])||[];console.log("prev:",pr,wi.difficulty),pr!=null&&pr.includes[wi.difficulty]||ir.setFieldValue([`${wi.group_id}`,"diffValue"],Array.from(new Set([...pr,wi.difficulty])))})):(He((yi==null?void 0:yi.filter(wi=>!!wi.is_share).reduce((wi,pr)=>wi+pr.item_bank_num,0))||0),($i=yi==null?void 0:yi.filter(wi=>!!wi.is_share))==null||$i.forEach(wi=>{const pr=ir.getFieldValue([`${wi.group_id}`,"diffValue"])||[];pr!=null&&pr.includes[wi.difficulty]||ir.setFieldValue([`${wi.group_id}`,"diffValue"],Array.from(new Set([...pr,wi.difficulty])))}));break}}},800)},[Xt,Yt,sa,Oa]);const[ln,He]=(0,ue.useState)(0);return ue.createElement(yt.default,{form:ir,onValuesChange:(Dt,Xi)=>_t(void 0,null,function*(){var Mr,Qi,$i,wi;console.log("onValuesChange:",Xi,Dt);let pr=0;if(je(Yt)===Ot.FileFolderAndDiff){const Hr=yield ir.getFieldValue(),no=[],lr=[];for(const yr of Object.keys(Hr))if((Qi=(Mr=Hr[yr])==null?void 0:Mr.diffValue)!=null&&Qi.length&&yr!=="null"&&yr!==null){const _i=Hr[yr];no.push(Kn({id:yr},_i))}const cr={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"};no.map(yr=>{var _i,Ci,Dr,ko,br;yr.id==0&&(yr.diffNum=Ai==="1"?(Ci=(_i=ua==null?void 0:ua.navigation)==null?void 0:_i[0])==null?void 0:Ci.difficulty_count:(ko=(Dr=jr==null?void 0:jr.navigation)==null?void 0:Dr[0])==null?void 0:ko.difficulty_count),(br=yr==null?void 0:yr.diffValue)==null||br.map(Cr=>{var Nr,Tr,sr,ra,Bo;const ta={group_name:((Nr=yr.extra)==null?void 0:Nr.name)||"",teacher_group_name:"",id:`${yr.id}_${Cr}`,group_id:yr.id,difficulty:Cr,item_bank_num:(ra=(sr=(Tr=yr.diffNum)==null?void 0:Tr.filter(Sa=>Sa.name===cr[Cr]))==null?void 0:sr[0])==null?void 0:ra.value};Ai==="2"&&(ta.is_share=!0,ta.teacher_group_id=yr.id,ta.teacher_group_name=(Bo=yr.extra)==null?void 0:Bo.name),lr.push(ta)})}),pr=lr.reduce((yr,_i)=>yr+_i.item_bank_num,0),kn([...lr,...yi==null?void 0:yi.filter(yr=>Ai==="1"?yr.is_share:!yr.is_share)])}else if(je(Yt)===Ot.All){const Hr=[];for(const no of Object.keys(Xi)){const{diffNum:lr=[],diffValue:cr=[],extra:yr={}}=Xi[no];console.log("---",yr);const[_i,Ci]=no.split("_");let Dr=(wi=($i=yr.tag_disciplines)==null?void 0:$i.filter(ko=>parseInt(ko.id)===parseInt(Ci)))==null?void 0:wi[0];cr.forEach(ko=>{var br;const Cr={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},Nr=(br=lr==null?void 0:lr.find(sr=>sr.name===Cr[ko]))==null?void 0:br.value,Tr={group_name:"",teacher_group_name:"",tag_discipline_name:(Dr==null?void 0:Dr.name)||yr.tag_discipline_name,id:`${no}_${ko}`,group_id:_i,is_share:!!(Dr!=null&&Dr.is_share||(yr==null?void 0:yr.type)==="3"),tag_discipline_id:Ci,difficulty:ko,item_bank_num:Nr};pr+=Nr,yr.type==="0"?Tr.group_name=yr.name:Tr.teacher_group_name=yr.name,Ai==="2"&&(Tr.is_share=!0,Tr.teacher_group_id=yr.id||0,Tr.teacher_group_name=yr.name),Nr>0&&Hr.push(Tr)})}kn([...Hr,...yi==null?void 0:yi.filter(no=>Ai==="1"?no.is_share:!no.is_share)])}He(pr)})},ue.createElement(Ce.default,{destroyInactiveTabPane:!0,activeKey:Ai,onChange:Dt=>Li(Dt),style:{minHeight:260},tabBarExtraContent:{right:Ai==="2"&&(Rr==null?void 0:Rr.length)>0&&ue.createElement(_n.default,{onChange:Dt=>{Pa(Dt)},value:_o,style:{width:120}},ue.createElement(_n.default.Option,{key:"all",value:"all"},"\u5168\u90E8"),Rr==null?void 0:Rr.map(Dt=>ue.createElement(_n.default.Option,{key:Dt==null?void 0:Dt.group_id,value:Dt==null?void 0:Dt.group_id},Dt==null?void 0:Dt.name)))},items:[{key:"1",label:"\u6211\u521B\u5EFA\u7684",children:(sa==null?void 0:sa.length)===0?ue.createElement(Ct.Z,{spinning:Yr},ue.createElement(di.Z,{ButtonTwo:ue.createElement("a",{target:"_blank",href:"/problemset"},"\u524D\u5F80\u9898\u5E93\uFF0C\u65B0\u589E\u66F4\u591A\u8BD5\u9898",">")})):ue.createElement("div",{className:fi.folderAreaWrapper},ue.createElement(ot.Z,{justify:"space-between",align:"middle",className:fi.folderAreaHeader},ue.createElement("span",null,"\u6587\u4EF6\u5939"),ue.createElement("span",{className:"mr20"},"\u5DF2\u9009",ue.createElement("span",{style:{color:"#3061D0"}}," ",ln," "),"\u9898")),ue.createElement(Ct.Z,{spinning:Yr},ue.createElement("div",{style:{minHeight:200}},sa.length>0&&ue.createElement(ci.default,{checkable:!0,className:fi.folderWrapper,rootStyle:{paddingLeft:15,paddingRight:0,paddingTop:10},selectable:!1,onCheck:(Dt,Xi)=>xa(Dt,Xi,"0"),checkedKeys:vo,checkStrictly:!0,treeData:sa,showIcon:!0,blockNode:!0,defaultExpandAll:!0}))))},{key:"2",label:"\u56E2\u961F\u5171\u4EAB",children:(Oa==null?void 0:Oa.length)===0?ue.createElement(Ct.Z,{spinning:Ra},ue.createElement(di.Z,{ButtonTwo:ue.createElement("a",{target:"_blank",href:"/problemset"},"\u524D\u5F80\u9898\u5E93\uFF0C\u65B0\u589E\u66F4\u591A\u8BD5\u9898",">")})):ue.createElement("div",{className:fi.folderAreaWrapper},ue.createElement(ot.Z,{justify:"space-between",align:"middle",className:fi.folderAreaHeader},ue.createElement("span",null,"\u6587\u4EF6\u5939"),ue.createElement("span",{className:"mr20"},"\u5DF2\u9009",ue.createElement("span",{style:{color:"#3061D0"}}," ",ln||0," "),"\u9898")),ue.createElement(Ct.Z,{spinning:Ra},ue.createElement("div",{style:{minHeight:200}},(Oa==null?void 0:Oa.length)>0&&ue.createElement(ci.default,{checkable:!0,className:fi.folderWrapper,selectable:!1,rootStyle:{paddingLeft:15,paddingRight:0,paddingTop:10},onCheck:(Dt,Xi)=>xa(Dt,Xi,"3"),checkedKeys:er,checkStrictly:!0,treeData:Oa,showIcon:!0,blockNode:!0,defaultExpandAll:!0}))))}]}))},qt=Le(26422),an=Le(83312),Gi=Object.defineProperty,ur=Object.defineProperties,Hi=Object.getOwnPropertyDescriptors,Mi=Object.getOwnPropertySymbols,Ri=Object.prototype.hasOwnProperty,dr=Object.prototype.propertyIsEnumerable,Er=(Yt,Xt,kn)=>Xt in Yt?Gi(Yt,Xt,{enumerable:!0,configurable:!0,writable:!0,value:kn}):Yt[Xt]=kn,Ar=(Yt,Xt)=>{for(var kn in Xt||(Xt={}))Ri.call(Xt,kn)&&Er(Yt,kn,Xt[kn]);if(Mi)for(var kn of Mi(Xt))dr.call(Xt,kn)&&Er(Yt,kn,Xt[kn]);return Yt},wn=(Yt,Xt)=>ur(Yt,Hi(Xt)),Yo=(Yt,Xt,kn)=>new Promise((Zi,yi)=>{var Ai=ri=>{try{Rn(kn.next(ri))}catch(ir){yi(ir)}},Li=ri=>{try{Rn(kn.throw(ri))}catch(ir){yi(ir)}},Rn=ri=>ri.done?Zi(ri.value):Promise.resolve(ri.value).then(Ai,Li);Rn((kn=kn.apply(Yt,Xt)).next())});const zr={\u7B80\u5355:1,\u9002\u4E2D:2,\u56F0\u96BE:3};var en=({ruleValue:Yt,setSelectData:Xt,currentItemType:kn,defaultData:Zi,isFirst:yi})=>{const[Ai,Li]=(0,ue.useState)([]),[Rn,ri,ir,Rr]=(0,an.U)(et,{source:"question",page:1,per_page:10,group_id:0,keyword:"",group_type:0,clazz:"ItemBanksGroup",sub_discipline_id:void 0,item_type:kn,show_children:!0});(0,ue.useEffect)(()=>{Yo(void 0,null,function*(){const er=yield ir({},!0);Li((0,qt.L)(er.disciplines))})},[]),console.log(Zi),(0,ue.useEffect)(()=>{if(yi)switch(je(Yt)){case Ot.OnlyKnowledge:{vo(Zi.map(er=>er.tag_discipline_id));break}case Ot.KnowledgeAndDiff:{const er=new Map;Zi.forEach(ia=>{ia&&(er.has(ia.tag_discipline_id)?er.set(ia.tag_discipline_id,[...er.get(ia.tag_discipline_id),ia.difficulty]):er.set(ia.tag_discipline_id,[ia.difficulty]))});for(const[ia,sa]of er.entries())ea.setFieldValue([ia,"diff"],sa);break}}},[Zi,Yt,yi]);const[ea]=yt.default.useForm(),_o=(0,ue.useMemo)(()=>{const er=[];let ia="",sa="";const Ma={};for(const Oa of(Rr==null?void 0:Rr.disciplines)||[]){ia=Oa.name;for(const Oo of Oa.sub_disciplines){sa=Oo.name;for(const ua of Oo.tag_disciplines){const Lo={sub_discipline_name:`${ia}&${sa}`,sub_discipline_id:Oo.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};er.push(Lo)}}}return er},[Rr,Zi]),Pa=[{title:"\u77E5\u8BC6\u70B9",dataIndex:"tag_discipline_name",show:!0,render:(er,ia)=>{const{item_bank_num:sa}=ia;return ue.createElement("div",null,er,`(${sa})`)}},{title:"\u65B9\u5411&\u8BFE\u7A0B",dataIndex:"sub_discipline_name",ellipsis:!0,show:!0},{title:"\u96BE\u5EA6",width:"35%",show:Yt.includes(Hn.Difficulty),render:(er,ia)=>{const{id:sa,difficulty_count:Ma,total_count:Oa,sub_discipline_name:Oo,tag_discipline_name:ua}=ia;return ue.createElement(ue.Fragment,null,ue.createElement(yt.default.Item,{name:[sa,"diff"],noStyle:!0},ue.createElement(Kt.default.Group,{style:{columnGap:12},options:Ma.map(Lo=>({label:Lo.name,value:zr[Lo.name]}))})),ue.createElement(yt.default.Item,{name:[sa,"extra"],initialValue:{difficulty_count:Ma,total_count:Oa,sub_discipline_name:Oo,tag_discipline_name:ua},noStyle:!0},ue.createElement("input",{type:"hidden"})))}}].filter(er=>er.show),[xa,vo]=(0,ue.useState)([]),Kr=(0,ue.useRef)(new Map);return ue.createElement("div",{style:{marginTop:12}},ue.createElement(ot.Z,{className:"mb20",align:"middle",gutter:20},ue.createElement(tn.Z,null,ue.createElement(Ge.Z,{placeholder:"\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B",size:"large",style:{width:240},options:Ai,onChange:er=>{ir({sub_discipline_id:er==null?void 0:er[1]})}})),ue.createElement(tn.Z,null,ue.createElement(Sn.t7,{style:{width:300},placeholder:"\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9\u540D\u79F0\u8FDB\u884C\u641C\u7D22",value:Rn.keyword,onChange:er=>ir({keyword:er})}))),ue.createElement(yt.default,{form:ea,onValuesChange:(er,ia)=>{var sa;console.log(ia),Kr.current.clear();for(const Ma of Object.keys(ia)){const Oa={1:"\u7B80\u5355",2:"\u9002\u4E2D",3:"\u56F0\u96BE"},Oo=ia[Ma],{difficulty_count:ua,total_count:Lo}=Oo.extra||{};(sa=Oo==null?void 0:Oo.diff)==null||sa.forEach(jr=>{var oo;const Yr=(oo=ua==null?void 0:ua.find(Ra=>Ra.name===Oa[jr]))==null?void 0:oo.value,wo=wn(Ar({},Oo.extra),{id:`${Ma}_${jr}`,difficulty:jr,item_bank_num:Yr,tag_discipline_id:Ma});Yr>0&&Kr.current.set(`${Ma}_${jr}`,wo)})}Xt([...Kr.current.values()])}},(_o==null?void 0:_o.length)===0?ue.createElement(di.Z,{ButtonTwo:ue.createElement("a",{target:"_blank",href:"/problemset"},"\u524D\u5F80\u9898\u5E93\uFF0C\u65B0\u589E\u66F4\u591A\u8BD5\u9898",">")}):ue.createElement(Ii.default,{rowSelection:je(Yt)===Ot.OnlyKnowledge?{preserveSelectedRowKeys:!0,type:"checkbox",onChange(er,ia){console.log("table-selectedRowKeys:",er,ia),vo(er),Xt(ia)},getCheckboxProps:er=>({disabled:er.item_bank_num===0}),selectedRowKeys:xa}:void 0,columns:Pa,dataSource:_o,loading:ri,scroll:{y:480},rowKey:"id",pagination:!1})))},li=Object.defineProperty,nr=Object.defineProperties,Sr=Object.getOwnPropertyDescriptors,vr=Object.getOwnPropertySymbols,Ir=Object.prototype.hasOwnProperty,bo=Object.prototype.propertyIsEnumerable,fo=(Yt,Xt,kn)=>Xt in Yt?li(Yt,Xt,{enumerable:!0,configurable:!0,writable:!0,value:kn}):Yt[Xt]=kn,so=(Yt,Xt)=>{for(var kn in Xt||(Xt={}))Ir.call(Xt,kn)&&fo(Yt,kn,Xt[kn]);if(vr)for(var kn of vr(Xt))bo.call(Xt,kn)&&fo(Yt,kn,Xt[kn]);return Yt},lo=(Yt,Xt)=>nr(Yt,Sr(Xt)),Tn=(Yt,Xt,kn)=>new Promise((Zi,yi)=>{var Ai=ri=>{try{Rn(kn.next(ri))}catch(ir){yi(ir)}},Li=ri=>{try{Rn(kn.throw(ri))}catch(ir){yi(ir)}},Rn=ri=>ri.done?Zi(ri.value):Promise.resolve(ri.value).then(Ai,Li);Rn((kn=kn.apply(Yt,Xt)).next())});const qo={\u7B80\u5355:1,\u9002\u4E2D:2,\u56F0\u96BE:3};var wr=({open:Yt,onCancel:Xt,setVisibleModalType:kn,currentItemType:Zi})=>{var yi;const{data:Ai,dispatch:Li}=(0,ue.useContext)(lt),[Rn,ri]=(0,ue.useState)([]),[ir,Rr]=(0,ue.useState)(),ea=(yi=Ai==null?void 0:Ai.item_types)==null?void 0:yi.find(sa=>sa.item_type===Zi);(0,ue.useEffect)(()=>{var sa,Ma,Oa;if(Yt){const Oo=(sa=Ai==null?void 0:Ai.item_types)==null?void 0:sa.find(ua=>ua.item_type===Zi);if((Oo==null?void 0:Oo.random_rule_type)!==Ot.Shixun){const ua=An[Oo==null?void 0:Oo.random_rule_type]||[];ri(ua);const Lo=(Oa=(Ma=Ai==null?void 0:Ai.item_types)==null?void 0:Ma.find(jr=>jr.item_type===Zi))==null?void 0:Oa.contents;switch(console.log("----xxx",je(ua)),je(ua)){case Ot.OnlyDifficulty:{vo(Lo.map(jr=>jr.difficulty));break}case Ot.OnlyFileFolder:{vo({my:Lo==null?void 0:Lo.filter(jr=>parseInt(jr.teacher_group_id)!=="NaN"&&!jr.teacher_group_id&&jr.teacher_group_id!==0),public:Lo==null?void 0:Lo.filter(jr=>parseInt(jr.teacher_group_id)>=0)}),Rr({my:Lo==null?void 0:Lo.filter(jr=>parseInt(jr.teacher_group_id)!=="NaN"&&!jr.teacher_group_id&&jr.teacher_group_id!==0),public:Lo==null?void 0:Lo.filter(jr=>parseInt(jr.teacher_group_id)>=0)});break}case Ot.FileFolderAndKnowledge:{vo({my:Lo==null?void 0:Lo.filter(jr=>parseInt(jr.teacher_group_id)!=="NaN"&&!jr.teacher_group_id&&jr.teacher_group_id!==0),public:Lo==null?void 0:Lo.filter(jr=>parseInt(jr.teacher_group_id)>=0)}),Rr({my:Lo==null?void 0:Lo.filter(jr=>parseInt(jr.teacher_group_id)!=="NaN"&&!jr.teacher_group_id&&jr.teacher_group_id!==0),public:Lo==null?void 0:Lo.filter(jr=>parseInt(jr.teacher_group_id)>=0)});break}case Ot.FileFolderAndDiff:{vo(Lo),Rr(Lo);break}case Ot.All:{vo(Lo),Rr(Lo);break}default:vo(Lo)}}}},[Yt]);const[_o,Pa]=(0,ue.useState)([]);(0,ue.useEffect)(()=>{Yt&&Ye({item_type:Zi}).then(sa=>{sa.status===0&&Pa(sa.data)})},[Yt]),(0,ue.useEffect)(()=>{console.log("selectData",ir)},[ir]);const[xa,vo]=(0,ue.useState)(),[Kr,er]=(0,ue.useState)(!0);console.log("isFirst:",Kr);const ia=sa=>{ri(sa),Rr([]),vo([]),er(!1)};return ue.createElement(nn.default,{title:"\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219",width:948,closable:!0,centered:!0,open:Yt,onCancel:Xt,destroyOnClose:!0,onOk:()=>Tn(void 0,null,function*(){var sa,Ma,Oa,Oo,ua,Lo,jr;if(ir===void 0){kn("");return}if(Object.prototype.toString.call(ir)==="[object Object]"&&!((sa=ir.my)!=null&&sa.length)&&!((Ma=ir.public)!=null&&Ma.length)){ft.ZP.warning("\u8BD5\u9898\u603B\u6570=0\uFF0C\u8BF7\u5148\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219");return}if(!Object.keys(ir).length&&!(ir!=null&&ir.length)){ft.ZP.warning("\u8BD5\u9898\u603B\u6570=0\uFF0C\u8BF7\u5148\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219");return}const oo=je(Rn);switch(oo){case Ot.OnlyFileFolder:{Li({type:"editRule",payload:{itemType:Zi,tableData:[...ir.my||[],...ir.public||[]],randomRuleType:oo}});break}case Ot.OnlyDifficulty:{const Yr=(Oo=(Oa=Ai==null?void 0:Ai.item_types)==null?void 0:Oa.find(Ra=>Ra.item_type===Zi))==null?void 0:Oo.contents;let wo=[{},{value:(ua=_o.find(Ra=>Ra.name==="\u7B80\u5355"))==null?void 0:ua.value},{value:(Lo=_o.find(Ra=>Ra.name==="\u9002\u4E2D"))==null?void 0:Lo.value},{value:(jr=_o.find(Ra=>Ra.name==="\u56F0\u96BE"))==null?void 0:jr.value}];Li({type:"editRule",payload:{itemType:Zi,tableData:ir.map((Ra,Ha)=>{var Mt,Pt,ln,He;return{difficulty:Ra,id:Ha,quanlity:((Pt=(Mt=Yr==null?void 0:Yr.filter(Dt=>Dt.id===Ha))==null?void 0:Mt[0])==null?void 0:Pt.quanlity)||1,item_bank_num:(_o==null?void 0:_o.length)===1?(ln=_o[0])==null?void 0:ln.value:(He=wo==null?void 0:wo[Ra])==null?void 0:He.value}}),randomRuleType:oo}});break}case Ot.OnlyKnowledge:{Li({type:"editRule",payload:{itemType:Zi,tableData:ir.map(Yr=>lo(so({},Yr),{quanlity:Yr.quanlity||1})),randomRuleType:oo}});break}case Ot.KnowledgeAndDiff:{Li({type:"editRule",payload:{itemType:Zi,tableData:ir.map(Yr=>lo(so({},Yr),{quanlity:Yr.quanlity||1})),randomRuleType:oo}});break}case Ot.FileFolderAndDiff:{Li({type:"editRule",payload:{itemType:Zi,tableData:ir.map(Yr=>lo(so({},Yr),{quanlity:Yr.quanlity||1})),randomRuleType:oo}});break}case Ot.FileFolderAndKnowledge:{Li({type:"editRule",payload:{itemType:Zi,tableData:[...ir.my||[],...ir.public||[]],randomRuleType:oo}});break}case Ot.All:{Li({type:"editRule",payload:{itemType:Zi,tableData:ir.map(Yr=>lo(so({},Yr),{quanlity:Yr.quanlity||1})),randomRuleType:oo}});break}}kn("")})},ue.createElement(Kt.default.Group,{className:`${fi.ruleCheckBox}`,style:{marginBottom:8},value:Rn,onChange:sa=>{var Ma;Rn!=null&&Rn.length&&((Ma=ea==null?void 0:ea.contents)==null?void 0:Ma.length)>0?nn.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:()=>ia(sa)}):ia(sa)},options:[{label:"\u6307\u5B9A\u6587\u4EF6\u5939\u62BD\u9898",value:Hn.FileFolder},{label:"\u6307\u5B9A\u96BE\u5EA6\u62BD\u9898",value:Hn.Difficulty},{label:"\u6307\u5B9A\u77E5\u8BC6\u70B9\u62BD\u9898",value:Hn.Knowledge}]}),Rn.includes(Hn.FileFolder)?ue.createElement(cn,{defaultData:xa,selectData:ir,ruleValue:Rn,setSelectData:Rr,currentItemType:Zi}):Rn.includes(Hn.Knowledge)?ue.createElement(en,{defaultData:xa,isFirst:Kr,ruleValue:Rn,setSelectData:Rr,currentItemType:Zi}):Rn.includes(Hn.Difficulty)?ue.createElement("div",{style:{marginTop:12}},ue.createElement("span",{className:"mr20",style:{color:"#666"}},"\u96BE\u5EA6"),ue.createElement(Kt.default.Group,{style:{columnGap:12},options:_o.map(sa=>({label:sa.name,value:qo[sa.name]})),value:ir||xa,onChange:sa=>Rr(sa)})):null)},hr=({open:Yt,onCancel:Xt,setVisibleModalType:kn,currentItemType:Zi})=>Yt?ue.createElement(wr,{open:Yt,onCancel:Xt,setVisibleModalType:kn,currentItemType:Zi}):null,la=Le(25399),ca=Le(94860),Qo=Le(92365),zo=Le(85149),Vt=Le(955),On=Le(61485),Ut=Le(32570),pi=({open:Yt,onCancel:Xt,onOk:kn})=>{const{data:Zi}=(0,ue.useContext)(lt),yi=(0,ca.g)(),[Ai,Li,Rn,ri]=(0,an.U)(Qo.Gm,{page:1,limit:10,keyword:"",diff:"",shixun_publish_status:"",discipline_id:"",sub_discipline_id:"",type:0,include_shixuns:!0,item_type:"SHIXUN"}),[ir,Rr]=(0,ue.useState)(!1);(0,ue.useEffect)(()=>{if(Yt){Rn({page:1,limit:10,type:0},!0).then(Kr=>{(Kr==null?void 0:Kr.shixuns_count)===0&&Rr(!0)});const vo=Zi.item_types.find(Kr=>Kr.item_type==="PRACTICAL");_o(vo.item_banks.map(Kr=>Kr.id)),xa(vo.item_banks)}},[Yt,Zi]);const[ea,_o]=(0,ue.useState)([]),[Pa,xa]=(0,ue.useState)([]);return ue.createElement(nn.default,{title:"\u9009\u62E9\u5B9E\u8BAD\u9898",open:Yt,width:948,centered:!0,closable:!0,onCancel:Xt,onOk:()=>kn(Pa),destroyOnClose:!0},ue.createElement(ot.Z,{justify:"space-between",className:"mb20",style:{maxHeight:650}},ue.createElement(tn.Z,null,ue.createElement(Ge.Z,{style:{width:160},size:"large",placeholder:"\u8BF7\u9009\u62E9\u65B9\u5411&\u8BFE\u7A0B",options:yi,onChange:vo=>{Rn({page:1,discipline_id:vo==null?void 0:vo[0],sub_discipline_id:vo==null?void 0:vo[1]})}}),ue.createElement(_n.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:vo=>Rn({page:1,diff:vo})}),ue.createElement(_n.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:vo=>Rn({page:1,shixun_publish_status:vo})})),ue.createElement(Sn.t7,{placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22",style:{width:290},onChange:vo=>{Rn({keyword:vo,page:1})}})),ir?ue.createElement("div",null,ue.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")})):ue.createElement(Ii.default,{loading:Li,rowKey:"id",columns:[{title:"\u8BD5\u9898\u540D\u79F0",dataIndex:"name",width:"30%",ellipsis:{showTitle:!0},render:(vo,Kr)=>ue.createElement("div",{style:{display:"flex",alignItems:"center"}},ue.createElement("div",{className:Kr!=null&&Kr.high_resources_consume?hn.title:"",title:vo||"--"},ue.createElement(zo.Z,{key:1,showLines:1,showTextOnly:!0,value:vo||"--"})),(Kr==null?void 0:Kr.high_resources_consume)&&ue.createElement(Ut.Z,{type:"shixun",style:{marginLeft:10}}))},{title:"\u96BE\u5EA6",dataIndex:"level"},{title:"\u5173\u5361\u6570\u91CF",dataIndex:"challenges_count",key:"challenges_count",render:(vo,Kr,er)=>ue.createElement("span",null,vo||"- -")},{title:"\u4F7F\u7528\u6B21\u6570",dataIndex:"study_count"},{title:ue.createElement("span",null,"\u53D1\u5E03\u72B6\u6001 ",ue.createElement(la.Z,{title:"\u672A\u53D1\u5E03\u7684\u5B9E\u8DF5\u9879\u76EE\u4E0D\u80FD\u88AB\u9009\u7528"},ue.createElement(On.Z,null))),dataIndex:"shixun_tag_num_name",key:"shixun_tag_num_name",width:100,render:(vo,Kr,er)=>ue.createElement("span",null,vo||"- -")},{title:"\u64CD\u4F5C",render(vo,Kr){const{title:er,challenge_names:ia,author_name:sa,identifier:Ma,author_school_name:Oa,study_count:Oo}=Kr||{};return ue.createElement("div",null,ue.createElement("span",{style:{color:"#165DFF",cursor:"pointer"},onClick:()=>{nn.default.confirm({title:"\u9898\u76EE\u8BE6\u60C5",closable:!0,width:1e3,centered:!0,icon:null,footer:null,content:ue.createElement("div",null,ue.createElement(zo.Z,{value:er,style:{marginBottom:18}}),ue.createElement("div",{className:hn.challengeNameWrapper},ia.map((ua,Lo)=>ue.createElement("div",{className:hn.challengeName,key:Lo},"\u7B2C",(0,Vt.EM)(Lo+1),"\u9898\xA0",ua))),ue.createElement(ot.Z,{className:hn.shixunPreviewFooter,justify:"space-between",style:{alignItems:"center"}},ue.createElement(tn.Z,{className:hn.shixunInfoWrapper},ue.createElement("span",null,"\u521B\u5EFA\u8005"),ue.createElement("span",{className:hn.shixunInfo},sa.split("\u3001")[0]),ue.createElement("span",null,"\u6240\u5C5E\u5355\u4F4D"),ue.createElement("span",{className:hn.shixunInfo},Oa),ue.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570"),ue.createElement("span",{className:hn.shixunInfo},Oo)),ue.createElement(Te.ZP,{type:"primary",className:hn.btnToDetail,onClick:()=>(0,Vt.xg)(`/shixuns/${Ma}/challenges?exercise=true`)},ue.createElement("i",{className:"iconfont icon-shixunkecheng"}),"\u5B9E\u8BAD\u8BE6\u60C5")))})}},"\u67E5\u770B"),(Kr==null?void 0:Kr.shixun_tag_num)===1&&ue.createElement("a",{target:"_blank",href:`/shixuns/${Kr==null?void 0:Kr.identifier}/challenges`,style:{marginLeft:10}},"\u53BB\u53D1\u5E03"))}}],dataSource:ri==null?void 0:ri.items,rowSelection:{selectedRowKeys:ea,preserveSelectedRowKeys:!0,getCheckboxProps:vo=>({disabled:vo.shixun_tag_num===1}),onChange(vo,Kr){var er,ia,sa;console.log(vo),_o(vo);const Ma=[];for(const Oo of Pa)vo.includes(Oo.id)&&Ma.push(Oo);const Oa=Ma.map(Oo=>Oo.id);for(const Oo of Kr)Oo&&vo.includes(Oo.id)&&!Oa.includes(Oo.id)&&Ma.push({id:Oo.id,difficulty:Oo.level,identifier:Oo.identifier,name:Oo.name,real_name:(er=Oo==null?void 0:Oo.author_name)==null?void 0:er.split("\u3001")[0],school_name:Oo.author_school_name,challenge_names:Oo.challenge_names,challenges:(ia=Oo.challenge_names)==null?void 0:ia.map((ua,Lo)=>({subject:ua,id:Lo,score:5})),score:((sa=Oo.challenge_names)==null?void 0:sa.length)*5,study_count:Oo.study_count,challenges_count:Oo.challenges_count});xa(Ma)}},pagination:{current:Ai.page,pageSize:Ai.limit,total:ri==null?void 0:ri.items_count,showTotal:vo=>ue.createElement("span",null,"\u5171\xA0",ue.createElement("span",{style:{color:"#165DFF"}},vo),"\xA0\u6761\u6570\u636E"),showQuickJumper:!0,onChange(vo,Kr){Rn({page:vo,limit:Kr})},size:"default"},scroll:{y:400}}))},Vn=Le(12921),qn=Le(59301),ki=Object.defineProperty,Wi=Object.defineProperties,Wn=Object.getOwnPropertyDescriptors,mi=Object.getOwnPropertySymbols,Si=Object.prototype.hasOwnProperty,Ei=Object.prototype.propertyIsEnumerable,bi=(Yt,Xt,kn)=>Xt in Yt?ki(Yt,Xt,{enumerable:!0,configurable:!0,writable:!0,value:kn}):Yt[Xt]=kn,gr=(Yt,Xt)=>{for(var kn in Xt||(Xt={}))Si.call(Xt,kn)&&bi(Yt,kn,Xt[kn]);if(mi)for(var kn of mi(Xt))Ei.call(Xt,kn)&&bi(Yt,kn,Xt[kn]);return Yt},qi=(Yt,Xt)=>Wi(Yt,Wn(Xt)),bn=({onDelete:Yt,list:Xt,onSelect:kn})=>{const[Zi,yi]=(0,ue.useState)(!1),{dispatch:Ai,disabled:Li}=(0,ue.useContext)(lt),Rn=(_o,Pa,xa)=>{const vo=Array.from(_o),[Kr]=vo.splice(Pa,1);return vo.splice(xa,0,Kr),vo},[ri,ir]=(0,ue.useState)(null),[Rr,ea]=(0,ue.useState)(!1);return qn.createElement(Vn.Z5,{onDragStart:()=>{ea(!0)},onDragEnd:_o=>{if(ea(!1),!_o.destination)return;const Pa=Rn(Xt,_o.source.index,_o.destination.index);Ai({type:"updateItemTypes",payload:Pa})}},qn.createElement(Vn.bK,{droppableId:"droppable"},(_o,Pa)=>qn.createElement("div",qi(gr({},_o.droppableProps),{ref:_o.innerRef}),qn.createElement(Ct.Z,{spinning:Zi},Xt.map((xa,vo)=>qn.createElement(Vn._l,{key:vo,draggableId:vo.toString(),index:vo,isDragDisabled:ri!==xa.item_type},(Kr,er)=>qn.createElement(ot.Z,qi(gr(gr({align:"middle",wrap:!1,ref:Kr.innerRef},Kr.draggableProps),Kr.dragHandleProps),{className:`${hn.dragItem} ${Rr?hn.dragging:""}`}),qn.createElement(tn.Z,{className:hn.contentArea,onClick:()=>{kn(xa.item_type),(0,Vt.k3)()}},qn.createElement("span",{className:hn.blackText},(0,Vt.EM)(vo+1),"\u3001\u3010",xa.item_type_text,"\u3011"),qn.createElement(la.Z,{title:`\uFF08${xa.item_bank_count}\u5C0F\u9898\uFF0C\u5171${parseFloat(xa.total_score).toFixed(1)}\u5206\uFF09`},qn.createElement("span",{className:hn.greyText},`\uFF08${xa.item_bank_count}\u5C0F\u9898\uFF0C\u5171${parseFloat(xa.total_score).toFixed(1)}\u5206\uFF09`))),!Li&&qn.createElement(qn.Fragment,null,qn.createElement(la.Z,{title:"\u957F\u6309\u53EF\u8FDB\u884C\u62D6\u62FD\u6392\u5E8F",open:ri===xa.item_type&&!Rr},qn.createElement("div",{style:{cursor:"grab"},className:`${hn.iconWrapper} ${Rr?hn.hidden:""}`,onMouseEnter:()=>{ir(xa.item_type)},onMouseLeave:()=>ir(null)},qn.createElement("i",{className:`iconfont icon-tuodong1 ${hn.dragIcon}`}))),qn.createElement(la.Z,{title:"\u5220\u9664"},qn.createElement("div",{className:`${hn.iconWrapper} ${Rr?hn.hidden:""}`,style:{cursor:"pointer"},onClick:()=>Yt(xa.item_type)},qn.createElement("i",{className:`iconfont icon-shanchu12 ${hn.deleteIcon}`})))))))),_o.placeholder)))},Yi=Le(71114),rr={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"},Po=Le(73631),uo=Le(31328);const No=(Yt,Xt,kn,Zi)=>{const yi={[Ot.OnlyDifficulty]:[{title:"\u96BE\u5EA6",key:"difficulty",render(Ai,Li){const{difficulty:Rn}=Li;return ue.createElement("span",{style:{color:Ee[Rn].color}},Ee[Rn].label)}}],[Ot.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(Ai,Li){return`${Ai}`}}],[Ot.OnlyFileFolder]:[{title:"\u6587\u4EF6\u5939",render(Ai,Li,Rn){const{group_name:ri,teacher_group_name:ir}=Li,Rr=ri||ir,ea=ir?uo:Po;return ue.createElement("div",{style:{display:"flex"}},ue.createElement("img",{src:ea,className:rr.folderIcon})," ",ue.createElement(la.Z,{title:Rr},ue.createElement("span",{className:rr.titles},Rr)))}},{title:"\u7C7B\u578B",render(Ai,Li){const{teacher_group_name:Rn}=Li;return ue.createElement("span",null,Rn?"\u56E2\u961F\u5171\u4EAB":"\u6211\u521B\u5EFA\u7684")}}],[Ot.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(Ai,Li){const{difficulty:Rn}=Li;return ue.createElement("span",{style:{color:Ee[Rn].color}},Ee[Rn].label)}}],[Ot.FileFolderAndKnowledge]:[{title:"\u77E5\u8BC6\u70B9",dataIndex:"tag_discipline_name",ellipsis:!0},{title:"\u6587\u4EF6\u5939",render(Ai,Li){const{group_name:Rn,teacher_group_name:ri}=Li,ir=Rn||ri,Rr=ri?uo:Po;return ue.createElement("div",{style:{display:"flex"}},ue.createElement("img",{src:Rr,className:rr.folderIcon})," ",ue.createElement(la.Z,{title:ir},ue.createElement("span",{className:rr.titles},ir)))}},{title:"\u7C7B\u578B",render(Ai,Li){const{teacher_group_name:Rn}=Li;return ue.createElement("span",null,Rn?"\u56E2\u961F\u5171\u4EAB":"\u6211\u521B\u5EFA\u7684")}}],[Ot.FileFolderAndDiff]:[{title:"\u6587\u4EF6\u5939",render(Ai,Li){const{group_name:Rn,teacher_group_name:ri}=Li,ir=Rn||ri,Rr=ri?uo:Po;return ue.createElement("div",{style:{display:"flex"}},ue.createElement("img",{src:Rr,className:rr.folderIcon})," ",ue.createElement(la.Z,{title:ir},ue.createElement("span",{className:rr.titles},ir)))}},{title:"\u7C7B\u578B",render(Ai,Li){const{teacher_group_name:Rn}=Li;return ue.createElement("span",null,Rn?"\u56E2\u961F\u5171\u4EAB":"\u6211\u521B\u5EFA\u7684")}},{title:"\u96BE\u5EA6",key:"difficulty",render(Ai,Li){const{difficulty:Rn}=Li;return ue.createElement("span",{style:{color:Ee[Rn].color}},Ee[Rn].label)}}],[Ot.All]:[{title:"\u77E5\u8BC6\u70B9",dataIndex:"tag_discipline_name",ellipsis:!0},{title:"\u6587\u4EF6\u5939",render(Ai,Li){const{group_name:Rn,teacher_group_name:ri,teacher_group_id:ir}=Li,Rr=Rn||ri,ea=ir||ir===0?uo:Po;return ue.createElement("div",{style:{display:"flex"}},ue.createElement("img",{src:ea,className:rr.folderIcon})," ",ue.createElement(la.Z,{title:Rr},ue.createElement("span",{className:rr.titles},Rr)))}},{title:"\u7C7B\u578B",render(Ai,Li){const{teacher_group_id:Rn}=Li;return ue.createElement("span",null,Rn||Rn===0?"\u56E2\u961F\u5171\u4EAB":"\u6211\u521B\u5EFA\u7684")}},{title:"\u96BE\u5EA6",key:"difficulty",render(Ai,Li){const{difficulty:Rn}=Li;return ue.createElement("span",{style:{color:Ee[Rn].color}},Ee[Rn].label)}}],[Ot.Shixun]:[]};for(const Ai of Object.values(yi))Ai.push({title:"\u62BD\u9898\u6570\u91CF",key:"quanlity",render(Li,Rn){const{item_bank_num:ri,quanlity:ir,id:Rr,teacher_group_id:ea}=Rn||{};return ue.createElement(ot.Z,{align:"middle"},ue.createElement(At.Z,{disabled:Zi,min:1,max:ri,size:"large",precision:0,value:ir,onChange:_o=>{Xt({type:"changeQuestionNum",payload:{itemType:kn,id:Rr,num:_o,teacher_group_id:ea}})}}),ue.createElement("span",{className:"ml10 font14",style:{color:"#333333"}},"/",ri))}},{title:"\u64CD\u4F5C",key:"action",align:"right",render(Li,Rn){const{id:ri,is_share:ir}=Rn;return Zi?ue.createElement("span",{className:"cursorNotAllowed c-grey-999"},"\u5220\u9664"):ue.createElement("span",{className:rr.deleteBtn,onClick:()=>{Xt({type:"deleteRule",payload:{itemType:kn,id:ri,is_share:ir}})}},"\u5220\u9664")}});return yi[Yt]},Do=({setVisibleModalType:Yt})=>{var Xt,kn,Zi,yi;const{data:Ai,dispatch:Li,disabled:Rn}=(0,ue.useContext)(lt),ri=(Xt=Ai==null?void 0:Ai.item_types)==null?void 0:Xt.find(ir=>ir.item_type==="PRACTICAL");return ue.createElement(Yi.Z,{className:rr.timelineWrapper,items:[{children:ue.createElement("div",{style:{transform:"translateY(-4px)"}},ue.createElement(ot.Z,{className:"mb20",align:"middle",justify:"space-between"},ue.createElement(tn.Z,null,ue.createElement("span",{className:rr.title},"\u9898\u5E93\u9009\u9898"),ue.createElement("span",{className:rr.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")),!Rn&&ue.createElement(Sn.op,{style:{width:102},onClick:()=>Yt("selectShixun")},"\u4ECE\u9898\u5E93\u9009\u62E9")),((kn=ri==null?void 0:ri.item_banks)==null?void 0:kn.length)===0?ue.createElement(di.Z,{customText:"\u6682\u65E0\u5F85\u62BD\u8BD5\u9898\uFF0C\u8BF7\u5148\u4ECE\u9898\u5E93\u8FDB\u884C\u9009\u62E9\uFF5E"}):ue.createElement(Ii.default,{rowKey:"id",className:"mb10",columns:[{title:"\u5E8F\u53F7",width:60,render(ir,Rr,ea){return ue.createElement("span",null,ea+1)}},{title:"\u8BD5\u9898\u540D\u79F0",dataIndex:"name",width:"40%",ellipsis:{showTitle:!0},render:(ir,Rr)=>ue.createElement("div",{style:{display:"flex",alignItems:"center"}},ue.createElement("div",{className:Rr!=null&&Rr.high_resources_consume?rr.q_title:"",title:ir||"--"},ue.createElement(zo.Z,{key:1,showLines:1,showTextOnly:!0,value:ir})),(Rr==null?void 0:Rr.high_resources_consume)&&ue.createElement(Ut.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:(ir,Rr,ea)=>ue.createElement("span",null,ir||"- -")},{title:"\u96BE\u5EA6",dataIndex:"difficulty"},{title:"\u64CD\u4F5C",align:"right",width:180,render(ir,Rr,ea){const{id:_o,identifier:Pa,name:xa,challenge_names:vo=[],real_name:Kr,school_name:er,study_count:ia,challenges:sa=[]}=Rr||{};return ue.createElement("div",null,ue.createElement("span",{style:{color:"#165DFF",cursor:"pointer",marginLeft:20},onClick:()=>{nn.default.confirm({title:"\u9898\u76EE\u8BE6\u60C5",closable:!0,width:1e3,centered:!0,icon:null,footer:null,content:ue.createElement("div",null,ue.createElement(zo.Z,{value:xa,style:{marginBottom:18}}),ue.createElement("div",{className:rr.challengeNameWrapper},sa==null?void 0:sa.map((Ma,Oa)=>ue.createElement("div",{className:rr.challengeName,key:Oa},"\u7B2C",(0,Vt.EM)(Oa+1),"\u9898\xA0",Ma==null?void 0:Ma.subject))),ue.createElement(ot.Z,{className:rr.shixunPreviewFooter,justify:"space-between",style:{alignItems:"center"}},ue.createElement(tn.Z,{className:rr.shixunInfoWrapper},ue.createElement("span",null,"\u521B\u5EFA\u8005"),ue.createElement("span",{className:rr.shixunInfo},Kr),ue.createElement("span",null,"\u6240\u5C5E\u5355\u4F4D"),ue.createElement("span",{className:rr.shixunInfo},er),ue.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570"),ue.createElement("span",{className:rr.shixunInfo},ia)),ue.createElement(Te.ZP,{type:"primary",className:rr.btnToDetail,onClick:()=>(0,Vt.xg)(`/shixuns/${Pa}/challenges?exercise=true`)},ue.createElement("i",{className:"iconfont icon-shixunkecheng"}),"\u5B9E\u8BAD\u8BE6\u60C5")))})}},"\u67E5\u770B"),!Rn&&ue.createElement("span",{onClick:()=>{Li({type:"deleteShixunQuestion",payload:{shixunId:_o}})},className:`ml20 ${rr.deleteBtn}`},"\u5220\u9664"))}}],dataSource:(ri==null?void 0:ri.item_banks)||[],pagination:!1}))},{children:ue.createElement(ot.Z,{style:{transform:(Zi=ri==null?void 0:ri.item_banks)!=null&&Zi.length?"translateY(-8px)":"none"},align:"middle",justify:"space-between"},ue.createElement("span",{className:rr.title},"\u5DF2\u9009\u5B9E\u8BAD\u9898\u4E2D\u968F\u673A\u62BD\u9898"),!!((yi=ri==null?void 0:ri.item_banks)!=null&&yi.length)&&ue.createElement(tn.Z,null,ue.createElement(ot.Z,{align:"middle"},ue.createElement("span",{className:rr.normalText},"\u62BD\u9898\u6570\u91CF"),ue.createElement(At.Z,{min:0,disabled:Rn,max:ri==null?void 0:ri.item_bank_num,size:"large",className:"ml10 mr10",value:(ri==null?void 0:ri.item_bank_count)||1,onChange:ir=>Li({type:"changeQuestionNum",payload:{num:ir||1,itemType:"PRACTICAL"}})}),ue.createElement("span",{className:`${rr.normalText} mr30`},"/",ri==null?void 0:ri.item_bank_num),ue.createElement("span",{className:rr.normalText},"\u6BCF\u9898\u5206\u503C"),ue.createElement(At.Z,{disabled:Rn,min:0,max:100,size:"large",precision:1,className:"ml10 mr10",value:ri==null?void 0:ri.score,onChange:ir=>Li({type:"changeQuestionScore",payload:{score:ir,itemType:"PRACTICAL"}})}),ue.createElement("span",{className:rr.normalText},"\u5206"))))}]})};var fa=({setVisibleModalType:Yt,currentItemType:Xt,onDelete:kn})=>{var Zi,yi;const Ai=(0,Oe.useParams)(),{data:Li,dispatch:Rn,disabled:ri}=(0,ue.useContext)(lt),ir=((Zi=Li==null?void 0:Li.item_types)==null?void 0:Zi.findIndex(ea=>ea.item_type===Xt))+1,Rr=(yi=Li==null?void 0:Li.item_types)==null?void 0:yi.find(ea=>ea.item_type===Xt);return ue.createElement("div",{className:rr.questionDetailWrapper},ue.createElement(ot.Z,{justify:"space-between",align:"middle",className:"mb30"},ue.createElement(tn.Z,null,ue.createElement("span",{className:rr.questionTitle},`${(0,Vt.EM)(ir)}\u3001${Rr==null?void 0:Rr.item_type_text}`),ue.createElement("span",{className:rr.questionScoreInfo},"\uFF08",ue.createElement("span",{style:{color:"#3061D0"}},Rr==null?void 0:Rr.item_bank_count),"\u5C0F\u9898 ",ue.createElement("span",null,"\uFF0C\u5171",ue.createElement("span",{style:{color:"#3061D0"}},Rr==null?void 0:Rr.total_score),"\u5206"),"\uFF09")),!ri&&ue.createElement("i",{className:`iconfont icon-shanchutimu ${rr.deleteIcon}`,onClick:()=>kn(Xt)})),Xt==="PRACTICAL"?ue.createElement(Do,{setVisibleModalType:Yt}):ue.createElement(ue.Fragment,null,(Rr==null?void 0:Rr.contents.length)===0?ue.createElement(di.Z,{styles:{margin:"70px auto 100px auto"},customText:ue.createElement("span",null,"\u6682\u65E0\u62BD\u9898\u89C4\u5219\uFF0C\u652F\u6301",ue.createElement("span",{style:{color:"#EA9741"}},"\u6307\u5B9A\u6587\u4EF6\u5939\u3001\u96BE\u5EA6\u3001\u77E5\u8BC6\u70B9"),"\u8FDB\u884C\u62BD\u9898\uFF5E"),ButtonTwo:(Ai==null?void 0:Ai.id)&&ue.createElement(ot.Z,{justify:"center",className:"mt30"},ue.createElement(Sn.op,{style:{width:136,marginTop:-10},onClick:()=>Yt("rule")},"\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219"))}):ue.createElement(ue.Fragment,null,ue.createElement(ot.Z,{justify:"space-between",align:"middle",className:"mb20"},ue.createElement(tn.Z,null,ue.createElement(ot.Z,{align:"middle"},ue.createElement("span",{className:`${rr.normalText}`},"\u6BCF\u9898\u5206\u503C"),ue.createElement(At.Z,{disabled:ri,size:"large",className:"ml10 mr10",min:.1,max:100,value:Rr==null?void 0:Rr.score,precision:1,onChange:ea=>Rn({type:"changeQuestionScore",payload:{score:ea,itemType:Xt}})}),ue.createElement("span",{className:rr.normalText},"\u5206"))),(Ai==null?void 0:Ai.id)&&ue.createElement(Sn.op,{onClick:()=>Yt("rule")},"\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219")),ue.createElement(Ii.default,{columns:No(Rr==null?void 0:Rr.random_rule_type,Rn,Xt,ri),dataSource:Rr==null?void 0:Rr.contents,pagination:!1,rowKey:"id"}))))},na=Le(6021),za=Le(94941),zt=Le(24065),To=Le(32637),Pr=Le(59301),eo=Object.defineProperty,Zo=Object.defineProperties,Wr=Object.getOwnPropertyDescriptors,ba=Object.getOwnPropertySymbols,ga=Object.prototype.hasOwnProperty,Uo=Object.prototype.propertyIsEnumerable,Fo=(Yt,Xt,kn)=>Xt in Yt?eo(Yt,Xt,{enumerable:!0,configurable:!0,writable:!0,value:kn}):Yt[Xt]=kn,vs=(Yt,Xt)=>{for(var kn in Xt||(Xt={}))ga.call(Xt,kn)&&Fo(Yt,kn,Xt[kn]);if(ba)for(var kn of ba(Xt))Uo.call(Xt,kn)&&Fo(Yt,kn,Xt[kn]);return Yt},Qa=(Yt,Xt)=>Zo(Yt,Wr(Xt)),ns=(Yt,Xt,kn)=>new Promise((Zi,yi)=>{var Ai=ri=>{try{Rn(kn.next(ri))}catch(ir){yi(ir)}},Li=ri=>{try{Rn(kn.throw(ri))}catch(ir){yi(ir)}},Rn=ri=>ri.done?Zi(ri.value):Promise.resolve(ri.value).then(Ai,Li);Rn((kn=kn.apply(Yt,Xt)).next())}),Vr=({})=>{var Yt,Xt,kn,Zi,yi,Ai,Li,Rn,ri,ir,Rr,ea,_o,Pa,xa;const[vo]=(0,Oe.useSearchParams)(),Kr=(0,Oe.useParams)(),{data:er,dispatch:ia,setPreview:sa,getData:Ma,handlePreview:Oa,disabled:Oo}=(0,ue.useContext)(lt),[ua,Lo]=(0,ue.useState)(""),[jr,oo]=(0,ue.useState)((Xt=(Yt=er==null?void 0:er.item_types)==null?void 0:Yt[0])==null?void 0:Xt.item_type),[Yr,wo]=(0,ue.useState)(!0),[Ra,Ha]=(0,ue.useState)(!1),Mt=(Dt,Xi)=>ns(void 0,null,function*(){var Mr,Qi,$i,wi,pr,Hr;const no=er.item_types.map(Ci=>Ci.item_type_text),lr=(Mr=er==null?void 0:er.item_types)==null?void 0:Mr.filter(Ci=>{var Dr,ko;return((Dr=Ci.contents)==null?void 0:Dr.length)>0||((ko=Ci==null?void 0:Ci.item_banks)==null?void 0:ko.length)>0});if(er.sort_by_item_type=no,!((Qi=er.item_types)!=null&&Qi.length)){ft.ZP.warning("\u8BD5\u9898\u603B\u6570=0\uFF0C\u8BF7\u5148\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219");return}if((lr==null?void 0:lr.length)===0){ft.ZP.warning("\u8BD5\u9898\u603B\u6570=0\uFF0C\u8BF7\u5148\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219");return}let cr=()=>ns(void 0,null,function*(){const Ci=(0,ct.cloneDeep)(er),{item_types:Dr}=Ci||{};Ci.item_types=Dr.filter(br=>br.item_type===jr),(yield Re(Kr.id||Kr.categoryId,Ci)).status===0&&(oo(Xi),ft.ZP.success("\u4FDD\u5B58\u6210\u529F"),Dt||Oe.history.push("/paperlibrary"))}),yr=(wi=($i=er==null?void 0:er.item_types)==null?void 0:$i.filter(Ci=>Ci.item_type_text==="\u5B9E\u8BAD\u9898")[0])==null?void 0:wi.item_banks,_i=0;yr==null||yr.map(Ci=>{Ci.high_resources_consume&&(_i=_i+1)}),console.log(_i),_i>0?nn.default.info({centered:!0,icon:null,width:600,okText:"\u6211\u77E5\u9053\u4E86",title:"\u63D0\u793A",content:Pr.createElement("div",null,Pr.createElement("div",{className:hn.tipcontent},Pr.createElement("div",null,Pr.createElement("div",{className:hn.name},"\u60A8\u597D\uFF01",(pr=(0,zt.eY)())==null?void 0:pr.username,"\uFF08",(Hr=(0,zt.eY)())==null?void 0:Hr.login,"\uFF09\uFF1A"),Pr.createElement("div",{className:hn.tip},"\u5F53\u524D\u8BD5\u5377\u5305\u542B\u9AD8\u6D88\u8017\u7C7B\u578B\u7684\u5B9E\u9A8C\u3002",Pr.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"),Pr.createElement("div",{className:hn.info},Pr.createElement("i",{className:"iconfont icon-xunifangzhenti1 mr10 font26"}),Pr.createElement("span",{className:"mr10",style:{color:"#6A7283"}},"\u9AD8\u6D88\u8017\u5B9E\u9A8C"),Pr.createElement("span",{style:{color:"#232B40"}},`${_i}\u4E2A`))),Pr.createElement("div",null,Pr.createElement("div",{className:hn.img},Pr.createElement("img",{src:To,width:"124px",height:"124px"})),Pr.createElement("div",{className:"tc font14 mt10",style:{color:"#777A93"}},"\u626B\u4E00\u626B\uFF0C\u83B7\u53D6\u6388\u6743\u7801")))),onOk:()=>{cr()}}):cr()}),Pt=(Dt,Xi,Mr,Qi=!1)=>ns(void 0,null,function*(){console.log(er);const $i=Qa(vs(vs({},er.exercise),Kr),{exerciseId:Kr.categoryId,sort_by_item_type:er.sort_by_item_type,difficulty:er.examination_bank.difficulty,exam_notes:er.examination_bank.exam_notes,exercise_name:er.examination_bank.name,time:er.examination_bank.time,changed_item_type:jr,item_types:er.item_types,sub_discipline_id:er.examination_bank.sub_discipline_id});(!Dt||Xi===1)&&($i.is_reset=1);const wi=yield(0,za.wy)($i);return wi.status===0&&(Qi||ft.ZP.success("\u4FEE\u6539\u6210\u529F "),oo(Mr),Dt||Oe.history.push(`/classrooms/${Kr.coursesId}/exercise/${Kr.categoryId}/detail?random=true`)),wi}),ln=Dt=>{nn.default.confirm({title:"\u63D0\u793A",icon:null,centered:!0,closable:!0,content:Pr.createElement("div",null,"\u786E\u8BA4\u5220\u9664\u8BE5\u9898\u578B\uFF1F"),onOk:()=>ns(void 0,null,function*(){var Xi,Mr,Qi,$i;if(Kr.id){if((yield wt(Kr.id,{item_type:[Dt]})).status!==0)return}else{const wi=yield St(Kr.categoryId,{item_type:[Dt]});if(Ma(),wi.status!==0)return}if(ia({type:"deleteQuestionType",payload:Dt}),Dt===jr){const wi=We(er,{type:"deleteQuestionType",payload:Dt});oo(wi.item_types.length?wi.item_types[0].item_type:(Mr=(Xi=er==null?void 0:er.item_types)==null?void 0:Xi[0])==null?void 0:Mr.item_type)}else oo(($i=(Qi=er==null?void 0:er.item_types)==null?void 0:Qi[0])==null?void 0:$i.item_type)})})};(0,ue.useEffect)(()=>{var Dt;(Dt=er==null?void 0:er.examination_bank)!=null&&Dt.name&&wo(!1),(0,Vt.Dk)("\u968F\u673A\u7EC4\u5377")},[(kn=er==null?void 0:er.examination_bank)==null?void 0:kn.name]);const He=()=>ns(void 0,null,function*(){var Dt;let Xi=yield Pt(!0,1,jr,!0);if((Xi==null?void 0:Xi.status)===0){const Mr=yield(0,ne.ZP)(`/api/exercises/${Kr==null?void 0:Kr.categoryId}/simulate_start_answer.json`,{method:"get",params:{coursesId:Kr==null?void 0:Kr.coursesId,categoryId:Kr==null?void 0:Kr.categoryId}});(Mr==null?void 0:Mr.status)!=-1&&window.open(`/classrooms/${Kr.coursesId}/exercise/${Kr.categoryId}/${(Dt=(0,zt.eY)())==null?void 0:Dt.login}/initate_answer`)}});return Pr.createElement("div",{className:hn.questionInfo},Pr.createElement("div",{className:"tc mb20"},Pr.createElement(at.VP,{defaultValue:(Zi=er==null?void 0:er.examination_bank)==null?void 0:Zi.name,onFinish:Dt=>ns(void 0,null,function*(){return ia({type:"updateBaseInfo",payload:Qa(vs({},er.examination_bank),{name:Dt})}),(0,za.wy)({exercise_name:Dt,exerciseId:Kr==null?void 0:Kr.categoryId}),!0})})),Pr.createElement(ot.Z,{justify:"center",className:"mb20"},Pr.createElement(tn.Z,{className:"mr30"},Pr.createElement("span",{className:hn.label},"\u7B54\u9898\u65F6\u957F"),Pr.createElement("span",null,((yi=er==null?void 0:er.examination_bank)==null?void 0:yi.time)===-1?"\u4E0D\u9650":((Ai=er==null?void 0:er.examination_bank)==null?void 0:Ai.time)||"\u4E0D\u9650")),Pr.createElement(tn.Z,{className:"mr30"},Pr.createElement("span",{className:hn.label},"\u96BE\u5EA6"),Pr.createElement("span",null,(Rn=Ee[`${(Li=er==null?void 0:er.examination_bank)==null?void 0:Li.difficulty}`])==null?void 0:Rn.label)),Pr.createElement(tn.Z,{className:"mr30"},Pr.createElement("span",{className:hn.label},"\u8BD5\u9898\u603B\u6570"),Pr.createElement("span",null,((ri=er==null?void 0:er.examination_bank)==null?void 0:ri.question_count)||0)),Pr.createElement(tn.Z,null,Pr.createElement("span",{className:hn.label},"\u603B\u5206"),Pr.createElement("span",null,((Rr=(ir=er==null?void 0:er.examination_bank)==null?void 0:ir.total_score)==null?void 0:Rr.toFixed(1))||0))),Pr.createElement("div",{className:hn.content,style:{border:((ea=er==null?void 0:er.item_types)==null?void 0:ea.length)<=0&&"none"}},((_o=er==null?void 0:er.item_types)==null?void 0:_o.length)>0?Pr.createElement(ot.Z,{wrap:!1},Pr.createElement(tn.Z,{flex:"260px",className:hn.leftPart},!Oo&&Pr.createElement(ot.Z,{className:"mb20"},Pr.createElement(Sn.op,{style:{margin:"0 15px",borderRadius:2},onClick:()=>Lo("setScore")},"\u6279\u91CF\u8BBE\u7F6E\u5206\u503C"),(Kr==null?void 0:Kr.id)&&Pr.createElement(Sn.op,{shape:"default",onClick:()=>Lo("questionType")},"\u6DFB\u52A0\u9898\u578B")),Pr.createElement(bn,{list:er.item_types,onSelect:Dt=>ns(void 0,null,function*(){if(Dt===jr)return;wo(!0);const Xi=er.item_types.find(Mr=>Mr.item_type===jr);if(jr!=="PRACTICAL"&&Xi.contents.length>0&&(Kr!=null&&Kr.id)){const Mr=(0,ct.cloneDeep)(er),{item_types:Qi}=Mr||{};Mr.item_types=Qi.filter($i=>$i.item_type===jr);try{(yield Re(Kr.id||Kr.categoryId,Mr)).status===0&&oo(Dt)}catch($i){}}else Kr.categoryId?Pt(!0,2,Dt):Mt(!0,Dt);wo(!1)}),onDelete:ln})),Pr.createElement(tn.Z,{flex:1,className:hn.rightPart},Pr.createElement(Ct.Z,{spinning:Yr},Pr.createElement(fa,{setVisibleModalType:Lo,currentItemType:jr,onDelete:ln})))):Pr.createElement(di.Z,{customText:"\u8BF7\u5148\u8BBE\u7F6E\u8BD5\u5377\u9898\u578B",styles:{margin:"70px auto"},ButtonTwo:Pr.createElement(ot.Z,{justify:"center",className:"mt20"},(Kr==null?void 0:Kr.id)&&Pr.createElement(Sn.op,{style:{width:88},onClick:()=>Lo("questionType")},"\u6DFB\u52A0\u9898\u578B"))})),!!(Kr!=null&&Kr.id)&&Pr.createElement("div",{className:hn.fixedBottom},Pr.createElement(na.Z,{className:`${hn.previewBtn} mr20`,onClick:()=>ns(void 0,null,function*(){var Dt,Xi;const Mr=(Dt=er==null?void 0:er.item_types)==null?void 0:Dt.filter(Qi=>{var $i,wi;return(($i=Qi.contents)==null?void 0:$i.length)>0||((wi=Qi==null?void 0:Qi.item_banks)==null?void 0:wi.length)>0});if(!((Xi=er.item_types)!=null&&Xi.length)){ft.ZP.warning("\u8BD5\u9898\u603B\u6570=0\uFF0C\u8BF7\u5148\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219");return}if((Mr==null?void 0:Mr.length)===0){ft.ZP.warning("\u8BD5\u9898\u603B\u6570=0\uFF0C\u8BF7\u5148\u8BBE\u7F6E\u62BD\u9898\u89C4\u5219");return}yield Mt(!0,jr),Oa()})},"\u8BD5\u5377\u9884\u89C8"),Pr.createElement(na.Z,{type:"primary",className:hn.confirmBtn,onClick:()=>Mt()},Pr.createElement("i",{className:"iconfont icon-baocun1 mr5"}),"\u4FDD\u5B58\u8BD5\u5377")),!!(Kr!=null&&Kr.categoryId)&&Pr.createElement("div",{className:hn.fixedBottom,style:{justifyContent:((Pa=er==null?void 0:er.exercise)==null?void 0:Pa.exercise_status)!==1?"end":"center"}},Pr.createElement(na.Z,{className:`${hn.previewBtn} mr20`,onClick:()=>ns(void 0,null,function*(){var Dt,Xi;document.body.scrollIntoView(),Oe.history.push(`/classrooms/${Kr.coursesId}/exercise/${(Dt=er==null?void 0:er.exercise)==null?void 0:Dt.id}/detail?random=${(Xi=er==null?void 0:er.exercise)==null?void 0:Xi.is_random}`)})},"\u8FD4\u56DE"),((xa=er==null?void 0:er.exercise)==null?void 0:xa.exercise_status)===1&&Pr.createElement(na.Z,{className:`${hn.previewBtn} mr20`,onClick:He},"\u6A21\u62DF\u8003\u8BD5"),(er==null?void 0:er.exercise.exercise_status)===1&&Pr.createElement(na.Z,{type:"primary",className:hn.confirmBtn,onClick:()=>Pt()},"\u63D0\u4EA4")),Pr.createElement(Pi,{open:ua==="questionType",onCancel:()=>Lo(""),onOk:Dt=>ns(void 0,null,function*(){var Xi,Mr;const Qi=[],$i=We(er,{type:"setQuestionType",payload:Dt}),wi=((Xi=$i==null?void 0:$i.item_types)==null?void 0:Xi.map(pr=>pr.item_type))||[];for(const pr of((Mr=er==null?void 0:er.item_types)==null?void 0:Mr.map(Hr=>Hr.item_type))||[])wi.includes(pr)||Qi.push(pr);Kr.id&&Qi.length>0&&(yield wt(Kr.id,{item_type:Qi})).status!==0||(ia({type:"setQuestionType",payload:Dt}),oo(jr||$i.item_types[0].item_type),Lo(""))})}),Pr.createElement(xr,{open:ua==="setScore",onCancel:()=>{Lo("")},onOk:Dt=>ns(void 0,null,function*(){console.log("---newData",Dt);const Xi=Dt.item_types.map(Mr=>({item_type:Mr.item_type,score:Mr.score}));Kr.id?(yield ut(Kr.id,{score_settings:Xi})).status===0&&ia({type:"init",payload:Dt}):(yield tt(Kr.categoryId,{score_settings:Xi})).status===0&&ia({type:"init",payload:Dt}),Lo("")})}),Pr.createElement(hr,{open:ua==="rule",onCancel:()=>Lo(""),currentItemType:jr,setVisibleModalType:Lo}),vo.get("type")==="settings"&&Pr.createElement(pi,{open:ua==="selectShixun",onCancel:()=>Lo(""),onOk:Dt=>{if(console.log(Dt),(Dt==null?void 0:Dt.length)<=0){ft.ZP.info("\u5B9E\u8BAD\u6570\u4E0D\u80FD\u4E3A0");return}ia({type:"addShixun",payload:{shixunList:[...Dt]}}),Lo("")}}))},wa=Le(92744),Ba=Le(59301),is=Object.defineProperty,Vo=Object.defineProperties,Ko=Object.getOwnPropertyDescriptors,ni=Object.getOwnPropertySymbols,to=Object.prototype.hasOwnProperty,Xo=Object.prototype.propertyIsEnumerable,Ia=(Yt,Xt,kn)=>Xt in Yt?is(Yt,Xt,{enumerable:!0,configurable:!0,writable:!0,value:kn}):Yt[Xt]=kn,ms=(Yt,Xt)=>{for(var kn in Xt||(Xt={}))to.call(Xt,kn)&&Ia(Yt,kn,Xt[kn]);if(ni)for(var kn of ni(Xt))Xo.call(Xt,kn)&&Ia(Yt,kn,Xt[kn]);return Yt},cs=(Yt,Xt)=>Vo(Yt,Ko(Xt)),yo=(Yt,Xt,kn)=>new Promise((Zi,yi)=>{var Ai=ri=>{try{Rn(kn.next(ri))}catch(ir){yi(ir)}},Li=ri=>{try{Rn(kn.throw(ri))}catch(ir){yi(ir)}},Rn=ri=>ri.done?Zi(ri.value):Promise.resolve(ri.value).then(Ai,Li);Rn((kn=kn.apply(Yt,Xt)).next())}),ls=()=>{var Yt,Xt,kn,Zi;const[yi,Ai]=(0,ue.useState)("baseInfo"),Li=(0,Oe.useDispatch)();(0,ue.useEffect)(()=>{Li({type:"globalSetting/footerToggle",payload:!1})},[]);const Rn=(0,Oe.useParams)(),ri=!!(Rn.id||Rn.categoryId),[ir]=(0,Oe.useSearchParams)();(0,ue.useEffect)(()=>{ir.get("type")==="settings"&&Ai("settings")},[]);const[Rr,ea]=(0,ue.useReducer)(We,null),[_o,Pa]=(0,ue.useState)(!1),xa=()=>yo(void 0,null,function*(){Pa(!0);let jr;Rn.categoryId?jr=yield Pn(Rn):jr=yield Ie(Rn.id),Pa(!1),jr.status===0&&ea({type:"init",payload:jr})});(0,ue.useEffect)(()=>{ri?xa():ea({type:"init",payload:{examination_bank:{difficulty:2}}})},[Rn]);const[vo,Kr]=(0,ue.useState)(""),er=(jr,oo)=>yo(void 0,null,function*(){var Yr,wo,Ra,Ha;const Mt=(Yr=Rr==null?void 0:Rr.item_types)==null?void 0:Yr.filter(He=>{var Dt;return((Dt=He==null?void 0:He.item_type)==null?void 0:Dt.toUpperCase())===(oo==null?void 0:oo.type)}),Pt={sort_by_item_type:Rr.sort_by_item_type,difficulty:Rr.examination_bank.difficulty,exam_notes:Rr.examination_bank.exam_notes,name:Rr.examination_bank.name,time:Rr.examination_bank.time,item_types:Rr.item_types};if(jr!==void 0&&!(jr!=null&&jr.single_question_id)){Pt.seleted_item_bank_ids=jr==null?void 0:jr.seleted_item_bank_ids,Pt.item_types=Mt;const He=yield mn(Pt);if((He==null?void 0:He.status)===0){let Dt=(0,ct.cloneDeep)(Oo.data);Dt.questionList=(wo=Dt==null?void 0:Dt.questionList)==null?void 0:wo.map(Xi=>{var Mr;return Xi.type===oo.type?cs(ms({},Xi),{questions:((Mr=He==null?void 0:He.questions)==null?void 0:Mr.questions)||[]}):Xi}),ua({show:!0,data:Dt})}return}if(jr!==void 0&&(jr!=null&&jr.single_question_id)){Pt.seleted_item_bank_ids=jr==null?void 0:jr.seleted_item_bank_ids,Pt.single_question_id=jr==null?void 0:jr.single_question_id,Pt.item_types=Mt;const He=yield mn(Pt);if((He==null?void 0:He.status)===0){let Dt=(0,ct.cloneDeep)(Oo.data);Dt.questionList=(Ra=Dt==null?void 0:Dt.questionList)==null?void 0:Ra.map(Xi=>{var Mr,Qi;if(Xi.type===oo.type){const $i=(0,ct.cloneDeep)(Xi==null?void 0:Xi.questions);return $i.splice(oo.index,1,(Qi=(Mr=He==null?void 0:He.questions)==null?void 0:Mr.questions)==null?void 0:Qi[0]),console.log(Xi==null?void 0:Xi.questions,$i,oo.index,"new_questions"),cs(ms({},Xi),{questions:$i})}return Xi}),ua({show:!0,data:Dt})}return}const ln=yield Lt(Pt);if((ln==null?void 0:ln.status)===0){const He=(0,Vt.ad)(ln);let Dt=[];(Ha=Rr==null?void 0:Rr.item_types)==null||Ha.forEach(Xi=>{var Mr;const Qi=(Mr=He==null?void 0:He.questionList)==null?void 0:Mr.find($i=>Xi.item_type===$i.type);Dt.push(Qi)}),console.log(Rr,"sortList"),Dt=(0,ct.compact)(Dt),He.questionList=Dt,ua({show:!0,data:He}),Kr(new Date)}}),ia=jr=>{var oo;let Yr=(0,ct.cloneDeep)(Oo.data);Yr.questionList=(oo=Yr==null?void 0:Yr.questionList)==null?void 0:oo.map(wo=>wo.type===jr.type?cs(ms({},wo),{questions_score:jr.scoreTotal}):wo),ea({type:"changeQuestionScore",payload:{score:jr.score,itemType:jr.type}}),ua({show:!0,data:Yr})},sa=jr=>yo(void 0,null,function*(){const oo={sort_by_item_type:Rr.sort_by_item_type,difficulty:Rr.examination_bank.difficulty,exam_notes:Rr.examination_bank.exam_notes,name:Rr.examination_bank.name,time:Rr.examination_bank.time,item_types:Rr.item_types,sub_discipline_id:Rr.examination_bank.sub_discipline_id};if(jr){(yield $t(ms(ms({},oo),jr))).status===0&&ft.ZP.success("\u4FDD\u5B58\u6210\u529F");return}(yield Re(Rn.id,oo)).status===0&&(ft.ZP.success("\u63D0\u4EA4\u6210\u529F"),Oe.history.push("/paperlibrary?defaultActiveKey=0"))}),Ma=(0,ca.g)(),[Oa]=yt.default.useForm(),[Oo,ua]=(0,ue.useState)({show:!1,data:{}}),Lo=!!((Yt=Rr==null?void 0:Rr.exercise)!=null&&Yt.exercise_status)&&((Xt=Rr==null?void 0:Rr.exercise)==null?void 0:Xt.exercise_status)!==1;return Ba.createElement(lt.Provider,{value:{data:Rr,disabled:Lo,dispatch:ea,setPreview:ua,getData:xa,handlePreview:er}},Oo.show?Ba.createElement(wa.Z,{key:vo,data:Oo.data,onExchange:er,onTypeScore:ia,submit:sa,goBack:()=>ua({show:!1,data:{}})}):Ba.createElement("div",{className:Ke.wrapper},Ba.createElement("div",{className:"edu-container"},Ba.createElement(mt.Z,{className:Ke.breadCrumbWrapper,separator:">",items:Rn!=null&&Rn.categoryId?[{title:Ba.createElement(Oe.Link,{to:`/classrooms/${Rn.coursesId}/exercise`},(Zi=(kn=(0,zt.eY)())==null?void 0:kn.course)==null?void 0:Zi.course_name)},{title:Ba.createElement(Oe.Link,{to:`/classrooms/${Rn.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:yi,tabs:[{key:"baseInfo",label:"\u8BD5\u5377\u57FA\u7840\u4FE1\u606F"},{key:"settings",label:"\u7EC4\u5377\u914D\u7F6E"}],onChange:jr=>yo(void 0,null,function*(){if(jr==="settings"&&(yield Oa.validateFields(),!ri)){const oo=yield rt(Rr);oo.status===0&&Oe.history.replace(`/randompaper/edit/${oo==null?void 0:oo.examination_bank_id}?type=settings`)}Ai(jr)})}),yi==="baseInfo"&&Ba.createElement(fr,{courseOptions:Ma,setCurrentKey:Ai,loading:_o,form:Oa}),Ba.createElement("div",{style:{display:yi==="settings"?"block":"none"}},Rr&&Ba.createElement(Vr,null)))))}},86918:function(Un,ai,Le){"use strict";Le.d(ai,{Z:function(){return Ge}});var ue=Le(62957),Ke={ul:"ul___TdfYY"},ft=Le(32637),yt=Le(59301),mt=Object.getOwnPropertySymbols,Oe=Object.prototype.hasOwnProperty,at=Object.prototype.propertyIsEnumerable,Ct=(Rt,ot)=>{var At={};for(var Te in Rt)Oe.call(Rt,Te)&&ot.indexOf(Te)<0&&(At[Te]=Rt[Te]);if(Rt!=null&&mt)for(var Te of mt(Rt))ot.indexOf(Te)<0&&at.call(Rt,Te)&&(At[Te]=Rt[Te]);return At},Ge=Rt=>{var ot=Rt,{open:At,onCancel:Te}=ot,ne=Ct(ot,["open","onCancel"]);return yt.createElement(ue.default,{centered:!0,open:At,title:yt.createElement("div",{style:{fontWeight:"bold"}},"\u8054\u7CFB\u6559\u7814\u52A9\u7406"),width:"696px",onCancel:Te,footer:null},yt.createElement("div",null,yt.createElement("div",{className:"tc"},yt.createElement("img",{className:"mt10",src:ft,width:"182px",height:"181px",style:{borderRadius:"2px",border:"1px solid #D8E3E9"}})),yt.createElement("div",{style:{color:"#191919",fontWeight:"bold"},className:"tc font16 mt10"},"\u514D\u8D39\u6559\u7814\u52A9\u7406"),yt.createElement("div",{style:{color:"#191919",fontWeight:"bold"},className:"tc font16"},"\u5FAE\u4FE1\u626B\u4E00\u626B\u6DFB\u52A0"),yt.createElement("div",{style:{color:"#333"},className:"pt30 font14"},yt.createElement("ul",{className:Ke.ul},yt.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"),yt.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"),yt.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")))))}},94860:function(Un,ai,Le){"use strict";Le.d(ai,{g:function(){return mt}});var ue=Le(59301),Ke=Le(80401),ft=Le(26422),yt=(Oe,at,Ct)=>new Promise((dt,Ge)=>{var Rt=Te=>{try{At(Ct.next(Te))}catch(ne){Ge(ne)}},ot=Te=>{try{At(Ct.throw(Te))}catch(ne){Ge(ne)}},At=Te=>Te.done?dt(Te.value):Promise.resolve(Te.value).then(Rt,ot);At((Ct=Ct.apply(Oe,at)).next())});const mt=()=>{const[Oe,at]=(0,ue.useState)([]);return(0,ue.useEffect)(()=>{yt(void 0,null,function*(){const dt=yield(0,Ke.d1)({source:"question"});dt!=null&&dt.disciplines&&at((0,ft.L)(dt==null?void 0:dt.disciplines))})},[]),Oe}},83312:function(Un,ai,Le){"use strict";Le.d(ai,{U:function(){return dt}});var ue=Le(59301),Ke=Object.defineProperty,ft=Object.getOwnPropertySymbols,yt=Object.prototype.hasOwnProperty,mt=Object.prototype.propertyIsEnumerable,Oe=(Ge,Rt,ot)=>Rt in Ge?Ke(Ge,Rt,{enumerable:!0,configurable:!0,writable:!0,value:ot}):Ge[Rt]=ot,at=(Ge,Rt)=>{for(var ot in Rt||(Rt={}))yt.call(Rt,ot)&&Oe(Ge,ot,Rt[ot]);if(ft)for(var ot of ft(Rt))mt.call(Rt,ot)&&Oe(Ge,ot,Rt[ot]);return Ge},Ct=(Ge,Rt,ot)=>new Promise((At,Te)=>{var ne=se=>{try{de(ot.next(se))}catch(pe){Te(pe)}},te=se=>{try{de(ot.throw(se))}catch(pe){Te(pe)}},de=se=>se.done?At(se.value):Promise.resolve(se.value).then(ne,te);de((ot=ot.apply(Ge,Rt)).next())});function dt(Ge,Rt){const[ot,At]=(0,ue.useState)(Rt),[Te,ne]=(0,ue.useState)(!1),[te,de]=(0,ue.useState)();return[ot,Te,(pe,ye=!1)=>Ct(this,null,function*(){const we=ye?Rt:at(at({},ot),pe);ne(!0),At(we);const be=yield Ge(we);return ne(!1),de(be),be}),te,de]}},24768:function(Un,ai,Le){"use strict";Le.d(ai,{AL:function(){return we},Iy:function(){return Rt},Qv:function(){return Te},ez:function(){return ye},jb:function(){return ot}});var ue=Le(32834),Ke=Le.n(ue),ft=Le(11690),yt=Le.n(ft);let mt=1;function Oe(et,Ye){const ut=et.match(/^(\s+)(?:```)/);if(ut===null)return Ye;const tt=ut[1];return Ye.split(`
|
|
`).map(wt=>{const St=wt.match(/^\s+/);if(St===null)return wt;const[Lt]=St;return Lt.length>=tt.length?wt.slice(tt.length):wt}).join(`
|
|
`)}let at=[],Ct=["<ul>"];const dt=new(Ke()).Renderer,Ge=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function Rt(){at.length=0,Ct=["<ul>"]}const ot={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function At(et,Ye,ut,tt){if(Ye>=et.length||et[Ye].level<=ut)return Ye;var wt=et[Ye];tt.push("<li><a href='#"+mt+wt.anchor+"'>"+wt.text+"</a>"),Ye++;var St=[];return Ye=At(et,Ye,wt.level,St),St.length>0&&(tt.push("<ul>"),St.forEach(function(Lt){tt.push(Lt)}),tt.push("</ul>")),tt.push("</li>"),Ye=At(et,Ye,ut,tt),Ye}function Te(){return At(at,0,0,Ct),Ct.push("</ul>"),Ct.join("")}const ne={heading(et){const Ye=Ge.exec(et);if(mt+=1,Ye)return{type:"heading",raw:Ye[0],depth:Ye[1].length,text:Ye[2]}},fences(et){const Ye=this.rules.block.fences.exec(et);if(Ye){const ut=Ye[0];let tt=Oe(ut,Ye[3]||"");const wt=Ye[2]?Ye[2].trim():Ye[2];if(["latex","katex","math"].indexOf(wt)>=0){const St=se(),Lt=tt;tt=St,pe[St]={type:"block",expression:Lt}}return{type:"code",raw:ut,lang:wt,text:tt}}}},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 be(et){return et=et.replace(te,(Ye,ut)=>{const tt=se();return pe[tt]={type:"inline",expression:ut},tt}),et}const Ie=dt.listitem;dt.listitem=function(et){return Ie(be(et))};const Re=dt.paragraph;dt.paragraph=function(et){return Re(be(et))};const rt=dt.tablecell;dt.tablecell=function(et,Ye){return rt(be(et),Ye)},dt.code=function(et,Ye,ut){const tt=(Ye||"").match(/\S*/)[0];return tt?["latex","katex","math"].indexOf(tt)>=0?`<p class='editormd-tex'>${et}</p>`:`<pre class="prettyprint linenums"><code class="language-${Ye}">${ut?et:(0,ft.escape)(et,!0)}</code></pre>
|
|
`:'<pre class="prettyprint linenums"><code>'+(ut?et:(0,ft.escape)(et,!0))+"</code></pre>"},dt.heading=function(et,Ye,ut){let tt=this.options.headerPrefix+ut.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return at.push({anchor:tt,level:Ye,text:et}),"<h"+Ye+' id="'+mt+tt+'">'+et+"</h"+Ye+">"},Ke().setOptions({silent:!0,gfm:!0,pedantic:!1}),Ke().use({tokenizer:ne,renderer:dt}),ai.ZP=Ke()},71114:function(Un,ai,Le){"use strict";Le.d(ai,{Z:function(){return Ye}});var ue=Le(59301),Ke=Le(92310),ft=Le.n(Ke),yt=Le(48755),mt=Le(83397),Oe=Le(93083),at=Le(63356),Ct=Le(16931),dt=Le(51636);const Ge=ut=>{const{componentCls:tt,calc:wt}=ut;return{[tt]:Object.assign(Object.assign({},(0,at.Wf)(ut)),{margin:0,padding:0,listStyle:"none",[`${tt}-item`]:{position:"relative",margin:0,paddingBottom:ut.itemPaddingBottom,fontSize:ut.fontSize,listStyle:"none","&-tail":{position:"absolute",insetBlockStart:ut.itemHeadSize,insetInlineStart:wt(wt(ut.itemHeadSize).sub(ut.tailWidth)).div(2).equal(),height:`calc(100% - ${(0,Oe.unit)(ut.itemHeadSize)})`,borderInlineStart:`${(0,Oe.unit)(ut.tailWidth)} ${ut.lineType} ${ut.tailColor}`},"&-pending":{[`${tt}-item-head`]:{fontSize:ut.fontSizeSM,backgroundColor:"transparent"},[`${tt}-item-tail`]:{display:"none"}},"&-head":{position:"absolute",width:ut.itemHeadSize,height:ut.itemHeadSize,backgroundColor:ut.dotBg,border:`${(0,Oe.unit)(ut.dotBorderWidth)} ${ut.lineType} transparent`,borderRadius:"50%","&-blue":{color:ut.colorPrimary,borderColor:ut.colorPrimary},"&-red":{color:ut.colorError,borderColor:ut.colorError},"&-green":{color:ut.colorSuccess,borderColor:ut.colorSuccess},"&-gray":{color:ut.colorTextDisabled,borderColor:ut.colorTextDisabled}},"&-head-custom":{position:"absolute",insetBlockStart:wt(ut.itemHeadSize).div(2).equal(),insetInlineStart:wt(ut.itemHeadSize).div(2).equal(),width:"auto",height:"auto",marginBlockStart:0,paddingBlock:ut.customHeadPaddingVertical,lineHeight:1,textAlign:"center",border:0,borderRadius:0,transform:"translate(-50%, -50%)"},"&-content":{position:"relative",insetBlockStart:wt(wt(ut.fontSize).mul(ut.lineHeight).sub(ut.fontSize)).mul(-1).add(ut.lineWidth).equal(),marginInlineStart:wt(ut.margin).add(ut.itemHeadSize).equal(),marginInlineEnd:0,marginBlockStart:0,marginBlockEnd:0,wordBreak:"break-word"},"&-last":{[`> ${tt}-item-tail`]:{display:"none"},[`> ${tt}-item-content`]:{minHeight:wt(ut.controlHeightLG).mul(1.2).equal()}}},[`&${tt}-alternate,
|
|
&${tt}-right,
|
|
&${tt}-label`]:{[`${tt}-item`]:{"&-tail, &-head, &-head-custom":{insetInlineStart:"50%"},"&-head":{marginInlineStart:wt(ut.marginXXS).mul(-1).equal(),"&-custom":{marginInlineStart:wt(ut.tailWidth).div(2).equal()}},"&-left":{[`${tt}-item-content`]:{insetInlineStart:`calc(50% - ${(0,Oe.unit)(ut.marginXXS)})`,width:`calc(50% - ${(0,Oe.unit)(ut.marginSM)})`,textAlign:"start"}},"&-right":{[`${tt}-item-content`]:{width:`calc(50% - ${(0,Oe.unit)(ut.marginSM)})`,margin:0,textAlign:"end"}}}},[`&${tt}-right`]:{[`${tt}-item-right`]:{[`${tt}-item-tail,
|
|
${tt}-item-head,
|
|
${tt}-item-head-custom`]:{insetInlineStart:`calc(100% - ${(0,Oe.unit)(wt(wt(ut.itemHeadSize).add(ut.tailWidth)).div(2).equal())})`},[`${tt}-item-content`]:{width:`calc(100% - ${(0,Oe.unit)(wt(ut.itemHeadSize).add(ut.marginXS).equal())})`}}},[`&${tt}-pending
|
|
${tt}-item-last
|
|
${tt}-item-tail`]:{display:"block",height:`calc(100% - ${(0,Oe.unit)(ut.margin)})`,borderInlineStart:`${(0,Oe.unit)(ut.tailWidth)} dotted ${ut.tailColor}`},[`&${tt}-reverse
|
|
${tt}-item-last
|
|
${tt}-item-tail`]:{display:"none"},[`&${tt}-reverse ${tt}-item-pending`]:{[`${tt}-item-tail`]:{insetBlockStart:ut.margin,display:"block",height:`calc(100% - ${(0,Oe.unit)(ut.margin)})`,borderInlineStart:`${(0,Oe.unit)(ut.tailWidth)} dotted ${ut.tailColor}`},[`${tt}-item-content`]:{minHeight:wt(ut.controlHeightLG).mul(1.2).equal()}},[`&${tt}-label`]:{[`${tt}-item-label`]:{position:"absolute",insetBlockStart:wt(wt(ut.fontSize).mul(ut.lineHeight).sub(ut.fontSize)).mul(-1).add(ut.tailWidth).equal(),width:`calc(50% - ${(0,Oe.unit)(ut.marginSM)})`,textAlign:"end"},[`${tt}-item-right`]:{[`${tt}-item-label`]:{insetInlineStart:`calc(50% + ${(0,Oe.unit)(ut.marginSM)})`,width:`calc(50% - ${(0,Oe.unit)(ut.marginSM)})`,textAlign:"start"}}},"&-rtl":{direction:"rtl",[`${tt}-item-head-custom`]:{transform:"translate(50%, -50%)"}}})}},Rt=ut=>({tailColor:ut.colorSplit,tailWidth:ut.lineWidthBold,dotBorderWidth:ut.wireframe?ut.lineWidthBold:ut.lineWidth*3,dotBg:ut.colorBgContainer,itemPaddingBottom:ut.padding*1.25});var ot=(0,Ct.I$)("Timeline",ut=>{const tt=(0,dt.mergeToken)(ut,{itemHeadSize:10,customHeadPaddingVertical:ut.paddingXXS,paddingInlineEnd:2});return[Ge(tt)]},Rt),At=function(ut,tt){var wt={};for(var St in ut)Object.prototype.hasOwnProperty.call(ut,St)&&tt.indexOf(St)<0&&(wt[St]=ut[St]);if(ut!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Lt=0,St=Object.getOwnPropertySymbols(ut);Lt<St.length;Lt++)tt.indexOf(St[Lt])<0&&Object.prototype.propertyIsEnumerable.call(ut,St[Lt])&&(wt[St[Lt]]=ut[St[Lt]]);return wt},ne=ut=>{var{prefixCls:tt,className:wt,color:St="blue",dot:Lt,pending:mn=!1,position:$t,label:Pn,children:Ot}=ut,ct=At(ut,["prefixCls","className","color","dot","pending","position","label","children"]);const{getPrefixCls:nt}=ue.useContext(yt.E_),gn=nt("timeline",tt),oi=ft()(`${gn}-item`,{[`${gn}-item-pending`]:mn},wt),zn=/blue|red|green|gray/.test(St||"")?void 0:St,Ht=ft()(`${gn}-item-head`,{[`${gn}-item-head-custom`]:!!Lt,[`${gn}-item-head-${St}`]:!zn});return ue.createElement("li",Object.assign({},ct,{className:oi}),Pn&&ue.createElement("div",{className:`${gn}-item-label`},Pn),ue.createElement("div",{className:`${gn}-item-tail`}),ue.createElement("div",{className:Ht,style:{borderColor:zn,color:zn}},Lt),ue.createElement("div",{className:`${gn}-item-content`},Ot))},te=Le(80702),de=Le(58617),se=function(ut,tt){var wt={};for(var St in ut)Object.prototype.hasOwnProperty.call(ut,St)&&tt.indexOf(St)<0&&(wt[St]=ut[St]);if(ut!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Lt=0,St=Object.getOwnPropertySymbols(ut);Lt<St.length;Lt++)tt.indexOf(St[Lt])<0&&Object.prototype.propertyIsEnumerable.call(ut,St[Lt])&&(wt[St[Lt]]=ut[St[Lt]]);return wt},ye=ut=>{var{prefixCls:tt,className:wt,pending:St=!1,children:Lt,items:mn,rootClassName:$t,reverse:Pn=!1,direction:Ot,hashId:ct,pendingDot:nt,mode:gn=""}=ut,oi=se(ut,["prefixCls","className","pending","children","items","rootClassName","reverse","direction","hashId","pendingDot","mode"]);const zn=(An,Ni)=>gn==="alternate"?An==="right"?`${tt}-item-right`:An==="left"?`${tt}-item-left`:Ni%2===0?`${tt}-item-left`:`${tt}-item-right`:gn==="left"?`${tt}-item-left`:gn==="right"?`${tt}-item-right`:An==="right"?`${tt}-item-right`:"",Ht=(0,te.Z)(mn||[]),Fn=typeof St=="boolean"?null:St;St&&Ht.push({pending:!!St,dot:nt||ue.createElement(de.Z,null),children:Fn}),Pn&&Ht.reverse();const Cn=Ht.length,ii=`${tt}-item-last`,Wt=Ht.filter(An=>!!An).map((An,Ni)=>{var je;const Me=Ni===Cn-2?ii:"",Ee=Ni===Cn-1?ii:"",{className:De}=An,We=se(An,["className"]);return ue.createElement(ne,Object.assign({},We,{className:ft()([De,!Pn&&St?Me:Ee,zn((je=An==null?void 0:An.position)!==null&&je!==void 0?je:"",Ni)]),key:(An==null?void 0:An.key)||Ni}))}),Hn=Ht.some(An=>!!(An!=null&&An.label)),lt=ft()(tt,{[`${tt}-pending`]:!!St,[`${tt}-reverse`]:!!Pn,[`${tt}-${gn}`]:!!gn&&!Hn,[`${tt}-label`]:Hn,[`${tt}-rtl`]:Ot==="rtl"},wt,$t,ct);return ue.createElement("ul",Object.assign({},oi,{className:lt}),Wt)},we=Le(11592);function be(ut,tt){return ut&&Array.isArray(ut)?ut:(0,we.Z)(tt).map(wt=>{var St,Lt;return Object.assign({children:(Lt=(St=wt==null?void 0:wt.props)===null||St===void 0?void 0:St.children)!==null&&Lt!==void 0?Lt:""},wt.props)})}var Ie=be,Re=function(ut,tt){var wt={};for(var St in ut)Object.prototype.hasOwnProperty.call(ut,St)&&tt.indexOf(St)<0&&(wt[St]=ut[St]);if(ut!=null&&typeof Object.getOwnPropertySymbols=="function")for(var Lt=0,St=Object.getOwnPropertySymbols(ut);Lt<St.length;Lt++)tt.indexOf(St[Lt])<0&&Object.prototype.propertyIsEnumerable.call(ut,St[Lt])&&(wt[St[Lt]]=ut[St[Lt]]);return wt};const rt=ut=>{const{getPrefixCls:tt,direction:wt,timeline:St}=ue.useContext(yt.E_),{prefixCls:Lt,children:mn,items:$t,className:Pn,style:Ot}=ut,ct=Re(ut,["prefixCls","children","items","className","style"]),nt=tt("timeline",Lt),gn=(0,mt.Z)(nt),[oi,zn,Ht]=ot(nt,gn),Fn=Ie($t,mn);return oi(ue.createElement(ye,Object.assign({},ct,{className:ft()(St==null?void 0:St.className,Pn,Ht,gn),style:Object.assign(Object.assign({},St==null?void 0:St.style),Ot),prefixCls:nt,direction:wt,items:Fn,hashId:zn})))};rt.Item=ne;var et=rt,Ye=et},99498:function(Un,ai,Le){(function(ue){ue(Le(89780))})(function(ue){ue.defineOption("placeholder","",function(Ct,dt,Ge){var Rt=Ge&&Ge!=ue.Init;if(dt&&!Rt)Ct.on("blur",mt),Ct.on("change",Oe),Ct.on("swapDoc",Oe),ue.on(Ct.getInputField(),"compositionupdate",Ct.state.placeholderCompose=function(){yt(Ct)}),Oe(Ct);else if(!dt&&Rt){Ct.off("blur",mt),Ct.off("change",Oe),Ct.off("swapDoc",Oe),ue.off(Ct.getInputField(),"compositionupdate",Ct.state.placeholderCompose),Ke(Ct);var ot=Ct.getWrapperElement();ot.className=ot.className.replace(" CodeMirror-empty","")}dt&&!Ct.hasFocus()&&mt(Ct)});function Ke(Ct){Ct.state.placeholder&&(Ct.state.placeholder.parentNode.removeChild(Ct.state.placeholder),Ct.state.placeholder=null)}function ft(Ct){Ke(Ct);var dt=Ct.state.placeholder=document.createElement("pre");dt.style.cssText="height: 0; overflow: visible",dt.style.direction=Ct.getOption("direction"),dt.className="CodeMirror-placeholder CodeMirror-line-like";var Ge=Ct.getOption("placeholder");typeof Ge=="string"&&(Ge=document.createTextNode(Ge)),dt.appendChild(Ge),Ct.display.lineSpace.insertBefore(dt,Ct.display.lineSpace.firstChild)}function yt(Ct){setTimeout(function(){var dt=!1,Ge=Ct.getInputField();Ge.nodeName=="TEXTAREA"?dt=!Ge.value:Ct.lineCount()==1&&(dt=!/[^\u200b]/.test(Ge.querySelector(".CodeMirror-line").textContent)),dt?ft(Ct):Ke(Ct)},20)}function mt(Ct){at(Ct)&&ft(Ct)}function Oe(Ct){var dt=Ct.getWrapperElement(),Ge=at(Ct);dt.className=dt.className.replace(" CodeMirror-empty","")+(Ge?" CodeMirror-empty":""),Ge?ft(Ct):Ke(Ct)}function at(Ct){return Ct.lineCount()===1&&Ct.getLine(0)===""}})},25717:function(Un,ai,Le){(function(ue){ue(Le(89780))})(function(ue){var Ke={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},ft=ue.Pos;ue.defineOption("autoCloseBrackets",!1,function(ne,te,de){de&&de!=ue.Init&&(ne.removeKeyMap(mt),ne.state.closeBrackets=null),te&&(Oe(yt(te,"pairs")),ne.state.closeBrackets=te,ne.addKeyMap(mt))});function yt(ne,te){return te=="pairs"&&typeof ne=="string"?ne:typeof ne=="object"&&ne[te]!=null?ne[te]:Ke[te]}var mt={Backspace:dt,Enter:Ge};function Oe(ne){for(var te=0;te<ne.length;te++){var de=ne.charAt(te),se="'"+de+"'";mt[se]||(mt[se]=at(de))}}Oe(Ke.pairs+"`");function at(ne){return function(te){return ot(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 dt(ne){var te=Ct(ne);if(!te||ne.getOption("disableInput"))return ue.Pass;for(var de=yt(te,"pairs"),se=ne.listSelections(),pe=0;pe<se.length;pe++){if(!se[pe].empty())return ue.Pass;var ye=At(ne,se[pe].head);if(!ye||de.indexOf(ye)%2!=0)return ue.Pass}for(var pe=se.length-1;pe>=0;pe--){var we=se[pe].head;ne.replaceRange("",ft(we.line,we.ch-1),ft(we.line,we.ch+1),"+delete")}}function Ge(ne){var te=Ct(ne),de=te&&yt(te,"explode");if(!de||ne.getOption("disableInput"))return ue.Pass;for(var se=ne.listSelections(),pe=0;pe<se.length;pe++){if(!se[pe].empty())return ue.Pass;var ye=At(ne,se[pe].head);if(!ye||de.indexOf(ye)%2!=0)return ue.Pass}ne.operation(function(){var we=ne.lineSeparator()||`
|
|
`;ne.replaceSelection(we+we,null),ne.execCommand("goCharLeft"),se=ne.listSelections();for(var be=0;be<se.length;be++){var Ie=se[be].head.line;ne.indentLine(Ie,null,!0),ne.indentLine(Ie+1,null,!0)}})}function Rt(ne){var te=ue.cmpPos(ne.anchor,ne.head)>0;return{anchor:new ft(ne.anchor.line,ne.anchor.ch+(te?-1:1)),head:new ft(ne.head.line,ne.head.ch+(te?1:-1))}}function ot(ne,te){var de=Ct(ne);if(!de||ne.getOption("disableInput"))return ue.Pass;var se=yt(de,"pairs"),pe=se.indexOf(te);if(pe==-1)return ue.Pass;for(var ye=yt(de,"closeBefore"),we=yt(de,"triples"),be=se.charAt(pe+1)==te,Ie=ne.listSelections(),Re=pe%2==0,rt,et=0;et<Ie.length;et++){var Ye=Ie[et],ut=Ye.head,tt,wt=ne.getRange(ut,ft(ut.line,ut.ch+1));if(Re&&!Ye.empty())tt="surround";else if((be||!Re)&&wt==te)be&&Te(ne,ut)?tt="both":we.indexOf(te)>=0&&ne.getRange(ut,ft(ut.line,ut.ch+3))==te+te+te?tt="skipThree":tt="skip";else if(be&&ut.ch>1&&we.indexOf(te)>=0&&ne.getRange(ft(ut.line,ut.ch-2),ut)==te+te){if(ut.ch>2&&/\bstring/.test(ne.getTokenTypeAt(ft(ut.line,ut.ch-2))))return ue.Pass;tt="addFour"}else if(be){var St=ut.ch==0?" ":ne.getRange(ft(ut.line,ut.ch-1),ut);if(!ue.isWordChar(wt)&&St!=te&&!ue.isWordChar(St))tt="both";else return ue.Pass}else if(Re&&(wt.length===0||/\s/.test(wt)||ye.indexOf(wt)>-1))tt="both";else return ue.Pass;if(!rt)rt=tt;else if(rt!=tt)return ue.Pass}var Lt=pe%2?se.charAt(pe-1):te,mn=pe%2?te:se.charAt(pe+1);ne.operation(function(){if(rt=="skip")ne.execCommand("goCharRight");else if(rt=="skipThree")for(var $t=0;$t<3;$t++)ne.execCommand("goCharRight");else if(rt=="surround"){for(var Pn=ne.getSelections(),$t=0;$t<Pn.length;$t++)Pn[$t]=Lt+Pn[$t]+mn;ne.replaceSelections(Pn,"around"),Pn=ne.listSelections().slice();for(var $t=0;$t<Pn.length;$t++)Pn[$t]=Rt(Pn[$t]);ne.setSelections(Pn)}else rt=="both"?(ne.replaceSelection(Lt+mn,null),ne.triggerElectric(Lt+mn),ne.execCommand("goCharLeft")):rt=="addFour"&&(ne.replaceSelection(Lt+Lt+Lt+Lt,"before"),ne.execCommand("goCharRight"))})}function At(ne,te){var de=ne.getRange(ft(te.line,te.ch-1),ft(te.line,te.ch+1));return de.length==2?de:null}function Te(ne,te){var de=ne.getTokenAt(ft(te.line,te.ch+1));return/\bstring/.test(de.type)&&de.start==te.ch&&(te.ch==0||!/\bstring/.test(ne.getTokenTypeAt(te)))}})},6313:function(Un,ai,Le){(function(ue){ue(Le(89780),Le(32855))})(function(ue){ue.defineOption("autoCloseTags",!1,function(dt,Ge,Rt){if(Rt!=ue.Init&&Rt&&dt.removeKeyMap("autoCloseTags"),!!Ge){var ot={name:"autoCloseTags"};(typeof Ge!="object"||Ge.whenClosing!==!1)&&(ot["'/'"]=function(At){return Oe(At)}),(typeof Ge!="object"||Ge.whenOpening!==!1)&&(ot["'>'"]=function(At){return yt(At)}),dt.addKeyMap(ot)}});var Ke=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],ft=["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 yt(dt){if(dt.getOption("disableInput"))return ue.Pass;for(var Ge=dt.listSelections(),Rt=[],ot=dt.getOption("autoCloseTags"),At=0;At<Ge.length;At++){if(!Ge[At].empty())return ue.Pass;var Te=Ge[At].head,ne=dt.getTokenAt(Te),te=ue.innerMode(dt.getMode(),ne.state),de=te.state,se=te.mode.xmlCurrentTag&&te.mode.xmlCurrentTag(de),pe=se&&se.name;if(!pe)return ue.Pass;var ye=te.mode.configuration=="html",we=typeof ot=="object"&&ot.dontCloseTags||ye&&Ke,be=typeof ot=="object"&&ot.indentTags||ye&&ft;ne.end>Te.ch&&(pe=pe.slice(0,pe.length-ne.end+Te.ch));var Ie=pe.toLowerCase();if(!pe||ne.type=="string"&&(ne.end!=Te.ch||!/[\"\']/.test(ne.string.charAt(ne.string.length-1))||ne.string.length==1)||ne.type=="tag"&&se.close||ne.string.indexOf("/")==Te.ch-ne.start-1||we&&at(we,Ie)>-1||Ct(dt,te.mode.xmlCurrentContext&&te.mode.xmlCurrentContext(de)||[],pe,Te,!0))return ue.Pass;var Re=typeof ot=="object"&&ot.emptyTags;if(Re&&at(Re,pe)>-1){Rt[At]={text:"/>",newPos:ue.Pos(Te.line,Te.ch+2)};continue}var rt=be&&at(be,Ie)>-1;Rt[At]={indent:rt,text:">"+(rt?`
|
|
|
|
`:"")+"</"+pe+">",newPos:rt?ue.Pos(Te.line+1,0):ue.Pos(Te.line,Te.ch+1)}}for(var et=typeof ot=="object"&&ot.dontIndentOnAutoClose,At=Ge.length-1;At>=0;At--){var Ye=Rt[At];dt.replaceRange(Ye.text,Ge[At].head,Ge[At].anchor,"+insert");var ut=dt.listSelections().slice(0);ut[At]={head:Ye.newPos,anchor:Ye.newPos},dt.setSelections(ut),!et&&Ye.indent&&(dt.indentLine(Ye.newPos.line,null,!0),dt.indentLine(Ye.newPos.line+1,null,!0))}}function mt(dt,Ge){for(var Rt=dt.listSelections(),ot=[],At=Ge?"/":"</",Te=dt.getOption("autoCloseTags"),ne=typeof Te=="object"&&Te.dontIndentOnSlash,te=0;te<Rt.length;te++){if(!Rt[te].empty())return ue.Pass;var de=Rt[te].head,se=dt.getTokenAt(de),pe=ue.innerMode(dt.getMode(),se.state),ye=pe.state;if(Ge&&(se.type=="string"||se.string.charAt(0)!="<"||se.start!=de.ch-1))return ue.Pass;var we,be=pe.mode.name!="xml"&&dt.getMode().name=="htmlmixed";if(be&&pe.mode.name=="javascript")we=At+"script";else if(be&&pe.mode.name=="css")we=At+"style";else{var Ie=pe.mode.xmlCurrentContext&&pe.mode.xmlCurrentContext(ye);if(!Ie||Ie.length&&Ct(dt,Ie,Ie[Ie.length-1],de))return ue.Pass;we=At+Ie[Ie.length-1]}dt.getLine(de.line).charAt(se.end)!=">"&&(we+=">"),ot[te]=we}if(dt.replaceSelections(ot),Rt=dt.listSelections(),!ne)for(var te=0;te<Rt.length;te++)(te==Rt.length-1||Rt[te].head.line<Rt[te+1].head.line)&&dt.indentLine(Rt[te].head.line)}function Oe(dt){return dt.getOption("disableInput")?ue.Pass:mt(dt,!0)}ue.commands.closeTag=function(dt){return mt(dt)};function at(dt,Ge){if(dt.indexOf)return dt.indexOf(Ge);for(var Rt=0,ot=dt.length;Rt<ot;++Rt)if(dt[Rt]==Ge)return Rt;return-1}function Ct(dt,Ge,Rt,ot,At){if(!ue.scanForClosingTag)return!1;var Te=Math.min(dt.lastLine()+1,ot.line+500),ne=ue.scanForClosingTag(dt,ot,null,Te);if(!ne||ne.tag!=Rt)return!1;for(var te=At?1:0,de=Ge.length-1;de>=0&&Ge[de]==Rt;de--)++te;ot=ne.to;for(var de=1;de<te;de++){var se=ue.scanForClosingTag(dt,ot,null,Te);if(!se||se.tag!=Rt)return!1;ot=se.to}return!0}})},32855:function(Un,ai,Le){(function(ue){ue(Le(89780))})(function(ue){"use strict";var Ke=ue.Pos;function ft(de,se){return de.line-se.line||de.ch-se.ch}var yt="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",mt=yt+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Oe=new RegExp("<(/?)(["+yt+"]["+mt+"]*)","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(Ke(de.line,se));return pe&&/\btag\b/.test(pe)}function dt(de){if(!(de.line>=de.max))return de.ch=0,de.text=de.cm.getLine(++de.line),!0}function Ge(de){if(!(de.line<=de.min))return de.text=de.cm.getLine(--de.line),de.ch=de.text.length,!0}function Rt(de){for(;;){var se=de.text.indexOf(">",de.ch);if(se==-1){if(dt(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 ot(de){for(;;){var se=de.ch?de.text.lastIndexOf("<",de.ch-1):-1;if(se==-1){if(Ge(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 At(de){for(;;){Oe.lastIndex=de.ch;var se=Oe.exec(de.text);if(!se){if(dt(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 Te(de){for(;;){var se=de.ch?de.text.lastIndexOf(">",de.ch-1):-1;if(se==-1){if(Ge(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=At(de),we,be=de.line,Ie=de.ch-(ye?ye[0].length:0);if(!ye||!(we=Rt(de)))return;if(we!="selfClose")if(ye[1]){for(var Re=pe.length-1;Re>=0;--Re)if(pe[Re]==ye[2]){pe.length=Re;break}if(Re<0&&(!se||se==ye[2]))return{tag:ye[2],from:Ke(be,Ie),to:Ke(de.line,de.ch)}}else pe.push(ye[2])}}function te(de,se){for(var pe=[];;){var ye=Te(de);if(!ye)return;if(ye=="selfClose"){ot(de);continue}var we=de.line,be=de.ch,Ie=ot(de);if(!Ie)return;if(Ie[1])pe.push(Ie[2]);else{for(var Re=pe.length-1;Re>=0;--Re)if(pe[Re]==Ie[2]){pe.length=Re;break}if(Re<0&&(!se||se==Ie[2]))return{tag:Ie[2],from:Ke(de.line,de.ch),to:Ke(we,be)}}}}ue.registerHelper("fold","xml",function(de,se){for(var pe=new at(de,se.line,0);;){var ye=At(pe);if(!ye||pe.line!=se.line)return;var we=Rt(pe);if(!we)return;if(!ye[1]&&we!="selfClose"){var be=Ke(pe.line,pe.ch),Ie=ne(pe,ye[2]);return Ie&&ft(Ie.from,be)>0?{from:be,to:Ie.from}:null}}}),ue.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=Rt(ye),be=we&&Ke(ye.line,ye.ch),Ie=we&&ot(ye);if(!(!we||!Ie||ft(ye,se)>0)){var Re={from:Ke(ye.line,ye.ch),to:be,tag:Ie[2]};return we=="selfClose"?{open:Re,close:null,at:"open"}:Ie[1]?{open:te(ye,Ie[2]),close:Re,at:"close"}:(ye=new at(de,be.line,be.ch,pe),{open:Re,close:ne(ye,Ie[2]),at:"open"})}}},ue.findEnclosingTag=function(de,se,pe,ye){for(var we=new at(de,se.line,se.ch,pe);;){var be=te(we,ye);if(!be)break;var Ie=new at(de,se.line,se.ch,pe),Re=ne(Ie,be.tag);if(Re)return{open:be,close:Re}}},ue.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(Un){(function(ai,Le){Un.exports=Le()})(this,function(){"use strict";var ai=navigator.userAgent,Le=navigator.platform,ue=/gecko\/\d/i.test(ai),Ke=/MSIE \d/.test(ai),ft=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ai),yt=/Edge\/(\d+)/.exec(ai),mt=Ke||ft||yt,Oe=mt&&(Ke?document.documentMode||6:+(yt||ft)[1]),at=!yt&&/WebKit\//.test(ai),Ct=at&&/Qt\/\d+\.\d+/.test(ai),dt=!yt&&/Chrome\//.test(ai),Ge=/Opera\//.test(ai),Rt=/Apple Computer/.test(navigator.vendor),ot=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ai),At=/PhantomJS/.test(ai),Te=!yt&&/AppleWebKit/.test(ai)&&/Mobile\/\w+/.test(ai),ne=/Android/.test(ai),te=Te||ne||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ai),de=Te||/Mac/.test(Le),se=/\bCrOS\b/.test(ai),pe=/win/i.test(Le),ye=Ge&&ai.match(/Version\/(\d*\.\d*)/);ye&&(ye=Number(ye[1])),ye&&ye>=15&&(Ge=!1,at=!0);var we=de&&(Ct||Ge&&(ye==null||ye<12.11)),be=ue||mt&&Oe>=9;function Ie(ie){return new RegExp("(^|\\s)"+ie+"(?:$|\\s)\\s*")}var Re=function(ie,ae){var fe=ie.className,ce=Ie(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 rt(ie){for(var ae=ie.childNodes.length;ae>0;--ae)ie.removeChild(ie.firstChild);return ie}function et(ie,ae){return rt(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 ut(ie,ae,fe,ce){var me=Ye(ie,ae,fe,ce);return me.setAttribute("role","presentation"),me}var tt;document.createRange?tt=function(ie,ae,fe,ce){var me=document.createRange();return me.setEnd(ce||ie,fe),me.setStart(ie,ae),me}:tt=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 wt(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 St(){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 Lt(ie,ae){var fe=ie.className;Ie(ae).test(fe)||(ie.className+=(fe?" ":"")+ae)}function mn(ie,ae){for(var fe=ie.split(" "),ce=0;ce<fe.length;ce++)fe[ce]&&!Ie(fe[ce]).test(ae)&&(ae+=" "+fe[ce]);return ae}var $t=function(ie){ie.select()};Te?$t=function(ie){ie.selectionStart=0,ie.selectionEnd=ie.value.length}:mt&&($t=function(ie){try{ie.select()}catch(ae){}});function Pn(ie){var ae=Array.prototype.slice.call(arguments,1);return function(){return ie.apply(null,ae)}}function Ot(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 ct(ie,ae,fe,ce,me){ae==null&&(ae=ie.search(/[^\s\u00a0]/),ae==-1&&(ae=ie.length));for(var ke=ce||0,Ze=me||0;;){var Qe=ie.indexOf(" ",ke);if(Qe<0||Qe>=ae)return Ze+(ae-ke);Ze+=Qe-ke,Ze+=fe-Ze%fe,ke=Qe+1}}var nt=function(){this.id=null,this.f=null,this.time=0,this.handler=Pn(this.onTimeout,this)};nt.prototype.onTimeout=function(ie){ie.id=0,ie.time<=+new Date?ie.f():setTimeout(ie.handler,ie.time-+new Date)},nt.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 gn(ie,ae){for(var fe=0;fe<ie.length;++fe)if(ie[fe]==ae)return fe;return-1}var oi=50,zn={toString:function(){return"CodeMirror.Pass"}},Ht={scroll:!1},Fn={origin:"*mouse"},Cn={origin:"+move"};function ii(ie,ae,fe){for(var ce=0,me=0;;){var ke=ie.indexOf(" ",ce);ke==-1&&(ke=ie.length);var Ze=ke-ce;if(ke==ie.length||me+Ze>=ae)return ce+Math.min(Ze,ae-me);if(me+=ke-ce,me+=fe-me%fe,ce=ke+1,me>=ae)return ce}}var Wt=[""];function Hn(ie){for(;Wt.length<=ie;)Wt.push(lt(Wt)+" ");return Wt[ie]}function lt(ie){return ie[ie.length-1]}function An(ie,ae){for(var fe=[],ce=0;ce<ie.length;ce++)fe[ce]=ae(ie[ce],ce);return fe}function Ni(ie,ae,fe){for(var ce=0,me=fe(ae);ce<ie.length&&fe(ie[ce])<=me;)ce++;ie.splice(ce,0,ae)}function je(){}function Me(ie,ae){var fe;return Object.create?fe=Object.create(ie):(je.prototype=ie,fe=new je),ae&&Ot(ae,fe),fe}var Ee=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function De(ie){return/\w/.test(ie)||ie>"\x80"&&(ie.toUpperCase()!=ie.toLowerCase()||Ee.test(ie))}function We(ie,ae){return ae?ae.source.indexOf("\\w")>-1&&De(ie)?!0:ae.test(ie):De(ie)}function Ae(ie){for(var ae in ie)if(ie.hasOwnProperty(ae)&&ie[ae])return!1;return!0}var Je=/[\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 Nt(ie){return ie.charCodeAt(0)>=768&&Je.test(ie)}function fn(ie,ae,fe){for(;(fe<0?ae>0:ae<ie.length)&&Nt(ie.charAt(ae));)ae+=fe;return ae}function vn(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 Ft(ie,ae,fe,ce){if(!ie)return ce(ae,fe,"ltr",0);for(var me=!1,ke=0;ke<ie.length;++ke){var Ze=ie[ke];(Ze.from<fe&&Ze.to>ae||ae==fe&&Ze.to==ae)&&(ce(Math.max(Ze.from,ae),Math.min(Ze.to,fe),Ze.level==1?"rtl":"ltr",ke),me=!0)}me||ce(ae,fe,"ltr")}var Jt=null;function jt(ie,ae,fe){var ce;Jt=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:Jt=me),ke.from==ae&&(ke.from!=ke.to&&fe!="before"?ce=me:Jt=me)}return ce!=null?ce:Jt}var pn=function(){var ie="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",ae="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function fe(vt){return vt<=247?ie.charAt(vt):1424<=vt&&vt<=1524?"R":1536<=vt&&vt<=1785?ae.charAt(vt-1536):1774<=vt&&vt<=2220?"r":8192<=vt&&vt<=8203?"w":vt==8204?"b":"L"}var ce=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,me=/[stwN]/,ke=/[LRr]/,Ze=/[Lb1n]/,Qe=/[1n]/;function Ue(vt,un,bt){this.level=vt,this.from=un,this.to=bt}return function(vt,un){var bt=un=="ltr"?"L":"R";if(vt.length==0||un=="ltr"&&!ce.test(vt))return!1;for(var Gn=vt.length,Bn=[],Ji=0;Ji<Gn;++Ji)Bn.push(fe(vt.charCodeAt(Ji)));for(var or=0,Br=bt;or<Gn;++or){var Jr=Bn[or];Jr=="m"?Bn[or]=Br:Br=Jr}for(var Ao=0,ho=bt;Ao<Gn;++Ao){var jo=Bn[Ao];jo=="1"&&ho=="r"?Bn[Ao]="n":ke.test(jo)&&(ho=jo,jo=="r"&&(Bn[Ao]="R"))}for(var ma=1,co=Bn[0];ma<Gn-1;++ma){var _a=Bn[ma];_a=="+"&&co=="1"&&Bn[ma+1]=="1"?Bn[ma]="1":_a==","&&co==Bn[ma+1]&&(co=="1"||co=="n")&&(Bn[ma]=co),co=_a}for(var xs=0;xs<Gn;++xs){var rl=Bn[xs];if(rl==",")Bn[xs]="N";else if(rl=="%"){var Fs=void 0;for(Fs=xs+1;Fs<Gn&&Bn[Fs]=="%";++Fs);for(var Zl=xs&&Bn[xs-1]=="!"||Fs<Gn&&Bn[Fs]=="1"?"1":"N",yl=xs;yl<Fs;++yl)Bn[yl]=Zl;xs=Fs-1}}for(var Qs=0,Gl=bt;Qs<Gn;++Qs){var dl=Bn[Qs];Gl=="L"&&dl=="1"?Bn[Qs]="L":ke.test(dl)&&(Gl=dl)}for(var $s=0;$s<Gn;++$s)if(me.test(Bn[$s])){var Ya=void 0;for(Ya=$s+1;Ya<Gn&&me.test(Bn[Ya]);++Ya);for(var Ls=($s?Bn[$s-1]:bt)=="L",sl=(Ya<Gn?Bn[Ya]:bt)=="L",cl=Ls==sl?Ls?"L":"R":bt,Iu=$s;Iu<Ya;++Iu)Bn[Iu]=cl;$s=Ya-1}for(var Bs=[],hu,ve=0;ve<Gn;)if(Ze.test(Bn[ve])){var Se=ve;for(++ve;ve<Gn&&Ze.test(Bn[ve]);++ve);Bs.push(new Ue(0,Se,ve))}else{var Be=ve,ze=Bs.length,qe=un=="rtl"?1:0;for(++ve;ve<Gn&&Bn[ve]!="L";++ve);for(var $e=Be;$e<ve;)if(Qe.test(Bn[$e])){Be<$e&&(Bs.splice(ze,0,new Ue(1,Be,$e)),ze+=qe);var gt=$e;for(++$e;$e<ve&&Qe.test(Bn[$e]);++$e);Bs.splice(ze,0,new Ue(2,gt,$e)),ze+=qe,Be=$e}else++$e;Be<ve&&Bs.splice(ze,0,new Ue(1,Be,ve))}return un=="ltr"&&(Bs[0].level==1&&(hu=vt.match(/^\s+/))&&(Bs[0].from=hu[0].length,Bs.unshift(new Ue(0,0,hu[0].length))),lt(Bs).level==1&&(hu=vt.match(/\s+$/))&&(lt(Bs).to-=hu[0].length,Bs.push(new Ue(0,Gn-hu[0].length,Gn)))),un=="rtl"?Bs.reverse():Bs}}();function jn(ie,ae){var fe=ie.order;return fe==null&&(fe=ie.order=pn(ie.text,ae)),fe}var Nn=[],Mn=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]||Nn).concat(fe)}};function fr(ie,ae){return ie._handlers&&ie._handlers[ae]||Nn}function nn(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=gn(me,fe);ke>-1&&(ce[ae]=me.slice(0,ke).concat(me.slice(ke+1)))}}}function tn(ie,ae){var fe=fr(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 hn(ie,ae,fe){return typeof ae=="string"&&(ae={type:ae,preventDefault:function(){this.defaultPrevented=!0}}),tn(ie,fe||ae.type,ie,ae),Pi(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)gn(fe,ae[ce])==-1&&fe.push(ae[ce])}function Sn(ie,ae){return fr(ie,ae).length>0}function Kt(ie){ie.prototype.on=function(ae,fe){Mn(this,ae,fe)},ie.prototype.off=function(ae,fe){nn(this,ae,fe)}}function gi(ie){ie.preventDefault?ie.preventDefault():ie.returnValue=!1}function Vi(ie){ie.stopPropagation?ie.stopPropagation():ie.cancelBubble=!0}function Pi(ie){return ie.defaultPrevented!=null?ie.defaultPrevented:ie.returnValue==!1}function Ii(ie){gi(ie),Vi(ie)}function Fr(ie){return ie.target||ie.srcElement}function $n(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 In=function(){if(mt&&Oe<9)return!1;var ie=Ye("div");return"draggable"in ie||"dragDrop"in ie}(),si;function Ti(ie){if(si==null){var ae=Ye("span","\u200B");et(ie,Ye("span",[ae,document.createTextNode("x")])),ie.firstChild.offsetHeight!=0&&(si=ae.offsetWidth<=1&&ae.offsetHeight>2&&!(mt&&Oe<8))}var fe=si?Ye("span","\u200B"):Ye("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return fe.setAttribute("cm-text",""),fe}var Oi;function zi(ie){if(Oi!=null)return Oi;var ae=et(ie,document.createTextNode("A\u062EA")),fe=tt(ae,0,1).getBoundingClientRect(),ce=tt(ae,1,2).getBoundingClientRect();return rt(ie),!fe||fe.left==fe.right?!1:Oi=ce.right-fe.right<3}var xr=`
|
|
|
|
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),Ze=ke.indexOf("\r");Ze!=-1?(fe.push(ke.slice(0,Ze)),ae+=Ze+1):(fe.push(ke),ae=me+1)}return fe}:function(ie){return ie.split(/\r\n?|\n/)},Ce=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},_n=function(){var ie=Ye("div");return"oncopy"in ie?!0:(ie.setAttribute("oncopy","return;"),typeof ie.oncopy=="function")}(),ci=null;function ar(ie){if(ci!=null)return ci;var ae=et(ie,Ye("span","x")),fe=ae.getBoundingClientRect(),ce=tt(ae,0,1).getBoundingClientRect();return ci=Math.abs(fe.left-ce.left)>1}var _r={},$r={};function po(ie,ae){arguments.length>2&&(ae.dependencies=Array.prototype.slice.call(arguments,2)),_r[ie]=ae}function fi(ie,ae){$r[ie]=ae}function Qn(ie){if(typeof ie=="string"&&$r.hasOwnProperty(ie))ie=$r[ie];else if(ie&&typeof ie.name=="string"&&$r.hasOwnProperty(ie.name)){var ae=$r[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 Qn("application/xml");if(typeof ie=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(ie))return Qn("application/json")}return typeof ie=="string"?{name:ie}:ie||{name:"null"}}function Bt(ie,ae){ae=Qn(ae);var fe=_r[ae.name];if(!fe)return Bt(ie,"text/plain");var ce=fe(ie,ae);if(Tt.hasOwnProperty(ae.name)){var me=Tt[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 Ze in ae.modeProps)ce[Ze]=ae.modeProps[Ze];return ce}var Tt={};function kt(ie,ae){var fe=Tt.hasOwnProperty(ie)?Tt[ie]:Tt[ie]={};Ot(ae,fe)}function ui(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 Yn(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 vi(ie,ae,fe){return ie.startState?ie.startState(ae,fe):!0}var yn=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};yn.prototype.eol=function(){return this.pos>=this.string.length},yn.prototype.sol=function(){return this.pos==this.lineStart},yn.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},yn.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},yn.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},yn.prototype.eatWhile=function(ie){for(var ae=this.pos;this.eat(ie););return this.pos>ae},yn.prototype.eatSpace=function(){for(var ie=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>ie},yn.prototype.skipToEnd=function(){this.pos=this.string.length},yn.prototype.skipTo=function(ie){var ae=this.string.indexOf(ie,this.pos);if(ae>-1)return this.pos=ae,!0},yn.prototype.backUp=function(ie){this.pos-=ie},yn.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=ct(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?ct(this.string,this.lineStart,this.tabSize):0)},yn.prototype.indentation=function(){return ct(this.string,null,this.tabSize)-(this.lineStart?ct(this.string,this.lineStart,this.tabSize):0)},yn.prototype.match=function(ie,ae,fe){if(typeof ie=="string"){var ce=function(Ze){return fe?Ze.toLowerCase():Ze},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)}},yn.prototype.current=function(){return this.string.slice(this.start,this.pos)},yn.prototype.hideFirstChars=function(ie,ae){this.lineStart+=ie;try{return ae()}finally{this.lineStart-=ie}},yn.prototype.lookAhead=function(ie){var ae=this.lineOracle;return ae&&ae.lookAhead(ie)},yn.prototype.baseToken=function(){var ie=this.lineOracle;return ie&&ie.baseToken(this.pos)};function Kn(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 It(ie,ae,fe){var ce=[],me=ae.line;return ie.iter(ae.line,fe.line+1,function(ke){var Ze=ke.text;me==fe.line&&(Ze=Ze.slice(0,fe.ch)),me==ae.line&&(Ze=Ze.slice(ae.ch)),ce.push(Ze),++me}),ce}function _t(ie,ae,fe){var ce=[];return ie.iter(ae,fe,function(me){ce.push(me.text)}),ce}function hi(ie,ae){var fe=ae-ie.height;if(fe)for(var ce=ie;ce;ce=ce.parent)ce.height+=fe}function it(ie){if(ie.parent==null)return null;for(var ae=ie.parent,fe=gn(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 sn(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 Ze=0;Ze<ie.lines.length;++Ze){var Qe=ie.lines[Ze],Ue=Qe.height;if(ae<Ue)break;ae-=Ue}return fe+Ze}function Dn(ie,ae){return ae>=ie.first&&ae<ie.first+ie.size}function Di(ie,ae){return String(ie.lineNumberFormatter(ae+ie.firstLineNumber))}function cn(ie,ae,fe){if(fe===void 0&&(fe=null),!(this instanceof cn))return new cn(ie,ae,fe);this.line=ie,this.ch=ae,this.sticky=fe}function qt(ie,ae){return ie.line-ae.line||ie.ch-ae.ch}function an(ie,ae){return ie.sticky==ae.sticky&&qt(ie,ae)==0}function Gi(ie){return cn(ie.line,ie.ch)}function ur(ie,ae){return qt(ie,ae)<0?ae:ie}function Hi(ie,ae){return qt(ie,ae)<0?ie:ae}function Mi(ie,ae){return Math.max(ie.first,Math.min(ae,ie.first+ie.size-1))}function Ri(ie,ae){if(ae.line<ie.first)return cn(ie.first,0);var fe=ie.first+ie.size-1;return ae.line>fe?cn(fe,Kn(ie,fe).text.length):dr(ae,Kn(ie,ae.line).text.length)}function dr(ie,ae){var fe=ie.ch;return fe==null||fe>ae?cn(ie.line,ae):fe<0?cn(ie.line,0):ie}function Er(ie,ae){for(var fe=[],ce=0;ce<ae.length;ce++)fe[ce]=Ri(ie,ae[ce]);return fe}var Ar=function(ie,ae){this.state=ie,this.lookAhead=ae},wn=function(ie,ae,fe,ce){this.state=ae,this.doc=ie,this.line=fe,this.maxLookAhead=ce||0,this.baseTokens=null,this.baseTokenPos=1};wn.prototype.lookAhead=function(ie){var ae=this.doc.getLine(this.line+ie);return ae!=null&&ie>this.maxLookAhead&&(this.maxLookAhead=ie),ae},wn.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}},wn.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},wn.fromSaved=function(ie,ae,fe){return ae instanceof Ar?new wn(ie,ui(ie.mode,ae.state),fe,ae.lookAhead):new wn(ie,ui(ie.mode,ae),fe)},wn.prototype.save=function(ie){var ae=ie!==!1?ui(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Ar(ae,this.maxLookAhead):ae};function Yo(ie,ae,fe,ce){var me=[ie.state.modeGen],ke={};bo(ie,ae.text,ie.doc.mode,fe,function(vt,un){return me.push(vt,un)},ke,ce);for(var Ze=fe.state,Qe=function(vt){fe.baseTokens=me;var un=ie.state.overlays[vt],bt=1,Gn=0;fe.state=!0,bo(ie,ae.text,un.mode,fe,function(Bn,Ji){for(var or=bt;Gn<Bn;){var Br=me[bt];Br>Bn&&me.splice(bt,1,Bn,me[bt+1],Br),bt+=2,Gn=Math.min(Bn,Br)}if(Ji)if(un.opaque)me.splice(or,bt-or,Bn,"overlay "+Ji),bt=or+2;else for(;or<bt;or+=2){var Jr=me[or+1];me[or+1]=(Jr?Jr+" ":"")+"overlay "+Ji}},ke),fe.state=Ze,fe.baseTokens=null,fe.baseTokenPos=1},Ue=0;Ue<ie.state.overlays.length;++Ue)Qe(Ue);return{styles:me,classes:ke.bgClass||ke.textClass?ke:null}}function zr(ie,ae,fe){if(!ae.styles||ae.styles[0]!=ie.state.modeGen){var ce=mo(ie,it(ae)),me=ae.text.length>ie.options.maxHighlightLength&&ui(ie.doc.mode,ce.state),ke=Yo(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 mo(ie,ae,fe){var ce=ie.doc,me=ie.display;if(!ce.mode.startState)return new wn(ce,!0,ae);var ke=fo(ie,ae,fe),Ze=ke>ce.first&&Kn(ce,ke-1).stateAfter,Qe=Ze?wn.fromSaved(ce,Ze,ke):new wn(ce,vi(ce.mode),ke);return ce.iter(ke,ae,function(Ue){en(ie,Ue.text,Qe);var vt=Qe.line;Ue.stateAfter=vt==ae-1||vt%5==0||vt>=me.viewFrom&&vt<me.viewTo?Qe.save():null,Qe.nextLine()}),fe&&(ce.modeFrontier=Qe.line),Qe}function en(ie,ae,fe,ce){var me=ie.doc.mode,ke=new yn(ae,ie.options.tabSize,fe);for(ke.start=ke.pos=ce||0,ae==""&&li(me,fe.state);!ke.eol();)nr(me,ke,fe.state),ke.start=ke.pos}function li(ie,ae){if(ie.blankLine)return ie.blankLine(ae);if(ie.innerMode){var fe=Yn(ie,ae);if(fe.mode.blankLine)return fe.mode.blankLine(fe.state)}}function nr(ie,ae,fe,ce){for(var me=0;me<10;me++){ce&&(ce[0]=Yn(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 Sr=function(ie,ae,fe){this.start=ie.start,this.end=ie.pos,this.string=ie.current(),this.type=ae||null,this.state=fe};function vr(ie,ae,fe,ce){var me=ie.doc,ke=me.mode,Ze;ae=Ri(me,ae);var Qe=Kn(me,ae.line),Ue=mo(ie,ae.line,fe),vt=new yn(Qe.text,ie.options.tabSize,Ue),un;for(ce&&(un=[]);(ce||vt.pos<ae.ch)&&!vt.eol();)vt.start=vt.pos,Ze=nr(ke,vt,Ue.state),ce&&un.push(new Sr(vt,Ze,ui(me.mode,Ue.state)));return ce?un:new Sr(vt,Ze,Ue.state)}function Ir(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 bo(ie,ae,fe,ce,me,ke,Ze){var Qe=fe.flattenSpans;Qe==null&&(Qe=ie.options.flattenSpans);var Ue=0,vt=null,un=new yn(ae,ie.options.tabSize,ce),bt,Gn=ie.options.addModeClass&&[null];for(ae==""&&Ir(li(fe,ce.state),ke);!un.eol();){if(un.pos>ie.options.maxHighlightLength?(Qe=!1,Ze&&en(ie,ae,ce,un.pos),un.pos=ae.length,bt=null):bt=Ir(nr(fe,un,ce.state,Gn),ke),Gn){var Bn=Gn[0].name;Bn&&(bt="m-"+(bt?Bn+" "+bt:Bn))}if(!Qe||vt!=bt){for(;Ue<un.start;)Ue=Math.min(un.start,Ue+5e3),me(Ue,vt);vt=bt}un.start=un.pos}for(;Ue<un.pos;){var Ji=Math.min(un.pos,Ue+5e3);me(Ji,vt),Ue=Ji}}function fo(ie,ae,fe){for(var ce,me,ke=ie.doc,Ze=fe?-1:ae-(ie.doc.mode.innerMode?1e3:100),Qe=ae;Qe>Ze;--Qe){if(Qe<=ke.first)return ke.first;var Ue=Kn(ke,Qe-1),vt=Ue.stateAfter;if(vt&&(!fe||Qe+(vt instanceof Ar?vt.lookAhead:0)<=ke.modeFrontier))return Qe;var un=ct(Ue.text,null,ie.options.tabSize);(me==null||ce>un)&&(me=Qe-1,ce=un)}return me}function so(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=Kn(ie,ce).stateAfter;if(me&&(!(me instanceof Ar)||ce+me.lookAhead<ae)){fe=ce+1;break}}ie.highlightFrontier=Math.min(ie.highlightFrontier,fe)}}var lo=!1,Tn=!1;function qo(){lo=!0}function Zn(){Tn=!0}function wr(ie,ae,fe){this.marker=ie,this.from=ae,this.to=fe}function Or(ie,ae){if(ie)for(var fe=0;fe<ie.length;++fe){var ce=ie[fe];if(ce.marker==ae)return ce}}function hr(ie,ae){for(var fe,ce=0;ce<ie.length;++ce)ie[ce]!=ae&&(fe||(fe=[])).push(ie[ce]);return fe}function la(ie,ae){ie.markedSpans=ie.markedSpans?ie.markedSpans.concat([ae]):[ae],ae.marker.attachLine(ie)}function ca(ie,ae,fe){var ce;if(ie)for(var me=0;me<ie.length;++me){var ke=ie[me],Ze=ke.marker,Qe=ke.from==null||(Ze.inclusiveLeft?ke.from<=ae:ke.from<ae);if(Qe||ke.from==ae&&Ze.type=="bookmark"&&(!fe||!ke.marker.insertLeft)){var Ue=ke.to==null||(Ze.inclusiveRight?ke.to>=ae:ke.to>ae);(ce||(ce=[])).push(new wr(Ze,ke.from,Ue?null:ke.to))}}return ce}function Qo(ie,ae,fe){var ce;if(ie)for(var me=0;me<ie.length;++me){var ke=ie[me],Ze=ke.marker,Qe=ke.to==null||(Ze.inclusiveRight?ke.to>=ae:ke.to>ae);if(Qe||ke.from==ae&&Ze.type=="bookmark"&&(!fe||ke.marker.insertLeft)){var Ue=ke.from==null||(Ze.inclusiveLeft?ke.from<=ae:ke.from<ae);(ce||(ce=[])).push(new wr(Ze,Ue?null:ke.from-ae,ke.to==null?null:ke.to-ae))}}return ce}function zo(ie,ae){if(ae.full)return null;var fe=Dn(ie,ae.from.line)&&Kn(ie,ae.from.line).markedSpans,ce=Dn(ie,ae.to.line)&&Kn(ie,ae.to.line).markedSpans;if(!fe&&!ce)return null;var me=ae.from.ch,ke=ae.to.ch,Ze=qt(ae.from,ae.to)==0,Qe=ca(fe,me,Ze),Ue=Qo(ce,ke,Ze),vt=ae.text.length==1,un=lt(ae.text).length+(vt?me:0);if(Qe)for(var bt=0;bt<Qe.length;++bt){var Gn=Qe[bt];if(Gn.to==null){var Bn=Or(Ue,Gn.marker);Bn?vt&&(Gn.to=Bn.to==null?null:Bn.to+un):Gn.to=me}}if(Ue)for(var Ji=0;Ji<Ue.length;++Ji){var or=Ue[Ji];if(or.to!=null&&(or.to+=un),or.from==null){var Br=Or(Qe,or.marker);Br||(or.from=un,vt&&(Qe||(Qe=[])).push(or))}else or.from+=un,vt&&(Qe||(Qe=[])).push(or)}Qe&&(Qe=Vt(Qe)),Ue&&Ue!=Qe&&(Ue=Vt(Ue));var Jr=[Qe];if(!vt){var Ao=ae.text.length-2,ho;if(Ao>0&&Qe)for(var jo=0;jo<Qe.length;++jo)Qe[jo].to==null&&(ho||(ho=[])).push(new wr(Qe[jo].marker,null,null));for(var ma=0;ma<Ao;++ma)Jr.push(ho);Jr.push(Ue)}return Jr}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 On(ie,ae,fe){var ce=null;if(ie.iter(ae.line,fe.line+1,function(Bn){if(Bn.markedSpans)for(var Ji=0;Ji<Bn.markedSpans.length;++Ji){var or=Bn.markedSpans[Ji].marker;or.readOnly&&(!ce||gn(ce,or)==-1)&&(ce||(ce=[])).push(or)}}),!ce)return null;for(var me=[{from:ae,to:fe}],ke=0;ke<ce.length;++ke)for(var Ze=ce[ke],Qe=Ze.find(0),Ue=0;Ue<me.length;++Ue){var vt=me[Ue];if(!(qt(vt.to,Qe.from)<0||qt(vt.from,Qe.to)>0)){var un=[Ue,1],bt=qt(vt.from,Qe.from),Gn=qt(vt.to,Qe.to);(bt<0||!Ze.inclusiveLeft&&!bt)&&un.push({from:vt.from,to:Qe.from}),(Gn>0||!Ze.inclusiveRight&&!Gn)&&un.push({from:Qe.to,to:vt.to}),me.splice.apply(me,un),Ue+=un.length-3}}return me}function Ut(ie){var ae=ie.markedSpans;if(ae){for(var fe=0;fe<ae.length;++fe)ae[fe].marker.detachLine(ie);ie.markedSpans=null}}function _e(ie,ae){if(ae){for(var fe=0;fe<ae.length;++fe)ae[fe].marker.attachLine(ie);ie.markedSpans=ae}}function pi(ie){return ie.inclusiveLeft?-1:0}function Vn(ie){return ie.inclusiveRight?1:0}function qn(ie,ae){var fe=ie.lines.length-ae.lines.length;if(fe!=0)return fe;var ce=ie.find(),me=ae.find(),ke=qt(ce.from,me.from)||pi(ie)-pi(ae);if(ke)return-ke;var Ze=qt(ce.to,me.to)||Vn(ie)-Vn(ae);return Ze||ae.id-ie.id}function ki(ie,ae){var fe=Tn&&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||qn(ce,me.marker)<0)&&(ce=me.marker);return ce}function Wi(ie){return ki(ie,!0)}function Wn(ie){return ki(ie,!1)}function mi(ie,ae){var fe=Tn&&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||qn(ce,ke.marker)<0)&&(ce=ke.marker)}return ce}function Si(ie,ae,fe,ce,me){var ke=Kn(ie,ae),Ze=Tn&&ke.markedSpans;if(Ze)for(var Qe=0;Qe<Ze.length;++Qe){var Ue=Ze[Qe];if(Ue.marker.collapsed){var vt=Ue.marker.find(0),un=qt(vt.from,fe)||pi(Ue.marker)-pi(me),bt=qt(vt.to,ce)||Vn(Ue.marker)-Vn(me);if(!(un>=0&&bt<=0||un<=0&&bt>=0)&&(un<=0&&(Ue.marker.inclusiveRight&&me.inclusiveLeft?qt(vt.to,fe)>=0:qt(vt.to,fe)>0)||un>=0&&(Ue.marker.inclusiveRight&&me.inclusiveLeft?qt(vt.from,ce)<=0:qt(vt.from,ce)<0)))return!0}}}function Ei(ie){for(var ae;ae=Wi(ie);)ie=ae.find(-1,!0).line;return ie}function bi(ie){for(var ae;ae=Wn(ie);)ie=ae.find(1,!0).line;return ie}function gr(ie){for(var ae,fe;ae=Wn(ie);)ie=ae.find(1,!0).line,(fe||(fe=[])).push(ie);return fe}function qi(ie,ae){var fe=Kn(ie,ae),ce=Ei(fe);return fe==ce?ae:it(ce)}function Ui(ie,ae){if(ae>ie.lastLine())return ae;var fe=Kn(ie,ae),ce;if(!bn(ie,fe))return ae;for(;ce=Wn(fe);)fe=ce.find(1,!0).line;return it(fe)+1}function bn(ie,ae){var fe=Tn&&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&&Yi(ie,ae,ce))return!0}}}function Yi(ie,ae,fe){if(fe.to==null){var ce=fe.marker.find(1,!0);return Yi(ie,ce.line,Or(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)&&Yi(ie,ae,me))return!0}function rr(ie){ie=Ei(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 Ze=0;Ze<ke.children.length;++Ze){var Qe=ke.children[Ze];if(Qe==fe)break;ae+=Qe.height}return ae}function Po(ie){if(ie.height==0)return 0;for(var ae=ie.text.length,fe,ce=ie;fe=Wi(ce);){var me=fe.find(0,!0);ce=me.from.line,ae+=me.from.ch-me.to.ch}for(ce=ie;fe=Wn(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 uo(ie){var ae=ie.display,fe=ie.doc;ae.maxLine=Kn(fe,fe.first),ae.maxLineLength=Po(ae.maxLine),ae.maxLineChanged=!0,fe.iter(function(ce){var me=Po(ce);me>ae.maxLineLength&&(ae.maxLineLength=me,ae.maxLine=ce)})}var No=function(ie,ae,fe){this.text=ie,_e(this,ae),this.height=fe?fe(this):1};No.prototype.lineNo=function(){return it(this)},Kt(No);function Do(ie,ae,fe,ce){ie.text=ae,ie.stateAfter&&(ie.stateAfter=null),ie.styles&&(ie.styles=null),ie.order!=null&&(ie.order=null),Ut(ie),_e(ie,fe);var me=ce?ce(ie):1;me!=ie.height&&hi(ie,me)}function Io(ie){ie.parent=null,Ut(ie)}var fa={},na={};function za(ie,ae){if(!ie||/^\s*$/.test(ie))return null;var fe=ae.addModeClass?na:fa;return fe[ie]||(fe[ie]=ie.replace(/\S+/g,"cm-$&"))}function zt(ie,ae){var fe=ut("span",null,null,at?"padding-right: .1px":null),ce={pre:ut("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,Ze=void 0;ce.pos=0,ce.addToken=Pr,zi(ie.display.measure)&&(Ze=jn(ke,ie.doc.direction))&&(ce.addToken=Zo(ce.addToken,Ze)),ce.map=[];var Qe=ae!=ie.display.externalMeasured&&it(ke);ba(ke,ce,zr(ie,ke,Qe)),ke.styleClasses&&(ke.styleClasses.bgClass&&(ce.bgClass=mn(ke.styleClasses.bgClass,ce.bgClass||"")),ke.styleClasses.textClass&&(ce.textClass=mn(ke.styleClasses.textClass,ce.textClass||""))),ce.map.length==0&&ce.map.push(0,0,ce.content.appendChild(Ti(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 Ue=ce.content.lastChild;(/\bcm-tab\b/.test(Ue.className)||Ue.querySelector&&Ue.querySelector(".cm-tab"))&&(ce.content.className="cm-tab-wrap-hack")}return tn(ie,"renderLine",ie,ae.line,ce.pre),ce.pre.className&&(ce.textClass=mn(ce.pre.className,ce.textClass||"")),ce}function To(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 Pr(ie,ae,fe,ce,me,ke,Ze){if(ae){var Qe=ie.splitSpaces?eo(ae,ie.trailingSpace):ae,Ue=ie.cm.state.specialChars,vt=!1,un;if(!Ue.test(ae))ie.col+=ae.length,un=document.createTextNode(Qe),ie.map.push(ie.pos,ie.pos+ae.length,un),mt&&Oe<9&&(vt=!0),ie.pos+=ae.length;else{un=document.createDocumentFragment();for(var bt=0;;){Ue.lastIndex=bt;var Gn=Ue.exec(ae),Bn=Gn?Gn.index-bt:ae.length-bt;if(Bn){var Ji=document.createTextNode(Qe.slice(bt,bt+Bn));mt&&Oe<9?un.appendChild(Ye("span",[Ji])):un.appendChild(Ji),ie.map.push(ie.pos,ie.pos+Bn,Ji),ie.col+=Bn,ie.pos+=Bn}if(!Gn)break;bt+=Bn+1;var or=void 0;if(Gn[0]==" "){var Br=ie.cm.options.tabSize,Jr=Br-ie.col%Br;or=un.appendChild(Ye("span",Hn(Jr),"cm-tab")),or.setAttribute("role","presentation"),or.setAttribute("cm-text"," "),ie.col+=Jr}else Gn[0]=="\r"||Gn[0]==`
|
|
`?(or=un.appendChild(Ye("span",Gn[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),or.setAttribute("cm-text",Gn[0]),ie.col+=1):(or=ie.cm.options.specialCharPlaceholder(Gn[0]),or.setAttribute("cm-text",Gn[0]),mt&&Oe<9?un.appendChild(Ye("span",[or])):un.appendChild(or),ie.col+=1);ie.map.push(ie.pos,ie.pos+1,or),ie.pos++}}if(ie.trailingSpace=Qe.charCodeAt(ae.length-1)==32,fe||ce||me||vt||ke||Ze){var Ao=fe||"";ce&&(Ao+=ce),me&&(Ao+=me);var ho=Ye("span",[un],Ao,ke);if(Ze)for(var jo in Ze)Ze.hasOwnProperty(jo)&&jo!="style"&&jo!="class"&&ho.setAttribute(jo,Ze[jo]);return ie.content.appendChild(ho)}ie.content.appendChild(un)}}function eo(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 Zo(ie,ae){return function(fe,ce,me,ke,Ze,Qe,Ue){me=me?me+" cm-force-border":"cm-force-border";for(var vt=fe.pos,un=vt+ce.length;;){for(var bt=void 0,Gn=0;Gn<ae.length&&(bt=ae[Gn],!(bt.to>vt&&bt.from<=vt));Gn++);if(bt.to>=un)return ie(fe,ce,me,ke,Ze,Qe,Ue);ie(fe,ce.slice(0,bt.to-vt),me,ke,null,Qe,Ue),ke=null,ce=ce.slice(bt.to-vt),vt=bt.to}}}function Wr(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 ba(ie,ae,fe){var ce=ie.markedSpans,me=ie.text,ke=0;if(!ce){for(var Ze=1;Ze<fe.length;Ze+=2)ae.addToken(ae,me.slice(ke,ke=fe[Ze]),za(fe[Ze+1],ae.cm.options));return}for(var Qe=me.length,Ue=0,vt=1,un="",bt,Gn,Bn=0,Ji,or,Br,Jr,Ao;;){if(Bn==Ue){Ji=or=Br=Gn="",Ao=null,Jr=null,Bn=1/0;for(var ho=[],jo=void 0,ma=0;ma<ce.length;++ma){var co=ce[ma],_a=co.marker;if(_a.type=="bookmark"&&co.from==Ue&&_a.widgetNode)ho.push(_a);else if(co.from<=Ue&&(co.to==null||co.to>Ue||_a.collapsed&&co.to==Ue&&co.from==Ue)){if(co.to!=null&&co.to!=Ue&&Bn>co.to&&(Bn=co.to,or=""),_a.className&&(Ji+=" "+_a.className),_a.css&&(Gn=(Gn?Gn+";":"")+_a.css),_a.startStyle&&co.from==Ue&&(Br+=" "+_a.startStyle),_a.endStyle&&co.to==Bn&&(jo||(jo=[])).push(_a.endStyle,co.to),_a.title&&((Ao||(Ao={})).title=_a.title),_a.attributes)for(var xs in _a.attributes)(Ao||(Ao={}))[xs]=_a.attributes[xs];_a.collapsed&&(!Jr||qn(Jr.marker,_a)<0)&&(Jr=co)}else co.from>Ue&&Bn>co.from&&(Bn=co.from)}if(jo)for(var rl=0;rl<jo.length;rl+=2)jo[rl+1]==Bn&&(or+=" "+jo[rl]);if(!Jr||Jr.from==Ue)for(var Fs=0;Fs<ho.length;++Fs)Wr(ae,0,ho[Fs]);if(Jr&&(Jr.from||0)==Ue){if(Wr(ae,(Jr.to==null?Qe+1:Jr.to)-Ue,Jr.marker,Jr.from==null),Jr.to==null)return;Jr.to==Ue&&(Jr=!1)}}if(Ue>=Qe)break;for(var Zl=Math.min(Qe,Bn);;){if(un){var yl=Ue+un.length;if(!Jr){var Qs=yl>Zl?un.slice(0,Zl-Ue):un;ae.addToken(ae,Qs,bt?bt+Ji:Ji,Br,Ue+Qs.length==Bn?or:"",Gn,Ao)}if(yl>=Zl){un=un.slice(Zl-Ue),Ue=Zl;break}Ue=yl,Br=""}un=me.slice(ke,ke=fe[vt++]),bt=za(fe[vt++],ae.cm.options)}}}function ga(ie,ae,fe){this.line=ae,this.rest=gr(ae),this.size=this.rest?it(lt(this.rest))-fe+1:1,this.node=this.text=null,this.hidden=bn(ie,ae)}function Uo(ie,ae,fe){for(var ce=[],me,ke=ae;ke<fe;ke=me){var Ze=new ga(ie.doc,Kn(ie.doc,ke),ke);me=ke+Ze.size,ce.push(Ze)}return ce}var Fo=null;function vs(ie){Fo?Fo.ops.push(ie):ie.ownsGroup=Fo={ops:[ie],delayedCallbacks:[]}}function Qa(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 ns(ie,ae){var fe=ie.ownsGroup;if(fe)try{Qa(fe)}finally{Fo=null,ae(fe)}}var ds=null;function Vr(ie,ae){var fe=fr(ie,ae);if(fe.length){var ce=Array.prototype.slice.call(arguments,2),me;Fo?me=Fo.delayedCallbacks:ds?me=ds:(me=ds=[],setTimeout(wa,0));for(var ke=function(Qe){me.push(function(){return fe[Qe].apply(null,ce)})},Ze=0;Ze<fe.length;++Ze)ke(Ze)}}function wa(){var ie=ds;ds=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"?ni(ie,ae):ke=="gutter"?Xo(ie,ae,fe,ce):ke=="class"?to(ie,ae):ke=="widget"&&Ia(ie,ae,ce)}ae.changes=null}function is(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),mt&&Oe<8&&(ie.node.style.zIndex=2)),ie.node}function Vo(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=is(ae);ae.background=ce.insertBefore(Ye("div",null,fe),ce.firstChild),ie.display.input.setUneditable(ae.background)}}function Ko(ie,ae){var fe=ie.display.externalMeasured;return fe&&fe.line==ae.line?(ie.display.externalMeasured=null,ae.measure=fe.measure,fe.built):zt(ie,ae)}function ni(ie,ae){var fe=ae.text.className,ce=Ko(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,to(ie,ae)):fe&&(ae.text.className=fe)}function to(ie,ae){Vo(ie,ae),ae.line.wrapClass?is(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 Xo(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=is(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 Ze=is(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),Ze.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",Di(ie.options,fe),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+ce.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+ie.display.lineNumInnerWidth+"px"))),ke)for(var Ue=0;Ue<ie.display.gutterSpecs.length;++Ue){var vt=ie.display.gutterSpecs[Ue].className,un=ke.hasOwnProperty(vt)&&ke[vt];un&&Qe.appendChild(Ye("div",[un],"CodeMirror-gutter-elt","left: "+ce.gutterLeft[vt]+"px; width: "+ce.gutterWidth[vt]+"px"))}}}function Ia(ie,ae,fe){ae.alignable&&(ae.alignable=null);for(var ce=Ie("CodeMirror-linewidget"),me=ae.node.firstChild,ke=void 0;me;me=ke)ke=me.nextSibling,ce.test(me.className)&&ae.node.removeChild(me);cs(ie,ae,fe)}function ms(ie,ae,fe,ce){var me=Ko(ie,ae);return ae.text=ae.node=me.pre,me.bgClass&&(ae.bgClass=me.bgClass),me.textClass&&(ae.textClass=me.textClass),to(ie,ae),Xo(ie,ae,fe,ce),cs(ie,ae,ce),ae.node}function cs(ie,ae,fe){if(yo(ie,ae.line,ae,fe,!0),ae.rest)for(var ce=0;ce<ae.rest.length;ce++)yo(ie,ae.rest[ce],ae,fe,!1)}function yo(ie,ae,fe,ce,me){if(ae.widgets)for(var ke=is(fe),Ze=0,Qe=ae.widgets;Ze<Qe.length;++Ze){var Ue=Qe[Ze],vt=Ye("div",[Ue.node],"CodeMirror-linewidget"+(Ue.className?" "+Ue.className:""));Ue.handleMouseEvents||vt.setAttribute("cm-ignore-events","true"),as(Ue,vt,fe,ce),ie.display.input.setUneditable(vt),me&&Ue.above?ke.insertBefore(vt,fe.gutter||fe.text):ke.appendChild(vt),Vr(Ue,"redraw")}}function as(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 ls(ie){if(ie.height!=null)return ie.height;var ae=ie.doc.cm;if(!ae)return 0;if(!wt(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;"),et(ae.display.measure,Ye("div",[ie.node],null,fe))}return ie.height=ie.node.parentNode.offsetHeight}function Yt(ie,ae){for(var fe=Fr(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 Xt(ie){return ie.lineSpace.offsetTop}function kn(ie){return ie.mover.offsetHeight-ie.lineSpace.offsetHeight}function Zi(ie){if(ie.cachedPaddingH)return ie.cachedPaddingH;var ae=et(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 yi(ie){return oi-ie.display.nativeBarWidth}function Ai(ie){return ie.display.scroller.clientWidth-yi(ie)-ie.display.barWidth}function Li(ie){return ie.display.scroller.clientHeight-yi(ie)-ie.display.barHeight}function Rn(ie,ae,fe){var ce=ie.options.lineWrapping,me=ce&&Ai(ie);if(!ae.measure.heights||ce&&ae.measure.width!=me){var ke=ae.measure.heights=[];if(ce){ae.measure.width=me;for(var Ze=ae.text.firstChild.getClientRects(),Qe=0;Qe<Ze.length-1;Qe++){var Ue=Ze[Qe],vt=Ze[Qe+1];Math.abs(Ue.bottom-vt.bottom)>2&&ke.push((Ue.bottom+vt.top)/2-fe.top)}}ke.push(fe.bottom-fe.top)}}function ri(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(it(ie.rest[me])>fe)return{map:ie.measure.maps[me],cache:ie.measure.caches[me],before:!0}}function ir(ie,ae){ae=Ei(ae);var fe=it(ae),ce=ie.display.externalMeasured=new ga(ie.doc,ae,fe);ce.lineN=fe;var me=ce.built=zt(ie,ce);return ce.text=me.pre,et(ie.display.lineMeasure,me.pre),ce}function Rr(ie,ae,fe,ce){return Pa(ie,_o(ie,ae),fe,ce)}function ea(ie,ae){if(ae>=ie.display.viewFrom&&ae<ie.display.viewTo)return ie.display.view[yr(ie,ae)];var fe=ie.display.externalMeasured;if(fe&&ae>=fe.lineN&&ae<fe.lineN+fe.size)return fe}function _o(ie,ae){var fe=it(ae),ce=ea(ie,fe);ce&&!ce.text?ce=null:ce&&ce.changes&&(Ba(ie,ce,fe,pr(ie)),ie.curOp.forceUpdate=!0),ce||(ce=ir(ie,ae));var me=ri(ce,ae,fe);return{line:ae,view:ce,rect:null,map:me.map,cache:me.cache,before:me.before,hasHeights:!1}}function Pa(ie,ae,fe,ce,me){ae.before&&(fe=-1);var ke=fe+(ce||""),Ze;return ae.cache.hasOwnProperty(ke)?Ze=ae.cache[ke]:(ae.rect||(ae.rect=ae.view.text.getBoundingClientRect()),ae.hasHeights||(Rn(ie,ae.view,ae.rect),ae.hasHeights=!0),Ze=er(ie,ae,fe,ce),Ze.bogus||(ae.cache[ke]=Ze)),{left:Ze.left,right:Ze.right,top:me?Ze.rtop:Ze.top,bottom:me?Ze.rbottom:Ze.bottom}}var xa={left:0,right:0,top:0,bottom:0};function vo(ie,ae,fe){for(var ce,me,ke,Ze,Qe,Ue,vt=0;vt<ie.length;vt+=3)if(Qe=ie[vt],Ue=ie[vt+1],ae<Qe?(me=0,ke=1,Ze="left"):ae<Ue?(me=ae-Qe,ke=me+1):(vt==ie.length-3||ae==Ue&&ie[vt+3]>ae)&&(ke=Ue-Qe,me=ke-1,ae>=Ue&&(Ze="right")),me!=null){if(ce=ie[vt+2],Qe==Ue&&fe==(ce.insertLeft?"left":"right")&&(Ze=fe),fe=="left"&&me==0)for(;vt&&ie[vt-2]==ie[vt-3]&&ie[vt-1].insertLeft;)ce=ie[(vt-=3)+2],Ze="left";if(fe=="right"&&me==Ue-Qe)for(;vt<ie.length-3&&ie[vt+3]==ie[vt+4]&&!ie[vt+5].insertLeft;)ce=ie[(vt+=3)+2],Ze="right";break}return{node:ce,start:me,end:ke,collapse:Ze,coverStart:Qe,coverEnd:Ue}}function Kr(ie,ae){var fe=xa;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 er(ie,ae,fe,ce){var me=vo(ae.map,fe,ce),ke=me.node,Ze=me.start,Qe=me.end,Ue=me.collapse,vt;if(ke.nodeType==3){for(var un=0;un<4;un++){for(;Ze&&Nt(ae.line.text.charAt(me.coverStart+Ze));)--Ze;for(;me.coverStart+Qe<me.coverEnd&&Nt(ae.line.text.charAt(me.coverStart+Qe));)++Qe;if(mt&&Oe<9&&Ze==0&&Qe==me.coverEnd-me.coverStart?vt=ke.parentNode.getBoundingClientRect():vt=Kr(tt(ke,Ze,Qe).getClientRects(),ce),vt.left||vt.right||Ze==0)break;Qe=Ze,Ze=Ze-1,Ue="right"}mt&&Oe<11&&(vt=ia(ie.display.measure,vt))}else{Ze>0&&(Ue=ce="right");var bt;ie.options.lineWrapping&&(bt=ke.getClientRects()).length>1?vt=bt[ce=="right"?bt.length-1:0]:vt=ke.getBoundingClientRect()}if(mt&&Oe<9&&!Ze&&(!vt||!vt.left&&!vt.right)){var Gn=ke.parentNode.getClientRects()[0];Gn?vt={left:Gn.left,right:Gn.left+wi(ie.display),top:Gn.top,bottom:Gn.bottom}:vt=xa}for(var Bn=vt.top-ae.rect.top,Ji=vt.bottom-ae.rect.top,or=(Bn+Ji)/2,Br=ae.view.measure.heights,Jr=0;Jr<Br.length-1&&!(or<Br[Jr]);Jr++);var Ao=Jr?Br[Jr-1]:0,ho=Br[Jr],jo={left:(Ue=="right"?vt.right:vt.left)-ae.rect.left,right:(Ue=="left"?vt.left:vt.right)-ae.rect.left,top:Ao,bottom:ho};return!vt.left&&!vt.right&&(jo.bogus=!0),ie.options.singleCursorHeightPerLine||(jo.rtop=Bn,jo.rbottom=Ji),jo}function ia(ie,ae){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!ar(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 sa(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,rt(ie.display.lineMeasure);for(var ae=0;ae<ie.display.view.length;ae++)sa(ie.display.view[ae])}function Oa(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 Oo(){return dt&&ne?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ua(){return dt&&ne?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Lo(ie){var ae=0;if(ie.widgets)for(var fe=0;fe<ie.widgets.length;++fe)ie.widgets[fe].above&&(ae+=ls(ie.widgets[fe]));return ae}function jr(ie,ae,fe,ce,me){if(!me){var ke=Lo(ae);fe.top+=ke,fe.bottom+=ke}if(ce=="line")return fe;ce||(ce="local");var Ze=rr(ae);if(ce=="local"?Ze+=Xt(ie.display):Ze-=ie.display.viewOffset,ce=="page"||ce=="window"){var Qe=ie.display.lineSpace.getBoundingClientRect();Ze+=Qe.top+(ce=="window"?0:ua());var Ue=Qe.left+(ce=="window"?0:Oo());fe.left+=Ue,fe.right+=Ue}return fe.top+=Ze,fe.bottom+=Ze,fe}function oo(ie,ae,fe){if(fe=="div")return ae;var ce=ae.left,me=ae.top;if(fe=="page")ce-=Oo(),me-=ua();else if(fe=="local"||!fe){var ke=ie.display.sizer.getBoundingClientRect();ce+=ke.left,me+=ke.top}var Ze=ie.display.lineSpace.getBoundingClientRect();return{left:ce-Ze.left,top:me-Ze.top}}function Yr(ie,ae,fe,ce,me){return ce||(ce=Kn(ie.doc,ae.line)),jr(ie,ce,Rr(ie,ce,ae.ch,me),fe)}function wo(ie,ae,fe,ce,me,ke){ce=ce||Kn(ie.doc,ae.line),me||(me=_o(ie,ce));function Ze(Ji,or){var Br=Pa(ie,me,Ji,or?"right":"left",ke);return or?Br.left=Br.right:Br.right=Br.left,jr(ie,ce,Br,fe)}var Qe=jn(ce,ie.doc.direction),Ue=ae.ch,vt=ae.sticky;if(Ue>=ce.text.length?(Ue=ce.text.length,vt="before"):Ue<=0&&(Ue=0,vt="after"),!Qe)return Ze(vt=="before"?Ue-1:Ue,vt=="before");function un(Ji,or,Br){var Jr=Qe[or],Ao=Jr.level==1;return Ze(Br?Ji-1:Ji,Ao!=Br)}var bt=jt(Qe,Ue,vt),Gn=Jt,Bn=un(Ue,bt,vt=="before");return Gn!=null&&(Bn.other=un(Ue,Gn,vt!="before")),Bn}function Ra(ie,ae){var fe=0;ae=Ri(ie.doc,ae),ie.options.lineWrapping||(fe=wi(ie.display)*ae.ch);var ce=Kn(ie.doc,ae.line),me=rr(ce)+Xt(ie.display);return{left:fe,right:fe,top:me,bottom:me+ce.height}}function Ha(ie,ae,fe,ce,me){var ke=cn(ie,ae,fe);return ke.xRel=me,ce&&(ke.outside=ce),ke}function Mt(ie,ae,fe){var ce=ie.doc;if(fe+=ie.display.viewOffset,fe<0)return Ha(ce.first,0,null,-1,-1);var me=sn(ce,fe),ke=ce.first+ce.size-1;if(me>ke)return Ha(ce.first+ce.size-1,Kn(ce,ke).text.length,null,1,1);ae<0&&(ae=0);for(var Ze=Kn(ce,me);;){var Qe=Dt(ie,Ze,me,ae,fe),Ue=mi(Ze,Qe.ch+(Qe.xRel>0||Qe.outside>0?1:0));if(!Ue)return Qe;var vt=Ue.find(1);if(vt.line==me)return vt;Ze=Kn(ce,me=vt.line)}}function Pt(ie,ae,fe,ce){ce-=Lo(ae);var me=ae.text.length,ke=vn(function(Ze){return Pa(ie,fe,Ze-1).bottom<=ce},me,0);return me=vn(function(Ze){return Pa(ie,fe,Ze).top>ce},ke,me),{begin:ke,end:me}}function ln(ie,ae,fe,ce){fe||(fe=_o(ie,ae));var me=jr(ie,ae,Pa(ie,fe,ce),"line").top;return Pt(ie,ae,fe,me)}function He(ie,ae,fe,ce){return ie.bottom<=fe?!1:ie.top>fe?!0:(ce?ie.left:ie.right)>ae}function Dt(ie,ae,fe,ce,me){me-=rr(ae);var ke=_o(ie,ae),Ze=Lo(ae),Qe=0,Ue=ae.text.length,vt=!0,un=jn(ae,ie.doc.direction);if(un){var bt=(ie.options.lineWrapping?Mr:Xi)(ie,ae,fe,ke,un,ce,me);vt=bt.level!=1,Qe=vt?bt.from:bt.to-1,Ue=vt?bt.to:bt.from-1}var Gn=null,Bn=null,Ji=vn(function(ma){var co=Pa(ie,ke,ma);return co.top+=Ze,co.bottom+=Ze,He(co,ce,me,!1)?(co.top<=me&&co.left<=ce&&(Gn=ma,Bn=co),!0):!1},Qe,Ue),or,Br,Jr=!1;if(Bn){var Ao=ce-Bn.left<Bn.right-ce,ho=Ao==vt;Ji=Gn+(ho?0:1),Br=ho?"after":"before",or=Ao?Bn.left:Bn.right}else{!vt&&(Ji==Ue||Ji==Qe)&&Ji++,Br=Ji==0?"after":Ji==ae.text.length?"before":Pa(ie,ke,Ji-(vt?1:0)).bottom+Ze<=me==vt?"after":"before";var jo=wo(ie,cn(fe,Ji,Br),"line",ae,ke);or=jo.left,Jr=me<jo.top?-1:me>=jo.bottom?1:0}return Ji=fn(ae.text,Ji,1),Ha(fe,Ji,Br,Jr,ce-or)}function Xi(ie,ae,fe,ce,me,ke,Ze){var Qe=vn(function(bt){var Gn=me[bt],Bn=Gn.level!=1;return He(wo(ie,cn(fe,Bn?Gn.to:Gn.from,Bn?"before":"after"),"line",ae,ce),ke,Ze,!0)},0,me.length-1),Ue=me[Qe];if(Qe>0){var vt=Ue.level!=1,un=wo(ie,cn(fe,vt?Ue.from:Ue.to,vt?"after":"before"),"line",ae,ce);He(un,ke,Ze,!0)&&un.top>Ze&&(Ue=me[Qe-1])}return Ue}function Mr(ie,ae,fe,ce,me,ke,Ze){var Qe=Pt(ie,ae,ce,Ze),Ue=Qe.begin,vt=Qe.end;/\s/.test(ae.text.charAt(vt-1))&&vt--;for(var un=null,bt=null,Gn=0;Gn<me.length;Gn++){var Bn=me[Gn];if(!(Bn.from>=vt||Bn.to<=Ue)){var Ji=Bn.level!=1,or=Pa(ie,ce,Ji?Math.min(vt,Bn.to)-1:Math.max(Ue,Bn.from)).right,Br=or<ke?ke-or+1e9:or-ke;(!un||bt>Br)&&(un=Bn,bt=Br)}}return un||(un=me[me.length-1]),un.from<Ue&&(un={from:Ue,to:un.to,level:un.level}),un.to>vt&&(un={from:un.from,to:vt,level:un.level}),un}var Qi;function $i(ie){if(ie.cachedTextHeight!=null)return ie.cachedTextHeight;if(Qi==null){Qi=Ye("pre",null,"CodeMirror-line-like");for(var ae=0;ae<49;++ae)Qi.appendChild(document.createTextNode("x")),Qi.appendChild(Ye("br"));Qi.appendChild(document.createTextNode("x"))}et(ie.measure,Qi);var fe=Qi.offsetHeight/50;return fe>3&&(ie.cachedTextHeight=fe),rt(ie.measure),fe||1}function wi(ie){if(ie.cachedCharWidth!=null)return ie.cachedCharWidth;var ae=Ye("span","xxxxxxxxxx"),fe=Ye("pre",[ae],"CodeMirror-line-like");et(ie.measure,fe);var ce=ae.getBoundingClientRect(),me=(ce.right-ce.left)/10;return me>2&&(ie.cachedCharWidth=me),me||10}function pr(ie){for(var ae=ie.display,fe={},ce={},me=ae.gutters.clientLeft,ke=ae.gutters.firstChild,Ze=0;ke;ke=ke.nextSibling,++Ze){var Qe=ie.display.gutterSpecs[Ze].className;fe[Qe]=ke.offsetLeft+ke.clientLeft+me,ce[Qe]=ke.clientWidth}return{fixedPos:Hr(ae),gutterTotalWidth:ae.gutters.offsetWidth,gutterLeft:fe,gutterWidth:ce,wrapperWidth:ae.wrapper.clientWidth}}function Hr(ie){return ie.scroller.getBoundingClientRect().left-ie.sizer.getBoundingClientRect().left}function no(ie){var ae=$i(ie.display),fe=ie.options.lineWrapping,ce=fe&&Math.max(5,ie.display.scroller.clientWidth/wi(ie.display)-3);return function(me){if(bn(ie.doc,me))return 0;var ke=0;if(me.widgets)for(var Ze=0;Ze<me.widgets.length;Ze++)me.widgets[Ze].height&&(ke+=me.widgets[Ze].height);return fe?ke+(Math.ceil(me.text.length/ce)||1)*ae:ke+ae}}function lr(ie){var ae=ie.doc,fe=no(ie);ae.iter(function(ce){var me=fe(ce);me!=ce.height&&hi(ce,me)})}function cr(ie,ae,fe,ce){var me=ie.display;if(!fe&&Fr(ae).getAttribute("cm-not-content")=="true")return null;var ke,Ze,Qe=me.lineSpace.getBoundingClientRect();try{ke=ae.clientX-Qe.left,Ze=ae.clientY-Qe.top}catch(bt){return null}var Ue=Mt(ie,ke,Ze),vt;if(ce&&Ue.xRel>0&&(vt=Kn(ie.doc,Ue.line).text).length==Ue.ch){var un=ct(vt,vt.length,ie.options.tabSize)-vt.length;Ue=cn(Ue.line,Math.max(0,Math.round((ke-Zi(ie.display).left)/wi(ie.display))-un))}return Ue}function yr(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 _i(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)Tn&&qi(ie.doc,ae)<me.viewTo&&Dr(ie);else if(fe<=me.viewFrom)Tn&&Ui(ie.doc,fe+ce)>me.viewFrom?Dr(ie):(me.viewFrom+=ce,me.viewTo+=ce);else if(ae<=me.viewFrom&&fe>=me.viewTo)Dr(ie);else if(ae<=me.viewFrom){var ke=ko(ie,fe,fe+ce,1);ke?(me.view=me.view.slice(ke.index),me.viewFrom=ke.lineN,me.viewTo+=ce):Dr(ie)}else if(fe>=me.viewTo){var Ze=ko(ie,ae,ae,-1);Ze?(me.view=me.view.slice(0,Ze.index),me.viewTo=Ze.lineN):Dr(ie)}else{var Qe=ko(ie,ae,ae,-1),Ue=ko(ie,fe,fe+ce,1);Qe&&Ue?(me.view=me.view.slice(0,Qe.index).concat(Uo(ie,Qe.lineN,Ue.lineN)).concat(me.view.slice(Ue.index)),me.viewTo+=ce):Dr(ie)}var vt=me.externalMeasured;vt&&(fe<vt.lineN?vt.lineN+=ce:ae<vt.lineN+vt.size&&(me.externalMeasured=null))}function Ci(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[yr(ie,ae)];if(ke.node!=null){var Ze=ke.changes||(ke.changes=[]);gn(Ze,fe)==-1&&Ze.push(fe)}}}function Dr(ie){ie.display.viewFrom=ie.display.viewTo=ie.doc.first,ie.display.view=[],ie.display.viewOffset=0}function ko(ie,ae,fe,ce){var me=yr(ie,ae),ke,Ze=ie.display.view;if(!Tn||fe==ie.doc.first+ie.doc.size)return{index:me,lineN:fe};for(var Qe=ie.display.viewFrom,Ue=0;Ue<me;Ue++)Qe+=Ze[Ue].size;if(Qe!=ae){if(ce>0){if(me==Ze.length-1)return null;ke=Qe+Ze[me].size-ae,me++}else ke=Qe-ae;ae+=ke,fe+=ke}for(;qi(ie.doc,fe)!=fe;){if(me==(ce<0?0:Ze.length-1))return null;fe+=ce*Ze[me-(ce<0?1:0)].size,me+=ce}return{index:me,lineN:fe}}function br(ie,ae,fe){var ce=ie.display,me=ce.view;me.length==0||ae>=ce.viewTo||fe<=ce.viewFrom?(ce.view=Uo(ie,ae,fe),ce.viewFrom=ae):(ce.viewFrom>ae?ce.view=Uo(ie,ae,ce.viewFrom).concat(ce.view):ce.viewFrom<ae&&(ce.view=ce.view.slice(yr(ie,ae))),ce.viewFrom=ae,ce.viewTo<fe?ce.view=ce.view.concat(Uo(ie,ce.viewTo,fe)):ce.viewTo>fe&&(ce.view=ce.view.slice(0,yr(ie,fe)))),ce.viewTo=fe}function Cr(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 Nr(ie){ie.display.input.showSelection(ie.display.input.prepareSelection())}function Tr(ie,ae){ae===void 0&&(ae=!0);for(var fe=ie.doc,ce={},me=ce.cursors=document.createDocumentFragment(),ke=ce.selection=document.createDocumentFragment(),Ze=0;Ze<fe.sel.ranges.length;Ze++)if(!(!ae&&Ze==fe.sel.primIndex)){var Qe=fe.sel.ranges[Ze];if(!(Qe.from().line>=ie.display.viewTo||Qe.to().line<ie.display.viewFrom)){var Ue=Qe.empty();(Ue||ie.options.showCursorWhenSelecting)&&sr(ie,Qe.head,me),Ue||Bo(ie,Qe,ke)}}return ce}function sr(ie,ae,fe){var ce=wo(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 ra(ie,ae){return ie.top-ae.top||ie.left-ae.left}function Bo(ie,ae,fe){var ce=ie.display,me=ie.doc,ke=document.createDocumentFragment(),Ze=Zi(ie.display),Qe=Ze.left,Ue=Math.max(ce.sizerWidth,Ai(ie)-ce.sizer.offsetLeft)-Ze.right,vt=me.direction=="ltr";function un(ho,jo,ma,co){jo<0&&(jo=0),jo=Math.round(jo),co=Math.round(co),ke.appendChild(Ye("div",null,"CodeMirror-selected","position: absolute; left: "+ho+`px;
|
|
top: `+jo+"px; width: "+(ma==null?Ue-ho:ma)+`px;
|
|
height: `+(co-jo)+"px"))}function bt(ho,jo,ma){var co=Kn(me,ho),_a=co.text.length,xs,rl;function Fs(Qs,Gl){return Yr(ie,cn(ho,Qs),"div",co,Gl)}function Zl(Qs,Gl,dl){var $s=ln(ie,co,null,Qs),Ya=Gl=="ltr"==(dl=="after")?"left":"right",Ls=dl=="after"?$s.begin:$s.end-(/\s/.test(co.text.charAt($s.end-1))?2:1);return Fs(Ls,Ya)[Ya]}var yl=jn(co,me.direction);return Ft(yl,jo||0,ma==null?_a:ma,function(Qs,Gl,dl,$s){var Ya=dl=="ltr",Ls=Fs(Qs,Ya?"left":"right"),sl=Fs(Gl-1,Ya?"right":"left"),cl=jo==null&&Qs==0,Iu=ma==null&&Gl==_a,Bs=$s==0,hu=!yl||$s==yl.length-1;if(sl.top-Ls.top<=3){var ve=(vt?cl:Iu)&&Bs,Se=(vt?Iu:cl)&&hu,Be=ve?Qe:(Ya?Ls:sl).left,ze=Se?Ue:(Ya?sl:Ls).right;un(Be,Ls.top,ze-Be,Ls.bottom)}else{var qe,$e,gt,xt;Ya?(qe=vt&&cl&&Bs?Qe:Ls.left,$e=vt?Ue:Zl(Qs,dl,"before"),gt=vt?Qe:Zl(Gl,dl,"after"),xt=vt&&Iu&&hu?Ue:sl.right):(qe=vt?Zl(Qs,dl,"before"):Qe,$e=!vt&&cl&&Bs?Ue:Ls.right,gt=!vt&&Iu&&hu?Qe:sl.left,xt=vt?Zl(Gl,dl,"after"):Ue),un(qe,Ls.top,$e-qe,Ls.bottom),Ls.bottom<sl.top&&un(Qe,Ls.bottom,null,sl.top),un(gt,sl.top,xt-gt,sl.bottom)}(!xs||ra(Ls,xs)<0)&&(xs=Ls),ra(sl,xs)<0&&(xs=sl),(!rl||ra(Ls,rl)<0)&&(rl=Ls),ra(sl,rl)<0&&(rl=sl)}),{start:xs,end:rl}}var Gn=ae.from(),Bn=ae.to();if(Gn.line==Bn.line)bt(Gn.line,Gn.ch,Bn.ch);else{var Ji=Kn(me,Gn.line),or=Kn(me,Bn.line),Br=Ei(Ji)==Ei(or),Jr=bt(Gn.line,Gn.ch,Br?Ji.text.length+1:null).end,Ao=bt(Bn.line,Br?0:null,Bn.ch).start;Br&&(Jr.top<Ao.top-2?(un(Jr.right,Jr.top,null,Jr.bottom),un(Qe,Ao.top,Ao.left,Ao.bottom)):un(Jr.right,Jr.top,Ao.left-Jr.right,Jr.bottom)),Jr.bottom<Ao.top&&un(Qe,Jr.bottom,null,Ao.top)}fe.appendChild(ke)}function ta(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()||As(ie),ae.cursorDiv.style.visibility=(fe=!fe)?"":"hidden"},ie.options.cursorBlinkRate):ie.options.cursorBlinkRate<0&&(ae.cursorDiv.style.visibility="hidden")}}function Sa(ie){ie.state.focused||(ie.display.input.focus(),ha(ie))}function ro(ie){ie.state.delayingBlurEvent=!0,setTimeout(function(){ie.state.delayingBlurEvent&&(ie.state.delayingBlurEvent=!1,As(ie))},100)}function ha(ie,ae){ie.state.delayingBlurEvent&&(ie.state.delayingBlurEvent=!1),ie.options.readOnly!="nocursor"&&(ie.state.focused||(tn(ie,"focus",ie,ae),ie.state.focused=!0,Lt(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()),ta(ie))}function As(ie,ae){ie.state.delayingBlurEvent||(ie.state.focused&&(tn(ie,"blur",ie,ae),ie.state.focused=!1,Re(ie.display.wrapper,"CodeMirror-focused")),clearInterval(ie.display.blinker),setTimeout(function(){ie.state.focused||(ie.display.shift=!1)},150))}function kr(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,Ze=void 0,Qe=0;if(!me.hidden){if(mt&&Oe<8){var Ue=me.node.offsetTop+me.node.offsetHeight;Ze=Ue-fe,fe=Ue}else{var vt=me.node.getBoundingClientRect();Ze=vt.bottom-vt.top,!ke&&me.text.firstChild&&(Qe=me.text.firstChild.getBoundingClientRect().right-vt.left-1)}var un=me.line.height-Ze;if((un>.005||un<-.005)&&(hi(me.line,Ze),$a(me.line),me.rest))for(var bt=0;bt<me.rest.length;bt++)$a(me.rest[bt]);if(Qe>ie.display.sizerWidth){var Gn=Math.ceil(Qe/wi(ie.display));Gn>ie.display.maxLineLength&&(ie.display.maxLineLength=Gn,ie.display.maxLine=me.line,ie.display.maxLineChanged=!0)}}}}function $a(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 Eo(ie,ae,fe){var ce=fe&&fe.top!=null?Math.max(0,fe.top):ie.scroller.scrollTop;ce=Math.floor(ce-Xt(ie));var me=fe&&fe.bottom!=null?fe.bottom:ce+ie.wrapper.clientHeight,ke=sn(ae,ce),Ze=sn(ae,me);if(fe&&fe.ensure){var Qe=fe.ensure.from.line,Ue=fe.ensure.to.line;Qe<ke?(ke=Qe,Ze=sn(ae,rr(Kn(ae,Qe))+ie.wrapper.clientHeight)):Math.min(Ue,ae.lastLine())>=Ze&&(ke=sn(ae,rr(Kn(ae,Ue))-ie.wrapper.clientHeight),Ze=Ue)}return{from:ke,to:Math.max(Ze,ke+1)}}function ts(ie,ae){if(!hn(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&&!At){var ke=Ye("div","\u200B",null,`position: absolute;
|
|
top: `+(ae.top-fe.viewOffset-Xt(ie.display))+`px;
|
|
height: `+(ae.bottom-ae.top+yi(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 ys(ie,ae,fe,ce){ce==null&&(ce=0);var me;!ie.options.lineWrapping&&ae==fe&&(ae=ae.ch?cn(ae.line,ae.sticky=="before"?ae.ch-1:ae.ch,"after"):ae,fe=ae.sticky=="before"?cn(ae.line,ae.ch+1,"before"):ae);for(var ke=0;ke<5;ke++){var Ze=!1,Qe=wo(ie,ae),Ue=!fe||fe==ae?Qe:wo(ie,fe);me={left:Math.min(Qe.left,Ue.left),top:Math.min(Qe.top,Ue.top)-ce,right:Math.max(Qe.left,Ue.left),bottom:Math.max(Qe.bottom,Ue.bottom)+ce};var vt=ku(ie,me),un=ie.doc.scrollTop,bt=ie.doc.scrollLeft;if(vt.scrollTop!=null&&(Bl(ie,vt.scrollTop),Math.abs(ie.doc.scrollTop-un)>1&&(Ze=!0)),vt.scrollLeft!=null&&(ul(ie,vt.scrollLeft),Math.abs(ie.doc.scrollLeft-bt)>1&&(Ze=!0)),!Ze)break}return me}function Ol(ie,ae){var fe=ku(ie,ae);fe.scrollTop!=null&&Bl(ie,fe.scrollTop),fe.scrollLeft!=null&&ul(ie,fe.scrollLeft)}function ku(ie,ae){var fe=ie.display,ce=$i(ie.display);ae.top<0&&(ae.top=0);var me=ie.curOp&&ie.curOp.scrollTop!=null?ie.curOp.scrollTop:fe.scroller.scrollTop,ke=Li(ie),Ze={};ae.bottom-ae.top>ke&&(ae.bottom=ae.top+ke);var Qe=ie.doc.height+kn(fe),Ue=ae.top<ce,vt=ae.bottom>Qe-ce;if(ae.top<me)Ze.scrollTop=Ue?0:ae.top;else if(ae.bottom>me+ke){var un=Math.min(ae.top,(vt?Qe:ae.bottom)-ke);un!=me&&(Ze.scrollTop=un)}var bt=ie.options.fixedGutter?0:fe.gutters.offsetWidth,Gn=ie.curOp&&ie.curOp.scrollLeft!=null?ie.curOp.scrollLeft:fe.scroller.scrollLeft-bt,Bn=Ai(ie)-fe.gutters.offsetWidth,Ji=ae.right-ae.left>Bn;return Ji&&(ae.right=ae.left+Bn),ae.left<10?Ze.scrollLeft=0:ae.left<Gn?Ze.scrollLeft=Math.max(0,ae.left+bt-(Ji?0:10)):ae.right>Bn+Gn-3&&(Ze.scrollLeft=ae.right+(Ji?0:10)-Bn),Ze}function mu(ie,ae){ae!=null&&(tl(ie),ie.curOp.scrollTop=(ie.curOp.scrollTop==null?ie.doc.scrollTop:ie.curOp.scrollTop)+ae)}function Ll(ie){tl(ie);var ae=ie.getCursor();ie.curOp.scrollToPos={from:ae,to:ae,margin:ie.options.cursorScrollMargin}}function ru(ie,ae,fe){(ae!=null||fe!=null)&&tl(ie),ae!=null&&(ie.curOp.scrollLeft=ae),fe!=null&&(ie.curOp.scrollTop=fe)}function ka(ie,ae){tl(ie),ie.curOp.scrollToPos=ae}function tl(ie){var ae=ie.curOp.scrollToPos;if(ae){ie.curOp.scrollToPos=null;var fe=Ra(ie,ae.from),ce=Ra(ie,ae.to);ou(ie,fe,ce,ae.margin)}}function ou(ie,ae,fe,ce){var me=ku(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});ru(ie,me.scrollLeft,me.scrollTop)}function Bl(ie,ae){Math.abs(ie.doc.scrollTop-ae)<2||(ue||vl(ie,{top:ae}),ih(ie,ae,!0),ue&&vl(ie),Au(ie,100))}function ih(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 ul(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,sf(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+kn(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+yi(ie)+ae.barHeight,nativeBarWidth:ae.nativeBarWidth,gutterWidth:fe}}var Fa=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),Mn(ce,"scroll",function(){ce.clientHeight&&ae(ce.scrollTop,"vertical")}),Mn(me,"scroll",function(){me.clientWidth&&ae(me.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,mt&&Oe<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Fa.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}},Fa.prototype.setScrollLeft=function(ie){this.horiz.scrollLeft!=ie&&(this.horiz.scrollLeft=ie),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Fa.prototype.setScrollTop=function(ie){this.vert.scrollTop!=ie&&(this.vert.scrollTop=ie),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Fa.prototype.zeroWidthHack=function(){var ie=de&&!ot?"12px":"18px";this.horiz.style.height=this.vert.style.width=ie,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new nt,this.disableVert=new nt},Fa.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)},Fa.prototype.clear=function(){var ie=this.horiz.parentNode;ie.removeChild(this.horiz),ie.removeChild(this.vert)};var us=function(){};us.prototype.update=function(){return{bottom:0,right:0}},us.prototype.setScrollLeft=function(){},us.prototype.setScrollTop=function(){},us.prototype.clear=function(){};function Ts(ie,ae){ae||(ae=pa(ie));var fe=ie.display.barWidth,ce=ie.display.barHeight;_s(ie,ae);for(var me=0;me<4&&fe!=ie.display.barWidth||ce!=ie.display.barHeight;me++)fe!=ie.display.barWidth&&ie.options.lineWrapping&&kr(ie),_s(ie,pa(ie)),fe=ie.display.barWidth,ce=ie.display.barHeight}function _s(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 vu={native:Fa,null:us};function Jl(ie){ie.display.scrollbars&&(ie.display.scrollbars.clear(),ie.display.scrollbars.addClass&&Re(ie.display.wrapper,ie.display.scrollbars.addClass)),ie.display.scrollbars=new vu[ie.options.scrollbarStyle](function(ae){ie.display.wrapper.insertBefore(ae,ie.display.scrollbarFiller),Mn(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"?ul(ie,ae):Bl(ie,ae)},ie),ie.display.scrollbars.addClass&&Lt(ie.display.wrapper,ie.display.scrollbars.addClass)}var yu=0;function Jn(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:++yu},vs(ie.curOp)}function Xr(ie){var ae=ie.curOp;ae&&ns(ae,function(fe){for(var ce=0;ce<fe.ops.length;ce++)fe.ops[ce].cm.curOp=null;Aa(fe)})}function Aa(ie){for(var ae=ie.ops,fe=0;fe<ae.length;fe++)Go(ae[fe]);for(var ce=0;ce<ae.length;ce++)Lr(ae[ce]);for(var me=0;me<ae.length;me++)Wa(ae[me]);for(var ke=0;ke<ae.length;ke++)aa(ae[ke]);for(var Ze=0;Ze<ae.length;Ze++)qa(ae[Ze])}function Go(ie){var ae=ie.cm,fe=ae.display;Ml(ae),ie.updateMaxLine&&uo(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 js(ae,ie.mustUpdate&&{top:ie.scrollTop,ensure:ie.scrollToPos},ie.forceUpdate)}function Lr(ie){ie.updatedDisplay=ie.mustUpdate&&Ch(ie.cm,ie.update)}function Wa(ie){var ae=ie.cm,fe=ae.display;ie.updatedDisplay&&kr(ae),ie.barMeasure=pa(ae),fe.maxLineChanged&&!ae.options.lineWrapping&&(ie.adjustWidthTo=Rr(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+yi(ae)+ae.display.barWidth),ie.maxScrollLeft=Math.max(0,fe.sizer.offsetLeft+ie.adjustWidthTo-Ai(ae))),(ie.updatedDisplay||ie.selectionChanged)&&(ie.preparedSelection=fe.input.prepareSelection())}function aa(ie){var ae=ie.cm;ie.adjustWidthTo!=null&&(ae.display.sizer.style.minWidth=ie.adjustWidthTo+"px",ie.maxScrollLeft<ae.doc.scrollLeft&&ul(ae,Math.min(ae.display.scroller.scrollLeft,ie.maxScrollLeft),!0),ae.display.maxLineChanged=!1);var fe=ie.focus&&ie.focus==St();ie.preparedSelection&&ae.display.input.showSelection(ie.preparedSelection,fe),(ie.updatedDisplay||ie.startHeight!=ae.doc.height)&&Ts(ae,ie.barMeasure),ie.updatedDisplay&&Oh(ae,ie.barMeasure),ie.selectionChanged&&ta(ae),ae.state.focused&&ie.updateInput&&ae.display.input.reset(ie.typing),fe&&Sa(ie.cm)}function qa(ie){var ae=ie.cm,fe=ae.display,ce=ae.doc;if(ie.updatedDisplay&&Ka(ae,ie.update),fe.wheelStartX!=null&&(ie.scrollTop!=null||ie.scrollLeft!=null||ie.scrollToPos)&&(fe.wheelStartX=fe.wheelStartY=null),ie.scrollTop!=null&&ih(ae,ie.scrollTop,ie.forceScroll),ie.scrollLeft!=null&&ul(ae,ie.scrollLeft,!0,!0),ie.scrollToPos){var me=ys(ae,Ri(ce,ie.scrollToPos.from),Ri(ce,ie.scrollToPos.to),ie.scrollToPos.margin);ts(ae,me)}var ke=ie.maybeHiddenMarkers,Ze=ie.maybeUnhiddenMarkers;if(ke)for(var Qe=0;Qe<ke.length;++Qe)ke[Qe].lines.length||tn(ke[Qe],"hide");if(Ze)for(var Ue=0;Ue<Ze.length;++Ue)Ze[Ue].lines.length&&tn(Ze[Ue],"unhide");fe.wrapper.offsetHeight&&(ce.scrollTop=ae.display.scroller.scrollTop),ie.changeObjs&&tn(ae,"changes",ae,ie.changeObjs),ie.update&&ie.update.finish()}function xo(ie,ae){if(ie.curOp)return ae();Jn(ie);try{return ae()}finally{Xr(ie)}}function Va(ie,ae){return function(){if(ie.curOp)return ae.apply(ie,arguments);Jn(ie);try{return ae.apply(ie,arguments)}finally{Xr(ie)}}}function Ea(ie){return function(){if(this.curOp)return ie.apply(this,arguments);Jn(this);try{return ie.apply(this,arguments)}finally{Xr(this)}}}function Cs(ie){return function(){var ae=this.cm;if(!ae||ae.curOp)return ie.apply(this,arguments);Jn(ae);try{return ie.apply(this,arguments)}finally{Xr(ae)}}}function Au(ie,ae){ie.doc.highlightFrontier<ie.display.viewTo&&ie.state.highlight.set(ae,Pn(So,ie))}function So(ie){var ae=ie.doc;if(!(ae.highlightFrontier>=ie.display.viewTo)){var fe=+new Date+ie.options.workTime,ce=mo(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 Ze=ke.styles,Qe=ke.text.length>ie.options.maxHighlightLength?ui(ae.mode,ce.state):null,Ue=Yo(ie,ke,ce,!0);Qe&&(ce.state=Qe),ke.styles=Ue.styles;var vt=ke.styleClasses,un=Ue.classes;un?ke.styleClasses=un:vt&&(ke.styleClasses=null);for(var bt=!Ze||Ze.length!=ke.styles.length||vt!=un&&(!vt||!un||vt.bgClass!=un.bgClass||vt.textClass!=un.textClass),Gn=0;!bt&&Gn<Ze.length;++Gn)bt=Ze[Gn]!=ke.styles[Gn];bt&&me.push(ce.line),ke.stateAfter=ce.save(),ce.nextLine()}else ke.text.length<=ie.options.maxHighlightLength&&en(ie,ke.text,ce),ke.stateAfter=ce.line%5==0?ce.save():null,ce.nextLine();if(+new Date>fe)return Au(ie,ie.options.workDelay),!0}),ae.highlightFrontier=ce.line,ae.modeFrontier=Math.max(ae.modeFrontier,ce.line),me.length&&xo(ie,function(){for(var ke=0;ke<me.length;ke++)Ci(ie,me[ke],"text")})}}var js=function(ie,ae,fe){var ce=ie.display;this.viewport=ae,this.visible=Eo(ce,ie.doc,ae),this.editorIsHidden=!ce.wrapper.offsetWidth,this.wrapperHeight=ce.wrapper.clientHeight,this.wrapperWidth=ce.wrapper.clientWidth,this.oldDisplayWidth=Ai(ie),this.force=fe,this.dims=pr(ie),this.events=[]};js.prototype.signal=function(ie,ae){Sn(ie,ae)&&this.events.push(arguments)},js.prototype.finish=function(){for(var ie=0;ie<this.events.length;ie++)tn.apply(null,this.events[ie])};function Ml(ie){var ae=ie.display;!ae.scrollbarsClipped&&ae.scroller.offsetWidth&&(ae.nativeBarWidth=ae.scroller.offsetWidth-ae.scroller.clientWidth,ae.heightForcer.style.height=yi(ie)+"px",ae.sizer.style.marginBottom=-ae.nativeBarWidth+"px",ae.sizer.style.borderRightWidth=yi(ie)+"px",ae.scrollbarsClipped=!0)}function Xs(ie){if(ie.hasFocus())return null;var ae=St();if(!ae||!wt(ie.display.lineDiv,ae))return null;var fe={activeElt:ae};if(window.getSelection){var ce=window.getSelection();ce.anchorNode&&ce.extend&&wt(ie.display.lineDiv,ce.anchorNode)&&(fe.anchorNode=ce.anchorNode,fe.anchorOffset=ce.anchorOffset,fe.focusNode=ce.focusNode,fe.focusOffset=ce.focusOffset)}return fe}function Is(ie){if(!(!ie||!ie.activeElt||ie.activeElt==St())&&(ie.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(ie.activeElt.nodeName)&&ie.anchorNode&&wt(document.body,ie.anchorNode)&&wt(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 Ch(ie,ae){var fe=ie.display,ce=ie.doc;if(ae.editorIsHidden)return Dr(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&&Cr(ie)==0)return!1;Vs(ie)&&(Dr(ie),ae.dims=pr(ie));var me=ce.first+ce.size,ke=Math.max(ae.visible.from-ie.options.viewportMargin,ce.first),Ze=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>Ze&&fe.viewTo-Ze<20&&(Ze=Math.min(me,fe.viewTo)),Tn&&(ke=qi(ie.doc,ke),Ze=Ui(ie.doc,Ze));var Qe=ke!=fe.viewFrom||Ze!=fe.viewTo||fe.lastWrapHeight!=ae.wrapperHeight||fe.lastWrapWidth!=ae.wrapperWidth;br(ie,ke,Ze),fe.viewOffset=rr(Kn(ie.doc,fe.viewFrom)),ie.display.mover.style.top=fe.viewOffset+"px";var Ue=Cr(ie);if(!Qe&&Ue==0&&!ae.force&&fe.renderedView==fe.view&&(fe.updateLineNumbers==null||fe.updateLineNumbers>=fe.viewTo))return!1;var vt=Xs(ie);return Ue>4&&(fe.lineDiv.style.display="none"),bh(ie,fe.updateLineNumbers,ae.dims),Ue>4&&(fe.lineDiv.style.display=""),fe.renderedView=fe.view,Is(vt),rt(fe.cursorDiv),rt(fe.selectionDiv),fe.gutters.style.height=fe.sizer.style.minHeight=0,Qe&&(fe.lastWrapHeight=ae.wrapperHeight,fe.lastWrapWidth=ae.wrapperWidth,Au(ie,400)),fe.updateLineNumbers=null,!0}function Ka(ie,ae){for(var fe=ae.viewport,ce=!0;;ce=!1){if(!ce||!ie.options.lineWrapping||ae.oldDisplayWidth==Ai(ie)){if(fe&&fe.top!=null&&(fe={top:Math.min(ie.doc.height+kn(ie.display)-Li(ie),fe.top)}),ae.visible=Eo(ie.display,ie.doc,fe),ae.visible.from>=ie.display.viewFrom&&ae.visible.to<=ie.display.viewTo)break}else ce&&(ae.visible=Eo(ie.display,ie.doc,fe));if(!Ch(ie,ae))break;kr(ie);var me=pa(ie);Nr(ie),Ts(ie,me),Oh(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 vl(ie,ae){var fe=new js(ie,ae);if(Ch(ie,fe)){kr(ie),Ka(ie,fe);var ce=pa(ie);Nr(ie),Ts(ie,ce),Oh(ie,ce),fe.finish()}}function bh(ie,ae,fe){var ce=ie.display,me=ie.options.lineNumbers,ke=ce.lineDiv,Ze=ke.firstChild;function Qe(Ji){var or=Ji.nextSibling;return at&&de&&ie.display.currentWheelTarget==Ji?Ji.style.display="none":Ji.parentNode.removeChild(Ji),or}for(var Ue=ce.view,vt=ce.viewFrom,un=0;un<Ue.length;un++){var bt=Ue[un];if(!bt.hidden)if(!bt.node||bt.node.parentNode!=ke){var Gn=ms(ie,bt,vt,fe);ke.insertBefore(Gn,Ze)}else{for(;Ze!=bt.node;)Ze=Qe(Ze);var Bn=me&&ae!=null&&ae<=vt&&bt.lineNumber;bt.changes&&(gn(bt.changes,"gutter")>-1&&(Bn=!1),Ba(ie,bt,vt,fe)),Bn&&(rt(bt.lineNumber),bt.lineNumber.appendChild(document.createTextNode(Di(ie.options,vt)))),Ze=bt.node.nextSibling}vt+=bt.size}for(;Ze;)Ze=Qe(Ze)}function Ih(ie){var ae=ie.gutters.offsetWidth;ie.sizer.style.marginLeft=ae+"px"}function Oh(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+yi(ie)+"px"}function sf(ie){var ae=ie.display,fe=ae.view;if(!(!ae.alignWidgets&&(!ae.gutters.firstChild||!ie.options.fixedGutter))){for(var ce=Hr(ae)-ae.scroller.scrollLeft+ie.doc.scrollLeft,me=ae.gutters.offsetWidth,ke=ce+"px",Ze=0;Ze<fe.length;Ze++)if(!fe[Ze].hidden){ie.options.fixedGutter&&(fe[Ze].gutter&&(fe[Ze].gutter.style.left=ke),fe[Ze].gutterBackground&&(fe[Ze].gutterBackground.style.left=ke));var Qe=fe[Ze].alignable;if(Qe)for(var Ue=0;Ue<Qe.length;Ue++)Qe[Ue].style.left=ke}ie.options.fixedGutter&&(ae.gutters.style.left=ce+me+"px")}}function Vs(ie){if(!ie.options.lineNumbers)return!1;var ae=ie.doc,fe=Di(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,Ze=me.offsetWidth-ke;return ce.lineGutter.style.width="",ce.lineNumInnerWidth=Math.max(ke,ce.lineGutter.offsetWidth-Ze)+1,ce.lineNumWidth=ce.lineNumInnerWidth+Ze,ce.lineNumChars=ce.lineNumInnerWidth?fe.length:-1,ce.lineGutter.style.width=ce.lineNumWidth+"px",Ih(ie.display),!0}return!1}function ol(ie,ae){for(var fe=[],ce=!1,me=0;me<ie.length;me++){var ke=ie[me],Ze=null;if(typeof ke!="string"&&(Ze=ke.style,ke=ke.className),ke=="CodeMirror-linenumbers")if(ae)ce=!0;else continue;fe.push({className:ke,style:Ze})}return ae&&!ce&&fe.push({className:"CodeMirror-linenumbers",style:null}),fe}function sd(ie){var ae=ie.gutters,fe=ie.gutterSpecs;rt(ae),ie.lineGutter=null;for(var ce=0;ce<fe.length;++ce){var me=fe[ce],ke=me.className,Ze=me.style,Qe=ae.appendChild(Ye("div",null,"CodeMirror-gutter "+ke));Ze&&(Qe.style.cssText=Ze),ke=="CodeMirror-linenumbers"&&(ie.lineGutter=Qe,Qe.style.width=(ie.lineNumWidth||1)+"px")}ae.style.display=fe.length?"":"none",Ih(ie)}function Rl(ie){sd(ie.display),_i(ie),sf(ie)}function Rh(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=ut("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=ut("div",[me.measure,me.lineMeasure,me.selectionDiv,me.cursorDiv,me.lineDiv],null,"position: relative; outline: none");var ke=ut("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: "+oi+"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"),mt&&Oe<8&&(me.gutters.style.zIndex=-1,me.scroller.style.paddingRight=0),!at&&!(ue&&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=ol(ce.gutters,ce.lineNumbers),sd(me),fe.init(me)}var jl=0,Os=null;mt?Os=-.53:ue?Os=15:dt?Os=-.7:Rt&&(Os=-1/3);function Nu(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 au(ie){var ae=Nu(ie);return ae.x*=Os,ae.y*=Os,ae}function al(ie,ae){var fe=Nu(ae),ce=fe.x,me=fe.y,ke=ie.display,Ze=ke.scroller,Qe=Ze.scrollWidth>Ze.clientWidth,Ue=Ze.scrollHeight>Ze.clientHeight;if(ce&&Qe||me&&Ue){if(me&&de&&at){e:for(var vt=ae.target,un=ke.view;vt!=Ze;vt=vt.parentNode)for(var bt=0;bt<un.length;bt++)if(un[bt].node==vt){ie.display.currentWheelTarget=vt;break e}}if(ce&&!ue&&!Ge&&Os!=null){me&&Ue&&Bl(ie,Math.max(0,Ze.scrollTop+me*Os)),ul(ie,Math.max(0,Ze.scrollLeft+ce*Os)),(!me||me&&Ue)&&gi(ae),ke.wheelStartX=null;return}if(me&&Os!=null){var Gn=me*Os,Bn=ie.doc.scrollTop,Ji=Bn+ke.wrapper.clientHeight;Gn<0?Bn=Math.max(0,Bn+Gn-50):Ji=Math.min(ie.doc.height,Ji+Gn+50),vl(ie,{top:Bn,bottom:Ji})}jl<20&&(ke.wheelStartX==null?(ke.wheelStartX=Ze.scrollLeft,ke.wheelStartY=Ze.scrollTop,ke.wheelDX=ce,ke.wheelDY=me,setTimeout(function(){if(ke.wheelStartX!=null){var or=Ze.scrollLeft-ke.wheelStartX,Br=Ze.scrollTop-ke.wheelStartY,Jr=Br&&ke.wheelDY&&Br/ke.wheelDY||or&&ke.wheelDX&&or/ke.wheelDX;ke.wheelStartX=ke.wheelStartY=null,Jr&&(Os=(Os*jl+Jr)/(jl+1),++jl)}},200)):(ke.wheelDX+=ce,ke.wheelDY+=me))}}var su=function(ie,ae){this.ranges=ie,this.primIndex=ae};su.prototype.primary=function(){return this.ranges[this.primIndex]},su.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(!an(fe.anchor,ce.anchor)||!an(fe.head,ce.head))return!1}return!0},su.prototype.deepCopy=function(){for(var ie=[],ae=0;ae<this.ranges.length;ae++)ie[ae]=new ss(Gi(this.ranges[ae].anchor),Gi(this.ranges[ae].head));return new su(ie,this.primIndex)},su.prototype.somethingSelected=function(){for(var ie=0;ie<this.ranges.length;ie++)if(!this.ranges[ie].empty())return!0;return!1},su.prototype.contains=function(ie,ae){ae||(ae=ie);for(var fe=0;fe<this.ranges.length;fe++){var ce=this.ranges[fe];if(qt(ae,ce.from())>=0&&qt(ie,ce.to())<=0)return fe}return-1};var ss=function(ie,ae){this.anchor=ie,this.head=ae};ss.prototype.from=function(){return Hi(this.anchor,this.head)},ss.prototype.to=function(){return ur(this.anchor,this.head)},ss.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function xu(ie,ae,fe){var ce=ie&&ie.options.selectionsMayTouch,me=ae[fe];ae.sort(function(Gn,Bn){return qt(Gn.from(),Bn.from())}),fe=gn(ae,me);for(var ke=1;ke<ae.length;ke++){var Ze=ae[ke],Qe=ae[ke-1],Ue=qt(Qe.to(),Ze.from());if(ce&&!Ze.empty()?Ue>0:Ue>=0){var vt=Hi(Qe.from(),Ze.from()),un=ur(Qe.to(),Ze.to()),bt=Qe.empty()?Ze.from()==Ze.head:Qe.from()==Qe.head;ke<=fe&&--fe,ae.splice(--ke,2,new ss(bt?un:vt,bt?vt:un))}}return new su(ae,fe)}function Fh(ie,ae){return new su([new ss(ie,ae||ie)],0)}function jh(ie){return ie.text?cn(ie.from.line+ie.text.length-1,lt(ie.text).length+(ie.text.length==1?ie.from.ch:0)):ie.to}function ld(ie,ae){if(qt(ie,ae.from)<0)return ie;if(qt(ie,ae.to)<=0)return jh(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+=jh(ae).ch-ae.to.ch),cn(fe,ce)}function xc(ie,ae){for(var fe=[],ce=0;ce<ie.sel.ranges.length;ce++){var me=ie.sel.ranges[ce];fe.push(new ss(ld(me.anchor,ae),ld(me.head,ae)))}return xu(ie.cm,fe,ie.sel.primIndex)}function Su(ie,ae,fe){return ie.line==ae.line?cn(fe.line,ie.ch-ae.ch+fe.ch):cn(fe.line+(ie.line-ae.line),ie.ch)}function Sc(ie,ae,fe){for(var ce=[],me=cn(ie.first,0),ke=me,Ze=0;Ze<ae.length;Ze++){var Qe=ae[Ze],Ue=Su(Qe.from,me,ke),vt=Su(jh(Qe),me,ke);if(me=Qe.to,ke=vt,fe=="around"){var un=ie.sel.ranges[Ze],bt=qt(un.head,un.anchor)<0;ce[Ze]=new ss(bt?vt:Ue,bt?Ue:vt)}else ce[Ze]=new ss(Ue,Ue)}return new su(ce,ie.sel.primIndex)}function Na(ie){ie.doc.mode=Bt(ie.options,ie.doc.modeOption),ud(ie)}function ud(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,Au(ie,100),ie.state.modeGen++,ie.curOp&&_i(ie)}function Uf(ie,ae){return ae.from.ch==0&&ae.to.ch==0&<(ae.text)==""&&(!ie.cm||ie.cm.options.wholeLineUpdateBefore)}function wc(ie,ae,fe,ce){function me(Ao){return fe?fe[Ao]:null}function ke(Ao,ho,jo){Do(Ao,ho,jo,ce),Vr(Ao,"change",Ao,ae)}function Ze(Ao,ho){for(var jo=[],ma=Ao;ma<ho;++ma)jo.push(new No(vt[ma],me(ma),ce));return jo}var Qe=ae.from,Ue=ae.to,vt=ae.text,un=Kn(ie,Qe.line),bt=Kn(ie,Ue.line),Gn=lt(vt),Bn=me(vt.length-1),Ji=Ue.line-Qe.line;if(ae.full)ie.insert(0,Ze(0,vt.length)),ie.remove(vt.length,ie.size-vt.length);else if(Uf(ie,ae)){var or=Ze(0,vt.length-1);ke(bt,bt.text,Bn),Ji&&ie.remove(Qe.line,Ji),or.length&&ie.insert(Qe.line,or)}else if(un==bt)if(vt.length==1)ke(un,un.text.slice(0,Qe.ch)+Gn+un.text.slice(Ue.ch),Bn);else{var Br=Ze(1,vt.length-1);Br.push(new No(Gn+un.text.slice(Ue.ch),Bn,ce)),ke(un,un.text.slice(0,Qe.ch)+vt[0],me(0)),ie.insert(Qe.line+1,Br)}else if(vt.length==1)ke(un,un.text.slice(0,Qe.ch)+vt[0]+bt.text.slice(Ue.ch),me(0)),ie.remove(Qe.line+1,Ji);else{ke(un,un.text.slice(0,Qe.ch)+vt[0],me(0)),ke(bt,Gn+bt.text.slice(Ue.ch),Bn);var Jr=Ze(1,vt.length-1);Ji>1&&ie.remove(Qe.line+1,Ji-1),ie.insert(Qe.line+1,Jr)}Vr(ie,"change",ie,ae)}function Du(ie,ae,fe){function ce(me,ke,Ze){if(me.linked)for(var Qe=0;Qe<me.linked.length;++Qe){var Ue=me.linked[Qe];if(Ue.doc!=ke){var vt=Ze&&Ue.sharedHist;fe&&!vt||(ae(Ue.doc,vt),ce(Ue.doc,me,vt))}}}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,lr(ie),Na(ie),Rd(ie),ie.options.lineWrapping||uo(ie),ie.options.mode=ae.modeOption,_i(ie)}function Rd(ie){(ie.doc.direction=="rtl"?Lt:Re)(ie.display.lineDiv,"CodeMirror-rtl")}function Hg(ie){xo(ie,function(){Rd(ie),_i(ie)})}function jd(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:Gi(ae.from),to:jh(ae),text:It(ie,ae.from,ae.to)};return rh(ie,fe,ae.from.line,ae.to.line+1),Du(ie,function(ce){return rh(ce,fe,ae.from.line,ae.to.line+1)},!0),fe}function hd(ie){for(;ie.length;){var ae=lt(ie);if(ae.ranges)ie.pop();else break}}function Pc(ie,ae){if(ae)return hd(ie.done),lt(ie.done);if(ie.done.length&&!lt(ie.done).ranges)return lt(ie.done);if(ie.done.length>1&&!ie.done[ie.done.length-2].ranges)return ie.done.pop(),lt(ie.done)}function dd(ie,ae,fe,ce){var me=ie.history;me.undone.length=0;var ke=+new Date,Ze,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)=="*"))&&(Ze=Pc(me,me.lastOp==ce)))Qe=lt(Ze.changes),qt(ae.from,ae.to)==0&&qt(ae.from,Qe.to)==0?Qe.to=jh(ae):Ze.changes.push(uf(ie,ae));else{var Ue=lt(me.done);for((!Ue||!Ue.ranges)&&zd(ie.sel,me.done),Ze={changes:[uf(ie,ae)],generation:me.generation},me.done.push(Ze);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||tn(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 cd(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,lt(me.done),ae))?me.done[me.done.length-1]=ae:zd(ae,me.done),me.lastSelTime=+new Date,me.lastSelOrigin=ke,me.lastSelOp=fe,ce&&ce.clearRedo!==!1&&hd(me.undone)}function zd(ie,ae){var fe=lt(ae);fe&&fe.ranges&&fe.equals(ie)||ae.push(ie)}function rh(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(Ze){Ze.markedSpans&&((me||(me=ae["spans_"+ie.id]={}))[ke]=Ze.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 oh(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=oh(ie,ae),ce=zo(ie,ae);if(!fe)return ce;if(!ce)return fe;for(var me=0;me<fe.length;++me){var ke=fe[me],Ze=ce[me];if(ke&&Ze)e:for(var Qe=0;Qe<Ze.length;++Qe){for(var Ue=Ze[Qe],vt=0;vt<ke.length;++vt)if(ke[vt].marker==Ue.marker)continue e;ke.push(Ue)}else Ze&&(fe[me]=Ze)}return fe}function ah(ie,ae,fe){for(var ce=[],me=0;me<ie.length;++me){var ke=ie[me];if(ke.ranges){ce.push(fe?su.prototype.deepCopy.call(ke):ke);continue}var Ze=ke.changes,Qe=[];ce.push({changes:Qe});for(var Ue=0;Ue<Ze.length;++Ue){var vt=Ze[Ue],un=void 0;if(Qe.push({from:vt.from,to:vt.to,text:vt.text}),ae)for(var bt in vt)(un=bt.match(/^spans_(\d+)$/))&&gn(ae,Number(un[1]))>-1&&(lt(Qe)[bt]=vt[bt],delete vt[bt])}}return ce}function cf(ie,ae,fe,ce){if(ce){var me=ie.anchor;if(fe){var ke=qt(ae,me)<0;ke!=qt(fe,me)<0?(me=ae,ae=fe):ke!=qt(ae,fe)<0&&(ae=fe)}return new ss(me,ae)}else return new ss(fe||ae,ae)}function ff(ie,ae,fe,ce,me){me==null&&(me=ie.cm&&(ie.cm.display.shift||ie.extend)),hl(ie,new su([cf(ie.sel.primary(),ae,fe,me)],0),ce)}function Wg(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 Ze=xu(ie.cm,ce,ie.sel.primIndex);hl(ie,Ze,fe)}function wu(ie,ae,fe,ce){var me=ie.sel.ranges.slice(0);me[ae]=fe,hl(ie,xu(ie.cm,me,ie.sel.primIndex),ce)}function Tu(ie,ae,fe,ce){hl(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 ss(Ri(ie,me[ke].anchor),Ri(ie,me[ke].head))},origin:fe&&fe.origin};return tn(ie,"beforeSelectionChange",ie,ce),ie.cm&&tn(ie.cm,"beforeSelectionChange",ie.cm,ce),ce.ranges!=ae.ranges?xu(ie.cm,ce.ranges,ce.ranges.length-1):ae}function pf(ie,ae,fe){var ce=ie.history.done,me=lt(ce);me&&me.ranges?(ce[ce.length-1]=ae,fd(ie,ae,fe)):hl(ie,ae,fe)}function hl(ie,ae,fe){fd(ie,ae,fe),cd(ie,ie.sel,ie.cm?ie.cm.curOp.id:NaN,fe)}function fd(ie,ae,fe){(Sn(ie,"beforeSelectionChange")||ie.cm&&Sn(ie.cm,"beforeSelectionChange"))&&(ae=gf(ie,ae,fe));var ce=fe&&fe.bias||(qt(ae.primary().head,ie.sel.primary().head)<0?-1:1);gd(ie,Cc(ie,ae,ce,!0)),!(fe&&fe.scroll===!1)&&ie.cm&&Ll(ie.cm)}function gd(ie,ae){ae.equals(ie.sel)||(ie.sel=ae,ie.cm&&(ie.cm.curOp.updateInput=1,ie.cm.curOp.selectionChanged=!0,di(ie.cm)),Vr(ie,"cursorActivity",ie))}function Ec(ie){gd(ie,Cc(ie,ie.sel,null,!1))}function Cc(ie,ae,fe,ce){for(var me,ke=0;ke<ae.ranges.length;ke++){var Ze=ae.ranges[ke],Qe=ae.ranges.length==ie.sel.ranges.length&&ie.sel.ranges[ke],Ue=pd(ie,Ze.anchor,Qe&&Qe.anchor,fe,ce),vt=pd(ie,Ze.head,Qe&&Qe.head,fe,ce);(me||Ue!=Ze.anchor||vt!=Ze.head)&&(me||(me=ae.ranges.slice(0,ke)),me[ke]=new ss(Ue,vt))}return me?xu(ie.cm,me,ae.primIndex):ae}function nl(ie,ae,fe,ce,me){var ke=Kn(ie,ae.line);if(ke.markedSpans)for(var Ze=0;Ze<ke.markedSpans.length;++Ze){var Qe=ke.markedSpans[Ze],Ue=Qe.marker,vt="selectLeft"in Ue?!Ue.selectLeft:Ue.inclusiveLeft,un="selectRight"in Ue?!Ue.selectRight:Ue.inclusiveRight;if((Qe.from==null||(vt?Qe.from<=ae.ch:Qe.from<ae.ch))&&(Qe.to==null||(un?Qe.to>=ae.ch:Qe.to>ae.ch))){if(me&&(tn(Ue,"beforeCursorEnter"),Ue.explicitlyCleared))if(ke.markedSpans){--Ze;continue}else break;if(!Ue.atomic)continue;if(fe){var bt=Ue.find(ce<0?1:-1),Gn=void 0;if((ce<0?un:vt)&&(bt=mf(ie,bt,-ce,bt&&bt.line==ae.line?ke:null)),bt&&bt.line==ae.line&&(Gn=qt(bt,fe))&&(ce<0?Gn<0:Gn>0))return nl(ie,bt,ae,ce,me)}var Bn=Ue.find(ce<0?-1:1);return(ce<0?vt:un)&&(Bn=mf(ie,Bn,ce,Bn.line==ae.line?ke:null)),Bn?nl(ie,Bn,ae,ce,me):null}}return ae}function pd(ie,ae,fe,ce,me){var ke=ce||1,Ze=nl(ie,ae,fe,ke,me)||!me&&nl(ie,ae,fe,ke,!0)||nl(ie,ae,fe,-ke,me)||!me&&nl(ie,ae,fe,-ke,!0);return Ze||(ie.cantEdit=!0,cn(ie.first,0))}function mf(ie,ae,fe,ce){return fe<0&&ae.ch==0?ae.line>ie.first?Ri(ie,cn(ae.line-1)):null:fe>0&&ae.ch==(ce||Kn(ie,ae.line)).text.length?ae.line<ie.first+ie.size-1?cn(ae.line+1,0):null:new cn(ae.line,ae.ch+fe)}function zs(ie){ie.setSelection(cn(ie.firstLine(),0),cn(ie.lastLine()),Ht)}function Zd(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,Ze,Qe){me&&(ce.from=Ri(ie,me)),ke&&(ce.to=Ri(ie,ke)),Ze&&(ce.text=Ze),Qe!==void 0&&(ce.origin=Qe)}),tn(ie,"beforeChange",ie,ce),ie.cm&&tn(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 _u(ie,ae,fe){if(ie.cm){if(!ie.cm.curOp)return Va(ie.cm,_u)(ie,ae,fe);if(ie.cm.state.suppressEdits)return}if(!((Sn(ie,"beforeChange")||ie.cm&&Sn(ie.cm,"beforeChange"))&&(ae=Zd(ie,ae,!0),!ae))){var ce=lo&&!fe&&On(ie,ae.from,ae.to);if(ce)for(var me=ce.length-1;me>=0;--me)zh(ie,{from:ce[me].from,to:ce[me].to,text:me?[""]:ae.text,origin:ae.origin});else zh(ie,ae)}}function zh(ie,ae){if(!(ae.text.length==1&&ae.text[0]==""&&qt(ae.from,ae.to)==0)){var fe=xc(ie,ae);dd(ie,ae,fe,ie.cm?ie.cm.curOp.id:NaN),Gd(ie,ae,fe,zo(ie,ae));var ce=[];Du(ie,function(me,ke){!ke&&gn(ce,me.history)==-1&&(Xf(me.history,ae),ce.push(me.history)),Gd(me,ae,null,zo(me,ae))})}}function bc(ie,ae,fe){var ce=ie.cm&&ie.cm.state.suppressEdits;if(!(ce&&!fe)){for(var me=ie.history,ke,Ze=ie.sel,Qe=ae=="undo"?me.done:me.undone,Ue=ae=="undo"?me.undone:me.done,vt=0;vt<Qe.length&&(ke=Qe[vt],!(fe?ke.ranges&&!ke.equals(ie.sel):!ke.ranges));vt++);if(vt!=Qe.length){for(me.lastOrigin=me.lastSelOrigin=null;;)if(ke=Qe.pop(),ke.ranges){if(zd(ke,Ue),fe&&!ke.equals(ie.sel)){hl(ie,ke,{clearRedo:!1});return}Ze=ke}else if(ce){Qe.push(ke);return}else break;var un=[];zd(Ze,Ue),Ue.push({changes:un,generation:me.generation}),me.generation=ke.generation||++me.maxGeneration;for(var bt=Sn(ie,"beforeChange")||ie.cm&&Sn(ie.cm,"beforeChange"),Gn=function(or){var Br=ke.changes[or];if(Br.origin=ae,bt&&!Zd(ie,Br,!1))return Qe.length=0,{};un.push(uf(ie,Br));var Jr=or?xc(ie,Br):lt(Qe);Gd(ie,Br,Jr,df(ie,Br)),!or&&ie.cm&&ie.cm.scrollIntoView({from:Br.from,to:jh(Br)});var Ao=[];Du(ie,function(ho,jo){!jo&&gn(Ao,ho.history)==-1&&(Xf(ho.history,Br),Ao.push(ho.history)),Gd(ho,Br,null,df(ho,Br))})},Bn=ke.changes.length-1;Bn>=0;--Bn){var Ji=Gn(Bn);if(Ji)return Ji.v}}}}function Yf(ie,ae){if(ae!=0&&(ie.first+=ae,ie.sel=new su(An(ie.sel.ranges,function(me){return new ss(cn(me.anchor.line+ae,me.anchor.ch),cn(me.head.line+ae,me.head.ch))}),ie.sel.primIndex),ie.cm)){_i(ie.cm,ie.first,ie.first-ae,ae);for(var fe=ie.cm.display,ce=fe.viewFrom;ce<fe.viewTo;ce++)Ci(ie.cm,ce,"gutter")}}function Gd(ie,ae,fe,ce){if(ie.cm&&!ie.cm.curOp)return Va(ie.cm,Gd)(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:cn(ie.first,0),to:cn(ae.to.line+me,ae.to.ch),text:[lt(ae.text)],origin:ae.origin}}var ke=ie.lastLine();ae.to.line>ke&&(ae={from:ae.from,to:cn(ke,Kn(ie,ke).text.length),text:[ae.text[0]],origin:ae.origin}),ae.removed=It(ie,ae.from,ae.to),fe||(fe=xc(ie,ae)),ie.cm?vf(ie.cm,ae,ce):wc(ie,ae,ce),fd(ie,fe,Ht),ie.cantEdit&&pd(ie,cn(ie.firstLine(),0))&&(ie.cantEdit=!1)}}function vf(ie,ae,fe){var ce=ie.doc,me=ie.display,ke=ae.from,Ze=ae.to,Qe=!1,Ue=ke.line;ie.options.lineWrapping||(Ue=it(Ei(Kn(ce,ke.line))),ce.iter(Ue,Ze.line+1,function(Bn){if(Bn==me.maxLine)return Qe=!0,!0})),ce.sel.contains(ae.from,ae.to)>-1&&di(ie),wc(ce,ae,fe,no(ie)),ie.options.lineWrapping||(ce.iter(Ue,ke.line+ae.text.length,function(Bn){var Ji=Po(Bn);Ji>me.maxLineLength&&(me.maxLine=Bn,me.maxLineLength=Ji,me.maxLineChanged=!0,Qe=!1)}),Qe&&(ie.curOp.updateMaxLine=!0)),so(ce,ke.line),Au(ie,400);var vt=ae.text.length-(Ze.line-ke.line)-1;ae.full?_i(ie):ke.line==Ze.line&&ae.text.length==1&&!Uf(ie.doc,ae)?Ci(ie,ke.line,"text"):_i(ie,ke.line,Ze.line+1,vt);var un=Sn(ie,"changes"),bt=Sn(ie,"change");if(bt||un){var Gn={from:ke,to:Ze,text:ae.text,removed:ae.removed,origin:ae.origin};bt&&Vr(ie,"change",ie,Gn),un&&(ie.curOp.changeObjs||(ie.curOp.changeObjs=[])).push(Gn)}ie.display.selForContextMenu=null}function Wu(ie,ae,fe,ce,me){var ke;ce||(ce=fe),qt(ce,fe)<0&&(ke=[ce,fe],fe=ke[0],ce=ke[1]),typeof ae=="string"&&(ae=ie.splitLines(ae)),_u(ie,{from:fe,to:ce,text:ae,origin:me})}function Pu(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],Ze=!0;if(ke.ranges){ke.copied||(ke=ie[me]=ke.deepCopy(),ke.copied=!0);for(var Qe=0;Qe<ke.ranges.length;Qe++)Pu(ke.ranges[Qe].anchor,ae,fe,ce),Pu(ke.ranges[Qe].head,ae,fe,ce);continue}for(var Ue=0;Ue<ke.changes.length;++Ue){var vt=ke.changes[Ue];if(fe<vt.from.line)vt.from=cn(vt.from.line+ce,vt.from.ch),vt.to=cn(vt.to.line+ce,vt.to.ch);else if(ae<=vt.to.line){Ze=!1;break}}Ze||(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 Zh(ie,ae,fe,ce){var me=ae,ke=ae;return typeof ae=="number"?ke=Kn(ie,Mi(ie,ae)):me=it(ae),me==null?null:(ce(ke,me)&&ie.cm&&Ci(ie.cm,me,fe),ke)}function Hd(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}Hd.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,Io(me),Vr(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 bs(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}bs.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),Ze=ce.height;if(ce.removeInner(ie,ke),this.height-=Ze-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 Hd))){var Qe=[];this.collapse(Qe),this.children=[new Hd(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 Ze=me.lines.length%25+25,Qe=Ze;Qe<me.lines.length;){var Ue=new Hd(me.lines.slice(Qe,Qe+=25));me.height-=Ue.height,this.children.splice(++ce,0,Ue),Ue.parent=this}me.lines=me.lines.slice(0,Ze),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 bs(ae);if(ie.parent){ie.size-=fe.size,ie.height-=fe.height;var me=gn(ie.parent.children,ie);ie.parent.children.splice(me+1,0,fe)}else{var ce=new bs(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 Ze=Math.min(ae,ke-ie);if(me.iterN(ie,Ze,fe))return!0;if((ae-=Ze)==0)break;ie=0}else ie-=ke}}};var Vu=function(ie,ae,fe){if(fe)for(var ce in fe)fe.hasOwnProperty(ce)&&(this[ce]=fe[ce]);this.doc=ie,this.node=ae};Vu.prototype.clear=function(){var ie=this.doc.cm,ae=this.line.widgets,fe=this.line,ce=it(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=ls(this);hi(fe,Math.max(0,fe.height-ke)),ie&&(xo(ie,function(){Kg(ie,fe,-ke),Ci(ie,ce,"widget")}),Vr(ie,"lineWidgetCleared",ie,this,ce))}},Vu.prototype.changed=function(){var ie=this,ae=this.height,fe=this.doc.cm,ce=this.line;this.height=null;var me=ls(this)-ae;me&&(bn(this.doc,ce)||hi(ce,ce.height+me),fe&&xo(fe,function(){fe.curOp.forceUpdate=!0,Kg(fe,ce,me),Vr(fe,"lineWidgetChanged",fe,ie,it(ce))}))},Kt(Vu);function Kg(ie,ae,fe){rr(ae)<(ie.curOp&&ie.curOp.scrollTop||ie.doc.scrollTop)&&mu(ie,fe)}function yf(ie,ae,fe,ce){var me=new Vu(ie,fe,ce),ke=ie.cm;return ke&&me.noHScroll&&(ke.display.alignWidgets=!0),Zh(ie,ae,"widget",function(Ze){var Qe=Ze.widgets||(Ze.widgets=[]);if(me.insertAt==null?Qe.push(me):Qe.splice(Math.min(Qe.length-1,Math.max(0,me.insertAt)),0,me),me.line=Ze,ke&&!bn(ie,Ze)){var Ue=rr(Ze)<ie.scrollTop;hi(Ze,Ze.height+ls(me)),Ue&&mu(ke,me.height),ke.curOp.forceUpdate=!0}return!0}),ke&&Vr(ke,"lineWidgetAdded",ke,me,typeof ae=="number"?ae:it(ae)),me}var Fc=0,Zt=function(ie,ae){this.lines=[],this.type=ae,this.doc=ie,this.id=++Fc};Zt.prototype.clear=function(){if(!this.explicitlyCleared){var ie=this.doc.cm,ae=ie&&!ie.curOp;if(ae&&Jn(ie),Sn(this,"clear")){var fe=this.find();fe&&Vr(this,"clear",fe.from,fe.to)}for(var ce=null,me=null,ke=0;ke<this.lines.length;++ke){var Ze=this.lines[ke],Qe=Or(Ze.markedSpans,this);ie&&!this.collapsed?Ci(ie,it(Ze),"text"):ie&&(Qe.to!=null&&(me=it(Ze)),Qe.from!=null&&(ce=it(Ze))),Ze.markedSpans=hr(Ze.markedSpans,Qe),Qe.from==null&&this.collapsed&&!bn(this.doc,Ze)&&ie&&hi(Ze,$i(ie.display))}if(ie&&this.collapsed&&!ie.options.lineWrapping)for(var Ue=0;Ue<this.lines.length;++Ue){var vt=Ei(this.lines[Ue]),un=Po(vt);un>ie.display.maxLineLength&&(ie.display.maxLine=vt,ie.display.maxLineLength=un,ie.display.maxLineChanged=!0)}ce!=null&&ie&&this.collapsed&&_i(ie,ce,me+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,ie&&Ec(ie.doc)),ie&&Vr(ie,"markerCleared",ie,this,ce,me),ae&&Xr(ie),this.parent&&this.parent.clear()}},Zt.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],Ze=Or(ke.markedSpans,this);if(Ze.from!=null&&(fe=cn(ae?ke:it(ke),Ze.from),ie==-1))return fe;if(Ze.to!=null&&(ce=cn(ae?ke:it(ke),Ze.to),ie==1))return ce}return fe&&{from:fe,to:ce}},Zt.prototype.changed=function(){var ie=this,ae=this.find(-1,!0),fe=this,ce=this.doc.cm;!ae||!ce||xo(ce,function(){var me=ae.line,ke=it(ae.line),Ze=ea(ce,ke);if(Ze&&(sa(Ze),ce.curOp.selectionChanged=ce.curOp.forceUpdate=!0),ce.curOp.updateMaxLine=!0,!bn(fe.doc,me)&&fe.height!=null){var Qe=fe.height;fe.height=null;var Ue=ls(fe)-Qe;Ue&&hi(me,me.height+Ue)}Vr(ce,"markerChanged",ce,ie)})},Zt.prototype.attachLine=function(ie){if(!this.lines.length&&this.doc.cm){var ae=this.doc.cm.curOp;(!ae.maybeHiddenMarkers||gn(ae.maybeHiddenMarkers,this)==-1)&&(ae.maybeUnhiddenMarkers||(ae.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(ie)},Zt.prototype.detachLine=function(ie){if(this.lines.splice(gn(this.lines,ie),1),!this.lines.length&&this.doc.cm){var ae=this.doc.cm.curOp;(ae.maybeHiddenMarkers||(ae.maybeHiddenMarkers=[])).push(this)}},Kt(Zt);function md(ie,ae,fe,ce,me){if(ce&&ce.shared)return Ug(ie,ae,fe,ce,me);if(ie.cm&&!ie.cm.curOp)return Va(ie.cm,md)(ie,ae,fe,ce,me);var ke=new Zt(ie,me),Ze=qt(ae,fe);if(ce&&Ot(ce,ke,!1),Ze>0||Ze==0&&ke.clearWhenEmpty!==!1)return ke;if(ke.replacedWith&&(ke.collapsed=!0,ke.widgetNode=ut("span",[ke.replacedWith],"CodeMirror-widget"),ce.handleMouseEvents||ke.widgetNode.setAttribute("cm-ignore-events","true"),ce.insertLeft&&(ke.widgetNode.insertLeft=!0)),ke.collapsed){if(Si(ie,ae.line,ae,fe,ke)||ae.line!=fe.line&&Si(ie,fe.line,ae,fe,ke))throw new Error("Inserting collapsed marker partially overlapping an existing one");Zn()}ke.addToHistory&&dd(ie,{from:ae,to:fe,origin:"markText"},ie.sel,NaN);var Qe=ae.line,Ue=ie.cm,vt;if(ie.iter(Qe,fe.line+1,function(bt){Ue&&ke.collapsed&&!Ue.options.lineWrapping&&Ei(bt)==Ue.display.maxLine&&(vt=!0),ke.collapsed&&Qe!=ae.line&&hi(bt,0),la(bt,new wr(ke,Qe==ae.line?ae.ch:null,Qe==fe.line?fe.ch:null)),++Qe}),ke.collapsed&&ie.iter(ae.line,fe.line+1,function(bt){bn(ie,bt)&&hi(bt,0)}),ke.clearOnEnter&&Mn(ke,"beforeCursorEnter",function(){return ke.clear()}),ke.readOnly&&(qo(),(ie.history.done.length||ie.history.undone.length)&&ie.clearHistory()),ke.collapsed&&(ke.id=++Fc,ke.atomic=!0),Ue){if(vt&&(Ue.curOp.updateMaxLine=!0),ke.collapsed)_i(Ue,ae.line,fe.line+1);else if(ke.className||ke.startStyle||ke.endStyle||ke.css||ke.attributes||ke.title)for(var un=ae.line;un<=fe.line;un++)Ci(Ue,un,"text");ke.atomic&&Ec(Ue.doc),Vr(Ue,"markerAdded",Ue,ke)}return ke}var Ku=function(ie,ae){this.markers=ie,this.primary=ae;for(var fe=0;fe<ie.length;++fe)ie[fe].parent=this};Ku.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var ie=0;ie<this.markers.length;++ie)this.markers[ie].clear();Vr(this,"clear")}},Ku.prototype.find=function(ie,ae){return this.primary.find(ie,ae)},Kt(Ku);function Ug(ie,ae,fe,ce,me){ce=Ot(ce),ce.shared=!1;var ke=[md(ie,ae,fe,ce,me)],Ze=ke[0],Qe=ce.widgetNode;return Du(ie,function(Ue){Qe&&(ce.widgetNode=Qe.cloneNode(!0)),ke.push(md(Ue,Ri(Ue,ae),Ri(Ue,fe),ce,me));for(var vt=0;vt<Ue.linked.length;++vt)if(Ue.linked[vt].isParent)return;Ze=lt(ke)}),new Ku(ke,Ze)}function Jf(ie){return ie.findMarks(cn(ie.first,0),ie.clipPos(cn(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),Ze=ie.clipPos(me.to);if(qt(ke,Ze)){var Qe=md(ie,ke,Ze,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];Du(me.primary.doc,function(Ue){return ke.push(Ue)});for(var Ze=0;Ze<me.markers.length;Ze++){var Qe=me.markers[Ze];gn(ke,Qe.doc)==-1&&(Qe.parent=null,me.markers.splice(Ze--,1))}},fe=0;fe<ie.length;fe++)ae(fe)}var Om=0,Ks=function(ie,ae,fe,ce,me){if(!(this instanceof Ks))return new Ks(ie,ae,fe,ce,me);fe==null&&(fe=0),bs.call(this,[new Hd([new No("",null)])]),this.first=fe,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=fe;var ke=cn(fe,0);this.sel=Fh(ke),this.history=new jd(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)),wc(this,{from:ke,to:ke,text:ie}),hl(this,Fh(ke),Ht)};Ks.prototype=Me(bs.prototype,{constructor:Ks,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=_t(this,this.first,this.first+this.size);return ie===!1?ae:ae.join(ie||this.lineSeparator())},setValue:Cs(function(ie){var ae=cn(this.first,0),fe=this.first+this.size-1;_u(this,{from:ae,to:cn(fe,Kn(this,fe).text.length),text:this.splitLines(ie),origin:"setValue",full:!0},!0),this.cm&&ru(this.cm,0,0),hl(this,Fh(ae),Ht)}),replaceRange:function(ie,ae,fe,ce){ae=Ri(this,ae),fe=fe?Ri(this,fe):ae,Wu(this,ie,ae,fe,ce)},getRange:function(ie,ae,fe){var ce=It(this,Ri(this,ie),Ri(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(Dn(this,ie))return Kn(this,ie)},getLineNumber:function(ie){return it(ie)},getLineHandleVisualStart:function(ie){return typeof ie=="number"&&(ie=Kn(this,ie)),Ei(ie)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(ie){return Ri(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:Cs(function(ie,ae,fe){Tu(this,Ri(this,typeof ie=="number"?cn(ie,ae||0):ie),null,fe)}),setSelection:Cs(function(ie,ae,fe){Tu(this,Ri(this,ie),Ri(this,ae||ie),fe)}),extendSelection:Cs(function(ie,ae,fe){ff(this,Ri(this,ie),ae&&Ri(this,ae),fe)}),extendSelections:Cs(function(ie,ae){Wg(this,Er(this,ie),ae)}),extendSelectionsBy:Cs(function(ie,ae){var fe=An(this.sel.ranges,ie);Wg(this,Er(this,fe),ae)}),setSelections:Cs(function(ie,ae,fe){if(ie.length){for(var ce=[],me=0;me<ie.length;me++)ce[me]=new ss(Ri(this,ie[me].anchor),Ri(this,ie[me].head));ae==null&&(ae=Math.min(ie.length-1,this.sel.primIndex)),hl(this,xu(this.cm,ce,ae),fe)}}),addSelection:Cs(function(ie,ae,fe){var ce=this.sel.ranges.slice(0);ce.push(new ss(Ri(this,ie),Ri(this,ae||ie))),hl(this,xu(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=It(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=It(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:Cs(function(ie,ae,fe){for(var ce=[],me=this.sel,ke=0;ke<me.ranges.length;ke++){var Ze=me.ranges[ke];ce[ke]={from:Ze.from(),to:Ze.to(),text:this.splitLines(ie[ke]),origin:fe}}for(var Qe=ae&&ae!="end"&&Sc(this,ce,ae),Ue=ce.length-1;Ue>=0;Ue--)_u(this,ce[Ue]);Qe?pf(this,Qe):this.cm&&Ll(this.cm)}),undo:Cs(function(){bc(this,"undo")}),redo:Cs(function(){bc(this,"redo")}),undoSelection:Cs(function(){bc(this,"undo",!0)}),redoSelection:Cs(function(){bc(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 jd(this.history.maxGeneration),Du(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:ah(this.history.done),undone:ah(this.history.undone)}},setHistory:function(ie){var ae=this.history=new jd(this.history.maxGeneration);ae.done=ah(ie.done.slice(0),null,!0),ae.undone=ah(ie.undone.slice(0),null,!0)},setGutterMarker:Cs(function(ie,ae,fe){return Zh(this,ie,"gutter",function(ce){var me=ce.gutterMarkers||(ce.gutterMarkers={});return me[ae]=fe,!fe&&Ae(me)&&(ce.gutterMarkers=null),!0})}),clearGutter:Cs(function(ie){var ae=this;this.iter(function(fe){fe.gutterMarkers&&fe.gutterMarkers[ie]&&Zh(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(!Dn(this,ie)||(ae=ie,ie=Kn(this,ie),!ie))return null}else if(ae=it(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:Cs(function(ie,ae,fe){return Zh(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(Ie(fe).test(ce[me]))return!1;ce[me]+=" "+fe}return!0})}),removeLineClass:Cs(function(ie,ae,fe){return Zh(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 Ze=ke.match(Ie(fe));if(!Ze)return!1;var Qe=Ze.index+Ze[0].length;ce[me]=ke.slice(0,Ze.index)+(!Ze.index||Qe==ke.length?"":" ")+ke.slice(Qe)||null}else return!1;return!0})}),addLineWidget:Cs(function(ie,ae,fe){return yf(this,ie,ae,fe)}),removeLineWidget:function(ie){ie.clear()},markText:function(ie,ae,fe){return md(this,Ri(this,ie),Ri(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=Ri(this,ie),md(this,ie,ie,fe,"bookmark")},findMarksAt:function(ie){ie=Ri(this,ie);var ae=[],fe=Kn(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=Ri(this,ie),ae=Ri(this,ae);var ce=[],me=ie.line;return this.iter(ie.line,ae.line+1,function(ke){var Ze=ke.markedSpans;if(Ze)for(var Qe=0;Qe<Ze.length;Qe++){var Ue=Ze[Qe];!(Ue.to!=null&&me==ie.line&&ie.ch>=Ue.to||Ue.from==null&&me!=ie.line||Ue.from!=null&&me==ae.line&&Ue.from>=ae.ch)&&(!fe||fe(Ue.marker))&&ce.push(Ue.marker.parent||Ue.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}),Ri(this,cn(fe,ae))},indexFromPos:function(ie){ie=Ri(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 Ks(_t(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 Ks(_t(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 Ua&&(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];Du(ie,function(me){return ce.push(me.id)},!0),ie.history=new jd(null),ie.history.done=ah(this.history.done,ce),ie.history.undone=ah(this.history.undone,ce)}},iterLinkedDocs:function(ie){Du(this,ie)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(ie){return this.lineSep?ie.split(this.lineSep):xr(ie)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:Cs(function(ie){ie!="rtl"&&(ie="ltr"),ie!=this.direction&&(this.direction=ie,this.iter(function(ae){return ae.order=null}),this.cm&&Hg(this.cm))})}),Ks.prototype.eachLine=Ks.prototype.iter;var Lc=0;function Bc(ie){var ae=this;if(Jg(ae),!(hn(ae,ie)||Yt(ae.display,ie))){gi(ie),mt&&(Lc=+new Date);var fe=cr(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),Ze=0,Qe=function(){++Ze==me&&Va(ae,function(){fe=Ri(ae.doc,fe);var Bn={from:fe,to:fe,text:ae.doc.splitLines(ke.filter(function(Ji){return Ji!=null}).join(ae.doc.lineSeparator())),origin:"paste"};_u(ae.doc,Bn),pf(ae.doc,Fh(Ri(ae.doc,fe),Ri(ae.doc,jh(Bn))))})()},Ue=function(Bn,Ji){if(ae.options.allowDropFileTypes&&gn(ae.options.allowDropFileTypes,Bn.type)==-1){Qe();return}var or=new FileReader;or.onerror=function(){return Qe()},or.onload=function(){var Br=or.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Br)){Qe();return}ke[Ji]=Br,Qe()},or.readAsText(Bn)},vt=0;vt<ce.length;vt++)Ue(ce[vt],vt);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 un=ie.dataTransfer.getData("Text");if(un){var bt;if(ae.state.draggingText&&!ae.state.draggingText.copy&&(bt=ae.listSelections()),fd(ae.doc,Fh(fe,fe)),bt)for(var Gn=0;Gn<bt.length;++Gn)Wu(ae.doc,"",bt[Gn].anchor,bt[Gn].head,"drag");ae.replaceSelection(un,"around","paste"),ae.display.input.focus()}}catch(Bn){}}}}function Yg(ie,ae){if(mt&&(!ie.state.draggingText||+new Date-Lc<100)){Ii(ae);return}if(!(hn(ie,ae)||Yt(ie.display,ae))&&(ae.dataTransfer.setData("Text",ie.getSelection()),ae.dataTransfer.effectAllowed="copyMove",ae.dataTransfer.setDragImage&&!Rt)){var fe=Ye("img",null,null,"position: fixed; left: 0; top: 0;");fe.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Ge&&(fe.width=fe.height=1,ie.display.wrapper.appendChild(fe),fe._top=fe.offsetTop),ae.dataTransfer.setDragImage(fe,0,0),Ge&&fe.parentNode.removeChild(fe)}}function Xg(ie,ae){var fe=cr(ie,ae);if(fe){var ce=document.createDocumentFragment();sr(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)),et(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 lu(){Sf||(Wd(),Sf=!0)}function Wd(){var ie;Mn(window,"resize",function(){ie==null&&(ie=setTimeout(function(){ie=null,xf($f)},100))}),Mn(window,"blur",function(){return xf(As)})}function $f(ie){var ae=ie.display;ae.cachedCharWidth=ae.cachedTextHeight=ae.cachedPaddingH=null,ae.scrollbarsClipped=!1,ie.setSize()}for(var sh={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"},Mc=0;Mc<10;Mc++)sh[Mc+48]=sh[Mc+96]=String(Mc);for(var wf=65;wf<=90;wf++)sh[wf]=String.fromCharCode(wf);for(var kc=1;kc<=12;kc++)sh[kc+111]=sh[kc+63235]="F"+kc;var Ql={};Ql.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"},Ql.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"},Ql.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"},Ql.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"]},Ql.default=de?Ql.macDefault:Ql.pcDefault;function Vd(ie){var ae=ie.split(/-(?!$)/);ie=ae[ae.length-1];for(var fe,ce,me,ke,Ze=0;Ze<ae.length-1;Ze++){var Qe=ae[Ze];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=An(fe.split(" "),Vd),ke=0;ke<me.length;ke++){var Ze=void 0,Qe=void 0;ke==me.length-1?(Qe=me.join(" "),Ze=ce):(Qe=me.slice(0,ke+1).join(" "),Ze="...");var Ue=ae[Qe];if(!Ue)ae[Qe]=Ze;else if(Ue!=Ze)throw new Error("Inconsistent bindings for "+Qe)}delete ie[fe]}for(var vt in ae)ie[vt]=ae[vt];return ie}function uu(ie,ae,fe,ce){ae=vd(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 uu(ie,ae.fallthrough,fe,ce);for(var ke=0;ke<ae.fallthrough.length;ke++){var Ze=uu(ie,ae.fallthrough[ke],fe,ce);if(Ze)return Ze}}}function Lh(ie){var ae=typeof ie=="string"?ie:sh[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(Ge&&ie.keyCode==34&&ie.char)return!1;var fe=sh[ie.keyCode];return fe==null||ie.altGraphKey?!1:(ie.keyCode==3&&ie.code&&(fe=ie.code),Pf(fe,ie,ae))}function vd(ie){return typeof ie=="string"?Ql[ie]:ie}function zl(ie,ae){for(var fe=ie.doc.sel.ranges,ce=[],me=0;me<fe.length;me++){for(var ke=ae(fe[me]);ce.length&&qt(ke.from,lt(ce).to)<=0;){var Ze=ce.pop();if(qt(Ze.from,ke.from)<0){ke.from=Ze.from;break}}ce.push(ke)}xo(ie,function(){for(var Qe=ce.length-1;Qe>=0;Qe--)Wu(ie.doc,"",ce[Qe].from,ce[Qe].to,"+delete");Ll(ie)})}function tg(ie,ae,fe){var ce=fn(ie.text,ae+fe,fe);return ce<0||ce>ie.text.length?null:ce}function Zs(ie,ae,fe){var ce=tg(ie,ae.ch,fe);return ce==null?null:new cn(ae.line,ce,fe<0?"after":"before")}function lh(ie,ae,fe,ce,me){if(ie){ae.doc.direction=="rtl"&&(me=-me);var ke=jn(fe,ae.doc.direction);if(ke){var Ze=me<0?lt(ke):ke[0],Qe=me<0==(Ze.level==1),Ue=Qe?"after":"before",vt;if(Ze.level>0||ae.doc.direction=="rtl"){var un=_o(ae,fe);vt=me<0?fe.text.length-1:0;var bt=Pa(ae,un,vt).top;vt=vn(function(Gn){return Pa(ae,un,Gn).top==bt},me<0==(Ze.level==1)?Ze.from:Ze.to-1,vt),Ue=="before"&&(vt=tg(fe,vt,1))}else vt=me<0?Ze.to:Ze.from;return new cn(ce,vt,Ue)}}return new cn(ce,me<0?fe.text.length:0,me<0?"before":"after")}function Ef(ie,ae,fe,ce){var me=jn(ae,ie.doc.direction);if(!me)return Zs(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=jt(me,fe.ch,fe.sticky),Ze=me[ke];if(ie.doc.direction=="ltr"&&Ze.level%2==0&&(ce>0?Ze.to>fe.ch:Ze.from<fe.ch))return Zs(ae,fe,ce);var Qe=function(Jr,Ao){return tg(ae,Jr instanceof cn?Jr.ch:Jr,Ao)},Ue,vt=function(Jr){return ie.options.lineWrapping?(Ue=Ue||_o(ie,ae),ln(ie,ae,Ue,Jr)):{begin:0,end:ae.text.length}},un=vt(fe.sticky=="before"?Qe(fe,-1):fe.ch);if(ie.doc.direction=="rtl"||Ze.level==1){var bt=Ze.level==1==ce<0,Gn=Qe(fe,bt?1:-1);if(Gn!=null&&(bt?Gn<=Ze.to&&Gn<=un.end:Gn>=Ze.from&&Gn>=un.begin)){var Bn=bt?"before":"after";return new cn(fe.line,Gn,Bn)}}var Ji=function(Jr,Ao,ho){for(var jo=function(xs,rl){return rl?new cn(fe.line,Qe(xs,1),"before"):new cn(fe.line,xs,"after")};Jr>=0&&Jr<me.length;Jr+=Ao){var ma=me[Jr],co=Ao>0==(ma.level!=1),_a=co?ho.begin:Qe(ho.end,-1);if(ma.from<=_a&&_a<ma.to||(_a=co?ma.from:Qe(ma.to,-1),ho.begin<=_a&&_a<ho.end))return jo(_a,co)}},or=Ji(ke+ce,ce,un);if(or)return or;var Br=ce>0?un.end:Qe(un.begin,-1);return Br!=null&&!(ce>0&&Br==ae.text.length)&&(or=Ji(ce>0?0:me.length-1,ce,vt(Br)),or)?or:null}var Gh={selectAll:zs,singleSelection:function(ie){return ie.setSelection(ie.getCursor("anchor"),ie.getCursor("head"),Ht)},killLine:function(ie){return zl(ie,function(ae){if(ae.empty()){var fe=Kn(ie.doc,ae.head.line).text.length;return ae.head.ch==fe&&ae.head.line<ie.lastLine()?{from:ae.head,to:cn(ae.head.line+1,0)}:{from:ae.head,to:cn(ae.head.line,fe)}}else return{from:ae.from(),to:ae.to()}})},deleteLine:function(ie){return zl(ie,function(ae){return{from:cn(ae.from().line,0),to:Ri(ie.doc,cn(ae.to().line+1,0))}})},delLineLeft:function(ie){return zl(ie,function(ae){return{from:cn(ae.from().line,0),to:ae.from()}})},delWrappedLineLeft:function(ie){return zl(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 zl(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(cn(ie.firstLine(),0))},goDocEnd:function(ie){return ie.extendSelection(cn(ie.lastLine()))},goLineStart:function(ie){return ie.extendSelectionsBy(function(ae){return Kd(ie,ae.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(ie){return ie.extendSelectionsBy(function(ae){return Ac(ie,ae.head)},{origin:"+move",bias:1})},goLineEnd:function(ie){return ie.extendSelectionsBy(function(ae){return Ud(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")},Cn)},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")},Cn)},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/)?Ac(ie,ae.head):ce},Cn)},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(),Ze=ct(ie.getLine(ke.line),ke.ch,ce);ae.push(Hn(ce-Ze%ce))}ie.replaceSelections(ae)},defaultTab:function(ie){ie.somethingSelected()?ie.indentSelection("add"):ie.execCommand("insertTab")},transposeChars:function(ie){return xo(ie,function(){for(var ae=ie.listSelections(),fe=[],ce=0;ce<ae.length;ce++)if(ae[ce].empty()){var me=ae[ce].head,ke=Kn(ie.doc,me.line).text;if(ke){if(me.ch==ke.length&&(me=new cn(me.line,me.ch-1)),me.ch>0)me=new cn(me.line,me.ch+1),ie.replaceRange(ke.charAt(me.ch-1)+ke.charAt(me.ch-2),cn(me.line,me.ch-2),me,"+transpose");else if(me.line>ie.doc.first){var Ze=Kn(ie.doc,me.line-1).text;Ze&&(me=new cn(me.line,1),ie.replaceRange(ke.charAt(0)+ie.doc.lineSeparator()+Ze.charAt(Ze.length-1),cn(me.line-1,Ze.length-1),me,"+transpose"))}}fe.push(new ss(me,me))}ie.setSelections(fe)})},newlineAndIndent:function(ie){return xo(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);Ll(ie)})},openLine:function(ie){return ie.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(ie){return ie.toggleOverwrite()}};function Kd(ie,ae){var fe=Kn(ie.doc,ae),ce=Ei(fe);return ce!=fe&&(ae=it(ce)),lh(!0,ie,ce,ae,1)}function Ud(ie,ae){var fe=Kn(ie.doc,ae),ce=bi(fe);return ce!=fe&&(ae=it(ce)),lh(!0,ie,fe,ae,-1)}function Ac(ie,ae){var fe=Kd(ie,ae.line),ce=Kn(ie.doc,fe.line),me=jn(ce,ie.doc.direction);if(!me||me[0].level==0){var ke=Math.max(fe.ch,ce.text.search(/\S/)),Ze=ae.line==fe.line&&ae.ch<=ke&&ae.ch;return cn(fe.line,Ze?0:ke,fe.sticky)}return fe}function Yd(ie,ae,fe){if(typeof ae=="string"&&(ae=Gh[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)!=zn}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=uu(ae,ie.state.keyMaps[ce],fe,ie);if(me)return me}return ie.options.extraKeys&&uu(ae,ie.options.extraKeys,fe,ie)||uu(ae,ie.options.keyMap,fe,ie)}var uh=new nt;function yd(ie,ae,fe,ce){var me=ie.state.keySeq;if(me){if(Lh(ae))return"handled";if(/\'$/.test(ae)?ie.state.keySeq=null:uh.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"&&Vr(ie,"keyHandled",ie,ae,fe),(me=="handled"||me=="multi")&&(gi(fe),ta(ie)),!!me}function bf(ie,ae){var fe=eg(ae,!0);return fe?ae.shiftKey&&!ie.state.keySeq?yd(ie,"Shift-"+fe,ae,function(ce){return Yd(ie,ce,!0)})||yd(ie,fe,ae,function(ce){if(typeof ce=="string"?/^go[A-Z]/.test(ce):ce.motion)return Yd(ie,ce)}):yd(ie,fe,ae,function(ce){return Yd(ie,ce)}):!1}function Ff(ie,ae,fe){return yd(ie,"'"+fe+"'",ae,function(ce){return Yd(ie,ce,!0)})}var Hh=null;function ig(ie){var ae=this;if(!(ie.target&&ie.target!=ae.display.input.getField())&&(ae.curOp.focus=St(),!hn(ae,ie))){mt&&Oe<11&&ie.keyCode==27&&(ie.returnValue=!1);var fe=ie.keyCode;ae.display.shift=fe==16||ie.shiftKey;var ce=bf(ae,ie);Ge&&(Hh=ce?fe:null,!ce&&fe==88&&!_n&&(de?ie.metaKey:ie.ctrlKey)&&ae.replaceSelection("",null,"cut")),ue&&!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;Lt(ae,"CodeMirror-crosshair");function fe(ce){(ce.keyCode==18||!ce.altKey)&&(Re(ae,"CodeMirror-crosshair"),nn(document,"keyup",fe),nn(document,"mouseover",fe))}Mn(document,"keyup",fe),Mn(document,"mouseover",fe)}function og(ie){ie.keyCode==16&&(this.doc.sel.shift=!1),hn(this,ie)}function Uu(ie){var ae=this;if(!(ie.target&&ie.target!=ae.display.input.getField())&&!(Yt(ae.display,ie)||hn(ae,ie)||ie.ctrlKey&&!ie.altKey||de&&ie.metaKey)){var fe=ie.keyCode,ce=ie.charCode;if(Ge&&fe==Hh){Hh=null,gi(ie);return}if(!(Ge&&(!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&&qt(ae,this.pos)==0&&fe==this.button};var Xd,xd;function lg(ie,ae){var fe=+new Date;return xd&&xd.compare(fe,ie,ae)?(Xd=xd=null,"triple"):Xd&&Xd.compare(fe,ie,ae)?(xd=new sg(fe,ie,ae),Xd=null,"double"):(Xd=new sg(fe,ie,ae),xd=null,"single")}function Yu(ie){var ae=this,fe=ae.display;if(!(hn(ae,ie)||fe.activeTouch&&fe.input.supportsTouch())){if(fe.input.ensurePolled(),fe.shift=ie.shiftKey,Yt(fe,ie)){at||(fe.scroller.draggable=!1,setTimeout(function(){return fe.scroller.draggable=!0},100));return}if(!Lf(ae,ie)){var ce=cr(ae,ie),me=$n(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):Fr(ie)==fe.scroller&&gi(ie):me==2?(ce&&ff(ae.doc,ce),setTimeout(function(){return fe.input.focus()},20)):me==3&&(be?ae.display.input.onContextMenu(ie):ro(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,yd(ie,Pf(ke,me),me,function(Ze){if(typeof Ze=="string"&&(Ze=Gh[Ze]),!Ze)return!1;var Qe=!1;try{ie.isReadOnly()&&(ie.state.suppressEdits=!0),Qe=Ze(ie,fe)!=zn}finally{ie.state.suppressEdits=!1}return Qe})}function Sd(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){mt?setTimeout(Pn(Sa,ie),0):ie.curOp.focus=St();var me=Sd(ie,fe,ce),ke=ie.doc.sel,Ze;ie.options.dragDrop&&In&&!ie.isReadOnly()&&fe=="single"&&(Ze=ke.contains(ae))>-1&&(qt((Ze=ke.ranges[Ze]).from(),ae)<0||ae.xRel>0)&&(qt(Ze.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,Ze=Va(ie,function(vt){at&&(me.scroller.draggable=!1),ie.state.draggingText=!1,nn(me.wrapper.ownerDocument,"mouseup",Ze),nn(me.wrapper.ownerDocument,"mousemove",Qe),nn(me.scroller,"dragstart",Ue),nn(me.scroller,"drop",Ze),ke||(gi(vt),ce.addNew||ff(ie.doc,fe,null,null,ce.extend),at&&!Rt||mt&&Oe==9?setTimeout(function(){me.wrapper.ownerDocument.body.focus({preventScroll:!0}),me.input.focus()},20):me.input.focus())}),Qe=function(vt){ke=ke||Math.abs(ae.clientX-vt.clientX)+Math.abs(ae.clientY-vt.clientY)>=10},Ue=function(){return ke=!0};at&&(me.scroller.draggable=!0),ie.state.draggingText=Ze,Ze.copy=!ce.moveOnDrag,me.scroller.dragDrop&&me.scroller.dragDrop(),Mn(me.wrapper.ownerDocument,"mouseup",Ze),Mn(me.wrapper.ownerDocument,"mousemove",Qe),Mn(me.scroller,"dragstart",Ue),Mn(me.scroller,"drop",Ze),ro(ie),setTimeout(function(){return me.input.focus()},20)}function cg(ie,ae,fe){if(fe=="char")return new ss(ae,ae);if(fe=="word")return ie.findWordAt(ae);if(fe=="line")return new ss(cn(ae.line,0),Ri(ie.doc,cn(ae.line+1,0)));var ce=fe(ie,ae);return new ss(ce.from,ce.to)}function Zp(ie,ae,fe,ce){var me=ie.display,ke=ie.doc;gi(ae);var Ze,Qe,Ue=ke.sel,vt=Ue.ranges;if(ce.addNew&&!ce.extend?(Qe=ke.sel.contains(fe),Qe>-1?Ze=vt[Qe]:Ze=new ss(fe,fe)):(Ze=ke.sel.primary(),Qe=ke.sel.primIndex),ce.unit=="rectangle")ce.addNew||(Ze=new ss(fe,fe)),fe=cr(ie,ae,!0,!0),Qe=-1;else{var un=cg(ie,fe,ce.unit);ce.extend?Ze=cf(Ze,un.anchor,un.head,ce.extend):Ze=un}ce.addNew?Qe==-1?(Qe=vt.length,hl(ke,xu(ie,vt.concat([Ze]),Qe),{scroll:!1,origin:"*mouse"})):vt.length>1&&vt[Qe].empty()&&ce.unit=="char"&&!ce.extend?(hl(ke,xu(ie,vt.slice(0,Qe).concat(vt.slice(Qe+1)),0),{scroll:!1,origin:"*mouse"}),Ue=ke.sel):wu(ke,Qe,Ze,Fn):(Qe=0,hl(ke,new su([Ze],0),Fn),Ue=ke.sel);var bt=fe;function Gn(ho){if(qt(bt,ho)!=0)if(bt=ho,ce.unit=="rectangle"){for(var jo=[],ma=ie.options.tabSize,co=ct(Kn(ke,fe.line).text,fe.ch,ma),_a=ct(Kn(ke,ho.line).text,ho.ch,ma),xs=Math.min(co,_a),rl=Math.max(co,_a),Fs=Math.min(fe.line,ho.line),Zl=Math.min(ie.lastLine(),Math.max(fe.line,ho.line));Fs<=Zl;Fs++){var yl=Kn(ke,Fs).text,Qs=ii(yl,xs,ma);xs==rl?jo.push(new ss(cn(Fs,Qs),cn(Fs,Qs))):yl.length>Qs&&jo.push(new ss(cn(Fs,Qs),cn(Fs,ii(yl,rl,ma))))}jo.length||jo.push(new ss(fe,fe)),hl(ke,xu(ie,Ue.ranges.slice(0,Qe).concat(jo),Qe),{origin:"*mouse",scroll:!1}),ie.scrollIntoView(ho)}else{var Gl=Ze,dl=cg(ie,ho,ce.unit),$s=Gl.anchor,Ya;qt(dl.anchor,$s)>0?(Ya=dl.head,$s=Hi(Gl.from(),dl.anchor)):(Ya=dl.anchor,$s=ur(Gl.to(),dl.head));var Ls=Ue.ranges.slice(0);Ls[Qe]=Qg(ie,new ss(Ri(ke,$s),Ya)),hl(ke,xu(ie,Ls,Qe),Fn)}}var Bn=me.wrapper.getBoundingClientRect(),Ji=0;function or(ho){var jo=++Ji,ma=cr(ie,ho,!0,ce.unit=="rectangle");if(ma)if(qt(ma,bt)!=0){ie.curOp.focus=St(),Gn(ma);var co=Eo(me,ke);(ma.line>=co.to||ma.line<co.from)&&setTimeout(Va(ie,function(){Ji==jo&&or(ho)}),150)}else{var _a=ho.clientY<Bn.top?-20:ho.clientY>Bn.bottom?20:0;_a&&setTimeout(Va(ie,function(){Ji==jo&&(me.scroller.scrollTop+=_a,or(ho))}),50)}}function Br(ho){ie.state.selectingText=!1,Ji=1/0,ho&&(gi(ho),me.input.focus()),nn(me.wrapper.ownerDocument,"mousemove",Jr),nn(me.wrapper.ownerDocument,"mouseup",Ao),ke.history.lastSelOrigin=null}var Jr=Va(ie,function(ho){ho.buttons===0||!$n(ho)?Br(ho):or(ho)}),Ao=Va(ie,Br);ie.state.selectingText=Ao,Mn(me.wrapper.ownerDocument,"mousemove",Jr),Mn(me.wrapper.ownerDocument,"mouseup",Ao)}function Qg(ie,ae){var fe=ae.anchor,ce=ae.head,me=Kn(ie.doc,fe.line);if(qt(fe,ce)==0&&fe.sticky==ce.sticky)return ae;var ke=jn(me);if(!ke)return ae;var Ze=jt(ke,fe.ch,fe.sticky),Qe=ke[Ze];if(Qe.from!=fe.ch&&Qe.to!=fe.ch)return ae;var Ue=Ze+(Qe.from==fe.ch==(Qe.level!=1)?0:1);if(Ue==0||Ue==ke.length)return ae;var vt;if(ce.line!=fe.line)vt=(ce.line-fe.line)*(ie.doc.direction=="ltr"?1:-1)>0;else{var un=jt(ke,ce.ch,ce.sticky),bt=un-Ze||(ce.ch-fe.ch)*(Qe.level==1?-1:1);un==Ue-1||un==Ue?vt=bt<0:vt=bt>0}var Gn=ke[Ue+(vt?-1:0)],Bn=vt==(Gn.level==1),Ji=Bn?Gn.from:Gn.to,or=Bn?"after":"before";return fe.ch==Ji&&fe.sticky==or?ae:new ss(new cn(fe.line,Ji,or),ce)}function Wh(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(Gn){return!1}if(me>=Math.floor(ie.display.gutters.getBoundingClientRect().right))return!1;ce&&gi(ae);var Ze=ie.display,Qe=Ze.lineDiv.getBoundingClientRect();if(ke>Qe.bottom||!Sn(ie,fe))return Pi(ae);ke-=Qe.top-Ze.viewOffset;for(var Ue=0;Ue<ie.display.gutterSpecs.length;++Ue){var vt=Ze.gutters.childNodes[Ue];if(vt&&vt.getBoundingClientRect().right>=me){var un=sn(ie.doc,ke),bt=ie.display.gutterSpecs[Ue];return tn(ie,fe,ie,un,bt.className,ae),Pi(ae)}}}function Lf(ie,ae){return Wh(ie,ae,"gutterClick",!0)}function Nc(ie,ae){Yt(ie.display,ae)||$g(ie,ae)||hn(ie,ae,"contextmenu")||be||ie.display.input.onContextMenu(ae)}function $g(ie,ae){return Sn(ie,"gutterContextMenu")?Wh(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-"),Oa(ie)}var wd={toString:function(){return"CodeMirror.Init"}},fg={},Pd={};function qg(ie){var ae=ie.optionHandlers;function fe(ce,me,ke,Ze){ie.defaults[ce]=me,ke&&(ae[ce]=Ze?function(Qe,Ue,vt){vt!=wd&&ke(Qe,Ue,vt)}:ke)}ie.defineOption=fe,ie.Init=wd,fe("value","",function(ce,me){return ce.setValue(me)},!0),fe("mode",null,function(ce,me){ce.doc.modeOption=me,Na(ce)},!0),fe("indentUnit",2,Na,!0),fe("indentWithTabs",!1),fe("smartIndent",!0),fe("tabSize",4,function(ce){ud(ce),Oa(ce),_i(ce)},!0),fe("lineSeparator",null,function(ce,me){if(ce.doc.lineSep=me,!!me){var ke=[],Ze=ce.doc.first;ce.doc.iter(function(Ue){for(var vt=0;;){var un=Ue.text.indexOf(me,vt);if(un==-1)break;vt=un+me.length,ke.push(cn(Ze,un))}Ze++});for(var Qe=ke.length-1;Qe>=0;Qe--)Wu(ce.doc,me,ke[Qe],cn(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!=wd&&ce.refresh()}),fe("specialCharPlaceholder",To,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),Rl(ce)},!0),fe("keyMap","default",function(ce,me,ke){var Ze=vd(me),Qe=ke!=wd&&vd(ke);Qe&&Qe.detach&&Qe.detach(ce,Ze),Ze.attach&&Ze.attach(ce,Qe||null)}),fe("extraKeys",null),fe("configureMouse",null),fe("lineWrapping",!1,ep,!0),fe("gutters",[],function(ce,me){ce.display.gutterSpecs=ol(me,ce.options.lineNumbers),Rl(ce)},!0),fe("fixedGutter",!0,function(ce,me){ce.display.gutters.style.left=me?Hr(ce.display)+"px":"0",ce.refresh()},!0),fe("coverGutterNextToScrollbar",!1,function(ce){return Ts(ce)},!0),fe("scrollbarStyle","native",function(ce){Jl(ce),Ts(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=ol(ce.options.gutters,me),Rl(ce)},!0),fe("firstLineNumber",1,Rl,!0),fe("lineNumberFormatter",function(ce){return ce},Rl,!0),fe("showCursorWhenSelecting",!1,Nr,!0),fe("resetSelectionOnContextMenu",!0),fe("lineWiseCopyCut",!0),fe("pasteLinesPerSelection",!0),fe("selectionsMayTouch",!1),fe("readOnly",!1,function(ce,me){me=="nocursor"&&(As(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,Nr,!0),fe("singleCursorHeightPerLine",!0,Nr,!0),fe("workTime",100),fe("workDelay",100),fe("flattenSpans",!0,ud,!0),fe("addModeClass",!1,ud,!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,ud,!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!=wd;if(!ae!=!ce){var me=ie.display.dragFunctions,ke=ae?Mn:nn;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?(Lt(ie.display.wrapper,"CodeMirror-wrap"),ie.display.sizer.style.minWidth="",ie.display.sizerWidth=null):(Re(ie.display.wrapper,"CodeMirror-wrap"),uo(ie)),lr(ie),_i(ie),Oa(ie),setTimeout(function(){return Ts(ie)},100)}function Ua(ie,ae){var fe=this;if(!(this instanceof Ua))return new Ua(ie,ae);this.options=ae=ae?Ot(ae):{},Ot(fg,ae,!1);var ce=ae.value;typeof ce=="string"?ce=new Ks(ce,ae.mode,null,ae.lineSeparator,ae.direction):ae.mode&&(ce.modeOption=ae.mode),this.doc=ce;var me=new Ua.inputStyles[ae.inputStyle](this),ke=this.display=new Rh(ie,ce,me,ae);ke.wrapper.CodeMirror=this,Bf(this),ae.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Jl(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 nt,keySeq:null,specialChars:null},ae.autofocus&&!te&&ke.input.focus(),mt&&Oe<11&&setTimeout(function(){return fe.display.input.reset(!0)},20),Jd(this),lu(),Jn(this),this.curOp.forceUpdate=!0,lf(this,ce),ae.autofocus&&!te||this.hasFocus()?setTimeout(function(){fe.hasFocus()&&!fe.state.focused&&ha(fe)},20):As(this);for(var Ze in Pd)Pd.hasOwnProperty(Ze)&&Pd[Ze](this,ae[Ze],wd);Vs(this),ae.finishInit&&ae.finishInit(this);for(var Qe=0;Qe<Vh.length;++Qe)Vh[Qe](this);Xr(this),at&&ae.lineWrapping&&getComputedStyle(ke.lineDiv).textRendering=="optimizelegibility"&&(ke.lineDiv.style.textRendering="auto")}Ua.defaults=fg,Ua.optionHandlers=Pd;function Jd(ie){var ae=ie.display;Mn(ae.scroller,"mousedown",Va(ie,Yu)),mt&&Oe<11?Mn(ae.scroller,"dblclick",Va(ie,function(Ue){if(!hn(ie,Ue)){var vt=cr(ie,Ue);if(!(!vt||Lf(ie,Ue)||Yt(ie.display,Ue))){gi(Ue);var un=ie.findWordAt(vt);ff(ie.doc,un.anchor,un.head)}}})):Mn(ae.scroller,"dblclick",function(Ue){return hn(ie,Ue)||gi(Ue)}),Mn(ae.scroller,"contextmenu",function(Ue){return Nc(ie,Ue)}),Mn(ae.input.getField(),"contextmenu",function(Ue){ae.scroller.contains(Ue.target)||Nc(ie,Ue)});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(Ue){if(Ue.touches.length!=1)return!1;var vt=Ue.touches[0];return vt.radiusX<=1&&vt.radiusY<=1}function Ze(Ue,vt){if(vt.left==null)return!0;var un=vt.left-Ue.left,bt=vt.top-Ue.top;return un*un+bt*bt>20*20}Mn(ae.scroller,"touchstart",function(Ue){if(!hn(ie,Ue)&&!ke(Ue)&&!Lf(ie,Ue)){ae.input.ensurePolled(),clearTimeout(fe);var vt=+new Date;ae.activeTouch={start:vt,moved:!1,prev:vt-ce.end<=300?ce:null},Ue.touches.length==1&&(ae.activeTouch.left=Ue.touches[0].pageX,ae.activeTouch.top=Ue.touches[0].pageY)}}),Mn(ae.scroller,"touchmove",function(){ae.activeTouch&&(ae.activeTouch.moved=!0)}),Mn(ae.scroller,"touchend",function(Ue){var vt=ae.activeTouch;if(vt&&!Yt(ae,Ue)&&vt.left!=null&&!vt.moved&&new Date-vt.start<300){var un=ie.coordsChar(ae.activeTouch,"page"),bt;!vt.prev||Ze(vt,vt.prev)?bt=new ss(un,un):!vt.prev.prev||Ze(vt,vt.prev.prev)?bt=ie.findWordAt(un):bt=new ss(cn(un.line,0),Ri(ie.doc,cn(un.line+1,0))),ie.setSelection(bt.anchor,bt.head),ie.focus(),gi(Ue)}me()}),Mn(ae.scroller,"touchcancel",me),Mn(ae.scroller,"scroll",function(){ae.scroller.clientHeight&&(Bl(ie,ae.scroller.scrollTop),ul(ie,ae.scroller.scrollLeft,!0),tn(ie,"scroll",ie))}),Mn(ae.scroller,"mousewheel",function(Ue){return al(ie,Ue)}),Mn(ae.scroller,"DOMMouseScroll",function(Ue){return al(ie,Ue)}),Mn(ae.wrapper,"scroll",function(){return ae.wrapper.scrollTop=ae.wrapper.scrollLeft=0}),ae.dragFunctions={enter:function(Ue){hn(ie,Ue)||Ii(Ue)},over:function(Ue){hn(ie,Ue)||(Xg(ie,Ue),Ii(Ue))},start:function(Ue){return Yg(ie,Ue)},drop:Va(ie,Bc),leave:function(Ue){hn(ie,Ue)||Jg(ie)}};var Qe=ae.input.getField();Mn(Qe,"keyup",function(Ue){return og.call(ie,Ue)}),Mn(Qe,"keydown",Va(ie,ig)),Mn(Qe,"keypress",Va(ie,Uu)),Mn(Qe,"focus",function(Ue){return ha(ie,Ue)}),Mn(Qe,"blur",function(Ue){return As(ie,Ue)})}var Vh=[];Ua.defineInitHook=function(ie){return Vh.push(ie)};function il(ie,ae,fe,ce){var me=ie.doc,ke;fe==null&&(fe="add"),fe=="smart"&&(me.mode.indent?ke=mo(ie,ae).state:fe="prev");var Ze=ie.options.tabSize,Qe=Kn(me,ae),Ue=ct(Qe.text,null,Ze);Qe.stateAfter&&(Qe.stateAfter=null);var vt=Qe.text.match(/^\s*/)[0],un;if(!ce&&!/\S/.test(Qe.text))un=0,fe="not";else if(fe=="smart"&&(un=me.mode.indent(ke,Qe.text.slice(vt.length),Qe.text),un==zn||un>150)){if(!ce)return;fe="prev"}fe=="prev"?ae>me.first?un=ct(Kn(me,ae-1).text,null,Ze):un=0:fe=="add"?un=Ue+ie.options.indentUnit:fe=="subtract"?un=Ue-ie.options.indentUnit:typeof fe=="number"&&(un=Ue+fe),un=Math.max(0,un);var bt="",Gn=0;if(ie.options.indentWithTabs)for(var Bn=Math.floor(un/Ze);Bn;--Bn)Gn+=Ze,bt+=" ";if(Gn<un&&(bt+=Hn(un-Gn)),bt!=vt)return Wu(me,bt,cn(ae,0),cn(ae,vt.length),"+input"),Qe.stateAfter=null,!0;for(var Ji=0;Ji<me.sel.ranges.length;Ji++){var or=me.sel.ranges[Ji];if(or.head.line==ae&&or.head.ch<vt.length){var Br=cn(ae,vt.length);wu(me,Ji,new ss(Br,Br));break}}}var Al=null;function Qd(ie){Al=ie}function Ed(ie,ae,fe,ce,me){var ke=ie.doc;ie.display.shift=!1,ce||(ce=ke.sel);var Ze=+new Date-200,Qe=me=="paste"||ie.state.pasteIncoming>Ze,Ue=xr(ae),vt=null;if(Qe&&ce.ranges.length>1)if(Al&&Al.text.join(`
|
|
`)==ae){if(ce.ranges.length%Al.text.length==0){vt=[];for(var un=0;un<Al.text.length;un++)vt.push(ke.splitLines(Al.text[un]))}}else Ue.length==ce.ranges.length&&ie.options.pasteLinesPerSelection&&(vt=An(Ue,function(Jr){return[Jr]}));for(var bt=ie.curOp.updateInput,Gn=ce.ranges.length-1;Gn>=0;Gn--){var Bn=ce.ranges[Gn],Ji=Bn.from(),or=Bn.to();Bn.empty()&&(fe&&fe>0?Ji=cn(Ji.line,Ji.ch-fe):ie.state.overwrite&&!Qe?or=cn(or.line,Math.min(Kn(ke,or.line).text.length,or.ch+lt(Ue).length)):Qe&&Al&&Al.lineWise&&Al.text.join(`
|
|
`)==Ue.join(`
|
|
`)&&(Ji=or=cn(Ji.line,0)));var Br={from:Ji,to:or,text:vt?vt[Gn%vt.length]:Ue,origin:me||(Qe?"paste":ie.state.cutIncoming>Ze?"cut":"+input")};_u(ie.doc,Br),Vr(ie,"inputRead",ie,Br)}ae&&!Qe&&pg(ie,ae),Ll(ie),ie.curOp.updateInput<2&&(ie.curOp.updateInput=bt),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&&xo(ae,function(){return Ed(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),Ze=!1;if(ke.electricChars){for(var Qe=0;Qe<ke.electricChars.length;Qe++)if(ae.indexOf(ke.electricChars.charAt(Qe))>-1){Ze=il(ie,me.head.line,"smart");break}}else ke.electricInput&&ke.electricInput.test(Kn(ie.doc,me.head.line).text.slice(0,me.head.ch))&&(Ze=il(ie,me.head.line,"smart"));Ze&&Vr(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:cn(me,0),head:cn(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"),Te&&(ie.style.border="1px solid black"),vg(ie),ae}function Kh(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,Ze=ke[ce];ke[ce]==me&&ce!="mode"||(ke[ce]=me,ae.hasOwnProperty(ce)&&Va(this,ae[ce])(this,me,Ze),tn(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"](vd(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:Ea(function(ce,me){var ke=ce.token?ce:ie.getMode(this.options,ce);if(ke.startState)throw new Error("Overlays may not be stateful.");Ni(this.state.overlays,{mode:ke,modeSpec:ce,opaque:me&&me.opaque,priority:me&&me.priority||0},function(Ze){return Ze.priority}),this.state.modeGen++,_i(this)}),removeOverlay:Ea(function(ce){for(var me=this.state.overlays,ke=0;ke<me.length;++ke){var Ze=me[ke].modeSpec;if(Ze==ce||typeof ce=="string"&&Ze.name==ce){me.splice(ke,1),this.state.modeGen++,_i(this);return}}}),indentLine:Ea(function(ce,me,ke){typeof me!="string"&&typeof me!="number"&&(me==null?me=this.options.smartIndent?"smart":"prev":me=me?"add":"subtract"),Dn(this.doc,ce)&&il(this,ce,me,ke)}),indentSelection:Ea(function(ce){for(var me=this.doc.sel.ranges,ke=-1,Ze=0;Ze<me.length;Ze++){var Qe=me[Ze];if(Qe.empty())Qe.head.line>ke&&(il(this,Qe.head.line,ce,!0),ke=Qe.head.line,Ze==this.doc.sel.primIndex&&Ll(this));else{var Ue=Qe.from(),vt=Qe.to(),un=Math.max(ke,Ue.line);ke=Math.min(this.lastLine(),vt.line-(vt.ch?0:1))+1;for(var bt=un;bt<ke;++bt)il(this,bt,ce);var Gn=this.doc.sel.ranges;Ue.ch==0&&me.length==Gn.length&&Gn[Ze].from().ch>0&&wu(this.doc,Ze,new ss(Ue,Gn[Ze].to()),Ht)}}}),getTokenAt:function(ce,me){return vr(this,ce,me)},getLineTokens:function(ce,me){return vr(this,cn(ce),me,!0)},getTokenTypeAt:function(ce){ce=Ri(this.doc,ce);var me=zr(this,Kn(this.doc,ce.line)),ke=0,Ze=(me.length-1)/2,Qe=ce.ch,Ue;if(Qe==0)Ue=me[2];else for(;;){var vt=ke+Ze>>1;if((vt?me[vt*2-1]:0)>=Qe)Ze=vt;else if(me[vt*2+1]<Qe)ke=vt+1;else{Ue=me[vt*2+2];break}}var un=Ue?Ue.indexOf("overlay "):-1;return un<0?Ue:un==0?null:Ue.slice(0,un-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 Ze=fe[me],Qe=this.getModeAt(ce);if(typeof Qe[me]=="string")Ze[Qe[me]]&&ke.push(Ze[Qe[me]]);else if(Qe[me])for(var Ue=0;Ue<Qe[me].length;Ue++){var vt=Ze[Qe[me][Ue]];vt&&ke.push(vt)}else Qe.helperType&&Ze[Qe.helperType]?ke.push(Ze[Qe.helperType]):Ze[Qe.name]&&ke.push(Ze[Qe.name]);for(var un=0;un<Ze._global.length;un++){var bt=Ze._global[un];bt.pred(Qe,this)&&gn(ke,bt.val)==-1&&ke.push(bt.val)}return ke},getStateAfter:function(ce,me){var ke=this.doc;return ce=Mi(ke,ce==null?ke.first+ke.size-1:ce),mo(this,ce+1,me).state},cursorCoords:function(ce,me){var ke,Ze=this.doc.sel.primary();return ce==null?ke=Ze.head:typeof ce=="object"?ke=Ri(this.doc,ce):ke=ce?Ze.from():Ze.to(),wo(this,ke,me||"page")},charCoords:function(ce,me){return Yr(this,Ri(this.doc,ce),me||"page")},coordsChar:function(ce,me){return ce=oo(this,ce,me||"page"),Mt(this,ce.left,ce.top)},lineAtHeight:function(ce,me){return ce=oo(this,{top:ce,left:0},me||"page").top,sn(this.doc,ce+this.display.viewOffset)},heightAtLine:function(ce,me,ke){var Ze=!1,Qe;if(typeof ce=="number"){var Ue=this.doc.first+this.doc.size-1;ce<this.doc.first?ce=this.doc.first:ce>Ue&&(ce=Ue,Ze=!0),Qe=Kn(this.doc,ce)}else Qe=ce;return jr(this,Qe,{top:0,left:0},me||"page",ke||Ze).top+(Ze?this.doc.height-rr(Qe):0)},defaultTextHeight:function(){return $i(this.display)},defaultCharWidth:function(){return wi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(ce,me,ke,Ze,Qe){var Ue=this.display;ce=wo(this,Ri(this.doc,ce));var vt=ce.bottom,un=ce.left;if(me.style.position="absolute",me.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(me),Ue.sizer.appendChild(me),Ze=="over")vt=ce.top;else if(Ze=="above"||Ze=="near"){var bt=Math.max(Ue.wrapper.clientHeight,this.doc.height),Gn=Math.max(Ue.sizer.clientWidth,Ue.lineSpace.clientWidth);(Ze=="above"||ce.bottom+me.offsetHeight>bt)&&ce.top>me.offsetHeight?vt=ce.top-me.offsetHeight:ce.bottom+me.offsetHeight<=bt&&(vt=ce.bottom),un+me.offsetWidth>Gn&&(un=Gn-me.offsetWidth)}me.style.top=vt+"px",me.style.left=me.style.right="",Qe=="right"?(un=Ue.sizer.clientWidth-me.offsetWidth,me.style.right="0px"):(Qe=="left"?un=0:Qe=="middle"&&(un=(Ue.sizer.clientWidth-me.offsetWidth)/2),me.style.left=un+"px"),ke&&Ol(this,{left:un,top:vt,right:un+me.offsetWidth,bottom:vt+me.offsetHeight})},triggerOnKeyDown:Ea(ig),triggerOnKeyPress:Ea(Uu),triggerOnKeyUp:og,triggerOnMouseDown:Ea(Yu),execCommand:function(ce){if(Gh.hasOwnProperty(ce))return Gh[ce].call(null,this)},triggerElectric:Ea(function(ce){pg(this,ce)}),findPosH:function(ce,me,ke,Ze){var Qe=1;me<0&&(Qe=-1,me=-me);for(var Ue=Ri(this.doc,ce),vt=0;vt<me&&(Ue=Dc(this.doc,Ue,Qe,ke,Ze),!Ue.hitSide);++vt);return Ue},moveH:Ea(function(ce,me){var ke=this;this.extendSelectionsBy(function(Ze){return ke.display.shift||ke.doc.extend||Ze.empty()?Dc(ke.doc,Ze.head,ce,me,ke.options.rtlMoveVisually):ce<0?Ze.from():Ze.to()},Cn)}),deleteH:Ea(function(ce,me){var ke=this.doc.sel,Ze=this.doc;ke.somethingSelected()?Ze.replaceSelection("",null,"+delete"):zl(this,function(Qe){var Ue=Dc(Ze,Qe.head,ce,me,!1);return ce<0?{from:Ue,to:Qe.head}:{from:Qe.head,to:Ue}})}),findPosV:function(ce,me,ke,Ze){var Qe=1,Ue=Ze;me<0&&(Qe=-1,me=-me);for(var vt=Ri(this.doc,ce),un=0;un<me;++un){var bt=wo(this,vt,"div");if(Ue==null?Ue=bt.left:bt.left=Ue,vt=Bh(this,bt,Qe,ke),vt.hitSide)break}return vt},moveV:Ea(function(ce,me){var ke=this,Ze=this.doc,Qe=[],Ue=!this.display.shift&&!Ze.extend&&Ze.sel.somethingSelected();if(Ze.extendSelectionsBy(function(un){if(Ue)return ce<0?un.from():un.to();var bt=wo(ke,un.head,"div");un.goalColumn!=null&&(bt.left=un.goalColumn),Qe.push(bt.left);var Gn=Bh(ke,bt,ce,me);return me=="page"&&un==Ze.sel.primary()&&mu(ke,Yr(ke,Gn,"div").top-bt.top),Gn},Cn),Qe.length)for(var vt=0;vt<Ze.sel.ranges.length;vt++)Ze.sel.ranges[vt].goalColumn=Qe[vt]}),findWordAt:function(ce){var me=this.doc,ke=Kn(me,ce.line).text,Ze=ce.ch,Qe=ce.ch;if(ke){var Ue=this.getHelper(ce,"wordChars");(ce.sticky=="before"||Qe==ke.length)&&Ze?--Ze:++Qe;for(var vt=ke.charAt(Ze),un=We(vt,Ue)?function(bt){return We(bt,Ue)}:/\s/.test(vt)?function(bt){return/\s/.test(bt)}:function(bt){return!/\s/.test(bt)&&!We(bt)};Ze>0&&un(ke.charAt(Ze-1));)--Ze;for(;Qe<ke.length&&un(ke.charAt(Qe));)++Qe}return new ss(cn(ce.line,Ze),cn(ce.line,Qe))},toggleOverwrite:function(ce){ce!=null&&ce==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Lt(this.display.cursorDiv,"CodeMirror-overwrite"):Re(this.display.cursorDiv,"CodeMirror-overwrite"),tn(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==St()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Ea(function(ce,me){ru(this,ce,me)}),getScrollInfo:function(){var ce=this.display.scroller;return{left:ce.scrollLeft,top:ce.scrollTop,height:ce.scrollHeight-yi(this)-this.display.barHeight,width:ce.scrollWidth-yi(this)-this.display.barWidth,clientHeight:Li(this),clientWidth:Ai(this)}},scrollIntoView:Ea(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:cn(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?ka(this,ce):ou(this,ce.from,ce.to,ce.margin)}),setSize:Ea(function(ce,me){var ke=this,Ze=function(Ue){return typeof Ue=="number"||/^\d+$/.test(String(Ue))?Ue+"px":Ue};ce!=null&&(this.display.wrapper.style.width=Ze(ce)),me!=null&&(this.display.wrapper.style.height=Ze(me)),this.options.lineWrapping&&Ma(this);var Qe=this.display.viewFrom;this.doc.iter(Qe,this.display.viewTo,function(Ue){if(Ue.widgets){for(var vt=0;vt<Ue.widgets.length;vt++)if(Ue.widgets[vt].noHScroll){Ci(ke,Qe,"widget");break}}++Qe}),this.curOp.forceUpdate=!0,tn(this,"refresh",this)}),operation:function(ce){return xo(this,ce)},startOperation:function(){return Jn(this)},endOperation:function(){return Xr(this)},refresh:Ea(function(){var ce=this.display.cachedTextHeight;_i(this),this.curOp.forceUpdate=!0,Oa(this),ru(this,this.doc.scrollLeft,this.doc.scrollTop),Ih(this.display),(ce==null||Math.abs(ce-$i(this.display))>.5||this.options.lineWrapping)&&lr(this),tn(this,"refresh",this)}),swapDoc:Ea(function(ce){var me=this.doc;return me.cm=null,this.state.selectingText&&this.state.selectingText(),lf(this,ce),Oa(this),this.display.input.reset(),ru(this,ce.scrollLeft,ce.scrollTop),this.curOp.forceScroll=!0,Vr(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}},Kt(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,Ze){ie.registerHelper(ce,me,Ze),fe[ce]._global.push({pred:ke,val:Ze})}}function Dc(ie,ae,fe,ce,me){var ke=ae,Ze=fe,Qe=Kn(ie,ae.line),Ue=me&&ie.direction=="rtl"?-fe:fe;function vt(){var Ao=ae.line+Ue;return Ao<ie.first||Ao>=ie.first+ie.size?!1:(ae=new cn(Ao,ae.ch,ae.sticky),Qe=Kn(ie,Ao))}function un(Ao){var ho;if(ce=="codepoint"){var jo=Qe.text.charCodeAt(ae.ch+(ce>0?0:-1));isNaN(jo)?ho=null:ho=new cn(ae.line,Math.max(0,Math.min(Qe.text.length,ae.ch+fe*(jo>=55296&&jo<56320?2:1))),-fe)}else me?ho=Ef(ie.cm,Qe,ae,fe):ho=Zs(Qe,ae,fe);if(ho==null)if(!Ao&&vt())ae=lh(me,ie.cm,Qe,ae.line,Ue);else return!1;else ae=ho;return!0}if(ce=="char"||ce=="codepoint")un();else if(ce=="column")un(!0);else if(ce=="word"||ce=="group")for(var bt=null,Gn=ce=="group",Bn=ie.cm&&ie.cm.getHelper(ae,"wordChars"),Ji=!0;!(fe<0&&!un(!Ji));Ji=!1){var or=Qe.text.charAt(ae.ch)||`
|
|
`,Br=We(or,Bn)?"w":Gn&&or==`
|
|
`?"n":!Gn||/\s/.test(or)?null:"p";if(Gn&&!Ji&&!Br&&(Br="s"),bt&&bt!=Br){fe<0&&(fe=1,un(),ae.sticky="after");break}if(Br&&(bt=Br),fe>0&&!un(!Ji))break}var Jr=pd(ie,ae,ke,Ze,!0);return an(ke,Jr)&&(Jr.hitSide=!0),Jr}function Bh(ie,ae,fe,ce){var me=ie.doc,ke=ae.left,Ze;if(ce=="page"){var Qe=Math.min(ie.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Ue=Math.max(Qe-.5*$i(ie.display),3);Ze=(fe>0?ae.bottom:ae.top)+fe*Ue}else ce=="line"&&(Ze=fe>0?ae.bottom+3:ae.top-3);for(var vt;vt=Mt(ie,ke,Ze),!!vt.outside;){if(fe<0?Ze<=0:Ze>=me.height){vt.hitSide=!0;break}Ze+=fe*5}return vt}var rs=function(ie){this.cm=ie,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new nt,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};rs.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 Ue=Qe.target;Ue;Ue=Ue.parentNode){if(Ue==me)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Ue.className))break}return!1}Mn(me,"paste",function(Qe){!ke(Qe)||hn(ce,Qe)||gg(Qe,ce)||Oe<=11&&setTimeout(Va(ce,function(){return ae.updateFromDOM()}),20)}),Mn(me,"compositionstart",function(Qe){ae.composing={data:Qe.data,done:!1}}),Mn(me,"compositionupdate",function(Qe){ae.composing||(ae.composing={data:Qe.data,done:!1})}),Mn(me,"compositionend",function(Qe){ae.composing&&(Qe.data!=ae.composing.data&&ae.readFromDOMSoon(),ae.composing.done=!0)}),Mn(me,"touchstart",function(){return fe.forceCompositionEnd()}),Mn(me,"input",function(){ae.composing||ae.readFromDOMSoon()});function Ze(Qe){if(!(!ke(Qe)||hn(ce,Qe))){if(ce.somethingSelected())Qd({lineWise:!1,text:ce.getSelections()}),Qe.type=="cut"&&ce.replaceSelection("",null,"cut");else if(ce.options.lineWiseCopyCut){var Ue=mg(ce);Qd({lineWise:!0,text:Ue.text}),Qe.type=="cut"&&ce.operation(function(){ce.setSelections(Ue.ranges,0,Ht),ce.replaceSelection("",null,"cut")})}else return;if(Qe.clipboardData){Qe.clipboardData.clearData();var vt=Al.text.join(`
|
|
`);if(Qe.clipboardData.setData("Text",vt),Qe.clipboardData.getData("Text")==vt){Qe.preventDefault();return}}var un=yg(),bt=un.firstChild;ce.display.lineSpace.insertBefore(un,ce.display.lineSpace.firstChild),bt.value=Al.text.join(`
|
|
`);var Gn=document.activeElement;$t(bt),setTimeout(function(){ce.display.lineSpace.removeChild(un),Gn.focus(),Gn==me&&fe.showPrimarySelection()},50)}}Mn(me,"copy",Ze),Mn(me,"cut",Ze)},rs.prototype.screenReaderLabelChanged=function(ie){ie?this.div.setAttribute("aria-label",ie):this.div.removeAttribute("aria-label")},rs.prototype.prepareSelection=function(){var ie=Tr(this.cm,!1);return ie.focus=document.activeElement==this.div,ie},rs.prototype.showSelection=function(ie,ae){!ie||!this.cm.display.view.length||((ie.focus||ae)&&this.showPrimarySelection(),this.showMultipleSelections(ie))},rs.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},rs.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=Tc(ae,ie.anchorNode,ie.anchorOffset),Ze=Tc(ae,ie.focusNode,ie.focusOffset);if(!(ke&&!ke.bad&&Ze&&!Ze.bad&&qt(Hi(ke,Ze),ce)==0&&qt(ur(ke,Ze),me)==0)){var Qe=ae.display.view,Ue=ce.line>=ae.display.viewFrom&&Cd(ae,ce)||{node:Qe[0].measure.map[2],offset:0},vt=me.line<ae.display.viewTo&&Cd(ae,me);if(!vt){var un=Qe[Qe.length-1].measure,bt=un.maps?un.maps[un.maps.length-1]:un.map;vt={node:bt[bt.length-1],offset:bt[bt.length-2]-bt[bt.length-3]}}if(!Ue||!vt){ie.removeAllRanges();return}var Gn=ie.rangeCount&&ie.getRangeAt(0),Bn;try{Bn=tt(Ue.node,Ue.offset,vt.offset,vt.node)}catch(Ji){}Bn&&(!ue&&ae.state.focused?(ie.collapse(Ue.node,Ue.offset),Bn.collapsed||(ie.removeAllRanges(),ie.addRange(Bn))):(ie.removeAllRanges(),ie.addRange(Bn)),Gn&&ie.anchorNode==null?ie.addRange(Gn):ue&&this.startGracePeriod()),this.rememberSelection()}},rs.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)},rs.prototype.showMultipleSelections=function(ie){et(this.cm.display.cursorDiv,ie.cursors),et(this.cm.display.selectionDiv,ie.selection)},rs.prototype.rememberSelection=function(){var ie=this.getSelection();this.lastAnchorNode=ie.anchorNode,this.lastAnchorOffset=ie.anchorOffset,this.lastFocusNode=ie.focusNode,this.lastFocusOffset=ie.focusOffset},rs.prototype.selectionInEditor=function(){var ie=this.getSelection();if(!ie.rangeCount)return!1;var ae=ie.getRangeAt(0).commonAncestorContainer;return wt(this.div,ae)},rs.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},rs.prototype.blur=function(){this.div.blur()},rs.prototype.getField=function(){return this.div},rs.prototype.supportsTouch=function(){return!0},rs.prototype.receivedFocus=function(){var ie=this;this.selectionInEditor()?this.pollSelection():xo(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)},rs.prototype.selectionChanged=function(){var ie=this.getSelection();return ie.anchorNode!=this.lastAnchorNode||ie.anchorOffset!=this.lastAnchorOffset||ie.focusNode!=this.lastFocusNode||ie.focusOffset!=this.lastFocusOffset},rs.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var ie=this.getSelection(),ae=this.cm;if(ne&&dt&&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=Tc(ae,ie.anchorNode,ie.anchorOffset),ce=Tc(ae,ie.focusNode,ie.focusOffset);fe&&ce&&xo(ae,function(){hl(ae.doc,Fh(fe,ce),Ht),(fe.bad||ce.bad)&&(ae.curOp.selectionChanged=!0)})}}},rs.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=cn(ce.line-1,Kn(ie.doc,ce.line-1).length)),me.ch==Kn(ie.doc,me.line).text.length&&me.line<ie.lastLine()&&(me=cn(me.line+1,0)),ce.line<ae.viewFrom||me.line>ae.viewTo-1)return!1;var ke,Ze,Qe;ce.line==ae.viewFrom||(ke=yr(ie,ce.line))==0?(Ze=it(ae.view[0].line),Qe=ae.view[0].node):(Ze=it(ae.view[ke].line),Qe=ae.view[ke-1].node.nextSibling);var Ue=yr(ie,me.line),vt,un;if(Ue==ae.view.length-1?(vt=ae.viewTo-1,un=ae.lineDiv.lastChild):(vt=it(ae.view[Ue+1].line)-1,un=ae.view[Ue+1].node.previousSibling),!Qe)return!1;for(var bt=ie.doc.splitLines(bd(ie,Qe,un,Ze,vt)),Gn=It(ie.doc,cn(Ze,0),cn(vt,Kn(ie.doc,vt).text.length));bt.length>1&&Gn.length>1;)if(lt(bt)==lt(Gn))bt.pop(),Gn.pop(),vt--;else if(bt[0]==Gn[0])bt.shift(),Gn.shift(),Ze++;else break;for(var Bn=0,Ji=0,or=bt[0],Br=Gn[0],Jr=Math.min(or.length,Br.length);Bn<Jr&&or.charCodeAt(Bn)==Br.charCodeAt(Bn);)++Bn;for(var Ao=lt(bt),ho=lt(Gn),jo=Math.min(Ao.length-(bt.length==1?Bn:0),ho.length-(Gn.length==1?Bn:0));Ji<jo&&Ao.charCodeAt(Ao.length-Ji-1)==ho.charCodeAt(ho.length-Ji-1);)++Ji;if(bt.length==1&&Gn.length==1&&Ze==ce.line)for(;Bn&&Bn>ce.ch&&Ao.charCodeAt(Ao.length-Ji-1)==ho.charCodeAt(ho.length-Ji-1);)Bn--,Ji++;bt[bt.length-1]=Ao.slice(0,Ao.length-Ji).replace(/^\u200b+/,""),bt[0]=bt[0].slice(Bn).replace(/\u200b+$/,"");var ma=cn(Ze,Bn),co=cn(vt,Gn.length?lt(Gn).length-Ji:0);if(bt.length>1||bt[0]||qt(ma,co))return Wu(ie.doc,bt,ma,co,"+input"),!0},rs.prototype.ensurePolled=function(){this.forceCompositionEnd()},rs.prototype.reset=function(){this.forceCompositionEnd()},rs.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},rs.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))},rs.prototype.updateFromDOM=function(){var ie=this;(this.cm.isReadOnly()||!this.pollContent())&&xo(this.cm,function(){return _i(ie.cm)})},rs.prototype.setUneditable=function(ie){ie.contentEditable="false"},rs.prototype.onKeyPress=function(ie){ie.charCode==0||this.composing||(ie.preventDefault(),this.cm.isReadOnly()||Va(this.cm,Ed)(this.cm,String.fromCharCode(ie.charCode==null?ie.keyCode:ie.charCode),0))},rs.prototype.readOnlyChanged=function(ie){this.div.contentEditable=String(ie!="nocursor")},rs.prototype.onContextMenu=function(){},rs.prototype.resetPosition=function(){},rs.prototype.needsContentAttribute=!0;function Cd(ie,ae){var fe=ea(ie,ae.line);if(!fe||fe.hidden)return null;var ce=Kn(ie.doc,ae.line),me=ri(fe,ce,ae.line),ke=jn(ce,ie.doc.direction),Ze="left";if(ke){var Qe=jt(ke,ae.ch);Ze=Qe%2?"right":"left"}var Ue=vo(me.map,ae.ch,Ze);return Ue.offset=Ue.collapse=="right"?Ue.end:Ue.start,Ue}function xg(ie){for(var ae=ie;ae;ae=ae.parentNode)if(/CodeMirror-gutter-wrapper/.test(ae.className))return!0;return!1}function Uh(ie,ae){return ae&&(ie.bad=!0),ie}function bd(ie,ae,fe,ce,me){var ke="",Ze=!1,Qe=ie.doc.lineSeparator(),Ue=!1;function vt(Bn){return function(Ji){return Ji.id==Bn}}function un(){Ze&&(ke+=Qe,Ue&&(ke+=Qe),Ze=Ue=!1)}function bt(Bn){Bn&&(un(),ke+=Bn)}function Gn(Bn){if(Bn.nodeType==1){var Ji=Bn.getAttribute("cm-text");if(Ji){bt(Ji);return}var or=Bn.getAttribute("cm-marker"),Br;if(or){var Jr=ie.findMarks(cn(ce,0),cn(me+1,0),vt(+or));Jr.length&&(Br=Jr[0].find(0))&&bt(It(ie.doc,Br.from,Br.to).join(Qe));return}if(Bn.getAttribute("contenteditable")=="false")return;var Ao=/^(pre|div|p|li|table|br)$/i.test(Bn.nodeName);if(!/^br$/i.test(Bn.nodeName)&&Bn.textContent.length==0)return;Ao&&un();for(var ho=0;ho<Bn.childNodes.length;ho++)Gn(Bn.childNodes[ho]);/^(pre|p)$/i.test(Bn.nodeName)&&(Ue=!0),Ao&&(Ze=!0)}else Bn.nodeType==3&&bt(Bn.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;Gn(ae),ae!=fe;)ae=ae.nextSibling,Ue=!1;return ke}function Tc(ie,ae,fe){var ce;if(ae==ie.display.lineDiv){if(ce=ie.display.lineDiv.childNodes[fe],!ce)return Uh(ie.clipPos(cn(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||!wt(ce,ae))return Uh(cn(it(ie.line),0),!0);if(ae==ce&&(me=!0,ae=ce.childNodes[fe],fe=0,!ae)){var ke=ie.rest?lt(ie.rest):ie.line;return Uh(cn(it(ke),ke.text.length),me)}var Ze=ae.nodeType==3?ae:null,Qe=ae;for(!Ze&&ae.childNodes.length==1&&ae.firstChild.nodeType==3&&(Ze=ae.firstChild,fe&&(fe=Ze.nodeValue.length));Qe.parentNode!=ce;)Qe=Qe.parentNode;var Ue=ie.measure,vt=Ue.maps;function un(Br,Jr,Ao){for(var ho=-1;ho<(vt?vt.length:0);ho++)for(var jo=ho<0?Ue.map:vt[ho],ma=0;ma<jo.length;ma+=3){var co=jo[ma+2];if(co==Br||co==Jr){var _a=it(ho<0?ie.line:ie.rest[ho]),xs=jo[ma]+Ao;return(Ao<0||co!=Br)&&(xs=jo[ma+(Ao?1:0)]),cn(_a,xs)}}}var bt=un(Ze,Qe,fe);if(bt)return Uh(bt,me);for(var Gn=Qe.nextSibling,Bn=Ze?Ze.nodeValue.length-fe:0;Gn;Gn=Gn.nextSibling){if(bt=un(Gn,Gn.firstChild,0),bt)return Uh(cn(bt.line,bt.ch-Bn),me);Bn+=Gn.textContent.length}for(var Ji=Qe.previousSibling,or=fe;Ji;Ji=Ji.previousSibling){if(bt=un(Ji,Ji.firstChild,-1),bt)return Uh(cn(bt.line,bt.ch+or),me);or+=Ji.textContent.length}}var Js=function(ie){this.cm=ie,this.prevInput="",this.pollingFast=!1,this.polling=new nt,this.hasSelection=!1,this.composing=null};Js.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),Te&&(me.style.width="0px"),Mn(me,"input",function(){mt&&Oe>=9&&ae.hasSelection&&(ae.hasSelection=null),fe.poll()}),Mn(me,"paste",function(Ze){hn(ce,Ze)||gg(Ze,ce)||(ce.state.pasteIncoming=+new Date,fe.fastPoll())});function ke(Ze){if(!hn(ce,Ze)){if(ce.somethingSelected())Qd({lineWise:!1,text:ce.getSelections()});else if(ce.options.lineWiseCopyCut){var Qe=mg(ce);Qd({lineWise:!0,text:Qe.text}),Ze.type=="cut"?ce.setSelections(Qe.ranges,null,Ht):(fe.prevInput="",me.value=Qe.text.join(`
|
|
`),$t(me))}else return;Ze.type=="cut"&&(ce.state.cutIncoming=+new Date)}}Mn(me,"cut",ke),Mn(me,"copy",ke),Mn(ie.scroller,"paste",function(Ze){if(!(Yt(ie,Ze)||hn(ce,Ze))){if(!me.dispatchEvent){ce.state.pasteIncoming=+new Date,fe.focus();return}var Qe=new Event("paste");Qe.clipboardData=Ze.clipboardData,me.dispatchEvent(Qe)}}),Mn(ie.lineSpace,"selectstart",function(Ze){Yt(ie,Ze)||gi(Ze)}),Mn(me,"compositionstart",function(){var Ze=ce.getCursor("from");fe.composing&&fe.composing.range.clear(),fe.composing={start:Ze,range:ce.markText(Ze,ce.getCursor("to"),{className:"CodeMirror-composing"})}}),Mn(me,"compositionend",function(){fe.composing&&(fe.poll(),fe.composing.range.clear(),fe.composing=null)})},Js.prototype.createField=function(ie){this.wrapper=yg(),this.textarea=this.wrapper.firstChild},Js.prototype.screenReaderLabelChanged=function(ie){ie?this.textarea.setAttribute("aria-label",ie):this.textarea.removeAttribute("aria-label")},Js.prototype.prepareSelection=function(){var ie=this.cm,ae=ie.display,fe=ie.doc,ce=Tr(ie);if(ie.options.moveInputWithCursor){var me=wo(ie,fe.sel.primary().head,"div"),ke=ae.wrapper.getBoundingClientRect(),Ze=ae.lineDiv.getBoundingClientRect();ce.teTop=Math.max(0,Math.min(ae.wrapper.clientHeight-10,me.top+Ze.top-ke.top)),ce.teLeft=Math.max(0,Math.min(ae.wrapper.clientWidth-10,me.left+Ze.left-ke.left))}return ce},Js.prototype.showSelection=function(ie){var ae=this.cm,fe=ae.display;et(fe.cursorDiv,ie.cursors),et(fe.selectionDiv,ie.selection),ie.teTop!=null&&(this.wrapper.style.top=ie.teTop+"px",this.wrapper.style.left=ie.teLeft+"px")},Js.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&&$t(this.textarea),mt&&Oe>=9&&(this.hasSelection=fe)}else ie||(this.prevInput=this.textarea.value="",mt&&Oe>=9&&(this.hasSelection=null))}},Js.prototype.getField=function(){return this.textarea},Js.prototype.supportsTouch=function(){return!1},Js.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!te||St()!=this.textarea))try{this.textarea.focus()}catch(ie){}},Js.prototype.blur=function(){this.textarea.blur()},Js.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Js.prototype.receivedFocus=function(){this.slowPoll()},Js.prototype.slowPoll=function(){var ie=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){ie.poll(),ie.cm.state.focused&&ie.slowPoll()})},Js.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)},Js.prototype.poll=function(){var ie=this,ae=this.cm,fe=this.textarea,ce=this.prevInput;if(this.contextMenuPending||!ae.state.focused||Ce(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(mt&&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 Ze=0,Qe=Math.min(ce.length,me.length);Ze<Qe&&ce.charCodeAt(Ze)==me.charCodeAt(Ze);)++Ze;return xo(ae,function(){Ed(ae,me.slice(Ze),ce.length-Ze,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},Js.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Js.prototype.onKeyPress=function(){mt&&Oe>=9&&(this.hasSelection=null),this.fastPoll()},Js.prototype.onContextMenu=function(ie){var ae=this,fe=ae.cm,ce=fe.display,me=ae.textarea;ae.contextMenuPending&&ae.contextMenuPending();var ke=cr(fe,ie),Ze=ce.scroller.scrollTop;if(!ke||Ge)return;var Qe=fe.options.resetSelectionOnContextMenu;Qe&&fe.doc.sel.contains(ke)==-1&&Va(fe,hl)(fe.doc,Fh(ke),Ht);var Ue=me.style.cssText,vt=ae.wrapper.style.cssText,un=ae.wrapper.offsetParent.getBoundingClientRect();ae.wrapper.style.cssText="position: static",me.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(ie.clientY-un.top-5)+"px; left: "+(ie.clientX-un.left-5)+`px;
|
|
z-index: 1000; background: `+(mt?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var bt;at&&(bt=window.scrollY),ce.input.focus(),at&&window.scrollTo(null,bt),ce.input.reset(),fe.somethingSelected()||(me.value=ae.prevInput=" "),ae.contextMenuPending=Bn,ce.selForContextMenu=fe.doc.sel,clearTimeout(ce.detectingSelectAll);function Gn(){if(me.selectionStart!=null){var or=fe.somethingSelected(),Br="\u200B"+(or?me.value:"");me.value="\u21DA",me.value=Br,ae.prevInput=or?"":"\u200B",me.selectionStart=1,me.selectionEnd=Br.length,ce.selForContextMenu=fe.doc.sel}}function Bn(){if(ae.contextMenuPending==Bn&&(ae.contextMenuPending=!1,ae.wrapper.style.cssText=vt,me.style.cssText=Ue,mt&&Oe<9&&ce.scrollbars.setScrollTop(ce.scroller.scrollTop=Ze),me.selectionStart!=null)){(!mt||mt&&Oe<9)&&Gn();var or=0,Br=function(){ce.selForContextMenu==fe.doc.sel&&me.selectionStart==0&&me.selectionEnd>0&&ae.prevInput=="\u200B"?Va(fe,zs)(fe):or++<10?ce.detectingSelectAll=setTimeout(Br,500):(ce.selForContextMenu=null,ce.input.reset())};ce.detectingSelectAll=setTimeout(Br,200)}}if(mt&&Oe>=9&&Gn(),be){Ii(ie);var Ji=function(){nn(window,"mouseup",Ji),setTimeout(Bn,20)};Mn(window,"mouseup",Ji)}else setTimeout(Bn,50)},Js.prototype.readOnlyChanged=function(ie){ie||this.reset(),this.textarea.disabled=ie=="nocursor",this.textarea.readOnly=!!ie},Js.prototype.setUneditable=function(){},Js.prototype.needsContentAttribute=!1;function np(ie,ae){if(ae=ae?Ot(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=St();ae.autofocus=fe==ie||ie.getAttribute("autofocus")!=null&&fe==document.body}function ce(){ie.value=Qe.getValue()}var me;if(ie.form&&(Mn(ie.form,"submit",ce),!ae.leaveSubmitMethodAlone)){var ke=ie.form;me=ke.submit;try{var Ze=ke.submit=function(){ce(),ke.submit=me,ke.submit(),ke.submit=Ze}}catch(Ue){}}ae.finishInit=function(Ue){Ue.save=ce,Ue.getTextArea=function(){return ie},Ue.toTextArea=function(){Ue.toTextArea=isNaN,ce(),ie.parentNode.removeChild(Ue.getWrapperElement()),ie.style.display="",ie.form&&(nn(ie.form,"submit",ce),!ae.leaveSubmitMethodAlone&&typeof ie.form.submit=="function"&&(ie.form.submit=me))}},ie.style.display="none";var Qe=Ua(function(Ue){return ie.parentNode.insertBefore(Ue,ie.nextSibling)},ae);return Qe}function Yh(ie){ie.off=nn,ie.on=Mn,ie.wheelEventPixels=au,ie.Doc=Ks,ie.splitLines=xr,ie.countColumn=ct,ie.findColumn=ii,ie.isWordChar=De,ie.Pass=zn,ie.signal=tn,ie.Line=No,ie.changeEnd=jh,ie.scrollbarModel=vu,ie.Pos=cn,ie.cmpPos=qt,ie.modes=_r,ie.mimeModes=$r,ie.resolveMode=Qn,ie.getMode=Bt,ie.modeExtensions=Tt,ie.extendMode=kt,ie.copyState=ui,ie.startState=vi,ie.innerMode=Yn,ie.commands=Gh,ie.keyMap=Ql,ie.keyName=eg,ie.isModifierKey=Lh,ie.lookupKey=uu,ie.normalizeKeyMap=qf,ie.StringStream=yn,ie.SharedTextMarker=Ku,ie.TextMarker=Zt,ie.LineWidget=Vu,ie.e_preventDefault=gi,ie.e_stopPropagation=Vi,ie.e_stop=Ii,ie.addClass=Lt,ie.contains=wt,ie.rmClass=Re,ie.keyNames=sh}qg(Ua),Kh(Ua);var hh="iter insert remove copy getEditor constructor".split(" ");for(var Fd in Ks.prototype)Ks.prototype.hasOwnProperty(Fd)&&gn(hh,Fd)<0&&(Ua.prototype[Fd]=function(ie){return function(){return ie.apply(this.doc,arguments)}}(Ks.prototype[Fd]));return Kt(Ks),Ua.inputStyles={textarea:Js,contenteditable:rs},Ua.defineMode=function(ie){!Ua.defaults.mode&&ie!="null"&&(Ua.defaults.mode=ie),po.apply(this,arguments)},Ua.defineMIME=fi,Ua.defineMode("null",function(){return{token:function(ie){return ie.skipToEnd()}}}),Ua.defineMIME("text/plain","null"),Ua.defineExtension=function(ie,ae){Ua.prototype[ie]=ae},Ua.defineDocExtension=function(ie,ae){Ks.prototype[ie]=ae},Ua.fromTextArea=np,Yh(Ua),Ua.version="5.58.2",Ua})},25419:function(Un,ai,Le){(function(ue){ue(Le(89780),Le(15525),Le(98101))})(function(ue){"use strict";ue.defineMode("markdown",function(Ke,ft){var yt=ue.getMode(Ke,"text/html"),mt=yt.name=="null";function Oe(ct){if(ue.findModeByName){var nt=ue.findModeByName(ct);nt&&(ct=nt.mime||nt.mimes[0])}var gn=ue.getMode(Ke,ct);return gn.name=="null"?null:gn}ft.highlightFormatting===void 0&&(ft.highlightFormatting=!1),ft.maxBlockquoteDepth===void 0&&(ft.maxBlockquoteDepth=0),ft.taskLists===void 0&&(ft.taskLists=!1),ft.strikethrough===void 0&&(ft.strikethrough=!1),ft.emoji===void 0&&(ft.emoji=!1),ft.fencedCodeBlockHighlighting===void 0&&(ft.fencedCodeBlockHighlighting=!0),ft.fencedCodeBlockDefaultMode===void 0&&(ft.fencedCodeBlockDefaultMode="text/plain"),ft.xml===void 0&&(ft.xml=!0),ft.tokenTypeOverrides===void 0&&(ft.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)&&ft.tokenTypeOverrides[Ct]&&(at[Ct]=ft.tokenTypeOverrides[Ct]);var dt=/^([*\-_])(?:\s*\1){2,}\s*$/,Ge=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,Rt=/^\[(x| )\](?=\s)/i,ot=ft.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,At=/^ {0,3}(?:\={1,}|-{2,})\s*$/,Te=/^[^#!\[\]*_\\<>` "'(~:]+/,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(ct,nt,gn){return nt.f=nt.inline=gn,gn(ct,nt)}function ye(ct,nt,gn){return nt.f=nt.block=gn,gn(ct,nt)}function we(ct){return!ct||!/\S/.test(ct.string)}function be(ct){if(ct.linkTitle=!1,ct.linkHref=!1,ct.linkText=!1,ct.em=!1,ct.strong=!1,ct.strikethrough=!1,ct.quote=0,ct.indentedCode=!1,ct.f==Re){var nt=mt;if(!nt){var gn=ue.innerMode(yt,ct.htmlState);nt=gn.mode.name=="xml"&&gn.state.tagStart===null&&!gn.state.context&&gn.state.tokenize.isInText}nt&&(ct.f=ut,ct.block=Ie,ct.htmlState=null)}return ct.trailingSpace=0,ct.trailingSpaceNewLine=!1,ct.prevLine=ct.thisLine,ct.thisLine={stream:null},null}function Ie(ct,nt){var gn=ct.column()===nt.indentation,oi=we(nt.prevLine.stream),zn=nt.indentedCode,Ht=nt.prevLine.hr,Fn=nt.list!==!1,Cn=(nt.listStack[nt.listStack.length-1]||0)+3;nt.indentedCode=!1;var ii=nt.indentation;if(nt.indentationDiff===null&&(nt.indentationDiff=nt.indentation,Fn)){for(nt.list=null;ii<nt.listStack[nt.listStack.length-1];)nt.listStack.pop(),nt.listStack.length?nt.indentation=nt.listStack[nt.listStack.length-1]:nt.list=!1;nt.list!==!1&&(nt.indentationDiff=ii-nt.listStack[nt.listStack.length-1])}var Wt=!oi&&!Ht&&!nt.prevLine.header&&(!Fn||!zn)&&!nt.prevLine.fencedCodeEnd,Hn=(nt.list===!1||Ht||oi)&&nt.indentation<=Cn&&ct.match(dt),lt=null;if(nt.indentationDiff>=4&&(zn||nt.prevLine.fencedCodeEnd||nt.prevLine.header||oi))return ct.skipToEnd(),nt.indentedCode=!0,at.code;if(ct.eatSpace())return null;if(gn&&nt.indentation<=Cn&&(lt=ct.match(ot))&<[1].length<=6)return nt.quote=0,nt.header=lt[1].length,nt.thisLine.header=!0,ft.highlightFormatting&&(nt.formatting="header"),nt.f=nt.inline,et(nt);if(nt.indentation<=Cn&&ct.eat(">"))return nt.quote=gn?1:nt.quote+1,ft.highlightFormatting&&(nt.formatting="quote"),ct.eatSpace(),et(nt);if(!Hn&&!nt.setext&&gn&&nt.indentation<=Cn&&(lt=ct.match(Ge))){var An=lt[1]?"ol":"ul";return nt.indentation=ii+ct.current().length,nt.list=!0,nt.quote=0,nt.listStack.push(nt.indentation),nt.em=!1,nt.strong=!1,nt.code=!1,nt.strikethrough=!1,ft.taskLists&&ct.match(Rt,!1)&&(nt.taskList=!0),nt.f=nt.inline,ft.highlightFormatting&&(nt.formatting=["list","list-"+An]),et(nt)}else{if(gn&&nt.indentation<=Cn&&(lt=ct.match(ne,!0)))return nt.quote=0,nt.fencedEndRE=new RegExp(lt[1]+"+ *$"),nt.localMode=ft.fencedCodeBlockHighlighting&&Oe(lt[2]||ft.fencedCodeBlockDefaultMode),nt.localMode&&(nt.localState=ue.startState(nt.localMode)),nt.f=nt.block=rt,ft.highlightFormatting&&(nt.formatting="code-block"),nt.code=-1,et(nt);if(nt.setext||(!Wt||!Fn)&&!nt.quote&&nt.list===!1&&!nt.code&&!Hn&&!te.test(ct.string)&&(lt=ct.lookAhead(1))&&(lt=lt.match(At)))return nt.setext?(nt.header=nt.setext,nt.setext=0,ct.skipToEnd(),ft.highlightFormatting&&(nt.formatting="header")):(nt.header=lt[0].charAt(0)=="="?1:2,nt.setext=nt.header),nt.thisLine.header=!0,nt.f=nt.inline,et(nt);if(Hn)return ct.skipToEnd(),nt.hr=!0,nt.thisLine.hr=!0,at.hr;if(ct.peek()==="[")return pe(ct,nt,mn)}return pe(ct,nt,nt.inline)}function Re(ct,nt){var gn=yt.token(ct,nt.htmlState);if(!mt){var oi=ue.innerMode(yt,nt.htmlState);(oi.mode.name=="xml"&&oi.state.tagStart===null&&!oi.state.context&&oi.state.tokenize.isInText||nt.md_inside&&ct.current().indexOf(">")>-1)&&(nt.f=ut,nt.block=Ie,nt.htmlState=null)}return gn}function rt(ct,nt){var gn=nt.listStack[nt.listStack.length-1]||0,oi=nt.indentation<gn,zn=gn+3;if(nt.fencedEndRE&&nt.indentation<=zn&&(oi||ct.match(nt.fencedEndRE))){ft.highlightFormatting&&(nt.formatting="code-block");var Ht;return oi||(Ht=et(nt)),nt.localMode=nt.localState=null,nt.block=Ie,nt.f=ut,nt.fencedEndRE=null,nt.code=0,nt.thisLine.fencedCodeEnd=!0,oi?ye(ct,nt,nt.block):Ht}else return nt.localMode?nt.localMode.token(ct,nt.localState):(ct.skipToEnd(),at.code)}function et(ct){var nt=[];if(ct.formatting){nt.push(at.formatting),typeof ct.formatting=="string"&&(ct.formatting=[ct.formatting]);for(var gn=0;gn<ct.formatting.length;gn++)nt.push(at.formatting+"-"+ct.formatting[gn]),ct.formatting[gn]==="header"&&nt.push(at.formatting+"-"+ct.formatting[gn]+"-"+ct.header),ct.formatting[gn]==="quote"&&(!ft.maxBlockquoteDepth||ft.maxBlockquoteDepth>=ct.quote?nt.push(at.formatting+"-"+ct.formatting[gn]+"-"+ct.quote):nt.push("error"))}if(ct.taskOpen)return nt.push("meta"),nt.length?nt.join(" "):null;if(ct.taskClosed)return nt.push("property"),nt.length?nt.join(" "):null;if(ct.linkHref?nt.push(at.linkHref,"url"):(ct.strong&&nt.push(at.strong),ct.em&&nt.push(at.em),ct.strikethrough&&nt.push(at.strikethrough),ct.emoji&&nt.push(at.emoji),ct.linkText&&nt.push(at.linkText),ct.code&&nt.push(at.code),ct.image&&nt.push(at.image),ct.imageAltText&&nt.push(at.imageAltText,"link"),ct.imageMarker&&nt.push(at.imageMarker)),ct.header&&nt.push(at.header,at.header+"-"+ct.header),ct.quote&&(nt.push(at.quote),!ft.maxBlockquoteDepth||ft.maxBlockquoteDepth>=ct.quote?nt.push(at.quote+"-"+ct.quote):nt.push(at.quote+"-"+ft.maxBlockquoteDepth)),ct.list!==!1){var oi=(ct.listStack.length-1)%3;oi?oi===1?nt.push(at.list2):nt.push(at.list3):nt.push(at.list1)}return ct.trailingSpaceNewLine?nt.push("trailing-space-new-line"):ct.trailingSpace&&nt.push("trailing-space-"+(ct.trailingSpace%2?"a":"b")),nt.length?nt.join(" "):null}function Ye(ct,nt){if(ct.match(Te,!0))return et(nt)}function ut(ct,nt){var gn=nt.text(ct,nt);if(typeof gn!="undefined")return gn;if(nt.list)return nt.list=null,et(nt);if(nt.taskList){var oi=ct.match(Rt,!0)[1]===" ";return oi?nt.taskOpen=!0:nt.taskClosed=!0,ft.highlightFormatting&&(nt.formatting="task"),nt.taskList=!1,et(nt)}if(nt.taskOpen=!1,nt.taskClosed=!1,nt.header&&ct.match(/^#+$/,!0))return ft.highlightFormatting&&(nt.formatting="header"),et(nt);var zn=ct.next();if(nt.linkTitle){nt.linkTitle=!1;var Ht=zn;zn==="("&&(Ht=")"),Ht=(Ht+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Fn="^\\s*(?:[^"+Ht+"\\\\]+|\\\\\\\\|\\\\.)"+Ht;if(ct.match(new RegExp(Fn),!0))return at.linkHref}if(zn==="`"){var Cn=nt.formatting;ft.highlightFormatting&&(nt.formatting="code"),ct.eatWhile("`");var ii=ct.current().length;if(nt.code==0&&(!nt.quote||ii==1))return nt.code=ii,et(nt);if(ii==nt.code){var Wt=et(nt);return nt.code=0,Wt}else return nt.formatting=Cn,et(nt)}else if(nt.code)return et(nt);if(zn==="\\"&&(ct.next(),ft.highlightFormatting)){var Hn=et(nt),lt=at.formatting+"-escape";return Hn?Hn+" "+lt:lt}if(zn==="!"&&ct.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return nt.imageMarker=!0,nt.image=!0,ft.highlightFormatting&&(nt.formatting="image"),et(nt);if(zn==="["&&nt.imageMarker&&ct.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return nt.imageMarker=!1,nt.imageAltText=!0,ft.highlightFormatting&&(nt.formatting="image"),et(nt);if(zn==="]"&&nt.imageAltText){ft.highlightFormatting&&(nt.formatting="image");var Hn=et(nt);return nt.imageAltText=!1,nt.image=!1,nt.inline=nt.f=wt,Hn}if(zn==="["&&!nt.image)return nt.linkText&&ct.match(/^.*?\]/)||(nt.linkText=!0,ft.highlightFormatting&&(nt.formatting="link")),et(nt);if(zn==="]"&&nt.linkText){ft.highlightFormatting&&(nt.formatting="link");var Hn=et(nt);return nt.linkText=!1,nt.inline=nt.f=ct.match(/\(.*?\)| ?\[.*?\]/,!1)?wt:ut,Hn}if(zn==="<"&&ct.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){nt.f=nt.inline=tt,ft.highlightFormatting&&(nt.formatting="link");var Hn=et(nt);return Hn?Hn+=" ":Hn="",Hn+at.linkInline}if(zn==="<"&&ct.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){nt.f=nt.inline=tt,ft.highlightFormatting&&(nt.formatting="link");var Hn=et(nt);return Hn?Hn+=" ":Hn="",Hn+at.linkEmail}if(ft.xml&&zn==="<"&&ct.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var An=ct.string.indexOf(">",ct.pos);if(An!=-1){var Ni=ct.string.substring(ct.start,An);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Ni)&&(nt.md_inside=!0)}return ct.backUp(1),nt.htmlState=ue.startState(yt),ye(ct,nt,Re)}if(ft.xml&&zn==="<"&&ct.match(/^\/\w*?>/))return nt.md_inside=!1,"tag";if(zn==="*"||zn==="_"){for(var je=1,Me=ct.pos==1?" ":ct.string.charAt(ct.pos-2);je<3&&ct.eat(zn);)je++;var Ee=ct.peek()||" ",De=!/\s/.test(Ee)&&(!de.test(Ee)||/\s/.test(Me)||de.test(Me)),We=!/\s/.test(Me)&&(!de.test(Me)||/\s/.test(Ee)||de.test(Ee)),Ae=null,Je=null;if(je%2&&(!nt.em&&De&&(zn==="*"||!We||de.test(Me))?Ae=!0:nt.em==zn&&We&&(zn==="*"||!De||de.test(Ee))&&(Ae=!1)),je>1&&(!nt.strong&&De&&(zn==="*"||!We||de.test(Me))?Je=!0:nt.strong==zn&&We&&(zn==="*"||!De||de.test(Ee))&&(Je=!1)),Je!=null||Ae!=null){ft.highlightFormatting&&(nt.formatting=Ae==null?"strong":Je==null?"em":"strong em"),Ae===!0&&(nt.em=zn),Je===!0&&(nt.strong=zn);var Wt=et(nt);return Ae===!1&&(nt.em=!1),Je===!1&&(nt.strong=!1),Wt}}else if(zn===" "&&(ct.eat("*")||ct.eat("_"))){if(ct.peek()===" ")return et(nt);ct.backUp(1)}if(ft.strikethrough){if(zn==="~"&&ct.eatWhile(zn)){if(nt.strikethrough){ft.highlightFormatting&&(nt.formatting="strikethrough");var Wt=et(nt);return nt.strikethrough=!1,Wt}else if(ct.match(/^[^\s]/,!1))return nt.strikethrough=!0,ft.highlightFormatting&&(nt.formatting="strikethrough"),et(nt)}else if(zn===" "&&ct.match(/^~~/,!0)){if(ct.peek()===" ")return et(nt);ct.backUp(2)}}if(ft.emoji&&zn===":"&&ct.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){nt.emoji=!0,ft.highlightFormatting&&(nt.formatting="emoji");var Nt=et(nt);return nt.emoji=!1,Nt}return zn===" "&&(ct.match(/^ +$/,!1)?nt.trailingSpace++:nt.trailingSpace&&(nt.trailingSpaceNewLine=!0)),et(nt)}function tt(ct,nt){var gn=ct.next();if(gn===">"){nt.f=nt.inline=ut,ft.highlightFormatting&&(nt.formatting="link");var oi=et(nt);return oi?oi+=" ":oi="",oi+at.linkInline}return ct.match(/^[^>]+/,!0),at.linkInline}function wt(ct,nt){if(ct.eatSpace())return null;var gn=ct.next();return gn==="("||gn==="["?(nt.f=nt.inline=Lt(gn==="("?")":"]"),ft.highlightFormatting&&(nt.formatting="link-string"),nt.linkHref=!0,et(nt)):"error"}var St={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function Lt(ct){return function(nt,gn){var oi=nt.next();if(oi===ct){gn.f=gn.inline=ut,ft.highlightFormatting&&(gn.formatting="link-string");var zn=et(gn);return gn.linkHref=!1,zn}return nt.match(St[ct]),gn.linkHref=!0,et(gn)}}function mn(ct,nt){return ct.match(/^([^\]\\]|\\.)*\]:/,!1)?(nt.f=$t,ct.next(),ft.highlightFormatting&&(nt.formatting="link"),nt.linkText=!0,et(nt)):pe(ct,nt,ut)}function $t(ct,nt){if(ct.match(/^\]:/,!0)){nt.f=nt.inline=Pn,ft.highlightFormatting&&(nt.formatting="link");var gn=et(nt);return nt.linkText=!1,gn}return ct.match(/^([^\]\\]|\\.)+/,!0),at.linkText}function Pn(ct,nt){return ct.eatSpace()?null:(ct.match(/^[^\s]+/,!0),ct.peek()===void 0?nt.linkTitle=!0:ct.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),nt.f=nt.inline=ut,at.linkHref+" url")}var Ot={startState:function(){return{f:Ie,prevLine:{stream:null},thisLine:{stream:null},block:Ie,htmlState:null,indentation:0,inline:ut,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(ct){return{f:ct.f,prevLine:ct.prevLine,thisLine:ct.thisLine,block:ct.block,htmlState:ct.htmlState&&ue.copyState(yt,ct.htmlState),indentation:ct.indentation,localMode:ct.localMode,localState:ct.localMode?ue.copyState(ct.localMode,ct.localState):null,inline:ct.inline,text:ct.text,formatting:!1,linkText:ct.linkText,linkTitle:ct.linkTitle,linkHref:ct.linkHref,code:ct.code,em:ct.em,strong:ct.strong,strikethrough:ct.strikethrough,emoji:ct.emoji,header:ct.header,setext:ct.setext,hr:ct.hr,taskList:ct.taskList,list:ct.list,listStack:ct.listStack.slice(0),quote:ct.quote,indentedCode:ct.indentedCode,trailingSpace:ct.trailingSpace,trailingSpaceNewLine:ct.trailingSpaceNewLine,md_inside:ct.md_inside,fencedEndRE:ct.fencedEndRE}},token:function(ct,nt){if(nt.formatting=!1,ct!=nt.thisLine.stream){if(nt.header=0,nt.hr=!1,ct.match(/^\s*$/,!0))return be(nt),null;if(nt.prevLine=nt.thisLine,nt.thisLine={stream:ct},nt.taskList=!1,nt.trailingSpace=0,nt.trailingSpaceNewLine=!1,!nt.localState&&(nt.f=nt.block,nt.f!=Re)){var gn=ct.match(/^\s*/,!0)[0].replace(/\t/g,se).length;if(nt.indentation=gn,nt.indentationDiff=null,gn>0)return null}}return nt.f(ct,nt)},innerMode:function(ct){return ct.block==Re?{state:ct.htmlState,mode:yt}:ct.localState?{state:ct.localState,mode:ct.localMode}:{state:ct,mode:Ot}},indent:function(ct,nt,gn){return ct.block==Re&&yt.indent?yt.indent(ct.htmlState,nt,gn):ct.localState&&ct.localMode.indent?ct.localMode.indent(ct.localState,nt,gn):ue.Pass},blankLine:be,getType:et,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return Ot},"xml"),ue.defineMIME("text/markdown","markdown"),ue.defineMIME("text/x-markdown","markdown")})},98101:function(Un,ai,Le){(function(ue){ue(Le(89780))})(function(ue){"use strict";ue.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 Ke=0;Ke<ue.modeInfo.length;Ke++){var ft=ue.modeInfo[Ke];ft.mimes&&(ft.mime=ft.mimes[0])}ue.findModeByMIME=function(yt){yt=yt.toLowerCase();for(var mt=0;mt<ue.modeInfo.length;mt++){var Oe=ue.modeInfo[mt];if(Oe.mime==yt)return Oe;if(Oe.mimes){for(var at=0;at<Oe.mimes.length;at++)if(Oe.mimes[at]==yt)return Oe}}if(/\+xml$/.test(yt))return ue.findModeByMIME("application/xml");if(/\+json$/.test(yt))return ue.findModeByMIME("application/json")},ue.findModeByExtension=function(yt){yt=yt.toLowerCase();for(var mt=0;mt<ue.modeInfo.length;mt++){var Oe=ue.modeInfo[mt];if(Oe.ext){for(var at=0;at<Oe.ext.length;at++)if(Oe.ext[at]==yt)return Oe}}},ue.findModeByFileName=function(yt){for(var mt=0;mt<ue.modeInfo.length;mt++){var Oe=ue.modeInfo[mt];if(Oe.file&&Oe.file.test(yt))return Oe}var at=yt.lastIndexOf("."),Ct=at>-1&&yt.substring(at+1,yt.length);if(Ct)return ue.findModeByExtension(Ct)},ue.findModeByName=function(yt){yt=yt.toLowerCase();for(var mt=0;mt<ue.modeInfo.length;mt++){var Oe=ue.modeInfo[mt];if(Oe.name.toLowerCase()==yt)return Oe;if(Oe.alias){for(var at=0;at<Oe.alias.length;at++)if(Oe.alias[at].toLowerCase()==yt)return Oe}}}})},67549:function(Un,ai,Le){(function(ue){ue(Le(89780))})(function(ue){"use strict";ue.defineMode("stex",function(Ke,ft){"use strict";function yt(Te,ne){Te.cmdState.push(ne)}function mt(Te){return Te.cmdState.length>0?Te.cmdState[Te.cmdState.length-1]:null}function Oe(Te){var ne=Te.cmdState.pop();ne&&ne.closeBracket()}function at(Te){for(var ne=Te.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(Te,ne,te){return function(){this.name=Te,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 dt={};dt.importmodule=Ct("importmodule","tag",["string","builtin"]),dt.documentclass=Ct("documentclass","tag",["","atom"]),dt.usepackage=Ct("usepackage","tag",["atom"]),dt.begin=Ct("begin","tag",["atom"]),dt.end=Ct("end","tag",["atom"]),dt.label=Ct("label","tag",["atom"]),dt.ref=Ct("ref","tag",["atom"]),dt.eqref=Ct("eqref","tag",["atom"]),dt.cite=Ct("cite","tag",["atom"]),dt.bibitem=Ct("bibitem","tag",["atom"]),dt.Bibitem=Ct("Bibitem","tag",["atom"]),dt.RBibitem=Ct("RBibitem","tag",["atom"]),dt.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function Ge(Te,ne){Te.f=ne}function Rt(Te,ne){var te;if(Te.match(/^\\[a-zA-Z@]+/)){var de=Te.current().slice(1);return te=dt.hasOwnProperty(de)?dt[de]:dt.DEFAULT,te=new te,yt(ne,te),Ge(ne,At),te.style}if(Te.match(/^\\[$&%#{}_]/)||Te.match(/^\\[,;!\/\\]/))return"tag";if(Te.match("\\["))return Ge(ne,function(pe,ye){return ot(pe,ye,"\\]")}),"keyword";if(Te.match("\\("))return Ge(ne,function(pe,ye){return ot(pe,ye,"\\)")}),"keyword";if(Te.match("$$"))return Ge(ne,function(pe,ye){return ot(pe,ye,"$$")}),"keyword";if(Te.match("$"))return Ge(ne,function(pe,ye){return ot(pe,ye,"$")}),"keyword";var se=Te.next();if(se=="%")return Te.skipToEnd(),"comment";if(se=="}"||se=="]"){if(te=mt(ne),te)te.closeBracket(se),Ge(ne,At);else return"error";return"bracket"}else return se=="{"||se=="["?(te=dt.DEFAULT,te=new te,yt(ne,te),"bracket"):/\d/.test(se)?(Te.eatWhile(/[\w.%]/),"atom"):(Te.eatWhile(/[\w\-_]/),te=at(ne),te.name=="begin"&&(te.argument=Te.current()),te.styleIdentifier())}function ot(Te,ne,te){if(Te.eatSpace())return null;if(te&&Te.match(te))return Ge(ne,Rt),"keyword";if(Te.match(/^\\[a-zA-Z@]+/))return"tag";if(Te.match(/^[a-zA-Z]+/))return"variable-2";if(Te.match(/^\\[$&%#{}_]/)||Te.match(/^\\[,;!\/]/)||Te.match(/^[\^_&]/))return"tag";if(Te.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(Te.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var de=Te.next();return de=="{"||de=="}"||de=="["||de=="]"||de=="("||de==")"?"bracket":de=="%"?(Te.skipToEnd(),"comment"):"error"}function At(Te,ne){var te=Te.peek(),de;return te=="{"||te=="["?(de=mt(ne),de.openBracket(te),Te.eat(te),Ge(ne,Rt),"bracket"):/[ \t\r]/.test(te)?(Te.eat(te),null):(Ge(ne,Rt),Oe(ne),Rt(Te,ne))}return{startState:function(){var Te=ft.inMathMode?function(ne,te){return ot(ne,te)}:Rt;return{cmdState:[],f:Te}},copyState:function(Te){return{cmdState:Te.cmdState.slice(),f:Te.f}},token:function(Te,ne){return ne.f(Te,ne)},blankLine:function(Te){Te.f=Rt,Te.cmdState.length=0},lineComment:"%"}}),ue.defineMIME("text/x-stex","stex"),ue.defineMIME("text/x-latex","stex")})},15525:function(Un,ai,Le){(function(ue){ue(Le(89780))})(function(ue){"use strict";var Ke={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},ft={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ue.defineMode("xml",function(yt,mt){var Oe=yt.indentUnit,at={},Ct=mt.htmlMode?Ke:ft;for(var dt in Ct)at[dt]=Ct[dt];for(var dt in mt)at[dt]=mt[dt];var Ge,Rt;function ot(tt,wt){function St($t){return wt.tokenize=$t,$t(tt,wt)}var Lt=tt.next();if(Lt=="<")return tt.eat("!")?tt.eat("[")?tt.match("CDATA[")?St(ne("atom","]]>")):null:tt.match("--")?St(ne("comment","-->")):tt.match("DOCTYPE",!0,!0)?(tt.eatWhile(/[\w\._\-]/),St(te(1))):null:tt.eat("?")?(tt.eatWhile(/[\w\._\-]/),wt.tokenize=ne("meta","?>"),"meta"):(Ge=tt.eat("/")?"closeTag":"openTag",wt.tokenize=At,"tag bracket");if(Lt=="&"){var mn;return tt.eat("#")?tt.eat("x")?mn=tt.eatWhile(/[a-fA-F\d]/)&&tt.eat(";"):mn=tt.eatWhile(/[\d]/)&&tt.eat(";"):mn=tt.eatWhile(/[\w\.\-:]/)&&tt.eat(";"),mn?"atom":"error"}else return tt.eatWhile(/[^&<]/),null}ot.isInText=!0;function At(tt,wt){var St=tt.next();if(St==">"||St=="/"&&tt.eat(">"))return wt.tokenize=ot,Ge=St==">"?"endTag":"selfcloseTag","tag bracket";if(St=="=")return Ge="equals",null;if(St=="<"){wt.tokenize=ot,wt.state=ye,wt.tagName=wt.tagStart=null;var Lt=wt.tokenize(tt,wt);return Lt?Lt+" tag error":"tag error"}else return/[\'\"]/.test(St)?(wt.tokenize=Te(St),wt.stringStartCol=tt.column(),wt.tokenize(tt,wt)):(tt.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function Te(tt){var wt=function(St,Lt){for(;!St.eol();)if(St.next()==tt){Lt.tokenize=At;break}return"string"};return wt.isInAttribute=!0,wt}function ne(tt,wt){return function(St,Lt){for(;!St.eol();){if(St.match(wt)){Lt.tokenize=ot;break}St.next()}return tt}}function te(tt){return function(wt,St){for(var Lt;(Lt=wt.next())!=null;){if(Lt=="<")return St.tokenize=te(tt+1),St.tokenize(wt,St);if(Lt==">")if(tt==1){St.tokenize=ot;break}else return St.tokenize=te(tt-1),St.tokenize(wt,St)}return"meta"}}function de(tt,wt,St){this.prev=tt.context,this.tagName=wt,this.indent=tt.indented,this.startOfLine=St,(at.doNotIndent.hasOwnProperty(wt)||tt.context&&tt.context.noIndent)&&(this.noIndent=!0)}function se(tt){tt.context&&(tt.context=tt.context.prev)}function pe(tt,wt){for(var St;;){if(!tt.context||(St=tt.context.tagName,!at.contextGrabbers.hasOwnProperty(St)||!at.contextGrabbers[St].hasOwnProperty(wt)))return;se(tt)}}function ye(tt,wt,St){return tt=="openTag"?(St.tagStart=wt.column(),we):tt=="closeTag"?be:ye}function we(tt,wt,St){return tt=="word"?(St.tagName=wt.current(),Rt="tag",rt):at.allowMissingTagName&&tt=="endTag"?(Rt="tag bracket",rt(tt,wt,St)):(Rt="error",we)}function be(tt,wt,St){if(tt=="word"){var Lt=wt.current();return St.context&&St.context.tagName!=Lt&&at.implicitlyClosed.hasOwnProperty(St.context.tagName)&&se(St),St.context&&St.context.tagName==Lt||at.matchClosing===!1?(Rt="tag",Ie):(Rt="tag error",Re)}else return at.allowMissingTagName&&tt=="endTag"?(Rt="tag bracket",Ie(tt,wt,St)):(Rt="error",Re)}function Ie(tt,wt,St){return tt!="endTag"?(Rt="error",Ie):(se(St),ye)}function Re(tt,wt,St){return Rt="error",Ie(tt,wt,St)}function rt(tt,wt,St){if(tt=="word")return Rt="attribute",et;if(tt=="endTag"||tt=="selfcloseTag"){var Lt=St.tagName,mn=St.tagStart;return St.tagName=St.tagStart=null,tt=="selfcloseTag"||at.autoSelfClosers.hasOwnProperty(Lt)?pe(St,Lt):(pe(St,Lt),St.context=new de(St,Lt,mn==St.indented)),ye}return Rt="error",rt}function et(tt,wt,St){return tt=="equals"?Ye:(at.allowMissing||(Rt="error"),rt(tt,wt,St))}function Ye(tt,wt,St){return tt=="string"?ut:tt=="word"&&at.allowUnquoted?(Rt="string",rt):(Rt="error",rt(tt,wt,St))}function ut(tt,wt,St){return tt=="string"?ut:rt(tt,wt,St)}return{startState:function(tt){var wt={tokenize:ot,state:ye,indented:tt||0,tagName:null,tagStart:null,context:null};return tt!=null&&(wt.baseIndent=tt),wt},token:function(tt,wt){if(!wt.tagName&&tt.sol()&&(wt.indented=tt.indentation()),tt.eatSpace())return null;Ge=null;var St=wt.tokenize(tt,wt);return(St||Ge)&&St!="comment"&&(Rt=null,wt.state=wt.state(Ge||St,tt,wt),Rt&&(St=Rt=="error"?St+" error":Rt)),St},indent:function(tt,wt,St){var Lt=tt.context;if(tt.tokenize.isInAttribute)return tt.tagStart==tt.indented?tt.stringStartCol+1:tt.indented+Oe;if(Lt&&Lt.noIndent)return ue.Pass;if(tt.tokenize!=At&&tt.tokenize!=ot)return St?St.match(/^(\s*)/)[0].length:0;if(tt.tagName)return at.multilineTagIndentPastTag!==!1?tt.tagStart+tt.tagName.length+2:tt.tagStart+Oe*(at.multilineTagIndentFactor||1);if(at.alignCDATA&&/<!\[CDATA\[/.test(wt))return 0;var mn=wt&&/^<(\/)?([\w_:\.-]*)/.exec(wt);if(mn&&mn[1])for(;Lt;)if(Lt.tagName==mn[2]){Lt=Lt.prev;break}else if(at.implicitlyClosed.hasOwnProperty(Lt.tagName))Lt=Lt.prev;else break;else if(mn)for(;Lt;){var $t=at.contextGrabbers[Lt.tagName];if($t&&$t.hasOwnProperty(mn[2]))Lt=Lt.prev;else break}for(;Lt&&Lt.prev&&!Lt.startOfLine;)Lt=Lt.prev;return Lt?Lt.indent+Oe:tt.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:at.htmlMode?"html":"xml",helperType:at.htmlMode?"html":"xml",skipAttribute:function(tt){tt.state==Ye&&(tt.state=rt)},xmlCurrentTag:function(tt){return tt.tagName?{name:tt.tagName,close:tt.type=="closeTag"}:null},xmlCurrentContext:function(tt){for(var wt=[],St=tt.context;St;St=St.prev)St.tagName&&wt.push(St.tagName);return wt.reverse()}}}),ue.defineMIME("text/xml","xml"),ue.defineMIME("application/xml","xml"),ue.mimeModes.hasOwnProperty("text/html")||ue.defineMIME("text/html",{name:"xml",htmlMode:!0})})},12378:function(Un,ai,Le){"use strict";Le.d(ai,{$u:function(){return dt},BD:function(){return je},E9:function(){return Ct},FF:function(){return si},FJ:function(){return ye},Hn:function(){return pe},KX:function(){return be},NB:function(){return Ft},S0:function(){return lt},UL:function(){return Ge},Vk:function(){return se},Vm:function(){return jt},YI:function(){return An},ZA:function(){return ft},Zt:function(){return Rt},al:function(){return Ae},bn:function(){return We},bx:function(){return Me},g2:function(){return Ni},h1:function(){return Ye},hD:function(){return Kt},l4:function(){return Oe},rU:function(){return Jt},s_:function(){return Ee},uz:function(){return vn},z6:function(){return ot}}),Un=Le.hmd(Un),function(){var Ce;function _n(a){var y=0;return function(){return y<a.length?{done:!1,value:a[y++]}:{done:!0}}}function ci(a){var y=typeof Symbol!="undefined"&&Symbol.iterator&&a[Symbol.iterator];return y?y.call(a):{next:_n(a)}}function ar(a){for(var y,x=[];!(y=a.next()).done;)x.push(y.value);return x}var _r=typeof Object.create=="function"?Object.create:function(a){function y(){}return y.prototype=a,new y},$r;if(typeof Object.setPrototypeOf=="function")$r=Object.setPrototypeOf;else{var po;e:{var fi={a:!0},Qn={};try{Qn.__proto__=fi,po=Qn.a;break e}catch(a){}po=!1}$r=po?function(a,y){if(a.__proto__=y,a.__proto__!==y)throw new TypeError(a+" is not extensible");return a}:null}var Bt=$r;function Tt(a,y){if(a.prototype=_r(y.prototype),a.prototype.constructor=a,Bt)Bt(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 kt=typeof Le.g!="undefined"&&Le.g!=null?Le.g:self,ui=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},Yn=typeof Object.defineProperties=="function"?Object.defineProperty:function(a,y,x){a!=Array.prototype&&a!=Object.prototype&&(a[y]=x.value)};function vi(a,y){if(y){var x=kt;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&&Yn(x,a,{writable:!0,value:y})}}vi("Object.assign",function(a){return a||ui}),vi("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 yn=typeof globalThis=="object"&&globalThis||typeof Le.g=="object"&&Le.g.global===Le.g&&Le.g||typeof self=="object"&&self.self===self&&self||{};yn.requestAnimationFrame===void 0&&(yn.setImmediate===void 0?yn.requestAnimationFrame=function(a){yn.setTimeout(a,0)}:yn.requestAnimationFrame=yn.setImmediate);function Kn(){}function It(a,y){var x=-1;return function(){var E=this,b=arguments;x!==-1&&yn.clearTimeout(x),x=_t(function(){x=-1,a.apply(E,b)},y)}}function _t(a,y){return yn.setTimeout(a,y)}function hi(a){return yn.document.createElement(a)}function it(a){throw Error(a)}function sn(a,y){a="The object is frozen, so its properties cannot be set: "+a.toString(),y!==void 0&&(a+=" to value: "+y),it(a)}function Dn(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),it(x+" is not in the range "+y+": "+a)}function Di(a){yn.console&&yn.console.log(a)}function cn(a){return typeof a=="object"&&a!==null}function qt(a){return Array.isArray(a)||yn.NodeList&&a instanceof yn.NodeList||yn.HTMLCollection&&a instanceof yn.HTMLCollection}function an(a){return Array.prototype.slice.call(a)}function Gi(a,y,x){Array.isArray(a)?y>=a.length?a.push(x):a.splice(y,0,x):it("Cannot insert an object into an HTMLCollection or NodeList: "+x+" at "+y)}function ur(a,y){Array.isArray(a)?y>=a.length?a.pop():a.splice(y,1):it("Cannot remove an object from an HTMLCollection or NodeList at "+y)}function Hi(){var a=mo.pop();return a===void 0?[]:a}function Mi(a){a.length=0,mo.push(a)}function Ri(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(cn(a)&&a.constructor)return Ri(a.constructor);return typeof a}function dr(a){var y=a;return cn(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 Er(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 Ar(a,y,x){Object.defineProperty(Eo.prototype,a,{get:y,set:x})}function wn(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 Yo=yn.navigator!==void 0&&0<yn.navigator.userAgent.indexOf("Trident/7"),zr=yn.navigator!==void 0&&yn.navigator.platform!==void 0&&yn.navigator.platform.match(/(iPhone|iPod|iPad|Mac)/i)!==null,mo=[];Object.freeze([]),Kn.className="Util",Kn.Dx="32ab5ff3b26f42dc0ed90f21472913b5",Kn.adym="gojs.net",Kn.vfo="28e645fdb266",Kn.className="Util";function en(a,y,x){wr(this),this.j=a,this.xa=y,this.o=x}en.prototype.toString=function(){return"EnumValue."+this.xa};function li(a,y){return y==null||y===""?null:a[y]}kt.Object.defineProperties(en.prototype,{classType:{get:function(){return this.j}},name:{get:function(){return this.xa}},value:{get:function(){return this.o}}}),en.className="EnumValue";function nr(){this.ew=[]}nr.prototype.toString=function(){return this.ew.join("")},nr.prototype.add=function(a){a!==""&&this.ew.push(a)},nr.className="StringBuilder";function Sr(){}Sr.className="PropertyCollection";var vr={EA:!1,JA:!1,GA:!1,IA:!1,NA:!1,LA:!1,nx:!1,FA:null,trace:function(a){yn.console&&yn.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 Ir(){}Ir.prototype.reset=function(){},Ir.prototype.next=function(){return!1},Ir.prototype.Ad=function(){return!1},Ir.prototype.first=function(){return null},Ir.prototype.any=function(){return!1},Ir.prototype.all=function(){return!0},Ir.prototype.each=function(){return this},Ir.prototype.map=function(){return this},Ir.prototype.filter=function(){return this},Ir.prototype.de=function(){},Ir.prototype.toString=function(){return"EmptyIterator"},kt.Object.defineProperties(Ir.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 0}}}),Ir.prototype.first=Ir.prototype.first,Ir.prototype.hasNext=Ir.prototype.Ad,Ir.prototype.next=Ir.prototype.next,Ir.prototype.reset=Ir.prototype.reset;var bo=null;Ir.className="EmptyIterator",bo=new Ir;function fo(a){this.key=-1,this.value=a}fo.prototype.reset=function(){this.key=-1},fo.prototype.next=function(){return this.key===-1?(this.key=0,!0):!1},fo.prototype.Ad=function(){return this.next()},fo.prototype.first=function(){return this.key=0,this.value},fo.prototype.any=function(a){return this.key=-1,a(this.value)},fo.prototype.all=function(a){return this.key=-1,a(this.value)},fo.prototype.each=function(a){return this.key=-1,a(this.value),this},fo.prototype.map=function(a){return new fo(a(this.value))},fo.prototype.filter=function(a){return a(this.value)?new fo(this.value):bo},fo.prototype.de=function(){this.value=null},fo.prototype.toString=function(){return"SingletonIterator("+this.value+")"},kt.Object.defineProperties(fo.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 1}}}),fo.prototype.first=fo.prototype.first,fo.prototype.hasNext=fo.prototype.Ad,fo.prototype.next=fo.prototype.next,fo.prototype.reset=fo.prototype.reset,fo.className="SingletonIterator";function so(a){this.Bb=a,this.qf=null,a.Sa=null,this.qa=a.Ja,this.Za=-1}so.prototype.reset=function(){var a=this.Bb;a.Sa=null,this.qa=a.Ja,this.Za=-1},so.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},so.prototype.Ad=function(){return this.next()},so.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},so.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},so.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},so.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},so.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 Tn,a.s=x,a.xb(),a.iterator},so.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 Tn,a.s=x,a.xb(),a.iterator},so.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.qf=null,this.Bb.Sa=this},so.prototype.toString=function(){return"ListIterator@"+this.Za+"/"+this.Bb.count},kt.Object.defineProperties(so.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}}}),so.prototype.first=so.prototype.first,so.prototype.hasNext=so.prototype.Ad,so.prototype.next=so.prototype.next,so.prototype.reset=so.prototype.reset,so.className="ListIterator";function lo(a){this.Bb=a,a.Hg=null,this.qa=a.Ja,this.Za=a.s.length}lo.prototype.reset=function(){var a=this.Bb;a.Hg=null,this.qa=a.Ja,this.Za=a.s.length},lo.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)},lo.prototype.Ad=function(){return this.next()},lo.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},lo.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},lo.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},lo.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},lo.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 Tn,a.s=x,a.xb(),a.iterator},lo.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 Tn,a.s=x,a.xb(),a.iterator},lo.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.Bb.Hg=this},lo.prototype.toString=function(){return"ListIteratorBackwards("+this.Za+"/"+this.Bb.count+")"},kt.Object.defineProperties(lo.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.Bb.s.length}}}),lo.prototype.first=lo.prototype.first,lo.prototype.hasNext=lo.prototype.Ad,lo.prototype.next=lo.prototype.next,lo.prototype.reset=lo.prototype.reset,lo.className="ListIteratorBackwards";function Tn(a){wr(this),this._isFrozen=!1,this.s=[],this.Ja=0,this.Hg=this.Sa=null,typeof a=="string"&&it("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}Ce=Tn.prototype,Ce.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},Ce.freeze=function(){return this._isFrozen=!0,this},Ce.ka=function(){return this._isFrozen=!1,this},Ce.toString=function(){return"List()#"+hr(this)},Ce.add=function(a){return a===null?this:(this._isFrozen&&sn(this,a),this.s.push(a),this.xb(),this)},Ce.push=function(a){this.add(a)},Ce.addAll=function(a){if(a===null)return this;this._isFrozen&&sn(this);var y=this.s;if(qt(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},Ce.clear=function(){this._isFrozen&&sn(this),this.s.length=0,this.xb()},Ce.contains=function(a){return a===null?!1:this.s.indexOf(a)!==-1},Ce.has=function(a){return this.contains(a)},Ce.indexOf=function(a){return a===null?-1:this.s.indexOf(a)},Ce.M=function(a){var y=this.s;return(0>a||a>=y.length)&&Dn(a,"0 <= i < length",Tn,"elt:i"),y[a]},Ce.get=function(a){return this.M(a)},Ce.cd=function(a,y){var x=this.s;(0>a||a>=x.length)&&Dn(a,"0 <= i < length",Tn,"setElt:i"),this._isFrozen&&sn(this,a),x[a]=y},Ce.set=function(a,y){this.cd(a,y)},Ce.first=function(){var a=this.s;return a.length===0?null:a[0]},Ce.jc=function(){var a=this.s,y=a.length;return 0<y?a[y-1]:null},Ce.pop=function(){this._isFrozen&&sn(this);var a=this.s;return 0<a.length?a.pop():null},Tn.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},Tn.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},Tn.prototype.each=function(a){for(var y=this.s,x=y.length,E=0;E<x;E++)a(y[E]);return this},Tn.prototype.map=function(a){for(var y=new Tn,x=[],E=this.s,b=E.length,z=0;z<b;z++)x.push(a(E[z]));return y.s=x,y.xb(),y},Tn.prototype.filter=function(a){for(var y=new Tn,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},Ce=Tn.prototype,Ce.Gb=function(a,y){0>a&&Dn(a,">= 0",Tn,"insertAt:i"),this._isFrozen&&sn(this,a);var x=this.s;a>=x.length?x.push(y):x.splice(a,0,y),this.xb()},Ce.remove=function(a){if(a===null)return!1;this._isFrozen&&sn(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)},Ce.delete=function(a){return this.remove(a)},Ce.mb=function(a){var y=this.s;(0>a||a>=y.length)&&Dn(a,"0 <= i < length",Tn,"removeAt:i"),this._isFrozen&&sn(this,a),a===y.length-1?y.pop():y.splice(a,1),this.xb()},Ce.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&&sn(this);for(var b=a,z=y+1;z<E;)x[b++]=x[z++];return x.length=E-(y-a+1),this.xb(),this},Tn.prototype.copy=function(){var a=new Tn,y=this.s;return 0<y.length&&(a.s=Array.prototype.slice.call(y)),a},Ce=Tn.prototype,Ce.Fa=function(){for(var a=this.s,y=this.count,x=Array(y),E=0;E<y;E++)x[E]=a[E];return x},Ce.Iv=function(){for(var a=new Zn,y=this.s,x=this.count,E=0;E<x;E++)a.add(y[E]);return a},Ce.sort=function(a){return this._isFrozen&&sn(this),this.s.sort(a),this.xb(),this},Ce.zi=function(a,y,x){var E=this.s,b=E.length;y===void 0&&(y=0),x===void 0&&(x=b),this._isFrozen&&sn(this);var z=x-y;if(1>=z)return this;if((0>y||y>=b-1)&&Dn(y,"0 <= from < length",Tn,"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},Ce.reverse=function(){return this._isFrozen&&sn(this),this.s.reverse(),this.xb(),this},kt.Object.defineProperties(Tn.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 bo;var a=this.Sa;return a!==null?(a.reset(),a):new so(this)}},iteratorBackwards:{get:function(){if(0>=this.s.length)return bo;var a=this.Hg;return a!==null?(a.reset(),a):new lo(this)}}}),Tn.prototype.reverse=Tn.prototype.reverse,Tn.prototype.sortRange=Tn.prototype.zi,Tn.prototype.sort=Tn.prototype.sort,Tn.prototype.toSet=Tn.prototype.Iv,Tn.prototype.toArray=Tn.prototype.Fa,Tn.prototype.removeRange=Tn.prototype.removeRange,Tn.prototype.removeAt=Tn.prototype.mb,Tn.prototype.delete=Tn.prototype.delete,Tn.prototype.remove=Tn.prototype.remove,Tn.prototype.insertAt=Tn.prototype.Gb,Tn.prototype.pop=Tn.prototype.pop,Tn.prototype.last=Tn.prototype.jc,Tn.prototype.first=Tn.prototype.first,Tn.prototype.set=Tn.prototype.set,Tn.prototype.setElt=Tn.prototype.cd,Tn.prototype.get=Tn.prototype.get,Tn.prototype.elt=Tn.prototype.M,Tn.prototype.indexOf=Tn.prototype.indexOf,Tn.prototype.has=Tn.prototype.has,Tn.prototype.contains=Tn.prototype.contains,Tn.prototype.clear=Tn.prototype.clear,Tn.prototype.addAll=Tn.prototype.addAll,Tn.prototype.push=Tn.prototype.push,Tn.prototype.add=Tn.prototype.add,Tn.prototype.thaw=Tn.prototype.ka,Tn.prototype.freeze=Tn.prototype.freeze,Tn.className="List";function qo(a){this.eg=a,a.Sa=null,this.qa=a.Ja,this.sa=null}qo.prototype.reset=function(){var a=this.eg;a.Sa=null,this.qa=a.Ja,this.sa=null},qo.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)},qo.prototype.Ad=function(){return this.next()},qo.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},qo.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},qo.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},qo.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},qo.prototype.map=function(a){var y=this.eg;y.Sa=null;var x=new Tn;for(y=y.ea;y!==null;)x.add(a(y.value)),y=y.va;return x.iterator},qo.prototype.filter=function(a){var y=this.eg;y.Sa=null;var x=new Tn;for(y=y.ea;y!==null;){var E=y.value;a(E)&&x.add(E),y=y.va}return x.iterator},qo.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.eg.Sa=this},qo.prototype.toString=function(){return this.sa!==null?"SetIterator@"+this.sa.value:"SetIterator"},kt.Object.defineProperties(qo.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.eg.Sb}}}),qo.prototype.first=qo.prototype.first,qo.prototype.hasNext=qo.prototype.Ad,qo.prototype.next=qo.prototype.next,qo.prototype.reset=qo.prototype.reset,qo.className="SetIterator";function Zn(a){wr(this),this._isFrozen=!1,this.Tb={},this.Sb=0,this.Sa=null,this.Ja=0,this.kf=this.ea=null,typeof a=="string"&&it("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}Ce=Zn.prototype,Ce.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},Ce.freeze=function(){return this._isFrozen=!0,this},Ce.ka=function(){return this._isFrozen=!1,this},Ce.toString=function(){return"Set()#"+hr(this)},Ce.add=function(a){if(a===null)return this;this._isFrozen&&sn(this,a);var y=a;return cn(a)&&(y=Or(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},Ce.addAll=function(a){if(a===null)return this;if(this._isFrozen&&sn(this),qt(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},Ce.contains=function(a){if(a===null)return!1;var y=a;return cn(a)&&(y=hr(a),y===void 0)?!1:this.Tb[y]!==void 0},Ce.has=function(a){return this.contains(a)},Ce.Sy=function(a){if(a===null)return!0;for(a=a.iterator;a.next();)if(!this.contains(a.value))return!1;return!0},Ce.Ty=function(a){if(a===null)return!0;for(a=a.iterator;a.next();)if(this.contains(a.value))return!0;return!1},Ce.first=function(){var a=this.ea;return a===null?null:a.value},Zn.prototype.any=function(a){for(var y=this.ea;y!==null;){if(a(y.value))return!0;y=y.va}return!1},Zn.prototype.all=function(a){for(var y=this.ea;y!==null;){if(!a(y.value))return!1;y=y.va}return!0},Zn.prototype.each=function(a){for(var y=this.ea;y!==null;)a(y.value),y=y.va;return this},Zn.prototype.map=function(a){for(var y=new Zn,x=this.ea;x!==null;)y.add(a(x.value)),x=x.va;return y},Zn.prototype.filter=function(a){for(var y=new Zn,x=this.ea;x!==null;){var E=x.value;a(E)&&y.add(E),x=x.va}return y},Ce=Zn.prototype,Ce.remove=function(a){if(a===null)return!1;this._isFrozen&&sn(this,a);var y=a;if(cn(a)&&(y=hr(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},Ce.delete=function(a){return this.remove(a)},Ce.hp=function(a){if(a===null)return this;if(this._isFrozen&&sn(this),qt(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},Ce.pA=function(a){if(a===null||this.count===0)return this;this._isFrozen&&sn(this);var y=new Zn;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},Ce.clear=function(){this._isFrozen&&sn(this),this.Tb={},this.Sb=0,this.Sa!==null&&this.Sa.reset(),this.kf=this.ea=null,this.xb()},Zn.prototype.copy=function(){var a=new Zn,y=this.Tb,x;for(x in y)a.add(y[x].value);return a},Zn.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},Zn.prototype.Hv=function(){var a=new Tn,y=this.Tb,x;for(x in y)a.add(y[x].value);return a};function wr(a){a.__gohashid=la++}function Or(a){var y=a.__gohashid;return y===void 0&&(y=la++,a.__gohashid=y),y}function hr(a){return a.__gohashid}kt.Object.defineProperties(Zn.prototype,{count:{get:function(){return this.Sb}},size:{get:function(){return this.Sb}},iterator:{get:function(){if(0>=this.Sb)return bo;var a=this.Sa;return a!==null?(a.reset(),a):new qo(this)}}}),Zn.prototype.toList=Zn.prototype.Hv,Zn.prototype.toArray=Zn.prototype.Fa,Zn.prototype.clear=Zn.prototype.clear,Zn.prototype.retainAll=Zn.prototype.pA,Zn.prototype.removeAll=Zn.prototype.hp,Zn.prototype.delete=Zn.prototype.delete,Zn.prototype.remove=Zn.prototype.remove,Zn.prototype.first=Zn.prototype.first,Zn.prototype.containsAny=Zn.prototype.Ty,Zn.prototype.containsAll=Zn.prototype.Sy,Zn.prototype.has=Zn.prototype.has,Zn.prototype.contains=Zn.prototype.contains,Zn.prototype.addAll=Zn.prototype.addAll,Zn.prototype.add=Zn.prototype.add,Zn.prototype.thaw=Zn.prototype.ka,Zn.prototype.freeze=Zn.prototype.freeze;var la=1;Zn.className="Set",Zn.uniqueHash=wr,Zn.hashIdUnique=Or,Zn.hashId=hr;function ca(a){this.ma=a,this.qa=a.Ja,this.sa=null}ca.prototype.reset=function(){this.qa=this.ma.Ja,this.sa=null},ca.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)},ca.prototype.Ad=function(){return this.next()},ca.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},ca.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},ca.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},ca.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},ca.prototype.map=function(a){var y=this.ma;this.sa=null;var x=new Tn;for(y=y.ea;y!==null;)x.add(a(y.key)),y=y.va;return x.iterator},ca.prototype.filter=function(a){var y=this.ma;this.sa=null;var x=new Tn;for(y=y.ea;y!==null;){var E=y.key;a(E)&&x.add(E),y=y.va}return x.iterator},ca.prototype.de=function(){this.value=this.key=null,this.qa=-1},ca.prototype.toString=function(){return this.sa!==null?"MapKeySetIterator@"+this.sa.value:"MapKeySetIterator"},kt.Object.defineProperties(ca.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),ca.prototype.first=ca.prototype.first,ca.prototype.hasNext=ca.prototype.Ad,ca.prototype.next=ca.prototype.next,ca.prototype.reset=ca.prototype.reset,ca.className="MapKeySetIterator";function Qo(a){Zn.call(this),wr(this),this._isFrozen=!0,this.ma=a}Tt(Qo,Zn),Ce=Qo.prototype,Ce.freeze=function(){return this},Ce.ka=function(){return this},Ce.toString=function(){return"MapKeySet("+this.ma.toString()+")"},Ce.add=function(){it("This Set is read-only: "+this.toString())},Ce.contains=function(a){return this.ma.contains(a)},Ce.has=function(a){return this.contains(a)},Ce.remove=function(){it("This Set is read-only: "+this.toString())},Ce.delete=function(a){return this.remove(a)},Ce.clear=function(){it("This Set is read-only: "+this.toString())},Ce.first=function(){var a=this.ma.ea;return a!==null?a.key:null},Qo.prototype.any=function(a){for(var y=this.ma.ea;y!==null;){if(a(y.key))return!0;y=y.va}return!1},Qo.prototype.all=function(a){for(var y=this.ma.ea;y!==null;){if(!a(y.key))return!1;y=y.va}return!0},Qo.prototype.each=function(a){for(var y=this.ma.ea;y!==null;)a(y.key),y=y.va;return this},Qo.prototype.map=function(a){for(var y=new Zn,x=this.ma.ea;x!==null;)y.add(a(x.key)),x=x.va;return y},Qo.prototype.filter=function(a){for(var y=new Zn,x=this.ma.ea;x!==null;){var E=x.key;a(E)&&y.add(E),x=x.va}return y},Qo.prototype.copy=function(){return new Qo(this.ma)},Qo.prototype.Iv=function(){var a=new Zn,y=this.ma.Tb,x;for(x in y)a.add(y[x].key);return a},Qo.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},Qo.prototype.Hv=function(){var a=new Tn,y=this.ma.Tb,x;for(x in y)a.add(y[x].key);return a},kt.Object.defineProperties(Qo.prototype,{count:{get:function(){return this.ma.Sb}},size:{get:function(){return this.ma.Sb}},iterator:{get:function(){return 0>=this.ma.Sb?bo:new ca(this.ma)}}}),Qo.prototype.toList=Qo.prototype.Hv,Qo.prototype.toArray=Qo.prototype.Fa,Qo.prototype.toSet=Qo.prototype.Iv,Qo.prototype.first=Qo.prototype.first,Qo.prototype.clear=Qo.prototype.clear,Qo.prototype.delete=Qo.prototype.delete,Qo.prototype.remove=Qo.prototype.remove,Qo.prototype.has=Qo.prototype.has,Qo.prototype.contains=Qo.prototype.contains,Qo.prototype.add=Qo.prototype.add,Qo.prototype.thaw=Qo.prototype.ka,Qo.prototype.freeze=Qo.prototype.freeze,Qo.className="MapKeySet";function zo(a){this.ma=a,a.jf=null,this.qa=a.Ja,this.sa=null}zo.prototype.reset=function(){var a=this.ma;a.jf=null,this.qa=a.Ja,this.sa=null},zo.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)},zo.prototype.Ad=function(){return this.next()},zo.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},zo.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},zo.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},zo.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},zo.prototype.map=function(a){var y=this.ma;this.sa=y.jf=null;var x=new Tn;for(y=y.ea;y!==null;)x.add(a(y.value)),y=y.va;return x.iterator},zo.prototype.filter=function(a){var y=this.ma;this.sa=y.jf=null;var x=new Tn;for(y=y.ea;y!==null;){var E=y.value;a(E)&&x.add(E),y=y.va}return x.iterator},zo.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.jf=this},zo.prototype.toString=function(){return this.sa!==null?"MapValueSetIterator@"+this.sa.value:"MapValueSetIterator"},kt.Object.defineProperties(zo.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),zo.prototype.first=zo.prototype.first,zo.prototype.hasNext=zo.prototype.Ad,zo.prototype.next=zo.prototype.next,zo.prototype.reset=zo.prototype.reset,zo.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 On(a){this.ma=a,a.Sa=null,this.qa=a.Ja,this.sa=null}On.prototype.reset=function(){var a=this.ma;a.Sa=null,this.qa=a.Ja,this.sa=null},On.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)},On.prototype.Ad=function(){return this.next()},On.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},On.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},On.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},On.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},On.prototype.map=function(a){var y=this.ma;this.sa=y.Sa=null;var x=new Tn;for(y=y.ea;y!==null;)x.add(a(y)),y=y.va;return x.iterator},On.prototype.filter=function(a){var y=this.ma;this.sa=y.Sa=null;var x=new Tn;for(y=y.ea;y!==null;)a(y)&&x.add(y),y=y.va;return x.iterator},On.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.Sa=this},On.prototype.toString=function(){return this.sa!==null?"MapIterator@"+this.sa:"MapIterator"},kt.Object.defineProperties(On.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),On.prototype.first=On.prototype.first,On.prototype.hasNext=On.prototype.Ad,On.prototype.next=On.prototype.next,On.prototype.reset=On.prototype.reset,On.className="MapIterator";function Ut(a){wr(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"&&it("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}Ce=Ut.prototype,Ce.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},Ce.freeze=function(){return this._isFrozen=!0,this},Ce.ka=function(){return this._isFrozen=!1,this},Ce.toString=function(){return"Map()#"+hr(this)},Ce.add=function(a,y){this._isFrozen&&sn(this,a);var x=a;cn(a)&&(x=Or(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},Ce.set=function(a,y){return this.add(a,y)},Ce.addAll=function(a){if(a===null)return this;if(qt(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 Ut)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},Ce.first=function(){return this.ea},Ut.prototype.any=function(a){for(var y=this.ea;y!==null;){if(a(y))return!0;y=y.va}return!1},Ut.prototype.all=function(a){for(var y=this.ea;y!==null;){if(!a(y))return!1;y=y.va}return!0},Ut.prototype.each=function(a){for(var y=this.ea;y!==null;)a(y),y=y.va;return this},Ut.prototype.map=function(a){for(var y=new Ut,x=this.ea;x!==null;)y.add(x.key,a(x)),x=x.va;return y},Ut.prototype.filter=function(a){for(var y=new Ut,x=this.ea;x!==null;)a(x)&&y.add(x.key,x.value),x=x.va;return y},Ce=Ut.prototype,Ce.contains=function(a){var y=a;return cn(a)&&(y=hr(a),y===void 0)?!1:this.Tb[y]!==void 0},Ce.has=function(a){return this.contains(a)},Ce.I=function(a){var y=a;return cn(a)&&(y=hr(a),y===void 0)?null:(a=this.Tb[y],a===void 0?null:a.value)},Ce.get=function(a){return this.I(a)},Ce.remove=function(a){if(a===null)return!1;this._isFrozen&&sn(this,a);var y=a;if(cn(a)&&(y=hr(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},Ce.delete=function(a){return this.remove(a)},Ce.clear=function(){this._isFrozen&&sn(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()},Ut.prototype.copy=function(){var a=new Ut,y=this.Tb,x;for(x in y){var E=y[x];a.add(E.key,E.value)}return a},Ut.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},Ut.prototype.Lf=function(){return new Qo(this)},kt.Object.defineProperties(Ut.prototype,{count:{get:function(){return this.Sb}},size:{get:function(){return this.Sb}},iterator:{get:function(){if(0>=this.count)return bo;var a=this.Sa;return a!==null?(a.reset(),a):new On(this)}},iteratorKeys:{get:function(){return 0>=this.count?bo:new ca(this)}},iteratorValues:{get:function(){if(0>=this.count)return bo;var a=this.jf;return a!==null?(a.reset(),a):new zo(this)}}}),Ut.prototype.toKeySet=Ut.prototype.Lf,Ut.prototype.toArray=Ut.prototype.Fa,Ut.prototype.clear=Ut.prototype.clear,Ut.prototype.delete=Ut.prototype.delete,Ut.prototype.remove=Ut.prototype.remove,Ut.prototype.get=Ut.prototype.get,Ut.prototype.getValue=Ut.prototype.I,Ut.prototype.has=Ut.prototype.has,Ut.prototype.contains=Ut.prototype.contains,Ut.prototype.first=Ut.prototype.first,Ut.prototype.addAll=Ut.prototype.addAll,Ut.prototype.set=Ut.prototype.set,Ut.prototype.add=Ut.prototype.add,Ut.prototype.thaw=Ut.prototype.ka,Ut.prototype.freeze=Ut.prototype.freeze,Ut.className="Map";function _e(a,y){a===void 0?this.y=this.x=0:typeof a=="number"&&typeof y=="number"?(this.x=a,this.y=y):it("Invalid arguments to Point constructor: "+a+", "+y),this._isFrozen=!1}var pi,Vn,qn,ki,Wi;_e.prototype.assign=function(a){return this.x=a.x,this.y=a.y,this},_e.prototype.h=function(a,y){return this.x=a,this.y=y,this},_e.prototype.sg=function(a,y){return this.x=a,this.y=y,this},_e.prototype.set=function(a){return this.x=a.x,this.y=a.y,this},_e.prototype.copy=function(){var a=new _e;return a.x=this.x,a.y=this.y,a},Ce=_e.prototype,Ce.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},Ce.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},Ce.freeze=function(){return this._isFrozen=!0,this},Ce.ka=function(){return Object.isFrozen(this)&&it("cannot thaw constant: "+this),this._isFrozen=!1,this};function Wn(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 _e(x,b)}return new _e}function mi(a){return a.x.toString()+" "+a.y.toString()}Ce.toString=function(){return"Point("+this.x+","+this.y+")"},Ce.D=function(a){return a instanceof _e?this.x===a.x&&this.y===a.y:!1},Ce.hi=function(a,y){return this.x===a&&this.y===y},Ce.Xa=function(a){return He.B(this.x,a.x)&&He.B(this.y,a.y)},Ce.add=function(a){return this.x+=a.x,this.y+=a.y,this},Ce.re=function(a){return this.x-=a.x,this.y-=a.y,this},Ce.offset=function(a,y){return this.x+=a,this.y+=y,this},_e.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},Ce=_e.prototype,Ce.scale=function(a,y){return this.x*=a,this.y*=y,this},Ce.Bf=function(a){var y=a.x-this.x;return a=a.y-this.y,y*y+a*a},Ce.zd=function(a,y){return a-=this.x,y-=this.y,a*a+y*y},Ce.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},Ce.ab=function(a){return Si(a.x-this.x,a.y-this.y)},Ce.direction=function(a,y){return Si(a-this.x,y-this.y)};function Si(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}Ce.Ry=function(a,y){return He.Fl(a.x,a.y,y.x,y.y,this.x,this.y)},Ce.fA=function(a,y,x,E){return He.qh(a,y,x,E,this.x,this.y,this),this},Ce.gA=function(a,y){return He.qh(a.x,a.y,y.x,y.y,this.x,this.y,this),this},Ce.uA=function(a,y,x,E){return He.No(this.x,this.y,a,y,x,E,this),this},Ce.vA=function(a,y){return He.No(this.x,this.y,a.x,a.y,y.width,y.height,this),this},Ce.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},Ce.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},Ce.transform=function(a){return a.Ga(this),this};function Ei(a,y){return y.Cd(a),a}function bi(a,y,x,E,b,z){var ee=b-x,re=z-E,oe=ee*ee+re*re;x-=a,E-=y;var le=-x*ee-E*re;return 0>=le||le>=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 gr(a,y,x,E){return a=x-a,y=E-y,a*a+y*y}function qi(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)}Ce.w=function(){return isFinite(this.x)&&isFinite(this.y)},_e.alloc=function(){var a=Ui.pop();return a===void 0?new _e:a},_e.allocAt=function(a,y){var x=Ui.pop();return x===void 0?new _e(a,y):(x.x=a,x.y=y,x)},_e.free=function(a){Ui.push(a)},_e.prototype.isReal=_e.prototype.w,_e.prototype.setSpot=_e.prototype.yi,_e.prototype.setRectSpot=_e.prototype.xi,_e.prototype.snapToGridPoint=_e.prototype.vA,_e.prototype.snapToGrid=_e.prototype.uA,_e.prototype.projectOntoLineSegmentPoint=_e.prototype.gA,_e.prototype.projectOntoLineSegment=_e.prototype.fA,_e.intersectingLineSegments=function(a,y,x,E,b,z,ee,re){return He.Rl(a,y,x,E,b,z,ee,re)},_e.prototype.compareWithLineSegmentPoint=_e.prototype.Ry,_e.compareWithLineSegment=function(a,y,x,E,b,z){return He.Fl(a,y,x,E,b,z)},_e.prototype.direction=_e.prototype.direction,_e.prototype.directionPoint=_e.prototype.ab,_e.prototype.normalize=_e.prototype.normalize,_e.prototype.distanceSquared=_e.prototype.zd,_e.prototype.distanceSquaredPoint=_e.prototype.Bf,_e.prototype.scale=_e.prototype.scale,_e.prototype.rotate=_e.prototype.rotate,_e.prototype.offset=_e.prototype.offset,_e.prototype.subtract=_e.prototype.re,_e.prototype.add=_e.prototype.add,_e.prototype.equalsApprox=_e.prototype.Xa,_e.prototype.equalTo=_e.prototype.hi,_e.prototype.equals=_e.prototype.D,_e.prototype.set=_e.prototype.set,_e.prototype.setTo=_e.prototype.sg;var Ui=[];_e.className="Point",_e.parse=Wn,_e.stringify=mi,_e.distanceLineSegmentSquared=bi,_e.distanceSquared=gr,_e.direction=qi,_e.Origin=pi=new _e(0,0).ja(),_e.InfiniteTopLeft=Vn=new _e(-1/0,-1/0).ja(),_e.InfiniteBottomRight=qn=new _e(1/0,1/0).ja(),_e.SixPoint=ki=new _e(6,6).ja(),_e.NoPoint=Wi=new _e(NaN,NaN).ja(),_e.parse=Wn,_e.stringify=mi,_e.distanceLineSegmentSquared=bi,_e.distanceSquared=gr,_e.direction=qi;function bn(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):it("Invalid arguments to Size constructor: "+a+", "+y),this._isFrozen=!1}var Yi,rr,Po,uo,No,Do,Io;bn.prototype.assign=function(a){return this.width=a.width,this.height=a.height,this},bn.prototype.h=function(a,y){return this.width=a,this.height=y,this},bn.prototype.sg=function(a,y){return this.width=a,this.height=y,this},bn.prototype.set=function(a){return this.width=a.width,this.height=a.height,this},bn.prototype.copy=function(){var a=new bn;return a.width=this.width,a.height=this.height,a},Ce=bn.prototype,Ce.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},Ce.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},Ce.freeze=function(){return this._isFrozen=!0,this},Ce.ka=function(){return Object.isFrozen(this)&&it("cannot thaw constant: "+this),this._isFrozen=!1,this};function fa(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 bn(x,b)}return new bn}function na(a){return a.width.toString()+" "+a.height.toString()}Ce.toString=function(){return"Size("+this.width+","+this.height+")"},Ce.D=function(a){return a instanceof bn?this.width===a.width&&this.height===a.height:!1},Ce.hi=function(a,y){return this.width===a&&this.height===y},Ce.Xa=function(a){return He.B(this.width,a.width)&&He.B(this.height,a.height)},Ce.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},Ce.w=function(){return isFinite(this.width)&&isFinite(this.height)},bn.alloc=function(){var a=za.pop();return a===void 0?new bn:a},bn.free=function(a){za.push(a)},bn.prototype.isReal=bn.prototype.w,bn.prototype.inflate=bn.prototype.Bc,bn.prototype.equalsApprox=bn.prototype.Xa,bn.prototype.equalTo=bn.prototype.hi,bn.prototype.equals=bn.prototype.D,bn.prototype.set=bn.prototype.set,bn.prototype.setTo=bn.prototype.sg;var za=[];bn.className="Size",bn.parse=fa,bn.stringify=na,bn.ZeroSize=Yi=new bn(0,0).ja(),bn.OneSize=rr=new bn(1,1).ja(),bn.SixSize=Po=new bn(6,6).ja(),bn.EightSize=uo=new bn(8,8).ja(),bn.TenSize=No=new bn(10,10).ja(),bn.InfiniteSize=Do=new bn(1/0,1/0).ja(),bn.NoSize=Io=new bn(NaN,NaN).ja(),bn.parse=fa,bn.stringify=na;function zt(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 _e?(x=a.x,a=a.y,y instanceof _e?(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 bn?(this.x=x,this.y=a,this.width=y.width,this.height=y.height):it("Incorrect second argument supplied to Rect constructor "+y)):it("Invalid arguments to Rect constructor: "+a+", "+y+", "+x+", "+E),this._isFrozen=!1}Ce=zt.prototype,Ce.assign=function(a){return this.x=a.x,this.y=a.y,this.width=a.width,this.height=a.height,this},Ce.h=function(a,y,x,E){return this.x=a,this.y=y,this.width=x,this.height=E,this};function To(a,y,x){a.width=y,a.height=x}Ce.sg=function(a,y,x,E){return this.x=a,this.y=y,this.width=x,this.height=E,this},Ce.set=function(a){return this.x=a.x,this.y=a.y,this.width=a.width,this.height=a.height,this},Ce.dd=function(a){return this.x=a.x,this.y=a.y,this},Ce.tA=function(a){return this.width=a.width,this.height=a.height,this},zt.prototype.copy=function(){var a=new zt;return a.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},Ce=zt.prototype,Ce.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},Ce.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},Ce.freeze=function(){return this._isFrozen=!0,this},Ce.ka=function(){return Object.isFrozen(this)&&it("cannot thaw constant: "+this),this._isFrozen=!1,this};function Pr(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 zt(x,b,z,ee)}return new zt}function eo(a){return a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString()}Ce.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"},Ce.D=function(a){return a instanceof zt?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1},Ce.hi=function(a,y,x,E){return this.x===a&&this.y===y&&this.width===x&&this.height===E},Ce.Xa=function(a){return He.B(this.x,a.x)&&He.B(this.y,a.y)&&He.B(this.width,a.width)&&He.B(this.height,a.height)};function Zo(a,y){return He.$(a.x,y.x)&&He.$(a.y,y.y)&&He.$(a.width,y.width)&&He.$(a.height,y.height)}Ce.ca=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y},Ce.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},Ce.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},Ce.offset=function(a,y){return this.x+=a,this.y+=y,this},Ce.Bc=function(a,y){return Wr(this,y,a,y,a)},Ce.Co=function(a){return Wr(this,a.top,a.right,a.bottom,a.left)},Ce.Fv=function(a){return Wr(this,-a.top,-a.right,-a.bottom,-a.left)},Ce.Hz=function(a,y,x,E){return Wr(this,a,y,x,E)};function Wr(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}Ce.Ex=function(a){return ba(this,a.x,a.y,a.width,a.height)},Ce.Uu=function(a,y,x,E){return ba(this,a,y,x,E)};function ba(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}Ce.Yc=function(a){return this.Vu(a.x,a.y,a.width,a.height)},Ce.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))}Ce.Ye=function(a){return Uo(this,a.x,a.y,0,0)},Ce.ed=function(a){return Uo(this,a.x,a.y,a.width,a.height)},Ce.Kv=function(a,y,x,E){return x===void 0&&(x=0),E===void 0&&(E=0),Uo(this,a,y,x,E)};function Uo(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}Ce.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)}Ce.w=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},Ce.Mz=function(){return this.width===0&&this.height===0},zt.alloc=function(){var a=ds.pop();return a===void 0?new zt:a},zt.allocAt=function(a,y,x,E){var b=ds.pop();return b===void 0?new zt(a,y,x,E):b.h(a,y,x,E)},zt.free=function(a){ds.push(a)},kt.Object.defineProperties(zt.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 _e(this.x,this.y)},set:function(a){this.x=a.x,this.y=a.y}},size:{get:function(){return new bn(this.width,this.height)},set:function(a){this.width=a.width,this.height=a.height}},center:{get:function(){return new _e(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}}}),zt.prototype.isEmpty=zt.prototype.Mz,zt.prototype.isReal=zt.prototype.w,zt.intersectsLineSegment=function(a,y,x,E,b,z,ee,re){return He.Fx(a,y,x,E,b,z,ee,re)},zt.prototype.setSpot=zt.prototype.yi,zt.prototype.union=zt.prototype.Kv,zt.prototype.unionRect=zt.prototype.ed,zt.prototype.unionPoint=zt.prototype.Ye,zt.prototype.intersects=zt.prototype.Vu,zt.prototype.intersectsRect=zt.prototype.Yc,zt.prototype.intersect=zt.prototype.Uu,zt.prototype.intersectRect=zt.prototype.Ex,zt.prototype.grow=zt.prototype.Hz,zt.prototype.subtractMargin=zt.prototype.Fv,zt.prototype.addMargin=zt.prototype.Co,zt.prototype.inflate=zt.prototype.Bc,zt.prototype.offset=zt.prototype.offset,zt.prototype.contains=zt.prototype.contains,zt.prototype.containsRect=zt.prototype.Re,zt.prototype.containsPoint=zt.prototype.ca,zt.prototype.equalsApprox=zt.prototype.Xa,zt.prototype.equalTo=zt.prototype.hi,zt.prototype.equals=zt.prototype.D,zt.prototype.setSize=zt.prototype.tA,zt.prototype.setPoint=zt.prototype.dd,zt.prototype.set=zt.prototype.set,zt.prototype.setTo=zt.prototype.sg;var Qa=null,ns=null,ds=[];zt.className="Rect",zt.parse=Pr,zt.stringify=eo,zt.contains=Fo,zt.intersects=vs,zt.ZeroRect=Qa=new zt(0,0,0,0).ja(),zt.NoRect=ns=new zt(NaN,NaN,NaN,NaN).ja(),zt.parse=Pr,zt.stringify=eo,zt.contains=Fo,zt.intersects=vs;function Vr(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):it("Invalid arguments to Margin constructor: "+a+", "+y+", "+x+", "+E),this._isFrozen=!1}Vr.prototype.assign=function(a){return this.top=a.top,this.right=a.right,this.bottom=a.bottom,this.left=a.left,this},Vr.prototype.sg=function(a,y,x,E){return this.top=a,this.right=y,this.bottom=x,this.left=E,this},Vr.prototype.set=function(a){return this.top=a.top,this.right=a.right,this.bottom=a.bottom,this.left=a.left,this},Vr.prototype.copy=function(){var a=new Vr;return a.top=this.top,a.right=this.right,a.bottom=this.bottom,a.left=this.left,a},Ce=Vr.prototype,Ce.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},Ce.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},Ce.freeze=function(){return this._isFrozen=!0,this},Ce.ka=function(){return Object.isFrozen(this)&&it("cannot thaw constant: "+this),this._isFrozen=!1,this};function wa(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 Vr;for(var b=NaN;a[y]==="";)y++;if((E=a[y++])&&(b=parseFloat(E)),isNaN(b))return new Vr(x);for(var z=NaN;a[y]==="";)y++;if((E=a[y++])&&(z=parseFloat(E)),isNaN(z))return new Vr(x,b);for(var ee=NaN;a[y]==="";)y++;return(E=a[y++])&&(ee=parseFloat(E)),isNaN(ee)?new Vr(x,b):new Vr(x,b,z,ee)}return new Vr}function Ba(a){return a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString()}Ce.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"},Ce.D=function(a){return a instanceof Vr?this.top===a.top&&this.right===a.right&&this.bottom===a.bottom&&this.left===a.left:!1},Ce.hi=function(a,y,x,E){return this.top===a&&this.right===y&&this.bottom===x&&this.left===E},Ce.Xa=function(a){return He.B(this.top,a.top)&&He.B(this.right,a.right)&&He.B(this.bottom,a.bottom)&&He.B(this.left,a.left)},Ce.w=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)},Vr.alloc=function(){var a=Ko.pop();return a===void 0?new Vr:a},Vr.free=function(a){Ko.push(a)},Vr.prototype.isReal=Vr.prototype.w,Vr.prototype.equalsApprox=Vr.prototype.Xa,Vr.prototype.equalTo=Vr.prototype.hi,Vr.prototype.equals=Vr.prototype.D,Vr.prototype.set=Vr.prototype.set,Vr.prototype.setTo=Vr.prototype.sg;var is=null,Vo=null,Ko=[];Vr.className="Margin",Vr.parse=wa,Vr.stringify=Ba,Vr.ZeroMargin=is=new Vr(0,0,0,0).ja(),Vr.TwoMargin=Vo=new Vr(2,2,2,2).ja(),Vr.parse=wa,Vr.stringify=Ba;function ni(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 to,Xo,Ia,ms,cs,yo,as,ls,Yt,Xt,kn,Zi,yi,Ai,Li,Rn,ri,ir,Rr,ea,_o,Pa,xa,vo,Kr,er,ia,sa,Ma,Oa,Oo,ua,Lo,jr,oo,Yr;ni.prototype.assign=function(a){return this.x=a.x,this.y=a.y,this.offsetX=a.offsetX,this.offsetY=a.offsetY,this},ni.prototype.sg=function(a,y,x,E){return this.x=a,this.y=y,this.offsetX=x,this.offsetY=E,this},ni.prototype.set=function(a){return this.x=a.x,this.y=a.y,this.offsetX=a.offsetX,this.offsetY=a.offsetY,this},ni.prototype.copy=function(){var a=new ni;return a.x=this.x,a.y=this.y,a.offsetX=this.offsetX,a.offsetY=this.offsetY,a},Ce=ni.prototype,Ce.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},Ce.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},Ce.freeze=function(){return this._isFrozen=!0,this},Ce.ka=function(){return Object.isFrozen(this)&&it("cannot thaw constant: "+this),this._isFrozen=!1,this};function wo(a,y){return a.x=NaN,a.y=NaN,a.offsetX=y,a}function Ra(a){if(typeof a=="string"){if(a=a.trim(),a==="None")return to;if(a==="TopLeft")return Xo;if(a==="Top"||a==="TopCenter"||a==="MiddleTop")return Ia;if(a==="TopRight")return ms;if(a==="Left"||a==="LeftCenter"||a==="MiddleLeft")return cs;if(a==="Center")return yo;if(a==="Right"||a==="RightCenter"||a==="MiddleRight")return as;if(a==="BottomLeft")return ls;if(a==="Bottom"||a==="BottomCenter"||a==="MiddleBottom")return Yt;if(a==="BottomRight")return Xt;if(a==="TopSide")return kn;if(a==="LeftSide")return Zi;if(a==="RightSide")return yi;if(a==="BottomSide")return Ai;if(a==="TopBottomSides")return Li;if(a==="LeftRightSides")return Rn;if(a==="TopLeftSides")return ri;if(a==="TopRightSides")return ir;if(a==="BottomLeftSides")return Rr;if(a==="BottomRightSides")return ea;if(a==="NotTopSide")return _o;if(a==="NotLeftSide")return Pa;if(a==="NotRightSide")return xa;if(a==="NotBottomSide")return vo;if(a==="AllSides")return Kr;if(a==="Default")return er;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 ni(x,b,z,ee)}return new ni}function Ha(a){return a.sb()?a.x.toString()+" "+a.y.toString()+" "+a.offsetX.toString()+" "+a.offsetY.toString():a.toString()}Ce.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(to)?"None":this.D(Xo)?"TopLeft":this.D(Ia)?"Top":this.D(ms)?"TopRight":this.D(cs)?"Left":this.D(yo)?"Center":this.D(as)?"Right":this.D(ls)?"BottomLeft":this.D(Yt)?"Bottom":this.D(Xt)?"BottomRight":this.D(kn)?"TopSide":this.D(Zi)?"LeftSide":this.D(yi)?"RightSide":this.D(Ai)?"BottomSide":this.D(Li)?"TopBottomSides":this.D(Rn)?"LeftRightSides":this.D(ri)?"TopLeftSides":this.D(ir)?"TopRightSides":this.D(Rr)?"BottomLeftSides":this.D(ea)?"BottomRightSides":this.D(_o)?"NotTopSide":this.D(Pa)?"NotLeftSide":this.D(xa)?"NotRightSide":this.D(vo)?"NotBottomSide":this.D(Kr)?"AllSides":this.D(er)?"Default":"None"},Ce.D=function(a){return a instanceof ni?(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},Ce.gv=function(){return new ni(.5-(this.x-.5),.5-(this.y-.5),-this.offsetX,-this.offsetY)},Ce.Hf=function(a){if(!this.$c())return!1;if(!a.$c())if(a.D(ia))a=Zi;else if(a.D(sa))a=yi;else if(a.D(Ma))a=kn;else if(a.D(Oa))a=Ai;else return!1;return a=a.offsetY,(this.offsetY&a)===a},Ce.sb=function(){return!isNaN(this.x)&&!isNaN(this.y)},Ce.Mc=function(){return isNaN(this.x)||isNaN(this.y)},Ce.$c=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===1&&this.offsetY!==0},Ce.ys=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===0&&this.offsetY===0},Ce.Xb=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===-1&&this.offsetY===0},ni.alloc=function(){var a=Mt.pop();return a===void 0?new ni:a},ni.free=function(a){Mt.push(a)},ni.prototype.isDefault=ni.prototype.Xb,ni.prototype.isNone=ni.prototype.ys,ni.prototype.isSide=ni.prototype.$c,ni.prototype.isNoSpot=ni.prototype.Mc,ni.prototype.isSpot=ni.prototype.sb,ni.prototype.includesSide=ni.prototype.Hf,ni.prototype.opposite=ni.prototype.gv,ni.prototype.equals=ni.prototype.D,ni.prototype.set=ni.prototype.set,ni.prototype.setTo=ni.prototype.sg;var Mt=[];ni.className="Spot",ni.parse=Ra,ni.stringify=Ha,ni.None=to=wo(new ni(0,0,0,0),0).ja(),ni.Default=er=wo(new ni(0,0,-1,0),-1).ja(),ni.TopLeft=Xo=new ni(0,0,0,0).ja(),ni.TopCenter=Ia=new ni(.5,0,0,0).ja(),ni.TopRight=ms=new ni(1,0,0,0).ja(),ni.LeftCenter=cs=new ni(0,.5,0,0).ja(),ni.Center=yo=new ni(.5,.5,0,0).ja(),ni.RightCenter=as=new ni(1,.5,0,0).ja(),ni.BottomLeft=ls=new ni(0,1,0,0).ja(),ni.BottomCenter=Yt=new ni(.5,1,0,0).ja(),ni.BottomRight=Xt=new ni(1,1,0,0).ja(),ni.MiddleTop=Oo=Ia,ni.MiddleLeft=ua=cs,ni.MiddleRight=Lo=as,ni.MiddleBottom=jr=Yt,ni.Top=Ma=Ia,ni.Left=ia=cs,ni.Right=sa=as,ni.Bottom=Oa=Yt,ni.TopSide=kn=wo(new ni(0,0,1,1),1).ja(),ni.LeftSide=Zi=wo(new ni(0,0,1,2),1).ja(),ni.RightSide=yi=wo(new ni(0,0,1,4),1).ja(),ni.BottomSide=Ai=wo(new ni(0,0,1,8),1).ja(),ni.TopBottomSides=Li=wo(new ni(0,0,1,9),1).ja(),ni.LeftRightSides=Rn=wo(new ni(0,0,1,6),1).ja(),ni.TopLeftSides=ri=wo(new ni(0,0,1,3),1).ja(),ni.TopRightSides=ir=wo(new ni(0,0,1,5),1).ja(),ni.BottomLeftSides=Rr=wo(new ni(0,0,1,10),1).ja(),ni.BottomRightSides=ea=wo(new ni(0,0,1,12),1).ja(),ni.NotTopSide=_o=wo(new ni(0,0,1,14),1).ja(),ni.NotLeftSide=Pa=wo(new ni(0,0,1,13),1).ja(),ni.NotRightSide=xa=wo(new ni(0,0,1,11),1).ja(),ni.NotBottomSide=vo=wo(new ni(0,0,1,7),1).ja(),ni.AllSides=Kr=wo(new ni(0,0,1,15),1).ja(),oo=new ni(.156,.156).ja(),Yr=new ni(.844,.844).ja(),ni.parse=Ra,ni.stringify=Ha;function Pt(){this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0}Pt.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},Pt.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},Pt.prototype.copy=function(){var a=new Pt;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},Pt.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"},Pt.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},Pt.prototype.ws=function(){return this.dx===0&&this.dy===0&&this.m11===1&&this.m12===0&&this.m21===0&&this.m22===1},Pt.prototype.reset=function(){return this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0,this},Pt.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},Pt.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},Pt.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},Pt.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},Ce=Pt.prototype,Ce.translate=function(a,y){return this.dx+=this.m11*a+this.m21*y,this.dy+=this.m12*a+this.m22*y,this},Ce.scale=function(a,y){return y===void 0&&(y=a),this.m11*=a,this.m12*=a,this.m21*=y,this.m22*=y,this},Ce.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)},Ce.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))},Ce.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))},Ce.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,le=this.dx,he=this.dy,ge=y*z+x*re+le,xe=y*ee+x*oe+he,Pe=E*z+x*re+le,Fe=E*ee+x*oe+he;return x=y*z+b*re+le,y=y*ee+b*oe+he,z=E*z+b*re+le,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},Pt.alloc=function(){var a=ln.pop();return a===void 0?new Pt:a},Pt.free=function(a){ln.push(a)},Pt.prototype.transformRect=Pt.prototype.pp,Pt.prototype.transformPoint=Pt.prototype.Ga,Pt.prototype.scale=Pt.prototype.scale,Pt.prototype.translate=Pt.prototype.translate,Pt.prototype.rotate=Pt.prototype.rotate,Pt.prototype.invert=Pt.prototype.Vj,Pt.prototype.multiplyInverted=Pt.prototype.bv,Pt.prototype.multiply=Pt.prototype.multiply,Pt.prototype.reset=Pt.prototype.reset,Pt.prototype.isIdentity=Pt.prototype.ws,Pt.prototype.equals=Pt.prototype.D,Pt.prototype.setTransform=Pt.prototype.setTransform,Pt.prototype.set=Pt.prototype.set;var ln=[];Pt.className="Transform",Pt.xF="54a702f3e53909c447824c6706603faf4c";var He={AA:"7da71ca0ad381e90",wg:(Math.sqrt(2)-1)/3*4,Uv:null,sqrt:function(a){if(0>=a)return 0;var y=He.Uv;if(y===null){y=[];for(var x=0;2e3>=x;x++)y[x]=Math.sqrt(x);He.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 le=y,he=E;else le=E,he=y;if(a===x)return le<=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,le-=b,le<=ee&&ee<=he))if(oe-re>he-le)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,le,he,ge){if(He.Yb(a,y,ee,re,ge,x,E)&&He.Yb(a,y,ee,re,ge,b,z))return He.Yb(a,y,ee,re,ge,le,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 Xe=(E+Fe)/2,Ve=(x+Ne)/2;return He.cs(a,y,xe,Pe,E,x,Xe,Ve,oe,le,he,ge)||He.cs(Xe,Ve,Fe,Ne,b,z,ee,re,oe,le,he,ge)},ax:function(a,y,x,E,b,z,ee,re,oe){var le=(x+b)/2,he=(E+z)/2;return oe.h((((a+x)/2+le)/2+(le+(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,le=(E+z)/2;return qi(((a+x)/2+oe)/2,((y+E)/2+le)/2,(oe+(b+ee)/2)/2,(le+(z+re)/2)/2)},Dl:function(a,y,x,E,b,z,ee,re,oe,le){if(He.Yb(a,y,ee,re,oe,x,E)&&He.Yb(a,y,ee,re,oe,b,z))Uo(le,a,y,0,0),Uo(le,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;He.Dl(a,y,he,ge,E,x,Fe,Ne,oe,le),He.Dl(Fe,Ne,xe,Pe,b,z,ee,re,oe,le)}return le},Qe:function(a,y,x,E,b,z,ee,re,oe,le){if(He.Yb(a,y,ee,re,oe,x,E)&&He.Yb(a,y,ee,re,oe,b,z))le.length===0&&(le.push(a),le.push(y)),le.push(ee),le.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;He.Qe(a,y,he,ge,E,x,Fe,Ne,oe,le),He.Qe(Fe,Ne,xe,Pe,b,z,ee,re,oe,le)}return le},jv:function(a,y,x,E,b,z,ee,re,oe,le){if(He.Yb(a,y,b,z,le,x,E))return He.Yb(a,y,b,z,le,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 He.jv(a,y,he,ge,xe,Pe,ee,re,oe,le)||He.jv(xe,Pe,x,E,b,z,ee,re,oe,le)},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(He.Yb(a,y,b,z,ee,x,E))Uo(re,a,y,0,0),Uo(re,b,z,0,0);else{var oe=(a+x)/2,le=(y+E)/2;x=(x+b)/2,E=(E+z)/2;var he=(oe+x)/2,ge=(le+E)/2;He.iv(a,y,oe,le,he,ge,ee,re),He.iv(he,ge,x,E,b,z,ee,re)}return re},ep:function(a,y,x,E,b,z,ee,re){if(He.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,le=(y+E)/2;x=(x+b)/2,E=(E+z)/2;var he=(oe+x)/2,ge=(le+E)/2;He.ep(a,y,oe,le,he,ge,ee,re),He.ep(he,ge,x,E,b,z,ee,re)}return re},Eo:function(a,y,x,E,b,z,ee,re,oe,le,he,ge,xe,Pe){if(He.Yb(a,y,ee,re,xe,x,E)&&He.Yb(a,y,ee,re,xe,b,z))return!He.Rl(a,y,ee,re,oe,le,he,ge)||(xe=(a-ee)*(le-ge)-(y-re)*(oe-he),xe===0)?!1:(Pe.h(((a*re-y*ee)*(oe-he)-(a-ee)*(oe*ge-le*he))/xe,((a*re-y*ee)*(le-ge)-(y-re)*(oe*ge-le*he))/xe),!0);var Fe=(a+x)/2,Ne=(y+E)/2,Xe=(x+b)/2,Ve=(E+z)/2;b=(b+ee)/2,z=(z+re)/2,E=(Fe+Xe)/2,x=(Ne+Ve)/2,Xe=(Xe+b)/2,Ve=(Ve+z)/2;var st=(E+Xe)/2,ht=(x+Ve)/2,pt=1/0,Et=!1,Gt=0,xi=0;return He.Eo(a,y,Fe,Ne,E,x,st,ht,oe,le,he,ge,xe,Pe)&&(a=(Pe.x-oe)*(Pe.x-oe)+(Pe.y-le)*(Pe.y-le),a<pt&&(pt=a,Et=!0,Gt=Pe.x,xi=Pe.y)),He.Eo(st,ht,Xe,Ve,b,z,ee,re,oe,le,he,ge,xe,Pe)&&(Pe.x-oe)*(Pe.x-oe)+(Pe.y-le)*(Pe.y-le)<pt&&(Et=!0,Gt=Pe.x,xi=Pe.y),Et&&(Pe.x=Gt,Pe.y=xi),Et},Fo:function(a,y,x,E,b,z,ee,re,oe,le,he,ge,xe){var Pe=0;if(He.Yb(a,y,ee,re,xe,x,E)&&He.Yb(a,y,ee,re,xe,b,z)){if(xe=(a-ee)*(le-ge)-(y-re)*(oe-he),xe===0)return Pe;var Fe=((a*re-y*ee)*(oe-he)-(a-ee)*(oe*ge-le*he))/xe,Ne=((a*re-y*ee)*(le-ge)-(y-re)*(oe*ge-le*he))/xe;if(Fe>=he)return Pe;if((oe>he?oe-he:he-oe)<(le>ge?le-ge:ge-le)){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 Xe=(x+b)/2,Ve=(E+z)/2;b=(b+ee)/2,z=(z+re)/2,E=(Fe+Xe)/2,x=(Ne+Ve)/2,Xe=(Xe+b)/2,Ve=(Ve+z)/2;var st=(E+Xe)/2,ht=(x+Ve)/2;Pe+=He.Fo(a,y,Fe,Ne,E,x,st,ht,oe,le,he,ge,xe),Pe+=He.Fo(st,ht,Xe,Ve,b,z,ee,re,oe,le,he,ge,xe)}return Pe},qh:function(a,y,x,E,b,z,ee){return He.$(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)):He.$(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 He.B(a,x)&&He.B(y,E)?(oe.h(a,y),!1):He.$(b,ee)?He.$(a,x)?(He.qh(a,y,x,E,b,z,oe),!1):He.qh(a,y,x,E,b,(E-y)/(x-a)*(b-a)+y,oe):(re=(re-z)/(ee-b),He.$(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),He.$(re,ee)?(He.qh(a,y,x,E,b,z,oe),!1):(b=(ee*a-re*b+z-y)/(ee-re),He.$(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)):He.qh(a,y,x,E,b,ee*(b-a)+y,oe))))},MA:function(a,y,x,E,b){return He.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,le){function he(Xe,Ve){var st=(Xe-a)*(Xe-a)+(Ve-y)*(Ve-y);st<ge&&(ge=st,oe.h(Xe,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+le,le=(Ne-Fe)/2+le,b=(b+ee)/2,z=(z+re)/2,xe===0||le===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=-le*xe+z,he(x,le*xe+z),he(x,E)}else{if(x=(E-y)/(x-a),E=1/(xe*xe)+x*x/(le*le),re=2*x*(y-x*a)/(le*le)-2*x*z/(le*le)-2*b/(xe*xe),xe=re*re-4*E*(2*x*a*z/(le*le)-2*y*z/(le*le)+z*z/(le*le)+b*b/(xe*xe)-1+(y-x*a)*(y-x*a)/(le*le)),0>xe)return oe;xe=Math.sqrt(xe),le=(-re+xe)/(2*E),he(le,x*le-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 le=1e21,he=a,ge=y;if(He.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<le&&(le=xe,he=oe.x,ge=oe.y)}return He.Ve(x,y,x,E,b,z,ee,re,oe)&&(xe=(oe.x-b)*(oe.x-b)+(oe.y-z)*(oe.y-z),xe<le&&(le=xe,he=oe.x,ge=oe.y)),He.Ve(a,y,x,y,b,z,ee,re,oe)&&(y=(oe.x-b)*(oe.x-b)+(oe.y-z)*(oe.y-z),y<le&&(le=y,he=oe.x,ge=oe.y)),He.Ve(a,E,x,E,b,z,ee,re,oe)&&(a=(oe.x-b)*(oe.x-b)+(oe.y-z)*(oe.y-z),a<le&&(le=a,he=oe.x,ge=oe.y)),oe.h(he,ge),1e21>le},us:function(a,y,x){return He.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,le=y+E;return b===ee?(z<re?(ee=z,z=re):ee=re,a<=b&&b<=oe&&ee<=le&&z>=y):z===re?(b<ee?(re=b,b=ee):re=ee,y<=z&&z<=le&&re<=oe&&b>=a):!!(Fo(a,y,x,E,b,z)||Fo(a,y,x,E,ee,re)||He.Rl(a,y,oe,y,b,z,ee,re)||He.Rl(oe,y,oe,le,b,z,ee,re)||He.Rl(oe,le,a,le,b,z,ee,re)||He.Rl(a,le,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>=He.Fl(a,y,x,E,b,z)*He.Fl(a,y,x,E,ee,re)&&0>=He.Fl(b,z,ee,re,a,y)*He.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,le=E;if(E=Math.min(2*ee,Math.abs(b-E)),1e-5>E)return oe=le+re*Math.min(E,oe),re=a+x*Math.cos(le),le=y+x*Math.sin(le),a+=x*Math.cos(oe),y+=x*Math.sin(oe),x=(re+a)/2,oe=(le+y)/2,z.push([re,le,x,oe,x,oe,a,y]),z;for(;1e-5<E;)b=le+re*Math.min(E,oe),z.push(He.Vy(x,le,b,a,y)),E-=Math.abs(b-le),le=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,le=ee*ee+oe*oe,he=le+ee*ee+oe*re;return le=4/3*(Math.sqrt(2*le*he)-he)/(ee*re-oe*ee),re=ee-le*oe,ee=oe+le*ee,oe=-ee,le=z+y,z=Math.cos(le),le=Math.sin(le),[E+a*Math.cos(y),b+a*Math.sin(y),E+re*z-ee*le,b+re*le+ee*z,E+re*z-oe*le,b+re*le+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,le=ee===0?x:E;return(ee===0?b:z)&&(le=-le),ee=re,x=ee===0?x:E,(ee===0?b:z)&&(x=-x),He.az(oe,ee===0?a:y,le,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 le=0;9999999999>le&&(y=.5*(re+oe),!(y===re||y===oe));++le){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 Sr,um:new Sr,Mf:new Sr,Nf:0,vm:100};He.za=He.AA;function Dt(a){wr(this),this.l=2,a===void 0&&(a=Dt.o),this.na=a,this.Ec=this.Dc=this.pd=this.od=0,a===Dt.o?this.ee=new Tn:(Dt.V===null&&(Dt.V=new Tn().freeze()),this.ee=Dt.V),this.aq=this.ee.Ja,this.Ip=new zt().freeze(),this.ym=this.tk=null,this.zm=NaN,this.fg=Xo,this.gg=Xt,this.Rk=this.Sk=NaN,this.Uf=Gn}Dt.prototype.copy=function(){var a=new Dt;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===Dt.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},Dt.prototype.ja=function(){return this.freeze(),Object.freeze(this),this},Dt.prototype.freeze=function(){if(this._isFrozen=!0,this.type!==Dt.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},Dt.prototype.ka=function(){if(Object.isFrozen(this)&&it("cannot thaw constant: "+this),this._isFrozen=!1,this.type!==Dt.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},Dt.prototype.Xa=function(a){if(!(a instanceof Dt))return!1;if(this.type!==a.type)return this.type===Dt.j&&a.type===Dt.o?Xi(this,a):a.type===Dt.j&&this.type===Dt.o?Xi(a,this):!1;if(this.type===Dt.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 He.B(this.startX,a.startX)&&He.B(this.startY,a.startY)&&He.B(this.endX,a.endX)&&He.B(this.endY,a.endY)};function Xi(a,y){return a.type!==Dt.j||y.type!==Dt.o?!1:!!(y.figures.count===1&&(y=y.figures.M(0),y.segments.count===1&&He.B(a.startX,y.startX)&&He.B(a.startY,y.startY)&&(y=y.segments.M(0),y.type===Ci&&He.B(a.endX,y.endX)&&He.B(a.endY,y.endY))))}Dt.ia=function(a){return a.toString()},Dt.prototype.qb=function(a){a.classType===Dt&&(this.type=a)},Dt.prototype.toString=function(a){switch(a===void 0&&(a=-1),this.type){case Dt.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 Dt.u:var y=new zt(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 Dt.F:if(y=new zt(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 Dt.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()}},Dt.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},Dt.parse=function(a,y){function x(){return Ne>=pt-1?!0:le[Ne+1].match(Et)!==null}function E(){return Ne++,le[Ne]}function b(Qr){var Gr=parseFloat(E()),oa=parseFloat(E());Xe===Xe.toLowerCase()&&(Gr=ht.x+Gr,oa=ht.y+oa),Qr.h(Gr,oa)}function z(){return b(ht),ht}function ee(){return b(st),st}function re(){var Qr=Ve.toLowerCase();return Qr!=="c"&&Qr!=="s"&&Qr!=="q"&&Qr!=="t"?ht:new _e(2*ht.x-st.x,2*ht.y-st.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 le=a.split(" ");for(a=0;a<le.length;a++){var he=le[a];if(he.match(/(\.[0-9]*)(\.)/gm)!==null){oe=Hi();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),le.splice(a,1),he=0;he<oe.length;he++)le.splice(a+he,0,oe[he]);a+=oe.length-1,Mi(oe)}}var Ne=-1,Xe="",Ve="";oe=new _e(0,0);var st=new _e(0,0),ht=new _e(0,0),pt=le.length;a=A1(null),xe=ge=he=!1,Pe=!0,Fe=null;for(var Et=/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/;!(Ne>=pt-1);)if(Ve=Xe,Xe=E(),Xe!=="")switch(Xe.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(ht);!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();)ht=new _e((Xe===Xe.toLowerCase()?ht.x:0)+parseFloat(E()),ht.y),a.lineTo(ht.x,ht.y);break;case"V":for(;!x();)ht=new _e(ht.x,(Xe===Xe.toLowerCase()?ht.y:0)+parseFloat(E())),a.lineTo(ht.x,ht.y);break;case"C":for(;!x();){Fe=new _e,b(Fe);var Gt=ee(),xi=z();tc(a,Fe.x,Fe.y,Gt.x,Gt.y,xi.x,xi.y)}break;case"S":for(;!x();)Fe=re(),Gt=ee(),xi=z(),tc(a,Fe.x,Fe.y,Gt.x,Gt.y,xi.x,xi.y);break;case"Q":for(;!x();)Fe=ee(),Gt=z(),u0(a,Fe.x,Fe.y,Gt.x,Gt.y);break;case"T":for(;!x();)st=Fe=re(),Gt=z(),u0(a,Fe.x,Fe.y,Gt.x,Gt.y);break;case"B":for(;!x();){Fe=parseFloat(E()),Gt=parseFloat(E()),xi=parseFloat(E());var Ki=parseFloat(E()),ji=parseFloat(E()),ei=ji,En=!1;x()||(ei=parseFloat(E()),x()||(En=parseFloat(E())!==0)),Xe===Xe.toLowerCase()&&(xi+=ht.x,Ki+=ht.y),a.arcTo(Fe,Gt,xi,Ki,ji,ei,En)}break;case"A":for(;!x();)Fe=Math.abs(parseFloat(E())),Gt=Math.abs(parseFloat(E())),xi=parseFloat(E()),ji=Ki=!1,En=ei=0,ei=E(),ei.length===1?(Ki=!!parseFloat(ei),ji=!!parseFloat(E()),ei=parseFloat(E())):ei.length===2?(Ki=!!parseFloat(ei[0]),ji=!!parseFloat(ei[1]),ei=parseFloat(E())):(Ki=!!parseFloat(ei[0]),ji=!!parseFloat(ei[1]),ei=parseFloat(ei.slice(2))),En=parseFloat(E()),Xe===Xe.toLowerCase()&&(ei=ht.x+ei,En=ht.y+En),ht.h(ei,En),PS(a,Fe,Gt,xi,Ki,ji,ei,En);break;case"Z":wS(a),ht.assign(oe);break;case"F":for(Fe="",Gt=1;le[Ne+Gt];)if(le[Ne+Gt]==="0")xe=!0,Gt++;else if(le[Ne+Gt].match(/[Uu]/)!==null)Gt++;else if(le[Ne+Gt].match(Et)===null)Gt++;else{Fe=le[Ne+Gt];break}Fe.match(/[Mm]/)?he=!0:0<a.mc.segments.length&&(a.mc.isFilled=!0);break;case"U":for(Fe="",Gt=1;le[Ne+Gt];)if(le[Ne+Gt].match(/[Ff]/)!==null)Gt++;else if(le[Ne+Gt].match(Et)===null)Gt++;else{Fe=le[Ne+Gt];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},Dt.Ha=function(a,y){for(var x=a.length,E=_e.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}_e.free(E)},Dt.prototype.Zu=function(){if(this._isInvalidBounds)return!0;if(this.type===Dt.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},Dt.prototype.computeBounds=function(){if(this._isInvalidBounds=!1,this.ym=this.tk=null,this.zm=NaN,this.type===Dt.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),Mr(this,a,!1),Uo(a,0,0,0,0),a.freeze()},Dt.prototype.ix=function(){var a=new zt;return Mr(this,a,!0),a};function Mr(a,y,x){switch(a.type){case Dt.j:case Dt.u:case Dt.F:x?y.h(a.od,a.pd,0,0):Uo(y,a.od,a.pd,0,0),Uo(y,a.Dc,a.Ec,0,0);break;case Dt.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):Uo(y,z.startX,z.startY,0,0);for(var ee=z.segments.s,re=ee.length,oe=z.startX,le=z.startY,he=0;he<re;he++){var ge=ee[he];switch(ge.type){case Ci:case _i:oe=ge.endX,le=ge.endY,Uo(y,oe,le,0,0);break;case Dr:He.Dl(oe,le,ge.point1X,ge.point1Y,ge.point2X,ge.point2Y,ge.endX,ge.endY,.5,y),oe=ge.endX,le=ge.endY;break;case ko:He.iv(oe,le,ge.point1X,ge.point1Y,ge.endX,ge.endY,.5,y),oe=ge.endX,le=ge.endY;break;case br:case Cr:var xe=ge.type===br?cr(ge,z):yr(ge,z,oe,le),Pe=xe.length;if(Pe===0){oe=ge.type===br?ge.centerX:ge.endX,le=ge.type===br?ge.centerY:ge.endY,Uo(y,oe,le,0,0);break}ge=null;for(var Fe=0;Fe<Pe;Fe++)ge=xe[Fe],He.Dl(ge[0],ge[1],ge[2],ge[3],ge[4],ge[5],ge[6],ge[7],.5,y);ge!==null&&(oe=ge[6],le=ge[7]);break;default:it("Unknown Segment type: "+ge.type)}}}break;default:it("Unknown Geometry type: "+a.type)}}Dt.prototype.normalize=function(){this._isFrozen&&sn(this);var a=this.ix();return this.offset(-a.x,-a.y),new _e(-a.x,-a.y)},Dt.prototype.offset=function(a,y){return this._isFrozen&&sn(this),this.transform(1,0,0,1,a,y),this},Dt.prototype.scale=function(a,y){return this._isFrozen&&sn(this),this.transform(a,0,0,y,0,0),this},Dt.prototype.rotate=function(a,y,x){this._isFrozen&&sn(this),y===void 0&&(y=0),x===void 0&&(x=0);var E=Pt.alloc();return E.reset(),E.rotate(a,y,x),this.transform(E.m11,E.m12,E.m21,E.m22,E.dx,E.dy),Pt.free(E),this},Ce=Dt.prototype,Ce.transform=function(a,y,x,E,b,z){switch(this.type){case Dt.j:case Dt.u:case Dt.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 Dt.o:for(var oe=this.figures.s,le=oe.length,he=0;he<le;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 Ci:case _i:ee=Fe.endX,re=Fe.endY,Fe.endX=ee*a+re*x+b,Fe.endY=ee*y+re*E+z;break;case Dr: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 ko: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 br: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 Cr: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:it("Unknown Segment type: "+Fe.type)}}}}return this._isInvalidBounds=!0,this},Ce.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 Dt.j:return He.Yb(x,E,b,z,y,a.x,a.y);case Dt.u:var ee=zt.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),zt.free(ee),a;case Dt.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 Dt.o:return Qi(this,a,y,!0,!1);default:return!1}};function Qi(a,y,x,E,b){var z=y.x;y=y.y;for(var ee=a.bounds.x-20,re=0,oe,le,he,ge,xe=a.figures.s,Pe=xe.length,Fe=0;Fe<Pe;Fe++){var Ne=xe[Fe],Xe=!Ne.isEvenOdd;if(Ne.isFilled){if(E&&Ne.ca(z,y,x))return!0;var Ve=Ne.segments;oe=Ne.startX,le=Ne.startY;for(var st=oe,ht=le,pt=Ve.s,Et=0;Et<=Ve.length;Et++){var Gt=void 0;if(Et!==Ve.length){Gt=pt[Et];var xi=Gt.type;a=Gt.endX,ge=Gt.endY}else xi=Ci,a=st,ge=ht;switch(xi){case _i:if(st=$i(z,y,ee,y,oe,le,st,ht),isNaN(st))return!0;re+=st,st=a,ht=ge;break;case Ci:if(oe=$i(z,y,ee,y,oe,le,a,ge),isNaN(oe))return!0;re+=oe;break;case Dr:he=He.Fo(oe,le,Gt.point1X,Gt.point1Y,Gt.point2X,Gt.point2Y,a,ge,ee,y,z,y,.5),re+=he;break;case ko:he=He.Fo(oe,le,(oe+2*Gt.point1X)/3,(le+2*Gt.point1Y)/3,(2*Gt.point1X+a)/3,(2*Gt.point1Y+ge)/3,a,ge,ee,y,z,y,.5),re+=he;break;case br:case Cr:xi=Gt.type===br?cr(Gt,Ne):yr(Gt,Ne,oe,le);var Ki=xi.length;if(Ki===0){if(oe=$i(z,y,ee,y,oe,le,Gt.type===br?Gt.centerX:Gt.endX,Gt.type===br?Gt.centerY:Gt.endY),isNaN(oe))return!0;re+=oe;break}Gt=null;for(var ji=0;ji<Ki;ji++){if(Gt=xi[ji],ji===0){if(he=$i(z,y,ee,y,oe,le,Gt[0],Gt[1]),isNaN(he))return!0;re+=he}he=He.Fo(Gt[0],Gt[1],Gt[2],Gt[3],Gt[4],Gt[5],Gt[6],Gt[7],ee,y,z,y,.5),re+=he}Gt!==null&&(a=Gt[6],ge=Gt[7]);break;default:it("Unknown Segment type: "+Gt.type)}oe=a,le=ge}if(Xe){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 $i(a,y,x,E,b,z,ee,re){if(He.Yb(b,z,ee,re,.05,a,y))return NaN;var oe=(a-x)*(z-re);if(oe===0)return 0;var le=((a*E-y*x)*(b-ee)-(a-x)*(b*re-z*ee))/oe;if(y=(a*E-y*x)*(z-re)/oe,le>=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(le<b||le>ee)return 0}else if(le<ee||le>b)return 0;return 0<oe?1:-1}function wi(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}Ce.Pu=function(a,y){if(0>a?a=0:1<a&&(a=1),y===void 0&&(y=new _e),this.type===Dt.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],le=oe.length;for(a=0;a<le;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},Ce.wx=function(a){if(0>a?a=0:1<a&&(a=1),this.type===Dt.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 le=re[a];if(z+le>=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+=le}}return NaN},Ce.Qu=function(a,y){if(0>a?a=0:1<a&&(a=1),y===void 0&&(y=[]),y.length=3,this.type===Dt.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],le=oe.length;for(a=0;a<le;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},Ce.xx=function(a){if(this.type===Dt.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=_e.alloc();return He.qh(y,x,E,b,z,a,re),a=re.x,z=re.y,_e.free(re),Math.sqrt(((a-y)*(a-y)+(z-x)*(z-x))/ee)}}else if(this.type===Dt.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 le=Math.min(ee,oe,re,b);if(le===re)return E/z;if(le===oe)return(y+a)/z;if(le===b)return(2*y+x-E)/z;if(le===ee)return(2*y+2*x-a)/z}}else{y=this.flattenedSegments,x=this.flattenedLengths,z=this.flattenedTotalLength,E=_e.alloc(),b=1/0,re=ee=0,oe=y.length;for(var he=le=0,ge=0;ge<oe;ge++)for(var xe=y[ge],Pe=x[ge],Fe=xe.length,Ne=0;Ne<Fe;Ne+=2){var Xe=xe[Ne],Ve=xe[Ne+1];if(Ne!==0){He.qh(le,he,Xe,Ve,a.x,a.y,E);var st=(E.x-a.x)*(E.x-a.x)+(E.y-a.y)*(E.y-a.y);st<b&&(b=st,ee=re,ee+=Math.sqrt((E.x-le)*(E.x-le)+(E.y-he)*(E.y-he))),re+=Pe[(Ne-2)/2]}le=Xe,he=Ve}return _e.free(E),a=ee/z,0>a?0:1<a?1:a}return 0};function pr(a){if(a.tk===null){var y=a.tk=[],x=a.ym=[],E=[],b=[];if(a.type===Dt.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===Dt.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===Dt.F){var z=new no;z.startX=a.endX,z.startY=(a.startY+a.endY)/2;var ee=new lr(br);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=cr(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];He.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(Hr(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 le=b.segments.s,he=le.length,ge=0;ge<he;ge++){var xe=le[ge];switch(xe.type){case _i:4<=E.length&&(y.push(E),x.push(Hr(E))),E=[],E.push(xe.endX),E.push(xe.endY),ee=xe.endX,z=xe.endY,re=ee,oe=z;break;case Ci:E.push(xe.endX),E.push(xe.endY),ee=xe.endX,z=xe.endY;break;case Dr:He.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 ko:He.ep(ee,z,xe.point1X,xe.point1Y,xe.endX,xe.endY,.5,E),ee=xe.endX,z=xe.endY;break;case br:var Pe=cr(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 Xe=Pe[Ne];He.Qe(ee,z,Xe[2],Xe[3],Xe[4],Xe[5],Xe[6],Xe[7],.5,E),ee=Xe[6],z=Xe[7]}break;case Cr:if(Pe=yr(xe,b,ee,z),Fe=Pe.length,Ne=xe.endX,Xe=xe.endY,Fe===0){E.push(Ne),E.push(Xe),ee=Ne,z=Xe;break}for(Ne=0;Ne<Fe;Ne++)Xe=Pe[Ne],He.Qe(ee,z,Xe[2],Xe[3],Xe[4],Xe[5],Xe[6],Xe[7],.5,E),ee=Xe[6],z=Xe[7];break;default:it("Segment not of valid type: "+xe.type)}xe.isClosed&&(E.push(re),E.push(oe))}4<=E.length&&(y.push(E),x.push(Hr(E)))}}}function Hr(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(gr(x,E,ee,re))),x=ee,E=re}return y}Ce.add=function(a){return this.ee.add(a),this},Ce.pm=function(a,y,x,E,b,z,ee,re){return this._isFrozen&&sn(this),this.fg=new ni(a,y,b,z).freeze(),this.gg=new ni(x,E,ee,re).freeze(),this},kt.Object.defineProperties(Dt.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 pr(this),this.tk}},flattenedLengths:{get:function(){return pr(this),this.ym}},flattenedTotalLength:{get:function(){var a=this.zm;if(isNaN(a)){if(this.type===Dt.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===Dt.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&&sn(this,a),this.na=a,a===Dt.o?this.ee=new Tn:(Dt.V===null&&(Dt.V=new Tn().freeze()),this.ee=Dt.V),this._isInvalidBounds=!0)}},startX:{get:function(){return this.od},set:function(a){this.od!==a&&(this._isFrozen&&sn(this,a),this.od=a,this._isInvalidBounds=!0)}},startY:{get:function(){return this.pd},set:function(a){this.pd!==a&&(this._isFrozen&&sn(this,a),this.pd=a,this._isInvalidBounds=!0)}},endX:{get:function(){return this.Dc},set:function(a){this.Dc!==a&&(this._isFrozen&&sn(this,a),this.Dc=a,this._isInvalidBounds=!0)}},endY:{get:function(){return this.Ec},set:function(a){this.Ec!==a&&(this._isFrozen&&sn(this,a),this.Ec=a,this._isInvalidBounds=!0)}},figures:{get:function(){return this.ee},set:function(a){this.ee!==a&&(this._isFrozen&&sn(this,a),this.ee=a,this._isInvalidBounds=!0)}},spot1:{get:function(){return this.fg},set:function(a){this._isFrozen&&sn(this,a),this.fg=a.J()}},spot2:{get:function(){return this.gg},set:function(a){this._isFrozen&&sn(this,a),this.gg=a.J()}},defaultStretch:{get:function(){return this.Uf},set:function(a){this._isFrozen&&sn(this,a),this.Uf=a}},bounds:{get:function(){return this.Zu()&&this.computeBounds(),this.Ip}}}),Dt.prototype.setSpots=Dt.prototype.pm,Dt.prototype.add=Dt.prototype.add,Dt.prototype.getFractionForPoint=Dt.prototype.xx,Dt.prototype.getPointAndAngleAlongPath=Dt.prototype.Qu,Dt.prototype.getAngleAlongPath=Dt.prototype.wx,Dt.prototype.getPointAlongPath=Dt.prototype.Pu,Dt.prototype.containsPoint=Dt.prototype.ca,Dt.prototype.transform=Dt.prototype.transform,Dt.prototype.rotate=Dt.prototype.rotate,Dt.prototype.scale=Dt.prototype.scale,Dt.prototype.offset=Dt.prototype.offset,Dt.prototype.normalize=Dt.prototype.normalize,Dt.prototype.computeBoundsWithoutOrigin=Dt.prototype.ix,Dt.prototype.equalsApprox=Dt.prototype.Xa,Dt.className="Geometry",Dt.j=new en(Dt,"Line",0),Dt.u=new en(Dt,"Rectangle",1),Dt.F=new en(Dt,"Ellipse",2),Dt.o=new en(Dt,"Path",3),Dt.V=null,Dt.hb="UuBbMmZzLlHhVvCcSsQqTtAaFfXx",Dt.className="Geometry",Dt.stringify=Dt.ia,Dt.fillPath=Dt.nb,Dt.parse=Dt.parse,Dt.Line=Dt.j,Dt.Rectangle=Dt.u,Dt.Ellipse=Dt.F,Dt.Path=Dt.o;function no(a,y,x,E,b){wr(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 Tn,this.sr=this.pl.Ja,this.fw=null}no.prototype.copy=function(){var a=new no;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},Ce=no.prototype,Ce.Xa=function(a){if(!(a instanceof no&&He.B(this.startX,a.startX)&&He.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},Ce.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},Ce.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},Ce.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},Ce.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},Ce.add=function(a){return this.pl.add(a),this},Ce.ca=function(a,y,x){for(var E=this.startX,b=this.startY,z=E,ee=b,re=this.segments.s,oe=re.length,le=0;le<oe;le++){var he=re[le];switch(he.type){case _i:z=he.endX,ee=he.endY,E=he.endX,b=he.endY;break;case Ci:if(He.Yb(E,b,he.endX,he.endY,x,a,y))return!0;E=he.endX,b=he.endY;break;case Dr:if(He.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 ko:if(He.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 br:case Cr:var ge=he.type===br?cr(he,this):yr(he,this,E,b),xe=ge.length,Pe=he.type===br?he.centerX:he.endX,Fe=he.type===br?he.centerY:he.endY;if(xe===0){if(He.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&&He.Yb(E,b,Pe[0],Pe[1],x,a,y)||He.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:it("Unknown Segment type: "+he.type)}if(he.isClosed&&(E!==z||b!==ee)&&He.Yb(E,b,z,ee,x,a,y))return!0}return!1},kt.Object.defineProperties(no.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&&sn(this,a),this.l=a?this.l|4:this.l&-5}},isShadowed:{get:function(){return(this.l&8)!==0},set:function(a){this._isFrozen&&sn(this,a),this.l=a?this.l|8:this.l&-9}},isEvenOdd:{get:function(){return(this.l&16)!==0},set:function(a){this._isFrozen&&sn(this,a),this.l=a?this.l|16:this.l&-17}},startX:{get:function(){return this.od},set:function(a){this._isFrozen&&sn(this,a),this.od=a,this._isInvalidBounds=!0}},startY:{get:function(){return this.pd},set:function(a){this._isFrozen&&sn(this,a),this.pd=a,this._isInvalidBounds=!0}},segments:{get:function(){return this.pl},set:function(a){this._isFrozen&&sn(this,a),this.pl=a,this._isInvalidBounds=!0}}}),no.prototype.add=no.prototype.add,no.prototype.equalsApprox=no.prototype.Xa,no.className="PathFigure";function lr(a,y,x,E,b,z,ee,re){wr(this),a===void 0&&(a=Ci),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===Cr?(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===br&&(z=Math.max(z,0)),this.Wh=z,typeof ee=="number"?(a===br&&(ee=Math.max(ee,0)),this.Pg=ee):this.Pg=0),this.ae=null}lr.prototype.copy=function(){var a=new lr;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},Ce=lr.prototype,Ce.Xa=function(a){if(!(a instanceof lr)||this.type!==a.type||this.isClosed!==a.isClosed)return!1;switch(this.type){case _i:case Ci:return He.B(this.endX,a.endX)&&He.B(this.endY,a.endY);case Dr:return He.B(this.endX,a.endX)&&He.B(this.endY,a.endY)&&He.B(this.point1X,a.point1X)&&He.B(this.point1Y,a.point1Y)&&He.B(this.point2X,a.point2X)&&He.B(this.point2Y,a.point2Y);case ko:return He.B(this.endX,a.endX)&&He.B(this.endY,a.endY)&&He.B(this.point1X,a.point1X)&&He.B(this.point1Y,a.point1Y);case br:return He.B(this.startAngle,a.startAngle)&&He.B(this.sweepAngle,a.sweepAngle)&&He.B(this.centerX,a.centerX)&&He.B(this.centerY,a.centerY)&&He.B(this.radiusX,a.radiusX)&&He.B(this.radiusY,a.radiusY);case Cr:return this.isClockwiseArc===a.isClockwiseArc&&this.isLargeArc===a.isLargeArc&&He.B(this.xAxisRotation,a.xAxisRotation)&&He.B(this.endX,a.endX)&&He.B(this.endY,a.endY)&&He.B(this.radiusX,a.radiusX)&&He.B(this.radiusY,a.radiusY);default:return!1}},Ce.qb=function(a){a.classType===lr&&(this.type=a)},Ce.toString=function(a){switch(a===void 0&&(a=-1),this.type){case _i:a=0>a?"M"+this.endX.toString()+" "+this.endY.toString():"M"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Ci:a=0>a?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Dr: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 ko: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 br: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 Cr: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":"")},Ce.freeze=function(){return this._isFrozen=!0,this},Ce.ka=function(){return this._isFrozen=!1,this},Ce.close=function(){return this.isClosed=!0,this};function cr(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=He.jx(0,0,x<E?x:E,a.startAngle,a.startAngle+a.sweepAngle,!1);if(x!==E){var ee=Pt.alloc();ee.reset(),x<E?ee.scale(1,E/x):ee.scale(x/E,1),Dt.Ha(z,ee),Pt.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 yr(a,y,x,E){function b(Ne,Xe,Ve,st){return(Ne*st<Xe*Ve?-1:1)*Math.acos((Ne*Ve+Xe*st)/(Math.sqrt(Ne*Ne+Xe*Xe)*Math.sqrt(Ve*Ve+st*st)))}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,le=a.Dc,he=a.Ec,ge=Math.cos(ee),xe=Math.sin(ee),Pe=ge*(x-le)/2+xe*(E-he)/2;ee=-xe*(x-le)/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+le)/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,le=(ee-Fe)/z,Pe=(-Pe-re)/y,re=(-ee-Fe)/z,ee=b(ge,le,Pe,re),Pe=(ge*Pe+le*re)/(Math.sqrt(ge*ge+le*le)*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=He.jx(0,0,y>z?y:z,he,he+ee,!0),z=Pt.alloc(),z.reset(),z.translate(x,E),z.rotate(a.Ne,0,0),z.scale(oe,Pe),Dt.Ha(y,z),Pt.free(z),a.ae=y,a.ae}kt.Object.defineProperties(lr.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&&sn(this,a),this.na=a,this._isInvalidBounds=!0}},endX:{get:function(){return this.Dc},set:function(a){this._isFrozen&&sn(this,a),this.Dc=a,this._isInvalidBounds=!0}},endY:{get:function(){return this.Ec},set:function(a){this._isFrozen&&sn(this,a),this.Ec=a,this._isInvalidBounds=!0}},point1X:{get:function(){return this.Ne},set:function(a){this._isFrozen&&sn(this,a),this.Ne=a,this._isInvalidBounds=!0}},point1Y:{get:function(){return this.Vh},set:function(a){this._isFrozen&&sn(this,a),this.Vh=a,this._isInvalidBounds=!0}},point2X:{get:function(){return this.Wh},set:function(a){this._isFrozen&&sn(this,a),this.Wh=a,this._isInvalidBounds=!0}},point2Y:{get:function(){return this.Pg},set:function(a){this._isFrozen&&sn(this,a),this.Pg=a,this._isInvalidBounds=!0}},centerX:{get:function(){return this.Ne},set:function(a){this._isFrozen&&sn(this,a),this.Ne=a,this._isInvalidBounds=!0}},centerY:{get:function(){return this.Vh},set:function(a){this._isFrozen&&sn(this,a),this.Vh=a,this._isInvalidBounds=!0}},radiusX:{get:function(){return this.Wh},set:function(a){0>a&&Dn(a,">= zero",lr,"radiusX"),this._isFrozen&&sn(this,a),this.Wh=a,this._isInvalidBounds=!0}},radiusY:{get:function(){return this.Pg},set:function(a){0>a&&Dn(a,">= zero",lr,"radiusY"),this._isFrozen&&sn(this,a),this.Pg=a,this._isInvalidBounds=!0}},startAngle:{get:function(){return this.Dc},set:function(a){this._isFrozen&&sn(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&&sn(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&&sn(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&&sn(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&&sn(this,a),a%=360,0>a&&(a+=360),this.Ne=a,this._isInvalidBounds=!0}}}),lr.prototype.equalsApprox=lr.prototype.Xa;var _i=new en(lr,"Move",0),Ci=new en(lr,"Line",1),Dr=new en(lr,"Bezier",2),ko=new en(lr,"QuadraticBezier",3),br=new en(lr,"Arc",4),Cr=new en(lr,"SvgArc",4);lr.className="PathSegment",lr.Move=_i,lr.Line=Ci,lr.Bezier=Dr,lr.QuadraticBezier=ko,lr.Arc=br,lr.SvgArc=Cr;function Nr(){this.H=null,this.xu=new _e(0,0).freeze(),this.mt=new _e(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}Nr.prototype.copy=function(){var a=new Nr;return this.clone(a)},Nr.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},Nr.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},Nr.prototype.So=function(a,y){var x=this.diagram;return x===null||Pf(x,a,y),y},Nr.prototype.Bz=function(a,y){var x=this.diagram;return x===null||(Pf(x,a,y),y.assign(x.Ps(y))),y},kt.Object.defineProperties(Nr.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}}}),Nr.prototype.getMultiTouchDocumentPoint=Nr.prototype.Bz,Nr.prototype.getMultiTouchViewPoint=Nr.prototype.So,Nr.className="InputEvent";function Tr(){this.H=null,this.xa="",this.ar=this.Lr=null}Tr.prototype.copy=function(){var a=new Tr;return a.H=this.H,a.xa=this.xa,a.Lr=this.Lr,a.ar=this.ar,a},Tr.prototype.toString=function(){var a="*"+this.name;return this.subject!==null&&(a+=":"+this.subject.toString()),this.parameter!==null&&(a+="("+this.parameter.toString()+")"),a},kt.Object.defineProperties(Tr.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}}}),Tr.className="DiagramEvent";function sr(){this.Fm=Bo,this.rf=this.Qq="",this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null}sr.prototype.clear=function(){this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null},sr.prototype.copy=function(){var a=new sr;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=cn(y)&&typeof y.J=="function"?y.J():y,y=this.Rn,a.Rn=cn(y)&&typeof y.J=="function"?y.J():y,y=this.Mn,a.Mn=cn(y)&&typeof y.J=="function"?y.J():y,y=this.Ln,a.Ln=cn(y)&&typeof y.J=="function"?y.J():y,a},sr.prototype.qb=function(a){a.classType===sr&&(this.change=a)},sr.prototype.toString=function(){var a="";return a=this.change===ra?a+"* ":this.change===Bo?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===ra?this.oldValue!==null&&(a+=" "+this.oldValue):(this.object!==null&&(a+=dr(this.object)),this.oldValue!==null&&(a+=" old: "+dr(this.oldValue)),this.oldParam!==null&&(a+=" "+this.oldParam),this.newValue!==null&&(a+=" new: "+dr(this.newValue)),this.newParam!==null&&(a+=" "+this.newParam)),a},sr.prototype.I=function(a){return a?this.oldValue:this.newValue},sr.prototype.Dz=function(a){return a?this.oldParam:this.newParam},sr.prototype.canUndo=function(){return this.model!==null||this.diagram!==null},sr.prototype.undo=function(){this.canUndo()&&(this.model!==null?this.model.changeState(this,!0):this.diagram!==null&&this.diagram.changeState(this,!0))},sr.prototype.canRedo=function(){return this.model!==null||this.diagram!==null},sr.prototype.redo=function(){this.canRedo()&&(this.model!==null?this.model.changeState(this,!1):this.diagram!==null&&this.diagram.changeState(this,!1))},kt.Object.defineProperties(sr.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===ra&&(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}}}),sr.prototype.redo=sr.prototype.redo,sr.prototype.canRedo=sr.prototype.canRedo,sr.prototype.undo=sr.prototype.undo,sr.prototype.canUndo=sr.prototype.canUndo,sr.prototype.getParam=sr.prototype.Dz,sr.prototype.getValue=sr.prototype.I,sr.prototype.clear=sr.prototype.clear;var ra=new en(sr,"Transaction",-1),Bo=new en(sr,"Property",0),ta=new en(sr,"Insert",1),Sa=new en(sr,"Remove",2);sr.className="ChangedEvent",sr.Transaction=ra,sr.Property=Bo,sr.Insert=ta,sr.Remove=Sa;function ro(){this.o=new Tn().freeze(),this.xa="",this.j=!1}ro.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},ro.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()},ro.prototype.canUndo=function(){return this.isComplete},ro.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()}},ro.prototype.canRedo=function(){return this.isComplete},ro.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()}},ro.prototype.ak=function(){if(this.isComplete){var a=this.changes;a.ka();for(var y=new Ut,x=0;x<a.count;x++){var E=a.M(x);if(E!==null&&E.change===Bo&&E.object){var b=y.get(E.object);b||(b=new Ut,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()}},kt.Object.defineProperties(ro.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}}}),ro.prototype.optimize=ro.prototype.ak,ro.prototype.redo=ro.prototype.redo,ro.prototype.canRedo=ro.prototype.canRedo,ro.prototype.undo=ro.prototype.undo,ro.prototype.canUndo=ro.prototype.canUndo,ro.prototype.clear=ro.prototype.clear,ro.className="Transaction";function ha(){this.Pt=new Zn,this.Jd=!1,this.u=new Tn().freeze(),this.Ce=-1,this.o=999,this.Fe=!1,this.Np=null,this.bi=0,this.j=!1,this.Ie=new Tn().freeze(),this.hl=new Tn,this.tt=!0,this.Dt=this.rq=this.Gt=this.Ft=!1}ha.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},ha.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},ha.prototype.copyProperties=function(a){this.isEnabled=a.isEnabled,this.maxHistoryLength=a.maxHistoryLength,this.checksTransactionLevel=a.checksTransactionLevel},Ce=ha.prototype,Ce.Xw=function(a){this.Pt.add(a)},Ce.Rx=function(a){this.Pt.remove(a)},Ce.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},Ce.eb=function(a){return a===void 0&&(a=""),As(this,!0,a)},Ce.Kf=function(){return As(this,!1,"")};function As(a,y,x){if(a.isUndoingRedoing)return!1;a.checksTransactionLevel&&1>a.transactionLevel&&Di("Ending transaction without having started a transaction: "+x);var E=a.transactionLevel===1,b=a.currentTransaction;E&&y&&(a.isInternalTransaction||a.Ob("CommittingTransaction",x,b));var z=0;if(0<a.transactionLevel&&(a.bi--,a.isEnabled)){var 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}Ce.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()}},ha.prototype.canUndo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToUndo;return!!(a!==null&&a.canUndo())},ha.prototype.undo=function(){if(this.canUndo()){var a=this.transactionToUndo;try{this.Fe=!0,this.Ob("StartingUndo","Undo",a),this.Ce--,a.undo()}catch(y){Di("undo error: "+y.toString())}finally{this.Ob("FinishedUndo","Undo",a),this.Fe=!1}}},ha.prototype.canRedo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToRedo;return!!(a!==null&&a.canRedo())},ha.prototype.redo=function(){if(this.canRedo()){var a=this.transactionToRedo;try{this.Fe=!0,this.Ob("StartingRedo","Redo",a),this.Ce++,a.redo()}catch(y){Di("redo error: "+y.toString())}finally{this.Ob("FinishedRedo","Redo",a),this.Fe=!1}}},ha.prototype.Ob=function(a,y,x){x===void 0&&(x=null);var E=new sr;for(E.change=ra,E.propertyName=a,E.object=x,E.oldValue=y,a=this.models;a.next();)y=a.value,E.model=y,y.ds(E)},ha.prototype.Tu=function(a){if(this.isEnabled&&!this.isUndoingRedoing&&!this.skipsEvent(a)){var y=this.currentTransaction;y===null&&(this.Np=y=new ro);var x=a.copy();y=y.changes,y.ka(),y.add(x),y.freeze(),this.checksTransactionLevel&&0>=this.transactionLevel&&!this.tt&&(a=a.diagram,a!==null&&a.pi===!1||Di("Change not within a transaction: "+x.toString()))}},ha.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},kt.Object.defineProperties(ha.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}}}),ha.prototype.handleChanged=ha.prototype.Tu,ha.prototype.redo=ha.prototype.redo,ha.prototype.undo=ha.prototype.undo,ha.prototype.canUndo=ha.prototype.canUndo,ha.prototype.discardHistoryAfterIndex=ha.prototype.lx,ha.prototype.rollbackTransaction=ha.prototype.Kf,ha.prototype.commitTransaction=ha.prototype.eb,ha.prototype.startTransaction=ha.prototype.Ea,ha.prototype.removeModel=ha.prototype.Rx,ha.prototype.addModel=ha.prototype.Xw,ha.prototype.clear=ha.prototype.clear,ha.className="UndoManager";function kr(){wr(this),this.H=Ku,this.xa="",this.Jd=!0,this.nb=!1,this.wm=null,this.yy=new Nr,this.Zr=-1}kr.prototype.toString=function(){return this.name!==""?this.name+" Tool":Ri(this.constructor)},kr.prototype.updateAdornments=function(){},kr.prototype.canStart=function(){return this.isEnabled},kr.prototype.doStart=function(){},kr.prototype.doActivate=function(){this.isActive=!0},kr.prototype.doDeactivate=function(){this.isActive=!1},kr.prototype.doStop=function(){},kr.prototype.doCancel=function(){this.transactionResult=null,this.stopTool()},kr.prototype.stopTool=function(){var a=this.diagram;a.currentTool===this&&(a.currentTool=null,a.currentCursor="")},kr.prototype.doMouseDown=function(){!this.isActive&&this.canStart()&&this.doActivate()},kr.prototype.doMouseMove=function(){},kr.prototype.doMouseUp=function(){this.stopTool()},kr.prototype.doMouseWheel=function(){},kr.prototype.canStartMultiTouch=function(){return!0},kr.prototype.standardPinchZoomStart=function(){var a=this.diagram,y=a.lastInput,x=y.So(0,_e.allocAt(NaN,NaN)),E=y.So(1,_e.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}_e.free(x),_e.free(E)},kr.prototype.standardPinchZoomMove=function(){var a=this.diagram,y=a.lastInput,x=y.So(0,_e.allocAt(NaN,NaN)),E=y.So(1,_e.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 _e((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}_e.free(x),_e.free(E)},kr.prototype.doKeyDown=function(){this.diagram.lastInput.key==="Esc"&&this.doCancel()},kr.prototype.doKeyUp=function(){},kr.prototype.Ea=function(a){return a===void 0&&(a=this.name),this.transactionResult=null,this.diagram.Ea(a)},kr.prototype.stopTransaction=function(){var a=this.diagram;return this.transactionResult===null?a.Kf():a.eb(this.transactionResult)},kr.prototype.standardMouseSelect=function(){var a=this.diagram;if(a.allowSelect){var y=a.lastInput,x=a.Ol(y.documentPoint,!1);if(x!==null){if(zr?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||(zr?y.meta:y.control)||y.shift||a.clearSelection()}},kr.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,$a(a,E,x),E.handled};function $a(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)}}}kr.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}},kr.prototype.doUpdateCursor=function(){var a=this.diagram;a&&(a.currentCursor="")},kr.prototype.doCurrentObjectChanged=function(){},kr.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===Ol&&!y.shift||b===ys&&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===Ol&&y.shift||b===ys&&!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)}}},kr.prototype.doWheelChange=function(a,y,x){a.position.D(y)&&x.event.wheelDeltaX===0||(x.bubbles=!1)},kr.prototype.standardWaitAfter=function(a,y){y===void 0&&(y=this.diagram.lastInput),this.cancelWaitAfter();var x=this,E=y.clone(this.yy);this.Zr=_t(function(){x.doWaitAfter(E)},a)},kr.prototype.cancelWaitAfter=function(){this.Zr!==-1&&yn.clearTimeout(this.Zr),this.Zr=-1},kr.prototype.doWaitAfter=function(){},kr.prototype.findToolHandleAt=function(a,y){return a=this.diagram.ic(a,function(x){for(;x!==null&&!(x.panel instanceof $o);)x=x.panel;return x}),a===null?null:a.part.category===y?a:null},kr.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},kt.Object.defineProperties(kr.prototype,{diagram:{get:function(){return this.H},set:function(a){a instanceof Zt&&(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}}}),kr.prototype.startTransaction=kr.prototype.Ea,kr.className="Tool";function Eo(){kr.call(this),this.name="ToolManager",this.hb=new Tn,this.ob=new Tn,this.Hb=new Tn,this.F=this.V=850,this.o=new bn(2,2).ja(),this.Ha=5e3,this.ia=ys,this.u=mu,this.Mp=this.j=null,this.zj=-1}Tt(Eo,kr),Eo.prototype.initializeStandardTools=function(){},Eo.prototype.updateAdornments=function(a){var y=this.currentToolTip;if(y instanceof $o&&this.Mp===a){var x=y.adornedObject;(a!==null?x.part===a:x===null)?this.showToolTip(y,x):this.hideToolTip()}},Eo.prototype.doMouseDown=function(){var a=this.diagram,y=a.lastInput;if(y.isTouchEvent&&this.gestureBehavior===Ll&&(y.bubbles=!1),y.isMultiTouch){if(this.cancelWaitAfter(),this.gestureBehavior===ru){y.bubbles=!0;return}if(this.gestureBehavior===Ll)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===ys?this.mouseWheelBehavior=Ol:this.mouseWheelBehavior===Ol&&(this.mouseWheelBehavior=ys)),this.doActivate(),this.standardWaitAfter(this.holdDelay,y)},Eo.prototype.doMouseMove=function(){var a=this.diagram,y=a.lastInput;if(y.isMultiTouch){if(this.gestureBehavior===ru){y.bubbles=!0;return}if(this.gestureBehavior===Ll)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)}Eo.prototype.doCurrentObjectChanged=function(a,y){a=this.currentToolTip,a===null||y!==null&&a instanceof $o&&(y===a||y.rg(a))||this.hideToolTip()},Eo.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()))},Eo.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)},Eo.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 $o)||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()},Eo.prototype.showToolTip=function(a,y){var x=this.diagram;if(a!==this.currentToolTip&&this.hideToolTip(),a instanceof $o){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 Nu&&a!==this.currentToolTip&&a.show(y,x,this);if(this.currentToolTip=a,this.zj!==-1&&(yn.clearTimeout(this.zj),this.zj=-1),a=this.toolTipDuration,0<a&&a!==1/0){var b=this;this.zj=_t(function(){b.hideToolTip()},a)}},Eo.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}},Eo.prototype.hideToolTip=function(){this.zj!==-1&&(yn.clearTimeout(this.zj),this.zj=-1);var a=this.diagram,y=this.currentToolTip;y!==null&&(y instanceof $o?(a.remove(y),this.Mp!==null&&this.Mp.Jf(y.category),y.data=null,y.adornedObject=null):y instanceof Nu&&y.hide!==null&&y.hide(a,this),this.currentToolTip=null)},Eo.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()},Eo.prototype.doMouseWheel=function(){this.standardMouseWheel()},Eo.prototype.doKeyDown=function(){var a=this.diagram;a.commandHandler!==null&&a.commandHandler.doKeyDown()},Eo.prototype.doKeyUp=function(){var a=this.diagram;a.commandHandler!==null&&a.commandHandler.doKeyUp()},Eo.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},Eo.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},Eo.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)},kt.Object.defineProperties(Eo.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 $o?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}}}),Eo.prototype.replaceStandardTool=Eo.prototype.gb;var ys=new en(Eo,"WheelScroll",0),Ol=new en(Eo,"WheelZoom",1),ku=new en(Eo,"WheelNone",2),mu=new en(Eo,"GestureZoom",3),Ll=new en(Eo,"GestureCancel",4),ru=new en(Eo,"GestureNone",5);Eo.className="ToolManager",Eo.WheelScroll=ys,Eo.WheelZoom=Ol,Eo.WheelNone=ku,Eo.GestureZoom=mu,Eo.GestureCancel=Ll,Eo.GestureNone=ru;function ka(){kr.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 _e(NaN,NaN),this.Fr=new _e,this.hb=!0,this.Ik=100,this.Cg=[],this.te=new Zn().freeze(),this.ia=new ae,this.Bn=null,this.F="copy",this.Oc="",this.Pc="no-drop"}var tl;Tt(ka,kr),ka.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},ka.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},ka.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,(zr?y.meta:y.control)||y.shift||a.clearSelection(!0),this.currentPart.isSelected=!0,a.R("ChangedSelection",a.selection))}}},ka.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),aa=null,this.isActive=!0,this.tl.set(a.position),ou(this,a.selection),this.Cg.length=0,a.animationManager.Cc(),this.draggedParts=this.computeEffectiveCollection(a.selection,this.dragOptions),this.Sw=this.diagram.layout.isRealtime,this.diagram.layout.isRealtime=!1,a.Ns=!0,a.Gf("temporaryPixelRatio")===!0&&30<a.$w&&Ks(a),Ff(a,this.draggedParts),this.Ea("Drag"),this.startPoint=a.firstInput.documentPoint,a.isMouseCaptured=!0,a.allowDragOut&&(this.isDragOutStarted=!0,this.Ym=!1,aa=this,qa=this.diagram,this.doSimulatedDragOut()))};function ou(a,y){if(a.dragsLink){var x=a.diagram;x.allowRelink&&(x.model.Wj()&&y.count===1&&y.first()instanceof ti?(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 Is,a.Oe.diagram=x),a.Oe.originalLink=a.draggedLink):(a.draggedLink=null,a.Oe=null))}}ka.prototype.computeEffectiveCollection=function(a,y){return this.diagram.commandHandler.computeEffectiveCollection(a,y)},ka.prototype.Pd=function(a){return a===void 0?new hh(pi):this.isGridSnapEnabled?new hh(new _e(Math.round(1e3*a.x)/1e3,Math.round(1e3*a.y)/1e3)):new hh(a.copy())},ka.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;if(this.diagram.layout.isRealtime=this.Sw,a.Fu(!1),a.ug(),Bl(this),Hh(a,this.draggedParts),this.draggedParts=this.currentPart=this.Bn=null,this.Ym=this.isDragOutStarted=!1,0<tl.count){for(var y=tl,x=y.length,E=0;E<x;E++){var b=y.M(E);Fa(b),pa(b),Bl(b),b.diagram.ug()}y.clear()}Fa(this),this.tl.h(NaN,NaN),qa!==null&&(qa.currentCursor=""),aa=qa=null,pa(this),a.isMouseCaptured=!1,a.currentCursor="",a.Ns=!1,this.stopTransaction(),Lc(a,!0)},ka.prototype.stopTransaction=function(){var a=this.diagram,y=kr.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y};function Bl(a){var y=a.diagram,x=y.skipsUndoManager;y.skipsUndoManager=!0,vu(a,y.lastInput,null),y.skipsUndoManager=x,a.Cg.length=0}function ih(){var a=aa;pa(a),Ts(a);var y=a.diagram;a.tl.w()&&(y.position=a.tl),y.ug()}ka.prototype.doCancel=function(){pa(this),Ts(this);var a=this.diagram;this.tl.w()&&(a.position=this.tl),this.stopTool()},ka.prototype.doKeyDown=function(){var a=this.diagram,y=a.lastInput;this.isActive&&(y.key==="Esc"?this.doCancel():y.key!==a.previousInput.key&&this.doMouseMove())},ka.prototype.doKeyUp=function(){this.isActive&&this.doMouseMove()};function ul(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")):Ts(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 Ut,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 ti&&E.canCopy()&&x.add(E,a.Pd());a.copiedParts=x,ou(a,x.Lf()),a.draggedLink!==null&&(x=a.draggedLink,y=x.routeBounds,rc(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 ti&&(x.value.point=new _e(0,0));a.doUpdateCursor(null)}y.skipsUndoManager=!1,y.partManager.addsToTemporaryLayer=!1,a.startPoint=y.firstInput.documentPoint}function Fa(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 us(a,y,x){var E=a.diagram,b=a.startPoint,z=_e.alloc();z.assign(E.lastInput.documentPoint),a.moveParts(y,z.re(b),x),_e.free(z),E.Gf("temporaryPixelRatio")===!0&&E.Yh===null&&30<E.$w&&(Ks(E),E.hk())}ka.prototype.moveParts=function(a,y,x){x===void 0&&(x=!1);var E=this.diagram;E!==null&&yd(E,a,y,this.dragOptions,x)};function Ts(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 ti&&E.suspendsRouting){var b=x.value.point;a.draggedParts.add(E,a.Pd()),rc(E,-b.x,-b.y)}y.bd()}}function _s(a,y){var x=a.diagram;a.dragsLink&&(a.draggedLink!==null&&(a.draggedLink.fromNode=null,a.draggedLink.toNode=null),Jn(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=vu(a,b,E),!a.isActive&&aa===null)return;var re=E!==null?E.part:null;if(re===null||x.handlesDragDropForTopLevelParts&&re.isTopLevel&&!(re instanceof qr)){var oe=x.mouseDragOver;oe!==null&&(oe(b),ee=!0)}if(!a.isActive&&aa===null||(a.doDragOver(y,E),!a.isActive&&aa===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)}ka.prototype.findDragOverObject=function(a){var y=this;return sh(this.diagram,a,null,function(x){return x===null?x=!0:(x=x.part,x=!!(x===null||x instanceof $o||x.layer.isTemporary||y.draggedParts&&y.draggedParts.contains(x)||y.copiedParts&&y.copiedParts.contains(x))),!x})},ka.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 vu(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&&aa===null||x===null)return E;for(y.handled=!1,b=x;b!==null;)a.Cg.push(b),b=Jl(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 Jl(a){var y=a.panel;return y!==null?y:a instanceof mr&&!(a instanceof qr)&&(a=a.containingGroup,a!==null&&a.handlesDragDropForMembers)?a:null}function yu(a,y,x){var E=a.Oe;if(E===null)return null;var b=a.diagram.og(y,E.portGravity,function(le){return E.findValidLinkablePort(le,x)});a=_e.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(yo,a);oe=y.Bf(oe),oe<z&&(ee=re,z=oe)}}return _e.free(a),ee}function Jn(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=yu(a,x.i(0),!1),z!==null&&(ee=z.part));var re=null,oe=null;x.toNode===null&&(re=yu(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)):Ch(b,ee,z,oe,re):Ch(b,null,null,null,null)}}}}ka.prototype.doDragOver=function(){};function Xr(a,y){var x=a.diagram;a.dragsLink&&Jn(a,!0),Bl(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;Aa(a,b,z),z=Jl(z)}}else z=x.mouseDrop,z!==null&&z(b);if(a.isActive||aa!==null){for(b=(a.copiedParts||a.draggedParts).iterator;b.next();)z=b.key,z instanceof Fi&&z.linksConnected.each(function(re){re.suspendsRouting=!1});if(a.doDropOnto(y,E),a.isActive||aa!==null){for(a=zt.alloc(),y=x.selection.iterator;y.next();)E=y.value,E instanceof Fi&&Go(x,E,a);zt.free(a)}}}function Aa(a,y,x){a=a.diagram,x=x.part,!a.handlesDragDropForTopLevelParts||!x.isTopLevel||x instanceof qr||(x=a.mouseDrop,x!==null&&x(y))}function Go(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 ti},!0,function(b){return b instanceof ti},E),a.count!==0)for(a=a.iterator;a.next();)x=a.value,!x.Td(y)&&x.isAvoiding&&x.bb()}ka.prototype.doDropOnto=function(){},ka.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()?(ul(this,!1),Ff(a,this.copiedParts),us(this,this.copiedParts,!1),Hh(a,this.copiedParts)):this.mayMove()?(pa(this),us(this,this.draggedParts,!0)):this.mayDragOut()?(ul(this,!1),us(this,this.copiedParts,!1)):pa(this),_s(this,a.lastInput.documentPoint))}},ka.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),ul(this,!0),Ff(a,this.copiedParts),us(this,this.copiedParts,!1),Hh(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()&&(us(this,this.draggedParts,!0),_s(this,a.lastInput.documentPoint))),this.Ym=!0,Xr(this,a.lastInput.documentPoint),this.isActive){var E=x?this.copiedParts.Lf():this.draggedParts.Lf();this.copiedParts=null,y&&Lr(this),a.Ya(),Hh(a,this.draggedParts),this.transactionResult=x?"Copy":"Move",a.R(x?"SelectionCopied":"SelectionMoved",E)}this.stopTool(),x&&a.R("ChangedSelection",a.selection)}}},ka.prototype.simulatedMouseMove=function(a,y,x){if(aa===null)return!1;var E=aa.diagram;x instanceof Zt||(x=null);var b=qa;return x!==b&&(b!==null&&b!==E&&(b.ug(),aa.isDragOutStarted=!1,b=b.toolManager.findTool("Dragging"),b!==null&&b.doSimulatedDragLeave()),qa=x,x!==null&&x!==E&&(ih(),b=x.toolManager.findTool("Dragging"),b!==null&&(tl.contains(b)||tl.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)},ka.prototype.simulatedMouseUp=function(a,y,x){if(aa===null)return!1;var E=qa,b=aa.diagram;if(x===null)return aa.doCancel(),!0;if(x!==E){var z=E.toolManager.findTool("Dragging");if(E!==null&&E!==b&&z!==null)return E.ug(),aa.isDragOutStarted=!1,z.doSimulatedDragLeave(),!1;qa=x,E=x.toolManager.findTool("Dragging"),E!==null&&(ih(),tl.contains(E)||tl.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 _e),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=aa,a!==null&&(x=a.mayCopy(),a.transactionResult=x?"Copy":"Move",a.stopTool()),!0):!1};function Lr(a){if(a.draggedParts!==null)for(var y=a.draggedParts.iterator;y.next();){var x=y.key;x instanceof Fi&&(x=x.containingGroup,x===null||x.placeholder===null||a.draggedParts.contains(x)||x.placeholder.v())}}ka.prototype.mayCopy=function(){if(!this.isCopyEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowCopy||(zr?!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())},ka.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())},ka.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())},ka.prototype.computeBorder=function(a,y,x){return this.Ym||this.draggedParts===null||this.draggedParts.contains(a)?null:x.assign(y)},ka.prototype.Az=function(){return aa},ka.prototype.mayDragIn=function(){var a=this.diagram;if(!a.allowDrop||a.isReadOnly||a.isModelReadOnly||!a.allowInsert)return!1;var y=aa;return!(y===null||y.diagram.model.dataFormat!==a.model.dataFormat)},ka.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var a=this.diagram;a.animationManager.Cc(),zl(a),a.animationManager.Cc(),a=aa,a!==null&&(a.diagram.Ns=!1),this.doUpdateCursor(null)}},ka.prototype.doSimulatedDragLeave=function(){var a=aa;a!==null&&a.doSimulatedDragOut(),this.doCancel()},ka.prototype.doSimulatedDragOver=function(){var a=this.diagram;a.animationManager.Dm=!0;var y=aa;if(y!==null&&y.draggedParts!==null){if(!this.mayDragIn())return;Wa(this,y.draggedParts.Lf(),!1,a.firstInput),us(this,this.copiedParts,!1),_s(this,a.lastInput.documentPoint)}a.animationManager.Dm=!1},ka.prototype.doSimulatedDrop=function(){var a=this.diagram,y=aa;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"),Wa(this,y.draggedParts.Lf(),!0,a.lastInput),us(this,this.copiedParts,!1);var E=new Zn;this.copiedParts!==null&&(a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(b){b.isSelected=!0,E.add(b)})),Xr(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 Wa(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=zt.alloc();b=E=1/0;for(var ee=-1/0,re=-1/0,oe=y.iterator;oe.next();){var le=oe.value;if(le.isVisible()){var he=le.location;le=he.x,he=he.y,isNaN(le)||isNaN(he)||(le<E&&(E=le),he<b&&(b=he),le>ee&&(ee=le),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,zt.free(z),z=a.Fr,ee=new Ut,re=_e.alloc(),oe=y.iterator;oe.next();)le=oe.value,le instanceof ti&&le.canCopy()&&(he=x.I(le),he!==null&&(he.points=le.points,rc(he,z.x-E,z.y-b),he.suspendsRouting=!0,ee.add(he,a.Pd())));for(y=y.iterator;y.next();)le=y.value,le.Zc()&&le.canCopy()&&(oe=x.I(le),oe!==null&&(le=le.location,re.h(z.x-(E-le.x),z.y-(b-le.y)),oe.location=re,oe.Va(),ee.add(oe,a.Pd(re))));_e.free(re),a.copiedParts=ee,ou(a,ee.Lf()),a.draggedLink!==null&&(x=a.draggedLink,y=x.routeBounds,rc(x,a.startPoint.x-(y.x+y.width/2),a.startPoint.y-(y.y+y.height/2))),a.doUpdateCursor(null)}}}ka.prototype.doSimulatedDragOut=function(){var a=this.diagram;a.Ns=!1,this.mayCopy()||this.mayMove()?a.currentCursor="":a.currentCursor=this.nodropCursor,this.Bn=null},ka.prototype.computeMove=function(a,y,x,E){return x=this.diagram,x!==null?x.computeMove(a,y,this.dragOptions,E):new _e},kt.Object.defineProperties(ka.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}}}),ka.prototype.getDraggingSource=ka.prototype.Az;var aa=null,qa=null;ka.className="DraggingTool",tl=new Tn,Ar("draggingTool",function(){return this.findTool("Dragging")},function(a){this.gb("Dragging",a,this.mouseMoveTools)}),Eo.prototype.doCancel=function(){aa!==null&&aa.doCancel(),kr.prototype.doCancel.call(this)};function xo(){kr.call(this),this.te=100,this.Ha=!1,this.u="pointer";var a=new ti,y=new ao;y.isPanelMain=!0,y.stroke="blue",a.add(y),y=new ao,y.toArrow="Standard",y.fill="blue",y.stroke="blue",a.add(y),a.layerName="Tool",this.Ci=a,a=new Fi,y=new ao,y.portId="",y.figure="Rectangle",y.fill=null,y.stroke="magenta",y.strokeWidth=2,y.desiredSize=rr,a.add(y),a.selectable=!1,a.layerName="Tool",this.Bi=a,this.j=y,a=new Fi,y=new ao,y.portId="",y.figure="Rectangle",y.fill=null,y.stroke="magenta",y.strokeWidth=2,y.desiredSize=rr,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 Ut,this.Of=this.gj=this.Pf=null}Tt(xo,kr),xo.prototype.doStop=function(){this.diagram.ug(),this.originalToPort=this.originalToNode=this.originalFromPort=this.originalFromNode=this.originalLink=null,this.validPortsCache.clear(),this.targetPort=null},xo.prototype.copyPortProperties=function(a,y,x,E,b){if(a!==null&&y!==null&&x!==null&&E!==null){var z=y.Df(),ee=bn.alloc();ee.width=y.naturalBounds.width*z,ee.height=y.naturalBounds.height*z,E.desiredSize=ee,bn.free(ee),b?(E.toSpot=y.toSpot,E.toEndSegmentLength=y.toEndSegmentLength):(E.fromSpot=y.fromSpot,E.fromEndSegmentLength=y.fromEndSegmentLength),x.locationSpot=yo,z=_e.alloc(),x.location=y.ga(yo,z),_e.free(z),E.angle=y.li(),this.portTargeted!==null&&this.portTargeted(a,y,x,E,b)}},xo.prototype.setNoTargetPortProperties=function(a,y,x){y!==null&&(y.desiredSize=rr,y.fromSpot=to,y.toSpot=to),a!==null&&(a.location=this.diagram.lastInput.documentPoint),this.portTargeted!==null&&this.portTargeted(null,null,a,y,x)},xo.prototype.doMouseDown=function(){this.isActive&&this.doMouseMove()},xo.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram;if(this.targetPort=this.findTargetPort(this.isForwards),this.targetPort!==null&&this.targetPort.part instanceof Fi){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)}},xo.prototype.findValidLinkablePort=function(a,y){if(a===null)return null;var x=a.part;if(!(x instanceof Fi))return null;for(;a!==null;){var E=y?a.toLinkable:a.fromLinkable;if(E===!0&&(a.portId!==null||a instanceof Fi)&&(y?this.isValidTo(x,a):this.isValidFrom(x,a)))return a;if(E===!1)break;a=a.panel}return null},xo.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 Fi){var oe=ee.ga(yo,_e.alloc()),le=x.x-oe.x,he=x.y-oe.y;_e.free(oe),oe=le*le+he*he,oe<E&&(le=this.validPortsCache.I(ee),le!==null?le&&(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 Fi&&(x.layer===null||x.layer.allowLink))?y:null},xo.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},xo.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},xo.prototype.isInSameNode=function(a,y){return a===null||y===null?!1:a===y?!0:(a=a.part,y=y.part,a!==null&&a===y)},xo.prototype.isLinked=function(a,y){if(a===null||y===null)return!1;var x=a.part;if(!(x instanceof Fi))return!1;a=a.portId,a===null&&(a="");var E=y.part;if(!(E instanceof Fi))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},xo.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)},xo.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 Zn;return E.add(a),Va(this,x,y,E)};function Va(a,y,x,E){if(y===x)return!0;var b=y.fromNode;return b!==null&&b.isLinkLabel&&(E.add(b),Va(a,b.labeledLink,x,E))?!0:(y=y.toNode,!!(y!==null&&y.isLinkLabel&&(E.add(y),Va(a,y.labeledLink,x,E))))}xo.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!==Ed){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!Ea(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!Ea(this,a,y,x,!0)}if(E===gg)return a===y?a=!0:(E=new Zn,E.add(y),a=Cs(this,E,a,y,x)),!a;if(E===pg)return!Ea(this,a,y,x,!1);if(E===mg)return a===y?a=!0:(E=new Zn,E.add(y),a=Au(this,E,a,y,x)),!a}return!0};function Ea(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&&Ea(a,ee,x,E,b)))return!0}return!1}function Cs(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&&Cs(a,y,ee,E,b)))return!0}return!1}function Au(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&&Au(a,y,re,E,b))return!0}}return!1}kt.Object.defineProperties(xo.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}}}),xo.className="LinkingBaseTool";function So(){xo.call(this),this.name="Linking",this.V={},this.F=null,this.K=js,this.Xd=null}Tt(So,xo),So.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},So.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 Fi)))return null;var x=this.direction;if(x===js||x===Ml){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===js||x===Xs)&&(y=this.findValidLinkablePort(y,!0),y!==null||this.startObject===a&&(y=a.port,this.findValidLinkablePort(y,!0)))?(this.isForwards=!1,y):null},So.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 Fi&&(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 Fi&&(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)},So.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()},So.prototype.doStop=function(){xo.prototype.doStop.call(this),this.startObject=null},So.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 Fi&&(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)}}},So.prototype.isNewTreeLink=function(){var a=this.archetypeLinkData;if(a===null)return!0;if(a instanceof ti)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)},So.prototype.insertLink=function(a,y,x,E){return this.diagram.partManager.insertLink(a,y,x,E)},So.prototype.doNoLink=function(){},kt.Object.defineProperties(So.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 js=new en(So,"Either",0),Ml=new en(So,"ForwardsOnly",0),Xs=new en(So,"BackwardsOnly",0);So.className="LinkingTool",So.Either=js,So.ForwardsOnly=Ml,So.BackwardsOnly=Xs;function Is(){xo.call(this),this.name="Relinking";var a=new ao;a.figure="Diamond",a.desiredSize=uo,a.fill="lightblue",a.stroke="dodgerblue",a.cursor=this.linkingCursor,a.segmentIndex=0,this.V=a,a=new ao,a.figure="Diamond",a.desiredSize=uo,a.fill="lightblue",a.stroke="dodgerblue",a.cursor=this.linkingCursor,a.segmentIndex=-1,this.Xd=a,this.F=null,this.Ew=new zt}Tt(Is,xo),Is.prototype.updateAdornments=function(a){if(a!==null&&a instanceof ti){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)}},Is.prototype.makeAdornment=function(a,y){var x=new $o;return x.type=Xn.Link,y=y?this.toHandleArchetype:this.fromHandleArchetype,y!==null&&x.add(y.copy()),x.adornedObject=a,x},Is.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},Is.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 $o&&x.adornedPart instanceof ti))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=Yi),this.temporaryFromNode!==null&&(this.temporaryFromNode.location=this.originalLink.i(0))),this.originalLink.toNode===null&&(this.temporaryToPort!==null&&(this.temporaryToPort.desiredSize=Yi),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},Is.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===oc)&&(x=Sl),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}},Is.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()},Is.prototype.doStop=function(){xo.prototype.doStop.call(this),this.handle=null},Is.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 Fi&&(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()}}},Is.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},Is.prototype.doNoRelink=function(){};function Ch(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)}kt.Object.defineProperties(Is.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 $o))throw Error("new handle is not in an Adornment: "+a);this.F=a}}}),Is.className="RelinkingTool",Ar("linkingTool",function(){return this.findTool("Linking")},function(a){this.gb("Linking",a,this.mouseMoveTools)}),Ar("relinkingTool",function(){return this.findTool("Relinking")},function(a){this.gb("Relinking",a,this.mouseDownTools)});function Ka(){kr.call(this),this.name="LinkReshaping";var a=new ao;a.figure="Rectangle",a.desiredSize=Po,a.fill="lightblue",a.stroke="dodgerblue",this.o=a,a=new ao,a.figure="Diamond",a.desiredSize=uo,a.fill="lightblue",a.stroke="dodgerblue",a.cursor="move",this.u=a,this.F=3,this.Ts=this.j=null,this.Fw=new _e,this.Yq=new Tn}Tt(Ka,kr),Ka.prototype.Ru=function(a){return a&&a.reshapingBehavior.value!==0?a.reshapingBehavior:bh},Ka.prototype.om=function(a,y){a.reshapingBehavior=y},Ka.prototype.updateAdornments=function(a){if(a!==null&&a instanceof ti){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)}},Ka.prototype.makeAdornment=function(a){var y=a.part,x=y.pointsCount,E=y.isOrthogonal,b=null;if(y.points!==null&&1<x){b=new $o,b.type=Xn.Link,x=y.firstPickIndex;var z=y.lastPickIndex,ee=E?1:0;if(y.resegmentable&&y.computeCurve()!==fu)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 le=y.i(x+1);He.B(oe.x,le.x)&&He.B(oe.y,le.y)&&(le=y.i(x-1)),He.B(oe.x,le.x)?(this.om(re,Oh),re.cursor="n-resize"):He.B(oe.y,le.y)&&(this.om(re,Ih),re.cursor="w-resize")}else ee===z-1&&E?(oe=y.i(z-1),le=y.i(z),He.B(oe.x,le.x)&&He.B(oe.y,le.y)&&(oe=y.i(z+1)),He.B(oe.x,le.x)?(this.om(re,Oh),re.cursor="n-resize"):He.B(oe.y,le.y)&&(this.om(re,Ih),re.cursor="w-resize")):ee!==z&&(this.om(re,sf),re.cursor="move");b.add(re)}b.adornedObject=a}return b},Ka.prototype.makeHandle=function(){var a=this.handleArchetype;return a===null?null:a.copy()},Ka.prototype.makeResegmentHandle=function(){var a=this.midHandleArchetype;return a===null?null:a.copy()},Ka.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},Ka.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 ti){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}}},Ka.prototype.doDeactivate=function(){this.stopTransaction(),this.Ts=this.handle=null,this.isActive=this.diagram.isMouseCaptured=!1},Ka.prototype.stopTransaction=function(){var a=this.diagram,y=kr.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},Ka.prototype.doCancel=function(){var a=this.adornedLink;a!==null&&(a.points=this.Yq),this.stopTool()},Ka.prototype.getResegmentingPoint=function(){return this.handle.ga(yo)},Ka.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeReshape(a.lastInput.documentPoint),this.reshape(a))},Ka.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&&(vl(this,ee,E,b,z,!0)||vl(this,ee,E,b,z,!1))){var re=y.points.copy();vl(this,ee,E,b,z,!0)?(re.cd(x-2,new _e(ee.x,(z.y+ee.y)/2)),re.cd(x+1,new _e(z.x,(z.y+ee.y)/2))):(re.cd(x-2,new _e((z.x+ee.x)/2,ee.y)),re.cd(x+1,new _e((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&&(vl(this,E,b,z,ee,!0)||vl(this,E,b,z,ee,!1))&&(re=y.points.copy(),vl(this,E,b,z,ee,!0)?(re.cd(x-1,new _e(E.x,(E.y+ee.y)/2)),re.cd(x+2,new _e(ee.x,(E.y+ee.y)/2))):(re.cd(x-1,new _e((E.x+ee.x)/2,E.y)),re.cd(x+2,new _e((E.x+ee.x)/2,ee.y))),re.mb(x+1),re.mb(x),y.points=re,y.Wb())}}else ee=_e.alloc(),He.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()),_e.free(ee)}a.Ya(),this.transactionResult=this.name,a.R("LinkReshaped",this.adornedLink,this.Yq)}this.stopTool()};function vl(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}Ka.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===Oh?(y.L(x,y.i(x-1).x,a.y),y.L(x+1,y.i(x+2).x,a.y)):E===Ih&&(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===Oh?(y.L(x-1,y.i(x-2).x,a.y),y.L(x,y.i(x+1).x,a.y)):E===Ih&&(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);He.B(z.x,b.x)&&He.B(b.y,ee.y)?(He.B(z.x,y.i(E-2).x)&&!He.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),He.B(ee.y,y.i(E+2).y)&&!He.B(ee.x,y.i(E+2).x)?y.m(E+1,ee.x,a.y):y.L(E+1,ee.x,a.y)):He.B(z.y,b.y)&&He.B(b.x,ee.x)?(He.B(z.y,y.i(E-2).y)&&!He.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),He.B(ee.x,y.i(E+2).x)&&!He.B(ee.y,y.i(E+2).y)?y.m(E+1,a.x,ee.y):y.L(E+1,a.x,ee.y)):He.B(z.x,b.x)&&He.B(b.x,ee.x)?(He.B(z.x,y.i(E-2).x)&&!He.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),He.B(ee.x,y.i(E+2).x)&&!He.B(ee.y,y.i(E+2).y)?y.m(E+1,a.x,ee.y):y.L(E+1,a.x,ee.y)):He.B(z.y,b.y)&&He.B(b.y,ee.y)&&(He.B(z.y,y.i(E-2).y)&&!He.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),He.B(ee.y,y.i(E+2).y)&&!He.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(yo,_e.alloc()),E=y.getLinkPointFromPoint(E,b,z,a,!0,_e.alloc()),y.L(0,E.x,E.y),_e.free(z),_e.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(yo,_e.alloc()),a=y.getLinkPointFromPoint(E,b,x,a,!1,_e.alloc()),y.L(y.pointsCount-1,a.x,a.y),_e.free(x),_e.free(a));y.zf()},Ka.prototype.computeReshape=function(a){var y=this.adornedLink,x=this.handle.segmentIndex;switch(this.Ru(this.handle)){case sf:return a;case Oh:return new _e(y.i(x).x,a.y);case Ih:return new _e(a.x,y.i(x).y);default:case bh:return y.i(x)}},kt.Object.defineProperties(Ka.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 $o))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}}}),Ka.prototype.setReshapingBehavior=Ka.prototype.om,Ka.prototype.getReshapingBehavior=Ka.prototype.Ru;var bh=new en(Ka,"None",0),Ih=new en(Ka,"Horizontal",1),Oh=new en(Ka,"Vertical",2),sf=new en(Ka,"All",3);Ka.className="LinkReshapingTool",Ka.None=bh,Ka.Horizontal=Ih,Ka.Vertical=Oh,Ka.All=sf,Ar("linkReshapingTool",function(){return this.findTool("LinkReshaping")},function(a){this.gb("LinkReshaping",a,this.mouseDownTools)});function Vs(){kr.call(this),this.name="Resizing",this.o=new bn(1,1).freeze(),this.j=new bn(9999,9999).freeze(),this.yg=new bn(NaN,NaN).freeze(),this.V=!1,this.ia=!0,this.ue=null;var a=new ao;a.alignmentFocus=yo,a.figure="Rectangle",a.desiredSize=Po,a.fill="lightblue",a.stroke="dodgerblue",a.strokeWidth=1,a.cursor="pointer",this.F=a,this.u=null,this.Xq=new _e,this.Dw=new bn,this.Tn=new _e,this.rt=new bn(0,0),this.qt=new bn(1/0,1/0),this.pt=new bn(1,1)}Tt(Vs,kr),Vs.prototype.updateAdornments=function(a){if(!(a===null||a instanceof ti)){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(),zc(a)&&this.updateResizeHandles(x,y),a.bh(this.name,x);return}}a.Jf(this.name)}},Vs.prototype.makeAdornment=function(a){var y=a.part.resizeAdornmentTemplate;if(y===null){y=new $o,y.type=Xn.Spot,y.locationSpot=yo;var x=new xl;x.isPanelMain=!0,y.add(x),y.add(this.makeHandle(a,Xo)),y.add(this.makeHandle(a,ms)),y.add(this.makeHandle(a,Xt)),y.add(this.makeHandle(a,ls)),y.add(this.makeHandle(a,Oo)),y.add(this.makeHandle(a,Lo)),y.add(this.makeHandle(a,jr)),y.add(this.makeHandle(a,ua))}else if(Ru(y),y=y.copy(),y===null)return null;return y.adornedObject=a,y},Vs.prototype.makeHandle=function(a,y){return a=this.handleArchetype,a===null?null:(a=a.copy(),a.alignment=y,a)},Vs.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=yo),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 Xn)for(a=a.elements;a.next();)this.updateResizeHandles(a.value,y)}},Vs.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},Vs.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))},Vs.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.isActive=a.isMouseCaptured=!1},Vs.prototype.stopTransaction=function(){var a=this.diagram,y=kr.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},Vs.prototype.doCancel=function(){this.adornedObject!==null&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation),this.stopTool()},Vs.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,_e.alloc()),z=this.computeReshape();y=this.computeResize(b,this.handle.alignment,y,x,E,z),this.resize(y),a.bd(),_e.free(b)}},Vs.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,_e.alloc()),z=this.computeReshape();y=this.computeResize(b,this.handle.alignment,y,x,E,z),this.resize(y),_e.free(b),a.Ya(),this.transactionResult=this.name,a.R("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()},Vs.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 qr){var E=new Tn;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()}},Vs.prototype.computeResize=function(a,y,x,E,b,z){y.Mc()&&(y=yo);var ee=this.adornedObject.naturalBounds,re=ee.x,oe=ee.y,le=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=_e.alloc(),He.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,le-E.width),a.x=Math.min(a.x,le-x.width),a.width=Math.max(le-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=le-a.width,a.y=he-a.height)):1<=y.y?(a.x=Math.max(xe.x,le-E.width),a.x=Math.min(a.x,le-x.width),a.width=Math.max(le-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=le-a.width)):(a.x=Math.max(xe.x,le-E.width),a.x=Math.min(a.x,le-x.width),a.width=le-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*(le-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*(le-re-a.width))),_e.free(xe),a},Vs.prototype.computeReshape=function(){var a=Bn;return this.adornedObject instanceof ao&&(a=Tv(this.adornedObject)),!(a===Ji||this.diagram.lastInput.shift)},Vs.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},Vs.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},Vs.prototype.computeCellSize=function(){var a=new bn(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},kt.Object.defineProperties(Vs.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 $o))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 $o)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}}}),Vs.className="ResizingTool",Ar("resizingTool",function(){return this.findTool("Resizing")},function(a){this.gb("Resizing",a,this.mouseDownTools)});function ol(){kr.call(this),this.name="Rotating",this.ia=45,this.V=2,this.Tn=new _e,this.ue=null;var a=new ao;a.figure="Ellipse",a.desiredSize=uo,a.fill="lightblue",a.stroke="dodgerblue",a.strokeWidth=1,a.cursor="pointer",this.o=a,this.j=null,this.Cw=0,this.kr=new _e(NaN,NaN),this.u=0,this.F=50}Tt(ol,kr),ol.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)}},ol.prototype.makeAdornment=function(a){var y=a.part.rotateAdornmentTemplate;if(y===null){y=new $o,y.type=Xn.Position,y.locationSpot=yo;var x=this.handleArchetype;x!==null&&y.add(x.copy())}else if(Ru(y),y=y.copy(),y===null)return null;return y.adornedObject=a,y},ol.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},ol.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)},ol.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(yo)},ol.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)},ol.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.kr=new _e(NaN,NaN),this.isActive=a.isMouseCaptured=!1},ol.prototype.stopTransaction=function(){var a=this.diagram,y=kr.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},ol.prototype.doCancel=function(){this.diagram.delaysLayout=!1,this.rotate(this.originalAngle),this.stopTool()},ol.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeRotate(a.lastInput.documentPoint),this.rotate(a))},ol.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()},ol.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()}},ol.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},kt.Object.defineProperties(ol.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 $o))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 $o)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}}}),ol.className="RotatingTool",Ar("rotatingTool",function(){return this.findTool("Rotating")},function(a){this.gb("Rotating",a,this.mouseDownTools)});function sd(){kr.call(this),this.name="ClickSelecting"}Tt(sd,kr),sd.prototype.canStart=function(){return!(!this.isEnabled||this.isBeyondDragSize())},sd.prototype.doMouseUp=function(){this.isActive&&(this.standardMouseSelect(),!this.standardMouseClick()&&this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip()),this.stopTool()},sd.className="ClickSelectingTool";function Rl(){kr.call(this),this.name="Action",this.pk=null}Tt(Rl,kr),Rl.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},Rl.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()},Rl.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))}},Rl.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()},Rl.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())},Rl.prototype.doStop=function(){this.pk=null},Rl.className="ActionTool";function Rh(){kr.call(this),this.name="ClickCreating",this.Ri=null,this.o=!0,this.j=!1,this.mw=new _e(0,0)}Tt(Rh,kr),Rh.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)},Rh.prototype.doMouseUp=function(){var a=this.diagram;this.isActive&&this.insertPart(a.lastInput.documentPoint),this.stopTool()},Rh.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()&&(Ru(x),E=x.copy(),E!==null&&y.add(E));else if(x!==null){var b=y.model.copyNodeData(x);cn(b)&&(y.model.xf(b),E=y.Lc(b))}if(E!==null){var z=_e.allocAt(a.x,a.y);this.isGridSnapEnabled&&bf(this.diagram,E,a,z),E.location=z,y.allowSelect&&(y.clearSelection(!0),E.isSelected=!0),_e.free(z)}y.Ya(),this.transactionResult=this.name,y.R("PartCreated",E)}finally{this.stopTransaction(),y.R("ChangedSelection",y.selection)}return E},kt.Object.defineProperties(Rh.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}}}),Rh.className="ClickCreatingTool";function jl(){kr.call(this),this.name="DragSelecting",this.Ik=175,this.o=!1;var a=new mr;a.layerName="Tool",a.selectable=!1;var y=new ao;y.name="SHAPE",y.figure="Rectangle",y.fill=null,y.stroke="magenta",a.add(y),this.j=a}Tt(jl,kr),jl.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))},jl.prototype.doActivate=function(){var a=this.diagram;this.isActive=!0,a.isMouseCaptured=!0,a.skipsUndoManager=!0,a.add(this.box),this.doMouseMove()},jl.prototype.doDeactivate=function(){var a=this.diagram;a.ug(),a.remove(this.box),a.skipsUndoManager=!1,this.isActive=a.isMouseCaptured=!1},jl.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=bn.alloc().h(y.width,y.height);x.desiredSize=E,this.box.mm(y.x,y.y,!1),bn.free(E),(a.allowHorizontalScroll||a.allowVerticalScroll)&&a.gs(a.lastInput.viewPoint)}},jl.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()},jl.prototype.computeBoxBounds=function(){var a=this.diagram;return new zt(a.firstInput.documentPoint,a.lastInput.documentPoint)},jl.prototype.selectInRect=function(a){var y=this.diagram,x=y.lastInput;if(a=y.ux(a,this.isPartialInclusion),zr?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 Tn,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)}},kt.Object.defineProperties(jl.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}}}),jl.className="DragSelectingTool";function Os(){kr.call(this),this.name="Panning",this.Xt=new _e,this.xy=new _e,this.xg=!1;var a=this;this.Kw=function(){var y=a.diagram;y!==null&&y.removeEventListener(yn.document,"scroll",a.Kw,!1),a.stopTool()}}Tt(Os,kr),Os.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())},Os.prototype.doActivate=function(){var a=this.diagram;this.xg?(a.lastInput.bubbles=!0,a.addEventListener(yn.document,"scroll",this.Kw,!1)):(a.currentCursor="move",a.isMouseCaptured=!0,this.Xt.assign(a.position)),this.isActive=!0},Os.prototype.doDeactivate=function(){var a=this.diagram;a.currentCursor="",this.isActive=a.isMouseCaptured=!1},Os.prototype.doCancel=function(){var a=this.diagram;a.position=this.Xt,a.isMouseCaptured=!1,this.stopTool()},Os.prototype.doMouseMove=function(){this.move()},Os.prototype.doMouseUp=function(){this.move(),this.stopTool()},Os.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)}},kt.Object.defineProperties(Os.prototype,{bubbles:{get:function(){return this.xg},set:function(a){this.xg=a}},originalPosition:{get:function(){return this.Xt}}}),Os.className="PanningTool",Ar("clickCreatingTool",function(){return this.findTool("ClickCreating")},function(a){this.gb("ClickCreating",a,this.mouseUpTools)}),Ar("clickSelectingTool",function(){return this.findTool("ClickSelecting")},function(a){this.gb("ClickSelecting",a,this.mouseUpTools)}),Ar("panningTool",function(){return this.findTool("Panning")},function(a){this.gb("Panning",a,this.mouseMoveTools)}),Ar("dragSelectingTool",function(){return this.findTool("DragSelecting")},function(a){this.gb("DragSelecting",a,this.mouseMoveTools)}),Ar("actionTool",function(){return this.findTool("Action")},function(a){this.gb("Action",a,this.mouseDownTools)});function Nu(){this.F=this.u=this.j=this.o=null}kt.Object.defineProperties(Nu.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}}}),Nu.className="HTMLInfo";function au(a,y,x){this.text=a,this.hx=y,this.visible=x}au.className="ContextMenuButtonInfo";function al(){kr.call(this),this.name="ContextMenu",this.o=this.ht=this.j=null,this.yw=new _e,this.jt=null,this.Et=!1;var a=this;this.tu=function(){a.stopTool()}}Tt(al,kr);function su(a){var y=new Nu;y.show=function(b,z,ee){ee.showDefaultContextMenu()},y.hide=function(b,z){z.hideDefaultContextMenu()},ld=y,a.tu=function(){a.stopTool()},y=hi("div");var x=hi("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=hi("style");yn.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",ss,!1),E.addEventListener(y,"selectstart",ss,!1),E.addEventListener(x,"contextmenu",ss,!1)),y.className="goCXforeground",x.className="goCXbackground",yn.document.body&&(yn.document.body.appendChild(y),yn.document.body.appendChild(x)),Sc=y,Su=x,xc=!0}function ss(a){return a.preventDefault(),!1}al.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)},al.prototype.doStart=function(){this.yw.set(this.diagram.firstInput.documentPoint)},al.prototype.doStop=function(){this.hideContextMenu(),this.currentObject=null},al.prototype.findObjectWithContextMenu=function(a){a===void 0&&(a=null);var y=this.diagram,x=y.lastInput,E=null;if(a instanceof Zt||(a instanceof bt?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},al.prototype.doActivate=function(){},al.prototype.doMouseDown=function(){if(kr.prototype.doMouseDown.call(this),this.isActive&&this.currentContextMenu instanceof $o){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.canStart()&&(a.doActivate(),a.doMouseDown(),a.doDeactivate())}this.diagram.toolManager.mouseDownTools.contains(this)&&xu(this)},al.prototype.doMouseUp=function(){if(this.isActive&&this.currentContextMenu instanceof $o){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.canStart()&&(a.doActivate(),a.doCancel(),a.doDeactivate())}xu(this)};function xu(a){var y=a.diagram;if(a.isActive){var x=a.currentContextMenu;if(x!==null){var E=null;x instanceof Nu||(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())}al.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=ld,x===null&&(x=a.findObjectWithContextMenu()),x!==null){var E=x.contextMenu;E!==null?(a.currentObject=x instanceof bt?x:null,a.showContextMenu(E,a.currentObject)):y!==null&&a.showContextMenu(y,a.currentObject)}else y!==null&&a.showContextMenu(y,null);a.currentContextMenu instanceof $o&&!a.currentContextMenu.visible&&a.stopTool()}}al.prototype.doMouseMove=function(){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.doMouseMove(),this.isActive&&this.diagram.toolManager.doMouseMove()},al.prototype.showContextMenu=function(a,y){var x=this.diagram;if(a!==this.currentContextMenu&&this.hideContextMenu(),a instanceof $o){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 Nu&&a.show(y,x,this);this.currentContextMenu=a},al.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}},al.prototype.hideContextMenu=function(){var a=this.diagram,y=this.currentContextMenu;y!==null&&(y instanceof $o?(a.remove(y),this.ht!==null&&this.ht.Jf(y.category),y.data=null,y.adornedObject=null):y instanceof Nu&&(y.hide!==null?y.hide(a,this):y.mainElement!==null&&(y.mainElement.style.display="none")),this.currentContextMenu=null,this.standardMouseOver())};function jh(a){var y=new Tn;return y.add(new au("Copy",function(x){x.commandHandler.copySelection()},function(x){return x.commandHandler.canCopySelection()})),y.add(new au("Cut",function(x){x.commandHandler.cutSelection()},function(x){return x.commandHandler.canCutSelection()})),y.add(new au("Delete",function(x){x.commandHandler.deleteSelection()},function(x){return x.commandHandler.canDeleteSelection()})),y.add(new au("Paste",function(x){x.commandHandler.pasteSelection(a.mouseDownPoint)},function(x){return x.commandHandler.canPasteSelection(a.mouseDownPoint)})),y.add(new au("Select All",function(x){x.commandHandler.selectAll()},function(x){return x.commandHandler.canSelectAll()})),y.add(new au("Undo",function(x){x.commandHandler.undo()},function(x){return x.commandHandler.canUndo()})),y.add(new au("Redo",function(x){x.commandHandler.redo()},function(x){return x.commandHandler.canRedo()})),y.add(new au("Scroll To Part",function(x){x.commandHandler.scrollToPart()},function(x){return x.commandHandler.canScrollToPart()})),y.add(new au("Zoom To Fit",function(x){x.commandHandler.zoomToFit()},function(x){return x.commandHandler.canZoomToFit()})),y.add(new au("Reset Zoom",function(x){x.commandHandler.resetZoom()},function(x){return x.commandHandler.canResetZoom()})),y.add(new au("Group Selection",function(x){x.commandHandler.groupSelection()},function(x){return x.commandHandler.canGroupSelection()})),y.add(new au("Ungroup Selection",function(x){x.commandHandler.ungroupSelection()},function(x){return x.commandHandler.canUngroupSelection()})),y.add(new au("Edit Text",function(x){x.commandHandler.editTextBlock()},function(x){return x.commandHandler.canEditTextBlock()})),y}al.prototype.showDefaultContextMenu=function(){var a=this.diagram;this.jt===null&&(this.jt=jh(this)),Sc.innerHTML="",Su.addEventListener("pointerdown",this.tu,!1);var y=this,x=hi("ul");x.className="goCXul",Sc.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=hi("li"),z.className="goCXli";var ee=hi("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)}}Sc.style.display="block",Su.style.display="block"},al.prototype.hideDefaultContextMenu=function(){if(this.currentContextMenu!==null&&this.currentContextMenu===ld){Sc.style.display="none",Su.style.display="none";var a=this.diagram;a!==null&&a.removeEventListener(Su,"pointerdown",this.tu,!1),this.currentContextMenu=null}},kt.Object.defineProperties(al.prototype,{currentContextMenu:{get:function(){return this.j},set:function(a){this.j=a,this.ht=a instanceof $o?a.adornedPart:null}},defaultTouchContextMenu:{get:function(){return xc===!1&&ld===null&&Ua&&su(this),ld},set:function(a){a===null&&(xc=!0),ld=a}},currentObject:{get:function(){return this.o},set:function(a){this.o=a}},mouseDownPoint:{get:function(){return this.yw}}});var ld=null,xc=!1,Su=null,Sc=null;al.className="ContextMenuTool",Ar("contextMenuTool",function(){return this.findTool("ContextMenu")},function(a){this.gb("ContextMenu",a,this.mouseUpTools)});function Na(){kr.call(this),this.name="TextEditing",this.Zh=new Da,this.ia=null,this.V=jd,this.vj=null,this.qa=hd,this.u=1,this.F=!0,this.o=null,this.j=new Nu,this.kt=null,ud(this,this.j)}Tt(Na,kr);function ud(a,y){if(Ua){var x=hi("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(Rd)):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!==hd){var E=a.kt;a.qa===Pc&&(a.qa=dd),typeof E.select=="function"&&a.selectsTextOnActivate&&(E.select(),E.setSelectionRange(0,9999))}},!1),x.addEventListener("blur",function(){if(a.currentTextEditor!==null&&a.state!==hd){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 Da&&z instanceof Na)if(z.state===cd)x.style.border="3px solid red",x.focus();else{var ee=E.ga(yo),re=b.position,oe=b.scale,le=E.Df()*oe;le<z.minimumEditorScale&&(le=z.minimumEditorScale);var he=E.naturalBounds.width*le+6,ge=E.naturalBounds.height*le+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*le,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*le+"%",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=le,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)}}}Na.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a===null||a.isReadOnly||rh&&rh!==this&&(rh.acceptText(Du),rh&&rh!==this)||!a.lastInput.left||this.isBeyondDragSize())return!1;var y=a.ic(a.lastInput.documentPoint);return y!==null&&y instanceof Da&&y.editable&&y.part.canEdit()?(y=y.part,!(y===null||this.starting===jd&&!y.isSelected||this.starting===uf&&2>a.lastInput.clickCount)):!1},Na.prototype.doStart=function(){rh=this,this.textBlock!==null&&this.doActivate()},Na.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 Da&&(this.textBlock=y,y.part!==null)){a.animationManager.Cc(),this.isActive=!0,this.qa=Pc;var x=this.defaultTextEditor;y.textEditor!==null&&(x=y.textEditor),this.Zh=this.textBlock.copy();var E=new zt(this.textBlock.ga(Xo),this.textBlock.ga(Xt));a.tv(E),x.show(y,a,this),this.currentTextEditor=x}}}},Na.prototype.doCancel=function(){this.stopTool()},Na.prototype.doMouseUp=function(){this.canStart()&&this.doActivate()},Na.prototype.doMouseDown=function(){this.isActive&&this.acceptText(Du)},Na.prototype.acceptText=function(a){switch(a){case Du:this.qa===zd?this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus():(this.qa===Pc||this.qa===cd||this.qa===dd)&&(this.qa=hf,Uf(this));break;case wc:case Rd:case lf:(Rd!==a||this.textBlock.isMultiline!==!0)&&(this.qa===Pc||this.qa===cd||this.qa===dd)&&(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=zd,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=cd,a.doError(b,z))}}Na.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)},Na.prototype.doSuccess=function(a,y){var x=this.textBlock;x.textEdited!==null&&x.textEdited(x,a,y)},Na.prototype.doDeactivate=function(){var a=this.diagram;a!==null&&(this.qa=hd,this.currentTextEditor!==null&&this.currentTextEditor.hide(a,this),this.textBlock=null,this.isActive=!1)},Na.prototype.doStop=function(){rh=null},Na.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)))},Na.prototype.Lx=function(a){var y=this.Zh;return y.text=a,y.measure(this.textBlock.Ih,1/0),y},kt.Object.defineProperties(Na.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)}}}),Na.prototype.measureTemporaryTextBlock=Na.prototype.Lx;var wc=new en(Na,"LostFocus",0),Du=new en(Na,"MouseDown",1),lf=new en(Na,"Tab",2),Rd=new en(Na,"Enter",3),Hg=new en(Na,"SingleClick",0),jd=new en(Na,"SingleClickSelected",1),uf=new en(Na,"DoubleClick",2),hd=new en(Na,"StateNone",0),Pc=new en(Na,"StateActive",1),dd=new en(Na,"StateEditing",2),hf=new en(Na,"StateValidating",3),cd=new en(Na,"StateInvalid",4),zd=new en(Na,"StateValidated",5),rh=null;Na.className="TextEditingTool",Na.LostFocus=wc,Na.MouseDown=Du,Na.Tab=lf,Na.Enter=Rd,Na.SingleClick=Hg,Na.SingleClickSelected=jd,Na.DoubleClick=uf,Na.StateNone=hd,Na.StateActive=Pc,Na.StateEditing=dd,Na.StateValidating=hf,Na.StateInvalid=cd,Na.StateValidated=zd,Ar("textEditingTool",function(){return this.findTool("TextEditing")},function(a){this.gb("TextEditing",a,this.mouseUpTools)});function kl(a){Cc||(gd(),Cc=!0),this.H=Ku,this.Ok=this.zb=this.vq=this.bc=!1,this.Qw=!0,this.Pk=nl,this.Dm=!1,this.Gh=this.Jd=!0,this.Dg=600,this.cw=this.Ow=!1,this.Zd=new Zn,this.ce=new zs,this.ce.Yd=this,this.Ei=new Zn,this.pu=new Zn,this.Sr=new Zn,this.pr=new Zn,a&&Object.assign(this,a)}kl.prototype.Xe=function(a){this.H=a},kl.prototype.canStart=function(){return!0};function oh(a,y){a.Jd&&a.canStart(y)&&(a.Zd.add(y),a.defaultAnimation.isAnimating&&a.Cc(),Zs(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===nl?(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===pd&&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(),Zd(y,x),a.Ok=!1,x.N()):(a.Zd.clear(),x.kg=!1,E=y.vc.get(x),x.autoScale!==il&&E!==null&&(delete E.start.scale,delete E.end.scale),yn.requestAnimationFrame(function(){a.zb===!1||y.bc||(x.Gf("temporaryPixelRatio")&&Ks(x),Bc(x),a.zb=!1,y.start(),y.bc&&(wu(a),x.Ya(),Yf(y,0),zl(x,!0),Tu(a),x.R("AnimationStarting",a)))}))}}function ah(a){return a.Zd.contains("Trigger")&&a.Zd.count===1}function cf(a,y,x,E){a.isTicking||ah(a)||y instanceof ti&&(y.fromNode!==null||y.toNode!==null)||a.ce.add(y,"position",x,E,!1)}Ce=kl.prototype,Ce.fv=function(a){return this.ce.fv(a)},Ce.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 bt&&oe.diagram!==null||oe instanceof Zt){re=!0;break e}}re=!1}re?bc(ee,!1):ee.Xk=!0}}b.pu.clear(),b.bc!==!1&&(wu(b),zl(b.H),Tu(b)),yn.requestAnimationFrame(x)}}var E=a.Ei,b=a;a.bc?a.Sr.add(y):(a.bc=!0,E.add(y),yn.requestAnimationFrame(function(){x()}))}function Wg(a){for(a=a.Ei.iterator;a.next();)a.value.Xk=!1}function wu(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 Tu(a){var y=a.H;y.skipsUndoManager=a.Ow,y.skipsModelSourceBindings=a.cw,a.vq=!1}Ce.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(),Zd(y,null),a===!0)for(a=this.Ei.Fa(),y=0;y<a.length;y++)a[y].Ml(!0)}else y.vc.clear(),Zd(y,this.H)},Ce.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))},Ce.Cj=function(a,y){this.zb&&(this.Zd.contains("Expand Tree")||this.Zd.contains("Expand SubGraph"))&&(this.ce.Cj(a,y),hl(this,a))},Ce.Aj=function(a,y){this.zb&&(this.Zd.contains("Collapse Tree")||this.Zd.contains("Collapse SubGraph"))&&(this.ce.Aj(a,y),_u(this.ce,y,"position",y.position,y.position),hl(this,a))};function gf(a,y,x){!a.zb||y.D(x)||ah(a)||(a.H.pi||(y=x.copy()),_u(a.ce,a.H,"position",y,x))}function pf(a,y,x){y.fd&&(y.Tg=x,a.pr.add(y))}function hl(a,y){for(y=y.findLinksConnected();y.next();){var x=y.value;x.fd&&(x.Tg=x.points.copy(),a.pr.add(x))}}function fd(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],le=y[1],he=y[2];return y=y[3],re===0||re===100?(z=oe,ee=le):(he===0||he===100)&&(oe=z,le=ee),180<Math.abs(oe-z)&&(oe>z?z+=360:oe+=360),z=b(x,z,oe-z,E)%360,ee=b(x,ee,le-ee,E),re=b(x,re,he-re,E),x=b(x,a,y-a,E),"hsla("+z+", "+ee+"%, "+re+"%, "+x+")"}function gd(){function a(x,E,b,z,ee,re){x.position=new _e(z(ee,E.x,b.x-E.x,re),z(ee,E.y,b.y-E.y,re))}var y=new Ut;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 _e(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 _e(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 _e(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,le=b.actualBounds;b=le.x+le.width/2-oe.width/2,oe=le.y+le.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 _e(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 zt(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=fd(E,b,ee,re,z)}),y.add("stroke",function(x,E,b,z,ee,re){x.stroke=fd(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=fd(E,b,ee,re,z)}),y.add("areaBackground",function(x,E,b,z,ee,re){x.areaBackground=fd(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)}),Ec=y}kt.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&&Dn(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 Ec=null,Cc=!1,nl=new en(kl,"Default",1),pd=new en(kl,"AnimateLocations",2),mf=new en(kl,"None",3);kl.className="AnimationManager",kl.defineAnimationEffect=function(a,y){Cc||(gd(),Cc=!0),Ec.add(a,y)},kl.Default=nl,kl.AnimateLocations=pd,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=Gd,this.Wk=this.ho=!1,this.cu=1,this.au=0,this.Gd=this.Dg=NaN,this.gw=0,this.dn=null,this.o=pi,this.vc=new Ut,this.Tt=new Ut,this.yl=new Zn,this.Ut=new Zn,this.dw=Kh,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,bc(this,!0),wu(this.Yd),zl(this.H),Tu(this.Yd),this.H.redraw()};function Zd(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}Ce=zs.prototype,Ce.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 Zt?a=x:x instanceof bt&&(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===nl&&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=Dc),wu(y),this.yl.each(function(E){E.data=null,a.add(E)}),Tu(y),this.bc=!0,this.Qd=+new Date,this.cn=this.Qd+this.Gd,ff(y,this),this)},Ce.Iy=function(a,y){return a.Zc()?(this.yl.add(a),this.H=y,this):this},Ce.add=function(a,y,x,E,b){if(y==="position"&&x.Xa(E))return this;if(this.H===null&&(a instanceof Zt?this.H=a:a instanceof bt&&a.diagram!==null&&(this.H=a.diagram)),a instanceof mr){if(!a.isAnimated)return this;y==="position"&&(y="position:part")}return _u(this,a,y,x,E,b),this};function _u(a,y,x,E,b,z){var ee=a.vc;if(y instanceof Zt&&x==="position"&&(x="position:diagram"),(x==="fill"||x==="stroke"||x==="background"||x==="areaBackground")&&(cu(E),kf(),E=[Wl.j,Wl.u,Wl.o,Wl.F],cu(b),kf(),b=[Wl.j,Wl.u,Wl.o,Wl.F]),ee.contains(y)){var re=ee.I(y),oe=re.start,le=re.end;oe[x]===void 0&&(oe[x]=zh(E)),le[x]=zh(b)}else oe={},le={},oe[x]=zh(E),le[x]=zh(b),re=oe.position,y instanceof bt&&re instanceof _e&&!re.w()&&y.diagram.animationManager.Zd.contains("Expand SubGraph")&&re.assign(le.position),re=new Wu(oe,le,z),ee.add(y,re);ee=oe[x],ee instanceof _e&&!ee.w()&&ee.assign(a.o),z&&x.indexOf("position:")===0&&y instanceof mr?re.Ku.location=zh(y.location):z&&(re.Ku[x]=zh(E))}function zh(a){return a instanceof _e||a instanceof bn?a.copy():a}Ce.fv=function(a){return this.bc?(a=this.vc.I(a),a!==null&&a.nv):!1},Ce.Xu=function(a){return this.bc?(a=this.vc.I(a),a!==null&&(a.start.position||a.start.location)):!1};function bc(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),wu(x),Yf(a,b),zl(a.H,!0),Tu(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 bt&&z.diagram===null)){var ee=E.value,re=b?ee.end:ee.start;ee=b?ee.start:ee.end;var oe=Ec,le;for(le in ee)le==="position"&&(ee["position:placeholder"]||ee["position:nodeCollapse"])||oe.get(le)===null||oe.get(le)(z,re[le],ee[le],a.Lp,y,x,a)}}}Ce.stop=function(){return this.bc?(this.Ml(!0),this):this},Ce.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,wu(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=Ec;E.next();){var ee=E.key,re=E.value,oe=b?re.end:re.start,le=b?re.start:re.end,he=re.Ku,ge;for(ge in le)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]:le[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(),Lc(y,!1),y.Ya(),y.N(),zl(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()}zl(y,!0),this.isViewportUnconstrained&&(y.scrollMode=this.dw),Tu(x),this.au++,!a&&this.cu>this.au?(this.Wk=!1,this.start()):(this.dn&&this.dn(this),Zd(this,null),x.Ml(this),y.$b())}},Ce.Cj=function(a,y){var x=y.actualBounds,E=null;if(y instanceof qr&&(E=y.placeholder),E!==null?(x=E.ga(Xo),E=E.padding,x.x+=E.left,x.y+=E.top,this.add(a,"position",x,a.position,!1)):this.add(a,"position",new _e(x.x+x.width/2,x.y+x.height/2),a.position,!1),this.add(a,"scale",.01,a.scale,!1),a instanceof qr)for(a=a.memberParts;a.next();)E=a.value,E instanceof Fi&&this.Cj(E,y)},Ce.Aj=function(a,y){if(a.isVisible()){var x=null;if(y instanceof qr&&(x=y.placeholder),x!==null){var E=x.ga(Xo);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 qr)for(a=a.memberParts;a.next();)E=a.value,E instanceof Fi&&this.Aj(E,y)}},Ce.Ez=function(a){var y=this.Tt.get(a);return y===null&&(y={},this.Tt.add(a,y)),y},kt.Object.defineProperties(zs.prototype,{duration:{get:function(){return this.Dg},set:function(a){1>a&&Dn(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:it("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 Gd(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=Gd,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 Wu(a,y,x){this.start=a,this.end=y,this.Ku={},this.Hu=x,this.nv=!1}Wu.className="AnimationState";function Pu(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=Zh))}Pu.prototype.copy=function(){var a=new Pu(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))}kt.Object.defineProperties(Pu.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 en(Pu,"Default",1),Zh=new en(Pu,"Immediate",2),Hd=new en(Pu,"Bundled",3);Pu.className="AnimationTrigger",Pu.Default=Xf,Pu.Immediate=Zh,Pu.Bundled=Hd;function bs(a){wr(this),this.H=null,this.Pa=new Tn,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)}Ce=bs.prototype,Ce.clear=function(){for(var a=this.Pa,y=0;y<a.length;y++){var x=a.s[y];x.Ig=null,$s(x)}a.clear(),this.Zq.length=0},Ce.Xe=function(a){this.H=a},Ce.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 qr?b++:oe instanceof Fi?E++:oe instanceof ti?z++:oe instanceof $o?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&&hr(E)&&(re+=" #"+hr(E)),x instanceof Fi?re+=" "+dr(E):x instanceof ti&&(re+=" "+dr(x.fromNode)+" "+dr(x.toNode));return y+" "+this.Pa.count+": "+re},Ce.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=_e.alloc(),z=this.Pa.s,ee=z.length;ee--;){var re=z[ee];if((E!==!0||zc(re)!==!1)&&re.isVisible()&&(b.assign(a),Ei(b,re.oe),re=re.ic(b,y,x),re!==null&&(y!==null&&(re=y(re)),re!==null&&(x===null||x(re)))))return _e.free(b),re}return _e.free(b),null},Ce.ji=function(a,y,x,E){if(y===void 0&&(y=null),x===void 0&&(x=null),E instanceof Tn||E instanceof Zn||(E=new Zn),this.Uh===!1)return E;var b=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(b=!0);for(var z=_e.alloc(),ee=this.Pa.s,re=ee.length;re--;){var oe=ee[re];if((b!==!0||zc(oe)!==!1)&&oe.isVisible()){z.assign(a),Ei(z,oe.oe);var le=oe;oe.ji(z,y,x,E)&&(y!==null&&(le=y(le)),le===null||x!==null&&!x(le)||E.add(le))}}return _e.free(z),E},Ce.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 Tn||b instanceof Zn||(b=new Zn),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||zc(oe)!==!1)&&oe.isVisible()){var le=oe;oe.Cf(a,y,x,E,b)&&(y!==null&&(le=y(le)),le===null||x!==null&&!x(le)||b.add(le))}}return b},Ce.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 le=re[oe];if((ee!==!0||zc(le)!==!1)&&z(le)&&le.isVisible()){var he=le;le.Cf(a,y,x,E,b)&&(y!==null&&(he=y(he)),he===null||x!==null&&!x(he)||b.add(he))}}return b},Ce.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 Tn||b instanceof Zn)&&(z=b),b=!0),z instanceof Tn||z instanceof Zn||(z=new Zn),this.Uh===!1)return z;var ee=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(ee=!0);for(var re=_e.alloc(),oe=_e.alloc(),le=this.Pa.s,he=le.length;he--;){var ge=le[he];if((ee!==!0||zc(ge)!==!1)&&ge.isVisible()){re.assign(a),Ei(re,ge.oe),oe.h(a.x+y,a.y),Ei(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 _e.free(re),_e.free(oe),z},Ce.Fd=function(a,y){if(this.visible){var x=this.Pa.s,E=x.length;if(E!==0){a=Hi();for(var b=Hi(),z=0;z<E;z++){var ee=x[z];if(ee.vw=z,ee instanceof ti){if(ee.fd===!1)continue}else if(ee instanceof $o&&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]);Mi(a),Mi(b)}}};function Vu(a,y){var x=1;return a.pb!==1&&(x=y.globalAlpha,y.globalAlpha=x*a.pb),x}Ce.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=Vu(this,a);var z=this.Zq;z.length=0;for(var ee=y.scale,re=zt.alloc(),oe=0;oe<E;oe++)this.Oj(a,x[oe],y,z,ee,re,!0);if(zt.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=Vu(a,y),re=a.Zq;re.length=0;for(var oe=x.scale,le=zt.alloc(),he=0;he<z;he++){var ge=b[he];E.contains(ge)&&a.Oj(y,ge,x,re,oe,le,!1)}zt.free(le),y.globalAlpha=ee}}}Ce.Oj=function(a,y,x,E,b,z,ee){if(ee&&!zc(y))a.Hs(y);else{if(E!==null&&y instanceof ti&&(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&&(Ya(y,a,y.areaBackground,!0,!0,z,b),a.fillRect(b.x,b.y,b.width,b.height)),y.areaBackground===null&&y.background===null&&(Ya(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),Ya(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))}},Ce.g=function(a,y,x,E,b){var z=this.diagram;z!==null&&z.cb(Bo,a,this,y,x,E,b)},Ce.oi=function(a,y,x){var E=this.Pa;if(y.Ig=this,this===null&&$s(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},Ce.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,$s(y),a};function yf(a,y,x){if(y=Fc(a,y,x),x instanceof qr&&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 Fc(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}kt.Object.defineProperties(bs.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===""&&it("Cannot rename default Layer to: "+a),x=x.layers;x.next();)x.value.name===a&&it("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)&&Dn(a,"0 <= value <= 1",bs,"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))}}}),bs.prototype.findObjectsNear=bs.prototype.og,bs.prototype.findObjectsIn=bs.prototype.Cf,bs.prototype.findObjectsAt=bs.prototype.ji,bs.prototype.findObjectAt=bs.prototype.ic,bs.className="Layer";function Zt(a,y){if(tp||(Js(),tp=!0),wr(this),Ku=this,this.vb=!0,this.Ka=null,this.ya=this.Aa=0,this.ta=null,Ua){var x=this,E=function(){x.removeEventListener(yn.document,"DOMContentLoaded",E,!1),x.setRTL()};yn.document.body!==null?this.setRTL():x.addEventListener(yn.document,"DOMContentLoaded",E,!1)}this.ol=null,Mf.add("Model",va);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===Bo&&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 Ga,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"||yn.Element&&a instanceof Element?Qf(this,a):y=a),this.vb=!1,y&&this.nm(y),this}var md,Ku;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 Tn,a.pj=new Ut,a.nl="default",a.Tx(),a.Sx(),a.pb=1,a.pa=new _e(NaN,NaN).freeze(),a.du=new _e(NaN,NaN),a.Ca=1,a.Pp=1,a.zt=new _e(NaN,NaN).freeze(),a.At=NaN,a.Ot=1e-4,a.Mt=100,a.Ab=new Pt,a.zu=new _e(NaN,NaN).freeze(),a.ut=new zt(NaN,NaN,NaN,NaN).freeze(),a.rj=new Vr(0,0,0,0).freeze(),a.sj=Kh,a.nu=!1,a.Zt=null,a.fu=null,a.yh=il,a.zk=er,a.Fg=il,a.pq=er,a.yt=Xo,a.Bt=Xo,a.Fc=!0,a.pn=!1,a.De=new Zn,a.Eh=new Ut,a.Xm=!0,a.vp=250,a.vk=-1,a.xp=new Vr(16,16,16,16).freeze(),a.kg=!1,a.Jk=!1,a.fn=!0,a.bq=new Nr,a.bq.diagram=a,a.Qg=new Nr,a.Qg.diagram=a,a.cj=new Nr,a.cj.diagram=a,a.zg=null,a.pf=null,a.qu=!1,Zp(a),a.ai=new Zn,a.Ht=!0,a.uu=Bh,a.pw=!1,a.wu=Ed,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 Ut,a.Xn=new Tn,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 Vr(5).freeze(),a.Hw=new Zn().freeze(),a.Nt=999999999,a.nw=new Zn().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 Zn,a.ow=new Zn,a.Xh=null,a.aw=new bn(8,8),a.bw=999,a.Bw=1,a.Jw=0,a.fc={scale:1,position:new _e,bounds:new zt,Py:new bn,bA:new bn,Oz:!1},a.fc.canvasSize=a.fc.Py,a.fc.newCanvasSize=a.fc.bA,a.fc.isScroll=!1,a.Rw=new zt(NaN,NaN,NaN,NaN).freeze(),a.wo=new bn(NaN,NaN).freeze(),a.Sp=new zt(NaN,NaN,NaN,NaN).freeze(),a.It=!1,a.Lg=new Ut;var y=new Fi,x=new Da;x.bind(new fs("text","",dr)),y.add(x),a.ny=y,a.Lg.add("",y),y=new Fi,x=new Da,x.stroke="brown",x.bind(new fs("text","",dr)),y.add(x),a.Lg.add("Comment",y),y=new Fi,y.selectable=!1,y.avoidable=!1,x=new ao,x.figure="Ellipse",x.fill="black",x.stroke=null,x.desiredSize=new bn(3,3).ja(),y.add(x),a.Lg.add("LinkLabel",y),a.Yi=new Ut,y=new qr,y.selectionObjectName="GROUPPANEL",y.type=Xn.Vertical,x=new Da,x.font="bold 12pt sans-serif",x.bind(new fs("text","",dr)),y.add(x),x=new Xn(Xn.Auto),x.name="GROUPPANEL";var E=new ao;E.figure="Rectangle",E.fill="rgba(128,128,128,0.2)",E.stroke="black",x.add(E),E=new xl,E.padding=new Vr(5,5,5,5).ja(),x.add(E),y.add(x),a.ly=y,a.Yi.add("",y),a.Kh=new Ut,y=new ti,x=new ao,x.isPanelMain=!0,y.add(x),x=new ao,x.toArrow="Standard",x.fill="black",x.stroke=null,x.strokeWidth=0,y.add(x),a.my=y,a.Kh.add("",y),y=new ti,x=new ao,x.isPanelMain=!0,x.stroke="brown",y.add(x),a.Kh.add("Comment",y),y=new $o,y.type=Xn.Auto,x=new ao,x.fill=null,x.stroke="dodgerblue",x.strokeWidth=3,y.add(x),x=new xl,x.margin=new Vr(1.5,1.5,1.5,1.5).ja(),y.add(x),a.St=y,a.wt=y,y=new $o,y.type=Xn.Link,x=new ao,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 va,a.toolManager=new Eo,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=Wi,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 _e,a.zy=500,a.wp=new _e,a.wq=!1}Zt.prototype.clear=function(){this.animationManager.Cc(),this.model.clear(),Jd=null,Vh="",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 Zn().freeze(),a.nw=new Zn().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(),mo=[],b!==null&&(a.add(b),a.partManager.parts.remove(b)),E&&(a.skipsUndoManager=x),z}function zp(){return null}Zt.prototype.reset=function(){this.clear(),this.vb=!0,Ug(this),Yu(this),this.Wg=!0,Yg(this),this.layout=new Ga,this.Wg=!1,this.model=Sy(),this.model.undoManager=new ha,this.vb=this.rn=!1,this.N()},Zt.prototype.setRTL=function(a){a=a===void 0?this.div:a,a===null&&(a=yn.document.body);var y=hi("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},Zt.prototype.setScrollWidth=function(a){a=a===void 0?this.div:a,a===null&&(a=yn.document.body);var y=0;if(Ua){var x=ep;y=md,x===null&&(x=ep=hi("p"),x.style.width="100%",x.style.height="200px",x.style.boxSizing="content-box",y=md=hi("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||zr||(y=11)}this.Db=y,this.Gw=!0},Zt.prototype.qb=function(a){a.classType===Zt&&(this.autoScale=a)},Zt.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(Ua){if(y!=null||it("Diagram setup requires an argument DIV."),a.Ka!==null&&it("Diagram has already completed setup."),typeof y=="string"?a.Ka=yn.document.getElementById(y):y instanceof HTMLDivElement?a.Ka=y:it("No DIV or DIV id supplied: "+y),a.Ka===null&&it("Invalid DIV id; could not get element with id: "+y),a.Ka.H!==void 0&&it("Invalid div id; div already has a Diagram associated with it."),!a.ol&&yn.ResizeObserver){var x=It(function(){a.$b()},250);a.ol=new yn.ResizeObserver(function(){x()}),a.ol.observe(a.Ka)}yn.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=yn.go;var b=new Ys(a);if(b.style!==void 0&&(b.style.position="absolute",b.style.top="0px",b.style.left="0px",yn.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),Ac(a,a.Aa,a.ya),a.Ka.insertBefore(b.Oa,a.Ka.firstChild),b=new Ys(null),b.width=1,b.height=1,a.jw=b,a.oy=b.context,Ua){b=hi("div");var z=hi("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=It(function(){a.Yh=null,a.N()},300),a.Ov=It(function(){Bc(a)},250),a.preventDefault=function(ee){return ee.preventDefault(),!1},a.$j=function(ee){if(a.isEnabled){var re=Ql(a,ee,!0);re.bubbles=!0;var oe=0,le=0;re.delta=0,ee.deltaX!==void 0?(ee.deltaX!==0&&(oe=0<ee.deltaX?1:-1),ee.deltaY!==0&&(le=0<ee.deltaY?1:-1),re.delta=Math.abs(ee.deltaX)>Math.abs(ee.deltaY)?-oe:-le):ee.wheelDeltaX!==void 0?(ee.wheelDeltaX!==0&&(oe=0<ee.wheelDeltaX?-1:1),ee.wheelDeltaY!==0&&(le=0<ee.wheelDeltaY?-1:1),re.delta=Math.abs(ee.wheelDeltaX)>Math.abs(ee.wheelDeltaY)?-oe:-le):ee.wheelDelta!==void 0&&ee.wheelDelta!==0&&(re.delta=0<ee.wheelDelta?1:-1),a.doMouseWheel(),uu(re,ee)}},a.aA=function(ee){a.isEnabled&&(a.Vk=!1,Ql(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 le=oe;oe=qf(a,ee,!0,!1,!0,le),Lh(a,ee,oe),oe.targetDiagram=Vd(ee,ee.target),oe.targetObject=null,le||oe.clone(a.bq),le=a.uw,re=re?25:10,ee.timeStamp-a.tw<a.zy&&!(Math.abs(le.x-ee.screenX)>re||Math.abs(le.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():uu(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=yn.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 le=a,he=ee;oe&&oe.H&&(he=ee,le=oe.H),re.targetDiagram=le,Lh(a,he,re),re.targetObject=null,a.doMouseMove(),uu(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 le=yn.document.elementFromPoint(ee.clientX,ee.clientY)||null;le!==null&&le.shadowRoot!==void 0&&le.shadowRoot!==null&&(le=le.shadowRoot.elementFromPoint(ee.clientX,ee.clientY)),le!==null&&le.H instanceof Zt&&le.H!==a&&Lh(le.H,ee,oe),le===null&&(le=ee.target),Lh(a,ee,oe),oe.clickCount=a.yq,oe.targetDiagram=Vd(ee,le),oe.targetObject=null,a.doMouseUp(),uu(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"+Fd[1]+Fd[2]+"wI"+bd.slice(1,5)]["b"+NS.slice(1,y)](E.Z,Tc,y,y),E.Vc(!0),Om(a),a.nl==="svg"&&(y=a.pj.get("svg"),a.Ka.appendChild(y.Oa),a.ib=y.context)}}Zt.prototype.addEventListener=function(a,y,x,E){a.addEventListener(y,x,{capture:E,passive:!1})},Zt.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(yn,"resize",a.Ov,!1)}function Ks(a){30<a.Sq&&(a.Yh=1)}function Lc(a,y){a.Yh!==null&&(a.Yh=null,y&&a.hk(),vr&&vr.nx||(a.Sq=0,a.zw=[0,0,0,0,0],a.Tq=0))}Zt.prototype.computePixelRatio=function(){return this.Yh!==null?this.Yh:yn.devicePixelRatio||1},Zt.prototype.doMouseMove=function(){this.currentTool.doMouseMove()},Zt.prototype.doMouseDown=function(){this.currentTool.doMouseDown()},Zt.prototype.doMouseUp=function(){this.currentTool.doMouseUp()},Zt.prototype.doMouseWheel=function(){this.currentTool.doMouseWheel()},Zt.prototype.doKeyDown=function(){this.currentTool.doKeyDown()},Zt.prototype.doKeyUp=function(){this.currentTool.doKeyUp()},Zt.prototype.doFocus=function(){this.focus()},Zt.prototype.focus=function(){if(this.ta)if(this.scrollsPageOnFocus)this.ta.focus();else{var a=yn.scrollX||yn.pageXOffset,y=yn.scrollY||yn.pageYOffset;this.ta.focus(),yn.scrollTo(a,y)}},Zt.prototype.Oy=function(){this.H.R("GainedFocus")},Zt.prototype.Ny=function(){this.H.R("LostFocus")};function Bc(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===il&&(a.Jk=!0,y.C()),a.ld||a.$b())}}}function Yg(a){var y=new bs;y.name="Background",a.Al(y),y=new bs,y.name="",a.Al(y),y=new bs,y.name="Foreground",a.Al(y),y=new bs,y.name="Adornment",y.isTemporary=!0,y.isInDocumentBounds=!1,a.Al(y),y=new bs,y.name="Tool",y.isTemporary=!0,y.isInDocumentBounds=!0,a.Al(y),y=new bs,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 Xn(Xn.Grid);y.name="GRID";var x=new ao;return x.figure="LineH",x.stroke="lightgray",x.strokeWidth=.5,x.interval=1,y.add(x),x=new ao,x.figure="LineH",x.stroke="gray",x.strokeWidth=.5,x.interval=5,y.add(x),x=new ao,x.figure="LineH",x.stroke="gray",x.strokeWidth=1,x.interval=10,y.add(x),x=new ao,x.figure="LineV",x.stroke="lightgray",x.strokeWidth=.5,x.interval=1,y.add(x),x=new ao,x.figure="LineV",x.stroke="gray",x.strokeWidth=.5,x.interval=5,y.add(x),x=new ao,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):Yd(this.H)}function xf(a){this.H.isEnabled?(this.H.lu=a.target.scrollTop,this.H.ju=a.target.scrollLeft):Yd(this.H)}Zt.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,le=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 Xe=a.scrollLeft;if(this.tn)switch(this.bu){case"negative":Xe=Xe+a.scrollWidth-a.clientWidth;break;case"reverse":Xe=a.scrollWidth-Xe-a.clientWidth}var Ve=Xe;xe<oe||Pe<le?(Xe=_e.allocAt(this.position.x,this.position.y),this.allowHorizontalScroll&&this.ju!==Ve&&(Xe.x=Ve/b+ee,this.ju=Ve),this.allowVerticalScroll&&this.lu!==a.scrollTop&&(Xe.y=a.scrollTop/b+re,this.lu=a.scrollTop),this.position=Xe,_e.free(Xe),this.Ee=this.qr=!1):(Xe=_e.alloc(),a.uy&&this.allowHorizontalScroll&&(ee<ge&&(this.position=Xe.h(Ve+ee,this.position.y)),he>Fe&&(this.position=Xe.h(-(y.scrollWidth-this.Aa)+Ve-this.Aa/b+he,this.position.y))),a.vy&&this.allowVerticalScroll&&(re<E&&(this.position=Xe.h(this.position.x,a.scrollTop+re)),z>Ne&&(this.position=Xe.h(this.position.x,-(y.scrollHeight-this.ya)+a.scrollTop-this.ya/b+z))),_e.free(Xe),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>=le&&re>=E&&z<=Ne&&(x.style.height="1px"))}},Zt.prototype.computeBounds=function(a){return a===void 0&&(a=new zt),Zs(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 le=ee[oe];le.isInDocumentBounds&&le.isVisible()&&(le=le.actualBounds,le.w()&&(x?(x=!1,y.assign(le)):y.ed(le)))}}}return x&&y.h(0,0,0,0),y.Co(a.yb),y}Zt.prototype.computePartsBounds=function(a,y){y===void 0&&(y=!1);var x=null;if(qt(a))for(var E=0;E<a.length;E++){var b=a[E];!y&&b instanceof ti||(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 ti||(E.Va(),x===null?x=E.actualBounds.copy():x.ed(E.actualBounds));return x===null?new zt(NaN,NaN,0,0):x};function lu(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=_e.alloc(),x.xi(a.documentBounds,a.initialDocumentSpot);var E=a.viewportBounds;E=zt.allocAt(0,0,E.width,E.height);var b=_e.alloc();b.xi(E,a.initialViewportSpot),b.h(x.x-b.x,x.y-b.y),a.position=b,zt.free(E),_e.free(b),_e.free(x)}x=a.yh,y&&a.Fg!==il&&(x=a.Fg);var z=x!==il?Wd(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()?yo:oe),$f(a,a.documentBounds,b,ee,re,y),y=a.scale,a.scale=z,a.vb=!1,z=a.viewportBounds,He.B(z.x,x)&&He.B(z.y,E)&&He.B(z.width,b)&&He.B(z.height,ee)||a.onViewportBoundsChanged(new zt(x,E,b,ee),z,y,!1)}}function Wd(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===Qd?(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}Zt.prototype.zoomToFit=function(){var a=this.sj;this.sj=Kh,this.scale=Wd(this,Al),a!==Kh&&(lu(this,!1),$f(this,this.documentBounds,this.Aa/this.Ca,this.ya/this.Ca,this.zk,!1)),this.sj=a},Ce=Zt.prototype,Ce.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===Qd)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===Qd?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 _e(a.x,a.y)}},Ce.Jy=function(a,y){this.Va();var x=this.documentBounds,E=this.viewportBounds;this.position=new _e(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))},Ce.zz=function(a){if(a instanceof bt){this.eq=a;var y=_e.alloc();this.fq=this.op(a.ga(Xo,y)),_e.free(y)}else this.eq=null,this.fq=Wi};function $f(a,y,x,E,b,z){var ee=_e.allocAt(a.pa.x,a.pa.y),re=ee.x,oe=ee.y;if(a.eq!==null){var le=_e.alloc();le=a.eq.ga(Xo,le),re=le.x-a.fq.x/a.scale,oe=le.y-a.fq.y/a.scale,b=to,_e.free(le)}(z||a.scrollMode===Kh)&&(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),Yu(a),_e.free(ee)}Ce.Ol=function(a,y){if(y===void 0&&(y=!0),y){if(a=sh(this,a,function(x){return x.part},function(x){return x.canSelect()}),a instanceof mr)return a}else if(a=sh(this,a,function(x){return x.part}),a instanceof mr)return a;return null},Ce.ic=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null),Zs(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 sh(a,y,x,E){for(x===void 0&&(x=null),E===void 0&&(E=null),Zs(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}Ce.lz=function(a,y,x){return y===void 0&&(y=!0),Mc(this,a,function(E){return E.part},y?function(E){return E instanceof mr&&E.canSelect()}:null,x)};function Mc(a,y,x,E,b){for(x===void 0&&(x=null),E===void 0&&(E=null),b instanceof Tn||b instanceof Zn||(b=new Zn),Zs(a),a=a.Wa.iteratorBackwards;a.next();){var z=a.value;z.visible&&!z.isTemporary&&z.ji(y,x,E,b)}return b}Ce.ji=function(a,y,x,E){y===void 0&&(y=null),x===void 0&&(x=null),E instanceof Tn||E instanceof Zn||(E=new Zn),Zs(this);for(var b=this.Wa.iteratorBackwards;b.next();){var z=b.value;z.visible&&z.ji(a,y,x,E)}return E},Ce.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)},Ce.Cf=function(a,y,x,E,b){y===void 0&&(y=null),x===void 0&&(x=null),E===void 0&&(E=!1),b instanceof Tn||b instanceof Zn||(b=new Zn),Zs(this);for(var z=this.Wa.iteratorBackwards;z.next();){var ee=z.value;ee.visible&&ee.Cf(a,y,x,E,b)}return b},Ce.Nu=function(a,y,x,E,b,z){var ee=new Zn;Zs(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 Tn||b instanceof Zn||(b=new Zn),Zs(a),a=a.Wa.iteratorBackwards;a.next();){var ee=a.value;ee.visible&&!ee.isTemporary&&ee.Cf(y,z,x,E,b)}return b}Ce.mz=function(a,y,x,E,b){return x===void 0&&(x=!0),E===void 0&&(E=!0),kc(this,a,y,function(z){return z instanceof mr&&(!E||z.canSelect())},x,b)},Ce.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 Tn||b instanceof Zn)&&(z=b),b=!0),z instanceof Tn||z instanceof Zn||(z=new Zn),Zs(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 kc(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 Tn||b instanceof Zn)&&(z=b),b=!0),z instanceof Tn||z instanceof Zn||(z=new Zn),Zs(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}Zt.prototype.acceptEvent=function(a){return Ql(this,a,a instanceof MouseEvent)};function Ql(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),zr&&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=Vd(y,y.target),E.targetObject=null,E}function Vd(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,zr&&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 uu(a,y){return a.bubbles?!0:(y.stopPropagation!==void 0&&y.stopPropagation(),y.cancelable!==!1&&y.preventDefault(),y.cancelBubble=!0,!1)}Zt.prototype.Qz=function(a){var y=this.H;if(!this.H.isEnabled)return!1;var x=Ql(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(),uu(x,a)},Zt.prototype.Rz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=Ql(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(),uu(x,a)},Zt.prototype.bz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=Ql(y,a,!0);return y.mouseEnter!==null&&y.mouseEnter(x),y.currentTool.standardMouseOver(),uu(x,a)},Zt.prototype.cz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=Ql(y,a,!0);return y.mouseLeave!==null&&y.mouseLeave(x),uu(x,a)},Zt.prototype.getMouse=function(a){var y=this.ta;if(y===null)return new _e(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?Ei(new _e(y,a),this.Ab):new _e(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=_e.allocAt(ee,re),a.Ab.Cd(y),x.documentPoint.assign(y),_e.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))}}Zt.prototype.Ya=function(){this.Zi||(this.Zi=!0,this.$b(!1))};function eg(a){a.ld||Zs(a),a.Va()}Zt.prototype.redraw=function(){this.vb||this.ld||(this.N(),this.bd())},Ce=Zt.prototype,Ce.Pz=function(){return this.kg},Ce.Xy=function(a){a===void 0&&(a=null);var y=this.animationManager,x=y.isEnabled;y.Cc(),y.isEnabled=!1,zl(this),this.hf=!1,this.du=new _e(NaN,NaN),y.isEnabled=x,this.ld=!0;var E=this;a!==null&&_t(function(){E.ld=!1,oh(y,"Model"),a(E)},1)},Ce.$b=function(a){if(a===void 0&&(a=!1),this.kg!==!0&&!(this.vb||a===!1&&this.ld)){this.kg=!0;var y=this;yn.requestAnimationFrame(function(){y.kg&&y.bd()})}},Ce.bd=function(){(!this.fn||this.kg)&&(this.fn&&(this.fn=!1),zl(this))};function vd(a,y,x){!a.Ee||a.vb||a.animationManager.defaultAnimation.isAnimating||Yd(a)||(y&&Zs(a),x&&lu(a,!1))}function zl(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];$e(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||Bc(a),vd(a,!1,!0),a.fe!==null&&(a.fe.visible&&!a.mq&&(Uu(a),a.mq=!0),!a.fe.visible&&a.mq&&(a.mq=!1)),Zs(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,Zs(a),a.ou||eg(a),vd(a,!0,!1),ee=!1,z?(x=zt.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"),vd(a,!0,!1),zt.free(x)):x.Ok&&x.Qw&&(a.Fg!==il?a.scale=Wd(a,a.Fg):a.yh!==il?a.scale=Wd(a,a.yh):(x=a.initialScale,isFinite(x)&&0<x&&(a.scale=x)),lu(a,!0)),z&&ee&&a.eb("Initial Layout"),Zs(a),y||a.gc(a.ib),b&&(a.skipsUndoManager=E),a.ld=!1}}function tg(a){if(a.Fg!==il)a.scale=Wd(a,a.Fg);else if(a.yh!==il)a.scale=Wd(a,a.yh);else{var y=a.initialScale;isFinite(y)&&0<y&&(a.scale=y)}lu(a,!0),y=a.Wa.s,a.Fd(y,y.length,a,a.viewportBounds),a.R("InitialLayoutCompleted"),a.du.assign(a.pa),Uu(a)}function Zs(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 Zn,a.Nv(x,a.De)}a.nodes.each(function(E){E instanceof qr&&E.U&65536&&(E.U=E.U^65536)})}}Ce.Nv=function(a,y){for(a.reset();a.next();){var x=a.value;!x.Zc()||x instanceof qr||(x.si()?(x.measure(1/0,1/0),x.arrange()):y.add(x))}for(a.reset();a.next();)x=a.value,x instanceof qr&&x.isVisible()&&lh(this,x);for(a.reset();a.next();)x=a.value,x instanceof ti&&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 $o&&x.isVisible()&&(x.si()?(x.measure(1/0,1/0),x.arrange()):y.add(x))};function lh(a,y){for(var x=Hi(),E=Hi(),b=y.memberParts;b.next();){var z=b.value;z.isVisible()&&(z instanceof qr?(qe(z)||gt(z)||jc(z))&&lh(a,z):z instanceof ti?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(Mi(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();Mi(E)}Ce.Fd=function(a,y,x,E){if(this.vd||this.animationManager.isAnimating)for(var b=0;b<y;b++)a[b].Fd(x,E)},Ce.gc=function(a){if(this.Ka!==null){if(this.ta===null&&it("No canvas specified"),this.nl==="svg"){if(this.Ka!==null){var y=this.animationManager;if(!y.zb&&(!y.isAnimating||y.isTicking)){Ud(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,ja(a,re.m11,re.m12,re.m21,re.m22,re.dx,re.dy),this.pb!==1&&(a.globalAlpha=this.pb),Gh(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?Yh(this.Yf,this)&&(a=this.Vp()):a=!0,a&&(Pt.prototype.Cd=Pt.prototype.Eu),this.Fc=this.vd=!1}}}}else e:if(z=this.animationManager,!z.zb&&(!z.isAnimating||z.isTicking)&&(x=new Date,Ud(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,le=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(-le,-he),a.setTransform(ee,0,0,ee,0,0),a.clearRect(0,0,this.Aa,this.ya),this.pb!==1&&(a.globalAlpha=this.pb),Gh(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?Yh(this.Yf,this)&&(y=this.Vp()):y=!0,y&&(Pt.prototype.Cd=Pt.prototype.Eu),E?(this.ib.Vc(!0),this.vd=!0):this.Fc=this.vd=!1,y=+new Date-+x,E=vr&&vr.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,le){if(a.Ka!==null){a.ta===null&&it("No canvas specified"),ee===void 0&&(ee=null),re===void 0&&(re=null),oe===void 0&&(oe=!1),le===void 0&&(le=!1),Ud(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 zt(z.x,z.y,E.width/b,E.height/b),Fe=Pe.copy();Fe.Co(x),Uu(a,Fe),Zs(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 Xe=Pt.alloc();Xe.reset(),Xe.translate(x.left,x.top),Xe.scale(b),z.x===0&&z.y===0||Xe.translate(-z.x,-z.y),y.setTransform(Xe.m11,Xe.m12,Xe.m21,Xe.m22,Xe.dx,Xe.dy),y.yc(),y instanceof da&&ja(y,Xe.m11,Xe.m12,Xe.m21,Xe.m22,Xe.dx,Xe.dy),Pt.free(Xe),Gh(a,y),y.globalAlpha=a.pb;var Ve=a.Qj("Grid");if(ee){var st=new Zn,ht=ee.iterator;for(ht.reset();ht.next();){var pt=ht.value;pt instanceof mr&&(le||pt.layer!==Ve)&&(pt.Gj(),st.add(pt))}for(le=0;le<xe;le++)Kg(ge[le],y,a,st,oe);st.each(function(Gt){return Gt.Gj()})}else for(st=0;st<xe;st++){var Et=ge[st];Et===Ve?le&&Et.gc(y,a,!0):Et.gc(y,a,oe)}a.$i=!1,a.Yf&&Yh(a.Yf,a)&&a.Vp()}finally{a.Ca=he,a.ib.Vc(!0),a.vd=!0,a.Fd(ge,xe,a,a.viewportBounds),Uu(a),a.ib instanceof da&&(a.ib.Nj.PA(),a.redraw())}}}Ce.Gf=function(a){return this.Rg[a]},Ce.Xx=function(a,y){a==="minDrawingLength"&&(this.Oq=y),this.Rg[a]=y,this.redraw()},Ce.Tx=function(){this.Rg=new Sr,this.Rg.drawShadows=!0,this.Rg.textGreeking=!0,this.Rg.viewportOptimizations=!(zr||Yo),this.Rg.temporaryPixelRatio=!0,this.Rg.pictureRatioOptimization=!0,this.Oq=this.Rg.minDrawingLength=1};function Gh(a,y){a=a.Rg,a!==null&&(a.imageSmoothingEnabled!==void 0&&y.Wx(!!a.imageSmoothingEnabled),a=a.defaultFont,a!=null&&(y.font=a))}Ce.Ql=function(a){return this.on[a]},Ce.sA=function(a,y){this.on[a]=y},Ce.Sx=function(){this.on=new Sr,this.on.extraTouchArea=10,this.on.extraTouchThreshold=10,this.on.hasGestureZoom=!0},Ce.set=function(a){return Object.assign(this,a),this},Ce.Du=function(a){return this.nm(a)},Ce.nm=function(a){return Kd(this,a),this};function Kd(a,y){var x=a instanceof Xn,E=a instanceof Zt,b;for(b in y){b===""&&it("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])),cn(z)?ee=b.substr(re+1):it("Unable to find object named: "+oe+" in "+a.toString()+" when trying to set property: "+b)}}if(ee[0]!=="_"&&!Er(z,ee))if(E&&ee==="ModelChanged"){a.Yw(y[ee]);continue}else if(E&&ee==="Changed"){a.Pe(y[ee]);continue}else if(E&&Er(a.toolManager,ee))z=a.toolManager;else if(E&&Qg(a,ee)){a.Bj(ee,y[ee]);continue}else if(a instanceof tr&&ee==="Changed"){a.Pe(y[ee]);continue}else it('Trying to set undefined property "'+ee+'" on object: '+z.toString());z[ee]=y[b],ee[0]==="_"&&z instanceof bt&&z.Vw(ee)}}Ce.bx=function(){if(this.Eh.count!==0&&!(1<this.undoManager.transactionLevel)){for(;0<this.Eh.count;){var a=this.Eh;for(this.Eh=new Ut,a=a.iterator;a.next();){var y=a.key;y.Xo(a.value),y.qc()}}this.N()}},Ce.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")},Zt.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!==Dc&&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=zt.alloc(),ug(this,this.computeBounds(E)),zt.free(E)),E=this.ta,E===null||E instanceof Ro)))){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 le=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),Yh(this.Yf,this)&&a.clearRect(0,0,oe,le),E=Hi(),a=Hi(),Pe=Math.abs(z),xe=Math.abs(y);var Fe=he===0?0:b-Pe;he=_e.allocAt(Fe,0),Pe=_e.allocAt(Pe+Fe,re),a.push(new zt(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),Ei(he,Ne),Ei(Pe,Ne),E.push(new zt(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 zt(Math.min(he.x,Pe.x),Math.min(he.y,Pe.y),Math.abs(he.x-Pe.x),Math.abs(he.y-Pe.y))),Ei(he,Ne),Ei(Pe,Ne),E.push(new zt(Math.min(he.x,Pe.x),Math.min(he.y,Pe.y),Math.abs(he.x-Pe.x),Math.abs(he.y-Pe.y))),Yh(this.Yf,this)&&(b=0<z?0:-z,re=0<y?0:-y,he.h(b,re),Pe.h(oe+b,le+re),a.push(new zt(Math.min(he.x,Pe.x),Math.min(he.y,Pe.y),Math.abs(he.x-Pe.x),Math.abs(he.y-Pe.y))),Ei(he,Ne),Ei(Pe,Ne),E.push(new zt(Math.min(he.x,Pe.x),Math.min(he.y,Pe.y),Math.abs(he.x-Pe.x),Math.abs(he.y-Pe.y)))),_e.free(he),_e.free(Pe),vd(this,!1,!0),this.Ka===null&&it("No div specified"),this.ta===null&&it("No canvas specified"),!this.animationManager.zb&&(b=this.ib,this.Fc)){for(Ud(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,le=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,-le),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),Gh(this,b),b.globalAlpha=this.pb,re=0;re<z;re++)if(ee=y[re],oe=E,ee.visible&&ee.pb!==0){le=Vu(ee,b),ge=ee.Zq,ge.length=0,he=this.scale,xe=zt.alloc(),Pe=ee.Pa.s,Ne=Pe.length,Fe=oe.length;for(var Xe=0;Xe<Ne;Xe++){var Ve=Pe[Xe],st=_f(Ve,Ve.actualBounds);e:{for(var ht=2/he,pt=4/he,Et=0;Et<Fe;Et++){var Gt=oe[Et];if(Gt.width!==0&&Gt.height!==0&&st.Vu(Gt.x-ht,Gt.y-ht,Gt.width+pt,Gt.height+pt)){st=!0;break e}}st=!1}st&&ee.Oj(b,Ve,this,ge,he,xe,!0)}zt.free(xe),b.globalAlpha=le}b.restore(),b.Vc(!0),this.Yf&&Yh(this.Yf,this)&&this.Vp(),this.Fc=this.vd=!1,this.hk()}Mi(E),Mi(a),this.ld=!1}}else this.bd();x&&(Ks(this),this.bd(),Lc(this,!0))}else x?(Ks(this),this.bd(),Lc(this,!0)):this.bd()}};function Ud(a){a.pn!==!1&&(a.pn=!1,Ac(a,a.Aa,a.ya))}function Ac(a,y,x){Yu(a);var E=a.Mb;a.ta.resize(y*E,x*E,y,x)&&(a.Fc=!0,a.ib.Vc(!0))}function Yd(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,le=b.clientHeight||E+re,he=a.viewportBounds;b=he.x;var ge=he.y,xe=he.width,Pe=he.height;if((oe!==x+ee||le!==E+re)&&(a.gf=!1,a.Be=!1,re=ee=0,a.Aa=oe,a.ya=le,z=a.pn=!0,Yu(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 Xe=a.documentBounds,Ve=0,st=0,ht=0,pt=0,Et=he.width,Gt=he.height,xi=a.rj;a.contentAlignment.sb()?(Xe.width>Et&&(Ve=xi.left,st=xi.right),Xe.height>Gt&&(ht=xi.top,pt=xi.bottom)):(Ve=xi.left,st=xi.right,ht=xi.top,pt=xi.bottom);var Ki=Xe.width+Ve+st,ji=Xe.height+ht+pt;xi=a.scale;var ei=Ki>oe/xi,En=ji>le/xi;if(!(z||a.gf||a.Be||ei||En))return!0;Ve=Xe.x-Ve,oe=he.x,st=Xe.right+st,le=he.right+ee,ht=Xe.y-ht;var Qr=he.y;Xe=Xe.bottom+pt,he=he.bottom+re;var Gr="1px";if(pt="1px",a.scrollMode===Kh&&(ei||En)&&(ei&&a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(ei=1,Ve+1<oe&&(ei=Math.max((oe-Ve)*xi+a.Aa,ei)),st>le+1&&(ei=Math.max((st-le)*xi+a.Aa,ei)),Et+ee+1<Ki&&(ei=Math.max((Ki-Et)*xi+a.Aa,ei)),Gr=ei.toString()+"px"),En&&a.hasVerticalScrollbar&&a.allowVerticalScroll&&(ei=1,ht+1<Qr&&(ei=Math.max((Qr-ht)*xi+a.ya,ei)),Xe>he+1&&(ei=Math.max((Xe-he)*xi+a.ya,ei)),Gt+re+1<ji&&(ei=Math.max((ji-Gt)*xi+a.ya,ei)),pt=ei.toString()+"px")),ei=Gr!=="1px",En=pt!=="1px",ei&&En||!ei&&!En||(En&&(le-=a.Db),ei&&(he-=a.Db),Ki<Et+ee||!a.hasHorizontalScrollbar||!a.allowHorizontalScroll||(ee=1,Ve+1<oe&&(ee=Math.max((oe-Ve)*xi+a.Aa,ee)),st>le+1&&(ee=Math.max((st-le)*xi+a.Aa,ee)),Et+1<Ki&&(ee=Math.max((Ki-Et)*xi+a.Aa,ee)),Gr=ee.toString()+"px"),ei=Gr!=="1px",ee=a.ya,ei!==a.Be&&(ee=ei?a.ya-a.Db:a.ya+a.Db),ji<Gt+re||!a.hasVerticalScrollbar||!a.allowVerticalScroll||(re=1,ht+1<Qr&&(re=Math.max((Qr-ht)*xi+ee,re)),Xe>he+1&&(re=Math.max((Xe-he)*xi+ee,re)),Gt+1<ji&&(re=Math.max((ji-Gt)*xi+ee,re)),pt=re.toString()+"px"),En=pt!=="1px"),a.qr&&ei===a.Be&&En===a.gf)return x===a.Aa&&E===a.ya||a.bd(),!1;if(ei!==a.Be&&(Gr==="1px"?a.ya=a.ya+a.Db:a.ya=Math.max(a.ya-a.Db,1),z=!0),a.Be=ei,Ne.style.width=Gr,En!==a.gf&&(pt==="1px"?a.Aa=a.Aa+a.Db:a.Aa=Math.max(a.Aa-a.Db,1),z=!0,a.tn&&(re=_e.alloc(),En?(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)),_e.free(re))),z&&Yu(a),a.gf=En,Ne.style.height=pt,a.gu=!0,z&&(a.pn=!0),y=Fe.scrollLeft,a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(Et+1<Ki?y=(a.position.x-Ve)*xi:Ve+1<oe?y=Fe.scrollWidth-Fe.clientWidth:st>le+1&&(y=a.position.x*xi)),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&&(Gt+1<ji?Fe.scrollTop=(a.position.y-ht)*xi:ht+1<Qr?Fe.scrollTop=Fe.scrollHeight-Fe.clientHeight:Xe>he+1&&(Fe.scrollTop=a.position.y*xi)),oe=a.Aa,le=a.ya,Fe.style.width=oe+(a.gf?a.Db:0)+"px",Fe.style.height=le+(a.Be?a.Db:0)+"px",x!==oe||E!==le||a.animationManager.zb?(x=zt.allocAt(b,ge,xe,Pe),a.onViewportBoundsChanged(x,a.viewportBounds,xi,z),zt.free(x),!1):!0}Ce=Zt.prototype,Ce.add=function(a){var y=a.diagram;if(y!==this&&(y!==null&&it("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&&it('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(ta,"parts",y,null,a,null,x),y.isTemporary||this.Ya(),a.C(1),x=a.layerChanged,x!==null&&x(a,null,y)}},Ce.oi=function(a){this.partManager.oi(a);var y=this;Nf(a,function(x){Xd(y,x)}),(a instanceof $o||a instanceof qr&&a.placeholder!==null)&&a.v(),a.data!==null&&Nf(a,function(x){vy(y.partManager,x)}),gt(a)!==!0&&jc(a)!==!0||this.De.add(a),R1(a,!0,this),z1(a)?(a.actualBounds.w()&&this.N(_f(a,a.actualBounds)),this.Ya()):a.isVisible()&&a.actualBounds.w()&&this.N(_f(a,a.actualBounds)),this.$b()},Ce.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(_f(a,a.actualBounds)),this.Ya()):a.isVisible()&&a.actualBounds.w()&&this.N(_f(a,a.actualBounds)),this.$b()},Ce.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(Sa,"parts",E,y,null,x,null),a=y.layerChanged,a!==null&&a(y,E,null))}Ce.Is=function(a,y){if(y===void 0&&(y=!1),qt(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 Zn,x.addAll(a),a=x.iterator;a.next();)x=a.value,y&&!x.canDelete()||this.remove(x)},Ce.Kj=function(a,y,x){return x===void 0&&(x=!1),this.partManager.Kj(a,y,x)},Zt.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 Ut;if(a!==null)if(qt(a))for(var z=0;z<a.length;z++)uh(this,b,a[z],x,E);else for(a=a.iterator;a.next();)uh(this,b,a.value,x,E);else{for(a=this.parts;a.next();)uh(this,b,a.value,x,E);for(a=this.nodes;a.next();)uh(this,b,a.value,x,E);for(a=this.links;a.next();)uh(this,b,a.value,x,E)}yd(this,b,y,E,x)}};function uh(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 Fi){if(y.add(x,a.Pd(b,x,x.location)),x instanceof qr&&(x.placeholder!==null||b.dragsMembers))for(z=x.memberParts;z.next();)uh(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)&&uh(a,y,ee,E,b)}}if(b.dragsTree)for(x=x.Ou();x.next();)uh(a,y,x.value,E,b)}else if(x instanceof ti)for(y.add(x,a.Pd(b,x)),x=x.labelNodes;x.next();)uh(a,y,x.value,E,b);else x instanceof $o||y.add(x,a.Pd(b,x,x.location))}function yd(a,y,x,E,b){if(y!==null&&y.count!==0){var z=_e.alloc(),ee=_e.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=Hi(),oe=Hi(),le=y.iterator,he=_e.alloc();le.next();){var ge=le.key,xe=le.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 _e),xe.shifted.assign(he.re(Pe)))}else le.key instanceof ti&&oe.push(le.sa)}for(_e.free(he),b=re.length,le=0;le<b;le++)ge=re[le],z.assign(ge.info.point),ge.Su.shifted===void 0&&(ge.Su.shifted=new _e),ge.node.location=z.add(ge.Su.shifted);for(b=_e.alloc(),le=_e.alloc(),ge=oe.length,xe=0;xe<ge;xe++){var Fe=oe[xe];if(Pe=Fe.key,Pe instanceof ti)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)),rc(Pe,ee.x-Ne.x,ee.y-Ne.y);else{Fe=_e.allocAt(0,0),(he=Pe.i(0))&&he.w()&&Fe.assign(he);var Xe=he=_e.alloc().assign(Fe).add(ee);E.isGridSnapEnabled&&(E.isGridSnapRealtime||a.lastInput.up)&&(Xe=_e.alloc(),bf(a,Pe,he,Xe,E)),he.assign(Pe.dragComputation(Pe,he,Xe)).re(Fe),y.add(Pe,a.Pd(E,Pe,he)),rc(Pe,he.x-Ne.x,he.y-Ne.y),_e.free(Fe),_e.free(he),Xe!==he&&_e.free(Xe)}else he!==null&&(b.assign(he.location),Xe=y.I(he),Xe!==null&&b.re(Xe.point)),Ne!==null&&(le.assign(Ne.location),Xe=y.I(Ne),Xe!==null&&le.re(Xe.point)),he!==null&&Ne!==null?b.Xa(le)?(he=Fe.value.point,Ne=z,Ne.assign(b),Ne.re(he),y.add(Pe,a.Pd(E,Pe,b)),rc(Pe,Ne.x,Ne.y)):(Pe.suspendsRouting=!1,Pe.bb()):(Fe=Fe.value.point,he=he!==null?b:Ne!==null?le:ee,y.add(Pe,a.Pd(E,Pe,he)),rc(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)),rc(Pe,ee.x-he.x,ee.y-he.y))}_e.free(z),_e.free(ee),_e.free(b),_e.free(le),Mi(re),Mi(oe),x||(Zs(a),Hh(a,y))}}Zt.prototype.computeMove=function(a,y,x,E){if(E===void 0&&(E=new _e),E.assign(y),a===null)return E;var b=y,z=x.isGridSnapEnabled;z&&(x.isGridSnapRealtime||this.lastInput.up)&&(b=_e.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,le=oe.x;return isNaN(le)&&(le=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,le)),Math.max(ee,Math.min(x.y,oe))),b!==y&&_e.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=_e.allocAt(0,0),z.yi(0,0,a,y,b),He.No(x.x,x.y,re+z.x,ee+z.y,a,y,E),_e.free(z)}}function Ff(a,y){if(y!==null)for(a.Mr=!0,a=y.iterator;a.next();)y=a.key,y instanceof ti&&(y.suspendsRouting=!0)}function Hh(a,y){if(y!==null){for(y=y.iterator;y.next();){var x=y.key;x instanceof ti&&(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}Ce=Zt.prototype,Ce.Pd=function(a,y,x){if(x===void 0)return new hh(pi);var E=a.isGridSnapEnabled;return a.groupsSnapMembers||y.containingGroup===null||(E=!1),E?new hh(new _e(Math.round(1e3*x.x)/1e3,Math.round(1e3*x.y)/1e3)):new hh(x.copy())};function rg(a,y,x){if(y.diagram!==null&&y.diagram!==a&&it("Cannot share a Layer with another Diagram: "+y+" of "+y.diagram),x===null?y.diagram!==null&&it("Cannot add an existing Layer to this Diagram again: "+y):(x.diagram!==a&&it("Existing Layer must be in this Diagram: "+x+" not in "+x.diagram),y===x&&it("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&&it("Cannot add Layer with the name '"+y+"'; a Layer with the same name is already present in this Diagram.")}}Ce.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(ta,"layers",this,null,a,null,x+1),this.N(),this.Ya(),this},Ce.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(Sa,"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(ta,"layers",this,null,a,null,z),this.N(),0>E&&this.Ya(),this},Ce.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(Sa,"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(ta,"layers",this,null,a,null,z+1),this.N(),0>E&&this.Ya(),this},Ce.kA=function(a){if(a.diagram!==this&&it("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(Sa,"layers",this,a,null,x,null),this.N(),this.Ya()}}},Ce.Qj=function(a){for(var y=this.layers;y.next();){var x=y.value;if(x.name===a)return x}return null},Ce.Yw=function(a){return this.pf===null&&(this.pf=new Tn),this.pf.add(a),this.model.Pe(a),this},Ce.mA=function(a){this.pf!==null&&(this.pf.remove(a),this.pf.count===0&&(this.pf=null)),this.model.ik(a)},Ce.Pe=function(a){return this.zg===null&&(this.zg=new Tn),this.zg.add(a),this},Ce.ik=function(a){this.zg!==null&&(this.zg.remove(a),this.zg.count===0&&(this.zg=null))},Ce.ds=function(a){if(this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.Tu(a),a.change!==ra&&(this.isModified=!0),this.zg!==null)for(var y=this.zg,x=y.length,E=0;E<x;E++)y.M(E)(a)},Ce.cb=function(a,y,x,E,b,z,ee){z===void 0&&(z=null),ee===void 0&&(ee=null);var re=new sr;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)},Ce.g=function(a,y,x,E,b){this.cb(Bo,a,this,y,x,E,b)},Zt.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===Bo){var b=a.object;if(Za(b,a.propertyName,a.I(y)),b instanceof bt){var z=b.part;z!==null&&z.Wb()}this.isModified=!0}else if(E===ta){var ee=a.object,re=a.newParam,oe=a.newValue;if(ee instanceof Xn)if(typeof re=="number"&&oe instanceof bt){y?ee.pc(re):ee.Gb(re,oe);var le=ee.part;le!==null&&le.Wb()}else typeof re=="number"&&oe instanceof Ss&&(oe.isRow?d1(ee,re,y?void 0:oe):c1(ee,re,y?void 0:oe));else if(ee instanceof bs){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 Zt?typeof re=="number"&&oe instanceof bs&&(y?this.Wa.mb(re):(oe.Xe(this),this.Wa.Gb(re,oe))):it("unknown ChangedEvent.Insert object: "+a.toString());this.isModified=!0}else if(E===Sa){var ge=a.object,xe=a.oldParam,Pe=a.oldValue;if(ge instanceof Xn)typeof xe=="number"&&Pe instanceof bt?y?ge.Gb(xe,Pe):ge.pc(xe):typeof xe=="number"&&Pe instanceof Ss&&(Pe.isRow?d1(ge,xe,y?Pe:void 0):c1(ge,xe,y?Pe:void 0));else if(ge instanceof bs){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 Zt?typeof xe=="number"&&Pe instanceof bs&&(y?(Pe.Xe(this),this.Wa.Gb(xe,Pe)):this.Wa.mb(xe)):it("unknown ChangedEvent.Remove object: "+a.toString());this.isModified=!0}else E!==ra&&it("unknown ChangedEvent: "+a.toString())}finally{this.skipsModelSourceBindings=x}}},Zt.prototype.Ea=function(a){return this.undoManager.Ea(a)},Zt.prototype.eb=function(a){return this.undoManager.eb(a)},Zt.prototype.Kf=function(){return this.undoManager.Kf()},Zt.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}},Zt.prototype.updateAllTargetBindings=function(a){this.partManager.updateAllTargetBindings(a)},Zt.prototype.rp=function(){this.partManager.rp()};function og(a,y,x){var E=a.animationManager;if(a.vb||a.ld)a.Ca=x,Yu(a),a.N(),a.Ee=!0,E.zb&&(ah(E)||E.ce.add(E.H,"scale",y,a.Ca));else if(a.ta===null)a.Ca=x,Yu(a);else{a.vb=!0;var b=a.viewportBounds.copy(),z=a.Aa,ee=a.ya,re=a.zoomPoint.x,oe=a.zoomPoint.y,le=a.contentAlignment;isNaN(re)&&(le.$c()?le.Hf(Zi)?re=0:le.Hf(yi)&&(re=z-1):re=le.sb()?le.x*(z-1):z/2),isNaN(oe)&&(le.$c()?le.Hf(kn)?oe=0:le.Hf(Ai)&&(oe=ee-1):oe=le.sb()?le.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=_e.allocAt(a.pa.x+re/y-re/x,a.pa.y+oe/y-oe/x),a.position=z,_e.free(z),a.Ca=x,Yu(a),a.vb=!1,a.onViewportBoundsChanged(b,a.viewportBounds,y,!1),lu(a,!1),E.zb&&(ah(E)||E.ce.add(E.H,"scale",y,a.Ca))}}Zt.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!==il||a.width===y.width&&a.height===y.height||b.C(),b=this.currentTool,this.Vk===!0&&b instanceof Eo&&(this.lastInput.documentPoint=this.Ps(this.lastInput.viewPoint),ts(b,this)),this.vb||this.invalidateViewport(a,y),Uu(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 Uu(a,y){var x=a.fe;if(x!==null&&x.visible){for(var E=bn.alloc(),b=1,z=1,ee=x.O.s,re=ee.length,oe=0;oe<re;oe++){var le=ee[oe],he=Math.abs(le.interval);2>he||(bv(le.figure)?z=z*he/He.vx(z,he):b=b*he/He.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=zt.alloc(),a=a.viewportBounds,y.h(a.x,a.y,a.width,a.height),!y.w()){zt.free(y);return}b=y.width,z=y.height,a=y.x,ee=y.y,zt.free(y)}x.width=b+2*E.width,x.height=z+2*E.height,y=_e.alloc(),He.No(a,ee,0,0,E.width,E.height,y),y.offset(-E.width,-E.height),bn.free(E),x.part.location=y,_e.free(y)}}Zt.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)}},Zt.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))},Zt.prototype.rA=function(a){if(this.R("ChangingSelection",this.selection),this.clearSelection(!0),qt(a))for(var y=a.length,x=0;x<y;x++){var E=a[x];E instanceof mr||it("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||it("Diagram.selectCollection given something that is not a Part: "+y),y.isSelected=!0;this.R("ChangedSelection",this.selection)},Zt.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()}},Ce=Zt.prototype,Ce.Iz=function(a){a!==null&&a.diagram===this&&(!a.isHighlighted||1<this.highlighteds.count)&&(this.clearHighlighteds(),a.isHighlighted=!0)},Ce.Jz=function(a){a=new Zn().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||it("Diagram.highlightCollection given something that is not a Part: "+y),y.isHighlighted=!0},Ce.scroll=function(a,y,x){x===void 0&&(x=1);var E=y==="up"||y==="down",b=0,z=_e.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)),_e.free(z);return}it("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):it("scrolling direction must be 'up', 'down', 'left', or 'right', not: "+y),_e.free(z)},Ce.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)},Ce.es=function(a){var y=this.viewportBounds;a=a.center,a.x-=y.width/2,a.y-=y.height/2,this.position=a},Ce.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)},Ce.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,le=y.m22,he=y.dx,ge=y.dy,xe=x*ee+E*oe+he;y=x*re+E*le+ge;var Pe=b*ee+E*oe+he;return a=b*re+E*le+ge,E=x*ee+z*oe+he,x=x*re+z*le+ge,ee=b*ee+z*oe+he,b=b*re+z*le+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 zt(z,Pe,xe-z,y-Pe)},Ce.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),Ei(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 va}Zt.prototype.doModelChanged=function(a){var y=this;if(a.model===this.model){var x=a.change,E=a.propertyName;if(x===ra&&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===ra){(E==="FinishedUndo"||E==="FinishedRedo")&&(this.R("ChangedSelection",this.selection),Zs(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(),Wg(this.animationManager)),!this.Rt&&ee&&this.lastInput.targetDiagram){this.Rt=!0;var re=this;_t(function(){re.currentTool.standardMouseOver(),re.Rt=!1},10)}}}finally{this.aa=!0}}}};function Xd(a,y){y=y.O.s;for(var x=y.length,E=0;E<x;E++)xd(a,y[E])}function xd(a,y){if(y instanceof Tl){var x=y.element;if(x!==null&&x instanceof HTMLImageElement){x.Bg instanceof Zn&&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 Zn&&x.Bg.remove(a),dp(E));break}}}}}Zt.prototype.Wd=function(){this.partManager.Wd()},Zt.prototype.Aj=function(a,y){this.Yd.Aj(a,y)},Zt.prototype.Cj=function(a,y){this.Yd.Cj(a,y)},Zt.prototype.findPartForKey=function(a){return this.partManager.findPartForKey(a)},Zt.prototype.Vb=function(a){return this.partManager.Vb(a)},Zt.prototype.findLinkForKey=function(a){return this.partManager.findLinkForKey(a)},Ce=Zt.prototype,Ce.Lc=function(a){return this.partManager.Lc(a)},Ce.ii=function(a){return this.partManager.ii(a)},Ce.Kc=function(a){return this.partManager.Kc(a)},Ce.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:ar(ci(y)))},Ce.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:ar(ci(y)))};function Yu(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),lu(a,!1),a.R("DocumentBoundsChanged",void 0,x),a.Ee=!0,a.N())}Ce.Va=function(){if(this.Zi){var a=zt.alloc();ug(this,this.computeBounds(a)),zt.free(a)}},Ce.rz=function(){for(var a=new Zn,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},Ce.qz=function(){return this.ai.iterator},Ce.Uz=function(a){Zs(this),a&&Sd(this,!0),this.ld?dg(this,!1):(this.Jk=!0,zl(this))};function Sd(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||oh(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),Zs(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),lh(a,y),b.isValidLayout=!0):a.xh=!0)}}Ce.yz=function(){for(var a=new Tn,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 Tn;x.add(b,ee),x.add(z,ee),E.add(b,b),E.add(z,b)}var x=new Ut,E=new Ut;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 Wh(a,y){var x=a.iw.I(y);if(x!==null||(x=a.iw.I(y.toLowerCase()),x!==null))return x;it("Unknown DiagramEvent name: "+y)}Ce.Bj=function(a,y){return a=Wh(this,a),a!==null&&a.add(y),this},Ce.am=function(a,y){a=Wh(this,a),a!==null&&a.remove(y)},Ce.R=function(a,y,x){var E=Wh(this,a),b=new Tr;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}Ce.Yj=function(a,y){return Nc(this,!1,null,y||null).Yj(a.x,a.y,a.width,a.height)},Zt.prototype.computeOccupiedArea=function(a){return this.isVirtualized?this.viewportBounds.copy():this.Zi?Sf(this,a):a.assign(this.documentBounds)};function Nc(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=zt.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)}zt.free(y)}else{for(0<x.memberParts.count&&(y=a.computePartsBounds(x.memberParts,!1),y.Bc(20,20),b.initialize(y)),y=zt.alloc(),z=x.memberParts;z.next();)ee=z.value,ee instanceof Fi&&Bf(a,ee,E,y);zt.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(ac,x,y+1);else for(var ee=x;ee<=y;ee++)z[ee]=ac}else if(y instanceof qr)for(y=y.memberParts;y.next();)b=y.value,b instanceof Fi&&Bf(a,b,x,E)}}function wd(a,y){a.Xh===null||a.Xh.vs||y!==void 0&&(!y.avoidable||y.isLinkLabel)||(a.Xh.vs=!0)}Zt.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=_t(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=zt.alloc(),a.computeBounds(y),y.ed(a.documentBounds),ug(a,y),zt.free(y),a.Fc=!0,a.bd(),fg(a))}},a.vp))}Zt.prototype.ug=function(){this.vk!==-1&&(yn.clearTimeout(this.vk),this.vk=-1)},Zt.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=zt.allocAt(0,0,E.width*b,E.height*b);var z=_e.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(pi)||(y=new _e(y.x+z.x/b,y.y+z.y/b)),zt.free(E),_e.free(z),y},Ce=Zt.prototype,Ce.Cs=function(){return null},Ce.av=function(){return null},Ce.bs=function(a,y){this.pj.add(a,y)},Ce.Fu=function(a){(this.Pw=a)||this.nodes.each(function(y){y instanceof qr&&(y.$p=null)})};function Pd(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-le>oe?y(x,b,re):yn.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,le=+new Date;return yn.requestAnimationFrame(function(){E()}),null}Ce.Wz=function(a){return Ua?(a===void 0&&(a={}),a.returnType="Image",this.Jx(a)):null},Ce.Jx=function(a){return a===void 0&&(a={}),Pd(this,this.Xz,a)},Ce.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 bd+"data":b=E.getImageData(0,0,x.width,x.height);break;case bd:E=(a.document||document).createElement("img"),E.src=x.toDataURL(a.type,a.details),b=E;break;case"blob":return typeof y!="function"&&it('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"&&it("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 bn(1/0,1/0):new bn(2e3,2e3));var re=y.position||null,oe=y.parts||null,le=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 le=="number"?le=new Vr(le):le instanceof Vr||it("MakeImage padding must be a Margin or a number."),le.left=Math.max(le.left,0),le.right=Math.max(le.right,0),le.top=Math.max(le.top,0),le.bottom=Math.max(le.bottom,0),a.ib.Vc(!0),ge=new Ys(null,xe,void 0,!0);var Ne=ge.context;if(!(b||z||oe||re))return ge.width=a.Aa+Math.ceil(le.left+le.right),ge.height=a.ya+Math.ceil(le.top+le.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,le,new bn(ge.width,ge.height),a.Ca,a.pa,oe,he,Fe,y),E.context):(a.Xm=!1,Ef(a,Ne,le,new bn(ge.width,ge.height),a.Ca,a.pa,oe,he,Fe,y),a.Xm=!0,ge.context);var Xe=a.Pp,Ve=a.documentBounds.copy();if(Ve.Fv(a.yb),Fe)for(var st=a.Wa.s,ht=st.length,pt=0;pt<ht;pt++){var Et=st[pt];if(Et.visible&&Et.isTemporary){Et=Et.Pa.s;for(var Gt=Et.length,xi=0;xi<Gt;xi++){var Ki=Et[xi];Ki.isInDocumentBounds&&Ki.isVisible()&&(Ki=Ki.actualBounds,Ki.w()&&Ve.ed(Ki))}}}if(st=new _e(Ve.x,Ve.y),oe!==null){for(ht=new zt(0,0,0,0),pt=!0,Et=oe.iterator,Et.reset();Et.next();)Gt=Et.value,Gt instanceof mr&&(xi=Gt.layer,xi!==null&&!xi.visible||xi!==null&&!Fe&&xi.isTemporary||!Gt.isVisible()||(Gt=Gt.actualBounds,Gt.w()&&(pt?(pt=!1,ht.assign(Gt)):ht.ed(Gt))));Ve.width=ht.width,Ve.height=ht.height,st.x=ht.x,st.y=ht.y}return re!==null&&re.w()&&(st=re,z||(z=Xe)),ht=re=0,le!==null&&(re=le.left+le.right,ht=le.top+le.bottom),pt=Et=0,b!==null&&(Et=b.width,pt=b.height,isFinite(Et)&&(Et=Math.max(0,Et-re)),isFinite(pt)&&(pt=Math.max(0,pt-ht))),b!==null&&z!==null?(z==="NaN"&&(z=Xe),b.w()?(b=Et,Ve=pt):isNaN(pt)?(b=Et,Ve=Ve.height*z):(b=Ve.width*z,Ve=pt)):b!==null?b.w()?(z=Math.min(Et/Ve.width,pt/Ve.height),b=Et,Ve=pt):isNaN(pt)?(z=Et/Ve.width,b=Et,Ve=Ve.height*z):(z=pt/Ve.height,b=Ve.width*z,Ve=pt):z!==null?z==="NaN"&&ee.w()?(z=Math.min((ee.width-re)/Ve.width,(ee.height-ht)/Ve.height),z>Xe?(z=Xe,b=Ve.width,Ve=Ve.height):(b=ee.width,Ve=ee.height)):(b=Ve.width*z,Ve=Ve.height*z):(z=Xe,b=Ve.width,Ve=Ve.height),le!==null?(b+=re,Ve+=ht):le=new Vr(0),ee!==null&&(Xe=ee.width,ee=ee.height,isNaN(Xe)&&(Xe=2e3),isNaN(ee)&&(ee=2e3),isFinite(Xe)&&(b=Math.min(b,Xe)),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,le,new bn(Math.ceil(b),Math.ceil(Ve)),z,st,oe,he,Fe,y),E.context):(a.Xm=!1,Ef(a,Ne,le,new bn(Math.ceil(b),Math.ceil(Ve)),z,st,oe,he,Fe,y),a.Xm=!0,ge.context)}kt.Object.defineProperties(Zt.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 Ro(this,yn.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 Ro(this,yn.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(yn,"resize",this.Ov,!1),this.removeEventListener(yn,"wheel",this.$j,!0),Ku===this&&(Ku=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)&&Dn(a,"0 <= value <= 1",Zt,"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),lu(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),lu(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),lu(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),lu(this,!1))}},scrollHorizontalLineChange:{get:function(){return this.iu},set:function(a){var y=this.iu;y!==a&&(0>a&&Dn(a,">= 0",Zt,"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&&Dn(a,">= 0",Zt,"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 Dn(a,">= 0",Zt,"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&&it("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,oh(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(yn,"pointermove",this.dk,!0),this.addEventListener(yn,"pointerdown",this.ui,!0),this.addEventListener(yn,"pointerup",this.fk,!0),this.addEventListener(yn,"pointerout",this.ek,!0),this.addEventListener(yn,"pointercancel",this.ck,!0),this.removeEventListener(y,"wheel",this.$j,!1),this.addEventListener(yn,"wheel",this.$j,!0),this.addEventListener(yn,"selectstart",this.preventDefault,!1)):(this.removeEventListener(yn,"pointermove",this.dk,!0),this.removeEventListener(yn,"pointerdown",this.ui,!0),this.removeEventListener(yn,"pointerup",this.fk,!0),this.removeEventListener(yn,"pointerout",this.ek,!0),this.removeEventListener(yn,"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(yn,"wheel",this.$j,!0),this.removeEventListener(yn,"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=_e.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()?Yu(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)}_e.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!==Xn.Grid&&it("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),Uu(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),Yu(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||it("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 Vr(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===Kh&&lu(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,lu(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!==il&&lu(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()||it("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()||it("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)):Dn(a,"> 0",Zt,"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)):Dn(a,"> 0",Zt,"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),lu(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 Vr(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&&it("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!==rs&&a!==Cd&&it("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 bn(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 Vr(a));var y=this.xp;y.D(a)||(this.xp=a=a.J(),this.Ya(),this.g("autoScrollRegion",y,a))}}}),kt.Object.defineProperties(Zt,{licenseKey:{get:function(){return xg.jc()},set:function(a){xg.add(a.replace(/\s/g,""))}},version:{get:function(){return Uh}}}),Zt.prototype.makeImageData=Zt.prototype.Jx,Zt.prototype.makeImage=Zt.prototype.Wz,Zt.prototype.cacheGroupExternalLinks=Zt.prototype.Fu,Zt.prototype.addRenderer=Zt.prototype.bs,Zt.prototype.makeSVG=Zt.prototype.av,Zt.prototype.makeSvg=Zt.prototype.Cs,Zt.prototype.stopAutoScroll=Zt.prototype.ug,Zt.prototype.doAutoScroll=Zt.prototype.gs,Zt.prototype.isUnoccupied=Zt.prototype.Yj,Zt.prototype.raiseDiagramEvent=Zt.prototype.R,Zt.prototype.removeDiagramListener=Zt.prototype.am,Zt.prototype.addDiagramListener=Zt.prototype.Bj,Zt.prototype.findTreeRoots=Zt.prototype.yz,Zt.prototype.layoutDiagram=Zt.prototype.Uz,Zt.prototype.findTopLevelGroups=Zt.prototype.qz,Zt.prototype.findTopLevelNodesAndLinks=Zt.prototype.rz,Zt.prototype.ensureBounds=Zt.prototype.Va,Zt.prototype.findLinksByExample=Zt.prototype.ls,Zt.prototype.findNodesByExample=Zt.prototype.ms,Zt.prototype.findLinkForData=Zt.prototype.Kc,Zt.prototype.findNodeForData=Zt.prototype.ii,Zt.prototype.findPartForData=Zt.prototype.Lc,Zt.prototype.findLinkForKey=Zt.prototype.findLinkForKey,Zt.prototype.findNodeForKey=Zt.prototype.Vb,Zt.prototype.findPartForKey=Zt.prototype.findPartForKey,Zt.prototype.rebuildParts=Zt.prototype.Wd,Zt.prototype.transformViewToDoc=Zt.prototype.Ps,Zt.prototype.transformRectDocToView=Zt.prototype.zA,Zt.prototype.transformDocToView=Zt.prototype.op,Zt.prototype.centerRect=Zt.prototype.es,Zt.prototype.scrollToRect=Zt.prototype.tv,Zt.prototype.scroll=Zt.prototype.scroll,Zt.prototype.highlightCollection=Zt.prototype.Jz,Zt.prototype.highlight=Zt.prototype.Iz,Zt.prototype.selectCollection=Zt.prototype.rA,Zt.prototype.select=Zt.prototype.select,Zt.prototype.updateAllRelationshipsFromData=Zt.prototype.rp,Zt.prototype.updateAllTargetBindings=Zt.prototype.updateAllTargetBindings,Zt.prototype.commit=Zt.prototype.commit,Zt.prototype.rollbackTransaction=Zt.prototype.Kf,Zt.prototype.commitTransaction=Zt.prototype.eb,Zt.prototype.startTransaction=Zt.prototype.Ea,Zt.prototype.raiseChanged=Zt.prototype.g,Zt.prototype.raiseChangedEvent=Zt.prototype.cb,Zt.prototype.removeChangedListener=Zt.prototype.ik,Zt.prototype.addChangedListener=Zt.prototype.Pe,Zt.prototype.removeModelChangedListener=Zt.prototype.mA,Zt.prototype.addModelChangedListener=Zt.prototype.Yw,Zt.prototype.findLayer=Zt.prototype.Qj,Zt.prototype.removeLayer=Zt.prototype.kA,Zt.prototype.addLayerAfter=Zt.prototype.Cy,Zt.prototype.addLayerBefore=Zt.prototype.Ww,Zt.prototype.addLayer=Zt.prototype.Al,Zt.prototype.moveParts=Zt.prototype.moveParts,Zt.prototype.copyParts=Zt.prototype.Kj,Zt.prototype.removeParts=Zt.prototype.Is,Zt.prototype.remove=Zt.prototype.remove,Zt.prototype.add=Zt.prototype.add,Zt.prototype.clearDelayedGeometries=Zt.prototype.bx,Zt.prototype.setProperties=Zt.prototype.nm,Zt.prototype.attach=Zt.prototype.Du,Zt.prototype.set=Zt.prototype.set,Zt.prototype.resetInputOptions=Zt.prototype.Sx,Zt.prototype.setInputOption=Zt.prototype.sA,Zt.prototype.getInputOption=Zt.prototype.Ql,Zt.prototype.resetRenderingHints=Zt.prototype.Tx,Zt.prototype.setRenderingHint=Zt.prototype.Xx,Zt.prototype.getRenderingHint=Zt.prototype.Gf,Zt.prototype.maybeUpdate=Zt.prototype.bd,Zt.prototype.requestUpdate=Zt.prototype.$b,Zt.prototype.delayInitialization=Zt.prototype.Xy,Zt.prototype.isUpdateRequested=Zt.prototype.Pz,Zt.prototype.invalidateDocumentBounds=Zt.prototype.Ya,Zt.prototype.findObjectsNear=Zt.prototype.og,Zt.prototype.findPartsNear=Zt.prototype.mz,Zt.prototype.findObjectsIn=Zt.prototype.Cf,Zt.prototype.findPartsIn=Zt.prototype.ux,Zt.prototype.findObjectsAt=Zt.prototype.ji,Zt.prototype.findPartsAt=Zt.prototype.lz,Zt.prototype.findObjectAt=Zt.prototype.ic,Zt.prototype.findPartAt=Zt.prototype.Ol,Zt.prototype.focusObject=Zt.prototype.zz,Zt.prototype.alignDocument=Zt.prototype.Jy,Zt.prototype.zoomToRect=Zt.prototype.BA,Zt.prototype.zoomToFit=Zt.prototype.zoomToFit,Zt.prototype.diagramScroll=Zt.prototype.kx,Zt.prototype.focus=Zt.prototype.focus;var Mf=new Ut,ep=null,Ua=yn.document!==void 0,Jd=null,Vh="",il=new en(Zt,"None",0),Al=new en(Zt,"Uniform",1),Qd=new en(Zt,"UniformToFill",2),Ed=new en(Zt,"CycleAll",10),gg=new en(Zt,"CycleNotDirected",11),pg=new en(Zt,"CycleNotDirectedFast",12),mg=new en(Zt,"CycleNotUndirected",13),vg=new en(Zt,"CycleDestinationTree",14),yg=new en(Zt,"CycleSourceTree",15),Kh=new en(Zt,"DocumentScroll",1),Dc=new en(Zt,"InfiniteScroll",2),Bh=new en(Zt,"TreeParentCollapsed",21),rs=new en(Zt,"AllParentsCollapsed",22),Cd=new en(Zt,"AnyParentsCollapsed",23),xg=new Tn,Uh="2.3.10",bd="image",Tc=null,tp=!1;function Js(){if(Ua){var a=yn.document.createElement("canvas"),y=a.getContext("2d"),x=wn("7ca11abfd022028846");y[x]=wn("398c3597c01238");for(var E=["5da73c80a36455d7038e4972187c3cae51fd22",Kn.Dx+"4ae6247590da4bb21c324ba3a84e385776",Pt.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",He.za],b=1;5>b;b++)y[wn("7ca11abfd7330390")](wn(E[b-1]),10,15*b);for(y[x]=wn("39f046ebb36e4b"),x=1;5>x;x++)y[wn("7ca11abfd7330390")](wn(E[x-1]),10,15*x);(E.length!==4||E[0][0]!=="5"||E[3][0]!=="7")&&(Pt.prototype.Cd=Pt.prototype.Eu),Tc=a}}Zt.className="Diagram",Zt.fromDiv=function(a){var y=a;return typeof a=="string"&&(y=yn.document.getElementById(a)),y instanceof HTMLDivElement&&y.H instanceof Zt?y.H:null},Zt.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},Zt.useDOM=function(a){Ua=a?yn.document!==void 0:!1},Zt.isUsingDOM=function(){return Ua},Zt.None=il,Zt.Uniform=Al,Zt.UniformToFill=Qd,Zt.CycleAll=Ed,Zt.CycleNotDirected=gg,Zt.CycleNotDirectedFast=pg,Zt.CycleNotUndirected=mg,Zt.CycleDestinationTree=vg,Zt.CycleSourceTree=yg,Zt.DocumentScroll=Kh,Zt.InfiniteScroll=Dc,Zt.TreeParentCollapsed=Bh,Zt.AllParentsCollapsed=rs,Zt.AnyParentsCollapsed=Cd;function np(){this.wy=null,this.j="zz@orderNum",this._tk==="63ad05bbe23a1786468a4c741b6d2"?this.Rc=this.j=!0:this.Rc=null}function Yh(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=yn[wn("76a715b2f73f148a")][wn("72ba13b5")]||"";if(a.Rc=!0,Ua){var E=Zt[wn("76a115b6ed251eaf4692")];if(E)for(var b=xg.iterator;b.next()&&(E=b.value,E=wn(E).split(wn("39e9")),!(6>E.length));){var z=wn(E[1]).split(".");if(E[4]!=="7da71ca0")break;var ee=wn(Kn[wn("6cae19")]).split(".");if(z[0]>ee[0]||z[0]===ee[0]&&z[1]>=ee[1]){var re=yn[wn("74a900bae4370f8b51")][wn("6fbb13a1c2311e8a57")].toLowerCase();if(ee=re[wn("73a612b6fb191d")](wn("3aad1ab6e022098b4dc4")),z=wn(E[2]),-1<ee&&(re=re[wn("73a612b6fb191d")](z.toLowerCase()+"/"),a.Rc=!(-1<re&&re<ee),!a.Rc))break;for(ee=x[wn("76ad18b4f73e")],re=x[wn("73a612b6fb191d")](wn("35e7"))+2;re<ee;re++)y+=x[re];if(ee=y[wn("73a612b6fb191d")](z),0>ee&&z!==wn("7da71ca0ad381e90")&&(ee=y[wn("73a612b6fb191d")](wn("76a715b2ef3e149757"))),0>ee&&(ee=y[wn("73a612b6fb191d")](wn("76a715b2ef3e149757"))),0>ee&&(ee=y[wn("73a612b6fb191d")](wn("2bfa41fdb3784bca12"))),0>ee&&(ee=x[wn("73a612b6fb191d")](wn("7baa19a6f76c1988428554"))),a.Rc=!(0<=ee&&ee<y[wn("73a612b6fb191d")](wn("35"))||y[wn("73a612b6fb191d")](wn("35"))===-1),!a.Rc||x[wn("73a612b6fb191d")](wn("7fb002b6ed25128b4da25b2e"))&&(a.Rc=!(-1<x[wn("73a612b6fb191d")](z)),!a.Rc)||(ee=yn[wn("76a715b2f73f148a")][wn("69ad17a1e03e")],re=ee[wn("73a612b6fb191d")](wn("7fb002b6ed25128b4da25b2e")),-1<re&&(a.Rc=!(ee[wn("73a612b6fb191d")](z)>re),!a.Rc)))break;if(z[0]==="#"){ee=yn.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[wn("79a417a0f0181a8946")]=E,yn.document[wn("78a712aa")]){yn.document[wn("78a712aa")][wn("7bb806b6ed32388c4a875b")](ee),oe=yn.getComputedStyle(ee).getPropertyValue(wn("78a704b7e62456904c9b12701b6532a8"));var le=yn.getComputedStyle(ee).getPropertyValue(wn("75b817b0ea2202"));if(yn.document[wn("78a712aa")][wn("68ad1bbcf533388c4a875b")](ee),oe){if(ee=yn[wn("77a902b0eb1b1e804a8a")],le==="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(wn("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[wn("76ad18b4f73e")],b=x[wn("73a612b6fb191d")](wn("35e7"))+2;b<he;b++)y+=x[b];x=y[wn("73a612b6fb191d")](wn("7da71ca0ad381e90")),a.Rc=!(0<=x&&x<y[wn("73a612b6fb191d")](wn("35")))}}}return 0<a.Rc&&a!==a.wy}np.className="DiagramHelper";function hh(a){this.j=a===void 0?new _e:a,this.o=new _e}kt.Object.defineProperties(hh.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 Fd="DraggingInfo";hh.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 bn(NaN,NaN).freeze(),this.gridSnapCellSpot=Xo,this.gridSnapOrigin=new _e(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"||yn.Element&&a instanceof Element)var x=Zt.call(this,a)||this;else x=Zt.call(this)||this,y=a;return ce(x),y&&x.nm(y),x}Tt(fe,Zt);function ce(a){a.allowDragOut=!0,a.allowMove=!1,a.isReadOnly=!0,a.contentAlignment=Ia,a.layout=new Hs}fe.prototype.reset=function(){Zt.prototype.reset.call(this),ce(this)},fe.className="Palette";function me(a,y){if(typeof a=="string"||yn.Element&&a instanceof Element)var x=Zt.call(this,a)||this;else x=Zt.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 ao;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 Vr(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 _e(re.x-ee.width/2,re.y-ee.height/2)}},x.Pf=function(){E.Ya(),Ze(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&&Ze(E)},x.autoScale=Al,x.vb=!1,y&&Object.assign(x,y),x}Tt(me,Zt),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(Ud(this),this.ql===null){var x=new Ys(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}}}Zt.prototype.redraw.call(this)},me.prototype.gc=function(){if(this.Ka===null&&it("No div specified"),this.ta===null&&it("No canvas specified"),!(this.ta instanceof Ro)&&(Vv(this.box),this.Fc)){var a=this.observed;if(a!==null&&!a.animationManager.defaultAnimation.isAnimating&&a.pi){Ud(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=zt.alloc().assign(a.viewportBounds).ed(y.viewportBounds),Uu(y,b),zt.free(b),Zs(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 le=re.diagram.grid.part;if(!x&&re.isTemporary)E&&le.layer===re&&(re=Vu(re,b),le.gc(b,oe),b.globalAlpha=re);else{for(var he=Vu(re,b),ge=oe.scale,xe=zt.alloc(),Pe=re.Pa.s,Fe=Pe.length,Ne=0;Ne<Fe;Ne++){var Xe=Pe[Ne];(E||Xe!==le)&&re.Oj(b,Xe,oe,null,ge,xe,!1)}zt.free(xe),b.globalAlpha=he}}}}}function Ze(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=bn.alloc();b.h(x.width,x.height),E.desiredSize=b,bn.free(b),a=2/a.scale,E instanceof ao&&(E.strokeWidth=a),y.location=new _e(x.x-a/2,x.y-a/2),y.isSelected=!0}}}me.prototype.computeBounds=function(){var a=this.observed;if(a===null)return Qa;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(),Ze(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))},kt.Object.defineProperties(me.prototype,{observed:{get:function(){return this.V},set:function(a){var y=this.V;if(a instanceof me&&it("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),Ze(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),Ze(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(){ka.call(this),this.j=null}Tt(Qe,ka),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 _e(x.width/2,x.height/2),a=a.firstInput.documentPoint,y.position=new _e(a.x-this.j.x,a.y-this.j.y)),!0)},Qe.prototype.doActivate=function(){this.j=null,ka.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 _e(E.x-x.x,E.y-x.y)}a=a.lastInput.documentPoint,y.position=new _e(a.x-this.j.x,a.y-this.j.y)}}},Qe.className="OverviewDraggingTool";function Ue(){wr(this),this.H=Ku,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=Qa,this.hb=!0,this.cg=null,this.ob=200}Ue.prototype.toString=function(){return"CommandHandler"},Ue.prototype.Xe=function(a){this.H=a},Ue.prototype.doKeyDown=function(){var a=this.diagram,y=a.lastInput,x=zr?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()},Ue.prototype.doKeyUp=function(){this.diagram.lastInput.bubbles=!0},Ue.prototype.stopCommand=function(){var a=this.diagram,y=a.currentTool;y instanceof Eo&&a.allowSelect&&a.clearSelection(),y!==null&&y.doCancel()},Ue.prototype.canStopCommand=function(){return!0},Ue.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=""}},Ue.prototype.canSelectAll=function(){return this.diagram.allowSelect},Ue.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 Zn,x=a.selection.iterator;x.next();)Zc(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=""}},Ue.prototype.canDeleteSelection=function(){var a=this.diagram;return!(a.isReadOnly||a.isModelReadOnly||!a.allowDelete||a.selection.count===0)},Ue.prototype.copySelection=function(){var a=this.diagram,y=new Zn;for(a=a.selection.iterator;a.next();)Zc(y,a.value,!0,this.copiesTree?1/0:0,this.copiesConnectedLinks,function(x){return x.canCopy()});this.copyToClipboard(y)},Ue.prototype.canCopySelection=function(){var a=this.diagram;return!!(a.allowCopy&&a.allowClipboard&&a.selection.count!==0)},Ue.prototype.cutSelection=function(){this.copySelection(),this.deleteSelection()},Ue.prototype.canCutSelection=function(){var a=this.diagram;return!!(!a.isReadOnly&&!a.isModelReadOnly&&a.allowCopy&&a.allowDelete&&a.allowClipboard&&a.selection.count!==0)},Ue.prototype.copyToClipboard=function(a){var y=this.diagram,x=null;if(a===null)Jd=null,Vh="";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 Tn,x.addAll(z),Jd=x,Vh=y.model.dataFormat}}y.R("ClipboardChanged",x)},Ue.prototype.pasteFromClipboard=function(){var a=new Zn,y=Jd;if(y===null)return a;var x=this.diagram;if(Vh!==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},Ue.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);yd(y,z,new _e(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=""}},Ue.prototype.canPasteSelection=function(){var a=this.diagram;return!(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowClipboard||Jd===null||Jd.count===0||Vh!==a.model.dataFormat)},Ue.prototype.undo=function(){this.diagram.undoManager.undo()},Ue.prototype.canUndo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canUndo()},Ue.prototype.redo=function(){this.diagram.undoManager.redo()},Ue.prototype.canRedo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canRedo()},Ue.prototype.decreaseZoom=function(a){a===void 0&&(a=1/this.zoomFactor);var y=this.diagram;y.autoScale===il&&(a=y.scale*a,a<y.minScale||a>y.maxScale||(y.scale=a))},Ue.prototype.canDecreaseZoom=function(a){a===void 0&&(a=1/this.zoomFactor);var y=this.diagram;return y.autoScale!==il?!1:(a=y.scale*a,a<y.minScale||a>y.maxScale?!1:y.allowZoom)},Ue.prototype.increaseZoom=function(a){a===void 0&&(a=this.zoomFactor);var y=this.diagram;y.autoScale===il&&(a=y.scale*a,a<y.minScale||a>y.maxScale||(y.scale=a))},Ue.prototype.canIncreaseZoom=function(a){a===void 0&&(a=this.zoomFactor);var y=this.diagram;return y.autoScale!==il?!1:(a=y.scale*a,a<y.minScale||a>y.maxScale?!1:y.allowZoom)},Ue.prototype.resetZoom=function(a){a===void 0&&(a=this.defaultScale);var y=this.diagram;a<y.minScale||a>y.maxScale||(y.scale=a)},Ue.prototype.canResetZoom=function(a){a===void 0&&(a=this.defaultScale);var y=this.diagram;return a<y.minScale||a>y.maxScale?!1:y.allowZoom},Ue.prototype.zoomToFit=function(){var a=this.diagram,y=a.animationManager;y.Cc(),a.redraw();var x=a.position,E=a.scale;oh(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=Qa):(this.Jt=E,this.sw=x.copy(),a.zoomToFit(),this.Au=a.scale,this.yu=a.documentBounds.copy()),df(y)},Ue.prototype.canZoomToFit=function(){return this.diagram.allowZoom},Ue.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;oh(x,"Scroll To Part");var E=this.scrollToPartPause;if(0<E){var b=vt(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 Fi&&oe.isTreeExpanded&&(!(oe instanceof qr)||oe.isSubGraphExpanded);)oe=b.pop();0<b.length?(oe instanceof mr&&y.tv(oe.actualBounds),oe instanceof Fi&&!oe.isTreeExpanded&&(oe.isTreeExpanded=!0),oe instanceof qr&&!oe.isSubGraphExpanded&&(oe.isSubGraphExpanded=!0)):(oe instanceof mr&&y.es(oe.actualBounds),y.am("LayoutCompleted",ee)),y.eb("Scroll To Part")},ee=function(){_t(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 vt(a,y,x){if(y.isVisible())return x;if(y instanceof $o)vt(a,y.adornedPart,x);else if(y instanceof ti){var E=y.fromNode;E!==null&&vt(a,E,x),y=y.toNode,y!==null&&vt(a,y,x)}else y instanceof Fi&&(E=y.labeledLink,E!==null&&vt(a,E,x),E=y.pg(),E!==null&&(E.isTreeExpanded||E.wasTreeExpanded||x.push(E),vt(a,E,x))),y=y.containingGroup,y!==null&&(y.isSubGraphExpanded||y.wasSubGraphExpanded||x.push(y),vt(a,y,x));return x}Ue.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)},Ue.prototype.collapseTree=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Collapse Tree"),oh(y.animationManager,"Collapse Tree");var x=new Tn;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 Fi&&b.isTreeExpanded&&(b.collapseTree(),x.add(b))}y.R("TreeCollapsed",x)}finally{y.eb("Collapse Tree")}},Ue.prototype.canCollapseTree=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null){if(!(a instanceof Fi&&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 Fi&&y.isTreeExpanded&&0<y.Qo().count)return!0;return!1},Ue.prototype.expandTree=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Expand Tree"),oh(y.animationManager,"Expand Tree");var x=new Tn;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 Fi&&!b.isTreeExpanded&&(b.expandTree(),x.add(b))}y.R("TreeExpanded",x)}finally{y.eb("Expand Tree")}},Ue.prototype.canExpandTree=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null){if(!(a instanceof Fi)||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 Fi&&!y.isTreeExpanded&&0<y.Qo().count)return!0;return!1},Ue.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 Tn,z=a.selection.iterator;z.next();){var ee=z.value;ee.Zc()&&ee.canGroup()&&b.add(ee)}for(var re=new Tn,oe=b.iterator;oe.next();){var le=oe.value;z=!1;for(var he=b.iterator;he.next();)if(le.Td(he.value)){z=!0;break}z||re.add(le)}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 qr)Ru(x),E=x.copy(),E!==null&&a.add(E);else if(y.Yu(x)){var Pe=y.copyNodeData(x);cn(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=""}}}},Ue.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 un(a){var y=Hi();for(a=a.iterator;a.next();){var x=a.value;x instanceof ti||y.push(x)}a=new Zn,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 Mi(y),a}Ue.prototype.isValidMember=function(a,y){if(y===null||a===y||y instanceof ti)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},Ue.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 Tn;if(a!==null)E.add(a);else for(var b=y.selection.iterator;b.next();){var z=b.value;z instanceof qr&&z.canUngroup()&&E.add(z)}var ee=new Tn;if(0<E.count){y.clearSelection(!0);for(var re=E.iterator;re.next();){var oe=re.value;oe.expandSubGraph();var le=oe.containingGroup,he=le!==null&&le.data!==null?x.wa(le.data):void 0;ee.addAll(oe.memberParts);for(var ge=ee.iterator;ge.next();){var xe=ge.value;if(xe.isSelected=!0,!(xe instanceof ti)){var Pe=xe.data;Pe!==null?x.mp(Pe,he):xe.containingGroup=le}}y.remove(oe)}}y.R("SelectionUngrouped",E,ee)}finally{y.eb("Ungroup"),y.R("ChangedSelection",y.selection),y.currentCursor=""}},Ue.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 qr))return!1;if(a.canUngroup())return!0}else for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof qr&&y.canUngroup())return!0;return!1},Ue.prototype.addTopLevelParts=function(a,y){var x=!0;for(a=un(a).iterator;a.next();){var E=a.value;E.containingGroup!==null&&(!y||this.isValidMember(null,E)?E.containingGroup=null:x=!1)}return x},Ue.prototype.collapseSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Collapse SubGraph"),oh(y.animationManager,"Collapse SubGraph");var x=new Tn;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 qr&&b.isSubGraphExpanded&&(b.collapseSubGraph(),x.add(b))}y.R("SubGraphCollapsed",x)}finally{y.eb("Collapse SubGraph")}},Ue.prototype.canCollapseSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null)return!!(a instanceof qr&&a.isSubGraphExpanded);for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof qr&&y.isSubGraphExpanded)return!0;return!1},Ue.prototype.expandSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Expand SubGraph"),oh(y.animationManager,"Expand SubGraph");var x=new Tn;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 qr&&!b.isSubGraphExpanded&&(b.expandSubGraph(),x.add(b))}y.R("SubGraphExpanded",x)}finally{y.eb("Expand SubGraph")}},Ue.prototype.canExpandSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null)return a instanceof qr&&!a.isSubGraphExpanded;for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof qr&&!y.isSubGraphExpanded)return!0;return!1},Ue.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 Da&&z.editable})}a!==null&&(y.currentTool=null,x.textBlock=a,y.currentTool=x)}},Ue.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 Da))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 Da&&x.editable}),a!==null))return!0;return!1},Ue.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 bt?b=a.ga(yo):y.viewportBounds.ca(E.documentPoint)||(b=y.viewportBounds,b=new _e(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)}},Ue.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)},Ue.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 Ut,a===null)return E;for(var z=a.iterator;z.next();)uh(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 ti&&(y=a.fromNode,y===null||E.contains(y)?(y=a.toNode,y===null||E.contains(y)||E.remove(a)):E.remove(a));return E},kt.Object.defineProperties(Ue.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||it("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}}}),Ue.className="CommandHandler",zp=function(){return new Ue};function bt(){wr(this),this.l=30723,this.pb=1,this.bn="",this.Ma=this.Me=null,this.pa=new _e(NaN,NaN).freeze(),this.jd=Io,this.Ab=new Pt,this.wh=new Pt,this.Lb=null,this.Ca=this.Kk=1,this.Kb=0,this.Kg=is,this.uc=new zt(NaN,NaN,NaN,NaN).freeze(),this.Ib=new zt(NaN,NaN,NaN,NaN).freeze(),this.dc=new zt(0,0,NaN,NaN).freeze(),this.ba=this.Yn=this.Zn=null,this.sk=this.Jb=er,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 Gn,Bn,Ji,or,Br,Jr,Ao,ho,jo,ma;bt.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=an(this.Dh)),this.tb!==null&&(a.tb=this.tb.copy())},bt.prototype.Vw=function(a){var y=this.Dh;if(qt(y)){for(var x=0;x<y.length;x++)if(y[x]===a)return}else this.Dh=y=[];y.push(a)},bt.prototype.Af=function(a){a.Zn=null,a.Ng=null,a.v()},bt.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},bt.prototype.copy=function(){return this.clone()},Ce=bt.prototype,Ce.qb=function(a){a.classType===ti?a.name.indexOf("Orient")===0?this.segmentOrientation=a:it("Unknown Link enum value for GraphObject.segmentOrientation property: "+a):a.classType===bt&&(this.stretch=a)},Ce.toString=function(){return Ri(this.constructor)+"#"+hr(this)},Ce.th=function(){this.A!==null&&(this.A.nc=!0)};function co(a){a.A===null?a.A=new Zr:a.A.nc&&(a.A=a.A.copy())}Ce.Xc=function(){if(this.ba===null){var a=new io;a.Xi=to,a.yj=to,a.Vi=10,a.wj=10,a.Wi=0,a.xj=0,this.ba=a}},Ce.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===Bo&&ve(this)&&_a(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 Ut),ee=z.undoManager.transactionLevel===0,a.startCondition===Zh?ee=!0:a.startCondition===Hd&&(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()):(oh(z.animationManager,"Trigger"),z.animationManager.defaultAnimation.add(this,y,E,b)))),this instanceof Xn&&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 Xn&&Nf(re,function(oe){oe.data!==null&&oe.l&16777216&&oe.La(y)})};function _a(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))}}Ce.ks=function(a){return this.bindingId===a?this:null},Ce.g=function(a,y,x){this.cb(Bo,a,this,y,x)},Ce.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 Pt);var z=this.Lb;z.reset(),this.no(z,a,y,x,E),z.pp(b)}};function xs(a,y,x,E){return a.pickable===!1?!1:(E.multiply(a.transform),x?a.Yc(y,E):a.fh(y,E))}Ce.tx=function(a,y,x){if(this.pickable===!1)return!1;var E=this.naturalBounds;return y=a.Bf(y),x?bi(a.x,a.y,0,0,0,E.height)<=y||bi(a.x,a.y,0,E.height,E.width,E.height)<=y||bi(a.x,a.y,E.width,E.height,E.width,0)<=y||bi(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},Ce.se=function(){return!0},Ce.ca=function(a){var y=_e.alloc();y.assign(a),this.transform.Ga(y);var x=this.actualBounds;if(!x.w())return _e.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),_e.free(y),a}return b=!1,(this instanceof $o||this instanceof ao?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)),_e.free(y),b},Ce.gh=function(a){var y=this.naturalBounds;return Fo(0,0,y.width,y.height,a.x,a.y)},Ce.Re=function(a){if(this.angle===0)return this.actualBounds.Re(a);var y=this.naturalBounds;y=zt.allocAt(0,0,y.width,y.height);var x=this.transform,E=!1,b=_e.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)))),_e.free(b),zt.free(y),E},Ce.fh=function(a,y){if(y===void 0)return a.Re(this.actualBounds);var x=this.naturalBounds,E=!1,b=_e.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)))),_e.free(b),E},Ce.Yc=function(a,y){if(y===void 0&&(y=this.transform,this.angle===0))return a.Yc(this.actualBounds);var x=this.naturalBounds,E=_e.allocAt(0,0),b=_e.allocAt(0,x.height),z=_e.allocAt(x.width,x.height),ee=_e.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=zt.allocAt(0,0,x.width,x.height);var oe=_e.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)))),_e.free(oe),zt.free(x),!re&&(He.us(a,E,b)||He.us(a,b,z)||He.us(a,z,ee)||He.us(a,ee,E))&&(re=!0)}return _e.free(E),_e.free(b),_e.free(z),_e.free(ee),re},Ce.ga=function(a,y){if(y===void 0&&(y=new _e),a instanceof ni){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},Ce.mi=function(a){a===void 0&&(a=new zt);var y=this.naturalBounds,x=this.oe,E=_e.allocAt(0,0).transform(x);return a.h(E.x,E.y,0,0),E.h(y.width,0).transform(x),Uo(a,E.x,E.y,0,0),E.h(y.width,y.height).transform(x),Uo(a,E.x,E.y,0,0),E.h(0,y.height).transform(x),Uo(a,E.x,E.y,0,0),_e.free(E),a},Ce.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},Ce.Df=function(){if(!(this.l&4096))return this.Kk;var a=this.Ca;return this.panel!==null?a*this.panel.Df():a},Ce.qs=function(a,y){return y===void 0&&(y=new _e),y.assign(a),this.oe.Cd(y),y},Ce.rs=function(a,y,x){return this.Sj(a.x,a.y,y.x,y.y,x)},Ce.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,le=-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,He.Ff(z.left,z.top,z.right,z.bottom,a,y,x,E,b)):(ee=a*re+y*le+ge,a=a*oe+y*he+xe,y=x*re+E*le+ge,x=x*oe+E*he+xe,b.h(0,0),E=this.naturalBounds,x=He.Ff(0,0,E.width,E.height,ee,a,y,x,b),b.transform(z),x)},bt.prototype.measure=function(a,y,x,E){if(qe(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 Xn;switch(cl(this,!0)){case Bn:ee=b=0,re&&(y=a=1/0);break;case Gn:isFinite(a)&&a>x&&(b=a),isFinite(y)&&y>E&&(ee=y);break;case or: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()||it("Non-real measuredBounds has been set. Object "+this+", measuredBounds: "+this.uc.toString()),$e(this,!1)}},bt.prototype.Wl=function(){},bt.prototype.Dd=function(){return!1},bt.prototype.arrange=function(a,y,x,E,b){this.Uk();var z=zt.alloc();z.assign(this.Ib),this.Ib.ka(),gt(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&&ec(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 Da&&(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()||it("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Ib.toString()),this.Xl(z,this.Ib),xt(this,!1),zt.free(z)},Ce=bt.prototype,Ce.eh=function(){};function rl(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=cl(a,!0),x===E&&z===b&&(y=Bn),y){case Bn:(x>E||z>b)&&($e(a,!0),a.measure(x>E?E:x,z>b?b:z,0,0));break;case Gn:$e(a,!0),a.measure(E,b,0,0);break;case or:$e(a,!0),a.measure(E,z,0,0);break;case Br:$e(a,!0),a.measure(x,b,0,0)}}}Ce.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(),Zo(a,y)||(x.oh(),this.Pn(x)))},Ce.Pn=function(a){this.portId!==null&&(Yv(a,!0),a instanceof Fi&&W1(a,this))},Ce.gc=function(a,y){if(!Gl(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 Xn&&ec(this),ee=this.Ib;if(z){var re=this.Ib,oe=this.dc,le=this.areaBackground,he=this.Ma;le===null&&he===null||a.yc(),le!==null&&(Ya(this,a,le,!0,!0,oe,re),le instanceof Jo&&le.type===Cu?(a.beginPath(),a.rect(re.x,re.y,re.width,re.height),a.ng(le)):a.fillRect(re.x,re.y,re.width,re.height)),he!==null&&(Ya(this,a,he,!0,!1,oe,re),he instanceof Jo&&he.type===Cu?(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&&Ls(this),le=this.part,oe=!1;var ge=0;le&&y.Gf("drawShadows")&&(oe=le.isShadowed)&&(he=le.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,Xe=xe.dx,Ve=xe.m12,st=xe.m22,ht=xe.dy,pt,Et=pt=0;xe=pt*Fe+Et*Ne+Xe;var Gt=pt*Ve+Et*st+ht;pt=Pe.width+ge,Et=0;var xi=pt*Fe+Et*Ne+Xe;pt=pt*Ve+Et*st+ht,Et=Math.min(xe,xi);var Ki=Math.min(Gt,pt),ji=Math.max(xe+0,xi)-Et,ei=Math.max(Gt+0,pt)-Ki;xe=Et,Gt=Ki,pt=Pe.width+ge,Et=Pe.height+ge,xi=pt*Fe+Et*Ne+Xe,pt=pt*Ve+Et*st+ht,Et=Math.min(xe,xi),Ki=Math.min(Gt,pt),ji=Math.max(xe+ji,xi)-Et,ei=Math.max(Gt+ei,pt)-Ki,xe=Et,Gt=Ki,pt=0,Et=Pe.height+ge,xi=pt*Fe+Et*Ne+Xe,pt=pt*Ve+Et*st+ht,Et=Math.min(xe,xi),Ki=Math.min(Gt,pt),ji=Math.max(xe+ji,xi)-Et,ei=Math.max(Gt+ei,pt)-Ki,xe=Et,Gt=Ki,ge=y.viewportBounds,Pe=ge.x,Fe=ge.y,xe=!(xe>ge.width+Pe||Pe>ji+xe||Gt>ge.height+Fe||Fe>ei+Gt)}if(xe){if(xe=(this.l&256)!==0,a.clipInsteadOfFill&&(xe=!1),this instanceof Da&&(a.font=this.font),xe){if(Gt=re.se()?re.naturalBounds:re.actualBounds,ji=Math.max(ee.x,Gt.x),ei=Math.max(ee.y,Gt.y),ge=Math.min(ee.right,Gt.right)-ji,Pe=Math.min(ee.bottom,Gt.bottom)-ei,Fe=this.tb,Fe!==null&&(ji=Fe.x,ei=Fe.y,ge=Fe.width,Pe=Fe.height),ji>ee.width+ee.x||ee.x>Gt.width+Gt.x){x!==1&&(a.globalAlpha=E),this.filter!==""&&(a.filter=b);return}a.save(),a.beginPath(),a.rect(ji,ei,ge,Pe),a.clip()}if(he){if(!le.isVisible()){x!==1&&(a.globalAlpha=E),this.filter!==""&&(a.filter=b);return}oe&&(Gt=le.shadowOffset,a.Ev(Gt.x*y.scale*this.scale*y.Mb,Gt.y*y.scale*this.scale*y.Mb,le.shadowBlur),Rs(a),a.shadowColor=le.shadowColor)}oe&&this.shadowVisible===!0?Rs(a):oe&&this.shadowVisible===!1&&fl(a),le=this.naturalBounds,this.areaBackground!==null&&(a.yc(),Zl(this,a,le,ee)),a.transform(z.m11,z.m12,z.m21,z.m22,z.dx,z.dy),oe&&Fs(this,re)&&this.shadowVisible===null&&fl(a),this.Ma!==null&&(a.yc(),yl(this,a,le,ee)),oe&&(this.Ma!==null||this.areaBackground!==null||Fs(this,re))?(hu(this,!0),this.shadowVisible===null&&fl(a)):hu(this,!1),this.hh(a,y),oe&&this.l&512&&Rs(a),he&&oe&&fl(a),xe&&(a.restore(),a.Vc(this instanceof Xn)),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 Fs(a,y){return y===null?!1:(ec(y)&&(y=y.panel),(y.l&512)!==0||(y.type===Xn.Auto||y.type===Xn.Spot)&&y.Pb()!==a)}Ce.Dv=function(){};function Zl(a,y,x,E){Ya(a,y,a.areaBackground,!0,!0,x,E),a.areaBackground instanceof Jo&&a.areaBackground.type===Cu?(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 yl(a,y,x,E){var b=a.kq(),z=x.x,ee=x.y,re=x.width+b,oe=x.height+b;Ya(a,y,a.Ma,!0,!1,x,E),a.Ma instanceof Jo&&a.Ma.type===Cu?(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 Qs(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===Xn.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 Gl(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&&Qs(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),Rs(y),y.shadowColor=a.shadowColor}a instanceof Da&&(y.font=a.font),y.yd=null;var ee=a.transform;z=a instanceof Xn;var re=a instanceof Xn?ec(a):!1;a.l&4096&&Ls(a);var oe=a.Ib;if(y.rb.ha=[1,0,0,1,0,0],y.o=!1,b&&(y.o=!0,z&&re?(Eu(y,1,0,0,1,0,0),a.svg=y.ad):z?(Eu(y,ee.m11,ee.m12,ee.m21,ee.m22,ee.dx,ee.dy),a.svg=y.ad):Eu(y,1,0,0,1,0,0)),b=a.naturalBounds,a.areaBackground!==null){var le=ee.copy().Vj();y.rb.ha=[le.m11,le.m12,le.m21,le.m22,le.dx,le.dy],Zl(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]),yl(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],yl(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&&Rs(y),re&&a.shadowVisible===!0?Rs(y):re&&a.shadowVisible===!1&&fl(y),b=a.panel,re&&Fs(a,b)&&a.shadowVisible===null&&fl(y),y.Il&&(le=x.computePixelRatio(),le="drop-shadow("+y.shadowOffsetX/le+"px "+y.shadowOffsetY/le+"px "+y.shadowBlur/le/2+"px "+y.shadowColor+")",a.background!==null&&ee.Ma.setAttributeNS(null,"filter",le),a.areaBackground!==null&&ee.gd.setAttributeNS(null,"filter",le)),re&&(a.Ma!==null||a.areaBackground!==null||Fs(a,b))?(hu(a,!0),a.shadowVisible===null&&fl(y)):hu(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,le=a.svg,!z&&le!==null&&re!==le&&le.parentNode===a.panel.svg?(a.svg.replaceWith(re),a.svg=re,re!==null&&a.$o(y,E,oe,re),dl(y,le),!0):(a.svg=re,ee!==null&&re===null&&(du(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&&Rs(y),a.Dd()&&fl(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&&Qs(a,E,re),ee!==null&&ee(a,re)),!0)}Ce.$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"+la++,re=a.Ud("clipPath",{id:z}),y=a.Ud("rect",{x:y,y:b,width:ee,height:x}),this instanceof Xn&&(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"),dl(a,E)};function dl(a,y){y=y.getAttribute("clip-path"),y!==null&&(a=a.svg.getElementById(y.split("#")[1].slice(0,-1)),a!==null&&a.remove())}function $s(a){if(a.svg!==null){var y=a.svg.innerHTML.match(/url\(#((CLIP|GRAD).+?)\)/g),x=a.svg.ownerDocument;if(y!==null){y=ci(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()}}Ce.hh=function(){},Ce.lv=function(){this.Uc=!0},Ce.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 Xn?ec(this):!1;if(!(this instanceof Xn&&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&&es(a,z[0],z[1],z[2],z[3],z[4],z[5],z[6],z[7]),x?y.lastElementChild.setAttributeNS(null,"transform",qs(a)):y.setAttributeNS(null,"transform",qs(a))}else if(!x||this instanceof Xn)y.setAttributeNS(null,"transform","matrix("+E.m11+", "+E.m12+", "+E.m21+", "+E.m22+", "+E.dx+", "+E.dy+")");else if(this instanceof ao){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],Zl(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 Xn))&&(a.rb.ha=[E.m11,E.m12,E.m21,E.m22,E.dx,E.dy]),yl(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},Ce.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 Ya(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===qd)E?y.fillStyle=x.color:y.strokeStyle=x.color;else{var le=a.kq();if(re=z.width,oe=z.height,b?(re=ee.width,oe=ee.height):E||(re+=le,oe+=le),(z=y instanceof ch)&&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,Xe=0;if(Xe=Ne=0,b?(Ne=ee.x,Xe=ee.y):E||(Ne-=le/2,Xe-=le/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+=Xe,Fe+=Xe,x.type===Bd)he=y.createLinearGradient(ge,xe,Pe,Fe);else if(x.type===Cu)Xe=isNaN(x.endRadius)?Math.max(re,oe)/2:x.endRadius,isNaN(x.startRadius)?(Ne=0,Xe=Math.max(re,oe)/2):Ne=x.startRadius,he=y.createRadialGradient(ge,xe,Ne,Pe,Fe,Xe);else if(x.type===ap)try{he=y.createPattern(x.pattern,"repeat")}catch(st){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&&_t(function(){Ve.redraw()},600)}}E?y.fillStyle=he:y.strokeStyle=he}}}Ce.rg=function(a){if(a instanceof Xn)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},Ce.Ed=function(){if(!this.visible)return!1;var a=this.panel;return a!==null?a.Ed():!0},Ce.If=function(){for(var a=this instanceof Xn?this:this.panel;a!==null&&a.isEnabled;)a=a.panel;return a===null};function Ls(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),ze(a,!0)}a.l&4096&&(y=a.panel,y===null?(a.wh.set(a.Ab),a.Kk=a.scale,ze(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,ze(a,!1)))}Ce.no=function(a,y,x,E,b){if(this.Ca!==1&&a.scale(this.Ca),this.Kb!==0){var z=_e.alloc();z.yi(y,x,E,b,yo),a.rotate(this.Kb,z.x,z.y),_e.free(z)}},Ce.v=function(a){if(!qe(this)){a===void 0&&(a=!1),$e(this,!0),xt(this,!0);var y=this.panel;y===null||a||y.v()}},Ce.Uj=function(){qe(this)||($e(this,!0),xt(this,!0))};function sl(a){if(!gt(a)){var y=a.panel;y!==null?y.v():a.Dd()&&(y=a.diagram,y!==null&&(y.De.add(a),a instanceof Fi&&a.Bd(),y.$b())),xt(a,!0)}}Ce.Uk=function(){!(this.l&2048)&&(Be(this,!0),ze(this,!0))},Ce.Wu=function(){ze(this,!0)},Ce.N=function(){var a=this.part;a!==null&&a.N()};function cl(a,y){var x=a.stretch,E=a.panel;return E!==null&&E.type===Xn.Table?Iu(a,E.Fb(a.row),E.Eb(a.column),y):E!==null&&E.type===Xn.Auto&&E.Pb()===a?Bs(a,Gn,y):x===Jr?E!==null?E.type===Xn.Spot&&E.Pb()===a?Bs(a,Gn,y):(x=E.defaultStretch,x===Jr?Bs(a,Bn,y):Bs(a,x,y)):Bs(a,Bn,y):Bs(a,x,y)}function Iu(a,y,x,E){var b=a.stretch;if(b!==Jr)return Bs(a,b,E);var z=b=null;switch(y.stretch){case Br:z=!0;break;case Gn:z=!0}switch(x.stretch){case or:b=!0;break;case Gn:b=!0}return y=a.panel.defaultStretch,b===null&&(b=y===or||y===Gn),z===null&&(z=y===Br||y===Gn),b===!0&&z===!0?Bs(a,Gn,E):b===!0?Bs(a,or,E):z===!0?Bs(a,Br,E):Bs(a,Bn,E)}function Bs(a,y,x){if(x)return y;if(y===Bn||(x=a.desiredSize,x.w()))return Bn;if(a=a.angle,!isNaN(x.width))if(a!==90&&a!==270){if(y===or)return Bn;if(y===Gn)return Br}else{if(y===Br)return Bn;if(y===Gn)return or}if(!isNaN(x.height))if(a!==90&&a!==270){if(y===Br)return Bn;if(y===Gn)return or}else{if(y===or)return Bn;if(y===Gn)return Br}return y}function hu(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 ze(a,y){a.l=y?a.l|4096:a.l&-4097}function qe(a){return(a.l&8192)!==0}function $e(a,y){a.l=y?a.l|8192:a.l&-8193}function gt(a){return(a.l&16384)!==0}function xt(a,y){a.l=y?a.l|16384:a.l&-16385}Ce.Gj=function(){this.svg=null},Ce.wi=function(a){this.Me=a,this.svg!==null&&this.svg.remove()},Ce.Av=function(){},Ce.zv=function(a){return this.pa=a,sl(this),!0},Ce.mm=function(a,y){(this.pa.x!==a||this.pa.y!==y)&&(this.pa.h(a,y),this.Uk())},Ce.kq=function(){return 0};function Qt(a){var y=a.part;if(y instanceof Fi&&(a.portId!==null||a===y.port)){var x=y.diagram;x===null||x.undoManager.isUndoingRedoing||W1(y,a)}}function xn(a){var y=a.diagram;y===null||y.undoManager.isUndoingRedoing||(a instanceof Xn?a instanceof Fi?a.Bd():a.qm(a,function(x){Qt(x)}):Qt(a))}Ce.bind=function(a,y,x,E){var b=null;return typeof a=="string"?b=new fs(a,y,x,E):b=a,b.xd=this,a=this.ih(),a!==null&&f1(a)&&it("Cannot add a Binding to a template that has already been copied: "+b),this.localBindings===null&&(this.localBindings=new Tn),this.localBindings.add(b),this},Ce.set=function(a){return Object.assign(this,a),this},Ce.Du=function(a){return on(this,a),this},Ce.apply=function(a){return a(this),this},Ce.nm=function(a){return Kd(this,a),this},Ce.pz=function(){return this.ih()},Ce.ih=function(){for(var a=this instanceof Xn?this:this.panel;a!==null;){if(a.allBindings!==null)return a;a=a.panel}return null},Ce.Jv=function(a){return a.xd=this,this.animationTriggers===null&&(this.animationTriggers=new Ut),this.animationTriggers.add(a.propertyName,a),this};function dn(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=Bi.I(a);typeof z=="function"?(x=an(arguments),E=z(x),cn(E)||it('GraphObject.make invoked object builder "'+a+'", but it did not return an Object')):b=yn.go[a]}if(E===null&&(b!=null&&b.constructor||it("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 Zt&&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?it("Undefined value at argument "+b+" for object being constructed by GraphObject.make: "+E):on(E,z);return E}function on(a,y){if(typeof y=="string")if(a instanceof Da)a.text=y;else if(a instanceof ao)a.figure=y;else if(a instanceof Tl)a.source=y;else if(a instanceof Xn)y=Xu.I(y),y!==null&&(a.type=y);else if(a instanceof Jo){var x=li(Jo,y);x!==null?a.type=x:it("Unknown Brush type as an argument to GraphObject.make: "+y)}else a instanceof Dt?(y=li(Dt,y),y!==null&&(a.type=y)):a instanceof lr&&(y=li(lr,y),y!==null&&(a.type=y));else if(y instanceof bt)a instanceof Xn||it("A GraphObject can only be added to a Panel, not to: "+a),a.add(y);else if(y instanceof Ss){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 Ss?$m(E,y):it("A RowColumnDefinition can only be added to an object that implements getRowDefinition/getColumnDefinition, not to: "+a)}else if(y instanceof en)typeof a.qb=="function"&&a.qb(y);else if(y instanceof Ps)a.type=y;else if(y instanceof fs)a instanceof bt||a instanceof Ss?a.bind(y):it("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: "+a);else if(y instanceof Pu)a instanceof bt?a.Jv(y):it("An AnimationTrigger can only be applied to a GraphObject, not to: "+a);else if(y instanceof no)a instanceof Dt&&a.type===Dt.o?a.figures.add(y):it("A PathFigure can only be added to a Path Geometry, not to: "+a);else if(y instanceof lr)a instanceof no?a.segments.add(y):it("A PathSegment can only be added to a PathFigure, not to: "+a);else if(y instanceof Ga)a instanceof Zt||a instanceof qr?a.layout=y:it("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++)on(a,y[x]);else if(typeof y=="object"&&y!==null)if(a instanceof Jo){x=new Sr;for(var b in y)E=parseFloat(b),isNaN(E)?x[b]=y[b]:a.addColorStop(E,y[b]);Kd(a,x)}else if(a instanceof Ss){y.row!==void 0?(b=y.row,(b==null||b===1/0||isNaN(b)||0>b)&&it("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)&&it("Must specify non-negative integer column for RowColumnDefinition "+y+", not: "+b),a.isRow=!1,a.index=b),b=new Sr;for(x in y)x!=="row"&&x!=="column"&&(b[x]=y[x]);Kd(a,b)}else Kd(a,y);else it('Unknown initializer "'+y+'" for object being constructed by GraphObject.make: '+a)}function rn(a,y){Bi.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}kt.Object.defineProperties(bt.prototype,{bindingId:{get:function(){return this.A!==null?this.A.zp:-1},set:function(a){this.bindingId!==a&&(this.A===null&&(this.A=new Zr),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 Zr),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 Zr),this.A.wm=a)}},shadowVisible:{get:function(){return this.A!==null?this.A.Ci:null},set:function(a){var y=this.shadowVisible;y!==a&&(co(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&&(co(this),this.A.Hb=a,this.g("enabledChanged",y,a))}},segmentOrientation:{get:function(){return this.Ua!==null?this.Ua.rr:Sl},set:function(a){var y=this.segmentOrientation;y!==a&&(this.Ua===null&&(this.Ua=new Ur),this.Ua.rr=a,this.v(),this.g("segmentOrientation",y,a),a===Sl&&(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 Ur),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 Ur),this.Ua.o=a,this.v(),this.g("segmentFraction",y,a))}},segmentOffset:{get:function(){return this.Ua!==null?this.Ua.F:pi},set:function(a){var y=this.segmentOffset;y.D(a)||(a=a.J(),this.Ua===null&&(this.Ua=new Ur),this.Ua.F=a,this.v(),this.g("segmentOffset",y,a))}},stretch:{get:function(){return this.A!==null?this.A.hg:Jr},set:function(a){var y=this.stretch;y!==a&&(co(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&&(co(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)&&Dn(a,"0 <= value <= 1",bt,"opacity"),this.pb=a,this.g("opacity",y,a),a=this.diagram,y=this.part,a!==null&&y!==null&&a.N(_f(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(_f(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(),xn(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&&Ic(a,"GraphObject.areaBackground"),a instanceof Jo&&a.freeze(),co(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&&Ic(a,"GraphObject.background"),a instanceof Jo&&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 _e(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&&it("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,xn(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 ao&&this.qc(),this.g("desiredSize",E,a),ve(this)&&(a=this.part,a!==null&&(_a(this,a,"width"),_a(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 bn(a,this.jd.height).freeze(),this.v(),this instanceof ao&&this.qc(),this.g("desiredSize",y,a),ve(this)&&(a=this.part,a!==null&&_a(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 bn(this.jd.width,a).freeze(),this.v(),this instanceof ao&&this.qc(),this.g("desiredSize",y,a),ve(this)&&(a=this.part,a!==null&&_a(this,a,"height")))}},minSize:{get:function(){return this.A!==null?this.A.u:Yi},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(),co(this),this.A.u=a,this.v(),this.g("minSize",y,a))}},maxSize:{get:function(){return this.A!==null?this.A.o:Do},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(),co(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 Vr(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&&Ls(this),this.Ab}},oe:{get:function(){return this.l&4096&&Ls(this),this.wh}},animationTriggers:{get:function(){return this.A!==null?this.A.hb:null},set:function(a){this.animationTriggers!==a&&(co(this),this.A.hb=a)}},reshapingBehavior:{get:function(){return this.A!==null?this.A.Pf:Bn},set:function(a){this.reshapingBehavior!==a&&(co(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()&&it("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.Jb=a=a.J(),sl(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&&Dn(a,">= 0",bt,"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&&Dn(a,">= 1",bt,"columnSpan"),co(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&&Dn(a,">= 0",bt,"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&&Dn(a,">= 1",bt,"rowSpan"),co(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&&(co(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 Fi||it("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:to},set:function(a){var y=this.toSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.yj=a,this.g("toSpot",y,a),Qt(this))}},toEndSegmentLength:{get:function(){return this.ba!==null?this.ba.wj:10},set:function(a){var y=this.toEndSegmentLength;y!==a&&(0>a&&Dn(a,">= 0",bt,"toEndSegmentLength"),this.Xc(),this.ba.wj=a,this.g("toEndSegmentLength",y,a),Qt(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),Qt(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&&Dn(a,">= 0",bt,"toMaxLinks"),this.Xc(),this.ba.Ur=a,this.g("toMaxLinks",y,a))}},fromSpot:{get:function(){return this.ba!==null?this.ba.Xi:to},set:function(a){var y=this.fromSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.Xi=a,this.g("fromSpot",y,a),Qt(this))}},fromEndSegmentLength:{get:function(){return this.ba!==null?this.ba.Vi:10},set:function(a){var y=this.fromEndSegmentLength;y!==a&&(0>a&&Dn(a,">= 0",bt,"fromEndSegmentLength"),this.Xc(),this.ba.Vi=a,this.g("fromEndSegmentLength",y,a),Qt(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),Qt(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&&Dn(a,">= 0",bt,"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&&(co(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&&(co(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&&(co(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&&(co(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&&(co(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&&(co(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&&(co(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&&(co(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&&(co(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&&(co(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&&(co(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&&(co(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&&(co(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&&(co(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&&(co(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&&(co(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&&(co(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&&(co(this),this.A.Ch=a,this.g("contextMenu",y,a))}}}),bt.prototype.trigger=bt.prototype.Jv,bt.prototype.findBindingPanel=bt.prototype.ih,bt.prototype.findTemplateBinder=bt.prototype.pz,bt.prototype.setProperties=bt.prototype.nm,bt.prototype.apply=bt.prototype.apply,bt.prototype.attach=bt.prototype.Du,bt.prototype.set=bt.prototype.set,bt.prototype.isEnabledObject=bt.prototype.If,bt.prototype.isVisibleObject=bt.prototype.Ed,bt.prototype.isContainedBy=bt.prototype.rg,bt.prototype.getNearestIntersectionPoint=bt.prototype.rs,bt.prototype.getLocalPoint=bt.prototype.qs,bt.prototype.getDocumentScale=bt.prototype.Df,bt.prototype.getDocumentAngle=bt.prototype.li,bt.prototype.getDocumentBounds=bt.prototype.mi,bt.prototype.getDocumentPoint=bt.prototype.ga,bt.prototype.intersectsRect=bt.prototype.Yc,bt.prototype.containedInRect=bt.prototype.fh,bt.prototype.containsRect=bt.prototype.Re,bt.prototype.containsPoint=bt.prototype.ca,bt.prototype.raiseChanged=bt.prototype.g,bt.prototype.raiseChangedEvent=bt.prototype.cb,bt.prototype.addCopyProperty=bt.prototype.Vw;var Bi=null;bt.className="GraphObject",Bi=new Ut,rn("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=dn(Xn,Xn.Auto,{isActionable:!0,enabledChanged:function(x,E){if(x instanceof Xn){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"},dn(ao,{name:"ButtonBorder",figure:"RoundedRectangle",spot1:new ni(0,0,2.76142374915397,2.761423749153969),spot2:new ni(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 Xn&&(x=E.fb("ButtonBorder"),x instanceof ao)){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 Xn&&(x=E.fb("ButtonBorder"),x instanceof ao&&(x.fill=E._buttonFillNormal,x.stroke=E._buttonStrokeNormal))},y.actionDown=function(x,E){if(E.If()&&E instanceof Xn&&E._buttonFillPressed!==null&&x.button===0){var b=E.fb("ButtonBorder");if(b instanceof ao){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 Xn&&E._buttonFillPressed!==null&&x.button===0){var b=E.fb("ButtonBorder");if(b instanceof ao){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 Xn&&E._buttonFillPressed!==null){var b=E.fb("ButtonBorder");if(b instanceof ao){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 Xn&&E._buttonFillPressed!==null){var b=x.diagram;if(b.firstInput.button===0&&(b.currentTool.standardMouseOver(),a(x,E)&&(x=E.fb("ButtonBorder"),x instanceof ao))){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}),rn("TreeExpanderButton",function(){var a=dn("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},dn(ao,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:uo},new fs("figure","isTreeExpanded",function(y,x){return x=x.panel,y?x._treeExpandedFigure:x._treeCollapsedFigure}).cp()),{visible:!1},new fs("visible","isTreeLeaf",function(y){return!y}).cp());return a.click=function(y,x){if(x=x.part,x instanceof $o&&(x=x.adornedPart),x instanceof Fi){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}),rn("SubGraphExpanderButton",function(){var a=dn("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},dn(ao,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:uo},new fs("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 $o&&(x=x.adornedPart),x instanceof qr){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}),rn("ToolTip",function(){return dn($o,Xn.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new _e(0,3),shadowBlur:5},dn(ao,{name:"Border",figure:"RoundedRectangle",parameter1:1,parameter2:1,fill:"#F5F5F5",stroke:"#F0F0F0",spot1:new ni(0,0,4,6),spot2:new ni(1,1,-4,-4)}))}),rn("ContextMenu",function(){return dn($o,Xn.Vertical,{background:"#F5F5F5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new _e(0,3),shadowBlur:5},new fs("background","",function(a){return a.adornedPart!==null&&a.placeholder!==null?null:"#F5F5F5"}))}),rn("ContextMenuButton",function(){var a=dn("Button");a.stretch=or;var y=a.fb("ButtonBorder");return y instanceof ao&&(y.figure="Rectangle",y.strokeWidth=0,y.spot1=new ni(0,0,2,3),y.spot2=new ni(1,1,-2,-2)),a}),rn("PanelExpanderButton",function(a){var y=Ln(a,"COLLAPSIBLE"),x=dn("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},dn(ao,{name:"ButtonIcon",strokeWidth:2},new fs("geometryString","visible",function(E){return E?x._buttonExpandedFigure:x._buttonCollapsedFigure}).cp(y)));return a=x.fb("ButtonBorder"),a instanceof ao&&(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}),rn("CheckBoxButton",function(a){var y=Ln(a);return a=dn("Button",{desiredSize:new bn(14,14)},dn(ao,{name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:Gn,geometryStretch:Ji,visible:!1},y!==""?new fs("visible",y).Kx():[])),a.click=function(x,E){if(E instanceof Xn){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}),rn("CheckBox",function(a){a=Ln(a),a=dn("CheckBoxButton",a,{name:"Button",isActionable:!1,margin:new Vr(0,1,0,0)});var y=dn(Xn,"Horizontal",a,{isActionable:!0,cursor:a.cursor,margin:new Vr(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}),bt.None=Bn=new en(bt,"None",0),bt.Default=Jr=new en(bt,"Default",0),bt.Vertical=Br=new en(bt,"Vertical",4),bt.Horizontal=or=new en(bt,"Horizontal",5),bt.Fill=Gn=new en(bt,"Fill",3),bt.Uniform=Ji=new en(bt,"Uniform",1),bt.UniformToFill=Ao=new en(bt,"UniformToFill",2),bt.FlipVertical=ho=new en(bt,"FlipVertical",1),bt.FlipHorizontal=jo=new en(bt,"FlipHorizontal",2),bt.FlipBoth=ma=new en(bt,"FlipBoth",3),bt.make=dn,bt.getBuilders=function(){var a=new Ut,y;for(y in Bi)if(y!==y.toLowerCase()){var x=Bi.I(y);typeof x=="function"&&a.add(y,x)}return a.freeze(),a},bt.defineBuilder=rn,bt.build=function(a,y,x){for(var E=[],b=2;b<arguments.length;++b)E[b-2]=arguments[b];if(b=Bi.I(a),typeof b=="function"&&(E=b([a].concat(E)),E instanceof bt))return y&&E.set(y),E;it('GraphObject.build invoked object builder "'+a+'", but it did not return an Object')},bt.takeBuilderArgument=Ln;function Zr(){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=Yi,this.o=Do,this.hg=Jr,this.ob=this.Bi=1,this.Pf=Bn,this.Pc=this.Ci=this.gd=null,this.Oc="category"}Zr.prototype.copy=function(){var a=new Zr;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 Ur(){this.u=-1/0,this.o=0,this.F=pi,this.rr=Sl,this.j=this.V="None"}Ur.prototype.copy=function(){var a=new Ur;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},Ur.className="LinkElementSettings";function io(){this.yj=this.Xi=er,this.xj=this.Wi=this.wj=this.Vi=NaN,this.Tr=this.hq=null,this.Ur=this.iq=1/0}io.prototype.copy=function(){var a=new io;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},io.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 Ho(a){this.type=a,this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0,this.gx=[],this.pattern=null}Ho.prototype.addColorStop=function(a,y){this.gx.push({offset:a,color:y})},Ho.className="SGradient";function Ro(a,y,x){this.ownerDocument=a=y===void 0?yn.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)}Ro.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},Ro.prototype.Ud=function(a,y,x){if(a=this.ownerDocument.createElementNS(this.cA,a),cn(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},Ro.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},Ro.prototype.focus=function(){this.Oa.focus()},Ro.prototype.mx=function(){this.ownerDocument=null},kt.Object.defineProperties(Ro.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}}}),Ro.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=du(this),this.Nj=du(this,"gojs-diagram"),this.Hl=this.ti=null;var x=la++,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 ja(a,y,x,E,b,z,ee){a.Nj===void 0?Eu(a,y,x,E,b,z,ee):a.Nj.setAttribute("transform","matrix("+y+", "+x+", "+E+", "+b+", "+z+", "+ee+")")}Ce=da.prototype,Ce.arc=function(a,y,x,E,b,z,ee,re){var oe=2*Math.PI,le=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>le?(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)])},Ce.beginPath=function(){this.path=[],this.Yl={stroke:"none",fill:"none"}},Ce.Se=function(a){this.addPath(this.path,this.rb,a||0)},Ce.bezierCurveTo=function(a,y,x,E,b,z){this.path.push(["C",a,y,x,E,b,z])},Ce.clearRect=function(){},Ce.clip=function(){this.Yl.clipPath=!0},Ce.closePath=function(){this.path.push(["z"])},Ce.createLinearGradient=function(a,y,x,E){var b=new Ho("linear");return b.x1=a,b.y1=y,b.x2=x,b.y2=E,b},Ce.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"+la++,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(bd,b)),this.svg.appendChild(a),x[y]=E,"url(#"+E+")"},Ce.createRadialGradient=function(a,y,x,E,b,z){var ee=new Ho("radial");return ee.x1=a,ee.y1=y,ee.r1=x,ee.x2=E,ee.y2=b,ee.r2=z,ee};function es(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)}Ce.drawImage=function(a,y,x,E,b,z,ee,re,oe){var le="";a instanceof HTMLCanvasElement&&(le=a.toDataURL()),a instanceof HTMLImageElement&&(le=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,es(this,y,x,E,b,z||0,ee||0,re,oe),z={x:0,y:0,width:he||E,height:a||b,href:le},He.$(E,re)&&He.$(b,oe)?le.toLowerCase().indexOf(".svg")===-1&&le.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')"),Xa(this,bd,z,this.rb),this.addElement(bd,z)},Ce.fill=function(a){a&&(this.Yl["fill-rule"]="evenodd"),Us(this,this.Yl)},Ce.ng=function(a,y){this.clipInsteadOfFill?this.clip():this.fill(y)},Ce.fillRect=function(a,y,x,E){a=[a,y,x,E],a={x:a[0],y:a[1],width:a[2],height:a[3]},Xa(this,"fill",a,this.rb),this.addElement("rect",a)},Ce.ox=function(a,y,x,E){a={x:a,y,width:x,height:E},Xa(this,"fill",a,this.rb),Us(this,a),this.svg.prepend(this.Ud("rect",a))},Ce.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},Xa(this,"fill",y,this.rb),this.addElement("text",y,a[0])},Ce.lineTo=function(a,y){this.path.push(["L",a,y])},Ce.moveTo=function(a,y){this.path.push(["M",a,y])},Ce.quadraticCurveTo=function(a,y,x,E){this.path.push(["Q",a,y,x,E])},Ce.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"])},Ce.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},Ce.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())},Ce.setTransform=function(a,y,x,E,b,z){a===1&&y===0&&x===0&&E===1&&b===0&&z===0||Eu(this,a,y,x,E,b,z)};function qs(a){return a=a.rb.ha,"matrix("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+")"}Ce.scale=function(a,y){this.rb.scale(a,y)},Ce.translate=function(a,y){this.rb.translate(a,y)},Ce.transform=function(){},Ce.yc=function(){},Ce.stroke=function(){Hl(this,this.Yl)},Ce.jk=function(){this.clipInsteadOfFill||this.stroke()},Ce.Ud=function(a,y,x){return this.Gv.Ud(a,y,x)},Ce.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 Xa(a,y,x,E){y==="fill"?Us(a,x):y==="stroke"&&Hl(a,x),E!==null&&(a=E.ha,x.transform="matrix("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+")")}function Us(a,y){a.fillStyle instanceof Ho?y.fill=dh(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 Ho?y.setAttributeNS(null,"fill",dh(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 Hl(a,y){if(a.strokeStyle instanceof Ho)y.stroke=dh(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 dh(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"+la++,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(le,he){return le.offset>he.offset?1:-1}),b=0;b<y;b++)x.appendChild(a.Ud("stop",z[b]));return a.svg.appendChild(x),"url(#"+E+")"}Ce.addPath=function(a,y,x){for(var E=[],b=0;b<a.length;b++){var z=an(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,Xa(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 Eu(a,y,x,E,b,z,ee){var re=new Co;re.ha=[y,x,E,b,z,ee],y={},Xa(a,"g",y,re),re=a.addElement("g",y),a.nh.push(re)}function du(a,y){var x={};return y&&(x.class=y),y=a.addElement("g",x),a.nh.push(y),y}Ce.Ev=function(a,y,x){this.Ar=a,this.Br=y,this.Vg=x};function fl(a){a.Il=!1,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0}function Rs(a){a.Il=!0,a.shadowOffsetX=a.Ar,a.shadowOffsetY=a.Br,a.shadowBlur=a.Vg}Ce.js=function(a,y){this.Ct=!0,this.Yg=a,this.uj=y},Ce.fs=function(){this.Ct=!1},Ce.Vc=function(){},Ce.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",Zt.prototype.Cs=function(a){this.pj.contains("SVG")||this.bs("SVG",new Ro(this,yn.document));var y=new Ro(this,yn.document,!0);a===void 0&&(a=new Sr);var x=this;return Pd(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)},Zt.prototype.makeSvg=Zt.prototype.Cs,Zt.prototype.av=function(a){return this.Cs(a)},Zt.prototype.makeSVG=Zt.prototype.av;function Ys(a,y,x,E){this.ownerDocument=y=y===void 0?yn.document:y,this.hs=null,y=y.createElement("canvas"),y.tabIndex=0,this.Oa=y,this.context=new ch(y,x,E),y.H=a}Ys.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},Ys.prototype.toDataURL=function(a,y){return this.Oa.toDataURL(a,y)},Ys.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},Ys.prototype.focus=function(){this.Oa.focus()},Ys.prototype.mx=function(){this.ownerDocument=this.Oa.H=null},kt.Object.defineProperties(Ys.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}}}),Ys.className="CanvasSurface";function ch(a,y,x){this.Z=a.getContext?a.getContext("2d",y):null,this.Z===null&&it("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 Pt,this.isTemporary=!!x}Ce=ch.prototype,Ce.Wx=function(a){this.Z.imageSmoothingEnabled=a},Ce.arc=function(a,y,x,E,b,z){this.Z.arc(a,y,x,E,b,z)},Ce.beginPath=function(){this.Z.beginPath()},Ce.Se=function(){},Ce.bezierCurveTo=function(a,y,x,E,b,z){this.Z.bezierCurveTo(a,y,x,E,b,z)},Ce.clearRect=function(a,y,x,E){this.yc(),this.Z.clearRect(a,y,x,E)},Ce.clip=function(){this.Z.clip()},Ce.closePath=function(){this.Z.closePath()},Ce.createLinearGradient=function(a,y,x,E){return this.Z.createLinearGradient(a,y,x,E)},Ce.createPattern=function(a,y){return this.Z.createPattern(a,y)},Ce.createRadialGradient=function(a,y,x,E,b,z){return this.Z.createRadialGradient(a,y,x,E,b,z)},Ce.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)},Ce.fill=function(a){this.Z.fill(a?"evenodd":"nonzero")},Ce.fillRect=function(a,y,x,E){this.Z.fillRect(a,y,x,E)},Ce.ox=function(a,y,x,E){this.Z.fillRect(a,y,x,E)},Ce.fillText=function(a,y,x){this.Z.fillText(a,y,x)},Ce.getImageData=function(a,y,x,E){return this.Z.getImageData(a,y,x,E)},Ce.lineTo=function(a,y){this.Z.lineTo(a,y)},Ce.measureText=function(a){return this.Z.measureText(a)},Ce.moveTo=function(a,y){this.Z.moveTo(a,y)},Ce.quadraticCurveTo=function(a,y,x,E){this.Z.quadraticCurveTo(a,y,x,E)},Ce.rect=function(a,y,x,E){this.Z.rect(a,y,x,E)},Ce.restore=function(){this.Z.restore()},Ce.save=function(){this.yc(),this.Z.save()},ch.prototype.rotate=function(a){this.El.rotate(57.2958*a,0,0)},Ce=ch.prototype,Ce.setTransform=function(a,y,x,E,b,z){this.El.setTransform(a,y,x,E,b,z)},Ce.scale=function(a,y){this.El.scale(a,y)},Ce.translate=function(a,y){this.El.translate(a,y)},Ce.stroke=function(){this.Z.stroke()},Ce.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}},Ce.yc=function(){var a=this.El;this.Z.setTransform(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy)},Ce.ng=function(a,y){if(a instanceof Jo&&a.type===Cu){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)},Ce.jk=function(){this.Hm||this.stroke()},Ce.Ev=function(a,y,x){this.Ar=a,this.Br=y,this.Vg=x},Ce.js=function(a,y){var x=this.Z;x.setLineDash!==void 0&&(x.setLineDash(a),x.lineDashOffset=y)},Ce.fs=function(){var a=this.Z;a.setLineDash!==void 0&&(a.setLineDash(_c),a.lineDashOffset=0)},Ce.Vc=function(a){a&&(this.dt=""),this.ct=this.et=""},Ce.Hs=function(){},kt.Object.defineProperties(ch.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 _c=Object.freeze([]);ch.className="CanvasSurfaceContext";function fh(){this.F=this.o=this.u=this.j=0}fh.className="ColorNumbers";function Jo(a,y){op||(rp(),op=!0),wr(this),this._isFrozen=!1,a===void 0?(this.na=qd,this.xk="black"):typeof a=="string"?(this.na=qd,this.xk=a):(this.na=a,this.xk="black"),a=this.na,a===Bd?(this.Qd=Ia,this.Lk=Yt):this.Lk=a===Cu?this.Qd=yo:this.Qd=to,this.Gr=0,this.Xp=NaN,this.xe=this.cr=this.we=null,this.ft=this.yk=0,y&&Object.assign(this,y)}Jo.prototype.copy=function(){var a=new Jo;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},Ce=Jo.prototype,Ce.freeze=function(){return this._isFrozen=!0,this.we!==null&&this.we.freeze(),this},Ce.ka=function(){return Object.isFrozen(this)&&it("cannot thaw constant: "+this),this._isFrozen=!1,this.we!==null&&this.we.ka(),this},Ce.qb=function(a){a.classType===Jo&&(this.type=a)},Ce.toString=function(){var a="Brush(";if(this.type===qd)a+=this.color;else if(a=this.type===Bd?a+"Linear ":this.type===Cu?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+")"},Ce.addColorStop=function(a,y){return this._isFrozen&&sn(this),(typeof a!="number"||!isFinite(a)||1<a||0>a)&&Dn(a,"0 <= loc <= 1",Jo,"addColorStop:loc"),this.we===null&&(this.we=new Ut),this.we.add(a,y),this.na===qd&&(this.type=Bd),this.xe=null,this},Ce.Vz=function(a,y){if(this._isFrozen&&sn(this),a=a===void 0||typeof a!="number"?.2:a,y=y===void 0?sp:y,this.type===qd)cu(this.color),this.color=Ld(a,y);else if((this.type===Bd||this.type===Cu)&&this.colorStops!==null)for(var x=this.colorStops.iterator;x.next();)cu(x.value),this.addColorStop(x.key,Ld(a,y));return this};function $d(a,y,x){return y=y===void 0||typeof y!="number"?.2:y,x=x===void 0?sp:x,cu(a),Ld(y,x)}Ce.Wy=function(a,y){if(this._isFrozen&&sn(this),a=a===void 0||typeof a!="number"?.2:a,y=y===void 0?sp:y,this.type===qd)cu(this.color),this.color=Ld(-a,y);else if((this.type===Bd||this.type===Cu)&&this.colorStops!==null)for(var x=this.colorStops.iterator;x.next();)cu(x.value),this.addColorStop(x.key,Ld(-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,cu(a),Ld(-y,x)}function gh(a,y,x){cu(a),a=Ca.j;var E=Ca.u,b=Ca.o,z=Ca.F;return cu(y),x===void 0&&(x=.5),"rgba("+Math.round((Ca.j-a)*x+a)+", "+Math.round((Ca.u-E)*x+E)+", "+Math.round((Ca.o-b)*x+b)+", "+Math.round((Ca.F-z)*x+z)+")"}Ce.Gx=function(){if(this.type===qd)return Xh(this.color);if((this.type===Bd||this.type===Cu)&&this.colorStops!==null){var a=this.colorStops;if(this.type===Cu)return Xh(a.first().value);if(a.get(.5)!==null)return Xh(a.get(.5));if(a.count===2)return a=a.Fa(),Xh(gh(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,Xh(gh(a.get(x),a.get(E),1-z/b))}return!1};function Xh(a){return a?a instanceof Jo?a.Gx():(cu(a),128>(299*Ca.j+587*Ca.u+114*Ca.o)/1e3):!1}function Ld(a,y){switch(y){case sp:y=100*Af(Ca.j);var x=100*Af(Ca.u),E=100*Af(Ca.o);return Gs.j=.4124564*y+.3575761*x+.1804375*E,Gs.u=.2126729*y+.7151522*x+.072175*E,Gs.o=.0193339*y+.119192*x+.9503041*E,Gs.F=Ca.F,y=Gp(Gs.j/Rc[0]),x=Gp(Gs.u/Rc[1]),E=Gp(Gs.o/Rc[2]),Ou.j=116*x-16,Ou.u=500*(y-x),Ou.o=200*(x-E),Ou.F=Gs.F,Ou.j=Math.min(100,Math.max(0,Ou.j+100*a)),a=(Ou.j+16)/116,y=a-Ou.o/200,Gs.j=Rc[0]*wg(Ou.u/500+a),Gs.u=Rc[1]*(Ou.j>Oc*Pg?Math.pow(a,3):Ou.j/Oc),Gs.o=Rc[2]*wg(y),Gs.F=Ou.F,a=-.969266*Gs.j+1.8760108*Gs.u+.041556*Gs.o,y=.0556434*Gs.j+-.2040259*Gs.u+1.0572252*Gs.o,Ca.j=255*ip((3.2404542*Gs.j+-1.5371385*Gs.u+-.4985314*Gs.o)/100),Ca.u=255*ip(a/100),Ca.o=255*ip(y/100),Ca.F=Gs.F,Ca.j=Math.round(Ca.j),255<Ca.j?Ca.j=255:0>Ca.j&&(Ca.j=0),Ca.u=Math.round(Ca.u),255<Ca.u?Ca.u=255:0>Ca.u&&(Ca.u=0),Ca.o=Math.round(Ca.o),255<Ca.o?Ca.o=255:0>Ca.o&&(Ca.o=0),"rgba("+Ca.j+", "+Ca.u+", "+Ca.o+", "+Ca.F+")";case i1:return kf(),Wl.o=Math.min(100,Math.max(0,Wl.o+100*a)),"hsla("+Wl.j+", "+Wl.u+"%, "+Wl.o+"%, "+Wl.F+")";default:it("Unknown color space: "+y)}}function cu(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,Ca.j=a[0],Ca.u=a[1],Ca.o=a[2],Ca.F=a[3]/255):(y.fillStyle="#FFFFFF",y.fillStyle=a,Ca.j=0,Ca.u=0,Ca.o=0,Ca.F=1)}}function kf(){var a=Ca.j/255,y=Ca.u/255,x=Ca.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))}Wl.j=Math.round(ee),Wl.u=Math.round(100*a),Wl.o=Math.round(100*b),Wl.F=Ca.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):(Oc*a+16)/116}function wg(a){var y=a*a*a;return y>Pg?y:(116*a-16)/Oc}function Ic(a,y){typeof a!="string"&&(a instanceof Jo||it("Value for "+y+" must be a color string or a Brush, not "+a))}function rp(){Eg=Ua?new Ys(null,void 0,{willReadFrequently:!0}).context:null}kt.Object.defineProperties(Jo.prototype,{type:{get:function(){return this.na},set:function(a){this._isFrozen&&sn(this,a),this.na=a,this.start.Mc()&&(a===Bd?this.start=Ia:a===Cu&&(this.start=yo)),this.end.Mc()&&(a===Bd?this.end=Yt:a===Cu&&(this.end=yo)),this.xe=null}},color:{get:function(){return this.xk},set:function(a){this._isFrozen&&sn(this,a),this.xk=a,this.xe=null}},start:{get:function(){return this.Qd},set:function(a){this._isFrozen&&sn(this,a),this.Qd=a.J(),this.xe=null}},end:{get:function(){return this.Lk},set:function(a){this._isFrozen&&sn(this,a),this.Lk=a.J(),this.xe=null}},startRadius:{get:function(){return this.Gr},set:function(a){this._isFrozen&&sn(this,a),0>a&&Dn(a,">= zero",Jo,"startRadius"),this.Gr=a,this.xe=null}},endRadius:{get:function(){return this.Xp},set:function(a){this._isFrozen&&sn(this,a),0>a&&Dn(a,">= zero",Jo,"endRadius"),this.Xp=a,this.xe=null}},colorStops:{get:function(){return this.we},set:function(a){this._isFrozen&&sn(this,a),this.we=a,this.xe=null}},pattern:{get:function(){return this.cr},set:function(a){this._isFrozen&&sn(this,a),this.cr=a,this.xe=null}}}),Jo.prototype.isDark=Jo.prototype.Gx,Jo.prototype.darkenBy=Jo.prototype.Wy,Jo.prototype.lightenBy=Jo.prototype.Vz,Jo.prototype.addColorStop=Jo.prototype.addColorStop;var Pg=216/24389,Oc=24389/27,Rc=[95.047,100,108.883],Eg=null,Ca=new fh,Wl=new fh,Gs=new fh,Ou=new fh,op=!1;Jo.className="Brush";var qd;Jo.Solid=qd=new en(Jo,"Solid",0);var Bd;Jo.Linear=Bd=new en(Jo,"Linear",1);var Cu;Jo.Radial=Cu=new en(Jo,"Radial",2);var ap;Jo.Pattern=ap=new en(Jo,"Pattern",4);var sp;Jo.Lab=sp=new en(Jo,"Lab",5);var i1;Jo.HSL=i1=new en(Jo,"HSL",6),Jo.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},Jo.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)},Jo.lighten=function(a){return $d(a)},Jo.lightenBy=$d,Jo.darken=function(a){return Sg(a)},Jo.darkenBy=Sg,Jo.mix=gh,Jo.isDark=Xh;function Ps(){this.xa="Base"}Ps.prototype.measure=function(){},Ps.prototype.Yz=function(a,y,x,E,b){a.measure(y,x,E,b)},Ps.prototype.arrange=function(){},Ps.prototype.Ly=function(a,y,x,E,b,z){a.arrange(y,x,E,b,z)},Ps.prototype.iA=function(a){a.Uj()},Ps.prototype.gc=function(){},kt.Object.defineProperties(Ps.prototype,{name:{get:function(){return this.xa},set:function(a){this.xa=a}},classType:{get:function(){return Xn}}}),Ps.prototype.remeasureObject=Ps.prototype.iA,Ps.prototype.arrangeElement=Ps.prototype.Ly,Ps.prototype.measureElement=Ps.prototype.Yz,Ps.className="PanelLayout";function Rm(){this.xa="Base"}Tt(Rm,Ps),Rm.prototype.measure=function(a,y,x,E,b,z,ee){var re=E.length;a=Md(a);for(var oe=0;oe<re;oe++){var le=E[oe];if(le.visible||le===a){var he=le.margin,ge=he.right+he.left;he=he.top+he.bottom,le.measure(y,x,z,ee);var xe=le.measuredBounds;ge=Math.max(xe.width+ge,0),he=Math.max(xe.height+he,0),xe=le.position.x;var Pe=le.position.y;isFinite(xe)||(xe=0),isFinite(Pe)||(Pe=0),le instanceof ao&&le.isGeometryPositioned&&(le=le.strokeWidth/2,xe-=le,Pe-=le),Uo(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,le=z.position.y;if(oe=isNaN(oe)?-a:oe-a,le=isNaN(le)?-x:le-x,z instanceof ao&&z.isGeometryPositioned){var he=z.strokeWidth/2;oe-=he,le-=he}z.visible&&z.arrange(oe+re.left,le+re.top,ee.width,ee.height)}};function jm(){this.xa="Base"}Tt(jm,Ps),jm.prototype.measure=function(a,y,x,E,b,z,ee){var re=E.length;y=Hi(),z=Md(a);for(var oe=0;oe<re;oe++){var le=E[oe];if(le.visible||le===z){var he=cl(le,!1);if(he!==Bn&&he!==or)y.push(le);else{le.measure(1/0,x,0,ee),he=le.margin,le=le.measuredBounds;var ge=Math.max(le.height+he.top+he.bottom,0);b.width+=Math.max(le.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));Mi(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 le=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,Xe=cl(he,!1);(isNaN(he.desiredSize.height)&&Xe===Gn||Xe===Br)&&(Ne=Math.max(x.height-Pe-Fe,0)),Pe=Ne+Pe+Fe,Fe=he.alignment,Fe.Xb()&&(Fe=a.defaultAlignment),Fe.sb()||(Fe=yo),ee&&(re-=ge.width+xe.left+xe.right),he.arrange(re+Fe.offsetX+xe.left,le+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"}Tt(zm,Ps),zm.prototype.measure=function(a,y,x,E,b,z){var ee=E.length;x=Hi();for(var re=Md(a),oe=0;oe<ee;oe++){var le=E[oe];if(le.visible||le===re){var he=cl(le,!1);if(he!==Bn&&he!==Br)x.push(le);else{var ge=le.margin;he=ge.right+ge.left,ge=ge.top+ge.bottom,le.measure(y,1/0,z,0),le=le.measuredBounds,To(b,Math.max(b.width,Math.max(le.width+he,0)),b.height+Math.max(le.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)&&(le=oe.margin,ee=le.right+le.left,le=le.top+le.bottom,oe.measure(y,1/0,z,0),oe=oe.measuredBounds,le=Math.max(oe.height+le,0),b.width=Math.max(b.width,Math.max(oe.width+ee,0)),b.height+=le);Mi(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 le=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,Xe=cl(he,!1);(isNaN(he.desiredSize.width)&&Xe===Gn||Xe===or)&&(Ne=Math.max(x.width-Pe-Fe,0)),Pe=Ne+Pe+Fe,Fe=he.alignment,Fe.Xb()&&(Fe=a.defaultAlignment),Fe.sb()||(Fe=yo),ee&&(re-=ge.height+xe.bottom+xe.top),he.arrange(le+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"}Tt(Zm,Ps),Zm.prototype.measure=function(a,y,x,E,b,z,ee){var re=E.length,oe=a.Pb(),le=oe.margin,he=le.right+le.left,ge=le.top+le.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,Xe=zt.allocAt(-le.left,-le.top,Pe,Fe),Ve=zt.allocAt(0,0,z,ee);Ev(oe,Ve,!0),z=Ve.width,ee=Ve.height;for(var st=!0,ht=Md(a),pt=0;pt<re;pt++){var Et=E[pt];xe=y;var Gt=x;if(Et!==oe&&(Et.visible||Et===ht)){le=Et.margin;var xi=le.left,Ki=le.top;switch(Pe=le.right+le.left,Fe=le.top+le.bottom,le=cl(Et,!1),le){case Gn:xe=z,Gt=ee,Ki=xi=Fe=Pe=0;break;case or:xe=z,xi=Pe=0;break;case Br:Gt=ee,Ki=Fe=0}Et.measure(xe,Gt,0,0),xe=Et.measuredBounds,Pe=Math.max(xe.width+Pe,0),Fe=Math.max(xe.height+Fe,0),le=Et.alignment,le.Xb()&&(le=a.defaultAlignment),le.sb()||(le=yo);var ji=Et.alignmentFocus;if(ji.Xb()&&(ji=yo),Gt=null,Et instanceof Xn&&Et.$e!==""&&(Gt=Et.fb(Et.$e),Gt===Et&&(Gt=null)),xi=Ve.x-xi,Ki=Ve.y-Ki,Gt!==null){for(Et.arrange(0,0,xe.width,xe.height),xe=Gt.actualBounds,xe=_e.allocAt(xe.x+(ji.x*xe.width-ji.offsetX),xe.y+(ji.y*xe.height-ji.offsetY)),Gt=Gt.panel;Gt!==Et;)Gt.transform.Ga(xe),Gt=Gt.panel;xi+=le.x*z+le.offsetX-xe.x,Ki+=le.y*ee+le.offsetY-xe.y,_e.free(xe)}else xi+=le.x*z+le.offsetX-(ji.x*xe.width+ji.offsetX),Ki+=le.y*ee+le.offsetY-(ji.y*xe.height+ji.offsetY);st?(st=!1,b.h(xi,Ki,Pe,Fe)):Uo(b,xi,Ki,Pe,Fe)}}switch(st?b.assign(Xe):Ne?b.Uu(Ve.x,Ve.y,Ve.width,Ve.height):Uo(b,Xe.x,Xe.y,Xe.width,Xe.height),zt.free(Xe),zt.free(Ve),le=oe.stretch,le===Jr&&(le=cl(oe,!1)),le){case Bn:return;case Gn:if(!isFinite(y)&&!isFinite(x))return;break;case or: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),le=oe.margin,Ve=zt.allocAt(-le.left,-le.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!==ht||(le=x.margin,Pe=le.right+le.left,Fe=le.top+le.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=yo),x=x.alignmentFocus,x.Xb()&&(x=yo),st?(st=!1,b.h(he.x*z+he.offsetX-(x.x*xe.width+x.offsetX)-le.left,he.y*ee+he.offsetY-(x.y*xe.height+x.offsetY)-le.top,Pe,Fe)):Uo(b,he.x*z+he.offsetX-(x.x*xe.width+x.offsetX)-le.left,he.y*ee+he.offsetY-(x.y*xe.height+x.offsetY)-le.top,Pe,Fe));st?b.assign(Xe):Ne?b.Uu(Ve.x,Ve.y,Ve.width,Ve.height):Uo(b,Xe.x,Xe.y,Xe.width,Xe.height),zt.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 le=z-x.x,he=oe-x.y;for(b.arrange(le,he,ee,re),ee=zt.allocAt(0,0,ee,re),Ev(b,ee,!1),re=0;re<E;re++){var ge=y[re];if(ge!==b){le=ge.measuredBounds;var xe=le.width,Pe=le.height;he=ge.alignment,he.Xb()&&(he=a.defaultAlignment),he.sb()||(he=yo);var Fe=ge.alignmentFocus;if(Fe.Xb()&&(Fe=yo),le=null,ge instanceof Xn&&ge.$e!==""&&(le=ge.fb(ge.$e),le===ge&&(le=null)),le!==null){var Ne=le.actualBounds;for(Fe=_e.allocAt(Ne.x+(Fe.x*Ne.width-Fe.offsetX),Ne.y+(Fe.y*Ne.height-Fe.offsetY)),le=le.panel;le!==ge;)le.transform.Ga(Fe),le=le.panel;le=he.x*ee.width+he.offsetX-Fe.x,he=he.y*ee.height+he.offsetY-Fe.y,_e.free(Fe)}else le=he.x*ee.width+he.offsetX-(Fe.x*xe+Fe.offsetX),he=he.y*ee.height+he.offsetY-(Fe.y*Pe+Fe.offsetY);le+=ee.x-x.x,he+=ee.y-x.y,ge.visible&&ge.arrange(z+le,oe+he,xe,Pe)}}zt.free(ee)};function Ev(a,y,x){var E=null;if(a instanceof Xn&&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"}Tt(Gm,Ps),Gm.prototype.measure=function(a,y,x,E,b,z,ee){var re=E.length,oe=a.Pb(),le=oe.margin,he=y,ge=x,xe=le.right+le.left,Pe=le.top+le.bottom;oe.measure(y,x,z,ee),le=oe.measuredBounds;var Fe=0,Ne=null;oe instanceof ao&&(Ne=oe,Fe=Ne.strokeWidth*Ne.scale);var Xe=Math.max(le.width+xe,0);le=Math.max(le.height+Pe,0);var Ve=Lv(oe),st=Ve.x*Xe+Ve.offsetX;Ve=Ve.y*le+Ve.offsetY;var ht=Bv(oe),pt=ht.x*Xe+ht.offsetX;for(ht=ht.y*le+ht.offsetY,isFinite(y)&&(he=Math.max(Math.abs(st-pt)-Fe,0)),isFinite(x)&&(ge=Math.max(Math.abs(Ve-ht)-Fe,0)),Fe=bn.alloc(),Fe.h(0,0),a=Md(a),ht=0;ht<re;ht++)Ve=E[ht],Ve===oe||!Ve.visible&&Ve!==a||(le=Ve.margin,Xe=le.right+le.left,st=le.top+le.bottom,Ve.measure(he,ge,0,0),le=Ve.measuredBounds,Xe=Math.max(le.width+Xe,0),le=Math.max(le.height+st,0),Fe.h(Math.max(Xe,Fe.width),Math.max(le,Fe.height)));if(re===1)b.width=Xe,b.height=le,bn.free(Fe);else{switch(Ve=Lv(oe),ht=Bv(oe),re=E=0,ht.x!==Ve.x&&ht.y!==Ve.y&&(E=Fe.width/Math.abs(ht.x-Ve.x),re=Fe.height/Math.abs(ht.y-Ve.y)),bn.free(Fe),Fe=0,Ne!==null&&(Fe=Ne.strokeWidth*Ne.scale,Tv(Ne)===Ji&&(E=re=Math.max(E,re))),E+=Math.abs(Ve.offsetX)+Math.abs(ht.offsetX)+Fe,re+=Math.abs(Ve.offsetY)+Math.abs(ht.offsetY)+Fe,Ne=oe.stretch,Ne===Jr&&(Ne=cl(oe,!1)),Ne){case Bn:ee=z=0;break;case Gn:isFinite(y)&&(E=y),isFinite(x)&&(re=x);break;case or: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=zt.alloc();z.h(0,0,1,1);var ee=E.margin,re=ee.left;ee=ee.top;var oe=a.padding,le=oe.left;oe=oe.top,E.arrange(le+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,Uo(z,Pe,ge,0,0),z.x+=re+le,z.y+=ee+oe,b=0;b<x;b++)re=y[b],re!==E&&(le=re.measuredBounds,ee=re.margin,oe=Math.max(le.width+ee.right+ee.left,0),he=Math.max(le.height+ee.top+ee.bottom,0),xe=re.alignment,xe.Xb()&&(xe=a.defaultAlignment),xe.sb()||(xe=yo),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,le.width,le.height)?re.arrange(oe,ee,le.width,le.height):re.arrange(oe,ee,le.width,le.height,new zt(z.x,z.y,z.width,z.height))));zt.free(z)};function Hm(){this.xa="Base",this.name="Table"}Tt(Hm,Ps),Hm.prototype.measure=function(a,y,x,E,b){for(var z=E.length,ee=Hi(),re=Hi(),oe=0;oe<z;oe++){var le=E[oe],he=le instanceof Xn?le:null;if(he!==null&&ec(he)&&le.visible){re.push(he);for(var ge=he.O.s,xe=ge.length,Pe=0;Pe<xe;Pe++){var Fe=ge[Pe];he.type===Xn.TableRow?Fe.row=le.row:he.type===Xn.TableColumn&&(Fe.column=le.column),ee.push(Fe)}}else ee.push(le)}z=ee.length,z===0&&(a.Fb(0),a.Eb(0));for(var Ne=[],Xe=0;Xe<z;Xe++){var Ve=ee[Xe];Ve.visible&&($e(Ve,!0),xt(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))}Mi(ee);var st=Hi(),ht=Hi(),pt=Hi(),Et={count:0},Gt={count:0},xi=y,Ki=x,ji=a.rowDefs,ei=a.colDefs,En=null;z=ji.length;for(var Qr=0;Qr<z;Qr++)En=ji[Qr],En!==void 0&&(En.actual=0);z=ei.length;for(var Gr=0;Gr<z;Gr++)En=ei[Gr],En!==void 0&&(En.actual=0);for(var oa=Ne.length,La=0,Ms=0;Ms<oa;Ms++)Ne[Ms]&&(La=Math.max(La,Ne[Ms].length));var Ds=Math.min(a.topIndex,oa-1),gl=Math.min(a.leftIndex,La-1),ks=0;oa=Ne.length;for(var hc=Md(a),gs=0;gs<oa;gs++)if(Ne[gs]){La=Ne[gs].length;var xh=a.Fb(gs);xh.actual=0;for(var pl=xh.oc=0;pl<La;pl++)if(Ne[gs][pl]){var dc=a.Eb(pl);st[pl]===void 0&&(dc.actual=0,dc.oc=0,st[pl]=!0);for(var pu=Ne[gs][pl],Zu=pu.length,eu=0;eu<Zu;eu++){var Kl=pu[eu];if(Kl.visible||Kl===hc){var $c=1<Kl.rowSpan||1<Kl.columnSpan;$c&&(gs<Ds||pl<gl||ht.push(Kl));var Sh=Kl.margin,kp=Sh.right+Sh.left,tu=Sh.top+Sh.bottom,ml=Iu(Kl,xh,dc,!1),Mm=Kl.desiredSize,_g=!isNaN(Mm.height),Nh=!isNaN(Mm.width)&&_g;if($c||ml===Bn||Nh||gs<Ds||pl<gl||(Et[pl]!==void 0||ml!==Gn&&ml!==or||(Et[pl]=-1,Et.count++),Gt[gs]!==void 0||ml!==Gn&&ml!==Br||(Gt[gs]=-1,Gt.count++),pt.push(Kl)),Kl.measure(1/0,1/0,0,0),!(gs<Ds||pl<gl)){var Ul=Kl.measuredBounds,zf=Math.max(Ul.width+kp,0),nu=Math.max(Ul.height+tu,0);if(Kl.rowSpan===1&&(ml===Bn||ml===or)){En=a.Fb(gs);var qc=En.Wc();ks=Math.max(nu-En.actual,0),ks+qc>Ki&&(ks=Math.max(Ki-qc,0));var cv=En.oa===0;En.oc=En.oc+ks,En.actual=En.oa+ks,Ki=Math.max(Ki-(ks+(cv?qc:0)),0)}if(Kl.columnSpan===1&&(ml===Bn||ml===Br)){En=a.Eb(pl);var km=En.Wc();ks=Math.max(zf-En.actual,0),ks+km>xi&&(ks=Math.max(xi-km,0));var Jy=En.oa===0;En.oc=En.oc+ks,En.actual=En.oa+ks,xi=Math.max(xi-(ks+(Jy?km:0)),0)}$c&&Kl.Uj()}}}}}Mi(st);var rd=0,Nd=0;z=a.columnCount;for(var Ig=0;Ig<z;Ig++){var ef=ei[Ig];ef!==void 0&&(rd+=isNaN(ef.Hc)?ef.oc:ef.Hc,ef.oc!==0&&(rd+=ef.Wc()))}z=a.rowCount;for(var Ap=0;Ap<z;Ap++){var tf=ji[Ap];tf!==void 0&&(Nd+=isNaN(tf.Hc)?tf.oc:tf.Hc,tf.oc!==0&&(Nd+=tf.Wc()))}xi=Math.max(y-rd,0);var od=Ki=Math.max(x-Nd,0),cc=xi;z=pt.length;for(var Yl=0;Yl<z;Yl++){var Dh=pt[Yl],fv=a.Fb(Dh.row),Dd=a.Eb(Dh.column),Np=Dh.measuredBounds,wh=Dh.margin,Zf=wh.right+wh.left,Th=wh.top+wh.bottom;Et[Dh.column]=Dd.oc===0&&Et[Dh.column]!==void 0?Math.max(Np.width+Zf,Et[Dh.column]):null,Gt[Dh.row]=fv.oc===0&&Gt[Dh.row]!==void 0?Math.max(Np.height+Th,Gt[Dh.row]):null}var Og=0,Dp=0,th;for(th in Gt)th!=="count"&&(Og+=Gt[th]);for(th in Et)th!=="count"&&(Dp+=Et[th]);for(var Ws=bn.alloc(),Am=0;Am<z;Am++){var bl=pt[Am];if(bl.visible||bl===hc){var ps=a.Fb(bl.row),Fl=a.Eb(bl.column),Td=0;isFinite(Fl.width)?Td=Fl.width:(isFinite(xi)&&Et[bl.column]!==null?Dp===0?Td=Fl.actual+xi:Td=Et[bl.column]/Dp*cc:Et[bl.column]!==null?Td=xi:Td=Fl.actual||xi,Td=Math.max(0,Td-Fl.Wc()));var fc=0;switch(isFinite(ps.height)?fc=ps.height:(isFinite(Ki)&&Gt[bl.row]!==null?Og===0?fc=ps.actual+Ki:fc=Gt[bl.row]/Og*od:Gt[bl.row]!==null?fc=Ki:fc=ps.actual||Ki,fc=Math.max(0,fc-ps.Wc())),Ws.h(Math.max(Fl.minimum,Math.min(Td,Fl.maximum)),Math.max(ps.minimum,Math.min(fc,ps.maximum))),ml=Iu(bl,ps,Fl,!1),ml){case or:Ws.height=Math.max(Ws.height,ps.actual+Ki);break;case Br:Ws.width=Math.max(Ws.width,Fl.actual+xi)}var Gf=bl.margin,Qy=Gf.right+Gf.left,gv=Gf.top+Gf.bottom;bl.Uj(),bl.measure(Ws.width,Ws.height,Fl.minimum,ps.minimum);var Tp=bl.measuredBounds,Hf=Math.max(Tp.width+Qy,0),Rg=Math.max(Tp.height+gv,0);isFinite(xi)&&(Hf=Math.min(Hf,Ws.width)),isFinite(Ki)&&(Rg=Math.min(Rg,Ws.height));var Xl=0;Xl=ps.actual,ps.actual=Math.max(ps.actual,Rg),ps.oc=Math.max(ps.oc,Rg),ks=ps.actual-Xl,Ki=Math.max(Ki-ks,0),Gt[bl.row]===null&&(od=Math.max(od-ks,0)),Xl=Fl.actual,Fl.actual=Math.max(Fl.actual,Hf),Fl.oc=Math.max(Fl.oc,Hf),ks=Fl.actual-Xl,xi=Math.max(xi-ks,0),Et[bl.column]===null&&(cc=Math.max(cc-ks,0))}}Mi(pt);var _d=bn.alloc(),Ph=Hi(),Mu=Hi();if(z=ht.length,z!==0){for(var nf=0;nf<oa;nf++)if(Ne[nf]){La=Ne[nf].length;var _p=a.Fb(nf);Ph[nf]=_p.actual;for(var rf=0;rf<La;rf++)if(Ne[nf][rf]){var pv=a.Eb(rf);Mu[rf]=pv.actual}}}for(var Ip=0;Ip<z;Ip++){var os=ht[Ip];if(os.visible||os===hc){var nh=a.Fb(os.row),Gu=a.Eb(os.column);switch(Ws.h(Math.max(Gu.minimum,Math.min(y,Gu.maximum)),Math.max(nh.minimum,Math.min(x,nh.maximum))),ml=Iu(os,nh,Gu,!1),ml){case Gn:Mu[Gu.index]!==0&&(Ws.width=Math.min(Ws.width,Mu[Gu.index])),Ph[nh.index]!==0&&(Ws.height=Math.min(Ws.height,Ph[nh.index]));break;case or:Mu[Gu.index]!==0&&(Ws.width=Math.min(Ws.width,Mu[Gu.index]));break;case Br:Ph[nh.index]!==0&&(Ws.height=Math.min(Ws.height,Ph[nh.index]))}isFinite(Gu.width)&&(Ws.width=Gu.width),isFinite(nh.height)&&(Ws.height=nh.height),_d.h(0,0);for(var mv=Gu.minimum,iu=nh.minimum,gc=1;gc<os.rowSpan&&!(os.row+gc>=a.rowCount);gc++)En=a.Fb(os.row+gc),ks=0,ks=ml===Gn||ml===Br?Math.max(En.minimum,Ph[os.row+gc]===0?En.maximum:Math.min(Ph[os.row+gc],En.maximum)):Math.max(En.minimum,isNaN(En.Hc)?En.maximum:Math.min(En.Hc,En.maximum)),_d.height+=ks,iu+=En.minimum;for(var Hu=1;Hu<os.columnSpan&&!(os.column+Hu>=a.columnCount);Hu++)En=a.Eb(os.column+Hu),ks=0,ks=ml===Gn||ml===or?Math.max(En.minimum,Mu[os.column+Hu]===0?En.maximum:Math.min(Mu[os.column+Hu],En.maximum)):Math.max(En.minimum,isNaN(En.Hc)?En.maximum:Math.min(En.Hc,En.maximum)),_d.width+=ks,mv+=En.minimum;Ws.width+=_d.width,Ws.height+=_d.height;var Op=os.margin,of=Op.right+Op.left,Nm=Op.top+Op.bottom;os.measure(Ws.width,Ws.height,mv,iu);for(var Rp=os.measuredBounds,_h=Math.max(Rp.width+of,0),Wf=Math.max(Rp.height+Nm,0),af=0,jp=0;jp<os.rowSpan&&!(os.row+jp>=a.rowCount);jp++)En=a.Fb(os.row+jp),af+=En.total||0;if(af<Wf){var pc=Wf-af,ad=Wf-af;if(os.spanAllocation!==null)for(var mc=os.spanAllocation,Id=0;Id<os.rowSpan&&!(0>=pc)&&!(os.row+Id>=a.rowCount);Id++){En=a.Fb(os.row+Id);var vc=En.oa||0,Vf=mc(os,En,ad);En.actual=Math.min(En.maximum,vc+Vf),En.oa!==vc&&(pc-=En.oa-vc)}for(;0<pc;){var Eh=En.oa||0;if(isNaN(En.height)&&En.maximum>Eh&&(En.actual=Math.min(En.maximum,Eh+pc),En.oa!==Eh&&(pc-=En.oa-Eh)),En.index===0)break;En=a.Fb(En.index-1)}}for(var jg=0,yc=0;yc<os.columnSpan&&!(os.column+yc>=a.columnCount);yc++)En=a.Eb(os.column+yc),jg+=En.total||0;if(jg<_h){var zg=_h-jg,$y=_h-jg;if(os.spanAllocation!==null)for(var Od=os.spanAllocation,Kf=0;Kf<os.columnSpan&&!(0>=zg)&&!(os.column+Kf>=a.columnCount);Kf++){En=a.Eb(os.column+Kf);var Dm=En.oa||0,qy=Od(os,En,$y);En.actual=Math.min(En.maximum,Dm+qy),En.oa!==Dm&&(zg-=En.oa-Dm)}for(;0<zg;){var vv=En.oa||0;if(isNaN(En.width)&&En.maximum>vv&&(En.actual=Math.min(En.maximum,vv+zg),En.oa!==vv&&(zg-=En.oa-vv)),En.index===0)break;En=a.Eb(En.index-1)}}}}Mi(ht),bn.free(_d),bn.free(Ws),Ph!==void 0&&Mi(Ph),Mu!==void 0&&Mi(Mu);var Zg=0,Gg=0,yv=a.desiredSize,pS=a.maxSize;ml=cl(a,!0);var Tm=Nd=rd=0,_m=0;z=a.columnCount;for(var xv=0;xv<z;xv++)ei[xv]!==void 0&&(En=a.Eb(xv),isFinite(En.width)?(Tm+=En.width,Tm+=En.Wc()):qm(En)===Kp?(Tm+=En.oa,Tm+=En.Wc()):En.oa!==0&&(rd+=En.oa,rd+=En.Wc()));isFinite(yv.width)?Zg=Math.min(yv.width,pS.width):Zg=ml!==Bn&&isFinite(y)?y:rd,Zg=Math.max(Zg,a.minSize.width),Zg=Math.max(Zg-Tm,0);for(var QS=rd===0?1:Math.max(Zg/rd,1),Sv=0;Sv<z;Sv++)ei[Sv]!==void 0&&(En=a.Eb(Sv),isFinite(En.width)||qm(En)===Kp||(En.actual=En.oa*QS),En.position=b.width,En.oa!==0&&(b.width+=En.oa,b.width+=En.Wc()));z=a.rowCount;for(var wv=0;wv<z;wv++)ji[wv]!==void 0&&(En=a.Fb(wv),isFinite(En.height)?(_m+=En.height,_m+=En.Wc()):qm(En)===Kp?(_m+=En.oa,_m+=En.Wc()):En.oa!==0&&(Nd+=En.oa,Nd+=En.Wc()));isFinite(yv.height)?Gg=Math.min(yv.height,pS.height):Gg=ml!==Bn&&isFinite(x)?x:Nd,Gg=Math.max(Gg,a.minSize.height),Gg=Math.max(Gg-_m,0);for(var $S=Nd===0?1:Math.max(Gg/Nd,1),Pv=0;Pv<z;Pv++)ji[Pv]!==void 0&&(En=a.Fb(Pv),isFinite(En.height)||qm(En)===Kp||(En.actual=En.oa*$S),En.position=b.height,En.oa!==0&&(b.height+=En.oa,b.height+=En.Wc()));z=re.length;for(var e1=0;e1<z;e1++){var Im=re[e1],t1=0,n1=0;Im.type===Xn.TableRow?(t1=b.width,En=a.Fb(Im.row),n1=En.actual):(En=a.Eb(Im.column),t1=En.actual,n1=b.height),Im.measuredBounds.h(0,0,t1,n1),$e(Im,!1)}Mi(re),a.inRowsCols=Ne},Hm.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,le=ee.length,he=0,ge=0;ge<le;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,le-1);if(0<oe.length){for(;Pe!==le&&(oe[Pe]===void 0||oe[Pe].oa===0);)Pe++;Pe=Math.max(Math.min(Pe,le-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,Xe=0;Ne!==le&&oe[Ne]===void 0;)Ne++;for(;Xe!==le&&re[Xe]===void 0;)Xe++;he=a.part,a.Fb(Ne),a.Eb(Xe);for(var Ve=0;Ve<y.length;Ve++){var st=y[Ve];if(st instanceof Xn&&st.visible&&ec(st)){if(st.type===Xn.TableRow){re=a.Fb(st.row);var ht=a.Eb(Xe)}else re=a.Fb(Ne),ht=a.Eb(st.column);oe=re.position+ge+b,re.oa!==0&&(oe+=re.Io(Math.max(Ne,Pe))),re=ht.position+xe+z,ht.oa!==0&&(re+=ht.Io(Math.max(Xe,Fe))),ht=st.measuredBounds,st.Uk(),st.actualBounds.ka();var pt=st.actualBounds,Et=zt.allocAt(pt.x,pt.y,pt.width,pt.height);pt.x=st.type===Xn.TableRow?z:re,pt.y=st.type===Xn.TableColumn?b:oe,pt.width=ht.width,pt.height=ht.height,st.actualBounds.freeze(),xt(st,!1),Zo(Et,pt)||he===null||(he.oh(),st.Pn(he)),zt.free(Et)}}for(Ve=bn.alloc(),st=0;st<le;st++)if(ee[st]){for(he=ee[st].length,ht=a.Fb(st),oe=ht.position+ge+b,ht.oa!==0&&(oe+=ht.Io(Math.max(Ne,Pe))),pt=0;pt<he;pt++)if(ee[st][pt]){Et=a.Eb(pt),re=Et.position+xe+z,Et.oa!==0&&(re+=Et.Io(Math.max(Xe,Fe)));for(var Gt=ee[st][pt],xi=Gt.length,Ki=0;Ki<xi;Ki++){var ji=Gt[Ki],ei=ji.measuredBounds;Ve.h(0,0);for(var En=1;En<ji.rowSpan&&!(st+En>=a.rowCount);En++){var Qr=a.Fb(st+En);Qr.oa!==0&&(Ve.height+=Qr.total)}for(En=1;En<ji.columnSpan&&!(pt+En>=a.columnCount);En++)Qr=a.Eb(pt+En),Qr.oa!==0&&(Ve.width+=Qr.total);var Gr=Et.oa+Ve.width,oa=ht.oa+Ve.height;En=re,Qr=oe;var La=Gr,Ms=oa,Ds=re,gl=oe,ks=Gr,hc=oa;re+Gr>x.width&&(ks=Math.max(x.width-re,0)),oe+oa>x.height&&(hc=Math.max(x.height-oe,0));var gs=ji.alignment;if(gs.Xb()){gs=a.defaultAlignment,gs.sb()||(gs=yo);var xh=gs.x,pl=gs.y,dc=gs.offsetX;gs=gs.offsetY;var pu=Et.alignment,Zu=ht.alignment;pu.sb()&&(xh=pu.x,dc=pu.offsetX),Zu.sb()&&(pl=Zu.y,gs=Zu.offsetY)}else xh=gs.x,pl=gs.y,dc=gs.offsetX,gs=gs.offsetY;(isNaN(xh)||isNaN(pl))&&(pl=xh=.5,gs=dc=0),pu=ei.width,Zu=ei.height;var eu=ji.margin,Kl=eu.left+eu.right,$c=eu.top+eu.bottom,Sh=Iu(ji,ht,Et,!1);!isNaN(ji.desiredSize.width)||Sh!==Gn&&Sh!==or||(pu=Math.max(Gr-Kl,0)),!isNaN(ji.desiredSize.height)||Sh!==Gn&&Sh!==Br||(Zu=Math.max(oa-$c,0)),Gr=ji.maxSize,oa=ji.minSize,pu=Math.min(Gr.width,pu),Zu=Math.min(Gr.height,Zu),pu=Math.max(oa.width,pu),Zu=Math.max(oa.height,Zu),Gr=Zu+$c,En+=La*xh-(pu+Kl)*xh+dc+eu.left,Qr+=Ms*pl-Gr*pl+gs+eu.top,ji.visible&&(Fo(Ds,gl,ks,hc,En,Qr,ei.width,ei.height)?ji.arrange(En,Qr,pu,Zu):ji.arrange(En,Qr,pu,Zu,new zt(Ds,gl,ks,hc)))}}}for(bn.free(Ve),a=0;a<E;a++)x=y[a],z=x instanceof Xn?x:null,z!==null&&ec(z)&&(z=x.actualBounds,x.naturalBounds.ka(),x.naturalBounds.h(0,0,z.width,z.height),x.naturalBounds.freeze())}};function Wm(){this.xa="Base"}Tt(Wm,Ps),Wm.prototype.measure=function(){},Wm.prototype.arrange=function(){};function Vm(){this.xa="Base"}Tt(Vm,Ps),Vm.prototype.measure=function(){},Vm.prototype.arrange=function(){};function Km(){this.xa="Base"}Tt(Km,Ps),Km.prototype.measure=function(a,y,x,E,b,z,ee){1<E.length&&it("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,le=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-le,0),Pe=Math.max(x-oe,0),Fe=1;a.viewboxStretch===Ji?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&&($e(E,!0),E.measure(1/0,1/0,z,ee))}re=E.measuredBounds,b.width=isFinite(y)?y:Math.max(re.width+le,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=yo),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 Hp(){this.xa="Base"}Tt(Hp,Ps),Hp.prototype.measure=function(){},Hp.prototype.arrange=function(){},Hp.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,le=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,Xe=0;Xe<Ne;Xe++){var Ve=Fe[Xe],st=[];if(Pe.push(st),Ve.visible){var ht=Ve.interval;if(!(0>ht)){Ve=bv(Ve.figure);for(var pt=0;pt<Ne;pt++)if(pt!==Xe){var Et=Fe[pt];Et.visible&&bv(Et.figure)===Ve&&(Et=Et.interval,Et>ht&&st.push(Et))}}}}for(Fe=a.O.s,Ne=Fe.length,Xe=0;Xe<Ne;Xe++){var Gt=Fe[Xe];if(Gt.visible&&(st=Gt.interval||1,Ve=Math.abs(st),!(2>b*Ve*x))){if(ht=Gt.segmentIndex,(!isFinite(ht)||isNaN(ht))&&(ht=0),0>ht&&(ht=Ve-Math.min(-ht,Ve)),ht=Math.round(ht%Ve),Ve=Gt.opacity,pt=1,Ve!==1){if(Ve===0)continue;pt=y.globalAlpha,y.globalAlpha=pt*Ve}Et=Pe[Xe];var xi=!1,Ki=Gt.strokeDashArray;if(Ki!==null&&(xi=!0,y.js(Ki,Gt.strokeDashOffset)),Gt.figure==="LineV"&&Gt.stroke!==null&&0<Gt.strokeWidth){for(y.lineWidth=Gt.strokeWidth,Ya(a,y,Gt.stroke,!1,!1,z,ee),y.beginPath(),Ki=Gt=Math.floor((xe-b)/b);Ki<=Gt+le;Ki++){var ji=Ki*b+xe;0<=ji&&ji<=re&&Um(Ki,st,ht,Et)&&(y.moveTo(ji,0),y.lineTo(ji,oe))}y.stroke(),y.Se()}else if(Gt.figure==="LineH"&&Gt.stroke!==null&&0<Gt.strokeWidth){for(y.lineWidth=Gt.strokeWidth,Ya(a,y,Gt.stroke,!1,!1,z,ee),y.beginPath(),Ki=Gt=Math.floor((ge-E)/E);Ki<=Gt+he;Ki++)ji=Ki*E+ge,0<=ji&&ji<=oe&&Um(Ki,st,ht,Et)&&(y.moveTo(0,ji),y.lineTo(re,ji));y.stroke(),y.Se()}else if(Gt.figure==="BarV"&&Gt.fill!==null)for(Ya(a,y,Gt.fill,!0,!1,z,ee),Gt=Gt.width,isNaN(Gt)&&(Gt=b),ji=Ki=Math.floor((xe-b)/b);ji<=Ki+le;ji++){var ei=ji*b+xe;0<=ei+Gt&&ei<=re&&Um(ji,st,ht,Et)&&y.fillRect(ei,0,Gt,oe)}else if(Gt.figure==="BarH"&&Gt.fill!==null)for(Ya(a,y,Gt.fill,!0,!1,z,ee),Gt=Gt.height,isNaN(Gt)&&(Gt=E),ji=Ki=Math.floor((ge-E)/E);ji<=Ki+he;ji++)ei=ji*E+ge,0<=ei+Gt&&ei<=oe&&Um(ji,st,ht,Et)&&y.fillRect(0,ei,re,Gt);xi&&y.fs(),Ve!==1&&(y.globalAlpha=pt)}}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"}Tt(Ym,Ps),Ym.prototype.measure=function(a,y,x,E,b){var z=E.length;if(a instanceof $o||a instanceof ti){var ee=null,re=null;if(a instanceof ti&&(ee=a),a instanceof $o&&(re=a,ee=re.adornedPart,a.j===null&&(a.j=[])),ee instanceof ti){var oe=ee;if(z===0)To(a.naturalBounds,0,0),a.measuredBounds.h(0,0,0,0);else{var le=a instanceof $o?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,le!==null){r1(a,re,xe,le);var Fe=le.measuredBounds;x.ed(Fe),Pe.push(Fe)}Fe=Pt.alloc();for(var Ne=_e.alloc(),Xe=_e.alloc(),Ve=0;Ve<z;Ve++){var st=E[Ve];if(st!==le)if(st.isPanelMain&&st instanceof ao){r1(a,re,xe,st);var ht=st.measuredBounds;x.ed(ht),Pe.push(ht)}else if(2>ge)st.measure(1/0,1/0,0,0),ht=st.measuredBounds,x.ed(ht),Pe.push(ht);else{var pt=st.segmentIndex,Et=st.segmentFraction,Gt=st.alignmentFocus;Gt.Mc()&&(Gt=yo);var xi=st.segmentOrientation,Ki=st.segmentOffset;if(isNaN(pt)){var ji=oe.ua;ht=Hi(),ji.Qu(Et,ht);var ei=_e.allocAt(ht[0],ht[1]);if(ei.add(oe.i(0)),ji.type===Dt.j?ei.offset(-ji.startX,-ji.startY):(ji=ji.figures.first(),ji!==null&&ei.offset(-ji.startX,-ji.startY)),ji=ht[2],xi!==Sl){var En=oe.computeAngle(st,xi,ji);st.Kb=En}En=ei.x-y.x;var Qr=ei.y-y.y;_e.free(ei),Mi(ht)}else if(pt<-ge||pt>=ge)ht=_e.alloc(),oe.vg(),oe.computeMidPoint(ht),ji=oe.midAngle,xi!==Sl&&(En=oe.computeAngle(st,xi,ji),st.Kb=En),En=ht.x-y.x,Qr=ht.y-y.y,_e.free(ht);else{if(En=0,0<=pt?(Qr=he.M(pt),ht=pt<ge-1?he.M(pt+1):Qr):(En=ge+pt,Qr=he.M(En),ht=0<En?he.M(En-1):Qr),Qr.Xa(ht)){0<=pt?(ji=0<pt?he.M(pt-1):Qr,En=pt<ge-2?he.M(pt+2):ht):(ji=En<ge-1?he.M(En+1):Qr,En=1<En?he.M(En-2):ht),ei=ji.Bf(Qr);var Gr=ht.Bf(En);ji=ei>Gr+10?0<=pt?ji.ab(Qr):Qr.ab(ji):Gr>ei+10?0<=pt?ht.ab(En):En.ab(ht):0<=pt?ji.ab(En):En.ab(ji)}else ji=0<=pt?Qr.ab(ht):ht.ab(Qr);xi!==Sl&&(En=oe.computeAngle(st,xi,ji),st.Kb=En),En=Qr.x+(ht.x-Qr.x)*Et-y.x,Qr=Qr.y+(ht.y-Qr.y)*Et-y.y}st.measure(1/0,1/0,0,0),ht=st.measuredBounds,ei=st.naturalBounds;var oa=0;st instanceof ao&&(oa=st.strokeWidth),Gr=ei.width+oa;var La=ei.height+oa;Fe.reset(),Fe.translate(-ht.x,-ht.y),Fe.scale(st.scale,st.scale),Fe.rotate(xi===Sl?st.angle:ji,Gr/2,La/2),xi!==nm&&xi!==rm||Fe.rotate(90,Gr/2,La/2),xi!==im&&xi!==om||Fe.rotate(-90,Gr/2,La/2),xi===C0&&(45<ji&&135>ji||225<ji&&315>ji)&&Fe.rotate(-ji,Gr/2,La/2),ei=new zt(0,0,Gr,La),Ne.xi(ei,Gt),Fe.Ga(Ne),Gt=-Ne.x+oa/2*st.scale,st=-Ne.y+oa/2*st.scale,Xe.assign(Ki),oa=isNaN(Ki.x);var Ms=isNaN(Ki.y);if(oa||Ms){Gr=Gr/2+3,La=La/2+3;var Ds=45<=ji&&135>=ji,gl=225<=ji&&315>=ji;xi===Sl&&(Ds||gl)?(Xe.x=Ms?Gr:Ki.y,Xe.y=oa?La:Ki.x,Ds?0<=pt||isNaN(pt)&&.5>Et||!oa||(Xe.y=-La):gl&&((0<=pt||isNaN(pt)&&.5>Et)&&oa&&(Xe.y=-La),Ms&&(Xe.x=-Gr))):(oa&&(Xe.x=0<=pt||isNaN(pt)&&.5>Et?Gr:-Gr),Ms&&(Xe.y=-La),Xe.rotate(ji))}else Xe.rotate(ji);En+=Xe.x,Qr+=Xe.y,ei.set(ht),ei.h(En+Gt,Qr+st,ht.width,ht.height),Pe.push(ei),x.ed(ei)}}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),To(b,x.width||0,x.height||0),Pt.free(Fe),_e.free(Ne),_e.free(Xe)}}}},Ym.prototype.arrange=function(a,y){var x=y.length;if(a instanceof $o||a instanceof ti){var E=a,b=null;a instanceof $o&&(b=a,E=b.adornedPart);var z=a instanceof $o?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 le=y[oe];if(le!==z&&re<ee.length){var he=ee[re];re++,le.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 ti)for(z=a.labelNodes;z.next();){var ge=a;ee=z.value,re=ee.segmentIndex,oe=ee.segmentFraction;var xe=ee.alignmentFocus;if(le=ee.segmentOrientation,he=ee.segmentOffset,isNaN(re)){var Pe=ge.ua,Fe=Hi();Pe.Qu(oe,Fe);var Ne=_e.allocAt(Fe[0],Fe[1]);Ne.add(ge.i(0)),Pe.type===Dt.j||(Pe=Pe.figures.first()),Ne.offset(-Pe.startX,-Pe.startY),Pe=Fe[2],le!==Sl&&(ge=ge.computeAngle(ee,le,Pe),ee.angle=ge),ge=Ne.x;var Xe=Ne.y;_e.free(Ne),Mi(Fe)}else if(re<-x||re>=x)Fe=_e.alloc(),Pe=ge,Xe=Fe,Pe.vg(),Pe.computeMidPoint(Xe),Pe=ge.midAngle,le!==Sl&&(ge=ge.computeAngle(ee,le,Pe),ee.angle=ge),ge=Fe.x,Xe=Fe.y,_e.free(Fe);else{if(Ne=0,0<=re?(Fe=y.s[re],Xe=re<x-1?y.s[re+1]:Fe):(Ne=x+re,Fe=y.s[Ne],Xe=0<Ne?y.s[Ne-1]:Fe),Fe.Xa(Xe)){0<=re?(Pe=0<re?y.s[re-1]:Fe,Ne=re<x-2?y.s[re+2]:Xe):(Pe=Ne<x-1?y.s[Ne+1]:Fe,Ne=1<Ne?y.s[Ne-2]:Xe);var Ve=Pe.Bf(Fe),st=Xe.Bf(Ne);Pe=Ve>st+10?0<=re?Pe.ab(Fe):Fe.ab(Pe):st>Ve+10?0<=re?Xe.ab(Ne):Ne.ab(Xe):0<=re?Pe.ab(Ne):Ne.ab(Pe)}else Pe=0<=re?Fe.ab(Xe):Xe.ab(Fe);le!==Sl&&(ge=ge.computeAngle(ee,le,Pe),ee.angle=ge),ge=Fe.x+(Xe.x-Fe.x)*oe,Xe=Fe.y+(Xe.y-Fe.y)*oe}if(xe.ys())ee.location=new _e(ge,Xe);else{xe.Mc()&&(xe=yo),Fe=Pt.alloc(),Fe.reset(),Fe.scale(ee.scale,ee.scale),Fe.rotate(ee.angle,0,0);var ht=ee.naturalBounds;Ne=zt.allocAt(0,0,ht.width,ht.height),Ve=_e.alloc(),Ve.xi(Ne,xe),Fe.Ga(Ve),xe=-Ve.x,st=-Ve.y;var pt=ht.width,Et=ht.height;ht=_e.alloc(),ht.assign(he);var Gt=isNaN(he.x),xi=isNaN(he.y);if(Gt||xi){pt=pt/2+3,Et=Et/2+3;var Ki=45<=Pe&&135>=Pe,ji=225<=Pe&&315>=Pe;le===Sl&&(Ki||ji)?(ht.x=xi?pt:he.y,ht.y=Gt?Et:he.x,Ki?0<=re||isNaN(re)&&.5>oe||!Gt||(ht.y=-Et):ji&&((0<=re||isNaN(re)&&.5>oe)&&Gt&&(ht.y=-Et),xi&&(ht.x=-pt))):(Gt&&(ht.x=0<=re||isNaN(re)&&.5>oe?pt:-pt),xi&&(ht.y=-Et),ht.rotate(Pe))}else ht.rotate(Pe);ge+=ht.x,Xe+=ht.y,Fe.pp(Ne),xe+=Ne.x,st+=Ne.y,re=_e.allocAt(ge+xe,Xe+st),ee.move(re),_e.free(re),_e.free(ht),_e.free(Ve),zt.free(Ne),Pt.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),_e.free(E)}};function r1(a,y,x,E){if(qe(E)!==!1){var b=E.strokeWidth;b===0&&a instanceof $o&&a.type===Xn.Link&&a.adornedObject instanceof ao&&(b=a.adornedObject.strokeWidth),b*=E.Ca,a instanceof ti&&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 $o&&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),$e(E,!1)}}function Wp(){this.xa="Base"}Tt(Wp,Ps),Wp.prototype.measure=function(a,y,x,E,b,z,ee){var re=a.Pb();a.graduatedBounds=[];var oe=re.margin,le=oe.right+oe.left,he=oe.top+oe.bottom;re.measure(y,x,z,ee);var ge=re.measuredBounds,xe=new zt(-oe.left,-oe.top,Math.max(ge.width+le,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,Xe=Pe.flattenedLengths,Ve=Pe.flattenedTotalLength,st=Ne.length,ht=0,pt=0,Et=Hi(),Gt=0;Gt<st;Gt++){var xi=Ne[Gt],Ki=[];pt=ht=0;for(var ji=xi.length,ei=0;ei<ji;ei+=2){var En=xi[ei],Qr=xi[ei+1];if(ei!==0){var Gr=180*Math.atan2(Qr-pt,En-ht)/Math.PI;0>Gr&&(Gr+=360),Ki.push(Gr)}ht=En,pt=Qr}Et.push(Ki)}if(a.graduatedIntervals===null){for(var oa=[],La=a.O.s,Ms=La.length,Ds=0;Ds<Ms;Ds++){var gl=La[Ds],ks=[];if(oa.push(ks),gl.visible){var hc=gl.interval;if(!(0>hc)){for(var gs=0;gs<Ms;gs++)if(gs!==Ds){var xh=La[gs];if(xh.visible&&gl.constructor===xh.constructor){var pl=xh.interval;pl>hc&&ks.push(pl)}}}}}a.graduatedIntervals=oa}var dc=a.graduatedIntervals,pu=a.O.s,Zu=pu.length,eu=0,Kl=0,$c=Ve;a.graduatedMarks=[];for(var Sh,kp=0;kp<Zu;kp++){var tu=pu[kp];if(Sh=[],tu.visible&&tu!==re){var ml=Math.abs(tu.interval),Mm=a.graduatedTickUnit;if(!(2>Mm*ml*Ve/a.graduatedRange&&tu.graduatedSkip===null)){var _g=Xe[0][0],Nh=0,Ul=0;Kl=Ve*tu.graduatedStart-1e-4,$c=Ve*tu.graduatedEnd+1e-4;var zf=Mm*ml,nu=a.graduatedTickBase;if(nu<a.graduatedMin){var qc=(a.graduatedMin-nu)/zf;qc=qc%1===0?qc:Math.floor(qc+1),nu+=qc*zf}else nu>a.graduatedMin+zf&&(nu-=Math.floor((nu-a.graduatedMin)/zf)*zf);for(var cv=dc[kp],km=nu,Jy=1e-6*a.graduatedMax,rd=1;nu<=a.graduatedMax+Jy;rd++){e:{for(var Nd=cv.length,Ig=0;Ig<Nd;Ig++){var ef=(nu-a.graduatedTickBase)%(cv[Ig]*a.graduatedTickUnit),Ap=1e-6*a.graduatedTickUnit;if(ef<Ap&&ef>-Ap){var tf=!1;break e}}tf=!0}if(tf&&(nu>a.graduatedMax&&(nu=a.graduatedMax),tu.graduatedSkip===null||tu instanceof Da&&!tu.graduatedSkip(nu,tu)||tu instanceof ao&&!tu.graduatedSkip(nu,tu))&&(eu=(nu-a.graduatedMin)*Ve/a.graduatedRange,eu>Ve&&(eu=Ve),Kl<=eu&&eu<=$c)){for(var od=Et[Nh][Ul],cc=Xe[Nh][Ul];Nh<Xe.length;){for(;eu>_g&&Ul<Xe[Nh].length-1;)Ul++,od=Et[Nh][Ul],cc=Xe[Nh][Ul],_g+=cc;if(eu<=_g)break;Nh++,Ul=0,od=Et[Nh][Ul],cc=Xe[Nh][Ul],_g+=cc}var Yl=Ne[Nh],Dh=Yl[2*Ul],fv=Yl[2*Ul+1],Dd=(eu-(_g-cc))/cc,Np=new _e(Dh+(Yl[2*Ul+2]-Dh)*Dd+Fe/2-Pe.bounds.x,fv+(Yl[2*Ul+3]-fv)*Dd+Fe/2-Pe.bounds.y);Np.scale(re.scale,re.scale);e:{var wh=od,Zf=Et[Nh];if(!(.5005>Dd&&.4995<Dd)){var Th=wh;if(.5>Dd?0<Ul?Th=Zf[Ul-1]:He.$(Yl[0],Yl[Yl.length-2])&&He.$(Yl[1],Yl[Yl.length-1])&&(Th=Zf[Zf.length-1]):.5<Dd&&(Ul+1<Zf.length?Th=Zf[Ul+1]:He.$(Yl[0],Yl[Yl.length-2])&&He.$(Yl[1],Yl[Yl.length-1])&&(Th=Zf[0])),wh!==Th){var Og=Math.abs(wh-Th);if(180<Og&&(wh<Th?wh+=360:Th+=360,Og=Math.abs(wh-Th)),5e-4>Dd||.9995<Dd){od=(wh+Th)/2%360;break e}if(10>Og){var Dp=1-Math.abs(.5-Dd);od=(wh*Dp+Th*(1-Dp))%360;break e}}}od=wh}if(tu instanceof Da){var th="";tu.graduatedFunction!==null?(th=tu.graduatedFunction(nu,tu),th=th!=null?th.toString():""):th=(+nu.toFixed(2)).toString(),th!==""&&Sh.push({$l:Np,angle:od,text:th})}else Sh.push({$l:Np,angle:od})}nu=km+rd*zf}}}a.graduatedMarks.push(Sh)}Mi(Et);var Ws=a.graduatedMarks;if(Ws!==null)for(var Am=E.length,bl=0;bl<Am;bl++){var ps=E[bl],Fl=Ws[bl];if(ps.visible&&ps!==re&&Fl.length!==0){if(ps instanceof ao){var Td=a,fc=b,Gf=ps.alignmentFocus;Gf.Mc()&&(Gf=Ia);var Qy=ps.angle;ps.Kb=0,ps.measure(1/0,1/0,0,0),ps.Kb=Qy;var gv=ps.measuredBounds,Tp=gv.width,Hf=gv.height,Rg=zt.allocAt(0,0,Tp,Hf),Xl=_e.alloc();Xl.xi(Rg,Gf),zt.free(Rg);for(var _d=-Xl.x,Ph=-Xl.y,Mu=new zt,nf=Fl.length,_p=0;_p<nf;_p++)for(var rf=Fl[_p],pv=rf.$l.x,Ip=rf.$l.y,os=rf.angle,nh=0;4>nh;nh++){switch(nh){case 0:Xl.h(_d,Ph);break;case 1:Xl.h(_d+Tp,Ph);break;case 2:Xl.h(_d,Ph+Hf);break;case 3:Xl.h(_d+Tp,Ph+Hf)}Xl.rotate(os+ps.angle),Xl.offset(pv,Ip),_p===0&&nh===0?Mu.h(Xl.x,Xl.y,0,0):Mu.Ye(Xl),Xl.offset(-pv,-Ip),Xl.rotate(-os-ps.angle)}_e.free(Xl),Td.graduatedBounds!==null&&Td.graduatedBounds.push(Mu),Uo(fc,Mu.x,Mu.y,Mu.width,Mu.height)}else if(ps instanceof Da){var Gu=a,mv=b;Gu.temporaryTextBlock===null&&(Gu.temporaryTextBlock=new Da);var iu=Gu.temporaryTextBlock;x1(iu,ps);var gc=ps.alignmentFocus;gc.Mc()&&(gc=Ia);for(var Hu=ps.segmentOrientation,Op=ps.segmentOffset,of=new zt,Nm=0,Rp=0,_h=0,Wf=0,af=0,jp=Fl.length,pc=0;pc<jp;pc++){var ad=Fl[pc];Nm=ad.$l.x,Rp=ad.$l.y,_h=ad.angle,af=Wf=ps.angle,Hu!==Sl&&(af=Hu===tm||Hu===E0?_h+ps.angle:_h,Wf=ti.computeAngle(Hu,af)),iu.Kb=Wf,iu.text=ad.text||"",iu.measure(1/0,1/0,0,0);var mc=iu.measuredBounds,Id=iu.naturalBounds,vc=Id.width,Vf=Id.height,Eh=Pt.alloc();Eh.reset(),Eh.translate(-mc.x,-mc.y),Eh.scale(iu.scale,iu.scale),Eh.rotate(af,vc/2,Vf/2),Hu!==nm&&Hu!==rm||Eh.rotate(90,vc/2,Vf/2),Hu!==im&&Hu!==om||Eh.rotate(-90,vc/2,Vf/2),Hu===C0&&(45<_h&&135>_h||225<_h&&315>_h)&&Eh.rotate(-_h,vc/2,Vf/2);var jg=zt.allocAt(0,0,vc,Vf),yc=_e.alloc();yc.xi(jg,gc),Eh.Ga(yc);var zg=-yc.x,$y=-yc.y,Od=_e.alloc();Od.assign(Op),isNaN(Od.x)&&(Od.x=vc/2+3),isNaN(Od.y)&&(Od.y=-(Vf/2+3)),Od.rotate(_h),Nm+=Od.x+zg,Rp+=Od.y+$y;var Kf=new zt(Nm,Rp,mc.width,mc.height),Dm=new zt(mc.x,mc.y,mc.width,mc.height),qy=new zt(Id.x,Id.y,Id.width,Id.height);ad.Sz=Wf,ad.lineCount=iu.lineCount,ad.lines=[iu.Cb,iu.Ih,iu.df,iu.Le,iu.Qc,iu.Qb,iu.ze],ad.actualBounds=Kf,ad.measuredBounds=Dm,ad.naturalBounds=qy,pc===0?of.assign(Kf):of.ed(Kf),_e.free(Od),_e.free(yc),zt.free(jg),Pt.free(Eh)}Gu.graduatedBounds!==null&&Gu.graduatedBounds.push(of),Uo(mv,of.x,of.y,of.width,of.height)}$e(ps,!1)}}},Wp.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,le=0;le<oe;le++){var he=y[le];re=b[le],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}}},Wp.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,le=a.graduatedMarks,he=oe.length,ge=0;ge<he;ge++){var xe=oe[ge],Pe=le[ge],Fe=Pe.length;if(xe.visible&&xe!==z&&Pe.length!==0){if(xe instanceof ao){if(!(2>a.graduatedTickUnit*xe.interval*z.geometry.flattenedTotalLength/a.graduatedRange*ee&&xe.graduatedSkip===null)){var Ne=xe.measuredBounds,Xe=xe.strokeWidth*xe.scale,Ve=xe.alignmentFocus;Ve.Mc()&&(Ve=Ia);for(var st=0;st<Fe;st++){var ht=Pe[st].$l,pt=Pe[st].angle,Et=Ve,Gt=xe.Ab;Gt.reset(),Gt.translate(ht.x+re.x,ht.y+re.y),Gt.rotate(pt+xe.angle,0,0),Gt.translate(-Ne.width*Et.x+Et.offsetX+Xe/2,-Ne.height*Et.y+Et.offsetY+Xe/2),Gt.scale(xe.scale,xe.scale),Be(xe,!1),xe.wh.set(xe.Ab),xe.Kk=xe.scale,ze(xe,!1),xe.gc(y,x),b&&(a.svg.appendChild(xe.svg),xe.svg=null),xe.Ab.reset()}}}else if(xe instanceof Da)for(a.temporaryTextBlock===null&&(a.temporaryTextBlock=new Da),Ne=a.temporaryTextBlock,x1(Ne,xe),Xe=0;Xe<Fe;Xe++)Ve=Pe[Xe],Ve.actualBounds&&Ve.measuredBounds&&Ve.naturalBounds&&(Ne.ec=Ve.text||"",Ne.Kb=Ve.Sz||0,Ne.Gc=Ve.lineCount||0,st=Ve.lines,st!==void 0&&(Ne.Cb=st[0],Ne.Ih=st[1],Ne.df=st[2],Ne.Le=st[3],Ne.Qc=st[4],Ne.Qb=st[5],Ne.ze=st[6]),Ve.naturalBounds&&(Ne.dc=Ve.naturalBounds),Ve.actualBounds&&(st=Ve.actualBounds,Ne.arrange(st.x,st.y,st.width,st.height)),st=Ve.actualBounds,Ne.arrange(st.x,st.y,st.width,st.height),ht=Ve.measuredBounds,Ve=Ve.naturalBounds,pt=Ne.Ab,pt.reset(),pt.translate(st.x+re.x,st.y+re.y),pt.translate(-ht.x,-ht.y),Ne.no(pt,Ve.x,Ve.y,Ve.width,Ve.height),Be(Ne,!1),Ne.wh.set(Ne.Ab),Ne.Kk=Ne.scale,ze(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 Xn(a,y){if(bt.call(this),this.na=null,a===void 0)this.na=Xn.Position;else if(typeof a=="string"){var x=Xu.I(a);x!==null&&(this.na=x)}else a instanceof Ps?this.na=a:a&&(this.na=Xn.Position,y=a);this.na===null&&it("Panel type not specified or PanelLayout not loaded: "+a),this.l=this.l|4194304|(this.na===Xn.Grid?1048576:0),this.O=new Tn,this.yb=is,this.Tm=er,this.Uf=Jr,this.$g=null,this.$e="",this.jg=new zt(NaN,NaN,NaN,NaN),this.T=this.F=null,this.xo=Ji,this.jn=No,this.kn=pi,this.ub=this.ra=null,this.zn=NaN,this.ge=this.Hh=null,y&&Object.assign(this,y)}Tt(Xn,bt),Xn.prototype.cloneProtected=function(a){bt.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},Xn.prototype.Af=function(a){bt.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},Xn.prototype.copy=function(){var a=bt.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 Fi&&(z.Te=!0);var re=a.diagram;re!==null&&re.undoManager.isUndoingRedoing||z.cb(ta,"elements",a,null,b,null,ee)}}return a}return null},Ce=Xn.prototype,Ce.toString=function(){return"Panel("+this.type.name+")#"+hr(this)},Ce.Pn=function(a){bt.prototype.Pn.call(this,a);for(var y=this.O.s,x=y.length,E=0;E<x;E++)y[E].Pn(a)},Ce.hh=function(a,y){if(this.na===Xn.Grid)a.yc(),this.na.gc(this,a,y);else if(this.na===Xn.Graduated)a.yc(),this.na.gc(this,a,y);else{if(this.na===Xn.Table)if(a.yc(),a instanceof da){var x=a.yd;a.yd=du(a,"gojs-ts"),Cv(this,a),a.nh.pop(),a.yd=x}else Cv(this,a);(x=this.isClipping&&this.na===Xn.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 le=E[oe];if(le!==void 0&&le.actual!==0)if(re)re=!1;else{if(x){if(le.position>ee.height)continue}else if(le.position>ee.width)continue;var he=le.separatorStrokeWidth;isNaN(he)&&(he=x?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var ge=le.separatorStroke;if(ge===null&&(ge=x?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke),he!==0&&ge!==null){Ya(a,y,ge,!1,!1,ee,z),ge=!1;var xe=le.separatorDashArray;xe===null&&(xe=x?a.defaultRowSeparatorDashArray:a.defaultColumnSeparatorDashArray),xe!==null&&(ge=!0,y.js(xe,0)),y.beginPath(),xe=le.position+he,x?xe>ee.height&&(he-=xe-ee.height):xe>ee.width&&(he-=xe-ee.width),le=le.position+he/2,y.lineWidth=he,he=a.yb,x?(le+=he.top,xe=ee.width-he.right,y.moveTo(he.left,le),y.lineTo(xe,le)):(le+=he.left,xe=ee.height-he.bottom,y.moveTo(le,he.top),y.lineTo(le,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),le=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:le))&&(Fe=0),Pe-=Fe,Fe=ge.position+Fe,Pe+=ge.actual,Fe+Pe>xe&&(Pe=xe-Fe),0>=Pe||(xe=a.yb,Ya(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"}Ce.lv=function(){for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].lv();this.Uc=!0},Ce.kk=function(a,y,x){if(!bt.prototype.kk.call(this,a,y,x))return!1;if(this.type===Xn.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===Xn.Grid||this.na===Xn.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},Ce.nk=function(){return!0},Ce.$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 bt.prototype.$o.call(this,a,y,x,E)},Ce.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,le=-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,He.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*le+y*ge+Pe,a=x*oe+E*he+xe,oe=x*le+E*ge+Pe,b.h(0,0),x=this.naturalBounds,z=He.Ff(0,0,x.width,x.height,z,re,a,oe,b),b.transform(ee),z;z||(oe=1,he=le=0,ge=1,Pe=xe=0),re=a*oe+y*he+xe,a=a*le+y*ge+Pe,oe=x*oe+E*he+xe,x=x*le+E*ge+Pe,b.h(oe,x),E=(oe-re)*(oe-re)+(x-a)*(x-a),le=!1,ge=this.O.s,Pe=ge.length,he=_e.alloc(),xe=null,y=1/0;var Fe=null,Ne=this.isClipping&&this.na===Xn.Spot;Ne&&(Fe=_e.alloc(),xe=this.Pb(),(le=xe.Sj(re,a,oe,x,Fe))&&(y=(re-Fe.x)*(re-Fe.x)+(a-Fe.y)*(a-Fe.y)));for(var Xe=0;Xe<Pe;Xe++){var Ve=ge[Xe];Ve.visible&&Ve!==xe&&Ve.Sj(re,a,oe,x,he)&&(le=!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),_e.free(Fe)),_e.free(he),z&&b.transform(ee),le},Ce.Gj=function(){for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Gj();bt.prototype.Gj.call(this)},Ce.v=function(a){if(!qe(this)){bt.prototype.v.call(this,a),a=null,(this.na===Xn.Auto||this.na===Xn.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=cl(b,!1);(b instanceof xl||b instanceof Xn||b instanceof Da||z!==Bn)&&b.v(!0)}}}},Ce.Uj=function(){if(!qe(this)){$e(this,!0),xt(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Uj()}},Ce.Uk=function(){if(!(this.l&2048)){Be(this,!0),ze(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Wu()}},Ce.Wu=function(){ze(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Wu()},Ce.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 le=this.O.s;le.length!==0&&this.na.measure(this,a,y,le,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),To(b,a,oe),To(this.naturalBounds,a,oe),this.Ge(0,0,a,oe)},Ce.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 Md(a){return a.part!==null?a.part.locationObject:null}Ce.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=cl(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=Bn),a){case Bn:(y>x||z>E)&&(this.v(),this.measure(y>x?x:y,z>E?E:z,0,0));break;case Gn:this.v(!0),this.measure(x+re,E+ee,0,0);break;case or: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)}},Ce.gh=function(a){var y=this.naturalBounds,x=Md(this);if(Fo(0,0,y.width,y.height,a.x,a.y)){y=this.O.s;for(var E=y.length,b=_e.allocAt(0,0);E--;){var z=y[E];if((z.visible||z===x)&&(Ei(b.set(a),z.transform),z.ca(b)))return _e.free(b),!0}return _e.free(b),!(this.Ma===null&&this.areaBackground===null)}return!1},Ce.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},Ce.qm=function(a,y){if(y(this,a),a instanceof Xn){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 Xn&&s1(a,z,x)}}function vS(a,y){l1(a,a,y)}function l1(a,y,x){if(x(y),y instanceof Xn){y=y.O.s;for(var E=y.length,b=0;b<E;b++)l1(a,y[b],x)}}Ce.Nl=function(a){return u1(this,this,a)};function u1(a,y,x){if(x(y))return y;if(y instanceof Xn){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}Ce.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 Xn){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 Xn?x=Math.max(x,h1(b)):b instanceof ao&&(x=Math.max(x,b.ig/2*b.strokeMiterLimit*b.Df()))}return x}Ce.se=function(){return!(this.type===Xn.TableRow||this.type===Xn.TableColumn)};function ec(a){return a.type===Xn.TableRow||a.type===Xn.TableColumn}Ce.ic=function(a,y,x){if(this.pickable===!1||(y===void 0&&(y=null),x===void 0&&(x=null),gt(this)))return null;var E=this.naturalBounds,b=1/this.Df(),z=this.se(),ee=z?a:Ei(_e.allocAt(a.x,a.y),this.transform),re=this.diagram,oe=10,le=5;if(re!==null&&(oe=re.Ql("extraTouchArea"),le=oe/2),Fo(-(le*b),-(le*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=_e.alloc(),le=(oe=this.isClipping&&this.na===Xn.Spot)?this.Pb():null,oe&&(le.se()?Ei(re.set(a),le.transform):re.set(a),!le.ca(re)))return _e.free(re),z||_e.free(ee),null;for(var ge=Md(this);he--;){var xe=b[he];if((xe.visible||xe===ge)&&(xe.se()?Ei(re.set(a),xe.transform):re.set(a),!oe||xe!==le)){var Pe=null;if(xe instanceof Xn?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 _e.free(re),z||_e.free(ee),Pe}}_e.free(re)}return this.background===null&&this.areaBackground===null?(z||_e.free(ee),null):(a=Fo(0,0,E.width,E.height,ee.x,ee.y)?this:null,z||_e.free(ee),a)}return z||_e.free(ee),null},Ce.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:Ei(_e.allocAt(a.x,a.y),this.transform);if(b=Fo(0,0,b.width,b.height,ee.x,ee.y),ec(this)||b){if(!this.isAtomic){for(var re=this.O.s,oe=re.length,le=_e.alloc(),he=Md(this);oe--;){var ge=re[oe];if(ge.visible||ge===he){ge.se()?Ei(le.set(a),ge.transform):le.set(a);var xe=ge;ge=ge instanceof Xn?ge:null,(ge!==null?ge.ji(le,y,x,E):xe.ca(le))&&xe.pickable!==!1&&(y!==null&&(xe=y(xe)),xe===null||x!==null&&!x(xe)||E.add(xe))}}_e.free(le)}return z||_e.free(ee),b&&(this.background!==null||this.areaBackground!==null)}return z||_e.free(ee),!1},Ce.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=Pt.alloc(),ee.reset()),ee.multiply(this.transform),this.fh(a,ee))return Fv(this,y,x,b),z===void 0&&Pt.free(ee),!0;if(this.Yc(a,ee)){if(!this.isAtomic)for(var re=Md(this),oe=this.O.s,le=oe.length;le--;){var he=oe[le];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 Xn?he:null,xe=Pt.alloc(),xe.set(ee),(he!==null?he.Cf(a,y,x,E,b,xe):xs(ge,a,E,xe))&&(y!==null&&(ge=y(ge)),ge===null||x!==null&&!x(ge)||b.add(ge)),Pt.free(xe))}}return z===void 0&&Pt.free(ee),E}return z===void 0&&Pt.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 Xn&&Fv(ee,y,x,E),y!==null&&(ee=y(ee)),ee===null||x!==null&&!x(ee)||E.add(ee))}}}Ce.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:Ei(_e.allocAt(a.x,a.y),this.transform),le=re?y:Ei(_e.allocAt(y.x,y.y),this.transform),he=oe.Bf(le),ge=0<oe.x&&oe.x<ee.width&&0<oe.y&&oe.y<ee.height||bi(oe.x,oe.y,0,0,0,ee.height)<=he||bi(oe.x,oe.y,0,ee.height,ee.width,ee.height)<=he||bi(oe.x,oe.y,ee.width,ee.height,ee.width,0)<=he||bi(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||(_e.free(oe),_e.free(le)),ge){if(!this.isAtomic){oe=_e.alloc(),le=_e.alloc(),he=Md(this);for(var xe=this.O.s,Pe=xe.length;Pe--;){var Fe=xe[Pe];if(Fe.visible||Fe===he){var Ne=Fe.actualBounds,Xe=this.naturalBounds;(!re||!(Ne.x>Xe.width||Ne.y>Xe.height||0>Ne.x+Ne.width||0>Ne.y+Ne.height))&&(Fe.se()?(Ne=Fe.transform,Ei(oe.set(a),Ne),Ei(le.set(y),Ne)):(oe.set(a),le.set(y)),Ne=Fe,Fe=Fe instanceof Xn?Fe:null,(Fe!==null?Fe.og(oe,le,x,E,b,z):Ne.tx(oe,le,b))&&(x!==null&&(Ne=x(Ne)),Ne===null||E!==null&&!E(Ne)||z.add(Ne)))}}_e.free(oe),_e.free(le)}return b?ge:ee}return!1};function Lv(a){var y=null;return a instanceof ao&&(y=a.spot1,y===er&&(y=null),a=a.geometry,a!==null&&y===null&&(y=a.spot1)),y===null&&(y=Xo),y}function Bv(a){var y=null;return a instanceof ao&&(y=a.spot2,y===er&&(y=null),a=a.geometry,a!==null&&y===null&&(y=a.spot2)),y===null&&(y=Xt),y}Ce.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},Ce.M=function(a){return this.O.M(a)},Ce.Gb=function(a,y){y instanceof mr&&it("Cannot add a Part to a Panel: "+y+"; use a Panel instead"),(this===y||this.rg(y))&&(this===y&&it("Cannot make a Panel contain itself: "+this.toString()),it("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+y.toString()));var x=y.panel;if(x!==null&&x!==this&&it("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!==Xn.Grid||y instanceof ao||it("Can only add Shapes to a Grid Panel, not: "+y),this.na!==Xn.Graduated||y instanceof ao||y instanceof Da||it("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 Ut),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 it("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),qe(this)||this.v(),y.v(!1),y.portId!==null?this.Te=!0:y instanceof Xn&&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 Fi&&(x.Te=!0),x.Te&&x instanceof Fi&&(x.wc=null),b=this.diagram,b!==null&&b.undoManager.isUndoingRedoing||(E!==-1&&x.cb(Sa,"elements",this,y,null,E,null),x.cb(ta,"elements",this,null,y,null,a)))};function Mv(a,y){a.l=y?a.l|16777216:a.l&-16777217}Ce.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)},Ce.mb=function(a){0<=a&&this.pc(a,!0)},Ce.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),$e(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 Fi&&(E instanceof Xn?E.qm(E,function(ee,re){$v(z,re,y)}):$v(z,E,y)),x=this.diagram,x!==null&&x.undoManager.isUndoingRedoing||z.cb(Sa,"elements",this,E,null,a,null))},Ce.Fb=function(a){0>a&&Dn(a,">= 0",Xn,"getRowDefinition:idx"),a=Math.round(a);var y=this.rowDefs;if(y[a]===void 0){var x=new Ss;x.wi(this),x.isRow=!0,x.index=a,y[a]=x,this.cb(ta,"rowdefs",this,null,x,null,a)}return y[a]},Ce.oA=function(a){if(0>a&&Dn(a,">= 0",Xn,"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(Sa,"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 Ss?x:void 0,!x)for(y=E.length-1;0<=y&&E[y--]===void 0;)E.length--;a.v()}}Ce.Eb=function(a){0>a&&Dn(a,">= 0",Xn,"getColumnDefinition:idx"),a=Math.round(a);var y=this.colDefs;if(y[a]===void 0){var x=new Ss;x.wi(this),x.isRow=!1,x.index=a,y[a]=x,this.cb(ta,"coldefs",this,null,x,null,a)}return y[a]},Ce.jA=function(a){if(0>a&&Dn(a,">= 0",Xn,"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(Sa,"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 Ss?x:void 0,!x)for(y=E.length-1;0<=y&&E[y--]===void 0;)E.length--;a.v()}}Ce.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},Ce.Hy=function(a,y){return(a=this.Fb(a))&&$m(a,new Ss(y)),this},Ce.By=function(a,y){return(a=this.Eb(a))&&$m(a,new Ss(y)),this},Ce.nz=function(a){if(0>a||this.type!==Xn.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},Ce.fz=function(a){if(0>a||this.type!==Xn.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},Ce.Fz=function(a,y){if(y===void 0&&(y=new _e(NaN,NaN)),this.type!==Xn.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)},Ce.Gz=function(a){if(this.type!==Xn.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 Ru(a){var y=a.allBindings;if(y===null)a.data!==null&&it("Template cannot have .data be non-null: "+a),a.allBindings=y=new Tn;else if(y._isFrozen)return;var x=new Tn;Mv(a,!1),a.qm(a,function(le,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(le,!0),Pe=Lx(xe,le,he),Pe!==null&&(x.add(Pe),Pe.srcBindings===null&&(Pe.srcBindings=new Tn),Pe.srcBindings.add(xe))),y.add(xe)}if(he instanceof Xn&&he.type===Xn.Table){if(0<he.rowCount){for(le=he.rowDefs,ge=le.length,xe=0;xe<ge;xe++)if(Pe=le[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,le=he.length,ge=0;ge<le;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 Tn),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 Xn&&(ee=re.substring(0,oe),re=re.substr(oe+1),oe=z.fb(ee),oe!==null?(z=oe,b.targetProperty=re):Di('Warning: unable to find GraphObject named "'+ee+'" for Binding: '+b.toString())),z instanceof Ss?(ee=hr(z.panel),b.Ai=ee===void 0?-1:ee,z.panel.bindingId=b.Ai):z instanceof bt?(ee=hr(z),b.Ai=ee===void 0?-1:ee,z.bindingId=b.Ai):it("Unknown type of binding target: "+z)}y.freeze(),a instanceof mr&&a.Zc()&&a.Va()}Ce.Uy=function(a){a===void 0&&(a=!1);var y=this.copy();return vS(y,function(x){x instanceof Xn&&(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&&Ru(y),y},Ce.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 Xn))continue;b===1?z=z.Eb(x.wl):b===2&&(z=z.Fb(x.wl))}z!==void 0&&x.Mv(z,E)}}},Ce.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 Xn&&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 Xn)||z.data!==y[ee])return!0;b++,ee++}return!1}function Vp(a){if(a.type===Xn.Spot||a.type===Xn.Auto)return Math.min(a.O.length,1);if(a.type===Xn.Link){a=a.O;for(var y=a.length,x=0;x<y;x++){var E=a.M(x);if(!(E instanceof ao&&E.isPanelMain))break}return x}return a.type===Xn.Table&&0<a.O.length&&(a=a.O.M(0),a.isPanelMain&&a instanceof Xn&&ec(a))?1:0}Ce.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 Xn){if(ee.data!==z){var re=Av(a,ee.data),oe=Av(a,z),le=oe!==re;le||(re=Nv(a,re),le=Nv(a,oe)!==re),le?(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),qe(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 Fi&&(y.Te=!0),y.Te&&y instanceof Fi&&(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(Ru(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 Ut),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 Xn){var b=y,z=x;E.type===Xn.TableRow?E.row=b:E.type===Xn.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=hs(y,a)}else return"";if(a===void 0)return"";if(typeof a=="string")return a;it("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,Di('No item template Panel found for category "'+y+'" on '+a),Di(" Using default item template."),a=new Xn,y=new Da,y.bind(new fs("text","",dr)),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 Xn){y=y.O.s,E=y.length;for(var b=0;b<E;b++){var z=y[b];x&&z instanceof Xn&&!z.isEnabled||Qm(a,z,x)}}}function kh(a,y){y.name=a,Xu.add(a,y)}kt.Object.defineProperties(Xn.prototype,{type:{get:function(){return this.na},set:function(a){var y=this.na;y!==a&&(this.na=a,this.isAtomic=this.na===Xn.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&&Dn(a,">= 0",Xn,"padding"),a=new Vr(a)):(0>a.left&&Dn(a.left,">= 0",Xn,"padding:value.left"),0>a.right&&Dn(a.right,">= 0",Xn,"padding:value.right"),0>a.top&&Dn(a.top,">= 0",Xn,"padding:value.top"),0>a.bottom&&Dn(a.bottom,">= 0",Xn,"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:is},set:function(a){typeof a=="number"&&(a=new Vr(a));var y=this.defaultSeparatorPadding;y.D(a)||(a=a.J(),this.T===null&&(this.T=new bu),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 Jo)&&(a instanceof Jo&&a.freeze(),this.T===null&&(this.T=new bu),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 bu),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)||it("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 bu),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 Jo)&&(a instanceof Jo&&a.freeze(),this.T===null&&(this.T=new bu),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 bu),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)||it("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 bu),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 bu),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||it("Invalid Panel.gridCellSize: "+a),this.jn=a.J();var x=this.diagram;x!==null&&this===x.grid&&Uu(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()||it("Invalid Panel.gridOrigin: "+a),this.kn=a.J();var x=this.diagram;x!==null&&this===x.grid&&Uu(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 kd),this.ra.lq=a,this.v(),this.g("graduatedMin",y,a),ve(this)&&(a=this.part,a!==null&&_a(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 kd),this.ra.F=a,this.v(),this.g("graduatedMax",y,a),ve(this)&&(a=this.part,a!==null&&_a(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 kd),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 kd),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 kd,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 kd,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 kd,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 kd,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 bu),this.T.Pc}},rowCount:{get:function(){return this.T===null?0:this.rowDefs.length}},colDefs:{get:function(){return this.T===null&&(this.T=new bu),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 bu),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 bu),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)&&it("Panel.topIndex must be greater than zero and a real number, not: "+a),this.T===null&&(this.T=new bu),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)&&it("Panel.leftIndex must be greater than zero and a real number, not: "+a),this.T===null&&(this.T=new bu),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 $o);Ru(this),this.ub=a;var E=this.diagram;E!==null&&(x?(x=E.partManager,this instanceof ti?(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 Zr),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 Ut}var y=this.itemTemplateMap.I("");y!==a&&((a instanceof mr||a.isPanelMain)&&it("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(););co(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&&(co(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 qr&&(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))}}}),kt.Object.defineProperties(Xn,{Position:{get:function(){return Xu.I("Position")}},Horizontal:{get:function(){return Xu.I("Horizontal")}},Vertical:{get:function(){return Xu.I("Vertical")}},Spot:{get:function(){return Xu.I("Spot")}},Auto:{get:function(){return Xu.I("Auto")}},Table:{get:function(){return Xu.I("Table")}},Viewbox:{get:function(){return Xu.I("Viewbox")}},TableRow:{get:function(){return Xu.I("TableRow")}},TableColumn:{get:function(){return Xu.I("TableColumn")}},Link:{get:function(){return Xu.I("Link")}},Grid:{get:function(){return Xu.I("Grid")}},Graduated:{get:function(){return Xu.I("Graduated")}}}),Xn.prototype.rebuildItemElements=Xn.prototype.mv,Xn.prototype.findItemPanelForData=Xn.prototype.sx,Xn.prototype.updateTargetBindings=Xn.prototype.La,Xn.prototype.copyTemplate=Xn.prototype.Uy,Xn.prototype.graduatedValueForPoint=Xn.prototype.Gz,Xn.prototype.graduatedPointForValue=Xn.prototype.Fz,Xn.prototype.findColumnForLocalX=Xn.prototype.fz,Xn.prototype.findRowForLocalY=Xn.prototype.nz,Xn.prototype.addColumnDefinition=Xn.prototype.By,Xn.prototype.addRowDefinition=Xn.prototype.Hy,Xn.prototype.addRowColumnDefinition=Xn.prototype.Gy,Xn.prototype.removeColumnDefinition=Xn.prototype.jA,Xn.prototype.getColumnDefinition=Xn.prototype.Eb,Xn.prototype.removeRowDefinition=Xn.prototype.oA,Xn.prototype.getRowDefinition=Xn.prototype.Fb,Xn.prototype.removeAt=Xn.prototype.mb,Xn.prototype.remove=Xn.prototype.remove,Xn.prototype.insertAt=Xn.prototype.Gb,Xn.prototype.elt=Xn.prototype.M,Xn.prototype.add=Xn.prototype.add,Xn.prototype.findObject=Xn.prototype.fb,Xn.prototype.findInVisualTree=Xn.prototype.Nl,Xn.prototype.walkVisualTreeFrom=Xn.prototype.qm,Xn.prototype.findMainElement=Xn.prototype.Pb;var p1=!1,m1=null,Xu=new Ut;Xn.className="Panel",Xn.definePanelLayout=kh,kh("Position",new Rm),kh("Vertical",new zm),kh("Auto",new Gm),kh("Link",new Ym);function kd(){this.lq=0,this.F=100,this.ia=10,this.V=0,this.Zh=this.o=this.j=this.u=null}kd.prototype.copy=function(){var a=new kd;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},kd.className="GradPanelSettings";function bu(){this.Pc=[],this.Oc=[],this.j=this.ob=e0,this.hb=this.Hb=0,this.Qp=is,this.Ha=1,this.V=this.ia=null,this.F=1,this.nb=this.o=this.u=null}bu.prototype.copy=function(a){for(var y=new bu,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},bu.className="TablePanelSettings";function Ss(a){wr(this),this.Me=null,this.uq=!0,this.Za=0,this.Hc=NaN,this.jj=0,this.hj=1/0,this.Jb=er,this.pa=this.oc=this.oa=0,this.be=null,this.oo=Dv,this.hg=Jr,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))}Ss.prototype.copy=function(){var a=new Ss;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=an(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=an(y.separatorDashArray)),a.background=y.background,a.coversSeparators=y.coversSeparators,a.be=y.be}Ce=Ss.prototype,Ce.qb=function(a){a.classType===Ss&&(this.sizing=a)},Ce.toString=function(){return"RowColumnDefinition "+(this.isRow?"(Row ":"(Column ")+this.index+") #"+hr(this)},Ce.wi=function(a){this.Me=a},Ce.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)},Ce.Wc=function(){var a=0,y=this.Me,x=0,E=this.isRow;if(y!==null&&y.type===Xn.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)},Ce.Ob=function(a,y,x){var E=this.Me;if(E!==null&&(E.cb(Bo,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}Ce.bind=function(a,y,x,E){var b=null;return typeof a=="string"?b=new fs(a,y,x,E):b=a,b.xd=this,a=this.panel,a!==null&&(y=a.ih(),y!==null&&f1(y)&&it("Cannot add a Binding to a RowColumnDefinition that is already frozen: "+b+" on "+a)),this.be===null&&(this.be=new Tn),this.be.add(b),this},kt.Object.defineProperties(Ss.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&&Dn(a,">= 0",Ss,"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&&Dn(a,">= 0",Ss,"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))&&Dn(a,">= 0",Ss,"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&&Dn(a,">= 0",Ss,"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 Vr(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&&Ic(a,"RowColumnDefinition.separatorStroke"),a instanceof Jo&&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)||it("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&&Ic(a,"RowColumnDefinition.background"),a instanceof Jo&&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}}}),Ss.prototype.computeEffectiveSpacing=Ss.prototype.Wc,Ss.prototype.computeEffectiveSpacingTop=Ss.prototype.Io;var Dv=new en(Ss,"Default",0),Kp=new en(Ss,"None",1),e0=new en(Ss,"ProportionalExtra",2);Ss.className="RowColumnDefinition",Ss.Default=Dv,Ss.None=Kp,Ss.ProportionalExtra=e0;function ao(a,y){bt.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)}Tt(ao,bt),ao.prototype.cloneProtected=function(a){bt.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=an(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 Iv:a.Na.nc&&(a.Na=a.Na.copy())}Ce=ao.prototype,Ce.th=function(){bt.prototype.th.call(this),this.Na!==null&&(this.Na.nc=!0)},Ce.qb=function(a){a===Bn||a===Ji||a===Ao||a===Jr?this.geometryStretch=a:bt.prototype.qb.call(this,a)},Ce.toString=function(){return"Shape("+(this.figure!=="None"?this.figure:this.toArrow!=="None"?this.toArrow:this.fromArrow)+")#"+hr(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],le,he,ge,xe,Pe,Fe,Ne=0,Xe=Hi(),Ve=2;Ve<b;Ve+=2)le=x[Ve],he=x[Ve+1],ge=le-re,re=he-oe,ge===0&&(ge=.001),xe=re/ge,Pe=Math.atan2(re,ge),Fe=Math.sqrt(ge*ge+re*re),Xe.push([ge,Pe,xe,Fe]),Ne+=Fe,re=le,oe=he;re=x[0],oe=x[1],ge=E.measuredBounds.width,E instanceof ao&&(ge-=E.strokeWidth),1>ge&&(ge=1),b=x=ge,le=ee/2,he=le!==0,Ve=0,Fe=Xe[Ve],ge=Fe[0],Pe=Fe[1],xe=Fe[2],Fe=Fe[3];for(var st=0;.1<=Ne;){if(st===0&&(he?(b=x,b-=le,Ne-=le,he=!1):b=x,b===0&&(b=1)),b>Ne){Mi(Xe);return}b>Fe?(st=b-Fe,b=Fe):st=0;var ht=Math.sqrt(b*b/(1+xe*xe));if(0>ge&&(ht=-ht),re+=ht,oe+=xe*ht,a.translate(re,oe),a.rotate(Pe),a.translate(-(ee/2),-(z/2)),st===0&&E.hh(a,y),a.translate(ee/2,z/2),a.rotate(-Pe),a.translate(-re,-oe),Ne-=b,Fe-=b,st!==0){if(Ve++,Ve===Xe.length){Mi(Xe);return}Fe=Xe[Ve],ge=Fe[0],Pe=Fe[1],xe=Fe[2],Fe=Fe[3],b=st}}Mi(Xe)}}Ce.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&&Ya(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===Xn.Link&&re instanceof $o&&re.category==="Selection"&&re.adornedObject instanceof ao&&re.adornedPart.Pb()===re.adornedObject?re.adornedObject.strokeWidth:0),oe===0&&(x=null),x!==null&&oe!==0&&(Ya(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===Dt.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===Dt.u){var le=b.startX;oe=b.startY;var he=b.endX,ge=b.endY;b=Math.min(le,he);var xe=Math.min(oe,ge);le=Math.abs(he-le),oe=Math.abs(ge-oe),a.beginPath(),a.rect(b,xe,le,oe),E!==null&&a.ng(E),x!==null&&(re&&z&&fl(a),a.jk(),re&&z&&Rs(a)),a.Se()}else if(b.type===Dt.F)le=b.startX,oe=b.startY,he=b.endX,ge=b.endY,b=Math.abs(he-le)/2,xe=Math.abs(ge-oe)/2,le=Math.min(le,he)+b,oe=Math.min(oe,ge)+xe,a.beginPath(),a.moveTo(le,oe-xe),a.bezierCurveTo(le+He.wg*b,oe-xe,le+b,oe-He.wg*xe,le+b,oe),a.bezierCurveTo(le+b,oe+He.wg*xe,le+He.wg*b,oe+xe,le,oe+xe),a.bezierCurveTo(le-He.wg*b,oe+xe,le-b,oe+He.wg*xe,le-b,oe),a.bezierCurveTo(le-b,oe-He.wg*xe,le-He.wg*b,oe-xe,le,oe-xe),a.closePath(),E!==null&&a.ng(E),x!==null&&(re&&z&&fl(a),a.jk(),re&&z&&Rs(a)),a.Se();else if(b.type===Dt.o)for(b=b.figures,oe=b.length,xe=0;xe<oe;xe++){le=b.s[xe],a.beginPath(),a.moveTo(le.startX,le.startY),he=le.segments.s,ge=he.length;for(var Pe=null,Fe=0;Fe<ge;Fe++){var Ne=he[Fe];switch(Ne.type){case _i:a.moveTo(Ne.endX,Ne.endY);break;case Ci:a.lineTo(Ne.endX,Ne.endY);break;case Dr:a.bezierCurveTo(Ne.point1X,Ne.point1Y,Ne.point2X,Ne.point2Y,Ne.endX,Ne.endY);break;case ko:a.quadraticCurveTo(Ne.point1X,Ne.point1Y,Ne.endX,Ne.endY);break;case br:if(Ne.radiusX===Ne.radiusY){var Xe=Math.PI/180;a.arc(Ne.point1X,Ne.point1Y,Ne.radiusX,Ne.startAngle*Xe,(Ne.startAngle+Ne.sweepAngle)*Xe,0>Ne.sweepAngle,Pe!==null?Pe.endX:le.startX,Pe!==null?Pe.endY:le.startY)}else if(Pe=cr(Ne,le),Xe=Pe.length,Xe===0)a.lineTo(Ne.centerX,Ne.centerY);else for(var Ve=0;Ve<Xe;Ve++){var st=Pe[Ve];Ve===0&&a.lineTo(st[0],st[1]),a.bezierCurveTo(st[2],st[3],st[4],st[5],st[6],st[7])}break;case Cr:if(Ve=Xe=0,Pe!==null&&Pe.type===br){if(Pe=cr(Pe,le),st=Pe.length,st===0){a.lineTo(Ne.endX,Ne.endY);break}Pe=Pe[st-1]||null,Pe!==null&&(Xe=Pe[6],Ve=Pe[7])}else Xe=Pe!==null?Pe.endX:le.startX,Ve=Pe!==null?Pe.endY:le.startY;if(Pe=yr(Ne,le,Xe,Ve),Xe=Pe.length,Xe===0){a.lineTo(Ne.endX,Ne.endY);break}for(Ve=0;Ve<Xe;Ve++)st=Pe[Ve],a.bezierCurveTo(st[2],st[3],st[4],st[5],st[6],st[7]);break;default:it("Segment not of valid type: "+Ne.type)}Ne.isClosed&&a.closePath(),Pe=Ne}he=le.isFilled,z?le.isShadowed?(he===!0&&E!=="transparent"&&E!==null&&a.ng(E,le.isEvenOdd),x!==null&&(he&&re&&fl(a),a.jk(),he&&re&&Rs(a))):(fl(a),he&&E!=="transparent"&&E!==null&&a.ng(E,le.isEvenOdd),x!==null&&a.jk(),Rs(a)):(he&&E!==null&&a.ng(E,le.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=Hi(),z.type===Dt.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===Dt.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,le=re.segments.s,he=le.length,ge=0;ge<he;ge++){switch(Fe=le[ge],Fe.type){case _i: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 Ci:E.push(Fe.endX),E.push(Fe.endY),ee=Fe.endX,b=Fe.endY;break;case Dr:He.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 ko:He.ep(ee,b,Fe.point1X,Fe.point1Y,Fe.endX,Fe.endY,.5,E),ee=Fe.endX,b=Fe.endY;break;case br:if(Ne=cr(Fe,re),Pe=Ne.length,Pe===0){E.push(Fe.centerX),E.push(Fe.centerY),ee=Fe.centerX,b=Fe.centerY;break}for(Xe=0;Xe<Pe;Xe++)Ve=Ne[Xe],He.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 Cr:if(Ne=yr(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(Xe=0;Xe<Pe;Xe++)Ve=Ne[Xe],He.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:it("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===Dt.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===Dt.F){if(b=new no,b.startX=z.endX,b.startY=(z.startY+z.endY)/2,ee=new lr(br),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=cr(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],He.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)}Mi(E),a.restore(),a.Vc(!1)}}}},Ce.kk=function(a,y,x){return!bt.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)},Ce.nk=function(a){return this.geometry!==null&&1<this.geometry.figures.length||this.pathPattern!==null?!0:bt.prototype.nk.call(this,a)},Ce.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)}},Ce.ga=function(a,y){if(y===void 0&&(y=new _e),a instanceof ni){a.Mc()&&it("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},Ce.mi=function(a){a===void 0&&(a=new zt);var y=this.naturalBounds,x=this.oe;y=zt.allocAt(y.x,y.y,y.width,y.height);var E=this.strokeWidth;return y.Bc(E/2,E/2),E=_e.allocAt(y.x,y.y).transform(x),a.h(E.x,E.y,0,0),E.h(y.right,y.y).transform(x),Uo(a,E.x,E.y,0,0),E.h(y.right,y.bottom).transform(x),Uo(a,E.x,E.y,0,0),E.h(y.x,y.bottom).transform(x),Uo(a,E.x,E.y,0,0),zt.free(y),_e.free(E),a},Ce.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!==Dt.j||y||(b+=2);var z=zt.alloc();if(z.assign(E),z.Bc(b+2,b+2),!z.ca(a))return zt.free(z),!1;if(E=b+1e-4,x.type===Dt.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:(zt.free(z),He.Yb(x.startX,x.startY,x.endX,x.endY,b,a.x,a.y));if(x.type===Dt.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 zt.free(z),!1;z.Bc(E,E)}return this.stroke!==null&&z.Bc(b,b),a=z.ca(a),zt.free(z),a}if(x.type===Dt.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 zt.free(z),!1;ee+=E,b+=E}return this.stroke!==null&&(ee+=E,b+=E),zt.free(z),0>=ee||0>=b?!1:1>=x*x/(ee*ee)+y*y/(b*b)}if(x.type===Dt.o)return zt.free(z),this.fill===null?wi(x,a.x,a.y,b):Qi(x,a,b,1<this.strokeWidth,y);it("Unknown Geometry type: "+x.type)},Ce.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=_v[re];if(oe===void 0){var le=He.Ze[re];typeof le=="string"&&(le=He.Ze[le]),typeof le=="function"?(oe=le(null,100,100),_v[re]=oe):it("Unsupported Figure: "+re)}ee=oe.bounds}re=ee.width,oe=ee.height,le=ee.width;var he=ee.height;switch(cl(this,!0)){case Bn:E=x=0;break;case Gn:le=Math.max(a-z,0),he=Math.max(y-z,0);break;case or:le=Math.max(a-z,0),E=0;break;case Br:x=0,he=Math.max(y-z,0)}isFinite(b.width)&&(le=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),le=Math.min(ge.width,le),he=Math.min(ge.height,he),le=isFinite(le)?Math.max(x,le):Math.max(re,x),he=isFinite(he)?Math.max(E,he):Math.max(oe,E),x=Tv(this),x){case Bn:break;case Gn:re=le,oe=he;break;case Ji:x=Math.min(le/re,he/oe),isFinite(x)||(x=1),re*=x,oe*=x;break;default:it(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&&He.$(this.ua.Sk,a-z)&&He.$(this.ua.Rk,y-z)||(this.ua=ao.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),le+z,he+z),b.w()?(le=b.width,he=b.height,le=Math.min(ge.width,le),he=Math.min(ge.height,he),le=Math.max(xe.width,le),he=Math.max(xe.height,he),this.dc.h(0,0,le,he)):this.dc.assign(ee)};function Tv(a){var y=a.geometryStretch;return a.Rd!==null?y===Jr?Gn:y:y===Jr?_v[a.figure].defaultStretch:y}Ce.eh=function(a,y,x,E){rl(this,a,y,x,E)},Ce.rs=function(a,y,x){return this.Sj(a.x,a.y,y.x,y.y,x)},Ce.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,le=-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*le+ge,ee=a*oe+y*he+xe,re=x*re+E*le+ge,oe=x*oe+E*he+xe,ge=this.ig/2,le=this.ua,le===null&&(this.measure(1/0,1/0),le=this.ua);var Pe=le.bounds;if(he=!1,le.type===Dt.j)if(1.5>=this.strokeWidth)he=He.Ve(le.startX,le.startY,le.endX,le.endY,z,ee,re,oe,b);else{if(le.startX===le.endX?(E=ge,he=0):(y=(le.endY-le.startY)/(le.endX-le.startX),he=ge/Math.sqrt(1+y*y),E=he*y),y=Hi(),a=new _e,He.Ve(le.startX+E,le.startY+he,le.endX+E,le.endY+he,z,ee,re,oe,a)&&y.push(a),a=new _e,He.Ve(le.startX-E,le.startY-he,le.endX-E,le.endY-he,z,ee,re,oe,a)&&y.push(a),a=new _e,He.Ve(le.startX+E,le.startY+he,le.startX-E,le.startY-he,z,ee,re,oe,a)&&y.push(a),a=new _e,He.Ve(le.endX+E,le.endY+he,le.endX-E,le.endY-he,z,ee,re,oe,a)&&y.push(a),re=y.length,re===0)return Mi(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);Mi(y)}else if(le.type===Dt.u)he=He.Ff(Pe.x-ge,Pe.y-ge,Pe.x+Pe.width+ge,Pe.y+Pe.height+ge,z,ee,re,oe,b);else if(le.type===Dt.F){y=zt.allocAt(Pe.x,Pe.y,Pe.width,Pe.height).Bc(ge,ge);e:if(y.width===0)he=He.Ve(y.x,y.y,y.x,y.y+y.height,z,ee,re,oe,b);else if(y.height===0)he=He.Ve(y.x,y.y,y.x+y.width,y.y,z,ee,re,oe,b);else{if(a=y.width/2,le=y.height/2,E=y.x+a,he=y.y+le,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+le*le-oe*oe){b.x=NaN,b.y=NaN,he=!1;break e}ge=Math.sqrt(a*a*x*x+le*le-oe*oe),re=(-(a*a*x*oe)+a*le*ge)/(le*le+a*a*x*x)+E,a=(-(a*a*x*oe)-a*le*ge)/(le*le+a*a*x*x)+E,le=x*(re-E)+oe+he,oe=x*(a-E)+oe+he,Math.abs((z-re)*(z-re))+Math.abs((ee-le)*(ee-le))<Math.abs((z-a)*(z-a))+Math.abs((ee-oe)*(ee-oe))?(b.x=re,b.y=le):(b.x=a,b.y=oe)}else{if(re=le*le,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}zt.free(y)}else if(le.type===Dt.o){xe=_e.alloc();var Fe=re-z,Ne=oe-ee,Xe=Fe*Fe+Ne*Ne,Ve=z,st=ee;if(0<Xe&&Pe.contains(Ve,st)&&(xe.x=Ve,xe.y=st,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,st-=Ne;Pe.contains(Ve,st);)Ve-=Fe,st-=Ne;for(b.x=re,b.y=oe,Ne=0;Ne<le.figures.count;Ne++){var ht=le.figures.s[Ne],pt=ht.isFilled?Ve:z,Et=ht.isFilled?st:ee,Gt=ht.segments;Pe=ht.startX,Fe=ht.startY;for(var xi=Pe,Ki=Fe,ji=0;ji<Gt.count;ji++){var ei=Gt.s[ji],En=ei.type,Qr=ei.endX,Gr=ei.endY,oa=!1;switch(En){case _i:xi=Qr,Ki=Gr;break;case Ci:oa=n0(Pe,Fe,Qr,Gr,pt,Et,re,oe,xe);break;case Dr:oa=He.Eo(Pe,Fe,ei.point1X,ei.point1Y,ei.point2X,ei.point2Y,Qr,Gr,pt,Et,re,oe,.6,xe);break;case ko:oa=He.Eo(Pe,Fe,Pe+2/3*(ei.point1X-Pe),Fe+2/3*(ei.point1Y-Fe),Qr+2/3*(ei.point1X-Qr),Gr+2/3*(ei.point1Y-Gr),Qr,Gr,pt,Et,re,oe,.6,xe);break;case br:case Cr:En=ei.type===br?cr(ei,ht):yr(ei,ht,Pe,Fe);var La=En.length;if(La===0){oa=n0(Pe,Fe,ei.type===br?ei.centerX:ei.endX,ei.type===br?ei.centerY:ei.endY,pt,Et,re,oe,xe);break}for(Gr=null,Qr=0;Qr<La;Qr++){if(Gr=En[Qr],Qr===0&&n0(Pe,Fe,Gr[0],Gr[1],pt,Et,re,oe,xe)){var Ms=t0(pt,Et,xe,Xe,b);Ms<Xe&&(Xe=Ms,he=!0)}He.Eo(Gr[0],Gr[1],Gr[2],Gr[3],Gr[4],Gr[5],Gr[6],Gr[7],pt,Et,re,oe,.6,xe)&&(Ms=t0(pt,Et,xe,Xe,b),Ms<Xe&&(Xe=Ms,he=!0))}Qr=Gr[6],Gr=Gr[7];break;default:it("Unknown Segment type: "+En)}Pe=Qr,Fe=Gr,oa&&(oa=t0(pt,Et,xe,Xe,b),oa<Xe&&(Xe=oa,he=!0)),ei.isClosed&&(Qr=xi,Gr=Ki,n0(Pe,Fe,Qr,Gr,pt,Et,re,oe,xe)&&(ei=t0(pt,Et,xe,Xe,b),ei<Xe&&(Xe=ei,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,_e.free(xe)}else it("Unknown Geometry type: "+le.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(He.$(a,x)&&He.$(y,E)||He.$(b,ee)&&He.$(z,re))return!1;var le=!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||He.$(oe.y,a))&&(oe.y<y||He.$(oe.y,y))&&(le=!0)):(y=a<x?a:x,a=a<x?x:a,(oe.x>y||He.$(oe.x,y))&&(oe.x<a||He.$(oe.x,a))&&(le=!0)),le)}Ce.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=_e.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)))),_e.free(z),b},Ce.Yc=function(a,y){if(this.fh(a,y)||y===void 0&&(y=this.transform,a.Re(this.actualBounds)))return!0;var x=Pt.alloc();x.set(y),x.Vj();var E=a.left,b=a.right,z=a.top;a=a.bottom;var ee=_e.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 _e.free(ee),!0;var re=_e.alloc(),oe=_e.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)))),_e.free(ee),Pt.free(x),_e.free(re),_e.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)}Ce.tx=function(a,y,x){function E(Xe,Ve){for(var st=Xe.length,ht=0;ht<st;ht+=2)if(Ve.zd(Xe[ht],Xe[ht+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,le=ee.x+ee.width;if(ee=ee.y+ee.height,gr(a.x,a.y,re,oe)<=b&&gr(a.x,a.y,le,oe)<=b&&gr(a.x,a.y,re,ee)<=b&&gr(a.x,a.y,le,ee)<=b)return!0}if(re=y.startX,oe=y.startY,le=y.endX,ee=y.endY,y.type===Dt.j){if(x=(re-le)*(a.x-le)+(oe-ee)*(a.y-ee),bi(a.x,a.y,re,oe,le,ee)<=(0<=(le-re)*(a.x-re)+(ee-oe)*(a.y-oe)&&0<=x?b:z))return!0}else{if(y.type===Dt.u)return y=!1,x&&(y=bi(a.x,a.y,re,oe,re,ee)<=b||bi(a.x,a.y,re,oe,le,oe)<=b||bi(a.x,a.y,le,oe,le,ee)<=b||bi(a.x,a.y,re,ee,le,ee)<=b),y;if(y.type===Dt.F){y=a.x-(re+le)/2,z=a.y-(oe+ee)/2;var he=Math.abs(le-re)/2,ge=Math.abs(ee-oe)/2;if(he===0||ge===0)return bi(a.x,a.y,re,oe,le,ee)<=b;if(x){if(a=He.$y(he,ge,y,z),a*a<=b)return!0}else return!(gr(y,z,-he,0)>=b||gr(y,z,0,-ge)>=b||gr(y,z,0,ge)>=b||gr(y,z,he,0)>=b)}else if(y.type===Dt.o){if(le=y.bounds,z=le.x,re=le.y,oe=le.x+le.width,le=le.y+le.height,a.x>oe&&a.x<z&&a.y>le&&a.y<re&&bi(a.x,a.y,z,re,z,le)>b&&bi(a.x,a.y,z,re,oe,re)>b&&bi(a.x,a.y,oe,le,z,le)>b&&bi(a.x,a.y,oe,le,oe,re)>b)return!1;if(z=Math.sqrt(b),x){if(this.fill===null?wi(y,a.x,a.y,z):Qi(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,le=0;le<oe;le++)switch(ge=re[le],ge.type){case _i:case Ci:if(ee=ge.endX,he=ge.endY,a.zd(ee,he)>b)return!1;break;case Dr:var xe=Hi();if(He.Qe(ee,he,ge.point1X,ge.point1Y,ge.point2X,ge.point2Y,ge.endX,ge.endY,.8,xe),ee=E(xe,a),Mi(xe),ee||(ee=ge.endX,he=ge.endY,a.zd(ee,he)>b))return!1;break;case ko:if(xe=Hi(),He.ep(ee,he,ge.point1X,ge.point1Y,ge.endX,ge.endY,.8,xe),ee=E(xe,a),Mi(xe),ee||(ee=ge.endX,he=ge.endY,a.zd(ee,he)>b))return!1;break;case br:case Cr:xe=ge.type===br?cr(ge,z):yr(ge,z,ee,he);var Pe=xe.length;if(Pe===0){if(ee=ge.type===br?ge.centerX:ge.endX,he=ge.type===br?ge.centerY:ge.endY,a.zd(ee,he)>b)return!1;break}ge=null;for(var Fe=Hi(),Ne=0;Ne<Pe;Ne++)if(ge=xe[Ne],Fe.length=0,He.Qe(ge[0],ge[1],ge[2],ge[3],ge[4],ge[5],ge[6],ge[7],.8,Fe),E(Fe,a))return Mi(Fe),!1;Mi(Fe),ge!==null&&(ee=ge[6],he=ge[7]);break;default:it("Unknown Segment type: "+ge.type)}}return!0}}}return!1},Ce.qc=function(){this.ua=null},Ce.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=Lo):a.fromArrow!=="None"&&(a.segmentIndex=0,a.alignmentFocus=new ni(1-Lo.x,Lo.y)))}ao.makeGeometry=function(a,y,x){if(a.toArrow!=="None")var E=Jh[a.toArrow];else a.fromArrow!=="None"?E=Jh[a.fromArrow]:(E=He.Ze[a.figure],typeof E=="string"&&(E=He.Ze[E]),E===void 0&&it("Unknown Shape.figure: "+a.figure),E=E(a,y,x),E.Sk=y,E.Rk=x);if(E===null){var b=He.Ze.Rectangle;typeof b=="function"&&(E=b(a,y,x))}return E};function y1(a){var y=Jh[a];if(y===void 0){var x=a.toLowerCase();if(x==="none")return"None";if(y=Jh[x],y===void 0){var E=null,b;for(b in He.um)if(b.toLowerCase()===x){E=b;break}if(E!==null)return a=Dt.parse(He.um[E],!1),Jh[E]=a,x!==E&&(Jh[x]=E),E}}return typeof y=="string"?y:y instanceof Dt?a:null}kt.Object.defineProperties(ao.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&&_a(this,a,"geometryString"))}}},geometryString:{get:function(){return this.geometry===null?"":this.geometry.toString()},set:function(a){a=Dt.parse(a);var y=a.normalize();this.geometry=a,this.position=a=_e.allocAt(-y.x,-y.y),_e.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&&Ic(a,"Shape.fill"),a instanceof Jo&&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&&Ic(a,"Shape.stroke"),a instanceof Jo&&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 Dn(a,"value >= 0",ao,"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"?Dn(a,'"butt", "round", or "square"',ao,"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"?Dn(a,'"miter", "bevel", or "round"',ao,"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)||it("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=He.Ze[a];typeof x=="function"?x=a:(x=He.Ze[a.toLowerCase()])||it("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?it("Unknown Shape.toArrow: "+a):y!==x&&(this.Ua===null&&(this.Ua=new Ur),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?it("Unknown Shape.fromArrow: "+a):y!==x&&(this.Ua===null&&(this.Ua=new Ur),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:er},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:er},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:Jr},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 Qh),this.fa.Tk=a;var x=this.diagram;x!==null&&this.panel===x.grid&&Uu(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 Qh),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 Qh),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 Qh),this.fa.o=a,this.v(),this.g("graduatedSkip",y,a))}}}),ao.prototype.intersectsRect=ao.prototype.Yc,ao.prototype.containedInRect=ao.prototype.fh,ao.prototype.getNearestIntersectionPoint=ao.prototype.rs,ao.prototype.getDocumentBounds=ao.prototype.mi,ao.prototype.getDocumentPoint=ao.prototype.ga;var Jh=new Sr,_v=new Sr;ao.className="Shape",ao.getFigureGenerators=function(){var a=new Ut,y;for(y in He.Ze)y!==y.toLowerCase()&&a.add(y,He.Ze[y]);return a.freeze(),a},ao.defineFigureGenerator=function(a,y){var x=a.toLowerCase(),E=He.Ze;E[a]=y,E[x]=a},ao.getArrowheadGeometries=function(){var a=new Ut;for(E in He.um)if(Jh[E]===void 0){var y=Dt.parse(He.um[E],!1);Jh[E]=y,y=E.toLowerCase(),y!==E&&(Jh[y]=E)}for(var x in Jh)if(x!==x.toLowerCase()){var E=Jh[x];E instanceof Dt&&a.add(x,E)}return a.freeze(),a},ao.defineArrowheadGeometry=function(a,y){var x=null;typeof y=="string"?x=Dt.parse(y,!1):x=y,y=a.toLowerCase(),y!=="none"&&a!==y||it("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+a);var E=Jh;E[a]=x,E[y]=a};function Iv(){this.nc=!1,this.Hr="butt",this.Ir="miter",this.Jr=10,this.uj=0,this.br=null,this.jq=Jr,this.gg=this.fg=er}Iv.prototype.copy=function(){var a=new Iv;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 Da(a,y){return bt.call(this),s0||(Dl=Ua?new Ys(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}Tt(Da,bt),Da.prototype.cloneProtected=function(a){bt.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 Hv:a.da.nc&&(a.da=a.da.copy())}Ce=Da.prototype,Ce.th=function(){bt.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}Ce.qb=function(a){a.classType===Da?this.wrap=a:bt.prototype.qb.call(this,a)},Ce.toString=function(){return 22<this.ec.length?'TextBlock("'+this.ec.substring(0,20)+'"...)':'TextBlock("'+this.ec+'")'},Ce.v=function(){bt.prototype.v.call(this)},Ce.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 le=this.isStrikethrough;Ya(this,a,this.xc,!0,!1,x,E),(oe||le)&&Ya(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 jo:a.translate(b,0),a.scale(-1,1);break;case ho:a.translate(0,z),a.scale(1,-1);break;case ma: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,le);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,le),E+=ee+ge}switch(this.flip){case jo:a.scale(-1,1),a.translate(-b,0);break;case ho:a.scale(1,-1),a.translate(0,-z);break;case ma:a.scale(-1,-1),a.translate(-b,-z)}}},Ce.Oj=function(a,y,x,E,b,z,ee,re,oe,le,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),le){re=r0!==null?r0(this,z):.8*z,oe=x+ge,le=E+re,b=x+ge+ee,re=E+re;var xe=a;y.beginPath(),y.lineWidth=xe,y.moveTo(oe,le),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"))}},Ce.kk=function(a,y,x){if(!bt.prototype.kk.call(this,a,y,x))return!1;if(Ya(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},Ce.nk=function(a){return 1<this.lineCount||this.isUnderline||this.isStrikethrough?!0:bt.prototype.nk.call(this,a)},Ce.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)}},Ce.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 le=z.indexOf(`
|
|
`,re);le===-1&&(le=z.length,oe=!0),re=z.substr(re,le-re),this.formatting===Xp&&(re=re.trim()),ee=Math.max(ee,Ju(re)),re=le+1}z=ee}else ee=z.indexOf(`
|
|
`,0),0<=ee&&(z=z.substr(0,ee)),z=Ju(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,le=this.spacingAbove+this.spacingBelow,le=Math.max(0,Yp(this)+le),oe=Math.min(this.maxLines-1,Math.max(Math.floor(oe/le+.01)-1,0)),!(oe+1>=this.Qb.length))){for(this.l|=16777216,le=this.Qb[oe],y=Math.max(1,a-y);Ju(le)>y&&1<le.length;)le=le.substr(0,le.length-1);le+=Jp,y=Ju(le),this.Qb[oe]=le,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),To(this.dc,z,ee),this.Ge(0,0,z,ee),this.svg!==null&&b!==this.Gc&&(this.Uc=!0)},Ce.eh=function(a,y,x,E){rl(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 le=Ju(y);if(oe===0||le<=x)a.Cb=Math.max(a.Cb,le),Up(a,y,a.Cb),E!==null&&E.h(le,re);else{for(z=up(a,ee),ee=ee.substr(z.length),y=up(a,ee),le=Ju(z+y);0<y.length&&le<=x;)z+=y,ee=ee.substr(y.length),y=up(a,ee),le=z+y,b&&(le=le.trim()),le=Ju(le);for(b&&(y=y.trim()),z+=y,x=Math.max(1,x-oe);Ju(z)>x&&1<z.length;)z=z.substr(0,z.length-1);a.l|=16777216,z+=Jp;var he=Ju(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);Ju(y)>x;){var ge=1;for(le=Ju(y.substr(0,ge)),he=0;le<=x;)ge++,he=le,le=Ju(y.substr(0,ge));if(ge===1){var xe=le;z=Math.max(z,le)}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),le=Ju(y+he);0<he.length&&le<=x;)y+=he,ee=ee.substr(he.length),he=up(a,ee),le=y+he,b&&(le=le.trim()),le=Ju(le);if(b&&(y=y.trim()),y!==""&&(y[y.length-1]==="\xAD"&&(y=y.substring(0,y.length-1)+"\u2010"),he.length===0?(ge=le,z=Math.max(z,le)):(ge=he=Ju(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 Ju(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=bn.alloc();Ov(a,z,y,oe),b+=oe.height,bn.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}kt.Object.defineProperties(Da.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:Bn},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,sl(this),this.g("verticalAlignment",y,a))}},naturalBounds:{get:function(){if(!this.dc.w()){var a=bn.alloc();Ov(this,this.ec,999999,a);var y=a.width;bn.free(a),a=w1(this,y);var x=this.desiredSize;isNaN(x.width)||(y=x.width),isNaN(x.height)||(a=x.height),To(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&&Ic(a,"TextBlock.stroke"),a instanceof Jo&&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 Qh),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 Qh),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 Qh),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 Qh),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 Qh),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&&Dn(a,"> 0",Da,"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 en(Da,"None",0),P1=new en(Da,"WrapFit",1),jv=new en(Da,"WrapDesiredSize",2),E1=new en(Da,"WrapBreakAll",3),zv=new en(Da,"OverflowClip",0),o0=new en(Da,"OverflowEllipsis",1),Xp=new en(Da,"FormatTrim",0),C1=new en(Da,"FormatNone",0),xS=/[ \u200b\u00ad]/,Zv=new Sr,b1=0,a0=new Sr,Gv=0,Jp="...",F1="",Dl=null,s0=!1;Da.className="TextBlock";function Hv(){this.nc=!1,this.Hd=null,this.Xf=Bn,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}Hv.prototype.copy=function(){var a=new Hv;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},Da.getEllipsis=function(){return Jp},Da.setEllipsis=function(a){Jp=a,a0=new Sr,Gv=0},Da.getBaseline=function(){return i0},Da.setBaseline=function(a){i0=a},Da.getUnderline=function(){return r0},Da.setUnderline=function(a){r0=a},Da.isValidFont=function(a){if(s0||(Dl=Ua?new Ys(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},Da.FormatNone=C1,Da.FormatTrim=Xp,Da.None=Rv,Da.OverflowClip=zv,Da.OverflowEllipsis=o0,Da.WrapBreakAll=E1,Da.WrapDesiredSize=jv,Da.WrapFit=P1;function Qh(){this.Tk=1,this.u=0,this.j=1,this.o=this.F=null}Qh.prototype.copy=function(){var a=new Qh;return a.Tk=this.Tk,a.u=this.u,a.j=this.j,a.F=this.F,a.o=this.o,a},Qh.className="GradElementSettings";function Tl(a,y){bt.call(this),this.Eg=null,this.qo="",this.Xg=ns,this.Nk=Gn,this.Zg=this.Hd=null,this.Mk=yo,this.Xf=Bn,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;Tt(Tl,bt),Tl.prototype.cloneProtected=function(a){bt.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===Bn||a===Ji||a===Ao?this.imageStretch=a:bt.prototype.qb.call(this,a)},Tl.prototype.toString=function(){return"Picture("+this.source+")#"+hr(this)};function dp(a){a===void 0&&(a=""),a!==""?hp[a]&&(delete hp[a],l0--):(hp=new Sr,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()||($e(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=Hi();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);Mi(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 ch)){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 le=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 Bn: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 Gn:ge=E.width,xe=E.height;break;case Ji:case Ao:Pe===Ji?(Pe=Math.min(E.height/xe,E.width/ge),ge*=Pe,xe*=Pe):Pe===Ao&&(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,Xe=oe*re/Ne,Ve=x.__goCache;Pe=null;var st=SS;if(!b){if(x.sq&&Ve!==void 0&&4<Ne&&Xe>st*st)for(Ve.gi===null&&(M1(Ve,4,le,he,x),M1(Ve,16,le,he,x)),b=Ve.gi,le=b.length,he=0;he<le&&b[he].ratio*b[he].ratio<Xe;he++)Pe=b[he];if(!y.Xm){if(this.vl===null)if(this.Eg===null)this.vl=!1;else{b=new Ys(null).context;try{b.drawImage(this.Eg,0,0)}catch(ht){this.en=!1}try{b.getImageData(0,0,1,1).data[3]&&(this.vl=!1),this.vl=!1}catch(ht){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 jo:a.translate(Math.min(E.width,ge),0),a.scale(-1,1);break;case ho:a.translate(0,Math.min(E.height,xe)),a.scale(1,-1);break;case ma: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(ht){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(ht){this.en=!1}switch(this.flip){case jo:a.scale(-1,1),a.translate(-Math.min(E.width,ge),0);break;case ho:a.scale(1,-1),a.translate(0,-Math.min(E.height,xe));break;case ma: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=cl(this,!0),ee=this.Eg,re=this.qn,oe=0,le=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,le=re?+ee.height:ee.naturalHeight),isFinite(b.width)||z===Gn||z===or?(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===Gn||z===Br?(isFinite(y)||(this.sourceRect.w()?y=this.sourceRect.height:ee!==null&&(y=le)),E=0):ee!==null&&this.al!==!1&&(y=this.sourceRect.w()?this.sourceRect.height:le),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)),To(this.dc,a,y),this.Ge(0,0,a,y)},Tl.prototype.eh=function(a,y,x,E){rl(this,a,y,x,E)},kt.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||it("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 Zn),E!==null&&x&&xd(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()||($e(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(Ua){var E=null;if(x[a]!==void 0)E=x[a];else if(a!==""){30<l0&&(dp(),x=hp),E=hi("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 Sr,Tl.clearCache=dp;function B1(){this.gi=null}function M1(a,y,x,E,b){a.gi===null&&(a.gi=[]);var z=new Ys(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 Dt,this.mc=null}cp.prototype.reset=function(a){a!==null?(a.ka(),this.os=a,a.figures.clear()):this.os=new Dt,this.mc=null};function fp(a,y,x,E,b,z){a.mc=new no,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 lr(_i);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 lr(Ci);E.endX=a,E.endY=y,x&&E.close(),this.mc.segments.add(E)};function tc(a,y,x,E,b,z,ee){var re;re===void 0&&(re=!1);var oe=new lr(Dr);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 lr(ko);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 lr(br);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 lr(Cr,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 ll(a,y){var x=a.toLowerCase(),E=He.Ze;E[a]=y,E[x]=a}ll("Rectangle",function(a,y,x){a="r"+y+","+x;var E=He.Mf[a];return E!==void 0||(E=new Dt(Dt.u),E.endX=y,E.endY=x,He.Nf<He.vm&&(He.Mf[a]=E,He.Nf++)),E}),ll("Square",function(a,y,x){a="s"+y+","+x;var E=He.Mf[a];return E!==void 0||(E=new Dt(Dt.u),E.endX=y,E.endY=x,E.defaultStretch=Ji,He.Nf<He.vm&&(He.Mf[a]=E,He.Nf++)),E}),ll("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=He.Mf[E];if(b!==void 0)return b;var z=a*He.wg;return b=new Dt().add(new no(a,0,!0).add(new lr(Ci,y-a,0)).add(new lr(Dr,y,a,y-z,0,y,z)).add(new lr(Ci,y,x-a)).add(new lr(Dr,y-a,x,y,x-z,y-z,x)).add(new lr(Ci,a,x)).add(new lr(Dr,0,x-a,z,x,0,x-z)).add(new lr(Ci,0,a)).add(new lr(Dr,a,0,0,z,z,0).close())),1<z&&(b.spot1=new ni(0,0,z,z),b.spot2=new ni(1,1,-z,-z)),He.Nf<He.vm&&(He.Mf[E]=b,He.Nf++),b}),ll("Border","RoundedRectangle"),ll("Ellipse",function(a,y,x){a="e"+y+","+x;var E=He.Mf[a];return E!==void 0||(E=new Dt(Dt.F),E.endX=y,E.endY=x,E.spot1=oo,E.spot2=Yr,He.Nf<He.vm&&(He.Mf[a]=E,He.Nf++)),E}),ll("Circle",function(a,y,x){a="c"+y+","+x;var E=He.Mf[a];return E!==void 0||(E=new Dt(Dt.F),E.endX=y,E.endY=x,E.spot1=oo,E.spot2=Yr,E.defaultStretch=Ji,He.Nf<He.vm&&(He.Mf[a]=E,He.Nf++)),E}),ll("TriangleRight",function(a,y,x){return new Dt().add(new no(0,0).add(new lr(Ci,y,.5*x)).add(new lr(Ci,0,x).close())).pm(0,.25,.5,.75)}),ll("TriangleDown",function(a,y,x){return new Dt().add(new no(0,0).add(new lr(Ci,y,0)).add(new lr(Ci,.5*y,x).close())).pm(.25,0,.75,.5)}),ll("TriangleLeft",function(a,y,x){return new Dt().add(new no(y,x).add(new lr(Ci,0,.5*x)).add(new lr(Ci,y,0).close())).pm(.5,.25,1,.75)}),ll("TriangleUp",function(a,y,x){return new Dt().add(new no(y,x).add(new lr(Ci,0,x)).add(new lr(Ci,.5*y,0).close())).pm(.25,.5,.75,1)}),ll("Triangle","TriangleUp"),ll("Diamond",function(a,y,x){return new Dt().add(new no(.5*y,0).add(new lr(Ci,0,.5*x)).add(new lr(Ci,.5*y,x)).add(new lr(Ci,y,.5*x).close())).pm(.25,.25,.75,.75)}),ll("LineH",function(a,y,x){return a=new Dt(Dt.j),a.startX=0,a.startY=x/2,a.endX=y,a.endY=x/2,a}),ll("LineV",function(a,y,x){return a=new Dt(Dt.j),a.startX=y/2,a.startY=0,a.endX=y/2,a.endY=x,a}),ll("None","Rectangle"),ll("BarH","Rectangle"),ll("BarV","Rectangle"),ll("MinusLine","LineH"),ll("PlusLine",function(a,y,x){return new Dt().add(new no(0,x/2,!1).add(new lr(Ci,y,x/2)).add(new lr(_i,y/2,0)).add(new lr(Ci,y/2,x)))}),ll("XLine",function(a,y,x){return new Dt().add(new no(0,x,!1).add(new lr(Ci,y,0)).add(new lr(_i,0,0)).add(new lr(Ci,y,x)))}),ll("LineRight",function(a,y,x){return new Dt().add(new no(.25*y,0,!1).add(new lr(Ci,.75*y,.5*x)).add(new lr(Ci,.25*y,x)))}),ll("LineDown",function(a,y,x){return new Dt().add(new no(0,.25*x,!1).add(new lr(Ci,.5*y,.75*x)).add(new lr(Ci,y,.25*x)))}),ll("LineLeft",function(a,y,x){return new Dt().add(new no(.75*y,0,!1).add(new lr(Ci,.25*y,.5*x)).add(new lr(Ci,.75*y,x)))}),ll("LineUp",function(a,y,x){return new Dt().add(new no(0,.75*x,!1).add(new lr(Ci,.5*y,.25*x)).add(new lr(Ci,y,.75*x)))}),He.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 Wv(){this.nc=!1,this.tr=this.Kp=this.zq=null,this.vr="",this.fr=this.oq=this.ur=null,this.hr="",this.gr=Io,this.ir=null,this.jr="",this.lr=er,this.Gq="",this.Hq=Xo,this.Pq=Vn,this.Kq=qn,this.Up=null,this.Cq=127,this.zr=ki,this.yr="gray",this.Vg=4}Wv.prototype.copy=function(){var a=new Wv;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 Ps||typeof a=="string"?Xn.call(this,a):(Xn.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 _e(NaN,NaN).freeze(),this.nf=null,this.Ao=NaN,this.vw=-1,this.py=new zt,this.Rh=null,this.ag=NaN,y&&Object.assign(this,y)}Tt(mr,Xn),mr.prototype.cloneProtected=function(a){Xn.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},Ce=mr.prototype,Ce.Af=function(a){Xn.prototype.Af.call(this,a),a.oh(),a.Ug=null,a.nf=null,a.Rh=null},Ce.toString=function(){var a=Ri(this.constructor)+"#"+hr(this);return this.data!==null&&(a+="("+dr(this.data)+")"),a};function _l(a){a.P===null?a.P=new Wv:a.P.nc&&(a.P=a.P.copy())}Ce.th=function(){Xn.prototype.th.call(this),this.P!==null&&(this.P.nc=!0)},Ce.gk=function(a,y,x,E,b,z,ee){var re=this.diagram;re!==null&&(a===ta&&y==="elements"?b instanceof Xn?Nf(b,function(oe){vy(re.partManager,oe),Xd(re,oe)}):xd(re,b):a===Sa&&y==="elements"&&(b instanceof Xn?Nf(b,function(oe){yy(re.partManager,oe,re)}):lg(re,b)),re.cb(a,y,x,E,b,z,ee))},Ce.La=function(a){if(Xn.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 Xn&&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 Ut),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=Hi();for(a=a.iterator;a.next();)y.push(a.key);a=y.length;for(var x=0;x<a;x++)this.Jf(y[x]);Mi(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 qr?a.groupSelectionAdornmentTemplate:a.nodeSelectionAdornmentTemplate),!(x instanceof $o))break e;Ru(x),x=x.copy(),x!==null&&(this.ph()&&this.selectionObject===this.path&&(x.type=Xn.Link),x.adornedObject=y)}if(x!==null){x.type===Xn.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(jc(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,jc(a)!==!1){var y=a.position,x=a.location;x.w()&&y.w()||_1(a,y,x),x=a.Ib;var E=zt.alloc().assign(x);x.ka(),x.x=y.x,x.y=y.y,x.freeze(),a.Xl(E,x),zt.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 Pt);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=yo;this.locationSpot.sb()&&(z=this.locationSpot);var ee=_e.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),_e.free(ee)}},mr.prototype.move=function(a,y){y===!0?this.location=a:this.position=a},mr.prototype.moveTo=function(a,y,x){a=_e.allocAt(a,y),this.move(a,x),_e.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 Ut),y.I(a)!==null)return y.I(a);var x=Xn.prototype.fb.call(this,a);return x!==null?(y.set(a,x),x):(y.set(a,null),null)};function nc(a,y,x,E){E===void 0&&(E=new _e),x=x.Mc()?yo: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 zt),a.assign(this.actualBounds)},mr.prototype.Va=function(){this.measure(1/0,1/0),this.arrange()};function D1(a){var y=_e.alloc(),x=a.locationObject,E=x.naturalBounds,b=x instanceof ao?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 _f(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(gt(this)===!1)N1(this);else{xt(this,!1);var a=this.Ib,y=zt.alloc();y.assign(a);var x=zc(this);this.eh(0,0,this.uc.width,this.uc.height);var E=this.position;_1(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()||He.B(y.width,a.width)&&He.B(y.height,a.height)||0<=this.vw&&this.C(16),zt.free(y),Uv(this,!1)}},Ce=mr.prototype,Ce.Xl=function(a,y){var x=this.diagram;if(x!==null){var E=!1;if(x.Zi===!1&&a.w()){var b=zt.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),zt.free(b)}!(this.G&65536)&&a.D(y)||R1(this,E,x),x.N(),!a.w()&&!y.w()||Zo(a,y)||(this instanceof Fi&&!x.undoManager.isUndoingRedoing&&this.Bd(),this.oh())}},Ce.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 _e(E.x+(a.x-y),E.y+(a.y-x)),this.g("location",E,this.ke.copy())),jc(this)===!1&>(this)===!1&&(d0(this),N1(this)),!0};function T1(a,y,x,E,b){y===null||a instanceof $o||(y=y.animationManager,y.zb&&cf(y,a,new _e(E,b),x))}Ce.mm=function(a,y,x){var E=this.ke,b=this.pa;if(x){if(E.x===a&&E.y===y)return;jc(this)||gt(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)},Ce.Av=function(){this.G&=-2097153,d0(this)};function _1(a,y,x){var E=D1(a),b=a.diagram,z=x.w(),ee=y.w();z&&ee?a.G&2097152?I1(a,y,x,b,E):O1(a,y,x,b,E):z?I1(a,y,x,b,E):ee&&O1(a,y,x,b,E),a.G|=2097152,_e.free(E),a.Uk()}function I1(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 $o||cf(x,a,new _e(z,ee),y),E||y.x===z&&y.y===ee||a.g("position",new _e(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 Fi&&wd(x,a),a.layer.isTemporary||y||x.Ya(),y=a.Ib;var E=x.viewportBounds;E.w()?zc(a)?(ga(y,E)||a.Fd(!1),a.updateAdornments()):a.isVisible()&&y.Yc(E)?(a.Fd(!0),a.updateAdornments()):a.Wb():x.vd=!0}Ce.si=function(){return!0},Ce.Zc=function(){return!0},Ce.ph=function(){return!1},Ce.Dd=function(){return!0};function Kv(a,y,x,E){y.constructor===a.constructor||Z1||(Z1=!0,Di('Should not change the class of the Part when changing category from "'+x+'" to "'+E+'"'),Di(" Old class: "+Ri(a.constructor)+", new class: "+Ri(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,le=!1;a instanceof Fi&&(re=a.isTreeLeaf,oe=a.isTreeExpanded,le=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 Fi&&(a.U=re?a.U|4:a.U&-5,a.U=oe?a.U|1:a.U&-2,a.U=le?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 jc(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 zc(a){return(a.G&131072)!==0}Ce=mr.prototype,Ce.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}Ce.oh=function(){var a=this.containingGroup;a!==null&&(a.v(),a.placeholder!==null&&a.placeholder.v(),a.Bd())},Ce.N=function(){var a=this.diagram;a!==null&&!gt(this)&&!jc(this)&&this.isVisible()&&this.Ib.w()&&a.N(_f(this,this.Ib))},Ce.v=function(){Xn.prototype.v.call(this);var a=this.diagram;a!==null&&(a.De.add(this),this instanceof Fi&&this.labeledLink!==null&&sl(this.labeledLink),a.$b(!0))},Ce.Vo=function(a){a||(a=this.Ah,a!==null&&ey(a,this))},Ce.Wo=function(a){a||(a=this.Ah,a!==null&&ty(a,this))},Ce.Lj=function(){var a=this.data;if(a!==null){var y=this.diagram;y!==null&&(y=y.model,y!==null&&y.cm(a))}},Ce.oz=function(){return Xv(this,this)};function Xv(a,y){var x=y.containingGroup;return x!==null?1+Xv(a,x):y instanceof Fi&&(y=y.labeledLink,y!==null)?Xv(a,y):0}Ce.sz=function(){return j1(this,this)};function j1(a,y){var x=y.containingGroup;return x!==null||y instanceof Fi&&(x=y.labeledLink,x!==null)?j1(a,x):y}Ce.Td=function(a){return a instanceof qr?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 Fi&&(y=y.labeledLink,y!==null)?Jv(a,y,x):!1:!0}Ce.px=function(a){if(a===null)return null;if(this===a)return this.containingGroup;for(var y=this;y!==null;){if(y instanceof qr&&c0(y,!0),y instanceof Fi){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 Fi&&(a=y.labeledLink,a!==null&&(y=a)),y=y.containingGroup}for(y=this;y!==null;)y instanceof qr&&c0(y,!1),y instanceof Fi&&(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 Fi&&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 Fi&&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 Zc(a,y,x,E,b,z){if(z===void 0&&(z=null),!(a.contains(y)||z!==null&&!z(y)||y instanceof $o)){if(a.add(y),y instanceof Fi){if(x&&y instanceof qr)for(var ee=y.memberParts;ee.next();)Zc(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,le=re.toNode;oe=oe===null||a.contains(oe),le=le===null||a.contains(le),(b?oe&&le:oe||le)&&Zc(a,re,x,E,b,z)}}if(1<E)for(y=y.Ou();y.next();)Zc(a,y.value,x,E-1,b,z)}else if(y instanceof ti)for(y=y.labelNodes;y.next();)Zc(a,y.value,x,E,b,z)}}kt.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?bo: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(Sa,"parts",y,this,null,E,!0),E=a.oi(99999999,this,!0),y.visible!==a.visible&&this.Zb(a.visible),0<=E&&x.cb(ta,"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&&(_l(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 $o?this.type!==Xn.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:Vn},set:function(a){var y=this.minLocation;y.D(a)||(a=a.J(),_l(this),this.P.Pq=a,this.g("minLocation",y,a))}},maxLocation:{get:function(){return this.P!==null?this.P.Kq:qn},set:function(a){var y=this.maxLocation;y.D(a)||(a=a.J(),_l(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&&(_l(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:Xo},set:function(a){var y=this.locationSpot;y.D(a)||(a=a.J(),_l(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,gt(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 $o)){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 $o?this instanceof $o&&(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&&(Ru(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&&(Ru(x),x=x.copy(),x===null||x instanceof ti||(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&&(_l(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&&(_l(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&&(_l(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 ti?(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&&(_l(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&&(_l(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&&(_l(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:Io},set:function(a){var y=this.resizeCellSize;y.D(a)||(a=a.J(),_l(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&&(_l(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&&(_l(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:er},set:function(a){var y=this.rotationSpot;y.D(a)||(a=a.J(),_l(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&&it("Cannot make a Group a member of itself: "+this.toString()),it("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 qr&&x!==null&&x.ai.remove(this),this.Ah=a,a!==null?ey(a,this):this instanceof qr&&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 qr){for(x=new Zn,Zc(x,this,!0,0,!0),x=x.iterator;x.next();)if(E=x.value,E instanceof Fi)for(E=E.linksConnected;E.next();)gp(E.value)}if(this instanceof Fi){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 it("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&&(_l(this),this.P.Kp=a,this.g("containingGroupChanged",y,a))}},isTopLevel:{get:function(){return!(this.containingGroup!==null||this instanceof Fi&&this.labeledLink!==null)}},layoutConditions:{get:function(){return this.P!==null?this.P.Cq:127},set:function(a){var y=this.layoutConditions;y!==a&&(_l(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&&(_l(this),this.P.Up=a,this.g("dragComputation",y,a))}},shadowOffset:{get:function(){return this.P!==null?this.P.zr:ki},set:function(a){var y=this.shadowOffset;y.D(a)||(a=a.J(),_l(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&&(_l(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&&(_l(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 $o(a,y){a===void 0||a instanceof Ps||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)}Tt($o,mr),$o.prototype.toString=function(){var a=this.adornedPart;return"Adornment("+this.category+")"+(a!==null?a.toString():"")},$o.prototype.updateRelationshipsFromData=function(){},$o.prototype.Ul=function(a){var y=this.adornedObject,x=y==null?void 0:y.part;if(x instanceof ti&&y instanceof ao){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 ao&&(b.ua=a)}}},$o.prototype.si=function(){var a=this.ue;return a===null?!0:(a=a.part,a===null||!gt(a))},$o.prototype.Zc=function(){return!1},$o.prototype.gk=function(a,y,x,E,b,z,ee){if(a===ta&&y==="elements"){if(b instanceof xl)this.$a===null&&(this.$a=b);else if(b instanceof Xn){var re=b.Nl(function(oe){return oe instanceof xl});re instanceof xl&&this.$a===null&&(this.$a=re)}}else a===Sa&&y==="elements"&&this.$a!==null&&(E===this.$a?this.$a=null:E instanceof Xn&&this.$a.rg(E)&&(this.$a=null));mr.prototype.gk.call(this,a,y,x,E,b,z,ee)},$o.prototype.updateAdornments=function(){},$o.prototype.Lj=function(){},kt.Object.defineProperties($o.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}}}),$o.className="Adornment";function Qv(){this.nc=!1,this.Vr=this.gj=this.Eq=this.Dq=null,this.yp=Vo,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 Fi(a,y){a===void 0||a instanceof Ps||typeof a=="string"?mr.call(this,a):(mr.call(this),a&&(y=a)),this.U=13,this.Ba=null,this.jb=new Tn,this.wc=this.af=this.Yk=null,this.ci=!1,y&&Object.assign(this,y)}Tt(Fi,mr),Fi.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())},Ce=Fi.prototype,Ce.Af=function(a){mr.prototype.Af.call(this,a),a.Bd(),a.af=this.af,a.wc=null};function ic(a){a.Ba===null?a.Ba=new Qv:a.Ba.nc&&(a.Ba=a.Ba.copy())}Ce.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 Zn),a.af.add(y))}function H1(a,y,x,E){if(y===null||a.af===null)return null;for(var b=a.af.iterator;b.next();){var z=b.value;if(z.Ds===a&&z.cv===y&&z.Ox===x&&z.Px===E||z.Ds===y&&z.cv===a&&z.Ox===E&&z.Px===x)return z}return null}Ce.Lz=function(a,y,x){y==null&&(y=""),x==null&&(x=""),a=H1(this,a,y,x),a!==null&&a.Sl()},Ce.gk=function(a,y,x,E,b,z,ee){a===ta&&y==="elements"?this.wc=null:a===Sa&&y==="elements"&&(this.wc=null),mr.prototype.gk.call(this,a,y,x,E,b,z,ee)},Ce.Bd=function(a){for(var y=this.linksConnected;y.next();){var x=y.value;a!==void 0&&a.contains(x)||($l(x.fromPort),$l(x.toPort),x.bb())}};function W1(a,y){for(a=a.linksConnected;a.next();){var x=a.value;(x.fromPort===y||x.toPort===y)&&($l(x.fromPort),$l(x.toPort),x.bb())}}function $l(a){if(a!==null){var y=a.Zn;y!==null&&y.Sl(),a=a.part,y=a.containingGroup,y===null||a.isVisible()||$l(y.port)}}Ce.si=function(){return!0},Fi.prototype.getAvoidableRect=function(a){return a.set(this.actualBounds),a.Co(this.avoidableMargin),a},Fi.prototype.findVisibleNode=function(){for(var a=this;a!==null&&!a.isVisible();)a=a.containingGroup;return a},Fi.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===rs){if(a=a?this.Oo():this.Po(),0<a.count&&a.all(function(E){return!E.isTreeExpanded}))return!1}else if(y===Cd&&(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},Fi.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)}},Fi.prototype.qx=function(){var a=new Zn,y=new Zn;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)})}}Fi.prototype.findLinksConnected=function(a){if(a===void 0&&(a=null),a===null)return this.jb.iterator;var y=new so(this.jb),x=this;return y.predicate=function(E){return E.fromNode===x&&E.fromPortId===a||E.toNode===x&&E.toPortId===a},y},Ce=Fi.prototype,Ce.Mo=function(a){a===void 0&&(a=null);var y=new so(this.jb),x=this;return y.predicate=function(E){return E.fromNode!==x?!1:a===null?!0:E.fromPortId===a},y},Ce.Sd=function(a){a===void 0&&(a=null);var y=new so(this.jb),x=this;return y.predicate=function(E){return E.toNode!==x?!1:a===null?!0:E.toPortId===a},y},Ce.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 Zn,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 Zn,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new fo(x):bo},Ce.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 Zn,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new fo(x):bo},Ce.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 Zn,y.add(x),y.add(b)):x=b)}return y!==null?y.iterator:x!==null?new fo(x):bo},Ce.jz=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null);var E=new so(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},Ce.kz=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null);var E=new so(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){$l(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){$l(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}}}Fi.prototype.updateRelationshipsFromData=function(){var a=this.diagram;a!==null&&a.partManager.updateRelationshipsFromData(this)},Ce=Fi.prototype,Ce.Vo=function(a){mr.prototype.Vo.call(this,a),a||(Qp(this),a=this.Yk,a!==null&&ex(a,this))},Ce.Wo=function(a){mr.prototype.Wo.call(this,a),a||(a=this.Yk,a!==null&&a.wd!==null&&(a.wd.remove(this),a.v()))},Ce.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)},Ce.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 Ut: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=Hi()),x.push(E);if(x!==null){for(a=0;a<x.length;a++)y.remove(x[a]);Mi(x)}}}Ce.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},Ce.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}},Ce.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},Ce.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},Ce.pg=function(){var a=this.ci;if(a===null)return null;if(a instanceof Fi)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},Ce.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 Zn;return a(this,y),y},Ce.uz=function(){return Y1(this,this)};function Y1(a,y){return y=y.pg(),y===null?0:1+Y1(a,y)}Ce.Qo=function(){var a=!0,y=this.diagram;y!==null&&(a=y.isTreePathToChildren),y=new so(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},Ce.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 Tn,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 Tn,y.add(x),y.add(a)):x=a);return y!==null?y.iterator:x!==null?new fo(x):bo},Ce.wz=function(a){a===void 0&&(a=1/0);var y=new Zn;return Zc(y,this,!1,a,!0),y},Fi.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 Zn;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 le=re.value;if(le.isTreeLink&&(le=le.To(a),le!==null&&le!==a)){var he=y.contains(le);if(he||y.add(le),ee){var ge=x?le.Oo():le.Po();oe.uv=a,ge.all(function(xe){return function(Pe){return Pe===xe.uv||!Pe.isTreeExpanded}}(oe))&&E.Aj(le,b),le.oh(),le.Zb(!1)}le.isTreeExpanded&&(le.wasTreeExpanded=le.isTreeExpanded,he||J1(le,y,x,E,b,z))}oe={uv:oe.uv}}a.isTreeExpanded=!1}Fi.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 Zn;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(),le={};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();le.vv=a,ge.all(function(xe){return function(Pe){return Pe===xe.vv||!Pe.isTreeExpanded}}(le))&&b.Cj(he,z)}(2<E||he.wasTreeExpanded)&&(he.wasTreeExpanded=!1,Q1(he,y,x,E-1,b,z,ee))}le={vv:le.vv}}a.isTreeExpanded=!0}kt.Object.defineProperties(Fi.prototype,{portSpreading:{get:function(){return this.Ba!==null?this.Ba.er:p0},set:function(a){var y=this.portSpreading;y!==a&&(ic(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&&wd(x,this),this.g("avoidable",y,a)}}},avoidableMargin:{get:function(){return this.Ba!==null?this.Ba.yp:Vo},set:function(a){typeof a=="number"&&(a=new Vr(a));var y=this.avoidableMargin;if(!y.D(a)){a=a.J(),ic(this),this.Ba.yp=a;var x=this.diagram;x!==null&&wd(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&&(ic(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&&(ic(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&&(ic(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),sl(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&&(ic(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))}}}),Fi.prototype.expandTree=Fi.prototype.expandTree,Fi.prototype.collapseTree=Fi.prototype.collapseTree,Fi.prototype.findTreeParts=Fi.prototype.wz,Fi.prototype.findTreeChildrenNodes=Fi.prototype.Ou,Fi.prototype.findTreeChildrenLinks=Fi.prototype.Qo,Fi.prototype.findTreeLevel=Fi.prototype.uz,Fi.prototype.findTreeParentChain=Fi.prototype.vz,Fi.prototype.findTreeParentNode=Fi.prototype.pg,Fi.prototype.findTreeParentLink=Fi.prototype.kh,Fi.prototype.findCommonTreeParent=Fi.prototype.gz,Fi.prototype.findTreeRoot=Fi.prototype.xz,Fi.prototype.isInTreeOf=Fi.prototype.Nz,Fi.prototype.findPort=Fi.prototype.ns,Fi.prototype.findLinksTo=Fi.prototype.kz,Fi.prototype.findLinksBetween=Fi.prototype.jz,Fi.prototype.findNodesInto=Fi.prototype.Oo,Fi.prototype.findNodesOutOf=Fi.prototype.Po,Fi.prototype.findNodesConnected=Fi.prototype.Mu,Fi.prototype.findLinksInto=Fi.prototype.Sd,Fi.prototype.findLinksOutOf=Fi.prototype.Mo,Fi.prototype.findExternalTreeLinksConnected=Fi.prototype.qx,Fi.prototype.invalidateConnectedLinks=Fi.prototype.Bd,Fi.prototype.invalidateLinkBundle=Fi.prototype.Lz;var CS=new en(Fi,"SpreadingNone",10),p0=new en(Fi,"SpreadingEvenly",11),qv=new en(Fi,"SpreadingPacked",12);Fi.className="Node",Fi.SpreadingNone=CS,Fi.SpreadingEvenly=p0,Fi.SpreadingPacked=qv;function qr(a,y){a===void 0||a instanceof Ps||typeof a=="string"?Fi.call(this,a):(Fi.call(this),a&&(y=a)),this.U|=4608,this.Gn=new Zn,this.$a=null,this.Sc=new Ga,this.Sc.group=this,this.gl=new Zn,this.tb=this.$p=null,y&&Object.assign(this,y)}Tt(qr,Fi),qr.prototype.cloneProtected=function(a){Fi.prototype.cloneProtected.call(this,a),this.U=this.U&-32769;var y=a.Nl(function(x){return x instanceof xl});y instanceof xl?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())},Ce=qr.prototype,Ce.Af=function(a){Fi.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 Fi)x.Bd(y);else if(x instanceof ti)for(x=x.labelNodes;x.next();)x.value.Bd(y)}},Ce.gk=function(a,y,x,E,b,z,ee){if(a===ta&&y==="elements"){if(b instanceof xl)this.$a===null?this.$a=b:this.$a!==b&&it("Cannot insert a second Placeholder into the visual tree of a Group.");else if(b instanceof Xn){var re=b.Nl(function(oe){return oe instanceof xl});re instanceof xl&&(this.$a===null?this.$a=re:this.$a!==re&&it("Cannot insert a second Placeholder into the visual tree of a Group."))}}else a===Sa&&y==="elements"&&this.$a!==null&&(E===this.$a?this.$a=null:E instanceof Xn&&this.$a.rg(E)&&(this.$a=null));Fi.prototype.gk.call(this,a,y,x,E,b,z,ee)},Ce.Xl=function(a,y){Fi.prototype.Xl.call(this,a,y),this.isClipping&&this.type!==Xn.Spot&&this.isSubGraphExpanded&&(a=this.resizeObject,a instanceof Xn&&(a=a.Pb()),this.tb===null&&(this.tb=new zt),a.mi(this.tb),a instanceof ao&&this.tb.Bc(-a.strokeWidth,-a.strokeWidth))},Ce.eh=function(a,y,x,E){this.nf=this.$a,Fi.prototype.eh.call(this,a,y,x,E)},Ce.Va=function(){var a=this;a.isSubGraphExpanded&&this.memberParts.each(function(y){!a.computesBoundsIncludingLinks&&y instanceof ti||y.Va()}),Fi.prototype.Va.call(this)},Ce.si=function(){if(!Fi.prototype.si.call(this))return!1;for(var a=this.memberParts;a.next();){var y=a.value;if(y instanceof Fi){if(y.isVisible()&>(y))return!1}else if(y instanceof ti&&y.isVisible()&>(y)&&y.fromNode!==this&&y.toNode!==this)return!1}return!0};function ey(a,y){if(a.Gn.add(y)){y instanceof qr&&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 ti&&!a.computesBoundsIncludingLinks||(y=a.$a,y===null&&(y=a),y.v())}function ty(a,y){if(a.Gn.remove(y)){y instanceof qr&&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 ti&&!a.computesBoundsIncludingLinks||(y=a.$a,y===null&&(y=a),y.v())}Ce.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)}Fi.prototype.Lj.call(this)},qr.prototype.canAddMembers=function(a){var y=this.diagram;if(y===null)return!1;for(y=y.commandHandler,a=un(a).iterator;a.next();)if(!y.isValidMember(this,a.value))return!1;return!0},qr.prototype.addMembers=function(a,y){var x=this.diagram;if(x===null)return!1;x=x.commandHandler;var E=!0;for(a=un(a).iterator;a.next();){var b=a.value;!y||x.isValidMember(this,b)?b.containingGroup=this:E=!1}return E},qr.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))},Ce=qr.prototype,Ce.Bd=function(a){var y=(this.U&65536)!==0;if(Fi.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()?($l(x.fromPort),$l(x.toPort),x.bb()):(E=x.toNode,E!==null&&E!==this&&E.Td(this)&&!E.isVisible()&&($l(x.fromPort),$l(x.toPort),x.bb()))}}},Ce.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 Zn,E=y.iterator;E.next();){var b=E.value;if(b instanceof Fi)for(b=b.linksConnected;b.next();){var z=b.value;y.contains(z)||x.add(z)}}return a&&(this.$p=x),x.iterator},Ce.iz=function(){var a=this.Rj();a.add(this);for(var y=new Zn,x=a.iterator;x.next();){var E=x.value;if(E instanceof Fi)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},Ce.hz=function(){function a(x,E){x!==null&&(E.add(x),a(x.containingGroup,E))}var y=new Zn;return a(this,y),y},Ce.Rj=function(){var a=new Zn;return Zc(a,this,!0,0,!0),a.remove(this),a},Ce.Zb=function(a){Fi.prototype.Zb.call(this,a);for(var y=this.memberParts;y.next();)y.value.Zb(a)},qr.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 qr&&z.isSubGraphExpanded&&(z.wasSubGraphExpanded=z.isSubGraphExpanded,$1(z,y,x,E)),z instanceof Fi)z.Bd(y),x.Aj(z,E);else if(z instanceof ti)for(z=z.labelNodes;z.next();)z.value.Bd(y)}a.isSubGraphExpanded=!1}qr.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 qr&&z.wasSubGraphExpanded&&(z.wasSubGraphExpanded=!1,q1(z,y,x,E)),z instanceof Fi)z.Bd(y),x.Cj(z,E);else if(z instanceof ti)for(z=z.labelNodes;z.next();)z.value.Bd(y)}a.isSubGraphExpanded=!0}qr.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=_e.alloc(),Fi.prototype.move.call(this,a,y),a=new Zn,y=this.Rj().iterator;y.next();)b=y.value,b instanceof ti&&(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 Fi&&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 ti&&(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());_e.free(z)}},kt.Object.defineProperties(qr.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&&it("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&&(ic(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&&(ic(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&&(ic(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&&(ic(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)}}}),qr.prototype.expandSubGraph=qr.prototype.expandSubGraph,qr.prototype.collapseSubGraph=qr.prototype.collapseSubGraph,qr.prototype.findSubGraphParts=qr.prototype.Rj,qr.prototype.findContainingGroupChain=qr.prototype.hz,qr.prototype.findExternalNodesConnected=qr.prototype.iz,qr.prototype.findExternalLinksConnected=qr.prototype.Lu,qr.prototype.ensureBounds=qr.prototype.Va,qr.className="Group";function xl(a){bt.call(this),this.yb=is,this.ko=new zt(NaN,NaN,NaN,NaN),a&&Object.assign(this,a)}Tt(xl,bt),xl.prototype.cloneProtected=function(a){bt.prototype.cloneProtected.call(this,a),a.yb=this.yb.J(),a.ko=this.ko.copy()},xl.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)},xl.prototype.Wl=function(){var a=this.part;if(a!==null&&(a instanceof qr||a instanceof $o)||it("Placeholder is not inside a Group or Adornment."),a instanceof qr){var y=this.computeBorder(this.ko),x=this.minSize,E=this.dc;for(To(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=_e.alloc(),x.xi(y,a.locationSpot),x.D(a.location)||(a.location=x),_e.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 ao&&(ee=z.strokeWidth);var re=z.Df(),oe=z.naturalBounds,le=(oe.width+ee)*re;ee=(oe.height+ee)*re,a.type!==Xn.Link&&(re=z.ga(a.category==="Selection"?Xo:a.locationSpot,_e.alloc()),a.location=re,_e.free(re)),isNaN(le)||isNaN(ee)?(a=z.ga(Xo,_e.alloc()),le=zt.allocAt(a.x,a.y,0,0),le.Ye(z.ga(Xt,a)),le.Ye(z.ga(ms,a)),le.Ye(z.ga(ls,a)),To(y,le.width+E||0,le.height+b||0),this.Ge(-x.left,-x.top,y.width,y.height),_e.free(a),zt.free(le)):(To(y,le+E||0,ee+b||0),this.Ge(-x.left,-x.top,y.width,y.height))}},xl.prototype.eh=function(a,y,x,E){this.actualBounds.h(a,y,x,E)},xl.prototype.computeBorder=function(a){var y=this.part,x=y.diagram,E=x===null||!x.animationManager.isAnimating;if(x!==null&&y instanceof qr&&!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=zt.alloc(),b=this.computeMemberBounds(x);var z=this.yb;return y instanceof qr&&!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)),zt.free(x),E&&y instanceof qr&&y.computesBoundsIncludingLocation&&y.location.w()&&a.Ye(y.location),a},xl.prototype.computeMemberBounds=function(a){if(!(this.part instanceof qr))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 ti&&(!y.computesBoundsIncludingLinks||qe(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},kt.Object.defineProperties(xl.prototype,{padding:{get:function(){return this.yb},set:function(a){typeof a=="number"&&(a=new Vr(a));var y=this.yb;y.D(a)||(this.yb=a=a.J(),this.g("padding",y,a),this.v())}}}),xl.className="Placeholder";function ti(a){mr.call(this,Xn.Link),this.Qa=8,this.ef=null,this.ff="",this.uf=this.gn=null,this.vf="",this.uo=null,this.qk=Sl,this.Om=0,this.Qm=Sl,this.Rm=NaN,this.qj=ay,this.po=.5,this.wd=null,this.Nb=new Tn().freeze(),this.Tg=this.Mg=null,this.ml=new zt,this.ua=new Dt,this.u=this.o=this.Sf=this.Wf=null,this.su=new _e,this.cq=this.Mw=this.Lw=null,this.vt=NaN,this.ba=null,this.j=[],a&&Object.assign(this,a)}Tt(ti,mr),ti.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())},Ce=ti.prototype,Ce.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&&$l(y),a=a.toPort,a!==null&&$l(a)},Ce.qb=function(a){a.classType===ti?(a.value&2)===2?this.routing=a:a===fu||a===oc||a===mp?this.curve=a:a===em||a===w0||a===P0?this.adjusting=a:a!==ay&&a!==Sl&&it("Unknown Link enum value for a Link property: "+a):mr.prototype.qb.call(this,a)},Ce.Xc=function(){this.ba===null&&(this.ba=new io)},Ce.si=function(){var a=this.fromNode;if(a!==null){var y=a.findVisibleNode();if(y!==null&&(a=y),gt(a)||jc(a))return!1}return a=this.toNode,!(a!==null&&(y=a.findVisibleNode(),y!==null&&(a=y),gt(a)||jc(a)))},Ce.zv=function(){return!1},Ce.Av=function(){},Ce.Zc=function(){return!1},ti.prototype.computeAngle=function(a,y,x){return ti.computeAngle(y,x)},ti.computeAngle=function(a,y){switch(a){default:case Sl: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=He.bp(y),90<a&&270>a&&(a-=180);break;case rm:a=He.bp(y+90),90<a&&270>a&&(a-=180);break;case om:a=He.bp(y-90),90<a&&270>a&&(a-=180);break;case C0:if(a=He.bp(y),45<a&&135>a||225<a&&315>a)return 0;90<a&&270>a&&(a-=180)}return He.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}Ce=ti.prototype,Ce.oh=function(){var a=this.containingGroup;a!==null&&this.fromNode!==a&&this.toNode!==a&&a.computesBoundsIncludingLinks&&mr.prototype.oh.call(this)},Ce.To=function(a){var y=this.fromNode;return a===y?this.toNode:y},Ce.Cz=function(a){var y=this.fromPort;return a===y?this.toPort:y};function ex(a,y){a.wd===null&&(a.wd=new Zn),a.wd.add(y),a.v()}Ce.Vo=function(a){if(mr.prototype.Vo.call(this,a),If(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)}},Ce.Wo=function(a){if(mr.prototype.Wo.call(this,a),If(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)}},Ce.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))},ti.prototype.updateRelationshipsFromData=function(){if(this.data!==null){var a=this.diagram;a!==null&&a.partManager.updateRelationshipsFromData(this)}},ti.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=_e.allocAt(x.x+E,x.y+b),mr.prototype.move.call(this,a,!1),_e.free(a)),rc(this,E,b),a=this.labelNodes;a.next();)y=a.value,x=y.position,y.moveTo(x.x+E,x.y+b)},ti.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},ti.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},ti.prototype.computeMidPoint=function(a){var y=this.pointsCount;if(y===0)return a.assign(Wi),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()===fu))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()===fu){if(y===3){x=this.i(0),E=this.i(1);var b=this.i(2);return He.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),He.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},ti.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()===fu))return this.ua.wx(.5);if(this.computeCurve()===fu&&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),He.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)},Ce=ti.prototype,Ce.i=function(a){return this.Nb.s[a]},Ce.dd=function(a,y){this.Nb.cd(a,y)},Ce.L=function(a,y,x){this.Nb.cd(a,new _e(y,x))},Ce.Kz=function(a,y){this.Nb.Gb(a,y)},Ce.m=function(a,y,x){this.Nb.Gb(a,new _e(y,x))},Ce.ne=function(a){this.Nb.add(a)},Ce.yf=function(a,y){this.Nb.add(new _e(a,y))},Ce.pv=function(a){this.Nb.mb(a)},Ce.Fj=function(){this.Nb.clear()};function rc(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 Tn,z=a.Nb.iterator;z.next();){var ee=z.value;b.add(new _e(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),sl(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)}}Ce.uh=function(){this.Mg===null&&(this.Mg=this.Nb,this.Nb=this.Nb.copy())},Ce.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,le=oe.length,he=0;he<le;he++){var ge=oe[he];ee=Math.min(ge.x,ee),re=Math.min(ge.y,re),ge.freeze()}if(y.freeze(),le===z){for(z=0;z<le;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)}},Ce.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))}Ce.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())}},Ce.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()}}},ti.prototype.computePoints=function(){if(this.diagram===null)return!1;var a=this.fromNode,y=null;if(a===null?(Fg||(Fg=new Fi,Fg.desiredSize=Yi,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 Fi,Lg.desiredSize=Yi,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),le=y===b&&y!==null,he=this.isOrthogonal,ge=this.curve===fu;this.Wf=le&&!he?ge=!0:!1;var xe=this.computeAdjusting()===Sl||le;if(!he&&!le&&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,le=this.computeCurviness(),ge=he=0;var Pe=z.x+re/3,Fe=z.y+oe/3,Ne=Pe,Xe=Fe;He.B(oe,0)?Xe=0<re?Xe-le:Xe+le:(he=-re/oe,ge=Math.sqrt(le*le/(he*he+1)),0>le&&(ge=-ge),Ne=(0>oe?-1:1)*ge+Pe,Xe=he*(Ne-Pe)+Fe),Pe=z.x+2*re/3,Fe=z.y+2*oe/3;var Ve=Pe,st=Fe;He.B(oe,0)?st=0<re?st-le:st+le:(Ve=(0>oe?-1:1)*ge+Pe,st=he*(Ve-Pe)+Fe),this.Fj(),this.ne(z),this.yf(Ne,Xe),this.yf(Ve,st),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,He.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=zt.alloc(),y.mi(re),oe=re.ca(b),xe.mi(re),le=re.ca(E),(oe||le)&&(ee=y.ga(y0(ee),new _e),this.dd(0,this.getLinkPointFromPoint(a,y,ee,b,!0,ee)),x=xe.ga(y0(x),new _e),this.dd(1,this.getLinkPointFromPoint(z,xe,x,E,!1,x))),zt.free(re))}else{ge=this.isAvoiding,xe&&(he&&ge||le)&&this.Fj();var ht=le?this.computeCurviness():0;ge=this.getLinkPoint(a,y,ee,!0,he,E,b),Pe=Ne=Fe=0,(he||!re||le)&&(Xe=this.computeEndSegmentLength(a,y,ee,!0),Pe=this.getLinkDirection(a,y,ge,ee,!0,he,E,b),le&&(re||ee.D(x)||!he&&ee.x+x.x===1&&ee.y+x.y===1)&&(Pe-=he?90:30,0>ht&&(Pe-=180)),0>Pe?Pe+=360:360<=Pe&&(Pe-=360),le&&(Xe+=Math.abs(ht)*(he?1:2)),Pe===0?Fe=Xe:Pe===90?Ne=Xe:Pe===180?Fe=-Xe:Pe===270?Ne=-Xe:(Fe=Xe*Math.cos(Pe*Math.PI/180),Ne=Xe*Math.sin(Pe*Math.PI/180)),ee.Mc()&&le&&(Xe=y.ga(yo,_e.alloc()),Ve=_e.allocAt(Xe.x+1e3*Fe,Xe.y+1e3*Ne),this.getLinkPointFromPoint(a,y,Xe,Ve,!0,ge),_e.free(Xe),_e.free(Ve))),Xe=this.getLinkPoint(E,b,x,!1,he,a,y);var pt=st=Ve=0;if(he||!oe||le){var Et=this.computeEndSegmentLength(E,b,x,!1);pt=this.getLinkDirection(E,b,Xe,x,!1,he,a,y),le&&(oe||ee.D(x)||!he&&ee.x+x.x===1&&ee.y+x.y===1)&&(pt+=he?0:30,0>ht&&(pt+=180)),0>pt?pt+=360:360<=pt&&(pt-=360),le&&(Et+=Math.abs(ht)*(he?1:2)),pt===0?Ve=Et:pt===90?st=Et:pt===180?Ve=-Et:pt===270?st=-Et:(Ve=Et*Math.cos(pt*Math.PI/180),st=Et*Math.sin(pt*Math.PI/180)),x.Mc()&&le&&(x=b.ga(yo,_e.alloc()),ee=_e.allocAt(x.x+1e3*Ve,x.y+1e3*st),this.getLinkPointFromPoint(E,b,x,ee,!1,Xe),_e.free(x),_e.free(ee))}x=ge,(he||!re||le)&&(x=new _e(ge.x+Fe,ge.y+Ne)),ee=Xe,(he||!oe||le)&&(ee=new _e(Xe.x+Ve,Xe.y+st)),!xe&&!he&&re&&3<z&&this.adjustPoints(0,ge,z-2,ee)?this.dd(z-1,Xe):!xe&&!he&&oe&&3<z&&this.adjustPoints(1,x,z-1,Xe)?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,Xe)):(this.Fj(),this.ne(ge),(he||!re||le)&&this.ne(x),he&&this.addOrthoPoints(x,Pe,ee,pt,a,E),(he||!oe||le)&&this.ne(ee),this.ne(Xe))}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}ti.prototype.getLinkPointFromPoint=function(a,y,x,E,b,z){if(z===void 0&&(z=new _e),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,le=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*le+ge,ee=x.x*ee+x.y*oe+he,x=x.x*re+x.y*le+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)}ti.prototype.getLinkPoint=function(a,y,x,E,b,z,ee,re){if(re===void 0&&(re=new _e),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 le=v0(this,ee);if(le!==null&&oe.Gl<le.Gl){oe=_e.alloc(),le=_e.alloc();var he=new zt(y.ga(Xo,oe),y.ga(Xt,le)),ge=this.computeSpot(!E,ee);a=this.getLinkPoint(z,ee,ge,!E,b,a,y,le),(x.Hf(Zi)||x.Hf(yi))&&a.y>=he.y&&a.y<=he.y+he.height?re.y=a.y:(x.Hf(kn)||x.Hf(Ai))&&a.x>=he.x&&a.x<=he.x+he.width&&(re.x=a.x),_e.free(oe),_e.free(le)}}return re}}return x=y.ga(y0(x),_e.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=_e.alloc(),ee=ee.ga(y0(oe),z),b&&(ee=ny(x,ee)),_e.free(z)),this.getLinkPointFromPoint(a,y,x,ee,E,re),_e.free(x),re},ti.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(yo,_e.alloc()),this.pointsCount>(z?6:2)?(re=b?this.i(1):this.i(this.pointsCount-2),re=z?ny(oe,re.copy()):x):(x=_e.alloc(),re=re.ga(yo,x),_e.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,_e.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},ti.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)},ti.prototype.computeSpot=function(a,y){return y===void 0&&(y=null),a?(a=y||this.fromPort,a===null?a=yo:(y=this.fromSpot,y.Xb()&&(y=a.fromSpot),a=y===er?to:y)):(a=y||this.toPort,a===null?a=yo:(y=this.toSpot,y.Xb()&&(y=a.toSpot),a=y===er?to:y)),a};function pp(a){return a===to||a.x===.5&&a.y===.5}function y0(a){return a.x===.5&&a.y===.5?a:yo}ti.prototype.computeOtherPoint=function(a,y){return this.computeAdjusting()!==Sl&&4<this.pointsCount?this.computeMidPoint(new _e):(a=y.Zn,a=a!==null?lx(a,this):null,a!==null?a.Zo:y.ga(yo))},ti.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},ti.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=Pt.alloc(),ee.reset()),ee.multiply(this.transform),this.fh(a,ee))return Fv(this,y,x,b),z===void 0&&Pt.free(ee),!0;if(this.Yc(a,ee)){var re=!1;if(!this.isAtomic)for(var oe=this.O.s,le=oe.length;le--;){var he=oe[le];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=Pt.alloc(),ge.set(ee),he instanceof Xn)re=he.Cf(a,y,x,E,b,ge);else if(this.path===he){if(he instanceof ao)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 Xe=_e.alloc(),Ve=_e.alloc(),st=_e.alloc(),ht=Pt.alloc();ht.set(Fe),ht.bv(he.transform),ht.Vj(),Ve.x=xe,Ve.y=Ne,Ve.transform(ht),Xe.x=re,Xe.y=Ne,Xe.transform(ht),Fe=!1,Tf(he,Xe,Ve,st)?Fe=!0:(Xe.x=xe,Xe.y=Pe,Xe.transform(ht),Tf(he,Xe,Ve,st)?Fe=!0:(Ve.x=re,Ve.y=Pe,Ve.transform(ht),Tf(he,Xe,Ve,st)?Fe=!0:(Xe.x=re,Xe.y=Ne,Xe.transform(ht),Tf(he,Xe,Ve,st)&&(Fe=!0)))),Pt.free(ht),_e.free(Xe),_e.free(Ve),_e.free(st),re=Fe}}else re=he.fh(re,ge)}else re=xs(he,a,E,ge);re&&(xe=he,y!==null&&(xe=y(he)),xe&&(x===null||x(xe))&&b.add(xe)),Pt.free(ge)}}}return z===void 0&&Pt.free(ee),re||this.background!==null||this.areaBackground!==null}return z===void 0&&Pt.free(ee),!1},ti.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?fu:this.curve},ti.prototype.computeCorner=function(){if(this.curve===fu)return 0;var a=this.corner;return(isNaN(a)||0>a)&&(a=10),a},ti.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},ti.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(yo).ab(x.ga(yo))/180*Math.PI,a=Math.max(a,Math.abs(Math.sin(y)*ee)+Math.abs(Math.cos(y)*b)+1)),this.curve===fu&&(a*=1.333)}}return a},ti.prototype.arrangeBundledLinks=function(a,y){if(y)for(y=0;y<a.length;y++){var x=a[y];x.computeAdjusting()===Sl&&x.bb()}},ti.prototype.computeCurviness=function(){var a=this.curviness;if(isNaN(a)){a=ix;var y=this.Sf;if(y!==null){for(var x=Hi(),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),Mi(x)}}return a},ti.prototype.computeThickness=function(){if(!this.isVisible())return 0;var a=this.path;return a!==null?Math.max(a.strokeWidth,1):1},ti.prototype.hasCurviness=function(){return!isNaN(this.curviness)||this.Sf!==null},ti.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,le=Math.sqrt(re*re+oe*oe);if(!He.$(le,0)){if(He.$(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),He.$(re,0)?xe=0>xe?-Math.PI/2:Math.PI/2:(xe=Math.atan(xe/Math.abs(re)),0>re&&(xe=Math.PI-xe)),le=oe/le,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),He.$(y,0)||(He.$(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*=le,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,le=(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,Xe=y.y,Ve=.5;le!==0&&(Ve=((b-Ne)*(b-ee)+(z-Xe)*(z-ge))/le);var st=b+Ve*(ee-b),ht=z+Ve*(ge-z);y=Math.sqrt((Ne-st)*(Ne-st)+(Xe-ht)*(Xe-ht)),Xe<Fe*(Ne-st)+ht&&(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,le=he,He.B(b.y,z.y)?He.B(z.x,ee.x)?he=y.y:He.B(z.y,ee.y)&&(re=y.x):He.B(b.x,z.x)&&(He.B(z.y,ee.y)?re=y.x:He.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,He.B(b.y,z.y)?He.B(z.x,ee.x)?he=E.y:He.B(z.y,ee.y)&&(re=E.x):He.B(b.x,z.x)&&(He.B(z.y,ee.y)?re=E.x:He.B(z.x,ee.x)&&(he=E.y)),this.L(x-1,re,he),iy(this))){this.L(a+1,ge,le),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}},ti.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 le=_e.alloc(),he=_e.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?(le.h(x.x,a.y),he.h(x.x,(a.y+x.y)/2),E===180?(le.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1),he.x=le.x,he.y=x.y):E===270&&x.y<a.y||E===90&&x.y>a.y?(le.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=le.x,he.y=x.y):E===0&&a.x<oe.left&&a.y>oe.top&&a.y<oe.bottom&&(le.x=a.x,le.y=a.y<x.y?Math.min(x.y,oe.top):Math.max(x.y,oe.bottom),he.y=le.y)):(le.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))?le.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):x.y<a.y&&(E===180||E===90)?le.y=this.computeMidOrthoPosition(a.x,re.top,x.x,Math.max(x.y,oe.bottom),!0):x.y>a.y&&(E===180||E===270)&&(le.y=this.computeMidOrthoPosition(a.x,re.bottom,x.x,Math.min(x.y,oe.top),!0)),he.x=x.x,he.y=le.y),le.y>re.top&&le.y<re.bottom&&(x.x>=re.left&&x.x<=a.x||a.x<=oe.right&&a.x>=x.x?(E===90||E===270)&&(le.h(Math.max((a.x+x.x)/2,a.x),a.y),he.h(le.x,x.y)):(le.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=le.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?(le.h(x.x,a.y),he.h(x.x,(a.y+x.y)/2),E===0?(le.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1),he.x=le.x,he.y=x.y):E===270&&x.y<a.y||E===90&&x.y>a.y?(le.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=le.x,he.y=x.y):E===180&&a.x>oe.right&&a.y>oe.top&&a.y<oe.bottom&&(le.x=a.x,le.y=a.y<x.y?Math.min(x.y,oe.top):Math.max(x.y,oe.bottom),he.y=le.y)):(le.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))?le.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):x.y<a.y&&(E===0||E===90)?le.y=this.computeMidOrthoPosition(a.x,re.top,x.x,Math.max(x.y,oe.bottom),!0):x.y>a.y&&(E===0||E===270)&&(le.y=this.computeMidOrthoPosition(a.x,re.bottom,x.x,Math.min(x.y,oe.top),!0)),he.x=x.x,he.y=le.y),le.y>re.top&&le.y<re.bottom&&(x.x<=re.right&&x.x>=a.x||a.x>=oe.left&&a.x<=x.x?(E===90||E===270)&&(le.h(Math.min((a.x+x.x)/2,a.x),a.y),he.h(le.x,x.y)):(le.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=le.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?(le.h(a.x,x.y),he.h((a.x+x.x)/2,x.y),E===270?(le.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0),he.x=x.x,he.y=le.y):E===180&&x.x<a.x||E===0&&x.x>a.x?(le.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=le.y):E===90&&a.y<oe.top&&a.x>oe.left&&a.x<oe.right&&(le.x=a.x<x.x?Math.min(x.x,oe.left):Math.max(x.x,oe.right),le.y=a.y,he.x=le.x)):(le.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))?le.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):x.x<a.x&&(E===270||E===0)?le.x=this.computeMidOrthoPosition(re.left,a.y,Math.max(x.x,oe.right),x.y,!1):x.x>a.x&&(E===270||E===180)&&(le.x=this.computeMidOrthoPosition(re.right,a.y,Math.min(x.x,oe.left),x.y,!1)),he.x=le.x,he.y=x.y),le.x>re.left&&le.x<re.right&&(x.y>=re.top&&x.y<=a.y||a.y<=oe.bottom&&a.y>=x.y?(E===0||E===180)&&(le.h(a.x,Math.max((a.y+x.y)/2,a.y)),he.h(x.x,le.y)):(le.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=le.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?(le.h(a.x,x.y),he.h((a.x+x.x)/2,x.y),E===90?(le.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0),he.x=x.x,he.y=le.y):E===180&&x.x<a.x||E===0&&x.x>=a.x?(le.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=le.y):E===270&&a.y>oe.bottom&&a.x>oe.left&&a.x<oe.right&&(le.x=a.x<x.x?Math.min(x.x,oe.left):Math.max(x.x,oe.right),le.y=a.y,he.x=le.x)):(le.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))?le.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):x.x<a.x&&(E===90||E===0)?le.x=this.computeMidOrthoPosition(re.left,a.y,Math.max(x.x,oe.right),x.y,!1):x.x>a.x&&(E===90||E===180)&&(le.x=this.computeMidOrthoPosition(re.right,a.y,Math.min(x.x,oe.left),x.y,!1)),he.x=le.x,he.y=x.y),le.x>re.left&&le.x<re.right&&(x.y<=re.bottom&&x.y>=a.y||a.y>=oe.top&&a.y<=x.y?(E===0||E===180)&&(le.h(a.x,Math.min((a.y+x.y)/2,a.y)),he.h(x.x,le.y)):(le.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=le.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=Nc(xe,!0,this.containingGroup,null);if(this.segmentIndex!==17&&Pe.Yj(Math.min(a.x,le.x),Math.min(a.y,le.y),Math.abs(a.x-le.x),Math.abs(a.y-le.y))&&Pe.Yj(Math.min(le.x,he.x),Math.min(le.y,he.y),Math.abs(le.x-he.x),Math.abs(le.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=_e.alloc();vp(Pe,a.x,a.y)||(He.Ff(xe.x,xe.y,xe.x+xe.width,xe.y+xe.height,a.x,a.y,le.x,le.y,Ne)?(x=a=Ne.copy(),y=Ne.ab(le)):He.Ff(xe.x,xe.y,xe.x+xe.width,xe.y+xe.height,le.x,le.y,he.x,he.y,Ne)?(x=a=Ne.copy(),y=Ne.ab(he)):He.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)||(He.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)):He.Ff(xe.x,xe.y,xe.x+xe.width,xe.y+xe.height,he.x,he.y,le.x,le.y,Ne)?(Fe=ge=Ne.copy(),E=le.ab(Ne)):He.Ff(xe.x,xe.y,xe.x+xe.width,xe.y+xe.height,le.x,le.y,a.x,a.y,Ne)&&(Fe=ge=Ne.copy(),E=a.ab(Ne))),_e.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=$h(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=$h(Pe,ge.x,ge.y)),!Pe.abort&&oe<yp&&$h(Pe,ge.x,ge.y)!==ac?(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?He.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)):He.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)&&(He.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)):He.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(le.copy()),this.ne(he.copy())),_e.free(le),_e.free(he)}},ti.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=Nc(a.diagram,!0,a.containingGroup,null);for(var E=1;E<x-2;E++){var b=y[E],z=y[E+1];if(!a.Yj(Math.min(b.x,z.x),Math.min(b.y,z.y),Math.abs(b.x-z.x),Math.abs(b.y-z.y)))return!0}return!1}function ry(a,y,x,E,b,z,ee){var re=y.Ho,oe=y.Go,le=$h(y,x,E),he=x,ge=E;for(b===0?he+=re:b===90?ge+=oe:b===180?he-=re:ge-=oe,b!==ee&&le>Of&&$h(y,he,ge)!==le-1&&($h(y,x-re,E)===le-1?(b=180,he=x-re,ge=E):$h(y,x+re,E)===le-1?(b=0,he=x+re,ge=E):$h(y,x,E-oe)===le-1?(b=270,he=x,ge=E-oe):$h(y,x,E+oe)===le-1&&(b=90,he=x,ge=E+oe));le>Of&&$h(y,he,ge)===le-1;)x=he,E=ge,b===0?he+=re:b===90?ge+=oe:b===180?he-=re:ge-=oe,--le;z?le>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),le>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),$h(y,ee,he)===le-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),$h(y,ee,he)===le-1&&ry(a,y,ee,he,z,!1,z))),a.yf(x,E)}ti.prototype.ez=function(a){var y=a.x;a=a.y;for(var x=this.i(0),E=this.i(1),b=bi(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=bi(y,a,E.x,E.y,x.x,x.y);E=x,re<b&&(z=ee,b=re)}return z},ti.prototype.qc=function(){this.lk=!1,this.v()},ti.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 ao&&(b.ua=this.ua)}}},ti.prototype.makeGeometry=function(){var a=this.ua,y=this.pointsCount,x=!1,E=this.diagram;E!==null&&If(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===fu&&3<=y&&!He.$(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||If(this)){if(a.type=Dt.o,re=A1(a),this.computeShortLength(!0)!==0&&(b=Cg(this,b,!0,z)),fp(re,b.x,b.y,!1),ee===fu&&3<=y&&!He.$(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)),tc(re,y,x,y,x,b.x,b.y);else if(this.isOrthogonal){y=_e.allocAt(E,oe),x=_e.alloc(),x.assign(this.i(1)),z=_e.allocAt(E,oe),b=_e.allocAt(E,oe),ee=this.i(0);for(var le,he=this.smoothness/3,ge=1;ge<this.pointsCount-1;ge++){le=this.i(ge);var xe=ee,Pe=le,Fe=this.i(oy(this,le,ge,!1));if((!He.$(xe.x,Pe.x)||!He.$(Pe.x,Fe.x))&&(!He.$(xe.y,Pe.y)||!He.$(Pe.y,Fe.y))){var Ne=he;isNaN(Ne)&&(Ne=this.smoothness/3);var Xe=xe.x;xe=xe.y;var Ve=Pe.x;Pe=Pe.y;var st=Fe.x;Fe=Fe.y;var ht=Ne*x0(Xe,xe,Ve,Pe);Ne*=x0(Ve,Pe,st,Fe),He.$(xe,Pe)&&He.$(Ve,st)&&(Ve>Xe?Fe>Pe?(z.x=Ve-ht,z.y=Pe-ht,b.x=Ve+Ne,b.y=Pe+Ne):(z.x=Ve-ht,z.y=Pe+ht,b.x=Ve+Ne,b.y=Pe-Ne):Fe>Pe?(z.x=Ve+ht,z.y=Pe-ht,b.x=Ve-Ne,b.y=Pe+Ne):(z.x=Ve+ht,z.y=Pe+ht,b.x=Ve-Ne,b.y=Pe-Ne)),He.$(Xe,Ve)&&He.$(Pe,Fe)&&(Pe>xe?(st>Ve?(z.x=Ve-ht,z.y=Pe-ht,b.x=Ve+Ne):(z.x=Ve+ht,z.y=Pe-ht,b.x=Ve-Ne),b.y=Pe+Ne):(st>Ve?(z.x=Ve-ht,z.y=Pe+ht,b.x=Ve+Ne):(z.x=Ve+ht,z.y=Pe+ht,b.x=Ve-Ne),b.y=Pe-Ne)),(He.$(Xe,Ve)&&He.$(Ve,st)||He.$(xe,Pe)&&He.$(Pe,Fe))&&(Xe=.5*(Xe+st),xe=.5*(xe+Fe),z.x=Xe,z.y=xe,b.x=Xe,b.y=xe),(ge===1||ge===2&&He.$(ee.x,this.i(0).x)&&He.$(ee.y,this.i(0).y))&&(x.x=.5*(ee.x+le.x),x.y=.5*(ee.y+le.y)),tc(re,x.x-E,x.y-oe,z.x-E,z.y-oe,le.x-E,le.y-oe),y.set(z),x.set(b),ee=le}}le=ee.x,ee=ee.y,he=this.i(this.pointsCount-1),this.computeShortLength(!1)!==0&&(he=Cg(this,he.copy(),!1,pi)),le=.5*(le+he.x),ee=.5*(ee+he.y),tc(re,b.x-E,b.y-oe,le-E,ee-oe,he.x-E,he.y-oe),_e.free(y),_e.free(x),_e.free(z),_e.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,pi)),tc(re,z.x-E,z.y-oe,b.x-E,b.y-oe,ee.x-E,ee.y-oe);else{for(z=_e.alloc(),z.assign(this.i(0)),b=_e.alloc(),b.assign(z),ee=this.computeCorner(),ge=1,le=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,pi)),bg(this,re,-E,-oe,z,he,x);else if(le===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(le=oy(this,he,ge+1,ge<y-3),ge=-E,Xe=-oe,xe=he,Ve=this.i(le),Ne=x,He.B(z.y,xe.y)&&He.B(xe.x,Ve.x))if(Fe=Math.min(ee,Math.abs(xe.x-b.x)/2),Fe=ht=Math.min(Fe,Math.abs(Ve.y-xe.y)/2),He.B(Fe,0))bg(this,re,ge,Xe,z,xe,Ne),z.assign(xe);else{var pt=xe.x,Et=xe.y;Pe=pt,st=Et,xe.x>z.x?pt=xe.x-Fe:pt=xe.x+Fe,Ve.y>xe.y?st=xe.y+ht:st=xe.y-ht,Ve=_e.allocAt(pt,Et),bg(this,re,ge,Xe,z,Ve,Ne),_e.free(Ve),u0(re,xe.x+ge,xe.y+Xe,Pe+ge,st+Xe),z.h(Pe,st)}else He.B(z.x,xe.x)&&He.B(xe.y,Ve.y)?(Fe=Math.min(ee,Math.abs(xe.y-b.y)/2),Fe=ht=Math.min(Fe,Math.abs(Ve.x-xe.x)/2),He.B(ht,0)?(bg(this,re,ge,Xe,z,xe,Ne),z.assign(xe)):(pt=xe.x,Et=xe.y,Pe=pt,st=Et,xe.y>z.y?Et=xe.y-Fe:Et=xe.y+Fe,Ve.x>xe.x?Pe=xe.x+ht:Pe=xe.x-ht,Ve=_e.allocAt(pt,Et),bg(this,re,ge,Xe,z,Ve,Ne),_e.free(Ve),u0(re,xe.x+ge,xe.y+Xe,Pe+ge,st+Xe),z.h(Pe,st))):(bg(this,re,ge,Xe,z,xe,Ne),z.assign(xe));b.assign(he),ge=le}_e.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=Dt.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),He.$(a,0)?y:He.$(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;He.$(y.x,z.x)&&He.$(y.y,z.y);){if(x>=b)return b-1;z=a.i(x++)}if(!He.$(y.x,z.x)&&!He.$(y.y,z.y))return x-1;for(var ee=z;He.$(y.x,z.x)&&He.$(z.x,ee.x)&&(!E||(y.y>=z.y?z.y>=ee.y:z.y<=ee.y))||He.$(y.y,z.y)&&He.$(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}ti.prototype.computeJumpLength=function(){return 10};function bg(a,y,x,E,b,z,ee){if(!ee&&If(a)){ee=a.computeJumpLength();var re=ee/2,oe=[],le=0;if(a.isVisible()&&(le=bS(a,b,z,oe)),0<le){if(He.B(b.y,z.y))if(b.x<z.x)for(var he=0;he<le;){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<le&&(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===oc?fp(y,Pe,Fe,!1):tc(y,xe,ge,Pe,ge,Pe,Fe)}else for(--le;0<=le;){for(he=Math.min(b.x,Math.max(oe[le--]+re,z.x+ee)),y.lineTo(he+x,z.y+E),xe=he+x,ge=Math.max(he-ee,z.x);0<=le&&(he=oe[le],he>ge-ee);)le--,ge=Math.max(he-re,z.x);he=z.y-ee+E,ge+=x,Pe=z.y+E,a.curve===oc?fp(y,ge,Pe,!1):tc(y,xe,he,ge,he,ge,Pe)}else if(He.B(b.x,z.x))if(b.y<z.y)for(he=0;he<le;){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<le&&(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===oc?fp(y,Fe,ge,!1):tc(y,Pe,xe,Pe,ge,Fe,ge)}else for(--le;0<=le;){for(he=Math.min(b.y,Math.max(oe[le--]+re,z.y+ee)),y.lineTo(z.x+x,he+E),xe=he+E,he=Math.max(he-ee,z.y);0<=le&&(ge=oe[le],ge>he-ee);)le--,he=Math.max(ge-re,z.y);ge=z.x-ee+x,Pe=z.x+x,he+=E,a.curve===oc?fp(y,Pe,he,!1):tc(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 ti){if(oe===a)return 0<E.length&&E.sort(function(he,ge){return he-ge}),E.length;if(oe.isVisible()&&If(oe)){var le=oe.routeBounds;le.w()&&a.routeBounds.Yc(le)&&!a.usesSamePort(oe)&&(le=oe.path,le!==null&&le.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=He.B(a.y,y.y),z=E.pointsCount,ee=E.i(0),re=_e.alloc(),oe=1;oe<z;oe++){var le=E.i(oe);if(oe<z-1){var he=E.i(oe+1);if(ee.y===le.y&&le.y===he.y){if(le.x>ee.x&&he.x>=le.x||le.x<ee.x&&he.x<=le.x)continue}else if(ee.x===le.x&&le.x===he.x&&(le.y>ee.y&&he.y>=le.y||le.y<ee.y&&he.y<=le.y))continue}e:{he=a.x;var ge=a.y,xe=y.x,Pe=y.y,Fe=ee.x;ee=ee.y;var Ne=le.x,Xe=le.y;if(He.B(he,xe)){if(!He.B(ge,Pe)&&He.B(ee,Xe)&&Math.min(ge,Pe)<ee&&Math.max(ge,Pe)>ee&&Math.min(Fe,Ne)<he&&Math.max(Fe,Ne)>he&&!He.B(Fe,Ne)){re.x=he,re.y=ee,he=!0;break e}}else if(He.B(ge,Pe)&&He.B(Fe,Ne)&&Math.min(he,xe)<Fe&&Math.max(he,xe)>Fe&&Math.min(ee,Xe)<ge&&Math.max(ee,Xe)>ge&&!He.B(ee,Xe)){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=le}_e.free(re)}function If(a){return a=a.curve,a===mp||a===oc}function S0(a,y){(y||If(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()))}ti.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 ti&&(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 ti&&tx(this,re,a)}}}}};function tx(a,y,x){if(y!==null&&y.lk&&y.fd&&If(y)){var E=y.routeBounds;E.w()&&(a.routeBounds.Yc(E)||x.Yc(E))&&(a.usesSamePort(y)||y.qc())}}ti.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},ti.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},ti.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)},ti.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 le=ee[oe];(le.ef===y&&le.ff===E&&le.uf===x&&le.vf===b||le.ef===x&&le.ff===b&&le.uf===y&&le.vf===E)&&(z===null?z=le:(a===null&&(a=[],a.push(z)),a.push(le)))}if(a!==null){for(z=H1(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&&(ur(y.links,a),y.Sl()))}ti.prototype.ph=function(){return!0},kt.Object.defineProperties(ti.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&&$l(x),qp(this),this.ff=a;var E=this.fromPort;E!==null&&$l(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&&$l(x),qp(this),this.vf=a;var E=this.toPort;E!==null&&$l(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:er},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&&$l(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&&Dn(a,">= 0",ti,"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:er},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&&$l(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&&Dn(a,">= 0",ti,"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?bo: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 ao?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()===fu&&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),He.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);He.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 _e)}},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);He.$(E.x,b.x)?(E=b.y-E.y,0>E&&(E=-E)):He.$(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 Tn,E=0;E<a.length/2;E++)b=new _e(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(!cn(z)||typeof z.x!="number"||isNaN(z.x)||typeof z.y!="number"||isNaN(z.y)){E=!1;break}}if(E)for(x=new Tn,E=0;E<a.length;E++)b=a[E],x.add(new _e(b.x,b.y).freeze())}}else if(a instanceof Tn)for(x=a.copy(),a=x.iterator;a.next();)a.value.freeze();else it("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===oc||y===mp||a===oc||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)}}}),ti.prototype.invalidateOtherJumpOvers=ti.prototype.Xo,ti.prototype.findClosestSegment=ti.prototype.ez,ti.prototype.updateRoute=ti.prototype.vg,ti.prototype.invalidateRoute=ti.prototype.bb,ti.prototype.rollbackRoute=ti.prototype.rv,ti.prototype.commitRoute=ti.prototype.zf,ti.prototype.startRoute=ti.prototype.uh,ti.prototype.clearPoints=ti.prototype.Fj,ti.prototype.removePoint=ti.prototype.pv,ti.prototype.addPointAt=ti.prototype.yf,ti.prototype.addPoint=ti.prototype.ne,ti.prototype.insertPointAt=ti.prototype.m,ti.prototype.insertPoint=ti.prototype.Kz,ti.prototype.setPointAt=ti.prototype.L,ti.prototype.setPoint=ti.prototype.dd,ti.prototype.getPoint=ti.prototype.i,ti.prototype.getOtherPort=ti.prototype.Cz,ti.prototype.getOtherNode=ti.prototype.To;var Fg=null,Lg=null,ay=new en(ti,"Normal",1),LS=new en(ti,"Orthogonal",2),BS=new en(ti,"AvoidsNodes",6),nx=new en(ti,"AvoidsNodesStraight",7),Sl=new en(ti,"None",0),fu=new en(ti,"Bezier",9),oc=new en(ti,"JumpGap",10),mp=new en(ti,"JumpOver",11),em=new en(ti,"End",17),w0=new en(ti,"Scale",18),P0=new en(ti,"Stretch",19),tm=new en(ti,"OrientAlong",21),nm=new en(ti,"OrientPlus90",22),im=new en(ti,"OrientMinus90",23),sy=new en(ti,"OrientOpposite",24),E0=new en(ti,"OrientUpright",25),rm=new en(ti,"OrientPlus90Upright",26),om=new en(ti,"OrientMinus90Upright",27),C0=new en(ti,"OrientUpright45",28),ix=16,rx=14,am=8;ti.className="Link",ti.Normal=ay,ti.Orthogonal=LS,ti.AvoidsNodes=BS,ti.AvoidsNodesStraight=nx,ti.None=Sl,ti.Bezier=fu,ti.JumpGap=oc,ti.JumpOver=mp,ti.End=em,ti.Scale=w0,ti.Stretch=P0,ti.OrientAlong=tm,ti.OrientPlus90=nm,ti.OrientMinus90=im,ti.OrientOpposite=sy,ti.OrientUpright=E0,ti.OrientPlus90Upright=rm,ti.OrientMinus90Upright=om,ti.OrientUpright45=C0,ti.EndSegmentStep=8,ti.CurvinessStart=ix,ti.SpacingMin=rx,ti.OrthoShortCut=am;function b0(a,y,x,E){wr(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){wr(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 $h(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]===ac)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 le=y|0,he=x|0,ge=a.ac[le][he];if(ge>=Of&&ge<yp)for(b?he+=E:le+=E,ge+=1;z<=le&&le<=ee&&re<=he&&he<=oe&&!(ge>=a.ac[le][he]);)a.ac[le][he]=ge,ge+=1,b?he+=E:le+=E;if(le=b?he:le,b)if(0<E)for(x+=E;x<le;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>le;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<le;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>le;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 le=ac,he=Of;for(a.ac[y][x]=he;le===ac&&y>z&&y<ee&&x>re&&x<oe;)he+=1,a.ac[y][x]=he,b?x+=E:y+=E,le=a.ac[y][x]}function L0(a,y,x,E,b,z,ee,re,oe){y|=0,x|=0;var le=ac,he=yp;for(a.ac[y][x]=he;le===ac&&y>z&&y<ee&&x>re&&x<oe;)a.ac[y][x]=he,b?x+=E:y+=E,le=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 le=E.x,he=E.y;if(vp(a,le,he))if(le-=a.Nd,le/=a.rc,he-=a.Od,he/=a.sc,1>=Math.abs(re-le)&&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,le|=0,he|=0;var Pe=x===0||x===90?1:-1;if(x=x===90||x===270,E[re][oe]===ac?(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[le][he]===ac?(L0(a,le,he,b===0||b===90?1:-1,b===90||b===270,z,y,ge,xe),L0(a,le,he,1,!(b===90||b===270),z,y,ge,xe),L0(a,le,he,-1,!(b===90||b===270),z,y,ge,xe)):L0(a,le,he,Pe,x,le,he,le,he),x=Hi(),ee&&sx(a,le,he,b,re,oe,x))for((x[0]!==le||x[1]!==he)&&(x.unshift(he),x.unshift(le)),(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],le=x[z+1];y>b?b++:y<b?b--:le>ee?ee++:le<ee&&ee--,E[b][ee]=a++,b!==y||ee!==le;);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);Mi(x)}}}}function sx(a,y,x,E,b,z,ee){for(var re=a.ac,oe=y,le=x;;){if(oe===b&&le===z)return!0;var he=oe,ge=le;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,le=ge}for(;;){if(he=E,ge=oe,xe=le,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(le),sx(a,oe,le,he,b,z,ee))return!0;ee.pop(),ee.pop()}if(re[oe][le]=uy,E===0){if(oe===y)return!1;oe--}else if(E===90){if(le===x)return!1;le--}else if(E===180){if(oe===y)return!1;oe++}else{if(le===x)return!1;le++}}}kt.Object.defineProperties(sm.prototype,{bounds:{get:function(){return new zt(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 ac=0,Of=1,yp=999999,ly=yp+1,uy=yp+2;sm.className="PositionArray";function Bg(){wr(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 qr?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(Xo,_e.alloc()),oe=a.port.ga(Xt,_e.alloc());for(b=zt.allocAt(re.x,re.y,0,0),b.Ye(oe),_e.free(re),_e.free(oe),re=_e.allocAt(b.x+b.width/2,b.y+b.height/2),oe=a.port.li(),ee=ee.iterator;ee.next();){var le=ee.value;if(le.isVisible()&&le.fromPort!==le.toPort){var he=le.fromPort===a.port||le.fromNode!==null&&le.fromNode.Td(E),ge=le.computeSpot(he,a.port);if(ge.$c()&&(he=he?le.toPort:le.fromPort,he!==null)){var xe=he.part;if(xe!==null){var Pe=xe.findVisibleNode();Pe!==null&&Pe!==xe&&(xe=Pe,he=xe.port),he=le.computeOtherPoint(xe,he),xe=re.ab(he),xe-=oe,0>xe?xe+=360:360<=xe&&(xe-=360),ge=MS(b,ge,xe,le.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(le,xe,ge),a.pe[z]=Pe):(Pe.link=le,Pe.angle=xe,Pe.Nc=ge),Pe.hv.set(he),z++}}}}for(_e.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=_e.alloc(),oe=_e.alloc(),ee=_e.alloc(),le=_e.alloc(),ge.ga(Xo,re),ge.ga(ms,oe),ge.ga(Xt,ee),ge.ga(ls,le),Pe=xe=he=ge=0,E===qv)for(var Fe=0;Fe<z.length;Fe++){var Ne=z[Fe];if(Ne!==null){var Xe=Ne.link.computeThickness();switch(Ne.Nc){case 8:xe+=Xe;break;case 2:Pe+=Xe;break;case 1:ge+=Xe;break;default:case 4:he+=Xe}}}var Ve=Fe=0,st=1,ht=Ne=0;for(Xe=0;Xe<z.length;Xe++){var pt=z[Xe];if(pt!==null){if(Fe!==pt.Nc){switch(Fe=pt.Nc,Fe){case 8:var Et=ee;Ve=le;break;case 2:Et=le,Ve=re;break;case 1:Et=re,Ve=oe;break;default:case 4:Et=oe,Ve=ee}switch(Ne=Ve.x-Et.x,ht=Ve.y-Et.y,Fe){case 8:xe>Math.abs(Ne)?(st=Math.abs(Ne)/xe,xe=Math.abs(Ne)):st=1;break;case 2:Pe>Math.abs(ht)?(st=Math.abs(ht)/Pe,Pe=Math.abs(ht)):st=1;break;case 1:ge>Math.abs(Ne)?(st=Math.abs(Ne)/ge,ge=Math.abs(Ne)):st=1;break;default:case 4:he>Math.abs(ht)?(st=Math.abs(ht)/he,he=Math.abs(ht)):st=1}Ve=0}var Gt=pt.Zo;if(E===qv){switch(pt=pt.link.computeThickness(),pt*=st,Gt.set(Et),Fe){case 8:Gt.x=Et.x+Ne/2+xe/2-Ve-pt/2;break;case 2:Gt.y=Et.y+ht/2+Pe/2-Ve-pt/2;break;case 1:Gt.x=Et.x+Ne/2-ge/2+Ve+pt/2;break;default:case 4:Gt.y=Et.y+ht/2-he/2+Ve+pt/2}Ve+=pt}else{var xi=.5;E===p0&&(xi=(pt.Uo+1)/(pt.Gl+1)),Gt.x=Et.x+Ne*xi,Gt.y=Et.y+ht*xi}}}for(_e.free(re),_e.free(oe),_e.free(ee),_e.free(le),Et=a.pe,z=0;z<Et.length;z++)E=Et[z],E!==null&&(E.Ju=a.computeEndSegmentLength(E));a.ap=x,zt.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,to,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 _e,this.Gl=this.Uo=0,this.Zo=new _e,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 Ga(a){wr(this),this.o=this.H=null,this.Gh=this.sn=!0,this.yn=!1,this.Am=new _e(0,0).freeze(),this.vn=!0,this.Em=this.un=null,this.xn=!1,this.j=null,a&&Object.assign(this,a)}Ga.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},Ga.prototype.copy=function(){var a=new this.constructor;return this.cloneProtected(a),a},Ga.prototype.qb=function(){},Ga.prototype.toString=function(){var a=Ri(this.constructor);return a+="(",this.group!==null&&(a+=" in "+this.group),this.diagram!==null&&(a+=" for "+this.diagram),a+")"},Ga.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())}}},Ga.prototype.createNetwork=function(){return new Ta(this)},Ga.prototype.makeNetwork=function(a){var y=this.createNetwork();return a instanceof Zt?(y.lg(a.nodes,!0),y.lg(a.links,!0)):a instanceof qr?y.lg(a.memberParts):y.lg(a.iterator),y},Ga.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")}},Ga.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()}},Ga.prototype.doLayout=function(a){var y=new Zn;a instanceof Zt?(Gc(this,y,a.nodes,!0,this.rh,!0,!1,!0),Gc(this,y,a.parts,!0,this.rh,!0,!1,!0)):a instanceof qr?Gc(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},Ga.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,le=oe.width;oe=oe.height,re.moveTo(E,b),re instanceof qr&&(re.rh=!1),E+=Math.max(le,50)+20,ee=Math.max(ee,Math.max(oe,50)),z>=y-1?(z=0,E=x,b+=ee+20,ee=0):z++}},Ga.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 ti)&&(lm(re),this.rh(re))){var oe=re.measuredBounds,le=oe.width;oe=oe.height,re.moveTo(x,E),re instanceof qr&&(re.rh=!1),x+=Math.max(le,50)+20,z=Math.max(z,Math.max(oe,50)),b>=a-1?(b=0,x=y,E+=z+20,z=0):b++}}},Ga.prototype.rh=function(a){return!!(!a.location.w()||a instanceof qr&&a.rh)};function Gc(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 Fi?oe.isLinkLabel||(oe instanceof qr&&oe.layout===null?Gc(a,y,oe.memberParts,!1,b,z,ee,re):(lm(oe),y.add(oe))):ee&&oe instanceof ti?y.add(oe):!re||!oe.Zc()||oe instanceof Fi||(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()}Ga.prototype.ni=function(a,y){var x=this.boundsComputation;return x!==null?(y||(y=new zt),x(a,this,y)):y?(y.set(a.actualBounds),y):a.actualBounds},Ga.prototype.ex=function(a){var y=new Zn;return a instanceof Zt?(Gc(this,y,a.nodes,!0,null,!0,!0,!0),Gc(this,y,a.links,!0,null,!0,!0,!0),Gc(this,y,a.parts,!0,null,!0,!0,!0)):a instanceof qr?Gc(this,y,a.memberParts,!1,null,!0,!0,!0):Gc(this,y,a.iterator,!1,null,!0,!0,!0),y},Ga.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(Xo),(isNaN(x.x)||isNaN(x.y))&&x.set(a),a=y.padding,x.x+=a.left,x.y+=a.top),x}return a},kt.Object.defineProperties(Ga.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())}}}),Ga.prototype.collectParts=Ga.prototype.ex,Ga.prototype.getLayoutBounds=Ga.prototype.ni,Ga.prototype.invalidateLayout=Ga.prototype.C,Ga.className="Layout";function Ta(a){wr(this),this.Sc=a,this.wf=new Zn,this.ye=new Zn,this.Es=new Ut,this.zs=new Ut}Ta.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 Zn,this.ye=new Zn,this.Es=new Ut,this.zs=new Ut},Ta.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},Ta.prototype.createVertex=function(){return new Es(this)},Ta.prototype.createEdge=function(){return new ql(this)},Ta.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 Fi)return!ee.isLinkLabel;if(ee instanceof ti){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 Fi&&(!y||E.isTopLevel)&&E.canLayout()&&x(E)){if(E instanceof qr&&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 ti&&(!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))}}},Ta.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},Ce=Ta.prototype,Ce.dh=function(a){if(a!==null){this.wf.add(a);var y=a.node;y!==null&&this.Es.add(y,a),a.network=this}},Ce.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},Ce.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}Ce.Zy=function(a){a!==null&&(a=this.ki(a),a!==null&&this.Iu(a))},Ce.ki=function(a){return a===null?null:this.Es.I(a)},Ce.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}}Ce.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},Ce.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))}Ce.Yy=function(a){a!==null&&(a=this.Lo(a),a!==null&&this.Mj(a))},Ce.Lo=function(a){return a===null?null:this.zs.I(a)},Ce.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},Ce.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))}},Ce.Ko=function(){for(var a=Hi(),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]);Mi(a)},Ta.prototype.deleteArtificialVertexes=function(){for(var a=Hi(),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=Hi(),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]);Mi(a),Mi(y)};function kS(a){for(var y=Hi(),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]);Mi(y)}Ta.prototype.Zx=function(a){a===void 0&&(a=!0),a&&(this.deleteArtificialVertexes(),kS(this),this.Ko()),a=new Tn;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))}}Ta.prototype.dz=function(){for(var a=new Zn,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},kt.Object.defineProperties(Ta.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}}}),Ta.prototype.findAllParts=Ta.prototype.dz,Ta.prototype.splitIntoSubNetworks=Ta.prototype.Zx,Ta.prototype.deleteSelfEdges=Ta.prototype.Ko,Ta.prototype.reverseEdge=Ta.prototype.gm,Ta.prototype.linkVertexes=Ta.prototype.Zj,Ta.prototype.findEdge=Ta.prototype.Lo,Ta.prototype.deleteLink=Ta.prototype.Yy,Ta.prototype.deleteEdge=Ta.prototype.Mj,Ta.prototype.addLink=Ta.prototype.Dy,Ta.prototype.addEdge=Ta.prototype.Bo,Ta.prototype.findVertex=Ta.prototype.ki,Ta.prototype.deleteNode=Ta.prototype.Zy,Ta.prototype.deleteVertex=Ta.prototype.Iu,Ta.prototype.addNode=Ta.prototype.Bl,Ta.prototype.addVertex=Ta.prototype.dh,Ta.prototype.addParts=Ta.prototype.lg,Ta.className="LayoutNetwork";function Es(a){wr(this),this.ob=a,this.j=new zt(0,0,10,10).freeze(),this.o=new _e(5,5).freeze(),this.Sh=this.ub=null,this.tg=new Tn,this.mg=new Tn}Es.prototype.clear=function(){this.Sh=this.ub=null,this.tg=new Tn,this.mg=new Tn},Es.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutVertex#"+hr(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},Es.prototype.commit=function(){var a=this.ub;if(a!==null){var y=this.bounds,x=a.bounds;cn(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 qr)){x=zt.alloc(),a.Va();var E=this.network.layout.ni(a,x),b=a.locationObject.ga(yo);if(E.w()&&b.w()){a.moveTo(y.x+this.focusX-(b.x-E.x),y.y+this.focusY-(b.y-E.y)),zt.free(x);return}zt.free(x)}a.moveTo(y.x,y.y)}},Es.prototype.Cl=function(a){a!==null&&(this.tg.contains(a)||this.tg.add(a))},Es.prototype.Kl=function(a){a!==null&&this.tg.remove(a)},Es.prototype.zl=function(a){a!==null&&(this.mg.contains(a)||this.mg.add(a))},Es.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}kt.Object.defineProperties(Es.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=zt.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),zt.free(x),!(a instanceof qr)&&(a=a.locationObject.ga(yo),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 Zn,y=this.sourceEdges;y.next();)a.add(y.value.fromVertex);return a.iterator}},destinationVertexes:{get:function(){for(var a=new Zn,y=this.destinationEdges;y.next();)a.add(y.value.toVertex);return a.iterator}},vertexes:{get:function(){for(var a=new Zn,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 Tn,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}}}),Es.prototype.deleteDestinationEdge=Es.prototype.Jl,Es.prototype.addDestinationEdge=Es.prototype.zl,Es.prototype.deleteSourceEdge=Es.prototype.Kl,Es.prototype.addSourceEdge=Es.prototype.Cl,Es.className="LayoutVertex",Es.standardComparer=gy,Es.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 ql(a){wr(this),this.nb=a,this.qd=this.kd=this.$k=this.ub=null}ql.prototype.clear=function(){this.qd=this.kd=this.$k=this.ub=null},ql.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutEdge#"+hr(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},ql.prototype.gm=function(){var a=this.kd;this.kd=this.qd,this.qd=a},ql.prototype.commit=function(){},ql.prototype.Ax=function(a){return this.qd===a?this.kd:this.kd===a?this.qd:null},kt.Object.defineProperties(ql.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)}}}),ql.prototype.getOtherVertex=ql.prototype.Ax,ql.className="LayoutEdge";function Hs(a){Ga.call(this),this.isViewportSized=!0,this.yo=this.zo=NaN,this.yg=new bn(NaN,NaN).freeze(),this.tf=new bn(10,10).freeze(),this.Jb=um,this.Rb=M0,this.nd=hm,this.hd=hx,a&&Object.assign(this,a)}Tt(Hs,Ga),Hs.prototype.cloneProtected=function(a){Ga.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===ph?this.arrangement=a:a===um||a===B0?this.alignment=a:it("Unknown enum value: "+a):Ga.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 qr)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,le=zt.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],le);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],le);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,Xe=0,Ve=0,st=0;st<b.length;st++){var ht=b[st],pt=this.ni(ht,le),Et=Math.ceil((pt.width+re)/he)*he,Gt=Math.ceil((pt.height+oe)/ge)*ge;switch(xe){case ph:var xi=Math.abs(Fe-pt.width);break;default:xi=Fe+pt.width}switch((0<z&&Xe>z-1||0<ee&&0<Xe&&xi-Pe>ee)&&(E.push(new zt(0,Ne,ee+re,Ve)),Xe=0,Fe=Pe,Ne+=Ve,Ve=0),Ve=Math.max(Ve,Gt),xe){case ph:pt=-pt.width;break;default:pt=0}switch(ht.moveTo(Fe+pt,Ne),xe){case ph:Fe-=Et;break;default:Fe+=Et}Xe++}E.push(new zt(0,Ne,ee+re,Ve)),zt.free(le);break;case um:for(oe=ee,he=z,ge=y,xe=x,ee=zt.alloc(),Pe=Math.max(this.cellSize.width,1),z=Ne=le=0,re=_e.alloc(),Fe=0;Fe<b.length;Fe++)Ve=b[Fe],Xe=this.ni(Ve,ee),Ve=nc(Ve,Ve.locationObject,Ve.locationSpot,re),le=Math.max(le,Ve.x),Ne=Math.max(Ne,Xe.width-Ve.x),z=Math.max(z,Ve.y);switch(Fe=this.arrangement,Fe){case ph:le+=ge;break;default:Ne+=ge}Pe=isFinite(Pe)?Math.max(Pe+ge,1):Math.max(le+Ne,1);var Ki=Ve=this.arrangementOrigin.x;for(st=this.arrangementOrigin.y,Ne=0,oe>=le&&(oe-=le),le=ht=0,Et=Math.max(this.cellSize.height,1),pt=z=0,Gt=!0,Xe=_e.alloc(),xi=0;xi<b.length;xi++){var ji=b[xi],ei=this.ni(ji,ee),En=nc(ji,ji.locationObject,ji.locationSpot,re);if(0<Ne)switch(Fe){case ph:Ki=(Ki-Ve-(ei.width-En.x))/Pe,Ki=He.$(Math.round(Ki),Ki)?Math.round(Ki):Math.floor(Ki),Ki=Ki*Pe+Ve;break;default:Ki=(Ki-Ve+En.x)/Pe,Ki=He.$(Math.round(Ki),Ki)?Math.round(Ki):Math.ceil(Ki),Ki=Ki*Pe+Ve}else switch(Fe){case ph:ht=Ki+En.x+ei.width;break;default:ht=Ki-En.x}switch(Fe){case ph:var Qr=-(Ki+En.x)+ht;break;default:Qr=Ki+ei.width-En.x-ht}if(0<he&&Ne>he-1||0<oe&&0<Ne&&Qr>oe){for(E.push(new zt(0,Gt?st-z:st,oe+ge,pt+z+xe)),Ki=0;Ki<Ne&&xi!==Ne;Ki++){Qr=b[xi-Ne+Ki];var Gr=nc(Qr,Qr.locationObject,Qr.locationSpot,Xe);Qr.moveTo(Qr.position.x,Qr.position.y+z-Gr.y)}pt+=xe,st=Gt?st+pt:st+(pt+z),Ne=pt=z=0,Ki=Ve,Gt=!1}switch(Ki===Ve&&(le=Fe===ph?Math.max(le,ei.width-En.x):Math.min(le,-En.x)),z=Math.max(z,En.y),pt=Math.max(pt,ei.height-En.y),isFinite(Et)&&(pt=Math.max(pt,Math.max(ei.height,Et)-En.y)),Gt?ji.moveTo(Ki-En.x,st-En.y):ji.moveTo(Ki-En.x,st),Fe){case ph:Ki-=En.x+ge;break;default:Ki+=ei.width-En.x+ge}Ne++}if(E.push(new zt(0,st,oe+ge,(Gt?pt:pt+z)+xe)),b.length!==Ne)for(oe=0;oe<Ne;oe++)he=b[b.length-Ne+oe],ge=nc(he,he.locationObject,he.locationSpot,re),he.moveTo(he.position.x,he.position.y+z-ge.y);if(_e.free(re),_e.free(Xe),Fe===ph)for(b=0;b<E.length;b++)z=E[b],z.width+=le,z.x-=le;else for(b=0;b<E.length;b++)z=E[b],z.x>le&&(z.width+=z.x-le,z.x=le);zt.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===ph?this.commitLayers(E,new _e(b+y/2-(z+b),ee-x/2)):this.commitLayers(E,new _e(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}kt.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!==ph||(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 en(Hs,"Position",0),um=new en(Hs,"Location",1),M0=new en(Hs,"LeftToRight",2),ph=new en(Hs,"RightToLeft",3),py=new en(Hs,"Forward",4),k0=new en(Hs,"Reverse",5),hm=new en(Hs,"Ascending",6),A0=new en(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=ph,Hs.Forward=py,Hs.Reverse=k0,Hs.Ascending=hm,Hs.Descending=A0;function va(){this.On=new Zn,this.Dn=new Zn,this.Pa=new Zn,this.cf=new Ut,this.bf=new Ut,this.aj=new Ut,this.H=null,this.tp=!1}Ce=va.prototype,Ce.clear=function(){this.On.clear(),this.Dn.clear(),this.Pa.clear(),this.cf.clear(),this.bf.clear(),this.aj.clear()},Ce.Xe=function(a){this.H=a},Ce.oi=function(a){if(a instanceof Fi){if(this.On.add(a),a instanceof qr){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 ti?this.Dn.add(a):a instanceof $o||this.Pa.add(a);y=a.data,y===null||a instanceof $o||(a instanceof ti?this.bf.add(y,a):this.cf.add(y,a))},Ce.pc=function(a){if(a.Ej(),a instanceof Fi){if(this.On.remove(a),a instanceof qr){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 ti?this.Dn.remove(a):a instanceof $o||this.Pa.remove(a);y=a.data,y===null||a instanceof $o||(a instanceof ti?this.bf.remove(y):this.cf.remove(y))},Ce.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 qr)&&it('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 qr||it('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 ti||it('Invalid link template in Diagram.linkTemplateMap: template for "'+E+'" must be a Link, not a normal Node or simple Part: '+x);for(y=Hi(),x=a.selection.iterator;x.next();)(E=x.value.data)&&y.push(E);for(x=Hi(),a=a.highlighteds.iterator;a.next();)(E=a.value.data)&&x.push(E);for(a=Hi(),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]);Mi(y),Mi(x),Mi(a)}},va.prototype.addAllModeledParts=function(){this.addModeledParts(this.diagram.model.nodeDataArray)},va.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&&Sd(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&&(Ru(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)}}va.prototype.insertLink=function(){return null},va.prototype.resolveReferencesForData=function(){},va.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,Di('No Group template found for category "'+x+'"'),Di(" Using default group template")),y=a.ly))):(y=a.nodeTemplateMap.I(x),y===null&&(y=a.nodeTemplateMap.I(""),y===null&&(gx||(gx=!0,Di('No Node template found for category "'+x+'"'),Di(" Using default node template")),y=a.ny))),y}va.prototype.getLinkCategoryForData=function(){return""},va.prototype.setLinkCategoryForData=function(){},va.prototype.setFromNodeForLink=function(){},va.prototype.setToNodeForLink=function(){},va.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,Di('No Link template found for category "'+a+'"'),Di(" Using default link template")),x=y.my)),x},va.prototype.removeAllModeledParts=function(){this.Gs(this.diagram.model.nodeDataArray)},va.prototype.Gs=function(a){var y=this;a.forEach(function(x){y.ip(x)})},va.prototype.ip=function(a){a=this.Lc(a),a!==null&&(ng(this.diagram,a,!1),this.unresolveReferencesForPart(a))},va.prototype.unresolveReferencesForPart=function(){},va.prototype.removeDataForLink=function(){},va.prototype.findPartForKey=function(a){return a==null?null:(a=this.H.model.hc(a),a!==null?this.cf.I(a):null)},va.prototype.Vb=function(a){return a==null||(a=this.H.model.hc(a),a===null)?null:(a=this.cf.I(a),a instanceof Fi?a:null)},va.prototype.findLinkForKey=function(){return null},Ce=va.prototype,Ce.Lc=function(a){if(a===null)return null;var y=this.cf.I(a);return y!==null?y:y=this.bf.I(a)},Ce.ii=function(a){return a===null?null:(a=this.cf.I(a),a instanceof Fi?a:null)},Ce.Kc=function(a){return a===null?null:this.bf.I(a)},Ce.ms=function(a){for(var y=0;y<arguments.length;++y);y=new Zn;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(cn(ee)&&my(this,b,ee)){y.add(E);break}}}return y.iterator},Ce.ls=function(a){for(var y=0;y<arguments.length;++y);y=new Zn;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(cn(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(qt(z)){if(!qt(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(cn(y)&&cn(x)){if(!my(a,y,x))return!1}else if(y!==x)return!1;return!0}va.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===Bo){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===ta){var ee=a.newValue;E==="nodeDataArray"&&cn(ee)&&dx(this,ee),y.isModified=!0}else if(x===Sa){var re=a.oldValue;E==="nodeDataArray"&&cn(re)&&this.ip(re),y.isModified=!0}else x===ra&&(E==="SourceChanged"?a.object!==null?this.updateDataBindings(a.object,a.propertyName):(this.rp(),this.updateAllTargetBindings()):E==="ModelDisplaced"&&this.Wd());else if(x===Bo){var oe=a.propertyName,le=a.object;le===y.model?(oe==="nodeKeyProperty"||oe==="nodeCategoryProperty")&&(y.undoManager.isUndoingRedoing||this.Wd()):this.updateDataBindings(le,oe),y.isModified=!0}else if(x===ta||x===Sa){var he=a.change===ta,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}}}}},va.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)},va.prototype.rp=function(){for(var a=this.H.model,y=new Zn,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()},va.prototype.refreshDataBoundLinks=function(){},va.prototype.updateRelationshipsFromData=function(){},va.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=Hi()),x.push(ee))}if(x!==null)break}if(x!==null){for(E=0;E<x.length;E++)x[E].La(y);Mi(x)}}a===this.diagram.model.modelData&&this.updateAllTargetBindings(y)}};function vy(a,y){var x=y.Hh;if(qt(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(qt(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}}}}va.prototype.Kj=function(a,y,x){x===void 0&&(x=!1);var E=new Ut;if(qt(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 Zn;for(var z=new Ut,ee=E.iterator;ee.next();){var re=ee.value;if(re instanceof ti)a||re.fromNode!==null&&re.toNode!==null||b.add(re);else if(re instanceof Fi&&re.data!==null&&x.Tl()){var oe=re;re=ee.key;var le=re.pg();le!==null&&(le=E.I(le),le!==null?(x.qe(oe.data,x.wa(le.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 Ut;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 Fi){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 qr&&z instanceof qr)for(y=y.memberParts;y.next();)ee=N0(a,y.value,x,E,b),ee instanceof ti||ee===null||(ee.containingGroup=z)}else if(y instanceof ti&&z instanceof ti)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 Fi&&(ee.labeledLink=z);return z}va.prototype.copyPartData=function(a,y){var x=null,E=a.data;if(E!==null&&y!==null){var b=y.model;a instanceof ti||(E=b.copyNodeData(E),cn(E)&&(b.xf(E),x=y.Lc(E)))}else Ru(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 ti||(b=y.copyNodeData(E)),cn(b)&&(x.data=b)));return x},kt.Object.defineProperties(va.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}}}),va.prototype.updateAllRelationshipsFromData=va.prototype.rp,va.prototype.findLinksByExample=va.prototype.ls,va.prototype.findNodesByExample=va.prototype.ms,va.prototype.findLinkForData=va.prototype.Kc,va.prototype.findNodeForData=va.prototype.ii,va.prototype.findPartForData=va.prototype.Lc,va.prototype.findNodeForKey=va.prototype.Vb,va.prototype.removeModeledPart=va.prototype.ip,va.prototype.removeModeledParts=va.prototype.Gs,va.prototype.rebuildParts=va.prototype.Wd;var gx=!1,px=!1,mx=!1;va.className="PartManager";function Ns(a){va.apply(this,arguments)}Tt(Ns,va),Ns.prototype.addAllModeledParts=function(){var a=this.diagram.model;this.addModeledParts(a.nodeDataArray),vx(this,a.linkDataArray)},Ns.prototype.addModeledParts=function(a){for(va.prototype.addModeledParts.call(this,a,!1),a=this.links.iterator;a.next();)gp(a.value);Sd(this.diagram,!1)};function vx(a,y){y.forEach(function(x){yx(a,x)}),Sd(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){Ru(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=I0(x,y,!0);z!==""&&(b.fromPortId=z),z=gu(x,y,!0),z!==void 0&&(z=a.Vb(z),z instanceof Fi&&(b.fromNode=z)),z=I0(x,y,!1),z!==""&&(b.toPortId=z),z=gu(x,y,!1),z!==void 0&&(z=a.Vb(z),z instanceof Fi&&(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}}}}Ns.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)})}Ns.prototype.getLinkCategoryForData=function(a){return this.diagram.model.ps(a)},Ns.prototype.setLinkCategoryForData=function(a,y){return this.diagram.model.lp(a,y)},Ns.prototype.setFromNodeForLink=function(a,y){var x=this.diagram.model;x.wv(a.data,x.wa(y!==null?y.data:null))},Ns.prototype.setToNodeForLink=function(a,y){var x=this.diagram.model;x.Bv(a.data,x.wa(y!==null?y.data:null))},Ns.prototype.removeDataForLink=function(a){this.diagram.model.bm(a.data)},Ns.prototype.findPartForKey=function(a){var y=va.prototype.findPartForKey.call(this,a);return y===null&&(a=this.diagram.model.jh(a),a!==null)?this.bf.I(a):y},Ns.prototype.findLinkForKey=function(a){return a==null?null:(a=this.diagram.model.jh(a),a!==null?this.bf.I(a):null)},Ns.prototype.doModelChanged=function(a){var y=this;if(va.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===Bo){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 le=this.Kc(a.object);if(le!==null){var he=a.newValue;typeof he=="string"&&(le.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 qr?Pe.containingGroup=Ne:Pe.containingGroup=null}else Pe.containingGroup=null}}else if(b==="linkLabelKeys"){var Xe=this.Kc(a.object);if(Xe!==null){var Ve=a.oldValue,st=a.newValue;Array.isArray(Ve)&&Ve.forEach(function(En){0<=st.indexOf(En)||(En=y.Vb(En),En!==null&&(En.labeledLink=null))}),Array.isArray(st)&&st.forEach(function(En){En=y.Vb(En),En!==null&&(En.labeledLink=Xe)})}}else if(b==="linkCategory"){var ht=this.Kc(a.object),pt=a.newValue;ht!==null&&typeof pt=="string"&&(ht.category=pt)}else b==="linkDataArray"&&(xx(this,a.oldValue),vx(this,a.newValue));x.isModified=!0}else if(E===ta){var Et=a.newValue;if(b==="linkDataArray"&&typeof Et=="object"&&Et!==null)yx(this,Et);else if(b==="linkLabelKeys"&&Wc(Et)){var Gt=this.Kc(a.object),xi=this.Vb(Et);Gt!==null&&xi!==null&&(xi.labeledLink=Gt)}x.isModified=!0}else if(E===Sa){var Ki=a.oldValue;if(b==="linkDataArray"&&typeof Ki=="object"&&Ki!==null)this.ip(Ki);else if(b==="linkLabelKeys"&&Wc(Ki)){var ji=this.Vb(Ki);ji!==null&&(ji.labeledLink=null)}x.isModified=!0}}else if(E===Bo){var ei=a.propertyName;a.object!==x.model||ei!=="linkFromKeyProperty"&&ei!=="linkToKeyProperty"&&ei!=="linkFromPortIdProperty"&&ei!=="linkToPortIdProperty"&&ei!=="linkLabelKeysProperty"&&ei!=="nodeIsGroupProperty"&&ei!=="nodeGroupKeyProperty"&&ei!=="linkCategoryProperty"||x.undoManager.isUndoingRedoing||this.Wd(),x.isModified=!0}}finally{x.aa=!0}}}}},Ns.prototype.refreshDataBoundLinks=function(){var a=this,y=this.diagram.model,x=new Zn,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)})},Ns.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 ti){var b=gu(E,y,!0);if(b=x.Vb(b),a.fromNode=b,b=gu(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 Zn().addAll(y);var ee=new Zn;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 $o)&&(y=E.lh(y),y=x.findPartForKey(y),y===null||y instanceof qr)&&(a.containingGroup=y)}}},Ns.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 qr&&y.lh(ee)===x&&(ee=this.Lc(ee),ee!==null&&(ee.containingGroup=b)):(z.link=this.Kc(ee),z.link!==null&&b instanceof Fi&&(gu(y,ee,!0)===x&&(z.link.fromNode=b),gu(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}}vh(y,x)}a=y.lh(a),a!==void 0&&(a=this.Vb(a),a instanceof qr&&(b.containingGroup=a))}},Ns.prototype.unresolveReferencesForPart=function(a){var y=this.diagram.model;if(a instanceof Fi){var x=y.wa(a.data);if(x!==void 0){for(var E=a.linksConnected;E.next();)mh(y,x,E.value.data);if(a.isLinkLabel&&(E=a.labeledLink,E!==null&&mh(y,x,E.data)),a instanceof qr)for(a=a.memberParts;a.next();)E=a.value.data,y.lb(E)&&mh(y,x,E)}}},Ns.prototype.copyPartData=function(a,y){var x=va.prototype.copyPartData.call(this,a,y);if(a instanceof ti)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},Ns.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 ti){if(Ru(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 Fi&&(Ru(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 Fi||(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},Ns.prototype.findLinkForKey=Ns.prototype.findLinkForKey,Ns.prototype.findPartForKey=Ns.prototype.findPartForKey,Ns.prototype.removeAllModeledParts=Ns.prototype.removeAllModeledParts,Ns.prototype.addModeledParts=Ns.prototype.addModeledParts,Ns.prototype.addAllModeledParts=Ns.prototype.addAllModeledParts,Ns.className="GraphLinksPartManager";function Fu(){va.apply(this,arguments),this.Sg=null}Tt(Fu,va);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||!Ea(E,b,z,null,!0))&&(y=a.getLinkCategoryForData(x.data),E=a.findLinkTemplateForCategory(y),E!==null&&(Ru(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}}}Fu.prototype.getLinkCategoryForData=function(a){return this.diagram.model.ss(a)},Fu.prototype.setLinkCategoryForData=function(a,y){this.diagram.model.Ms(a,y)},Fu.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}},Fu.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))},Fu.prototype.removeDataForLink=function(a){this.diagram.model.qe(a.data,void 0)},Fu.prototype.findLinkForKey=function(a){return a==null?null:(a=this.diagram.model.hc(a),a!==null?this.bf.I(a):null)},Fu.prototype.doModelChanged=function(a){if(va.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===Bo){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),le=a.newValue;if(oe!==null&&typeof le=="string"){var he=oe.kh();he!==null&&(he.category=le)}}y.isModified=!0}}else if(x===Bo){var ge=a.propertyName;a.object===y.model&&ge==="nodeParentKeyProperty"&&(y.undoManager.isUndoingRedoing||this.Wd()),y.isModified=!0}}finally{y.aa=!0}}}}},Fu.prototype.updateRelationshipsFromData=function(a){var y=a.data;if(y!==null){var x=a.diagram;if(x!==null){var E=x.model;a instanceof Fi&&(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)))}}},Fu.prototype.updateDataBindings=function(a,y){va.prototype.updateDataBindings.call(this,a,y),typeof y=="string"&&this.Lc(a)!==null&&(a=this.Kc(a),a!==null&&a.La(y))},Fu.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 Fi&&y.mh(z)===x&&D0(this,b,this.ii(z))}vh(y,x)}a=y.mh(a),a!==void 0&&b instanceof Fi&&(a=this.Vb(a),D0(this,a,b))}},Fu.prototype.unresolveReferencesForPart=function(a){var y=this.diagram.model;if(a instanceof Fi){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(Sa,"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)&&mh(y,x,b)}},Fu.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},Fu.prototype.findLinkForKey=Fu.prototype.findLinkForKey,Fu.className="TreePartManager";function tr(a,y){this.kl=new Zn,this.il=new Zn,this.Wv=`,
|
|
"insertedNodeKeys": `,this.jy=`,
|
|
"modifiedNodeData": `,this.Yv=`,
|
|
"removedNodeKeys": `,this.vh=null,wr(this),this.Sm=this.xa="",this.Gg=!1,this.j={},this.Tc=[],this.kb=new Ut,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 Ut,this.Lt=new Tn,this.Wg=!1,this.o=null,this.undoManager=new ha,a!==void 0&&(qt(a)?this.nodeDataArray=a:y=a),y&&(Object.assign(this,y),a=y.Changed)&&(delete this.Changed,this.Pe(a))}tr.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},tr.prototype.copy=function(){var a=new this.constructor;return this.cloneProtected(a),a},tr.prototype.clear=function(){this.Tc=[],this.kb.clear(),this.Vf.clear(),this.undoManager.clear()},tr.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)+":"+dr(b)}}return y},tr.prototype.xA=function(a){a.change!==ra&&it("Model.toIncrementalData argument is not a Transaction ChangedEvent:"+a.toString());var y=a.object;return a.isTransactionFinished&&y instanceof ro?(wx(this,y),a=this.Qv(y,a.propertyName==="FinishedUndo"),this.vh=null,a):null},tr.prototype.Qv=function(a,y){var x=this,E=!1,b=new Zn,z=new Zn,ee=new Zn,re=this.vh;a.changes.each(function(ge){ge.model===x&&(ge.modelChange==="nodeDataArray"?ge.change===ta?b.add(ge.newValue):ge.change===Sa&&ee.add(ge.oldValue):x.lb(ge.object)?z.add(ge.object):ge.change!==Bo||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 tr||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 le=this.kl;le.clear(),ee.each(function(ge){le.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<le.count&&(he===null&&(he={}),y?he.insertedNodeKeys=le.Fa():he.removedNodeKeys=le.Fa()),le.clear(),oe.clear(),he},tr.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=la++,E.set(ge,xe),b.set(ge,y))}if(!cn(y))return y;z||(z=[]);var re=Object.isExtensible(y);if(E||(E=new Ut),re){var oe=E.get(y);if(oe)return oe}else for(b||(b=new Ut),oe=b.iterator;oe.next();){var le=oe.key;if(oe.value===y&&(le=E.get(le)))return le}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 _e||y instanceof bn||y instanceof zt||y instanceof Vr||y instanceof ni)oe=y.copy(),ee(y,oe);else{if(y instanceof Jo||y instanceof Dt||y instanceof en)return y;if(y instanceof Tn)oe=new Tn().addAll(xp(a,y.Fa(),!1,E,b,z)),ee(y,oe);else if(y instanceof Zn)oe=new Zn().addAll(xp(a,y.Fa(),!1,E,b,z)),ee(y,oe);else if(y instanceof Ut)oe=new Ut().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}Ce=tr.prototype,Ce.quote=function(a){return JSON.stringify(a).replace(/[\u007F-\uFFFF]/g,function(y){return"\\u"+("0000"+y.charCodeAt(0).toString(16)).substr(-4)})},Ce.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},Ce.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,cn(y)&&(a.dm(y),a.modelData=y)}Ce.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": `+Hc(this,this.nodeDataArray,!0)},Ce.kv=function(a){Sx(this,a),a=a.nodeDataArray,qt(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 Zn,ee.add(z),E.add(b,ee)):ee.add(z)}}var E=a.vh;E===null&&(E=new Ut,y.changes.each(function(b){if(b.diagram!==null){var z=b.change;z===Bo?(b=b.object.panel)&&(z=b.data)&&x(z,b):(z===ta||z===Sa)&&(b=b.object,(z=b.itemArray)&&x(z,b))}}),a.vh=E)}function Px(a,y){for(var x=new Zn,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(cn(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}Ce.Pv=function(a,y){var x=this,E=!1,b=new Zn,z=new Zn,ee=new Zn,re=this.vh;a.changes.each(function(he){he.model===x&&(he.modelChange==="nodeDataArray"?he.change===ta?b.add(he.newValue):he.change===Sa&&ee.add(he.oldValue):x.lb(he.object)?z.add(he.object):he.change!==Bo||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 tr||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 le=this.kl;return le.clear(),ee.each(function(he){le.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)+Hc(this,oe.Fa(),!0)),0<z.count&&(a+=this.jy+Hc(this,z.Fa(),!0)),0<le.count&&(a+=(y?this.Wv:this.Yv)+Hc(this,le.Fa(),!0)),le.clear(),oe.clear(),a},Ce.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)&&it("applyIncrementalJson cannot change Model properties"),Sx(this,a);var y=a.insertedNodeKeys,x=a.modifiedNodeData,E=new Ut;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)},Ce.$x=function(a,y){a.change!==ra&&it("Model.toIncrementalJson argument is not a Transaction ChangedEvent:"+a.toString());var x=a.object;return a.isTransactionFinished&&x instanceof ro?(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 }'},Ce.yA=function(a,y){return this.$x(a,y)},Ce.np=function(a){return a===void 0&&(a=cm(this,this)),'{ "class": '+this.quote(a)+this.rm()+this.Rv()+"}"},Ce.toJSON=function(a){return this.np(a)},Ce.Zw=function(a){var y=null;if(typeof a=="string")try{y=yn.JSON.parse(a)}catch(E){}else typeof a=="object"?y=a:it("Unable to modify a Model from: "+a);var x=y.incremental;typeof x!="number"&&it("Unable to apply non-incremental changes to Model: "+a),x!==0&&(this.Ea("applyIncrementalJson"),this.fp(y),this.eb("applyIncrementalJson"))},Ce.Ky=function(a){return this.Zw(a)},tr.constructGraphLinksModel=function(){return new tr},Ce=tr.prototype,Ce.dm=function(a){if(qt(a))for(var y=a.length,x=0;x<y;x++){var E=a[x];if(cn(E)){var b=x;E=this.dm(E),Array.isArray(a)?a[b]=E:it("Cannot replace an object in an HTMLCollection or NodeList at "+b)}}else if(cn(a)){for(y in a)if(x=a[y],cn(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 Tn,E=0;E<x.length/2;E++)b.add(new _e(x[2*E],x[2*E+1]));b.freeze(),a[y]=b}}return AS(a)}return a},Ce.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()):qt(a)?Hc(this,a):cn(a)?xy(this,a):typeof a=="function"?"null":a.toString()};function Hc(a,y,x){x===void 0&&(x=!1);var E=y.length;if(0>=E)return"[]";var b=new nr;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 wl(a){return isNaN(a)?"NaN":a===1/0?"9e9999":a===-1/0?"-9e9999":a}function xy(a,y){var x=y;if(x instanceof _e)y={class:"go.Point",x:wl(x.x),y:wl(x.y)};else if(x instanceof bn)y={class:"go.Size",width:wl(x.width),height:wl(x.height)};else if(x instanceof zt)y={class:"go.Rect",x:wl(x.x),y:wl(x.y),width:wl(x.width),height:wl(x.height)};else if(x instanceof Vr)y={class:"go.Margin",top:wl(x.top),right:wl(x.right),bottom:wl(x.bottom),left:wl(x.left)};else if(x instanceof ni)x.sb()?y={class:"go.Spot",x:wl(x.x),y:wl(x.y),offsetX:wl(x.offsetX),offsetY:wl(x.offsetY)}:y={class:"go.Spot",enum:x.toString()};else if(x instanceof Jo){if(y={class:"go.Brush",type:x.type.name},x.type===qd?y.color=x.color:(x.type===Bd||x.type===Cu)&&(y.start=x.start,y.end=x.end,x.type===Cu&&(x.startRadius!==0&&(y.startRadius=wl(x.startRadius)),isNaN(x.endRadius)||(y.endRadius=wl(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 Dt?(y={class:"go.Geometry",type:x.type.name},x.startX!==0&&(y.startX=wl(x.startX)),x.startY!==0&&(y.startY=wl(x.startY)),x.endX!==0&&(y.endX=wl(x.endX)),x.endY!==0&&(y.endY=wl(x.endY)),x.spot1.D(Xo)||(y.spot1=x.spot1),x.spot2.D(Xt)||(y.spot2=x.spot2),x.type===Dt.o&&(y.path=Dt.ia(x))):x instanceof en&&(y={class:"go.EnumValue",classType:cm(a,x.classType),name:x.name});E="{",x=!0;for(var b in y){var z=hs(y,b);if(!Ex(b,z))if(x?x=!1:E+=",",E+=a.quote(b)+":",b==="points"&&z instanceof Tn){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 Pl(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 _e(Pl(a.x),Pl(a.y));else if(y==="Size")x=new bn(Pl(a.width),Pl(a.height));else if(y==="Rect")x=new zt(Pl(a.x),Pl(a.y),Pl(a.width),Pl(a.height));else if(y==="Margin")x=new Vr(Pl(a.top),Pl(a.right),Pl(a.bottom),Pl(a.left));else if(y==="Spot")typeof a.enum=="string"?x=Ra(a.enum):x=new ni(Pl(a.x),Pl(a.y),Pl(a.offsetX),Pl(a.offsetY));else if(y==="Brush"){if(x=new Jo,x.type=li(Jo,a.type),typeof a.color=="string"&&(x.color=a.color),a.start instanceof ni&&(x.start=a.start),a.end instanceof ni&&(x.end=a.end),typeof a.startRadius=="number"&&(x.startRadius=Pl(a.startRadius)),typeof a.endRadius=="number"&&(x.endRadius=Pl(a.endRadius)),a=a.colorStops,cn(a))for(var E in a)x.addColorStop(parseFloat(E),a[E])}else y==="Geometry"?(x=null,typeof a.path=="string"?x=Dt.parse(a.path):x=new Dt,x.type=li(Dt,a.type),typeof a.startX=="number"&&(x.startX=Pl(a.startX)),typeof a.startY=="number"&&(x.startY=Pl(a.startY)),typeof a.endX=="number"&&(x.endX=Pl(a.endX)),typeof a.endY=="number"&&(x.endY=Pl(a.endY)),a.spot1 instanceof ni&&(x.spot1=a.spot1),a.spot2 instanceof ni&&(x.spot2=a.spot2)):y==="EnumValue"&&(E=a.classType,E.indexOf("go.")===0&&(E=E.substr(3)),E=wy(E),typeof E=="function"&&(x=li(E,a.name)));return x}Ce.Pe=function(a){return this.Lt.add(a),this},Ce.ik=function(a){this.Lt.remove(a)},Ce.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)},Ce.cb=function(a,y,x,E,b,z,ee){ws(this,"",a,y,x,E,b,z,ee)},Ce.g=function(a,y,x,E,b){ws(this,"",Bo,a,this,y,x,E,b)},Ce.Fs=function(a,y,x,E,b,z){ws(this,"",Bo,y,a,x,E,b,z)};function ws(a,y,x,E,b,z,ee,re,oe){re===void 0&&(re=null),oe===void 0&&(oe=null);var le=new sr;le.model=a,le.change=x,le.modelChange=y,le.propertyName=E,le.object=b,le.oldValue=z,le.oldParam=re,le.newValue=ee,le.newParam=oe,a.ds(le)}tr.prototype.changeState=function(a,y){if(a!==null&&a.model===this)if(a.change===Bo){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)),Za(x,E,b)}else a.change===ta?(x=a.newParam,a.modelChange==="nodeDataArray"?(a=a.newValue,cn(a)&&typeof x=="number"&&(E=this.wa(a),y?(this.Tc[x]===a&&ur(this.Tc,x),E!==void 0&&this.kb.remove(E)):(this.Tc[x]!==a&&Gi(this.Tc,x,a),E!==void 0&&this.kb.add(E,a)))):a.modelChange===""?((E=a.object)&&!qt(E)&&a.propertyName&&(E=hs(a.object,a.propertyName)),qt(E)&&typeof x=="number"&&(a=a.newValue,y?ur(E,x):Gi(E,x,a))):it("unknown ChangedEvent.Insert modelChange: "+a.toString())):a.change===Sa?(x=a.oldParam,a.modelChange==="nodeDataArray"?(a=a.oldValue,cn(a)&&typeof x=="number"&&(E=this.wa(a),y?(this.Tc[x]!==a&&Gi(this.Tc,x,a),E!==void 0&&this.kb.add(E,a)):(this.Tc[x]===a&&ur(this.Tc,x),E!==void 0&&this.kb.remove(E)))):a.modelChange===""?((E=a.object)&&!qt(E)&&a.propertyName&&(E=hs(a.object,a.propertyName)),qt(E)&&typeof x=="number"&&(a=a.oldValue,y?Gi(E,x,a):ur(E,x))):it("unknown ChangedEvent.Remove modelChange: "+a.toString())):a.change!==ra&&it("unknown ChangedEvent: "+a.toString())},tr.prototype.Ea=function(a){return this.undoManager.Ea(a)},tr.prototype.eb=function(a){return this.undoManager.eb(a)},tr.prototype.Kf=function(){return this.undoManager.Kf()},tr.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}},Ce=tr.prototype,Ce.La=function(a,y){y===void 0&&(y=""),ws(this,"SourceChanged",ra,y,a,null,null)},Ce.wa=function(a){if(a!==null){var y=this.Th;if(y!==""&&(y=hs(a,y),y!==void 0)){if(Wc(y))return y;it("Key value for node data "+a+" is not a number or a string: "+y)}}},Ce.km=function(a,y){if(a!==null){var x=this.Th;if(x!=="")if(this.lb(a)){var E=hs(a,x);E!==y&&this.hc(y)===null&&(Za(a,x,y),E!==void 0&&this.kb.remove(E),this.kb.add(y,a),ws(this,"nodeKey",Bo,x,a,E,y),typeof x=="string"&&this.La(a,x),this.jp(E,y))}else Za(a,x,y)}};function Wc(a){return typeof a=="number"||typeof a=="string"}Ce.lb=function(a){var y=this.wa(a);return y===void 0?!1:this.kb.I(y)===a},Ce.hc=function(a){return a===null&&it("Model.findNodeDataForKey:key must not be null"),a!==void 0&&Wc(a)?this.kb.I(a):null},Ce.$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))){Za(a,y,x);return}if(typeof x=="string"){for(E=2;this.kb.contains(x+E);)E++;Za(a,y,x+E)}else if(x===void 0||typeof x=="number"){for(x=-this.kb.count-1;this.kb.contains(x);)x--;Za(a,y,x)}}}}},Ce.xf=function(a){a!==null&&(Or(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&&it("Model.makeNodeDataKeyUnique failed on "+y+". Data not added to Model."),a.kb.add(E,y),E=null,x&&(E=a.Tc.length,Gi(a.Tc,E,y)),ws(a,"nodeDataArray",ta,"nodeDataArray",a,null,y,null,E),a.fm(y),a.em(y))}Ce.Fy=function(a){if(qt(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)},Ce.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;ur(a.Tc,E)}ws(a,"nodeDataArray",Sa,"nodeDataArray",a,y,null,E,null),a.qp(y)}Ce.nA=function(a){if(qt(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)},Ce.$z=function(a){if(a!==this.nodeDataArray&&qt(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()}},Ce.jp=function(a,y){y!==void 0&&(a=dm(this,a),a instanceof Zn&&this.Vf.add(y,a))},Ce.Lv=function(){},Ce.fm=function(){},Ce.em=function(){},Ce.qp=function(){};function mh(a,y,x){if(y!==void 0){var E=a.Vf.I(y);E===null&&(E=new Zn,a.Vf.add(y,E)),E.add(x)}}function vh(a,y,x){if(y!==void 0){var E=a.Vf.I(y);E instanceof Zn&&(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 Zn?a:null)}Ce.Qy=function(a){a===void 0?this.Vf.clear():this.Vf.remove(a)},tr.prototype.copyNodeData=function(a){if(a===null)return null;var y=this.Bk;return a=y!==null?y(a,this):_0(this,a,!0),cn(a)&&wr(a),a};function _0(a,y,x){if(a.copiesArrays&&Array.isArray(y)){var E=[];for(x=0;x<y.length;x++){var b=_0(a,y[x],a.copiesArrayObjects);E.push(b)}return wr(E),E}if(x&&cn(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=hs(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 tr||z instanceof ha||z instanceof ro||z instanceof sr||(z=_0(a,z,!1)),Za(x,E,z)}return wr(x),x}return y instanceof _e||y instanceof bn||y instanceof zt||y instanceof ni||y instanceof Vr?y.copy():y}tr.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 bt&&(Fx=!0,Di('Model.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),Di(" Is that really your intent?"));var E=hs(a,y);E!==x&&(Za(a,y,x),this.Fs(a,y,E,x))},Ce=tr.prototype,Ce.set=function(a,y,x){this.setDataProperty(a,y,x)},Ce.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])}},Ce.Ay=function(a,y){this.ts(a,-1,y)},Ce.ts=function(a,y,x){0>y&&(y=a.length),Gi(a,y,x),ws(this,"",ta,"",a,null,x,null,y)},Ce.ov=function(a,y){y===void 0&&(y=-1),a===this.Tc&&it("Model.removeArrayItem should not be called on the Model.nodeDataArray"),y===-1&&(y=a.length-1);var x=a[y];ur(a,y),ws(this,"",Sa,"",a,x,null,y,null)},Ce.Ro=function(a){if(a===null)return"";var y=this.lj;if(y===""||(y=hs(a,y),y===void 0))return"";if(typeof y=="string")return y;it("getCategoryForNodeData found a non-string category for "+a+": "+y)},Ce.jm=function(a,y){if(a!==null){var x=this.lj;if(x!=="")if(this.lb(a)){var E=hs(a,x);E===void 0&&(E=""),E!==y&&(Za(a,x,y),ws(this,"nodeCategory",Bo,x,a,E,y))}else Za(a,x,y)}},Ce.lm=function(a,y){this.jm(y,this.Ro(a))},Ce.Tl=function(){return!1},Ce.Wj=function(){return!1},Ce.ri=function(){return!1},Ce.xs=function(){return!1},Ce.Xj=function(){return!1};function Sy(){return new tr}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]:yn.go!==void 0&&yn.go[a]?yn.go[a]:null}function hs(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 Za(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){}}kt.Object.defineProperties(tr.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===""&&it("Model.nodeKeyProperty may not be the empty string"),0<this.kb.count&&it("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];cn(b)||it("Model.nodeDataArray must only contain Objects, not: "+b),Or(b)}for(this.Tc=a,E=new Tn,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(ws(this,"nodeDataArray",Bo,"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"}}}),tr.prototype.setCategoryForNodeData=tr.prototype.jm,tr.prototype.getCategoryForNodeData=tr.prototype.Ro,tr.prototype.removeArrayItem=tr.prototype.ov,tr.prototype.insertArrayItem=tr.prototype.ts,tr.prototype.addArrayItem=tr.prototype.Ay,tr.prototype.assignAllDataProperties=tr.prototype.Do,tr.prototype.set=tr.prototype.set,tr.prototype.clearUnresolvedReferences=tr.prototype.Qy,tr.prototype.mergeNodeDataArray=tr.prototype.$z,tr.prototype.removeNodeDataCollection=tr.prototype.nA,tr.prototype.removeNodeData=tr.prototype.cm,tr.prototype.addNodeDataCollection=tr.prototype.Fy,tr.prototype.addNodeData=tr.prototype.xf,tr.prototype.makeNodeDataKeyUnique=tr.prototype.$u,tr.prototype.findNodeDataForKey=tr.prototype.hc,tr.prototype.containsNodeData=tr.prototype.lb,tr.prototype.setKeyForNodeData=tr.prototype.km,tr.prototype.getKeyForNodeData=tr.prototype.wa,tr.prototype.updateTargetBindings=tr.prototype.La,tr.prototype.commit=tr.prototype.commit,tr.prototype.rollbackTransaction=tr.prototype.Kf,tr.prototype.commitTransaction=tr.prototype.eb,tr.prototype.startTransaction=tr.prototype.Ea,tr.prototype.raiseDataChanged=tr.prototype.Fs,tr.prototype.raiseChanged=tr.prototype.g,tr.prototype.raiseChangedEvent=tr.prototype.cb,tr.prototype.removeChangedListener=tr.prototype.ik,tr.prototype.addChangedListener=tr.prototype.Pe,tr.prototype.writeJsonValue=tr.prototype.sm,tr.prototype.replaceJsonObjects=tr.prototype.dm,tr.prototype.applyIncrementalJSON=tr.prototype.Ky,tr.prototype.applyIncrementalJson=tr.prototype.Zw,tr.prototype.toJSON=tr.prototype.toJSON,tr.prototype.toJson=tr.prototype.np,tr.prototype.toIncrementalJSON=tr.prototype.yA,tr.prototype.toIncrementalJson=tr.prototype.$x,tr.prototype.toIncrementalData=tr.prototype.xA,tr.prototype.clear=tr.prototype.clear;var Fx=!1,Qu={};tr.className="Model",tr.fromJSON=tr.fromJson=function(a,y){y===void 0&&(y=null);var x=null;if(typeof a=="string")try{x=yn.JSON.parse(a)}catch(z){}else typeof a=="object"?x=a:it("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=yn[E])),typeof b=="function"&&(a=new b)}catch(z){}a===null||a instanceof tr?y=a:it("Unable to construct a Model of declared class: "+x.class)}return y===null&&(y=tr.constructGraphLinksModel()),y.gp(x),y.kv(x),y},tr.safePropertyValue=hs,tr.safePropertySet=Za,Qu.Brush=Jo,Qu.ChangedEvent=sr,Qu.Geometry=Dt,Qu.Margin=Vr,Qu.Panel=Xn,Qu.Point=_e,Qu.Rect=zt,Qu.Size=bn,Qu.Spot=ni,Qu.Transaction=ro,Qu.UndoManager=ha;function fs(a,y,x,E){wr(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 Zn}fs.prototype.copy=function(){var a=new fs;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},Ce=fs.prototype,Ce.qb=function(a){a.classType===fs&&(this.mode=a)},Ce.toString=function(){return"Binding("+this.targetProperty+":"+this.sourceProperty+(this.Ai!==-1?" "+this.Ai:"")+" "+this.mode.name+")"},Ce.freeze=function(){return this._isFrozen=!0,this},Ce.ka=function(){return this._isFrozen=!1,this},Ce.Kx=function(a){return a===void 0&&(a=null),this.mode=fm,this.backConverter=a,this},Ce.cp=function(a){return a===void 0&&(a=""),this.sourceName=a,this.isToModel=!1,this},Ce.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)}Ce.Mv=function(a,y,x){var E=this.sl;if(x===void 0||E===""||E===x){x=this.xl;var b=this.Im;if(b===null&&x==="")Di("Binding error: target property is the empty string: "+this.toString());else{var z=y;if(E!==""&&(z=hs(y,E)),z!==void 0)if(b===null)x!==""&&Za(a,x,z);else try{if(x!==""){var ee=b(z,a);Za(a,x,ee)}else b(z,a)}catch(re){}}}},Ce.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=hs(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):Za(y,x,ee);else if(oe!==null&&E!==null&&0<=E.itemIndex&&E.panel!==null&&Array.isArray(E.panel.itemArray)){var le=E.itemIndex,he=E.panel.itemArray;oe.ov(he,le),oe.ts(he,le,ee)}}else try{if(x!==""){var ge=z(ee,y,oe);oe!==null?oe.setDataProperty(y,x,ge):Za(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)}}}},kt.Object.defineProperties(fs.prototype,{Ai:{get:function(){return this.j},set:function(a){this._isFrozen&&sn(this),this.j=a}},targetProperty:{get:function(){return this.xl},set:function(a){this._isFrozen&&sn(this),this.xl=a}},sourceName:{get:function(){return this.Cr},set:function(a){this._isFrozen&&sn(this),this.Cr=a,a!==null&&(this.wn=!1)}},isToModel:{get:function(){return this.wn},set:function(a){this._isFrozen&&sn(this),this.wn=a}},sourceProperty:{get:function(){return this.sl},set:function(a){this._isFrozen&&sn(this),this.sl=a}},converter:{get:function(){return this.Im},set:function(a){this._isFrozen&&sn(this),this.Im=a}},backConverter:{get:function(){return this.wk},set:function(a){this._isFrozen&&sn(this),this.wk=a}},mode:{get:function(){return this.el},set:function(a){this._isFrozen&&sn(this),this.el=a}}}),fs.prototype.updateSource=fs.prototype.sp,fs.prototype.updateTarget=fs.prototype.Mv,fs.prototype.ofModel=fs.prototype.dA,fs.prototype.ofObject=fs.prototype.cp,fs.prototype.makeTwoWay=fs.prototype.Kx;var NS="Binding",Bx=new en(fs,"OneWay",1),fm=new en(fs,"TwoWay",2);fs.className="Binding",fs.parseEnum=function(a,y){return function(x){return x=li(a,x),x===null?y:x}},fs.toString=dr,fs.OneWay=Bx,fs.TwoWay=fm;function Wo(a,y,x){tr.call(this),this.Vv=`,
|
|
"insertedLinkKeys": `,this.iy=`,
|
|
"modifiedLinkData": `,this.Xv=`,
|
|
"removedLinkKeys": `,this.md=[],this.$f=new Zn,this.wb=new Ut,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&&(qt(a)?this.nodeDataArray=a:x=a),x&&(Object.assign(this,x),a=x.Changed)&&(delete this.Changed,this.Pe(a))}Tt(Wo,tr),Wo.constructGraphLinksModel=tr.constructGraphLinksModel,Wo.prototype.cloneProtected=function(a){tr.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},Ce=Wo.prototype,Ce.clear=function(){tr.prototype.clear.call(this),this.md=[],this.wb.clear(),this.$f.clear()},Ce.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)+":"+dr(b)}for(y+=`
|
|
link data:`,a=this.linkDataArray,x=a.length,E=0;E<x;E++)b=a[E],y+=" "+gu(this,b,!0)+"-->"+gu(this,b,!1)}return y},Ce.Qv=function(a,y){this.linkKeyProperty===""&&it("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalData() to succeed.");var x=tr.prototype.Qv.call(this,a,y),E=this,b=new Zn,z=new Zn,ee=new Zn,re=this.vh;a.changes.each(function(he){he.model===E&&(he.modelChange==="linkDataArray"?he.change===ta?b.add(he.newValue):he.change===Sa&&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 tr||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 le=this.kl;return le.clear(),ee.each(function(he){le.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<le.count&&(x===null&&(x={}),y?x.insertedLinkKeys=le.Fa():x.removedLinkKeys=le.Fa()),le.clear(),oe.clear(),x},Ce.rm=function(){var a=tr.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},Ce.gp=function(a){tr.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)},Ce.Rv=function(){var a=tr.prototype.Rv.call(this),y=`,
|
|
"linkDataArray": `+Hc(this,this.linkDataArray,!0);return a+y},Ce.kv=function(a){tr.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 Zn,E=0;E<a.linkDataArray.length;E++){var b=a.linkDataArray[E];T0(a,y,b,b,x)}return x}Ce.Pv=function(a,y){this.linkKeyProperty===""&&it("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalJson() to succeed.");var x=tr.prototype.Pv.call(this,a,y),E=this,b=new Zn,z=new Zn,ee=new Zn,re=this.vh;a.changes.each(function(he){he.model===E&&(he.modelChange==="linkDataArray"?he.change===ta?b.add(he.newValue):he.change===Sa&&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 tr||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 le=this.kl;return le.clear(),ee.each(function(he){le.add(E.Ac(he)),y&&z.add(he)}),a=x,0<oe.count&&(a+=(y?this.Xv:this.Vv)+Hc(this,oe.Fa(),!0)),0<z.count&&(a+=this.iy+Hc(this,z.Fa(),!0)),0<le.count&&(a+=(y?this.Vv:this.Xv)+Hc(this,le.Fa(),!0)),le.clear(),oe.clear(),a},Ce.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)&&it("applyIncrementalJson cannot change Model properties"),tr.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===Bo){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),Za(x,E,b);return}}else if(a.change===ta){if(x=a.newParam,a.modelChange==="linkDataArray"){a=a.newValue,cn(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===Sa){if(x=a.oldParam,a.modelChange==="linkDataArray"){a=a.oldValue,cn(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}}tr.prototype.changeState.call(this,a,y)}},Ce=Wo.prototype,Ce.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),Za(x,this.nodeKeyProperty,a),this.xf(x))}return a}},Ce.yx=function(a){return gu(this,a,!0)},Ce.wv=function(a,y){Sp(this,a,y,!0)},Ce.Bx=function(a){return gu(this,a,!1)},Ce.Bv=function(a,y){Sp(this,a,y,!1)};function gu(a,y,x){if(y!==null&&(a=x?a.lf:a.mf,a!==""&&(a=hs(y,a),a!==void 0))){if(Wc(a))return a;it((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=hs(y,b);z!==x&&(vh(a,z,y),Za(y,b,x),a.hc(x)===null&&mh(a,x,y),ws(a,E?"linkFromKey":"linkToKey",Bo,b,y,z,x),typeof b=="string"&&a.La(y,b))}else Za(y,b,x)}}Ce.zx=function(a){return I0(this,a,!0)},Ce.xv=function(a,y){wp(this,a,y,!0)},Ce.Cx=function(a){return I0(this,a,!1)},Ce.Cv=function(a,y){wp(this,a,y,!1)};function I0(a,y,x){return y===null||(a=x?a.ej:a.fj,a==="")?"":(y=hs(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=hs(y,b);z===void 0&&(z=""),z!==x&&(Za(y,b,x),ws(a,E?"linkFromPortId":"linkToPortId",Bo,b,y,z,x),typeof b=="string"&&a.La(y,b))}else Za(y,b,x)}}Ce.Ef=function(a){if(a===null)return O0;var y=this.je;return y===""?O0:(a=hs(a,y),a===void 0?O0:a)},Ce.Ls=function(a,y){if(a!==null){var x=this.je;if(x!=="")if(this.Jc(a)){var E=hs(a,x);if(E===void 0&&(E=O0),E!==y){if(Array.isArray(E))for(var b=E.length,z=0;z<b;z++)vh(this,E[z],a);for(Za(a,x,y),b=y.length,z=0;z<b;z++){var ee=y[z];this.hc(ee)===null&&mh(this,ee,a)}ws(this,"linkLabelKeys",Bo,x,a,E,y),typeof x=="string"&&this.La(a,x)}}else Za(a,x,y)}},Ce.Bu=function(a,y){if(y!=null&&a!==null){var x=this.je;if(x!==""){var E=hs(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&&mh(this,y,a),ws(this,"linkLabelKeys",ta,x,a,null,y,null,b)))}else it(x+" property is not an Array; cannot addLabelKeyForLinkData: "+a)}}},Ce.Qx=function(a,y){if(y!=null&&a!==null){var x=this.je;if(x!==""){var E=hs(a,x);if(Array.isArray(E)){var b=E.indexOf(y);0>b||(E.splice(b,1),this.Jc(a)&&(vh(this,y,a),ws(this,"linkLabelKeys",Sa,x,a,y,null,b,null)))}else E!==void 0&&it(x+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}},Ce.Ac=function(a){if(a!==null){var y=this.Jh;if(y!==""&&(y=hs(a,y),y!==void 0)){if(Wc(y))return y;it("Key value for link data "+a+" is not a number or a string: "+y)}}},Ce.Ks=function(a,y){if(a!==null){var x=this.Jh;if(x!=="")if(this.Jc(a)){var E=hs(a,x);E!==y&&this.jh(y)===null&&(Za(a,x,y),E!==void 0&&this.wb.remove(E),this.wb.add(y,a),ws(this,"linkKey",Bo,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Za(a,x,y)}},Ce.jh=function(a){return a===null&&it("GraphLinksModel.findLinkDataForKey:key must not be null"),a!==void 0&&Wc(a)?this.wb.I(a):null},Ce.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))){Za(a,y,x);return}if(typeof x=="string"){for(E=2;this.wb.contains(x+E);)E++;Za(a,y,x+E)}else if(x===void 0||typeof x=="number"){for(x=-this.wb.count-1;this.wb.contains(x);)x--;Za(a,y,x)}}}}},Ce.Jc=function(a){return a===null?!1:this.$f.contains(a)},Ce.fi=function(a){a!==null&&(Or(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&&it("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)),ws(a,"linkDataArray",ta,"linkDataArray",a,null,y,null,E),Py(a,y)}Ce.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)},Ce.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(ws(a,"linkDataArray",Sa,"linkDataArray",a,y,null,E,null),x=gu(a,y,!0),vh(a,x,y),x=gu(a,y,!1),vh(a,x,y),E=a.Ef(y),Array.isArray(E))for(var b=E.length,z=0;z<b;z++)x=E[z],vh(a,x,y)}Ce.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)},Ce.Zz=function(a){if(this.linkKeyProperty===""&&it("GraphLinksModel.linkKeyProperty must not be an empty string for .mergeLinkDataArray() to succeed."),a!==this.linkDataArray&&qt(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=gu(a,y,!0);x=a.Vl(x),a.hc(x)===null&&mh(a,x,y),x=gu(a,y,!1),x=a.Vl(x),a.hc(x)===null&&mh(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&&mh(a,x,y)}Ce.Jo=function(a){if(a===null)return null;var y=this.Ak;return a=y!==null?y(a,this):_0(this,a,!0),cn(a)&&(wr(a),this.lf!==""&&Za(a,this.lf,void 0),this.mf!==""&&Za(a,this.mf,void 0),this.je!==""&&Za(a,this.je,[])),a},Ce.Yu=function(a){if(a===null)return!1;var y=this.jl;return y===""?!1:!!hs(a,y)},Ce.lh=function(a){if(a!==null){var y=this.Je;if(y!==""&&(y=hs(a,y),y!==void 0)){if(Wc(y))return y;it("GroupKey value for node data "+a+" is not a number or a string: "+y)}}},Ce.mp=function(a,y){if(y===null&&(y=void 0),a!==null){var x=this.Je;if(x!=="")if(this.lb(a)){var E=hs(a,x);E!==y&&(vh(this,E,a),Za(a,x,y),this.hc(y)===null&&mh(this,y,a),ws(this,"nodeGroupKey",Bo,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Za(a,x,y)}},Wo.prototype.copyNodeData=function(a){return a===null?null:(a=tr.prototype.copyNodeData.call(this,a),this.Ij||this.Je===""||hs(a,this.Je)===void 0||Za(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=hs(a,y);E!==x&&(Za(a,y,x),this.Fs(a,y,E,x))},Ce=Wo.prototype,Ce.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&&hs(a,b)===y[b]||E&&b===this.linkKeyProperty||this.setDataProperty(a,b,y[b])}},Ce.jp=function(a,y){tr.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(gu(this,E,!0)===b){var ee=this.lf;Za(E,ee,z),ws(this,"linkFromKey",Bo,ee,E,b,z),typeof ee=="string"&&this.La(E,ee)}if(gu(this,E,!1)===b&&(ee=this.mf,Za(E,ee,z),ws(this,"linkToKey",Bo,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,le=0;le<re;le++)ee[le]===b&&(ee[le]=z,ws(this,"linkLabelKeys",ta,oe,E,b,z,le,le))}},Ce.qv=function(a,y,x){if(this.lh(a)===y){var E=this.Je;Za(a,E,x),ws(this,"nodeGroupKey",Bo,E,a,y,x),typeof E=="string"&&this.La(a,E)}},Ce.Lv=function(){tr.prototype.Lv.call(this);for(var a=this.linkDataArray,y=a.length,x=0;x<y;x++)Py(this,a[x])},Ce.fm=function(a){tr.prototype.fm.call(this,a),a=this.wa(a);var y=dm(this,a);if(y!==null){var x=Hi();for(y=y.iterator;y.next();){var E=y.value;if(this.lb(E)){if(this.lh(E)===a){var b=this.Je;ws(this,"nodeGroupKey",Bo,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)}}else if(gu(this,E,!0)===a&&(b=this.lf,ws(this,"linkFromKey",Bo,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)),gu(this,E,!1)===a&&(b=this.mf,ws(this,"linkToKey",Bo,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&&(ws(this,"linkLabelKeys",ta,ee,E,a,a,re,re),x.push(E))}for(y=0;y<x.length;y++)vh(this,a,x[y]);Mi(x)}},Ce.em=function(a){tr.prototype.em.call(this,a);var y=this.lh(a);this.hc(y)===null&&mh(this,y,a)},Ce.qp=function(a){tr.prototype.qp.call(this,a);var y=this.lh(a);vh(this,y,a)},Ce.ps=function(a){if(a===null)return"";var y=this.dj;if(y===""||(y=hs(a,y),y===void 0))return"";if(typeof y=="string")return y;it("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=hs(a,x);E===void 0&&(E=""),E!==y&&(Za(a,x,y),ws(this,"linkCategory",Bo,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Za(a,x,y)}},Wo.prototype.setLinkCategoryForData=function(a,y){this.lp(a,y)},Ce=Wo.prototype,Ce.lm=function(a,y){tr.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))}Ce.Wj=function(){return!0},Ce.ri=function(){return!0},Ce.xs=function(){return!0},Ce.Xj=function(){return!0},kt.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];cn(b)||it("GraphLinksModel.linkDataArray must only contain Objects, not: "+b),Or(b)}if(this.md=a,this.linkKeyProperty!==""){for(E=new Tn,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 Zn,b=0;b<x;b++)E.add(a[b]);for(this.$f=E,ws(this,"linkDataArray",Bo,"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,tr.constructGraphLinksModel=tr.constructGraphLinksModel=function(){return new Wo},tr.initDiagramModel=Sy=function(){return new Wo};function El(a,y){tr.call(this),this.Ke="parent",this.Nm=!1,this.nj="parentLinkCategory",a!==void 0&&(qt(a)?this.nodeDataArray=a:y=a),y&&(Object.assign(this,y),a=y.Changed)&&(delete this.Changed,this.Pe(a))}Tt(El,tr),El.constructGraphLinksModel=tr.constructGraphLinksModel,El.prototype.cloneProtected=function(a){tr.prototype.cloneProtected.call(this,a),a.Ke=this.Ke,a.Nm=this.Nm,a.nj=this.nj},Ce=El.prototype,Ce.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)+":"+dr(b)}}return y},Ce.rm=function(){var a=tr.prototype.rm.call(this),y="";return this.nodeParentKeyProperty!=="parent"&&typeof this.nodeParentKeyProperty=="string"&&(y+=`,
|
|
"nodeParentKeyProperty": `+this.quote(this.nodeParentKeyProperty)),a+y},Ce.gp=function(a){tr.prototype.gp.call(this,a),a.nodeParentKeyProperty&&(this.nodeParentKeyProperty=a.nodeParentKeyProperty)},Ce.fp=function(a){a.nodeParentKeyProperty!==void 0&&a.nodeParentKeyProperty!==this.nodeParentKeyProperty&&it("applyIncrementalJson cannot change Model properties"),tr.prototype.fp.call(this,a)},Ce.Vl=function(a){return a},Ce.mh=function(a){if(a!==null){var y=this.Ke;if(y!==""&&(y=hs(a,y),y!==void 0)){if(Wc(y))return y;it("ParentKey value for node data "+a+" is not a number or a string: "+y)}}},Ce.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=hs(a,x);E!==y&&(vh(this,E,a),Za(a,x,y),this.hc(y)===null&&mh(this,y,a),ws(this,"nodeParentKey",Bo,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Za(a,x,y)}},Ce.ss=function(a){if(a===null)return"";var y=this.nj;return y===""||(y=hs(a,y),y===void 0)?"":typeof y=="string"?y:(it("getParentLinkCategoryForNodeData found a non-string category for "+a+": "+y),"")},El.prototype.getLinkCategoryForData=function(a){return this.ss(a)},El.prototype.Ms=function(a,y){if(a!==null){var x=this.nj;if(x!=="")if(this.lb(a)){var E=hs(a,x);E===void 0&&(E=""),E!==y&&(Za(a,x,y),ws(this,"parentLinkCategory",Bo,x,a,E,y),typeof x=="string"&&this.La(a,x))}else Za(a,x,y)}},El.prototype.setLinkCategoryForData=function(a,y){this.Ms(a,y)},El.prototype.copyNodeData=function(a){return a===null?null:(a=tr.prototype.copyNodeData.call(this,a),this.Jj||this.Ke===""||hs(a,this.Ke)===void 0||Za(a,this.Ke,void 0),a)},El.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=hs(a,y);E!==x&&(Za(a,y,x),this.Fs(a,y,E,x))},Ce=El.prototype,Ce.jp=function(a,y){tr.prototype.jp.call(this,a,y);for(var x=this.kb.iterator;x.next();)this.qv(x.value,a,y)},Ce.qv=function(a,y,x){if(this.mh(a)===y){var E=this.Ke;Za(a,E,x),ws(this,"nodeParentKey",Bo,E,a,y,x),typeof E=="string"&&this.La(a,E)}},Ce.fm=function(a){tr.prototype.fm.call(this,a),a=this.wa(a);var y=dm(this,a);if(y!==null){var x=Hi();for(y=y.iterator;y.next();){var E=y.value;if(this.lb(E)&&this.mh(E)===a){var b=this.Ke;ws(this,"nodeParentKey",Bo,b,E,a,a),typeof b=="string"&&this.La(E,b),x.push(E)}}for(y=0;y<x.length;y++)vh(this,a,x[y]);Mi(x)}},Ce.em=function(a){tr.prototype.em.call(this,a);var y=this.mh(a);y=this.Vl(y),this.hc(y)===null&&mh(this,y,a)},Ce.qp=function(a){tr.prototype.qp.call(this,a);var y=this.mh(a);vh(this,y,a)},Ce.lm=function(a,y){tr.prototype.lm.call(this,a,y),this.Ms(y,this.ss(a)),this.qe(y,this.mh(a))},Ce.Tl=function(){return!0},Ce.xs=function(){return!0},kt.Object.defineProperties(El.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"}}}),El.prototype.setParentLinkCategoryForNodeData=El.prototype.Ms,El.prototype.getParentLinkCategoryForNodeData=El.prototype.ss,El.prototype.setParentKeyForNodeData=El.prototype.qe,El.prototype.getParentKeyForNodeData=El.prototype.mh,El.className="TreeModel",Qu.TreeModel=El;function Ja(a){Ga.call(this),this.lw=this.Zm=this.lc=0,this.Wp=360,this.kw=$u,this.Ti=0,this.Zv=new _e,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=$u,this.K=Cl,this.nd=Ep,this.hd=gy,this.tf=6,this.Nn=W0,a&&Object.assign(this,a)}Tt(Ja,Ga),Ja.prototype.cloneProtected=function(a){Ga.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},Ja.prototype.qb=function(a){a.classType===Ja?a===G0||a===H0||a===z0||a===Z0||a===Ep?this.sorting=a:a===Rf||a===Pp||a===Cl||a===Kc?this.direction=a:a===sc||a===Vc||a===$u||a===qu?this.arrangement=a:(a===Mg||a===W0)&&(this.nodeDiameterFormula=a):Ga.prototype.qb.call(this,a)},Ja.prototype.createNetwork=function(){return new Cp(this)},Ja.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 Tn;y.addAll(a.iterator),a=new Tn;var x=new Tn,E=this.sort(y),b,z,ee=this.Jp,re=this.arrangement,oe=this.nodeDiameterFormula,le=this.radius;(!isFinite(le)||0>=le)&&(le=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===qu&&oe===Mg?re=$u:re===qu&&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===qu&&a.reverse(),E=new Tn,E.addAll(a),E.addAll(x)):(this.arrangement===qu&&x.reverse(),E=new Tn,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===Cl?1:-1)/oe,Ne=E.M(Pe).diameter;isNaN(Ne)&&(Ne=Uc(E.M(Pe),Fe)),360>xe&&(Pe===0||Pe===E.length-1)&&(Ne/=2),b+=Ne,z++}if(isNaN(le)||re===qu){if(isNaN(y)&&(y=6),re!==$u&&re!==qu){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)&&Uc(Pe,0),isNaN(b.diameter)&&Uc(b,0),z=Math.max(z,(Pe.diameter+b.diameter)/2);ee=z+y,re===sc?le=(z+y)/(2*Math.PI/oe):le=R0(this,ee*(360<=xe?oe:oe-1),he,ge*Math.PI/180,xe*Math.PI/180)}else le=R0(this,b+(360<=xe?oe:oe-1)*(re!==qu?y:1.6*y),he,ge*Math.PI/180,xe*Math.PI/180);z=le*he}else if(z=le*he,Pe=Ey(this,le,z,ge*Math.PI/180,xe*Math.PI/180),isNaN(y))(re===$u||re===qu)&&(y=(Pe-b)/(360<=xe?oe:oe-1));else if(re===$u||re===qu)Pe=(Pe-b)/(360<=xe?oe:oe-1),Pe<y?(le=R0(this,b+y*(360<=xe?oe:oe-1),he,ge*Math.PI/180,xe*Math.PI/180),z=le*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)&&Uc(Fe,0),isNaN(Ne.diameter)&&Uc(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>le?(le=b,z=le*he):ee=Pe/(360<=xe?oe:oe-1)}if(this.kw=re,this.lc=le,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,le=this.lw,he=this.Wp,ge=this.Ti,xe=this.me,oe=this.Jp,this.direction!==Rf&&this.direction!==Pp||E!==qu)if(this.direction===Rf||this.direction===Pp){switch(ee=0,E){case Vc:ee=180*j0(this,re,xe,le,oe)/Math.PI;break;case $u:oe=y=0,ee=a.first(),ee!==null&&(y=Uc(ee,Math.PI/2)),ee=x.first(),ee!==null&&(oe=Uc(ee,Math.PI/2)),ee=180*j0(this,re,xe,le,ge+(y+oe)/2)/Math.PI;break;case sc:ee=he/y.length}if(this.direction===Rf){switch(E){case Vc:mm(this,a,le,Kc);break;case $u:pm(this,a,le,Kc);break;case sc:gm(this,a,he/2,le,Kc)}switch(E){case Vc:mm(this,x,le+ee,Cl);break;case $u:pm(this,x,le+ee,Cl);break;case sc:gm(this,x,he/2,le+ee,Cl)}}else{switch(E){case Vc:mm(this,x,le,Kc);break;case $u:pm(this,x,le,Kc);break;case sc:gm(this,x,he/2,le,Kc)}switch(E){case Vc:mm(this,a,le+ee,Cl);break;case $u:pm(this,a,le+ee,Cl);break;case sc:gm(this,a,he/2,le+ee,Cl)}}}else switch(E){case Vc:mm(this,y,le,this.direction);break;case $u:pm(this,y,le,this.direction);break;case sc:gm(this,y,he,le,this.direction);break;case qu:Dx(this,y,he,le,this.direction)}else Dx(this,y,he,le-he/2,Cl)}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 le=E+(b===Cl?oe*x/(360<=z?re:re-1):-(oe*x)/re),he=y.M(oe),ge=ee*Math.tan(le)/a;ge=Math.sqrt((ee*ee+a*a*ge*ge)/(1+ge*ge)),he.centerX=ge*Math.cos(le),he.centerY=ge*Math.sin(le),he.actualAngle=180*le/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 le=y.M(oe),he=y.M(oe===re-1?0:oe+1),ge=z*Math.sin(x);le.centerX=b*Math.cos(x),le.centerY=ge,le.actualAngle=180*x/Math.PI,isNaN(le.diameter)&&Uc(le,0),isNaN(he.diameter)&&Uc(he,0),le=j0(a,b,z,E===Cl?x:-x,(le.diameter+he.diameter)/2+ee),x+=E===Cl?le:-le}}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 le=y.M(oe);le.centerX=b*Math.cos(x),le.centerY=z*Math.sin(x),le.actualAngle=180*x/Math.PI,le=j0(a,b,z,E===Cl?x:-x,ee),x+=E===Cl?le:-le}}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===Cl?z:-z);0>z;)z+=360;z%=360,180<z&&(z-=360),z*=Math.PI/180,a.gt=z,_x(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),le=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=_e.alloc();for(var ge=0;ge<he.length&&(he[ge].centerX=oe,he[ge].centerY=le,!(ge>=he.length-1));ge++)Ix(a,oe,le,he,ge,b,z)||Ox(a,oe,le,he,ge,b,z),oe=z.x,le=z.y;if(_e.free(z),a.mj++,!(23<a.mj)){oe=he[0].centerX,le=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(le-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!=le>ge:0<ge!=oe<z,(oe=b===Cl?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 _x(a,y,x,E,b){for(var z=a.lc,ee=a.me,re=a.Zm,oe=z*Math.cos(E*Math.PI/180),le=ee*Math.sin(E*Math.PI/180),he=_e.alloc(),ge=y.Fa(),xe=0;xe<ge.length&&(ge[xe].centerX=oe,ge[xe].centerY=le,!(xe>=ge.length-1));xe++)Ix(a,oe,le,ge,xe,b,he)||Ox(a,oe,le,ge,xe,b,he),oe=he.x,le=he.y;if(_e.free(he),a.mj++,!(23<a.mj)){if(oe=Math.atan2(le,oe),oe=b===Cl?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,_x(a,y,x,E,b))}}function Ix(a,y,x,E,b,z,ee){var re=a.lc,oe=a.me,le=0;a=(E[b].width+E[b+1].width)/2+a.Ti;var he=!1;if(0<=x!=(z===Cl)){if(z=y+a,z>re){if(z=y-a,z<-re)return ee.x=z,ee.y=le,!1;he=!0}}else if(z=y-a,z<-re){if(z=y+a,z>re)return ee.x=z,ee.y=le,!1;he=!0}return le=Math.sqrt(1-Math.min(1,z*z/(re*re)))*oe,0>x!==he&&(le=-le),Math.abs(x-le)>(E[b].height+E[b+1].height)/2?(ee.x=z,ee.y=le,!1):(ee.x=z,ee.y=le,!0)}function Ox(a,y,x,E,b,z,ee){var re=a.lc,oe=a.me,le=0;if(a=(E[b].height+E[b+1].height)/2+a.Ti,E=!1,0<=y!=(z===Cl)){if(z=x-a,z<-oe){if(z=x+a,z>oe){ee.x=le,ee.y=z;return}E=!0}}else if(z=x+a,z>oe){if(z=x-a,z<-oe){ee.x=le,ee.y=z;return}E=!0}le=Math.sqrt(1-Math.min(1,z*z/(oe*oe)))*re,0>y!==E&&(le=-le),ee.x=le,ee.y=z}Ja.prototype.commitLayout=function(){this.commitNodes(),this.isRouting&&this.commitLinks()},Ja.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 _e(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))},Ja.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,le=0;le<=z;le++){E!==void 0&&b!==void 0?oe=E+le*b/z:oe=le*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}}Ja.prototype.sort=function(a){switch(this.sorting){case z0:break;case Z0:a.reverse();break;case G0:a.sort(this.comparer);break;case H0:a.sort(this.comparer),a.reverse();break;case Ep:return this.ak(DS(a));default:it("Invalid sorting type.")}return a};function DS(a){for(var y=[],x=0;x<a.length;x++)y.push(0);x=new Tn;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}Ja.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 Tn;for(var oe=0,le=0;le<y.length;le++){var he=y[le].length;if(he===1)E.push(le);else if(he===0)b.add(a.M(le));else{if(oe===0)x.push(le);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],Xe=y[le],Ve=0,st=0;st<ee.length;st++){var ht=z[ee[st]],pt=z[re[st]];if(ht<pt){var Et=ht;ht=pt}else Et=pt;if(Et<Ne&&Ne<=ht)for(pt=0;pt<Xe.length;pt++){var Gt=Xe[pt];0>x.indexOf(Gt)||Et<z[Gt]&&z[Gt]<ht||Et===z[Gt]||ht===z[Gt]||Ve++}else for(pt=0;pt<Xe.length;pt++)Gt=Xe[pt],0>x.indexOf(Gt)||Et<z[Gt]&&z[Gt]<ht&&Et!==z[Gt]&&ht!==z[Gt]&&Ve++}for(Xe=Ve,st=Ve=0;st<y[le].length;st++)Et=x.indexOf(y[le][st]),0<=Et&&(Et=Math.abs(Ne-(Et>=Ne?Et+1:Et)),Ve+=Et<x.length+1-Et?Et:x.length+1-Et);for(st=0;st<ee.length;st++)Et=z[ee[st]],ht=z[re[st]],Et>=Ne&&Et++,ht>=Ne&&ht++,Et>ht&&(pt=ht,ht=Et,Et=pt),ht-Et<(x.length+2)/2==(Et<Ne&&Ne<=ht)&&Ve++;(Xe<he||Xe===he&&Ve<ge)&&(he=Xe,ge=Ve,xe=Ne)}for(x.splice(xe,0,le),he=0;he<x.length;he++)z[x[he]]=he;for(he=0;he<y[le].length;he++)ge=y[le][he],0<=x.indexOf(ge)&&(ee.push(le),re.push(ge))}oe++}}for(ee=x.length;;){for(z=!0,re=0;re<E.length;re++)if(oe=E[re],le=y[oe][0],he=x.indexOf(le),0<=he){for(xe=ge=0;xe<y[le].length;xe++)Pe=x.indexOf(y[le][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},kt.Object.defineProperties(Ja.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!==qu&&a!==$u&&a!==Vc&&a!==sc||(this.Rb=a,this.C())}},direction:{get:function(){return this.K},set:function(a){this.K===a||a!==Cl&&a!==Kc&&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&&!H0&&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!==W0&&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 $u=new en(Ja,"ConstantSpacing",0),Vc=new en(Ja,"ConstantDistance",1),sc=new en(Ja,"ConstantAngle",2),qu=new en(Ja,"Packed",3),Cl=new en(Ja,"Clockwise",4),Kc=new en(Ja,"Counterclockwise",5),Rf=new en(Ja,"BidirectionalLeft",6),Pp=new en(Ja,"BidirectionalRight",7),z0=new en(Ja,"Forwards",8),Z0=new en(Ja,"Reverse",9),G0=new en(Ja,"Ascending",10),H0=new en(Ja,"Descending",11),Ep=new en(Ja,"Optimized",12),W0=new en(Ja,"Pythagorean",13),Mg=new en(Ja,"Circular",14);Ja.className="CircularLayout",Ja.ConstantSpacing=$u,Ja.ConstantDistance=Vc,Ja.ConstantAngle=sc,Ja.Packed=qu,Ja.Clockwise=Cl,Ja.Counterclockwise=Kc,Ja.BidirectionalLeft=Rf,Ja.BidirectionalRight=Pp,Ja.Forwards=z0,Ja.Reverse=Z0,Ja.Ascending=G0,Ja.Descending=H0,Ja.Optimized=Ep,Ja.Pythagorean=W0,Ja.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){Ta.call(this,a)}Tt(Cp,Ta),Cp.prototype.createVertex=function(){return new ym(this)},Cp.prototype.createEdge=function(){return new V0(this)},Cp.className="CircularNetwork";function ym(a){Es.call(this,a),this.u=this.Si=NaN}Tt(ym,Es);function Uc(a,y){var x=a.network;if(x===null)return NaN;if(x=x.layout,x===null)return NaN;if(x.arrangement===qu)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}kt.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){ql.call(this,a)}Tt(V0,ql),V0.className="CircularEdge";function el(a){Ga.call(this),this.ah=null,this.An=0,this.$d=new bn(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)}Tt(el,Ga),el.prototype.cloneProtected=function(a){Ga.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},el.prototype.createNetwork=function(){return new kg(this)},el.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 le=Hi(),he=0;he<re+y.vertexes.count+2;he++)le[he]=null;re=0,ee.reset();for(var ge=zt.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,le[0]=new _e(ge.x+ge.width+E.width,ge.y),le[1]=new _e(ge.x,ge.y+ge.height+E.height),re=2;else{var xe=jx(le,re,b,z,ge.width,ge.height,E),Pe=le[xe],Fe=new _e(Pe.x+ge.width+E.width,Pe.y),Ne=new _e(Pe.x,Pe.y+ge.height+E.height);for(xe+1<re&&le.splice(xe+1,0,null),le[xe]=Fe,le[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(zt.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,le[0]=new _e(xe.x+xe.width+E.width,xe.y),le[1]=new _e(xe.x,xe.y+xe.height+E.height),re=2):(oe=jx(le,re,b,z,xe.width,xe.height,E),ge=le[oe],Pe=new _e(ge.x+xe.width+E.width,ge.y),xe=new _e(ge.x,ge.y+xe.height+E.height),oe+1<re&&le.splice(oe+1,0,null),le[oe]=Pe,le[oe+1]=xe,re++,ee.centerX=ge.x+ee.width/2,ee.centerY=ge.y+ee.height/2);for(Mi(le),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},el.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},el.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=_S(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),IS(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 _S(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 Tn),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 Tn,b.Hj=re),re.add(ee),b.Vd--,b.sh+=ee.sh):ee.network===E&&(re=ee.Hj,re===null&&(re=new Tn,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,He.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 le=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&&(le+=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=He.sqrt((re+Pe+le*le*4/(ee*ee))/Pe),ee=(re-1)*he/2,re=(re-1)*ge/2,b.bounds=new zt(z-xe.x-ee,oe-xe.y-re,he+2*ee,ge+2*re),b.focus=new _e(xe.x+ee,xe.y+re)}}return a.network=E,x}function IS(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 zt(E.centerX-z,E.centerY-ee,b.Ss,b.Qs),E.focus=new _e(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=He.sqrt(z*z+ee*ee)/2;for(var re=!1,oe=ee=0,le=0,he=y.vertexes.iterator;he.next();){var ge=he.value;1>=ge.Vd?oe++:(re=!0,le++,ee+=Math.atan2(y.centerY-ge.centerY,y.centerX-ge.centerX))}if(oe!==0){for(0<le&&(ee/=le),le=y=0,y=re?2*Math.PI/(oe+1):2*Math.PI/oe,oe%2===0&&(le=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=He.sqrt(ge*ge+xe*xe)/2,he=z+he.length+ge,ge=ee+(y*(re/2>>1)+le)*(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,le=0;e:for(;le<y;le++){var he=a[le],ge=he.x-x,xe=he.y-E;if(ge=ge*ge+xe*xe,ge<re){for(xe=le-1;0<=xe;xe--)if(a[xe].y>he.y&&a[xe].x-he.x<b+ee.width)continue e;for(xe=le+1;xe<y;xe++)if(a[xe].x>he.x&&a[xe].y-he.y<z+ee.height)continue e;oe=le,re=ge}}return oe}el.prototype.Cu=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)},el.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,He.sqrt(x*x+a*a)):a+x<y?(E=E+b-ee,a=a+x-y,He.sqrt(E*E+a*a)):ee-(E+b):E>ee+re?a>y+z?(x=E-ee-re,a=a-y-z,He.sqrt(x*x+a*a)):a+x<y?(E=E-ee-re,a=a+x-y,He.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,Xe){return Ne===null||Xe===null||Ne===Xe?0:Ne.centerX-Xe.centerX}):y.sort(function(Ne,Xe){return Ne===null||Xe===null||Ne===Xe?0:Ne.centerY-Xe.centerY}),x=a.Zf;var le=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),le=ee.charge*a.electricalFieldY(oe,he),E+=ee.mass*a.gravitationalFieldX(oe,he),le+=ee.mass*a.gravitationalFieldY(oe,he),ee.forceX+=E,ee.forceY+=le;for(var ge=z+1;ge<y.length;ge++){var xe=y[ge];if(xe!==ee){E=xe.bounds,re=xe.focus,le=E.x+re.x;var Pe=E.y+re.y;if(oe-le>x||le-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>le?(E=Math.abs(xe.bounds.right-ee.bounds.x),E=(1+E)*Fe):oe<le?(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?(le=Math.abs(xe.bounds.bottom-ee.bounds.y),le=(1+le)*re):oe<le?(le=Math.abs(xe.bounds.y-ee.bounds.bottom),le=-(1+le)*re):(le=Math.max(xe.height,ee.height),le=(1+le)*re-le/2)):(re=-(ee.charge*xe.charge)/(Fe*Fe),E=(le-oe)/Fe*re,le=(Pe-he)/Fe*re),ee.forceX+=E,ee.forceY+=le,xe.forceX-=E,xe.forceY-=le}}}}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,le=(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,le=(he-ee)/ge*re),x.forceX+=E,x.forceY+=le,z.forceX-=E,z.forceY-=le;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}el.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},el.prototype.moveFixedVertex=function(){},el.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.isRouting&&this.commitLinks()},el.prototype.yv=function(){if(this.setsPortSpots)for(var a=this.network.edges.iterator;a.next();){var y=a.value.link;y!==null&&(y.fromSpot=er,y.toSpot=er)}},el.prototype.commitNodes=function(){var a=0,y=0;if(this.arrangesToOrigin){var x=zt.alloc();this.computeBounds(this.network,x),y=this.arrangementOrigin,a=y.x-x.x,y=y.y-x.y,zt.free(x)}x=zt.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()}zt.free(x)},el.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()},el.prototype.springStiffness=function(a){return a=a.stiffness,isNaN(a)?this.Hk:a},el.prototype.springLength=function(a){return a=a.length,isNaN(a)?this.Gk:a},el.prototype.electricalCharge=function(a){return a=a.charge,isNaN(a)?this.Ek:a},el.prototype.electricalFieldX=function(){return 0},el.prototype.electricalFieldY=function(){return 0},el.prototype.gravitationalMass=function(a){return a=a.mass,isNaN(a)?this.Fk:a},el.prototype.gravitationalFieldX=function(){return 0},el.prototype.gravitationalFieldY=function(){return 0},el.prototype.isFixed=function(a){return a.isFixed},kt.Object.defineProperties(el.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"&&it('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())}}}),el.className="ForceDirectedLayout";function Gx(){this.Tv=this.Sv=this.Qs=this.Ss=this.Rs=0}Gx.className="ForceDirectedSubnet";function kg(a){Ta.call(this,a)}Tt(kg,Ta),kg.prototype.createVertex=function(){return new xm(this)},kg.prototype.createEdge=function(){return new Sm(this)},kg.className="ForceDirectedNetwork";function xm(a){Es.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}Tt(xm,Es),kt.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){ql.call(this,a),this.j=this.o=NaN}Tt(Sm,ql),kt.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 ya(a){Ga.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 _e,this.He=[],this.He.length=100,this.xw=this.ve=0,a&&Object.assign(this,a)}Tt(ya,Ga),ya.prototype.cloneProtected=function(a){Ga.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},ya.prototype.qb=function(a){a.classType===ya?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:it("Unknown enum value: "+a):Ga.prototype.qb.call(this,a)},ya.prototype.createNetwork=function(){return new Fp(this)},ya.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,le=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){le=ge;var Pe=xe;ge=oe,xe=re,oe=le,re=Pe}var Fe=b.focus;le=z.focus;var Ne=E.rev?z.bounds:b.bounds;Pe=_e.alloc(),he!==ge?Ne.w()&&ge.isVisible()?ge.actualBounds.w()?(nc(ge,xe,yo,Pe),Pe.x+=ge.actualBounds.x-Ne.x,Pe.y+=ge.actualBounds.y-Ne.y):(nc(ge,xe,yo,Pe),Pe.w()||Pe.assign(Fe)):Pe.assign(Fe):Ne.w()?(nc(ge,xe,yo,Pe),Pe.w()||Pe.assign(Fe)):Pe.assign(Fe),ge=E.rev?b.bounds:z.bounds,he=_e.alloc(),ee!==oe?ge.w()&&oe.isVisible()?oe.actualBounds.w()?(nc(oe,re,yo,he),he.x+=oe.actualBounds.x-ge.x,he.y+=oe.actualBounds.y-ge.y):(nc(oe,re,yo,he),he.w()||he.assign(le)):he.assign(le):ge.w()?(nc(oe,re,yo,he),he.w()||he.assign(le)):he.assign(le),this.K===90||this.K===270?(ee=Math.round((Pe.x-Fe.x)/this.kc),oe=Pe.x,re=Math.round((he.x-le.x)/this.kc),le=he.x):(ee=Math.round((Pe.y-Fe.y)/this.kc),oe=Pe.y,re=Math.round((he.y-le.y)/this.kc),le=he.y),_e.free(Pe),_e.free(he),E.portFromColOffset=ee,E.portFromPos=oe,E.portToColOffset=re,E.portToPos=le}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 Xe=Ne.fromPort,Ve=Ne.toPort;if(Xe!==null&&Ve!==null){var st=Ne.fromNode;if(xe=Ne.toNode,st!==null&&xe!==null){var ht=J0(this,!0),pt=J0(this,!1),Et=this.setsPortSpots?ht:Ne.computeSpot(!0,Xe);Fe=this.setsPortSpots?pt:Ne.computeSpot(!1,Ve);var Gt=Ne.isOrthogonal;Et.$c()&&Et.Hf(pt)&&Fe.$c()&&Fe.Hf(ht)?ge=0:(ht=Ne.getLinkPoint(st,Xe,Et,!0,Gt,xe,Ve,_e.alloc()),pt=Ne.getLinkDirection(st,Xe,ht,Et,!0,Gt,xe,Ve),_e.free(ht),Et.ys()||pt!==Qx(this,E,!0)?this.setsPortSpots&&st!==null&&st.ports.count===1&&E.rev&&(ge+=1):ge+=1,Et=Ne.getLinkPoint(xe,Ve,Fe,!1,Gt,st,Xe,_e.alloc()),Ne=Ne.getLinkDirection(xe,Ve,Et,Fe,!1,Gt,st,Xe),_e.free(Et),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=le}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=Yc(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),Xc(this,a,y)}this.reduceCrossings(),this.straightenAndPack(),this.updateParts()}this.network=null,this.isValidLayout=!0},ya.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}ya.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},ya.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 Il(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 Lu(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 Hx(a,y,x){var E=Yc(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],le=oe.near;if(le!==null&&le.layer===oe.layer)if(oe=le.index,oe>ee)for(var he=ee+1;he<oe;he++){var ge=E[he];ge.near===le&&ge.Dj===le.Dj||re++}else for(he=ee-1;he>oe;he--)ge=E[he],ge.near===le&&ge.Dj===le.Dj||re++;var xe;if(0<=x)for(oe=E[ee].sourceEdgesArrayAccess,le=0;le<oe.length;le++){var Pe=oe[le];if(Pe.valid&&Pe.fromVertex.layer!==y)for(ge=Pe.fromVertex.index,he=Pe.portToPos,Pe=Pe.portFromPos,xe=le+1;xe<oe.length;xe++){var Fe=oe[xe];if(Fe.valid&&Fe.fromVertex.layer!==y){var Ne=Fe.fromVertex.index,Xe=Fe.portToPos;Fe=Fe.portFromPos,he<Xe&&(ge>Ne||ge===Ne&&Pe>Fe)&&re++,Xe<he&&(Ne>ge||Ne===ge&&Fe>Pe)&&re++}}}if(0>=x){for(oe=E[ee].destinationEdgesArrayAccess,le=0;le<oe.length;le++)if(Pe=oe[le],Pe.valid&&Pe.toVertex.layer!==y)for(ge=Pe.toVertex.index,he=Pe.portToPos,Pe=Pe.portFromPos,xe=le+1;xe<oe.length;xe++)Fe=oe[xe],Fe.valid&&Fe.toVertex.layer!==y&&(Ne=Fe.toVertex.index,Xe=Fe.portToPos,Fe=Fe.portFromPos,Pe<Fe&&(ge>Ne||ge===Ne&&he>Xe)&&re++,Fe<Pe&&(Ne>ge||Ne===ge&&Xe>he)&&re++)}for(z[ee*b+ee]=re,oe=ee+1;oe<b;oe++){var Ve=0,st=0;if(0<=x){re=E[ee].sourceEdgesArrayAccess;var ht=E[oe].sourceEdgesArrayAccess;for(le=0;le<re.length;le++)if(Pe=re[le],Pe.valid&&Pe.fromVertex.layer!==y)for(ge=Pe.fromVertex.index,Pe=Pe.portFromPos,xe=0;xe<ht.length;xe++)Fe=ht[xe],Fe.valid&&Fe.fromVertex.layer!==y&&(Ne=Fe.fromVertex.index,Fe=Fe.portFromPos,(ge<Ne||ge===Ne&&Pe<Fe)&&st++,(Ne<ge||Ne===ge&&Fe<Pe)&&Ve++)}if(0>=x){for(re=E[ee].destinationEdgesArrayAccess,ht=E[oe].destinationEdgesArrayAccess,le=0;le<re.length;le++)if(Pe=re[le],Pe.valid&&Pe.toVertex.layer!==y)for(ge=Pe.toVertex.index,he=Pe.portToPos,xe=0;xe<ht.length;xe++)Fe=ht[xe],Fe.valid&&Fe.toVertex.layer!==y&&(Ne=Fe.toVertex.index,Xe=Fe.portToPos,(ge<Ne||ge===Ne&&he<Xe)&&st++,(Ne<ge||Ne===ge&&Xe<he)&&Ve++)}z[ee*b+oe]=Ve,z[oe*b+ee]=st}}return Xc(a,y,E),z}ya.prototype.countCrossings=function(){for(var a=0,y=0;y<=this.Ia;y++)for(var x=Hx(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=Yc(E,b),ee=E.tc[b],re=0,oe=0;oe<ee;oe++){var le=z[oe].destinationEdgesArrayAccess;if(le!==null)for(var he=0;he<le.length;he++){var ge=le[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)}}}Xc(E,b,z),y+=re}return y}ya.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=Yc(a,y),b=a.tc[y],z=[],ee=0;ee<b;ee++){var re=E[ee],oe=null;0>=x&&(oe=re.sourceEdgesArrayAccess);var le=null;0<=x&&(le=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(le!==null)for(oe=0;oe<le.length;oe++)re=le[oe],xe=re.toVertex,re.valid&&!re.rev&&xe.layer!==y&&(he+=xe.column,ge++);z[ee]=ge===0?-1:he/ge}return Xc(a,y,E),z}function Wx(a,y,x){for(var E=Yc(a,y),b=a.tc[y],z=[],ee=0;ee<b;ee++){var re=E[ee],oe=null;0>=x&&(oe=re.sourceEdgesArrayAccess);var le=null;0<=x&&(le=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(le!==null)for(oe=0;oe<le.length;oe++)re=le[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}),le=he>>1,z[ee]=he&1?ge[le]:ge[le-1]+ge[le]>>1)}return Xc(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,le=y.layer-oe.layer;re=a.linkMinLength(re),le===re&&wm(a,oe,x,E,b,z)}if(z)for(ee=y.sourceEdges;ee.next();)re=ee.value,oe=re.fromVertex,le=oe.layer-y.layer,re=a.linkMinLength(re),le===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)}}ya.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,le=re.destinationEdges;le.next();)le.value.toVertex.valid&&oe++;le=0;for(var he=re.sourceEdges;he.next();)he.value.fromVertex.valid&&le++;(b===null||z<oe-le)&&(b=re,z=oe-le)}}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++}ya.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 le=ee.value;if(le.component===1){var he=0,ge=!1,xe=le.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-le.layer,Fe=a.linkMinLength(Fe),E=Math.min(E,Ne-Fe))}for(xe=le.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=le,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(le=0,he=!1,xe=ee.sourceEdgesArrayAccess,ge=xe.length,Pe=0;Pe<ge;Pe++)Fe=xe[Pe].fromVertex,le+=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,--le,Ne.component!==1&&(--E,Ne=ee.layer-Ne.layer,Fe=a.linkMinLength(Fe),b=Math.min(b,Ne-Fe));(re===null||le>z)&&!he&&(re=ee,z=le)}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}ya.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))}ya.prototype.reduceCrossings=function(){var a=this.countCrossings(),y=Il(this),x,E;for(x=0;x<this.bj;x++){for(E=0;E<=this.Ia;E++)Y0(this,E,1),ju(this,E,1);var b=this.countCrossings();for(b<a&&(a=b,y=Il(this)),E=this.Ia;0<=E;E--)Y0(this,E,-1),ju(this,E,-1);b=this.countCrossings(),b<a&&(a=b,y=Il(this))}for(Lu(this,y),x=0;x<this.bj;x++){for(E=0;E<=this.Ia;E++)Y0(this,E,0),ju(this,E,0);for(b=this.countCrossings(),b<a&&(a=b,y=Il(this)),E=this.Ia;0<=E;E--)Y0(this,E,0),ju(this,E,0);b=this.countCrossings(),b<a&&(a=b,y=Il(this))}Lu(this,y);var z,ee,re;switch(this.rk){case Ty:break;case _y: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=ju(this,E,-1)||z;for(b=this.countCrossings(),b>=a?Lu(this,y):(a=b,y=Il(this)),z=!0;z;)for(z=!1,E=x;E>=ee;E--)z=ju(this,E,1)||z;for(b=this.countCrossings(),b>=a?Lu(this,y):(a=b,y=Il(this)),z=!0;z;)for(z=!1,E=ee;E<=x;E++)z=ju(this,E,1)||z;for(b>=a?Lu(this,y):(a=b,y=Il(this)),z=!0;z;)for(z=!1,E=ee;E<=x;E++)z=ju(this,E,-1)||z;for(b>=a?Lu(this,y):(a=b,y=Il(this)),z=!0;z;)for(z=!1,E=x;E>=ee;E--)z=ju(this,E,0)||z;for(b>=a?Lu(this,y):(a=b,y=Il(this)),z=!0;z;)for(z=!1,E=ee;E<=x;E++)z=ju(this,E,0)||z;b>=a?Lu(this,y):(a=b,y=Il(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=ju(this,E,-1)||z;for(b=this.countCrossings(),b>=a?Lu(this,y):(a=b,y=Il(this)),z=!0;z;)for(z=!1,E=x;E>=ee;E--)z=ju(this,E,1)||z;for(b=this.countCrossings(),b>=a?Lu(this,y):(a=b,y=Il(this)),z=!0;z;)for(z=!1,E=ee;E<=x;E++)z=ju(this,E,1)||z;for(b>=a?Lu(this,y):(a=b,y=Il(this)),z=!0;z;)for(z=!1,E=ee;E<=x;E++)z=ju(this,E,-1)||z;for(b>=a?Lu(this,y):(a=b,y=Il(this)),z=!0;z;)for(z=!1,E=x;E>=ee;E--)z=ju(this,E,0)||z;for(b>=a?Lu(this,y):(a=b,y=Il(this)),z=!0;z;)for(z=!1,E=ee;E<=x;E++)z=ju(this,E,0)||z;b>=a?Lu(this,y):(a=b,y=Il(this))}}Lu(this,y)};function Y0(a,y,x){var E=Yc(a,y),b=a.tc[y],z=Wx(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);Xc(a,y,E)}function ju(a,y,x){var E=Yc(a,y),b=a.tc[y];x=Hx(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,le=!0;le;)for(le=!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,Xe=a.nodeMinColumnSpace(E[z],!0),Ve=a.nodeMinColumnSpace(E[z],!1),st=a.nodeMinColumnSpace(E[z+1],!0),ht=a.nodeMinColumnSpace(E[z+1],!1);Xe=Fe-Xe+st,Ve=Ne-Ve+ht;var pt=E[z].sourceEdges.iterator;for(pt.reset();pt.next();)if(st=pt.value,ht=st.fromVertex,st.valid&&ht.layer===y){for(st=0;E[st]!==ht;)st++;st<z&&(xe+=2*(z-st),Pe+=2*(z+1-st)),st===z+1&&(xe+=1),st>z+1&&(xe+=4*(st-z),Pe+=4*(st-(z+1)))}for(pt=E[z].destinationEdges.iterator,pt.reset();pt.next();)if(st=pt.value,ht=st.toVertex,st.valid&&ht.layer===y){for(st=0;E[st]!==ht;)st++;st===z+1&&(Pe+=1)}for(pt=E[z+1].sourceEdges.iterator,pt.reset();pt.next();)if(st=pt.value,ht=st.fromVertex,st.valid&&ht.layer===y){for(st=0;E[st]!==ht;)st++;st<z&&(xe+=2*(z+1-st),Pe+=2*(z-st)),st===z&&(Pe+=1),st>z+1&&(xe+=4*(st-(z+1)),Pe+=4*(st-z))}for(pt=E[z+1].destinationEdges.iterator,pt.reset();pt.next();)if(st=pt.value,ht=st.toVertex,st.valid&&ht.layer===y){for(st=0;E[st]!==ht;)st++;st===z&&(xe+=1)}st=ht=0,pt=ee[E[z].index];var Et=re[E[z].index],Gt=ee[E[z+1].index],xi=re[E[z+1].index];pt!==-1&&(ht+=Math.abs(pt-Fe),st+=Math.abs(pt-Ve)),Et!==-1&&(ht+=Math.abs(Et-Fe),st+=Math.abs(Et-Ve)),Gt!==-1&&(ht+=Math.abs(Gt-Ne),st+=Math.abs(Gt-Xe)),xi!==-1&&(ht+=Math.abs(xi-Ne),st+=Math.abs(xi-Xe)),(Pe<xe-.5||Pe===xe&&ge<he-.5||Pe===xe&&ge===he&&st<ht-.5)&&(le=oe=!0,E[z].column=Ve,E[z+1].column=Xe,he=E[z],E[z]=E[z+1],E[z+1]=he)}for(z=0;z<b;z++)E[z].index=z;return Xc(a,y,E),oe}ya.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 HS(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=Yc(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,le=!0;le;)for(le=!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 Xe=b[E].sourceEdges.iterator;Xe.next();){var Ve=Xe.value,st=Ve.fromVertex;if(Ve.valid&&st.layer!==y){var ht=Cy(Ve),pt=Ve.portFromColOffset;Ve=Ve.portToColOffset,st=st.column,xe+=(Math.abs(he+Ve-(st+pt))+1)*ht,Fe+=(Math.abs(Pe+Ve-(st+pt))+1)*ht,Ne+=(Math.abs(ge+Ve-(st+pt))+1)*ht}}if(0<=x)for(Xe=b[E].destinationEdges.iterator;Xe.next();)Ve=Xe.value,st=Ve.toVertex,Ve.valid&&st.layer!==y&&(ht=Cy(Ve),pt=Ve.portFromColOffset,Ve=Ve.portToColOffset,st=st.column,xe+=(Math.abs(he+pt-(st+Ve))+1)*ht,Fe+=(Math.abs(Pe+pt-(st+Ve))+1)*ht,Ne+=(Math.abs(ge+pt-(st+Ve))+1)*ht);Ve=pt=ht=0,Xe=ee[b[E].index],st=re[b[E].index],Xe!==-1&&(ht+=Math.abs(Xe-he),pt+=Math.abs(Xe-Pe),Ve+=Math.abs(Xe-ge)),st!==-1&&(ht+=Math.abs(st-he),pt+=Math.abs(st-Pe),Ve+=Math.abs(st-ge)),Fe<xe||Fe===xe&&pt<ht?(le=oe=!0,b[E].column=Pe):(Ne<xe||Ne===xe&&Ve<ht)&&(le=oe=!0,b[E].column=ge)}return Xc(a,y,b),a.normalize(),oe}function By(a,y,x){var E=Yc(a,y),b=a.tc[y],z=Wx(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),le=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===le+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,le=ge-a.nodeMinColumnSpace(E[x+1],!0)-le-1,he=(oe+le)/2|0);else x===0&&x===b-1?he=ee[x]:x===0?(ge=E[x+1].column,le=ge-a.nodeMinColumnSpace(E[x+1],!0)-le-1,he=Math.min(ee[x],le)):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,le=ge-a.nodeMinColumnSpace(E[x+1],!0)-le-1,oe<ee[x]&&ee[x]<le?he=ee[x]:oe>=ee[x]?he=oe:le<=ee[x]&&(he=le));he!==re&&(z=!0,E[x].column=he)}Xc(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=Il(a),z=U0(a);for(E=z+1;z<E;){E=z,tS(a,x,1);var ee=U0(a);ee>z?Lu(a,b):ee<z&&(z=ee,b=Il(a))}}if(0>y)for(x=a.Ra;0<=x;x--)for(b=Il(a),z=U0(a),E=z+1;z<E;)E=z,tS(a,x,-1),ee=U0(a),ee>z?Lu(a,b):ee<z&&(z=ee,b=Il(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 HS(a){for(var y=Hi(),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 Zn,WS(y,x);var z=null,ee=null,re=null,oe=null,le=(a.ve&1)!==0,he=(a.ve&2)!==0,ge=(a.ve&4)!==0,xe=(a.ve&8)!==0;for(le&&(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=ci(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)),Mi(y),a.u(z,ee,re,oe),a.network.vertexes.each(function(Pe){var Fe=Hi();le&&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(Xe,Ve){return Xe-Ve});var Ne=Fe.length;Ne=(Fe[Math.floor((Ne-1)/2)]+Fe[Math.ceil((Ne-1)/2)])/2,Mi(Fe),Pe.zc=Ne})}function WS(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 le=re[oe];e:{if(le.node===null){var he=Iy(le);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=Iy(le)[0].index);z<=oe;){if(le=re[z],!le.bo){ge=[];for(var xe=ci(le.sourceEdgesArrayAccess),Pe=xe.next();!Pe.done;Pe=xe.next())Pe=Pe.value,Pe.valid&&ge.push(Pe);le.bo=ge}for(le=ci(le.bo),ge=le.next();!ge.done;ge=le.next())ge=ge.value,xe=ge.fromVertex.index,(xe<b||xe>he)&&y.add(ge);z++}b=he}}}ya.prototype.verticalAlignment=function(a,y,x){VS(a),a=ci(a);for(var E=a.next();!E.done;E=a.next()){var b=-1;E=ci(E.value);for(var z=E.next();!z.done;z=E.next()){z=z.value;var ee=x?Iy(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 le=ee[re],he=void 0;he=x?tv(le,z):tv(z,le),!y.contains(he)&&b<le.vi&&(le.align=z,z.root=le.root,z.align=le.root,b=le.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=ci(y),ee=z.next();!ee.done;ee=z.next()){var re=ci(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=ci(y),re=z.next();!re.done;re=z.next()){re=ci(re.value);for(var oe=re.next();!oe.done;oe=re.next())if(oe=oe.value,oe.root===oe){for(var le=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,Xe=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&&(Xe=ee?ge.focusX:ge.focusY))}else Fe=tv(ge,he),Ne=Fe.portToPos,Xe=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&&(Xe=ee?ge.focusX:ge.focusY));xe=E?he.qg+(xe-Ne)-(Pe-Xe):he.qg+Ne-Xe,ge.qg=xe,le=Math.min(le,xe),he=he.align}he=oe;do he.qg=he.qg-le,he=he.align;while(he!==oe)}}for(x=ci(y),ee=x.next();!ee.done;ee=x.next())for(z=ci(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 Ut,y=ci(y),ee=y.next();!ee.done;ee=y.next())for(x=ci(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&&it("Could not determine previous vertex in layer"),y[x][a-1]}ya.prototype.u=function(a){for(var y=[],x=0;x<arguments.length;++x)y[x]=arguments[x];x=-1;for(var E=Hi(),b=Hi(),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(le){le.value+=oe.delta}}(z)));Mi(E),Mi(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}ya.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?Oo:jr:a.K===90?y?jr:Oo:a.K===180?y?ua:Lo:y?Lo:ua}ya.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,le=oe.layer,he=oe.column|0;E?(ee=y.x+this.kc*he,le=this.Kd[le]):(ee=this.Kd[le],le=y.y+this.kc*he),oe.centerX=ee,oe.centerY=le,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 _e(x&&E?0:z,x&&!E?0:y),a.reset();a.next();)x=a.value,x.x+=z,x.y+=y,x.commit()},ya.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 zt(0,0,x,Math.abs(this.Ta[0]))):y.push(new zt(0,this.Ta[E-1],x,Math.abs(this.Ta[E-1]-this.Ta[E]))):this.K===90?E===0?y.push(new zt(0,this.Ta[0],x,Math.abs(this.Ta[0]-a))):y.push(new zt(0,this.Ta[E],x,Math.abs(this.Ta[E-1]-this.Ta[E]))):this.K===180?E===0?y.push(new zt(0,0,Math.abs(this.Ta[0]),x)):y.push(new zt(this.Ta[E-1],0,Math.abs(this.Ta[E-1]-this.Ta[E]),x)):E===0?y.push(new zt(this.Ta[0],0,Math.abs(this.Ta[0]-a),x)):y.push(new zt(this.Ta[E],0,Math.abs(this.Ta[E-1]-this.Ta[E]),x));this.commitLayers(y,this.Rf)},ya.prototype.commitLayers=function(){},ya.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 le=y.computeSpot(!0,ee);oe=y.computeSpot(!1,re);var he=x.fromVertex,ge=x.toVertex;if(x.valid)y.curve===fu&&y.pointsCount===4&&(he.column===ge.column&&this.alignOption===0?(x=y.getLinkPoint(b,ee,le,!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&&le===to&&(E=!0),re!==null&&oe===to&&(x=!0),(E||x)&&(oe=null,E&&(oe=y.getLinkPointFromPoint(b,ee,ee.ga(yo),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(yo),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 Xe=y.pointsCount;4<Xe&&y.points.removeRange(2,Xe-3)}else if(y.curve===fu)xe=!0,Xe=y.pointsCount,4<Xe&&y.points.removeRange(2,Xe-3),Xe===4&&(Ne=2);else{Xe=y.pointsCount;var Ve=le===to,st=oe===to;2<Xe&&Ve&&st?y.points.removeRange(1,Xe-2):3<Xe&&Ve&&!st?y.points.removeRange(1,Xe-3):3<Xe&&!Ve&&st?y.points.removeRange(2,Xe-2):4<Xe&&!Ve&&!st&&y.points.removeRange(2,Xe-3)}if(x.rev){for(;ge!==null&&he!==ge;){var ht=Xe=null;for(Ve=ge.sourceEdges.iterator;Ve.next()&&(st=Ve.value,st.link!==x.link||(Xe=st.fromVertex,ht=st.toVertex,Xe.node!==null)););if(Xe===null)break;if(Xe!==he){Ve=y.i(Ne-1).x,st=y.i(Ne-1).y;var pt=Xe.centerX,Et=Xe.centerY;if(Pe)this.K===180||this.K===0?Ne===y.firstPickIndex+1?(y.m(Ne++,Ve,st),y.m(Ne++,Ve,Et)):(ht!==null?ht.centerY:st)!==Et&&(ht=this.Ta[Xe.layer-1]+this.Rf.x,y.m(Ne++,ht,st),y.m(Ne++,ht,Et)):Ne===y.firstPickIndex+1?(y.m(Ne++,Ve,st),y.m(Ne++,pt,st)):(ht!==null?ht.centerX:Ve)!==pt&&(ht=this.Ta[Xe.layer-1]+this.Rf.y,y.m(Ne++,Ve,ht),y.m(Ne++,pt,ht));else if(Ne===y.firstPickIndex+1){ht=Math.max(10,this.he[ge.layer]);var Gt=Math.max(10,this.Ld[ge.layer]);if(xe)this.K===180?pt<=ge.bounds.x?(ge=ge.bounds.x,y.m(Ne++,ge-ht,Et),y.m(Ne++,ge,Et),y.m(Ne++,ge+Gt,Et)):(y.m(Ne++,pt-ht,Et),y.m(Ne++,pt,Et),y.m(Ne++,pt+Gt,Et)):this.K===90?Et>=ge.bounds.bottom?(ge=ge.bounds.y+ge.bounds.height,y.m(Ne++,pt,ge+Gt),y.m(Ne++,pt,ge),y.m(Ne++,pt,ge-ht)):(y.m(Ne++,pt,Et+Gt),y.m(Ne++,pt,Et),y.m(Ne++,pt,Et-ht)):this.K===270?Et<=ge.bounds.y?(ge=ge.bounds.y,y.m(Ne++,pt,ge-ht),y.m(Ne++,pt,ge),y.m(Ne++,pt,ge+Gt)):(y.m(Ne++,pt,Et-ht),y.m(Ne++,pt,Et),y.m(Ne++,pt,Et+Gt)):this.K===0&&(pt>=ge.bounds.right?(ge=ge.bounds.x+ge.bounds.width,y.m(Ne++,ge+Gt,Et),y.m(Ne++,ge,Et),y.m(Ne++,ge-ht,Et)):(y.m(Ne++,pt+Gt,Et),y.m(Ne++,pt,Et),y.m(Ne++,pt-ht,Et)));else{y.m(Ne++,Ve,st);var xi=0;this.K===180||this.K===0?((this.K===180?pt>=ge.bounds.right:pt<=ge.bounds.x)&&(xi=(this.K===0?-ht:Gt)/2),y.m(Ne++,Ve+xi,Et)):((this.K===270?Et>=ge.bounds.bottom:Et<=ge.bounds.y)&&(xi=(this.K===90?-ht:Gt)/2),y.m(Ne++,pt,st+xi)),y.m(Ne++,pt,Et)}}else ht=Math.max(10,this.he[Xe.layer]),Gt=Math.max(10,this.Ld[Xe.layer]),xe?this.K===180?(y.m(Ne++,pt-ht-Fe,Et),y.m(Ne++,Math.min(pt-ht+Fe/2,pt),Et),y.m(Ne++,pt,Et),y.m(Ne++,pt,Et),y.m(Ne++,Math.max(pt+Gt-Fe/2,pt),Et),y.m(Ne++,pt+Gt+Fe,Et)):this.K===90?(y.m(Ne++,pt,Et+Gt+Fe),y.m(Ne++,pt,Math.max(Et+Gt-Fe/2,Et)),y.m(Ne++,pt,Et),y.m(Ne++,pt,Et),y.m(Ne++,pt,Math.min(Et-ht+Fe/2,Et)),y.m(Ne++,pt,Et-ht-Fe)):this.K===270?(y.m(Ne++,pt,Et-ht-Fe),y.m(Ne++,pt,Math.min(Et-ht+Fe/2,Et)),y.m(Ne++,pt,Et),y.m(Ne++,pt,Et),y.m(Ne++,pt,Math.max(Et+Gt-Fe/2,Et)),y.m(Ne++,pt,Et+Gt+Fe)):(y.m(Ne++,pt+Gt+Fe,Et),y.m(Ne++,Math.max(pt+Gt-Fe/2,pt),Et),y.m(Ne++,pt,Et),y.m(Ne++,pt,Et),y.m(Ne++,Math.min(pt-ht+Fe/2,pt),Et),y.m(Ne++,pt-ht-Fe,Et)):y.m(Ne++,pt,Et)}ge=Xe}(re===null||le!==to||Pe)&&(Ve=y.i(Ne-1).x,st=y.i(Ne-1).y,pt=y.i(Ne).x,Et=y.i(Ne).y,Pe?(Fe=this.Ld[he.layer],this.K===180||this.K===0?(Pe=st,Pe>=he.bounds.y&&Pe<=he.bounds.bottom&&(this.K===180?pt>=he.bounds.x:pt<=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,st),y.m(Ne++,ge,Pe)),y.m(Ne++,pt,Pe)):(Pe=Ve,Pe>=he.bounds.x&&Pe<=he.bounds.right&&(this.K===270?Et>=he.bounds.y:Et<=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,Et)),y.m(Ne++,pt,Et)):xe?(ht=Math.max(10,this.he[he.layer]),Gt=Math.max(10,this.Ld[he.layer]),this.K===180&&pt>=he.bounds.x?(ge=he.bounds.x+he.bounds.width,y.L(Ne-2,ge,st),y.L(Ne-1,ge+Gt,st)):this.K===90&&Et<=he.bounds.bottom?(ge=he.bounds.y,y.L(Ne-2,Ve,ge),y.L(Ne-1,Ve,ge-ht)):this.K===270&&Et>=he.bounds.y?(ge=he.bounds.y+he.bounds.height,y.L(Ne-2,Ve,ge),y.L(Ne-1,Ve,ge+Gt)):this.K===0&&pt<=he.bounds.right&&(ge=he.bounds.x,y.L(Ne-2,ge,st),y.L(Ne-1,ge-ht,st))):(ht=Math.max(10,this.he[he.layer]),Gt=Math.max(10,this.Ld[he.layer]),Pe=0,this.K===180||this.K===0?((this.K===180?pt<=he.bounds.x:pt>=he.bounds.right)&&(Pe=(this.K===0?Gt:-ht)/2),y.m(Ne++,pt+Pe,st)):((this.K===270?Et<=he.bounds.y:Et>=he.bounds.bottom)&&(Pe=(this.K===90?Gt:-ht)/2),y.m(Ne++,Ve,Et+Pe)),y.m(Ne++,pt,Et)))}else{for(;he!==null&&he!==ge;){for(ht=Xe=null,he=he.destinationEdges.iterator;he.next()&&(Ve=he.value,Ve.link!==x.link||(Xe=Ve.toVertex,ht=Ve.fromVertex,ht.node!==null&&(ht=null),Xe.node!==null)););if(Xe===null)break;Xe!==ge&&(Ve=y.i(Ne-1).x,st=y.i(Ne-1).y,pt=Xe.centerX,Et=Xe.centerY,Pe?this.K===180||this.K===0?(ht!==null?ht.centerY:st)!==Et&&(ht=this.Ta[Xe.layer]+this.Rf.x,Ne===y.firstPickIndex+1&&(ht=this.K===0?Math.max(ht,Ve):Math.min(ht,Ve)),y.m(Ne++,ht,st),y.m(Ne++,ht,Et)):(ht!==null?ht.centerX:Ve)!==pt&&(ht=this.Ta[Xe.layer]+this.Rf.y,Ne===y.firstPickIndex+1&&(ht=this.K===90?Math.max(ht,st):Math.min(ht,st)),y.m(Ne++,Ve,ht),y.m(Ne++,pt,ht)):(ht=Math.max(10,this.he[Xe.layer]),Gt=Math.max(10,this.Ld[Xe.layer]),xe?this.K===180?(y.m(Ne++,pt+Gt+Fe,Et),y.m(Ne++,Math.max(pt+Gt-Fe/2,pt),Et),y.m(Ne++,pt,Et),y.m(Ne++,pt,Et),y.m(Ne++,Math.min(pt-ht+Fe/2,pt),Et),y.m(Ne++,pt-ht-Fe,Et)):this.K===90?(y.m(Ne++,pt,Et-ht-Fe),y.m(Ne++,pt,Math.min(Et-ht+Fe/2,Et)),y.m(Ne++,pt,Et),y.m(Ne++,pt,Et),y.m(Ne++,pt,Math.max(Et+Gt-Fe/2,Et)),y.m(Ne++,pt,Et+Gt+Fe)):this.K===270?(y.m(Ne++,pt,Et+Gt+Fe),y.m(Ne++,pt,Math.max(Et+Gt-Fe/2,Et)),y.m(Ne++,pt,Et),y.m(Ne++,pt,Et),y.m(Ne++,pt,Math.min(Et-ht+Fe/2,Et)),y.m(Ne++,pt,Et-ht-Fe)):(y.m(Ne++,pt-ht-Fe,Et),y.m(Ne++,Math.min(pt-ht+Fe/2,pt),Et),y.m(Ne++,pt,Et),y.m(Ne++,pt,Et),y.m(Ne++,Math.max(pt+Gt-Fe/2,pt),Et),y.m(Ne++,pt+Gt+Fe,Et)):this.K===180?(y.m(Ne++,pt+Gt,Et),y.m(Ne++,pt-ht,Et)):this.K===90?(y.m(Ne++,pt,Et-ht),y.m(Ne++,pt,Et+Gt)):this.K===270?(y.m(Ne++,pt,Et+Gt),y.m(Ne++,pt,Et-ht)):(y.m(Ne++,pt-ht,Et),y.m(Ne++,pt+Gt,Et)))),he=Xe}Pe&&(Ve=y.i(Ne-1).x,st=y.i(Ne-1).y,pt=y.i(Ne).x,Et=y.i(Ne).y,this.K===180||this.K===0?st!==Et&&(ht=this.K===0?Math.min(Math.max((pt+Ve)/2,this.Ta[ge.layer]+this.Rf.x),pt):Math.max(Math.min((pt+Ve)/2,this.Ta[ge.layer]+this.Rf.x),pt),y.m(Ne++,ht,st),y.m(Ne++,ht,Et)):Ve!==pt&&(ht=this.K===90?Math.min(Math.max((Et+st)/2,this.Ta[ge.layer]+this.Rf.y),Et):Math.max(Math.min((Et+st)/2,this.Ta[ge.layer]+this.Rf.y),Et),y.m(Ne++,Ve,ht),y.m(Ne++,pt,ht)))}E!==null&&xe&&4<=y.pointsCount&&(ee!==null&&(ee=le===to?y.getLinkPointFromPoint(b,ee,ee.ga(yo),y.i(3),!0):y.i(0),le===to&&(le=y.i(2),E=y.i(3),this.direction===90||this.direction===270?(y.L(1,(ee.x+le.x)/2,le.y),y.L(2,E.x,(le.y+E.y)/2)):(y.L(1,le.x,(ee.y+le.y)/2),y.L(2,(le.x+E.x)/2,E.y))),ee.w()||ee.set(b.actualBounds.center),y.L(0,ee.x,ee.y)),re!==null&&(b=oe===to?y.getLinkPointFromPoint(z,re,re.ga(yo),y.i(y.pointsCount-4),!1):y.i(y.pointsCount-1),oe===to&&(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()},ya.prototype.avoidOrthogonalOverlaps=function(){if(!(0>=this.linkSpacing)){for(var a=new Tn,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 Jc;re.layer=Math.floor(z.y/2);var oe=E.i(0),le=E.i(E.pointsCount-1);if(re.first=oe.x*oe.x+oe.y,re.jc=le.x*le.x+le.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),le=E.i(b+2);var he=0;oe.y<z.y?he=le.y<z.y?3:z.x<ee.x?2:1:oe.y>z.y&&(he=le.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++)le=x[oe],le.jc!==re&&(he++,re=le.jc);this.zi(x,this.Ux,z,z+ee);var ge=1;for(re=x[z].first,oe=z;oe<b;oe++)le=x[oe],le.first!==re&&(ge++,re=le.first);for(oe=!0,le=ge,he<ge?(oe=!1,le=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-(le-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 Jc,re.layer=Math.floor(z.x/2),oe=E.i(0),le=E.i(E.pointsCount-1),re.first=oe.x+oe.y*oe.y,re.jc=le.x+le.y*le.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),le=E.i(b+2),he=0,oe.x<z.x?he=le.x<z.x?3:z.y<ee.y?2:1:oe.x>z.x&&(he=le.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++)le=x[oe],le.jc!==re&&(he++,re=le.jc);for(this.zi(x,this.Ux,z,z+ee),ge=1,re=x[z].first,oe=z;oe<b;oe++)le=x[oe],le.first!==re&&(ge++,re=le.first);for(oe=!0,le=ge,he<ge?(oe=!1,le=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-(le-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}}}},Ce=ya.prototype,Ce.Vx=function(a,y){return a instanceof Jc&&y instanceof Jc&&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},Ce.Ux=function(a,y){return a instanceof Jc&&y instanceof Jc&&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},Ce.Js=function(a,y){return a instanceof Jc&&y instanceof Jc&&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},Ce.B=function(a,y){return a-=y,-1<a&&1>a},Ce.zi=function(a,y,x,E){var b=a.length,z=E-x;if(!(1>=z))if((0>x||x>=b-1)&&it("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 Yc(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 Xc(a,y,x){a.He[a.tc[y]]=x}kt.Object.defineProperties(ya.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()):it("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!==_y||(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 en(ya,"CycleDepthFirst",0),My=new en(ya,"CycleGreedy",1),Pm=new en(ya,"CycleFromLayers",2),$0=new en(ya,"LayerOptimalLinkLength",0),ky=new en(ya,"LayerLongestPathSink",1),Ay=new en(ya,"LayerLongestPathSource",2),q0=new en(ya,"InitDepthFirstOut",0),Ny=new en(ya,"InitDepthFirstIn",1),Dy=new en(ya,"InitNaive",2),Ty=new en(ya,"AggressiveNone",0),ev=new en(ya,"AggressiveLess",1),_y=new en(ya,"AggressiveMore",2),US=8;ya.className="LayeredDigraphLayout",ya.CycleDepthFirst=Q0,ya.CycleGreedy=My,ya.CycleFromLayers=Pm,ya.LayerOptimalLinkLength=$0,ya.LayerLongestPathSink=ky,ya.LayerLongestPathSource=Ay,ya.InitDepthFirstOut=q0,ya.InitDepthFirstIn=Ny,ya.InitNaive=Dy,ya.AggressiveNone=Ty,ya.AggressiveLess=ev,ya.AggressiveMore=_y,ya.PackNone=0,ya.PackExpand=1,ya.PackStraighten=2,ya.PackMedian=4,ya.PackAll=15,ya.AlignNone=0,ya.AlignUpperLeft=1,ya.AlignUpperRight=2,ya.AlignLowerLeft=4,ya.AlignLowerRight=8,ya.AlignAll=15;function Jc(){this.index=this.Ic=this.rd=this.jc=this.first=this.layer=0,this.link=null,this.j=0}Jc.className="SegInfo";function Fp(a){Ta.call(this,a)}Tt(Fp,Ta),Fp.prototype.createVertex=function(){return new Bu(this)},Fp.prototype.createEdge=function(){return new Em(this)},Fp.className="LayeredDigraphNetwork";function Bu(a){Es.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}Tt(Bu,Es);function rS(a,y){return a.index-y.index}function tv(a,y){if(!a.$n){for(var x=[],E=ci(a.destinationEdgesArrayAccess),b=E.next();!b.done;b=E.next())b=b.value,b.valid&&x.push(b);a.$n=x}for(a=ci(a.$n),x=a.next();!x.done;x=a.next())if(x=x.value,x.toVertex===y)return x;it("Unable to find destination edge to given vertex")}function Iy(a){if(!a.co){for(var y=[],x=ci(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=ci(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}Bu.prototype.Cl=function(a){Es.prototype.Cl.call(this,a),this.bo=this.co=null},Bu.prototype.Kl=function(a){Es.prototype.Kl.call(this,a),this.bo=this.co=null},Bu.prototype.zl=function(a){Es.prototype.zl.call(this,a),this.$n=this.ao=null},Bu.prototype.Jl=function(a){Es.prototype.Jl.call(this,a),this.$n=this.ao=null},kt.Object.defineProperties(Bu.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)}}}),Bu.prototype.deleteDestinationEdge=Bu.prototype.Jl,Bu.prototype.addDestinationEdge=Bu.prototype.zl,Bu.prototype.deleteSourceEdge=Bu.prototype.Kl,Bu.prototype.addSourceEdge=Bu.prototype.Cl,Bu.className="LayeredDigraphVertex";function Em(a){ql.call(this,a),this.j=this.ia=this.Ha=!1,this.V=this.u=NaN,this.F=this.o=0}Tt(Em,ql),kt.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 Mo(a){Ga.call(this),this.Ub=new Zn,this.Wn=ov,this.ud=ed,this.vo=sv,this.Bq=Uy,this.$v=[],this.td=!0,this.Rb=lv,this.$d=new bn(10,10).freeze();var y=new Tg(this);this.W=new zu(y),this.Y=new zu(y),this.ru=[],a&&Object.assign(this,a)}Tt(Mo,Ga),Mo.prototype.cloneProtected=function(a){Ga.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)},Mo.prototype.qb=function(a){a.classType===Mo?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:it("Unknown enum value: "+a):Ga.prototype.qb.call(this,a)},Mo.prototype.createNetwork=function(){return new Tg(this)},Mo.prototype.makeNetwork=function(a){function y(E){if(E instanceof Fi)return!E.isLinkLabel&&E.category!=="Comment";if(E instanceof ti){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 Zt?(x.lg(a.nodes,!0,y),x.lg(a.links,!0,y)):a instanceof qr?x.lg(a.memberParts,!1,y):x.lg(a.iterator,!1,y),x},Mo.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 Zt&&(y=a),this.path===ov&&y!==null?this.ud=y.isTreePathToChildren?ed:Ng:this.ud=this.path===ov?ed: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 Zn,y=this.Ub.iterator;y.next();){var x=y.value;x instanceof Fi?(x=this.network.ki(x),x!==null&&a.add(x)):x instanceof zu&&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 zu&&sS(this,y);for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof zu&&lS(this,y);for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof zu&&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 zu&&this.layoutTree(y);this.arrangeTrees(),this.updateParts()}this.network=null,this.Ub=new Zn,this.isValidLayout=!0};function XS(a){var y=new Zn;for(a=a.iterator;a.next();){var x=a.value;x.initialized||y.add(x)}return y}Mo.prototype.findRoots=function(){for(var a=this.network.vertexes,y=a.iterator;y.next();){var x=y.value;switch(this.ud){case ed:x.sourceEdges.count===0&&this.Ub.add(x);break;case Ng:x.destinationEdges.count===0&&this.Ub.add(x);break;default:it("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 ed: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:it("Unhandled path value "+a.ud.toString())}}return E}function Oy(a,y){if(y!==null){switch(a.ud){case ed:if(0<y.destinationEdges.count){for(var x=new Tn,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 Tn,E=y.sourceVertexes;E.next();)b=E.value,aS(a,y,b)&&x.add(b);0<x.count&&(y.children=x.Fa())}break;default:it("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}Mo.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===id&&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 Wy:return y.parent!==null?y.parent.parent!==null?y.parent.parent:a.Y:a.W;case Hy: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}}Mo.prototype.initializeTreeVertexValues=function(a){if(a.copyInheritedPropertiesFrom(JS(this,a)),a.parent!==null&&a.parent.alignment===id){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])}}Mo.prototype.assignTreeVertexValues=function(){};function uS(a,y){if(y!==null){y.alignment!==id&&a.sortTreeVertexChildren(y),y=y.children;for(var x=y.length,E=0;E<x;E++)uS(a,y[E])}}Mo.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:it("Unhandled sorting value "+a.sorting.toString())}},Mo.prototype.Cu=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)},Mo.prototype.addComments=function(a){var y=a.angle,x=a.parent,E=0,b=!1;x!==null&&(E=x.angle,b=x.alignment,b=Qc(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 le=a.node.Mu();le.next();){var he=le.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=zt.allocAt(0,0,a.bounds.width+z,a.bounds.height+ee),a.bounds=b,zt.free(b))};function Qc(a){return a===lc||a===id||a===uc||a===Ad}function Cm(a){return a===lc||a===id}function Ry(a){var y=a.parent;if(y!==null){var x=y.alignment;if(Qc(x)){if(Cm(x)){for(y=y.children,x=0;x<y.length&&a!==y[x];)x++;return x%2===0}if(x===uc)return!0}}return!1}Mo.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=Qc(z)),E=E===90||E===270,x=b===90||b===270;for(var ee=a.childrenCount===0,re=Ry(a),oe=0,le=a.comments,he=le.length,ge=_e.alloc(),xe=0;xe<he;xe++){var Pe=le[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=Lo}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=Lo,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=Lo,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=Lo;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=Oo,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=Oo;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=Oo;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=Oo,Ne.toSpot=jr;oe=0<=a.commentSpacing?oe+(Fe.width+a.commentSpacing):oe+(a.commentSpacing-Fe.width)}}if(_e.free(ge),y=oe-a.commentSpacing-(E?y.height:y.width),this.ud===ed)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)}},Mo.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===id)hS(this,a);else if(a.childrenCount===0)E=a.parent,x=!1,y=0,E!==null&&(y=E.angle,x=E.alignment,x=Qc(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=eh(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===td;var le=oe===nd,he=Qc(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||le||a.hm||a.im&&a.maxGenerationCount===1)&&(Ne=Math.max(0,a.rowIndent)),E=a.width;var Xe=a.height,Ve=0,st=0,ht=0,pt=null,Et=null,Gt=0,xi=0,Ki=0,ji=0,ei=0,En=0,Qr=0,Gr=0;if(he&&!Cm(oe)&&135<b&&ee.reverse(),Cm(oe))if(1<re)for(var oa=0;oa<re;oa++)oa%2===0&&oa!==re-1&&(Gr=Math.max(Gr,y?ee[oa].Da.width:ee[oa].Da.height));else re===1&&(Gr=y?ee[0].Da.width:ee[0].Da.height);if(he){switch(oe){case lc:st=135>b?dS(this,a,ee,Gr,Ve,st):cS(this,a,ee,Gr,Ve,st),Gr=st.x,Ve=st.width,st=st.height;break;case uc:for(pt=0;pt<re;pt++)Et=ee[pt],ge=Et.Da,ht=En===0?0:Fe,y?(Et.S.h(z-ge.width,ji+ht),Ve=Math.max(Ve,ge.width),st=Math.max(st,ji+ht+ge.height),ji+=ht+ge.height):(Et.S.h(Ki+ht,z-ge.height),Ve=Math.max(Ve,Ki+ht+ge.width),st=Math.max(st,ge.height),Ki+=ht+ge.width),En++;break;case Ad:for(pt=0;pt<re;pt++)Et=ee[pt],z=Et.Da,ge=En===0?0:Fe,y?(Et.S.h(xe/2+a.focus.x,ji+ge),Ve=Math.max(Ve,z.width),st=Math.max(st,ji+ge+z.height),ji+=ge+z.height):(Et.S.h(Ki+ge,xe/2+a.focus.y),Ve=Math.max(Ve,Ki+ge+z.width),st=Math.max(st,z.height),Ki+=ge+z.width),En++}pt=Vl(this,2),Et=Vl(this,2),y?(pt[0].h(0,0),pt[1].h(0,st),Et[0].h(Ve,0)):(pt[0].h(0,0),pt[1].h(Ve,0),Et[0].h(0,st)),Et[1].h(Ve,st)}else for(oa=0;oa<re;oa++){var La=ee[oa],Ms=La.Da;if(y){0<ge&&0<En&&Ki+xe+Ms.width>ge&&(Ki<z&&jf(a,oe,z-Ki,0,Qr,oa-1),ei++,En=0,Qr=oa,ht=st,Ki=0,ji=135<b?-st-Fe:st+Fe),iv(this,La,0,ji);var Ds=0;if(En===0)pt=La.Yo,Et=La.kp,Gt=Ms.width,xi=Ms.height,(pt===null||Et===null||b!==eh(La))&&(pt=Vl(this,2),Et=Vl(this,2),pt[0].h(0,0),pt[1].h(0,xi),Et[0].h(Gt,0),Et[1].h(Gt,xi));else{var gl=Hi();xi=fS(this,a,La,pt,Et,Gt,xi,gl),Ds=xi.x,pt=gl[0],Et=gl[1],Gt=xi.width,xi=xi.height,Mi(gl),Ki<Ms.width&&0>Ds&&(Ag(a,-Ds,0,Qr,oa-1),rv(pt,-Ds,0),rv(Et,-Ds,0),Ds=0)}La.S.h(Ds,ji),Ve=Math.max(Ve,Gt),st=Math.max(st,ht+(ei===0?0:Fe)+Ms.height),Ki=Gt}else 0<ge&&0<En&&ji+xe+Ms.height>ge&&(ji<z&&jf(a,oe,0,z-ji,Qr,oa-1),ei++,En=0,Qr=oa,ht=Ve,ji=0,Ki=135<b?-Ve-Fe:Ve+Fe),iv(this,La,Ki,0),Ds=0,En===0?(pt=La.Yo,Et=La.kp,Gt=Ms.width,xi=Ms.height,(pt===null||Et===null||b!==eh(La))&&(pt=Vl(this,2),Et=Vl(this,2),pt[0].h(0,0),pt[1].h(Gt,0),Et[0].h(0,xi),Et[1].h(Gt,xi))):(gl=Hi(),xi=fS(this,a,La,pt,Et,Gt,xi,gl),Ds=xi.x,pt=gl[0],Et=gl[1],Gt=xi.width,xi=xi.height,Mi(gl),ji<Ms.height&&0>Ds&&(Ag(a,0,-Ds,Qr,oa-1),rv(pt,0,-Ds),rv(Et,0,-Ds),Ds=0)),La.S.h(Ki,Ds),st=Math.max(st,xi),Ve=Math.max(Ve,ht+(ei===0?0:Fe)+Ms.width),ji=xi;En++}switch(0<ei&&(y?(st+=Math.max(0,x),Ki<Ve&&jf(a,oe,Ve-Ki,0,Qr,re-1),0<Ne&&(le||Ag(a,Ne,0,0,re-1),Ve+=Ne)):(Ve+=Math.max(0,x),ji<st&&jf(a,oe,0,st-ji,Qr,re-1),0<Ne&&(le||Ag(a,0,Ne,0,re-1),st+=Ne))),Ne=le=0,oe){case Bp:y?le+=Ve/2-a.focus.x-Pe/2:Ne+=st/2-a.focus.y-Pe/2;break;case Dg:0<ei?y?le+=Ve/2-a.focus.x-Pe/2:Ne+=st/2-a.focus.y-Pe/2:y?(Gr=ee[0].S.x+ee[0].la.x,le+=Gr+(ee[re-1].S.x+ee[re-1].la.x+2*ee[re-1].focus.x-Gr)/2-a.focus.x-Pe/2):(Gr=ee[0].S.y+ee[0].la.y,Ne+=Gr+(ee[re-1].S.y+ee[re-1].la.y+2*ee[re-1].focus.y-Gr)/2-a.focus.y-Pe/2);break;case td:y?(le-=Pe,Ve+=Pe):(Ne-=Pe,st+=Pe);break;case nd:y?(le+=Ve-a.width+Pe,Ve+=Pe):(Ne+=st-a.height+Pe,st+=Pe);break;case lc:y?1<re?le+=Gr+xe/2-a.focus.x:le+=ee[0].focus.x-a.focus.x+ee[0].la.x:1<re?Ne+=Gr+xe/2-a.focus.y:Ne+=ee[0].focus.y-a.focus.y+ee[0].la.y;break;case uc:y?le+=Ve+xe/2-a.focus.x:Ne+=st+xe/2-a.focus.y;break;case Ad:break;default:st=this.customAlignment(a,le,Ne,Ve,st),le=st[0],Ne=st[1],Ve=st[2],st=st[3]}for(Pe=0;Pe<re;Pe++)Gr=ee[Pe],y?Gr.S.h(Gr.S.x+Gr.la.x-le,Gr.S.y+(135<b?(he?-st:-Gr.Da.height)+Gr.la.y-x:Xe+x+Gr.la.y)):Gr.S.h(Gr.S.x+(135<b?(he?-Ve:-Gr.Da.width)+Gr.la.x-x:E+x+Gr.la.x),Gr.S.y+Gr.la.y-Ne);if(re=ee=0,he?y?(Ve=jy(a,Ve,le),0>le&&(le=0),135<b&&(Ne+=st+x),st+=Xe+x,oe===Ad&&(ee+=xe/2+a.focus.x),re+=Xe+x):(135<b&&(le+=Ve+x),Ve+=E+x,st=zy(a,st,Ne),0>Ne&&(Ne=0),oe===Ad&&(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,le=0):Ve=jy(a,Ve,le),0>le&&(ee-=le,le=0),135<b&&(Ne+=st+x),st=Math.max(Math.max(st,Xe),st+Xe+x),re+=Xe+x):(135<b&&(le+=Ve+x),Ve=Math.max(Math.max(Ve,E),Ve+E+x),a.comments===null?Xe>st&&(st=Zy(oe,0,Xe-st),ee=st.x,re=st.y,st=Xe,Ne=0):st=zy(a,st,Ne),0>Ne&&(re-=Ne,Ne=0),ee+=E+x),0<ei)b=Vl(this,4),ei=Vl(this,4),y?(b[2].h(0,Xe+x),b[3].h(b[2].x,st),ei[2].h(Ve,b[2].y),ei[3].h(ei[2].x,b[3].y)):(b[2].h(E+x,0),b[3].h(Ve,b[2].y),ei[2].h(b[2].x,st),ei[3].h(b[3].x,ei[2].y));else{for(b=Vl(this,pt.length+2),ei=Vl(this,Et.length+2),oe=0;oe<pt.length;oe++)he=pt[oe],b[oe+2].h(he.x+ee,he.y+re);for(oe=0;oe<Et.length;oe++)he=Et[oe],ei[oe+2].h(he.x+ee,he.y+re)}y?(b[0].h(le,0),b[1].h(b[0].x,Xe),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])),ei[0].h(le+E,0),ei[1].h(ei[0].x,Xe),ei[2].y<ei[1].y&&(ei[2].x<ei[0].x?ei[2].assign(ei[1]):ei[1].assign(ei[2])),ei[3].y<ei[2].y&&(ei[3].x<ei[0].x?ei[3].assign(ei[2]):ei[2].assign(ei[3])),b[2].y-=x/2,ei[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])),ei[0].h(0,Ne+Xe),ei[1].h(E,ei[0].y),ei[2].x<ei[1].x&&(ei[2].y<ei[0].y?ei[2].assign(ei[1]):ei[1].assign(ei[2])),ei[3].x<ei[2].x&&(ei[3].y<ei[0].y?ei[3].assign(ei[2]):ei[2].assign(ei[3])),b[2].x-=x/2,ei[2].x-=x/2),yh(this,pt),yh(this,Et),a.Yo=b,a.kp=ei,a.la.h(le,Ne),a.Da.h(Ve,st)}break;default:it("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=Qc(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=eh(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 le=y.alignment,he=le===td,ge=le===nd;re=Qc(le);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,Xe=y.rowSpacing,Ve=0;(he||ge||y.hm||y.im&&y.maxGenerationCount===1)&&(Ve=Math.max(0,y.rowIndent)),he=y.width;var st=y.height,ht=0,pt=0,Et=0,Gt=0,xi=0,Ki=0,ji=0,ei=0,En=0,Qr=0;if(re&&!Cm(le)&&135<E&&b.reverse(),Cm(le))if(1<ee)for(var Gr=0;Gr<ee;Gr++){var oa=b[Gr],La=oa.Da;Gr%2===0&&Gr!==ee-1?En=Math.max(En,(x?La.width:La.height)+a.computeBusNodeSpacing(oa)-Pe):Gr%2!==0&&(Qr=Math.max(Qr,(x?La.width:La.height)+a.computeBusNodeSpacing(oa)-Pe))}else ee===1&&(En=x?b[0].Da.width:b[0].Da.height);if(re)switch(le){case lc:case id:pt=135>E?dS(a,y,b,En,ht,pt):cS(a,y,b,En,ht,pt),En=pt.x,ht=pt.width,pt=pt.height;break;case uc:for(xe=0;xe<ee;xe++)Ne=b[xe],Et=Ne.Da,Qr=ji===0?0:Xe,x?(Ne.S.h(z-Et.width,xi+Qr),ht=Math.max(ht,Et.width),pt=Math.max(pt,xi+Qr+Et.height),xi+=Qr+Et.height):(Ne.S.h(Gt+Qr,z-Et.height),ht=Math.max(ht,Gt+Qr+Et.width),pt=Math.max(pt,Et.height),Gt+=Qr+Et.width),ji++;break;case Ad:for(z=0;z<ee;z++)xe=b[z],Ne=xe.Da,Et=ji===0?0:Xe,x?(xe.S.h(Pe/2+y.focus.x,xi+Et),ht=Math.max(ht,Ne.width),pt=Math.max(pt,xi+Et+Ne.height),xi+=Et+Ne.height):(xe.S.h(Gt+Et,Pe/2+y.focus.y),ht=Math.max(ht,Gt+Et+Ne.width),pt=Math.max(pt,Ne.height),Gt+=Et+Ne.width),ji++}else for(Qr=0;Qr<ee;Qr++)Gr=b[Qr],oa=Gr.Da,x?(0<xe&&0<ji&&Gt+Pe+oa.width>xe&&(Gt<z&&jf(y,le,z-Gt,0,ei,Qr-1),Ki++,ji=0,ei=Qr,Et=pt,Gt=0,xi=135<E?-pt-Xe:pt+Xe),La=ji===0?Ne:Pe,iv(a,Gr,0,xi),Gr.S.h(Gt+La,xi),ht=Math.max(ht,Gt+La+oa.width),pt=Math.max(pt,Et+(Ki===0?0:Xe)+oa.height),Gt+=La+oa.width):(0<xe&&0<ji&&xi+Pe+oa.height>xe&&(xi<z&&jf(y,le,0,z-xi,ei,Qr-1),Ki++,ji=0,ei=Qr,Et=ht,xi=0,Gt=135<E?-ht-Xe:ht+Xe),La=ji===0?Ne:Pe,iv(a,Gr,Gt,0),Gr.S.h(Gt,xi+La),pt=Math.max(pt,xi+La+oa.height),ht=Math.max(ht,Et+(Ki===0?0:Xe)+oa.width),xi+=La+oa.height),ji++;switch(0<Ki&&(x?(pt+=Math.max(0,oe),Gt<ht&&jf(y,le,ht-Gt,0,ei,ee-1),0<Ve&&(ge||Ag(y,Ve,0,0,ee-1),ht+=Ve)):(ht+=Math.max(0,oe),xi<pt&&jf(y,le,0,pt-xi,ei,ee-1),0<Ve&&(ge||Ag(y,0,Ve,0,ee-1),pt+=Ve))),Ve=ge=0,le){case Bp:x?ge+=ht/2-y.focus.x-Fe/2:Ve+=pt/2-y.focus.y-Fe/2;break;case Dg:0<Ki?x?ge+=ht/2-y.focus.x-Fe/2:Ve+=pt/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 td:x?(ge-=Fe,ht+=Fe):(Ve-=Fe,pt+=Fe);break;case nd:x?(ge+=ht-y.width+Fe,ht+=Fe):(Ve+=pt-y.height+Fe,pt+=Fe);break;case lc:case id:x?1<ee?ge+=En+Pe/2-y.focus.x:ge+=b[0].focus.x-y.focus.x+b[0].la.x:1<ee?Ve+=En+Pe/2-y.focus.y:Ve+=b[0].focus.y-y.focus.y+b[0].la.y;break;case uc:x?ge+=ht+Pe/2-y.focus.x:Ve+=pt+Pe/2-y.focus.y;break;case Ad:break;default:a=a.customAlignment(y,ge,Ve,ht,pt),ge=a[0],Ve=a[1],ht=a[2],pt=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?-pt:-Fe.Da.height)+Fe.la.y-oe:st+oe+Fe.la.y)):Fe.S.h(Fe.S.x+(135<E?(re?-ht:-Fe.Da.width)+Fe.la.x-oe:he+oe+Fe.la.x),Fe.S.y+Fe.la.y-Ve);x?(ht=jy(y,ht,ge),0>ge&&(ge=0),135<E&&(Ve+=pt+oe),pt=Math.max(Math.max(pt,st),pt+st+oe)):(135<E&&(ge+=ht+oe),ht=Math.max(Math.max(ht,he),ht+he+oe),pt=zy(y,pt,Ve),0>Ve&&(Ve=0)),y.la.h(ge,Ve),y.Da.h(ht,pt)}}Mo.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 zt(E,0,b,z);if(ee===1)return y=x[0],b=y.Da.width,z=y.Da.height,new zt(E,0,b,z);for(var re=y.nodeSpacing,oe=y.rowSpacing,le=eh(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,Xe=he===0?0:oe;if(le){var Ve=a.computeBusNodeSpacing(Fe)-re;Fe.S.h(E-(Ne.width+Ve),xe+Xe),b=Math.max(b,Ne.width+Ve),z=Math.max(z,xe+Xe+Ne.height),xe+=Xe+Ne.height}else Ve=a.computeBusNodeSpacing(Fe)-re,Fe.S.h(ge+Xe,E-(Ne.height+Ve)),z=Math.max(z,Ne.height+Ve),b=Math.max(b,ge+Xe+Ne.width),ge+=Xe+Ne.width;he++}for(he=0,Fe=ge,Pe=xe,le?(ge=E+re,xe=0):(ge=0,xe=E+re),Ne=0;Ne<ee;Ne++)if(Ne%2!==0){Xe=x[Ne],Ve=Xe.Da;var st=he===0?0:oe;if(le){var ht=a.computeBusNodeSpacing(Xe)-re;Xe.S.h(ge+ht,xe+st),b=Math.max(b,ge+Ve.width+ht),z=Math.max(z,xe+st+Ve.height),xe+=st+Ve.height}else ht=a.computeBusNodeSpacing(Xe)-re,Xe.S.h(ge+st,xe+ht),b=Math.max(b,ge+st+Ve.width),z=Math.max(z,xe+Ve.height+ht),ge+=st+Ve.width;he++}return 1<ee&&ee%2===1&&(x=x[ee-1],ee=x.Da,a=a.computeBusLastRowSpacing(x,le?Math.max(Math.abs(Pe),Math.abs(xe)):Math.max(Math.abs(Fe),Math.abs(ge))),le?(x.S.h(E+re/2-x.focus.x-x.la.x,z+a),le=E+re/2-x.focus.x-x.la.x,b=Math.max(b,le+ee.width),0>le&&(b-=le),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 zt(E,0,b,z)}function cS(a,y,x,E,b,z){var ee=x.length;if(ee===0)return new zt(E,0,b,z);if(ee===1)return x=x[0],b=x.Da.width,z=x.Da.height,new zt(E,0,b,z);for(var re=y.nodeSpacing,oe=y.rowSpacing,le=eh(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,Xe=he===0?0:oe;if(le){var Ve=a.computeBusNodeSpacing(Fe)-re;xe-=Xe+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-=Xe+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,le?(ge=E+re,xe=0):(ge=0,xe=E+re),Ne=0;Ne<ee;Ne++)if(Ne%2!==0){Xe=x[Ne],Ve=Xe.Da;var st=he===0?0:oe;if(le){var ht=a.computeBusNodeSpacing(Xe)-re;xe-=st+Ve.height,Xe.S.h(ge+ht,xe),b=Math.max(b,ge+Ve.width+ht),z=Math.max(z,Math.abs(xe))}else ht=a.computeBusNodeSpacing(Xe)-re,ge-=st+Ve.width,Xe.S.h(ge,xe+ht),z=Math.max(z,xe+Ve.height+ht),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,le?Math.max(Math.abs(Pe),Math.abs(xe)):Math.max(Math.abs(Fe),Math.abs(ge))),le?(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],le?re.S.h(re.S.x,re.S.y+z):re.S.h(re.S.x+b,re.S.y);return new zt(E,0,b,z)}Mo.prototype.computeBusNodeSpacing=function(a){return a.parent===null?0:a.parent.nodeSpacing},Mo.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 td:return a.width>y?a.width:y;case nd:return 2*a.focus.x>y?a.width:y+a.width-2*a.focus.x;case lc:case id:return Math.max(a.width,Math.max(y,x+a.width)-Math.min(0,x));case uc:return a.width-a.focus.x+a.nodeSpacing/2+y;case Ad: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 td:return a.height>y?a.height:y;case nd:return 2*a.focus.y>y?a.height:y+a.height-2*a.focus.y;case lc:case id:return Math.max(a.height,Math.max(y,x+a.height)-Math.min(0,x));case uc:return a.height-a.focus.y+a.nodeSpacing/2+y;case Ad: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 td:x=y=0;break;case nd:break;default:it("Unhandled alignment value "+a.toString())}return new _e(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 ed: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:it("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=eh(y),le=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=le?Math.max(xe,ee.height):Math.max(E,ee.width);if((Pe===null||oe!==eh(x))&&(Pe=Vl(a,2),Fe=Vl(a,2),le?(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))),le){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 Xe=Pe[b];oe=Xe.x,le=Xe.y,oe+=E;var Ve=z;x+1<ge.length&&(Ve=ge[x+1]);var st=Xe;Xe=st.x,st=st.y,b+1<Pe.length&&(st=Pe[b+1],Xe=st.x,st=st.y,Xe+=E);var ht=xe;z.y===le?ht=oe-z.x:z.y>le&&z.y<st?ht=oe+(z.y-le)/(st-le)*(Xe-oe)-z.x:le>z.y&&le<Ve.y&&(ht=oe-(z.x+(le-z.y)/(Ve.y-z.y)*(Ve.x-z.x))),ht<xe&&(xe=ht),Ve.y<=z.y?x++:st<=le?b++:(Ve.y<=st&&x++,st<=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=Vl(a,y.length+x.length),E=z=oe=0;z<x.length&&x[z].y<y[0].y;)le=x[z++],he[E++].h(le.x+b,le.y);for(;oe<y.length;)le=y[oe++],he[E++].h(le.x,le.y);for(oe=y[y.length-1].y;z<x.length&&x[z].y<=oe;)z++;for(;z<x.length&&x[z].y>oe;)le=x[z++],he[E++].h(le.x+b,le.y);for(x=Vl(a,E),oe=0;oe<E;oe++)x[oe].assign(he[oe]);yh(a,he),E=x}if(z=Fe,oe=xe,ge===null||2>ge.length||z===null||2>z.length)b=null;else{for(he=Vl(a,ge.length+z.length),b=le=x=0;x<ge.length&&ge[x].y<z[0].y;)Ve=ge[x++],he[b++].h(Ve.x,Ve.y);for(;le<z.length;)Ve=z[le++],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=Vl(a,b),x=0;x<b;x++)z[x].assign(he[x]);yh(a,he),b=z}return z=Math.max(0,xe)+ee.width,ee=Ne,yh(a,y),yh(a,Pe),yh(a,ge),yh(a,Fe),re[0]=E,re[1]=b,new zt(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],Xe=Pe[b],oe=Xe.x,le=Xe.y,le+=xe,Ve=z,x+1<ge.length&&(Ve=ge[x+1]),st=Xe,Xe=st.x,st=st.y,b+1<Pe.length&&(st=Pe[b+1],Xe=st.x,st=st.y,st+=xe),ht=E,z.x===oe?ht=le-z.y:z.x>oe&&z.x<Xe?ht=le+(z.x-oe)/(Xe-oe)*(st-le)-z.y:oe>z.x&&oe<Ve.x&&(ht=le-(z.y+(oe-z.x)/(Ve.x-z.x)*(Ve.y-z.y))),ht<E&&(E=ht),Ve.x<=z.x?x++:Xe<=oe?b++:(Ve.x<=Xe&&x++,Xe<=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=Vl(a,y.length+x.length),E=z=oe=0;z<x.length&&x[z].x<y[0].x;)le=x[z++],he[E++].h(le.x,le.y+b);for(;oe<y.length;)le=y[oe++],he[E++].h(le.x,le.y);for(oe=y[y.length-1].x;z<x.length&&x[z].x<=oe;)z++;for(;z<x.length&&x[z].x>oe;)le=x[z++],he[E++].h(le.x,le.y+b);for(x=Vl(a,E),oe=0;oe<E;oe++)x[oe].assign(he[oe]);yh(a,he),E=x}if(z=Fe,oe=xe,ge===null||2>ge.length||z===null||2>z.length)b=null;else{for(he=Vl(a,ge.length+z.length),b=le=x=0;x<ge.length&&ge[x].x<z[0].x;)Ve=ge[x++],he[b++].h(Ve.x,Ve.y);for(;le<z.length;)Ve=z[le++],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=Vl(a,b),x=0;x<b;x++)z[x].assign(he[x]);yh(a,he),b=z}return z=Ne,ee=Math.max(0,xe)+ee.height,yh(a,y),yh(a,Pe),yh(a,ge),yh(a,Fe),re[0]=E,re[1]=b,new zt(xe,0,z,ee)}function Vl(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 _e;return a}function yh(a,y){var x=y.length,E=a.ru[x];E===void 0&&(E=[],a.ru[x]=E),E.push(y)}Mo.prototype.arrangeTrees=function(){if(this.Rb===uv)for(var a=this.Ub.iterator;a.next();){var y=a.value;if(y instanceof zu){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 zu&&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:it("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:it("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)}}}Mo.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.Gu(),this.isRouting&&this.commitLinks()},Mo.prototype.commitNodes=function(){for(var a=this.network.vertexes.iterator;a.next();)a.value.commit();for(a.reset();a.next();)this.layoutComments(a.value)},Mo.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 _e(-this.nodeSpacing/2,-this.layerSpacing/2)):(x.Bc(this.layerSpacing,this.nodeSpacing/2),E=new _e(-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 zt(0,z,x,re))):this.angle===90?(b.push(new zt(0,z,x,re)),z+=re):this.angle===180?(z-=re,b.push(new zt(z,0,re,x))):(b.push(new zt(z,0,re,x)),z+=re)}this.commitLayers(b,E)}},Mo.prototype.commitLayers=function(){},Mo.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()},Mo.prototype.yv=function(){for(var a=this.Ub.iterator;a.next();){var y=a.value;y instanceof zu&&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])}}Mo.prototype.setPortSpots=function(a){var y=a.alignment;if(Qc(y)){var x=this.ud===ed,E=eh(a);switch(E){case 0:var b=Lo;break;case 90:b=jr;break;case 180:b=ua;break;default:b=Oo}var z=a.children,ee=z.length;switch(y){case lc:case id: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:Oo;if(ee===1||y===ee-1&&ee%2===1)switch(E){case 0:oe=ua;break;case 90:oe=Oo;break;case 180:oe=Lo;break;default:oe=jr}else y%2===0&&(oe=E===90||E===270?Lo:jr);x?(a.setsPortSpot&&(re.fromSpot=b),a.setsChildPortSpot&&(re.toSpot=oe)):(a.setsPortSpot&&(re.fromSpot=oe),a.setsChildPortSpot&&(re.toSpot=b))}}break;case uc:for(E=E===90||E===270?Lo: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 Ad:for(E=E===90||E===270?ua:Oo,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=eh(a),this.ud===ed){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=Lo;break;case 90:E.fromSpot=jr;break;case 180:E.fromSpot=ua;break;default:E.fromSpot=Oo}else E.fromSpot=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Xb())switch(x){case 0:E.toSpot=ua;break;case 90:E.toSpot=Oo;break;case 180:E.toSpot=Lo;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=Lo;break;case 90:E.toSpot=jr;break;case 180:E.toSpot=ua;break;default:E.toSpot=Oo}else E.toSpot=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Xb())switch(x){case 0:E.fromSpot=ua;break;case 90:E.fromSpot=Oo;break;case 180:E.fromSpot=Lo;break;default:E.fromSpot=jr}else E.fromSpot=a.childPortSpot}};function eh(a){return a=a.angle,45>=a?0:135>=a?90:225>=a?180:315>=a?270:0}Mo.prototype.computeLayerSpacing=function(a){var y=eh(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},Mo.prototype.computeNodeIndent=function(a){var y=eh(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)},kt.Object.defineProperties(Mo.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!==Wy&&a!==Hy&&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()):it("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 en(Mo,"PathDefault",-1),ed=new en(Mo,"PathDestination",0),Ng=new en(Mo,"PathSource",1),Lp=new en(Mo,"SortingForwards",10),bm=new en(Mo,"SortingReverse",11),Fm=new en(Mo,"SortingAscending",12),Lm=new en(Mo,"SortingDescending",13),Bp=new en(Mo,"AlignmentCenterSubtrees",20),Dg=new en(Mo,"AlignmentCenterChildren",21),td=new en(Mo,"AlignmentStart",22),nd=new en(Mo,"AlignmentEnd",23),lc=new en(Mo,"AlignmentBus",24),id=new en(Mo,"AlignmentBusBranching",25),uc=new en(Mo,"AlignmentTopLeftBus",26),Ad=new en(Mo,"AlignmentBottomRightBus",27),av=new en(Mo,"CompactionNone",30),Bm=new en(Mo,"CompactionBlock",31),sv=new en(Mo,"StyleLayered",40),Hy=new en(Mo,"StyleLastParents",41),Wy=new en(Mo,"StyleAlternating",42),Vy=new en(Mo,"StyleRootOnly",43),lv=new en(Mo,"ArrangementVertical",50),Ky=new en(Mo,"ArrangementHorizontal",51),uv=new en(Mo,"ArrangementFixedRoots",52),Uy=new en(Mo,"LayerIndividual",60),Yy=new en(Mo,"LayerSiblings",61),hv=new en(Mo,"LayerUniform",62);Mo.className="TreeLayout",Mo.PathDefault=ov,Mo.PathDestination=ed,Mo.PathSource=Ng,Mo.SortingForwards=Lp,Mo.SortingReverse=bm,Mo.SortingAscending=Fm,Mo.SortingDescending=Lm,Mo.AlignmentCenterSubtrees=Bp,Mo.AlignmentCenterChildren=Dg,Mo.AlignmentStart=td,Mo.AlignmentEnd=nd,Mo.AlignmentBus=lc,Mo.AlignmentBusBranching=id,Mo.AlignmentTopLeftBus=uc,Mo.AlignmentBottomRightBus=Ad,Mo.CompactionNone=av,Mo.CompactionBlock=Bm,Mo.StyleLayered=sv,Mo.StyleLastParents=Hy,Mo.StyleAlternating=Wy,Mo.StyleRootOnly=Vy,Mo.ArrangementVertical=lv,Mo.ArrangementHorizontal=Ky,Mo.ArrangementFixedRoots=uv,Mo.LayerIndividual=Uy,Mo.LayerSiblings=Yy,Mo.LayerUniform=hv;function Tg(a){Ta.call(this,a)}Tt(Tg,Ta),Tg.prototype.createVertex=function(){return new zu(this)},Tg.prototype.createEdge=function(){return new Mp(this)},Tg.className="TreeNetwork";function zu(a){Es.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 _e(0,0),this.Da=new bn(0,0),this.la=new _e(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=er,this.wr=!0,this.Dp=er}Tt(zu,Es),zu.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)},kt.Object.defineProperties(zu.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)}}}),zu.className="TreeVertex";function Mp(a){ql.call(this,a),this.$t=new _e(0,0)}Tt(Mp,ql),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 ed:x=this.fromVertex,E=this.toVertex;break;case Ng:x=this.toVertex,E=this.fromVertex;break;default:it("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=eh(x),ee=y.computeLayerSpacing(x),re=x.rowSpacing;a.vg();var oe=a.curve===fu,le=a.isOrthogonal,he;if(a.uh(),le||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===nd?(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===td?(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)):(le&&(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-(le?re/2:re),z),he++,le&&a.m(he,a.i(he-1).x,xe.y))):z===90?(x.alignment===nd?(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===td?(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)):(le&&(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-(le?re/2:re)),he++,le&&a.m(he,xe.x,a.i(he-1).y))):z===180?(x.alignment===nd?(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===td?(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)):(le&&(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+(le?re/2:re),z),he++,le&&a.m(he,a.i(he-1).x,xe.y))):z===270?(x.alignment===nd?(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===td?(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)):(le&&(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+(le?re/2:re)),he++,le&&a.m(he,xe.x,a.i(he-1).y))):it("Invalid angle "+z),a.zf()}else b=E,a=this.link,E=this.network.layout,y=eh(x),y!==eh(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===fu,b=a.isOrthogonal,E=Qc(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()))}}},kt.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",Eo.prototype.initializeStandardTools=function(){this.gb("Action",new Rl,this.mouseDownTools),this.gb("Relinking",new Is,this.mouseDownTools),this.gb("LinkReshaping",new Ka,this.mouseDownTools),this.gb("Rotating",new ol,this.mouseDownTools),this.gb("Resizing",new Vs,this.mouseDownTools),this.gb("Linking",new So,this.mouseMoveTools),this.gb("Dragging",new ka,this.mouseMoveTools),this.gb("DragSelecting",new jl,this.mouseMoveTools),this.gb("Panning",new Os,this.mouseMoveTools),this.gb("ContextMenu",new al,this.mouseUpTools),this.gb("TextEditing",new Na,this.mouseUpTools),this.gb("ClickCreating",new Rh,this.mouseUpTools),this.gb("ClickSelecting",new sd,this.mouseUpTools)},kh("Horizontal",new jm),kh("Spot",new Zm),kh("Table",new Hm),kh("Viewbox",new Km),kh("TableRow",new Wm),kh("TableColumn",new Vm),kh("Graduated",new Wp),kh("Grid",new Hp),Mf.add("GraphLinksModel",Ns),Mf.add("TreeModel",Fu);var dv=yn.go,Xy={get licenseKey(){return Zt.licenseKey},set licenseKey(a){Zt.licenseKey=a},get version(){return Zt.version},Group:qr,EnumValue:en,List:Tn,Set:Zn,Map:Ut,Point:_e,Size:bn,Rect:zt,Margin:Vr,Spot:ni,Geometry:Dt,PathFigure:no,PathSegment:lr,InputEvent:Nr,DiagramEvent:Tr,ChangedEvent:sr,Model:tr,GraphLinksModel:Wo,TreeModel:El,Binding:fs,Transaction:ro,UndoManager:ha,CommandHandler:Ue,Tool:kr,DraggingTool:ka,DraggingInfo:hh,DraggingOptions:ae,LinkingBaseTool:xo,LinkingTool:So,RelinkingTool:Is,LinkReshapingTool:Ka,ResizingTool:Vs,RotatingTool:ol,ClickSelectingTool:sd,ActionTool:Rl,ClickCreatingTool:Rh,HTMLInfo:Nu,ContextMenuTool:al,DragSelectingTool:jl,PanningTool:Os,TextEditingTool:Na,ToolManager:Eo,Animation:zs,AnimationManager:kl,AnimationTrigger:Pu,Layer:bs,Diagram:Zt,Palette:fe,Overview:me,Brush:Jo,GraphObject:bt,Panel:Xn,RowColumnDefinition:Ss,Shape:ao,TextBlock:Da,Picture:Tl,Part:mr,Adornment:$o,Node:Fi,Link:ti,Placeholder:xl,Layout:Ga,LayoutNetwork:Ta,LayoutVertex:Es,LayoutEdge:ql,GridLayout:Hs,PanelLayout:Ps,CircularLayout:Ja,CircularNetwork:Cp,CircularVertex:ym,CircularEdge:V0,ForceDirectedLayout:el,ForceDirectedNetwork:kg,ForceDirectedVertex:xm,ForceDirectedEdge:Sm,LayeredDigraphLayout:ya,LayeredDigraphNetwork:Fp,LayeredDigraphVertex:Bu,LayeredDigraphEdge:Em,TreeLayout:Mo,TreeNetwork:Tg,TreeVertex:zu,TreeEdge:Mp};typeof dv=="object"&&dv.version&&Di("WARNING: a `go` object on the root object is already defined. "+("Debug"in dv?"debug ":"")+"version: "+dv.version+", replaced with version: "+Xy.version),Zt.prototype.go=Xy,yn.go=Xy,typeof Un.exports=="object"&&(Un.exports=typeof Le.g!="undefined"?Le.g.go:self.go)}();var ue=typeof Le.g!="undefined"?Le.g.go:self.go;const Ke=typeof Le.g!="undefined"?Le.g.go:self.go,ft=Ke.Group,yt=Ke.EnumValue,mt=Ke.List,Oe=Ke.Set,at=Ke.Map,Ct=Ke.Point,dt=Ke.Size,Ge=Ke.Rect,Rt=Ke.Margin,ot=Ke.Spot,At=Ke.Geometry,Te=Ke.PathFigure,ne=Ke.PathSegment,te=Ke.InputEvent,de=Ke.DiagramEvent,se=Ke.ChangedEvent,pe=Ke.Model,ye=Ke.GraphLinksModel,we=Ke.TreeModel,be=Ke.Binding,Ie=Ke.Transaction,Re=Ke.UndoManager,rt=Ke.CommandHandler,et=Ke.Tool,Ye=Ke.DraggingTool,ut=Ke.DraggingInfo,tt=Ke.LinkingBaseTool,wt=Ke.LinkingTool,St=Ke.RelinkingTool,Lt=Ke.LinkReshapingTool,mn=Ke.ResizingTool,$t=Ke.RotatingTool,Pn=Ke.ClickSelectingTool,Ot=Ke.ActionTool,ct=Ke.ClickCreatingTool,nt=Ke.HTMLInfo,gn=Ke.ContextMenuTool,oi=Ke.DragSelectingTool,zn=Ke.PanningTool,Ht=Ke.TextEditingTool,Fn=Ke.ToolManager,Cn=Ke.Animation,ii=Ke.AnimationManager,Wt=Ke.AnimationTrigger,Hn=Ke.Layer,lt=Ke.Diagram,An=Ke.Palette,Ni=Ke.Overview,je=Ke.Brush,Me=Ke.GraphObject,Ee=Ke.Panel,De=Ke.RowColumnDefinition,We=Ke.Shape,Ae=Ke.TextBlock,Je=Ke.TextBlockMetrics,Nt=Ke.Picture,fn=Ke.Part,vn=Ke.Adornment,Ft=Ke.Node,Jt=Ke.Link,jt=Ke.Placeholder,pn=Ke.Layout,jn=Ke.LayoutNetwork,Nn=Ke.LayoutVertex,Mn=Ke.LayoutEdge,fr=Ke.GridLayout,nn=Ke.PanelLayout,tn=Ke.CircularLayout,hn=Ke.CircularNetwork,di=Ke.CircularVertex,Sn=Ke.CircularEdge,Kt=Ke.ForceDirectedLayout,gi=Ke.ForceDirectedNetwork,Vi=Ke.ForceDirectedVertex,Pi=Ke.ForceDirectedEdge,Ii=Ke.LayeredDigraphLayout,Fr=Ke.LayeredDigraphNetwork,$n=Ke.LayeredDigraphVertex,In=Ke.LayeredDigraphEdge,si=Ke.TreeLayout,Ti=Ke.TreeNetwork,Oi=Ke.TreeVertex,zi=Ke.TreeEdge,xr=Ke.version},24334:function(Un,ai,Le){var ue,Ke;(function(ft,yt){Un.exports=yt(ft)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof Le.g!="undefined"?Le.g:this,function(ft){"use strict";ft=ft||{};var yt=ft.Base64,mt="2.6.4",Oe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",at=function(St){for(var Lt={},mn=0,$t=St.length;mn<$t;mn++)Lt[St.charAt(mn)]=mn;return Lt}(Oe),Ct=String.fromCharCode,dt=function(St){if(St.length<2){var Lt=St.charCodeAt(0);return Lt<128?St:Lt<2048?Ct(192|Lt>>>6)+Ct(128|Lt&63):Ct(224|Lt>>>12&15)+Ct(128|Lt>>>6&63)+Ct(128|Lt&63)}else{var Lt=65536+(St.charCodeAt(0)-55296)*1024+(St.charCodeAt(1)-56320);return Ct(240|Lt>>>18&7)+Ct(128|Lt>>>12&63)+Ct(128|Lt>>>6&63)+Ct(128|Lt&63)}},Ge=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Rt=function(St){return St.replace(Ge,dt)},ot=function(St){var Lt=[0,2,1][St.length%3],mn=St.charCodeAt(0)<<16|(St.length>1?St.charCodeAt(1):0)<<8|(St.length>2?St.charCodeAt(2):0),$t=[Oe.charAt(mn>>>18),Oe.charAt(mn>>>12&63),Lt>=2?"=":Oe.charAt(mn>>>6&63),Lt>=1?"=":Oe.charAt(mn&63)];return $t.join("")},At=ft.btoa&&typeof ft.btoa=="function"?function(St){return ft.btoa(St)}:function(St){if(St.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return St.replace(/[\s\S]{1,3}/g,ot)},Te=function(St){return At(Rt(String(St)))},ne=function(St){return St.replace(/[+\/]/g,function(Lt){return Lt=="+"?"-":"_"}).replace(/=/g,"")},te=function(St,Lt){return Lt?ne(Te(St)):Te(St)},de=function(St){return te(St,!0)},se;ft.Uint8Array&&(se=function(St,Lt){for(var mn="",$t=0,Pn=St.length;$t<Pn;$t+=3){var Ot=St[$t],ct=St[$t+1],nt=St[$t+2],gn=Ot<<16|ct<<8|nt;mn+=Oe.charAt(gn>>>18)+Oe.charAt(gn>>>12&63)+(typeof ct!="undefined"?Oe.charAt(gn>>>6&63):"=")+(typeof nt!="undefined"?Oe.charAt(gn&63):"=")}return Lt?ne(mn):mn});var pe=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,ye=function(St){switch(St.length){case 4:var Lt=(7&St.charCodeAt(0))<<18|(63&St.charCodeAt(1))<<12|(63&St.charCodeAt(2))<<6|63&St.charCodeAt(3),mn=Lt-65536;return Ct((mn>>>10)+55296)+Ct((mn&1023)+56320);case 3:return Ct((15&St.charCodeAt(0))<<12|(63&St.charCodeAt(1))<<6|63&St.charCodeAt(2));default:return Ct((31&St.charCodeAt(0))<<6|63&St.charCodeAt(1))}},we=function(St){return St.replace(pe,ye)},be=function(St){var Lt=St.length,mn=Lt%4,$t=(Lt>0?at[St.charAt(0)]<<18:0)|(Lt>1?at[St.charAt(1)]<<12:0)|(Lt>2?at[St.charAt(2)]<<6:0)|(Lt>3?at[St.charAt(3)]:0),Pn=[Ct($t>>>16),Ct($t>>>8&255),Ct($t&255)];return Pn.length-=[0,0,2,1][mn],Pn.join("")},Ie=ft.atob&&typeof ft.atob=="function"?function(St){return ft.atob(St)}:function(St){return St.replace(/\S{1,4}/g,be)},Re=function(St){return Ie(String(St).replace(/[^A-Za-z0-9\+\/]/g,""))},rt=function(St){return we(Ie(St))},et=function(St){return String(St).replace(/[-_]/g,function(Lt){return Lt=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},Ye=function(St){return rt(et(St))},ut;ft.Uint8Array&&(ut=function(St){return Uint8Array.from(Re(et(St)),function(Lt){return Lt.charCodeAt(0)})});var tt=function(){var St=ft.Base64;return ft.Base64=yt,St};if(ft.Base64={VERSION:mt,atob:Re,btoa:At,fromBase64:Ye,toBase64:te,utob:Rt,encode:te,encodeURI:de,btou:we,decode:Ye,noConflict:tt,fromUint8Array:se,toUint8Array:ut},typeof Object.defineProperty=="function"){var wt=function(St){return{value:St,enumerable:!1,writable:!0,configurable:!0}};ft.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",wt(function(){return Ye(this)})),Object.defineProperty(String.prototype,"toBase64",wt(function(St){return te(this,St)})),Object.defineProperty(String.prototype,"toBase64URI",wt(function(){return te(this,!0)}))}}return ft.Meteor&&(Base64=ft.Base64),Un.exports?Un.exports.Base64=ft.Base64:(ue=[],Ke=function(){return ft.Base64}.apply(ai,ue),Ke!==void 0&&(Un.exports=Ke)),{Base64:ft.Base64}})},2859:function(Un,ai,Le){"use strict";Le.d(ai,{hP:function(){return Ni}});var ue=function(je,Me){return(ue=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Ee,De){Ee.__proto__=De}||function(Ee,De){for(var We in De)Object.prototype.hasOwnProperty.call(De,We)&&(Ee[We]=De[We])})(je,Me)};function Ke(je,Me){function Ee(){this.constructor=je}ue(je,Me),je.prototype=Me===null?Object.create(Me):(Ee.prototype=Me.prototype,new Ee)}function ft(je,Me,Ee,De){return new(Ee||(Ee=Promise))(function(We,Ae){function Je(vn){try{fn(De.next(vn))}catch(Ft){Ae(Ft)}}function Nt(vn){try{fn(De.throw(vn))}catch(Ft){Ae(Ft)}}function fn(vn){var Ft;vn.done?We(vn.value):(Ft=vn.value,Ft instanceof Ee?Ft:new Ee(function(Jt){Jt(Ft)})).then(Je,Nt)}fn((De=De.apply(je,Me||[])).next())})}function yt(je,Me){var Ee,De,We,Ae,Je={label:0,sent:function(){if(1&We[0])throw We[1];return We[1]},trys:[],ops:[]};return Ae={next:Nt(0),throw:Nt(1),return:Nt(2)},typeof Symbol=="function"&&(Ae[Symbol.iterator]=function(){return this}),Ae;function Nt(fn){return function(vn){return function(Ft){if(Ee)throw new TypeError("Generator is already executing.");for(;Je;)try{if(Ee=1,De&&(We=2&Ft[0]?De.return:Ft[0]?De.throw||((We=De.return)&&We.call(De),0):De.next)&&!(We=We.call(De,Ft[1])).done)return We;switch(De=0,We&&(Ft=[2&Ft[0],We.value]),Ft[0]){case 0:case 1:We=Ft;break;case 4:return Je.label++,{value:Ft[1],done:!1};case 5:Je.label++,De=Ft[1],Ft=[0];continue;case 7:Ft=Je.ops.pop(),Je.trys.pop();continue;default:if(We=Je.trys,!((We=We.length>0&&We[We.length-1])||Ft[0]!==6&&Ft[0]!==2)){Je=0;continue}if(Ft[0]===3&&(!We||Ft[1]>We[0]&&Ft[1]<We[3])){Je.label=Ft[1];break}if(Ft[0]===6&&Je.label<We[1]){Je.label=We[1],We=Ft;break}if(We&&Je.label<We[2]){Je.label=We[2],Je.ops.push(Ft);break}We[2]&&Je.ops.pop(),Je.trys.pop();continue}Ft=Me.call(je,Je)}catch(Jt){Ft=[6,Jt],De=0}finally{Ee=We=0}if(5&Ft[0])throw Ft[1];return{value:Ft[0]?Ft[1]:void 0,done:!0}}([fn,vn])}}}function mt(){for(var je=0,Me=0,Ee=arguments.length;Me<Ee;Me++)je+=arguments[Me].length;var De=Array(je),We=0;for(Me=0;Me<Ee;Me++)for(var Ae=arguments[Me],Je=0,Nt=Ae.length;Je<Nt;Je++,We++)De[We]=Ae[Je];return De}var Oe=function(){function je(){}return je.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},je.setAttributes=function(Me,Ee){for(var De=0,We=Ee;De<We.length;De++){var Ae=We[De],Je=Ae[0],Nt=Ae[1];Me.setAttribute(Je,Nt)}},je.createRect=function(Me,Ee,De){var We=document.createElementNS("http://www.w3.org/2000/svg","rect");return We.setAttribute("width",Me.toString()),We.setAttribute("height",Ee.toString()),De&&je.setAttributes(We,De),We},je.createLine=function(Me,Ee,De,We,Ae){var Je=document.createElementNS("http://www.w3.org/2000/svg","line");return Je.setAttribute("x1",Me.toString()),Je.setAttribute("y1",Ee.toString()),Je.setAttribute("x2",De.toString()),Je.setAttribute("y2",We.toString()),Ae&&je.setAttributes(Je,Ae),Je},je.createPolygon=function(Me,Ee){var De=document.createElementNS("http://www.w3.org/2000/svg","polygon");return De.setAttribute("points",Me),Ee&&je.setAttributes(De,Ee),De},je.createCircle=function(Me,Ee){var De=document.createElementNS("http://www.w3.org/2000/svg","circle");return De.setAttribute("cx",(Me/2).toString()),De.setAttribute("cy",(Me/2).toString()),De.setAttribute("r",Me.toString()),Ee&&je.setAttributes(De,Ee),De},je.createEllipse=function(Me,Ee,De){var We=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return We.setAttribute("cx",(Me/2).toString()),We.setAttribute("cy",(Ee/2).toString()),We.setAttribute("rx",(Me/2).toString()),We.setAttribute("ry",(Ee/2).toString()),De&&je.setAttributes(We,De),We},je.createGroup=function(Me){var Ee=document.createElementNS("http://www.w3.org/2000/svg","g");return Me&&je.setAttributes(Ee,Me),Ee},je.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},je.createMarker=function(Me,Ee,De,We,Ae,Je,Nt){var fn=document.createElementNS("http://www.w3.org/2000/svg","marker");return je.setAttributes(fn,[["id",Me],["orient",Ee],["markerWidth",De.toString()],["markerHeight",We.toString()],["refX",Ae.toString()],["refY",Je.toString()]]),fn.appendChild(Nt),fn},je.createText=function(Me){var Ee=document.createElementNS("http://www.w3.org/2000/svg","text");return Ee.setAttribute("x","0"),Ee.setAttribute("y","0"),Me&&je.setAttributes(Ee,Me),Ee},je.createTSpan=function(Me,Ee){var De=document.createElementNS("http://www.w3.org/2000/svg","tspan");return De.textContent=Me,Ee&&je.setAttributes(De,Ee),De},je.createImage=function(Me){var Ee=document.createElementNS("http://www.w3.org/2000/svg","image");return Me&&je.setAttributes(Ee,Me),Ee},je.createPoint=function(Me,Ee){var De=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return De.x=Me,De.y=Ee,De},je.createPath=function(Me,Ee){var De=document.createElementNS("http://www.w3.org/2000/svg","path");return De.setAttribute("d",Me),Ee&&je.setAttributes(De,Ee),De},je}(),at=function(){function je(){}return je.addKey=function(Me){je.key=Me},Object.defineProperty(je,"isLicensed",{get:function(){return!!je.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(je.key)},enumerable:!1,configurable:!0}),je}(),Ct=function(){function je(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return je.prototype.rasterize=function(Me,Ee,De){var We=this;return new Promise(function(Ae){var Je=De!==void 0?De:document.createElement("canvas");Me===null&&(We.markersOnly=!0,We.naturalSize=!1);var Nt=document.createElementNS("http://www.w3.org/2000/svg","svg");Nt.setAttribute("xmlns","http://www.w3.org/2000/svg"),Nt.setAttribute("width",Ee.width.baseVal.valueAsString),Nt.setAttribute("height",Ee.height.baseVal.valueAsString),Nt.setAttribute("viewBox","0 0 "+Ee.viewBox.baseVal.width.toString()+" "+Ee.viewBox.baseVal.height.toString()),Nt.innerHTML=Ee.innerHTML,We.naturalSize===!0?(Nt.width.baseVal.value=Me.naturalWidth,Nt.height.baseVal.value=Me.naturalHeight):We.width!==void 0&&We.height!==void 0&&(Nt.width.baseVal.value=We.width,Nt.height.baseVal.value=We.height),Je.width=Nt.width.baseVal.value,Je.height=Nt.height.baseVal.value;var fn=Nt.outerHTML,vn=Je.getContext("2d");We.markersOnly!==!0&&vn.drawImage(Me,0,0,Je.width,Je.height);var Ft=window.URL,Jt=new Image(Je.width,Je.height);Jt.setAttribute("crossOrigin","anonymous");var jt=new Blob([fn],{type:"image/svg+xml"}),pn=Ft.createObjectURL(jt);Jt.onload=function(){vn.drawImage(Jt,0,0),Ft.revokeObjectURL(pn);var jn=Je.toDataURL(We.imageType,We.imageQuality);Ae(jn)},Jt.src=pn})},je}(),dt=function(){},Ge=function(){function je(Me){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+Me+"_"}return Object.defineProperty(je.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(je.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(je.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(je.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(je.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),je.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},je.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)},je.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 Rt("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Rt("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Rt("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new ot("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new ot("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},je.prototype.removeStyleSheet=function(){var Me;this.styleSheet&&(((Me=this.styleSheetRoot)!==null&&Me!==void 0?Me:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},je}(),Rt=function(je,Me){this.selector=je,this.style=Me},ot=function(je,Me){this.localName=je,this.style=Me},At=function(){function je(Me,Ee,De,We,Ae){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=Me,this.displayMode=Ee,this.markerItems=De,this.uiStyleSettings=We,this.styles=Ae,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return je.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 De=document.createElement("div");De.className=this.toolbarBlockStyleClass.name,De.style.whiteSpace="nowrap",this.uiContainer.appendChild(De),this.addActionButton(De,'<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(De,'<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(De,'<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(De,'<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(De,'<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(De,'<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(De,'<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(De,'<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 Je=document.createElement("div");Je.className=""+Ee.toolbarButtonStyleClass.name,Je.setAttribute("data-type-name",Ae.typeName),Je.innerHTML=Ae.icon,Je.addEventListener("click",function(){Ee.markerToolbarButtonClicked(Je,Ae)}),Ee.buttons.push(Je),Ee.markerButtons.push(Je)}),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 We=document.createElement("div");We.className=this.toolbarBlockStyleClass.name,We.style.whiteSpace="nowrap",We.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(We),this.addActionButton(We,'<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(We,'<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()},je.prototype.addButtonClickListener=function(Me){this.buttonClickListeners.push(Me)},je.prototype.removeButtonClickListener=function(Me){this.buttonClickListeners.indexOf(Me)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(Me),1)},je.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},je.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]))}},je.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")},je.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)})},je.prototype.addActionButton=function(Me,Ee,De){var We=this,Ae=document.createElement("div");switch(Ae.className=""+this.toolbarButtonStyleClass.name,Ae.innerHTML=Ee,Ae.setAttribute("data-action",De),Ae.addEventListener("click",function(){We.actionToolbarButtonClicked(Ae,De)}),De){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)},je.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ot("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 ot("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ot("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new ot("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 ot("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var Me=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ot("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 ot("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ot("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Rt("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Rt("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},je.prototype.markerToolbarButtonClicked=function(Me,Ee){this.setActiveButton(Me),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(De){return De("marker",Ee)}),this.markerButtonOverflowBlock.style.display="none"},je.prototype.actionToolbarButtonClicked=function(Me,Ee){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(De){return De("action",Ee)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},je.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)},je.prototype.setActiveMarkerButton=function(Me){var Ee=this.markerButtons.find(function(De){return De.getAttribute("data-type-name")===Me});Ee&&this.setActiveButton(Ee)},je.prototype.setCurrentMarker=function(Me){var Ee=this;this.currentMarker=Me,this.buttons.filter(function(De){return/delete|notes/.test(De.getAttribute("data-action"))}).forEach(function(De){Ee.currentMarker===void 0?(De.style.fillOpacity="0.4",De.style.pointerEvents="none"):(De.style.fillOpacity="1",De.style.pointerEvents="all")})},je}(),Te=function(){function je(Me,Ee,De,We){this.panels=[],this.panelButtons=[],this.markerjsContainer=Me,this.displayMode=Ee,this.uiStyleSettings=De,this.styles=We,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return je.prototype.addStyles=function(){var Me;this.toolboxStyleClass=this.styles.addClass(new ot("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 ot("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var Ee=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new ot("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new ot("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new ot("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 ot("toolbox-panel-row_colors",`
|
|
background-color: `+((Me=this.uiStyleSettings.toolboxBackgroundColor)!==null&&Me!==void 0?Me:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new ot("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 ot("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new ot("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new Rt("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Rt("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},je.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)},je.prototype.setPanelButtons=function(Me){var Ee,De,We=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+" "+((De=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&De!==void 0?De:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Ae){var Je;Ae.uiStyleSettings=We.uiStyleSettings;var Nt=document.createElement("div");Nt.className=We.toolboxButtonStyleClass.name+" "+((Je=We.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Je!==void 0?Je:We.toolboxButtonStyleColorsClass.name),Nt.innerHTML=Ae.icon,Nt.title=Ae.title,Nt.addEventListener("click",function(){We.panelButtonClick(Ae)}),We.panelButtons.push(Nt),We.buttonRow.appendChild(Nt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},je.prototype.panelButtonClick=function(Me){var Ee=this,De=-1;if(Me!==this.activePanel){De=this.panels.indexOf(Me),this.panelRow.innerHTML="";var We=Me.getUi();We.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(We),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,Je){var Nt,fn;Ae.className=Ee.toolboxButtonStyleClass.name+" "+(Je===De?""+((Nt=Ee.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Nt!==void 0?Nt:Ee.toolboxActiveButtonStyleColorsClass.name):""+((fn=Ee.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&fn!==void 0?fn:Ee.toolboxButtonStyleColorsClass.name))})},je}(),ne=function(je,Me){this.title=je,this.icon=Me},te=function(je){function Me(Ee,De,We,Ae){var Je=je.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 Je.colors=[],Je.addTransparent=!1,Je.colorBoxes=[],Je.colors=De,Je.currentColor=We,Je.setCurrentColor=Je.setCurrentColor.bind(Je),Je.getColorBox=Je.getColorBox.bind(Je),Je}return Ke(Me,je),Me.prototype.getUi=function(){var Ee=this,De=document.createElement("div");return De.style.overflow="hidden",De.style.whiteSpace="nowrap",this.colors.forEach(function(We){var Ae=Ee.getColorBox(We);De.appendChild(Ae),Ee.colorBoxes.push(Ae)}),De},Me.prototype.getColorBox=function(Ee){var De=this,We=this.uiStyleSettings.toolbarHeight/4,Ae=this.uiStyleSettings.toolbarHeight-We,Je=document.createElement("div");Je.style.display="inline-block",Je.style.boxSizing="content-box",Je.style.width=Ae-2+"px",Je.style.height=Ae-2+"px",Je.style.padding="1px",Je.style.marginRight="2px",Je.style.marginBottom="2px",Je.style.borderWidth="2px",Je.style.borderStyle="solid",Je.style.borderRadius=(Ae+2)/2+"px",Je.style.borderColor=Ee===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Je.addEventListener("click",function(){De.setCurrentColor(Ee,Je)});var Nt=document.createElement("div");return Nt.style.display="inline-block",Nt.style.width=Ae-2+"px",Nt.style.height=Ae-2+"px",Nt.style.backgroundColor=Ee,Nt.style.borderRadius=Ae/2+"px",Ee==="transparent"&&(Nt.style.fill=this.uiStyleSettings.toolboxAccentColor,Nt.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>`),Je.appendChild(Nt),Je},Me.prototype.setCurrentColor=function(Ee,De){var We=this;this.currentColor=Ee,this.colorBoxes.forEach(function(Ae){Ae.style.borderColor=Ae===De?We.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(Ee)},Me}(ne),de=function(){function je(Me,Ee,De){this._state="new",this._isSelected=!1,this._container=Me,this._overlayContainer=Ee,this.globalSettings=De,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(je.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(je.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(je.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(je.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(je.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),je.prototype.ownsTarget=function(Me){return!1},Object.defineProperty(je.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),je.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},je.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},je.prototype.pointerDown=function(Me,Ee){},je.prototype.dblClick=function(Me,Ee){},je.prototype.manipulate=function(Me){},je.prototype.pointerUp=function(Me){this.stateChanged()},je.prototype.dispose=function(){},je.prototype.addMarkerVisualToContainer=function(Me){this.container.childNodes.length>0?this.container.insertBefore(Me,this.container.childNodes[0]):this.container.appendChild(Me)},je.prototype.getState=function(){return{typeName:je.typeName,state:this.state,notes:this.notes}},je.prototype.restoreState=function(Me){this._state=Me.state,this.notes=Me.notes},je.prototype.scale=function(Me,Ee){},je.prototype.colorChanged=function(Me){this.onColorChanged&&this.onColorChanged(Me),this.stateChanged()},je.prototype.fillColorChanged=function(Me){this.onFillColorChanged&&this.onFillColorChanged(Me),this.stateChanged()},je.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)}},je.typeName="MarkerBase",je}(),se=function(){function je(){this.findGripByVisual=this.findGripByVisual.bind(this)}return je.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},je}(),pe=function(){function je(){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 je.prototype.ownsTarget=function(Me){return Me===this.visual||Me===this.visual.childNodes[0]||Me===this.visual.childNodes[1]},je}(),ye=function(){function je(){}return je.toITransformMatrix=function(Me){return{a:Me.a,b:Me.b,c:Me.c,d:Me.d,e:Me.e,f:Me.f}},je.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},je}(),we=function(je){function Me(Ee,De,We){var Ae=je.call(this,Ee,De,We)||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 Ke(Me,je),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 De=Oe.createTransform();this._visual.transform.baseVal.appendItem(De)},enumerable:!1,configurable:!0}),Me.prototype.ownsTarget=function(Ee){return!!je.prototype.ownsTarget.call(this,Ee)||!!(this.controlGrips.findGripByVisual(Ee)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(Ee))},Me.prototype.pointerDown=function(Ee,De){je.prototype.pointerDown.call(this,Ee,De),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 We=this.unrotatePoint(Ee);if(this.manipulationStartX=We.x,this.manipulationStartY=We.y,this.offsetX=We.x-this.left,this.offsetY=We.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(De),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(De)){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 Je=this.container.transform.baseVal.getItem(0);Je.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Je,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},Me.prototype.pointerUp=function(Ee){var De=this.state;je.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",De==="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 De=this.unrotatePoint(Ee);this.state==="creating"?this.resize(Ee):this.state==="move"?(this.left=this.manipulationStartLeft+(De.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(De.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(De):this.state==="rotate"&&this.rotate(Ee)},Me.prototype.resize=function(Ee){var De=this.manipulationStartLeft,We=this.manipulationStartWidth,Ae=this.manipulationStartTop,Je=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:De=this.manipulationStartLeft+Ee.x-this.manipulationStartX,We=this.manipulationStartWidth+this.manipulationStartLeft-De;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:We=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,Je=this.manipulationStartHeight+this.manipulationStartTop-Ae;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Je=this.manipulationStartHeight+Ee.y-this.manipulationStartY}We>=0?(this.left=De,this.width=We):(this.left=De+We,this.width=-We),Je>=0?(this.top=Ae,this.height=Je):(this.top=Ae+Je,this.height=-Je),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 De=Math.sign(Ee.x-this.centerX);this.rotationAngle=180*Math.atan((Ee.y-this.centerY)/(Ee.x-this.centerX))/Math.PI+90*De,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 De=this.container.getCTM(),We=Oe.createPoint(Ee.x,Ee.y);return{x:(We=We.matrixTransform(De)).x,y:We.y}},Me.prototype.unrotatePoint=function(Ee){if(this.rotationAngle===0)return Ee;var De=this.container.getCTM();De=De.inverse();var We=Oe.createPoint(Ee.x,Ee.y);return{x:(We=We.matrixTransform(De)).x,y:We.y}},Me.prototype.select=function(){je.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},Me.prototype.deselect=function(){je.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,De=-Ee/2,We=De,Ae=(this.width+this.CB_DISTANCE)/2-Ee/2,Je=(this.height+this.CB_DISTANCE)/2-Ee/2,Nt=this.height+this.CB_DISTANCE-Ee/2,fn=this.width+this.CB_DISTANCE-Ee/2;this.positionGrip(this.controlGrips.topLeft.visual,De,We),this.positionGrip(this.controlGrips.topCenter.visual,Ae,We),this.positionGrip(this.controlGrips.topRight.visual,fn,We),this.positionGrip(this.controlGrips.centerLeft.visual,De,Je),this.positionGrip(this.controlGrips.centerRight.visual,fn,Je),this.positionGrip(this.controlGrips.bottomLeft.visual,De,Nt),this.positionGrip(this.controlGrips.bottomCenter.visual,Ae,Nt),this.positionGrip(this.controlGrips.bottomRight.visual,fn,Nt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Ae,We-3*this.CB_DISTANCE)},Me.prototype.positionGrip=function(Ee,De,We){var Ae=Ee.transform.baseVal.getItem(0);Ae.setTranslate(De,We),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)},je.prototype.getState.call(this))},Me.prototype.restoreState=function(Ee){je.prototype.restoreState.call(this,Ee);var De=Ee;this.left=De.left,this.top=De.top,this.width=De.width,this.height=De.height,this.rotationAngle=De.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(ye.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,De.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(ye.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,De.containerTransformMatrix))},Me.prototype.scale=function(Ee,De){je.prototype.scale.call(this,Ee,De);var We=this.rotatePoint({x:this.left,y:this.top}),Ae=this.unrotatePoint({x:We.x*Ee,y:We.y*De});this.left=Ae.x,this.top=Ae.y,this.width=this.width*Ee,this.height=this.height*De,this.adjustControlBox()},Me}(de),be=function(je){function Me(Ee,De,We){var Ae=je.call(this,Ee,De,We)||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 Ke(Me,je),Me.prototype.ownsTarget=function(Ee){return!(!je.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,De){je.prototype.pointerDown.call(this,Ee,De),this.state==="new"&&(this.createVisual(),this.moveVisual(Ee),this._state="creating")},Me.prototype.manipulate=function(Ee){je.prototype.manipulate.call(this,Ee)},Me.prototype.resize=function(Ee){je.prototype.resize.call(this,Ee),this.setSize()},Me.prototype.setSize=function(){je.prototype.setSize.call(this),Oe.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},Me.prototype.pointerUp=function(Ee){je.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},je.prototype.getState.call(this))},Me.prototype.restoreState=function(Ee){var De=Ee;this.fillColor=De.fillColor,this.strokeColor=De.strokeColor,this.strokeWidth=De.strokeWidth,this.strokeDasharray=De.strokeDasharray,this.opacity=De.opacity,this.createVisual(),je.prototype.restoreState.call(this,Ee),this.setSize()},Me.prototype.scale=function(Ee,De){je.prototype.scale.call(this,Ee,De),this.setSize()},Me.title="Rectangle marker",Me}(we),Ie=function(je){function Me(Ee,De,We,Ae){var Je=je.call(this,Ee,Ae||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Je.widths=[],Je.widthBoxes=[],Je.widths=De,Je.currentWidth=We,Je.setCurrentWidth=Je.setCurrentWidth.bind(Je),Je}return Ke(Me,je),Me.prototype.getUi=function(){var Ee=this,De=document.createElement("div");return De.style.display="flex",De.style.overflow="hidden",De.style.flexGrow="2",this.widths.forEach(function(We){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=We===Ee.currentWidth?Ee.uiStyleSettings.toolboxAccentColor:"transparent",Ae.addEventListener("click",function(){Ee.setCurrentWidth(We,Ae)}),De.appendChild(Ae);var Je=document.createElement("div");Je.innerText=We.toString(),Je.style.marginRight="5px",Ae.appendChild(Je);var Nt=document.createElement("div");Nt.style.minHeight="20px",Nt.style.flexGrow="2",Nt.style.display="flex",Nt.style.alignItems="center";var fn=document.createElement("hr");fn.style.minWidth="20px",fn.style.border="0px",fn.style.borderTop=We+"px solid "+Ee.uiStyleSettings.toolboxColor,fn.style.flexGrow="2",Nt.appendChild(fn),Ae.appendChild(Nt),Ee.widthBoxes.push(Ae)}),De},Me.prototype.setCurrentWidth=function(Ee,De){var We=this;this.currentWidth=Ee,this.widthBoxes.forEach(function(Ae){Ae.style.borderColor=Ae===De?We.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},Me}(ne),Re=function(je){function Me(Ee,De,We,Ae){var Je=je.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 Je.styles=[],Je.styleBoxes=[],Je.styles=De,Je.currentStyle=We,Je.setCurrentStyle=Je.setCurrentStyle.bind(Je),Je}return Ke(Me,je),Me.prototype.getUi=function(){var Ee=this,De=document.createElement("div");return De.style.display="flex",De.style.overflow="hidden",De.style.flexGrow="2",this.styles.forEach(function(We){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=We===Ee.currentStyle?Ee.uiStyleSettings.toolboxAccentColor:"transparent",Ae.addEventListener("click",function(){Ee.setCurrentStyle(We,Ae)}),De.appendChild(Ae);var Je=document.createElement("div");Je.style.minHeight="20px",Je.style.flexGrow="2",Je.style.overflow="hidden";var Nt=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+Ee.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(We!==""?'stroke-dasharray="'+We+'"':"")+` />
|
|
</svg>`;Je.innerHTML=Nt,Ae.appendChild(Je),Ee.styleBoxes.push(Ae)}),De},Me.prototype.setCurrentStyle=function(Ee,De){var We=this;this.currentStyle=Ee,this.styleBoxes.forEach(function(Ae){Ae.style.borderColor=Ae===De?We.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},Me}(ne),rt=function(je){function Me(Ee,De,We){var Ae=je.call(this,Ee,De,We)||this;return Ae.strokeColor=We.defaultColor,Ae.strokeWidth=We.defaultStrokeWidth,Ae.strokeDasharray=We.defaultStrokeDasharray,Ae.strokePanel=new te("Line color",We.defaultColorSet,We.defaultColor),Ae.strokePanel.onColorChanged=Ae.setStrokeColor,Ae.strokeWidthPanel=new Ie("Line width",We.defaultStrokeWidths,We.defaultStrokeWidth),Ae.strokeWidthPanel.onWidthChanged=Ae.setStrokeWidth,Ae.strokeStylePanel=new Re("Line style",We.defaultStrokeDasharrays,We.defaultStrokeDasharray),Ae.strokeStylePanel.onStyleChanged=Ae.setStrokeDasharray,Ae}return Ke(Me,je),Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Me.prototype.getState=function(){var Ee=je.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}(be),et=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(je){function Me(Ee,De,We){var Ae=je.call(this,Ee,De,We)||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 Ke(Me,je),Me.prototype.ownsTarget=function(Ee){return!!je.prototype.ownsTarget.call(this,Ee)||!(!this.grip1.ownsTarget(Ee)&&!this.grip2.ownsTarget(Ee))},Me.prototype.pointerDown=function(Ee,De){je.prototype.pointerDown.call(this,Ee,De),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(De)?this.activeGrip=this.grip1:this.grip2.ownsTarget(De)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},Me.prototype.pointerUp=function(Ee){var De=this.state;je.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",De==="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(){je.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},Me.prototype.deselect=function(){je.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,De,We){var Ae=Ee.transform.baseVal.getItem(0);Ae.setTranslate(De,We),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},je.prototype.getState.call(this))},Me.prototype.restoreState=function(Ee){je.prototype.restoreState.call(this,Ee);var De=Ee;this.x1=De.x1,this.y1=De.y1,this.x2=De.x2,this.y2=De.y2},Me.prototype.scale=function(Ee,De){je.prototype.scale.call(this,Ee,De),this.x1=this.x1*Ee,this.y1=this.y1*De,this.x2=this.x2*Ee,this.y2=this.y2*De,this.adjustVisual(),this.adjustControlBox()},Me}(de),ut=function(je){function Me(Ee,De,We){var Ae=je.call(this,Ee,De,We)||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=We.defaultColor,Ae.strokeWidth=We.defaultStrokeWidth,Ae.strokeDasharray=We.defaultStrokeDasharray,Ae.strokePanel=new te("Line color",We.defaultColorSet,We.defaultColor),Ae.strokePanel.onColorChanged=Ae.setStrokeColor,Ae.strokeWidthPanel=new Ie("Line width",We.defaultStrokeWidths,We.defaultStrokeWidth),Ae.strokeWidthPanel.onWidthChanged=Ae.setStrokeWidth,Ae.strokeStylePanel=new Re("Line style",We.defaultStrokeDasharrays,We.defaultStrokeDasharray),Ae.strokeStylePanel.onStyleChanged=Ae.setStrokeDasharray,Ae}return Ke(Me,je),Me.prototype.ownsTarget=function(Ee){return!(!je.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,De){je.prototype.pointerDown.call(this,Ee,De),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},je.prototype.getState.call(this));return Ee.typeName=Me.typeName,Ee},Me.prototype.restoreState=function(Ee){je.prototype.restoreState.call(this,Ee);var De=Ee;this.strokeColor=De.strokeColor,this.strokeWidth=De.strokeWidth,this.strokeDasharray=De.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),tt=function(je){function Me(Ee,De,We,Ae){var Je=je.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 Je.fonts=[],Je.fontBoxes=[],Je.fonts=De,Je.currentFont=We,Je.setCurrentFont=Je.setCurrentFont.bind(Je),Je}return Ke(Me,je),Me.prototype.getUi=function(){var Ee=this,De=document.createElement("div");return De.style.overflow="hidden",De.style.flexGrow="2",this.fonts.forEach(function(We){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=We===Ee.currentFont?Ee.uiStyleSettings.toolboxAccentColor:"transparent",Ae.addEventListener("click",function(){Ee.setCurrentFont(We,Ae)}),De.appendChild(Ae);var Je=document.createElement("div");Je.style.display="flex",Je.style.minHeight="20px",Je.style.flexGrow="2",Je.style.fontFamily=We,Je.style.overflow="hidden";var Nt=document.createElement("div");Nt.style.whiteSpace="nowrap",Nt.style.overflow="hidden",Nt.style.textOverflow="ellipsis",Nt.innerHTML="The quick brown fox jumps over the lazy dog",Je.appendChild(Nt),Ae.appendChild(Je),Ee.fontBoxes.push(Ae)}),De},Me.prototype.setCurrentFont=function(Ee,De){var We=this;this.currentFont=Ee,this.fontBoxes.forEach(function(Ae){Ae.style.borderColor=Ae===De?We.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},Me}(ne),wt=function(je){function Me(Ee,De,We){var Ae=je.call(this,Ee,De,We)||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=We.defaultColor,Ae.fontFamily=We.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",We.defaultColorSet,We.defaultColor),Ae.colorPanel.onColorChanged=Ae.setColor,Ae.fontFamilyPanel=new tt("Font",We.defaultFontFamilies,We.defaultFontFamily),Ae.fontFamilyPanel.onFontChanged=Ae.setFont,Ae}return Ke(Me,je),Me.prototype.ownsTarget=function(Ee){if(je.prototype.ownsTarget.call(this,Ee)||Ee===this.visual||Ee===this.textElement||Ee===this.bgRectangle)return!0;var De=!1;return this.textElement.childNodes.forEach(function(We){We===Ee&&(De=!0)}),De},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,De){je.prototype.pointerDown.call(this,Ee,De),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(De){Ee.textElement.appendChild(Oe.createTSpan(De.trim()===""?" ":De.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},Me.prototype.getTextScale=function(){var Ee=this.textElement.getBBox(),De=1;if(Ee.width>0&&Ee.height>0){var We=(1*this.width-this.width*this.padding*2/100)/Ee.width,Ae=(1*this.height-this.height*this.padding*2/100)/Ee.height;De=Math.min(We,Ae)}return De},Me.prototype.getTextPosition=function(Ee){var De=this.textElement.getBBox(),We=0,Ae=0;return De.width>0&&De.height>0&&(We=(this.width-De.width*Ee)/2,Ae=this.height/2-De.height*Ee/2),{x:We,y:Ae}},Me.prototype.sizeText=function(){var Ee=this.textElement.getBBox(),De=this.getTextScale(),We=this.getTextPosition(De);We.y-=Ee.y*De,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+We.x+"px, "+We.y+"px) scale("+De+", "+De+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(We.x,We.y),this.textElement.transform.baseVal.getItem(1).setScale(De,De))},Me.prototype.manipulate=function(Ee){je.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){je.prototype.resize.call(this,Ee),this.isMoved=!0,this.setSize(),this.sizeText()},Me.prototype.setSize=function(){je.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 De=this.state;De==="creating"&&(this._suppressMarkerCreateEvent=!0),je.prototype.pointerUp.call(this,Ee),this.setSize(),(De==="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(De){De.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var De=Number.parseFloat(Ee.textEditor.style.fontSize);Ee.textEditor.clientWidth>=Number.parseInt(Ee.textEditor.style.maxWidth)&&De>.9;)De-=.1,Ee.textEditor.style.fontSize=Math.max(De,.9)+"em"}),this.textEditor.addEventListener("keyup",function(De){De.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(De){if(De.clipboardData){var We=De.clipboardData.getData("text"),Ae=window.getSelection();if(!Ae.rangeCount)return!1;Ae.deleteFromDocument(),Ae.getRangeAt(0).insertNode(document.createTextNode(We)),De.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(),De=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),We=this.textElement.getBBox(),Ae={x:We.width*Ee,y:We.height*Ee};De.x-=Ae.x/2,De.y-=Ae.y/2,this.textEditor.style.top=De.y+"px",this.textEditor.style.left=De.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-De.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(){je.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},Me.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),je.prototype.deselect.call(this)},Me.prototype.dblClick=function(Ee,De){je.prototype.dblClick.call(this,Ee,De),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},je.prototype.getState.call(this));return Ee.typeName=Me.typeName,Ee},Me.prototype.restoreState=function(Ee){var De=Ee;this.color=De.color,this.fontFamily=De.fontFamily,this.padding=De.padding,this.text=De.text,this.createVisual(),je.prototype.restoreState.call(this,Ee),this.setSize()},Me.prototype.scale=function(Ee,De){je.prototype.scale.call(this,Ee,De),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),St=function(je){function Me(Ee,De,We){var Ae=je.call(this,Ee,De,We)||this;return Ae.color="transparent",Ae.lineWidth=3,Ae.drawing=!1,Ae.pixelRatio=1,Ae.color=We.defaultColor,Ae.lineWidth=We.defaultStrokeWidth,Ae.pixelRatio=We.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",We.defaultColorSet,We.defaultColor),Ae.colorPanel.onColorChanged=Ae.setColor,Ae.lineWidthPanel=new Ie("Line width",We.defaultStrokeWidths,We.defaultStrokeWidth),Ae.lineWidthPanel.onWidthChanged=Ae.setLineWidth,Ae}return Ke(Me,je),Me.prototype.ownsTarget=function(Ee){return!(!je.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,De){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):je.prototype.pointerDown.call(this,Ee,De)},Me.prototype.manipulate=function(Ee){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(Ee.x,Ee.y),this.canvasContext.stroke()):je.prototype.manipulate.call(this,Ee)},Me.prototype.resize=function(Ee){je.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()):je.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(),je.prototype.select.call(this)},Me.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),je.prototype.deselect.call(this)},Me.prototype.finishCreation=function(){for(var Ee=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),De=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],We=De[0],Ae=De[1],Je=De[2],Nt=De[3],fn=!1,vn=0;vn<this.canvasElement.height;vn++)for(var Ft=0;Ft<this.canvasElement.width;Ft++)Ee.data[vn*this.canvasElement.width*4+4*Ft+3]>0&&(fn=!0,vn<Ae&&(Ae=vn),Ft<We&&(We=Ft),vn>Nt&&(Nt=vn),Ft>Je&&(Je=Ft));if(fn){this.left=We/this.pixelRatio,this.top=Ae/this.pixelRatio,this.width=(Je-We)/this.pixelRatio,this.height=(Nt-Ae)/this.pixelRatio;var Jt=document.createElement("canvas");Jt.width=Je-We,Jt.height=Nt-Ae,Jt.getContext("2d").putImageData(this.canvasContext.getImageData(We,Ae,Je-We,Nt-Ae),0,0),this.drawingImgUrl=Jt.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},je.prototype.getState.call(this));return Ee.typeName=Me.typeName,Ee},Me.prototype.restoreState=function(Ee){this.createVisual(),je.prototype.restoreState.call(this,Ee),this.drawingImgUrl=Ee.drawingImgUrl,this.setDrawingImage()},Me.prototype.scale=function(Ee,De){je.prototype.scale.call(this,Ee,De),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),Lt=function(je){function Me(Ee,De,We){var Ae=je.call(this,Ee,We||'<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=De,Ae.setCurrentType=Ae.setCurrentType.bind(Ae),Ae}return Ke(Me,je),Me.prototype.getUi=function(){var Ee=this,De=document.createElement("div");De.style.display="flex",De.style.overflow="hidden",De.style.flexGrow="2";for(var We=function(Nt){var fn="both";switch(Nt){case 0:fn="both";break;case 1:fn="start";break;case 2:fn="end";break;case 3:fn="none"}var vn=document.createElement("div");if(vn.style.display="flex",vn.style.flexGrow="2",vn.style.alignItems="center",vn.style.justifyContent="space-between",vn.style.padding="5px",vn.style.borderWidth="2px",vn.style.borderStyle="solid",vn.style.borderColor=fn===Ae.currentType?Ae.uiStyleSettings.toolboxAccentColor:"transparent",vn.addEventListener("click",function(){Ee.setCurrentType(fn,vn)}),De.appendChild(vn),fn==="both"||fn==="start"){var Ft=document.createElement("div");Ft.style.display="flex",Ft.style.alignItems="center",Ft.style.minHeight="20px",Ft.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>`,Ft.style.marginLeft="5px",vn.appendChild(Ft)}var Jt=document.createElement("div");Jt.style.display="flex",Jt.style.alignItems="center",Jt.style.minHeight="20px",Jt.style.flexGrow="2";var jt=document.createElement("hr");if(jt.style.minWidth="20px",jt.style.border="0px",jt.style.borderTop="3px solid "+(Ae.uiStyleSettings!==void 0?Ae.uiStyleSettings.toolboxColor:"#eeeeee"),jt.style.flexGrow="2",Jt.appendChild(jt),vn.appendChild(Jt),fn==="both"||fn==="end"){var pn=document.createElement("div");pn.style.display="flex",pn.style.alignItems="center",pn.style.minHeight="20px",pn.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>`,pn.style.marginRight="5px",vn.appendChild(pn)}Ae.typeBoxes.push(vn)},Ae=this,Je=0;Je<4;Je++)We(Je);return De},Me.prototype.setCurrentType=function(Ee,De){var We=this;this.currentType=Ee,this.typeBoxes.forEach(function(Ae){Ae.style.borderColor=Ae===De?We.uiStyleSettings!==void 0?We.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},Me}(ne),mn=function(je){function Me(Ee,De,We){var Ae=je.call(this,Ee,De,We)||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 Lt("Arrow type","end"),Ae.arrowTypePanel.onArrowTypeChanged=Ae.setArrowType,Ae}return Ke(Me,je),Me.prototype.ownsTarget=function(Ee){return!(!je.prototype.ownsTarget.call(this,Ee)&&Ee!==this.arrow1&&Ee!==this.arrow2)},Me.prototype.getArrowPoints=function(Ee,De){var We=this.arrowBaseWidth+2*this.strokeWidth,Ae=this.arrowBaseHeight+2*this.strokeWidth;return Ee-We/2+","+(De+Ae/2)+" "+Ee+","+(De-Ae/2)+" "+(Ee+We/2)+","+(De+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,De){je.prototype.pointerDown.call(this,Ee,De),this.state==="creating"&&this.createTips()},Me.prototype.adjustVisual=function(){if(je.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 De=this.arrow1.transform.baseVal.getItem(0);De.setRotate(Ee,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(De,0);var We=this.arrow2.transform.baseVal.getItem(0);We.setRotate(Ee+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(We,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},je.prototype.getState.call(this));return Ee.typeName=Me.typeName,Ee},Me.prototype.restoreState=function(Ee){je.prototype.restoreState.call(this,Ee);var De=Ee;this.arrowType=De.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}(ut),$t=function(je){function Me(Ee,De,We){var Ae=je.call(this,Ee,De,We)||this;return Ae.fillColor=We.defaultFillColor,Ae.strokeWidth=0,Ae.fillPanel=new te("Color",We.defaultColorSet,We.defaultFillColor),Ae.fillPanel.onColorChanged=Ae.setFillColor,Ae}return Ke(Me,je),Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),Me.prototype.getState=function(){var Ee=je.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}(be),Pn=function(je){function Me(Ee,De,We,Ae){var Je=je.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 Je.opacities=[],Je.opacityBoxes=[],Je.opacities=De,Je.currentOpacity=We,Je.setCurrentOpacity=Je.setCurrentOpacity.bind(Je),Je}return Ke(Me,je),Me.prototype.getUi=function(){var Ee=this,De=document.createElement("div");return De.style.display="flex",De.style.overflow="hidden",De.style.flexGrow="2",De.style.justifyContent="space-between",this.opacities.forEach(function(We){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=We===Ee.currentOpacity?Ee.uiStyleSettings.toolboxAccentColor:"transparent",Ae.addEventListener("click",function(){Ee.setCurrentOpacity(We,Ae)}),De.appendChild(Ae);var Je=document.createElement("div");Je.innerText=100*We+"%",Ae.appendChild(Je),Ee.opacityBoxes.push(Ae)}),De},Me.prototype.setCurrentOpacity=function(Ee,De){var We=this;this.currentOpacity=Ee,this.opacityBoxes.forEach(function(Ae){Ae.style.borderColor=Ae===De?We.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},Me}(ne),Ot=function(je){function Me(Ee,De,We){var Ae=je.call(this,Ee,De,We)||this;return Ae.setOpacity=Ae.setOpacity.bind(Ae),Ae.fillColor=We.defaultHighlightColor,Ae.strokeWidth=0,Ae.opacity=We.defaultHighlightOpacity,Ae.fillPanel=new te("Color",We.defaultColorSet,Ae.fillColor),Ae.fillPanel.onColorChanged=Ae.setFillColor,Ae.opacityPanel=new Pn("Opacity",We.defaultOpacitySteps,Ae.opacity),Ae.opacityPanel.onOpacityChanged=Ae.setOpacity,Ae}return Ke(Me,je),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=je.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}($t),ct='<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>',nt='<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>',gn=function(je){function Me(Ee,De,We){var Ae=je.call(this,Ee,De,We)||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=We.defaultStrokeColor,Ae.bgColor=We.defaultFillColor,Ae.fontFamily=We.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",We.defaultColorSet,Ae.color,ct),Ae.colorPanel.onColorChanged=Ae.setColor,Ae.bgColorPanel=new te("Fill color",We.defaultColorSet,Ae.bgColor,nt),Ae.bgColorPanel.onColorChanged=Ae.setBgColor,Ae.fontFamilyPanel=new tt("Font",We.defaultFontFamilies,We.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 Ke(Me,je),Me.prototype.ownsTarget=function(Ee){return je.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,De){this.state==="new"&&je.prototype.pointerDown.call(this,Ee,De),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(De)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):je.prototype.pointerDown.call(this,Ee,De)},Me.prototype.pointerUp=function(Ee){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,je.prototype.pointerUp.call(this,Ee);else{var De=this.state==="creating";je.prototype.pointerUp.call(this,Ee),this.setTipPoints(De),this.positionTip()}},Me.prototype.manipulate=function(Ee){if(this.tipMoving){var De=this.unrotatePoint(Ee);this.tipPosition={x:De.x-this.manipulationStartLeft,y:De.y-this.manipulationStartTop},this.positionTip()}else je.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 De=Math.min(this.height/2,15),We=this.height/5;Ee&&(this.tipPosition={x:De+We/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))?(We=this.width/5,De=Math.min(this.width/2,15),this.tipBase1Position={x:De,y:0},this.tipBase2Position={x:De+We,y:0}):(this.tipBase1Position={x:0,y:De},this.tipBase2Position={x:0,y:De+We}):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))?(We=this.width/5,De=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-De-We,y:0},this.tipBase2Position={x:this.width-De,y:0}):(this.tipBase1Position={x:this.width,y:De},this.tipBase2Position={x:this.width,y:De+We}):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))?(We=this.width/5,De=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-De-We,y:this.height},this.tipBase2Position={x:this.width-De,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-De-We},this.tipBase2Position={x:this.width,y:this.height-De}):Ae<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(We=this.width/5,De=Math.min(this.width/2,15),this.tipBase1Position={x:De,y:this.height},this.tipBase2Position={x:De+We,y:this.height}):(this.tipBase1Position={x:0,y:this.height-De},this.tipBase2Position={x:0,y:this.height-De-We})},Me.prototype.resize=function(Ee){je.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(),je.prototype.select.call(this)},Me.prototype.getState=function(){var Ee=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},je.prototype.getState.call(this));return Ee.typeName=Me.typeName,Ee},Me.prototype.restoreState=function(Ee){var De=Ee;this.bgColor=De.bgColor,this.tipPosition=De.tipPosition,je.prototype.restoreState.call(this,Ee),this.createTip(),this.setTipPoints()},Me.prototype.scale=function(Ee,De){je.prototype.scale.call(this,Ee,De),this.tipPosition={x:this.tipPosition.x*Ee,y:this.tipPosition.y*De},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}(wt),oi=function(je){function Me(Ee,De,We){var Ae=je.call(this,Ee,De,We)||this;return Ae.fillColor="transparent",Ae.strokeColor="transparent",Ae.strokeWidth=0,Ae.strokeDasharray="",Ae.opacity=1,Ae.strokeColor=We.defaultColor,Ae.strokeWidth=We.defaultStrokeWidth,Ae.strokeDasharray=We.defaultStrokeDasharray,Ae.fillColor=We.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",mt(We.defaultColorSet,["transparent"]),We.defaultColor),Ae.strokePanel.onColorChanged=Ae.setStrokeColor,Ae.fillPanel=new te("Fill color",mt(We.defaultColorSet,["transparent"]),Ae.fillColor,nt),Ae.fillPanel.onColorChanged=Ae.setFillColor,Ae.strokeWidthPanel=new Ie("Line width",We.defaultStrokeWidths,We.defaultStrokeWidth),Ae.strokeWidthPanel.onWidthChanged=Ae.setStrokeWidth,Ae.strokeStylePanel=new Re("Line style",We.defaultStrokeDasharrays,We.defaultStrokeDasharray),Ae.strokeStylePanel.onStyleChanged=Ae.setStrokeDasharray,Ae.opacityPanel=new Pn("Opacity",We.defaultOpacitySteps,Ae.opacity),Ae.opacityPanel.onOpacityChanged=Ae.setOpacity,Ae}return Ke(Me,je),Me.prototype.ownsTarget=function(Ee){return!(!je.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,De){je.prototype.pointerDown.call(this,Ee,De),this.state==="new"&&(this.createVisual(),this.moveVisual(Ee),this._state="creating")},Me.prototype.manipulate=function(Ee){je.prototype.manipulate.call(this,Ee)},Me.prototype.resize=function(Ee){je.prototype.resize.call(this,Ee),this.setSize()},Me.prototype.setSize=function(){je.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){je.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},je.prototype.getState.call(this));return Ee.typeName=Me.typeName,Ee},Me.prototype.restoreState=function(Ee){var De=Ee;this.fillColor=De.fillColor,this.strokeColor=De.strokeColor,this.strokeWidth=De.strokeWidth,this.strokeDasharray=De.strokeDasharray,this.opacity=De.opacity,this.createVisual(),je.prototype.restoreState.call(this,Ee),this.setSize()},Me.prototype.scale=function(Ee,De){je.prototype.scale.call(this,Ee,De),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),zn=function(je){function Me(Ee,De,We){return je.call(this,Ee,De,We)||this}return Ke(Me,je),Object.defineProperty(Me.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),Me.prototype.ownsTarget=function(Ee){return!(!je.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,De){je.prototype.pointerDown.call(this,Ee,De),this.state==="creating"&&this.createTips()},Me.prototype.adjustVisual=function(){if(je.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),De=this.tip1.transform.baseVal.getItem(0);De.setRotate(Ee,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(De,0);var We=this.tip2.transform.baseVal.getItem(0);We.setRotate(Ee+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(We,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=je.prototype.getState.call(this);return Ee.typeName=Me.typeName,Ee},Me.prototype.restoreState=function(Ee){je.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}(ut),Ht=function(je){function Me(Ee,De,We){var Ae=je.call(this,Ee,De,We)||this;return Ae.strokePanel.colors=We.defaultColorSet,Ae.fillColor="transparent",Ae}return Ke(Me,je),Object.defineProperty(Me.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Me.prototype.getState=function(){var Ee=je.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}(oi),Fn=function(){function je(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(je.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(je.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(je.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(je.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),je.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))},je.prototype.replaceLastUndoStep=function(Me){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=Me)},je.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},je.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}},je.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},je}(),Cn=function(je){function Me(Ee,De,We){var Ae=je.call(this,Ee,De,We)||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=We.defaultColor,Ae.strokeWidth=We.defaultStrokeWidth,Ae.strokeDasharray=We.defaultStrokeDasharray,Ae.strokePanel=new te("Line color",We.defaultColorSet,We.defaultColor),Ae.strokePanel.onColorChanged=Ae.setStrokeColor,Ae.strokeWidthPanel=new Ie("Line width",We.defaultStrokeWidths,We.defaultStrokeWidth),Ae.strokeWidthPanel.onWidthChanged=Ae.setStrokeWidth,Ae.strokeStylePanel=new Re("Line style",We.defaultStrokeDasharrays,We.defaultStrokeDasharray),Ae.strokeStylePanel.onStyleChanged=Ae.setStrokeDasharray,Ae}return Ke(Me,je),Me.prototype.ownsTarget=function(Ee){return!(!je.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,De){je.prototype.pointerDown.call(this,Ee,De),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(De)&&(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(){je.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,je.prototype.addControlGrips.call(this)},Me.prototype.positionGrips=function(){je.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),je.prototype.manipulate.call(this,Ee)},Me.prototype.resize=function(Ee){this.activeGrip===this.curveGrip&&(this.curveX=Ee.x,this.curveY=Ee.y),je.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,De){this.curveX=this.curveX*Ee,this.curveY=this.curveY*De,je.prototype.scale.call(this,Ee,De)},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},je.prototype.getState.call(this));return Ee.typeName=Me.typeName,Ee},Me.prototype.restoreState=function(Ee){je.prototype.restoreState.call(this,Ee);var De=Ee;this.strokeColor=De.strokeColor,this.strokeWidth=De.strokeWidth,this.strokeDasharray=De.strokeDasharray,this.curveX=De.curveX,this.curveY=De.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),ii=function(je){function Me(Ee,De,We){var Ae=je.call(this,Ee,De,We)||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=We.defaultColor,Ae.strokeWidth=We.defaultStrokeWidth,Ae.strokeDasharray=We.defaultStrokeDasharray,Ae.fillColor=We.defaultFillColor,Ae.textColor=We.defaultStrokeColor,Ae.fontFamily=We.defaultFontFamily,Ae.fontSize=We.defaultCaptionFontSize,Ae.captionText=We.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",mt(We.defaultColorSet,["transparent"]),Ae.strokeColor),Ae.strokePanel.onColorChanged=Ae.setStrokeColor,Ae.fillPanel=new te("Fill color",mt(We.defaultColorSet,["transparent"]),Ae.fillColor,nt),Ae.fillPanel.onColorChanged=Ae.setFillColor,Ae.strokeWidthPanel=new Ie("Line width",We.defaultStrokeWidths,We.defaultStrokeWidth),Ae.strokeWidthPanel.onWidthChanged=Ae.setStrokeWidth,Ae.strokeStylePanel=new Re("Line style",We.defaultStrokeDasharrays,We.defaultStrokeDasharray),Ae.strokeStylePanel.onStyleChanged=Ae.setStrokeDasharray,Ae.fontFamilyPanel=new tt("Font",We.defaultFontFamilies,We.defaultFontFamily),Ae.fontFamilyPanel.onFontChanged=Ae.setFont,Ae.textColorPanel=new te("Text color",We.defaultColorSet,Ae.textColor,ct),Ae.textColorPanel.onColorChanged=Ae.setTextColor,Ae}return Ke(Me,je),Me.prototype.ownsTarget=function(Ee){return!(!je.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,De){je.prototype.pointerDown.call(this,Ee,De),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){je.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){je.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(De){De.stopPropagation()}),this.textEditBox.addEventListener("keypress",function(De){De.key==="Enter"&&Ee.finishTextEditing(Ee.textEditBox.value)}),this.textEditBox.addEventListener("keyup",function(De){De.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(){je.prototype.setSize.call(this),Oe.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},Me.prototype.pointerUp=function(Ee){je.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,De){je.prototype.dblClick.call(this,Ee,De),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},je.prototype.getState.call(this));return Ee.typeName=this.typeName,Ee},Me.prototype.restoreState=function(Ee){var De=Ee;this.fillColor=De.fillColor,this.strokeColor=De.strokeColor,this.strokeWidth=De.strokeWidth,this.strokeDasharray=De.strokeDasharray,this.textColor=De.textColor,this.fontFamily=De.fontFamily,this.captionText=De.captionText,this.fontSize=De.fontSize,this.createVisual(),je.prototype.restoreState.call(this,Ee),this.setSize()},Me.prototype.scale=function(Ee,De){je.prototype.scale.call(this,Ee,De),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),Wt=function(){function je(Me,Ee){Ee===void 0&&(Ee=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=Me,this.cancelable=Ee}return Object.defineProperty(je.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),je.prototype.preventDefault=function(){this._defaultPrevented=!0},je}(),Hn=function(je){function Me(Ee,De,We){var Ae=je.call(this,Ee,!1)||this;return Ae.dataUrl=De,Ae.state=We,Ae}return Ke(Me,je),Me}(Wt),lt=function(je){function Me(Ee,De,We){We===void 0&&(We=!1);var Ae=je.call(this,Ee,We)||this;return Ae.marker=De,Ae}return Ke(Me,je),Me}(Wt),An=function(){function je(){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 je.prototype.addEventListener=function(Me,Ee){this[Me].push(Ee)},je.prototype.removeEventListener=function(Me,Ee){var De=this[Me].indexOf(Ee);De>-1&&this[Me].splice(De,1)},je}(),Ni=function(){function je(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 et,this._isOpen=!1,this.undoRedoManager=new Fn,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 An,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=je.instanceCounter++,this.styles=new Ge(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(je.prototype,"ALL_MARKER_TYPES",{get:function(){return[rt,St,mn,wt,Ht,oi,Ot,gn,zn,$t,ut,Cn,ii]},enumerable:!1,configurable:!0}),Object.defineProperty(je.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[rt,St,mn,wt,oi,Ot,gn]},enumerable:!1,configurable:!0}),Object.defineProperty(je.prototype,"BASIC_MARKER_TYPES",{get:function(){return[rt,St,mn,wt,Ot]},enumerable:!1,configurable:!0}),Object.defineProperty(je.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(Me){var Ee=this;this._availableMarkerTypes.splice(0),Me.forEach(function(De){if(typeof De=="string"){var We=Ee.ALL_MARKER_TYPES.find(function(Ae){return Ae.typeName===De});We!==void 0&&Ee._availableMarkerTypes.push(We)}else Ee._availableMarkerTypes.push(De)})},enumerable:!1,configurable:!0}),Object.defineProperty(je.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(je.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(je.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(je.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(je.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(je.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),je.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},je.prototype.show=function(){var Me=this;this.styles.styleSheetRoot===void 0&&dt.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=dt.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(Ee){return Ee(new Wt(Me))})},je.prototype.render=function(){return ft(this,void 0,void 0,function(){var Me;return yt(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()]}})})},je.prototype.close=function(Me){var Ee=this;if(Me===void 0&&(Me=!1),this.isOpen){var De=!1;Me||this.eventListeners.beforeclose.forEach(function(We){var Ae=new Wt(Ee,!0);We(Ae),Ae.defaultPrevented&&(De=!0)}),De||(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(We){return We(new Wt(Ee))}),this.detachEvents(),this._isOpen=!1)}},je.prototype.addMarkersToToolbar=function(){for(var Me,Ee=[],De=0;De<arguments.length;De++)Ee[De]=arguments[De];(Me=this._availableMarkerTypes).push.apply(Me,Ee)},je.prototype.addRenderEventListener=function(Me){this.addEventListener("render",function(Ee){Me(Ee.dataUrl,Ee.state)})},je.prototype.removeRenderEventListener=function(Me){},je.prototype.addCloseEventListener=function(Me){this.addEventListener("close",function(){Me()})},je.prototype.removeCloseEventListener=function(Me){},je.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))},je.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,De=Ee<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/Me;this.resize(Ee,De)},je.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},je.prototype.resize=function(Me,Ee){this._isResizing=!0;var De=Me/this.imageWidth,We=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(De,We),this._isResizing=!1},je.prototype.scaleMarkers=function(Me,Ee){var De,We=this;this._currentMarker&&this._currentMarker instanceof wt?this._currentMarker.scale(Me,Ee):(De=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Ae){Ae!==We._currentMarker&&Ae.scale(Me,Ee)}),De!==void 0&&this.setCurrentMarker(De)},je.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"},je.prototype.setTopLeft=function(){var Me=this.editingTarget.getBoundingClientRect(),Ee=this.editorCanvas.getBoundingClientRect();this.left=Me.left-Ee.left,this.top=Me.top-Ee.top},je.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)},je.prototype.addDefs=function(){for(var Me,Ee=[],De=0;De<arguments.length;De++)Ee[De]=arguments[De];this.defs=Oe.createDefs(),this.addDefsToImage(),(Me=this.defs).append.apply(Me,Ee)},je.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},je.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)},je.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},je.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},je.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)},je.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},je.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)},je.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()},je.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")},je.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"},je.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},je.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 At(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 Te(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},je.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},je.prototype.removeMarker=function(Me){this.markerImage.removeChild(Me.container),this.markers.indexOf(Me)>-1&&this.markers.splice(this.markers.indexOf(Me),1),Me.dispose()},je.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())},je.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()}},je.prototype.deleteSelectedMarker=function(){var Me=this;if(this._currentMarker!==void 0){var Ee=!1;if(this.eventListeners.markerbeforedelete.forEach(function(We){var Ae=new lt(Me,Me._currentMarker,!0);We(Ae),Ae.defaultPrevented&&(Ee=!0)}),!Ee){var De=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(We){return We(new lt(Me,De))})}}},je.prototype.clear=function(){var Me=this,Ee=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Je){var Nt=new lt(Me,void 0,!0);Je(Nt),Nt.defaultPrevented&&(Ee=!0)}),!Ee)){this.setCurrentMarker();for(var De=function(Je){var Nt=We.markers[Je];We.setCurrentMarker(We.markers[Je]),We._currentMarker.dispose(),We.markerImage.removeChild(We._currentMarker.container),We.markers.splice(We.markers.indexOf(We._currentMarker),1),We.eventListeners.markerdelete.forEach(function(fn){return fn(new lt(Me,Nt))})},We=this,Ae=this.markers.length-1;Ae>=0;Ae--)De(Ae);this.addUndoStep()}},Object.defineProperty(je.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),je.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))},je.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)},je.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},je.prototype.addUndoStep=function(){var Me=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var Ee=this.getState(),De=this.undoRedoManager.getLastUndoStep();if(!De||De.width===Ee.width&&De.height===Ee.height){var We=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(Ee),We<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(Ae){return Ae(new Wt(Me))})}else this.undoRedoManager.replaceLastUndoStep(Ee),this.eventListeners.statechange.forEach(function(Ae){return Ae(new Wt(Me))})}},je.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},je.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(De){return De(new Wt(Me))}))},je.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},je.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(De){return De(new Wt(Me))}))},je.prototype.stepZoom=function(){var Me=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=Me<this.zoomSteps.length-1?this.zoomSteps[Me+1]:this.zoomSteps[0]},je.prototype.panTo=function(Me){this.contentDiv.scrollBy({left:this.prevPanPoint.x-Me.x,top:this.prevPanPoint.y-Me.y}),this.prevPanPoint=Me},je.prototype.startRenderAndClose=function(){return ft(this,void 0,void 0,function(){var Me,Ee,De=this;return yt(this,function(We){switch(We.label){case 0:return[4,this.render()];case 1:return Me=We.sent(),Ee=this.getState(),this.eventListeners.render.forEach(function(Ae){return Ae(new Hn(De,Me,Ee))}),this.close(!0),[2]}})})},je.prototype.getState=function(Me){Me===!0&&this.setCurrentMarker();var Ee={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(De){return Ee.markers.push(De.getState())}),Ee},je.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(De){var We=Ee._availableMarkerTypes.find(function(Je){return Je.typeName===De.typeName});if(We!==void 0){var Ae=Ee.addNewMarker(We);Ae.restoreState(De),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(De){return De(new Wt(Ee))})},je.prototype.addNewMarker=function(Me){var Ee=Oe.createGroup();return this.markerImage.appendChild(Ee),new Me(Ee,this.overlayContainer,this.settings)},je.prototype.createNewMarker=function(Me){var Ee,De=this;(Ee=typeof Me=="string"?this._availableMarkerTypes.find(function(We){return We.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(We){return We(new lt(De,De._currentMarker))}))},je.prototype.markerCreated=function(Me){var Ee=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(Me),this.setCurrentMarker(Me),Me instanceof St&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(St):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(De){return De(new lt(Ee,Ee._currentMarker))})},je.prototype.colorChanged=function(Me){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=Me,this.settings.defaultStrokeColor=Me)},je.prototype.fillColorChanged=function(Me){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=Me)},je.prototype.markerStateChanged=function(Me){var Ee=this;this.eventListeners.markerchange.forEach(function(De){return De(new lt(Ee,Me))})},je.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(De){return De(new lt(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(De){return De(new lt(Ee,Ee._currentMarker))}))},je.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(De){return De.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))},je.prototype.onDblClick=function(Me){if(this._isFocused||this.focus(),this.mode==="select"){var Ee=this.markers.find(function(De){return De.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()}},je.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}))},je.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()},je.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},je.prototype.onKeyUp=function(Me){this._currentMarker===void 0||this.notesArea!==void 0||Me.key!=="Delete"&&Me.key!=="Backspace"||this.deleteSelectedMarker()},je.prototype.clientToLocalCoordinates=function(Me,Ee){var De=this.markerImage.getBoundingClientRect();return{x:(Me-De.left)/this.zoomLevel,y:(Ee-De.top)/this.zoomLevel}},je.prototype.onWindowResize=function(){this.positionUI()},je.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()},je.prototype.addLicenseKey=function(Me){at.addKey(Me)},je.prototype.addEventListener=function(Me,Ee){this.eventListeners.addEventListener(Me,Ee)},je.prototype.removeEventListener=function(Me,Ee){this.eventListeners.removeEventListener(Me,Ee)},je.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(je.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),je.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 Wt(Me))}))},je.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 Wt(Me))}))},je.instanceCounter=0,je}()},63727:function(Un,ai,Le){"use strict";Le.d(ai,{s:function(){return Ft},default:function(){return fr}});var ue=Le(72308),Ke=Le(77321),ft=Le(80702),yt=Le(52487),mt=Le(74416),Oe=Le(45560),at=Le(69582),Ct=Le(6089),dt=Le(18929),Ge=Le(59301),Rt=Ge.createContext({}),ot=Rt,At=Le(62853),Te=Le(49618),ne="__rc_cascader_search_mark__",te=function(tn,hn,di){var Sn=di.label,Kt=Sn===void 0?"":Sn;return hn.some(function(gi){return String(gi[Kt]).toLowerCase().includes(tn.toLowerCase())})},de=function(tn,hn,di,Sn){return hn.map(function(Kt){return Kt[Sn.label]}).join(" / ")},se=function(tn,hn,di,Sn,Kt,gi){var Vi=Kt.filter,Pi=Vi===void 0?te:Vi,Ii=Kt.render,Fr=Ii===void 0?de:Ii,$n=Kt.limit,In=$n===void 0?50:$n,si=Kt.sort;return Ge.useMemo(function(){var Ti=[];if(!tn)return[];function Oi(zi,xr){var Ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;zi.forEach(function(_n){if(!(!si&&In!==!1&&In>0&&Ti.length>=In)){var ci=[].concat((0,ft.Z)(xr),[_n]),ar=_n[di.children],_r=Ce||_n.disabled;if((!ar||ar.length===0||gi)&&Pi(tn,ci,{label:di.label})){var $r;Ti.push((0,Ke.Z)((0,Ke.Z)({},_n),{},($r={disabled:_r},(0,Te.Z)($r,di.label,Fr(tn,ci,Sn,di)),(0,Te.Z)($r,ne,ci),(0,Te.Z)($r,di.children,void 0),$r)))}ar&&Oi(_n[di.children],ci,_r)}})}return Oi(hn,[]),si&&Ti.sort(function(zi,xr){return si(zi[ne],xr[ne],tn,di)}),In!==!1&&In>0?Ti.slice(0,In):Ti},[tn,hn,di,Sn,Fr,gi,Pi,si,In])},pe=se,ye="__RC_CASCADER_SPLIT__",we="SHOW_PARENT",be="SHOW_CHILD";function Ie(nn){return nn.join(ye)}function Re(nn){return nn.map(Ie)}function rt(nn){return nn.split(ye)}function et(nn){var tn=nn||{},hn=tn.label,di=tn.value,Sn=tn.children,Kt=di||"value";return{label:hn||"label",value:Kt,key:Kt,children:Sn||"children"}}function Ye(nn,tn){var hn,di;return(hn=nn.isLeaf)!==null&&hn!==void 0?hn:!((di=nn[tn.children])!==null&&di!==void 0&&di.length)}function ut(nn){var tn=nn.parentElement;if(tn){var hn=nn.offsetTop-tn.offsetTop;hn-tn.scrollTop<0?tn.scrollTo({top:hn}):hn+nn.offsetHeight-tn.scrollTop>tn.offsetHeight&&tn.scrollTo({top:hn+nn.offsetHeight-tn.offsetHeight})}}function tt(nn,tn){return nn.map(function(hn){var di;return(di=hn[ne])===null||di===void 0?void 0:di.map(function(Sn){return Sn[tn.value]})})}function wt(nn){return Array.isArray(nn)&&Array.isArray(nn[0])}function St(nn){return nn?wt(nn)?nn:(nn.length===0?[]:[nn]).map(function(tn){return Array.isArray(tn)?tn:[tn]}):[]}function Lt(nn,tn,hn){var di=new Set(nn),Sn=tn();return nn.filter(function(Kt){var gi=Sn[Kt],Vi=gi?gi.parent:null,Pi=gi?gi.children:null;return gi&&gi.node.disabled?!0:hn===be?!(Pi&&Pi.some(function(Ii){return Ii.key&&di.has(Ii.key)})):!(Vi&&!Vi.node.disabled&&di.has(Vi.key))})}function mn(nn,tn,hn){for(var di=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,Sn=tn,Kt=[],gi=function(){var Ii,Fr,$n,In=nn[Vi],si=(Ii=Sn)===null||Ii===void 0?void 0:Ii.findIndex(function(Oi){var zi=Oi[hn.value];return di?String(zi)===String(In):zi===In}),Ti=si!==-1?(Fr=Sn)===null||Fr===void 0?void 0:Fr[si]:null;Kt.push({value:($n=Ti==null?void 0:Ti[hn.value])!==null&&$n!==void 0?$n:In,index:si,option:Ti}),Sn=Ti==null?void 0:Ti[hn.children]},Vi=0;Vi<nn.length;Vi+=1)gi();return Kt}var $t=function(nn,tn,hn,di,Sn){return Ge.useMemo(function(){var Kt=Sn||function(gi){var Vi=di?gi.slice(-1):gi,Pi=" / ";return Vi.every(function(Ii){return["string","number"].includes((0,At.Z)(Ii))})?Vi.join(Pi):Vi.reduce(function(Ii,Fr,$n){var In=Ge.isValidElement(Fr)?Ge.cloneElement(Fr,{key:$n}):Fr;return $n===0?[In]:[].concat((0,ft.Z)(Ii),[Pi,In])},[])};return nn.map(function(gi){var Vi,Pi=mn(gi,tn,hn),Ii=Kt(Pi.map(function($n){var In,si=$n.option,Ti=$n.value;return(In=si==null?void 0:si[hn.label])!==null&&In!==void 0?In:Ti}),Pi.map(function($n){var In=$n.option;return In})),Fr=Ie(gi);return{label:Ii,value:Fr,key:Fr,valueCells:gi,disabled:(Vi=Pi[Pi.length-1])===null||Vi===void 0||(Vi=Vi.option)===null||Vi===void 0?void 0:Vi.disabled}})},[nn,tn,hn,Sn,di])};function Pn(nn,tn){return Ge.useCallback(function(hn){var di=[],Sn=[];return hn.forEach(function(Kt){var gi=mn(Kt,nn,tn);gi.every(function(Vi){return Vi.option})?Sn.push(Kt):di.push(Kt)}),[Sn,di]},[nn,tn])}var Ot=Le(34061),ct=function(nn,tn){var hn=Ge.useRef({options:[],info:{keyEntities:{},pathKeyEntities:{}}}),di=Ge.useCallback(function(){return hn.current.options!==nn&&(hn.current.options=nn,hn.current.info=(0,Ot.I8)(nn,{fieldNames:tn,initWrapper:function(Kt){return(0,Ke.Z)((0,Ke.Z)({},Kt),{},{pathKeyEntities:{}})},processEntity:function(Kt,gi){var Vi=Kt.nodes.map(function(Pi){return Pi[tn.value]}).join(ye);gi.pathKeyEntities[Vi]=Kt,Kt.key=Vi}})),hn.current.info.pathKeyEntities},[tn,nn]);return di};function nt(nn,tn){var hn=Ge.useMemo(function(){return tn||[]},[tn]),di=ct(hn,nn),Sn=Ge.useCallback(function(Kt){var gi=di();return Kt.map(function(Vi){var Pi=gi[Vi].nodes;return Pi.map(function(Ii){return Ii[nn.value]})})},[di,nn]);return[hn,di,Sn]}var gn=Le(48736);function oi(nn){return Ge.useMemo(function(){if(!nn)return[!1,{}];var tn={matchInputWidth:!0,limit:50};return nn&&(0,At.Z)(nn)==="object"&&(tn=(0,Ke.Z)((0,Ke.Z)({},tn),nn)),tn.limit<=0&&(tn.limit=!1),[!0,tn]},[nn])}var zn=Le(34643);function Ht(nn,tn,hn,di,Sn,Kt,gi,Vi){return function(Pi){if(!nn)tn(Pi);else{var Ii=Ie(Pi),Fr=Re(hn),$n=Re(di),In=Fr.includes(Ii),si=Sn.some(function(_r){return Ie(_r)===Ii}),Ti=hn,Oi=Sn;if(si&&!In)Oi=Sn.filter(function(_r){return Ie(_r)!==Ii});else{var zi=In?Fr.filter(function(_r){return _r!==Ii}):[].concat((0,ft.Z)(Fr),[Ii]),xr=Kt(),Ce;if(In){var _n=(0,zn.S)(zi,{checked:!1,halfCheckedKeys:$n},xr);Ce=_n.checkedKeys}else{var ci=(0,zn.S)(zi,!0,xr);Ce=ci.checkedKeys}var ar=Lt(Ce,Kt,Vi);Ti=gi(ar)}tn([].concat((0,ft.Z)(Oi),(0,ft.Z)(Ti)))}}}function Fn(nn,tn,hn,di,Sn){return Ge.useMemo(function(){var Kt=Sn(tn),gi=(0,yt.Z)(Kt,2),Vi=gi[0],Pi=gi[1];if(!nn||!tn.length)return[Vi,[],Pi];var Ii=Re(Vi),Fr=hn(),$n=(0,zn.S)(Ii,!0,Fr),In=$n.checkedKeys,si=$n.halfCheckedKeys;return[di(In),di(si),Pi]},[nn,tn,hn,di,Sn])}var Cn=Le(92310),ii=Le.n(Cn),Wt=Ge.memo(function(nn){var tn=nn.children;return tn},function(nn,tn){return!tn.open}),Hn=Wt;function lt(nn){var tn,hn=nn.prefixCls,di=nn.checked,Sn=nn.halfChecked,Kt=nn.disabled,gi=nn.onClick,Vi=nn.disableCheckbox,Pi=Ge.useContext(ot),Ii=Pi.checkable,Fr=typeof Ii!="boolean"?Ii:null;return Ge.createElement("span",{className:ii()("".concat(hn),(tn={},(0,Te.Z)(tn,"".concat(hn,"-checked"),di),(0,Te.Z)(tn,"".concat(hn,"-indeterminate"),!di&&Sn),(0,Te.Z)(tn,"".concat(hn,"-disabled"),Kt||Vi),tn)),onClick:gi},Fr)}var An="__cascader_fix_label__";function Ni(nn){var tn=nn.prefixCls,hn=nn.multiple,di=nn.options,Sn=nn.activeValue,Kt=nn.prevValuePath,gi=nn.onToggleOpen,Vi=nn.onSelect,Pi=nn.onActive,Ii=nn.checkedSet,Fr=nn.halfCheckedSet,$n=nn.loadingKeys,In=nn.isSelectable,si=nn.disabled,Ti="".concat(tn,"-menu"),Oi="".concat(tn,"-menu-item"),zi=Ge.useContext(ot),xr=zi.fieldNames,Ce=zi.changeOnSelect,_n=zi.expandTrigger,ci=zi.expandIcon,ar=zi.loadingIcon,_r=zi.dropdownMenuColumnStyle,$r=zi.optionRender,po=_n==="hover",fi=function(Tt){return si||Tt},Qn=Ge.useMemo(function(){return di.map(function(Bt){var Tt,kt=Bt.disabled,ui=Bt.disableCheckbox,Yn=Bt[ne],vi=(Tt=Bt[An])!==null&&Tt!==void 0?Tt:Bt[xr.label],yn=Bt[xr.value],Kn=Ye(Bt,xr),It=Yn?Yn.map(function(Dn){return Dn[xr.value]}):[].concat((0,ft.Z)(Kt),[yn]),_t=Ie(It),hi=$n.includes(_t),it=Ii.has(_t),sn=Fr.has(_t);return{disabled:kt,label:vi,value:yn,isLeaf:Kn,isLoading:hi,checked:it,halfChecked:sn,option:Bt,disableCheckbox:ui,fullPath:It,fullPathKey:_t}})},[di,Ii,xr,Fr,$n,Kt]);return Ge.createElement("ul",{className:Ti,role:"menu"},Qn.map(function(Bt){var Tt,kt=Bt.disabled,ui=Bt.label,Yn=Bt.value,vi=Bt.isLeaf,yn=Bt.isLoading,Kn=Bt.checked,It=Bt.halfChecked,_t=Bt.option,hi=Bt.fullPath,it=Bt.fullPathKey,sn=Bt.disableCheckbox,Dn=function(){if(!fi(kt)){var an=(0,ft.Z)(hi);po&&vi&&an.pop(),Pi(an)}},Di=function(){In(_t)&&!fi(kt)&&Vi(hi,vi)},cn;return typeof _t.title=="string"?cn=_t.title:typeof ui=="string"&&(cn=ui),Ge.createElement("li",{key:it,className:ii()(Oi,(Tt={},(0,Te.Z)(Tt,"".concat(Oi,"-expand"),!vi),(0,Te.Z)(Tt,"".concat(Oi,"-active"),Sn===Yn||Sn===it),(0,Te.Z)(Tt,"".concat(Oi,"-disabled"),fi(kt)),(0,Te.Z)(Tt,"".concat(Oi,"-loading"),yn),Tt)),style:_r,role:"menuitemcheckbox",title:cn,"aria-checked":Kn,"data-path-key":it,onClick:function(){Dn(),!sn&&(!hn||vi)&&Di()},onDoubleClick:function(){Ce&&gi(!1)},onMouseEnter:function(){po&&Dn()},onMouseDown:function(an){an.preventDefault()}},hn&&Ge.createElement(lt,{prefixCls:"".concat(tn,"-checkbox"),checked:Kn,halfChecked:It,disabled:fi(kt)||sn,disableCheckbox:sn,onClick:function(an){sn||(an.stopPropagation(),Di())}}),Ge.createElement("div",{className:"".concat(Oi,"-content")},$r?$r(_t):ui),!yn&&ci&&!vi&&Ge.createElement("div",{className:"".concat(Oi,"-expand-icon")},ci),yn&&ar&&Ge.createElement("div",{className:"".concat(Oi,"-loading-icon")},ar))}))}var je=function(tn,hn){var di=Ge.useContext(ot),Sn=di.values,Kt=Sn[0],gi=Ge.useState([]),Vi=(0,yt.Z)(gi,2),Pi=Vi[0],Ii=Vi[1];return Ge.useEffect(function(){tn||Ii(Kt||[])},[hn,Kt]),[Pi,Ii]},Me=je,Ee=Le(10228),De=function(nn,tn,hn,di,Sn,Kt,gi){var Vi=gi.direction,Pi=gi.searchValue,Ii=gi.toggleOpen,Fr=gi.open,$n=Vi==="rtl",In=Ge.useMemo(function(){for(var _r=-1,$r=tn,po=[],fi=[],Qn=di.length,Bt=tt(tn,hn),Tt=function(yn){var Kn=$r.findIndex(function(It,_t){return(Bt[_t]?Ie(Bt[_t]):It[hn.value])===di[yn]});if(Kn===-1)return 1;_r=Kn,po.push(_r),fi.push(di[yn]),$r=$r[_r][hn.children]},kt=0;kt<Qn&&$r&&!Tt(kt);kt+=1);for(var ui=tn,Yn=0;Yn<po.length-1;Yn+=1)ui=ui[po[Yn]][hn.children];return[fi,_r,ui,Bt]},[di,hn,tn]),si=(0,yt.Z)(In,4),Ti=si[0],Oi=si[1],zi=si[2],xr=si[3],Ce=function($r){Sn($r)},_n=function($r){var po=zi.length,fi=Oi;fi===-1&&$r<0&&(fi=po);for(var Qn=0;Qn<po;Qn+=1){fi=(fi+$r+po)%po;var Bt=zi[fi];if(Bt&&!Bt.disabled){var Tt=Ti.slice(0,-1).concat(xr[fi]?Ie(xr[fi]):Bt[hn.value]);Ce(Tt);return}}},ci=function(){if(Ti.length>1){var $r=Ti.slice(0,-1);Ce($r)}else Ii(!1)},ar=function(){var $r,po=(($r=zi[Oi])===null||$r===void 0?void 0:$r[hn.children])||[],fi=po.find(function(Bt){return!Bt.disabled});if(fi){var Qn=[].concat((0,ft.Z)(Ti),[fi[hn.value]]);Ce(Qn)}};Ge.useImperativeHandle(nn,function(){return{onKeyDown:function($r){var po=$r.which;switch(po){case Ee.Z.UP:case Ee.Z.DOWN:{var fi=0;po===Ee.Z.UP?fi=-1:po===Ee.Z.DOWN&&(fi=1),fi!==0&&_n(fi);break}case Ee.Z.LEFT:{if(Pi)break;$n?ar():ci();break}case Ee.Z.RIGHT:{if(Pi)break;$n?ci():ar();break}case Ee.Z.BACKSPACE:{Pi||ci();break}case Ee.Z.ENTER:{if(Ti.length){var Qn=zi[Oi],Bt=(Qn==null?void 0:Qn[ne])||[];Bt.length?Kt(Bt.map(function(Tt){return Tt[hn.value]}),Bt[Bt.length-1]):Kt(Ti,zi[Oi])}break}case Ee.Z.ESC:Ii(!1),Fr&&$r.stopPropagation()}},onKeyUp:function(){}}})},We=Ge.forwardRef(function(nn,tn){var hn,di,Sn,Kt=nn.prefixCls,gi=nn.multiple,Vi=nn.searchValue,Pi=nn.toggleOpen,Ii=nn.notFoundContent,Fr=nn.direction,$n=nn.open,In=nn.disabled,si=Ge.useRef(null),Ti=Fr==="rtl",Oi=Ge.useContext(ot),zi=Oi.options,xr=Oi.values,Ce=Oi.halfValues,_n=Oi.fieldNames,ci=Oi.changeOnSelect,ar=Oi.onSelect,_r=Oi.searchOptions,$r=Oi.dropdownPrefixCls,po=Oi.loadData,fi=Oi.expandTrigger,Qn=$r||Kt,Bt=Ge.useState([]),Tt=(0,yt.Z)(Bt,2),kt=Tt[0],ui=Tt[1],Yn=function(dr){if(!(!po||Vi)){var Er=mn(dr,zi,_n),Ar=Er.map(function(zr){var mo=zr.option;return mo}),wn=Ar[Ar.length-1];if(wn&&!Ye(wn,_n)){var Yo=Ie(dr);ui(function(zr){return[].concat((0,ft.Z)(zr),[Yo])}),po(Ar)}}};Ge.useEffect(function(){kt.length&&kt.forEach(function(Ri){var dr=rt(Ri),Er=mn(dr,zi,_n,!0).map(function(wn){var Yo=wn.option;return Yo}),Ar=Er[Er.length-1];(!Ar||Ar[_n.children]||Ye(Ar,_n))&&ui(function(wn){return wn.filter(function(Yo){return Yo!==Ri})})})},[zi,kt,_n]);var vi=Ge.useMemo(function(){return new Set(Re(xr))},[xr]),yn=Ge.useMemo(function(){return new Set(Re(Ce))},[Ce]),Kn=Me(gi,$n),It=(0,yt.Z)(Kn,2),_t=It[0],hi=It[1],it=function(dr){hi(dr),Yn(dr)},sn=function(dr){if(In)return!1;var Er=dr.disabled,Ar=Ye(dr,_n);return!Er&&(Ar||ci||gi)},Dn=function(dr,Er){var Ar=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;ar(dr),!gi&&(Er||ci&&(fi==="hover"||Ar))&&Pi(!1)},Di=Ge.useMemo(function(){return Vi?_r:zi},[Vi,_r,zi]),cn=Ge.useMemo(function(){for(var Ri=[{options:Di}],dr=Di,Er=tt(dr,_n),Ar=function(){var zr=_t[wn],mo=dr.find(function(li,nr){return(Er[nr]?Ie(Er[nr]):li[_n.value])===zr}),en=mo==null?void 0:mo[_n.children];if(!(en!=null&&en.length))return 1;dr=en,Ri.push({options:en})},wn=0;wn<_t.length&&!Ar();wn+=1);return Ri},[Di,_t,_n]),qt=function(dr,Er){sn(Er)&&Dn(dr,Ye(Er,_n),!0)};De(tn,Di,_n,_t,it,qt,{direction:Fr,searchValue:Vi,toggleOpen:Pi,open:$n}),Ge.useEffect(function(){if(!Vi)for(var Ri=0;Ri<_t.length;Ri+=1){var dr,Er=_t.slice(0,Ri+1),Ar=Ie(Er),wn=(dr=si.current)===null||dr===void 0?void 0:dr.querySelector('li[data-path-key="'.concat(Ar.replace(/\\{0,2}"/g,'\\"'),'"]'));wn&&ut(wn)}},[_t,Vi]);var an=!((hn=cn[0])!==null&&hn!==void 0&&(hn=hn.options)!==null&&hn!==void 0&&hn.length),Gi=[(di={},(0,Te.Z)(di,_n.value,"__EMPTY__"),(0,Te.Z)(di,An,Ii),(0,Te.Z)(di,"disabled",!0),di)],ur=(0,Ke.Z)((0,Ke.Z)({},nn),{},{multiple:!an&&gi,onSelect:Dn,onActive:it,onToggleOpen:Pi,checkedSet:vi,halfCheckedSet:yn,loadingKeys:kt,isSelectable:sn}),Hi=an?[{options:Gi}]:cn,Mi=Hi.map(function(Ri,dr){var Er=_t.slice(0,dr),Ar=_t[dr];return Ge.createElement(Ni,(0,ue.Z)({key:dr},ur,{prefixCls:Qn,options:Ri.options,prevValuePath:Er,activeValue:Ar}))});return Ge.createElement(Hn,{open:$n},Ge.createElement("div",{className:ii()("".concat(Qn,"-menus"),(Sn={},(0,Te.Z)(Sn,"".concat(Qn,"-menu-empty"),an),(0,Te.Z)(Sn,"".concat(Qn,"-rtl"),Ti),Sn)),ref:si},Mi))}),Ae=We,Je=Ge.forwardRef(function(nn,tn){var hn=(0,Oe.lk)();return Ge.createElement(Ae,(0,ue.Z)({},nn,hn,{ref:tn}))}),Nt=Je,fn=Le(70425);function vn(){}function Ft(nn){var tn,hn=nn,di=hn.prefixCls,Sn=di===void 0?"rc-cascader":di,Kt=hn.style,gi=hn.className,Vi=hn.options,Pi=hn.checkable,Ii=hn.defaultValue,Fr=hn.value,$n=hn.fieldNames,In=hn.changeOnSelect,si=hn.onChange,Ti=hn.showCheckedStrategy,Oi=hn.loadData,zi=hn.expandTrigger,xr=hn.expandIcon,Ce=xr===void 0?">":xr,_n=hn.loadingIcon,ci=hn.direction,ar=hn.notFoundContent,_r=ar===void 0?"Not Found":ar,$r=hn.disabled,po=!!Pi,fi=(0,fn.C8)(Ii,{value:Fr,postState:St}),Qn=(0,yt.Z)(fi,2),Bt=Qn[0],Tt=Qn[1],kt=Ge.useMemo(function(){return et($n)},[JSON.stringify($n)]),ui=nt(kt,Vi),Yn=(0,yt.Z)(ui,3),vi=Yn[0],yn=Yn[1],Kn=Yn[2],It=Pn(vi,kt),_t=Fn(po,Bt,yn,Kn,It),hi=(0,yt.Z)(_t,3),it=hi[0],sn=hi[1],Dn=hi[2],Di=(0,fn.zX)(function(Hi){if(Tt(Hi),si){var Mi=St(Hi),Ri=Mi.map(function(Ar){return mn(Ar,vi,kt).map(function(wn){return wn.option})}),dr=po?Mi:Mi[0],Er=po?Ri:Ri[0];si(dr,Er)}}),cn=Ht(po,Di,it,sn,Dn,yn,Kn,Ti),qt=(0,fn.zX)(function(Hi){cn(Hi)}),an=Ge.useMemo(function(){return{options:vi,fieldNames:kt,values:it,halfValues:sn,changeOnSelect:In,onSelect:qt,checkable:Pi,searchOptions:[],dropdownPrefixCls:void 0,loadData:Oi,expandTrigger:zi,expandIcon:Ce,loadingIcon:_n,dropdownMenuColumnStyle:void 0}},[vi,kt,it,sn,In,qt,Pi,Oi,zi,Ce,_n]),Gi="".concat(Sn,"-panel"),ur=!vi.length;return Ge.createElement(ot.Provider,{value:an},Ge.createElement("div",{className:ii()(Gi,(tn={},(0,Te.Z)(tn,"".concat(Gi,"-rtl"),ci==="rtl"),(0,Te.Z)(tn,"".concat(Gi,"-empty"),ur),tn),gi),style:Kt},ur?_r:Ge.createElement(Ae,{prefixCls:Sn,searchValue:"",multiple:po,toggleOpen:vn,open:!0,direction:ci,disabled:$r})))}function Jt(nn){var tn=nn.onPopupVisibleChange,hn=nn.popupVisible,di=nn.popupClassName,Sn=nn.popupPlacement;warning(!tn,"`onPopupVisibleChange` is deprecated. Please use `onDropdownVisibleChange` instead."),warning(hn===void 0,"`popupVisible` is deprecated. Please use `open` instead."),warning(di===void 0,"`popupClassName` is deprecated. Please use `dropdownClassName` instead."),warning(Sn===void 0,"`popupPlacement` is deprecated. Please use `placement` instead.")}function jt(nn,tn){if(nn){var hn=function di(Sn){for(var Kt=0;Kt<Sn.length;Kt++){var gi=Sn[Kt];if(gi[tn==null?void 0:tn.value]===null)return warning(!1,"`value` in Cascader options should not be `null`."),!0;if(Array.isArray(gi[tn==null?void 0:tn.children])&&di(gi[tn==null?void 0:tn.children]))return!0}};hn(nn)}}var pn=null,jn=["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"],Nn=Ge.forwardRef(function(nn,tn){var hn=nn.id,di=nn.prefixCls,Sn=di===void 0?"rc-cascader":di,Kt=nn.fieldNames,gi=nn.defaultValue,Vi=nn.value,Pi=nn.changeOnSelect,Ii=nn.onChange,Fr=nn.displayRender,$n=nn.checkable,In=nn.autoClearSearchValue,si=In===void 0?!0:In,Ti=nn.searchValue,Oi=nn.onSearch,zi=nn.showSearch,xr=nn.expandTrigger,Ce=nn.options,_n=nn.dropdownPrefixCls,ci=nn.loadData,ar=nn.popupVisible,_r=nn.open,$r=nn.popupClassName,po=nn.dropdownClassName,fi=nn.dropdownMenuColumnStyle,Qn=nn.dropdownStyle,Bt=nn.popupPlacement,Tt=nn.placement,kt=nn.onDropdownVisibleChange,ui=nn.onPopupVisibleChange,Yn=nn.expandIcon,vi=Yn===void 0?">":Yn,yn=nn.loadingIcon,Kn=nn.children,It=nn.dropdownMatchSelectWidth,_t=It===void 0?!1:It,hi=nn.showCheckedStrategy,it=hi===void 0?we:hi,sn=nn.optionRender,Dn=(0,mt.Z)(nn,jn),Di=(0,at.ZP)(hn),cn=!!$n,qt=(0,dt.Z)(gi,{value:Vi,postState:St}),an=(0,yt.Z)(qt,2),Gi=an[0],ur=an[1],Hi=Ge.useMemo(function(){return et(Kt)},[JSON.stringify(Kt)]),Mi=nt(Hi,Ce),Ri=(0,yt.Z)(Mi,3),dr=Ri[0],Er=Ri[1],Ar=Ri[2],wn=(0,dt.Z)("",{value:Ti,postState:function(qn){return qn||""}}),Yo=(0,yt.Z)(wn,2),zr=Yo[0],mo=Yo[1],en=function(qn,ki){mo(qn),ki.source!=="blur"&&Oi&&Oi(qn)},li=oi(zi),nr=(0,yt.Z)(li,2),Sr=nr[0],vr=nr[1],Ir=pe(zr,dr,Hi,_n||Sn,vr,Pi||cn),bo=Pn(dr,Hi),fo=Fn(cn,Gi,Er,Ar,bo),so=(0,yt.Z)(fo,3),lo=so[0],Tn=so[1],qo=so[2],Zn=Ge.useMemo(function(){var Vn=Re(lo),qn=Lt(Vn,Er,it);return[].concat((0,ft.Z)(qo),(0,ft.Z)(Ar(qn)))},[lo,Er,Ar,qo,it]),wr=$t(Zn,dr,Hi,cn,Fr),Or=(0,Ct.Z)(function(Vn){if(ur(Vn),Ii){var qn=St(Vn),ki=qn.map(function(mi){return mn(mi,dr,Hi).map(function(Si){return Si.option})}),Wi=cn?qn:qn[0],Wn=cn?ki:ki[0];Ii(Wi,Wn)}}),hr=Ht(cn,Or,lo,Tn,qo,Er,Ar,it),la=(0,Ct.Z)(function(Vn){(!cn||si)&&mo(""),hr(Vn)}),ca=function(qn,ki){if(ki.type==="clear"){Or([]);return}var Wi=ki.values[0],Wn=Wi.valueCells;la(Wn)},Qo=_r!==void 0?_r:ar,zo=po||$r,Vt=Tt||Bt,On=function(qn){kt==null||kt(qn),ui==null||ui(qn)},Ut=Ge.useMemo(function(){return{options:dr,fieldNames:Hi,values:lo,halfValues:Tn,changeOnSelect:Pi,onSelect:la,checkable:$n,searchOptions:Ir,dropdownPrefixCls:_n,loadData:ci,expandTrigger:xr,expandIcon:vi,loadingIcon:yn,dropdownMenuColumnStyle:fi,optionRender:sn}},[dr,Hi,lo,Tn,Pi,la,$n,Ir,_n,ci,xr,vi,yn,fi,sn]),_e=!(zr?Ir:dr).length,pi=zr&&vr.matchInputWidth||_e?{}:{minWidth:"auto"};return Ge.createElement(ot.Provider,{value:Ut},Ge.createElement(Oe.Ac,(0,ue.Z)({},Dn,{ref:tn,id:Di,prefixCls:Sn,autoClearSearchValue:si,dropdownMatchSelectWidth:_t,dropdownStyle:(0,Ke.Z)((0,Ke.Z)({},pi),Qn),displayValues:wr,onDisplayValuesChange:ca,mode:cn?"multiple":void 0,searchValue:zr,onSearch:en,showSearch:Sr,OptionList:Nt,emptyOptions:_e,open:Qo,dropdownClassName:zo,placement:Vt,onDropdownVisibleChange:On,getRawInputElement:function(){return Kn}})))});Nn.SHOW_PARENT=we,Nn.SHOW_CHILD=be,Nn.Panel=Ft;var Mn=Nn,fr=Mn},98535:function(Un,ai,Le){"use strict";Le.r(ai),Le.d(ai,{Panel:function(){return St},default:function(){return wt}});var ue=Le(72308),Ke=Le(80702),ft=Le(52487),yt=Le(62853),mt=Le(92310),Oe=Le.n(mt),at=Le(18929),Ct=Le(48736),dt=Le(59301),Ge=Le(74416),Rt=Le(11592),ot=Le(77321),At=Le(49618),Te=Le(77900),ne=Le(10228),te=dt.forwardRef(function(Lt,mn){var $t=Lt.prefixCls,Pn=Lt.forceRender,Ot=Lt.className,ct=Lt.style,nt=Lt.children,gn=Lt.isActive,oi=Lt.role,zn=Lt.classNames,Ht=Lt.styles,Fn=dt.useState(gn||Pn),Cn=(0,ft.Z)(Fn,2),ii=Cn[0],Wt=Cn[1];return dt.useEffect(function(){(Pn||gn)&&Wt(!0)},[Pn,gn]),ii?dt.createElement("div",{ref:mn,className:Oe()("".concat($t,"-content"),(0,At.Z)((0,At.Z)({},"".concat($t,"-content-active"),gn),"".concat($t,"-content-inactive"),!gn),Ot),style:ct,role:oi},dt.createElement("div",{className:Oe()("".concat($t,"-content-box"),zn==null?void 0:zn.body),style:Ht==null?void 0:Ht.body},nt)):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=dt.forwardRef(function(Lt,mn){var $t=Lt.showArrow,Pn=$t===void 0?!0:$t,Ot=Lt.headerClass,ct=Lt.isActive,nt=Lt.onItemClick,gn=Lt.forceRender,oi=Lt.className,zn=Lt.classNames,Ht=zn===void 0?{}:zn,Fn=Lt.styles,Cn=Fn===void 0?{}:Fn,ii=Lt.prefixCls,Wt=Lt.collapsible,Hn=Lt.accordion,lt=Lt.panelKey,An=Lt.extra,Ni=Lt.header,je=Lt.expandIcon,Me=Lt.openMotion,Ee=Lt.destroyInactivePanel,De=Lt.children,We=(0,Ge.Z)(Lt,se),Ae=Wt==="disabled",Je=An!=null&&typeof An!="boolean",Nt=(0,At.Z)((0,At.Z)((0,At.Z)({onClick:function(){nt==null||nt(lt)},onKeyDown:function(jn){(jn.key==="Enter"||jn.keyCode===ne.Z.ENTER||jn.which===ne.Z.ENTER)&&(nt==null||nt(lt))},role:Hn?"tab":"button"},"aria-expanded",ct),"aria-disabled",Ae),"tabIndex",Ae?-1:0),fn=typeof je=="function"?je(Lt):dt.createElement("i",{className:"arrow"}),vn=fn&&dt.createElement("div",(0,ue.Z)({className:"".concat(ii,"-expand-icon")},["header","icon"].includes(Wt)?Nt:{}),fn),Ft=Oe()("".concat(ii,"-item"),(0,At.Z)((0,At.Z)({},"".concat(ii,"-item-active"),ct),"".concat(ii,"-item-disabled"),Ae),oi),Jt=Oe()(Ot,"".concat(ii,"-header"),(0,At.Z)({},"".concat(ii,"-collapsible-").concat(Wt),!!Wt),Ht.header),jt=(0,ot.Z)({className:Jt,style:Cn.header},["header","icon"].includes(Wt)?{}:Nt);return dt.createElement("div",(0,ue.Z)({},We,{ref:mn,className:Ft}),dt.createElement("div",jt,Pn&&vn,dt.createElement("span",(0,ue.Z)({className:"".concat(ii,"-header-text")},Wt==="header"?Nt:{}),Ni),Je&&dt.createElement("div",{className:"".concat(ii,"-extra")},An)),dt.createElement(Te.default,(0,ue.Z)({visible:ct,leavedClassName:"".concat(ii,"-content-hidden")},Me,{forceRender:gn,removeOnLeave:Ee}),function(pn,jn){var Nn=pn.className,Mn=pn.style;return dt.createElement(de,{ref:jn,prefixCls:ii,className:Nn,classNames:Ht,style:Mn,styles:Cn,isActive:ct,forceRender:gn,role:Hn?"tabpanel":void 0},De)}))}),ye=pe,we=["children","label","key","collapsible","onItemClick","destroyInactivePanel"],be=function(mn,$t){var Pn=$t.prefixCls,Ot=$t.accordion,ct=$t.collapsible,nt=$t.destroyInactivePanel,gn=$t.onItemClick,oi=$t.activeKey,zn=$t.openMotion,Ht=$t.expandIcon;return mn.map(function(Fn,Cn){var ii=Fn.children,Wt=Fn.label,Hn=Fn.key,lt=Fn.collapsible,An=Fn.onItemClick,Ni=Fn.destroyInactivePanel,je=(0,Ge.Z)(Fn,we),Me=String(Hn!=null?Hn:Cn),Ee=lt!=null?lt:ct,De=Ni!=null?Ni:nt,We=function(Nt){Ee!=="disabled"&&(gn(Nt),An==null||An(Nt))},Ae=!1;return Ot?Ae=oi[0]===Me:Ae=oi.indexOf(Me)>-1,dt.createElement(ye,(0,ue.Z)({},je,{prefixCls:Pn,key:Me,panelKey:Me,isActive:Ae,accordion:Ot,openMotion:zn,expandIcon:Ht,header:Wt,collapsible:Ee,onItemClick:We,destroyInactivePanel:De}),ii)})},Ie=function(mn,$t,Pn){if(!mn)return null;var Ot=Pn.prefixCls,ct=Pn.accordion,nt=Pn.collapsible,gn=Pn.destroyInactivePanel,oi=Pn.onItemClick,zn=Pn.activeKey,Ht=Pn.openMotion,Fn=Pn.expandIcon,Cn=mn.key||String($t),ii=mn.props,Wt=ii.header,Hn=ii.headerClass,lt=ii.destroyInactivePanel,An=ii.collapsible,Ni=ii.onItemClick,je=!1;ct?je=zn[0]===Cn:je=zn.indexOf(Cn)>-1;var Me=An!=null?An:nt,Ee=function(Ae){Me!=="disabled"&&(oi(Ae),Ni==null||Ni(Ae))},De={key:Cn,panelKey:Cn,header:Wt,headerClass:Hn,isActive:je,prefixCls:Ot,destroyInactivePanel:lt!=null?lt:gn,openMotion:Ht,accordion:ct,children:mn.props.children,onItemClick:Ee,expandIcon:Fn,collapsible:Me};return typeof mn.type=="string"?mn:(Object.keys(De).forEach(function(We){typeof De[We]=="undefined"&&delete De[We]}),dt.cloneElement(mn,De))};function Re(Lt,mn,$t){return Array.isArray(Lt)?be(Lt,$t):(0,Rt.Z)(mn).map(function(Pn,Ot){return Ie(Pn,Ot,$t)})}var rt=Re,et=Le(26112);function Ye(Lt){var mn=Lt;if(!Array.isArray(mn)){var $t=(0,yt.Z)(mn);mn=$t==="number"||$t==="string"?[mn]:[]}return mn.map(function(Pn){return String(Pn)})}var ut=dt.forwardRef(function(Lt,mn){var $t=Lt.prefixCls,Pn=$t===void 0?"rc-collapse":$t,Ot=Lt.destroyInactivePanel,ct=Ot===void 0?!1:Ot,nt=Lt.style,gn=Lt.accordion,oi=Lt.className,zn=Lt.children,Ht=Lt.collapsible,Fn=Lt.openMotion,Cn=Lt.expandIcon,ii=Lt.activeKey,Wt=Lt.defaultActiveKey,Hn=Lt.onChange,lt=Lt.items,An=Oe()(Pn,oi),Ni=(0,at.Z)([],{value:ii,onChange:function(Je){return Hn==null?void 0:Hn(Je)},defaultValue:Wt,postState:Ye}),je=(0,ft.Z)(Ni,2),Me=je[0],Ee=je[1],De=function(Je){return Ee(function(){if(gn)return Me[0]===Je?[]:[Je];var Nt=Me.indexOf(Je),fn=Nt>-1;return fn?Me.filter(function(vn){return vn!==Je}):[].concat((0,Ke.Z)(Me),[Je])})};(0,Ct.ZP)(!zn,"[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");var We=rt(lt,zn,{prefixCls:Pn,accordion:gn,openMotion:Fn,expandIcon:Cn,collapsible:Ht,destroyInactivePanel:ct,onItemClick:De,activeKey:Me});return dt.createElement("div",(0,ue.Z)({ref:mn,className:An,style:nt,role:gn?"tablist":void 0},(0,et.Z)(Lt,{aria:!0,data:!0})),We)}),tt=Object.assign(ut,{Panel:ye}),wt=tt,St=tt.Panel},23425:function(Un,ai,Le){"use strict";Le.d(ai,{Z:function(){return Re}});var ue=Le(49618),Ke=Le(72308),ft=Le(62853),yt=Le(77321),mt=Le(52487),Oe=Le(92310),at=Le.n(Oe),Ct=Le(18929),dt=Le(10228),Ge=Le(26112),Rt=Le(48736),ot=Le(59301),At=Le(17119),Te=[10,20,50,100],ne=function(et){var Ye=et.pageSizeOptions,ut=Ye===void 0?Te:Ye,tt=et.locale,wt=et.changeSize,St=et.pageSize,Lt=et.goButton,mn=et.quickGo,$t=et.rootPrefixCls,Pn=et.disabled,Ot=et.buildOptionText,ct=et.showSizeChanger,nt=et.sizeChangerRender,gn=ot.useState(""),oi=(0,mt.Z)(gn,2),zn=oi[0],Ht=oi[1],Fn=function(){return!zn||Number.isNaN(zn)?void 0:Number(zn)},Cn=typeof Ot=="function"?Ot:function(Ee){return"".concat(Ee," ").concat(tt.items_per_page)},ii=function(De){Ht(De.target.value)},Wt=function(De){Lt||zn===""||(Ht(""),!(De.relatedTarget&&(De.relatedTarget.className.indexOf("".concat($t,"-item-link"))>=0||De.relatedTarget.className.indexOf("".concat($t,"-item"))>=0))&&(mn==null||mn(Fn())))},Hn=function(De){zn!==""&&(De.keyCode===dt.Z.ENTER||De.type==="click")&&(Ht(""),mn==null||mn(Fn()))},lt=function(){return ut.some(function(De){return De.toString()===St.toString()})?ut:ut.concat([St]).sort(function(De,We){var Ae=Number.isNaN(Number(De))?0:Number(De),Je=Number.isNaN(Number(We))?0:Number(We);return Ae-Je})},An="".concat($t,"-options");if(!ct&&!mn)return null;var Ni=null,je=null,Me=null;return ct&&nt&&(Ni=nt({disabled:Pn,size:St,onSizeChange:function(De){wt==null||wt(Number(De))},"aria-label":tt.page_size,className:"".concat(An,"-size-changer"),options:lt().map(function(Ee){return{label:Cn(Ee),value:Ee}})})),mn&&(Lt&&(Me=typeof Lt=="boolean"?ot.createElement("button",{type:"button",onClick:Hn,onKeyUp:Hn,disabled:Pn,className:"".concat(An,"-quick-jumper-button")},tt.jump_to_confirm):ot.createElement("span",{onClick:Hn,onKeyUp:Hn},Lt)),je=ot.createElement("div",{className:"".concat(An,"-quick-jumper")},tt.jump_to,ot.createElement("input",{disabled:Pn,type:"text",value:zn,onChange:ii,onKeyUp:Hn,onBlur:Wt,"aria-label":tt.page}),tt.page,Me)),ot.createElement("li",{className:An},Ni,je)},te=ne,de=function(et){var Ye=et.rootPrefixCls,ut=et.page,tt=et.active,wt=et.className,St=et.showTitle,Lt=et.onClick,mn=et.onKeyPress,$t=et.itemRender,Pn="".concat(Ye,"-item"),Ot=at()(Pn,"".concat(Pn,"-").concat(ut),(0,ue.Z)((0,ue.Z)({},"".concat(Pn,"-active"),tt),"".concat(Pn,"-disabled"),!ut),wt),ct=function(){Lt(ut)},nt=function(zn){mn(zn,Lt,ut)},gn=$t(ut,"page",ot.createElement("a",{rel:"nofollow"},ut));return gn?ot.createElement("li",{title:St?String(ut):null,className:Ot,onClick:ct,onKeyDown:nt,tabIndex:0},gn):null},se=de,pe=function(et,Ye,ut){return ut};function ye(){}function we(rt){var et=Number(rt);return typeof et=="number"&&!Number.isNaN(et)&&isFinite(et)&&Math.floor(et)===et}function be(rt,et,Ye){var ut=typeof rt=="undefined"?et:rt;return Math.floor((Ye-1)/ut)+1}var Ie=function(et){var Ye=et.prefixCls,ut=Ye===void 0?"rc-pagination":Ye,tt=et.selectPrefixCls,wt=tt===void 0?"rc-select":tt,St=et.className,Lt=et.current,mn=et.defaultCurrent,$t=mn===void 0?1:mn,Pn=et.total,Ot=Pn===void 0?0:Pn,ct=et.pageSize,nt=et.defaultPageSize,gn=nt===void 0?10:nt,oi=et.onChange,zn=oi===void 0?ye:oi,Ht=et.hideOnSinglePage,Fn=et.align,Cn=et.showPrevNextJumpers,ii=Cn===void 0?!0:Cn,Wt=et.showQuickJumper,Hn=et.showLessItems,lt=et.showTitle,An=lt===void 0?!0:lt,Ni=et.onShowSizeChange,je=Ni===void 0?ye:Ni,Me=et.locale,Ee=Me===void 0?At.Z:Me,De=et.style,We=et.totalBoundaryShowSizeChanger,Ae=We===void 0?50:We,Je=et.disabled,Nt=et.simple,fn=et.showTotal,vn=et.showSizeChanger,Ft=vn===void 0?Ot>Ae:vn,Jt=et.sizeChangerRender,jt=et.pageSizeOptions,pn=et.itemRender,jn=pn===void 0?pe:pn,Nn=et.jumpPrevIcon,Mn=et.jumpNextIcon,fr=et.prevIcon,nn=et.nextIcon,tn=ot.useRef(null),hn=(0,Ct.Z)(10,{value:ct,defaultValue:gn}),di=(0,mt.Z)(hn,2),Sn=di[0],Kt=di[1],gi=(0,Ct.Z)(1,{value:Lt,defaultValue:$t,postState:function(Or){return Math.max(1,Math.min(Or,be(void 0,Sn,Ot)))}}),Vi=(0,mt.Z)(gi,2),Pi=Vi[0],Ii=Vi[1],Fr=ot.useState(Pi),$n=(0,mt.Z)(Fr,2),In=$n[0],si=$n[1];(0,ot.useEffect)(function(){si(Pi)},[Pi]);var Ti=zn!==ye,Oi="current"in et,zi=Math.max(1,Pi-(Hn?3:5)),xr=Math.min(be(void 0,Sn,Ot),Pi+(Hn?3:5));function Ce(wr,Or){var hr=wr||ot.createElement("button",{type:"button","aria-label":Or,className:"".concat(ut,"-item-link")});return typeof wr=="function"&&(hr=ot.createElement(wr,(0,yt.Z)({},et))),hr}function _n(wr){var Or=wr.target.value,hr=be(void 0,Sn,Ot),la;return Or===""?la=Or:Number.isNaN(Number(Or))?la=In:Or>=hr?la=hr:la=Number(Or),la}function ci(wr){return we(wr)&&wr!==Pi&&we(Ot)&&Ot>0}var ar=Ot>Sn?Wt:!1;function _r(wr){(wr.keyCode===dt.Z.UP||wr.keyCode===dt.Z.DOWN)&&wr.preventDefault()}function $r(wr){var Or=_n(wr);switch(Or!==In&&si(Or),wr.keyCode){case dt.Z.ENTER:Qn(Or);break;case dt.Z.UP:Qn(Or-1);break;case dt.Z.DOWN:Qn(Or+1);break;default:break}}function po(wr){Qn(_n(wr))}function fi(wr){var Or=be(wr,Sn,Ot),hr=Pi>Or&&Or!==0?Or:Pi;Kt(wr),si(hr),je==null||je(Pi,wr),Ii(hr),zn==null||zn(hr,wr)}function Qn(wr){if(ci(wr)&&!Je){var Or=be(void 0,Sn,Ot),hr=wr;return wr>Or?hr=Or:wr<1&&(hr=1),hr!==In&&si(hr),Ii(hr),zn==null||zn(hr,Sn),hr}return Pi}var Bt=Pi>1,Tt=Pi<be(void 0,Sn,Ot);function kt(){Bt&&Qn(Pi-1)}function ui(){Tt&&Qn(Pi+1)}function Yn(){Qn(zi)}function vi(){Qn(xr)}function yn(wr,Or){if(wr.key==="Enter"||wr.charCode===dt.Z.ENTER||wr.keyCode===dt.Z.ENTER){for(var hr=arguments.length,la=new Array(hr>2?hr-2:0),ca=2;ca<hr;ca++)la[ca-2]=arguments[ca];Or.apply(void 0,la)}}function Kn(wr){yn(wr,kt)}function It(wr){yn(wr,ui)}function _t(wr){yn(wr,Yn)}function hi(wr){yn(wr,vi)}function it(wr){var Or=jn(wr,"prev",Ce(fr,"prev page"));return ot.isValidElement(Or)?ot.cloneElement(Or,{disabled:!Bt}):Or}function sn(wr){var Or=jn(wr,"next",Ce(nn,"next page"));return ot.isValidElement(Or)?ot.cloneElement(Or,{disabled:!Tt}):Or}function Dn(wr){(wr.type==="click"||wr.keyCode===dt.Z.ENTER)&&Qn(In)}var Di=null,cn=(0,Ge.Z)(et,{aria:!0,data:!0}),qt=fn&&ot.createElement("li",{className:"".concat(ut,"-total-text")},fn(Ot,[Ot===0?0:(Pi-1)*Sn+1,Pi*Sn>Ot?Ot:Pi*Sn])),an=null,Gi=be(void 0,Sn,Ot);if(Ht&&Ot<=Sn)return null;var ur=[],Hi={rootPrefixCls:ut,onClick:Qn,onKeyPress:yn,showTitle:An,itemRender:jn,page:-1},Mi=Pi-1>0?Pi-1:0,Ri=Pi+1<Gi?Pi+1:Gi,dr=Wt&&Wt.goButton,Er=(0,ft.Z)(Nt)==="object"?Nt.readOnly:!Nt,Ar=dr,wn=null;Nt&&(dr&&(typeof dr=="boolean"?Ar=ot.createElement("button",{type:"button",onClick:Dn,onKeyUp:Dn},Ee.jump_to_confirm):Ar=ot.createElement("span",{onClick:Dn,onKeyUp:Dn},dr),Ar=ot.createElement("li",{title:An?"".concat(Ee.jump_to).concat(Pi,"/").concat(Gi):null,className:"".concat(ut,"-simple-pager")},Ar)),wn=ot.createElement("li",{title:An?"".concat(Pi,"/").concat(Gi):null,className:"".concat(ut,"-simple-pager")},Er?In:ot.createElement("input",{type:"text","aria-label":Ee.jump_to,value:In,disabled:Je,onKeyDown:_r,onKeyUp:$r,onChange:$r,onBlur:po,size:3}),ot.createElement("span",{className:"".concat(ut,"-slash")},"/"),Gi));var Yo=Hn?1:2;if(Gi<=3+Yo*2){Gi||ur.push(ot.createElement(se,(0,Ke.Z)({},Hi,{key:"noPager",page:1,className:"".concat(ut,"-item-disabled")})));for(var zr=1;zr<=Gi;zr+=1)ur.push(ot.createElement(se,(0,Ke.Z)({},Hi,{key:zr,page:zr,active:Pi===zr})))}else{var mo=Hn?Ee.prev_3:Ee.prev_5,en=Hn?Ee.next_3:Ee.next_5,li=jn(zi,"jump-prev",Ce(Nn,"prev page")),nr=jn(xr,"jump-next",Ce(Mn,"next page"));ii&&(Di=li?ot.createElement("li",{title:An?mo:null,key:"prev",onClick:Yn,tabIndex:0,onKeyDown:_t,className:at()("".concat(ut,"-jump-prev"),(0,ue.Z)({},"".concat(ut,"-jump-prev-custom-icon"),!!Nn))},li):null,an=nr?ot.createElement("li",{title:An?en:null,key:"next",onClick:vi,tabIndex:0,onKeyDown:hi,className:at()("".concat(ut,"-jump-next"),(0,ue.Z)({},"".concat(ut,"-jump-next-custom-icon"),!!Mn))},nr):null);var Sr=Math.max(1,Pi-Yo),vr=Math.min(Pi+Yo,Gi);Pi-1<=Yo&&(vr=1+Yo*2),Gi-Pi<=Yo&&(Sr=Gi-Yo*2);for(var Ir=Sr;Ir<=vr;Ir+=1)ur.push(ot.createElement(se,(0,Ke.Z)({},Hi,{key:Ir,page:Ir,active:Pi===Ir})));if(Pi-1>=Yo*2&&Pi!==3&&(ur[0]=ot.cloneElement(ur[0],{className:at()("".concat(ut,"-item-after-jump-prev"),ur[0].props.className)}),ur.unshift(Di)),Gi-Pi>=Yo*2&&Pi!==Gi-2){var bo=ur[ur.length-1];ur[ur.length-1]=ot.cloneElement(bo,{className:at()("".concat(ut,"-item-before-jump-next"),bo.props.className)}),ur.push(an)}Sr!==1&&ur.unshift(ot.createElement(se,(0,Ke.Z)({},Hi,{key:1,page:1}))),vr!==Gi&&ur.push(ot.createElement(se,(0,Ke.Z)({},Hi,{key:Gi,page:Gi})))}var fo=it(Mi);if(fo){var so=!Bt||!Gi;fo=ot.createElement("li",{title:An?Ee.prev_page:null,onClick:kt,tabIndex:so?null:0,onKeyDown:Kn,className:at()("".concat(ut,"-prev"),(0,ue.Z)({},"".concat(ut,"-disabled"),so)),"aria-disabled":so},fo)}var lo=sn(Ri);if(lo){var Tn,qo;Nt?(Tn=!Tt,qo=Bt?0:null):(Tn=!Tt||!Gi,qo=Tn?null:0),lo=ot.createElement("li",{title:An?Ee.next_page:null,onClick:ui,tabIndex:qo,onKeyDown:It,className:at()("".concat(ut,"-next"),(0,ue.Z)({},"".concat(ut,"-disabled"),Tn)),"aria-disabled":Tn},lo)}var Zn=at()(ut,St,(0,ue.Z)((0,ue.Z)((0,ue.Z)((0,ue.Z)((0,ue.Z)({},"".concat(ut,"-start"),Fn==="start"),"".concat(ut,"-center"),Fn==="center"),"".concat(ut,"-end"),Fn==="end"),"".concat(ut,"-simple"),Nt),"".concat(ut,"-disabled"),Je));return ot.createElement("ul",(0,Ke.Z)({className:Zn,style:De,ref:tn},cn),qt,fo,Nt?wn:ur,lo,ot.createElement(te,{locale:Ee,rootPrefixCls:ut,disabled:Je,selectPrefixCls:wt,changeSize:fi,pageSize:Sn,pageSizeOptions:jt,quickGo:ar?Qn:null,goButton:Ar,showSizeChanger:Ft,sizeChangerRender:Jt}))},Re=Ie},738:function(Un,ai,Le){"use strict";Le.d(ai,{Z:function(){return ye}});var ue=Le(72308),Ke=Le(49618),ft=Le(52487),yt=Le(74416),mt=Le(92310),Oe=Le.n(mt),at=Le(18929),Ct=Le(10228),dt=Le(26112),Ge=Le(59301);function Rt(we,be){var Ie=we.disabled,Re=we.prefixCls,rt=we.character,et=we.characterRender,Ye=we.index,ut=we.count,tt=we.value,wt=we.allowHalf,St=we.focused,Lt=we.onHover,mn=we.onClick,$t=function(Ht){Lt(Ht,Ye)},Pn=function(Ht){mn(Ht,Ye)},Ot=function(Ht){Ht.keyCode===Ct.Z.ENTER&&mn(Ht,Ye)},ct=Ye+1,nt=new Set([Re]);tt===0&&Ye===0&&St?nt.add("".concat(Re,"-focused")):wt&&tt+.5>=ct&&tt<ct?(nt.add("".concat(Re,"-half")),nt.add("".concat(Re,"-active")),St&&nt.add("".concat(Re,"-focused"))):(ct<=tt?nt.add("".concat(Re,"-full")):nt.add("".concat(Re,"-zero")),ct===tt&&St&&nt.add("".concat(Re,"-focused")));var gn=typeof rt=="function"?rt(we):rt,oi=Ge.createElement("li",{className:Oe()(Array.from(nt)),ref:be},Ge.createElement("div",{onClick:Ie?null:Pn,onKeyDown:Ie?null:Ot,onMouseMove:Ie?null:$t,role:"radio","aria-checked":tt>Ye?"true":"false","aria-posinset":Ye+1,"aria-setsize":ut,tabIndex:Ie?-1:0},Ge.createElement("div",{className:"".concat(Re,"-first")},gn),Ge.createElement("div",{className:"".concat(Re,"-second")},gn)));return et&&(oi=et(oi,we)),oi}var ot=Ge.forwardRef(Rt);function At(){var we=Ge.useRef({});function be(Re){return we.current[Re]}function Ie(Re){return function(rt){we.current[Re]=rt}}return[be,Ie]}function Te(we){var be=we.pageXOffset,Ie="scrollLeft";if(typeof be!="number"){var Re=we.document;be=Re.documentElement[Ie],typeof be!="number"&&(be=Re.body[Ie])}return be}function ne(we){var be,Ie,Re=we.ownerDocument,rt=Re.body,et=Re&&Re.documentElement,Ye=we.getBoundingClientRect();return be=Ye.left,Ie=Ye.top,be-=et.clientLeft||rt.clientLeft||0,Ie-=et.clientTop||rt.clientTop||0,{left:be,top:Ie}}function te(we){var be=ne(we),Ie=we.ownerDocument,Re=Ie.defaultView||Ie.parentWindow;return be.left+=Te(Re),be.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,be){var Ie=we.prefixCls,Re=Ie===void 0?"rc-rate":Ie,rt=we.className,et=we.defaultValue,Ye=we.value,ut=we.count,tt=ut===void 0?5:ut,wt=we.allowHalf,St=wt===void 0?!1:wt,Lt=we.allowClear,mn=Lt===void 0?!0:Lt,$t=we.keyboard,Pn=$t===void 0?!0:$t,Ot=we.character,ct=Ot===void 0?"\u2605":Ot,nt=we.characterRender,gn=we.disabled,oi=we.direction,zn=oi===void 0?"ltr":oi,Ht=we.tabIndex,Fn=Ht===void 0?0:Ht,Cn=we.autoFocus,ii=we.onHoverChange,Wt=we.onChange,Hn=we.onFocus,lt=we.onBlur,An=we.onKeyDown,Ni=we.onMouseLeave,je=(0,yt.Z)(we,de),Me=At(),Ee=(0,ft.Z)(Me,2),De=Ee[0],We=Ee[1],Ae=Ge.useRef(null),Je=function(){if(!gn){var zi;(zi=Ae.current)===null||zi===void 0||zi.focus()}};Ge.useImperativeHandle(be,function(){return{focus:Je,blur:function(){if(!gn){var zi;(zi=Ae.current)===null||zi===void 0||zi.blur()}}}});var Nt=(0,at.Z)(et||0,{value:Ye}),fn=(0,ft.Z)(Nt,2),vn=fn[0],Ft=fn[1],Jt=(0,at.Z)(null),jt=(0,ft.Z)(Jt,2),pn=jt[0],jn=jt[1],Nn=function(zi,xr){var Ce=zn==="rtl",_n=zi+1;if(St){var ci=De(zi),ar=te(ci),_r=ci.clientWidth;(Ce&&xr-ar>_r/2||!Ce&&xr-ar<_r/2)&&(_n-=.5)}return _n},Mn=function(zi){Ft(zi),Wt==null||Wt(zi)},fr=Ge.useState(!1),nn=(0,ft.Z)(fr,2),tn=nn[0],hn=nn[1],di=function(){hn(!0),Hn==null||Hn()},Sn=function(){hn(!1),lt==null||lt()},Kt=Ge.useState(null),gi=(0,ft.Z)(Kt,2),Vi=gi[0],Pi=gi[1],Ii=function(zi,xr){var Ce=Nn(xr,zi.pageX);Ce!==pn&&(Pi(Ce),jn(null)),ii==null||ii(Ce)},Fr=function(zi){gn||(Pi(null),jn(null),ii==null||ii(void 0)),zi&&(Ni==null||Ni(zi))},$n=function(zi,xr){var Ce=Nn(xr,zi.pageX),_n=!1;mn&&(_n=Ce===vn),Fr(),Mn(_n?0:Ce),jn(_n?Ce:null)},In=function(zi){var xr=zi.keyCode,Ce=zn==="rtl",_n=St?.5:1;Pn&&(xr===Ct.Z.RIGHT&&vn<tt&&!Ce?(Mn(vn+_n),zi.preventDefault()):xr===Ct.Z.LEFT&&vn>0&&!Ce||xr===Ct.Z.RIGHT&&vn>0&&Ce?(Mn(vn-_n),zi.preventDefault()):xr===Ct.Z.LEFT&&vn<tt&&Ce&&(Mn(vn+_n),zi.preventDefault())),An==null||An(zi)};Ge.useEffect(function(){Cn&&!gn&&Je()},[]);var si=new Array(tt).fill(0).map(function(Oi,zi){return Ge.createElement(ot,{ref:We(zi),index:zi,count:tt,disabled:gn,prefixCls:"".concat(Re,"-star"),allowHalf:St,value:Vi===null?vn:Vi,onClick:$n,onHover:Ii,key:Oi||zi,character:ct,characterRender:nt,focused:tn})}),Ti=Oe()(Re,rt,(0,Ke.Z)((0,Ke.Z)({},"".concat(Re,"-disabled"),gn),"".concat(Re,"-rtl"),zn==="rtl"));return Ge.createElement("ul",(0,ue.Z)({className:Ti,onMouseLeave:Fr,tabIndex:gn?-1:Fn,onFocus:gn?null:di,onBlur:gn?null:Sn,onKeyDown:gn?null:In,ref:Ae},(0,dt.Z)(je,{aria:!0,data:!0,attr:!0})),si)}var pe=Ge.forwardRef(se),ye=pe},69582:function(Un,ai,Le){"use strict";Le.d(ai,{ZP:function(){return at}});var ue=Le(52487),Ke=Le(59301),ft=Le(47273),yt=0,mt=(0,ft.Z)();function Oe(){var Ct;return mt?(Ct=yt,yt+=1):Ct="TEST_OR_SSR",Ct}function at(Ct){var dt=Ke.useState(),Ge=(0,ue.Z)(dt,2),Rt=Ge[0],ot=Ge[1];return Ke.useEffect(function(){ot("rc_select_".concat(Oe()))},[]),Ct||Rt}},45560:function(Un,ai,Le){"use strict";Le.d(ai,{Ac:function(){return fr},Xo:function(){return tn},Wx:function(){return di},ZP:function(){return Kn},lk:function(){return ye}});var ue=Le(72308),Ke=Le(80702),ft=Le(49618),yt=Le(77321),mt=Le(52487),Oe=Le(74416),at=Le(62853),Ct=Le(18929),dt=Le(48736),Ge=Le(59301),Rt=Le(92310),ot=Le.n(Rt),At=Le(34280),Te=Le(49658),ne=Le(8654),te=function(_t){var hi=_t.className,it=_t.customizeIcon,sn=_t.customizeIconProps,Dn=_t.children,Di=_t.onMouseDown,cn=_t.onClick,qt=typeof it=="function"?it(sn):it;return Ge.createElement("span",{className:hi,onMouseDown:function(Gi){Gi.preventDefault(),Di==null||Di(Gi)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:cn,"aria-hidden":!0},qt!==void 0?qt:Ge.createElement("span",{className:ot()(hi.split(/\s+/).map(function(an){return"".concat(an,"-icon")}))},Dn))},de=te,se=function(_t,hi,it,sn,Dn){var Di=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,cn=arguments.length>6?arguments[6]:void 0,qt=arguments.length>7?arguments[7]:void 0,an=Ge.useMemo(function(){if((0,at.Z)(sn)==="object")return sn.clearIcon;if(Dn)return Dn},[sn,Dn]),Gi=Ge.useMemo(function(){return!!(!Di&&sn&&(it.length||cn)&&!(qt==="combobox"&&cn===""))},[sn,Di,it.length,cn,qt]);return{allowClear:Gi,clearIcon:Ge.createElement(de,{className:"".concat(_t,"-clear"),onMouseDown:hi,customizeIcon:an},"\xD7")}},pe=Ge.createContext(null);function ye(){return Ge.useContext(pe)}function we(){var It=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,_t=Ge.useState(!1),hi=(0,mt.Z)(_t,2),it=hi[0],sn=hi[1],Dn=Ge.useRef(null),Di=function(){window.clearTimeout(Dn.current)};Ge.useEffect(function(){return Di},[]);var cn=function(an,Gi){Di(),Dn.current=window.setTimeout(function(){sn(an),Gi&&Gi()},It)};return[it,cn,Di]}function be(){var It=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,_t=Ge.useRef(null),hi=Ge.useRef(null);Ge.useEffect(function(){return function(){window.clearTimeout(hi.current)}},[]);function it(sn){(sn||_t.current===null)&&(_t.current=sn),window.clearTimeout(hi.current),hi.current=window.setTimeout(function(){_t.current=null},It)}return[function(){return _t.current},it]}function Ie(It,_t,hi,it){var sn=Ge.useRef(null);sn.current={open:_t,triggerOpen:hi,customizedTrigger:it},Ge.useEffect(function(){function Dn(Di){var cn;if(!((cn=sn.current)!==null&&cn!==void 0&&cn.customizedTrigger)){var qt=Di.target;qt.shadowRoot&&Di.composed&&(qt=Di.composedPath()[0]||qt),sn.current.open&&It().filter(function(an){return an}).every(function(an){return!an.contains(qt)&&an!==qt})&&sn.current.triggerOpen(!1)}}return window.addEventListener("mousedown",Dn),function(){return window.removeEventListener("mousedown",Dn)}},[])}var Re=Le(10228);function rt(It){return It&&![Re.Z.ESC,Re.Z.SHIFT,Re.Z.BACKSPACE,Re.Z.TAB,Re.Z.WIN_KEY,Re.Z.ALT,Re.Z.META,Re.Z.WIN_KEY_RIGHT,Re.Z.CTRL,Re.Z.SEMICOLON,Re.Z.EQUALS,Re.Z.CAPS_LOCK,Re.Z.CONTEXT_MENU,Re.Z.F1,Re.Z.F2,Re.Z.F3,Re.Z.F4,Re.Z.F5,Re.Z.F6,Re.Z.F7,Re.Z.F8,Re.Z.F9,Re.Z.F10,Re.Z.F11,Re.Z.F12].includes(It)}var et=Le(26112),Ye=Le(11780),ut=function(_t,hi){var it,sn=_t.prefixCls,Dn=_t.id,Di=_t.inputElement,cn=_t.disabled,qt=_t.tabIndex,an=_t.autoFocus,Gi=_t.autoComplete,ur=_t.editable,Hi=_t.activeDescendantId,Mi=_t.value,Ri=_t.maxLength,dr=_t.onKeyDown,Er=_t.onMouseDown,Ar=_t.onChange,wn=_t.onPaste,Yo=_t.onCompositionStart,zr=_t.onCompositionEnd,mo=_t.onBlur,en=_t.open,li=_t.attrs,nr=Di||Ge.createElement("input",null),Sr=nr,vr=Sr.ref,Ir=Sr.props,bo=Ir.onKeyDown,fo=Ir.onChange,so=Ir.onMouseDown,lo=Ir.onCompositionStart,Tn=Ir.onCompositionEnd,qo=Ir.onBlur,Zn=Ir.style;return(0,dt.Kp)(!("maxLength"in nr.props),"Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."),nr=Ge.cloneElement(nr,(0,yt.Z)((0,yt.Z)((0,yt.Z)({type:"search"},Ir),{},{id:Dn,ref:(0,ne.sQ)(hi,vr),disabled:cn,tabIndex:qt,autoComplete:Gi||"off",autoFocus:an,className:ot()("".concat(sn,"-selection-search-input"),(it=nr)===null||it===void 0||(it=it.props)===null||it===void 0?void 0:it.className),role:"combobox","aria-expanded":en||!1,"aria-haspopup":"listbox","aria-owns":"".concat(Dn,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(Dn,"_list"),"aria-activedescendant":en?Hi:void 0},li),{},{value:ur?Mi:"",maxLength:Ri,readOnly:!ur,unselectable:ur?null:"on",style:(0,yt.Z)((0,yt.Z)({},Zn),{},{opacity:ur?null:0}),onKeyDown:function(Or){dr(Or),bo&&bo(Or)},onMouseDown:function(Or){Er(Or),so&&so(Or)},onChange:function(Or){Ar(Or),fo&&fo(Or)},onCompositionStart:function(Or){Yo(Or),lo&&lo(Or)},onCompositionEnd:function(Or){zr(Or),Tn&&Tn(Or)},onPaste:wn,onBlur:function(Or){mo(Or),qo&&qo(Or)}})),nr},tt=Ge.forwardRef(ut),wt=tt;function St(It){return Array.isArray(It)?It:It!==void 0?[It]:[]}var Lt=typeof window!="undefined"&&window.document&&window.document.documentElement,mn=Lt;function $t(It){return It!=null}function Pn(It){return!It&&It!==0}function Ot(It){return["string","number"].includes((0,at.Z)(It))}function ct(It){var _t=void 0;return It&&(Ot(It.title)?_t=It.title.toString():Ot(It.label)&&(_t=It.label.toString())),_t}function nt(It,_t){mn?Ge.useLayoutEffect(It,_t):Ge.useEffect(It,_t)}function gn(It){var _t;return(_t=It.key)!==null&&_t!==void 0?_t:It.value}var oi=function(_t){_t.preventDefault(),_t.stopPropagation()},zn=function(_t){var hi=_t.id,it=_t.prefixCls,sn=_t.values,Dn=_t.open,Di=_t.searchValue,cn=_t.autoClearSearchValue,qt=_t.inputRef,an=_t.placeholder,Gi=_t.disabled,ur=_t.mode,Hi=_t.showSearch,Mi=_t.autoFocus,Ri=_t.autoComplete,dr=_t.activeDescendantId,Er=_t.tabIndex,Ar=_t.removeIcon,wn=_t.maxTagCount,Yo=_t.maxTagTextLength,zr=_t.maxTagPlaceholder,mo=zr===void 0?function(Wi){return"+ ".concat(Wi.length," ...")}:zr,en=_t.tagRender,li=_t.onToggleOpen,nr=_t.onRemove,Sr=_t.onInputChange,vr=_t.onInputPaste,Ir=_t.onInputKeyDown,bo=_t.onInputMouseDown,fo=_t.onInputCompositionStart,so=_t.onInputCompositionEnd,lo=_t.onInputBlur,Tn=Ge.useRef(null),qo=(0,Ge.useState)(0),Zn=(0,mt.Z)(qo,2),wr=Zn[0],Or=Zn[1],hr=(0,Ge.useState)(!1),la=(0,mt.Z)(hr,2),ca=la[0],Qo=la[1],zo="".concat(it,"-selection"),Vt=Dn||ur==="multiple"&&cn===!1||ur==="tags"?Di:"",On=ur==="tags"||ur==="multiple"&&cn===!1||Hi&&(Dn||ca);nt(function(){Or(Tn.current.scrollWidth)},[Vt]);var Ut=function(Wn,mi,Si,Ei,bi){return Ge.createElement("span",{title:ct(Wn),className:ot()("".concat(zo,"-item"),(0,ft.Z)({},"".concat(zo,"-item-disabled"),Si))},Ge.createElement("span",{className:"".concat(zo,"-item-content")},mi),Ei&&Ge.createElement(de,{className:"".concat(zo,"-item-remove"),onMouseDown:oi,onClick:bi,customizeIcon:Ar},"\xD7"))},_e=function(Wn,mi,Si,Ei,bi,gr){var qi=function(bn){oi(bn),li(!Dn)};return Ge.createElement("span",{onMouseDown:qi},en({label:mi,value:Wn,disabled:Si,closable:Ei,onClose:bi,isMaxTag:!!gr}))},pi=function(Wn){var mi=Wn.disabled,Si=Wn.label,Ei=Wn.value,bi=!Gi&&!mi,gr=Si;if(typeof Yo=="number"&&(typeof Si=="string"||typeof Si=="number")){var qi=String(gr);qi.length>Yo&&(gr="".concat(qi.slice(0,Yo),"..."))}var Ui=function(Yi){Yi&&Yi.stopPropagation(),nr(Wn)};return typeof en=="function"?_e(Ei,gr,mi,bi,Ui):Ut(Wn,gr,mi,bi,Ui)},Vn=function(Wn){if(!sn.length)return null;var mi=typeof mo=="function"?mo(Wn):mo;return typeof en=="function"?_e(void 0,mi,!1,!1,void 0,!0):Ut({title:mi},mi,!1)},qn=Ge.createElement("div",{className:"".concat(zo,"-search"),style:{width:wr},onFocus:function(){Qo(!0)},onBlur:function(){Qo(!1)}},Ge.createElement(wt,{ref:qt,open:Dn,prefixCls:it,id:hi,inputElement:null,disabled:Gi,autoFocus:Mi,autoComplete:Ri,editable:On,activeDescendantId:dr,value:Vt,onKeyDown:Ir,onMouseDown:bo,onChange:Sr,onPaste:vr,onCompositionStart:fo,onCompositionEnd:so,onBlur:lo,tabIndex:Er,attrs:(0,et.Z)(_t,!0)}),Ge.createElement("span",{ref:Tn,className:"".concat(zo,"-search-mirror"),"aria-hidden":!0},Vt,"\xA0")),ki=Ge.createElement(Ye.Z,{prefixCls:"".concat(zo,"-overflow"),data:sn,renderItem:pi,renderRest:Vn,suffix:qn,itemKey:gn,maxCount:wn});return Ge.createElement("span",{className:"".concat(zo,"-wrap")},ki,!sn.length&&!Vt&&Ge.createElement("span",{className:"".concat(zo,"-placeholder")},an))},Ht=zn,Fn=function(_t){var hi=_t.inputElement,it=_t.prefixCls,sn=_t.id,Dn=_t.inputRef,Di=_t.disabled,cn=_t.autoFocus,qt=_t.autoComplete,an=_t.activeDescendantId,Gi=_t.mode,ur=_t.open,Hi=_t.values,Mi=_t.placeholder,Ri=_t.tabIndex,dr=_t.showSearch,Er=_t.searchValue,Ar=_t.activeValue,wn=_t.maxLength,Yo=_t.onInputKeyDown,zr=_t.onInputMouseDown,mo=_t.onInputChange,en=_t.onInputPaste,li=_t.onInputCompositionStart,nr=_t.onInputCompositionEnd,Sr=_t.onInputBlur,vr=_t.title,Ir=Ge.useState(!1),bo=(0,mt.Z)(Ir,2),fo=bo[0],so=bo[1],lo=Gi==="combobox",Tn=lo||dr,qo=Hi[0],Zn=Er||"";lo&&Ar&&!fo&&(Zn=Ar),Ge.useEffect(function(){lo&&so(!1)},[lo,Ar]);var wr=Gi!=="combobox"&&!ur&&!dr?!1:!!Zn,Or=vr===void 0?ct(qo):vr,hr=Ge.useMemo(function(){return qo?null:Ge.createElement("span",{className:"".concat(it,"-selection-placeholder"),style:wr?{visibility:"hidden"}:void 0},Mi)},[qo,wr,Mi,it]);return Ge.createElement("span",{className:"".concat(it,"-selection-wrap")},Ge.createElement("span",{className:"".concat(it,"-selection-search")},Ge.createElement(wt,{ref:Dn,prefixCls:it,id:sn,open:ur,inputElement:hi,disabled:Di,autoFocus:cn,autoComplete:qt,editable:Tn,activeDescendantId:an,value:Zn,onKeyDown:Yo,onMouseDown:zr,onChange:function(ca){so(!0),mo(ca)},onPaste:en,onCompositionStart:li,onCompositionEnd:nr,onBlur:Sr,tabIndex:Ri,attrs:(0,et.Z)(_t,!0),maxLength:lo?wn:void 0})),!lo&&qo?Ge.createElement("span",{className:"".concat(it,"-selection-item"),title:Or,style:wr?{visibility:"hidden"}:void 0},qo.label):null,hr)},Cn=Fn,ii=function(_t,hi){var it=(0,Ge.useRef)(null),sn=(0,Ge.useRef)(!1),Dn=_t.prefixCls,Di=_t.open,cn=_t.mode,qt=_t.showSearch,an=_t.tokenWithEnter,Gi=_t.disabled,ur=_t.prefix,Hi=_t.autoClearSearchValue,Mi=_t.onSearch,Ri=_t.onSearchSubmit,dr=_t.onToggleOpen,Er=_t.onInputKeyDown,Ar=_t.onInputBlur,wn=_t.domRef;Ge.useImperativeHandle(hi,function(){return{focus:function(Or){it.current.focus(Or)},blur:function(){it.current.blur()}}});var Yo=be(0),zr=(0,mt.Z)(Yo,2),mo=zr[0],en=zr[1],li=function(Or){var hr=Or.which,la=it.current instanceof HTMLTextAreaElement;!la&&Di&&(hr===Re.Z.UP||hr===Re.Z.DOWN)&&Or.preventDefault(),Er&&Er(Or),hr===Re.Z.ENTER&&cn==="tags"&&!sn.current&&!Di&&(Ri==null||Ri(Or.target.value)),!(la&&!Di&&~[Re.Z.UP,Re.Z.DOWN,Re.Z.LEFT,Re.Z.RIGHT].indexOf(hr))&&rt(hr)&&dr(!0)},nr=function(){en(!0)},Sr=(0,Ge.useRef)(null),vr=function(Or){Mi(Or,!0,sn.current)!==!1&&dr(!0)},Ir=function(){sn.current=!0},bo=function(Or){sn.current=!1,cn!=="combobox"&&vr(Or.target.value)},fo=function(Or){var hr=Or.target.value;if(an&&Sr.current&&/[\r\n]/.test(Sr.current)){var la=Sr.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");hr=hr.replace(la,Sr.current)}Sr.current=null,vr(hr)},so=function(Or){var hr=Or.clipboardData,la=hr==null?void 0:hr.getData("text");Sr.current=la||""},lo=function(Or){var hr=Or.target;if(hr!==it.current){var la=document.body.style.msTouchAction!==void 0;la?setTimeout(function(){it.current.focus()}):it.current.focus()}},Tn=function(Or){var hr=mo();Or.target!==it.current&&!hr&&!(cn==="combobox"&&Gi)&&Or.preventDefault(),(cn!=="combobox"&&(!qt||!hr)||!Di)&&(Di&&Hi!==!1&&Mi("",!0,!1),dr())},qo={inputRef:it,onInputKeyDown:li,onInputMouseDown:nr,onInputChange:fo,onInputPaste:so,onInputCompositionStart:Ir,onInputCompositionEnd:bo,onInputBlur:Ar},Zn=cn==="multiple"||cn==="tags"?Ge.createElement(Ht,(0,ue.Z)({},_t,qo)):Ge.createElement(Cn,(0,ue.Z)({},_t,qo));return Ge.createElement("div",{ref:wn,className:"".concat(Dn,"-selector"),onClick:lo,onMouseDown:Tn},ur&&Ge.createElement("div",{className:"".concat(Dn,"-prefix")},ur),Zn)},Wt=Ge.forwardRef(ii),Hn=Wt,lt=Le(65352),An=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],Ni=function(_t){var hi=_t===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:hi,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:hi,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:hi,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:hi,adjustY:1},htmlRegion:"scroll"}}},je=function(_t,hi){var it=_t.prefixCls,sn=_t.disabled,Dn=_t.visible,Di=_t.children,cn=_t.popupElement,qt=_t.animation,an=_t.transitionName,Gi=_t.dropdownStyle,ur=_t.dropdownClassName,Hi=_t.direction,Mi=Hi===void 0?"ltr":Hi,Ri=_t.placement,dr=_t.builtinPlacements,Er=_t.dropdownMatchSelectWidth,Ar=_t.dropdownRender,wn=_t.dropdownAlign,Yo=_t.getPopupContainer,zr=_t.empty,mo=_t.getTriggerDOMNode,en=_t.onPopupVisibleChange,li=_t.onPopupMouseEnter,nr=(0,Oe.Z)(_t,An),Sr="".concat(it,"-dropdown"),vr=cn;Ar&&(vr=Ar(cn));var Ir=Ge.useMemo(function(){return dr||Ni(Er)},[dr,Er]),bo=qt?"".concat(Sr,"-").concat(qt):an,fo=typeof Er=="number",so=Ge.useMemo(function(){return fo?null:Er===!1?"minWidth":"width"},[Er,fo]),lo=Gi;fo&&(lo=(0,yt.Z)((0,yt.Z)({},lo),{},{width:Er}));var Tn=Ge.useRef(null);return Ge.useImperativeHandle(hi,function(){return{getPopupElement:function(){var Zn;return(Zn=Tn.current)===null||Zn===void 0?void 0:Zn.popupElement}}}),Ge.createElement(lt.Z,(0,ue.Z)({},nr,{showAction:en?["click"]:[],hideAction:en?["click"]:[],popupPlacement:Ri||(Mi==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:Ir,prefixCls:Sr,popupTransitionName:bo,popup:Ge.createElement("div",{onMouseEnter:li},vr),ref:Tn,stretch:so,popupAlign:wn,popupVisible:Dn,getPopupContainer:Yo,popupClassName:ot()(ur,(0,ft.Z)({},"".concat(Sr,"-empty"),zr)),popupStyle:lo,getTriggerDOMNode:mo,onPopupVisibleChange:en}),Di)},Me=Ge.forwardRef(je),Ee=Me,De=Le(68413);function We(It,_t){var hi=It.key,it;return"value"in It&&(it=It.value),hi!=null?hi:it!==void 0?it:"rc-index-key-".concat(_t)}function Ae(It){return typeof It!="undefined"&&!Number.isNaN(It)}function Je(It,_t){var hi=It||{},it=hi.label,sn=hi.value,Dn=hi.options,Di=hi.groupLabel,cn=it||(_t?"children":"label");return{label:cn,value:sn||"value",options:Dn||"options",groupLabel:Di||cn}}function Nt(It){var _t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},hi=_t.fieldNames,it=_t.childrenAsData,sn=[],Dn=Je(hi,!1),Di=Dn.label,cn=Dn.value,qt=Dn.options,an=Dn.groupLabel;function Gi(ur,Hi){Array.isArray(ur)&&ur.forEach(function(Mi){if(Hi||!(qt in Mi)){var Ri=Mi[cn];sn.push({key:We(Mi,sn.length),groupOption:Hi,data:Mi,label:Mi[Di],value:Ri})}else{var dr=Mi[an];dr===void 0&&it&&(dr=Mi.label),sn.push({key:We(Mi,sn.length),group:!0,data:Mi,label:dr}),Gi(Mi[qt],!0)}})}return Gi(It,!1),sn}function fn(It){var _t=(0,yt.Z)({},It);return"props"in _t||Object.defineProperty(_t,"props",{get:function(){return(0,dt.ZP)(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),_t}}),_t}var vn=function(_t,hi,it){if(!hi||!hi.length)return null;var sn=!1,Dn=function cn(qt,an){var Gi=(0,De.Z)(an),ur=Gi[0],Hi=Gi.slice(1);if(!ur)return[qt];var Mi=qt.split(ur);return sn=sn||Mi.length>1,Mi.reduce(function(Ri,dr){return[].concat((0,Ke.Z)(Ri),(0,Ke.Z)(cn(dr,Hi)))},[]).filter(Boolean)},Di=Dn(_t,hi);return sn?typeof it!="undefined"?Di.slice(0,it):Di:null},Ft=Ge.createContext(null),Jt=Ft;function jt(It){var _t=It.visible,hi=It.values;if(!_t)return null;var it=50;return Ge.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(hi.slice(0,it).map(function(sn){var Dn=sn.label,Di=sn.value;return["number","string"].includes((0,at.Z)(Dn))?Dn:Di}).join(", ")),hi.length>it?", ...":null)}var pn=["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"],jn=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],Nn=function(_t){return _t==="tags"||_t==="multiple"},Mn=Ge.forwardRef(function(It,_t){var hi,it=It.id,sn=It.prefixCls,Dn=It.className,Di=It.showSearch,cn=It.tagRender,qt=It.direction,an=It.omitDomProps,Gi=It.displayValues,ur=It.onDisplayValuesChange,Hi=It.emptyOptions,Mi=It.notFoundContent,Ri=Mi===void 0?"Not Found":Mi,dr=It.onClear,Er=It.mode,Ar=It.disabled,wn=It.loading,Yo=It.getInputElement,zr=It.getRawInputElement,mo=It.open,en=It.defaultOpen,li=It.onDropdownVisibleChange,nr=It.activeValue,Sr=It.onActiveValueChange,vr=It.activeDescendantId,Ir=It.searchValue,bo=It.autoClearSearchValue,fo=It.onSearch,so=It.onSearchSplit,lo=It.tokenSeparators,Tn=It.allowClear,qo=It.prefix,Zn=It.suffixIcon,wr=It.clearIcon,Or=It.OptionList,hr=It.animation,la=It.transitionName,ca=It.dropdownStyle,Qo=It.dropdownClassName,zo=It.dropdownMatchSelectWidth,Vt=It.dropdownRender,On=It.dropdownAlign,Ut=It.placement,_e=It.builtinPlacements,pi=It.getPopupContainer,Vn=It.showAction,qn=Vn===void 0?[]:Vn,ki=It.onFocus,Wi=It.onBlur,Wn=It.onKeyUp,mi=It.onKeyDown,Si=It.onMouseDown,Ei=(0,Oe.Z)(It,pn),bi=Nn(Er),gr=(Di!==void 0?Di:bi)||Er==="combobox",qi=(0,yt.Z)({},Ei);jn.forEach(function(oo){delete qi[oo]}),an==null||an.forEach(function(oo){delete qi[oo]});var Ui=Ge.useState(!1),bn=(0,mt.Z)(Ui,2),Yi=bn[0],rr=bn[1];Ge.useEffect(function(){rr((0,Te.Z)())},[]);var Po=Ge.useRef(null),uo=Ge.useRef(null),No=Ge.useRef(null),Do=Ge.useRef(null),Io=Ge.useRef(null),fa=Ge.useRef(!1),na=we(),za=(0,mt.Z)(na,3),zt=za[0],To=za[1],Pr=za[2];Ge.useImperativeHandle(_t,function(){var oo,Yr;return{focus:(oo=Do.current)===null||oo===void 0?void 0:oo.focus,blur:(Yr=Do.current)===null||Yr===void 0?void 0:Yr.blur,scrollTo:function(Ra){var Ha;return(Ha=Io.current)===null||Ha===void 0?void 0:Ha.scrollTo(Ra)},nativeElement:Po.current||uo.current}});var eo=Ge.useMemo(function(){var oo;if(Er!=="combobox")return Ir;var Yr=(oo=Gi[0])===null||oo===void 0?void 0:oo.value;return typeof Yr=="string"||typeof Yr=="number"?String(Yr):""},[Ir,Er,Gi]),Zo=Er==="combobox"&&typeof Yo=="function"&&Yo()||null,Wr=typeof zr=="function"&&zr(),ba=(0,ne.x1)(uo,Wr==null||(hi=Wr.props)===null||hi===void 0?void 0:hi.ref),ga=Ge.useState(!1),Uo=(0,mt.Z)(ga,2),Fo=Uo[0],vs=Uo[1];(0,At.Z)(function(){vs(!0)},[]);var Qa=(0,Ct.Z)(!1,{defaultValue:en,value:mo}),ns=(0,mt.Z)(Qa,2),ds=ns[0],Vr=ns[1],wa=Fo?ds:!1,Ba=!Ri&&Hi;(Ar||Ba&&wa&&Er==="combobox")&&(wa=!1);var is=Ba?!1:wa,Vo=Ge.useCallback(function(oo){var Yr=oo!==void 0?oo:!wa;Ar||(Vr(Yr),wa!==Yr&&(li==null||li(Yr)))},[Ar,wa,Vr,li]),Ko=Ge.useMemo(function(){return(lo||[]).some(function(oo){return[`
|
|
`,`\r
|
|
`].includes(oo)})},[lo]),ni=Ge.useContext(Jt)||{},to=ni.maxCount,Xo=ni.rawValues,Ia=function(Yr,wo,Ra){if(!(bi&&Ae(to)&&(Xo==null?void 0:Xo.size)>=to)){var Ha=!0,Mt=Yr;Sr==null||Sr(null);var Pt=vn(Yr,lo,Ae(to)?to-Xo.size:void 0),ln=Ra?null:Pt;return Er!=="combobox"&&ln&&(Mt="",so==null||so(ln),Vo(!1),Ha=!1),fo&&eo!==Mt&&fo(Mt,{source:wo?"typing":"effect"}),Ha}},ms=function(Yr){!Yr||!Yr.trim()||fo(Yr,{source:"submit"})};Ge.useEffect(function(){!wa&&!bi&&Er!=="combobox"&&Ia("",!1,!1)},[wa]),Ge.useEffect(function(){ds&&Ar&&Vr(!1),Ar&&!fa.current&&To(!1)},[Ar]);var cs=be(),yo=(0,mt.Z)(cs,2),as=yo[0],ls=yo[1],Yt=Ge.useRef(!1),Xt=function(Yr){var wo=as(),Ra=Yr.key,Ha=Ra==="Enter";if(Ha&&(Er!=="combobox"&&Yr.preventDefault(),wa||Vo(!0)),ls(!!eo),Ra==="Backspace"&&!wo&&bi&&!eo&&Gi.length){for(var Mt=(0,Ke.Z)(Gi),Pt=null,ln=Mt.length-1;ln>=0;ln-=1){var He=Mt[ln];if(!He.disabled){Mt.splice(ln,1),Pt=He;break}}Pt&&ur(Mt,{type:"remove",values:[Pt]})}for(var Dt=arguments.length,Xi=new Array(Dt>1?Dt-1:0),Mr=1;Mr<Dt;Mr++)Xi[Mr-1]=arguments[Mr];if(wa&&(!Ha||!Yt.current)){var Qi;Ha&&(Yt.current=!0),(Qi=Io.current)===null||Qi===void 0||Qi.onKeyDown.apply(Qi,[Yr].concat(Xi))}mi==null||mi.apply(void 0,[Yr].concat(Xi))},kn=function(Yr){for(var wo=arguments.length,Ra=new Array(wo>1?wo-1:0),Ha=1;Ha<wo;Ha++)Ra[Ha-1]=arguments[Ha];if(wa){var Mt;(Mt=Io.current)===null||Mt===void 0||Mt.onKeyUp.apply(Mt,[Yr].concat(Ra))}Yr.key==="Enter"&&(Yt.current=!1),Wn==null||Wn.apply(void 0,[Yr].concat(Ra))},Zi=function(Yr){var wo=Gi.filter(function(Ra){return Ra!==Yr});ur(wo,{type:"remove",values:[Yr]})},yi=function(){Yt.current=!1},Ai=Ge.useRef(!1),Li=function(){To(!0),Ar||(ki&&!Ai.current&&ki.apply(void 0,arguments),qn.includes("focus")&&Vo(!0)),Ai.current=!0},Rn=function(){fa.current=!0,To(!1,function(){Ai.current=!1,fa.current=!1,Vo(!1)}),!Ar&&(eo&&(Er==="tags"?fo(eo,{source:"submit"}):Er==="multiple"&&fo("",{source:"blur"})),Wi&&Wi.apply(void 0,arguments))},ri=[];Ge.useEffect(function(){return function(){ri.forEach(function(oo){return clearTimeout(oo)}),ri.splice(0,ri.length)}},[]);var ir=function(Yr){var wo,Ra=Yr.target,Ha=(wo=No.current)===null||wo===void 0?void 0:wo.getPopupElement();if(Ha&&Ha.contains(Ra)){var Mt=setTimeout(function(){var Dt=ri.indexOf(Mt);if(Dt!==-1&&ri.splice(Dt,1),Pr(),!Yi&&!Ha.contains(document.activeElement)){var Xi;(Xi=Do.current)===null||Xi===void 0||Xi.focus()}});ri.push(Mt)}for(var Pt=arguments.length,ln=new Array(Pt>1?Pt-1:0),He=1;He<Pt;He++)ln[He-1]=arguments[He];Si==null||Si.apply(void 0,[Yr].concat(ln))},Rr=Ge.useState({}),ea=(0,mt.Z)(Rr,2),_o=ea[1];function Pa(){_o({})}var xa;Wr&&(xa=function(Yr){Vo(Yr)}),Ie(function(){var oo;return[Po.current,(oo=No.current)===null||oo===void 0?void 0:oo.getPopupElement()]},is,Vo,!!Wr);var vo=Ge.useMemo(function(){return(0,yt.Z)((0,yt.Z)({},It),{},{notFoundContent:Ri,open:wa,triggerOpen:is,id:it,showSearch:gr,multiple:bi,toggleOpen:Vo})},[It,Ri,is,wa,it,gr,bi,Vo]),Kr=!!Zn||wn,er;Kr&&(er=Ge.createElement(de,{className:ot()("".concat(sn,"-arrow"),(0,ft.Z)({},"".concat(sn,"-arrow-loading"),wn)),customizeIcon:Zn,customizeIconProps:{loading:wn,searchValue:eo,open:wa,focused:zt,showSearch:gr}}));var ia=function(){var Yr;dr==null||dr(),(Yr=Do.current)===null||Yr===void 0||Yr.focus(),ur([],{type:"clear",values:Gi}),Ia("",!1,!1)},sa=se(sn,ia,Gi,Tn,wr,Ar,eo,Er),Ma=sa.allowClear,Oa=sa.clearIcon,Oo=Ge.createElement(Or,{ref:Io}),ua=ot()(sn,Dn,(0,ft.Z)((0,ft.Z)((0,ft.Z)((0,ft.Z)((0,ft.Z)((0,ft.Z)((0,ft.Z)((0,ft.Z)((0,ft.Z)((0,ft.Z)({},"".concat(sn,"-focused"),zt),"".concat(sn,"-multiple"),bi),"".concat(sn,"-single"),!bi),"".concat(sn,"-allow-clear"),Tn),"".concat(sn,"-show-arrow"),Kr),"".concat(sn,"-disabled"),Ar),"".concat(sn,"-loading"),wn),"".concat(sn,"-open"),wa),"".concat(sn,"-customize-input"),Zo),"".concat(sn,"-show-search"),gr)),Lo=Ge.createElement(Ee,{ref:No,disabled:Ar,prefixCls:sn,visible:is,popupElement:Oo,animation:hr,transitionName:la,dropdownStyle:ca,dropdownClassName:Qo,direction:qt,dropdownMatchSelectWidth:zo,dropdownRender:Vt,dropdownAlign:On,placement:Ut,builtinPlacements:_e,getPopupContainer:pi,empty:Hi,getTriggerDOMNode:function(Yr){return uo.current||Yr},onPopupVisibleChange:xa,onPopupMouseEnter:Pa},Wr?Ge.cloneElement(Wr,{ref:ba}):Ge.createElement(Hn,(0,ue.Z)({},It,{domRef:uo,prefixCls:sn,inputElement:Zo,ref:Do,id:it,prefix:qo,showSearch:gr,autoClearSearchValue:bo,mode:Er,activeDescendantId:vr,tagRender:cn,values:Gi,open:wa,onToggleOpen:Vo,activeValue:nr,searchValue:eo,onSearch:Ia,onSearchSubmit:ms,onRemove:Zi,tokenWithEnter:Ko,onInputBlur:yi}))),jr;return Wr?jr=Lo:jr=Ge.createElement("div",(0,ue.Z)({className:ua},qi,{ref:Po,onMouseDown:ir,onKeyDown:Xt,onKeyUp:kn,onFocus:Li,onBlur:Rn}),Ge.createElement(jt,{visible:zt&&!wa,values:Gi}),Lo,er,Ma&&Oa),Ge.createElement(pe.Provider,{value:vo},jr)}),fr=Mn,nn=function(){return null};nn.isSelectOptGroup=!0;var tn=nn,hn=function(){return null};hn.isSelectOption=!0;var di=hn,Sn=Le(80547),Kt=Le(2738),gi=Le(45680);function Vi(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var Pi=["disabled","title","children","style","className"];function Ii(It){return typeof It=="string"||typeof It=="number"}var Fr=function(_t,hi){var it=ye(),sn=it.prefixCls,Dn=it.id,Di=it.open,cn=it.multiple,qt=it.mode,an=it.searchValue,Gi=it.toggleOpen,ur=it.notFoundContent,Hi=it.onPopupScroll,Mi=Ge.useContext(Jt),Ri=Mi.maxCount,dr=Mi.flattenOptions,Er=Mi.onActiveValue,Ar=Mi.defaultActiveFirstOption,wn=Mi.onSelect,Yo=Mi.menuItemSelectedIcon,zr=Mi.rawValues,mo=Mi.fieldNames,en=Mi.virtual,li=Mi.direction,nr=Mi.listHeight,Sr=Mi.listItemHeight,vr=Mi.optionRender,Ir="".concat(sn,"-item"),bo=(0,Sn.Z)(function(){return dr},[Di,dr],function(Vn,qn){return qn[0]&&Vn[1]!==qn[1]}),fo=Ge.useRef(null),so=Ge.useMemo(function(){return cn&&Ae(Ri)&&(zr==null?void 0:zr.size)>=Ri},[cn,Ri,zr==null?void 0:zr.size]),lo=function(qn){qn.preventDefault()},Tn=function(qn){var ki;(ki=fo.current)===null||ki===void 0||ki.scrollTo(typeof qn=="number"?{index:qn}:qn)},qo=Ge.useCallback(function(Vn){return qt==="combobox"?!1:zr.has(Vn)},[qt,(0,Ke.Z)(zr).toString(),zr.size]),Zn=function(qn){for(var ki=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Wi=bo.length,Wn=0;Wn<Wi;Wn+=1){var mi=(qn+Wn*ki+Wi)%Wi,Si=bo[mi]||{},Ei=Si.group,bi=Si.data;if(!Ei&&!(bi!=null&&bi.disabled)&&(qo(bi.value)||!so))return mi}return-1},wr=Ge.useState(function(){return Zn(0)}),Or=(0,mt.Z)(wr,2),hr=Or[0],la=Or[1],ca=function(qn){var ki=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;la(qn);var Wi={source:ki?"keyboard":"mouse"},Wn=bo[qn];if(!Wn){Er(null,-1,Wi);return}Er(Wn.value,qn,Wi)};(0,Ge.useEffect)(function(){ca(Ar!==!1?Zn(0):-1)},[bo.length,an]);var Qo=Ge.useCallback(function(Vn){return qt==="combobox"?String(Vn).toLowerCase()===an.toLowerCase():zr.has(Vn)},[qt,an,(0,Ke.Z)(zr).toString(),zr.size]);(0,Ge.useEffect)(function(){var Vn=setTimeout(function(){if(!cn&&Di&&zr.size===1){var ki=Array.from(zr)[0],Wi=bo.findIndex(function(Wn){var mi=Wn.data;return mi.value===ki});Wi!==-1&&(ca(Wi),Tn(Wi))}});if(Di){var qn;(qn=fo.current)===null||qn===void 0||qn.scrollTo(void 0)}return function(){return clearTimeout(Vn)}},[Di,an]);var zo=function(qn){qn!==void 0&&wn(qn,{selected:!zr.has(qn)}),cn||Gi(!1)};if(Ge.useImperativeHandle(hi,function(){return{onKeyDown:function(qn){var ki=qn.which,Wi=qn.ctrlKey;switch(ki){case Re.Z.N:case Re.Z.P:case Re.Z.UP:case Re.Z.DOWN:{var Wn=0;if(ki===Re.Z.UP?Wn=-1:ki===Re.Z.DOWN?Wn=1:Vi()&&Wi&&(ki===Re.Z.N?Wn=1:ki===Re.Z.P&&(Wn=-1)),Wn!==0){var mi=Zn(hr+Wn,Wn);Tn(mi),ca(mi,!0)}break}case Re.Z.TAB:case Re.Z.ENTER:{var Si,Ei=bo[hr];Ei&&!(Ei!=null&&(Si=Ei.data)!==null&&Si!==void 0&&Si.disabled)&&!so?zo(Ei.value):zo(void 0),Di&&qn.preventDefault();break}case Re.Z.ESC:Gi(!1),Di&&qn.stopPropagation()}},onKeyUp:function(){},scrollTo:function(qn){Tn(qn)}}}),bo.length===0)return Ge.createElement("div",{role:"listbox",id:"".concat(Dn,"_list"),className:"".concat(Ir,"-empty"),onMouseDown:lo},ur);var Vt=Object.keys(mo).map(function(Vn){return mo[Vn]}),On=function(qn){return qn.label};function Ut(Vn,qn){var ki=Vn.group;return{role:ki?"presentation":"option",id:"".concat(Dn,"_list_").concat(qn)}}var _e=function(qn){var ki=bo[qn];if(!ki)return null;var Wi=ki.data||{},Wn=Wi.value,mi=ki.group,Si=(0,et.Z)(Wi,!0),Ei=On(ki);return ki?Ge.createElement("div",(0,ue.Z)({"aria-label":typeof Ei=="string"&&!mi?Ei:null},Si,{key:qn},Ut(ki,qn),{"aria-selected":Qo(Wn)}),Wn):null},pi={role:"listbox",id:"".concat(Dn,"_list")};return Ge.createElement(Ge.Fragment,null,en&&Ge.createElement("div",(0,ue.Z)({},pi,{style:{height:0,width:0,overflow:"hidden"}}),_e(hr-1),_e(hr),_e(hr+1)),Ge.createElement(gi.Z,{itemKey:"key",ref:fo,data:bo,height:nr,itemHeight:Sr,fullHeight:!1,onMouseDown:lo,onScroll:Hi,virtual:en,direction:li,innerProps:en?null:pi},function(Vn,qn){var ki=Vn.group,Wi=Vn.groupOption,Wn=Vn.data,mi=Vn.label,Si=Vn.value,Ei=Wn.key;if(ki){var bi,gr=(bi=Wn.title)!==null&&bi!==void 0?bi:Ii(mi)?mi.toString():void 0;return Ge.createElement("div",{className:ot()(Ir,"".concat(Ir,"-group"),Wn.className),title:gr},mi!==void 0?mi:Ei)}var qi=Wn.disabled,Ui=Wn.title,bn=Wn.children,Yi=Wn.style,rr=Wn.className,Po=(0,Oe.Z)(Wn,Pi),uo=(0,Kt.Z)(Po,Vt),No=qo(Si),Do=qi||!No&&so,Io="".concat(Ir,"-option"),fa=ot()(Ir,Io,rr,(0,ft.Z)((0,ft.Z)((0,ft.Z)((0,ft.Z)({},"".concat(Io,"-grouped"),Wi),"".concat(Io,"-active"),hr===qn&&!Do),"".concat(Io,"-disabled"),Do),"".concat(Io,"-selected"),No)),na=On(Vn),za=!Yo||typeof Yo=="function"||No,zt=typeof na=="number"?na:na||Si,To=Ii(zt)?zt.toString():void 0;return Ui!==void 0&&(To=Ui),Ge.createElement("div",(0,ue.Z)({},(0,et.Z)(uo),en?{}:Ut(Vn,qn),{"aria-selected":Qo(Si),className:fa,title:To,onMouseMove:function(){hr===qn||Do||ca(qn)},onClick:function(){Do||zo(Si)},style:Yi}),Ge.createElement("div",{className:"".concat(Io,"-content")},typeof vr=="function"?vr(Vn,{index:qn}):zt),Ge.isValidElement(Yo)||No,za&&Ge.createElement(de,{className:"".concat(Ir,"-option-state"),customizeIcon:Yo,customizeIconProps:{value:Si,disabled:Do,isSelected:No}},No?"\u2713":null))}))},$n=Ge.forwardRef(Fr),In=$n,si=function(It,_t){var hi=Ge.useRef({values:new Map,options:new Map}),it=Ge.useMemo(function(){var Dn=hi.current,Di=Dn.values,cn=Dn.options,qt=It.map(function(ur){if(ur.label===void 0){var Hi;return(0,yt.Z)((0,yt.Z)({},ur),{},{label:(Hi=Di.get(ur.value))===null||Hi===void 0?void 0:Hi.label})}return ur}),an=new Map,Gi=new Map;return qt.forEach(function(ur){an.set(ur.value,ur),Gi.set(ur.value,_t.get(ur.value)||cn.get(ur.value))}),hi.current.values=an,hi.current.options=Gi,qt},[It,_t]),sn=Ge.useCallback(function(Dn){return _t.get(Dn)||hi.current.options.get(Dn)},[_t]);return[it,sn]};function Ti(It,_t){return St(It).join("").toUpperCase().includes(_t)}var Oi=function(It,_t,hi,it,sn){return Ge.useMemo(function(){if(!hi||it===!1)return It;var Dn=_t.options,Di=_t.label,cn=_t.value,qt=[],an=typeof it=="function",Gi=hi.toUpperCase(),ur=an?it:function(Mi,Ri){return sn?Ti(Ri[sn],Gi):Ri[Dn]?Ti(Ri[Di!=="children"?Di:"label"],Gi):Ti(Ri[cn],Gi)},Hi=an?function(Mi){return fn(Mi)}:function(Mi){return Mi};return It.forEach(function(Mi){if(Mi[Dn]){var Ri=ur(hi,Hi(Mi));if(Ri)qt.push(Mi);else{var dr=Mi[Dn].filter(function(Er){return ur(hi,Hi(Er))});dr.length&&qt.push((0,yt.Z)((0,yt.Z)({},Mi),{},(0,ft.Z)({},Dn,dr)))}return}ur(hi,Hi(Mi))&&qt.push(Mi)}),qt},[It,it,sn,hi,_t])},zi=Le(69582),xr=Le(11592),Ce=["children","value"],_n=["children"];function ci(It){var _t=It,hi=_t.key,it=_t.props,sn=it.children,Dn=it.value,Di=(0,Oe.Z)(it,Ce);return(0,yt.Z)({key:hi,value:Dn!==void 0?Dn:hi,children:sn},Di)}function ar(It){var _t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return(0,xr.Z)(It).map(function(hi,it){if(!Ge.isValidElement(hi)||!hi.type)return null;var sn=hi,Dn=sn.type.isSelectOptGroup,Di=sn.key,cn=sn.props,qt=cn.children,an=(0,Oe.Z)(cn,_n);return _t||!Dn?ci(hi):(0,yt.Z)((0,yt.Z)({key:"__RC_SELECT_GRP__".concat(Di===null?it:Di,"__"),label:Di},an),{},{options:ar(qt)})}).filter(function(hi){return hi})}var _r=function(_t,hi,it,sn,Dn){return Ge.useMemo(function(){var Di=_t,cn=!_t;cn&&(Di=ar(hi));var qt=new Map,an=new Map,Gi=function(Mi,Ri,dr){dr&&typeof dr=="string"&&Mi.set(Ri[dr],Ri)},ur=function Hi(Mi){for(var Ri=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,dr=0;dr<Mi.length;dr+=1){var Er=Mi[dr];!Er[it.options]||Ri?(qt.set(Er[it.value],Er),Gi(an,Er,it.label),Gi(an,Er,sn),Gi(an,Er,Dn)):Hi(Er[it.options],!0)}};return ur(Di),{options:Di,valueOptions:qt,labelOptions:an}},[_t,hi,it,sn,Dn])},$r=_r;function po(It){var _t=Ge.useRef();_t.current=It;var hi=Ge.useCallback(function(){return _t.current.apply(_t,arguments)},[]);return hi}function fi(It){var _t=It.mode,hi=It.options,it=It.children,sn=It.backfill,Dn=It.allowClear,Di=It.placeholder,cn=It.getInputElement,qt=It.showSearch,an=It.onSearch,Gi=It.defaultOpen,ur=It.autoFocus,Hi=It.labelInValue,Mi=It.value,Ri=It.inputValue,dr=It.optionLabelProp,Er=isMultiple(_t),Ar=qt!==void 0?qt:Er||_t==="combobox",wn=hi||convertChildrenToData(it);if(warning(_t!=="tags"||wn.every(function(en){return!en.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),_t==="tags"||_t==="combobox"){var Yo=wn.some(function(en){return en.options?en.options.some(function(li){return typeof("value"in li?li.value:li.key)=="number"}):typeof("value"in en?en.value:en.key)=="number"});warning(!Yo,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(_t!=="combobox"||!dr,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(_t==="combobox"||!sn,"`backfill` only works with `combobox` mode."),warning(_t==="combobox"||!cn,"`getInputElement` only work with `combobox` mode."),noteOnce(_t!=="combobox"||!cn||!Dn||!Di,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),an&&!Ar&&_t!=="combobox"&&_t!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!Gi||ur,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),Mi!=null){var zr=toArray(Mi);warning(!Hi||zr.every(function(en){return _typeof(en)==="object"&&("key"in en||"value"in en)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!Er||Array.isArray(Mi),"`value` should be array when `mode` is `multiple` or `tags`")}if(it){var mo=null;toNodeArray(it).some(function(en){if(!React.isValidElement(en)||!en.type)return!1;var li=en,nr=li.type;if(nr.isSelectOption)return!1;if(nr.isSelectOptGroup){var Sr=toNodeArray(en.props.children).every(function(vr){return!React.isValidElement(vr)||!en.type||vr.type.isSelectOption?!0:(mo=vr.type,!1)});return!Sr}return mo=nr,!0}),mo&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(mo.displayName||mo.name||mo,"`.")),warning(Ri===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function Qn(It,_t){if(It){var hi=function it(sn){for(var Dn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Di=0;Di<sn.length;Di++){var cn=sn[Di];if(cn[_t==null?void 0:_t.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!Dn&&Array.isArray(cn[_t==null?void 0:_t.options])&&it(cn[_t==null?void 0:_t.options],!0))break}};hi(It)}}var Bt=null,Tt=["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"],kt=["inputValue"];function ui(It){return!It||(0,at.Z)(It)!=="object"}var Yn=Ge.forwardRef(function(It,_t){var hi=It.id,it=It.mode,sn=It.prefixCls,Dn=sn===void 0?"rc-select":sn,Di=It.backfill,cn=It.fieldNames,qt=It.inputValue,an=It.searchValue,Gi=It.onSearch,ur=It.autoClearSearchValue,Hi=ur===void 0?!0:ur,Mi=It.onSelect,Ri=It.onDeselect,dr=It.dropdownMatchSelectWidth,Er=dr===void 0?!0:dr,Ar=It.filterOption,wn=It.filterSort,Yo=It.optionFilterProp,zr=It.optionLabelProp,mo=It.options,en=It.optionRender,li=It.children,nr=It.defaultActiveFirstOption,Sr=It.menuItemSelectedIcon,vr=It.virtual,Ir=It.direction,bo=It.listHeight,fo=bo===void 0?200:bo,so=It.listItemHeight,lo=so===void 0?20:so,Tn=It.labelRender,qo=It.value,Zn=It.defaultValue,wr=It.labelInValue,Or=It.onChange,hr=It.maxCount,la=(0,Oe.Z)(It,Tt),ca=(0,zi.ZP)(hi),Qo=Nn(it),zo=!!(!mo&&li),Vt=Ge.useMemo(function(){return Ar===void 0&&it==="combobox"?!1:Ar},[Ar,it]),On=Ge.useMemo(function(){return Je(cn,zo)},[JSON.stringify(cn),zo]),Ut=(0,Ct.Z)("",{value:an!==void 0?an:qt,postState:function(Ko){return Ko||""}}),_e=(0,mt.Z)(Ut,2),pi=_e[0],Vn=_e[1],qn=$r(mo,li,On,Yo,zr),ki=qn.valueOptions,Wi=qn.labelOptions,Wn=qn.options,mi=Ge.useCallback(function(Vo){var Ko=St(Vo);return Ko.map(function(ni){var to,Xo,Ia,ms,cs;if(ui(ni))to=ni;else{var yo;Ia=ni.key,Xo=ni.label,to=(yo=ni.value)!==null&&yo!==void 0?yo:Ia}var as=ki.get(to);if(as){var ls;if(Xo===void 0&&(Xo=as==null?void 0:as[zr||On.label]),Ia===void 0&&(Ia=(ls=as==null?void 0:as.key)!==null&&ls!==void 0?ls:to),ms=as==null?void 0:as.disabled,cs=as==null?void 0:as.title,0)var Yt}return{label:Xo,value:to,key:Ia,disabled:ms,title:cs}})},[On,zr,ki]),Si=(0,Ct.Z)(Zn,{value:qo}),Ei=(0,mt.Z)(Si,2),bi=Ei[0],gr=Ei[1],qi=Ge.useMemo(function(){var Vo,Ko=Qo&&bi===null?[]:bi,ni=mi(Ko);return it==="combobox"&&Pn((Vo=ni[0])===null||Vo===void 0?void 0:Vo.value)?[]:ni},[bi,mi,it,Qo]),Ui=si(qi,ki),bn=(0,mt.Z)(Ui,2),Yi=bn[0],rr=bn[1],Po=Ge.useMemo(function(){if(!it&&Yi.length===1){var Vo=Yi[0];if(Vo.value===null&&(Vo.label===null||Vo.label===void 0))return[]}return Yi.map(function(Ko){var ni;return(0,yt.Z)((0,yt.Z)({},Ko),{},{label:(ni=typeof Tn=="function"?Tn(Ko):Ko.label)!==null&&ni!==void 0?ni:Ko.value})})},[it,Yi,Tn]),uo=Ge.useMemo(function(){return new Set(Yi.map(function(Vo){return Vo.value}))},[Yi]);Ge.useEffect(function(){if(it==="combobox"){var Vo,Ko=(Vo=Yi[0])===null||Vo===void 0?void 0:Vo.value;Vn($t(Ko)?String(Ko):"")}},[Yi]);var No=po(function(Vo,Ko){var ni=Ko!=null?Ko:Vo;return(0,ft.Z)((0,ft.Z)({},On.value,Vo),On.label,ni)}),Do=Ge.useMemo(function(){if(it!=="tags")return Wn;var Vo=(0,Ke.Z)(Wn),Ko=function(to){return ki.has(to)};return(0,Ke.Z)(Yi).sort(function(ni,to){return ni.value<to.value?-1:1}).forEach(function(ni){var to=ni.value;Ko(to)||Vo.push(No(to,ni.label))}),Vo},[No,Wn,ki,Yi,it]),Io=Oi(Do,On,pi,Vt,Yo),fa=Ge.useMemo(function(){return it!=="tags"||!pi||Io.some(function(Vo){return Vo[Yo||"value"]===pi})||Io.some(function(Vo){return Vo[On.value]===pi})?Io:[No(pi)].concat((0,Ke.Z)(Io))},[No,Yo,it,Io,pi,On]),na=function Vo(Ko){var ni=(0,Ke.Z)(Ko).sort(function(to,Xo){return wn(to,Xo,{searchValue:pi})});return ni.map(function(to){return Array.isArray(to.options)?(0,yt.Z)((0,yt.Z)({},to),{},{options:to.options.length>0?Vo(to.options):to.options}):to})},za=Ge.useMemo(function(){return wn?na(fa):fa},[fa,wn,pi]),zt=Ge.useMemo(function(){return Nt(za,{fieldNames:On,childrenAsData:zo})},[za,On,zo]),To=function(Ko){var ni=mi(Ko);if(gr(ni),Or&&(ni.length!==Yi.length||ni.some(function(Ia,ms){var cs;return((cs=Yi[ms])===null||cs===void 0?void 0:cs.value)!==(Ia==null?void 0:Ia.value)}))){var to=wr?ni:ni.map(function(Ia){return Ia.value}),Xo=ni.map(function(Ia){return fn(rr(Ia.value))});Or(Qo?to:to[0],Qo?Xo:Xo[0])}},Pr=Ge.useState(null),eo=(0,mt.Z)(Pr,2),Zo=eo[0],Wr=eo[1],ba=Ge.useState(0),ga=(0,mt.Z)(ba,2),Uo=ga[0],Fo=ga[1],vs=nr!==void 0?nr:it!=="combobox",Qa=Ge.useCallback(function(Vo,Ko){var ni=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},to=ni.source,Xo=to===void 0?"keyboard":to;Fo(Ko),Di&&it==="combobox"&&Vo!==null&&Xo==="keyboard"&&Wr(String(Vo))},[Di,it]),ns=function(Ko,ni,to){var Xo=function(){var Zi,yi=rr(Ko);return[wr?{label:yi==null?void 0:yi[On.label],value:Ko,key:(Zi=yi==null?void 0:yi.key)!==null&&Zi!==void 0?Zi:Ko}:Ko,fn(yi)]};if(ni&&Mi){var Ia=Xo(),ms=(0,mt.Z)(Ia,2),cs=ms[0],yo=ms[1];Mi(cs,yo)}else if(!ni&&Ri&&to!=="clear"){var as=Xo(),ls=(0,mt.Z)(as,2),Yt=ls[0],Xt=ls[1];Ri(Yt,Xt)}},ds=po(function(Vo,Ko){var ni,to=Qo?Ko.selected:!0;to?ni=Qo?[].concat((0,Ke.Z)(Yi),[Vo]):[Vo]:ni=Yi.filter(function(Xo){return Xo.value!==Vo}),To(ni),ns(Vo,to),it==="combobox"?Wr(""):(!Nn||Hi)&&(Vn(""),Wr(""))}),Vr=function(Ko,ni){To(Ko);var to=ni.type,Xo=ni.values;(to==="remove"||to==="clear")&&Xo.forEach(function(Ia){ns(Ia.value,!1,to)})},wa=function(Ko,ni){if(Vn(Ko),Wr(null),ni.source==="submit"){var to=(Ko||"").trim();if(to){var Xo=Array.from(new Set([].concat((0,Ke.Z)(uo),[to])));To(Xo),ns(to,!0),Vn("")}return}ni.source!=="blur"&&(it==="combobox"&&To(Ko),Gi==null||Gi(Ko))},Ba=function(Ko){var ni=Ko;it!=="tags"&&(ni=Ko.map(function(Xo){var Ia=Wi.get(Xo);return Ia==null?void 0:Ia.value}).filter(function(Xo){return Xo!==void 0}));var to=Array.from(new Set([].concat((0,Ke.Z)(uo),(0,Ke.Z)(ni))));To(to),to.forEach(function(Xo){ns(Xo,!0)})},is=Ge.useMemo(function(){var Vo=vr!==!1&&Er!==!1;return(0,yt.Z)((0,yt.Z)({},qn),{},{flattenOptions:zt,onActiveValue:Qa,defaultActiveFirstOption:vs,onSelect:ds,menuItemSelectedIcon:Sr,rawValues:uo,fieldNames:On,virtual:Vo,direction:Ir,listHeight:fo,listItemHeight:lo,childrenAsData:zo,maxCount:hr,optionRender:en})},[hr,qn,zt,Qa,vs,ds,Sr,uo,On,vr,Er,Ir,fo,lo,zo,en]);return Ge.createElement(Jt.Provider,{value:is},Ge.createElement(fr,(0,ue.Z)({},la,{id:ca,prefixCls:Dn,ref:_t,omitDomProps:kt,mode:it,displayValues:Po,onDisplayValuesChange:Vr,direction:Ir,searchValue:pi,onSearch:wa,autoClearSearchValue:Hi,onSearchSplit:Ba,dropdownMatchSelectWidth:Er,OptionList:In,emptyOptions:!zt.length,activeValue:Zo,activeDescendantId:"".concat(ca,"_list_").concat(Uo)})))}),vi=Yn;vi.Option=di,vi.OptGroup=tn;var yn=vi,Kn=yn},63158:function(Un,ai,Le){"use strict";var ue=Le(72308),Ke=Le(49618),ft=Le(52487),yt=Le(74416),mt=Le(59301),Oe=Le(92310),at=Le.n(Oe),Ct=Le(18929),dt=Le(10228),Ge=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],Rt=mt.forwardRef(function(ot,At){var Te,ne=ot.prefixCls,te=ne===void 0?"rc-switch":ne,de=ot.className,se=ot.checked,pe=ot.defaultChecked,ye=ot.disabled,we=ot.loadingIcon,be=ot.checkedChildren,Ie=ot.unCheckedChildren,Re=ot.onClick,rt=ot.onChange,et=ot.onKeyDown,Ye=(0,yt.Z)(ot,Ge),ut=(0,Ct.Z)(!1,{value:se,defaultValue:pe}),tt=(0,ft.Z)(ut,2),wt=tt[0],St=tt[1];function Lt(Ot,ct){var nt=wt;return ye||(nt=Ot,St(nt),rt==null||rt(nt,ct)),nt}function mn(Ot){Ot.which===dt.Z.LEFT?Lt(!1,Ot):Ot.which===dt.Z.RIGHT&&Lt(!0,Ot),et==null||et(Ot)}function $t(Ot){var ct=Lt(!wt,Ot);Re==null||Re(ct,Ot)}var Pn=at()(te,de,(Te={},(0,Ke.Z)(Te,"".concat(te,"-checked"),wt),(0,Ke.Z)(Te,"".concat(te,"-disabled"),ye),Te));return mt.createElement("button",(0,ue.Z)({},Ye,{type:"button",role:"switch","aria-checked":wt,disabled:ye,className:Pn,ref:At,onKeyDown:mn,onClick:$t}),we,mt.createElement("span",{className:"".concat(te,"-inner")},mt.createElement("span",{className:"".concat(te,"-inner-checked")},be),mt.createElement("span",{className:"".concat(te,"-inner-unchecked")},Ie)))});Rt.displayName="Switch",ai.Z=Rt},67204:function(Un,ai,Le){"use strict";Le.d(ai,{R:function(){return Ke},w:function(){return ue}});var ue={},Ke="rc-table-internal-hook"},78612:function(Un,ai,Le){"use strict";Le.d(ai,{L:function(){return te},Z:function(){return we}});var ue=Le(52487),Ke=Le(49618),ft=Le(80702),yt=Le(62853),mt=Le(77321),Oe=Le(74416),at=Le(11592),Ct=Le(48736),dt=Le(59301),Ge=Le(67204),Rt=Le(90494);function ot(be){var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return typeof Ie=="number"?Ie:Ie.endsWith("%")?be*parseFloat(Ie)/100:null}function At(be,Ie,Re){return dt.useMemo(function(){if(Ie&&Ie>0){var rt=0,et=0;be.forEach(function($t){var Pn=ot(Ie,$t.width);Pn?rt+=Pn:et+=1});var Ye=Math.max(Ie,Re),ut=Math.max(Ye-rt,et),tt=et,wt=ut/et,St=0,Lt=be.map(function($t){var Pn=(0,mt.Z)({},$t),Ot=ot(Ie,Pn.width);if(Ot)Pn.width=Ot;else{var ct=Math.floor(wt);Pn.width=tt===1?ut:ct,ut-=ct,tt-=1}return St+=Pn.width,Pn});if(St<Ye){var mn=Ye/St;ut=Ye,Lt.forEach(function($t,Pn){var Ot=Math.floor($t.width*mn);$t.width=Pn===Lt.length-1?ut:Ot,ut-=Ot})}return[Lt,Math.max(St,Ye)]}return[be,Ie]},[be,Ie,Re])}var Te=["children"],ne=["fixed"];function te(be){return(0,at.Z)(be).filter(function(Ie){return dt.isValidElement(Ie)}).map(function(Ie){var Re=Ie.key,rt=Ie.props,et=rt.children,Ye=(0,Oe.Z)(rt,Te),ut=(0,mt.Z)({key:Re},Ye);return et&&(ut.children=te(et)),ut})}function de(be){return be.filter(function(Ie){return Ie&&(0,yt.Z)(Ie)==="object"&&!Ie.hidden}).map(function(Ie){var Re=Ie.children;return Re&&Re.length>0?(0,mt.Z)((0,mt.Z)({},Ie),{},{children:de(Re)}):Ie})}function se(be){var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"key";return be.filter(function(Re){return Re&&(0,yt.Z)(Re)==="object"}).reduce(function(Re,rt,et){var Ye=rt.fixed,ut=Ye===!0?"left":Ye,tt="".concat(Ie,"-").concat(et),wt=rt.children;return wt&&wt.length>0?[].concat((0,ft.Z)(Re),(0,ft.Z)(se(wt,tt).map(function(St){return(0,mt.Z)({fixed:ut},St)}))):[].concat((0,ft.Z)(Re),[(0,mt.Z)((0,mt.Z)({key:tt},rt),{},{fixed:ut})])},[])}function pe(be){return be.map(function(Ie){var Re=Ie.fixed,rt=(0,Oe.Z)(Ie,ne),et=Re;return Re==="left"?et="right":Re==="right"&&(et="left"),(0,mt.Z)({fixed:et},rt)})}function ye(be,Ie){var Re=be.prefixCls,rt=be.columns,et=be.children,Ye=be.expandable,ut=be.expandedKeys,tt=be.columnTitle,wt=be.getRowKey,St=be.onTriggerExpand,Lt=be.expandIcon,mn=be.rowExpandable,$t=be.expandIconColumnIndex,Pn=be.direction,Ot=be.expandRowByClick,ct=be.columnWidth,nt=be.fixed,gn=be.scrollWidth,oi=be.clientWidth,zn=dt.useMemo(function(){var Ni=rt||te(et)||[];return de(Ni.slice())},[rt,et]),Ht=dt.useMemo(function(){if(Ye){var Ni=zn.slice();if(!Ni.includes(Ge.w)){var je=$t||0;je>=0&&(je||nt==="left"||!nt)&&Ni.splice(je,0,Ge.w),nt==="right"&&Ni.splice(zn.length,0,Ge.w)}var Me=Ni.indexOf(Ge.w);Ni=Ni.filter(function(Ae,Je){return Ae!==Ge.w||Je===Me});var Ee=zn[Me],De;nt?De=nt:De=Ee?Ee.fixed:null;var We=(0,Ke.Z)((0,Ke.Z)((0,Ke.Z)((0,Ke.Z)((0,Ke.Z)((0,Ke.Z)({},Rt.v,{className:"".concat(Re,"-expand-icon-col"),columnType:"EXPAND_COLUMN"}),"title",tt),"fixed",De),"className","".concat(Re,"-row-expand-icon-cell")),"width",ct),"render",function(Je,Nt,fn){var vn=wt(Nt,fn),Ft=ut.has(vn),Jt=mn?mn(Nt):!0,jt=Lt({prefixCls:Re,expanded:Ft,expandable:Jt,record:Nt,onExpand:St});return Ot?dt.createElement("span",{onClick:function(jn){return jn.stopPropagation()}},jt):jt});return Ni.map(function(Ae){return Ae===Ge.w?We:Ae})}return zn.filter(function(Ae){return Ae!==Ge.w})},[Ye,zn,wt,ut,Lt,Pn]),Fn=dt.useMemo(function(){var Ni=Ht;return Ie&&(Ni=Ie(Ni)),Ni.length||(Ni=[{render:function(){return null}}]),Ni},[Ie,Ht,Pn]),Cn=dt.useMemo(function(){return Pn==="rtl"?pe(se(Fn)):se(Fn)},[Fn,Pn,gn]),ii=dt.useMemo(function(){for(var Ni=-1,je=Cn.length-1;je>=0;je-=1){var Me=Cn[je].fixed;if(Me==="left"||Me===!0){Ni=je;break}}if(Ni>=0)for(var Ee=0;Ee<=Ni;Ee+=1){var De=Cn[Ee].fixed;if(De!=="left"&&De!==!0)return!0}var We=Cn.findIndex(function(Nt){var fn=Nt.fixed;return fn==="right"});if(We>=0)for(var Ae=We;Ae<Cn.length;Ae+=1){var Je=Cn[Ae].fixed;if(Je!=="right")return!0}return!1},[Cn]),Wt=At(Cn,gn,oi),Hn=(0,ue.Z)(Wt,2),lt=Hn[0],An=Hn[1];return[Fn,lt,An,ii]}var we=ye},16596:function(Un,ai,Le){"use strict";Le.d(ai,{w2:function(){return ue.w},vP:function(){return In.v},RQ:function(){return ue.R},ER:function(){return vn},Q$:function(){return zr},TN:function(){return ca}});var ue=Le(67204),Ke=Le(52487),ft=Le(6089),yt=Le(34280),mt=Le(13697),Oe=Le(59301),at=Le(4676);function Ct(Vt){var On=Oe.createContext(void 0),Ut=function(pi){var Vn=pi.value,qn=pi.children,ki=Oe.useRef(Vn);ki.current=Vn;var Wi=Oe.useState(function(){return{getValue:function(){return ki.current},listeners:new Set}}),Wn=(0,Ke.Z)(Wi,1),mi=Wn[0];return(0,yt.Z)(function(){(0,at.unstable_batchedUpdates)(function(){mi.listeners.forEach(function(Si){Si(Vn)})})},[Vn]),Oe.createElement(On.Provider,{value:mi},qn)};return{Context:On,Provider:Ut,defaultValue:Vt}}function dt(Vt,On){var Ut=(0,ft.Z)(typeof On=="function"?On:function(Si){if(On===void 0)return Si;if(!Array.isArray(On))return Si[On];var Ei={};return On.forEach(function(bi){Ei[bi]=Si[bi]}),Ei}),_e=Oe.useContext(Vt==null?void 0:Vt.Context),pi=_e||{},Vn=pi.listeners,qn=pi.getValue,ki=Oe.useRef();ki.current=Ut(_e?qn():Vt==null?void 0:Vt.defaultValue);var Wi=Oe.useState({}),Wn=(0,Ke.Z)(Wi,2),mi=Wn[1];return(0,yt.Z)(function(){if(!_e)return;function Si(Ei){var bi=Ut(Ei);(0,mt.Z)(ki.current,bi,!0)||mi({})}return Vn.add(Si),function(){Vn.delete(Si)}},[_e]),ki.current}var Ge=Le(72308),Rt=Le(8654);function ot(){var Vt=Oe.createContext(null);function On(){return Oe.useContext(Vt)}function Ut(pi,Vn){var qn=(0,Rt.Yr)(pi),ki=function(Wn,mi){var Si=qn?{ref:mi}:{},Ei=Oe.useRef(0),bi=Oe.useRef(Wn),gr=On();return gr!==null?Oe.createElement(pi,(0,Ge.Z)({},Wn,Si)):((!Vn||Vn(bi.current,Wn))&&(Ei.current+=1),bi.current=Wn,Oe.createElement(Vt.Provider,{value:Ei.current},Oe.createElement(pi,(0,Ge.Z)({},Wn,Si))))};return qn?Oe.forwardRef(ki):ki}function _e(pi,Vn){var qn=(0,Rt.Yr)(pi),ki=function(Wn,mi){var Si=qn?{ref:mi}:{};return On(),Oe.createElement(pi,(0,Ge.Z)({},Wn,Si))};return qn?Oe.memo(Oe.forwardRef(ki),Vn):Oe.memo(ki,Vn)}return{makeImmutable:Ut,responseImmutable:_e,useImmutableMark:On}}var At=ot(),Te=At.makeImmutable,ne=At.responseImmutable,te=At.useImmutableMark,de=ot(),se=de.makeImmutable,pe=de.responseImmutable,ye=de.useImmutableMark,we=Ct(),be=we;function Ie(Vt,On){var Ut=React.useRef(0);Ut.current+=1;var _e=React.useRef(Vt),pi=[];Object.keys(Vt||{}).map(function(qn){var ki;(Vt==null?void 0:Vt[qn])!==((ki=_e.current)===null||ki===void 0?void 0:ki[qn])&&pi.push(qn)}),_e.current=Vt;var Vn=React.useRef([]);return pi.length&&(Vn.current=pi),React.useDebugValue(Ut.current),React.useDebugValue(Vn.current.join(", ")),On&&console.log("".concat(On,":"),Ut.current,Vn.current),Ut.current}var Re=null,rt=null,et=Le(62853),Ye=Le(77321),ut=Le(49618),tt=Le(92310),wt=Le.n(tt),St=Le(80547),Lt=Le(97938),mn=Le(48736),$t=Oe.createContext({renderWithProps:!1}),Pn=$t,Ot="RC_TABLE_KEY";function ct(Vt){return Vt==null?[]:Array.isArray(Vt)?Vt:[Vt]}function nt(Vt){var On=[],Ut={};return Vt.forEach(function(_e){for(var pi=_e||{},Vn=pi.key,qn=pi.dataIndex,ki=Vn||ct(qn).join("-")||Ot;Ut[ki];)ki="".concat(ki,"_next");Ut[ki]=!0,On.push(ki)}),On}function gn(Vt){return Vt!=null}function oi(Vt){return typeof Vt=="number"&&!Number.isNaN(Vt)}function zn(Vt){return Vt&&(0,et.Z)(Vt)==="object"&&!Array.isArray(Vt)&&!Oe.isValidElement(Vt)}function Ht(Vt,On,Ut,_e,pi,Vn){var qn=Oe.useContext(Pn),ki=ye(),Wi=(0,St.Z)(function(){if(gn(_e))return[_e];var Wn=On==null||On===""?[]:Array.isArray(On)?On:[On],mi=(0,Lt.Z)(Vt,Wn),Si=mi,Ei=void 0;if(pi){var bi=pi(mi,Vt,Ut);zn(bi)?(Si=bi.children,Ei=bi.props,qn.renderWithProps=!0):Si=bi}return[Si,Ei]},[ki,Vt,_e,On,pi,Ut],function(Wn,mi){if(Vn){var Si=(0,Ke.Z)(Wn,2),Ei=Si[1],bi=(0,Ke.Z)(mi,2),gr=bi[1];return Vn(gr,Ei)}return qn.renderWithProps?!0:!(0,mt.Z)(Wn,mi,!0)});return Wi}function Fn(Vt,On,Ut,_e){var pi=Vt+On-1;return Vt<=_e&&pi>=Ut}function Cn(Vt,On){return dt(be,function(Ut){var _e=Fn(Vt,On||1,Ut.hoverStartRow,Ut.hoverEndRow);return[_e,Ut.onHover]})}var ii=Le(70425),Wt=function(On){var Ut=On.ellipsis,_e=On.rowType,pi=On.children,Vn,qn=Ut===!0?{showTitle:!0}:Ut;return qn&&(qn.showTitle||_e==="header")&&(typeof pi=="string"||typeof pi=="number"?Vn=pi.toString():Oe.isValidElement(pi)&&typeof pi.props.children=="string"&&(Vn=pi.props.children)),Vn};function Hn(Vt){var On,Ut,_e,pi,Vn,qn,ki,Wi,Wn=Vt.component,mi=Vt.children,Si=Vt.ellipsis,Ei=Vt.scope,bi=Vt.prefixCls,gr=Vt.className,qi=Vt.align,Ui=Vt.record,bn=Vt.render,Yi=Vt.dataIndex,rr=Vt.renderIndex,Po=Vt.shouldCellUpdate,uo=Vt.index,No=Vt.rowType,Do=Vt.colSpan,Io=Vt.rowSpan,fa=Vt.fixLeft,na=Vt.fixRight,za=Vt.firstFixLeft,zt=Vt.lastFixLeft,To=Vt.firstFixRight,Pr=Vt.lastFixRight,eo=Vt.appendNode,Zo=Vt.additionalProps,Wr=Zo===void 0?{}:Zo,ba=Vt.isSticky,ga="".concat(bi,"-cell"),Uo=dt(be,["supportSticky","allColumnsFixedLeft","rowHoverable"]),Fo=Uo.supportSticky,vs=Uo.allColumnsFixedLeft,Qa=Uo.rowHoverable,ns=Ht(Ui,Yi,rr,mi,bn,Po),ds=(0,Ke.Z)(ns,2),Vr=ds[0],wa=ds[1],Ba={},is=typeof fa=="number"&&Fo,Vo=typeof na=="number"&&Fo;is&&(Ba.position="sticky",Ba.left=fa),Vo&&(Ba.position="sticky",Ba.right=na);var Ko=(On=(Ut=(_e=wa==null?void 0:wa.colSpan)!==null&&_e!==void 0?_e:Wr.colSpan)!==null&&Ut!==void 0?Ut:Do)!==null&&On!==void 0?On:1,ni=(pi=(Vn=(qn=wa==null?void 0:wa.rowSpan)!==null&&qn!==void 0?qn:Wr.rowSpan)!==null&&Vn!==void 0?Vn:Io)!==null&&pi!==void 0?pi:1,to=Cn(uo,ni),Xo=(0,Ke.Z)(to,2),Ia=Xo[0],ms=Xo[1],cs=(0,ii.zX)(function(Zi){var yi;Ui&&ms(uo,uo+ni-1),Wr==null||(yi=Wr.onMouseEnter)===null||yi===void 0||yi.call(Wr,Zi)}),yo=(0,ii.zX)(function(Zi){var yi;Ui&&ms(-1,-1),Wr==null||(yi=Wr.onMouseLeave)===null||yi===void 0||yi.call(Wr,Zi)});if(Ko===0||ni===0)return null;var as=(ki=Wr.title)!==null&&ki!==void 0?ki:Wt({rowType:No,ellipsis:Si,children:Vr}),ls=wt()(ga,gr,(Wi={},(0,ut.Z)((0,ut.Z)((0,ut.Z)((0,ut.Z)((0,ut.Z)((0,ut.Z)((0,ut.Z)((0,ut.Z)((0,ut.Z)((0,ut.Z)(Wi,"".concat(ga,"-fix-left"),is&&Fo),"".concat(ga,"-fix-left-first"),za&&Fo),"".concat(ga,"-fix-left-last"),zt&&Fo),"".concat(ga,"-fix-left-all"),zt&&vs&&Fo),"".concat(ga,"-fix-right"),Vo&&Fo),"".concat(ga,"-fix-right-first"),To&&Fo),"".concat(ga,"-fix-right-last"),Pr&&Fo),"".concat(ga,"-ellipsis"),Si),"".concat(ga,"-with-append"),eo),"".concat(ga,"-fix-sticky"),(is||Vo)&&ba&&Fo),(0,ut.Z)(Wi,"".concat(ga,"-row-hover"),!wa&&Ia)),Wr.className,wa==null?void 0:wa.className),Yt={};qi&&(Yt.textAlign=qi);var Xt=(0,Ye.Z)((0,Ye.Z)((0,Ye.Z)((0,Ye.Z)({},wa==null?void 0:wa.style),Ba),Yt),Wr.style),kn=Vr;return(0,et.Z)(kn)==="object"&&!Array.isArray(kn)&&!Oe.isValidElement(kn)&&(kn=null),Si&&(zt||To)&&(kn=Oe.createElement("span",{className:"".concat(ga,"-content")},kn)),Oe.createElement(Wn,(0,Ge.Z)({},wa,Wr,{className:ls,style:Xt,title:as,scope:Ei,onMouseEnter:Qa?cs:void 0,onMouseLeave:Qa?yo:void 0,colSpan:Ko!==1?Ko:null,rowSpan:ni!==1?ni:null}),eo,kn)}var lt=Oe.memo(Hn);function An(Vt,On,Ut,_e,pi){var Vn=Ut[Vt]||{},qn=Ut[On]||{},ki,Wi;Vn.fixed==="left"?ki=_e.left[pi==="rtl"?On:Vt]:qn.fixed==="right"&&(Wi=_e.right[pi==="rtl"?Vt:On]);var Wn=!1,mi=!1,Si=!1,Ei=!1,bi=Ut[On+1],gr=Ut[Vt-1],qi=bi&&!bi.fixed||gr&&!gr.fixed||Ut.every(function(Po){return Po.fixed==="left"});if(pi==="rtl"){if(ki!==void 0){var Ui=gr&&gr.fixed==="left";Ei=!Ui&&qi}else if(Wi!==void 0){var bn=bi&&bi.fixed==="right";Si=!bn&&qi}}else if(ki!==void 0){var Yi=bi&&bi.fixed==="left";Wn=!Yi&&qi}else if(Wi!==void 0){var rr=gr&&gr.fixed==="right";mi=!rr&&qi}return{fixLeft:ki,fixRight:Wi,lastFixLeft:Wn,firstFixRight:mi,lastFixRight:Si,firstFixLeft:Ei,isSticky:_e.isSticky}}var Ni=Oe.createContext({}),je=Ni;function Me(Vt){var On=Vt.className,Ut=Vt.index,_e=Vt.children,pi=Vt.colSpan,Vn=pi===void 0?1:pi,qn=Vt.rowSpan,ki=Vt.align,Wi=dt(be,["prefixCls","direction"]),Wn=Wi.prefixCls,mi=Wi.direction,Si=Oe.useContext(je),Ei=Si.scrollColumnIndex,bi=Si.stickyOffsets,gr=Si.flattenColumns,qi=Ut+Vn-1,Ui=qi+1===Ei?Vn+1:Vn,bn=An(Ut,Ut+Ui-1,gr,bi,mi);return Oe.createElement(lt,(0,Ge.Z)({className:On,index:Ut,component:"td",prefixCls:Wn,record:null,dataIndex:null,align:ki,colSpan:Ui,rowSpan:qn,render:function(){return _e}},bn))}var Ee=Le(74416),De=["children"];function We(Vt){var On=Vt.children,Ut=(0,Ee.Z)(Vt,De);return Oe.createElement("tr",Ut,On)}function Ae(Vt){var On=Vt.children;return On}Ae.Row=We,Ae.Cell=Me;var Je=Ae;function Nt(Vt){var On=Vt.children,Ut=Vt.stickyOffsets,_e=Vt.flattenColumns,pi=dt(be,"prefixCls"),Vn=_e.length-1,qn=_e[Vn],ki=Oe.useMemo(function(){return{stickyOffsets:Ut,flattenColumns:_e,scrollColumnIndex:qn!=null&&qn.scrollbar?Vn:null}},[qn,_e,Vn,Ut]);return Oe.createElement(je.Provider,{value:ki},Oe.createElement("tfoot",{className:"".concat(pi,"-summary")},On))}var fn=pe(Nt),vn=Je,Ft=Le(29301),Jt=Le(29194),jt=Le(24514),pn=Le(75152),jn=Le(26112);function Nn(Vt,On,Ut,_e,pi,Vn,qn){Vt.push({record:On,indent:Ut,index:qn});var ki=Vn(On),Wi=pi==null?void 0:pi.has(ki);if(On&&Array.isArray(On[_e])&&Wi)for(var Wn=0;Wn<On[_e].length;Wn+=1)Nn(Vt,On[_e][Wn],Ut+1,_e,pi,Vn,Wn)}function Mn(Vt,On,Ut,_e){var pi=Oe.useMemo(function(){if(Ut!=null&&Ut.size){for(var Vn=[],qn=0;qn<(Vt==null?void 0:Vt.length);qn+=1){var ki=Vt[qn];Nn(Vn,ki,0,On,Ut,_e,qn)}return Vn}return Vt==null?void 0:Vt.map(function(Wi,Wn){return{record:Wi,indent:0,index:Wn}})},[Vt,On,Ut,_e]);return pi}function fr(Vt,On,Ut,_e){var pi=dt(be,["prefixCls","fixedInfoList","flattenColumns","expandableType","expandRowByClick","onTriggerExpand","rowClassName","expandedRowClassName","indentSize","expandIcon","expandedRowRender","expandIconColumnIndex","expandedKeys","childrenColumnName","rowExpandable","onRow"]),Vn=pi.flattenColumns,qn=pi.expandableType,ki=pi.expandedKeys,Wi=pi.childrenColumnName,Wn=pi.onTriggerExpand,mi=pi.rowExpandable,Si=pi.onRow,Ei=pi.expandRowByClick,bi=pi.rowClassName,gr=qn==="nest",qi=qn==="row"&&(!mi||mi(Vt)),Ui=qi||gr,bn=ki&&ki.has(On),Yi=Wi&&Vt&&Vt[Wi],rr=(0,ii.zX)(Wn),Po=Si==null?void 0:Si(Vt,Ut),uo=Po==null?void 0:Po.onClick,No=function(na){Ei&&Ui&&Wn(Vt,na);for(var za=arguments.length,zt=new Array(za>1?za-1:0),To=1;To<za;To++)zt[To-1]=arguments[To];uo==null||uo.apply(void 0,[na].concat(zt))},Do;typeof bi=="string"?Do=bi:typeof bi=="function"&&(Do=bi(Vt,Ut,_e));var Io=nt(Vn);return(0,Ye.Z)((0,Ye.Z)({},pi),{},{columnsKey:Io,nestExpandable:gr,expanded:bn,hasNestChildren:Yi,record:Vt,onTriggerExpand:rr,rowSupportExpand:qi,expandable:Ui,rowProps:(0,Ye.Z)((0,Ye.Z)({},Po),{},{className:wt()(Do,Po==null?void 0:Po.className),onClick:No})})}function nn(Vt){var On=Vt.prefixCls,Ut=Vt.children,_e=Vt.component,pi=Vt.cellComponent,Vn=Vt.className,qn=Vt.expanded,ki=Vt.colSpan,Wi=Vt.isEmpty,Wn=dt(be,["scrollbarSize","fixHeader","fixColumn","componentWidth","horizonScroll"]),mi=Wn.scrollbarSize,Si=Wn.fixHeader,Ei=Wn.fixColumn,bi=Wn.componentWidth,gr=Wn.horizonScroll,qi=Ut;return(Wi?gr&&bi:Ei)&&(qi=Oe.createElement("div",{style:{width:bi-(Si&&!Wi?mi:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(On,"-expanded-row-fixed")},qi)),Oe.createElement(_e,{className:Vn,style:{display:qn?null:"none"}},Oe.createElement(lt,{component:pi,prefixCls:On,colSpan:ki},qi))}var tn=nn;function hn(Vt){var On=Vt.prefixCls,Ut=Vt.record,_e=Vt.onExpand,pi=Vt.expanded,Vn=Vt.expandable,qn="".concat(On,"-row-expand-icon");if(!Vn)return Oe.createElement("span",{className:wt()(qn,"".concat(On,"-row-spaced"))});var ki=function(Wn){_e(Ut,Wn),Wn.stopPropagation()};return Oe.createElement("span",{className:wt()(qn,(0,ut.Z)((0,ut.Z)({},"".concat(On,"-row-expanded"),pi),"".concat(On,"-row-collapsed"),!pi)),onClick:ki})}function di(Vt,On,Ut){var _e=[];function pi(Vn){(Vn||[]).forEach(function(qn,ki){_e.push(On(qn,ki)),pi(qn[Ut])})}return pi(Vt),_e}function Sn(Vt,On,Ut,_e){return typeof Vt=="string"?Vt:typeof Vt=="function"?Vt(On,Ut,_e):""}function Kt(Vt,On,Ut,_e,pi){var Vn=Vt.record,qn=Vt.prefixCls,ki=Vt.columnsKey,Wi=Vt.fixedInfoList,Wn=Vt.expandIconColumnIndex,mi=Vt.nestExpandable,Si=Vt.indentSize,Ei=Vt.expandIcon,bi=Vt.expanded,gr=Vt.hasNestChildren,qi=Vt.onTriggerExpand,Ui=ki[Ut],bn=Wi[Ut],Yi;Ut===(Wn||0)&&mi&&(Yi=Oe.createElement(Oe.Fragment,null,Oe.createElement("span",{style:{paddingLeft:"".concat(Si*_e,"px")},className:"".concat(qn,"-row-indent indent-level-").concat(_e)}),Ei({prefixCls:qn,expanded:bi,expandable:gr,record:Vn,onExpand:qi})));var rr;return On.onCell&&(rr=On.onCell(Vn,pi)),{key:Ui,fixedInfo:bn,appendCellNode:Yi,additionalCellProps:rr||{}}}function gi(Vt){var On=Vt.className,Ut=Vt.style,_e=Vt.record,pi=Vt.index,Vn=Vt.renderIndex,qn=Vt.rowKey,ki=Vt.indent,Wi=ki===void 0?0:ki,Wn=Vt.rowComponent,mi=Vt.cellComponent,Si=Vt.scopeCellComponent,Ei=fr(_e,qn,pi,Wi),bi=Ei.prefixCls,gr=Ei.flattenColumns,qi=Ei.expandedRowClassName,Ui=Ei.expandedRowRender,bn=Ei.rowProps,Yi=Ei.expanded,rr=Ei.rowSupportExpand,Po=Oe.useRef(!1);Po.current||(Po.current=Yi);var uo=Sn(qi,_e,pi,Wi),No=Oe.createElement(Wn,(0,Ge.Z)({},bn,{"data-row-key":qn,className:wt()(On,"".concat(bi,"-row"),"".concat(bi,"-row-level-").concat(Wi),bn==null?void 0:bn.className,(0,ut.Z)({},uo,Wi>=1)),style:(0,Ye.Z)((0,Ye.Z)({},Ut),bn==null?void 0:bn.style)}),gr.map(function(fa,na){var za=fa.render,zt=fa.dataIndex,To=fa.className,Pr=Kt(Ei,fa,na,Wi,pi),eo=Pr.key,Zo=Pr.fixedInfo,Wr=Pr.appendCellNode,ba=Pr.additionalCellProps;return Oe.createElement(lt,(0,Ge.Z)({className:To,ellipsis:fa.ellipsis,align:fa.align,scope:fa.rowScope,component:fa.rowScope?Si:mi,prefixCls:bi,key:eo,record:_e,index:pi,renderIndex:Vn,dataIndex:zt,render:za,shouldCellUpdate:fa.shouldCellUpdate},Zo,{appendNode:Wr,additionalProps:ba}))})),Do;if(rr&&(Po.current||Yi)){var Io=Ui(_e,pi,Wi+1,Yi);Do=Oe.createElement(tn,{expanded:Yi,className:wt()("".concat(bi,"-expanded-row"),"".concat(bi,"-expanded-row-level-").concat(Wi+1),uo),prefixCls:bi,component:Wn,cellComponent:mi,colSpan:gr.length,isEmpty:!1},Io)}return Oe.createElement(Oe.Fragment,null,No,Do)}var Vi=pe(gi);function Pi(Vt){var On=Vt.columnKey,Ut=Vt.onColumnResize,_e=Oe.useRef();return Oe.useEffect(function(){_e.current&&Ut(On,_e.current.offsetWidth)},[]),Oe.createElement(Ft.Z,{data:On},Oe.createElement("td",{ref:_e,style:{padding:0,border:0,height:0}},Oe.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function Ii(Vt){var On=Vt.prefixCls,Ut=Vt.columnsKey,_e=Vt.onColumnResize;return Oe.createElement("tr",{"aria-hidden":"true",className:"".concat(On,"-measure-row"),style:{height:0,fontSize:0}},Oe.createElement(Ft.Z.Collection,{onBatchResize:function(Vn){Vn.forEach(function(qn){var ki=qn.data,Wi=qn.size;_e(ki,Wi.offsetWidth)})}},Ut.map(function(pi){return Oe.createElement(Pi,{key:pi,columnKey:pi,onColumnResize:_e})})))}function Fr(Vt){var On=Vt.data,Ut=Vt.measureColumnWidth,_e=dt(be,["prefixCls","getComponent","onColumnResize","flattenColumns","getRowKey","expandedKeys","childrenColumnName","emptyNode"]),pi=_e.prefixCls,Vn=_e.getComponent,qn=_e.onColumnResize,ki=_e.flattenColumns,Wi=_e.getRowKey,Wn=_e.expandedKeys,mi=_e.childrenColumnName,Si=_e.emptyNode,Ei=Mn(On,mi,Wn,Wi),bi=Oe.useRef({renderWithProps:!1}),gr=Vn(["body","wrapper"],"tbody"),qi=Vn(["body","row"],"tr"),Ui=Vn(["body","cell"],"td"),bn=Vn(["body","cell"],"th"),Yi;On.length?Yi=Ei.map(function(Po,uo){var No=Po.record,Do=Po.indent,Io=Po.index,fa=Wi(No,uo);return Oe.createElement(Vi,{key:fa,rowKey:fa,record:No,index:uo,renderIndex:Io,rowComponent:qi,cellComponent:Ui,scopeCellComponent:bn,indent:Do})}):Yi=Oe.createElement(tn,{expanded:!0,className:"".concat(pi,"-placeholder"),prefixCls:pi,component:qi,cellComponent:Ui,colSpan:ki.length,isEmpty:!0},Si);var rr=nt(ki);return Oe.createElement(Pn.Provider,{value:bi.current},Oe.createElement(gr,{className:"".concat(pi,"-tbody")},Ut&&Oe.createElement(Ii,{prefixCls:pi,columnsKey:rr,onColumnResize:qn}),Yi))}var $n=pe(Fr),In=Le(90494),si=["columnType"];function Ti(Vt){for(var On=Vt.colWidths,Ut=Vt.columns,_e=Vt.columCount,pi=dt(be,["tableLayout"]),Vn=pi.tableLayout,qn=[],ki=_e||Ut.length,Wi=!1,Wn=ki-1;Wn>=0;Wn-=1){var mi=On[Wn],Si=Ut&&Ut[Wn],Ei=void 0,bi=void 0;if(Si&&(Ei=Si[In.v],Vn==="auto"&&(bi=Si.minWidth)),mi||bi||Ei||Wi){var gr=Ei||{},qi=gr.columnType,Ui=(0,Ee.Z)(gr,si);qn.unshift(Oe.createElement("col",(0,Ge.Z)({key:Wn,style:{width:mi,minWidth:bi}},Ui))),Wi=!0}}return Oe.createElement("colgroup",null,qn)}var Oi=Ti,zi=Le(80702),xr=["className","noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","stickyTopOffset","stickyBottomOffset","stickyClassName","onScroll","maxContentScroll","children"];function Ce(Vt,On){return(0,Oe.useMemo)(function(){for(var Ut=[],_e=0;_e<On;_e+=1){var pi=Vt[_e];if(pi!==void 0)Ut[_e]=pi;else return null}return Ut},[Vt.join("_"),On])}var _n=Oe.forwardRef(function(Vt,On){var Ut=Vt.className,_e=Vt.noData,pi=Vt.columns,Vn=Vt.flattenColumns,qn=Vt.colWidths,ki=Vt.columCount,Wi=Vt.stickyOffsets,Wn=Vt.direction,mi=Vt.fixHeader,Si=Vt.stickyTopOffset,Ei=Vt.stickyBottomOffset,bi=Vt.stickyClassName,gr=Vt.onScroll,qi=Vt.maxContentScroll,Ui=Vt.children,bn=(0,Ee.Z)(Vt,xr),Yi=dt(be,["prefixCls","scrollbarSize","isSticky","getComponent"]),rr=Yi.prefixCls,Po=Yi.scrollbarSize,uo=Yi.isSticky,No=Yi.getComponent,Do=No(["header","table"],"table"),Io=uo&&!mi?0:Po,fa=Oe.useRef(null),na=Oe.useCallback(function(ba){(0,Rt.mH)(On,ba),(0,Rt.mH)(fa,ba)},[]);Oe.useEffect(function(){var ba;function ga(Uo){var Fo=Uo,vs=Fo.currentTarget,Qa=Fo.deltaX;Qa&&(gr({currentTarget:vs,scrollLeft:vs.scrollLeft+Qa}),Uo.preventDefault())}return(ba=fa.current)===null||ba===void 0||ba.addEventListener("wheel",ga,{passive:!1}),function(){var Uo;(Uo=fa.current)===null||Uo===void 0||Uo.removeEventListener("wheel",ga)}},[]);var za=Oe.useMemo(function(){return Vn.every(function(ba){return ba.width})},[Vn]),zt=Vn[Vn.length-1],To={fixed:zt?zt.fixed:null,scrollbar:!0,onHeaderCell:function(){return{className:"".concat(rr,"-cell-scrollbar")}}},Pr=(0,Oe.useMemo)(function(){return Io?[].concat((0,zi.Z)(pi),[To]):pi},[Io,pi]),eo=(0,Oe.useMemo)(function(){return Io?[].concat((0,zi.Z)(Vn),[To]):Vn},[Io,Vn]),Zo=(0,Oe.useMemo)(function(){var ba=Wi.right,ga=Wi.left;return(0,Ye.Z)((0,Ye.Z)({},Wi),{},{left:Wn==="rtl"?[].concat((0,zi.Z)(ga.map(function(Uo){return Uo+Io})),[0]):ga,right:Wn==="rtl"?ba:[].concat((0,zi.Z)(ba.map(function(Uo){return Uo+Io})),[0]),isSticky:uo})},[Io,Wi,uo]),Wr=Ce(qn,ki);return Oe.createElement("div",{style:(0,Ye.Z)({overflow:"hidden"},uo?{top:Si,bottom:Ei}:{}),ref:na,className:wt()(Ut,(0,ut.Z)({},bi,!!bi))},Oe.createElement(Do,{style:{tableLayout:"fixed",visibility:_e||Wr?null:"hidden"}},(!_e||!qi||za)&&Oe.createElement(Oi,{colWidths:Wr?[].concat((0,zi.Z)(Wr),[Io]):[],columCount:ki+1,columns:eo}),Ui((0,Ye.Z)((0,Ye.Z)({},bn),{},{stickyOffsets:Zo,columns:Pr,flattenColumns:eo}))))}),ci=Oe.memo(_n),ar=function(On){var Ut=On.cells,_e=On.stickyOffsets,pi=On.flattenColumns,Vn=On.rowComponent,qn=On.cellComponent,ki=On.onHeaderRow,Wi=On.index,Wn=dt(be,["prefixCls","direction"]),mi=Wn.prefixCls,Si=Wn.direction,Ei;ki&&(Ei=ki(Ut.map(function(gr){return gr.column}),Wi));var bi=nt(Ut.map(function(gr){return gr.column}));return Oe.createElement(Vn,Ei,Ut.map(function(gr,qi){var Ui=gr.column,bn=An(gr.colStart,gr.colEnd,pi,_e,Si),Yi;return Ui&&Ui.onHeaderCell&&(Yi=gr.column.onHeaderCell(Ui)),Oe.createElement(lt,(0,Ge.Z)({},gr,{scope:Ui.title?gr.colSpan>1?"colgroup":"col":null,ellipsis:Ui.ellipsis,align:Ui.align,component:qn,prefixCls:mi,key:bi[qi]},bn,{additionalProps:Yi,rowType:"header"}))}))},_r=ar;function $r(Vt){var On=[];function Ut(qn,ki){var Wi=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;On[Wi]=On[Wi]||[];var Wn=ki,mi=qn.filter(Boolean).map(function(Si){var Ei={key:Si.key,className:Si.className||"",children:Si.title,column:Si,colStart:Wn},bi=1,gr=Si.children;return gr&&gr.length>0&&(bi=Ut(gr,Wn,Wi+1).reduce(function(qi,Ui){return qi+Ui},0),Ei.hasSubColumns=!0),"colSpan"in Si&&(bi=Si.colSpan),"rowSpan"in Si&&(Ei.rowSpan=Si.rowSpan),Ei.colSpan=bi,Ei.colEnd=Ei.colStart+bi-1,On[Wi].push(Ei),Wn+=bi,bi});return mi}Ut(Vt,0);for(var _e=On.length,pi=function(ki){On[ki].forEach(function(Wi){!("rowSpan"in Wi)&&!Wi.hasSubColumns&&(Wi.rowSpan=_e-ki)})},Vn=0;Vn<_e;Vn+=1)pi(Vn);return On}var po=function(On){var Ut=On.stickyOffsets,_e=On.columns,pi=On.flattenColumns,Vn=On.onHeaderRow,qn=dt(be,["prefixCls","getComponent"]),ki=qn.prefixCls,Wi=qn.getComponent,Wn=Oe.useMemo(function(){return $r(_e)},[_e]),mi=Wi(["header","wrapper"],"thead"),Si=Wi(["header","row"],"tr"),Ei=Wi(["header","cell"],"th");return Oe.createElement(mi,{className:"".concat(ki,"-thead")},Wn.map(function(bi,gr){var qi=Oe.createElement(_r,{key:gr,flattenColumns:pi,cells:bi,stickyOffsets:Ut,rowComponent:Si,cellComponent:Ei,onHeaderRow:Vn,index:gr});return qi}))},fi=pe(po),Qn=Le(78612);function Bt(Vt,On,Ut){var _e=(0,In.g)(Vt),pi=_e.expandIcon,Vn=_e.expandedRowKeys,qn=_e.defaultExpandedRowKeys,ki=_e.defaultExpandAllRows,Wi=_e.expandedRowRender,Wn=_e.onExpand,mi=_e.onExpandedRowsChange,Si=_e.childrenColumnName,Ei=pi||hn,bi=Si||"children",gr=Oe.useMemo(function(){return Wi?"row":Vt.expandable&&Vt.internalHooks===ue.R&&Vt.expandable.__PARENT_RENDER_ICON__||On.some(function(uo){return uo&&(0,et.Z)(uo)==="object"&&uo[bi]})?"nest":!1},[!!Wi,On]),qi=Oe.useState(function(){return qn||(ki?di(On,Ut,bi):[])}),Ui=(0,Ke.Z)(qi,2),bn=Ui[0],Yi=Ui[1],rr=Oe.useMemo(function(){return new Set(Vn||bn||[])},[Vn,bn]),Po=Oe.useCallback(function(uo){var No=Ut(uo,On.indexOf(uo)),Do,Io=rr.has(No);Io?(rr.delete(No),Do=(0,zi.Z)(rr)):Do=[].concat((0,zi.Z)(rr),[No]),Yi(Do),Wn&&Wn(!Io,uo),mi&&mi(Do)},[Ut,rr,On,Wn,mi]);return[_e,gr,rr,Ei,bi,Po]}function Tt(Vt,On,Ut){var _e=Vt.map(function(pi,Vn){return An(Vn,Vn,Vt,On,Ut)});return(0,St.Z)(function(){return _e},[_e],function(pi,Vn){return!(0,mt.Z)(pi,Vn)})}function kt(Vt){var On=(0,Oe.useRef)(Vt),Ut=(0,Oe.useState)({}),_e=(0,Ke.Z)(Ut,2),pi=_e[1],Vn=(0,Oe.useRef)(null),qn=(0,Oe.useRef)([]);function ki(Wi){qn.current.push(Wi);var Wn=Promise.resolve();Vn.current=Wn,Wn.then(function(){if(Vn.current===Wn){var mi=qn.current,Si=On.current;qn.current=[],mi.forEach(function(Ei){On.current=Ei(On.current)}),Vn.current=null,Si!==On.current&&pi({})}})}return(0,Oe.useEffect)(function(){return function(){Vn.current=null}},[]),[On.current,ki]}function ui(Vt){var On=(0,Oe.useRef)(Vt||null),Ut=(0,Oe.useRef)();function _e(){window.clearTimeout(Ut.current)}function pi(qn){On.current=qn,_e(),Ut.current=window.setTimeout(function(){On.current=null,Ut.current=void 0},100)}function Vn(){return On.current}return(0,Oe.useEffect)(function(){return _e},[]),[pi,Vn]}function Yn(){var Vt=Oe.useState(-1),On=(0,Ke.Z)(Vt,2),Ut=On[0],_e=On[1],pi=Oe.useState(-1),Vn=(0,Ke.Z)(pi,2),qn=Vn[0],ki=Vn[1],Wi=Oe.useCallback(function(Wn,mi){_e(Wn),ki(mi)},[]);return[Ut,qn,Wi]}var vi=Le(47273),yn=(0,vi.Z)()?window:null;function Kn(Vt,On){var Ut=(0,et.Z)(Vt)==="object"?Vt:{},_e=Ut.offsetHeader,pi=_e===void 0?0:_e,Vn=Ut.offsetSummary,qn=Vn===void 0?0:Vn,ki=Ut.offsetScroll,Wi=ki===void 0?0:ki,Wn=Ut.getContainer,mi=Wn===void 0?function(){return yn}:Wn,Si=mi()||yn,Ei=!!Vt;return Oe.useMemo(function(){return{isSticky:Ei,stickyClassName:Ei?"".concat(On,"-sticky-holder"):"",offsetHeader:pi,offsetSummary:qn,offsetScroll:Wi,container:Si}},[Ei,Wi,pi,qn,On,Si])}function It(Vt,On,Ut){var _e=(0,Oe.useMemo)(function(){var pi=On.length,Vn=function(Wn,mi,Si){for(var Ei=[],bi=0,gr=Wn;gr!==mi;gr+=Si)Ei.push(bi),On[gr].fixed&&(bi+=Vt[gr]||0);return Ei},qn=Vn(0,pi,1),ki=Vn(pi-1,-1,-1).reverse();return Ut==="rtl"?{left:ki,right:qn}:{left:qn,right:ki}},[Vt,On,Ut]);return _e}var _t=It;function hi(Vt){var On=Vt.className,Ut=Vt.children;return Oe.createElement("div",{className:On},Ut)}var it=hi,sn=Le(8224),Dn=Le(16089),Di=Le(76846);function cn(Vt){var On=(0,Di.bn)(Vt),Ut=On.getBoundingClientRect(),_e=document.documentElement;return{left:Ut.left+(window.pageXOffset||_e.scrollLeft)-(_e.clientLeft||document.body.clientLeft||0),top:Ut.top+(window.pageYOffset||_e.scrollTop)-(_e.clientTop||document.body.clientTop||0)}}var qt=function(On,Ut){var _e,pi,Vn=On.scrollBodyRef,qn=On.onScroll,ki=On.offsetScroll,Wi=On.container,Wn=On.direction,mi=dt(be,"prefixCls"),Si=((_e=Vn.current)===null||_e===void 0?void 0:_e.scrollWidth)||0,Ei=((pi=Vn.current)===null||pi===void 0?void 0:pi.clientWidth)||0,bi=Si&&Ei*(Ei/Si),gr=Oe.useRef(),qi=kt({scrollLeft:0,isHiddenScrollBar:!0}),Ui=(0,Ke.Z)(qi,2),bn=Ui[0],Yi=Ui[1],rr=Oe.useRef({delta:0,x:0}),Po=Oe.useState(!1),uo=(0,Ke.Z)(Po,2),No=uo[0],Do=uo[1],Io=Oe.useRef(null);Oe.useEffect(function(){return function(){Dn.Z.cancel(Io.current)}},[]);var fa=function(){Do(!1)},na=function(eo){eo.persist(),rr.current.delta=eo.pageX-bn.scrollLeft,rr.current.x=0,Do(!0),eo.preventDefault()},za=function(eo){var Zo,Wr=eo||((Zo=window)===null||Zo===void 0?void 0:Zo.event),ba=Wr.buttons;if(!No||ba===0){No&&Do(!1);return}var ga=rr.current.x+eo.pageX-rr.current.x-rr.current.delta,Uo=Wn==="rtl";ga=Math.max(Uo?bi-Ei:0,Math.min(Uo?0:Ei-bi,ga));var Fo=!Uo||Math.abs(ga)+Math.abs(bi)<Ei;Fo&&(qn({scrollLeft:ga/Ei*(Si+2)}),rr.current.x=eo.pageX)},zt=function(){Dn.Z.cancel(Io.current),Io.current=(0,Dn.Z)(function(){if(Vn.current){var eo=cn(Vn.current).top,Zo=eo+Vn.current.offsetHeight,Wr=Wi===window?document.documentElement.scrollTop+window.innerHeight:cn(Wi).top+Wi.clientHeight;Zo-(0,pn.Z)()<=Wr||eo>=Wr-ki?Yi(function(ba){return(0,Ye.Z)((0,Ye.Z)({},ba),{},{isHiddenScrollBar:!0})}):Yi(function(ba){return(0,Ye.Z)((0,Ye.Z)({},ba),{},{isHiddenScrollBar:!1})})}})},To=function(eo){Yi(function(Zo){return(0,Ye.Z)((0,Ye.Z)({},Zo),{},{scrollLeft:eo/Si*Ei||0})})};return Oe.useImperativeHandle(Ut,function(){return{setScrollLeft:To,checkScrollBarVisible:zt}}),Oe.useEffect(function(){var Pr=(0,sn.Z)(document.body,"mouseup",fa,!1),eo=(0,sn.Z)(document.body,"mousemove",za,!1);return zt(),function(){Pr.remove(),eo.remove()}},[bi,No]),Oe.useEffect(function(){if(Vn.current){for(var Pr=[],eo=(0,Di.bn)(Vn.current);eo;)Pr.push(eo),eo=eo.parentElement;return Pr.forEach(function(Zo){return Zo.addEventListener("scroll",zt,!1)}),window.addEventListener("resize",zt,!1),window.addEventListener("scroll",zt,!1),Wi.addEventListener("scroll",zt,!1),function(){Pr.forEach(function(Zo){return Zo.removeEventListener("scroll",zt)}),window.removeEventListener("resize",zt),window.removeEventListener("scroll",zt),Wi.removeEventListener("scroll",zt)}}},[Wi]),Oe.useEffect(function(){bn.isHiddenScrollBar||Yi(function(Pr){var eo=Vn.current;return eo?(0,Ye.Z)((0,Ye.Z)({},Pr),{},{scrollLeft:eo.scrollLeft/eo.scrollWidth*eo.clientWidth}):Pr})},[bn.isHiddenScrollBar]),Si<=Ei||!bi||bn.isHiddenScrollBar?null:Oe.createElement("div",{style:{height:(0,pn.Z)(),width:Ei,bottom:ki},className:"".concat(mi,"-sticky-scroll")},Oe.createElement("div",{onMouseDown:na,ref:gr,className:wt()("".concat(mi,"-sticky-scroll-bar"),(0,ut.Z)({},"".concat(mi,"-sticky-scroll-bar-active"),No)),style:{width:"".concat(bi,"px"),transform:"translate3d(".concat(bn.scrollLeft,"px, 0, 0)")}}))},an=Oe.forwardRef(qt);function Gi(Vt){return null}var ur=Gi;function Hi(Vt){return null}var Mi=Hi,Ri="rc-table",dr=[],Er={};function Ar(){return"No Data"}function wn(Vt,On){var Ut=(0,Ye.Z)({rowKey:"key",prefixCls:Ri,emptyText:Ar},Vt),_e=Ut.prefixCls,pi=Ut.className,Vn=Ut.rowClassName,qn=Ut.style,ki=Ut.data,Wi=Ut.rowKey,Wn=Ut.scroll,mi=Ut.tableLayout,Si=Ut.direction,Ei=Ut.title,bi=Ut.footer,gr=Ut.summary,qi=Ut.caption,Ui=Ut.id,bn=Ut.showHeader,Yi=Ut.components,rr=Ut.emptyText,Po=Ut.onRow,uo=Ut.onHeaderRow,No=Ut.onScroll,Do=Ut.internalHooks,Io=Ut.transformColumns,fa=Ut.internalRefs,na=Ut.tailor,za=Ut.getContainerWidth,zt=Ut.sticky,To=Ut.rowHoverable,Pr=To===void 0?!0:To,eo=ki||dr,Zo=!!eo.length,Wr=Do===ue.R,ba=Oe.useCallback(function(pa,Fa){return(0,Lt.Z)(Yi,pa)||Fa},[Yi]),ga=Oe.useMemo(function(){return typeof Wi=="function"?Wi:function(pa){var Fa=pa&&pa[Wi];return Fa}},[Wi]),Uo=ba(["body"]),Fo=Yn(),vs=(0,Ke.Z)(Fo,3),Qa=vs[0],ns=vs[1],ds=vs[2],Vr=Bt(Ut,eo,ga),wa=(0,Ke.Z)(Vr,6),Ba=wa[0],is=wa[1],Vo=wa[2],Ko=wa[3],ni=wa[4],to=wa[5],Xo=Wn==null?void 0:Wn.x,Ia=Oe.useState(0),ms=(0,Ke.Z)(Ia,2),cs=ms[0],yo=ms[1],as=(0,Qn.Z)((0,Ye.Z)((0,Ye.Z)((0,Ye.Z)({},Ut),Ba),{},{expandable:!!Ba.expandedRowRender,columnTitle:Ba.columnTitle,expandedKeys:Vo,getRowKey:ga,onTriggerExpand:to,expandIcon:Ko,expandIconColumnIndex:Ba.expandIconColumnIndex,direction:Si,scrollWidth:Wr&&na&&typeof Xo=="number"?Xo:null,clientWidth:cs}),Wr?Io:null),ls=(0,Ke.Z)(as,4),Yt=ls[0],Xt=ls[1],kn=ls[2],Zi=ls[3],yi=kn!=null?kn:Xo,Ai=Oe.useMemo(function(){return{columns:Yt,flattenColumns:Xt}},[Yt,Xt]),Li=Oe.useRef(),Rn=Oe.useRef(),ri=Oe.useRef(),ir=Oe.useRef();Oe.useImperativeHandle(On,function(){return{nativeElement:Li.current,scrollTo:function(Fa){var us;if(ri.current instanceof HTMLElement){var Ts=Fa.index,_s=Fa.top,vu=Fa.key;if(oi(_s)){var Jl;(Jl=ri.current)===null||Jl===void 0||Jl.scrollTo({top:_s})}else{var yu,Jn=vu!=null?vu:ga(eo[Ts]);(yu=ri.current.querySelector('[data-row-key="'.concat(Jn,'"]')))===null||yu===void 0||yu.scrollIntoView()}}else(us=ri.current)!==null&&us!==void 0&&us.scrollTo&&ri.current.scrollTo(Fa)}}});var Rr=Oe.useRef(),ea=Oe.useState(!1),_o=(0,Ke.Z)(ea,2),Pa=_o[0],xa=_o[1],vo=Oe.useState(!1),Kr=(0,Ke.Z)(vo,2),er=Kr[0],ia=Kr[1],sa=kt(new Map),Ma=(0,Ke.Z)(sa,2),Oa=Ma[0],Oo=Ma[1],ua=nt(Xt),Lo=ua.map(function(pa){return Oa.get(pa)}),jr=Oe.useMemo(function(){return Lo},[Lo.join("_")]),oo=_t(jr,Xt,Si),Yr=Wn&&gn(Wn.y),wo=Wn&&gn(yi)||!!Ba.fixed,Ra=wo&&Xt.some(function(pa){var Fa=pa.fixed;return Fa}),Ha=Oe.useRef(),Mt=Kn(zt,_e),Pt=Mt.isSticky,ln=Mt.offsetHeader,He=Mt.offsetSummary,Dt=Mt.offsetScroll,Xi=Mt.stickyClassName,Mr=Mt.container,Qi=Oe.useMemo(function(){return gr==null?void 0:gr(eo)},[gr,eo]),$i=(Yr||Pt)&&Oe.isValidElement(Qi)&&Qi.type===Je&&Qi.props.fixed,wi,pr,Hr;Yr&&(pr={overflowY:Zo?"scroll":"auto",maxHeight:Wn.y}),wo&&(wi={overflowX:"auto"},Yr||(pr={overflowY:"hidden"}),Hr={width:yi===!0?"auto":yi,minWidth:"100%"});var no=Oe.useCallback(function(pa,Fa){(0,Jt.Z)(Li.current)&&Oo(function(us){if(us.get(pa)!==Fa){var Ts=new Map(us);return Ts.set(pa,Fa),Ts}return us})},[]),lr=ui(null),cr=(0,Ke.Z)(lr,2),yr=cr[0],_i=cr[1];function Ci(pa,Fa){Fa&&(typeof Fa=="function"?Fa(pa):Fa.scrollLeft!==pa&&(Fa.scrollLeft=pa,Fa.scrollLeft!==pa&&setTimeout(function(){Fa.scrollLeft=pa},0)))}var Dr=(0,ft.Z)(function(pa){var Fa=pa.currentTarget,us=pa.scrollLeft,Ts=Si==="rtl",_s=typeof us=="number"?us:Fa.scrollLeft,vu=Fa||Er;if(!_i()||_i()===vu){var Jl;yr(vu),Ci(_s,Rn.current),Ci(_s,ri.current),Ci(_s,Rr.current),Ci(_s,(Jl=Ha.current)===null||Jl===void 0?void 0:Jl.setScrollLeft)}var yu=Fa||Rn.current;if(yu){var Jn=Wr&&na&&typeof yi=="number"?yi:yu.scrollWidth,Xr=yu.clientWidth;if(Jn===Xr){xa(!1),ia(!1);return}Ts?(xa(-_s<Jn-Xr),ia(-_s>0)):(xa(_s>0),ia(_s<Jn-Xr))}}),ko=(0,ft.Z)(function(pa){Dr(pa),No==null||No(pa)}),br=function(){if(wo&&ri.current){var Fa;Dr({currentTarget:(0,Di.bn)(ri.current),scrollLeft:(Fa=ri.current)===null||Fa===void 0?void 0:Fa.scrollLeft})}else xa(!1),ia(!1)},Cr=function(Fa){var us,Ts=Fa.width;(us=Ha.current)===null||us===void 0||us.checkScrollBarVisible();var _s=Li.current?Li.current.offsetWidth:Ts;Wr&&za&&Li.current&&(_s=za(Li.current,_s)||_s),_s!==cs&&(br(),yo(_s))},Nr=Oe.useRef(!1);Oe.useEffect(function(){Nr.current&&br()},[wo,ki,Yt.length]),Oe.useEffect(function(){Nr.current=!0},[]);var Tr=Oe.useState(0),sr=(0,Ke.Z)(Tr,2),ra=sr[0],Bo=sr[1],ta=Oe.useState(!0),Sa=(0,Ke.Z)(ta,2),ro=Sa[0],ha=Sa[1];Oe.useEffect(function(){(!na||!Wr)&&(ri.current instanceof Element?Bo((0,pn.o)(ri.current).width):Bo((0,pn.o)(ir.current).width)),ha((0,jt.G)("position","sticky"))},[]),Oe.useEffect(function(){Wr&&fa&&(fa.body.current=ri.current)});var As=Oe.useCallback(function(pa){return Oe.createElement(Oe.Fragment,null,Oe.createElement(fi,pa),$i==="top"&&Oe.createElement(fn,pa,Qi))},[$i,Qi]),kr=Oe.useCallback(function(pa){return Oe.createElement(fn,pa,Qi)},[Qi]),$a=ba(["table"],"table"),Eo=Oe.useMemo(function(){return mi||(Ra?yi==="max-content"?"auto":"fixed":Yr||Pt||Xt.some(function(pa){var Fa=pa.ellipsis;return Fa})?"fixed":"auto")},[Yr,Ra,Xt,mi,Pt]),ts,ys={colWidths:jr,columCount:Xt.length,stickyOffsets:oo,onHeaderRow:uo,fixHeader:Yr,scroll:Wn},Ol=Oe.useMemo(function(){return Zo?null:typeof rr=="function"?rr():rr},[Zo,rr]),ku=Oe.createElement($n,{data:eo,measureColumnWidth:Yr||wo||Pt}),mu=Oe.createElement(Oi,{colWidths:Xt.map(function(pa){var Fa=pa.width;return Fa}),columns:Xt}),Ll=qi!=null?Oe.createElement("caption",{className:"".concat(_e,"-caption")},qi):void 0,ru=(0,jn.Z)(Ut,{data:!0}),ka=(0,jn.Z)(Ut,{aria:!0});if(Yr||Pt){var tl;typeof Uo=="function"?(tl=Uo(eo,{scrollbarSize:ra,ref:ri,onScroll:Dr}),ys.colWidths=Xt.map(function(pa,Fa){var us=pa.width,Ts=Fa===Xt.length-1?us-ra:us;return typeof Ts=="number"&&!Number.isNaN(Ts)?Ts:0})):tl=Oe.createElement("div",{style:(0,Ye.Z)((0,Ye.Z)({},wi),pr),onScroll:ko,ref:ri,className:wt()("".concat(_e,"-body"))},Oe.createElement($a,(0,Ge.Z)({style:(0,Ye.Z)((0,Ye.Z)({},Hr),{},{tableLayout:Eo})},ka),Ll,mu,ku,!$i&&Qi&&Oe.createElement(fn,{stickyOffsets:oo,flattenColumns:Xt},Qi)));var ou=(0,Ye.Z)((0,Ye.Z)((0,Ye.Z)({noData:!eo.length,maxContentScroll:wo&&yi==="max-content"},ys),Ai),{},{direction:Si,stickyClassName:Xi,onScroll:Dr});ts=Oe.createElement(Oe.Fragment,null,bn!==!1&&Oe.createElement(ci,(0,Ge.Z)({},ou,{stickyTopOffset:ln,className:"".concat(_e,"-header"),ref:Rn}),As),tl,$i&&$i!=="top"&&Oe.createElement(ci,(0,Ge.Z)({},ou,{stickyBottomOffset:He,className:"".concat(_e,"-summary"),ref:Rr}),kr),Pt&&ri.current&&ri.current instanceof Element&&Oe.createElement(an,{ref:Ha,offsetScroll:Dt,scrollBodyRef:ri,onScroll:Dr,container:Mr,direction:Si}))}else ts=Oe.createElement("div",{style:(0,Ye.Z)((0,Ye.Z)({},wi),pr),className:wt()("".concat(_e,"-content")),onScroll:Dr,ref:ri},Oe.createElement($a,(0,Ge.Z)({style:(0,Ye.Z)((0,Ye.Z)({},Hr),{},{tableLayout:Eo})},ka),Ll,mu,bn!==!1&&Oe.createElement(fi,(0,Ge.Z)({},ys,Ai)),ku,Qi&&Oe.createElement(fn,{stickyOffsets:oo,flattenColumns:Xt},Qi)));var Bl=Oe.createElement("div",(0,Ge.Z)({className:wt()(_e,pi,(0,ut.Z)((0,ut.Z)((0,ut.Z)((0,ut.Z)((0,ut.Z)((0,ut.Z)((0,ut.Z)((0,ut.Z)((0,ut.Z)((0,ut.Z)({},"".concat(_e,"-rtl"),Si==="rtl"),"".concat(_e,"-ping-left"),Pa),"".concat(_e,"-ping-right"),er),"".concat(_e,"-layout-fixed"),mi==="fixed"),"".concat(_e,"-fixed-header"),Yr),"".concat(_e,"-fixed-column"),Ra),"".concat(_e,"-fixed-column-gapped"),Ra&&Zi),"".concat(_e,"-scroll-horizontal"),wo),"".concat(_e,"-has-fix-left"),Xt[0]&&Xt[0].fixed),"".concat(_e,"-has-fix-right"),Xt[Xt.length-1]&&Xt[Xt.length-1].fixed==="right")),style:qn,id:Ui,ref:Li},ru),Ei&&Oe.createElement(it,{className:"".concat(_e,"-title")},Ei(eo)),Oe.createElement("div",{ref:ir,className:"".concat(_e,"-container")},ts),bi&&Oe.createElement(it,{className:"".concat(_e,"-footer")},bi(eo)));wo&&(Bl=Oe.createElement(Ft.Z,{onResize:Cr},Bl));var ih=Tt(Xt,oo,Si),ul=Oe.useMemo(function(){return{scrollX:yi,prefixCls:_e,getComponent:ba,scrollbarSize:ra,direction:Si,fixedInfoList:ih,isSticky:Pt,supportSticky:ro,componentWidth:cs,fixHeader:Yr,fixColumn:Ra,horizonScroll:wo,tableLayout:Eo,rowClassName:Vn,expandedRowClassName:Ba.expandedRowClassName,expandIcon:Ko,expandableType:is,expandRowByClick:Ba.expandRowByClick,expandedRowRender:Ba.expandedRowRender,onTriggerExpand:to,expandIconColumnIndex:Ba.expandIconColumnIndex,indentSize:Ba.indentSize,allColumnsFixedLeft:Xt.every(function(pa){return pa.fixed==="left"}),emptyNode:Ol,columns:Yt,flattenColumns:Xt,onColumnResize:no,hoverStartRow:Qa,hoverEndRow:ns,onHover:ds,rowExpandable:Ba.rowExpandable,onRow:Po,getRowKey:ga,expandedKeys:Vo,childrenColumnName:ni,rowHoverable:Pr}},[yi,_e,ba,ra,Si,ih,Pt,ro,cs,Yr,Ra,wo,Eo,Vn,Ba.expandedRowClassName,Ko,is,Ba.expandRowByClick,Ba.expandedRowRender,to,Ba.expandIconColumnIndex,Ba.indentSize,Ol,Yt,Xt,no,Qa,ns,ds,Ba.rowExpandable,Po,ga,Vo,ni,Pr]);return Oe.createElement(be.Provider,{value:ul},Bl)}var Yo=Oe.forwardRef(wn);function zr(Vt){return se(Yo,Vt)}var mo=zr();mo.EXPAND_COLUMN=ue.w,mo.INTERNAL_HOOKS=ue.R,mo.Column=ur,mo.ColumnGroup=Mi,mo.Summary=vn;var en=mo,li=Le(45680),nr=Ct(null),Sr=Ct(null);function vr(Vt,On,Ut){var _e=On||1;return Ut[Vt+_e]-(Ut[Vt]||0)}function Ir(Vt){var On=Vt.rowInfo,Ut=Vt.column,_e=Vt.colIndex,pi=Vt.indent,Vn=Vt.index,qn=Vt.component,ki=Vt.renderIndex,Wi=Vt.record,Wn=Vt.style,mi=Vt.className,Si=Vt.inverse,Ei=Vt.getHeight,bi=Ut.render,gr=Ut.dataIndex,qi=Ut.className,Ui=Ut.width,bn=dt(Sr,["columnsOffset"]),Yi=bn.columnsOffset,rr=Kt(On,Ut,_e,pi,Vn),Po=rr.key,uo=rr.fixedInfo,No=rr.appendCellNode,Do=rr.additionalCellProps,Io=Do.style,fa=Do.colSpan,na=fa===void 0?1:fa,za=Do.rowSpan,zt=za===void 0?1:za,To=_e-1,Pr=vr(To,na,Yi),eo=na>1?Ui-Pr:0,Zo=(0,Ye.Z)((0,Ye.Z)((0,Ye.Z)({},Io),Wn),{},{flex:"0 0 ".concat(Pr,"px"),width:"".concat(Pr,"px"),marginRight:eo,pointerEvents:"auto"}),Wr=Oe.useMemo(function(){return Si?zt<=1:na===0||zt===0||zt>1},[zt,na,Si]);Wr?Zo.visibility="hidden":Si&&(Zo.height=Ei==null?void 0:Ei(zt));var ba=Wr?function(){return null}:bi,ga={};return(zt===0||na===0)&&(ga.rowSpan=1,ga.colSpan=1),Oe.createElement(lt,(0,Ge.Z)({className:wt()(qi,mi),ellipsis:Ut.ellipsis,align:Ut.align,scope:Ut.rowScope,component:qn,prefixCls:On.prefixCls,key:Po,record:Wi,index:Vn,renderIndex:ki,dataIndex:gr,render:ba,shouldCellUpdate:Ut.shouldCellUpdate},uo,{appendNode:No,additionalProps:(0,Ye.Z)((0,Ye.Z)({},Do),{},{style:Zo},ga)}))}var bo=Ir,fo=["data","index","className","rowKey","style","extra","getHeight"],so=Oe.forwardRef(function(Vt,On){var Ut=Vt.data,_e=Vt.index,pi=Vt.className,Vn=Vt.rowKey,qn=Vt.style,ki=Vt.extra,Wi=Vt.getHeight,Wn=(0,Ee.Z)(Vt,fo),mi=Ut.record,Si=Ut.indent,Ei=Ut.index,bi=dt(be,["prefixCls","flattenColumns","fixColumn","componentWidth","scrollX"]),gr=bi.scrollX,qi=bi.flattenColumns,Ui=bi.prefixCls,bn=bi.fixColumn,Yi=bi.componentWidth,rr=dt(nr,["getComponent"]),Po=rr.getComponent,uo=fr(mi,Vn,_e,Si),No=Po(["body","row"],"div"),Do=Po(["body","cell"],"div"),Io=uo.rowSupportExpand,fa=uo.expanded,na=uo.rowProps,za=uo.expandedRowRender,zt=uo.expandedRowClassName,To;if(Io&&fa){var Pr=za(mi,_e,Si+1,fa),eo=Sn(zt,mi,_e,Si),Zo={};bn&&(Zo={style:(0,ut.Z)({},"--virtual-width","".concat(Yi,"px"))});var Wr="".concat(Ui,"-expanded-row-cell");To=Oe.createElement(No,{className:wt()("".concat(Ui,"-expanded-row"),"".concat(Ui,"-expanded-row-level-").concat(Si+1),eo)},Oe.createElement(lt,{component:Do,prefixCls:Ui,className:wt()(Wr,(0,ut.Z)({},"".concat(Wr,"-fixed"),bn)),additionalProps:Zo},Pr))}var ba=(0,Ye.Z)((0,Ye.Z)({},qn),{},{width:gr});ki&&(ba.position="absolute",ba.pointerEvents="none");var ga=Oe.createElement(No,(0,Ge.Z)({},na,Wn,{"data-row-key":Vn,ref:Io?null:On,className:wt()(pi,"".concat(Ui,"-row"),na==null?void 0:na.className,(0,ut.Z)({},"".concat(Ui,"-row-extra"),ki)),style:(0,Ye.Z)((0,Ye.Z)({},ba),na==null?void 0:na.style)}),qi.map(function(Uo,Fo){return Oe.createElement(bo,{key:Fo,component:Do,rowInfo:uo,column:Uo,colIndex:Fo,indent:Si,index:_e,renderIndex:Ei,record:mi,inverse:ki,getHeight:Wi})}));return Io?Oe.createElement("div",{ref:On},ga,To):ga}),lo=pe(so),Tn=lo,qo=Oe.forwardRef(function(Vt,On){var Ut=Vt.data,_e=Vt.onScroll,pi=dt(be,["flattenColumns","onColumnResize","getRowKey","prefixCls","expandedKeys","childrenColumnName","scrollX","direction"]),Vn=pi.flattenColumns,qn=pi.onColumnResize,ki=pi.getRowKey,Wi=pi.expandedKeys,Wn=pi.prefixCls,mi=pi.childrenColumnName,Si=pi.scrollX,Ei=pi.direction,bi=dt(nr),gr=bi.sticky,qi=bi.scrollY,Ui=bi.listItemHeight,bn=bi.getComponent,Yi=bi.onScroll,rr=Oe.useRef(),Po=Mn(Ut,mi,Wi,ki),uo=Oe.useMemo(function(){var To=0;return Vn.map(function(Pr){var eo=Pr.width,Zo=Pr.key;return To+=eo,[Zo,eo,To]})},[Vn]),No=Oe.useMemo(function(){return uo.map(function(To){return To[2]})},[uo]);Oe.useEffect(function(){uo.forEach(function(To){var Pr=(0,Ke.Z)(To,2),eo=Pr[0],Zo=Pr[1];qn(eo,Zo)})},[uo]),Oe.useImperativeHandle(On,function(){var To,Pr={scrollTo:function(Zo){var Wr;(Wr=rr.current)===null||Wr===void 0||Wr.scrollTo(Zo)},nativeElement:(To=rr.current)===null||To===void 0?void 0:To.nativeElement};return Object.defineProperty(Pr,"scrollLeft",{get:function(){var Zo;return((Zo=rr.current)===null||Zo===void 0?void 0:Zo.getScrollInfo().x)||0},set:function(Zo){var Wr;(Wr=rr.current)===null||Wr===void 0||Wr.scrollTo({left:Zo})}}),Pr});var Do=function(Pr,eo){var Zo,Wr=(Zo=Po[eo])===null||Zo===void 0?void 0:Zo.record,ba=Pr.onCell;if(ba){var ga,Uo=ba(Wr,eo);return(ga=Uo==null?void 0:Uo.rowSpan)!==null&&ga!==void 0?ga:1}return 1},Io=function(Pr){var eo=Pr.start,Zo=Pr.end,Wr=Pr.getSize,ba=Pr.offsetY;if(Zo<0)return null;for(var ga=Vn.filter(function(Ko){return Do(Ko,eo)===0}),Uo=eo,Fo=function(ni){if(ga=ga.filter(function(to){return Do(to,ni)===0}),!ga.length)return Uo=ni,1},vs=eo;vs>=0&&!Fo(vs);vs-=1);for(var Qa=Vn.filter(function(Ko){return Do(Ko,Zo)!==1}),ns=Zo,ds=function(ni){if(Qa=Qa.filter(function(to){return Do(to,ni)!==1}),!Qa.length)return ns=Math.max(ni-1,Zo),1},Vr=Zo;Vr<Po.length&&!ds(Vr);Vr+=1);for(var wa=[],Ba=function(ni){var to=Po[ni];if(!to)return 1;Vn.some(function(Xo){return Do(Xo,ni)>1})&&wa.push(ni)},is=Uo;is<=ns;is+=1)Ba(is);var Vo=wa.map(function(Ko){var ni=Po[Ko],to=ki(ni.record,Ko),Xo=function(cs){var yo=Ko+cs-1,as=ki(Po[yo].record,yo),ls=Wr(to,as);return ls.bottom-ls.top},Ia=Wr(to);return Oe.createElement(Tn,{key:Ko,data:ni,rowKey:to,index:Ko,style:{top:-ba+Ia.top},extra:!0,getHeight:Xo})});return Vo},fa=Oe.useMemo(function(){return{columnsOffset:No}},[No]),na="".concat(Wn,"-tbody"),za=bn(["body","wrapper"]),zt={};return gr&&(zt.position="sticky",zt.bottom=0,(0,et.Z)(gr)==="object"&&gr.offsetScroll&&(zt.bottom=gr.offsetScroll)),Oe.createElement(Sr.Provider,{value:fa},Oe.createElement(li.Z,{fullHeight:!1,ref:rr,prefixCls:"".concat(na,"-virtual"),styles:{horizontalScrollBar:zt},className:na,height:qi,itemHeight:Ui||24,data:Po,itemKey:function(Pr){return ki(Pr.record)},component:za,scrollWidth:Si,direction:Ei,onVirtualScroll:function(Pr){var eo,Zo=Pr.x;_e({currentTarget:(eo=rr.current)===null||eo===void 0?void 0:eo.nativeElement,scrollLeft:Zo})},onScroll:Yi,extraRender:Io},function(To,Pr,eo){var Zo=ki(To.record,Pr);return Oe.createElement(Tn,{data:To,rowKey:Zo,index:Pr,style:eo.style})}))}),Zn=pe(qo),wr=Zn,Or=function(On,Ut){var _e=Ut.ref,pi=Ut.onScroll;return Oe.createElement(wr,{ref:_e,data:On,onScroll:pi})};function hr(Vt,On){var Ut=Vt.data,_e=Vt.columns,pi=Vt.scroll,Vn=Vt.sticky,qn=Vt.prefixCls,ki=qn===void 0?Ri:qn,Wi=Vt.className,Wn=Vt.listItemHeight,mi=Vt.components,Si=Vt.onScroll,Ei=pi||{},bi=Ei.x,gr=Ei.y;typeof bi!="number"&&(bi=1),typeof gr!="number"&&(gr=500);var qi=(0,ii.zX)(function(Yi,rr){return(0,Lt.Z)(mi,Yi)||rr}),Ui=(0,ii.zX)(Si),bn=Oe.useMemo(function(){return{sticky:Vn,scrollY:gr,listItemHeight:Wn,getComponent:qi,onScroll:Ui}},[Vn,gr,Wn,qi,Ui]);return Oe.createElement(nr.Provider,{value:bn},Oe.createElement(en,(0,Ge.Z)({},Vt,{className:wt()(Wi,"".concat(ki,"-virtual")),scroll:(0,Ye.Z)((0,Ye.Z)({},pi),{},{x:bi}),components:(0,Ye.Z)((0,Ye.Z)({},mi),{},{body:Ut!=null&&Ut.length?Or:void 0}),columns:_e,internalHooks:ue.R,tailor:!0,ref:On})))}var la=Oe.forwardRef(hr);function ca(Vt){return se(la,Vt)}var Qo=ca(),zo=null},90494:function(Un,ai,Le){"use strict";Le.d(ai,{g:function(){return Oe},v:function(){return mt}});var ue=Le(77321),Ke=Le(74416),ft=Le(48736),yt=["expandable"],mt="RC_TABLE_INTERNAL_COL_DEFINE";function Oe(at){var Ct=at.expandable,dt=(0,Ke.Z)(at,yt),Ge;return"expandable"in at?Ge=(0,ue.Z)((0,ue.Z)({},dt),Ct):Ge=dt,Ge.showExpandColumn===!1&&(Ge.expandIconColumnIndex=-1),Ge}},22711:function(Un,ai,Le){"use strict";Le.r(ai),Le.d(ai,{ResizableTextArea:function(){return tt},default:function(){return mn}});var ue=Le(72308),Ke=Le(49618),ft=Le(77321),yt=Le(80702),mt=Le(52487),Oe=Le(74416),at=Le(92310),Ct=Le.n(at),dt=Le(36901),Ge=Le(66003),Rt=Le(30292),ot=Le(18929),At=Le(59301),Te=Le(62853),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 be($t){var Pn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ot=$t.getAttribute("id")||$t.getAttribute("data-reactid")||$t.getAttribute("name");if(Pn&&ye[Ot])return ye[Ot];var ct=window.getComputedStyle($t),nt=ct.getPropertyValue("box-sizing")||ct.getPropertyValue("-moz-box-sizing")||ct.getPropertyValue("-webkit-box-sizing"),gn=parseFloat(ct.getPropertyValue("padding-bottom"))+parseFloat(ct.getPropertyValue("padding-top")),oi=parseFloat(ct.getPropertyValue("border-bottom-width"))+parseFloat(ct.getPropertyValue("border-top-width")),zn=pe.map(function(Fn){return"".concat(Fn,":").concat(ct.getPropertyValue(Fn))}).join(";"),Ht={sizingStyle:zn,paddingSize:gn,borderSize:oi,boxSizing:nt};return Pn&&Ot&&(ye[Ot]=Ht),Ht}function Ie($t){var Pn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ot=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,ct=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)),$t.getAttribute("wrap")?we.setAttribute("wrap",$t.getAttribute("wrap")):we.removeAttribute("wrap");var nt=be($t,Pn),gn=nt.paddingSize,oi=nt.borderSize,zn=nt.boxSizing,Ht=nt.sizingStyle;we.setAttribute("style","".concat(Ht,";").concat(se)),we.value=$t.value||$t.placeholder||"";var Fn=void 0,Cn=void 0,ii,Wt=we.scrollHeight;if(zn==="border-box"?Wt+=oi:zn==="content-box"&&(Wt-=gn),Ot!==null||ct!==null){we.value=" ";var Hn=we.scrollHeight-gn;Ot!==null&&(Fn=Hn*Ot,zn==="border-box"&&(Fn=Fn+gn+oi),Wt=Math.max(Fn,Wt)),ct!==null&&(Cn=Hn*ct,zn==="border-box"&&(Cn=Cn+gn+oi),ii=Wt>Cn?"":"hidden",Wt=Math.min(Cn,Wt))}var lt={height:Wt,overflowY:ii,resize:"none"};return Fn&&(lt.minHeight=Fn),Cn&&(lt.maxHeight=Cn),lt}var Re=["prefixCls","defaultValue","value","autoSize","onResize","className","style","disabled","onChange","onInternalAutoSize"],rt=0,et=1,Ye=2,ut=At.forwardRef(function($t,Pn){var Ot=$t,ct=Ot.prefixCls,nt=Ot.defaultValue,gn=Ot.value,oi=Ot.autoSize,zn=Ot.onResize,Ht=Ot.className,Fn=Ot.style,Cn=Ot.disabled,ii=Ot.onChange,Wt=Ot.onInternalAutoSize,Hn=(0,Oe.Z)(Ot,Re),lt=(0,ot.Z)(nt,{value:gn,postState:function(gi){return gi!=null?gi:""}}),An=(0,mt.Z)(lt,2),Ni=An[0],je=An[1],Me=function(gi){je(gi.target.value),ii==null||ii(gi)},Ee=At.useRef();At.useImperativeHandle(Pn,function(){return{textArea:Ee.current}});var De=At.useMemo(function(){return oi&&(0,Te.Z)(oi)==="object"?[oi.minRows,oi.maxRows]:[]},[oi]),We=(0,mt.Z)(De,2),Ae=We[0],Je=We[1],Nt=!!oi,fn=function(){try{if(document.activeElement===Ee.current){var gi=Ee.current,Vi=gi.selectionStart,Pi=gi.selectionEnd,Ii=gi.scrollTop;Ee.current.setSelectionRange(Vi,Pi),Ee.current.scrollTop=Ii}}catch(Fr){}},vn=At.useState(Ye),Ft=(0,mt.Z)(vn,2),Jt=Ft[0],jt=Ft[1],pn=At.useState(),jn=(0,mt.Z)(pn,2),Nn=jn[0],Mn=jn[1],fr=function(){jt(rt)};(0,te.Z)(function(){Nt&&fr()},[gn,Ae,Je,Nt]),(0,te.Z)(function(){if(Jt===rt)jt(et);else if(Jt===et){var Kt=Ie(Ee.current,!1,Ae,Je);jt(Ye),Mn(Kt)}else fn()},[Jt]);var nn=At.useRef(),tn=function(){de.Z.cancel(nn.current)},hn=function(gi){Jt===Ye&&(zn==null||zn(gi),oi&&(tn(),nn.current=(0,de.Z)(function(){fr()})))};At.useEffect(function(){return tn},[]);var di=Nt?Nn:null,Sn=(0,ft.Z)((0,ft.Z)({},Fn),di);return(Jt===rt||Jt===et)&&(Sn.overflowY="hidden",Sn.overflowX="hidden"),At.createElement(ne.Z,{onResize:hn,disabled:!(oi||zn)},At.createElement("textarea",(0,ue.Z)({},Hn,{ref:Ee,style:Sn,className:Ct()(ct,Ht,(0,Ke.Z)({},"".concat(ct,"-disabled"),Cn)),disabled:Cn,value:Ni,onChange:Me})))}),tt=ut,wt=["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"],St=At.forwardRef(function($t,Pn){var Ot,ct=$t.defaultValue,nt=$t.value,gn=$t.onFocus,oi=$t.onBlur,zn=$t.onChange,Ht=$t.allowClear,Fn=$t.maxLength,Cn=$t.onCompositionStart,ii=$t.onCompositionEnd,Wt=$t.suffix,Hn=$t.prefixCls,lt=Hn===void 0?"rc-textarea":Hn,An=$t.showCount,Ni=$t.count,je=$t.className,Me=$t.style,Ee=$t.disabled,De=$t.hidden,We=$t.classNames,Ae=$t.styles,Je=$t.onResize,Nt=$t.onClear,fn=$t.onPressEnter,vn=$t.readOnly,Ft=$t.autoSize,Jt=$t.onKeyDown,jt=(0,Oe.Z)($t,wt),pn=(0,ot.Z)(ct,{value:nt,defaultValue:ct}),jn=(0,mt.Z)(pn,2),Nn=jn[0],Mn=jn[1],fr=Nn==null?"":String(Nn),nn=At.useState(!1),tn=(0,mt.Z)(nn,2),hn=tn[0],di=tn[1],Sn=At.useRef(!1),Kt=At.useState(null),gi=(0,mt.Z)(Kt,2),Vi=gi[0],Pi=gi[1],Ii=(0,At.useRef)(null),Fr=(0,At.useRef)(null),$n=function(){var It;return(It=Fr.current)===null||It===void 0?void 0:It.textArea},In=function(){$n().focus()};(0,At.useImperativeHandle)(Pn,function(){var Kn;return{resizableTextArea:Fr.current,focus:In,blur:function(){$n().blur()},nativeElement:((Kn=Ii.current)===null||Kn===void 0?void 0:Kn.nativeElement)||$n()}}),(0,At.useEffect)(function(){di(function(Kn){return!Ee&&Kn})},[Ee]);var si=At.useState(null),Ti=(0,mt.Z)(si,2),Oi=Ti[0],zi=Ti[1];At.useEffect(function(){if(Oi){var Kn;(Kn=$n()).setSelectionRange.apply(Kn,(0,yt.Z)(Oi))}},[Oi]);var xr=(0,Ge.Z)(Ni,An),Ce=(Ot=xr.max)!==null&&Ot!==void 0?Ot:Fn,_n=Number(Ce)>0,ci=xr.strategy(fr),ar=!!Ce&&ci>Ce,_r=function(It,_t){var hi=_t;!Sn.current&&xr.exceedFormatter&&xr.max&&xr.strategy(_t)>xr.max&&(hi=xr.exceedFormatter(_t,{max:xr.max}),_t!==hi&&zi([$n().selectionStart||0,$n().selectionEnd||0])),Mn(hi),(0,Rt.rJ)(It.currentTarget,It,zn,hi)},$r=function(It){Sn.current=!0,Cn==null||Cn(It)},po=function(It){Sn.current=!1,_r(It,It.currentTarget.value),ii==null||ii(It)},fi=function(It){_r(It,It.target.value)},Qn=function(It){It.key==="Enter"&&fn&&fn(It),Jt==null||Jt(It)},Bt=function(It){di(!0),gn==null||gn(It)},Tt=function(It){di(!1),oi==null||oi(It)},kt=function(It){Mn(""),In(),(0,Rt.rJ)($n(),It,zn)},ui=Wt,Yn;xr.show&&(xr.showFormatter?Yn=xr.showFormatter({value:fr,count:ci,maxLength:Ce}):Yn="".concat(ci).concat(_n?" / ".concat(Ce):""),ui=At.createElement(At.Fragment,null,ui,At.createElement("span",{className:Ct()("".concat(lt,"-data-count"),We==null?void 0:We.count),style:Ae==null?void 0:Ae.count},Yn)));var vi=function(It){var _t;Je==null||Je(It),(_t=$n())!==null&&_t!==void 0&&_t.style.height&&Pi(!0)},yn=!Ft&&!An&&!Ht;return At.createElement(dt.BaseInput,{ref:Ii,value:fr,allowClear:Ht,handleReset:kt,suffix:ui,prefixCls:lt,classNames:(0,ft.Z)((0,ft.Z)({},We),{},{affixWrapper:Ct()(We==null?void 0:We.affixWrapper,(0,Ke.Z)((0,Ke.Z)({},"".concat(lt,"-show-count"),An),"".concat(lt,"-textarea-allow-clear"),Ht))}),disabled:Ee,focused:hn,className:Ct()(je,ar&&"".concat(lt,"-out-of-range")),style:(0,ft.Z)((0,ft.Z)({},Me),Vi&&!yn?{height:"auto"}:{}),dataAttrs:{affixWrapper:{"data-count":typeof Yn=="string"?Yn:void 0}},hidden:De,readOnly:vn,onClear:Nt},At.createElement(tt,(0,ue.Z)({},jt,{autoSize:Ft,maxLength:Fn,onKeyDown:Qn,onChange:fi,onFocus:Bt,onBlur:Tt,onCompositionStart:$r,onCompositionEnd:po,className:Ct()(We==null?void 0:We.textarea),style:(0,ft.Z)((0,ft.Z)({},Ae==null?void 0:Ae.textarea),{},{resize:Me==null?void 0:Me.resize}),disabled:Ee,prefixCls:lt,onResize:vi,ref:Fr,readOnly:vn})))}),Lt=St,mn=Lt},639:function(Un,ai,Le){"use strict";Le.d(ai,{Z:function(){return ye}});var ue=Le(72308),Ke=Le(49618),ft=Le(77321),yt=Le(52487),mt=Le(74416),Oe=Le(59301),at=Le(92310),Ct=Le.n(at),dt=Le(26112),Ge=Le(30699),Rt=function(be){for(var Ie=be.prefixCls,Re=be.level,rt=be.isStart,et=be.isEnd,Ye="".concat(Ie,"-indent-unit"),ut=[],tt=0;tt<Re;tt+=1)ut.push(Oe.createElement("span",{key:tt,className:Ct()(Ye,(0,Ke.Z)((0,Ke.Z)({},"".concat(Ye,"-start"),rt[tt]),"".concat(Ye,"-end"),et[tt]))}));return Oe.createElement("span",{"aria-hidden":"true",className:"".concat(Ie,"-indent")},ut)},ot=Oe.memo(Rt),At=Le(65065),Te=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(be){var Ie,Re,rt,et=be.eventKey,Ye=be.className,ut=be.style,tt=be.dragOver,wt=be.dragOverGapTop,St=be.dragOverGapBottom,Lt=be.isLeaf,mn=be.isStart,$t=be.isEnd,Pn=be.expanded,Ot=be.selected,ct=be.checked,nt=be.halfChecked,gn=be.loading,oi=be.domRef,zn=be.active,Ht=be.data,Fn=be.onMouseMove,Cn=be.selectable,ii=(0,mt.Z)(be,ne),Wt=Oe.useContext(Ge.k),Hn=Oe.useContext(Ge.y),lt=Oe.useRef(null),An=Oe.useState(!1),Ni=(0,yt.Z)(An,2),je=Ni[0],Me=Ni[1],Ee=!!(Wt.disabled||be.disabled||(Ie=Hn.nodeDisabled)!==null&&Ie!==void 0&&Ie.call(Hn,Ht)),De=Oe.useMemo(function(){return!Wt.checkable||be.checkable===!1?!1:Wt.checkable},[Wt.checkable,be.checkable]),We=function(ci){Ee||Wt.onNodeSelect(ci,(0,Te.F)(be))},Ae=function(ci){Ee||!De||be.disableCheckbox||Wt.onNodeCheck(ci,(0,Te.F)(be),!ct)},Je=Oe.useMemo(function(){return typeof Cn=="boolean"?Cn:Wt.selectable},[Cn,Wt.selectable]),Nt=function(ci){Wt.onNodeClick(ci,(0,Te.F)(be)),Je?We(ci):Ae(ci)},fn=function(ci){Wt.onNodeDoubleClick(ci,(0,Te.F)(be))},vn=function(ci){Wt.onNodeMouseEnter(ci,(0,Te.F)(be))},Ft=function(ci){Wt.onNodeMouseLeave(ci,(0,Te.F)(be))},Jt=function(ci){Wt.onNodeContextMenu(ci,(0,Te.F)(be))},jt=Oe.useMemo(function(){return!!(Wt.draggable&&(!Wt.draggable.nodeDraggable||Wt.draggable.nodeDraggable(Ht)))},[Wt.draggable,Ht]),pn=function(ci){ci.stopPropagation(),Me(!0),Wt.onNodeDragStart(ci,be);try{ci.dataTransfer.setData("text/plain","")}catch(ar){}},jn=function(ci){ci.preventDefault(),ci.stopPropagation(),Wt.onNodeDragEnter(ci,be)},Nn=function(ci){ci.preventDefault(),ci.stopPropagation(),Wt.onNodeDragOver(ci,be)},Mn=function(ci){ci.stopPropagation(),Wt.onNodeDragLeave(ci,be)},fr=function(ci){ci.stopPropagation(),Me(!1),Wt.onNodeDragEnd(ci,be)},nn=function(ci){ci.preventDefault(),ci.stopPropagation(),Me(!1),Wt.onNodeDrop(ci,be)},tn=function(ci){gn||Wt.onNodeExpand(ci,(0,Te.F)(be))},hn=Oe.useMemo(function(){var _n=(0,At.Z)(Wt.keyEntities,et)||{},ci=_n.children;return!!(ci||[]).length},[Wt.keyEntities,et]),di=Oe.useMemo(function(){return Lt===!1?!1:Lt||!Wt.loadData&&!hn||Wt.loadData&&be.loaded&&!hn},[Lt,Wt.loadData,hn,be.loaded]);Oe.useEffect(function(){gn||typeof Wt.loadData=="function"&&Pn&&!di&&!be.loaded&&Wt.onNodeLoad((0,Te.F)(be))},[gn,Wt.loadData,Wt.onNodeLoad,Pn,di,be]);var Sn=Oe.useMemo(function(){var _n;return(_n=Wt.draggable)!==null&&_n!==void 0&&_n.icon?Oe.createElement("span",{className:"".concat(Wt.prefixCls,"-draggable-icon")},Wt.draggable.icon):null},[Wt.draggable]),Kt=function(ci){var ar=be.switcherIcon||Wt.switcherIcon;return typeof ar=="function"?ar((0,ft.Z)((0,ft.Z)({},be),{},{isLeaf:ci})):ar},gi=function(){if(di){var ci=Kt(!0);return ci!==!1?Oe.createElement("span",{className:Ct()("".concat(Wt.prefixCls,"-switcher"),"".concat(Wt.prefixCls,"-switcher-noop"))},ci):null}var ar=Kt(!1);return ar!==!1?Oe.createElement("span",{onClick:tn,className:Ct()("".concat(Wt.prefixCls,"-switcher"),"".concat(Wt.prefixCls,"-switcher_").concat(Pn?te:de))},ar):null},Vi=Oe.useMemo(function(){if(!De)return null;var _n=typeof De!="boolean"?De:null;return Oe.createElement("span",{className:Ct()("".concat(Wt.prefixCls,"-checkbox"),(0,Ke.Z)((0,Ke.Z)((0,Ke.Z)({},"".concat(Wt.prefixCls,"-checkbox-checked"),ct),"".concat(Wt.prefixCls,"-checkbox-indeterminate"),!ct&&nt),"".concat(Wt.prefixCls,"-checkbox-disabled"),Ee||be.disableCheckbox)),onClick:Ae,role:"checkbox","aria-checked":nt?"mixed":ct,"aria-disabled":Ee||be.disableCheckbox,"aria-label":"Select ".concat(typeof be.title=="string"?be.title:"tree node")},_n)},[De,ct,nt,Ee,be.disableCheckbox,be.title]),Pi=Oe.useMemo(function(){return di?null:Pn?te:de},[di,Pn]),Ii=Oe.useMemo(function(){return Oe.createElement("span",{className:Ct()("".concat(Wt.prefixCls,"-iconEle"),"".concat(Wt.prefixCls,"-icon__").concat(Pi||"docu"),(0,Ke.Z)({},"".concat(Wt.prefixCls,"-icon_loading"),gn))})},[Wt.prefixCls,Pi,gn]),Fr=Oe.useMemo(function(){var _n=!!Wt.draggable,ci=!be.disabled&&_n&&Wt.dragOverNodeKey===et;return ci?Wt.dropIndicatorRender({dropPosition:Wt.dropPosition,dropLevelOffset:Wt.dropLevelOffset,indent:Wt.indent,prefixCls:Wt.prefixCls,direction:Wt.direction}):null},[Wt.dropPosition,Wt.dropLevelOffset,Wt.indent,Wt.prefixCls,Wt.direction,Wt.draggable,Wt.dragOverNodeKey,Wt.dropIndicatorRender]),$n=Oe.useMemo(function(){var _n=be.title,ci=_n===void 0?se:_n,ar="".concat(Wt.prefixCls,"-node-content-wrapper"),_r;if(Wt.showIcon){var $r=be.icon||Wt.icon;_r=$r?Oe.createElement("span",{className:Ct()("".concat(Wt.prefixCls,"-iconEle"),"".concat(Wt.prefixCls,"-icon__customize"))},typeof $r=="function"?$r(be):$r):Ii}else Wt.loadData&&gn&&(_r=Ii);var po;return typeof ci=="function"?po=ci(Ht):Wt.titleRender?po=Wt.titleRender(Ht):po=ci,Oe.createElement("span",{ref:lt,title:typeof ci=="string"?ci:"",className:Ct()(ar,"".concat(ar,"-").concat(Pi||"normal"),(0,Ke.Z)({},"".concat(Wt.prefixCls,"-node-selected"),!Ee&&(Ot||je))),onMouseEnter:vn,onMouseLeave:Ft,onContextMenu:Jt,onClick:Nt,onDoubleClick:fn},_r,Oe.createElement("span",{className:"".concat(Wt.prefixCls,"-title")},po),Fr)},[Wt.prefixCls,Wt.showIcon,be,Wt.icon,Ii,Wt.titleRender,Ht,Pi,vn,Ft,Jt,Nt,fn]),In=(0,dt.Z)(ii,{aria:!0,data:!0}),si=(0,At.Z)(Wt.keyEntities,et)||{},Ti=si.level,Oi=$t[$t.length-1],zi=!Ee&&jt,xr=Wt.draggingNodeKey===et,Ce=Cn!==void 0?{"aria-selected":!!Cn}:void 0;return Oe.createElement("div",(0,ue.Z)({ref:oi,role:"treeitem","aria-expanded":Lt?void 0:Pn,className:Ct()(Ye,"".concat(Wt.prefixCls,"-treenode"),(rt={},(0,Ke.Z)((0,Ke.Z)((0,Ke.Z)((0,Ke.Z)((0,Ke.Z)((0,Ke.Z)((0,Ke.Z)((0,Ke.Z)((0,Ke.Z)((0,Ke.Z)(rt,"".concat(Wt.prefixCls,"-treenode-disabled"),Ee),"".concat(Wt.prefixCls,"-treenode-switcher-").concat(Pn?"open":"close"),!Lt),"".concat(Wt.prefixCls,"-treenode-checkbox-checked"),ct),"".concat(Wt.prefixCls,"-treenode-checkbox-indeterminate"),nt),"".concat(Wt.prefixCls,"-treenode-selected"),Ot),"".concat(Wt.prefixCls,"-treenode-loading"),gn),"".concat(Wt.prefixCls,"-treenode-active"),zn),"".concat(Wt.prefixCls,"-treenode-leaf-last"),Oi),"".concat(Wt.prefixCls,"-treenode-draggable"),jt),"dragging",xr),(0,Ke.Z)((0,Ke.Z)((0,Ke.Z)((0,Ke.Z)((0,Ke.Z)((0,Ke.Z)((0,Ke.Z)(rt,"drop-target",Wt.dropTargetKey===et),"drop-container",Wt.dropContainerKey===et),"drag-over",!Ee&&tt),"drag-over-gap-top",!Ee&&wt),"drag-over-gap-bottom",!Ee&&St),"filter-node",(Re=Wt.filterTreeNode)===null||Re===void 0?void 0:Re.call(Wt,(0,Te.F)(be))),"".concat(Wt.prefixCls,"-treenode-leaf"),di))),style:ut,draggable:zi,onDragStart:zi?pn:void 0,onDragEnter:jt?jn:void 0,onDragOver:jt?Nn:void 0,onDragLeave:jt?Mn:void 0,onDrop:jt?nn:void 0,onDragEnd:jt?fr:void 0,onMouseMove:Fn},Ce,In),Oe.createElement(ot,{prefixCls:Wt.prefixCls,level:Ti,isStart:mn,isEnd:$t}),Sn,gi(),Vi,$n)};pe.isTreeNode=1;var ye=pe},30699:function(Un,ai,Le){"use strict";Le.d(ai,{k:function(){return Ke},y:function(){return ft}});var ue=Le(59301),Ke=ue.createContext(null),ft=ue.createContext({})},15018:function(Un,ai,Le){"use strict";Le.d(ai,{OF:function(){return et.Z},y6:function(){return de.y},ZP:function(){return Ee}});var ue=Le(72308),Ke=Le(62853),ft=Le(77321),yt=Le(80702),mt=Le(96949),Oe=Le(55090),at=Le(80237),Ct=Le(77205),dt=Le(38793),Ge=Le(49618),Rt=Le(92310),ot=Le.n(Rt),At=Le(10228),Te=Le(26112),ne=Le(48736),te=Le(59301),de=Le(30699),se=function(We){var Ae=We.dropPosition,Je=We.dropLevelOffset,Nt=We.indent,fn={pointerEvents:"none",position:"absolute",right:0,backgroundColor:"red",height:2};switch(Ae){case-1:fn.top=0,fn.left=-Je*Nt;break;case 1:fn.bottom=0,fn.left=-Je*Nt;break;case 0:fn.bottom=0,fn.left=Nt;break}return te.createElement("div",{style:fn})},pe=se;function ye(De){if(De==null)throw new TypeError("Cannot destructure "+De)}var we=Le(52487),be=Le(74416),Ie=Le(34280),Re=Le(45680),rt=Le(77900),et=Le(639);function Ye(De,We){var Ae=te.useState(!1),Je=(0,we.Z)(Ae,2),Nt=Je[0],fn=Je[1];(0,Ie.Z)(function(){if(Nt)return De(),function(){We()}},[Nt]),(0,Ie.Z)(function(){return fn(!0),function(){fn(!1)}},[])}var ut=Ye,tt=Le(34061),wt=["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"],St=te.forwardRef(function(De,We){var Ae=De.className,Je=De.style,Nt=De.motion,fn=De.motionNodes,vn=De.motionType,Ft=De.onMotionStart,Jt=De.onMotionEnd,jt=De.active,pn=De.treeNodeRequiredProps,jn=(0,be.Z)(De,wt),Nn=te.useState(!0),Mn=(0,we.Z)(Nn,2),fr=Mn[0],nn=Mn[1],tn=te.useContext(de.k),hn=tn.prefixCls,di=fn&&vn!=="hide";(0,Ie.Z)(function(){fn&&di!==fr&&nn(di)},[fn]);var Sn=function(){fn&&Ft()},Kt=te.useRef(!1),gi=function(){fn&&!Kt.current&&(Kt.current=!0,Jt())};ut(Sn,gi);var Vi=function(Ii){di===Ii&&gi()};return fn?te.createElement(rt.default,(0,ue.Z)({ref:We,visible:fr},Nt,{motionAppear:vn==="show",onVisibleChanged:Vi}),function(Pi,Ii){var Fr=Pi.className,$n=Pi.style;return te.createElement("div",{ref:Ii,className:ot()("".concat(hn,"-treenode-motion"),Fr),style:$n},fn.map(function(In){var si=Object.assign({},(ye(In.data),In.data)),Ti=In.title,Oi=In.key,zi=In.isStart,xr=In.isEnd;delete si.children;var Ce=(0,tt.H8)(Oi,pn);return te.createElement(et.Z,(0,ue.Z)({},si,Ce,{title:Ti,active:jt,data:In.data,key:Oi,isStart:zi,isEnd:xr}))}))}):te.createElement(et.Z,(0,ue.Z)({domRef:We,className:Ae,style:Je},jn,{active:jt}))}),Lt=St;function mn(){var De=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],We=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Ae=De.length,Je=We.length;if(Math.abs(Ae-Je)!==1)return{add:!1,key:null};function Nt(fn,vn){var Ft=new Map;fn.forEach(function(jt){Ft.set(jt,!0)});var Jt=vn.filter(function(jt){return!Ft.has(jt)});return Jt.length===1?Jt[0]:null}return Ae<Je?{add:!0,key:Nt(De,We)}:{add:!1,key:Nt(We,De)}}function $t(De,We,Ae){var Je=De.findIndex(function(Ft){return Ft.key===Ae}),Nt=De[Je+1],fn=We.findIndex(function(Ft){return Ft.key===Ae});if(Nt){var vn=We.findIndex(function(Ft){return Ft.key===Nt.key});return We.slice(fn+1,vn)}return We.slice(fn+1)}var Pn=["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"],Ot={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},ct=function(){},nt="RC_TREE_MOTION_".concat(Math.random()),gn={key:nt},oi={key:nt,level:0,index:0,pos:"0",node:gn,nodes:[gn]},zn={parent:null,children:[],pos:oi.pos,data:gn,title:null,key:nt,isStart:[],isEnd:[]};function Ht(De,We,Ae,Je){return We===!1||!Ae?De:De.slice(0,Math.ceil(Ae/Je)+1)}function Fn(De){var We=De.key,Ae=De.pos;return(0,tt.km)(We,Ae)}function Cn(De){for(var We=String(De.data.key),Ae=De;Ae.parent;)Ae=Ae.parent,We="".concat(Ae.data.key," > ").concat(We);return We}var ii=te.forwardRef(function(De,We){var Ae=De.prefixCls,Je=De.data,Nt=De.selectable,fn=De.checkable,vn=De.expandedKeys,Ft=De.selectedKeys,Jt=De.checkedKeys,jt=De.loadedKeys,pn=De.loadingKeys,jn=De.halfCheckedKeys,Nn=De.keyEntities,Mn=De.disabled,fr=De.dragging,nn=De.dragOverNodeKey,tn=De.dropPosition,hn=De.motion,di=De.height,Sn=De.itemHeight,Kt=De.virtual,gi=De.scrollWidth,Vi=De.focusable,Pi=De.activeItem,Ii=De.focused,Fr=De.tabIndex,$n=De.onKeyDown,In=De.onFocus,si=De.onBlur,Ti=De.onActiveChange,Oi=De.onListChangeStart,zi=De.onListChangeEnd,xr=(0,be.Z)(De,Pn),Ce=te.useRef(null),_n=te.useRef(null);te.useImperativeHandle(We,function(){return{scrollTo:function(Gi){Ce.current.scrollTo(Gi)},getIndentWidth:function(){return _n.current.offsetWidth}}});var ci=te.useState(vn),ar=(0,we.Z)(ci,2),_r=ar[0],$r=ar[1],po=te.useState(Je),fi=(0,we.Z)(po,2),Qn=fi[0],Bt=fi[1],Tt=te.useState(Je),kt=(0,we.Z)(Tt,2),ui=kt[0],Yn=kt[1],vi=te.useState([]),yn=(0,we.Z)(vi,2),Kn=yn[0],It=yn[1],_t=te.useState(null),hi=(0,we.Z)(_t,2),it=hi[0],sn=hi[1],Dn=te.useRef(Je);Dn.current=Je;function Di(){var an=Dn.current;Bt(an),Yn(an),It([]),sn(null),zi()}(0,Ie.Z)(function(){$r(vn);var an=mn(_r,vn);if(an.key!==null)if(an.add){var Gi=Qn.findIndex(function(Er){var Ar=Er.key;return Ar===an.key}),ur=Ht($t(Qn,Je,an.key),Kt,di,Sn),Hi=Qn.slice();Hi.splice(Gi+1,0,zn),Yn(Hi),It(ur),sn("show")}else{var Mi=Je.findIndex(function(Er){var Ar=Er.key;return Ar===an.key}),Ri=Ht($t(Je,Qn,an.key),Kt,di,Sn),dr=Je.slice();dr.splice(Mi+1,0,zn),Yn(dr),It(Ri),sn("hide")}else Qn!==Je&&(Bt(Je),Yn(Je))},[vn,Je]),te.useEffect(function(){fr||Di()},[fr]);var cn=hn?ui:Je,qt={expandedKeys:vn,selectedKeys:Ft,loadedKeys:jt,loadingKeys:pn,checkedKeys:Jt,halfCheckedKeys:jn,dragOverNodeKey:nn,dropPosition:tn,keyEntities:Nn};return te.createElement(te.Fragment,null,Ii&&Pi&&te.createElement("span",{style:Ot,"aria-live":"assertive"},Cn(Pi)),te.createElement("div",null,te.createElement("input",{style:Ot,disabled:Vi===!1||Mn,tabIndex:Vi!==!1?Fr:null,onKeyDown:$n,onFocus:In,onBlur:si,value:"",onChange:ct,"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:_n,className:"".concat(Ae,"-indent-unit")}))),te.createElement(Re.Z,(0,ue.Z)({},xr,{data:cn,itemKey:Fn,height:di,fullHeight:!1,virtual:Kt,itemHeight:Sn,scrollWidth:gi,prefixCls:"".concat(Ae,"-list"),ref:Ce,role:"tree",onVisibleChange:function(Gi){Gi.every(function(ur){return Fn(ur)!==nt})&&Di()}}),function(an){var Gi=an.pos,ur=Object.assign({},(ye(an.data),an.data)),Hi=an.title,Mi=an.key,Ri=an.isStart,dr=an.isEnd,Er=(0,tt.km)(Mi,Gi);delete ur.key,delete ur.children;var Ar=(0,tt.H8)(Er,qt);return te.createElement(Lt,(0,ue.Z)({},ur,Ar,{title:Hi,active:!!Pi&&Mi===Pi.key,pos:Gi,data:an.data,isStart:Ri,isEnd:dr,motion:hn,motionNodes:Mi===nt?Kn:null,motionType:it,onMotionStart:Oi,onMotionEnd:Di,treeNodeRequiredProps:qt,onMouseMove:function(){Ti(null)}}))}))}),Wt=ii,Hn=Le(82661),lt=Le(34643),An=Le(65065),Ni=10,je=function(De){(0,Ct.Z)(Ae,De);var We=(0,dt.Z)(Ae);function Ae(){var Je;(0,mt.Z)(this,Ae);for(var Nt=arguments.length,fn=new Array(Nt),vn=0;vn<Nt;vn++)fn[vn]=arguments[vn];return Je=We.call.apply(We,[this].concat(fn)),(0,Ge.Z)((0,at.Z)(Je),"destroyed",!1),(0,Ge.Z)((0,at.Z)(Je),"delayedDragEnterLogic",void 0),(0,Ge.Z)((0,at.Z)(Je),"loadingRetryTimes",{}),(0,Ge.Z)((0,at.Z)(Je),"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,tt.w$)()}),(0,Ge.Z)((0,at.Z)(Je),"dragStartMousePosition",null),(0,Ge.Z)((0,at.Z)(Je),"dragNodeProps",null),(0,Ge.Z)((0,at.Z)(Je),"currentMouseOverDroppableNodeKey",null),(0,Ge.Z)((0,at.Z)(Je),"listRef",te.createRef()),(0,Ge.Z)((0,at.Z)(Je),"onNodeDragStart",function(Ft,Jt){var jt=Je.state,pn=jt.expandedKeys,jn=jt.keyEntities,Nn=Je.props.onDragStart,Mn=Jt.eventKey;Je.dragNodeProps=Jt,Je.dragStartMousePosition={x:Ft.clientX,y:Ft.clientY};var fr=(0,Hn._5)(pn,Mn);Je.setState({draggingNodeKey:Mn,dragChildrenKeys:(0,Hn.wA)(Mn,jn),indent:Je.listRef.current.getIndentWidth()}),Je.setExpandedKeys(fr),window.addEventListener("dragend",Je.onWindowDragEnd),Nn==null||Nn({event:Ft,node:(0,tt.F)(Jt)})}),(0,Ge.Z)((0,at.Z)(Je),"onNodeDragEnter",function(Ft,Jt){var jt=Je.state,pn=jt.expandedKeys,jn=jt.keyEntities,Nn=jt.dragChildrenKeys,Mn=jt.flattenNodes,fr=jt.indent,nn=Je.props,tn=nn.onDragEnter,hn=nn.onExpand,di=nn.allowDrop,Sn=nn.direction,Kt=Jt.pos,gi=Jt.eventKey;if(Je.currentMouseOverDroppableNodeKey!==gi&&(Je.currentMouseOverDroppableNodeKey=gi),!Je.dragNodeProps){Je.resetDragState();return}var Vi=(0,Hn.OM)(Ft,Je.dragNodeProps,Jt,fr,Je.dragStartMousePosition,di,Mn,jn,pn,Sn),Pi=Vi.dropPosition,Ii=Vi.dropLevelOffset,Fr=Vi.dropTargetKey,$n=Vi.dropContainerKey,In=Vi.dropTargetPos,si=Vi.dropAllowed,Ti=Vi.dragOverNodeKey;if(Nn.includes(Fr)||!si){Je.resetDragState();return}if(Je.delayedDragEnterLogic||(Je.delayedDragEnterLogic={}),Object.keys(Je.delayedDragEnterLogic).forEach(function(Oi){clearTimeout(Je.delayedDragEnterLogic[Oi])}),Je.dragNodeProps.eventKey!==Jt.eventKey&&(Ft.persist(),Je.delayedDragEnterLogic[Kt]=window.setTimeout(function(){if(Je.state.draggingNodeKey!==null){var Oi=(0,yt.Z)(pn),zi=(0,An.Z)(jn,Jt.eventKey);zi&&(zi.children||[]).length&&(Oi=(0,Hn.L0)(pn,Jt.eventKey)),Je.props.hasOwnProperty("expandedKeys")||Je.setExpandedKeys(Oi),hn==null||hn(Oi,{node:(0,tt.F)(Jt),expanded:!0,nativeEvent:Ft.nativeEvent})}},800)),Je.dragNodeProps.eventKey===Fr&&Ii===0){Je.resetDragState();return}Je.setState({dragOverNodeKey:Ti,dropPosition:Pi,dropLevelOffset:Ii,dropTargetKey:Fr,dropContainerKey:$n,dropTargetPos:In,dropAllowed:si}),tn==null||tn({event:Ft,node:(0,tt.F)(Jt),expandedKeys:pn})}),(0,Ge.Z)((0,at.Z)(Je),"onNodeDragOver",function(Ft,Jt){var jt=Je.state,pn=jt.dragChildrenKeys,jn=jt.flattenNodes,Nn=jt.keyEntities,Mn=jt.expandedKeys,fr=jt.indent,nn=Je.props,tn=nn.onDragOver,hn=nn.allowDrop,di=nn.direction;if(Je.dragNodeProps){var Sn=(0,Hn.OM)(Ft,Je.dragNodeProps,Jt,fr,Je.dragStartMousePosition,hn,jn,Nn,Mn,di),Kt=Sn.dropPosition,gi=Sn.dropLevelOffset,Vi=Sn.dropTargetKey,Pi=Sn.dropContainerKey,Ii=Sn.dropTargetPos,Fr=Sn.dropAllowed,$n=Sn.dragOverNodeKey;pn.includes(Vi)||!Fr||(Je.dragNodeProps.eventKey===Vi&&gi===0?Je.state.dropPosition===null&&Je.state.dropLevelOffset===null&&Je.state.dropTargetKey===null&&Je.state.dropContainerKey===null&&Je.state.dropTargetPos===null&&Je.state.dropAllowed===!1&&Je.state.dragOverNodeKey===null||Je.resetDragState():Kt===Je.state.dropPosition&&gi===Je.state.dropLevelOffset&&Vi===Je.state.dropTargetKey&&Pi===Je.state.dropContainerKey&&Ii===Je.state.dropTargetPos&&Fr===Je.state.dropAllowed&&$n===Je.state.dragOverNodeKey||Je.setState({dropPosition:Kt,dropLevelOffset:gi,dropTargetKey:Vi,dropContainerKey:Pi,dropTargetPos:Ii,dropAllowed:Fr,dragOverNodeKey:$n}),tn==null||tn({event:Ft,node:(0,tt.F)(Jt)}))}}),(0,Ge.Z)((0,at.Z)(Je),"onNodeDragLeave",function(Ft,Jt){Je.currentMouseOverDroppableNodeKey===Jt.eventKey&&!Ft.currentTarget.contains(Ft.relatedTarget)&&(Je.resetDragState(),Je.currentMouseOverDroppableNodeKey=null);var jt=Je.props.onDragLeave;jt==null||jt({event:Ft,node:(0,tt.F)(Jt)})}),(0,Ge.Z)((0,at.Z)(Je),"onWindowDragEnd",function(Ft){Je.onNodeDragEnd(Ft,null,!0),window.removeEventListener("dragend",Je.onWindowDragEnd)}),(0,Ge.Z)((0,at.Z)(Je),"onNodeDragEnd",function(Ft,Jt){var jt=Je.props.onDragEnd;Je.setState({dragOverNodeKey:null}),Je.cleanDragState(),jt==null||jt({event:Ft,node:(0,tt.F)(Jt)}),Je.dragNodeProps=null,window.removeEventListener("dragend",Je.onWindowDragEnd)}),(0,Ge.Z)((0,at.Z)(Je),"onNodeDrop",function(Ft,Jt){var jt,pn=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,jn=Je.state,Nn=jn.dragChildrenKeys,Mn=jn.dropPosition,fr=jn.dropTargetKey,nn=jn.dropTargetPos,tn=jn.dropAllowed;if(tn){var hn=Je.props.onDrop;if(Je.setState({dragOverNodeKey:null}),Je.cleanDragState(),fr!==null){var di=(0,ft.Z)((0,ft.Z)({},(0,tt.H8)(fr,Je.getTreeNodeRequiredProps())),{},{active:((jt=Je.getActiveItem())===null||jt===void 0?void 0:jt.key)===fr,data:(0,An.Z)(Je.state.keyEntities,fr).node}),Sn=Nn.includes(fr);(0,ne.ZP)(!Sn,"Can not drop to dragNode's children node. This is a bug of rc-tree. Please report an issue.");var Kt=(0,Hn.yx)(nn),gi={event:Ft,node:(0,tt.F)(di),dragNode:Je.dragNodeProps?(0,tt.F)(Je.dragNodeProps):null,dragNodesKeys:[Je.dragNodeProps.eventKey].concat(Nn),dropToGap:Mn!==0,dropPosition:Mn+Number(Kt[Kt.length-1])};pn||hn==null||hn(gi),Je.dragNodeProps=null}}}),(0,Ge.Z)((0,at.Z)(Je),"cleanDragState",function(){var Ft=Je.state.draggingNodeKey;Ft!==null&&Je.setState({draggingNodeKey:null,dropPosition:null,dropContainerKey:null,dropTargetKey:null,dropLevelOffset:null,dropAllowed:!0,dragOverNodeKey:null}),Je.dragStartMousePosition=null,Je.currentMouseOverDroppableNodeKey=null}),(0,Ge.Z)((0,at.Z)(Je),"triggerExpandActionExpand",function(Ft,Jt){var jt=Je.state,pn=jt.expandedKeys,jn=jt.flattenNodes,Nn=Jt.expanded,Mn=Jt.key,fr=Jt.isLeaf;if(!(fr||Ft.shiftKey||Ft.metaKey||Ft.ctrlKey)){var nn=jn.filter(function(hn){return hn.key===Mn})[0],tn=(0,tt.F)((0,ft.Z)((0,ft.Z)({},(0,tt.H8)(Mn,Je.getTreeNodeRequiredProps())),{},{data:nn.data}));Je.setExpandedKeys(Nn?(0,Hn._5)(pn,Mn):(0,Hn.L0)(pn,Mn)),Je.onNodeExpand(Ft,tn)}}),(0,Ge.Z)((0,at.Z)(Je),"onNodeClick",function(Ft,Jt){var jt=Je.props,pn=jt.onClick,jn=jt.expandAction;jn==="click"&&Je.triggerExpandActionExpand(Ft,Jt),pn==null||pn(Ft,Jt)}),(0,Ge.Z)((0,at.Z)(Je),"onNodeDoubleClick",function(Ft,Jt){var jt=Je.props,pn=jt.onDoubleClick,jn=jt.expandAction;jn==="doubleClick"&&Je.triggerExpandActionExpand(Ft,Jt),pn==null||pn(Ft,Jt)}),(0,Ge.Z)((0,at.Z)(Je),"onNodeSelect",function(Ft,Jt){var jt=Je.state.selectedKeys,pn=Je.state,jn=pn.keyEntities,Nn=pn.fieldNames,Mn=Je.props,fr=Mn.onSelect,nn=Mn.multiple,tn=Jt.selected,hn=Jt[Nn.key],di=!tn;di?nn?jt=(0,Hn.L0)(jt,hn):jt=[hn]:jt=(0,Hn._5)(jt,hn);var Sn=jt.map(function(Kt){var gi=(0,An.Z)(jn,Kt);return gi?gi.node:null}).filter(Boolean);Je.setUncontrolledState({selectedKeys:jt}),fr==null||fr(jt,{event:"select",selected:di,node:Jt,selectedNodes:Sn,nativeEvent:Ft.nativeEvent})}),(0,Ge.Z)((0,at.Z)(Je),"onNodeCheck",function(Ft,Jt,jt){var pn=Je.state,jn=pn.keyEntities,Nn=pn.checkedKeys,Mn=pn.halfCheckedKeys,fr=Je.props,nn=fr.checkStrictly,tn=fr.onCheck,hn=Jt.key,di,Sn={event:"check",node:Jt,checked:jt,nativeEvent:Ft.nativeEvent};if(nn){var Kt=jt?(0,Hn.L0)(Nn,hn):(0,Hn._5)(Nn,hn),gi=(0,Hn._5)(Mn,hn);di={checked:Kt,halfChecked:gi},Sn.checkedNodes=Kt.map(function(In){return(0,An.Z)(jn,In)}).filter(Boolean).map(function(In){return In.node}),Je.setUncontrolledState({checkedKeys:Kt})}else{var Vi=(0,lt.S)([].concat((0,yt.Z)(Nn),[hn]),!0,jn),Pi=Vi.checkedKeys,Ii=Vi.halfCheckedKeys;if(!jt){var Fr=new Set(Pi);Fr.delete(hn);var $n=(0,lt.S)(Array.from(Fr),{checked:!1,halfCheckedKeys:Ii},jn);Pi=$n.checkedKeys,Ii=$n.halfCheckedKeys}di=Pi,Sn.checkedNodes=[],Sn.checkedNodesPositions=[],Sn.halfCheckedKeys=Ii,Pi.forEach(function(In){var si=(0,An.Z)(jn,In);if(si){var Ti=si.node,Oi=si.pos;Sn.checkedNodes.push(Ti),Sn.checkedNodesPositions.push({node:Ti,pos:Oi})}}),Je.setUncontrolledState({checkedKeys:Pi},!1,{halfCheckedKeys:Ii})}tn==null||tn(di,Sn)}),(0,Ge.Z)((0,at.Z)(Je),"onNodeLoad",function(Ft){var Jt,jt=Ft.key,pn=Je.state.keyEntities,jn=(0,An.Z)(pn,jt);if(!(jn!=null&&(Jt=jn.children)!==null&&Jt!==void 0&&Jt.length)){var Nn=new Promise(function(Mn,fr){Je.setState(function(nn){var tn=nn.loadedKeys,hn=tn===void 0?[]:tn,di=nn.loadingKeys,Sn=di===void 0?[]:di,Kt=Je.props,gi=Kt.loadData,Vi=Kt.onLoad;if(!gi||hn.includes(jt)||Sn.includes(jt))return null;var Pi=gi(Ft);return Pi.then(function(){var Ii=Je.state.loadedKeys,Fr=(0,Hn.L0)(Ii,jt);Vi==null||Vi(Fr,{event:"load",node:Ft}),Je.setUncontrolledState({loadedKeys:Fr}),Je.setState(function($n){return{loadingKeys:(0,Hn._5)($n.loadingKeys,jt)}}),Mn()}).catch(function(Ii){if(Je.setState(function($n){return{loadingKeys:(0,Hn._5)($n.loadingKeys,jt)}}),Je.loadingRetryTimes[jt]=(Je.loadingRetryTimes[jt]||0)+1,Je.loadingRetryTimes[jt]>=Ni){var Fr=Je.state.loadedKeys;(0,ne.ZP)(!1,"Retry for `loadData` many times but still failed. No more retry."),Je.setUncontrolledState({loadedKeys:(0,Hn.L0)(Fr,jt)}),Mn()}fr(Ii)}),{loadingKeys:(0,Hn.L0)(Sn,jt)}})});return Nn.catch(function(){}),Nn}}),(0,Ge.Z)((0,at.Z)(Je),"onNodeMouseEnter",function(Ft,Jt){var jt=Je.props.onMouseEnter;jt==null||jt({event:Ft,node:Jt})}),(0,Ge.Z)((0,at.Z)(Je),"onNodeMouseLeave",function(Ft,Jt){var jt=Je.props.onMouseLeave;jt==null||jt({event:Ft,node:Jt})}),(0,Ge.Z)((0,at.Z)(Je),"onNodeContextMenu",function(Ft,Jt){var jt=Je.props.onRightClick;jt&&(Ft.preventDefault(),jt({event:Ft,node:Jt}))}),(0,Ge.Z)((0,at.Z)(Je),"onFocus",function(){var Ft=Je.props.onFocus;Je.setState({focused:!0});for(var Jt=arguments.length,jt=new Array(Jt),pn=0;pn<Jt;pn++)jt[pn]=arguments[pn];Ft==null||Ft.apply(void 0,jt)}),(0,Ge.Z)((0,at.Z)(Je),"onBlur",function(){var Ft=Je.props.onBlur;Je.setState({focused:!1}),Je.onActiveChange(null);for(var Jt=arguments.length,jt=new Array(Jt),pn=0;pn<Jt;pn++)jt[pn]=arguments[pn];Ft==null||Ft.apply(void 0,jt)}),(0,Ge.Z)((0,at.Z)(Je),"getTreeNodeRequiredProps",function(){var Ft=Je.state,Jt=Ft.expandedKeys,jt=Ft.selectedKeys,pn=Ft.loadedKeys,jn=Ft.loadingKeys,Nn=Ft.checkedKeys,Mn=Ft.halfCheckedKeys,fr=Ft.dragOverNodeKey,nn=Ft.dropPosition,tn=Ft.keyEntities;return{expandedKeys:Jt||[],selectedKeys:jt||[],loadedKeys:pn||[],loadingKeys:jn||[],checkedKeys:Nn||[],halfCheckedKeys:Mn||[],dragOverNodeKey:fr,dropPosition:nn,keyEntities:tn}}),(0,Ge.Z)((0,at.Z)(Je),"setExpandedKeys",function(Ft){var Jt=Je.state,jt=Jt.treeData,pn=Jt.fieldNames,jn=(0,tt.oH)(jt,Ft,pn);Je.setUncontrolledState({expandedKeys:Ft,flattenNodes:jn},!0)}),(0,Ge.Z)((0,at.Z)(Je),"onNodeExpand",function(Ft,Jt){var jt=Je.state.expandedKeys,pn=Je.state,jn=pn.listChanging,Nn=pn.fieldNames,Mn=Je.props,fr=Mn.onExpand,nn=Mn.loadData,tn=Jt.expanded,hn=Jt[Nn.key];if(!jn){var di=jt.includes(hn),Sn=!tn;if((0,ne.ZP)(tn&&di||!tn&&!di,"Expand state not sync with index check"),jt=Sn?(0,Hn.L0)(jt,hn):(0,Hn._5)(jt,hn),Je.setExpandedKeys(jt),fr==null||fr(jt,{node:Jt,expanded:Sn,nativeEvent:Ft.nativeEvent}),Sn&&nn){var Kt=Je.onNodeLoad(Jt);Kt&&Kt.then(function(){var gi=(0,tt.oH)(Je.state.treeData,jt,Nn);Je.setUncontrolledState({flattenNodes:gi})}).catch(function(){var gi=Je.state.expandedKeys,Vi=(0,Hn._5)(gi,hn);Je.setExpandedKeys(Vi)})}}}),(0,Ge.Z)((0,at.Z)(Je),"onListChangeStart",function(){Je.setUncontrolledState({listChanging:!0})}),(0,Ge.Z)((0,at.Z)(Je),"onListChangeEnd",function(){setTimeout(function(){Je.setUncontrolledState({listChanging:!1})})}),(0,Ge.Z)((0,at.Z)(Je),"onActiveChange",function(Ft){var Jt=Je.state.activeKey,jt=Je.props,pn=jt.onActiveChange,jn=jt.itemScrollOffset,Nn=jn===void 0?0:jn;Jt!==Ft&&(Je.setState({activeKey:Ft}),Ft!==null&&Je.scrollTo({key:Ft,offset:Nn}),pn==null||pn(Ft))}),(0,Ge.Z)((0,at.Z)(Je),"getActiveItem",function(){var Ft=Je.state,Jt=Ft.activeKey,jt=Ft.flattenNodes;return Jt===null?null:jt.find(function(pn){var jn=pn.key;return jn===Jt})||null}),(0,Ge.Z)((0,at.Z)(Je),"offsetActiveKey",function(Ft){var Jt=Je.state,jt=Jt.flattenNodes,pn=Jt.activeKey,jn=jt.findIndex(function(fr){var nn=fr.key;return nn===pn});jn===-1&&Ft<0&&(jn=jt.length),jn=(jn+Ft+jt.length)%jt.length;var Nn=jt[jn];if(Nn){var Mn=Nn.key;Je.onActiveChange(Mn)}else Je.onActiveChange(null)}),(0,Ge.Z)((0,at.Z)(Je),"onKeyDown",function(Ft){var Jt=Je.state,jt=Jt.activeKey,pn=Jt.expandedKeys,jn=Jt.checkedKeys,Nn=Jt.fieldNames,Mn=Je.props,fr=Mn.onKeyDown,nn=Mn.checkable,tn=Mn.selectable;switch(Ft.which){case At.Z.UP:{Je.offsetActiveKey(-1),Ft.preventDefault();break}case At.Z.DOWN:{Je.offsetActiveKey(1),Ft.preventDefault();break}}var hn=Je.getActiveItem();if(hn&&hn.data){var di=Je.getTreeNodeRequiredProps(),Sn=hn.data.isLeaf===!1||!!(hn.data[Nn.children]||[]).length,Kt=(0,tt.F)((0,ft.Z)((0,ft.Z)({},(0,tt.H8)(jt,di)),{},{data:hn.data,active:!0}));switch(Ft.which){case At.Z.LEFT:{Sn&&pn.includes(jt)?Je.onNodeExpand({},Kt):hn.parent&&Je.onActiveChange(hn.parent.key),Ft.preventDefault();break}case At.Z.RIGHT:{Sn&&!pn.includes(jt)?Je.onNodeExpand({},Kt):hn.children&&hn.children.length&&Je.onActiveChange(hn.children[0].key),Ft.preventDefault();break}case At.Z.ENTER:case At.Z.SPACE:{nn&&!Kt.disabled&&Kt.checkable!==!1&&!Kt.disableCheckbox?Je.onNodeCheck({},Kt,!jn.includes(jt)):!nn&&tn&&!Kt.disabled&&Kt.selectable!==!1&&Je.onNodeSelect({},Kt);break}}}fr==null||fr(Ft)}),(0,Ge.Z)((0,at.Z)(Je),"setUncontrolledState",function(Ft){var Jt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,jt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(!Je.destroyed){var pn=!1,jn=!0,Nn={};Object.keys(Ft).forEach(function(Mn){if(Je.props.hasOwnProperty(Mn)){jn=!1;return}pn=!0,Nn[Mn]=Ft[Mn]}),pn&&(!Jt||jn)&&Je.setState((0,ft.Z)((0,ft.Z)({},Nn),jt))}}),(0,Ge.Z)((0,at.Z)(Je),"scrollTo",function(Ft){Je.listRef.current.scrollTo(Ft)}),Je}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 Nt=this.props,fn=Nt.activeKey,vn=Nt.itemScrollOffset,Ft=vn===void 0?0:vn;fn!==void 0&&fn!==this.state.activeKey&&(this.setState({activeKey:fn}),fn!==null&&this.scrollTo({key:fn,offset:Ft}))}},{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 Nt=this.state,fn=Nt.focused,vn=Nt.flattenNodes,Ft=Nt.keyEntities,Jt=Nt.draggingNodeKey,jt=Nt.activeKey,pn=Nt.dropLevelOffset,jn=Nt.dropContainerKey,Nn=Nt.dropTargetKey,Mn=Nt.dropPosition,fr=Nt.dragOverNodeKey,nn=Nt.indent,tn=this.props,hn=tn.prefixCls,di=tn.className,Sn=tn.style,Kt=tn.showLine,gi=tn.focusable,Vi=tn.tabIndex,Pi=Vi===void 0?0:Vi,Ii=tn.selectable,Fr=tn.showIcon,$n=tn.icon,In=tn.switcherIcon,si=tn.draggable,Ti=tn.checkable,Oi=tn.checkStrictly,zi=tn.disabled,xr=tn.motion,Ce=tn.loadData,_n=tn.filterTreeNode,ci=tn.height,ar=tn.itemHeight,_r=tn.scrollWidth,$r=tn.virtual,po=tn.titleRender,fi=tn.dropIndicatorRender,Qn=tn.onContextMenu,Bt=tn.onScroll,Tt=tn.direction,kt=tn.rootClassName,ui=tn.rootStyle,Yn=(0,Te.Z)(this.props,{aria:!0,data:!0}),vi;si&&((0,Ke.Z)(si)==="object"?vi=si:typeof si=="function"?vi={nodeDraggable:si}:vi={});var yn={prefixCls:hn,selectable:Ii,showIcon:Fr,icon:$n,switcherIcon:In,draggable:vi,draggingNodeKey:Jt,checkable:Ti,checkStrictly:Oi,disabled:zi,keyEntities:Ft,dropLevelOffset:pn,dropContainerKey:jn,dropTargetKey:Nn,dropPosition:Mn,dragOverNodeKey:fr,indent:nn,direction:Tt,dropIndicatorRender:fi,loadData:Ce,filterTreeNode:_n,titleRender:po,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:yn},te.createElement("div",{className:ot()(hn,di,kt,(0,Ge.Z)((0,Ge.Z)((0,Ge.Z)({},"".concat(hn,"-show-line"),Kt),"".concat(hn,"-focused"),fn),"".concat(hn,"-active-focused"),jt!==null)),style:ui},te.createElement(Wt,(0,ue.Z)({ref:this.listRef,prefixCls:hn,style:Sn,data:vn,disabled:zi,selectable:Ii,checkable:!!Ti,motion:xr,dragging:Jt!==null,height:ci,itemHeight:ar,virtual:$r,focusable:gi,focused:fn,tabIndex:Pi,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:Qn,onScroll:Bt,scrollWidth:_r},this.getTreeNodeRequiredProps(),Yn))))}}],[{key:"getDerivedStateFromProps",value:function(Nt,fn){var vn=fn.prevProps,Ft={prevProps:Nt};function Jt(Pi){return!vn&&Nt.hasOwnProperty(Pi)||vn&&vn[Pi]!==Nt[Pi]}var jt,pn=fn.fieldNames;if(Jt("fieldNames")&&(pn=(0,tt.w$)(Nt.fieldNames),Ft.fieldNames=pn),Jt("treeData")?jt=Nt.treeData:Jt("children")&&((0,ne.ZP)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),jt=(0,tt.zn)(Nt.children)),jt){Ft.treeData=jt;var jn=(0,tt.I8)(jt,{fieldNames:pn});Ft.keyEntities=(0,ft.Z)((0,Ge.Z)({},nt,oi),jn.keyEntities)}var Nn=Ft.keyEntities||fn.keyEntities;if(Jt("expandedKeys")||vn&&Jt("autoExpandParent"))Ft.expandedKeys=Nt.autoExpandParent||!vn&&Nt.defaultExpandParent?(0,Hn.r7)(Nt.expandedKeys,Nn):Nt.expandedKeys;else if(!vn&&Nt.defaultExpandAll){var Mn=(0,ft.Z)({},Nn);delete Mn[nt];var fr=[];Object.keys(Mn).forEach(function(Pi){var Ii=Mn[Pi];Ii.children&&Ii.children.length&&fr.push(Ii.key)}),Ft.expandedKeys=fr}else!vn&&Nt.defaultExpandedKeys&&(Ft.expandedKeys=Nt.autoExpandParent||Nt.defaultExpandParent?(0,Hn.r7)(Nt.defaultExpandedKeys,Nn):Nt.defaultExpandedKeys);if(Ft.expandedKeys||delete Ft.expandedKeys,jt||Ft.expandedKeys){var nn=(0,tt.oH)(jt||fn.treeData,Ft.expandedKeys||fn.expandedKeys,pn);Ft.flattenNodes=nn}if(Nt.selectable&&(Jt("selectedKeys")?Ft.selectedKeys=(0,Hn.BT)(Nt.selectedKeys,Nt):!vn&&Nt.defaultSelectedKeys&&(Ft.selectedKeys=(0,Hn.BT)(Nt.defaultSelectedKeys,Nt))),Nt.checkable){var tn;if(Jt("checkedKeys")?tn=(0,Hn.E6)(Nt.checkedKeys)||{}:!vn&&Nt.defaultCheckedKeys?tn=(0,Hn.E6)(Nt.defaultCheckedKeys)||{}:jt&&(tn=(0,Hn.E6)(Nt.checkedKeys)||{checkedKeys:fn.checkedKeys,halfCheckedKeys:fn.halfCheckedKeys}),tn){var hn=tn,di=hn.checkedKeys,Sn=di===void 0?[]:di,Kt=hn.halfCheckedKeys,gi=Kt===void 0?[]:Kt;if(!Nt.checkStrictly){var Vi=(0,lt.S)(Sn,!0,Nn);Sn=Vi.checkedKeys,gi=Vi.halfCheckedKeys}Ft.checkedKeys=Sn,Ft.halfCheckedKeys=gi}}return Jt("loadedKeys")&&(Ft.loadedKeys=Nt.loadedKeys),Ft}}]),Ae}(te.Component);(0,Ge.Z)(je,"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,Ge.Z)(je,"TreeNode",et.Z);var Me=je,Ee=Me},82661:function(Un,ai,Le){"use strict";Le.d(ai,{BT:function(){return te},E6:function(){return pe},L0:function(){return Ge},OM:function(){return ne},_5:function(){return dt},r7:function(){return ye},wA:function(){return ot},yx:function(){return Rt}});var ue=Le(80702),Ke=Le(62853),ft=Le(48736),yt=Le(59301),mt=Le(639),Oe=Le(65065),at=Le(34061),Ct=null;function dt(we,be){if(!we)return[];var Ie=we.slice(),Re=Ie.indexOf(be);return Re>=0&&Ie.splice(Re,1),Ie}function Ge(we,be){var Ie=(we||[]).slice();return Ie.indexOf(be)===-1&&Ie.push(be),Ie}function Rt(we){return we.split("-")}function ot(we,be){var Ie=[],Re=(0,Oe.Z)(be,we);function rt(){var et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];et.forEach(function(Ye){var ut=Ye.key,tt=Ye.children;Ie.push(ut),rt(tt)})}return rt(Re.children),Ie}function At(we){if(we.parent){var be=Rt(we.pos);return Number(be[be.length-1])===we.parent.children.length-1}return!1}function Te(we){var be=Rt(we.pos);return Number(be[be.length-1])===0}function ne(we,be,Ie,Re,rt,et,Ye,ut,tt,wt){var St,Lt=we.clientX,mn=we.clientY,$t=we.target.getBoundingClientRect(),Pn=$t.top,Ot=$t.height,ct=(wt==="rtl"?-1:1)*(((rt==null?void 0:rt.x)||0)-Lt),nt=(ct-12)/Re,gn=tt.filter(function(Ee){var De;return(De=ut[Ee])===null||De===void 0||(De=De.children)===null||De===void 0?void 0:De.length}),oi=(0,Oe.Z)(ut,Ie.eventKey);if(mn<Pn+Ot/2){var zn=Ye.findIndex(function(Ee){return Ee.key===oi.key}),Ht=zn<=0?0:zn-1,Fn=Ye[Ht].key;oi=(0,Oe.Z)(ut,Fn)}var Cn=oi.key,ii=oi,Wt=oi.key,Hn=0,lt=0;if(!gn.includes(Cn))for(var An=0;An<nt&&At(oi);An+=1)oi=oi.parent,lt+=1;var Ni=be.data,je=oi.node,Me=!0;return Te(oi)&&oi.level===0&&mn<Pn+Ot/2&&et({dragNode:Ni,dropNode:je,dropPosition:-1})&&oi.key===Ie.eventKey?Hn=-1:(ii.children||[]).length&&gn.includes(Wt)?et({dragNode:Ni,dropNode:je,dropPosition:0})?Hn=0:Me=!1:lt===0?nt>-1.5?et({dragNode:Ni,dropNode:je,dropPosition:1})?Hn=1:Me=!1:et({dragNode:Ni,dropNode:je,dropPosition:0})?Hn=0:et({dragNode:Ni,dropNode:je,dropPosition:1})?Hn=1:Me=!1:et({dragNode:Ni,dropNode:je,dropPosition:1})?Hn=1:Me=!1,{dropPosition:Hn,dropLevelOffset:lt,dropTargetKey:oi.key,dropTargetPos:oi.pos,dragOverNodeKey:Wt,dropContainerKey:Hn===0?null:((St=oi.parent)===null||St===void 0?void 0:St.key)||null,dropAllowed:Me}}function te(we,be){if(we){var Ie=be.multiple;return Ie?we.slice():we.length?[we[0]]:we}}var de=function(be){return be};function se(we,be){if(!we)return[];var Ie=be||{},Re=Ie.processProps,rt=Re===void 0?de:Re,et=Array.isArray(we)?we:[we];return et.map(function(Ye){var ut=Ye.children,tt=_objectWithoutProperties(Ye,Ct),wt=se(ut,be);return React.createElement(TreeNode,_extends({key:tt.key},rt(tt)),wt)})}function pe(we){if(!we)return null;var be;if(Array.isArray(we))be={checkedKeys:we,halfCheckedKeys:void 0};else if((0,Ke.Z)(we)==="object")be={checkedKeys:we.checked||void 0,halfCheckedKeys:we.halfChecked||void 0};else return(0,ft.ZP)(!1,"`checkedKeys` is not an array or an object"),null;return be}function ye(we,be){var Ie=new Set;function Re(rt){if(!Ie.has(rt)){var et=(0,Oe.Z)(be,rt);if(et){Ie.add(rt);var Ye=et.parent,ut=et.node;ut.disabled||Ye&&Re(Ye.key)}}}return(we||[]).forEach(function(rt){Re(rt)}),(0,ue.Z)(Ie)}},34643:function(Un,ai,Le){"use strict";Le.d(ai,{S:function(){return at}});var ue=Le(48736),Ke=Le(65065);function ft(Ct,dt){var Ge=new Set;return Ct.forEach(function(Rt){dt.has(Rt)||Ge.add(Rt)}),Ge}function yt(Ct){var dt=Ct||{},Ge=dt.disabled,Rt=dt.disableCheckbox,ot=dt.checkable;return!!(Ge||Rt)||ot===!1}function mt(Ct,dt,Ge,Rt){for(var ot=new Set(Ct),At=new Set,Te=0;Te<=Ge;Te+=1){var ne=dt.get(Te)||new Set;ne.forEach(function(pe){var ye=pe.key,we=pe.node,be=pe.children,Ie=be===void 0?[]:be;ot.has(ye)&&!Rt(we)&&Ie.filter(function(Re){return!Rt(Re.node)}).forEach(function(Re){ot.add(Re.key)})})}for(var te=new Set,de=Ge;de>=0;de-=1){var se=dt.get(de)||new Set;se.forEach(function(pe){var ye=pe.parent,we=pe.node;if(!(Rt(we)||!pe.parent||te.has(pe.parent.key))){if(Rt(pe.parent.node)){te.add(ye.key);return}var be=!0,Ie=!1;(ye.children||[]).filter(function(Re){return!Rt(Re.node)}).forEach(function(Re){var rt=Re.key,et=ot.has(rt);be&&!et&&(be=!1),!Ie&&(et||At.has(rt))&&(Ie=!0)}),be&&ot.add(ye.key),Ie&&At.add(ye.key),te.add(ye.key)}})}return{checkedKeys:Array.from(ot),halfCheckedKeys:Array.from(ft(At,ot))}}function Oe(Ct,dt,Ge,Rt,ot){for(var At=new Set(Ct),Te=new Set(dt),ne=0;ne<=Rt;ne+=1){var te=Ge.get(ne)||new Set;te.forEach(function(ye){var we=ye.key,be=ye.node,Ie=ye.children,Re=Ie===void 0?[]:Ie;!At.has(we)&&!Te.has(we)&&!ot(be)&&Re.filter(function(rt){return!ot(rt.node)}).forEach(function(rt){At.delete(rt.key)})})}Te=new Set;for(var de=new Set,se=Rt;se>=0;se-=1){var pe=Ge.get(se)||new Set;pe.forEach(function(ye){var we=ye.parent,be=ye.node;if(!(ot(be)||!ye.parent||de.has(ye.parent.key))){if(ot(ye.parent.node)){de.add(we.key);return}var Ie=!0,Re=!1;(we.children||[]).filter(function(rt){return!ot(rt.node)}).forEach(function(rt){var et=rt.key,Ye=At.has(et);Ie&&!Ye&&(Ie=!1),!Re&&(Ye||Te.has(et))&&(Re=!0)}),Ie||At.delete(we.key),Re&&Te.add(we.key),de.add(we.key)}})}return{checkedKeys:Array.from(At),halfCheckedKeys:Array.from(ft(Te,At))}}function at(Ct,dt,Ge,Rt){var ot=[],At;Rt?At=Rt:At=yt;var Te=new Set(Ct.filter(function(se){var pe=!!(0,Ke.Z)(Ge,se);return pe||ot.push(se),pe})),ne=new Map,te=0;Object.keys(Ge).forEach(function(se){var pe=Ge[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,ue.ZP)(!ot.length,"Tree missing follow keys: ".concat(ot.slice(0,100).map(function(se){return"'".concat(se,"'")}).join(", ")));var de;return dt===!0?de=mt(Te,ne,te,At):de=Oe(Te,dt.halfCheckedKeys,ne,te,At),de}},65065:function(Un,ai,Le){"use strict";Le.d(ai,{Z:function(){return ue}});function ue(Ke,ft){return Ke[ft]}},34061:function(Un,ai,Le){"use strict";Le.d(ai,{F:function(){return ye},H8:function(){return pe},I8:function(){return se},km:function(){return ot},oH:function(){return te},w$:function(){return At},zn:function(){return ne}});var ue=Le(62853),Ke=Le(80702),ft=Le(77321),yt=Le(74416),mt=Le(11592),Oe=Le(2738),at=Le(48736),Ct=Le(65065),dt=["children"];function Ge(we,be){return"".concat(we,"-").concat(be)}function Rt(we){return we&&we.type&&we.type.isTreeNode}function ot(we,be){return we!=null?we:be}function At(we){var be=we||{},Ie=be.title,Re=be._title,rt=be.key,et=be.children,Ye=Ie||"title";return{title:Ye,_title:Re||[Ye],key:rt||"key",children:et||"children"}}function Te(we,be){var Ie=new Map;function Re(rt){var et=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(rt||[]).forEach(function(Ye){var ut=Ye[be.key],tt=Ye[be.children];warning(ut!=null,"Tree node must have a certain key: [".concat(et).concat(ut,"]"));var wt=String(ut);warning(!Ie.has(wt)||ut===null||ut===void 0,"Same 'key' exist in the Tree: ".concat(wt)),Ie.set(wt,!0),Re(tt,"".concat(et).concat(wt," > "))})}Re(we)}function ne(we){function be(Ie){var Re=(0,mt.Z)(Ie);return Re.map(function(rt){if(!Rt(rt))return(0,at.ZP)(!rt,"Tree/TreeNode can only accept TreeNode as children."),null;var et=rt.key,Ye=rt.props,ut=Ye.children,tt=(0,yt.Z)(Ye,dt),wt=(0,ft.Z)({key:et},tt),St=be(ut);return St.length&&(wt.children=St),wt}).filter(function(rt){return rt})}return be(we)}function te(we,be,Ie){var Re=At(Ie),rt=Re._title,et=Re.key,Ye=Re.children,ut=new Set(be===!0?[]:be),tt=[];function wt(St){var Lt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return St.map(function(mn,$t){for(var Pn=Ge(Lt?Lt.pos:"0",$t),Ot=ot(mn[et],Pn),ct,nt=0;nt<rt.length;nt+=1){var gn=rt[nt];if(mn[gn]!==void 0){ct=mn[gn];break}}var oi=Object.assign((0,Oe.Z)(mn,[].concat((0,Ke.Z)(rt),[et,Ye])),{title:ct,key:Ot,parent:Lt,pos:Pn,children:null,data:mn,isStart:[].concat((0,Ke.Z)(Lt?Lt.isStart:[]),[$t===0]),isEnd:[].concat((0,Ke.Z)(Lt?Lt.isEnd:[]),[$t===St.length-1])});return tt.push(oi),be===!0||ut.has(Ot)?oi.children=wt(mn[Ye]||[],oi):oi.children=[],oi})}return wt(we),tt}function de(we,be,Ie){var Re={};(0,ue.Z)(Ie)==="object"?Re=Ie:Re={externalGetKey:Ie},Re=Re||{};var rt=Re,et=rt.childrenPropName,Ye=rt.externalGetKey,ut=rt.fieldNames,tt=At(ut),wt=tt.key,St=tt.children,Lt=et||St,mn;Ye?typeof Ye=="string"?mn=function(Ot){return Ot[Ye]}:typeof Ye=="function"&&(mn=function(Ot){return Ye(Ot)}):mn=function(Ot,ct){return ot(Ot[wt],ct)};function $t(Pn,Ot,ct,nt){var gn=Pn?Pn[Lt]:we,oi=Pn?Ge(ct.pos,Ot):"0",zn=Pn?[].concat((0,Ke.Z)(nt),[Pn]):[];if(Pn){var Ht=mn(Pn,oi),Fn={node:Pn,index:Ot,pos:oi,key:Ht,parentPos:ct.node?ct.pos:null,level:ct.level+1,nodes:zn};be(Fn)}gn&&gn.forEach(function(Cn,ii){$t(Cn,ii,{node:Pn,pos:oi,level:ct?ct.level+1:-1},zn)})}$t(null)}function se(we){var be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ie=be.initWrapper,Re=be.processEntity,rt=be.onProcessFinished,et=be.externalGetKey,Ye=be.childrenPropName,ut=be.fieldNames,tt=arguments.length>2?arguments[2]:void 0,wt=et||tt,St={},Lt={},mn={posEntities:St,keyEntities:Lt};return Ie&&(mn=Ie(mn)||mn),de(we,function($t){var Pn=$t.node,Ot=$t.index,ct=$t.pos,nt=$t.key,gn=$t.parentPos,oi=$t.level,zn=$t.nodes,Ht={node:Pn,nodes:zn,index:Ot,key:nt,pos:ct,level:oi},Fn=ot(nt,ct);St[ct]=Ht,Lt[Fn]=Ht,Ht.parent=St[gn],Ht.parent&&(Ht.parent.children=Ht.parent.children||[],Ht.parent.children.push(Ht)),Re&&Re(Ht,mn)},{externalGetKey:wt,childrenPropName:Ye,fieldNames:ut}),rt&&rt(mn),mn}function pe(we,be){var Ie=be.expandedKeys,Re=be.selectedKeys,rt=be.loadedKeys,et=be.loadingKeys,Ye=be.checkedKeys,ut=be.halfCheckedKeys,tt=be.dragOverNodeKey,wt=be.dropPosition,St=be.keyEntities,Lt=(0,Ct.Z)(St,we),mn={eventKey:we,expanded:Ie.indexOf(we)!==-1,selected:Re.indexOf(we)!==-1,loaded:rt.indexOf(we)!==-1,loading:et.indexOf(we)!==-1,checked:Ye.indexOf(we)!==-1,halfChecked:ut.indexOf(we)!==-1,pos:String(Lt?Lt.pos:""),dragOver:tt===we&&wt===0,dragOverGapTop:tt===we&&wt===-1,dragOverGapBottom:tt===we&&wt===1};return mn}function ye(we){var be=we.data,Ie=we.expanded,Re=we.selected,rt=we.checked,et=we.loaded,Ye=we.loading,ut=we.halfChecked,tt=we.dragOver,wt=we.dragOverGapTop,St=we.dragOverGapBottom,Lt=we.pos,mn=we.active,$t=we.eventKey,Pn=(0,ft.Z)((0,ft.Z)({},be),{},{expanded:Ie,selected:Re,checked:rt,loaded:et,loading:Ye,halfChecked:ut,dragOver:tt,dragOverGapTop:wt,dragOverGapBottom:St,pos:Lt,active:mn,key:$t});return"props"in Pn||Object.defineProperty(Pn,"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}}),Pn}},8224:function(Un,ai,Le){"use strict";Le.d(ai,{Z:function(){return Ke}});var ue=Le(4676);function Ke(ft,yt,mt,Oe){var at=ue.unstable_batchedUpdates?function(dt){ue.unstable_batchedUpdates(mt,dt)}:mt;return ft!=null&&ft.addEventListener&&ft.addEventListener(yt,at,Oe),{remove:function(){ft!=null&&ft.removeEventListener&&ft.removeEventListener(yt,at,Oe)}}}},24514:function(Un,ai,Le){"use strict";Le.d(ai,{G:function(){return yt}});var ue=Le(47273),Ke=function(Oe){if((0,ue.Z)()&&window.document.documentElement){var at=Array.isArray(Oe)?Oe:[Oe],Ct=window.document.documentElement;return at.some(function(dt){return dt in Ct.style})}return!1},ft=function(Oe,at){if(!Ke(Oe))return!1;var Ct=document.createElement("div"),dt=Ct.style[Oe];return Ct.style[Oe]=at,Ct.style[Oe]!==dt};function yt(mt,Oe){return!Array.isArray(mt)&&Oe!==void 0?ft(mt,Oe):Ke(mt)}},45680:function(Un,ai,Le){"use strict";Le.d(ai,{Z:function(){return Ni}});var ue=Le(72308),Ke=Le(62853),ft=Le(77321),yt=Le(49618),mt=Le(52487),Oe=Le(74416),at=Le(92310),Ct=Le.n(at),dt=Le(29301),Ge=Le(70425),Rt=Le(34280),ot=Le(59301),At=Le(4676),Te=ot.forwardRef(function(je,Me){var Ee=je.height,De=je.offsetY,We=je.offsetX,Ae=je.children,Je=je.prefixCls,Nt=je.onInnerResize,fn=je.innerProps,vn=je.rtl,Ft=je.extra,Jt={},jt={display:"flex",flexDirection:"column"};return De!==void 0&&(Jt={height:Ee,position:"relative",overflow:"hidden"},jt=(0,ft.Z)((0,ft.Z)({},jt),{},(0,yt.Z)((0,yt.Z)((0,yt.Z)((0,yt.Z)((0,yt.Z)({transform:"translateY(".concat(De,"px)")},vn?"marginRight":"marginLeft",-We),"position","absolute"),"left",0),"right",0),"top",0))),ot.createElement("div",{style:Jt},ot.createElement(dt.Z,{onResize:function(jn){var Nn=jn.offsetHeight;Nn&&Nt&&Nt()}},ot.createElement("div",(0,ue.Z)({style:jt,className:Ct()((0,yt.Z)({},"".concat(Je,"-holder-inner"),Je)),ref:Me},fn),Ae,Ft)))});Te.displayName="Filler";var ne=Te;function te(je){var Me=je.children,Ee=je.setRef,De=ot.useCallback(function(We){Ee(We)},[]);return ot.cloneElement(Me,{ref:De})}function de(je,Me,Ee,De,We,Ae,Je,Nt){var fn=Nt.getKey;return je.slice(Me,Ee+1).map(function(vn,Ft){var Jt=Me+Ft,jt=Je(vn,Jt,{style:{width:De},offsetX:We}),pn=fn(vn);return ot.createElement(te,{key:pn,setRef:function(Nn){return Ae(vn,Nn)}},jt)})}function se(je,Me,Ee,De){var We=Ee-je,Ae=Me-Ee,Je=Math.min(We,Ae)*2;if(De<=Je){var Nt=Math.floor(De/2);return De%2?Ee+Nt+1:Ee-Nt}return We>Ae?Ee-(De-Ae):Ee+(De-We)}function pe(je,Me,Ee){var De=je.length,We=Me.length,Ae,Je;if(De===0&&We===0)return null;De<We?(Ae=je,Je=Me):(Ae=Me,Je=je);var Nt={__EMPTY_ITEM__:!0};function fn(jn){return jn!==void 0?Ee(jn):Nt}for(var vn=null,Ft=Math.abs(De-We)!==1,Jt=0;Jt<Je.length;Jt+=1){var jt=fn(Ae[Jt]),pn=fn(Je[Jt]);if(jt!==pn){vn=Jt,Ft=Ft||jt!==fn(Je[Jt+1]);break}}return vn===null?null:{index:vn,multiple:Ft}}function ye(je,Me,Ee){var De=ot.useState(je),We=(0,mt.Z)(De,2),Ae=We[0],Je=We[1],Nt=ot.useState(null),fn=(0,mt.Z)(Nt,2),vn=fn[0],Ft=fn[1];return ot.useEffect(function(){var Jt=pe(Ae||[],je||[],Me);(Jt==null?void 0:Jt.index)!==void 0&&(Ee==null||Ee(Jt.index),Ft(je[Jt.index])),Je(je)},[je]),[vn]}var we=Le(16089),be=(typeof navigator=="undefined"?"undefined":(0,Ke.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),Ie=be,Re=function(je,Me,Ee,De){var We=(0,ot.useRef)(!1),Ae=(0,ot.useRef)(null);function Je(){clearTimeout(Ae.current),We.current=!0,Ae.current=setTimeout(function(){We.current=!1},50)}var Nt=(0,ot.useRef)({top:je,bottom:Me,left:Ee,right:De});return Nt.current.top=je,Nt.current.bottom=Me,Nt.current.left=Ee,Nt.current.right=De,function(fn,vn){var Ft=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,Jt=fn?vn<0&&Nt.current.left||vn>0&&Nt.current.right:vn<0&&Nt.current.top||vn>0&&Nt.current.bottom;return Ft&&Jt?(clearTimeout(Ae.current),We.current=!1):(!Jt||We.current)&&Je(),!We.current&&Jt}};function rt(je,Me,Ee,De,We,Ae,Je){var Nt=(0,ot.useRef)(0),fn=(0,ot.useRef)(null),vn=(0,ot.useRef)(null),Ft=(0,ot.useRef)(!1),Jt=Re(Me,Ee,De,We);function jt(nn,tn){if(we.Z.cancel(fn.current),!Jt(!1,tn)){var hn=nn;if(!hn._virtualHandled)hn._virtualHandled=!0;else return;Nt.current+=tn,vn.current=tn,Ie||hn.preventDefault(),fn.current=(0,we.Z)(function(){var di=Ft.current?10:1;Je(Nt.current*di,!1),Nt.current=0})}}function pn(nn,tn){Je(tn,!0),Ie||nn.preventDefault()}var jn=(0,ot.useRef)(null),Nn=(0,ot.useRef)(null);function Mn(nn){if(je){we.Z.cancel(Nn.current),Nn.current=(0,we.Z)(function(){jn.current=null},2);var tn=nn.deltaX,hn=nn.deltaY,di=nn.shiftKey,Sn=tn,Kt=hn;(jn.current==="sx"||!jn.current&&di&&hn&&!tn)&&(Sn=hn,Kt=0,jn.current="sx");var gi=Math.abs(Sn),Vi=Math.abs(Kt);jn.current===null&&(jn.current=Ae&&gi>Vi?"x":"y"),jn.current==="y"?jt(nn,Kt):pn(nn,Sn)}}function fr(nn){je&&(Ft.current=nn.detail===vn.current)}return[Mn,fr]}function et(je,Me,Ee,De){var We=ot.useMemo(function(){return[new Map,[]]},[je,Ee.id,De]),Ae=(0,mt.Z)(We,2),Je=Ae[0],Nt=Ae[1],fn=function(Ft){var Jt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ft,jt=Je.get(Ft),pn=Je.get(Jt);if(jt===void 0||pn===void 0)for(var jn=je.length,Nn=Nt.length;Nn<jn;Nn+=1){var Mn,fr=je[Nn],nn=Me(fr);Je.set(nn,Nn);var tn=(Mn=Ee.get(nn))!==null&&Mn!==void 0?Mn:De;if(Nt[Nn]=(Nt[Nn-1]||0)+tn,nn===Ft&&(jt=Nn),nn===Jt&&(pn=Nn),jt!==void 0&&pn!==void 0)break}return{top:Nt[jt-1]||0,bottom:Nt[pn]}};return fn}var Ye=Le(96949),ut=Le(55090),tt=function(){function je(){(0,Ye.Z)(this,je),(0,yt.Z)(this,"maps",void 0),(0,yt.Z)(this,"id",0),(0,yt.Z)(this,"diffKeys",new Set),this.maps=Object.create(null)}return(0,ut.Z)(je,[{key:"set",value:function(Ee,De){this.maps[Ee]=De,this.id+=1,this.diffKeys.add(Ee)}},{key:"get",value:function(Ee){return this.maps[Ee]}},{key:"resetRecord",value:function(){this.diffKeys.clear()}},{key:"getRecord",value:function(){return this.diffKeys}}]),je}(),wt=tt;function St(je){var Me=parseFloat(je);return isNaN(Me)?0:Me}function Lt(je,Me,Ee){var De=ot.useState(0),We=(0,mt.Z)(De,2),Ae=We[0],Je=We[1],Nt=(0,ot.useRef)(new Map),fn=(0,ot.useRef)(new wt),vn=(0,ot.useRef)(0);function Ft(){vn.current+=1}function Jt(){var pn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;Ft();var jn=function(){var fr=!1;Nt.current.forEach(function(nn,tn){if(nn&&nn.offsetParent){var hn=nn.offsetHeight,di=getComputedStyle(nn),Sn=di.marginTop,Kt=di.marginBottom,gi=St(Sn),Vi=St(Kt),Pi=hn+gi+Vi;fn.current.get(tn)!==Pi&&(fn.current.set(tn,Pi),fr=!0)}}),fr&&Je(function(nn){return nn+1})};if(pn)jn();else{vn.current+=1;var Nn=vn.current;Promise.resolve().then(function(){Nn===vn.current&&jn()})}}function jt(pn,jn){var Nn=je(pn),Mn=Nt.current.get(Nn);jn?(Nt.current.set(Nn,jn),Jt()):Nt.current.delete(Nn),!Mn!=!jn&&(jn?Me==null||Me(pn):Ee==null||Ee(pn))}return(0,ot.useEffect)(function(){return Ft},[]),[jt,Jt,fn.current,Ae]}var mn=14/15;function $t(je,Me,Ee){var De=(0,ot.useRef)(!1),We=(0,ot.useRef)(0),Ae=(0,ot.useRef)(0),Je=(0,ot.useRef)(null),Nt=(0,ot.useRef)(null),fn,vn=function(pn){if(De.current){var jn=Math.ceil(pn.touches[0].pageX),Nn=Math.ceil(pn.touches[0].pageY),Mn=We.current-jn,fr=Ae.current-Nn,nn=Math.abs(Mn)>Math.abs(fr);nn?We.current=jn:Ae.current=Nn;var tn=Ee(nn,nn?Mn:fr,!1,pn);tn&&pn.preventDefault(),clearInterval(Nt.current),tn&&(Nt.current=setInterval(function(){nn?Mn*=mn:fr*=mn;var hn=Math.floor(nn?Mn:fr);(!Ee(nn,hn,!0)||Math.abs(hn)<=.1)&&clearInterval(Nt.current)},16))}},Ft=function(){De.current=!1,fn()},Jt=function(pn){fn(),pn.touches.length===1&&!De.current&&(De.current=!0,We.current=Math.ceil(pn.touches[0].pageX),Ae.current=Math.ceil(pn.touches[0].pageY),Je.current=pn.target,Je.current.addEventListener("touchmove",vn,{passive:!1}),Je.current.addEventListener("touchend",Ft,{passive:!0}))};fn=function(){Je.current&&(Je.current.removeEventListener("touchmove",vn),Je.current.removeEventListener("touchend",Ft))},(0,Rt.Z)(function(){return je&&Me.current.addEventListener("touchstart",Jt,{passive:!0}),function(){var jt;(jt=Me.current)===null||jt===void 0||jt.removeEventListener("touchstart",Jt),fn(),clearInterval(Nt.current)}},[je])}function Pn(je){return Math.floor(Math.pow(je,.5))}function Ot(je,Me){var Ee="touches"in je?je.touches[0]:je;return Ee[Me?"pageX":"pageY"]-window[Me?"scrollX":"scrollY"]}function ct(je,Me,Ee){ot.useEffect(function(){var De=Me.current;if(je&&De){var We=!1,Ae,Je,Nt=function(){we.Z.cancel(Ae)},fn=function jt(){Nt(),Ae=(0,we.Z)(function(){Ee(Je),jt()})},vn=function(pn){if(!(pn.target.draggable||pn.button!==0)){var jn=pn;jn._virtualHandled||(jn._virtualHandled=!0,We=!0)}},Ft=function(){We=!1,Nt()},Jt=function(pn){if(We){var jn=Ot(pn,!1),Nn=De.getBoundingClientRect(),Mn=Nn.top,fr=Nn.bottom;if(jn<=Mn){var nn=Mn-jn;Je=-Pn(nn),fn()}else if(jn>=fr){var tn=jn-fr;Je=Pn(tn),fn()}else Nt()}};return De.addEventListener("mousedown",vn),De.ownerDocument.addEventListener("mouseup",Ft),De.ownerDocument.addEventListener("mousemove",Jt),function(){De.removeEventListener("mousedown",vn),De.ownerDocument.removeEventListener("mouseup",Ft),De.ownerDocument.removeEventListener("mousemove",Jt),Nt()}}},[je])}var nt=10;function gn(je,Me,Ee,De,We,Ae,Je,Nt){var fn=ot.useRef(),vn=ot.useState(null),Ft=(0,mt.Z)(vn,2),Jt=Ft[0],jt=Ft[1];return(0,Rt.Z)(function(){if(Jt&&Jt.times<nt){if(!je.current){jt(function(xr){return(0,ft.Z)({},xr)});return}Ae();var pn=Jt.targetAlign,jn=Jt.originAlign,Nn=Jt.index,Mn=Jt.offset,fr=je.current.clientHeight,nn=!1,tn=pn,hn=null;if(fr){for(var di=pn||jn,Sn=0,Kt=0,gi=0,Vi=Math.min(Me.length-1,Nn),Pi=0;Pi<=Vi;Pi+=1){var Ii=We(Me[Pi]);Kt=Sn;var Fr=Ee.get(Ii);gi=Kt+(Fr===void 0?De:Fr),Sn=gi}for(var $n=di==="top"?Mn:fr-Mn,In=Vi;In>=0;In-=1){var si=We(Me[In]),Ti=Ee.get(si);if(Ti===void 0){nn=!0;break}if($n-=Ti,$n<=0)break}switch(di){case"top":hn=Kt-Mn;break;case"bottom":hn=gi-fr+Mn;break;default:{var Oi=je.current.scrollTop,zi=Oi+fr;Kt<Oi?tn="top":gi>zi&&(tn="bottom")}}hn!==null&&Je(hn),hn!==Jt.lastTop&&(nn=!0)}nn&&jt((0,ft.Z)((0,ft.Z)({},Jt),{},{times:Jt.times+1,targetAlign:tn,lastTop:hn}))}},[Jt,je.current]),function(pn){if(pn==null){Nt();return}if(we.Z.cancel(fn.current),typeof pn=="number")Je(pn);else if(pn&&(0,Ke.Z)(pn)==="object"){var jn,Nn=pn.align;"index"in pn?jn=pn.index:jn=Me.findIndex(function(nn){return We(nn)===pn.key});var Mn=pn.offset,fr=Mn===void 0?0:Mn;jt({times:0,index:jn,offset:fr,originAlign:Nn})}}}var oi=ot.forwardRef(function(je,Me){var Ee=je.prefixCls,De=je.rtl,We=je.scrollOffset,Ae=je.scrollRange,Je=je.onStartMove,Nt=je.onStopMove,fn=je.onScroll,vn=je.horizontal,Ft=je.spinSize,Jt=je.containerSize,jt=je.style,pn=je.thumbStyle,jn=je.showScrollBar,Nn=ot.useState(!1),Mn=(0,mt.Z)(Nn,2),fr=Mn[0],nn=Mn[1],tn=ot.useState(null),hn=(0,mt.Z)(tn,2),di=hn[0],Sn=hn[1],Kt=ot.useState(null),gi=(0,mt.Z)(Kt,2),Vi=gi[0],Pi=gi[1],Ii=!De,Fr=ot.useRef(),$n=ot.useRef(),In=ot.useState(jn),si=(0,mt.Z)(In,2),Ti=si[0],Oi=si[1],zi=ot.useRef(),xr=function(){jn===!0||jn===!1||(clearTimeout(zi.current),Oi(!0),zi.current=setTimeout(function(){Oi(!1)},3e3))},Ce=Ae-Jt||0,_n=Jt-Ft||0,ci=ot.useMemo(function(){if(We===0||Ce===0)return 0;var kt=We/Ce;return kt*_n},[We,Ce,_n]),ar=function(ui){ui.stopPropagation(),ui.preventDefault()},_r=ot.useRef({top:ci,dragging:fr,pageY:di,startTop:Vi});_r.current={top:ci,dragging:fr,pageY:di,startTop:Vi};var $r=function(ui){nn(!0),Sn(Ot(ui,vn)),Pi(_r.current.top),Je(),ui.stopPropagation(),ui.preventDefault()};ot.useEffect(function(){var kt=function(yn){yn.preventDefault()},ui=Fr.current,Yn=$n.current;return ui.addEventListener("touchstart",kt,{passive:!1}),Yn.addEventListener("touchstart",$r,{passive:!1}),function(){ui.removeEventListener("touchstart",kt),Yn.removeEventListener("touchstart",$r)}},[]);var po=ot.useRef();po.current=Ce;var fi=ot.useRef();fi.current=_n,ot.useEffect(function(){if(fr){var kt,ui=function(yn){var Kn=_r.current,It=Kn.dragging,_t=Kn.pageY,hi=Kn.startTop;we.Z.cancel(kt);var it=Fr.current.getBoundingClientRect(),sn=Jt/(vn?it.width:it.height);if(It){var Dn=(Ot(yn,vn)-_t)*sn,Di=hi;!Ii&&vn?Di-=Dn:Di+=Dn;var cn=po.current,qt=fi.current,an=qt?Di/qt:0,Gi=Math.ceil(an*cn);Gi=Math.max(Gi,0),Gi=Math.min(Gi,cn),kt=(0,we.Z)(function(){fn(Gi,vn)})}},Yn=function(){nn(!1),Nt()};return window.addEventListener("mousemove",ui,{passive:!0}),window.addEventListener("touchmove",ui,{passive:!0}),window.addEventListener("mouseup",Yn,{passive:!0}),window.addEventListener("touchend",Yn,{passive:!0}),function(){window.removeEventListener("mousemove",ui),window.removeEventListener("touchmove",ui),window.removeEventListener("mouseup",Yn),window.removeEventListener("touchend",Yn),we.Z.cancel(kt)}}},[fr]),ot.useEffect(function(){return xr(),function(){clearTimeout(zi.current)}},[We]),ot.useImperativeHandle(Me,function(){return{delayHidden:xr}});var Qn="".concat(Ee,"-scrollbar"),Bt={position:"absolute",visibility:Ti?null:"hidden"},Tt={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return vn?(Bt.height=8,Bt.left=0,Bt.right=0,Bt.bottom=0,Tt.height="100%",Tt.width=Ft,Ii?Tt.left=ci:Tt.right=ci):(Bt.width=8,Bt.top=0,Bt.bottom=0,Ii?Bt.right=0:Bt.left=0,Tt.width="100%",Tt.height=Ft,Tt.top=ci),ot.createElement("div",{ref:Fr,className:Ct()(Qn,(0,yt.Z)((0,yt.Z)((0,yt.Z)({},"".concat(Qn,"-horizontal"),vn),"".concat(Qn,"-vertical"),!vn),"".concat(Qn,"-visible"),Ti)),style:(0,ft.Z)((0,ft.Z)({},Bt),jt),onMouseDown:ar,onMouseMove:xr},ot.createElement("div",{ref:$n,className:Ct()("".concat(Qn,"-thumb"),(0,yt.Z)({},"".concat(Qn,"-thumb-moving"),fr)),style:(0,ft.Z)((0,ft.Z)({},Tt),pn),onMouseDown:$r}))}),zn=oi,Ht=20;function Fn(){var je=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Ee=je/Me*je;return isNaN(Ee)&&(Ee=0),Ee=Math.max(Ee,Ht),Math.floor(Ee)}var Cn=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],ii=[],Wt={overflowY:"auto",overflowAnchor:"none"};function Hn(je,Me){var Ee=je.prefixCls,De=Ee===void 0?"rc-virtual-list":Ee,We=je.className,Ae=je.height,Je=je.itemHeight,Nt=je.fullHeight,fn=Nt===void 0?!0:Nt,vn=je.style,Ft=je.data,Jt=je.children,jt=je.itemKey,pn=je.virtual,jn=je.direction,Nn=je.scrollWidth,Mn=je.component,fr=Mn===void 0?"div":Mn,nn=je.onScroll,tn=je.onVirtualScroll,hn=je.onVisibleChange,di=je.innerProps,Sn=je.extraRender,Kt=je.styles,gi=je.showScrollBar,Vi=gi===void 0?"optional":gi,Pi=(0,Oe.Z)(je,Cn),Ii=ot.useCallback(function(Wn){return typeof jt=="function"?jt(Wn):Wn==null?void 0:Wn[jt]},[jt]),Fr=Lt(Ii,null,null),$n=(0,mt.Z)(Fr,4),In=$n[0],si=$n[1],Ti=$n[2],Oi=$n[3],zi=!!(pn!==!1&&Ae&&Je),xr=ot.useMemo(function(){return Object.values(Ti.maps).reduce(function(Wn,mi){return Wn+mi},0)},[Ti.id,Ti.maps]),Ce=zi&&Ft&&(Math.max(Je*Ft.length,xr)>Ae||!!Nn),_n=jn==="rtl",ci=Ct()(De,(0,yt.Z)({},"".concat(De,"-rtl"),_n),We),ar=Ft||ii,_r=(0,ot.useRef)(),$r=(0,ot.useRef)(),po=(0,ot.useRef)(),fi=(0,ot.useState)(0),Qn=(0,mt.Z)(fi,2),Bt=Qn[0],Tt=Qn[1],kt=(0,ot.useState)(0),ui=(0,mt.Z)(kt,2),Yn=ui[0],vi=ui[1],yn=(0,ot.useState)(!1),Kn=(0,mt.Z)(yn,2),It=Kn[0],_t=Kn[1],hi=function(){_t(!0)},it=function(){_t(!1)},sn={getKey:Ii};function Dn(Wn){Tt(function(mi){var Si;typeof Wn=="function"?Si=Wn(mi):Si=Wn;var Ei=Ir(Si);return _r.current.scrollTop=Ei,Ei})}var Di=(0,ot.useRef)({start:0,end:ar.length}),cn=(0,ot.useRef)(),qt=ye(ar,Ii),an=(0,mt.Z)(qt,1),Gi=an[0];cn.current=Gi;var ur=ot.useMemo(function(){if(!zi)return{scrollHeight:void 0,start:0,end:ar.length-1,offset:void 0};if(!Ce){var Wn;return{scrollHeight:((Wn=$r.current)===null||Wn===void 0?void 0:Wn.offsetHeight)||0,start:0,end:ar.length-1,offset:void 0}}for(var mi=0,Si,Ei,bi,gr=ar.length,qi=0;qi<gr;qi+=1){var Ui=ar[qi],bn=Ii(Ui),Yi=Ti.get(bn),rr=mi+(Yi===void 0?Je:Yi);rr>=Bt&&Si===void 0&&(Si=qi,Ei=mi),rr>Bt+Ae&&bi===void 0&&(bi=qi),mi=rr}return Si===void 0&&(Si=0,Ei=0,bi=Math.ceil(Ae/Je)),bi===void 0&&(bi=ar.length-1),bi=Math.min(bi+1,ar.length-1),{scrollHeight:mi,start:Si,end:bi,offset:Ei}},[Ce,zi,Bt,ar,Oi,Ae]),Hi=ur.scrollHeight,Mi=ur.start,Ri=ur.end,dr=ur.offset;Di.current.start=Mi,Di.current.end=Ri,ot.useLayoutEffect(function(){var Wn=Ti.getRecord();if(Wn.size===1){var mi=Array.from(Wn)[0],Si=ar[Mi];if(Si){var Ei=Ii(Si);if(Ei===mi){var bi=Ti.get(mi),gr=bi-Je;Dn(function(qi){return qi+gr})}}}Ti.resetRecord()},[Hi]);var Er=ot.useState({width:0,height:Ae}),Ar=(0,mt.Z)(Er,2),wn=Ar[0],Yo=Ar[1],zr=function(mi){Yo({width:mi.offsetWidth,height:mi.offsetHeight})},mo=(0,ot.useRef)(),en=(0,ot.useRef)(),li=ot.useMemo(function(){return Fn(wn.width,Nn)},[wn.width,Nn]),nr=ot.useMemo(function(){return Fn(wn.height,Hi)},[wn.height,Hi]),Sr=Hi-Ae,vr=(0,ot.useRef)(Sr);vr.current=Sr;function Ir(Wn){var mi=Wn;return Number.isNaN(vr.current)||(mi=Math.min(mi,vr.current)),mi=Math.max(mi,0),mi}var bo=Bt<=0,fo=Bt>=Sr,so=Yn<=0,lo=Yn>=Nn,Tn=Re(bo,fo,so,lo),qo=function(){return{x:_n?-Yn:Yn,y:Bt}},Zn=(0,ot.useRef)(qo()),wr=(0,Ge.zX)(function(Wn){if(tn){var mi=(0,ft.Z)((0,ft.Z)({},qo()),Wn);(Zn.current.x!==mi.x||Zn.current.y!==mi.y)&&(tn(mi),Zn.current=mi)}});function Or(Wn,mi){var Si=Wn;mi?((0,At.flushSync)(function(){vi(Si)}),wr()):Dn(Si)}function hr(Wn){var mi=Wn.currentTarget.scrollTop;mi!==Bt&&Dn(mi),nn==null||nn(Wn),wr()}var la=function(mi){var Si=mi,Ei=Nn?Nn-wn.width:0;return Si=Math.max(Si,0),Si=Math.min(Si,Ei),Si},ca=(0,Ge.zX)(function(Wn,mi){mi?((0,At.flushSync)(function(){vi(function(Si){var Ei=Si+(_n?-Wn:Wn);return la(Ei)})}),wr()):Dn(function(Si){var Ei=Si+Wn;return Ei})}),Qo=rt(zi,bo,fo,so,lo,!!Nn,ca),zo=(0,mt.Z)(Qo,2),Vt=zo[0],On=zo[1];$t(zi,_r,function(Wn,mi,Si,Ei){var bi=Ei;return Tn(Wn,mi,Si)?!1:!bi||!bi._virtualHandled?(bi&&(bi._virtualHandled=!0),Vt({preventDefault:function(){},deltaX:Wn?mi:0,deltaY:Wn?0:mi}),!0):!1}),ct(Ce,_r,function(Wn){Dn(function(mi){return mi+Wn})}),(0,Rt.Z)(function(){function Wn(Si){var Ei=bo&&Si.detail<0,bi=fo&&Si.detail>0;zi&&!Ei&&!bi&&Si.preventDefault()}var mi=_r.current;return mi.addEventListener("wheel",Vt,{passive:!1}),mi.addEventListener("DOMMouseScroll",On,{passive:!0}),mi.addEventListener("MozMousePixelScroll",Wn,{passive:!1}),function(){mi.removeEventListener("wheel",Vt),mi.removeEventListener("DOMMouseScroll",On),mi.removeEventListener("MozMousePixelScroll",Wn)}},[zi,bo,fo]),(0,Rt.Z)(function(){if(Nn){var Wn=la(Yn);vi(Wn),wr({x:Wn})}},[wn.width,Nn]);var Ut=function(){var mi,Si;(mi=mo.current)===null||mi===void 0||mi.delayHidden(),(Si=en.current)===null||Si===void 0||Si.delayHidden()},_e=gn(_r,ar,Ti,Je,Ii,function(){return si(!0)},Dn,Ut);ot.useImperativeHandle(Me,function(){return{nativeElement:po.current,getScrollInfo:qo,scrollTo:function(mi){function Si(Ei){return Ei&&(0,Ke.Z)(Ei)==="object"&&("left"in Ei||"top"in Ei)}Si(mi)?(mi.left!==void 0&&vi(la(mi.left)),_e(mi.top)):_e(mi)}}}),(0,Rt.Z)(function(){if(hn){var Wn=ar.slice(Mi,Ri+1);hn(Wn,ar)}},[Mi,Ri,ar]);var pi=et(ar,Ii,Ti,Je),Vn=Sn==null?void 0:Sn({start:Mi,end:Ri,virtual:Ce,offsetX:Yn,offsetY:dr,rtl:_n,getSize:pi}),qn=de(ar,Mi,Ri,Nn,Yn,In,Jt,sn),ki=null;Ae&&(ki=(0,ft.Z)((0,yt.Z)({},fn?"height":"maxHeight",Ae),Wt),zi&&(ki.overflowY="hidden",Nn&&(ki.overflowX="hidden"),It&&(ki.pointerEvents="none")));var Wi={};return _n&&(Wi.dir="rtl"),ot.createElement("div",(0,ue.Z)({ref:po,style:(0,ft.Z)((0,ft.Z)({},vn),{},{position:"relative"}),className:ci},Wi,Pi),ot.createElement(dt.Z,{onResize:zr},ot.createElement(fr,{className:"".concat(De,"-holder"),style:ki,ref:_r,onScroll:hr,onMouseEnter:Ut},ot.createElement(ne,{prefixCls:De,height:Hi,offsetX:Yn,offsetY:dr,scrollWidth:Nn,onInnerResize:si,ref:$r,innerProps:di,rtl:_n,extra:Vn},qn))),Ce&&Hi>Ae&&ot.createElement(zn,{ref:mo,prefixCls:De,scrollOffset:Bt,scrollRange:Hi,rtl:_n,onScroll:Or,onStartMove:hi,onStopMove:it,spinSize:nr,containerSize:wn.height,style:Kt==null?void 0:Kt.verticalScrollBar,thumbStyle:Kt==null?void 0:Kt.verticalScrollBarThumb,showScrollBar:Vi}),Ce&&Nn>wn.width&&ot.createElement(zn,{ref:en,prefixCls:De,scrollOffset:Yn,scrollRange:Nn,rtl:_n,onScroll:Or,onStartMove:hi,onStopMove:it,spinSize:li,containerSize:wn.width,horizontal:!0,style:Kt==null?void 0:Kt.horizontalScrollBar,thumbStyle:Kt==null?void 0:Kt.horizontalScrollBarThumb,showScrollBar:Vi}))}var lt=ot.forwardRef(Hn);lt.displayName="List";var An=lt,Ni=An},12921:function(Un,ai,Le){"use strict";Le.d(ai,{Z5:function(){return fg},_l:function(){return dl},bK:function(){return hu}});var ue=Le(59301),Ke=Le(60039);function ft(ve,Se){ve.prototype=Object.create(Se.prototype),ve.prototype.constructor=ve,(0,Ke.Z)(ve,Se)}var yt=Le(72308),mt=Le(59781),Oe=ue.createContext(null),at=null;function Ct(ve){ve()}var dt=Ct,Ge=function(Se){return dt=Se},Rt=function(){return dt};function ot(){var ve=Rt(),Se=null,Be=null;return{clear:function(){Se=null,Be=null},notify:function(){ve(function(){for(var qe=Se;qe;)qe.callback(),qe=qe.next})},get:function(){for(var qe=[],$e=Se;$e;)qe.push($e),$e=$e.next;return qe},subscribe:function(qe){var $e=!0,gt=Be={callback:qe,next:null,prev:Be};return gt.prev?gt.prev.next=gt:Se=gt,function(){!$e||Se===null||($e=!1,gt.next?gt.next.prev=gt.prev:Be=gt.prev,gt.prev?gt.prev.next=gt.next:Se=gt.next)}}}}var At={notify:function(){},get:function(){return[]}};function Te(ve,Se){var Be,ze=At;function qe(on){return Qt(),ze.subscribe(on)}function $e(){ze.notify()}function gt(){dn.onStateChange&&dn.onStateChange()}function xt(){return!!Be}function Qt(){Be||(Be=Se?Se.addNestedSub(gt):ve.subscribe(gt),ze=ot())}function xn(){Be&&(Be(),Be=void 0,ze.clear(),ze=At)}var dn={addNestedSub:qe,notifyNestedSubs:$e,handleChangeWrapper:gt,isSubscribed:xt,trySubscribe:Qt,tryUnsubscribe:xn,getListeners:function(){return ze}};return dn}var ne=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?ue.useLayoutEffect:ue.useEffect;function te(ve){var Se=ve.store,Be=ve.context,ze=ve.children,qe=(0,ue.useMemo)(function(){var xt=Te(Se);return{store:Se,subscription:xt}},[Se]),$e=(0,ue.useMemo)(function(){return Se.getState()},[Se]);ne(function(){var xt=qe.subscription;return xt.onStateChange=xt.notifyNestedSubs,xt.trySubscribe(),$e!==Se.getState()&&xt.notifyNestedSubs(),function(){xt.tryUnsubscribe(),xt.onStateChange=null}},[qe,$e]);var gt=Be||Oe;return ue.createElement(gt.Provider,{value:qe},ze)}var de=te,se=Le(87488),pe=Le(94266),ye=Le.n(pe),we=Le(53410),be=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],Ie=["reactReduxForwardedRef"],Re=[],rt=[null,null],et=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 ut(ve,Se,Be){ne(function(){return ve.apply(void 0,Se)},Be)}function tt(ve,Se,Be,ze,qe,$e,gt){ve.current=ze,Se.current=qe,Be.current=!1,$e.current&&($e.current=null,gt())}function wt(ve,Se,Be,ze,qe,$e,gt,xt,Qt,xn){if(ve){var dn=!1,on=null,rn=function(){if(!dn){var Zr=Se.getState(),Ur,io;try{Ur=ze(Zr,qe.current)}catch(Co){io=Co,on=Co}io||(on=null),Ur===$e.current?gt.current||Qt():($e.current=Ur,xt.current=Ur,gt.current=!0,xn({type:"STORE_UPDATED",payload:{error:io}}))}};Be.onStateChange=rn,Be.trySubscribe(),rn();var Ln=function(){if(dn=!0,Be.tryUnsubscribe(),Be.onStateChange=null,on)throw on};return Ln}}var St=function(){return[null,0]};function Lt(ve,Se){Se===void 0&&(Se={});var Be=Se,ze=Be.getDisplayName,qe=ze===void 0?function(ja){return"ConnectAdvanced("+ja+")"}:ze,$e=Be.methodName,gt=$e===void 0?"connectAdvanced":$e,xt=Be.renderCountProp,Qt=xt===void 0?void 0:xt,xn=Be.shouldHandleStateChanges,dn=xn===void 0?!0:xn,on=Be.storeKey,rn=on===void 0?"store":on,Ln=Be.withRef,Bi=Ln===void 0?!1:Ln,Zr=Be.forwardRef,Ur=Zr===void 0?!1:Zr,io=Be.context,Co=io===void 0?Oe:io,Ho=(0,se.Z)(Be,be);if(0)var Ro;var da=Co;return function(es){var qs=es.displayName||es.name||"Component",Xa=qe(qs),Us=(0,yt.Z)({},Ho,{getDisplayName:qe,methodName:gt,renderCountProp:Qt,shouldHandleStateChanges:dn,storeKey:rn,displayName:Xa,wrappedComponentName:qs,WrappedComponent:es}),Nl=Ho.pure;function Hl(Rs){return ve(Rs.dispatch,Us)}var dh=Nl?ue.useMemo:function(Rs){return Rs()};function Eu(Rs){var Mh=(0,ue.useMemo)(function(){var Gs=Rs.reactReduxForwardedRef,Ou=(0,se.Z)(Rs,Ie);return[Rs.context,Gs,Ou]},[Rs]),Ys=Mh[0],ch=Mh[1],_c=Mh[2],fh=(0,ue.useMemo)(function(){return Ys&&Ys.Consumer&&(0,we.isContextConsumer)(ue.createElement(Ys.Consumer,null))?Ys:da},[Ys,da]),Jo=(0,ue.useContext)(fh),$d=!!Rs.store&&!!Rs.store.getState&&!!Rs.store.dispatch,Sg=!!Jo&&!!Jo.store,gh=$d?Rs.store:Jo.store,Xh=(0,ue.useMemo)(function(){return Hl(gh)},[gh]),Ld=(0,ue.useMemo)(function(){if(!dn)return rt;var Gs=Te(gh,$d?null:Jo.subscription),Ou=Gs.notifyNestedSubs.bind(Gs);return[Gs,Ou]},[gh,$d,Jo]),cu=Ld[0],kf=Ld[1],Af=(0,ue.useMemo)(function(){return $d?Jo:(0,yt.Z)({},Jo,{subscription:cu})},[$d,Jo,cu]),ip=(0,ue.useReducer)(Ye,Re,St),Gp=ip[0],wg=Gp[0],Ic=ip[1];if(wg&&wg.error)throw wg.error;var rp=(0,ue.useRef)(),Pg=(0,ue.useRef)(_c),Oc=(0,ue.useRef)(),Rc=(0,ue.useRef)(!1),Eg=dh(function(){return Oc.current&&_c===Pg.current?Oc.current:Xh(gh.getState(),_c)},[gh,wg,_c]);ut(tt,[Pg,rp,Rc,_c,Eg,Oc,kf]),ut(wt,[dn,gh,cu,Xh,Pg,rp,Rc,Oc,kf,Ic],[gh,cu,Xh]);var Ca=(0,ue.useMemo)(function(){return ue.createElement(es,(0,yt.Z)({},Eg,{ref:ch}))},[ch,es,Eg]),Wl=(0,ue.useMemo)(function(){return dn?ue.createElement(fh.Provider,{value:Af},Ca):Ca},[fh,Ca,Af]);return Wl}var du=Nl?ue.memo(Eu):Eu;if(du.WrappedComponent=es,du.displayName=Eu.displayName=Xa,Ur){var fl=ue.forwardRef(function(Mh,Ys){return ue.createElement(du,(0,yt.Z)({},Mh,{reactReduxForwardedRef:Ys}))});return fl.displayName=Xa,fl.WrappedComponent=es,ye()(fl,es)}return ye()(du,es)}}function mn(ve,Se){return ve===Se?ve!==0||Se!==0||1/ve===1/Se:ve!==ve&&Se!==Se}function $t(ve,Se){if(mn(ve,Se))return!0;if(typeof ve!="object"||ve===null||typeof Se!="object"||Se===null)return!1;var Be=Object.keys(ve),ze=Object.keys(Se);if(Be.length!==ze.length)return!1;for(var qe=0;qe<Be.length;qe++)if(!Object.prototype.hasOwnProperty.call(Se,Be[qe])||!mn(ve[Be[qe]],Se[Be[qe]]))return!1;return!0}function Pn(ve,Se){var Be={},ze=function(gt){var xt=ve[gt];typeof xt=="function"&&(Be[gt]=function(){return Se(xt.apply(void 0,arguments))})};for(var qe in ve)ze(qe);return Be}function Ot(ve){return function(Be,ze){var qe=ve(Be,ze);function $e(){return qe}return $e.dependsOnOwnProps=!1,$e}}function ct(ve){return ve.dependsOnOwnProps!==null&&ve.dependsOnOwnProps!==void 0?!!ve.dependsOnOwnProps:ve.length!==1}function nt(ve,Se){return function(ze,qe){var $e=qe.displayName,gt=function(Qt,xn){return gt.dependsOnOwnProps?gt.mapToProps(Qt,xn):gt.mapToProps(Qt)};return gt.dependsOnOwnProps=!0,gt.mapToProps=function(Qt,xn){gt.mapToProps=ve,gt.dependsOnOwnProps=ct(ve);var dn=gt(Qt,xn);return typeof dn=="function"&&(gt.mapToProps=dn,gt.dependsOnOwnProps=ct(dn),dn=gt(Qt,xn)),dn},gt}}function gn(ve){return typeof ve=="function"?nt(ve,"mapDispatchToProps"):void 0}function oi(ve){return ve?void 0:Ot(function(Se){return{dispatch:Se}})}function zn(ve){return ve&&typeof ve=="object"?Ot(function(Se){return Pn(ve,Se)}):void 0}var Ht=[gn,oi,zn];function Fn(ve){return typeof ve=="function"?nt(ve,"mapStateToProps"):void 0}function Cn(ve){return ve?void 0:Ot(function(){return{}})}var ii=[Fn,Cn];function Wt(ve,Se,Be){return(0,yt.Z)({},Be,ve,Se)}function Hn(ve){return function(Be,ze){var qe=ze.displayName,$e=ze.pure,gt=ze.areMergedPropsEqual,xt=!1,Qt;return function(dn,on,rn){var Ln=ve(dn,on,rn);return xt?(!$e||!gt(Ln,Qt))&&(Qt=Ln):(xt=!0,Qt=Ln),Qt}}}function lt(ve){return typeof ve=="function"?Hn(ve):void 0}function An(ve){return ve?void 0:function(){return Wt}}var Ni=[lt,An],je=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function Me(ve,Se,Be,ze){return function($e,gt){return Be(ve($e,gt),Se(ze,gt),gt)}}function Ee(ve,Se,Be,ze,qe){var $e=qe.areStatesEqual,gt=qe.areOwnPropsEqual,xt=qe.areStatePropsEqual,Qt=!1,xn,dn,on,rn,Ln;function Bi(Ho,Ro){return xn=Ho,dn=Ro,on=ve(xn,dn),rn=Se(ze,dn),Ln=Be(on,rn,dn),Qt=!0,Ln}function Zr(){return on=ve(xn,dn),Se.dependsOnOwnProps&&(rn=Se(ze,dn)),Ln=Be(on,rn,dn),Ln}function Ur(){return ve.dependsOnOwnProps&&(on=ve(xn,dn)),Se.dependsOnOwnProps&&(rn=Se(ze,dn)),Ln=Be(on,rn,dn),Ln}function io(){var Ho=ve(xn,dn),Ro=!xt(Ho,on);return on=Ho,Ro&&(Ln=Be(on,rn,dn)),Ln}function Co(Ho,Ro){var da=!gt(Ro,dn),ja=!$e(Ho,xn,Ro,dn);return xn=Ho,dn=Ro,da&&ja?Zr():da?Ur():ja?io():Ln}return function(Ro,da){return Qt?Co(Ro,da):Bi(Ro,da)}}function De(ve,Se){var Be=Se.initMapStateToProps,ze=Se.initMapDispatchToProps,qe=Se.initMergeProps,$e=(0,se.Z)(Se,je),gt=Be(ve,$e),xt=ze(ve,$e),Qt=qe(ve,$e),xn=$e.pure?Ee:Me;return xn(gt,xt,Qt,ve,$e)}var We=["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"];function Ae(ve,Se,Be){for(var ze=Se.length-1;ze>=0;ze--){var qe=Se[ze](ve);if(qe)return qe}return function($e,gt){throw new Error("Invalid value of type "+typeof ve+" for "+Be+" argument when connecting component "+gt.wrappedComponentName+".")}}function Je(ve,Se){return ve===Se}function Nt(ve){var Se=ve===void 0?{}:ve,Be=Se.connectHOC,ze=Be===void 0?Lt:Be,qe=Se.mapStateToPropsFactories,$e=qe===void 0?ii:qe,gt=Se.mapDispatchToPropsFactories,xt=gt===void 0?Ht:gt,Qt=Se.mergePropsFactories,xn=Qt===void 0?Ni:Qt,dn=Se.selectorFactory,on=dn===void 0?De:dn;return function(Ln,Bi,Zr,Ur){Ur===void 0&&(Ur={});var io=Ur,Co=io.pure,Ho=Co===void 0?!0:Co,Ro=io.areStatesEqual,da=Ro===void 0?Je:Ro,ja=io.areOwnPropsEqual,es=ja===void 0?$t:ja,qs=io.areStatePropsEqual,Xa=qs===void 0?$t:qs,Us=io.areMergedPropsEqual,Nl=Us===void 0?$t:Us,Hl=(0,se.Z)(io,We),dh=Ae(Ln,$e,"mapStateToProps"),Eu=Ae(Bi,xt,"mapDispatchToProps"),du=Ae(Zr,xn,"mergeProps");return ze(on,(0,yt.Z)({methodName:"connect",getDisplayName:function(Rs){return"Connect("+Rs+")"},shouldHandleStateChanges:!!Ln,initMapStateToProps:dh,initMapDispatchToProps:Eu,initMergeProps:du,pure:Ho,areStatesEqual:da,areOwnPropsEqual:es,areStatePropsEqual:Xa,areMergedPropsEqual:Nl},Hl))}}var fn=Nt();function vn(){var ve=useContext(ReactReduxContext);return ve}function Ft(ve){ve===void 0&&(ve=ReactReduxContext);var Se=ve===ReactReduxContext?useDefaultReduxContext:function(){return useContext(ve)};return function(){var ze=Se(),qe=ze.store;return qe}}var Jt=null;function jt(ve){ve===void 0&&(ve=ReactReduxContext);var Se=ve===ReactReduxContext?useDefaultStore:createStoreHook(ve);return function(){var ze=Se();return ze.dispatch}}var pn=null,jn=function(Se,Be){return Se===Be};function Nn(ve,Se,Be,ze){var qe=useReducer(function(Bi){return Bi+1},0),$e=qe[1],gt=useMemo(function(){return createSubscription(Be,ze)},[Be,ze]),xt=useRef(),Qt=useRef(),xn=useRef(),dn=useRef(),on=Be.getState(),rn;try{if(ve!==Qt.current||on!==xn.current||xt.current){var Ln=ve(on);dn.current===void 0||!Se(Ln,dn.current)?rn=Ln:rn=dn.current}else rn=dn.current}catch(Bi){throw xt.current&&(Bi.message+=`
|
|
The error may be correlated with this previous error:
|
|
`+xt.current.stack+`
|
|
|
|
`),Bi}return useIsomorphicLayoutEffect(function(){Qt.current=ve,xn.current=on,dn.current=rn,xt.current=void 0}),useIsomorphicLayoutEffect(function(){function Bi(){try{var Zr=Be.getState();if(Zr===xn.current)return;var Ur=Qt.current(Zr);if(Se(Ur,dn.current))return;dn.current=Ur,xn.current=Zr}catch(io){xt.current=io}$e()}return gt.onStateChange=Bi,gt.trySubscribe(),Bi(),function(){return gt.tryUnsubscribe()}},[Be,gt]),rn}function Mn(ve){ve===void 0&&(ve=ReactReduxContext);var Se=ve===ReactReduxContext?useDefaultReduxContext:function(){return useContext(ve)};return function(ze,qe){qe===void 0&&(qe=jn);var $e=Se(),gt=$e.store,xt=$e.subscription,Qt=Nn(ze,qe,gt,xt);return useDebugValue(Qt),Qt}}var fr=null,nn=Le(4676);Ge(nn.unstable_batchedUpdates);function tn(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 hn(ve,Se){var Be=(0,ue.useState)(function(){return{inputs:Se,result:ve()}})[0],ze=(0,ue.useRef)(!0),qe=(0,ue.useRef)(Be),$e=ze.current||!!(Se&&qe.current.inputs&&tn(Se,qe.current.inputs)),gt=$e?qe.current:{inputs:Se,result:ve()};return(0,ue.useEffect)(function(){ze.current=!1,qe.current=gt},[gt]),gt.result}function di(ve,Se){return hn(function(){return ve},Se)}var Sn=hn,Kt=di,gi=!0,Vi="Invariant failed";function Pi(ve,Se){if(!ve){if(gi)throw new Error(Vi);var Be=typeof Se=="function"?Se():Se,ze=Be?"".concat(Vi,": ").concat(Be):Vi;throw new Error(ze)}}var Ii=function(Se){var Be=Se.top,ze=Se.right,qe=Se.bottom,$e=Se.left,gt=ze-$e,xt=qe-Be,Qt={top:Be,right:ze,bottom:qe,left:$e,width:gt,height:xt,x:$e,y:Be,center:{x:(ze+$e)/2,y:(qe+Be)/2}};return Qt},Fr=function(Se,Be){return{top:Se.top-Be.top,left:Se.left-Be.left,bottom:Se.bottom+Be.bottom,right:Se.right+Be.right}},$n=function(Se,Be){return{top:Se.top+Be.top,left:Se.left+Be.left,bottom:Se.bottom-Be.bottom,right:Se.right-Be.right}},In=function(Se,Be){return{top:Se.top+Be.y,left:Se.left+Be.x,bottom:Se.bottom+Be.y,right:Se.right+Be.x}},si={top:0,right:0,bottom:0,left:0},Ti=function(Se){var Be=Se.borderBox,ze=Se.margin,qe=ze===void 0?si:ze,$e=Se.border,gt=$e===void 0?si:$e,xt=Se.padding,Qt=xt===void 0?si:xt,xn=Ii(Fr(Be,qe)),dn=Ii($n(Be,gt)),on=Ii($n(dn,Qt));return{marginBox:xn,borderBox:Ii(Be),paddingBox:dn,contentBox:on,margin:qe,border:gt,padding:Qt}},Oi=function(Se){var Be=Se.slice(0,-2),ze=Se.slice(-2);if(ze!=="px")return 0;var qe=Number(Be);return isNaN(qe)&&Pi(!1),qe},zi=function(){return{x:window.pageXOffset,y:window.pageYOffset}},xr=function(Se,Be){var ze=Se.borderBox,qe=Se.border,$e=Se.margin,gt=Se.padding,xt=In(ze,Be);return Ti({borderBox:xt,border:qe,margin:$e,padding:gt})},Ce=function(Se,Be){return Be===void 0&&(Be=zi()),xr(Se,Be)},_n=function(Se,Be){var ze={top:Oi(Be.marginTop),right:Oi(Be.marginRight),bottom:Oi(Be.marginBottom),left:Oi(Be.marginLeft)},qe={top:Oi(Be.paddingTop),right:Oi(Be.paddingRight),bottom:Oi(Be.paddingBottom),left:Oi(Be.paddingLeft)},$e={top:Oi(Be.borderTopWidth),right:Oi(Be.borderRightWidth),bottom:Oi(Be.borderBottomWidth),left:Oi(Be.borderLeftWidth)};return Ti({borderBox:Se,margin:ze,padding:qe,border:$e})},ci=function(Se){var Be=Se.getBoundingClientRect(),ze=window.getComputedStyle(Se);return _n(Be,ze)},ar=Number.isNaN||function(Se){return typeof Se=="number"&&Se!==Se};function _r(ve,Se){return!!(ve===Se||ar(ve)&&ar(Se))}function $r(ve,Se){if(ve.length!==Se.length)return!1;for(var Be=0;Be<ve.length;Be++)if(!_r(ve[Be],Se[Be]))return!1;return!0}function po(ve,Se){Se===void 0&&(Se=$r);var Be,ze=[],qe,$e=!1;function gt(){for(var xt=[],Qt=0;Qt<arguments.length;Qt++)xt[Qt]=arguments[Qt];return $e&&Be===this&&Se(xt,ze)||(qe=ve.apply(this,xt),$e=!0,Be=this,ze=xt),qe}return gt}var fi=po,Qn=function(Se){var Be=[],ze=null,qe=function(){for(var gt=arguments.length,xt=new Array(gt),Qt=0;Qt<gt;Qt++)xt[Qt]=arguments[Qt];Be=xt,!ze&&(ze=requestAnimationFrame(function(){ze=null,Se.apply(void 0,Be)}))};return qe.cancel=function(){ze&&(cancelAnimationFrame(ze),ze=null)},qe},Bt=Qn,Tt=!0,kt=/[ \t]{2,}/g,ui=/^[ \t]*/gm,Yn=function(Se){return Se.replace(kt," ").replace(ui,"").trim()},vi=function(Se){return Yn(`
|
|
%creact-beautiful-dnd
|
|
|
|
%c`+Yn(Se)+`
|
|
|
|
%c\u{1F477}\u200D This is a development only message. It will be removed in production builds.
|
|
`)},yn=function(Se){return[vi(Se),"color: #00C584; font-size: 1.2em; font-weight: bold;","line-height: 1.5","color: #723874;"]},Kn="__react-beautiful-dnd-disable-dev-warnings";function It(ve,Se){var Be;Tt||typeof window!="undefined"&&window[Kn]||(Be=console)[ve].apply(Be,yn(Se))}var _t=It.bind(null,"warn"),hi=It.bind(null,"error");function it(){}function sn(ve,Se){return(0,yt.Z)({},ve,{},Se)}function Dn(ve,Se,Be){var ze=Se.map(function(qe){var $e=sn(Be,qe.options);return ve.addEventListener(qe.eventName,qe.fn,$e),function(){ve.removeEventListener(qe.eventName,qe.fn,$e)}});return function(){ze.forEach(function($e){$e()})}}var Di=!0,cn="Invariant failed";function qt(ve){this.message=ve}qt.prototype.toString=function(){return this.message};function an(ve,Se){if(!ve)throw Di?new qt(cn):new qt(cn+": "+(Se||""))}var Gi=function(ve){ft(Se,ve);function Se(){for(var ze,qe=arguments.length,$e=new Array(qe),gt=0;gt<qe;gt++)$e[gt]=arguments[gt];return ze=ve.call.apply(ve,[this].concat($e))||this,ze.callbacks=null,ze.unbind=it,ze.onWindowError=function(xt){var Qt=ze.getCallbacks();Qt.isDragging()&&Qt.tryAbort();var xn=xt.error;xn instanceof qt&&xt.preventDefault()},ze.getCallbacks=function(){if(!ze.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return ze.callbacks},ze.setCallbacks=function(xt){ze.callbacks=xt},ze}var Be=Se.prototype;return Be.componentDidMount=function(){this.unbind=Dn(window,[{eventName:"error",fn:this.onWindowError}])},Be.componentWillUnmount=function(){this.unbind()},Be.componentDidCatch=function(qe){if(qe instanceof qt){this.setState({});return}throw qe},Be.render=function(){return this.props.children(this.setCallbacks)},Se}(ue.Component),ur=`
|
|
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
|
|
`,Hi=function(Se){return Se+1},Mi=function(Se){return`
|
|
You have lifted an item in position `+Hi(Se.source.index)+`
|
|
`},Ri=function(Se,Be){var ze=Se.droppableId===Be.droppableId,qe=Hi(Se.index),$e=Hi(Be.index);return ze?`
|
|
You have moved the item from position `+qe+`
|
|
to position `+$e+`
|
|
`:`
|
|
You have moved the item from position `+qe+`
|
|
in list `+Se.droppableId+`
|
|
to list `+Be.droppableId+`
|
|
in position `+$e+`
|
|
`},dr=function(Se,Be,ze){var qe=Be.droppableId===ze.droppableId;return qe?`
|
|
The item `+Se+`
|
|
has been combined with `+ze.draggableId:`
|
|
The item `+Se+`
|
|
in list `+Be.droppableId+`
|
|
has been combined with `+ze.draggableId+`
|
|
in list `+ze.droppableId+`
|
|
`},Er=function(Se){var Be=Se.destination;if(Be)return Ri(Se.source,Be);var ze=Se.combine;return ze?dr(Se.draggableId,Se.source,ze):"You are over an area that cannot be dropped on"},Ar=function(Se){return`
|
|
The item has returned to its starting position
|
|
of `+Hi(Se.index)+`
|
|
`},wn=function(Se){if(Se.reason==="CANCEL")return`
|
|
Movement cancelled.
|
|
`+Ar(Se.source)+`
|
|
`;var Be=Se.destination,ze=Se.combine;return Be?`
|
|
You have dropped the item.
|
|
`+Ri(Se.source,Be)+`
|
|
`:ze?`
|
|
You have dropped the item.
|
|
`+dr(Se.draggableId,Se.source,ze)+`
|
|
`:`
|
|
The item has been dropped while not over a drop area.
|
|
`+Ar(Se.source)+`
|
|
`},Yo={dragHandleUsageInstructions:ur,onDragStart:Mi,onDragUpdate:Er,onDragEnd:wn},zr={x:0,y:0},mo=function(Se,Be){return{x:Se.x+Be.x,y:Se.y+Be.y}},en=function(Se,Be){return{x:Se.x-Be.x,y:Se.y-Be.y}},li=function(Se,Be){return Se.x===Be.x&&Se.y===Be.y},nr=function(Se){return{x:Se.x!==0?-Se.x:0,y:Se.y!==0?-Se.y:0}},Sr=function(Se,Be,ze){var qe;return ze===void 0&&(ze=0),qe={},qe[Se]=Be,qe[Se==="x"?"y":"x"]=ze,qe},vr=function(Se,Be){return Math.sqrt(Math.pow(Be.x-Se.x,2)+Math.pow(Be.y-Se.y,2))},Ir=function(Se,Be){return Math.min.apply(Math,Be.map(function(ze){return vr(Se,ze)}))},bo=function(Se){return function(Be){return{x:Se(Be.x),y:Se(Be.y)}}},fo=function(ve,Se){var Be=Ii({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},so=function(Se,Be){return{top:Se.top+Be.y,left:Se.left+Be.x,bottom:Se.bottom+Be.y,right:Se.right+Be.x}},lo=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}]},Tn={top:0,right:0,bottom:0,left:0},qo=function(Se,Be){return Be?so(Se,Be.scroll.diff.displacement):Se},Zn=function(Se,Be,ze){if(ze&&ze.increasedBy){var qe;return(0,yt.Z)({},Se,(qe={},qe[Be.end]=Se[Be.end]+ze.increasedBy[Be.line],qe))}return Se},wr=function(Se,Be){return Be&&Be.shouldClipSubject?fo(Be.pageMarginBox,Se):Ii(Se)},Or=function(ve){var Se=ve.page,Be=ve.withPlaceholder,ze=ve.axis,qe=ve.frame,$e=qo(Se.marginBox,qe),gt=Zn($e,ze,Be),xt=wr(gt,qe);return{page:Se,withPlaceholder:Be,active:xt}},hr=function(ve,Se){ve.frame||an(!1);var Be=ve.frame,ze=en(Se,Be.scroll.initial),qe=nr(ze),$e=(0,yt.Z)({},Be,{scroll:{initial:Be.scroll.initial,current:Se,diff:{value:ze,displacement:qe},max:Be.scroll.max}}),gt=Or({page:ve.subject.page,withPlaceholder:ve.subject.withPlaceholder,axis:ve.axis,frame:$e}),xt=(0,yt.Z)({},ve,{frame:$e,subject:gt});return xt};function la(ve){return Number.isInteger?Number.isInteger(ve):typeof ve=="number"&&isFinite(ve)&&Math.floor(ve)===ve}function ca(ve){return Object.values?Object.values(ve):Object.keys(ve).map(function(Se){return ve[Se]})}function Qo(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 zo(ve,Se){if(ve.find)return ve.find(Se);var Be=Qo(ve,Se);if(Be!==-1)return ve[Be]}function Vt(ve){return Array.prototype.slice.call(ve)}var On=fi(function(ve){return ve.reduce(function(Se,Be){return Se[Be.descriptor.id]=Be,Se},{})}),Ut=fi(function(ve){return ve.reduce(function(Se,Be){return Se[Be.descriptor.id]=Be,Se},{})}),_e=fi(function(ve){return ca(ve)}),pi=fi(function(ve){return ca(ve)}),Vn=fi(function(ve,Se){var Be=pi(Se).filter(function(ze){return ve===ze.descriptor.droppableId}).sort(function(ze,qe){return ze.descriptor.index-qe.descriptor.index});return Be});function qn(ve){return ve.at&&ve.at.type==="REORDER"?ve.at.destination:null}function ki(ve){return ve.at&&ve.at.type==="COMBINE"?ve.at.combine:null}var Wi=fi(function(ve,Se){return Se.filter(function(Be){return Be.descriptor.id!==ve.descriptor.id})}),Wn=function(ve){var Se=ve.isMovingForward,Be=ve.draggable,ze=ve.destination,qe=ve.insideDestination,$e=ve.previousImpact;if(!ze.isCombineEnabled)return null;var gt=qn($e);if(!gt)return null;function xt(Zr){var Ur={type:"COMBINE",combine:{draggableId:Zr,droppableId:ze.descriptor.id}};return(0,yt.Z)({},$e,{at:Ur})}var Qt=$e.displaced.all,xn=Qt.length?Qt[0]:null;if(Se)return xn?xt(xn):null;var dn=Wi(Be,qe);if(!xn){if(!dn.length)return null;var on=dn[dn.length-1];return xt(on.descriptor.id)}var rn=Qo(dn,function(Zr){return Zr.descriptor.id===xn});rn===-1&&an(!1);var Ln=rn-1;if(Ln<0)return null;var Bi=dn[Ln];return xt(Bi.descriptor.id)},mi=function(ve,Se){return ve.descriptor.droppableId===Se.descriptor.id},Si={point:zr,value:0},Ei={invisible:{},visible:{},all:[]},bi={displaced:Ei,displacedBy:Si,at:null},gr=function(ve,Se){return function(Be){return ve<=Be&&Be<=Se}},qi=function(ve){var Se=gr(ve.top,ve.bottom),Be=gr(ve.left,ve.right);return function(ze){var qe=Se(ze.top)&&Se(ze.bottom)&&Be(ze.left)&&Be(ze.right);if(qe)return!0;var $e=Se(ze.top)||Se(ze.bottom),gt=Be(ze.left)||Be(ze.right),xt=$e&>if(xt)return!0;var Qt=ze.top<ve.top&&ze.bottom>ve.bottom,xn=ze.left<ve.left&&ze.right>ve.right,dn=Qt&&xn;if(dn)return!0;var on=Qt&>||xn&&$e;return on}},Ui=function(ve){var Se=gr(ve.top,ve.bottom),Be=gr(ve.left,ve.right);return function(ze){var qe=Se(ze.top)&&Se(ze.bottom)&&Be(ze.left)&&Be(ze.right);return qe}},bn={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},Yi={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},rr=function(ve){return function(Se){var Be=gr(Se.top,Se.bottom),ze=gr(Se.left,Se.right);return function(qe){return ve===bn?Be(qe.top)&&Be(qe.bottom):ze(qe.left)&&ze(qe.right)}}},Po=function(Se,Be){var ze=Be.frame?Be.frame.scroll.diff.displacement:zr;return so(Se,ze)},uo=function(Se,Be,ze){return Be.subject.active?ze(Be.subject.active)(Se):!1},No=function(Se,Be,ze){return ze(Be)(Se)},Do=function(Se){var Be=Se.target,ze=Se.destination,qe=Se.viewport,$e=Se.withDroppableDisplacement,gt=Se.isVisibleThroughFrameFn,xt=$e?Po(Be,ze):Be;return uo(xt,ze,gt)&&No(xt,qe,gt)},Io=function(Se){return Do((0,yt.Z)({},Se,{isVisibleThroughFrameFn:qi}))},fa=function(Se){return Do((0,yt.Z)({},Se,{isVisibleThroughFrameFn:Ui}))},na=function(Se){return Do((0,yt.Z)({},Se,{isVisibleThroughFrameFn:rr(Se.destination.axis)}))},za=function(Se,Be,ze){if(typeof ze=="boolean")return ze;if(!Be)return!0;var qe=Be.invisible,$e=Be.visible;if(qe[Se])return!1;var gt=$e[Se];return gt?gt.shouldAnimate:!0};function zt(ve,Se){var Be=ve.page.marginBox,ze={top:Se.point.y,right:0,bottom:0,left:Se.point.x};return Ii(Fr(Be,ze))}function To(ve){var Se=ve.afterDragging,Be=ve.destination,ze=ve.displacedBy,qe=ve.viewport,$e=ve.forceShouldAnimate,gt=ve.last;return Se.reduce(function(Qt,xn){var dn=zt(xn,ze),on=xn.descriptor.id;Qt.all.push(on);var rn=Io({target:dn,destination:Be,viewport:qe,withDroppableDisplacement:!0});if(!rn)return Qt.invisible[xn.descriptor.id]=!0,Qt;var Ln=za(on,gt,$e),Bi={draggableId:on,shouldAnimate:Ln};return Qt.visible[on]=Bi,Qt},{all:[],visible:{},invisible:{}})}function Pr(ve,Se){if(!ve.length)return 0;var Be=ve[ve.length-1].descriptor.index;return Se.inHomeList?Be:Be+1}function eo(ve){var Se=ve.insideDestination,Be=ve.inHomeList,ze=ve.displacedBy,qe=ve.destination,$e=Pr(Se,{inHomeList:Be});return{displaced:Ei,displacedBy:ze,at:{type:"REORDER",destination:{droppableId:qe.descriptor.id,index:$e}}}}function Zo(ve){var Se=ve.draggable,Be=ve.insideDestination,ze=ve.destination,qe=ve.viewport,$e=ve.displacedBy,gt=ve.last,xt=ve.index,Qt=ve.forceShouldAnimate,xn=mi(Se,ze);if(xt==null)return eo({insideDestination:Be,inHomeList:xn,displacedBy:$e,destination:ze});var dn=zo(Be,function(Zr){return Zr.descriptor.index===xt});if(!dn)return eo({insideDestination:Be,inHomeList:xn,displacedBy:$e,destination:ze});var on=Wi(Se,Be),rn=Be.indexOf(dn),Ln=on.slice(rn),Bi=To({afterDragging:Ln,destination:ze,displacedBy:$e,last:gt,viewport:qe.frame,forceShouldAnimate:Qt});return{displaced:Bi,displacedBy:$e,at:{type:"REORDER",destination:{droppableId:ze.descriptor.id,index:xt}}}}function Wr(ve,Se){return!!Se.effected[ve]}var ba=function(ve){var Se=ve.isMovingForward,Be=ve.destination,ze=ve.draggables,qe=ve.combine,$e=ve.afterCritical;if(!Be.isCombineEnabled)return null;var gt=qe.draggableId,xt=ze[gt],Qt=xt.descriptor.index,xn=Wr(gt,$e);return xn?Se?Qt:Qt-1:Se?Qt+1:Qt},ga=function(ve){var Se=ve.isMovingForward,Be=ve.isInHomeList,ze=ve.insideDestination,qe=ve.location;if(!ze.length)return null;var $e=qe.index,gt=Se?$e+1:$e-1,xt=ze[0].descriptor.index,Qt=ze[ze.length-1].descriptor.index,xn=Be?Qt:Qt+1;return gt<xt||gt>xn?null:gt},Uo=function(ve){var Se=ve.isMovingForward,Be=ve.isInHomeList,ze=ve.draggable,qe=ve.draggables,$e=ve.destination,gt=ve.insideDestination,xt=ve.previousImpact,Qt=ve.viewport,xn=ve.afterCritical,dn=xt.at;if(dn||an(!1),dn.type==="REORDER"){var on=ga({isMovingForward:Se,isInHomeList:Be,location:dn.destination,insideDestination:gt});return on==null?null:Zo({draggable:ze,insideDestination:gt,destination:$e,viewport:Qt,last:xt.displaced,displacedBy:xt.displacedBy,index:on})}var rn=ba({isMovingForward:Se,destination:$e,displaced:xt.displaced,draggables:qe,combine:dn.combine,afterCritical:xn});return rn==null?null:Zo({draggable:ze,insideDestination:gt,destination:$e,viewport:Qt,last:xt.displaced,displacedBy:xt.displacedBy,index:rn})},Fo=function(ve){var Se=ve.displaced,Be=ve.afterCritical,ze=ve.combineWith,qe=ve.displacedBy,$e=!!(Se.visible[ze]||Se.invisible[ze]);return Wr(ze,Be)?$e?zr:nr(qe.point):$e?qe.point:zr},vs=function(ve){var Se=ve.afterCritical,Be=ve.impact,ze=ve.draggables,qe=ki(Be);qe||an(!1);var $e=qe.draggableId,gt=ze[$e].page.borderBox.center,xt=Fo({displaced:Be.displaced,afterCritical:Se,combineWith:$e,displacedBy:Be.displacedBy});return mo(gt,xt)},Qa=function(Se,Be){return Be.margin[Se.start]+Be.borderBox[Se.size]/2},ns=function(Se,Be){return Be.margin[Se.end]+Be.borderBox[Se.size]/2},ds=function(Se,Be,ze){return Be[Se.crossAxisStart]+ze.margin[Se.crossAxisStart]+ze.borderBox[Se.crossAxisSize]/2},Vr=function(Se){var Be=Se.axis,ze=Se.moveRelativeTo,qe=Se.isMoving;return Sr(Be.line,ze.marginBox[Be.end]+Qa(Be,qe),ds(Be,ze.marginBox,qe))},wa=function(Se){var Be=Se.axis,ze=Se.moveRelativeTo,qe=Se.isMoving;return Sr(Be.line,ze.marginBox[Be.start]-ns(Be,qe),ds(Be,ze.marginBox,qe))},Ba=function(Se){var Be=Se.axis,ze=Se.moveInto,qe=Se.isMoving;return Sr(Be.line,ze.contentBox[Be.start]+Qa(Be,qe),ds(Be,ze.contentBox,qe))},is=function(ve){var Se=ve.impact,Be=ve.draggable,ze=ve.draggables,qe=ve.droppable,$e=ve.afterCritical,gt=Vn(qe.descriptor.id,ze),xt=Be.page,Qt=qe.axis;if(!gt.length)return Ba({axis:Qt,moveInto:qe.page,isMoving:xt});var xn=Se.displaced,dn=Se.displacedBy,on=xn.all[0];if(on){var rn=ze[on];if(Wr(on,$e))return wa({axis:Qt,moveRelativeTo:rn.page,isMoving:xt});var Ln=xr(rn.page,dn.point);return wa({axis:Qt,moveRelativeTo:Ln,isMoving:xt})}var Bi=gt[gt.length-1];if(Bi.descriptor.id===Be.descriptor.id)return xt.borderBox.center;if(Wr(Bi.descriptor.id,$e)){var Zr=xr(Bi.page,nr($e.displacedBy.point));return Vr({axis:Qt,moveRelativeTo:Zr,isMoving:xt})}return Vr({axis:Qt,moveRelativeTo:Bi.page,isMoving:xt})},Vo=function(ve,Se){var Be=ve.frame;return Be?mo(Se,Be.scroll.diff.displacement):Se},Ko=function(Se){var Be=Se.impact,ze=Se.draggable,qe=Se.droppable,$e=Se.draggables,gt=Se.afterCritical,xt=ze.page.borderBox.center,Qt=Be.at;return!qe||!Qt?xt:Qt.type==="REORDER"?is({impact:Be,draggable:ze,draggables:$e,droppable:qe,afterCritical:gt}):vs({impact:Be,draggables:$e,afterCritical:gt})},ni=function(ve){var Se=Ko(ve),Be=ve.droppable,ze=Be?Vo(Be,Se):Se;return ze},to=function(ve,Se){var Be=en(Se,ve.scroll.initial),ze=nr(Be),qe=Ii({top:Se.y,bottom:Se.y+ve.frame.height,left:Se.x,right:Se.x+ve.frame.width}),$e={frame:qe,scroll:{initial:ve.scroll.initial,max:ve.scroll.max,current:Se,diff:{value:Be,displacement:ze}}};return $e};function Xo(ve,Se){return ve.map(function(Be){return Se[Be]})}function Ia(ve,Se){for(var Be=0;Be<Se.length;Be++){var ze=Se[Be].visible[ve];if(ze)return ze}return null}var ms=function(ve){var Se=ve.impact,Be=ve.viewport,ze=ve.destination,qe=ve.draggables,$e=ve.maxScrollChange,gt=to(Be,mo(Be.scroll.current,$e)),xt=ze.frame?hr(ze,mo(ze.frame.scroll.current,$e)):ze,Qt=Se.displaced,xn=To({afterDragging:Xo(Qt.all,qe),destination:ze,displacedBy:Se.displacedBy,viewport:gt.frame,last:Qt,forceShouldAnimate:!1}),dn=To({afterDragging:Xo(Qt.all,qe),destination:xt,displacedBy:Se.displacedBy,viewport:Be.frame,last:Qt,forceShouldAnimate:!1}),on={},rn={},Ln=[Qt,xn,dn];Qt.all.forEach(function(Zr){var Ur=Ia(Zr,Ln);if(Ur){rn[Zr]=Ur;return}on[Zr]=!0});var Bi=(0,yt.Z)({},Se,{displaced:{all:Qt.all,invisible:on,visible:rn}});return Bi},cs=function(ve,Se){return mo(ve.scroll.diff.displacement,Se)},yo=function(ve){var Se=ve.pageBorderBoxCenter,Be=ve.draggable,ze=ve.viewport,qe=cs(ze,Se),$e=en(qe,Be.page.borderBox.center);return mo(Be.client.borderBox.center,$e)},as=function(ve){var Se=ve.draggable,Be=ve.destination,ze=ve.newPageBorderBoxCenter,qe=ve.viewport,$e=ve.withDroppableDisplacement,gt=ve.onlyOnMainAxis,xt=gt===void 0?!1:gt,Qt=en(ze,Se.page.borderBox.center),xn=so(Se.page.borderBox,Qt),dn={target:xn,destination:Be,withDroppableDisplacement:$e,viewport:qe};return xt?na(dn):fa(dn)},ls=function(ve){var Se=ve.isMovingForward,Be=ve.draggable,ze=ve.destination,qe=ve.draggables,$e=ve.previousImpact,gt=ve.viewport,xt=ve.previousPageBorderBoxCenter,Qt=ve.previousClientSelection,xn=ve.afterCritical;if(!ze.isEnabled)return null;var dn=Vn(ze.descriptor.id,qe),on=mi(Be,ze),rn=Wn({isMovingForward:Se,draggable:Be,destination:ze,insideDestination:dn,previousImpact:$e})||Uo({isMovingForward:Se,isInHomeList:on,draggable:Be,draggables:qe,destination:ze,insideDestination:dn,previousImpact:$e,viewport:gt,afterCritical:xn});if(!rn)return null;var Ln=ni({impact:rn,draggable:Be,droppable:ze,draggables:qe,afterCritical:xn}),Bi=as({draggable:Be,destination:ze,newPageBorderBoxCenter:Ln,viewport:gt.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});if(Bi){var Zr=yo({pageBorderBoxCenter:Ln,draggable:Be,viewport:gt});return{clientSelection:Zr,impact:rn,scrollJumpRequest:null}}var Ur=en(Ln,xt),io=ms({impact:rn,viewport:gt,destination:ze,draggables:qe,maxScrollChange:Ur});return{clientSelection:Qt,impact:io,scrollJumpRequest:Ur}},Yt=function(Se){var Be=Se.subject.active;return Be||an(!1),Be},Xt=function(ve){var Se=ve.isMovingForward,Be=ve.pageBorderBoxCenter,ze=ve.source,qe=ve.droppables,$e=ve.viewport,gt=ze.subject.active;if(!gt)return null;var xt=ze.axis,Qt=gr(gt[xt.start],gt[xt.end]),xn=_e(qe).filter(function(on){return on!==ze}).filter(function(on){return on.isEnabled}).filter(function(on){return!!on.subject.active}).filter(function(on){return qi($e.frame)(Yt(on))}).filter(function(on){var rn=Yt(on);return Se?gt[xt.crossAxisEnd]<rn[xt.crossAxisEnd]:rn[xt.crossAxisStart]<gt[xt.crossAxisStart]}).filter(function(on){var rn=Yt(on),Ln=gr(rn[xt.start],rn[xt.end]);return Qt(rn[xt.start])||Qt(rn[xt.end])||Ln(gt[xt.start])||Ln(gt[xt.end])}).sort(function(on,rn){var Ln=Yt(on)[xt.crossAxisStart],Bi=Yt(rn)[xt.crossAxisStart];return Se?Ln-Bi:Bi-Ln}).filter(function(on,rn,Ln){return Yt(on)[xt.crossAxisStart]===Yt(Ln[0])[xt.crossAxisStart]});if(!xn.length)return null;if(xn.length===1)return xn[0];var dn=xn.filter(function(on){var rn=gr(Yt(on)[xt.start],Yt(on)[xt.end]);return rn(Be[xt.line])});return dn.length===1?dn[0]:dn.length>1?dn.sort(function(on,rn){return Yt(on)[xt.start]-Yt(rn)[xt.start]})[0]:xn.sort(function(on,rn){var Ln=Ir(Be,lo(Yt(on))),Bi=Ir(Be,lo(Yt(rn)));return Ln!==Bi?Ln-Bi:Yt(on)[xt.start]-Yt(rn)[xt.start]})[0]},kn=function(Se,Be){var ze=Se.page.borderBox.center;return Wr(Se.descriptor.id,Be)?en(ze,Be.displacedBy.point):ze},Zi=function(Se,Be){var ze=Se.page.borderBox;return Wr(Se.descriptor.id,Be)?so(ze,nr(Be.displacedBy.point)):ze},yi=function(ve){var Se=ve.pageBorderBoxCenter,Be=ve.viewport,ze=ve.destination,qe=ve.insideDestination,$e=ve.afterCritical,gt=qe.filter(function(xt){return fa({target:Zi(xt,$e),destination:ze,viewport:Be.frame,withDroppableDisplacement:!0})}).sort(function(xt,Qt){var xn=vr(Se,Vo(ze,kn(xt,$e))),dn=vr(Se,Vo(ze,kn(Qt,$e)));return xn<dn?-1:dn<xn?1:xt.descriptor.index-Qt.descriptor.index});return gt[0]||null},Ai=fi(function(Se,Be){var ze=Be[Se.line];return{value:ze,point:Sr(Se.line,ze)}}),Li=function(Se,Be,ze){var qe=Se.axis;if(Se.descriptor.mode==="virtual")return Sr(qe.line,Be[qe.line]);var $e=Se.subject.page.contentBox[qe.size],gt=Vn(Se.descriptor.id,ze),xt=gt.reduce(function(dn,on){return dn+on.client.marginBox[qe.size]},0),Qt=xt+Be[qe.line],xn=Qt-$e;return xn<=0?null:Sr(qe.line,xn)},Rn=function(Se,Be){return(0,yt.Z)({},Se,{scroll:(0,yt.Z)({},Se.scroll,{max:Be})})},ri=function(Se,Be,ze){var qe=Se.frame;mi(Be,Se)&&an(!1),Se.subject.withPlaceholder&&an(!1);var $e=Ai(Se.axis,Be.displaceBy).point,gt=Li(Se,$e,ze),xt={placeholderSize:$e,increasedBy:gt,oldFrameMaxScroll:Se.frame?Se.frame.scroll.max:null};if(!qe){var Qt=Or({page:Se.subject.page,withPlaceholder:xt,axis:Se.axis,frame:Se.frame});return(0,yt.Z)({},Se,{subject:Qt})}var xn=gt?mo(qe.scroll.max,gt):qe.scroll.max,dn=Rn(qe,xn),on=Or({page:Se.subject.page,withPlaceholder:xt,axis:Se.axis,frame:dn});return(0,yt.Z)({},Se,{subject:on,frame:dn})},ir=function(Se){var Be=Se.subject.withPlaceholder;Be||an(!1);var ze=Se.frame;if(!ze){var qe=Or({page:Se.subject.page,axis:Se.axis,frame:null,withPlaceholder:null});return(0,yt.Z)({},Se,{subject:qe})}var $e=Be.oldFrameMaxScroll;$e||an(!1);var gt=Rn(ze,$e),xt=Or({page:Se.subject.page,axis:Se.axis,frame:gt,withPlaceholder:null});return(0,yt.Z)({},Se,{subject:xt,frame:gt})},Rr=function(ve){var Se=ve.previousPageBorderBoxCenter,Be=ve.moveRelativeTo,ze=ve.insideDestination,qe=ve.draggable,$e=ve.draggables,gt=ve.destination,xt=ve.viewport,Qt=ve.afterCritical;if(!Be){if(ze.length)return null;var xn={displaced:Ei,displacedBy:Si,at:{type:"REORDER",destination:{droppableId:gt.descriptor.id,index:0}}},dn=ni({impact:xn,draggable:qe,droppable:gt,draggables:$e,afterCritical:Qt}),on=mi(qe,gt)?gt:ri(gt,qe,$e),rn=as({draggable:qe,destination:on,newPageBorderBoxCenter:dn,viewport:xt.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});return rn?xn:null}var Ln=Se[gt.axis.line]<=Be.page.borderBox.center[gt.axis.line],Bi=function(){var Ur=Be.descriptor.index;return Be.descriptor.id===qe.descriptor.id||Ln?Ur:Ur+1}(),Zr=Ai(gt.axis,qe.displaceBy);return Zo({draggable:qe,insideDestination:ze,destination:gt,viewport:xt,displacedBy:Zr,last:Ei,index:Bi})},ea=function(ve){var Se=ve.isMovingForward,Be=ve.previousPageBorderBoxCenter,ze=ve.draggable,qe=ve.isOver,$e=ve.draggables,gt=ve.droppables,xt=ve.viewport,Qt=ve.afterCritical,xn=Xt({isMovingForward:Se,pageBorderBoxCenter:Be,source:qe,droppables:gt,viewport:xt});if(!xn)return null;var dn=Vn(xn.descriptor.id,$e),on=yi({pageBorderBoxCenter:Be,viewport:xt,destination:xn,insideDestination:dn,afterCritical:Qt}),rn=Rr({previousPageBorderBoxCenter:Be,destination:xn,draggable:ze,draggables:$e,moveRelativeTo:on,insideDestination:dn,viewport:xt,afterCritical:Qt});if(!rn)return null;var Ln=ni({impact:rn,draggable:ze,droppable:xn,draggables:$e,afterCritical:Qt}),Bi=yo({pageBorderBoxCenter:Ln,draggable:ze,viewport:xt});return{clientSelection:Bi,impact:rn,scrollJumpRequest:null}},_o=function(ve){var Se=ve.at;return Se?Se.type==="REORDER"?Se.destination.droppableId:Se.combine.droppableId:null},Pa=function(Se,Be){var ze=_o(Se);return ze?Be[ze]:null},xa=function(ve){var Se=ve.state,Be=ve.type,ze=Pa(Se.impact,Se.dimensions.droppables),qe=!!ze,$e=Se.dimensions.droppables[Se.critical.droppable.id],gt=ze||$e,xt=gt.axis.direction,Qt=xt==="vertical"&&(Be==="MOVE_UP"||Be==="MOVE_DOWN")||xt==="horizontal"&&(Be==="MOVE_LEFT"||Be==="MOVE_RIGHT");if(Qt&&!qe)return null;var xn=Be==="MOVE_DOWN"||Be==="MOVE_RIGHT",dn=Se.dimensions.draggables[Se.critical.draggable.id],on=Se.current.page.borderBoxCenter,rn=Se.dimensions,Ln=rn.draggables,Bi=rn.droppables;return Qt?ls({isMovingForward:xn,previousPageBorderBoxCenter:on,draggable:dn,destination:gt,draggables:Ln,viewport:Se.viewport,previousClientSelection:Se.current.client.selection,previousImpact:Se.impact,afterCritical:Se.afterCritical}):ea({isMovingForward:xn,previousPageBorderBoxCenter:on,draggable:dn,isOver:gt,draggables:Ln,droppables:Bi,viewport:Se.viewport,afterCritical:Se.afterCritical})};function vo(ve){return ve.phase==="DRAGGING"||ve.phase==="COLLECTING"}function Kr(ve){var Se=gr(ve.top,ve.bottom),Be=gr(ve.left,ve.right);return function(qe){return Se(qe.y)&&Be(qe.x)}}function er(ve,Se){return ve.left<Se.right&&ve.right>Se.left&&ve.top<Se.bottom&&ve.bottom>Se.top}function ia(ve){var Se=ve.pageBorderBox,Be=ve.draggable,ze=ve.candidates,qe=Be.page.borderBox.center,$e=ze.map(function(gt){var xt=gt.axis,Qt=Sr(gt.axis.line,Se.center[xt.line],gt.page.borderBox.center[xt.crossAxisLine]);return{id:gt.descriptor.id,distance:vr(qe,Qt)}}).sort(function(gt,xt){return xt.distance-gt.distance});return $e[0]?$e[0].id:null}function sa(ve){var Se=ve.pageBorderBox,Be=ve.draggable,ze=ve.droppables,qe=_e(ze).filter(function($e){if(!$e.isEnabled)return!1;var gt=$e.subject.active;if(!gt||!er(Se,gt))return!1;if(Kr(gt)(Se.center))return!0;var xt=$e.axis,Qt=gt.center[xt.crossAxisLine],xn=Se[xt.crossAxisStart],dn=Se[xt.crossAxisEnd],on=gr(gt[xt.crossAxisStart],gt[xt.crossAxisEnd]),rn=on(xn),Ln=on(dn);return!rn&&!Ln?!0:rn?xn<Qt:dn>Qt});return qe.length?qe.length===1?qe[0].descriptor.id:ia({pageBorderBox:Se,draggable:Be,candidates:qe}):null}var Ma=function(Se,Be){return Ii(so(Se,Be))},Oa=function(ve,Se){var Be=ve.frame;return Be?Ma(Se,Be.scroll.diff.value):Se};function Oo(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,ze=ve.inHomeList;return Be?ze&&Be.descriptor.index>Se.descriptor.index?Be.descriptor.index-1:Be.descriptor.index:null}var Lo=function(ve){var Se=ve.pageBorderBoxWithDroppableScroll,Be=ve.draggable,ze=ve.destination,qe=ve.insideDestination,$e=ve.last,gt=ve.viewport,xt=ve.afterCritical,Qt=ze.axis,xn=Ai(ze.axis,Be.displaceBy),dn=xn.value,on=Se[Qt.start],rn=Se[Qt.end],Ln=Wi(Be,qe),Bi=zo(Ln,function(Ur){var io=Ur.descriptor.id,Co=Ur.page.borderBox.center[Qt.line],Ho=Wr(io,xt),Ro=Oo({displaced:$e,id:io});return Ho?Ro?rn<=Co:on<Co-dn:Ro?rn<=Co+dn:on<Co}),Zr=ua({draggable:Be,closest:Bi,inHomeList:mi(Be,ze)});return Zo({draggable:Be,insideDestination:qe,destination:ze,viewport:gt,last:$e,displacedBy:xn,index:Zr})},jr=4,oo=function(ve){var Se=ve.draggable,Be=ve.pageBorderBoxWithDroppableScroll,ze=ve.previousImpact,qe=ve.destination,$e=ve.insideDestination,gt=ve.afterCritical;if(!qe.isCombineEnabled)return null;var xt=qe.axis,Qt=Ai(qe.axis,Se.displaceBy),xn=Qt.value,dn=Be[xt.start],on=Be[xt.end],rn=Wi(Se,$e),Ln=zo(rn,function(Zr){var Ur=Zr.descriptor.id,io=Zr.page.borderBox,Co=io[xt.size],Ho=Co/jr,Ro=Wr(Ur,gt),da=Oo({displaced:ze.displaced,id:Ur});return Ro?da?on>io[xt.start]+Ho&&on<io[xt.end]-Ho:dn>io[xt.start]-xn+Ho&&dn<io[xt.end]-xn-Ho:da?on>io[xt.start]+xn+Ho&&on<io[xt.end]+xn-Ho:dn>io[xt.start]+Ho&&dn<io[xt.end]-Ho});if(!Ln)return null;var Bi={displacedBy:Qt,displaced:ze.displaced,at:{type:"COMBINE",combine:{draggableId:Ln.descriptor.id,droppableId:qe.descriptor.id}}};return Bi},Yr=function(ve){var Se=ve.pageOffset,Be=ve.draggable,ze=ve.draggables,qe=ve.droppables,$e=ve.previousImpact,gt=ve.viewport,xt=ve.afterCritical,Qt=Ma(Be.page.borderBox,Se),xn=sa({pageBorderBox:Qt,draggable:Be,droppables:qe});if(!xn)return bi;var dn=qe[xn],on=Vn(dn.descriptor.id,ze),rn=Oa(dn,Qt);return oo({pageBorderBoxWithDroppableScroll:rn,draggable:Be,previousImpact:$e,destination:dn,insideDestination:on,afterCritical:xt})||Lo({pageBorderBoxWithDroppableScroll:rn,draggable:Be,destination:dn,insideDestination:on,last:$e.displaced,viewport:gt,afterCritical:xt})},wo=function(ve,Se){var Be;return(0,yt.Z)({},ve,(Be={},Be[Se.descriptor.id]=Se,Be))},Ra=function(Se){var Be=Se.previousImpact,ze=Se.impact,qe=Se.droppables,$e=_o(Be),gt=_o(ze);if(!$e||$e===gt)return qe;var xt=qe[$e];if(!xt.subject.withPlaceholder)return qe;var Qt=ir(xt);return wo(qe,Qt)},Ha=function(ve){var Se=ve.draggable,Be=ve.draggables,ze=ve.droppables,qe=ve.previousImpact,$e=ve.impact,gt=Ra({previousImpact:qe,impact:$e,droppables:ze}),xt=_o($e);if(!xt)return gt;var Qt=ze[xt];if(mi(Se,Qt)||Qt.subject.withPlaceholder)return gt;var xn=ri(Qt,Se,Be);return wo(gt,xn)},Mt=function(ve){var Se=ve.state,Be=ve.clientSelection,ze=ve.dimensions,qe=ve.viewport,$e=ve.impact,gt=ve.scrollJumpRequest,xt=qe||Se.viewport,Qt=ze||Se.dimensions,xn=Be||Se.current.client.selection,dn=en(xn,Se.initial.client.selection),on={offset:dn,selection:xn,borderBoxCenter:mo(Se.initial.client.borderBoxCenter,dn)},rn={selection:mo(on.selection,xt.scroll.current),borderBoxCenter:mo(on.borderBoxCenter,xt.scroll.current),offset:mo(on.offset,xt.scroll.diff.value)},Ln={client:on,page:rn};if(Se.phase==="COLLECTING")return(0,yt.Z)({phase:"COLLECTING"},Se,{dimensions:Qt,viewport:xt,current:Ln});var Bi=Qt.draggables[Se.critical.draggable.id],Zr=$e||Yr({pageOffset:rn.offset,draggable:Bi,draggables:Qt.draggables,droppables:Qt.droppables,previousImpact:Se.impact,viewport:xt,afterCritical:Se.afterCritical}),Ur=Ha({draggable:Bi,impact:Zr,previousImpact:Se.impact,draggables:Qt.draggables,droppables:Qt.droppables}),io=(0,yt.Z)({},Se,{current:Ln,dimensions:{draggables:Qt.draggables,droppables:Ur},impact:Zr,viewport:xt,scrollJumpRequest:gt||null,forceShouldAnimate:gt?!1:null});return io};function Pt(ve,Se){return ve.map(function(Be){return Se[Be]})}var ln=function(ve){var Se=ve.impact,Be=ve.viewport,ze=ve.draggables,qe=ve.destination,$e=ve.forceShouldAnimate,gt=Se.displaced,xt=Pt(gt.all,ze),Qt=To({afterDragging:xt,destination:qe,displacedBy:Se.displacedBy,viewport:Be.frame,forceShouldAnimate:$e,last:gt});return(0,yt.Z)({},Se,{displaced:Qt})},He=function(ve){var Se=ve.impact,Be=ve.draggable,ze=ve.droppable,qe=ve.draggables,$e=ve.viewport,gt=ve.afterCritical,xt=ni({impact:Se,draggable:Be,draggables:qe,droppable:ze,afterCritical:gt});return yo({pageBorderBoxCenter:xt,draggable:Be,viewport:$e})},Dt=function(ve){var Se=ve.state,Be=ve.dimensions,ze=ve.viewport;Se.movementMode!=="SNAP"&&an(!1);var qe=Se.impact,$e=ze||Se.viewport,gt=Be||Se.dimensions,xt=gt.draggables,Qt=gt.droppables,xn=xt[Se.critical.draggable.id],dn=_o(qe);dn||an(!1);var on=Qt[dn],rn=ln({impact:qe,viewport:$e,destination:on,draggables:xt}),Ln=He({impact:rn,draggable:xn,droppable:on,draggables:xt,viewport:$e,afterCritical:Se.afterCritical});return Mt({impact:rn,clientSelection:Ln,state:Se,dimensions:gt,viewport:$e})},Xi=function(ve){return{index:ve.index,droppableId:ve.droppableId}},Mr=function(ve){var Se=ve.draggable,Be=ve.home,ze=ve.draggables,qe=ve.viewport,$e=Ai(Be.axis,Se.displaceBy),gt=Vn(Be.descriptor.id,ze),xt=gt.indexOf(Se);xt===-1&&an(!1);var Qt=gt.slice(xt+1),xn=Qt.reduce(function(Ln,Bi){return Ln[Bi.descriptor.id]=!0,Ln},{}),dn={inVirtualList:Be.descriptor.mode==="virtual",displacedBy:$e,effected:xn},on=To({afterDragging:Qt,destination:Be,displacedBy:$e,last:null,viewport:qe.frame,forceShouldAnimate:!1}),rn={displaced:on,displacedBy:$e,at:{type:"REORDER",destination:Xi(Se.descriptor)}};return{impact:rn,afterCritical:dn}},Qi=function(ve,Se){return{draggables:ve.draggables,droppables:wo(ve.droppables,Se)}},$i=function(Se){},wi=function(Se){},pr=function(ve){var Se=ve.draggable,Be=ve.offset,ze=ve.initialWindowScroll,qe=xr(Se.client,Be),$e=Ce(qe,ze),gt=(0,yt.Z)({},Se,{placeholder:(0,yt.Z)({},Se.placeholder,{client:qe}),client:qe,page:$e});return gt},Hr=function(ve){var Se=ve.frame;return Se||an(!1),Se},no=function(ve){var Se=ve.additions,Be=ve.updatedDroppables,ze=ve.viewport,qe=ze.scroll.diff.value;return Se.map(function($e){var gt=$e.descriptor.droppableId,xt=Be[gt],Qt=Hr(xt),xn=Qt.scroll.diff.value,dn=mo(qe,xn),on=pr({draggable:$e,offset:dn,initialWindowScroll:ze.scroll.initial});return on})},lr=function(ve){var Se=ve.state,Be=ve.published;$i();var ze=Be.modified.map(function(Ho){var Ro=Se.dimensions.droppables[Ho.droppableId],da=hr(Ro,Ho.scroll);return da}),qe=(0,yt.Z)({},Se.dimensions.droppables,{},On(ze)),$e=Ut(no({additions:Be.additions,updatedDroppables:qe,viewport:Se.viewport})),gt=(0,yt.Z)({},Se.dimensions.draggables,{},$e);Be.removals.forEach(function(Ho){delete gt[Ho]});var xt={droppables:qe,draggables:gt},Qt=_o(Se.impact),xn=Qt?xt.droppables[Qt]:null,dn=xt.draggables[Se.critical.draggable.id],on=xt.droppables[Se.critical.droppable.id],rn=Mr({draggable:dn,home:on,draggables:gt,viewport:Se.viewport}),Ln=rn.impact,Bi=rn.afterCritical,Zr=xn&&xn.isCombineEnabled?Se.impact:Ln,Ur=Yr({pageOffset:Se.current.page.offset,draggable:xt.draggables[Se.critical.draggable.id],draggables:xt.draggables,droppables:xt.droppables,previousImpact:Zr,viewport:Se.viewport,afterCritical:Bi});wi();var io=(0,yt.Z)({phase:"DRAGGING"},Se,{phase:"DRAGGING",impact:Ur,onLiftImpact:Ln,dimensions:xt,afterCritical:Bi,forceShouldAnimate:!1});if(Se.phase==="COLLECTING")return io;var Co=(0,yt.Z)({phase:"DROP_PENDING"},io,{phase:"DROP_PENDING",reason:Se.reason,isWaiting:!1});return Co},cr=function(Se){return Se.movementMode==="SNAP"},yr=function(Se,Be,ze){var qe=Qi(Se.dimensions,Be);return!cr(Se)||ze?Mt({state:Se,dimensions:qe}):Dt({state:Se,dimensions:qe})};function _i(ve){return ve.isDragging&&ve.movementMode==="SNAP"?(0,yt.Z)({phase:"DRAGGING"},ve,{scrollJumpRequest:null}):ve}var Ci={phase:"IDLE",completed:null,shouldFlush:!1},Dr=function(ve,Se){if(ve===void 0&&(ve=Ci),Se.type==="FLUSH")return(0,yt.Z)({},Ci,{shouldFlush:!0});if(Se.type==="INITIAL_PUBLISH"){ve.phase!=="IDLE"&&an(!1);var Be=Se.payload,ze=Be.critical,qe=Be.clientSelection,$e=Be.viewport,gt=Be.dimensions,xt=Be.movementMode,Qt=gt.draggables[ze.draggable.id],xn=gt.droppables[ze.droppable.id],dn={selection:qe,borderBoxCenter:Qt.client.borderBox.center,offset:zr},on={client:dn,page:{selection:mo(dn.selection,$e.scroll.initial),borderBoxCenter:mo(dn.selection,$e.scroll.initial),offset:mo(dn.selection,$e.scroll.diff.value)}},rn=_e(gt.droppables).every(function(Af){return!Af.isFixedOnPage}),Ln=Mr({draggable:Qt,home:xn,draggables:gt.draggables,viewport:$e}),Bi=Ln.impact,Zr=Ln.afterCritical,Ur={phase:"DRAGGING",isDragging:!0,critical:ze,movementMode:xt,dimensions:gt,initial:on,current:on,isWindowScrollAllowed:rn,impact:Bi,afterCritical:Zr,onLiftImpact:Bi,viewport:$e,scrollJumpRequest:null,forceShouldAnimate:null};return Ur}if(Se.type==="COLLECTION_STARTING"){if(ve.phase==="COLLECTING"||ve.phase==="DROP_PENDING")return ve;ve.phase!=="DRAGGING"&&an(!1);var io=(0,yt.Z)({phase:"COLLECTING"},ve,{phase:"COLLECTING"});return io}if(Se.type==="PUBLISH_WHILE_DRAGGING")return ve.phase==="COLLECTING"||ve.phase==="DROP_PENDING"||an(!1),lr({state:ve,published:Se.payload});if(Se.type==="MOVE"){if(ve.phase==="DROP_PENDING")return ve;vo(ve)||an(!1);var Co=Se.payload.client;return li(Co,ve.current.client.selection)?ve:Mt({state:ve,clientSelection:Co,impact:cr(ve)?ve.impact:null})}if(Se.type==="UPDATE_DROPPABLE_SCROLL"){if(ve.phase==="DROP_PENDING"||ve.phase==="COLLECTING")return _i(ve);vo(ve)||an(!1);var Ho=Se.payload,Ro=Ho.id,da=Ho.newScroll,ja=ve.dimensions.droppables[Ro];if(!ja)return ve;var es=hr(ja,da);return yr(ve,es,!1)}if(Se.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(ve.phase==="DROP_PENDING")return ve;vo(ve)||an(!1);var qs=Se.payload,Xa=qs.id,Us=qs.isEnabled,Nl=ve.dimensions.droppables[Xa];Nl||an(!1),Nl.isEnabled===Us&&an(!1);var Hl=(0,yt.Z)({},Nl,{isEnabled:Us});return yr(ve,Hl,!0)}if(Se.type==="UPDATE_DROPPABLE_IS_COMBINE_ENABLED"){if(ve.phase==="DROP_PENDING")return ve;vo(ve)||an(!1);var dh=Se.payload,Eu=dh.id,du=dh.isCombineEnabled,fl=ve.dimensions.droppables[Eu];fl||an(!1),fl.isCombineEnabled===du&&an(!1);var Rs=(0,yt.Z)({},fl,{isCombineEnabled:du});return yr(ve,Rs,!0)}if(Se.type==="MOVE_BY_WINDOW_SCROLL"){if(ve.phase==="DROP_PENDING"||ve.phase==="DROP_ANIMATING")return ve;vo(ve)||an(!1),ve.isWindowScrollAllowed||an(!1);var Mh=Se.payload.newScroll;if(li(ve.viewport.scroll.current,Mh))return _i(ve);var Ys=to(ve.viewport,Mh);return cr(ve)?Dt({state:ve,viewport:Ys}):Mt({state:ve,viewport:Ys})}if(Se.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!vo(ve))return ve;var ch=Se.payload.maxScroll;if(li(ch,ve.viewport.scroll.max))return ve;var _c=(0,yt.Z)({},ve.viewport,{scroll:(0,yt.Z)({},ve.viewport.scroll,{max:ch})});return(0,yt.Z)({phase:"DRAGGING"},ve,{viewport:_c})}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"&&an(!1);var fh=xa({state:ve,type:Se.type});return fh?Mt({state:ve,impact:fh.impact,clientSelection:fh.clientSelection,scrollJumpRequest:fh.scrollJumpRequest}):ve}if(Se.type==="DROP_PENDING"){var Jo=Se.payload.reason;ve.phase!=="COLLECTING"&&an(!1);var $d=(0,yt.Z)({phase:"DROP_PENDING"},ve,{phase:"DROP_PENDING",isWaiting:!0,reason:Jo});return $d}if(Se.type==="DROP_ANIMATE"){var Sg=Se.payload,gh=Sg.completed,Xh=Sg.dropDuration,Ld=Sg.newHomeClientOffset;ve.phase==="DRAGGING"||ve.phase==="DROP_PENDING"||an(!1);var cu={phase:"DROP_ANIMATING",completed:gh,dropDuration:Xh,newHomeClientOffset:Ld,dimensions:ve.dimensions};return cu}if(Se.type==="DROP_COMPLETE"){var kf=Se.payload.completed;return{phase:"IDLE",completed:kf,shouldFlush:!1}}return ve},ko=function(Se){return{type:"BEFORE_INITIAL_CAPTURE",payload:Se}},br=function(Se){return{type:"LIFT",payload:Se}},Cr=function(Se){return{type:"INITIAL_PUBLISH",payload:Se}},Nr=function(Se){return{type:"PUBLISH_WHILE_DRAGGING",payload:Se}},Tr=function(){return{type:"COLLECTION_STARTING",payload:null}},sr=function(Se){return{type:"UPDATE_DROPPABLE_SCROLL",payload:Se}},ra=function(Se){return{type:"UPDATE_DROPPABLE_IS_ENABLED",payload:Se}},Bo=function(Se){return{type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:Se}},ta=function(Se){return{type:"MOVE",payload:Se}},Sa=function(Se){return{type:"MOVE_BY_WINDOW_SCROLL",payload:Se}},ro=function(Se){return{type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:Se}},ha=function(){return{type:"MOVE_UP",payload:null}},As=function(){return{type:"MOVE_DOWN",payload:null}},kr=function(){return{type:"MOVE_RIGHT",payload:null}},$a=function(){return{type:"MOVE_LEFT",payload:null}},Eo=function(){return{type:"FLUSH",payload:null}},ts=function(Se){return{type:"DROP_ANIMATE",payload:Se}},ys=function(Se){return{type:"DROP_COMPLETE",payload:Se}},Ol=function(Se){return{type:"DROP",payload:Se}},ku=function(Se){return{type:"DROP_PENDING",payload:Se}},mu=function(){return{type:"DROP_ANIMATION_FINISHED",payload:null}};function Ll(ve){if(!(ve.length<=1)){for(var Se=ve.map(function(xt){return xt.descriptor.index}),Be={},ze=1;ze<Se.length;ze++){var qe=Se[ze],$e=Se[ze-1];qe!==$e+1&&(Be[qe]=!0)}if(Object.keys(Be).length)var gt=Se.map(function(xt){var Qt=!!Be[xt];return Qt?"[\u{1F525}"+xt+"]":""+xt}).join(", ")}}function ru(ve,Se){if(0)var Be}var ka=function(ve){return function(Se){var Be=Se.getState,ze=Se.dispatch;return function(qe){return function($e){if($e.type!=="LIFT"){qe($e);return}var gt=$e.payload,xt=gt.id,Qt=gt.clientSelection,xn=gt.movementMode,dn=Be();dn.phase==="DROP_ANIMATING"&&ze(ys({completed:dn.completed})),Be().phase!=="IDLE"&&an(!1),ze(Eo()),ze(ko({draggableId:xt,movementMode:xn}));var on={shouldPublishImmediately:xn==="SNAP"},rn={draggableId:xt,scrollOptions:on},Ln=ve.startPublishing(rn),Bi=Ln.critical,Zr=Ln.dimensions,Ur=Ln.viewport;ru(Bi,Zr),ze(Cr({critical:Bi,dimensions:Zr,clientSelection:Qt,movementMode:xn,viewport:Ur}))}}}},tl=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)}}}},ou={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},Bl={opacity:{drop:0,combining:.7},scale:{drop:.75}},ih={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},ul=ih.outOfTheWay+"s "+ou.outOfTheWay,pa={fluid:"opacity "+ul,snap:"transform "+ul+", opacity "+ul,drop:function(Se){var Be=Se+"s "+ou.drop;return"transform "+Be+", opacity "+Be},outOfTheWay:"transform "+ul,placeholder:"height "+ul+", width "+ul+", margin "+ul},Fa=function(Se){return li(Se,zr)?null:"translate("+Se.x+"px, "+Se.y+"px)"},us={moveTo:Fa,drop:function(Se,Be){var ze=Fa(Se);return ze?Be?ze+" scale("+Bl.scale.drop+")":ze:null}},Ts=ih.minDropTime,_s=ih.maxDropTime,vu=_s-Ts,Jl=1500,yu=.6,Jn=function(ve){var Se=ve.current,Be=ve.destination,ze=ve.reason,qe=vr(Se,Be);if(qe<=0)return Ts;if(qe>=Jl)return _s;var $e=qe/Jl,gt=Ts+vu*$e,xt=ze==="CANCEL"?gt*yu:gt;return Number(xt.toFixed(2))},Xr=function(ve){var Se=ve.impact,Be=ve.draggable,ze=ve.dimensions,qe=ve.viewport,$e=ve.afterCritical,gt=ze.draggables,xt=ze.droppables,Qt=_o(Se),xn=Qt?xt[Qt]:null,dn=xt[Be.descriptor.droppableId],on=He({impact:Se,draggable:Be,draggables:gt,afterCritical:$e,droppable:xn||dn,viewport:qe}),rn=en(on,Be.client.borderBox.center);return rn},Aa=function(ve){var Se=ve.draggables,Be=ve.reason,ze=ve.lastImpact,qe=ve.home,$e=ve.viewport,gt=ve.onLiftImpact;if(!ze.at||Be!=="DROP"){var xt=ln({draggables:Se,impact:gt,destination:qe,viewport:$e,forceShouldAnimate:!0});return{impact:xt,didDropInsideDroppable:!1}}if(ze.at.type==="REORDER")return{impact:ze,didDropInsideDroppable:!0};var Qt=(0,yt.Z)({},ze,{displaced:Ei});return{impact:Qt,didDropInsideDroppable:!0}},Go=function(ve){var Se=ve.getState,Be=ve.dispatch;return function(ze){return function(qe){if(qe.type!=="DROP"){ze(qe);return}var $e=Se(),gt=qe.payload.reason;if($e.phase==="COLLECTING"){Be(ku({reason:gt}));return}if($e.phase!=="IDLE"){var xt=$e.phase==="DROP_PENDING"&&$e.isWaiting;xt&&an(!1),$e.phase==="DRAGGING"||$e.phase==="DROP_PENDING"||an(!1);var Qt=$e.critical,xn=$e.dimensions,dn=xn.draggables[$e.critical.draggable.id],on=Aa({reason:gt,lastImpact:$e.impact,afterCritical:$e.afterCritical,onLiftImpact:$e.onLiftImpact,home:$e.dimensions.droppables[$e.critical.droppable.id],viewport:$e.viewport,draggables:$e.dimensions.draggables}),rn=on.impact,Ln=on.didDropInsideDroppable,Bi=Ln?qn(rn):null,Zr=Ln?ki(rn):null,Ur={index:Qt.draggable.index,droppableId:Qt.droppable.id},io={draggableId:dn.descriptor.id,type:dn.descriptor.type,source:Ur,reason:gt,mode:$e.movementMode,destination:Bi,combine:Zr},Co=Xr({impact:rn,draggable:dn,dimensions:xn,viewport:$e.viewport,afterCritical:$e.afterCritical}),Ho={critical:$e.critical,afterCritical:$e.afterCritical,result:io,impact:rn},Ro=!li($e.current.client.offset,Co)||!!io.combine;if(!Ro){Be(ys({completed:Ho}));return}var da=Jn({current:$e.current.client.offset,destination:Co,reason:gt}),ja={newHomeClientOffset:Co,dropDuration:da,completed:Ho};Be(ts(ja))}}}},Lr=function(){return{x:window.pageXOffset,y:window.pageYOffset}};function Wa(ve){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(Be){Be.target!==window&&Be.target!==window.document||ve()}}}function aa(ve){var Se=ve.onWindowScroll;function Be(){Se(Lr())}var ze=Bt(Be),qe=Wa(ze),$e=it;function gt(){return $e!==it}function xt(){gt()&&an(!1),$e=Dn(window,[qe])}function Qt(){gt()||an(!1),ze.cancel(),$e(),$e=it}return{start:xt,stop:Qt,isActive:gt}}var qa=function(Se){return Se.type==="DROP_COMPLETE"||Se.type==="DROP_ANIMATE"||Se.type==="FLUSH"},xo=function(ve){var Se=aa({onWindowScroll:function(ze){ve.dispatch(Sa({newScroll:ze}))}});return function(Be){return function(ze){!Se.isActive()&&ze.type==="INITIAL_PUBLISH"&&Se.start(),Se.isActive()&&qa(ze)&&Se.stop(),Be(ze)}}},Va=function(ve){var Se=!1,Be=!1,ze=setTimeout(function(){Be=!0}),qe=function(gt){Se||Be||(Se=!0,ve(gt),clearTimeout(ze))};return qe.wasCalled=function(){return Se},qe},Ea=function(){var ve=[],Se=function($e){var gt=Qo(ve,function(xn){return xn.timerId===$e});gt===-1&&an(!1);var xt=ve.splice(gt,1),Qt=xt[0];Qt.callback()},Be=function($e){var gt=setTimeout(function(){return Se(gt)}),xt={timerId:gt,callback:$e};ve.push(xt)},ze=function(){if(ve.length){var $e=[].concat(ve);ve.length=0,$e.forEach(function(gt){clearTimeout(gt.timerId),gt.callback()})}};return{add:Be,flush:ze}},Cs=function(Se,Be){return Se==null&&Be==null?!0:Se==null||Be==null?!1:Se.droppableId===Be.droppableId&&Se.index===Be.index},Au=function(Se,Be){return Se==null&&Be==null?!0:Se==null||Be==null?!1:Se.draggableId===Be.draggableId&&Se.droppableId===Be.droppableId},So=function(Se,Be){if(Se===Be)return!0;var ze=Se.draggable.id===Be.draggable.id&&Se.draggable.droppableId===Be.draggable.droppableId&&Se.draggable.type===Be.draggable.type&&Se.draggable.index===Be.draggable.index,qe=Se.droppable.id===Be.droppable.id&&Se.droppable.type===Be.droppable.type;return ze&&qe},js=function(Se,Be){$i(),Be(),wi()},Ml=function(Se,Be){return{draggableId:Se.draggable.id,type:Se.droppable.type,source:{droppableId:Se.droppable.id,index:Se.draggable.index},mode:Be}},Xs=function(Se,Be,ze,qe){if(!Se){ze(qe(Be));return}var $e=Va(ze),gt={announce:$e};Se(Be,gt),$e.wasCalled()||ze(qe(Be))},Is=function(ve,Se){var Be=Ea(),ze=null,qe=function(rn,Ln){ze&&an(!1),js("onBeforeCapture",function(){var Bi=ve().onBeforeCapture;if(Bi){var Zr={draggableId:rn,mode:Ln};Bi(Zr)}})},$e=function(rn,Ln){ze&&an(!1),js("onBeforeDragStart",function(){var Bi=ve().onBeforeDragStart;Bi&&Bi(Ml(rn,Ln))})},gt=function(rn,Ln){ze&&an(!1);var Bi=Ml(rn,Ln);ze={mode:Ln,lastCritical:rn,lastLocation:Bi.source,lastCombine:null},Be.add(function(){js("onDragStart",function(){return Xs(ve().onDragStart,Bi,Se,Yo.onDragStart)})})},xt=function(rn,Ln){var Bi=qn(Ln),Zr=ki(Ln);ze||an(!1);var Ur=!So(rn,ze.lastCritical);Ur&&(ze.lastCritical=rn);var io=!Cs(ze.lastLocation,Bi);io&&(ze.lastLocation=Bi);var Co=!Au(ze.lastCombine,Zr);if(Co&&(ze.lastCombine=Zr),!(!Ur&&!io&&!Co)){var Ho=(0,yt.Z)({},Ml(rn,ze.mode),{combine:Zr,destination:Bi});Be.add(function(){js("onDragUpdate",function(){return Xs(ve().onDragUpdate,Ho,Se,Yo.onDragUpdate)})})}},Qt=function(){ze||an(!1),Be.flush()},xn=function(rn){ze||an(!1),ze=null,js("onDragEnd",function(){return Xs(ve().onDragEnd,rn,Se,Yo.onDragEnd)})},dn=function(){if(ze){var rn=(0,yt.Z)({},Ml(ze.lastCritical,ze.mode),{combine:null,destination:null,reason:"CANCEL"});xn(rn)}};return{beforeCapture:qe,beforeStart:$e,start:gt,update:xt,flush:Qt,drop:xn,abort:dn}},Ch=function(ve,Se){var Be=Is(ve,Se);return function(ze){return function(qe){return function($e){if($e.type==="BEFORE_INITIAL_CAPTURE"){Be.beforeCapture($e.payload.draggableId,$e.payload.movementMode);return}if($e.type==="INITIAL_PUBLISH"){var gt=$e.payload.critical;Be.beforeStart(gt,$e.payload.movementMode),qe($e),Be.start(gt,$e.payload.movementMode);return}if($e.type==="DROP_COMPLETE"){var xt=$e.payload.completed.result;Be.flush(),qe($e),Be.drop(xt);return}if(qe($e),$e.type==="FLUSH"){Be.abort();return}var Qt=ze.getState();Qt.phase==="DRAGGING"&&Be.update(Qt.critical,Qt.impact)}}}},Ka=function(ve){return function(Se){return function(Be){if(Be.type!=="DROP_ANIMATION_FINISHED"){Se(Be);return}var ze=ve.getState();ze.phase!=="DROP_ANIMATING"&&an(!1),ve.dispatch(ys({completed:ze.completed}))}}},vl=function(ve){var Se=null,Be=null;function ze(){Be&&(cancelAnimationFrame(Be),Be=null),Se&&(Se(),Se=null)}return function(qe){return function($e){if(($e.type==="FLUSH"||$e.type==="DROP_COMPLETE"||$e.type==="DROP_ANIMATION_FINISHED")&&ze(),qe($e),$e.type==="DROP_ANIMATE"){var gt={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){var Qt=ve.getState();Qt.phase==="DROP_ANIMATING"&&ve.dispatch(mu())}};Be=requestAnimationFrame(function(){Be=null,Se=Dn(window,[gt])})}}}},bh=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)}}}},Ih=function(ve){var Se=!1;return function(){return function(Be){return function(ze){if(ze.type==="INITIAL_PUBLISH"){Se=!0,ve.tryRecordFocus(ze.payload.critical.draggable.id),Be(ze),ve.tryRestoreFocusRecorded();return}if(Be(ze),!!Se){if(ze.type==="FLUSH"){Se=!1,ve.tryRestoreFocusRecorded();return}if(ze.type==="DROP_COMPLETE"){Se=!1;var qe=ze.payload.completed.result;qe.combine&&ve.tryShiftRecord(qe.draggableId,qe.combine.draggableId),ve.tryRestoreFocusRecorded()}}}}}},Oh=function(Se){return Se.type==="DROP_COMPLETE"||Se.type==="DROP_ANIMATE"||Se.type==="FLUSH"},sf=function(ve){return function(Se){return function(Be){return function(ze){if(Oh(ze)){ve.stop(),Be(ze);return}if(ze.type==="INITIAL_PUBLISH"){Be(ze);var qe=Se.getState();qe.phase!=="DRAGGING"&&an(!1),ve.start(qe);return}Be(ze),ve.scroll(Se.getState())}}}},Vs=function(ve){return function(Se){return function(Be){if(Se(Be),Be.type==="PUBLISH_WHILE_DRAGGING"){var ze=ve.getState();ze.phase==="DROP_PENDING"&&(ze.isWaiting||ve.dispatch(Ol({reason:ze.reason})))}}}},ol=mt.qC,sd=function(ve){var Se=ve.dimensionMarshal,Be=ve.focusMarshal,ze=ve.styleMarshal,qe=ve.getResponders,$e=ve.announce,gt=ve.autoScroller;return(0,mt.MT)(Dr,ol((0,mt.md)(tl(ze),bh(Se),ka(Se),Go,Ka,vl,Vs,sf(gt),xo,Ih(Be),Ch(qe,$e))))},Rl=function(){return{additions:{},removals:{},modified:{}}};function Rh(ve){var Se=ve.registry,Be=ve.callbacks,ze=Rl(),qe=null,$e=function(){qe||(Be.collectionStarting(),qe=requestAnimationFrame(function(){qe=null,$i();var dn=ze,on=dn.additions,rn=dn.removals,Ln=dn.modified,Bi=Object.keys(on).map(function(io){return Se.draggable.getById(io).getDimension(zr)}).sort(function(io,Co){return io.descriptor.index-Co.descriptor.index}),Zr=Object.keys(Ln).map(function(io){var Co=Se.droppable.getById(io),Ho=Co.callbacks.getScrollWhileDragging();return{droppableId:io,scroll:Ho}}),Ur={additions:Bi,removals:Object.keys(rn),modified:Zr};ze=Rl(),wi(),Be.publish(Ur)}))},gt=function(dn){var on=dn.descriptor.id;ze.additions[on]=dn,ze.modified[dn.descriptor.droppableId]=!0,ze.removals[on]&&delete ze.removals[on],$e()},xt=function(dn){var on=dn.descriptor;ze.removals[on.id]=!0,ze.modified[on.droppableId]=!0,ze.additions[on.id]&&delete ze.additions[on.id],$e()},Qt=function(){qe&&(cancelAnimationFrame(qe),qe=null,ze=Rl())};return{add:gt,remove:xt,stop:Qt}}var jl=function(ve){var Se=ve.scrollHeight,Be=ve.scrollWidth,ze=ve.height,qe=ve.width,$e=en({x:Be,y:Se},{x:qe,y:ze}),gt={x:Math.max(0,$e.x),y:Math.max(0,$e.y)};return gt},Os=function(){var ve=document.documentElement;return ve||an(!1),ve},Nu=function(){var ve=Os(),Se=jl({scrollHeight:ve.scrollHeight,scrollWidth:ve.scrollWidth,width:ve.clientWidth,height:ve.clientHeight});return Se},au=function(){var ve=Lr(),Se=Nu(),Be=ve.y,ze=ve.x,qe=Os(),$e=qe.clientWidth,gt=qe.clientHeight,xt=ze+$e,Qt=Be+gt,xn=Ii({top:Be,left:ze,right:xt,bottom:Qt}),dn={frame:xn,scroll:{initial:ve,current:ve,max:Se,diff:{value:zr,displacement:zr}}};return dn},al=function(ve){var Se=ve.critical,Be=ve.scrollOptions,ze=ve.registry;$i();var qe=au(),$e=qe.scroll.current,gt=Se.droppable,xt=ze.droppable.getAllByType(gt.type).map(function(on){return on.callbacks.getDimensionAndWatchScroll($e,Be)}),Qt=ze.draggable.getAllByType(Se.draggable.type).map(function(on){return on.getDimension($e)}),xn={draggables:Ut(Qt),droppables:On(xt)};wi();var dn={dimensions:xn,critical:Se,viewport:qe};return dn};function su(ve,Se,Be){if(Be.descriptor.id===Se.id||Be.descriptor.type!==Se.type)return!1;var ze=ve.droppable.getById(Be.descriptor.droppableId);return ze.descriptor.mode==="virtual"}var ss=function(ve,Se){var Be=null,ze=Rh({callbacks:{publish:Se.publishWhileDragging,collectionStarting:Se.collectionStarting},registry:ve}),qe=function(Ln,Bi){ve.droppable.exists(Ln)||an(!1),Be&&Se.updateDroppableIsEnabled({id:Ln,isEnabled:Bi})},$e=function(Ln,Bi){Be&&(ve.droppable.exists(Ln)||an(!1),Se.updateDroppableIsCombineEnabled({id:Ln,isCombineEnabled:Bi}))},gt=function(Ln,Bi){Be&&(ve.droppable.exists(Ln)||an(!1),Se.updateDroppableScroll({id:Ln,newScroll:Bi}))},xt=function(Ln,Bi){Be&&ve.droppable.getById(Ln).callbacks.scroll(Bi)},Qt=function(){if(Be){ze.stop();var Ln=Be.critical.droppable;ve.droppable.getAllByType(Ln.type).forEach(function(Bi){return Bi.callbacks.dragStopped()}),Be.unsubscribe(),Be=null}},xn=function(Ln){Be||an(!1);var Bi=Be.critical.draggable;Ln.type==="ADDITION"&&su(ve,Bi,Ln.value)&&ze.add(Ln.value),Ln.type==="REMOVAL"&&su(ve,Bi,Ln.value)&&ze.remove(Ln.value)},dn=function(Ln){Be&&an(!1);var Bi=ve.draggable.getById(Ln.draggableId),Zr=ve.droppable.getById(Bi.descriptor.droppableId),Ur={draggable:Bi.descriptor,droppable:Zr.descriptor},io=ve.subscribe(xn);return Be={critical:Ur,unsubscribe:io},al({critical:Ur,registry:ve,scrollOptions:Ln.scrollOptions})},on={updateDroppableIsEnabled:qe,updateDroppableIsCombineEnabled:$e,scrollDroppable:xt,updateDroppableScroll:gt,startPublishing:dn,stopPublishing:Qt};return on},xu=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)},jh=fi(function(ve){return _e(ve).filter(function(Se){return!(!Se.isEnabled||!Se.frame)})}),ld=function(Se,Be){var ze=zo(jh(Be),function(qe){return qe.frame||an(!1),Kr(qe.frame.pageMarginBox)(Se)});return ze},xc=function(ve){var Se=ve.center,Be=ve.destination,ze=ve.droppables;if(Be){var qe=ze[Be];return qe.frame?qe:null}var $e=ld(Se,ze);return $e},Su={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:function(Se){return Math.pow(Se,2)},durationDampening:{stopDampeningAt:1200,accelerateAt:360}},Sc=function(ve,Se){var Be=ve[Se.size]*Su.startFromPercentage,ze=ve[Se.size]*Su.maxScrollAtPercentage,qe={startScrollingFrom:Be,maxScrollValueAt:ze};return qe},Na=function(ve){var Se=ve.startOfRange,Be=ve.endOfRange,ze=ve.current,qe=Be-Se;if(qe===0)return 0;var $e=ze-Se,gt=$e/qe;return gt},ud=1,Uf=function(ve,Se){if(ve>Se.startScrollingFrom)return 0;if(ve<=Se.maxScrollValueAt)return Su.maxPixelScroll;if(ve===Se.startScrollingFrom)return ud;var Be=Na({startOfRange:Se.maxScrollValueAt,endOfRange:Se.startScrollingFrom,current:ve}),ze=1-Be,qe=Su.maxPixelScroll*Su.ease(ze);return Math.ceil(qe)},wc=Su.durationDampening.accelerateAt,Du=Su.durationDampening.stopDampeningAt,lf=function(ve,Se){var Be=Se,ze=Du,qe=Date.now(),$e=qe-Be;if($e>=Du)return ve;if($e<wc)return ud;var gt=Na({startOfRange:wc,endOfRange:ze,current:$e}),xt=ve*Su.ease(gt);return Math.ceil(xt)},Rd=function(ve){var Se=ve.distanceToEdge,Be=ve.thresholds,ze=ve.dragStartTime,qe=ve.shouldUseTimeDampening,$e=Uf(Se,Be);return $e===0?0:qe?Math.max(lf($e,ze),ud):$e},Hg=function(ve){var Se=ve.container,Be=ve.distanceToEdges,ze=ve.dragStartTime,qe=ve.axis,$e=ve.shouldUseTimeDampening,gt=Sc(Se,qe),xt=Be[qe.end]<Be[qe.start];return xt?Rd({distanceToEdge:Be[qe.end],thresholds:gt,dragStartTime:ze,shouldUseTimeDampening:$e}):-1*Rd({distanceToEdge:Be[qe.start],thresholds:gt,dragStartTime:ze,shouldUseTimeDampening:$e})},jd=function(ve){var Se=ve.container,Be=ve.subject,ze=ve.proposedScroll,qe=Be.height>Se.height,$e=Be.width>Se.width;return!$e&&!qe?ze:$e&&qe?null:{x:$e?0:ze.x,y:qe?0:ze.y}},uf=bo(function(ve){return ve===0?0:ve}),hd=function(ve){var Se=ve.dragStartTime,Be=ve.container,ze=ve.subject,qe=ve.center,$e=ve.shouldUseTimeDampening,gt={top:qe.y-Be.top,right:Be.right-qe.x,bottom:Be.bottom-qe.y,left:qe.x-Be.left},xt=Hg({container:Be,distanceToEdges:gt,dragStartTime:Se,axis:bn,shouldUseTimeDampening:$e}),Qt=Hg({container:Be,distanceToEdges:gt,dragStartTime:Se,axis:Yi,shouldUseTimeDampening:$e}),xn=uf({x:Qt,y:xt});if(li(xn,zr))return null;var dn=jd({container:Be,subject:ze,proposedScroll:xn});return dn?li(dn,zr)?null:dn:null},Pc=bo(function(ve){return ve===0?0:ve>0?1:-1}),dd=function(){var ve=function(Be,ze){return Be<0?Be:Be>ze?Be-ze:0};return function(Se){var Be=Se.current,ze=Se.max,qe=Se.change,$e=mo(Be,qe),gt={x:ve($e.x,ze.x),y:ve($e.y,ze.y)};return li(gt,zr)?null:gt}}(),hf=function(Se){var Be=Se.max,ze=Se.current,qe=Se.change,$e={x:Math.max(ze.x,Be.x),y:Math.max(ze.y,Be.y)},gt=Pc(qe),xt=dd({max:$e,current:ze,change:gt});return!xt||gt.x!==0&&xt.x===0||gt.y!==0&&xt.y===0},cd=function(Se,Be){return hf({current:Se.scroll.current,max:Se.scroll.max,change:Be})},zd=function(Se,Be){if(!cd(Se,Be))return null;var ze=Se.scroll.max,qe=Se.scroll.current;return dd({current:qe,max:ze,change:Be})},rh=function(Se,Be){var ze=Se.frame;return ze?hf({current:ze.scroll.current,max:ze.scroll.max,change:Be}):!1},kl=function(Se,Be){var ze=Se.frame;return!ze||!rh(Se,Be)?null:dd({current:ze.scroll.current,max:ze.scroll.max,change:Be})},oh=function(ve){var Se=ve.viewport,Be=ve.subject,ze=ve.center,qe=ve.dragStartTime,$e=ve.shouldUseTimeDampening,gt=hd({dragStartTime:qe,container:Se.frame,subject:Be,center:ze,shouldUseTimeDampening:$e});return gt&&cd(Se,gt)?gt:null},df=function(ve){var Se=ve.droppable,Be=ve.subject,ze=ve.center,qe=ve.dragStartTime,$e=ve.shouldUseTimeDampening,gt=Se.frame;if(!gt)return null;var xt=hd({dragStartTime:qe,container:gt.pageMarginBox,subject:Be,center:ze,shouldUseTimeDampening:$e});return xt&&rh(Se,xt)?xt:null},ah=function(ve){var Se=ve.state,Be=ve.dragStartTime,ze=ve.shouldUseTimeDampening,qe=ve.scrollWindow,$e=ve.scrollDroppable,gt=Se.current.page.borderBoxCenter,xt=Se.dimensions.draggables[Se.critical.draggable.id],Qt=xt.page.marginBox;if(Se.isWindowScrollAllowed){var xn=Se.viewport,dn=oh({dragStartTime:Be,viewport:xn,subject:Qt,center:gt,shouldUseTimeDampening:ze});if(dn){qe(dn);return}}var on=xc({center:gt,destination:_o(Se.impact),droppables:Se.dimensions.droppables});if(on){var rn=df({dragStartTime:Be,droppable:on,subject:Qt,center:gt,shouldUseTimeDampening:ze});rn&&$e(on.descriptor.id,rn)}},cf=function(ve){var Se=ve.scrollWindow,Be=ve.scrollDroppable,ze=Bt(Se),qe=Bt(Be),$e=null,gt=function(dn){$e||an(!1);var on=$e,rn=on.shouldUseTimeDampening,Ln=on.dragStartTime;ah({state:dn,scrollWindow:ze,scrollDroppable:qe,dragStartTime:Ln,shouldUseTimeDampening:rn})},xt=function(dn){$i(),$e&&an(!1);var on=Date.now(),rn=!1,Ln=function(){rn=!0};ah({state:dn,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:Ln,scrollDroppable:Ln}),$e={dragStartTime:on,shouldUseTimeDampening:rn},wi(),rn&>(dn)},Qt=function(){$e&&(ze.cancel(),qe.cancel(),$e=null)};return{start:xt,stop:Qt,scroll:gt}},ff=function(ve){var Se=ve.move,Be=ve.scrollDroppable,ze=ve.scrollWindow,qe=function(xn,dn){var on=mo(xn.current.client.selection,dn);Se({client:on})},$e=function(xn,dn){if(!rh(xn,dn))return dn;var on=kl(xn,dn);if(!on)return Be(xn.descriptor.id,dn),null;var rn=en(dn,on);Be(xn.descriptor.id,rn);var Ln=en(dn,rn);return Ln},gt=function(xn,dn,on){if(!xn||!cd(dn,on))return on;var rn=zd(dn,on);if(!rn)return ze(on),null;var Ln=en(on,rn);ze(Ln);var Bi=en(on,Ln);return Bi},xt=function(xn){var dn=xn.scrollJumpRequest;if(dn){var on=_o(xn.impact);on||an(!1);var rn=$e(xn.dimensions.droppables[on],dn);if(rn){var Ln=xn.viewport,Bi=gt(xn.isWindowScrollAllowed,Ln,rn);Bi&&qe(xn,Bi)}}};return xt},Wg=function(ve){var Se=ve.scrollDroppable,Be=ve.scrollWindow,ze=ve.move,qe=cf({scrollWindow:Be,scrollDroppable:Se}),$e=ff({move:ze,scrollWindow:Be,scrollDroppable:Se}),gt=function(xn){if(xn.phase==="DRAGGING"){if(xn.movementMode==="FLUID"){qe.scroll(xn);return}xn.scrollJumpRequest&&$e(xn)}},xt={scroll:gt,start:qe.start,stop:qe.stop};return xt},wu="data-rbd",Tu=function(){var ve=wu+"-drag-handle";return{base:ve,draggableId:ve+"-draggable-id",contextId:ve+"-context-id"}}(),gf=function(){var ve=wu+"-draggable";return{base:ve,contextId:ve+"-context-id",id:ve+"-id"}}(),pf=function(){var ve=wu+"-droppable";return{base:ve,contextId:ve+"-context-id",id:ve+"-id"}}(),hl={contextId:wu+"-scroll-container-context-id"},fd=function(Se){return function(Be){return"["+Be+'="'+Se+'"]'}},gd=function(Se,Be){return Se.map(function(ze){var qe=ze.styles[Be];return qe?ze.selector+" { "+qe+" }":""}).join(" ")},Ec="pointer-events: none;",Cc=function(ve){var Se=fd(ve),Be=function(){var xt=`
|
|
cursor: -webkit-grab;
|
|
cursor: grab;
|
|
`;return{selector:Se(Tu.contextId),styles:{always:`
|
|
-webkit-touch-callout: none;
|
|
-webkit-tap-highlight-color: rgba(0,0,0,0);
|
|
touch-action: manipulation;
|
|
`,resting:xt,dragging:Ec,dropAnimating:xt}}}(),ze=function(){var xt=`
|
|
transition: `+pa.outOfTheWay+`;
|
|
`;return{selector:Se(gf.contextId),styles:{dragging:xt,dropAnimating:xt,userCancel:xt}}}(),qe={selector:Se(pf.contextId),styles:{always:"overflow-anchor: none;"}},$e={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;
|
|
`}},gt=[ze,Be,qe,$e];return{always:gd(gt,"always"),resting:gd(gt,"resting"),dragging:gd(gt,"dragging"),dropAnimating:gd(gt,"dropAnimating"),userCancel:gd(gt,"userCancel")}},nl=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?ue.useLayoutEffect:ue.useEffect,pd=function(){var Se=document.querySelector("head");return Se||an(!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=Sn(function(){return Cc(ve)},[ve]),ze=(0,ue.useRef)(null),qe=(0,ue.useRef)(null),$e=Kt(fi(function(on){var rn=qe.current;rn||an(!1),rn.textContent=on}),[]),gt=Kt(function(on){var rn=ze.current;rn||an(!1),rn.textContent=on},[]);nl(function(){!ze.current&&!qe.current||an(!1);var on=mf(Se),rn=mf(Se);return ze.current=on,qe.current=rn,on.setAttribute(wu+"-always",ve),rn.setAttribute(wu+"-dynamic",ve),pd().appendChild(on),pd().appendChild(rn),gt(Be.always),$e(Be.resting),function(){var Ln=function(Zr){var Ur=Zr.current;Ur||an(!1),pd().removeChild(Ur),Zr.current=null};Ln(ze),Ln(qe)}},[Se,gt,$e,Be.always,Be.resting,ve]);var xt=Kt(function(){return $e(Be.dragging)},[$e,Be.dragging]),Qt=Kt(function(on){if(on==="DROP"){$e(Be.dropAnimating);return}$e(Be.userCancel)},[$e,Be.dropAnimating,Be.userCancel]),xn=Kt(function(){qe.current&&$e(Be.resting)},[$e,Be.resting]),dn=Sn(function(){return{dragging:xt,dropping:Qt,resting:xn}},[xt,Qt,xn]);return dn}var Zd=function(ve){return ve&&ve.ownerDocument?ve.ownerDocument.defaultView:window};function _u(ve){return ve instanceof Zd(ve).HTMLElement}function zh(ve,Se){var Be="["+Tu.contextId+'="'+ve+'"]',ze=Vt(document.querySelectorAll(Be));if(!ze.length)return null;var qe=zo(ze,function($e){return $e.getAttribute(Tu.draggableId)===Se});return!qe||!_u(qe)?null:qe}function bc(ve){var Se=(0,ue.useRef)({}),Be=(0,ue.useRef)(null),ze=(0,ue.useRef)(null),qe=(0,ue.useRef)(!1),$e=Kt(function(rn,Ln){var Bi={id:rn,focus:Ln};return Se.current[rn]=Bi,function(){var Ur=Se.current,io=Ur[rn];io!==Bi&&delete Ur[rn]}},[]),gt=Kt(function(rn){var Ln=zh(ve,rn);Ln&&Ln!==document.activeElement&&Ln.focus()},[ve]),xt=Kt(function(rn,Ln){Be.current===rn&&(Be.current=Ln)},[]),Qt=Kt(function(){ze.current||qe.current&&(ze.current=requestAnimationFrame(function(){ze.current=null;var rn=Be.current;rn&>(rn)}))},[gt]),xn=Kt(function(rn){Be.current=null;var Ln=document.activeElement;Ln&&Ln.getAttribute(Tu.draggableId)===rn&&(Be.current=rn)},[]);nl(function(){return qe.current=!0,function(){qe.current=!1;var rn=ze.current;rn&&cancelAnimationFrame(rn)}},[]);var dn=Sn(function(){return{register:$e,tryRecordFocus:xn,tryRestoreFocusRecorded:Qt,tryShiftRecord:xt}},[$e,xn,Qt,xt]);return dn}function Yf(){var ve={draggables:{},droppables:{}},Se=[];function Be(on){return Se.push(on),function(){var Ln=Se.indexOf(on);Ln!==-1&&Se.splice(Ln,1)}}function ze(on){Se.length&&Se.forEach(function(rn){return rn(on)})}function qe(on){return ve.draggables[on]||null}function $e(on){var rn=qe(on);return rn||an(!1),rn}var gt={register:function(rn){ve.draggables[rn.descriptor.id]=rn,ze({type:"ADDITION",value:rn})},update:function(rn,Ln){var Bi=ve.draggables[Ln.descriptor.id];Bi&&Bi.uniqueId===rn.uniqueId&&(delete ve.draggables[Ln.descriptor.id],ve.draggables[rn.descriptor.id]=rn)},unregister:function(rn){var Ln=rn.descriptor.id,Bi=qe(Ln);Bi&&rn.uniqueId===Bi.uniqueId&&(delete ve.draggables[Ln],ze({type:"REMOVAL",value:rn}))},getById:$e,findById:qe,exists:function(rn){return!!qe(rn)},getAllByType:function(rn){return ca(ve.draggables).filter(function(Ln){return Ln.descriptor.type===rn})}};function xt(on){return ve.droppables[on]||null}function Qt(on){var rn=xt(on);return rn||an(!1),rn}var xn={register:function(rn){ve.droppables[rn.descriptor.id]=rn},unregister:function(rn){var Ln=xt(rn.descriptor.id);Ln&&rn.uniqueId===Ln.uniqueId&&delete ve.droppables[rn.descriptor.id]},getById:Qt,findById:xt,exists:function(rn){return!!xt(rn)},getAllByType:function(rn){return ca(ve.droppables).filter(function(Ln){return Ln.descriptor.type===rn})}};function dn(){ve.draggables={},ve.droppables={},Se.length=0}return{draggable:gt,droppable:xn,subscribe:Be,clean:dn}}function Gd(){var ve=Sn(Yf,[]);return(0,ue.useEffect)(function(){return function(){requestAnimationFrame(ve.clean)}},[ve]),ve}var vf=ue.createContext(null),Wu=function(){var ve=document.body;return ve||an(!1),ve},Pu={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=Sn(function(){return Vg(ve)},[ve]),Be=(0,ue.useRef)(null);(0,ue.useEffect)(function(){var $e=document.createElement("div");return Be.current=$e,$e.id=Se,$e.setAttribute("aria-live","assertive"),$e.setAttribute("aria-atomic","true"),(0,yt.Z)($e.style,Pu),Wu().appendChild($e),function(){setTimeout(function(){var Qt=Wu();Qt.contains($e)&&Qt.removeChild($e),$e===Be.current&&(Be.current=null)})}},[Se]);var ze=Kt(function(qe){var $e=Be.current;if($e){$e.textContent=qe;return}},[]);return ze}var Zh=0,Hd={separator:"::"};function bs(){Zh=0}function Vu(ve,Se){return Se===void 0&&(Se=Hd),Sn(function(){return""+ve+Se.separator+Zh++},[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,ze=Vu("hidden-text",{separator:"-"}),qe=Sn(function(){return Kg({contextId:Se,uniqueId:ze})},[ze,Se]);return(0,ue.useEffect)(function(){var gt=document.createElement("div");return gt.id=qe,gt.textContent=Be,gt.style.display="none",Wu().appendChild(gt),function(){var Qt=Wu();Qt.contains(gt)&&Qt.removeChild(gt)}},[qe,Be]),qe}var Fc=ue.createContext(null),Zt={react:"^16.8.5","react-dom":"^16.8.5"},md=/(\d+)\.(\d+)\.(\d+)/,Ku=function(Se){var Be=md.exec(Se);Be==null&&an(!1);var ze=Number(Be[1]),qe=Number(Be[2]),$e=Number(Be[3]);return{major:ze,minor:qe,patch:$e,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=Ku(ve),ze=Ku(Se);Ug(Be,ze)},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 Ks(ve,Se){}function Lc(){Ks(function(){Jf(Zt.react,ue.version),Qf(document)},[])}function Bc(ve){var Se=(0,ue.useRef)(ve);return(0,ue.useEffect)(function(){Se.current=ve}),Se}function Yg(){var ve=null;function Se(){return!!ve}function Be(gt){return gt===ve}function ze(gt){ve&&an(!1);var xt={abandon:gt};return ve=xt,xt}function qe(){ve||an(!1),ve=null}function $e(){ve&&(ve.abandon(),qe())}return{isClaimed:Se,isActive:Be,claim:ze,release:qe,tryAbandon:$e}}var Xg=9,Jg=13,xf=27,Sf=32,lu=33,Wd=34,$f=35,sh=36,Mc=37,wf=38,kc=39,Ql=40,Vd,qf=(Vd={},Vd[Jg]=!0,Vd[Xg]=!0,Vd),uu=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=zo(Se,function(ze){return"on"+ze in document});return Be||ve}(),Pf=0,eg=5;function vd(ve,Se){return Math.abs(Se.x-ve.x)>=eg||Math.abs(Se.y-ve.y)>=eg}var zl={type:"IDLE"};function tg(ve){var Se=ve.cancel,Be=ve.completed,ze=ve.getPhase,qe=ve.setPhase;return[{eventName:"mousemove",fn:function(gt){var xt=gt.button,Qt=gt.clientX,xn=gt.clientY;if(xt===Pf){var dn={x:Qt,y:xn},on=ze();if(on.type==="DRAGGING"){gt.preventDefault(),on.actions.move(dn);return}on.type!=="PENDING"&&an(!1);var rn=on.point;if(vd(rn,dn)){gt.preventDefault();var Ln=on.actions.fluidLift(dn);qe({type:"DRAGGING",actions:Ln})}}}},{eventName:"mouseup",fn:function(gt){var xt=ze();if(xt.type!=="DRAGGING"){Se();return}gt.preventDefault(),xt.actions.drop({shouldBlockNextClick:!0}),Be()}},{eventName:"mousedown",fn:function(gt){ze().type==="DRAGGING"&>.preventDefault(),Se()}},{eventName:"keydown",fn:function(gt){var xt=ze();if(xt.type==="PENDING"){Se();return}if(gt.keyCode===xf){gt.preventDefault(),Se();return}uu(gt)}},{eventName:"resize",fn:Se},{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(){ze().type==="PENDING"&&Se()}},{eventName:"webkitmouseforcedown",fn:function(gt){var xt=ze();if(xt.type==="IDLE"&&an(!1),xt.actions.shouldRespectForcePress()){Se();return}gt.preventDefault()}},{eventName:Lh,fn:Se}]}function Zs(ve){var Se=(0,ue.useRef)(zl),Be=(0,ue.useRef)(it),ze=Sn(function(){return{eventName:"mousedown",fn:function(on){if(!on.defaultPrevented&&on.button===Pf&&!(on.ctrlKey||on.metaKey||on.shiftKey||on.altKey)){var rn=ve.findClosestDraggableId(on);if(rn){var Ln=ve.tryGetLock(rn,gt,{sourceEvent:on});if(Ln){on.preventDefault();var Bi={x:on.clientX,y:on.clientY};Be.current(),xn(Ln,Bi)}}}}}},[ve]),qe=Sn(function(){return{eventName:"webkitmouseforcewillbegin",fn:function(on){if(!on.defaultPrevented){var rn=ve.findClosestDraggableId(on);if(rn){var Ln=ve.findOptionsForDraggable(rn);Ln&&(Ln.shouldRespectForcePress||ve.canGetLock(rn)&&on.preventDefault())}}}}},[ve]),$e=Kt(function(){var on={passive:!1,capture:!0};Be.current=Dn(window,[qe,ze],on)},[qe,ze]),gt=Kt(function(){var dn=Se.current;dn.type!=="IDLE"&&(Se.current=zl,Be.current(),$e())},[$e]),xt=Kt(function(){var dn=Se.current;gt(),dn.type==="DRAGGING"&&dn.actions.cancel({shouldBlockNextClick:!0}),dn.type==="PENDING"&&dn.actions.abort()},[gt]),Qt=Kt(function(){var on={capture:!0,passive:!1},rn=tg({cancel:xt,completed:gt,getPhase:function(){return Se.current},setPhase:function(Bi){Se.current=Bi}});Be.current=Dn(window,rn,on)},[xt,gt]),xn=Kt(function(on,rn){Se.current.type!=="IDLE"&&an(!1),Se.current={type:"PENDING",point:rn,actions:on},Qt()},[Qt]);nl(function(){return $e(),function(){Be.current()}},[$e])}var lh;function Ef(){}var Gh=(lh={},lh[Wd]=!0,lh[lu]=!0,lh[sh]=!0,lh[$f]=!0,lh);function Kd(ve,Se){function Be(){Se(),ve.cancel()}function ze(){Se(),ve.drop()}return[{eventName:"keydown",fn:function($e){if($e.keyCode===xf){$e.preventDefault(),Be();return}if($e.keyCode===Sf){$e.preventDefault(),ze();return}if($e.keyCode===Ql){$e.preventDefault(),ve.moveDown();return}if($e.keyCode===wf){$e.preventDefault(),ve.moveUp();return}if($e.keyCode===kc){$e.preventDefault(),ve.moveRight();return}if($e.keyCode===Mc){$e.preventDefault(),ve.moveLeft();return}if(Gh[$e.keyCode]){$e.preventDefault();return}uu($e)}},{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 Ud(ve){var Se=(0,ue.useRef)(Ef),Be=Sn(function(){return{eventName:"keydown",fn:function($e){if($e.defaultPrevented||$e.keyCode!==Sf)return;var gt=ve.findClosestDraggableId($e);if(!gt)return;var xt=ve.tryGetLock(gt,dn,{sourceEvent:$e});if(!xt)return;$e.preventDefault();var Qt=!0,xn=xt.snapLift();Se.current();function dn(){Qt||an(!1),Qt=!1,Se.current(),ze()}Se.current=Dn(window,Kd(xn,dn),{capture:!0,passive:!1})}}},[ve]),ze=Kt(function(){var $e={passive:!1,capture:!0};Se.current=Dn(window,[Be],$e)},[Be]);nl(function(){return ze(),function(){Se.current()}},[ze])}var Ac={type:"IDLE"},Yd=120,ng=.15;function uh(ve){var Se=ve.cancel,Be=ve.getPhase;return[{eventName:"orientationchange",fn:Se},{eventName:"resize",fn:Se},{eventName:"contextmenu",fn:function(qe){qe.preventDefault()}},{eventName:"keydown",fn:function(qe){if(Be().type!=="DRAGGING"){Se();return}qe.keyCode===xf&&qe.preventDefault(),Se()}},{eventName:Lh,fn:Se}]}function yd(ve){var Se=ve.cancel,Be=ve.completed,ze=ve.getPhase;return[{eventName:"touchmove",options:{capture:!1},fn:function($e){var gt=ze();if(gt.type!=="DRAGGING"){Se();return}gt.hasMoved=!0;var xt=$e.touches[0],Qt=xt.clientX,xn=xt.clientY,dn={x:Qt,y:xn};$e.preventDefault(),gt.actions.move(dn)}},{eventName:"touchend",fn:function($e){var gt=ze();if(gt.type!=="DRAGGING"){Se();return}$e.preventDefault(),gt.actions.drop({shouldBlockNextClick:!0}),Be()}},{eventName:"touchcancel",fn:function($e){if(ze().type!=="DRAGGING"){Se();return}$e.preventDefault(),Se()}},{eventName:"touchforcechange",fn:function($e){var gt=ze();gt.type==="IDLE"&&an(!1);var xt=$e.touches[0];if(xt){var Qt=xt.force>=ng;if(Qt){var xn=gt.actions.shouldRespectForcePress();if(gt.type==="PENDING"){xn&&Se();return}if(xn){if(gt.hasMoved){$e.preventDefault();return}Se();return}$e.preventDefault()}}}},{eventName:Lh,fn:Se}]}function Cf(ve){var Se=(0,ue.useRef)(Ac),Be=(0,ue.useRef)(it),ze=Kt(function(){return Se.current},[]),qe=Kt(function(Ln){Se.current=Ln},[]),$e=Sn(function(){return{eventName:"touchstart",fn:function(Ln){if(!Ln.defaultPrevented){var Bi=ve.findClosestDraggableId(Ln);if(Bi){var Zr=ve.tryGetLock(Bi,xt,{sourceEvent:Ln});if(Zr){var Ur=Ln.touches[0],io=Ur.clientX,Co=Ur.clientY,Ho={x:io,y:Co};Be.current(),on(Zr,Ho)}}}}}},[ve]),gt=Kt(function(){var Ln={capture:!0,passive:!1};Be.current=Dn(window,[$e],Ln)},[$e]),xt=Kt(function(){var rn=Se.current;rn.type!=="IDLE"&&(rn.type==="PENDING"&&clearTimeout(rn.longPressTimerId),qe(Ac),Be.current(),gt())},[gt,qe]),Qt=Kt(function(){var rn=Se.current;xt(),rn.type==="DRAGGING"&&rn.actions.cancel({shouldBlockNextClick:!0}),rn.type==="PENDING"&&rn.actions.abort()},[xt]),xn=Kt(function(){var Ln={capture:!0,passive:!1},Bi={cancel:Qt,completed:xt,getPhase:ze},Zr=Dn(window,yd(Bi),Ln),Ur=Dn(window,uh(Bi),Ln);Be.current=function(){Zr(),Ur()}},[Qt,ze,xt]),dn=Kt(function(){var Ln=ze();Ln.type!=="PENDING"&&an(!1);var Bi=Ln.actions.fluidLift(Ln.point);qe({type:"DRAGGING",actions:Bi,hasMoved:!1})},[ze,qe]),on=Kt(function(Ln,Bi){ze().type!=="IDLE"&&an(!1);var Zr=setTimeout(dn,Yd);qe({type:"PENDING",point:Bi,actions:Ln,longPressTimerId:Zr}),xn()},[xn,ze,qe,dn]);nl(function(){return gt(),function(){Be.current();var Bi=ze();Bi.type==="PENDING"&&(clearTimeout(Bi.longPressTimerId),qe(Ac))}},[ze,gt,qe]),nl(function(){var Ln=Dn(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 Hh(ve,Se){if(Se==null)return!1;var Be=!!Ff[Se.tagName.toLowerCase()];if(Be)return!0;var ze=Se.getAttribute("contenteditable");return ze==="true"||ze===""?!0:Se===ve?!1:Hh(ve,Se.parentElement)}function ig(ve,Se){var Be=Se.target;return _u(Be)?Hh(ve,Be):!1}var rg=function(ve){return Ii(ve.getBoundingClientRect()).center};function og(ve){return ve instanceof Zd(ve).Element}var Uu=function(){var ve="matches";if(typeof document=="undefined")return ve;var Se=[ve,"msMatchesSelector","webkitMatchesSelector"],Be=zo(Se,function(ze){return ze in Element.prototype});return Be||ve}();function ag(ve,Se){return ve==null?null:ve[Uu](Se)?ve:ag(ve.parentElement,Se)}function sg(ve,Se){return ve.closest?ve.closest(Se):ag(ve,Se)}function Xd(ve){return"["+Tu.contextId+'="'+ve+'"]'}function xd(ve,Se){var Be=Se.target;if(!og(Be))return null;var ze=Xd(ve),qe=sg(Be,ze);return!qe||!_u(qe)?null:qe}function lg(ve,Se){var Be=xd(ve,Se);return Be?Be.getAttribute(Tu.draggableId):null}function Yu(ve,Se){var Be="["+gf.contextId+'="'+ve+'"]',ze=Vt(document.querySelectorAll(Be)),qe=zo(ze,function($e){return $e.getAttribute(gf.id)===Se});return!qe||!_u(qe)?null:qe}function ug(ve){ve.preventDefault()}function Sd(ve){var Se=ve.expected,Be=ve.phase,ze=ve.isLockActive,qe=ve.shouldWarn;return!(!ze()||Se!==Be)}function hg(ve){var Se=ve.lockAPI,Be=ve.store,ze=ve.registry,qe=ve.draggableId;if(Se.isClaimed())return!1;var $e=ze.draggable.findById(qe);return!(!$e||!$e.options.isEnabled||!xu(Be.getState(),qe))}function dg(ve){var Se=ve.lockAPI,Be=ve.contextId,ze=ve.store,qe=ve.registry,$e=ve.draggableId,gt=ve.forceSensorStop,xt=ve.sourceEvent,Qt=hg({lockAPI:Se,store:ze,registry:qe,draggableId:$e});if(!Qt)return null;var xn=qe.draggable.getById($e),dn=Yu(Be,xn.descriptor.id);if(!dn||xt&&!xn.options.canDragInteractiveElements&&ig(dn,xt))return null;var on=Se.claim(gt||it),rn="PRE_DRAG";function Ln(){return xn.options.shouldRespectForcePress}function Bi(){return Se.isActive(on)}function Zr(ja,es){Sd({expected:ja,phase:rn,isLockActive:Bi,shouldWarn:!0})&&ze.dispatch(es())}var Ur=Zr.bind(null,"DRAGGING");function io(ja){function es(){Se.release(),rn="COMPLETED"}rn!=="PRE_DRAG"&&(es(),rn!=="PRE_DRAG"&&an(!1)),ze.dispatch(br(ja.liftActionArgs)),rn="DRAGGING";function qs(Xa,Us){if(Us===void 0&&(Us={shouldBlockNextClick:!1}),ja.cleanup(),Us.shouldBlockNextClick){var Nl=Dn(window,[{eventName:"click",fn:ug,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(Nl)}es(),ze.dispatch(Ol({reason:Xa}))}return(0,yt.Z)({isActive:function(){return Sd({expected:"DRAGGING",phase:rn,isLockActive:Bi,shouldWarn:!1})},shouldRespectForcePress:Ln,drop:function(Us){return qs("DROP",Us)},cancel:function(Us){return qs("CANCEL",Us)}},ja.actions)}function Co(ja){var es=Bt(function(Xa){Ur(function(){return ta({client:Xa})})}),qs=io({liftActionArgs:{id:$e,clientSelection:ja,movementMode:"FLUID"},cleanup:function(){return es.cancel()},actions:{move:es}});return(0,yt.Z)({},qs,{move:es})}function Ho(){var ja={moveUp:function(){return Ur(ha)},moveRight:function(){return Ur(kr)},moveDown:function(){return Ur(As)},moveLeft:function(){return Ur($a)}};return io({liftActionArgs:{id:$e,clientSelection:rg(dn),movementMode:"SNAP"},cleanup:it,actions:ja})}function Ro(){var ja=Sd({expected:"PRE_DRAG",phase:rn,isLockActive:Bi,shouldWarn:!0});ja&&Se.release()}var da={isActive:function(){return Sd({expected:"PRE_DRAG",phase:rn,isLockActive:Bi,shouldWarn:!1})},shouldRespectForcePress:Ln,fluidLift:Co,snapLift:Ho,abort:Ro};return da}var cg=[Zs,Ud,Cf];function Zp(ve){var Se=ve.contextId,Be=ve.store,ze=ve.registry,qe=ve.customSensors,$e=ve.enableDefaultSensors,gt=[].concat($e?cg:[],qe||[]),xt=(0,ue.useState)(function(){return Yg()})[0],Qt=Kt(function(Co,Ho){Co.isDragging&&!Ho.isDragging&&xt.tryAbandon()},[xt]);nl(function(){var Co=Be.getState(),Ho=Be.subscribe(function(){var Ro=Be.getState();Qt(Co,Ro),Co=Ro});return Ho},[xt,Be,Qt]),nl(function(){return xt.tryAbandon},[xt.tryAbandon]);var xn=Kt(function(io){return hg({lockAPI:xt,registry:ze,store:Be,draggableId:io})},[xt,ze,Be]),dn=Kt(function(io,Co,Ho){return dg({lockAPI:xt,registry:ze,contextId:Se,store:Be,draggableId:io,forceSensorStop:Co,sourceEvent:Ho&&Ho.sourceEvent?Ho.sourceEvent:null})},[Se,xt,ze,Be]),on=Kt(function(io){return lg(Se,io)},[Se]),rn=Kt(function(io){var Co=ze.draggable.findById(io);return Co?Co.options:null},[ze.draggable]),Ln=Kt(function(){xt.isClaimed()&&(xt.tryAbandon(),Be.getState().phase!=="IDLE"&&Be.dispatch(Eo()))},[xt,Be]),Bi=Kt(xt.isClaimed,[xt]),Zr=Sn(function(){return{canGetLock:xn,tryGetLock:dn,findClosestDraggableId:on,findOptionsForDraggable:rn,tryReleaseLock:Ln,isLockClaimed:Bi}},[xn,dn,on,rn,Ln,Bi]);bf(gt);for(var Ur=0;Ur<gt.length;Ur++)gt[Ur](Zr)}var Qg=function(Se){return{onBeforeCapture:Se.onBeforeCapture,onBeforeDragStart:Se.onBeforeDragStart,onDragStart:Se.onDragStart,onDragEnd:Se.onDragEnd,onDragUpdate:Se.onDragUpdate}};function Wh(ve){return ve.current||an(!1),ve.current}function Lf(ve){var Se=ve.contextId,Be=ve.setCallbacks,ze=ve.sensors,qe=ve.nonce,$e=ve.dragHandleUsageInstructions,gt=(0,ue.useRef)(null);Lc();var xt=Bc(ve),Qt=Kt(function(){return Qg(xt.current)},[xt]),xn=Xf(Se),dn=yf({contextId:Se,text:$e}),on=zs(Se,qe),rn=Kt(function(Xa){Wh(gt).dispatch(Xa)},[]),Ln=Sn(function(){return(0,mt.DE)({publishWhileDragging:Nr,updateDroppableScroll:sr,updateDroppableIsEnabled:ra,updateDroppableIsCombineEnabled:Bo,collectionStarting:Tr},rn)},[rn]),Bi=Gd(),Zr=Sn(function(){return ss(Bi,Ln)},[Bi,Ln]),Ur=Sn(function(){return Wg((0,yt.Z)({scrollWindow:Fh,scrollDroppable:Zr.scrollDroppable},(0,mt.DE)({move:ta},rn)))},[Zr.scrollDroppable,rn]),io=bc(Se),Co=Sn(function(){return sd({announce:xn,autoScroller:Ur,dimensionMarshal:Zr,focusMarshal:io,getResponders:Qt,styleMarshal:on})},[xn,Ur,Zr,io,Qt,on]);gt.current=Co;var Ho=Kt(function(){var Xa=Wh(gt),Us=Xa.getState();Us.phase!=="IDLE"&&Xa.dispatch(Eo())},[]),Ro=Kt(function(){var Xa=Wh(gt).getState();return Xa.isDragging||Xa.phase==="DROP_ANIMATING"},[]),da=Sn(function(){return{isDragging:Ro,tryAbort:Ho}},[Ro,Ho]);Be(da);var ja=Kt(function(Xa){return xu(Wh(gt).getState(),Xa)},[]),es=Kt(function(){return vo(Wh(gt).getState())},[]),qs=Sn(function(){return{marshal:Zr,focus:io,contextId:Se,canLift:ja,isMovementAllowed:es,dragHandleUsageInstructionsId:dn,registry:Bi}},[Se,Zr,dn,io,ja,es,Bi]);return Zp({contextId:Se,store:Co,registry:Bi,customSensors:ze,enableDefaultSensors:ve.enableDefaultSensors!==!1}),(0,ue.useEffect)(function(){return Ho},[Ho]),ue.createElement(Fc.Provider,{value:qs},ue.createElement(de,{context:vf,store:Co},ve.children))}var Nc=0;function $g(){Nc=0}function Bf(){return Sn(function(){return""+Nc++},[])}function wd(){$g(),bs()}function fg(ve){var Se=Bf(),Be=ve.dragHandleUsageInstructions||Yo.dragHandleUsageInstructions;return ue.createElement(Gi,null,function(ze){return ue.createElement(Lf,{nonce:ve.nonce,contextId:Se,setCallbacks:ze,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 Pd=function(Se){return function(Be){return Se===Be}},qg=Pd("scroll"),Mf=Pd("auto"),ep=Pd("visible"),Ua=function(Se,Be){return Be(Se.overflowX)||Be(Se.overflowY)},Jd=function(Se,Be){return Be(Se.overflowX)&&Be(Se.overflowY)},Vh=function(Se){var Be=window.getComputedStyle(Se),ze={overflowX:Be.overflowX,overflowY:Be.overflowY};return Ua(ze,qg)||Ua(ze,Mf)},il=function(){return!1;var Se,Be,ze,qe},Al=function ve(Se){return Se==null?null:Se===document.body?il()?Se:null:Se===document.documentElement?null:Vh(Se)?Se:ve(Se.parentElement)},Qd=function(ve){if(ve)var Se=Al(ve.parentElement)},Ed=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,ze=ve.isCombineEnabled,qe=ve.isFixedOnPage,$e=ve.direction,gt=ve.client,xt=ve.page,Qt=ve.closest,xn=function(){if(!Qt)return null;var Ln=Qt.scrollSize,Bi=Qt.client,Zr=jl({scrollHeight:Ln.scrollHeight,scrollWidth:Ln.scrollWidth,height:Bi.paddingBox.height,width:Bi.paddingBox.width});return{pageMarginBox:Qt.page.marginBox,frameClient:Bi,scrollSize:Ln,shouldClipSubject:Qt.shouldClipSubject,scroll:{initial:Qt.scroll,current:Qt.scroll,max:Zr,diff:{value:zr,displacement:zr}}}}(),dn=$e==="vertical"?bn:Yi,on=Or({page:xt,withPlaceholder:null,axis:dn,frame:xn}),rn={descriptor:Se,isCombineEnabled:ze,isFixedOnPage:qe,axis:dn,isEnabled:Be,client:gt,page:xt,frame:xn,subject:on};return rn},vg=function(Se,Be){var ze=ci(Se);if(!Be||Se!==Be)return ze;var qe=ze.paddingBox.top-Be.scrollTop,$e=ze.paddingBox.left-Be.scrollLeft,gt=qe+Be.scrollHeight,xt=$e+Be.scrollWidth,Qt={top:qe,right:xt,bottom:gt,left:$e},xn=Fr(Qt,ze.border),dn=Ti({borderBox:xn,margin:ze.margin,border:ze.border,padding:ze.padding});return dn},yg=function(ve){var Se=ve.ref,Be=ve.descriptor,ze=ve.env,qe=ve.windowScroll,$e=ve.direction,gt=ve.isDropDisabled,xt=ve.isCombineEnabled,Qt=ve.shouldClipSubject,xn=ze.closestScrollable,dn=vg(Se,xn),on=Ce(dn,qe),rn=function(){if(!xn)return null;var Bi=ci(xn),Zr={scrollHeight:xn.scrollHeight,scrollWidth:xn.scrollWidth};return{client:Bi,page:Ce(Bi,qe),scroll:Ed(xn),scrollSize:Zr,shouldClipSubject:Qt}}(),Ln=mg({descriptor:Be,isEnabled:!gt,isCombineEnabled:xt,isFixedOnPage:ze.isFixedOnPage,direction:$e,client:dn,page:on,closest:rn});return Ln},Kh={passive:!1},Dc={passive:!0},Bh=function(ve){return ve.shouldPublishImmediately?Kh:Dc};function rs(ve){var Se=(0,ue.useContext)(ve);return Se||an(!1),Se}var Cd=function(Se){return Se&&Se.env.closestScrollable||null};function xg(ve){var Se=(0,ue.useRef)(null),Be=rs(Fc),ze=Vu("droppable"),qe=Be.registry,$e=Be.marshal,gt=Bc(ve),xt=Sn(function(){return{id:ve.droppableId,type:ve.type,mode:ve.mode}},[ve.droppableId,ve.mode,ve.type]),Qt=(0,ue.useRef)(xt),xn=Sn(function(){return fi(function(Ro,da){Se.current||an(!1);var ja={x:Ro,y:da};$e.updateDroppableScroll(xt.id,ja)})},[xt.id,$e]),dn=Kt(function(){var Ro=Se.current;return!Ro||!Ro.env.closestScrollable?zr:Ed(Ro.env.closestScrollable)},[]),on=Kt(function(){var Ro=dn();xn(Ro.x,Ro.y)},[dn,xn]),rn=Sn(function(){return Bt(on)},[on]),Ln=Kt(function(){var Ro=Se.current,da=Cd(Ro);Ro&&da||an(!1);var ja=Ro.scrollOptions;if(ja.shouldPublishImmediately){on();return}rn()},[rn,on]),Bi=Kt(function(Ro,da){Se.current&&an(!1);var ja=gt.current,es=ja.getDroppableRef();es||an(!1);var qs=pg(es),Xa={ref:es,descriptor:xt,env:qs,scrollOptions:da};Se.current=Xa;var Us=yg({ref:es,descriptor:xt,env:qs,windowScroll:Ro,direction:ja.direction,isDropDisabled:ja.isDropDisabled,isCombineEnabled:ja.isCombineEnabled,shouldClipSubject:!ja.ignoreContainerClipping}),Nl=qs.closestScrollable;return Nl&&(Nl.setAttribute(hl.contextId,Be.contextId),Nl.addEventListener("scroll",Ln,Bh(Xa.scrollOptions))),Us},[Be.contextId,xt,Ln,gt]),Zr=Kt(function(){var Ro=Se.current,da=Cd(Ro);return Ro&&da||an(!1),Ed(da)},[]),Ur=Kt(function(){var Ro=Se.current;Ro||an(!1);var da=Cd(Ro);Se.current=null,da&&(rn.cancel(),da.removeAttribute(hl.contextId),da.removeEventListener("scroll",Ln,Bh(Ro.scrollOptions)))},[Ln,rn]),io=Kt(function(Ro){var da=Se.current;da||an(!1);var ja=Cd(da);ja||an(!1),ja.scrollTop+=Ro.y,ja.scrollLeft+=Ro.x},[]),Co=Sn(function(){return{getDimensionAndWatchScroll:Bi,getScrollWhileDragging:Zr,dragStopped:Ur,scroll:io}},[Ur,Bi,Zr,io]),Ho=Sn(function(){return{uniqueId:ze,descriptor:xt,callbacks:Co}},[Co,xt,ze]);nl(function(){return Qt.current=Ho.descriptor,qe.droppable.register(Ho),function(){Se.current&&Ur(),qe.droppable.unregister(Ho)}},[Co,xt,Ur,Ho,$e,qe.droppable]),nl(function(){Se.current&&$e.updateDroppableIsEnabled(Qt.current.id,!ve.isDropDisabled)},[ve.isDropDisabled,$e]),nl(function(){Se.current&&$e.updateDroppableIsCombineEnabled(Qt.current.id,ve.isCombineEnabled)},[ve.isCombineEnabled,$e])}function Uh(){}var bd={width:0,height:0,margin:Tn},Tc=function(Se){var Be=Se.isAnimatingOpenOnMount,ze=Se.placeholder,qe=Se.animate;return Be||qe==="close"?bd:{height:ze.client.borderBox.height,width:ze.client.borderBox.width,margin:ze.client.margin}},tp=function(Se){var Be=Se.isAnimatingOpenOnMount,ze=Se.placeholder,qe=Se.animate,$e=Tc({isAnimatingOpenOnMount:Be,placeholder:ze,animate:qe});return{display:ze.display,boxSizing:"border-box",width:$e.width,height:$e.height,marginTop:$e.margin.top,marginRight:$e.margin.right,marginBottom:$e.margin.bottom,marginLeft:$e.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:qe!=="none"?pa.placeholder:null}};function Js(ve){var Se=(0,ue.useRef)(null),Be=Kt(function(){Se.current&&(clearTimeout(Se.current),Se.current=null)},[]),ze=ve.animate,qe=ve.onTransitionEnd,$e=ve.onClose,gt=ve.contextId,xt=(0,ue.useState)(ve.animate==="open"),Qt=xt[0],xn=xt[1];(0,ue.useEffect)(function(){return Qt?ze!=="open"?(Be(),xn(!1),Uh):Se.current?Uh:(Se.current=setTimeout(function(){Se.current=null,xn(!1)}),Be):Uh},[ze,Qt,Be]);var dn=Kt(function(rn){rn.propertyName==="height"&&(qe(),ze==="close"&&$e())},[ze,$e,qe]),on=tp({isAnimatingOpenOnMount:Qt,animate:ve.animate,placeholder:ve.placeholder});return ue.createElement(ve.placeholder.tagName,{style:on,"data-rbd-placeholder-context-id":gt,onTransitionEnd:dn,ref:ve.innerRef})}var np=ue.memo(Js),Yh=ue.createContext(null);function hh(ve){ve&&_u(ve)||an(!1)}function Fd(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||an(!1),typeof Be.droppableId!="string"&&an(!1)},function(Se){var Be=Se.props;Fd(Be.isDropDisabled)||an(!1),Fd(Be.isCombineEnabled)||an(!1),Fd(Be.ignoreContainerClipping)||an(!1)},function(Se){var Be=Se.getDroppableRef;hh(Be())}],fe=[function(Se){var Be=Se.props,ze=Se.getPlaceholderRef;if(Be.placeholder)var qe=ze()}],ce=[function(Se){var Be=Se.props;Be.renderClone||an(!1)},function(Se){var Be=Se.getPlaceholderRef;Be()&&an(!1)}];function me(ve){Ks(function(){ie(ve,ae),ve.props.mode==="standard"&&ie(ve,fe),ve.props.mode==="virtual"&&ie(ve,ce)})}var ke=function(ve){ft(Se,ve);function Se(){for(var ze,qe=arguments.length,$e=new Array(qe),gt=0;gt<qe;gt++)$e[gt]=arguments[gt];return ze=ve.call.apply(ve,[this].concat($e))||this,ze.state={isVisible:!!ze.props.on,data:ze.props.on,animate:ze.props.shouldAnimate&&ze.props.on?"open":"none"},ze.onClose=function(){ze.state.animate==="close"&&ze.setState({isVisible:!1})},ze}Se.getDerivedStateFromProps=function(qe,$e){return qe.shouldAnimate?qe.on?{isVisible:!0,data:qe.on,animate:"open"}:$e.isVisible?{isVisible:!0,data:$e.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:!!qe.on,data:qe.on,animate:"none"}};var Be=Se.prototype;return Be.render=function(){if(!this.state.isVisible)return null;var qe={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(qe)},Se}(ue.PureComponent),Ze={dragging:5e3,dropAnimating:4500},Qe=function(Se,Be){return Be?pa.drop(Be.duration):Se?pa.snap:pa.fluid},Ue=function(Se,Be){return Se?Be?Bl.opacity.drop:Bl.opacity.combining:null},vt=function(Se){return Se.forceShouldAnimate!=null?Se.forceShouldAnimate:Se.mode==="SNAP"};function un(ve){var Se=ve.dimension,Be=Se.client,ze=ve.offset,qe=ve.combineWith,$e=ve.dropping,gt=!!qe,xt=vt(ve),Qt=!!$e,xn=Qt?us.drop(ze,gt):us.moveTo(ze),dn={position:"fixed",top:Be.marginBox.top,left:Be.marginBox.left,boxSizing:"border-box",width:Be.borderBox.width,height:Be.borderBox.height,transition:Qe(xt,$e),transform:xn,opacity:Ue(gt,Qt),zIndex:Qt?Ze.dropAnimating:Ze.dragging,pointerEvents:"none"};return dn}function bt(ve){return{transform:us.moveTo(ve.offset),transition:ve.shouldAnimateDisplacement?null:"none"}}function Gn(ve){return ve.type==="DRAGGING"?un(ve):bt(ve)}function Bn(ve,Se,Be){Be===void 0&&(Be=zr);var ze=window.getComputedStyle(Se),qe=Se.getBoundingClientRect(),$e=_n(qe,ze),gt=Ce($e,Be),xt={client:$e,tagName:Se.tagName.toLowerCase(),display:ze.display},Qt={x:$e.marginBox.width,y:$e.marginBox.height},xn={descriptor:ve,placeholder:xt,displaceBy:Qt,client:$e,page:gt};return xn}function Ji(ve){var Se=Vu("draggable"),Be=ve.descriptor,ze=ve.registry,qe=ve.getDraggableRef,$e=ve.canDragInteractiveElements,gt=ve.shouldRespectForcePress,xt=ve.isEnabled,Qt=Sn(function(){return{canDragInteractiveElements:$e,shouldRespectForcePress:gt,isEnabled:xt}},[$e,xt,gt]),xn=Kt(function(Ln){var Bi=qe();return Bi||an(!1),Bn(Be,Bi,Ln)},[Be,qe]),dn=Sn(function(){return{uniqueId:Se,descriptor:Be,options:Qt,getDimension:xn}},[Be,xn,Qt,Se]),on=(0,ue.useRef)(dn),rn=(0,ue.useRef)(!0);nl(function(){return ze.draggable.register(on.current),function(){return ze.draggable.unregister(on.current)}},[ze.draggable]),nl(function(){if(rn.current){rn.current=!1;return}var Ln=on.current;on.current=dn,ze.draggable.update(dn,Ln)},[dn,ze.draggable])}function or(ve,Se,Be){Ks(function(){function ze($e){return"Draggable[id: "+$e+"]: "}var qe=ve.draggableId;qe||an(!1),typeof qe!="string"&&an(!1),la(ve.index)||an(!1),ve.mapped.type!=="DRAGGING"&&(hh(Be()),ve.isEnabled&&(zh(Se,qe)||an(!1)))})}function Br(ve){}function Jr(ve){ve.preventDefault()}function Ao(ve){var Se=(0,ue.useRef)(null),Be=Kt(function(Xa){Se.current=Xa},[]),ze=Kt(function(){return Se.current},[]),qe=rs(Fc),$e=qe.contextId,gt=qe.dragHandleUsageInstructionsId,xt=qe.registry,Qt=rs(Yh),xn=Qt.type,dn=Qt.droppableId,on=Sn(function(){return{id:ve.draggableId,index:ve.index,type:xn,droppableId:dn}},[ve.draggableId,ve.index,xn,dn]),rn=ve.children,Ln=ve.draggableId,Bi=ve.isEnabled,Zr=ve.shouldRespectForcePress,Ur=ve.canDragInteractiveElements,io=ve.isClone,Co=ve.mapped,Ho=ve.dropAnimationFinished;if(or(ve,$e,ze),Br(io),!io){var Ro=Sn(function(){return{descriptor:on,registry:xt,getDraggableRef:ze,canDragInteractiveElements:Ur,shouldRespectForcePress:Zr,isEnabled:Bi}},[on,xt,ze,Ur,Zr,Bi]);Ji(Ro)}var da=Sn(function(){return Bi?{tabIndex:0,role:"button","aria-describedby":gt,"data-rbd-drag-handle-draggable-id":Ln,"data-rbd-drag-handle-context-id":$e,draggable:!1,onDragStart:Jr}:null},[$e,gt,Ln,Bi]),ja=Kt(function(Xa){Co.type==="DRAGGING"&&Co.dropping&&Xa.propertyName==="transform"&&Ho()},[Ho,Co]),es=Sn(function(){var Xa=Gn(Co),Us=Co.type==="DRAGGING"&&Co.dropping?ja:null,Nl={innerRef:Be,draggableProps:{"data-rbd-draggable-context-id":$e,"data-rbd-draggable-id":Ln,style:Xa,onTransitionEnd:Us},dragHandleProps:da};return Nl},[$e,da,Ln,Co,ja,Be]),qs=Sn(function(){return{draggableId:on.id,type:on.type,source:{index:on.index,droppableId:on.droppableId}}},[on.droppableId,on.id,on.index,on.type]);return rn(es,Co.snapshot,qs)}var ho=function(ve,Se){return ve===Se},jo=function(ve){var Se=ve.combine,Be=ve.destination;return Be?Be.droppableId:Se?Se.droppableId:null},ma=function(Se){return Se.combine?Se.combine.draggableId:null},co=function(Se){return Se.at&&Se.at.type==="COMBINE"?Se.at.combine.draggableId:null};function _a(){var ve=fi(function(qe,$e){return{x:qe,y:$e}}),Se=fi(function(qe,$e,gt,xt,Qt){return{isDragging:!0,isClone:$e,isDropAnimating:!!Qt,dropAnimation:Qt,mode:qe,draggingOver:gt,combineWith:xt,combineTargetFor:null}}),Be=fi(function(qe,$e,gt,xt,Qt,xn,dn){return{mapped:{type:"DRAGGING",dropping:null,draggingOver:Qt,combineWith:xn,mode:$e,offset:qe,dimension:gt,forceShouldAnimate:dn,snapshot:Se($e,xt,Qt,xn,null)}}}),ze=function($e,gt){if($e.isDragging){if($e.critical.draggable.id!==gt.draggableId)return null;var xt=$e.current.client.offset,Qt=$e.dimensions.draggables[gt.draggableId],xn=_o($e.impact),dn=co($e.impact),on=$e.forceShouldAnimate;return Be(ve(xt.x,xt.y),$e.movementMode,Qt,gt.isClone,xn,dn,on)}if($e.phase==="DROP_ANIMATING"){var rn=$e.completed;if(rn.result.draggableId!==gt.draggableId)return null;var Ln=gt.isClone,Bi=$e.dimensions.draggables[gt.draggableId],Zr=rn.result,Ur=Zr.mode,io=jo(Zr),Co=ma(Zr),Ho=$e.dropDuration,Ro={duration:Ho,curve:ou.drop,moveTo:$e.newHomeClientOffset,opacity:Co?Bl.opacity.drop:null,scale:Co?Bl.scale.drop:null};return{mapped:{type:"DRAGGING",offset:$e.newHomeClientOffset,dimension:Bi,dropping:Ro,draggingOver:io,combineWith:Co,mode:Ur,forceShouldAnimate:null,snapshot:Se(Ur,Ln,io,Co,Ro)}}}return null};return ze}function xs(ve){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:ve,combineWith:null}}var rl={mapped:{type:"SECONDARY",offset:zr,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:xs(null)}};function Fs(){var ve=fi(function(gt,xt){return{x:gt,y:xt}}),Se=fi(xs),Be=fi(function(gt,xt,Qt){return xt===void 0&&(xt=null),{mapped:{type:"SECONDARY",offset:gt,combineTargetFor:xt,shouldAnimateDisplacement:Qt,snapshot:Se(xt)}}}),ze=function(xt){return xt?Be(zr,xt,!0):null},qe=function(xt,Qt,xn,dn){var on=xn.displaced.visible[xt],rn=!!(dn.inVirtualList&&dn.effected[xt]),Ln=ki(xn),Bi=Ln&&Ln.draggableId===xt?Qt:null;if(!on){if(!rn)return ze(Bi);if(xn.displaced.invisible[xt])return null;var Zr=nr(dn.displacedBy.point),Ur=ve(Zr.x,Zr.y);return Be(Ur,Bi,!0)}if(rn)return ze(Bi);var io=xn.displacedBy.point,Co=ve(io.x,io.y);return Be(Co,Bi,on.shouldAnimate)},$e=function(xt,Qt){if(xt.isDragging)return xt.critical.draggable.id===Qt.draggableId?null:qe(Qt.draggableId,xt.critical.draggable.id,xt.impact,xt.afterCritical);if(xt.phase==="DROP_ANIMATING"){var xn=xt.completed;return xn.result.draggableId===Qt.draggableId?null:qe(Qt.draggableId,xn.result.draggableId,xn.impact,xn.afterCritical)}return null};return $e}var Zl=function(){var Se=_a(),Be=Fs(),ze=function($e,gt){return Se($e,gt)||Be($e,gt)||rl};return ze},yl={dropAnimationFinished:mu},Qs=fn(Zl,yl,null,{context:vf,pure:!0,areStatePropsEqual:ho})(Ao);function Gl(ve){var Se=rs(Yh),Be=Se.isUsingCloneFor;return Be===ve.draggableId&&!ve.isClone?null:ue.createElement(Qs,ve)}function dl(ve){var Se=typeof ve.isDragDisabled=="boolean"?!ve.isDragDisabled:!0,Be=!!ve.disableInteractiveElementBlocking,ze=!!ve.shouldRespectForcePress;return ue.createElement(Gl,(0,yt.Z)({},ve,{isClone:!1,isEnabled:Se,canDragInteractiveElements:Be,shouldRespectForcePress:ze}))}function $s(ve){var Se=(0,ue.useContext)(Fc);Se||an(!1);var Be=Se.contextId,ze=Se.isMovementAllowed,qe=(0,ue.useRef)(null),$e=(0,ue.useRef)(null),gt=ve.children,xt=ve.droppableId,Qt=ve.type,xn=ve.mode,dn=ve.direction,on=ve.ignoreContainerClipping,rn=ve.isDropDisabled,Ln=ve.isCombineEnabled,Bi=ve.snapshot,Zr=ve.useClone,Ur=ve.updateViewportMaxScroll,io=ve.getContainerForClone,Co=Kt(function(){return qe.current},[]),Ho=Kt(function(Hl){qe.current=Hl},[]),Ro=Kt(function(){return $e.current},[]),da=Kt(function(Hl){$e.current=Hl},[]);me({props:ve,getDroppableRef:Co,getPlaceholderRef:Ro});var ja=Kt(function(){ze()&&Ur({maxScroll:Nu()})},[ze,Ur]);xg({droppableId:xt,type:Qt,mode:xn,direction:dn,isDropDisabled:rn,isCombineEnabled:Ln,ignoreContainerClipping:on,getDroppableRef:Co});var es=ue.createElement(ke,{on:ve.placeholder,shouldAnimate:ve.shouldAnimatePlaceholder},function(Hl){var dh=Hl.onClose,Eu=Hl.data,du=Hl.animate;return ue.createElement(np,{placeholder:Eu,onClose:dh,innerRef:da,animate:du,contextId:Be,onTransitionEnd:ja})}),qs=Sn(function(){return{innerRef:Ho,placeholder:es,droppableProps:{"data-rbd-droppable-id":xt,"data-rbd-droppable-context-id":Be}}},[Be,xt,es,Ho]),Xa=Zr?Zr.dragging.draggableId:null,Us=Sn(function(){return{droppableId:xt,type:Qt,isUsingCloneFor:Xa}},[xt,Xa,Qt]);function Nl(){if(!Zr)return null;var Hl=Zr.dragging,dh=Zr.render,Eu=ue.createElement(Gl,{draggableId:Hl.draggableId,index:Hl.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},function(du,fl){return dh(du,fl,Hl)});return nn.createPortal(Eu,io())}return ue.createElement(Yh.Provider,{value:Us},gt(qs,Bi),Nl())}var Ya=function(Se,Be){return Se===Be.droppable.type},Ls=function(Se,Be){return Be.draggables[Se.draggable.id]},sl=function(){var Se={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},Be=(0,yt.Z)({},Se,{shouldAnimatePlaceholder:!1}),ze=fi(function(gt){return{draggableId:gt.id,type:gt.type,source:{index:gt.index,droppableId:gt.droppableId}}}),qe=fi(function(gt,xt,Qt,xn,dn,on){var rn=dn.descriptor.id,Ln=dn.descriptor.droppableId===gt;if(Ln){var Bi=on?{render:on,dragging:ze(dn.descriptor)}:null,Zr={isDraggingOver:Qt,draggingOverWith:Qt?rn:null,draggingFromThisWith:rn,isUsingPlaceholder:!0};return{placeholder:dn.placeholder,shouldAnimatePlaceholder:!1,snapshot:Zr,useClone:Bi}}if(!xt)return Be;if(!xn)return Se;var Ur={isDraggingOver:Qt,draggingOverWith:rn,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:dn.placeholder,shouldAnimatePlaceholder:!0,snapshot:Ur,useClone:null}}),$e=function(xt,Qt){var xn=Qt.droppableId,dn=Qt.type,on=!Qt.isDropDisabled,rn=Qt.renderClone;if(xt.isDragging){var Ln=xt.critical;if(!Ya(dn,Ln))return Be;var Bi=Ls(Ln,xt.dimensions),Zr=_o(xt.impact)===xn;return qe(xn,on,Zr,Zr,Bi,rn)}if(xt.phase==="DROP_ANIMATING"){var Ur=xt.completed;if(!Ya(dn,Ur.critical))return Be;var io=Ls(Ur.critical,xt.dimensions);return qe(xn,on,jo(Ur.result)===xn,_o(Ur.impact)===xn,io,rn)}if(xt.phase==="IDLE"&&xt.completed&&!xt.shouldFlush){var Co=xt.completed;if(!Ya(dn,Co.critical))return Be;var Ho=_o(Co.impact)===xn,Ro=!!(Co.impact.at&&Co.impact.at.type==="COMBINE"),da=Co.critical.droppable.id===xn;return Ho?Ro?Se:Be:da?Se:Be}return Be};return $e},cl={updateViewportMaxScroll:ro};function Iu(){return document.body||an(!1),document.body}var Bs={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:Iu},hu=fn(sl,cl,null,{context:vf,pure:!0,areStatePropsEqual:ho})($s);hu.defaultProps=Bs},38486:function(Un,ai){"use strict";var Le;var ue=60103,Ke=60106,ft=60107,yt=60108,mt=60114,Oe=60109,at=60110,Ct=60112,dt=60113,Ge=60120,Rt=60115,ot=60116,At=60121,Te=60122,ne=60117,te=60129,de=60131;if(typeof Symbol=="function"&&Symbol.for){var se=Symbol.for;ue=se("react.element"),Ke=se("react.portal"),ft=se("react.fragment"),yt=se("react.strict_mode"),mt=se("react.profiler"),Oe=se("react.provider"),at=se("react.context"),Ct=se("react.forward_ref"),dt=se("react.suspense"),Ge=se("react.suspense_list"),Rt=se("react.memo"),ot=se("react.lazy"),At=se("react.block"),Te=se("react.server.block"),ne=se("react.fundamental"),te=se("react.debug_trace_mode"),de=se("react.legacy_hidden")}function pe(wt){if(typeof wt=="object"&&wt!==null){var St=wt.$$typeof;switch(St){case ue:switch(wt=wt.type,wt){case ft:case mt:case yt:case dt:case Ge:return wt;default:switch(wt=wt&&wt.$$typeof,wt){case at:case Ct:case ot:case Rt:case Oe:return wt;default:return St}}case Ke:return St}}}var ye=Oe,we=ue,be=Ct,Ie=ft,Re=ot,rt=Rt,et=Ke,Ye=mt,ut=yt,tt=dt;Le=at,Le=ye,Le=we,Le=be,Le=Ie,Le=Re,Le=rt,Le=et,Le=Ye,Le=ut,Le=tt,Le=function(){return!1},Le=function(){return!1},ai.isContextConsumer=function(wt){return pe(wt)===at},Le=function(wt){return pe(wt)===Oe},Le=function(wt){return typeof wt=="object"&&wt!==null&&wt.$$typeof===ue},Le=function(wt){return pe(wt)===Ct},Le=function(wt){return pe(wt)===ft},Le=function(wt){return pe(wt)===ot},Le=function(wt){return pe(wt)===Rt},Le=function(wt){return pe(wt)===Ke},Le=function(wt){return pe(wt)===mt},Le=function(wt){return pe(wt)===yt},Le=function(wt){return pe(wt)===dt},Le=function(wt){return typeof wt=="string"||typeof wt=="function"||wt===ft||wt===mt||wt===te||wt===yt||wt===dt||wt===Ge||wt===de||typeof wt=="object"&&wt!==null&&(wt.$$typeof===ot||wt.$$typeof===Rt||wt.$$typeof===Oe||wt.$$typeof===at||wt.$$typeof===Ct||wt.$$typeof===ne||wt.$$typeof===At||wt[0]===Te)},Le=pe},53410:function(Un,ai,Le){"use strict";Un.exports=Le(38486)},32637:function(Un,ai,Le){"use strict";Un.exports=Le.p+"static/AssistantCode3.a8740efb.jpeg"},93314:function(Un){"use strict";Un.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMwAAACaCAYAAADl9acYAAAAAXNSR0IArs4c6QAAIABJREFUeF7tXQd4U1Ubfs/NaJtO9kzLahFQEJkiUBBFUFFkCCjiAAVFERT5FREQQQXBBcpysWRP2RtkKRsEOphNodCZdDfjnv85CU2TZt2bhABNDw9PmtzvrO+c957xLQIP0pkz1yrQIEmwwcDzHhTj91klEo7jpcG5zetWUJdmRjmPvTM9GI9JgSGvadOoLE9KJJ5kPp2YXLtZdO1kT8ooz2vigCNelvPYezPEG7z0CDAn4pJqPvJA5A3vdcl/S3LEy3Iee29OeIOX5YDx3nh4VFI5YDxin6DM5YARxKb7g6gcMHd+nMoBc+d57LKGhCQ1ZURBCoVL2nKCO8sBZWW50x1TOWDuLP8FlV4OGEFs8glROWB8wmbPKikHjGf882bucsB4k5t3qKxywNwhxrpRbJkGTOx0ehlA3d9e5VEtzA3ulGe55zmg1QOfrCVo34BgQGvr5rLDRl4RRZG+5NjBESBc4FHw1LlrCAuPsCo0JjKi7J5hYqfTXADBq4byCJLf82Nf3kA3OfD9LgKdgeCzZ4CUTJ1VKQFyKQgpmeMSjiKvQC+oplspN/wOMDcBVFv0Bo+KwYJ4VE50H3Jg7j6CWzkEX74A3MrSgTfeKZpSaBCHcAVn/JunBHlFPDR5BkG9LMjPt7mZLOtbskQADea9wqOW9coqiGHlRPcHBxYcJriQQvB9P+v2cqCwWFxgoOJk6JeTNX4HmJMAHv6xP4/6VXw/+OxNx/bM/pIohdUE9VW/VxwjOHiJYO5A6xolpGSpYW3jIW4w/A8wM+h+UHSY2pvHgzV9NXymeor0wPc7Cf7XzWJ/4Nsm+Ly2LzZx+OwZ3yuVbzhNsPEMwcI3rM8wMikHiURi5gNbbQoKrc84zpjkj2eYzQC6f96DomUd305ctrp8tp5gSk/f1utzlFhUOHYthy9f8D1gdpwnWHiEYOVQ6zNM6QM/AY+CImHnF9YtfwTMCgB9P+5G0SHa9xP3bk2gT9cBU3r6Hjp95nBYNcz3gDlwkRhX843vlfS59PmFHfjFzgC/2pJ1nEEnEIpIAG+834Wia2Ox7PJ8wt0twLz7J8Gsl3zf316zCVYPsz5oe85F1yUcu0YwcQPBjlElZyjL8wsrQeyBn+XxK8DETqefgyACFCPe6kjxfDPfT6C7BpilBLMG+L6/A34h+P1VikCZ60nuTYpzN4AxqznjCqPOMZ1RSp9f2OVLYZH1lbOrNvjVlswIGEAKYOyrj1K82NL3E+huAWbEMnbFSn1+Qzd4AcE3fajPZV6X04D3lnHGM4xOawKFJwLLYiD5H2AoCkHwJQMLA42v090CzJjVBBN7UCh8rN3AgDrqCYq6lX3L6RQ1MGQRhwWvA7UrALbnFzCJjOhG+d2WjFCkUYKZPZpSDIv1PWDGrycY34NCahI0+yxN/Ivg3c4UlUN8VqWxok/XEfRrSdG0tm/rzcoHBv7KYc5AILqqLWDcOb/45RmGEFyhFL8/0Yga33y+Tl9uJhjxOEVIoG9rnrqVKSJSRFb0fb3tG1A81sC39TLRSu85HL57Eaii0Bm3oqEKqZXSJaUURUxTU0Tyuy0ZAc5SYCUbxE+6+x4w3+0kGNiWooqP3/Qz9xB0bUTRsLqI2eEFUlbvA9WBJxv5ltdMit9jFocpLwB1InQIkBEQTmLUHStOBoMBOr24K2+/AwwPHOKArS2iKCY9VzKIg34jyMgTv6f1wpwqL8JLHKgUTLHwjZIxZTKg0V2Bzg2tLzvYBYA75xe/25J1mkEnGAzYyXE40KQmMK23uLeLN8b1j0ME7epTxFTzRmnCy/jzXyCqIny+NVryDzFeKfd+xLcrDOMMO8MMfgx45iFrOZA7AstiTvvVoZ91usM3tClHcLpeZWDmAN8DZtlRgkY1KJr5+BC87hQQLAeebCwcZN6gXH6MgG2P+rfyDmD+WLoV8xZugkIRiNh2TTHghcfRoF4tFBZpkXgpGQ81rmdu9puLOLzwMPBYPR1Cgzw/v7CC/WpLxjrc/jtaT2LApRrhwC+DfA+Y9aeI0dKzbT3vTCChk3r7eaBABzzfTGgO79CtPUmM9b7U2jv9bf3kOyjSlihLcoSg93MdkZ2Th227j2Hoq8/inTeeNzZ+xFIOsTHAsw/pAeL5+cUvAdPuG1pVRnArQgEsGex7wGw7RxAgBTo19M4EEjqtD1wEkrPYm15oDu/QbfkPSM0hHsu8du0/gSnfLkFGVrbThjFLynULJ6FOZHUw2RNbyd/qUJLFHZV+ywr9aksWO4Ou0BK8KueRz/bVq++CUuD+RGbhB3R/0LeAOZEEnFIRvPGYb+vdGw+cvU7w3uOe1dv+mfeRk5svCMUfvz8AA3o9jgkbCJQVgPe7lGTz5MDvj4f+VXs/JH1ip1PmAkHy17u8z42bjl4lxjf9C809m0CCZo4FUVwKsDPOJLz0ZTp6Fdh6jtnWe1bvuCm/4q/tRwQ1/b03e2LIwGfw1RaCkADg425AOvPkYCHZd0cG43dbsk4zaDFgWHiHcG85wjBQoEhnMhAzf5r/Jihkf9/+fjXDtDXqGA108+Eqcy0DYAfwMU95NnEFzVgLovibwK8HCab19qze61s24Pf5K7A5KwB5vHM1CblMij9m/Q87rtc1jsek54CMPIBayGD0BgP0ImUw/gwYFiqjllhHGAcvAkuPcijU8cgv0KGgSGv8LNJqweu1MOh14A3ss+S78W+Dzuo3RsPoTy0YgIjQALFz0C36tBzg570EE3p4NnHFVn5TA0zaSPDzy57Vu2bIS6jF67BDHYBHgnVI0kow+6ZjLyZNm9RD+35jkZINfNO7ZIVhEn+e16NQ6157/OqWjJ1h9n1IXoydTi8AeGD+KzxqinCEsfkswfBJC2HQacXOG7v0B+e9CGXVUK+U5aoQdm5iE3eqh296R/XoDEBu0e3/hcz3FzF+Z292trI91Zgav7N2tKrDrrfFTdgTI4dAl61BipZDDXYINRCMvBrusNvBikAMHT8LTM3/pwElK4xMAuQV6uBuKK4yA5hEVfY8SvmmHCETGyjDtzqbQLHf0KMgaCnWEcaW/whGT1mAHHZP6oW09bueaFy3khdKcl0EO+y+v4xgphs2MWxbs+K46bLCDIoi6+9iVLKY4PbTp8UB5t8h/UB53qimz1aJA9lyLExz7H1vyMCnUa15L/x9EfhtkIk/nh74y9ShPz5JnUGA26qFZIdcTofWqR5xxd5Uip1O9wDoJNYRxs4LBB9PXYxUdaHrGSqAYuWUp9GmSQ0BlN4h8cTq8qVfOGgKStpBeAoJb4DEYPrPsU89b/5e/LvEYPubLCIQX06NEtWpfwa/yA4h0FEgqVCK71OCUeTARdLLfbpg9PAXsfGsBBtOA0uHmKpyV0PZsqFl5lo5QaXWgRqNw4pTHiEYGa2M+KX0yMROpxsA9BDrCGNvAsG4GcuQdMt45eJx+nXsk3iyNbOY9k161wOry8/GqZCr1t4GBA/O3T0Nm7gSDl/89IBRHiU0nRk3CgU3knEmT4pZN51rrjI5TN2oGmCOMP44BKx7B8jINemP8ZRCK2Y5LNXAMrMlS0hSpwKw9TRGME+XHf5ekybEfPCInU7/BDBArCOMw5cIPvt+JRJUGqHj7JRu2rsd0P+JGBuanELTTVpwwO3/cnjFxNcTwMz95hquxud5pd+skIEfR6NJA+F2y6o1S3Fj4xpj/X9lBmK7OsDuChMUKMf+v36AXC4Fc4QxYwew/X0gM8/k5VKvN0BvcF9gfc8CJuGWuh4twgoQnJSBzK+nDP+3eLTsBahJSNL8DdD29kaUAFsDSU4vpVJp3FTETqdzAbwl1hHGySSCCTPX41RimlcmzthBrTCsV1Obss5cJ2hWXQupTIoiHUW+1nRYZkcn5kRbTzlIOQq5hBmimfRu2RwoeU4gl5rAFiI3Odpmb/NRK0zXu+zgKzZtWZWK/VvTxWZzSP/EK5HoEivcxsFQWIBzk8caVxmWmMT+g6thNlfMg/p1xYfv9DXSMEcYEzYAu247wnBXQ9myE/fslixRpf6FUgw2N5bgDChmk6Lw33MMqkqlg8JeVKmn8hRjHI0QIdgbiJynGWhiZ9AZoPhgaEeK50Q4wmDCvwmzt+HwGe8EcH67V1N8MshWV4UBpnlNLQID3Lcn5nkKrZ6iUEex4azEqC08di0BW1XDgsTP+2NHsrH6F+/0m9Xetns1PN9b3IWHPi8XyetXIOPoEeg1WbhYKMGK9CCoiiSoWq0SnuvWzqhLVuyoz+wI411mmi3epZI9Lt2zgElIUht9INtpdDJPMUsSGf59NCFFxc8TknI6AoZ9LqbCmj+V4X33zMAEAOMHtaXoJ0KLVpUJjJuzD3v+vSh+xtnJ0ffxaMwY0dHuCtO8pg6BAcK3LI4axCTai/4hRsBM3kww5DGK6o5vYx32S52pw9QxbEi8k6o2DMeoj2q5VVhqNnB29JsI0TP5M6Dj5Gg7dwmkpVZOsyOMtyg4joDyBhRq3d+Osbru3S2ZSp0LCmf+9ZM5CUY3qBWx3LREUy5RpbkKQOl0FAimvrksPAME08Q6wmD74DGz/8H2A/+5NdClM8U2r4VFE7rZBcwjtXQIkHsOGLbSLP7XBJhvdxD0fJiinhs+pVk5n41IBM/UFryQSHggvpxRooovpsgdFwjoD8MQri3ZIso/XYzm9a2FwDfUAFPxX/AaRYSCeCR/KW7fvQuYJE0RQF3vSQh2UQn3bsOaYXEJSZrPADrJBfP5BceCVx+4LO0r1hGG3gC8//Np/LXrmJjxdUhbv1YE9vzU22eAmbOPBRmieNCNFzvP8/jhaxVSL3vn4M9zBJN/bgSZgJsyplZ0KQ24oSZgq8vmE4V4+9hrkNIS8O5uPhbNOz+CprWpWRhd7Ahj9svMYM871rT38pbM/q2XvelHoeU4bpxBgt+Jjr8MAqfi80NXZEW/H1UEuOMIY/zCRPyxZr9XABMSJMP5pbelahYlsjNMi1p6402Pp8lyhWEhIBpVp2hdV1yp6nwgPAhYvzQF/+zOEpfZCfXgz6LRIMrxKsq0B5YcKsL6UxRFvBygelBdLjhZGMCx/RfTKWMCUGZzbAClvJEmtiGH97oEGLdhzBHGjL4UDyvLOmBUmn9AaamAay7GimAXgdErzG1RlX36k9el+PlgsPFtK9YRxtwtNzBl7havTZoLywYhuJRbSCNgauvBlAg9TQYDjyVHOeOWbOVxoEoo0Mn2JttpNZvOcmhfn0KTXoTr8TlITSnCrRSt8TMvV7gj79KVPDskCo+1tb/rZkLScavzcTlTARBrZUu+MB1coHNHZ8rQXEzvH4T+8yWY9DzQrj6QptFDzzRlPUj37JbM5pZMeCfZK5CNgsPt3PlbEny3LwSlHWEIqWLzcTWGfbFaCKkgml0zeyNaaa3QdqcAs+msSa2k+4OCmmYm2nyWQ98W9idabo4eqSla3EopMn6m3mRgKkJ6KlM6dV5Plz418ES3CjZE7Ar9w2X5UGXbv3bmC1NBAiqBEOf34zFhKlzLq40PuxK0i8qFutBzRdd7FjDx1zSDCKELxA2tmZoyyztqqc9tUdDlDAm+2hUCdxxhHIwrwOAJy5EvIkSCsz78Nq4rnmhpfU/BANOytgEydwQmpSpjQro/b68we+JNArzej4jjKouz0q+luDwGAzWCxnI1Kr0qPfpEZTzXv6pVwUzf6+MVBTiX6vi+hxoKQfUF4AJswWZZGF+UCUN2IsYMaINnbcVd4jp0m/qePcNcvJlTldcaUm5vVN3qnKNM1zUcJm4LhTuOMP65qMWYGWtxJcU76jGT3nwUrz1j7ZnCCBilAbLS96RucIFJtv88ZpLD/HMZSEgFXmkrrqANp2yjEYsroYRar6f44I3zxh9qNwnH8FHWNxBLj2ix6F85SKltmGV9lBrAF6RConCuh8fotCn7MSC2Fob3ELkPddDBexYwrL2JSZqtFPQpdwfHUT7mf+zjTWFwxxHG8St6zPhtCw6cZXcSnqdhLzTF2FethZcMMK2UBki9DBgmbz18mYAJbMUk5shiYBsxORzT5ucZ8PHbcUaC4OpBGDe55AbiShqP9/40gHLOt058UZbxXMPJnQuUKK+DLi8DEs0R/PJBLIIVwjULHPXgnt2SsQbHq7JeIJSYFIi8mNgeeeT6cFRQAItFOsL4L5li0do9WLrLriK06FZ2e7QO5v3PwugcgDcBo9MbsPT2CnMxFcYwdiNFuMhlKjcs/J23AMMEoONHJhj5JA2T44tvS2TTo5cX4kKqY5X9YuYacq9CEhzlMngmr8uGQasFLUpDPcUV/DCiKwrcNBwrrvueBsyKFVTSvG32aQraRPRMdJKBWaa+vSrcqNAo1hEGsyD8Y/1R/LzmjFea1EBZAbtn9rIqywiYSB5Siecey3U6A5YeN23JmCCPORIcK8IWhV0ps1Wpj8hzjyPmsDPN5P+ZNCWInMOXPz9g/PtgohZfbpEZ3SE5TxSGXBUkIa61vPnCDLCzFEuGrOMY1q02Xunq2VS6p7dkrKOJ17N7UAPP1PG9moatCoOBJ9go0hEGe+P+vC4e3yw84JX2VAoLxMmFL9sApnUkD4kXAKPV6bHsuNQIGDb5p28nmCwixmZSJnA5jeCZh1x3NzfpKi7M/xlFGRmo0qoNqnfohPAG1mcH1dUCfDP+sqkwjuCreY2Mf478swiJGa6V3Az518EFVgHhXMu0DYUZ4G8Dhuqy0Sg0EfM+8myHf88DhjEzIUmzAaA9XA+ZcIqR60KRp+XgjiOM3Sdu4s0vtyAkSIrgQCmCg6QIYZ+BMuPf7Dfzs9vP2bPi34ICZTh2szJ6NM41HuyrV7f2G8tWmNZRPCSc5yuMJWCYGcjHawm+7Sv8DPPfdSBfS9C5oWveHhg+GFqNyfRBEhgIeWgY2kz7AZysRDh5KT4fP0y5vZ0lwBdzGoO9FwbOK4S6KMDpCkP1eaD6fCNghCSDNhe8zmTsVznrMD59XIGa7Wx194SUVUxzT2/JihuZmJJThWoNZ0HgNY/EH28MRUY+B7GOMFibcrJzkJuXB3Z1zXHc7U9ivNlh0mX2aXpm/7ekLA57E6R44zHm5slWAs0A0ybKpDDoaWLhHJafMK0wLIm1ujx0iYD56WgrQO3ryuplSN6xzajkqM83+RCr1aUrol95A5zUJIT971QO5n2bZPybXYRNntsYvx4guLJrL1qkbsD2moOQHP6wlUskRkt5PfiCm5AEC/exa9DmgNcVoVL2KQy59RsqhAQg6tPvwAU5U1F0zvH7AjCsC4mqnE6UGpitvsfSJ0IIHb8lmNzIlkCsIwxPJzDLf10NrDtJMNyBjzDvAkaH5SdkbgOGOf5oVAN4sKawnl+YOwspf+81EzPIh9VvgCbvfoDAKlVx9JAai+ZcNz4PVBBE9W+M07uPo9/laeBgknSeC22ObbVeQ06QCRzselivuQhZBNveCX+JGAoyEZEThyE3fkIYNa00yh69UPdF6y2wsJ6ZqO6LLZl5pUlW9wHFMkrh6mTokgdf7QzG5UwpxDrCcFmwAAImPPztIMHorva3RkbA1GEhGoRPDkfVMj/EVoARaabM2vliCxj9QQtJ1GDAtU3rcGPXDmjVWWDfWWJbtHp9BiCwRScU6KQICJRg4VEp4g8ex4tXvrFSpGT0JxXNsKraIEgVFaHLuQ5ZSE1wAeLsEioRFZ5PnAVlTok5hiQwCG1+mAupwr1V5r4CDGNkgkrzEij93Znqi5CB/XafAhduySDWEYaQsl3RFGiB6Tsce4NkgGlbx+WtqatqjM9ZlOAVJ0tWmPeWEvzYX3gYcOY9cuKzsLE1EVK5oagQJ7/4DDlXS67gZTVqI6dlXxwNaIXrJ06j75UZkFhoHbNyK7Zqh2E3usHAlCupDgFhtSAJEmdsxsqJqZSHevmJaHPoC6vm1nvpNdTu7t6R+L4DjAk06t7M+tKuDb+QkQTw00EFTl2XQawjDIHFOyVj6h+frSeY4uC2it1MRVXgIeUIpBLTWcjdxMJArDgpN2/JPlpF8PlzwoPDjl9v0vZ1N2k1apz+ehJyVaZzS3HimUMKIoWUWrusqtDqUTR46308/bUKekghU1QBkbq+PbPXPkNuEog8DAOS5+ABzVEzSWj9GDSf+JVbXbovAcNs+oODFYSjsp8oqCm2gcj06z9BOHJNbjTZ7RDt/oQQWa2ZXEw0ZWY1yYzYGdCYuj5L7AJNwgBlvHRgj3mjnfvtx0YlS/Zcp9dj6wU5nmpiysccdLMYm5UECr3HruHwQ3/P+KPLzcWZ6VOQfdG5xWbVzl0R9fJgEI7DjO0Eu85rQSTuH1lbV45HbmYSzl1OR+2im4g0ZEJpyETdAC26zpnv1tDdt4AptulPNJ1rplMKUY6uFh8PxL5LARDrCMMtLtvJJAYw3qqTlcOCw7JYLUoBwWHZWWvBIYJxz3jeAiZxv7R0AZJ3bIetdT1B7T4voebTPc0VMbe2G08Wur26sII+6JyD5x4JQU6+FkfOp+DA2es4fO4GsvO1qFk5BE3qVEaTupWNn9G1K0AmILT1fQ8YxhhKqfTi9ewBoPQjSiFAxAasOh2AbfGBRr0qMY4wPJ86phLuFmBm7ibo2oSioYAL+uPXgKvpBIMe9VavgctnE5C7fyuyz58Bc2oRVKMWaj7XBxVbWGuELjxMsOxIAYjUtaqMo9Z90CkHz7WwXkoNPMXZy2k4ePYGDvx3HVdSTHIjBqCVn7verJQJwBQzjKnzJyRlPcZJuJ6UxwsAHEoP/joXgA3nAiHWEYa3ps7dAgyTeTwSRdHcuecDYzdXHCN4oBrwaH3v9Fqr55GWmY2ICNe3XWtOEvyy17MVZmRsLnq2dH4bdv5qBt6Ytg3d29TDOAFvhjIFmNLDGp+c1UxCycs8xTu3jcrMJDvi5VhxOghiHWF4Z+rcvRXGGBy2EvCYABB8sZHggycpqoa6f+lgya/MXC20RUUIDXV9gGJueb/d5tkZ5r0OOejd2nldm/+5gkkLDuOzQe3QrY1r2+0yDZjiwbp4PUNJeelKSqlZSX3/ZRkWHVNArCMMbwFm/AaC8c9Qt65rPWkDCw7Lggw9YVLhcprWnCCoH5qKGmHUaC4tl8sgl0kgl7FPqWhdt6upuQiWc1AoXN96MSd849ez62/31YPeeSwHL7Z1DpixvxzA7hNJWP9lL1RmjgtcJL8ADOOBSkWDCqiGaQoYlYn+TZJh/hEF3HGE4YqpQp7/sC0PrzRPhYxPg9yQjmCkoTA/HUV5aZDq0wBZBQQ0my6kKFE028/BGODpOYHBYfPy8qDT6aDT6Y2flolpUxeDhznscAWkfxKzEFNDAbncteIk8xIzYinxSBj1VrtcvPSo4y0Zs0Z96qPVqFpBgcXjnhXEx/saMCZfZNmTQCjTmZCAEC0oUglPU3iOnDEYtCcb16nCrDaN6ZxKU1HK0xOEIOrMDSlmHnDPEYZLzhoKAW0aivLSQXRpCKRp4HTpKMxNAy1KN36XE+cRAHjKIb/pckhk7h967bXz70STao47wWHZ9bZebwJOMYDY38Zrb4vEtKwZeAKMq5IJSDKZFOuPpqFr8yqCNBjYDd3AXwwgnPu+2Qa3zccrjzleNY7G3cR7P+7G8+2jMWaAMH8r9zVg4pKynudA1jmawExnjKf8fwRkAwF+j46MuJSoyupEKdkdnyoh0/e65wjDUX1c3MdA3hUEEO+YL6fU+BwRNUQa07tAM7v5OpNM8LoXg8PqDXrotHrojUDSQafXgXmrKZ3i0uV4vKkwiT2TJ/WcqYWBBLp8PzkieK1NIV5r71iO8/2qE1i2O8542GeHfiHpvgbMRVX2RzzlpwnpKCGEOa76i5dynxCeTriaTvpP2RnqliMMhwC9MBaBBaeFNEcQTU7FvpDWeU0QrVCiCynA7jjHip9Cy3FFxxz/mVYi0//sPD2u5wWgXUOBSmkAXvtVj7R819s3R215ta0Orz/m2FVVnwkbkJyWa7xOZtfKQtJ9DZiEpKzXAfKbkI6W0JAiQrDyZjZ5adyWUM4dRxiO6qOqRVCkLRPXHCfUt2gjhLXw7jmGBYdl18Uf+Tg47K4LBCz0uZh6P1oJnL/p/qH/5dYGvNnBfv5rN7PRb9JGVAoLwoavrC1enQ3gfQ2YC1ey6kil3CV2lhE7S7MKuMIxf4UGuuMIw1FdhszjCLk6XmxTHNLrqRT5TVdAJnNfPaR04cbgsPsIJjzrmbqL2E4evgxsPy+uXubM7+Vfmbss9661X2lDMdhuABRgyc4LmLnmJGKbKfHlW8KNyu5rwLBBS0zSbKBuWGOyWCoj1rrnCMPRZNEX5SLk3ACmVih2PjmkV9WYiso1RHrec1I7i1HJ5Ct3Kjiso6rPXgeY9P6bPsKB2uSRWKSlZbjNy3FjhuOTD5kIzja9891OnEhMxVs9muHVbsL5e98DJu5ydkNOxh934enfhmPsUDl0ZRgCZUS0IwyHWzJmqPPfcATorrk9yKUzZld5DTKlKUCQNxLr98jlJhV/X6ZrmcBXmwnmDBReb2R0CxQWmiOaiG5uj+5dsOyPH23yMd2ybmNWg6nJfDv8cbRpLDzO6H0PGMaN2zYyi8Q6/Ru+Ogw6A8FfIh1hOBs5evE7KLJ3ih5cRxluSR5FWLNxXiuPFeRJ6D53G5KWC3y4gmDhG8IAw7Ssa9Vlpsrup8jaNXHh+A6bAnYcu4bPfjto/H3z1D4IZ5JcgalMAIb1NVGlHkwpmQ1QwRf3H6wPRU6Re44wHPHXcGMTQm7+LJD9rsnU+soIaO2ux1z75Yu163fdStcUuYXA6wsIVg4VBpjMLDUeaOrgAOK6OjNFcvwhVCiluzbh90PYdvQqqlcMxuovSjSkhRRbZgDDOnsxOaczpYaFlEKQp4Sxm0KQlidxyxGGI+Zqs+IRfuUDIbwXTJMWsxghIc79CAsu7C6Ndg0lAAAdVklEQVStMEws88Jsgg3DhQEmSXUdLdt55hLJuIKs/g2x7UvcdrJtWPcxq40q/h2bKfGViAM/K69MAYZ16NKlzHCDlHwBwr0FUKdr7efbQpCs8a4jjMKCfITHDQRH3d97l578qmqTUblWczGYcErLzjDT+/hej63HLA5r32YOCl135dyFeHTuahtsynVOa4qvPv8II4aVyLJOXUzFsG9NW+bXuz+EISK9lJc5wBSz69KNzEheLxlFQVnEIrvmUlN3B+NiuncdYWi1OsjjP0KQznvxIDVVh0Bem1kreCcZg8N2pwhzX4juVkN6zebwx+u8oHr/OXoCPXrZBpsSW/GAvj3wy6yvzdl+WnsKi3aYnKFPHtIBnZu79qBpWWeZBUxxJ69coYE6ae4zlOqfIyBPM59uxc++36/AuZvedYTBJNz6+OkIL3AVn1b40N8K6oawRu8Jz+CCcvImgiEdKKoLF7p7pe4B8zl8148XVO+uPQcwYNAwj+tt0iga/+4t0Z4a8MUms9HY0vE9ECnUHc7tlpR5wFhyfA+l0lqq7L4A/QlAhTmHgnA8We51Rxh5FxejcvZSjwe7uIAk/cOo0nqK18qbsYPghebUGO7Dl+n1Pzh89iwvqN71G7fhzbc/9Lh5LALCzr+PQVMkR2w0Na4u566m49J1tVElRqyDEb8CTDH3LyblPMhTw67fjwZVPXTV+44wspP2oVq6IBU3QRPiprYWwtvOE0QrhGj2PoKO0dSoR+fL9O5SDm/H8oLq/XP5Gowc7R2tic9/XIlNyU2wY5RH1gJGVvklYFjHL6k0Ty85EbhxV6KceNsRRuatS6h1fYTX5mK+IQR5TZcbDb+8kVhw2MY1KFrV8UZpwsv4ZC3BCw8LC0o7/7fF+HRCydnDWS1FOSmQh1S363aX5XtlxGTEBfbCxveAIMFCB/s1+i1gGDsGL9Cvvpgm6eVtRxgZGZmomTQYHNUKn01OKHlIcEG5AfWE+eB2WefKY0DVMCDWO0G5XNZXTMDOTu3qUzxuinDhNH0/cx6+nGYrpS+diflxLkhPgFRRGfIQ+wzq9OxA5DUei5VDgYruObw0V+vXgOn8LR3L85jibUcY6iw1KiV9CLnhpqt5Ieg5DxkOV16PRyKFyTBcFbrxDPNZJj44rKtyXT1nvsYaVqeC4k1OmfoDfpjl2ncYb9CiMOOS0edyUOVoEGM4cuvUuGkrBHdbgIVvALWs4++6arLNc78GTOx0yq6efvS2I4zs7ByEJY1HkNYUactZ4kkg9FwE9JIKMEgijH8bjN/Z36bftCQcudLaeKC6q9KEPd8dB2Tliw8OK6x0x1Q/7SWoGkrRt4XrksZN/Brzfl3skpB59S9IN13hy0KrQxZkK+ANCQ1Do7ePYO5AoIF1DFqX5Zcm8G/AfENfB8Fv3naEkZubi6CkbxCou2yc9CZARJgBwcCRVlgZV3KC0aSmAhwnQYBcYowHI5FIwIN9MjPfkt/shcUQPdq3Mxy5DLDwfQNFBod1t77ifMyxuVxCBdX7wZgJWLzUdXh3Zh7NtmSgPCQBIQgIt+8/qtmw3fj5zep4yDoGregu+TVgOk2nTNl8pbcdYeTnFyA9U2MMDhQYIIFcwoGTSGCgnHHLECTnIJVIMG2H1BjywtcCRBYc9shlgrdEBocVPbtKZVjyDwGLLyqk3mHvjsGa9ZtdV0k4FGZdBa/NM/JbUcX+wSy692z8PDoWAjwpOa3TvwEzjXajHLa0b0DxSXfvnA9cj3AJxfe7TG5bq4aKyeU5bWIqsOkswcguvu3zyuPE6IBDSL2DBr+Hrdv3uOxshVqNkZqwH7q8NCNtYKUG4CS2V2G1OozE7ClvoZOHFx3+DZjptD0F/m4RRTHpOd9OHja4c/cRdHuQGh3r+TKxScuMuXz9kmDRmM/dgKB6+wwYgv0HjrhkS6+Bb2PlbzNQpDbZILEtGdualU4VH3gaX0/92ii89HZSVpY7NQllzvOLfYG7W7d7Nqe3a/NGA1hR7WfQZhKKU0yAN62396wkhTKFyUPa1qVo6KXDvNB62YH/2x0EXzzv/cnjrA07zhPsT4SgepkeGdMnc5V++nE6Phz/PTITmEIlhSykOmQK24M/W3mmzV2Lpxp7f5z9BjCPT6P1DRwuetMRhqsBtnzOnFHEVAMeVvp24hbpmata4lHcFzH9LKZl8TJXn4Cgep98+kWcPmtSknSWVi/7BZNmrsc/G2eC1xVAqqgEeYjtVRjhpPji1wN49qE7x+uYyAi7C4E3XvA+XWFU6Vo1ABsP2MzJwvDlMnjTEYarAbZ8zrYoVUKBR+vduUF01J67YUR2OhmYs49g9suu+9uhy/OIT2DyFedpz/bVWLXtFL77/F3o8zMhCQxHQJh9nZ/RU5diYJc7p95QZgCTnKHLppTaHK3Zm3bwYhkqKIDFg72/VLsabLZFYbYhnRu6nkCuyhL7/G4AJuEWwKT9QsyUWz3WDdeSkl1268zR3ThwLgtDBzyFIo0KnDwYgRH2VfYrP/jCzKTdX3pPZ8ll60wE990Kk5yhi6OU2kSaZx5OBy2UIkDqPUcYAnloJDtwkSC7AHj6Dm4THK4wIoPDiumXI1pVJjBqBcGqYa5fEA+16IxbqaabL2cp+dJJ3MqRoGXL1si7cRKcNAiBFe2vIopqDZemn133kqsyvf38fgTMJkops4WxSUOWSFGoI9joRUcYQhl+SgUkZZK7EtBp3DpgsjhzdqHdckiXlQcMWcReTq4Bw+z5mV2/sxQcrMCVuH+NoQof7DwESf/+aTz4B1WyH8tDHl7zhDpxlwA9A4+7alXAfQcYVYb2V1C8YY8N7y6XQl1AsGoojyD3vZK6zWHm9siDmK9u13u3Mgrtb71GbZCbm+e0mbVq1cDJIyavMK99OAvrfp0IfVEOFJWj7earUKUG9mxZ45WuOzqv2Cv8vgNMcqZuCuXpWHudGb1GipvZxKuOMLwyIn5eSGSDR8AiQDtLDzZ+ALu3rTKSzPrzAMa//xK0OSlQVLHZfd8uhuDQ/p1QKDyPiFCmAaNK17KD3g/2mP/ZXxJcyeAw/xUeNT3UZPXzOe7V7tes2wx6vcFpme3btcaa5SbX2gfP56Dnk62NipiKqo7tB1at+BMPPdjE47a6kr1YVnD/rTAZ+r6U8ivscWnyVgnibnL4sT+P+l6yN/F4NMoLQLXIh2zizpRmy9PduuCP+ab3YE4h8OCjzyMzfrvDMwyjm/rVZPR8vofHHC7TgLmRpetoMFC7Ximm75TgVDJn1G96srHrw6jHnC4vQBAHqipd+zvu/2JP/Dhjsrm8zv0n4sSWHx3KYRjh0DcH44NRnt8sl2nApGTROnqD7oq9kZq1T4IjV0Q7/xc06OVE7nPg6DS2bXL+AqvW4hVEdvnEXEna2bW4uGY4pEGO99ZPPv4YZs3y3DNpmQYM42hyujaBAjbXJxvOcFhxggHGI+UD92dGeU67HDg6/SGAd36GqfHoMNTuULJaFGZexem5T4CTOL7ufCCmAf7dv0EQ11MyrWN6WmYq84C5lqEdyVF8J4hTlkQc+URZUSbMG4PowsVlSEhSO3zlBtm5+alR0UOPD+KaZ5fa0aQryM+3oi/d/ocfaYOCQudxQCeOHYUPRrxpLocZk8U0i8Wt1HSHLQ+Qy3Hj0jFjzE1Xya8Bw4IuJWfoFgJ42RWjip8TQlbVqijtbwz3dw8kfwJM23YdkaXWOOX6tMljMWzIQCuawW9/hJVrNznNt37Fr+jc8VGXI+rXgCnmjipT353w/Es80IIALDAIM56QMFBQSpmkLAUEJzmeX1qrSuBfLrnqQwJ/AkyXJ7sh+bo5ALZdLs+cPgmvDuxj9ezPFesxbETJucZexrfeeAnTv3QdQqTMAyY5TdeZEspcjdjXjfDm5Ka4REDerF1F5tos0Ev1+hNger7QGxfiLzrl3PyfpqJfb+sr4vSMTDR4qCOYy15HSVmrJs4ddx3Dp8wDRpWhvQQKYfGjvTGJCS4rK8nvPDhvt9WfADPwlUE4etx5ROpFv/6A55950mYkn+zxMv45etLpCB/esw5NGjm3Vy77gEnX+lyQIua2xFOM+hNghg8fjp17Djhl2aolc9C1i21A1x9//h3jJn3jNO+EsaPwocWFgT3isg+Y8hXGatzv51uyTz75GGvWb3E66Teu+h0dLYIlFRNfuapCs7bOgzG1a9MCW9ezKI+OU5kHTPkZxnrw72fAfP3VFPy+yK42k7mTOzf+idYt7cfB7PBkH6cmzsz/29ULhxAe5thlT5kHjOV0SUzKfp6CLwkMAnIjJjLcyo3bRZV6Kk8xxpyPIjsmqiQgYkKS5jpAzfauBFzP6Miw9Z5urdzN709bsjmzZ+K7mb84ZdWBnavR9MFGdmm+/XE+Jn7pXOy2cP536NnD8UrkX4BRaSZQSieauUnIphhl+LNWoFJpFlFKSy7yCYmLUYabRyBBpdkISp8pzkMImRitDP/c3QnvaT5/AsyyJQswYcq3Tll29O+NaBht/45HyLZs0Et9MOvbSQ7r8DfArKOUPm/BjSkxkRFWl++JKvUuSvF4CSCwO1oZ0aX4e0KSmmn2fWoBmPXRynAf2ymW9MCfALNt8zqMGD3BKWDOHt2BKKVj36+du/XD8VNnHZZRu2YNnD+xqxwwjAOJKvU1SlHiDYGgT4wywspZb8I19QUQlBhPULokJqqCecVJUKl7g8JkocS0zQiSopURUZ6uFO7m9yfA/HtoL14Z8r5TViWe2Y9qVR2HUftp7kJ84iLGjLNVqsysMKcTk2s3i67t0KXIheTsSlJK0yilJRqVFPVjoiIuW59z1Ew5q8T9EsE3McoI85km4Zq6HgjMvn4IIVRPSJVGtcMy3J30nuTzJ8AkXjiJZ3uXRD+2xzdV/BGEhzsO1JlyMxWNHnncqRDzmymfYuhg+9pS3gKMq/kqZE54pBp85sy1CjRIEmww2BfnKoKC23NEsrzk/IKc/PycRjzTzrudQoLCAi3BwH6mlH6eV5Bjjo3HEUIUitALoDBfpfDU0C+/IM+5gEAIB9ygCVGEXXeUrawpX2bcvIx2jzuPHJ167SQCA5yHZevR9w3s+9uxy9mnn+qMZQtYyFPb5Awwaek3BcUBkEg4jhQY8po2jcpyY8gtprAnuV3kTVCpPwKFOcgkIdgbrYzobJntokrTgKfUKjY4B/RvEBlRAjTT1m4Ppehk0fIxMcoI51KxO9Q3f1phaFEmHmhuNWQ2XNWknHMYpq+YePGytXhnpPkYalNGSEgwkuIOQyq11V721grjjeng0QrjqgGJKs0SSqmF/ynyfUxk+CjLfAlJWR0BYmWFKZVyHevVDPvbmk7zHUBHFv9GCPkzWhkuWOPZVVvFPPcnwFQI5lE1qrlD9jA1/bSkUy7Zl52TiwYPdkBhUZFD2u0blqBta9u6/AcwSZrzFNR8PcxR8mqDqHCm2m9O8Uma/gTUKjY4R0h0A2W4lcbfxWuaQTyhC8yAAbkQHRne2OVI3QECfwIME7pWr9sC+QUFdjkZFhqK5MR/BHH5taEfOtUa+GT0u/hk9Ds2ZfkFYG7coIo8gyabUpiDHUqItGl9ZYjV/WJikmYUBbW66A+RhgfXrEmsLJsuqXIfMlD9mZIVBoZgSXhYaTpBI+chkb8BpknLJ6BKvmGXa1WrVMbFs/sFcXT7rv3o8/Iwh7SO1GT8AjCJydmPUp4/ZMGdwmhleCghRG+11VKpp4HiI4vfNDGRETbG4JRSaaJKk8Ni9ZhBw3HtomuHHRY0Wl4kEgsYL1bt9aJcWVyyCnv1HYBz5+x78K9Zswb27NwqqF16gwGxnZ9Eerr9y01mffnv4QNQKIIElceIfKl0y+q7Y2eY+CTNOwS05NqDkKMxyvDWpTmRqNIsppRanEXIhRgHW60ElYb5I21VXAYFGd4wMtxzTwqCh8dE6G+AGfzW2zhwwPLdV8KwunXqYOtm4VpKX0+bjt//cKxs+cu8n9Gh/WOCR6TMACZRlT2PUr7E0Jtw82KUYUNLcyL+mno3ISi5hiFkV4wy/Al7HEtQZc8F5d8q2ZZx86OVYebvgrnsIaG/Aeaj/43Fhr/smxs3bBiDDWtXCubohbg49OzVzyH9kMGv46MPzXc7LsstO4BJ0hyloC3Nkxt4JzoyYnZpDiRcU8eBwOxTlFK6uGFUhVfscSoxSf02BcwrCgE5Fh0Zbl5xXHLXSwRiAXM/ayuztn88/mv8PM/qrsbMyRbNH8KeLVYSAJdcZnKd/87H26Vr3uxB7NtmrR1d5s8w7LxxUZWdQ0Etzhvk0eja4TaSq4Qko4cFs5iYI9y0Bsqw/9kFTLKmLeWp+cxCQAobKMNszkUuR8xDAn8DzLTv5mDy1B/tcq1d25bYus4+mByxedacBRg7cardxxzH4VrcYSt1/zIPmMuqzKZ6ylnatRpCpPlhNWvWtLr5unmTBmdrNbmWnCOUjIqOCv/eHjdv3LihyNUrspmzjOLnUsI3q6esaL498xALgrL7G2B+W7gcI8fYVw5/PPYxrFvO3DcIT2npGWj4cGfo9Vb3P+YCmMSfSf6LU5kHTPy17FcJ4f8o2Y6R89GR4Taepy+pNNEGShOsAYN+0VERDi2WEpM05yioWf5CKfdaw6gws3xG+LC5T+lvgNmwaQcGDravgNm9a2csX2hfpcUZh/u/+i42b9ttl2T40Ffx1eclm4wyD5jEJM131FoqvyRaGW7tuMqo7pIVSynZa8k1Cr5jw8iKVlJ+y+elb9UIyPfRpbQH3IeCsJz+BphDR46jW0+7x0qj4RczABObNm7ZhZdef89uNmaMxozS/GaFSVSp91KKWAtufBQTGTG9NHcuXtf05w3WUn4CNIiOjHAYhTQhST0agFmHjBDsi1ZGlOiYiR05N+j9DTDxiZfRqoOVzZ+Za/369MD8WfbPI85Yq9Pp0fDhTmDumEondo5hZssRtzWgy/QKw1T5L6o0WZbq+pTiiYZRETYWQolJ2R9Q8DMsGRakDFcoCbGvhwEg/pq6CyEwO7MigKaBMrwCU/l3Y+67lcXfAMNC9tVp1M4ur159uQ9mznBsLemMwWMnTMOsueaduxXp0j9m4ZluJpvCMg2YxCR1fQqY9cDYRA4MC6usDCc2r5KEJDVbKdiKUZzUMZERFZwxWaXSVCwE0i1tbFytSm6hwkkmR4Cxp9rPirnfr5WZM75KymYwGGw99Qr1XmmPnefjEtG2k6UxbgmV5TmmbAMmWd2H8jBLsgjBtWhlhN1wuglJmiWAlTbz+Rg7lwOlmZ2oUl+lFGaLS8Khb3TtCLNFprcBUro8fwMM6z/zYpmaZutc/L23X8eUCZaaTeK437l7Pxw/aWu+3Oyhxvh7h2lIyzZgktRTKGCOY0kI1kUrI+xaICUkqZl715LzB8WumKgIu1J+y2FIVKnXUgqzTT8BvoyOjHBsbCFuDF1SiwWMywLvIoEQXTLWvB49+yAhwcpsydjqYUOHYNT79g/vQrq1bPkqTPj8CxtSdo759/DfCA1lLrcdp/te0p+g0myCRWhx5jGmYVQFu5f4CSpNHCg1S/kJIYuileGDXDE6/lrWBOY5xkxHyOYYZbjZq4yr/J4+90fAvPbGWzh8xFaNf8S772D4OzYaT4JZnJubi/Ydu9gNqTF39kx0irX1qGlZuM8Bc+PGZa86k8jVVzwGwOwRQQLD4CCpxq5LkFxDxXOgCC5mAOEwO5jLdHnlUqAP72KA5FcLxqWHSDPNajiCR8tNwlx9xav2sjo6w9ymTeCobjTR3bpjQlaDvLbddjnrptAV5oPRH2PTZlsPmLVrVv1q7+bf57rJSmO2Zu36TM3LLzArmAVWqo+qD/dD96c6Y1T3CiASx/F1JNpku9t9T9rjLO8d01a+Uw0uL/fucCCoSqPvCYGN9JJS8n5B2nn7ejMCmxpUpUl7TsL9HRHdBVWbD0CYspXRNZA+Lz394IQq91SI4HLACBxUfydTVGs8FpROseUDHZafGufRCtNxOh1nyM+YKFVUMqs86fLSaW7y0U1n5j/teahlLw5eOWC8yMyyXJSiWqMhoLBRGiOUvpaXFueRalLsdPongAGMfwUZl6G4sARtcw4e/XrXNhv7qbvN43sCMGcSUyy1Asw8aRpdw+gcw9FzMcwrLktMnnLaEg4oqjV8DpSzsRSjPAYUpF9Y5gmvOs2gbXke069tm8A9l7enaYNQWXCAhKMNK4ZFdl6yxqHfO0/qdDfvPQEYdxtfns93HIj9xpBm0BVUpgYteH0ReL0W1FAEWXDl/w5+VvEhIS1JSbli98VYnLdGjbr7furWZVGYXDawYlAAgmTSMY8vXn1XXGk56k+ZBYw3ViV7TLvXVipXk1DIRHZGwyYxex47nf4LwJ6xXuK+0cR5CDERjdjzWs8IXsvdvJRTGDDt7HXt9QLtmIJbF34QUcQdJS2zgLmjXPPHwmu2UCj0+SxYr1XiCN8l91a8fT19kXwqBv9Xg975fuHZaw9reZN6YLWqlfYe2rGoRO4motxiwIvI4pS0HDDe4qSflDPrqS5aA6UyAtAR23dz3u52gyffH3vj9HYWrcE0Nyl0lCOjC255dnXtrXaWA8ZbnPSTcna/3PsyBa0LILPLkjWVvN3tyk2emp+fljTEVC5N43j0zU2Ps/KM6u06xZRXDhgx3Cqnxe6Xe12gYKFJSF6XJaudK3qJ5xdRVG3ETNvZJcI5nqPPFt6ME629IL5a4TnKNGAopfLkbIRIDAgBj2BQnUJPiUIqQRD7JNSgAIgCBIGUkkCOIIAHH0gIFwBKAkH5QEogJwRyUCKn4OWEcDJCIQeBnFLIACoFAfOgLQX7TnH7O5UCHAdQCQjhQKkEIKbvAGf8m4DAFAqEEGIcCnLbbMH4m3FDAtDbtj70dtADCmb7w/6B8gB4gBiMfxNiAGW/se8sogLRg0IPYvyvA2D6DqIn7DuFlhJoKeV1BJwWhGophZZQaEG4QhBaSClfxIEr/HbR1mZrli2unp/8X6tcHW92bhJdv/6cLRvW/AIiyweHPIMEubXDkEsI0QqfhibK4KqNXqEA86hxOF9X1B1Zl5mDlHsq3dOASU2lIQYZKuv0usrgSCUJIRUBvgLlSQVKEMGBhPOgEaB8OEDCKBBGYAyJEUKBEAI2ocuTOxw4dfoMzp0/j/j4RJw5+x/i4uJZGBKbotq0boWFf9jGwKSAjgDMwUkuBXIIkA3QbBBOw4GoeVANoVATjmYBXJaB0syWrR79SSaX33rhuef7zpr2P/u+ad3pjBfz3BXAUEq5lCzUNhj0dQmhUQBRArQWBalBCGoAtBqlqAZAuM9QLzKlvCjgzaHDceCgydslc+Eqk8nNoSiYIRn7r9PpUCEiAn/vMxvAepN1BYTgFkBuUYoUApoCEBYcWEUpuSaRSK/UqIBkQghbZX2W7jhgKKWylCx9WwOPdoTQhylIE0IRbemzzGe9La+oTHGA+aWjBIkE9Byl5JSEw6EaFaRHCCFs+3lH0h0FTHK6bjIFhoNtm8pTOQd8wgGiJsBPtSvLrAIPe6vqOw8YguGg5YDx1oCVl+OCA4SoCb1PAcO6Zt6SAe0IpQ9TigcBRANwHhSxfGaUc8A1B1g4s0RC8B8l5JQE9/mWzFF/iw/9hOjrGkCiYKDmQz9AaxKCqpSSagAtP/S7njRllIIUEELZgT+VgqZwIDeMh34JUUlAr1FaRg/9noxm8bUy1esq6+1cK5vORiS8/FrZEy7fmbzOrpUBqgGImhCoCUqulaU8zSBSWbpEh/SqVYmVz+0700rxpd7RM4z45ng3hz3BJSREoadQSDkSZKBQgPIKUAeCS8IHMiElE16aBZeAnICTWQouCYHUJMQ0Ci9vCy6JlIJKOJOAkqNMcGkrwCTMFJdYCCwtBZilBZbsO5NWwiQPoaUFlsQouGQSS8oTkzCzRHAJGIWVtLTgEryOAtpiwSUTWjJhJqi14JKnKCKEFoKgEITLlxDk63laICXIh4Hme0Nw6d3RvzOl/R8AdGoXzom1qQAAAABJRU5ErkJggg=="},73631:function(Un){"use strict";Un.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAAXNSR0IArs4c6QAAAZxJREFUOBGtlL1Ow0AMgH2XUIkOLFXVASgTsDHxBIAEzAwMPBQjT8AATGVBgEBCYmHmFcICYmBogCbNYSe52HUTVZWwFJ3PP599Z+WMcy6Af5SwYkWnLYifTyBzq5XNK8YNwbbvYP381ZuaVlN1+HJwAc4d1QYaA+gDsHYANrhGHTdCMtSDMILtwSMDn7ZiANPKwyjeQ0Reo4r1gEoEwRkDb7spdPcBeocMk1Cv00oii5L+fgPwcR/zHfb3AJY2sEpUVLOUhB/l+w7I1iS9TYDFrM3AzhqGDstPZ3li2Z12U2WLvk4fGJh+F0elYN8ZrbWiA7igAP4WR6sFzDAKPgPHP0VnlMsFS5IyyIGoeAamCKybYI5UQLWVE2fgGI/s72wqQXRd9jyxiHgGJtihFxGQm8Qd5XvtF3fEQOrQH9mDm1Z9hyJuEphXIq9uSWSQqv8a4RbAUTFdcs7gifwplYGjT3wzbPFz6Q70EZv8WZoxMP66ApMc86inirNBA8njcFIuvOTXhowPyzuQJiukzi3hQgS7b+I9nJtQn/AHsLGsvlcPPWsAAAAASUVORK5CYII="},31328:function(Un){"use strict";Un.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(Un){"use strict";Un.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(Un){"use strict";Un.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(Un){"use strict";Un.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(Un,ai,Le){"use strict";Le.d(ai,{Z:function(){return Ct}});const ue=dt=>typeof dt=="object"&&dt!=null&&dt.nodeType===1,Ke=(dt,Ge)=>(!Ge||dt!=="hidden")&&dt!=="visible"&&dt!=="clip",ft=(dt,Ge)=>{if(dt.clientHeight<dt.scrollHeight||dt.clientWidth<dt.scrollWidth){const Rt=getComputedStyle(dt,null);return Ke(Rt.overflowY,Ge)||Ke(Rt.overflowX,Ge)||(ot=>{const At=(Te=>{if(!Te.ownerDocument||!Te.ownerDocument.defaultView)return null;try{return Te.ownerDocument.defaultView.frameElement}catch(ne){return null}})(ot);return!!At&&(At.clientHeight<ot.scrollHeight||At.clientWidth<ot.scrollWidth)})(dt)}return!1},yt=(dt,Ge,Rt,ot,At,Te,ne,te)=>Te<dt&&ne>Ge||Te>dt&&ne<Ge?0:Te<=dt&&te<=Rt||ne>=Ge&&te>=Rt?Te-dt-ot:ne>Ge&&te<Rt||Te<dt&&te>Rt?ne-Ge+At:0,mt=dt=>{const Ge=dt.parentElement;return Ge==null?dt.getRootNode().host||null:Ge},Oe=(dt,Ge)=>{var Rt,ot,At,Te;if(typeof document=="undefined")return[];const{scrollMode:ne,block:te,inline:de,boundary:se,skipOverflowHiddenElements:pe}=Ge,ye=typeof se=="function"?se:zn=>zn!==se;if(!ue(dt))throw new TypeError("Invalid target");const we=document.scrollingElement||document.documentElement,be=[];let Ie=dt;for(;ue(Ie)&&ye(Ie);){if(Ie=mt(Ie),Ie===we){be.push(Ie);break}Ie!=null&&Ie===document.body&&ft(Ie)&&!ft(document.documentElement)||Ie!=null&&ft(Ie,pe)&&be.push(Ie)}const Re=(ot=(Rt=window.visualViewport)==null?void 0:Rt.width)!=null?ot:innerWidth,rt=(Te=(At=window.visualViewport)==null?void 0:At.height)!=null?Te:innerHeight,{scrollX:et,scrollY:Ye}=window,{height:ut,width:tt,top:wt,right:St,bottom:Lt,left:mn}=dt.getBoundingClientRect(),{top:$t,right:Pn,bottom:Ot,left:ct}=(zn=>{const Ht=window.getComputedStyle(zn);return{top:parseFloat(Ht.scrollMarginTop)||0,right:parseFloat(Ht.scrollMarginRight)||0,bottom:parseFloat(Ht.scrollMarginBottom)||0,left:parseFloat(Ht.scrollMarginLeft)||0}})(dt);let nt=te==="start"||te==="nearest"?wt-$t:te==="end"?Lt+Ot:wt+ut/2-$t+Ot,gn=de==="center"?mn+tt/2-ct+Pn:de==="end"?St+Pn:mn-ct;const oi=[];for(let zn=0;zn<be.length;zn++){const Ht=be[zn],{height:Fn,width:Cn,top:ii,right:Wt,bottom:Hn,left:lt}=Ht.getBoundingClientRect();if(ne==="if-needed"&&wt>=0&&mn>=0&&Lt<=rt&&St<=Re&&(Ht===we&&!ft(Ht)||wt>=ii&&Lt<=Hn&&mn>=lt&&St<=Wt))return oi;const An=getComputedStyle(Ht),Ni=parseInt(An.borderLeftWidth,10),je=parseInt(An.borderTopWidth,10),Me=parseInt(An.borderRightWidth,10),Ee=parseInt(An.borderBottomWidth,10);let De=0,We=0;const Ae="offsetWidth"in Ht?Ht.offsetWidth-Ht.clientWidth-Ni-Me:0,Je="offsetHeight"in Ht?Ht.offsetHeight-Ht.clientHeight-je-Ee:0,Nt="offsetWidth"in Ht?Ht.offsetWidth===0?0:Cn/Ht.offsetWidth:0,fn="offsetHeight"in Ht?Ht.offsetHeight===0?0:Fn/Ht.offsetHeight:0;if(we===Ht)De=te==="start"?nt:te==="end"?nt-rt:te==="nearest"?yt(Ye,Ye+rt,rt,je,Ee,Ye+nt,Ye+nt+ut,ut):nt-rt/2,We=de==="start"?gn:de==="center"?gn-Re/2:de==="end"?gn-Re:yt(et,et+Re,Re,Ni,Me,et+gn,et+gn+tt,tt),De=Math.max(0,De+Ye),We=Math.max(0,We+et);else{De=te==="start"?nt-ii-je:te==="end"?nt-Hn+Ee+Je:te==="nearest"?yt(ii,Hn,Fn,je,Ee+Je,nt,nt+ut,ut):nt-(ii+Fn/2)+Je/2,We=de==="start"?gn-lt-Ni:de==="center"?gn-(lt+Cn/2)+Ae/2:de==="end"?gn-Wt+Me+Ae:yt(lt,Wt,Cn,Ni,Me+Ae,gn,gn+tt,tt);const{scrollLeft:vn,scrollTop:Ft}=Ht;De=fn===0?0:Math.max(0,Math.min(Ft+De/fn,Ht.scrollHeight-Fn/fn+Je)),We=Nt===0?0:Math.max(0,Math.min(vn+We/Nt,Ht.scrollWidth-Cn/Nt+Ae)),nt+=Ft-De,gn+=vn-We}oi.push({el:Ht,top:De,left:We})}return oi},at=dt=>dt===!1?{block:"end",inline:"nearest"}:(Ge=>Ge===Object(Ge)&&Object.keys(Ge).length!==0)(dt)?dt:{block:"start",inline:"nearest"};function Ct(dt,Ge){if(!dt.isConnected||!(At=>{let Te=At;for(;Te&&Te.parentNode;){if(Te.parentNode===document)return!0;Te=Te.parentNode instanceof ShadowRoot?Te.parentNode.host:Te.parentNode}return!1})(dt))return;const Rt=(At=>{const Te=window.getComputedStyle(At);return{top:parseFloat(Te.scrollMarginTop)||0,right:parseFloat(Te.scrollMarginRight)||0,bottom:parseFloat(Te.scrollMarginBottom)||0,left:parseFloat(Te.scrollMarginLeft)||0}})(dt);if((At=>typeof At=="object"&&typeof At.behavior=="function")(Ge))return Ge.behavior(Oe(dt,Ge));const ot=typeof Ge=="boolean"||Ge==null?void 0:Ge.behavior;for(const{el:At,top:Te,left:ne}of Oe(dt,at(Ge))){const te=Te-Rt.top+Rt.bottom,de=ne-Rt.left+Rt.right;At.scroll({top:te,left:de,behavior:ot})}}}}]);
|