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