(function(X,Y,Z,$,aa,M,H,N,P,Q,I,R,S,ba,L,D,T,K,U,ca,V,da,ea,fa,ga,ha,ia,ja,ka,y,la,ma,na,oa,pa,qa,ra,sa,ta,ua,va,wa,xa,ya,za,Aa,Ba,Ca,Da,Ea,Fa,Ga,Ha,Ia,Ja,Ka,k,W){M("JS");c$=Q(function(){this.e=this.vwr=null;this.chk=!1;this.st=null;this.slen=0;P(this,arguments)},JS,"ScriptExt");k(c$,"init",function(a){this.e=a;this.vwr=this.e.vwr;return this},"~O");k(c$,"atomExpressionAt",function(a){return this.e.atomExpressionAt(a)},"~N");k(c$,"checkLength",function(a){this.e.checkLength(a)},"~N");k(c$,"error",
function(a){this.e.error(a)},"~N");k(c$,"invArg",function(){this.e.invArg()});k(c$,"invPO",function(){this.error(23)});k(c$,"getShapeProperty",function(a,d){return this.e.getShapeProperty(a,d)},"~N,~S");k(c$,"paramAsStr",function(a){return this.e.paramAsStr(a)},"~N");k(c$,"centerParameter",function(a){return this.e.centerParameter(a,null)},"~N");k(c$,"floatParameter",function(a){return this.e.floatParameter(a)},"~N");k(c$,"getPoint3f",function(a,d){return this.e.getPoint3f(a,d)},"~N,~B");k(c$,"intParameter",
function(a){return this.e.intParameter(a)},"~N");k(c$,"isFloatParameter",function(a){switch(this.e.tokAt(a)){case 2:case 3:return!0}return!1},"~N");k(c$,"setShapeProperty",function(a,d,b){this.e.setShapeProperty(a,d,b)},"~N,~S,~O");k(c$,"showString",function(a){this.e.showString(a)},"~S");k(c$,"stringParameter",function(a){return this.e.stringParameter(a)},"~N");k(c$,"getToken",function(a){return this.e.getToken(a)},"~N");k(c$,"tokAt",function(a){return this.e.tokAt(a)},"~N");k(c$,"setShapeId",function(a,
d,b){b&&this.invArg();d=this.e.setShapeNameParameter(d).toLowerCase();this.setShapeProperty(a,"thisID",d);return d},"~N,~N,~B");k(c$,"getColorTrans",function(a,d,b,c){b=3.4028235E38;1765808134!=a.theTok&&--d;switch(this.tokAt(d+1)){case 603979967:d++;b=this.isFloatParameter(d+1)?a.getTranslucentLevel(++d):this.vwr.getFloat(570425354);break;case 1073742074:d++,b=0}a.isColorParam(d+1)?c[0]=a.getArgbParam(++d):1073742333==this.tokAt(d+1)?(c[0]=0,a.iToken=d+1):3.4028235E38==b?this.invArg():c[0]=-2147483648;
return b},"JS.ScriptEval,~N,~B,~A");k(c$,"finalizeObject",function(a,d,b,c,e,g,f,j){e&&this.setShapeProperty(a,"set",g);-2147483648!=d&&this.e.setShapePropertyBs(a,"color",Integer.$valueOf(d),j);3.4028235E38!=b&&this.e.setShapeTranslucency(a,"","translucent",b,j);0!=c&&this.setShapeProperty(a,"scale",Integer.$valueOf(c));0<f&&(this.e.setMeshDisplayProperty(a,f,0)||this.invArg())},"~N,~N,~N,~N,~B,~O,~N,JU.BS");M("JS");N(["JS.ScriptExt"],"JS.CmdExt","java.lang.Boolean $.Float $.Long java.util.Hashtable JU.AU $.BS $.Base64 $.Lst $.M3 $.M4 $.Measure $.P3 $.P4 $.PT $.Quat $.SB $.V3 J.api.Interface J.atomdata.RadiusData J.c.STER $.VDW J.i18n.GT JM.Atom $.AtomCollection $.BondSet $.LabelToken JS.SV $.ScriptCompiler $.ScriptError $.ScriptEval $.ScriptInterruption $.ScriptMathProcessor $.ScriptParam $.T JU.BSUtil $.BoxInfo $.C $.Edge $.Elements $.Escape $.Logger $.Parser $.Point3fi JV.FileManager $.JC $.StateManager $.Viewer".split(" "),
function(){c$=U(JS,"CmdExt",JS.ScriptExt);S(c$,function(){V(this,JS.CmdExt,[])});W(c$,"dispatch",function(a,d,b){this.chk=this.e.chk;this.slen=this.e.slen;this.st=b;switch(a){case 1073741866:b[0].value=this.prepareBinaryOutput(b[0]);break;case 4098:this.assign();break;case 134221829:this.cache();break;case 4102:this.calculate();break;case 4103:this.capture();break;case 4105:this.centerAt();break;case 134221831:this.compare();break;case 528395:this.console();break;case 4106:this.connect(1);break;case 1094717448:this.configuration();
break;case 134221834:this.data();break;case 1613238294:this.connect(0);break;case 4120:this.image();break;case 4124:this.macro();break;case 4125:this.mapProperty();break;case 4126:this.minimize();break;case 1275072532:this.modulation();break;case 4130:this.mutate();break;case 4131:this.navigate();break;case 4133:case 134221850:case 4138:this.plot(b);break;case 134222350:this.show();break;case 528443:this.stereo();break;case 1747587102:this.unitcell(d?2:1);break;case 134221856:return this.write(d?
b:null);case 6:this.measure();break;case 21:this.polyhedra();break;case 20:this.ellipsoid();break;case 4:this.struts()}return null},"~N,~B,~A");k(c$,"macro",function(){var a=this.e.optParameterAsString(1);if(0!=a.length&&!this.chk){var d=JV.JC.getMacro(a);null==d?this.showString("macro "+a+" could not be found. Current macros include:\n"+JV.JC.getMacroList()):(this.showString("running "+d),this.e.cmdScript(4124,d,null))}});k(c$,"evalParallel",function(a,d){this.chk=this.e.chk;this.slen=this.e.slen;
var b=(new JS.ScriptEval).setViewer(this.vwr);b.historyDisabled=!0;b.compiler=new JS.ScriptCompiler(this.vwr);b.sm=d;try{b.restoreScriptContext(a,!0,!1,!1),b.allowJSThreads=!1,b.dispatchCommands(!1,!1,!1)}catch(c){if(L(c,Exception))return this.e.vwr.setStringProperty("_errormessage",""+c),null==b.thisContext&&(JU.Logger.error("Error evaluating context "+c),this.vwr.isJS||c.printStackTrace()),!1;throw c;}return!0},"JS.ScriptContext,JV.ShapeManager");k(c$,"getBitsetIdent",function(a,d,b,c,e,g){var f=
!H(b,JM.BondSet);f&&(null==d?d=this.vwr.getStandardLabelFormat(0):0==d.length&&(d="%[label]"));var j=null==d?-1:d.indexOf("%"),h=2147483647!=e;if(null==a||this.chk||f&&0>j)return null==d&&(d=""),g?y(-1,[d]):d;var j=this.vwr.ms,q=0,m=j.getLabeler();b=f||!c?null:b.associatedAtoms;null==b&&(null!=d&&0<d.indexOf("%D"))&&(b=this.vwr.ms.getAtomIndices(a));c=null==d||0==d.length;var l=f||c?null:JM.LabelToken.getBondLabelValues();d=c?null:f?m.compile(this.vwr,d,"\x00",null):m.compile(this.vwr,d,"\u0001",
l);var k=h?1:JU.BSUtil.cardinalityOf(a),p=Array(k),A=new JU.P3;for(e=h?e:a.nextSetBit(0);0<=e;e=a.nextSetBit(e+1)){var s;f?s=c?j.at[e].getInfo():m.formatLabelAtomArray(this.vwr,j.at[e],d,"\x00",b,A):(s=j.bo[e],s=c?s.getIdentity():m.formatLabelBond(this.vwr,s,d,l,b,A));s=JU.PT.formatStringI(s,"#",q+1);p[q++]=s;if(h)break}return 1==k&&!g?p[0]:p},"JU.BS,~S,~O,~B,~N,~B");k(c$,"getLoadSymmetryParams",function(a,d,b){var c=this.e;this.chk=c.chk;this.slen=c.slen;var e=null,g=this.tokAt(a);if(1073742332==
g||8==g)e=this.getPoint3f(a,!1),a=c.iToken+1,g=this.tokAt(a);switch(g){case 1073741938:case 1073742080:case 1094713350:case 1073742163:case 1073742114:case 1073742152:case 1747587102:null==e&&(e=JU.P3.new3(555,555,-1)),c.iToken=a-1}g=null;if(null!=e){b.put("lattice",e);a=c.iToken+1;d.append(" {"+I(e.x)+" "+I(e.y)+" "+I(e.z)+"}");a=this.checkPacked(a,b,d);1094713350==this.tokAt(a)&&(b.put("centroid",Boolean.TRUE),d.append(" CENTROID"),a=this.checkPacked(++a,b,d));if(1073742163==this.tokAt(a)){var f;
d.append(" SUPERCELL ");if(c.isPoint3f(++a)){f=this.getPoint3f(a,!1);if(f.x!=I(f.x)||f.y!=I(f.y)||f.z!=I(f.z)||1>f.x||1>f.y||1>f.z)c.iToken=a,this.invArg();a=c.iToken}else f=this.stringParameter(a);d.append(JU.Escape.e(f));b.put("supercell",f);a=this.checkPacked(++a,b,d)}f=0;1073742114==this.tokAt(a)&&(a++,f=this.floatParameter(a++),d.append(" range "+f));b.put("symmetryRange",Float.$valueOf(f));f=null;f=-2147483648;1073742152==this.tokAt(a)&&(++a,f=JU.PT.rep(this.paramAsStr(a++),"''",'"'),d.append(" spacegroup "+
JU.PT.esc(f)),f.equalsIgnoreCase("ignoreOperators")?f=-999:(0==f.length?(e=this.vwr.getCurrentUnitCell(),null!=e&&(f=e.getSpaceGroupName())):0<=f.indexOf(",")&&9>e.x&&(9>e.y&&0==e.z)&&(f+="#doNormalize=0"),b.put("spaceGroupName",f),f=-2));var j=null;if(1747587102==this.tokAt(a)){++a;0==c.optParameterAsString(a).length?(e=this.vwr.getCurrentUnitCell(),null!=e&&(j=e.getUnitCellAsArray(!0),g=e.getCartesianOffset())):j=c.floatParameterSet(a,6,9);(null==j||6!=j.length&&9!=j.length)&&this.invArg();d.append(" unitcell {");
for(a=0;a<j.length;a++)d.append((0==a?"":" ")+j[a]);d.append("}");b.put("unitcell",j);-2147483648==f&&(f=-1);a=c.iToken+1}-2147483648!=f&&b.put("spaceGroupIndex",Integer.$valueOf(f))}null!=g?c.coordinatesAreFractional=!1:1073742066==this.tokAt(a)&&(g=this.getPoint3f(++a,!0));null!=g&&(c.coordinatesAreFractional?(g.setT(c.fractionalPoint),b.put("unitCellOffsetFractional",c.coordinatesAreFractional?Boolean.TRUE:Boolean.FALSE),d.append(" offset {"+g.x+" "+g.y+" "+g.z+"/1}")):d.append(" offset "+JU.Escape.eP(g)),
b.put("unitCellOffset",g),a=c.iToken+1);return a},"~N,JU.SB,java.util.Map");k(c$,"checkPacked",function(a,d,b){switch(this.tokAt(a)){case 1073741938:d.put("packed",Boolean.TRUE);var c=null,e=this.tokAt(++a);switch(e){case 1747587102:case 1678381065:break;default:this.e.isArrayParameter(a)?(c=this.e.getPointArray(a,-1,!1),a=this.e.iToken):this.isFloatParameter(a)?(c=this.floatParameter(a),c=y(-1,[new JU.P3,JU.P3.new3(c,c,c)])):(c=[],--a)}a++;if(this.e.chk)break;switch(e){case 1747587102:if(c=this.vwr.getCurrentUnitCell(),
null!=c){c=JU.BoxInfo.getUnitCellPoints(c.getUnitCellVerticesNoOffset(),c.getCartesianOffset());break}case 1678381065:c=JU.BoxInfo.getUnitCellPoints(this.vwr.ms.getBBoxVertices(),null)}switch(c.length){case 2:e=c[1];c=y(-1,[c[0],JU.P3.newP(c[0]),new JU.P3,new JU.P3]);c[1].x=e.x;c[2].y=e.y;c[3].z=e.z;break;case 3:c=y(-1,[new JU.P3,c[0],c[1],c[2]]);break;case 4:break;default:c=y(-1,[new JU.P3,JU.P3.new3(10,0,0),JU.P3.new3(0,10,0),JU.P3.new3(0,0,10)])}d.put("fillRange",c);b.append(" FILL ["+c[0]+c[1]+
c[2]+c[3]+"]");break;case 1073742080:c=NaN,this.isFloatParameter(++a)&&(c=this.floatParameter(a++)),this.e.chk||(d.put("packed",Boolean.TRUE),b.append(" PACKED"),Float.isNaN(c)||(d.put("packingError",Float.$valueOf(c)),b.append(" "+c)))}return a},"~N,java.util.Map,JU.SB");k(c$,"cache",function(){var a=this.tokAt(1),d=null,b=2;switch(a){case 1275069441:case 1073742119:d=this.e.optParameterAsString(b++);case 1073741882:this.checkLength(b);this.chk||("all".equals(d)&&(d=null),d=this.vwr.cacheFileByName(d,
1275069441==a),this.showString(0>d?"cache cleared":d+" bytes "+(1275069441==a?" cached":" removed")));break;default:this.invArg()}});k(c$,"calculate",function(){var a=!1,d=!1,b=null,c=null,e=this.e,g=-2147483648;if(2<=(e.iToken=e.slen))switch(e.clearDefinedVariableAtomSets(),this.getToken(1).tok){case 1073741824:this.checkLength(2);break;case 1631586315:this.checkLength(2);if(this.chk)return;g=this.vwr.calculateFormalCharges(null);this.showString(J.i18n.GT.i(J.i18n.GT._("{0} charges modified"),g));
return;case 1075838996:this.checkLength(2);this.chk||this.vwr.ms.assignAromaticBondsBs(!0,null);return;case 1613238294:2!=e.slen&&(b=(d=1639976963==this.tokAt(++e.iToken))?this.vwr.bsA():this.atomExpressionAt(e.iToken),!d&&1639976963!=this.tokAt(++e.iToken)&&(c=this.atomExpressionAt(e.iToken)));if(this.chk)return;g=this.vwr.autoHbond(b,c,!1);-2147483648!=g&&e.report(J.i18n.GT.i(J.i18n.GT._("{0} hydrogen bonds"),Math.abs(g)));return;case 1612709900:(a=1073742335==this.tokAt(2))&&e.iToken++;b=this.slen==
(a?3:2)?null:this.atomExpressionAt(a?3:2);e.checkLast(e.iToken);this.chk||(this.vwr.addHydrogens(b,!1,!1),a&&(null==b&&(b=this.vwr.bsA()),this.vwr.makeConnections(0.1,1E8,515,1073742025,b,b,null,!1,!1,0),this.vwr.ms.assignAromaticBondsBs(!0,null)));return;case 1111492619:e.iToken=1;b=2==this.slen?null:this.atomExpressionAt(2);e.checkLast(e.iToken);if(!this.chk)try{this.vwr.calculatePartialCharges(b)}catch(f){if(L(f,JV.JmolAsyncException))e.loadFileResourceAsync(f.getFileName());else throw f;}return;
case 1088421903:case 1073742102:this.chk||(1275203608==e.tokAt(2)?this.showString(this.getShapePropertyIndex(21,"symmetry",0)):this.showString(this.vwr.ms.calculatePointGroup(this.vwr.bsA())));return;case 1111490574:this.checkLength(2);this.chk||(this.vwr.calculateStraightness(),this.vwr.addStateScript("set quaternionFrame '"+this.vwr.getQuaternionFrame()+"'; calculate straightness",!1,!0));return;case 1639976963:b=4>this.slen?null:this.atomExpressionAt(2);switch(this.tokAt(++e.iToken)){case 4138:break;
case 1073741916:if(this.chk)return;e.showString(this.vwr.getAnnotationParser(!0).calculateDSSRStructure(this.vwr,b));return;case 1073741915:d=!0;break;case 0:d=this.vwr.getBoolean(603979826);break;default:this.invArg()}this.chk||this.showString(this.vwr.calculateStructures(b,d,!0));return;case 659482:b=e.iToken+1<this.slen?this.atomExpressionAt(++e.iToken):null;c=e.iToken+1<this.slen?this.atomExpressionAt(++e.iToken):null;this.checkLength(++e.iToken);this.chk||(g=this.vwr.calculateStruts(b,c),0<g&&
(this.setShapeProperty(1,"type",Integer.$valueOf(32768)),e.setShapePropertyBs(1,"color",Integer.$valueOf(16777215),null),e.setShapeTranslucency(1,"","translucent",0.5,null),this.setShapeProperty(1,"type",Integer.$valueOf(1023))),this.showString(J.i18n.GT.i(J.i18n.GT._("{0} struts added"),g)));return;case 2097180:a=!0;case 1111490575:d=!1;switch(this.tokAt(2)){case 134217759:e.iToken++;break;case 0:d=!a;break;case 1073741952:d=!0;e.iToken++;break;default:d=!0}b=e.iToken+1<this.slen?this.atomExpressionAt(++e.iToken):
this.vwr.bsA();this.checkLength(++e.iToken);this.chk||this.vwr.calculateSurface(b,d?3.4028235E38:-1);return}e.errorStr2(53,"CALCULATE","aromatic? hbonds? hydrogen? formalCharge? partialCharge? pointgroup? straightness? structure? struts? surfaceDistance FROM? surfaceDistance WITHIN?")});k(c$,"capture",function(){if(!this.chk&&!this.vwr.allowCapture())this.showString("Cannot capture on this platform");else{var a=this.vwr.captureParams,d=null==a?"GIF":a.get("type"),b=0,c=0,e=this.e.slen,g="",f=1073742070!=
this.vwr.am.animationReplayMode,j=1,h=this.tokAt(j),q=603979967==h;q&&(h=this.tokAt(++j));switch(0==h?h=102409:h){case 4:g=this.e.optParameterAsString(j++);if(0==g.length){c=102409;break}d=g.toLowerCase();d.endsWith(".gift")||d.endsWith(".pngt")?(q=!0,g=g.substring(0,g.length-1),d=g.toLowerCase()):!d.endsWith(".gif")&&!d.contains(".png")&&(g+=".gif");d.endsWith(".png")?(d.endsWith("0.png")||(g=g.substring(0,g.length-4)+"0000.png"),d="PNG"):d="GIF";q&&(d+="T");a=g.indexOf("0000.");h=0>a||a!=g.lastIndexOf(".")-
4;a=!1;528411==this.tokAt(j)&&(f=!0,this.tokAt(++j));switch(this.tokAt(j)){case 1073742129:a=!0;case 1611141175:b=null;f="y";j++;a?(j<e&&2!=this.tokAt(j)&&(f=this.e.optParameterAsString(j++).toLowerCase()),b=JU.PT.rep("rotate Y 10 10;rotate Y -10 -10;rotate Y -10 -10;rotate Y 10 10","10",""+(j<e?this.intParameter(j++):5))):(j<e&&(f=this.e.optParameterAsString(j++).toLowerCase()),b="rotate Y 360 30;");if(this.chk)return;this.vwr.setNavigationMode(!1);if(""===f||0>"xyz".indexOf(f))f="y";e=this.vwr.g.waitForMoveTo;
b="set waitformoveto true;"+JU.PT.rep(b,"Y",f)+";set waitformoveto "+e;b="capture "+(q?"transparent ":"")+JU.PT.esc(g)+" LOOP;"+b+";capture end;";this.e.cmdScript(0,null,b);return;case 3:case 2:b=this.floatParameter(j++)}if(this.chk)return;c=1073742032;a=new java.util.Hashtable;q=this.vwr.getInt(553648132);h&&(a.put("streaming",Boolean.TRUE),f||this.showString(J.i18n.GT.o(J.i18n.GT._("Note: Enable looping using {0}"),y(-1,["ANIMATION MODE LOOP"]))),this.showString(J.i18n.GT.o(J.i18n.GT._("Animation delay based on: {0}"),
y(-1,["ANIMATION FPS "+q]))));a.put("captureFps",Integer.$valueOf(q));break;case 102409:case 1073741874:null!=a&&a.put("captureSilent",Boolean.TRUE);case 1073742335:case 1073742334:this.checkLength(-2);c=h;break;default:this.invArg()}this.chk||null==a||(a.put("type",d),q=Integer.$valueOf(this.vwr.getBackgroundArgb()),a.put("backgroundColor",q),a.put("fileName",g),a.put("quality",Integer.$valueOf(-1)),a.put("endTime",Long.$valueOf(0>=b?-1:System.currentTimeMillis()+R(1E3*b))),a.put("captureMode",JS.T.nameOf(c).toLowerCase()),
a.put("captureLooping",f?Boolean.TRUE:Boolean.FALSE),g=this.vwr.processWriteOrCapture(a),null==g&&(g="canceled"),JU.Logger.info(g))}});k(c$,"centerAt",function(){var a=this.getToken(1).tok;switch(a){case 1073741826:case 96:case 1678381065:break;default:this.invArg()}var d=JU.P3.new3(0,0,0);5==this.slen?(d.x=this.floatParameter(2),d.y=this.floatParameter(3),d.z=this.floatParameter(4)):this.e.isCenterParameter(2)?(d=this.centerParameter(2),this.e.checkLast(this.e.iToken)):this.checkLength(2);!this.chk&&
!this.vwr.isJmolDataFrame()&&this.vwr.tm.setCenterAt(a,d)});k(c$,"compare",function(){var a=this.e,d=!1,b=!1,c=!1,e=!1,g=!1,f=null,j=null,h=null,q=null,m=null,l=null;a.iToken=0;var k=this.isFloatParameter(1)?this.floatParameter(++a.iToken):NaN,p=this.atomExpressionAt(++a.iToken),A=null,s=null;a.isArrayParameter(++a.iToken)?A=a.getPointArray(a.iToken,-1,!1):1140850689!=this.tokAt(a.iToken)&&(s=this.atomExpressionAt(a.iToken));var z=null,v=!1,x=null,w=JU.BSUtil.copy(p);null!=s&&w.or(s);for(var w=e=
null==A&&null!=s&&w.equals(p),r=a.iToken+1;r<this.slen;++r)switch(this.getToken(r).tok){case 4115:w=!0;break;case 134218757:if(v=!0,4!=this.tokAt(r+1)){x="*";break}case 134218756:x=this.stringParameter(++r);break;case 1677721602:b=g=!0;x=this.paramAsStr(++r);x.equalsIgnoreCase("SMILES")&&(v=!0,x="*");break;case 3:case 2:k=Math.abs(this.floatParameter(r));break;case 268435504:break;case 2109448:z=this.atomExpressionAt(++r);r=a.iToken;break;case 10:case 1073742325:null!=l&&this.invArg();var h=this.atomExpressionAt(a.iToken),
C=e?0:this.tokAt(a.iToken+1),q=null==A&&a.isArrayParameter(a.iToken+1)?null:10==C||1073742325==C?this.atomExpressionAt(++a.iToken):JU.BSUtil.copy(h);null!=z&&(h.and(z),null!=q&&q.and(z));null==q?A=a.getPointArray(++a.iToken,-1,!1):q.and(s);null==m&&(m=new JU.Lst);m.addLast(y(-1,[h,q]));r=a.iToken;break;case 7:null!=m&&this.invArg();d=!0;f=a.getQuaternionArray(a.theToken.getList(),1073742001);this.getToken(++r);j=a.getQuaternionArray(a.theToken.getList(),1073742001);null==l&&(l=new JU.Lst);l.addLast(y(-1,
[f,j]));break;case 1073742077:d=!0;break;case 134217751:case 1140850689:d=!1;break;case 528432:b=!0;break;case 4160:c=!0;break;default:this.invArg()}if(!this.chk){w&&(k=0);Float.isNaN(k)||0>k?k=1:!b&&!c&&(b=c=!0);e=0!=k;(C=!d&&null==x||null!=A)&&J.api.Interface.getInterface("JU.Eigen",this.vwr,"script");null==m&&null==l&&(null==z?(h=C?this.vwr.getAtomBitSet("spine"):new JU.BS,0>h.nextSetBit(0)?(h=p,q=s):(q=JU.BSUtil.copy(h),h.and(p),q.and(s))):(h=JU.BSUtil.copy(p),q=JU.BSUtil.copy(s),h.and(z),q.and(z),
h.and(p),q.and(s)),m=new JU.Lst,m.addLast(y(-1,[h,q])));if(w){p=this.vwr.ms.getModelBS(p,!1);z=Array(p.cardinality());r=0;for(q=p.nextSetBit(0);0<=q;q=p.nextSetBit(q+1),r++)z[r]=this.vwr.getModelUndeletedAtomsBitSet(q)}else z=y(-1,[p]);for(q=0;q<z.length;q++){for(var p=z[q],u=K(2,0),n=null,t=new JU.Lst,B=null,F=w?new JU.Lst:m,r=0;r<m.size();++r){var G=m.get(r);w&&F.addLast(G=y(-1,[JU.BSUtil.copy(G[0]),G[1]]));G[0].and(p)}var E=null,D=null;if(C){null!=A&&(F.clear(),F.addLast(y(-1,[h,A])));try{B=this.vwr.getCenterAndPoints(F,
!0)}catch(I){if(L(I,Exception))this.invArg();else throw I;}n=B[0].length-1;for(r=1;r<=n;r++){t=B[0][r];G=B[1][r];if(!H(t,JM.Atom)||!H(G,JM.Atom))break;JU.Logger.info(" atom 1 "+t.getInfo()+"\tatom 2 "+G.getInfo())}n=JU.Measure.calculateQuaternionRotation(B,u);r=Float.isNaN(u[1])?NaN:Math.round(100*u[0])/100;u=Float.isNaN(u[1])?NaN:Math.round(100*u[1])/100;this.showString("RMSD "+r+" --\x3e "+u+" Angstroms")}else if(d){if(null==l)for(r=0;r<F.size();r++){G=F.get(r);f=this.vwr.getAtomGroupQuaternions(G[0],
2147483647);j=this.vwr.getAtomGroupQuaternions(G[1],2147483647);for(n=0;n<f.length&&n<j.length;n++)t.addLast(j[n].div(f[n]))}else for(n=0;n<f.length&&n<j.length;n++)t.addLast(j[n].div(f[n]));u[0]=0;f=t.toArray(Array(t.size()));n=JU.Quat.sphereMean(f,u,1E-4);this.showString("RMSD = "+u[0]+" degrees")}else{r=new JU.M4;E=new JU.P3;if(("*".equals(x)||"".equals(x))&&null!=p)try{x=this.vwr.getSmiles(p)}catch(O){if(L(O,Exception))a.evalError(O.getMessage(),null);else throw O;}if(g){var M;if(null==p||null==
s||null==(M=a.getSmilesExt().getFlexFitList(p,s,x,!v)))break;this.vwr.setDihedrals(M,null,1)}u=a.getSmilesExt().getSmilesCorrelation(p,s,x,null,null,r,null,!1,null,E,!1,v?1:2);System.out.println("compare:\n"+r);if(Float.isNaN(u)){this.showString("structures do not match");break}c&&(D=new JU.V3,r.getTranslation(D));b&&(n=new JU.M3,r.getRotationScale(n),n=JU.Quat.newM(n));this.showString("RMSD = "+u+" Angstroms")}null!=B&&(E=B[0][0]);null==E&&(B=this.vwr.getCenterAndPoints(F,!0),E=B[0][0]);F=new JU.P3;
u=NaN;c&&(null==D&&(D=JU.V3.newVsub(B[1][0],E)),u=1E10);b&&(null==n&&a.evalError("option not implemented",null),F.add2(E,n.getNormal()),u=n.getTheta(),0==u&&c&&(0.01<D.length()?u=1E10:b=c=e=!1));if(!Float.isNaN(u)&&!Float.isNaN(F.x)&&(B=null,b&&(c&&0!=k)&&(B=this.vwr.ms.getAtomPointVector(p),r=JS.ScriptMathProcessor.getMatrix4f(n.getMatrix(),D),B=JU.Measure.transformPoints(B,r,E)),a.useThreads()||(e=!1),this.vwr.rotateAboutPointsInternal(a,E,F,u/k,u,e,p,D,B,null,null)&&e&&a.isJS))throw new JS.ScriptInterruption(a,
"compare",1);}}});k(c$,"configuration",function(){var a=null,d=this.vwr.bsA();if(1==this.slen){if(this.chk)return;a=this.vwr.ms.setConformation(d);this.vwr.ms.addStateScript("select",null,d,null,"configuration",!0,!1)}else if(this.isFloatParameter(1)){d=this.intParameter(this.e.checkLast(1));if(this.chk)return;a=this.vwr.ms.getConformation(this.vwr.am.cmi,d-1,!0,null);this.vwr.addStateScript("configuration "+d+";",!0,!1)}else{a=this.atomExpressionAt(1);if(this.chk)return;d=this.intParameter(this.e.checkLast(this.e.iToken+
1));this.vwr.addStateScript("configuration "+JU.Escape.eBS(a)+" "+d+";",!0,!1);a=this.vwr.ms.getConformation(this.vwr.am.cmi,d-1,!0,a)}this.setShapeProperty(1,"type",Integer.$valueOf(30720));this.e.setShapeSizeBs(1,0,a);this.vwr.autoHbond(a,a,!0);this.vwr.select(a,!1,0,this.e.tQuiet)});k(c$,"measure",function(){var a=this.e,d=null,b=0,c=null;if(2==this.slen)switch(this.tokAt(1)){case 1073742334:this.setShapeProperty(6,"hideAll",Boolean.TRUE);return;case 12291:this.chk||this.vwr.clearAllMeasurements();
return}this.vwr.shm.loadShape(6);switch(this.tokAt(1)){case 134218756:var e=this.stringParameter(3==this.slen?2:4);if(this.chk)return;var g=this.vwr.ms.at,d=this.vwr.ms.ac,b=null;try{b=this.vwr.getSmilesMatcher().getCorrelationMaps(e,g,d,this.vwr.bsA(),2)}catch(f){if(L(f,Exception))a.evalError(f.getMessage(),null);else throw f;}if(null==b)return;this.setShapeProperty(6,"maps",b);return}switch(this.slen){case 2:switch(this.getToken(1).tok){case 0:case 1073742335:this.vwr.shm.loadShape(6);this.setShapeProperty(6,
"hideAll",Boolean.FALSE);return;case 1073742001:this.chk||a.showStringPrint(this.vwr.getMeasurementInfoAsString(),!1);return;case 4:this.setShapeProperty(6,"setFormats",this.stringParameter(1));return}a.errorStr(24,"ON, OFF, DELETE");break;case 3:switch(this.getToken(1).tok){case 12291:if(1073742327==this.getToken(2).tok)this.chk||this.vwr.clearAllMeasurements();else{var j=this.intParameter(2)-1;this.chk||this.vwr.deleteMeasurement(j)}return}}for(var h=0,q=0,m=-1,l=-1,k=-1,p=D(5,0),A=K(-1,[3.4028235E38,
3.4028235E38]),s=!1,z=!1,v=!1,x=!0,w=null,r=null,e=268435538,y=g=null,u=new JU.Lst,n=new JU.BS,t=null,B=null,F=0,G=0,j=1;j<this.slen;++j)switch(this.getToken(j).tok){case 1073741974:1!=j&&this.invArg();d=a.optParameterAsString(++j);continue;case 1073741824:a.errorStr(24,"ALL, ALLCONNECTED, DELETE");break;default:this.error(15);break;case 268435568:134217736!=this.tokAt(j+1)&&this.invArg();j++;v=!0;break;case 134217736:case 1073741834:case 1073742327:z=1073741834==a.theTok;l=-1;s=!0;z&&v&&this.invArg();
break;case 1765808134:b=JU.C.getColix(a.getArgbParam(++j));j=a.iToken;break;case 1073742066:a.isPoint3f(++j)?(c=this.getPoint3f(j,!1),c=K(-1,[1,c.x,c.y,c.z,0,0,0])):c=a.floatParameterSet(j,7,7);j=a.iToken;break;case 1665140738:case 1073741917:G=I((1665140738==a.theTok?2E3:1E3)*this.floatParameter(++j));null!=d&&0>=G&&(G=-1);break;case 3:null!=w&&this.invArg();x=s=!0;k=(k+1)%2;A[k]=this.floatParameter(j);break;case 12291:268435538!=e&&this.invArg();e=12291;break;case 4114:var E=this.floatParameter(++j),
M=this.paramAsStr(++j),N=this.paramAsStr(++j);this.chk||(y=this.vwr.getFont3D(M,N,E));break;case 2:E=this.intParameter(j);if(s)x=!0,k=(k+1)%2,A[k]=E;else{l=this.vwr.ms.getFirstAtomIndexFromAtomNumber(E,this.vwr.getVisibleFramesBitSet());if(!this.chk&&0>l)return;null!=t&&this.invArg();4<(p[0]=++h)&&a.bad();p[h]=l}break;case 1094713359:m=this.intParameter(++j);break;case 1073742334:268435538!=e&&this.invArg();e=1073742334;break;case 1073742335:268435538!=e&&this.invArg();e=1073742335;break;case 1073742114:x=
s=!0;l=-1;break;case 1073741989:case 1073741990:r=Boolean.$valueOf(1073741989==a.theTok);s=!0;v=1073741990==a.theTok;break;case 1648363544:0<=k&&this.invArg();w=a.encodeRadiusParameter(j,!1,!0);if(null==w)return;w.values=A;j=a.iToken;s=v=!0;r=Boolean.$valueOf(!1);1==F&&(F++,h++,E=JU.BSUtil.copy(n),JU.BSUtil.invertInPlace(E,this.vwr.ms.ac),E.and(this.vwr.ms.getAtomsWithinRadius(5,n,!1,null)),u.addLast(E));break;case 10:case 1073742325:case 1073742332:case 8:case 1073742330:(10==a.theTok||1073742325==
a.theTok)&&F++;0<=l&&this.invArg();h=Array(1);t=a.centerParameter(j,h);if(H(h[0],JU.BS)&&(t=n=h[0],!this.chk&&0==n.length()))return;H(t,JU.P3)&&(j=new JU.Point3fi,j.setT(t),j.mi=m,t=j);4<(h=++q)&&a.bad();j=a.iToken;u.addLast(t);break;case 4:g=this.stringParameter(j);break;case 1073742164:B=a.tickParamAsStr(j,!1,!0,!0),j=a.iToken,e=12290}(null!=w&&(0<=k||2!=h)||2>h&&null==d&&(null==B||1==h))&&a.bad();null!=g&&0!=g.indexOf(h+":")&&(g=h+":"+g);x&&A[1]<A[0]&&(A[1]=A[0],A[0]=3.4028235E38==A[1]?3.4028235E38:
-200);if(!this.chk)if(null!=t||null!=B)null==w&&(w=new J.atomdata.RadiusData(A,0,null,null)),null==t&&(B.id="default"),null!=t&&(null!=g&&268435538==e)&&(e=12290),a=null,null!=y&&(a=J.api.Interface.getInterface("JM.Text",this.vwr,"script").newLabel(this.vwr,y,"",b,0,0,0)),null!=a&&(a.pymolOffset=c),this.setShapeProperty(6,"measure",this.vwr.newMeasurementData(d,u).set(e,null,w,g,null,B,z,v,r,s,G,b,a));else switch(a=null==d?p:d,e){case 12291:this.setShapeProperty(6,"delete",a);break;case 1073742335:this.setShapeProperty(6,
"show",a);break;case 1073742334:this.setShapeProperty(6,"hide",a);break;default:this.setShapeProperty(6,null==g?"toggle":"toggleOn",a),null!=g&&this.setShapeProperty(6,"setFormats",g)}});k(c$,"connect",function(a){var d=this.e,b=K(2,0),c=Array(2);c[0]=c[1]=this.vwr.bsA();var e=NaN,g=D(-1,[-2147483648]),f=0,j=131071,h=1073742026,q=!1,m=!1,l=!1,k=3.4028235E38,p=!1,A=0,s=0,z=new JU.BS,v=!1,x=0,w=0,r=0,C=!1;if(1==this.slen)this.chk||this.vwr.rebondState(d.$isStateScript);else{for(;a<this.slen;++a){switch(this.getToken(a).tok){case 1073742335:case 1073742334:this.checkLength(2);
this.chk||this.vwr.rebondState(d.$isStateScript);return;case 2:case 3:if(0<A){(m||p)&&d.error(23);j=JU.Edge.getBondOrderFromFloat(this.floatParameter(a));131071==j&&this.invArg();m=!0;break}2<++s&&d.bad();var u=this.floatParameter(a);268435634==this.tokAt(a+1)&&(u=-u/100,a++);b[f++]=u;break;case 10:case 1073742325:(2<A||v&&0<A)&&d.bad();(m||p)&&this.invArg();c[A++]=this.atomExpressionAt(a);v=d.isBondSet;if(2==A){for(var u=d.iToken,n=a;n<u;n++)if(1073741824==this.tokAt(n)&&this.paramAsStr(n).equals("_1")){x=
a;break}d.iToken=u}a=d.iToken;break;case 1086324742:C=!0;break;case 1765808134:case 603979967:case 1073742074:p=!0;k=this.getColorTrans(d,a,!1,g);a=d.iToken;break;case 1073742086:g=1073741852==this.tokAt(2);this.checkLength(g?3:2);if(this.chk)return;this.vwr.clearModelDependentObjects();this.vwr.ms.deleteAllBonds();e=new JU.BS;this.vwr.ms.setPdbConectBonding(0,0,e);if(g){d=d.$isStateScript&&this.vwr.getBoolean(603979873);this.vwr.ms.autoBondBs4(null,null,e,null,this.vwr.getMadBond(),d);this.vwr.addStateScript(d?
"set legacyAutoBonding TRUE;connect PDB AUTO;set legacyAutoBonding FALSE;":"connect PDB auto;",!1,!0);return}this.vwr.addStateScript("connect PDB;",!1,!0);return;case 1073741830:case 1073741852:case 1073741904:case 1073742025:case 1073742026:l=!0;++a!=this.slen&&this.invArg();h=d.theTok;1073741852==h&&!(131071==j||2048==j||515==j)&&this.invArg();break;case 659482:p||(g[0]=16777215,k=0.5,e=this.vwr.getFloat(570425406),p=!0),l||(h=1073742026),l=!0;case 1073741824:if(d.isColorParam(a)){w=-a;break}case 1075838996:case 1613238294:j=
this.paramAsStr(a);131071==(j=JS.ScriptParam.getBondOrderFromString(j))&&this.invArg();m&&d.error(18);m=!0;switch(j){case 33:switch(this.tokAt(a+1)){case 3:j=JS.ScriptParam.getPartialBondOrderFromFloatEncodedInt(this.st[++a].intValue);break;case 2:j=this.intParameter(++a)}break;case 2048:2==this.tokAt(a+1)&&(j=this.intParameter(++a)<<11,r=this.floatParameter(++a))}break;case 1665140738:e=this.floatParameter(++a);p=!0;break;case 1073742333:case 12291:++a!=this.slen&&this.invArg();h=12291;q=!0;p=!1;
break;default:w=a}0<a&&(w==-a||w==a&&d.isColorParam(a)?(p=!0,g[0]=d.getArgbParam(a),a=d.iToken):w==a&&this.invArg())}if(!this.chk){2>f&&(0==f&&(b[0]=1E8),b[1]=b[0],b[0]=0.1);p&&(m||(j=65535),l||(h=1073742025));m=f=0;if(0<x){r=new JU.BS;this.vwr.definedAtomSets.put("_1",r);C=c[0];for(l=C.nextSetBit(0);0<=l;l=C.nextSetBit(l+1))r.set(l),c=this.vwr.makeConnections(b[0],b[1],j,h,r,this.atomExpressionAt(x),z,v,!1,0),f+=Math.abs(c[0]),m+=c[1],r.clear(l)}else c=this.vwr.makeConnections(b[0],b[1],j,h,c[0],
c[1],z,v,C,r),f+=Math.abs(c[0]),m+=c[1];b=d.doReport();q?b&&d.report(J.i18n.GT.i(J.i18n.GT._("{0} connections deleted"),m)):(p&&(this.vwr.selectBonds(z),Float.isNaN(e)||d.setShapeSizeBs(1,Math.round(2E3*e),null),this.finalizeObject(1,g[0],k,0,!1,null,0,z),this.vwr.selectBonds(null)),b&&d.report(J.i18n.GT.o(J.i18n.GT._("{0} new bonds; {1} modified"),y(-1,[Integer.$valueOf(f),Integer.$valueOf(m)]))))}}},"~N");k(c$,"console",function(){switch(this.getToken(1).tok){case 1073742334:this.chk||this.vwr.showConsole(!1);
break;case 1073742335:this.chk||this.vwr.showConsole(!0);break;case 1073741882:this.chk||this.vwr.sm.clearConsole();break;case 134221856:this.showString(this.stringParameter(2));break;default:this.invArg()}});k(c$,"data",function(){var a=this.e,d=null,b=null,c=!1,e;switch(a.iToken=this.slen){case 5:d=this.paramAsStr(2);case 4:case 2:b=this.paramAsStr(1);if(b.equalsIgnoreCase("clear")){this.chk||this.vwr.setData(null,null,0,0,0,0,0);return}if(0<=(e=b.indexOf("@")))d=""+a.getParameter(b.substring(e+
1),4,!0),b=b.substring(0,e).trim();else if(null==d&&0<=(e=b.indexOf(" ")))d=b.substring(e+1).trim(),b=b.substring(0,e).trim(),c=!0;break;default:a.bad()}e=b.substring(0,(b+" ").indexOf(" ")).toLowerCase();if(e.equals("model")||e.equals("append"))a.cmdLoad();else if(!this.chk){var g=0<=b.toLowerCase().indexOf("(default)");if(e.equals("connect_atoms"))this.vwr.ms.connect(this.parseDataArray(d,!1));else if(0==e.indexOf("ligand_"))this.vwr.setLigandModel(b.substring(7).toUpperCase()+"_data",d.trim());
else if(0==e.indexOf("file_"))this.vwr.setLigandModel(b.substring(5)+"_file",d.trim());else if(a=Array(4),e.equals("element_vdw")){a[0]=e;a[1]=d.$replace(";","\n");d=JU.Elements.elementNumberMax;e=D(d+1,0);for(g=1;g<=d;g++)e[g]=g;a[2]=e;a[3]=Integer.$valueOf(0);this.vwr.setData("element_vdw",a,d,0,0,0,0)}else if(0==e.indexOf("data2d_"))a[0]=b,a[1]=this.parseDataArray(d,!1),a[3]=Integer.$valueOf(2),this.vwr.setData(b,a,0,0,0,0,0);else if(0==e.indexOf("data3d_"))a[0]=b,a[1]=this.parseDataArray(d,!0),
a[3]=Integer.$valueOf(3),this.vwr.setData(b,a,0,0,0,0,0);else{var f=JU.PT.getTokens(b);if(0==e.indexOf("property_")&&!(2==f.length&&f[1].equals("set"))){g=this.vwr.bsA();a[0]=e;var j=c?0:this.vwr.getP("propertyAtomNumberField").intValue(),h=c?0:this.vwr.getP("propertyAtomNumberColumnCount").intValue(),q=c?-2147483648:this.vwr.getP("propertyDataField").intValue(),m=c?0:this.vwr.getP("propertyDataColumnCount").intValue();!c&&0<=b.indexOf(" ")&&(3==f.length&&(j=JU.PT.parseInt(f[1]),q=JU.PT.parseInt(f[2])),
5==f.length&&(j=JU.PT.parseInt(f[1]),h=JU.PT.parseInt(f[2]),q=JU.PT.parseInt(f[3]),m=JU.PT.parseInt(f[4])));0>j&&(j=0);0>q&&(q=0);b=this.vwr.ms.ac;c=null;f=JU.BS.newN(b);if(0<j){for(var c=D(b+2,0),l=0;l<=b;l++)c[l]=-1;for(l=g.nextSetBit(0);0<=l;l=g.nextSetBit(l+1)){var k=this.vwr.ms.at[l].getAtomNumber();k>b+1||(0>k||f.get(k))||(f.set(k),c[k]=l)}a[2]=c}else a[2]=JU.BSUtil.copy(g);a[1]=d;a[3]=Integer.$valueOf(0);this.vwr.setData(e,a,b,j,h,q,m)}else"occupany".equals(e)&&(e="occupancy"),j=JM.AtomCollection.getUserSettableType(e),
-1<j?this.vwr.setAtomData(j,e,d,g):(a[0]=b,a[1]=d,a[3]=Integer.$valueOf(0),this.vwr.setData(e,a,0,0,0,0,0))}}});k(c$,"ellipsoid",function(){var a=this.e,d=0,b=1,c=3.4028235E38,e=!1,g=!1;this.setShapeProperty(20,"thisID",null);switch(this.getToken(1).tok){case 1073742335:d=2147483647;break;case 1073742334:break;case 2:d=this.intParameter(1);break;case 36867:this.e.sm.loadShape(20);this.setShapeProperty(20,"select",this.paramAsStr(2));b=a.iToken;g=e=!0;break;case 1073741974:case 268435633:case 1073741824:this.e.sm.loadShape(20);
1073741974==a.theTok&&b++;this.setShapeId(20,b,!1);b=a.iToken;e=!0;break;default:this.invArg()}if(e){for(d=D(-1,[-2147483648]);++b<this.slen;){var e=this.paramAsStr(b),f=null;this.getToken(b);if(!g)switch(a.theTok){case 1073742330:e="points";f=Array(3);f[0]=a.objectNameParameter(++b);if(this.chk)continue;a.getShapePropertyData(24,"getVertices",f);break;case 1611272194:for(var f=Array(3),j=0;3>j;j++)f[j]=new JU.V3,f[j].setT(this.centerParameter(++b)),b=a.iToken;break;case 12289:f=this.centerParameter(++b);
b=a.iToken;break;case 1094713359:f=Integer.$valueOf(this.intParameter(++b));break;case 12291:f=Boolean.TRUE,this.checkLength(b+1)}if(null==f)switch(a.theTok){case 1073742335:e="on";f=Boolean.TRUE;break;case 1073742334:e="on";f=Boolean.FALSE;break;case 1073742138:f=Float.$valueOf(this.floatParameter(++b));break;case 10:case 1073742325:e="atoms";f=this.atomExpressionAt(b);b=a.iToken;break;case 1765808134:case 603979967:case 1073742074:c=this.getColorTrans(a,b,!0,d);b=a.iToken;continue;case 1073742075:f=
this.paramAsStr(++b)}null==f&&this.invArg();this.setShapeProperty(20,e.toLowerCase(),f)}this.finalizeObject(20,d[0],c,0,!1,null,0,null);this.setShapeProperty(20,"thisID",null)}else a.setShapeSizeBs(20,d,null)});k(c$,"image",function(){this.chk||this.vwr.getConsole();var a=1,d=null;1073741974==this.tokAt(1)&&(d=this.e.optParameterAsString(++a),a++);var b=this.e.optParameterAsString(a),c=this.e.optParameterAsString(this.slen-1).equalsIgnoreCase("close");if(!c&&(this.slen==a||this.slen==a+2))b=this.slen==
a+2?this.intParameter(a++):-1,a=0>b?-1:this.intParameter(a),c=new java.util.Hashtable,c.put("fileName","\u0001\u0001"+d),c.put("backgroundColor",Integer.$valueOf(this.vwr.getBackgroundArgb())),c.put("type","png"),c.put("quality",Integer.$valueOf(-1)),c.put("width",Integer.$valueOf(b)),c.put("height",Integer.$valueOf(a)),this.chk||this.vwr.processWriteOrCapture(c);else{if(c)switch(this.slen){case 2:b="closeall";break;case 3:case 4:break;default:this.checkLength(0)}this.chk||this.vwr.fm.loadImage(c?
"\u0001close":b,"\u0001"+b+"\u0001"+("".equals(d)||null==d?null:d),!1)}});k(c$,"mapProperty",function(){for(var a,d,b,c,e,g=0,f=0,j=0,h=this.e;;){if(1113589787==this.tokAt(1))a=this.vwr.bsA(),d=this.atomExpressionAt(2),b=c="selected";else{a=this.atomExpressionAt(1);if(1073742336!=this.tokAt(++h.iToken)||!JS.T.tokAttr(g=this.tokAt(++h.iToken),1077936128))break;b=this.paramAsStr(h.iToken);d=this.atomExpressionAt(++h.iToken);if(1073742336!=this.tokAt(++h.iToken)||!JS.T.tokAttr(f=this.tokAt(++h.iToken),
2048))break;c=this.paramAsStr(h.iToken)}e=JS.T.tokAttr(j=this.tokAt(h.iToken+1),1077936128)?this.paramAsStr(++h.iToken):JS.T.nameOf(j=1094715393);h.checkLast(h.iToken);if(this.chk)return;var q=null;this.showString("mapping "+b.toUpperCase()+" for "+a.cardinality()+" atoms to "+c.toUpperCase()+" for "+d.cardinality()+" atoms using "+e.toUpperCase());if(JS.T.tokAttrOr(g,1094713344,1111490560)&&JS.T.tokAttrOr(f,1094713344,1111490560)&&JS.T.tokAttrOr(j,1094713344,1111490560)){var m=this.getBitsetPropertyFloat(a,
g|224,null,NaN,NaN),l=this.getBitsetPropertyFloat(a,j|224,null,NaN,NaN),g=this.getBitsetPropertyFloat(d,j|224,null,NaN,NaN),k=1715472409==f,p=K(k?this.vwr.ms.ac:g.length,0),q=new JU.BS;if(m.length==l.length){for(var A=new java.util.Hashtable,j=0;j<m.length;j++)A.put(Float.$valueOf(l[j]),Float.$valueOf(m[j]));m=-1;for(j=l=0;j<g.length;j++){var m=d.nextSetBit(m+1),s=A.get(Float.$valueOf(g[j]));null!=s&&(q.set(m),p[k?m:l]=s.floatValue(),l++)}k?this.vwr.setData(c,y(-1,[c,p,q,Integer.$valueOf(1),Boolean.TRUE]),
this.vwr.ms.ac,0,0,2147483647,0):this.vwr.setAtomProperty(q,f,0,0,null,p,null)}}if(null==q){b=this.getBitsetIdent(a,"{"+e+"=%["+e+"]}."+c+" = %["+b+"]",null,!1,2147483647,!1);a=new JU.SB;for(j=0;j<b.length;j++)0>b[j].indexOf("null")&&a.append(b[j]).appendC("\n");JU.Logger.debugging&&JU.Logger.debug(a.toString());b=JU.BSUtil.copy(this.vwr.slm.bsSubset);this.vwr.slm.setSelectionSubset(d);try{h.runScript(a.toString())}catch(z){if(L(z,Exception))d=z,this.vwr.slm.setSelectionSubset(b),h.errorStr(-1,"Error: "+
d.getMessage());else if(L(z,Error))d=z,this.vwr.slm.setSelectionSubset(b),h.errorStr(-1,"Error: "+d.toString());else throw z;}this.vwr.slm.setSelectionSubset(b)}this.showString("DONE");return}this.invArg()});k(c$,"minimize",function(){for(var a=null,d=2147483647,b=0,c=!1,e=!1,g=null,f=!1,j=this.vwr.getMinimizer(!1),h=1;h<this.slen;h++)switch(this.getToken(h).tok){case 1073741828:c=!0;continue;case 1073741874:case 1073742162:this.checkLength(2);if(this.chk||null==j)return;j.setProperty(this.paramAsStr(h),
null);return;case 1073741882:this.checkLength(2);if(this.chk||null==j)return;j.setProperty("clear",null);return;case 1073741894:1!=h&&this.invArg();d=a=0;b=D(5,0);if(1073741882==this.tokAt(++h))this.checkLength(3);else{for(;4>a&&!this.isFloatParameter(h);)b[++a]=this.atomExpressionAt(h).nextSetBit(0),h=this.e.iToken+1;b[0]=a;1==a&&this.invArg();d=this.floatParameter(this.e.checkLast(h))}this.chk||this.vwr.getMinimizer(!0).setProperty("constraint",y(-1,[b,D(a,0),Float.$valueOf(d)]));return;case 1073741905:b=
this.floatParameter(++h);continue;case 1073741934:d=0;continue;case 12293:1!=h&&this.invArg();g=this.atomExpressionAt(++h);0>g.nextSetBit(0)&&(g=null);h=this.e.iToken;this.chk||this.vwr.getMinimizer(!0).setProperty("fixed",g);if(h+1==this.slen)return;continue;case 10:case 1073742325:f=!0;case 1275082245:1275082245==this.e.theTok&&h++;a=this.atomExpressionAt(h);h=this.e.iToken;1073742072==this.tokAt(h+1)&&(h++,f=!0);continue;case 1073742148:e=!0;break;case 266298:d=this.intParameter(++h);continue;
default:this.invArg()}if(!this.chk)try{this.vwr.minimize(this.e,d,b,a,g,0,c,f,e,!1)}catch(q){if(L(q,Exception))throw new JS.ScriptInterruption(this.e,"minimize",1);throw q;}});k(c$,"modulation",function(){var a=null,d=this.e,b=!0,c=!1,e=null,g=1;switch(this.getToken(g).tok){case 1073742334:b=!1;case 0:case 1073742335:break;case 10:case 1073742325:e=this.atomExpressionAt(1);switch(this.tokAt(d.iToken+1)){case 1073742334:b=!1;case 1073742335:d.iToken++}d.checkLast(d.iToken);break;case 1073742332:case 8:a=
d.getPoint3f(1,!1);c=1073742335==this.tokAt(d.iToken+1);break;default:var f=d.theToken.value.toString();g++;f.equalsIgnoreCase("t")?d.theTok=3:f.equalsIgnoreCase("m")||f.equalsIgnoreCase("q")?d.theTok=2:this.invArg();case 3:case 2:switch(d.theTok){case 3:this.isFloatParameter(g)?(a=this.floatParameter(g),a=JU.P3.new3(a,a,a)):a=d.getPoint3f(g,!1);break;case 2:2==this.tokAt(g)?(c=this.intParameter(g),a=JU.P3.new3(c,c,c)):a=d.getPoint3f(g,!1),c=!0}break;case 1073742138:b=this.floatParameter(2);this.chk||
this.vwr.setFloatProperty("modulationScale",b);return}this.chk||(this.vwr.tm.setVibrationPeriod(0),this.vwr.setModulation(e,b,a,c))});k(c$,"mutate",function(){var a,d;switch(this.tokAt(1)){case 2:this.st[1]=JS.T.o(4,""+this.st[1].value);default:a=this.atomExpressionAt(1);d=++this.e.iToken;break;case 268435633:a=this.vwr.getAllAtoms(),d=2}a.and(this.vwr.getModelUndeletedAtomsBitSet(this.vwr.ms.mc-1));var b=a.length()-1;if(!(0>b||this.vwr.ms.at[b].mi+1!=this.vwr.ms.mc||this.vwr.ms.isTrajectory(this.vwr.ms.at[b].mi)))if(b=
this.e.optParameterAsString(d),this.e.checkLast(d),!this.chk&&this.vwr.ms.am[this.vwr.ms.mc-1].isBioModel){var c=null;if(4==this.tokAt(d)&&!b.startsWith("~"))c=y(-1,[b]),b=null;else{b=JU.PT.replaceAllCharacters(b,",; \t\n"," ").trim().toUpperCase();if((d=b.startsWith("~"))||3!=b.length||!this.vwr.getJBR().isKnownPDBGroup(b,20))b=this.vwr.getJBR().toStdAmino3(d?b.substring(1):b);c=JU.PT.getTokens(b)}0<c.length&&this.vwr.ms.bioModelset.mutate(a,b,c)}});k(c$,"navigate",function(){var a=this.e;if(1==
this.slen)a.setBooleanProperty("navigationMode",!0);else{var d=JU.V3.new3(0,1,0),b=new JU.Lst,c;if(2==this.slen)switch(this.getToken(1).tok){case 1073742335:case 1073742334:if(this.chk)return;a.setObjectMad(34,"axes",1);this.setShapeProperty(34,"position",JU.P3.new3(50,50,3.4028235E38));a.setBooleanProperty("navigationMode",!0);this.vwr.tm.setNavOn(1073742335==a.theTok);return;case 1073742162:this.chk||this.vwr.tm.setNavXYZ(0,0,0);return;case 8:case 1112152078:break;default:this.invArg()}!this.chk&&
!this.vwr.getBoolean(603979889)&&a.setBooleanProperty("navigationMode",!0);for(var e=1;e<this.slen;e++){var g=this.isFloatParameter(e)?this.floatParameter(e++):2;0>g&&this.invArg();!this.chk&&0<g&&a.refresh(!1);switch(this.getToken(e).tok){case 8:case 1073742332:c=this.getPoint3f(e,!0);a.iToken++;a.iToken!=this.slen&&this.invArg();this.chk||this.vwr.tm.setNavXYZ(c.x,c.y,c.z);return;case 554176526:c=this.floatParameter(++e);this.chk||b.addLast(y(-1,[Integer.$valueOf(554176526),Float.$valueOf(g),Float.$valueOf(c)]));
continue;case 12289:c=this.centerParameter(++e);e=a.iToken;this.chk||b.addLast(y(-1,[Integer.$valueOf(134217751),Float.$valueOf(g),c]));continue;case 528432:switch(this.getToken(++e).tok){case 1111492629:d.set(1,0,0);e++;break;case 1111492630:d.set(0,1,0);e++;break;case 1111492631:d.set(0,0,1);e++;break;case 8:case 1073742332:d.setT(this.getPoint3f(e,!0));e=a.iToken+1;break;case 1073741824:this.invArg()}c=this.floatParameter(e);this.chk||b.addLast(y(-1,[Integer.$valueOf(528432),Float.$valueOf(g),
d,Float.$valueOf(c)]));continue;case 4160:var f=c=NaN;if(this.isFloatParameter(++e))c=this.floatParameter(e),f=this.floatParameter(++e);else switch(this.tokAt(e)){case 1111492629:c=this.floatParameter(++e);break;case 1111492630:f=this.floatParameter(++e);break;default:c=this.centerParameter(e);e=a.iToken;this.chk||b.addLast(y(-1,[Integer.$valueOf(4160),Float.$valueOf(g),c]));continue}this.chk||b.addLast(y(-1,[Integer.$valueOf(268435634),Float.$valueOf(g),Float.$valueOf(c),Float.$valueOf(f)]));continue;
case 268435632:continue;case 1112152078:c=new JU.Lst;10==this.tokAt(e+1)||1073742325==this.tokAt(e+1)?(f=this.atomExpressionAt(++e),e=a.iToken):f=this.vwr.bsA();if(this.chk)return;this.vwr.getPolymerPointsAndVectors(f,c);var j;if(0<(j=c.size())){for(var f=Array(j),h=0;h<j;h++)f[h]=c.get(h);b.addLast(y(-1,[Integer.$valueOf(1112152078),Float.$valueOf(g),f]));continue}break;case 1073742084:if(1073742330==this.getToken(e+1).tok){e++;c=a.objectNameParameter(++e);if(this.chk)return;this.setShapeProperty(22,
"thisID",c);c=this.getShapeProperty(22,"vertices");a.refresh(!1);null==c&&this.invArg();f=I(this.isFloatParameter(e+1)?this.floatParameter(++e):0);j=I(this.isFloatParameter(e+1)?this.floatParameter(++e):2147483647);b.addLast(y(-1,[Integer.$valueOf(1073742084),Float.$valueOf(g),c,null,D(-1,[f,j])]));continue}for(c=new JU.Lst;a.isCenterParameter(e+1);)c.addLast(this.centerParameter(++e)),e=a.iToken;if(0<c.size()){c=c.toArray(Array(c.size()));this.chk||b.addLast(y(-1,[Integer.$valueOf(1073742084),Float.$valueOf(g),
c,null,D(-1,[0,2147483647])]));continue}default:this.invArg()}}!this.chk&&!this.vwr.isJmolDataFrame()&&this.vwr.tm.navigateList(a,b)}});k(c$,"plot",function(a){var d=this.e,b=this.vwr.am.cmi;0>b&&d.errorStr(30,"plot");var b=this.vwr.ms.getJmolDataSourceFrame(b),c=a.length-1,e=a!==this.st,g=!0,f=this.st;e&&(d.st=this.st=a);var j=e?134222350:a[0].tok,h=e||134221850==j||4138==j?0:1,q=null,m=!0,l=!1;switch(j){case 135176:m=!1;l=!0;break;case 134222350:g=m=!1;break;case 134221856:m=!1,4==JS.CmdExt.tokAtArray(c,
a)?q=this.stringParameter(c--):1073742336==JS.CmdExt.tokAtArray(c-1,a)?(q=this.paramAsStr(c-2)+"."+this.paramAsStr(c),c-=3):(d.st=this.st=f,d.iToken=this.st.length,this.error(13)),d.slen=this.slen=c+1}var e="",k=null,p="",A=!1,s=!1,z=!1,v=!1,x=Array(3),w=D(3,0),r=JU.BSUtil.copy(this.vwr.bsA()),C="; select "+JU.Escape.eBS(r)+";\n ",v=d.optParameterAsString(c).toLowerCase(),u=null,n=null,t=null,B=JS.CmdExt.tokAtArray(h,a);4==B&&(B=JS.T.getTokFromName(a[h].value));switch(B){default:d.iToken=1;this.invArg();
break;case 134221834:d.iToken=1;v="data";C="";break;case 1715472409:d.iToken=h+1;for(a=0;3>a;a++){switch(this.tokAt(d.iToken)){case 4:w[a]=JS.T.getTokFromName(d.getToken(d.iToken).value);break;default:w[a]=this.tokAt(d.iToken);break;case 0:0==a&&this.invArg();case 1287653388:case 32:case 64:a=2;continue}1715472409!=w[a]&&!JS.T.tokAttr(w[a],1077936128)&&this.invArg();x[a]=this.getToken(d.iToken).value.toString();d.iToken++}1287653388==this.tokAt(d.iToken)&&(t=this.stringParameter(++d.iToken),g=!1,
d.iToken++);32==this.tokAt(d.iToken)&&(u=this.getPoint3f(++d.iToken,!1),d.iToken++);64==this.tokAt(d.iToken)&&(n=this.getPoint3f(++d.iToken,!1),d.iToken++);v="property "+x[0]+(null==x[1]?"":" "+x[1])+(null==x[2]?"":" "+x[2]);0>r.nextSetBit(0)&&(r=this.vwr.getModelUndeletedAtomsBitSet(b));p="select "+JU.Escape.eBS(r)+";\n ";break;case 4138:v.equalsIgnoreCase("draw")&&(v=d.optParameterAsString(--c).toLowerCase());v=c>h&&v.startsWith("r");v="ramachandran"+(v?" r":"")+(135176==j?" draw":"");break;case 134221850:case 136314895:e=
' "'+this.vwr.getQuaternionFrame()+'"';p="set quaternionFrame"+e+";\n  ";A=!0;v.equalsIgnoreCase("draw")&&(l=!0,v=d.optParameterAsString(--c).toLowerCase());z=(s=v.startsWith("deriv")||v.startsWith("diff"))&&0<v.indexOf("2");s&&c--;if(v.equalsIgnoreCase("helix")||v.equalsIgnoreCase("axis"))s=l=!0,c=-1;v=((c<=h?"":d.optParameterAsString(c))+"w").substring(0,1);if(v.equals("a")||v.equals("r"))s=!0;JU.PT.isOneOf(v,";w;x;y;z;r;a;")||d.evalError("QUATERNION [w,x,y,z,a,r] [difference][2]",null);v="quaternion "+
v+(s?" difference":"")+(z?"2":"")+(l?" draw":"")}this.st=f;if(this.chk)return"";if(m&&(p+="plot "+v,f=this.vwr.ms.getJmolDataFrameIndex(b,p),0<f&&134221856!=j&&134222350!=j))return this.vwr.setCurrentModelIndexClear(f,!0),"";m=c=f=null;h=Array(3);if(1715472409==B){f=this.getBitsetPropertyFloat(r,w[0]|224,1715472409==w[0]?x[0]:null,null==u?NaN:u.x,null==n?NaN:n.x);h[0]=x[0]+" "+JU.Escape.eAF(f);null!=x[1]&&(c=this.getBitsetPropertyFloat(r,w[1]|224,1715472409==w[1]?x[1]:null,null==u?NaN:u.y,null==n?
NaN:n.y),h[1]=x[1]+" "+JU.Escape.eAF(c));null!=x[2]&&(m=this.getBitsetPropertyFloat(r,w[2]|224,1715472409==w[2]?x[2]:null,null==u?NaN:u.z,null==n?NaN:n.z),h[2]=x[2]+" "+JU.Escape.eAF(m));null==u&&(u=JU.P3.new3(this.getPlotMinMax(f,!1,w[0]),this.getPlotMinMax(c,!1,w[1]),this.getPlotMinMax(m,!1,w[2])));null==n&&(n=JU.P3.new3(this.getPlotMinMax(f,!0,w[0]),this.getPlotMinMax(c,!0,w[1]),this.getPlotMinMax(m,!0,w[2])));JU.Logger.info("plot min/max: "+u+" "+n);l=k=null;if(g){l=JU.P3.new3(1,1,1);k=new JU.P3;
k.ave(n,u);l.sub2(n,u);l.set(l.x/200,l.y/200,l.z/200);JS.T.tokAttr(w[0],1094713344)?(l.x=1,k.x=0):0.1<l.x&&10>=l.x&&(l.x=1);JS.T.tokAttr(w[1],1094713344)?(l.y=1,k.y=0):0.1<l.y&&10>=l.y&&(l.y=1);JS.T.tokAttr(w[2],1094713344)?(l.z=1,k.z=0):0.1<l.z&&10>=l.z&&(l.z=1);if(null==x[2]||null==x[1])k.z=u.z=n.z=l.z=0;for(a=0;a<f.length;a++)f[a]=(f[a]-k.x)/l.x;if(null!=x[1])for(a=0;a<c.length;a++)c[a]=(c[a]-k.y)/l.y;if(null!=x[2])for(a=0;a<m.length;a++)m[a]=(m[a]-k.z)/l.z}k=y(-1,[r,f,c,m,u,n,l,k,t,h])}if(134221856==
j)return this.vwr.writeFileData(q,"PLOT_"+v,b,k);g=v.equals("data")?"1 0 H 0 0 0 # Jmol PDB-encoded data":this.vwr.getPdbData(b,v,null,k,null,!0);if(134222350==j)return g;JU.Logger.debugging&&JU.Logger.debug(g);if(135176==j)return d.runScript(g),"";j=this.vwr.fm.getFileInfo();q=this.vwr.getBoolean(603979792);this.vwr.g.appendNew=!0;g=null!=g&&null==this.vwr.openStringInlineParamsAppend(g,null,!0);this.vwr.g.appendNew=q;this.vwr.fm.setFileInfo(j);if(!g)return"";j=this.vwr.ms.mc;this.vwr.ms.setJmolDataFrame(p,
b,j-1);1715472409!=B&&(p+=";\n"+C);p=this.vwr.addStateScript(p,!0,!1);g=150;switch(B){default:b="frame 0.0; frame last; reset;select visible;wireframe only;";g=10;break;case 1715472409:this.vwr.setFrameTitle(j-1,v+" plot for model "+this.vwr.getModelNumberDotted(b));b="frame 0.0; frame last; reset;select visible; spacefill 3.0; wireframe 0;draw plotAxisX"+j+' {100 -100 -100} {-100 -100 -100} "'+x[0]+'";draw plotAxisY'+j+' {-100 100 -100} {-100 -100 -100} "'+x[1]+'";';null!=x[2]&&(b+="draw plotAxisZ"+
j+' {-100 -100 100} {-100 -100 -100} "'+x[2]+'";');break;case 4138:this.vwr.setFrameTitle(j-1,"ramachandran plot for model "+this.vwr.getModelNumberDotted(b));b="frame 0.0; frame last; reset;select visible; color structure; spacefill 3.0; wireframe 0;draw ramaAxisX"+j+' {100 0 0} {-100 0 0} "phi";draw ramaAxisY'+j+' {0 100 0} {0 -100 0} "psi";';break;case 134221850:case 136314895:this.vwr.setFrameTitle(j-1,v.$replace("w"," ")+e+" for model "+this.vwr.getModelNumberDotted(b)),b=JU.C.getHexCode(this.vwr.cm.colixBackgroundContrast),
b="frame 0.0; frame last; reset;select visible; wireframe 0; spacefill 3.0; isosurface quatSphere"+j+" color "+b+" sphere 100.0 mesh nofill frontonly translucent 0.8;draw quatAxis"+j+'X {100 0 0} {-100 0 0} color red "x";draw quatAxis'+j+'Y {0 100 0} {0 -100 0} color green "y";draw quatAxis'+j+'Z {0 0 100} {0 0 -100} color blue "z";color structure;draw quatCenter'+j+"{0 0 0} scale 0.02;"}d.runScript(b+C);p.setModelIndex(this.vwr.am.cmi);this.vwr.setRotationRadius(g,!0);d.sm.loadShape(31);this.showString("frame "+
this.vwr.getModelNumberDotted(j-1)+(0<v.length?" created: "+v+(A?e:""):""));return""},"~A");k(c$,"polyhedra",function(){var a=this.e,d=1==this.slen,b=d,c=!1,e=!1,g=!1,f=0;this.e.sm.loadShape(21);this.setShapeProperty(21,"init",Boolean.TRUE);for(var j=3.4028235E38,h=D(-1,[-2147483648]),k=1;k<this.slen;++k){var m=null,l=null;switch(this.getToken(k).tok){case 6:m="info";l=this.e.theToken.value;b=!0;break;case 1747587102:m="unitCell";l=Boolean.TRUE;b=!0;break;case 1073742072:this.e.restrictSelected(!1,
!1),a.theTok=1073742335;case 1073742335:case 12291:case 1073742334:(k+1!=this.slen||b||1<f)&&this.error(18);m=1073742334==a.theTok?"off":1073742335==a.theTok?"on":"delete";c=!0;break;case 2:m="nVertices";l=Integer.$valueOf(this.intParameter(k));b=!0;268435504==this.tokAt(k+1)&&k++;break;case 1677721602:0<f&&this.invPO();b=!0;m="bonds";d=!0;break;case 1665140738:k++;case 3:0<f&&this.invPO();m="radius";l=Float.$valueOf(this.floatParameter(k));b=!0;break;case 1073742066:a.theTok=1073741937;case 1073741937:this.setShapeProperty(21,
"collapsed",Boolean.TRUE);case 1073742099:case 1073741924:m=JS.T.nameOf(a.theTok);switch(this.tokAt(k+1)){case 268435860:case 268435504:k++}l=Float.$valueOf(this.floatParameter(++k));break;case 1073742170:1<f&&this.invPO();(10==this.tokAt(++k)||1073742325==this.tokAt(k))&&!b?(m="toBitSet",l=this.atomExpressionAt(k)):a.isArrayParameter(k)?(m="toVertices",l=a.getPointArray(k,-1,!1)):this.error(19);k=a.iToken;b=!0;break;case 10:case 1073742325:e&&this.invPO();switch(++f){case 1:m="centers";break;case 2:m=
"to";b=!0;break;default:a.bad()}l=this.atomExpressionAt(k);k=a.iToken;k+1==this.slen&&(b=!0);break;case 1765808134:case 603979967:case 1073742074:j=this.getColorTrans(a,k,!0,h);k=a.iToken;continue;case 1073741886:e&&this.error(18);e=!0;this.isFloatParameter(k+1)&&this.setShapeProperty(21,"faceCenterOffset",Float.$valueOf(this.floatParameter(++k)));m="collapsed";l=Boolean.TRUE;break;case 1073742044:case 1073741933:case 1073741956:g&&this.error(18);g=!0;m=JS.T.nameOf(a.iToken);break;case 1073742182:case 1073742060:case 1073741862:case 1073741958:case 1073741964:continue;
default:if(a.isColorParam(k)){h[0]=a.getArgbParam(k);k=a.iToken;continue}this.invArg()}this.setShapeProperty(21,m,l);if(c)return!1}b?(!e&&d&&this.setShapeProperty(21,"bonds",null),this.setShapeProperty(21,"generate",null)):g||this.error(19);-2147483648!=h[0]&&this.setShapeProperty(21,"colorThis",Integer.$valueOf(h[0]));3.4028235E38!=j&&a.setShapeTranslucency(21,"","translucentThis",j,null);this.setShapeProperty(21,"init",Boolean.FALSE);return!0});k(c$,"write",function(a){var d=this.e,b=1,c=1,e=null,
g=null,f=null,j=null,h="SPT",g=!0,k=!1;null==a?(a=this.st,k=this.vwr.isApplet&&!this.vwr.isSignedApplet||!this.vwr.haveAccess(JV.Viewer.ACCESS.ALL)||0<this.vwr.fm.getPathForAllFiles().length):(b=c=0,g=!1,k=!g);var m=JS.CmdExt.tokAtArray(b,a);if(4==m&&!g){var l=JS.T.getTokenFromName(JS.SV.sValue(a[0]).toLowerCase());null!=l&&(m=l.tok)}switch(m){case 0:break;case 134221850:case 4138:case 1715472409:return g=this.plot(a),k?g:this.writeMsg(g);case 134222850:d.isArrayParameter(b+1)&&(e=d.stringParameterSet(++b),
j=f=".",c=b=d.iToken+1,m=this.tokAt(b));break;default:h=JS.SV.sValue(this.tokenAt(b,a)).toUpperCase()}var y=this.vwr.getExportDriverList(),l=null,p=g?this.slen:a.length,A="",s=null,z=null,v=0,x="PNGJ",w=!1,r=null,C=-1,u=-1,n=!1,t=null;0!=m&&(g&&1<this.slen&&1073741848==this.tokAt(this.slen-2))&&(h=this.paramAsStr(this.slen-1).toUpperCase(),c=p,p-=2,m=0);switch(m){case 15:case 6:h="VAR";z=this.tokenAt(b++,a);break;case 1073741983:h="INLINE";l=JS.SV.sValue(this.tokenAt(++b,a));b++;break;case 1073742102:h=
"PGRP";b++;A=JS.SV.sValue(this.tokenAt(b,a)).toLowerCase();A.equals("draw")&&b++;break;case 1073742329:b++;w=!0;break;case 1073742158:case 134222850:for(s=JS.SV.sValue(this.tokenAt(++b,a)).toLowerCase();s.equals("localpath")||s.equals("remotepath");)s.equals("localpath")?f=JS.SV.sValue(this.tokenAt(++b,a)):j=JS.SV.sValue(this.tokenAt(++b,a)),s=JS.SV.sValue(this.tokenAt(++b,a)).toLowerCase();h="SPT";break;case 1228935687:case 134320141:case 1610616855:case 135180:case 1073742015:case 1073742018:case 1073877011:case 1073877010:case 135188:b++;
break;case 1073741991:h="ZIPALL";b++;break;case 36868:h="VAR";b+=2;break;case 4115:case 4120:case 1073742139:case 4166:case 1073741824:case 4:switch(m){case 4115:var B;b+1<p&&1073742325==a[++b].tok||10==a[b].tok?(B=d.atomExpression(a,b,0,!0,!1,null,!0),b=d.iToken+1):B=this.vwr.getAllAtoms();this.chk||(r=this.vwr.ms.getModelBS(B,!0));break;case 4120:h="IMAGE";b++;break;case 1073742139:s=JS.SV.sValue(this.tokenAt(++b,a)).toUpperCase();JU.PT.isOneOf(s,";PNG;PNGJ;")&&(x=s,b++);break;case 4166:v=d.intParameterRange(++b,
1,10);if(2147483647==v)return"";this.chk||(this.vwr.tm.setVibrationPeriod(0),d.isJS||d.delayScript(100));b++;break;default:m=4120}if(4120==m&&b<a.length)if(m=JS.T.getTokenFromName(JS.SV.sValue(a[b]).toLowerCase()),null!=m&&(h=JS.SV.sValue(m).toUpperCase()),JU.PT.isOneOf(h,y.toUpperCase())){b++;h=h.substring(0,1).toUpperCase()+h.substring(1).toLowerCase();n=!0;g&&(t="Jmol."+h.toLowerCase());break}else if(JU.PT.isOneOf(h,";ZIP;ZIPALL;SPT;STATE;")){b++;break}else h="IMAGE";2==JS.CmdExt.tokAtArray(b,
a)&&(C=JS.SV.iValue(this.tokenAt(b++,a)),u=JS.SV.iValue(this.tokenAt(b++,a)))}m=-2147483648;if(c<p){s=JS.SV.sValue(this.tokenAt(b,a));if(s.equalsIgnoreCase("clipboard")){if(this.chk)return""}else JU.PT.isOneOf(s.toLowerCase(),";jpg;jpeg;jpg64;jpeg64;gif;gift;pdf;ppm;png;pngj;pngt;")?(2==JS.CmdExt.tokAtArray(b+1,a)&&2==JS.CmdExt.tokAtArray(b+2,a)&&(C=JS.SV.iValue(this.tokenAt(++b,a)),u=JS.SV.iValue(this.tokenAt(++b,a))),2==JS.CmdExt.tokAtArray(b+1,a)&&(m=JS.SV.iValue(this.tokenAt(++b,a)))):JU.PT.isOneOf(s.toLowerCase(),
";xyz;xyzrn;xyzvib;mol;sdf;v2000;v3000;json;pdb;pqr;cml;")&&(h=s.toUpperCase(),b+1==p&&b++);h.equals("IMAGE")&&JU.PT.isOneOf(s.toLowerCase(),";jpg;jpeg;jpg64;jpeg64;gif;gift;pdf;ppm;png;pngj;pngt;scene;")&&(h=s.toUpperCase(),b++)}b+2==p&&(c=JS.SV.sValue(this.tokenAt(++b,a)),0<c.length&&"."!=c.charAt(0)&&(h=s.toUpperCase()));switch(JS.CmdExt.tokAtArray(b,a)){case 0:k=!0;break;case 1073741884:break;case 805306401:t=h.equals("IMAGE")?"?jmol.png":"?jmol."+h.toLowerCase();break;case 1073741824:case 4:t=
JS.SV.sValue(this.tokenAt(b,a));t.equalsIgnoreCase("clipboard")||!this.vwr.haveAccess(JV.Viewer.ACCESS.ALL)?t=null:g&&(p!=this.slen&&1073742336==this.tokAt(b+1)&&b+3==p)&&(t+="."+JS.SV.sValue(this.tokenAt(b+2,a)));break;default:this.invArg()}if(h.equals("IMAGE")||h.equals("FRAME")||h.equals("VIBRATION"))h=null!=t&&0<=t.indexOf(".")?t.substring(t.lastIndexOf(".")+1).toUpperCase():"JPG";p=JU.PT.isOneOf(h.toLowerCase(),";jpg;jpeg;jpg64;jpeg64;gif;gift;pdf;ppm;png;pngj;pngt;scene;");if(!p&&(h.equals("MNU")?
h="MENU":h.equals("WRL")||h.equals("VRML")?(h="Vrml",n=!0):h.equals("X3D")?(h="X3d",n=!0):h.equals("IDTF")?(h="Idtf",n=!0):h.equals("MA")?(h="Maya",n=!0):h.equals("JS")?(h="Js",n=!0):h.equals("OBJ")?(h="Obj",n=!0):h.equals("JVXL")?h="ISOSURFACE":h.equals("XJVXL")?h="ISOSURFACE":h.equals("JMOL")?h="ZIPALL":h.equals("HIS")&&(h="HISTORY"),h.equals("COORD")||h.equals("COORDS")))h=null!=t&&0<=t.indexOf(".")?t.substring(t.lastIndexOf(".")+1).toUpperCase():"XYZ";null!=e&&(h.equals("PNG")&&(h="PNGJ"),!h.equals("PNGJ")&&
(!h.equals("ZIPALL")&&!h.equals("ZIP"))&&this.invArg());!p&&(!n&&!JU.PT.isOneOf(h,";SCENE;JMOL;ZIP;ZIPALL;SPT;HISTORY;MO;NBO;ISOSURFACE;MESH;PMESH;VAR;FILE;FUNCTION;CML;JSON;XYZ;XYZRN;XYZVIB;MENU;MOL;PDB;PGRP;PQR;QUAT;RAMA;SDF;V2000;V3000;INLINE;"))&&d.errorStr2(54,"COORDS|FILE|FUNCTIONS|HISTORY|IMAGE|INLINE|ISOSURFACE|JMOL|MENU|MO|NBO|POINTGROUP|QUATERNION [w,x,y,z] [derivative]|RAMACHANDRAN|SPT|STATE|VAR x|ZIP|ZIPALL  CLIPBOARD","CML|GIF|GIFT|JPG|JPG64|JMOL|JVXL|MESH|MOL|PDB|PMESH|PNG|PNGJ|PNGT|PPM|PQR|SDF|CD|JSON|V2000|V3000|SPT|XJVXL|XYZ|XYZRN|XYZVIB|ZIP"+
y.toUpperCase().$replace(";","|"));if(this.chk)return"";b=Array(1);c=this.vwr.getBoolean(603979934);if(n){c&&JU.Logger.startTimer("export");e=new java.util.Hashtable;e.put("type",h);null!=t&&e.put("fileName",t);(g||null!=t)&&e.put("fullPath",b);e.put("width",Integer.$valueOf(C));e.put("height",Integer.$valueOf(u));l=this.vwr.generateOutputForExport(e);if(null==l||0==l.length)return"";if(k)return l;if(!h.equals("Povray")&&!h.equals("Idtf")||null==b[0])return this.writeMsg(l);k=h.equals("Idtf")?".tex":
".ini";t=b[0]+k;a=new java.util.Hashtable;a.put("fileName",t);a.put("type",k);a.put("text",l);a.put("fullPath",b);g=this.vwr.processWriteOrCapture(a);h.equals("Idtf")&&(l=l.substring(0,l.indexOf("\\begin{comment}")));l="Created "+b[0]+":\n\n"+l;c&&this.showString(JU.Logger.getTimerMsg("export",0));null!=g&&(g.startsWith("OK")||d.evalError(g,null),d.report(l));return""}n=null;y=!1;if(null==l){s=0;l=h.intern();if("MENU"===l)l=this.vwr.getMenu("");else if("PGRP"===l)l=this.vwr.ms.getPointGroupAsString(this.vwr.bsA(),
A.equals("draw"),null,0,1);else if("PDB"===l||"PQR"===l)k?l=this.vwr.getPdbAtomData(null,null,"PQR"===l,w):(y=!0,h="PDB_"+l+"-coord "+w);else if("FILE"===l)"?".equals(t)&&(t="?Jmol."+this.vwr.getP("_fileType")),k?l=this.vwr.getCurrentFileAsString("script"):y=!0;else if("SDF"===l||"MOL"===l||"V2000"===l||"V3000"===l||"CD"===l||"JSON"===l||"XYZ"===l||"XYZRN"===l||"XYZVIB"===l||"CML"===l)l=this.vwr.getModelExtract("selected",w,!1,l),l.startsWith("ERROR:")&&(n=l);else if("FUNCTION"===l)l=this.vwr.getFunctionCalls(null),
h="TXT";else if("VAR"===l)null==z&&(z=d.getParameter(JS.SV.sValue(this.tokenAt(g?2:1,a)),1073742190,!0)),f=null,15==z.tok?(f=new JU.Lst,f.addLast(z.value.data)):6==z.tok&&(f=null==t?new JU.Lst:this.prepareBinaryOutput(z)),null==f?(l=z.asString(),h="TXT"):null!=t&&(a=new java.util.Hashtable,a.put("data",f),null==(n=l=this.vwr.createZip(t,1==f.size()||t.endsWith(".png")||t.endsWith(".pngj")?"BINARY":"ZIPDATA",a))&&d.evalError("#CANCELED#",null));else if("SPT"===l)if(w)a=this.vwr.ms.getTaintedAtoms(2),
this.vwr.setAtomCoordsRelative(JU.P3.new3(0,0,0),null),l=this.vwr.getStateInfo(),this.vwr.ms.setTaintedAtoms(a,2);else{if(l=this.vwr.getStateInfo(),null!=f||null!=j)l=JV.FileManager.setScriptFileReferences(l,f,j,null)}else"ZIP"===l||"ZIPALL"===l?null!=t&&(a=new java.util.Hashtable,a.put("data",e),null==(n=l=this.vwr.createZip(t,h,a))&&d.evalError("#CANCELED#",null)):"HISTORY"===l?(l=this.vwr.getSetHistory(2147483647),h="SPT"):"MO"===l||"NBO"===l?(l=this.getMoJvxl(2147483647,"NBO"===l),h="XJVXL"):
"PMESH"===l?(null==(l=this.getIsosurfaceJvxl(!0,29))&&this.error(31),h="XJVXL"):"ISOSURFACE"===l||"MESH"===l?(null==(l=this.getIsosurfaceJvxl("MESH"===l,24))&&this.error(31),h=0<=l.indexOf("<?xml")?"XJVXL":"JVXL",k||this.showString(this.getShapeProperty(24,"jvxlFileInfo"))):(g&&(k&&null==t)&&(k=!1,t="\u0001"),s=-1,0>m&&(m=-1));null==l&&(l="");0==s&&(null==n||H(n,String))}if(!g)return l;if(k)return d.showStringPrint(l,!0),"";if(null!=n&&H(n,String))return this.writeMsg(n);if(y)return this.writeMsg(this.vwr.writeFileData(t,
h,0,null));if(h.equals("SCENE"))n=x;else if(null==n&&(!p||null!=t))n=l;c&&JU.Logger.startTimer("write");p&&(d.refresh(!1),0>C&&(C=this.vwr.getScreenWidth()),0>u&&(u=this.vwr.getScreenHeight()));a=new java.util.Hashtable;null!=t&&a.put("fileName",t);a.put("backgroundColor",Integer.$valueOf(this.vwr.getBackgroundArgb()));a.put("type",h);H(n,String)&&-2147483648==m?a.put("text",n):H(n,Array)&&a.put("bytes",n);null!=e&&a.put("scripts",e);null!=r&&a.put("bsFrames",r);a.put("fullPath",b);a.put("quality",
Integer.$valueOf(m));a.put("width",Integer.$valueOf(C));a.put("height",Integer.$valueOf(u));a.put("nVibes",Integer.$valueOf(v));g=this.vwr.processWriteOrCapture(a);null==g&&(g="canceled");p&&g.startsWith("OK")&&(g+="; width="+C+"; height="+u);c&&this.showString(JU.Logger.getTimerMsg("write",0));return this.writeMsg(g)},"~A");k(c$,"prepareBinaryOutput",function(a){var d=a.getMap();if(null==d||!d.containsKey("$_BINARY_$"))return null;a=new JU.Lst;for(var b,d=d.entrySet().iterator();d.hasNext()&&((b=
d.next())||1);){var c=b.getKey();if(!c.equals("$_BINARY_$")){var e=b.getValue(),g=15==e.tok?e.value.data:null;null==g&&(e=e.asString(),g=e.startsWith(";base64,")?JU.Base64.decodeBase64(e):e.getBytes());if(c.equals("_DATA_")){a=new JU.Lst;a.addLast(g);break}else c.equals("_IMAGE_")?(a.add(0,c),a.add(1,null),a.add(2,g)):(a.addLast(c),a.addLast(null),a.addLast(g))}}return a},"JS.SV");k(c$,"writeMsg",function(a){if(this.chk||null==a)return"";a.startsWith("OK")||(this.e.evalError(a,null),alert(a));this.e.report(a);
return a},"~S");k(c$,"show",function(){var a=this.e,d=null,b=this.paramAsStr(1),c=null,e=null,g=2,e=this.getToken(1),f=H(e,JS.SV)&&1073741824!=e.tok?0:e.tok;4==f&&(e=JS.T.getTokenFromName(b.toLowerCase()),null!=e&&(f=e.tok));1296041474!=f&&(1073742158!=f&&1715472409!=f)&&this.checkLength(-3);if(2==this.slen&&0<=b.indexOf("?"))this.showString(this.vwr.getAllSettings(b.substring(0,b.indexOf("?"))));else{switch(f){case 0:this.chk||(c=a.theToken.escape());break;case 1073741925:a.checkLength23();g=this.st.length;
this.chk||(c=this.vwr.ms.getInfo(this.vwr.am.cmi,"domains"),c=H(c,JS.SV)?this.vwr.getAnnotationInfo(c,a.optParameterAsString(2),1073741925):"domain information has not been loaded");break;case 1715472409:c=this.plot(this.st);g=this.st.length;break;case 1073742189:a.checkLength23();g=this.st.length;this.chk||(c=this.vwr.ms.getInfo(this.vwr.am.cmi,"validation"),c=H(c,JS.SV)?this.vwr.getAnnotationInfo(c,a.optParameterAsString(2),1073742189):"validation information has not been loaded");break;case 134221829:this.chk||
(c=JU.Escape.e(this.vwr.fm.cacheList()));break;case 1073741916:a.checkLength23();g=this.st.length;this.chk||(c=this.vwr.ms.getInfo(this.vwr.am.cmi,"dssr"),c=null==c?"no DSSR information has been read":2<g?JS.SV.getVariable(this.vwr.extractProperty(c,this.stringParameter(2),-1)).asString():""+JS.SV.getVariable(c).asString());break;case 1073741915:this.checkLength(2);this.chk||(c=this.vwr.calculateStructures(null,!0,!1));break;case 545259571:this.checkLength(2);this.chk||(c=this.vwr.fm.getPathForAllFiles());
break;case 1275203608:this.chk||(f=Array(2),this.vwr.shm.getShapePropertyData(21,"allInfo",f),c=JS.SV.getVariable(f[1]).asString());break;case 1073742038:if(a.optParameterAsString(2).equalsIgnoreCase("1H")){g=3;this.chk||(c=this.vwr.getNMRPredict(!1));break}this.chk||this.vwr.getNMRPredict(!0);return;case 1073741929:case 1073741879:case 134218757:this.checkLength(1073741879==f||134218757==f&&0!=this.tokAt(2)?g=3:2);if(this.chk)return;try{134218757!=f?(c=this.vwr.getDataBaseName(null),c=null!=c&&(c.startsWith("$")||
c.startsWith(":"))?c.substring(1):null):a.optParameterAsString(2).equalsIgnoreCase("true")&&(c=this.vwr.getBioSmiles(null)),null==c&&(c=this.vwr.getSmiles(null))}catch(j){if(L(j,Exception))c=j.getMessage();else throw j;}switch(f){case 1073741929:if(0<c.length){this.vwr.fm.loadImage(this.vwr.setLoadFormat("_"+c,"2",!1),"\u0001"+c,!1);return}c="Could not show drawing -- Either insufficient atoms are selected or the model is a PDB file.";break;case 1073741879:g=3,0<c.length?(c=this.vwr.getChemicalInfo(c,
this.getToken(2)),0<=c.indexOf("FileNotFound")&&(c="?")):c="Could not show name -- Either insufficient atoms are selected or the model is a PDB file."}break;case 1296041474:var f=0,h=e=null;3<this.slen&&4!=this.tokAt(3)?(e=this.centerParameter(2),h=this.centerParameter(++a.iToken)):f=2==this.tokAt(2)?this.intParameter(2):0;var k=4==this.tokAt(a.iToken+1)?this.stringParameter(++a.iToken):null;this.checkLength(g=++a.iToken);this.chk||(c=this.vwr.ms.getSymTemp(!0).getSymmetryInfoString(this.vwr.ms,this.vwr.am.cmi,
f,e,h,null,k));break;case 1648363544:a=null;2<this.slen&&(a=J.c.VDW.getVdwType(this.paramAsStr(2)),null==a&&this.invArg());this.chk||this.showString(this.vwr.getDefaultVdwNameOrData(0,a,null));return;case 134320141:a.checkLength23();this.chk||this.showString(this.vwr.getFunctionCalls(a.optParameterAsString(2)));return;case 36867:this.checkLength(2);this.chk||this.showString(this.vwr.getAllSettings(null));return;case 1073742184:if(2==this.slen){this.chk||this.vwr.showUrl(a.getFullPathName());return}e=
this.paramAsStr(2);this.chk||this.vwr.showUrl(e);return;case 1765808134:b="defaultColorScheme";break;case 1610612740:b="scaleAngstromsPerInch";break;case 134221850:case 4138:if(this.chk)return;0>this.vwr.am.cmi&&a.errorStr(30,"show "+a.theToken.value);c=this.plot(this.st);g=this.slen;break;case 14:case 1112152078:this.chk||(c=this.getContext(!1));break;case 1073741888:e=a.optParameterAsString(2);0<e.length&&(g=3);this.chk||(d=this.vwr.cm.getColorSchemeList(e));break;case 1073742192:this.chk||(c=this.vwr.getAtomDefs(this.vwr.definedAtomSets)+
this.vwr.g.getVariableList()+this.getContext(!0));break;case 536870926:this.chk||(c=this.vwr.getTrajectoryState());break;case 553648148:d=""+JS.ScriptEval.commandHistoryLevelMax;break;case 553648150:d=""+JU.Logger.getLogLevel();break;case 603979825:d=""+this.vwr.getBoolean(603979825);break;case 553648178:c="set strandCountForStrands "+this.vwr.getStrandCount(12)+"; set strandCountForMeshRibbon "+this.vwr.getStrandCount(13);break;case 536875070:c=this.vwr.showTimeout(2==(g=this.slen)?null:this.paramAsStr(2));
break;case 536870918:d=JU.Escape.eP(this.vwr.getDefaultLattice());break;case 4126:this.chk||(c=this.vwr.getMinimizationInfo());break;case 1611272194:switch(this.vwr.g.axesMode){case 603979808:c="set axesUnitcell";break;case 603979804:c="set axesMolecular";break;default:c="set axesWindow"}break;case 1610612737:c="set bondMode "+(this.vwr.getBoolean(603979812)?"OR":"AND");break;case 1649022989:this.chk||(c="set strandCountForStrands "+this.vwr.getStrandCount(12)+"; set strandCountForMeshRibbon "+this.vwr.getStrandCount(13));
break;case 1613238294:c="set hbondsBackbone "+this.vwr.getBoolean(603979852)+";set hbondsSolid "+this.vwr.getBoolean(603979854);break;case 1611141175:this.chk||(c=this.vwr.getSpinState());break;case 1611141176:c="set ssbondsBackbone "+this.vwr.getBoolean(603979952);break;case 1610625028:case 1611141171:c="selectionHalos "+(this.vwr.getSelectionHalosEnabled()?"ON":"OFF");break;case 1612709894:c="set selectHetero "+this.vwr.getBoolean(1612709894);break;case 1073741828:c=JU.Escape.eAP(this.vwr.getAdditionalHydrogens(null,
!0,!0,null));break;case 1612709900:c="set selectHydrogens "+this.vwr.getBoolean(1612709900);break;case 553648130:case 553648142:case 536870924:case 553648176:case 553648172:case 1073741995:this.chk||(c=this.vwr.getLightingState());break;case 1073742136:case 4146:this.chk||(c=this.vwr.stm.listSavedStates());break;case 1747587102:this.chk||(c=this.vwr.getUnitCellInfoText());break;case 1073742329:if(2==(g=this.slen)){this.chk||(c=this.vwr.getCoordinateState(this.vwr.bsA()));break}f=this.paramAsStr(2);
this.chk||(c=this.vwr.stm.getSavedCoordinates(f));break;case 1073742158:!this.chk&&null==a.outputBuffer&&this.vwr.sm.clearConsole();if(2==(g=this.slen)){this.chk||(c=this.vwr.getStateInfo());break}e=this.paramAsStr(2);if(e.startsWith("/")&&3==(g=this.slen)){if(!this.chk){e=e.substring(1).toLowerCase();f=JU.PT.split(this.vwr.getStateInfo(),"\n");c=new JU.SB;for(h=0;h<f.length;h++)0<=f[h].toLowerCase().indexOf(e)&&c.append(f[h]).appendC("\n");c=c.toString()}break}else if(1228935687==this.tokAt(2)&&
4==(g=this.slen)){this.chk||(c=this.vwr.fm.getEmbeddedFileState(this.paramAsStr(3),!0));break}g=3;this.chk||(c=this.vwr.stm.getSavedState(e));break;case 1639976963:if(2==(g=this.slen)){this.chk||(c=this.vwr.ms.getProteinStructureState(this.vwr.bsA(),134222350));break}f=this.paramAsStr(2);this.chk||(c=this.vwr.stm.getSavedStructure(f));break;case 134221834:f=3==(g=this.slen)?this.paramAsStr(2):null;this.chk||(c=this.vwr.getDataObj(f,null,-2),c=null==c?"no data":JU.Escape.encapsulateData(c[0],c[1],
c[3].intValue()));break;case 1073742152:f=null;2==(g=this.slen)?this.chk||(f=this.vwr.ms.getSymTemp(!0).getSpaceGroupInfo(this.vwr.ms,null)):(e=this.paramAsStr(2),this.chk||(f=this.vwr.ms.getSymTemp(!0).getSpaceGroupInfo(this.vwr.ms,JU.PT.rep(e,"''",'"'))));null!=f&&(c=""+f.get("spaceGroupInfo")+f.get("symmetryInfo"));break;case 1073742330:g=3;c=a.setObjectProperty();break;case 1678381065:this.chk||(c=this.vwr.ms.getBoundBoxCommand(!0));break;case 12289:this.chk||(c="center "+JU.Escape.eP(this.vwr.tm.fixedRotationCenter));
break;case 135176:this.chk||(c=this.getShapeProperty(22,"command"));break;case 1228935687:this.chk||this.vwr.sm.clearConsole();if(2==this.slen){this.chk||(c=this.vwr.getCurrentFileAsString("script"));null==c&&(c="<unavailable>");break}g=3;d=this.paramAsStr(2);this.chk||(c=this.vwr.getFileAsString3(d,!0,null));break;case 4115:c=1073742327==this.tokAt(2)&&0<(g=3)?this.vwr.getModelFileInfoAll():this.vwr.getModelFileInfo();break;case 1610616855:f=2==(g=this.slen)?2147483647:this.intParameter(2);1>f&&
this.invArg();this.chk||(this.vwr.sm.clearConsole(),0==a.scriptLevel&&this.vwr.removeCommand(),c=this.vwr.getSetHistory(f));break;case 135180:this.chk||(c=this.getShapeProperty(24,"jvxlDataXml"));break;case 1073877011:case 1073877010:a.optParameterAsString(2).equalsIgnoreCase("list")?(this.e.sm.loadShape(27),c=this.chk?"":this.getShapeProperty(27,"list -1"),g=3):(e=2==(g=this.slen)?-2147483648:this.intParameter(2),this.chk||(c=this.getMoJvxl(e,1073877011==f)));break;case 1094717454:this.chk||(c=this.vwr.ms.getModelInfoAsString());
break;case 537006096:this.chk||(c=this.vwr.getMeasurementInfoAsString());break;case 1073741863:g=3;!this.chk&&this.slen==g&&(c=this.vwr.getOrientationText(this.tokAt(2),null));break;case 1073742132:f=this.tokAt(2),0==f?f=1073742132:g=3;case 1073742178:case 4129:this.chk||(c=this.vwr.getOrientationText(f,null));break;case 1073742077:g=2;if(3<this.slen)break;switch(f=this.tokAt(2)){case 1073742178:case 1073742132:case 4129:case 0:this.chk||(c=this.vwr.getOrientationText(f,null));break;default:e=a.optParameterAsString(2),
c=this.vwr.getOrientationText(1073742035,e)}g=this.slen;break;case 1073742088:this.chk||(c=this.vwr.ms.getPDBHeader(this.vwr.am.cmi));break;case 1073742102:a=a.optParameterAsString(2);0==a.length&&(a=null);this.chk||this.showString(this.vwr.ms.getPointGroupAsString(this.vwr.bsA(),!1,"show:"+a,0,0));return;case 1088421903:this.chk||(c=this.vwr.ms.getSymmetryInfoAsString());break;case 1073742176:this.chk||(c="transform:\n"+this.vwr.tm.matrixRotate.toString());break;case 4168:c="zoom "+(this.vwr.tm.zoomEnabled?
""+this.vwr.tm.getZoomSetting():"off");break;case 1611272202:c=this.vwr.getShowFrank()?"frank ON":"frank OFF";break;case 1665140738:b="solventProbeRadius";break;case 1086324744:if(3==(g=this.slen)&&1073742334==this.tokAt(2))f=1086324743;case 1073741864:case 1086324740:case 1073742120:case 1113589787:case 1086324742:case 1140850689:case 1073741982:this.chk||(c=this.vwr.getChimeInfo(f));break;case 537022465:case 1610612738:case 20482:case 1612709912:d="?";break;case 1073742031:f=2==(g=this.slen)?null:
this.paramAsStr(2);this.chk||(c=this.vwr.getBindingInfo(f));break;case 1073742015:this.chk||(d=this.vwr.getMenu(""));break;case 1073741824:b.equalsIgnoreCase("fileHeader")&&(this.chk||(c=this.vwr.ms.getPDBHeader(this.vwr.am.cmi)));break;case 1073741992:case 36868:b=this.paramAsStr(g++),e=a.getParameter(b,1073742190,!0),this.chk||(c=1073741992==f?e.toJSON():e.escape())}this.checkLength(g);this.chk||(null!=c?this.showString(c):null!=d?this.showString(b+" = "+d):null!=b&&(0<=b.indexOf(" ")?this.showString(b):
this.showString(b+" = "+a.getParameter(b,1073742190,!0).escape())))}});k(c$,"stereo",function(){for(var a=J.c.STER.DOUBLE,d=-5,b=!1,c=null,e=0,g=1;g<this.slen;++g)if(this.e.isColorParam(g))1<e&&this.e.bad(),0==e&&(c=D(2,0)),b||(d=3),c[e]=this.e.getArgbParam(g),0==e++&&(c[1]=~c[0]),g=this.e.iToken;else switch(this.getToken(g).tok){case 1073742335:this.e.checkLast(this.e.iToken=1);this.e.iToken=1;break;case 1073742334:this.e.checkLast(this.e.iToken=1);a=J.c.STER.NONE;break;case 2:case 3:d=this.floatParameter(g);
b=!0;break;case 1073741824:if(b||(d=3),a=J.c.STER.getStereoMode(this.paramAsStr(g)),null!=a)break;default:this.invArg()}this.chk||this.vwr.setStereoMode(c,a,d)});k(c$,"struts",function(){var a=this.e,d=1073742072==this.tokAt(1)||1073742335==this.tokAt(1)||1==this.slen,b=a.getMadParameter();if(2147483647==b)return!1;d&&(b=Math.round(2E3*this.vwr.getFloat(570425406)));this.setShapeProperty(1,"type",Integer.$valueOf(32768));a.setShapeSizeBs(1,b,null);this.setShapeProperty(1,"type",Integer.$valueOf(1023));
return!0});k(c$,"unitcell",function(a){var d=this.e,b=2147483647,c=2147483647,e=null,g=d.tickParamAsStr(a,!0,!1,!1);a=d.iToken;var f=null,j=null,h=null,k=null,m=c=!1;switch(this.tokAt(++a)){case 4142:case 4141:m=!0;e=JU.P4.new4(0,0,0,-1);d.iToken++;break;case 4:case 1073741824:k=c=this.paramAsStr(a).toLowerCase();0>c.indexOf(",")&&!this.chk&&(d.setCurrentCagePts(null,null),JU.PT.isOneOf(c,";parent;standard;primitive;")&&(h=this.vwr.ms.getInfo(this.vwr.am.cmi,"unitcell_conventional"),null!=h&&d.setCurrentCagePts(this.vwr.getV0abc(h),
""+h)),c=this.vwr.ms.getInfo(this.vwr.am.cmi,"unitcell_"+c),this.showString(c));h=c;break;case 135180:case 1073742330:f=d.objectNameParameter(++a);break;case 1678381065:j=JU.P3.newP(this.vwr.getBoundBoxCenter());e=this.vwr.getBoundBoxCornerVector();j.sub(e);j=y(-1,[j,JU.P3.new3(2*e.x,0,0),JU.P3.new3(0,2*e.y,0),JU.P3.new3(0,0,2*e.z)]);e=null;d.iToken=a;break;case 11:case 12:h=this.getToken(a).value;break;case 12289:switch(this.tokAt(++a)){case 10:case 1073742325:e=JU.P3.newP(this.vwr.ms.getAtomSetCenter(this.atomExpressionAt(a)));
this.vwr.toFractional(e,!0);a=d.iToken;break;default:if(d.isCenterParameter(a)){e=this.centerParameter(a);a=d.iToken;break}this.invArg()}e.x-=0.5;e.y-=0.5;e.z-=0.5;break;case 10:case 1073742325:a=this.atomExpressionAt(a).nextSetBit(0);this.chk||(this.vwr.am.cai=a);if(0>a)return;a=d.iToken;break;case 1073742066:c=!0;case 1073742114:e=d.getPointOrPlane(++a,!1,!0,!1,!0,3,3);e=JU.P4.new4(e.x,e.y,e.z,c?1:0);a=d.iToken;break;case 3:case 2:if(111>this.floatParameter(a)){a--;break}b=this.intParameter(a);
break;default:d.isArrayParameter(a)?(j=d.getPointArray(a,4,!1),a=d.iToken):this.slen>a+1?(e=d.getPointOrPlane(a,!1,!0,!1,!0,3,3),a=d.iToken):a--}c=d.getSetAxesTypeMad(++a);d.checkLast(d.iToken);this.chk||2147483647==c||(2147483647==c&&(this.vwr.am.cai=-1),null!=h&&(j=this.vwr.getV0abc(h)),2147483647!=b?this.vwr.ms.setUnitCellOffset(this.vwr.getCurrentUnitCell(),null,b):null!=f?this.vwr.setCurrentCage(f):(m||null!=j)&&d.setCurrentCagePts(j,k),d.setObjectMad(33,"unitCell",c),null!=e&&this.vwr.ms.setUnitCellOffset(this.vwr.getCurrentUnitCell(),
e,0),null!=g&&this.setShapeProperty(33,"tickInfo",g))},"~N");k(c$,"assign",function(){var a=this.tokAt(1),d=this.atomExpressionAt(2).nextSetBit(0),b=-1,c=null;if(!(0>d)){4106==a?b=this.atomExpressionAt(++this.e.iToken).nextSetBit(0):c=this.paramAsStr(++this.e.iToken);var e=++this.e.iToken<this.slen?this.centerParameter(this.e.iToken):null;if(!this.chk)switch(a){case 1140850689:this.e.clearDefinedVariableAtomSets();this.assignAtom(d,e,c);break;case 1677721602:this.assignBond(d,(c+"p").charAt(0));break;
case 4106:this.assignConnect(d,b)}}});k(c$,"assignAtom",function(a,d,b){b.equals("X")&&this.vwr.setRotateBondIndex(-1);if(this.vwr.ms.at[a].mi==this.vwr.ms.mc-1){this.vwr.clearModelDependentObjects();var c=this.vwr.ms.ac;if(null==d)this.vwr.sm.modifySend(a,this.vwr.ms.at[a].mi,1,this.e.fullCommand),this.vwr.ms.assignAtom(a,b,!0),JU.PT.isOneOf(b,";Mi;Pl;X;")||this.vwr.ms.setAtomNamesAndNumbers(a,-c,null),this.vwr.sm.modifySend(a,this.vwr.ms.at[a].mi,-1,"OK"),this.vwr.refresh(3,"assignAtom");else{var e=
this.vwr.ms.at[a],g=JU.BSUtil.newAndSetBit(a);d=y(-1,[d]);var f=new JU.Lst;f.addLast(e);e=e.mi;this.vwr.sm.modifySend(a,e,3,this.e.fullCommand);try{g=this.vwr.addHydrogensInline(g,f,d),a=g.nextSetBit(0),this.vwr.ms.assignAtom(a,b,!1)}catch(j){if(!L(j,Exception))throw j;}this.vwr.ms.setAtomNamesAndNumbers(a,-c,null);this.vwr.sm.modifySend(a,e,-3,"OK")}}},"~N,JU.P3,~S");k(c$,"assignBond",function(a,d){var b=-1;try{b=this.vwr.ms.bo[a].atom1.mi;this.vwr.sm.modifySend(a,b,2,this.e.fullCommand);var c=this.vwr.ms.setBondOrder(a,
d);null==c||"0"==d?this.vwr.refresh(3,"setBondOrder"):this.vwr.addHydrogens(c,!1,!0);this.vwr.sm.modifySend(a,b,-2,""+d)}catch(e){if(L(e,Exception))JU.Logger.error("assignBond failed"),this.vwr.sm.modifySend(a,b,-2,"ERROR "+e);else throw e;}},"~N,~S");k(c$,"assignConnect",function(a,d){this.vwr.clearModelDependentObjects();var b=JU.AU.newFloat2(1);b[0]=K(-1,[a,d]);var c=this.vwr.ms.at[a].mi;this.vwr.sm.modifySend(a,c,2,this.e.fullCommand);this.vwr.ms.connect(b);this.vwr.ms.assignAtom(a,".",!0);this.vwr.ms.assignAtom(d,
".",!0);this.vwr.sm.modifySend(a,c,-2,"OK");this.vwr.refresh(3,"assignConnect")},"~N,~N");k(c$,"getContext",function(a){for(var d=new JU.SB,b=this.e.thisContext;null!=b;)a?null!=b.vars&&(d.append(this.getScriptID(b)),d.append(JV.StateManager.getVariableList(b.vars,80,!0,!1))):d.append(JS.ScriptError.getErrorLineMessage(b.functionName,b.scriptFileName,this.e.getLinenumber(b),b.pc,JS.ScriptEval.statementAsString(this.vwr,b.statement,-9999,this.e.debugHigh))),b=b.parentContext;a?null!=this.e.contextVariables&&
(d.append(this.getScriptID(null)),d.append(JV.StateManager.getVariableList(this.e.contextVariables,80,!0,!1))):d.append(this.e.getErrorLineMessage2());return d.toString()},"~B");k(c$,"getIsosurfaceJvxl",function(a,d){return this.chk?"":this.getShapeProperty(d,a?"jvxlMeshX":"jvxlDataXml")},"~B,~N");k(c$,"getMoJvxl",function(a,d){var b=d?28:27;this.e.sm.loadShape(b);var c=this.vwr.am.cmi;0>c&&this.e.errorStr(30,"show/write MO/NBO");var e=this.vwr.ms.getInfo(c,"moData");null==e&&this.error(27);var g=
this.getShapeProperty(b,"moNumber");(null==g||0==g.intValue())&&this.setShapeProperty(b,"init",Integer.$valueOf(c));this.setShapeProperty(b,"moData",e);return this.getShapePropertyIndex(b,"showMO",a)},"~N,~B");k(c$,"getScriptID",function(a){return"\n# "+(null==a?this.e.functionName:"function "+a.functionName)+" (file "+(null==a?this.e.scriptFileName:a.scriptFileName)+(null==a?"":" context "+a.id)+")\n"},"JS.ScriptContext");k(c$,"getShapePropertyIndex",function(a,d,b){return this.e.sm.getShapePropertyIndex(a,
d,b)},"~N,~S,~N");k(c$,"tokenAt",function(a,d){return a<d.length?d[a]:null},"~N,~A");c$.tokAtArray=k(c$,"tokAtArray",function(a,d){return a<d.length&&null!=d[a]?d[a].tok:0},"~N,~A");k(c$,"getPlotMinMax",function(a,d,b){if(null==a)return 0;switch(b){case 1111490568:case 1111490569:case 1111490570:return d?180:-180;case 1111490565:case 1111490576:return d?360:0;case 1111490574:return d?1:-1}b=d?-1E10:1E10;for(var c=a.length;0<=--c;){var e=a[c];Float.isNaN(e)||d==e>b&&(b=e)}return b},"~A,~B,~N");k(c$,
"parseDataArray",function(a,d){a=JU.Parser.fixDataString(a);var b=JU.Parser.markLines(a,"\n"),c=b.length;if(!d){for(var e=JU.AU.newFloat2(c),g=0,f=0;g<c;f=b[g++])f=JU.PT.getTokens(a.substring(f,b[g])),JU.PT.parseFloatArrayData(f,e[g]=K(f.length,0));return e}f=JU.PT.getTokens(a.substring(0,b[0]));if(3!=f.length)return K(0,0,0,0);var j=JU.PT.parseInt(f[0]),h=JU.PT.parseInt(f[1]),k=JU.PT.parseInt(f[2]);if(1>j||1>h||1>k)return K(1,1,1,0);for(var e=JU.AU.newFloat3(j,h),m=0,l=0,g=1,f=b[0];g<c&&m<j;f=b[g++])f=
JU.PT.getTokens(a.substring(f,b[g])),f.length<k||(JU.PT.parseFloatArrayData(f,e[m][l]=K(f.length,0)),++l==h&&(m++,l=0));return m!=j?(System.out.println("Error reading 3D data -- nX = "+j+", but only "+m+" blocks read"),K(1,1,1,0)):e},"~S,~B");k(c$,"getBitsetPropertyFloat",function(a,d,b,c,e){d=null==b?this.e.getBitsetProperty(a,d,null,null,null,null,!1,2147483647,!1):this.vwr.getDataObj(b,a,1);if(null==d||!JU.AU.isAF(d))return K(a.cardinality(),0);if(!Float.isNaN(c))for(a=0;a<d.length;a++)d[a]<c&&
(d[a]=NaN);if(!Float.isNaN(e))for(a=0;a<d.length;a++)d[a]>e&&(d[a]=NaN);return d},"JU.BS,~N,~S,~N,~N");T(c$,"ERROR_invalidArgument",22)})})(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);
