(function(da,ea,fa,ga,ha,ia,T,N,U,X,Y,F,Z,$,ja,O,L,Q,aa,ka,ba,la,ma,na,oa,pa,qa,A,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,p,ca){T("JS");U(null,"JS.ScriptExt",["JU.AU"],function(){var l=Y(function(){this.e=this.vwr=null;this.chk=!1;this.st=null;this.slen=0;X(this,arguments)},JS,"ScriptExt",null);p(l,"init",function(a){this.e=a;this.vwr=this.e.vwr;return this},"~O");p(l,"atomExpressionAt",function(a){return this.e.atomExpressionAt(a)},"~N");p(l,"checkLength",
function(a){this.e.checkLength(a)},"~N");p(l,"error",function(a){this.e.error(a)},"~N");p(l,"invArg",function(){this.e.invArg()});p(l,"invPO",function(){this.error(23)});p(l,"getShapeProperty",function(a,c){return this.e.getShapeProperty(a,c)},"~N,~S");p(l,"paramAsStr",function(a){return this.e.paramAsStr(a)},"~N");p(l,"centerParameter",function(a){return this.e.centerParameter(a,null)},"~N");p(l,"floatParameter",function(a){return this.e.floatParameter(a)},"~N");p(l,"getPoint3f",function(a,c){return this.e.getPoint3f(a,
c,!0)},"~N,~B");p(l,"intParameter",function(a){return this.e.intParameter(a)},"~N");p(l,"isFloatParameter",function(a){switch(this.e.tokAt(a)){case 2:case 3:return!0}return!1},"~N");p(l,"setShapeProperty",function(a,c,b){this.e.setShapeProperty(a,c,b)},"~N,~S,~O");p(l,"showString",function(a){this.e.showString(a)},"~S");p(l,"stringParameter",function(a){return this.e.stringParameter(a)},"~N");p(l,"getToken",function(a){return this.e.getToken(a)},"~N");p(l,"tokAt",function(a){return this.e.tokAt(a)},
"~N");p(l,"setShapeId",function(a,c,b){b&&this.invArg();c=this.e.setShapeNameParameter(c).toLowerCase();this.setShapeProperty(a,"thisID",c);return c},"~N,~N,~B");p(l,"getColorTrans",function(a,c,b,e){b=3.4028235E38;1765808134!=a.theTok&&--c;switch(this.tokAt(c+1)){case 1111490588: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");p(l,"finalizeObject",function(a,c,b,e,f,d,g,j){f&&this.setShapeProperty(a,"set",d);-2147483648!=c&&this.e.setShapePropertyBs(a,"color",Integer.$valueOf(c),j);3.4028235E38!=b&&this.e.setShapeTranslucency(a,"","translucent",b,j);0!=e&&this.setShapeProperty(a,"scale",Integer.$valueOf(e));0>g&&(g=-1-g,this.setShapeProperty(a,"token",Integer.$valueOf(1073742018)),this.setShapeProperty(a,"token",Integer.$valueOf(1073742046)));0<g&&(this.e.setMeshDisplayProperty(a,
g,0)||this.invArg())},"~N,~N,~N,~N,~B,~O,~N,JU.BS");p(l,"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]=L(e.size(),0);for(var f=c[b].length;0<=--f;)c[b][f]=e.get(f).intValue}return c},"~N");p(l,"getAllPoints",function(a,c){var b=null,e=null;try{switch(this.e.tokAt(a)){case 7:b=this.e.getPointArray(a,-1,!1,!0);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(!O(f,Exception))throw f;}(null==b||b.length<c)&&this.invArg();return b},"~N,~N");p(l,"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")});T("JS");U(["JS.ScriptExt"],"JS.CmdExt","java.util.Hashtable JU.AU $.BS $.Base64 $.Lst $.M3 $.M4 $.Measure $.P3 $.P4 $.PT $.Quat $.SB $.V3 J.api.Interface J.atomdata.RadiusData J.c.STER $.VDW J.i18n.GT JM.AtomCollection $.LabelToken $.Measurement $.Text JS.SV $.ScriptCompiler $.ScriptError $.ScriptEval $.ScriptInterruption $.ScriptMathProcessor $.ScriptParam $.T JU.BSUtil $.BoxInfo $.C $.Edge $.Elements $.Escape $.Logger $.Parser $.Point3fi $.SimpleUnitCell JV.FileManager $.JC $.StateManager $.Viewer".split(" "),
function(){var l=aa(JS,"CmdExt",JS.ScriptExt);$(l,function(){ba(this,JS.CmdExt,[])});ca(l,"dispatch",function(a,c,b){this.chk=this.e.chk;this.slen=this.e.slen;this.st=b;switch(a){case 4108:this.audio();break;case 1073741866:b[0].value=this.prepareBinaryOutput(b[0]);break;case 4098:this.assign(!1);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(!1);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 4156:this.sync();break;case 1814695966:this.unitcell(c?2:1,0);break;case 20489:this.varna();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");p(l,"audio",function(){var a=new java.util.Hashtable,c=null,b=null,b=null,e=this.e.iToken+1;if(1073742334==this.tokAt(e))this.checkLength(e+1),this.chk||this.vwr.sm.stopAudio(null);
else{for(;e<this.slen;e++)switch(this.tokAt(e)){case 1073741974:null!=c&&this.invArg();c=this.paramAsStr(++e);break;case 4:b=this.stringParameter(e);a.put("audioFile",b);break;case 1073741940:b=this.stringParameter(++e);c=this.addFilterAttribute(a,b,"id");this.addFilterAttribute(a,b,"loop");this.addFilterAttribute(a,b,"start");this.addFilterAttribute(a,b,"pause");this.addFilterAttribute(a,b,"play");this.addFilterAttribute(a,b,"ended");this.addFilterAttribute(a,b,"action");break;default:this.checkLength(e+
1),a.containsKey("action")&&this.invArg(),b=this.paramAsStr(e),a.put("autoclose",Boolean.FALSE),a.put("action",b)}!this.chk&&!a.isEmpty()&&(null==c&&(c="audio1"),a.put("id",c),this.vwr.sm.playAudio(a))}});p(l,"addFilterAttribute",function(a,c,b){c=JU.PT.getQuotedOrUnquotedAttribute(c,b);null!=c&&0<c.length&&a.put(b,c);return c},"java.util.Map,~S,~S");p(l,"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,null))}}});p(l,"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(O(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");p(l,"getBitsetIdent",function(a,c,b,e,f,d){return this.getBitsetIdentFull(a,c,e,f,d,null)},"JU.BS,~S,~O,~B,~N,~B");p(l,"getBitsetIdentFull",function(a,c,b,e,f,d){var g=!N(a,"JM.BondSet");g?null==c?c=this.vwr.getStandardLabelFormat(0):0==c.length&&(c="%[label]"):null!=c&&0==c.length?c="[%a1 #%i1] %4.3LENGTH [%a2 #%i2] #%#":"%U".equals(c)&&(c="");
var j=null==c?-1:c.indexOf("%"),h=2147483647!=e;if(null==a||this.chk||g&&0>j)return null==c&&(c=""),f?A(-1,[c]):c;var j=this.vwr.ms,m=0;null==JS.CmdExt.labeler&&(JS.CmdExt.labeler=j.getLabeler());b=g||!b?null:a.getAssociatedAtoms(j);var k=null==c||0==c.length,r=g||k?null:JS.CmdExt.labeler.getBondLabelValues();c=k?null:g?JS.CmdExt.labeler.compile(this.vwr,c,"\x00",null):JS.CmdExt.labeler.compile(this.vwr,c,"\u0001",r);var S=h?1:a.cardinality(),q=null!=d;q||(d=Array(S));var w=new JU.P3;for(e=h?e:a.nextSetBit(0);0<=
e;e=a.nextSetBit(e+1)){var n;if(g)n=k?j.at[e].getInfo():JS.CmdExt.labeler.formatLabelAtomArray(this.vwr,j.at[e],c,"\x00",b,w);else{n=j.bo[e];if(null==n)continue;n=k?n.getIdentity():JS.CmdExt.labeler.formatLabelBond(this.vwr,n,c,r,b,w)}n=JU.PT.formatStringI(n,"#",m+1);d[q?e:m]=n;m++;if(h)break}return 1==S&&!f?d[0]:d},"JU.BS,~S,~B,~N,~B,~A");p(l,"getLoadSymmetryParams",function(a,c,b){var e=this.e;this.chk=e.chk;this.slen=e.slen;var f=!1,d=null,g=this.tokAt(a);if(1073742332==g||8==g)d=e.getFractionalPoint(a),
g=this.tokAt(a=e.iToken+1);switch(g){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}g=null;if(null!=d){b.put("lattice",d);a=e.iToken+1;c.append(" "+JU.SimpleUnitCell.escapeMultiplier(d));a=this.checkPacked(a,0,b,c);if(1094713350==this.tokAt(a)){b.put("centroid",Boolean.TRUE);c.append(" CENTROID");var j=0;this.isFloatParameter(a+1)&&(--a,j=1073742080);
a=this.checkPacked(++a,j,b,c)}if(1073742163==this.tokAt(a)){c.append(" SUPERCELL ");if(e.isPoint3f(++a)){j=this.getPoint3f(a,!1);if(j.x!=F(j.x)||j.y!=F(j.y)||j.z!=F(j.z)||1>j.x||1>j.y||1>j.z)e.iToken=a,this.invArg();a=e.iToken}else j=this.stringParameter(a);c.append(JU.Escape.e(j));b.put("supercell",j);a=this.checkPacked(++a,0,b,c)}j=0;1073742114==this.tokAt(a)&&(a++,j=this.floatParameter(a++),c.append(" range "+j));b.put("symmetryRange",Float.$valueOf(j));var j=null,h,m=-2147483648;134217764==this.tokAt(a)&&
(++a,j=JU.PT.rep(this.paramAsStr(a++),"''",'"'),c.append(" spacegroup "+JU.PT.esc(j)),j.equalsIgnoreCase("ignoreOperators")?m=-999:(0==j.length?(h=this.vwr.getCurrentUnitCell(),null!=h&&(j=h.getSpaceGroupName())):0<=j.indexOf(",")&&9>d.x&&(9>d.y&&0==d.z)&&(j+="#doNormalize=0"),b.put("spaceGroupName",j),m=-2));d=null;if(1814695966==this.tokAt(a)){++a;h=e.optParameterAsString(a);0==h.length?(h=this.vwr.getCurrentUnitCell(),null!=h&&(d=h.getUnitCellAsArray(!0),g=h.getCartesianOffset())):4==this.tokAt(a)?
(d=Q(6,0),JU.SimpleUnitCell.setAbc(h,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==m&&(m=-1);a=e.iToken+1}-2147483648!=m&&b.put("spaceGroupIndex",Integer.$valueOf(m));f&&null==d&&null!=j&&JU.PT.parseInt(j)}f=!1;null==g&&1073742066==this.tokAt(a)&&(g=this.getPoint3f(++a,!0),f=e.coordinatesAreFractional);null!=g&&(f?(g.setT(e.fractionalPoint),
b.put("unitCellOffsetFractional",f?Boolean.TRUE:Boolean.FALSE),c.append(" offset {"+g.x+" "+g.y+" "+g.z+"/1}")):c.append(" offset "+JU.Escape.eP(g)),b.put("unitCellOffset",g),a=e.iToken+1);return a},"~N,JU.SB,java.util.Map");p(l,"checkPacked",function(a,c,b,e){0==c&&(c=this.tokAt(a));switch(c){case 1073741938:b.put("packed",Boolean.TRUE);var f=null;c=this.tokAt(++a);switch(c){case 1812599299:case 1814695966:case 4:break;default:this.e.isArrayParameter(a)?(f=this.e.getPointArray(a,-1,!1,!0),a=this.e.iToken):
this.isFloatParameter(a)?(f=this.floatParameter(a),f=A(-1,[new JU.P3,JU.P3.new3(f,f,f)])):(f=[],--a)}a++;if(this.e.chk)break;var d=!1;switch(c){case 4:case 1095241729:d=!0,a--;case 1814695966:f=this.e.optParameterAsString(a++).toLowerCase();if(d||JU.PT.isOneOf(f,";spin;conventional;primitive;rhombohedral;trigonal;")||0<=f.indexOf(",")&&0<=f.indexOf("a")&&0<=f.indexOf("b")&&0<=f.indexOf("c"))return b.put("fillRange",f),e.append(" FILL "+(d?"":"UNITCELL ")+'"'+f+'"'),a;f=this.vwr.getCurrentUnitCell();
if(null!=f){f=JU.BoxInfo.toOABC(f.getUnitCellVerticesNoOffset(),f.getCartesianOffset());break}case 1812599299:f=JU.BoxInfo.toOABC(this.vwr.ms.getBBoxVertices(),null)}switch(f.length){case 2:c=f[1];f=A(-1,[f[0],JU.P3.newP(f[0]),new JU.P3,new JU.P3]);f[1].x=c.x;f[2].y=c.y;f[3].z=c.z;break;case 3:f=A(-1,[new JU.P3,f[0],f[1],f[2]]);break;case 4:break;default:0!=c&&this.invArg(),f=A(-1,[new JU.P3,JU.P3.new3(10,0,0),JU.P3.new3(0,10,0),JU.P3.new3(0,0,10)])}b.put("fillRange",f);e.append(" FILL ["+f[0]+f[1]+
f[2]+f[3]+"]");break;case 1073742080:c=NaN,this.isFloatParameter(++a)&&(c=this.floatParameter(a++)),this.e.chk||(b.put("packed",Boolean.TRUE),e.append(" PACKED"),Float.isNaN(c)||(b.put("packingRange",Float.$valueOf(c)),e.append(" "+c)))}return a},"~N,~N,java.util.Map,JU.SB");p(l,"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()}});p(l,"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(null,b,null,null,null,null,1));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=A(-1,[a,null,b]),this.showString(f.getShapePropertyData(21,"symmetry",b)?b[1]:"")):(b=2==this.slen?this.vwr.bsA():this.atomExpressionAt(2),a=null,12289==this.tokAt(f.iToken)&&(a=f.centerParameter(f.iToken+1,null)),this.showString(this.vwr.ms.calculatePointGroup(b,
a))));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;a=this.vwr.getAnnotationParser(1111490587).calculateDSSRStructure(this.vwr,b);f.showString(a);this.vwr.notifyCalculation("dssr",
b,a);return;case 1073741915:c=!0;d=this.slen==f.iToken+1?-1:F(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?")});p(l,"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="",g=1073742070!=this.vwr.am.animationReplayMode,j=
1,h=this.tokAt(j),m=1111490588==h;m&&(h=this.tokAt(++j));var k=null;switch(0==h?h=102409:h){case 4:d=this.e.optParameterAsString(j++);if(0==d.length){e=102409;break}c=d.toLowerCase();c.endsWith(".gift")||c.endsWith(".pngt")?(m=!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";m&&(c+="T");h=d.indexOf("0000.");h=0>h||h!=d.lastIndexOf(".")-4;e=!1;528411==
this.tokAt(j)&&(g=!0,this.tokAt(++j));switch(this.tokAt(j)){case 134222850:k=this.stringParameter(++j);break;case 1073742129:e=!0;case 1095241729:a="y";g=!0;j++;e?(j<f&&2!=this.tokAt(j)&&(a=this.e.optParameterAsString(j++).toLowerCase()),k="rotate Y 10 10;rotate Y -10 -10;rotate Y -10 -10;rotate Y 10 10",f=j<f?this.intParameter(j++):5,k=0>f?JU.PT.rep(k,"10;",""+-f+";"):JU.PT.rep(k,"10",""+f)):(j<f&&(a=this.e.optParameterAsString(j++).toLowerCase()),k="rotate Y 360 30;");if(this.chk)return;this.vwr.setNavigationMode(!1);
if(""===a||0>"xyz".indexOf(a))a="y";k=JU.PT.rep(k,"Y",a);break;case 3:case 2:b=this.floatParameter(j++)}if(this.chk)return;if(null!=k){k="set waitformoveto true;"+k+";set waitformoveto "+this.vwr.g.waitForMoveTo;k="capture "+(m?"transparent ":"")+JU.PT.esc(d)+(g?" LOOP;":";")+k+";capture end;";this.e.cmdScript(0,null,k,null);return}e=1073742031;a=new java.util.Hashtable;m=this.vwr.getInt(553648132);h&&(a.put("streaming",Boolean.TRUE),g||this.showString(J.i18n.GT.o(J.i18n.GT.$("Note: Enable looping using the LOOP keyword just after the file name or {0}"),
A(-1,["ANIMATION MODE LOOP"]))),this.showString(J.i18n.GT.o(J.i18n.GT.$("Animation delay based on: {0}"),A(-1,["ANIMATION FPS "+m]))));a.put("captureFps",Integer.$valueOf(m));break;case 102409:case 1073741874:null!=a&&a.put("captureSilent",Boolean.TRUE);case 1073742335:case 1073742334:this.checkLength(-2);e=h;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()+Z(1E3*b))),a.put("captureMode",JS.T.nameOf(e).toLowerCase()),a.put("captureLooping",g?Boolean.TRUE:Boolean.FALSE),b=this.vwr.processWriteOrCapture(a),null==b&&(b="canceled"),JU.Logger.info(b))}});p(l,"centerAt",function(){var a=this.getToken(1).tok;switch(a){case 1073741826:case 96:case 1812599299: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)});p(l,"compare",function(){var a=this.e,c=!1,b=!1,e=!1,f=!1,d=!1,g=!1,j=null,h=null,m=null,k=null,r=null,S=null;a.iToken=0;var q=this.isFloatParameter(1)?this.floatParameter(++a.iToken):NaN,w=null,n=null,s=null,f=0;if(4115==this.tokAt(1))n=this.vwr.bsA();else if(n=this.atomExpressionAt(1),a.isArrayParameter(++a.iToken))w=a.getPointArray(a.iToken,
-1,!1,!0);else if(1153433601!=(f=this.tokAt(a.iToken))&&4115!=f)s=this.atomExpressionAt(a.iToken);var l=null,p=!1,u=!1,t=null,v=JU.BSUtil.copy(n);null!=s&&v.or(s);for(var y=null==w&&null!=s&&v.equals(n),v=y,R=1153433601==f,F=!1,x=a.iToken+1;x<this.slen;++x)switch(this.getToken(x).tok){case 4115:v=!0;null==s&&(s=JU.BSUtil.copy(n));break;case 134218757:if(p=!0,f=this.tokAt(x+1),4!=f&&1275203608!=f){t="*";break}case 134218756:t=(u=1275203608==this.tokAt(++x))?"polyhedra":this.stringParameter(x);if(t.equalsIgnoreCase("polyhedra")||
t.equalsIgnoreCase("polyhedron"))u=!0;break;case 1677721602:b=d=!0;t=this.paramAsStr(++x);t.equalsIgnoreCase("SMILES")&&(p=!0,1612709900==this.e.tokAt(x+1)?(t="H",x++):t="*");break;case 3:case 2:q=Math.abs(this.floatParameter(x));break;case 268436992:break;case 2109448:l=this.atomExpressionAt(++x);x=a.iToken;break;case 10:case 1073742325:null!=S&&this.invArg();m=this.atomExpressionAt(a.iToken);f=y?0:this.tokAt(a.iToken+1);k=null==w&&a.isArrayParameter(a.iToken+1)?null:10==f||1073742325==f?this.atomExpressionAt(++a.iToken):
JU.BSUtil.copy(m);null!=l&&(m.and(l),null!=k&&k.and(l));null==k?(f=a.iToken,w=a.getPointArray(a.iToken+1,-1,!1,!0),null==w?a.iToken=f:F=!0):null!=s&&k.and(s);null==r&&(r=new JU.Lst);r.addLast(A(-1,[m,null==k?w:k]));R&&(w=null);x=a.iToken;break;case 1275203608:p=u=!0;break;case 4125:break;case 7:null!=r&&this.invArg();c=!0;j=a.getQuaternionArray(a.theToken.getList(),1073742001);this.getToken(++x);h=a.getQuaternionArray(a.theToken.getList(),1073742001);null==S&&(S=new JU.Lst);S.addLast(A(-1,[j,h]));
break;case 1073742077:c=!0;break;case 1153433601:R=!0;c=!1;break;case 134217751:c=!1;break;case 1073742029:g=!0;break;case 528432:b=!0;break;case 4160:e=!0;break;default:this.invArg()}if(!this.chk){v&&(q=0);Float.isNaN(q)||0>q?q=1:!g&&(!b&&!e)&&(b=e=!0);f=0!=q;(R=!c&&null==t&&!u||null!=w)&&J.api.Interface.getInterface("JU.Eigen",this.vwr,"script");null==r&&null==S&&(u&&null==l&&(l=this.vwr.getAtomBitSet("polyhedra")),null==l?(m=R?this.vwr.getAtomBitSet("spine"):new JU.BS,0>m.nextSetBit(0)?(m=n,k=
s):(k=JU.BSUtil.copy(m),m.and(n),k.and(s))):(m=JU.BSUtil.copy(n),k=JU.BSUtil.copy(s),m.and(l),m.and(n),null!=k&&(k.and(l),k.and(s))),r=new JU.Lst,r.addLast(A(-1,[m,k])));y=null;if(v)for(var y=this.vwr.ms.getModelBS(n,!1),l=Array(y.cardinality()),x=0,G=y.nextSetBit(0);0<=G;G=y.nextSetBit(G+1),x++)l[x]=this.vwr.getModelUndeletedAtomsBitSet(G);else y=JU.BSUtil.newAndSetBit(0),l=A(-1,[n]);for(var z=0,G=y.nextSetBit(0);z<l.length;z++,G=y.nextSetBit(G+1)){var n=l[z],D=Q(2,0);if(v&&u&&0==z)s=n;else{var C=
null,I=new JU.Lst,K=null,M=v?new JU.Lst:r;if(!F)for(x=0;x<r.size();++x){var E=r.get(x);v&&M.addLast(E=A(-1,[JU.BSUtil.copy(E[0]),E[1]]));E[0].and(n)}var P=null,L=null;if(R){null!=w&&(M.clear(),M.addLast(A(-1,[m,w])));try{K=this.vwr.getCenterAndPoints(M,!g)}catch(T){if(O(T,Exception))this.invArg();else throw T;}if(!g){C=K[0].length-1;for(x=1;x<=C;x++){I=K[0][x];E=K[1][x];if(!N(I,"JM.Atom")||!N(E,"JM.Atom"))break;v||JU.Logger.info(" atom 1 "+I.getInfo()+"\tatom 2 "+E.getInfo())}C=JU.Measure.calculateQuaternionRotation(K,
D);x=Float.isNaN(D[1])?NaN:Math.round(100*D[0])/100;D=Float.isNaN(D[1])?NaN:Math.round(100*D[1])/100;this.showString("RMSD "+x+" --\x3e "+D+" Angstroms")}}else if(c){if(null==S)for(x=0;x<M.size();x++){E=M.get(x);j=this.vwr.getAtomGroupQuaternions(E[0],2147483647);h=this.vwr.getAtomGroupQuaternions(E[1],2147483647);for(C=0;C<j.length&&C<h.length;C++)I.addLast(h[C].div(j[C]))}else for(C=0;C<j.length&&C<h.length;C++)I.addLast(h[C].div(j[C]));D[0]=0;j=I.toArray(Array(I.size()));C=JU.Quat.sphereMean(j,
D,1E-4);this.showString("RMSD = "+D[0]+" degrees")}else{x=new JU.M4;P=new JU.P3;if(null!=n&&null!=t&&("H".equals(t)||"*".equals(t)||"".equals(t)))try{t=this.vwr.getSmilesOpt(null==m?n:m,-1,-1,32768|("H".equals(t)?4096:0),null)}catch(W){if(O(W,Exception))a.evalError(W.getMessage(),null);else throw W;}if(d){var U;if(null==n||null==s||null==(U=a.getSmilesExt().getFlexFitList(n,s,t,!p)))break;this.vwr.setDihedrals(U,null,1)}u?(D=JU.BS.copy(m),D.and(n),I=JU.BS.copy(k),I.and(s),D=a.getSmilesExt().mapPolyhedra(D.nextSetBit(0),
I.nextSetBit(0),p,x)):(this.showString("COMPARE using "+(p?"SMILES ":"SMARTS ")+t),E=new JU.Lst,D=new JU.Lst,D=a.getSmilesExt().getSmilesCorrelation(null==m?n:m,null==k?s:k,t,E,D,x,null,!1,null,P,!1,32|(p?1:2)));if(Float.isNaN(D)){this.showString("structures do not match from "+n+" to "+s);break}e&&(L=new JU.V3,x.getTranslation(L));b&&(C=new JU.M3,x.getRotationScale(C),C=JU.Quat.newM(C));this.showString("RMSD = "+D+" Angstroms");v&&(x=this.vwr.getV0abc(G,A(-1,[x])),null!=x&&this.vwr.ms.setModelCagePts(G,
x,null))}null!=K&&(P=K[0][0]);null==P&&(K=this.vwr.getCenterAndPoints(M,!0),P=K[0][0]);M=new JU.P3;I=NaN;if(g)I=1E10;else if(e&&(null==L&&(L=JU.V3.newVsub(K[1][0],P)),I=1E10),b&&(null==C&&a.evalError("option not implemented",null),M.add2(P,C.getNormal()),I=C.getTheta(),0==I&&e))if(0.01<L.length())I=1E10;else if(v)continue;else b=e=f=!1;if(!Float.isNaN(I)&&!Float.isNaN(M.x)){D=null;if(g){D=new JU.Lst;C=K[0].length;for(x=0;x<C;x++)D.addLast(K[1][x])}else b&&(e&&0!=q)&&(E=this.vwr.ms.getAtomPointVector(n),
x=JS.ScriptMathProcessor.getMatrix4f(C.getMatrix(),L),D=JS.ScriptParam.transformPoints(E,x,P));a.useThreads(!0)||(f=!1);if(this.vwr.rotateAboutPointsInternal(a,P,M,I/q,I,f,n,L,D,null,null,null,!1,g?K:null)&&f&&a.isJS)throw new JS.ScriptInterruption(a,"compare",1);}}}}});p(l,"configuration",function(){var a=null,c=this.chk?null: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{var c=-2147483648,
b=null;4==this.tokAt(1)?c=-1E3-(this.stringParameter(this.e.checkLast(1))+" ").codePointAt(0):2==this.tokAt(1)?c=this.intParameter(this.e.checkLast(1)):(b=a=this.atomExpressionAt(1),c=4==this.tokAt(this.e.iToken)?-1E3-(this.stringParameter(this.e.checkLast(this.e.iToken+1))+" ").codePointAt(0):this.intParameter(this.e.checkLast(this.e.iToken+1)));if(this.chk)return;this.vwr.addStateScript("configuration "+(null==b?"":JU.Escape.eBS(a)+" ")+c+";",!0,!1);a=this.vwr.ms.getConformation(this.vwr.am.cmi,
c,!0,b)}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.doReport(),!1)});p(l,"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;case 1113589787:this.chk||this.showMeasureCount(!0);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,g=this.vwr.ms.ac,c=null;try{c=this.vwr.getSmilesMatcher().getCorrelationMaps(f,d,g,this.vwr.bsA(),2)}catch(j){if(O(j,Exception))a.evalError(j.getMessage(),null);else throw j;}if(null==c)return;this.setShapeProperty(6,"maps",c);return}switch(this.slen){case 2:switch(this.getToken(1).tok){case 0:case 1073742335:this.vwr.shm.loadShape(6);this.setShapeProperty(6,"hideAll",Boolean.FALSE);return;case 1073742001:this.chk||a.showStringPrint(this.vwr.getMeasurementInfoAsString(),
!1);return;case 4:this.setShapeProperty(6,"setFormats",this.stringParameter(1));return}a.errorStr(24,"ON, OFF, DELETE");break;case 3:switch(this.getToken(1).tok){case 12291:if(1073742327==this.getToken(2).tok)this.chk||this.vwr.clearAllMeasurements();else{var h=this.intParameter(2)-1;this.chk||this.vwr.deleteMeasurement(h)}return}}for(var m=0,k=0,r=-1,l=-1,q=-1,w=L(5,0),n=Q(-1,[3.4028235E38,3.4028235E38]),s=!1,p=!1,B=!1,u=!0,t=!1,v=null,y=null,f=268438018,A=d=null,V=g=null,x=new JU.Lst,t=new JU.BS,
G=null,z=null,D=null,C=0,I=0,K=NaN,M=null,h=1;h<this.slen;++h)switch(this.getToken(h).tok){default:this.error(15);break;case 1073741974:1!=h&&this.invArg();c=a.optParameterAsString(++h);continue;case 1073741824:a.errorStr(24,"ALL, ALLCONNECTED, DELETE");break;case 1275082241:f=1275082241;if(1073742327==this.tokAt(h+1)&&this.slen==h+2){this.chk||(this.vwr.setShapeProperty(6,"selectall",null),this.showMeasureCount(!0));return}break;case 1113589787:(0<x.size()||0<C||null!=c)&&this.invArg();f=1275082241;
if(this.chk)G=new JU.BS;else if(G=this.vwr.getShapeProperty(6,"selected"),0==G.cardinality())return;s=!0;break;case 268439040:134217736!=this.tokAt(h+1)&&this.invArg();h++;B=!0;break;case 1073741832:M=this.paramAsStr(++h).toLowerCase();break;case 134217736:case 1073741834:case 1073742327:p=1073741834==a.theTok;l=-1;s=!0;p&&B&&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=Q(-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:I=F((1665140738==a.theTok?2E3:1E3)*this.floatParameter(++h));null!=c&&0>=I&&(I=-1);break;case 3:null!=v&&this.invArg();u=s=!0;q=(q+1)%2;n[q]=this.floatParameter(h);break;case 12291:268438018!=f&&1275082241!=f&&this.invArg();f=12291;break;case 4114:var E=this.floatParameter(++h),P=this.paramAsStr(++h),T=this.paramAsStr(++h);this.chk||(V=this.vwr.getFont3D(P,T,E));break;case 2:E=this.intParameter(h);if(s)u=!0,q=(q+1)%
2,n[q]=E;else{l=this.vwr.ms.getFirstAtomIndexFromAtomNumber(E,this.vwr.getVisibleFramesBitSet());if(!this.chk&&0>l)return;null!=z&&this.invArg();4<(w[0]=++m)&&a.bad();w[m]=l}break;case 1094713359:r=this.intParameter(++h);break;case 1073742334:268438018!=f&&this.invArg();f=1073742334;break;case 1073742335:268438018!=f&&this.invArg();f=1073742335;break;case 1073742114:u=s=!0;l=-1;break;case 1073741989:case 1073741990:y=Boolean.$valueOf(1073741989==a.theTok);s=!0;B=1073741990==a.theTok;break;case 1648363544:0<=
q&&this.invArg();v=a.encodeRadiusParameter(h,!1,!0);if(null==v)return;v.values=n;h=a.iToken;s=B=!0;y=Boolean.$valueOf(!1);1==C&&(C++,m++,E=JU.BSUtil.copy(t),JU.BSUtil.invertInPlace(E,this.vwr.ms.ac),E.and(this.vwr.ms.getAtomsWithinRadius(5,t,!1,null,null)),x.addLast(E));break;case 12290:case 10:case 1073742325:C++;case 1073742332:case 8:case 1073742330:(0<=l||null!=G)&&this.invArg();m=Array(1);z=a.centerParameter(h,m);if(N(m[0],"JU.BS")&&(z=t=m[0],!this.chk&&0==t.length()))return;N(z,"JU.P3")&&(z=
JU.Point3fi.newPF(z,r));4<(m=++k)&&a.bad();h=a.iToken;x.addLast(z);break;case 1715472409:A=this.paramAsStr(h);break;case 1073742188:K=this.floatParameter(++h);break;case 4:E=this.stringParameter(h);JM.Measurement.isUnits(E)||E.equals("default")?g=E:d=E;break;case 1073742164:D=a.tickParamAsStr(h,!1,!0,!0),h=a.iToken,f=12290}(null!=v&&(0<=q||2!=m)||1275082241!=f&&null==G&&2>m&&null==c&&(null==D||1==m))&&a.bad();null!=d&&0!=d.indexOf(m+":")&&(d=m+":"+d);u&&n[1]<n[0]&&(n[1]=n[0],n[0]=3.4028235E38==n[1]?
3.4028235E38:-200);if(!this.chk)if(t=null!=c&&null==z&&268438018==f,null!=z||null!=G||null!=D||t){null==v&&(v=new J.atomdata.RadiusData(n,0,null,null));null!=D&&(D.id="default");if(t)f=266284;else if(null!=z&&(null!=A||null!=d)&&268438018==f)f=12290;a=null;if(null!=V||null!=M||0!=b||null!=d&&(t||0<=d.indexOf("\n")))a=JM.Text.newMeasure(this.vwr,V,b);null!=a&&(a.setPymolOffset(e),a.setAlignmentLCR(M));this.setShapeProperty(6,"measure",this.vwr.newMeasurementData(c,x).set(f,null,v,A,d,g,D,p,B,y,s,I,
b,a,K,G));1275082241==f&&this.showMeasureCount(!1)}else switch(a=null==c?w: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&&null==g?"toggle":"toggleOn",a),null!=d&&this.setShapeProperty(6,"setFormats",d)}});p(l,"showMeasureCount",function(a){var c=this.vwr.getShapeProperty(6,"selected"),b=c.cardinality();if(a)for(a=c.nextSetBit(0);0<=a;a=
c.nextSetBit(a+1))this.showString(this.vwr.shm.getShape(6).getInfoAsString(a));this.showString(b+(1==b?" measure":" measures")+" selected")},"~B");p(l,"connect",function(a){var c=this.e,b=Q(2,0),e=Array(2);e[0]=e[1]=this.vwr.bsA();var f=NaN,d=L(-1,[-2147483648]),g=0,j=131071,h=1073742026,m=!1,k=!1,r=!1,l=3.4028235E38,q=!1,w=0,n=0,s=new JU.BS,p=!1,B=0,u=0,t=0,v=!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<w){(k||q)&&c.error(23);j=JU.Edge.getBondOrderFromFloat(this.floatParameter(a));131071==j&&this.invArg();k=!0;break}2<++n&&c.bad();var y=this.floatParameter(a);268441090==this.tokAt(a+1)&&(y=-y/100,a++);b[g++]=y;break;case 12290:case 10:case 1073742325:(2<w||p&&0<w)&&c.bad();(k||q)&&this.invArg();e[w++]=this.atomExpressionAt(a);
p=c.isBondSet;if(2==w){for(var y=c.iToken,R=a;R<y;R++)if(1073741824==this.tokAt(R)&&this.paramAsStr(R).equals("_1")){B=a;break}c.iToken=y}a=c.iToken;break;case 1086324742:v=!0;break;case 1765808134:case 1111490588:case 1073742074:q=!0;l=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,null);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 1073741852:case 1073741904:case 1073742025:case 1073742026:r=!0;++a!=this.slen&&this.invArg();h=c.theTok;1073741852==h&&!(131071==j||2048==j||515==j)&&this.invArg();break;case 659482:q||(d[0]=16777215,l=0.5,
f=this.vwr.getFloat(570425406),q=!0),r||(h=1073742026,r=!0);case 1073741824:if(c.isColorParam(a)){u=-a;break}case 1075838996:case 1613238294:j=this.paramAsStr(a);131071==(j=JU.Edge.getBondOrderFromString(j))&&this.invArg();k&&c.error(18);k=!0;switch(j){case 33:switch(this.tokAt(a+1)){case 3:j=JU.Edge.getPartialBondOrderFromFloatEncodedInt(this.st[++a].intValue);break;case 2:j=this.intParameter(++a)}break;case 2048:2==this.tokAt(a+1)&&(j=this.intParameter(++a)<<11,t=this.floatParameter(++a));break;
case 65537:r||(h=1073742025,r=!0)}break;case 1665140738:f=this.floatParameter(++a);q=!0;break;case 1073742333:++a!=this.slen&&this.invArg();case 12291:h=12291;m=!0;q=!1;break;default:u=a}0<a&&(u==-a||u==a&&c.isColorParam(a)?(q=!0,d[0]=c.getArgbParam(a),a=c.iToken):u==a&&this.invArg())}if(!this.chk){2>g&&(0==g&&(b[0]=1E8),b[1]=b[0],b[0]=0.1);q&&(k||(j=65535),r||(h=1073742025));k=g=0;if(0<B){t=new JU.BS;this.vwr.definedAtomSets.put("_1",t);v=e[0];for(r=v.nextSetBit(0);0<=r;r=v.nextSetBit(r+1))t.set(r),
e=this.vwr.makeConnections(b[0],b[1],j,h,t,this.atomExpressionAt(B),s,p,!1,0),g+=Math.abs(e[0]),k+=e[1],t.clear(r)}else e=this.vwr.makeConnections(b[0],b[1],j,h,e[0],e[1],s,p,v,t),g+=Math.abs(e[0]),k+=e[1];b=c.doReport();m?b&&c.report(J.i18n.GT.i(J.i18n.GT.$("{0} connections deleted"),k),!1):(q&&(this.vwr.selectBonds(s),Float.isNaN(f)||c.setShapeSizeBs(1,Math.round(2E3*f),null),this.finalizeObject(1,d[0],l,0,!1,null,0,s),this.vwr.selectBonds(null)),b&&c.report(J.i18n.GT.o(J.i18n.GT.$("{0} new bonds; {1} modified"),
A(-1,[Integer.$valueOf(g),Integer.$valueOf(k)])),!1))}}},"~N");p(l,"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()}});p(l,"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=L(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 g=JU.PT.getTokens(b);if(0==f.indexOf("property_")&&!(2==g.length&&g[1].equals("set"))){d=this.vwr.bsA();a[0]=f;var j=e?0:this.vwr.getP("propertyAtomNumberField").intValue(),h=e?0:this.vwr.getP("propertyAtomNumberColumnCount").intValue(),m=e?-2147483648:this.vwr.getP("propertyDataField").intValue(),k=e?0:this.vwr.getP("propertyDataColumnCount").intValue();
!e&&0<=b.indexOf(" ")&&(3==g.length&&(j=JU.PT.parseInt(g[1]),m=JU.PT.parseInt(g[2])),5==g.length&&(j=JU.PT.parseInt(g[1]),h=JU.PT.parseInt(g[2]),m=JU.PT.parseInt(g[3]),k=JU.PT.parseInt(g[4])));0>j&&(j=0);0>m&&(m=0);b=this.vwr.ms.ac;e=null;g=JU.BS.newN(b);if(0<j){for(var e=L(b+2,0),r=0;r<=b;r++)e[r]=-1;for(r=d.nextSetBit(0);0<=r;r=d.nextSetBit(r+1)){var l=this.vwr.ms.at[r].getAtomNumber();l>b+1||(0>l||g.get(l))||(g.set(l),e[l]=r)}a[2]=e}else a[2]=JU.BSUtil.copy(d);a[1]=c;a[3]=Integer.$valueOf(0);this.vwr.setData(f,
a,b,j,h,m,k)}else"occupany".equals(f)&&(f="occupancy"),j=JM.AtomCollection.getUserSettableType(f),-1<j?this.vwr.setAtomData(j,f,c,d):(a[0]=b,a[1]=c,a[3]=Integer.$valueOf(0),this.vwr.setData(f,a,0,0,0,0,0))}}});p(l,"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 268441089: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=L(-1,[-2147483648]);++b<this.slen;){var f=this.paramAsStr(b),g=null;this.getToken(b);if(!d)switch(a.theTok){case 1073742330:f="points";g=Array(3);g[0]=a.objectNameParameter(++b);if(this.chk)continue;a.getShapePropertyData(24,"getVertices",g);break;case 1825200146:g=this.e.optParameterAsString(++b);
if(0==g.length)continue;break;case 1611272194:var g=Array(3),j=null;switch(this.getToken(b+1).tok){case 11:for(var b=a.theToken.value,h=3;0<=--h;)b.getColumnV(h,g[h]=new JU.V3);break;case 1073742195:b+=2;case 268437504:j=new JU.Lst;for(h=3;0<=--h;){switch(this.tokAt(++b)){case 268437504:break;default:a.isCenterParameter(b)?j.addLast(JS.SV.newV(8,this.centerParameter(b))):268437504!=this.tokAt(b)&&j.addLast(this.getToken(b))}b=a.iToken}268437505!=this.getToken(++b).tok&&this.invArg();break;case 7:j=
a.theToken.getList();switch(j.size()){case 1:j=new JU.Lst;for(h=3;0<=--h;)j.addLast(this.getToken(++b));break;case 3:break;default:this.invArg()}break;default:for(h=0;3>h;h++)g[h]=new JU.V3,g[h].setT(this.centerParameter(++b)),b=a.iToken}if(null!=j)for(b=3;0<=--b;)switch(h=j.get(b),h.tok){case 7:g[b]=JU.V3.new3(JS.SV.fValue(h.getList().get(0)),JS.SV.fValue(h.getList().get(1)),JS.SV.fValue(h.getList().get(2)));break;case 8:g[b]=JU.V3.newV(h.value)}b=a.iToken;break;case 12289:g=this.centerParameter(++b);
b=a.iToken;break;case 1094713359:g=Integer.$valueOf(this.intParameter(++b));break;case 12291:g=Boolean.TRUE,this.checkLength(b+1)}if(null==g)switch(a.theTok){case 1073742335:f="on";g=Boolean.TRUE;break;case 1073742334:f="on";g=Boolean.FALSE;break;case 536875059:this.isFloatParameter(b+1)?g=Float.$valueOf(this.floatParameter(++b)):a.isCenterParameter(b)?(b=this.centerParameter(b),g=Q(-1,[b.x,b.y,b.z])):g=a.floatParameterSet(++b,3,3);b=a.iToken;break;case 12290:case 10:case 1073742325:f="atoms";g=this.atomExpressionAt(b);
b=a.iToken;break;case 1765808134:case 1111490588:case 1073742074:e=this.getColorTrans(a,b,!0,c);b=a.iToken;continue;case 1073742075:g=this.paramAsStr(++b)}null==g&&this.invArg();this.setShapeProperty(20,f.toLowerCase(),g)}this.finalizeObject(20,c[0],e,0,!1,null,0,null);this.setShapeProperty(20,"thisID",null)}else a.setShapeSizeBs(20,c,null)});p(l,"image",function(){this.chk||this.vwr.getConsole();var a=1,c=null;1073741974==this.tokAt(1)&&(c=this.e.optParameterAsString(++a),a++);var b=null,e=this.e.optParameterAsString(this.slen-
1).equalsIgnoreCase("close");switch(this.tokAt(a)){case 15:e&&this.invArg();b=this.getToken(a).value.data;break;case 6:e&&this.invArg();b=this.getToken(a).getMap();break;case 4:case 0:if(b=this.e.optParameterAsString(a),!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);return}}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"+("string"==typeof b?b:"")+"\u0001"+("".equals(c)||null==c?null:c),!1)});p(l,"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 1153433601: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,null)}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)});p(l,"mapProperty",function(){for(var a,c,b,e,f,d=0,g=0,j=0,h=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(++h.iToken)||!JS.T.tokAttr(d=this.tokAt(++h.iToken),1077936128))break;b=this.paramAsStr(h.iToken);
c=this.atomExpressionAt(++h.iToken);if(1073742336!=this.tokAt(++h.iToken)||!JS.T.tokAttr(g=this.tokAt(++h.iToken),2048))break;e=this.paramAsStr(h.iToken)}f=JS.T.tokAttr(j=this.tokAt(h.iToken+1),1077936128)?this.paramAsStr(++h.iToken):JS.T.nameOf(j=1094715393);h.checkLast(h.iToken);if(this.chk)return;var m=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(g,1094713344,1111490560)&&JS.T.tokAttrOr(j,1094713344,1111490560)){var k=h.getBitsetPropertyFloat(a,d|224,null,NaN,NaN),r=h.getBitsetPropertyFloat(a,j|224,null,NaN,NaN),d=h.getBitsetPropertyFloat(c,j|224,null,NaN,NaN),l=1715472409==g,q=Q(l?this.vwr.ms.ac:d.length,0),m=new JU.BS;if(k.length==r.length){for(var w=new java.util.Hashtable,j=0;j<k.length;j++)w.put(Float.$valueOf(r[j]),Float.$valueOf(k[j]));k=-1;for(j=r=0;j<d.length;j++){var k=c.nextSetBit(k+1),n=w.get(Float.$valueOf(d[j]));
null!=n&&(m.set(k),q[l?k:r]=n.floatValue(),r++)}l?this.vwr.setData(e,A(-1,[e,q,m,Integer.$valueOf(1),Boolean.TRUE]),this.vwr.ms.ac,0,0,2147483647,0):JS.T.tokAttr(g,2048)?this.vwr.setAtomProperty(m,g,0,0,null,q,null):this.error(56)}}if(null==m){b=this.getBitsetIdent(a,"{"+f+"=%["+f+"]}."+e+" = %["+b+"]",null,!1,2147483647,!1);a=new JU.SB;for(j=0;j<b.length;j++)0>b[j].indexOf("null")&&a.append(b[j]).appendC("\n");JU.Logger.debugging&&JU.Logger.debug(a.toString());b=JU.BSUtil.copy(this.vwr.slm.bsSubset);
this.vwr.slm.setSelectionSubset(c);try{h.runScript(a.toString())}catch(s){if(O(s,Exception))c=s,this.vwr.slm.setSelectionSubset(b),h.errorStr(-1,"Error: "+c.getMessage());else if(O(s,Error))c=s,this.vwr.slm.setSelectionSubset(b),h.errorStr(-1,"Error: "+c.toString());else throw s;}this.vwr.slm.setSelectionSubset(b)}this.showString("DONE");return}this.invArg()});p(l,"minimize",function(a){for(var c=null,b=2147483647,e=0,f=!1,d=!1,g=null,j=!1,h=!1,m=this.vwr.getMinimizer(!1),k=0,r=a?2:1;r<this.slen;r++)switch(this.getToken(r).tok){case 1073741905:e=
this.floatParameter(++r);continue;case 1073742114:k=this.floatParameter(++r);continue;case 1073741935:b=0;continue;case 1073741874:case 1073742162:this.checkLength(2);if(this.chk||null==m)return;m.setProperty(this.paramAsStr(r),null);return;case 1073741882:this.checkLength(2);if(this.chk||null==m)return;m.setProperty("clear",null);return;case 1073741894:1!=r&&this.invArg();c=a=0;b=L(5,0);if(1073741882==this.tokAt(++r))this.checkLength(3);else{for(;4>a&&!this.isFloatParameter(r);)b[++a]=this.atomExpressionAt(r).nextSetBit(0),
r=this.e.iToken+1;b[0]=a;1==a&&this.invArg();c=this.floatParameter(this.e.checkLast(r))}this.chk||this.vwr.getMinimizer(!0).setProperty("constraint",A(-1,[b,Float.$valueOf(c)]));return;case 12293:1!=r&&this.invArg();if(this.slen==++r){this.chk||(r=this.vwr.getMinimizer(!0).getProperty("fixed",0),null==r?this.e.showString("no atoms are fixed for minimization"):(a=r.cardinality(),this.e.showString(a+(1==a?" atom is":" atoms are")+" fixed for minimization: "+r+"\nunfix them with MINIMIZE FIX NONE")));
return}g=this.atomExpressionAt(r);0>g.nextSetBit(0)&&(g=null);r=this.e.iToken;this.chk||this.vwr.getMinimizer(!0).setProperty("fixed",g);if(r+1==this.slen)return;continue;case 1073741828:f=!0;continue;case 1073742072:case 1113589787:j=!0;break;case 1086324742:h=!0;break;case 1073742148:d=!0;break;case 266298:b=this.intParameter(++r);continue;case 10:case 1073742325:j=!0;case 1275082241:1275082241==this.e.theTok&&r++;c=this.atomExpressionAt(r);r=this.e.iToken;1073742072==this.tokAt(r+1)&&(r++,j=!0);
continue;default:this.invArg()}a&&(f||j||h)&&this.invArg();if(!this.chk)try{this.vwr.minimize(this.e,b,e,c,g,null,k,(f?16:0)|(a?256:0)|(j?32:0)|(h?64:0)|(d?1:0))}catch(l){if(O(l,Exception))throw new JS.ScriptInterruption(this.e,"minimize",1);throw l;}},"~B");p(l,"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 g=c.theToken.value.toString();d++;g.equalsIgnoreCase("t")?c.theTok=3:g.equalsIgnoreCase("m")||g.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 536875059: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))});p(l,"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 268437504: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 268441089:c=this.vwr.getFrameAtoms(),a=++this.e.iToken}if(!this.chk&&null!=c){c.and(this.vwr.getFrameAtoms());var g=c.nextSetBit(0);0>g&&this.invArg();g=this.vwr.ms.at[g].mi;if(this.vwr.ms.isTrajectory(g)||!this.vwr.ms.am[g].isBioModel)return}null==
e&&(e=this.e.optParameterAsString(a));this.e.checkLast(a);!d&&!this.vwr.ms.haveBioModels&&this.invArg();if(!this.chk){a=e.startsWith("~");if(!a&&!d&&(0<=e.indexOf(".")||0>e.indexOf("-")&&3<e.length&&e.startsWith("==")))d=A(-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&&(c=this.vwr.getJBR().getBioModelSet(this.vwr.ms).mutate(c,e,d,b,f),null!=c&&this.e.showString(c))}});p(l,"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(A(-1,[Integer.$valueOf(554176526),Float.$valueOf(d),Float.$valueOf(e)]));continue;case 12289:e=this.centerParameter(++f);f=a.iToken;this.chk||b.addLast(A(-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(A(-1,[Integer.$valueOf(528432),Float.$valueOf(d),c,Float.$valueOf(e)]));continue;case 4160:var g=e=NaN;if(this.isFloatParameter(++f))e=this.floatParameter(f),g=this.floatParameter(++f);else switch(this.tokAt(f)){case 1111492629:e=this.floatParameter(++f);break;case 1111492630:g=this.floatParameter(++f);break;default:e=this.centerParameter(f);f=a.iToken;this.chk||b.addLast(A(-1,[Integer.$valueOf(4160),
Float.$valueOf(d),e]));continue}this.chk||b.addLast(A(-1,[Integer.$valueOf(268441090),Float.$valueOf(d),Float.$valueOf(e),Float.$valueOf(g)]));continue;case 268441088:continue;case 1112152078:e=new JU.Lst;a.isAtomExpression(f+1)?(g=this.atomExpressionAt(++f),f=a.iToken):g=this.vwr.bsA();if(this.chk)return;this.vwr.getPolymerPointsAndVectors(g,e);var j;if(0<(j=e.size())){for(var g=Array(j),h=0;h<j;h++)g[h]=e.get(h);b.addLast(A(-1,[Integer.$valueOf(1112152078),Float.$valueOf(d),g]));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();g=F(this.isFloatParameter(f+1)?this.floatParameter(++f):0);j=F(this.isFloatParameter(f+1)?this.floatParameter(++f):2147483647);b.addLast(A(-1,[Integer.$valueOf(1073742084),Float.$valueOf(d),e,null,L(-1,[g,j])]));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(A(-1,[Integer.$valueOf(1073742084),Float.$valueOf(d),e,null,L(-1,[0,2147483647])]));continue}default:this.invArg()}}!this.chk&&(!this.vwr.isJmolDataFrame()&&!this.vwr.is2D())&&this.vwr.tm.navigateList(a,b)}});p(l,"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=!1,g=!0,j=!1,h=this.st;f&&(c.st=this.st=a);var m=f?134222350:a[0].tok,
k=f||134221850==m||4138==m?0:1,r=null,l=!0,q=!1,w=!1;switch(m){case 4133:case 134221850:case 4138:if(j=1275069447==this.tokAt(e))c.slen=this.slen=e--;break;case 135176:l=!1;q=!0;break;case 134222350:g=l=!1;break;case 134221856:l=!1,4==JS.CmdExt.tokAtArray(e,a)?r=this.stringParameter(e--):1073742336==JS.CmdExt.tokAtArray(e-1,a)?(r=this.paramAsStr(e-2)+"."+this.paramAsStr(e),e-=3):(c.st=this.st=h,c.iToken=this.st.length,this.error(13)),c.slen=this.slen=e+1}var n=f="",s="",p=!1,B=!1,u=!1,t=Array(4),
v=L(4,0),y=JU.BSUtil.copy(this.vwr.bsA()),A="; select "+JU.Escape.eBS(y)+";\n ",u=c.optParameterAsString(e).toLowerCase(),F=null,x=null,G=null,z=JS.CmdExt.tokAtArray(k,a);4==z&&(z=JS.T.getTokFromName(a[k].value));switch(z){default:c.iToken=1;this.invArg();break;case 134221834:c.iToken=1;u="data";A="";break;case 1073741872:u="brillouin";0>y.nextSetBit(0)&&(y=this.vwr.getModelUndeletedAtomsBitSet(b));break;case 1095241729:if(!this.chk){u="spin";w=1275068447==this.tokAt(k+1);v[0]=1111492626;v[1]=1111492627;
v[2]=1111492628;v[3]=1095241729;t[0]="spinX";t[1]="spinY";t[2]="spinZ";t[3]="spin";y=this.vwr.fm.getJmolDataReader().getPlotSpinSet(this.vwr,y,b,F=new JU.P3,x=new JU.P3);if(null==y||0==y.cardinality())return null;a=this.vwr.ms.getJmolDataFrameInt(b,1095241729);0<=a&&this.vwr.deleteModels(a,null);this.vwr.setSelectionSet(y)}break;case 1715472409:c.iToken=k+1;for(u=0;3>u;u++){switch(this.tokAt(c.iToken)){case 4:v[u]=JS.T.getTokFromName(c.getToken(c.iToken).value);break;default:v[u]=this.tokAt(c.iToken);
break;case 0:0==u&&this.invArg();case 1287653388:case 32:case 64:u=2;continue}1715472409!=v[u]&&!JS.T.tokAttr(v[u],1077936128)&&this.invArg();t[u]=this.getToken(c.iToken).value.toString();c.iToken++}1287653388==this.tokAt(c.iToken)&&(G=this.stringParameter(++c.iToken),g=!1,c.iToken++);32==this.tokAt(c.iToken)&&(F=this.getPoint3f(++c.iToken,!1),c.iToken++);64==this.tokAt(c.iToken)&&(x=this.getPoint3f(++c.iToken,!1),c.iToken++);u="property "+t[0]+(null==t[1]?"":" "+t[1])+(null==t[2]?"":" "+t[2]);0>
y.nextSetBit(0)&&(y=this.vwr.getModelUndeletedAtomsBitSet(b));n="select "+JU.Escape.eBS(y)+";\n ";break;case 4138:u.equalsIgnoreCase("draw")&&(u=c.optParameterAsString(--e).toLowerCase());u=e>k&&u.startsWith("r");u="ramachandran"+(u?" r":"")+(135176==m?" draw":"");break;case 134221850:case 136314895:f=' "'+this.vwr.getQuaternionFrame()+'"';n="set quaternionFrame"+f+";\n  ";d=!0;u.equalsIgnoreCase("draw")&&(q=!0,u=c.optParameterAsString(--e).toLowerCase());B=(p=u.startsWith("deriv")||u.startsWith("diff"))&&
0<u.indexOf("2");p&&e--;if(u.equalsIgnoreCase("helix")||u.equalsIgnoreCase("axis"))p=q=!0,e=-1;u=((e<=k?"":c.optParameterAsString(e))+"w").substring(0,1);if(u.equals("a")||u.equals("r"))p=!0;JU.PT.isOneOf(u,";w;x;y;z;r;a;")||c.evalError("QUATERNION [w,x,y,z,a,r] [difference][2]",null);u="quaternion "+u+(p?" difference":"")+(B?"2":"")+(q?" draw":"")}this.st=h;if(this.chk)return"";if(l&&(j&&(s+=" split"),n+="plot "+u+s,h=this.vwr.ms.getJmolDataFrameIndex(b,n),0<h&&134221856!=m&&134222350!=m))return this.vwr.setCurrentModelIndexClear(h,
!0),"";h=this.vwr.fm.getJmolDataReader();g=1715472409==z||1095241729==z?h.getJmolDataFrameProperties(c,z,v,t,y,F,x,G,g):null;if(134221856==m)return this.vwr.writeFileData(r,"PLOT_"+u,b,g);switch(u.substring(0,4)){case "data":g="1 0 H 0 0 0 # Jmol PDB-encoded data";break;default:g=this.vwr.getPdbData(b,u,null,g,null,!0)}if(134222350==m)return g;JU.Logger.debugging&&JU.Logger.debug(g);if(135176==m)return c.runScript(g),"";m=this.vwr.fm.getFileInfo();r=this.vwr.getBoolean(603979792);this.vwr.g.appendNew=
!0;g=null!=g&&null==this.vwr.openStringInlineParamsAppend(g,null,!0);this.vwr.g.appendNew=r;this.vwr.fm.setFileInfo(m);if(!g)return"";m=this.vwr.ms.mc;h.setJmolDataFrame(this.vwr.ms,n,b,m-1);1715472409!=z&&(n+=";\n"+A);n=this.vwr.addStateScript(n,!0,!1);b=h.getJmolDataFrameScripts(this.vwr,z,b,m,u,f,t,w);c.runScript(b[0]+A);n.setModelIndex(this.vwr.am.cmi);switch(z){case 1715472409:case 4138:case 134221850:case 136314895:case 1095241729:A=180;break;default:A=10}this.vwr.setRotationRadius(A,!0);c.sm.loadShape(31);
null!=b[1]&&c.runScript(b[1]);j&&(j=this.vwr.getP("_modelNumber"),c.runScript("frame 1.1 "+j+" split;"));this.showString("frame "+this.vwr.getModelNumberDotted(this.vwr.ms.mc-1)+(0<u.length?" created: "+u+(d?f:""):""));return""},"~A");p(l,"polyhedra",function(){var a=this.e,c=1==this.slen,b=!1,e=c,f=!1,d=!1,g=!1,j=NaN,h=0;a.sm.loadShape(21);this.setShapeProperty(21,"init",Boolean.TRUE);var m=3.4028235E38,k=-1,r=L(-1,[-2147483648]),l=-1,q=-1,p=null,n=0,s=null,H=!1,B=!1,u=null,t=null;if(2==this.slen&&
1073742001==this.tokAt(1))this.chk||a.showStringPrint(this.getShapeProperty(21,"list"),!1);else{for(var v=1;v<this.slen;++v){var y=null,u=null;switch(this.getToken(v).tok){case 1073742197:j=NaN;case 1073741872:a=1073742197==this.e.theTok?-1:2==this.tokAt(v+1)?this.intParameter(++v):1;8<a&&this.invArg();this.chk||J.api.Interface.getInterface("JU.BZone",this.vwr,"script").createBZ(this.vwr,a,null,!1,s,j,n,p);return;case 6:y="info";u=this.e.theToken.value;e=!0;break;case 134217751:y="points";u=Float.$valueOf(1073742334==
this.tokAt(++v)?0:this.e.floatParameter(v));H=!0;break;case 536875059:j=this.floatParameter(++v);H=!0;continue;case 1814695966:null!=s&&this.invArg();y="unitCell";u=Boolean.TRUE;e=!0;break;case 1073742072:this.e.restrictSelected(!1,!1),a.theTok=1073742335;case 1073742335:case 12291:case 1073742334:(v+1!=this.slen||e||1<h)&&this.error(18);y=1073742334==a.theTok?"off":1073742335==a.theTok?"on":"delete";f=!0;break;case 7:(null==s||e)&&this.invArg();e=!0;u=this.getIntArray2(v);t=this.getAllPoints(a.iToken+
1,3);v=a.iToken;N(t[0],"JM.Atom")&&this.setShapeProperty(21,"model",Integer.$valueOf(t[0].getModelIndex()));y="definedFaces";u=A(-1,[u,t]);break;case 1073741961:y="full";break;case 2:null!=s&&this.invArg();y="nVertices";u=Integer.$valueOf(this.intParameter(v));e=!0;268436992==this.tokAt(v+1)&&v++;break;case 1677721602:null!=s&&this.invArg();0<h&&this.invPO();e=!0;y="bonds";c=!0;break;case 1073741852:-1!=k&&this.invArg(),k=0,v--;case 1665140738:v++;case 3:null!=s&&this.invArg();0<h&&this.invPO();y=
0>=k?"radius":"radius1";u=Float.$valueOf(k=0==k?0:this.floatParameter(v));e=!0;break;case 1073742066:this.isFloatParameter(v+1)?n=this.floatParameter(++v):(p=this.e.centerParameter(++v,null),v=a.iToken);H=!0;continue;case 1073741937:this.setShapeProperty(21,"collapsed",null);case 1073742099:case 1073741924:y=JS.T.nameOf(a.theTok);switch(this.tokAt(v+1)){case 268440324:case 268436992:v++}u=Float.$valueOf(this.floatParameter(++v));break;case 1094717454:null==s&&this.invArg();y="model";u=Integer.$valueOf(this.intParameter(++v));
break;case 1073742170:(1<h||null!=s&&!b||l==v)&&this.invPO();h=3;a.isAtomExpression(++v)?(y=e||b?"to":"toBitSet",u=this.atomExpressionAt(v)):a.isArrayParameter(v)?(y="toVertices",u=a.getPointArray(v,-1,!1,!0)):this.error(19);v=a.iToken;e=!0;break;case 12290:case 10:case 1073742325:d&&this.invPO();switch(++h){case 1:null!=s&&this.invArg();y="centers";break;case 2:y="to";e=!0;break;default:a.bad()}u=this.atomExpressionAt(v);q=v=a.iToken;e=(new Boolean(e|v+1==this.slen)).valueOf();break;case 1073741948:case 1073741886:e=
!0;B=1==v;d&&this.error(18);d=!0;y=1073741886==this.e.theTok?"collapsed":null;this.isFloatParameter(v+1)&&this.setShapeProperty(21,"faceCenterOffset",Float.$valueOf(this.floatParameter(++v)));break;case 1765808134:case 1111490588:case 1073742074:q==v-1&&(e=!0);m=this.getColorTrans(a,v,!0,r);H=!0;v=a.iToken;continue;case 1073742044:case 1073741933:case 1073741956:case 1073741934:q==v-1&&(e=!0);g&&this.error(18);H=g=!0;y=JS.T.nameOf(a.theTok);break;case 1073742182:case 1073742060:case 1073741861:case 1073741958:case 1073741964:continue;
case 1073741974:case 268441089:case 1073741824:case 4:if(!a.isColorParam(v)){1!=v&&this.invPO();s=1073741974==a.theTok?this.stringParameter(++v):a.optParameterAsString(v);268441089==this.tokAt(v+1)&&(s+=this.paramAsStr(++v));this.setShapeProperty(21,"thisID",s);this.setShapeProperty(21,"model",Integer.$valueOf(this.vwr.am.cmi));if(!a.isCenterParameter(v+1))continue;y="center";u=this.centerParameter(++v);v=a.iToken;b=!0;break}default:if(a.isColorParam(v)){q==v-1&&(e=!0);r[0]=a.getArgbParam(v);a.isCenterParameter(v)&&
(l=a.iToken+1);v=a.iToken;continue}this.invArg()}null!=y&&this.setShapeProperty(21,y,u);if(f)return}e?(!d&&c&&this.setShapeProperty(21,"bonds",null),this.setShapeProperty(21,"generate",Boolean.$valueOf(B))):H||this.error(19);null!=p&&this.setShapeProperty(21,"offset",p);Float.isNaN(j)||this.setShapeProperty(21,"scale",Float.$valueOf(j));-2147483648!=r[0]&&this.setShapeProperty(21,"colorThis",Integer.$valueOf(r[0]));3.4028235E38!=m&&a.setShapeTranslucency(21,"","translucentThis",m,null);this.setShapeProperty(21,
"init",Boolean.FALSE)}});p(l,"write",function(a){null==a&&this.vwr.haveAccessInternal(null)&&this.invArg();var c=this.e,b=1,e=1,f=null,d=null,g=null,j=null,h="SPT",m=!0,k=!1,r=!1;null==a?(a=this.st,k=this.vwr.isApplet&&!this.vwr.isSignedApplet||!this.vwr.haveAccess(JV.Viewer.ACCESS.ALL)||0<this.vwr.fm.getPathForAllFiles().length):(b=e=0,m=!1,k=!m);var l=JS.CmdExt.tokAtArray(b,a);if(4==l&&!m){var q=JS.T.getTokenFromName(JS.SV.sValue(a[0]).toLowerCase());null!=q&&(l=q.tok)}switch(l){case 0:break;case 15:case 7:case 6:h=
"VAR";break;case 1095241729:case 1073741872:this.invArg();break;case 134221850:case 4138:case 1715472409:return d=this.plot(a),k?d:this.writeMsg(d);case 134222850:c.isArrayParameter(b+1)&&(f=c.stringParameterSet(++b),j=g=".",e=b=c.iToken+1,l=this.tokAt(b));break;default:h=JS.SV.sValue(this.tokenAt(b,a)).toUpperCase()}var p=this.vwr.getExportDriverList(),n=null,s=m?this.slen:a.length,A="",B=null,u=!1,t=null,v=0,y=null,F=!1,L=null,x=-1,G=-1,z=!1,D=!1,q=null,C=-2147483648;if(0!=l&&m&&1<this.slen&&1073741848==
this.tokAt(this.slen-2)){B=this.paramAsStr(this.slen-1).toUpperCase();B.equals("JSON")&&(D=!0,s-=2);if(!D||!h.equals("VAR"))h=B,e=s,l=0;s-=2}switch(l){case 15:case 7:case 6:h="VAR";t=this.tokenAt(b++,a);break;case 1073741984:h="INLINE";n=JS.SV.sValue(this.tokenAt(++b,a));b++;break;case 1275068447:h="PGRP";b++;A=JS.SV.sValue(this.tokenAt(b,a)).toLowerCase();A.equals("draw")&&b++;break;case 1073742329:b++;F=!0;break;case 1073742158:case 134222850:for(B=JS.SV.sValue(this.tokenAt(++b,a)).toLowerCase();B.equals("localpath")||
B.equals("remotepath");)B.equals("localpath")?g=JS.SV.sValue(this.tokenAt(++b,a)):j=JS.SV.sValue(this.tokenAt(++b,a)),B=JS.SV.sValue(this.tokenAt(++b,a)).toLowerCase();h="SPT";break;case 1228935687:case 134320141:case 1610616855:case 135180:case 1073742015:case 1073742018:case 1073877011:case 1073877010:case 135188:b++;break;case 1073741991:h="ZIPALL";b++;break;case 36868:h="VAR";b+=2;break;case 1073741929:case 4115:case 4120:case 1073742062:case 1073742139:case 4166:case 1073741824:case 4:switch(l){case 4115:b+
1<s&&1073742325==a[++b].tok||10==a[b].tok?(B=c.atomExpression(a,b,0,!0,!1,null,!0),b=c.iToken+1):B=this.vwr.getAllAtoms();this.chk||(L=this.vwr.ms.getModelBS(B,!0));break;case 1073741929:l=4120,u=!0;case 4120:h="IMAGE";b++;break;case 1073742139:B=JS.SV.sValue(this.tokenAt(++b,a)).toUpperCase();JU.PT.isOneOf(B,";PNG;PNGJ;")?(y=B,b++):y="PNG";break;case 4166:v=c.intParameterRange(++b,1,10);if(2147483647==v)return"";this.chk||(this.vwr.tm.setVibrationPeriod(0),c.isJS||c.delayScript(100));b++;break;default:l=
4120}if(4120==l&&b<a.length)if(l=JS.T.getTokenFromName(JS.SV.sValue(a[b]).toLowerCase()),null!=l&&(h=JS.SV.sValue(l).toUpperCase()),JU.PT.isOneOf(h,p.toUpperCase())){b++;h=h.substring(0,1).toUpperCase()+h.substring(1).toLowerCase();z=!0;m&&(q="Jmol."+h.toLowerCase());break}else if(JU.PT.isOneOf(h,";ZIP;ZIPALL;SPT;STATE;")){b++;break}else h="IMAGE";2==JS.CmdExt.tokAtArray(b,a)&&(x=JS.SV.iValue(this.tokenAt(b++,a)),0>=x&&this.invArg(),G=JS.SV.iValue(this.tokenAt(b++,a)),0>=G&&this.invArg(),2==JS.CmdExt.tokAtArray(b,
a)&&(C=JS.SV.iValue(this.tokenAt(b++,a))))}if(e<s){B=JS.SV.sValue(this.tokenAt(b,a));if(B.equalsIgnoreCase("clipboard")){if(this.chk)return""}else JU.PT.isOneOf(B.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(),G=JS.SV.iValue(this.tokenAt(++b,a)),0>=G&&this.invArg()),2==JS.CmdExt.tokAtArray(b+1,a)&&(C=JS.SV.iValue(this.tokenAt(++b,a)))):!"VAR".equals(h)&&
JU.PT.isOneOf(B.toLowerCase(),";xyz;xyzrn;xyzvib;mol;mol67;sdf;v2000;v3000;json;pdb;pqr;cml;cif;scif;cifp1;pwmat;pwslab;qcjson;xsf;")&&(h=B.toUpperCase(),b+1==s&&b++);h.equals("IMAGE")&&JU.PT.isOneOf(B.toLowerCase(),";jpg;jpeg;jpg64;jpeg64;gif;gift;pdf;ppm;png;pngj;pngt;scene;")&&(h=B.toUpperCase(),b++)}b+2==s&&++b;switch(JS.CmdExt.tokAtArray(b,a)){case 0:k=!0;break;case 1073741884:break;case 805307393:q=h.equals("IMAGE")?"?jmol.png":"?jmol."+h.toLowerCase();break;case 15:case 7:case 6:break;case 1073741824:case 4:q=
JS.SV.sValue(this.tokenAt(b,a));if(q.equalsIgnoreCase("clipboard")||!this.vwr.haveAccess(JV.Viewer.ACCESS.ALL))q=null;break;default:this.invArg()}switch(h){case "IMAGE":case "FRAME":case "VIBRATION":h=this.getWriteType(q,"JPG");break;case "CONTACT":r=!0;case "ISOSURFACE":h=this.getWriteType(q,"JVXL");case "PLB":switch(h){case "PMESH":h="ISOMESH";break;case "PMB":h="ISOMESHBIN";break;case "PLY":h="ISOPLY";break;case "PLB":h="ISOPLYBIN"}}l=JU.PT.isOneOf(h.toLowerCase(),";jpg;jpeg;jpg64;jpeg64;gif;gift;pdf;ppm;png;pngj;pngt;scene;");
if(!l)switch(h){case "MNU":h="MENU";break;case "WRL":case "VRML":h="Vrml";z=!0;break;case "X3D":h="X3d";z=!0;break;case "STL":h="Stl";z=!0;break;case "IDTF":h="Idtf";z=!0;break;case "MA":h="Maya";z=!0;break;case "JS":h="Js";z=!0;break;case "OBJ":h="Obj";z=!0;break;case "JVXL":case "XJVXL":h="ISOSURFACE";break;case "JMOL":h="ZIPALL";break;case "HIS":h="HISTORY";break;case "COORD":case "COORDS":h=this.getWriteType(q,"XYZ")}null!=f&&(JV.FileManager.isJmolType(h)||this.invArg(),h.equals("PNG")&&(h="PNGJ"));
!l&&(!z&&!JU.PT.isOneOf(h,";SCENE;JMOL;ZIP;ZIPALL;SPT;HISTORY;MO;NBO;ISOSURFACE;MESH;PMESH;PMB;PLY;PLB;ISOMESHBIN;ISOMESH;ISOPLY;ISOPLYBIN;VAR;FILE;FUNCTION;CFI;CIF;SCIF;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|SCIF|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"";b=Array(1);e=this.vwr.getBoolean(603979934);if(z){e&&JU.Logger.startTimer("export");d=new java.util.Hashtable;d.put("type",h);null!=q&&d.put("fileName",q);(m||null!=q)&&d.put("fullPath",b);d.put("width",Integer.$valueOf(x));d.put("height",Integer.$valueOf(G));try{n=this.vwr.generateOutputForExport(d)}catch(I){if(O(I,Exception))return n=I.toString();throw I;}if(null==n||0==n.length)return"";if(k)return n;if(!h.equals("Povray")&&!h.equals("Idtf")||
null==b[0])return this.writeMsg(n);d=h.equals("Idtf")?".tex":".ini";q=b[0]+d;t=new java.util.Hashtable;t.put("fileName",q);t.put("type",d);t.put("text",n);t.put("fullPath",b);d=this.vwr.processWriteOrCapture(t);h.equals("Idtf")&&(n=n.substring(0,n.indexOf("\\begin{comment}")));n="Created "+b[0]+":\n\n"+n;e&&this.showString(JU.Logger.getTimerMsg("export",0));null!=d&&((h=!d.startsWith("OK"))&&c.evalError(d,null),c.report(n,h));return""}z=null;p=!1;if(null==n){n=h.intern();switch(n){case "MENU":n=this.vwr.getMenu("");
break;case "PGRP":n=this.vwr.ms.getPointGroupAsString(this.vwr.bsA(),null,0,1,null,null,A.equals("draw")?"":null);break;case "PDB":case "PQR":k?n=this.vwr.getPdbAtomData(null,null,"PQR"===n,F):(p=!0,h="PDB_"+n+"-coord "+F);break;case "FILE":"?".equals(q)&&(q="?Jmol."+this.vwr.getP("_fileType"));k?n=this.vwr.getCurrentModelFile(null,!1):p=!0;break;case "CFI":n=this.vwr.getModelFileData("selected","cfi",!1);break;case "FUNCTION":n=this.vwr.getFunctionCalls(null);h="TXT";break;case "VAR":if(null==t){var K=
this.tokenAt(m?2:1,a);switch(K.tok){case 15:case 7:case 6:break;default:t=c.getParameter(JS.SV.sValue(K),1073742190,!0)}}null!=q&&q.endsWith(".json")&&(D=!0);K=null;switch(t.tok){case 15:K=new JU.Lst;K.addLast(t.value.data);break;case 6:K=null==q?null:this.prepareBinaryOutput(t)}null==K?(n=D?t.toJSON():t.asString(),h="TXT"):null!=q&&(t=new java.util.Hashtable,t.put("data",K),null==(z=n=this.vwr.createZip(q,1==K.size()||q.endsWith(".png")||q.endsWith(".pngj")?"BINARY":"ZIPDATA",t))&&c.evalError("#CANCELED#",
null));break;case "SPT":if(F)t=this.vwr.ms.getTaintedAtoms(2),this.vwr.setAtomCoordsRelative(JU.P3.new3(0,0,0),null),n=this.vwr.getStateInfo(),this.vwr.ms.setTaintedAtoms(t,2);else if(n=this.vwr.getStateInfo(),null!=g||null!=j)n=JV.FileManager.setScriptFileReferences(n,g,j,null);break;case "ZIP":case "ZIPALL":null!=q&&(t=new java.util.Hashtable,null!=f&&t.put("data",f),null==(z=n=this.vwr.createZip(q,h,t))&&c.evalError("#CANCELED#",null));break;case "HISTORY":n=this.vwr.getSetHistory(2147483647);
h="SPT";break;case "MO":case "NBO":n=this.getMoJvxl(2147483647,"NBO"===n);h="XJVXL";break;case "PMESH":case "PMB":null==(n=this.getIsosurfaceJvxl(29,n))&&this.error(31);h="XJVXL";break;case "ISOMESH":null==(n=this.getIsosurfaceJvxl(24,n))&&this.error(31);h="PMESH";break;case "ISOMESHBIN":null==(z=this.getIsosurfaceJvxl(24,"ISOMESHBIN"))&&this.error(31);h="PMB";break;case "ISOPLY":null==(n=this.getIsosurfaceJvxl(24,n))&&this.error(31);h="PLY";break;case "ISOPLYBIN":null==(z=this.getIsosurfaceJvxl(24,
"ISOPLYBIN"))&&this.error(31);h="PLB";break;case "ISOSURFACE":case "MESH":null==(n=this.getIsosurfaceJvxl(r?25:24,n))&&this.error(31);h=0<=n.indexOf("<?xml")?"XJVXL":"JVXL";k||this.showString(this.getShapeProperty(r?25:24,"jvxlFileInfo"));break;default:if(JU.PT.isOneOf(n,";CIF;SCIF;CIFP1;SDF;MOL;MOL67;V2000;V3000;CD;JSON;XYZ;XYZRN;XYZVIB;CML;QCJSON;PWMAT;PWSLAB;XSF;")){t=this.vwr.bsA();this.vwr.setErrorMessage(null," ("+t.cardinality()+" atoms)");n=this.vwr.getModelExtract(t,F,!1,n);d=this.vwr.getErrorMessageUn();
this.vwr.setErrorMessage(null,null);if(0<=this.vwr.am.cmi&&!t.equals(K=this.vwr.getModelUndeletedAtomsBitSet(this.vwr.am.cmi)))d+="\nNote! Selected atom set "+t+" is not the same as the current model "+K;n.startsWith("ERROR:")&&(z=n)}else m&&(k&&null==q)&&(k=!1,q="\u0001"),null==y&&0>C&&(C=-1)}null==n&&(n="")}if(!m)return n;if(k)return c.showStringPrint(n,!0),"";if(null!=z&&"string"==typeof z)return this.writeMsg(z);if(p)return this.writeMsg(this.vwr.writeFileData(q,h,0,null));if(h.equals("SCENE"))z=
y;else if(null==z&&(!l||null!=q))z=n;e&&JU.Logger.startTimer("write");l&&(c.refresh(!1),0>x&&(x=u?250:this.vwr.getScreenWidth()),0>G&&(G=u?250:this.vwr.getScreenHeight()));t=new java.util.Hashtable;c=!1;null!=q&&(t.put("fileName",q),c=q.startsWith("cache://"));t.put("backgroundColor",Integer.$valueOf(this.vwr.getBackgroundArgb()));t.put("type",h);if(u){t.put("is2D",Boolean.TRUE);var M,n="smiles could not be generated";try{if(M=this.vwr.getOpenSmiles(null),0<M.length){var E=this.vwr.setLoadFormat(!0,
"_"+M,"2",!1),E=E+("?width="+x+"&height="+G+"&format="+h.toLowerCase());this.showString(E);n=this.vwr.fm.getFileAsBytes(E,null)}}catch(P){if(!O(P,Exception))throw P;}if("string"==typeof n)return this.showString(n),null;z=n}h=null;"string"==typeof z&&-2147483648==C?t.put(h="text",z):N(z,Array)&&t.put(h="bytes",z);if(c){if(null==h)return null;this.vwr.cachePut(q,z);return this.writeMsg("OK "+z.length)}null!=f&&t.put("scripts",f);null!=L&&t.put("bsFrames",L);t.put("fullPath",b);t.put("quality",Integer.$valueOf(C));
t.put("width",Integer.$valueOf(x));t.put("height",Integer.$valueOf(G));t.put("nVibes",Integer.$valueOf(v));n=this.vwr.processWriteOrCapture(t);null==n&&(n="canceled");l&&n.startsWith("OK")&&(n+="; width="+x+"; height="+G);e&&this.showString(JU.Logger.getTimerMsg("write",0));return this.writeMsg(n+(null==d?"":d))},"~A");p(l,"getWriteType",function(a,c){if(null!=a){var b=a.indexOf(".");if(0<=b)return a.substring(b+1).toUpperCase()}return c},"~S,~S");p(l,"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");
p(l,"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");p(l,"show",function(){var a=this.e,c=null,b=this.paramAsStr(1),e=null,f=0;3<this.slen&&268441088==this.tokAt(this.slen-3)&&268439040==this.tokAt(this.slen-2)?(e="!/"+this.paramAsStr(this.slen-1),this.slen-=3,f=3):2<this.slen&&268441088==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,g=null,j=2,h=this.getToken(1),g=N(h,"JS.SV")&&1073741824!=h.tok?0:h.tok;4==g&&(h=JS.T.getTokenFromName(b.toLowerCase()),null!=h&&(g=h.tok));1296041986!=g&&(1073742158!=g&&1715472409!=g&&1228935687!=g)&&this.checkLength(-3);2==this.slen&&0<=b.indexOf("?")&&(d=this.vwr.getAllSettings(b.substring(0,b.indexOf("?"))),g=-1);switch(g){case 0:this.chk||(d=a.theToken.escape());break;case 603984065:this.chk||(d=this.vwr.stm.getUndoInfo());break;case 1073741925:a.checkLength23();
j=this.st.length;this.chk||(d=this.vwr.getModelInfo("domains"),d=N(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);j=this.st.length;break;case 1073742189:a.checkLength23();j=this.st.length;this.chk||(d=this.vwr.getModelInfo("validation"),d=N(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();j=this.st.length;this.chk||(d=this.vwr.getModelInfo("dssr"),d=null==d?"no DSSR information has been read":2<j?JS.SV.getVariable(this.vwr.extractProperty(d,this.stringParameter(2),-1)).asString():""+JS.SV.getVariable(d).asString());break;case 1073741915:g=2;3==this.slen?g=F(this.floatParameter((j=3)-1)):this.checkLength(2+f);this.chk||(d=this.vwr.calculateStructures(null,!0,!1,g));break;case 545259572:this.checkLength(2+
f);this.chk||(d=this.vwr.fm.getPathForAllFiles());break;case 1275203608:if(!this.chk){var m=Array(2);this.vwr.shm.getShapePropertyData(21,"allInfo",m);d=JS.SV.getVariable(m[1]).asString()}break;case 1073742038:this.chk||this.vwr.getNMRPredict(a.optParameterAsString(2));return;case 603983903:!this.chk&&3==this.slen&&(d=""+this.vwr.getModelkitPropertySafely(a.stringParameter(2)),j=3);break;case 1275068433:case 1073741978:case 1073741929:case 1073741879:case 134218757:this.checkLength((1073741879==g||
134218757==g&&1073742335==this.tokAt(2)?j=3:2)+f);if(this.chk)return;var k=a.optParameterAsString(2);1073741879==g&&("mf".equals(k)&&(k="formula"),"formula".equals(k)&&(d=this.vwr.getModelInfo("formula"),null!=d&&(d=JU.PT.rep(d," ",""))));if(null==d){try{switch(g){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:k.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}if(null==d){var r=JU.Logger.getLogLevel();JU.Logger.setLogLevel(4);d=134218757==g?this.vwr.getSmiles(null):this.vwr.getOpenSmiles(null);JU.Logger.setLogLevel(r)}}catch(l){if(O(l,Exception))d=l.getMessage(),null==d&&(d=""),l.printStackTrace();else throw l;}switch(g){case 1073741929:if(0<d.length){this.vwr.fm.loadImage(this.vwr.setLoadFormat(!1,
"_"+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:j=3,0<d.length?(d=this.vwr.getChemicalInfo(d,k,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 1086324755:case 1086324754:if(this.chk)break;d=(""+this.vwr.evaluateExpression("symop('wyckoff"+(1086324755==g?"m":"")+"')")).trim();break;
case 134217764:case 1296041986:r=this.vwr.getOperativeSymmetry();switch(g){case 134217764:var k=a.optParameterAsString(2),h=k.toLowerCase().equals("names"),m=k.toLowerCase().startsWith("subgroups"),q=k.toLowerCase().startsWith("diagram"),p=k.startsWith("diagramITA"),n=k.toLowerCase().startsWith("table"),j=this.slen,s=-1;if(h){if(this.chk)break}else if(m||q||n||p){if(this.chk)break;k=JU.PT.trim(k.substring(p?10:m?9:q?7:5).trim(),'"');if(0==k.length){if(null==r){d="Include a space group name or number to view its diagram, table, or subgroups";
break}if("/"==r.getSpaceGroupClegId().charAt(1)){d="special group information is not implemented yet";break}k=r.getIntTableNumber();if(null==k||k.equals("0")){d="Can't display a table; don't have an ITA number.";break}}if(null!=d)break;s=JU.PT.parseInt(k);if(-2147483648==s){null==r&&(r=this.vwr.getSymStatic());m=r.getSpaceGroupInfo(this.vwr.ms,JU.PT.rep(k,"''",'"'),-1,!0,null);if(null==m){d="Could not find space group "+k;break}s=m.get("spaceGroupInfo").get("ita").intValue()}}if(h||0<s){d=g=h?"https://www.cryst.ehu.es/cgi-bin/cryst/programs/nph-getgen":
JV.JC.resolveDataBase(p?"itadiagramita":q?"itadiagram":"itatable",JU.PT.formatS(""+s,3,0,!1,!0),null);this.vwr.showUrl(g);break}case 1296041986:d="";m=null;if(2==(j=this.slen)){if(this.chk)break;null==r&&(r=this.vwr.getSymTemp());m=r.getSpaceGroupInfo(this.vwr.ms,null,-1,!1,null)}else if(134217764==g){r=this.paramAsStr(2);j=3;if(this.chk)break;r.startsWith("list/")&&(e=r.substring(4),r="list");m=this.vwr.getSymTemp().getSpaceGroupInfo(this.vwr.ms,JU.PT.rep(r,"''",'"'),-1,!1,null)}if(null!=m){d=(134217764==
g?""+m.get("spaceGroupInfo")+m.get("spaceGroupNote"):"")+(m.containsKey("symmetryInfo")?m.get("symmetryInfo"):"");break}g=2==this.tokAt(2)?this.intParameter(2):0;r=4==this.tokAt(2)||12==this.tokAt(2)?this.paramAsStr(2):null;h=k=null;q=-1;if(3<this.slen&&4!=this.tokAt(3)){j=A(-1,[null,this.vwr.getFrameAtoms()]);k=a.centerParameter(2+(0==g?0:1),j);if(null!=j[0]&&j[0].isEmpty()){j=this.slen;break}j[0]=null;if(0!=this.tokAt(a.iToken+1)&&4!=this.tokAt(a.iToken+1)&&(h=a.centerParameter(++a.iToken,j),null!=
j[0]&&j[0].isEmpty())){j=this.slen;break}0==g&&2==this.tokAt(a.iToken+1)&&(q=a.getToken(++a.iToken).intValue)}p=1<a.iToken&&4==this.tokAt(a.iToken+1)?this.stringParameter(++a.iToken):null==k&&null==h?"label":null;this.checkLength((j=++a.iToken)+f);this.chk||(d=this.vwr.getSymmetryInfo(this.vwr.getAllAtoms().nextSetBit(0),r,g,null,k,h,0,p,0,q,0,null),d=null==d?"":N(d,"java.util.Map")?JS.SV.getVariable(d).asString():d.toString())}break;case 1648363544:g=null;2<this.slen&&(j=this.slen,g=J.c.VDW.getVdwType(this.paramAsStr(2)),
null==g&&this.invArg());this.chk||(d=this.vwr.getDefaultVdwNameOrData(0,g,null));break;case 134320141:a.checkLength23();j=this.slen;g=a.optParameterAsString(2);if(null==e&&0<=(k=g.indexOf("/")))e=g.substring(k+1),g=g.substring(0,k);this.chk||(d=this.vwr.getFunctionCalls(g));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)):(g=this.paramAsStr(2),
this.chk||this.vwr.showUrl(g));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);j=this.slen;break;case 14:case 1112152078:this.chk||(d=this.getContext(!1));break;case 1073741888:g=a.optParameterAsString(2);0<g.length&&(j=3);this.chk||(c=this.vwr.cm.getColorSchemeList(g));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 553648148: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==(j=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 1095241729: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=3==(j=this.slen)?this.vwr.stm.getSavedUnitCell(this.paramAsStr(2)):this.vwr.getUnitCellInfoText());break;case 1073742329:if(2==(j=this.slen)){this.chk||(d=this.vwr.getCoordinateState(this.vwr.bsA()));
break}g=this.paramAsStr(2);this.chk||(d=this.vwr.stm.getSavedCoordinates(g));break;case 1073742158:!this.chk&&(null==a.outputBuffer&&null==e)&&this.vwr.sm.clearConsole();if(2==(j=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==(j=this.slen)){this.chk||(d=this.vwr.fm.getEmbeddedFileState(this.paramAsStr(3),!0,"state.spt"));break}j=3;g=this.paramAsStr(2);this.chk||(d=this.vwr.stm.getSavedState(g));
break;case 1639976963:if(2==(j=this.slen)){this.chk||(d=this.vwr.ms.getProteinStructureState(this.vwr.bsA(),134222350));break}g=this.paramAsStr(2);this.chk||(d=this.vwr.stm.getSavedStructure(g));break;case 134221834:k=3==(j=this.slen)?this.paramAsStr(2):null;this.chk||(r=this.vwr.getDataObj(k,null,-2),k=(g=null!=k&&"types".equals(k.toLowerCase()))||"*".equals(k),null==r?d="no data":N(r,"JU.Lst")?r=r.toArray(Array(r.size())):k||(d=r,d=JU.Escape.encapsulateData(d[0],d[1],d[3].intValue())),null==d&&
(d=r,g&&(d[1]=d[1].$replace("\n",",")),d=JU.Escape.e(d)));break;case 1073742330:j=3;d=a.setObjectProperty();break;case 1812599299: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&&!a.isFuncReturn&&this.vwr.sm.clearConsole(),d=this.vwr.getCurrentModelFile(null,!1));null==d&&(d="<unavailable>");
break}j=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<(j=3)?this.vwr.getModelFileInfoAll():this.vwr.getModelFileInfo();break;case 1610616855:g=2==(j=this.slen)?2147483647:this.intParameter(2);1>g&&this.invArg();this.chk||(this.vwr.sm.clearConsole(),0==a.scriptLevel&&this.vwr.removeCommand(),d=this.vwr.getSetHistory(g));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"),j=3):(r=2==(j=this.slen)?-2147483648:this.intParameter(2),this.chk||(d=this.getMoJvxl(r,1073877011==g)));break;case 1094717454:this.chk||(d=this.vwr.ms.getModelInfoAsString());break;case 537006096:this.chk||(d=this.vwr.getMeasurementInfoAsString());break;case 1073741864:j=3;!this.chk&&this.slen==j&&(d=this.paramAsStr(2),d=this.vwr.getOrientation(JS.T.getTokFromName(d.equals("box")?
"volume":d.equals("rotation")?"best":d),"best",null,null).toString());break;case 1073742132:g=this.tokAt(2),0==g?g=1073742132:j=3;case 1073742178:case 4129:this.chk||(d=this.vwr.getOrientation(g,null,null,null).toString());break;case 1073742077:j=2;if(3<this.slen)break;switch(g=this.tokAt(2)){case 1073742178:case 1073742132:case 4129:case 0:this.chk||(d=this.vwr.getOrientation(g,null,null,null).toString());break;default:g=a.optParameterAsString(2),d=this.vwr.getOrientation(1073742034,g,null,null).toString()}j=
this.slen;break;case 1073742088:this.chk||(d=this.vwr.ms.getPDBHeader(this.vwr.am.cmi));break;case 1275068447:g=a.optParameterAsString(2);0==g.length&&(g=null);j=this.slen;this.chk||(d=this.vwr.ms.getPointGroupAsString(this.vwr.bsA(),"show:"+g,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==(j=this.slen)&&1073742334==this.tokAt(2))g=1086324743;case 1073741863:case 1086326788:case 1073742120:case 1113589787:case 1086324742:case 1153433601:case 1073741982:this.chk||(d=this.vwr.getChimeInfo(g));break;case 537022465:case 1610612738:case 20482:case 1612709912:c="?";break;case 1073742030:g=2==(j=this.slen)?null:this.paramAsStr(2);this.chk||
(d=this.vwr.getBindingInfo(g));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(j++),r=a.getParameter(b,1073742190,!0),this.chk||(d=1073741992==g?r.toJSON():r.escape())}this.checkLength(j+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())))});p(l,"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");p(l,"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=L(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)});p(l,"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});p(l,"unitcell",function(a,c){var b=4141==c,e=this.e,f=2147483647,d=2147483647,g=null,j=0==c?e.tickParamAsStr(a,!0,!1,!1):null;a=e.iToken;var h=null,m=null,k=null,l=null,p=d=!1,q=-1,w=this.chk?null:this.vwr.getCurrentUnitCell(),
n=b?4141:this.tokAt(++a);switch(n){case 1073742333:this.chk||this.vwr.ms.clearUnitCell(this.vwr.am.cmi);return;case 4142:case 4141:p=!0;g=JU.P4.new4(0,0,0,-1);b||e.iToken++;break;case 2097180:d=e.hklParameter(a+1,null,!1,null);n=e.getPointOrPlane(a+1,7);a=e.iToken;var s=NaN;this.isFloatParameter(a+1)&&(s=this.floatParameter(++a),268441090==this.tokAt(a+1)&&(s=-s/100,a++));var H=NaN,B=!1;this.isFloatParameter(a+1)&&(H=this.floatParameter(++a),268441090==this.tokAt(a+1)&&(B=!0,a++));var u=1073742172==
this.tokAt(a+1);u&&a++;e.iToken=a;if(this.chk)break;N(n,"JU.P3")?n=JU.P4.new4(n.x,n.y,n.z,0):Float.isNaN(H)&&(H=n.w);var m=this.getUVBoxFromHKL(w,n,d),l=new JU.P3,t=new JU.V3;JU.Measure.getPlaneProjection(new JU.P3,d,l,t);0<s?(m[3].normalize(),m[3].scale(s)):0>s&&m[3].scale(-s);!Float.isNaN(H)&&0!=H&&(B&&(H=H/100*m[3].length()),m[0].scaleAdd2(H,t,m[0]));u&&m[0].scaleAdd2(-m[3].length(),t,m[0]);l="surface"+F(n.x)+F(n.y)+F(n.z);break;case 536875059:case 1073742163:g=536875059==n?e.getPointOrPlane(++a,
19):e.checkHKL(e.getFractionalPoint(++a));a=e.iToken;if(this.chk)break;m=w.getUnitCellVectors();m[1].scale(Math.abs(g.x));m[2].scale(Math.abs(g.y));m[3].scale(Math.abs(g.z));g=null;l="supercell";break;case 1073741938:g=e.getFractionalPoint(++a);a=e.iToken;if(this.chk)break;g=JU.SimpleUnitCell.ptToIJK(e.checkHKL(g),1);break;case 135180:case 1073742330:h=e.objectNameParameter(++a);break;case 1812599299:e.iToken=a;if(this.chk)break;m=JU.P3.newP(this.vwr.getBoundBoxCenter());g=this.vwr.getBoundBoxCornerVector();
m.sub(g);m=A(-1,[m,JU.P3.new3(2*g.x,0,0),JU.P3.new3(0,2*g.y,0),JU.P3.new3(0,0,2*g.z)]);g=null;break;case 1073742176:12!=this.tokAt(++a)&&this.invArg();if(this.chk)break;k=A(-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:g=this.vwr.ms.getAtomSetCenter(this.atomExpressionAt(a));a=e.iToken;if(this.chk)break;this.vwr.toFractional(g,!0);break;default:if(e.isCenterParameter(a)){g=this.centerParameter(a);
a=e.iToken;break}this.invArg()}g.x-=0.5;g.y-=0.5;g.z-=0.5;break;case 12290:case 10:case 1073742325:d=this.atomExpressionAt(a).nextSetBit(0);a=e.iToken;this.chk||this.vwr.setUnitCellAtomIndex(d);if(0>d)return;break;case 1073742066:if(d=!0,e.isAtomExpression(a+1)){g=e.centerParameter(++a,null);a=e.iToken;if(this.chk)break;this.vwr.toFractional(g,!1);break}case 1073742114:g=e.getFractionalPoint(++a);if(N(g,"JU.P4"))d&&this.invArg();else{a=e.iToken;if(this.chk)break;g=!d&&555>g.x?JU.SimpleUnitCell.ptToIJK(e.checkHKL(g),
1):JU.P4.new4(g.x,g.y,g.z,d?1:0)}break;case 3:case 2:if(111>this.floatParameter(a)){a--;break}f=this.intParameter(a);break;case 1095241729:case 4:case 1073741824:s=this.paramAsStr(a).toLowerCase();if(s.equals("rhombohedral")||s.equals("r")){if(null!=w&&0==w.getUnitCellInfoType(8))return;s="2/3a+1/3b+1/3c,-1/3a+1/3b+1/3c,-1/3a-2/3b+1/3c"}else if(s.equals("trigonal")||s.equals("hexagonal")){if(null!=w&&0==w.getUnitCellInfoType(9))return;s="a-b,b-c,a+b+c"}l=s;if(0<=s.indexOf(",")||this.chk){k=s;break}if(s.startsWith("unitcell_"))this.unitcell(0,
4141);else{d=null;this.vwr.ms.setModelCagePts(-1,null,null);k=this.vwr.getModelInfo("unitcell_conventional");n=null!=this.vwr.getModelInfo("isprimitive");if(JU.PT.isOneOf(l,";parent;standard;primitive;")){if(null==k&&n){this.showString("Cannot convert unit cell when file data is primitive and have no lattice information");return}l.equals("primitive")&&4==this.tokAt(a+1)&&(d=this.paramAsStr(++a).toUpperCase())}N(k,Array)&&(m=k);null==d&&(d=this.vwr.getModelInfo("latticeType"));null!=k&&(this.vwr.ms.setModelCagePts(-1,
this.vwr.getV0abc(-1,k),""+k),k=null);if(!l.equals("conventional"))if(this.setShapeProperty(34,"labels",null),s=this.vwr.getModelInfo("unitcell_"+l),null==s){if((s=l.equals("primitive"))||l.equals("reciprocal")){H=this.slen==a+1?1:2==this.tokAt(a+1)?3.141592653589793*this.intParameter(++a):this.floatParameter(++a);l=(null==w?"":w.getSpaceGroupName()+" ")+l;m=null==w?A(-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)]):w.getUnitCellVectors();null==d&&(d=this.vwr.getSymmetryInfo(this.vwr.getFrameAtoms().nextSetBit(0),
null,0,null,null,null,1073741994,null,0,-1,0,null));null==w&&(w=this.vwr.getSymTemp());n||w.toFromPrimitive(!0,0==d.length?"P":d.charAt(0),m,this.vwr.getCurrentModelAuxInfo().get("primitiveToCrystal"));s||JU.SimpleUnitCell.getReciprocal(m,m,H);break}}else l=s,0<=s.indexOf(",")&&(k=s);break}default:if(d=Array(1),(new Boolean(!b&this.getUnitCellParameter(a,d))).valueOf()?m=d[0]:k=d[0],null==k&&null==m)this.slen>a+1?(g=e.getFractionalPoint(a),a=e.iToken):a--;else if(null!=k){if(!this.chk&&0!=c)if(null==
w){if(1073741938==c)return;this.assignSpaceGroup(null,"P1",k,q,!1,"unitcell")}else 1073741938!=c&&w.fixUnitCell(k)&&e.invArgStr("Unit cell is incompatible with current space group");a=e.iToken}else null!=m&&(a=e.iToken)}switch(c){case 1073741938:e.isFloatParameter(a+1)?(q=this.floatParameter(++a),e.iToken=a):q=0;d=0;break;case 1814695966:1073742080==this.tokAt(a+1)&&(q=e.isFloatParameter(++a+1)?this.floatParameter(++a):0,e.iToken=a);default:d=b?1:e.getSetAxesTypeMad10(++a)}b||e.checkLast(e.iToken);
if(!(this.chk||2147483647==d))if(null==m&&null!=k&&(m=this.vwr.getV0abc(-1,k)),1073741938==c)(null==w||2147483647!=f||null!=h||p)&&this.invArg(),null==m&&(m=w.getUnitCellVectors(),null==g&&(g=new JU.P3),w.toCartesian(g,!0),m[0]=g),this.vwr.getModelkit(!1).cmdFillOABC(m,q,this.e.fullCommand);else{if(2147483647!=f)null!=w&&w.setOffset(f);else if(null!=h)this.vwr.setCurrentCage(h);else if(p||null!=m)if(p=1814695966==c||null==w?this.vwr.getModelkit(!1).transformAtomsToUnitCell(w,m,l):!0){if(1814695966==
c&&null!=w){this.vwr.ms.setSpaceGroup(this.vwr.am.cmi,w.getUnitCell(m,!1,null),null);return}this.vwr.ms.setModelCagePts(-1,m,l);null==w&&this.vwr.setNewRotationCenter(this.vwr.getUnitCellCenter())}b=1814695966==c?this.vwr.ms.getUnitCell(-1-this.vwr.am.cmi):null;e.setObjectMad10(33,"unitCell",d);null!=g&&(w=this.vwr.ms.getUnitCell(-2147483648),null!=w&&w.setOffsetPt(g));1814695966==c&&null==w.getFractionalOffset(!0)&&(w.setSpaceGroupTo(b),0<=q&&this.vwr.getModelkit(!1).cmdPackUnitCell(w,this.vwr.getModelUndeletedAtomsBitSet(this.vwr.am.cmi),
q));null!=j&&this.setShapeProperty(33,"tickInfo",j);null!=l&&this.showString(l+(null==m?"":" "+JU.Escape.e(m)))}},"~N,~N");p(l,"getUVBoxFromHKL",function(a,c,b){var e=F(c.x),f=F(c.y),d=F(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 g=b.w,j=JU.P4.new4(b.x,b.y,b.z,0),h=Math.max(Math.max(e,f),d),h=JU.Measure.getLatticePoints(a.getLatticeCentering(),h,h,h),m=h.size();0<=--m;)a.toCartesian(h.get(m),!0);for(var h=
JU.Measure.getPointsOnPlane(h.toArray(Array(h.size())),j),j=new JU.P3,m=-179,k=3.4028235E38,l=3.4028235E38,p=a=null,q=m,w=3.4028235E38,n,s,A,B,u=h.size();0<=--u;){var t=h.get(u);n=t.length();A=!1;if(!(0.01>n||null!=a&&(q=Math.abs(JU.Measure.computeTorsion(a,j,b,t,!0)))>-m))if(B=1>q,null==a)a=t,k=n;else{if(n<k-0.01)A=!0,q=w=3.4028235E38;else if(n<l-0.01)w=3.4028235E38;else if(!(n>=l+0.01))continue;A||(s=89<q)&&n<k+0.1&&-0.01<=t.x&&0.01>=t.y&&(3.4028235E38==w||89>w)?(B?(p=null,l=3.4028235E38):(p=a,
l=k),a=t,k=n,!A&&q<w&&(w=q)):s&&n<l+0.1&&(p=t,l=n,q<w&&(w=q))}}null==a&&this.invArg();s=null;if(null==p)for(u=h.size();0<=--u;)t=h.get(u),q=JU.Measure.computeTorsion(a,j,b,t,!0),-89.9>q&&q>m+0.01&&(m=q,s=t);else q=JU.Measure.computeTorsion(a,j,b,p,!0),1<q?(s=a,a=p):s=p;null==s&&this.invArg();c[1]=s;c[2]=a;b=1==((0>e?1:0)+(0>f?1:0)+(0>d?1:0))%2;h=c[3];j=JU.P3.newP(s);m=JU.P3.newP(a);0==e&&0==f?(m.scale(-1),j.scale(-1),c[1]=j,c[2]=m):!(0==e&&0==d)&&(0==f&&0==d)&&(j.scale(-1),m.scale(-1),c[1]=m,c[2]=
j);b&&(j=c[1],c[1]=c[2],c[2]=j);h.cross(a,s);h.normalize();h.scale(g);return c},"J.api.SymmetryInterface,JU.P4,JU.P4");p(l,"modelkit",function(){var a=0,c=this.tokAt(1);switch(c){case 603984065:case 4139:this.chk&&this.e.cmdUndoRedo(603984065==c?4165:4140);return;case 1073742334:if(this.e.$isStateScript&&this.vwr.getModelkit(!1).setProperty("updatekeysfromstate",null),2==this.slen&&null==this.vwr.getModelkitPropertySafely("exists"))return;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 4126:0>this.vwr.am.cmi&&this.e.errorStr(30,"MODELKIT MINIMIZE");this.minimize(!0);return;case 528432:case 4145:this.e.cmdRotate(!1,!0);return;case 4098:++this.e.iToken;case 134217764:case 4106:case 12291:case 1275069441:case 4129:case 1073742080:case 12297:case 135176:this.assign(!0);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,g=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:g=this.e.hklParameter(++a,null,!0,null);f=null;break;case 134217750:g=this.e.planeParameter(++a,!1);f=null;break;default:this.invArg()}null==f?((null==c||null==d)==(null==g)&&this.invArg(),f=A(-1,[c,d,g])):f=null;a=this.e.iToken;break;case 36867:e=this.paramAsStr(++a);f=0==this.tokAt(++a)?"true":this.paramAsStr(a);break;case 4166:e="vibration";switch(this.tokAt(++a)){case 1073742334:f="off";break;case 1086324754:f="wyckoff";break;default:this.invArg()}break;case 1296041986:switch(this.tokAt(++a)){case 4:case 1073742333:f=
this.paramAsStr(a);break;case 12:f=this.getToken(a).value;break;case 2:f=Integer.$valueOf(this.getToken(a).intValue);break;default:this.e.isCenterParameter(a)?(e="center",f=this.e.centerParameter(a,null),a=this.e.iToken):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;case 1073742024:f=this.paramAsStr(++a).toLowerCase();this.vwr.isModelKitOption("M",f)||this.invArg();
break;case 1073741938:case 1814695966:if(this.e.isArrayParameter(a+1)){this.unitcell(2,c);return}f=4==this.tokAt(a+1)||1814695966==this.tokAt(a+1)?this.paramAsStr(++a).toLowerCase():null;if(null==f||!this.vwr.isModelKitOption("U",f)){this.unitcell(2,c);return}break;case 1088421903:f=this.paramAsStr(++a).toLowerCase();this.vwr.isModelKitOption("S",f)||this.invArg();break;default:if(this.vwr.isModelKitOption("B",e)){f=Boolean.$valueOf(0==(c=this.tokAt(++a))||1073742335==c);break}if(this.vwr.isModelKitOption("M",
e)){f=e;e="mode";break}if(this.vwr.isModelKitOption("U",e)){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 SET "+e+" "+f.toString(),!1)}});p(l,"assign",function(a){0>this.vwr.am.cmi&&this.invArg();var c=this.vwr.getThisModelAtoms(),b=++this.e.iToken,e=!1,f=!1,d=this.tokAt(b);135176==d&&(134217764!=this.tokAt(2)&&this.invArg(),e=!0,d=12297);if(12297==d&&(a||this.invArg(),f=!0,d=this.tokAt(++b),0==d))return;
var g=1153433601==d,j=1677721602==d,h=1275069441==d,l=4106==d,k=12291==d,p=4129==d,F=134217764==d,q=-1;1073742080==d&&(q=this.e.isFloatParameter(b+1)?this.floatParameter(++b):0);(0<=q||F)&&!a&&this.invArg();g||j||l||F||k||p||h||0<=q?b++:(g=!0,d=1153433601);var w=-1,n=-1;a=null;if(j){if(2==this.tokAt(b))w=this.e.intParameter(b);else if(N(this.getToken(b).value,"JM.BondSet"))w=this.getToken(b).value.nextSetBit(0);else switch(a=this.expFor(b,c),w=a.nextSetBit(0),a.cardinality()){case 1:a=this.expFor(++this.e.iToken,
c),n=a.nextSetBit(0),0>n&&this.invArg(),a.set(w);case 2:a=this.vwr.ms.getBondsForSelectedAtoms(a,!1);a.isEmpty()?(l=!0,d=4106):w=a.nextSetBit(0);break;default:this.invArg()}b=++this.e.iToken}else if(0<=q)a=c;else if(!(g&&4==this.tokAt(b)||1275069441==d))if(!F||this.e.isAtomExpression(b)){a=this.expFor(b,c);w=a.nextSetBit(0);if(0>w)return;b=++this.e.iToken}var j=this.vwr.getOperativeSymmetry(),s=k=null,H=null,B=null,u=null;if(h)switch(this.e.isAtomExpression(b)?(a=this.expFor(++this.e.iToken,c),b=
this.e.iToken,k=this.e.optParameterAsString(b+1),b=this.e.iToken,k.toLowerCase().equals("packed")&&(q=this.e.isFloatParameter(b+1)?this.floatParameter(++b):0,this.e.iToken=b,k="")):1086324754==this.e.tokAt(b)?(this.e.iToken=b-1,k="O"):k=this.e.optParameterAsString(b),this.e.isPoint3f(this.e.iToken+1)?s=this.getPoint3f(++this.e.iToken,!0):this.e.isArrayParameter(this.e.iToken+1)&&(u=this.e.getPointArray(this.e.iToken+1,-1,!1,!0)),0==k.length&&(k=null),this.tokAt(this.e.iToken+1)){case 1073742080:this.e.iToken++;
q=this.e.isFloatParameter(this.e.iToken+1)?this.floatParameter(++this.e.iToken):0;break;case 1086324754:++this.e.iToken,H=this.paramAsStr(++this.e.iToken),c=H.equalsIgnoreCase("all")?"L":H.equalsIgnoreCase("general")?"G":1<H.length||0==H.length?"\x00":H.charAt(0),("a">c&&"A"!=c&&"G"!=c&&"L"!=c||"z"<c)&&this.invArg(),H=""+c,"packed".equals(this.e.optParameterAsString(this.e.iToken+1))&&(q=this.e.isFloatParameter(++this.e.iToken+1)?this.floatParameter(++this.e.iToken):0)}else p?(this.e.isArrayParameter(b)?
u=this.e.getPointArray(b,-1,!1,!0):s=this.getPoint3f(b,!0),b=this.e.iToken):F?(k=this.e.optParameterAsString(b),0==k.length&&(k="."),j=this.vwr.getOperativeSymmetry(),k.equals(".")&&(k=null==j?"P1":b==this.slen?null:j.getSpaceGroupClegId()),"packed".equalsIgnoreCase(k)&&(q=this.e.isFloatParameter(this.e.iToken+1)?this.floatParameter(++this.e.iToken):0,k=j.getSpaceGroupClegId()),1814695966==this.tokAt(this.e.iToken+1)&&(B=Array(1),this.getUnitCellParameter(this.e.iToken+2,B),B=B[0],null==B&&this.invArg()),
0>q&&1073742080==this.tokAt(this.e.iToken+1)&&(q=this.e.isFloatParameter(this.e.iToken+1)?this.floatParameter(++this.e.iToken):0)):l?0>n&&(a=this.expFor(b,c),n=a.nextSetBit(0),k=this.e.optParameterAsString(++this.e.iToken)):(k=this.e.optParameterAsString(b),g&&(s=++this.e.iToken<this.slen?this.centerParameter(this.e.iToken):null));if(!this.chk)switch(this.vwr.pushState(),d){case 1153433601:this.e.clearDefinedVariableAtomSets();this.vwr.getModelkit(!1).cmdAssignAtom(a,s,k,this.e.fullCommand);break;
case 1677721602:this.vwr.getModelkit(!1).cmdAssignBond(w,(k+"-").charAt(0),this.e.fullCommand);break;case 4106:this.vwr.getModelkit(!1).cmdAssignConnect(w,n,(k+"1").charAt(0),this.e.fullCommand);break;case 1073742080:k=null;case 1275069441:case 1086324754:null==u&&(null!=s?u=A(-1,[s]):null==a&&null==H&&(null==k?this.invArg():H="G"));e=this.vwr.getModelkit(!1).cmdAssignAddAtoms(null==k?null:k+(null!=H?":"+H:""),u,a,q,this.e.fullCommand);this.e.doReport()&&this.e.report(J.i18n.GT.i(J.i18n.GT.$("{0} atoms added"),
e),!1);break;case 12291:e=this.vwr.getModelkit(!1).cmdAssignDeleteAtoms(a);this.e.doReport()&&this.e.report(J.i18n.GT.i(J.i18n.GT.$("{0} atoms deleted"),e),!1);break;case 4129:e=this.vwr.getModelkit(!1).cmdAssignMoveAtoms(a,w,JU.P3.newP(s),u,!0,!1,!0);0<e&&this.vwr.checkCoordinatesChanged(a);this.e.doReport()&&this.e.report(J.i18n.GT.i(J.i18n.GT.$("{0} atoms moved"),e),!1);break;case 134217764:f&&(this.vwr.zap(!1,!1,!1),j=null);if(0<=q&&k.equalsIgnoreCase("packed"))k=null,null==j&&this.invArg();else{if(0>
q){for(d=f=b+1;d<this.slen;d++)if(1073742080==this.tokAt(d)){q=this.e.isFloatParameter(d+1)?this.floatParameter(++d):0;f=d;break}f<this.slen&&(k=null)}null==k&&(k=this.concatString(b,0<=q?"packed":"unitcell"));if(0<k.length&&0>k.indexOf(":")&&0>k.indexOf(">")&&(0<k.indexOf(",")||0<="rh".indexOf(k)))null==j&&this.invArg(),b=j.getSpaceGroupClegId(),k=(null==b?"["+j.getSpaceGroupName()+"]:":b.substring(0,b.indexOf(":")+1))+k}e=this.assignSpaceGroup(a,k,B,q,e,this.e.fullCommand);e.endsWith("!")&&this.e.invArgStr(e);
this.e.doReport()&&this.e.showString(e)}},"~B");p(l,"assignSpaceGroup",function(a,c,b,e,f,d){var g=new JU.SB;a=this.vwr.getSymStatic().staticTransformSpaceGroup(a,c,b,g);if(a.endsWith("!"))return a;(0<=e||f)&&this.vwr.getModelkit(!1).cmdAssignSpaceGroup(a,g,d,e,f);return g.toString()},"JU.BS,~S,~O,~N,~B,~S");p(l,"concatString",function(a,c){for(var b="";a<this.slen;a++){var e=JS.SV.sValue(this.e.getToken(a));if(e.equals(c)){this.e.iToken--;break}b+=e}return b},"~N,~S");p(l,"getUnitCellParameter",
function(a,c){c[0]=null;var b=this.tokAt(a),e=this.e.iToken,f=!1;268439040==b&&(f=!0,b=this.tokAt(++a));switch(b){case 8:return!1;case 1073741824:case 4:case 1814695966:var e=this.paramAsStr(a).toLowerCase(),d=this.vwr.getCurrentUnitCell();null==d&&this.invArg();this.chk||(e=e.equalsIgnoreCase("unitcell")?"a,b,c":e.startsWith("unitcell_")?this.vwr.getCurrentModelAuxInfo().get(e):JU.SimpleUnitCell.parseSimpleMath(this.vwr,e),f&&(e="!"+e),c[0]=d.getV0abc(e,null));return!0}if(this.e.isArrayParameter(a)){this.e.ignoreError=
!0;if(1073742332!=this.tokAt(a+2))try{return c[0]=this.e.floatParameterSet(a,6,6),this.e.ignoreError=!1}catch(g){if(!O(g,Exception))throw g;}try{return c[0]=this.e.getPointArray(a,4,!1,!0),!0}catch(j){if(O(j,Exception))this.e.iToken=e;else throw j;}try{if(1073742195==this.tokAt(a)){a+=2;d=Array(4);for(f=0;4>f;f++){if(this.e.isArrayParameter(a)){var h=this.e.floatParameterSet(a,3,3);d[f]=JU.P3.newA(h);a=this.e.iToken+1;268436992==this.tokAt(a)&&a++;this.e.iToken=a}else if(3==f){for(a=f;0<a;--a)d[a]=
d[a-1];d[0]=new JU.P3}else break;if(3==f)return c[0]=d,!0}}}catch(l){if(O(l,Exception))this.e.iToken=e;else throw l;}this.e.ignoreError=!1}return!0},"~N,~A");p(l,"expFor",function(a,c){var b=JU.BS.copy(this.atomExpressionAt(a));b.and(c);return b},"~N,JU.BS");p(l,"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");p(l,"getIsosurfaceJvxl",function(a,c){switch(c){case "PMESH":case "MESH":c="jvxlMeshXml";break;case "ISOMESH":c="pmesh";break;case "ISOMESHBIN":case "PMB":c=
"pmeshbin";break;case "ISOPLY":c="ply";break;case "ISOPLYBIN":case "PLB":c="plybin";break;default:c="jvxlDataXml"}return this.chk?"":this.getShapeProperty(a,c)},"~N,~S");p(l,"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");p(l,"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");p(l,"tokenAt",function(a,c){return a<c.length?c[a]:null},"~N,~A");l.tokAtArray=p(l,"tokAtArray",function(a,c){return a<c.length&&null!=c[a]?c[a].tok:0},"~N,~A");p(l,"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,g=0;d<e;g=b[d++])g=JU.PT.getTokens(a.substring(g,b[d])),JU.PT.parseFloatArrayData(g,f[d]=Q(g.length,0));return f}g=JU.PT.getTokens(a.substring(0,b[0]));if(3!=g.length)return Q(0,0,0,0);var j=JU.PT.parseInt(g[0]),h=JU.PT.parseInt(g[1]),l=JU.PT.parseInt(g[2]);if(1>j||1>h||1>l)return Q(1,1,1,0);for(var f=JU.AU.newFloat3(j,h),k=0,p=0,d=1,g=b[0];d<e&&k<j;g=b[d++])g=JU.PT.getTokens(a.substring(g,b[d])),g.length<l||(JU.PT.parseFloatArrayData(g,
f[k][p]=Q(g.length,0)),++p==h&&(k++,p=0));return k!=j?(System.out.println("Error reading 3D data -- nX = "+j+", but only "+k+" blocks read"),Q(1,1,1,0)):f},"~S,~B");p(l,"sync",function(){var a="",c="",b=JU.PT.parseInt(this.e.optParameterAsString(1));if(-2147483648==b)switch(this.checkLength(-3),b=0,this.slen){case 1:c="*";a="ON";break;case 2:c=this.paramAsStr(1);if(0==c.indexOf("jmolApplet")||JU.PT.isOneOf(c,";*;.;^;")){a="ON";this.chk||this.vwr.syncScript(a,c,0);c=".";break}a=c;c="*";break;case 3:c=
this.paramAsStr(1),a=528443==this.tokAt(2)?"GET_GRAPHICS":this.paramAsStr(2)}else{a=null;if(2<this.slen&&null==(a=this.e.setVariable(2,-1,"",!1)))return;a=2==this.slen?null:6==a.tok?a.toJSON():a.asString();c=null}this.chk||this.vwr.syncScript(a,c,b)});p(l,"varna",function(){var a=this.e.paramAsStr(1);this.chk||(a=this.vwr.syncScriptErr("varna:"+a),null!=a&&this.e.showString(a))});l.labeler=null})})(Clazz,Clazz.getClassName,Clazz.newLongArray,Clazz.doubleToByte,Clazz.doubleToInt,Clazz.doubleToLong,
Clazz.declarePackage,Clazz.instanceOf,Clazz.load,Clazz.instantialize,Clazz.decorateAsClass,Clazz.floatToInt,Clazz.floatToLong,Clazz.makeConstructor,Clazz.defineEnumConstant,Clazz.exceptionOf,Clazz.newIntArray,Clazz.newFloatArray,Clazz.declareType,Clazz.prepareFields,Clazz.superConstructor,Clazz.newByteArray,Clazz.declareInterface,Clazz.newShortArray,Clazz.innerTypeInstance,Clazz.isClassDefined,Clazz.prepareCallback,Clazz.newArray,Clazz.castNullAs,Clazz.floatToShort,Clazz.superCall,Clazz.decorateAsType,
Clazz.newBooleanArray,Clazz.newCharArray,Clazz.implementOf,Clazz.newDoubleArray,Clazz.overrideConstructor,Clazz.clone,Clazz.doubleToShort,Clazz.getInheritedLevel,Clazz.getParamsType,Clazz.isAF,Clazz.isAB,Clazz.isAI,Clazz.isAS,Clazz.isASS,Clazz.isAP,Clazz.isAFloat,Clazz.isAII,Clazz.isAFF,Clazz.isAFFF,Clazz.tryToSearchAndExecute,Clazz.getStackTrace,Clazz.inheritArgs,Clazz.alert,Clazz.defineMethod,Clazz.overrideMethod,Clazz.declareAnonymous,Clazz.cloneFinals);
