(function(Gb,Hb,Ib,Jb,Kb,Lb,Mb,Nb,Ob,Pb,Qb,Rb,Sb,Tb,Ub,Vb,Wb,Xb,Yb,Zb,$b,ac,k,bc,cc,dc,ec,fc,gc,hc,ic,jc,W,kc,lc,mc,nc,ia,ta,H,Na,Oa,Pa,K,Qa,oc,aa,Q,Eb,E,pc,qc,rc,sc,Fb){ta("J.script");Fb(J.script,"JmolScriptExtension");ta("J.scriptext");Na(["J.script.JmolScriptExtension"],"J.scriptext.ScriptExt","java.lang.Boolean $.Float $.Long $.Short java.util.Date $.Hashtable JU.AU $.BS $.CU $.List $.M3 $.M4 $.P3 $.P4 $.PT $.SB $.V3 J.api.Interface J.atomdata.RadiusData J.constant.EnumAxesMode $.EnumVdw J.i18n.GT J.modelset.Atom $.AtomCollection $.BondSet $.LabelToken J.script.SV $.ScriptCompiler $.ScriptEvaluator $.ScriptInterruption $.ScriptMathProcessor $.T J.util.BSUtil $.BoxInfo $.C $.ColorEncoder $.Elements $.Escape $.JmolMolecule $.Logger $.Measure $.Parser $.Point3fi $.Quaternion $.TempArray $.Txt J.viewer.FileManager $.JC $.StateManager $.Viewer".split(" "),
function(){c$=Pa(function(){this.sm=this.eval=this.viewer=null;this.chk=!1;this.st=this.thisCommand=this.fullCommand=null;this.slen=0;this.pm=this.$data=null;Oa(this,arguments)},J.scriptext,"ScriptExt",null,J.script.JmolScriptExtension);Qa(c$,function(){});W(c$,"init",function(b){this.eval=b;this.viewer=this.eval.viewer;this.sm=this.eval.sm;return this},"~O");W(c$,"dispatch",function(b,a,c){this.chk=this.eval.chk;this.fullCommand=this.eval.fullCommand;this.thisCommand=this.eval.thisCommand;this.slen=
this.eval.slen;this.st=c;switch(b){case 4102:this.calculate();break;case 4103:this.capture();break;case 135270405:this.compare();break;case 1095766024:this.configuration();break;case 1052700:this.mapProperty();break;case 4126:this.minimize();break;case 1276121113:this.modulation();break;case 4133:case 135270418:case 1052714:this.plot(c);break;case 4131:this.navigate();break;case 135270407:this.data();break;case 4148:this.show();break;case 135270422:this.write(null);break;case 23:return this.cgo();
case 25:return this.contact();case 17:return this.dipole();case 22:return this.draw();case 24:case 29:case 28:return this.isosurface(b);case 26:return this.lcaoCartoon();case 6:return this.measure(),!0;case 27:return this.mo(a);case 21:return this.polyhedra();case 4:return this.struts()}return!1},"~N,~B,~A");k(c$,"atomExpressionAt",function(b){return this.eval.atomExpressionAt(b)},"~N");k(c$,"error",function(b){this.eval.error(b)},"~N");k(c$,"invArg",function(){this.error(22)});k(c$,"invPO",function(){this.error(23)});
k(c$,"getShapeProperty",function(b,a){return this.eval.getShapeProperty(b,a)},"~N,~S");k(c$,"parameterAsString",function(b){return this.eval.parameterAsString(b)},"~N");k(c$,"centerParameter",function(b){return this.eval.centerParameter(b)},"~N");k(c$,"floatParameter",function(b){return this.eval.floatParameter(b)},"~N");k(c$,"getPoint3f",function(b,a){return this.eval.getPoint3f(b,a)},"~N,~B");k(c$,"getPoint4f",function(b){return this.eval.getPoint4f(b)},"~N");k(c$,"intParameter",function(b){return this.eval.intParameter(b)},
"~N");k(c$,"isFloatParameter",function(b){return this.eval.isFloatParameter(b)},"~N");k(c$,"setShapeId",function(b,a,c){return this.eval.setShapeId(b,a,c)},"~N,~N,~B");k(c$,"setShapeProperty",function(b,a,c){this.eval.setShapeProperty(b,a,c)},"~N,~S,~O");k(c$,"stringParameter",function(b){return this.eval.stringParameter(b)},"~N");k(c$,"getToken",function(b){return this.eval.getToken(b)},"~N");k(c$,"tokAt",function(b){return this.eval.tokAt(b)},"~N");k(c$,"cgo",function(){var b=this.eval;this.sm.loadShape(23);
if(1073742001==this.tokAt(1)&&this.listIsosurface(23))return!1;var a=0,c=null!=this.initIsosurface(23),d=c&&null==this.getShapeProperty(23,"ID"),e=!1,f=null,g=3.4028235E38;b.colorArgb[0]=-2147483648;for(var h=0,j=b.iToken;j<this.slen;++j){var m=null,u=null;switch(this.getToken(j).tok){case 7:case 269484096:case 1073742195:(null!=f||d)&&this.invArg();f=b.listParameter(j,2,2147483647);j=b.iToken;continue;case 1073742138:++j>=this.slen&&this.error(34);switch(this.getToken(j).tok){case 2:h=this.intParameter(j);
continue;case 3:h=Math.round(100*this.floatParameter(j));continue}this.error(34);break;case 1766856708:case 603979967:case 1073742074:g=b.getColorTrans(j,!1);j=b.iToken;c=!0;continue;case 1074790550:this.setShapeId(23,++j,c);d=null==this.getShapeProperty(23,"ID");j=b.iToken;break;default:if(!b.setMeshDisplayProperty(23,0,b.theTok)){if(269484209==b.theTok||J.script.T.tokAttr(b.theTok,1073741824)){this.setShapeId(23,j,c);j=b.iToken;break}this.invArg()}0==a&&(a=j);j=b.iToken;continue}c=12291!=b.theTok;
null!=f&&!e&&(m="points",u=Integer.$valueOf(h),e=!0,h=0);null!=m&&this.setShapeProperty(23,m,u)}b.finalizeObject(23,b.colorArgb[0],g,h,null!=f,f,a,null);return!0});k(c$,"contact",function(){var b=this.eval;this.sm.loadShape(25);if(1073742001==this.tokAt(1)&&this.listIsosurface(25))return!1;var a=0;b.iToken=1;for(var c=null!=this.initIsosurface(25),d=c&&null==this.getShapeProperty(25,"ID"),e=null,f=null,g=null,h=null,j=null,m=!1,u=new JU.SB,n=2147483647,p=135266319,k=0,q=NaN,A=NaN,w=!0,s=null,v=null,
t=0,G=!1,B=1<b.iToken,y=b.iToken;y<this.slen;++y){switch(g=this.getToken(y).tok){default:B=!0;if(!b.setMeshDisplayProperty(25,0,b.theTok)){269484209!=b.theTok&&!J.script.T.tokAttr(b.theTok,1073741824)&&this.invArg();this.setShapeId(25,y,c);y=b.iToken;break}0==a&&(a=y);y=b.iToken;continue;case 1074790550:B=!0;this.setShapeId(25,++y,c);d=null==this.getShapeProperty(25,"ID");y=b.iToken;break;case 1766856708:switch(this.tokAt(y+1)){case 1073741914:g=0;m=!0;u.append(" color density");y++;break;case 1141899272:g=
0,G=!0,u.append(" color type"),y++}if(0==g)break;case 603979967:case 1073742074:B=!0;0==t&&(t=y);b.setMeshDisplayProperty(25,y,b.theTok);y=b.iToken;break;case 554176565:B=!0;v=this.getCapSlabObject(y,!1);this.setShapeProperty(25,"slab",v);y=b.iToken;break;case 1073741914:m=!0;u.append(" density");this.isFloatParameter(y+1)&&(null==j&&(j=E(1,0)),j[0]=-Math.abs(this.floatParameter(++y)),u.append(" "+-j[0]));break;case 1073742122:c=this.floatParameter(++y);0<c&&(u.append(" resolution ").appendF(c),this.setShapeProperty(25,
"resolution",Float.$valueOf(c)));break;case 135266325:case 1276118018:q=this.floatParameter(++y);u.append(" within ").appendF(q);break;case 269484193:case 2:case 3:h=b.encodeRadiusParameter(y,!1,!1);u.append(" ").appendO(h);y=b.iToken;break;case 1073741990:case 1073741989:s=1073741989==g?Boolean.TRUE:Boolean.FALSE;u.append(" ").appendO(b.theToken.value);break;case 1073742020:n=this.intParameter(++y);break;case 1612189718:case 1073741881:case 1649412120:k=g;u.append(" ").appendO(b.theToken.value);
break;case 1073742136:this.isFloatParameter(y+1)&&(A=this.floatParameter(++y));case 1074790451:case 1073742036:case 3145756:w=!1;case 1276117512:case 1073741961:case 135266319:case 4106:p=g;u.append(" ").appendO(b.theToken.value);1073742136==g&&u.append(" ").appendF(A);break;case 1073742083:j=b.floatParameterSet(++y,1,10);y=b.iToken;break;case 10:case 1048577:(d||null!=f)&&this.invArg(),g=J.util.BSUtil.copy(this.atomExpressionAt(y)),y=b.iToken,null==e?e=g:f=g,u.append(" ").append(J.util.Escape.eBS(g))}c=
12291!=b.theTok}!B&&null==e&&this.error(13);if(this.chk)return!1;if(null!=e){1649412120==k&&null==h&&(h=new J.atomdata.RadiusData(null,0,J.atomdata.RadiusData.EnumType.OFFSET,J.constant.EnumVdw.AUTO));y=null==h?new J.atomdata.RadiusData(null,0.26,J.atomdata.RadiusData.EnumType.OFFSET,J.constant.EnumVdw.AUTO):h;f=1073742036==p&&null==f&&null!=s&&s.booleanValue()?e:this.setContactBitSets(e,f,w,q,y,!0);switch(p){case 1074790451:case 1073742136:y=b.lookupIdentifierValue("solvent");e.andNot(y);f.andNot(y);
f.andNot(e);break;case 3145756:f.andNot(e);break;case 1073742036:2147483647==n&&(n=100),this.setShapeProperty(25,"minset",Integer.$valueOf(n)),u.append(" minSet ").appendI(n),null==j&&(j=[0.5,2])}null!=s&&(j=null==j?E(2,0):JU.AU.ensureLengthA(j,2),j[1]=s.booleanValue()?1:2);null!=j&&u.append(" parameters ").append(J.util.Escape.eAF(j));this.setShapeProperty(25,"set",[Integer.$valueOf(k),Integer.$valueOf(p),Boolean.$valueOf(m),Boolean.$valueOf(G),e,f,h,Float.$valueOf(A),j,u.toString()]);0<t&&b.setMeshDisplayProperty(25,
t,0)}0<a&&(b.setMeshDisplayProperty(25,a,0)||this.invArg());null!=v&&null!=e&&this.setShapeProperty(25,"slab",v);if(null!=e&&(1073742036==p||w)){b=this.getShapeProperty(25,"volume");if(JU.PT.isAD(b)){for(y=a=0;y<b.length;y++)a+=Math.abs(b[y]);b=Float.$valueOf(a)}a=this.getShapeProperty(25,"nSets").intValue();if(m||1276117512!=p)this.showString((0==a?"":a+" contacts with ")+"net volume "+b+" A^3")}return!0});k(c$,"dipole",function(){var b=this.eval,a=null,c=null,d=!1,e=!1,f=!1;this.sm.loadShape(17);
if(1073742001==this.tokAt(1)&&this.listIsosurface(17))return!1;this.setShapeProperty(17,"init",null);if(1==this.slen)return this.setShapeProperty(17,"thisID",null),!1;for(var g=1;g<this.slen;++g){c=a=null;switch(this.getToken(g).tok){case 1048589:a="on";break;case 1048588:a="off";break;case 12291:a="delete";break;case 2:case 3:a="value";c=Float.$valueOf(this.floatParameter(g));break;case 10:a="atomBitset";case 1048577:null==a&&(a=d||e?"endSet":"startSet");c=this.atomExpressionAt(g);g=b.iToken;d=!0;
break;case 1048586:case 8:c=this.getPoint3f(g,!0);g=b.iToken;a=d||e?"endCoord":"startCoord";e=!0;break;case 1678770178:a="bonds";break;case 4102:a="calculate";break;case 1074790550:this.setShapeId(17,++g,f);g=b.iToken;break;case 135267329:a="cross";c=Boolean.TRUE;break;case 1073742040:a="cross";c=Boolean.FALSE;break;case 1073742066:c=this.floatParameter(++g);2==b.theTok?(a="offsetPercent",c=Integer.$valueOf(K(c))):(a="offset",c=Float.$valueOf(c));break;case 1073742068:a="offsetSide";c=Float.$valueOf(this.floatParameter(++g));
break;case 1073742188:a="value";c=Float.$valueOf(this.floatParameter(++g));break;case 1073742196:a="width";c=Float.$valueOf(this.floatParameter(++g));break;default:if(269484209==b.theTok||J.script.T.tokAttr(b.theTok,1073741824)){this.setShapeId(17,g,f);g=b.iToken;break}this.invArg()}f=12291!=b.theTok&&4102!=b.theTok;null!=a&&this.setShapeProperty(17,a,c)}(e||d)&&this.setShapeProperty(17,"set",null);return!0});k(c$,"draw",function(){var b=this.eval;this.sm.loadShape(22);switch(this.tokAt(1)){case 1073742001:if(this.listIsosurface(22))return!1;
break;case 1073742102:return this.pointGroup(),!1;case 137363468:case 135270418:case 1052714:return this.plot(this.st),!1}var a=!1,c=!1,d=!1,e=!1,f=!1,g,h=0,j=3.4028235E38;b.colorArgb[0]=-2147483648;for(var m=0,u="",n=0,p=null,k=this.initIsosurface(22),q=(g=null!=k)&&null==this.getShapeProperty(22,"ID"),A=null,w=0,s=b.iToken;s<this.slen;++s){var v=null,t=null;switch(this.getToken(s).tok){case 1614417948:case 1679429641:if(this.chk)break;a=this.viewer.getPlaneIntersection(b.theTok,null,m/100,0);m=
0;v="polygon";t=a;a=!0;break;case 4106:A=Q(4,0);w=4;a=b.floatParameterSet(++s,4,4);s=b.iToken;for(g=0;4>g;g++)A[g]=K(a[g]);a=!0;break;case 1678770178:case 1141899265:if(null==A||w>(1095761924==b.theTok?2:3))w=0,A=[-1,-1,-1,-1];A[w++]=this.atomExpressionAt(++s).nextSetBit(0);s=b.iToken;A[w++]=1678770178==b.theTok?this.atomExpressionAt(++s).nextSetBit(0):-1;s=b.iToken;a=!0;break;case 554176565:switch(this.getToken(++s).tok){case 1048583:v="slab";t=b.objectNameParameter(++s);s=b.iToken;a=!0;break;default:this.invArg()}break;
case 135267842:switch(this.getToken(++s).tok){case 1614417948:case 1679429641:h=b.theTok;e=!0;continue;case 1048583:v="intersect";t=b.objectNameParameter(++s);s=b.iToken;a=e=!0;break;default:this.invArg()}break;case 1073742106:var v="polygon",a=!0,t=new JU.List,G=0,B=0,y=null,I=null;if(b.isArrayParameter(++s))y=b.getPointArray(s,-1),G=y.length;else{G=Math.max(0,this.intParameter(s));y=Array(G);for(g=0;g<G;g++)y[g]=this.centerParameter(++b.iToken)}switch(this.getToken(++b.iToken).tok){case 11:case 12:s=
J.script.SV.newT(b.theToken);s.toArray();I=s.getList();B=I.size();break;case 7:I=b.theToken.getList();B=I.size();break;default:B=Math.max(0,this.intParameter(b.iToken))}s=JU.AU.newInt2(B);for(g=0;g<B;g++){var F=null==I?b.floatParameterSet(++b.iToken,3,4):J.script.SV.flistValue(I.get(g),0);(3>F.length||4<F.length)&&this.invArg();s[g]=[K(F[0]),K(F[1]),K(F[2]),3==F.length?7:K(F[3])]}0<G?(t.addLast(y),t.addLast(s)):t=null;s=b.iToken;break;case 1297090050:c=null;d=0;e=null;switch(this.tokAt(++s)){case 4:c=
this.stringParameter(s);break;case 12:c=J.script.SV.sValue(this.getToken(s));break;default:b.isCenterParameter(s)||(d=this.intParameter(s++));b.isCenterParameter(s)&&(p=this.centerParameter(s));b.isCenterParameter(b.iToken+1)&&(e=this.centerParameter(++b.iToken));if(this.chk)return!1;s=b.iToken}f=null;null==p&&s+1<this.slen&&(p=this.centerParameter(++s),f=10==this.tokAt(s)||1048577==this.tokAt(s)?this.atomExpressionAt(s):null);b.checkLast(b.iToken);this.chk||b.runScript(this.viewer.getSymmetryInfo(f,
c,d,p,e,k,135176));return!1;case 4115:f=!0;continue;case 1048586:case 9:case 8:if(9==b.theTok||!b.isPoint3f(s)){t=this.getPoint4f(s);if(f)return b.checkLast(b.iToken),this.chk||b.runScript(J.util.Quaternion.newP4(t).draw(null==k?"frame":k," "+u,null==p?new JU.P3:p,m/100)),!1;v="planedef"}else t=p=this.getPoint3f(s,!0),v="coord";s=b.iToken;a=!0;break;case 135267841:case 135266319:if(!a&&!e&&0==h&&135267841!=b.theTok){v="plane";break}g=135266319==b.theTok?b.planeParameter(++s):b.hklParameter(++s);s=
b.iToken;if(0!=h){if(this.chk)break;a=this.viewer.getPlaneIntersection(h,g,m/100,0);m=0;v="polygon";t=a}else t=g,v="planedef";a=!0;break;case 1073742E3:v="lineData";t=b.floatParameterSet(++s,0,2147483647);s=b.iToken;a=!0;break;case 10:case 1048577:v="atomSet";t=this.atomExpressionAt(s);f&&(p=this.centerParameter(s));s=b.iToken;a=!0;break;case 7:v="modelBasedPoints";t=J.script.SV.listValue(b.theToken);a=!0;break;case 1073742195:case 269484080:break;case 269484096:t=b.xypParameter(s);if(null!=t){s=
b.iToken;v="coord";a=!0;break}d&&this.invArg();d=!0;break;case 269484097:d||this.invArg();d=!1;break;case 1141899269:v="reverse";break;case 4:t=this.stringParameter(s);v="title";break;case 135198:v="vector";break;case 1141899267:t=Float.$valueOf(this.floatParameter(++s));v="length";break;case 3:t=Float.$valueOf(this.floatParameter(s));v="length";break;case 1095761935:v="modelIndex";t=Integer.$valueOf(this.intParameter(++s));break;case 2:d?(v="modelIndex",t=Integer.$valueOf(this.intParameter(s))):
m=this.intParameter(s);break;case 1073742138:++s>=this.slen&&this.error(34);switch(this.getToken(s).tok){case 2:m=this.intParameter(s);continue;case 3:m=Math.round(100*this.floatParameter(s));continue}this.error(34);break;case 1074790550:k=this.setShapeId(22,++s,g);q=null==this.getShapeProperty(22,"ID");s=b.iToken;break;case 1073742028:v="fixed";t=Boolean.FALSE;break;case 1060869:v="fixed";t=Boolean.TRUE;break;case 1073742066:g=this.getPoint3f(++s,!0);s=b.iToken;v="offset";t=g;break;case 1073741906:v=
"crossed";break;case 1073742196:t=Float.$valueOf(this.floatParameter(++s));v="width";u=v+" "+t;break;case 1073741998:v="line";t=Boolean.TRUE;break;case 1073741908:v="curve";break;case 1074790416:v="arc";break;case 1073741846:v="arrow";break;case 1073741880:v="circle";break;case 1073741912:v="cylinder";break;case 1073742194:v="vertices";break;case 1073742048:v="nohead";break;case 1073741861:v="isbarb";break;case 1073742130:v="rotate45";break;case 1073742092:v="perp";break;case 1666189314:case 1073741916:u=
1666189314==b.theTok;F=this.floatParameter(++s);u&&(F*=2);t=Float.$valueOf(F);v=u||3==this.tokAt(s)?"width":"diameter";u=v+(3==this.tokAt(s)?" "+F:" "+K(F));break;case 1048583:if(269484096==this.tokAt(s+2)||f){a=p=this.centerParameter(s);s=b.iToken;v="coord";t=a;a=!0;break}t=b.objectNameParameter(++s);v="identifier";a=!0;break;case 1766856708:case 603979967:case 1073742074:g=!0;j=b.getColorTrans(s,!1);s=b.iToken;continue;default:if(!b.setMeshDisplayProperty(22,0,b.theTok)){if(269484209==b.theTok||
J.script.T.tokAttr(b.theTok,1073741824)){k=this.setShapeId(22,s,g);s=b.iToken;break}this.invArg()}0==n&&(n=s);s=b.iToken;continue}g=12291!=b.theTok;a&&(!c&&!f)&&(this.setShapeProperty(22,"points",Integer.$valueOf(m)),c=!0,m=0);a&&q&&this.invArg();null!=v&&this.setShapeProperty(22,v,t)}b.finalizeObject(22,b.colorArgb[0],j,m,a,A,n,null);return!0});k(c$,"isosurface",function(b){var a=this.eval;this.sm.loadShape(b);if(1073742001==this.tokAt(1)&&this.listIsosurface(b))return!1;var c=0,d=24==b,e=28==b,
f=29==b,g=26==b,h=!1,j=!1,m=!1,u=!1,n=!1,p=!1,k=!1,q=!1,A=!1,w=!1,s=!1,v=!1,t=!1,G=!1,B=null,y=null,I=-2147483648,F,L,U,x,Fa,la=NaN,T=NaN,W=0,Q=null,ua=2147483647,N=null,O=null,Y=null,r=new JU.SB,M,va=null,ia=null,ma,ba=0,Z=null,P=this.chk?0:-2147483648;a.setCursorWait(!0);var ja=null!=this.initIsosurface(b),ta=ja&&null==this.getShapeProperty(b,"ID"),hb=!1,Ra=!1,wa=null,Sa=null,ca=null,Ta=null,qa=null,xa=null,D=new JU.List,ib=!1;(e||f)&&this.addShapeProperty(D,"fileType","Pmesh");for(var l=a.iToken;l<
this.slen;++l){var C=null,z=null;this.getToken(l);1073741824==a.theTok&&(Z=this.parameterAsString(l));switch(a.theTok){case 603979871:Q=1048589==this.getToken(++l).tok?Boolean.TRUE:1048588==a.theTok?Boolean.FALSE:null;null==Q&&this.invArg();continue;case 553648149:ua=this.intParameter(++l);continue;case 4128:C="moveIsosurface";12!=this.tokAt(++l)&&this.invArg();z=this.getToken(l++).value;break;case 1297090050:for(var jb=this.floatArraySet(l+2,this.intParameter(l+1),16),qa=Array(jb.length),da=qa.length;0<=
--da;)qa[da]=JU.M4.newA(jb[da]);l=a.iToken;break;case 1089470478:0>P&&(P=Math.min(this.viewer.getCurrentModelIndex(),0));var kb=null==Y;null==O&&(O=J.util.BSUtil.copy(this.viewer.getSelectionSet(!1)));O.and(this.viewer.getAtomBits(1297090050,Integer.$valueOf(1)));kb||O.andNot(Y);this.addShapeProperty(D,"select",O);kb&&(Y=J.util.BSUtil.copy(O),J.util.BSUtil.invertInPlace(Y,this.viewer.getAtomCount()),G=!0,this.addShapeProperty(D,"ignore",Y),r.append(" ignore ").append(J.util.Escape.eBS(Y)));r.append(" symmetry");
0==ba&&this.addShapeProperty(D,"colorRGB",Integer.$valueOf(1297090050));qa=this.viewer.modelSet.getSymMatrices(P);break;case 1073742066:C="offset";z=this.centerParameter(++l);l=a.iToken;break;case 528432:C="rotate";z=1048587==this.tokAt(a.iToken=++l)?null:this.getPoint4f(l);l=a.iToken;break;case 1610612740:C="scale3d";z=Float.$valueOf(this.floatParameter(++l));break;case 1073742090:r.append(" periodic");C="periodic";break;case 1073742078:case 266298:case 135266320:C=a.theToken.value.toString();r.append(" ").appendO(a.theToken.value);
z=this.centerParameter(++l);r.append(" ").append(J.util.Escape.eP(z));l=a.iToken;break;case 1679429641:if(0<=this.fullCommand.indexOf("# BBOX=")){var lb=JU.PT.split(JU.PT.getQuotedAttribute(this.fullCommand,"# BBOX"),",");ma=[J.util.Escape.uP(lb[0]),J.util.Escape.uP(lb[1])]}else a.isCenterParameter(l+1)?(ma=[this.getPoint3f(l+1,!0),this.getPoint3f(a.iToken+1,!0)],l=a.iToken):ma=this.viewer.getBoundBoxVertices();r.append(" boundBox "+J.util.Escape.eP(ma[0])+" "+J.util.Escape.eP(ma[ma.length-1]));C=
"boundingBox";z=ma;break;case 135188:e=!0;r.append(" pmesh");C="fileType";z="Pmesh";break;case 135267842:O=this.atomExpressionAt(++l);this.chk?N=new JU.BS:1048577==this.tokAt(a.iToken+1)||10==this.tokAt(a.iToken+1)?(N=this.atomExpressionAt(++a.iToken),N.and(this.viewer.getAtomsWithinRadius(5,O,!1,null))):(N=this.viewer.getAtomsWithinRadius(5,O,!0,null),N.andNot(this.viewer.getAtomBits(1095761936,O)));N.andNot(O);r.append(" intersection ").append(J.util.Escape.eBS(O)).append(" ").append(J.util.Escape.eBS(N));
l=a.iToken;if(135368713==this.tokAt(l+1)){l++;var ya=this.getToken(++l).value;r.append(" function ").append(J.util.Escape.eS(ya));this.chk||this.addShapeProperty(D,"func",ya.equals("a+b")||ya.equals("a-b")?ya:this.createFunction("__iso__","a,b",ya))}else t=!0;C="intersection";z=[O,N];break;case 1610625028:case 135266325:var Ua=1610625028==a.theTok;if(Ua){r.append(" display");var c=l,fa=this.tokAt(l+1);if(0==fa)continue;l++;this.addShapeProperty(D,"token",Integer.$valueOf(1048589));if(10==fa||1048579==
fa){C="bsDisplay";1048579==fa?r.append(" all"):(z=this.st[l].value,r.append(" ").append(J.util.Escape.eBS(z)));a.checkLast(l);break}else 135266325!=fa&&(a.iToken=l,this.invArg())}else W=l;var Ga,na=null,N=null,Va=!1;1048577==this.tokAt(l+1)?(Ga=this.floatParameter(l+3),a.isPoint3f(l+4)?(na=this.centerParameter(l+4),Va=!0,a.iToken+=2):a.isPoint3f(l+5)?(na=this.centerParameter(l+5),Va=!0,a.iToken+=2):(N=a.atomExpression(this.st,l+5,this.slen,!0,!1,!1,!0),null==N&&this.invArg())):(Ga=this.floatParameter(++l),
na=this.centerParameter(++l));Ua&&a.checkLast(a.iToken);l=a.iToken;0<=this.fullCommand.indexOf("# WITHIN=")?N=J.util.Escape.uB(JU.PT.getQuotedAttribute(this.fullCommand,"# WITHIN")):Va||(N=H(a.expressionResult,JU.BS)?a.expressionResult:null);this.chk||(null!=N&&0<=P&&N.and(this.viewer.getModelUndeletedAtomsBitSet(P)),null==na&&(na=this.viewer.getAtomSetCenter(N)),this.getWithinDistanceVector(D,Ga,na,N,Ua),r.append(" within ").appendF(Ga).append(" ").append(null==N?J.util.Escape.eP(na):J.util.Escape.eBS(N)));
continue;case 1073742083:var C="parameters",mb=a.floatParameterSet(++l,1,10),l=a.iToken,z=mb;r.append(" parameters ").append(J.util.Escape.eAF(mb));break;case 1716520985:case 1073742190:var wa=a.theToken.value,Na=1073742190==a.theTok,za=this.tokAt(l+1);null==Ta?(!h&&(!m&&!j)&&(this.addShapeProperty(D,"sasurface",Float.$valueOf(0)),r.append(" vdw"),h=!0),C="property",null==Q&&(Q=J.script.T.tokAttr(za,1112539136)&&1==this.viewer.getIsosurfacePropertySmoothing(!1)?Boolean.TRUE:Boolean.FALSE),this.addShapeProperty(D,
"propertySmoothing",Q),r.append(" isosurfacePropertySmoothing "+Q),Q===Boolean.TRUE&&(2147483647==ua&&(ua=this.viewer.getIsosurfacePropertySmoothing(!0)),this.addShapeProperty(D,"propertySmoothingPower",Integer.$valueOf(ua)),r.append(" isosurfacePropertySmoothingPower "+ua)),this.viewer.global.rangeSelected&&this.addShapeProperty(D,"rangeSelected",Boolean.TRUE)):C=Ta;Z=this.parameterAsString(l);r.append(" ").append(Z);if(0==Z.toLowerCase().indexOf("property_")){B=E(this.viewer.getAtomCount(),0);if(this.chk)continue;
B=this.viewer.getDataFloat(Z);null==B&&this.invArg();this.addShapeProperty(D,C,B);continue}var Aa=this.viewer.getAtomCount(),B=E(Aa,0);if(Na){var nb=this.parameterAsString(++l);0==nb.length?B=a.floatParameterSet(l,Aa,Aa):(B=E(Aa,0),this.chk||J.util.Parser.parseStringInfestedFloatArray(""+a.getParameter(nb,4),null,B));this.chk||r.append(' "" ').append(J.util.Escape.eAF(B))}else{this.getToken(++l);if(!this.chk){r.append(" "+a.theToken.value);var Oa=this.viewer.modelSet.atoms;this.viewer.autoCalculate(za);
if(1766856708!=za)for(var Wa=Aa;0<=--Wa;)B[Wa]=J.modelset.Atom.atomPropertyFloat(this.viewer,Oa[Wa],za)}1766856708==za&&(ca="inherit");if(135266325==this.tokAt(l+1)){var ob=this.floatParameter(l+=2);r.append(" within "+ob);this.addShapeProperty(D,"propertyDistanceMax",Float.$valueOf(ob))}}z=B;break;case 1095761935:case 1095766030:h&&this.invArg();P=1095761935==a.theTok?this.intParameter(++l):a.modelNumberParameter(++l);r.append(" modelIndex "+P);if(0>P){C="fixed";z=Boolean.TRUE;break}C="modelIndex";
z=Integer.$valueOf(P);break;case 135280132:var C="select",Xa=this.atomExpressionAt(++l),z=Xa,l=a.iToken;1073742072==this.tokAt(l+1)&&(l++,Y=J.util.BSUtil.copy(Xa),J.util.BSUtil.invertInPlace(Y,this.viewer.getAtomCount()),this.addShapeProperty(D,"ignore",Y),r.append(" ignore ").append(J.util.Escape.eBS(Y)),G=!0);h||m?r.append(" select "+J.util.Escape.eBS(Xa)):(O=z,0>P&&0<=O.nextSetBit(0)&&(P=this.viewer.getAtomModelIndex(O.nextSetBit(0))));break;case 1085443:I=this.intParameter(++l);break;case 12289:C=
"center";z=this.centerParameter(++l);r.append(" center "+J.util.Escape.eP(z));l=a.iToken;break;case 1073742147:case 1766856708:var ja=!0,Ya=1073742147==a.theTok;if(Ya)r.append(" sign"),this.addShapeProperty(D,"sign",Boolean.TRUE);else{if(1073741914==this.tokAt(l+1)){l++;C="colorDensity";r.append(" color density");if(this.isFloatParameter(l+1)){var pb=this.floatParameter(++l);r.append(" "+pb);z=Float.$valueOf(pb)}break}if(4==this.getToken(l+1).tok)ca=this.parameterAsString(++l),0<ca.indexOf(" ")&&
(xa=J.util.C.getColixArray(ca),null==xa&&this.error(4));else if(1073742018==a.theTok){l++;r.append(" color mesh");ba=a.getArgbParam(++l);this.addShapeProperty(D,"meshcolor",Integer.$valueOf(ba));r.append(" ").append(J.util.Escape.escapeColor(ba));l=a.iToken;continue}if(603979967==(a.theTok=this.tokAt(l+1))||1073742074==a.theTok){r.append(" color");Sa=this.setColorOptions(r,l+1,24,-2);l=a.iToken;continue}switch(this.tokAt(l+1)){case 1073741826:case 1073742114:this.getToken(++l);r.append(" color range");
this.addShapeProperty(D,"rangeAll",null);if(1048579==this.tokAt(l+1)){l++;r.append(" all");continue}var qb=this.floatParameter(++l),rb=this.floatParameter(++l);this.addShapeProperty(D,"red",Float.$valueOf(qb));this.addShapeProperty(D,"blue",Float.$valueOf(rb));r.append(" ").appendF(qb).append(" ").appendF(rb);continue}if(a.isColorParam(l+1)&&(ba=a.getArgbParam(l+1),1074790746==this.tokAt(l+2))){ca=a.getColorRange(l+1);l=a.iToken;break}r.append(" color")}a.isColorParam(l+1)?(ba=a.getArgbParam(++l),
r.append(" ").append(J.util.Escape.escapeColor(ba)),l=a.iToken,this.addShapeProperty(D,"colorRGB",Integer.$valueOf(ba)),ja=!0,a.isColorParam(l+1)?(ba=a.getArgbParam(++l),l=a.iToken,this.addShapeProperty(D,"colorRGB",Integer.$valueOf(ba)),r.append(" ").append(J.util.Escape.escapeColor(ba)),u=!0):Ya&&this.invPO()):!Ya&&null==xa&&this.invPO();continue;case 135270423:d||this.invArg();w=!this.chk;continue;case 1229984263:4!=this.tokAt(l+1)&&this.invPO();continue;case 1112541195:case 1649412120:r.append(" ").appendO(a.theToken.value);
var Ha=a.encodeRadiusParameter(l,!1,!0);r.append(" ").appendO(Ha);Float.isNaN(Ha.value)&&(Ha.value=100);z=Ha;C="radius";A=!0;m&&(h=!1);l=a.iToken;break;case 135266319:j=!0;C="plane";z=a.planeParameter(++l);l=a.iToken;r.append(" plane ").append(J.util.Escape.eP4(z));break;case 1073742138:C="scale";z=Float.$valueOf(this.floatParameter(++l));r.append(" scale ").appendO(z);break;case 1048579:ja&&this.invArg();C="thisID";break;case 1113198596:h=!0;++l;z=this.getPoint4f(l);C="ellipsoid";l=a.iToken;r.append(" ellipsoid ").append(J.util.Escape.eP4(z));
break;case 135267841:j=!0;C="plane";z=a.hklParameter(++l);l=a.iToken;r.append(" plane ").append(J.util.Escape.eP4(z));break;case 135182:var h=!0,Ia=this.parameterAsString(++l);this.addShapeProperty(D,"lcaoType",Ia);r.append(" lcaocartoon ").append(J.util.Escape.eS(Ia));switch(this.getToken(++l).tok){case 10:case 1048577:C="lcaoCartoon";N=this.atomExpressionAt(l);l=a.iToken;if(this.chk)continue;var Ba=N.nextSetBit(0);0>Ba&&this.error(14);r.append(" ({").appendI(Ba).append("})");P=this.viewer.getAtomModelIndex(Ba);
this.addShapeProperty(D,"modelIndex",Integer.$valueOf(P));var Za=[new JU.V3,new JU.V3,JU.V3.newV(this.viewer.getAtomPoint3f(Ba)),new JU.V3];if(!Ia.equalsIgnoreCase("s")&&null==this.viewer.getHybridizationAndAxes(Ba,Za[0],Za[1],Ia))return!1;z=Za;break;default:this.error(14)}break;case 1183762:var Ca=2147483647,ra=2147483647,$a=269484192==this.tokAt(l+1);$a&&l++;var Da=null;switch(this.tokAt(++l)){case 0:this.error(2);break;case 1073741914:r.append("mo [1] squared ");this.addShapeProperty(D,"squareLinear",
Boolean.TRUE);Da=[1];ra=Ca=0;l++;break;case 1073741973:case 1073742008:ra=this.moOffset(l);Ca=0;l=a.iToken;r.append(" mo "+($a?"-":"")+"HOMO ");0<ra&&r.append("+");0!=ra&&r.appendI(ra);break;case 2:Ca=this.intParameter(l);r.append(" mo ").appendI(Ca);break;default:a.isArrayParameter(l)&&(Da=a.floatParameterSet(l,1,2147483647),l=a.iToken)}if(1073742156==this.tokAt(l+1))this.addShapeProperty(D,"squareLinear",Boolean.TRUE),r.append(" squared"),null==Da&&(Da=E(0,0));else if(135266320==this.tokAt(l+1)){++l;
var sb=this.intParameter(++l),tb=2==this.tokAt(l+1)?this.intParameter(++l):-System.currentTimeMillis()%1E4;this.addShapeProperty(D,"monteCarloCount",Integer.$valueOf(sb));this.addShapeProperty(D,"randomSeed",Integer.$valueOf(tb));r.append(" points ").appendI(sb).appendC(" ").appendI(tb)}this.setMoData(D,Ca,Da,ra,$a,P,null);h=!0;continue;case 1073742036:C="nci";r.append(" "+C);var fa=this.tokAt(l+1),ub=1229984263!=fa&&4!=fa&&1073742033!=fa,z=Boolean.$valueOf(ub);ub&&(h=!0);break;case 1073742016:case 1073742022:var vb=
1073742016==a.theTok,C=vb?"mep":"mlp";r.append(" "+C);var Ja=null,ab=-1,h=!0;2==this.tokAt(l+1)&&(ab=this.intParameter(++l),r.append(" "+ab),this.addShapeProperty(D,"mepCalcType",Integer.$valueOf(ab)));if(4==this.tokAt(l+1))Ja=this.stringParameter(++l),r.append(" /*file*/"+J.util.Escape.eS(Ja));else if(1716520985==this.tokAt(l+1)){Ta=C;continue}if(!this.chk)try{B=null==Ja&&vb?this.viewer.getPartialCharges():this.getAtomicPotentials(O,Y,Ja)}catch(wb){if(!aa(wb,Exception))throw wb;}!this.chk&&null==
B&&this.error(32);z=B;break;case 1313866249:k=!this.chk;r.append(" volume");break;case 1074790550:this.setShapeId(b,++l,ja);ta=null==this.getShapeProperty(b,"ID");l=a.iToken;break;case 1073741888:603979967==this.tokAt(l+1)&&(hb=!0,l++);ca=this.parameterAsString(++l).toLowerCase();ca.equals("sets")?r.append(' colorScheme "sets"'):a.isColorParam(l)&&(ca=a.getColorRange(l),l=a.iToken);break;case 1073741828:C="addHydrogens";z=Boolean.TRUE;r.append(" mp.addHydrogens");break;case 1073741836:C="angstroms";
r.append(" angstroms");break;case 1073741838:C="anisotropy";z=this.getPoint3f(++l,!1);r.append(" anisotropy").append(J.util.Escape.eP(z));l=a.iToken;break;case 1073741842:p=!this.chk;r.append(" area");break;case 1073741850:case 1073742076:h=!0;u&&!n&&(r.append(' phase "_orb"'),this.addShapeProperty(D,"phase","_orb"));var V=E(7,0);V[0]=this.intParameter(++l);V[1]=this.intParameter(++l);V[2]=this.intParameter(++l);V[3]=this.isFloatParameter(l+1)?this.floatParameter(++l):6;r.append(" atomicOrbital ").appendI(K(V[0])).append(" ").appendI(K(V[1])).append(" ").appendI(K(V[2])).append(" ").appendF(V[3]);
135266320==this.tokAt(l+1)&&(l+=2,V[4]=this.intParameter(l),V[5]=3==this.tokAt(l+1)?this.floatParameter(++l):0,V[6]=2==this.tokAt(l+1)?this.intParameter(++l):-System.currentTimeMillis()%1E4,r.append(" points ").appendI(K(V[4])).appendC(" ").appendF(V[5]).appendC(" ").appendI(K(V[6])));C="hydrogenOrbital";z=V;break;case 1073741866:r.append(" binary");continue;case 1073741868:r.append(" blockData");C="blockData";z=Boolean.TRUE;break;case 1074790451:case 554176565:v=!0;C=a.theToken.value;z=this.getCapSlabObject(l,
!1);l=a.iToken;break;case 1073741876:d||this.invArg();q=!0;if(this.chk)continue;var xb=this.isFloatParameter(l+1)?this.floatParameter(++l):1.2,bb=this.isFloatParameter(l+1)?this.floatParameter(++l):10;10<bb&&a.integerOutOfRange(0,10);r.append(" cavity ").appendF(xb).append(" ").appendF(bb);this.addShapeProperty(D,"envelopeRadius",Float.$valueOf(bb));this.addShapeProperty(D,"cavityRadius",Float.$valueOf(xb));C="cavity";break;case 1073741896:case 1073741900:C="contour";r.append(" contour");switch(this.tokAt(l+
1)){case 1073741920:z=a.floatParameterSet(l+2,1,2147483647);r.append(" discrete ").append(J.util.Escape.eAF(z));l=a.iToken;break;case 1073741981:M=this.getPoint3f(l+2,!1);(0>=M.z||M.y<M.x)&&this.invArg();M.z==K(M.z)&&M.z>M.y-M.x&&(M.z=(M.y-M.x)/M.z);z=M;l=a.iToken;r.append(" increment ").append(J.util.Escape.eP(M));break;default:z=Integer.$valueOf(2==this.tokAt(l+1)?this.intParameter(++l):0),r.append(" ").appendO(z)}break;case 3:case 2:case 269484193:case 1073741910:r.append(" cutoff ");1073741910==
a.theTok&&l++;269484193==this.tokAt(l)?(C="cutoffPositive",z=Float.$valueOf(T=this.floatParameter(++l)),r.append("+").appendO(z)):this.isFloatParameter(l)?(C="cutoff",z=Float.$valueOf(T=this.floatParameter(l)),r.appendO(z)):(C="cutoffRange",z=a.floatParameterSet(l,2,2),this.addShapeProperty(D,"cutoff",Float.$valueOf(0)),r.append(J.util.Escape.eAF(z)),l=a.iToken);break;case 1073741928:C="downsample";z=Integer.$valueOf(this.intParameter(++l));r.append(" downsample ").appendO(z);break;case 1073741930:C=
"eccentricity";z=this.getPoint4f(++l);r.append(" eccentricity ").append(J.util.Escape.eP4(z));l=a.iToken;break;case 1074790508:r.append(" ed");this.setMoData(D,-1,null,0,!1,P,null);h=!0;continue;case 536870916:case 1073742041:r.append(" ").appendO(a.theToken.value);C="debug";z=536870916==a.theTok?Boolean.TRUE:Boolean.FALSE;break;case 1060869:r.append(" fixed");C="fixed";z=Boolean.TRUE;break;case 1073741962:r.append(" fullPlane");C="fullPlane";z=Boolean.TRUE;break;case 1073741966:case 1073741968:var Pa=
1073741968==a.theTok,C=""+a.theToken.value,ga=new JU.List,z=ga,s=h=!0;r.append(" ").append(C);var X=this.parameterAsString(++l);if(X.equals("=")){r.append(" =");X=this.parameterAsString(++l);r.append(" ").append(J.util.Escape.eS(X));ga.addLast(X);this.chk||this.addShapeProperty(D,"func",this.createFunction("__iso__","x,y,z",X));break}var cb=JU.PT.getQuotedAttribute(this.fullCommand,"# DATA"+(s?"2":""));null==cb?cb="inline":X=cb;var yb=0==X.indexOf("data2d_"),Qa=0==X.indexOf("data3d_"),Ra=X.equals("inline");
r.append(" inline");ga.addLast(X);var zb=this.getPoint3f(++l,!1);r.append(" ").append(J.util.Escape.eP(zb));ga.addLast(zb);var ha;x=++a.iToken;ga.addLast(ha=this.getPoint4f(x));r.append(" ").append(J.util.Escape.eP4(ha));F=K(ha.x);Fa=++a.iToken;ga.addLast(ha=this.getPoint4f(Fa));r.append(" ").append(J.util.Escape.eP4(ha));L=K(ha.x);ga.addLast(ha=this.getPoint4f(++a.iToken));r.append(" ").append(J.util.Escape.eP4(ha));U=K(ha.x);(0==F||0==L||0==U)&&this.invArg();if(!this.chk){var $=null,ea=null;if(Pa){Ra?
(F=Math.abs(F),L=Math.abs(L),U=Math.abs(U),ea=this.floatArraySetXYZ(++a.iToken,F,L,U)):ea=Qa?this.viewer.getDataFloat3D(X):this.viewer.functionXYZ(X,F,L,U);F=Math.abs(F);L=Math.abs(L);U=Math.abs(U);null==ea&&(a.iToken=x,a.errorStr(53,"xyzdata is null."));if(ea.length!=F||ea[0].length!=L||ea[0][0].length!=U)a.iToken=x,a.errorStr(53,"xyzdata["+ea.length+"]["+ea[0].length+"]["+ea[0][0].length+"] is not of size ["+F+"]["+L+"]["+U+"]");ga.addLast(ea);r.append(" ").append(J.util.Escape.e(ea))}else{Ra?(F=
Math.abs(F),L=Math.abs(L),$=this.floatArraySet(++a.iToken,F,L)):yb?($=this.viewer.getDataFloat2D(X),F=null==$?0:$.length,L=3):($=this.viewer.functionXY(X,F,L),F=Math.abs(F),L=Math.abs(L));null==$&&(a.iToken=x,a.errorStr(53,"fdata is null."));$.length!=F&&!yb&&(a.iToken=x,a.errorStr(53,"fdata length is not correct: "+$.length+" "+F+"."));for(da=0;da<F;da++)null==$[da]&&(a.iToken=Fa,a.errorStr(53,"fdata["+da+"] is null.")),$[da].length!=L&&(a.iToken=Fa,a.errorStr(53,"fdata["+da+"] is not the right length: "+
$[da].length+" "+L+"."));ga.addLast($);r.append(" ").append(J.util.Escape.e($))}}l=a.iToken;break;case 1073741970:C="gridPoints";r.append(" gridPoints");break;case 1073741976:C="ignore";z=Y=this.atomExpressionAt(++l);r.append(" ignore ").append(J.util.Escape.eBS(Y));l=a.iToken;break;case 1073741984:C="insideOut";r.append(" insideout");break;case 1073741988:case 1073741986:case 1073742100:r.append(" ").appendO(a.theToken.value);C="pocket";z=1073742100==a.theTok?Boolean.TRUE:Boolean.FALSE;break;case 1073742002:C=
"lobe";z=this.getPoint4f(++l);l=a.iToken;r.append(" lobe ").append(J.util.Escape.eP4(z));h=!0;break;case 1073742004:case 1073742006:C="lp";z=this.getPoint4f(++l);l=a.iToken;r.append(" lp ").append(J.util.Escape.eP4(z));h=!0;break;case 1052700:(m||this.slen==l+1)&&this.invArg();m=!0;if((q||A||t)&&!h)h=!0,this.addShapeProperty(D,"bsSolvent",A||t?new JU.BS:a.lookupIdentifierValue("solvent")),this.addShapeProperty(D,"sasurface",Float.$valueOf(0));0==r.length()?(va=this.getShapeProperty(24,"plane"),null==
va?null!=this.getShapeProperty(24,"contours")&&this.addShapeProperty(D,"nocontour",null):(this.addShapeProperty(D,"plane",va),r.append("plane ").append(J.util.Escape.eP4(va)),j=!0,va=null)):!h&&!j&&this.invArg();r.append("; isosurface map");this.addShapeProperty(D,"map",h?Boolean.TRUE:Boolean.FALSE);break;case 1073742014:C="maxset";z=Integer.$valueOf(this.intParameter(++l));r.append(" maxSet ").appendO(z);break;case 1073742020:C="minset";z=Integer.$valueOf(this.intParameter(++l));r.append(" minSet ").appendO(z);
break;case 1073742112:h=!0;C="rad";z=this.getPoint4f(++l);l=a.iToken;r.append(" radical ").append(J.util.Escape.eP4(z));break;case 1073742028:C="fixed";z=Boolean.FALSE;r.append(" modelBased");break;case 1073742029:case 1073742136:case 1613758488:var wa=a.theToken.value,Ka;1073742029==a.theTok?(C="molecular",r.append(" molecular"),Ka=this.isFloatParameter(l+1)?this.floatParameter(++l):1.4):(this.addShapeProperty(D,"bsSolvent",a.lookupIdentifierValue("solvent")),C=1073742136==a.theTok?"sasurface":"solvent",
r.append(" ").appendO(a.theToken.value),Ka=this.isFloatParameter(l+1)?this.floatParameter(++l):this.viewer.getFloat(570425394));r.append(" ").appendF(Ka);z=Float.$valueOf(Ka);1073741961==this.tokAt(l+1)&&(this.addShapeProperty(D,"doFullMolecular",null),r.append(" full"),l++);h=!0;break;case 1073742033:this.addShapeProperty(D,"fileType","Mrc");r.append(" mrc");continue;case 1073742064:case 1073742062:this.addShapeProperty(D,"fileType","Obj");r.append(" obj");continue;case 1073742034:this.addShapeProperty(D,
"fileType","Msms");r.append(" msms");continue;case 1073742094:h&&this.invArg();C="phase";n=!0;z=4==this.tokAt(l+1)?this.stringParameter(++l):"_orb";r.append(" phase ").append(J.util.Escape.eS(z));break;case 1073742104:case 1073742122:C="resolution";z=Float.$valueOf(this.floatParameter(++l));r.append(" resolution ").appendO(z);break;case 1073742124:C="reverseColor";z=Boolean.TRUE;r.append(" reversecolor");break;case 1073742146:C="sigma";z=Float.$valueOf(la=this.floatParameter(++l));r.append(" sigma ").appendO(z);
break;case 1113198597:C="geodesic";z=Float.$valueOf(this.floatParameter(++l));r.append(" geosurface ").appendO(z);h=!0;break;case 1073742154:C="sphere";z=Float.$valueOf(this.floatParameter(++l));r.append(" sphere ").appendO(z);h=!0;break;case 1073742156:C="squareData";z=Boolean.TRUE;r.append(" squared");break;case 1073741983:C=!h&&!j&&!m?"readFile":"mapColor";Z=this.stringParameter(++l);null==Z&&this.invArg();e&&(Z=JU.PT.replaceAllCharacter(Z,"{,}|"," "));a.logMessages&&J.util.Logger.debug("pmesh inline data:\n"+
Z);z=this.chk?null:Z;this.addShapeProperty(D,"fileName","");r.append(" INLINE ").append(J.util.Escape.eS(Z));h=!0;break;case 4:var La=!h&&!j,C=La&&!m?"readFile":"mapColor",S=this.parameterAsString(l);if(S.startsWith("=")&&1<S.length){var Ab=this.viewer.setLoadFormat(S,"_",!1),S=Ab[0],Bb=!La||!Float.isNaN(T)?null:Ab[1];null!=Bb&&!this.chk&&(T=J.script.SV.fValue(J.script.SV.getVariable(this.viewer.evaluateExpression(Bb))),0<T&&(Float.isNaN(la)||(T*=la,la=NaN,this.addShapeProperty(D,"sigma",Float.$valueOf(la))),
this.addShapeProperty(D,"cutoff",Float.$valueOf(T)),r.append(" cutoff ").appendF(T)));0==W&&(wa="=xxxx",0>P&&(P=this.viewer.getCurrentModelIndex()),N=this.viewer.getModelUndeletedAtomsBitSet(P),this.getWithinDistanceVector(D,2,null,N,!1),r.append(" within 2.0 ").append(J.util.Escape.eBS(N)));La&&(ib=!0)}La&&(this.viewer.getParameter("_fileType").equals("Pdb")&&Float.isNaN(la)&&Float.isNaN(T))&&(this.addShapeProperty(D,"sigma",Float.$valueOf(-1)),r.append(" sigma -1.0"));0==S.length&&(0>P&&(P=this.viewer.getCurrentModelIndex()),
S=a.getFullPathName(),z=this.viewer.getModelAuxiliaryInfoValue(P,"jmolSurfaceInfo"));var db=-1;null==z&&2==this.tokAt(l+1)&&this.addShapeProperty(D,"fileIndex",Integer.$valueOf(db=this.intParameter(++l)));var Ea=4==this.tokAt(l+1)?this.stringParameter(++l):null,h=!0;if(this.chk)break;var sa,ka=null;null==z&&(0<=this.fullCommand.indexOf("# FILE0=")?(S=JU.PT.getQuotedAttribute(this.fullCommand,"# FILE0"),1073741848==this.tokAt(l+1)&&(l+=2)):1073741848==this.tokAt(l+1)&&(ka=this.viewer.getFilePath(this.stringParameter(a.iToken=
l+=2),!1),sa=this.viewer.getFullPathNameOrError(ka),ka=sa[0],""!==this.viewer.getPathForAllFiles()?(S=ka,ka=null):this.addShapeProperty(D,"localName",ka)));!S.startsWith("cache://")&&null==Ea&&(sa=this.viewer.getFullPathNameOrError(S),S=sa[0],null!=sa[1]&&a.errorStr(17,S+":"+sa[1]));J.util.Logger.info("reading isosurface data from "+S);null!=Ea&&(z=this.viewer.cacheGet(S),this.addShapeProperty(D,"calculationType",Ea));null==z&&(this.addShapeProperty(D,"fileName",S),null!=ka&&(S=ka),0<=db&&r.append(" ").appendI(db));
r.append(" /*file*/").append(J.util.Escape.eS(S));null!=Ea&&r.append(" ").append(J.util.Escape.eS(Ea));break;case 4106:C="connections";switch(this.tokAt(++l)){case 10:case 1048577:z=[this.atomExpressionAt(l).nextSetBit(0)];break;default:z=[K(a.floatParameterSet(l,1,1)[0])]}l=a.iToken;break;case 1095761923:C="atomIndex";z=Integer.$valueOf(this.intParameter(++l));break;case 1073741999:C="link";r.append(" link");break;case 1073741994:24!=b&&this.invArg();M=this.getPoint3f(a.iToken+1,!1);l=a.iToken;if(0>=
M.x||0>=M.y||0>=M.z)break;M.x=K(M.x);M.y=K(M.y);M.z=K(M.z);r.append(" lattice ").append(J.util.Escape.eP(M));m?(C="mapLattice",z=M):ia=M;break;default:1073741824==a.theTok&&(C="thisID",z=Z);if(!a.setMeshDisplayProperty(b,0,a.theTok)){if(J.script.T.tokAttr(a.theTok,1073741824)&&!ja){this.setShapeId(b,l,ja);l=a.iToken;break}this.invArg()}0==c&&(c=l);l=this.slen-1}ja=12291!=a.theTok;ta&&h&&this.invArg();null!=C&&this.addShapeProperty(D,C,z)}if(!this.chk){if((q||A)&&!h)h=!0,this.addShapeProperty(D,"bsSolvent",
A?new JU.BS:a.lookupIdentifierValue("solvent")),this.addShapeProperty(D,"sasurface",Float.$valueOf(0));j&&(!h&&!m)&&(this.addShapeProperty(D,"nomap",Float.$valueOf(0)),h=!0);-1<=I&&this.addShapeProperty(D,"getSurfaceSets",Integer.$valueOf(I-1));if(null!=xa)this.addShapeProperty(D,"colorDiscrete",xa);else if("sets".equals(ca))this.addShapeProperty(D,"setColorScheme",null);else if(null!=ca){var Ma=this.viewer.getColorEncoder(ca);null!=Ma&&(Ma.isTranslucent=hb,Ma.hi=3.4028235E38,this.addShapeProperty(D,
"remapColor",Ma))}if(h&&!g&&0!=r.indexOf(";")){D.add(0,["newObject",null]);var Cb=null==O;Cb&&(O=J.util.BSUtil.copy(this.viewer.getSelectionSet(!1)));0>P&&(P=this.viewer.getCurrentModelIndex());O.and(this.viewer.getModelUndeletedAtomsBitSet(P));null!=wa&&(1!=this.viewer.getModelBitSet(O,!1).cardinality()&&a.errorStr(30,"ISOSURFACE "+wa),Cb&&(D.add(0,["select",O]),0==r.indexOf("; isosurface map")&&(r=(new JU.SB).append("; isosurface map select ").append(J.util.Escape.eBS(O)).append(r.substring(16)))))}t&&
!v&&(h||this.addShapeProperty(D,"sasurface",Float.$valueOf(0)),m||(this.addShapeProperty(D,"map",Boolean.TRUE),this.addShapeProperty(D,"select",N),this.addShapeProperty(D,"sasurface",Float.$valueOf(0))),this.addShapeProperty(D,"slab",this.getCapSlabObject(-100,!1)));var Db=h&&this.viewer.getBoolean(603979934);Db&&J.util.Logger.startTimer("isosurface");this.setShapeProperty(b,"setProperties",D);Db&&this.showString(J.util.Logger.getTimerMsg("isosurface",0));ib&&(this.setShapeProperty(b,"token",Integer.$valueOf(1073742018)),
this.setShapeProperty(b,"token",Integer.$valueOf(1073742046)),G=!0,r.append(" mesh nofill frontOnly"))}null!=ia&&this.setShapeProperty(b,"lattice",ia);null!=qa&&this.setShapeProperty(b,"symops",qa);G&&this.setShapeProperty(b,"token",Integer.$valueOf(1073741960));0<c&&(a.setMeshDisplayProperty(b,c,0)||this.invArg());if(this.chk)return!1;var oa=null,pa=null;p&&(oa=this.getShapeProperty(b,"area"),H(oa,Float)?this.viewer.setFloatProperty("isosurfaceArea",oa.floatValue()):this.viewer.setUserVariable("isosurfaceArea",
J.script.SV.getVariableAD(oa)));k&&(pa=k?this.getShapeProperty(b,"volume"):null,H(pa,Float)?this.viewer.setFloatProperty("isosurfaceVolume",pa.floatValue()):this.viewer.setUserVariable("isosurfaceVolume",J.script.SV.getVariableAD(pa)));if(!g){var R=null;if(m&&!h)this.setShapeProperty(b,"finalize",r.toString());else if(h&&(y=r.toString(),this.setShapeProperty(b,"finalize",(0==y.indexOf("; isosurface map")?"":" select "+J.util.Escape.eBS(O)+" ")+y),R=this.getShapeProperty(b,"ID"),null!=R&&!a.tQuiet)){T=
this.getShapeProperty(b,"cutoff").floatValue();Float.isNaN(T)&&!Float.isNaN(la)&&J.util.Logger.error("sigma not supported");R+=" created";d&&(R+=" with cutoff="+T);var eb=this.getShapeProperty(b,"minMaxInfo");3.4028235E38!=eb[0]&&(R+=" min="+eb[0]+" max="+eb[1]);R+="; "+J.viewer.JC.shapeClassBases[b].toLowerCase()+" count: "+this.getShapeProperty(b,"count");R+=a.getIsosurfaceDataRange(b,"\n")}var fb,gb;if(p||k)fb=p?"isosurfaceArea = "+(H(oa,Float)?""+oa:J.util.Escape.eAD(oa)):null,gb=k?"isosurfaceVolume = "+
(H(pa,Float)?""+pa:J.util.Escape.eAD(pa)):null,null==R?(p&&this.showString(fb),k&&this.showString(gb)):(p&&(R+="\n"+fb),k&&(R+="\n"+gb));null!=R&&this.showString(R)}null!=Sa&&this.setShapeProperty(b,"translucency",Sa);this.setShapeProperty(b,"clear",null);w&&this.setShapeProperty(b,"cache",null);this.listIsosurface(b);return!0},"~N");k(c$,"getAtomicPotentials",function(b,a,c){var d=E(this.viewer.getAtomCount(),0),e=J.api.Interface.getOptionInterface("quantum.MlpCalculation");e.set(this.viewer);c=
null==c?null:this.viewer.getFileAsString(c);e.assignPotentials(this.viewer.modelSet.atoms,d,this.viewer.getSmartsMatch("a",b),this.viewer.getSmartsMatch("/noAromatic/[$(C=O),$(O=C),$(NC=O)]",b),a,c);return d},"JU.BS,JU.BS,~S");k(c$,"lcaoCartoon",function(){var b=this.eval;this.sm.loadShape(26);if(1073742001==this.tokAt(1)&&this.listIsosurface(26))return!1;this.setShapeProperty(26,"init",this.fullCommand);if(1==this.slen)return this.setShapeProperty(26,"lcaoID",null),!1;for(var a=!1,c=null,c=1;c<this.slen;c++){var d=
null,e=null;switch(this.getToken(c).tok){case 1074790451:case 554176565:d=b.theToken.value;1048588==this.tokAt(c+1)&&(b.iToken=c+1);e=this.getCapSlabObject(c,!0);c=b.iToken;break;case 12289:return this.isosurface(26),!1;case 528432:var f=e=0,g=0;switch(this.getToken(++c).tok){case 1112541205:e=0.017453292*this.floatParameter(++c);break;case 1112541206:f=0.017453292*this.floatParameter(++c);break;case 1112541207:g=0.017453292*this.floatParameter(++c);break;default:this.invArg()}d="rotationAxis";e=
JU.V3.new3(e,f,g);break;case 1048589:case 1610625028:case 3145768:d="on";break;case 1048588:case 12294:case 3145770:d="off";break;case 12291:d="delete";break;case 10:case 1048577:d="select";e=this.atomExpressionAt(c);c=b.iToken;break;case 1766856708:c=this.setColorOptions(null,c+1,26,-2);null!=c&&this.setShapeProperty(26,"settranslucency",c);c=b.iToken;a=!0;continue;case 603979967:case 1073742074:b.setMeshDisplayProperty(26,c,b.theTok);c=b.iToken;a=!0;continue;case 1113200651:case 4:e=this.parameterAsString(c).toLowerCase();
e.equals("spacefill")&&(e="cpk");d="create";b.optParameterAsString(c+1).equalsIgnoreCase("molecular")&&(c++,d="molecular");break;case 135280132:10==this.tokAt(c+1)||1048577==this.tokAt(c+1)?(d="select",e=this.atomExpressionAt(c+1),c=b.iToken):(d="selectType",e=this.parameterAsString(++c),e.equals("spacefill")&&(e="cpk"));break;case 1073742138:d="scale";e=Float.$valueOf(this.floatParameter(++c));break;case 1073742004:case 1073742006:d="lonePair";break;case 1073742112:case 1073742111:d="radical";break;
case 1073742029:d="molecular";break;case 1073741904:e=this.parameterAsString(++c);d="create";b.optParameterAsString(c+1).equalsIgnoreCase("molecular")&&(c++,d="molecular");break;case 1074790550:e=b.getShapeNameParameter(++c);c=b.iToken;a&&this.invArg();d="lcaoID";break;default:if(269484209==b.theTok||J.script.T.tokAttr(b.theTok,1073741824))269484209!=b.theTok&&(e=this.parameterAsString(c)),a&&this.invArg(),d="lcaoID"}12291!=b.theTok&&(a=!0);null==d&&this.invArg();this.setShapeProperty(26,d,e)}this.setShapeProperty(26,
"clear",null);return!0});k(c$,"getCapSlabObject",function(b,a){if(0>b)return J.util.TempArray.getSlabWithinRange(b,0);var c=this.eval,d=null,e=554176565==this.tokAt(b),f=this.tokAt(b+1),g=null,h=g=null,j=null,m=null;if(603979967==f)switch(j=this.isFloatParameter(++b+1)?this.floatParameter(++b):0.5,c.isColorParam(b+1)?(j=Short.$valueOf(J.util.C.getColixTranslucent3(J.util.C.getColix(c.getArgbParam(b+1)),0!=j,j)),b=c.iToken):j=Short.$valueOf(J.util.C.getColixTranslucent3(1,0!=j,j)),f=this.tokAt(b+1)){case 1073742018:case 1073741938:m=
Integer.$valueOf(f);f=this.tokAt(++b+1);break;default:m=Integer.$valueOf(1073741938)}switch(f){case 10:case 1048577:d=this.atomExpressionAt(b+1);f=3;c.iToken++;break;case 1048588:return c.iToken=b+1,Integer.$valueOf(-2147483648);case 1048587:c.iToken=b+1;break;case 1048583:b++;d=[Float.$valueOf(1),this.parameterAsString(++b)];f=1073742018;break;case 135266325:b++;if(1073742114==this.tokAt(++b))d=this.floatParameter(++b),f=this.floatParameter(++b),d=[Float.$valueOf(d),Float.$valueOf(f)],f=1073742114;
else if(this.isFloatParameter(b)){d=this.floatParameter(b);if(c.isCenterParameter(++b))if(g=this.centerParameter(b),this.chk||!H(c.expressionResult,JU.BS))g=[g];else for(var u=this.viewer.modelSet.atoms,h=c.expressionResult,g=Array(h.cardinality()),n=0,p=h.nextSetBit(0);0<=p;p=h.nextSetBit(p+1),n++)g[n]=u[p];else g=c.getPointArray(b,-1);0==g.length&&(c.iToken=b,this.invArg());d=[Float.$valueOf(d),g,h]}else d=c.getPointArray(b,4),f=1679429641;break;case 1679429641:c.iToken=b+1;d=J.util.BoxInfo.getCriticalPoints(this.viewer.getBoundBoxVertices(),
null);break;case 1073741872:case 1614417948:c.iToken=b+1;c=this.viewer.getCurrentUnitCell();if(null==c)1614417948==f&&this.invArg();else{g=J.util.BoxInfo.getCriticalPoints(c.getUnitCellVertices(),c.getCartesianOffset());c=K(c.getUnitCellInfoType(6));d=h=null;switch(c){case 1:d=JU.V3.newVsub(g[2],g[0]),d.scale(1E3);case 2:h=JU.V3.newVsub(g[1],g[0]),h.scale(1E3),g[0].sub(h),g[1].scale(2E3),1==c&&(g[0].sub(d),g[2].scale(2E3))}d=g}break;default:if(!a&&e&&this.isFloatParameter(b+1)){d=this.floatParameter(++b);
if(!this.isFloatParameter(b+1))return Integer.$valueOf(K(d));f=this.floatParameter(++b);d=[Float.$valueOf(d),Float.$valueOf(f)];f=1073742114;break}g=c.planeParameter(++b);f=this.isFloatParameter(c.iToken+1)?this.floatParameter(++c.iToken):NaN;Float.isNaN(f)||(g.w-=f);d=g;f=135266319}return J.util.TempArray.getSlabObjectType(f,d,!e,null==m?null:[m,j])},"~N,~B");k(c$,"mo",function(b){var a=this.eval,c=2147483647,d=!1,e=this.viewer.getVisibleFramesBitSet(),f=new JU.List,g=1;if(1095766030==this.tokAt(1)||
4115==this.tokAt(1))g=a.modelNumberParameter(2),0>g&&this.invArg(),e.clearAll(),e.set(g),g=3;for(var h=e.nextSetBit(0);0<=h;h=e.nextSetBit(h+1)){this.sm.loadShape(27);var j=g;if(1073742001==this.tokAt(j)&&this.listIsosurface(27))break;this.setShapeProperty(27,"init",Integer.$valueOf(h));var m=null,u=this.getShapeProperty(27,"moNumber").intValue(),n=this.getShapeProperty(27,"moLinearCombination");if(b)break;0==u&&(u=2147483647);var p=null,k=null;switch(this.getToken(j).tok){case 1074790451:case 554176565:p=
a.theToken.value;k=this.getCapSlabObject(j,!1);break;case 1073741914:p="squareLinear";k=Boolean.TRUE;n=[1];c=u=0;break;case 2:u=this.intParameter(j);n=this.moCombo(f);null==n&&0>u&&(n=[-100,-u]);break;case 269484192:switch(this.tokAt(++j)){case 1073741973:case 1073742008:break;default:this.invArg()}d=!0;case 1073741973:case 1073742008:2147483647==(c=this.moOffset(j))&&this.invArg();u=0;n=this.moCombo(f);break;case 1073742037:u=1073742037;n=this.moCombo(f);break;case 1073742108:u=1073742108;n=this.moCombo(f);
break;case 1766856708:this.setColorOptions(null,j+1,27,2);break;case 135266319:p="plane";k=a.planeParameter(j+1);break;case 135266320:this.addShapeProperty(f,"randomSeed",2==this.tokAt(j+2)?Integer.$valueOf(this.intParameter(j+2)):null);p="monteCarloCount";k=Integer.$valueOf(this.intParameter(j+1));break;case 1073742138:p="scale";k=Float.$valueOf(this.floatParameter(j+1));break;case 1073741910:269484193==this.tokAt(j+1)?(p="cutoffPositive",k=Float.$valueOf(this.floatParameter(j+2))):(p="cutoff",k=
Float.$valueOf(this.floatParameter(j+1)));break;case 536870916:p="debug";break;case 1073742054:p="plane";break;case 1073742104:case 1073742122:p="resolution";k=Float.$valueOf(this.floatParameter(j+1));break;case 1073742156:p="squareData";k=Boolean.TRUE;break;case 1073742168:j+1<this.slen&&4==this.tokAt(j+1)&&(p="titleFormat",k=this.parameterAsString(j+1));break;case 1073741824:this.invArg();break;default:if(a.isArrayParameter(j)){n=a.floatParameterSet(j,1,2147483647);1073742156==this.tokAt(a.iToken+
1)&&(this.addShapeProperty(f,"squareLinear",Boolean.TRUE),a.iToken++);break}b=a.iToken;a.setMeshDisplayProperty(27,0,a.theTok)||this.invArg();this.setShapeProperty(27,"setProperties",f);a.setMeshDisplayProperty(27,b,this.tokAt(b));return!0}null!=p&&this.addShapeProperty(f,p,k);if(2147483647!=u||null!=n)4==this.tokAt(a.iToken+1)&&(m=this.parameterAsString(++a.iToken)),a.setCursorWait(!0),this.setMoData(f,u,n,c,d,h,m),this.addShapeProperty(f,"finalize",null);0<f.size()&&this.setShapeProperty(27,"setProperties",
f);f.clear()}return!0},"~B");k(c$,"moCombo",function(b){if(1073742156!=this.tokAt(this.eval.iToken+1))return null;this.addShapeProperty(b,"squareLinear",Boolean.TRUE);this.eval.iToken++;return E(0,0)},"JU.List");k(c$,"moOffset",function(b){var a=1073741973==this.getToken(b).tok?0:1,c=this.tokAt(++b);2==c&&0>this.intParameter(b)?a+=this.intParameter(b):269484193==c?a+=this.intParameter(++b):269484192==c&&(a-=this.intParameter(++b));return a},"~N");k(c$,"setMoData",function(b,a,c,d,e,f,g){var h=this.eval;
if(!this.chk){0>f&&(f=this.viewer.getCurrentModelIndex(),0>f&&h.errorStr(30,"MO isosurfaces"));f=this.viewer.getModelAuxiliaryInfoValue(f,"moData");var j=null,m,u,n=0;if(null==c||2>c.length){null!=c&&1==c.length&&(d=0);null==f&&this.error(27);var p=f.containsKey("lastMoNumber")?f.get("lastMoNumber").intValue():0,j=f.containsKey("lastMoCount")?f.get("lastMoCount").intValue():1;1073742108==a?a=p-1:1073742037==a&&(a=p+j);j=f.get("mos");n=null==j?0:j.size();0==n&&this.error(25);1==n&&1<a&&this.error(29);
if(2147483647!=d){if(f.containsKey("HOMO"))a=f.get("HOMO").intValue()+d;else{a=-1;for(p=0;p<n;p++)if(m=j.get(p),null!=(u=m.get("occupancy"))){if(0.5>u.floatValue()){a=p;break}}else if(null!=(u=m.get("energy"))){if(0<u.floatValue()){a=p;break}}else break;0>a&&this.error(28);a+=d}J.util.Logger.info("MO "+a)}(1>a||a>n)&&h.errorStr(26,""+n)}a=Math.abs(a);f.put("lastMoNumber",Integer.$valueOf(a));f.put("lastMoCount",Integer.$valueOf(1));e&&null==c&&(c=[-100,a]);if(null!=c&&2>c.length){m=j.get(a-1);if(null==
(u=m.get("energy")))c=[100,a];else{h=u.floatValue();d=JU.BS.newN(n);e=0;c=1==c.length&&1==c[0];for(p=0;p<n;p++)if(null!=(u=j.get(p).get("energy")))if(u=u.floatValue(),c?u<=h:u==h)d.set(p+1),e+=2;c=E(e,0);for(j=p=0;p<e;p+=2)c[p]=1,c[p+1]=j=d.nextSetBit(j+1);f.put("lastMoNumber",Integer.$valueOf(d.nextSetBit(0)));f.put("lastMoCount",Integer.$valueOf(ia(e/2)))}this.addShapeProperty(b,"squareLinear",Boolean.TRUE)}this.addShapeProperty(b,"moData",f);null!=g&&this.addShapeProperty(b,"title",g);this.addShapeProperty(b,
"molecularOrbital",null!=c?c:Integer.$valueOf(Math.abs(a)));this.addShapeProperty(b,"clear",null)}},"JU.List,~N,~A,~N,~B,~N,~S");W(c$,"plot",function(b){this.st=this.eval.st;this.chk=this.eval.chk;var a=this.viewer.getCurrentModelIndex();0>a&&this.eval.errorStr(30,"plot");var a=this.viewer.getJmolDataSourceFrame(a),c=b.length-1,d=b!==this.st,e=this.st;d&&(this.eval.st=this.st=b);var f=d?4148:b[0].tok,g=d||135270418==f||1052714==f?0:1,h=null,j=!0,m=!1;switch(f){case 135176:j=!1;m=!0;break;case 4148:j=
!1;break;case 135270422:j=!1,4==J.scriptext.ScriptExt.tokAtArray(c,b)?h=this.stringParameter(c--):1048584==J.scriptext.ScriptExt.tokAtArray(c-1,b)?(h=this.parameterAsString(c-2)+"."+this.parameterAsString(c),c-=3):(this.eval.st=this.st=e,this.eval.iToken=this.st.length,this.error(13))}var d="",u=null,n="",p=!1,k=!1,q=!1,A=!1,w=0,s=0,v=0,t=J.util.BSUtil.copy(this.viewer.getSelectionSet(!1)),G="; select "+J.util.Escape.eBS(t)+";\n ",A=this.eval.optParameterAsString(c).toLowerCase(),B=null,y=null,I=
J.scriptext.ScriptExt.tokAtArray(g,b);4==I&&(I=J.script.T.getTokFromName(b[g].value));switch(I){default:this.eval.iToken=1;this.invArg();break;case 135270407:this.eval.iToken=1;A="data";G="";break;case 1716520985:this.eval.iToken=g+1;(!J.script.T.tokAttr(w=this.tokAt(this.eval.iToken++),1078984704)||!J.script.T.tokAttr(s=this.tokAt(this.eval.iToken++),1078984704))&&this.invArg();J.script.T.tokAttr(v=this.tokAt(this.eval.iToken),1078984704)?this.eval.iToken++:v=0;32==this.tokAt(this.eval.iToken)&&
(B=this.getPoint3f(++this.eval.iToken,!1),this.eval.iToken++);64==this.tokAt(this.eval.iToken)&&(y=this.getPoint3f(++this.eval.iToken,!1),this.eval.iToken++);A="property "+J.script.T.nameOf(w)+" "+J.script.T.nameOf(s)+(0==v?"":" "+J.script.T.nameOf(v));0>t.nextSetBit(0)&&(t=this.viewer.getModelUndeletedAtomsBitSet(a));n="select "+J.util.Escape.eBS(t)+";\n ";break;case 1052714:A.equalsIgnoreCase("draw")&&(A=this.eval.optParameterAsString(--c).toLowerCase());A=c>g&&A.startsWith("r");A="ramachandran"+
(A?" r":"")+(135176==f?" draw":"");break;case 135270418:case 137363468:d=' "'+this.viewer.getQuaternionFrame()+'"';n="set quaternionFrame"+d+";\n  ";p=!0;A.equalsIgnoreCase("draw")&&(m=!0,A=this.eval.optParameterAsString(--c).toLowerCase());q=(k=A.startsWith("deriv")||A.startsWith("diff"))&&0<A.indexOf("2");k&&c--;if(A.equalsIgnoreCase("helix")||A.equalsIgnoreCase("axis"))k=m=!0,c=-1;A=((c<=g?"":this.eval.optParameterAsString(c))+"w").substring(0,1);if(A.equals("a")||A.equals("r"))k=!0;JU.PT.isOneOf(A,
";w;x;y;z;r;a;")||this.eval.evalError("QUATERNION [w,x,y,z,a,r] [difference][2]",null);A="quaternion "+A+(k?" difference":"")+(q?"2":"")+(m?" draw":"")}this.st=e;if(this.chk)return"";if(j&&(n+="plot "+A,b=this.viewer.getJmolDataFrameIndex(a,n),0<b&&135270422!=f&&4148!=f))return this.viewer.setCurrentModelIndexClear(b,!0),"";e=c=b=null;g=JU.P3.new3(1,1,1);if(1716520985==I){b=this.eval.getBitsetPropertyFloat(t,w|224,null==B?NaN:B.x,null==y?NaN:y.x);c=this.eval.getBitsetPropertyFloat(t,s|224,null==B?
NaN:B.y,null==y?NaN:y.y);0!=v&&(e=this.eval.getBitsetPropertyFloat(t,v|224,null==B?NaN:B.z,null==y?NaN:y.z));null==B&&(B=JU.P3.new3(this.getPlotMinMax(b,!1,w),this.getPlotMinMax(c,!1,s),this.getPlotMinMax(e,!1,v)));null==y&&(y=JU.P3.new3(this.getPlotMinMax(b,!0,w),this.getPlotMinMax(c,!0,s),this.getPlotMinMax(e,!0,v)));J.util.Logger.info("plot min/max: "+B+" "+y);u=new JU.P3;u.ave(y,B);g.sub2(y,B);g.set(g.x/200,g.y/200,g.z/200);J.script.T.tokAttr(w,1095761920)?(g.x=1,u.x=0):0.1<g.x&&10>=g.x&&(g.x=
1);J.script.T.tokAttr(s,1095761920)?(g.y=1,u.y=0):0.1<g.y&&10>=g.y&&(g.y=1);J.script.T.tokAttr(v,1095761920)?(g.z=1,u.z=0):0.1<g.z&&10>=g.z&&(g.z=1);0==v&&(u.z=B.z=y.z=g.z=0);for(j=0;j<b.length;j++)b[j]=(b[j]-u.x)/g.x;for(j=0;j<c.length;j++)c[j]=(c[j]-u.y)/g.y;if(0!=v)for(j=0;j<e.length;j++)e[j]=(e[j]-u.z)/g.z;u=[t,b,c,e,B,y,g,u]}if(135270422==f)return this.viewer.writeFileData(h,"PLOT_"+A,a,u);h=A.equals("data")?"1 0 H 0 0 0 # Jmol PDB-encoded data":this.viewer.getPdbData(a,A,u);if(4148==f)return h;
J.util.Logger.debugging&&J.util.Logger.debug(h);if(135176==f)return this.eval.runScript(h),"";f=this.viewer.getFileInfo();t=this.viewer.getBoolean(603979792);this.viewer.setAppendNew(!0);h=null!=h&&null==this.viewer.openStringInlineParamsAppend(h,null,!0);this.viewer.setAppendNew(t);this.viewer.setFileInfo(f);if(!h)return"";f=this.viewer.getModelCount();this.viewer.setJmolDataFrame(n,a,f-1);1716520985!=I&&(n+=";\n"+G);n=this.viewer.addStateScript(n,!0,!1);h=150;switch(I){default:a="frame 0.0; frame last; reset;select visible;wireframe only;";
h=10;break;case 1716520985:this.viewer.setFrameTitle(f-1,A+" plot for model "+this.viewer.getModelNumberDotted(a));a="frame 0.0; frame last; reset;select visible; spacefill 3; wireframe 0;draw plotAxisX"+f+' {100 -100 -100} {-100 -100 -100} "'+J.script.T.nameOf(w)+'";draw plotAxisY'+f+' {-100 100 -100} {-100 -100 -100} "'+J.script.T.nameOf(s)+'";';0!=v&&(a+="draw plotAxisZ"+f+' {-100 -100 100} {-100 -100 -100} "'+J.script.T.nameOf(v)+'";');break;case 1052714:this.viewer.setFrameTitle(f-1,"ramachandran plot for model "+
this.viewer.getModelNumberDotted(a));a="frame 0.0; frame last; reset;select visible; color structure; spacefill 3.0; wireframe 0;draw ramaAxisX"+f+' {100 0 0} {-100 0 0} "phi";draw ramaAxisY'+f+' {0 100 0} {0 -100 0} "psi";';break;case 135270418:case 137363468:this.viewer.setFrameTitle(f-1,A.$replace("w"," ")+d+" for model "+this.viewer.getModelNumberDotted(a)),a=J.util.C.getHexCode(this.viewer.getColixBackgroundContrast()),a="frame 0.0; frame last; reset;select visible; wireframe 0; spacefill 3.0; isosurface quatSphere"+
f+" color "+a+" sphere 100.0 mesh nofill frontonly translucent 0.8;draw quatAxis"+f+'X {100 0 0} {-100 0 0} color red "x";draw quatAxis'+f+'Y {0 100 0} {0 -100 0} color green "y";draw quatAxis'+f+'Z {0 0 100} {0 0 -100} color blue "z";color structure;draw quatCenter'+f+"{0 0 0} scale 0.02;"}this.eval.runScript(a+G);n.setModelIndex(this.viewer.getCurrentModelIndex());this.viewer.setRotationRadius(h,!0);this.sm.loadShape(30);this.showString("frame "+this.viewer.getModelNumberDotted(f-1)+(0<A.length?
" created: "+A+(p?d:""):""));return""},"~A");k(c$,"getPlotMinMax",function(b,a,c){if(null==b)return 0;switch(c){case 1112539144:case 1112539145:case 1112539146:return a?180:-180;case 1112539141:case 1112539152:return a?360:0;case 1112539150:return a?1:-1}c=a?-1E10:1E10;for(var d=b.length;0<=--d;){var e=b[d];Float.isNaN(e)||a==e>c&&(c=e)}return c},"~A,~B,~N");k(c$,"polyhedra",function(){var b=this.eval,a=!1,c=!1,d=!1,e=!1,f=!1,g=0,h=0;this.sm.loadShape(21);this.setShapeProperty(21,"init",Boolean.TRUE);
var j="centers",m="radius_",u=3.4028235E38;b.colorArgb[0]=-2147483648;for(var n=1;n<this.slen;++n){var p=null,k=null;switch(this.getToken(n).tok){case 12291:case 1048589:case 1048588:(n+1!=this.slen||a||1<h||0==h&&"to".equals(j))&&this.error(18);p=1048588==b.theTok?"off":1048589==b.theTok?"on":"delete";c=!0;break;case 269484436:case 269484080:continue;case 1678770178:0<h&&this.invPO();a=!0;p="bonds";break;case 1666189314:m="radius";continue;case 2:case 3:0<h&&!f&&this.invPO();if(2==b.theTok&&"radius_"===
m){p="nVertices";k=Integer.$valueOf(this.intParameter(n));a=!0;break}p="radius_"===m?"radius":m;k=Float.$valueOf(this.floatParameter(n));m="radius_";f=!1;a=!0;break;case 10:case 1048577:d&&this.invPO();2<++h&&this.error(2);"to".equals(j)&&(a=!0);p=j;j="to";k=this.atomExpressionAt(n);n=b.iToken;break;case 1074790746:1<h&&this.invPO();if(10==this.tokAt(n+1)||1048577==this.tokAt(n+1)&&!a){p="toBitSet";k=this.atomExpressionAt(++n);n=b.iToken;a=!0;break}else a||this.error(19);j="to";continue;case 1073741937:a||
this.error(19);m="faceCenterOffset";f=!0;continue;case 1073741924:0==h&&this.error(19);m="distanceFactor";f=!0;continue;case 1766856708:case 603979967:case 1073742074:u=b.getColorTrans(n,!0);n=b.iToken;continue;case 1073741886:case 1073741948:p="collapsed";k=1073741886==b.theTok?Boolean.TRUE:Boolean.FALSE;d&&this.error(18);d=!0;break;case 1073742044:case 1073741933:case 1073741956:e&&this.error(18);p=this.parameterAsString(n);e=!0;break;case 1073741964:g=b.theTok;continue;default:if(b.isColorParam(n)){b.colorArgb[0]=
b.getArgbParam(n);n=b.iToken;continue}this.invArg()}this.setShapeProperty(21,p,k);if(c)return!1}!a&&(!d&&!e&&0==g)&&this.error(19);a&&this.setShapeProperty(21,"generate",null);-2147483648!=b.colorArgb[0]&&this.setShapeProperty(21,"colorThis",Integer.$valueOf(b.colorArgb[0]));3.4028235E38!=u&&b.setShapeTranslucency(21,"","translucentThis",u,null);0!=g&&this.setShapeProperty(21,"token",Integer.$valueOf(g));this.setShapeProperty(21,"init",Boolean.FALSE);return!0});k(c$,"struts",function(){var b=this.eval,
a=1073742072==this.tokAt(1)||1048589==this.tokAt(1)||1==this.slen,c=b.getMadParameter();a&&(c=Math.round(2E3*this.viewer.getFloat(570425406)));this.setShapeProperty(1,"type",Integer.$valueOf(32768));b.setShapeSizeBs(1,c,null);this.setShapeProperty(1,"type",Integer.$valueOf(1023));return!0});k(c$,"initIsosurface",function(b){var a=this.eval;this.setShapeProperty(b,"init",this.fullCommand);a.iToken=0;var c=this.tokAt(1),d=this.tokAt(2);if(12291==c||12291==d&&1048579==this.tokAt(++a.iToken))return this.setShapeProperty(b,
"delete",null),a.iToken+=2,this.slen>a.iToken&&(this.setShapeProperty(b,"init",this.fullCommand),this.setShapeProperty(b,"thisID","+PREVIOUS_MESH+")),null;a.iToken=1;return!a.setMeshDisplayProperty(b,0,c)&&(this.setShapeProperty(b,"thisID","+PREVIOUS_MESH+"),22!=b&&this.setShapeProperty(b,"title",[this.thisCommand]),1074790550!=c&&(269484209==d||269484209==c&&a.setMeshDisplayProperty(b,0,d)))?(b=this.setShapeId(b,1,!1),a.iToken++,b):null},"~N");k(c$,"getWithinDistanceVector",function(b,a,c,d,e){var f=
new JU.List,g=Array(2);if(null==d){var h=JU.P3.new3(a,a,a),j=JU.P3.newP(c);j.sub(h);h.add(c);g[0]=j;g[1]=h;f.addLast(c)}else c=this.viewer.getBoxInfo(d,-Math.abs(a)),g[0]=c.getBoundBoxVertices()[0],g[1]=c.getBoundBoxVertices()[7],1==d.cardinality()&&f.addLast(this.viewer.getAtomPoint3f(d.nextSetBit(0)));1==f.size()&&!e&&(this.addShapeProperty(b,"withinDistance",Float.$valueOf(a)),this.addShapeProperty(b,"withinPoint",f.get(0)));this.addShapeProperty(b,e?"displayWithin":"withinPoints",[Float.$valueOf(a),
g,d,f])},"JU.List,~N,JU.P3,JU.BS,~B");k(c$,"setColorOptions",function(b,a,c,d){var e=this.eval;this.getToken(a);var f="opaque";if(603979967==e.theTok)if(f="translucent",0>d){var g=this.isFloatParameter(a+1)?this.floatParameter(++a):3.4028235E38;e.setShapeTranslucency(c,null,"translucent",g,null);null!=b&&(b.append(" translucent"),3.4028235E38!=g&&b.append(" ").appendF(g))}else e.setMeshDisplayProperty(c,a,e.theTok);else 1073742074==e.theTok?0<=d&&e.setMeshDisplayProperty(c,a,e.theTok):e.iToken--;
d=Math.abs(d);for(g=0;g<d;g++)if(e.isColorParam(e.iToken+1)){var h=e.getArgbParam(++e.iToken);this.setShapeProperty(c,"colorRGB",Integer.$valueOf(h));null!=b&&b.append(" ").append(J.util.Escape.escapeColor(h))}else if(e.iToken<a)this.invArg();else break;return f},"JU.SB,~N,~N,~N");k(c$,"addShapeProperty",function(b,a,c){this.chk||b.addLast([a,c])},"JU.List,~S,~O");k(c$,"createFunction",function(b,a,c){var d=new J.script.ScriptEvaluator;d.setViewer(this.viewer);try{d.compileScript(null,"function "+
b+"("+a+") { return "+c+"}",!1);var e=new JU.List;for(b=0;b<a.length;b+=2)e.addLast(J.script.SV.newV(3,Float.$valueOf(0)).setName(a.substring(b,b+1)));return[d.aatoken[0][1].value,e]}catch(f){if(aa(f,Exception))return null;throw f;}},"~S,~S,~S");k(c$,"floatArraySet",function(b,a,c){var d=this.tokAt(b++);1073742195==d&&(d=this.tokAt(b++));269484096!=d&&this.invArg();for(var e=JU.AU.newFloat2(a),f=0;269484097!=d;)switch(d=this.getToken(b).tok,d){case 1073742195:case 269484097:continue;case 269484080:b++;
break;case 269484096:b++;d=E(c,0);e[f++]=d;for(var g=0;g<c;g++)d[g]=this.floatParameter(b++),269484080==this.tokAt(b)&&b++;269484097!=this.tokAt(b++)&&this.invArg();d=0;f==a&&269484097!=this.tokAt(b)&&this.invArg();break;default:this.invArg()}return e},"~N,~N,~N");k(c$,"floatArraySetXYZ",function(b,a,c,d){var e=this.eval,f=this.tokAt(b++);1073742195==f&&(f=this.tokAt(b++));(269484096!=f||0>=a)&&this.invArg();for(var g=JU.AU.newFloat3(a,-1),h=0;269484097!=f;)switch(f=this.getToken(b).tok,f){case 1073742195:case 269484097:continue;
case 269484080:b++;break;case 269484096:g[h++]=this.floatArraySet(b,c,d);b=++e.iToken;f=0;h==a&&269484097!=this.tokAt(b)&&this.invArg();break;default:this.invArg()}return g},"~N,~N,~N,~N");k(c$,"listIsosurface",function(b){var a=3<this.slen?"0":0==this.tokAt(2)?"":" "+this.getToken(2).value;this.chk||this.showString(this.getShapeProperty(b,"list"+a));return!0},"~N");W(c$,"getBitsetIdent",function(b,a,c,d,e,f){var g=!H(c,J.modelset.BondSet);g&&(null==a?a=this.viewer.getStandardLabelFormat(0):0==a.length&&
(a="%[label]"));var h=null==a?-1:a.indexOf("%"),j=2147483647!=e;if(null==b||this.chk||g&&0>h)return null==a&&(a=""),f?[a]:a;var h=this.viewer.modelSet,m=0,u=h.getLabeler();c=g||!d?null:c.getAssociatedAtoms();null==c&&(null!=a&&0<a.indexOf("%D"))&&(c=this.viewer.getAtomIndices(b));d=null==a||0==a.length;var n=g||d?null:J.modelset.LabelToken.getBondLabelValues();a=d?null:g?u.compile(this.viewer,a,"\x00",null):u.compile(this.viewer,a,"\u0001",n);var p=j?1:J.util.BSUtil.cardinalityOf(b),k=Array(p);for(e=
j?e:b.nextSetBit(0);0<=e;e=b.nextSetBit(e+1)){var q;g?q=d?h.atoms[e].getInfo():u.formatLabelAtomArray(this.viewer,h.atoms[e],a,"\x00",c):(q=h.getBondAt(e),q=d?q.getIdentity():u.formatLabelBond(this.viewer,q,a,n,c));q=J.util.Txt.formatStringI(q,"#",m+1);k[m++]=q;if(j)break}return 1==p&&!f?k[0]:k},"JU.BS,~S,~O,~B,~N,~B");k(c$,"data",function(){var b=this.eval,a=null,c=null,d=!1,e;switch(b.iToken=this.slen){case 5:a=this.parameterAsString(2);case 4:case 2:c=this.parameterAsString(1);if(c.equalsIgnoreCase("clear")){this.chk||
this.viewer.setData(null,null,0,0,0,0,0);return}if(0<=(e=c.indexOf("@")))a=""+b.getParameter(c.substring(e+1),4),c=c.substring(0,e).trim();else if(null==a&&0<=(e=c.indexOf(" ")))a=c.substring(e+1).trim(),c=c.substring(0,e).trim(),d=!0;break;default:this.error(2)}e=c+" ";e=e.substring(0,e.indexOf(" ")).toLowerCase();if(e.equals("model")||e.equals("append"))b.load();else if(!this.chk)if(b=0<=c.toLowerCase().indexOf("(default)"),e.equals("connect_atoms"))this.viewer.connect(J.util.Parser.parseFloatArray2d(a));
else if(0==e.indexOf("ligand_"))this.viewer.setLigandModel(c.substring(7).toUpperCase()+"_data",a.trim());else if(0==e.indexOf("file_"))this.viewer.setLigandModel(c.substring(5).toUpperCase()+"_file",a.trim());else if(this.$data=Array(4),e.equals("element_vdw")){this.$data[0]=e;this.$data[1]=a.$replace(";","\n");a=J.util.Elements.elementNumberMax;e=Q(a+1,0);for(b=1;b<=a;b++)e[b]=b;this.$data[2]=e;this.$data[3]=Integer.$valueOf(0);this.viewer.setData("element_vdw",this.$data,a,0,0,0,0)}else if(0==
e.indexOf("data2d_"))this.$data[0]=c,this.$data[1]=J.util.Parser.parseFloatArray2d(a),this.$data[3]=Integer.$valueOf(2),this.viewer.setData(c,this.$data,0,0,0,0,0);else if(0==e.indexOf("data3d_"))this.$data[0]=c,this.$data[1]=J.util.Parser.parseFloatArray3d(a),this.$data[3]=Integer.$valueOf(3),this.viewer.setData(c,this.$data,0,0,0,0,0);else{var f=JU.PT.getTokens(c);if(0==e.indexOf("property_")&&!(2==f.length&&f[1].equals("set"))){b=this.viewer.getSelectionSet(!1);this.$data[0]=e;var g=d?0:this.viewer.getParameter("propertyAtomNumberField").intValue(),
h=d?0:this.viewer.getParameter("propertyAtomNumberColumnCount").intValue(),j=d?-2147483648:this.viewer.getParameter("propertyDataField").intValue(),m=d?0:this.viewer.getParameter("propertyDataColumnCount").intValue();!d&&0<=c.indexOf(" ")&&(3==f.length&&(g=JU.PT.parseInt(f[1]),j=JU.PT.parseInt(f[2])),5==f.length&&(g=JU.PT.parseInt(f[1]),h=JU.PT.parseInt(f[2]),j=JU.PT.parseInt(f[3]),m=JU.PT.parseInt(f[4])));0>g&&(g=0);0>j&&(j=0);c=this.viewer.getAtomCount();d=null;f=J.util.BSUtil.newBitSet(c);if(0<
g){for(var d=Q(c+2,0),u=0;u<=c;u++)d[u]=-1;for(u=b.nextSetBit(0);0<=u;u=b.nextSetBit(u+1)){var n=this.viewer.getAtomNumber(u);n>c+1||(0>n||f.get(n))||(f.set(n),d[n]=u)}this.$data[2]=d}else this.$data[2]=J.util.BSUtil.copy(b);this.$data[1]=a;this.$data[3]=Integer.$valueOf(0);this.viewer.setData(e,this.$data,c,g,h,j,m)}else g=J.modelset.AtomCollection.getUserSettableType(e),0<=g?this.viewer.setAtomData(g,e,a,b):(this.$data[0]=c,this.$data[1]=a,this.$data[3]=Integer.$valueOf(0),this.viewer.setData(e,
this.$data,0,0,0,0,0))}});k(c$,"navigate",function(){var b=this.eval;if(1==this.slen)b.setBooleanProperty("navigationMode",!0);else{var a=JU.V3.new3(0,1,0),c=new JU.List,d;if(2==this.slen)switch(this.getToken(1).tok){case 1048589:case 1048588:if(this.chk)return;b.setObjectMad(31,"axes",1);this.setShapeProperty(31,"position",JU.P3.new3(50,50,3.4028235E38));b.setBooleanProperty("navigationMode",!0);this.viewer.setNavOn(1048589==b.theTok);return;case 1073742162:this.chk||this.viewer.setNavXYZ(0,0,0);
return;case 8:case 1113200654:break;default:this.invArg()}!this.chk&&!this.viewer.getBoolean(603979887)&&b.setBooleanProperty("navigationMode",!0);for(var e=1;e<this.slen;e++){var f=this.isFloatParameter(e)?this.floatParameter(e++):2;0>f&&this.invArg();!this.chk&&0<f&&b.refresh();switch(this.getToken(e).tok){case 8:case 1048586:d=this.getPoint3f(e,!0);b.iToken++;b.iToken!=this.slen&&this.invArg();this.chk||this.viewer.setNavXYZ(d.x,d.y,d.z);return;case 554176526:d=this.floatParameter(++e);this.chk||
c.addLast([Integer.$valueOf(554176526),Float.$valueOf(f),Float.$valueOf(d)]);continue;case 12289:d=this.centerParameter(++e);e=b.iToken;this.chk||c.addLast([Integer.$valueOf(135266320),Float.$valueOf(f),d]);continue;case 528432:switch(this.getToken(++e).tok){case 1112541205:a.set(1,0,0);e++;break;case 1112541206:a.set(0,1,0);e++;break;case 1112541207:a.set(0,0,1);e++;break;case 8:case 1048586:a.setT(this.getPoint3f(e,!0));e=b.iToken+1;break;case 1073741824:this.invArg()}d=this.floatParameter(e);this.chk||
c.addLast([Integer.$valueOf(528432),Float.$valueOf(f),a,Float.$valueOf(d)]);continue;case 4160:var g=d=NaN;if(this.isFloatParameter(++e))d=this.floatParameter(e),g=this.floatParameter(++e);else switch(this.tokAt(e)){case 1112541205:d=this.floatParameter(++e);break;case 1112541206:g=this.floatParameter(++e);break;default:d=this.centerParameter(e);e=b.iToken;this.chk||c.addLast([Integer.$valueOf(4160),Float.$valueOf(f),d]);continue}this.chk||c.addLast([Integer.$valueOf(269484210),Float.$valueOf(f),
Float.$valueOf(d),Float.$valueOf(g)]);continue;case 269484208:continue;case 1113200654:d=new JU.List;10==this.tokAt(e+1)||1048577==this.tokAt(e+1)?(g=this.atomExpressionAt(++e),e=b.iToken):g=this.viewer.getSelectionSet(!1);if(this.chk)return;this.viewer.getPolymerPointsAndVectors(g,d);var h;if(0<(h=d.size())){for(var g=Array(h),j=0;j<h;j++)g[j]=d.get(j);c.addLast([Integer.$valueOf(1113200654),Float.$valueOf(f),g]);continue}break;case 1073742084:if(1048583==this.getToken(e+1).tok){e++;d=b.objectNameParameter(++e);
if(this.chk)return;this.setShapeProperty(22,"thisID",d);d=this.getShapeProperty(22,"vertices");b.refresh();null==d&&this.invArg();g=K(this.isFloatParameter(e+1)?this.floatParameter(++e):0);h=K(this.isFloatParameter(e+1)?this.floatParameter(++e):2147483647);c.addLast([Integer.$valueOf(1073742084),Float.$valueOf(f),d,null,[g,h]]);continue}for(d=new JU.List;b.isCenterParameter(e+1);)d.addLast(this.centerParameter(++e)),e=b.iToken;if(0<d.size()){d=d.toArray(Array(d.size()));this.chk||c.addLast([Integer.$valueOf(1073742084),
Float.$valueOf(f),d,null,[0,2147483647]]);continue}default:this.invArg()}}this.chk||this.viewer.navigateList(b,c)}});W(c$,"evaluateParallel",function(b,a){var c=new J.script.ScriptEvaluator;c.setViewer(this.viewer);c.historyDisabled=!0;c.compiler=new J.script.ScriptCompiler(this.viewer);c.sm=a;try{c.restoreScriptContext(b,!0,!1,!1),c.allowJSThreads=!1,c.dispatchCommands(!1,!1)}catch(d){if(aa(d,Exception))return this.eval.viewer.setStringProperty("_errormessage",""+d),null==c.thisContext&&(J.util.Logger.error("Error evaluating context "+
d),this.viewer.isJS||d.printStackTrace()),!1;throw d;}return!0},"J.script.ScriptContext,J.viewer.ShapeManager");W(c$,"write",function(b){var a=0,c=0,d,e;null==b?(b=this.st,a=c=1,d=!0,e=this.viewer.isApplet()&&!this.viewer.isSignedApplet()||!this.viewer.haveAccess(J.viewer.Viewer.ACCESS.ALL)||0<this.viewer.getPathForAllFiles().length):(d=!1,e=!0);var f=d?this.slen:b.length,g=0,h=0,j=-1,m=-1,u=-2147483648,n=this.viewer.getBoolean(603979934),p=this.viewer.getExportDriverList(),k="PNGJ",q=null,A="",w=
null,s=null,v=null,t=null,G=null,B=Array(1),y=!1,I=!1,F=!1,L=null,E=null,x="SPT",K=d&&1==b.length?1073741884:J.scriptext.ScriptExt.tokAtArray(a,b);switch(K){case 0:break;case 135271429:this.eval.isArrayParameter(a+1)&&(E=this.eval.stringParameterSet(++a),v=s=".",c=a=this.eval.iToken+1,K=this.tokAt(a));break;default:x=J.script.SV.sValue(this.tokenAt(a,b)).toUpperCase()}switch(K){case 135270418:case 1052714:case 1716520985:G=this.plot(b);if(!d)return G;break;case 1073741983:x="INLINE";q=J.script.SV.sValue(this.tokenAt(++a,
b));a++;break;case 1073742102:x="PGRP";a++;A=J.script.SV.sValue(this.tokenAt(a,b)).toLowerCase();A.equals("draw")&&a++;break;case 1048582:a++;y=!0;break;case 1073742158:case 135271429:for(t=J.script.SV.sValue(this.tokenAt(++a,b)).toLowerCase();t.equals("localpath")||t.equals("remotepath");)t.equals("localpath")?s=J.script.SV.sValue(this.tokenAt(++a,b)):v=J.script.SV.sValue(this.tokenAt(++a,b)),t=J.script.SV.sValue(this.tokenAt(++a,b)).toLowerCase();x="SPT";break;case 1229984263:case 135368713:case 1610616855:case 135180:case 1073742015:case 1073742018:case 1183762:case 135188:a++;
break;case 1073741992:x="ZIPALL";a++;break;case 36868:x="VAR";a+=2;break;case 4115:case 1073741824:case 1073741979:case 1073742139:case 4:case 4166:switch(K){case 1073741979:a++;break;case 4166:h=this.eval.intParameterRange(++a,1,10);this.chk||(this.viewer.setVibrationOff(),this.eval.isJS||this.eval.delayScript(100));a++;break;case 4115:a+1<f&&1048577==b[++a].tok||10==b[a].tok?(t=this.eval.atomExpression(b,a,0,!0,!1,!0,!0),a=this.eval.iToken+1):t=this.viewer.getAllAtoms();this.chk||(L=this.viewer.getModelBitSet(t,
!0));break;case 1073742139:t=J.script.SV.sValue(this.tokenAt(++a,b)).toUpperCase();JU.PT.isOneOf(t,";PNG;PNGJ;")&&(k=t,a++);break;default:K=1073741979}if(1073741979==K)if(t=J.script.T.getTokenFromName(J.script.SV.sValue(b[a]).toLowerCase()),null!=t&&(x=J.script.SV.sValue(t).toUpperCase()),JU.PT.isOneOf(x,p.toUpperCase())){a++;x=x.substring(0,1).toUpperCase()+x.substring(1).toLowerCase();I=!0;d&&(w="Jmol."+x.toLowerCase());break}else if(JU.PT.isOneOf(x,";ZIP;ZIPALL;SPT;STATE;")){a++;break}else x="(image)";
2==J.scriptext.ScriptExt.tokAtArray(a,b)&&(j=J.script.SV.iValue(this.tokenAt(a++,b)),m=J.script.SV.iValue(this.tokenAt(a++,b)))}if(null==G){t=J.script.SV.sValue(this.tokenAt(a,b));if(t.equalsIgnoreCase("clipboard")){if(this.chk)return""}else JU.PT.isOneOf(t.toLowerCase(),";jpg;jpeg;jpg64;jpeg64;gif;pdf;ppm;png;pngj;pngt;")?(2==J.scriptext.ScriptExt.tokAtArray(a+1,b)&&2==J.scriptext.ScriptExt.tokAtArray(a+2,b)&&(j=J.script.SV.iValue(this.tokenAt(++a,b)),m=J.script.SV.iValue(this.tokenAt(++a,b))),2==
J.scriptext.ScriptExt.tokAtArray(a+1,b)&&(u=J.script.SV.iValue(this.tokenAt(++a,b)))):JU.PT.isOneOf(t.toLowerCase(),";xyz;xyzrn;xyzvib;mol;sdf;v2000;v3000;json;pdb;pqr;cml;")&&(x=t.toUpperCase(),a+1==f&&a++);x.equals("(image)")&&JU.PT.isOneOf(t.toLowerCase(),";jpg;jpeg;jpg64;jpeg64;gif;pdf;ppm;png;pngj;pngt;scene;")&&(x=t.toUpperCase(),a++);a+2==f&&(F=J.script.SV.sValue(this.tokenAt(++a,b)),0<F.length&&"."!=F.charAt(0)&&(x=t.toUpperCase()));switch(J.scriptext.ScriptExt.tokAtArray(a,b)){case 0:e=!0;
break;case 1073741884:break;case 1073741824:case 4:w=J.script.SV.sValue(this.tokenAt(a,b));a==f-3&&1048584==J.scriptext.ScriptExt.tokAtArray(a+1,b)&&(w+="."+J.script.SV.sValue(this.tokenAt(a+2,b)));if("VAR"!==x&&a==c)x="IMAGE";else if(0<w.length&&"."==w.charAt(0)&&(a==c+1||a==c+2))w=J.script.SV.sValue(this.tokenAt(a-1,b))+w,"VAR"!==x&&a==c+1&&(x="IMAGE");if(w.equalsIgnoreCase("clipboard")||!this.viewer.haveAccess(J.viewer.Viewer.ACCESS.ALL))w=null;break;default:this.invArg()}if(x.equals("IMAGE")||
x.equals("(image)")||x.equals("FRAME")||x.equals("VIBRATION"))x=null!=w&&0<=w.indexOf(".")?w.substring(w.lastIndexOf(".")+1).toUpperCase():"JPG";x.equals("MNU")?x="MENU":x.equals("WRL")||x.equals("VRML")?(x="Vrml",I=!0):x.equals("X3D")?(x="X3d",I=!0):x.equals("IDTF")?(x="Idtf",I=!0):x.equals("MA")?(x="Maya",I=!0):x.equals("JS")?(x="Js",I=!0):x.equals("OBJ")?(x="Obj",I=!0):x.equals("JVXL")?x="ISOSURFACE":x.equals("XJVXL")?x="ISOSURFACE":x.equals("JMOL")?x="ZIPALL":x.equals("HIS")&&(x="HISTORY");x.equals("COORD")&&
(x=null!=w&&0<=w.indexOf(".")?w.substring(w.lastIndexOf(".")+1).toUpperCase():"XYZ");F=JU.PT.isOneOf(x.toLowerCase(),";jpg;jpeg;jpg64;jpeg64;gif;pdf;ppm;png;pngj;pngt;scene;");null!=E&&(x.equals("PNG")&&(x="PNGJ"),!x.equals("PNGJ")&&!x.equals("ZIPALL")&&this.invArg());!F&&(!I&&!JU.PT.isOneOf(x,";SCENE;JMOL;ZIP;ZIPALL;SPT;HISTORY;MO;ISOSURFACE;MESH;PMESH;VAR;FILE;FUNCTION;CML;JSON;XYZ;XYZRN;XYZVIB;MENU;MOL;PDB;PGRP;PQR;QUAT;RAMA;SDF;V2000;V3000;INLINE;"))&&this.eval.errorStr2(54,"COORDS|FILE|FUNCTIONS|HISTORY|IMAGE|INLINE|ISOSURFACE|JMOL|MENU|MO|POINTGROUP|QUATERNION [w,x,y,z] [derivative]|RAMACHANDRAN|SPT|STATE|VAR x|ZIP|ZIPALL  CLIPBOARD",
"CML|GIF|JPG|JPG64|JMOL|JVXL|MESH|MOL|PDB|PMESH|PNG|PNGJ|PNGT|PPM|PQR|SDF|CD|JSON|V2000|V3000|SPT|XJVXL|XYZ|XYZRN|XYZVIB|ZIP"+p.toUpperCase().$replace(";","|"));if(this.chk)return"";a=null;c=!1;if(null==q||I){q=x.intern();if(I){n&&J.util.Logger.startTimer("export");h=new java.util.Hashtable;h.put("type",q);null!=w&&h.put("fileName",w);(d||null!=w)&&h.put("fullPath",B);h.put("width",Integer.$valueOf(j));h.put("height",Integer.$valueOf(m));q=this.viewer.generateOutputForExport(h);if(null==q||0==q.length)return"";
if(!d)return q;(x.equals("Povray")||x.equals("Idtf"))&&null!=B[0]?(j=x.equals("Idtf")?".tex":".ini",w=B[0]+j,d=new java.util.Hashtable,d.put("fileName",w),d.put("type",j),d.put("text",q),d.put("fullPath",B),G=this.viewer.processWriteOrCapture(d),x.equals("Idtf")&&(q=q.substring(0,q.indexOf("\\begin{comment}"))),q="Created "+B[0]+":\n\n"+q,n&&this.showString(J.util.Logger.getTimerMsg("export",0))):G=q;null!=G&&(G.startsWith("OK")||this.eval.evalError(G,null),this.eval.scriptStatusOrBuffer(q));return""}if("MENU"===
q)q=this.viewer.getMenu("");else if("PGRP"===q)q=this.viewer.getPointGroupAsString(A.equals("draw"),null,0,1);else if("PDB"===q||"PQR"===q)e?q=this.viewer.getPdbAtomData(null,null):c=!0;else if("FILE"===q)e?q=this.viewer.getCurrentFileAsString():c=!0,"?".equals(w)&&(w="?Jmol."+this.viewer.getParameter("_fileType"));else if(("SDF"===q||"MOL"===q||"V2000"===q||"V3000"===q||"CD"===q||"JSON"===q)&&y)q=this.viewer.getModelExtract("selected",!0,!1,q),q.startsWith("ERROR:")&&(a=q);else if("XYZ"===q||"XYZRN"===
q||"XYZVIB"===q||"MOL"===q||"SDF"===q||"V2000"===q||"V3000"===q||"CML"===q||"CD"===q||"JSON"===q)q=this.viewer.getData("selected",q),q.startsWith("ERROR:")&&(a=q);else if("FUNCTION"===q)q=this.viewer.getFunctionCalls(null),x="TXT";else if("VAR"===q)q=this.eval.getParameter(J.script.SV.sValue(this.tokenAt(d?2:1,b)),1073742190).asString(),x="TXT";else if("SPT"===q)if(y)b=this.viewer.getTaintedAtoms(2),this.viewer.setAtomCoordsRelative(JU.P3.new3(0,0,0),null),q=this.viewer.getStateInfo(),this.viewer.setTaintedAtoms(b,
2);else{if(q=this.viewer.getStateInfo(),null!=s||null!=v)q=J.viewer.FileManager.setScriptFileReferences(q,s,v,null)}else"ZIP"===q||"ZIPALL"===q?null!=w&&null==(a=q=this.viewer.createZip(w,x,E))&&this.eval.evalError("#CANCELED#",null):"HISTORY"===q?(q=this.viewer.getSetHistory(2147483647),x="SPT"):"MO"===q?(q=this.getMoJvxl(2147483647),x="XJVXL"):"PMESH"===q?(null==(q=this.getIsosurfaceJvxl(!0,28))&&this.error(31),x="XJVXL"):"ISOSURFACE"===q||"MESH"===q?(null==(q=this.getIsosurfaceJvxl("MESH"===q,
24))&&this.error(31),x=0<=q.indexOf("<?xml")?"XJVXL":"JVXL",e||this.showString(this.getShapeProperty(24,"jvxlFileInfo"))):(g=-1,0>u&&(u=-1));null==q&&!c&&(q="");0==g&&!c&&(null==a||H(a,String));F&&(this.eval.refresh(),0>j&&(j=this.viewer.getScreenWidth()),0>m&&(m=this.viewer.getScreenHeight()))}if(!d)return q;if(e)return this.eval.showStringPrint(q,!0),"";if(null!=a&&H(a,String))return 0!=a.indexOf("OK")&&alert(a),this.eval.scriptStatusOrBuffer(a),a;if(x.equals("SCENE"))a=k;else if(null==a&&(!F||
null!=w))a=q;n&&J.util.Logger.startTimer("write");c?G=this.viewer.writeFileData(w,x,0,null):(d=new java.util.Hashtable,null!=w&&d.put("fileName",w),d.put("type",x),H(a,String)&&-2147483648==u?d.put("text",a):H(a,Array)&&d.put("bytes",a),null!=E&&d.put("scripts",E),null!=L&&d.put("bsFrames",L),d.put("fullPath",B),d.put("quality",Integer.$valueOf(u)),d.put("width",Integer.$valueOf(j)),d.put("height",Integer.$valueOf(m)),d.put("nVibes",Integer.$valueOf(h)),G=this.viewer.processWriteOrCapture(d));n&&
this.showString(J.util.Logger.getTimerMsg("write",0))}return!this.chk&&null!=G?(G.startsWith("OK")||(this.eval.evalError(G,null),alert(G)),this.eval.scriptStatusOrBuffer(G+(F?"; width="+j+"; height="+m:"")),G):""},"~A");k(c$,"show",function(){var b=null,a=this.parameterAsString(1),c=null,d=null,e=2,f=this.getToken(1),d=H(f,J.script.SV)?0:f.tok;4==d&&(f=J.script.T.getTokenFromName(a.toLowerCase()),null!=f&&(d=f.tok));1297090050!=d&&1073742158!=d&&this.checkLength(-3);if(2==this.slen&&0<=a.indexOf("?"))this.showString(this.viewer.getAllSettings(a.substring(0,
a.indexOf("?"))));else{switch(d){case 0:this.chk||(c=this.eval.theToken.escape());break;case 135270423:this.chk||(c=J.util.Escape.e(this.viewer.cacheList()));break;case 1073741915:this.checkLength(2);this.chk||(c=this.viewer.calculateStructures(null,!0,!1));break;case 545259571:this.checkLength(2);this.chk||(c=this.viewer.getPathForAllFiles());break;case 1073742038:if(this.eval.optParameterAsString(2).equalsIgnoreCase("1H")){e=3;this.chk||(c=this.viewer.getNMRPredict(!1));break}this.chk||this.viewer.getNMRPredict(!0);
return;case 135267336:case 1073741929:case 1073741879:this.checkLength(1073741879==d?3:2);if(this.chk)return;c=this.viewer.getSmiles(0,0,this.viewer.getSelectionSet(!1),!1,!0,!1,!1);switch(d){case 1073741929:if(0<c.length){this.viewer.show2D(c);return}c="Could not show drawing -- Either insufficient atoms are selected or the model is a PDB file.";break;case 1073741879:if(e=3,f=null,0<c.length){d="/";switch(this.getToken(2).tok){case 1073741977:d="I";break;case 1073741978:d="K";break;case 1073742035:d=
"N";break;default:f=this.parameterAsString(2)}c=this.viewer.getChemicalInfo(c,d,f);0<=c.indexOf("FileNotFound")&&(c="?")}else c="Could not show name -- Either insufficient atoms are selected or the model is a PDB file."}break;case 1297090050:3<this.slen?(e=this.centerParameter(2),f=this.centerParameter(++this.eval.iToken),this.chk||(c=this.viewer.getSymmetryOperation(null,0,e,f,!1)),e=++this.eval.iToken):(e=2==this.eval.checkLength23()?0:this.intParameter(2),this.chk||(c=this.viewer.getSymmetryOperation(null,
e,null,null,!1)),e=-3);break;case 1649412120:b=null;2<this.slen&&(b=J.constant.EnumVdw.getVdwType(this.parameterAsString(2)),null==b&&this.invArg());this.chk||this.showString(this.viewer.getDefaultVdwNameOrData(0,b,null));return;case 135368713:this.eval.checkLength23();this.chk||this.showString(this.viewer.getFunctionCalls(this.eval.optParameterAsString(2)));return;case 1085443:this.checkLength(2);this.chk||this.showString(this.viewer.getAllSettings(null));return;case 1074790760:if(2==this.slen){this.chk||
this.viewer.showUrl(this.eval.getFullPathName());return}d=this.parameterAsString(2);this.chk||this.viewer.showUrl(d);return;case 1766856708:a="defaultColorScheme";break;case 1610612740:a="scaleAngstromsPerInch";break;case 135270418:case 1052714:if(this.chk)return;0>this.viewer.getCurrentModelIndex()&&this.eval.errorStr(30,"show "+this.eval.theToken.value);c=this.plot(this.st);e=this.slen;break;case 1113200654:this.chk||(c=this.getContext(!1));break;case 1073741888:d=this.eval.optParameterAsString(2);
0<d.length&&(e=3);this.chk||(b=this.viewer.getColorSchemeList(d));break;case 1073742192:this.chk||(c=this.viewer.getAtomDefs(this.eval.definedAtomSets)+this.viewer.getVariableList()+this.getContext(!0));break;case 536870926:this.chk||(c=this.viewer.getTrajectoryState());break;case 553648148:b=""+this.eval.commandHistoryLevelMax;break;case 553648150:b=""+J.util.Logger.getLogLevel();break;case 603979824:b=""+this.viewer.getBoolean(603979824);break;case 553648178:c="set strandCountForStrands "+this.viewer.getStrandCount(12)+
"; set strandCountForMeshRibbon "+this.viewer.getStrandCount(13);break;case 536875070:c=this.viewer.showTimeout(2==(e=this.slen)?null:this.parameterAsString(2));break;case 536870918:b=J.util.Escape.eP(this.viewer.getDefaultLattice());break;case 4126:this.chk||(c=this.viewer.getMinimizationInfo());break;case 1611272194:switch(this.viewer.getAxesMode()){case J.constant.EnumAxesMode.UNITCELL:c="set axesUnitcell";break;case J.constant.EnumAxesMode.BOUNDBOX:c="set axesWindow";break;default:c="set axesMolecular"}break;
case 1610612737:c="set bondMode "+(this.viewer.getBoolean(603979812)?"OR":"AND");break;case 1650071565:this.chk||(c="set strandCountForStrands "+this.viewer.getStrandCount(12)+"; set strandCountForMeshRibbon "+this.viewer.getStrandCount(13));break;case 1612189718:c="set hbondsBackbone "+this.viewer.getBoolean(603979852)+";set hbondsSolid "+this.viewer.getBoolean(603979854);break;case 1611141175:this.chk||(c=this.viewer.getSpinState());break;case 1611141176:c="set ssbondsBackbone "+this.viewer.getBoolean(603979952);
break;case 1610625028:case 1611141171:c="selectionHalos "+(this.viewer.getSelectionHaloEnabled(!1)?"ON":"OFF");break;case 1613758470:c="set selectHetero "+this.viewer.getBoolean(1613758470);break;case 1073741828:c=J.util.Escape.eAP(this.viewer.getAdditionalHydrogens(null,!0,!0,null));break;case 1613758476:c="set selectHydrogens "+this.viewer.getBoolean(1613758476);break;case 553648130:case 553648142:case 536870924:case 553648176:case 553648172:case 1073741995:this.chk||(c=this.viewer.getSpecularState());
break;case 4146:this.chk||(c=this.viewer.listSavedStates());break;case 1614417948:this.chk||(c=this.viewer.getUnitCellInfoText());break;case 1048582:if(2==(e=this.slen)){this.chk||(c=this.viewer.getCoordinateState(this.viewer.getSelectionSet(!1)));break}f=this.parameterAsString(2);this.chk||(c=this.viewer.getSavedCoordinates(f));break;case 1073742158:this.chk||this.viewer.clearConsole();if(2==(e=this.slen)){this.chk||(c=this.viewer.getStateInfo());break}d=this.parameterAsString(2);if(d.equals("/")&&
4==(e=this.slen)){d=this.parameterAsString(3).toLowerCase();if(!this.chk){for(var f=JU.PT.split(this.viewer.getStateInfo(),"\n"),c=new JU.SB,g=0;g<f.length;g++)0<=f[g].toLowerCase().indexOf(d)&&c.append(f[g]).appendC("\n");c=c.toString()}break}else if(1229984263==this.tokAt(2)&&4==(e=this.slen)){this.chk||(c=this.viewer.getEmbeddedFileState(this.parameterAsString(3)));break}e=3;this.chk||(c=this.viewer.getSavedState(d));break;case 1641025539:if(2==(e=this.slen)){this.chk||(c=this.viewer.getProteinStructureState());
break}f=this.parameterAsString(2);this.chk||(c=this.viewer.getSavedStructure(f));break;case 135270407:d=3==(e=this.slen)?this.parameterAsString(2):null;this.chk||(c=null==d?this.$data:this.viewer.getData(d),c=null==c?"no data":J.util.Escape.encapsulateData(c[0],c[1],c[3].intValue()));break;case 1073742152:f=null;2==(e=this.slen)?this.chk||(f=this.viewer.getSpaceGroupInfo(null)):(d=this.parameterAsString(2),this.chk||(f=this.viewer.getSpaceGroupInfo(JU.PT.simpleReplace(d,"''",'"'))));null!=f&&(c=""+
f.get("spaceGroupInfo")+f.get("symmetryInfo"));break;case 1048583:e=3;c=this.eval.setObjectProperty();break;case 1679429641:this.chk||(c=this.viewer.getBoundBoxCommand(!0));break;case 12289:this.chk||(c="center "+J.util.Escape.eP(this.viewer.getRotationCenter()));break;case 135176:this.chk||(c=this.getShapeProperty(22,"command"));break;case 1229984263:this.chk||this.viewer.clearConsole();if(2==this.slen){this.chk||(c=this.viewer.getCurrentFileAsString());null==c&&(c="<unavailable>");break}e=3;b=this.parameterAsString(2);
this.chk||(c=this.viewer.getFileAsString(b));break;case 4115:c=1048579==this.tokAt(2)&&0<(e=3)?this.viewer.getModelFileInfoAll():this.viewer.getModelFileInfo();break;case 1610616855:f=2==(e=this.slen)?2147483647:this.intParameter(2);1>f&&this.invArg();this.chk||(this.viewer.clearConsole(),0==this.eval.scriptLevel&&this.viewer.removeCommand(),c=this.viewer.getSetHistory(f));break;case 135180:this.chk||(c=this.getShapeProperty(24,"jvxlDataXml"));break;case 1183762:this.eval.optParameterAsString(2).equalsIgnoreCase("list")?
(c=this.viewer.getMoInfo(-1),e=3):(f=2==(e=this.slen)?-2147483648:this.intParameter(2),this.chk||(c=this.getMoJvxl(f)));break;case 1095766030:this.chk||(c=this.viewer.getModelInfoAsString());break;case 537006096:this.chk||(c=this.viewer.getMeasurementInfoAsString());break;case 1073741863:e=3;!this.chk&&this.slen==e&&(c=this.viewer.getOrientationText(this.tokAt(2),null));break;case 1073742132:d=this.tokAt(2),0==d?d=1073742132:e=3;case 1073742178:case 4130:this.chk||(c=this.viewer.getOrientationText(d,
null));break;case 1073742077:e=2;if(3<this.slen)break;switch(d=this.tokAt(2)){case 1073742178:case 1073742132:case 4130:case 0:this.chk||(c=this.viewer.getOrientationText(d,null));break;default:d=this.eval.optParameterAsString(2),c=this.viewer.getOrientationText(1073742035,d)}e=this.slen;break;case 1073742088:this.chk||(c=this.viewer.getPDBHeader());break;case 1073742102:this.pointGroup();return;case 1089470478:this.chk||(c=this.viewer.getSymmetryInfoAsString());break;case 1073742176:this.chk||(c=
"transform:\n"+this.viewer.getTransformText());break;case 4168:c="zoom "+(this.viewer.getZoomEnabled()?""+this.viewer.getZoomSetting():"off");break;case 1611272202:c=this.viewer.getShowFrank()?"frank ON":"frank OFF";break;case 1666189314:a="solventProbeRadius";break;case 1073741864:case 1087373316:case 1087373320:case 1073742120:case 1114638363:case 1087373318:case 1141899265:case 1073741982:c=this.viewer.getChimeInfo(d);break;case 537022465:case 1610612738:case 1716520985:case 20482:case 1613758488:b=
"?";break;case 1073741824:a.equalsIgnoreCase("fileHeader")?this.chk||(c=this.viewer.getPDBHeader()):a.equalsIgnoreCase("menu")?this.chk||(b=this.viewer.getMenu("")):a.equalsIgnoreCase("mouse")&&(f=2==(e=this.slen)?null:this.parameterAsString(2),this.chk||(c=this.viewer.getBindingInfo(f)))}this.checkLength(e);this.chk||(null!=c?this.showString(c):null!=b?this.showString(a+" = "+b):null!=a&&(0<=a.indexOf(" ")?this.showString(a):this.showString(a+" = "+this.getParameterEscaped(a))))}});k(c$,"showString",
function(b){this.eval.showString(b)},"~S");k(c$,"checkLength",function(b){this.eval.checkLength(b)},"~N");k(c$,"getIsosurfaceJvxl",function(b,a){return this.chk?"":this.getShapeProperty(a,b?"jvxlMeshX":"jvxlDataXml")},"~B,~N");k(c$,"getMoJvxl",function(b){this.sm.loadShape(27);var a=this.viewer.getCurrentModelIndex();0>a&&this.eval.errorStr(30,"MO isosurfaces");var c=this.viewer.getModelAuxiliaryInfoValue(a,"moData");null==c&&this.error(27);var d=this.getShapeProperty(27,"moNumber");(null==d||0==
d.intValue())&&this.setShapeProperty(27,"init",Integer.$valueOf(a));this.setShapeProperty(27,"moData",c);return this.getShapePropertyIndex(27,"showMO",b)},"~N");k(c$,"getParameterEscaped",function(b){var a=this.eval.getContextVariableAsVariable(b);return null==a?""+this.viewer.getParameterEscaped(b):a.escape()},"~S");k(c$,"getContext",function(b){for(var a=new JU.SB,c=this.eval.thisContext;null!=c;)b?null!=c.contextVariables&&(a.append(this.getScriptID(c)),a.append(J.viewer.StateManager.getVariableList(c.contextVariables,
80,!0,!1))):a.append(J.script.ScriptEvaluator.getErrorLineMessage(c.functionName,c.scriptFileName,this.eval.getLinenumber(c),c.pc,J.script.ScriptEvaluator.statementAsString(this.viewer,c.statement,-9999,this.eval.logMessages))),c=c.parentContext;b?null!=this.eval.contextVariables&&(a.append(this.getScriptID(null)),a.append(J.viewer.StateManager.getVariableList(this.eval.contextVariables,80,!0,!1))):a.append(this.eval.getErrorLineMessage2());return a.toString()},"~B");k(c$,"getScriptID",function(b){return"\n# "+
(null==b?this.eval.functionName:"function "+b.functionName)+" (file "+(null==b?this.eval.scriptFileName:b.scriptFileName)+(null==b?"":" context "+b.id)+")\n"},"J.script.ScriptContext");k(c$,"getShapePropertyIndex",function(b,a,c){return this.sm.getShapePropertyIndex(b,a,c)},"~N,~S,~N");k(c$,"tokenAt",function(b,a){return b<a.length?a[b]:null},"~N,~A");c$.tokAtArray=k(c$,"tokAtArray",function(b,a){return b<a.length&&null!=a[b]?a[b].tok:0},"~N,~A");k(c$,"calculate",function(){var b=!1,a=!1,c=null,d=
null,e=-2147483648;if(2<=(this.eval.iToken=this.eval.slen))switch(this.eval.clearDefinedVariableAtomSets(),this.getToken(1).tok){case 1073741824:this.checkLength(2);break;case 1632634891:this.checkLength(2);if(this.chk)return;e=this.viewer.calculateFormalCharges(null);this.showString(J.i18n.GT.i(J.i18n.GT._("{0} charges modified"),e));return;case 1076887572:this.checkLength(2);this.chk||this.viewer.assignAromaticBonds();return;case 1612189718:2!=this.eval.slen&&(c=(a=1641025539==this.tokAt(++this.eval.iToken))?
this.viewer.getSelectionSet(!1):this.atomExpressionAt(this.eval.iToken),!a&&1641025539!=this.tokAt(++this.eval.iToken)&&(d=this.atomExpressionAt(this.eval.iToken)));if(this.chk)return;e=this.viewer.autoHbond(c,d,!1);-2147483648!=e&&this.eval.scriptStatusOrBuffer(J.i18n.GT.i(J.i18n.GT._("{0} hydrogen bonds"),Math.abs(e)));return;case 1613758476:c=2==this.slen?null:this.atomExpressionAt(2);this.eval.checkLast(this.eval.iToken);this.chk||this.viewer.addHydrogens(c,!1,!1);return;case 1112541196:this.eval.iToken=
1;c=2==this.slen?null:this.atomExpressionAt(2);this.eval.checkLast(this.eval.iToken);this.chk||this.viewer.calculatePartialCharges(c);return;case 1073742102:this.pointGroup();return;case 1112539150:this.checkLength(2);this.chk||(this.viewer.calculateStraightness(),this.viewer.addStateScript("set quaternionFrame '"+this.viewer.getQuaternionFrame()+"'; calculate straightness",!1,!0));return;case 1641025539:c=4>this.slen?null:this.atomExpressionAt(2);switch(this.tokAt(++this.eval.iToken)){case 1052714:break;
case 1073741915:a=!0;break;case 0:a=this.viewer.getBoolean(603979825);break;default:this.invArg()}this.chk||this.showString(this.viewer.calculateStructures(c,a,!0));return;case 1708058:c=this.eval.iToken+1<this.slen?this.atomExpressionAt(++this.eval.iToken):null;d=this.eval.iToken+1<this.slen?this.atomExpressionAt(++this.eval.iToken):null;this.checkLength(++this.eval.iToken);this.chk||(e=this.viewer.calculateStruts(c,d),0<e&&(this.setShapeProperty(1,"type",Integer.$valueOf(32768)),this.eval.setShapePropertyBs(1,
"color",Integer.$valueOf(16777215),null),this.eval.setShapeTranslucency(1,"","translucent",0.5,null),this.setShapeProperty(1,"type",Integer.$valueOf(1023))),this.showString(J.i18n.GT.i(J.i18n.GT._("{0} struts mp.added"),e)));return;case 3145756:b=!0;case 1112539151:a=!1;switch(this.tokAt(2)){case 135266325:this.eval.iToken++;break;case 0:a=!b;break;case 1073741952:a=!0;this.eval.iToken++;break;default:a=!0}c=this.eval.iToken+1<this.slen?this.atomExpressionAt(++this.eval.iToken):this.viewer.getSelectionSet(!1);
this.checkLength(++this.eval.iToken);this.chk||this.viewer.calculateSurface(c,a?3.4028235E38:-1);return}this.eval.errorStr2(53,"CALCULATE","aromatic? hbonds? hydrogen? formalCharge? partialCharge? pointgroup? straightness? structure? struts? surfaceDistance FROM? surfaceDistance WITHIN?")});k(c$,"pointGroup",function(){switch(this.tokAt(0)){case 4102:this.chk||this.showString(this.viewer.calculatePointGroup());return;case 4148:this.chk||this.showString(this.viewer.getPointGroupAsString(!1,null,0,
0));return}var b=2,a=1073742138==this.tokAt(b)?"":this.eval.optParameterAsString(b);a.equals("chemicalShift")&&(a="cs");var c=1,d=0;0<a.length&&this.isFloatParameter(++b)&&(d=this.intParameter(b++));1073742138==this.tokAt(b)&&(c=this.floatParameter(++b));this.chk||this.eval.runScript(this.viewer.getPointGroupAsString(!0,a,d,c))});k(c$,"mapProperty",function(){for(var b,a,c,d,e,f=0,g=0,h=0;;){if(1114638363==this.tokAt(1))b=this.viewer.getSelectionSet(!1),a=this.atomExpressionAt(2),c=d="selected";else{b=
this.atomExpressionAt(1);if(1048584!=this.tokAt(++this.eval.iToken)||!J.script.T.tokAttr(f=this.tokAt(++this.eval.iToken),1078984704))break;c=this.parameterAsString(this.eval.iToken);a=this.atomExpressionAt(++this.eval.iToken);if(1048584!=this.tokAt(++this.eval.iToken)||!J.script.T.tokAttr(g=this.tokAt(++this.eval.iToken),2048))break;d=this.parameterAsString(this.eval.iToken)}e=J.script.T.tokAttr(h=this.tokAt(this.eval.iToken+1),1078984704)?this.parameterAsString(++this.eval.iToken):J.script.T.nameOf(h=
1095763969);this.eval.checkLast(this.eval.iToken);if(this.chk)return;var j=null;this.showString("mapping "+c.toUpperCase()+" for "+b.cardinality()+" atoms to "+d.toUpperCase()+" for "+a.cardinality()+" atoms using "+e.toUpperCase());if(J.script.T.tokAttrOr(f,1095761920,1112539136)&&J.script.T.tokAttrOr(g,1095761920,1112539136)&&J.script.T.tokAttrOr(h,1095761920,1112539136)){var m=this.eval.getBitsetPropertyFloat(b,f|224,NaN,NaN),u=this.eval.getBitsetPropertyFloat(b,h|224,NaN,NaN),f=this.eval.getBitsetPropertyFloat(a,
h|224,NaN,NaN),n=1716520985==g,p=E(n?this.viewer.getAtomCount():f.length,0),j=new JU.BS;if(m.length==u.length){for(var k=new java.util.Hashtable,h=0;h<m.length;h++)k.put(Float.$valueOf(u[h]),Float.$valueOf(m[h]));m=-1;for(h=u=0;h<f.length;h++){var m=a.nextSetBit(m+1),q=k.get(Float.$valueOf(f[h]));null!=q&&(j.set(m),p[n?m:u]=q.floatValue(),u++)}n?this.viewer.setData(d,[d,p,j,Integer.$valueOf(0),Boolean.TRUE],this.viewer.getAtomCount(),0,0,2147483647,0):this.viewer.setAtomProperty(j,g,0,0,null,p,null)}}if(null==
j){c=this.getBitsetIdent(b,"{"+e+"=%["+e+"]}."+d+" = %["+c+"]",null,!1,2147483647,!1);b=new JU.SB;for(h=0;h<c.length;h++)0>c[h].indexOf("null")&&b.append(c[h]).appendC("\n");J.util.Logger.debugging&&J.util.Logger.debug(b.toString());c=J.util.BSUtil.copy(this.viewer.getSelectionSubset());this.viewer.setSelectionSubset(a);try{this.eval.runScript(b.toString())}catch(A){if(aa(A,Exception))a=A,this.viewer.setSelectionSubset(c),this.eval.errorStr(-1,"Error: "+a.toString());else if(aa(A,Error))a=A,this.viewer.setSelectionSubset(c),
this.eval.errorStr(-1,"Error: "+a.toString());else throw A;}this.viewer.setSelectionSubset(c)}this.showString("DONE");return}this.invArg()});k(c$,"minimize",function(){for(var b=null,a=2147483647,c=0,d=!1,e=!1,f=null,g=!1,h=this.viewer.getMinimizer(!1),j=1;j<this.slen;j++)switch(this.getToken(j).tok){case 1073741828:d=!0;continue;case 1073741874:case 1073742162:this.checkLength(2);if(this.chk||null==h)return;h.setProperty(this.parameterAsString(j),null);return;case 1073741882:this.checkLength(2);
if(this.chk||null==h)return;h.setProperty("clear",null);return;case 1073741894:1!=j&&this.invArg();a=b=0;c=Q(5,0);if(1073741882==this.tokAt(++j))this.checkLength(3);else{for(;4>b&&!this.isFloatParameter(j);)c[++b]=this.atomExpressionAt(j).nextSetBit(0),j=this.eval.iToken+1;c[0]=b;1==b&&this.invArg();a=this.floatParameter(this.eval.checkLast(j))}this.chk||this.viewer.getMinimizer(!0).setProperty("constraint",[c,Q(b,0),Float.$valueOf(a)]);return;case 1073741905:c=this.floatParameter(++j);continue;case 1073741934:a=
0;continue;case 1060869:1!=j&&this.invArg();f=this.atomExpressionAt(++j);0>f.nextSetBit(0)&&(f=null);j=this.eval.iToken;this.chk||this.viewer.getMinimizer(!0).setProperty("fixed",f);if(j+1==this.slen)return;continue;case 10:case 1048577:g=!0;case 135280132:135280132==this.eval.theTok&&j++;b=this.atomExpressionAt(j);j=this.eval.iToken;1073742072==this.tokAt(j+1)&&(j++,g=!0);continue;case 1073742148:e=!0;break;case 266298:a=this.intParameter(++j);continue;default:this.invArg()}this.chk||this.viewer.minimize(a,
c,b,f,0,d,g,e,!1)});k(c$,"modulation",function(){var b=null,a=!0,c=!1,d=null;switch(this.getToken(1).tok){case 1048588:a=!1;case 0:case 1048589:break;case 10:case 1048577:d=this.atomExpressionAt(1);switch(this.tokAt(this.eval.iToken+1)){case 1048588:a=!1;case 1048589:this.eval.iToken++}this.eval.checkLast(this.eval.iToken);break;case 1048586:case 8:b=this.eval.getPoint3f(1,!1);c=1048589==this.tokAt(this.eval.iToken+1);break;case 3:b=this.floatParameter(1);b=JU.P3.new3(b,b,b);break;case 2:c=this.intParameter(1);
b=JU.P3.new3(c,c,c);c=!0;break;case 1073742138:a=this.floatParameter(2);this.chk||this.viewer.setFloatProperty("modulationScale",a);return;default:this.invArg()}this.chk||this.viewer.setModulation(d,a,b,c)});k(c$,"setContactBitSets",function(b,a,c,d,e,f){var g,h;null==a?(a=J.util.BSUtil.setAll(this.viewer.getAtomCount()),J.util.BSUtil.andNot(a,this.viewer.getDeletedAtoms()),a.andNot(b),g=!1):(h=J.util.BSUtil.copy(b),h.or(a),h=this.viewer.getModelBitSet(h,!1).cardinality(),g=1<h,f&&(1<h&&!this.eval.tQuiet)&&
this.showString(J.i18n.GT._("Note: More than one model is involved in this contact!")));if(!b.equals(a)){if(f=!c||b.cardinality()<a.cardinality())h=this.viewer.getAtomsWithinRadius(d,b,g,Float.isNaN(d)?e:null),a.and(h);c&&(h=this.viewer.getAtomsWithinRadius(d,a,g,Float.isNaN(d)?e:null),b.and(h),f||(h=this.viewer.getAtomsWithinRadius(d,b,g,Float.isNaN(d)?e:null),a.and(h)),h=J.util.BSUtil.copy(a),h.and(b),h.equals(b)?a.andNot(b):h.equals(a)&&b.andNot(a))}return a},"JU.BS,JU.BS,~B,~N,J.atomdata.RadiusData,~B");
k(c$,"compare",function(){var b=!1,a=!1,c=!1,d=!1,e=!1,f=null,g=null,h=null,j=null,m=null,u=null;this.eval.iToken=0;var n=this.isFloatParameter(1)?this.floatParameter(++this.eval.iToken):NaN,p=this.atomExpressionAt(++this.eval.iToken),k=null,q=null;this.eval.isArrayParameter(++this.eval.iToken)?k=this.eval.getPointArray(this.eval.iToken,-1):1141899265!=this.tokAt(this.eval.iToken)&&(q=this.atomExpressionAt(this.eval.iToken));var A=null,w=!1,s=null,v=J.util.BSUtil.copy(p);null!=q&&v.or(q);for(var v=
d=null==k&&null!=q&&v.equals(p),t=this.eval.iToken+1;t<this.slen;++t)switch(this.getToken(t).tok){case 4115:v=!0;break;case 135267336:w=!0;case 135267335:s=this.stringParameter(++t);break;case 1678770178:a=e=!0;s=this.parameterAsString(++t);s.equalsIgnoreCase("SMILES")&&(w=!0,s=this.viewer.getSmiles(0,0,p,!1,!1,!1,!1));break;case 3:case 2:n=Math.abs(this.floatParameter(t));break;case 269484080:break;case 3158024:A=this.atomExpressionAt(++t);t=this.eval.iToken;break;case 10:case 1048577:null!=u&&this.invArg();
var h=this.atomExpressionAt(this.eval.iToken),G=d?0:this.tokAt(this.eval.iToken+1),j=null==k&&this.eval.isArrayParameter(this.eval.iToken+1)?null:10==G||1048577==G?this.atomExpressionAt(++this.eval.iToken):J.util.BSUtil.copy(h);null!=A&&(h.and(A),null!=j&&j.and(A));null==j?k=this.eval.getPointArray(++this.eval.iToken,-1):j.and(q);null==m&&(m=new JU.List);m.addLast([h,j]);t=this.eval.iToken;break;case 7:null!=m&&this.invArg();b=!0;f=this.getQuaternionArray(this.eval.theToken.getList(),1073742001);
this.getToken(++t);g=this.getQuaternionArray(this.eval.theToken.getList(),1073742001);null==u&&(u=new JU.List);u.addLast([f,g]);break;case 1073742077:b=!0;break;case 135266320:case 1141899265:b=!1;break;case 528432:a=!0;break;case 4160:c=!0;break;default:this.invArg()}if(!this.chk){v&&(n=0);Float.isNaN(n)||0>n?n=1:!a&&!c&&(a=c=!0);d=0!=n;G=!b&&null==s||null!=k;null==m&&null==u&&(null==A?(h=G?this.viewer.getAtomBitSet("spine"):new JU.BS,0>h.nextSetBit(0)?(h=p,j=q):(j=J.util.BSUtil.copy(h),h.and(p),
j.and(q))):(h=J.util.BSUtil.copy(p),j=J.util.BSUtil.copy(q),h.and(A),j.and(A),h.and(p),j.and(q)),m=new JU.List,m.addLast([h,j]));if(v){p=this.viewer.getModelBitSet(p,!1);A=Array(p.cardinality());t=0;for(j=p.nextSetBit(0);0<=j;j=p.nextSetBit(j+1),t++)A[t]=this.viewer.getModelUndeletedAtomsBitSet(j)}else A=[p];for(j=0;j<A.length;j++){for(var p=A[j],B=E(2,0),y=null,I=new JU.List,F=null,L=v?new JU.List:m,t=0;t<m.size();++t){var H=m.get(t);v&&L.addLast(H=[J.util.BSUtil.copy(H[0]),H[1]]);H[0].and(p)}var x=
null,K=null;if(G){null!=k&&(L.clear(),L.addLast([h,k]));try{F=this.viewer.getCenterAndPoints(L,!0)}catch(Q){if(aa(Q,Exception))this.invArg();else throw Q;}y=J.util.Measure.calculateQuaternionRotation(F,B,!0);t=Float.isNaN(B[1])?NaN:Math.round(100*B[0])/100;B=Float.isNaN(B[1])?NaN:Math.round(100*B[1])/100;this.showString("RMSD "+t+" --\x3e "+B+" Angstroms")}else if(b){if(null==u)for(t=0;t<L.size();t++){H=L.get(t);f=this.viewer.getAtomGroupQuaternions(H[0],2147483647);g=this.viewer.getAtomGroupQuaternions(H[1],
2147483647);for(y=0;y<f.length&&y<g.length;y++)I.addLast(g[y].div(f[y]))}else for(y=0;y<f.length&&y<g.length;y++)I.addLast(g[y].div(f[y]));B[0]=0;f=I.toArray(Array(I.size()));y=J.util.Quaternion.sphereMean(f,B,1E-4);this.showString("RMSD = "+B[0]+" degrees")}else{t=new JU.M4;x=new JU.P3;if(e){var T;if(null==p||null==q||null==(T=this.getFlexFitList(p,q,s,!w)))break;this.viewer.setDihedrals(T,null,1)}B=this.getSmilesCorrelation(p,q,s,null,null,t,null,!w,!1,null,x);Float.isNaN(B)&&this.invArg();c&&(K=
new JU.V3,t.get(K));a&&(y=new JU.M3,t.getRotationScale(y),y=J.util.Quaternion.newM(y));this.showString("RMSD = "+B+" Angstroms")}null!=F&&(x=F[0][0]);null==x&&(F=this.viewer.getCenterAndPoints(L,!0),x=F[0][0]);L=new JU.P3;B=NaN;c&&(null==K&&(K=JU.V3.newVsub(F[1][0],x)),B=1E10);a&&(null==y&&this.eval.evalError("option not implemented",null),L.add2(x,y.getNormal()),B=y.getTheta(),0==B&&c&&(0.01<K.length()?B=1E10:a=c=d=!1));if(!Float.isNaN(B)&&!Float.isNaN(L.x)&&(F=null,a&&(c&&0!=n)&&(F=this.viewer.getAtomPointVector(p),
t=J.script.ScriptMathProcessor.getMatrix4f(y.getMatrix(),K),F=J.util.Measure.transformPoints(F,t,x)),this.eval.useThreads()||(d=!1),this.viewer.rotateAboutPointsInternal(this.eval,x,L,B/n,B,d,p,K,F,null)&&d&&this.eval.isJS))throw new J.script.ScriptInterruption(this.eval,"compare",1);}}});k(c$,"configuration",function(){var b;if(1==this.slen)b=this.viewer.setConformation(),this.viewer.addStateScriptRet("select",null,this.viewer.getSelectionSet(!1),null,"configuration",!0,!1);else{var a=this.intParameter(this.eval.checkLast(1));
if(this.chk)return;b=this.viewer.getConformation(this.viewer.getCurrentModelIndex(),a-1,!0);this.viewer.addStateScript("configuration "+a+";",!0,!1)}this.chk||(this.setShapeProperty(1,"type",Integer.$valueOf(30720)),this.eval.setShapeSizeBs(1,0,b),this.viewer.autoHbond(b,b,!0),this.viewer.select(b,!1,0,this.eval.tQuiet))});k(c$,"measure",function(){var b=this.eval,a=null,c=0,d=null;if(2==this.slen)switch(this.tokAt(1)){case 1048588:this.setShapeProperty(6,"hideAll",Boolean.TRUE);return;case 12291:this.chk||
this.viewer.clearAllMeasurements();return}this.viewer.loadShape(6);switch(this.tokAt(1)){case 135267335:var e=this.stringParameter(3==this.slen?2:4);if(this.chk)return;var f=this.viewer.modelSet.atoms,a=this.viewer.getAtomCount(),e=this.viewer.getSmilesMatcher().getCorrelationMaps(e,f,a,this.viewer.getSelectionSet(!1),!0,!1);if(null==e)return;this.setShapeProperty(6,"maps",e);return}switch(this.slen){case 2:switch(this.getToken(1).tok){case 0:case 1048589:this.viewer.loadShape(6);this.setShapeProperty(6,
"hideAll",Boolean.FALSE);return;case 1073742001:this.chk||b.showStringPrint(this.viewer.getMeasurementInfoAsString(),!1);return;case 4:this.setShapeProperty(6,"setFormats",this.stringParameter(1));return}b.errorStr(24,"ON, OFF, DELETE");break;case 3:switch(this.getToken(1).tok){case 12291:if(1048579==this.getToken(2).tok)this.chk||this.viewer.clearAllMeasurements();else{var g=this.intParameter(2)-1;this.chk||this.viewer.deleteMeasurement(g)}return}}for(var h=0,j=0,m=-1,k=-1,n=-1,p=Q(5,0),E=[3.4028235E38,
3.4028235E38],q=!1,A=!1,w=!1,s=!0,v=null,t=null,e=269484114,G=f=null,B=new JU.List,y=new JU.BS,I=null,F=null,L=0,U=0,g=1;g<this.slen;++g)switch(this.getToken(g).tok){case 1074790550:1!=g&&this.invArg();a=b.optParameterAsString(++g);continue;case 1073741824:b.errorStr(24,"ALL, ALLCONNECTED, DELETE");break;default:this.error(15);break;case 269484144:135266310!=this.tokAt(g+1)&&this.invArg();g++;w=!0;break;case 135266310:case 1073741834:case 1048579:A=1073741834==b.theTok;k=-1;q=!0;A&&w&&this.invArg();
break;case 1766856708:c=J.util.C.getColix(b.getArgbParam(++g));g=b.iToken;break;case 1073742066:b.isPoint3f(++g)?(d=this.getPoint3f(g,!1),d=[1,d.x,d.y,d.z,0,0,0]):d=b.floatParameterSet(g,7,7);g=b.iToken;break;case 1666189314:case 1073741916:U=K((1666189314==b.theTok?2E3:1E3)*this.floatParameter(++g));null!=a&&0>=U&&(U=-1);break;case 3:null!=v&&this.invArg();s=q=!0;n=(n+1)%2;E[n]=this.floatParameter(g);break;case 12291:269484114!=e&&this.invArg();e=12291;break;case 4114:var x=this.floatParameter(++g),
W=this.parameterAsString(++g),aa=this.parameterAsString(++g);this.chk||(G=this.viewer.getFont3D(W,aa,x));break;case 2:x=this.intParameter(g);if(q)s=!0,n=(n+1)%2,E[n]=x;else{k=this.viewer.getAtomIndexFromAtomNumber(x);if(!this.chk&&0>k)return;null!=I&&this.invArg();4<(p[0]=++h)&&this.error(2);p[h]=k}break;case 1095761935:m=this.intParameter(++g);break;case 1048588:269484114!=e&&this.invArg();e=1048588;break;case 1048589:269484114!=e&&this.invArg();e=1048589;break;case 1073742114:s=q=!0;k=-1;break;
case 1073741989:case 1073741990:t=Boolean.$valueOf(1073741989==b.theTok);q=!0;w=1073741990==b.theTok;break;case 1649412120:0<=n&&this.invArg();v=b.encodeRadiusParameter(g,!1,!0);v.values=E;g=b.iToken;q=w=!0;t=Boolean.$valueOf(!1);1==L&&(L++,h++,x=J.util.BSUtil.copy(y),J.util.BSUtil.invertInPlace(x,this.viewer.getAtomCount()),x.and(this.viewer.getAtomsWithinRadius(5,y,!1,null)),B.addLast(x));break;case 10:case 1048577:case 1048586:case 8:case 1048583:(10==b.theTok||1048577==b.theTok)&&L++;0<=k&&this.invArg();
b.expressionResult=Boolean.FALSE;I=this.centerParameter(g);if(H(b.expressionResult,JU.BS)&&(I=y=b.expressionResult,!this.chk&&0==y.length()))return;H(I,JU.P3)&&(h=new J.util.Point3fi,h.setT(I),h.modelIndex=m,I=h);4<(h=++j)&&this.error(2);g=b.iToken;B.addLast(I);break;case 4:f=this.stringParameter(g);break;case 1073742164:F=b.checkTicks(g,!1,!0,!0),g=b.iToken,e=1060866}(null!=v&&(0<=n||2!=h)||2>h&&null==a&&(null==F||1==h))&&this.error(2);null!=f&&0!=f.indexOf(h+":")&&(f=h+":"+f);s&&E[1]<E[0]&&(E[1]=
E[0],E[0]=3.4028235E38==E[1]?3.4028235E38:-200);if(!this.chk)if(null!=I||null!=F)null==v&&(v=new J.atomdata.RadiusData(E,0,null,null)),null==I&&(F.id="default"),null!=I&&(null!=f&&269484114==e)&&(e=1060866),b=null,null!=G&&(b=J.api.Interface.getOptionInterface("modelset.Text").newLabel(this.viewer.getGraphicsData(),G,"",c,0,0,0,null)),null!=b&&(b.pymolOffset=d),this.setShapeProperty(6,"measure",this.newMeasurementData(a,B).set(e,null,v,f,null,F,A,w,t,q,U,c,b));else switch(a=null==a?p:a,e){case 12291:this.setShapeProperty(6,
"delete",a);break;case 1048589:this.setShapeProperty(6,"show",a);break;case 1048588:this.setShapeProperty(6,"hide",a);break;default:this.setShapeProperty(6,null==f?"toggle":"toggleOn",a),null!=f&&this.setShapeProperty(6,"setFormats",f)}});k(c$,"getFlexFitList",function(b,a,c,d){var e=JU.AU.newInt2(2);this.getSmilesCorrelation(b,a,c,null,null,null,null,d,!1,e,null);if(null==e[0])return null;b=this.viewer.getDihedralMap(e[0]);a=null==b?null:this.viewer.getDihedralMap(e[1]);if(null==a||a.length!=b.length)return null;
e=E(b.length,3,0);c=this.viewer.modelSet.atoms;J.scriptext.ScriptExt.getTorsions(c,a,e,0);J.scriptext.ScriptExt.getTorsions(c,b,e,1);a=E(6*b.length,0);for(d=c=0;c<b.length;c++){var f=b[c];a[d++]=f[0];a[d++]=f[1];a[d++]=f[2];a[d++]=f[3];a[d++]=e[c][0];a[d++]=e[c][1]}return a},"JU.BS,JU.BS,~S,~B");c$.getTorsions=k(c$,"getTorsions",function(b,a,c,d){for(var e=a.length;0<=--e;){var f=a[e],f=J.util.Measure.computeTorsion(b[f[0]],b[f[1]],b[f[2]],b[f[3]],!0);1==d&&(180<f-c[e][0]?f-=360:-180>=f-c[e][0]&&
(f+=360));c[e][d]=f}},"~A,~A,~A,~N");k(c$,"getSmilesCorrelation",function(b,a,c,d,e,f,g,h,j,m,k){var n=null==m?0.1:3.4028235E38;try{null==d&&(d=new JU.List,e=new JU.List);var p=new JU.M4,E=new JU.P3,q=this.viewer.modelSet.atoms,A=this.viewer.getAtomCount(),w=this.viewer.getSmilesMatcher().getCorrelationMaps(c,q,A,b,h,!0);null==w&&this.eval.evalError(this.viewer.getSmilesMatcher().getLastException(),null);if(0==w.length)return NaN;var s=w[0];for(b=0;b<s.length;b++)d.addLast(q[s[b]]);w=this.viewer.getSmilesMatcher().getCorrelationMaps(c,
q,A,a,h,!1);null==w&&this.eval.evalError(this.viewer.getSmilesMatcher().getLastException(),null);if(0==w.length)return NaN;if(j){for(b=0;b<w.length;b++)for(var v=0;v<w[b].length;v++)e.addLast(q[w[b][v]]);return 0}a=3.4028235E38;c=null;for(b=0;b<w.length;b++){e.clear();for(v=0;v<w[b].length;v++)e.addLast(q[w[b][v]]);var t=J.util.Measure.getTransformMatrix4(d,e,p,E);J.util.Logger.info("getSmilesCorrelation stddev="+t);if(null!=g&&t<n){for(var G=new JU.BS,v=0;v<w[b].length;v++)G.set(w[b][v]);g.addLast(G)}t<
a&&(c=w[b],null!=f&&f.setM(p),null!=k&&k.setT(E),a=t)}null!=m&&(m[0]=s,m[1]=c);e.clear();for(b=0;b<c.length;b++)e.addLast(q[c[b]]);return a}catch(B){if(aa(B,Exception))return this.eval.evalError(B.toString(),null),0;throw B;}},"JU.BS,JU.BS,~S,JU.List,JU.List,JU.M4,JU.List,~B,~B,~A,JU.P3");W(c$,"getSmilesMatches",function(b,a,c,d,e,f){if(this.chk)return f?new JU.BS:["({})"];if(0==b.length){var g=this.viewer.getSmiles(0,0,c,!f,!1,!0,!0);null==g&&this.eval.evalError(this.viewer.getSmilesMatcher().getLastException(),
null);return g}g=!0;if(null==d){if(b=(g=null==a)?this.viewer.getSmilesMatcher().getSubstructureSetArray(b,this.viewer.modelSet.atoms,this.viewer.getAtomCount(),c,null,e,!1):this.viewer.getSmilesMatcher().find(b,a,e,!1),null==b)return this.eval.showStringPrint(this.viewer.getSmilesMatcher().getLastException(),!1),!g&&!e?Integer.$valueOf(-1):"?"}else{a=new JU.List;b=this.getSmilesCorrelation(d,c,b,null,null,null,a,e,!1,null,null);if(Float.isNaN(b))return f?new JU.BS:[];this.showString("RMSD "+b+" Angstroms");
b=a.toArray(Array(a.size()))}if(f){f=new JU.BS;for(c=0;c<b.length;c++)f.or(b[c]);if(g)return f;if(!e)return Integer.$valueOf(f.cardinality());g=Q(f.cardinality(),0);e=0;for(b=f.nextSetBit(0);0<=b;b=f.nextSetBit(b+1))g[e++]=b+1;return g}e=Array(b.length);for(c=0;c<b.length;c++)e[c]=g?J.util.Escape.eBS(b[c]):J.util.Escape.eBond(b[c]);return e},"~S,~S,JU.BS,JU.BS,~B,~B");W(c$,"evaluate",function(b,a,c,d){switch(d){case 135266826:case 135266819:case 135266821:case 135266318:case 135266820:case 135266822:return this.evaluateMath(b,
c,d);case 1276118017:case 1276117504:case 1276117507:case 1276117508:case 1276117511:case 1276383749:case 1276383249:return this.evaluateList(b,a.intValue,c);case 135266306:case 269484096:return this.evaluateArray(b,c,269484096==d);case 135266307:case 135270418:return this.evaluateQuaternion(b,c,d);case 1276118529:return this.evaluateBin(b,c);case 1276117514:case 1276117515:return this.evaluateRowCol(b,c,d);case 1766856708:return this.evaluateColor(b,c);case 135270405:return this.evaluateCompare(b,
c);case 135266310:return this.evaluateConnected(b,c);case 135267329:return this.evaluateCross(b,c);case 135270407:return this.evaluateData(b,c);case 1276118018:case 1276117505:if(269484241==a.tok)return this.evaluateDot(b,c,d,a.intValue);case 135266305:case 1746538509:return this.evaluateMeasure(b,c,a.tok);case 1229984263:case 135271426:return this.evaluateLoad(b,c,d);case 1276118531:return this.evaluateFind(b,c);case 135368713:return this.evaluateUserFunction(b,a.value,c,a.intValue,269484241==a.tok);
case 1288701960:case 1826248715:return this.evaluateLabel(b,a.intValue,c);case 1276121098:return this.evaluateGetProperty(b,c,269484241==a.tok);case 137363468:return this.evaluateHelix(b,c);case 135267841:case 135266319:case 135267842:return this.evaluatePlane(b,c,d);case 135287308:case 135271429:return this.evaluateScript(b,c,d);case 1276117506:case 1276117510:case 1276117512:return this.evaluateString(b,a.intValue,c);case 135266320:return this.evaluatePoint(b,c);case 135304707:return this.evaluatePrompt(b,
c);case 135267332:return this.evaluateRandom(b,c);case 1276118019:return this.evaluateReplace(b,c);case 135267335:case 135267336:case 1238369286:return this.evaluateSubstructure(b,c,d);case 135270423:return this.evaluateCache(b,c);case 1276121113:return this.evaluateModulation(b,c);case 1276117011:case 1276117012:return this.evaluateSort(b,c,d);case 1297090050:return this.evaluateSymop(b,c,269484241==a.tok);case 1276117016:return this.evaluateTensor(b,c);case 135266325:return this.evaluateWithin(b,
c);case 135402505:return this.evaluateContact(b,c);case 135270422:return this.evaluateWrite(b,c)}return!1},"J.script.ScriptMathProcessor,J.script.T,~A,~N");k(c$,"evaluateModulation",function(b,a){var c="D",d=NaN,e=null,f=-1;switch(a.length){case 0:break;case 1:f=0;break;case 2:c=J.script.SV.sValue(a[0]).toUpperCase();d=J.script.SV.fValue(a[1]);break;default:return!1}0<=f&&(8==a[f].tok?e=a[f].value:d=J.script.SV.fValue(a[f]));null==e&&1E6>d&&(e=JU.P3.new3(d,d,d));d=J.script.SV.getBitSet(b.getX(),!1);
return b.addXList(this.viewer.getModulationList(d,c,e))},"J.script.ScriptMathProcessor,~A");k(c$,"evaluateTensor",function(b,a){if(2<a.length)return!1;var c=J.script.SV.getBitSet(b.getX(),!1),d=0==a.length?null:J.script.SV.sValue(a[0]).toLowerCase(),e=this.viewer.getNMRCalculation();if("unique".equals(d))return b.addXBs(e.getUniqueTensorSet(c));var f=2>a.length?null:J.script.SV.sValue(a[1]).toLowerCase();return b.addXList(e.getTensorInfo(d,f,c))},"J.script.ScriptMathProcessor,~A");k(c$,"evaluateCache",
function(b,a){return 0<a.length?!1:b.addXMap(this.viewer.cacheList())},"J.script.ScriptMathProcessor,~A");k(c$,"evaluateCompare",function(b,a){if(2>a.length||5<a.length)return!1;var c;c=J.script.SV.sValue(a[a.length-1]);var d=c.equalsIgnoreCase("stddev"),e=c.equalsIgnoreCase("ISOMER"),f=c.equalsIgnoreCase("BONDS"),g=!e&&a.length>(d?3:2),h=10==a[0].tok?a[0].value:null,j=10==a[1].tok?a[1].value:null,m=null==h?J.script.SV.sValue(a[0]):"",k=null==j?J.script.SV.sValue(a[1]):"",n=new JU.M4;c=NaN;if(g&&
(null==h||null==j))return!1;if(f){if(4!=a.length)return!1;m=J.script.SV.sValue(a[2]);(g=m.equalsIgnoreCase("SMILES"))&&(m=this.viewer.getSmiles(0,0,h,!1,!1,!1,!1));j=this.getFlexFitList(h,j,m,!g);return null==j?b.addXStr(""):b.addXAF(j)}if(e){if(3!=a.length)return!1;if(null==h&&null==j)return b.addXStr(this.viewer.getSmilesMatcher().getRelationship(m,k).toUpperCase());d=null==h?this.viewer.getSmilesMatcher().getMolecularFormula(m,!1):J.util.JmolMolecule.getMolecularFormula(this.viewer.getModelSet().atoms,
h,!1);g=null==j?this.viewer.getSmilesMatcher().getMolecularFormula(k,!1):J.util.JmolMolecule.getMolecularFormula(this.viewer.getModelSet().atoms,j,!1);if(!d.equals(g))return b.addXStr("NONE");null!=h&&(m=this.getSmilesMatches("",null,h,null,!1,!0));d=null==j?0<this.viewer.getSmilesMatcher().areEqual(k,m):0<=this.getSmilesMatches(m,null,j,null,!1,!0).nextSetBit(0);if(!d){h=m+k;if(0<=h.indexOf("/")||0<=h.indexOf("\\")||0<=h.indexOf("@")){if(0<=m.indexOf("@")&&(null!=j||0<=k.indexOf("@")))if(m=this.viewer.getSmilesMatcher().reverseChirality(m),
d=null==j?0<this.viewer.getSmilesMatcher().areEqual(m,k):0<=this.getSmilesMatches(m,null,j,null,!1,!0).nextSetBit(0))return b.addXStr("ENANTIOMERS");null==j?d=0<this.viewer.getSmilesMatcher().areEqual("/nostereo/"+k,m):(j=this.getSmilesMatches("/nostereo/"+m,null,j,null,!1,!0),d=0<=j.nextSetBit(0));if(d)return b.addXStr("DIASTERIOMERS")}return b.addXStr("CONSTITUTIONAL ISOMERS")}if(null==h||null==j)return b.addXStr("IDENTICAL");c=this.getSmilesCorrelation(h,j,m,null,null,null,null,!1,!1,null,null);
return b.addXStr(0.2>c?"IDENTICAL":"IDENTICAL or CONFORMATIONAL ISOMERS (RMSD="+c+")")}if(g){m=new JU.List;k=new JU.List;c=J.script.SV.sValue(a[2]);e=c.equalsIgnoreCase("MAP");g=c.equalsIgnoreCase("SMILES");f=e||c.equalsIgnoreCase("SMARTS");if(g||f)c=3<a.length?J.script.SV.sValue(a[3]):null;if(null==c)return!1;c=this.getSmilesCorrelation(h,j,c,m,k,n,null,!g,e,null,null);if(e){h=m.size();if(0==h)return b.addXStr("");d=ia(k.size()/h);j=new JU.List;for(n=g=0;g<d;g++){c=JU.AU.newInt2(h);j.addLast(c);
for(e=0;e<h;e++,n++)c[e]=[m.get(e).index,k.get(n).index]}return b.addXList(j)}}else m=this.eval.getPointVector(a[0],0),k=this.eval.getPointVector(a[1],0),null!=m&&null!=k&&(c=J.util.Measure.getTransformMatrix4(m,k,n,null));return d||Float.isNaN(c)?b.addXFloat(c):b.addXM4(n)},"J.script.ScriptMathProcessor,~A");k(c$,"evaluateContact",function(b,a){if(1>a.length||3<a.length)return!1;var c=0,d=100;switch(a[0].tok){case 3:case 2:d=J.script.SV.fValue(a[c++]);break;case 10:break;default:return!1}if(c==a.length||
!H(a[c].value,JU.BS))return!1;var e=J.util.BSUtil.copy(J.script.SV.bsSelectVar(a[c++]));if(this.chk)return b.addXBs(new JU.BS);c=c<a.length?J.util.BSUtil.copy(J.script.SV.bsSelectVar(a[c])):null;d=new J.atomdata.RadiusData(null,10<d?d/100:d,10<d?J.atomdata.RadiusData.EnumType.FACTOR:J.atomdata.RadiusData.EnumType.OFFSET,J.constant.EnumVdw.AUTO);c=this.setContactBitSets(e,c,!0,NaN,d,!1);c.or(e);return b.addXBs(c)},"J.script.ScriptMathProcessor,~A");k(c$,"evaluateSort",function(b,a,c){if(1<a.length)return!1;
if(1276117011==c){var d=0==a.length?0:a[0].asInt();return b.addXVar(b.getX().sortOrReverse(d))}c=b.getX();a=0==a.length?null:a[0];if(4==c.tok){var d=0,e=J.script.SV.sValue(c);if(null==a)return b.addXInt(0);a=J.script.SV.sValue(a);for(c=0;c<e.length;c++){c=e.indexOf(a,c);if(0>c)break;d++}return b.addXInt(d)}var d=new JU.List,f=e=null,g=J.script.SV.getVariable(c.value).sortOrReverse(0).getList();if(null==g)return null==a?b.addXStr(""):b.addXInt(0);c=0;for(var h=g.size();c<=h;c++){var j=c==h?null:g.get(c);
if(!(null!=a&&null!=j&&!J.script.SV.areEqual(j,a)))if(J.script.SV.areEqual(j,e))f.intValue++;else{if(null!=e){var m=new JU.List;m.addLast(e);m.addLast(f);d.addLast(J.script.SV.getVariableList(m))}f=J.script.SV.newI(1);e=j}}return null==a?b.addXVar(J.script.SV.getVariableList(d)):d.isEmpty()?b.addXInt(0):b.addXVar(d.get(0).getList().get(1))},"J.script.ScriptMathProcessor,~A,~N");k(c$,"evaluateSymop",function(b,a,c){if(0==a.length)return!1;c=c?b.getX():null;if(null!=c&&10!=c.tok)return!1;c=null!=c?
c.value:2<a.length&&10==a[1].tok?a[1].value:this.viewer.getAllAtoms();var d;switch(a[0].tok){case 4:d=J.script.SV.sValue(a[0]);break;case 12:d=a[0].escape();break;default:d=null}var e=null==d?a[0].asInt():0,f=1<a.length?b.ptValue(a[1],!0):null;if(2==a.length&&!Float.isNaN(f.x))return b.addXObj(this.viewer.getSymmetryInfo(c,d,e,f,null,null,135266320));var g=(1==a.length?"":J.script.SV.sValue(a[a.length-1])).toLowerCase(),h=135176;1==a.length||g.equalsIgnoreCase("matrix")?h=12:g.equalsIgnoreCase("array")||
g.equalsIgnoreCase("list")?h=1073742001:g.equalsIgnoreCase("description")?h=1826248715:g.equalsIgnoreCase("xyz")?h=1073741982:g.equalsIgnoreCase("translation")?h=1073742178:g.equalsIgnoreCase("axis")?h=1073741854:g.equalsIgnoreCase("plane")?h=135266319:g.equalsIgnoreCase("angle")?h=135266305:g.equalsIgnoreCase("axispoint")?h=135266320:g.equalsIgnoreCase("center")&&(h=12289);return b.addXObj(this.viewer.getSymmetryInfo(c,d,e,f,null,g,h))},"J.script.ScriptMathProcessor,~A,~B");k(c$,"evaluateBin",function(b,
a){if(3!=a.length)return!1;var c=b.getX(),d=13==c.tok;if(!d&&7!=c.tok)return b.addXVar(c);var e=J.script.SV.fValue(a[0]),f=J.script.SV.fValue(a[1]),g=J.script.SV.fValue(a[2]);if(d)c=c.value;else for(var h=c.getList(),c=E(h.size(),0),d=h.size();0<=--d;)c[d]=J.script.SV.fValue(h.get(d));for(var f=ia(Math.floor((f-e)/g+0.01)),h=Q(f,0),j=c.length,d=0;d<j;d++){var m=ia(Math.floor((c[d]-e)/g));0>m?m=0:m>=f&&(m=f-1);h[m]++}return b.addXAI(h)},"J.script.ScriptMathProcessor,~A");k(c$,"evaluateHelix",function(b,
a){if(1>a.length||5<a.length)return!1;var c=2<a.length?3:1,d=c>=a.length?"array":J.script.SV.sValue(a[c]),c=J.script.T.getTokFromName(d);if(2<a.length){var e=b.ptValue(a[0],!0),f=b.ptValue(a[1],!0);if(9!=a[2].tok)return!1;var g=J.util.Quaternion.newP4(a[2].value);switch(c){case 0:break;case 135266320:case 1073741854:case 1666189314:case 135266305:case 1746538509:return b.addXObj(J.util.Measure.computeHelicalAxis(null,c,e,f,g));case 135266306:c=J.util.Measure.computeHelicalAxis(null,1073742001,e,f,
g);if(null==c)break;return b.addXAS(c);default:return b.addXObj(J.util.Measure.computeHelicalAxis(d,135176,e,f,g))}}else switch(d=H(a[0].value,JU.BS)?a[0].value:this.eval.compareInt(1095761939,269484436,a[0].asInt()),c){case 135266320:return b.addXObj(this.viewer.getHelixData(d,135266320));case 1073741854:return b.addXObj(this.viewer.getHelixData(d,1073741854));case 1666189314:return b.addXObj(this.viewer.getHelixData(d,1666189314));case 135266305:return b.addXFloat(this.viewer.getHelixData(d,135266305).floatValue());
case 135176:case 1746538509:return b.addXObj(this.viewer.getHelixData(d,c));case 135266306:c=this.viewer.getHelixData(d,1073742001);if(null==c)break;return b.addXAS(c)}return!1},"J.script.ScriptMathProcessor,~A");k(c$,"evaluateDot",function(b,a,c,d){switch(a.length){case 1:if(1276117505==c)return!1;case 2:break;default:return!1}var e=b.getX(),f=a[0],g=7==f.tok?null:b.ptValue(f,!1),h=b.planeValue(f);if(1276118018==c){var j=d&480,m=32==j||64==j,k=480==j;switch(e.tok){case 10:var n=J.script.SV.bsSelectVar(e),
p=null;a=m&&2==a.length&&a[1].asBoolean();switch(f.tok){case 10:p=10==f.tok?J.script.SV.bsSelectVar(f):null;case 8:c=this.viewer.modelSet.atoms;if(a){k=NaN;f=2147483647;for(m=n.nextSetBit(0);0<=m;m=n.nextSetBit(m+1))if(a=null==p?c[m].distanceSquared(g):this.eval.getBitsetProperty(p,d,c[m],h,e.value,null,!1,e.index,!1).floatValue(),!(32==j?a>=k:a<=k))k=a,f=m;return b.addXBs(2147483647==f?new JU.BS:J.util.BSUtil.newAndSetBit(f))}if(k){if(null==p){k=E(n.cardinality(),0);j=0;for(m=n.nextSetBit(0);0<=
m;m=n.nextSetBit(m+1),j++)k[j]=c[m].distance(g);return b.addXAF(k)}d=E(n.cardinality(),p.cardinality(),0);j=0;for(m=n.nextSetBit(0);0<=m;m=n.nextSetBit(m+1),j++){e=0;for(g=p.nextSetBit(0);0<=g;g=p.nextSetBit(g+1),e++)d[j][e]=c[m].distance(c[g])}return b.addXAFF(d)}if(m){k=E(n.cardinality(),0);m=n.nextSetBit(0);for(j=0;0<=m;m=n.nextSetBit(m+1))k[j++]=this.eval.getBitsetProperty(p,d,c[m],h,e.value,null,!1,e.index,!1).floatValue();return b.addXAF(k)}return b.addXObj(this.eval.getBitsetProperty(n,d,g,
h,e.value,null,!1,e.index,!1))}}}return b.addXFloat(this.getDistance(b,e,f,c))},"J.script.ScriptMathProcessor,~A,~N,~N");k(c$,"getDistance",function(b,a,c,d){var e=b.ptValue(a,!0);a=b.planeValue(a);var f=b.ptValue(c,!0);b=b.planeValue(c);if(1276117505==d){if(null!=a&&null!=b)return a.x*b.x+a.y*b.y+a.z*b.z+a.w*b.w;null!=a&&(e=JU.P3.new3(a.x,a.y,a.z));null!=b&&(f=JU.P3.new3(b.x,b.y,b.z));return e.x*f.x+e.y*f.y+e.z*f.z}return null==a?null==b?f.distance(e):J.util.Measure.distanceToPlane(b,e):J.util.Measure.distanceToPlane(a,
f)},"J.script.ScriptMathProcessor,J.script.SV,J.script.SV,~N");k(c$,"evaluateMeasure",function(b,a,c){var d=0;switch(c){case 1746538509:c=new JU.List;for(var e=[3.4028235E38,3.4028235E38],f=null,g=null,h=!1,j=!1,m=0,k=!1,n=null,p=0,E=3.4028235E38,q=!1,A=!1,n=0;n<a.length;n++)switch(a[n].tok){case 10:var w=a[n].value;0==w.length()&&(k=!0);c.addLast(w);d++;p++;break;case 8:w=new J.util.Point3fi;w.setT(a[n].value);c.addLast(w);d++;break;case 2:case 3:e[m++%2]=J.script.SV.fValue(a[n]);break;case 4:w=
J.script.SV.sValue(a[n]);w.equalsIgnoreCase("vdw")||w.equalsIgnoreCase("vanderwaals")?E=(n+1<a.length&&2==a[n+1].tok?a[++n].asInt():100)/100:w.equalsIgnoreCase("notConnected")?j=!0:w.equalsIgnoreCase("connected")?h=!0:w.equalsIgnoreCase("minArray")?q=1<=p:w.equalsIgnoreCase("asArray")?A=1<=p:JU.PT.isOneOf(w.toLowerCase(),";nm;nanometers;pm;picometers;angstroms;ang;au;")||w.endsWith("hz")?g=w.toLowerCase():f=d+":"+w;break;default:return!1}if(2>d||4<d||2<m||j&&h)return!1;if(k||3.4028235E38!=E&&(2!=
p||2!=d))return b.addXStr("");n=3.4028235E38==E?new J.atomdata.RadiusData(e,0,null,null):new J.atomdata.RadiusData(null,E,J.atomdata.RadiusData.EnumType.FACTOR,J.constant.EnumVdw.AUTO);return b.addXObj(this.newMeasurementData(null,c).set(0,null,n,f,g,null,h,j,null,!0,0,0,null).getMeasurements(A,q));case 135266305:if(3!=(d=a.length)&&4!=d)return!1;break;default:if(2!=(d=a.length))return!1}c=Array(d);for(n=0;n<d;n++)c[n]=b.ptValue(a[n],!0);switch(d){case 2:return b.addXFloat(c[0].distance(c[1]));case 3:return b.addXFloat(J.util.Measure.computeAngleABC(c[0],
c[1],c[2],!0));case 4:return b.addXFloat(J.util.Measure.computeTorsion(c[0],c[1],c[2],c[3],!0))}return!1},"J.script.ScriptMathProcessor,~A,~N");k(c$,"newMeasurementData",function(b,a){return J.api.Interface.getOptionInterface("modelset.MeasurementData").init(b,this.viewer,a)},"~S,JU.List");k(c$,"evaluateUserFunction",function(b,a,c,d,e){var f=null;if(e&&(f=b.getX(),10!=f.tok))return!1;b.wasX=!1;for(var g=new JU.List,h=0;h<c.length;h++)g.addLast(c[h]);if(e)return b.addXObj(this.eval.getBitsetProperty(J.script.SV.bsSelectVar(f),
d,null,null,f.value,[a,g],!1,f.index,!1));a=this.eval.runFunctionRet(null,a,g,null,!0,!0,!1);return null==a?!1:b.addXVar(a)},"J.script.ScriptMathProcessor,~S,~A,~N,~B");k(c$,"evaluateFind",function(b,a){if(0==a.length)return!1;var c=b.getX(),d=J.script.SV.sValue(a[0]),e=1<a.length&&1048589!=a[1].tok&&1048588!=a[1].tok?J.script.SV.sValue(a[1]):"",f=d.equalsIgnoreCase("SEQUENCE"),g=d.equalsIgnoreCase("SMILES"),h=d.equalsIgnoreCase("SMARTS"),j=d.equalsIgnoreCase("MF");if(g||h||10==c.tok){var m=g||h?
2:1,m=m<a.length&&10==a[m].tok?a[m++].value:null,k="bonds".equalsIgnoreCase(J.script.SV.sValue(a[a.length-1])),n=k||1048589==a[a.length-1].tok,p=null;switch(c.tok){case 4:d=J.script.SV.sValue(c);if(null!=m)return!1;e.equalsIgnoreCase("mf")?(p=this.viewer.getSmilesMatcher().getMolecularFormula(d,h),null==p&&this.eval.evalError(this.viewer.getSmilesMatcher().getLastException(),null)):p=this.getSmilesMatches(e,d,null,null,h,!n);break;case 10:if(j)return b.addXStr(J.util.JmolMolecule.getMolecularFormula(this.viewer.getModelSet().atoms,
c.value,!1));if(f)return b.addXStr(this.viewer.getSmiles(-1,-1,c.value,!0,n,n,!1));if(g||h)d=e;k?(d=this.viewer.getSmilesMatcher().getCorrelationMaps(d,this.viewer.modelSet.atoms,this.viewer.getAtomCount(),c.value,!g,!0),p=0<d.length?this.viewer.getDihedralMap(d[0]):Q(0,0)):p=this.getSmilesMatches(d,null,c.value,m,!g,!n)}null==p&&this.eval.error(22);return b.addXObj(p)}h=0<=e.indexOf("v");j=0<=e.indexOf("i");e=0<=e.indexOf("m");f=7==c.tok;g=2==a.length;if(f||g){m=this.getPatternMatcher();g=null;try{g=
m.compile(d,j)}catch(E){if(aa(E,Exception))this.eval.evalError(E.toString(),null);else throw E;}c=J.script.SV.listValue(c);J.util.Logger.debugging&&J.util.Logger.debug("finding "+d);d=new JU.BS;j=k=0;p=null;m=e?new JU.List:null;for(n=0;n<c.length;n++){var q=c[n],p=g.matcher(q),A=p.find();if(e&&A||!e&&A==!h)j++,k=n,d.set(n),e&&m.addLast(h?q.substring(0,p.start())+q.substring(p.end()):p.group())}if(!f)return e?b.addXStr(1==m.size()?m.get(0):""):h?b.addXBool(1==j):e?b.addXStr(0==j?"":p.group()):b.addXInt(0==
j?0:p.start()+1);if(1==j)return b.addXStr(e?m.get(0):c[k]);h=Array(j);if(0<j)for(n=c.length;0<=--n;)d.get(n)&&(--j,h[j]=e?m.get(j):c[n]);return b.addXAS(h)}return b.addXInt(J.script.SV.sValue(c).indexOf(d)+1)},"J.script.ScriptMathProcessor,~A");k(c$,"getPatternMatcher",function(){return null==this.pm?this.pm=J.api.Interface.getOptionInterface("util.PatternMatcher"):this.pm});k(c$,"evaluateGetProperty",function(b,a,c){var d=0,e=a.length>d?J.script.SV.sValue(a[d++]).toLowerCase():"",f=!1;e.equals("json")&&
a.length>d&&(f=!0,e=J.script.SV.sValue(a[d++]));e.startsWith("$");c&&!e.equalsIgnoreCase("bondInfo")&&(e="atomInfo."+e);var g="";if(e.equalsIgnoreCase("fileContents")&&2<a.length){d=J.script.SV.sValue(a[1]);for(g=2;g<a.length;g++)d+="|"+J.script.SV.sValue(a[g]);g=d;d=a.length}else if(a.length>d)switch(a[d].tok){case 10:g=J.script.SV.bsSelectVar(a[d++]);e.equalsIgnoreCase("bondInfo")&&(a.length>d&&10==a[d].tok)&&(g=[g,J.script.SV.bsSelectVar(a[d])]);break;case 4:this.viewer.checkPropertyParameter(e)&&
(g=a[d++].value)}if(c){g=b.getX();if(10!=g.tok)return!1;g=J.script.SV.bsSelectVar(g).nextSetBit(0);if(0>g)return b.addXStr("");g=J.util.BSUtil.newAndSetBit(g)}g=this.viewer.getProperty(null,e,g);d<a.length&&(g=this.viewer.extractProperty(g,a,d));c&&H(g,JU.List)&&(g=0<g.size()?g.get(0):"");return b.addXObj(f?JU.PT.toJSON(null,g):J.script.SV.isVariableType(g)?g:J.util.Escape.toReadable(e,g))},"J.script.ScriptMathProcessor,~A,~B");k(c$,"evaluatePlane",function(b,a,c){if(135267841==c&&3!=a.length||135267842==
c&&2!=a.length&&3!=a.length||0==a.length||4<a.length)return!1;var d,e,f,g,h;switch(a.length){case 1:if(10==a[0].tok&&(c=J.script.SV.getBitSet(a[0],!1),3==c.cardinality())){a=this.viewer.getAtomPointVector(c);c=new JU.V3;h=new JU.V3;var j=new JU.V3;g=new JU.P4;J.util.Measure.getPlaneThroughPoints(a.get(0),a.get(1),a.get(2),c,h,j,g);return b.addXPt4(g)}a=J.util.Escape.uP(J.script.SV.sValue(a[0]));return H(a,JU.P4)?b.addXPt4(a):b.addXStr(""+a);case 2:if(135267842==c){if(9!=a[1].tok)return!1;f=new JU.P3;
c=new JU.V3;h=new JU.V3;g=a[1].value;if(9==a[0].tok)return a=J.util.Measure.getIntersectionPP(a[0].value,g),null==a?b.addXStr(""):b.addXList(a);e=b.ptValue(a[0],!1);return null==e?b.addXStr(""):b.addXPt(J.util.Measure.getIntersection(e,null,g,f,c,h))}case 3:case 4:switch(c){case 135267841:return b.addXPt4(this.eval.getHklPlane(JU.P3.new3(J.script.SV.fValue(a[0]),J.script.SV.fValue(a[1]),J.script.SV.fValue(a[2]))));case 135267842:d=b.ptValue(a[0],!1);e=b.ptValue(a[1],!1);if(null==d||null==e)return b.addXStr("");
e=JU.V3.newV(e);e.normalize();if(9==a[2].tok)return f=new JU.P3,c=new JU.V3,h=new JU.V3,d=J.util.Measure.getIntersection(d,e,a[2].value,f,c,h),null==d?b.addXStr(""):b.addXPt(d);f=b.ptValue(a[2],!1);if(null==f)return b.addXStr("");a=new JU.V3;J.util.Measure.projectOntoAxis(f,d,e,a);return b.addXPt(f)}switch(a[0].tok){case 2:case 3:if(3==a.length)return d=J.script.SV.fValue(a[0]),f=J.script.SV.fValue(a[1]),a=J.script.SV.fValue(a[2]),c=JU.V3.new3(0,0,1),e=JU.P3.new3(0,1,0),a=J.util.Quaternion.newVA(e,
a),a.getMatrix().transform(c),e.set(0,0,1),a=J.util.Quaternion.newVA(e,f),a.getMatrix().transform(c),e.setT(c),e.scale(d),g=new JU.P4,J.util.Measure.getPlaneThroughPoint(e,c,g),b.addXPt4(g);break;case 10:case 8:d=b.ptValue(a[0],!1);e=b.ptValue(a[1],!1);if(null==e)return!1;f=2<a.length&&(10==a[2].tok||8==a[2].tok)?b.ptValue(a[2],!1):null;c=JU.V3.newV(e);if(null==f)return g=new JU.P4,2==a.length||!a[2].asBoolean()?(f=JU.P3.newP(d),f.add(e),f.scale(0.5),c.sub(d),c.normalize()):f=d,J.util.Measure.getPlaneThroughPoint(f,
c,g),b.addXPt4(g);h=new JU.V3;j=new JU.V3;a=J.util.Measure.getDirectedNormalThroughPoints(d,e,f,4==a.length?b.ptValue(a[3],!0):null,c,h,j);return b.addXPt4(JU.P4.new4(c.x,c.y,c.z,a))}}if(4!=a.length)return!1;c=J.script.SV.fValue(a[0]);e=J.script.SV.fValue(a[1]);d=J.script.SV.fValue(a[2]);a=J.script.SV.fValue(a[3]);return b.addXPt4(JU.P4.new4(c,e,d,a))},"J.script.ScriptMathProcessor,~A,~N");k(c$,"evaluatePoint",function(b,a){if(1!=a.length&&3!=a.length&&4!=a.length)return!1;switch(a.length){case 1:if(3==
a[0].tok||2==a[0].tok)return b.addXInt(a[0].asInt());var c=J.script.SV.sValue(a[0]);7==a[0].tok&&(c="{"+c+"}");c=J.util.Escape.uP(c);return H(c,JU.P3)?b.addXPt(c):b.addXStr(""+c);case 3:return b.addXPt(JU.P3.new3(a[0].asFloat(),a[1].asFloat(),a[2].asFloat()));case 4:return b.addXPt4(JU.P4.new4(a[0].asFloat(),a[1].asFloat(),a[2].asFloat(),a[3].asFloat()))}return!1},"J.script.ScriptMathProcessor,~A");k(c$,"evaluatePrompt",function(b,a){if(1!=a.length&&2!=a.length&&3!=a.length)return!1;var c=J.script.SV.sValue(a[0]),
d=1<a.length&&7==a[1].tok?J.script.SV.listValue(a[1]):null,e=null!=d||1==a.length||3==a.length&&a[2].asBoolean(),f=null!=d?null:2<=a.length?J.script.SV.sValue(a[1]):"OK",c=""+this.viewer.prompt(c,f,d,e);return e&&null!=d?b.addXInt(Integer.parseInt(c)+1):b.addXStr(c)},"J.script.ScriptMathProcessor,~A");k(c$,"evaluateReplace",function(b,a){if(2!=a.length)return!1;var c=b.getX(),d=J.script.SV.sValue(a[0]),e=J.script.SV.sValue(a[1]),f=7==c.tok?null:J.script.SV.sValue(c);if(null!=f)return b.addXStr(JU.PT.simpleReplace(f,
d,e));c=J.script.SV.listValue(c);for(f=c.length;0<=--f;)c[f]=JU.PT.simpleReplace(c[f],d,e);return b.addXAS(c)},"J.script.ScriptMathProcessor,~A");k(c$,"evaluateString",function(b,a,c){if(1<c.length)return!1;var d=b.getX();if(7==d.tok)return b.addXVar(d),this.evaluateList(b,a,c);var e=1276117510==a&&10==d.tok||1276117512==a&&7==d.tok?null:J.script.SV.sValue(d);c=1==c.length?J.script.SV.sValue(c[0]):1276117512==a?"":"\n";switch(a){case 1276117510:if(10==d.tok){d=J.script.SV.bsSelectVar(d);c="\n";var f=
this.viewer.getModelCount(),e="";for(a=0;a<f;a++){var e=e+(0==a?"":"\n"),g=this.viewer.getModelUndeletedAtomsBitSet(a);g.and(d);e+=J.util.Escape.eBS(g)}}return b.addXAS(JU.PT.split(e,c));case 1276117506:return 0<e.length&&"\n"==e.charAt(e.length-1)&&(e=e.substring(0,e.length-1)),b.addXStr(JU.PT.simpleReplace(e,"\n",c));case 1276117512:if(null!=e)return b.addXStr(JU.PT.trim(e,c));e=J.script.SV.listValue(d);for(a=e.length;0<=--a;)e[a]=JU.PT.trim(e[a],c);return b.addXAS(e)}return b.addXStr("")},"J.script.ScriptMathProcessor,~N,~A");
k(c$,"evaluateList",function(b,a,c){var d=c.length,e=b.getX(),f;switch(a){case 1276383749:return 1==d&&b.addXVar(e.pushPop(c[0]));case 1276383249:return 0==d&&b.addXVar(e.pushPop(null));case 1276118017:if(1!=d&&2!=d)return!1;break;default:if(1!=d)return!1}var g=null,h=null;f=null;if(2==d){d=4==c[0].tok?0:1;a=J.script.SV.sValue(c[d]);g=7==e.tok?J.script.SV.listValue(e):JU.PT.split(J.script.SV.sValue(e),"\n");f=c[1-d];h=7==f.tok?J.script.SV.listValue(f):JU.PT.split(J.script.SV.sValue(f),"\n");f=Array(d=
Math.max(g.length,h.length));for(c=0;c<d;c++)f[c]=(c>=g.length?"":g[c])+a+(c>=h.length?"":h[c]);return b.addXAS(f)}f=0==d?J.script.SV.newV(1048579,"all"):c[0];c=1048579==f.tok;if(7!=e.tok&&4!=e.tok)return b.binaryOp(this.opTokenFor(a),e,f);var j=J.script.SV.isScalar(e),m=J.script.SV.isScalar(f),k=null,n=null,p=e.getList(),H=f.getList();7==e.tok?d=p.size():j?d=2147483647:(g=JU.PT.split(J.script.SV.sValue(e),"\n"),k=E(d=g.length,0),JU.PT.parseFloatArrayData(g,k));if(c){g=0;if(7==e.tok)for(c=d;0<=--c;)g+=
J.script.SV.fValue(p.get(c));else if(!j)for(c=d;0<=--c;)g+=k[c];return b.addXFloat(g)}if(1276117506==a&&4==f.tok){g=new JU.SB;if(j)g.append(J.script.SV.sValue(e));else for(c=0;c<d;c++)g.appendO(0<c?f.value:null).append(J.script.SV.sValue(p.get(c)));return b.addXStr(g.toString())}var q=null;m?q=f:7==f.tok?d=Math.min(d,H.size()):(h=JU.PT.split(J.script.SV.sValue(f),"\n"),n=E(h.length,0),JU.PT.parseFloatArrayData(h,n),d=Math.min(d,n.length));var A=this.opTokenFor(a),w=Array(d),s=j?e:null,v;for(c=0;c<
d;c++){v=m?q:7==f.tok?H.get(c):Float.isNaN(n[c])?J.script.SV.getVariable(J.script.SV.unescapePointOrBitsetAsVariable(h[c])):J.script.SV.newV(3,Float.$valueOf(n[c]));j||(s=7==e.tok?p.get(c):Float.isNaN(k[c])?J.script.SV.getVariable(J.script.SV.unescapePointOrBitsetAsVariable(g[c])):J.script.SV.newV(3,Float.$valueOf(k[c])));if(1276117506==a&&7!=s.tok){var t=new JU.List;t.addLast(s);s=J.script.SV.getVariableList(t)}if(!b.binaryOp(A,s,v))return!1;w[c]=b.getX()}return b.addXAV(w)},"J.script.ScriptMathProcessor,~N,~A");
k(c$,"opTokenFor",function(b){switch(b){case 1276118017:case 1276117506:return J.script.T.tokenPlus;case 1276117511:return J.script.T.tokenMinus;case 1276117507:return J.script.T.tokenTimes;case 1276117508:return J.script.T.tokenMul3;case 1276117504:return J.script.T.tokenDivide}return null},"~N");k(c$,"evaluateRowCol",function(b,a,c){if(1!=a.length)return!1;a=a[0].asInt()-1;var d=b.getX();switch(d.tok){case 11:if(0>a||2<a)break;d=d.value;switch(c){case 1276117515:return c=E(3,0),d.getRow(a,c),b.addXAF(c);
default:return c=E(3,0),d.getColumn(a,c),b.addXAF(c)}case 12:if(0>a||2<a)break;d=d.value;switch(c){case 1276117515:return c=E(4,0),d.getRow(a,c),b.addXAF(c);default:return c=E(4,0),d.getColumn(a,c),b.addXAF(c)}}return!1},"J.script.ScriptMathProcessor,~A,~N");k(c$,"evaluateArray",function(b,a,c){var d=a.length;if(c&&(4==d||3==d)){var e=!0;for(c=0;c<d&&e;c++)e=7==a[c].tok&&a[c].getList().size()==d;if(e){var f=E(d*d,0),g=0;for(c=0;c<d&&e;c++)for(var h=a[c].getList(),j=0;j<d;j++){var k=J.script.SV.fValue(h.get(j));
if(Float.isNaN(k)){e=!1;break}f[g++]=k}if(e)return 3==d?b.addXM3(JU.M3.newA(f)):b.addXM4(JU.M4.newA(f))}}d=Array(a.length);for(c=d.length;0<=--c;)d[c]=J.script.SV.newT(a[c]);return b.addXAV(d)},"J.script.ScriptMathProcessor,~A,~B");k(c$,"evaluateMath",function(b,a,c){if(135266318==c)return 1==a.length&&4==a[0].tok?b.addXStr(new java.util.Date+"\t"+J.script.SV.sValue(a[0])):b.addXInt((System.currentTimeMillis()&2147483647)-(0==a.length?0:a[0].asInt()));if(1!=a.length)return!1;if(135266826==c)return 2==
a[0].tok?b.addXInt(Math.abs(a[0].asInt())):b.addXFloat(Math.abs(a[0].asFloat()));a=J.script.SV.fValue(a[0]);switch(c){case 135266819:return b.addXFloat(180*Math.acos(a)/3.141592653589793);case 135266821:return b.addXFloat(Math.cos(3.141592653589793*a/180));case 135266820:return b.addXFloat(Math.sin(3.141592653589793*a/180));case 135266822:return b.addXFloat(Math.sqrt(a))}return!1},"J.script.ScriptMathProcessor,~A,~N");k(c$,"evaluateQuaternion",function(b,a,c){var d=null,e=a.length,f=2147483647,g=
!1;135270418==c&&(1<e&&(4==a[e-1].tok&&a[e-1].value.equalsIgnoreCase("relative"))&&(e--,g=!0),1<e&&(2==a[e-1].tok&&10==a[0].tok)&&(f=a[e-1].asInt(),0>=f&&(f=2147483646),e--));switch(e){case 0:case 1:case 4:break;case 2:if(135270418==c){if(7==a[0].tok&&(7==a[1].tok||1048589==a[1].tok))break;if(10==a[0].tok&&(2==a[1].tok||10==a[1].tok))break}if(null==(d=b.ptValue(a[0],!1))||135270418!=c&&8==a[1].tok)return!1;break;case 3:if(135270418!=c)return!1;if(9==a[0].tok){if(8!=a[2].tok&&10!=a[2].tok)return!1;
break}for(var h=0;3>h;h++)if(8!=a[h].tok&&10!=a[h].tok)return!1;break;default:return!1}var j=h=null,k=null;switch(e){case 0:return b.addXPt4(J.util.Quaternion.newQ(this.viewer.getRotationQuaternion()).toPoint4f());default:if(135270418==c&&7==a[0].tok){c=this.getQuaternionArray(a[0].getList(),1073742001);a=J.util.Quaternion.sphereMean(c,null,1E-4);h=H(a,J.util.Quaternion)?a:null;break}else if(135270418==c&&10==a[0].tok)j=this.viewer.getAtomGroupQuaternions(a[0].value,f);else if(11==a[0].tok)h=J.util.Quaternion.newM(a[0].value);
else if(9==a[0].tok)k=a[0].value;else if(k=J.script.SV.sValue(a[0]),k=J.util.Escape.uP(k.equalsIgnoreCase("best")?this.viewer.getOrientationText(1073741863,null):k),!H(k,JU.P4))return!1;135266307==c&&(h=J.util.Quaternion.newVA(JU.P3.new3(k.x,k.y,k.z),k.w));break;case 2:if(135270418==c){if(7==a[0].tok&&7==a[1].tok){c=this.getQuaternionArray(a[0].getList(),1073742001);j=this.getQuaternionArray(a[1].getList(),1073742001);j=J.util.Quaternion.div(j,c,f,g);break}if(7==a[0].tok&&1048589==a[1].tok)return c=
this.getQuaternionArray(a[0].getList(),1073742001),f=E(1,0),J.util.Quaternion.sphereMean(c,f,1E-4),b.addXFloat(f[0]);if(10==a[0].tok&&10==a[1].tok){c=this.viewer.getAtomGroupQuaternions(a[0].value,2147483647);j=this.viewer.getAtomGroupQuaternions(a[1].value,2147483647);j=J.util.Quaternion.div(j,c,f,g);break}}h=b.ptValue(a[1],!1);k=b.planeValue(a[0]);h=null!=h?J.util.Quaternion.getQuaternionFrame(JU.P3.new3(0,0,0),d,h):J.util.Quaternion.newVA(d,J.script.SV.fValue(a[1]));break;case 3:if(9==a[0].tok)return f=
8==a[2].tok?a[2].value:this.viewer.getAtomSetCenter(a[2].value),b.addXStr(J.util.Quaternion.newP4(a[0].value).draw("q",J.script.SV.sValue(a[1]),f,1));c=Array(3);for(h=0;3>h;h++)c[h]=8==a[h].tok?a[h].value:this.viewer.getAtomSetCenter(a[h].value);h=J.util.Quaternion.getQuaternionFrame(c[0],c[1],c[2]);break;case 4:135270418==c?k=JU.P4.new4(J.script.SV.fValue(a[1]),J.script.SV.fValue(a[2]),J.script.SV.fValue(a[3]),J.script.SV.fValue(a[0])):h=J.util.Quaternion.newVA(JU.P3.new3(J.script.SV.fValue(a[0]),
J.script.SV.fValue(a[1]),J.script.SV.fValue(a[2])),J.script.SV.fValue(a[3]))}if(null!=j){if(2147483647!=f){f=new JU.List;for(h=0;h<j.length;h++)f.addLast(j[h].toPoint4f());return b.addXList(f)}h=0<j.length?j[0]:null}return b.addXPt4((null==h?J.util.Quaternion.newP4(k):h).toPoint4f())},"J.script.ScriptMathProcessor,~A,~N");k(c$,"evaluateRandom",function(b,a){if(2<a.length)return!1;var c=2>a.length?0:J.script.SV.fValue(a[0]),d=0==a.length?1:J.script.SV.fValue(a[a.length-1]);return b.addXFloat(Math.random()*
(d-c)+c)},"J.script.ScriptMathProcessor,~A");k(c$,"evaluateCross",function(b,a){if(2!=a.length)return!1;var c=a[0],d=a[1];if(8!=c.tok||8!=d.tok)return!1;c=JU.V3.newV(c.value);d=JU.V3.newV(d.value);c.cross(c,d);return b.addXPt(JU.P3.newP(c))},"J.script.ScriptMathProcessor,~A");k(c$,"evaluateLoad",function(b,a,c){if(2<a.length||1>a.length)return!1;var d=J.script.SV.sValue(a[0]),d=d.$replace("\\","/");a=2==a.length?a[1].asInt():-1;if(this.viewer.isJS&&d.startsWith("?")){if(1229984263==c)return b.addXStr("");
d=this.eval.loadFileAsync("load()_",d,b.oPt,!0)}return b.addXStr(135271426==c?this.viewer.getFileAsString4(d,a,!1,!1,!0):this.viewer.getFilePath(d,!1))},"J.script.ScriptMathProcessor,~A,~N");k(c$,"evaluateWrite",function(b,a){return 0==a.length?!1:b.addXStr(this.write(a))},"J.script.ScriptMathProcessor,~A");k(c$,"evaluateScript",function(b,a,c){if(135287308==c&&1!=a.length||0==a.length||2<a.length)return!1;var d=J.script.SV.sValue(a[0]),e=new JU.SB;switch(c){case 135271429:a=2==a.length?J.script.SV.sValue(a[1]):
".";a.equals(".")||e.append(this.viewer.jsEval(a+"\u0001"+d));(a.equals(".")||a.equals("*"))&&this.eval.runScriptBuffer(d,e);break;case 135287308:e.append(this.viewer.jsEval(d))}var d=e.toString(),f;return Float.isNaN(f=JU.PT.parseFloatStrict(d))?b.addXStr(d):0<=d.indexOf(".")?b.addXFloat(f):b.addXInt(JU.PT.parseInt(d))},"J.script.ScriptMathProcessor,~A,~N");k(c$,"evaluateData",function(b,a){if(1!=a.length&&2!=a.length&&4!=a.length)return!1;var c=J.script.SV.sValue(a[0]),d=2==a.length?J.script.SV.sValue(a[1]):
"";if(4==a.length){var d=a[1].asInt(),e=a[2].asInt(),f=a[3].asInt(),c=J.util.Parser.parseFloatArrayFromMatchAndField(c,null,0,0,null,d,e,null,f);return b.addXStr(J.util.Escape.escapeFloatA(c,!1))}if(0==c.indexOf("data2d_"))return c=this.viewer.getDataFloat2D(c),null==c?b.addXStr(""):2==a.length&&2==a[1].tok?(d=a[1].intValue,0>d&&(d+=c.length),0<=d&&d<c.length?b.addXStr(J.util.Escape.escapeFloatA(c[d],!1)):b.addXStr("")):b.addXStr(J.util.Escape.escapeFloatAA(c,!1));if(0==c.indexOf("property_")){c=
this.viewer.getDataFloat(c);if(null==c)return b.addXStr("");d=0==d.indexOf("property_")?this.viewer.getDataFloat(d):null;if(null!=d){c=JU.AU.arrayCopyF(c,-1);for(e=Math.min(c.length,d.length);0<=--e;)c[e]+=d[e]}return b.addXStr(J.util.Escape.escapeFloatA(c,!1))}return 1==a.length?(c=this.viewer.getData(c),b.addXStr(null==c?"":""+c[1])):b.addXStr(this.viewer.getData(c,d))},"J.script.ScriptMathProcessor,~A");k(c$,"evaluateLabel",function(b,a,c){var d=2>c.length?b.getX():null,e=0==c.length?"%U":J.script.SV.sValue(c[0]);
a=J.script.T.tokAttr(a,480);if(null==d)return b.addXStr(J.script.SV.sprintfArray(c));c=J.script.SV.getBitSet(d,!0);return null==c?b.addXObj(J.script.SV.sprintf(J.util.Txt.formatCheck(e),d)):b.addXObj(this.getBitsetIdent(c,e,d.value,!0,d.index,a))},"J.script.ScriptMathProcessor,~N,~A");k(c$,"evaluateWithin",function(b,a){if(1>a.length||5<a.length)return!1;var c=a.length,d=0,e=a[0].value,f=""+e,g=a[0].tok;4==g&&(g=J.script.T.getTokFromName(f));var h=1649412120==g;h&&(d=100,e=null);var j=!1,k=!1,u=h||
3==g||2==g,n=null;switch(g){case 1048580:return 3!=c||!H(a[1].value,JU.BS)||!H(a[2].value,JU.BS)?!1:b.addXBs(this.viewer.getBranchBitSet(a[2].value.nextSetBit(0),a[1].value.nextSetBit(0),!0));case 135267336:case 1238369286:case 135267335:d=null;f=!0;switch(c){case 2:break;case 3:if(f=10==a[2].tok)d=a[2].value;break;default:f=!1}f||this.eval.error(22);return b.addXObj(this.getSmilesMatches(J.script.SV.sValue(a[1]),null,d,null,135267335==g,b.asBitSet))}if(H(e,String)){if(0==g){g=1048614;if(2<c)return!1;
c=2}}else if(u){h||(d=J.script.SV.fValue(a[0]));if(2>c)return!1;switch(g=a[1].tok){case 1048589:case 1048588:j=a[1].asBoolean();c=0;break;case 4:g=J.script.SV.sValue(a[1]);if(g.startsWith("$"))return b.addXBs(this.getAtomsNearSurface(d,g.substring(1)));k=g.equalsIgnoreCase("group");g=(h=g.equalsIgnoreCase("vanderwaals"))?1649412120:1087373318}}else return!1;var p=e=null;switch(c){case 1:switch(g){case 137363468:case 3145760:case 1679429641:return b.addXBs(this.viewer.getAtomBits(g,null));case 1073741864:return b.addXBs(this.viewer.getAtomBits(g,
""));case 1048614:return b.addXBs(this.viewer.getAtomBits(1087373320,f))}return!1;case 2:switch(g){case 1048614:g=1087373320;break;case 1087375362:case 1087375361:case 1073741864:case 1087373320:return b.addXBs(this.viewer.getAtomBits(g,J.script.SV.sValue(a[a.length-1])))}break;case 3:switch(g){case 1048589:case 1048588:case 1087373318:case 1649412120:case 135266319:case 135267841:case 1048582:break;case 1087373320:f=J.script.SV.sValue(a[2]);break;default:return!1}}c=a.length-1;H(a[c].value,JU.P4)?
p=a[c].value:H(a[c].value,JU.P3)&&(e=a[c].value,J.script.SV.sValue(a[1]).equalsIgnoreCase("hkl")&&(p=this.eval.getHklPlane(e)));if(0<c&&null==p&&null==e&&!H(a[c].value,JU.BS))return!1;if(null!=p)return b.addXBs(this.viewer.getAtomsNearPlane(d,p));if(null!=e)return b.addXBs(this.viewer.getAtomsNearPt(d,e));c=10==a[c].tok?J.script.SV.bsSelectVar(a[c]):null;if(1087373320==g)return b.addXBs(this.viewer.getSequenceBits(f,c));null==c&&(c=new JU.BS);if(!u)return b.addXBs(this.viewer.getAtomBits(g,c));if(k)return b.addXBs(this.viewer.getGroupsWithin(K(d),
c));h&&(n=new J.atomdata.RadiusData(null,10<d?d/100:d,10<d?J.atomdata.RadiusData.EnumType.FACTOR:J.atomdata.RadiusData.EnumType.OFFSET,J.constant.EnumVdw.AUTO));return b.addXBs(this.viewer.getAtomsWithinRadius(d,c,j,n))},"J.script.ScriptMathProcessor,~A");k(c$,"getAtomsNearSurface",function(b,a){var c=[a,null,null];if(this.chk)return new JU.BS;if(this.eval.getShapePropertyData(24,"getVertices",c))return this.viewer.getAtomsNearPts(b,c[1],c[2]);c[1]=Integer.$valueOf(0);c[2]=Integer.$valueOf(-1);return this.eval.getShapePropertyData(22,
"getCenter",c)?this.viewer.getAtomsNearPt(b,c[2]):new JU.BS},"~N,~S");k(c$,"evaluateColor",function(b,a){var c=0<a.length?J.script.SV.sValue(a[0]):"";if(c.equalsIgnoreCase("hsl")&&2==a.length){var d=JU.P3.newP(J.script.SV.ptValue(a[1])),e=E(3,0);J.util.ColorEncoder.RGBtoHSL(d.x,d.y,d.z,e);d.set(360*e[0],100*e[1],100*e[2]);return b.addXPt(d)}var f=c.startsWith("$"),g=f?null:this.viewer.getColorEncoder(c);if(!f&&null==g)return b.addXStr("");var d=1<a.length?J.script.SV.fValue(a[1]):3.4028235E38,h=2<
a.length?J.script.SV.fValue(a[2]):3.4028235E38,e=3<a.length?J.script.SV.fValue(a[3]):3.4028235E38,j=3.4028235E38!=e||3.4028235E38!=d&&3.4028235E38==h;3.4028235E38==h&&0==c.length&&(e=d,h=this.viewer.getCurrentColorRange(),d=h[0],h=h[1]);if(f){g=[c.substring(1),null];if(!this.viewer.getShapePropertyData(24,"colorEncoder",g))return b.addXStr("");g=g[1]}else g.setRange(d,h,d>h);c=g.getColorKey();return j?b.addXPt(JU.CU.colorPtFromInt2(g.getArgb(3.4028235E38==h?d:e))):b.addXVar(J.script.SV.getVariableMap(c))},
"J.script.ScriptMathProcessor,~A");k(c$,"evaluateConnected",function(b,a){if(5<a.length)return!1;for(var c=-2147483648,d=2147483647,e=0,f=3.4028235E38,g=65535,h=null,j=null,k=!1,u=!1,n=0;n<a.length;n++){var p=a[n];switch(p.tok){case 10:if((u=H(p.value,J.modelset.BondSet))&&null!=h)return!1;if(null==h)h=J.script.SV.bsSelectVar(p);else if(null==j)j=J.script.SV.bsSelectVar(p);else return!1;break;case 4:g=J.script.SV.sValue(p);g=g.equalsIgnoreCase("hbond")?30720:J.script.ScriptEvaluator.getBondOrderFromString(g);
if(131071==g)return!1;break;case 3:k=!0;default:var E=p.asInt(),p=p.asFloat();if(2147483647!=d)return!1;-2147483648==c?(c=Math.max(E,0),e=p):(d=E,f=p)}}-2147483648==c?(c=1,d=100,e=0.1,f=1E8):2147483647==d&&(d=c,f=e,e=0.1);null==h&&(h=this.viewer.getAllAtoms());k&&null==j&&(j=h);return null!=j?(c=new JU.BS,this.viewer.makeConnections(e,f,g,1087373321,h,j,c,u,!1,0),b.addXVar(J.script.SV.newV(10,new J.modelset.BondSet(c,this.viewer.getAtomIndices(this.viewer.getAtomBits(1678770178,c)))))):b.addXBs(this.viewer.getAtomsConnected(c,
d,g,h))},"J.script.ScriptMathProcessor,~A");k(c$,"evaluateSubstructure",function(b,a,c){if(0==a.length)return!1;var d=new JU.BS,e=J.script.SV.sValue(a[0]);if(0<e.length)try{var f=2==a.length&&10==a[1].tok?J.script.SV.bsSelectVar(a[1]):null,d=this.viewer.getSmilesMatcher().getSubstructureSet(e,this.viewer.getModelSet().atoms,this.viewer.getAtomCount(),f,135267336!=c&&1238369286!=c,!1)}catch(g){if(aa(g,Exception))this.eval.evalError(g.toString(),null);else throw g;}return b.addXBs(d)},"J.script.ScriptMathProcessor,~A,~N");
k(c$,"getMinMaxPoint",function(b,a){var c=null,d=null,e=0;H(b,Array)?(c=b,e=c.length):H(b,JU.List)&&(d=b,e=d.size());if(null!=d||null!=c){for(var f=new JU.P3,g=E(e,0),h=!0,j=0;3>j&&h;j++){for(var k=0;k<e;k++){var u=null==c?J.script.SV.ptValue(d.get(k)):c[k];if(null==u){h=!1;break}switch(j){case 0:g[k]=u.x;break;case 1:g[k]=u.y;break;case 2:g[k]=u.z}}if(!h)break;k=this.getMinMax(g,a);if(H(k,Float))switch(k=k.floatValue(),j){case 0:f.x=k;break;case 1:f.y=k;break;case 2:f.z=k}else break}return f}return"NaN"},
"~O,~N");k(c$,"getMinMaxQuaternion",function(b,a){var c;switch(a){case 32:case 64:case 128:case 160:return"NaN"}for(;;){c=this.getQuaternionArray(b,1073742001);if(null==c)break;var d=E(1,0);c=J.util.Quaternion.sphereMean(c,d,1E-4);switch(a){case 96:return c;case 192:return Float.$valueOf(d[0])}break}return"NaN"},"JU.List,~N");k(c$,"getQuaternionArray",function(b,a){var c;switch(a){case 135270418:c=b;break;case 9:c=Array(b.length);for(var d=0;d<b.length;d++)c[d]=J.util.Quaternion.newP4(b[d]);break;
case 1073742001:c=Array(b.size());for(d=0;d<b.size();d++){var e=J.script.SV.pt4Value(b.get(d));if(null==e)return null;c[d]=J.util.Quaternion.newP4(e)}break;default:return null}return c},"~O,~N");W(c$,"getMinMax",function(b,a){for(var c=null,d=null,e=0;;){if(JU.PT.isAF(b)){if(c=b,e=c.length,0==e)break}else if(H(b,JU.List)){d=b;e=d.size();if(0==e)break;var f=d.get(0);if(4==f.tok&&f.value.startsWith("{")){c=J.script.SV.ptValue(f);if(H(c,JU.P3))return this.getMinMaxPoint(d,a);if(H(c,JU.P4))return this.getMinMaxQuaternion(d,
a);break}}else break;switch(a){case 32:f=3.4028235E38;break;case 64:f=-3.4028235E38;break;default:f=0}for(var g=0,h=0;0<=--e;){var j=null==c?J.script.SV.fValue(d.get(e)):c[e];if(!Float.isNaN(j))switch(h++,a){case 160:case 192:g+=j*j;case 128:case 96:f+=j;break;case 32:j<f&&(f=j);break;case 64:j>f&&(f=j)}}if(0==h)break;switch(a){case 96:f/=h;break;case 192:if(1==h)break;f=Math.sqrt((g-f*f/h)/(h-1));break;case 160:f=g}return Float.$valueOf(f)}return"NaN"},"~O,~N");k(c$,"capture",function(){if(!this.chk&&
!this.viewer.allowCapture())this.showString("Cannot capture on this platform");else{var b=this.viewer.getInt(553648132),a=10,c=0,d="",e=this.viewer.captureParams,f=!this.viewer.getAnimationReplayMode().name().equals("ONCE"),g=this.tokAt(1),h="";switch(g){case 0:c=1150985;break;case 4:d=this.eval.optParameterAsString(1);if(0==d.length){c=1150985;break}d.endsWith(".gif")||(d+=".gif");var g=null,c="y",j;switch(this.tokAt(2)){case 1073742129:f=!0;j=3;c=2==this.tokAt(3)?"y":this.eval.optParameterAsString(j++).toLowerCase();
g=0==this.tokAt(j)?5:this.intParameter(j++);g=JU.PT.simpleReplace("; rotate Y 10 10;delay 2.0; rotate Y -10 -10; delay 2.0;rotate Y -10 -10; delay 2.0;rotate Y 10 10;delay 2.0","10",""+g);break;case 1611141175:f=!0;j=3;c=this.eval.optParameterAsString(j).toLowerCase();0<c.length&&j++;g="; rotate Y 360 30;delay 15.0;";2==this.tokAt(j)&&(h=" "+(b=this.intParameter(j++)));break;case 3:a=this.floatParameter(2);break;case 2:b=this.intParameter(2)}if(null!=g){this.chk||this.viewer.setNavigationMode(!1);
if(""===c||0>"xyz".indexOf(c))c="y";g=JU.PT.simpleReplace(g,"Y",c);g="capture "+J.util.Escape.eS(d)+h+g+";capture;";this.eval.script(0,null,g);return}null!=e&&new java.util.Hashtable;c=1073742032;e=new java.util.Hashtable;f||this.showString(J.i18n.GT.o(J.i18n.GT._("Note: Enable looping using {0}"),["ANIMATION MODE LOOP"]));this.showString(J.i18n.GT.o(J.i18n.GT._("Animation delay based on: {0}"),["ANIMATION FPS "+b]));e.put("captureFps",Integer.$valueOf(b));break;case 1073741874:case 1048589:case 1048588:this.checkLength(2);
c=g;break;default:this.invArg()}this.chk||null==e||(e.put("type","GIF"),e.put("fileName",d),e.put("quality",Integer.$valueOf(-1)),e.put("endTime",Long.$valueOf(System.currentTimeMillis()+Clazz_floatToLong(1E3*a))),e.put("captureMode",Integer.$valueOf(c)),e.put("captureLooping",f?Boolean.TRUE:Boolean.FALSE),b=this.viewer.processWriteOrCapture(e),J.util.Logger.info(b))}});Eb(c$,"ERROR_invalidArgument",22)})})(Clazz,Clazz.newArray,Clazz.newBooleanArray,Clazz.newByteArray,Clazz.newCharArray,Clazz.newDoubleArray,
Clazz.newFloatArray,Clazz.newIntArray,Clazz.newLongArray,Clazz.newShortArray,Clazz.prepareCallback,Clazz.decorateAsClass,Clazz.isClassDefined,Clazz.defineEnumConstant,Clazz.cloneFinals,Clazz.inheritArgs,Clazz.pu$h,Clazz.declareInterface,Clazz.declarePackage,Clazz.makeConstructor,Clazz.overrideConstructor,Clazz.load,Clazz.defineMethod,Clazz.innerTypeInstance,Clazz.instanceOf,Clazz.p0p,Clazz.makeFunction,Clazz.superConstructor,Clazz.defineStatics,Clazz.registerSerializableFields,Clazz.declareType,Clazz.superCall,
Clazz.overrideMethod,Clazz.declareAnonymous,Clazz.checkPrivateMethod,Clazz.prepareFields,Clazz.instantialize,Clazz.doubleToInt,Clazz.declarePackage,Clazz.instanceOf,Clazz.load,Clazz.instantialize,Clazz.decorateAsClass,Clazz.floatToInt,Clazz.makeConstructor,Clazz.defineEnumConstant,Clazz.exceptionOf,Clazz.newIntArray,Clazz.defineStatics,Clazz.newFloatArray,Clazz.declareType,Clazz.prepareFields,Clazz.superConstructor,Clazz.newByteArray,Clazz.declareInterface,Clazz.p0p,Clazz.pu$h,Clazz.newShortArray,
Clazz.innerTypeInstance,Clazz.isClassDefined,Clazz.prepareCallback,Clazz.newArray,Clazz.castNullAs,Clazz.floatToShort,Clazz.superCall,Clazz.decorateAsType,Clazz.newBooleanArray,Clazz.newCharArray,Clazz.implementOf,Clazz.newDoubleArray,Clazz.overrideConstructor,Clazz.supportsNativeObject,Clazz.extendedObjectMethods,Clazz.callingStackTraces,Clazz.clone,Clazz.doubleToShort,Clazz.innerFunctions,Clazz.getInheritedLevel,Clazz.getParamsType,Clazz.isAF,Clazz.isAI,Clazz.isAS,Clazz.isASS,Clazz.isAP,Clazz.isAFloat,
Clazz.isAII,Clazz.isAFF,Clazz.isAFFF,Clazz.tryToSearchAndExecute,Clazz.getStackTrace,Clazz.inheritArgs);
