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