(function(C,D,E,m,F,p,r,q,t,s,j,G,A,H,I,w,x,u,y,v,K,L,M,N,O,B,P,Q,R,S,T,U,z,V,W,X,Y,Z,$,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka,la,ma,na,oa,pa,qa,e,h){p("JM");q(null,"JM.Object2d",["java.lang.Float","JU.C","JV.JC"],function(){c$=s(function(){this.isLabelOrHover=!1;this.script=this.target=this.xyz=null;this.atomY=this.atomX=this.valign=this.align=this.fontScale=this.pointer=this.bgcolix=this.colix=0;this.atomZ=2147483647;this.movableZ=this.movableY=this.movableX=0;this.movableZPercent=this.movableYPercent=
this.movableXPercent=2147483647;this.offsetY=this.offsetX=0;this.z=1;this.zSlab=-2147483648;this.pymolOffset=null;this.windowHeight=this.windowWidth=0;this.adjustForWindow=!1;this.boxY=this.boxX=this.boxHeight=this.boxWidth=0;this.modelIndex=-1;this.visible=!0;this.hidden=!1;this.boxXY=null;this.scalePixelsPerMicron=0;t(this,arguments)},JM,"Object2d");e(c$,"setScalePixelsPerMicron",function(a){this.fontScale=0;this.scalePixelsPerMicron=a},"~N");e(c$,"setXYZ",function(a,b){this.xyz=a;null==a&&(this.zSlab=
-2147483648);b&&(this.valign=null==a?0:4,this.adjustForWindow=null==a)},"JU.P3,~B");e(c$,"setTranslucent",function(a,b){b?0!=this.bgcolix&&(this.bgcolix=JU.C.getColixTranslucent3(this.bgcolix,!Float.isNaN(a),a)):this.colix=JU.C.getColixTranslucent3(this.colix,!Float.isNaN(a),a)},"~N,~B");e(c$,"setMovableX",function(a){this.valign=4==this.valign?4:0;this.movableX=a;this.movableXPercent=2147483647},"~N");e(c$,"setMovableY",function(a){this.valign=4==this.valign?4:0;this.movableY=a;this.movableYPercent=
2147483647},"~N");e(c$,"setMovableXPercent",function(a){this.valign=4==this.valign?4:0;this.movableX=2147483647;this.movableXPercent=a},"~N");e(c$,"setMovableYPercent",function(a){this.valign=4==this.valign?4:0;this.movableY=2147483647;this.movableYPercent=a},"~N");e(c$,"setMovableZPercent",function(a){4!=this.valign&&(this.valign=0);this.movableZ=2147483647;this.movableZPercent=a},"~N");e(c$,"setZs",function(a,b){this.z=a;this.zSlab=b},"~N,~N");e(c$,"setXYZs",function(a,b,c,d){this.setMovableX(a);
this.setMovableY(b);this.setZs(c,d)},"~N,~N,~N,~N");e(c$,"setScript",function(a){this.script=null==a||0==a.length?null:a},"~S");e(c$,"setOffset",function(a){this.offsetX=JV.JC.getXOffset(a);this.offsetY=JV.JC.getYOffset(a);this.pymolOffset=null;this.valign=0},"~N");e(c$,"setAlignmentLCR",function(a){return"left".equals(a)?this.setAlignment(1):"center".equals(a)?this.setAlignment(2):"right".equals(a)?this.setAlignment(3):!1},"~S");e(c$,"setAlignment",function(a){this.align!=a&&(this.align=a,this.recalc());
return!0},"~N");e(c$,"setBoxOffsetsInWindow",function(a,b,c){var d=this.boxWidth+a,f=this.boxX;f+d>this.windowWidth&&(f=this.windowWidth-d);f<a&&(f=a);this.boxX=f;a=this.boxHeight;c+a>this.windowHeight&&(c=this.windowHeight-a);c<b&&(c=b);this.boxY=c},"~N,~N,~N");e(c$,"setWindow",function(a,b,c){this.windowWidth=a;this.windowHeight=b;null==this.pymolOffset&&(0>this.scalePixelsPerMicron&&0!=c)&&this.setScalePixelsPerMicron(c)},"~N,~N,~N");e(c$,"checkObjectClicked",function(a,b,c,d){if(this.hidden||
null==this.script||0<=this.modelIndex&&!d.get(this.modelIndex))return!1;a&&(b<<=1,c<<=1);return b>=this.boxX&&b<=this.boxX+this.boxWidth&&c>=this.boxY&&c<=this.boxY+this.boxHeight},"~B,~N,~N,JU.BS");c$.setProperty=e(c$,"setProperty",function(a,b,c){if("script"===a)return null!=c&&c.setScript(b),!0;if("xpos"===a)return null!=c&&c.setMovableX(b.intValue()),!0;if("ypos"===a)return null!=c&&c.setMovableY(b.intValue()),!0;if("%xpos"===a)return null!=c&&c.setMovableXPercent(b.intValue()),!0;if("%ypos"===
a)return null!=c&&c.setMovableYPercent(b.intValue()),!0;if("%zpos"===a)return null!=c&&c.setMovableZPercent(b.intValue()),!0;if("xypos"===a){if(null==c)return!0;c.setXYZ(null,!0);3.4028235E38==b.z?(c.setMovableX(j(b.x)),c.setMovableY(j(b.y))):(c.setMovableXPercent(j(b.x)),c.setMovableYPercent(j(b.y)));return!0}return"xyz"===a?(null!=c&&c.setXYZ(b,!0),!0):!1},"~S,~O,JM.Object2d")});p("JM");q(["JM.Object2d"],"JM.Text",["javajs.awt.Font","JU.PT","J.shape.Shape","JU.Txt"],function(){c$=s(function(){this.textUnformatted=
null;this.doFormatText=!1;this.font=this.lines=null;this.textHeight=this.textWidth=this.lineHeight=this.descent=this.ascent=this.fid=0;this.image=this.vwr=this.widths=this.text=null;this.imageScale=1;this.y0=this.yAdj=this.xAdj=this.boxYoff2=0;this.pointerPt=null;t(this,arguments)},JM,"Text",JM.Object2d);e(c$,"getText",function(){return this.text});A(c$,function(a){this.vwr=a;this.boxXY=u(5,0)},"JV.Viewer");c$.newLabel=e(c$,"newLabel",function(a,b,c,d,f,g,e,k){a=new JM.Text(a);a.set(b,d,g,!0,e,k);
a.setText(c);a.bgcolix=f;return a},"JV.Viewer,javajs.awt.Font,~S,~N,~N,~N,~N,~A");c$.newEcho=e(c$,"newEcho",function(a,b,c,d,f,g,e){JM.Text.isEcho=!0;a=new JM.Text(a);a.set(b,d,g,!1,e,null);a.target=c;c.equals("error")&&(f=1);a.valign=f;a.z=2;a.zSlab=-2147483648;return a},"JV.Viewer,javajs.awt.Font,~S,~N,~N,~N,~N");e(c$,"set",function(a,b,c,d,f,g){this.scalePixelsPerMicron=f;this.isLabelOrHover=d;this.colix=b;this.align=c;this.pymolOffset=g;this.setFont(a,d)},"javajs.awt.Font,~N,~N,~B,~N,~A");e(c$,
"getFontMetrics",function(){this.descent=this.font.getDescent();this.ascent=this.font.getAscent();this.lineHeight=this.ascent+this.descent});e(c$,"setFontFromFid",function(a){this.fid!=a&&(this.fontScale=0,this.setFont(javajs.awt.Font.getFont3D(a),!0))},"~N");e(c$,"setText",function(a){null!=this.image&&this.getFontMetrics();this.image=null;a=this.fixText(a);null!=this.text&&this.text.equals(a)||(this.textUnformatted=this.text=a,(this.doFormatText=JM.Text.isEcho&&null!=a&&(0<=a.indexOf("%{")||0<=
a.indexOf("@{")))||this.recalc())},"~S");e(c$,"setImage",function(a){this.image=a;this.recalc()},"~O");e(c$,"setScale",function(a){this.imageScale=a;this.recalc()},"~N");e(c$,"setFont",function(a,b){this.font=a;null!=this.font&&(this.getFontMetrics(),b&&(this.fid=this.font.fid,this.recalc()))},"javajs.awt.Font,~B");e(c$,"setFontScale",function(a){this.fontScale!=a&&(this.fontScale=a,0!=this.fontScale&&this.setFont(this.vwr.gdata.getFont3DScaled(this.font,a),!0))},"~N");e(c$,"fixText",function(a){if(null==
a||0==a.length)return null;for(var b;0<=(b=a.indexOf("\n"));)a=a.substring(0,b)+"|"+a.substring(b+1);return a},"~S");h(c$,"recalc",function(){if(null!=this.image)this.textWidth=this.textHeight=0,this.boxWidth=this.vwr.apiPlatform.getImageWidth(this.image)*this.fontScale*this.imageScale,this.boxHeight=this.vwr.apiPlatform.getImageHeight(this.image)*this.fontScale*this.imageScale,this.ascent=0;else if(null==this.text)this.widths=this.lines=this.text=null;else if(null!=this.font){this.lines=JU.PT.split(this.text,
"|");this.textWidth=0;this.widths=w(this.lines.length,0);for(var a=this.lines.length;0<=--a;)this.textWidth=Math.max(this.textWidth,this.widths[a]=this.stringWidth(this.lines[a]));this.textHeight=this.lines.length*this.lineHeight;this.boxWidth=this.textWidth+(2<=this.fontScale?16:8);this.boxHeight=this.textHeight+(2<=this.fontScale?16:8)}});e(c$,"formatText",function(){this.text=JM.Text.isEcho?JU.Txt.formatText(this.vwr,this.textUnformatted):this.textUnformatted;this.recalc()});e(c$,"setPosition",
function(a,b,c,d){null==d?d=this.boxXY:this.boxXY=d;this.setWindow(this.vwr.gdata.width,this.vwr.gdata.height,a);0!=a&&0!=this.scalePixelsPerMicron?this.setFontScale(a/this.scalePixelsPerMicron):this.fontScale!=b&&this.setFontScale(b);this.doFormatText&&this.formatText();a=this.offsetX*b;b*=this.offsetY;this.xAdj=2<=this.fontScale?8:4;this.yAdj=this.ascent-this.lineHeight+this.xAdj;this.isLabelOrHover?(d[0]=this.movableX,d[1]=this.movableY,null!=this.pymolOffset?(c=this.vwr.tm.scaleToScreen(this.z,
1E3),a=this.pymolOffset[3],c*=(0>a?-1:1)*Math.max(0,Math.abs(a)-1),this.z-=j(c),c=this.vwr.tm.scaleToScreen(this.z,1E3),a=this.getPymolXYOffset(this.pymolOffset[1],this.textWidth,c),b=-this.getPymolXYOffset(-this.pymolOffset[2],this.ascent-this.descent,c),this.xAdj=2<=this.fontScale?8:4,this.yAdj=0,b+=this.descent,d[0]=this.movableX-this.xAdj,d[1]=this.movableY-this.yAdj,this.y0=this.movableY-b-this.descent,c=!0,this.boxYoff2=-2):this.boxYoff2=0,JM.Text.setBoxXY(this.boxWidth,this.boxHeight,a,b,d,
c)):this.setPos(this.fontScale);this.boxX=d[0];this.boxY=d[1];this.adjustForWindow&&this.setBoxOffsetsInWindow(0,this.isLabelOrHover?16*this.fontScale+this.lineHeight:0,this.boxY-this.textHeight);c||(this.y0=this.boxY+this.yAdj)},"~N,~N,~B,~A");e(c$,"getPymolXYOffset",function(a,b,c){var d=-1>a?-1:1<a?0:(a-1)/2;return d*b+(-1>a||1<a?a+(0>a?1:-1):0)*c},"~N,~N,~N");e(c$,"setPos",function(a){var b,c,d,f=null!=this.xyz;0==this.valign||4==this.valign?b=d=c=(2147483647!=this.movableXPercent?m(this.movableXPercent*
this.windowWidth/100):f?this.movableX:this.movableX*a)+this.offsetX*a:(b=5*a,c=m(this.windowWidth/2),d=this.windowWidth-b);this.boxXY[0]=b;switch(this.align){case 2:this.boxXY[0]=c-this.boxWidth/2;break;case 3:this.boxXY[0]=d-this.boxWidth}this.boxXY[1]=0;switch(this.valign){case 1:break;case 3:this.boxXY[1]=m(this.windowHeight/2);break;case 2:this.boxXY[1]=this.windowHeight;break;default:b=2147483647!=this.movableYPercent?m(this.movableYPercent*this.windowHeight/100):f?this.movableY:this.movableY*
a,this.boxXY[1]=(f?b:this.windowHeight-b)+this.offsetY*a}2==this.align?this.boxXY[1]-=(null!=this.image?this.boxHeight:null!=this.xyz?this.boxHeight:this.ascent-this.boxHeight)/2:null!=this.image?this.boxXY[1]-=0:null!=this.xyz&&(this.boxXY[1]-=m(this.ascent/2))},"~N");c$.setBoxXY=e(c$,"setBoxXY",function(a,b,c,d,f,g){var e;0<c||g?e=c:(e=-a,e=0==c?e/2:e+c);f[0]+=e;f[1]+=g?-d:0>d?-b+d:0==d?-b/2:d;f[2]=a;f[3]=b},"~N,~N,~N,~N,~A,~B");e(c$,"stringWidth",function(a){var b=0,c=1;if(null==a)return 0;if(0>
a.indexOf("<su"))return this.font.stringWidth(a);for(var d=a.length,f,g=0;g<d;g++){if("<"==a.charAt(g)){if(g+4<d&&((f=a.substring(g,g+5)).equals("<sub>")||f.equals("<sup>"))){g+=4;c=1;continue}if(g+5<d&&((f=a.substring(g,g+6)).equals("</sub>")||f.equals("</sup>"))){g+=5;c=1;continue}}b+=this.font.stringWidth(a.substring(g,g+1))*c}return b},"~S");e(c$,"setXYA",function(a,b){if(0==b){a[2]=this.boxX;switch(this.align){case 2:a[2]+=this.boxWidth/2;break;case 3:a[2]+=this.boxWidth-this.xAdj;break;default:a[2]+=
this.xAdj}a[0]=a[2];a[1]=this.y0}switch(this.align){case 2:a[0]=a[2]-m(this.widths[b]/2);break;case 3:a[0]=a[2]-this.widths[b]}a[1]+=this.lineHeight},"~A,~N");e(c$,"appendFontCmd",function(a){a.append("  "+J.shape.Shape.getFontCommand("echo",this.font));0<this.scalePixelsPerMicron&&a.append(" "+1E4/this.scalePixelsPerMicron)},"JU.SB");x(c$,"isEcho",!1)});p("J.shape");q(["J.shape.Shape","java.util.Hashtable"],"J.shape.Object2dShape",["JU.P3","$.PT","JU.C","$.Logger"],function(){c$=s(function(){this.currentBgColor=
this.currentColor=this.currentFont=this.currentObject=this.objects=null;this.currentBgTranslucentLevel=this.currentTranslucentLevel=0;this.thisID=null;this.isAll=this.isHover=!1;t(this,arguments)},J.shape,"Object2dShape",J.shape.Shape);v(c$,function(){this.objects=new java.util.Hashtable});e(c$,"setPropOS",function(a,b,c){if("allOff"===a)this.currentObject=null,this.isAll=!0,this.objects=new java.util.Hashtable;else if("delete"===a)if(null==this.currentObject){if(this.isAll||null!=this.thisID)for(a=
this.objects.values().iterator();a.hasNext();){var d=a.next();(this.isAll||JU.PT.isMatch(d.target.toUpperCase(),this.thisID,!0,!0))&&a.remove()}}else this.objects.remove(this.currentObject.target),this.currentObject=null;else if("off"===a)this.isAll&&(this.objects=new java.util.Hashtable,this.isAll=!1,this.currentObject=null),null!=this.currentObject&&(this.objects.remove(this.currentObject.target),this.currentObject=null);else if("model"===a)if(b=b.intValue(),null==this.currentObject){if(this.isAll)for(a=
this.objects.values().iterator();a.hasNext()&&((d=a.next())||1);)d.modelIndex=b}else this.currentObject.modelIndex=b;else if("align"===a)if(null==this.currentObject){if(this.isAll)for(var f,d=this.objects.values().iterator();d.hasNext()&&((f=d.next())||1);)f.setAlignmentLCR(b)}else this.currentObject.setAlignmentLCR(b)||JU.Logger.error("unrecognized align:"+b);else if("bgcolor"===a)if(this.currentBgColor=b,null==this.currentObject){if(this.isAll)for(a=this.objects.values().iterator();a.hasNext();)a.next().colix=
JU.C.getColixO(b)}else this.currentObject.bgcolix=JU.C.getColixO(b);else if("color"===a)if(this.currentColor=b,null==this.currentObject){if(this.isAll||null!=this.thisID)for(a=this.objects.values().iterator();a.hasNext();)if(d=a.next(),this.isAll||JU.PT.isMatch(d.target.toUpperCase(),this.thisID,!0,!0))d.colix=JU.C.getColixO(b)}else this.currentObject.colix=JU.C.getColixO(b);else if("target"===a){if((this.isAll=b.equals("all"))||b.equals("none"))this.currentObject=null}else if((d="bgtranslucency"===
a)||"translucency"===a)if(b="translucent"===b,d?this.currentBgTranslucentLevel=b?this.translucentLevel:0:this.currentTranslucentLevel=b?this.translucentLevel:0,null==this.currentObject){if(this.isAll)for(a=this.objects.values().iterator();a.hasNext();)a.next().setTranslucent(this.translucentLevel,d)}else this.currentObject.setTranslucent(this.translucentLevel,d);else if("deleteModelAtoms"===a){b=b[2][0];for(a=this.objects.values().iterator();a.hasNext();)d=a.next(),d.modelIndex==b?a.remove():d.modelIndex>
b&&d.modelIndex--}else this.setPropS(a,b,c)},"~S,~O,JU.BS");h(c$,"initModelSet",function(){this.currentObject=null;this.isAll=!1});h(c$,"setModelVisibilityFlags",function(a){if(!this.isHover)for(var b,c=this.objects.values().iterator();c.hasNext()&&((b=c.next())||1);)b.visible=0>b.modelIndex||a.get(b.modelIndex)},"JU.BS");h(c$,"checkObjectClicked",function(a,b,c,d){if(this.isHover||0==c)return null;c=this.vwr.antialiased;for(var f,g=this.objects.values().iterator();g.hasNext()&&((f=g.next())||1);)if(f.checkObjectClicked(c,
a,b,d))return null!=f.script&&this.vwr.evalStringQuiet(f.script),a=new java.util.Hashtable,a.put("pt",null==f.xyz?new JU.P3:f.xyz),b=f.modelIndex,0>b&&(b=0),a.put("modelIndex",Integer.$valueOf(b)),a.put("model",this.vwr.getModelNumberDotted(b)),a.put("id",f.target),a.put("type","echo"),a;return null},"~N,~N,~N,JU.BS,~B");h(c$,"checkObjectHovered",function(a,b,c){if(this.isHover)return!1;for(var d=!1,f=this.vwr.antialiased,g,e=this.objects.values().iterator();e.hasNext()&&((g=e.next())||1);)if(null!=
g.script&&(d=!0,g.checkObjectClicked(f,a,b,c)))return this.vwr.setCursor(12),!0;d&&this.vwr.setCursor(0);return!1},"~N,~N,JU.BS")});p("J.shape");q(["J.shape.Object2dShape"],"J.shape.TextShape",null,function(){c$=y(J.shape,"TextShape",J.shape.Object2dShape);h(c$,"setProperty",function(a,b,c){this.setPropTS(a,b,c)},"~S,~O,JU.BS");e(c$,"setPropTS",function(a,b,c){if("text"===a)if(null==this.currentObject){if(this.isAll){var d;for(a=this.objects.values().iterator();a.hasNext()&&((d=a.next())||1);)d.setText(b)}}else this.currentObject.setText(b);
else if("font"===a)if(this.currentFont=b,null==this.currentObject){if(this.isAll)for(a=this.objects.values().iterator();a.hasNext()&&((d=a.next())||1);)d.setFont(this.currentFont,!0)}else this.currentObject.setFont(this.currentFont,!0),this.currentObject.setFontScale(0);else this.setPropOS(a,b,c)},"~S,~O,JU.BS")});p("J.shape");q(["J.shape.AtomShape","java.util.Hashtable","JU.P3"],"J.shape.Labels","javajs.awt.Font JU.AU $.BS $.Lst J.c.PAL JM.LabelToken $.Text JS.SV JU.BSUtil $.C JV.JC".split(" "),
function(){c$=s(function(){this.bsBgColixSet=this.bsFontSet=this.labelBoxes=this.text=this.atomLabels=this.offsets=this.fids=this.bgcolixes=this.formats=this.strings=null;this.zeroFontId=this.defaultPointer=this.defaultPaletteID=this.defaultBgcolix=this.defaultColix=this.defaultFontId=this.defaultZPos=this.defaultAlignment=this.defaultOffset=0;this.defaultsOnlyForNone=!0;this.isScaled=this.setDefaults=!1;this.scalePixelsPerMicron=0;this.ptTemp=null;this.pickedAtom=-1;this.pickedY=this.pickedX=this.pickedOffset=
0;t(this,arguments)},J.shape,"Labels",J.shape.AtomShape);v(c$,function(){this.atomLabels=new java.util.Hashtable;this.ptTemp=new JU.P3});e(c$,"initShape",function(){z(this,J.shape.Labels,"initShape",[]);this.defaultFontId=this.zeroFontId=this.vwr.gdata.getFont3DFSS("SansSerif","Plain",13).fid;this.defaultBgcolix=this.defaultColix=0;this.defaultOffset=J.shape.Labels.zeroOffset;this.defaultZPos=0;this.translucentAllowed=!1});h(c$,"setProperty",function(a,b,c){this.isActive=!0;if("setDefaults"===a)this.setDefaults=
b.booleanValue();else if("color"===a){var d=J.c.PAL.pidOf(b);b=JU.C.getColixO(b);if(!this.setDefaults)for(a=c.nextSetBit(0);0<=a&&a<this.ac;a=c.nextSetBit(a+1))this.setLabelColix(a,b,d);if(this.setDefaults||!this.defaultsOnlyForNone)this.defaultColix=b,this.defaultPaletteID=d}else if("scalereference"===a){if(null!=this.strings){a=b.floatValue();d=0==a?0:1E4/a;for(a=c.nextSetBit(0);0<=a&&a<this.ac;a=c.nextSetBit(a+1))this.strings.length<=a||(this.text=this.getLabel(a),null==this.text?(this.text=JM.Text.newLabel(this.vwr,
null,this.strings[a],0,0,0,d,null),this.putLabel(a,this.text)):this.text.setScalePixelsPerMicron(d))}}else if("label"===a)if(this.setScaling(),d=null,r(b,JU.Lst)){var f=b.size(),d=[null],g=0;for(a=c.nextSetBit(0);0<=a&&a<this.ac;a=c.nextSetBit(a+1)){if(g>=f){this.setLabel(J.shape.Labels.nullToken,"",a);break}d[0]=null;this.setLabel(d,JS.SV.sValue(b.get(g++)),a)}}else{d=null==b||0==b.length?J.shape.Labels.nullToken:[null];for(a=c.nextSetBit(0);0<=a&&a<this.ac;a=c.nextSetBit(a+1))this.setLabel(d,b,
a)}else if("labels"===a){this.setScaling();f=b;a=c.nextSetBit(0);for(g=0;0<=a&&a<this.ac;a=c.nextSetBit(a+1))b=f.get(g++),d=null==b||0==b.length?J.shape.Labels.nullToken:[null],this.setLabel(d,b,a)}else if("clearBoxes"===a)this.labelBoxes=null;else if(!("translucency"===a||"bgtranslucency"===a))if("bgcolor"===a){this.isActive=!0;null==this.bsBgColixSet&&(this.bsBgColixSet=new JU.BS);d=JU.C.getColixO(b);if(!this.setDefaults)for(a=c.nextSetBit(0);0<=a&&a<this.ac;a=c.nextSetBit(a+1))this.setBgcolix(a,
d);if(this.setDefaults||!this.defaultsOnlyForNone)this.defaultBgcolix=d}else if(null==this.bsFontSet&&(this.bsFontSet=new JU.BS),"textLabels"===a){this.setScaling();f=b;for(a=c.nextSetBit(0);0<=a&&a<this.ac;a=c.nextSetBit(a+1))this.setTextLabel(a,f.get(Integer.$valueOf(a)))}else if("fontsize"===a)if(a=b.intValue(),0>a)this.fids=null;else{d=this.vwr.gdata.getFontFid(a);if(!this.setDefaults)for(a=c.nextSetBit(0);0<=a&&a<this.ac;a=c.nextSetBit(a+1))this.setFont(a,d);if(this.setDefaults||!this.defaultsOnlyForNone)this.defaultFontId=
d}else if("font"===a){d=b.fid;if(!this.setDefaults)for(a=c.nextSetBit(0);0<=a&&a<this.ac;a=c.nextSetBit(a+1))this.setFont(a,d);if(this.setDefaults||!this.defaultsOnlyForNone)this.defaultFontId=d}else if("offset"===a||"offsetexact"===a)if(r(b,Integer)){d=b.intValue();b="offsetexact"===a;0==d?d=32767:d==J.shape.Labels.zeroOffset&&(d=0);if(!this.setDefaults)for(a=c.nextSetBit(0);0<=a&&a<this.ac;a=c.nextSetBit(a+1))this.setOffsets(a,d,b);if(this.setDefaults||!this.defaultsOnlyForNone)this.defaultOffset=
d}else{if(!this.setDefaults)for(a=c.nextSetBit(0);0<=a&&a<this.ac;a=c.nextSetBit(a+1))this.setPymolOffset(a,b)}else if("align"===a){d=1;b.equalsIgnoreCase("right")?d=3:b.equalsIgnoreCase("center")&&(d=2);for(a=c.nextSetBit(0);0<=a&&a<this.ac;a=c.nextSetBit(a+1))this.setAlignment(a,d);if(this.setDefaults||!this.defaultsOnlyForNone)this.defaultAlignment=d}else if("pointer"===a){d=b.intValue();if(!this.setDefaults)for(a=c.nextSetBit(0);0<=a&&a<this.ac;a=c.nextSetBit(a+1))this.setPointer(a,d);if(this.setDefaults||
!this.defaultsOnlyForNone)this.defaultPointer=d}else if("front"===a){d=b.booleanValue();if(!this.setDefaults)for(a=c.nextSetBit(0);0<=a&&a<this.ac;a=c.nextSetBit(a+1))this.setFront(a,d);if(this.setDefaults||!this.defaultsOnlyForNone)this.defaultZPos=d?32:0}else if("group"===a){d=b.booleanValue();if(!this.setDefaults)for(a=c.nextSetBit(0);0<=a&&a<this.ac;a=c.nextSetBit(a+1))this.setGroup(a,d);if(this.setDefaults||!this.defaultsOnlyForNone)this.defaultZPos=d?16:0}else if("display"===a||"toggleLabel"===
a){g="toggleLabel"===a?0:b.booleanValue()?1:-1;null==this.mads&&(this.mads=B(this.ac,0));var e=f=null,k=null,j=null;for(a=c.nextSetBit(0);0<=a&&a<this.ac;a=c.nextSetBit(a+1)){var l=this.atoms[a];if(null==this.formats||a>=this.formats.length)this.formats=JU.AU.ensureLengthS(this.formats,a+1);null!=this.strings&&this.strings.length>a&&null!=this.strings[a]?this.mads[a]=0==g&&0>this.mads[a]||1==g?1:-1:(null==this.bsSizeSet&&(this.bsSizeSet=new JU.BS),this.strings=JU.AU.ensureLengthS(this.strings,a+1),
l.getGroup3(!1).equals("UNK")?(null==k&&(k=this.vwr.getStandardLabelFormat(1),j=JM.LabelToken.compile(this.vwr,k,"\x00",null)),b=k,d=j):(null==f&&(f=this.vwr.getStandardLabelFormat(2),e=JM.LabelToken.compile(this.vwr,f,"\x00",null)),b=f,d=e),this.strings[a]=JM.LabelToken.formatLabelAtomArray(this.vwr,l,d,"\x00",null,this.ptTemp),this.formats[a]=b,this.bsSizeSet.set(a),(null==this.bsBgColixSet||!this.bsBgColixSet.get(a))&&0!=this.defaultBgcolix&&this.setBgcolix(a,this.defaultBgcolix),this.mads[a]=
0<=g?1:-1);this.setShapeVisibility(l,null!=this.strings&&a<this.strings.length&&null!=this.strings[a]&&0<=this.mads[a])}}else a.startsWith("label:")?(this.setScaling(),this.setLabel(Array(1),a.substring(6),b.intValue())):("deleteModelAtoms"===a&&(this.labelBoxes=null,d=b[2][1],g=b[2][2],this.fids=JU.AU.deleteElements(this.fids,d,g),this.bgcolixes=JU.AU.deleteElements(this.bgcolixes,d,g),this.offsets=JU.AU.deleteElements(this.offsets,d,g),this.formats=JU.AU.deleteElements(this.formats,d,g),this.strings=
JU.AU.deleteElements(this.strings,d,g),JU.BSUtil.deleteBits(this.bsFontSet,c),JU.BSUtil.deleteBits(this.bsBgColixSet,c)),this.setPropAS(a,b,c))},"~S,~O,JU.BS");e(c$,"setPymolOffset",function(a,b){var c=this.getLabel(a);if(null==c){if(!(null==this.strings||this.strings.length<=a||null==this.strings[a])){c=null!=this.bsFontSet&&this.bsFontSet.get(a)?this.fids[a]:-1;0>c&&this.setFont(a,c=this.defaultFontId);var c=javajs.awt.Font.getFont3D(c),d=this.getColix2(a,this.atoms[a],!1),c=JM.Text.newLabel(this.vwr,
c,this.strings[a],d,this.getColix2(a,this.atoms[a],!0),0,this.scalePixelsPerMicron,b);this.setTextLabel(a,c)}}else c.pymolOffset=b},"~N,~A");e(c$,"setScaling",function(){this.isActive=!0;null==this.bsSizeSet&&(this.bsSizeSet=new JU.BS);this.scalePixelsPerMicron=(this.isScaled=this.vwr.getBoolean(603979845))?1E4*this.vwr.getScalePixelsPerAngstrom(!1):0});e(c$,"setTextLabel",function(a,b){if(null!=b){var c=b.getText(),d=this.atoms[a];this.addString(d,a,c,c);this.setShapeVisibility(d,!0);0<=b.colix&&
this.setLabelColix(a,b.colix,J.c.PAL.UNKNOWN.id);this.setFont(a,b.font.fid);this.putLabel(a,b)}},"~N,JM.Text");e(c$,"setLabel",function(a,b,c){var d=this.atoms[c],f=a[0];null==f&&(f=a[0]=JM.LabelToken.compile(this.vwr,b,"\x00",null));a=null==f?null:JM.LabelToken.formatLabelAtomArray(this.vwr,d,f,"\x00",null,this.ptTemp);this.addString(d,c,a,b);this.text=this.getLabel(c);this.isScaled?(this.text=JM.Text.newLabel(this.vwr,null,a,0,0,0,this.scalePixelsPerMicron,null),this.putLabel(c,this.text)):null!=
this.text&&null!=a&&this.text.setText(a);this.defaultOffset!=J.shape.Labels.zeroOffset&&this.setOffsets(c,this.defaultOffset,!1);1!=this.defaultAlignment&&this.setAlignment(c,this.defaultAlignment);0!=(this.defaultZPos&32)?this.setFront(c,!0):0!=(this.defaultZPos&16)&&this.setGroup(c,!0);0!=this.defaultPointer&&this.setPointer(c,this.defaultPointer);(0!=this.defaultColix||0!=this.defaultPaletteID)&&this.setLabelColix(c,this.defaultColix,this.defaultPaletteID);0!=this.defaultBgcolix&&this.setBgcolix(c,
this.defaultBgcolix);this.defaultFontId!=this.zeroFontId&&this.setFont(c,this.defaultFontId)},"~A,~S,~N");e(c$,"addString",function(a,b,c,d){this.setShapeVisibility(a,null!=c);if(null==this.strings||b>=this.strings.length)this.strings=JU.AU.ensureLengthS(this.strings,b+1);if(null==this.formats||b>=this.formats.length)this.formats=JU.AU.ensureLengthS(this.formats,b+1);this.strings[b]=c;this.formats[b]=null!=d&&0<=d.indexOf("%{")?c:d;this.bsSizeSet.setBitTo(b,null!=d)},"JM.Atom,~N,~S,~S");h(c$,"getProperty",
function(a,b){return a.equals("offsets")?this.offsets:a.equals("label")?null!=this.strings&&b<this.strings.length&&null!=this.strings[b]?this.strings[b]:"":null},"~S,~N");e(c$,"putLabel",function(a,b){null==b?this.atomLabels.remove(Integer.$valueOf(a)):this.atomLabels.put(Integer.$valueOf(a),b)},"~N,JM.Text");e(c$,"getLabel",function(a){return this.atomLabels.get(Integer.$valueOf(a))},"~N");e(c$,"putBox",function(a,b){null==this.labelBoxes&&(this.labelBoxes=new java.util.Hashtable);this.labelBoxes.put(Integer.$valueOf(a),
b)},"~N,~A");e(c$,"getBox",function(a){return null==this.labelBoxes?null:this.labelBoxes.get(Integer.$valueOf(a))},"~N");e(c$,"setLabelColix",function(a,b,c){this.setColixAndPalette(b,c,a);if(null!=this.colixes&&null!=(this.text=this.getLabel(a)))this.text.colix=this.colixes[a]},"~N,~N,~N");e(c$,"setBgcolix",function(a,b){if(null==this.bgcolixes||a>=this.bgcolixes.length){if(0==b)return;this.bgcolixes=JU.AU.ensureLengthShort(this.bgcolixes,a+1)}this.bgcolixes[a]=b;this.bsBgColixSet.setBitTo(a,0!=
b);this.text=this.getLabel(a);null!=this.text&&(this.text.bgcolix=b)},"~N,~N");e(c$,"setOffsets",function(a,b,c){if(null==this.offsets||a>=this.offsets.length){if(0==b)return;this.offsets=JU.AU.ensureLengthI(this.offsets,a+1)}this.offsets[a]=this.offsets[a]&255|b<<8;c&&(this.offsets[a]|=128);this.text=this.getLabel(a);null!=this.text&&this.text.setOffset(b)},"~N,~N,~B");e(c$,"setAlignment",function(a,b){if(null==this.offsets||a>=this.offsets.length){if(1==b)return;this.offsets=JU.AU.ensureLengthI(this.offsets,
a+1)}this.offsets[a]=this.offsets[a]&-13|b<<2;this.text=this.getLabel(a);null!=this.text&&this.text.setAlignment(b)},"~N,~N");c$.getAlignment=e(c$,"getAlignment",function(a){return(a&12)>>2},"~N");e(c$,"setPointer",function(a,b){if(null==this.offsets||a>=this.offsets.length){if(0==b)return;this.offsets=JU.AU.ensureLengthI(this.offsets,a+1)}this.offsets[a]=(this.offsets[a]&-4)+b;this.text=this.getLabel(a);null!=this.text&&(this.text.pointer=b)},"~N,~N");e(c$,"setFront",function(a,b){if(null==this.offsets||
a>=this.offsets.length){if(!b)return;this.offsets=JU.AU.ensureLengthI(this.offsets,a+1)}this.offsets[a]=(this.offsets[a]&-49)+(b?32:0)},"~N,~B");e(c$,"setGroup",function(a,b){if(null==this.offsets||a>=this.offsets.length){if(!b)return;this.offsets=JU.AU.ensureLengthI(this.offsets,a+1)}this.offsets[a]=(this.offsets[a]&-49)+(b?16:0)},"~N,~B");e(c$,"setFont",function(a,b){if(null==this.fids||a>=this.fids.length){if(b==this.zeroFontId)return;this.fids=JU.AU.ensureLengthByte(this.fids,a+1)}this.fids[a]=
b;this.bsFontSet.set(a);this.text=this.getLabel(a);null!=this.text&&this.text.setFontFromFid(b)},"~N,~N");h(c$,"setAtomClickability",function(){if(null!=this.strings)for(var a=this.strings.length;0<=--a;)null!=this.strings[a]&&(this.ms.at.length>a&&!this.ms.isAtomHidden(a))&&this.ms.at[a].setClickable(this.vf)});h(c$,"getShapeState",function(){return!this.isActive||null==this.bsSizeSet?"":this.vwr.getShapeState(this)});h(c$,"checkObjectDragged",function(a,b,c,d){if(2!=this.vwr.getPickingMode()||null==
this.labelBoxes)return!1;if(-2147483648==a)return a=this.findNearestLabel(c,d),0<=a?(this.pickedAtom=a,this.pickedX=c,this.pickedY=d,this.pickedOffset=(null==this.offsets||this.pickedAtom>=this.offsets.length?0:this.offsets[this.pickedAtom])>>8,!0):!1;if(2147483647==a)return this.pickedAtom=-1,!1;if(0>this.pickedAtom)return!1;this.move2D(this.pickedAtom,c,d);return!0},"~N,~N,~N,~N,~N,JU.BS");e(c$,"findNearestLabel",function(a,b){if(null==this.labelBoxes)return-1;for(var c=3.4028235E38,d=-1,f=3.4028235E38,
g,e=this.labelBoxes.entrySet().iterator();e.hasNext()&&((g=e.next())||1);)if(this.atoms[g.getKey().intValue()].isVisible(this.vf|9)){var k=g.getValue(),j=a-k[0],l=b-k[1];0>=j||(0>=l||j>=k[2]||l>=k[3]||k[4]>f)||(f=k[4],k=Math.min(Math.abs(j-k[2]/2),Math.abs(l-k[3]/2)),k<=c&&(c=k,d=g.getKey().intValue()))}return d},"~N,~N");e(c$,"move2D",function(a,b,c){var d=JV.JC.getXOffset(this.pickedOffset),f=-JV.JC.getYOffset(this.pickedOffset),d=d+(b-this.pickedX),f=f+(this.pickedY-c);b=JV.JC.getOffset(d,f);0==
b?b=32767:b==J.shape.Labels.zeroOffset&&(b=0);this.setOffsets(a,b,!0)},"~N,~N,~N");e(c$,"getColix2",function(a,b,c){c?a=null==this.bgcolixes||a>=this.bgcolixes.length?0:this.bgcolixes[a]:(a=null==this.colixes||a>=this.colixes.length?0:this.colixes[a],a=JU.C.getColixInherited(a,b.colixAtom),JU.C.isColixTranslucent(a)&&(a=JU.C.getColixTranslucent3(a,!1,0)));return a},"~N,JM.Atom,~B");x(c$,"zeroOffset",1028);c$.nullToken=c$.prototype.nullToken=[null]});p("J.shape");q(["J.api.JmolMeasurementClient","J.shape.AtomShape",
"JU.Lst"],"J.shape.Measures","java.lang.Float java.util.Hashtable JU.BS $.PT JM.Measurement $.MeasurementData JU.BSUtil $.C $.Escape".split(" "),function(){c$=s(function(){this.strFormat=this.bsSelected=null;this.mustNotBeConnected=this.mustBeConnected=!1;this.intramolecular=this.radiusData=null;this.measureAllModels=!1;this.measurementCount=0;this.mPending=this.measurements=null;this.colix=0;this.htMin=this.font3d=this.defaultTickInfo=this.tickInfo=null;this.tokAction=0;t(this,arguments)},J.shape,
"Measures",J.shape.AtomShape,J.api.JmolMeasurementClient);v(c$,function(){this.measurements=new JU.Lst});h(c$,"initModelSet",function(){for(var a=this.measurements.size();0<=--a;){var b=this.measurements.get(a);null!=b&&(b.ms=this.ms)}this.atoms=this.ms.at});h(c$,"initShape",function(){this.font3d=this.vwr.gdata.getFont3D(15)});h(c$,"setSize",function(a){this.mad=a},"~N,JU.BS");h(c$,"setProperty",function(a,b){var c;if("clearModelIndex"===a)for(var d=0;d<this.measurementCount;d++)this.measurements.get(d).setModelIndex(0);
else if("color"===a)this.setColor(JU.C.getColixO(b));else if("font"===a)this.font3d=b;else if("hideAll"===a)this.showHide(b.booleanValue());else if("pending"===a)this.mPending=b,null!=this.mPending&&1<this.mPending.count&&this.vwr.setStatusMeasuring("measurePending",this.mPending.count,this.mPending.toVector(!1).toString(),this.mPending.value);else{var f;if((f="refresh"===a)||"refreshTrajectories"===a)for(d=this.measurements.size();0<=--d;)null!=(c=this.measurements.get(d))&&(f||c.isTrajectory)&&
c.refresh(null);else if("select"===a)null==b||0==JU.BSUtil.cardinalityOf(b)?this.bsSelected=null:(this.bsSelected=new JU.BS,this.bsSelected.or(b));else if("setFormats"===a)this.setFormats(b);else if(this.measureAllModels=this.vwr.getBoolean(603979878),"delete"===a)this.deleteO(b),this.setIndices();else{this.bsSelected=null;if("maps"===a)for(d=0;d<b.length;d++)c=b[d].length,2>c||4<c||(f=w(c+1,0),f[0]=c,System.arraycopy(b[d],0,f,1,c),this.toggleOn(f));else if("measure"===a){this.tickInfo=b.tickInfo;
if(null!=b.tickInfo&&b.tickInfo.id.equals("default")){this.defaultTickInfo=b.tickInfo;return}if(b.isAll&&2==b.points.size()&&r(b.points.get(0),JU.BS))switch(JM.Measurement.nmrType(this.vwr.getDistanceUnits(b.strFormat))){case 2:b.htMin=this.vwr.getNMRCalculation().getMinDistances(b)}this.tickInfo=b.tickInfo;this.radiusData=b.radiusData;this.htMin=b.htMin;this.mustBeConnected=b.mustBeConnected;this.mustNotBeConnected=b.mustNotBeConnected;this.intramolecular=b.intramolecular;this.strFormat=b.strFormat;
if(b.isAll){null!=this.tickInfo&&this.define(b,12291);this.define(b,b.tokAction);this.setIndices();return}var g=this.setSingleItem(b.points);null!=b.thisID&&(g.thisID=b.thisID,g.mad=b.mad,0!=b.colix&&(g.colix=b.colix),g.strFormat=b.strFormat,g.text=b.text);switch(b.tokAction){case 12291:this.defineAll(-2147483648,g,!0,!1,!1);this.setIndices();break;case 1048589:this.showHideM(g,!1);break;case 1048588:this.showHideM(g,!0);break;case 1666189314:null!=b.thisID&&this.doAction(b,b.thisID,1666189314);break;
case 1060866:null==b.thisID?this.deleteM(g):this.deleteO(b.thisID);this.toggle(g);break;case 269484114:this.toggle(g)}return}if("clear"===a)this.clear();else if("deleteModelAtoms"===a){this.atoms=b[1];f=b[2][0];for(var e=b[2][1],k=b[2][2],j=e+k,d=this.measurementCount;0<=--d;){c=this.measurements.get(d);for(var l=c.countPlusIndices,h=1;h<=l[0];h++)if(g=l[h],g>=e){if(g<j){this.deleteI(d);break}l[h]-=k}else if(0>g)if(g=c.getAtom(h),g.mi>f)g.mi--;else if(g.mi==f){this.deleteI(d);break}}}else"reformatDistances"===
a?this.reformatDistances():"hide"===a?r(b,String)?this.doAction(null,b,12294):this.showHideM((new JM.Measurement).setPoints(this.ms,b,null,null),!0):"show"===a?r(b,String)?this.doAction(null,b,135270926):this.showHideM((new JM.Measurement).setPoints(this.ms,b,null,null),!1):"toggle"===a?r(b,String)?this.doAction(null,b,269484114):this.toggle((new JM.Measurement).setPoints(this.ms,b,null,null)):"toggleOn"===a&&(r(b,String)?this.doAction(null,b,1048589):this.toggleOn(b))}}},"~S,~O,JU.BS");e(c$,"setSingleItem",
function(a){var b=Array(4),c=w(5,0);c[0]=a.size();for(var d=a.size();0<=--d;){var f=a.get(d);if(r(f,JU.BS)){f=f.nextSetBit(0);if(0>f)return null;c[d+1]=f}else b[d]=f,c[d+1]=-2-d}return(new JM.Measurement).setPoints(this.ms,c,b,null==this.tickInfo?this.defaultTickInfo:this.tickInfo)},"JU.Lst");h(c$,"getProperty",function(a,b){return"pending".equals(a)?this.mPending:"count".equals(a)?Integer.$valueOf(this.measurementCount):"countPlusIndices".equals(a)?b<this.measurementCount?this.measurements.get(b).countPlusIndices:
null:"stringValue".equals(a)?b<this.measurementCount?this.measurements.get(b).getString():null:"pointInfo".equals(a)?this.measurements.get(m(b/10)).getLabel(b%10,!1,!1):"info".equals(a)?this.getAllInfo():"infostring".equals(a)?this.getAllInfoAsString():null},"~S,~N");e(c$,"clear",function(){0!=this.measurementCount&&(this.measurementCount=0,this.measurements.clear(),this.vwr.setStatusMeasuring("measureDeleted",-1,"all",0))});e(c$,"setColor",function(a){null==this.bsColixSet&&(this.bsColixSet=new JU.BS);
null==this.bsSelected&&(this.colix=a);for(var b,c=this.measurements.size();0<=--c;)if(null!=(b=this.measurements.get(c))&&(null!=this.bsSelected&&this.bsSelected.get(c)||null==this.bsSelected&&(0==a||0==b.colix)))b.colix=a,this.bsColixSet.set(c)},"~N");e(c$,"setFormats",function(a){null!=a&&0==a.length&&(a=null);for(var b=this.measurements.size();0<=--b;)(null==this.bsSelected||this.bsSelected.get(b))&&this.measurements.get(b).formatMeasurementAs(a,null,!1)},"~S");e(c$,"showHide",function(a){for(var b=
this.measurements.size();0<=--b;)if(null==this.bsSelected||this.bsSelected.get(b))this.measurements.get(b).isHidden=a},"~B");e(c$,"showHideM",function(a,b){var c=this.find(a);0<=c&&(this.measurements.get(c).isHidden=b)},"JM.Measurement,~B");e(c$,"toggle",function(a){this.htMin=this.radiusData=null;var b=this.find(a),c;0<=b&&!(c=this.measurements.get(b)).isHidden?this.defineAll(b,c,!0,!1,!1):this.defineAll(-1,a,!1,!0,!1);this.setIndices()},"JM.Measurement");e(c$,"toggleOn",function(a){this.htMin=this.radiusData=
null;this.bsSelected=new JU.BS;this.defineAll(-2147483648,(new JM.Measurement).setPoints(this.ms,a,null,this.defaultTickInfo),!1,!0,!0);this.setIndices();this.reformatDistances()},"~A");e(c$,"deleteM",function(a){this.htMin=this.radiusData=null;a=this.find(a);0<=a&&this.defineAll(a,this.measurements.get(a),!0,!1,!1);this.setIndices()},"JM.Measurement");e(c$,"deleteO",function(a){r(a,Integer)?this.deleteI(a.intValue()):r(a,String)?this.doAction(null,a,12291):JU.PT.isAI(a)&&this.defineAll(-2147483648,
(new JM.Measurement).setPoints(this.ms,a,null,null),!0,!1,!1)},"~O");e(c$,"defineAll",function(a,b,c,d,f){if(this.measureAllModels){if(d&&(this.defineAll(a,b,!0,!1,!1),c))return;a=new JU.Lst;d=b.count;for(f=1;f<=d;f++){var g=b.getAtomIndex(f);a.addLast(0<=g?this.vwr.ms.getAtoms(1095763969,Integer.$valueOf(this.atoms[g].getAtomNumber())):b.getAtom(f))}this.define((new JM.MeasurementData).init(null,this.vwr,a).set(this.tokAction,this.htMin,this.radiusData,this.strFormat,null,this.tickInfo,this.mustBeConnected,
this.mustNotBeConnected,this.intramolecular,!0,0,0,null),c?12291:1060866)}else c?(-2147483648==a&&(a=this.find(b)),0<=a&&this.deleteI(a)):this.defineMeasurement(a,b,f)},"~N,JM.Measurement,~B,~B,~B");e(c$,"find",function(a){return null==a.thisID?JM.Measurement.find(this.measurements,a):-1},"JM.Measurement");e(c$,"setIndices",function(){for(var a=0;a<this.measurementCount;a++)this.measurements.get(a).index=a});e(c$,"define",function(a,b){this.tokAction=b;a.define(this,this.ms)},"JM.MeasurementData,~N");
h(c$,"processNextMeasure",function(a){var b=this.find(a);if(0<=b)12291==this.tokAction?this.deleteI(b):null!=this.strFormat?this.measurements.get(b).formatMeasurementAs(this.strFormat,null,!0):this.measurements.get(b).isHidden=1048588==this.tokAction;else if(1060866==this.tokAction||269484114==this.tokAction)a.tickInfo=null==this.tickInfo?this.defaultTickInfo:this.tickInfo,this.defineMeasurement(-1,a,!0)},"JM.Measurement");e(c$,"defineMeasurement",function(a,b,c){var d=b.getMeasurement(null);null!=
this.htMin&&!b.isMin(this.htMin)||null!=this.radiusData&&!b.isInRange(this.radiusData,d)||(-2147483648==a&&(a=this.find(b)),0<=a?(this.measurements.get(a).isHidden=!1,c&&this.bsSelected.set(a)):(a=(new JM.Measurement).setM(this.ms,b,d,0==b.colix?this.colix:b.colix,this.strFormat,this.measurementCount),a.$isValid&&(this.measurements.addLast(a),this.vwr.setStatusMeasuring("measureCompleted",this.measurementCount++,a.toVector(!1).toString(),a.value))))},"~N,JM.Measurement,~B");e(c$,"deleteI",function(a){if(!(a>=
this.measurements.size()||0>a)){var b=this.measurements.get(a).toVector(!0).toString();this.measurements.remove(a);this.measurementCount--;this.vwr.setStatusMeasuring("measureDeleted",a,b,0)}},"~N");e(c$,"doAction",function(a,b,c){b=b.toUpperCase().$replace("?","*");for(var d=JU.PT.isWild(b),f=this.measurements.size();0<=--f;){var g=this.measurements.get(f);if(null!=g.thisID&&(g.thisID.equalsIgnoreCase(b)||d&&JU.PT.isMatch(g.thisID.toUpperCase(),b,!0,!0)))switch(c){case 1666189314:g.mad=a.mad;break;
case 12291:g=this.measurements.get(f).toVector(!0).toString();this.measurements.remove(f);this.measurementCount--;this.vwr.setStatusMeasuring("measureDeleted",f,g,0);break;case 135270926:g.isHidden=!1;break;case 12294:g.isHidden=!0;break;case 269484114:g.isHidden=!g.isHidden;break;case 1048589:g.isHidden=!1}}},"JM.MeasurementData,~S,~N");e(c$,"reformatDistances",function(){for(var a=this.measurementCount;0<=--a;)this.measurements.get(a).reformatDistanceIfSelected()});e(c$,"getAllInfo",function(){for(var a=
new JU.Lst,b=0;b<this.measurementCount;b++)a.addLast(this.getInfo(b));return a});e(c$,"getAllInfoAsString",function(){for(var a="Measurement Information",b=0;b<this.measurementCount;b++)a+="\n"+this.getInfoAsString(b);return a});e(c$,"getInfo",function(a){var b=this.measurements.get(a),c=b.count,d=new java.util.Hashtable;d.put("index",Integer.$valueOf(a));d.put("type",2==c?"distance":3==c?"angle":"dihedral");d.put("strMeasurement",b.getString());d.put("count",Integer.$valueOf(c));d.put("value",Float.$valueOf(b.value));
a=b.tickInfo;null!=a&&(d.put("ticks",a.ticks),null!=a.scale&&d.put("tickScale",a.scale),null!=a.tickLabelFormats&&d.put("tickLabelFormats",a.tickLabelFormats),Float.isNaN(a.first)||d.put("tickStart",Float.$valueOf(a.first)));a=new JU.Lst;for(var f=1;f<=c;f++){var g=new java.util.Hashtable,e=b.getAtomIndex(f);g.put("_ipt",Integer.$valueOf(e));g.put("coord",JU.Escape.eP(b.getAtom(f)));g.put("atomno",Integer.$valueOf(0>e?-1:this.atoms[e].getAtomNumber()));g.put("info",0>e?"<point>":this.atoms[e].getInfo());
a.addLast(g)}d.put("atoms",a);return d},"~N");h(c$,"getInfoAsString",function(a){return this.measurements.get(a).getInfoAsString(null)},"~N");e(c$,"setVisibilityInfo",function(){var a=this.vwr.getVisibleFramesBitSet(),b=this.measurementCount;a:for(;0<=--b;){var c=this.measurements.get(b);c.isVisible=!1;if(!(0==this.mad||c.isHidden)){for(var d=c.count;0<d;d--){var f=c.getAtomIndex(d);if(0<=f){if(!this.ms.at[f].isClickable())continue a}else if(f=c.getAtom(d).mi,0<=f&&!a.get(f))continue a}c.isVisible=
!0}}});h(c$,"getShapeState",function(){return this.vwr.getMeasurementState(this,this.measurements,this.measurementCount,this.font3d,this.defaultTickInfo)})});p("J.shape");q(["J.shape.TextShape"],"J.shape.Echo",["JU.PT","JM.Object2d","$.Text","JU.C"],function(){c$=y(J.shape,"Echo",J.shape.TextShape);e(c$,"initShape",function(){z(this,J.shape.Echo,"initShape",[]);this.setProperty("target","top",null)});h(c$,"setProperty",function(a,b){if("scalereference"===a){if(null!=this.currentObject){var c=b.floatValue();
this.currentObject.setScalePixelsPerMicron(0==c?0:1E4/c)}}else if("point"===a)null!=this.currentObject&&(c=this.currentObject,c.pointerPt=null==b?null:b,c.pointer=null==b?0:1);else if("xyz"===a&&null!=this.currentObject&&this.vwr.getBoolean(603979845)&&this.currentObject.setScalePixelsPerMicron(1E4*this.vwr.getScalePixelsPerAngstrom(!1)),"scale"===a)if(null==this.currentObject){if(this.isAll)for(var d=this.objects.values().iterator();d.hasNext()&&((c=d.next())||1);)c.setScale(b.floatValue())}else this.currentObject.setScale(b.floatValue());
else if("image"===a)if(null==this.currentObject){if(this.isAll)for(d=this.objects.values().iterator();d.hasNext()&&((c=d.next())||1);)c.setImage(b)}else this.currentObject.setImage(b);else if("thisID"===a)c=b,this.currentObject=this.objects.get(c),null==this.currentObject&&JU.PT.isWild(c)&&(this.thisID=c.toUpperCase());else if("hidden"===a){var f=b.booleanValue();if(null==this.currentObject){if(this.isAll||null!=this.thisID)for(d=this.objects.values().iterator();d.hasNext()&&((c=d.next())||1);)if(this.isAll||
JU.PT.isMatch(c.target.toUpperCase(),this.thisID,!0,!0))c.hidden=f}else this.currentObject.hidden=f}else if(!JM.Object2d.setProperty(a,b,this.currentObject)){if("target"===a&&(this.thisID=null,c=b.intern().toLowerCase(),!("none"===c||"all"===c))){this.isAll=!1;d=this.objects.get(c);null==d&&(d=0,f=1,"top"===c?(d=1,f=2):"middle"===c?(d=3,f=2):"bottom"===c&&(d=2),d=JM.Text.newEcho(this.vwr,this.vwr.gdata.getFont3DFS("Serif",20),c,10,d,f,0),d.adjustForWindow=!0,this.objects.put(c,d),null!=this.currentFont&&
d.setFont(this.currentFont,!0),null!=this.currentColor&&(d.colix=JU.C.getColixO(this.currentColor)),null!=this.currentBgColor&&(d.bgcolix=JU.C.getColixO(this.currentBgColor)),0!=this.currentTranslucentLevel&&d.setTranslucent(this.currentTranslucentLevel,!1),0!=this.currentBgTranslucentLevel&&d.setTranslucent(this.currentBgTranslucentLevel,!0));this.currentObject=d;return}this.setPropTS(a,b,null)}},"~S,~O,JU.BS");h(c$,"getPropertyData",function(a,b){if("currentTarget"===a)return null!=this.currentObject&&
null!=(b[0]=this.currentObject.target);if("checkID"===a)for(var c=b[0].toUpperCase(),d=JU.PT.isWild(c),f,g=this.objects.values().iterator();g.hasNext()&&((f=g.next())||1);){var e=f.target;if(e.equalsIgnoreCase(c)||d&&JU.PT.isMatch(e.toUpperCase(),c,!0,!0))return b[1]=e,!0}return!1},"~S,~A");h(c$,"getShapeState",function(){return this.vwr.getShapeState(this)});x(c$,"FONTFACE","Serif","FONTSIZE",20,"COLOR",10)});p("J.shape");q(["J.shape.TextShape"],"J.shape.Hover",["JU.AU","JM.Text","JU.C"],function(){c$=
s(function(){this.hoverText=null;this.atomIndex=-1;this.text=this.xy=null;this.labelFormat="%U";this.specialLabel=this.atomFormats=null;t(this,arguments)},J.shape,"Hover",J.shape.TextShape);e(c$,"initShape",function(){z(this,J.shape.Hover,"initShape",[]);this.isHover=!0;var a=this.vwr.gdata.getFont3DFSS("SansSerif","Plain",12),b=JU.C.getColixS("#FFFFC3");this.currentObject=this.hoverText=JM.Text.newLabel(this.vwr,a,null,4,b,1,0,null);this.hoverText.adjustForWindow=!0});h(c$,"setProperty",function(a,
b,c){if("target"===a)this.atomIndex=null==b?-1:b.intValue();else if("text"===a)this.text=b,null!=this.text&&0==this.text.length&&(this.text=null);else if("specialLabel"===a)this.specialLabel=b;else if("atomLabel"===a){a=b;null!=a&&0==a.length&&(a=null);b=this.vwr.ms.ac;if(null==this.atomFormats||this.atomFormats.length<b)this.atomFormats=Array(b);for(b=c.nextSetBit(0);0<=b;b=c.nextSetBit(b+1))this.atomFormats[b]=a}else"xy"===a?this.xy=b:"label"===a?(this.labelFormat=b,null!=this.labelFormat&&0==this.labelFormat.length&&
(this.labelFormat=null)):"deleteModelAtoms"===a?(null!=this.atomFormats&&(this.atomFormats=JU.AU.deleteElements(this.atomFormats,b[2][1],b[2][2])),this.atomIndex=-1):this.setPropTS(a,b,null)},"~S,~O,JU.BS");h(c$,"getShapeState",function(){return this.vwr.getShapeState(this)});x(c$,"FONTFACE","SansSerif","FONTSTYLE","Plain","FONTSIZE",12)});p("J.render");q(null,"J.render.TextRenderer",["java.lang.Float","JM.Text"],function(){c$=y(J.render,"TextRenderer");c$.render=e(c$,"render",function(a,b,c,d,f,
g,e){if(!(null==a||null==a.image&&!a.doFormatText&&null==a.lines)){var k=b.setC(a.colix);if(k||!(null==a.image&&(0==a.bgcolix||!b.setC(a.bgcolix)))){a.setPosition(c,d,f,g);if(null==a.image&&0!=a.bgcolix&&(b.setC(a.bgcolix)&&J.render.TextRenderer.showBox(b,a.colix,j(a.boxX),j(a.boxY)+2*a.boxYoff2,a.z+2,a.zSlab,j(a.boxWidth),j(a.boxHeight),a.fontScale,a.isLabelOrHover),!k))return;if(null==a.image)for(c=0;c<a.lines.length;c++)a.setXYA(e,c),b.drawString(a.lines[c],a.font,j(e[0]),j(e[1]),a.z,a.zSlab,a.bgcolix);
else b.drawImage(a.image,j(a.boxX),j(a.boxY),a.z,a.zSlab,a.bgcolix,j(a.boxWidth),j(a.boxHeight));J.render.TextRenderer.drawPointer(a,b)}}},"JM.Text,J.api.JmolRendererInterface,~N,~N,~B,~A,~A");c$.drawPointer=e(c$,"drawPointer",function(a,b){if(0!=(a.pointer&1)&&b.setC(0!=(a.pointer&2)&&0!=a.bgcolix?a.bgcolix:a.colix)){var c=a.boxWidth,d=a.boxHeight,f=NaN,c=a.boxX+(a.boxX>a.atomX+c?0:a.boxX+c<a.atomX-c?c:f=c/2),f=!Float.isNaN(f),d=a.boxY+(f&&a.boxY>a.atomY?0:f&&a.boxY+d<a.atomY?d:d/2);b.drawLineXYZ(a.atomX,
a.atomY,a.atomZ,j(c),j(d),a.zSlab)}},"JM.Text,J.api.JmolRendererInterface");c$.renderSimpleLabel=e(c$,"renderSimpleLabel",function(a,b,c,d,f,e,h,k,m,l,p,n,q,r,t){var s=b.stringWidth(c)+8;n=p+n+8;var u=j(e[0]),v=j(e[1]);JM.Text.setBoxXY(s,n,m,l,e,t);l=e[0];e=e[1];0!=f&&a.setC(f)?J.render.TextRenderer.showBox(a,d,j(l),j(e),h,k,j(s),j(n),1,!0):a.setC(d);a.drawString(c,b,j(l+4),j(e+4+p),h-1,k,f);q&&(a.setC(r),0<m?a.drawLineXYZ(u,v,k,j(l),j(e+n/2),k):0>m&&a.drawLineXYZ(u,v,k,j(l+s),j(e+n/2),k))},"J.api.JmolRendererInterface,javajs.awt.Font,~S,~N,~N,~A,~N,~N,~N,~N,~N,~N,~B,~N,~B");
c$.showBox=e(c$,"showBox",function(a,b,c,d,f,e,h,k,j,l){a.fillRect(c,d,f,e,h,k);a.setC(b);l&&(2<=j?a.drawRect(c+3,d+3,f-1,e,h-6,k-6):a.drawRect(c+1,d+1,f-1,e,h-2,k-2))},"J.api.JmolRendererInterface,~N,~N,~N,~N,~N,~N,~N,~N,~B")});p("J.render");q(["J.render.FontLineShapeRenderer","JU.P3","$.P3i"],"J.render.LabelsRenderer",["JM.Text","J.render.TextRenderer","J.shape.Labels","JV.JC"],function(){c$=s(function(){this.minZ=null;this.sppm=this.descent=this.ascent=0;this.screen=this.xy=null;this.fidPrevious=
0;this.pTemp=null;this.fid=this.labelColix=this.bgcolix=0;this.atomPt=this.atom=null;this.isExact=!1;this.pointer=this.textAlign=this.offset=0;this.zSlab=-2147483648;this.zBox=this.zCutoff=0;this.boxXY=null;this.scalePixelsPerMicron=0;t(this,arguments)},J.render,"LabelsRenderer",J.render.FontLineShapeRenderer);v(c$,function(){this.minZ=w(1,0);this.xy=u(3,0);this.screen=new JU.P3i;this.pTemp=new JU.P3});h(c$,"render",function(){this.fidPrevious=0;var a=this.shape,b=a.strings,c=a.fids,d=a.offsets;if(null==
b)return!1;this.setZcutoff();var f=this.ms.at,e=this.vwr.cm.colixBackgroundContrast,h=this.vwr.getBackgroundArgb();this.sppm=this.vwr.getScalePixelsPerAngstrom(!0);this.scalePixelsPerMicron=this.vwr.getBoolean(603979845)?1E4*this.sppm:0;this.imageFontScaling=this.vwr.getImageFontScaling();var k=-1;this.minZ[0]=2147483647;for(var j=this.g3d.isAntialiased(),l=b.length;0<=--l;)if(this.atomPt=this.atom=f[l],this.isVisibleForMe(this.atom)){var p=b[l];if(!(null==p||0==p.length||null!=a.mads&&0>a.mads[l])){this.labelColix=
a.getColix2(l,this.atom,!1);this.bgcolix=a.getColix2(l,this.atom,!0);0==this.bgcolix&&this.vwr.gdata.getColorArgbOrGray(this.labelColix)==h&&(this.labelColix=e);this.fid=null==c||l>=c.length||0==c[l]?a.zeroFontId:c[l];var n=null==d||l>=d.length?0:d[l],q=0!=(n&32),r=0!=(n&16);this.isExact=0!=(n&128);this.offset=n>>8;this.textAlign=J.shape.Labels.getAlignment(n);this.pointer=n&3;this.zSlab=this.atom.sZ-m(this.atom.sD/2)-3;this.zSlab>this.zCutoff||(1>this.zSlab&&(this.zSlab=1),this.zBox=this.zSlab,r?
(n=this.atom.group,q=n.groupIndex,q!=k&&(n.getMinZ(f,this.minZ),k=q),this.zBox=this.minZ[0]):q&&(this.zBox=1),1>this.zBox&&(this.zBox=1),n=a.getLabel(l),this.boxXY=!this.isExport||this.vwr.creatingImage?a.getBox(l):u(5,0),null==this.boxXY&&a.putBox(l,this.boxXY=u(5,0)),n=this.renderLabelOrMeasure(n,p),null!=n&&a.putLabel(l,n),j&&(this.boxXY[0]/=2,this.boxXY[1]/=2),this.boxXY[4]=this.zBox)}}return!1});e(c$,"setZcutoff",function(){this.zCutoff=this.tm.zShadeEnabled?this.tm.zSlabValue:2147483647});e(c$,
"renderLabelOrMeasure",function(a,b){var c=!1;if(null!=a)null==a.font&&a.setFontFromFid(this.fid),a.atomX=this.atomPt.sX,a.atomY=this.atomPt.sY,a.atomZ=this.zSlab,null==a.pymolOffset?(a.setXYZs(this.atomPt.sX,this.atomPt.sY,this.zBox,this.zSlab),a.colix=this.labelColix,a.bgcolix=this.bgcolix):(1==a.pymolOffset[0]?this.pTemp.setT(this.atomPt):this.pTemp.set(0,0,0),this.pTemp.add3(a.pymolOffset[4],a.pymolOffset[5],a.pymolOffset[6]),this.tm.transformPtScr(this.pTemp,this.screen),a.setXYZs(this.screen.x,
this.screen.y,this.screen.z,this.zSlab),a.setScalePixelsPerMicron(this.sppm));else{var d=1==this.textAlign||0==this.textAlign;if(this.fid!=this.fidPrevious||0==this.ascent)this.vwr.gdata.setFontFid(this.fid),this.fidPrevious=this.fid,this.font3d=this.vwr.gdata.getFont3DCurrent(),d&&(this.ascent=this.font3d.getAscent(),this.descent=this.font3d.getDescent());if(d&&1==this.imageFontScaling&&0==this.scalePixelsPerMicron&&0>b.indexOf("|")&&0>b.indexOf("<su")){var d=0!=(this.pointer&1),f=0!=(this.pointer&
2)&&0!=this.bgcolix?this.bgcolix:this.labelColix;this.boxXY[0]=this.atomPt.sX;this.boxXY[1]=this.atomPt.sY;J.render.TextRenderer.renderSimpleLabel(this.g3d,this.font3d,b,this.labelColix,this.bgcolix,this.boxXY,this.zBox,this.zSlab,JV.JC.getXOffset(this.offset),JV.JC.getYOffset(this.offset),this.ascent,this.descent,d,f,this.isExact);this.atomPt=null}else a=JM.Text.newLabel(this.vwr,this.font3d,b,this.labelColix,this.bgcolix,this.textAlign,0,null),a.atomX=this.atomPt.sX,a.atomY=this.atomPt.sY,a.atomZ=
this.zSlab,a.setXYZs(this.atomPt.sX,this.atomPt.sY,this.zBox,this.zSlab),c=!0}null!=this.atomPt&&(null==a.pymolOffset&&(a.setOffset(this.offset),0!=this.textAlign&&a.setAlignment(this.textAlign)),a.pointer=this.pointer,J.render.TextRenderer.render(a,this.g3d,this.scalePixelsPerMicron,this.imageFontScaling,this.isExact,this.boxXY,this.xy));return c?a:null},"JM.Text,~S")});p("J.render");q(["J.render.LabelsRenderer"],"J.render.MeasuresRenderer","java.util.Hashtable JU.A4 $.M3 $.Measure $.P3 J.render.FontLineShapeRenderer JU.Point3fi".split(" "),
function(){c$=s(function(){this.modulating=this.doJustify=!1;this.mad0=0;this.p=this.m=this.mpts=null;this.count=0;this.matrixT=this.aaT=null;t(this,arguments)},J.render,"MeasuresRenderer",J.render.LabelsRenderer);h(c$,"initRenderer",function(){this.mpts=new java.util.Hashtable;this.p=Array(4)});h(c$,"render",function(){if(!this.g3d.checkTranslucent(!1))return!1;null==this.atomPt&&(this.atomPt=new JU.Point3fi);var a=this.shape;this.doJustify=this.vwr.getBoolean(603979871);this.modulating=null!=this.ms.bsModulated;
this.imageFontScaling=this.vwr.getImageFontScaling();this.mad0=a.mad;this.font3d=this.vwr.gdata.getFont3DScaled(a.font3d,this.imageFontScaling);this.m=a.mPending;!this.isExport&&(null!=this.m&&0!=(this.count=this.m.count))&&this.renderPendingMeasurement();if(!this.vwr.getBoolean(603979926))return!1;var b=this.vwr.getBoolean(603979879);a.setVisibilityInfo();this.setZcutoff();for(var c=a.measurementCount;0<=--c;)if(this.m=a.measurements.get(c),this.m.isVisible&&this.m.$isValid&&!(1==(this.count=this.m.count)&&
-2147483648==this.m.traceX))this.getPoints(),this.colix=this.m.colix,0==this.colix&&(this.colix=a.colix),0==this.colix&&(this.colix=this.vwr.cm.colixBackgroundContrast),this.labelColix=this.m.labelColix,0==this.labelColix?this.labelColix=this.vwr.cm.colixBackgroundContrast:-1==this.labelColix&&(this.labelColix=this.colix),this.g3d.setC(this.colix),this.colixA=this.colixB=this.colix,this.renderMeasurement(b);return!1});e(c$,"getPoints",function(){for(var a=this.count;0<=--a;){var b=this.m.getAtomIndex(a+
1),b=0<=b&&this.modulating?this.getModAtom(b):this.m.getAtom(a+1);0>b.sD&&(this.tm.transformPtScr(b,this.pt0i),b.sX=this.pt0i.x,b.sY=this.pt0i.y,b.sZ=this.pt0i.z);this.p[a]=b}this.modulating&&this.m.refresh(this.p)});e(c$,"getModAtom",function(a){var b=Integer.$valueOf(a),c=this.mpts.get(b);null!=c&&(b=null);var d=this.ms.getModulation(a);null==d?c=this.ms.at[a]:(null==c&&(c=new JU.Point3fi),c.setT(this.ms.at[a]),this.vwr.tm.vibrationOn&&this.vwr.tm.getVibrationPoint(d,c,NaN),c.sD=-1);null!=b&&this.mpts.put(b,
c);return c},"~N");e(c$,"renderMeasurement",function(a){a=a?this.m.getString():null;null!=a&&(0==a.length?a=null:null!=this.m.text&&(this.m.text.setText(a),this.m.text.colix=this.labelColix));0==this.m.mad?(this.dotsOrDashes=!1,this.mad=this.mad0):(this.mad=this.m.mad,this.dotsOrDashes=!0,this.dashDots=0>this.mad?null:J.render.FontLineShapeRenderer.ndots);switch(this.count){case 1:this.drawLine(this.p[0].sX,this.p[0].sY,this.p[0].sZ,this.m.traceX,this.m.traceY,this.p[0].sZ,this.mad);break;case 2:this.renderDistance(a,
this.p[0],this.p[1]);break;case 3:this.renderAngle(a,this.p[0],this.p[1],this.p[2]);break;case 4:this.renderTorsion(a,this.p[0],this.p[1],this.p[2],this.p[3])}this.p[0]=this.p[1]=this.p[2]=this.p[3]=null},"~B");e(c$,"renderDistance",function(a,b,c){if(null!=(this.tickInfo=this.m.tickInfo))this.drawLine(b.sX,b.sY,b.sZ,c.sX,c.sY,c.sZ,this.mad),this.drawTicks(b,c,this.mad,null!=a);else{var d=b.sZ-b.sD-10,f=c.sZ-c.sD-10,e=this.drawLine(b.sX,b.sY,d,c.sX,c.sY,f,this.mad);if(!(null==a||f>=this.zCutoff)){0<
this.mad&&(e<<=1);d=m((d+f)/2);1>d&&(d=1);var f=m((b.sX+c.sX)/2),h=m((b.sY+c.sY)/2);null==this.m.text?(this.g3d.setC(this.labelColix),this.drawString(f,h,d,e,this.doJustify&&0<(f-b.sX)*(h-b.sY),!1,!1,this.doJustify?0:2147483647,a)):(this.atomPt.ave(b,c),this.atomPt.sX=m((b.sX+c.sX)/2),this.atomPt.sY=m((b.sY+c.sY)/2),this.renderLabelOrMeasure(this.m.text,a))}}},"~S,JU.Point3fi,JU.Point3fi");e(c$,"renderAngle",function(a,b,c,d){var f=c.sD+10,e=c.sZ-f,h=d.sZ-d.sD-10;b=this.drawLine(b.sX,b.sY,b.sZ-b.sD-
10,c.sX,c.sY,e,this.mad);b+=this.drawLine(c.sX,c.sY,e,d.sX,d.sY,h,this.mad);if(!(null==a||e>=this.zCutoff))if(b=m((b+1)/2),175<this.m.value)null==this.m.text?(f=m(Math.floor(5*this.imageFontScaling)),this.g3d.setC(this.labelColix),this.drawString(c.sX+f,c.sY-f,e,b,!1,!1,!1,this.doJustify?0:2147483647,a)):(this.atomPt.setT(c),this.renderLabelOrMeasure(this.m.text,a));else{this.m.isTainted()&&(e=JU.Measure.computeAngle(this.p[0],this.p[1],this.p[2],this.vectorT2,this.vectorT3,!1),this.vectorT.cross(this.vectorT2,
this.vectorT3),this.m.renderAxis=JU.A4.new4(this.vectorT.x,this.vectorT.y,this.vectorT.z,e),this.vectorT2.normalize(),this.vectorT2.scale(0.5),this.m.renderArc=JU.P3.newP(this.vectorT2));null==this.aaT&&(this.aaT=new JU.A4,this.matrixT=new JU.M3);h=m(Math.floor(64*(this.m.renderAxis.angle/6.283185307179586)));e=this.m.renderAxis.angle/h;this.aaT.setAA(this.m.renderAxis);for(d=m(h/2);0<=--h;){this.aaT.angle=h*e;this.pointT.setT(this.m.renderArc);this.matrixT.setAA(this.aaT).rotate(this.pointT);this.pointT.add(c);
var k=this.tm.transformPt(this.pointT),j=k.z-f;0>j&&(j=0);this.g3d.drawPixel(k.x,k.y,j);h==d&&(this.pointT.setT(this.m.renderArc),this.pointT.scale(1.1),this.matrixT.rotate(this.pointT),this.pointT.add(c),this.tm.transformPt(this.pointT),j=k.z-f,null==this.m.text?(this.g3d.setC(this.labelColix),this.drawString(k.x,k.y,j,b,k.x<c.sX,!1,!1,this.doJustify?c.sY:2147483647,a)):(this.atomPt.setT(this.pointT),this.renderLabelOrMeasure(this.m.text,a)))}}},"~S,JU.Point3fi,JU.Point3fi,JU.Point3fi");e(c$,"renderTorsion",
function(a,b,c,d,f){var e=b.sZ-b.sD-10,h=c.sZ-c.sD-10,k=d.sZ-d.sD-10,j=f.sZ-f.sD-10,l=this.drawLine(b.sX,b.sY,e,c.sX,c.sY,h,this.mad),l=l+this.drawLine(c.sX,c.sY,h,d.sX,d.sY,k,this.mad),l=l+this.drawLine(d.sX,d.sY,k,f.sX,f.sY,j,this.mad),e=m((e+h+k+j)/4);null==a||e>=this.zCutoff||(l/=3,null==this.m.text?(this.g3d.setC(this.labelColix),this.drawString(m((b.sX+c.sX+d.sX+f.sX)/4),m((b.sY+c.sY+d.sY+f.sY)/4),e,l,!1,!1,!1,this.doJustify?0:2147483647,a)):(this.atomPt.add2(b,c),this.atomPt.add(d),this.atomPt.add(f),
this.atomPt.scale(0.25),this.renderLabelOrMeasure(this.m.text,a)))},"~S,JU.Point3fi,JU.Point3fi,JU.Point3fi,JU.Point3fi");e(c$,"renderPendingMeasurement",function(){this.getPoints();var a=-2147483648==this.m.traceX;this.g3d.setC(this.labelColix=a?this.vwr.cm.colixRubberband:2==this.count?20:23);if(this.m.haveTarget)this.renderMeasurement(a);else{a=this.p[this.count-1];1<this.count&&this.renderMeasurement(!1);var b=a.sZ-a.sD-10,c=this.vwr.getCursorX(),d=this.vwr.getCursorY();this.g3d.isAntialiased()&&
(c<<=1,d<<=1);this.drawLine(a.sX,a.sY,b,c,d,0,this.mad)}});h(c$,"drawLine",function(a,b,c,d,e,g,h){h=j(20<=h&&1!=this.exportType?this.vwr.tm.scaleToScreen(m((c+g)/2),h):h);if(this.dotsOrDashes&&(null==this.dashDots||this.dashDots===J.render.FontLineShapeRenderer.ndots))this.width=h;return this.drawLine2(a,b,c,d,e,g,h)},"~N,~N,~N,~N,~N,~N,~N")});p("J.render");q(["J.render.LabelsRenderer"],"J.render.EchoRenderer",["JM.Atom","J.render.TextRenderer","JU.C","$.Txt"],function(){c$=y(J.render,"EchoRenderer",
J.render.LabelsRenderer);h(c$,"render",function(){if(this.vwr.isPreviewOnly)return!1;var a=this.shape,b=this.vwr.getBoolean(603979845)?1E4*this.vwr.getScalePixelsPerAngstrom(!0):0;this.imageFontScaling=this.vwr.getImageFontScaling();var c=!1;this.setZcutoff();for(var d,a=a.objects.values().iterator();a.hasNext()&&((d=a.next())||1);)if(d.visible&&!d.hidden&&(!r(d.pointerPt,JM.Atom)||d.pointerPt.checkVisible())){4==d.valign&&(this.tm.transformPtScr(d.xyz,this.pt0i),d.setXYZs(this.pt0i.x,this.pt0i.y,
this.pt0i.z,this.pt0i.z));if(2147483647!=d.movableZPercent){var e=this.vwr.tm.zValueFromPercent(d.movableZPercent%1E3);4==d.valign&&1E3<=Math.abs(d.movableZPercent)&&(e=this.pt0i.z-this.vwr.tm.zValueFromPercent(0)+e);d.setZs(e,e)}if(!(d.zSlab>=this.zCutoff)&&(null==d.pointerPt?d.pointer=0:(d.pointer=1,this.tm.transformPtScr(d.pointerPt,this.pt0i),d.atomX=this.pt0i.x,d.atomY=this.pt0i.y,d.atomZ=this.pt0i.z,-2147483648==d.zSlab&&(d.zSlab=1)),J.render.TextRenderer.render(d,this.g3d,b,this.imageFontScaling,
!1,null,this.xy),JU.C.isColixTranslucent(d.bgcolix)||JU.C.isColixTranslucent(d.colix)))c=!0}if(!this.isExport&&(b=this.vwr.getFrameTitle(),null!=b&&0<b.length&&this.g3d.setC(this.vwr.cm.colixBackgroundContrast))){if(0<=b.indexOf("%{")||0<=b.indexOf("@{"))b=JU.Txt.formatText(this.vwr,b);this.renderFrameTitle(b)}return c});e(c$,"renderFrameTitle",function(a){this.vwr.gdata.setFontFid(this.vwr.gdata.getFontFidFS("Serif",14*this.imageFontScaling));var b=m(Math.floor(this.vwr.getScreenHeight()*(this.g3d.isAntialiased()?
2:1)-10*this.imageFontScaling)),c=m(Math.floor(5*this.imageFontScaling));this.g3d.drawStringNoSlab(a,null,c,b,0,0)},"~S")});p("J.render");q(["J.render.ShapeRenderer"],"J.render.HoverRenderer",["JU.P3","J.render.TextRenderer","JU.Txt"],function(){c$=s(function(){this.ptTemp=this.tempXY=null;t(this,arguments)},J.render,"HoverRenderer",J.render.ShapeRenderer);v(c$,function(){this.tempXY=u(3,0)});h(c$,"render",function(){if(this.tm.isNavigating())return!1;null==this.ptTemp&&(this.ptTemp=new JU.P3);var a=
this.shape,b=this.g3d.isAntialiased(),c=a.hoverText,d;if(0<=a.atomIndex){var e=this.ms.at[a.atomIndex];d=null!=a.specialLabel?a.specialLabel:null!=a.atomFormats&&null!=a.atomFormats[a.atomIndex]?this.vwr.ms.getLabeler().formatLabel(this.vwr,e,a.atomFormats[a.atomIndex],this.ptTemp):null!=a.labelFormat?this.vwr.ms.getLabeler().formatLabel(this.vwr,e,this.fixLabel(e,a.labelFormat),this.ptTemp):null;if(null==d)return!1;c.setXYZs(e.sX,e.sY,1,-2147483648)}else if(null!=a.text)d=a.text,c.setXYZs(a.xy.x,
a.xy.y,1,-2147483648);else return!0;if(null!=this.vwr&&(0<=d.indexOf("%{")||0<=d.indexOf("@{")))d=JU.Txt.formatText(this.vwr,d);c.setText(d);J.render.TextRenderer.render(c,this.g3d,0,b?2:1,!1,null,this.tempXY);return!0});e(c$,"fixLabel",function(a,b){return null==b?null:this.vwr.ms.isJmolDataFrameForModel(a.mi)&&b.equals("%U")?"%W":b},"JM.Atom,~S")})})(Clazz,Clazz.newLongArray,Clazz.doubleToByte,Clazz.doubleToInt,Clazz.doubleToLong,Clazz.declarePackage,Clazz.instanceOf,Clazz.load,Clazz.instantialize,
Clazz.decorateAsClass,Clazz.floatToInt,Clazz.floatToLong,Clazz.makeConstructor,Clazz.defineEnumConstant,Clazz.exceptionOf,Clazz.newIntArray,Clazz.defineStatics,Clazz.newFloatArray,Clazz.declareType,Clazz.prepareFields,Clazz.superConstructor,Clazz.newByteArray,Clazz.declareInterface,Clazz.p0p,Clazz.pu$h,Clazz.newShortArray,Clazz.innerTypeInstance,Clazz.isClassDefined,Clazz.prepareCallback,Clazz.newArray,Clazz.castNullAs,Clazz.floatToShort,Clazz.superCall,Clazz.decorateAsType,Clazz.newBooleanArray,
Clazz.newCharArray,Clazz.implementOf,Clazz.newDoubleArray,Clazz.overrideConstructor,Clazz.clone,Clazz.doubleToShort,Clazz.getInheritedLevel,Clazz.getParamsType,Clazz.isAF,Clazz.isAI,Clazz.isAS,Clazz.isASS,Clazz.isAP,Clazz.isAFloat,Clazz.isAII,Clazz.isAFF,Clazz.isAFFF,Clazz.tryToSearchAndExecute,Clazz.getStackTrace,Clazz.inheritArgs,Clazz.alert,Clazz.defineMethod,Clazz.overrideMethod,Clazz.declareAnonymous,Clazz.cloneFinals);
