Clazz.declarePackage("J.api");Clazz.declareInterface(J.api,"JmolPropertyManager");Clazz.declarePackage("J.viewer");
Clazz.load(["J.api.JmolPropertyManager","java.util.Hashtable"],"J.viewer.PropertyManager","java.lang.Boolean $.Float java.util.Arrays J.modelset.Atom $.LabelToken J.script.SV $.T J.util.BS $.BSUtil $.Elements $.Escape $.JmolEdge $.JmolList $.JmolMolecule $.Logger $.P3 $.Parser $.SB $.TextFormat $.V3 J.viewer.Viewer".split(" "),function(){c$=Clazz.decorateAsClass(function(){this.map=this.viewer=null;Clazz.instantialize(this,arguments)},J.viewer,"PropertyManager",null,J.api.JmolPropertyManager);Clazz.prepareFields(c$,
function(){this.map=new java.util.Hashtable});Clazz.makeConstructor(c$,function(){});Clazz.overrideMethod(c$,"setViewer",function(a){this.viewer=a;for(var c=a=0;a<J.viewer.PropertyManager.propertyTypes.length;a+=3)this.map.put(J.viewer.PropertyManager.propertyTypes[a].toLowerCase(),Integer.$valueOf(c++))},"J.viewer.Viewer");Clazz.overrideMethod(c$,"getPropertyNumber",function(a){a=this.map.get(null==a?"":a.toLowerCase());return null==a?-1:a.intValue()},"~S");Clazz.overrideMethod(c$,"getDefaultPropertyParam",
function(a){return 0>a?"":J.viewer.PropertyManager.propertyTypes[3*a+2]},"~N");Clazz.overrideMethod(c$,"checkPropertyParameter",function(a){a=this.getPropertyNumber(a);a=J.viewer.PropertyManager.getParamType(a);return 0<a.length&&"<atom selection>"!==a},"~S");Clazz.overrideMethod(c$,"getProperty",function(a,c,d){117!=J.viewer.PropertyManager.propertyTypes.length&&J.util.Logger.warn("propertyTypes is not the right length: "+J.viewer.PropertyManager.propertyTypes.length+" != 117");d=0<=c.indexOf(".")||
0<=c.indexOf("[")?this.getModelProperty(c,d):this.getPropertyAsObject(c,d,a);if(null==a)return d;var b=a.equalsIgnoreCase("readable");b&&(a=J.viewer.PropertyManager.isReadableAsString(c)?"String":"JSON");return a.equalsIgnoreCase("String")?null==d?"":d.toString():b?J.util.Escape.toReadable(c,d):a.equalsIgnoreCase("JSON")?"{"+J.util.Escape.toJSON(c,d)+"}":d},"~S,~S,~O");$_M(c$,"getModelProperty",($fz=function(a,c){a=a.$replace("]"," ").$replace("["," ").$replace("."," ");a=J.util.TextFormat.simpleReplace(a,
"  "," ");var d=J.util.TextFormat.splitChars(J.util.TextFormat.trim(a," ")," "),b=Array(d.length);a=d[0];for(var e,f=1;f<d.length;f++)b[f]=-2147483648!=(e=J.util.Parser.parseInt(d[f]))?J.script.SV.newScriptVariableInt(e):J.script.SV.newVariable(4,d[f]);return this.extractProperty(this.getProperty(null,a,c),b,1)},$fz.isPrivate=!0,$fz),"~S,~O");Clazz.overrideMethod(c$,"extractProperty",function(a,c,d){if(d>=c.length)return a;var b;b=c[d++];switch(b.tok){case 2:b=b.asInt()-1;if(Clazz.instanceOf(a,J.util.JmolList))return 0>
b&&(b+=a.size()),0<=b&&b<a.size()?this.extractProperty(a.get(b),c,d):"";if(Clazz.instanceOf(a,J.util.Matrix3f))return a=[[a.m00,a.m01,a.m02],[a.m10,a.m11,a.m12],[a.m20,a.m21,a.m22]],0>b&&(b+=3),0<=b&&3>b?this.extractProperty(a,c,--d):"";if(J.util.Escape.isAI(a))return 0>b&&(b+=a.length),0<=b&&b<a.length?Integer.$valueOf(a[b]):"";if(J.util.Escape.isAF(a))return 0>b&&(b+=a.length),0<=b&&b<a.length?Float.$valueOf(a[b]):"";if(J.util.Escape.isAII(a)||J.util.Escape.isAFF(a))return 0>b&&(b+=a.length),0<=
b&&b<a.length?this.extractProperty(a[b],c,d):"";if(J.util.Escape.isAS(a)||Clazz.instanceOf(a,Array))return 0>b&&(b+=a.length),0<=b&&b<a.length?a[b]:"";break;case 4:var e=b.asString();if(Clazz.instanceOf(a,java.util.Map)){if(e.equalsIgnoreCase("keys")){e=new J.util.JmolList;for(b=a.keySet().iterator();b.hasNext();)e.addLast(b.next());return this.extractProperty(e,c,d)}if(!a.containsKey(e)){b=a.keySet().iterator();for(var f="";b.hasNext();)if((f=b.next()).equalsIgnoreCase(e)){e=f;break}}return a.containsKey(e)?
this.extractProperty(a.get(e),c,d):""}if(Clazz.instanceOf(a,J.util.JmolList)){e=new J.util.JmolList;d--;for(b=0;b<a.size();b++)f=a.get(b),Clazz.instanceOf(f,java.util.Map)&&e.addLast(this.extractProperty(f,c,d));return e}}return a},"~O,~A,~N");c$.getPropertyName=$_M(c$,"getPropertyName",($fz=function(a){return 0>a?"":J.viewer.PropertyManager.propertyTypes[3*a]},$fz.isPrivate=!0,$fz),"~N");c$.getParamType=$_M(c$,"getParamType",($fz=function(a){return 0>a?"":J.viewer.PropertyManager.propertyTypes[3*
a+1]},$fz.isPrivate=!0,$fz),"~N");c$.isReadableAsString=$_M(c$,"isReadableAsString",($fz=function(a){for(var c=J.viewer.PropertyManager.readableTypes.length;0<=--c;)if(a.equalsIgnoreCase(J.viewer.PropertyManager.readableTypes[c]))return!0;return!1},$fz.isPrivate=!0,$fz),"~S");$_M(c$,"getPropertyAsObject",($fz=function(a,c,d){if(a.equals("tokenList"))return J.script.T.getTokensLike(c);var b=this.getPropertyNumber(a),e=null!=c&&0<c.toString().length;c=e?c:this.getDefaultPropertyParam(b);switch(b){case 0:return this.viewer.getAppletInfo();
case 5:return this.viewer.getAnimationInfo();case 13:return this.viewer.getAtomBitSetVector(c);case 14:return this.viewer.getAllAtomInfo(c);case 24:return this.viewer.getAuxiliaryInfo(c);case 15:return this.viewer.getAllBondInfo(c);case 25:return this.viewer.getBoundBoxInfo();case 10:return this.viewer.getRotationCenter();case 16:return this.viewer.getAllChainInfo(c);case 37:return this.viewer.getProperty("DATA_API","consoleText",null);case 38:return this.viewer.getJspecViewProperties(c);case 26:return this.viewer.getData(c.toString());
case 33:return this.viewer.getErrorMessageUn();case 28:return this.viewer.evaluateExpression(c.toString());case 20:return this.viewer.getModelExtract(c,!0,!1,"MOL");case 32:return J.viewer.PropertyManager.getFileInfo(this.viewer.getFileData(),c.toString());case 1:return this.viewer.getFullPathName();case 2:return this.viewer.getFileHeader();case 4:case 3:return e?this.viewer.getFileAsString(c.toString()):this.viewer.getCurrentFileAsString();case 27:a=c.toString();e=b=-1;if(0<=(c=a.indexOf("height=")))b=
J.util.Parser.parseInt(a.substring(c+7));if(0<=(c=a.indexOf("width=")))e=J.util.Parser.parseInt(a.substring(c+6));0>e&&0>b?b=e=-1:0>e?e=b:b=e;return this.viewer.getImageAs(null==d?"JPEG":"JPG64",-1,e,b,null,null);case 35:return this.viewer.getShapeProperty(24,"getInfo");case 36:return this.viewer.getShapeProperty(24,"getData");case 21:return this.viewer.getStatusChanged(c.toString());case 22:return this.viewer;case 7:return this.viewer.getLigandInfo(c);case 9:return this.viewer.getMeasurementInfo();
case 29:return this.viewer.getMenu(c.toString());case 23:return this.viewer.getMessageQueue();case 30:return this.viewer.getMinimizationInfo();case 6:return this.viewer.getModelInfo(c);case 18:return this.viewer.getMoleculeInfo(c);case 34:return this.viewer.getMouseInfo();case 11:return this.viewer.getOrientationInfo();case 31:return this.viewer.getPointGroupInfo(c);case 17:return this.viewer.getAllPolymerInfo(c);case 8:return this.viewer.getShapeInfo();case 19:return this.viewer.getStateInfo3(c.toString(),
0,0);case 12:return this.viewer.getMatrixRotate()}d=Array(39);for(b=0;39>b;b++){e=J.viewer.PropertyManager.getParamType(b);c=this.getDefaultPropertyParam(b);var f=J.viewer.PropertyManager.getPropertyName(b);d[b]="X"==f.charAt(0)?"":f+(""!==e?" "+J.viewer.PropertyManager.getParamType(b)+(""!==c?" #default: "+this.getDefaultPropertyParam(b):""):"")}java.util.Arrays.sort(d);e=new J.util.SB;e.append("getProperty ERROR\n").append(a).append("?\nOptions include:\n");for(b=0;39>b;b++)0<d[b].length&&e.append("\n getProperty ").append(d[b]);
return e.toString()},$fz.isPrivate=!0,$fz),"~S,~O,~S");c$.getFileInfo=$_M(c$,"getFileInfo",function(a,c){var d=new java.util.Hashtable;if(null==a)return d;var b=null!=c&&0<c.length;if(Clazz.instanceOf(a,java.util.Map))return b?a.get(c):a;var e=J.util.TextFormat.split(a,"\n");if(0==e.length||6>e[0].length||" "!=e[0].charAt(6)||!e[0].substring(0,6).equals(e[0].substring(0,6).toUpperCase()))return d.put("fileHeader",a),d;var f="",h=new J.util.SB;b&&(c=c.toUpperCase());for(var g="",k=0;k<e.length;k++){var j=
e[k];if(!(12>j.length)){var g=j.substring(0,6).trim(),n=j.substring(7,10).trim();g.equals("REMARK")&&(g+=n);if(!g.equals(f)){if(b&&f.equals(c))return h.toString();b||(d.put(f,h.toString()),h=new J.util.SB);f=g}(!b||g.equals(c))&&h.append(j.substring(10).trim()).appendC("\n")}}b||d.put(f,h.toString());return b?g.equals(c)?h.toString():"":d},"~O,~S");Clazz.overrideMethod(c$,"getMoleculeInfo",function(a,c){for(var d=this.viewer.getAtomBitSet(c),b=this.viewer.modelSet.getMolecules(),e=new J.util.JmolList,
f=new J.util.BS,h=0;h<b.length;h++){var f=J.util.BSUtil.copy(d),g=b[h];f.and(g.atomList);0<f.length()&&(f=new java.util.Hashtable,f.put("mf",g.getMolecularFormula(!1)),f.put("number",Integer.$valueOf(g.moleculeIndex+1)),f.put("modelNumber",a.getModelNumberDotted(g.modelIndex)),f.put("numberInModel",Integer.$valueOf(g.indexInModel+1)),f.put("nAtoms",Integer.$valueOf(g.atomCount)),f.put("nElements",Integer.$valueOf(g.nElements)),e.addLast(f))}return e},"J.modelset.ModelSet,~O");Clazz.overrideMethod(c$,
"getModelInfo",function(a){a=this.viewer.getModelBitSet(this.viewer.getAtomBitSet(a),!1);var c=this.viewer.getModelSet(),d=new java.util.Hashtable;d.put("modelSetName",c.modelSetName);d.put("modelCount",Integer.$valueOf(c.modelCount));d.put("isTainted",Boolean.$valueOf(null!=c.tainted));d.put("canSkipLoad",Boolean.$valueOf(c.canSkipLoad));d.put("modelSetHasVibrationVectors",Boolean.$valueOf(c.modelSetHasVibrationVectors()));null!=c.modelSetProperties&&d.put("modelSetProperties",c.modelSetProperties);
d.put("modelCountSelected",Integer.$valueOf(J.util.BSUtil.cardinalityOf(a)));d.put("modelsSelected",a);var b=new J.util.JmolList;c.getMolecules();for(var e=a.nextSetBit(0);0<=e;e=a.nextSetBit(e+1)){var f=new java.util.Hashtable;f.put("_ipt",Integer.$valueOf(e));f.put("num",Integer.$valueOf(c.getModelNumber(e)));f.put("file_model",c.getModelNumberDotted(e));f.put("name",c.getModelName(e));var h=c.getModelTitle(e);null!=h&&f.put("title",h);h=c.getModelFileName(e);null!=h&&f.put("file",h);h=c.getModelAuxiliaryInfoValue(e,
"modelID");null!=h&&f.put("id",h);f.put("vibrationVectors",Boolean.$valueOf(c.modelHasVibrationVectors(e)));h=c.models[e];f.put("atomCount",Integer.$valueOf(h.atomCount));f.put("bondCount",Integer.$valueOf(h.getBondCount()));f.put("groupCount",Integer.$valueOf(h.getGroupCount()));f.put("moleculeCount",Integer.$valueOf(h.moleculeCount));f.put("polymerCount",Integer.$valueOf(h.getBioPolymerCount()));f.put("chainCount",Integer.$valueOf(c.getChainCountInModel(e,!0)));null!=h.properties&&f.put("modelProperties",
h.properties);var g=c.getModelAuxiliaryInfoValue(e,"Energy");null!=g&&f.put("energy",g);f.put("atomCount",Integer.$valueOf(h.atomCount));b.addLast(f)}d.put("models",b);return d},"~O");Clazz.overrideMethod(c$,"getLigandInfo",function(a){var c=this.viewer.getAtomBitSet(a),d=this.viewer.getAtomBitSet("solvent");a=new java.util.Hashtable;var b=new J.util.JmolList;a.put("ligands",b);var e=this.viewer.modelSet,f=J.util.BSUtil.copyInvert(c,e.atomCount);f.or(d);for(var d=e.atoms,h=c.nextSetBit(0);0<=h;h=
c.nextSetBit(h+1))(d[h].isProtein()||d[h].isNucleic())&&f.set(h);c=Array(e.modelCount);for(h=e.modelCount;0<=--h;)c[h]=this.viewer.getModelUndeletedAtomsBitSet(h),c[h].andNot(f);f=J.util.JmolMolecule.getMolecules(d,c,null,f);for(h=0;h<f.length;h++){var c=f[h].atomList,g=new java.util.Hashtable;b.addLast(g);g.put("atoms",J.util.Escape.eBS(c));for(var k="",j="",n=null,m="\x00",l="",q="",p=2147483647,u=2147483647,s=c.nextSetBit(0);0<=s;s=c.nextSetBit(s+1)){var r=d[s];if(n!==r.group){var n=r.group,t=
r.getResno(),v=r.getChainID();p!=t-1&&(0!=l.length&&p!=u&&(l+="-"+p),v="\u0001",u=t);q="/"+e.getModelNumberDotted(r.modelIndex);"\x00"!=m&&v!=m&&(l+=":"+m+q);"\u0001"==v&&(l+=" "+t);p=t;m=r.getChainID();k+=j+r.getGroup3(!1);j="-"}}l+=(u==p?"":"-"+p)+("\x00"==m?"":":"+m)+q;g.put("groupNames",k);g.put("residueList",l.substring(1))}return a},"~O");Clazz.overrideMethod(c$,"getSymmetryInfo",function(a,c,d,b,e,f,h){var g=-1;if(null==a){g=this.viewer.getCurrentModelIndex();if(0>g)return"";a=this.viewer.getModelUndeletedAtomsBitSet(g)}a=
a.nextSetBit(0);if(0>a)return"";var g=this.viewer.modelSet.atoms[a].modelIndex,k=this.viewer.modelSet.getUnitCell(g);return null==k?"":k.getSymmetryInfo(this.viewer.modelSet,g,a,k,c,d,b,e,f,h)},"J.util.BS,~S,~N,J.util.P3,J.util.P3,~S,~N");Clazz.overrideMethod(c$,"getModelExtract",function(a,c,d,b){var e=b.equalsIgnoreCase("V3000"),f=b.equalsIgnoreCase("SDF"),h=b.equalsIgnoreCase("XYZVIB"),g=b.equalsIgnoreCase("CD");b=new J.util.SB;var k=this.viewer.modelSet;if(!h&&!g){b.append(d?"Jmol Model Kit":
this.viewer.getFullPathName().$replace("\\","/"));d=J.viewer.Viewer.getJmolVersion();b.append("\n__Jmol-").append(d.substring(0,2));var j,n,m,l;l=new Date;d=l.getMonth();j=l.getDate();n=l.getFullYear();m=l.getHours();l=l.getMinutes();J.util.TextFormat.rFill(b,"_00",""+(1+d));J.util.TextFormat.rFill(b,"00",""+j);b.append((""+n).substring(2,4));J.util.TextFormat.rFill(b,"00",""+m);J.util.TextFormat.rFill(b,"00",""+l);b.append("3D 1   1.00000     0.00000     0");b.append("\nJmol version ").append(J.viewer.Viewer.getJmolVersion()).append(" EXTRACT: ").append(J.util.Escape.eBS(a)).append("\n")}d=
J.util.BSUtil.copy(a);n=k.atoms;for(j=a.nextSetBit(0);0<=j;j=a.nextSetBit(j+1))c&&n[j].isDeleted()&&d.clear(j);m=J.viewer.PropertyManager.getCovalentBondsForAtoms(k.bonds,k.bondCount,d);if(!h&&0==d.cardinality())return"";a=!0;c=c?this.viewer.getRotationQuaternion():null;if(f){n=b.toString();b=new J.util.SB;e=this.viewer.getModelBitSet(d,!0);for(j=e.nextSetBit(0);0<=j;j=e.nextSetBit(j+1)){b.append(n);f=J.util.BSUtil.copy(d);f.and(k.getModelAtomBitSetIncludingDeleted(j,!1));m=J.viewer.PropertyManager.getCovalentBondsForAtoms(k.bonds,
k.bondCount,f);if(!(a=this.addMolFile(b,f,m,!1,!1,c)))break;b.append("$$$$\n")}}else if(h){h=J.modelset.LabelToken.compile(this.viewer,"%-2e %10.5x %10.5y %10.5z %10.5vx %10.5vy %10.5vz\n","\x00",null);c=J.modelset.LabelToken.compile(this.viewer,"%-2e %10.5x %10.5y %10.5z\n","\x00",null);e=this.viewer.getModelBitSet(d,!0);for(j=e.nextSetBit(0);0<=j;j=e.nextSetBit(j+1))if(f=J.util.BSUtil.copy(d),f.and(k.getModelAtomBitSetIncludingDeleted(j,!1)),0!=f.cardinality()){b.appendI(f.cardinality()).appendC("\n");
g=k.models[j].properties;b.append("Model["+(j+1)+"]: ");if(null!=k.frameTitles[j]&&0<k.frameTitles[j].length)b.append(k.frameTitles[j].$replace("\n"," "));else if(null==g)b.append("Jmol "+J.viewer.Viewer.getJmolVersion());else{m=new J.util.SB;l=g.propertyNames();for(var q=null;l.hasMoreElements();){var p=l.nextElement();p.equals(".PATH")?q=g.getProperty(p):m.append(";").append(p).append("=").append(g.getProperty(p))}null!=q&&m.append(";PATH=").append(q);q=m.substring(0<m.length()?1:0);b.append(q.$replace("\n",
" "))}b.appendC("\n");for(g=f.nextSetBit(0);0<=g;g=f.nextSetBit(g+1))b.append(J.modelset.LabelToken.formatLabelAtomArray(this.viewer,n[g],null==k.getVibrationVector(g,!1)?c:h,"\x00",null))}}else a=this.addMolFile(b,d,m,e,g,c);return a?b.toString():"ERROR: Too many atoms or bonds -- use V3000 format."},"J.util.BS,~B,~B,~S");$_M(c$,"addMolFile",($fz=function(a,c,d,b,e,f){var h=c.cardinality(),g=d.cardinality();if(!b&&!e&&(999<h||999<g))return!1;var k=this.viewer.modelSet,j=Clazz.newIntArray(k.atomCount,
0),n=new J.util.P3;b?a.append("  0  0  0  0  0  0            999 V3000"):e?a.append('{"mol":{"scaling":[20,-20,20],"a":['):(J.util.TextFormat.rFill(a,"   ",""+h),J.util.TextFormat.rFill(a,"   ",""+g),a.append("  0  0  0  0              1 V2000"));e||a.append("\n");b&&a.append("M  V30 BEGIN CTAB\nM  V30 COUNTS ").appendI(h).append(" ").appendI(g).append(" 0 0 0\n").append("M  V30 BEGIN ATOM\n");for(var m=new J.util.P3,g=c.nextSetBit(0),l=0;0<=g;g=c.nextSetBit(g+1))this.getAtomRecordMOL(k,a,j[g]=++l,
k.atoms[g],f,n,m,b,e);b?a.append("M  V30 END ATOM\nM  V30 BEGIN BOND\n"):e&&a.append('],"b":[');g=d.nextSetBit(0);for(l=0;0<=g;g=d.nextSetBit(g+1))this.getBondRecordMOL(a,++l,k.bonds[g],j,b,e);b&&a.append("M  V30 END BOND\nM  V30 END CTAB\n");e?a.append("]}}"):a.append("M  END\n");if(!e&&!b&&(d=k.getPartialCharges(),null!=d)){a.append("> <JMOL_PARTIAL_CHARGES>\n").appendI(h).appendC("\n");g=c.nextSetBit(0);for(l=0;0<=g;g=c.nextSetBit(g+1))a.appendI(++l).append(" ").appendF(d[g]).appendC("\n")}return!0},
$fz.isPrivate=!0,$fz),"J.util.SB,J.util.BS,J.util.BS,~B,~B,J.util.Quaternion");c$.getCovalentBondsForAtoms=$_M(c$,"getCovalentBondsForAtoms",($fz=function(a,c,d){for(var b=new J.util.BS,e=0;e<c;e++){var f=a[e];d.get(f.atom1.index)&&(d.get(f.atom2.index)&&f.isCovalent())&&b.set(e)}return b},$fz.isPrivate=!0,$fz),"~A,~N,J.util.BS");$_M(c$,"getAtomRecordMOL",($fz=function(a,c,d,b,e,f,h,g,k){a.models[b.modelIndex].isTrajectory?b.setFractionalCoordPt(h,a.trajectorySteps.get(b.modelIndex)[b.index-a.models[b.modelIndex].firstAtomIndex],
!0):f.setT(b);null!=e&&e.transformP2(f,f);a=b.getElementNumber();e=b.isDeleted()?"Xx":J.util.Elements.elementSymbolFromNumber(a);h=b.getIsotopeNumber();var j=b.getFormalCharge();g?(c.append("M  V30 ").appendI(d).append(" ").append(e).append(" ").appendF(f.x).append(" ").appendF(f.y).append(" ").appendF(f.z).append(" 0"),0!=j&&c.append(" CHG=").appendI(j),0!=h&&c.append(" MASS=").appendI(h),c.append("\n")):k?(1!=d&&c.append(","),c.append("{"),6!=b.getElementNumber()&&c.append('"l":"').append(b.getElementSymbol()).append('",'),
0!=j&&c.append('"c":').appendI(j).append(","),0!=h&&h!=J.util.Elements.getNaturalIsotope(a)&&c.append('"m":').appendI(h).append(","),c.append('"x":').appendF(20*b.x).append(',"y":').appendF(20*-b.y).append(',"z":').appendF(20*b.z).append("}")):(c.append(J.util.TextFormat.sprintf("%10.5p%10.5p%10.5p","p",[f])),c.append(" ").append(e),1==e.length&&c.append(" "),0<h&&(h-=J.util.Elements.getNaturalIsotope(b.getElementNumber())),c.append(" "),J.util.TextFormat.rFill(c,"  ",""+h),J.util.TextFormat.rFill(c,
"   ",""+(0==j?0:4-j)),c.append("  0  0  0  0\n"))},$fz.isPrivate=!0,$fz),"J.modelset.ModelSet,J.util.SB,~N,J.modelset.Atom,J.util.Quaternion,J.util.P3,J.util.P3,~B,~B");$_M(c$,"getBondRecordMOL",($fz=function(a,c,d,b,e,f){var h=b[d.atom1.index];b=b[d.atom2.index];var g=d.getValence();3<g&&(g=1);switch(d.order&-131073){case 515:g=f?2:4;break;case 66:g=f?1:5;break;case 513:g=f?1:6;break;case 514:g=f?2:7;break;case 33:g=f?1:8}e?a.append("M  V30 ").appendI(c).append(" ").appendI(g).append(" ").appendI(h).append(" ").appendI(b).appendC("\n"):
f?(1!=c&&a.append(","),a.append('{"b":').appendI(h-1).append(',"e":').appendI(b-1),1!=g&&a.append(',"o":').appendI(g),a.append("}")):(J.util.TextFormat.rFill(a,"   ",""+h),J.util.TextFormat.rFill(a,"   ",""+b),a.append("  ").appendI(g).append("  0  0  0\n"))},$fz.isPrivate=!0,$fz),"J.util.SB,~N,J.modelset.Bond,~A,~B,~B");Clazz.overrideMethod(c$,"getChimeInfo",function(a,c){switch(a){case 1073741982:break;case 1073741864:return this.getBasePairInfo(c);default:return this.getChimeInfoA(this.viewer.modelSet.atoms,
a,c)}var d=new J.util.SB;this.viewer.modelSet.models[0].getChimeInfo(d,0);return d.appendC("\n").toString().substring(1)},"~N,J.util.BS");$_M(c$,"getChimeInfoA",($fz=function(a,c,d){var b=new J.util.SB;b.append("\n");var e;e="";var f=null,h=null,g=-1,k=0;if(null!=d)for(var j=d.nextSetBit(0);0<=j;j=d.nextSetBit(j+1)){e=a[j].getChainID();e="\x00"==e?" ":""+e;switch(c){case 1087373316:break;case 1114638350:e=a[j].getInfo();break;case 1141899265:e=""+a[j].getAtomNumber();break;case 1087373318:e=a[j].getGroup3(!1);
break;case 1073742120:e="["+a[j].getGroup3(!1)+"]"+a[j].getSeqcodeString()+":"+e;break;case 1087373320:a[j].getModelIndex()!=g&&(b.appendC("\n"),k=0,g=a[j].getModelIndex(),b.append("Model "+a[j].getModelNumber()),f=h=null);a[j].getChain()!==f&&(b.appendC("\n"),k=0,f=a[j].getChain(),b.append("Chain "+e+":\n"),h=null);e=a[j].getGroup();e!==h&&(0==k++%5&&1<k&&b.appendC("\n"),J.util.TextFormat.lFill(b,"          ","["+a[j].getGroup3(!1)+"]"+a[j].getResno()+" "),h=e);continue;default:return""}0>b.indexOf("\n"+
e+"\n")&&b.append(e).appendC("\n")}1087373320==c&&b.appendC("\n");return b.toString().substring(1)},$fz.isPrivate=!0,$fz),"~A,~N,J.util.BS");Clazz.overrideMethod(c$,"getModelFileInfo",function(a){for(var c=this.viewer.modelSet,d=new J.util.SB,b=0;b<c.modelCount;++b)if(null==a||a.get(b)){var e='["'+c.getModelNumberDotted(b)+'"] = ';d.append("\n\nfile").append(e).append(J.util.Escape.eS(c.getModelFileName(b)));var f=c.getModelAuxiliaryInfoValue(b,"modelID");null!=f&&d.append("\nid").append(e).append(J.util.Escape.eS(f));
d.append("\ntitle").append(e).append(J.util.Escape.eS(c.getModelTitle(b)));d.append("\nname").append(e).append(J.util.Escape.eS(c.getModelName(b)))}return d.toString()},"J.util.BS");Clazz.overrideMethod(c$,"getAllAtomInfo",function(a){for(var c=new J.util.JmolList,d=a.nextSetBit(0);0<=d;d=a.nextSetBit(d+1))c.addLast(this.getAtomInfoLong(d));return c},"J.util.BS");Clazz.overrideMethod(c$,"getAtomIdentityInfo",function(a,c){var d=this.viewer.modelSet;c.put("_ipt",Integer.$valueOf(a));c.put("atomIndex",
Integer.$valueOf(a));c.put("atomno",Integer.$valueOf(d.getAtomNumber(a)));c.put("info",d.getAtomInfo(a,null));c.put("sym",d.getElementSymbol(a))},"~N,java.util.Map");$_M(c$,"getAtomInfoLong",($fz=function(a){var c=this.viewer.modelSet,d=c.atoms[a],b=new java.util.Hashtable;this.getAtomIdentityInfo(a,b);b.put("element",c.getElementName(a));b.put("elemno",Integer.$valueOf(c.getElementNumber(a)));b.put("x",Float.$valueOf(d.x));b.put("y",Float.$valueOf(d.y));b.put("z",Float.$valueOf(d.z));b.put("coord",
J.util.P3.newP(d));null!=c.vibrationVectors&&null!=c.vibrationVectors[a]&&b.put("vibVector",J.util.V3.newV(c.vibrationVectors[a]));b.put("bondCount",Integer.$valueOf(d.getCovalentBondCount()));b.put("radius",Float.$valueOf(d.getRasMolRadius()/120));b.put("model",d.getModelNumberForLabel());b.put("shape",J.modelset.Atom.atomPropertyString(this.viewer,d,1087373323));b.put("visible",Boolean.$valueOf(d.isVisible(0)));b.put("clickabilityFlags",Integer.$valueOf(d.clickabilityFlags));b.put("visibilityFlags",
Integer.$valueOf(d.shapeVisibilityFlags));b.put("spacefill",Float.$valueOf(d.getRadius()));var e=J.util.Escape.escapeColor(this.viewer.getColorArgbOrGray(d.colixAtom));null!=e&&b.put("color",e);b.put("colix",Integer.$valueOf(d.colixAtom));(e=d.isTranslucent())&&b.put("translucent",Boolean.$valueOf(e));b.put("formalCharge",Integer.$valueOf(d.getFormalCharge()));b.put("partialCharge",Float.$valueOf(d.getPartialCharge()));e=d.getSurfaceDistance100()/100;0<=e&&b.put("surfaceDistance",Float.$valueOf(e));
if(c.models[d.modelIndex].isBioModel){b.put("resname",d.getGroup3(!1));var e=d.getSeqNumber(),f=d.getInsertionCode();0<e&&b.put("resno",Integer.$valueOf(e));0!=f.charCodeAt(0)&&b.put("insertionCode",""+f);e=d.getChainID();b.put("name",c.getAtomName(a));b.put("chain","\x00"==e?"":""+e);b.put("atomID",Integer.$valueOf(d.atomID));b.put("groupID",Integer.$valueOf(d.getGroupID()));"\x00"!=d.alternateLocationID&&b.put("altLocation",""+d.alternateLocationID);b.put("structure",Integer.$valueOf(d.getProteinStructureType().getId()));
b.put("polymerLength",Integer.$valueOf(d.getPolymerLength()));b.put("occupancy",Integer.$valueOf(d.getOccupancy100()));a=d.getBfactor100();b.put("temp",Integer.$valueOf(Clazz.doubleToInt(a/100)))}return b},$fz.isPrivate=!0,$fz),"~N");Clazz.overrideMethod(c$,"getAllBondInfo",function(a){var c=new J.util.JmolList,d=this.viewer.modelSet,b=d.bondCount;if(Clazz.instanceOf(a,J.modelset.Bond.BondSet)){for(d=a.nextSetBit(0);0<=d&&d<b;d=a.nextSetBit(d+1))c.addLast(this.getBondInfo(d));return c}for(var e=1==
a.cardinality()?a.nextSetBit(0):-1,f=d.bonds,d=0;d<b;d++)(0<=e?f[d].atom1.index==e||f[d].atom2.index==e:a.get(f[d].atom1.index)&&a.get(f[d].atom2.index))&&c.addLast(this.getBondInfo(d));return c},"J.util.BS");$_M(c$,"getBondInfo",($fz=function(a){var c=this.viewer.modelSet.bonds[a],d=c.atom1,b=c.atom2,e=new java.util.Hashtable;e.put("_bpt",Integer.$valueOf(a));a=new java.util.Hashtable;this.getAtomIdentityInfo(d.index,a);var f=new java.util.Hashtable;this.getAtomIdentityInfo(b.index,f);e.put("atom1",
a);e.put("atom2",f);e.put("order",Float.$valueOf(J.util.Parser.fVal(J.util.JmolEdge.getBondOrderNumberFromOrder(c.order))));e.put("radius",Float.$valueOf(c.mad/2E3));e.put("length_Ang",Float.$valueOf(d.distance(b)));e.put("visible",Boolean.$valueOf(0!=c.shapeVisibilityFlags));d=J.util.Escape.escapeColor(this.viewer.getColorArgbOrGray(c.colix));null!=d&&e.put("color",d);e.put("colix",Integer.$valueOf(c.colix));(c=c.isTranslucent())&&e.put("translucent",Boolean.$valueOf(c));return e},$fz.isPrivate=
!0,$fz),"~N");Clazz.overrideMethod(c$,"getAllChainInfo",function(a){for(var c=new java.util.Hashtable,d=new J.util.JmolList,b=this.viewer.modelSet.modelCount,e=0;e<b;++e){var f=new java.util.Hashtable,h=this.getChainInfo(e,a);0<h.size()&&(f.put("modelIndex",Integer.$valueOf(e)),f.put("chains",h),d.addLast(f))}c.put("models",d);return c},"J.util.BS");$_M(c$,"getChainInfo",($fz=function(a,c){for(var d=this.viewer.modelSet.models[a],b=d.getChainCount(!0),e=new J.util.JmolList,f=0;f<b;f++){for(var h=
d.getChainAt(f),g=new J.util.JmolList,k=h.getGroupCount(),j=new java.util.Hashtable,n=0;n<k;n++){var m=h.getGroup(n);c.get(m.firstAtomIndex)&&g.addLast(m.getGroupInfo(n))}g.isEmpty()||(j.put("residues",g),e.addLast(j))}return e},$fz.isPrivate=!0,$fz),"~N,J.util.BS");$_M(c$,"getAllPolymerInfo",function(a){for(var c=new java.util.Hashtable,d=new J.util.JmolList,b=this.viewer.modelSet.modelCount,e=this.viewer.modelSet.models,f=0;f<b;++f)e[f].isBioModel&&e[f].getAllPolymerInfo(a,c,d);c.put("models",d);
return c},"J.util.BS");$_M(c$,"getBasePairInfo",($fz=function(a){var c=new J.util.SB,d=new J.util.JmolList;this.viewer.modelSet.calcRasmolHydrogenBonds(a,a,d,!0,1,!1,null);for(a=d.size();0<=--a;){var b=d.get(a);J.viewer.PropertyManager.getAtomResidueInfo(c,b.atom1);c.append(" - ");J.viewer.PropertyManager.getAtomResidueInfo(c,b.atom2);c.append("\n")}return c.toString()},$fz.isPrivate=!0,$fz),"J.util.BS");c$.getAtomResidueInfo=$_M(c$,"getAtomResidueInfo",($fz=function(a,c){a.append("[").append(c.getGroup3(!1)).append("]").append(c.getSeqcodeString()).append(":");
var d=c.getChainID();a.append("\x00"==d?" ":""+d)},$fz.isPrivate=!0,$fz),"J.util.SB,J.modelset.Atom");Clazz.defineStatics(c$,"atomExpression","<atom selection>");c$.propertyTypes=c$.prototype.propertyTypes="appletInfo;;;fileName;;;fileHeader;;;fileContents;<pathname>;;fileContents;;;animationInfo;;;modelInfo;<atom selection>;{*};ligandInfo;<atom selection>;{*};shapeInfo;;;measurementInfo;;;centerInfo;;;orientationInfo;;;transformInfo;;;atomList;<atom selection>;(visible);atomInfo;<atom selection>;(visible);bondInfo;<atom selection>;(visible);chainInfo;<atom selection>;(visible);polymerInfo;<atom selection>;(visible);moleculeInfo;<atom selection>;(visible);stateInfo;<state type>;all;extractModel;<atom selection>;(visible);jmolStatus;statusNameList;;jmolViewer;;;messageQueue;;;auxiliaryInfo;<atom selection>;{*};boundBoxInfo;;;dataInfo;<data type>;types;image;;;evaluate;<expression>;;menu;<type>;current;minimizationInfo;;;pointGroupInfo;<atom selection>;(visible);fileInfo;<type>;;errorMessage;;;mouseInfo;;;isosurfaceInfo;;;isosurfaceData;;;consoleText;;;jspecView;<key>;".split(";");
Clazz.defineStatics(c$,"PROP_APPLET_INFO",0,"PROP_FILENAME",1,"PROP_FILEHEADER",2,"PROP_FILECONTENTS_PATH",3,"PROP_FILECONTENTS",4,"PROP_ANIMATION_INFO",5,"PROP_MODEL_INFO",6,"PROP_LIGAND_INFO",7,"PROP_SHAPE_INFO",8,"PROP_MEASUREMENT_INFO",9,"PROP_CENTER_INFO",10,"PROP_ORIENTATION_INFO",11,"PROP_TRANSFORM_INFO",12,"PROP_ATOM_LIST",13,"PROP_ATOM_INFO",14,"PROP_BOND_INFO",15,"PROP_CHAIN_INFO",16,"PROP_POLYMER_INFO",17,"PROP_MOLECULE_INFO",18,"PROP_STATE_INFO",19,"PROP_EXTRACT_MODEL",20,"PROP_JMOL_STATUS",
21,"PROP_JMOL_VIEWER",22,"PROP_MESSAGE_QUEUE",23,"PROP_AUXILIARY_INFO",24,"PROP_BOUNDBOX_INFO",25,"PROP_DATA_INFO",26,"PROP_IMAGE",27,"PROP_EVALUATE",28,"PROP_MENU",29,"PROP_MINIMIZATION_INFO",30,"PROP_POINTGROUP_INFO",31,"PROP_FILE_INFO",32,"PROP_ERROR_MESSAGE",33,"PROP_MOUSE_INFO",34,"PROP_ISOSURFACE_INFO",35,"PROP_ISOSURFACE_DATA",36,"PROP_CONSOLE_TEXT",37,"PROP_JSPECVIEW",38,"PROP_COUNT",39,"readableTypes"," stateinfo extractmodel filecontents fileheader image menu minimizationInfo".split(" "))});
