(function(T,U,V,Q,W,y,F,E,G,H,X,Y,K,Z,I,A,L,R,O,M,P,$,S,aa,ba,ca,da,ea,fa,N,ga,ha,ia,ja,ka,la,ma,na,oa,pa,qa,ra,sa,ta,ua,va,wa,xa,ya,za,Aa,Ba,Ca,Da,Ea,Fa,h,n){y("JS");E(["JU.BS","$.V3"],"JS.VTemp",null,function(){c$=H(function(){this.bsTemp=this.vNorm3=this.vNorm2=this.vNorm1=this.vTemp2=this.vTemp1=this.vB=this.vA=this.vTemp=null;G(this,arguments)},JS,"VTemp");M(c$,function(){this.vTemp=new JU.V3;this.vA=new JU.V3;this.vB=new JU.V3;this.vTemp1=new JU.V3;this.vTemp2=new JU.V3;this.vNorm1=new JU.V3;
this.vNorm2=new JU.V3;this.vNorm3=new JU.V3;this.bsTemp=new JU.BS})});y("J.api");S(J.api,"SmilesMatcherInterface");y("JS");E(["J.api.SmilesMatcherInterface"],"JS.SmilesMatcher","JU.AU $.BS $.PT JS.InvalidSmilesException $.SmilesAtom $.SmilesBond $.SmilesGenerator $.SmilesParser JU.BSUtil $.Node $.Point3fi".split(" "),function(){c$=O(JS,"SmilesMatcher",null,J.api.SmilesMatcherInterface);h(c$,"checkFlag",function(a,b){return(a&b)==b},"~N,~N");n(c$,"getLastException",function(){return JS.InvalidSmilesException.getLastError()});
n(c$,"getMolecularFormula",function(a,b){JS.InvalidSmilesException.clear();var c=JS.SmilesParser.getMolecule(a,b);c.createTopoMap(null);c.nodes=c.jmolAtoms;return c.getMolecularFormula(!b,null,!1)},"~S,~B");n(c$,"getSmiles",function(a,b,c,e,d){JS.InvalidSmilesException.clear();if(this.checkFlag(d,256)){var f=this.checkFlag(d,257);d=this.checkFlag(d,258);return(new JS.SmilesGenerator).getBioSmiles(a,b,c,f,d,e)}e=this.checkFlag(d,1);f=this.checkFlag(d,2);d=!this.checkFlag(d,4);return(new JS.SmilesGenerator).getSmiles(a,
b,c,e,f,d)},"~A,~N,JU.BS,~S,~N");n(c$,"areEqual",function(a,b){JS.InvalidSmilesException.clear();var c=this.findPriv(a,JS.SmilesParser.getMolecule(b,!1),(0<=a.indexOf("*")?131072:1114112)|4202496);return null==c?-1:c.length},"~S,~S");h(c$,"areEqualTest",function(a,b){var c=this.findPriv(a,b,5316608);return null!=c&&1==c.length},"~S,JS.SmilesSearch");n(c$,"find",function(a,b,c,e){JS.InvalidSmilesException.clear();b=JS.SmilesParser.cleanPattern(b);a=JS.SmilesParser.cleanPattern(a);b=JS.SmilesParser.getMolecule(b,
!1);return this.findPriv(a,b,(c?131072:1114112)|(e?4194304:0)|12288)},"~S,~S,~B,~B");n(c$,"getRelationship",function(a,b){if(null==a||null==b||0==a.length||0==b.length)return"";var c=this.getMolecularFormula(a,!1),e=this.getMolecularFormula(b,!1);if(!c.equals(e))return"none";var d,c=JS.SmilesMatcher.countStereo(a),e=JS.SmilesMatcher.countStereo(b);d=c==e&&0<this.areEqual(b,a);if(!d){d=a+b;if(0<=d.indexOf("/")||0<=d.indexOf("\\")||0<=d.indexOf("@")){if(c==e&&0<c&&(a=this.reverseChirality(a),d=0<this.areEqual(a,
b)))return"enantiomers";if(d=0<this.areEqual("/nostereo/"+b,a))return c==e?"diastereomers":"ambiguous stereochemistry!"}return"constitutional isomers"}return"identical"},"~S,~S");n(c$,"reverseChirality",function(a){a=JU.PT.rep(a,"@@","!@");a=JU.PT.rep(a,"@","@@");a=JU.PT.rep(a,"!@@","@");a=JU.PT.rep(a,"@@SP","@SP");a=JU.PT.rep(a,"@@OH","@OH");return a=JU.PT.rep(a,"@@TB","@TB")},"~S");n(c$,"getSubstructureSet",function(a,b,c,e,d){return this.matchPriv(a,b,c,e,null,d|2101248)},"~S,~A,~N,JU.BS,~N");
n(c$,"getSubstructureSets",function(a,b,c,e,d,f,j){JS.InvalidSmilesException.clear();var k=new JS.SmilesParser(!0),g=null,g=k.parse("");g.firstMatchOnly=!1;g.matchAllAtoms=!1;g.jmolAtoms=b;g.jmolAtomCount=Math.abs(c);g.setSelected(d);g.getRingData(!0,e,j);g.asVector=!1;g.subSearches=Array(1);g.getSelections();b=new JU.BS;for(d=0;d<a.length;d++)if(null==a[d]||0==a[d].length||a[d].startsWith("#"))f.addLast(null);else if(g.clear(),j=k.getSearch(g,JS.SmilesParser.cleanPattern(a[d]),e),g.subSearches[0]=
j,j=JU.BSUtil.copy(g.search(!1)),f.addLast(j),b.or(j),b.cardinality()==c)break},"~A,~A,~N,~N,JU.BS,JU.Lst,~A");n(c$,"getSubstructureSetArray",function(a,b,c,e,d,f){return this.matchPriv(a,b,c,e,d,f|2105344)},"~S,~A,~N,JU.BS,JU.BS,~N");n(c$,"polyhedronToSmiles",function(a,b,c){for(var e=Array(b),d=0;d<b;d++){e[d]=new JS.SmilesAtom;var f=null==c?null:c[d];e[d].elementNumber=null==f?-2:F(f,JU.Node)?f.getElementNumber():F(f,JU.Point3fi)?f.sD:-2;e[d].index=d}f=0;for(d=a.length;0<=--d;)for(var j=a[d],k=
j.length,g=k;0<=--g;){var h=j[g];if(!(0>h||h>=b)){var l=j[(g+1)%k];if(0>l||l>=b)l=j[(g+2)%k];if(!(0>l||l>=b)&&null==e[h].getBondTo(e[l]))(new JS.SmilesBond(e[h],e[l],1,!1)).index=f++}}for(d=0;d<b;d++)if(k=e[d].bondCount,0==k||k!=e[d].bonds.length)e[d].bonds=JU.AU.arrayCopyObject(e[d].bonds,k);return this.getSmiles(e,b,JU.BSUtil.newBitSet2(0,b),null,4|(null==c?2:65536))},"~A,~N,~A");n(c$,"getCorrelationMaps",function(a,b,c,e,d){return this.matchPriv(a,b,c,e,null,d|2109440)},"~S,~A,~N,JU.BS,~N");h(c$,
"findPriv",function(a,b,c){var e=new JU.BS;b.createTopoMap(e);return this.matchPriv(a,b.jmolAtoms,-b.jmolAtoms.length,null,e,c)},"~S,JS.SmilesSearch,~N");h(c$,"matchPriv",function(a,b,c,e,d,f){JS.InvalidSmilesException.clear();try{var j=JS.SmilesParser.getMolecule(a,this.checkFlag(f,131072));j.jmolAtoms=b;F(b,Array)&&(j.bioAtoms=b);j.jmolAtomCount=Math.abs(c);0>c&&(j.isSmilesFind=!0);j.setSelected(e);j.getSelections();j.bsRequired=null;j.setRingData(d);j.firstMatchOnly=this.checkFlag(f,4194304);j.matchAllAtoms=
this.checkFlag(f,1048576);switch(f&61440){case 4096:return j.asVector=!1,j.search(!1);case 8192:j.asVector=!0;var k=j.search(!1);return k.toArray(Array(k.size()));case 12288:j.getMaps=!0;var g=j.search(!1);return g.toArray(JU.AU.newInt2(g.size()))}}catch(h){if(I(h,Exception))throw h.printStackTrace(),null==JS.InvalidSmilesException.getLastError()&&JS.InvalidSmilesException.clear(),new JS.InvalidSmilesException(JS.InvalidSmilesException.getLastError());throw h;}return null},"~S,~A,~N,JU.BS,JU.BS,~N");
c$.countStereo=h(c$,"countStereo",function(a){a=JU.PT.rep(a,"@@","@");for(var b=a.lastIndexOf("@")+1,c=0;0<=--b;)"@"==a.charAt(b)&&c++;return c},"~S");n(c$,"cleanSmiles",function(a){return JS.SmilesParser.cleanPattern(a)},"~S");L(c$,"SMILES_MODE_BITSET",4096,"SMILES_MODE_ARRAY",8192,"SMILES_MODE_MAP",12288,"SMILES_MODE_MASK",61440)});y("JS");E(["java.lang.Exception"],"JS.InvalidSmilesException",null,function(){c$=O(JS,"InvalidSmilesException",Exception);c$.getLastError=h(c$,"getLastError",function(){return JS.InvalidSmilesException.lastError});
c$.clear=h(c$,"clear",function(){JS.InvalidSmilesException.lastError=null});K(c$,function(a){P(this,JS.InvalidSmilesException,[a]);JS.InvalidSmilesException.lastError=a},"~S");L(c$,"lastError",null)});y("JS");E(["JU.JmolMolecule","JU.BS","$.Lst","JS.VTemp"],"JS.SmilesSearch","java.util.Arrays $.Hashtable JU.AU $.SB $.V3 JS.SmilesAromatic $.SmilesAtom $.SmilesBond $.SmilesMeasure $.SmilesParser JU.BSUtil $.Logger".split(" "),function(){c$=H(function(){this.bioAtoms=this.smartsAtoms=this.jmolAtoms=
this.pattern=this.patternAtoms=null;this.jmolAtomCount=0;this.bsRequired=this.bsSelected=null;this.isSmilesFind=this.isSmarts=this.matchAllAtoms=this.firstMatchOnly=!1;this.subSearches=null;this.needRingData=this.haveAtomStereochemistry=this.haveBondStereochemistry=this.haveSelected=!1;this.needAromatic=!0;this.needRingMemberships=!1;this.ringDataMax=-2147483648;this.measures=null;this.flags=0;this.lastChainAtom=this.bsAromatic6=this.bsAromatic5=this.bsAromatic=this.ringSets=null;this.getMaps=this.asVector=
!1;this.top=null;this.isRingCheck=this.isSilent=!1;this.selectedAtomCount=0;this.htNested=this.bsFound=this.ringConnections=this.ringCounts=this.ringData=null;this.nNested=0;this.bsReturn=this.vReturn=this.nestedBond=null;this.aromaticDouble=this.noAromatic=this.ignoreStereochemistry=!1;this.v=this.bsCheck=null;this.isTopology=!1;G(this,arguments)},JS,"SmilesSearch",JU.JmolMolecule);M(c$,function(){this.patternAtoms=Array(16);this.measures=new JU.Lst;this.bsAromatic=new JU.BS;this.bsAromatic5=new JU.BS;
this.bsAromatic6=new JU.BS;this.top=this;this.bsFound=new JU.BS;this.bsReturn=new JU.BS;this.v=new JS.VTemp});h(c$,"toString",function(){var a=(new JU.SB).append(this.pattern);a.append("\nmolecular formula: "+this.getMolecularFormula(!0,null,!1));return a.toString()});h(c$,"setSelected",function(a){null==a&&(a=JU.BS.newN(this.jmolAtomCount),a.setBits(0,this.jmolAtomCount));this.bsSelected=a},"JU.BS");h(c$,"setAtomArray",function(){this.patternAtoms.length>this.ac&&(this.patternAtoms=JU.AU.arrayCopyObject(this.patternAtoms,
this.ac));this.nodes=this.patternAtoms});h(c$,"addAtom",function(){this.ac>=this.patternAtoms.length&&(this.patternAtoms=JU.AU.doubleLength(this.patternAtoms));var a=(new JS.SmilesAtom).setIndex(this.ac);this.patternAtoms[this.ac]=a;this.ac++;return a});h(c$,"addNested",function(a){null==this.top.htNested&&(this.top.htNested=new java.util.Hashtable);this.setNested(++this.top.nNested,a);return this.top.nNested},"~S");h(c$,"clear",function(){this.bsReturn.clearAll();this.nNested=0;this.nestedBond=this.htNested=
null;this.clearBsFound(-1)});h(c$,"setNested",function(a,b){this.top.htNested.put("_"+a,b)},"~N,~O");h(c$,"getNested",function(a){return this.top.htNested.get("_"+a)},"~N");h(c$,"getMissingHydrogenCount",function(){for(var a=0,b,c=0;c<this.ac;c++)if(0<=(b=this.patternAtoms[c].missingHydrogenCount))a+=b;return a});h(c$,"setRingData",function(a){this.isTopology&&(this.needAromatic=!1);this.needAromatic&&(this.needRingData=!0);this.needAromatic=(new Boolean(this.needAromatic&(new Boolean(null==a&0==
(this.flags&1))).valueOf())).valueOf();if(!this.needAromatic&&(this.bsAromatic.clearAll(),null!=a&&this.bsAromatic.or(a),!this.needRingMemberships&&!this.needRingData))return;this.getRingData(this.needRingData,this.flags,null)},"JU.BS");h(c$,"getRingData",function(a,b,c){var e=0!=(b&4),d=0!=(b&8);e&&null==c&&(c=JU.AU.createArrayOfArrayList(4));d&&this.needAromatic&&(this.bsAromatic=JS.SmilesAromatic.checkAromaticDefined(this.jmolAtoms,this.bsSelected),e=!1);0>this.ringDataMax&&(this.ringDataMax=8);
e&&6>this.ringDataMax&&(this.ringDataMax=6);a&&(this.ringCounts=A(this.jmolAtomCount,0),this.ringConnections=A(this.jmolAtomCount,0),this.ringData=Array(this.ringDataMax+1));this.ringSets=new JU.SB;for(var f="****";f.length<this.ringDataMax;)f+=f;var j=null;for(b=3;b<=this.ringDataMax;b++)if(!(b>this.jmolAtomCount)){var k="*1"+f.substring(0,b-2)+"*1",k=JS.SmilesParser.getMolecule(k,!0),k=this.subsearch(k,!1,!0);if(null!=c&&5>=b){for(var g=new JU.Lst,h=k.size();0<=--h;)g.addLast(k.get(h));c[b-3]=g}if(this.needAromatic){if(!d&&
(!e||5==b||6==b))for(g=k.size();0<=--g;)h=k.get(g),(d||JS.SmilesAromatic.isFlatSp2Ring(this.jmolAtoms,this.bsSelected,h,e?0.1:0.01))&&this.bsAromatic.or(h);if(e)switch(b){case 5:j=k;break;case 6:d?this.bsAromatic=JS.SmilesAromatic.checkAromaticDefined(this.jmolAtoms,this.bsAromatic):JS.SmilesAromatic.checkAromaticStrict(this.jmolAtoms,this.bsAromatic,j,k),c[3]=new JU.Lst,this.setAromatic56(j,this.bsAromatic5,5,c[3]),this.setAromatic56(k,this.bsAromatic6,6,c[3])}}if(a){this.ringData[b]=new JU.BS;for(var l=
0;l<k.size();l++){g=k.get(l);this.ringData[b].or(g);for(h=g.nextSetBit(0);0<=h;h=g.nextSetBit(h+1))this.ringCounts[h]++}}}if(a)for(b=this.bsSelected.nextSetBit(0);0<=b;b=this.bsSelected.nextSetBit(b+1))if(a=this.jmolAtoms[b],c=a.getEdges(),null!=c)for(l=c.length;0<=--l;)0<this.ringCounts[a.getBondedAtomIndex(l)]&&this.ringConnections[b]++},"~B,~N,~A");h(c$,"setAromatic56",function(a,b,c,e){for(var d=0;d<a.size();d++){var f=a.get(d);this.v.bsTemp.clearAll();this.v.bsTemp.or(f);this.v.bsTemp.and(this.bsAromatic);
this.v.bsTemp.cardinality()==c&&(b.or(f),null!=e&&e.addLast(f))}},"JU.Lst,JU.BS,~N,JU.Lst");h(c$,"subsearch",function(a,b,c){a.ringSets=this.ringSets;a.jmolAtoms=this.jmolAtoms;a.jmolAtomCount=this.jmolAtomCount;a.bsSelected=this.bsSelected;a.htNested=this.htNested;a.isSmilesFind=this.isSmilesFind;a.bsCheck=this.bsCheck;a.isSmarts=!0;a.bsAromatic=this.bsAromatic;a.bsAromatic5=this.bsAromatic5;a.bsAromatic6=this.bsAromatic6;a.ringData=this.ringData;a.ringCounts=this.ringCounts;a.ringConnections=this.ringConnections;
b?(a.bsRequired=null,a.firstMatchOnly=!1,a.matchAllAtoms=!1):c?(a.bsRequired=null,a.isSilent=!0,a.isRingCheck=!0,a.asVector=!0,a.matchAllAtoms=!1):(a.haveSelected=this.haveSelected,a.bsRequired=this.bsRequired,a.firstMatchOnly=this.firstMatchOnly,a.matchAllAtoms=this.matchAllAtoms,a.getMaps=this.getMaps,a.asVector=this.asVector,a.vReturn=this.vReturn,a.bsReturn=this.bsReturn);return a.search(b)},"JS.SmilesSearch,~B,~B");h(c$,"search",function(a){this.ignoreStereochemistry=0!=(this.flags&2);this.noAromatic=
0!=(this.flags&1);this.aromaticDouble=0!=(this.flags&16);JU.Logger.debugging&&!this.isSilent&&JU.Logger.debug("SmilesSearch processing "+this.pattern);if(null==this.vReturn&&(this.asVector||this.getMaps))this.vReturn=new JU.Lst;null==this.bsSelected&&(this.bsSelected=JU.BS.newN(this.jmolAtomCount),this.bsSelected.setBits(0,this.jmolAtomCount));this.selectedAtomCount=this.bsSelected.cardinality();if(null!=this.subSearches)for(a=0;a<this.subSearches.length&&!(null!=this.subSearches[a]&&(this.subsearch(this.subSearches[a],
!1,!1),this.firstMatchOnly&&(null==this.vReturn?0<=this.bsReturn.nextSetBit(0):0<this.vReturn.size())));a++);else 0<this.ac&&this.checkMatch(null,-1,-1,a);return this.asVector||this.getMaps?this.vReturn:this.bsReturn},"~B");h(c$,"checkMatch",function(a,b,c,e){var d;if(null==a)null==this.nestedBond?this.clearBsFound(-1):this.bsReturn.clearAll();else{if(this.bsFound.get(c)||!this.bsSelected.get(c))return!0;d=this.jmolAtoms[c];if(!this.isRingCheck&&!this.isTopology){if(null!=a.atomsOr){for(var f=0;f<
a.nAtomsOr;f++)if(!this.checkMatch(a.atomsOr[f],b,c,e))return!1;return!0}if(null==a.primitives){if(!this.checkPrimitiveAtom(a,c))return!0}else for(f=0;f<a.nPrimitives;f++)if(!this.checkPrimitiveAtom(a.primitives[f],c))return!0}d=d.getEdges();for(f=a.getBondCount();0<=--f;){var j=a.getBond(f);if(j.getAtomIndex2()==a.index){var k=j.atom1,g=k.getMatchingAtomIndex();switch(j.order){case 96:case 112:if(!this.checkMatchBond(a,k,j,c,g,null))return!0;break;default:for(var h=0;h<d.length&&(!(d[h].getAtomIndex1()==
g||d[h].getAtomIndex2()==g)||!d[h].isCovalent());h++);if(h==d.length||!this.checkMatchBond(a,k,j,c,g,d[h]))return!0}}}this.patternAtoms[a.index].setMatchingAtom(this.jmolAtoms[c],c);if(JU.Logger.debugging&&!this.isSilent){for(f=0;f<=b;f++)JU.Logger.debug("pattern atoms "+this.patternAtoms[f]);JU.Logger.debug("--ss--")}this.bsFound.set(c)}if(!this.continueMatch(b,c,e))return!1;0<=c&&this.clearBsFound(c);return!0},"JS.SmilesAtom,~N,~N,~B");h(c$,"continueMatch",function(a,b,c){var e,d;if(++a<this.ac){var f=
this.patternAtoms[a],j=0<=b?f.getBondTo(null):0==a?this.nestedBond:null;if(null==j){j=JU.BSUtil.copy(this.bsFound);e=JU.BSUtil.copy(this.bsFound);if(0<=f.notBondedIndex){d=this.patternAtoms[f.notBondedIndex];var k=d.getMatchingAtom();if(d.isBioAtom)d=k.getOffsetResidueAtom("0",1),0<=d&&j.set(d),d=k.getOffsetResidueAtom("0",-1),0<=d&&j.set(d);else{d=k.getEdges();for(var g=0;g<d.length;g++)j.set(d[g].getOtherAtomNode(k).getIndex())}}b=0<=b&&f.isBioAtom&&(null==f.atomName||null!=f.residueChar);for(k=
this.bsSelected.nextSetBit(0);0<=k;k=this.bsSelected.nextSetBit(k+1)){if(!j.get(k)&&!this.checkMatch(f,a,k,c))return!1;b&&(d=this.jmolAtoms[k].getOffsetResidueAtom(f.atomName,1),0<=d&&(k=d-1))}this.bsFound=e;return!0}e=j.atom1.getMatchingAtom();switch(j.order){case 96:k=e.getOffsetResidueAtom(f.atomName,1);if(0<=k){j=JU.BSUtil.copy(this.bsFound);e.getGroupBits(this.bsFound);if(!this.checkMatch(f,a,k,c))return!1;this.bsFound=j}return!0;case 112:b=new JU.Lst;e.getCrossLinkLeadAtomIndexes(b);j=JU.BSUtil.copy(this.bsFound);
e.getGroupBits(this.bsFound);for(k=0;k<b.size();k++)if(!this.checkMatch(f,a,b.get(k).intValue(),c))return!1;this.bsFound=j;return!0}d=e.getEdges();if(null!=d)for(k=0;k<d.length;k++)if(!this.checkMatch(f,a,e.getBondedAtomIndex(k),c))return!1;this.clearBsFound(b);return!0}if(!this.ignoreStereochemistry&&!this.checkStereochemistry())return!0;j=new JU.BS;for(k=f=0;k<this.ac;k++)if(b=this.patternAtoms[k].getMatchingAtomIndex(),c||!this.top.haveSelected||this.patternAtoms[k].selected){f++;j.set(b);this.patternAtoms[k].isBioAtom&&
null==this.patternAtoms[k].atomName&&this.jmolAtoms[b].getGroupBits(j);if(c)break;!this.isSmarts&&0<this.patternAtoms[k].missingHydrogenCount&&this.getHydrogens(this.jmolAtoms[b],j)}if(null!=this.bsRequired&&!this.bsRequired.intersects(j)||this.matchAllAtoms&&j.cardinality()!=this.selectedAtomCount)return!0;if(null!=this.bsCheck)if(c){this.bsCheck.clearAll();for(k=0;k<this.ac;k++)this.bsCheck.set(this.patternAtoms[k].getMatchingAtomIndex());if(this.bsCheck.cardinality()!=this.ac)return!0}else if(j.cardinality()!=
this.ac)return!0;this.bsReturn.or(j);if(this.getMaps){a=A(f,0);for(j=k=0;k<this.ac;k++)if(c||!this.top.haveSelected||this.patternAtoms[k].selected)a[j++]=this.patternAtoms[k].getMatchingAtomIndex();this.vReturn.addLast(a);return!this.firstMatchOnly}if(this.asVector){c=!0;for(k=this.vReturn.size();0<=--k&&c;)c=!this.vReturn.get(k).equals(j);if(!c)return!0;this.vReturn.addLast(j)}if(this.isRingCheck){this.ringSets.append(" ");for(g=3*a+2;--g>a;)this.ringSets.append("-").appendI(this.patternAtoms[(g<=
2*a?2*a-g+1:g-1)%a].getMatchingAtomIndex());this.ringSets.append("- ");return!0}return this.firstMatchOnly?!1:j.cardinality()!=this.selectedAtomCount},"~N,~N,~B");h(c$,"clearBsFound",function(a){0>a?null==this.bsCheck&&this.bsFound.clearAll():this.bsFound.clear(a)},"~N");h(c$,"getHydrogens",function(a,b){for(var c=a.getEdges(),e=-1,d=0;d<c.length;d++)if(1==this.jmolAtoms[a.getBondedAtomIndex(d)].getElementNumber()){e=a.getBondedAtomIndex(d);if(null==b)break;b.set(e)}return 0<=e?this.jmolAtoms[e]:
null},"JU.Node,JU.BS");h(c$,"checkPrimitiveAtom",function(a,b){for(var c=this.jmolAtoms[b],e=a.not;;){var d;if(0<a.iNested){e=this.getNested(a.iNested);F(e,JS.SmilesSearch)&&(a.isBioAtom&&(e.nestedBond=a.getBondTo(null)),e=this.subsearch(e,!0,!1),null==e&&(e=new JU.BS),a.isBioAtom||this.setNested(a.iNested,e));e=a.not!=e.get(b);break}if(a.isBioAtom){d=c;if(null!=a.atomName&&(a.isLeadAtom()?!d.isLeadAtom():!a.atomName.equals(d.getAtomName().toUpperCase())))break;if(a.notCrossLinked&&d.getCrossLinkLeadAtomIndexes(null))break;
if(null!=a.residueName&&!a.residueName.equals(d.getGroup3(!1).toUpperCase()))break;if(null!=a.residueChar){if(a.isDna()&&!d.isDna()||a.isRna()&&!d.isRna()||a.isProtein()&&!d.isProtein()||a.isNucleic()&&!d.isNucleic())break;var f=d.getGroup1("\x00").toUpperCase(),f=a.residueChar.equals(f);switch(a.residueChar.charAt(0)){case "N":f=a.isNucleic()?d.isNucleic():f;break;case "R":f=a.isNucleic()?d.isPurine():f;break;case "Y":f=a.isNucleic()?d.isPyrimidine():f}if(!f)break}if(0<=a.elementNumber&&a.elementNumber!=
c.getElementNumber())break}else{if(null!=a.atomName&&!a.atomName.equals(c.getAtomName().toUpperCase()))break;if(0<=a.jmolIndex&&c.getIndex()!=a.jmolIndex)break;if(null!=a.atomType&&!a.atomType.equals(c.getAtomType()))break;if(0<=a.elementNumber&&a.elementNumber!=c.getElementNumber())break;d=a.isAromatic();if(!this.noAromatic&&!a.aromaticAmbiguous&&d!=this.bsAromatic.get(b))break;if(-2147483648!=(d=a.getAtomicMass()))if(f=c.getIsotopeNumber(),0<=d&&d!=f||0>d&&0!=f&&-d!=f)break;if(-2147483648!=(d=a.getCharge())&&
d!=c.getFormalCharge())break;d=a.getCovalentHydrogenCount()+a.missingHydrogenCount;if(0<=d&&d!=c.getCovalentHydrogenCount())break;d=a.implicitHydrogenCount;if(-2147483648!=d&&(f=c.getImplicitHydrogenCount(),-1==d?0==f:d!=f))break;if(0<a.degree&&a.degree!=c.getCovalentBondCount())break;if(0<a.nonhydrogenDegree&&a.nonhydrogenDegree!=c.getCovalentBondCount()-c.getCovalentHydrogenCount())break;if(0<a.valence&&a.valence!=c.getValence())break;if(0<a.connectivity&&a.connectivity!=c.getCovalentBondCount()+
c.getImplicitHydrogenCount())break;if(null!=this.ringData&&-1<=a.ringSize)if(0>=a.ringSize){if(0==this.ringCounts[b]!=(0==a.ringSize))break}else{c=this.ringData[500==a.ringSize?5:600==a.ringSize?6:a.ringSize];if(null==c||!c.get(b))break;if(!this.noAromatic)if(500==a.ringSize){if(!this.bsAromatic5.get(b))break}else if(600==a.ringSize&&!this.bsAromatic6.get(b))break}if(null!=this.ringData&&-1<=a.ringMembership&&(-1==a.ringMembership?0==this.ringCounts[b]:this.ringCounts[b]!=a.ringMembership))break;
if(0<=a.ringConnectivity&&(d=this.ringConnections[b],-1==a.ringConnectivity&&0==d||-1!=a.ringConnectivity&&d!=a.ringConnectivity))break}e=!e;break}return e},"JS.SmilesAtom,~N");h(c$,"checkMatchBond",function(a,b,c,e,d,f){if(null!=c.bondsOr){for(var j=0;j<c.nBondsOr;j++)if(this.checkMatchBond(a,b,c.bondsOr[j],e,d,f))return!0;return!1}if(null==c.primitives){if(!this.checkPrimitiveBond(c,e,d,f))return!1}else for(a=0;a<c.nPrimitives;a++)if(!this.checkPrimitiveBond(c.primitives[a],e,d,f))return!1;c.matchingBond=
f;return!0},"JS.SmilesAtom,JS.SmilesAtom,JS.SmilesBond,~N,~N,JU.Edge");h(c$,"checkPrimitiveBond",function(a,b,c,e){var d=!1;switch(a.order){case 96:return a.isNot!=(this.bioAtoms[c].getOffsetResidueAtom("0",1)==this.bioAtoms[b].getOffsetResidueAtom("0",0));case 112:return a.isNot!=this.bioAtoms[b].isCrossLinked(this.bioAtoms[c])}var f=!this.noAromatic&&this.bsAromatic.get(b),j=!this.noAromatic&&this.bsAromatic.get(c);e=e.getCovalentOrder();if(f&&j)switch(a.order){case 17:case 65:d=JS.SmilesSearch.isRingBond(this.ringSets,
b,c);break;case 1:d=!this.isSmarts||!JS.SmilesSearch.isRingBond(this.ringSets,b,c);break;case 2:d=!this.isSmarts||this.aromaticDouble&&(2==e||514==e);break;case 769:case 1025:case 81:case -1:d=!0}else switch(a.order){case 81:case -1:d=!0;break;case 1:case 257:case 513:d=1==e||1041==e||1025==e;break;case 769:d=e==(this.isSmilesFind?33:1);break;case 1025:d=e==(this.isSmilesFind?97:1);break;case 2:d=2==e;break;case 3:d=3==e;break;case 65:d=JS.SmilesSearch.isRingBond(this.ringSets,b,c)}return d!=a.isNot},
"JS.SmilesBond,~N,~N,JU.Edge");c$.isRingBond=h(c$,"isRingBond",function(a,b,c){return null!=a&&0<=a.indexOf("-"+b+"-"+c+"-")},"JU.SB,~N,~N");h(c$,"checkStereochemistry",function(){for(var a=0;a<this.measures.size();a++)if(!this.measures.get(a).check())return!1;if(this.haveAtomStereochemistry){JU.Logger.debugging&&JU.Logger.debug("checking stereochemistry...");for(var b=null,c=null,e=null,d=null,f=null,j=null,k=c=null,a=0;a<this.ac;a++){var g=this.patternAtoms[a],h=g.getMatchingAtom(),j=g.missingHydrogenCount;
0>j&&(j=0);var l=g.getChiralClass();if(-2147483648!=l){var m=g.getChiralOrder();if(this.isSmilesFind&&h.getAtomSite()>>8!=l)return!1;JU.Logger.debugging&&JU.Logger.debug("...type "+l+" for pattern atom "+g+" "+h);switch(l){case 2:c=g.getBond(0).getOtherAtom(g);k=g.getBond(1).getOtherAtom(g);if(null==c||null==k)continue;for(e=b=g;2==c.getBondCount()&&2==k.getBondCount()&&4==c.getValence()&&4==k.getValence();)g=c.getBondNotTo(b,!0),b=c,c=g.getOtherAtom(c),g=k.getBondNotTo(e,!0),e=k,k=g.getOtherAtom(k);
g=c;d=Array(6);d[4]=(new JS.SmilesAtom).setIndex(604);e=g.getBondCount();for(b=0;b<e;b++)c=g.bonds[b].getOtherAtom(g),2==g.bonds[b].matchingBond.getCovalentOrder()?null==k&&(k=c):null==d[0]?d[0]=c.getMatchingAtom():d[1]=c.getMatchingAtom();if(null==k)continue;e=k.getBondCount();if(2>e||3<e)continue;for(b=0;b<e;b++)c=k.bonds[b].getOtherAtom(k),2!=k.bonds[b].matchingBond.getCovalentOrder()&&(null==d[2]?d[2]=c.getMatchingAtom():d[3]=c.getMatchingAtom());if(this.isSmilesFind&&(null==d[1]&&this.getX(g,
d,1,!1,!0),null==d[3]&&this.getX(k,d,3,!1,!1),!this.setSmilesCoordinates(h,g,k,d)))return!1;null==d[1]&&this.getX(g,d,1,!0,!1);null==d[3]&&this.getX(k,d,3,!0,!1);if(!JS.SmilesSearch.checkStereochemistryAll(g.not,h,l,m,d[0],d[1],d[2],d[3],null,null,this.v))return!1;continue;case 4:case 8:case 5:case 6:b=this.getJmolAtom(g.getMatchingBondedAtom(0));switch(j){case 0:c=this.getJmolAtom(g.getMatchingBondedAtom(1));break;case 1:c=this.getHydrogens(g.getMatchingAtom(),null);g.isFirst&&(e=c,c=b,b=e);break;
default:continue}e=this.getJmolAtom(g.getMatchingBondedAtom(2-j));d=this.getJmolAtom(g.getMatchingBondedAtom(3-j));f=this.getJmolAtom(g.getMatchingBondedAtom(4-j));j=this.getJmolAtom(g.getMatchingBondedAtom(5-j));if(this.isSmilesFind&&!this.setSmilesCoordinates(h,g,k,N(-1,[b,c,e,d,f,j]))||!JS.SmilesSearch.checkStereochemistryAll(g.not,h,l,m,b,c,e,d,f,j,this.v))return!1}}}}if(this.haveBondStereochemistry)for(b=0;b<this.ac;b++){c=this.patternAtoms[b];d=f=k=null;l=h=a=0;e=c.getBondCount();m=!1;for(j=
0;j<e;j++){var g=c.getBond(j),v=g.atom2===c,n=g.order;switch(n){case 769:case 1025:case 2:if(v)continue;k=g.atom2;l=n;(m=2!=n)&&(a=g.isNot?-1:1);break;case 257:case 513:f=v?g.atom1:g.atom2,a=v!=(257==n)?1:-1}}if(m){g=c.getBondNotTo(k,!1);if(null==g)return!1;f=g.getOtherAtom(c);g=k.getBondNotTo(c,!1);if(null==g)return!1;d=g.getOtherAtom(k)}else{if(null==k||0==a)continue;e=k.getBondCount();for(j=0;j<e&&0==h;j++)switch(g=k.getBond(j),v=g.atom2===k,n=g.order,n){case 257:case 513:d=v?g.atom1:g.atom2,h=
v!=(257==n)?1:-1}if(0==h)continue}this.isSmilesFind&&this.setSmilesBondCoordinates(c,k,l);c=c.getMatchingAtom();k=k.getMatchingAtom();g=f.getMatchingAtom();e=d.getMatchingAtom();if(null==g||null==e)return!1;JS.SmilesMeasure.setTorsionData(g,c,k,e,this.v,m);if(m){if(h=769==l?1:-1,k=this.v.vTemp1.dot(this.v.vTemp2),0.05>k||0.95<k||0<this.v.vNorm1.dot(this.v.vNorm2)*a*h)return!1}else if(0>this.v.vTemp1.dot(this.v.vTemp2)*a*h)return!1}return!0});h(c$,"getX",function(a,b,c,e,d){var f=this.getJmolAtom(a.getMatchingAtomIndex()),
j=a.isFirst||3==c;if(e){if(this.isSmarts){var k=f.getEdges();for(e=0;e<k.length;e++)if(2!=k[e].getCovalentOrder()){var g=this.jmolAtoms[f.getBondedAtomIndex(e)];if(g!==b[c-1]){b[c]=g;break}}}if(null==b[c]){k=new JU.V3;for(e=g=0;4>e;e++)null!=b[e]&&(g++,k.sub(b[e]));0==k.length()?(k.setT(b[4]),j=!1):(k.scaleAdd2(g+1,this.getJmolAtom(a.getMatchingAtomIndex()),k),j=this.isSmilesFind||j);b[c]=(new JS.SmilesAtom).setIndex(-1);b[c].setT(k)}}null==b[c]&&(b[c]=this.getHydrogens(f,null),d&&(j=!0));null!=b[c]&&
j&&(g=b[c],b[c]=b[c-1],b[c-1]=g)},"JS.SmilesAtom,~A,~N,~B,~B");c$.checkStereochemistryAll=h(c$,"checkStereochemistryAll",function(a,b,c,e,d,f,j,k,g,h,l){switch(c){default:case 2:case 4:return a==(JS.SmilesSearch.getHandedness(f,j,k,d,l)!=e);case 5:return a==(!JS.SmilesSearch.isDiaxial(b,b,g,d,l,-0.95)||JS.SmilesSearch.getHandedness(f,j,k,d,l)!=e);case 6:if(a!=!JS.SmilesSearch.isDiaxial(b,b,h,d,l,-0.95))return!1;JS.SmilesSearch.getPlaneNormals(f,j,k,g,l);if(a!=(0>l.vNorm1.dot(l.vNorm2)||0>l.vNorm2.dot(l.vNorm3)))return!1;
l.vNorm2.sub2(b,d);return a==((0>l.vNorm1.dot(l.vNorm2)?2:1)==e);case 8:return JS.SmilesSearch.getPlaneNormals(d,f,j,k,l),0>l.vNorm1.dot(l.vNorm2)?a==(3!=e):0>l.vNorm2.dot(l.vNorm3)?a==(2!=e):a==(1!=e)}},"~B,JU.Node,~N,~N,JU.Node,JU.Node,JU.Node,JU.Node,JU.Node,JU.Node,JS.VTemp");h(c$,"getJmolAtom",function(a){return 0>a||a>=this.jmolAtoms.length?null:this.jmolAtoms[a]},"~N");h(c$,"setSmilesBondCoordinates",function(a,b,c){a=this.jmolAtoms[a.getMatchingAtomIndex()];b=this.jmolAtoms[b.getMatchingAtomIndex()];
a.set(-1,0,0);b.set(1,0,0);if(2==c){var e=0,d=0;c=a.getEdges();for(var f=c.length;0<=--f;){var j=c[f],k=j.getOtherAtomNode(a);if(k!==b)switch(k.set(-1,0==e++?-1:1,0),k=j.getAtomIndex2()==a.getIndex()?e:-e,j.order){case 1025:d=k;break;case 1041:d=-k}}var g=0,e=0,h=Array(2);c=b.getEdges();for(f=c.length;0<=--f;)if(j=c[f],k=j.getOtherAtomNode(b),k!==a)switch(h[e]=k,k.set(1,0==e++?1:-1,0),k=j.getAtomIndex2()==b.getIndex()?e:-e,j.order){case 1025:g=k;break;case 1041:g=-k}0<d*g==(Math.abs(d)%2==Math.abs(g)%
2)&&(a=h[0].y,h[0].y=h[1].y,h[1].y=a)}else{c=a.getEdges();h=0;for(f=c.length;0<=--f;)if(j=c[f],j.getOtherAtomNode(a)===b){h=33==j.order?1:-1;break}for(f=c.length;0<=--f;)j=c[f],k=j.getOtherAtomNode(a),k!==b&&k.set(-1,1,0);c=b.getEdges();for(f=c.length;0<=--f;)j=c[f],k=j.getOtherAtomNode(b),k!==a&&k.set(1,1,-h/2)}},"JS.SmilesAtom,JS.SmilesAtom,~N");h(c$,"setSmilesCoordinates",function(a,b,c,e){var d=a.getAtomSite();if(-2147483648==d)return!1;var f=d>>8,d=d&255;c=2==f||3==f?c=this.jmolAtoms[c.getMatchingAtomIndex()]:
null;a.set(0,0,0);a=this.jmolAtoms[b.getMatchingAtomIndex()];a.set(0,0,0);a=this.getMappedAtoms(a,c,e);switch(f){case 2:case 4:2==d&&(d=a[0],a[0]=a[1],a[1]=d);e[a[0]].set(0,0,1);e[a[1]].set(1,0,-1);e[a[2]].set(0,1,-1);e[a[3]].set(-1,-1,-1);break;case 8:switch(d){case 1:e[a[0]].set(1,0,0);e[a[1]].set(0,1,0);e[a[2]].set(-1,0,0);e[a[3]].set(0,-1,0);break;case 2:e[a[0]].set(1,0,0);e[a[1]].set(-1,0,0);e[a[2]].set(0,1,0);e[a[3]].set(0,-1,0);break;case 3:e[a[0]].set(1,0,0),e[a[1]].set(0,1,0),e[a[2]].set(0,
-1,0),e[a[3]].set(-1,0,0)}break;case 5:case 6:f=a.length,2==d&&(d=a[0],a[0]=a[f-1],a[f-1]=d),e[a[0]].set(0,0,1),e[a[f-1]].set(0,0,-1),e[a[1]].set(1,0,0),e[a[2]].set(0,1,0),e[a[3]].set(-1,0,0),6==f&&e[a[4]].set(0,-1,0)}return!0},"JU.Node,JS.SmilesAtom,JS.SmilesAtom,~A");h(c$,"getMappedAtoms",function(a,b,c){for(var e=A(null==c[4]?4:null==c[5]?5:6,0),d=0;d<e.length;d++)e[d]=null==c[d]?104+100*d:c[d].getIndex();for(var f,j=a.getEdges(),k=null==b?null:b.getEdges(),d=0;d<e.length;d++){for(f=0;f<j.length&&
j[f].getOtherAtomNode(a)!==c[d];f++);if(f<j.length)e[d]=10*f+100+d;else if(null!=b){for(f=0;f<k.length&&k[f].getOtherAtomNode(b)!==c[d];f++);f<k.length&&(e[d]=10*f+300+d)}}java.util.Arrays.sort(e);for(d=0;d<e.length;d++)e[d]%=10;return e},"JU.Node,JU.Node,~A");c$.isDiaxial=h(c$,"isDiaxial",function(a,b,c,e,d,f){d.vA.sub2(a,c);d.vB.sub2(b,e);d.vA.normalize();d.vB.normalize();return d.vA.dot(d.vB)<f},"JU.Node,JU.Node,JU.Node,JU.Node,JS.VTemp,~N");c$.getHandedness=h(c$,"getHandedness",function(a,b,c,
e,d){a=JS.SmilesAromatic.getNormalThroughPoints(a,b,c,d.vTemp,d.vA,d.vB);return 0<JS.SmilesSearch.distanceToPlane(d.vTemp,a,e)?1:2},"JU.Node,JU.Node,JU.Node,JU.Node,JS.VTemp");c$.getPlaneNormals=h(c$,"getPlaneNormals",function(a,b,c,e,d){JS.SmilesAromatic.getNormalThroughPoints(a,b,c,d.vNorm1,d.vTemp1,d.vTemp2);JS.SmilesAromatic.getNormalThroughPoints(b,c,e,d.vNorm2,d.vTemp1,d.vTemp2);JS.SmilesAromatic.getNormalThroughPoints(c,e,a,d.vNorm3,d.vTemp1,d.vTemp2)},"JU.Node,JU.Node,JU.Node,JU.Node,JS.VTemp");
c$.distanceToPlane=h(c$,"distanceToPlane",function(a,b,c){return null==a?NaN:(a.x*c.x+a.y*c.y+a.z*c.z+b)/Math.sqrt(a.x*a.x+a.y*a.y+a.z*a.z)},"JU.V3,~N,JU.P3");h(c$,"createTopoMap",function(a){null==a&&(a=new JU.BS);var b=this.getMissingHydrogenCount();this.jmolAtoms=b=Array(this.ac+b);for(var c=0,e=new JU.BS,d=0;d<this.ac;d++){var f=this.patternAtoms[d],j=f.getChiralClass(),k=f.missingHydrogenCount;0>k&&(k=0);var g=b[c]=(new JS.SmilesAtom).setAll(0,c,-2147483648==j?j:(j<<8)+f.getChiralOrder(),f.elementNumber,
f.getCharge());g.atomName=f.atomName;g.residueName=f.residueName;g.residueChar=f.residueChar;g.isBioAtom=f.isBioAtom;g.$isLeadAtom=f.$isLeadAtom;g.setAtomicMass(f.getAtomicMass());f.isAromatic()&&a.set(c);!f.isFirst&&(1==k&&0<j)&&e.set(c);f.setMatchingAtom(null,c++);f=Array(f.getBondCount()+k);for(g.setBonds(f);0<=--k;)f=b[c]=(new JS.SmilesAtom).setAll(0,c,0,1,0),c++,f.setBonds(Array(1)),j=new JS.SmilesBond(g,f,1,!1),JU.Logger.info(""+j)}for(d=0;d<this.ac;d++){f=this.patternAtoms[d];k=f.getMatchingAtomIndex();
a=b[k];k=f.getBondCount();for(c=0;c<k;c++)if(g=f.getBond(c),g.atom1===f){j=1;switch(g.order){case 769:j=33;break;case 1025:j=97;break;case 257:j=1025;break;case 513:j=1041;break;case 112:case 96:j=g.order;break;case 1:j=1;break;case 17:j=514;break;case 2:j=2;break;case 3:j=3}g=b[g.atom2.getMatchingAtomIndex()];j=new JS.SmilesBond(a,g,j,!1);g.bondCount--;JU.Logger.debugging&&JU.Logger.info(""+j)}else g=b[g.atom1.getMatchingAtomIndex()],j=g.getBondTo(a),a.addBond(j)}for(d=e.nextSetBit(0);0<=d;d=e.nextSetBit(d+
1))f=b[d].getEdges(),j=f[0],f[0]=f[1],f[1]=j},"JU.BS");h(c$,"setTop",function(a){this.top=null==a?this:a.getTop()},"JS.SmilesSearch");h(c$,"getTop",function(){return this.top===this?this:this.top.getTop()});h(c$,"getSelections",function(){var a=this.top.htNested;if(!(null==a||0==this.jmolAtoms.length))for(var b=new java.util.Hashtable,c,a=a.entrySet().iterator();a.hasNext()&&((c=a.next())||1);){var e=c.getValue().toString();if(e.startsWith("select")){var d=b.containsKey(e)?b.get(e):this.smartsAtoms[0].findAtomsLike(e.substring(6));
null==d&&(d=new JU.BS);b.put(e,d);c.setValue(d)}}});L(c$,"INITIAL_ATOMS",16)});y("JS");E(["java.util.Hashtable","JU.BS","JS.VTemp"],"JS.SmilesGenerator","JU.Lst $.SB JS.InvalidSmilesException $.SmilesAromatic $.SmilesAtom $.SmilesBond $.SmilesParser $.SmilesSearch JU.BNode $.BSUtil $.Elements $.JmolMolecule $.Logger".split(" "),function(){c$=H(function(){this.atoms=null;this.ac=0;this.bsAromatic=this.bsSelected=null;this.explicitH=!1;this.vTemp=this.ringSets=null;this.nPairs=0;this.bsIncludingH=this.htRings=
this.htRingsSequence=this.prevSp2Atoms=this.prevAtom=this.bsToDo=this.bsBondsDn=this.bsBondsUp=null;this.topologyOnly=!1;this.getAromatic=!0;G(this,arguments)},JS,"SmilesGenerator");M(c$,function(){this.vTemp=new JS.VTemp;this.bsBondsUp=new JU.BS;this.bsBondsDn=new JU.BS;this.htRingsSequence=new java.util.Hashtable;this.htRings=new java.util.Hashtable});h(c$,"getSmiles",function(a,b,c,e,d,f){var j=c.nextSetBit(0);if(0>j)return"";this.atoms=a;this.ac=b;this.bsSelected=c=JU.BSUtil.copy(c);this.explicitH=
e;this.topologyOnly=d;this.getAromatic=f;return this.getSmilesComponent(a[j],c,!0,!1)},"~A,~N,JU.BS,~B,~B,~B");h(c$,"getBioSmiles",function(a,b,c,e,d,f){this.atoms=a;this.ac=b;b=new JU.SB;c=JU.BSUtil.copy(c);null!=f&&b.append("//* Jmol bioSMILES ").append(f.$replace("*","_")).append(" *//");f="\n";var j=new JU.BS,k=null,g,h=new JU.Lst;try{for(var l=0,m=c.nextSetBit(0);0<=m;m=c.nextSetBit(m+1)){var v=a[m],n=v.getGroup1("?"),p=v.getBioStructureTypeName(),s=n.equals("?");if(null!=f)if(0<b.length()&&
b.append(f),f=null,l=0,0<p.length)0!=v.getChainID()&&(g="//* chain "+v.getChainIDStr()+" "+p+" "+v.getResno()+" *// ",l=g.length,b.append(g)),b.append("~").appendC(p.charAt(0)).append("~"),l++;else{g=this.getSmilesComponent(v,c,!1,!0);if(g.equals(k))f="";else{var k=g,r=v.getGroup3(!0);null!=r&&b.append("//* ").append(r).append(" *//");b.append(g);f=".\n"}continue}75<=l&&(b.append("\n  "),l=2);s?this.addBracketedBioName(b,v,0<p.length?".0":null):b.append(n);l++;var q=v.getOffsetResidueAtom("0",0);
if(d){v.getCrossLinkLeadAtomIndexes(h);for(var y=0;y<h.size();y++)b.append(":"),g=this.getRingCache(q,h.get(y).intValue(),this.htRingsSequence),b.append(g),l+=1+g.length;h.clear()}v.getGroupBits(j);c.andNot(j);var t=v.getOffsetResidueAtom("0",1);if(0>t||!c.get(t)){b.append(" //* ").appendI(v.getResno()).append(" *//");if(0>t&&0>(t=c.nextSetBit(m+1)))break;0<l&&(f=".\n")}m=t-1}}catch(z){if(I(z,Exception))throw new JS.InvalidSmilesException("//* error: "+z.getMessage()+" *//");throw z;}if(!e&&!this.htRingsSequence.isEmpty())throw this.dumpRingKeys(b,
this.htRingsSequence),new JS.InvalidSmilesException("//* ?ring error? *//");g=b.toString();g.endsWith(".\n")&&(g=g.substring(0,g.length-2));return g},"~A,~N,JU.BS,~B,~B,~S");h(c$,"addBracketedBioName",function(a,b,c){a.append("[");if(null!=c&&F(b,JU.BNode)){var e=b.getChainIDStr();a.append(b.getGroup3(!1));c.equals(".0")||a.append(c).append("#").appendI(b.getElementNumber());a.append("//* ").appendI(b.getResno());0<e.length&&a.append(":").append(e);a.append(" *//")}else a.append(JU.Elements.elementNameFromNumber(b.getElementNumber()));
a.append("]")},"JU.SB,JU.Node,~S");h(c$,"getSmilesComponent",function(a,b,c,e){!this.explicitH&&(1==a.getElementNumber()&&0<a.getEdges().length)&&(a=this.atoms[a.getBondedAtomIndex(0)]);this.bsSelected=JU.JmolMolecule.getBranchBitSet(this.atoms,a.getIndex(),JU.BSUtil.copy(b),null,-1,!0,c);b.andNot(this.bsSelected);this.bsIncludingH=JU.BSUtil.copy(this.bsSelected);if(!this.explicitH)for(b=this.bsSelected.nextSetBit(0);0<=b;b=this.bsSelected.nextSetBit(b+1))c=this.atoms[b],1==c.getElementNumber()&&
0==c.getIsotopeNumber()&&this.bsSelected.clear(b);this.getAromatic&&!this.topologyOnly&&2<this.bsSelected.cardinality()?(b=null,b=JS.SmilesParser.getMolecule("A[=&@]A",!0),b.jmolAtoms=this.atoms,F(this.atoms,Array)&&(b.bioAtoms=this.atoms),b.setSelected(this.bsSelected),b.jmolAtomCount=this.ac,b.ringDataMax=7,b.setRingData(null),this.bsAromatic=b.bsAromatic,this.ringSets=b.ringSets,this.setBondDirections()):this.bsAromatic=new JU.BS;this.bsToDo=JU.BSUtil.copy(this.bsSelected);b=new JU.SB;for(c=this.bsToDo.nextSetBit(0);0<=
c;c=this.bsToDo.nextSetBit(c+1))4<this.atoms[c].getCovalentBondCount()&&(null==a&&b.append("."),this.getSmiles(b,this.atoms[c],e,!1,this.explicitH),a=null);if(null!=a)for(;null!=(a=this.getSmiles(b,a,e,!0,this.explicitH)););for(;0<this.bsToDo.cardinality()||!this.htRings.isEmpty();){a=this.htRings.values().iterator();if(a.hasNext()){if(a=this.atoms[a.next()[1].intValue()],!this.bsToDo.get(a.getIndex()))break}else a=this.atoms[this.bsToDo.nextSetBit(0)];b.append(".");for(this.prevAtom=this.prevSp2Atoms=
null;null!=(a=this.getSmiles(b,a,e,!0,this.explicitH)););}if(!this.htRings.isEmpty())throw this.dumpRingKeys(b,this.htRings),new JS.InvalidSmilesException("//* ?ring error? *//\n"+b);return b.toString()},"JU.Node,JU.BS,~B,~B");h(c$,"getBondStereochemistry",function(a,b){if(null==a)return"\x00";var c=a.index,e=null==b||a.getAtomIndex1()==b.getIndex();return this.bsBondsUp.get(c)?e?"/":"\\":this.bsBondsDn.get(c)?e?"\\":"/":"\x00"},"JU.Edge,JU.Node");h(c$,"setBondDirections",function(){for(var a=new JU.BS,
b=N(2,3,null),c=this.bsSelected.nextSetBit(0);0<=c;c=this.bsSelected.nextSetBit(c+1))for(var e=this.atoms[c],d=e.getEdges(),f=0;f<d.length;f++){var j=d[f],k=j.index;if(!a.get(k)){var g=j.getOtherAtomNode(e);if(!(2!=j.getCovalentOrder()||JS.SmilesSearch.isRingBond(this.ringSets,c,g.getIndex()))){a.set(k);var h=j=null,k=0,l=N(-1,[e,g]);JU.Logger.debugging&&JU.Logger.debug(e+" == "+g);h=1;for(g=0;2>g&&0<h&&3>h;g++)for(var h=0,m=l[g],v=m.getEdges(),n=0;n<v.length;n++)1==v[n].getCovalentOrder()&&(b[g][h++]=
v[n],"\x00"!=this.getBondStereochemistry(v[n],m)&&(j=v[n],k=g));if(!(3==h||0==h))if(null==j&&(k=0,j=b[k][0],this.bsBondsUp.set(j.index)),m=this.getBondStereochemistry(j,l[k]),h=j.getOtherAtomNode(l[k]),null!=h)for(g=0;2>g;g++)for(v=0;2>v;v++)if(n=b[g][v],!(null==n||n===j)){var p=n.index,s=n.getOtherAtomNode(l[g]);if(null!=s){var r=this.getBondStereochemistry(n,l[g]),q=JS.SmilesSearch.isDiaxial(l[k],l[g],h,s,this.vTemp,0);"\x00"==r||r!=m==q?("\\"==m&&q||"/"==m&&!q)==(n.getAtomIndex1()!=s.getIndex())?
this.bsBondsUp.set(p):this.bsBondsDn.set(p):JU.Logger.error("BOND STEREOCHEMISTRY ERROR");JU.Logger.debugging&&JU.Logger.debug(this.getBondStereochemistry(j,l[0])+" "+h.getIndex()+" "+s.getIndex()+" "+this.getBondStereochemistry(n,l[g]))}}}}}});h(c$,"getSmiles",function(a,b,c,e,d){var f=b.getIndex();if(!this.bsToDo.get(f))return null;this.bsToDo.clear(f);var j=!this.bsSelected.get(f),k=null==this.prevAtom?-1:this.prevAtom.getIndex(),g=this.bsAromatic.get(f),h=null!=this.prevSp2Atoms,l=this.prevSp2Atoms,
m=0,n=b.getElementNumber(),u=0,p=new JU.Lst,s=null,r=null,q=b.getEdges(),y=null,t=g?10:0,z=Array(7);JU.Logger.debugging&&JU.Logger.debug(a.toString());if(null!=q)for(var w=q.length;0<=--w;){var x=q[w];if(x.isCovalent()){var B=q[w].getOtherAtomNode(b),x=B.getIndex();if(x==k)r=q[w];else{var C=!d&&1==B.getElementNumber()&&0==B.getIsotopeNumber();if(!this.bsIncludingH.get(x))if(!C&&c&&this.bsSelected.get(f))this.bsToDo.set(x);else continue;C?(y=B,u++,1<u&&(t=10)):p.addLast(q[w])}}}q=null;null==l&&(l=
Array(5));null!=r&&(q=JS.SmilesBond.getBondOrderString(r.getCovalentOrder()),null==this.prevSp2Atoms?l[m++]=this.prevAtom:m=2);var m=m+u,k=0,A=new JU.BS;if(e)for(w=0;w<p.size();w++){var x=p.get(w),C=x.getOtherAtomNode(b),B=C.getCovalentBondCount()-(d?0:C.getCovalentHydrogenCount()),D=x.getCovalentOrder();if(1==D&&1==B&&w<p.size()-(null==s?1:0))A.set(x.index);else if((1<D||B>k)&&!this.htRings.containsKey(JS.SmilesGenerator.getRingKey(C.getIndex(),f)))k=1<D?1E3+D:B,s=x}k=null==s?null:s.getOtherAtomNode(b);
B=null==s?0:s.getCovalentOrder();7>t&&null!=r&&(2==r.getCovalentOrder()&&2==B&&null!=this.prevSp2Atoms&&null!=this.prevSp2Atoms[1]?(z[t++]=this.prevSp2Atoms[0],z[t++]=this.prevSp2Atoms[1]):z[t++]=this.prevAtom);7>t&&1==u&&(z[t++]=y);y=1==B&&null==this.prevSp2Atoms;D=this.getBondStereochemistry(r,this.prevAtom);r=new JU.SB;for(w=0;w<p.size();w++)x=p.get(w),A.get(x.index)&&(C=x.getOtherAtomNode(b),x=new JU.SB,x.append("("),this.prevAtom=b,this.prevSp2Atoms=null,this.getSmiles(x,C,c,e,d),x.append(")"),
0<=r.indexOf(x.toString())&&(t=10),r.appendSB(x),p.remove(w--),7>t&&(z[t++]=C),5>m&&(l[m++]=C));w=2==B?k.getIndex():-1;if(1<u||g||0>w||JS.SmilesSearch.isRingBond(this.ringSets,f,w))m=-1;0>m&&(l=null);if(null!=q||"\x00"!=D)"\x00"!=D&&(q=""+D),a.append(q);c=null;if(!e&&(5==p.size()||6==p.size()))c=this.sortInorganic(b,p);for(w=0;w<p.size();w++)x=p.get(w),x!==s&&(C=x.getOtherAtomNode(b),q=JS.SmilesBond.getBondOrderString(x.order),y||(D=this.getBondStereochemistry(x,b),"\x00"!=D&&(q=""+D)),r.append(q),
r.append(this.getRingCache(f,C.getIndex(),this.htRings)),7>t&&(z[t++]=C),null!=l&&5>m&&(l[m++]=C));if(h&&2==t&&2==B&&3==k.getCovalentBondCount()){q=k.getEdges();for(m=0;m<q.length;m++)q[m].isCovalent()&&k.getBondedAtomIndex(m)!=f&&(z[t++]=this.atoms[k.getBondedAtomIndex(m)]);m=0}else null!=k&&7>t&&(z[t++]=k);e=b.getFormalCharge();h=b.getIsotopeNumber();p=b.getValence();w=b.getAtomName();d=F(b,JU.BNode)?b.getBioStructureTypeName():"";JU.Logger.debugging&&a.append("\n//* "+b+" *//\t");this.topologyOnly?
a.append("*"):j&&0!=d.length&&0!=w.length?this.addBracketedBioName(a,b,"."+w):a.append(JS.SmilesAtom.getAtomLabel(n,h,p,e,u,g,null!=c?c:this.checkStereoPairs(b,f,z,t)));a.appendSB(r);if(null==s)return null;2==B&&(1==m||2==m)?(null==l[0]&&(l[0]=b),null==l[1]&&(l[1]=b)):l=null;this.prevSp2Atoms=l;this.prevAtom=b;return k},"JU.SB,JU.Node,~B,~B,~B");h(c$,"sortInorganic",function(a,b){for(var c=a.getIndex(),e=b.size(),d=new JU.Lst,f=new JU.Lst,j,k,g,h,l=new JU.BS,m=null,n=Array(6),m=!0,u="",p=0;p<e;p++)if(g=
b.get(p),n[0]=j=g.getOtherAtomNode(a),0==p?u=this.addStereoCheck(c,n,0,""):m&&null!=this.addStereoCheck(c,n,0,u)&&(m=!1),!l.get(p)){l.set(p);for(var s=!1,r=p+1;r<e;r++)if(!l.get(r)&&(h=b.get(r),k=h.getOtherAtomNode(a),JS.SmilesSearch.isDiaxial(a,a,j,k,this.vTemp,-0.95))){d.addLast(N(-1,[g,h]));s=!0;l.set(r);break}s||f.addLast(g)}c=d.size();if(m||6==e&&3!=c||5==e&&0==c)return"";m=d.get(0);g=m[0];n[0]=g.getOtherAtomNode(a);b.clear();b.addLast(g);1<c&&f.addLast(d.get(1)[0]);3==c&&f.addLast(d.get(2)[0]);
1<c&&f.addLast(d.get(1)[1]);3==c&&f.addLast(d.get(2)[1]);for(p=0;p<f.size();p++)g=f.get(p),b.addLast(g),n[p+1]=g.getOtherAtomNode(a);b.addLast(m[1]);return JS.SmilesGenerator.getStereoFlag(a,n,e,this.vTemp)},"JU.Node,JU.Lst");h(c$,"checkStereoPairs",function(a,b,c,e){if(4>e)return"";if(4==e&&6==a.getElementNumber())for(var d="",f=0;4>f;f++)if(null==(d=this.addStereoCheck(b,c,f,d))){e=10;break}return 6<e?"":JS.SmilesGenerator.getStereoFlag(a,c,e,this.vTemp)},"JU.Node,~N,~A,~N");c$.getStereoFlag=h(c$,
"getStereoFlag",function(a,b,c,e){var d=b[0],f=b[1],j=b[2],k=b[3],g=b[4];b=b[5];var h=4;switch(c){default:case 5:case 6:return JS.SmilesSearch.checkStereochemistryAll(!1,a,h,1,d,f,j,k,g,b,e)?"@":"@@";case 2:case 4:if(null==j||null==k)break;c=JS.SmilesAromatic.getNormalThroughPoints(d,f,j,e.vTemp,e.vA,e.vB);if(0.2>Math.abs(JS.SmilesSearch.distanceToPlane(e.vTemp,c,k))){h=8;if(JS.SmilesSearch.checkStereochemistryAll(!1,a,h,1,d,f,j,k,g,b,e))return"@SP1";if(JS.SmilesSearch.checkStereochemistryAll(!1,
a,h,2,d,f,j,k,g,b,e))return"@SP2";if(JS.SmilesSearch.checkStereochemistryAll(!1,a,h,3,d,f,j,k,g,b,e))return"@SP3"}else return JS.SmilesSearch.checkStereochemistryAll(!1,a,h,1,d,f,j,k,g,b,e)?"@":"@@"}return""},"JU.Node,~A,~N,JS.VTemp");h(c$,"addStereoCheck",function(a,b,c,e){var d=b[c].getAtomicAndIsotopeNumber(),f=b[c].getCovalentBondCount(),j=6==d&&!this.explicitH?b[c].getCovalentHydrogenCount():0;if(6==d?4!=f||3!=j:1<f)return e;d=";"+d+"/"+j+"/"+f+",";if(0<=e.indexOf(d)){if(3==j){for(d=j=0;d<f&&
3>j;d++){var k=b[c].getBondedAtomIndex(d);k!=a&&(j+=this.atoms[k].getAtomicAndIsotopeNumber())}if(3<j)return e}return null}return e+d},"~N,~A,~N,~S");h(c$,"getRingCache",function(a,b,c){var e=JS.SmilesGenerator.getRingKey(a,b),d=c.get(e),d=null==d?null:d[0];null==d?(c.put(e,N(-1,[d=this.getRingPointer(++this.nPairs),Integer.$valueOf(b)])),JU.Logger.debugging&&JU.Logger.debug("adding for "+a+" ring key "+this.nPairs+": "+e)):(c.remove(e),JU.Logger.debugging&&JU.Logger.debug("using ring key "+e));return d},
"~N,~N,java.util.Map");h(c$,"getRingPointer",function(a){return 10>a?""+a:100>a?"%"+a:"%("+a+")"},"~N");h(c$,"dumpRingKeys",function(a,b){JU.Logger.info(a.toString()+"\n\n");for(var c,e=b.keySet().iterator();e.hasNext()&&((c=e.next())||1);)JU.Logger.info("unmatched ring key: "+c)},"JU.SB,java.util.Map");c$.getRingKey=h(c$,"getRingKey",function(a,b){return Math.min(a,b)+"_"+Math.max(a,b)},"~N,~N")});y("JS");E(null,"JS.SmilesAromatic",["JU.BS","$.V3"],function(){c$=O(JS,"SmilesAromatic");c$.isFlatSp2Ring=
h(c$,"isFlatSp2Ring",function(a,b,c,e){for(var d=c.nextSetBit(0);0<=d;d=c.nextSetBit(d+1)){var f=a[d],j=f.getEdges();if(!(3>j.length)&&3<j.length)return!1}if(3.4028235E38==e)return!0;0>=e&&(e=0.01);for(var k=new JU.V3,g=new JU.V3,h=new JU.V3,l=null,d=c.cardinality(),m=Array(2*d),n=0,u=1-5*e,d=c.nextSetBit(0);0<=d;d=c.nextSetBit(d+1)){for(var f=a[d],j=f.getEdges(),p=-1,s=-1,r=-1,j=j.length;0<=--j;){var q=f.getBondedAtomIndex(j);b.get(q)&&(c.get(q)?0>s?s=q:r=q:p=q)}JS.SmilesAromatic.getNormalThroughPoints(a[s],
a[d],a[r],k,g,h);null==l&&(l=new JU.V3);if(!JS.SmilesAromatic.addNormal(k,l,u))return!1;m[n++]=JU.V3.newV(k);if(0<=p){JS.SmilesAromatic.getNormalThroughPoints(a[s],a[p],a[r],k,g,h);if(!JS.SmilesAromatic.addNormal(k,l,u))return!1;m[n++]=JU.V3.newV(k)}}return JS.SmilesAromatic.checkStandardDeviation(m,l,n,e)},"~A,JU.BS,JU.BS,~N");c$.addNormal=h(c$,"addNormal",function(a,b,c){var e=b.dot(a);if(0!=e&&Math.abs(e)<c)return!1;0>e&&a.scale(-1);b.add(a);b.normalize();return!0},"JU.V3,JU.V3,~N");c$.checkStandardDeviation=
h(c$,"checkStandardDeviation",function(a,b,c,e){for(var d=0,f=0,j=0;j<c;j++)var k=a[j].dot(b),d=d+k,f=f+k*k;d=Math.sqrt((f-d*d/c)/(c-1));return d<e},"~A,JU.V3,~N,~N");c$.getNormalThroughPoints=h(c$,"getNormalThroughPoints",function(a,b,c,e,d,f){d.sub2(b,a);f.sub2(c,a);e.cross(d,f);e.normalize();d.setT(a);return-d.dot(e)},"JU.Node,JU.Node,JU.Node,JU.V3,JU.V3,JU.V3");c$.checkAromaticDefined=h(c$,"checkAromaticDefined",function(a,b){for(var c=new JU.BS,e=b.nextSetBit(0);0<=e;e=b.nextSetBit(e+1))for(var d=
a[e].getEdges(),f=0;f<d.length;f++)switch(d[f].order){case 515:case 514:case 513:c.set(d[f].getAtomIndex1()),c.set(d[f].getAtomIndex2())}return c},"~A,JU.BS");c$.checkAromaticStrict=h(c$,"checkAromaticStrict",function(a,b,c,e){for(var d=new JU.BS,f=new JU.BS,j=c.size();0<=--j;){var k=c.get(j);JS.SmilesAromatic.isAromaticRing(b,f,k,5)&&JS.SmilesAromatic.checkAromaticStrict2(a,d,c,e,k,!0)}for(j=e.size();0<=--j;)k=e.get(j),JS.SmilesAromatic.isAromaticRing(b,f,k,6)&&JS.SmilesAromatic.checkAromaticStrict2(a,
d,c,e,k,!1);b.clearAll();b.or(d)},"~A,JU.BS,JU.Lst,JU.Lst");c$.isAromaticRing=h(c$,"isAromaticRing",function(a,b,c,e){b.clearAll();b.or(c);b.and(a);return b.cardinality()==e},"JU.BS,JU.BS,JU.BS,~N");c$.checkAromaticStrict2=h(c$,"checkAromaticStrict2",function(a,b,c,e,d,f){f=JS.SmilesAromatic.countInternalPairs(a,d,f)<<1;switch(f){case -3:break;default:for(var j=d.nextSetBit(0);0<=j;j=d.nextSetBit(j+1))for(var k=a[j].getEdges(),g=0;g<k.length;g++)if(2==k[g].order){var h=k[g].getOtherAtomNode(a[j]).getIndex();
if(!d.get(h)){for(var l=!1,m=c.size();0<=--m&&!l;){var n=c.get(m);if(n.get(h)&&(b.get(h)||3==Math.abs(JS.SmilesAromatic.countInternalPairs(a,n,!0))))l=!0}for(m=e.size();0<=--m&&!l;)if(n=e.get(m),n.get(h)&&(b.get(h)||3==Math.abs(JS.SmilesAromatic.countInternalPairs(a,n,!1))))l=!0;if(!l)return;f++}}}6==f&&b.or(d)},"~A,JU.BS,JU.Lst,JU.Lst,JU.BS,~B");c$.countInternalPairs=h(c$,"countInternalPairs",function(a,b,c){for(var e=0,d=0,f=0,j=b.nextSetBit(0);0<=j;j=b.nextSetBit(j+1)){for(var k=a[j],g=k.getEdges(),
h=!1,l=0;l<g.length;l++){var m=g[l].getOtherAtomNode(k).getIndex();if(b.get(m))switch(g[l].order){case 514:case 513:case 515:d++;break;case 2:e++,h=!0}}if(c&&0==d)switch(k.getElementNumber()){case 7:case 8:case 16:h||f++}}return 0==d?Q(e/2)+f:d==(c?5:6)?-3:0},"~A,JU.BS,~B")});y("JS");E(["JU.P3","JU.BNode"],"JS.SmilesAtom",["JU.AU","JU.Elements","$.Logger"],function(){c$=H(function(){this.atomsOr=null;this.nAtomsOr=0;this.primitives=null;this.index=this.nPrimitives=0;this.residueChar=this.residueName=
this.atomName=null;this.isBioAtom=!1;this.bioType="\x00";this.$isLeadAtom=!1;this.notBondedIndex=-1;this.notCrossLinked=!1;this.aromaticAmbiguous=!0;this.atomType=null;this.covalentHydrogenCount=-1;this.hasSymbol=this.selected=this.not=!1;this.isFirst=!0;this.jmolIndex=-1;this.elementNumber=-2;this.implicitHydrogenCount=this.missingHydrogenCount=-2147483648;this.bonds=this.parent=null;this.iNested=this.bondCount=0;this.charge=this.atomicMass=-2147483648;this.matchingIndex=-1;this.chiralOrder=this.chiralClass=
-2147483648;this.$isAromatic=!1;this.atomSite=this.component=0;this.nonhydrogenDegree=this.degree=-1;this.valence=0;this.connectivity=-1;this.ringSize=this.ringMembership=-2147483648;this.ringConnectivity=-1;this.matchingNode=null;G(this,arguments)},JS,"SmilesAtom",JU.P3,JU.BNode);M(c$,function(){this.bonds=Array(4)});c$.getChiralityClass=h(c$,"getChiralityClass",function(a){return Q(("0;11;AL;33;TH;TP;OH;77;SP;".indexOf(a)+1)/3)},"~S");c$.allowSmilesUnbracketed=h(c$,"allowSmilesUnbracketed",function(a){return 0<=
"B, C, N, O, P, S, F, Cl, Br, I, *,".indexOf(a+",")},"~S");K(c$,function(){P(this,JS.SmilesAtom,[])});h(c$,"setBioAtom",function(a){this.isBioAtom="\x00"!=a;this.bioType=a;null!=this.parent&&(this.parent.bioType=a,this.parent.isBioAtom=this.isBioAtom)},"~S");h(c$,"setAtomName",function(a){null!=a&&(0<a.length&&(this.atomName=a),a.equals("0")&&(this.$isLeadAtom=!0),null!=this.parent&&(this.parent.atomName=a))},"~S");h(c$,"setBonds",function(a){this.bonds=a},"~A");h(c$,"addAtomOr",function(){null==
this.atomsOr&&(this.atomsOr=Array(2));this.nAtomsOr>=this.atomsOr.length&&(this.atomsOr=JU.AU.doubleLength(this.atomsOr));var a=(new JS.SmilesAtom).setIndex(this.index);a.parent=this;this.atomsOr[this.nAtomsOr]=a;this.nAtomsOr++;return a});h(c$,"addPrimitive",function(){null==this.primitives&&(this.primitives=Array(2));if(this.nPrimitives>=this.primitives.length){var a=Array(2*this.primitives.length);System.arraycopy(this.primitives,0,a,0,this.primitives.length);this.primitives=a}a=(new JS.SmilesAtom).setIndex(this.index);
a.parent=this;this.primitives[this.nPrimitives]=a;this.setSymbol("*");this.hasSymbol=!1;this.nPrimitives++;return a});n(c$,"toString",function(){var a=null!=this.residueChar||null!=this.residueName?(null==this.residueChar?this.residueName:this.residueChar)+"."+this.atomName:-1==this.elementNumber?"A":-2==this.elementNumber?"*":JU.Elements.elementSymbolFromNumber(this.elementNumber);this.$isAromatic&&(a=a.toLowerCase());return"["+a+"."+this.index+(0<=this.matchingIndex?"("+this.matchingNode+")":"")+
"]"});h(c$,"setIndex",function(a){this.index=a;return this},"~N");h(c$,"setAll",function(a,b,c,e,d){this.component=a;this.index=b;this.atomSite=c;this.elementNumber=e;this.charge=d;return this},"~N,~N,~N,~N,~N");h(c$,"setHydrogenCount",function(){if(-2147483648!=this.missingHydrogenCount)return!0;var a=JS.SmilesAtom.getDefaultCount(this.elementNumber,this.$isAromatic);if(0>a)return-1==a;7==this.elementNumber&&this.$isAromatic&&2==this.bondCount&&1==this.bonds[0].order&&1==this.bonds[1].order&&a++;
for(var b=0;b<this.bondCount;b++)switch(this.bonds[b].order){case 81:7==this.elementNumber&&JU.Logger.info("Ambiguous bonding to aromatic N found -- MF may be in error");a-=1;break;case 1:case 257:case 513:a-=1;break;case 2:a-=this.$isAromatic&&6==this.elementNumber?1:2;break;case 3:a-=3}0<a&&(this.missingHydrogenCount=a);return!0},"JS.SmilesSearch");c$.getDefaultCount=h(c$,"getDefaultCount",function(a,b){switch(a){case 0:case -1:case -2:return-1;case 6:return b?3:4;case 8:case 16:return 2;case 7:return b?
2:3;case 5:case 15:return 3;case 9:case 17:case 35:case 53:return 1}return-2},"~N,~B");n(c$,"getIndex",function(){return this.index});h(c$,"isAromatic",function(){return this.$isAromatic});h(c$,"setSymbol",function(a){this.$isAromatic=a.equals(a.toLowerCase());this.hasSymbol=!0;if(a.equals("*"))return this.$isAromatic=!1,this.elementNumber=-2,!0;if(a.equals("Xx"))return this.elementNumber=0,!0;this.aromaticAmbiguous=!1;if(a.equals("a")||a.equals("A"))return 0>this.elementNumber&&(this.elementNumber=
-1),!0;this.$isAromatic&&(a=a.substring(0,1).toUpperCase()+(1==a.length?"":a.substring(1)));this.elementNumber=JU.Elements.elementNumberFromSymbol(a,!0);return 0!=this.elementNumber},"~S");n(c$,"getElementNumber",function(){return this.elementNumber});h(c$,"getAtomicMass",function(){return this.atomicMass});h(c$,"setAtomicMass",function(a){this.atomicMass=a},"~N");h(c$,"getCharge",function(){return this.charge});h(c$,"setCharge",function(a){this.charge=a},"~N");h(c$,"getMatchingAtomIndex",function(){return this.matchingIndex});
h(c$,"getMatchingAtom",function(){return this.matchingNode});h(c$,"setMatchingAtom",function(a,b){this.matchingNode=a;this.matchingIndex=b},"JU.Node,~N");h(c$,"getChiralClass",function(){return this.chiralClass});h(c$,"setChiralClass",function(a){this.chiralClass=a},"~N");h(c$,"getChiralOrder",function(){return this.chiralOrder});h(c$,"setChiralOrder",function(a){this.chiralOrder=a},"~N");h(c$,"setExplicitHydrogenCount",function(a){this.missingHydrogenCount=a},"~N");h(c$,"setImplicitHydrogenCount",
function(a){this.implicitHydrogenCount=a},"~N");h(c$,"setDegree",function(a){this.degree=a},"~N");h(c$,"setNonhydrogenDegree",function(a){this.nonhydrogenDegree=a},"~N");h(c$,"setValence",function(a){this.valence=a},"~N");h(c$,"setConnectivity",function(a){this.connectivity=a},"~N");h(c$,"setRingMembership",function(a){this.ringMembership=a},"~N");h(c$,"setRingSize",function(a){this.ringSize=a},"~N");h(c$,"setRingConnectivity",function(a){this.ringConnectivity=a},"~N");n(c$,"getModelIndex",function(){return this.component});
n(c$,"getAtomSite",function(){return this.atomSite});n(c$,"getImplicitHydrogenCount",function(){return 0});h(c$,"getExplicitHydrogenCount",function(){return this.missingHydrogenCount});n(c$,"getFormalCharge",function(){return this.charge});n(c$,"getIsotopeNumber",function(){return this.atomicMass});n(c$,"getAtomicAndIsotopeNumber",function(){return JU.Elements.getAtomicAndIsotopeNumber(this.elementNumber,this.atomicMass)});n(c$,"getAtomName",function(){return null==this.atomName?"":this.atomName});
n(c$,"getGroup3",function(){return null==this.residueName?"":this.residueName},"~B");n(c$,"getGroup1",function(){return null==this.residueChar?"":this.residueChar},"~S");h(c$,"addBond",function(a){this.bondCount>=this.bonds.length&&(this.bonds=JU.AU.doubleLength(this.bonds));this.bonds[this.bondCount]=a;this.bondCount++},"JS.SmilesBond");h(c$,"setBondArray",function(){this.bonds.length>this.bondCount&&(this.bonds=JU.AU.arrayCopyObject(this.bonds,this.bondCount));null!=this.atomsOr&&this.atomsOr.length>
this.nAtomsOr&&(this.atomsOr=JU.AU.arrayCopyObject(this.atomsOr,this.atomsOr.length));null!=this.primitives&&this.primitives.length>this.nPrimitives&&(this.primitives=JU.AU.arrayCopyObject(this.primitives,this.primitives.length));for(var a=0;a<this.bonds.length;a++)this.isBioAtom&&17==this.bonds[a].order&&(this.bonds[a].order=112),this.bonds[a].atom1.index>this.bonds[a].atom2.index&&this.bonds[a].switchAtoms()});n(c$,"getEdges",function(){return null!=this.parent?this.parent.getEdges():this.bonds});
h(c$,"getBond",function(a){return null!=this.parent?this.parent.getBond(a):0<=a&&a<this.bondCount?this.bonds[a]:null},"~N");n(c$,"getCovalentBondCount",function(){return this.getBondCount()});n(c$,"getBondCount",function(){return null!=this.parent?this.parent.getCovalentBondCount():this.bondCount});h(c$,"getMatchingBondedAtom",function(a){if(null!=this.parent)return this.parent.getMatchingBondedAtom(a);if(a>=this.bondCount)return-1;a=this.bonds[a];return(a.atom1===this?a.atom2:a.atom1).matchingIndex},
"~N");n(c$,"getBondedAtomIndex",function(a){return null!=this.parent?this.parent.getBondedAtomIndex(a):this.bonds[a].getOtherAtom(this).index},"~N");n(c$,"getCovalentHydrogenCount",function(){if(0<=this.covalentHydrogenCount)return this.covalentHydrogenCount;if(null!=this.parent)return this.parent.getCovalentHydrogenCount();for(var a=this.covalentHydrogenCount=0;a<this.bonds.length;a++)1==this.bonds[a].getOtherAtom(this).elementNumber&&this.covalentHydrogenCount++;return this.covalentHydrogenCount});
n(c$,"getValence",function(){if(null!=this.parent)return this.parent.getValence();var a=this.valence;if(0>=a&&null!=this.bonds)for(var b=this.bonds.length;0<=--b;)a+=this.bonds[b].getValence();return this.valence=a});h(c$,"getBondTo",function(a){if(null!=this.parent)return this.parent.getBondTo(a);for(var b,c=0;c<this.bonds.length;c++)if(null!=(b=this.bonds[c]))if(null==a?b.atom2===this:b.getOtherAtom(this)===a)return b;return null},"JS.SmilesAtom");h(c$,"getBondNotTo",function(a,b){for(var c,e=0;e<
this.bonds.length;e++)if(null!=(c=this.bonds[e])){var d=c.getOtherAtom(this);if(a!==d&&(b||1!=d.elementNumber))return c}return null},"JS.SmilesAtom,~B");n(c$,"isLeadAtom",function(){return this.$isLeadAtom});n(c$,"getOffsetResidueAtom",function(){if(this.isBioAtom)for(var a=0;a<this.bonds.length;a++)if(this.bonds[a].getAtomIndex1()==this.index&&96==this.bonds[a].order)return this.bonds[a].getOtherAtom(this).index;return-1},"~S,~N");n(c$,"getGroupBits",function(a){a.set(this.index)},"JU.BS");n(c$,
"isCrossLinked",function(a){return this.getBondTo(a).isHydrogen()},"JU.BNode");n(c$,"getCrossLinkLeadAtomIndexes",function(a){for(var b=0;b<this.bonds.length;b++)112==this.bonds[b].order&&a.addLast(Integer.$valueOf(this.bonds[b].getOtherAtom(this).index));return!0},"JU.Lst");n(c$,"getBioStructureTypeName",function(){return null});n(c$,"getResno",function(){return 0});n(c$,"getChainID",function(){return 0});n(c$,"getChainIDStr",function(){return""});c$.getAtomLabel=h(c$,"getAtomLabel",function(a,b,
c,e,d,f,j){var k=JU.Elements.elementSymbolFromNumber(a);f&&(k=k.toLowerCase(),6!=a&&(c=2147483647));return(0<j.length||0!=b||0!=e?-1:JS.SmilesAtom.getDefaultCount(a,!1))==c?k:"["+(0>=b?"":""+b)+k+(0>e&&-2147483648!=e?""+e:0<e?"+"+e:"")+j+(1<d?"H"+d:1==d?"H":"")+"]"},"~N,~N,~N,~N,~N,~B,~S");n(c$,"isDna",function(){return"d"==this.bioType});n(c$,"isRna",function(){return"r"==this.bioType});n(c$,"isNucleic",function(){return"n"==this.bioType||"r"==this.bioType||"d"==this.bioType});n(c$,"isProtein",function(){return"p"==
this.bioType});n(c$,"isPurine",function(){return null!=this.residueChar&&this.isNucleic()&&0<="AG".indexOf(this.residueChar)});n(c$,"isPyrimidine",function(){return null!=this.residueChar&&this.isNucleic()&&0<="CTUI".indexOf(this.residueChar)});n(c$,"isDeleted",function(){return!1});h(c$,"setAtomType",function(a){this.atomType=a},"~S");n(c$,"getAtomType",function(){return null==this.atomType?this.atomName:this.atomType});n(c$,"findAtomsLike",function(){return null},"~S");L(c$,"STEREOCHEMISTRY_DEFAULT",
0,"STEREOCHEMISTRY_ALLENE",2,"STEREOCHEMISTRY_TETRAHEDRAL",4,"STEREOCHEMISTRY_TRIGONAL_BIPYRAMIDAL",5,"STEREOCHEMISTRY_OCTAHEDRAL",6,"STEREOCHEMISTRY_SQUARE_PLANAR",8,"UNBRACKETED_SET","B, C, N, O, P, S, F, Cl, Br, I, *,")});y("JS");E(["JU.Edge"],"JS.SmilesBond",["JS.InvalidSmilesException"],function(){c$=H(function(){this.atom2=this.atom1=null;this.isNot=!1;this.primitives=this.matchingBond=null;this.nPrimitives=0;this.bondsOr=null;this.nBondsOr=0;G(this,arguments)},JS,"SmilesBond",JU.Edge);c$.getBondOrderString=
h(c$,"getBondOrderString",function(a){switch(a){case 1:return"";case 2:return"=";case 3:return"#";default:return""}},"~N");h(c$,"set",function(a){this.order=a.order;this.isNot=a.isNot;this.primitives=a.primitives;this.nPrimitives=a.nPrimitives;this.bondsOr=a.bondsOr;this.nBondsOr=a.nBondsOr},"JS.SmilesBond");h(c$,"addBondOr",function(){null==this.bondsOr&&(this.bondsOr=Array(2));if(this.nBondsOr>=this.bondsOr.length){var a=Array(2*this.bondsOr.length);System.arraycopy(this.bondsOr,0,a,0,this.bondsOr.length);
this.bondsOr=a}a=new JS.SmilesBond(null,null,-1,!1);this.bondsOr[this.nBondsOr]=a;this.nBondsOr++;return a});h(c$,"addPrimitive",function(){null==this.primitives&&(this.primitives=Array(2));if(this.nPrimitives>=this.primitives.length){var a=Array(2*this.primitives.length);System.arraycopy(this.primitives,0,a,0,this.primitives.length);this.primitives=a}a=new JS.SmilesBond(null,null,-1,!1);this.primitives[this.nPrimitives]=a;this.nPrimitives++;return a});n(c$,"toString",function(){return this.atom1+
" -"+(this.isNot?"!":"")+this.order+"- "+this.atom2});K(c$,function(a,b,c,e){P(this,JS.SmilesBond,[]);this.set2(c,e);this.set2a(a,b)},"JS.SmilesAtom,JS.SmilesAtom,~N,~B");h(c$,"set2",function(a,b){this.order=a;this.isNot=b},"~N,~B");h(c$,"set2a",function(a,b){null!=a&&(this.atom1=a,a.addBond(this));null!=b&&(this.atom2=b,b.isFirst=!1,b.addBond(this))},"JS.SmilesAtom,JS.SmilesAtom");c$.isBondType=h(c$,"isBondType",function(a,b,c){if(0>"-=#:/\\.+!,&;@~^'".indexOf(a))return!1;if(!b&&0>"-=#:/\\.~^'".indexOf(a))throw new JS.InvalidSmilesException("SMARTS bond type "+
a+" not allowed in SMILES");return c&&"~"==a?!1:!0},"~S,~B,~B");c$.getBondTypeFromCode=h(c$,"getBondTypeFromCode",function(a){switch(a){case ".":return 0;case "-":return 1;case "=":return 2;case "#":return 3;case ":":return 17;case "/":return 257;case "\\":return 513;case "^":return 769;case "'":return 1025;case "@":return 65;case "~":return 81;case "+":return 96}return-1},"~S");h(c$,"setAtom2",function(a){this.atom2=a;null!=this.atom2&&a.addBond(this)},"JS.SmilesAtom");h(c$,"getBondType",function(){return this.order});
h(c$,"getOtherAtom",function(a){return this.atom1===a?this.atom2:this.atom1},"JS.SmilesAtom");n(c$,"getAtomIndex1",function(){return this.atom1.index});n(c$,"getAtomIndex2",function(){return this.atom2.index});n(c$,"getCovalentOrder",function(){return this.order});n(c$,"getOtherAtomNode",function(a){return a===this.atom1?this.atom2:a===this.atom2?this.atom1:null},"JU.Node");n(c$,"isCovalent",function(){return 112!=this.order});h(c$,"getValence",function(){return this.order&7});n(c$,"isHydrogen",function(){return 112==
this.order});h(c$,"switchAtoms",function(){var a=this.atom1;this.atom1=this.atom2;this.atom2=a;switch(this.order){case 769:this.order=1025;break;case 1025:this.order=769;break;case 257:this.order=513;break;case 513:this.order=257}});L(c$,"TYPE_UNKNOWN",-1,"TYPE_NONE",0,"TYPE_SINGLE",1,"TYPE_DOUBLE",2,"TYPE_TRIPLE",3,"TYPE_AROMATIC",17,"TYPE_DIRECTIONAL_1",257,"TYPE_DIRECTIONAL_2",513,"TYPE_ATROPISOMER_1",769,"TYPE_ATROPISOMER_2",1025,"TYPE_RING",65,"TYPE_ANY",81,"TYPE_BIO_SEQUENCE",96,"TYPE_BIO_PAIR",
112,"TYPE_MULTIPLE",999)});y("JS");c$=H(function(){this.search=null;this.index=this.type=this.nPoints=0;this.isNot=!1;this.indices=null;this.max=this.min=0;this.points=null;G(this,arguments)},JS,"SmilesMeasure");M(c$,function(){this.indices=A(4,0);this.points=Array(4)});K(c$,function(a,b,c,e,d,f){this.search=a;this.type=Math.min(4,Math.max(c,2));this.index=b;this.min=Math.min(e,d);this.max=Math.max(e,d);this.isNot=f},"JS.SmilesSearch,~N,~N,~N,~N,~B");n(c$,"toString",function(){for(var a="(."+"__dat".charAt(this.type)+
this.index+":"+this.min+","+this.max+") for",b=0;b<this.type;b++)a+=" "+(b>=this.nPoints?"?":""+this.indices[b]);return a});h(c$,"addPoint",function(a){if(this.nPoints==this.type)return!1;if(0==this.nPoints)for(var b=1;b<this.type;b++)this.indices[b]=a+b;this.indices[this.nPoints++]=a;return!0},"~N");h(c$,"check",function(){for(var a=0;a<this.type;a++){var b=this.search.patternAtoms[this.indices[a]].getMatchingAtomIndex();this.points[a]=this.search.jmolAtoms[b]}a=0;switch(this.type){case 2:a=this.points[0].distance(this.points[1]);
break;case 3:this.search.v.vA.sub2(this.points[0],this.points[1]);this.search.v.vB.sub2(this.points[2],this.points[1]);a=this.search.v.vA.angle(this.search.v.vB)/0.017453292;break;case 4:JS.SmilesMeasure.setTorsionData(this.points[0],this.points[1],this.points[2],this.points[3],this.search.v,!0),a=this.search.v.vTemp1.angle(this.search.v.vTemp2)/0.017453292*(0>this.search.v.vNorm1.dot(this.search.v.vNorm2)?1:-1)}return(a<this.min||a>this.max)==this.isNot});c$.setTorsionData=h(c$,"setTorsionData",
function(a,b,c,e,d,f){d.vTemp1.sub2(a,b);d.vTemp2.sub2(e,c);f&&(d.vNorm1.sub2(b,c),d.vNorm1.normalize(),d.vTemp1.cross(d.vTemp1,d.vNorm1),d.vTemp1.normalize(),d.vTemp2.cross(d.vTemp2,d.vNorm1),d.vTemp2.normalize(),d.vNorm2.cross(d.vTemp1,d.vTemp2))},"JU.P3,JU.P3,JU.P3,JU.P3,JS.VTemp,~B");L(c$,"TYPES","__dat","radiansPerDegree",0.017453292519943295);y("JS");E(["java.util.Hashtable"],"JS.SmilesParser","java.lang.Character JU.Lst $.PT $.SB JS.InvalidSmilesException $.SmilesAtom $.SmilesBond $.SmilesMeasure $.SmilesSearch JU.Elements $.Logger".split(" "),
function(){c$=H(function(){this.isBioSequence=this.isSmarts=!1;this.bioType="\x00";this.ringBonds=null;this.flags=this.branchLevel=this.braceCount=0;this.htMeasures=null;G(this,arguments)},JS,"SmilesParser");M(c$,function(){this.ringBonds=new java.util.Hashtable;this.htMeasures=new java.util.Hashtable});c$.getMolecule=h(c$,"getMolecule",function(a,b){return(new JS.SmilesParser(b)).parse(a)},"~S,~B");K(c$,function(a){this.isSmarts=a},"~B");h(c$,"reset",function(){this.branchLevel=this.braceCount=0});
h(c$,"parse",function(a){if(null==a)throw new JS.InvalidSmilesException("SMILES expressions must not be null");var b=new JS.SmilesSearch;0<=a.indexOf("$(select")&&(a=this.parseNested(b,a,"select"));for(a=JS.SmilesParser.cleanPattern(a);a.startsWith("/");){var c=JS.SmilesParser.getSubPattern(a,0,"/").toUpperCase();a=a.substring(c.length);this.flags=0;0<=c.indexOf("NOAROMATIC")&&(this.flags|=1);0<=c.indexOf("AROMATICSTRICT")&&(this.flags|=4);0<=c.indexOf("AROMATICDEFINED")&&(this.flags|=8);0<=c.indexOf("AROMATICDOUBLE")&&
(this.flags|=16);0<=c.indexOf("NOSTEREO")&&(this.flags|=2)}0<=a.indexOf("$")&&(a=this.parseVariables(a));this.isSmarts&&0<=a.indexOf("[$")&&(a=this.parseVariableLength(a));if(0<=a.indexOf("||")){a=JU.PT.split(a,"||");c="";b.subSearches=Array(a.length);for(var e=0;e<a.length;e++){var d="|"+a[e]+"|";0>c.indexOf(d)&&(b.subSearches[e]=this.getSearch(b,a[e],this.flags),c+=d)}JU.Logger.info(c);return b}return this.getSearch(b,a,this.flags)},"~S");h(c$,"parseVariableLength",function(a){for(var b=new JU.SB,
c=a.length-1,e=0,d=!1,f=0;f<c;f++)switch(a.charAt(f)){case "(":e++;break;case ")":e--;break;case "|":0<e&&(d=!0,"|"==a.charAt(f+1)&&(a=a.substring(0,f)+a.substring(f+1),c--))}if(0<=a.indexOf("||")){c=JU.PT.split(a,"||");for(f=0;f<c.length;f++)b.append("||").append(this.parseVariableLength(c[f]))}else{c=-1;e=A(1,0);for(f=null;0<=(c=a.indexOf("[$",c+1));){var j=c,k=-2147483648,g=-2147483648,c=JS.SmilesParser.getDigits(a,c+2,e),k=e[0];-2147483648!=k&&"-"==JS.SmilesParser.getChar(a,c)&&(c=JS.SmilesParser.getDigits(a,
c+1,e),g=e[0]);if("("==JS.SmilesParser.getChar(a,c)&&(f=JS.SmilesParser.getSubPattern(a,j,"["),f.endsWith(")"))){var h=j+f.length+2,l=JS.SmilesParser.getSubPattern(a,c,"("),m=c;JS.SmilesParser.getSubPattern(a,c,"[");c+=1+l.length;if(0<=l.indexOf(":")&&0>l.indexOf("|")){for(var n=0,u=l.length,p=-1,f=0;f<u;f++)switch(l.charAt(f)){case "[":case "(":n++;break;case ")":case "]":n--;break;case ".":0<=p&&0==n&&(u=f);break;case ":":0>p&&0==n&&(p=f)}0<p&&(l=l.substring(0,p)+"("+l.substring(p,u)+")"+l.substring(u))}if(-2147483648==
k){if(f=l.indexOf("|"),0<=f)return this.parseVariableLength(a.substring(0,j)+"[$1"+a.substring(m,m+f+1)+")]"+a.substring(h)+"||"+a.substring(0,j)+"[$1("+a.substring(m+f+2)+a.substring(h))}else{-2147483648==g&&(g=k);0<=l.indexOf("|")&&(l="[$("+l+")]");for(f=k;f<=g;f++){k=new JU.SB;k.append("||").append(a.substring(0,j));for(m=0;m<f;m++)k.append(l);k.append(a.substring(h));b.appendSB(k)}}}}}return d?this.parseVariableLength(b.substring(2)):2>b.length()?a:b.substring(2)},"~S");h(c$,"getSearch",function(a,
b,c){this.htMeasures=new java.util.Hashtable;var e=new JS.SmilesSearch;e.setTop(a);e.isSmarts=this.isSmarts;e.pattern=b;e.flags=c;0<=b.indexOf("$(")&&(b=this.parseNested(e,b,""));this.parseSmiles(e,b,null,!1);if(0!=this.braceCount)throw new JS.InvalidSmilesException("unmatched '{'");if(!this.ringBonds.isEmpty())throw new JS.InvalidSmilesException("Open ring");e.setAtomArray();e.isTopology=!0;for(a=e.ac;0<=--a;){b=e.patternAtoms[a];if(e.isTopology&&(-2!=b.elementNumber||0<b.nAtomsOr||0<b.nPrimitives))e.isTopology=
!1;b.setBondArray();if(!this.isSmarts&&"\x00"==b.bioType&&!b.setHydrogenCount(e))throw new JS.InvalidSmilesException("unbracketed atoms must be one of: B, C, N, O, P, S, F, Cl, Br, I, *,");}if(this.isSmarts)for(a=e.ac;0<=--a;){b=e.patternAtoms[a];this.checkNested(e,b,c);for(var d=0;d<b.nAtomsOr;d++)this.checkNested(e,b.atomsOr[d],c);for(d=0;d<b.nPrimitives;d++)this.checkNested(e,b.primitives[d],c)}!this.isSmarts&&!this.isBioSequence&&(e.elementCounts[1]=e.getMissingHydrogenCount());this.fixChirality(e);
return e},"JS.SmilesSearch,~S,~N");h(c$,"checkNested",function(a,b,c){if(0<b.iNested){var e=a.getNested(b.iNested);F(e,String)&&!e.startsWith("select")&&("~"!=e.charAt(0)&&"\x00"!=b.bioType&&(e="~"+b.bioType+"~"+e),c=this.getSearch(a,e,c),0<c.ac&&c.patternAtoms[0].selected&&(b.selected=!0),a.setNested(b.iNested,c))}},"JS.SmilesSearch,JS.SmilesAtom,~N");h(c$,"fixChirality",function(a){for(var b=a.ac;0<=--b;){var c=a.patternAtoms[b],e=c.getChiralClass();if(-2147483648!=e){var d=c.missingHydrogenCount;
0>d&&(d=0);d+=c.getBondCount();switch(e){case 0:switch(d){case 2:e=3==c.getValence()?3:2;break;case 3:case 4:case 5:case 6:e=d}break;case 8:4!=d&&(e=0);break;case 2:case 6:case 4:case 5:d!=e&&(e=0)}if(0==e)throw new JS.InvalidSmilesException("Incorrect number of bonds for stereochemistry descriptor");c.setChiralClass(e)}}},"JS.SmilesSearch");h(c$,"parseSmiles",function(a,b,c,e){for(var d=A(1,0),f=0,j,k=null;null!=b&&0!=b.length;){var g=0;if(null==c||null!=k&&0==k.order)this.isBioSequence&&(a.top.needAromatic=
!1),g=this.checkBioType(b,0);j=JS.SmilesParser.getChar(b,g);var h=this.checkBrace(a,j,"{");h&&(j=JS.SmilesParser.getChar(b,++g));if("("==j){e="."==JS.SmilesParser.getChar(b,g+1);if(null==c)throw new JS.InvalidSmilesException("No previous atom for "+(e?"measure":"branch"));g=JS.SmilesParser.getSubPattern(b,g,"(");g.startsWith(".")?this.parseMeasure(a,g.substring(1),c):0==g.length&&this.isBioSequence?c.notCrossLinked=!0:(this.branchLevel++,this.parseSmiles(a,g,c,!0),this.branchLevel--);g=g.length+2}else{for(f=
g;JS.SmilesBond.isBondType(j,this.isSmarts,this.isBioSequence);)j=JS.SmilesParser.getChar(b,++g);k=this.parseBond(a,null,b.substring(f,g),null,c,!1,e);h&&-1!=k.order&&(g=f);j=JS.SmilesParser.getChar(b,g);this.checkBrace(a,j,"{")&&(j=JS.SmilesParser.getChar(b,++g));"~"==j&&0==k.order&&(g=this.checkBioType(b,g),j=JS.SmilesParser.getChar(b,g));if("\x00"==j&&0==k.order)break;f=JU.PT.isDigit(j)||"%"==j;h=!f&&("_"==j||"["==j||"*"==j||JU.PT.isLetter(j));if(f){switch(j){case "%":if("("==JS.SmilesParser.getChar(b,
g+1)){if(f=JS.SmilesParser.getSubPattern(b,g+1,"("),JS.SmilesParser.getDigits(f,0,d),g+=f.length+3,0>d[0])throw new JS.InvalidSmilesException("Invalid ring designation: "+f);}else if(g+3<=b.length&&(g=JS.SmilesParser.getDigits(b.substring(0,g+3),g+1,d)),10>d[0])throw new JS.InvalidSmilesException("Two digits must follow the % sign");e=d[0];break;default:e=j.charCodeAt(0)-48,g++}this.parseRing(a,e,c,k)}else if(h)switch(j){case "[":case "_":f=JS.SmilesParser.getSubPattern(b,g,j);g+=f.length+("["==j?
2:0);this.isBioSequence&&("["==j&&0>f.indexOf(".")&&0>f.indexOf("_"))&&(f+=".0");c=this.parseAtom(a,null,f,c,k,"["==j,!1,e);-1!=k.order&&0!=k.order&&k.set2a(null,c);break;default:f=!this.isBioSequence&&JU.PT.isUpperCase(j)?JS.SmilesParser.getChar(b,g+1):"\x00";if("X"!=j||"x"!=f)if(!JU.PT.isLowerCase(f)||0==JU.Elements.elementNumberFromSymbol(b.substring(g,g+2),!0))f="\x00";"\x00"!=f&&0<="NA CA BA PA SC AC".indexOf(b.substring(g,g+2))&&(f="\x00");j=JU.PT.isUpperCase(j)&&JU.PT.isLowerCase(f)?2:1;c=
this.parseAtom(a,null,b.substring(g,g+j),c,k,!1,!1,e);g+=j}else throw new JS.InvalidSmilesException("Unexpected character: "+JS.SmilesParser.getChar(b,g));}j=JS.SmilesParser.getChar(b,g);"}"==j&&this.checkBrace(a,j,"}")&&g++;b=b.substring(g);e=!1}},"JS.SmilesSearch,~S,JS.SmilesAtom,~B");h(c$,"checkBioType",function(a,b){if(this.isBioSequence="~"==a.charAt(b)){b++;this.bioType="*";var c=JS.SmilesParser.getChar(a,2);if("~"==c&&("*"==(c=a.charAt(1))||JU.PT.isLowerCase(c)))this.bioType=c,b=3}return b},
"~S,~N");h(c$,"parseMeasure",function(a,b,c){for(var e=b.indexOf(":"),d=!1,f=0>e?b:b.substring(0,e);0!=e;){1==f.length&&(f+="0");var j=this.htMeasures.get(f);if(null==j==0>e)break;try{if(0<e){var k="__dat".indexOf(f.charAt(0));if(2>k)break;var g=A(1,0),h=JS.SmilesParser.getDigits(f,1,g),l=b.indexOf(",",e);0>l&&(l=b.indexOf("-",e+1));if(0>l)break;var m=b.substring(e+1,l);m.startsWith("!")&&(d=!0,m=m.substring(1));var n=e+1==l?0:JU.PT.fVal(m),m=b.substring(l+1),u=0==m.length?3.4028235E38:JU.PT.fVal(m),
j=new JS.SmilesMeasure(a,h,k,n,u,d);a.measures.addLast(j);0<h?this.htMeasures.put(f,j):0==h&&JU.Logger.debugging&&JU.Logger.debug("measure created: "+j)}else{if(!j.addPoint(c.index))break;j.nPoints==j.type&&(this.htMeasures.remove(f),JU.Logger.debugging&&JU.Logger.debug("measure created: "+j));return}if(!j.addPoint(c.index))break}catch(p){if(I(p,NumberFormatException))break;else throw p;}return}throw new JS.InvalidSmilesException("invalid measure: "+b);},"JS.SmilesSearch,~S,JS.SmilesAtom");h(c$,"checkBrace",
function(a,b,c){switch(b){case "{":if(b!=c)break;this.braceCount++;return a.top.haveSelected=!0;case "}":if(b!=c)break;if(0<this.braceCount)return this.braceCount--,!0;break;default:return!1}throw new JS.InvalidSmilesException("Unmatched '}'");},"JS.SmilesSearch,~S,~S");h(c$,"parseNested",function(a,b,c){var e;for(c="$("+c;0<=(e=b.lastIndexOf(c));){var d=JS.SmilesParser.getSubPattern(b,e+1,"("),f=e+d.length+3;b=b.substring(0,e)+"_"+a.addNested(d)+"_"+b.substring(f)}return b},"JS.SmilesSearch,~S,~S");
h(c$,"parseVariables",function(a){for(var b=new JU.Lst,c=new JU.Lst,e,d=0,f=-1;0<=(e=a.indexOf("$",d))&&"("!=JS.SmilesParser.getChar(a,d+1);){d=JS.SmilesParser.skipTo(a,e,"=");if(d<=e+1||'"'!=JS.SmilesParser.getChar(a,d+1))break;e=a.substring(e,d);if(0<e.lastIndexOf("$")||0<e.indexOf("]"))throw new JS.InvalidSmilesException("Invalid variable name: "+e);f=JS.SmilesParser.getSubPattern(a,d+1,'"');b.addLast("["+e+"]");c.addLast(f);d+=f.length+2;d=JS.SmilesParser.skipTo(a,d,";");f=++d}return 0>f?a:JU.PT.replaceStrings(a.substring(f),
b,c)},"~S");h(c$,"parseAtom",function(a,b,c,e,d,f,j,k){if(null==c||0==c.length)throw new JS.InvalidSmilesException("Empty atom definition");var g=null==b?a.addAtom():j?b.addPrimitive():b.addAtomOr();0<this.braceCount&&(g.selected=!0);if(!this.checkLogic(a,c,g,null,e,j,k)){var h=A(1,0);this.isBioSequence&&1==c.length&&(c+=".0");var l=c.charAt(0),m=0,n=!1;if(this.isSmarts&&"!"==l){l=JS.SmilesParser.getChar(c,++m);if("\x00"==l)throw new JS.InvalidSmilesException("invalid '!'");g.not=n=!0}var u=-2147483648,
p=c.indexOf(".");if(0<=p){l=c.substring(m,p);0==l.length&&(l="*");1<l.length?g.residueName=l.toUpperCase():l.equals("*")||(g.residueChar=l);l=c.substring(p+1).toUpperCase();if(0<=(p=l.indexOf("#")))JS.SmilesParser.getDigits(l,p+1,h),g.elementNumber=h[0],l=l.substring(0,p);0==l.length&&(l="*");l.equals("*")||g.setAtomName(l);l="\x00"}for(g.setBioAtom(this.bioType);"\x00"!=l;){g.setAtomName(this.isBioSequence?"0":"");if(JU.PT.isDigit(l)){m=JS.SmilesParser.getDigits(c,m,h);l=h[0];if(-2147483648==l)throw new JS.InvalidSmilesException("Non numeric atomic mass");
"?"==JS.SmilesParser.getChar(c,m)&&(m++,l=-l);g.setAtomicMass(l)}else switch(l){case '"':l=JU.PT.getQuotedStringAt(c,m);m+=l.length+2;g.setAtomType(l);break;case "_":m=JS.SmilesParser.getDigits(c,m+1,h)+1;if(-2147483648==h[0])throw new JS.InvalidSmilesException("Invalid SEARCH primitive: "+c.substring(m));g.iNested=h[0];if(this.isBioSequence&&f&&m!=c.length)throw new JS.InvalidSmilesException("invalid characters: "+c.substring(m));break;case "=":m=JS.SmilesParser.getDigits(c,m+1,h);g.jmolIndex=h[0];
break;case "#":m=JS.SmilesParser.getDigits(c,m+1,h);g.elementNumber=h[0];break;case "-":case "+":m=this.checkCharge(c,m,g);break;case "@":a.haveAtomStereochemistry=!0;m=this.checkChirality(c,m,a.patternAtoms[g.index]);break;default:var p=JS.SmilesParser.getChar(c,m+1),s=c.substring(m+1,m+(JU.PT.isLowerCase(p)&&(!f||!JU.PT.isDigit(JS.SmilesParser.getChar(c,m+2)))?2:1)),r=Character.toUpperCase(l)+s,q=!0;f&&JU.PT.isLetter(l)&&(!n&&(j?b:g).hasSymbol?q=!1:"H"==l?q=!JU.PT.isDigit(p)||"?"==JS.SmilesParser.getChar(c,
m+2):0<="DdhRrvXx".indexOf(l)&&JU.PT.isDigit(p)?q=!1:!r.equals("A")&&!r.equals("Xx")&&(q=0<JU.Elements.elementNumberFromSymbol(r,!0),!q&&""!==s&&(s="",r=r.substring(0,1),q=0<JU.Elements.elementNumberFromSymbol(r,!0))));if(q){if(!f&&!this.isSmarts&&!this.isBioSequence&&!JS.SmilesAtom.allowSmilesUnbracketed(r)||!g.setSymbol(r=l+s))throw new JS.InvalidSmilesException("Invalid atom symbol: "+r);j&&(b.hasSymbol=!0);m+=r.length}else switch(m=JS.SmilesParser.getDigits(c,m+1,h),p=h[0],l){default:throw new JS.InvalidSmilesException("Invalid SEARCH primitive: "+
c.substring(m));case "D":g.setDegree(-2147483648==p?1:p);break;case "d":g.setNonhydrogenDegree(-2147483648==p?1:p);break;case "H":u=-2147483648==p?1:p;break;case "h":g.setImplicitHydrogenCount(-2147483648==p?-1:p);break;case "R":-2147483648==p&&(p=-1);g.setRingMembership(p);a.top.needRingData=!0;break;case "r":if(-2147483648==p)p=-1,g.setRingMembership(p);else{g.setRingSize(p);switch(p){case 500:p=5;break;case 600:p=6}p>a.ringDataMax&&(a.ringDataMax=p)}a.top.needRingData=!0;break;case "v":g.setValence(-2147483648==
p?1:p);break;case "X":g.setConnectivity(-2147483648==p?1:p);break;case "x":g.setRingConnectivity(-2147483648==p?-1:p),a.top.needRingData=!0}}l=JS.SmilesParser.getChar(c,m);if(n&&"\x00"!=l)throw new JS.InvalidSmilesException("'!' may only involve one primitive.");}-2147483648==u&&f&&(u=-2147483647);g.setExplicitHydrogenCount(u);a.patternAtoms[g.index].setExplicitHydrogenCount(u)}null!=e&&0==d.order&&(g.notBondedIndex=e.index);null!=e&&0!=d.order&&(-1==d.order&&(d.order=this.isBioSequence&&k?112:this.isSmarts||
e.isAromatic()&&g.isAromatic()?81:1),f||d.set2a(null,g),0==this.branchLevel&&(17==d.order||112==d.order)&&this.branchLevel++);0==this.branchLevel&&(a.lastChainAtom=g);return g},"JS.SmilesSearch,JS.SmilesAtom,~S,JS.SmilesAtom,JS.SmilesBond,~B,~B,~B");h(c$,"parseRing",function(a,b,c,e){a=Integer.$valueOf(b);b=this.ringBonds.get(a);if(null==b)this.ringBonds.put(a,e);else{this.ringBonds.remove(a);switch(e.order){case -1:e.order=-1!=b.order?b.order:this.isSmarts||c.isAromatic()&&b.atom1.isAromatic()?81:
1;break;case 257:e.order=513;break;case 513:e.order=257}if(-1!=b.order&&b.order!=e.order)throw new JS.InvalidSmilesException("Incoherent bond type for ring");b.set(e);c.bondCount--;b.setAtom2(c)}},"JS.SmilesSearch,~N,JS.SmilesAtom,JS.SmilesBond");h(c$,"checkCharge",function(a,b,c){var e=a.length,d=a.charAt(b),f=1;++b;if(b<e){var j=a.charAt(b);if(JU.PT.isDigit(j)){if(e=A(1,0),b=JS.SmilesParser.getDigits(a,b,e),f=e[0],-2147483648==f)throw new JS.InvalidSmilesException("Non numeric charge");}else for(;b<
e&&a.charAt(b)==d;)b++,f++}c.setCharge("+"==d?f:-f);return b},"~S,~N,JS.SmilesAtom");h(c$,"checkChirality",function(a,b,c){var e=0,d=-2147483648,f=a.length,j,e=0,d=1;if(++b<f){switch(j=a.charAt(b)){case "@":d=2;b++;break;case "H":break;case "A":case "D":case "E":case "O":case "S":case "T":e=b+1<f?JS.SmilesAtom.getChiralityClass(a.substring(b,b+2)):-1;b+=2;break;default:d=JU.PT.isDigit(j)?1:-1}j=b;if(1==d){for(;j<f&&JU.PT.isDigit(a.charAt(j));)j++;if(j>b){try{d=Integer.parseInt(a.substring(b,j))}catch(k){if(I(k,
NumberFormatException))d=-1;else throw k;}b=j}}if(1>d||0>e)throw new JS.InvalidSmilesException("Invalid stereochemistry descriptor");}c.setChiralClass(e);c.setChiralOrder(d);"?"==JS.SmilesParser.getChar(a,b)&&(JU.Logger.info("Ignoring '?' in stereochemistry"),b++);return b},"~S,~N,JS.SmilesAtom");h(c$,"parseBond",function(a,b,c,e,d,f,j){var k=JS.SmilesParser.getChar(c,0);if("."==k){if(null!=e||null!=b)throw new JS.InvalidSmilesException("invalid '.'");this.isBioSequence="~"==JS.SmilesParser.getChar(c,
1);return new JS.SmilesBond(null,null,0,!1)}if("+"==k&&null!=b)throw new JS.InvalidSmilesException("invalid '+'");e=null==b?null==e?new JS.SmilesBond(d,null,this.isBioSequence&&null!=d?j?112:96:-1,!1):e:f?b.addPrimitive():b.addBondOr();if("\x00"!=k&&!this.checkLogic(a,c,null,e,d,f,!1)){if(f="!"==k)if(k=JS.SmilesParser.getChar(c,1),"\x00"==k||"!"==k)throw new JS.InvalidSmilesException("invalid '!'");c=JS.SmilesBond.getBondTypeFromCode(k);65==c&&(a.top.needRingMemberships=!0);if(null==d&&0!=c)throw new JS.InvalidSmilesException("Bond without a previous atom");
switch(c){case 769:case 1025:f&&(f=!1,c=769==c?1025:769);a.haveBondStereochemistry=!0;break;case 257:case 513:a.haveBondStereochemistry=!0;break;case 2:case 1:d.isAromatic()&&(a.top.needRingData=!0)}e.set2(c,f);this.isBioSequence&&null!=b&&b.set2(c,f)}return e},"JS.SmilesSearch,JS.SmilesBond,~S,JS.SmilesBond,JS.SmilesAtom,~B,~B");h(c$,"checkLogic",function(a,b,c,e,d,f,j){for(var k=b.indexOf(","),g=b.length;;){var h=0<k;if(h&&!this.isSmarts||0==k)break;var l="",k=b.indexOf(";");if(0<=k){if(!this.isSmarts||
0==k)break;l="&"+b.substring(k+1);b=b.substring(0,k);h||(b+=l,l="")}var m=0;if(h)for(b+=",";0<(k=b.indexOf(",",m))&&k<=g;){m=b.substring(m,k)+l;if(0==m.length)throw new JS.InvalidSmilesException("missing "+(null==e?"atom":"bond")+" token");null==e?this.parseAtom(a,c,m,null,null,!0,!1,j):this.parseBond(a,e,m,null,d,!1,!1);m=k+1}else if(0<=(k=b.indexOf("&"))||null!=e&&1<g&&!f){if(!this.isSmarts||0==k)break;if(null!=e&&0>k&&1<g){f=new JU.SB;for(h=0;h<g;){var n=b.charAt(h++);f.appendC(n);"!"!=n&&h<g&&
f.appendC("&")}b=f.toString();g=b.length}for(b+="&";0<(k=b.indexOf("&",m))&&k<=g;)m=b.substring(m,k)+l,null==e?this.parseAtom(a,c,m,null,null,!0,!0,j):this.parseBond(a,e,m,null,d,!0,!1),m=k+1}else return!1;return!0}n=b.charAt(k);throw new JS.InvalidSmilesException((this.isSmarts?"invalid placement for '"+n+"'":"["+n+"] notation only valid with SMARTS, not SMILES,")+" in "+b);},"JS.SmilesSearch,~S,JS.SmilesAtom,JS.SmilesBond,JS.SmilesAtom,~B,~B");c$.getSubPattern=h(c$,"getSubPattern",function(a,b,
c){var e,d=1;switch(c){case "[":e="]";break;case '"':case "%":e=c;break;case "(":e=")";break;default:e=c,d=0}for(var f=a.length,j=1,k=b+1;k<f;k++){var g=a.charAt(k);if(g==e){if(j--,0==j)return a.substring(b+d,k+1-d)}else g==c&&j++}throw new JS.InvalidSmilesException("Unmatched "+c);},"~S,~N,~S");c$.getChar=h(c$,"getChar",function(a,b){return b<a.length?a.charAt(b):"\x00"},"~S,~N");c$.getDigits=h(c$,"getDigits",function(a,b,c){for(var e=b,d=a.length;e<d&&JU.PT.isDigit(a.charAt(e));)e++;try{c[0]=Integer.parseInt(a.substring(b,
e))}catch(f){if(I(f,NumberFormatException))c[0]=-2147483648;else throw f;}return e},"~S,~N,~A");c$.skipTo=h(c$,"skipTo",function(a,b,c){for(var e;(e=JS.SmilesParser.getChar(a,++b))!=c&&"\x00"!=e;);return"\x00"==e?-1:b},"~S,~N,~S");c$.cleanPattern=h(c$,"cleanPattern",function(a){a=JU.PT.replaceAllCharacters(a," \t\n\r","");a=JU.PT.rep(a,"^^","'");for(var b=0,c=0;0<=(b=a.indexOf("//*"))&&(c=a.indexOf("*//"))>=b;)a=a.substring(0,b)+a.substring(c+3);return a=JU.PT.rep(a,"//","")},"~S")});y("JS");E(null,
"JS.SmilesExt","java.lang.Float JU.AU $.BS $.Lst $.M4 $.Measure $.P3 J.api.Interface JU.Logger".split(" "),function(){c$=H(function(){this.sm=this.e=null;G(this,arguments)},JS,"SmilesExt");K(c$,function(){});h(c$,"init",function(a){this.e=a;this.sm=this.e.vwr.getSmilesMatcher();return this},"~O");h(c$,"getSmilesCorrelation",function(a,b,c,e,d,f,j,k,g,h,l,m){var n=null==g?0.1:3.4028235E38;try{null==e&&(e=new JU.Lst,d=new JU.Lst);var u=new JU.M4,p=new JU.P3,s=this.e.vwr.ms.at,r=this.e.vwr.ms.ac,q=this.sm.getCorrelationMaps(c,
s,r,a,m|4194304);null==q&&this.e.evalError(this.sm.getLastException(),null);if(0==q.length)return NaN;var y=q[0];for(a=0;a<y.length;a++)e.addLast(s[y[a]]);q=this.sm.getCorrelationMaps(c,s,r,b,m);null==q&&this.e.evalError(this.sm.getLastException(),null);if(0==q.length)return NaN;JU.Logger.info(q.length+" mappings found");if(l||!k){b=3.4028235E38;c=null;for(a=0;a<q.length;a++){d.clear();for(var t=0;t<q[a].length;t++)d.addLast(s[q[a][t]]);J.api.Interface.getInterface("JU.Eigen",this.e.vwr,"script");
var z=JU.Measure.getTransformMatrix4(e,d,u,p);JU.Logger.info("getSmilesCorrelation stddev="+z);if(null!=j&&z<n){for(var w=new JU.BS,t=0;t<q[a].length;t++)w.set(q[a][t]);j.addLast(w)}z<b&&(c=q[a],null!=f&&f.setM4(u),null!=h&&h.setT(p),b=z)}null!=g&&(g[0]=y,g[1]=c);d.clear();for(a=0;a<c.length;a++)d.addLast(s[c[a]]);return b}for(a=0;a<q.length;a++)for(t=0;t<q[a].length;t++)d.addLast(s[q[a][t]])}catch(x){if(I(x,Exception))this.e.evalError(x.getMessage(),null);else throw x;}return 0},"JU.BS,JU.BS,~S,JU.Lst,JU.Lst,JU.M4,JU.Lst,~B,~A,JU.P3,~B,~N");
h(c$,"getSmilesMatches",function(a,b,c,e,d,f,j){if(0==a.length||a.equals("H")||a.equals("*")){var k=!f;try{return this.e.vwr.getSmilesOpt(c,0,0,(a.equals("H")?1:0)|(a.equals("*")?2:0)|(k?262:0))}catch(g){if(I(g,Exception))this.e.evalError(g.getMessage(),null);else throw g;}}var h;if(null==e)try{if(null==b)h=this.sm.getSubstructureSetArray(a,this.e.vwr.ms.at,this.e.vwr.ms.ac,c,null,d?131072:65536);else{var l=this.sm.find(a,b,d,j);if(!f)return!j?l:0==l.length?A(0,0):l[0];var m=new JU.BS;for(f=0;f<l.length;f++)for(var n=
l[f],u=n.length;0<=--u;)m.set(n[u]);if(!d)return Integer.$valueOf(m.cardinality());var p=A(m.cardinality(),0);d=0;for(var s=m.nextSetBit(0);0<=s;s=m.nextSetBit(s+1))p[d++]=s+1;return p}}catch(r){if(I(r,Exception))return this.e.evalError(r.getMessage(),null),null;throw r;}else{h=new JU.Lst;d=this.getSmilesCorrelation(e,c,a,null,null,null,h,!1,null,null,!1,d?131072:65536);if(Float.isNaN(d))return f?new JU.BS:N(-1,[]);this.e.showString("RMSD "+d+" Angstroms");h=h.toArray(Array(h.size()))}if(f){m=new JU.BS;
for(f=0;f<h.length;f++)m.or(h[f]);return m}d=new JU.Lst;for(f=0;f<h.length;f++)d.addLast(h[f]);return d},"~S,~S,JU.BS,JU.BS,~B,~B,~B");h(c$,"getFlexFitList",function(a,b,c,e){var d=JU.AU.newInt2(2);this.getSmilesCorrelation(a,b,c,null,null,null,null,!1,d,null,!1,e?131072:65536);if(null==d[0])return null;a=this.e.vwr.ms.getDihedralMap(d[0]);b=null==a?null:this.e.vwr.ms.getDihedralMap(d[1]);if(null==b||b.length!=a.length)return null;d=R(a.length,3,0);c=this.e.vwr.ms.at;JS.SmilesExt.getTorsions(c,b,
d,0);JS.SmilesExt.getTorsions(c,a,d,1);b=R(6*a.length,0);for(e=c=0;c<a.length;c++){var f=a[c];b[e++]=f[0];b[e++]=f[1];b[e++]=f[2];b[e++]=f[3];b[e++]=d[c][0];b[e++]=d[c][1]}return b},"JU.BS,JU.BS,~S,~B");c$.getTorsions=h(c$,"getTorsions",function(a,b,c,e){for(var d=b.length;0<=--d;){var f=b[d],f=JU.Measure.computeTorsion(a[f[0]],a[f[1]],a[f[2]],a[f[3]],!0);1==e&&(180<f-c[d][0]?f-=360:-180>=f-c[d][0]&&(f+=360));c[d][e]=f}},"~A,~A,~A,~N")})})(Clazz,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.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);
