(function(D,E,F,G,m,H,n,u,r,q,s,j,I,z,K,A,y,v,B,w,L,M,N,C,O,P,Q,x,R,S,T,U,V,W,X,Y,Z,$,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka,la,ma,na,oa,pa,qa,h,k){n("JM");r(null,"JM.Text",["JU.PT","J.shape.Shape","JU.C","$.Font","JV.JC"],function(){var e=s(function(){this.vwr=null;this.doFormatText=!1;this.font=null;this.boxYoff2=this.offsetY=this.offsetX=this.lineHeight=this.descent=this.ascent=this.fid=0;this.widths=null;this.textHeight=this.textWidth=0;this.image=this.lines=this.textUnformatted=this.text=null;this.imageScale=
1;this.barDistance=this.barPixels=0;this.isEcho=this.isMeasure=!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.z=1;this.zSlab=-2147483648;this.y0=this.yAdj=this.xAdj=0;this.pymolOffset=this.pointerPt=null;this.windowHeight=this.windowWidth=0;this.adjustForWindow=!1;
this.boxY=this.boxX=this.boxHeight=this.boxWidth=0;this.modelIndex=-1;this.thisModelOnly=!1;this.visible=!0;this.hidden=!1;this.boxXY=null;this.sppa=this.barPixelsXYZ=this.scalePixelsPerMicron=0;q(this,arguments)},JM,"Text",null);z(e,function(){this.boxXY=v(5,0)});h(e,"getPymolOffset",function(){return this.pymolOffset});h(e,"setPymolOffset",function(a){this.pymolOffset=a},"~A");e.newLabel=h(e,"newLabel",function(a,b,c,d,f,g,e){var h=new JM.Text;h.vwr=a;h.set(b,d,g,e);h.setText(c);h.bgcolix=f;return h},
"JV.Viewer,JU.Font,~S,~N,~N,~N,~N");e.newMeasure=h(e,"newMeasure",function(a,b,c){var d=new JM.Text;d.vwr=a;d.set(b,c,0,0);d.isMeasure=!0;return d},"JV.Viewer,JU.Font,~N");e.newEcho=h(e,"newEcho",function(a,b,c,d,f,g,e){var h=new JM.Text;h.isEcho=!0;h.vwr=a;h.set(b,d,g,e);h.target=c;h.valign=f;h.z=2;h.zSlab=-2147483648;return h},"JV.Viewer,JU.Font,~S,~N,~N,~N,~N");h(e,"set",function(a,b,c,d){this.scalePixelsPerMicron=d;this.colix=b;this.align=c;this.setFont(a,!this.isEcho)},"JU.Font,~N,~N,~N");h(e,
"setOffset",function(a){this.offsetX=JV.JC.getXOffset(a);this.offsetY=JV.JC.getYOffset(a);this.setPymolOffset(null);this.valign=3},"~N");h(e,"getFontMetrics",function(){this.descent=this.font.getDescent();this.ascent=this.font.getAscent();this.lineHeight=this.ascent+this.descent});h(e,"setFontFromFid",function(a){this.fid!=a&&(this.fontScale=0,this.setFont(JU.Font.getFont3D(a),!0))},"~N");h(e,"setText",function(a){null!=this.image&&(this.getFontMetrics(),this.image=null);this.barPixels=0;null!=a&&
0==a.length&&(a=null);null!=this.text&&this.text.equals(a)||(this.text=this.textUnformatted=a,(this.doFormatText=this.isEcho&&null!=a&&(0<=a.indexOf("%{")||0<=a.indexOf("@{")))||this.recalc())},"~S");h(e,"setImage",function(a){this.image=a;this.recalc()},"~O");h(e,"setScale",function(a){this.imageScale=a;this.recalc()},"~N");h(e,"setFont",function(a,b){this.font=a;null!=this.font&&(this.getFontMetrics(),b&&(this.fid=this.font.fid,this.recalc()))},"JU.Font,~B");h(e,"setFontScale",function(a){this.fontScale!=
a&&(this.fontScale=a,0!=this.fontScale&&null!=this.font&&this.setFont(this.vwr.gdata.getFont3DScaled(this.font,a),!0))},"~N");h(e,"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,0<=this.text.indexOf("\n")?"\n":"|");this.textWidth=0;this.widths=y(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)}});h(e,"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!=this.font.fontSizeAngstroms||0!=a&&0!=this.scalePixelsPerMicron?0==this.font.fontSizeAngstroms?this.setFontScale(a/this.scalePixelsPerMicron):this.setFontScale(this.sppa*this.font.fontSizeAngstroms/this.font.fontSizeNominal):this.fontScale!=b&&this.setFontScale(b);this.doFormatText?(this.text=this.isEcho?this.vwr.formatText(this.textUnformatted):this.textUnformatted,this.recalc()):null!=this.textUnformatted&&this.textUnformatted.startsWith("%SCALE")&&(a=v(2,0),this.text=
this.vwr.getScaleText(this.textUnformatted.substring(6).trim(),this.vwr.antialiased,null==this.xyz?15:8,a),this.barPixels=j(a[0]*(this.vwr.antialiased?2:1)),this.barDistance=a[1],this.recalc());a=this.offsetX*b;b*=this.offsetY;this.xAdj=2<=this.fontScale?8:4;this.yAdj=this.ascent-this.lineHeight+this.xAdj;if(!this.isEcho||null!=this.pymolOffset){d[0]=this.movableX;d[1]=this.movableY;var f=!this.isPymolOffsetPixels();null!=this.pymolOffset&&f?(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=null!=this.xyz&&0<this.barPixels?0:this.getPymolXYOffset(this.pymolOffset[1],this.textWidth,c),b=this.ascent-this.descent,b=-this.getPymolXYOffset(-this.pymolOffset[2],b,c)-m((this.textHeight+b)/2),1==this.pymolOffset[0]&&(b-=this.descent),this.xAdj=2<=this.fontScale?8:4,this.yAdj=-this.descent,d[0]=this.movableX-this.xAdj,d[1]=this.movableY-this.yAdj+m((this.descent-this.ascent)/2)+8,c=!0,this.boxYoff2=
-2):this.boxYoff2=0;if(null==this.pymolOffset)switch(this.align){case 8:a=b=0;break;case 12:d[0]-=this.boxWidth;case 4:b=0}JM.Text.setBoxXY(this.boxWidth,this.boxHeight,a,b,d,c)}else this.setPos(this.fontScale);this.boxX=d[0];this.boxY=d[1];this.adjustForWindow&&this.setBoxOffsetsInWindow(0,this.isEcho?0:16*this.fontScale+this.lineHeight,this.boxY-this.textHeight);this.y0=this.boxY+this.yAdj;this.isMeasure&&8!=this.align&&(this.y0+=this.ascent+(this.lines.length-1)/2*this.lineHeight)},"~N,~N,~B,~A");
h(e,"getPymolXYOffset",function(a,b,c){return(-1>a?-1:1<a?0:(a-1)/2)*b+(-1>a||1<a?a+(0>a?1:-1):0)*c},"~N,~N,~N");h(e,"setPos",function(a){var b,c,d,f=null!=this.xyz;3==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+this.barPixels:(b=5*a,c=m((this.windowWidth+this.barPixels)/2),d=this.windowWidth-b,b+=this.barPixels);switch(this.align){case 8:this.boxXY[0]=c-this.boxWidth/2;break;case 12:this.boxXY[0]=
d-this.boxWidth;break;default:this.boxXY[0]=b}this.boxXY[1]=0;switch(this.valign){case 0:break;case 2:this.boxXY[1]=m(this.windowHeight/2);break;case 1: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}8==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");e.setBoxXY=h(e,"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||0<d?-b-d:0==d?-b/2:-d;f[2]=a;f[3]=b},"~N,~N,~N,~N,~A,~B");h(e,"stringWidth",function(a){var b=0,c=1;if(null==a)return 0;if(0>a.indexOf("<su")&&0>a.indexOf("<color"))return this.font.stringWidth(a);for(var d=a.length,f,g=0;g<d;g++){if("<"==a.charAt(g)){if(g+8<=d&&(a.substring(g,g+7).equals("<color ")||a.substring(g,g+8).equals("</color>"))){var e=
a.indexOf(">",g);if(0<=e){g=e;continue}}if(g+5<=d&&((f=a.substring(g,g+5)).equals("<sub>")||f.equals("<sup>"))){g+=4;c=1;continue}if(g+6<=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");h(e,"setXYA",function(a,b){if(0==b){a[2]=this.boxX;switch(this.align){case 8:a[2]+=this.boxWidth/2;break;case 12:a[2]+=this.boxWidth-this.xAdj;break;default:a[2]+=this.xAdj}a[0]=a[2];a[1]=this.y0}switch(this.align){case 8:a[0]=
a[2]-m(this.widths[b]/2);break;case 12:a[0]=a[2]-this.widths[b]}a[1]+=this.lineHeight},"~A,~N");h(e,"appendFontCmd",function(a){a.append("  "+J.shape.Shape.getFontCommand("echo",this.font));0<this.scalePixelsPerMicron&&a.append(" "+1E4/this.scalePixelsPerMicron)},"JU.SB");h(e,"setScalePixelsPerMicron",function(a){this.fontScale=0;this.scalePixelsPerMicron=a},"~N");h(e,"setXYZ",function(a,b){this.xyz=a;null==a&&(this.zSlab=-2147483648,this.setPymolOffset(null));b&&(this.valign=null==a?3:4,this.adjustForWindow=
null==a)},"JU.P3,~B");h(e,"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");h(e,"setMovableX",function(a){this.valign=4==this.valign?4:3;this.movableX=a;this.movableXPercent=2147483647},"~N");h(e,"setMovableY",function(a){this.valign=4==this.valign?4:3;this.movableY=a;this.movableYPercent=2147483647},"~N");h(e,"setMovableXPercent",function(a){this.valign=
4==this.valign?4:3;this.movableX=2147483647;this.movableXPercent=a},"~N");h(e,"setMovableYPercent",function(a){this.valign=4==this.valign?4:3;this.movableY=2147483647;this.movableYPercent=a},"~N");h(e,"setMovableZPercent",function(a){4!=this.valign&&(this.valign=3);this.movableZ=2147483647;this.movableZPercent=a},"~N");h(e,"setZs",function(a,b){this.z=a;this.zSlab=b},"~N,~N");h(e,"setXYZs",function(a,b,c,d){this.setMovableX(a);this.setMovableY(b);this.setZs(c,d)},"~N,~N,~N,~N");h(e,"setScript",function(a){this.script=
null==a||0==a.length?null:a},"~S");h(e,"setAlignmentLCR",function(a){if(null!=a){if("left".equals(a))return this.setAlignment(4);if("center".equals(a))return this.setAlignment(8);if("right".equals(a))return this.setAlignment(12)}return!1},"~S");h(e,"setAlignment",function(a){this.align!=a&&(this.align=a,this.recalc());return!0},"~N");h(e,"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");h(e,"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");h(e,"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");
h(e,"getPymolScreenOffset",function(a,b,c,d,f){this.sppa=f;f=this.isPymolOffsetPixels();var g=this.isPymolOffsetRelative();null!=a&&g?d.setT(a):d.set(0,0,0);d.add3(this.pymolOffset[4],this.pymolOffset[5],this.pymolOffset[6]);this.vwr.tm.transformPtScrSafe(d,b);f&&(b.x+=this.pymolOffset[1],b.y+=this.pymolOffset[2],b.z+=this.pymolOffset[3]);this.setXYZs(b.x,b.y,b.z,c)},"JU.P3,JU.P3i,~N,JU.P3,~N");h(e,"isPymolOffsetRelative",function(){return 1==((null==this.pymolOffset?-1:j(this.pymolOffset[0]))&1)});
h(e,"isPymolOffsetPixels",function(){var a=null==this.pymolOffset?-1:j(this.pymolOffset[0]);return-1!=a&&2==(a&2)});h(e,"getStateText",function(){return this.doFormatText?JU.PT.rep(this.text,"@{","\\@{"):this.text});k(e,"toString",function(){return this.textUnformatted})});n("J.shape");r(["J.shape.Shape","java.util.Hashtable"],"J.shape.TextShape",["JU.P3","$.PT","JU.C","$.Logger"],function(){var e=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;q(this,arguments)},J.shape,"TextShape",J.shape.Shape);w(e,function(){this.objects=new java.util.Hashtable});h(e,"setPropTS",function(a,b,c){if("text"===a){var d=b;if(null!=this.currentObject)this.currentObject.setText(d);else if(this.isAll)for(var f,g=this.objects.values().iterator();g.hasNext()&&((f=g.next())||1);)f.setText(d)}else if("font"===a)if(this.currentFont=b,null!=this.currentObject)this.currentObject.setFont(this.currentFont,
!0),this.currentObject.setFontScale(0);else{if(this.isAll)for(g=this.objects.values().iterator();g.hasNext()&&((f=g.next())||1);)f.setFont(this.currentFont,!0)}else if("allOff"===a)this.currentObject=null,this.isAll=!0,this.objects=new java.util.Hashtable;else if("delete"===a)if(u(b,"JM.Text")&&(this.currentObject=b),null!=this.currentObject)this.objects.remove(this.currentObject.target),this.currentObject=null;else{if(this.isAll||null!=this.thisID)for(g=this.objects.values().iterator();g.hasNext();)d=
g.next(),(this.isAll||JU.PT.isMatch(d.target.toUpperCase(),this.thisID,!0,!0))&&g.remove()}else{if("off"===a){if(this.isAll){this.objects=new java.util.Hashtable;this.isAll=!1;this.currentObject=null;return}if(null!=this.currentObject)this.objects.remove(this.currentObject.target),this.currentObject=null;else if(null!=this.thisID)for(g=this.objects.values().iterator();g.hasNext();)d=g.next(),(this.isAll||JU.PT.isMatch(d.target.toUpperCase(),this.thisID,!0,!0))&&g.remove()}if("model"===a)if(b=b.intValue(),
null!=this.currentObject)this.currentObject.modelIndex=b;else{if(this.isAll)for(g=this.objects.values().iterator();g.hasNext()&&((f=g.next())||1);)f.modelIndex=b}else if("align"===a)if(null!=this.currentObject)this.currentObject.setAlignmentLCR(b)||JU.Logger.error("unrecognized align:"+b);else{if(this.isAll)for(var e,d=this.objects.values().iterator();d.hasNext()&&((e=d.next())||1);)e.setAlignmentLCR(b)}else if("bgcolor"===a)if(this.currentBgColor=b,null!=this.currentObject)this.currentObject.bgcolix=
JU.C.getColixO(b);else{if(this.isAll)for(g=this.objects.values().iterator();g.hasNext();)g.next().bgcolix=JU.C.getColixO(b)}else if("color"===a)if(this.currentColor=b,null!=this.currentObject)this.currentObject.colix=JU.C.getColixO(b);else{if(this.isAll||null!=this.thisID)for(g=this.objects.values().iterator();g.hasNext();)if(d=g.next(),this.isAll||JU.PT.isMatch(d.target.toUpperCase(),this.thisID,!0,!0))d.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)this.currentObject.setTranslucent(this.translucentLevel,d);else{if(this.isAll)for(g=this.objects.values().iterator();g.hasNext();)g.next().setTranslucent(this.translucentLevel,d)}else if("deleteModelAtoms"===a){b=b[2][0];for(g=this.objects.values().iterator();g.hasNext();)d=g.next(),
d.modelIndex==b?g.remove():d.modelIndex>b&&d.modelIndex--}else this.setPropS(a,b,c)}},"~S,~O,JU.BS");k(e,"getShapeState",function(){return null});k(e,"initModelSet",function(){this.currentObject=null;this.isAll=!1});k(e,"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)&&(!b.thisModelOnly||1==a.cardinality()&&b.modelIndex==this.vwr.am.cmi)},"JU.BS");k(e,"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");
k(e,"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")});n("J.shape");r(["J.shape.AtomShape","java.util.Hashtable","JU.P3"],"J.shape.Labels","JU.AU $.BS $.PT J.c.PAL JM.LabelToken $.Text JS.SV JU.BSUtil $.C $.Font JV.JC".split(" "),function(){var e=
s(function(){this.bsBgColixSet=this.bsFontSet=this.labelBoxes=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.isScaled=this.setDefaults=!1;this.scalePixelsPerMicron=0;this.ptTemp=null;this.lastPicked=this.pickedAtom=-1;this.pickedY=this.pickedX=this.pickedOffset=0;q(this,arguments)},
J.shape,"Labels",J.shape.AtomShape);w(e,function(){this.atomLabels=new java.util.Hashtable;this.ptTemp=new JU.P3});k(e,"initShape",function(){this.defaultFontId=this.zeroFontId=this.vwr.gdata.getFont3DFSS("SansSerif","Plain",13).fid;this.defaultBgcolix=this.defaultColix=0;this.defaultOffset=JV.JC.LABEL_DEFAULT_OFFSET;this.defaultAlignment=4;this.defaultZPos=this.defaultPointer=0;this.translucentAllowed=!1});k(e,"setProperty",function(a,b,c){this.isActive=!0;var d=this.ms.at,f=this.ms.ac;if("setDefaults"===
a)this.setDefaults=b.booleanValue();else if("color"===a){var g=J.c.PAL.pidOf(b),d=JU.C.getColixO(b);if(this.setDefaults)this.defaultColix=d,this.defaultPaletteID=g;else{f=this.checkColixLength(d,c.length());for(a=c.nextSetBit(0);0<=a&&a<f;a=c.nextSetBit(a+1))this.setLabelColix(a,d,g)}}else if("scalereference"===a){if(null!=this.strings){a=b.floatValue();g=0==a?0:1E4/a;f=Math.min(f,this.strings.length);for(a=c.nextSetBit(0);0<=a&&a<f;a=c.nextSetBit(a+1))d=this.getLabel(a),null==d?(d=JM.Text.newLabel(this.vwr,
null,this.strings[a],0,0,0,g),this.putLabel(a,d)):d.setScalePixelsPerMicron(g)}}else if("label"===a){d=this.isPickingMode()&&1==c.cardinality()&&c.nextSetBit(0)==this.lastPicked;this.setScaling();var g=null,e=this.checkStringLength(c.length());(0!=this.defaultColix||0!=this.defaultPaletteID)&&this.checkColixLength(this.defaultColix,c.length());0!=this.defaultBgcolix&&this.checkBgColixLength(this.defaultBgcolix,c.length());if(u(b,"JU.Lst")){var f=b.size(),g=x(-1,[null]),h=0;for(a=c.nextSetBit(0);0<=
a&&a<e;a=c.nextSetBit(a+1))h>=f?this.setLabel(J.shape.Labels.nullToken,"",a,!d):(g[0]=null,this.setLabel(g,JS.SV.sValue(b.get(h++)),a,!d))}else{g=null==b||0==b.length?J.shape.Labels.nullToken:x(-1,[null]);for(a=c.nextSetBit(0);0<=a&&a<f;a=c.nextSetBit(a+1))this.setLabel(g,b,a,!d)}this.vwr.getModelkitPropertySafely(null)===Boolean.TRUE&&this.vwr.shm.notifyAtoms("atomslabeled",x(-1,[c,null]))}else if(a.startsWith("label:"))this.setScaling(),this.checkStringLength(f),c=a.substring(6),0==c.length&&(c=
null),this.setLabel(x(-1,[null]),c,b.intValue(),!1);else if("clearBoxes"===a)this.labelBoxes=null;else if(!("translucency"===a||"bgtranslucency"===a))if("bgcolor"===a)if(this.isActive=!0,null==this.bsBgColixSet&&(this.bsBgColixSet=JU.BS.newN(f)),g=JU.C.getColixO(b),this.setDefaults)this.defaultBgcolix=g;else{f=this.checkBgColixLength(g,c.length());for(a=c.nextSetBit(0);0<=a&&a<f;a=c.nextSetBit(a+1))this.setBgcolix(a,g)}else if(null==this.bsFontSet&&(this.bsFontSet=JU.BS.newN(f)),"fontsize"===a)if(g=
b.intValue(),0>g)this.fids=null;else if(this.setDefaults)d=JU.Font.getFont3D(this.defaultFontId),this.defaultFontId=this.vwr.getFont3D(d.fontFace,d.fontStyle,g).fid;else for(a=c.nextSetBit(0);0<=a&&a<f;a=c.nextSetBit(a+1))d=JU.Font.getFont3D(null==this.fids||a>=this.fids.length?this.fids[a]:this.defaultFontId),this.setFont(a,this.vwr.getFont3D(d.fontFace,d.fontStyle,g).fid);else if("font"===a)if(g=b.fid,this.setDefaults)this.defaultFontId=g;else for(a=c.nextSetBit(0);0<=a&&a<f;a=c.nextSetBit(a+1))this.setFont(a,
g);else if("offset"===a)if(u(b,Integer))if(g=b.intValue(),this.setDefaults)this.defaultOffset=g;else for(a=c.nextSetBit(0);0<=a&&a<f;a=c.nextSetBit(a+1))this.setOffsets(a,g);else{if(!this.setDefaults){this.checkColixLength(-1,f);for(a=c.nextSetBit(0);0<=a&&a<f;a=c.nextSetBit(a+1))this.setPymolOffset(a,b)}}else if("align"===a)if(g=b.equalsIgnoreCase("right")?12:b.equalsIgnoreCase("center")?8:4,this.setDefaults)this.defaultAlignment=g;else for(a=c.nextSetBit(0);0<=a&&a<f;a=c.nextSetBit(a+1))this.setHorizAlignment(a,
g);else if("pointer"===a)if(g=b.intValue(),this.setDefaults)this.defaultPointer=g;else for(a=c.nextSetBit(0);0<=a&&a<f;a=c.nextSetBit(a+1))this.setPointer(a,g);else if("front"===a)if(g=b.booleanValue(),this.setDefaults)this.defaultZPos=g?32:0;else for(a=c.nextSetBit(0);0<=a&&a<f;a=c.nextSetBit(a+1))this.setZPos(a,32,g);else if("group"===a)if(g=b.booleanValue(),this.setDefaults)this.defaultZPos=g?16:0;else for(a=c.nextSetBit(0);0<=a&&a<f;a=c.nextSetBit(a+1))this.setZPos(a,16,g);else if("display"===
a||"toggleLabel"===a){e="toggleLabel"===a?0:b.booleanValue()?1:-1;null==this.mads&&(this.mads=C(f,0));var p=h=null,l=null,j=null,t=this.checkStringLength(c.length()),g=this.defaultBgcolix,m=this.checkBgColixLength(g,c.length()),k=0<=e?1:-1;for(a=c.nextSetBit(0);0<=a&&a<f;a=c.nextSetBit(a+1)){var n=d[a];a<t&&null!=this.strings[a]?this.mads[a]=1==e||0==e&&0>this.mads[a]?1:-1:(this.mads[a]=k,n.getGroup3(!1).equals("UNK")?(null==l&&(l=this.vwr.getStandardLabelFormat(1),j=JM.LabelToken.compile(this.vwr,
l,"\x00",null)),b=l,g=j):(null==h&&(h=this.vwr.getStandardLabelFormat(2),p=JM.LabelToken.compile(this.vwr,h,"\x00",null)),b=h,g=p),this.strings[a]=JM.LabelToken.formatLabelAtomArray(this.vwr,n,g,"\x00",null,this.ptTemp),this.formats[a]=b,this.bsSizeSet.set(a),a<m&&!this.bsBgColixSet.get(a)&&this.setBgcolix(a,this.defaultBgcolix));n.setShapeVisibility(this.vf,null!=this.strings&&a<this.strings.length&&null!=this.strings[a]&&0<=this.mads[a])}}else"pymolLabels"===a?this.setPymolLabels(b,c):("deleteModelAtoms"===
a&&(this.labelBoxes=null,f=b[2][1],g=b[2][2],this.fids=JU.AU.deleteElements(this.fids,f,g),this.bgcolixes=JU.AU.deleteElements(this.bgcolixes,f,g),this.offsets=JU.AU.deleteElements(this.offsets,f,g),this.formats=JU.AU.deleteElements(this.formats,f,g),this.strings=JU.AU.deleteElements(this.strings,f,g),JU.BSUtil.deleteBits(this.bsFontSet,c),JU.BSUtil.deleteBits(this.bsBgColixSet,c)),this.setPropAS(a,b,c))},"~S,~O,JU.BS");h(e,"isPickingMode",function(){return 2==this.vwr.getPickingMode()&&null!=this.labelBoxes});
h(e,"checkStringLength",function(a){a=Math.min(this.ms.ac,a);if(null==this.strings||a>this.strings.length)this.formats=JU.AU.ensureLengthS(this.formats,a),this.strings=JU.AU.ensureLengthS(this.strings,a),null==this.bsSizeSet&&(this.bsSizeSet=JU.BS.newN(a));return a},"~N");h(e,"checkBgColixLength",function(a,b){b=Math.min(this.ms.ac,b);if(0==a)return null==this.bgcolixes?0:this.bgcolixes.length;if(null==this.bgcolixes||b>this.bgcolixes.length)this.bgcolixes=JU.AU.ensureLengthShort(this.bgcolixes,b);
return b},"~N,~N");h(e,"setPymolLabels",function(a,b){this.setScaling();var c=this.checkStringLength(this.ms.ac);this.checkColixLength(-1,c);for(var d=b.nextSetBit(0);0<=d&&d<c;d=b.nextSetBit(d+1))this.setPymolLabel(d,a.get(Integer.$valueOf(d)),null)},"java.util.Map,JU.BS");h(e,"setPymolOffset",function(a,b){var c=this.getLabel(a);if(null==c){if(null==this.strings||a>=this.strings.length||null==this.strings[a])return;c=null!=this.bsFontSet&&this.bsFontSet.get(a)?this.fids[a]:-1;0>c&&this.setFont(a,
c=this.defaultFontId);var d=this.ms.at[a],c=JM.Text.newLabel(this.vwr,JU.Font.getFont3D(c),this.strings[a],this.getColix2(a,d,!1),this.getColix2(a,d,!0),0,this.scalePixelsPerMicron);this.setPymolLabel(a,c,this.formats[a])}c.setPymolOffset(b)},"~N,~A");h(e,"setScaling",function(){this.isActive=!0;null==this.bsSizeSet&&(this.bsSizeSet=JU.BS.newN(this.ms.ac));this.scalePixelsPerMicron=(this.isScaled=this.vwr.getBoolean(603979847))?1E4*this.vwr.getScalePixelsPerAngstrom(!1):0});h(e,"setPymolLabel",function(a,
b,c){if(null!=b){var d=b.text,f=this.ms.at[a];null!=f&&(this.addString(f,a,d,null==c?JU.PT.rep(d,"%","%%"):c),f.setShapeVisibility(this.vf,!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,~S");h(e,"setLabel",function(a,b,c,d){var f=this.ms.at[c],g=a[0];null==g&&(g=a[0]=JM.LabelToken.compile(this.vwr,b,"\x00",null));a=null==g?null:JM.LabelToken.formatLabelAtomArray(this.vwr,f,g,"\x00",null,this.ptTemp);f=this.addString(f,
c,a,b);d=(new Boolean(d|(f||null==a))).valueOf();f=this.getLabel(c);this.isScaled&&d?(f=JM.Text.newLabel(this.vwr,null,a,0,0,0,this.scalePixelsPerMicron),this.putLabel(c,f)):null!=f&&(null==a?this.putLabel(c,null):(f.setText(a),f.textUnformatted=b));d&&(this.defaultOffset!=JV.JC.LABEL_DEFAULT_OFFSET&&this.setOffsets(c,this.defaultOffset),4!=this.defaultAlignment&&this.setHorizAlignment(c,this.defaultAlignment),0!=(this.defaultZPos&32)?this.setZPos(c,32,!0):0!=(this.defaultZPos&16)&&this.setZPos(c,
16,!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,~B");h(e,"addString",function(a,b,c,d){a.setShapeVisibility(this.vf,null!=c);a=null!=d;var f=null==this.strings[b];this.strings[b]=c;this.formats[b]=a&&0<=d.indexOf("%{")?c:
d;this.bsSizeSet.setBitTo(b,a);return f},"JM.Atom,~N,~S,~S");k(e,"getProperty",function(a,b){return a.equals("font")?JU.Font.getFont3D(this.defaultFontId):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");h(e,"putLabel",function(a,b){null==b?this.atomLabels.remove(Integer.$valueOf(a)):(this.atomLabels.put(Integer.$valueOf(a),b),b.textUnformatted=this.formats[a])},"~N,JM.Text");h(e,"getLabel",function(a){return this.atomLabels.get(Integer.$valueOf(a))},
"~N");h(e,"putBox",function(a,b){null==this.labelBoxes&&(this.labelBoxes=new java.util.Hashtable);this.labelBoxes.put(Integer.$valueOf(a),b)},"~N,~A");h(e,"getBox",function(a){return null==this.labelBoxes?null:this.labelBoxes.get(Integer.$valueOf(a))},"~N");h(e,"setLabelColix",function(a,b,c){this.setColixAndPalette(b,c,a);var d;if(null!=this.colixes&&null!=(d=this.getLabel(a)))d.colix=this.colixes[a]},"~N,~N,~N");h(e,"setBgcolix",function(a,b){this.bgcolixes[a]=b;this.bsBgColixSet.setBitTo(a,0!=
b);var c=this.getLabel(a);null!=c&&(c.bgcolix=b)},"~N,~N");h(e,"setOffsets",function(a,b){if(null==this.offsets||a>=this.offsets.length){if(b==JV.JC.LABEL_DEFAULT_OFFSET)return;this.offsets=JU.AU.ensureLengthI(this.offsets,this.ms.ac)}this.offsets[a]=this.offsets[a]&63|b;var c=this.getLabel(a);null!=c&&c.setOffset(b)},"~N,~N");h(e,"setHorizAlignment",function(a,b){if(null==this.offsets||a>=this.offsets.length){switch(b){case 0:case 4:return}this.offsets=JU.AU.ensureLengthI(this.offsets,this.ms.ac)}0==
b&&(b=4);this.offsets[a]=JV.JC.setHorizAlignment(this.offsets[a],b);var c=this.getLabel(a);null!=c&&c.setAlignment(b)},"~N,~N");h(e,"setPointer",function(a,b){if(null==this.offsets||a>=this.offsets.length){if(0==b)return;this.offsets=JU.AU.ensureLengthI(this.offsets,this.ms.ac)}this.offsets[a]=JV.JC.setPointer(this.offsets[a],b);var c=this.getLabel(a);null!=c&&(c.pointer=b)},"~N,~N");h(e,"setZPos",function(a,b,c){if(null==this.offsets||a>=this.offsets.length){if(!c)return;this.offsets=JU.AU.ensureLengthI(this.offsets,
this.ms.ac)}this.offsets[a]=JV.JC.setZPosition(this.offsets[a],c?b:0)},"~N,~N,~B");h(e,"setFont",function(a,b){if(null==this.fids||a>=this.fids.length){if(b==this.zeroFontId)return;this.fids=JU.AU.ensureLengthI(this.fids,this.ms.ac)}this.fids[a]=b;this.bsFontSet.set(a);var c=this.getLabel(a);null!=c&&c.setFontFromFid(b)},"~N,~N");k(e,"setAtomClickability",function(){if(null!=this.strings)for(var a=this.strings.length;0<=--a;)null!=this.strings[a]&&(this.ms.at.length>a&&null!=this.ms.at[a]&&!this.ms.isAtomHidden(a))&&
this.ms.at[a].setClickable(this.vf)});k(e,"checkObjectClicked",function(a,b){if(!this.isPickingMode())return null;var c=this.findNearestLabel(a,b);if(0>c)return null;var d=new java.util.Hashtable;d.put("type","label");d.put("atomIndex",Integer.$valueOf(c));this.lastPicked=c;return d},"~N,~N,~N,JU.BS,~B");k(e,"checkObjectDragged",function(a,b,c,d){if(!this.isPickingMode())return!1;if(-2147483648==a)return a=this.findNearestLabel(c,d),0<=a?(this.lastPicked=this.pickedAtom=a,this.vwr.acm.setDragAtomIndex(a),
this.pickedX=c,this.pickedY=d,this.pickedOffset=null==this.offsets||this.pickedAtom>=this.offsets.length?JV.JC.LABEL_DEFAULT_OFFSET:this.offsets[this.pickedAtom],!0):!1;2147483647==a&&(this.pickedAtom=-1);if(0>this.pickedAtom)return!1;this.move2D(this.pickedAtom,c,d);return!0},"~N,~N,~N,~N,~N,JU.BS");h(e,"findNearestLabel",function(a,b){if(null==this.labelBoxes)return-1;for(var c=3.4028235E38,d=-1,f=3.4028235E38,g=this.vwr.antialiased?2:1,e=this.ms.at,h,p=this.labelBoxes.entrySet().iterator();p.hasNext()&&
((h=p.next())||1);)if(e[h.getKey().intValue()].isVisible(this.vf|9)){var l=h.getValue(),j=(a-l[0])*g,t=(b-l[1])*g;0>=j||(0>=t||j>=l[2]||t>=l[3]||l[4]>f)||(f=l[4],l=Math.min(Math.abs(j-l[2]/2),Math.abs(t-l[3]/2)),l<=c&&(c=l,d=h.getKey().intValue()))}return d},"~N,~N");h(e,"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-(c-this.pickedY);b=JV.JC.getOffset(d,f,!0);this.setOffsets(a,b)},"~N,~N,~N");h(e,"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");e.nullToken=x(-1,[null])});n("J.shape");r(["J.api.JmolMeasurementClient","J.shape.AtomShape","JU.Lst"],"J.shape.Measures","java.util.Hashtable JU.AU $.BS $.PT $.SB JM.Measurement $.MeasurementData JU.BSUtil $.C $.Escape".split(" "),
function(){var e=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;q(this,arguments)},J.shape,"Measures",J.shape.AtomShape,J.api.JmolMeasurementClient);w(e,function(){this.measurements=new JU.Lst});h(e,"getSelected",function(){return this.bsSelected});
k(e,"initModelSet",function(){for(var a=this.measurements.size();0<=--a;){var b=this.measurements.get(a);null!=b&&(b.ms=this.ms)}});k(e,"initShape",function(){null==this.font3d&&(this.font3d=this.vwr.gdata.getFont3D(18))});k(e,"setSize",function(a){this.mad=a},"~N,JU.BS");k(e,"setProperty",function(a,b,c){var d;if("clearModelIndex"===a)for(var f=0;f<this.measurementCount;f++)this.measurements.get(f).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,J.shape.Measures.getMessage(this.mPending,!1),this.mPending.value);else{var g;if((g="refresh"===a)||"refreshTrajectories"===a)for(f=this.measurements.size();0<=--f;)null!=(d=this.measurements.get(f))&&(g||d.isTrajectory)&&d.refresh(null);else if("select"===a)0==JU.BSUtil.cardinalityOf(b)?this.bsSelected=
null:(this.bsSelected=new JU.BS,this.bsSelected.or(b));else if("selectall"===a)this.bsSelected=JU.BSUtil.newBitSet2(0,this.measurementCount);else if("setFormats"===a)this.setFormats(b);else if(this.measureAllModels=this.vwr.getBoolean(603979877),"delete"===a)this.deleteO(b),this.setIndices();else{this.bsSelected=null;if("maps"===a)for(f=0;f<b.length;f++)d=b[f].length,2>d||4<d||(g=y(d+1,0),g[0]=d,System.arraycopy(b[f],0,g,1,d),this.toggleOn(g));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()&&u(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);null!=b.bsSelected&&(this.bsSelected=b.bsSelected);this.define(b,b.tokAction);this.setIndices();return}f=this.setSingleItem(b);switch(b.tokAction){case 266284:this.doAction(b,b.thisID,266284);break;case 12291:this.defineAll(-2147483648,f,!0,!1,!1);this.setIndices();break;case 1073742335:this.showHideM(f,!1);break;case 1073742334:this.showHideM(f,!0);break;case 1665140738:null!=b.thisID&&this.doAction(b,b.thisID,1665140738);break;case 12290:null==b.thisID?this.deleteM(f):
this.deleteO(b.thisID);this.toggle(f);break;case 1275082241:this.bsSelected=new JU.BS;this.processNextMeasure(b,f);break;case 268438018:this.toggle(f)}return}if("clear"===a)this.clear();else if("atomsDeleted"===a)for(f=this.measurementCount;0<=--f;){g=c.nextSetBit(0);a:for(;0<=g;g=c.nextSetBit(g+1)){d=this.measurements.get(f);b=d.countPlusIndices;for(a=1;a<=b[0];a++)if(b[a]==g){this.deleteI(f);break a}}}else if("deleteModelAtoms"===a){c=b[2][0];g=b[2][1];for(var e=b[2][2],h=g+e,f=this.measurementCount;0<=
--f;){d=this.measurements.get(f);b=d.countPlusIndices;for(a=1;a<=b[0];a++){var p=b[a];if(p>=g){if(p<h){this.deleteI(f);break}b[a]-=e}else if(0>p)if(p=d.getAtom(a),p.mi>c)p.mi--;else if(p.mi==c){this.deleteI(f);break}}}}else"reformatDistances"===a?this.reformatDistances(null==b):"hide"===a?"string"==typeof b?this.doAction(null,b,12294):this.showHideM((new JM.Measurement).setPoints(this.ms,b,null,null),!0):"refresh"===a?this.doAction(b,null,266284):"show"===a?"string"==typeof b?this.doAction(null,b,
134222350):this.showHideM((new JM.Measurement).setPoints(this.ms,b,null,null),!1):"toggle"===a?"string"==typeof b?this.doAction(null,b,268438018):this.toggle((new JM.Measurement).setPoints(this.ms,b,null,null)):"toggleOn"===a&&("string"==typeof b?this.doAction(null,b,1073742335):this.toggleOn(b))}}},"~S,~O,JU.BS");h(e,"setSingleItem",function(a){var b=a.points,c=Array(4),d=y(5,0);d[0]=b.size();for(var f=b.size();0<=--f;){var g=b.get(f);if(u(g,"JU.BS")){g=g.nextSetBit(0);if(0>g)return null;d[f+1]=
g;a.modelIndex=this.vwr.ms.at[g].mi}else c[f]=g,d[f+1]=-2-f}b=(new JM.Measurement).setPoints(this.ms,d,c,null==this.tickInfo?this.defaultTickInfo:this.tickInfo);b.setFromMD(a,!1);return b},"JM.MeasurementData");k(e,"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():"selected".equals(a)?null==this.bsSelected?new JU.BS:JU.BSUtil.copy(this.bsSelected):null},"~S,~N");h(e,"clear",function(){0!=this.measurementCount&&(this.measurementCount=0,this.measurements.clear(),this.mPending=null,this.vwr.setStatusMeasuring("measureDeleted",-1,"all",0))});h(e,"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");h(e,"setFormats",function(a){null!=a&&0==a.length&&(a=null);var b="default".equals(a);if(b||JM.Measurement.isUnits(a)){b&&(a=null);for(b=this.measurements.size();0<=--b;)if(null==this.bsSelected||this.bsSelected.get(b)){var c=this.measurements.get(b);
c.units=a;c.formatMeasurement(null)}}else for(b=this.measurements.size();0<=--b;)(null==this.bsSelected||this.bsSelected.get(b))&&this.measurements.get(b).formatMeasurementAs(a,null,!1)},"~S");h(e,"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");h(e,"showHideM",function(a,b){var c=this.find(a);0<=c&&(this.measurements.get(c).isHidden=b)},"JM.Measurement,~B");h(e,"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");h(e,"toggleOn",function(a){this.htMin=this.radiusData=null;this.bsSelected=new JU.BS;a=(new JM.Measurement).setPoints(this.ms,a,null,this.defaultTickInfo);this.defineAll(-2147483648,a,!1,!0,!0);a=this.find(a);0<=a&&this.bsSelected.set(a);this.setIndices();this.reformatDistances(!1)},"~A");h(e,"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");h(e,"deleteO",function(a){u(a,Integer)?this.deleteI(a.intValue()):"string"==typeof a?this.doAction(null,a,12291):JU.AU.isAI(a)&&this.defineAll(-2147483648,(new JM.Measurement).setPoints(this.ms,a,null,null),!0,!1,!1)},"~O");h(e,"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;f=this.ms.at;for(var g=
1;g<=d;g++){var e=b.getAtomIndex(g);a.addLast(0<=e?this.ms.getAtoms(1094715393,Integer.$valueOf(f[e].getAtomNumber())):b.getAtom(g))}this.define((new JM.MeasurementData).init(null,this.vwr,a).set(this.tokAction,this.htMin,this.radiusData,b.property,this.strFormat,null,this.tickInfo,this.mustBeConnected,this.mustNotBeConnected,this.intramolecular,!0,0,0,null,NaN,null),c?12291:12290)}else c?(-2147483648==a&&(a=this.find(b)),0<=a&&this.deleteI(a)):this.defineMeasurement(a,b,f)},"~N,JM.Measurement,~B,~B,~B");
h(e,"find",function(a){return null==a.thisID?JM.Measurement.find(this.measurements,a):-1},"JM.Measurement");h(e,"setIndices",function(){for(var a=0;a<this.measurementCount;a++)this.measurements.get(a).index=a});h(e,"define",function(a,b){this.tokAction=b;if(null!=a.bsSelected)for(var c=this.measurementCount;0<=--c;)a.bsSelected.get(c)&&this.processNextMeasure(a,this.measurements.get(c));else 1275082241==b&&(this.bsSelected=new JU.BS),a.define(this,this.ms)},"JM.MeasurementData,~N");k(e,"processNextMeasure",
function(a,b){var c=this.find(b);if(1275082241==a.tokAction){if(0>c||!this.isInRange(NaN,b))return;this.bsSelected.set(c)}if(0<=c)12291==this.tokAction?this.isInRange(NaN,b)&&this.deleteI(c):1275082241==a.tokAction?(c=this.measurements.get(c),c.setFromMD(a,!0),null!=this.strFormat&&null==a.strFormat?c.formatMeasurementAs(this.strFormat,a.units,!0):null!=a.units&&(c.strFormat=null,c.units=a.units.equals("default")?null:a.units,c.formatMeasurement(null))):this.measurements.get(c).isHidden=1073742334==
this.tokAction;else if(12290==this.tokAction||268438018==this.tokAction)b.tickInfo=null==this.tickInfo?this.defaultTickInfo:this.tickInfo,this.defineMeasurement(-1,b,!0)},"JM.MeasurementData,JM.Measurement");h(e,"isInRange",function(a,b){return!(null!=this.htMin&&!b.isMin(this.htMin)||null!=this.radiusData&&!b.isInRange(this.radiusData,a==a?a:b.getMeasurement(null)))},"~N,JM.Measurement");h(e,"defineMeasurement",function(a,b,c){var d=b.getMeasurement(null);this.isInRange(d,b)&&(-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++,J.shape.Measures.getMessage(a,!1),a.value))))},"~N,JM.Measurement,~B");e.getMessage=h(e,"getMessage",function(a,b){var c=new JU.SB;c.append("[");for(var d=1;d<=a.count;d++)1<d&&c.append(", "),c.append(a.getLabel(d,
b,!1));c.append(", ");c.append(a.getString());c.append("]");return c.toString()},"JM.Measurement,~B");h(e,"deleteI",function(a){if(!(a>=this.measurements.size()||0>a)){var b=J.shape.Measures.getMessage(this.measurements.get(a),!0);this.measurements.removeItemAt(a);this.measurementCount--;this.vwr.setStatusMeasuring("measureDeleted",a,b,0);this.bsSelected=null}},"~N");h(e,"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 266284:g.setFromMD(a,!0);break;case 1665140738:g.mad=a.mad;break;case 12291:g=J.shape.Measures.getMessage(this.measurements.get(f),!0);this.measurements.removeItemAt(f);this.measurementCount--;this.vwr.setStatusMeasuring("measureDeleted",f,g,0);break;case 134222350:g.isHidden=!1;break;case 12294:g.isHidden=!0;break;case 268438018:g.isHidden=!g.isHidden;break;
case 1073742335:g.isHidden=!1}}},"JM.MeasurementData,~S,~N");h(e,"reformatDistances",function(a){for(var b=this.measurementCount;0<=--b;)this.measurements.get(b).reformatDistanceIfSelected(a)},"~B");h(e,"getAllInfo",function(){for(var a=new JU.Lst,b=0;b<this.measurementCount;b++)a.addLast(this.getInfo(b));return a});h(e,"getAllInfoAsString",function(){for(var a="Measurement Information",b=0;b<this.measurementCount;b++)a+="\n"+this.getInfoAsString(b);return a});h(e,"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("id",""+b.thisID);d.put("value",Float.$valueOf(b.value));d.put("hidden",Boolean.$valueOf(b.isHidden));d.put("visible",Boolean.$valueOf(b.isVisible));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=this.ms.at,g=1;g<=c;g++){var e=new java.util.Hashtable,h=b.getAtomIndex(g);e.put("_ipt",Integer.$valueOf(h));e.put("coord",JU.Escape.eP(b.getAtom(g)));e.put("atomno",Integer.$valueOf(0>h?-1:f[h].getAtomNumber()));e.put("info",0>h?"<point>":f[h].getInfo());a.addLast(e)}d.put("atoms",a);return d},"~N");h(e,"getInfoAsString",function(a){return this.measurements.get(a).getInfoAsString(null)},"~N");h(e,"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}}})});n("J.shape");r(["J.shape.TextShape"],"J.shape.Echo",["java.util.Hashtable","JU.Lst","$.PT","JM.Text","JU.C"],function(){var e=s(function(){this.scaleObject=
null;q(this,arguments)},J.shape,"Echo",J.shape.TextShape);k(e,"initShape",function(){this.setProperty("target","top",null)});k(e,"setProperty",function(a,b,c){if("target"===a){if("%SCALE".equals(b)&&(this.currentObject=this.scaleObject,this.thisID="%SCALE",null!=this.currentObject))return;var d=b.intern().toLowerCase();if(JU.PT.isWild(d))a="thisID";else if("none"!==d&&"all"!==d){this.isAll=!1;b=null!=this.scaleObject;c=(a="%SCALE"===this.thisID)?this.scaleObject:this.objects.get(d);if(null==c||c===
this.scaleObject){var f=3,g=4;"top"===d?(f=0,g=8):"middle"===d?(f=2,g=8):"bottom"===d?f=1:"error"===d&&(f=0);null!=c&&c===this.scaleObject?(c.valign=f,c.align=g):(c=JM.Text.newEcho(this.vwr,this.vwr.gdata.getFont3DFS("Serif",20),d,10,f,g,0),c.adjustForWindow=!0,"%SCALE"===this.thisID?this.scaleObject=c:(this.objects.put(d,c),d.startsWith("_!_")&&(c.thisModelOnly=!0)));if(!a||!b)null!=this.currentFont&&c.setFont(this.currentFont,!0),null!=this.currentColor&&(c.colix=JU.C.getColixO(this.currentColor)),
null!=this.currentBgColor&&(c.bgcolix=JU.C.getColixO(this.currentBgColor)),0!=this.currentTranslucentLevel&&c.setTranslucent(this.currentTranslucentLevel,!1),0!=this.currentBgTranslucentLevel&&c.setTranslucent(this.currentBgTranslucentLevel,!0)}this.currentObject=c;"%SCALE"!==this.thisID&&(this.thisID=null);return}}if("thisID"===a)null==b?this.thisID=this.currentObject=null:(d=b,"%SCALE"===d?(this.currentObject=this.scaleObject,this.thisID=d):(this.currentObject=this.objects.get(d),null==this.currentObject&&
JU.PT.isWild(d)&&(this.thisID=d.toUpperCase())));else if("%SCALE"===a)this.currentObject=this.scaleObject=b,this.thisID="%SCALE";else if(("color"===a||"font"===a)&&null!=this.scaleObject&&this.currentObject===this.scaleObject)d=this.currentFont,f=this.currentColor,this.setPropTS(a,b,c),this.currentFont=d,this.currentColor=f;else if("off"===a&&null!=this.currentObject&&this.currentObject===this.scaleObject)this.currentObject=this.scaleObject=null;else if("text"===a&&b.startsWith("%SCALE"))this.thisID=
"%SCALE",this.setPropTS("text",b,null),this.scaleObject=this.currentObject,null!=this.scaleObject&&this.objects.get(this.scaleObject.target)===this.scaleObject&&this.setPropTS("delete",this.scaleObject,null),this.currentObject=this.scaleObject;else if("scalereference"===a)null!=this.currentObject&&(d=b.floatValue(),this.currentObject.setScalePixelsPerMicron(0==d?0:1E4/d));else if("point"===a)null!=this.currentObject&&(f=this.currentObject,f.pointerPt=null==b?null:b,f.pointer=null==b?0:1);else if("xyz"===
a)null!=this.currentObject&&(this.vwr.getBoolean(603979847)&&this.currentObject.setScalePixelsPerMicron(1E4*this.vwr.getScalePixelsPerAngstrom(!1)),this.currentObject.setXYZ(b,!0));else if("scale"===a)if(null!=this.currentObject)this.currentObject.setScale(b.floatValue());else{if(this.isAll)for(d=this.objects.values().iterator();d.hasNext()&&((f=d.next())||1);)f.setScale(b.floatValue())}else if("image"===a)if(null!=this.currentObject)this.currentObject.setImage(b);else{if(this.isAll)for(d=this.objects.values().iterator();d.hasNext()&&
((f=d.next())||1);)f.setImage(b)}else if("hidden"===a)if(b=b.booleanValue(),null!=this.currentObject)this.currentObject.hidden=b;else{if(this.isAll||null!=this.thisID)for(d=this.objects.values().iterator();d.hasNext()&&((f=d.next())||1);)if(this.isAll||JU.PT.isMatch(f.target.toUpperCase(),this.thisID,!0,!0))f.hidden=b}else"script"===a?null!=this.currentObject&&this.currentObject.setScript(b):"xpos"===a?null!=this.currentObject&&(this.currentObject.setXYZ(null,!0),this.currentObject.setMovableX(b.intValue())):
"ypos"===a?null!=this.currentObject&&(this.currentObject.setXYZ(null,!0),this.currentObject.setMovableY(b.intValue())):"%xpos"===a?null!=this.currentObject&&(this.currentObject.setXYZ(null,!0),this.currentObject.setMovableXPercent(b.intValue())):"%ypos"===a?null!=this.currentObject&&(this.currentObject.setXYZ(null,!0),this.currentObject.setMovableYPercent(b.intValue())):"%zpos"===a?null!=this.currentObject&&this.currentObject.setMovableZPercent(b.intValue()):"xypos"===a?null!=this.currentObject&&
(this.currentObject.setXYZ(null,!0),3.4028235E38==b.z?(this.currentObject.setMovableX(j(b.x)),this.currentObject.setMovableY(j(b.y))):(this.currentObject.setMovableXPercent(j(b.x)),this.currentObject.setMovableYPercent(j(b.y)))):"offset"===a?null!=this.currentObject&&this.currentObject.setPymolOffset(b):("align"===a&&null!=this.currentObject&&this.currentObject.setPymolOffset(null),this.setPropTS(a,b,null))},"~S,~O,JU.BS");k(e,"getPropertyData",function(a,b){if("currentTarget"===a)return null!=this.currentObject&&
null!=(b[0]=this.currentObject.target);if("%SCALE"===a)return b[0]=this.scaleObject,null!=b[0];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}return this.getPropShape(a,b)},"~S,~A");k(e,"getShapeDetail",function(){for(var a=new java.util.Hashtable,b,c=this.objects.entrySet().iterator();c.hasNext()&&((b=
c.next())||1);){var d=new java.util.Hashtable,f=b.getValue(),g=b.getKey();d.put("boxXY",f.boxXY);null!=f.xyz&&d.put("xyz",f.xyz);var e=f.image;null==e?d.put("text",null==f.text?"":f.text):(d.put("imageFile",f.text),d.put("imageWidth",Integer.$valueOf(this.vwr.apiPlatform.getImageWidth(e))),d.put("imageHeight",Integer.$valueOf(this.vwr.apiPlatform.getImageHeight(e))));a.put(g,d)}b=new JU.Lst;b.addLast(a);return b})});n("J.shape");r(["J.shape.TextShape"],"J.shape.Hover",["JU.AU","JM.Text","JU.C"],function(){var e=
s(function(){this.hoverText=null;this.atomIndex=-1;this.text=this.xy=this.withPointer=null;this.labelFormat="%U";this.specialLabel=this.atomFormats=null;q(this,arguments)},J.shape,"Hover",J.shape.TextShape);k(e,"initShape",function(){this.isHover=!0;this.withPointer=null;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,4,0);this.hoverText.adjustForWindow=!0});k(e,"setProperty",function(a,b,
c){if("target"===a)this.atomIndex=null==b?-1:b.intValue();else if("pointer"===a)this.withPointer=b;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.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")});n("J.render");r(null,"J.render.TextRenderer",["JM.Text","JU.C"],function(){var e=B(J.render,"TextRenderer",null);e.render=h(e,"render",function(a,b,c,d,f,g,e,h,p,l,m){if(null==b||null==b.image&&!b.doFormatText&&null==b.lines)return!1;var t=
0!=(m&64),k=0!=(m&1);m=0!=(m&4);var n=b.colix;b.isEcho&&-74566==JU.C.getArgb(n)&&(n=a.cm.colixBackgroundContrast);n=c.setC(n);if(!n&&null==b.image&&(0==b.bgcolix||!c.setC(b.bgcolix)))return!1;b.isEcho&&4==b.valign&&J.render.TextRenderer.calcBarPixelsXYZ(a,b,h,!1);b.setPosition(d,f,t,g);a=b.isEcho&&4==b.valign?J.render.TextRenderer.calcBarPixelsXYZ(a,b,h,!1):b.barPixels;if(null==b.image){if(0!=b.bgcolix&&(c.setC(b.bgcolix)&&J.render.TextRenderer.showBox(c,b.colix,j(b.boxX)-(0==a?0:a+4),j(b.boxY)+2*
b.boxYoff2,b.z+2,b.zSlab,j(b.boxWidth)+a,j(b.boxHeight),b.fontScale,!b.isEcho),!n))return!1;for(d=0;d<b.lines.length;d++)b.setXYA(e,d),null!=b.xyz&&(e[1]+=2),c.drawString(b.lines[d],b.font,j(e[0]),j(e[1]),b.z,b.zSlab,b.bgcolix);0<b.barPixels&&J.render.TextRenderer.renderScale(c,b,e,a,m)}else c.drawImage(b.image,j(b.boxX),j(b.boxY),b.z,b.zSlab,b.bgcolix,j(b.boxWidth),j(b.boxHeight));if(!k)return!0;J.render.TextRenderer.drawLineXYZ(c,b.atomX,b.atomY,b.atomZ,b.boxX,b.boxY,b.zSlab,b.boxWidth,b.boxHeight,
p,l*(m?2:1));return!0},"JV.Viewer,JM.Text,J.api.JmolRendererInterface,~N,~N,~A,~A,JU.P3i,~N,~N,~N");e.calcBarPixelsXYZ=h(e,"calcBarPixelsXYZ",function(a,b,c,d){var f=b.barPixels;null!=b.xyz&&(a.tm.transformPtScr(b.xyz,c),d&&b.setXYZs(c.x,c.y,c.z,c.z),0<f&&a.tm.perspectiveDepth&&(a=a.tm.unscaleToScreen(c.z,f),f=b.barPixelsXYZ=j(f*b.barDistance/a)));return f},"JV.Viewer,JM.Text,JU.P3i,~B");e.renderScale=h(e,"renderScale",function(a,b,c,d,f){var g=b.z,e=null==b.xyz?0:2;f=f?2:1;var h=e+j(c[0])-d-1-2*
f,p=e+j(c[0])-1-2*f,e=m(b.lineHeight/2);c=j(c[1])-1;a.fillTextRect(h,c-m(e/2)-f,g,b.zSlab,p-h,2*f);a.fillTextRect(h,c-m(2*e/2),g,b.zSlab,2*f,m(2*e/2));a.fillTextRect(p,c-m(2*e/2),g,b.zSlab,2*f,m(2*e/2));for(p=1;10>p;p++){var l=h+m(p*d/10),k=5==p?e:m(e/2);a.fillTextRect(l,c-k,g,b.zSlab,2*f,k)}},"J.api.JmolRendererInterface,JM.Text,~A,~N,~B");e.drawLineXYZ=h(e,"drawLineXYZ",function(a,b,c,d,f,g,e,h,p,l,m){var k=f-b,n=g-c;if(!(0>=k&&-k<=h&&0>=n&&-n<=p)){var r=NaN;f+=0<n||n<-p?k>h/2?0:k<3*-h/2?h:r=h/
2:0<k?0:h;h=!Float.isNaN(r);g+=h&&0<n?0:h&&n<-p?p:p/2;1<m?a.fillCylinderXYZ(l,l,2,m,b,c,d,j(f),j(g),e):(a.setC(l),a.drawLineXYZ(b,c,d,j(f),j(g),e))}},"J.api.JmolRendererInterface,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N");e.renderSimpleLabel=h(e,"renderSimpleLabel",function(a,b,c,d,f,e,h,m,p,l,k,t,n,r,q){var s=b.stringWidth(c)+8;t=k+t+8;var u=j(e[0]),v=j(e[1]),w=0!=(q&1),x=0!=(q&4);JM.Text.setBoxXY(s,t,p,l,e,0!=(q&64));q=e[0];e=e[1];0!=f&&a.setC(f)?J.render.TextRenderer.showBox(a,d,j(q),j(e),h,m,j(s),j(t),1,
!0):a.setC(d);a.drawString(c,b,j(q+4),j(e+4+k),h-1,m,f);if(w&&(0!=p||0!=l))J.render.TextRenderer.drawLineXYZ(a,u,v,m,q,e,m,s,t,n,r*(x?2:1))},"J.api.JmolRendererInterface,JU.Font,~S,~N,~N,~A,~N,~N,~N,~N,~N,~N,~N,~N,~N");e.showBox=h(e,"showBox",function(a,b,c,d,f,e,h,m,p,l){a.fillTextRect(c,d,f,e,h,m);a.setC(b);l&&(2<=p?a.drawRect(c+3,d+3,f-1,e,h-6,m-6):a.drawRect(c+1,d+1,f-1,e,h-2,m-2))},"J.api.JmolRendererInterface,~N,~N,~N,~N,~N,~N,~N,~N,~B")});n("J.render");r(["J.render.FontLineShapeRenderer","JU.P3",
"$.P3i"],"J.render.LabelsRenderer",["JM.Text","J.render.TextRenderer","JU.Font","JV.JC"],function(){var e=s(function(){this.minZ=null;this.sppa=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.pointer=this.textAlign=this.offset=this.doPointer=0;this.zSlab=-2147483648;this.zBox=0;this.boxXY=null;this.mode=this.scalePixelsPerMicron=0;q(this,arguments)},J.render,"LabelsRenderer",J.render.FontLineShapeRenderer);
w(e,function(){this.minZ=y(1,0);this.xy=v(3,0);this.screen=new JU.P3i;this.pTemp=new JU.P3});h(e,"setRenderVars",function(){this.sppa=this.vwr.getScalePixelsPerAngstrom(!0);this.scalePixelsPerMicron=this.vwr.getBoolean(603979847)?1E4*this.sppa:0;this.imageFontScaling=this.vwr.imageFontScaling});k(e,"render",function(){this.fidPrevious=0;var a=this.shape,b=a.strings,c=a.fids,d=a.offsets;if(null==b)return!1;var f=this.ms.at,e=this.vwr.cm.colixBackgroundContrast,h=this.vwr.getBackgroundArgb();this.setRenderVars();
var k=-1;this.minZ[0]=2147483647;for(var p=this.g3d.isAntialiased(),l=b.length;0<=--l;)if(this.atomPt=this.atom=f[l],this.isVisibleForMe(this.atom)){var j=b[l];if(!(null==j||0==j.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];this.offset=null==d||l>=d.length?0:d[l];var n=0!=(this.offset&
32),q=0!=(this.offset&16);this.textAlign=JV.JC.getAlignment(this.offset);this.pointer=JV.JC.getPointer(this.offset);this.doPointer=this.pointer&1;this.mode=this.doPointer|this.offset&64|(p?4:0);this.zSlab=this.atom.sZ-m(this.atom.sD/2)-3;1>this.zSlab&&(this.zSlab=1);this.zBox=this.zSlab;q?(n=this.atom.group,q=n.groupIndex,q!=k&&(n.getMinZ(f,this.minZ),k=q),this.zBox=this.minZ[0]):n&&(this.zBox=1);1>this.zBox&&(this.zBox=1);n=a.getLabel(l);this.boxXY=!this.isExport||this.vwr.creatingImage?a.getBox(l):
v(5,0);null==this.boxXY&&a.putBox(l,this.boxXY=v(5,0));n=this.renderLabelOrMeasure(n,j);null!=n&&a.putLabel(l,n);p&&(this.boxXY[0]/=2,this.boxXY[1]/=2);this.boxXY[4]=this.zBox}}return!1});h(e,"renderLabelOrMeasure",function(a,b){var c=!1,d=0!=(this.pointer&2)&&0!=this.bgcolix?this.bgcolix:this.labelColix;if(null==a){c=4==this.textAlign||0==this.textAlign;if(this.fid!=this.fidPrevious||0==this.ascent)this.vwr.gdata.setFont(JU.Font.getFont3D(this.fid)),this.fidPrevious=this.fid,this.font3d=this.vwr.gdata.getFont3DCurrent(),
c&&(this.ascent=this.font3d.getAscent(),this.descent=this.font3d.getDescent());if(c&&1==this.imageFontScaling&&0==this.scalePixelsPerMicron&&0>b.indexOf("|")&&0>b.indexOf("\n")&&0>b.indexOf("<su")&&0>b.indexOf("<co"))return 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,0==this.doPointer?
0:this.vwr.getInt(553648147),this.mode),null;a=JM.Text.newLabel(this.vwr,this.font3d,b,this.labelColix,this.bgcolix,this.textAlign,0);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}else null==a.font&&a.setFontFromFid(this.fid),a.atomX=this.atomPt.sX,a.atomY=this.atomPt.sY,a.atomZ=this.zSlab,null==a.getPymolOffset()?(a.setXYZs(this.atomPt.sX,this.atomPt.sY,this.zBox,this.zSlab),a.colix=this.labelColix,a.bgcolix=this.bgcolix):
a.getPymolScreenOffset(this.atomPt,this.screen,this.zSlab,this.pTemp,this.sppa);null==a.getPymolOffset()&&(null==a.font&&a.setFontFromFid(this.font3d.fid),a.setOffset(this.offset),0!=this.textAlign&&a.setAlignment(this.textAlign));a.pointer=this.pointer;this.renderText(a,null,d,this.mode);return c?a:null},"JM.Text,~S");h(e,"renderText",function(a,b,c,d){return J.render.TextRenderer.render(this.vwr,a,this.g3d,this.scalePixelsPerMicron,this.imageFontScaling,this.boxXY,this.xy,b,c,0==this.doPointer?
0:this.vwr.getInt(553648147),d)},"JM.Text,JU.P3i,~N,~N")});n("J.render");r(["J.render.LabelsRenderer"],"J.render.MeasuresRenderer","java.util.Hashtable JU.A4 $.M3 $.Measure $.P3 J.render.FontLineShapeRenderer JU.Point3fi".split(" "),function(){var e=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;q(this,arguments)},J.render,"MeasuresRenderer",J.render.LabelsRenderer);k(e,"initRenderer",function(){this.mpts=new java.util.Hashtable;
this.p=Array(4)});k(e,"render",function(){if(!this.g3d.checkTranslucent(!1))return!1;null==this.atomPt&&(this.atomPt=new JU.Point3fi);var a=this.shape;if(a.ms!==this.ms)return System.out.println("!measure wrong modelset!"),a.clear(),!1;this.doJustify=this.vwr.getBoolean(603979869);this.modulating=null!=this.ms.bsModulated;this.setRenderVars();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(603979878);a.setVisibilityInfo();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.vwr.am.splitFrame&&this.m.modelIndex!=this.vwr.tm.splitFrameCurrentlyRendering))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.mode=this.g3d.isAntialiased()?4:0,this.renderMeasurement(b);return!1});h(e,"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)});h(e,"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");h(e,"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,this.m.text.setFontScale(this.imageFontScaling)));0==this.m.mad?(this.dotsOrDashes=!1,this.mad=this.mad0):(this.mad=this.m.mad,this.dotsOrDashes=!0,this.dashDots=null!=this.m.text&&null!=this.m.text.getPymolOffset()?J.render.FontLineShapeRenderer.pymoldashes: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");h(e,"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.tickA=b,this.tickB=c,null==this.tickAs&&(this.tickAs=new JU.P3,this.tickBs=new JU.P3),this.tickAs.set(b.sX,b.sY,
b.sZ),this.tickBs.set(c.sX,c.sY,c.sZ),this.drawTicks(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){0<this.mad&&(e<<=1);d=this.m.inFront?Math.min(d,f)-10: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,!0,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");h(e,"renderAngle",function(a,b,c,d){var e=c.sD+10,g=b.sZ-b.sD-10,h=c.sZ-e,k=d.sZ-d.sD-10;b=this.drawLine(b.sX,b.sY,g,c.sX,c.sY,h,this.mad);b+=this.drawLine(c.sX,c.sY,h,d.sX,d.sY,k,this.mad);if(null!=a)if(b=m((b+1)/2),175<this.m.value)null==this.m.text?(e=m(Math.floor(5*this.imageFontScaling)),this.g3d.setC(this.labelColix),this.drawString(c.sX+e,c.sY-e,h,b,!1,!1,!1,this.doJustify?0:2147483647,a)):(this.atomPt.setT(c),
this.renderLabelOrMeasure(this.m.text,a));else{this.m.isTainted()&&(d=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,d),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);var j=m(Math.floor(64*(this.m.renderAxis.angle/6.283185307179586)));
d=this.m.renderAxis.angle/j;this.aaT.setAA(this.m.renderAxis);for(var l=m(j/2);0<=--j;){this.aaT.angle=j*d;this.pointT.setT(this.m.renderArc);this.matrixT.setAA(this.aaT).rotate(this.pointT);this.pointT.add(c);var n=this.tm.transformPt(this.pointT),q=n.z-e;0>q&&(q=0);this.g3d.drawPixel(n.x,n.y,q);j==l&&(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),q=this.m.inFront?Math.min(Math.min(g,h),k):n.z-e,1>q&&
(q=1),null==this.m.text?(this.g3d.setC(this.labelColix),this.drawString(n.x,n.y,q,b,n.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");h(e,"renderTorsion",function(a,b,c,d,e){var g=b.sZ-b.sD-10,h=c.sZ-c.sD-10,j=d.sZ-d.sD-10,k=e.sZ-e.sD-10,l=this.drawLine(b.sX,b.sY,g,c.sX,c.sY,h,this.mad),l=l+this.drawLine(c.sX,c.sY,h,d.sX,d.sY,j,this.mad),l=l+this.drawLine(d.sX,d.sY,j,e.sX,e.sY,k,
this.mad);null!=a&&(g=this.m.inFront?Math.min(Math.min(Math.min(g,h),j),k):m((g+h+j+k)/4),1>g&&(g=1),l/=3,null==this.m.text?(this.g3d.setC(this.labelColix),this.drawString(m((b.sX+c.sX+d.sX+e.sX)/4),m((b.sY+c.sY+d.sY+e.sY)/4),g,l,!1,!1,!1,this.doJustify?0:2147483647,a)):(this.atomPt.add2(b,c),this.atomPt.add(d),this.atomPt.add(e),this.atomPt.scale(0.25),this.renderLabelOrMeasure(this.m.text,a)))},"~S,JU.Point3fi,JU.Point3fi,JU.Point3fi,JU.Point3fi");h(e,"renderPendingMeasurement",function(){if(!(this.vwr.am.splitFrame&&
this.m.modelIndex!=this.vwr.tm.splitFrameCurrentlyRendering)){try{this.getPoints()}catch(a){if(A(a,Exception)){this.shape.mPending=null;return}throw a;}var b=-2147483648==this.m.traceX;this.g3d.setC(this.labelColix=b?this.vwr.cm.colixRubberband:2==this.count?20:23);if(this.m.haveTarget)this.renderMeasurement(b);else if(b=this.p[this.count-1],!(this.vwr.am.splitFrame&&this.vwr.am.getSplitFrameModel()!=b.mi)){1<this.count&&this.renderMeasurement(!1);var c=b.sZ-b.sD-10,d=this.vwr.getCursorX(),e=this.vwr.getCursorY();
this.g3d.isAntialiased()&&(d<<=1,e<<=1);this.drawLine(b.sX,b.sY,c,d,e,c,this.mad)}}});k(e,"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.dashDots===J.render.FontLineShapeRenderer.pymoldashes))this.width=h;return this.drawLine2(this.g3d,a,b,c,d,e,g,h)},"~N,~N,~N,~N,~N,~N,~N")});n("J.render");r(["J.render.LabelsRenderer"],"J.render.EchoRenderer",
["J.render.TextRenderer","JU.C"],function(){var e=s(function(){this.haveTranslucent=!1;q(this,arguments)},J.render,"EchoRenderer",J.render.LabelsRenderer);k(e,"render",function(){if(this.vwr.isPreviewOnly)return!1;var a=this.shape;this.setRenderVars();this.haveTranslucent=!1;for(var b=this.g3d.isAntialiased()?4:0,c,d=a.objects.values().iterator();d.hasNext()&&((c=d.next())||1);)this.renderEcho(c,b);null!=a.scaleObject&&this.renderEcho(a.scaleObject,b);this.isExport||(a=this.vwr.getFrameTitle(),null!=
a&&0<a.length&&this.g3d.setC(this.vwr.cm.colixBackgroundContrast)&&this.renderFrameTitle(this.vwr.formatText(a)));return this.haveTranslucent});h(e,"renderEcho",function(a,b){if(a.visible&&!a.hidden&&(!u(a.pointerPt,"JM.Atom")||a.pointerPt.checkVisible())){4==a.valign&&J.render.TextRenderer.calcBarPixelsXYZ(this.vwr,a,this.pt0i,!0);if(null!=a.getPymolOffset())a.getPymolScreenOffset(a.xyz,this.pt0i,this.zSlab,this.pTemp,this.sppa);else if(2147483647!=a.movableZPercent){var c=this.vwr.tm.zValueFromPercent(a.movableZPercent%
1E3);4==a.valign&&1E3<=Math.abs(a.movableZPercent)&&(c=this.pt0i.z-this.vwr.tm.zValueFromPercent(0)+c);a.setZs(c,c)}null==a.pointerPt?a.pointer=0:(a.pointer=1,this.tm.transformPtScr(a.pointerPt,this.pt0i),a.atomX=this.pt0i.x,a.atomY=this.pt0i.y,a.atomZ=this.pt0i.z,-2147483648==a.zSlab&&(a.zSlab=1));this.renderText(a,this.pt2i,0,b)&&(1==a.valign&&12==a.align)&&(this.vwr.noFrankEcho=!1);if(JU.C.renderPass2(a.bgcolix)||JU.C.renderPass2(a.colix))this.haveTranslucent=!0}},"JM.Text,~N");h(e,"renderFrameTitle",
function(a){this.vwr.gdata.setFontBold("arial",j(24*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")});n("J.render");r(["J.render.ShapeRenderer"],"J.render.HoverRenderer",["JU.P3","J.render.TextRenderer"],function(){var e=s(function(){this.ptTemp=this.tempXY=null;q(this,arguments)},J.render,"HoverRenderer",J.render.ShapeRenderer);
w(e,function(){this.tempXY=v(3,0)});k(e,"render",function(){if(!this.vwr.showHover())return!1;null==this.ptTemp&&(this.ptTemp=new JU.P3);var a=this.shape,b=this.g3d.isAntialiased(),c=a.hoverText,d,e=a.withPointer===Boolean.TRUE?1:0;if(0<=a.atomIndex){var g=this.ms.at[a.atomIndex];d=null!=a.specialLabel?a.specialLabel:null!=a.atomFormats&&null!=a.atomFormats[a.atomIndex]?this.ms.getLabeler().formatLabel(this.vwr,g,a.atomFormats[a.atomIndex],this.ptTemp):null!=a.labelFormat?this.ms.getLabeler().formatLabel(this.vwr,
g,this.fixLabel(g,a.labelFormat),this.ptTemp):null;if(null==d)return!1;1==e&&(c.atomX=g.sX,c.atomY=g.sY,c.atomZ=c.z);c.setXYZs(g.sX,g.sY,1,-2147483648)}else if(null!=a.text)d=a.text,c.setXYZs(a.xy.x,a.xy.y,1,-2147483648);else return!0;null!=this.vwr&&(d=this.vwr.formatText(d));c.setText(d);J.render.TextRenderer.render(null,c,this.g3d,0,b?2:1,null,this.tempXY,null,c.bgcolix,15,e);return!0});h(e,"fixLabel",function(a,b){return null==b||null==a?null:this.ms.isJmolDataFrame(a.mi)&&b.equals("%U")?"%W":
b},"JM.Atom,~S")})})(Clazz,Clazz.getClassName,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.newFloatArray,Clazz.declareType,Clazz.prepareFields,Clazz.superConstructor,Clazz.newByteArray,Clazz.declareInterface,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.isAB,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);
