(function(S,T,U,V,W,X,Y,Z,$,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka,la,ma,g,na,oa,pa,qa,ra,sa,ta,ua,va,n,wa,xa,ya,za,O,z,P,F,G,H,Aa,I,Ba,D,E,K,Ca,N,L,M,Da,Q,Ea,Fa,Ga,Ha,Ia,Ja,R){z("J.smiles");F(["JU.BS","$.V3"],"J.smiles.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)},J.smiles,"VTemp");L(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})});z("J.api");Q(J.api,"SmilesMatcherInterface");z("J.smiles");F(["J.api.SmilesMatcherInterface"],"J.smiles.SmilesMatcher","JU.AU $.BS $.PT J.smiles.InvalidSmilesException $.SmilesGenerator $.SmilesParser J.util.BSUtil".split(" "),function(){c$=N(J.smiles,"SmilesMatcher",null,J.api.SmilesMatcherInterface);n(c$,"getLastException",function(){return J.smiles.InvalidSmilesException.getLastError()});n(c$,
"getMolecularFormula",function(a,b){J.smiles.InvalidSmilesException.setLastError(null);try{var c=J.smiles.SmilesParser.getMolecule(a,b);c.createTopoMap(null);c.nodes=c.jmolAtoms;return c.getMolecularFormula(!b)}catch(d){if(D(d,J.smiles.InvalidSmilesException))return null==J.smiles.InvalidSmilesException.getLastError()&&J.smiles.InvalidSmilesException.setLastError(d.toString()),null;throw d;}},"~S,~B");n(c$,"getSmiles",function(a,b,c,d,e,f,k){J.smiles.InvalidSmilesException.setLastError(null);try{return d?
(new J.smiles.SmilesGenerator).getBioSmiles(a,b,c,e,f,k):(new J.smiles.SmilesGenerator).getSmiles(a,b,c)}catch(j){if(D(j,J.smiles.InvalidSmilesException))return null==J.smiles.InvalidSmilesException.getLastError()&&J.smiles.InvalidSmilesException.setLastError(j.toString()),null;throw j;}},"~A,~N,JU.BS,~B,~B,~B,~S");g(c$,"areEqual",function(a,b){var c=this.find(a,b,!1,!1);return null==c?-1:c.length},"~S,~S");g(c$,"areEqual",function(a,b){var c=this.find(a,b,!1,!0,!0);return null!=c&&1==c.length},"~S,J.smiles.SmilesSearch");
g(c$,"find",function(a,b,c,d){J.smiles.InvalidSmilesException.setLastError(null);try{var e=J.smiles.SmilesParser.getMolecule(b,!1);return this.find(a,e,c,!c,d)}catch(f){if(D(f,Exception))return null==J.smiles.InvalidSmilesException.getLastError()&&J.smiles.InvalidSmilesException.setLastError(f.toString()),System.out.println(f.toString()),null;throw f;}},"~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),d=
this.getMolecularFormula(b,!1);if(!c.equals(d))return"none";var e,c=this.countStereo(a),d=this.countStereo(b);e=c==d&&0<this.areEqual(b,a);if(!e){e=a+b;if(0<=e.indexOf("/")||0<=e.indexOf("\\")||0<=e.indexOf("@")){if(c==d&&0<c&&(a=this.reverseChirality(a),e=0<this.areEqual(a,b)))return"enantiomers";if(e=0<this.areEqual("/nostereo/"+b,a))return c==d?"diastereomers":"ambiguous stereochemistry!"}return"constitutional isomers"}return"identical"},"~S,~S");n(c$,"reverseChirality",function(a){a=JU.PT.simpleReplace(a,
"@@","!@");a=JU.PT.simpleReplace(a,"@","@@");a=JU.PT.simpleReplace(a,"!@@","@");a=JU.PT.simpleReplace(a,"@@SP","@SP");a=JU.PT.simpleReplace(a,"@@OH","@OH");return a=JU.PT.simpleReplace(a,"@@TB","@TB")},"~S");n(c$,"getSubstructureSet",function(a,b,c,d,e,f){return this.match(a,b,c,d,null,e,!1,f,1)},"~S,~A,~N,JU.BS,~B,~B");n(c$,"getSubstructureSets",function(a,b,c,d,e,f,k){J.smiles.InvalidSmilesException.setLastError(null);var j=new J.smiles.SmilesParser(!0),h=null;try{h=j.parse(""),h.firstMatchOnly=
!1,h.matchAllAtoms=!1,h.jmolAtoms=b,h.jmolAtomCount=Math.abs(c),h.setSelected(e),h.getRingData(!0,d,k),h.asVector=!1,h.subSearches=Array(1),h.getSelections()}catch(g){if(!D(g,J.smiles.InvalidSmilesException))throw g;}b=new JU.BS;for(e=0;e<a.length;e++)if(null==a[e]||0==a[e].length||a[e].startsWith("#"))f.addLast(null);else try{h.clear();var l=j.getSearch(h,J.smiles.SmilesParser.cleanPattern(a[e]),d);h.subSearches[0]=l;var m=J.util.BSUtil.copy(h.search(!1));f.addLast(m);b.or(m);if(b.cardinality()==
c)break}catch(q){if(D(q,Exception))null==J.smiles.InvalidSmilesException.getLastError()&&J.smiles.InvalidSmilesException.setLastError(q.toString()),System.out.println(q.toString());else throw q;}},"~A,~A,~N,~N,JU.BS,JU.List,~A");n(c$,"getSubstructureSetArray",function(a,b,c,d,e,f,k){return this.match(a,b,c,d,e,f,!1,k,2)},"~S,~A,~N,JU.BS,JU.BS,~B,~B");n(c$,"getCorrelationMaps",function(a,b,c,d,e,f){return this.match(a,b,c,d,null,e,!1,f,3)},"~S,~A,~N,JU.BS,~B,~B");g(c$,"find",function(a,b,c,d,e){var f=
new JU.BS;b.createTopoMap(f);return this.match(a,b.jmolAtoms,-b.jmolAtoms.length,null,f,c,d,e,2)},"~S,J.smiles.SmilesSearch,~B,~B,~B");g(c$,"match",function(a,b,c,d,e,f,k,j,h){J.smiles.InvalidSmilesException.setLastError(null);try{var g=J.smiles.SmilesParser.getMolecule(a,f);g.jmolAtoms=b;g.jmolAtomCount=Math.abs(c);0>c&&(g.isSmilesFind=!0);g.setSelected(d);g.getSelections();g.bsRequired=null;g.setRingData(e);g.firstMatchOnly=j;g.matchAllAtoms=k;switch(h){case 1:return g.asVector=!1,g.search(!1);
case 2:g.asVector=!0;var l=g.search(!1);return l.toArray(Array(l.size()));case 3:g.getMaps=!0;var m=g.search(!1);return m.toArray(JU.AU.newInt2(m.size()))}}catch(q){if(D(q,Exception))null==J.smiles.InvalidSmilesException.getLastError()&&J.smiles.InvalidSmilesException.setLastError(q.toString()),System.out.println(q.toString());else throw q;}return null},"~S,~A,~N,JU.BS,JU.BS,~B,~B,~B,~N");g(c$,"countStereo",function(a){a=JU.PT.simpleReplace(a,"@@","@");for(var b=a.lastIndexOf("@")+1,c=0;0<=--b;)"@"==
a.charAt(b)&&c++;return c},"~S");K(c$,"MODE_BITSET",1,"MODE_ARRAY",2,"MODE_MAP",3)});z("J.smiles");F(["java.lang.Exception"],"J.smiles.InvalidSmilesException",null,function(){c$=N(J.smiles,"InvalidSmilesException",Exception);c$.getLastError=g(c$,"getLastError",function(){return J.smiles.InvalidSmilesException.lastError});c$.setLastError=g(c$,"setLastError",function(a){J.smiles.InvalidSmilesException.lastError=a},"~S");I(c$,function(a){M(this,J.smiles.InvalidSmilesException,[a]);J.smiles.InvalidSmilesException.lastError=
a},"~S");I(c$,function(a){M(this,J.smiles.InvalidSmilesException,[a]);J.smiles.InvalidSmilesException.lastError=a.toString()},"Throwable");I(c$,function(a,b){M(this,J.smiles.InvalidSmilesException,[a,b]);J.smiles.InvalidSmilesException.lastError=a+"\n"+b.getCause()},"~S,Throwable");K(c$,"lastError",null)});z("J.smiles");F(["J.util.JmolMolecule","JU.BS","$.List","J.smiles.VTemp"],"J.smiles.SmilesSearch","java.util.Arrays $.Hashtable JU.AU $.SB $.V3 J.smiles.SmilesAromatic $.SmilesAtom $.SmilesBond $.SmilesMeasure $.SmilesParser J.util.BSUtil $.Logger".split(" "),
function(){c$=H(function(){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;G(this,arguments)},J.smiles,"SmilesSearch",J.util.JmolMolecule);L(c$,function(){this.patternAtoms=Array(16);this.measures=new JU.List;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 J.smiles.VTemp});g(c$,"toString",function(){var a=(new JU.SB).append(this.pattern);a.append("\nmolecular formula: "+this.getMolecularFormula(!0));return a.toString()});g(c$,"setSelected",function(a){null==a&&(a=J.util.BSUtil.newBitSet(this.jmolAtomCount),a.setBits(0,this.jmolAtomCount));this.bsSelected=a},"JU.BS");g(c$,"setAtomArray",function(){this.patternAtoms.length>
this.atomCount&&(this.patternAtoms=JU.AU.arrayCopyObject(this.patternAtoms,this.atomCount));this.nodes=this.patternAtoms});g(c$,"addAtom",function(){this.atomCount>=this.patternAtoms.length&&(this.patternAtoms=JU.AU.doubleLength(this.patternAtoms));var a=(new J.smiles.SmilesAtom).setIndex(this.atomCount);this.patternAtoms[this.atomCount]=a;this.atomCount++;return a});g(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");g(c$,"clear",function(){this.bsReturn.clearAll();this.nNested=0;this.nestedBond=this.htNested=null;this.clearBsFound(-1)});g(c$,"setNested",function(a,b){this.top.htNested.put("_"+a,b)},"~N,~O");g(c$,"getNested",function(a){return this.top.htNested.get("_"+a)},"~N");g(c$,"getMissingHydrogenCount",function(){for(var a=0,b,c=0;c<this.atomCount;c++)if(0<=(b=this.patternAtoms[c].missingHydrogenCount))a+=b;return a});g(c$,"setRingData",function(a){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");g(c$,"getRingData",function(a,b,c){var d=0!=(b&4),e=0!=(b&8);d&&null==c&&(c=JU.AU.createArrayOfArrayList(4));e&&this.needAromatic&&(this.bsAromatic=J.smiles.SmilesAromatic.checkAromaticDefined(this.jmolAtoms,
this.bsSelected),d=!1);0>this.ringDataMax&&(this.ringDataMax=8);d&&6>this.ringDataMax&&(this.ringDataMax=6);a&&(this.ringCounts=E(this.jmolAtomCount,0),this.ringConnections=E(this.jmolAtomCount,0),this.ringData=Array(this.ringDataMax+1));this.ringSets=new JU.SB;for(var f="****";f.length<this.ringDataMax;)f+=f;var k=null;for(b=3;b<=this.ringDataMax;b++)if(!(b>this.jmolAtomCount)){var j="*1"+f.substring(0,b-2)+"*1",j=J.smiles.SmilesParser.getMolecule(j,!0),j=this.subsearch(j,!1,!0);if(null!=c&&5>=b){for(var h=
new JU.List,g=j.size();0<=--g;)h.addLast(j.get(g));c[b-3]=h}if(this.needAromatic){if(!e&&(!d||5==b||6==b))for(h=j.size();0<=--h;)g=j.get(h),(e||J.smiles.SmilesAromatic.isFlatSp2Ring(this.jmolAtoms,this.bsSelected,g,d?0.1:0.01))&&this.bsAromatic.or(g);if(d)switch(b){case 5:k=j;break;case 6:e?this.bsAromatic=J.smiles.SmilesAromatic.checkAromaticDefined(this.jmolAtoms,this.bsAromatic):J.smiles.SmilesAromatic.checkAromaticStrict(this.jmolAtoms,this.bsAromatic,k,j),c[3]=new JU.List,this.setAromatic56(k,
this.bsAromatic5,5,c[3]),this.setAromatic56(j,this.bsAromatic6,6,c[3])}}if(a){this.ringData[b]=new JU.BS;for(var l=0;l<j.size();l++){h=j.get(l);this.ringData[b].or(h);for(g=h.nextSetBit(0);0<=g;g=h.nextSetBit(g+1))this.ringCounts[g]++}}}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");g(c$,"setAromatic56",function(a,
b,c,d){for(var e=0;e<a.size();e++){var f=a.get(e);this.v.bsTemp.clearAll();this.v.bsTemp.or(f);this.v.bsTemp.and(this.bsAromatic);this.v.bsTemp.cardinality()==c&&(b.or(f),null!=d&&d.addLast(f))}},"JU.List,JU.BS,~N,JU.List");g(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)},"J.smiles.SmilesSearch,~B,~B");g(c$,"search",function(a){this.ignoreStereochemistry=0!=(this.flags&2);this.noAromatic=0!=(this.flags&1);this.aromaticDouble=0!=(this.flags&16);J.util.Logger.debugging&&!this.isSilent&&J.util.Logger.debug("SmilesSearch processing "+this.pattern);if(null==this.vReturn&&(this.asVector||this.getMaps))this.vReturn=new JU.List;null==this.bsSelected&&(this.bsSelected=J.util.BSUtil.newBitSet(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.atomCount&&this.checkMatch(null,-1,-1,a);return this.asVector||this.getMaps?this.vReturn:this.bsReturn},"~B");g(c$,"checkMatch",function(a,b,c,d){var e;if(null==a)null==this.nestedBond?this.clearBsFound(-1):
this.bsReturn.clearAll();else{if(this.bsFound.get(c)||!this.bsSelected.get(c))return!0;e=this.jmolAtoms[c];if(!this.isRingCheck){if(null!=a.atomsOr){for(var f=0;f<a.nAtomsOr;f++)if(!this.checkMatch(a.atomsOr[f],b,c,d))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}e=e.getEdges();for(f=a.getBondCount();0<=--f;){var k=a.getBond(f);if(k.getAtomIndex2()==a.index){var j=k.getAtom1(),
h=j.getMatchingAtom();switch(k.order){case 96:case 112:if(!this.checkMatchBond(a,j,k,c,h,null))return!0;break;default:for(var g=0;g<e.length&&(!(e[g].getAtomIndex1()==h||e[g].getAtomIndex2()==h)||!e[g].isCovalent());g++);if(g==e.length||!this.checkMatchBond(a,j,k,c,h,e[g]))return!0}}}this.patternAtoms[a.index].setMatchingAtom(c);J.util.Logger.debugging&&!this.isSilent&&J.util.Logger.debug("pattern atom "+b+" "+a);this.bsFound.set(c)}if(!this.continueMatch(b,c,d))return!1;0<=c&&this.clearBsFound(c);
return!0},"J.smiles.SmilesAtom,~N,~N,~B");g(c$,"continueMatch",function(a,b,c){var d,e;if(++a<this.atomCount){var f=this.patternAtoms[a],k=0<=b?f.getBondTo(null):0==a?this.nestedBond:null;if(null==k){k=J.util.BSUtil.copy(this.bsFound);if(0<=f.notBondedIndex){d=this.patternAtoms[f.notBondedIndex];var j=this.jmolAtoms[d.getMatchingAtom()];if("\x00"==d.bioType){e=j.getEdges();for(d=0;d<e.length;d++)k.set(e[d].getOtherAtomNode(j).getIndex())}else d=j.getOffsetResidueAtom("0",1),0<=d&&k.set(d),d=j.getOffsetResidueAtom("0",
-1),0<=d&&k.set(d)}b=0<=b&&f.isBioAtom&&(null==f.atomName||null!=f.residueChar);for(j=this.bsSelected.nextSetBit(0);0<=j;j=this.bsSelected.nextSetBit(j+1)){if(!k.get(j)&&!this.checkMatch(f,a,j,c))return!1;b&&(d=this.jmolAtoms[j].getOffsetResidueAtom(f.atomName,1),0<=d&&(j=d-1))}this.bsFound=k;return!0}d=this.jmolAtoms[k.getAtom1().getMatchingAtom()];switch(k.order){case 96:j=d.getOffsetResidueAtom(f.atomName,1);if(0<=j){k=J.util.BSUtil.copy(this.bsFound);d.getGroupBits(this.bsFound);if(!this.checkMatch(f,
a,j,c))return!1;this.bsFound=k}return!0;case 112:b=new JU.List;d.getCrossLinkLeadAtomIndexes(b);k=J.util.BSUtil.copy(this.bsFound);d.getGroupBits(this.bsFound);for(j=0;j<b.size();j++)if(!this.checkMatch(f,a,b.get(j).intValue(),c))return!1;this.bsFound=k;return!0}e=d.getEdges();if(null!=e)for(j=0;j<e.length;j++)if(!this.checkMatch(f,a,d.getBondedAtomIndex(j),c))return!1;this.clearBsFound(b);return!0}if(!this.ignoreStereochemistry&&!this.checkStereochemistry())return!0;k=new JU.BS;for(j=f=0;j<this.atomCount;j++)if(b=
this.patternAtoms[j].getMatchingAtom(),c||!this.top.haveSelected||this.patternAtoms[j].selected){f++;k.set(b);this.patternAtoms[j].isBioAtom&&null==this.patternAtoms[j].atomName&&this.jmolAtoms[b].getGroupBits(k);if(c)break;!this.isSmarts&&0<this.patternAtoms[j].missingHydrogenCount&&this.getHydrogens(this.jmolAtoms[b],k)}if(null!=this.bsRequired&&!this.bsRequired.intersects(k)||this.matchAllAtoms&&k.cardinality()!=this.selectedAtomCount)return!0;if(null!=this.bsCheck)if(c){this.bsCheck.clearAll();
for(j=0;j<this.atomCount;j++)this.bsCheck.set(this.patternAtoms[j].getMatchingAtom());if(this.bsCheck.cardinality()!=this.atomCount)return!0}else if(k.cardinality()!=this.atomCount)return!0;this.bsReturn.or(k);if(this.getMaps){a=E(f,0);for(k=j=0;j<this.atomCount;j++)if(c||!this.top.haveSelected||this.patternAtoms[j].selected)a[k++]=this.patternAtoms[j].getMatchingAtom();this.vReturn.addLast(a);return!this.firstMatchOnly}if(this.asVector){c=!0;for(j=this.vReturn.size();0<=--j&&c;)c=!this.vReturn.get(j).equals(k);
if(!c)return!0;this.vReturn.addLast(k)}if(this.isRingCheck){this.ringSets.append(" ");for(d=3*a+2;--d>a;)this.ringSets.append("-").appendI(this.patternAtoms[(d<=2*a?2*a-d+1:d-1)%a].getMatchingAtom());this.ringSets.append("- ");return!0}return this.firstMatchOnly?!1:k.cardinality()!=this.selectedAtomCount},"~N,~N,~B");g(c$,"clearBsFound",function(a){0>a?null==this.bsCheck&&this.bsFound.clearAll():this.bsFound.clear(a)},"~N");g(c$,"getHydrogens",function(a,b){for(var c=a.getEdges(),d=-1,e=0;e<c.length;e++)if(1==
this.jmolAtoms[a.getBondedAtomIndex(e)].getElementNumber()){d=a.getBondedAtomIndex(e);if(null==b)break;b.set(d)}return 0<=d?this.jmolAtoms[d]:null},"J.util.JmolNode,JU.BS");g(c$,"checkPrimitiveAtom",function(a,b){for(var c=this.jmolAtoms[b],d=a.not;;){var e;if(0<a.iNested){d=this.getNested(a.iNested);P(d,J.smiles.SmilesSearch)&&(a.isBioAtom&&(d.nestedBond=a.getBondTo(null)),d=this.subsearch(d,!0,!1),null==d&&(d=new JU.BS),a.isBioAtom||this.setNested(a.iNested,d));d=a.not!=d.get(b);break}if(a.isBioAtom){if(null!=
a.atomName&&(a.isLeadAtom()?!c.isLeadAtom():!a.atomName.equals(c.getAtomName().toUpperCase())))break;if(null!=a.residueName&&!a.residueName.equals(c.getGroup3(!1).toUpperCase()))break;if(null!=a.residueChar){if(a.isDna()&&!c.isDna()||a.isRna()&&!c.isRna()||a.isProtein()&&!c.isProtein()||a.isNucleic()&&!c.isNucleic())break;e=c.getGroup1("\x00").toUpperCase();e=a.residueChar.equals(e);switch(a.residueChar.charAt(0)){case "N":e=a.isNucleic()?c.isNucleic():e;break;case "R":e=a.isNucleic()?c.isPurine():
e;break;case "Y":e=a.isNucleic()?c.isPyrimidine():e}if(!e)break}if(0<=a.elementNumber&&a.elementNumber!=c.getElementNumber())break;if(a.notCrossLinked&&c.getCrossLinkLeadAtomIndexes(null))break}else{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;e=a.isAromatic();if(!this.noAromatic&&!a.aromaticAmbiguous&&e!=this.bsAromatic.get(b))break;if(-2147483648!=(e=a.getAtomicMass())){var f=
c.getIsotopeNumber();if(0<=e&&e!=f||0>e&&0!=f&&-e!=f)break}if(-2147483648!=(e=a.getCharge())&&e!=c.getFormalCharge())break;e=a.getCovalentHydrogenCount()+a.missingHydrogenCount;if(0<=e&&e!=c.getCovalentHydrogenCount())break;e=a.implicitHydrogenCount;if(-2147483648!=e&&(f=c.getImplicitHydrogenCount(),-1==e?0==f:e!=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&&(e=this.ringConnections[b],-1==a.ringConnectivity&&0==e||-1!=a.ringConnectivity&&e!=a.ringConnectivity))break}d=!d;break}return d},"J.smiles.SmilesAtom,~N");g(c$,"checkMatchBond",function(a,b,c,d,e,f){if(null!=c.bondsOr){for(var k=0;k<c.nBondsOr;k++)if(this.checkMatchBond(a,b,c.bondsOr[k],d,e,f))return!0;return!1}if(null==c.primitives){if(!this.checkPrimitiveBond(c,d,e,f))return!1}else for(a=
0;a<c.nPrimitives;a++)if(!this.checkPrimitiveBond(c.primitives[a],d,e,f))return!1;c.matchingBond=f;return!0},"J.smiles.SmilesAtom,J.smiles.SmilesAtom,J.smiles.SmilesBond,~N,~N,J.util.JmolEdge");g(c$,"checkPrimitiveBond",function(a,b,c,d){var e=!1;switch(a.order){case 96:return a.isNot!=(this.jmolAtoms[c].getOffsetResidueAtom("0",1)==this.jmolAtoms[b].getOffsetResidueAtom("0",0));case 112:return a.isNot!=this.jmolAtoms[b].isCrossLinked(this.jmolAtoms[c])}var f=!this.noAromatic&&this.bsAromatic.get(b),
k=!this.noAromatic&&this.bsAromatic.get(c);d=d.getCovalentOrder();if(f&&k)switch(a.order){case 17:case 65:e=J.smiles.SmilesSearch.isRingBond(this.ringSets,b,c);break;case 1:e=!this.isSmarts||!J.smiles.SmilesSearch.isRingBond(this.ringSets,b,c);break;case 2:e=!this.isSmarts||this.aromaticDouble&&(2==d||514==d);break;case 769:case 1025:case 81:case -1:e=!0}else switch(a.order){case 81:case -1:e=!0;break;case 1:case 257:case 513:e=1==d||1041==d||1025==d;break;case 769:e=d==(this.isSmilesFind?33:1);break;
case 1025:e=d==(this.isSmilesFind?97:1);break;case 2:e=2==d;break;case 3:e=3==d;break;case 65:e=J.smiles.SmilesSearch.isRingBond(this.ringSets,b,c)}return e!=a.isNot},"J.smiles.SmilesBond,~N,~N,J.util.JmolEdge");c$.isRingBond=g(c$,"isRingBond",function(a,b,c){return null!=a&&0<=a.indexOf("-"+b+"-"+c+"-")},"JU.SB,~N,~N");g(c$,"checkStereochemistry",function(){for(var a=0;a<this.measures.size();a++)if(!this.measures.get(a).check())return!1;if(this.haveAtomStereochemistry){J.util.Logger.debugging&&J.util.Logger.debug("checking stereochemistry...");
for(var b=null,c=null,d=null,e=null,f=null,k=null,j=c=null,a=0;a<this.atomCount;a++){var h=this.patternAtoms[a],g=this.jmolAtoms[h.getMatchingAtom()],k=h.missingHydrogenCount;0>k&&(k=0);var l=h.getChiralClass();if(-2147483648!=l){var m=h.getChiralOrder();if(this.isSmilesFind&&g.getAtomSite()>>8!=l)return!1;J.util.Logger.debugging&&J.util.Logger.debug("...type "+l+" for pattern atom "+h+" "+g);switch(l){case 2:c=h.getBond(0).getOtherAtom(h);j=h.getBond(1).getOtherAtom(h);if(null==c||null==j)continue;
for(d=b=h;2==c.getBondCount()&&2==j.getBondCount()&&4==c.getValence()&&4==j.getValence();)h=c.getBondNotTo(b,!0),b=c,c=h.getOtherAtom(c),h=j.getBondNotTo(d,!0),d=j,j=h.getOtherAtom(j);h=c;e=Array(6);e[4]=(new J.smiles.SmilesAtom).setIndex(604);d=h.getBondCount();for(b=0;b<d;b++)c=h.bonds[b].getOtherAtom(h),2==h.bonds[b].matchingBond.getCovalentOrder()?null==j&&(j=c):null==e[0]?e[0]=this.getJmolAtom(c.getMatchingAtom()):e[1]=this.getJmolAtom(c.getMatchingAtom());if(null==j)continue;d=j.getBondCount();
if(2>d||3<d)continue;for(b=0;b<d;b++)c=j.bonds[b].getOtherAtom(j),2!=j.bonds[b].matchingBond.getCovalentOrder()&&(null==e[2]?e[2]=this.getJmolAtom(c.getMatchingAtom()):e[3]=this.getJmolAtom(c.getMatchingAtom()));if(this.isSmilesFind&&(null==e[1]&&this.getX(h,e,1,!1,!0),null==e[3]&&this.getX(j,e,3,!1,!1),!this.setSmilesCoordinates(g,h,j,e)))return!1;null==e[1]&&this.getX(h,e,1,!0,!1);null==e[3]&&this.getX(j,e,3,!0,!1);if(!J.smiles.SmilesSearch.checkStereochemistryAll(h.not,g,l,m,e[0],e[1],e[2],e[3],
null,null,this.v))return!1;continue;case 4:case 8:case 5:case 6:b=this.getJmolAtom(h.getMatchingBondedAtom(0));switch(k){case 0:c=this.getJmolAtom(h.getMatchingBondedAtom(1));break;case 1:c=this.getHydrogens(this.getJmolAtom(h.getMatchingAtom()),null);h.isFirst&&(d=c,c=b,b=d);break;default:continue}d=this.getJmolAtom(h.getMatchingBondedAtom(2-k));e=this.getJmolAtom(h.getMatchingBondedAtom(3-k));f=this.getJmolAtom(h.getMatchingBondedAtom(4-k));k=this.getJmolAtom(h.getMatchingBondedAtom(5-k));if(this.isSmilesFind&&
!this.setSmilesCoordinates(g,h,j,[b,c,d,e,f,k])||!J.smiles.SmilesSearch.checkStereochemistryAll(h.not,g,l,m,b,c,d,e,f,k,this.v))return!1}}}}if(this.haveBondStereochemistry)for(b=0;b<this.atomCount;b++){c=this.patternAtoms[b];e=f=j=null;l=g=a=0;d=c.getBondCount();m=!1;for(k=0;k<d;k++){var h=c.getBond(k),q=h.getAtom2()===c,s=h.order;switch(s){case 769:case 1025:case 2:if(q)continue;j=h.getAtom2();l=s;(m=2!=s)&&(a=h.isNot?-1:1);break;case 257:case 513:f=q?h.getAtom1():h.getAtom2(),a=q!=(257==s)?1:-1}}if(m){h=
c.getBondNotTo(j,!1);if(null==h)return!1;f=h.getOtherAtom(c);h=j.getBondNotTo(c,!1);if(null==h)return!1;e=h.getOtherAtom(j)}else{if(null==j||0==a)continue;d=j.getBondCount();for(k=0;k<d&&0==g;k++)switch(h=j.getBond(k),q=h.getAtom2()===j,s=h.order,s){case 257:case 513:e=q?h.getAtom1():h.getAtom2(),g=q!=(257==s)?1:-1}if(0==g)continue}this.isSmilesFind&&this.setSmilesBondCoordinates(c,j,l);c=this.getJmolAtom(c.getMatchingAtom());j=this.getJmolAtom(j.getMatchingAtom());h=this.getJmolAtom(f.getMatchingAtom());
d=this.getJmolAtom(e.getMatchingAtom());if(null==h||null==d)return!1;J.smiles.SmilesMeasure.setTorsionData(h,c,j,d,this.v,m);if(m){if(g=769==l?1:-1,j=this.v.vTemp1.dot(this.v.vTemp2),0.05>j||0.95<j||0<this.v.vNorm1.dot(this.v.vNorm2)*a*g)return!1}else if(0>this.v.vTemp1.dot(this.v.vTemp2)*a*g)return!1}return!0});g(c$,"getX",function(a,b,c,d,e){var f=this.getJmolAtom(a.getMatchingAtom()),k=a.isFirst||3==c;if(d){if(this.isSmarts){var j=f.getEdges();for(d=0;d<j.length;d++)if(2!=j[d].getCovalentOrder()){var h=
this.jmolAtoms[f.getBondedAtomIndex(d)];if(h!==b[c-1]){b[c]=h;break}}}if(null==b[c]){j=new JU.V3;for(d=h=0;4>d;d++)null!=b[d]&&(h++,j.sub(b[d]));0==j.length()?(j.setT(b[4]),k=!1):(j.scaleAdd2(h+1,this.getJmolAtom(a.getMatchingAtom()),j),k=this.isSmilesFind||k);b[c]=(new J.smiles.SmilesAtom).setIndex(-1);b[c].setT(j)}}null==b[c]&&(b[c]=this.getHydrogens(f,null),e&&(k=!0));null!=b[c]&&k&&(h=b[c],b[c]=b[c-1],b[c-1]=h)},"J.smiles.SmilesAtom,~A,~N,~B,~B");c$.checkStereochemistryAll=g(c$,"checkStereochemistryAll",
function(a,b,c,d,e,f,k,j,h,g,l){switch(c){default:case 2:case 4:return a==(J.smiles.SmilesSearch.getHandedness(f,k,j,e,l)!=d);case 5:return a==(!J.smiles.SmilesSearch.isDiaxial(b,b,h,e,l,-0.95)||J.smiles.SmilesSearch.getHandedness(f,k,j,e,l)!=d);case 6:if(a!=!J.smiles.SmilesSearch.isDiaxial(b,b,g,e,l,-0.95))return!1;J.smiles.SmilesSearch.getPlaneNormals(f,k,j,h,l);if(a!=(0>l.vNorm1.dot(l.vNorm2)||0>l.vNorm2.dot(l.vNorm3)))return!1;l.vNorm2.sub2(b,e);return a==((0>l.vNorm1.dot(l.vNorm2)?2:1)==d);case 8:return J.smiles.SmilesSearch.getPlaneNormals(e,
f,k,j,l),0>l.vNorm1.dot(l.vNorm2)?a==(3!=d):0>l.vNorm2.dot(l.vNorm3)?a==(2!=d):a==(1!=d)}},"~B,J.util.JmolNode,~N,~N,J.util.JmolNode,J.util.JmolNode,J.util.JmolNode,J.util.JmolNode,J.util.JmolNode,J.util.JmolNode,J.smiles.VTemp");g(c$,"getJmolAtom",function(a){return 0>a||a>=this.jmolAtoms.length?null:this.jmolAtoms[a]},"~N");g(c$,"setSmilesBondCoordinates",function(a,b,c){a=this.jmolAtoms[a.getMatchingAtom()];b=this.jmolAtoms[b.getMatchingAtom()];a.set(-1,0,0);b.set(1,0,0);if(2==c){var d=0,e=0;c=
a.getEdges();for(var f=c.length;0<=--f;){var k=c[f],j=k.getOtherAtomNode(a);if(j!==b)switch(j.set(-1,0==d++?-1:1,0),j=k.getAtomIndex2()==a.getIndex()?d:-d,k.order){case 1025:e=j;break;case 1041:e=-j}}var h=0,d=0,g=Array(2);c=b.getEdges();for(f=c.length;0<=--f;)if(k=c[f],j=k.getOtherAtomNode(b),j!==a)switch(g[d]=j,j.set(1,0==d++?1:-1,0),j=k.getAtomIndex2()==b.getIndex()?d:-d,k.order){case 1025:h=j;break;case 1041:h=-j}0<e*h==(Math.abs(e)%2==Math.abs(h)%2)&&(a=g[0].y,g[0].y=g[1].y,g[1].y=a)}else{c=
a.getEdges();g=0;for(f=c.length;0<=--f;)if(k=c[f],k.getOtherAtomNode(a)===b){g=33==k.order?1:-1;break}for(f=c.length;0<=--f;)k=c[f],j=k.getOtherAtomNode(a),j!==b&&j.set(-1,1,0);c=b.getEdges();for(f=c.length;0<=--f;)k=c[f],j=k.getOtherAtomNode(b),j!==a&&j.set(1,1,-g/2)}},"J.smiles.SmilesAtom,J.smiles.SmilesAtom,~N");g(c$,"setSmilesCoordinates",function(a,b,c,d){var e=a.getAtomSite();if(-2147483648==e)return!1;var f=e>>8,e=e&255;c=2==f||3==f?c=this.jmolAtoms[c.getMatchingAtom()]:null;a.set(0,0,0);a=
this.jmolAtoms[b.getMatchingAtom()];a.set(0,0,0);a=this.getMappedAtoms(a,c,d);switch(f){case 2:case 4:2==e&&(e=a[0],a[0]=a[1],a[1]=e);d[a[0]].set(0,0,1);d[a[1]].set(1,0,-1);d[a[2]].set(0,1,-1);d[a[3]].set(-1,-1,-1);break;case 8:switch(e){case 1:d[a[0]].set(1,0,0);d[a[1]].set(0,1,0);d[a[2]].set(-1,0,0);d[a[3]].set(0,-1,0);break;case 2:d[a[0]].set(1,0,0);d[a[1]].set(-1,0,0);d[a[2]].set(0,1,0);d[a[3]].set(0,-1,0);break;case 3:d[a[0]].set(1,0,0),d[a[1]].set(0,1,0),d[a[2]].set(0,-1,0),d[a[3]].set(-1,0,
0)}break;case 5:case 6:f=a.length,2==e&&(e=a[0],a[0]=a[f-1],a[f-1]=e),d[a[0]].set(0,0,1),d[a[f-1]].set(0,0,-1),d[a[1]].set(1,0,0),d[a[2]].set(0,1,0),d[a[3]].set(-1,0,0),6==f&&d[a[4]].set(0,-1,0)}return!0},"J.util.JmolNode,J.smiles.SmilesAtom,J.smiles.SmilesAtom,~A");g(c$,"getMappedAtoms",function(a,b,c){for(var d=E(null==c[4]?4:null==c[5]?5:6,0),e=0;e<d.length;e++)d[e]=null==c[e]?104+100*e:c[e].getIndex();for(var f,k=a.getEdges(),j=null==b?null:b.getEdges(),e=0;e<d.length;e++){for(f=0;f<k.length&&
k[f].getOtherAtomNode(a)!==c[e];f++);if(f<k.length)d[e]=10*f+100+e;else if(null!=b){for(f=0;f<j.length&&j[f].getOtherAtomNode(b)!==c[e];f++);f<j.length&&(d[e]=10*f+300+e)}}java.util.Arrays.sort(d);for(e=0;e<d.length;e++)d[e]%=10;return d},"J.util.JmolNode,J.util.JmolNode,~A");c$.isDiaxial=g(c$,"isDiaxial",function(a,b,c,d,e,f){e.vA.sub2(a,c);e.vB.sub2(b,d);e.vA.normalize();e.vB.normalize();return e.vA.dot(e.vB)<f},"J.util.JmolNode,J.util.JmolNode,J.util.JmolNode,J.util.JmolNode,J.smiles.VTemp,~N");
c$.getHandedness=g(c$,"getHandedness",function(a,b,c,d,e){a=J.smiles.SmilesAromatic.getNormalThroughPoints(a,b,c,e.vTemp,e.vA,e.vB);return 0<J.smiles.SmilesSearch.distanceToPlane(e.vTemp,a,d)?1:2},"J.util.JmolNode,J.util.JmolNode,J.util.JmolNode,J.util.JmolNode,J.smiles.VTemp");c$.getPlaneNormals=g(c$,"getPlaneNormals",function(a,b,c,d,e){J.smiles.SmilesAromatic.getNormalThroughPoints(a,b,c,e.vNorm1,e.vTemp1,e.vTemp2);J.smiles.SmilesAromatic.getNormalThroughPoints(b,c,d,e.vNorm2,e.vTemp1,e.vTemp2);
J.smiles.SmilesAromatic.getNormalThroughPoints(c,d,a,e.vNorm3,e.vTemp1,e.vTemp2)},"J.util.JmolNode,J.util.JmolNode,J.util.JmolNode,J.util.JmolNode,J.smiles.VTemp");c$.distanceToPlane=g(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");g(c$,"createTopoMap",function(a){null==a&&(a=new JU.BS);var b=this.getMissingHydrogenCount();this.jmolAtoms=b=Array(this.atomCount+b);for(var c=0,d=new JU.BS,e=0;e<this.atomCount;e++){var f=
this.patternAtoms[e],k=f.getChiralClass(),j=f.missingHydrogenCount;0>j&&(j=0);var h=b[c]=(new J.smiles.SmilesAtom).setAll(0,c,-2147483648==k?k:(k<<8)+f.getChiralOrder(),f.elementNumber,f.getCharge());h.atomName=f.atomName;h.residueName=f.residueName;h.residueChar=f.residueChar;h.isBioAtom=f.isBioAtom;h.$isLeadAtom=f.$isLeadAtom;h.setAtomicMass(f.getAtomicMass());f.isAromatic()&&a.set(c);!f.isFirst&&(1==j&&0<k)&&d.set(c);f.setMatchingAtom(c++);f=Array(f.getBondCount()+j);for(h.setBonds(f);0<=--j;)f=
b[c]=(new J.smiles.SmilesAtom).setAll(0,c,0,1,0),c++,f.setBonds(Array(1)),k=new J.smiles.SmilesBond(h,f,1,!1),J.util.Logger.info(""+k)}for(e=0;e<this.atomCount;e++){f=this.patternAtoms[e];j=f.getMatchingAtom();a=b[j];j=f.getBondCount();for(c=0;c<j;c++)if(h=f.getBond(c),h.getAtom1()===f){k=1;switch(h.order){case 769:k=33;break;case 1025:k=97;break;case 257:k=1025;break;case 513:k=1041;break;case 112:case 96:k=h.order;break;case 1:k=1;break;case 17:k=514;break;case 2:k=2;break;case 3:k=3}h=b[h.getAtom2().getMatchingAtom()];
k=new J.smiles.SmilesBond(a,h,k,!1);h.bondCount--;J.util.Logger.info(""+k)}else h=b[h.getAtom1().getMatchingAtom()],k=h.getBondTo(a),a.addBond(k)}for(e=d.nextSetBit(0);0<=e;e=d.nextSetBit(e+1))f=b[e].getEdges(),k=f[0],f[0]=f[1],f[1]=k},"JU.BS");g(c$,"setTop",function(a){this.top=null==a?this:a.getTop()},"J.smiles.SmilesSearch");g(c$,"getTop",function(){return this.top===this?this:this.top.getTop()});g(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 d=c.getValue().toString();if(d.startsWith("select")){var e=b.containsKey(d)?b.get(d):this.jmolAtoms[0].findAtomsLike(d.substring(6));null==e&&(e=new JU.BS);b.put(d,e);c.setValue(e)}}});K(c$,"INITIAL_ATOMS",16)});z("J.smiles");F(["java.util.Hashtable","JU.BS","J.smiles.VTemp"],"J.smiles.SmilesGenerator","JU.List $.SB J.smiles.InvalidSmilesException $.SmilesAromatic $.SmilesAtom $.SmilesBond $.SmilesParser $.SmilesSearch J.util.BSUtil $.Elements $.JmolMolecule $.Logger".split(" "),
function(){c$=H(function(){this.atoms=null;this.atomCount=0;this.vTemp=this.ringSets=this.bsAromatic=this.bsSelected=null;this.nPairs=0;this.bsIncludingH=this.htRings=this.htRingsSequence=this.prevSp2Atoms=this.prevAtom=this.bsToDo=this.bsBondsDn=this.bsBondsUp=null;G(this,arguments)},J.smiles,"SmilesGenerator");L(c$,function(){this.vTemp=new J.smiles.VTemp;this.bsBondsUp=new JU.BS;this.bsBondsDn=new JU.BS;this.htRingsSequence=new java.util.Hashtable;this.htRings=new java.util.Hashtable});g(c$,"getSmiles",
function(a,b,c){var d=c.nextSetBit(0);if(0>d)return"";this.atoms=a;this.atomCount=b;this.bsSelected=c=J.util.BSUtil.copy(c);return this.getSmilesComponent(a[d],c,!1)},"~A,~N,JU.BS");g(c$,"getBioSmiles",function(a,b,c,d,e,f){this.atoms=a;this.atomCount=b;b=new JU.SB;c=J.util.BSUtil.copy(c);null!=f&&b.append("//* Jmol bioSMILES ").append(f.$replace("*","_")).append(" *//");f="\n";var k=new JU.BS,j=null,h,g=new JU.List;try{for(var l=0,m=c.nextSetBit(0);0<=m;m=c.nextSetBit(m+1)){var q=a[m],s=q.getGroup1("?"),
p=q.getBioStructureTypeName(),n=s.equals("?");if(null!=f)if(0<b.length()&&b.append(f),f=null,l=0,0<p.length)0!=q.getChainID()&&(h="//* chain "+q.getChainIDStr()+" "+p+" "+q.getResno()+" *// ",l=h.length,b.append(h)),b.append("~").appendC(p.charAt(0)).append("~"),l++;else{h=this.getSmilesComponent(q,c,!0);if(h.equals(j))f="";else{var j=h,r=q.getGroup3(!0);null!=r&&b.append("//* ").append(r).append(" *//");b.append(h);f=".\n"}continue}75<=l&&(b.append("\n  "),l=2);n?this.addBracketedBioName(b,q,0<p.length?
".0":null):b.append(s);l++;var v=q.getOffsetResidueAtom("0",0);if(e){q.getCrossLinkLeadAtomIndexes(g);for(var x=0;x<g.size();x++)b.append(":"),h=this.getRingCache(v,g.get(x).intValue(),this.htRingsSequence),b.append(h),l+=1+h.length;g.clear()}q.getGroupBits(k);c.andNot(k);var y=q.getOffsetResidueAtom("0",1);if(0>y||!c.get(y)){b.append(" //* ").appendI(q.getResno()).append(" *//");if(0>y&&0>(y=c.nextSetBit(m+1)))break;0<l&&(f=".\n")}m=y-1}}catch(t){if(D(t,Exception))return System.out.println(t.toString()),
"";throw t;}if(!d&&!this.htRingsSequence.isEmpty())throw this.dumpRingKeys(b,this.htRingsSequence),new J.smiles.InvalidSmilesException("//* ?ring error? *//");h=b.toString();h.endsWith(".\n")&&(h=h.substring(0,h.length-2));return h},"~A,~N,JU.BS,~B,~B,~S");g(c$,"addBracketedBioName",function(a,b,c){a.append("[");if(null!=c){var d=b.getChainIDStr();a.append(b.getGroup3(!1));c.equals(".0")||a.append(c).append("#").appendI(b.getElementNumber());a.append("//* ").appendI(b.getResno());0<d.length&&a.append(":").append(d);
a.append(" *//")}else a.append(J.util.Elements.elementNameFromNumber(b.getElementNumber()));a.append("]")},"JU.SB,J.util.JmolNode,~S");g(c$,"getSmilesComponent",function(a,b,c){1==a.getElementNumber()&&0<a.getEdges().length&&(a=this.atoms[a.getBondedAtomIndex(0)]);this.bsSelected=J.util.JmolMolecule.getBranchBitSet(this.atoms,a.getIndex(),J.util.BSUtil.copy(b),null,-1,!0,!1);b.andNot(this.bsSelected);this.bsIncludingH=J.util.BSUtil.copy(this.bsSelected);for(b=this.bsSelected.nextSetBit(0);0<=b;b=
this.bsSelected.nextSetBit(b+1)){var d=this.atoms[b];1==d.getElementNumber()&&0==d.getIsotopeNumber()&&this.bsSelected.clear(b)}2<this.bsSelected.cardinality()?(b=null,b=J.smiles.SmilesParser.getMolecule("A[=&@]A",!0),b.jmolAtoms=this.atoms,b.setSelected(this.bsSelected),b.jmolAtomCount=this.atomCount,b.ringDataMax=7,b.setRingData(null),this.bsAromatic=b.bsAromatic,this.ringSets=b.ringSets,this.setBondDirections()):this.bsAromatic=new JU.BS;this.bsToDo=J.util.BSUtil.copy(this.bsSelected);b=new JU.SB;
for(d=this.bsToDo.nextSetBit(0);0<=d;d=this.bsToDo.nextSetBit(d+1))4<this.atoms[d].getCovalentBondCount()&&(this.getSmiles(b,this.atoms[d],c,!1),a=null);if(null!=a)for(;null!=(a=this.getSmiles(b,a,c,!0)););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,c,!0)););}if(!this.htRings.isEmpty())throw this.dumpRingKeys(b,this.htRings),new J.smiles.InvalidSmilesException("//* ?ring error? *//\n"+b);return b.toString()},"J.util.JmolNode,JU.BS,~B");g(c$,"getBondStereochemistry",function(a,b){if(null==a)return"\x00";var c=a.index,d=null==b||a.getAtomIndex1()==b.getIndex();return this.bsBondsUp.get(c)?d?"/":"\\":this.bsBondsDn.get(c)?d?"\\":"/":"\x00"},"J.util.JmolEdge,J.util.JmolNode");g(c$,"setBondDirections",function(){for(var a=new JU.BS,
b=R(2,3,null),c=this.bsSelected.nextSetBit(0);0<=c;c=this.bsSelected.nextSetBit(c+1))for(var d=this.atoms[c],e=d.getEdges(),f=0;f<e.length;f++){var k=e[f],j=k.index;if(!a.get(j)){var h=k.getOtherAtomNode(d);if(!(2!=k.getCovalentOrder()||J.smiles.SmilesSearch.isRingBond(this.ringSets,c,h.getIndex()))){a.set(j);var g=k=null,j=0,l=[d,h];J.util.Logger.debugging&&J.util.Logger.debug(d+" == "+h);g=1;for(h=0;2>h&&0<g&&3>g;h++)for(var g=0,m=l[h],q=m.getEdges(),s=0;s<q.length;s++)1==q[s].getCovalentOrder()&&
(b[h][g++]=q[s],"\x00"!=this.getBondStereochemistry(q[s],m)&&(k=q[s],j=h));if(!(3==g||0==g))if(null==k&&(j=0,k=b[j][0],this.bsBondsUp.set(k.index)),m=this.getBondStereochemistry(k,l[j]),g=k.getOtherAtomNode(l[j]),null!=g)for(h=0;2>h;h++)for(q=0;2>q;q++)if(s=b[h][q],!(null==s||s===k)){var p=s.index,n=s.getOtherAtomNode(l[h]);if(null!=n){var r=this.getBondStereochemistry(s,l[h]),v=J.smiles.SmilesSearch.isDiaxial(l[j],l[h],g,n,this.vTemp,0);"\x00"==r||r!=m==v?("\\"==m&&v||"/"==m&&!v)==(s.getAtomIndex1()!=
n.getIndex())?this.bsBondsUp.set(p):this.bsBondsDn.set(p):J.util.Logger.error("BOND STEREOCHEMISTRY ERROR");J.util.Logger.debugging&&J.util.Logger.debug(this.getBondStereochemistry(k,l[0])+" "+g.getIndex()+" "+n.getIndex()+" "+this.getBondStereochemistry(s,l[h]))}}}}}});g(c$,"getSmiles",function(a,b,c,d){var e=b.getIndex();if(!this.bsToDo.get(e))return null;this.bsToDo.clear(e);var f=!this.bsSelected.get(e),k=null==this.prevAtom?-1:this.prevAtom.getIndex(),j=this.bsAromatic.get(e),h=null!=this.prevSp2Atoms,
g=this.prevSp2Atoms,l=0,m=b.getElementNumber(),q=0,n=new JU.List,p=null,u=null,r=b.getEdges(),v=null,x=j?10:0,y=Array(7);J.util.Logger.debugging&&J.util.Logger.debug(a.toString());if(null!=r)for(var t=r.length;0<=--t;){var w=r[t];if(w.isCovalent()){var A=r[t].getOtherAtomNode(b),w=A.getIndex();if(w==k)u=r[t];else{var B=1==A.getElementNumber()&&0==A.getIsotopeNumber();if(!this.bsIncludingH.get(w))if(!B&&c&&this.bsSelected.get(e))this.bsToDo.set(w);else continue;B?(v=A,q++,1<q&&(x=10)):n.addLast(r[t])}}}r=
null;null==g&&(g=Array(5));null!=u&&(r=J.smiles.SmilesBond.getBondOrderString(u.getCovalentOrder()),null==this.prevSp2Atoms?g[l++]=this.prevAtom:l=2);var l=l+q,k=0,z=new JU.BS;if(d)for(t=0;t<n.size();t++){var w=n.get(t),B=w.getOtherAtomNode(b),A=B.getCovalentBondCount()-B.getCovalentHydrogenCount(),C=w.getCovalentOrder();if(1==C&&1==A&&t<n.size()-(null==p?1:0))z.set(w.index);else if((1<C||A>k)&&!this.htRings.containsKey(J.smiles.SmilesGenerator.getRingKey(B.getIndex(),e)))k=1<C?1E3+C:A,p=w}k=null==
p?null:p.getOtherAtomNode(b);A=null==p?0:p.getCovalentOrder();7>x&&null!=u&&(2==u.getCovalentOrder()&&2==A&&null!=this.prevSp2Atoms&&null!=this.prevSp2Atoms[1]?(y[x++]=this.prevSp2Atoms[0],y[x++]=this.prevSp2Atoms[1]):y[x++]=this.prevAtom);7>x&&1==q&&(y[x++]=v);v=1==A&&null==this.prevSp2Atoms;C=this.getBondStereochemistry(u,this.prevAtom);u=new JU.SB;for(t=0;t<n.size();t++)w=n.get(t),z.get(w.index)&&(B=w.getOtherAtomNode(b),w=new JU.SB,w.append("("),this.prevAtom=b,this.prevSp2Atoms=null,this.getSmiles(w,
B,c,d),w.append(")"),0<=u.indexOf(w.toString())&&(x=10),u.appendSB(w),n.remove(t--),7>x&&(y[x++]=B),5>l&&(g[l++]=B));t=2==A?k.getIndex():-1;if(1<q||j||0>t||J.smiles.SmilesSearch.isRingBond(this.ringSets,e,t))l=-1;0>l&&(g=null);if(null!=r||"\x00"!=C)"\x00"!=C&&(r=""+C),a.append(r);c=null;if(!d&&(5==n.size()||6==n.size()))c=this.sortInorganic(b,n);for(t=0;t<n.size();t++)w=n.get(t),w!==p&&(B=w.getOtherAtomNode(b),d=this.getRingCache(e,B.getIndex(),this.htRings),r=J.smiles.SmilesBond.getBondOrderString(w.order),
v||(C=this.getBondStereochemistry(w,b),"\x00"!=C&&(r=""+C)),u.append(r),u.append(d),7>x&&(y[x++]=B),null!=g&&5>l&&(g[l++]=B));if(h&&2==x&&2==A&&3==k.getCovalentBondCount()){r=k.getEdges();for(l=0;l<r.length;l++)r[l].isCovalent()&&k.getBondedAtomIndex(l)!=e&&(y[x++]=this.atoms[k.getBondedAtomIndex(l)]);l=0}else null!=k&&7>x&&(y[x++]=k);h=b.getValence();n=b.getFormalCharge();d=b.getIsotopeNumber();t=b.getAtomName();r=b.getBioStructureTypeName();J.util.Logger.debugging&&a.append("\n//* "+b+" *//\t");
f&&0!=r.length&&0!=t.length?this.addBracketedBioName(a,b,"."+t):a.append(J.smiles.SmilesAtom.getAtomLabel(m,d,h,n,q,j,null!=c?c:this.checkStereoPairs(b,e,y,x)));a.appendSB(u);if(null==p)return null;2==A&&(1==l||2==l)?(null==g[0]&&(g[0]=b),null==g[1]&&(g[1]=b)):g=null;this.prevSp2Atoms=g;this.prevAtom=b;return k},"JU.SB,J.util.JmolNode,~B,~B");g(c$,"sortInorganic",function(a,b){for(var c=a.getIndex(),d=b.size(),e=new JU.List,f=new JU.List,k,j,h,g,l=new JU.BS,m=null,q=Array(6),m=!0,n="",p=0;p<d;p++)if(h=
b.get(p),q[0]=k=h.getOtherAtomNode(a),0==p?n=this.addStereoCheck(c,q,0,""):m&&null!=this.addStereoCheck(c,q,0,n)&&(m=!1),!l.get(p)){l.set(p);for(var u=!1,r=p+1;r<d;r++)if(!l.get(r)&&(g=b.get(r),j=g.getOtherAtomNode(a),J.smiles.SmilesSearch.isDiaxial(a,a,k,j,this.vTemp,-0.95))){e.addLast([h,g]);u=!0;l.set(r);break}u||f.addLast(h)}c=e.size();if(m||6==d&&3!=c||5==d&&0==c)return"";m=e.get(0);h=m[0];q[0]=h.getOtherAtomNode(a);b.clear();b.addLast(h);1<c&&f.addLast(e.get(1)[0]);3==c&&f.addLast(e.get(2)[0]);
1<c&&f.addLast(e.get(1)[1]);3==c&&f.addLast(e.get(2)[1]);for(p=0;p<f.size();p++)h=f.get(p),b.addLast(h),q[p+1]=h.getOtherAtomNode(a);b.addLast(m[1]);return J.smiles.SmilesGenerator.getStereoFlag(a,q,d,this.vTemp)},"J.util.JmolNode,JU.List");g(c$,"checkStereoPairs",function(a,b,c,d){if(4>d)return"";if(4==d&&6==a.getElementNumber())for(var e="",f=0;4>f;f++)if(null==(e=this.addStereoCheck(b,c,f,e))){d=10;break}return 6<d?"":J.smiles.SmilesGenerator.getStereoFlag(a,c,d,this.vTemp)},"J.util.JmolNode,~N,~A,~N");
c$.getStereoFlag=g(c$,"getStereoFlag",function(a,b,c,d){var e=b[0],f=b[1],k=b[2],j=b[3],h=b[4];b=b[5];var g=4;switch(c){default:case 5:case 6:return J.smiles.SmilesSearch.checkStereochemistryAll(!1,a,g,1,e,f,k,j,h,b,d)?"@":"@@";case 2:case 4:if(null==k||null==j)break;c=J.smiles.SmilesAromatic.getNormalThroughPoints(e,f,k,d.vTemp,d.vA,d.vB);if(0.2>Math.abs(J.smiles.SmilesSearch.distanceToPlane(d.vTemp,c,j))){g=8;if(J.smiles.SmilesSearch.checkStereochemistryAll(!1,a,g,1,e,f,k,j,h,b,d))return"@SP1";
if(J.smiles.SmilesSearch.checkStereochemistryAll(!1,a,g,2,e,f,k,j,h,b,d))return"@SP2";if(J.smiles.SmilesSearch.checkStereochemistryAll(!1,a,g,3,e,f,k,j,h,b,d))return"@SP3"}else return J.smiles.SmilesSearch.checkStereochemistryAll(!1,a,g,1,e,f,k,j,h,b,d)?"@":"@@"}return""},"J.util.JmolNode,~A,~N,J.smiles.VTemp");g(c$,"addStereoCheck",function(a,b,c,d){var e=b[c].getAtomicAndIsotopeNumber(),f=b[c].getCovalentBondCount(),k=6==e?b[c].getCovalentHydrogenCount():0;if(6==e?4!=f||3!=k:1<f)return d;e=";"+
e+"/"+k+"/"+f+",";if(0<=d.indexOf(e)){if(3==k){for(e=k=0;e<f&&3>k;e++){var j=b[c].getBondedAtomIndex(e);j!=a&&(k+=this.atoms[j].getAtomicAndIsotopeNumber())}if(3<k)return d}return null}return d+e},"~N,~A,~N,~S");g(c$,"getRingCache",function(a,b,c){var d=J.smiles.SmilesGenerator.getRingKey(a,b),e=c.get(d),e=null==e?null:e[0];null==e?(c.put(d,[e=J.smiles.SmilesParser.getRingPointer(++this.nPairs),Integer.$valueOf(b)]),J.util.Logger.debugging&&J.util.Logger.debug("adding for "+a+" ring key "+this.nPairs+
": "+d)):(c.remove(d),J.util.Logger.debugging&&J.util.Logger.debug("using ring key "+d));return e},"~N,~N,java.util.Map");g(c$,"dumpRingKeys",function(a,b){J.util.Logger.info(a.toString()+"\n\n");for(var c,d=b.keySet().iterator();d.hasNext()&&((c=d.next())||1);)J.util.Logger.info("unmatched ring key: "+c)},"JU.SB,java.util.Map");c$.getRingKey=g(c$,"getRingKey",function(a,b){return Math.min(a,b)+"_"+Math.max(a,b)},"~N,~N")});z("J.smiles");F(null,"J.smiles.SmilesAromatic",["JU.BS","$.V3"],function(){c$=
N(J.smiles,"SmilesAromatic");c$.isFlatSp2Ring=g(c$,"isFlatSp2Ring",function(a,b,c,d){for(var e=c.nextSetBit(0);0<=e;e=c.nextSetBit(e+1)){var f=a[e],k=f.getEdges();if(!(3>k.length)&&3<k.length)return!1}if(3.4028235E38==d)return!0;0>=d&&(d=0.01);for(var j=new JU.V3,h=new JU.V3,g=new JU.V3,l=null,e=c.cardinality(),m=Array(2*e),q=0,n=1-5*d,e=c.nextSetBit(0);0<=e;e=c.nextSetBit(e+1)){for(var f=a[e],k=f.getEdges(),p=-1,u=-1,r=-1,k=k.length;0<=--k;){var v=f.getBondedAtomIndex(k);b.get(v)&&(c.get(v)?0>u?
u=v:r=v:p=v)}J.smiles.SmilesAromatic.getNormalThroughPoints(a[u],a[e],a[r],j,h,g);null==l&&(l=new JU.V3);if(!J.smiles.SmilesAromatic.addNormal(j,l,n))return!1;m[q++]=JU.V3.newV(j);if(0<=p){J.smiles.SmilesAromatic.getNormalThroughPoints(a[u],a[p],a[r],j,h,g);if(!J.smiles.SmilesAromatic.addNormal(j,l,n))return!1;m[q++]=JU.V3.newV(j)}}return J.smiles.SmilesAromatic.checkStandardDeviation(m,l,q,d)},"~A,JU.BS,JU.BS,~N");c$.addNormal=g(c$,"addNormal",function(a,b,c){var d=b.dot(a);if(0!=d&&Math.abs(d)<
c)return!1;0>d&&a.scale(-1);b.add(a);b.normalize();return!0},"JU.V3,JU.V3,~N");c$.checkStandardDeviation=g(c$,"checkStandardDeviation",function(a,b,c,d){for(var e=0,f=0,k=0;k<c;k++)var j=a[k].dot(b),e=e+j,f=f+j*j;e=Math.sqrt((f-e*e/c)/(c-1));return e<d},"~A,JU.V3,~N,~N");c$.getNormalThroughPoints=g(c$,"getNormalThroughPoints",function(a,b,c,d,e,f){e.sub2(b,a);f.sub2(c,a);d.cross(e,f);d.normalize();e.setT(a);return-e.dot(d)},"J.util.JmolNode,J.util.JmolNode,J.util.JmolNode,JU.V3,JU.V3,JU.V3");c$.checkAromaticDefined=
g(c$,"checkAromaticDefined",function(a,b){for(var c=new JU.BS,d=b.nextSetBit(0);0<=d;d=b.nextSetBit(d+1))for(var e=a[d].getEdges(),f=0;f<e.length;f++)switch(e[f].order){case 515:case 514:case 513:c.set(e[f].getAtomIndex1()),c.set(e[f].getAtomIndex2())}return c},"~A,JU.BS");c$.checkAromaticStrict=g(c$,"checkAromaticStrict",function(a,b,c,d){for(var e=new JU.BS,f=new JU.BS,k=c.size();0<=--k;){var j=c.get(k);J.smiles.SmilesAromatic.isAromaticRing(b,f,j,5)&&J.smiles.SmilesAromatic.checkAromaticStrict2(a,
e,c,d,j,!0)}for(k=d.size();0<=--k;)j=d.get(k),J.smiles.SmilesAromatic.isAromaticRing(b,f,j,6)&&J.smiles.SmilesAromatic.checkAromaticStrict2(a,e,c,d,j,!1);b.clearAll();b.or(e)},"~A,JU.BS,JU.List,JU.List");c$.isAromaticRing=g(c$,"isAromaticRing",function(a,b,c,d){b.clearAll();b.or(c);b.and(a);return b.cardinality()==d},"JU.BS,JU.BS,JU.BS,~N");c$.checkAromaticStrict2=g(c$,"checkAromaticStrict2",function(a,b,c,d,e,f){f=J.smiles.SmilesAromatic.countInternalPairs(a,e,f)<<1;switch(f){case -3:break;default:for(var k=
e.nextSetBit(0);0<=k;k=e.nextSetBit(k+1))for(var j=a[k].getEdges(),h=0;h<j.length;h++)if(2==j[h].order){var g=j[h].getOtherAtomNode(a[k]).getIndex();if(!e.get(g)){for(var l=!1,m=c.size();0<=--m&&!l;){var q=c.get(m);if(q.get(g)&&(b.get(g)||3==Math.abs(J.smiles.SmilesAromatic.countInternalPairs(a,q,!0))))l=!0}for(m=d.size();0<=--m&&!l;)if(q=d.get(m),q.get(g)&&(b.get(g)||3==Math.abs(J.smiles.SmilesAromatic.countInternalPairs(a,q,!1))))l=!0;if(!l)return;f++}}}6==f&&b.or(e)},"~A,JU.BS,JU.List,JU.List,JU.BS,~B");
c$.countInternalPairs=g(c$,"countInternalPairs",function(a,b,c){for(var d=0,e=0,f=0,k=b.nextSetBit(0);0<=k;k=b.nextSetBit(k+1)){for(var j=a[k],h=j.getEdges(),g=!1,l=0;l<h.length;l++){var m=h[l].getOtherAtomNode(j).getIndex();if(b.get(m))switch(h[l].order){case 514:case 513:case 515:e++;break;case 2:d++,g=!0}}if(c&&0==e)switch(j.getElementNumber()){case 7:case 8:case 16:g||f++}}return 0==e?O(d/2)+f:e==(c?5:6)?-3:0},"~A,JU.BS,~B")});z("J.smiles");F(["JU.P3","J.util.JmolNode"],"J.smiles.SmilesAtom",
["JU.AU","J.util.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.matchingAtom=-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;G(this,arguments)},J.smiles,"SmilesAtom",JU.P3,J.util.JmolNode);L(c$,function(){this.bonds=Array(4)});
c$.getChiralityClass=g(c$,"getChiralityClass",function(a){return O(("0;11;AL;33;TH;TP;OH;77;SP;".indexOf(a)+1)/3)},"~S");c$.allowSmilesUnbracketed=g(c$,"allowSmilesUnbracketed",function(a){return 0<="B, C, N, O, P, S, F, Cl, Br, I,".indexOf(a+",")},"~S");g(c$,"setBioAtom",function(a){this.isBioAtom="\x00"!=a;this.bioType=a;null!=this.parent&&(this.parent.bioType=a,this.parent.isBioAtom=this.isBioAtom)},"~S");g(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");g(c$,"setBonds",function(a){this.bonds=a},"~A");g(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 J.smiles.SmilesAtom).setIndex(this.index);a.parent=this;this.atomsOr[this.nAtomsOr]=a;this.nAtomsOr++;return a});g(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 J.smiles.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?"*":J.util.Elements.elementSymbolFromNumber(this.elementNumber);
this.$isAromatic&&(a=a.toLowerCase());return"["+a+"."+this.index+(0<=this.matchingAtom?"("+this.matchingAtom+")":"")+"]"});g(c$,"setIndex",function(a){this.index=a;return this},"~N");g(c$,"setAll",function(a,b,c,d,e){this.component=a;this.index=b;this.atomSite=c;this.elementNumber=d;this.charge=e;return this},"~N,~N,~N,~N,~N");g(c$,"setHydrogenCount",function(){if(-2147483648!=this.missingHydrogenCount)return!0;var a=J.smiles.SmilesAtom.getDefaultCount(this.elementNumber,this.$isAromatic);if(-2==
a)return!1;if(-1==a)return!0;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&&J.util.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},"J.smiles.SmilesSearch");
c$.getDefaultCount=g(c$,"getDefaultCount",function(a,b){switch(a){case 0:case -1: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});g(c$,"isAromatic",function(){return this.$isAromatic});g(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=J.util.Elements.elementNumberFromSymbol(a,!0);return 0!=this.elementNumber},"~S");n(c$,"getElementNumber",function(){return this.elementNumber});g(c$,"getAtomicMass",function(){return this.atomicMass});g(c$,"setAtomicMass",function(a){this.atomicMass=a},"~N");g(c$,"getCharge",function(){return this.charge});
g(c$,"setCharge",function(a){this.charge=a},"~N");g(c$,"getMatchingAtom",function(){return this.matchingAtom});g(c$,"setMatchingAtom",function(a){this.matchingAtom=a},"~N");g(c$,"getChiralClass",function(){return this.chiralClass});g(c$,"setChiralClass",function(a){this.chiralClass=a},"~N");g(c$,"getChiralOrder",function(){return this.chiralOrder});g(c$,"setChiralOrder",function(a){this.chiralOrder=a},"~N");g(c$,"setExplicitHydrogenCount",function(a){this.missingHydrogenCount=a},"~N");g(c$,"setImplicitHydrogenCount",
function(a){this.implicitHydrogenCount=a},"~N");g(c$,"setDegree",function(a){this.degree=a},"~N");g(c$,"setNonhydrogenDegree",function(a){this.nonhydrogenDegree=a},"~N");g(c$,"setValence",function(a){this.valence=a},"~N");g(c$,"setConnectivity",function(a){this.connectivity=a},"~N");g(c$,"setRingMembership",function(a){this.ringMembership=a},"~N");g(c$,"setRingSize",function(a){this.ringSize=a},"~N");g(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});g(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 J.util.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");g(c$,"addBond",function(a){this.bondCount>=this.bonds.length&&(this.bonds=JU.AU.doubleLength(this.bonds));this.bonds[this.bondCount]=a;this.bondCount++},"J.smiles.SmilesBond");g(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].getAtom1().index>this.bonds[a].getAtom2().index&&this.bonds[a].switchAtoms()});n(c$,"getEdges",function(){return null!=this.parent?this.parent.getEdges():
this.bonds});g(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()});g(c$,"getBondCount",function(){return null!=this.parent?this.parent.getCovalentBondCount():this.bondCount});g(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.getAtom1()===this?a.getAtom2():
a.getAtom1()).matchingAtom},"~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});g(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.getAtom2()===this:b.getOtherAtom(this)===a)return b;return null},"J.smiles.SmilesAtom");g(c$,"getBondNotTo",function(a,b){for(var c,
d=0;d<this.bonds.length;d++)if(null!=(c=this.bonds[d])){var e=c.getOtherAtom(this);if(a!==e&&(b||1!=e.elementNumber))return c}return null},"J.smiles.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()},"J.util.JmolNode");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.List");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=g(c$,"getAtomLabel",
function(a,b,c,d,e,f,k){var j=J.util.Elements.elementSymbolFromNumber(a);f&&(j=j.toLowerCase(),6!=a&&(c=2147483647));return(0<k.length||0!=b||0!=d?-1:J.smiles.SmilesAtom.getDefaultCount(a,!1))==c?j:"["+(0>=b?"":""+b)+j+(0>d?""+d:0<d?"+"+d:"")+k+(1<e?"H"+e:1==e?"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});g(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");K(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,")});z("J.smiles");F(["J.util.JmolEdge"],"J.smiles.SmilesBond",["J.smiles.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)},J.smiles,"SmilesBond",J.util.JmolEdge);c$.getBondOrderString=g(c$,"getBondOrderString",function(a){switch(a){case 1:return"";case 2:return"=";case 3:return"#";default:return""}},"~N");g(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},"J.smiles.SmilesBond");g(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 J.smiles.SmilesBond(null,null,-1,!1);this.bondsOr[this.nBondsOr]=a;this.nBondsOr++;return a});g(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 J.smiles.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});I(c$,function(a,b,c,d){M(this,J.smiles.SmilesBond,[]);this.set2(c,d);this.set2a(a,b)},"J.smiles.SmilesAtom,J.smiles.SmilesAtom,~N,~B");g(c$,"set2",function(a,b){this.order=a;this.isNot=b},"~N,~B");g(c$,"set2a",function(a,b){null!=a&&(this.atom1=a,a.addBond(this));null!=b&&(this.atom2=b,b.isFirst=!1,b.addBond(this))},"J.smiles.SmilesAtom,J.smiles.SmilesAtom");c$.isBondType=
g(c$,"isBondType",function(a,b,c){if(0>"-=#:/\\.+!,&;@~^'".indexOf(a))return!1;if(!b&&0>"-=#:/\\.~^'".indexOf(a))throw new J.smiles.InvalidSmilesException("SMARTS bond type "+a+" not allowed in SMILES");return c&&"~"==a?!1:!0},"~S,~B,~B");c$.getBondTypeFromCode=g(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");g(c$,"getAtom1",function(){return this.atom1});g(c$,"getAtom2",function(){return this.atom2});g(c$,"setAtom2",function(a){this.atom2=a;null!=this.atom2&&a.addBond(this)},"J.smiles.SmilesAtom");g(c$,"getBondType",function(){return this.order});g(c$,"getOtherAtom",function(a){return this.atom1===a?this.atom2:this.atom1},"J.smiles.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},"J.util.JmolNode");n(c$,"isCovalent",function(){return 112!=this.order});g(c$,"getValence",function(){return this.order&7});n(c$,"isHydrogen",function(){return 112==this.order});g(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}});K(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)});z("J.smiles");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)},
J.smiles,"SmilesMeasure");L(c$,function(){this.indices=E(4,0);this.points=Array(4)});I(c$,function(a,b,c,d,e,f){this.search=a;this.type=Math.min(4,Math.max(c,2));this.index=b;this.min=Math.min(d,e);this.max=Math.max(d,e);this.isNot=f},"J.smiles.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});g(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");g(c$,"check",function(){for(var a=0;a<this.type;a++){var b=this.search.patternAtoms[this.indices[a]].getMatchingAtom();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:J.smiles.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=g(c$,"setTorsionData",function(a,b,c,d,e,f){e.vTemp1.sub2(a,b);e.vTemp2.sub2(d,c);f&&(e.vNorm1.sub2(b,c),e.vNorm1.normalize(),e.vTemp1.cross(e.vTemp1,e.vNorm1),e.vTemp1.normalize(),
e.vTemp2.cross(e.vTemp2,e.vNorm1),e.vTemp2.normalize(),e.vNorm2.cross(e.vTemp1,e.vTemp2))},"JU.P3,JU.P3,JU.P3,JU.P3,J.smiles.VTemp,~B");K(c$,"TYPES","__dat","radiansPerDegree",0.017453292519943295);z("J.smiles");F(["java.util.Hashtable"],"J.smiles.SmilesParser","java.lang.Character JU.List $.PT $.SB J.smiles.InvalidSmilesException $.SmilesAtom $.SmilesBond $.SmilesMeasure $.SmilesSearch J.util.Elements $.Logger $.Txt".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)},J.smiles,"SmilesParser");L(c$,function(){this.ringBonds=new java.util.Hashtable;this.htMeasures=new java.util.Hashtable});c$.getMolecule=g(c$,"getMolecule",function(a,b){return(new J.smiles.SmilesParser(b)).parse(a)},"~S,~B");I(c$,function(a){this.isSmarts=a},"~B");g(c$,"reset",function(){this.branchLevel=this.braceCount=0});g(c$,"parse",function(a){if(null==a)throw new J.smiles.InvalidSmilesException("SMILES expressions must not be null");
var b=new J.smiles.SmilesSearch;0<=a.indexOf("$(select")&&(a=this.parseNested(b,a,"select"));for(a=J.smiles.SmilesParser.cleanPattern(a);a.startsWith("/");){var c=J.smiles.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 d=0;d<a.length;d++){var e="|"+a[d]+"|";0>c.indexOf(e)&&(b.subSearches[d]=this.getSearch(b,a[d],this.flags),c+=e)}J.util.Logger.info(c);return b}return this.getSearch(b,a,this.flags)},"~S");g(c$,"parseVariableLength",function(a){for(var b=new JU.SB,c=a.length-1,d=0,e=!1,f=0;f<c;f++)switch(a.charAt(f)){case "(":d++;break;
case ")":d--;break;case "|":0<d&&(e=!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;d=E(1,0);for(f=null;0<=(c=a.indexOf("[$",c+1));){var k=c,j=-2147483648,h=-2147483648,c=J.smiles.SmilesParser.getDigits(a,c+2,d),j=d[0];-2147483648!=j&&"-"==J.smiles.SmilesParser.getChar(a,c)&&(c=J.smiles.SmilesParser.getDigits(a,c+1,d),h=d[0]);if("("==J.smiles.SmilesParser.getChar(a,
c)&&(f=J.smiles.SmilesParser.getSubPattern(a,k,"["),f.endsWith(")"))){var g=k+f.length+2,l=J.smiles.SmilesParser.getSubPattern(a,c,"("),m=c;J.smiles.SmilesParser.getSubPattern(a,c,"[");c+=1+l.length;if(0<=l.indexOf(":")&&0>l.indexOf("|")){for(var q=0,n=l.length,p=-1,f=0;f<n;f++)switch(l.charAt(f)){case "[":case "(":q++;break;case ")":case "]":q--;break;case ".":0<=p&&0==q&&(n=f);break;case ":":0>p&&0==q&&(p=f)}0<p&&(l=l.substring(0,p)+"("+l.substring(p,n)+")"+l.substring(n))}if(-2147483648==j){if(f=
l.indexOf("|"),0<=f)return this.parseVariableLength(a.substring(0,k)+"[$1"+a.substring(m,m+f+1)+")]"+a.substring(g)+"||"+a.substring(0,k)+"[$1("+a.substring(m+f+2)+a.substring(g))}else{-2147483648==h&&(h=j);0<=l.indexOf("|")&&(l="[$("+l+")]");for(f=j;f<=h;f++){j=new JU.SB;j.append("||").append(a.substring(0,k));for(m=0;m<f;m++)j.append(l);j.append(a.substring(g));b.appendSB(j)}}}}}return e?this.parseVariableLength(b.substring(2)):2>b.length()?a:b.substring(2)},"~S");g(c$,"getSearch",function(a,b,
c){this.htMeasures=new java.util.Hashtable;var d=new J.smiles.SmilesSearch;d.setTop(a);d.isSmarts=this.isSmarts;d.pattern=b;d.flags=c;0<=b.indexOf("$(")&&(b=this.parseNested(d,b,""));this.parseSmiles(d,b,null,!1);if(0!=this.braceCount)throw new J.smiles.InvalidSmilesException("unmatched '{'");if(!this.ringBonds.isEmpty())throw new J.smiles.InvalidSmilesException("Open ring");d.setAtomArray();for(a=d.atomCount;0<=--a;)if(b=d.patternAtoms[a],b.setBondArray(),!this.isSmarts&&"\x00"==b.bioType&&!b.setHydrogenCount(d))throw new J.smiles.InvalidSmilesException("unbracketed atoms must be one of: B, C, N, O, P, S, F, Cl, Br, I,");
if(this.isSmarts)for(a=d.atomCount;0<=--a;){b=d.patternAtoms[a];this.checkNested(d,b,c);for(var e=0;e<b.nAtomsOr;e++)this.checkNested(d,b.atomsOr[e],c);for(e=0;e<b.nPrimitives;e++)this.checkNested(d,b.primitives[e],c)}!this.isSmarts&&!this.isBioSequence&&(d.elementCounts[1]=d.getMissingHydrogenCount());this.fixChirality(d);return d},"J.smiles.SmilesSearch,~S,~N");g(c$,"checkNested",function(a,b,c){if(0<b.iNested){var d=a.getNested(b.iNested);P(d,String)&&!d.startsWith("select")&&("~"!=d.charAt(0)&&
"\x00"!=b.bioType&&(d="~"+b.bioType+"~"+d),c=this.getSearch(a,d,c),0<c.atomCount&&c.patternAtoms[0].selected&&(b.selected=!0),a.setNested(b.iNested,c))}},"J.smiles.SmilesSearch,J.smiles.SmilesAtom,~N");g(c$,"fixChirality",function(a){for(var b=a.atomCount;0<=--b;){var c=a.patternAtoms[b],d=c.getChiralClass();if(-2147483648!=d){var e=c.missingHydrogenCount;0>e&&(e=0);e+=c.getBondCount();switch(d){case 0:switch(e){case 2:d=3==c.getValence()?3:2;break;case 3:case 4:case 5:case 6:d=e}break;case 8:4!=
e&&(d=0);break;case 2:case 6:case 4:case 5:e!=d&&(d=0)}if(0==d)throw new J.smiles.InvalidSmilesException("Incorrect number of bonds for stereochemistry descriptor");c.setChiralClass(d)}}},"J.smiles.SmilesSearch");g(c$,"parseSmiles",function(a,b,c,d){for(var e=E(1,0),f=0,k,j=null;null!=b&&0!=b.length;){var h=0;if(null==c||null!=j&&0==j.order)this.isBioSequence&&(a.top.needAromatic=!1),h=this.checkBioType(b,0);k=J.smiles.SmilesParser.getChar(b,h);var g=this.checkBrace(a,k,"{");g&&(k=J.smiles.SmilesParser.getChar(b,
++h));if("("==k){d="."==J.smiles.SmilesParser.getChar(b,h+1);if(null==c)throw new J.smiles.InvalidSmilesException("No previous atom for "+(d?"measure":"branch"));h=J.smiles.SmilesParser.getSubPattern(b,h,"(");h.startsWith(".")?this.parseMeasure(a,h.substring(1),c):0==h.length&&this.isBioSequence?c.notCrossLinked=!0:(this.branchLevel++,this.parseSmiles(a,h,c,!0),this.branchLevel--);h=h.length+2}else{for(f=h;J.smiles.SmilesBond.isBondType(k,this.isSmarts,this.isBioSequence);)k=J.smiles.SmilesParser.getChar(b,
++h);j=this.parseBond(a,null,b.substring(f,h),null,c,!1,d);g&&-1!=j.order&&(h=f);k=J.smiles.SmilesParser.getChar(b,h);this.checkBrace(a,k,"{")&&(k=J.smiles.SmilesParser.getChar(b,++h));"~"==k&&0==j.order&&(h=this.checkBioType(b,h),k=J.smiles.SmilesParser.getChar(b,h));if("\x00"==k&&0==j.order)break;f=Character.isDigit(k)||"%"==k;g=!f&&("_"==k||"["==k||"*"==k||Character.isLetter(k));if(f){switch(k){case "%":if("("==J.smiles.SmilesParser.getChar(b,h+1)){if(f=J.smiles.SmilesParser.getSubPattern(b,h+
1,"("),J.smiles.SmilesParser.getDigits(f,0,e),h+=f.length+3,0>e[0])throw new J.smiles.InvalidSmilesException("Invalid ring designation: "+f);}else if(h+3<=b.length&&(h=J.smiles.SmilesParser.getDigits(b.substring(0,h+3),h+1,e)),10>e[0])throw new J.smiles.InvalidSmilesException("Two digits must follow the % sign");d=e[0];break;default:d=k.charCodeAt(0)-48,h++}this.parseRing(a,d,c,j)}else if(g)switch(k){case "[":case "_":f=J.smiles.SmilesParser.getSubPattern(b,h,k);h+=f.length+("["==k?2:0);this.isBioSequence&&
("["==k&&0>f.indexOf(".")&&0>f.indexOf("_"))&&(f+=".0");c=this.parseAtom(a,null,f,c,j,"["==k,!1,d);-1!=j.order&&0!=j.order&&j.set2a(null,c);break;default:f=!this.isBioSequence&&Character.isUpperCase(k)?J.smiles.SmilesParser.getChar(b,h+1):"\x00";if("X"!=k||"x"!=f)if(!Character.isLowerCase(f)||0==J.util.Elements.elementNumberFromSymbol(b.substring(h,h+2),!0))f="\x00";"\x00"!=f&&0<="NA CA BA PA SC AC".indexOf(b.substring(h,h+2))&&(f="\x00");k=Character.isUpperCase(k)&&Character.isLowerCase(f)?2:1;c=
this.parseAtom(a,null,b.substring(h,h+k),c,j,!1,!1,d);h+=k}else throw new J.smiles.InvalidSmilesException("Unexpected character: "+J.smiles.SmilesParser.getChar(b,h));}k=J.smiles.SmilesParser.getChar(b,h);"}"==k&&this.checkBrace(a,k,"}")&&h++;b=b.substring(h);d=!1}},"J.smiles.SmilesSearch,~S,J.smiles.SmilesAtom,~B");g(c$,"checkBioType",function(a,b){if(this.isBioSequence="~"==a.charAt(b)){b++;this.bioType="*";var c=J.smiles.SmilesParser.getChar(a,2);if("~"==c&&("*"==(c=a.charAt(1))||Character.isLowerCase(c)))this.bioType=
c,b=3}return b},"~S,~N");g(c$,"parseMeasure",function(a,b,c){for(var d=b.indexOf(":"),e=!1,f=0>d?b:b.substring(0,d);0!=d;){1==f.length&&(f+="0");var k=this.htMeasures.get(f);if(null==k==0>d)break;try{if(0<d){var j="__dat".indexOf(f.charAt(0));if(2>j)break;var h=E(1,0),g=J.smiles.SmilesParser.getDigits(f,1,h),l=b.indexOf(",",d);0>l&&(l=b.indexOf("-",d+1));if(0>l)break;var m=b.substring(d+1,l);m.startsWith("!")&&(e=!0,m=m.substring(1));var n=d+1==l?0:JU.PT.fVal(m),m=b.substring(l+1),s=0==m.length?3.4028235E38:
JU.PT.fVal(m),k=new J.smiles.SmilesMeasure(a,g,j,n,s,e);a.measures.addLast(k);0<g?this.htMeasures.put(f,k):0==g&&J.util.Logger.debugging&&J.util.Logger.debug("measure created: "+k)}else{if(!k.addPoint(c.index))break;k.nPoints==k.type&&(this.htMeasures.remove(f),J.util.Logger.debugging&&J.util.Logger.debug("measure created: "+k));return}if(!k.addPoint(c.index))break}catch(p){if(D(p,NumberFormatException))break;else throw p;}return}throw new J.smiles.InvalidSmilesException("invalid measure: "+b);},
"J.smiles.SmilesSearch,~S,J.smiles.SmilesAtom");g(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 J.smiles.InvalidSmilesException("Unmatched '}'");},"J.smiles.SmilesSearch,~S,~S");g(c$,"parseNested",function(a,b,c){var d;for(c="$("+c;0<=(d=b.lastIndexOf(c));){var e=J.smiles.SmilesParser.getSubPattern(b,d+1,"("),f=d+e.length+3;b=b.substring(0,
d)+"_"+a.addNested(e)+"_"+b.substring(f)}return b},"J.smiles.SmilesSearch,~S,~S");g(c$,"parseVariables",function(a){for(var b=new JU.List,c=new JU.List,d,e=0,f=-1;0<=(d=a.indexOf("$",e))&&"("!=J.smiles.SmilesParser.getChar(a,e+1);){e=J.smiles.SmilesParser.skipTo(a,d,"=");if(e<=d+1||'"'!=J.smiles.SmilesParser.getChar(a,e+1))break;d=a.substring(d,e);if(0<d.lastIndexOf("$")||0<d.indexOf("]"))throw new J.smiles.InvalidSmilesException("Invalid variable name: "+d);f=J.smiles.SmilesParser.getSubPattern(a,
e+1,'"');b.addLast("["+d+"]");c.addLast(f);e+=f.length+2;e=J.smiles.SmilesParser.skipTo(a,e,";");f=++e}return 0>f?a:J.util.Txt.replaceStrings(a.substring(f),b,c)},"~S");g(c$,"parseAtom",function(a,b,c,d,e,f,k,g){if(null==c||0==c.length)throw new J.smiles.InvalidSmilesException("Empty atom definition");var h=null==b?a.addAtom():k?b.addPrimitive():b.addAtomOr();0<this.braceCount&&(h.selected=!0);if(!this.checkLogic(a,c,h,null,d,k,g)){var n=E(1,0);this.isBioSequence&&1==c.length&&(c+=".0");var l=c.charAt(0),
m=0,q=!1;if(this.isSmarts&&"!"==l){l=J.smiles.SmilesParser.getChar(c,++m);if("\x00"==l)throw new J.smiles.InvalidSmilesException("invalid '!'");h.not=q=!0}var s=-2147483648,p=c.indexOf(".");if(0<=p){l=c.substring(m,p);0==l.length&&(l="*");1<l.length?h.residueName=l.toUpperCase():l.equals("*")||(h.residueChar=l);l=c.substring(p+1).toUpperCase();if(0<=(p=l.indexOf("#")))J.smiles.SmilesParser.getDigits(l,p+1,n),h.elementNumber=n[0],l=l.substring(0,p);0==l.length&&(l="*");l.equals("*")||h.setAtomName(l);
l="\x00"}for(h.setBioAtom(this.bioType);"\x00"!=l;){h.setAtomName(this.isBioSequence?"0":"");if(Character.isDigit(l)){m=J.smiles.SmilesParser.getDigits(c,m,n);l=n[0];if(-2147483648==l)throw new J.smiles.InvalidSmilesException("Non numeric atomic mass");"?"==J.smiles.SmilesParser.getChar(c,m)&&(m++,l=-l);h.setAtomicMass(l)}else switch(l){case '"':l=JU.PT.getQuotedStringAt(c,m);m+=l.length+2;h.setAtomType(l);break;case "_":m=J.smiles.SmilesParser.getDigits(c,m+1,n)+1;if(-2147483648==n[0])throw new J.smiles.InvalidSmilesException("Invalid SEARCH primitive: "+
c.substring(m));h.iNested=n[0];if(this.isBioSequence&&f&&m!=c.length)throw new J.smiles.InvalidSmilesException("invalid characters: "+c.substring(m));break;case "=":m=J.smiles.SmilesParser.getDigits(c,m+1,n);h.jmolIndex=n[0];break;case "#":m=J.smiles.SmilesParser.getDigits(c,m+1,n);h.elementNumber=n[0];break;case "-":case "+":m=this.checkCharge(c,m,h);break;case "@":a.haveAtomStereochemistry=!0;m=this.checkChirality(c,m,a.patternAtoms[h.index]);break;default:var p=J.smiles.SmilesParser.getChar(c,
m+1),u=c.substring(m+1,m+(Character.isLowerCase(p)&&(!f||!Character.isDigit(J.smiles.SmilesParser.getChar(c,m+2)))?2:1)),r=Character.toUpperCase(l)+u,v=!0;f&&Character.isLetter(l)&&(!q&&(k?b:h).hasSymbol?v=!1:"H"==l?v=!Character.isDigit(p)||"?"==J.smiles.SmilesParser.getChar(c,m+2):0<="DdhRrvXx".indexOf(l)&&Character.isDigit(p)?v=!1:!r.equals("A")&&!r.equals("Xx")&&(v=0<J.util.Elements.elementNumberFromSymbol(r,!0),!v&&""!==u&&(u="",r=r.substring(0,1),v=0<J.util.Elements.elementNumberFromSymbol(r,
!0))));if(v){if(!f&&!this.isSmarts&&!this.isBioSequence&&!J.smiles.SmilesAtom.allowSmilesUnbracketed(r)||!h.setSymbol(r=l+u))throw new J.smiles.InvalidSmilesException("Invalid atom symbol: "+r);k&&(b.hasSymbol=!0);m+=r.length}else switch(m=J.smiles.SmilesParser.getDigits(c,m+1,n),p=n[0],l){default:throw new J.smiles.InvalidSmilesException("Invalid SEARCH primitive: "+c.substring(m));case "D":h.setDegree(-2147483648==p?1:p);break;case "d":h.setNonhydrogenDegree(-2147483648==p?1:p);break;case "H":s=
-2147483648==p?1:p;break;case "h":h.setImplicitHydrogenCount(-2147483648==p?-1:p);break;case "R":-2147483648==p&&(p=-1);h.setRingMembership(p);a.top.needRingData=!0;break;case "r":if(-2147483648==p)p=-1,h.setRingMembership(p);else{h.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":h.setValence(-2147483648==p?1:p);break;case "X":h.setConnectivity(-2147483648==p?1:p);break;case "x":h.setRingConnectivity(-2147483648==p?-1:
p),a.top.needRingData=!0}}l=J.smiles.SmilesParser.getChar(c,m);if(q&&"\x00"!=l)throw new J.smiles.InvalidSmilesException("'!' may only involve one primitive.");}-2147483648==s&&f&&(s=-2147483647);h.setExplicitHydrogenCount(s);a.patternAtoms[h.index].setExplicitHydrogenCount(s)}null!=d&&0==e.order&&(h.notBondedIndex=d.index);null!=d&&0!=e.order&&(-1==e.order&&(e.order=this.isBioSequence&&g?112:this.isSmarts||d.isAromatic()&&h.isAromatic()?81:1),f||e.set2a(null,h),0==this.branchLevel&&(17==e.order||
112==e.order)&&this.branchLevel++);0==this.branchLevel&&(a.lastChainAtom=h);return h},"J.smiles.SmilesSearch,J.smiles.SmilesAtom,~S,J.smiles.SmilesAtom,J.smiles.SmilesBond,~B,~B,~B");g(c$,"parseRing",function(a,b,c,d){a=Integer.$valueOf(b);b=this.ringBonds.get(a);if(null==b)this.ringBonds.put(a,d);else{this.ringBonds.remove(a);switch(d.order){case -1:d.order=-1!=b.order?b.order:this.isSmarts||c.isAromatic()&&b.getAtom1().isAromatic()?81:1;break;case 257:d.order=513;break;case 513:d.order=257}if(-1!=
b.order&&b.order!=d.order)throw new J.smiles.InvalidSmilesException("Incoherent bond type for ring");b.set(d);c.bondCount--;b.setAtom2(c)}},"J.smiles.SmilesSearch,~N,J.smiles.SmilesAtom,J.smiles.SmilesBond");g(c$,"checkCharge",function(a,b,c){var d=a.length,e=a.charAt(b),f=1;++b;if(b<d){var g=a.charAt(b);if(Character.isDigit(g)){if(d=E(1,0),b=J.smiles.SmilesParser.getDigits(a,b,d),f=d[0],-2147483648==f)throw new J.smiles.InvalidSmilesException("Non numeric charge");}else for(;b<d&&a.charAt(b)==e;)b++,
f++}c.setCharge("+"==e?f:-f);return b},"~S,~N,J.smiles.SmilesAtom");g(c$,"checkChirality",function(a,b,c){var d=0,e=-2147483648,f=a.length,g,d=0,e=1;if(++b<f){switch(g=a.charAt(b)){case "@":e=2;b++;break;case "H":break;case "A":case "D":case "E":case "O":case "S":case "T":d=b+1<f?J.smiles.SmilesAtom.getChiralityClass(a.substring(b,b+2)):-1;b+=2;break;default:e=Character.isDigit(g)?1:-1}g=b;if(1==e){for(;g<f&&Character.isDigit(a.charAt(g));)g++;if(g>b){try{e=Integer.parseInt(a.substring(b,g))}catch(j){if(D(j,
NumberFormatException))e=-1;else throw j;}b=g}}if(1>e||0>d)throw new J.smiles.InvalidSmilesException("Invalid stereochemistry descriptor");}c.setChiralClass(d);c.setChiralOrder(e);"?"==J.smiles.SmilesParser.getChar(a,b)&&(J.util.Logger.info("Ignoring '?' in stereochemistry"),b++);return b},"~S,~N,J.smiles.SmilesAtom");g(c$,"parseBond",function(a,b,c,d,e,f,g){var j=J.smiles.SmilesParser.getChar(c,0);if("."==j){if(null!=d||null!=b)throw new J.smiles.InvalidSmilesException("invalid '.'");this.isBioSequence=
"~"==J.smiles.SmilesParser.getChar(c,1);return new J.smiles.SmilesBond(null,null,0,!1)}if("+"==j&&null!=b)throw new J.smiles.InvalidSmilesException("invalid '+'");d=null==b?null==d?new J.smiles.SmilesBond(e,null,this.isBioSequence&&null!=e?g?112:96:-1,!1):d:f?b.addPrimitive():b.addBondOr();if("\x00"!=j&&!this.checkLogic(a,c,null,d,e,f,!1)){if(f="!"==j)if(j=J.smiles.SmilesParser.getChar(c,1),"\x00"==j||"!"==j)throw new J.smiles.InvalidSmilesException("invalid '!'");c=J.smiles.SmilesBond.getBondTypeFromCode(j);
65==c&&(a.top.needRingMemberships=!0);if(null==e&&0!=c)throw new J.smiles.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:e.isAromatic()&&(a.top.needRingData=!0)}d.set2(c,f);this.isBioSequence&&null!=b&&b.set2(c,f)}return d},"J.smiles.SmilesSearch,J.smiles.SmilesBond,~S,J.smiles.SmilesBond,J.smiles.SmilesAtom,~B,~B");g(c$,"checkLogic",
function(a,b,c,d,e,f,g){for(var j=b.indexOf(","),h=b.length;;){var n=0<j;if(n&&!this.isSmarts||0==j)break;var l="",j=b.indexOf(";");if(0<=j){if(!this.isSmarts||0==j)break;l="&"+b.substring(j+1);b=b.substring(0,j);n||(b+=l,l="")}var m=0;if(n)for(b+=",";0<(j=b.indexOf(",",m))&&j<=h;){m=b.substring(m,j)+l;if(0==m.length)throw new J.smiles.InvalidSmilesException("missing "+(null==d?"atom":"bond")+" token");null==d?this.parseAtom(a,c,m,null,null,!0,!1,g):this.parseBond(a,d,m,null,e,!1,!1);m=j+1}else if(0<=
(j=b.indexOf("&"))||null!=d&&1<h&&!f){if(!this.isSmarts||0==j)break;if(null!=d&&0>j&&1<h){f=new JU.SB;for(n=0;n<h;){var q=b.charAt(n++);f.appendC(q);"!"!=q&&n<h&&f.appendC("&")}b=f.toString();h=b.length}for(b+="&";0<(j=b.indexOf("&",m))&&j<=h;)m=b.substring(m,j)+l,null==d?this.parseAtom(a,c,m,null,null,!0,!0,g):this.parseBond(a,d,m,null,e,!0,!1),m=j+1}else return!1;return!0}q=b.charAt(j);throw new J.smiles.InvalidSmilesException((this.isSmarts?"invalid placement for '"+q+"'":"["+q+"] notation only valid with SMARTS, not SMILES,")+
" in "+b);},"J.smiles.SmilesSearch,~S,J.smiles.SmilesAtom,J.smiles.SmilesBond,J.smiles.SmilesAtom,~B,~B");c$.getSubPattern=g(c$,"getSubPattern",function(a,b,c){var d,e=1;switch(c){case "[":d="]";break;case '"':case "%":d=c;break;case "(":d=")";break;default:d=c,e=0}for(var f=a.length,g=1,j=b+1;j<f;j++){var h=a.charAt(j);if(h==d){if(g--,0==g)return a.substring(b+e,j+1-e)}else h==c&&g++}throw new J.smiles.InvalidSmilesException("Unmatched "+c);},"~S,~N,~S");c$.getChar=g(c$,"getChar",function(a,b){return b<
a.length?a.charAt(b):"\x00"},"~S,~N");c$.getDigits=g(c$,"getDigits",function(a,b,c){for(var d=b,e=a.length;d<e&&Character.isDigit(a.charAt(d));)d++;try{c[0]=Integer.parseInt(a.substring(b,d))}catch(f){if(D(f,NumberFormatException))c[0]=-2147483648;else throw f;}return d},"~S,~N,~A");c$.skipTo=g(c$,"skipTo",function(a,b,c){for(var d;(d=J.smiles.SmilesParser.getChar(a,++b))!=c&&"\x00"!=d;);return"\x00"==d?-1:b},"~S,~N,~S");c$.getRingPointer=g(c$,"getRingPointer",function(a){return 10>a?""+a:100>a?"%"+
a:"%("+a+")"},"~N");c$.cleanPattern=g(c$,"cleanPattern",function(a){a=JU.PT.replaceAllCharacters(a," \t\n\r","");a=JU.PT.simpleReplace(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.simpleReplace(a,"//","")},"~S")})})(Clazz,Clazz.newArray,Clazz.newBooleanArray,Clazz.newByteArray,Clazz.newCharArray,Clazz.newDoubleArray,Clazz.newFloatArray,Clazz.newIntArray,Clazz.newLongArray,Clazz.newShortArray,Clazz.prepareCallback,
Clazz.decorateAsClass,Clazz.isClassDefined,Clazz.defineEnumConstant,Clazz.cloneFinals,Clazz.inheritArgs,Clazz.pu$h,Clazz.declareInterface,Clazz.declarePackage,Clazz.makeConstructor,Clazz.overrideConstructor,Clazz.load,Clazz.defineMethod,Clazz.innerTypeInstance,Clazz.instanceOf,Clazz.p0p,Clazz.makeFunction,Clazz.superConstructor,Clazz.defineStatics,Clazz.registerSerializableFields,Clazz.declareType,Clazz.superCall,Clazz.overrideMethod,Clazz.declareAnonymous,Clazz.checkPrivateMethod,Clazz.prepareFields,
Clazz.instantialize,Clazz.doubleToInt,Clazz.declarePackage,Clazz.instanceOf,Clazz.load,Clazz.instantialize,Clazz.decorateAsClass,Clazz.floatToInt,Clazz.makeConstructor,Clazz.defineEnumConstant,Clazz.exceptionOf,Clazz.newIntArray,Clazz.defineStatics,Clazz.newFloatArray,Clazz.declareType,Clazz.prepareFields,Clazz.superConstructor,Clazz.newByteArray,Clazz.declareInterface,Clazz.p0p,Clazz.pu$h,Clazz.newShortArray,Clazz.innerTypeInstance,Clazz.isClassDefined,Clazz.prepareCallback,Clazz.newArray,Clazz.castNullAs,
Clazz.floatToShort,Clazz.superCall,Clazz.decorateAsType,Clazz.newBooleanArray,Clazz.newCharArray,Clazz.implementOf,Clazz.newDoubleArray,Clazz.overrideConstructor,Clazz.supportsNativeObject,Clazz.extendedObjectMethods,Clazz.callingStackTraces,Clazz.clone,Clazz.doubleToShort,Clazz.innerFunctions,Clazz.getInheritedLevel,Clazz.getParamsType,Clazz.isAF,Clazz.isAI,Clazz.isAS,Clazz.isASS,Clazz.isAP,Clazz.isAFloat,Clazz.isAII,Clazz.isAFF,Clazz.isAFFF,Clazz.tryToSearchAndExecute,Clazz.getStackTrace,Clazz.inheritArgs);
