(function(ma,na,oa,pa,V,qa,Y,y,Z,ia,ja,$,ra,ka,sa,L,O,ta,C,la,ua,va,wa,xa,ya,za,Aa,Ba,Ca,Da,x,Ea,Fa,Ga,Ha,Ia,Ja,Ka,La,Ma,Na,Oa,Pa,Qa,Ra,Sa,Ta,Ua,Va,Wa,Xa,Ya,Za,$a,ab,bb,cb,db,m){Y("JS");Z(["java.lang.Float"],"JS.MathExt","java.lang.Number java.util.Date $.HashMap $.Hashtable $.Random JU.AU $.BArray $.BS $.CU $.Lst $.M3 $.M4 $.Measure $.OC $.P3 $.P4 $.PT $.Quat $.Rdr $.SB $.V3 J.api.Interface J.atomdata.RadiusData J.bspt.PointIterator J.c.VDW J.i18n.GT JM.BondSet $.Measurement JS.SV $.ScriptParam $.T JU.BSUtil $.BoxInfo $.Escape $.JmolMolecule $.Logger $.Parser $.Point3fi $.SimpleUnitCell JV.FileManager $.JC $.Viewer".split(" "),
function(){c$=ja(function(){this.pm=this.rand=this.e=this.vwr=null;ia(this,arguments)},JS,"MathExt");ka(c$,function(){});m(c$,"init",function(d){this.e=d;this.vwr=this.e.vwr;return this},"~O");m(c$,"evaluate",function(d,a,b,c){switch(c){case 134218760:return 1<=b.length&&4==b[0].tok?d.addXStr((1==b.length?(new java.util.Date).toString():this.vwr.apiPlatform.getDateFormat(JS.SV.sValue(b[1])))+"\t"+JS.SV.sValue(b[0]).trim()):d.addXInt(System.currentTimeMillis()-JS.MathExt.t0-(0==b.length?0:b[0].asInt()));
case 134218250:return 1==b.length&&2==b[0].tok?d.addXInt(b[0].intValue):d.addXFloat(Math.abs(b[0].asFloat()));case 134218242:case 134218245:case 134218244:case 134218246:return 1==b.length&&this.evaluateMath(d,b,c);case 1275069441:case 1275068928:case 1275068929:case 1275068930:case 1275068931:case 1275335685:case 1275334681:return this.evaluateList(d,a.intValue,b);case 268435520:0==b.length&&(d.wasX=!1);case 1275068418:return this.evaluateArray(d,b,1275068418==c&&268435665==a.tok);case 134217765:return d.addXObj(this.vwr.sm.getParameter(0==
b.length?-2147483648:b[0].intValue));case 134217731:case 134221850:return this.evaluateQuaternion(d,b,c);case 1275068420:return this.evaluateBin(d,b);case 134221829:return this.evaluateCache(d,b);case 1275068934:case 1275068935:return this.evaluateRowCol(d,b,c);case 1765808134:return this.evaluateColor(d,b);case 134221831:return this.evaluateCompare(d,b);case 1228931587:case 134217736:case 1275203608:return this.evaluateConnected(d,b,c,a.intValue);case 1814695966:return this.evaluateUnitCell(d,b,
268435665==a.tok);case 134353926:return this.evaluateContact(d,b);case 134221834:return this.evaluateData(d,b);case 1275069444:case 1275069442:return this.evaluateDotDist(d,b,c,a.intValue);case 1275069443:if(268435665==a.tok)return this.evaluateDotDist(d,b,c,a.intValue);case 134217729:case 1745489939:return this.evaluateMeasure(d,b,a.tok);case 1228935687:case 134222849:return this.evaluateLoad(d,b,1228935687==c);case 1275068427:return this.evaluateFind(d,b);case 1275068433:return this.evaluateInChI(d,
b);case 1287653388:case 1825200146:return this.evaluateFormat(d,a.intValue,b,1825200146==c);case 134320141:return this.evaluateUserFunction(d,a.value,b,a.intValue,268435665==a.tok);case 1275068437:c=1275068725;case 1275068446:case 1275068725:case 1275082245:case 1275072526:return this.evaluateGetProperty(d,b,c,268435665==a.tok);case 136314895:return this.evaluateHelix(d,b);case 134219777:case 134217750:case 134217763:return this.evaluatePlane(d,b,c);case 134218759:case 134238732:case 134222850:case 134222350:return this.evaluateScript(d,
b,c);case 1275069446:case 1275069447:case 1275068932:return this.evaluateString(d,a.intValue,b);case 134217751:return this.evaluatePoint(d,b);case 1275068447:return this.evaluatePointGroup(d,b,268435665==a.tok);case 134256131:return this.evaluatePrompt(d,b);case 134219268:return this.evaluateRandom(d,b);case 1275068432:return this.evaluateIn(d,b);case 1275072532:return this.evaluateModulation(d,b);case 1275068443:return this.evaluateReplace(d,b);case 134218756:case 134218757:case 1237320707:return this.evaluateSubstructure(d,
b,c,268435665==a.tok);case 1275068444:case 1275068425:return this.evaluateSort(d,b,c);case 134217764:return this.evaluateSpacegroup(d,b);case 1296041986:return this.evaluateSymop(d,b,268435665==a.tok);case 1275068445:return this.evaluateTensor(d,b);case 134217759:return this.evaluateWithin(d,b,268435665==a.tok);case 134221856:return this.evaluateWrite(d,b)}return!1},"JS.ScriptMathProcessor,JS.T,~A,~N");m(c$,"evaluateSpacegroup",function(d,a){var b=null;switch(a.length){case 0:return d.addXObj(this.vwr.getSymTemp().getSpaceGroupInfo(this.vwr.ms,
null,this.vwr.am.cmi,!0,null));case 2:if(b=JS.SV.flistValue(a[1],0),6!=b.length)return!1;case 1:var c=null,e=null;if(4==a[0].tok){if(e=a[0].asString(),0>e.indexOf("x")&&null==b)return d.addXObj(this.vwr.getSymTemp().getSpaceGroupInfoObj(e,null,!0,!1))}else if(null==(c=JS.SV.getBitSet(a[0],!0)))return d.addXObj(this.vwr.getSymTemp().getSpaceGroupInfoObj(""+a[0].asString(),b,!0,!1));return d.addXObj(this.vwr.findSpaceGroup(c,e,b,null==e,!1));default:return!1}},"JS.ScriptMathProcessor,~A");m(c$,"evaluatePointGroup",
function(d,a,b){var c=null,e=null,f=-1,h=-1,g=null,k=!1;switch(a.length){case 4:h=a[3].asFloat();case 3:f=a[2].asFloat();case 2:switch(a[1].tok){case 8:e=JS.SV.ptValue(a[1]);break;case 10:g=JS.SV.getBitSet(a[1],!1),a[0].asString().equalsIgnoreCase("spaceGroup")&&(k=!0,2==a.length&&(f=0))}if(k)break;case 1:switch(a[0].tok){case 7:b=a[0].getList();c=Array(b.size());for(a=c.length;0<=--a;)c[a]=JS.SV.ptValue(b.get(a));break;case 10:g=JS.SV.getBitSet(a[0],!1);c=this.vwr.ms.at;break;case 4:if(b){g=JS.SV.getBitSet(d.getX(),
!0);if(null==g||g.isEmpty())return!1;k=a[0].asString();if("spacegroup".equals(k)){k=!0;break}}default:return!1}break;case 0:if(!b)return d.addXObj(this.vwr.ms.getPointGroupInfo(null));g=JS.SV.getBitSet(d.getX(),!1);break;default:return!1}if(null!=g){a=g.nextSetBit(0);if(0>a||a>=this.vwr.ms.ac||k&&1!=g.cardinality())return!1;if(k){e=this.vwr.ms.generateCrystalClass(a,JU.P3.new3(NaN,NaN,NaN));c=Array(e.size());for(a=c.length;0<=--a;)c[a]=e.get(a);e=new JU.P3}}c=this.vwr.getSymTemp().setPointGroup(null,
e,null==c?this.vwr.ms.at:c,g,!1,0>f?this.vwr.getFloat(570425382):f,0>h?this.vwr.getFloat(570425384):h,null==g?c.length:g.cardinality(),!0);return d.addXMap(c.getPointGroupInfo(-1,null,!0,null,0,1))},"JS.ScriptMathProcessor,~A,~B");m(c$,"evaluateUnitCell",function(d,a,b){b=b?JS.SV.getBitSet(d.getX(),!0):null;var c=(null==b?this.vwr.getAllAtoms():b).nextSetBit(0),e=a.length-1;b=1;switch(0>e?0:a[e].tok){case 2:case 3:b=a[e].asFloat(),e--}var f=0>e?0:a[0].tok,h=null,g=null;switch(f){case 7:g=a[0].getList();
break;case 4:var k=a[0].asString();if(0==k.indexOf("a=")){for(var h=Array(4),j=0;4>j;j++)h[j]=new JU.P3;JU.SimpleUnitCell.setOabc(k,null,h)}else if(0<=k.indexOf(","))return d.addXObj(this.vwr.getV0abc(-1,k))}k=null;j=null!=g;if(null==h&&j&&4>g.size())return!1;var l=j?1:0;null==h&&(!j&&8!=f)&&(k=0>c?this.vwr.getCurrentUnitCell():this.vwr.ms.getUnitCell(this.vwr.ms.at[c].mi),h=null==k?x(-1,[JU.P3.new3(0,0,0),JU.P3.new3(1,0,0),JU.P3.new3(0,1,0),JU.P3.new3(0,0,1)]):k.getUnitCellVectors());if(null==h)if(h=
Array(4),j)switch(g.size()){case 3:h[0]=new JU.P3;for(j=0;3>j;j++)h[j+1]=JU.P3.newP(JS.SV.ptValue(g.get(j)));break;case 4:for(j=0;4>j;j++)h[j]=JU.P3.newP(JS.SV.ptValue(g.get(j)));break;case 6:f=C(6,0);for(j=0;6>j;j++)f[j]=g.get(j).asFloat();JU.SimpleUnitCell.setOabc(null,f,h);break;default:return!1}else switch(h[0]=JS.SV.ptValue(a[0]),e){case 3:for(j=1;4>j;j++)(h[j]=JU.P3.newP(JS.SV.ptValue(a[j]))).sub(h[0]);break;case 1:if(g=a[1].getList(),null!=g&&3==g.size()){for(j=0;3>j;j++)h[j+1]=JS.SV.ptValue(g.get(j));
break}default:return!1}j=l<=e?a[l].asString():null;if((g="primitive".equalsIgnoreCase(j))||"conventional".equalsIgnoreCase(j)){a=++l>e?"":a[l].asString().toUpperCase();a.equals("BCC")?a="I":0==a.length&&(a=this.vwr.getSymmetryInfo(c,null,0,null,null,null,1073741994,null,0,-1,0));if(null==a||0==a.length)return!1;null==k&&(k=this.vwr.getSymTemp());c=this.vwr.getModelForAtomIndex(c).auxiliaryInfo.get("primitiveToCrystal");if(!k.toFromPrimitive(g,a.charAt(0),h,c))return!1}else if("reciprocal".equalsIgnoreCase(j))h=
JU.SimpleUnitCell.getReciprocal(h,null,b),b=1;else if("vertices".equalsIgnoreCase(j))return d.addXObj(JU.BoxInfo.getVerticesFromOABC(h));if(1!=b)for(j=1;4>j;j++)h[j].scale(b);return d.addXObj(h)},"JS.ScriptMathProcessor,~A,~B");m(c$,"evaluateArray",function(d,a,b){if(b){b=d.getX();switch(1==a.length?b.tok:0){case 6:var c=new JU.Lst,e=a[0].asString(),f=b.getMap(),h=b.getKeys(!1);b=0;for(a=h.length;b<a;b++)if(null==f.get(h[b]).getMap())return!1;b=0;for(a=h.length;b<a;b++){var g=f.get(h[b]),g=g.getMap(),
g=JS.SV.deepCopy(g,!0,!1);g.put(e,JS.SV.newS(h[b]));c.addLast(JS.SV.newV(6,g))}return d.addXList(c);case 7:c=new java.util.Hashtable;e=b.getList();f=a[0].asString();b=0;for(a=e.size();b<a;b++)if(g=e.get(b).getMap(),null==g||null==g.get(f))return!1;b=0;for(a=e.size();b<a;b++)g=e.get(b),g=JS.SV.deepCopy(g.getMap(),!0,!1),h=g.remove(f),c.put(h.asString(),JS.SV.newV(6,g));return d.addXObj(c)}return!1}c=Array(a.length);for(b=c.length;0<=--b;)c[b]=JS.SV.newT(a[b]);return d.addXAV(c)},"JS.ScriptMathProcessor,~A,~B");
m(c$,"evaluateBin",function(d,a){var b=a.length;if(3>b||5<b)return!1;var c=d.getX(),e=13==c.tok;if(!e&&7!=c.tok)return d.addX(c);var f=JS.SV.fValue(a[0]),h=JS.SV.fValue(a[1]),g=JS.SV.fValue(a[2]),k=4<=b&&1073742335==a[b-1].tok,b=(5==b||4==b&&!k)&&1073742334!=a[3].tok?JS.SV.sValue(a[3]):null,j=null;if(e)c=c.value;else{e=c.getList();c=C(e.size(),0);null!=b&&(j=JU.AU.createArrayOfHashtable(e.size()));try{for(var l=e.size();0<=--l;)c[l]=JS.SV.fValue(null==b?e.get(l):(j[l]=e.get(l).getMap()).get(b))}catch(u){if(L(u,
Exception))return!1;throw u;}}for(var h=Math.max(V(Math.floor((h-f)/g+0.01)),1),e=O(h,0),n=c.length,l=0;l<n;l++){var s=V(Math.floor((c[l]-f)/g));if(!(0>s||s>=h))if(e[s]++,null!=b){var p=j[l];if(null!=p){p.put("_bin",JS.SV.newI(s));var q=f+g*s,m=q+g;p.put("_binMin",JS.SV.newF(0==s?-3.4028235E38:q));p.put("_binMax",JS.SV.newF(s==h-1?3.4028235E38:m))}}}if(k){k=new JU.Lst;for(l=0;l<h;l++)k.addLast(C(-1,[f+g*l,e[l]]));return d.addXList(k)}return d.addXAI(e)},"JS.ScriptMathProcessor,~A");m(c$,"evaluateCache",
function(d,a){return 0<a.length?!1:d.addXMap(this.vwr.fm.cacheList())},"JS.ScriptMathProcessor,~A");m(c$,"evaluateColor",function(d,a){var b=0<a.length?JS.SV.sValue(a[0]):"",c=b.startsWith("$");if(2==a.length&&b.equalsIgnoreCase("TOHSL"))return d.addXPt(JU.CU.rgbToHSL(JU.P3.newP(8==a[1].tok?JS.SV.ptValue(a[1]):JU.CU.colorPtFromString(a[1].asString())),!0));if(2==a.length&&b.equalsIgnoreCase("TORGB")){var e=JU.P3.newP(8==a[1].tok?JS.SV.ptValue(a[1]):JU.CU.colorPtFromString(a[1].asString()));return d.addXPt(8==
a[1].tok?JU.CU.hslToRGB(e):e)}if(4==a.length&&(1073742335==a[3].tok||1073742334==a[3].tok)){var e=JU.P3.newP(8==a[0].tok?JS.SV.ptValue(a[0]):JU.CU.colorPtFromString(a[0].asString())),f=JU.P3.newP(8==a[1].tok?JS.SV.ptValue(a[1]):JU.CU.colorPtFromString(a[1].asString())),h=1073742335==a[3].tok;h&&(e=JU.CU.rgbToHSL(e,!1),f=JU.CU.rgbToHSL(f,!1));var g=new JU.SB,f=JU.V3.newVsub(f,e),k=a[2].asInt();2>k&&(k=20);f.scale(1/(k-1));for(b=0;b<k;b++)g.append(JU.Escape.escapeColor(JU.CU.colorPtToFFRGB(h?JU.CU.hslToRGB(e):
e))),e.add(f);return d.addXStr(g.toString())}k=c?null:this.vwr.cm.getColorEncoder(b);if(!c&&null==k)return d.addXStr("");e=1<a.length?JS.SV.fValue(a[1]):3.4028235E38;f=2<a.length?JS.SV.fValue(a[2]):3.4028235E38;h=3<a.length?JS.SV.fValue(a[3]):3.4028235E38;g=3.4028235E38!=h||3.4028235E38!=e&&3.4028235E38==f;3.4028235E38==f&&0==b.length&&(h=e,f=this.vwr.getCurrentColorRange(),e=f[0],f=f[1]);if(c){k=b.substring(1);k=x(-1,[k,null]);if(!this.vwr.shm.getShapePropertyData(24,"colorEncoder",k))return d.addXStr("");
k=k[1]}else k.setRange(e,f,e>f);b=k.getColorKey();return g?d.addXPt(JU.CU.colorPtFromInt(k.getArgb(3.4028235E38==f?e:h),null)):d.addX(JS.SV.getVariableMap(b))},"JS.ScriptMathProcessor,~A");m(c$,"evaluateCompare",function(d,a){var b=a.length;if(2>b||5<b)return!1;var c,e=1073742335==a[b-1].tok;(e||1073742334==a[b-1].tok)&&b--;var f=JS.SV.sValue(a[b-1]),h=f.equalsIgnoreCase("stddev"),g=f.equalsIgnoreCase("ISOMER"),k=g&&e,j=f.equalsIgnoreCase("BONDS"),l=7==a[0].tok&&7==a[1].tok,u=!l&&!g&&b>(h?3:2),e=
10==a[0].tok?a[0].value:null,n=10==a[1].tok?a[1].value:null,s=null==e?JS.SV.sValue(a[0]):"",p=null==n?JS.SV.sValue(a[1]):"";c=NaN;try{if(j){if(4!=b)return!1;s=JS.SV.sValue(a[2]);u=s.equalsIgnoreCase("SMILES");try{u&&(s=this.vwr.getSmiles(e))}catch(q){if(L(q,Exception))this.e.evalError(q.getMessage(),null);else throw q;}var m=this.e.getSmilesExt().getFlexFitList(e,n,s,!u);return null==m?d.addXStr(""):d.addXAF(m)}if(g){if(3!=b)return!1;if(null==e&&null==n){var t=this.vwr.getSmilesMatcher().getRelationship(s,
p).toUpperCase();return d.addXStr(t)}var y=null==e?this.vwr.getSmilesMatcher().getMolecularFormula(s,!1):JU.JmolMolecule.getMolecularFormulaAtoms(this.vwr.ms.at,e,null,!1),C=null==n?this.vwr.getSmilesMatcher().getMolecularFormula(p,!1):JU.JmolMolecule.getMolecularFormulaAtoms(this.vwr.ms.at,n,null,!1);if(!y.equals(C))return d.addXStr("NONE");null!=e&&(s=this.e.getSmilesExt().getSmilesMatches("/strict///",null,e,null,1,!0,!1));var A;null==n?A=0<this.vwr.getSmilesMatcher().areEqual(p,s):(p=this.e.getSmilesExt().getSmilesMatches("/strict///",
null,n,null,1,!0,!1),A=0<=this.e.getSmilesExt().getSmilesMatches("/strict///"+s,null,n,null,1,!0,!1).nextSetBit(0));if(!A){var B=s+p;if(0<=B.indexOf("/")||0<=B.indexOf("\\")||0<=B.indexOf("@")){if(0<=s.indexOf("@")&&(null!=n||0<=p.indexOf("@"))&&0>s.indexOf("@SP")){var D=s.toLowerCase().indexOf("invertstereo"),s=0<=D?"/strict/"+s.substring(0,D)+s.substring(D+12):"/invertstereo strict/"+s;if(A=null==n?0<this.vwr.getSmilesMatcher().areEqual(s,p):0<=this.e.getSmilesExt().getSmilesMatches(s,null,n,null,
1,!0,!1).nextSetBit(0))return d.addXStr("ENANTIOMERS")}null==n?A=0<this.vwr.getSmilesMatcher().areEqual("/nostereo/"+p,s):(t=this.e.getSmilesExt().getSmilesMatches("/nostereo/"+s,null,n,null,1,!0,!1),A=0<=t.nextSetBit(0));if(A)return d.addXStr("DIASTEREOMERS")}t="CONSTITUTIONAL ISOMERS";if(k){var w=this.vwr.getInchi(e,null,null);null!=w&&w.equals(this.vwr.getInchi(n,null,null))&&(t="TAUTOMERS")}return d.addXStr(t)}if(null==e||null==n)return d.addXStr("IDENTICAL");c=this.e.getSmilesExt().getSmilesCorrelation(e,
n,s,null,null,null,null,!1,null,null,!1,1);return d.addXStr(0.2>c?"IDENTICAL":"IDENTICAL or CONFORMATIONAL ISOMERS (RMSD="+c+")")}var F=new JU.M4,w=A=null;if(u){if(null==e||null==n)return!1;var f=JS.SV.sValue(a[2]),x=f.equalsIgnoreCase("MAP"),u=f.equalsIgnoreCase("SMILES"),r=x||f.equalsIgnoreCase("SMARTS");if(u||r)f=b>(h?4:3)?JS.SV.sValue(a[3]):null;var z="H".equalsIgnoreCase(f)||"allH".equalsIgnoreCase(f)||"bestH".equalsIgnoreCase(f),P=!z&&("polyhedra".equalsIgnoreCase(f)||"polyhedron".equalsIgnoreCase(f));
if(P)c=this.e.getSmilesExt().mapPolyhedra(e.nextSetBit(0),n.nextSetBit(0),u,F);else{A=new JU.Lst;var w=new JU.Lst,B="all".equalsIgnoreCase(f)||"allH".equalsIgnoreCase(f),E="best".equalsIgnoreCase(f)||"bestH".equalsIgnoreCase(f);"stddev".equals(f)&&(f=null);r=f;if(null==f||z||B||E){if(!x&&!u||z&&P)return!1;r="/noaromatic"+(B||E?"/":" nostereo/")+this.e.getSmilesExt().getSmilesMatches(z?"H":"",null,e,null,1,!0,!1)}else B=!0;c=this.e.getSmilesExt().getSmilesCorrelation(e,n,r,A,w,F,null,x,null,null,E,
(u?1:2)|(!B&&!E?8:0));if(x){var K=A.size();if(0==K)return d.addXStr("");for(var I=V(w.size()/K),t=new JU.Lst,U=0,D=0;U<I;U++){var v=JU.AU.newInt2(K);t.addLast(v);for(b=0;b<K;b++,D++)v[b]=O(-1,[A.get(b).i,w.get(D).i])}return B?d.addXList(t):0<t.size()?d.addXAII(t.get(0)):d.addXStr("")}}}if(l){A=this.e.getPointVector(a[0],3);w=this.e.getPointVector(a[1],3);v=3<=b?a[2].getList():null;if(null!=v){b--;var Q=v.size();if(Q!=A.size()||Q!=w.size())return!1;for(var W=new JU.Lst,U=0;U<Q;U++)W.addLast(A.get(v.get(U).intValue));
A=W}switch(b){case 2:break;case 3:if(h)break;default:return!1}null!=A&&(null!=w&&A.size()==w.size())&&(J.api.Interface.getInterface("JU.Eigen",this.vwr,"script"),c=JU.Measure.getTransformMatrix4(A,w,F,null))}return h||Float.isNaN(c)?d.addXFloat(c):d.addXM4(F.round(1E-7))}catch(M){if(L(M,Exception))return this.e.evalError(null==M.getMessage()?M.toString():M.getMessage(),null),!1;throw M;}},"JS.ScriptMathProcessor,~A");m(c$,"evaluateConnected",function(d,a,b,c){if(5<a.length)return!1;var e=-2147483648,
f=2147483647,h=0,g=3.4028235E38,k=65535,j=null,l=null,u=!1,n=!1;switch(b){case 1275203608:l=-2147483648;h=null;if(0<a.length)switch(a[0].tok){case 2:l=a[0].intValue;break;case 4:h=JS.SV.sValue(a[0])}1275203608==c&&(j=JS.SV.getBitSet(d.getX(),!0));j=x(-1,[Integer.$valueOf(l),h,j]);this.vwr.shm.getShapePropertyData(21,"getCenters",j)||(j[1]=null);return d.addXBs(null==j[1]?new JU.BS:j[1]);case 1228931587:j=d.getX();if(10!=j.tok||1!=a.length||10!=a[0].tok)return!1;j=j.value;l=a[0].value;a=new JU.Lst;
h=this.vwr.ms.at;for(c=j.nextSetBit(0);0<=c;c=j.nextSetBit(c+1)){b=0;g=h[c].bonds;for(n=g.length;0<=--n;)l.get(g[n].getOtherAtom(h[c]).i)&&b++;a.addLast(Integer.$valueOf(b))}return d.addXList(a)}for(c=0;c<a.length;c++){var s=a[c];switch(s.tok){case 10:if((n=y(s.value,JM.BondSet))&&null!=j)return!1;if(null==j)j=s.value;else if(null==l)l=s.value;else return!1;break;case 4:b=JS.SV.sValue(s);k=b.equalsIgnoreCase("hbond")?30720:JS.ScriptParam.getBondOrderFromString(b);if(131071==k)return!1;break;case 3:u=
!0;default:b=s.asInt();s=s.asFloat();if(2147483647!=f)return!1;-2147483648==e?(e=Math.max(b,0),h=s):(f=b,g=s)}}-2147483648==e?(e=1,f=100,h=0.1,g=1E8):2147483647==f&&(f=e,g=h,h=0.1);null==j&&(j=this.vwr.getAllAtoms());u&&null==l&&(l=j);return null!=l?(a=new JU.BS,this.vwr.makeConnections(h,g,k,1086324745,j,l,a,n,!1,0),d.addX(JS.SV.newV(10,JM.BondSet.newBS(a,this.vwr.ms.getAtomIndices(this.vwr.ms.getAtoms(1677721602,a)))))):d.addXBs(this.vwr.ms.getAtomsConnected(e,f,k,j))},"JS.ScriptMathProcessor,~A,~N,~N");
m(c$,"evaluateContact",function(d,a){if(1>a.length||3<a.length)return!1;var b=0,c=100;switch(a[0].tok){case 3:case 2:c=JS.SV.fValue(a[b++]);break;case 10:break;default:return!1}if(b==a.length||!y(a[b].value,JU.BS))return!1;var e=JU.BSUtil.copy(a[b++].value),b=b<a.length?JU.BSUtil.copy(a[b].value):null,c=new J.atomdata.RadiusData(null,10<c?c/100:c,10<c?J.atomdata.RadiusData.EnumType.FACTOR:J.atomdata.RadiusData.EnumType.OFFSET,J.c.VDW.AUTO),b=this.setContactBitSets(e,b,!0,NaN,c,!1);b.or(e);return d.addXBs(b)},
"JS.ScriptMathProcessor,~A");m(c$,"evaluateData",function(d,a){var b=0==a.length?"":JS.SV.sValue(a[0]);switch(a.length){case 0:case 1:break;case 2:case 3:if(10==a[0].tok)return d.addXStr(this.vwr.getModelFileData(b,JS.SV.sValue(a[1]),3==a.length&&JS.SV.bValue(a[2])));break;case 4:var b=a[1].asInt(),c=a[2].asInt(),e=a[3].asInt(),b=JU.Parser.parseFloatArrayFromMatchAndField(JS.SV.sValue(a[0]),null,0,0,null,b,c,null,e);return d.addXStr(JU.Escape.escapeFloatA(b,!1));default:return!1}if(0==b.indexOf("data2d_"))return b=
this.vwr.getDataObj(b,null,2),null==b?d.addXStr(""):2==a.length&&2==a[1].tok?(c=a[1].intValue,0>c&&(c+=b.length),0<=c&&c<b.length?d.addXStr(JU.Escape.escapeFloatA(b[c],!1)):d.addXStr("")):d.addXStr(JU.Escape.escapeFloatAA(b,!1));if(b.endsWith("*"))return d.addXList(this.vwr.getDataObj(b,null,0));if(0==b.indexOf("property_"))return b=this.vwr.getDataObj(b,null,1),null==b?d.addXStr(""):d.addXStr(JU.Escape.escapeFloatA(b,!1));b=this.vwr.getDataObj(b,null,-1);return d.addXStr(null==b||2>b.length?"":""+
b[1])},"JS.ScriptMathProcessor,~A");m(c$,"evaluateDotDist",function(d,a,b,c){var e=1275069443==b,f,h,g=null;switch(a.length){case 2:if(2147483647==c){f=a[0];h=a[1];break}g=a[1];case 1:f=d.getX();h=a[0];break;case 0:if(e){f=d.getX();h=JS.SV.getVariable(new JU.P3);break}default:return!1}a=NaN;try{if(1275069442==b){var k=JU.P3.newP(d.ptValue(f,null));k.cross(k,d.ptValue(h,null));return d.addXPt(k)}var j=7==h.tok?null:d.ptValue(h,null),l=this.e.planeValue(h);if(e){b=-2147483648==c?0:c&480;var k=32==b||
64==b,u=480==b;switch(f.tok){case 7:case 10:var n=10==f.tok,s=10==h.tok,p=8==h.tok,q=n?f.value:null,m=s?h.value:null,t=n?null:f.getList(),y=s?null:h.getList(),x=k&&null!=g&&g.asBoolean();switch(h.tok){case 10:case 7:case 8:var A=this.vwr.ms.at;if(x){var B=NaN,D=2147483647;if(n){for(var w=q.nextSetBit(0);0<=w;w=q.nextSetBit(w+1)){var F=p?A[w].distanceSquared(j):this.e.getBitsetProperty(m,y,c,A[w],l,f.value,null,!1,f.index,!1).floatValue();if(!(32==b?F>=B:F<=B))B=F,D=w}return d.addXBs(2147483647==D?
new JU.BS:JU.BSUtil.newAndSetBit(D))}for(w=t.size();0<=--w;){var O=JS.SV.ptValue(t.get(w)),F=p?O.distanceSquared(j):this.e.getBitsetProperty(m,y,c,O,l,f.value,null,!1,2147483647,!1).floatValue();if(!(32==b?F>=B:F<=B))B=F,D=w}return d.addXInt(D)}if(u){if(null==m){for(var r=C(q.cardinality(),0),B=0,w=q.nextSetBit(0);0<=w;w=q.nextSetBit(w+1),B++)r[B]=A[w].distance(j);return d.addXAF(r)}D=C(q.cardinality(),m.cardinality(),0);B=0;for(w=q.nextSetBit(0);0<=w;w=q.nextSetBit(w+1),B++){c=0;for(var z=m.nextSetBit(0);0<=
z;z=m.nextSetBit(z+1),c++)D[B][c]=A[w].distance(A[z])}return d.addXAFF(D)}if(k){r=C(n?q.cardinality():t.size(),0);if(n){w=q.nextSetBit(0);for(B=0;0<=w;w=q.nextSetBit(w+1))r[B++]=this.e.getBitsetProperty(m,y,c,A[w],l,f.value,null,!1,f.index,!1).floatValue();return d.addXAF(r)}for(w=r.length;0<=--w;)r[w]=this.e.getBitsetProperty(m,y,c,JS.SV.ptValue(t.get(w)),l,null,null,!1,2147483647,!1).floatValue();return d.addXAF(r)}return d.addXObj(this.e.getBitsetProperty(q,t,c,j,l,f.value,null,!1,f.index,!1))}}}var P=
d.ptValue(f,null),E=this.e.planeValue(f);e?a=null!=l&&null!=g?JU.Measure.directedDistanceToPlane(P,l,JS.SV.ptValue(g)):null==E?null==l?j.distance(P):JU.Measure.distanceToPlane(l,P):JU.Measure.distanceToPlane(E,j):null!=E&&null!=l?a=E.x*l.x+E.y*l.y+E.z*l.z+E.w*l.w:(null!=E?P=JU.P3.new3(E.x,E.y,E.z):null!=l&&(j=JU.P3.new3(l.x,l.y,l.z)),a=P.dot(j))}catch(K){if(!L(K,Exception))throw K;}return d.addXFloat(a)},"JS.ScriptMathProcessor,~A,~N,~N");m(c$,"evaluateHelix",function(d,a){if(1>a.length||5<a.length)return!1;
var b=2<a.length?3:1,c=b>=a.length?"array":JS.SV.sValue(a[b]),b=JS.T.getTokFromName(c);if(2<a.length){var e=d.ptValue(a[0],null),f=d.ptValue(a[1],null);if(0==b||9!=a[2].tok||null==e||null==f)return!1;var h=JU.Quat.newP4(a[2].value),h=JU.Measure.computeHelicalAxis(e,f,h);return null==h?!1:d.addXObj(JU.Escape.escapeHelical(c,b,e,f,h))}c=y(a[0].value,JU.BS)?a[0].value:this.vwr.ms.getAtoms(1094715412,new Integer(a[0].asInt()));switch(b){case 134217751:case 1073741854:case 1665140738:return d.addXObj(this.getHelixData(c,
b));case 134217729:return d.addXFloat(this.getHelixData(c,134217729).floatValue());case 135176:case 1745489939:return d.addXObj(this.getHelixData(c,b));case 1275068418:h=this.getHelixData(c,1073742001);if(null==h)break;return d.addXAS(h)}return!1},"JS.ScriptMathProcessor,~A");m(c$,"getHelixData",function(d,a){var b=d.nextSetBit(0);return 0>b?"null":this.vwr.ms.at[b].group.getHelixData(a,this.vwr.getQuaternionFrame(),this.vwr.getInt(553648142))},"JU.BS,~N");m(c$,"evaluateInChI",function(d,a){var b=
d.getX(),c=0<a.length?JS.SV.sValue(a[0]):"fixedh?";c.toLowerCase().equals("standard")&&(c="");var e=JS.SV.getBitSet(b,!0),f=null;null==e&&(f=JS.SV.sValue(b));return d.addXStr(this.vwr.getInchi(e,f,c))},"JS.ScriptMathProcessor,~A");m(c$,"evaluateFind",function(d,a){var b=d.getX(),c=7==b.tok,e=10==b.tok,f=0==a.length,h=0==a.length?0:a[0].tok,g=f||4!=h?"":JS.SV.sValue(a[0]),k=1<a.length&&1073742334==a[1].tok,j=0==h?0:a[a.length-1].tok,l=0==j?JS.SV.vF:a[a.length-1],u=!c&&1073742335==j,n=1<a.length&&1073742335!=
a[1].tok&&1073742334!=a[1].tok&&10!=a[1].tok?JS.SV.sValue(a[1]):"",j=!c&&!k&&g.equalsIgnoreCase("SEQUENCE"),s=!c&&!k&&g.equalsIgnoreCase("SEQ");if(g.toUpperCase().startsWith("SMILES/")){g.endsWith("/")||(g+="/");var p=g.substring(6)+"//";JV.JC.isSmilesCanonical(p)?(n="SMILES",g="CHEMICAL"):(g="SMILES",n=p+n)}else g.toUpperCase().startsWith("SMARTS/")&&(g.endsWith("/")||(g+="/"),n=g.substring(6)+(0==n.length?"//":n),g="SMARTS");var q=null,p=!1;if(4==b.tok)switch(a.length){case 1:if(b.value.startsWith("InChI=")&&
g.equalsIgnoreCase("SMILES"))return d.addXStr(this.vwr.getInchi(null,b.value,"SMILES"+n));p=!0;break;case 2:k||u?p=!0:b.value.startsWith("InChI=")?g.equals("SMARTS")?q=this.vwr.getInchi(null,b.value,"SMILES"):p=!0:3>=n.length&&0==n.$replace("m"," ").$replace("i"," ").$replace("v"," ").trim().length&&(p=!0)}var m=!c&&!p&&g.equalsIgnoreCase("SMILES"),t=!c&&!p&&g.equalsIgnoreCase("SMARTS"),y=!c&&!p&&g.equalsIgnoreCase("CHEMICAL"),C=!c&&!p&&g.equalsIgnoreCase("MF"),A=!c&&!p&&g.equalsIgnoreCase("CELLFORMULA"),
B=e&&!c&&g.equalsIgnoreCase("INCHI"),D=e&&!c&&g.equalsIgnoreCase("INCHIKEY"),w=!m&&!t&&10==h&&0<=n.toLowerCase().indexOf("map"),p=(10==b.tok||8==b.tok||7==b.tok)&&g.toLowerCase().startsWith("equivalent");try{if(p)switch(b.tok){case 10:return d.addXBs(this.vwr.ms.getSymmetryEquivAtoms(b.value));case 8:return d.addXList(this.vwr.getSymmetryEquivPoints(b.value,g+n));case 7:for(var F=new JU.Lst,V=b.getList(),r=0,z=V.size();r<z;r++){var P=JS.SV.ptValue(V.get(r));if(null==P)return!1;F.addLast(P)}return d.addXList(this.vwr.getSymmetryEquivPointList(F,
g+n))}else if(B||D)return D&&(n+=" key"),d.addXStr(this.vwr.getInchi(JS.SV.getBitSet(b,!0),null,n));if(y){var E=e?b.value:null,K=null==E?JS.SV.sValue(b):this.vwr.getOpenSmiles(E),K=(0==K.length?"":this.vwr.getChemicalInfo(K,n.toLowerCase(),E)).trim();K.startsWith("InChI")&&(K=JU.PT.rep(JU.PT.rep(K,"InChI=",""),"InChIKey=",""));return d.addXStr(K)}if(m||t||e){var e=w?0:m||t?2:1,I=e<a.length&&10==a[e].tok?a[e++].value:null,U="bonds".equalsIgnoreCase(JS.SV.sValue(l)),F=U||u,e=null;switch(b.tok){case 4:null==
q&&(q=JS.SV.sValue(b));if((m||t)&&1==a.length||null!=I)return!1;if(n.equalsIgnoreCase("mf"))e=this.vwr.getSmilesMatcher().getMolecularFormula(q,t);else{var I=n,v=!0,r=!1;switch(a.length){case 4:v=JS.SV.bValue(a[3]);case 3:r=JS.SV.bValue(a[2])}var Q=I.equals("chirality"),z=!r&&(!v||!t&&!Q);try{e=this.e.getSmilesExt().getSmilesMatches(I,q,null,null,t?2:1,!r,!v)}catch(W){if(L(W,Exception))return System.out.println(W.getMessage()),d.addXInt(-1);throw W;}var M=Q?1:(JU.AU.isAI(e),e.length);0==M&&("MF_FAILED"!==
this.vwr.getSmilesMatcher().getLastException()&&0>q.toLowerCase().indexOf("noaromatic")&&0>q.toLowerCase().indexOf("strict"))&&(e=this.e.getSmilesExt().getSmilesMatches(I,q,null,null,16|(t?2:1),!r,!v));if(z)return d.addXInt(!v&&0<M?1:M)}break;case 10:v=b.value;if(g.equalsIgnoreCase("spacegroup"))return d.addXObj(this.vwr.findSpaceGroup(v,null,null,!1,!1));if(g.equalsIgnoreCase("crystalClass"))return z=v.nextSetBit(0),v=null,2!=a.length&&(v=new JU.BS,v.set(z)),d.addXList(this.vwr.ms.generateCrystalClass(z,
null!=v?this.vwr.ms.getAtomSetCenter(v):10==l.tok?this.vwr.ms.getAtomSetCenter(l.value):JS.SV.ptValue(l)));if(C&&0!=n.length)return d.addXBs(JU.JmolMolecule.getBitSetForMF(this.vwr.ms.at,v,n));if(C||A)return d.addXStr(JU.JmolMolecule.getMolecularFormulaAtoms(this.vwr.ms.at,v,C?null:this.vwr.ms.getCellWeights(v),u));if(j||s){var Y=l.asString().equalsIgnoreCase("H"),F=(new Boolean(F|Y)).valueOf();return d.addXStr(this.vwr.getSmilesOpt(v,-1,-1,(F?7340032|(Y?9437184:0):0)|(s?34603008:1048576),null))}if(w){var G=
null,M=Q=z=null,N=3==a.length?JS.SV.sValue(l):null,R=null==N||N.equals("%i")||N.equals("number")?"i":N.equals("%a")||N.equals("name")?"a":N.equals("%D")||N.equals("index")?"D":"?";null==N&&(N="number");l=null;n=n.$replace("map","").trim();g=this.vwr.getSmilesOpt(v,0,0,0,n);if(v.cardinality()!=I.cardinality())l="atom sets are not the same size";else try{0<n.length&&(g="/"+n+"/"+g);var z=this.vwr.getSmilesMatcher().getCorrelationMaps(g,this.vwr.ms.at,this.vwr.ms.ac,v,137)[0],X=this.vwr.getSmilesMatcher().getCorrelationMaps(g,
this.vwr.ms.at,this.vwr.ms.ac,I,137);if(0<X.length){G=O(v.length(),0);for(r=G.length;0<=--r;)G[r]=-1;Q=X[0];for(r=z.length;0<=--r;)G[z[r]]=Q[r];var M=x(z.length,2,null),ca=JU.BS.copy(v);ca.or(I);var S="?"==R?Array(ca.length()):null;null!=S&&(S=this.e.getCmdExt().getBitsetIdentFull(ca,N,null,!1,2147483647,!1,S));for(var H=this.vwr.ms.at,X=0,r=v.nextSetBit(0);0<=r;r=v.nextSetBit(r+1)){var aa=G[r];if(-1!=aa){var ba;switch(R){case "a":ba=x(-1,[H[r].getAtomName(),H[aa].getAtomName()]);break;case "i":ba=
x(-1,[Integer.$valueOf(H[r].getAtomNumber()),Integer.$valueOf(H[aa].getAtomNumber())]);break;case "D":ba=x(-1,[Integer.$valueOf(r),Integer.$valueOf(aa)]);break;default:ba=x(-1,[S[r],S[aa]])}M[X++]=ba}}}}catch(da){if(L(da,Exception))l=da.getMessage();else throw da;}var T=new java.util.HashMap;T.put("BS1",v);T.put("BS2",I);T.put("SMILES",g);null==l?(T.put("SMILEStoBS1",z),T.put("SMILEStoBS2",Q),T.put("BS1toBS2",G),T.put("MAP1to2",M),T.put("key",N)):T.put("error",l);return d.addXMap(T)}if(m||t)g=1<a.length&&
10==a[1].tok?this.vwr.getSmilesOpt(a[1].value,0,0,0,n):n;n=n.toUpperCase();if(0<=n.indexOf("INCHI"))return d.addXStr(this.vwr.getInchi(v,null,"SMILES/"+n));if(U)G=this.vwr.getSmilesMatcher().getCorrelationMaps(g,this.vwr.ms.at,this.vwr.ms.ac,v,(m?1:2)|8),e=0<G.length?this.vwr.ms.getDihedralMap(G[0]):O(0,0);else if(n.equals("MAP"))e=G=this.vwr.getSmilesMatcher().getCorrelationMaps(g,this.vwr.ms.at,this.vwr.ms.ac,v,(m?1:2)|144);else{var Z=(m?0<=n.indexOf("OPEN")?5:1:2)|(u&&0==g.length?22020096:0);if(0<=
n.indexOf("/MOLECULE/")){for(var ea=this.vwr.ms.getMolecules(),$=new JU.Lst,r=0;r<ea.length;r++)if(ea[r].atomList.intersects(v)){var ha=this.e.getSmilesExt().getSmilesMatches(g,null,ea[r].atomList,I,Z,!u,!1);ha.isEmpty()||$.addLast(ha)}e=$}else e=this.e.getSmilesExt().getSmilesMatches(g,null,v,I,Z,!u,!1)}}null==e&&this.e.invArg();return d.addXObj(e)}}catch(fa){if(L(fa,Exception))this.e.evalError(fa.getMessage(),null);else throw fa;}v=new JU.BS;G=c?b.getList():null;if(c&&4!=h&&0!=h){b=a[0];r=0;for(z=
G.size();r<z;r++)JS.SV.areEqual(G.get(r),b)&&v.set(r);e=O(v.cardinality(),0);X=0;for(r=v.nextSetBit(0);0<=r;r=v.nextSetBit(r+1))e[X++]=r+1;return d.addXAI(e)}h=0<=n.indexOf("v");r=0<=n.indexOf("i")||k;k=0<=n.indexOf("m");n=0==g.length;p=!n&&!p&&2==a.length;if(c||p){j=p?this.getPatternMatcher():null;I=null;if(p)try{I=j.compile(g,r)}catch(ga){if(L(ga,Exception))this.e.evalError(ga.toString(),null);else throw ga;}j=n?null:JS.SV.strListValue(b);N=n?G.size():j.length;JU.Logger.debugging&&JU.Logger.debug("finding "+
g);z=0;R=null;b=k?new JU.Lst:null;S="";for(r=0;r<N;r++){if(n)switch(H=G.get(r),H.tok){case 6:H=H.getMap().isEmpty()!=f;break;case 7:H=0==H.getList().size()!=f;break;case 4:H=0==H.asString().length!=f;break;default:H=!0}else p?(S=j[r],R=I.matcher(S),H=R.find()):H=0<=JS.SV.sValue(G.get(r)).indexOf(g);if(k&&H||!k&&H==!h)z++,v.set(r),k&&b.addLast(h?S.substring(0,R.start())+S.substring(R.end()):R.group())}if(!c)return k?d.addXStr(1==b.size()?b.get(0):""):h?d.addXBool(1==z):k?d.addXStr(0==z?"":R.group()):
d.addXInt(0==z?0:R.start()+1);if(k){c=Array(z);if(0<z)for(r=j.length;0<=--r;)v.get(r)&&(--z,c[z]=k?b.get(z):j[r]);return d.addXAS(c)}c=new JU.Lst;for(r=v.nextSetBit(0);0<=r;r=v.nextSetBit(r+1))c.addLast(G.get(r));return d.addXList(c)}return j?d.addXStr(this.vwr.getJBR().toStdAmino3(JS.SV.sValue(b))):d.addXInt(JS.SV.sValue(b).indexOf(g)+1)},"JS.ScriptMathProcessor,~A");m(c$,"evaluateGetProperty",function(d,a,b,c){var e=a.length,f=c&&1275082245==b,h=c&&1275068725==b,g=1275068446==b,k=0,j=0==e?0:a[0].tok;
if(2==e&&(7==j||6==j||14==j))return d.addXObj(this.vwr.extractProperty(a[0].value,a[1].value.toString(),-1));var l=c&&1==e&&10==a[0].tok?a[0].value:null,u=null==l&&0<e?JS.SV.sValue(a[k++]):"",j=u,n=j.toLowerCase();!f&&0>n.indexOf("[select ")&&(j=n);var m=!1;j.equals("json")&&e>k&&(m=!0,j=JS.SV.sValue(a[k++]));var p=null;if(c){p=d.getX();switch(p.tok){case 10:break;case 4:var q=p.value,e=Array(3);q.startsWith("$")?(q=q.substring(1),a=this.vwr.shm.getShapeIdFromObjectName(q),0<=a&&(e[0]=q,this.vwr.shm.getShapePropertyData(a,
"index",e),null!=e[1]&&!u.equals("index")&&(q=e[1].intValue(),e[1]=this.vwr.shm.getShapePropertyIndex(a,u.intern(),q)))):(a=JV.JC.shapeTokenIndex(JS.T.getTokFromName(q)),0<=a&&(e[0]=u,e[1]=Integer.$valueOf(-1),this.vwr.shm.getShapePropertyData(a,u.intern(),e)));return null==e[1]?d.addXStr(""):d.addXObj(e[1]);case 7:if(h){g=p.getList();if(0==e)return d.addXObj(this.getMinMax(g,1275068725,!0));c=new java.util.Hashtable;j=1<e?JS.SV.sValue(a[e-1]):null;null!=j&&e--;n=Array(e);for(q=0;q<e;q++)n[q]=JS.SV.sValue(a[q]);
q=0;for(m=g.size();q<m;q++)if(k=g.get(q),6==k.tok){u=k.getMap();a="";for(p=0;p<e;p++)l=u.get(n[p]),a+=(0==p?"":j)+JS.SV.sValue(l);u=c.get(a);null==u&&c.put(a,u=JS.SV.newV(7,new JU.Lst));u.getList().addLast(k)}return d.addXMap(c)}if(null!=l){e=p.getList();a=new JU.Lst;for(q=l.nextSetBit(0);0<=q;q=l.nextSetBit(q+1))a.addLast(e.get(q));return d.addXList(a)}default:if(1275068725==b&&6==p.tok){c=new java.util.Hashtable;for(e=p.getMap().entrySet().iterator();e.hasNext()&&((q=e.next())||1);)a=q.getKey(),
k=q.getValue().asString(),g=c.get(k),null==g&&c.put(k,g=new JU.Lst),g.addLast(a);if("count".equals(n))for(e=c.entrySet().iterator();e.hasNext()&&((q=e.next())||1);)q.setValue(Integer.$valueOf(q.getValue().size()));return d.addXMap(c)}f&&(j="[SELECT "+j+"]");return d.addXObj(this.vwr.extractProperty(p,j,-1))}!n.startsWith("bondinfo")&&(!n.startsWith("atominfo")&&!n.startsWith("modelkitinfo"))&&(j="atomInfo."+j)}q="";if(j.equalsIgnoreCase("fileContents")&&2<=e){k=JS.SV.sValue(a[1]);for(q=2;q<e;q++)k+=
"|"+JS.SV.sValue(a[q]);q=k;k=e}else if(e>k)switch(a[k].tok){case 10:q=a[k++].value;j.equalsIgnoreCase("bondInfo")&&(e>k&&10==a[k].tok)&&(q=x(-1,[q,a[k].value]));break;case 6:case 4:this.vwr.checkPropertyParameter(j)&&(q=a[k++].value)}if(c&&(q=p.value,0>q.nextSetBit(0)))return d.addXStr("");g&&!c&&(j="auxiliaryInfo.models."+j);j=JU.PT.rep(j,".[","[");q=this.vwr.getProperty(null,j,q);k<e&&(q=this.vwr.extractProperty(q,a,k));return d.addXObj(m?JS.SV.safeJSON("value",q):JS.SV.isVariableType(q)?q:JU.Escape.toReadable(j,
q))},"JS.ScriptMathProcessor,~A,~N,~B");m(c$,"evaluateFormat",function(d,a,b,c){var e=2>b.length||1287653388==a?d.getX():null,f=0==b.length?"%U":7==b[0].tok?null:JS.SV.sValue(b[0]);if(!c&&0<b.length&&null!=e&&10!=e.tok&&null!=f){if(2==b.length){var e=e.getList(),h=b[1].getList();if(null==e||null==h)return!1;e=JS.SV.getVariableList(this.getSublist(e,h))}b=x(-1,[b[0],e]);e=null}if(null==e){a=c?-1:JS.SV.getFormatType(f);if(0<=a&&2!=b.length)return!1;if(0<=a||2>b.length||7!=b[1].tok)return b=JS.SV.format(b,
a),f.equalsIgnoreCase("json")?d.addXStr(b):d.addXObj(b);f=b[1].getList();b=x(-1,[b[0],null]);c=Array(f.size());for(e=c.length;0<=--e;)b[1]=f.get(e),c[e]=JS.SV.format(b,a).toString();return d.addXAS(c)}if(7==e.tok&&null==f)return e=e.getList(),h=b[0].getList(),f=this.getSublist(e,h),d.addXList(f);b=10==e.tok?e.value:null;a=JS.T.tokAttr(a,480);return d.addXObj(null==f?"":null==b?JS.SV.sprintf(JU.PT.formatCheck(f),e):this.e.getCmdExt().getBitsetIdent(b,f,e.value,!0,e.index,a))},"JS.ScriptMathProcessor,~N,~A,~B");
m(c$,"getSublist",function(d,a){for(var b=new JU.Lst,c,e,f,h=0,g=d.size();h<g;h++)switch(e=d.get(h),e.tok){case 6:c=e.getMap();f=new JU.Lst;for(var k=0,j=a.size();k<j;k++)e=c.get(JS.SV.sValue(a.get(k))),f.addLast(null==e?JS.SV.newS(""):e);b.addLast(JS.SV.getVariableList(f));break;case 7:c=new java.util.Hashtable;f=e.getList();k=0;for(j=Math.min(f.size(),a.size());k<j;k++)c.put(JS.SV.sValue(a.get(k)),f.get(k));b.addLast(JS.SV.getVariable(c))}return b},"JU.Lst,JU.Lst");m(c$,"evaluateList",function(d,
a,b){var c=b.length,e=d.getX(),f=7==e.tok,h;switch(a){case 1275335685:return 2==c&&d.addX(e.pushPop(b[0],b[1]))||1==c&&d.addX(e.pushPop(null,b[0]));case 1275334681:return 1==c&&d.addX(e.pushPop(b[0],null))||0==c&&d.addX(e.pushPop(null,null));case 1275069441:if(1!=c&&2!=c)return!1;break;case 1275069447:case 1275069446:break;default:if(1!=c)return!1}var g=null,k=null,j=null;if(2==c){var l=JS.SV.sValue(b[0]);h=b[1];if(1275069441==a){g=f?JS.SV.strListValue(e):JU.PT.split(JS.SV.sValue(e),"\n");k=7==h.tok?
JS.SV.strListValue(h):JU.PT.split(JS.SV.sValue(h),"\n");j=Array(c=Math.max(g.length,k.length));for(e=0;e<c;e++)j[e]=(e>=g.length?"":g[e])+l+(e>=k.length?"":k[e]);return d.addXAS(j)}if(1073742335!=h.tok)return!1;j=e.getList();(c=0==l.length)&&(l=",");if(1275069446==a){k=Array(j.size());for(e=j.size();0<=--e;)if(b=j.get(e).getList(),null==b)k[e]=j.get(e);else{a=new JU.SB;f=0;for(g=b.size();f<g;f++)0<f&&a.append(l),h=b.get(f),a.append(c&&4==h.tok?'"'+JU.PT.rep(h.value,'"','""')+'"':""+h.asString());
k[e]=JS.SV.newS(a.toString())}return d.addXAV(k)}a=new JU.Lst;c&&(l="\x00");k=O(2,0);e=0;for(h=j.size();e<h;e++){f=j.get(e).asString();if(c){k[1]=0;for(g=k[0]=0;;){b=JU.PT.getCSVString(f,k);if(null==b){if(-1==k[1]){f+=++e<h?"\n"+j.get(e).asString():'"';k[1]=g;continue}f=f.substring(0,g)+f.substring(g).$replace(",","\x00");break}f=f.substring(0,g)+f.substring(g,k[0]).$replace(",","\x00")+b+f.substring(k[1]);k[1]=g=k[0]+b.length}}for(var u=f.$plit(l),n=new JU.Lst,f=0,g=u.length;f<g;f++){b=u[f];if(0>
b.indexOf("."))try{n.addLast(JS.SV.newI(Integer.parseInt(b)));continue}catch(m){if(!L(m,Exception))throw m;}else try{n.addLast(JS.SV.getVariable(Float.$valueOf(Float.parseFloat(b))));continue}catch(p){if(!L(p,Exception))throw p;}n.addLast(JS.SV.newS(b))}a.addLast(JS.SV.getVariableList(n))}return d.addXObj(JS.SV.getVariableList(a))}h=0==c?JS.SV.newV(1073742327,"all"):b[0];j=1073742327==h.tok;if(!f&&4!=e.tok)return d.binaryOp(this.opTokenFor(a),e,h);var u=JS.SV.isScalar(e),q=JS.SV.isScalar(h),y=n=null,
l=e.getList(),t=h.getList();f?c=l.size():u?c=2147483647:(g=JU.PT.split(JS.SV.sValue(e),"\n"),n=C(c=g.length,0),JU.PT.parseFloatArrayData(g,n));if(j&&1275069446!=a){j=0;if(f)for(e=c;0<=--e;)j+=JS.SV.fValue(l.get(e));else if(!u)for(e=c;0<=--e;)j+=n[e];return d.addXFloat(j)}if(1275069446==a&&4==h.tok){a=new JU.SB;if(u)a.append(JS.SV.sValue(e));else{b=j?"":h.value.toString();for(e=0;e<c;e++)a.append(0<e?b:"").append(JS.SV.sValue(l.get(e)))}return d.addXStr(a.toString())}var x=null;q?x=h:7==h.tok?c=Math.min(c,
t.size()):(k=JU.PT.split(JS.SV.sValue(h),"\n"),y=C(k.length,0),JU.PT.parseFloatArrayData(k,y),c=Math.min(c,y.length));var V=this.opTokenFor(a);if(f&&j)return j=new JU.Lst,d.addXList(this.addAllLists(e.getList(),j));b=u?e:null;var A,B=2147483647==c;B&&(c=1);for(var D=Array(c),e=0;e<c;e++){A=q?x:7==h.tok?t.get(e):Float.isNaN(y[e])?JS.SV.getVariable(JS.SV.unescapePointOrBitsetAsVariable(k[e])):JS.SV.newF(y[e]);u||(b=f?l.get(e):Float.isNaN(n[e])?JS.SV.getVariable(JS.SV.unescapePointOrBitsetAsVariable(g[e])):
JS.SV.newF(n[e]));1275069446==a&&7!=b.tok&&(j=new JU.Lst,j.addLast(b),b=JS.SV.getVariableList(j));if(!d.binaryOp(V,b,A))return!1;D[e]=d.getX()}return B?d.addXObj(D[0]):d.addXAV(D)},"JS.ScriptMathProcessor,~N,~A");m(c$,"addAllLists",function(d,a){for(var b=d.size(),c=0;c<b;c++){var e=d.get(c);7==e.tok?this.addAllLists(e.getList(),a):a.addLast(e)}return a},"JU.Lst,JU.Lst");m(c$,"evaluateLoad",function(d,a,b){if(1>a.length||3<a.length)return!1;var c=JV.FileManager.fixDOSName(JS.SV.sValue(a[0])),e=1<
a.length&&1073742335==a[1].tok,f=this.vwr.async||2<a.length&&1073742335==a[a.length-1].tok,h=1<a.length&&2==a[1].tok?a[1].asInt():-1;a=1<a.length&&a[1].asString().equalsIgnoreCase("JSON");if(e)return d.addXMap(this.vwr.fm.getFileAsMap(c,null,!1));e=c.startsWith("?");if(JV.Viewer.isJS&&(e||f)){if(b&&e)return d.addXStr("");c=this.e.loadFileAsync("load()_",c,d.oPt,!0)}b=b?this.vwr.fm.getFilePath(c,!1,!1):this.vwr.getFileAsString4(c,h,!1,!1,!0,"script");try{return a?d.addXObj(this.vwr.parseJSON(b)):d.addXStr(b)}catch(g){if(L(g,
Exception))return!1;throw g;}},"JS.ScriptMathProcessor,~A,~B");m(c$,"evaluateMath",function(d,a,b){a=JS.SV.fValue(a[0]);switch(b){case 134218246:a=Math.sqrt(a);break;case 134218244:a=Math.sin(3.141592653589793*a/180);break;case 134218245:a=Math.cos(3.141592653589793*a/180);break;case 134218242:a=180*Math.acos(a)/3.141592653589793}return d.addXFloat(a)},"JS.ScriptMathProcessor,~A,~N");m(c$,"evaluateMeasure",function(d,a,b){var c=0;switch(b){case 1745489939:b=null;for(var e=new JU.Lst,f=C(-1,[3.4028235E38,
3.4028235E38]),h=null,g=null,k=!1,j=!1,l=0,u=!1,n=null,m=0,p=3.4028235E38,q=!1,y=!1,n=0;n<a.length;n++)switch(a[n].tok){case 10:var t=a[n].value;0==t.length()&&(u=!0);e.addLast(t);c++;m++;break;case 8:t=new JU.Point3fi;t.setT(a[n].value);e.addLast(t);c++;break;case 2:case 3:f[l++%2]=JS.SV.fValue(a[n]);break;case 4:t=JS.SV.sValue(a[n]);if(t.startsWith("property_")){b=t;break}t.equalsIgnoreCase("vdw")||t.equalsIgnoreCase("vanderwaals")?p=(n+1<a.length&&2==a[n+1].tok?a[++n].asInt():100)/100:t.equalsIgnoreCase("notConnected")?
j=!0:t.equalsIgnoreCase("connected")?k=!0:t.equalsIgnoreCase("minArray")?q=1<=m:t.equalsIgnoreCase("asArray")||0==t.length?y=1<=m:JM.Measurement.isUnits(t)?g=t.toLowerCase():h=c+":"+t;break;default:return!1}if(2>c||4<c||2<l||j&&k)return!1;if(u||3.4028235E38!=p&&(2!=m||2!=c))return d.addXStr("");n=3.4028235E38==p?new J.atomdata.RadiusData(f,0,null,null):new J.atomdata.RadiusData(null,p,J.atomdata.RadiusData.EnumType.FACTOR,J.c.VDW.AUTO);a=this.vwr.newMeasurementData(null,e).set(0,null,n,b,h,g,null,
k,j,null,!0,0,0,null,NaN).getMeasurements(y,q);return d.addXObj(a);case 134217729:if(3!=(c=a.length)&&4!=c)return!1;break;default:if(2!=(c=a.length))return!1}b=Array(c);for(n=0;n<c;n++)if(null==(b[n]=d.ptValue(a[n],null)))return!1;switch(c){case 2:return d.addXFloat(b[0].distance(b[1]));case 3:return d.addXFloat(JU.Measure.computeAngleABC(b[0],b[1],b[2],!0));case 4:return d.addXFloat(JU.Measure.computeTorsion(b[0],b[1],b[2],b[3],!0))}return!1},"JS.ScriptMathProcessor,~A,~N");m(c$,"evaluateModulation",
function(d,a){var b="",c=NaN,e=null;switch(a.length){case 0:break;case 1:switch(a[0].tok){case 8:e=a[0].value;break;case 4:b=a[0].asString();break;default:c=JS.SV.fValue(a[0])}break;case 2:b=JS.SV.sValue(a[0]);c=JS.SV.fValue(a[1]);break;default:return!1}null==e&&1E6>c&&(e=JU.P3.new3(c,c,c));c=d.getX();c=10==c.tok?c.value:new JU.BS;return d.addXList(this.vwr.ms.getModulationList(c,(b+"D").toUpperCase().charAt(0),e))},"JS.ScriptMathProcessor,~A");m(c$,"evaluatePlane",function(d,a,b){if(134219777==b&&
3!=a.length&&4!=a.length||134217763==b&&2!=a.length&&3!=a.length&&4!=a.length||0==a.length||4<a.length)return!1;var c,e,f=this.e.planeValue(a[0]),h,g;switch(a.length){case 1:return 10==a[0].tok&&(a=a[0].value,3==a.cardinality())?(a=this.vwr.ms.getAtomPointVector(a),d.addXPt4(JU.Measure.getPlaneThroughPoints(a.get(0),a.get(1),a.get(2),new JU.V3,new JU.V3,new JU.P4))):null!=f&&d.addXPt4(f);case 2:if(134217763==b){c=this.e.planeValue(a[1]);if(null==c)return!1;b=new JU.P3;h=new JU.V3;g=new JU.V3;if(null!=
f)return a=JU.Measure.getIntersectionPP(f,c),null==a?d.addXStr(""):d.addXList(a);e=d.ptValue(a[0],null);return null==e?d.addXStr(""):d.addXPt(JU.Measure.getIntersection(e,null,c,b,h,g))}case 3:case 4:switch(b){case 134219777:return b=4==a.length?JS.SV.fValue(a[3]):NaN,f=this.e.getHklPlane(JU.P3.new3(JS.SV.fValue(a[0]),JS.SV.fValue(a[1]),JS.SV.fValue(a[2])),b,null),null!=f&&d.addXPt4(f);case 134217763:c=d.ptValue(a[0],null);e=d.ptValue(a[1],null);if(null==c||null==e)return d.addXStr("");e=JU.V3.newV(e);
e.normalize();f=this.e.planeValue(a[2]);if(null!=f)return b=new JU.P3,h=new JU.V3,g=new JU.V3,c=JU.Measure.getIntersection(c,e,f,b,h,g),null==c?d.addXStr(""):d.addXPt(c);b=d.ptValue(a[2],null);if(null==b)return d.addXStr("");h=new JU.V3;b=JU.P3.newP(b);if(3==a.length)return JU.Measure.projectOntoAxis(b,c,e,h),d.addXPt(b);f=JS.SV.fValue(a[3]);a=JU.P3.newP(b);JU.Measure.projectOntoAxis(b,c,e,h);a=a.distance(b);c=new JU.Lst;a==f?c.addLast(b):a<f&&(a=Math.sqrt(f*f-a*a),h.scaleAdd2(a,e,b),c.addLast(JU.P3.newP(h)),
h.scaleAdd2(-a,e,b),c.addLast(JU.P3.newP(h)));return d.addXList(c)}switch(a[0].tok){case 2:case 3:if(3==a.length)return f=JS.SV.fValue(a[0]),b=JS.SV.fValue(a[1]),a=JS.SV.fValue(a[2]),h=JU.V3.new3(0,0,1),e=JU.P3.new3(0,1,0),a=JU.Quat.newVA(e,a),a.getMatrix().rotate(h),e.set(0,0,1),a=JU.Quat.newVA(e,b),a.getMatrix().rotate(h),e.setT(h),e.scale(f),f=new JU.P4,JU.Measure.getPlaneThroughPoint(e,h,f),d.addXPt4(f);break;case 10:case 8:c=d.ptValue(a[0],null);e=d.ptValue(a[1],null);if(null==e)return!1;b=2<
a.length&&(10==a[2].tok||8==a[2].tok)?d.ptValue(a[2],null):null;h=JU.V3.newV(e);if(null==b)return f=new JU.P4,2==a.length||2!=a[2].tok&&3!=a[2].tok&&!a[2].asBoolean()?(b=JU.P3.newP(c),b.add(e),b.scale(0.5),h.sub(c),h.normalize()):1073742335==a[2].tok?b=c:(h.sub(c),b=new JU.P3,b.scaleAdd2(a[2].asFloat(),h,c)),JU.Measure.getPlaneThroughPoint(b,h,f),d.addXPt4(f);f=new JU.V3;a=4==a.length?d.ptValue(a[3],null):null;a=JU.Measure.getDirectedNormalThroughPoints(c,e,b,a,h,f);return d.addXPt4(JU.P4.new4(h.x,
h.y,h.z,a))}}if(4!=a.length)return!1;b=JS.SV.fValue(a[0]);h=JS.SV.fValue(a[1]);c=JS.SV.fValue(a[2]);a=JS.SV.fValue(a[3]);return d.addXPt4(JU.P4.new4(b,h,c,a))},"JS.ScriptMathProcessor,~A,~N");m(c$,"evaluatePoint",function(d,a){switch(a.length){default:return!1;case 1:if(3==a[0].tok||2==a[0].tok)return d.addXInt(a[0].asInt());var b=null;if(7==a[0].tok){var c=a[0].getList(),e=c.size();if(0==e)return!1;switch(c.get(0).tok){case 4:b=c.get(0).value;if(!b.startsWith("{")||y(JU.Escape.uP(b),String))break;
for(var b=new JU.Lst,f=0;f<e;f++)b.addLast(JS.SV.getVariable(JU.Escape.uP(JS.SV.sValue(c.get(f)))));return d.addXList(b)}b="{"+JS.SV.sValue(a[0])+"}"}null==b&&(b=JS.SV.sValue(a[0]));c=JU.Escape.uP(b);return y(c,JU.P3)?d.addXPt(c):d.addXStr(""+c);case 2:switch(a[1].tok){case 1073742334:case 1073742335:switch(a[0].tok){case 8:c=JU.P3.newP(a[0].value);break;case 10:c=this.vwr.ms.getAtomSetCenter(a[0].value);break;default:return!1}1073742335==a[1].tok?(this.vwr.tm.transformPt3f(c,c),c.y=this.vwr.tm.height-
c.y,this.vwr.antialiased&&c.scale(0.5)):(this.vwr.antialiased&&c.scale(2),c.y=this.vwr.tm.height-c.y,this.vwr.tm.unTransformPoint(c,c));break;case 8:e=a[0].getList();if(null==e||4!=e.size())return!1;b=JS.SV.ptValue(a[1]);c=JU.P3.newP(JS.SV.ptValue(e.get(0)));c.scaleAdd2(b.x,JS.SV.ptValue(e.get(1)),c);c.scaleAdd2(b.y,JS.SV.ptValue(e.get(2)),c);c.scaleAdd2(b.z,JS.SV.ptValue(e.get(3)),c);break;default:return!1}return d.addXPt(c);case 3:return d.addXPt(JU.P3.new3(a[0].asFloat(),a[1].asFloat(),a[2].asFloat()));
case 4:return d.addXPt4(JU.P4.new4(a[0].asFloat(),a[1].asFloat(),a[2].asFloat(),a[3].asFloat()))}},"JS.ScriptMathProcessor,~A");m(c$,"evaluatePrompt",function(d,a){if(1!=a.length&&2!=a.length&&3!=a.length)return!1;var b=JS.SV.sValue(a[0]),c=1<a.length&&7==a[1].tok?JS.SV.strListValue(a[1]):null,e=null!=c||1==a.length||3==a.length&&a[2].asBoolean(),f=null!=c?null:2<=a.length?JS.SV.sValue(a[1]):"OK",b=""+this.vwr.prompt(b,f,c,e);return e&&null!=c?d.addXInt(Integer.parseInt(b)+1):d.addXStr(b)},"JS.ScriptMathProcessor,~A");
m(c$,"evaluateQuaternion",function(d,a,b){var c=null,e=a.length,f=2147483647,h=!1;134221850==b&&(1<e&&(4==a[e-1].tok&&a[e-1].value.equalsIgnoreCase("relative"))&&(e--,h=!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(134221850==b){if(7==a[0].tok&&(7==a[1].tok||1073742335==a[1].tok))break;if(10==a[0].tok&&(2==a[1].tok||10==a[1].tok))break}if(null==(c=d.ptValue(a[0],null))||134221850!=b&&8==a[1].tok)return!1;break;case 3:if(134221850!=
b)return!1;if(9==a[0].tok){if(8!=a[2].tok&&10!=a[2].tok)return!1;break}for(var g=0;3>g;g++)if(8!=a[g].tok&&10!=a[g].tok)return!1;break;default:return!1}var k=g=null,j=null;switch(e){case 0:return d.addXPt4(this.vwr.tm.getRotationQ().toPoint4f());default:if(134221850==b&&7==a[0].tok){b=this.e.getQuaternionArray(a[0].getList(),1073742001);a=JU.Quat.sphereMean(b,null,1E-4);g=y(a,JU.Quat)?a:null;break}else if(134221850==b&&10==a[0].tok)k=this.vwr.getAtomGroupQuaternions(a[0].value,f);else if(11==a[0].tok)g=
JU.Quat.newM(a[0].value);else if(9==a[0].tok)j=a[0].value;else if(j=JS.SV.sValue(a[0]),j=JU.Escape.uP(j.equalsIgnoreCase("best")?this.vwr.getOrientation(1073741864,"best",null).toString():j),!y(j,JU.P4))return!1;134217731==b&&(g=JU.Quat.newVA(JU.P3.new3(j.x,j.y,j.z),j.w));break;case 2:if(134221850==b){if(7==a[0].tok&&7==a[1].tok){b=this.e.getQuaternionArray(a[0].getList(),1073742001);k=this.e.getQuaternionArray(a[1].getList(),1073742001);k=JU.Quat.div(k,b,f,h);break}if(7==a[0].tok&&1073742335==a[1].tok)return b=
this.e.getQuaternionArray(a[0].getList(),1073742001),f=C(1,0),JU.Quat.sphereMean(b,f,1E-4),d.addXFloat(f[0]);if(10==a[0].tok&&10==a[1].tok){b=this.vwr.getAtomGroupQuaternions(a[0].value,2147483647);k=this.vwr.getAtomGroupQuaternions(a[1].value,2147483647);k=JU.Quat.div(k,b,f,h);break}}g=d.ptValue(a[1],null);j=this.e.planeValue(a[0]);g=null!=g?JU.Quat.getQuaternionFrame(JU.P3.new3(0,0,0),c,g):JU.Quat.newVA(c,JS.SV.fValue(a[1]));break;case 3:if(9==a[0].tok)return f=8==a[2].tok?a[2].value:this.vwr.ms.getAtomSetCenter(a[2].value),
d.addXStr(JU.Escape.drawQuat(JU.Quat.newP4(a[0].value),"q",JS.SV.sValue(a[1]),f,1));b=Array(3);for(g=0;3>g;g++)b[g]=8==a[g].tok?a[g].value:this.vwr.ms.getAtomSetCenter(a[g].value);g=JU.Quat.getQuaternionFrame(b[0],b[1],b[2]);break;case 4:134221850==b?j=JU.P4.new4(JS.SV.fValue(a[1]),JS.SV.fValue(a[2]),JS.SV.fValue(a[3]),JS.SV.fValue(a[0])):g=JU.Quat.newVA(JU.P3.new3(JS.SV.fValue(a[0]),JS.SV.fValue(a[1]),JS.SV.fValue(a[2])),JS.SV.fValue(a[3]))}if(null!=k){if(2147483647!=f){f=new JU.Lst;for(g=0;g<k.length;g++)f.addLast(k[g].toPoint4f());
return d.addXList(f)}g=0<k.length?k[0]:null}return d.addXPt4((null==g?JU.Quat.newP4(j):g).toPoint4f())},"JS.ScriptMathProcessor,~A,~N");m(c$,"evaluateRandom",function(d,a){if(3<a.length)return!1;null==this.rand&&(this.rand=new java.util.Random);var b=0,c=1;switch(a.length){case 3:this.rand.setSeed($(JS.SV.fValue(a[2])));case 2:c=JS.SV.fValue(a[1]);case 1:b=JS.SV.fValue(a[0]);case 0:break;default:return!1}return d.addXFloat(this.rand.nextFloat()*(c-b)+b)},"JS.ScriptMathProcessor,~A");m(c$,"evaluateRowCol",
function(d,a,b){if(1!=a.length)return!1;a=a[0].asInt()-1;var c=d.getX();switch(c.tok){case 11:if(0>a||2<a)break;c=c.value;switch(b){case 1275068935:return b=C(3,0),c.getRow(a,b),d.addXAF(b);default:return b=C(3,0),c.getColumn(a,b),d.addXAF(b)}case 12:if(0>a||2<a)break;c=c.value;switch(b){case 1275068935:return b=C(4,0),c.getRow(a,b),d.addXAF(b);default:return b=C(4,0),c.getColumn(a,b),d.addXAF(b)}case 7:b=c.getList();for(var c=new JU.Lst,e=0,f=b.size();e<f;e++){var h=b.get(e).getList();if(null==h)return d.addXStr("");
c.addLast(a<h.size()?h.get(a):JS.SV.newS(""))}return d.addXList(c)}return!1},"JS.ScriptMathProcessor,~A,~N");m(c$,"evaluateIn",function(d,a){var b=d.getX();switch(a.length){case 1:var c=a[0].getList();if(null!=c)for(var e=0,f=c.size();e<f;e++)if(JS.SV.areEqual(b,c.get(e)))return d.addXInt(e+1);break;default:for(e=0;e<a.length;e++)if(JS.SV.areEqual(b,a[e]))return d.addXInt(e+1)}return d.addXInt(0)},"JS.ScriptMathProcessor,~A");m(c$,"evaluateReplace",function(d,a){var b=!1,c,e;switch(a.length){case 0:b=
!0;c=e=null;break;case 3:b=JS.SV.bValue(a[2]);case 2:c=JS.SV.sValue(a[0]);e=JS.SV.sValue(a[1]);break;default:return!1}var f=d.getX();if(7==f.tok){for(var f=JS.SV.strListValue(f),h=Array(f.length),g=f.length;0<=--g;)h[g]=null==c?JU.PT.clean(f[g]):b?JU.PT.replaceAllCharacters(f[g],c,e):JU.PT.rep(f[g],c,e);return d.addXAS(h)}f=JS.SV.sValue(f);return d.addXStr(null==c?JU.PT.clean(f):b?JU.PT.replaceAllCharacters(f,c,e):JU.PT.rep(f,c,e))},"JS.ScriptMathProcessor,~A");m(c$,"evaluateScript",function(d,a,
b){if((134222350==b||134238732==b)&&1!=a.length||0==a.length)return!1;var c=JS.SV.sValue(a[0]),e=new JU.SB;switch(b){case 134218759:return 2==a.length?c.equalsIgnoreCase("JSON")&&d.addXObj(this.vwr.parseJSON(JS.SV.sValue(a[1]))):d.addXObj(this.vwr.evaluateExpressionAsVariable(c));case 134222850:a=2==a.length?JS.SV.sValue(a[1]):".";a.equals(".")||e.append(this.vwr.jsEval(a+"\u0001"+c));(a.equals(".")||a.equals("*"))&&this.e.runScriptBuffer(c,e,!0);break;case 134222350:this.e.runScriptBuffer("show "+
c,e,!0);break;case 134238732:return d.addX(this.vwr.jsEvalSV(c))}var c=e.toString(),f;return Float.isNaN(f=JU.PT.parseFloatStrict(c))?d.addXStr(c):0<=c.indexOf(".")?d.addXFloat(f):d.addXInt(JU.PT.parseInt(c))},"JS.ScriptMathProcessor,~A,~N");m(c$,"evaluateSort",function(d,a,b){if(1<a.length)return!1;if(1275068444==b){if(1==a.length&&4==a[0].tok)return d.addX(d.getX().sortMapArray(a[0].asString()));var c=0==a.length?0:a[0].asInt();return d.addX(d.getX().sortOrReverse(c))}b=d.getX();a=0==a.length?null:
a[0];if(4==b.tok){var c=0,e=JS.SV.sValue(b);if(null==a)return d.addXInt(0);a=JS.SV.sValue(a);for(b=0;b<e.length;b++){b=e.indexOf(a,b);if(0>b)break;c++}return d.addXInt(c)}var c=new JU.Lst,f=e=null,h=JS.SV.getVariable(b.value).sortOrReverse(0).getList();if(null==h)return null==a?d.addXStr(""):d.addXInt(0);b=0;for(var g=h.size();b<=g;b++){var k=b==g?null:h.get(b);if(!(null!=a&&null!=k&&!JS.SV.areEqual(k,a)))if(JS.SV.areEqual(k,e))f.intValue++;else{if(null!=e){var j=new JU.Lst;j.addLast(e);j.addLast(f);
c.addLast(JS.SV.getVariableList(j))}f=JS.SV.newI(1);e=k}}return null==a?d.addX(JS.SV.getVariableList(c)):c.isEmpty()?d.addXInt(0):d.addX(c.get(0).getList().get(1))},"JS.ScriptMathProcessor,~A,~N");m(c$,"evaluateString",function(d,a,b){var c=d.getX(),e=0<b.length?JS.SV.sValue(b[0]):1275068932==a?"":"\n";switch(b.length){case 0:break;case 1:if(1073742335==b[0].tok)return d.addX(JS.SV.getVariable(JU.PT.getTokens(c.asString())));break;case 2:if(7==c.tok)break;if(1275069447==a){c=JS.SV.getVariable(JU.PT.split(JU.PT.rep(c.value,
"\n\r","\n").$replace("\r","\n"),"\n"));break}default:return!1}if(7==c.tok&&1275068932!=a&&(1275069447!=a||2==b.length))return d.addX(c),this.evaluateList(d,a,b);b=1275069447==a&&10==c.tok||1275068932==a&&7==c.tok?null:JS.SV.sValue(c);switch(a){case 1275069447:if(10==c.tok){e=c.value;c=this.vwr.ms.mc;b=new JU.Lst;for(a=0;a<c;a++){var f=this.vwr.getModelUndeletedAtomsBitSet(a);f.and(e);b.addLast(JS.SV.getVariable(f))}return d.addXList(b)}return d.addXAS(JU.PT.split(b,e));case 1275069446:return 0<b.length&&
"\n"==b.charAt(b.length-1)&&(b=b.substring(0,b.length-1)),d.addXStr(JU.PT.rep(b,"\n",e));case 1275068932:if(null!=b)return d.addXStr(JU.PT.trim(b,e));c=JS.SV.strListValue(c);for(a=c.length;0<=--a;)c[a]=JU.PT.trim(c[a],e);return d.addXAS(c)}return d.addXStr("")},"JS.ScriptMathProcessor,~N,~A");m(c$,"evaluateSubstructure",function(d,a,b,c){if(0==a.length||c&&1<a.length)return!1;var e=new JU.BS,f=JS.SV.sValue(a[0]);if(0<f.length)try{var h=c?d.getX().value:2==a.length&&10==a[1].tok?a[1].value:this.vwr.getModelUndeletedAtomsBitSet(-1),
e=this.vwr.getSmilesMatcher().getSubstructureSet(f,this.vwr.ms.at,this.vwr.ms.ac,h,134218757==b?1:2)}catch(g){if(L(g,Exception))this.e.evalError(g.getMessage(),null);else throw g;}return d.addXBs(e)},"JS.ScriptMathProcessor,~A,~N,~B");m(c$,"evaluateSymop",function(d,a,b){var c=b?d.getX():null,e=!1;if(null!=c&&10!=c.tok&&!(e=8==c.tok))return!1;var f=null==c||e?null:c.value,c=e?JS.SV.ptValue(c):null;!e&&null==f&&(f=this.vwr.getThisModelAtoms());if(null!=f&&f.isEmpty())return!1;var h=a.length;if(0==
h){for(var c=JU.PT.split(JU.PT.trim(this.vwr.getSymTemp().getSpaceGroupInfo(this.vwr.ms,null,this.vwr.ms.at[f.nextSetBit(0)].mi,!1,null).get("symmetryInfo"),"\n"),"\n"),e=new JU.Lst,g=0,k=c.length;g<k;g++)e.addLast(JU.PT.split(c[g],"\t"));return d.addXList(e)}var j=null,l=!1,e=-2147483648,m=0,n=null;switch(a[0].tok){case 4:j=JS.SV.sValue(a[0]);m++;break;case 12:j=a[0].escape();m++;break;case 2:e=a[0].asInt(),m++}if((l=null!=j&&j.equalsIgnoreCase("invariant"))&&-2147483648==e)return g=null,null!=c?
(g=this.vwr.getCurrentUnitCell(),g=null==g?O(0,0):g.getInvariantSymops(c,null)):null!=f&&(g=this.vwr.ms.getSymmetryInvariant(f.nextSetBit(0))),null!=g&&d.addXAI(g);null==f&&(m<h&&10==a[m].tok&&(f=new JU.BS).or(a[m].value),m+1<h&&10==a[m+1].tok&&(null==f?f=new JU.BS:f).or(a[m+1].value));var s=null;if(h>m&&7==a[m].tok){l=a[m++].getList();if(3!=l.size())return!1;s=JU.P3.new3(JS.SV.fValue(l.get(0)),JS.SV.fValue(l.get(1)),JS.SV.fValue(l.get(2)))}else h>m&&2==a[m].tok&&JU.SimpleUnitCell.ijkToPoint3f(JS.SV.iValue(a[m++]),
s=new JU.P3,0,0);null==c&&null!=(c=h>m?d.ptValue(a[m],f):null)&&m++;null!=(n=h>m?d.ptValue(a[m],f):null)&&m++;l=null!=n&&a.length>m&&-2147483648==e&&2==a[m].tok?a[m].intValue:-1;0<=l&&m++;-2147483648==e&&(e=0);var p=null;null!=j&&0>j.indexOf(",")&&(m==h?p=this.vwr.ms.getPointGroupInfo(null):6==a[m].tok&&(p=a[m].getMap()));if(null!=p){a=j.indexOf(".");b=j.indexOf("^");0<b?l=JU.PT.parseInt(j.substring(b+1)):(b=j.length,l=1);0<a&&b>a+1?(e=JU.PT.parseInt(j.substring(a+1,b)),1>e&&(e=1),b=a):e=1;j=j.substring(0,
b);a=p.get(j+"_m");if(null==a)return a=p.get(j),null==a?d.addXStr(""):d.addXObj(a);var q;try{if(y(a,JS.SV))if(q=p.get("center").value,j=a,11==j.tok)k=j.value;else if(7==j.tok)k=j.getList().get(e-1).value;else return!1;else q=p.get("center"),k=y(a,JU.M3)?a:a.get(e-1);e=k;k=JU.M3.newM3(k);if(1<l)for(g=1;g<l;g++)k.mul(e);if(null==c)return d.addXObj(k);c=JU.P3.newP(c);c.sub(q);k.rotate(c);c.add(q);return d.addXPt(c)}catch(x){if(L(x,Exception))return!1;throw x;}}g=h==m?null!=n?"all":null!=c?"point":"matrix":
JS.SV.sValue(a[m++]).toLowerCase();q=(k=null!=f&&!f.isEmpty())?f.nextSetBit(0):-1;g.equals("invariant")&&b&&(k&&null==c&&(c=this.vwr.ms.at[q]),k=null!=c,0>q&&(q=this.vwr.getThisModelAtoms().nextSetBit(0)));return k&&m==a.length&&d.addXObj(this.vwr.getSymmetryInfo(q,j,e,s,c,n,1275068418,g,0,l,0))},"JS.ScriptMathProcessor,~A,~B");m(c$,"evaluateTensor",function(d,a){var b=2==a.length&&1275068445==a[1].tok,c=b?null:d.getX();if(2<a.length||!b&&10!=c.tok)return!1;var c=c.value,e=b||0==a.length?null:JS.SV.sValue(a[0]).toLowerCase(),
f=this.vwr.getNMRCalculation();if("unique".equals(e))return d.addXBs(f.getUniqueTensorSet(c));var h=2>a.length?null:JS.SV.sValue(a[1]).toLowerCase();return b?d.addXObj(a[0].value.getInfo(h)):d.addXList(f.getTensorInfo(e,h,c))},"JS.ScriptMathProcessor,~A");m(c$,"evaluateUserFunction",function(d,a,b,c,e){var f=null;if(e)switch(f=d.getX(),f.tok){case 10:break;case 6:if(0<b.length)return!1;f=f.getMap().get(a);return null==f?d.addXStr(""):d.addX(f);default:return!1}a=a.toLowerCase();d.wasX=!1;for(var h=
new JU.Lst,g=0;g<b.length;g++)h.addLast(b[g]);if(e)return d.addXObj(this.e.getBitsetProperty(f.value,null,c,null,null,f.value,x(-1,[a,h]),!1,f.index,!1));a=this.e.getUserFunctionResult(a,h,null);return null==a?!1:d.addX(a)},"JS.ScriptMathProcessor,~S,~A,~N,~B");m(c$,"evaluateWithin",function(d,a,b){var c=a.length;if(1>c||5<c)return!1;if(1==c&&10==a[0].tok)return d.addX(a[0]);var e=b?JS.SV.getBitSet(d.getX(),!1):null,f=0,h=a[0].value,g=""+h,k=this.vwr.ms,j=!1,l=!1,m=!1,n=!1,s=null,p=a[0].tok;switch(4==
p?p=JS.T.getTokFromName(g):p){case 1648363544:j=!0,h=null;case 3:case 2:n=!0;if(2>c||3==c&&7==a[1].tok&&7!=a[2].tok)return!1;f=j?100:JS.SV.fValue(a[0]);switch(p=a[1].tok){case 1073742335:case 1073742334:l=a[1].asBoolean();if(2<c&&JS.SV.sValue(a[2]).equalsIgnoreCase("unitcell"))p=1814695966;else if(2<c&&10!=a[2].tok)return!1;c=0;break;case 4:p=JS.SV.sValue(a[1]);if(p.startsWith("$"))return d.addXBs(this.getAtomsNearSurface(f,p.substring(1)));if(p.equalsIgnoreCase("group"))m=!0,p=1086324742;else if(p.equalsIgnoreCase("vanderwaals")||
p.equalsIgnoreCase("vdw"))h=null,j=!0,p=1648363544;else if(p=JS.T.getTokFromName(p),0==p)return!1}break;case 7:1==c&&(h=a[0].asString(),p=0);break;case 1073742328:return 3==c&&y(a[1].value,JU.BS)&&y(a[2].value,JU.BS)&&d.addXBs(this.vwr.getBranchBitSet(a[2].value.nextSetBit(0),a[1].value.nextSetBit(0),!0));case 134218757:case 1237320707:case 134218756:f=null;b=!0;switch(c){case 2:f=e;break;case 3:if(b=10==a[2].tok)f=a[2].value;break;default:b=!1}return b&&d.addXObj(this.e.getSmilesExt().getSmilesMatches(JS.SV.sValue(a[1]),
null,f,null,134218756==p?2:1,d.asBitSet,!1))}if(y(h,String)){if(0==p){p=1073742362;if(2<c)return!1;c=2}}else if(!n)return!1;switch(c){case 1:switch(p){case 136314895:case 2097184:case 1678381065:case 1814695966:return d.addXBs(k.getAtoms(p,null));case 1073741863:return d.addXBs(k.getAtoms(p,""));case 1073742362:return d.addXBs(k.getAtoms(1086324744,g))}return!1;case 2:switch(p){case 1073742362:p=1086324744;break;case 1073741824:case 1086326786:case 1086326785:case 1073741863:case 1086324744:case 1111490587:case 1073742128:case 1073741925:case 1073742189:return d.addXBs(this.vwr.ms.getAtoms(p,
JS.SV.sValue(a[1])));case 1094713349:case 1094713350:return d.addXBs(this.vwr.ms.getAtoms(p,JS.SV.ptValue(a[1])));case 1814695966:e=a[1].getList();if(null==e)return!1;f=f=null;if(4!=e.size())return!1;f=Array(4);for(a=0;4>a;a++)if(null==(f[a]=JS.SV.ptValue(e.get(a))))return!1;f=this.vwr.getSymTemp().getUnitCell(f,!1,null);return d.addXBs(this.vwr.ms.getAtoms(p,f))}break;case 3:switch(p){case 1073742335:case 1073742334:case 1086324742:case 1648363544:case 1814695966:case 134217750:case 134219777:case 1073742329:case 8:case 7:break;
case 1086324744:g=JS.SV.sValue(a[2]);break;default:return!1}}var q=null,h=c=null,x=a.length-1;switch(a[x].tok){case 9:q=a[x].value;break;case 8:c=a[x].value;JS.SV.sValue(a[1]).equalsIgnoreCase("hkl")&&(q=this.e.getHklPlane(c,NaN,null));break;case 7:h=2==x&&7==a[1].tok?a[1].getList():null,c=2==x?JS.SV.ptValue(a[1]):1==x?JU.P3.new3(NaN,0,0):null}if(null!=q)return d.addXBs(k.getAtomsNearPlane(f,q));k=10==a[x].tok?a[x].value:null;null==e&&(e=k);if(0<x&&null==c&&null==h&&null==e)return!1;if(1814695966==
p)return(null!=e||null!=c)&&d.addXObj(this.vwr.ms.getUnitCellPointsWithin(f,e,c,l));if(null!=c||null!=h){if(7==a[x].tok){b=a[x].getList();p=Array(b.size());for(a=p.length;0<=--a;)p[a]=JS.SV.ptValue(b.get(a));b=null;if(null!=h){b=Array(h.size());for(a=b.length;0<=--a;)b[a]=JS.SV.ptValue(h.get(a))}a=Array(1);null!=e&&(e.and(this.vwr.getAllAtoms()),b=this.vwr.ms.at);switch(J.bspt.PointIterator.withinDistPoints(f,c,p,b,e,a)){case 10:return d.addXBs(a[0]);case 134217751:return d.addXPt(a[0]);case 1073742001:return d.addXList(a[0]);
case 1275068418:return d.addXAI(a[0]);case 4:return d.addXStr(a[0]);default:return!1}}return d.addXBs(this.vwr.getAtomsNearPt(f,c,null))}if(1086324744==p)return d.addXBs(this.vwr.ms.getSequenceBits(g,e,new JU.BS));null==e&&(e=new JU.BS);if(!n)try{return d.addXBs(this.vwr.ms.getAtoms(p,e))}catch(t){if(L(t,Exception))return!1;throw t;}if(m)return d.addXBs(this.vwr.getGroupsWithin($(f),e));j&&(s=new J.atomdata.RadiusData(null,10<f?f/100:f,10<f?J.atomdata.RadiusData.EnumType.FACTOR:J.atomdata.RadiusData.EnumType.OFFSET,
J.c.VDW.AUTO),0>f&&(f=0));e=this.vwr.ms.getAtomsWithinRadius(f,b?k:e,l,s,b?e:null);b&&e.andNot(k);return d.addXBs(e)},"JS.ScriptMathProcessor,~A,~B");m(c$,"evaluateWrite",function(d,a){var b=a.length,c=!1;2==b&&1073742335==a[1].tok&&(b=1,c=!0);switch(b){case 0:return!1;case 1:var e=a[0].asString().toUpperCase();if(e.equals("PNGJ"))return b=this.vwr.fm.getFileAsMap(null,"PNGJ",c),c?d.addX(JS.SV.newV(15,new JU.BArray(b))):d.addXMap(b);if(JU.PT.isOneOf(e,";ZIP;ZIPALL;JMOL;")){var b=new java.util.Hashtable,
f=new JU.OC;b.put("outputChannel",f);this.vwr.createZip(null,e,b);e=f.toByteArray();if(c)return d.addX(JS.SV.newV(15,new JU.BArray(e)));b=new java.util.Hashtable;this.vwr.readFileAsMap(JU.Rdr.getBIS(e),b,null);return d.addXMap(b)}}return d.addXStr(this.e.getCmdExt().dispatch(134221856,!0,a))},"JS.ScriptMathProcessor,~A");m(c$,"getAtomsNearSurface",function(d,a){var b=x(-1,[a,null,null]);if(this.e.getShapePropertyData(24,"getVertices",b))return this.getAtomsNearPts(d,b[1],b[2]);b[1]=Integer.$valueOf(0);
b[2]=Integer.$valueOf(-1);if(this.e.getShapePropertyData(22,"getCenter",b))return this.vwr.getAtomsNearPt(d,b[2],null);b[1]=Float.$valueOf(d);return this.e.getShapePropertyData(21,"getAtomsWithin",b)?b[2]:new JU.BS},"~N,~S");m(c$,"getAtomsNearPts",function(d,a,b){var c=new JU.BS;if(0==a.length||null!=b&&b.isEmpty())return c;null==b&&(b=JU.BSUtil.setAll(a.length));for(var e=this.vwr.ms.at,f=this.vwr.ms.ac;0<=--f;){var h=e[f];if(null!=h)for(var g=b.nextSetBit(0);0<=g;g=b.nextSetBit(g+1))if(h.distance(a[g])<
d){c.set(f);break}}return c},"~N,~A,JU.BS");m(c$,"getMinMax",function(d,a,b){for(var c=null,e=null,f=0,h=null;;){if(JU.AU.isAF(d)){if(1275068725==a)return NaN;c=d;f=c.length;if(0==f)break}else if(y(d,JU.Lst))if(e=d,f=e.size(),0==f){if(1275068725!=a)break}else{if(1275068725!=a){d=e.get(0);if(8==d.tok)return this.getMinMaxPoint(e,a);if(4==d.tok&&d.value.startsWith("{")){b=JS.SV.ptValue(d);if(y(b,JU.P3))return this.getMinMaxPoint(e,a);if(y(b,JU.P4))return this.getMinMaxQuaternion(e,a);break}}}else break;
var g,k=!1;switch(a){case 1275068725:h=new java.util.Hashtable;d=g=0;break;case 32:k=!0;d=3.4028235E38;g=2147483647;break;case 64:d=-3.4028235E38;g=-2147483647;break;default:d=g=0}for(var j=0,l=0,m=!0,n=1275068725==a;0<=--f;){var s=null==e?null:e.get(f),p=!b?null:null==s?JS.SV.vF:s,q=n?1:null==c?JS.SV.fValue(p):c[f];if(!Float.isNaN(q))switch(l++,a){case 160:case 192:j+=q*q;case 128:case 96:d+=q;break;case 1275068725:s=null==p?s.toString():p.asString();p=h.get(s);h.put(s,null==p?new Integer(1):new Integer(p.intValue()+
1));break;case 32:case 64:m=(new Boolean(m&2==p.tok)).valueOf(),k==q<d&&(d=q,m&&(g=p.intValue))}}if(1275068725==a)return h;if(0==l)break;switch(a){case 96:d/=l;break;case 192:if(1==l)break;d=Math.sqrt((j-d*d/l)/(l-1));break;case 32:case 64:if(m)return Integer.$valueOf(g);break;case 160:d=j}return Float.$valueOf(d)}return JS.MathExt.nan},"~O,~N,~B");m(c$,"getMinMaxPoint",function(d,a){var b=null,c=null,e=0;y(d,Array)?(b=d,e=b.length):y(d,JU.Lst)&&(c=d,e=c.size());if(null==c&&null==b)return JS.MathExt.nan;
for(var f=new JU.P3,h=C(e,0),g=0;3>g;g++){for(var k=0;k<e;k++){var j=null==b?JS.SV.ptValue(c.get(k)):b[k];if(null==j)return JS.MathExt.nan;switch(g){case 0:h[k]=j.x;break;case 1:h[k]=j.y;break;case 2:h[k]=j.z}}k=this.getMinMax(h,a,!0);if(!y(k,Number))return JS.MathExt.nan;k=k.floatValue();switch(g){case 0:f.x=k;break;case 1:f.y=k;break;case 2:f.z=k}}return f},"~O,~N");m(c$,"getMinMaxQuaternion",function(d,a){var b;switch(a){case 32:case 64:case 128:case 160:return JS.MathExt.nan}for(;;){b=this.e.getQuaternionArray(d,
1073742001);if(null==b)break;var c=C(1,0);b=JU.Quat.sphereMean(b,c,1E-4);switch(a){case 96:return b;case 192:return Float.$valueOf(c[0])}break}return JS.MathExt.nan},"JU.Lst,~N");m(c$,"getPatternMatcher",function(){return null==this.pm?this.pm=J.api.Interface.getUtil("PatternMatcher",this.e.vwr,"script"):this.pm});m(c$,"opTokenFor",function(d){switch(d){case 1275069441:case 1275069446:return JS.T.tokenPlus;case 1275068931:return JS.T.tokenMinus;case 1275068929:return JS.T.tokenTimes;case 1275068930:return JS.T.tokenMul3;
case 1275068928:return JS.T.tokenDivide}return null},"~N");m(c$,"setContactBitSets",function(d,a,b,c,e,f){var h,g;null==a?(a=JU.BSUtil.setAll(this.vwr.ms.ac),JU.BSUtil.andNot(a,this.vwr.slm.bsDeleted),a.andNot(d),h=!1):(g=JU.BSUtil.copy(d),g.or(a),g=this.vwr.ms.getModelBS(g,!1).cardinality(),h=1<g,f&&(1<g&&!this.e.tQuiet)&&this.e.showString(J.i18n.GT.$("Note: More than one model is involved in this contact!")));if(!d.equals(a)){if(f=!b||d.cardinality()<a.cardinality())g=this.vwr.ms.getAtomsWithinRadius(c,
d,h,Float.isNaN(c)?e:null,null),a.and(g);b&&(g=this.vwr.ms.getAtomsWithinRadius(c,a,h,Float.isNaN(c)?e:null,null),d.and(g),f||(g=this.vwr.ms.getAtomsWithinRadius(c,d,h,Float.isNaN(c)?e:null,null),a.and(g)),g=JU.BSUtil.copy(a),g.and(d),g.equals(d)?a.andNot(d):g.equals(a)&&d.andNot(a))}return a},"JU.BS,JU.BS,~B,~N,J.atomdata.RadiusData,~B");c$.nan=c$.prototype.nan=Float.$valueOf(NaN);c$.t0=c$.prototype.t0=System.currentTimeMillis()});Y("J.bspt");Z(null,"J.bspt.PointIterator","java.lang.Float JU.BS $.Lst $.P3 J.bspt.Bspt JU.BSUtil $.Point3fi".split(" "),
function(){c$=la(J.bspt,"PointIterator");c$.withinDistPoints=m(c$,"withinDistPoints",function(d,a,b,c,e,f){var h=new JU.Lst,g=new J.bspt.Bspt(3,0),k;if(null!=a&&Float.isNaN(a.x)){for(var j=Array(b.length),l=j.length;0<=--l;){k=b[l];if(null==k)return 0;null==e?(a=new JU.Point3fi,a.setT(k),a.i=l,j[l]=a,g.addTuple(a)):g.addTuple(k)}k=g.allocateCubeIterator();if(null!=e){b=JU.BS.newN(c.length);for(l=e.nextSetBit(0);0<=l;l=e.nextSetBit(l+1)){k.initialize(c[l],d,!1);for(g=d*d;k.hasMoreElements();)if(k.nextElement().distanceSquared(c[l])<=
g){b.set(l);break}}f[0]=b;return 10}b=JU.BSUtil.newBitSet2(0,b.length);for(l=j.length;0<=--l;){k.initialize(a=j[l],d,!1);g=d*d;for(e=0;k.hasMoreElements();)c=k.nextElement(),b.get(c.i)&&(c.distanceSquared(a)<=g&&1<++e)&&b.clear(c.i)}for(l=b.nextSetBit(0);0<=l;l=b.nextSetBit(l+1))h.addLast(JU.P3.newP(j[l]));f[0]=h;return 1073742001}if(0==d){if(null==c){g=3.4028235E38;j=null;for(l=b.length;0<=--l;)h=b[l],d=h.distanceSquared(a),d<g&&(j=h,g=d);f[0]=null==j?"":j;return null==j?4:134217751}j=O(c.length,
0);for(l=j.length;0<=--l;){g=3.4028235E38;e=-1;a=c[l];for(k=b.length;0<=--k;)h=b[k],d=h.distanceSquared(a),d<g&&(e=k,g=d);j[l]=e}f[0]=j;return 1275068418}for(l=b.length;0<=--l;)g.addTuple(b[l]);k=g.allocateCubeIterator();k.initialize(a,d,!1);for(g=d*d;k.hasMoreElements();)c=k.nextElement(),c.distanceSquared(a)<=g&&h.addLast(c);k.release();f[0]=h;return 1073742001},"~N,JU.P3,~A,~A,JU.BS,~A")})})(Clazz,Clazz.getClassName,Clazz.newLongArray,Clazz.doubleToByte,Clazz.doubleToInt,Clazz.doubleToLong,Clazz.declarePackage,
Clazz.instanceOf,Clazz.load,Clazz.instantialize,Clazz.decorateAsClass,Clazz.floatToInt,Clazz.floatToLong,Clazz.makeConstructor,Clazz.defineEnumConstant,Clazz.exceptionOf,Clazz.newIntArray,Clazz.defineStatics,Clazz.newFloatArray,Clazz.declareType,Clazz.prepareFields,Clazz.superConstructor,Clazz.newByteArray,Clazz.declareInterface,Clazz.p0p,Clazz.pu$h,Clazz.newShortArray,Clazz.innerTypeInstance,Clazz.isClassDefined,Clazz.prepareCallback,Clazz.newArray,Clazz.castNullAs,Clazz.floatToShort,Clazz.superCall,
Clazz.decorateAsType,Clazz.newBooleanArray,Clazz.newCharArray,Clazz.implementOf,Clazz.newDoubleArray,Clazz.overrideConstructor,Clazz.clone,Clazz.doubleToShort,Clazz.getInheritedLevel,Clazz.getParamsType,Clazz.isAF,Clazz.isAB,Clazz.isAI,Clazz.isAS,Clazz.isASS,Clazz.isAP,Clazz.isAFloat,Clazz.isAII,Clazz.isAFF,Clazz.isAFFF,Clazz.tryToSearchAndExecute,Clazz.getStackTrace,Clazz.inheritArgs,Clazz.alert,Clazz.defineMethod,Clazz.overrideMethod,Clazz.declareAnonymous,Clazz.cloneFinals);
