(function(S,T,U,V,L,W,H,p,M,N,O,X,Y,P,Z,$,I,K,z,aa,Q,ba,ca,R,da,ea,fa,ga,ha,ia,x,ja,ka,la,ma,na,oa,pa,qa,ra,sa,ta,ua,va,wa,xa,ya,za,Aa,Ba,Ca,Da,Ea,Fa,Ga,Ha,Ia,Ja,j,w){H("J.api");R(J.api,"JmolPropertyManager");H("JV");M(["J.api.JmolPropertyManager","java.util.Hashtable"],"JV.PropertyManager","java.lang.Boolean $.Double $.Float java.util.Arrays $.Date $.Map JU.AU $.BArray $.BS $.Base64 $.Lst $.M3 $.M4 $.P3 $.PT $.SB $.V3 $.XmlUtil J.api.Interface JM.BondSet $.LabelToken JS.SV $.T JU.BSUtil $.C $.Edge $.Escape $.JmolMolecule $.Logger JV.ActionManager $.FileManager $.JC $.Viewer JV.binding.Binding".split(" "),
function(){c$=O(function(){this.map=this.vwr=null;N(this,arguments)},JV,"PropertyManager",null,J.api.JmolPropertyManager);Q(c$,function(){this.map=new java.util.Hashtable});P(c$,function(){});w(c$,"setViewer",function(b){this.vwr=b;for(var c=b=0;b<JV.PropertyManager.propertyTypes.length;b+=3,c++)0<JV.PropertyManager.propertyTypes[b].length&&this.map.put(JV.PropertyManager.propertyTypes[b].toLowerCase(),Integer.$valueOf(c))},"JV.Viewer");w(c$,"getPropertyNumber",function(b){b=this.map.get(null==b?
"":b.toLowerCase());return null==b?-1:b.intValue()},"~S");w(c$,"getDefaultPropertyParam",function(b){return 0>b?"":JV.PropertyManager.propertyTypes[3*b+2]},"~N");w(c$,"checkPropertyParameter",function(b){b=this.getPropertyNumber(b);b=JV.PropertyManager.getParamType(b);return 0<b.length&&"<atom selection>"!==b},"~S");w(c$,"getProperty",function(b,c,e){141!=JV.PropertyManager.propertyTypes.length&&JU.Logger.warn("propertyTypes is not the right length: "+JV.PropertyManager.propertyTypes.length+" != 141");
if(0<=c.indexOf(".")||0<=c.indexOf("[")){var a=this.getArguments(c);e=this.extractProperty(this.getPropertyAsObject(a[0].asString(),e,null),a,1,null,!1)}else e=this.getPropertyAsObject(c,e,b);if(null==b)return e;(a=b.equalsIgnoreCase("readable"))&&(b=JV.PropertyManager.isReadableAsString(c)?"String":"JSON");return b.equalsIgnoreCase("String")?null==e?"":e.toString():a?JU.Escape.toReadable(c,e):b.equalsIgnoreCase("JSON")?JS.SV.safeJSON(c,e):e},"~S,~S,~O");j(c$,"getArguments",function(b){var c=b.toLowerCase(),
e=-1;if(0<=b.indexOf('"')||0<=b.indexOf("'"))b=this.fixSelectQuotes(b);for(;0<=(e=c.indexOf("[select ",++e));){var a=c.indexOf(" where ",e),d=c.indexOf(" wherein ",e);0<d&&d<a&&(a=d);d=c.lastIndexOf("]");0>a||a>d||(b=b.substring(0,e+1)+b.substring(e+1,d).$replace(".","\u0001").$replace("[","\u0002").$replace("]","\u0003")+b.substring(d))}b=JU.PT.rep(JU.PT.rep(b.$replace("]","\x00").$replace("[","\x00"),"..","\u0004").$replace(".","\x00").$replace("\u0001",".").$replace("\u0002","[").$replace("\u0003",
"]"),"\u0004","..");b=JU.PT.rep(b,"\x00\x00","\x00");b=JU.PT.split(JU.PT.trim(b,"\x00"),"\x00");for(var c=Array(b.length),e=0,f;e<b.length;e++)c[e]=b[e].startsWith("'")||b[e].startsWith('"')?JS.SV.newS(JU.PT.trim(b[e],"'\"")):-2147483648==(f=JU.PT.parseInt(b[e]))?JS.SV.newS(b[e]):JS.SV.newI(f);return c},"~S");j(c$,"fixSelectQuotes",function(b){b=b.toCharArray();for(var c=!1,e=!1,a=!1,d=b.length;0<=--d;)switch(b[d]){case "'":a||(c=e=!c);break;case '"':e||(c=a=!c);break;case ".":c&&(b[d]="\u0001");
break;case "[":c&&(b[d]="\u0002");break;case "]":c&&(b[d]="\u0003")}return b=String.instantialize(b)},"~S");w(c$,"extractProperty",function(b,c,e,a,d){0>e&&(c=this.getArguments(c),e=0);if(e>=c.length)return b;d||(c=this.compileSelect(c));var f,g=c[e++];d=JS.SV.oValue(b);switch(g.tok){case 2:f=g.intValue-1;if(p(d,JU.Lst))return 0>f&&(f+=d.size()),0<=f&&f<d.size()?this.extractProperty(d.get(f),c,e,null,!0):"";if(p(d,JU.M3))return a=d,a=x(-1,[z(-1,[a.m00,a.m01,a.m02]),z(-1,[a.m10,a.m11,a.m12]),z(-1,
[a.m20,a.m21,a.m22])]),0>f&&(f+=3),0<=f&&3>f?this.extractProperty(a,c,--e,null,!0):"";if(p(d,JU.M4))return a=d,a=x(-1,[z(-1,[a.m00,a.m01,a.m02,a.m03]),z(-1,[a.m10,a.m11,a.m12,a.m13]),z(-1,[a.m20,a.m21,a.m22,a.m23]),z(-1,[a.m30,a.m31,a.m32,a.m33])]),0>f&&(f+=4),0<=f&&4>f?this.extractProperty(a,c,--e,null,!0):"";if(JU.AU.isAI(d))return 0>f&&(f+=d.length),0<=f&&f<d.length?Integer.$valueOf(d[f]):"";if(JU.AU.isAD(d))return 0>f&&(f+=d.length),0<=f&&f<d.length?Double.$valueOf(d[f]):"";if(JU.AU.isAF(d))return 0>
f&&(f+=d.length),0<=f&&f<d.length?Float.$valueOf(d[f]):"";if(JU.AU.isAII(d)||JU.AU.isAFF(d))return 0>f&&(f+=d.length),0<=f&&f<d.length?this.extractProperty(d[f],c,e,null,!0):"";if(JU.AU.isAS(d)||p(d,Array))return 0>f&&(f+=d.length),0<=f&&f<d.length?d[f]:"";break;case 1275082245:case 4:if(p(d,java.util.Map)){var h=!1,n=b=!1;f=1275082245==g.tok?g.value[0]:null;var m=null;if(1275082245==g.tok)if(n=!0,m=g.value[1],g=g.myName,b=0<=g.indexOf(";"),g.contains("**")){for(var l=0==f.size(),k="",u,s=d.entrySet().iterator();s.hasNext()&&
((u=s.next())||1);)for(var y=u.getKey(),g=l?1:f.size();0<=--g;)if(l||JU.PT.isLike(y,f.get(g))){var h=u.getValue(),t=!1;switch(p(h,JS.SV)?h.tok:0){case 7:t=!0;h=h.getList();break;case 6:case 14:h=h.getMap();break;default:if(!p(h,java.util.Map)&&!(t=p(h,JU.Lst)))h=null}if(null!=h){if(t){null==a&&(a=new JU.Lst);c=h;e=c.size();for(d=0;d<e;d++)if(h=c.get(d),p(h,JS.SV)&&null!=(h=h.getMap()))(null==m||this.vwr.checkSelect(h,m))&&a.addLast(h);return a}if(null==m||this.vwr.checkSelect(h,m))k+=","+y}}if(0==
k.length)return new JU.Lst;g=k.substring(1);h=!b;f=null}else{if(null!=m&&!this.vwr.checkSelect(d,m))return""}else if(g=g.asString(),g.equalsIgnoreCase("keys")){a=new JU.Lst;for(d=d.keySet().iterator();d.hasNext()&&((y=d.next())||1);)a.addLast(y);return this.extractProperty(a,c,e,null,!0)}m=b||0<=g.indexOf(",")||0<=g.indexOf(";");n&&!m&&(m=!0,g+=",");u=b||g.startsWith("*")||g.endsWith("*")||m;y=null!=a;if(u&&(y||(a=new JU.Lst),!b&&(null==f?1==g.length:0==f.size()))){if(e==c.length){if(!y)return d;
a.addLast(d);return a}return this.extractProperty(d,c,e,a,!0)}g.contains("**")&&(g=JU.PT.rep(g,"**","*"));u&&!m&&(g+=",");if(h||b||g.contains(",")){n=new java.util.Hashtable;null!=f&&0==f.size()&&(f=null,g="*");if(null==f){f=JU.PT.split(g,",");for(g=f.length;0<=--g;)JV.PropertyManager.getMapSubset(d,f[g],n,b?a:null)}else for(g=f.size();0<=--g;)JV.PropertyManager.getMapSubset(d,f.get(g),n,b?a:null);if(h&&!y)return n;if(e==c.length){if(!b){if(!y)return n;a.addLast(n)}return a}return this.extractProperty(n,
c,e,y?a:null,!0)}g=this.checkMap(d,g,u,a,c,e,n);return null!=g&&!u?this.extractProperty(d.get(g),c,e,null,!0):!u?"":a}if(p(d,JU.Lst)){null==a&&(a=new JU.Lst);e--;for(f=0;f<d.size();f++)h=d.get(f),(p(h,java.util.Map)||p(h,JU.Lst)||p(h,JS.SV)&&(null!=h.getMap()||null!=h.getList()))&&this.extractProperty(h,c,e,a,!0);return a}}return b},"~O,~O,~N,JU.Lst,~B");c$.getMapSubset=j(c$,"getMapSubset",function(b,c,e,a){if(c.startsWith('"')||c.startsWith("'"))c=JU.PT.trim(c,"\"'");var d=b.get(c);if(null!=d)null==
a?e.put(c,d):a.addLast(d);else{var f;for(b=b.entrySet().iterator();b.hasNext()&&((f=b.next())||1);)d=f.getKey(),JU.PT.isLike(d,c)&&(null==a?e.put(d,f.getValue()):a.addLast(f.getValue()))}},"java.util.Map,~S,java.util.Map,JU.Lst");j(c$,"compileSelect",function(b){for(var c=null,e=b.length;0<=--e;)if(4==b[e].tok){var a=b[e].value,d=a.toUpperCase();d.startsWith("WHERE")&&(d=(a="SELECT * "+a).toUpperCase());if(d.startsWith("SELECT ")){null==c&&(c=JU.AU.arrayCopyObject(b,b.length));d=(a=a.substring(6).trim()).toUpperCase();
if(d.startsWith("WHERE ")||d.startsWith("WHEREIN "))d=(a="* "+a).toUpperCase();var f=d.indexOf(" WHEREIN "),g=0>f?"":0<=a.indexOf(";")?";**":",**";0>f&&(f=d.indexOf(" WHERE "));d=a.substring(0,0>f?a.length:f).trim();d.startsWith("(")&&d.endsWith(")")&&(d=d.substring(1,d.length-1)+";");0>f?c[e]=JS.SV.newV(1275082245,x(-1,[this.getKeys(d),null])):(d+=g,c[e]=JS.SV.newV(1275082245,x(-1,[this.getKeys(d),this.vwr.compileExpr(a.substring(f+6+g.length).trim())])));c[e].myName=d}}return null==c?b:c},"~A");
j(c$,"getKeys",function(b){var c=new JU.Lst;b=JU.PT.rep(JU.PT.rep(b,"**","*"),";",",")+",";for(var e=0,a=-1;0<=(a=b.indexOf(",",a+1));)if(a>e){var d=b.substring(e,a);if(d.equals("*")){if(0==c.size())break}else c.addLast(d),e=a+1}return c},"~S");j(c$,"checkMap",function(b,c,e,a,d,f,g){var h=null==a&&b.containsKey(c);if(!h)for(var n=c.contains(";"),m=n?JU.PT.split(c,";"):null,l=e&&!g?c.toLowerCase():null,k,u=b.keySet().iterator();u.hasNext()&&((k=u.next())||1);){if(n){for(var s=m.length;0<=--s;c=null)if(c=
m[s],0!=c.length){if(g){if(!JU.PT.isLike(k,c))continue;break}l=0<=c.indexOf("*")?c.toLowerCase():null;if(this.checkKey(k,c,l))break}if(null==c)continue}else if(g?!JU.PT.isLike(k,c):!this.checkKey(k,c,l))continue;if(null==a)return k;a.addLast(this.extractProperty(b.get(k),d,f,null,!0));if(!e&&!n)return null}return h?c:null},"java.util.Map,~S,~B,JU.Lst,~O,~N,~B");j(c$,"checkKey",function(b,c,e){return b.equalsIgnoreCase(c)||null!=e&&JU.PT.isLike(b.toLowerCase(),e)},"~S,~S,~S");c$.getPropertyName=j(c$,
"getPropertyName",function(b){return 0>b?"":JV.PropertyManager.propertyTypes[3*b]},"~N");c$.getParamType=j(c$,"getParamType",function(b){return 0>b?"":JV.PropertyManager.propertyTypes[3*b+1]},"~N");c$.isReadableAsString=j(c$,"isReadableAsString",function(b){for(var c=JV.PropertyManager.readableTypes.length;0<=--c;)if(b.equalsIgnoreCase(JV.PropertyManager.readableTypes[c]))return!0;return!1},"~S");j(c$,"getPropertyAsObject",function(b,c,e){if(b.equals("tokenList"))return JS.T.getTokensLike(c);var a=
null,d=b.indexOf("#");0<d&&(a=x(-1,[b.substring(d+1),c]),b=b.substring(0,d));var d=this.getPropertyNumber(b),f=null!=a||null!=c&&""!==c;null==a&&(a=f?c:this.getDefaultPropertyParam(d));switch(d){case 46:return this.vwr.getModelkitProperty(a);case 0:return this.getAppletInfo();case 5:return this.getAnimationInfo();case 14:return this.getAllAtomInfo(this.vwr.getAtomBitSet(a));case 24:return this.vwr.getAuxiliaryInfoForAtoms(a);case 15:return this.getAllBondInfo(a);case 25:return this.getBoundBoxInfo();
case 10:return this.vwr.tm.fixedRotationCenter;case 16:return this.getAllChainInfo(this.vwr.getAtomBitSet(a));case 37:return this.vwr.getProperty("DATA_API","consoleText",null);case 26:return this.vwr.getDataObj(a.toString(),null,-1);case 33:return this.vwr.getErrorMessageUn();case 28:return this.vwr.evaluateExpression(a.toString());case 20:return this.vwr.getModelExtract(a,!0,!1,"MOL");case 32:return JV.PropertyManager.getFileInfo(this.vwr.getFileData(),a.toString());case 45:return this.vwr.readCifData(a.toString(),
null);case 1:return this.vwr.fm.getFullPathName(!1);case 2:return this.vwr.getFileHeader();case 4:case 3:return f?this.vwr.getFileAsString3(a.toString(),!0,null):this.vwr.getCurrentFileAsString("prop");case 27:return b=a.toString().toLowerCase(),this.getImage(b,0>b.indexOf("g64")&&0>b.indexOf("base64")&&(null==e||e.equalsIgnoreCase("java")));case 35:return this.vwr.getShapeProperty(24,"info");case 36:return this.vwr.getShapeProperty(24,"data");case 40:return this.vwr.getNMRCalculation().getInfo(a.toString());
case 41:return this.getVariables(a.toString());case 21:return this.vwr.getStatusChanged(a.toString());case 22:return this.vwr;case 38:return this.vwr.getJspecViewProperties(a);case 7:return this.getLigandInfo(this.vwr.getAtomBitSet(a));case 9:return this.getMeasurementInfo();case 29:return this.vwr.getMenu(a.toString());case 23:return this.vwr.sm.messageQueue;case 30:return this.vwr.getMinimizationInfo();case 6:return this.getModelInfo(this.vwr.getAtomBitSet(a));case 18:return this.getMoleculeInfo(this.vwr.getAtomBitSet(a));
case 34:return this.getMouseInfo();case 11:return this.vwr.tm.getOrientationInfo();case 31:return this.vwr.ms.getPointGroupInfo(this.vwr.getAtomBitSet(a));case 17:return this.getAllPolymerInfo(this.vwr.getAtomBitSet(a));case 39:return this.vwr.getScriptQueueInfo();case 8:return this.getShapeInfo();case 19:return this.vwr.getStateInfo3(a.toString(),0,0);case 12:return JU.M3.newM3(this.vwr.tm.matrixRotate);case 42:return this.getAnnotationInfo(a,1073741925);case 43:return this.getAnnotationInfo(a,1073742189);
case 44:return a=JS.SV.oValue(a),a=p(a,java.util.Map)?a:null,null==a?null:this.vwr.sm.processService(a)}e=Array(47);for(c=0;47>c;c++)a=JV.PropertyManager.getParamType(c),d=this.getDefaultPropertyParam(c),f=JV.PropertyManager.getPropertyName(c),e[c]=0==f.length||"X"==f.charAt(0)?"":f+(""!==a?" "+JV.PropertyManager.getParamType(c)+(""!==d?" #default: "+this.getDefaultPropertyParam(c):""):"");java.util.Arrays.sort(e);a=new JU.SB;a.append("getProperty ERROR\n").append(b).append("?\nOptions include:\n");
for(c=0;47>c;c++)0<e[c].length&&a.append("\n getProperty ").append(e[c]);return a.toString()},"~S,~O,~S");j(c$,"getImage",function(b,c){var e=-1,a=-1,d;if(0<=(d=b.indexOf("height=")))e=JU.PT.parseInt(b.substring(d+7));if(0<=(d=b.indexOf("width=")))a=JU.PT.parseInt(b.substring(d+6));0>a&&0>e?e=a=-1:0>a?a=e:e=a;var f="JPG";0<=b.indexOf("type=")&&(f=JU.PT.getTokens(JU.PT.replaceWithCharacter(b.substring(b.indexOf("type=")+5),";,"," "))[0]);d=Array(1);e=this.vwr.getImageAsBytes(f.toUpperCase(),a,e,-1,
d);return null!=d[0]?d[0]:c?new JU.BArray(e):JU.Base64.getBase64(e).toString()},"~S,~B");j(c$,"getVariables",function(b){return b.toLowerCase().equals("all")?this.vwr.g.getAllVariables():this.vwr.evaluateExpressionAsVariable(b)},"~S");c$.getFileInfo=j(c$,"getFileInfo",function(b,c){var e=new java.util.Hashtable;if(null==b)return e;var a=null!=c&&0<c.length;if(p(b,java.util.Map))return a?b.get(c):b;var d=JU.PT.split(b,"\n");if(0==d.length||7>d[0].length||" "!=d[0].charAt(6)||!d[0].substring(0,6).equals(d[0].substring(0,
6).toUpperCase()))return e.put("fileHeader",b),e;var f="",g=new JU.SB;a&&(c=c.toUpperCase());for(var h="",n=0;n<d.length;n++){var m=d[n];if(!(12>m.length)){var h=m.substring(0,6).trim(),l=m.substring(7,10).trim();h.equals("REMARK")&&(h+=l);if(!h.equals(f)){if(a&&f.equals(c))return g.toString();a||(e.put(f,g.toString()),g=new JU.SB);f=h}(!a||h.equals(c))&&g.append(m).appendC("\n")}}a||e.put(f,g.toString());return a?h.equals(c)?g.toString():"":e},"~O,~S");j(c$,"getMoleculeInfo",function(b){b=this.vwr.getAtomBitSet(b);
for(var c=this.vwr.ms.getMolecules(),e=new JU.Lst,a=new JU.BS,d=0;d<c.length;d++){var a=JU.BSUtil.copy(b),f=c[d];a.and(f.atomList);0<a.length()&&(a=new java.util.Hashtable,a.put("mf",f.getMolecularFormula(!0,null,!1)),a.put("number",Integer.$valueOf(f.moleculeIndex+1)),a.put("modelNumber",this.vwr.ms.getModelNumberDotted(f.modelIndex)),a.put("numberInModel",Integer.$valueOf(f.indexInModel+1)),a.put("nAtoms",Integer.$valueOf(f.ac)),a.put("nElements",Integer.$valueOf(f.nElements)),e.addLast(a))}return e},
"~O");w(c$,"getModelInfo",function(b){b=this.vwr.ms.getModelBS(this.vwr.getAtomBitSet(b),!1);var c=this.vwr.ms,e=new java.util.Hashtable;e.put("modelSetName",c.modelSetName);e.put("modelIndex",Integer.$valueOf(this.vwr.am.cmi));e.put("modelCount",Integer.$valueOf(c.mc));e.put("isTainted",Boolean.$valueOf(null!=c.tainted));e.put("canSkipLoad",Boolean.$valueOf(c.canSkipLoad));e.put("modelSetHasVibrationVectors",Boolean.$valueOf(c.modelSetHasVibrationVectors()));null!=c.modelSetProperties&&e.put("modelSetProperties",
c.modelSetProperties);e.put("modelCountSelected",Integer.$valueOf(b.cardinality()));e.put("modelsSelected",b);var a=new JU.Lst;c.getMolecules();for(var d=b.nextSetBit(0);0<=d;d=b.nextSetBit(d+1)){var f=new java.util.Hashtable;f.put("_ipt",Integer.$valueOf(d));f.put("num",Integer.$valueOf(c.getModelNumber(d)));f.put("file_model",c.getModelNumberDotted(d));f.put("name",c.getModelName(d));var g=c.getModelTitle(d);null!=g&&f.put("title",g);g=c.getModelFileName(d);null!=g&&f.put("file",g);g=c.getInfo(d,
"modelID");null!=g&&f.put("id",g);f.put("vibrationVectors",Boolean.$valueOf(this.vwr.modelHasVibrationVectors(d)));g=c.am[d];f.put("atomCount",Integer.$valueOf(g.act));f.put("bondCount",Integer.$valueOf(g.getBondCount()));f.put("groupCount",Integer.$valueOf(g.getGroupCount()));f.put("moleculeCount",Integer.$valueOf(g.moleculeCount));g.isBioModel&&f.put("polymerCount",Integer.$valueOf(g.getBioPolymerCount()));f.put("chainCount",Integer.$valueOf(c.getChainCountInModelWater(d,!0)));null!=g.properties&&
f.put("modelProperties",g.properties);var h=c.getInfo(d,"Energy");null!=h&&f.put("energy",h);f.put("atomCount",Integer.$valueOf(g.act));a.addLast(f)}e.put("models",a);return e},"~O");w(c$,"getLigandInfo",function(b){var c=this.vwr.getAtomBitSet(b),e=this.vwr.getAtomBitSet("solvent");b=new java.util.Hashtable;var a=new JU.Lst;b.put("ligands",a);var d=this.vwr.ms,f=JU.BSUtil.copyInvert(c,d.ac);f.or(e);for(var e=d.at,g=c.nextSetBit(0);0<=g;g=c.nextSetBit(g+1))(e[g].group.isProtein()||e[g].group.isDna()||
e[g].group.isRna())&&e[g].group.setAtomBitsAndClear(f,c);c=Array(d.mc);for(g=d.mc;0<=--g;)c[g]=this.vwr.getModelUndeletedAtomsBitSet(g),c[g].andNot(f);f=JU.JmolMolecule.getMolecules(e,c,null,f);for(g=0;g<f.length;g++){var c=f[g].atomList,h=new java.util.Hashtable;a.addLast(h);h.put("atoms",JU.Escape.eBS(c));for(var n="",m="",l=null,k=0,u=null,s="",y="",t=2147483647,r=2147483647,j=c.nextSetBit(0);0<=j;j=c.nextSetBit(j+1)){var q=e[j];if(l!==q.group){var l=q.group,v=q.getResno(),p=q.getChainID();t!=
v-1&&(0!=s.length&&t!=r&&(s+="-"+t),p=-1,r=v);y="/"+d.getModelNumberDotted(q.mi);0!=k&&p!=k&&(s+=":"+u+y);-1==p&&(s+=" "+v);t=v;k=q.getChainID();u=q.getChainIDStr();n+=m+q.getGroup3(!1);m="-"}}s+=(r==t?"":"-"+t)+(0==k?"":":"+u)+y;h.put("groupNames",n);h.put("residueList",s.substring(1))}return b},"~O");w(c$,"getAtomData",function(b,c,e){b.startsWith("{")||(b="{"+b+"}");var a=c.toLowerCase().startsWith("user:"),d=c.toLowerCase().startsWith("property_");e&&(!a&&!d)&&(c=c.toUpperCase());a=d?"%{"+c+"}":
a?c.substring(5):c.equals("xyzrn")?"%-2e %8.3x %8.3y %8.3z %4.2[vdw] 1 [%n]%r.%a#%i":c.equals("xyzvib")?"%-2e %10.5x %10.5y %10.5z %10.5vx %10.5vy %10.5vz":c.equals("pdb")?'{selected and not hetero}.label("ATOM  %5i %-4a%1A%3.3n %1c%4R%1E   %8.3x%8.3y%8.3z%6.2Q%6.2b          %2e  ").lines+{selected and hetero}.label("HETATM%5i %-4a%1A%3.3n %1c%4R%1E   %8.3x%8.3y%8.3z%6.2Q%6.2b          %2e  ").lines':c.equals("xyz")?"%-2e %10.5x %10.5y %10.5z":c.equals("cfi")?"print '$CFI from Jmol"+JV.Viewer.getJmolVersion()+
"\n'+{selected}.count + ' ' + {selected}.bonds.count + '\n'   + {selected}.format('%10.0[atomno] %10.0[elemno] %10.4[xyz]')  + {selected}.bonds.format('%i1 %i2') + '\n' + {selected}.bonds.format('%ORDER')":null;if(null==a)return this.getModelExtract(this.vwr.getAtomBitSet(b),!1,!1,c.toUpperCase(),e);if(a.startsWith("print"))return b.equals("selected")||(a=JU.PT.rep(a,"selected",b.substring(1,b.length-1))),this.vwr.runScriptCautiously(a);0>a.indexOf("label")?a=b+'.label("'+a+'").lines':b.equals("selected")||
(a=JU.PT.rep(a,"selected",b.substring(1,b.length-1)));return this.vwr.evaluateExpression(a)},"~S,~S,~B");w(c$,"getModelExtract",function(b,c,e,a,d){if(a.equalsIgnoreCase("CIF"))return this.getModelCif(b);if(a.equalsIgnoreCase("QCJSON"))return this.getQCJSON(b);if(a.equalsIgnoreCase("CML"))return this.getModelCml(b,2147483647,!0,c,d);if(a.equals("PDB")||a.equals("PQR"))return this.getPdbAtomData(b,null,a.equals("PQR"),c,d);var f=a.equalsIgnoreCase("V3000"),g=a.equalsIgnoreCase("SDF"),h=a.equalsIgnoreCase("MOL"),
n=!c&&a.equalsIgnoreCase("XYZVIB"),m=a.equalsIgnoreCase("XYZRN"),l=a.toUpperCase().startsWith("XYZ"),k=a.equalsIgnoreCase("JSON")||a.equalsIgnoreCase("CD");a=new JU.SB;var u=this.vwr.ms,s=JU.BSUtil.copy(b),j=this.vwr.ms.getModelBS(s,!0);if(!l&&!k){var t=this.vwr.ms.getFrameTitle(j.nextSetBit(0)),t=null!=t?t.$replace("\n"," "):e?"Jmol Model Kit":JV.FileManager.fixDOSName(this.vwr.fm.getFullPathName(!1));80<t.length&&(t=t.substring(0,77)+"...");a.append(t);e=JV.Viewer.getJmolVersion();a.append("\n__Jmol-").append(e.substring(0,
2));var r,p,q;q=new Date;e=q.getMonth();t=q.getDate();r=q.getFullYear();p=q.getHours();q=q.getMinutes();JU.PT.rightJustify(a,"_00",""+(1+e));JU.PT.rightJustify(a,"00",""+t);a.append((""+r).substring(2,4));JU.PT.rightJustify(a,"00",""+p);JU.PT.rightJustify(a,"00",""+q);a.append("3D 1   1.00000     0.00000     0");a.append("\nJmol version ").append(JV.Viewer.getJmolVersion()).append(" EXTRACT: ").append(JU.Escape.eBS(b)).append("\n")}t=u.at;for(e=b.nextSetBit(0);0<=e;e=b.nextSetBit(e+1))c&&t[e].isDeleted()&&
s.clear(e);r=JV.PropertyManager.getCovalentBondsForAtoms(u.bo,u.bondCount,s);if(!n&&s.isEmpty())return"";b=!0;null!=u.trajectory&&!d&&u.trajectory.selectDisplayed(j);c=c?this.vwr.tm.getRotationQ():null;if(l){h=JM.LabelToken.compile(this.vwr,m?"%-2e _XYZ_ %4.2[vdw] 1 [%n]%r.%a#%i\n":"%-2e _XYZ_\n","\x00",null);g=n?JM.LabelToken.compile(this.vwr,"%-2e _XYZ_ %12.5vx %12.5vy %12.5vz\n","\x00",null):null;m=new JU.P3;for(e=j.nextSetBit(0);0<=e;e=j.nextSetBit(e+1))if(f=JU.BSUtil.copy(s),f.and(u.getModelAtomBitSetIncludingDeleted(e,
!1)),!f.isEmpty()){a.appendI(f.cardinality()).appendC("\n");l=u.am[e].properties;a.append("Model["+(e+1)+"]: ");if(null!=u.frameTitles[e]&&0<u.frameTitles[e].length)a.append(u.frameTitles[e].$replace("\n"," "));else if(null==l)a.append("Jmol "+JV.Viewer.getJmolVersion());else{k=new JU.SB;d=l.propertyNames();for(r=null;d.hasMoreElements();)p=d.nextElement(),p.equals(".PATH")?r=l.getProperty(p):k.append(";").append(p).append("=").append(l.getProperty(p));null!=r&&k.append(";PATH=").append(r);r=k.substring(0<
k.length()?1:0);a.append(r.$replace("\n"," "))}a.appendC("\n");l=x(-1,[m]);for(k=f.nextSetBit(0);0<=k;k=f.nextSetBit(k+1))d=JM.LabelToken.formatLabelAtomArray(this.vwr,t[k],n&&null!=u.getVibration(k,!1)?g:h,"\x00",null,m),JV.PropertyManager.getPointTransf(e,u,t[k],c,m),d=JU.PT.rep(d,"_XYZ_",JU.PT.sprintf("%12.5p %12.5p %12.5p","p",l)),a.append(d)}}else if(n=J.api.Interface.getInterface("JU.MolWriter",this.vwr,"write").setViewer(this.vwr),g){t=a.toString();a=new JU.SB;for(e=j.nextSetBit(0);0<=e&&!(a.append(t),
f=JU.BSUtil.copy(s),f.and(u.getModelAtomBitSetIncludingDeleted(e,!1)),r=JV.PropertyManager.getCovalentBondsForAtoms(u.bo,u.bondCount,f),!(b=n.addMolFile(e,a,f,r,!1,!1,h,c)));e=j.nextSetBit(e+1));}else b=n.addMolFile(-1,a,s,r,f,k,h,c);return b?a.toString():"ERROR: Too many atoms or bonds -- use V3000 format."},"JU.BS,~B,~B,~S,~B");j(c$,"getQCJSON",function(){var b=J.api.Interface.getInterface("J.adapter.writers.QCJSONWriter",this.vwr,"script");b.set(this.vwr,null);b.writeJSON();return b.toString()},
"JU.BS");j(c$,"getModelCif",function(b){var c=new JU.SB;c.append("# primitive CIF file created by Jmol "+JV.Viewer.getJmolVersion()+"\ndata_primitive");var e=this.vwr.ms.getUnitCellForAtom(b.nextSetBit(0)),a=null==e?z(-1,[1,1,1,90,90,90]):e.getUnitCellAsArray(!1);c.append("\n_cell_length_a ").appendF(a[0]);c.append("\n_cell_length_b ").appendF(a[1]);c.append("\n_cell_length_c ").appendF(a[2]);c.append("\n_cell_angle_alpha ").appendF(a[3]);c.append("\n_cell_angle_beta ").appendF(a[4]);c.append("\n_cell_angle_gamma ").appendF(a[5]);
c.append("\n\n_symmetry_space_group_name_H-M 'P 1'\nloop_\n_space_group_symop_operation_xyz\n'x,y,z'");c.append("\n\nloop_\n_atom_site_label\n_atom_site_fract_x\n_atom_site_fract_y\n_atom_site_fract_z\n");for(var a=this.vwr.ms.at,d=new JU.P3,f=b.nextSetBit(0);0<=f;f=b.nextSetBit(f+1)){var g=a[f];d.setT(g);null!=e&&e.toFractional(d,!1);c.append(g.getElementSymbol()).append("\t").append(JU.PT.formatF(d.x,10,5,!0,!1)).append("\t").append(JU.PT.formatF(d.y,10,5,!0,!1)).append("\t").append(JU.PT.formatF(d.z,
10,5,!0,!1)).append("\n")}return c.toString()},"JU.BS");c$.getCovalentBondsForAtoms=j(c$,"getCovalentBondsForAtoms",function(b,c,e){for(var a=new JU.BS,d=0;d<c;d++){var f=b[d];e.get(f.atom1.i)&&(e.get(f.atom2.i)&&f.isCovalent())&&a.set(d)}return a},"~A,~N,JU.BS");c$.getPointTransf=j(c$,"getPointTransf",function(b,c,e,a,d){c.isTrajectory(0<=b?b:e.mi)?c.trajectory.getFractional(e,d):d.setT(e);null!=a&&a.transform2(d,d)},"~N,JM.ModelSet,JM.Atom,JU.Quat,JU.P3");w(c$,"getChimeInfo",function(b,c){switch(b){case 1073741982:break;
case 1073741863:return this.getBasePairInfo(c);default:return this.getChimeInfoA(this.vwr.ms.at,b,c)}var e=new JU.SB;this.vwr.getChimeMessenger().getAllChimeInfo(e);return e.appendC("\n").toString().substring(1)},"~N,JU.BS");j(c$,"getChimeInfoA",function(b,c,e){var a=new JU.SB;a.append("\n");var d="",f=null,g=null,h=-1,n=0;if(null!=e)for(var m=e.nextSetBit(0);0<=m;m=e.nextSetBit(m+1)){var l=b[m];switch(c){default:return"";case 1113589787:d=l.getInfo();break;case 1140850689:d=""+l.getAtomNumber();
break;case 1086324742:d=l.getGroup3(!1);break;case 1086326788:case 1073742120:case 1086324744:case 1086324743:var k=l.getChainID(),d=0==k?" ":l.getChainIDStr();300<=k&&(d=JU.PT.esc(d));switch(c){case 1073742120:d="["+l.getGroup3(!1)+"]"+l.group.getSeqcodeString()+":"+d;break;case 1086324744:case 1086324743:l.mi!=h&&(a.appendC("\n"),n=0,h=l.mi,a.append("Model "+l.getModelNumber()),f=g=null);l.group.chain!==f&&(a.appendC("\n"),n=0,f=l.group.chain,a.append("Chain "+d+":\n"),g=null);d=l.group;d!==g&&
(g=d,1086324743==c?a.append(l.getGroup1("?")):(0==n++%5&&1<n&&a.appendC("\n"),JU.PT.leftJustify(a,"          ","["+l.getGroup3(!1)+"]"+l.getResno()+" ")));continue}}0>a.indexOf("\n"+d+"\n")&&a.append(d).appendC("\n")}1086324744==c&&a.appendC("\n");return a.toString().substring(1)},"~A,~N,JU.BS");w(c$,"getModelFileInfo",function(b){for(var c=this.vwr.ms,e=new JU.SB,a=0;a<c.mc;++a)if(null==b||b.get(a)){var d='["'+c.getModelNumberDotted(a)+'"] = ';e.append("\n\nfile").append(d).append(JU.PT.esc(c.getModelFileName(a)));
var f=c.getInfo(a,"modelID");null!=f&&e.append("\nid").append(d).append(JU.PT.esc(f));e.append("\ntitle").append(d).append(JU.PT.esc(c.getModelTitle(a)));e.append("\nname").append(d).append(JU.PT.esc(c.getModelName(a)));e.append("\ntype").append(d).append(JU.PT.esc(c.getModelFileType(a)))}return e.toString()},"JU.BS");j(c$,"getAllAtomInfo",function(b){for(var c=new JU.Lst,e=new JU.P3,a=b.nextSetBit(0);0<=a;a=b.nextSetBit(a+1))c.addLast(this.getAtomInfoLong(a,e));return c},"JU.BS");j(c$,"getAtomInfoLong",
function(b,c){var e=this.vwr.ms,a=e.at[b],d=new java.util.Hashtable;e.getAtomIdentityInfo(b,d,c);d.put("element",e.getElementName(b));d.put("elemno",Integer.$valueOf(e.at[b].getElementNumber()));d.put("x",Float.$valueOf(a.x));d.put("y",Float.$valueOf(a.y));d.put("z",Float.$valueOf(a.z));d.put("coord",JU.P3.newP(a));null!=e.vibrations&&null!=e.vibrations[b]&&e.vibrations[b].getInfo(d);d.put("bondCount",Integer.$valueOf(a.getCovalentBondCount()));d.put("radius",Float.$valueOf(a.getRasMolRadius()/120));
d.put("model",a.getModelNumberForLabel());var f=a.atomPropertyString(this.vwr,1086324748);null!=f&&d.put("shape",f);d.put("visible",Boolean.$valueOf(a.checkVisible()));d.put("clickabilityFlags",Integer.$valueOf(a.clickabilityFlags));d.put("visibilityFlags",Integer.$valueOf(a.shapeVisibilityFlags));d.put("spacefill",Float.$valueOf(a.getRadius()));f=JU.Escape.escapeColor(this.vwr.gdata.getColorArgbOrGray(a.colixAtom));null!=f&&d.put("color",f);d.put("colix",Integer.$valueOf(a.colixAtom));(f=JU.C.isColixTranslucent(a.colixAtom))&&
d.put("translucent",Boolean.$valueOf(f));d.put("formalCharge",Integer.$valueOf(a.getFormalCharge()));d.put("partialCharge",Float.$valueOf(a.getPartialCharge()));f=a.getSurfaceDistance100()/100;0<=f&&d.put("surfaceDistance",Float.$valueOf(f));if(e.am[a.mi].isBioModel){d.put("resname",a.getGroup3(!1));var f=a.group.getInsertionCode(),g=a.getResno();0<g&&d.put("resno",Integer.$valueOf(g));0!=f.charCodeAt(0)&&d.put("insertionCode",""+f);d.put("name",e.at[b].getAtomName());d.put("chain",a.getChainIDStr());
d.put("atomID",Integer.$valueOf(a.atomID));d.put("groupID",Integer.$valueOf(a.group.groupID));"\x00"!=a.altloc&&d.put("altLocation",""+a.altloc);d.put("structure",Integer.$valueOf(a.group.getProteinStructureType().getId()));d.put("polymerLength",Integer.$valueOf(a.group.getBioPolymerLength()));d.put("occupancy",Integer.$valueOf(a.getOccupancy100()));e=a.getBfactor100();d.put("temp",Integer.$valueOf(L(e/100)))}return d},"~N,JU.P3");j(c$,"getAllBondInfo",function(b){var c=new JU.Lst,e=this.vwr.ms,a=
e.bondCount,e=e.bo,d;p(b,String)&&(b=this.vwr.getAtomBitSet(b));var f=new JU.P3;if(p(b,Array)){d=b[0];var g=b[1];for(b=0;b<a;b++){var h=e[b].atom1.i,n=e[b].atom2.i;(d.get(h)&&g.get(n)||g.get(h)&&d.get(n))&&c.addLast(this.getBondInfo(b,f))}}else if(p(b,JM.BondSet)){d=b;for(b=d.nextSetBit(0);0<=b&&b<a;b=d.nextSetBit(b+1))c.addLast(this.getBondInfo(b,f))}else if(p(b,JU.BS)){d=b;g=1==d.cardinality()?d.nextSetBit(0):-1;for(b=0;b<a;b++)(0<=g?e[b].atom1.i==g||e[b].atom2.i==g:d.get(e[b].atom1.i)&&d.get(e[b].atom2.i))&&
c.addLast(this.getBondInfo(b,f))}return c},"~O");j(c$,"getBondInfo",function(b,c){var e=this.vwr.ms.bo[b],a=e.atom1,d=e.atom2,f=new java.util.Hashtable;f.put("_bpt",Integer.$valueOf(b));var g=new java.util.Hashtable;this.vwr.ms.getAtomIdentityInfo(a.i,g,c);var h=new java.util.Hashtable;this.vwr.ms.getAtomIdentityInfo(d.i,h,c);f.put("atom1",g);f.put("atom2",h);f.put("jmol_order","0x"+Integer.toHexString(e.order));f.put("order",Float.$valueOf(JU.Edge.getBondOrderNumberFromOrder(e.order)));f.put("type",
JU.Edge.getBondOrderNameFromOrder(e.order));f.put("radius",Float.$valueOf(e.mad/2E3));f.put("length_Ang",Float.$valueOf(a.distance(d)));f.put("visible",Boolean.$valueOf(0!=e.shapeVisibilityFlags));a=JU.Escape.escapeColor(this.vwr.gdata.getColorArgbOrGray(e.colix));null!=a&&f.put("color",a);f.put("colix",Integer.$valueOf(e.colix));JU.C.isColixTranslucent(e.colix)&&f.put("translucent",Boolean.TRUE);return f},"~N,JU.P3");j(c$,"getAllChainInfo",function(b){for(var c=new java.util.Hashtable,e=new JU.Lst,
a=this.vwr.ms.mc,d=0;d<a;++d){var f=new java.util.Hashtable,g=this.getChainInfo(d,b);0<g.size()&&(f.put("modelIndex",Integer.$valueOf(d)),f.put("chains",g),e.addLast(f))}c.put("models",e);return c},"JU.BS");j(c$,"getChainInfo",function(b,c){for(var e=this.vwr.ms.am[b],a=e.getChainCount(!0),d=new JU.Lst,f=new JU.P3,g=0;g<a;g++){for(var h=e.getChainAt(g),n=new JU.Lst,m=h.groupCount,l=new java.util.Hashtable,k=0;k<m;k++){var j=h.groups[k];c.get(j.firstAtomIndex)&&n.addLast(j.getGroupInfo(k,f))}n.isEmpty()||
(l.put("residues",n),d.addLast(l))}return d},"~N,JU.BS");j(c$,"getAllPolymerInfo",function(b){var c=new java.util.Hashtable;null!=this.vwr.ms.bioModelset&&this.vwr.ms.bioModelset.getAllPolymerInfo(b,c);return c},"JU.BS");j(c$,"getBasePairInfo",function(b){var c=new JU.SB,e=new JU.Lst;this.vwr.ms.calcRasmolHydrogenBonds(b,b,e,!0,1,!1,null);for(b=e.size();0<=--b;){var a=e.get(b);JV.PropertyManager.getAtomResidueInfo(c,a.atom1);c.append(" - ");JV.PropertyManager.getAtomResidueInfo(c,a.atom2);c.append("\n")}return c.toString()},
"JU.BS");c$.getAtomResidueInfo=j(c$,"getAtomResidueInfo",function(b,c){b.append("[").append(c.getGroup3(!1)).append("]").append(c.group.getSeqcodeString()).append(":");var e=c.getChainID();b.append(0==e?" ":c.getChainIDStr())},"JU.SB,JM.Atom");j(c$,"getAppletInfo",function(){var b=new java.util.Hashtable;b.put("htmlName",this.vwr.htmlName);b.put("syncId",this.vwr.syncId);b.put("fullName",this.vwr.fullName);b.put("codeBase",""+JV.Viewer.appletCodeBase);this.vwr.isApplet&&(b.put("documentBase",JV.Viewer.appletDocumentBase),
b.put("registry",this.vwr.sm.getRegistryInfo()));b.put("version",JV.JC.version);b.put("date",JV.JC.date);b.put("javaVendor",JV.Viewer.strJavaVendor);b.put("javaVersion",JV.Viewer.strJavaVersion+(!JV.Viewer.isJS?"":JV.Viewer.isWebGL?"(WebGL)":"(HTML5)"));b.put("operatingSystem",JV.Viewer.strOSName);return b});j(c$,"getAnimationInfo",function(){var b=this.vwr.am,c=new java.util.Hashtable;c.put("firstModelIndex",Integer.$valueOf(b.firstFrameIndex));c.put("lastModelIndex",Integer.$valueOf(b.lastFrameIndex));
c.put("animationDirection",Integer.$valueOf(b.animationDirection));c.put("currentDirection",Integer.$valueOf(b.currentDirection));c.put("displayModelIndex",Integer.$valueOf(b.cmi));null!=b.animationFrames&&(c.put("isMovie",Boolean.TRUE),c.put("frames",JU.Escape.eAI(b.animationFrames)),c.put("currentAnimationFrame",Integer.$valueOf(b.caf)));c.put("displayModelNumber",this.vwr.getModelNumberDotted(b.cmi));c.put("displayModelName",0<=b.cmi?this.vwr.getModelName(b.cmi):"");c.put("animationFps",Integer.$valueOf(b.animationFps));
c.put("animationReplayMode",JS.T.nameOf(b.animationReplayMode));c.put("firstFrameDelay",Float.$valueOf(b.firstFrameDelay));c.put("lastFrameDelay",Float.$valueOf(b.lastFrameDelay));c.put("animationOn",Boolean.$valueOf(b.animationOn));c.put("animationPaused",Boolean.$valueOf(b.animationPaused));return c});j(c$,"getBoundBoxInfo",function(){var b=this.vwr.ms.getBoxInfo(null,1).getBoundBoxPoints(!0),c=new java.util.Hashtable;c.put("center",JU.P3.newP(b[0]));c.put("vector",JU.V3.newV(b[1]));c.put("corner0",
JU.P3.newP(b[2]));c.put("corner1",JU.P3.newP(b[3]));return c});j(c$,"getShapeInfo",function(){var b=new java.util.Hashtable,c=new JU.SB,e=this.vwr.shm.shapes;if(null!=e)for(var a=0;37>a;++a){var d=e[a];if(null!=d){var f=JV.JC.shapeClassBases[a],d=d.getShapeDetail();null!=d&&b.put(f,d)}}0<c.length()&&b.put("shapeCommands",c.toString());return b});j(c$,"getAnnotationInfo",function(b,c){var e=this.vwr.getAtomBitSet(b),e=this.vwr.ms.getModelBS(e,!1).nextSetBit(0);if(0>e)return null;var a=this.vwr.ms.getModelAuxiliaryInfo(e).get(1073741925==
c?"domains":"validation");if(null==a||6!=a.tok)return null;this.vwr.getAnnotationParser(!1).initializeAnnotation(a,c,e);return a.mapGet("_list")},"~O,~N");j(c$,"getMeasurementInfo",function(){return this.vwr.getShapeProperty(6,"info")});j(c$,"getMouseInfo",function(){if(!this.vwr.haveDisplay)return null;for(var b=new java.util.Hashtable,c=new JU.Lst,e=this.vwr.acm,a,d=e.b.getBindings().values().iterator();d.hasNext()&&((a=d.next())||1);)p(a,Boolean)||(JU.AU.isAI(a)&&(a=x(-1,[JV.binding.Binding.getMouseActionName(a[0],
!1),JV.ActionManager.getActionName(a[1])])),c.addLast(a));b.put("bindings",c);b.put("bindingName",e.b.name);b.put("actionNames",JV.ActionManager.actionNames);b.put("actionInfo",JV.ActionManager.actionInfo);b.put("bindingInfo",JU.PT.split(e.getBindingInfo(null),"\n"));return b});w(c$,"getPdbAtomData",function(b,c,e,a){if(0==this.vwr.ms.ac||0>b.nextSetBit(0))return"";null==c?c=this.vwr.getOutputChannel(null,null):(e=(new Boolean(e|0<=c.getType().indexOf("PQR"))).valueOf(),a=(new Boolean(a|0<=c.getType().indexOf("-coord true"))).valueOf());
var d=this.vwr.ms.at,f=this.vwr.ms.am,g="%6.2Q%6.2b          ";if(e){g="%8.4P%7.4V       ";e=0;for(var h=b.nextSetBit(0);0<=h;h=b.nextSetBit(h+1))e+=d[h].getPartialCharge();c.append("REMARK   1 PQR file generated by Jmol "+JV.Viewer.getJmolVersion()).append("\nREMARK   1 created "+new java.util.Date).append("\nREMARK   1 Forcefield Used: unknown\nREMARK   1").append("\nREMARK   5").append("\nREMARK   6 Total charge on this protein: "+e+" e\nREMARK   6\n")}h=d[b.nextSetBit(0)].mi;e=-1;var n=b.length()-
1,n=h!=d[n].mi,m=this.vwr.ms.getModelBS(b,!0),l=m.cardinality(),k=new JU.Lst,j=f[h].isPdbWithMultipleBonds,s=!1;if(1<l)for(var p=null,t=0,h=m.nextSetBit(0);0<=h;h=m.nextSetBit(h+1)){var r=this.vwr.ms.getModelAuxiliaryInfo(h).get("PDB_CONECT_bonds");if(r!==p||!this.vwr.ms.am[h].isBioModel)if(p=r,0<t++){s=!0;break}}var p=new JU.P3,t=x(-1,[p]),w=a?this.vwr.tm.getRotationQ():null;a=new java.util.Hashtable;for(var m=!1,q=s?I(l,0):null,l=0,h=b.nextSetBit(0);0<=h;h=b.nextSetBit(h+1)){r=d[h];m=f[r.mi].isBioModel;
n&&r.mi!=e&&(-1!=e&&(l=this.fixPDBFormat(k,a,c,q,l),c.append("ENDMDL\n")),k=new JU.Lst,e=r.mi,c.append("MODEL     "+(e+1)+"\n"));var s=r.getAtomName(),v=2==r.getElementSymbol().length||4<=s.length||JU.PT.isDigit(s.charAt(0)),s=r.isHetero(),s=m?s?v?JM.LabelToken.compile(this.vwr,"HETATM%5.-5i %-4.4a%1A%3.3n %1c%4.-4R%1E   _XYZ_"+g,"\x00",null):JM.LabelToken.compile(this.vwr,"HETATM%5.-5i  %-3.3a%1A%3.3n %1c%4.-4R%1E   _XYZ_"+g,"\x00",null):v?JM.LabelToken.compile(this.vwr,"ATOM  %5.-5i %-4.4a%1A%3.3n %1c%4.-4R%1E   _XYZ_"+
g,"\x00",null):JM.LabelToken.compile(this.vwr,"ATOM  %5.-5i  %-3.3a%1A%3.3n %1c%4.-4R%1E   _XYZ_"+g,"\x00",null):v?JM.LabelToken.compile(this.vwr,"HETATM%5.-5i %-4.4a%1AUNK %1c   1%1E   _XYZ_"+g,"\x00",null):JM.LabelToken.compile(this.vwr,"HETATM%5.-5i  %-3.3a%1AUNK %1c   1%1E   _XYZ_"+g,"\x00",null),m=r.getElementSymbolIso(!1).toUpperCase(),m=this.pdbKey(r.group.getBioPolymerIndexInModel())+this.pdbKey(r.group.groupIndex)+JM.LabelToken.formatLabelAtomArray(this.vwr,r,s,"\x00",null,p)+(1==m.length?
" "+m:m.substring(0,2))+"  ";JV.PropertyManager.getPointTransf(-1,this.vwr.ms,r,w,p);r=JU.PT.sprintf("%8.3p%8.3p%8.3p","p",t);24<r.length&&(r=JU.PT.sprintf("%8.2p%8.2p%8.2p","p",t));m=JU.PT.rep(m,"_XYZ_",r);k.addLast(m)}this.fixPDBFormat(k,a,c,q,l);n&&c.append("ENDMDL\n");e=l=-1;g=""+(n?l:0);m=!1;for(h=b.nextSetBit(0);0<=h;h=b.nextSetBit(h+1))if(r=d[h],n&&r.mi!=e&&(e=r.mi,m=f[e].isBioModel,l++),s=!m||r.isHetero(),k=!s&&16==r.getElementNumber(),s||j||k)if(p=r.bonds,null!=p)for(t=0;t<p.length;t++)if(q=
r.getAtomNumber(),v=p[t].getOtherAtom(r),b.get(v.i)&&(w=p[t].getCovalentOrder(),!(1==w&&(j&&!s&&!k||k&&16!=v.getElementNumber()))))switch(v=v.getAtomNumber(),w){case 2:case 3:if(v<q)continue;case 1:q=a.get(g+"."+Integer.$valueOf(q));v=a.get(g+"."+Integer.$valueOf(v));if(null==q||null==v)break;c.append("CONECT").append(JU.PT.formatStringS("%5s","s",""+q));q=JU.PT.formatStringS("%5s","s",""+v);for(v=0;v<w;v++)c.append(q);c.append("\n")}return c.toString()},"JU.BS,JU.OC,~B,~B,~B");j(c$,"pdbKey",function(b){b=
0>b?"~999":"   "+b;return b.substring(b.length-4)},"~N");j(c$,"fixPDBFormat",function(b,c,e,a,d){b.addLast("~999~999XXXXXX99999999999999999999~99~");var f=Array(b.size());b.toArray(f);java.util.Arrays.sort(f);b.clear();for(var g=0,h=f.length;g<h;g++)b.addLast(f[g]);for(var n=f=null,h=b.size(),m=0,l=null==a?0:a[d],g=0;g<h;g++){var k=b.get(g),j=k.substring(0,4),k=k.substring(8),s=!1,p=0<=k.indexOf("~99~");if(!j.equals(f)||p)null!=f&&!f.equals("~999")&&(s=!0,k="TER   "+n.substring(6,11)+"      "+n.substring(17,
27),b.add(g,j+"~~~~"+k),h++),f=j;if(p&&!s)break;n=k;m=g+1+l;null!=c&&!s&&c.put(""+d+"."+Integer.$valueOf(JU.PT.parseInt(k.substring(6,11))),Integer.$valueOf(m));j="     "+m;e.append(k.substring(0,6)).append(j.substring(j.length-5)).append(k.substring(11)).append("\n")}null!=a&&++d<a.length&&(a[d]=m);return d},"JU.Lst,java.util.Map,JU.OC,~A,~N");w(c$,"getPdbData",function(b,c,e,a,d,f){this.vwr.ms.isJmolDataFrameForModel(b)&&(b=this.vwr.ms.getJmolDataSourceFrame(b));if(0>b)return"";var g=this.vwr.ms.am[b],
h=g.isBioModel;if(null==a&&!h)return null;null==d&&(d=this.vwr.getOutputChannel(null,null));var j=new JU.SB,m=0<=c.indexOf("draw"),l=null,k=new JU.BS,p="\x00",s=this.vwr.ms.getLabeler().compile(this.vwr,"ATOM  %-6i%4a%1A%3.-3n %1c%4R%1E   ","\x00",null);if(null==a)p=11<c.length&&0<=c.indexOf("quaternion ")?c.charAt(11):"R",g.getPdbData(c,p,m,e,d,s,j,k),l=this.vwr.getModelUndeletedAtomsBitSet(b);else{l=a[0];b=a[1];var g=a[2],w=a[3],t=null!=g,r=null!=w,B=a[4],q=a[5],v=a[6],E=a[7],C=a[8],D=a[9];a=null!=
v&&null==C;var F=this.vwr.ms.at;if(a){d.append("REMARK   6 Jmol PDB-encoded data: ").append(c).append("; ").append(JV.Viewer.getJmolVersion()).append("; ").append(this.vwr.apiPlatform.getDateFormat(null)).append("\n");d.append("REMARK   6 Jmol data").append(" min = ").append(JU.Escape.eP(B)).append(" max = ").append(JU.Escape.eP(q)).append(" unScaledXyz = xyz * ").append(JU.Escape.eP(v)).append(" + ").append(JU.Escape.eP(E)).append(";\n");q=null;for(c=l.nextSetBit(0);0<=c;c=l.nextSetBit(c+1))if(B=
""+F[c].getAtomName(),null!=q||4<B.length)null==q?(q="",c=-1):q+=" "+B;null!=q&&d.append("REMARK   6 Jmol atom names").append(q).append("\n");q=null;for(c=l.nextSetBit(0);0<=c;c=l.nextSetBit(c+1))if(B=""+F[c].getGroup3(!0),null!=q||3<B.length)null==q?(q="",c=-1):q+=" "+B;null!=q&&d.append("REMARK   6 Jmol residue names").append(q).append("\n");for(c=0;c<D.length;c++)null!=D[c]&&d.append("REMARK   6 Jmol property ").append(D[c]).append(";\n")}D=null;B=new JU.P3;a||(null==C&&(C="%-5i %-10s %-13.5f "+
(r?"%-13.5f %-13.5f":t?"%-13.5f":"")),C+="\n");c=l.nextSetBit(0);for(q=0;0<=c;c=l.nextSetBit(c+1),q++){var v=b[q],E=t?g[q]:0,G=r?w[q]:0;if(!Float.isNaN(v)&&!Float.isNaN(E)&&!Float.isNaN(G)){var A=F[c];a?(d.append(JM.LabelToken.formatLabelAtomArray(this.vwr,A,s,"\x00",null,B)),h&&k.set(c),d.append(JU.PT.sprintf("%-8.2f%-8.2f%-10.2f    %6.3f          %2s    %s\n","ssF",x(-1,[A.getElementSymbolIso(!1).toUpperCase(),"",z(-1,[v,E,G,0])]))),null!=D&&D.group.getBioPolymerIndexInModel()==A.group.getBioPolymerIndexInModel()&&
j.append("CONECT").append(JU.PT.formatStringI("%5i","i",D.getAtomNumber())).append(JU.PT.formatStringI("%5i","i",A.getAtomNumber())).appendC("\n")):r?d.append(JU.PT.sprintf(C,"isF",x(-1,[Integer.$valueOf(A.getAtomNumber()),A.getAtomName(),z(-1,[v,E,G])]))):t?d.append(JU.PT.sprintf(C,"isF",x(-1,[Integer.$valueOf(A.getAtomNumber()),A.getAtomName(),z(-1,[v,E])]))):d.append(JU.PT.sprintf(C,"isF",x(-1,[Integer.$valueOf(A.getAtomNumber()),A.getAtomName(),z(-1,[v])])));D=A}}}d.append(j.toString());if(m)return d.toString();
e.and(l);h&&f&&d.append("\n\n"+this.vwr.ms.getProteinStructureState(k,"R"==p?4138:1073742086));return d.toString()},"~N,~S,JU.BS,~A,JU.OC,~B");w(c$,"getModelCml",function(b,c,e){var a=new JU.SB;if(0==b.cardinality())return"";JV.Viewer.isJS&&J.api.Interface.getInterface("JU.XmlUtil",this.vwr,"file");JU.XmlUtil.openTag(a,"molecule");JU.XmlUtil.openTag(a,"atomArray");for(var d=new JU.BS,f=this.vwr.ms.at,g=b.nextSetBit(0);0<=g&&!(0>--c);g=b.nextSetBit(g+1)){var h=f[g],j=h.getAtomName();JU.PT.rep(j,'"',
"''");d.set(h.i);JU.XmlUtil.appendTag(a,"atom/",x(-1,["id","a"+(h.i+1),"title",h.getAtomName(),"elementType",h.getElementSymbol(),"x3",""+h.x,"y3",""+h.y,"z3",""+h.z]))}JU.XmlUtil.closeTag(a,"atomArray");if(e){JU.XmlUtil.openTag(a,"bondArray");b=this.vwr.ms.bondCount;c=this.vwr.ms.bo;for(g=0;g<b;g++)e=c[g],f=e.atom2,d.get(e.atom1.i)&&d.get(f.i)&&(f=JU.Edge.getCmlBondOrder(e.order),null!=f&&JU.XmlUtil.appendTag(a,"bond/",x(-1,["atomRefs2","a"+(e.atom1.i+1)+" a"+(e.atom2.i+1),"order",f])));JU.XmlUtil.closeTag(a,
"bondArray")}JU.XmlUtil.closeTag(a,"molecule");return a.toString()},"JU.BS,~N,~B,~B,~B");w(c$,"fixJMEFormalCharges",function(b,c){var e=!1;if(null==b)return c;for(var a=b.nextSetBit(0);0<=a;a=b.nextSetBit(a+1)){var d=this.vwr.ms.at[a];if(0!=d.getFormalCharge()){e=!0;break}}if(!e)return c;e=this.vwr.getSmilesMatcher().getMapForJME(c,this.vwr.ms.at,b);if(null==e)return c;for(var d=e[0],f=e[1],e=JU.PT.getTokens(c),g=JU.PT.parseInt(e[0]),g=I(g,0),a=d.length;0<=--a;)g[d[a]]=f[a]+1;a=0;for(f=2;f<e.length;f+=
3){var h=e[f];if(-2147483648!=JU.PT.parseInt(h))break;h=JU.PT.replaceAllCharacters(h,"+-","");d=this.vwr.ms.at[g[a++]-1];if(!d.getElementSymbol().equals(h))return c;d=d.getFormalCharge();0!=d&&(e[f]=h+(0<d?"+":"-")+(1<Math.abs(d)?""+Math.abs(d):""))}return JU.PT.join(e," ",0)},"JU.BS,~S");K(c$,"atomExpression","<atom selection>");c$.propertyTypes=c$.prototype.propertyTypes=x(-1,"appletInfo;;;fileName;;;fileHeader;;;fileContents;<pathname>;;fileContents;;;animationInfo;;;modelInfo;<atom selection>;{*};ligandInfo;<atom selection>;{*};shapeInfo;;;measurementInfo;;;centerInfo;;;orientationInfo;;;transformInfo;;;;;;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;<width=www,height=hhh>;;evaluate;<expression>;;menu;<type>;current;minimizationInfo;;;pointGroupInfo;<atom selection>;(visible);fileInfo;<type>;;errorMessage;;;mouseInfo;;;isosurfaceInfo;;;isosurfaceData;;;consoleText;;;JSpecView;<key>;;scriptQueueInfo;;;nmrInfo;<elementSymbol> or 'all' or 'shifts';all;variableInfo;<name>;all;domainInfo;<atom selection>;{visible};validationInfo;<atom selection>;{visible};service;<hashTable>;;CIFInfo;<filename>;;modelkitInfo;<key>;data".split(";"));
K(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_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_SCRIPT_QUEUE_INFO",39,"PROP_NMR_INFO",40,"PROP_VAR_INFO",41,"PROP_DOM_INFO",42,"PROP_VAL_INFO",43,"PROP_SERVICE",44,"PROP_CIF_INFO",45,"PROP_MODELKIT_INFO",46,
"PROP_COUNT",47,"readableTypes",x(-1," stateinfo extractmodel filecontents fileheader image menu minimizationInfo".split(" ")))})})(Clazz,Clazz.getClassName,Clazz.newLongArray,Clazz.doubleToByte,Clazz.doubleToInt,Clazz.doubleToLong,Clazz.declarePackage,Clazz.instanceOf,Clazz.load,Clazz.instantialize,Clazz.decorateAsClass,Clazz.floatToInt,Clazz.floatToLong,Clazz.makeConstructor,Clazz.defineEnumConstant,Clazz.exceptionOf,Clazz.newIntArray,Clazz.defineStatics,Clazz.newFloatArray,Clazz.declareType,Clazz.prepareFields,
Clazz.superConstructor,Clazz.newByteArray,Clazz.declareInterface,Clazz.p0p,Clazz.pu$h,Clazz.newShortArray,Clazz.innerTypeInstance,Clazz.isClassDefined,Clazz.prepareCallback,Clazz.newArray,Clazz.castNullAs,Clazz.floatToShort,Clazz.superCall,Clazz.decorateAsType,Clazz.newBooleanArray,Clazz.newCharArray,Clazz.implementOf,Clazz.newDoubleArray,Clazz.overrideConstructor,Clazz.clone,Clazz.doubleToShort,Clazz.getInheritedLevel,Clazz.getParamsType,Clazz.isAF,Clazz.isAB,Clazz.isAI,Clazz.isAS,Clazz.isASS,Clazz.isAP,
Clazz.isAFloat,Clazz.isAII,Clazz.isAFF,Clazz.isAFFF,Clazz.tryToSearchAndExecute,Clazz.getStackTrace,Clazz.inheritArgs,Clazz.alert,Clazz.defineMethod,Clazz.overrideMethod,Clazz.declareAnonymous,Clazz.cloneFinals);
