Clazz.declarePackage("J.api");Clazz.declareInterface(J.api,"JmolScriptManager");Clazz.declarePackage("J.api");Clazz.declareInterface(J.api,"JmolScriptEvaluator");Clazz.declarePackage("J.api");Clazz.declareInterface(J.api,"JmolScriptFunction");Clazz.declarePackage("J.script");
Clazz.load(["J.thread.JmolThread"],"J.script.FileLoadThread",null,function(){c$=Clazz.decorateAsClass(function(){this.key=this.cacheName=this.fileName=null;Clazz.instantialize(this,arguments)},J.script,"FileLoadThread",J.thread.JmolThread);Clazz.makeConstructor(c$,function(a,b,c,d,e){Clazz.superConstructor(this,J.script.FileLoadThread,[]);this.setViewer(b,"FileLoadThread");this.fileName=c;this.key=d;this.cacheName=e;this.setEval(a);this.sc.pc--},"J.api.JmolScriptEvaluator,J.viewer.Viewer,~S,~S,~S");
Clazz.overrideMethod(c$,"run1",function(a){for(;;)switch(a){case -1:a=0;break;case 0:if(this.stopped||this.eval.isStopped()){a=-2;break}return Jmol._loadFileAsynchronously(this,this.viewer.applet,this.fileName);case -2:this.resumeEval();return}},"~N");$_M(c$,"setData",function(a,b){null!=a&&this.sc.parentContext.htFileCache.put(this.key,this.cacheName=this.cacheName.substring(0,this.cacheName.lastIndexOf("_")+1)+a);this.viewer.cachePut(this.cacheName,b);this.run1(-2)},"~S,~O")});Clazz.declarePackage("J.script");
Clazz.load(["J.thread.JmolThread"],"J.script.ScriptQueueThread",["J.util.Logger"],function(){c$=Clazz.decorateAsClass(function(){this.scriptManager=null;this.startedByCommandThread=!1;this.pt=0;Clazz.instantialize(this,arguments)},J.script,"ScriptQueueThread",J.thread.JmolThread);Clazz.makeConstructor(c$,function(a,b,c,d){Clazz.superConstructor(this,J.script.ScriptQueueThread);this.setViewer(b,"QueueThread"+d);this.scriptManager=a;this.viewer=b;this.startedByCommandThread=c;this.pt=d},"J.api.JmolScriptManager,J.viewer.Viewer,~B,~N");
Clazz.overrideMethod(c$,"run1",function(a){for(;;)switch(a){case -1:a=0;break;case 0:if(this.stopped||0==this.scriptManager.getScriptQueue().size()){a=-2;break}if(!this.runNextScript()&&!this.runSleep(100,0))return;break;case -2:this.scriptManager.queueThreadFinished(this.pt);return}},"~N");$_M(c$,"runNextScript",($fz=function(){var a=this.scriptManager.getScriptQueue();if(0==a.size())return!1;var b=this.scriptManager.getScriptItem(!1,this.startedByCommandThread);if(null==b)return!1;var c=b.get(0),
d=b.get(1),e=b.get(2),f=b.get(3).booleanValue(),b=b.get(4).booleanValue();J.util.Logger.debugging&&J.util.Logger.debug("Queue["+this.pt+"]["+a.size()+"] scripts; running: "+c);a.remove(0);this.viewer.evalStringWaitStatusQueued(e,c,d,f,b,!0);return 0==a.size()?!1:!0},$fz.isPrivate=!0,$fz))});Clazz.declarePackage("J.script");
Clazz.load(["J.thread.JmolThread"],"J.script.ScriptDelayThread",null,function(){c$=Clazz.decorateAsClass(function(){this.seconds=this.millis=0;this.isPauseDelay=this.doPopPush=!1;Clazz.instantialize(this,arguments)},J.script,"ScriptDelayThread",J.thread.JmolThread);Clazz.makeConstructor(c$,function(a,b,c){Clazz.superConstructor(this,J.script.ScriptDelayThread,[]);this.setViewer(b,"ScriptDelayThread");this.millis=c;this.setEval(a)},"J.api.JmolScriptEvaluator,J.viewer.Viewer,~N");Clazz.overrideMethod(c$,
"run1",function(a){for(;;)switch(a){case -1:var b;this.doPopPush=0<this.millis;this.isPauseDelay=-100==this.millis;if(this.doPopPush){if(0<(b=this.viewer.getDelayMaximumMs())&&this.millis>b)this.millis=b}else this.millis=-this.millis;this.millis-=System.currentTimeMillis()-this.startTime;this.isJS?this.seconds=0:(this.seconds=Clazz.doubleToInt(this.millis/1E3),this.millis-=1E3*this.seconds,0>=this.millis&&(this.millis=1));this.doPopPush&&this.viewer.popHoldRepaint("scriptDelayThread INIT");a=0;break;
case 0:if(this.stopped||this.eval.isStopped()){a=-2;break}if(!this.runSleep(0<this.seconds--?1E3:this.millis,-2))return;0>this.seconds&&(this.millis=0);a=0<this.seconds||0<this.millis?0:-2;break;case -2:this.doPopPush&&this.viewer.pushHoldRepaint("delay FINISH");this.isPauseDelay&&this.eval.notifyResumeStatus();this.resumeEval();return}},"~N");Clazz.defineStatics(c$,"PAUSE_DELAY",-100)});Clazz.declarePackage("J.script");
Clazz.load(["J.thread.JmolThread"],"J.script.CommandWatcherThread",["java.lang.Thread","J.util.Logger"],function(){c$=Clazz.decorateAsClass(function(){this.scriptManager=null;Clazz.instantialize(this,arguments)},J.script,"CommandWatcherThread",J.thread.JmolThread);Clazz.makeConstructor(c$,function(){Clazz.superConstructor(this,J.script.CommandWatcherThread,[])});Clazz.overrideMethod(c$,"setManager",function(a,b){this.scriptManager=a;this.setViewer(b,"CommmandWatcherThread");return 0},"~O,J.viewer.Viewer,~O");
Clazz.overrideMethod(c$,"run",function(){for(Thread.currentThread().setPriority(1);!this.stopped;)try{Thread.sleep(50),this.stopped||this.scriptManager.runScriptNow()}catch(a){if(Clazz.exceptionOf(a,InterruptedException)){var b=a;J.util.Logger.warn("CommandWatcher InterruptedException! "+this);break}else if(Clazz.exceptionOf(a,Exception)){for(var b=a,c="script processing ERROR:\n\n"+b.toString(),d=0;d<b.getStackTrace().length;d++)c+="\n"+b.getStackTrace()[d].toString();J.util.Logger.warn("CommandWatcher Exception! "+
c);break}else throw a;}});Clazz.overrideMethod(c$,"run1",function(){},"~N");Clazz.defineStatics(c$,"commandDelay",50)});Clazz.declarePackage("J.script");
Clazz.load(["J.api.JmolScriptManager","JU.List"],"J.script.ScriptManager","java.lang.Boolean $.Thread JU.SB J.api.Interface J.io.JmolBinary J.script.ScriptQueueThread J.util.Escape $.Logger $.Txt".split(" "),function(){c$=Clazz.decorateAsClass(function(){this.scriptQueue=this.commandWatcherThread=this.scriptQueueRunning=this.queueThreads=this.evalTemp=this.eval=this.viewer=null;this.useCommandWatcherThread=!1;this.scriptIndex=0;this.$isScriptQueued=!0;Clazz.instantialize(this,arguments)},J.script,
"ScriptManager",null,J.api.JmolScriptManager);Clazz.prepareFields(c$,function(){this.queueThreads=Array(2);this.scriptQueueRunning=Clazz.newBooleanArray(2,!1);this.scriptQueue=new JU.List});Clazz.overrideMethod(c$,"getEval",function(){return this.eval});Clazz.overrideMethod(c$,"getScriptQueue",function(){return this.scriptQueue});Clazz.overrideMethod(c$,"isScriptQueued",function(){return this.$isScriptQueued});Clazz.makeConstructor(c$,function(){});Clazz.overrideMethod(c$,"setViewer",function(a){this.viewer=
a;this.eval=this.newScriptEvaluator();this.eval.setCompiler()},"J.viewer.Viewer");$_M(c$,"newScriptEvaluator",($fz=function(){return J.api.Interface.getOptionInterface("script.ScriptEvaluator").setViewer(this.viewer)},$fz.isPrivate=!0,$fz));Clazz.overrideMethod(c$,"clear",function(a){a?(this.startCommandWatcher(!1),this.interruptQueueThreads()):this.evalTemp=null},"~B");Clazz.overrideMethod(c$,"addScript",function(a,b,c){return this.addScr("String",a,"",b,c)},"~S,~B,~B");$_M(c$,"addScr",($fz=function(a,
b,c,d,e){this.useCommandWatcherThread=!1;this.viewer.global.useScriptQueue||(this.clearQueue(),this.viewer.haltScriptExecution());null==this.commandWatcherThread&&this.useCommandWatcherThread&&this.startCommandWatcher(!0);if(null!=this.commandWatcherThread&&0<=b.indexOf("/*SPLIT*/")){b=J.util.Txt.split(b,"/*SPLIT*/");for(var f=0;f<b.length;f++)this.addScr(a,b[f],c,d,e);return"split into "+b.length+" sections for processing"}var f=null!=this.commandWatcherThread&&(0>b.indexOf("javascript")||0<=b.indexOf("#javascript ")),
g=new JU.List;g.addLast(b);g.addLast(c);g.addLast(a);g.addLast(d?Boolean.TRUE:Boolean.FALSE);g.addLast(e?Boolean.TRUE:Boolean.FALSE);g.addLast(Integer.$valueOf(f?-1:1));this.scriptQueue.addLast(g);this.startScriptQueue(!1);return"pending"},$fz.isPrivate=!0,$fz),"~S,~S,~S,~B,~B");Clazz.overrideMethod(c$,"clearQueue",function(){this.scriptQueue.clear()});Clazz.overrideMethod(c$,"waitForQueue",function(){if(!this.viewer.isSingleThreaded)for(var a=0;this.isQueueProcessing();)try{Thread.sleep(100),0==
a++%10&&J.util.Logger.debugging&&J.util.Logger.debug("...scriptManager waiting for queue: "+this.scriptQueue.size()+" thread="+Thread.currentThread().getName())}catch(b){if(!Clazz.exceptionOf(b,InterruptedException))throw b;}});Clazz.overrideMethod(c$,"isQueueProcessing",function(){return null!=this.queueThreads[0]||null!=this.queueThreads[1]});$_M(c$,"flushQueue",($fz=function(a){for(var b=this.scriptQueue.size();0<=--b;){var c=this.scriptQueue.get(b).get(0);0==c.indexOf(a)&&(this.scriptQueue.remove(b),
J.util.Logger.debugging&&J.util.Logger.debug(this.scriptQueue.size()+" scripts; removed: "+c))}},$fz.isPrivate=!0,$fz),"~S");$_M(c$,"startScriptQueue",($fz=function(a){var b=a?1:0;this.scriptQueueRunning[b]||(this.scriptQueueRunning[b]=!0,this.queueThreads[b]=new J.script.ScriptQueueThread(this,this.viewer,a,b),this.queueThreads[b].start())},$fz.isPrivate=!0,$fz),"~B");Clazz.overrideMethod(c$,"getScriptItem",function(a,b){if(this.viewer.isSingleThreaded&&this.viewer.queueOnHold)return null;var c=
this.scriptQueue.get(0),d=c.get(5).intValue();return(a?0>d:b?0==d:1==d)?c:null},"~B,~B");Clazz.overrideMethod(c$,"startCommandWatcher",function(a){if(this.useCommandWatcherThread=a){if(null!=this.commandWatcherThread)return;this.commandWatcherThread=J.api.Interface.getOptionInterface("script.CommandWatcherThread");this.commandWatcherThread.setManager(this,this.viewer,null);this.commandWatcherThread.start()}else{if(null==this.commandWatcherThread)return;this.clearCommandWatcherThread()}J.util.Logger.debugging&&
J.util.Logger.debug("command watcher "+(a?"started":"stopped")+this.commandWatcherThread)},"~B");$_M(c$,"interruptQueueThreads",function(){for(var a=0;a<this.queueThreads.length;a++)null!=this.queueThreads[a]&&this.queueThreads[a].interrupt()});$_M(c$,"clearCommandWatcherThread",function(){null!=this.commandWatcherThread&&(this.commandWatcherThread.interrupt(),this.commandWatcherThread=null)});Clazz.overrideMethod(c$,"queueThreadFinished",function(a){this.queueThreads[a].interrupt();this.scriptQueueRunning[a]=
!1;this.queueThreads[a]=null;this.viewer.setSyncDriver(4)},"~N");$_M(c$,"runScriptNow",function(){if(0<this.scriptQueue.size()){var a=this.getScriptItem(!0,!0);null!=a&&(a.set(5,Integer.$valueOf(0)),this.startScriptQueue(!0))}});Clazz.overrideMethod(c$,"evalStringWaitStatusQueued",function(a,b,c,d,e,f){if(null==b)return null;var g=this.checkScriptExecution(b,!1);if(null!=g)return g;var h=null==c||c.equals("output")?new JU.SB:null,g=this.viewer.statusManager.getStatusList();this.viewer.getStatusChanged(c);
this.viewer.isSyntaxCheck&&J.util.Logger.info("--checking script:\n"+this.eval.getScript()+"\n----\n");var j=0==b.indexOf(")");j&&(b=b.substring(1));j=j||!f;this.viewer.setErrorMessage(null,null);d=d?this.eval.compileScriptFile(b,e):this.eval.compileScriptString(b,e);var l=this.eval.getErrorMessage(),k=this.eval.getErrorMessageUntranslated();this.viewer.setErrorMessage(l,k);this.viewer.refresh(7,"script complete");d?(this.$isScriptQueued=f,e||this.viewer.setScriptStatus(null,b,-2-++this.scriptIndex,
null),this.eval.evaluateCompiledScript(this.viewer.isSyntaxCheck,this.viewer.isSyntaxAndFileCheck,j,this.viewer.listCommands,h,f||!this.viewer.isSingleThreaded)):(this.viewer.scriptStatus(l),this.viewer.setScriptStatus("Jmol script terminated",l,1,k),this.viewer.setStateScriptVersion(null));null!=l&&this.viewer.autoExit&&this.viewer.exitJmol();this.viewer.isSyntaxCheck&&(null==l?J.util.Logger.info("--script check ok"):J.util.Logger.error("--script check error\n"+k),J.util.Logger.info("(use 'exit' to stop checking)"));
this.$isScriptQueued=!0;if(a.equalsIgnoreCase("String"))return k;if(null!=h)return null==k?h.toString():k;a=this.viewer.getProperty(a,"jmolStatus",c);this.viewer.getStatusChanged(g);return a},"~S,~S,~S,~B,~B,~B");$_M(c$,"checkScriptExecution",($fz=function(a,b){var c=a;0<=c.indexOf("\u0001##")&&(c=c.substring(0,c.indexOf("\u0001##")));return this.checkResume(c)?"script processing resumed":this.checkStepping(c)?"script processing stepped":this.checkHalt(c,b)?"script execution halted":null},$fz.isPrivate=
!0,$fz),"~S,~B");$_M(c$,"checkResume",($fz=function(a){return a.equalsIgnoreCase("resume")?(this.viewer.setScriptStatus("","execution resumed",0,null),this.eval.resumePausedExecution(),!0):!1},$fz.isPrivate=!0,$fz),"~S");$_M(c$,"checkStepping",($fz=function(a){return a.equalsIgnoreCase("step")?(this.eval.stepPausedExecution(),!0):a.equalsIgnoreCase("?")?(this.viewer.scriptStatus(this.eval.getNextStatement()),!0):!1},$fz.isPrivate=!0,$fz),"~S");Clazz.overrideMethod(c$,"evalStringQuietSync",function(a,
b,c){c&&(this.viewer.statusManager.syncingScripts&&0>a.indexOf("#NOSYNC;"))&&this.viewer.syncScript(a+" #NOSYNC;",null,0);this.eval.isPaused()&&"!"!=a.charAt(0)&&(a="!"+J.util.Txt.trim(a,"\n\r\t "));(c=0<a.length&&"!"==a.charAt(0))&&(a=a.substring(1));var d=this.checkScriptExecution(a,c);if(null!=d)return d;if(this.viewer.isScriptExecuting()&&(c||this.eval.isPaused()))return this.viewer.setInsertedCommand(a),0==a.indexOf("moveto ")&&this.flushQueue("moveto "),"!"+a;this.viewer.setInsertedCommand("");
b&&(a+="\u0001## EDITOR_IGNORE ##");return this.addScript(a,!1,b&&!this.viewer.getBoolean(603979880))},"~S,~B,~B");Clazz.overrideMethod(c$,"checkHalt",function(a,b){if(a.equalsIgnoreCase("pause"))return this.viewer.pauseScriptExecution(),this.viewer.scriptEditorVisible&&this.viewer.setScriptStatus("","paused -- type RESUME to continue",0,null),!0;if(a.equalsIgnoreCase("menu"))return this.viewer.getProperty("DATA_API","getPopupMenu","\x00"),!0;a=a.toLowerCase();var c=!1,d=null;a.startsWith("exit")?
(this.viewer.haltScriptExecution(),this.viewer.clearScriptQueue(),this.viewer.clearTimeouts(),c=a.equals(d="exit")):a.startsWith("quit")&&(this.viewer.haltScriptExecution(),c=a.equals(d="quit"));if(null==d)return!1;b&&(this.viewer.clearThreads(),this.viewer.queueOnHold=!1);(b||this.viewer.global.waitForMoveTo)&&this.viewer.stopMotion();J.util.Logger.info(this.viewer.isSyntaxCheck?d+" -- stops script checking":(b?"!":"")+d+" received");this.viewer.isSyntaxCheck=!1;return c},"~S,~B");Clazz.overrideMethod(c$,
"getAtomBitSetEval",function(a,b){null==a&&(a=this.evalTemp,null==a&&(a=this.evalTemp=this.newScriptEvaluator()));return a.getAtomBitSet(b)},"J.api.JmolScriptEvaluator,~O");Clazz.overrideMethod(c$,"scriptCheckRet",function(a,b){if(0==a.indexOf(")")||0==a.indexOf("!"))a=a.substring(1);var c=this.newScriptEvaluator().checkScriptSilent(a);return b||null==c.errorMessage?c:c.errorMessage},"~S,~B");Clazz.overrideMethod(c$,"openFileAsync",function(a,b){var c=null;a=a.trim();var d=!a.startsWith("\t");d||
(a=a.substring(1));a=a.$replace("\\","/");var e=a.startsWith("cache://");this.viewer.isApplet()&&0>a.indexOf("://")&&(a="file://"+(a.startsWith("/")?"":"/")+a);try{if(a.endsWith(".pse"))c=(e?"":"zap;")+"load SYNC "+J.util.Escape.eS(a)+" filter 'DORESIZE'";else if(a.endsWith("jvxl"))c="isosurface ";else{if(!a.endsWith(".spt")){var f=this.getFileTypeName(a);if(null==f){f=J.io.JmolBinary.determineSurfaceTypeIs(this.viewer.getBufferedInputStream(a));null!=f&&(c="if (_filetype == 'Pdb') { isosurface sigma 1.0 within 2.0 {*} "+
J.util.Escape.eS(a)+" mesh nofill }; else; { isosurface "+J.util.Escape.eS(a)+"}");return}if(f.equals("Jmol"))c="script ";else if(f.equals("Cube"))c="isosurface sign red blue ";else if(!f.equals("spt")){c=this.viewer.global.defaultDropScript;c=J.util.Txt.simpleReplace(c,"%FILE",a);c=J.util.Txt.simpleReplace(c,"%ALLOWCARTOONS",""+b);c.toLowerCase().startsWith("zap")&&e&&(c=c.substring(3));return}}d&&this.viewer.scriptEditorVisible&&null==c?this.viewer.showEditor([a,this.viewer.getFileAsString(a)]):
c=(null==c?"script ":c)+J.util.Escape.eS(a)}}finally{null!=c&&this.viewer.evalString(c)}},"~S,~B");$_M(c$,"getFileTypeName",($fz=function(a){var b=a.indexOf("::");if(0<=b)return a.substring(0,b);if(a.startsWith("="))return"pdb";b=this.viewer.fileManager.getUnzippedReaderOrStreamFromName(a,null,!0,!1,!0,!0,null);return Clazz.instanceOf(b,java.io.BufferedReader)?this.viewer.getModelAdapter().getFileTypeName(b):Clazz.instanceOf(b,J.api.ZInputStream)?(a=this.getZipDirectoryAsString(a),0<=a.indexOf("JmolManifest")?
"Jmol":this.viewer.getModelAdapter().getFileTypeName(J.io.JmolBinary.getBufferedReaderForString(a))):J.util.Escape.isAS(b)?b[0]:null},$fz.isPrivate=!0,$fz),"~S");$_M(c$,"getZipDirectoryAsString",($fz=function(a){a=this.viewer.fileManager.getBufferedInputStreamOrErrorMessageFromName(a,a,!1,!1,null,!1);return J.io.JmolBinary.getZipDirectoryAsStringAndClose(a)},$fz.isPrivate=!0,$fz),"~S")});Clazz.declarePackage("J.script");
Clazz.load(["J.api.JmolScriptEvaluator"],"J.script.ScriptEvaluator","java.lang.Boolean $.Float $.NullPointerException $.Thread java.util.Hashtable JU.BS $.List $.M3 $.M4 $.P3 $.P4 $.ParserJS $.SB $.V3 J.api.Interface J.atomdata.RadiusData J.constant.EnumAnimationMode $.EnumPalette $.EnumStereoMode $.EnumStructure $.EnumVdw J.i18n.GT J.io.JmolBinary J.modelset.Atom $.Bond $.Group $.ModelCollection $.TickInfo J.script.FileLoadThread $.SV $.ScriptCompiler $.ScriptContext $.ScriptDelayThread $.ScriptException $.ScriptInterruption $.ScriptMathProcessor $.T J.util.BSUtil $.ColorEncoder $.ColorUtil $.Elements $.Escape $.GData $.JmolEdge $.Logger $.Measure $.Parser $.ParserBS $.Quaternion $.Txt J.viewer.ActionManager $.FileManager $.JC $.StateManager $.Viewer".split(" "),function(){c$=
Clazz.decorateAsClass(function(){this.allowJSThreads=!0;this.executing=this.executionStepping=this.executionPaused=this.executionStopped=this.debugScript=this.logMessages=this.historyDisabled=this.isCmdLine_c_or_C_Option=this.isCmdLine_C_Option=this.chk=this.tQuiet=this.isJS=this.listCommands=!1;this.timeEndExecution=this.timeBeginExecution=0;this.mustResumeEval=!1;this.outputBuffer=this.definedAtomSets=this.compiler=this.viewer=this.currentThread=this.sm=null;this.contextPath="";this.functionName=
this.scriptFileName=null;this.isStateScript=!1;this.commandHistoryLevelMax=this.scriptReportingLevel=this.scriptLevel=0;this.$script=this.contextVariables=this.lineIndices=this.lineNumbers=this.aatoken=null;this.pc=0;this.st=this.fullCommand=this.thisCommand=null;this.pcEnd=this.lineEnd=this.iToken=this.slen=0;this.scriptExtensions=null;this.forceNoAddHydrogens=!1;this.thisContext=this.parallelProcessor=null;this.$error=!1;this.errorType=this.errorMessageUntranslated=this.errorMessage=null;this.iCommandError=
0;this.ignoreError=!1;this.tempStatement=null;this.isBondSet=!1;this.expressionResult=null;this.theTok=0;this.theToken=null;this.coordinatesAreFractional=!1;this.fileLoadThread=this.scriptDelayThread=this.colorArgb=this.scriptExt=this.fractionalPoint=null;Clazz.instantialize(this,arguments)},J.script,"ScriptEvaluator",null,J.api.JmolScriptEvaluator);Clazz.prepareFields(c$,function(){this.colorArgb=[-2147483648]});Clazz.overrideMethod(c$,"getAllowJSThreads",function(){return this.allowJSThreads});
Clazz.overrideMethod(c$,"setViewer",function(a){this.viewer=a;this.compiler=null==this.compiler?a.compiler:this.compiler;this.isJS=a.isSingleThreaded;this.definedAtomSets=a.definedAtomSets;return this},"J.viewer.Viewer");Clazz.makeConstructor(c$,function(){this.currentThread=Thread.currentThread();$t$=J.script.ScriptEvaluator.evalID++;J.script.ScriptEvaluator.prototype.evalID=J.script.ScriptEvaluator.evalID;$t$});Clazz.overrideMethod(c$,"setCompiler",function(){this.viewer.compiler=this.compiler=
new J.script.ScriptCompiler(this.viewer)});Clazz.overrideMethod(c$,"compileScriptString",function(a,b){this.clearState(b);this.contextPath="[script]";return this.compileScript(null,a,this.debugScript)},"~S,~B");Clazz.overrideMethod(c$,"compileScriptFile",function(a,b){this.clearState(b);this.contextPath=a;return this.compileScriptFileInternal(a,null,null,null)},"~S,~B");Clazz.overrideMethod(c$,"evaluateCompiledScript",function(a,b,c,d,e,f){var g=this.isCmdLine_C_Option;this.isCmdLine_C_Option=b;this.chk=
this.isCmdLine_c_or_C_Option=a;this.historyDisabled=c;this.outputBuffer=e;this.currentThread=Thread.currentThread();this.allowJSThreads=f;this.listCommands=d;this.startEval();this.isCmdLine_C_Option=g;this.viewer.setStateScriptVersion(null)},"~B,~B,~B,~B,JU.SB,~B");$_M(c$,"useThreads",function(){return!this.viewer.autoExit&&this.viewer.haveDisplay&&null==this.outputBuffer&&this.allowJSThreads});$_M(c$,"startEval",($fz=function(){this.timeBeginExecution=System.currentTimeMillis();this.executionStepping=
this.executionStopped=this.executionPaused=!1;this.executing=!0;this.viewer.pushHoldRepaint("runEval");this.setScriptExtensions();this.executeCommands(!1)},$fz.isPrivate=!0,$fz));$_M(c$,"executeCommands",($fz=function(a){var b=!1;try{if(!this.dispatchCommands(!1,!1))return}catch(c){if(Clazz.exceptionOf(c,Error))this.viewer.handleError(c,!1),this.setErrorMessage(""+c+" "+this.viewer.getShapeErrorState()),this.errorMessageUntranslated=""+c,this.scriptStatusOrBuffer(this.errorMessage),b=!0;else if(Clazz.exceptionOf(c,
J.script.ScriptException)){if(Clazz.instanceOf(c,J.script.ScriptInterruption))return;if(a){this.viewer.setStringProperty("_errormessage",""+c);return}this.setErrorMessage(c.toString());this.errorMessageUntranslated=c.getErrorMessageUntranslated();this.scriptStatusOrBuffer(this.errorMessage);this.viewer.notifyError(null!=this.errorMessage&&0<=this.errorMessage.indexOf("java.lang.OutOfMemoryError")?"Error":"ScriptException",this.errorMessage,this.errorMessageUntranslated);b=!0}else throw c;}if(b||!this.isJS||
!this.allowJSThreads)this.viewer.setTainted(!0),this.viewer.popHoldRepaint("executeCommands "+(0<this.scriptLevel?"\u0001## REPAINT_IGNORE ##":""));this.timeEndExecution=System.currentTimeMillis();null==this.errorMessage&&this.executionStopped?this.setErrorMessage("execution interrupted"):!this.tQuiet&&!this.chk&&this.viewer.scriptStatus("Script completed");this.executing=this.chk=this.isCmdLine_c_or_C_Option=this.historyDisabled=!1;a=this.getErrorMessageUntranslated();this.viewer.setErrorMessage(this.errorMessage,
a);this.tQuiet||this.viewer.setScriptStatus("Jmol script terminated",this.errorMessage,1+this.getExecutionWalltime(),a)},$fz.isPrivate=!0,$fz),"~B");Clazz.overrideMethod(c$,"resumeEval",function(a){this.setErrorMessage(null);this.executionStopped||null==a||!a.mustResumeEval?(this.viewer.setTainted(!0),this.viewer.popHoldRepaint("resumeEval"),this.viewer.queueOnHold=!1):(this.executionPaused||a.pc++,this.thisContext=a,0<a.scriptLevel&&(this.scriptLevel=a.scriptLevel-1),this.restoreScriptContext(a,
!0,!1,!1),this.executeCommands(a.isTryCatch))},"J.script.ScriptContext");Clazz.overrideMethod(c$,"runScript",function(a){this.viewer.isPreviewOnly()||this.runScriptBuffer(a,this.outputBuffer)},"~S");Clazz.overrideMethod(c$,"runScriptBuffer",function(a,b){this.pushContext(null,"runScriptBuffer");this.contextPath+=" >> script() ";this.outputBuffer=b;this.allowJSThreads=!1;this.compileScript(null,a+"\u0001## EDITOR_IGNORE ##\u0001## REPAINT_IGNORE ##",!1)&&this.dispatchCommands(!1,!1);this.popContext(!1,
!1)},"~S,JU.SB");Clazz.overrideMethod(c$,"checkScriptSilent",function(a){a=this.compiler.compile(null,a,!1,!0,!1,!0);if(null!=a.errorType)return a;this.restoreScriptContext(a,!1,!1,!1);this.chk=!0;this.isCmdLine_c_or_C_Option=this.isCmdLine_C_Option=!1;this.pc=0;try{this.dispatchCommands(!1,!1)}catch(b){if(Clazz.exceptionOf(b,J.script.ScriptException))this.setErrorMessage(b.toString()),a=this.getScriptContext("checkScriptSilent");else throw b;}this.chk=!1;return a},"~S");c$.getContextTrace=$_M(c$,
"getContextTrace",function(a,b,c,d){null==c&&(c=new JU.SB);c.append(J.script.ScriptEvaluator.getErrorLineMessage(b.functionName,b.scriptFileName,b.lineNumbers[b.pc],b.pc,J.script.ScriptEvaluator.statementAsString(a,b.statement,d?b.iToken:9999,!1)));null!=b.parentContext&&J.script.ScriptEvaluator.getContextTrace(a,b.parentContext,c,!1);return c},"J.viewer.Viewer,J.script.ScriptContext,JU.SB,~B");Clazz.overrideMethod(c$,"setDebugging",function(){this.logMessages=(this.debugScript=this.viewer.getBoolean(603979824))&&
J.util.Logger.debugging});$_M(c$,"getExecutionWalltime",($fz=function(){return this.timeEndExecution-this.timeBeginExecution},$fz.isPrivate=!0,$fz));Clazz.overrideMethod(c$,"haltExecution",function(){this.resumePausedExecution();this.executionStopped=!0});Clazz.overrideMethod(c$,"pauseExecution",function(a){!this.chk&&!this.viewer.isHeadless()&&(a&&!this.isJS&&this.delayScript(-100),this.viewer.popHoldRepaint("pauseExecution "+a),this.executionStepping=!1,this.executionPaused=!0)},"~B");Clazz.overrideMethod(c$,
"stepPausedExecution",function(){this.executionStepping=!0;this.executionPaused=!1});Clazz.overrideMethod(c$,"resumePausedExecution",function(){this.executionStepping=this.executionPaused=!1});Clazz.overrideMethod(c$,"isExecuting",function(){return this.executing&&!this.executionStopped});Clazz.overrideMethod(c$,"isPaused",function(){return this.executionPaused});Clazz.overrideMethod(c$,"isStepping",function(){return this.executionStepping});Clazz.overrideMethod(c$,"isStopped",function(){return this.executionStopped||
!this.isJS&&this.currentThread!==Thread.currentThread()});Clazz.overrideMethod(c$,"getNextStatement",function(){return this.pc<this.aatoken.length?J.script.ScriptEvaluator.getErrorLineMessage(this.functionName,this.scriptFileName,this.getLinenumber(null),this.pc,J.script.ScriptEvaluator.statementAsString(this.viewer,this.aatoken[this.pc],-9999,this.logMessages)):""});$_M(c$,"getCommand",($fz=function(a,b){if(a>=this.lineIndices.length)return"";if(b){for(var c=-1,d=this.$script.length,e=0;e<this.lineNumbers.length;e++)if(this.lineNumbers[e]==
this.lineNumbers[a])0>c&&(c=this.lineIndices[e][0]),d=this.lineIndices[e][1];else if(0==this.lineNumbers[e]||this.lineNumbers[e]>this.lineNumbers[a])break;d==this.$script.length-1&&this.$script.endsWith("}")&&d++;return c==this.$script.length||d<c?"":this.$script.substring(Math.max(c,0),Math.min(this.$script.length,d))}c=this.lineIndices[a][0];d=this.lineIndices[a][1];e="";if(0>c||d<=c||d>this.$script.length)return"";try{e=this.$script.substring(c,d),0<=e.indexOf("\\\n")&&(e=J.util.Txt.simpleReplace(e,
"\\\n","  ")),0<=e.indexOf("\\\r")&&(e=J.util.Txt.simpleReplace(e,"\\\r","  ")),0<e.length&&!e.endsWith(";")&&(e+=";")}catch(f){if(Clazz.exceptionOf(f,Exception))J.util.Logger.error("darn problem in Eval getCommand: ichBegin="+c+" ichEnd="+d+" len = "+this.$script.length+"\n"+f);else throw f;}return e},$fz.isPrivate=!0,$fz),"~N,~B,~B");$_M(c$,"logDebugScript",($fz=function(a){if(this.logMessages){0<this.st.length&&J.util.Logger.debug(this.st[0].toString());for(var b=1;b<this.slen;++b)J.util.Logger.debug(this.st[b].toString())}this.iToken=
-9999;this.logMessages?(b=new JU.SB,a=0<a?"                          ".substring(0,2*a):"",b.append(a).append(J.script.ScriptEvaluator.statementAsString(this.viewer,this.st,this.iToken,this.logMessages)),this.viewer.scriptStatus(b.toString())):(a=this.getCommand(this.pc,!1,!1),""!==a&&this.viewer.scriptStatus(a))},$fz.isPrivate=!0,$fz),"~N");Clazz.overrideMethod(c$,"evaluateExpression",function(a,b){var c=(new J.script.ScriptEvaluator).setViewer(this.viewer);try{c.pushContext(null,"evalExp"),c.allowJSThreads=
!1}catch(d){if(!Clazz.exceptionOf(d,J.script.ScriptException))throw d;}return c.evaluate(a,b)},"~O,~B");$_M(c$,"evaluate",($fz=function(a,b){try{if(Clazz.instanceOf(a,String)){if(this.compileScript(null,"e_x_p_r_e_s_s_i_o_n = "+a,!1))return this.contextVariables=this.viewer.getContextVariables(),this.setStatement(0),b?this.parameterExpressionList(2,-1,!1).get(0):this.parameterExpressionString(2,0)}else if(Clazz.instanceOf(a,Array)){this.contextVariables=this.viewer.getContextVariables();var c=this.atomExpression(a,
0,0,!0,!1,!0,!1);return b?J.script.SV.newScriptVariableBs(c,-1):c}}catch(d){if(Clazz.exceptionOf(d,Exception))J.util.Logger.error("Error evaluating: "+a+"\n"+d);else throw d;}return b?J.script.SV.getVariable("ERROR"):"ERROR"},$fz.isPrivate=!0,$fz),"~O,~B");Clazz.overrideMethod(c$,"getAtomBitSet",function(a){if(Clazz.instanceOf(a,JU.BS))return a;var b=new JU.BS;try{this.pushContext(null,"getAtomBitSet");var c="select ("+a+")",c=J.util.Txt.replaceAllCharacters(c,"\n\r","),("),c=J.util.Txt.simpleReplace(c,
"()","(none)");this.compileScript(null,c,!1)&&(this.st=this.aatoken[0],b=this.atomExpression(this.st,1,0,!1,!1,!0,!0));this.popContext(!1,!1)}catch(d){if(Clazz.exceptionOf(d,Exception))J.util.Logger.error("getAtomBitSet "+a+"\n"+d);else throw d;}return b},"~O");Clazz.overrideMethod(c$,"getAtomBitSetVector",function(a,b){for(var c=new JU.List,d=this.getAtomBitSet(b),e=d.nextSetBit(0);0<=e;e=d.nextSetBit(e+1))c.addLast(Integer.$valueOf(e));return c},"~N,~O");$_M(c$,"parameterExpressionList",($fz=function(a,
b,c){return this.parameterExpression(a,-1,null,!0,!0,b,c,null,null)},$fz.isPrivate=!0,$fz),"~N,~N,~B");$_M(c$,"parameterExpressionString",($fz=function(a,b){return this.parameterExpression(a,b,"",!0,!1,-1,!1,null,null)},$fz.isPrivate=!0,$fz),"~N,~N");$_M(c$,"parameterExpressionBoolean",($fz=function(a,b){return this.parameterExpression(a,b,null,!0,!1,-1,!1,null,null).booleanValue()},$fz.isPrivate=!0,$fz),"~N,~N");$_M(c$,"parameterExpressionToken",($fz=function(a){a=this.parameterExpressionList(a,
-1,!1);return 0<a.size()?a.get(0):J.script.SV.newVariable(4,"")},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"parameterExpression",($fz=function(a,b,c,d,e,f,g,h,j){var l,k,m=null!=j,s=0>a,w=!e&&null==c;c=!e&&null!=c&&0==c.length;var n=0;s&&(a=-a);var t=0;e=new J.script.ScriptMathProcessor(this,g,e,!1);0==a&&0==b&&(a=2);b<a&&(b=this.slen);g=a;a:for(;g<b;g++){l=null;var r=this.getToken(g).tok;if(m&&1048584!=this.tokAt(g+1)){var u=null!=h&&h.containsKey(this.theToken.value)?null:this.getBitsetPropertySelector(g,
!1);if(null!=u){e.addXVar(h.get(j));e.addOpAllowMath(u,269484048==this.tokAt(g+1))||this.invArg();if((135368713==u.intValue||102436==u.intValue)&&269484048!=this.tokAt(this.iToken+1))e.addOp(J.script.T.tokenLeftParen),e.addOp(J.script.T.tokenRightParen);g=this.iToken;continue}}switch(r){case 1060866:if(1048577==this.tokAt(++g))l=this.parameterExpressionToken(++g),g=this.iToken;else if(2==this.tokAt(g)){l=this.viewer.getAtomBits(1095763969,Integer.$valueOf(this.st[g].intValue));break}else l=this.getParameter(J.script.SV.sValue(this.st[g]),
1073742190);l=this.getParameter(l.asString(),1073742190);break;case 135369225:269484048!=this.getToken(++g).tok&&this.invArg();null==h&&(h=new java.util.Hashtable);k=this.parameterExpression(++g,-1,null,d,!1,-1,!1,h,j);u=k.booleanValue();r=this.iToken;1048591!=this.getToken(r++).tok&&this.invArg();this.parameterExpressionBoolean(r,-1);var q=this.iToken;1048591!=this.tokAt(q++)&&this.invArg();this.parameterExpression(-q,-1,null,d,!1,1,!1,h,j);g=this.iToken;269484049!=this.tokAt(g)&&this.invArg();l=
this.parameterExpression(u?r:q,u?q:g,"XXX",d,!1,1,!1,h,j);break;case 135369224:case 135280132:r=(u=0<a)&&135369224==r;u?((269484048!=this.getToken(++g).tok||!J.script.T.tokAttr(this.getToken(++g).tok,1073741824))&&this.invArg(),q=this.parameterAsString(g),1048591!=this.getToken(++g).tok&&this.invArg()):q="_x";l=this.parameterExpressionToken(-++g).value;Clazz.instanceOf(l,JU.BS)||this.invArg();g=this.iToken;u&&1048591!=this.getToken(g++).tok&&this.invArg();var v=new JU.BS,p=new JU.BS,y=r?Array(J.util.BSUtil.cardinalityOf(l)):
null;null==h&&(h=new java.util.Hashtable);p.set(0);var z=J.script.SV.newScriptVariableBs(p,0);h.put(q,z.setName(q));var B=-1;if(u){B=g-1;k=0;for(var A;0<=k&&++B<b;)269484049==(A=this.tokAt(B))?k--:269484048==A&&k++}var D=0,I=0,E=l.nextSetBit(0);if(0>E)this.iToken=B-1;else if(!this.chk)for(;0<=E;E=l.nextSetBit(E+1))0<=I&&p.clear(I),I=E,p.set(E),z.index=E,k=this.parameterExpression(g,B,r?"XXX":null,d,r,E,!1,h,u?null:q),r?((null==k||0==k.size())&&this.invArg(),y[D++]=k.get(0).asString()):k.booleanValue()&&
v.set(E);if(r)l=y;else if(u)l=v;else return this.bitsetVariableVector(v);g=this.iToken+1;break;case 1048591:break a;case 3:e.addXNum(J.script.SV.newVariable(3,this.theToken.value));break;case 1048614:case 2:e.addXNum(J.script.SV.newScriptVariableInt(this.theToken.intValue));break;case 135266319:if(269484048==this.tokAt(this.iToken+1)){e.addOpAllowMath(this.theToken,!0)||this.invArg();break}e.addXVar(J.script.SV.newScriptVariableToken(this.theToken));break;case 1087375362:case 1087375361:case 1048580:case 1679429641:case 1087373316:case 1048582:case 1087375365:case 1087373318:case 1095766028:case 1095761934:case 1087373320:case 1095761938:case 135267335:case 135267336:case 1238369286:case 1641025539:case 1048589:case 1048588:case 4:case 8:case 9:case 11:case 12:case 10:case 6:e.addXVar(J.script.SV.newScriptVariableToken(this.theToken));
break;case 1048583:this.ignoreError=!0;var F;try{F=this.centerParameter(g),e.addXVar(J.script.SV.newVariable(8,F))}catch(C){if(Clazz.exceptionOf(C,Exception))e.addXStr("");else throw C;}this.ignoreError=!1;g=this.iToken;break;case 1048586:l=4==this.tokAt(g+1)?this.getHash(g):this.getPointOrPlane(g,!1,!0,!0,!1,3,4);g=this.iToken;break;case 1048577:if(1048578==this.tokAt(g+1)){l=new java.util.Hashtable;g++;break}else 1048579==this.tokAt(g+1)&&1048578==this.tokAt(g+2)&&(r=1048579,this.iToken+=2);case 1048579:l=
1048579==r?this.viewer.getModelUndeletedAtomsBitSet(-1):this.atomExpression(this.st,g,0,!0,!0,!0,!0);g=this.iToken;if(0==t&&s)return this.iToken++,this.bitsetVariableVector(l);break;case 1073742195:e.addOp(this.theToken);continue;case 1048578:break a;case 1048590:if(!d&&0==t&&0==n)break a;this.invArg();break;case 269484080:if(!d&&0==t&&0==n)break a;e.addOp(this.theToken)||this.invArg();break;case 1048584:u=this.getBitsetPropertySelector(g+1,!1);null==u&&this.invArg();g=135368713==u.intValue;r=!0;
A=this.tokAt(this.iToken+2);if(1048584==this.tokAt(this.iToken+1))switch(A){case 1048579:A=480,1048584==this.tokAt(this.iToken+3)&&1276118529==this.tokAt(this.iToken+4)&&(A=224);case 32:case 64:case 192:case 128:case 160:case 96:r=g||1276118018==u.intValue||480==A||224==A,u.intValue|=A,this.getToken(this.iToken+2)}r=(new Boolean(r&(269484048==this.tokAt(this.iToken+1)||g))).valueOf();e.addOpAllowMath(u,r)||this.invArg();g=this.iToken;135368713==u.intValue&&269484048!=this.tokAt(g+1)&&(e.addOp(J.script.T.tokenLeftParen),
e.addOp(J.script.T.tokenRightParen));break;default:if(J.script.T.tokAttr(this.theTok,269484032)||J.script.T.tokAttr(this.theTok,135266304)&&269484048==this.tokAt(this.iToken+1)){if(!e.addOp(this.theToken)){if(0<=f)break a;this.invArg()}switch(this.theTok){case 269484048:t++;break;case 269484049:if(0>=--t&&0==n&&s){this.iToken++;break a}break;case 269484096:n++;break;case 269484097:if(0==--n&&0==t&&s){this.iToken++;break a}}}else{u=this.parameterAsString(g).toLowerCase();r=269484048==this.tokAt(g+
1);if(this.chk)l=u;else if(!r&&(null==h||null==(l=h.get(u))))l=this.getContextVariableAsVariable(u);null==l&&(J.script.T.tokAttr(this.theTok,1073741824)&&this.viewer.isFunction(u)?(e.addOp(J.script.SV.newVariable(135368713,this.theToken.value))||this.invArg(),r||(e.addOp(J.script.T.tokenLeftParen),e.addOp(J.script.T.tokenRightParen))):e.addXVar(this.viewer.getOrSetNewVariable(u,!1)))}}null!=l&&(Clazz.instanceOf(l,JU.BS)?e.addXBs(l):e.addXObj(l))}a=e.getResult(!1);null==a&&(this.chk||e.dumpStacks("null result"),
this.error(13));if(135198==a.tok)return a.value;if(w)return Boolean.$valueOf(a.asBoolean());if(c)return 4==a.tok&&(a.intValue=2147483647),a.asString();switch(a.tok){case 1048589:case 1048588:return Boolean.$valueOf(1==a.intValue);case 2:return Integer.$valueOf(a.intValue);default:return a.value}},$fz.isPrivate=!0,$fz),"~N,~N,~S,~B,~B,~N,~B,java.util.Map,~S");$_M(c$,"getHash",($fz=function(a){var b=new java.util.Hashtable;for(a+=1;a<this.slen&&1048590!=this.tokAt(a);a++){var c=this.stringParameter(a++);
269484066!=this.tokAt(a++)&&this.invArg();a=this.parameterExpression(a,0,null,!1,!0,-1,!1,null,null);b.put(c,a.get(0));a=this.iToken;if(269484080!=this.tokAt(a))break}this.iToken=a;1048590!=this.tokAt(a)&&this.invArg();return b},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"bitsetVariableVector",function(a){var b=new JU.List;Clazz.instanceOf(a,JU.BS)&&b.addLast(J.script.SV.newVariable(10,a));return b},"~O");$_M(c$,"getBitsetPropertySelector",($fz=function(a,b){var c=this.getToken(a).tok;switch(c){case 32:case 64:case 96:case 192:case 128:case 160:case 1716520985:break;
default:if(J.script.T.tokAttrOr(c,1078984704,1141899264))break;if(806354977!=c&&!J.script.T.tokAttr(c,1073741824))return null;c=this.parameterAsString(a);if(!b&&this.viewer.isFunction(c)){c=135368713;break}if(!c.endsWith("?"))return null;c=1073741824}return b&&!J.script.T.tokAttr(c,2048)?null:J.script.SV.newScriptVariableIntValue(269484241,c,this.parameterAsString(a).toLowerCase())},$fz.isPrivate=!0,$fz),"~N,~B");$_M(c$,"getBitsetPropertyFloat",function(a,b,c,d){a=this.getBitsetProperty(a,b,null,
null,null,null,!1,2147483647,!1);if(!Float.isNaN(c))for(b=0;b<a.length;b++)a[b]<c&&(a[b]=NaN);if(!Float.isNaN(d))for(b=0;b<a.length;b++)a[b]>d&&(a[b]=NaN);return a},"JU.BS,~N,~N,~N");$_M(c$,"getBitsetProperty",function(a,b,c,d,e,f,g,h,j){var l=2147483647!=h,k=l||!Clazz.instanceOf(e,J.modelset.Bond.BondSet),m=b&480,s=224==m,w=this.viewer.getAtomCount(),n=256==m?Clazz.newFloatArray(w,0):null,t=480==m||s;b&=-481;0==b&&(b=k?1141899265:1678770178);var r=!1,u=!1,q=!1;switch(b){case 1146095626:case 1146095631:case 1146095627:case 1146095629:case 1146093582:case 1766856708:case 1146095628:r=
!0;break;case 135368713:case 1276118018:break;default:u=J.script.T.tokAttr(b,1095761920)&&!J.script.T.tokAttr(b,1112539136),q=!u&&J.script.T.tokAttr(b,1087373312)}var v=r||!k?new JU.P3:null;if(t||q&&!l&&256!=m&&32!=m)m=1048579;var p=1048579==m?new JU.List:null,y=null,z=y=null,B=null,A=null,D=null,I=null;switch(b){case 1141899265:case 1678770178:if(this.chk)return a;y=1141899265==b?k?a:this.viewer.getAtomBits(1678770178,a):k?new J.modelset.Bond.BondSet(this.viewer.getBondsForSelectedAtoms(a)):a;switch(m){case 32:h=
y.nextSetBit(0);break;case 64:h=y.length()-1;break;case 192:case 128:case 160:return Float.$valueOf(NaN);default:return y}y.clearAll();0<=h&&y.set(h);return y;case 1087373321:switch(m){case 0:case 1048579:return this.getExtension().getBitsetIdent(a,null,e,g,h,t)}return"";case 135368713:y=f[0];z=f[1];B=J.util.BSUtil.newBitSet(w);A=J.script.SV.newVariable(10,B);break;case 1112539150:case 1112539151:this.viewer.autoCalculate(b);break;case 1276118018:if(null==c&&null==d)return new JU.P3;break;case 1766856708:D=
new JU.P3;break;case 1716520985:I=this.viewer.getDataFloat(f)}var E=f=0,F=g=0,C=0,H=0;switch(m){case 32:g=2147483647;F=3.4028235E38;break;case 64:g=-2147483648,F=-3.4028235E38}var L=this.viewer.modelSet;e=r?3:q?2:u?1:0;if(k){var D=null!=a,k=-1,x;l?(x=h,w=h+1):D?(x=a.nextSetBit(0),w=Math.min(w,a.length())):x=0;this.chk&&(w=0);for(h=x;0<=h&&h<w;h=D?a.nextSetBit(h+1):h+1){f++;var G=L.atoms[h];switch(e){case 0:x=3.4028235E38;switch(b){case 135368713:B.set(h);x=J.script.SV.fValue(this.runFunctionRet(null,
y,z,A,!0,!0,!1));B.clear(h);break;case 1716520985:x=null==I?0:I[h];break;case 1276118018:x=null!=d?J.util.Measure.distanceToPlane(d,G):G.distance(c);break;default:x=J.modelset.Atom.atomPropertyFloat(this.viewer,G,b)}if(3.4028235E38==x||Float.isNaN(x)&&1048579!=m){f--;continue}switch(m){case 32:x<F&&(F=x);break;case 64:x>F&&(F=x);break;case 256:n[h]=x;break;case 1048579:p.addLast(Float.$valueOf(x));break;case 160:case 192:H+=x*x;default:C+=x}break;case 1:x=0;switch(b){case 1297090050:G.getModelIndex()!=
k&&(k=G.getModelIndex());G=G.getAtomSymmetry();if(null==G)break;var M=0;switch(m){case 32:E=2147483647;break;case 64:E=-2147483648}for(var K=G.nextSetBit(0);0<=K;K=G.nextSetBit(K+1)){x+=K+1;switch(m){case 32:E=Math.min(E,K+1);break;case 64:E=Math.max(E,K+1)}M++}switch(m){case 32:case 64:x=E}f+=M-1;break;case 1095766022:case 1095761925:this.errorStr(45,J.script.T.nameOf(b));break;default:x=J.modelset.Atom.atomPropertyInt(G,b)}switch(m){case 32:x<g&&(g=x);break;case 64:x>g&&(g=x);break;case 256:n[h]=
x;break;case 1048579:p.addLast(Integer.$valueOf(x));break;case 160:case 192:H+=x*x;default:C+=x}break;case 2:x=J.modelset.Atom.atomPropertyString(this.viewer,G,b);switch(m){case 256:n[h]=JU.ParserJS.parseFloat(x);break;default:if(null==p)return x;p.addLast(x)}break;case 3:switch(x=J.modelset.Atom.atomPropertyTuple(G,b),null==x&&this.errorStr(45,J.script.T.nameOf(b)),m){case 256:n[h]=Math.sqrt(x.x*x.x+x.y*x.y+x.z*x.z);break;case 1048579:p.addLast(JU.P3.newP(x));break;default:v.add(x)}}if(l)break}}else{x=
(c=null==a)?0:a.nextSetBit(0);w=this.viewer.getBondCount();for(h=x;0<=h&&h<w;h=c?h+1:a.nextSetBit(h+1))switch(f++,d=L.getBondAt(h),b){case 1141899267:x=d.getAtom1().distance(d.getAtom2());switch(m){case 32:x<F&&(F=x);break;case 64:x>F&&(F=x);break;case 1048579:p.addLast(Float.$valueOf(x));break;case 160:case 192:H+=x*x;default:C+=x}break;case 1146095626:switch(m){case 1048579:v.setT(d.getAtom1());v.add(d.getAtom2());v.scale(0.5);p.addLast(JU.P3.newP(v));break;default:v.add(d.getAtom1()),v.add(d.getAtom2()),
f++}break;case 1766856708:J.util.ColorUtil.colorPointFromInt(this.viewer.getColorArgbOrGray(d.colix),D);switch(m){case 1048579:p.addLast(JU.P3.newP(D));break;default:v.add(D)}break;default:this.errorStr(46,J.script.T.nameOf(b))}}if(256==m)return n;if(1048579==m){if(j)return p;a=p.size();if(q&&!t&&1==a)return p.get(0);if(s){n=Clazz.newFloatArray(a,0);for(h=a;0<=--h;)switch(b=p.get(h),e){case 0:n[h]=b.floatValue();break;case 1:n[h]=b.floatValue();break;case 2:n[h]=JU.ParserJS.parseFloat(b);break;case 3:n[h]=
b.length()}return n}if(1087373320==b){n=new JU.SB;for(h=0;h<a;h++)n.append(p.get(h));return n.toString()}n=Array(a);for(h=a;0<=--h;)b=p.get(h),n[h]=Clazz.instanceOf(b,JU.P3)?J.util.Escape.eP(b):""+p.get(h);return n}if(r)return 0==f?v:JU.P3.new3(v.x/f,v.y/f,v.z/f);if(0==f||1==f&&192==m)return Float.$valueOf(NaN);if(u)switch(m){case 32:case 64:return Integer.$valueOf(g);case 160:case 192:break;case 128:return Integer.$valueOf(Clazz.doubleToInt(C));default:return C/f==Clazz.doubleToInt(C/f)?Integer.$valueOf(Clazz.doubleToInt(C/
f)):Float.$valueOf(C/f)}switch(m){case 32:case 64:C=F;break;case 128:break;case 160:C=H;break;case 192:C=Math.sqrt((H-C*C/f)/(f-1));break;default:C/=f}return Float.$valueOf(C)},"JU.BS,~N,JU.P3,JU.P4,~O,~O,~B,~N,~B");$_M(c$,"setBitsetProperty",($fz=function(a,b,c,d,e){if(!(this.chk||0==J.util.BSUtil.cardinalityOf(a))){var f=null,g=null,h=null,j,l=null;j=0;var k=J.script.T.tokAttr(b,1087373312);if(7==e.tok&&(l=e.getList(),0==(j=l.size())))return;switch(b){case 1146095626:case 1146095627:case 1146095629:case 1146095631:switch(e.tok){case 8:this.viewer.setAtomCoords(a,
b,e.value);break;case 7:this.theToken=e,this.viewer.setAtomCoords(a,b,this.getPointArray(-1,j))}return;case 1766856708:var m=null;b="color";switch(e.tok){case 7:e=Clazz.newIntArray(j,0);for(m=j;0<=--m;)b=l.get(m),j=J.script.SV.ptValue(b),null!=j?e[m]=J.util.ColorUtil.colorPtToInt(j):2==b.tok?e[m]=b.intValue:(e[m]=J.util.ColorUtil.getArgbFromString(b.asString()),0==e[m]&&(e[m]=b.asInt())),0==e[m]&&this.errorStr2(50,"ARRAY",b.asString());m=e;b="colorValues";break;case 8:m=Integer.$valueOf(J.util.ColorUtil.colorPtToInt(e.value));
break;case 4:m=e.value;break;default:m=Integer.$valueOf(J.script.SV.iValue(e))}this.setShapePropertyBs(0,b,m,a);return;case 1826248715:case 1288701960:7!=e.tok&&(g=J.script.SV.sValue(e));break;case 1087375365:case 1095763976:this.clearDefinedVariableAtomSets(),k=!1}switch(e.tok){case 7:k?f=J.script.SV.listValue(e):h=J.script.SV.flistValue(e,j);break;case 4:null==g&&(f=JU.ParserJS.getTokens(J.script.SV.sValue(e)))}if(null!=f){j=f.length;if(!k){h=Clazz.newFloatArray(j,0);for(m=j;0<=--m;)h[m]=1087375365==
b?J.util.Elements.elementNumberFromSymbol(f[m],!1):JU.ParserJS.parseFloat(f[m])}7!=e.tok&&1==j&&(k?g=f[0]:d=h[0],c=Clazz.floatToInt(d),h=f=null)}this.viewer.setAtomProperty(a,b,c,d,g,h,f)}},$fz.isPrivate=!0,$fz),"JU.BS,~N,~N,~N,J.script.T");Clazz.overrideMethod(c$,"getDefinedAtomSets",function(){return this.definedAtomSets});Clazz.overrideMethod(c$,"getContextVariables",function(){return this.contextVariables});Clazz.overrideMethod(c$,"getScript",function(){return this.$script});$_M(c$,"compileScript",
function(a,b,c){this.scriptFileName=a;b=this.fixScriptPath(b,a);this.restoreScriptContext(this.compiler.compile(a,b,!1,!1,c,!1),!1,!1,!1);this.forceNoAddHydrogens=(this.isStateScript=0<=this.$script.indexOf("# Jmol state version "))&&0>this.$script.indexOf("pdbAddHydrogens");a=this.$script;this.pc=this.setScriptExtensions();!this.chk&&(this.viewer.scriptEditorVisible&&0>b.indexOf("\u0001## EDITOR_IGNORE ##"))&&this.viewer.scriptStatus("");this.$script=a;return!this.$error},"~S,~S,~B");$_M(c$,"fixScriptPath",
($fz=function(a,b){if(null!=b&&0<=a.indexOf("$SCRIPT_PATH$")){var c=b,d=Math.max(b.lastIndexOf("|"),b.lastIndexOf("/")),c=c.substring(0,d+1);a=J.util.Txt.simpleReplace(a,"$SCRIPT_PATH$/",c);a=J.util.Txt.simpleReplace(a,"$SCRIPT_PATH$",c)}return a},$fz.isPrivate=!0,$fz),"~S,~S");$_M(c$,"setScriptExtensions",($fz=function(){var a=this.scriptExtensions;if(null==a)return 0;var b=a.indexOf("##SCRIPT_STEP");0<=b&&(this.executionStepping=!0);b=a.indexOf("##SCRIPT_START=");if(0>b)return 0;b=JU.ParserJS.parseInt(a.substring(b+
15));if(-2147483648==b)return 0;for(this.pc=0;this.pc<this.lineIndices.length&&!(this.lineIndices[this.pc][0]>b||this.lineIndices[this.pc][1]>=b);this.pc++);0<this.pc&&(this.pc<this.lineIndices.length&&this.lineIndices[this.pc][0]>b)&&--this.pc;return this.pc},$fz.isPrivate=!0,$fz));$_M(c$,"compileScriptFileInternal",($fz=function(a,b,c,d){if(0==a.toLowerCase().indexOf("javascript:"))return this.compileScript(a,this.viewer.jsEval(a.substring(11)),this.debugScript);var e=Array(2);e[0]=a;if(!this.viewer.getFileAsStringBin(e))return this.setErrorMessage("io error reading "+
e[0]+": "+e[1]),!1;if(0<=("\n"+e[1]).indexOf("\nJmolManifest.txt\n")){var f;if(a.endsWith(".all.pngj")||a.endsWith(".all.png"))f="|state.spt",a+="|";else{e[0]=a+="|JmolManifest.txt";if(!this.viewer.getFileAsStringBin(e))return this.setErrorMessage("io error reading "+e[0]+": "+e[1]),!1;f=J.io.JmolBinary.getManifestScriptPath(e[1])}if(null!=f&&0<f.length&&(e[0]=a=a.substring(0,a.lastIndexOf("|"))+f,!this.viewer.getFileAsStringBin(e)))return this.setErrorMessage("io error reading "+e[0]+": "+e[1]),
!1}this.scriptFileName=a;e[1]=J.io.JmolBinary.getEmbeddedScript(e[1]);e=this.fixScriptPath(e[1],e[0]);null==d&&(d=this.viewer.getFilePath(a,!1),d=d.substring(0,Math.max(d.lastIndexOf("|"),d.lastIndexOf("/"))));e=J.viewer.FileManager.setScriptFileReferences(e,b,c,d);return this.compileScript(a,e,this.debugScript)},$fz.isPrivate=!0,$fz),"~S,~S,~S,~S");$_M(c$,"getParameter",function(a,b){var c=this.getContextVariableAsVariable(a);null==c&&(c=this.viewer.getParameter(a));switch(b){case 1073742190:return J.script.SV.getVariable(c);
case 4:if(!Clazz.instanceOf(c,JU.List))break;for(var d=new JU.SB,e=0;e<c.size();e++)d.append(c.get(e).asString()).appendC("\n");return d.toString()}return Clazz.instanceOf(c,J.script.SV)?J.script.SV.oValue(c):c},"~S,~N");$_M(c$,"getStringParameter",($fz=function(a,b){var c=this.getContextVariableAsVariable(a);if(null!=c)return c.asString();c=""+this.viewer.getParameter(a);return 0==c.length&&b?a:c},$fz.isPrivate=!0,$fz),"~S,~B");$_M(c$,"getNumericParameter",($fz=function(a){if(a.equalsIgnoreCase("_modelNumber"))return a=
this.viewer.getCurrentModelIndex(),Integer.$valueOf(0>a?0:this.viewer.getModelFileNumber(a));var b=this.getContextVariableAsVariable(a);if(null==b){a=this.viewer.getParameter(a);if(!Clazz.instanceOf(a,String))return a;b=J.script.SV.newVariable(4,a)}return J.script.SV.nValue(b)},$fz.isPrivate=!0,$fz),"~S");$_M(c$,"getContextVariableAsVariable",function(a){if(a.equals("expressionBegin"))return null;a=a.toLowerCase();if(null!=this.contextVariables&&this.contextVariables.containsKey(a))return this.contextVariables.get(a);
for(var b=this.thisContext;null!=b&&!0!=b.isFunction;){if(null!=b.contextVariables&&b.contextVariables.containsKey(a))return b.contextVariables.get(a);b=b.parentContext}return null},"~S");$_M(c$,"getStringObjectAsVariable",($fz=function(a,b){if(null==a||0==a.length)return a;var c=J.script.SV.unescapePointOrBitsetAsVariable(a);Clazz.instanceOf(c,String)&&null!=b&&(c=this.viewer.setUserVariable(b,J.script.SV.newVariable(4,c)));return c},$fz.isPrivate=!0,$fz),"~S,~S");Clazz.overrideMethod(c$,"evalFunctionFloat",
function(a,b,c){try{for(var d=0;d<c.length;d++)b.get(d).value=Float.$valueOf(c[d]);return J.script.SV.fValue(this.runFunctionRet(a,a.name,b,null,!0,!1,!1))}catch(e){if(Clazz.exceptionOf(e,Exception))return NaN;throw e;}},"~O,~O,~A");$_M(c$,"runFunctionRet",function(a,b,c,d,e,f,g){if(null==a){a=this.viewer.getFunction(b);if(null==a)return null;f&&(this.contextPath+=" >> function "+b)}else f&&(this.contextPath+=" >> "+b);this.pushContext(null,"funcRet");this.allowJSThreads&&(this.allowJSThreads=g);
f=364558==a.getTok();this.thisContext.isTryCatch=f;this.thisContext.isFunction=!f;this.functionName=b;if(f){this.viewer.resetError();this.thisContext.displayLoadErrorsSave=this.viewer.displayLoadErrors;this.thisContext.tryPt=($t$=++J.script.ScriptEvaluator.tryPt,J.script.ScriptEvaluator.prototype.tryPt=J.script.ScriptEvaluator.tryPt,$t$);this.viewer.displayLoadErrors=!1;this.restoreFunction(a,c,d);this.contextVariables.put("_breakval",J.script.SV.newScriptVariableInt(2147483647));this.contextVariables.put("_errorval",
J.script.SV.newVariable(4,""));a=this.contextVariables;for(this.executeCommands(!0);this.thisContext.tryPt>J.script.ScriptEvaluator.tryPt;)this.popContext(!1,!1);this.processTry(a);return null}Clazz.instanceOf(a,J.api.JmolParallelProcessor)?(this.parallelProcessor=a,this.restoreFunction(a,c,d),this.dispatchCommands(!1,!0),a.runAllProcesses(this.viewer)):(this.restoreFunction(a,c,d),this.dispatchCommands(!1,!0));a=e?this.getContextVariableAsVariable("_retval"):null;this.popContext(!1,!1);return a},
"J.api.JmolScriptFunction,~S,JU.List,J.script.SV,~B,~B,~B");$_M(c$,"processTry",($fz=function(a){this.viewer.displayLoadErrors=this.thisContext.displayLoadErrorsSave;this.popContext(!1,!1);var b=this.viewer.getParameter("_errormessage");0<b.length&&(a.put("_errorval",J.script.SV.newVariable(4,b)),this.viewer.resetError());a.put("_tryret",a.get("_retval"));b=a.get("_tryret");if(null!=b.value||2147483647!=b.intValue)this.returnCmd(b);else{b=a.get("_errorval").value;if(0==b.length&&(a=a.get("_breakval").intValue,
2147483647!=a)){this.breakCmd(this.pc-a);return}this.pc+1<this.aatoken.length&&102412==this.aatoken[this.pc+1][0].tok&&(a=this.aatoken[this.pc+1][0],null!=a.contextVariables&&null!=a.name0&&a.contextVariables.put(a.name0,J.script.SV.newVariable(4,b)),a.intValue=(0<b.length?1:-1)*Math.abs(a.intValue))}},$fz.isPrivate=!0,$fz),"java.util.Map");$_M(c$,"restoreFunction",($fz=function(a,b,c){this.aatoken=a.aatoken;this.lineNumbers=a.lineNumbers;this.lineIndices=a.lineIndices;this.$script=a.script;this.pc=
0;null!=a.names&&(this.contextVariables=new java.util.Hashtable,a.setVariables(this.contextVariables,b));null!=c&&this.contextVariables.put("_x",c)},$fz.isPrivate=!0,$fz),"J.api.JmolScriptFunction,JU.List,J.script.SV");$_M(c$,"clearDefinedVariableAtomSets",function(){this.definedAtomSets.remove("# variable")});$_M(c$,"defineSets",($fz=function(){if(!this.definedAtomSets.containsKey("# static")){for(var a=0;a<J.viewer.JC.predefinedStatic.length;a++)this.defineAtomSet(J.viewer.JC.predefinedStatic[a]);
this.defineAtomSet("# static")}if(!this.definedAtomSets.containsKey("# variable")){for(a=0;a<J.viewer.JC.predefinedVariable.length;a++)this.defineAtomSet(J.viewer.JC.predefinedVariable[a]);for(a=J.util.Elements.elementNumberMax;0<=--a;){var b=" elemno="+a;this.defineAtomSet("@"+J.util.Elements.elementNameFromNumber(a)+b);this.defineAtomSet("@_"+J.util.Elements.elementSymbolFromNumber(a)+b)}for(a=4;0<=--a;)b="@"+J.util.Elements.altElementNameFromIndex(a)+" _e="+J.util.Elements.altElementNumberFromIndex(a),
this.defineAtomSet(b);for(a=J.util.Elements.altElementMax;4<=--a;){var c=J.util.Elements.altElementNumberFromIndex(a),d=" _e="+c,b="@_"+J.util.Elements.altElementSymbolFromIndex(a);this.defineAtomSet(b+d);b="@_"+J.util.Elements.altIsotopeSymbolFromIndex(a);this.defineAtomSet(b+d);b="@_"+J.util.Elements.altIsotopeSymbolFromIndex2(a);this.defineAtomSet(b+d);b="@"+J.util.Elements.altElementNameFromIndex(a);1<b.length&&this.defineAtomSet(b+d);b=J.util.Elements.getElementNumber(c);c=J.util.Elements.getNaturalIsotope(b);
0<c&&(d=J.util.Elements.elementSymbolFromNumber(b),this.defineAtomSet("@_"+d+c+" _e="+b),this.defineAtomSet("@_"+c+d+" _e="+b))}this.defineAtomSet("# variable")}},$fz.isPrivate=!0,$fz));$_M(c$,"defineAtomSet",($fz=function(a){if(0==a.indexOf("#"))this.definedAtomSets.put(a,Boolean.TRUE);else{var b=this.compiler.compile("#predefine",a,!0,!1,!1,!1);if(null!=b.errorType)this.viewer.scriptStatus("JmolConstants.java ERROR: predefined set compile error:"+a+"\ncompile error:"+b.errorMessageUntranslated);
else if(1!=b.aatoken.length)this.viewer.scriptStatus("JmolConstants.java ERROR: predefinition does not have exactly 1 command:"+a);else if(b=b.aatoken[0],2>=b.length)this.viewer.scriptStatus("JmolConstants.java ERROR: bad predefinition length:"+a);else{var c=b[1].tok;!J.script.T.tokAttr(c,1073741824)&&!J.script.T.tokAttr(c,3145728)?this.viewer.scriptStatus("JmolConstants.java ERROR: invalid variable name:"+a):(a=b[1].value.toLowerCase(),a.startsWith("dynamic_")&&(a="!"+a.substring(8)),this.definedAtomSets.put(a,
b))}}},$fz.isPrivate=!0,$fz),"~S");$_M(c$,"lookupIdentifierValue",function(a){var b=this.lookupValue(a,!1);if(null!=b)return J.util.BSUtil.copy(b);b=this.getAtomBits(1073741824,a);return null==b?new JU.BS:b},"~S");$_M(c$,"lookupValue",($fz=function(a,b){if(this.chk)return new JU.BS;this.defineSets();a=a.toLowerCase();var c=this.definedAtomSets.get(a),d=!1;null==c&&(c=this.definedAtomSets.get("!"+a),d=null!=c);if(Clazz.instanceOf(c,JU.BS))return c;if(Clazz.instanceOf(c,Array))return this.pushContext(null,
"lookupValue"),c=this.atomExpression(c,-2,0,!0,!1,!0,!0),this.popContext(!1,!1),d||this.definedAtomSets.put(a,c),c;if(b)return null;d=a.length;if(5>d||"s"!=a.charAt(d-1))return null;a=a.endsWith("ies")?a.substring(0,d-3)+"y":a.substring(0,d-1);return this.lookupValue(a,!0)},$fz.isPrivate=!0,$fz),"~S,~B");Clazz.overrideMethod(c$,"deleteAtomsInVariables",function(a){for(var b,c=this.definedAtomSets.entrySet().iterator();c.hasNext()&&((b=c.next())||1);){var d=b.getValue();Clazz.instanceOf(d,JU.BS)&&
(J.util.BSUtil.deleteBits(d,a),b.getKey().startsWith("!")||this.viewer.setUserVariable("@"+b.getKey(),J.script.SV.newVariable(10,d)))}},"JU.BS");$_M(c$,"setStatement",($fz=function(a){this.st=this.aatoken[a];this.slen=this.st.length;if(0==this.slen)return!0;var b,c;for(b=1;b<this.slen;b++){if(null==this.st[b])return this.slen=b,!0;if(1060866==this.st[b].tok)break}if(b==this.slen)return b==this.slen;switch(this.st[0].tok){case 102436:case 135368713:case 1073741824:if(269484048==this.tokAt(1))return!0}a=
Array(this.slen);a[0]=this.st[0];var d=!1,e=1;for(b=1;b<this.slen;b++)if(null!=this.st[b]){switch(c=this.getToken(b).tok){default:a[e]=this.st[b];break;case 1048577:case 1048578:d=1048577==c;a[e]=this.st[b];break;case 1060866:++b==this.slen&&this.invArg();var f,g=4==this.theToken.intValue,h;h=this.parameterAsString(b);var j=1048577==this.tokAt(b),l=1==e&&this.st[0]===J.script.T.tokenSetCmd;j?(f=this.parameterExpressionToken(++b),b=this.iToken,f=7==f.tok?f:J.script.SV.oValue(f)):(f=2==this.tokAt(b)?
this.viewer.getAtomBits(1095763969,Integer.$valueOf(this.st[b].intValue)):this.getParameter(h,0),!d&&!l&&(j=!0));c=this.tokAt(0);g=(new Boolean(g|(J.script.T.tokAttr(c,20480)||135271429==c))).valueOf();if(Clazz.instanceOf(f,J.script.SV))a[e]=f,d&&7==a[e].tok&&(g=J.script.SV.getBitSet(f,!0),a[e]=J.script.SV.newVariable(10,null==g?this.getAtomBitSet(J.script.SV.sValue(a[e])):g));else if(Clazz.instanceOf(f,Boolean))a[e]=f.booleanValue()?J.script.T.tokenOn:J.script.T.tokenOff;else if(Clazz.instanceOf(f,
Integer))a[e]=J.script.T.tv(2,f.intValue(),f);else if(Clazz.instanceOf(f,Float))a[e]=J.script.T.tv(3,J.script.ScriptEvaluator.getFloatEncodedInt(""+f),f);else if(Clazz.instanceOf(f,String)){if(!g){if((1085443!=c||1<e&&537022465!=this.st[1].tok)&&J.script.T.tokAttr(c,36864))f=this.getParameter(f,1073742190);Clazz.instanceOf(f,String)&&(f=this.getStringObjectAsVariable(f,null))}Clazz.instanceOf(f,J.script.SV)?a[e]=f:(h=f,d&&!g?a[e]=J.script.T.o(10,this.getAtomBitSet(h)):(c=l?J.script.T.getTokFromName(h):
j||g||0==h.length||0<=h.indexOf(".")||0<=h.indexOf(" ")||0<=h.indexOf("=")||0<=h.indexOf(";")||0<=h.indexOf("[")||0<=h.indexOf("{")?4:1073741824,a[e]=J.script.T.o(c,f)))}else if(Clazz.instanceOf(f,JU.BS))a[e]=J.script.SV.newVariable(10,f);else if(Clazz.instanceOf(f,JU.P3))a[e]=J.script.SV.newVariable(8,f);else if(Clazz.instanceOf(f,JU.P4))a[e]=J.script.SV.newVariable(9,f);else if(Clazz.instanceOf(f,JU.M3))a[e]=J.script.SV.newVariable(11,f);else if(Clazz.instanceOf(f,JU.M4))a[e]=J.script.SV.newVariable(12,
f);else if(Clazz.instanceOf(f,java.util.Map))a[e]=J.script.SV.newVariable(6,f);else if(Clazz.instanceOf(f,JU.List)){j=f;g=null;for(h=0;h<j.size();h++){c=j.get(h);if(10!=c.tok){g=null;break}null==g&&(g=new JU.BS);g.or(c.value)}a[e]=null==g?J.script.SV.getVariable(f):J.script.T.o(10,g)}else f=this.getObjectCenter(h,-2147483648,-2147483648),null==f&&this.invArg(),a[e]=J.script.T.o(8,f);l&&!J.script.T.tokAttr(a[e].tok,536870912)&&this.invArg()}e++}this.st=a;for(b=e;b<this.st.length;b++)this.st[b]=null;
this.slen=e;return!0},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"clearState",($fz=function(a){this.thisContext=null;this.scriptLevel=0;this.setErrorMessage(null);this.contextPath="";this.tQuiet=a},$fz.isPrivate=!0,$fz),"~B");Clazz.overrideMethod(c$,"getThisContext",function(){return this.thisContext});Clazz.overrideMethod(c$,"pushContextDown",function(a){this.scriptLevel--;this.pushContext2(null,a)},"~S");$_M(c$,"pushContext",($fz=function(a,b){100==this.scriptLevel&&this.error(44);this.pushContext2(a,b)},
$fz.isPrivate=!0,$fz),"J.script.ContextToken,~S");$_M(c$,"pushContext2",($fz=function(a,b){this.thisContext=this.getScriptContext(b);this.thisContext.token=a;if(null==a)this.scriptLevel=++this.thisContext.scriptLevel;else if(this.thisContext.scriptLevel=-1,this.contextVariables=new java.util.Hashtable,null!=a.contextVariables)for(var c,d=a.contextVariables.keySet().iterator();d.hasNext()&&((c=d.next())||1);)J.script.ScriptCompiler.addContextVariable(this.contextVariables,c);(this.debugScript||this.isCmdLine_c_or_C_Option)&&
J.util.Logger.info("--\x3e>-------------".substring(0,Math.max(17,this.scriptLevel+5))+this.scriptLevel+" "+this.scriptFileName+" "+a+" "+this.thisContext.id)},$fz.isPrivate=!0,$fz),"J.script.ContextToken,~S");Clazz.overrideMethod(c$,"getScriptContext",function(a){var b=new J.script.ScriptContext;this.debugScript&&J.util.Logger.info("creating context "+b.id+" for "+a);b.scriptLevel=this.scriptLevel;b.parentContext=this.thisContext;b.contextPath=this.contextPath;b.scriptFileName=this.scriptFileName;
b.parallelProcessor=this.parallelProcessor;b.functionName=this.functionName;b.script=this.$script;b.lineNumbers=this.lineNumbers;b.lineIndices=this.lineIndices;b.aatoken=this.aatoken;b.statement=this.st;b.statementLength=this.slen;b.pc=this.pc;b.lineEnd=this.lineEnd;b.pcEnd=this.pcEnd;b.iToken=this.iToken;b.outputBuffer=this.outputBuffer;b.contextVariables=this.contextVariables;b.isStateScript=this.isStateScript;b.errorMessage=this.errorMessage;b.errorType=this.errorType;b.iCommandError=this.iCommandError;
b.chk=this.chk;b.executionStepping=this.executionStepping;b.executionPaused=this.executionPaused;b.scriptExtensions=this.scriptExtensions;b.mustResumeEval=this.mustResumeEval;b.allowJSThreads=this.allowJSThreads;return b},"~S");$_M(c$,"popContext",function(a,b){if(null!=this.thisContext){0<this.thisContext.scriptLevel&&(this.scriptLevel=this.thisContext.scriptLevel-1);var c=a?this.getScriptContext("popFlow"):null;this.restoreScriptContext(this.thisContext,!0,a,b);null!=c&&this.restoreScriptContext(c,
!0,!1,!0);if(this.debugScript||this.isCmdLine_c_or_C_Option)J.util.Logger.info("--<<-------------".substring(0,Math.max(17,this.scriptLevel+5))+this.scriptLevel+" "+this.scriptFileName+" "+(null==this.thisContext?"":""+this.thisContext.id))}},"~B,~B");$_M(c$,"restoreScriptContext",function(a,b,c,d){this.executing=!this.chk;if(null!=a){(this.debugScript||this.isCmdLine_c_or_C_Option)&&J.util.Logger.info("--<<-------------".substring(0,Math.max(17,this.scriptLevel+5))+this.scriptLevel+" "+this.scriptFileName+
" isPop "+b+" "+a.id);if(!c&&(this.st=a.statement,this.slen=a.statementLength,this.pc=a.pc,this.lineEnd=a.lineEnd,this.pcEnd=a.pcEnd,d))return;this.mustResumeEval=a.mustResumeEval;this.$script=a.script;this.lineNumbers=a.lineNumbers;this.lineIndices=a.lineIndices;this.aatoken=a.aatoken;this.contextVariables=a.contextVariables;this.scriptExtensions=a.scriptExtensions;b?(this.contextPath=a.contextPath,this.scriptFileName=a.scriptFileName,this.parallelProcessor=a.parallelProcessor,this.functionName=
a.functionName,this.iToken=a.iToken,this.outputBuffer=a.outputBuffer,this.isStateScript=a.isStateScript,this.thisContext=a.parentContext,this.allowJSThreads=a.allowJSThreads):(this.$error=null!=a.errorType,this.errorMessage=a.errorMessage,this.errorMessageUntranslated=a.errorMessageUntranslated,this.iCommandError=a.iCommandError,this.errorType=a.errorType)}},"J.script.ScriptContext,~B,~B,~B");$_M(c$,"getLinenumber",function(a){return null==a?this.lineNumbers[this.pc]:a.lineNumbers[a.pc]},"J.script.ScriptContext");
Clazz.overrideMethod(c$,"setException",function(a,b,c){a.untranslated=null==c?b:c;this.errorType=b;this.iCommandError=this.pc;if(null==a.message)a.message="";else{for(c=J.script.ScriptEvaluator.getContextTrace(this.viewer,this.getScriptContext("setException"),null,!0).toString();null!=this.thisContext&&!this.thisContext.isTryCatch;)this.popContext(!1,!1);a.message+=c;a.untranslated+=c;null!=this.thisContext||(this.chk||0<=b.indexOf("NOTE: file recognized as a script file: "))||(J.util.Logger.error("eval ERROR: "+
this.toString()),this.viewer.autoExit&&this.viewer.exitJmol())}},"J.script.ScriptException,~S,~S");Clazz.overrideMethod(c$,"getErrorMessage",function(){return this.errorMessage});Clazz.overrideMethod(c$,"getErrorMessageUntranslated",function(){return null==this.errorMessageUntranslated?this.errorMessage:this.errorMessageUntranslated});$_M(c$,"setErrorMessage",($fz=function(a){this.errorMessageUntranslated=null;null==a?(this.$error=!1,this.errorMessage=this.errorType=null,this.iCommandError=-1):(this.$error=
!0,null==this.errorMessage&&(this.errorMessage=J.i18n.GT._("script ERROR: ")),this.errorMessage+=a)},$fz.isPrivate=!0,$fz),"~S");$_M(c$,"planeExpected",($fz=function(){this.errorMore(38,"{a b c d}",'"xy" "xz" "yz" "x=..." "y=..." "z=..."',"$xxxxx")},$fz.isPrivate=!0,$fz));$_M(c$,"integerOutOfRange",function(a,b){this.errorStr2(21,""+a,""+b)},"~N,~N");$_M(c$,"numberOutOfRange",($fz=function(a,b){this.errorStr2(36,""+a,""+b)},$fz.isPrivate=!0,$fz),"~N,~N");$_M(c$,"errorAt",function(a,b){this.iToken=
b;this.errorOrWarn(a,null,null,null,!1)},"~N,~N");$_M(c$,"invArg",($fz=function(){this.error(22)},$fz.isPrivate=!0,$fz));$_M(c$,"error",function(a){this.errorOrWarn(a,null,null,null,!1)},"~N");$_M(c$,"errorStr",function(a,b){this.errorOrWarn(a,b,null,null,!1)},"~N,~S");$_M(c$,"errorStr2",function(a,b,c){this.errorOrWarn(a,b,c,null,!1)},"~N,~S,~S");$_M(c$,"errorMore",function(a,b,c,d){this.errorOrWarn(a,b,c,d,!1)},"~N,~S,~S,~S");$_M(c$,"warning",($fz=function(a,b,c){this.errorOrWarn(a,b,c,null,!0)},
$fz.isPrivate=!0,$fz),"~N,~S,~S");$_M(c$,"errorOrWarn",function(a,b,c,d,e){var f=this.ignoreError?null:J.script.ScriptEvaluator.errorString(a,b,c,d,!0);a=!this.ignoreError&&J.i18n.GT.getDoTranslate()?J.script.ScriptEvaluator.errorString(a,b,c,d,!1):null;e||this.evalError(f,a);this.showString(f)},"~N,~S,~S,~S,~B");$_M(c$,"evalError",function(a,b){if(this.ignoreError)throw new NullPointerException;this.chk||(this.setCursorWait(!1),this.viewer.setBooleanProperty("refreshing",!0),this.viewer.setStringProperty("_errormessage",
b));throw new J.script.ScriptException(this,a,b,!0);},"~S,~S");c$.errorString=$_M(c$,"errorString",function(a,b,c,d,e){d=!1;!e&&!0==(d=J.i18n.GT.getDoTranslate())&&J.i18n.GT.setDoTranslate(!1);switch(a){default:a="Unknown error message number: "+a;break;case 0:a=J.i18n.GT._("x y z axis expected");break;case 1:a=J.i18n.GT._("{0} not allowed with background model displayed");break;case 2:a=J.i18n.GT._("bad argument count");break;case 3:a=J.i18n.GT._("Miller indices cannot all be zero.");break;case 4:a=
J.i18n.GT._("bad [R,G,B] color");break;case 5:a=J.i18n.GT._("boolean expected");break;case 6:a=J.i18n.GT._("boolean or number expected");break;case 7:a=J.i18n.GT._("boolean, number, or {0} expected");break;case 56:a=J.i18n.GT._("cannot set value");break;case 8:a=J.i18n.GT._("color expected");break;case 9:a=J.i18n.GT._("a color or palette name (Jmol, Rasmol) is required");break;case 10:a=J.i18n.GT._("command expected");break;case 11:a=J.i18n.GT._("{x y z} or $name or (atom expression) required");break;
case 12:a=J.i18n.GT._("draw object not defined");break;case 13:a=J.i18n.GT._("unexpected end of script command");break;case 14:a=J.i18n.GT._("valid (atom expression) expected");break;case 15:a=J.i18n.GT._("(atom expression) or integer expected");break;case 16:a=J.i18n.GT._("filename expected");break;case 17:a=J.i18n.GT._("file not found");break;case 18:a=J.i18n.GT._("incompatible arguments");break;case 19:a=J.i18n.GT._("insufficient arguments");break;case 20:a=J.i18n.GT._("integer expected");break;
case 21:a=J.i18n.GT._("integer out of range ({0} - {1})");break;case 22:a=J.i18n.GT._("invalid argument");break;case 23:a=J.i18n.GT._("invalid parameter order");break;case 24:a=J.i18n.GT._("keyword expected");break;case 25:a=J.i18n.GT._("no MO coefficient data available");break;case 26:a=J.i18n.GT._("An MO index from 1 to {0} is required");break;case 27:a=J.i18n.GT._("no MO basis/coefficient data available for this frame");break;case 28:a=J.i18n.GT._("no MO occupancy data available");break;case 29:a=
J.i18n.GT._("Only one molecular orbital is available in this file");break;case 30:a=J.i18n.GT._("{0} require that only one model be displayed");break;case 55:a=J.i18n.GT._("{0} requires that only one model be loaded");break;case 31:a=J.i18n.GT._("No data available");break;case 32:a=J.i18n.GT._("No partial charges were read from the file; Jmol needs these to render the MEP data.");break;case 33:a=J.i18n.GT._("No unit cell");break;case 34:a=J.i18n.GT._("number expected");break;case 35:a=J.i18n.GT._("number must be ({0} or {1})");
break;case 36:a=J.i18n.GT._("decimal number out of range ({0} - {1})");break;case 37:a=J.i18n.GT._("object name expected after '$'");break;case 38:a=J.i18n.GT._("plane expected -- either three points or atom expressions or {0} or {1} or {2}");break;case 39:a=J.i18n.GT._("property name expected");break;case 40:a=J.i18n.GT._("space group {0} was not found.");break;case 41:a=J.i18n.GT._("quoted string expected");break;case 42:a=J.i18n.GT._("quoted string or identifier expected");break;case 43:a=J.i18n.GT._("too many rotation points were specified");
break;case 44:a=J.i18n.GT._("too many script levels");break;case 45:a=J.i18n.GT._("unrecognized atom property");break;case 46:a=J.i18n.GT._("unrecognized bond property");break;case 47:a=J.i18n.GT._("unrecognized command");break;case 48:a=J.i18n.GT._("runtime unrecognized expression");break;case 49:a=J.i18n.GT._("unrecognized object");break;case 50:a=J.i18n.GT._("unrecognized {0} parameter");break;case 51:a=J.i18n.GT._("unrecognized {0} parameter in Jmol state script (set anyway)");break;case 52:a=
J.i18n.GT._("unrecognized SHOW parameter --  use {0}");break;case 53:a="{0}";break;case 54:a=J.i18n.GT._('write what? {0} or {1} "filename"')}0>a.indexOf("{0}")?null!=b&&(a+=": "+b):(a=J.util.Txt.simpleReplace(a,"{0}",b),0<=a.indexOf("{1}")?a=J.util.Txt.simpleReplace(a,"{1}",c):null!=c&&(a+=": "+c),0<=a.indexOf("{2}")&&(a=J.util.Txt.simpleReplace(a,"{2}",c)));d&&J.i18n.GT.setDoTranslate(!0);return a},"~N,~S,~S,~S,~B");c$.getErrorLineMessage=$_M(c$,"getErrorLineMessage",function(a,b,c,d,e){var f="\n----";
if(null!=b||null!=a)f+="line "+c+" command "+(d+1)+" of "+(null==a?b:a.equals("try")?"try":"function "+a)+":";return f+("\n         "+e)},"~S,~S,~N,~N,~S");$_M(c$,"toString",function(){var a=new JU.SB;a.append("Eval\n pc:");a.appendI(this.pc);a.append("\n");a.appendI(this.aatoken.length);a.append(" statements\n");for(var b=0;b<this.aatoken.length;++b){a.append("----\n");for(var c=this.aatoken[b],d=0;d<c.length;++d)a.appendO(c[d]),a.appendC("\n");a.appendC("\n")}a.append("END\n");return a.toString()});
c$.statementAsString=$_M(c$,"statementAsString",function(a,b,c,d){if(0==b.length)return"";var e=new JU.SB,f=b[0].tok;switch(f){case 0:return b[0].value;case 1150985:if(2==b.length&&(135368713==b[1].tok||102436==b[1].tok))return b[1].value.toString()}for(var g=!0,h=!1,j=!1,f=1<b.length&&1085443==f&&b[0].value.equals("")&&(61==b[0].intValue||35==b[0].intValue)&&1048577!=b[1].tok,l=b.length,k=0;k<l;++k){var m=b[k];if(null==m){l=k;break}c==k-1&&e.append(" <<");0!=k&&e.appendC(" ");if(2==k&&f&&((f=269484436!=
m.tok)||35==b[0].intValue))if(e.append(f?"= ":"== "),!f)continue;c==k&&1048578!=m.tok&&e.append(">> ");switch(m.tok){case 1048577:g&&e.append("{");continue;case 1048578:j&&k==b.length-1&&(g=!1);g&&e.append("}");continue;case 269484096:case 269484097:break;case 1048586:case 1048590:h=1048586==m.tok;break;case 1060866:if(0<k&&m.value.equals("define")){e.append("@");k+1<b.length&&1048577==b[k+1].tok&&(g||(j=!0),g=!0);continue}break;case 1048589:e.append("true");continue;case 1048588:e.append("false");
continue;case 135280132:break;case 2:e.appendI(m.intValue);continue;case 8:case 9:case 10:e.append(J.script.SV.sValue(m));continue;case 7:case 6:e.append(m.escape());continue;case 5:e.appendC("^");continue;case 1048615:2147483647!=m.intValue?e.appendI(m.intValue):e.append(J.modelset.Group.getSeqcodeStringFor(J.script.ScriptEvaluator.getSeqCode(m))),m=b[++k],e.appendC(" "),e.append(h?"-":"- ");case 1048614:2147483647!=m.intValue?e.appendI(m.intValue):e.append(J.modelset.Group.getSeqcodeStringFor(J.script.ScriptEvaluator.getSeqCode(m)));
continue;case 1048609:e.append("*:");e.append(a.getChainIDStr(m.intValue));continue;case 1048607:e.append("*%");null!=m.value&&e.append(m.value.toString());continue;case 1048610:e.append("*/");case 1048611:case 3:2147483647>m.intValue?e.append(J.util.Escape.escapeModelFileNumber(m.intValue)):e.append(""+m.value);continue;case 1048613:e.appendC("[");e.append(J.modelset.Group.getGroup3For(m.intValue));e.appendC("]");continue;case 1048612:e.appendC("[");e.appendO(m.value);e.appendC("]");continue;case 1048608:e.append("*.");
break;case 1095761925:if(Clazz.instanceOf(m.value,JU.P3)){m=m.value;e.append("cell=").append(J.util.Escape.eP(m));continue}break;case 4:e.append('"').appendO(m.value).append('"');continue;case 269484436:case 269484434:case 269484433:case 269484432:case 269484435:case 269484438:1716520985==m.intValue?e.append(b[++k].value).append(" "):2147483647!=m.intValue&&e.append(J.script.T.nameOf(m.intValue)).append(" ");break;case 364558:continue;case 1150985:e.append("end");continue;default:if(J.script.T.tokAttr(m.tok,
1073741824)||!d)break;e.appendC("\n").append(m.toString()).appendC("\n");continue}null!=m.value&&e.append(m.value.toString())}c>=l-1&&9999!=c&&e.append(" <<");return e.toString()},"J.viewer.Viewer,~A,~N,~B");$_M(c$,"getShapeProperty",function(a,b){return this.sm.getShapePropertyIndex(a,b,-2147483648)},"~N,~S");$_M(c$,"getShapePropertyData",function(a,b,c){return this.sm.getShapePropertyData(a,b,c)},"~N,~S,~A");$_M(c$,"setObjectMad",function(a,b,c){this.chk||this.viewer.setObjectMad(a,b,c)},"~N,~S,~N");
$_M(c$,"setObjectArgb",($fz=function(a,b){this.chk||this.viewer.setObjectArgb(a,b)},$fz.isPrivate=!0,$fz),"~S,~N");$_M(c$,"setShapeProperty",function(a,b,c){this.chk||this.sm.setShapePropertyBs(a,b,c,null)},"~N,~S,~O");$_M(c$,"setShapePropertyBs",function(a,b,c,d){this.chk||this.sm.setShapePropertyBs(a,b,c,d)},"~N,~S,~O,JU.BS");$_M(c$,"setShapeSizeBs",function(a,b,c){this.chk||this.sm.setShapeSizeBs(a,b,null,c)},"~N,~N,JU.BS");$_M(c$,"setShapeSize",($fz=function(a,b){this.chk||this.sm.setShapeSizeBs(a,
0,b,null)},$fz.isPrivate=!0,$fz),"~N,J.atomdata.RadiusData");$_M(c$,"setBooleanProperty",function(a,b){this.chk||this.viewer.setBooleanProperty(a,b)},"~S,~B");$_M(c$,"setIntProperty",($fz=function(a,b){this.chk||this.viewer.setIntProperty(a,b);return!0},$fz.isPrivate=!0,$fz),"~S,~N");$_M(c$,"setFloatProperty",($fz=function(a,b){this.chk||this.viewer.setFloatProperty(a,b);return!0},$fz.isPrivate=!0,$fz),"~S,~N");$_M(c$,"setStringProperty",($fz=function(a,b){this.chk||this.viewer.setStringProperty(a,
b)},$fz.isPrivate=!0,$fz),"~S,~S");$_M(c$,"showString",function(a){this.showStringPrint(a,!1)},"~S");$_M(c$,"showStringPrint",function(a,b){this.chk||null==a||(null!=this.outputBuffer?this.outputBuffer.append(a).appendC("\n"):this.viewer.showString(a,b))},"~S,~B");$_M(c$,"scriptStatusOrBuffer",function(a){this.chk||(null!=this.outputBuffer?this.outputBuffer.append(a).appendC("\n"):this.viewer.scriptStatus(a))},"~S");$_M(c$,"atomExpressionAt",function(a){this.checkToken(a)||this.errorAt(2,a);return this.atomExpression(this.st,
a,0,!0,!1,!0,!0)},"~N");$_M(c$,"atomExpression",function(a,b,c,d,e,f){this.isBondSet=!1;a!==this.st&&(this.tempStatement=this.st,this.st=a);var g=new J.script.ScriptMathProcessor(this,!1,!1,f),h,j=2147483647,l=!1;this.iToken=1E3;var k=0>b,m=!1,s=0,w=this.viewer.getAtomCount();k&&(b=-b);k=(new Boolean(k|this.chk)).valueOf();0==c&&a.length>b&&(c=b+1);a:for(;b<c;++b){this.iToken=b;j=a[b];if(null==j)break;var n=j.value;switch(j.tok){case 1048577:c=a.length;s++;break;case 1048578:s--;if(0<s)continue;break a;
case 1048586:if(this.isPoint3f(b)&&(n=this.getPoint3f(b,!0),null!=n)){g.addXPt(n);b=this.iToken;break}break;case 1048590:0<b&&1048586==a[b-1].tok&&g.addXBs(new JU.BS);break;case 269484096:m=!0;g.addOp(j);break;case 269484097:m=!1;g.addOp(j);break;case 1060866:g.addXBs(this.getAtomBitSet(n));break;case 135267841:g.addXVar(J.script.SV.newScriptVariableToken(j));g.addXVar(J.script.SV.newVariable(9,this.hklParameter(b+2)));b=this.iToken;break;case 135266319:g.addXVar(J.script.SV.newScriptVariableToken(j));
g.addXVar(J.script.SV.newVariable(9,this.planeParameter(b+2)));b=this.iToken;break;case 1048582:g.addXVar(J.script.SV.newScriptVariableToken(j));g.addXPt(this.getPoint3f(b+2,!0));b=this.iToken;break;case 4:if(0==n.indexOf("({")&&(h=J.util.Escape.uB(n),null!=h)){g.addXBs(h);break}g.addXVar(J.script.SV.newScriptVariableToken(j));n.equals("hkl")&&(g.addXVar(J.script.SV.newVariable(9,this.hklParameter(b+2))),b=this.iToken);break;case 135267336:case 135267335:case 1238369286:case 135266324:case 135402505:case 135266310:case 269484080:g.addOp(j);
break;case 1048579:g.addXBs(this.viewer.getModelUndeletedAtomsBitSet(-1));break;case 1048587:g.addXBs(new JU.BS);break;case 1048589:case 1048588:g.addXVar(J.script.SV.newScriptVariableToken(j));break;case 1114638363:g.addXBs(J.util.BSUtil.copy(this.viewer.getSelectionSet(!1)));break;case 3145770:g.addXBs(J.util.BSUtil.copy(this.viewer.getHiddenSet()));break;case 1060869:g.addXBs(J.util.BSUtil.copy(this.viewer.getMotionFixedAtoms()));break;case 3145768:g.addXBs(J.util.BSUtil.copyInvert(this.viewer.getHiddenSet(),
w));break;case 3145776:g.addXBs(this.viewer.getBaseModelBitSet());break;case 3145774:!this.chk&&!l&&this.viewer.setModelVisibility();l=!0;g.addXBs(this.viewer.getVisibleSet());break;case 3145766:!this.chk&&d&&this.refresh();g.addXBs(this.viewer.getClickableSet());break;case 1048608:this.viewer.allowSpecAtom()?(h=j.intValue,0<h?g.addXBs(this.compareInt(1095761922,269484436,h)):g.addXBs(this.getAtomBits(j.tok,n))):g.addXBs(this.lookupIdentifierValue("_"+n));break;case 3145764:case 3145732:case 1613758470:case 1048585:case 3145742:case 3145744:case 3145746:case 3145748:case 3145750:case 1048612:case 1048607:case 3145772:case 1089470478:case 3145778:case 1614417948:g.addXBs(this.getAtomBits(j.tok,
n));break;case 1048610:case 1048611:h=j.intValue;if(2147483647==h&&Clazz.instanceOf(n,Integer)){h=n.intValue();if(!this.viewer.haveFileSet()){g.addXBs(this.getAtomBits(1048610,Integer.$valueOf(h)));break}2147>=h&&(h*=1E6)}g.addXBs(this.bitSetForModelFileNumber(h));break;case 1048613:case 1048609:g.addXBs(this.getAtomBits(j.tok,Integer.$valueOf(j.intValue)));break;case 1048614:m?g.addXNum(J.script.SV.newScriptVariableInt(j.intValue)):g.addXBs(this.getAtomBits(1048614,Integer.$valueOf(J.script.ScriptEvaluator.getSeqCode(j))));
break;case 1048615:if(m){g.addXNum(J.script.SV.newScriptVariableInt(j.intValue));g.addOp(J.script.T.tokenMinus);g.addXNum(J.script.SV.newScriptVariableInt(a[++b].intValue));break}n=b+3<a.length&&269484160==a[b+2].tok&&1048609==a[b+3].tok?a[b+3].intValue:-1;g.addXBs(this.getAtomBits(1048615,[J.script.ScriptEvaluator.getSeqCode(j),J.script.ScriptEvaluator.getSeqCode(a[++b]),n]));-1!=n&&(b+=2);break;case 1095761926:case 1095761925:g.addXBs(this.getAtomBits(j.tok,[Clazz.doubleToInt(Math.floor(1E3*n.x)),
Clazz.doubleToInt(Math.floor(1E3*n.y)),Clazz.doubleToInt(Math.floor(1E3*n.z))]));break;case 3145758:g.addXBs(this.viewer.getModelUndeletedAtomsBitSet(this.viewer.getCurrentModelIndex()));break;case 1613758476:case 3145730:case 1115297793:case 1613758488:case 137363468:case 3145735:case 3145736:case 3145738:case 3145754:case 3145756:g.addXBs(this.lookupIdentifierValue(n));break;case 269484435:case 269484434:case 269484433:case 269484432:case 269484436:case 269484438:b+1==a.length&&this.invArg();h=
a[++b].value;var t=j.tok,r=j.intValue,u=1716520985==r?h:null;null!=u&&(b+1==a.length&&this.invArg(),h=a[++b].value);1095766022==r&&269484436!=t&&this.invArg();if(this.chk){g.addXBs(new JU.BS);break}var q=1095766028==r,v=J.script.T.tokAttr(r,1095761920),p=J.script.T.tokAttr(r,1112539136),y=v&&p,z=!v&&J.script.T.tokAttr(r,1087373312);1087375365==r&&(v=!(z=!1));var B=a[b].tok,j=a[b].intValue,A=NaN;Clazz.instanceOf(h,JU.P3)?1766856708==r&&(j=J.util.ColorUtil.colorPtToInt(h),B=2,v=!0):Clazz.instanceOf(h,
String)&&(1766856708==r?(j=J.util.ColorUtil.getArgbFromString(h),0==j&&J.script.T.tokAttr(B,1073741824)&&(h=this.getStringParameter(h,!0),h.startsWith("{")?(h=J.util.Escape.uP(h),j=Clazz.instanceOf(h,JU.P3)?J.util.ColorUtil.colorPtToInt(h):0):j=J.util.ColorUtil.getArgbFromString(h)),B=2,v=!0):z?J.script.T.tokAttr(B,1073741824)&&(h=this.getStringParameter(h,!0)):(J.script.T.tokAttr(B,1073741824)&&(h=this.getNumericParameter(h)),Clazz.instanceOf(h,String)&&(1641025539==r||1238369286==r||1087375365==
r?z=!(v=2147483647!=j):h=J.script.SV.nValue(a[b])),Clazz.instanceOf(h,Integer)?A=j=h.intValue():Clazz.instanceOf(h,Float)&&q&&(j=J.modelset.ModelCollection.modelFileNumberFromFloat(h.floatValue()))));z&&!Clazz.instanceOf(h,String)&&(h=""+h);Clazz.instanceOf(h,Integer)||2==B?q?1E6<=j&&(r=-1095766028):y||p&&(A=j):Clazz.instanceOf(h,Float)?q?r=-1095766028:(A=h.floatValue(),y?v=!1:v&&(j=Clazz.floatToInt(A))):z||(this.iToken++,this.invArg());q&&(1E6<=j&&0==j%1E6)&&(j/=1E6,r=1229984263);if(-1095766028==
r&&269484436==t){g.addXBs(this.bitSetForModelFileNumber(j));break}null!=n&&0<=n.indexOf("-")&&(v?j=-j:Float.isNaN(A)||(A=-A));n=1716520985==r?this.viewer.getDataFloat(u):null;g.addXBs(v?this.compareInt(r,t,j):z?this.compareString(r,t,h):this.compareFloatData(r,n,t,A));break;case 3:case 2:g.addXNum(J.script.SV.newScriptVariableToken(j));break;case 10:n=J.util.BSUtil.copy(n);g.addXBs(n);break;case 8:g.addXPt(n);break;default:if(J.script.T.tokAttr(j.tok,269484032)){g.addOp(j)||this.invArg();break}if(!Clazz.instanceOf(n,
String)){g.addXObj(n);break}h=this.getParameter(n,0);if(m){g.addXObj(h);break}Clazz.instanceOf(h,String)&&(h=this.getStringObjectAsVariable(h,null));Clazz.instanceOf(h,JU.List)&&(h=J.script.SV.unEscapeBitSetArray(h,!0),h=null==h?n:h);Clazz.instanceOf(h,String)&&(h=this.lookupIdentifierValue(n));g.addXObj(h)}}this.expressionResult=g.getResult(e);if(null==this.expressionResult){if(e)return null;this.chk||g.dumpStacks("after getResult");this.error(13)}this.expressionResult=this.expressionResult.value;
if(Clazz.instanceOf(this.expressionResult,String)&&(f||this.expressionResult.startsWith("({")))this.expressionResult=this.chk?new JU.BS:this.getAtomBitSet(this.expressionResult);if(!f&&!Clazz.instanceOf(this.expressionResult,JU.BS))return null;h=Clazz.instanceOf(this.expressionResult,JU.BS)?this.expressionResult:new JU.BS;this.isBondSet=Clazz.instanceOf(this.expressionResult,J.modelset.Bond.BondSet);this.isBondSet||(this.viewer.excludeAtoms(h,k),h.length()>this.viewer.getAtomCount()&&h.clearAll());
null!=this.tempStatement&&(this.st=this.tempStatement,this.tempStatement=null);return h},"~A,~N,~N,~B,~B,~B,~B");$_M(c$,"compareFloatData",($fz=function(a,b,c,d){var e=new JU.BS,f=this.viewer.getAtomCount(),g=this.viewer.modelSet.atoms,h=0;for(this.viewer.autoCalculate(a);0<=--f;){h=!1;switch(a){default:h=J.modelset.Atom.atomPropertyFloat(this.viewer,g[f],a);break;case 1716520985:if(null==b||b.length<=f)continue;h=b[f]}(h=J.script.ScriptEvaluator.compareFloat(c,h,d))&&e.set(f)}return e},$fz.isPrivate=
!0,$fz),"~N,~A,~N,~N");$_M(c$,"compareString",($fz=function(a,b,c){var d=new JU.BS,e=this.viewer.modelSet.atoms,f=this.viewer.getAtomCount(),g=1087373316==a&&this.viewer.getBoolean(603979822);for(g||(c=c.toLowerCase());0<=--f;){var h=J.modelset.Atom.atomPropertyString(this.viewer,e[f],a);g||(h=h.toLowerCase());this.compareStringValues(b,h,c)&&d.set(f)}return d},$fz.isPrivate=!0,$fz),"~N,~N,~S");$_M(c$,"compareInt",function(a,b,c){var d=2147483647,e=null,f=b,g=c,h=this.viewer.getAtomCount(),j=this.viewer.modelSet,
l=j.atoms,k=-1,m=0,s=-1,w=null,n=0,t;switch(a){case 1297090050:switch(f){case 269484433:case 269484432:k=2147483647}break;case 1095761923:try{switch(b){case 269484435:return J.util.BSUtil.newBitSet2(0,c);case 269484434:return J.util.BSUtil.newBitSet2(0,c+1);case 269484433:return J.util.BSUtil.newBitSet2(c,h);case 269484432:return J.util.BSUtil.newBitSet2(c+1,h);case 269484436:return c<h?J.util.BSUtil.newBitSet2(c,c+1):new JU.BS;default:return t=J.util.BSUtil.setAll(h),0<=c&&t.clear(c),t}}catch(r){if(Clazz.exceptionOf(r,
Exception))return new JU.BS;throw r;}}t=J.util.BSUtil.newBitSet(h);for(var u=0;u<h;++u){var q=!1,v=l[u];switch(a){default:d=J.modelset.Atom.atomPropertyInt(v,a);break;case 1095766022:return J.util.BSUtil.copy(this.viewer.getConformation(-1,c-1,!1));case 1297090050:e=v.getAtomSymmetry();if(null==e)continue;v.getModelIndex()!=s&&(s=v.getModelIndex(),w=j.getModelCellRange(s),n=j.getModelSymmetryCount(s));if(200<=g){if(null==w)continue;c=g%1E3;var p=Clazz.doubleToInt(g/1E3)-1;if(0>p)q=!0;else if(0==n||
0<=p&&!(q=e.get(p)))continue;f=1048587;d=0>p?v.getCellTranslation(c,w,n):v.getSymmetryTranslation(p,w,n)}else if(0<n){if(c>n&&269484435!=f&&269484434!=f)continue;if(269484438==f){0<c&&(c<=n&&!e.get(c))&&t.set(u);continue}}switch(f){case 269484435:k=c-1;break;case 269484434:k=c;break;case 269484433:m=c-1;break;case 269484432:m=c;break;case 269484436:k=c;m=c-1;break;case 269484438:q=!e.get(c)}0>m&&(m=0);m<k&&(e=e.nextSetBit(m),0<=e&&e<k&&(q=!0));if(!q||2147483647==d)b=1048587}switch(b){case 269484435:q=
d<c;break;case 269484434:q=d<=c;break;case 269484433:q=d>=c;break;case 269484432:q=d>c;break;case 269484436:q=d==c;break;case 269484438:q=d!=c}q&&t.set(u)}return t},"~N,~N,~N");$_M(c$,"compareStringValues",($fz=function(a,b,c){switch(a){case 269484436:case 269484438:return J.util.Txt.isMatch(b,c,!0,!0)==(269484436==a);default:this.invArg()}return!1},$fz.isPrivate=!0,$fz),"~N,~S,~S");c$.compareFloat=$_M(c$,"compareFloat",($fz=function(a,b,c){switch(a){case 269484435:return b<c;case 269484434:return b<=
c;case 269484433:return b>=c;case 269484432:return b>c;case 269484436:return b==c;case 269484438:return b!=c}return!1},$fz.isPrivate=!0,$fz),"~N,~N,~N");$_M(c$,"getAtomBits",($fz=function(a,b){return this.chk?new JU.BS:this.viewer.getAtomBits(a,b)},$fz.isPrivate=!0,$fz),"~N,~O");c$.getSeqCode=$_M(c$,"getSeqCode",($fz=function(a){return 2147483647==a.intValue?a.value.intValue():J.modelset.Group.getSeqcodeFor(a.intValue," ")},$fz.isPrivate=!0,$fz),"J.script.T");$_M(c$,"checkLast",function(a){return this.checkLength(a+
1)-1},"~N");$_M(c$,"checkLength",function(a){if(0<=a)return this.checkLengthErrorPt(a,0);this.slen>-a&&(this.iToken=-a,this.error(2));return this.slen},"~N");$_M(c$,"checkLengthErrorPt",($fz=function(a,b){this.slen!=a&&(this.iToken=0<b?b:this.slen,this.error(0<b?22:2));return this.slen},$fz.isPrivate=!0,$fz),"~N,~N");$_M(c$,"checkLength23",function(){this.iToken=this.slen;2!=this.slen&&3!=this.slen&&this.error(2);return this.slen});$_M(c$,"checkLength34",($fz=function(){this.iToken=this.slen;3!=this.slen&&
4!=this.slen&&this.error(2);return this.slen},$fz.isPrivate=!0,$fz));$_M(c$,"getToken",function(a){this.checkToken(a)||this.error(13);this.theToken=this.st[a];this.theTok=this.theToken.tok;return this.theToken},"~N");$_M(c$,"tokAt",function(a){return a<this.slen&&null!=this.st[a]?this.st[a].tok:0},"~N");$_M(c$,"checkToken",($fz=function(a){return(this.iToken=a)<this.slen},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"modelNumberParameter",function(a){var b=0,c=!1;switch(this.tokAt(a)){case 2:c=!0;case 3:b=
this.getToken(a).intValue;break;case 4:b=J.script.ScriptEvaluator.getFloatEncodedInt(this.stringParameter(a));break;default:this.invArg()}return this.viewer.getModelNumberIndex(b,c,!0)},"~N");$_M(c$,"optParameterAsString",function(a){return a>=this.slen?"":this.parameterAsString(a)},"~N");$_M(c$,"parameterAsString",function(a){this.getToken(a);null==this.theToken&&this.error(13);return J.script.SV.sValue(this.theToken)},"~N");$_M(c$,"intParameter",function(a){if(this.checkToken(a)&&2==this.getToken(a).tok)return this.theToken.intValue;
this.error(20);return 0},"~N");$_M(c$,"intParameterRange",function(a,b,c){a=this.intParameter(a);(a<b||a>c)&&this.integerOutOfRange(b,c);return a},"~N,~N,~N");$_M(c$,"isFloatParameter",function(a){switch(this.tokAt(a)){case 2:case 3:return!0}return!1},"~N");$_M(c$,"floatParameterRange",($fz=function(a,b,c){a=this.floatParameter(a);(a<b||a>c)&&this.numberOutOfRange(b,c);return a},$fz.isPrivate=!0,$fz),"~N,~N,~N");$_M(c$,"floatParameter",function(a){if(this.checkToken(a))switch(this.getToken(a),this.theTok){case 1048615:return-this.theToken.intValue;
case 1048614:case 2:return this.theToken.intValue;case 1048611:case 3:return this.theToken.value.floatValue()}this.error(34);return 0},"~N");$_M(c$,"listParameter",function(a,b,c){var d=new JU.List,e;e=this.tokAt(a);1073742195==e&&(e=this.tokAt(++a));var f=1048586==e,g=269484096==e;(f||g)&&a++;for(var h=0;h<c;){e=this.tokAt(a);if(f&&1048590==e||g&&269484097==e)break;switch(e){case 269484080:case 1048586:case 1048590:break;case 4:break;case 8:e=this.getPoint3f(a,!1);d.addLast(Float.$valueOf(e.x));
d.addLast(Float.$valueOf(e.y));d.addLast(Float.$valueOf(e.z));h+=3;break;case 9:e=this.getPoint4f(a);d.addLast(Float.$valueOf(e.x));d.addLast(Float.$valueOf(e.y));d.addLast(Float.$valueOf(e.z));d.addLast(Float.$valueOf(e.w));h+=4;break;default:d.addLast(Float.$valueOf(this.floatParameter(a))),h++,h==c&&(g&&1048590==this.tokAt(a+1))&&a++}a++}(f&&1048590!=this.tokAt(a++)||g&&269484097!=this.tokAt(a++)||h<b||h>c)&&this.invArg();this.iToken=a-1;return d},"~N,~N,~N");$_M(c$,"floatParameterSet",function(a,
b,c){var d=null,e=null,f=0,f=null;this.iToken=a;switch(this.tokAt(a)){case 4:f=J.script.SV.sValue(this.st[a]);f=J.util.Txt.replaceAllCharacter(f,"{},[]\"'"," ");e=JU.ParserJS.parseFloatArray(f);f=e.length;break;case 7:e=J.script.SV.flistValue(this.st[a],0);f=e.length;break;default:d=this.listParameter(a,b,c),f=d.size()}(f<b||f>c)&&this.invArg();if(null==e){e=Clazz.newFloatArray(f,0);for(a=0;a<f;a++)e[a]=d.get(a).floatValue()}return e},"~N,~N,~N");$_M(c$,"isArrayParameter",function(a){switch(this.tokAt(a)){case 7:case 11:case 12:case 1073742195:case 269484096:return!0}return!1},
"~N");$_M(c$,"getPointArray",function(a,b){var c=0>b?null:Array(b),d=0>b?new JU.List:null,e=0>a?7:this.getToken(a++).tok;switch(e){case 7:d=this.theToken.getList();0<=b&&d.size()!=b&&this.invArg();b=d.size();null==c&&(c=Array(b));for(e=0;e<b;e++)null==(c[e]=J.script.SV.ptValue(d.get(e)))&&this.invArg();return c;case 1073742195:e=this.tokAt(a++)}269484096!=e&&this.invArg();for(var f=0;269484097!=e&&0!=e;)switch(e=this.getToken(a).tok,e){case 0:case 269484097:break;case 269484080:a++;break;default:if(0<=
b&&f==b){e=0;break}var g=this.getPoint3f(a,!0);null==c?d.addLast(g):c[f]=g;f++;a=this.iToken+1}269484097!=e&&this.invArg();null==c&&(c=d.toArray(Array(d.size())));return c},"~N,~N");$_M(c$,"stringParameter",function(a){(!this.checkToken(a)||4!=this.getToken(a).tok)&&this.error(41);return this.theToken.value},"~N");$_M(c$,"stringParameterSet",function(a){switch(this.tokAt(a)){case 4:var b=this.stringParameter(a);return b.startsWith('["')&&(a=this.viewer.evaluateExpression(b),Clazz.instanceOf(a,String))?
J.util.Txt.split(a,"\n"):[b];case 1073742195:a+=2;break;case 269484096:++a;break;case 7:return J.script.SV.listValue(this.getToken(a));default:this.invArg()}for(var c,b=new JU.List;269484097!=(c=this.tokAt(a));){switch(c){case 269484080:break;case 4:b.addLast(this.stringParameter(a));break;default:case 0:this.invArg()}a++}this.iToken=a;a=b.size();c=Array(a);for(var d=0;d<a;d++)c[d]=b.get(d);return c},"~N");$_M(c$,"objectNameParameter",function(a){this.checkToken(a)||this.error(37);return this.parameterAsString(a)},
"~N");$_M(c$,"booleanParameter",($fz=function(a){if(this.slen==a)return!0;switch(this.getToken(this.checkLast(a)).tok){case 1048589:return!0;case 1048588:break;default:this.error(5)}return!1},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"atomCenterOrCoordinateParameter",($fz=function(a){switch(this.getToken(a).tok){case 10:case 1048577:a=this.atomExpression(this.st,a,0,!0,!1,!1,!0);if(null!=a&&1==a.cardinality())return this.viewer.getAtomPoint3f(a.nextSetBit(0));if(null!=a)return this.viewer.getAtomSetCenter(a);
if(Clazz.instanceOf(this.expressionResult,JU.P3))return this.expressionResult;this.invArg();break;case 1048586:case 8:return this.getPoint3f(a,!0)}this.invArg();return null},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"isCenterParameter",function(a){a=this.tokAt(a);return 1048583==a||1048586==a||1048577==a||8==a||10==a},"~N");$_M(c$,"centerParameter",function(a){return this.centerParameterForModel(a,-2147483648)},"~N");$_M(c$,"centerParameterForModel",($fz=function(a,b){var c=null;this.expressionResult=null;
if(this.checkToken(a))switch(this.getToken(a).tok){case 1048583:var d=this.objectNameParameter(++a),c=-2147483648;269484096==this.tokAt(a+1)&&(c=this.parameterExpressionList(-a-1,-1,!0).get(0).asInt(),269484097!=this.getToken(--this.iToken).tok&&this.invArg());if(this.chk)return new JU.P3;if(1048584==this.tokAt(a+1)&&(1141899267==this.tokAt(a+2)||1141899270==this.tokAt(a+2)))c=2147483647,this.iToken=a+2;null==(c=this.getObjectCenter(d,c,b))&&this.errorStr(12,d);break;case 10:case 1048577:case 1048586:case 8:c=
this.atomCenterOrCoordinateParameter(a)}null==c&&this.error(11);return c},$fz.isPrivate=!0,$fz),"~N,~N");$_M(c$,"planeParameter",function(a){var b=new JU.V3,c=new JU.V3,d=null,e=269484192==this.tokAt(a);e&&a++;if(a<this.slen)switch(this.getToken(a).tok){case 9:d=JU.P4.newPt(this.theToken.value);break;case 1048583:a=this.objectNameParameter(++a);if(this.chk)return new JU.P4;switch(this.sm.getShapeIdFromObjectName(a)){case 22:this.setShapeProperty(22,"thisID",a);a=this.getShapeProperty(22,"vertices");
if(null==a||3>a.length||null==a[0]||null==a[1]||null==a[2])break;J.util.Measure.getPlaneThroughPoints(a[0],a[1],a[2],new JU.V3,b,c,d=new JU.P4);break;case 24:this.setShapeProperty(24,"thisID",a),d=this.getShapeProperty(24,"plane")}break;case 1112541205:(!this.checkToken(++a)||269484436!=this.getToken(a++).tok)&&this.evalError("x=?",null);d=JU.P4.new4(1,0,0,-this.floatParameter(a));break;case 1112541206:(!this.checkToken(++a)||269484436!=this.getToken(a++).tok)&&this.evalError("y=?",null);d=JU.P4.new4(0,
1,0,-this.floatParameter(a));break;case 1112541207:(!this.checkToken(++a)||269484436!=this.getToken(a++).tok)&&this.evalError("z=?",null);d=JU.P4.new4(0,0,1,-this.floatParameter(a));break;case 1073741824:case 4:b=this.parameterAsString(a);if(b.equalsIgnoreCase("xy"))return JU.P4.new4(0,0,1,0);if(b.equalsIgnoreCase("xz"))return JU.P4.new4(0,1,0,0);if(b.equalsIgnoreCase("yz"))return JU.P4.new4(1,0,0,0);this.iToken+=2;break;case 1048586:if(!this.isPoint3f(a)){d=this.getPoint4f(a);break}case 10:case 1048577:a=
this.atomCenterOrCoordinateParameter(a);269484080==this.getToken(++this.iToken).tok&&++this.iToken;var f=this.atomCenterOrCoordinateParameter(this.iToken);269484080==this.getToken(++this.iToken).tok&&++this.iToken;var g=this.atomCenterOrCoordinateParameter(this.iToken),h=new JU.V3,b=J.util.Measure.getNormalThroughPoints(a,f,g,h,b,c),d=new JU.P4;d.set(h.x,h.y,h.z,b);!this.chk&&J.util.Logger.debugging&&J.util.Logger.debug("points: "+a+f+g+" defined plane: "+d)}null==d&&this.planeExpected();e&&d.scale(-1);
return d},"~N");$_M(c$,"hklParameter",function(a){!this.chk&&null==this.viewer.getCurrentUnitCell()&&this.error(33);a=this.getPointOrPlane(a,!1,!0,!1,!0,3,3);a=this.getHklPlane(a);null==a&&this.error(3);!this.chk&&J.util.Logger.debugging&&J.util.Logger.debug("defined plane: "+a);return a},"~N");$_M(c$,"getHklPlane",function(a){var b=new JU.V3,c=new JU.V3,d=JU.P3.new3(0==a.x?1:1/a.x,0,0),e=JU.P3.new3(0,0==a.y?1:1/a.y,0),f=JU.P3.new3(0,0,0==a.z?1:1/a.z);if(0==a.x&&0==a.y&&0==a.z)return null;0==a.x&&
0==a.y?(d.set(1,0,f.z),e.set(0,1,f.z)):0==a.y&&0==a.z?(e.set(d.x,0,1),f.set(d.x,1,0)):0==a.z&&0==a.x?(f.set(0,e.y,1),d.set(1,e.y,0)):0==a.x?d.set(1,e.y,0):0==a.y?e.set(0,1,f.z):0==a.z&&f.set(d.x,0,1);this.viewer.toCartesian(d,!1);this.viewer.toCartesian(e,!1);this.viewer.toCartesian(f,!1);a=new JU.V3;b=J.util.Measure.getNormalThroughPoints(d,e,f,a,b,c);c=new JU.P4;c.set(a.x,a.y,a.z,b);return c},"JU.P3");$_M(c$,"getMadParameter",function(){var a=1;switch(this.getToken(1).tok){case 1073742072:this.restrictSelected(!1,
!1);break;case 1048589:break;case 1048588:a=0;break;case 2:a=8*this.intParameterRange(1,0,750);break;case 3:a=Clazz.doubleToInt(Math.floor(2E3*this.floatParameterRange(1,-3,3)));0>a&&(this.restrictSelected(!1,!1),a=-a);break;default:this.error(6)}return a});$_M(c$,"getSetAxesTypeMad",($fz=function(a){if(a==this.slen)return 1;switch(this.getToken(this.checkLast(a)).tok){case 1048589:return 1;case 1048588:return 0;case 1073741926:return-1;case 2:return this.intParameterRange(a,-1,19);case 3:return a=
this.floatParameterRange(a,0,2),Clazz.doubleToInt(Math.floor(2E3*a))}this.errorStr(7,'"DOTTED"');return 0},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"isColorParam",function(a){var b=this.tokAt(a);return 570425378==b||1073742195==b||269484096==b||7==b||8==b||this.isPoint3f(a)||(4==b||J.script.T.tokAttr(b,1073741824))&&0!=J.util.ColorUtil.getArgbFromString(this.st[a].value)},"~N");$_M(c$,"getArgbParam",function(a){return this.getArgbParamOrNone(a,!1)},"~N");$_M(c$,"getArgbParamLast",($fz=function(a,b){var c=
this.getArgbParamOrNone(a,b);this.checkLast(this.iToken);return c},$fz.isPrivate=!0,$fz),"~N,~B");$_M(c$,"getArgbParamOrNone",($fz=function(a,b){var c=null;if(this.checkToken(a))switch(this.getToken(a).tok){default:if(!J.script.T.tokAttr(this.theTok,1073741824))break;case 570425378:case 4:return J.util.ColorUtil.getArgbFromString(this.parameterAsString(a));case 1073742195:return this.getColorTriad(a+2);case 269484096:return this.getColorTriad(++a);case 7:var d=J.script.SV.flistValue(this.theToken,
3);null!=d&&3!=d.length&&(c=JU.P3.new3(d[0],d[1],d[2]));break;case 8:c=this.theToken.value;break;case 1048586:c=this.getPoint3f(a,!1);break;case 1048587:if(b)return 0}null==c&&this.error(8);return J.util.ColorUtil.colorPtToInt(c)},$fz.isPrivate=!0,$fz),"~N,~B");$_M(c$,"getColorTriad",($fz=function(a){var b=Clazz.newFloatArray(3,0),c=0,d="";this.getToken(a);var e=null,f=0;a:switch(this.theTok){case 2:case 1048614:case 3:for(;a<this.slen;a++){switch(this.getToken(a).tok){case 269484080:continue;case 1073741824:(1!=
c||0!=b[0])&&this.error(4);d="0"+this.parameterAsString(a);break a;case 3:2<c&&this.error(4);f=this.floatParameter(a);break;case 2:2<c&&this.error(4);f=this.theToken.intValue;break;case 1048614:2<c&&this.error(4);f=this.theToken.value.intValue()%256;break;case 269484097:3!=c&&this.error(4);--a;e=JU.P3.new3(b[0],b[1],b[2]);break a;default:this.error(4)}b[c++]=f}this.error(4);break;case 8:e=this.theToken.value;break;case 1073741824:d=this.parameterAsString(a);break;default:this.error(4)}269484097!=
this.getToken(++a).tok&&this.error(4);if(null!=e)return J.util.ColorUtil.colorPtToInt(e);0==(c=J.util.ColorUtil.getArgbFromString("["+d+"]"))&&this.error(4);return c},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"isPoint3f",function(a){var b;if((b=8==this.tokAt(a))||9==this.tokAt(a)||this.isFloatParameter(a+1)&&this.isFloatParameter(a+2)&&this.isFloatParameter(a+3)&&this.isFloatParameter(a+4))return b;this.ignoreError=!0;var c=this.iToken;b=!0;try{this.getPoint3f(a,!0)}catch(d){if(Clazz.exceptionOf(d,Exception))b=
!1;else throw d;}this.ignoreError=!1;this.iToken=c;return b},"~N");$_M(c$,"getPoint3f",function(a,b){return this.getPointOrPlane(a,!1,b,!0,!1,3,3)},"~N,~B");$_M(c$,"getPoint4f",function(a){return this.getPointOrPlane(a,!1,!1,!1,!1,4,4)},"~N");$_M(c$,"getPointOrPlane",($fz=function(a,b,c,d,e,f,g){var h=Clazz.newFloatArray(6,0),j=0;this.coordinatesAreFractional=e;if(8==this.tokAt(a)){if(3>=f&&3<=g)return this.getToken(a).value;this.invArg()}if(9==this.tokAt(a)){if(4>=f&&4<=g)return this.getToken(a).value;
this.invArg()}e=1;a:for(;a<this.st.length;a++)switch(this.getToken(a).tok){case 1048586:case 269484080:case 269484128:case 269484160:break;case 1048590:break a;case 269484192:e=-1;break;case 1048615:6==j&&this.invArg();h[j++]=this.theToken.intValue;e=-1;break;case 2:case 1048614:6==j&&this.invArg();h[j++]=this.theToken.intValue*e;e=1;break;case 269484208:case 1048610:c||this.invArg();269484208==this.theTok&&this.getToken(++a);j--;(0>j||b)&&this.invArg();Clazz.instanceOf(this.theToken.value,Integer)||
2==this.theTok?h[j++]/=2147483647==this.theToken.intValue?this.theToken.value.intValue():this.theToken.intValue:Clazz.instanceOf(this.theToken.value,Float)&&(h[j++]/=this.theToken.value.floatValue());this.coordinatesAreFractional=!0;break;case 3:case 1048611:b&&this.invArg();6==j&&this.invArg();h[j++]=this.theToken.value.floatValue();break;default:this.invArg()}(j<f||j>g)&&this.invArg();return 3==j?(b=JU.P3.new3(h[0],h[1],h[2]),this.coordinatesAreFractional&&d&&(this.fractionalPoint=JU.P3.newP(b),
this.chk||this.viewer.toCartesian(b,!this.viewer.getBoolean(603979848))),b):4==j?(this.coordinatesAreFractional&&this.invArg(),JU.P4.new4(h[0],h[1],h[2],h[3])):h},$fz.isPrivate=!0,$fz),"~N,~B,~B,~B,~B,~N,~N");$_M(c$,"xypParameter",function(a){var b=this.tokAt(a);1073742195==b&&(b=this.tokAt(++a));if(269484096!=b||!this.isFloatParameter(++a))return null;b=new JU.P3;b.x=this.floatParameter(a);269484080==this.tokAt(++a)&&a++;if(!this.isFloatParameter(a))return null;b.y=this.floatParameter(a);var c=269484210==
this.tokAt(++a);c&&++a;if(269484097!=this.tokAt(a))return null;this.iToken=a;b.z=3.4028235E38*(c?-1:1);return b},"~N");$_M(c$,"isCommandDisplayable",($fz=function(a){return a>=this.aatoken.length||a>=this.pcEnd||null==this.aatoken[a]?!1:this.lineIndices[a][1]>this.lineIndices[a][0]},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"checkContinue",($fz=function(){if(this.executionStopped)return!1;if(this.executionStepping&&this.isCommandDisplayable(this.pc))this.viewer.setScriptStatus("Next: "+this.getNextStatement(),
"stepping -- type RESUME to continue",0,null),this.executionPaused=!0;else if(!this.executionPaused)return!0;J.util.Logger.debugging&&J.util.Logger.debug("script execution paused at command "+(this.pc+1)+" level "+this.scriptLevel+": "+this.thisCommand);for(this.refresh();this.executionPaused;){this.viewer.popHoldRepaint("pause \u0001## REPAINT_IGNORE ##");var a=this.viewer.getInsertedCommand();if(0<a.length){this.resumePausedExecution();this.setErrorMessage(null);var b=this.getScriptContext("script insertion");
this.pc--;try{this.runScript(a)}catch(c){if(Clazz.exceptionOf(c,Exception))this.setErrorMessage(""+c);else if(Clazz.exceptionOf(c,Error))this.setErrorMessage(""+c);else throw c;}this.$error&&(this.scriptStatusOrBuffer(this.errorMessage),this.setErrorMessage(null));this.restoreScriptContext(b,!0,!1,!1);this.pauseExecution(!1)}this.doDelay(-100);this.viewer.pushHoldRepaint("pause")}this.notifyResumeStatus();return!this.$error&&!this.executionStopped},$fz.isPrivate=!0,$fz));Clazz.overrideMethod(c$,"notifyResumeStatus",
function(){!this.chk&&(!this.executionStopped&&!this.executionStepping)&&this.viewer.scriptStatus("script execution "+(this.$error||this.executionStopped?"interrupted":"resumed"));J.util.Logger.debugging&&J.util.Logger.debug("script execution resumed")});$_M(c$,"doDelay",($fz=function(a){if(this.useThreads()){if(this.isJS&&this.allowJSThreads)throw new J.script.ScriptInterruption(this,"delay",a);this.delayScript(a)}},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"dispatchCommands",function(a,b){var c=0;null==
this.sm&&(this.sm=this.viewer.getShapeManager());this.debugScript=this.logMessages=!1;this.chk||this.setDebugging();this.logMessages&&(c=System.currentTimeMillis(),this.viewer.scriptStatus("Eval.dispatchCommands():"+c),this.viewer.scriptStatus(this.$script));0==this.pcEnd&&(this.pcEnd=2147483647);0==this.lineEnd&&(this.lineEnd=2147483647);if(null==this.aatoken)return!0;this.commandLoop(b);if(this.chk)return!0;c=this.viewer.getInsertedCommand();""!==c?this.runScriptBuffer(c,null):a&&(this.debugScript&&
this.viewer.getBoolean(603979880))&&this.viewer.scriptStatus("script <exiting>");return!this.isJS||!this.allowJSThreads||b?!0:this.mustResumeEval||null==this.thisContext?(c=null==this.thisContext,this.resumeEval(this.thisContext),this.mustResumeEval=!1,c):!0},"~B,~B");$_M(c$,"commandLoop",($fz=function(a){for(var b="",c=!1,d=null,e=System.currentTimeMillis();this.pc<this.aatoken.length&&this.pc<this.pcEnd;this.pc++){!this.chk&&(this.isJS&&this.allowJSThreads&&!a)&&(!this.executionPaused&&100<System.currentTimeMillis()-
e&&(this.pc--,this.doDelay(-1)),e=System.currentTimeMillis());if(!this.chk&&!this.checkContinue())break;if(this.lineNumbers[this.pc]>this.lineEnd)break;this.debugScript&&!this.chk&&J.util.Logger.info("Command "+this.pc);this.theToken=0==this.aatoken[this.pc].length?null:this.aatoken[this.pc][0];if(!this.historyDisabled&&!this.chk&&this.scriptLevel<=this.commandHistoryLevelMax&&!this.tQuiet){var f=this.getCommand(this.pc,!0,!0);if(null!=this.theToken&&0<f.length&&!f.equals(b)&&(135368713==this.theToken.tok||
102436==this.theToken.tok||!J.script.T.tokAttr(this.theToken.tok,102400)))this.viewer.addCommand(b=f)}this.chk||(f=this.viewer.getInsertedCommand(),""!==f&&this.runScript(f));if(this.setStatement(this.pc)){this.thisCommand=this.getCommand(this.pc,!1,!0);f=this.getCommand(this.pc+1,!1,!0);this.fullCommand=this.thisCommand+(f.startsWith("#")?f:"");this.getToken(0);this.iToken=0;if((this.listCommands||!this.chk&&0<this.scriptLevel)&&!this.isJS)if(f=this.viewer.getInt(536870922),this.listCommands||0<
f)0<f&&this.delayScript(-f),this.viewer.scriptEcho("$["+this.scriptLevel+"."+this.lineNumbers[this.pc]+"."+(this.pc+1)+"] "+this.thisCommand);if(null!=d&&(1150985!=this.theTok||2>this.slen||102439!=this.st[1].tok))d.addLast(this.st);else{if(this.chk){if(this.isCmdLine_c_or_C_Option&&J.util.Logger.info(this.thisCommand),1==this.slen&&135368713!=this.st[0].tok&&102436!=this.st[0].tok)continue}else this.debugScript&&this.logDebugScript(0),0==this.scriptLevel&&this.viewer.global.logCommands&&this.viewer.log(this.thisCommand),
this.logMessages&&null!=this.theToken&&J.util.Logger.debug(this.theToken.toString());if(null!=this.theToken){if(J.script.T.tokAttr(this.theToken.tok,135168))this.processShapeCommand(this.theToken.tok);else switch(this.theToken.tok){case 0:if(this.chk||!this.viewer.getBoolean(603979880))break;f=this.theToken.value;if(null==f)break;null==this.outputBuffer&&this.viewer.showMessage(f);this.scriptStatusOrBuffer(f);break;case 266280:this.pushContext(this.theToken,"PUSH");break;case 266278:this.popContext(!0,
!1);break;case 269484066:break;case 20500:case 528410:if(this.viewer.isHeadless())break;case 102412:case 102407:case 102408:case 364547:case 102402:case 1150985:case 364548:case 135369224:case 135369225:case 102410:case 102411:case 102413:case 102406:c=this.flowControl(this.theToken.tok,c,d);102439==this.theTok&&(d=null);break;case 4097:this.animation();break;case 4098:this.assign();break;case 1610616835:this.background(1);break;case 4100:this.bind();break;case 4101:this.bondorder();break;case 135270422:this.cache();
break;case 4103:this.capture();break;case 1069064:this.cd();break;case 12289:this.center(1);break;case 4105:this.centerAt();break;case 1766856708:this.color();break;case 4106:this.connect(1);break;case 528395:this.console();break;case 1060866:this.define();break;case 528397:this.delay();break;case 12291:this.$delete();break;case 554176526:this.slab(!0);break;case 1610625028:this.display(!0);break;case 266255:case 266281:if(this.chk)break;0<this.pc&&266255==this.theToken.tok&&this.viewer.clearScriptQueue();
this.executionStopped=0<this.pc||!this.viewer.global.useScriptQueue;break;case 266256:if(this.chk)return;this.viewer.exitJmol();break;case 1229984263:this.file();break;case 1060869:this.fixed();break;case 4114:this.font(-1,0);break;case 4115:case 1095766028:this.model(1);break;case 102436:case 135368713:case 1073741824:this.$function();break;case 135270410:this.getProperty();break;case 20482:this.help();break;case 12294:this.display(!1);break;case 1612189718:this.hbond();break;case 1610616855:this.history(1);
break;case 544771:this.hover();break;case 266264:this.chk||this.viewer.initialize(!this.isStateScript);break;case 4121:this.invertSelected();break;case 135287308:this.script(135287308,null,null);break;case 135271426:this.load();break;case 36869:this.log();break;case 20485:this.message();break;case 4128:this.move();break;case 4130:this.moveto();break;case 20487:this.pause();break;case 36865:this.print();break;case 102439:this.pushContext(this.theToken,"PROCESS");null!=this.parallelProcessor&&(d=new JU.List);
break;case 135304707:this.prompt();break;case 4139:case 4165:this.undoRedoMove();break;case 266284:this.refresh();break;case 4141:this.reset();break;case 4142:this.restore();break;case 12295:this.restrict();break;case 266287:this.chk||this.resumePausedExecution();break;case 36866:this.returnCmd(null);break;case 528432:this.rotate(!1,!1);break;case 4145:this.rotate(!1,!0);break;case 4146:this.save();break;case 1085443:this.set();break;case 135271429:this.script(135271429,null,null);break;case 135280132:this.select(1);
break;case 1611141171:this.selectionHalo(1);break;case 554176565:this.slab(!1);break;case 1611141175:this.rotate(!0,!1);break;case 1611141176:this.ssbond();break;case 266298:this.pause()&&this.stepPausedExecution();break;case 528443:this.stereo();break;case 1641025539:this.structure();break;case 3158024:this.subset();break;case 4156:this.sync();break;case 536875070:this.timeout(1);break;case 4160:this.translate(!1);break;case 4162:this.translate(!0);break;case 4164:this.unbind();break;case 4166:this.vibration();
break;case 1060873:this.zap(!0);break;case 4168:this.zoom(!1);break;case 4170:this.zoom(!0);break;case 4102:case 135270405:case 1095766022:case 1052700:case 4126:case 135270424:case 4133:case 135270417:case 1052714:case 135270407:case 4131:case 4148:case 135270421:this.getExtension().dispatch(this.theToken.tok,!1,this.st);break;default:this.error(47)}this.setCursorWait(!1);this.executionStepping&&(this.executionPaused=this.isCommandDisplayable(this.pc+1))}}}else J.util.Logger.info(this.getCommand(this.pc,
!0,!1)+" -- STATEMENT CONTAINING @{} SKIPPED")}},$fz.isPrivate=!0,$fz),"~B");$_M(c$,"cache",($fz=function(){var a=this.tokAt(1),b=null,c=2;switch(a){case 1276118017:case 1073742119:b=this.optParameterAsString(c++);case 1073741882:this.checkLength(c);this.chk||("all".equals(b)&&(b=null),b=this.viewer.cacheFileByName(b,1276118017==a),this.showString(0>b?"cache cleared":b+" bytes "+(1276118017==a?" cached":" removed")));break;default:this.invArg()}},$fz.isPrivate=!0,$fz));$_M(c$,"capture",($fz=function(){if(!this.chk&&
!this.viewer.allowCapture())this.showString("Cannot capture on this platform");else{var a=this.viewer.getInt(553648132),b=0,c="",d=this.viewer.captureParams,e=!this.viewer.getAnimationReplayMode().name().equals("ONCE"),f=this.tokAt(1),g="";switch(f){case 0:b=1150985;break;case 4:c=this.optParameterAsString(1);if(0==c.length){b=1150985;break}c.endsWith(".gif")||(c+=".gif");var f=null,b="y",h;switch(this.tokAt(2)){case 1073742129:e=!0;h=3;b=2==this.tokAt(3)?"y":this.optParameterAsString(h++).toLowerCase();
f=0==this.tokAt(h)?5:this.intParameter(h++);f=J.util.Txt.simpleReplace("; rotate Y 10 10;delay 2.0; rotate Y -10 -10; delay 2.0;rotate Y -10 -10; delay 2.0;rotate Y 10 10;delay 2.0","10",""+f);break;case 1611141175:e=!0;h=3;b=this.optParameterAsString(h).toLowerCase();0<b.length&&h++;f="; rotate Y 360 30;delay 15.0;";2==this.tokAt(h)&&(g=" "+(a=this.intParameter(h++)));break;case 2:a=this.intParameter(2)}if(null!=f){this.chk||this.viewer.setNavigationMode(!1);if(""===b||0>"xyz".indexOf(b))b="y";f=
J.util.Txt.simpleReplace(f,"Y",b);f="capture "+J.util.Escape.eS(c)+g+f+";capture;";this.script(0,null,f);return}null!=d&&new java.util.Hashtable;b=1073742032;d=new java.util.Hashtable;e||this.showString(J.i18n.GT._("Note: Enable looping using {0}",["ANIMATION MODE LOOP"]));this.showString(J.i18n.GT._("Animation delay based on: {0}",["ANIMATION FPS "+a]));d.put("captureFps",Integer.$valueOf(a));break;case 1073741874:case 1048589:case 1048588:this.checkLength(2);b=f;break;default:this.invArg()}this.chk||
null==d||(d.put("type","GIF"),d.put("fileName",c),d.put("quality",Integer.$valueOf(-1)),d.put("captureMode",Integer.$valueOf(b)),d.put("captureLooping",e?Boolean.TRUE:Boolean.FALSE),J.util.Logger.info(this.viewer.processWriteOrCapture(d)))}},$fz.isPrivate=!0,$fz));$_M(c$,"setCursorWait",function(a){this.chk||this.viewer.setCursor(a?3:0)},"~B");$_M(c$,"processShapeCommand",($fz=function(a){var b=0;switch(a){case 1611272194:b=31;break;case 1115297793:b=9;break;case 1679429641:b=32;break;case 1113200642:b=
11;break;case 135174:b=23;break;case 135402505:b=25;break;case 135175:b=17;break;case 1113198595:b=16;break;case 135176:b=22;break;case 537022465:b=30;break;case 1113198596:b=20;break;case 1611272202:b=35;break;case 1113198597:b=19;break;case 1113200646:b=8;break;case 135180:b=24;break;case 1826248715:b=5;break;case 135182:b=26;break;case 537006096:case 1746538509:b=6;break;case 1113200647:b=13;break;case 1183762:b=27;break;case 135190:b=29;break;case 135188:b=28;break;case 135192:b=21;break;case 1113200649:b=
14;break;case 1113200650:b=15;break;case 1113200651:b=0;break;case 1113200652:b=7;break;case 1650071565:b=12;break;case 1708058:b=4;break;case 1113200654:b=10;break;case 1614417948:b=33;break;case 135198:b=18;break;case 659488:b=1;break;default:this.error(47)}if(null==this.sm.getShape(b)&&2==this.slen)switch(this.st[1].tok){case 1048588:case 12291:case 1048587:return}switch(a){case 1115297793:case 1113200642:case 1113200647:case 1113200649:case 1113200650:case 1650071565:case 1113200654:this.proteinShape(b);
return;case 1113198595:case 1113198597:this.dots(b);return;case 1113198596:this.ellipsoid();return;case 1113200646:case 1113200651:case 1113200652:this.setAtomShapeSize(b,1113200646==a?-1:1);return;case 1826248715:this.label(1);return;case 135198:this.vector();return;case 659488:this.wireframe();return}switch(a){case 1611272194:this.axes(1);break;case 1679429641:this.boundbox(1);break;case 537022465:this.echo(1,null,!1);break;case 1611272202:this.frank(1);break;case 1614417948:this.unitcell(1);break;
case 135174:case 135402505:case 135175:case 135176:case 135180:case 135182:case 537006096:case 1746538509:case 1183762:case 135190:case 135188:case 135192:case 1708058:this.getExtension().dispatch(b,!1,this.st)}},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"getExtension",function(){return null==this.scriptExt?(this.scriptExt=J.api.Interface.getOptionInterface("scriptext.ScriptExt")).init(this):this.scriptExt});$_M(c$,"flowControl",($fz=function(a,b,c){var d;switch(a){case 20500:return this.gotoCmd(this.parameterAsString(this.checkLast(1))),
b;case 528410:return this.chk||(this.pc=-1),this.delay(),b}var e=this.st[0].intValue,f=0>e&&!this.chk;d=!0;var g=0;switch(a){case 102412:d=this.theToken;this.pushContext(d,"CATCH");!f&&null!=d.name0&&this.contextVariables.put(d.name0,d.contextVariables.get(d.name0));d=!f;break;case 102410:case 102413:case 102411:g=Math.abs(this.aatoken[Math.abs(e)][0].intValue);switch(f?0:this.switchCmd(this.theToken,a)){case 0:g=-g;d=!1;break;case -1:d=!1}this.aatoken[this.pc][0].intValue=Math.abs(e);this.theToken=
this.aatoken[Math.abs(e)][0];1150985!=this.theToken.tok&&(this.theToken.intValue=g);break;case 135369225:case 102402:d=!f&&this.ifCmd();if(this.chk)break;g=Math.abs(this.aatoken[Math.abs(e)][0].intValue);this.aatoken[Math.abs(e)][0].intValue=f||d?-g:g;102412==a&&(this.aatoken[this.pc][0].intValue=-e);break;case 364547:this.checkLength(1);0>e&&!this.chk&&(this.pc=-e-1);break;case 364548:this.checkLength(1);break;case 102406:b||this.pushContext(this.theToken,"WHILE");b=!1;!this.ifCmd()&&!this.chk&&
(this.pc=e,this.popContext(!0,!1));break;case 102407:if(!this.chk){this.breakCmd(e);break}if(1==this.slen)break;f=this.intParameter(this.checkLast(1));if(this.chk)break;for(var h=0;h<f;h++)this.popContext(!0,!1);break;case 102408:b=!0;this.chk||(this.pc=e-1);1<this.slen&&this.intParameter(this.checkLast(1));break;case 135369224:g=this.theToken;f=Clazz.newIntArray(2,0);c=0;a=null;for(var h=1,j=0;h<this.slen&&2>c;h++)switch(this.tokAt(h)){case 1048591:0<j?j--:f[c++]=h;break;case 1073741980:j-=2;if(1048577==
this.tokAt(++h)||10==this.tokAt(h))a=this.atomExpressionAt(h),this.isBondSet&&(a=new J.modelset.Bond.BondSet(a));else switch(h=this.parameterExpressionList(-h,1,!1),(null==h||1>h.size())&&this.invArg(),h=h.get(0),h.tok){case 10:a=J.script.SV.getBitSet(h,!1);break;case 7:a=h.getList();break;default:this.invArg()}h=this.iToken;break;case 135280132:j+=2}b?c=null==a?f[1]+1:2:(this.pushContext(g,"FOR"),c=2);36868==this.tokAt(c)&&c++;g=this.parameterAsString(c);(h=g.equals("--")||g.equals("++"))&&(g=this.parameterAsString(++c));
j=null;if(J.script.T.tokAttr(this.tokAt(c),1073741824)||null!=(j=this.getContextVariableAsVariable(g)))if(null==a&&(!h&&269484436!=this.getToken(++c).tok)&&this.invArg(),null==a)h&&(c-=2),this.setVariable(++c,this.slen-1,g,0);else if(d=!0,c=g+"_incr",null==j&&(j=this.getContextVariableAsVariable(c)),null==j&&(g.startsWith("_")&&this.invArg(),j=this.viewer.getOrSetNewVariable(c,!0)),!b||10!=j.tok&&7!=j.tok||2147483647==j.intValue?b?d=!1:(j.setv(J.script.SV.getVariable(a),!1),j.intValue=1):j.intValue++,
d=d&&(Clazz.instanceOf(a,JU.BS)?1==J.script.SV.bsSelectVar(j).cardinality():j.intValue<=j.getList().size()))j=J.script.SV.selectItemVar(j),b=this.getContextVariableAsVariable(g),null==b&&(b=this.viewer.getOrSetNewVariable(g,!0)),b.setv(j,!1);null==a&&(d=this.parameterExpressionBoolean(f[0]+1,f[1]));e++;d||this.popContext(!0,!1);b=!1;break;case 1150985:switch(this.getToken(this.checkLast(1)).tok){case 364558:e=this.getToken(1).value;if(this.chk)return!1;this.runFunctionRet(e,"try",null,null,!0,!0,
!0);return!1;case 102412:this.popContext(!0,!1);break;case 135368713:case 102436:return this.viewer.addFunction(this.theToken.value),b;case 102439:this.addProcess(c,e,this.pc);this.popContext(!0,!1);break;case 102410:if(0<e&&-1==this.switchCmd(this.aatoken[e][0],0)){for(;e<this.pc&&!(102413!=(a=this.aatoken[e][0].tok)&&102411!=a);e++);d=this.pc==e}}d&&(d=102412==this.theTok||102439==this.theTok||135369225==this.theTok||102410==this.theTok);b=135369224==this.theTok||102406==this.theTok}!d&&!this.chk&&
(this.pc=Math.abs(e)-1);return b},$fz.isPrivate=!0,$fz),"~N,~B,JU.List");$_M(c$,"gotoCmd",($fz=function(a){for(var b=null==a?this.aatoken.length-1:-1,c=null,d=b+1;d<this.aatoken.length;d++){var c=this.aatoken[d],e=c[0].tok;switch(e){case 20485:case 0:c=c[c.length-1].value;0==e&&(c=c.substring(c.startsWith("#")?1:2));break;default:continue}if(c.equalsIgnoreCase(a)){b=d;break}}0>b&&this.invArg();null==a&&(b=0);e=b<this.pc?1:-1;c=0;for(d=b;d!=this.pc;d+=e)switch(this.aatoken[d][0].tok){case 266280:case 102439:case 135369224:case 102412:case 102406:c++;
break;case 266278:c--;break;case 1150985:switch(this.aatoken[d][1].tok){case 102439:case 135369224:case 102412:case 102406:c--}}if(null==a)for(b=2147483647;0<c;--c)this.popContext(!1,!1);0!=c&&this.invArg();this.chk||(this.pc=b-1)},$fz.isPrivate=!0,$fz),"~S");$_M(c$,"breakCmd",($fz=function(a){if(0>a)this.getContextVariableAsVariable("_breakval").intValue=-a,this.pcEnd=this.pc;else if(this.pc=Math.abs(this.aatoken[a][0].intValue),a=this.aatoken[a][0].tok,102411==a||102413==a)this.theToken=this.aatoken[this.pc--][0],
a=Math.abs(this.theToken.intValue),1150985!=this.theToken.tok&&(this.theToken.intValue=-a);else{for(;null!=this.thisContext&&!J.script.ScriptCompiler.isBreakableContext(this.thisContext.token.tok);)this.popContext(!0,!1);this.popContext(!0,!1)}},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"addProcess",($fz=function(a,b,c){if(null!=this.parallelProcessor){for(var d=Array(c),e=0;e<a.size();e++)d[e+1-b]=a.get(e);a=this.getScriptContext("addProcess");a.aatoken=d;a.pc=1-b;a.pcEnd=c;this.parallelProcessor.addProcess("p"+
($t$=++J.script.ScriptEvaluator.iProcess,J.script.ScriptEvaluator.prototype.iProcess=J.script.ScriptEvaluator.iProcess,$t$),a)}},$fz.isPrivate=!0,$fz),"JU.List,~N,~N");$_M(c$,"switchCmd",($fz=function(a,b){102410==b&&a.addName("_var");var c=a.contextVariables.get("_var");if(null==c)return 1;if(0==b)return a.contextVariables.remove("_var"),-1;if(102413==b)return-1;var d=this.parameterExpressionToken(1);if(102411==b)return(c=J.script.SV.areEqual(c,d))&&a.contextVariables.remove("_var"),c?1:-1;a.contextVariables.put("_var",
d);return 1},$fz.isPrivate=!0,$fz),"J.script.ContextToken,~N");$_M(c$,"ifCmd",($fz=function(){return this.parameterExpressionBoolean(1,0)},$fz.isPrivate=!0,$fz));$_M(c$,"returnCmd",($fz=function(a){var b=this.getContextVariableAsVariable("_retval");if(null==b)this.chk||this.gotoCmd(null);else{var c=null!=a||1==this.slen?null:this.parameterExpressionToken(1);this.chk||(null==a&&(a=null==c?J.script.SV.newScriptVariableInt(0):c),b.value=a.value,b.intValue=a.intValue,b.tok=a.tok,this.gotoCmd(null))}},
$fz.isPrivate=!0,$fz),"J.script.SV");$_M(c$,"help",($fz=function(){if(!this.chk){var a=this.optParameterAsString(1).toLowerCase(),b=0;a.startsWith("mouse")&&0<=(b=a.indexOf(" "))&&b==a.lastIndexOf(" ")?this.showString(this.viewer.getBindingInfo(a.substring(b+1))):(J.script.T.tokAttr(J.script.T.getTokFromName(a),4096)&&(a="?command="+a),this.viewer.getHelp(a))}},$fz.isPrivate=!0,$fz));$_M(c$,"move",($fz=function(){this.checkLength(-11);var a=JU.V3.new3(this.floatParameter(1),this.floatParameter(2),
this.floatParameter(3)),b=this.floatParameter(4),c=JU.V3.new3(this.intParameter(5),this.intParameter(6),this.intParameter(7)),d=this.floatParameter(8),e=this.floatParameter(9),f=11==this.slen?this.intParameter(10):30;if(!this.chk&&(this.refresh(),this.useThreads()||(e=0),this.viewer.move(this,a,b,c,d,e,f),0<e&&this.isJS))throw new J.script.ScriptInterruption(this,"move",1);},$fz.isPrivate=!0,$fz));$_M(c$,"moveto",($fz=function(){if(2==this.slen&&1073742162==this.tokAt(1))this.chk||this.viewer.stopMotion();
else{var a;if(2==this.slen&&this.isFloatParameter(1)){if(a=this.floatParameter(1),!this.chk&&(this.useThreads()||(a=0),0<a&&this.refresh(),this.viewer.moveTo(this,a,null,J.viewer.JC.axisZ,0,null,100,0,0,0,null,NaN,NaN,NaN,NaN,NaN,NaN),this.isJS&&0<a&&this.viewer.global.waitForMoveTo))throw new J.script.ScriptInterruption(this,"moveTo",1);}else{var b=JU.V3.new3(NaN,0,0),c=null,d=1;a=this.isFloatParameter(d)?this.floatParameter(d++):2;var e=90,f=null,g=!0,h=0,j=0,l=NaN,k=NaN,m=this.viewer.getZoomSetting(),
s=null,w=NaN,n=NaN,t=NaN,r=NaN,u=NaN,q=NaN,v=null;switch(this.getToken(d).tok){case 1073742110:v=this.floatParameterSet(++d,18,21);d=this.iToken+1;if(this.chk&&0<this.checkLength(d))return;break;case 135270417:e=!1;1073742029==this.tokAt(++d)&&(e=!0,d++);10==this.tokAt(d)||1048577==this.tokAt(d)?(e=!0,c=this.centerParameter(d),Clazz.instanceOf(this.expressionResult,JU.BS)||this.invArg(),f=this.expressionResult,g=this.chk?new J.util.Quaternion:this.viewer.getAtomQuaternion(f.nextSetBit(0))):g=this.getQuaternionParameter(d);
d=this.iToken+1;null==g&&this.invArg();g=g.toAxisAngle4f();b.set(g.x,g.y,g.z);e=(e?-1:1)*(180*g.angle/3.141592653589793);break;case 9:case 8:case 1048586:this.isPoint3f(d)?(b.setT(this.getPoint3f(d,!0)),d=this.iToken+1,e=this.floatParameter(d++)):(e=this.getPoint4f(d),d=this.iToken+1,b.set(e.x,e.y,e.z),e=0==e.x&&0==e.y&&0==e.z?NaN:e.w);break;case 1073741954:b.set(1,0,0);e=0;this.checkLength(++d);break;case 1073741859:b.set(0,1,0);e=180;this.checkLength(++d);break;case 1073741996:b.set(0,1,0);this.checkLength(++d);
break;case 1073742128:b.set(0,-1,0);this.checkLength(++d);break;case 1074790748:b.set(1,0,0);this.checkLength(++d);break;case 1073741871:b.set(-1,0,0);this.checkLength(++d);break;default:b=JU.V3.new3(this.floatParameter(d++),this.floatParameter(d++),this.floatParameter(d++)),e=this.floatParameter(d++)}Float.isNaN(b.x)||Float.isNaN(b.y)||Float.isNaN(b.z)?b.set(0,0,0):0==b.length()&&0==e&&(e=NaN);g=!this.viewer.isInPosition(b,e);this.isFloatParameter(d)&&(l=this.floatParameter(d++));this.isFloatParameter(d)&&
!this.isCenterParameter(d)&&(h=this.floatParameter(d++),j=this.floatParameter(d++),!g&&1<=Math.abs(h-this.viewer.getTranslationXPercent())&&(g=!0),!g&&1<=Math.abs(j-this.viewer.getTranslationYPercent())&&(g=!0));null==f&&d!=this.slen&&(c=this.centerParameter(d),Clazz.instanceOf(this.expressionResult,JU.BS)&&(f=this.expressionResult),d=this.iToken+1);if(null!=c){!g&&0.1<=c.distance(this.viewer.getRotationCenter())&&(g=!0);this.isFloatParameter(d)&&(k=this.floatParameter(d++));this.isCenterParameter(d)||
((0==k||Float.isNaN(k))&&(0==l||Float.isNaN(l))?(f=Math.abs(this.getZoom(0,d,f,0==l?0:m)),d=this.iToken+1,l=f):!g&&0.1<=Math.abs(k-this.viewer.getFloat(570425388))&&(g=!0));if(0==l||Float.isNaN(l))l=100;Float.isNaN(k)&&(k=0);!g&&1<=Math.abs(l-m)&&(g=!0);d!=this.slen&&(s=this.centerParameter(d),d=this.iToken+1,d!=this.slen&&(w=this.floatParameter(d++),n=this.floatParameter(d++)),d!=this.slen&&(t=this.floatParameter(d++)),d!=this.slen&&(r=this.floatParameter(d++),!g&&0.01<=Math.abs(r-this.viewer.getCameraDepth())&&
(g=!0)),d+1<this.slen&&(u=this.floatParameter(d++),q=this.floatParameter(d++),!g&&0.01<=Math.abs(u-this.viewer.getCamera().x)&&(g=!0),!g&&0.01<=Math.abs(q-this.viewer.getCamera().y)&&(g=!0)))}this.checkLength(d);if(!this.chk&&(g||(a=0),0<a&&this.refresh(),this.useThreads()||(a=0),0==r&&(r=u=q=NaN),null!=v?this.viewer.movePyMOL(this,a,v):this.viewer.moveTo(this,a,c,b,e,null,l,h,j,k,s,w,n,t,r,u,q),this.isJS&&0<a&&this.viewer.global.waitForMoveTo))throw new J.script.ScriptInterruption(this,"moveTo",
1);}}},$fz.isPrivate=!0,$fz));$_M(c$,"bondorder",($fz=function(){this.checkLength(-3);var a=0;switch(this.getToken(1).tok){case 2:case 3:131071==(a=J.util.JmolEdge.getBondOrderFromFloat(this.floatParameter(1)))&&this.invArg();break;default:131071==(a=J.script.ScriptEvaluator.getBondOrderFromString(this.parameterAsString(1)))&&this.invArg(),33==a&&3==this.tokAt(2)&&(a=J.script.ScriptEvaluator.getPartialBondOrderFromFloatEncodedInt(this.st[2].intValue))}this.setShapeProperty(1,"bondOrder",Integer.$valueOf(a))},
$fz.isPrivate=!0,$fz));$_M(c$,"console",($fz=function(){switch(this.getToken(1).tok){case 1048588:this.chk||this.viewer.showConsole(!1);break;case 1048589:this.chk||this.viewer.showConsole(!0);break;case 1073741882:this.chk||this.viewer.clearConsole();break;case 135270421:this.showString(this.stringParameter(2));break;default:this.invArg()}},$fz.isPrivate=!0,$fz));$_M(c$,"centerAt",($fz=function(){var a=null;switch(this.getToken(1).tok){case 1073741826:a="absolute";break;case 96:a="average";break;
case 1679429641:a="boundbox";break;default:this.invArg()}var b=JU.P3.new3(0,0,0);5==this.slen?(b.x=this.floatParameter(2),b.y=this.floatParameter(3),b.z=this.floatParameter(4)):this.isCenterParameter(2)?(b=this.centerParameter(2),this.checkLast(this.iToken)):this.checkLength(2);this.chk||this.viewer.setCenterAt(a,b)},$fz.isPrivate=!0,$fz));$_M(c$,"stereo",($fz=function(){for(var a=J.constant.EnumStereoMode.DOUBLE,b=-5,c=!1,d=null,e=0,f=1;f<this.slen;++f)if(this.isColorParam(f))1<e&&this.error(2),
0==e&&(d=Clazz.newIntArray(2,0)),c||(b=3),d[e]=this.getArgbParam(f),0==e++&&(d[1]=~d[0]),f=this.iToken;else switch(this.getToken(f).tok){case 1048589:this.checkLast(this.iToken=1);this.iToken=1;break;case 1048588:this.checkLast(this.iToken=1);a=J.constant.EnumStereoMode.NONE;break;case 2:case 3:b=this.floatParameter(f);c=!0;break;case 1073741824:if(c||(b=3),a=J.constant.EnumStereoMode.getStereoMode(this.parameterAsString(f)),null!=a)break;default:this.invArg()}this.chk||this.viewer.setStereoMode(d,
a,b)},$fz.isPrivate=!0,$fz));$_M(c$,"connect",($fz=function(a){var b=Clazz.newFloatArray(2,0),c=Array(2);c[0]=c[1]=this.viewer.getSelectionSet(!1);var d=NaN;this.colorArgb[0]=-2147483648;var e=0,f=131071,g=1073742026,h=!1,j=!1,l=!1,k=3.4028235E38,m=!1,s=0,w=0,n=new JU.BS,t=!1,r=0,u=0,q=0,v=!1;if(1==this.slen)this.chk||this.viewer.rebondState(this.isStateScript);else{for(;a<this.slen;++a){switch(this.getToken(a).tok){case 1048589:case 1048588:this.checkLength(2);this.chk||this.viewer.rebondState(this.isStateScript);
return;case 2:case 3:if(0<s){(j||m)&&this.error(23);f=J.util.JmolEdge.getBondOrderFromFloat(this.floatParameter(a));131071==f&&this.invArg();j=!0;break}2<++w&&this.error(2);var p=this.floatParameter(a);269484210==this.tokAt(a+1)&&(p=-p/100,a++);b[e++]=p;break;case 10:case 1048577:(2<s||t&&0<s)&&this.error(2);(j||m)&&this.error(23);c[s++]=this.atomExpressionAt(a);t=this.isBondSet;if(2==s){for(var p=this.iToken,y=a;y<p;y++)if(1073741824==this.tokAt(y)&&this.parameterAsString(y).equals("_1")){r=a;break}this.iToken=
p}a=this.iToken;break;case 1087373318:v=!0;break;case 1766856708:case 603979967:case 1073742074:m=!0;k=this.getColorTrans(a,!1);a=this.iToken;break;case 1074790662:b=1073741852==this.tokAt(2);this.checkLength(b?3:2);this.chk||this.viewer.setPdbConectBonding(b,this.isStateScript);return;case 1073741830:case 1073741852:case 1073741904:case 1073742025:case 1073742026:l=!0;++a!=this.slen&&this.error(23);g=this.theTok;1073741852==this.theTok&&!(131071==f||2048==f||515==f)&&this.invArg();break;case 1708058:m||
(this.colorArgb[0]=16777215,k=0.5,d=this.viewer.getFloat(570425406),m=!0),l||(g=1073742026),l=!0;case 1073741824:if(this.isColorParam(a)){u=-a;break}case 1076887572:case 1612189718:f=this.parameterAsString(a);131071==(f=J.script.ScriptEvaluator.getBondOrderFromString(f))&&this.invArg();j&&this.error(18);j=!0;switch(f){case 33:switch(this.tokAt(a+1)){case 3:f=J.script.ScriptEvaluator.getPartialBondOrderFromFloatEncodedInt(this.st[++a].intValue);break;case 2:f=this.intParameter(++a)}break;case 2048:2==
this.tokAt(a+1)&&(f=this.intParameter(++a)<<11,q=this.floatParameter(++a))}break;case 1666189314:d=this.floatParameter(++a);m=!0;break;case 1048587:case 12291:++a!=this.slen&&this.error(23);g=12291;h=!0;m=!1;break;default:u=a}0<a&&(u==-a||u==a&&this.isColorParam(a)?(m=!0,this.colorArgb[0]=this.getArgbParam(a),a=this.iToken):u==a&&this.invArg())}if(!this.chk){2>e&&(0==e&&(b[0]=1E8),b[1]=b[0],b[0]=0.1);m&&(j||(f=65535),l||(g=1073742025));j=e=0;if(0<r){q=new JU.BS;this.definedAtomSets.put("_1",q);v=
c[0];for(l=v.nextSetBit(0);0<=l;l=v.nextSetBit(l+1))q.set(l),c=this.viewer.makeConnections(b[0],b[1],f,g,q,this.atomExpressionAt(r),n,t,!1,0),e+=Math.abs(c[0]),j+=c[1],q.clear(l)}else c=this.viewer.makeConnections(b[0],b[1],f,g,c[0],c[1],n,t,v,q),e+=Math.abs(c[0]),j+=c[1];h?this.tQuiet||this.scriptLevel>this.scriptReportingLevel||this.scriptStatusOrBuffer(J.i18n.GT._("{0} connections deleted",j)):(m&&(this.viewer.selectBonds(n),Float.isNaN(d)||this.setShapeSizeBs(1,Math.round(2E3*d),null),this.finalizeObject(1,
this.colorArgb[0],k,0,!1,null,0,n),this.viewer.selectBonds(null)),this.tQuiet||this.scriptLevel>this.scriptReportingLevel||this.scriptStatusOrBuffer(J.i18n.GT._("{0} new bonds; {1} modified",[Integer.$valueOf(e),Integer.$valueOf(j)])))}}},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"getTranslucentLevel",($fz=function(a){a=this.floatParameter(a);return 2==this.theTok&&0<a&&9>a?a+1:a},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"getProperty",($fz=function(){if(!this.chk){var a="",b=a=this.optParameterAsString(1);0<=
b.indexOf(".")&&(b=b.substring(0,b.indexOf(".")));0<=b.indexOf("[")&&(b=b.substring(0,b.indexOf("[")));var b=this.viewer.getPropertyNumber(b),c="";switch(this.tokAt(2)){default:c=this.optParameterAsString(2);break;case 1048577:case 10:if(c=this.atomExpressionAt(2),a.equalsIgnoreCase("bondInfo"))switch(this.tokAt(++this.iToken)){case 1048577:case 10:c=[c,this.atomExpressionAt(this.iToken)]}}if(0<a.length&&0>b)c=a="";else if(0<=b&&3>this.slen)c=this.viewer.getDefaultPropertyParam(b),c.equals("(visible)")&&
(this.viewer.setModelVisibility(),c=this.viewer.getVisibleSet());else if(b==this.viewer.getPropertyNumber("fileContents")){b=c.toString();for(c=3;c<this.slen;c++)b+=this.parameterAsString(c);c=b}a=this.viewer.getProperty("readable",a,c);this.showString(a)}},$fz.isPrivate=!0,$fz));$_M(c$,"background",($fz=function(a){this.getToken(a);if(1073741979==this.theTok)a=this.parameterAsString(this.checkLast(++a)),!this.chk&&(!a.equalsIgnoreCase("none")&&0<a.length)&&this.viewer.loadImage(a,null);else if(this.isColorParam(a)||
1048587==this.theTok)a=this.getArgbParamLast(a,!0),this.chk||(this.setObjectArgb("background",a),this.viewer.setBackgroundImage(null,null));else{var b=this.getShapeType(this.theTok);this.colorShape(b,a+1,!0)}},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"center",($fz=function(a){1==this.slen?this.viewer.setNewRotationCenter(null):(a=this.centerParameter(a),null==a&&this.invArg(),this.chk||this.viewer.setNewRotationCenter(a))},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"setObjectProperty",function(){var a=this.getShapeNameParameter(2);
if(this.chk)return"";var b=this.iToken,c=this.tokAt(0);return this.setObjectProp(a,c,b)});Clazz.overrideMethod(c$,"setObjectPropSafe",function(a,b,c){try{return this.setObjectProp(a,b,c)}catch(d){if(Clazz.exceptionOf(d,J.script.ScriptException))return null;throw d;}},"~S,~N,~N");$_M(c$,"setObjectProp",function(a,b,c){for(var d=[a,null],e="",f=J.util.Txt.isWild(a),g=17;;){if(27!=g&&this.getShapePropertyData(g,"checkID",d)){this.setShapeProperty(g,"thisID",a);switch(b){case 12291:this.setShapeProperty(g,
"delete",null);break;case 12294:case 1610625028:this.setShapeProperty(g,"hidden",1610625028==b?Boolean.FALSE:Boolean.TRUE);break;case 4148:e+=this.getShapeProperty(g,"command")+"\n";break;case 1766856708:0<=c&&this.colorShape(g,c+1,!1)}if(!f)break}17==g&&(g=31);if(22>--g)break}return e},"~S,~N,~N");$_M(c$,"color",($fz=function(){var a=1;if(this.isColorParam(1))this.theTok=1141899265;else{var b=0,a=2,c=this.getToken(1).tok;switch(c){case 1048583:this.setObjectProperty();return;case 1087373315:case 3145730:case 1087373316:case 1073741946:case 1632634889:case 1087373318:case 1114638362:case 1087373322:case 1073741992:case 1095761934:case 1073742030:case 1048587:case 1073742074:case 1112541196:case 1095761935:case 1716520985:case 1073742116:case 1113200651:case 1073742144:case 1112539150:case 1641025539:case 1112539151:case 1112541199:case 603979967:case 1073742186:case 1649412120:this.theTok=
1141899265;a=1;break;case 4:a=1;b=this.stringParameter(a++);this.isArrayParameter(a)&&(b=b+="="+J.script.SV.sValue(J.script.SV.getVariableAS(this.stringParameterSet(a))).$replace("\n"," "),a=this.iToken+1);c=603979967==this.tokAt(a);this.chk||this.viewer.setPropertyColorScheme(b,c,!0);c&&++a;if(1073742114==this.tokAt(a)||1073741826==this.tokAt(a))b=this.floatParameter(++a),a=this.floatParameter(++a),this.chk||this.viewer.setCurrentColorRange(b,a);return;case 1073742114:case 1073741826:b=this.floatParameter(2);
a=this.floatParameter(this.checkLast(3));this.chk||this.viewer.setCurrentColorRange(b,a);return;case 1610616835:b=this.getArgbParamLast(2,!0);this.chk||this.setObjectArgb("background",b);return;case 10:case 1048577:a=-1;this.theTok=1141899265;break;case 1073742134:b=this.getArgbParamLast(2,!1);this.chk||this.viewer.setRubberbandArgb(b);return;case 536870920:case 1611141171:a=2;1073742074==this.tokAt(2)&&a++;b=this.getArgbParamLast(a,!0);if(this.chk)return;this.sm.loadShape(8);this.setShapeProperty(8,
1611141171==c?"argbSelection":"argbHighlight",Integer.$valueOf(b));return;case 1611272194:case 1679429641:case 1614417948:case 1073741824:case 1613758476:c=this.parameterAsString(1);if(this.checkToken(2))switch(this.getToken(2).tok){case 1073742116:b=1073742116;break;case 1048587:case 1073741992:b=1073741992;break;default:b=this.getArgbParam(2)}0==b&&this.error(9);this.checkLast(this.iToken);if(c.equalsIgnoreCase("axes")||0<=J.viewer.StateManager.getObjectIdFromName(c)){this.setObjectArgb(c,b);return}if(this.changeElementColor(c,
b))return;this.invArg();break;case 135180:case 135402505:this.setShapeProperty(J.viewer.JC.shapeTokenIndex(c),"thisID","+PREVIOUS_MESH+")}}this.colorShape(this.getShapeType(this.theTok),a,!1)},$fz.isPrivate=!0,$fz));$_M(c$,"changeElementColor",($fz=function(a,b){for(var c=J.util.Elements.elementNumberMax;0<=--c;)if(a.equalsIgnoreCase(J.util.Elements.elementNameFromNumber(c)))return this.chk||this.viewer.setElementArgb(c,b),!0;for(c=J.util.Elements.altElementMax;0<=--c;)if(a.equalsIgnoreCase(J.util.Elements.altElementNameFromIndex(c)))return this.chk||
this.viewer.setElementArgb(J.util.Elements.altElementNumberFromIndex(c),b),!0;if("_"!=a.charAt(0))return!1;for(c=J.util.Elements.elementNumberMax;0<=--c;)if(a.equalsIgnoreCase("_"+J.util.Elements.elementSymbolFromNumber(c)))return this.chk||this.viewer.setElementArgb(c,b),!0;for(c=J.util.Elements.altElementMax;4<=--c;)if(a.equalsIgnoreCase("_"+J.util.Elements.altElementSymbolFromIndex(c))||a.equalsIgnoreCase("_"+J.util.Elements.altIsotopeSymbolFromIndex(c)))return this.chk||this.viewer.setElementArgb(J.util.Elements.altElementNumberFromIndex(c),
b),!0;return!1},$fz.isPrivate=!0,$fz),"~S,~N");$_M(c$,"colorShape",($fz=function(a,b,c){var d=null,e=null,f=null,g=null,h=2==b&&1073741860==this.tokAt(1)?"ball":"",j=!1,l=24==a||25==a,k=0,m=!1,s=3.4028235E38;0>b&&(g=this.atomExpressionAt(-b),b=this.iToken+1,this.isBondSet&&(m=!0,a=1));var w=this.getToken(b).tok;c?this.getToken(b):!0==(c=1610616835==w)&&this.getToken(++b);if(c)h="bg";else if(l)switch(this.theTok){case 1073742018:this.getToken(++b);h="mesh";break;case 1073742094:c=this.getArgbParamOrNone(++b,
!1);f=0==c?null:Integer.$valueOf(c);this.getToken(b=this.iToken+1);break;case 10:case 1048577:Clazz.instanceOf(this.theToken.value,J.modelset.Bond.BondSet)?(g=this.theToken.value,h="vertex"):(g=this.atomExpressionAt(b),h="atom"),this.getToken(b=this.iToken+1)}if(this.chk||27!=a||this.getExtension().dispatch(27,!0,this.st)){if((c=603979967==this.theTok)||1073742074==this.theTok)1.4E-45==s&&this.invArg(),d=this.parameterAsString(b++),c&&this.isFloatParameter(b)&&(s=this.getTranslucentLevel(b++));w=
0;if(b<this.slen&&1048589!=this.tokAt(b)&&1048588!=this.tokAt(b))if(j=!0,w=this.getToken(b).tok,(!l||1074790746!=this.tokAt(b+1))&&this.isColorParam(b)){if(c=this.getArgbParamOrNone(b,!1),e=0==c?null:Integer.$valueOf(c),null==d&&0!=this.tokAt(b=this.iToken+1))this.getToken(b),(c=603979967==this.theTok)||1073742074==this.theTok?(d=this.parameterAsString(b),c&&this.isFloatParameter(b+1)&&(s=this.getTranslucentLevel(++b))):this.isColorParam(b)&&(c=this.getArgbParamOrNone(b,!1),f=0==c?null:Integer.$valueOf(c))}else if(26==
a)this.iToken--;else{var k=this.parameterAsString(b).toLowerCase(),n=0==k.indexOf("byelement"),t=n||0==k.indexOf("byresidue"),e=t||l?J.constant.EnumPalette.PROPERTY:1113200651==w?J.constant.EnumPalette.CPK:J.constant.EnumPalette.getPalette(k);(e===J.constant.EnumPalette.UNKNOWN||(e===J.constant.EnumPalette.TYPE||e===J.constant.EnumPalette.ENERGY)&&2!=a)&&this.invArg();var r=null,u=e!==J.constant.EnumPalette.PROPERTY&&e!==J.constant.EnumPalette.VARIABLE||!this.viewer.global.rangeSelected?null:this.viewer.getSelectionSet(!1);
if(e===J.constant.EnumPalette.PROPERTY)if(t)this.chk||(r=this.getBitsetPropertyFloat(u,(n?1095763976:1095761930)|256,NaN,NaN));else{if(!t&&!l&&b++,k.equals("property")&&J.script.T.tokAttr(w=this.getToken(b).tok,1078984704)&&!J.script.T.tokAttr(w,1087373312))this.chk||(r=this.getBitsetPropertyFloat(u,this.getToken(b++).tok|256,NaN,NaN))}else e===J.constant.EnumPalette.VARIABLE&&(b++,k=this.parameterAsString(b++),r=Clazz.newFloatArray(this.viewer.getAtomCount(),0),J.util.ParserBS.parseStringInfestedFloatArray(""+
this.getParameter(k,4),null,r),e=J.constant.EnumPalette.PROPERTY);if(e===J.constant.EnumPalette.PROPERTY){var q=null;4==this.tokAt(b)?(q=this.parameterAsString(b++).toLowerCase(),this.isArrayParameter(b)&&(q+="="+J.script.SV.sValue(J.script.SV.getVariableAS(this.stringParameterSet(b))).$replace("\n"," "),b=this.iToken+1)):l&&this.isColorParam(b)&&(q=this.getColorRange(b),b=this.iToken+1);null!=q&&!l&&(this.setStringProperty("propertyColorScheme",(c&&3.4028235E38==s?"translucent ":"")+q),t=0==q.indexOf("byelement")||
0==q.indexOf("byresidue"));var n=0,v=3.4028235E38;if(!t&&(1073741826==this.tokAt(b)||1073742114==this.tokAt(b)))n=this.floatParameter(b+1),v=this.floatParameter(b+2),b+=3,n==v&&l?(t=this.getShapeProperty(a,"dataRange"),null!=t&&(n=t[0],v=t[1])):n==v&&(v=3.4028235E38);if(!this.chk)if(l||(null==r?this.viewer.setCurrentColorRange(k):this.viewer.setCurrentColorRangeData(r,u)),l){this.checkLength(b);j=!1;k=this.viewer.getColorEncoder(q);if(null==k)return;k.isTranslucent=c&&3.4028235E38==s;k.setRange(n,
v,n>v);3.4028235E38==v&&(k.hi=v);this.setShapeProperty(a,"remapColor",k);this.showString(this.getIsosurfaceDataRange(a,""));if(3.4028235E38==s)return}else 3.4028235E38!=v&&this.viewer.setCurrentColorRange(n,v)}else b++;this.checkLength(b)}if(!(this.chk||0>a)){switch(a){case 4:k=32768;break;case 2:k=30720;break;case 3:k=256;break;case 1:k=1023;break;default:k=0}0==k?(this.sm.loadShape(a),5==a&&this.setShapeProperty(5,"setDefaults",this.viewer.getNoneSelected())):(null!=g&&(this.viewer.selectBonds(g),
g=null),a=1,this.setShapeProperty(a,"type",Integer.$valueOf(k)));if(j){switch(w){case 1112539151:case 1112539150:this.viewer.autoCalculate(w);break;case 1112541199:this.viewer.global.rangeSelected&&this.viewer.clearBfactorRange();break;case 1087373318:this.viewer.calcSelectedGroupsCount();break;case 1095761935:case 1073742030:this.viewer.calcSelectedMonomersCount();break;case 1095761934:this.viewer.calcSelectedMoleculesCount()}null!=f&&(l||11==a||14==a)?this.setShapeProperty(a,"colorPhase",[f,e]):
null==g?this.setShapeProperty(a,h+"color",e):this.setShapePropertyBs(a,h+"color",e,g)}null!=d&&this.setShapeTranslucency(a,h,d,s,g);0!=k&&this.setShapeProperty(1,"type",Integer.$valueOf(1023));m&&this.viewer.selectBonds(null);0==a&&this.viewer.checkInheritedShapes()}}},$fz.isPrivate=!0,$fz),"~N,~N,~B");$_M(c$,"setShapeTranslucency",function(a,b,c,d,e){3.4028235E38==d&&(d=this.viewer.getFloat(570425354));this.setShapeProperty(a,"translucentLevel",Float.$valueOf(d));null!=b&&(null==e?this.setShapeProperty(a,
b+"translucency",c):this.chk||this.setShapePropertyBs(a,b+"translucency",c,e))},"~N,~S,~S,~N,JU.BS");$_M(c$,"cd",($fz=function(){if(!this.chk){var a=1==this.slen?null:this.parameterAsString(1);this.showString(this.viewer.cd(a))}},$fz.isPrivate=!0,$fz));$_M(c$,"define",($fz=function(){(3>this.slen||!Clazz.instanceOf(this.getToken(1).value,String))&&this.invArg();var a=this.getToken(1).value.toLowerCase();-2147483648!=JU.ParserJS.parseInt(a)&&this.invArg();if(!this.chk){var b=a.startsWith("site_");
if(0==a.indexOf("dynamic_")||b){for(var c=Array(this.slen),d=this.slen;0<=--d;)c[d]=this.st[d];this.definedAtomSets.put("!"+(b?a:a.substring(8)),c)}else b=this.atomExpressionAt(2),this.definedAtomSets.put(a,b),this.chk||this.viewer.setUserVariable("@"+a,J.script.SV.newVariable(10,b))}},$fz.isPrivate=!0,$fz));$_M(c$,"echo",($fz=function(a,b,c){if(!this.chk){a=this.optParameterAsString(a);if(this.viewer.getEchoStateActive()){if(c){this.viewer.loadImage(a,b);return}a.startsWith("\u0001")&&(a=a.substring(1),
c=!0);null!=a&&this.setShapeProperty(30,"text",a)}!c&&this.viewer.getRefreshing()&&this.showString(this.viewer.formatText(a))}},$fz.isPrivate=!0,$fz),"~N,~S,~B");$_M(c$,"message",($fz=function(){var a=this.parameterAsString(this.checkLast(1));this.chk||(a=this.viewer.formatText(a),null==this.outputBuffer&&this.viewer.showMessage(a),a.startsWith("_")||this.scriptStatusOrBuffer(a))},$fz.isPrivate=!0,$fz));$_M(c$,"log",($fz=function(){1==this.slen&&this.error(2);if(!this.chk){var a=this.parameterExpressionString(1,
0);1048588==this.tokAt(1)?this.setStringProperty("logFile",""):this.viewer.log(a)}},$fz.isPrivate=!0,$fz));$_M(c$,"label",($fz=function(a){if(!this.chk){this.sm.loadShape(5);var b=null;switch(this.getToken(a).tok){case 1048589:b=this.viewer.getStandardLabelFormat(0);break;case 1048588:break;case 12294:case 1610625028:this.setShapeProperty(5,"display",1610625028==this.theTok?Boolean.TRUE:Boolean.FALSE);return;default:b=this.parameterAsString(a)}this.sm.setLabel(b,this.viewer.getSelectionSet(!1))}},
$fz.isPrivate=!0,$fz),"~N");$_M(c$,"hover",($fz=function(){if(!this.chk){var a=this.parameterAsString(1);a.equalsIgnoreCase("on")?a="%U":a.equalsIgnoreCase("off")&&(a=null);this.viewer.setHoverLabel(a)}},$fz.isPrivate=!0,$fz));$_M(c$,"load",function(){var a=!this.chk||this.isCmdLine_C_Option,b=!1,c=!1,d=!1,e=!1,f,g=135270407==this.tokAt(0)?0:1,h=this.viewer.getBoolean(603979792),j=null,l=null,k=this.viewer.getModelCount()-(this.viewer.getFileName().equals("zapped")?1:0),m=this.viewer.getAtomCount(),
s=(new JU.SB).append("load"),w=1,n=new java.util.Hashtable;this.isStateScript&&(n.put("isStateScript",Boolean.TRUE),this.forceNoAddHydrogens&&n.put("doNotAddHydrogens",Boolean.TRUE));var t=null,r=null,u=null,q=null,q="",v=0,p;if(1==this.slen)g=0;else{t=this.parameterAsString(g);if(2==this.slen&&!this.chk&&(t.endsWith(".spt")||t.endsWith(".png")||t.endsWith(".pngj"))){this.script(0,t,null);return}switch(p=this.tokAt(g)){case 1073742015:b=this.parameterAsString(this.checkLast(2));this.chk||this.viewer.setMenu(b,
!0);return;case 135270407:e=!0;s.append(" /*data*/ data");f=this.stringParameter(++g).toLowerCase();s.append(" ").append(J.util.Escape.eS(f));var b=f.startsWith("append"),y=0<=f.indexOf("@")?""+this.getParameter(f.substring(f.indexOf("@")+1),4):this.parameterAsString(++g),y=J.viewer.Viewer.fixInlineString(y,this.viewer.getInlineChar());n.put("fileData",y);n.put("isData",Boolean.TRUE);s.appendC("\n");s.append(y);0>f.indexOf("@")&&(s.append(" end ").append(J.util.Escape.eS(f)),g+=2);break;case 1073741839:b=
!0;s.append(" append");t=this.optParameterAsString(++g);p=J.script.T.getTokFromName(t);break;case 1073741824:g++,s.append(" "+t),v=1073741824==p&&J.util.Parser.isOneOf(t.toLowerCase(),";xyz;vxyz;vibration;temperature;occupancy;partialcharge;")?J.script.T.getTokFromName(t):0,0!=v&&(n.put("atomDataOnly",Boolean.TRUE),n.put("modelNumber",Integer.$valueOf(1)),4166==v&&(v=1146095631),u=this.viewer.getFileInfo(),b=!0)}switch(p){case 1229984263:g++;s.append(" "+t);7==this.tokAt(g)&&(r=this.stringParameterSet(g),
g=this.iToken,g+1!=this.slen&&this.invArg(),null!=r&&(w=r.length));break;case 1073741983:c=!0;g++;s.append(" "+t);break;case 135267336:d=!0;g++;break;case 4156:n.put("async",Boolean.TRUE);g++;break;case 536870926:case 1095766028:g++;s.append(" "+t);536870926==p&&n.put("isTrajectory",Boolean.TRUE);this.isPoint3f(g)?(p=this.getPoint3f(g,!1),g=this.iToken+1,n.put("firstLastStep",[Clazz.floatToInt(p.x),Clazz.floatToInt(p.y),Clazz.floatToInt(p.z)]),s.append(" "+J.util.Escape.eP(p))):10==this.tokAt(g)?
(f=this.getToken(g++).value,n.put("bsModels",f),s.append(" "+J.util.Escape.eBS(f))):n.put("firstLastStep",[0,-1,1]);break;case 1073741824:break;default:t="fileset"}null==r&&4!=this.getToken(g).tok&&this.error(16)}p=g;f=null;1073741848==this.tokAt(p+1)&&(f=this.stringParameter(g+=2),""!==this.viewer.getPathForAllFiles()&&(f=null,p=g));var z=y=null,B=null;if(this.slen==g+1){if(0==g||null==r&&0==(y=this.parameterAsString(p)).length)y=this.viewer.getFullPathName();if(null==y&&null==r){this.zap(!1);return}if(null==
r&&!c)if(d)y="$"+y;else{if(0<=y.indexOf("[]"))return;0==y.indexOf("[")&&(r=J.util.Escape.unescapeStringArray(y),null!=r&&(1==g&&s.append(" files"),w=r.length))}if(null!=r)for(var A=0;A<w;A++)s.append(" /*file*/").append(J.util.Escape.eS(r[A]))}else if(1073742010==this.getToken(g+1).tok||2==this.theTok||7==this.theTok||269484096==this.theTok||1073742195==this.theTok||1048586==this.theTok||8==this.theTok||1073742080==this.theTok||1095761926==this.theTok||1073742163==this.theTok||1073742114==this.theTok||
1073742152==this.theTok||1614417948==this.theTok||1073742066==this.theTok||1073741940==this.theTok&&1048582!=this.tokAt(g+3)||1073741839==this.theTok||1073741824==this.theTok&&1048582!=this.tokAt(g+3)){if(0==(y=this.parameterAsString(p)).length&&null==(y=this.viewer.getFullPathName())){this.zap(!1);return}p==g&&g++;if(0<=y.indexOf("[]"))return;if(1073742010==(p=this.tokAt(g)))l=this.stringParameter(++g),n.put("manifest",l),q+=" MANIFEST "+J.util.Escape.eS(l),p=this.tokAt(++g);switch(p){case 2:l=this.intParameter(g);
q+=" "+l;0>l?n.put("vibrationNumber",Integer.$valueOf(-l)):n.put("modelNumber",Integer.$valueOf(l));p=this.tokAt(++g);break;case 7:case 269484096:case 1073742195:l=this.floatParameterSet(g,1,2147483647);g=this.iToken;d=new JU.BS;for(A=0;A<l.length;A++)1<=l[A]&&l[A]==Clazz.floatToInt(l[A])&&d.set(Clazz.floatToInt(l[A])-1);n.put("bsModels",d);l=Clazz.newIntArray(d.cardinality(),0);p=0;for(A=d.nextSetBit(0);0<=A;A=d.nextSetBit(A+1))l[p++]=A+1;q+=" "+J.util.Escape.eAI(l);p=this.tokAt(g)}d=null;if(1048586==
p||8==p)d=this.getPoint3f(g,!1),g=this.iToken+1,p=this.tokAt(g);switch(p){case 1073742080:case 1095761926:case 1073742163:case 1073742114:case 1073742152:case 1614417948:null==d&&(d=JU.P3.new3(555,555,-1)),this.iToken=g-1}l=null;if(null!=d){n.put("lattice",d);g=this.iToken+1;q+=" {"+Clazz.floatToInt(d.x)+" "+Clazz.floatToInt(d.y)+" "+Clazz.floatToInt(d.z)+"}";1073742080==this.tokAt(g)&&(n.put("packed",Boolean.TRUE),q+=" PACKED",g++);1095761926==this.tokAt(g)&&(n.put("centroid",Boolean.TRUE),q+=" CENTROID",
g++,1073742080==this.tokAt(g)&&!n.containsKey("packed")&&(n.put("packed",Boolean.TRUE),q+=" PACKED",g++));if(1073742163==this.tokAt(g)){if(this.isPoint3f(++g)){p=this.getPoint3f(g,!1);if(p.x!=Clazz.floatToInt(p.x)||p.y!=Clazz.floatToInt(p.y)||p.z!=Clazz.floatToInt(p.z)||1>p.x||1>p.y||1>p.z)this.iToken=g,this.invArg();g=this.iToken+1}else p=this.stringParameter(g++);n.put("supercell",p)}p=0;1073742114==this.tokAt(g)&&(g++,p=this.floatParameter(g++),q+=" range "+p);n.put("symmetryRange",Float.$valueOf(p));
p=null;p=-2147483648;1073742152==this.tokAt(g)&&(++g,p=J.util.Txt.simpleReplace(this.parameterAsString(g++),"''",'"'),q+=" spacegroup "+J.util.Escape.eS(p),p.equalsIgnoreCase("ignoreOperators")?p=-999:(0==p.length?(d=this.viewer.getCurrentUnitCell(),null!=d&&(p=d.getSpaceGroupName())):0<=p.indexOf(",")&&9>d.x&&(9>d.y&&0==d.z)&&(p+="#doNormalize=0"),n.put("spaceGroupName",p),p=-2));var D=null;if(1614417948==this.tokAt(g)){++g;0==this.optParameterAsString(g).length?(d=this.viewer.getCurrentUnitCell(),
null!=d&&(D=d.getUnitCellAsArray(!0),l=d.getCartesianOffset())):D=this.floatParameterSet(g,6,9);(null==D||6!=D.length&&9!=D.length)&&this.invArg();q+=" unitcell {";for(A=0;A<D.length;A++)q+=(0==A?"":" ")+D[A];q+="}";n.put("unitcell",D);-2147483648==p&&(p=-1);g=this.iToken+1}-2147483648!=p&&n.put("spaceGroupIndex",Integer.$valueOf(p))}null!=l?this.coordinatesAreFractional=!1:1073742066==this.tokAt(g)&&(l=this.getPoint3f(++g,!0));null!=l&&(this.coordinatesAreFractional?(l.setT(this.fractionalPoint),
n.put("unitCellOffsetFractional",this.coordinatesAreFractional?Boolean.TRUE:Boolean.FALSE),q+=" offset {"+l.x+" "+l.y+" "+l.z+"/1}"):q+=" offset "+J.util.Escape.eP(l),n.put("unitCellOffset",l),g=this.iToken+1);1073741839==this.tokAt(g)&&(135270407==this.tokAt(++g)?(g+=2,z=this.getToken(g++).value,B=this.stringParameter(++g),++g):(B=this.stringParameter(g++),z=this.stringParameter(g++)),n.put(B,z));1073741940==this.tokAt(g)&&(j=this.stringParameter(++g))}else{1==g&&(g++,s.append(" "+t));d=p=null;for(r=
new JU.List;g<this.slen;){switch(this.tokAt(g)){case 1073741940:j=this.stringParameter(++g);++g;continue;case 1048582:n.remove("isTrajectory");null==l&&(l=new JU.List,p=JU.P3.new3(0,-1,1));this.isPoint3f(++g)?(p=this.getPoint3f(g,!1),g=this.iToken+1):10==this.tokAt(g)&&(d=this.getToken(g).value,p=null,g=this.iToken+1);break;case 1073741824:this.invArg()}r.addLast(y=this.parameterAsString(g++));null!=p?(l.addLast([Clazz.floatToInt(p.x),Clazz.floatToInt(p.y),Clazz.floatToInt(p.z)]),s.append(" COORD "+
J.util.Escape.eP(p))):null!=d&&(l.addLast(d),s.append(" COORD "+J.util.Escape.eBS(d)));s.append(" /*file*/$FILENAME"+r.size()+"$")}null!=l&&n.put("firstLastSteps",l);w=r.size();r=r.toArray(Array(w))}if(a)if(null!=r&&(y="fileSet"),null!=z&&(q+=' APPEND data "'+B+'"\n'+z+(z.endsWith("\n")?"":"\n")+'end "'+B+'"'),null==j&&(j=this.viewer.getDefaultLoadFilter()),0<j.length&&(0<=j.toUpperCase().indexOf("DOCACHE")&&!this.isStateScript&&!b&&this.viewer.cacheClear(),n.put("filter",j),j.equalsIgnoreCase("2d")&&
(j="2D-noMin"),q+=" FILTER "+J.util.Escape.eS(j)),a=!1,null==r&&(c?n.put("fileData",y):y.startsWith("@")&&1<y.length?(a=!0,g=this.getStringParameter(y.substring(1),!1),n.put("fileData",g),s=(new JU.SB).append("{\n    var ").append(y.substring(1)).append(" = ").append(J.util.Escape.eS(g)).append(";\n    ").appendSB(s)):y.startsWith("?")&&this.viewer.isJS&&(f=null,y=this.loadFileAsync("LOAD"+(b?"_APPEND_":"_"),y,g,!b))),g=null,null!=f&&(f.equals(".")&&(f=this.viewer.getFilePath(y,!0)),(0==f.length||
this.viewer.getFilePath(f,!1).equalsIgnoreCase(this.viewer.getFilePath(y,!1)))&&this.invArg(),j=[f],g=this.viewer.getOutputChannel(f,j),null==g?J.util.Logger.error("Could not create output stream for "+j[0]):n.put("outputChannel",g)),null==r&&0==v&&(s.append(" "),a||c?s.append(J.util.Escape.eS(y)):e||(!y.equals("string")&&!y.equals("string[]")&&s.append("/*file*/"),null!=f&&(f=this.viewer.getFilePath(f,!1)),s.append(null!=f?J.util.Escape.eS(f):"$FILENAME$")),0<q.length&&s.append(" /*options*/ ").append(q),
a&&s.append("\n  }"),n.put("loadScript",s)),this.setCursorWait(!0),(c=this.viewer.getBoolean(603979934))&&J.util.Logger.startTimer("load"),q=this.viewer.loadModelFromFile(null,y,r,null,b,n,s,v),null!=g&&(this.viewer.setFileInfo([f,f,f]),J.util.Logger.info(J.i18n.GT._("file {0} created",f)),this.showString(this.viewer.getFilePath(f,!1)+" created"),g.closeChannel()),0<v)this.viewer.setFileInfo(u),null!=q&&!this.isCmdLine_c_or_C_Option&&this.evalError(q,null);else{if(null!=q&&!this.isCmdLine_c_or_C_Option){if(0==
q.indexOf("NOTE: file recognized as a script file: ")){y=q.substring(40).trim();this.script(0,y,null);return}this.evalError(q,null)}if(b&&(h||1<w))this.viewer.setAnimationRange(-1,-1),this.viewer.setCurrentModelIndex(k);0==this.scriptLevel&&(!b&&2>w)&&this.showString(this.viewer.getModelSetAuxiliaryInfoValue("modelLoadNote"));this.logMessages&&this.scriptStatusOrBuffer("Successfully loaded:"+(null==r?n.get("fullPathName"):t));h=this.viewer.getModelSetAuxiliaryInfo();null!=h&&(h.containsKey("centroidMinMax")&&
0<this.viewer.getAtomCount())&&(d=J.util.BSUtil.newBitSet2(b?m:0,this.viewer.getAtomCount()),this.viewer.setCentroid(d,h.get("centroidMinMax")));b=this.viewer.getDefaultLoadScript();m="";0<b.length&&(m+="\nUsing defaultLoadScript: "+b);null!=h&&this.viewer.allowEmbeddedScripts()?(k=h.remove("jmolscript"),null!=k&&0<k.length&&(m+="\nAdding embedded #jmolscript: "+k,b+=";"+k,this.setStringProperty("_loadScript",b),b="allowEmbeddedScripts = false;try{"+b+"} allowEmbeddedScripts = true;")):this.setStringProperty("_loadScript",
"");this.logLoadInfo(m);m=null==h?null:h.remove("sitescript");null!=m&&(b=m+";"+b);0<b.length&&!this.isCmdLine_c_or_C_Option&&this.runScript(b);c&&this.showString(J.util.Logger.getTimerMsg("load",0))}});$_M(c$,"loadFileAsync",function(a,b,c,d){a="cache://local"+a;c=this.pc+"_"+c;var e;if(null==this.thisContext||null==this.thisContext.htFileCache)this.pushContext(null,"loadFileAsync"),this.thisContext.htFileCache=new java.util.Hashtable;e=this.thisContext.htFileCache.get(c);if(null!=e&&0<e.length)return this.fileLoadThread=
null,this.popContext(!1,!1),this.viewer.queueOnHold=!1,"#CANCELED#".equals(this.viewer.cacheGet(e))&&this.evalError("#CANCELED#",null),e;this.thisContext.htFileCache.put(c,e=a+System.currentTimeMillis());null!=this.fileLoadThread&&this.evalError("#CANCELED#",null);d&&this.viewer.cacheFileByName(a+"*",!1);this.fileLoadThread=new J.script.FileLoadThread(this,this.viewer,b,c,e);this.fileLoadThread.run();throw new J.script.ScriptInterruption(this,"load",1);},"~S,~S,~N,~B");$_M(c$,"logLoadInfo",($fz=function(a){0<
a.length&&J.util.Logger.info(a);a=new JU.SB;var b=this.viewer.getModelCount();1<b&&a.append((this.viewer.isMovie()?this.viewer.getFrameCount()+" frames":b+" models")+"\n");for(var c=0;c<b;c++){var d=this.viewer.getModelAuxiliaryInfoValue(c,"moData");null!=d&&a.appendI(d.get("mos").size()).append(" molecular orbitals in model ").append(this.viewer.getModelNumberDotted(c)).append("\n")}0<a.length()&&this.showString(a.toString())},$fz.isPrivate=!0,$fz),"~S");$_M(c$,"getFullPathName",function(){var a=
!this.chk||this.isCmdLine_C_Option?this.viewer.getFullPathName():"test.xyz";null==a&&this.invArg();return a});$_M(c$,"pause",($fz=function(){if(this.chk||this.isJS&&!this.allowJSThreads)return!1;var a=this.optParameterAsString(1);this.viewer.getBooleanProperty("_useCommandThread");if(this.viewer.autoExit||!this.viewer.haveDisplay&&!this.viewer.isWebGL)return!1;if(0==this.scriptLevel&&this.pc==this.aatoken.length-1)return this.viewer.scriptStatus("nothing to pause: "+a),!1;a=0==a.length?": RESUME to continue.":
": "+this.viewer.formatText(a);this.pauseExecution(!0);this.viewer.scriptStatusMsg("script execution paused"+a,"script paused for RESUME");return!0},$fz.isPrivate=!0,$fz));$_M(c$,"print",($fz=function(){1==this.slen&&this.error(2);this.showStringPrint(this.parameterExpressionString(1,0),!0)},$fz.isPrivate=!0,$fz));$_M(c$,"prompt",($fz=function(){var a=null;1==this.slen?this.chk||(a=J.script.ScriptEvaluator.getContextTrace(this.viewer,this.getScriptContext("prompt"),null,!0).toString()):a=this.parameterExpressionString(1,
0);this.chk||this.viewer.prompt(a,"OK",null,!0)},$fz.isPrivate=!0,$fz));$_M(c$,"refresh",function(){this.chk||(this.viewer.setTainted(!0),this.viewer.requestRepaintAndWait("refresh cmd"))});$_M(c$,"reset",($fz=function(){if(3==this.slen&&135368713==this.tokAt(1))this.chk||this.viewer.removeFunction(this.stringParameter(2));else if(this.checkLength(-2),!this.chk)if(1==this.slen)this.viewer.reset(!1);else{switch(this.tokAt(1)){case 135270422:this.viewer.cacheClear();return;case 1073741935:this.viewer.resetError();
return;case 1087373323:this.viewer.resetShapes(!0);return;case 135368713:this.viewer.clearFunctions();return;case 1641025539:var a=new JU.BS;this.runScript(this.viewer.getDefaultStructure(null,a));this.viewer.resetBioshapes(a);return;case 1649412120:this.viewer.setData("element_vdw",[null,""],0,0,0,0,0);return;case 1076887572:this.viewer.resetAromatic();return;case 1611141175:this.viewer.reset(!0);return}a=this.parameterAsString(1);"_"==a.charAt(0)&&this.invArg();this.viewer.unsetProperty(a)}},$fz.isPrivate=
!0,$fz));$_M(c$,"restrict",($fz=function(){var a=1678770178==this.tokAt(1);this.select(a?2:1);this.restrictSelected(a,!0)},$fz.isPrivate=!0,$fz));$_M(c$,"restrictSelected",($fz=function(a,b){this.chk||this.sm.restrictSelected(a,b)},$fz.isPrivate=!0,$fz),"~B,~B");$_M(c$,"rotate",($fz=function(a,b){if(2==this.slen)switch(this.getToken(1).tok){case 1048589:this.chk||this.viewer.setSpinOn(!0);return;case 1048588:this.chk||this.viewer.setSpinOn(!1);return}for(var c=null,d=1.4E-45,e=0,f=3.4028235E38,g=
!1,h=!1,j=null,l=null,k=Array(2),m=JU.V3.new3(0,1,0),s=null,w=null,l=null,n=1,t,l=null,r=!1,u=null,q=null,v=null,p=null,y=this.viewer.getBoolean(603979806),z=1;z<this.slen;++z){switch(t=this.getToken(z).tok){case 10:case 1048577:case 1048586:case 8:case 1048583:if(10==t||1048577==t)if(null!=s||null!=l||2==e){c=this.atomExpressionAt(z);u=null;b=!0;break}h=!0;2==e&&(e=0);var B=this.centerParameterForModel(z,this.viewer.getCurrentModelIndex());!this.chk&&(1048583==t&&269484096!=this.tokAt(z+2))&&(g=
!0,m=this.getDrawObjectAxis(this.objectNameParameter(++z),this.viewer.getCurrentModelIndex()));k[e++]=B;break;case 1611141175:a=!0;continue;case 1073741988:case 1073742029:g=!0;continue;case 1114638363:b=!0;break;case 269484080:continue;case 2:case 3:if(a)if(1.4E-45==d){d=this.floatParameter(z);continue}else{if(3.4028235E38==f){f=d;d=this.floatParameter(z);continue}}else if(3.4028235E38==f){f=this.floatParameter(z);continue}else if(1.4E-45==d){d=this.floatParameter(z);a=!0;continue}this.invArg();
break;case 269484192:n=-1;continue;case 1112541205:h=!0;m.set(n,0,0);continue;case 1112541206:h=!0;m.set(0,n,0);continue;case 1112541207:h=!0;m.set(0,0,y&&!g?-n:n);continue;case 9:case 135270417:case 1073741863:135270417==t&&z++;h=!0;l=this.getQuaternionParameter(z);if(null!=l){if(1073741863==t&&!(g=b))l=l.mulQ(this.viewer.getRotationQuaternion().mul(-1));m.setT(l.getNormal());f=l.getTheta()}break;case 135266307:h=!0;if(this.isPoint3f(++z)){m.setT(this.centerParameter(z));break}f=this.getPoint4f(z);
m.set(f.x,f.y,f.z);f=f.w;l=J.util.Quaternion.newVA(m,f);break;case 1048580:h=g=b=!0;if(this.isArrayParameter(++z))j=this.floatParameterSet(z,6,2147483647);else{e=this.atomExpressionAt(z).nextSetBit(0);z=this.atomExpressionAt(++this.iToken).nextSetBit(0);if(0>e||0>z)return;c=this.viewer.getBranchBitSet(z,e,!0);k[0]=this.viewer.getAtomPoint3f(e);k[1]=this.viewer.getAtomPoint3f(z);e=2}break;case 4160:s=JU.V3.newV(this.centerParameter(++z));g=b=!0;break;case 137363468:r=!0;continue;case 1297090050:t=
this.intParameter(++z);if(this.chk)continue;s=this.viewer.getSpaceGroupInfo(null);g=null==s?null:s.get("operations");(0==t||null==g||g.length<Math.abs(t))&&this.invArg();g=g[Math.abs(t)-1];s=g[5];v=g[6];k[0]=g[7];null!=g[8]&&(m=g[8]);f=g[9].intValue();0>t&&(f=-f,null!=s&&s.scale(-1));0==f&&null!=k[0]&&(m.normalize(),J.util.Measure.getPlaneThroughPoint(k[0],m,p=new JU.P4));l=J.util.Quaternion.newVA(m,f);e=null==k[0]?0:1;b=h=g=!0;continue;case 135270405:case 12:case 11:h=!0;if(135270405==t){if(q=this.atomExpressionAt(++z),
l=this.viewer.getAtomPointVector(q),null==l&&this.errorAt(22,z),z=this.iToken,u=this.getPointVector(this.getToken(++z),z),(null==u||l.size()!=u.size())&&this.errorAt(22,z),w=new JU.M4,k[0]=new JU.P3,e=1,0.001<(this.chk?0:J.util.Measure.getTransformMatrix4(l,u,w,k[0])))u=null}else 12==t&&(w=this.theToken.value);l=new JU.M3;null!=w?(s=new JU.V3,w.get(s),w.getRotationScale(l)):l=this.theToken.value;l=this.chk?new J.util.Quaternion:J.util.Quaternion.newM(l);m.setT(l.getNormal());f=l.getTheta();g=!0;break;
default:this.invArg()}z=this.iToken}if(!this.chk){null!=j&&3.4028235E38!=f&&(a=!0,d=f);b&&null==c&&(c=this.viewer.getSelectionSet(!1));null!=q&&(b=!0,null==c&&(c=q));n=1.4E-45==d?10:3.4028235E38==f?d:0>d==0<f?-f/d:d;if(null!=j){if(!a){this.viewer.setDihedrals(j,null,1);return}s=null}null!=l&&(0==e&&null!=s&&(k[0]=this.viewer.getAtomSetCenter(null!=c?c:b?this.viewer.getSelectionSet(!1):this.viewer.getModelUndeletedAtomsBitSet(-1))),r&&null!=s&&(k[1]=JU.P3.newP(k[0]),k[1].add(s),w=J.util.Measure.computeHelicalAxis(null,
135266306,k[0],k[1],l),k[0]=w[0],r=w[3].x,0!=r&&(s=w[1],m=JU.V3.newV(s),0>r&&m.scale(-1)),w=null),a&&null==w&&(w=J.script.ScriptMathProcessor.getMatrix4f(l.getMatrix(),s)),null!=k[0]&&(e=1));if(null!=v&&(this.viewer.invertAtomCoordPt(v,c),null==m)||null!=p&&(this.viewer.invertAtomCoordPlane(p,c),null==m))return;if(2>e&&null==j){if(!g){if(a&&null==c&&!this.useThreads())return;if(this.viewer.rotateAxisAngleAtCenter(this,k[0],m,n,f,a,c)&&this.isJS&&a&&null==c)throw new J.script.ScriptInterruption(this,
"rotate",1);return}0==e&&(k[0]=new JU.P3);k[1]=JU.P3.newP(k[0]);k[1].add(m);e=2}0==e&&(k[0]=new JU.P3);if(2>e||0==k[0].distance(k[1]))k[1]=JU.P3.newP(k[0]),k[1].y+=1;3.4028235E38==f&&(f=0);0!=f&&(null!=s&&!h)&&s.scale(f/s.length());if(a&&null!=s&&(0==f||0==d))f=0.01,n=1.4E-45==d?0.01:0>d?-f/d:0.01*d/s.length();null!=c&&(a&&null==u&&null!=w)&&(l=this.viewer.getAtomPointVector(c),u=J.util.Measure.transformPoints(l,w,k[0]));if(null!=c&&!a&&null!=u)this.viewer.setAtomCoords(c,1146095626,u);else if(this.useThreads()&&
this.viewer.rotateAboutPointsInternal(this,k[0],k[1],n,f,a,c,s,u,j)&&this.isJS&&a)throw new J.script.ScriptInterruption(this,"rotate",1);}},$fz.isPrivate=!0,$fz),"~B,~B");$_M(c$,"getQuaternionParameter",($fz=function(a){switch(this.tokAt(a)){case 7:a=this.getToken(a).getList();var b=null;(0==a.size()||null==(b=J.script.SV.pt4Value(a.get(0))))&&this.invArg();return J.util.Quaternion.newP4(b);case 1073741863:return this.chk?null:J.util.Quaternion.newP4(J.util.Escape.uP(this.viewer.getOrientationText(1073741863,
null)));default:return J.util.Quaternion.newP4(this.getPoint4f(a))}},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"getPointVector",function(a,b){switch(a.tok){case 10:return this.viewer.getAtomPointVector(a.value);case 7:for(var c=new JU.List,d,e=a.getList(),f=0;f<e.size();f++)if(null!=(d=J.script.SV.ptValue(e.get(f))))c.addLast(d);else return null;return c}return 0<b?this.viewer.getAtomPointVector(this.atomExpressionAt(b)):null},"J.script.T,~N");$_M(c$,"getObjectCenter",($fz=function(a,b,c){a=[a,Integer.$valueOf(b),
Integer.$valueOf(c)];return this.getShapePropertyData(22,"getCenter",a)||this.getShapePropertyData(24,"getCenter",a)||this.getShapePropertyData(28,"getCenter",a)||this.getShapePropertyData(25,"getCenter",a)||this.getShapePropertyData(27,"getCenter",a)?a[2]:null},$fz.isPrivate=!0,$fz),"~S,~N,~N");$_M(c$,"getObjectBoundingBox",($fz=function(a){a=[a,null,null];return this.getShapePropertyData(24,"getBoundingBox",a)||this.getShapePropertyData(28,"getBoundingBox",a)||this.getShapePropertyData(25,"getBoundingBox",
a)||this.getShapePropertyData(27,"getBoundingBox",a)?a[2]:null},$fz.isPrivate=!0,$fz),"~S");$_M(c$,"getDrawObjectAxis",($fz=function(a,b){var c=[a,Integer.$valueOf(b),null];return this.getShapePropertyData(22,"getSpinAxis",c)?c[2]:null},$fz.isPrivate=!0,$fz),"~S,~N");$_M(c$,"script",($fz=function(a,b,c){var d=!0,e=!1,f=!1,g=0,h=0,j=0,l=0,k=2,m=null,s=null,w=null,n=null;if(135287308==a)this.checkLength(2),this.chk||this.viewer.jsEval(this.parameterAsString(1));else{if(null==b&&null==c)if(a=this.tokAt(1),
4!=a&&this.error(16),b=this.parameterAsString(1),b.equalsIgnoreCase("applet")){a=this.parameterAsString(2);c=this.parameterExpressionString(3,0);this.checkLast(this.iToken);if(this.chk)return;if(0==a.length||a.equals("all"))a="*";if(!a.equals(".")&&(this.viewer.jsEval(a+"\u0001"+c),!a.equals("*")))return}else{a=this.tokAt(this.slen-1);f=266298==a;b.equalsIgnoreCase("inline")&&(c=this.parameterExpressionString(2,f?this.slen-1:0),k=this.iToken+1);for(;b.equalsIgnoreCase("localPath")||b.equalsIgnoreCase("remotePath")||
b.equalsIgnoreCase("scriptPath");)b.equalsIgnoreCase("localPath")?m=this.parameterAsString(k++):b.equalsIgnoreCase("scriptPath")?w=this.parameterAsString(k++):s=this.parameterAsString(k++),b=this.parameterAsString(k++);b.startsWith("?")&&this.viewer.isJS&&(b=this.loadFileAsync("SCRIPT_",b,k,!0));if(1073741878==(a=this.tokAt(k)))e=!0,a=this.tokAt(++k);1073742050==a&&(d=!1,a=this.tokAt(++k));if(1073741998==a||1141899268==a)k++,j=g=Math.max(this.intParameter(k++),0),this.checkToken(k)&&(j=269484192==
this.getToken(k).tok?this.checkToken(++k)?this.intParameter(k++):0:-this.intParameter(k++),0>=j&&this.invArg());else if(1073741890==a||1073741892==a)k++,h=Math.max(this.intParameter(k++)-1,0),l=h+1,this.checkToken(k)&&(l=269484192==this.getToken(k).tok?this.checkToken(++k)?this.intParameter(k++):0:-this.intParameter(k++),0>=l&&this.invArg());269484048==this.tokAt(k)&&(n=this.parameterExpressionList(k,-1,!1),k=this.iToken+1);this.checkLength(f?k+1:k)}if(!this.chk||this.isCmdLine_c_or_C_Option){this.isCmdLine_c_or_C_Option&&
(e=!0);a=this.chk;k=this.isCmdLine_c_or_C_Option;e&&(this.chk=this.isCmdLine_c_or_C_Option=!0);this.pushContext(null,"SCRIPT");this.contextPath+=" >> "+b;if(null==c?this.compileScriptFileInternal(b,m,s,w):this.compileScript(null,c,!1)){this.pcEnd=l;for(this.lineEnd=j;h<this.lineNumbers.length&&this.lineNumbers[h]<g;)h++;this.pc=h;b=this.isCmdLine_C_Option;this.isCmdLine_C_Option=(new Boolean(this.isCmdLine_C_Option&d)).valueOf();this.executionStepping=(new Boolean(this.executionStepping|f)).valueOf();
this.contextVariables=new java.util.Hashtable;this.contextVariables.put("_arguments",null==n?J.script.SV.getVariableAI([]):J.script.SV.getVariableList(n));e&&(this.listCommands=!0);(d=this.viewer.getBoolean(603979934))&&J.util.Logger.startTimer("script");this.dispatchCommands(!1,!1);d&&this.showString(J.util.Logger.getTimerMsg("script",0));this.isCmdLine_C_Option=b;this.popContext(!1,!1)}else J.util.Logger.error(J.i18n.GT._("script ERROR: ")+this.errorMessage),this.popContext(!1,!1),k?this.setErrorMessage(null):
this.evalError(null,null);this.chk=a;this.isCmdLine_c_or_C_Option=k}}},$fz.isPrivate=!0,$fz),"~N,~S,~S");$_M(c$,"$function",($fz=function(){if(!this.chk||this.isCmdLine_c_or_C_Option){var a=this.getToken(0).value;this.viewer.isFunction(a)||this.error(10);var b=1==this.slen||3==this.slen&&269484048==this.tokAt(1)&&269484049==this.tokAt(2)?null:this.parameterExpressionList(1,-1,!1);this.chk||this.runFunctionRet(null,a,b,null,!1,!0,!0)}},$fz.isPrivate=!0,$fz));$_M(c$,"sync",($fz=function(){this.checkLength(-3);
var a="",b="",c=JU.ParserJS.parseInt(this.optParameterAsString(1));if(-2147483648==c)switch(c=0,this.slen){case 1:b="*";a="ON";break;case 2:b=this.parameterAsString(1);if(0==b.indexOf("jmolApplet")||J.util.Parser.isOneOf(b,";*;.;^;")){a="ON";this.chk||this.viewer.syncScript(a,b,0);b=".";break}a=b;b="*";break;case 3:b=this.parameterAsString(1),a=528443==this.tokAt(2)?"GET_GRAPHICS":this.parameterAsString(2)}else a=2==this.slen?null:this.parameterAsString(2),b=null;this.chk||this.viewer.syncScript(a,
b,c)},$fz.isPrivate=!0,$fz));$_M(c$,"history",($fz=function(a){if(1==this.slen)this.showString(this.viewer.getSetHistory(2147483647));else if(2==a)a=this.intParameter(this.checkLast(2)),0>a&&this.invArg(),this.chk||this.viewer.getSetHistory(0==a?0:-2-a);else switch(this.getToken(this.checkLast(1)).tok){case 1048589:case 1073741882:this.chk||this.viewer.getSetHistory(-2147483648);break;case 1048588:this.chk||this.viewer.getSetHistory(0);break;default:this.errorStr(24,"ON, OFF, CLEAR")}},$fz.isPrivate=
!0,$fz),"~N");$_M(c$,"display",($fz=function(a){var b=null,c=0,d=1,e;switch(e=this.tokAt(1)){case 1276118017:case 1073742119:c=e,e=this.tokAt(++d)}var f=1087373318==e;f&&(e=this.tokAt(++d));switch(e){case 1048583:this.setObjectProperty();return;case 0:break;default:b=4==this.slen&&1678770178==this.tokAt(2)?new J.modelset.Bond.BondSet(J.util.BSUtil.newBitSet2(0,this.viewer.modelSet.bondCount)):this.atomExpressionAt(d)}this.chk||(Clazz.instanceOf(b,J.modelset.Bond.BondSet)?this.viewer.displayBonds(b,
a):this.viewer.displayAtoms(b,a,f,c,this.tQuiet))},$fz.isPrivate=!0,$fz),"~B");$_M(c$,"$delete",($fz=function(){if(1048583==this.tokAt(1))this.setObjectProperty();else{var a=1==this.slen?null:this.atomExpression(this.st,1,0,!0,!1,!0,!1);this.chk||(null==a&&(a=this.viewer.getModelUndeletedAtomsBitSet(-1)),a=this.viewer.deleteAtoms(a,!1),this.tQuiet||this.scriptLevel>this.scriptReportingLevel||this.scriptStatusOrBuffer(J.i18n.GT._("{0} atoms deleted",a)))}},$fz.isPrivate=!0,$fz));$_M(c$,"select",($fz=
function(a){if(1==this.slen)this.viewer.select(null,!1,0,this.tQuiet||this.scriptLevel>this.scriptReportingLevel);else if(!(2==this.slen&&1073742072==this.tokAt(1))){this.viewer.setNoneSelected(4==this.slen&&1048587==this.tokAt(2));if(10==this.tokAt(2)&&Clazz.instanceOf(this.getToken(2).value,J.modelset.Bond.BondSet)||1678770178==this.getToken(2).tok&&10==this.getToken(3).tok){if(this.slen==this.iToken+2){this.chk||this.viewer.selectBonds(this.theToken.value);return}this.invArg()}if(1746538509==this.getToken(2).tok){if(5==
this.slen&&10==this.getToken(3).tok){this.chk||this.setShapeProperty(6,"select",this.theToken.value);return}this.invArg()}var b=0,c=!1;if(0==this.getToken(1).intValue)a=this.parameterExpressionToken(0).value,Clazz.instanceOf(a,JU.BS)||this.invArg(),this.checkLast(this.iToken);else{c=this.tokAt(a);switch(c){case 1276118017:case 1073742119:b=c,c=this.tokAt(++a)}(c=1087373318==c)&&this.tokAt(++a);a=this.atomExpressionAt(a)}if(!this.chk)if(this.isBondSet)this.viewer.selectBonds(a);else{if(a.length()>
this.viewer.getAtomCount()){var d=this.viewer.getModelUndeletedAtomsBitSet(-1);d.and(a);a=d}this.viewer.select(a,c,b,this.tQuiet||this.scriptLevel>this.scriptReportingLevel)}}},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"subset",($fz=function(){var a=null;this.chk||this.viewer.setSelectionSubset(null);if(1!=this.slen&&(4!=this.slen||!this.getToken(2).value.equals("off")))a=this.atomExpressionAt(1);this.chk||this.viewer.setSelectionSubset(a)},$fz.isPrivate=!0,$fz));$_M(c$,"invertSelected",($fz=function(){var a=
null,b=null,c=null,d=-2147483648;switch(this.tokAt(1)){case 0:if(this.chk)return;c=this.viewer.getSelectionSet(!1);a=this.viewer.getAtomSetCenter(c);this.viewer.invertAtomCoordPt(a,c);return;case 528443:d=this.atomExpressionAt(2).nextSetBit(0);c=this.atomExpressionAt(this.iToken+1);break;case 135266320:a=this.centerParameter(2);break;case 135266319:b=this.planeParameter(2);break;case 135267841:b=this.hklParameter(2)}this.checkLengthErrorPt(this.iToken+1,1);null==b&&(null==a&&-2147483648==d)&&this.invArg();
this.chk||-1!=d&&this.viewer.invertSelected(a,b,d,c)},$fz.isPrivate=!0,$fz));$_M(c$,"translate",($fz=function(a){var b=null,c=1,b=0;1114638363==this.tokAt(1)&&(a=!0,b=1,c=2);if(this.isPoint3f(c)){var d=this.getPoint3f(c,!0),b=!a&&this.iToken+1<this.slen?this.atomExpressionAt(++this.iToken):null;this.checkLast(this.iToken);this.chk||this.viewer.setAtomCoordsRelative(d,b)}else{d=(this.parameterAsString(c).toLowerCase()+" ").charAt(0);0>"xyz".indexOf(d)&&this.error(0);var e=this.floatParameter(++c);
switch(this.tokAt(++c)){case 0:case 10:case 1048577:c="\x00";break;default:c=(this.optParameterAsString(c).toLowerCase()+"\x00").charAt(0)}0==e&&"\x00"!=c||(this.iToken=b+("\x00"==c?2:3),b=a?this.viewer.getSelectionSet(!1):this.iToken+1<this.slen?this.atomExpressionAt(++this.iToken):null,this.checkLast(this.iToken),this.chk||this.viewer.translate(d,e,c,b))}},$fz.isPrivate=!0,$fz),"~B");$_M(c$,"zap",($fz=function(a){if(1==this.slen||!a)(a=a&&!this.isStateScript)&&this.viewer.cacheFileByName(null,!1),
this.viewer.zap(!0,a,!0),this.refresh();else if(a=this.atomExpressionAt(1),!this.chk){a=this.viewer.deleteAtoms(a,!0);var b=this.tQuiet||this.scriptLevel>this.scriptReportingLevel;b||this.scriptStatusOrBuffer(J.i18n.GT._("{0} atoms deleted",a));this.viewer.select(null,!1,0,b)}},$fz.isPrivate=!0,$fz),"~B");$_M(c$,"zoom",($fz=function(a){if(!a){var b=1<this.slen?this.getToken(1).tok:1048589;switch(b){case 1048589:case 1048588:2<this.slen&&this.error(2);this.chk||this.setBooleanProperty("zoomEnabled",
1048589==b);return}}var c=null,d=1,b=a?this.isFloatParameter(d)?this.floatParameter(d++):2:0;0>b&&(d--,b=0);var e=0,f=null;this.isCenterParameter(d)?(e=d,c=this.centerParameter(d),Clazz.instanceOf(this.expressionResult,JU.BS)&&(f=this.expressionResult),d=this.iToken+1):2==this.tokAt(d)&&0==this.getToken(d).intValue&&(f=this.viewer.getAtomBitSet("visible"),c=this.viewer.getAtomSetCenter(f));var g=this.viewer.getZoomSetting(),f=this.getZoom(e,d,f,g),d=this.iToken+1,h=g=NaN;d!=this.slen&&(g=this.floatParameter(d++),
h=this.floatParameter(d++));d!=this.slen&&this.invArg();0>f&&(f=-f,a&&(1==this.slen?f*=2:null==c&&(f/=2)));a=this.viewer.getMaxZoomPercent();(5>f||f>a)&&this.numberOutOfRange(5,a);this.viewer.isWindowCentered()||(null!=c&&(a=this.atomExpressionAt(e),this.chk||this.viewer.setCenterBitSet(a,!1)),c=this.viewer.getRotationCenter(),Float.isNaN(g)&&(g=this.viewer.getTranslationXPercent()),Float.isNaN(h)&&(h=this.viewer.getTranslationYPercent()));if(!this.chk&&(this.viewer.moveTo(this,b,c,J.viewer.JC.center,
NaN,null,f,g,h,NaN,null,NaN,NaN,NaN,NaN,NaN,NaN),this.isJS&&0<b&&this.viewer.global.waitForMoveTo))throw new J.script.ScriptInterruption(this,"zoomTo",1);},$fz.isPrivate=!0,$fz),"~B");$_M(c$,"getZoom",($fz=function(a,b,c,d){var e=this.isFloatParameter(b)?this.floatParameter(b++):NaN;if(0==e||0==d)d=NaN,null==c?1048583==this.tokAt(a)&&(e=this.getObjectBoundingBox(this.objectNameParameter(a+1)),(null==e||0==(d=e[0].distance(e[1])/2))&&this.invArg()):d=this.viewer.calcRotationRadiusBs(c),Float.isNaN(d)&&
this.invArg(),d=100*(this.viewer.getFloat(570425388)/d),e=NaN;if(0>e)e+=d;else if(Float.isNaN(e))switch(a=this.tokAt(b),a){case 1073742079:case 1073741980:e=d*(1073742079==a?0.5:2);b++;break;case 269484208:case 269484209:case 269484193:c=this.floatParameter(++b);b++;switch(a){case 269484208:e=d/c;break;case 269484209:e=d*c;break;case 269484193:e=d+c}break;default:e=null==c?-d:d}this.iToken=b-1;return e},$fz.isPrivate=!0,$fz),"~N,~N,JU.BS,~N");$_M(c$,"delay",($fz=function(){var a=0;switch(this.getToken(1).tok){case 1048589:a=
1;break;case 2:a=1E3*this.intParameter(1);break;case 3:a=Clazz.floatToInt(1E3*this.floatParameter(1));break;default:this.error(34)}!this.chk&&(!this.viewer.isHeadless()&&!this.viewer.autoExit)&&(this.refresh(),this.doDelay(Math.abs(a)))},$fz.isPrivate=!0,$fz));$_M(c$,"slab",($fz=function(a){var b=!1,c=null;if(this.isCenterParameter(1)||9==this.tokAt(1))c=this.planeParameter(1);else switch(this.getToken(1).tok){case 2:c=this.intParameter(this.checkLast(1));this.chk||(a?this.viewer.depthToPercent(c):
this.viewer.slabToPercent(c));return;case 1048589:this.checkLength(2),b=!0;case 1048588:this.checkLength(2);this.setBooleanProperty("slabEnabled",b);return;case 4141:this.checkLength(2);if(this.chk)return;this.viewer.slabReset();this.setBooleanProperty("slabEnabled",!0);return;case 1085443:this.checkLength(2);if(this.chk)return;this.viewer.setSlabDepthInternal(a);this.setBooleanProperty("slabEnabled",!0);return;case 269484192:b=this.parameterAsString(2);b.equalsIgnoreCase("hkl")?c=this.hklParameter(3):
b.equalsIgnoreCase("plane")&&(c=this.planeParameter(3));null==c&&this.invArg();c.scale(-1);break;case 135266319:switch(this.getToken(2).tok){case 1048587:break;default:c=this.planeParameter(2)}break;case 135267841:c=1048587==this.getToken(2).tok?null:this.hklParameter(2);break;case 1073742118:return;default:this.invArg()}this.chk||this.viewer.slabInternal(c,a)},$fz.isPrivate=!0,$fz),"~B");$_M(c$,"ellipsoid",($fz=function(){var a=0,b=1,c=3.4028235E38,d=!1,e=!1;this.setShapeProperty(20,"thisID",null);
switch(this.getToken(1).tok){case 1048589:a=2147483647;break;case 1048588:break;case 2:a=this.intParameter(1);break;case 1085443:this.sm.loadShape(20);this.setShapeProperty(20,"select",this.parameterAsString(2));b=this.iToken;e=d=!0;break;case 1074790550:case 269484209:case 1073741824:this.sm.loadShape(20);1074790550==this.theTok&&b++;this.setShapeId(20,b,!1);b=this.iToken;d=!0;break;default:this.invArg()}if(d){for(;++b<this.slen;){a=this.parameterAsString(b);d=null;this.getToken(b);if(!e)switch(this.theTok){case 1048583:a=
"points";d=Array(3);d[0]=this.objectNameParameter(++b);if(this.chk)continue;this.getShapePropertyData(24,"getVertices",d);break;case 1611272194:for(var d=Array(3),f=0;3>f;f++)d[f]=new JU.V3,d[f].setT(this.centerParameter(++b)),b=this.iToken;break;case 12289:d=this.centerParameter(++b);b=this.iToken;break;case 1095761933:d=Integer.$valueOf(this.intParameter(++b));break;case 12291:d=Boolean.TRUE,this.checkLength(b+1)}if(null==d)switch(this.theTok){case 1048589:a="on";d=Boolean.TRUE;break;case 1048588:a=
"on";d=Boolean.FALSE;break;case 1073742138:d=Float.$valueOf(this.floatParameter(++b));break;case 10:case 1048577:a="atoms";d=this.atomExpressionAt(b);b=this.iToken;break;case 1766856708:case 603979967:case 1073742074:c=this.getColorTrans(b,!0);b=this.iToken;continue;case 1073742075:d=this.parameterAsString(++b)}null==d&&this.invArg();this.setShapeProperty(20,a.toLowerCase(),d)}this.finalizeObject(20,this.colorArgb[0],c,0,!1,null,0,null);this.setShapeProperty(20,"thisID",null)}else this.setShapeSizeBs(20,
a,null)},$fz.isPrivate=!0,$fz));$_M(c$,"getShapeNameParameter",function(a){var b=this.parameterAsString(a),c=b.equals("*");0==b.length&&this.invArg();if(c)switch(this.tokAt(a+1)){case 0:case 1048589:case 1048588:case 3145768:case 3145770:case 1766856708:case 12291:break;default:if(this.setMeshDisplayProperty(-1,0,this.tokAt(a+1)))break;b+=this.optParameterAsString(++a)}269484209==this.tokAt(a+1)&&(b+=this.parameterAsString(++a));this.iToken=a;return b},"~N");$_M(c$,"setShapeId",function(a,b,c){c&&
this.invArg();b=this.getShapeNameParameter(b).toLowerCase();this.setShapeProperty(a,"thisID",b);return b},"~N,~N,~B");$_M(c$,"setAtomShapeSize",($fz=function(a,b){var c=null,d=!1;switch(this.tokAt(1)){case 1073742072:this.restrictSelected(!1,!1);break;case 1048589:break;case 1048588:b=0;break;case 3:d=0>this.floatParameter(1);default:c=this.encodeRadiusParameter(1,d,!0),Float.isNaN(c.value)&&this.invArg()}null==c&&(c=new J.atomdata.RadiusData(null,b,J.atomdata.RadiusData.EnumType.FACTOR,J.constant.EnumVdw.AUTO));
d&&this.restrictSelected(!1,!1);this.setShapeSize(a,c)},$fz.isPrivate=!0,$fz),"~N,~N");$_M(c$,"encodeRadiusParameter",function(a,b,c){var d=NaN,e=J.atomdata.RadiusData.EnumType.ABSOLUTE,f=null,g=-1==a?1649412120:this.getToken(a).tok;switch(g){case 1112539137:case 1112539138:case 1112541195:case 1114638362:case 1112541199:case 1649412120:d=1,e=J.atomdata.RadiusData.EnumType.FACTOR,f=1649412120==g?null:J.constant.EnumVdw.getVdwType2(J.script.T.nameOf(g)),g=this.tokAt(++a)}switch(g){case 4141:return this.viewer.getDefaultRadiusData();
case 1073741852:case 1073742116:case 1073741856:case 1073741858:case 1073741992:d=1;e=J.atomdata.RadiusData.EnumType.FACTOR;this.iToken=a-1;break;case 269484193:case 2:case 3:if(269484193==g)a++;else if(269484210==this.tokAt(a+1)){d=Math.round(this.floatParameter(a));this.iToken=++a;e=J.atomdata.RadiusData.EnumType.FACTOR;(0>d||200<d)&&this.integerOutOfRange(0,200);d/=100;break}else if(2==g){d=this.intParameter(a);(749<d||-200>d)&&this.integerOutOfRange(-200,749);0<d?(d/=250,e=J.atomdata.RadiusData.EnumType.ABSOLUTE):
(d/=-100,e=J.atomdata.RadiusData.EnumType.FACTOR);break}d=this.floatParameterRange(a,b||!c?-16:0,16);269484193==g||!c?e=J.atomdata.RadiusData.EnumType.OFFSET:(e=J.atomdata.RadiusData.EnumType.ABSOLUTE,f=J.constant.EnumVdw.NADA);b&&(d=-d);break;default:1==d&&a--}null==f&&(f=J.constant.EnumVdw.getVdwType(this.optParameterAsString(++this.iToken)),null==f&&(this.iToken=a,f=J.constant.EnumVdw.AUTO));return new J.atomdata.RadiusData(null,d,e,f)},"~N,~B,~B");$_M(c$,"structure",($fz=function(){var a=J.constant.EnumStructure.getProteinStructureType(this.parameterAsString(1));
a===J.constant.EnumStructure.NOT&&this.invArg();var b=null;switch(this.tokAt(2)){case 10:case 1048577:b=this.atomExpressionAt(2);this.checkLast(this.iToken);break;default:this.checkLength(2)}this.chk||(this.clearDefinedVariableAtomSets(),this.viewer.setProteinType(a,b))},$fz.isPrivate=!0,$fz));$_M(c$,"wireframe",($fz=function(){var a=-2147483648;4141==this.tokAt(1)?this.checkLast(1):a=this.getMadParameter();this.chk||(this.setShapeProperty(1,"type",Integer.$valueOf(1023)),this.setShapeSizeBs(1,-2147483648==
a?300:a,null))},$fz.isPrivate=!0,$fz));$_M(c$,"ssbond",($fz=function(){var a=this.getMadParameter();this.setShapeProperty(1,"type",Integer.$valueOf(256));this.setShapeSizeBs(1,a,null);this.setShapeProperty(1,"type",Integer.$valueOf(1023))},$fz.isPrivate=!0,$fz));$_M(c$,"hbond",($fz=function(){if(2==this.slen&&4102==this.getToken(1).tok){if(!this.chk){var a=this.viewer.autoHbond(null,null,!1);this.scriptStatusOrBuffer(J.i18n.GT._("{0} hydrogen bonds",Math.abs(a)))}}else 2==this.slen&&12291==this.getToken(1).tok?
this.chk||this.connect(0):(a=this.getMadParameter(),this.setShapeProperty(1,"type",Integer.$valueOf(30720)),this.setShapeSizeBs(1,a,null),this.setShapeProperty(1,"type",Integer.$valueOf(1023)))},$fz.isPrivate=!0,$fz));$_M(c$,"vector",($fz=function(){var a=J.atomdata.RadiusData.EnumType.SCREEN,b=1;this.checkLength(-3);switch(this.iToken=this.slen){case 2:switch(this.getToken(1).tok){case 1048589:break;case 1048588:b=0;break;case 2:b=this.intParameterRange(1,0,19);break;case 3:a=J.atomdata.RadiusData.EnumType.ABSOLUTE;
b=this.floatParameterRange(1,0,3);break;default:this.error(6)}break;case 3:if(1073742138==this.tokAt(1)){this.setFloatProperty("vectorScale",this.floatParameterRange(2,-100,100));return}}this.setShapeSize(18,new J.atomdata.RadiusData(null,b,a,null))},$fz.isPrivate=!0,$fz));$_M(c$,"vibration",($fz=function(){this.checkLength(-3);var a=0;switch(this.getToken(1).tok){case 1048589:this.checkLength(2);a=this.viewer.getFloat(570425412);break;case 1048588:this.checkLength(2);a=0;break;case 2:case 3:this.checkLength(2);
a=this.floatParameter(1);break;case 1073742138:this.setFloatProperty("vibrationScale",this.floatParameterRange(2,-10,10));return;case 1073742090:this.setFloatProperty("vibrationPeriod",this.floatParameter(2));return;case 1073741824:this.invArg();break;default:a=-1}0>a&&this.invArg();this.chk||(0==a?this.viewer.setVibrationOff():this.viewer.setVibrationPeriod(-a))},$fz.isPrivate=!0,$fz));$_M(c$,"dots",($fz=function(a){this.chk||this.sm.loadShape(a);this.setShapeProperty(a,"init",null);for(var b=NaN,
c=J.atomdata.RadiusData.EnumType.ABSOLUTE,d=1;;){switch(this.getToken(d).tok){case 1073742072:this.restrictSelected(!1,!1);b=1;c=J.atomdata.RadiusData.EnumType.FACTOR;break;case 1048589:b=1;c=J.atomdata.RadiusData.EnumType.FACTOR;break;case 1048588:b=0;break;case 1073741976:this.setShapeProperty(a,"ignore",this.atomExpressionAt(d+1));d=this.iToken+1;continue;case 2:var e=this.intParameter(d);if(1666189314==this.tokAt(d+1)){d++;this.setShapeProperty(a,"atom",Integer.$valueOf(e));this.setShapeProperty(a,
"radius",Float.$valueOf(this.floatParameter(++d)));1766856708==this.tokAt(++d)&&(this.setShapeProperty(a,"colorRGB",Integer.$valueOf(this.getArgbParam(++d))),d++);10!=this.getToken(d).tok&&this.invArg();this.setShapeProperty(a,"dots",this.st[d].value);return}}break}b=Float.isNaN(b)?this.encodeRadiusParameter(d,!1,!0):new J.atomdata.RadiusData(null,b,c,J.constant.EnumVdw.AUTO);Float.isNaN(b.value)&&this.invArg();this.setShapeSize(a,b)},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"proteinShape",($fz=function(a){var b=
0;switch(this.getToken(1).tok){case 1073742072:if(this.chk)return;this.restrictSelected(!1,!1);b=-1;break;case 1048589:b=-1;break;case 1048588:break;case 1641025539:b=-2;break;case 1112541199:case 1073741922:b=-4;break;case 2:b=8*this.intParameterRange(1,0,1E3);break;case 3:b=Math.round(2E3*this.floatParameterRange(1,-4,4));0>b&&(this.restrictSelected(!1,!1),b=-b);break;case 10:this.chk||this.sm.loadShape(a);this.setShapeProperty(a,"bitset",this.theToken.value);return;default:this.error(6)}this.setShapeSizeBs(a,
b,null)},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"animation",($fz=function(){var a=!1;switch(this.getToken(1).tok){case 1048589:a=!0;case 1048588:this.chk||this.viewer.setAnimationOn(a);break;case 1073742031:a=Clazz.floatToInt(this.floatParameter(2));this.chk||this.viewer.setAnimMorphCount(Math.abs(a));break;case 1610625028:this.iToken=2;a=1048579==this.tokAt(2)?null:this.atomExpressionAt(2);this.checkLength(this.iToken+1);this.chk||this.viewer.setAnimDisplay(a);break;case 4115:if(this.isArrayParameter(2)){var b=
this.floatParameterSet(2,0,2147483647);this.checkLength(this.iToken+1);if(this.chk)break;for(var a=Clazz.newIntArray(b.length,0),c=b.length;0<=--c;)a[c]=Clazz.floatToInt(b[c]);c=new java.util.Hashtable;c.put("frames",a);c.put("currentFrame",Integer.$valueOf(0));this.viewer.setMovie(c)}else this.model(2);break;case 1073742024:c=a=1;5<this.slen&&this.error(2);b=null;switch(J.script.T.getTokFromName(this.parameterAsString(2))){case 1073742070:b=J.constant.EnumAnimationMode.ONCE;a=c=0;break;case 528410:b=
J.constant.EnumAnimationMode.LOOP;break;case 1073742082:b=J.constant.EnumAnimationMode.PALINDROME;break;default:this.invArg()}4<=this.slen&&(a=c=this.floatParameter(3),5==this.slen&&(c=this.floatParameter(4)));this.chk||this.viewer.setAnimationReplayMode(b,a,c);break;case 1073741918:c=2;a=0;switch(this.tokAt(c)){case 269484192:a=-this.intParameter(++c);break;case 269484193:a=this.intParameter(++c);break;case 2:a=this.intParameter(c);break;default:this.invArg()}this.checkLength(++c);1!=a&&-1!=a&&this.errorStr2(35,
"-1","1");this.chk||this.viewer.setAnimationDirection(a);break;case 1074790526:this.setIntProperty("animationFps",this.intParameter(this.checkLast(2)));break;default:this.frameControl(1)}},$fz.isPrivate=!0,$fz));$_M(c$,"assign",($fz=function(){var a=this.tokAt(1),b=this.atomExpressionAt(2).nextSetBit(0),c=-1,d=null;if(!(0>b)){4106==a?c=this.atomExpressionAt(++this.iToken).nextSetBit(0):d=this.parameterAsString(++this.iToken);var e=++this.iToken<this.slen?this.centerParameter(this.iToken):null;if(!this.chk)switch(a){case 1141899265:this.clearDefinedVariableAtomSets();
this.viewer.assignAtom(b,e,d);break;case 1678770178:this.viewer.assignBond(b,(d+"p").charAt(0));break;case 4106:this.viewer.assignConnect(b,c)}}},$fz.isPrivate=!0,$fz));$_M(c$,"file",($fz=function(){var a=this.intParameter(this.checkLast(1));if(!this.chk){var b=this.viewer.getModelNumberIndex(1E6*a+1,!1,!1),c=-1;0<=b&&(c=this.viewer.getModelNumberIndex(1E6*(a+1)+1,!1,!1),0>c&&(c=this.viewer.getModelCount()),c--);this.viewer.setAnimationOn(!1);this.viewer.setAnimationDirection(1);this.viewer.setAnimationRange(b,
c);this.viewer.setCurrentModelIndex(-1)}},$fz.isPrivate=!0,$fz));$_M(c$,"fixed",($fz=function(){var a=1==this.slen?null:this.atomExpressionAt(1);this.chk||this.viewer.setMotionFixedAtoms(a)},$fz.isPrivate=!0,$fz));$_M(c$,"model",($fz=function(a){var b=4115==this.theTok,c=!0;if(1==this.slen&&1==a){var d=this.viewer.getCurrentModelIndex(),e;if(!this.chk&&0<=d&&0<=(e=this.viewer.getJmolDataSourceFrame(d)))this.viewer.setCurrentModelIndex(e==d?-2147483648:e)}else{switch(this.tokAt(1)){case 2:if(b&&2==
this.slen){this.chk||this.viewer.setFrame(this.intParameter(1));return}break;case 1048577:case 10:e=this.atomExpressionAt(1).nextSetBit(0);this.checkLength(this.iToken+1);if(this.chk||0>e)return;c=new JU.BS;c.set(e);this.viewer.setCurrentModelIndex(this.viewer.getModelBitSet(c,!1).nextSetBit(0));return;case 1073741904:this.iToken=1;c=2==this.tokAt(2)?this.intParameter(++this.iToken):1;this.checkLength(this.iToken+1);!this.chk&&0<c&&this.viewer.createModels(c);return;case 1074790550:this.checkLength(3);
d=this.stringParameter(2);this.chk||this.viewer.setCurrentModelID(d);return;case 528397:c=0;this.checkLength(3);switch(this.getToken(2).tok){case 2:case 3:c=Clazz.floatToLong(1E3*this.floatParameter(2));break;default:this.error(20)}this.chk||this.viewer.setFrameDelayMs(c);return;case 1073742166:0<this.checkLength23()&&(this.chk||this.viewer.setFrameTitleObj(2==this.slen?"@{_modelName}":7==this.tokAt(2)?J.script.SV.listValue(this.st[2]):this.parameterAsString(2)));return;case 1073741832:c=2==this.slen||
1048587==this.tokAt(2)?null:this.atomExpressionAt(2);this.chk||this.viewer.setFrameOffsets(c);return}if(269484192==this.getToken(a).tok)++a,(2!=this.getToken(this.checkLast(a)).tok||1!=this.intParameter(a))&&this.invArg(),this.chk||this.viewer.setAnimation(1073742108);else{var f=b=!1,g=!1,h=!1,j=[-1,-1],l=0,k=0,m=this.viewer.haveFileSet();for(e=a;e<this.slen;e++)switch(this.getToken(e).tok){case 1048579:case 269484209:this.checkLength(a+(f?2:1));g=!0;break;case 269484192:1!=l&&this.invArg();h=!0;
break;case 1048587:this.checkLength(a+1);break;case 3:if(c=!1,0>(k=this.floatParameter(e))){this.checkLength(e+1);this.chk||this.viewer.morph(-k);return}case 2:case 4:2==l&&this.invArg();d=4==this.theTok?J.script.ScriptEvaluator.getFloatEncodedInt(this.theToken.value):this.theToken.intValue;0>d&&1==l&&(h=!0,d=-d,m&&1E6>d&&(d*=1E6));3==this.theTok&&(m&&k==Clazz.floatToInt(k))&&(d=1E6*Clazz.floatToInt(k));if(2147483647==d){if(1==e&&(d=this.theToken.value.toString(),d=this.chk?-1:this.viewer.getModelIndexFromId(d),
0<=d)){this.checkLength(2);this.viewer.setCurrentModelIndex(d);return}d=0}if(-1==d){this.checkLength(a+1);this.chk||this.viewer.setAnimation(1073742108);return}1E3<=d&&(1E6>d&&m)&&(d=1E6*Clazz.doubleToInt(d/1E3)+d%1E3);!c&&(0==d&&0==l)&&(g=!0);1E6<=d&&(c=!1);j[l++]=d;break;case 1073742096:b=!0;break;case 1073742114:f=!0;break;default:this.frameControl(a);return}f&&0==l&&(g=!0);if(!this.chk)if(g)this.viewer.setAnimationOn(!1),this.viewer.setAnimationRange(-1,-1),f||this.viewer.setCurrentModelIndex(-1);
else{2==l&&!f&&(h=!0);if(m)c=!1;else if(c)for(e=0;e<l;e++)0<=j[e]&&(j[e]%=1E6);d=this.viewer.getModelNumberIndex(j[0],c,!1);a=-1;if(m&&0>d&&0!=j[0])if(1E6>j[0]&&(j[0]*=1E6),2==l&&1E6>j[1]&&(j[1]*=1E6),0==j[0]%1E6)j[0]++,d=this.viewer.getModelNumberIndex(j[0],!1,!1),0<=d&&(a=this.viewer.getModelNumberIndex(1==l?j[0]+1E6:0==j[1]?-1:0==j[1]%1E6?j[1]+1000001:j[1]+1,!1,!1),0>a&&(a=this.viewer.getModelCount()),a--,f?l=2:!h&&a!=d&&(h=!0),f=f||d==a);else return;(!b&&!f||0<=d)&&this.viewer.setCurrentModelIndexClear(d,
!1);if(b&&2==l||f||h)0>a&&(a=this.viewer.getModelNumberIndex(j[1],c,!1)),this.viewer.setAnimationOn(!1),this.viewer.setAnimationDirection(1),this.viewer.setAnimationRange(d,a),this.viewer.setCurrentModelIndexClear(h&&!f?-1:0<=d?d:0,!1);b&&this.viewer.setAnimation(266287)}}}},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"bitSetForModelFileNumber",function(a){var b=J.util.BSUtil.newBitSet(this.viewer.getAtomCount());if(this.chk)return b;var c=this.viewer.getModelCount(),d=this.viewer.haveFileSet();1E6>a&&d&&
(a*=1E6);if(0==a%1E6){d=this.viewer.getModelNumberIndex(a+1,!1,!1);if(0>d)return b;a=0==a?c:this.viewer.getModelNumberIndex(a+1000001,!1,!1);0>d&&(d=0);0>a&&(a=c);this.viewer.isTrajectory(d)&&(a=d+1);for(c=d;c<a;c++)b.or(this.viewer.getModelUndeletedAtomsBitSet(c))}else c=this.viewer.getModelNumberIndex(a,!1,!0),0<=c&&b.or(this.viewer.getModelUndeletedAtomsBitSet(c));return b},"~N");$_M(c$,"frameControl",($fz=function(a){switch(this.getToken(this.checkLast(a)).tok){case 1073742098:case 1073742096:case 266287:case 20487:case 1073742037:case 1073742108:case 1073742126:case 1073741942:case 1073741993:this.chk||
this.viewer.setAnimation(this.theTok);return}this.invArg()},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"getShapeType",($fz=function(a){a=J.viewer.JC.shapeTokenIndex(a);0>a&&this.error(49);return a},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"font",($fz=function(a,b){var c="SansSerif",d="Plain",e=0,f=-1;switch(this.iToken=this.slen){case 6:f=this.floatParameter(5),5<=f&&(f=this.viewer.getZoomSetting()/f/this.viewer.getScalePixelsPerAngstrom(!1));case 5:1073741824!=this.getToken(4).tok&&this.invArg(),d=this.parameterAsString(4);
case 4:1073741824!=this.getToken(3).tok&&this.invArg();c=this.parameterAsString(3);this.isFloatParameter(2)||this.error(34);b=this.floatParameter(2);a=this.getShapeType(this.getToken(1).tok);break;case 3:this.isFloatParameter(2)||this.error(34);-1==a?(a=this.getShapeType(this.getToken(1).tok),b=this.floatParameter(2)):1<=b&&(b+=e=5);break;default:if(5==a){b=13;break}this.error(2)}5==a&&((0>b||1<=b&&(6>b||63<b))&&this.integerOutOfRange(6-e,63-e),this.setShapeProperty(5,"setDefaults",this.viewer.getNoneSelected()));
this.chk||(0<=J.util.GData.getFontStyleID(c)&&(d=c,c="SansSerif"),c=this.viewer.getFont3D(c,d,b),this.sm.loadShape(a),this.setShapeProperty(a,"font",c),0<=f&&this.setShapeProperty(a,"scalereference",Float.$valueOf(f)))},$fz.isPrivate=!0,$fz),"~N,~N");$_M(c$,"set",($fz=function(){if(1==this.slen)this.showString(this.viewer.getAllSettings(null));else{var a=this.parameterAsString(0).equals("set"),b=this.optParameterAsString(1);if(a&&2==this.slen&&0<=b.indexOf("?"))this.showString(this.viewer.getAllSettings(b.substring(0,
b.indexOf("?"))));else{var c=this.getToken(1).tok,d=0,e,f=2147483647,g=!this.chk&&!this.tQuiet&&this.scriptLevel<=this.scriptReportingLevel&&!this.st[0].value.equals("var");switch(c){case 1611272194:this.axes(2);return;case 1610616835:this.background(2);return;case 1679429641:this.boundbox(2);return;case 1611272202:this.frank(2);return;case 1610616855:this.history(2);return;case 1826248715:this.label(2);return;case 1614417948:this.unitcell(2);return;case 536870920:this.sm.loadShape(8);this.setShapeProperty(8,
"highlight",1048588==this.tokAt(2)?null:this.atomExpressionAt(2));return;case 1610625028:case 1611141171:this.selectionHalo(2);return;case 536875070:this.timeout(2);return}switch(c){case 1641025539:g=J.constant.EnumStructure.getProteinStructureType(this.parameterAsString(2));g===J.constant.EnumStructure.NOT&&this.invArg();a=this.floatParameterSet(3,0,2147483647);0!=a.length%4&&this.invArg();this.viewer.setStructureList(a,g);this.checkLast(this.iToken);return;case 545259526:f=this.getArgbParam(2);
this.chk||this.setObjectArgb("axes",f);return;case 1610612737:this.setBondmode();return;case 536870916:if(this.chk)return;a=1048588==this.tokAt(2)||2==this.tokAt(2)&&0==this.intParameter(2)?4:5;J.util.Logger.setLogLevel(a);this.setIntProperty("logLevel",a);4==a&&(this.viewer.setDebugScript(!1),g&&this.viewer.showParameter("debugScript",!0,80));this.setDebugging();g&&this.viewer.showParameter("logLevel",!0,80);return;case 537022465:this.setEcho();return;case 1610612738:this.font(5,2==this.checkLength23()?
0:this.floatParameter(2));return;case 1612189718:this.setHbond();return;case 1746538509:case 537006096:this.setMonitor();return;case 1611141176:this.setSsbond();return;case 1610612741:this.setLabel("toggle");return;case 536870930:this.setUserColors();return;case 553648188:this.setZslab();return}var h=!0;switch(c){case 536870914:if(2<this.slen){a=this.stringSetting(2,!1);g=!1;0>a.indexOf(".")?(a=JU.ParserJS.parseInt(a),g=!0):a=J.script.ScriptEvaluator.getFloatEncodedInt(a);if(this.chk)return;g=this.viewer.getModelNumberIndex(a,
g,!0);this.viewer.setBackgroundModelIndex(g);return}break;case 1649412120:if(this.chk)return;this.viewer.setAtomProperty(this.viewer.getModelUndeletedAtomsBitSet(-1),1649412120,-1,NaN,null,null,null);switch(this.tokAt(2)){case 1073742109:this.runScript("#VDW radii for PROBE;{_H}.vdw = 1.0;{_H and connected(_C) and not connected(within(smiles,'[a]'))}.vdw = 1.17;{_C}.vdw = 1.75;{_C and connected(3) and connected(_O)}.vdw = 1.65;{_N}.vdw = 1.55;{_O}.vdw = 1.4;{_P}.vdw = 1.8;{_S}.vdw = 1.8;message VDW radii for H, C, N, O, P, and S set according to Word, et al., J. Mol. Biol. (1999) 285, 1711-1733");
return}d=545259555;case 545259555:2<this.slen&&(e=3==this.slen&&null==J.constant.EnumVdw.getVdwType(this.parameterAsString(2))?this.stringSetting(2,!1):this.parameterAsString(2),null==J.constant.EnumVdw.getVdwType(e)&&this.invArg(),this.setStringProperty(b,e));break;case 536870918:2<this.slen&&(e=this.parameterExpressionToken(2),8==e.tok?e=e.value:(e=e.asInt(),e=555>e?new JU.P3:this.viewer.getSymmetry().ijkToPoint3f(e+111)),this.chk||this.viewer.setDefaultLattice(e));break;case 545259552:case 545259545:2<
this.slen&&(e=1073741992==(this.theTok=this.tokAt(2))||1073742116==this.theTok?this.parameterAsString(this.checkLast(2)):this.stringSetting(2,!1),this.setStringProperty(b,e));break;case 1632634889:f=this.intSetting(2);-2147483648==f&&this.invArg();this.chk||this.viewer.setFormalCharges(f);return;case 553648148:f=this.intSetting(2);this.chk||(-2147483648!=f&&(this.commandHistoryLevelMax=f),this.setIntProperty(b,f));break;case 545259564:2<this.slen&&this.setStringProperty(b,this.stringSetting(2,a));
break;case 545259568:case 545259558:2<this.slen&&this.setUnits(this.stringSetting(2,a),c);break;case 545259572:this.chk||this.viewer.setPicked(-1);if(2<this.slen){this.setPicking();return}break;case 545259574:if(2<this.slen){this.setPickingStyle();return}break;case 1716520985:break;case 553648168:f=this.intSetting(2);!this.chk&&-2147483648!=f&&this.setIntProperty(b,this.scriptReportingLevel=f);break;case 536870924:f=this.intSetting(2);if(-2147483648==f||0==f||1==f){h=!1;break}c=553648174;b="specularPercent";
this.setIntProperty(b,f);break;case 1650071565:c=553648178;b="strandCount";this.setIntProperty(b,this.intSetting(2));break;default:h=!1}if(!h||g){var j=!h&&!a&&null!=this.getContextVariableAsVariable(b);if(!h&&!j)switch(c){case 1678770178:d=603979928;break;case 1613758470:d=603979908;break;case 1613758476:d=603979910;break;case 1610612739:d=603979879;break;case 1666189314:d=570425394;this.setFloatProperty("solventProbeRadius",this.floatSetting(2));h=!0;break;case 1610612740:d=570425390;break;case 1613758488:d=
603979948;break;case 1766856708:d=545259545;break;case 1611141175:e=this.parameterAsString(2).toLowerCase();switch("x;y;z;fps".indexOf(e+";")){case 0:d=570425398;break;case 2:d=570425400;break;case 4:d=570425402;break;case 6:d=570425396;break;default:this.errorStr2(50,"set SPIN ",e)}this.chk||this.viewer.setSpin(e,Clazz.floatToInt(this.floatParameter(this.checkLast(3))));h=!0}if(0!=d)b=J.script.T.nameOf(c=d);else if(!h&&!j){(0==b.length||"_"==b.charAt(0))&&this.error(56);d=b.toLowerCase();if(0==d.indexOf("label")&&
J.util.Parser.isOneOf(b.substring(5).toLowerCase(),";front;group;atom;offset;offsetexact;pointer;alignment;toggle;scalereference;")&&this.setLabel(b.substring(5)))return;if(a&&0==d.indexOf("shift_")){g=this.floatParameter(2);this.checkLength(3);this.chk||this.viewer.getNMRCalculation().setChemicalShiftReference(d.substring(6),g);return}d.endsWith("callback")&&(c=536870912)}a&&!J.script.T.tokAttr(c,536870912)&&(this.iToken=1,this.isStateScript||this.errorStr2(50,"SET",b),this.warning(51,"SET",b));
if(!h&&a)switch(this.slen){case 2:this.setBooleanProperty(b,!0);h=!0;break;case 3:2147483647!=f&&(this.setIntProperty(b,f),h=!0)}!h&&(!a&&1048587==this.tokAt(2))&&(this.chk||this.viewer.removeUserVariable(b.toLowerCase()),h=!0);if(!h&&(f=1048577==this.tokAt(1)?0:this.tokAt(2),c=this.st[0].intValue,e=269484436==f?3:61==c&&!b.equals("return")&&269484436!=f?0:2,this.setVariable(e,0,b,c),!a))return;g&&this.viewer.showParameter(b,!0,80)}}}},$fz.isPrivate=!0,$fz));$_M(c$,"setZslab",($fz=function(){var a=
null;this.isFloatParameter(2)?(this.checkLength(3),this.setIntProperty("zSlab",Clazz.floatToInt(this.floatParameter(2)))):(this.isCenterParameter(2)||this.invArg(),a=this.centerParameter(2),this.checkLength(this.iToken+1));this.chk||this.viewer.setZslabPoint(a)},$fz.isPrivate=!0,$fz));$_M(c$,"setBondmode",($fz=function(){var a=!1;switch(this.getToken(this.checkLast(2)).tok){case 269484128:break;case 269484112:a=!0;break;default:this.invArg()}this.setBooleanProperty("bondModeOr",a)},$fz.isPrivate=
!0,$fz));$_M(c$,"setEcho",($fz=function(){var a=null,b=null,c=null,d=!0,e=2;switch(this.getToken(2).tok){case 1048588:c=a="allOff";this.checkLength(++e);break;case 1048587:d=!1;case 1048579:c=this.parameterAsString(2);this.checkLength(++e);break;case 1073741996:case 12289:case 1073742128:case 1074790748:case 1073742019:case 1073741871:case 1073741824:case 4:case 1074790550:1074790550==this.theTok&&e++,c=this.parameterAsString(e++)}this.chk||(this.viewer.setEchoStateActive(d),this.sm.loadShape(30),
null!=c&&this.setShapeProperty(30,null==a?"target":a,c));if(e<this.slen)switch(this.getToken(e++).tok){case 1073741832:a="align";switch(this.getToken(e).tok){case 1073741996:case 1073742128:case 12289:b=this.parameterAsString(e++);break;default:this.invArg()}break;case 12289:case 1073741996:case 1073742128:a="align";b=this.parameterAsString(e-1);break;case 554176526:a="%zpos";b=Integer.$valueOf(Clazz.floatToInt(this.floatParameter(e++)));break;case 1610625028:case 3145768:case 1048589:a="hidden";
b=Boolean.FALSE;break;case 12294:case 3145770:a="hidden";b=Boolean.TRUE;break;case 1095766028:b=this.chk?0:this.modelNumberParameter(e++);b>=this.viewer.getModelCount()&&this.invArg();a="model";b=Integer.$valueOf(b);break;case 269484096:case 1073742195:a="xypos";b=this.xypParameter(--e);null==b?e--:e=this.iToken+1;break;case 2:e--;c=this.intParameter(e++);d="xpos";269484210==this.tokAt(e)&&(d="%xpos",e++);a="ypos";b=Integer.$valueOf(this.intParameter(e++));269484210==this.tokAt(e)&&(a="%ypos",e++);
this.checkLength(e);this.setShapeProperty(30,d,Integer.$valueOf(c));break;case 1048588:a="off";break;case 1073742138:a="scale";b=Float.$valueOf(this.floatParameter(e++));break;case 135271429:a="script";b=this.parameterAsString(e++);break;case 4:case 1073741979:(a=1073741979==this.theTok)&&e++;this.checkLength(e);null==c&&a&&(b=Array(1),this.getShapePropertyData(30,"currentTarget",b),c=b[0]);this.echo(e-1,c,a);return;case 135266320:a="point";b=this.isCenterParameter(e)?this.centerParameter(e):null;
e=this.iToken+1;break;default:if(this.isCenterParameter(e-1)){a="xyz";b=this.centerParameter(e-1);e=this.iToken+1;break}this.invArg()}this.checkLength(e);!this.chk&&null!=a&&this.setShapeProperty(30,a,b)},$fz.isPrivate=!0,$fz));$_M(c$,"intSetting",($fz=function(a){return a==this.slen?-2147483648:this.parameterExpressionToken(a).asInt()},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"floatSetting",($fz=function(a){return a==this.slen?NaN:J.script.SV.fValue(this.parameterExpressionToken(a))},$fz.isPrivate=!0,
$fz),"~N");$_M(c$,"stringSetting",($fz=function(a,b){return b&&this.slen==a+1?this.parameterAsString(a):this.parameterExpressionToken(a).asString()},$fz.isPrivate=!0,$fz),"~N,~B");$_M(c$,"setLabel",($fz=function(a){this.sm.loadShape(5);var b=null;for(this.setShapeProperty(5,"setDefaults",this.viewer.getNoneSelected());;){if(a.equals("scalereference")){b=this.floatParameter(2);5<=b&&(b=this.viewer.getZoomSetting()/b/this.viewer.getScalePixelsPerAngstrom(!1));b=Float.$valueOf(b);break}if(a.equals("offset")||
a.equals("offsetexact")){if(this.isPoint3f(2))b=this.getPoint3f(2,!1),b=[1,b.x,b.y,b.z,0,0,0];else if(this.isArrayParameter(2))b=this.floatParameterSet(2,7,7);else var b=this.intParameterRange(2,-127,127),c=this.intParameterRange(3,-127,127),b=Integer.$valueOf(J.viewer.JC.getOffset(b,c));break}if(a.equals("alignment")){switch(this.getToken(2).tok){case 1073741996:case 1073742128:case 12289:a="align";b=this.theToken.value;break;default:this.invArg()}break}if(a.equals("pointer")){b=0;switch(this.getToken(2).tok){case 1048588:case 1048587:break;
case 1610616835:b|=2;case 1048589:b|=1;break;default:this.invArg()}b=Integer.$valueOf(b);break}if(a.equals("toggle"))return this.iToken=1,c=2==this.slen?null:this.atomExpressionAt(2),this.checkLast(this.iToken),this.chk||this.viewer.togglePickingLabel(c),!0;this.iToken=1;b=2==this.slen||1048589==this.getToken(2).tok;if(a.equals("front")||a.equals("group")){!b&&1048588!=this.tokAt(2)&&this.invArg();b||(a="front");b=b?Boolean.TRUE:Boolean.FALSE;break}if(a.equals("atom")){!b&&1048588!=this.tokAt(2)&&
this.invArg();a="front";b=b?Boolean.FALSE:Boolean.TRUE;break}return!1}c=this.iToken+1<this.slen?this.atomExpressionAt(++this.iToken):null;this.checkLast(this.iToken);if(this.chk)return!0;null==c?this.setShapeProperty(5,a,b):this.setShapePropertyBs(5,a,b,c);return!0},$fz.isPrivate=!0,$fz),"~S");$_M(c$,"setMonitor",($fz=function(){var a=this.tokAt(this.checkLast(2));switch(a){case 1048589:case 1048588:this.setBooleanProperty("measurementlabels",1048589==a);return;case 1073741926:case 2:case 3:this.viewer.loadShape(6);
this.setShapeSizeBs(6,this.getSetAxesTypeMad(2),null);return}this.setUnits(this.parameterAsString(2),545259568)},$fz.isPrivate=!0,$fz));$_M(c$,"setUnits",($fz=function(a,b){545259568==b&&(a.endsWith("hz")||J.util.Parser.isOneOf(a.toLowerCase(),";angstroms;au;bohr;nanometers;nm;picometers;pm;vanderwaals;vdw;"))?this.chk||this.viewer.setUnits(a,!0):545259558==b&&J.util.Parser.isOneOf(a.toLowerCase(),";kcal;kj;")?this.chk||this.viewer.setUnits(a,!1):this.errorStr2(50,"set "+J.script.T.nameOf(b),a);return!0},
$fz.isPrivate=!0,$fz),"~S,~N");$_M(c$,"setSsbond",($fz=function(){var a=!1;switch(this.tokAt(this.checkLast(2))){case 1115297793:a=!0;break;case 3145754:break;default:this.invArg()}this.setBooleanProperty("ssbondsBackbone",a)},$fz.isPrivate=!0,$fz));$_M(c$,"setHbond",($fz=function(){var a=!1;switch(this.tokAt(this.checkLast(2))){case 1115297793:a=!0;case 3145754:this.setBooleanProperty("hbondsBackbone",a);break;case 1073742150:a=!0;case 1073741926:this.setBooleanProperty("hbondsSolid",a);break;default:this.invArg()}},
$fz.isPrivate=!0,$fz));$_M(c$,"setPicking",($fz=function(){if(2==this.slen)this.setStringProperty("picking","identify");else if(4<this.slen||4==this.tokAt(2))this.setStringProperty("picking",this.stringSetting(2,!1));else{var a=2,b="SELECT";switch(this.getToken(2).tok){case 135280132:case 1746538509:case 1611141175:4==this.checkLength34()&&(b=this.parameterAsString(2).toUpperCase(),b.equals("SPIN")?this.setIntProperty("pickingSpinRate",this.intParameter(3)):a=3);break;case 12291:break;default:this.checkLength(3)}var c=
this.parameterAsString(a);switch(this.getToken(a).tok){case 1048589:case 1073742056:c="identify";break;case 1048588:case 1048587:c="off";break;case 135280132:c="atom";break;case 1826248715:c="label";break;case 1678770178:c="bond";break;case 12291:this.checkLength(4),1678770178!=this.tokAt(3)&&this.invArg(),c="deleteBond"}var d=0<=(d=c.indexOf("_"))?d:c.length,d=J.viewer.ActionManager.getPickingMode(c.substring(0,d));0>d&&this.errorStr2(50,"SET PICKING "+b,c);this.setStringProperty("picking",c)}},
$fz.isPrivate=!0,$fz));$_M(c$,"setPickingStyle",($fz=function(){if(4<this.slen||4==this.tokAt(2))this.setStringProperty("pickingStyle",this.stringSetting(2,!1));else{var a=2,b=!1,c="SELECT";switch(this.getToken(2).tok){case 1746538509:b=!0,c="MEASURE";case 135280132:4==this.checkLength34()&&(a=3);break;default:this.checkLength(3)}var d=this.parameterAsString(a);switch(this.getToken(a).tok){case 1048587:case 1048588:d=b?"measureoff":"toggle";break;case 1048589:b&&(d="measure")}0>J.viewer.ActionManager.getPickingStyleIndex(d)&&
this.errorStr2(50,"SET PICKINGSTYLE "+c,d);this.setStringProperty("pickingStyle",d)}},$fz.isPrivate=!0,$fz));$_M(c$,"timeout",($fz=function(a){var b=null,c=null,d=0;if(this.slen==a)this.showString(this.viewer.showTimeout(null));else{for(;a<this.slen;a++)switch(this.getToken(a).tok){case 1074790550:b=this.parameterAsString(++a);if(3==this.slen){this.chk||this.viewer.triggerTimeout(b);return}break;case 1048588:break;case 2:d=this.intParameter(a);break;case 3:d=Math.round(1E3*this.floatParameter(a));
break;default:null==b?b=this.parameterAsString(a):null==c?c=this.parameterAsString(a):this.invArg()}this.chk||this.viewer.setTimeout(b,d,c)}},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"setUserColors",($fz=function(){for(var a=new JU.List,b=2;b<this.slen;b++){var c=this.getArgbParam(b);a.addLast(Integer.$valueOf(c));b=this.iToken}if(!this.chk){b=a.size();for(c=Clazz.newIntArray(b,0);0<=--b;)c[b]=a.get(b).intValue();this.viewer.setUserScale(c)}},$fz.isPrivate=!0,$fz));$_M(c$,"setVariable",($fz=function(a,
b,c,d){var e=null,f="",g=0,h=91==d,j=!1,l=!1,k=c.startsWith("property_");d=k?null:this.getContextVariableAsVariable(c);var m=null!=d;0<a&&1048577==this.tokAt(a-1)&&(e=this.atomExpressionAt(a-1),a=this.iToken+1,l=!0);1048584==this.tokAt(a)&&(j=!0,f=this.getBitsetPropertySelector(++a,!0),null==f&&this.invArg(),269484436!=this.tokAt(++a)&&this.invArg(),a++,g=f.intValue,f=f.value);l&&!j&&this.invArg();a=this.parameterExpression(a,b,c,!0,!0,-1,h,null,null);b=a.size();(0==b||!h&&1<b||h&&(3>b||1!=b%2))&&
this.invArg();if(!this.chk){b=a.get(h?a.size()-1:0);if(!m&&!l&&!k&&(h||j||!Clazz.instanceOf(b.value,String)&&!(2==b.tok||Clazz.instanceOf(b.value,Integer)||Clazz.instanceOf(b.value,Float)||Clazz.instanceOf(b.value,Boolean))))c.startsWith("_")&&this.errorStr(22,c),d=this.viewer.getOrSetNewVariable(c,!0),m=!0;if(h){c=J.script.SV.newVariable(4,"").setv(b,!1);e=Clazz.doubleToInt(a.size()/2);for(g=0;g<e;g++)if(f=g+1==e,h=a.get(2*g),10==d.tok&&(d.tok=6,d.value=new java.util.Hashtable),6==d.tok){h=h.asString();
d=d.value;if(f){d.put(h,c);break}d=d.get(h)}else{h=h.asInt();7==d.tok&&(d=J.script.SV.selectItemVar(d));switch(d.tok){case 7:j=d.getList();if(h>j.size()||f)break;0>=h&&(h=j.size()+h);0>--h&&(h=0);d=j.get(h);continue;case 11:case 12:f=11==d.tok?3:4;if(1==e&&1<=Math.abs(h)&&Math.abs(h)<=f&&7==c.tok&&c.getList().size()==f)break;if(2==e&&(j=a.get(2).asInt(),1<=j&&j<=f&&(2==c.tok||3==c.tok))){h=10*h+j;break}d.toArray();--g;continue}d.setSelectedValue(h,c);break}}else j?(l||(e=J.script.SV.getBitSet(d,!0),
null==e&&this.invArg()),f.startsWith("property_")?this.viewer.setData(f,[f,7==b.tok?J.script.SV.flistValue(b,b.value.size()==e.cardinality()?e.cardinality():this.viewer.getAtomCount()):b.asString(),J.util.BSUtil.copy(e),Integer.$valueOf(7==b.tok?1:0),Boolean.FALSE],this.viewer.getAtomCount(),0,0,7==b.tok?2147483647:-2147483648,0):this.setBitsetProperty(e,g,b.asInt(),b.asFloat(),b)):m?d.setv(b,!1):(h=J.script.SV.oValue(b),c.startsWith("property_")?(7==b.tok&&(h=b.asString()),this.viewer.setData(c,
[c,""+h,J.util.BSUtil.copy(this.viewer.getSelectionSet(!1)),Integer.$valueOf(0)],this.viewer.getAtomCount(),0,0,-2147483648,0)):Clazz.instanceOf(h,Boolean)?this.setBooleanProperty(c,h.booleanValue()):Clazz.instanceOf(h,Integer)?this.setIntProperty(c,h.intValue()):Clazz.instanceOf(h,Float)?this.setFloatProperty(c,h.floatValue()):Clazz.instanceOf(h,String)?this.setStringProperty(c,h):Clazz.instanceOf(h,J.modelset.Bond.BondSet)?this.setStringProperty(c,J.util.Escape.eBond(h)):Clazz.instanceOf(h,JU.BS)||
Clazz.instanceOf(h,JU.P3)||Clazz.instanceOf(h,JU.P4)?this.setStringProperty(c,J.util.Escape.e(h)):J.util.Logger.error("ERROR -- return from propertyExpression was "+h))}},$fz.isPrivate=!0,$fz),"~N,~N,~S,~N");$_M(c$,"axes",($fz=function(a){var b=this.checkTicks(a,!0,!0,!1);a=this.iToken+1;var c=this.tokAt(a),d=this.optParameterAsString(a).toLowerCase();if(this.slen==a+1&&J.util.Parser.isOneOf(d,";window;unitcell;molecular;"))this.setBooleanProperty("axes"+d,!0);else{switch(c){case 12289:a=this.centerParameter(a+
1);this.setShapeProperty(31,"origin",a);this.checkLast(this.iToken);return;case 1073742138:this.setFloatProperty("axesScale",this.floatParameter(this.checkLast(++a)));return;case 1826248715:switch(c=this.tokAt(a+1)){case 1048588:case 1048589:this.checkLength(a+2);this.setShapeProperty(31,"labels"+(1048589==c?"On":"Off"),null);return}b=null;switch(this.slen-a){case 7:this.setShapeProperty(31,"labels",[this.parameterAsString(++a),this.parameterAsString(++a),this.parameterAsString(++a),this.parameterAsString(++a),
this.parameterAsString(++a),this.parameterAsString(++a)]);break;case 5:b=this.parameterAsString(a+4);case 4:this.setShapeProperty(31,"labels",[this.parameterAsString(++a),this.parameterAsString(++a),this.parameterAsString(++a),b]);break;default:this.error(2)}return}d.equals("position")?(1048588==this.tokAt(++a)?a=new JU.P3:(a=this.xypParameter(a),null==a&&this.invArg()),this.setShapeProperty(31,"position",a)):(a=this.getSetAxesTypeMad(a),this.chk||(this.setObjectMad(31,"axes",a),null!=b&&this.setShapeProperty(31,
"tickInfo",b)))}},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"boundbox",($fz=function(a){var b=this.checkTicks(a,!1,!0,!1);a=this.iToken+1;var c=1;if(1073742138==this.tokAt(a)&&(c=this.floatParameter(++a),!this.chk&&0==c&&this.invArg(),a++,a==this.slen)){this.chk||this.viewer.setBoundBox(null,null,!0,c);return}var d=1073741902==this.tokAt(a);d&&a++;if(this.isCenterParameter(a)){this.expressionResult=null;var e=a,f=this.centerParameter(a);a=this.iToken+1;if(d||this.isCenterParameter(a))e=d?this.centerParameter(a):
this.getPoint3f(a,!0),a=this.iToken+1,this.chk||this.viewer.setBoundBox(f,e,d,c);else if(null!=this.expressionResult&&Clazz.instanceOf(this.expressionResult,JU.BS))this.chk||this.viewer.calcBoundBoxDimensions(this.expressionResult,c);else if(null==this.expressionResult&&1048583==this.tokAt(e)){if(this.chk)return;a=this.getObjectBoundingBox(this.objectNameParameter(++e));null==a&&this.invArg();this.viewer.setBoundBox(a[0],a[1],!0,c);a=this.iToken+1}else this.invArg();if(a==this.slen)return}c=this.getSetAxesTypeMad(a);
this.chk||(null!=b&&this.setShapeProperty(32,"tickInfo",b),this.setObjectMad(32,"boundbox",c))},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"checkTicks",function(a,b,c,d){this.iToken=a-1;if(1073742164!=this.tokAt(a))return null;var e=" ";switch(this.tokAt(a+1)){case 1112541205:case 1112541206:case 1112541207:e=this.parameterAsString(++a).toLowerCase();break;case 1073741824:this.invArg()}if(1048587==this.tokAt(++a))return b=new J.modelset.TickInfo(null),b.type=e,this.iToken=a,b;b=new J.modelset.TickInfo(this.getPointOrPlane(a,
!1,!0,!1,!1,3,3));if(this.coordinatesAreFractional||1614417948==this.tokAt(this.iToken+1))b.scale=JU.P3.new3(NaN,NaN,NaN),c=!1;1614417948==this.tokAt(this.iToken+1)&&this.iToken++;b.type=e;1288701960==this.tokAt(this.iToken+1)&&(b.tickLabelFormats=this.stringParameterSet(this.iToken+2));if(!c)return b;1073742138==this.tokAt(this.iToken+1)&&(this.isFloatParameter(this.iToken+2)?(a=this.floatParameter(this.iToken+2),b.scale=JU.P3.new3(a,a,a)):b.scale=this.getPoint3f(this.iToken+2,!0));d&&1073741942==
this.tokAt(this.iToken+1)&&(b.first=this.floatParameter(this.iToken+2));return b},"~N,~B,~B,~B");$_M(c$,"unitcell",($fz=function(a){var b=2147483647,c=2147483647,d=null,e=this.checkTicks(a,!0,!1,!1);a=this.iToken;var f=null,g=null;switch(this.tokAt(a+1)){case 4:f=this.objectNameParameter(++a);break;case 1048583:a++;f=this.objectNameParameter(++a);break;case 12289:++a;switch(this.tokAt(++a)){case 10:case 1048577:d=JU.P3.newP(this.viewer.getAtomSetCenter(this.atomExpressionAt(a)));this.viewer.toFractional(d,
!0);a=this.iToken;break;default:if(this.isCenterParameter(a)){d=this.centerParameter(a);a=this.iToken;break}this.invArg()}d.x-=0.5;d.y-=0.5;d.z-=0.5;break;default:this.isArrayParameter(a+1)?(g=this.getPointArray(++a,4),a=this.iToken):this.slen==a+2?2==this.getToken(a+1).tok&&111<=this.intParameter(a+1)&&(b=this.intParameter(++a)):this.slen>a+1&&(d=this.getPointOrPlane(++a,!1,!0,!1,!0,3,3),a=this.iToken)}c=this.getSetAxesTypeMad(++a);this.checkLast(this.iToken);this.chk||(2147483647!=b?this.viewer.setCurrentUnitCellOffset(b):
null!=f?this.viewer.setCurrentCage(f):null!=g&&this.viewer.setCurrentCagePts(g),this.setObjectMad(33,"unitCell",c),null!=d&&this.viewer.setCurrentUnitCellOffsetPt(d),null!=e&&this.setShapeProperty(33,"tickInfo",e))},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"frank",($fz=function(a){this.setBooleanProperty("frank",this.booleanParameter(a))},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"selectionHalo",($fz=function(a){var b=!1;switch(a==this.slen?1048589:this.getToken(a).tok){case 1048589:case 1114638363:b=!0;case 1048588:case 1048587:case 1073742056:this.setBooleanProperty("selectionHalos",
b);break;default:this.invArg()}},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"save",($fz=function(){if(1<this.slen){var a=this.optParameterAsString(2);switch(this.tokAt(1)){case 1073742077:case 1073742132:this.chk||this.viewer.saveOrientation(a,null);return;case 1678770178:this.chk||this.viewer.saveBonds(a);return;case 1073742158:this.chk||this.viewer.saveState(a);return;case 1641025539:this.chk||this.viewer.saveStructure(a);return;case 1048582:this.chk||this.viewer.saveCoordinates(a,this.viewer.getSelectionSet(!1));
return;case 1073742140:this.chk||this.viewer.saveSelection(a);return}}this.errorStr2(53,"SAVE","bonds? coordinates? orientation? selection? state? structure?")},$fz.isPrivate=!0,$fz));$_M(c$,"restore",($fz=function(){if(1<this.slen){var a=this.optParameterAsString(2),b=this.tokAt(1);switch(b){case 1073742077:case 1073742132:case 1073742139:var c=3<this.slen?this.floatParameter(3):0;0>c&&this.invArg();if(this.chk)return;var d="";switch(b){case 1073742077:d="Orientation";this.viewer.restoreOrientation(a,
c);break;case 1073742132:d="Rotation";this.viewer.restoreRotation(a,c);break;case 1073742139:d="Scene",this.viewer.restoreScene(a,c)}if(this.isJS&&0<c&&this.viewer.global.waitForMoveTo)throw new J.script.ScriptInterruption(this,"restore"+d,1);return}this.checkLength23();switch(b){case 1678770178:this.chk||this.viewer.restoreBonds(a);return;case 1048582:if(this.chk)return;a=this.viewer.getSavedCoordinates(a);null==a&&this.invArg();this.runScript(a);this.viewer.checkCoordinatesChanged();return;case 1073742140:this.chk||
this.viewer.restoreSelection(a);return;case 1073742158:if(this.chk)return;a=this.viewer.getSavedState(a);null==a&&this.invArg();this.runScript(a);return;case 1641025539:if(this.chk)return;a=this.viewer.getSavedStructure(a);null==a&&this.invArg();this.runScript(a);return}}this.errorStr2(53,"RESTORE","bonds? coords? orientation? rotation? scene? selection? state? structure?")},$fz.isPrivate=!0,$fz));$_M(c$,"getColorTrans",function(a){var b=3.4028235E38;1766856708!=this.theTok&&--a;switch(this.tokAt(a+
1)){case 603979967:a++;b=this.isFloatParameter(a+1)?this.getTranslucentLevel(++a):this.viewer.getFloat(570425354);break;case 1073742074:a++,b=0}this.isColorParam(a+1)?this.colorArgb[0]=this.getArgbParam(++a):1048587==this.tokAt(a+1)?(this.colorArgb[0]=0,this.iToken=a+1):3.4028235E38==b?this.invArg():this.colorArgb[0]=-2147483648;return b},"~N,~B");$_M(c$,"finalizeObject",function(a,b,c,d,e,f,g,h){e&&this.setShapeProperty(a,"set",f);-2147483648!=b&&this.setShapePropertyBs(a,"color",Integer.$valueOf(b),
h);3.4028235E38!=c&&this.setShapeTranslucency(a,"","translucent",c,h);0!=d&&this.setShapeProperty(a,"scale",Integer.$valueOf(d));0<g&&(this.setMeshDisplayProperty(a,g,0)||this.invArg())},"~N,~N,~N,~N,~B,~O,~N,JU.BS");$_M(c$,"getColorRange",function(a){a=this.getArgbParam(a);1074790746!=this.tokAt(++this.iToken)&&this.invArg();var b=this.getArgbParam(++this.iToken),c=2==this.tokAt(this.iToken+1)?this.intParameter(++this.iToken):0;return J.util.ColorEncoder.getColorSchemeList(J.util.ColorEncoder.getPaletteAtoB(a,
b,c))},"~N");$_M(c$,"getIsosurfaceDataRange",function(a,b){var c=this.getShapeProperty(a,"dataRange");return null!=c&&3.4028235E38!=c[0]&&c[0]!=c[1]?b+"isosurface full data range "+c[0]+" to "+c[1]+" with color scheme spanning "+c[2]+" to "+c[3]:""},"~N,~S");$_M(c$,"setMeshDisplayProperty",function(a,b,c){var d=null,e=null,f=25==a,g=0==b;g||(c=this.getToken(b).tok);switch(c){case 1766856708:if(f)this.iToken++;else break;case 1073742074:case 603979967:return g||this.colorShape(a,this.iToken,!1),!0;
case 0:case 12291:case 1048589:case 1048588:case 12294:case 3145770:case 1610625028:case 3145768:1==this.iToken&&(0<=a&&0==this.tokAt(2))&&this.setShapeProperty(a,"thisID",null);if(0==c)return 1==this.iToken;if(g)return!0;switch(c){case 12291:return this.setShapeProperty(a,"delete",null),!0;case 3145770:case 12294:c=1048588;break;case 3145768:c=1048589;break;case 1610625028:b+1==this.slen&&(c=1048589);break}case 1073741958:case 1073741862:case 1073741964:case 1073741898:case 1073742039:case 1113198595:case 1073742042:case 1073742018:case 1073742052:case 1073741938:case 1073742046:case 1073742182:case 1073742060:case 1073741960:case 1073742058:d=
"token",e=Integer.$valueOf(c)}if(null==d)return!1;if(g)return!0;this.setShapeProperty(a,d,e);0!=this.tokAt(this.iToken+1)&&(this.setMeshDisplayProperty(a,++this.iToken,0)||--this.iToken);return!0},"~N,~N,~N");$_M(c$,"bind",($fz=function(){var a=this.stringParameter(1),b=this.parameterAsString(2);this.checkLength(3);this.chk||this.viewer.bindAction(a,b)},$fz.isPrivate=!0,$fz));$_M(c$,"unbind",($fz=function(){1!=this.slen&&this.checkLength23();var a=this.optParameterAsString(1),b=this.optParameterAsString(2);
if(0==a.length||1048579==this.tokAt(1))a=null;if(0==b.length||1048579==this.tokAt(2))b=null;null==b&&(null!=a&&0<=J.viewer.ActionManager.getActionFromName(a))&&(b=a,a=null);this.chk||this.viewer.unBindAction(a,b)},$fz.isPrivate=!0,$fz));$_M(c$,"undoRedoMove",($fz=function(){var a=1,b=2;switch(this.tokAt(1)){case 0:b=1;break;case 1048579:a=0;break;case 2:a=this.intParameter(1);break;default:this.invArg()}this.checkLength(b);this.chk||this.viewer.undoMoveAction(this.tokAt(0),a)},$fz.isPrivate=!0,$fz));
c$.getFloatEncodedInt=$_M(c$,"getFloatEncodedInt",function(a){var b=a.indexOf(".");if(1>b||"-"==a.charAt(0)||a.endsWith(".")||a.contains(".0"))return 2147483647;var c=0,d=0;if(0<b)try{c=Integer.parseInt(a.substring(0,b)),0>c&&(c=-c)}catch(e){if(Clazz.exceptionOf(e,NumberFormatException))c=-1;else throw e;}if(b<a.length-1)try{d=Integer.parseInt(a.substring(b+1))}catch(f){if(!Clazz.exceptionOf(f,NumberFormatException))throw f;}c=1E6*c+d;return 0>c?2147483647:c},"~S");c$.getPartialBondOrderFromFloatEncodedInt=
$_M(c$,"getPartialBondOrderFromFloatEncodedInt",function(a){return(Clazz.doubleToInt(a/1E6)%6<<5)+(a%1E6&31)},"~N");c$.getBondOrderFromString=$_M(c$,"getBondOrderFromString",function(a){return 0>a.indexOf(" ")?J.util.JmolEdge.getBondOrderFromString(a):0==a.toLowerCase().indexOf("partial ")?J.script.ScriptEvaluator.getPartialBondOrderFromString(a.substring(8).trim()):131071},"~S");c$.getPartialBondOrderFromString=$_M(c$,"getPartialBondOrderFromString",($fz=function(a){return J.script.ScriptEvaluator.getPartialBondOrderFromFloatEncodedInt(J.script.ScriptEvaluator.getFloatEncodedInt(a))},
$fz.isPrivate=!0,$fz),"~S");Clazz.overrideMethod(c$,"addHydrogensInline",function(a,b,c){var d=this.viewer.getAtomModelIndex(a.nextSetBit(0));if(d!=this.viewer.modelSet.modelCount-1)return new JU.BS;a=this.viewer.getModelUndeletedAtomsBitSet(d);this.viewer.setAppendNew(!1);for(var e=this.viewer.modelSet.getAtomCount(),f=this.viewer.modelSet.getAtomCountInModel(d),g=new JU.SB,h=0;h<b.size();h++){var j=b.get(h);g.append(";  connect 0 100 ").append("({"+e++ +"}) ").append("({"+j.index+"}) group;")}b=
new JU.SB;b.appendI(c.length).append("\n").append("Viewer.AddHydrogens").append("#noautobond").append("\n");for(h=0;h<c.length;h++)b.append("H ").appendF(c[h].x).append(" ").appendF(c[h].y).append(" ").appendF(c[h].z).append(" - - - - ").appendI(++f).appendC("\n");this.viewer.openStringInlineParamsAppend(b.toString(),null,!0);this.runScriptBuffer(g.toString(),null);c=this.viewer.getModelUndeletedAtomsBitSet(d);c.andNot(a);return c},"JU.BS,JU.List,~A");Clazz.overrideMethod(c$,"stopScriptThreads",function(){null!=
this.scriptDelayThread&&(this.scriptDelayThread.interrupt(),this.scriptDelayThread=null);null!=this.fileLoadThread&&(this.fileLoadThread.interrupt(),this.fileLoadThread.resumeEval(),null!=this.thisContext&&this.popContext(!1,!1),this.fileLoadThread=null)});$_M(c$,"delayScript",function(a){this.viewer.autoExit||(this.stopScriptThreads(),this.scriptDelayThread=new J.script.ScriptDelayThread(this,this.viewer,a),this.scriptDelayThread.run())},"~N");$_M(c$,"getErrorLineMessage2",function(){return J.script.ScriptEvaluator.getErrorLineMessage(this.functionName,
this.scriptFileName,this.getLinenumber(null),this.pc,J.script.ScriptEvaluator.statementAsString(this.viewer,this.st,-9999,this.logMessages))});Clazz.overrideMethod(c$,"evaluateParallel",function(a,b){return this.getExtension().evaluateParallel(a,b)},"J.script.ScriptContext,J.viewer.ShapeManager");Clazz.defineStatics(c$,"EXPRESSION_KEY","e_x_p_r_e_s_s_i_o_n","scriptLevelMax",100,"evalID",0,"tryPt",0,"ERROR_axisExpected",0,"ERROR_backgroundModelError",1,"ERROR_badArgumentCount",2,"ERROR_badMillerIndices",
3,"ERROR_badRGBColor",4,"ERROR_booleanExpected",5,"ERROR_booleanOrNumberExpected",6,"ERROR_booleanOrWhateverExpected",7,"ERROR_colorExpected",8,"ERROR_colorOrPaletteRequired",9,"ERROR_commandExpected",10,"ERROR_coordinateOrNameOrExpressionRequired",11,"ERROR_drawObjectNotDefined",12,"ERROR_endOfStatementUnexpected",13,"ERROR_expressionExpected",14,"ERROR_expressionOrIntegerExpected",15,"ERROR_filenameExpected",16,"ERROR_fileNotFoundException",17,"ERROR_incompatibleArguments",18,"ERROR_insufficientArguments",
19,"ERROR_integerExpected",20,"ERROR_integerOutOfRange",21,"ERROR_invalidArgument",22,"ERROR_invalidParameterOrder",23,"ERROR_keywordExpected",24,"ERROR_moCoefficients",25,"ERROR_moIndex",26,"ERROR_moModelError",27,"ERROR_moOccupancy",28,"ERROR_moOnlyOne",29,"ERROR_multipleModelsDisplayedNotOK",30,"ERROR_noData",31,"ERROR_noPartialCharges",32,"ERROR_noUnitCell",33,"ERROR_numberExpected",34,"ERROR_numberMustBe",35,"ERROR_numberOutOfRange",36,"ERROR_objectNameExpected",37,"ERROR_planeExpected",38,"ERROR_propertyNameExpected",
39,"ERROR_spaceGroupNotFound",40,"ERROR_stringExpected",41,"ERROR_stringOrIdentifierExpected",42,"ERROR_tooManyPoints",43,"ERROR_tooManyScriptLevels",44,"ERROR_unrecognizedAtomProperty",45,"ERROR_unrecognizedBondProperty",46,"ERROR_unrecognizedCommand",47,"ERROR_unrecognizedExpression",48,"ERROR_unrecognizedObject",49,"ERROR_unrecognizedParameter",50,"ERROR_unrecognizedParameterWarning",51,"ERROR_unrecognizedShowParameter",52,"ERROR_what",53,"ERROR_writeWhat",54,"ERROR_multipleModelsNotOK",55,"ERROR_cannotSet",
56,"iProcess",0)});Clazz.declarePackage("J.script");
Clazz.load(["J.script.ScriptCompilationTokenParser","JU.List"],"J.script.ScriptCompiler","java.lang.Boolean $.Character $.Float java.util.Hashtable JU.ArrayUtil $.BS $.ParserJS $.SB J.api.Interface J.i18n.GT J.io.JmolBinary J.modelset.Bond $.Group J.script.ContextToken $.SV $.ScriptContext $.ScriptEvaluator $.ScriptFlowContext $.ScriptFunction $.T J.util.Escape $.Logger $.Parser $.Txt J.viewer.Viewer".split(" "),function(){c$=Clazz.decorateAsClass(function(){this.filename=null;this.isSilent=!1;this.lineIndices=
this.lineNumbers=this.aatokenCompiled=this.contextVariables=null;this.lnLength=8;this.haveComments=this.isCheckOnly=this.isShowScriptOutput=this.preDefining=!1;this.vBraces=this.lltoken=this.ltoken=this.flowContext=this.thisFunction=this.scriptExtensions=null;this.iBrace=this.setEqualPt=this.forPoint3=this.ptSemi=this.bracketCount=this.setBraceCount=this.braceCount=this.parenCount=this.nSemiSkip=this.cchScript=this.cchToken=this.ichBrace=0;this.endOfLine=this.needRightParen=this.isEndOfCommand=this.iHaveQuotedString=
!1;this.comment=null;this.tokLastMath=0;this.checkImpliedScriptCmd=!1;this.vFunctionStack=null;this.implicitString=this.isUserToken=this.isComment=this.isShowCommand=this.allowMissingEnd=!1;this.tokInitialPlusPlus=0;this.vPush=null;this.pushCount=0;this.chFirst="\x00";Clazz.instantialize(this,arguments)},J.script,"ScriptCompiler",J.script.ScriptCompilationTokenParser);Clazz.prepareFields(c$,function(){this.vPush=new JU.List});Clazz.makeConstructor(c$,function(a){Clazz.superConstructor(this,J.script.ScriptCompiler,
[]);this.viewer=a},"J.viewer.Viewer");$_M(c$,"compile",function(a,b,c,d,e,f){this.isCheckOnly=f;this.filename=a;this.isSilent=d;this.script=b;this.logMessages=!d&&!c&&e;this.preDefining="#predefine"===a;(a=this.compile0(!0))||this.handleError();c=new J.script.ScriptContext;a=0==this.iBrace&&0==this.parenCount&&0==this.braceCount&&0==this.bracketCount;c.isComplete=a;c.script=b;c.scriptExtensions=this.scriptExtensions;c.errorType=this.errorType;null!=this.errorType&&(c.iCommandError=this.iCommand,this.setAaTokenCompiled());
c.aatoken=this.aatokenCompiled;c.errorMessage=this.errorMessage;c.errorMessageUntranslated=null==this.errorMessageUntranslated?this.errorMessage:this.errorMessageUntranslated;this.allowMissingEnd&&(null!=c.errorMessage&&0<=c.errorMessageUntranslated.indexOf("missing END"))&&(c.errorMessage=c.errorMessageUntranslated);c.lineIndices=this.lineIndices;c.lineNumbers=this.lineNumbers;c.contextVariables=this.contextVariables;return c},"~S,~S,~B,~B,~B,~B");$_M(c$,"addContextVariable",($fz=function(a){this.theToken=
J.script.T.o(1073741824,a);if(0<this.pushCount){var b=this.vPush.get(this.pushCount-1);b.addName(a);if(364558!=b.tok)return}null==this.thisFunction?(null==this.contextVariables&&(this.contextVariables=new java.util.Hashtable),J.script.ScriptCompiler.addContextVariable(this.contextVariables,a)):this.thisFunction.addVariable(a,!1)},$fz.isPrivate=!0,$fz),"~S");c$.addContextVariable=$_M(c$,"addContextVariable",function(a,b){a.put(b,J.script.SV.newVariable(4,"").setName(b))},"java.util.Map,~S");$_M(c$,
"isContextVariable",($fz=function(a){for(var b=this.vPush.size();0<=--b;){var c=this.vPush.get(b);if(null!=c.contextVariables&&c.contextVariables.containsKey(a))return!0}return null!=this.thisFunction?this.thisFunction.isVariable(a):null!=this.contextVariables&&this.contextVariables.containsKey(a)},$fz.isPrivate=!0,$fz),"~S");$_M(c$,"cleanScriptComments",($fz=function(a){0<=a.indexOf("\u201c")&&(a=a.$replace("\u201c",'"'));0<=a.indexOf("\u201d")&&(a=a.$replace("\u201d",'"'));0<=a.indexOf("\ufeff")&&
(a=a.$replace("\ufeff"," "));var b=a.indexOf("\u0001##");0<=b&&(this.scriptExtensions=a.substring(b+1),a=a.substring(0,b),this.allowMissingEnd=0<=this.scriptExtensions.indexOf("##noendcheck"));this.haveComments=0<=a.indexOf("#");return J.io.JmolBinary.getEmbeddedScript(a)},$fz.isPrivate=!0,$fz),"~S");$_M(c$,"addTokenToPrefix",($fz=function(a){this.logMessages&&J.util.Logger.debug("addTokenToPrefix"+a);this.ltoken.addLast(a);0!=a.tok&&(this.lastToken=a)},$fz.isPrivate=!0,$fz),"J.script.T");$_M(c$,
"compile0",($fz=function(a){this.vFunctionStack=new JU.List;this.htUserFunctions=new java.util.Hashtable;this.script=this.cleanScriptComments(this.script);this.ichToken=this.script.indexOf("# Jmol state version ");if(this.isStateScript=0<=this.ichToken)this.ptSemi=this.script.indexOf(";",this.ichToken),this.ptSemi>=this.ichToken&&this.viewer.setStateScriptVersion(this.script.substring(this.ichToken+21,this.ptSemi).trim());this.cchScript=this.script.length;this.errorLine=this.errorMessageUntranslated=
this.errorMessage=this.errorType=this.flowContext=this.thisFunction=this.aatokenCompiled=this.lineIndices=this.lineNumbers=this.contextVariables=null;this.ichBrace=this.ichComment=this.ichCurrentCommand=this.ichToken=this.nSemiSkip=0;this.lineCurrent=1;this.tokLastMath=this.iCommand=0;this.lastToken=J.script.T.tokenOff;this.vBraces=new JU.List;this.vPush=new JU.List;this.parenCount=this.braceCount=this.iBrace=this.pushCount=0;this.ptSemi=-10;this.cchToken=0;this.lnLength=8;this.lineNumbers=Clazz.newShortArray(this.lnLength,
0);this.lineIndices=Clazz.newIntArray(this.lnLength,2,0);this.isNewSet=this.isSetBrace=!1;this.ptNewSetModifier=1;this.checkImpliedScriptCmd=this.iHaveQuotedString=this.isShowScriptOutput=!1;this.lltoken=new JU.List;this.ltoken=new JU.List;this.tokCommand=0;this.tokenAndEquals=this.lastFlowCommand=null;this.bracketCount=this.setBraceCount=this.tokInitialPlusPlus=0;this.forPoint3=-1;this.setEqualPt=2147483647;this.endOfLine=!1;this.comment=null;this.needRightParen=this.isEndOfCommand=!1;this.theTok=
0;for(var b=1;;this.ichToken+=this.cchToken){if(0==(this.nTokens=this.ltoken.size()))null!=this.thisFunction&&0==this.thisFunction.chpt0&&(this.thisFunction.chpt0=this.ichToken),this.ichCurrentCommand=this.ichToken,b=this.lineCurrent;if(!this.lookingAtLeadingWhitespace()){this.endOfLine=!1;if(!this.isEndOfCommand){this.endOfLine=this.lookingAtEndOfLine();switch(this.endOfLine?0:this.lookingAtComment()){case 2:continue;case 3:this.isEndOfCommand=!0;continue;case 1:this.isEndOfCommand=!0,this.comment=
this.script.substring(this.ichToken,this.ichToken+this.cchToken).trim()}this.isEndOfCommand=this.isEndOfCommand||this.endOfLine||this.lookingAtTerminator()}if(this.isEndOfCommand){this.isEndOfCommand=!1;switch(this.processTokenList(b,a)){case 2:continue;case 4:return!1}this.checkImpliedScriptCmd=!1;if(this.ichToken<this.cchScript)continue;this.setAaTokenCompiled();return null==this.flowContext||this.errorStr(11,J.script.T.nameOf(this.flowContext.token.tok))}if(0<this.nTokens)switch(this.checkSpecialParameterSyntax()){case 2:continue;
case 4:return!1}if(this.lookingAtLookupToken(this.ichToken)){var c=this.getPrefixToken();switch(this.parseKnownToken(c)){case 2:continue;case 4:return!1}switch(this.parseCommandParameter(c)){case 2:continue;case 4:return!1}this.addTokenToPrefix(this.theToken)}else{if(0==this.nTokens||(this.isNewSet||this.isSetBrace)&&this.nTokens==this.ptNewSetModifier){if(0==this.nTokens){if(this.lookingAtString(!0)){this.addTokenToPrefix(this.setCommand(J.script.T.tokenScript));this.cchToken=0;continue}this.lookingAtImpliedString(!0,
!0,!0)&&(this.ichEnd=this.ichToken+this.cchToken)}return this.commandExpected()}return this.errorStr(19,this.script.substring(this.ichToken,this.ichToken+1))}}}},$fz.isPrivate=!0,$fz),"~B");$_M(c$,"setAaTokenCompiled",($fz=function(){this.aatokenCompiled=this.lltoken.toArray(Array(this.lltoken.size()))},$fz.isPrivate=!0,$fz));$_M(c$,"lookingAtLeadingWhitespace",($fz=function(){for(var a=this.ichToken;J.script.ScriptCompiler.isSpaceOrTab(this.charAt(a));)++a;this.isLineContinuation(a,!0)&&(a+=1+this.nCharNewLine(a+
1));this.cchToken=a-this.ichToken;return 0<this.cchToken},$fz.isPrivate=!0,$fz));$_M(c$,"isLineContinuation",($fz=function(a,b){var c=a+2<this.cchScript&&"\\"==this.script.charAt(a)&&0<this.nCharNewLine(a+1)||b&&this.lookingAtMathContinuation(a);c&&this.lineCurrent++;return c},$fz.isPrivate=!0,$fz),"~N,~B");$_M(c$,"lookingAtMathContinuation",($fz=function(a){var b;if(0==(b=this.nCharNewLine(a))||1048586==this.lastToken.tok)return!1;if(0<this.parenCount||0<this.bracketCount)return!0;if((1085443!=this.tokCommand||
!this.isNewSet)&&36865!=this.tokCommand&&36869!=this.tokCommand)return!1;if(this.lastToken.tok==this.tokLastMath)return!0;for(a+=b;J.script.ScriptCompiler.isSpaceOrTab(this.charAt(a));)++a;return this.lookingAtLookupToken(a)&&1==this.tokLastMath},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"lookingAtEndOfLine",($fz=function(){return this.ichToken>=this.cchScript?(this.ichEnd=this.cchScript,!0):0<(this.cchToken=this.nCharNewLine(this.ichEnd=this.ichToken))},$fz.isPrivate=!0,$fz));$_M(c$,"nCharNewLine",($fz=
function(a){var b;return"\r"!=(b=this.charAt(a))?"\n"==b?1:0:"\n"==this.charAt(++a)?2:1},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"lookingAtTerminator",($fz=function(){var a=";"==this.script.charAt(this.ichToken);a&&0<this.nTokens&&(this.ptSemi=this.nTokens);if(!a||0<this.nSemiSkip--)return!1;this.cchToken=1;return!0},$fz.isPrivate=!0,$fz));$_M(c$,"lookingAtComment",($fz=function(){var a=this.script.charAt(this.ichToken),b=this.ichToken,c=-1;if(this.ichToken==this.ichCurrentCommand&&"$"==a&&(this.isShowScriptOutput||
0==this.ichToken)){this.isShowCommand=this.isShowScriptOutput=!0;if("["==this.charAt(++b))for(;"]"!=a&&!this.eol(a=this.charAt(b));)++b;this.cchToken=b-this.ichToken;return 2}this.isShowScriptOutput&&!this.isShowCommand&&(c=b);if("/"==a&&b+1<this.cchScript)switch(this.script.charAt(++b)){case "/":c=this.ichToken;this.ichEnd=b-1;break;case "*":this.ichEnd=b-1;b="*"==(a=this.charAt(++b))?"**/":"*/";b=this.script.indexOf(b,this.ichToken+2);if(0>b)return this.ichToken=this.cchScript,3;this.incrementLineCount(this.script.substring(this.ichToken,
b));this.cchToken=b+("*"==a?3:2)-this.ichToken;return 2;default:return 0}var d=0>c;if(d&&!this.haveComments)return 0;this.ichComment>b&&(b=this.ichComment);for(;b<this.cchScript;b++){if(this.eol(a=this.script.charAt(b))){this.ichEnd=b;if(0<b&&this.isLineContinuation(b-1,!1)){b+=this.nCharNewLine(b);continue}if(!d&&";"==a)continue;break}0<=c||"#"==a&&(c=b)}if(0>c)return 0;this.ichComment=c;if(d&&0==this.nTokens&&3<=this.cchScript-c&&"j"==this.script.charAt(c+1)&&"c"==this.script.charAt(c+2))return this.cchToken=
b-this.ichToken,2;if(c!=this.ichToken)return 0;if(d&&this.cchScript>this.ichToken+3&&"j"==this.script.charAt(this.ichToken+1)&&"x"==this.script.charAt(this.ichToken+2)&&J.script.ScriptCompiler.isSpaceOrTab(this.script.charAt(this.ichToken+3)))return this.cchToken=4,2;if(b==this.ichToken)return 0;this.cchToken=b-this.ichToken;return 0==this.nTokens?1:2},$fz.isPrivate=!0,$fz));$_M(c$,"charAt",($fz=function(a){return a<this.cchScript?this.script.charAt(a):"\x00"},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"processTokenList",
($fz=function(a,b){if(0<this.nTokens||null!=this.comment){if(0==this.nTokens)this.ichCurrentCommand=this.ichToken,null!=this.comment&&(this.isComment=!0,this.addTokenToPrefix(J.script.T.o(0,this.comment)));else if(0<this.setBraceCount&&this.endOfLine&&this.ichToken<this.cchScript)return 2;if(135271429==this.tokCommand&&this.checkImpliedScriptCmd){var c=2==this.nTokens?this.lastToken.value.toString().toUpperCase():null;if(2<this.nTokens&&!(269484048==this.tokAt(2)&&this.ltoken.get(1).value.toString().endsWith(".spt"))||
null!=c&&(c.endsWith(".SORT")||c.endsWith(".REVERSE")||0<=c.indexOf(".SORT(")||0<=c.indexOf(".REVERSE(")))return this.ichToken=this.ichCurrentCommand,this.nTokens=0,this.ltoken.clear(),this.tokCommand=this.cchToken=0,2}this.isNewSet&&2<this.nTokens&&1048584==this.tokAt(2)&&(1276117010==this.tokAt(3)||1141899269==this.tokAt(3))?(this.ltoken.set(0,J.script.T.tokenSet),this.ltoken.add(1,this.ltoken.get(1))):0!=this.tokInitialPlusPlus&&(this.isNewSet||this.checkNewSetCommand(),this.tokenizePlusPlus(this.tokInitialPlusPlus,
!0));this.iCommand=this.lltoken.size();null!=this.thisFunction&&0>this.thisFunction.cmdpt0&&(this.thisFunction.cmdpt0=this.iCommand);1==this.nTokens&&1==this.braceCount&&(null==this.lastFlowCommand?(this.parenCount=this.setBraceCount=this.braceCount=0,this.ltoken.remove(0),this.iBrace++,c=J.script.ContextToken.newContext(!0),this.addTokenToPrefix(this.setCommand(c)),this.pushCount++,this.vPush.addLast(c),this.vBraces.addLast(this.tokenCommand)):(this.parenCount=this.setBraceCount=0,this.setCommand(this.lastFlowCommand),
102439!=this.lastFlowCommand.tok&&1048586==this.tokAt(0)&&this.ltoken.remove(0),this.lastFlowCommand=null));if(0<this.bracketCount||0<this.setBraceCount||0<this.parenCount||1==this.braceCount&&!this.checkFlowStartBrace(!0))return this.error(1==this.nTokens?2:4),4;this.needRightParen&&(this.addTokenToPrefix(J.script.T.tokenRightParen),this.needRightParen=!1);if(0<this.ltoken.size()){if(b&&!this.compileCommand())return 4;this.logMessages&&J.util.Logger.debug("-------------------------------------");
c=!0;switch(this.tokCommand){case 364558:case 102436:case 135368713:case 1150985:c=0<this.atokenInfix.length&&2147483647!=this.atokenInfix[0].intValue}c&&(this.iCommand==this.lnLength&&(this.lineNumbers=JU.ArrayUtil.doubleLengthShort(this.lineNumbers),c=Clazz.newIntArray(2*this.lnLength,2,0),System.arraycopy(this.lineIndices,0,c,0,this.lnLength),this.lineIndices=c,this.lnLength*=2),this.lineNumbers[this.iCommand]=a,this.lineIndices[this.iCommand][0]=this.ichCurrentCommand,this.lineIndices[this.iCommand][1]=
Math.max(this.ichCurrentCommand,Math.min(this.cchScript,this.ichEnd==this.ichCurrentCommand?this.ichToken:this.ichEnd)),this.lltoken.addLast(this.atokenInfix),this.iCommand=this.lltoken.size());1085443==this.tokCommand&&(this.lastFlowCommand=null)}this.setCommand(null);this.comment=null;this.iHaveQuotedString=this.isNewSet=this.isSetBrace=this.needRightParen=!1;this.ptNewSetModifier=1;this.ltoken.clear();this.tokInitialPlusPlus=this.nTokens=this.nSemiSkip=0;this.tokenAndEquals=null;this.ptSemi=-10;
this.forPoint3=-1;this.setEqualPt=2147483647}if(this.endOfLine){if(null!=this.flowContext&&this.flowContext.checkForceEndIf())return this.isComment||this.forceFlowEnd(this.flowContext.token),this.isEndOfCommand=!0,this.cchToken=0,this.ichCurrentCommand=this.ichToken,this.lineCurrent--,2;this.isShowCommand=this.isComment=!1;++this.lineCurrent}if(this.ichToken>=this.cchScript){this.setCommand(J.script.T.tokenAll);this.theTok=0;switch(this.checkFlowEndBrace()){case 4:return 4;case 2:return this.isEndOfCommand=
!0,this.cchToken=0,2}this.ichToken=this.cchScript}return 0},$fz.isPrivate=!0,$fz),"~N,~B");$_M(c$,"compileCommand",($fz=function(){switch(this.ltoken.size()){case 0:return this.atokenInfix=[],!0;case 4:if(this.isNewSet&&this.tokenAt(2).value.equals(".")&&this.tokenAt(3).value.equals("spt")){var a=this.tokenAt(1).value+"."+this.tokenAt(3).value;this.ltoken.clear();this.addTokenToPrefix(J.script.T.tokenScript);this.addTokenToPrefix(J.script.T.o(4,a));this.isNewSet=!1}}this.setCommand(this.tokenAt(0));
a=this.ltoken.size();1==a&&J.script.T.tokAttr(this.tokCommand,524288)&&this.addTokenToPrefix(J.script.T.tokenOn);if(null!=this.tokenAndEquals){for(var b,c=0,c=1;c<a&&269484242!=this.tokAt(c);c++);a=c;c++;if(this.ltoken.size()<c)J.util.Logger.error("COMPILER ERROR! - andEquals ");else{for(b=1;b<a;b++,c++)this.ltoken.add(c,this.tokenAt(b));this.ltoken.set(a,J.script.T.tokenEquals);this.ltoken.add(c,this.tokenAndEquals);this.ltoken.add(++c,J.script.T.tokenLeftParen);this.addTokenToPrefix(J.script.T.tokenRightParen)}}this.atokenInfix=
this.ltoken.toArray(Array(this.ltoken.size()));if(this.logMessages){J.util.Logger.debug("token list:");for(c=0;c<this.atokenInfix.length;c++)J.util.Logger.debug(c+": "+this.atokenInfix[c]);J.util.Logger.debug("vBraces list:");for(c=0;c<this.vBraces.size();c++)J.util.Logger.debug(c+": "+this.vBraces.get(c));J.util.Logger.debug("-------------------------------------")}return this.compileExpressions()},$fz.isPrivate=!0,$fz));$_M(c$,"tokenAt",($fz=function(a){return this.ltoken.get(a)},$fz.isPrivate=
!0,$fz),"~N");Clazz.overrideMethod(c$,"tokAt",function(a){return a<this.ltoken.size()?this.tokenAt(a).tok:0},"~N");$_M(c$,"setCommand",($fz=function(a){this.tokenCommand=a;null==a?this.tokCommand=0:(this.tokCommand=this.tokenCommand.tok,this.isMathExpressionCommand=1073741824==this.tokCommand||J.script.T.tokAttr(this.tokCommand,36864),this.isSetOrDefine=1085443==this.tokCommand||1060866==this.tokCommand,this.isCommaAsOrAllowed=J.script.T.tokAttr(this.tokCommand,12288),this.implicitString=J.script.T.tokAttr(this.tokCommand,
20480));return a},$fz.isPrivate=!0,$fz),"J.script.T");$_M(c$,"replaceCommand",($fz=function(a){this.ltoken.remove(0);this.ltoken.add(0,this.setCommand(a))},$fz.isPrivate=!0,$fz),"J.script.T");$_M(c$,"getPrefixToken",($fz=function(){var a=this.script.substring(this.ichToken,this.ichToken+this.cchToken),b=a.toLowerCase(),c=this.isContextVariable(b);0==this.nTokens&&(this.isUserToken=c);if(1==this.nTokens&&(135368713==this.tokCommand||102436==this.tokCommand||36868==this.tokCommand)||0!=this.nTokens&&
c||this.isUserFunction(b)&&(null==this.thisFunction||!this.thisFunction.name.equals(b)))a=b,this.theToken=null;else if(1==a.length||269484066==this.lastToken.tok){if(null==(this.theToken=J.script.T.getTokenFromName(a))&&null!=(this.theToken=J.script.T.getTokenFromName(b)))this.theToken=J.script.T.tv(this.theToken.tok,this.theToken.intValue,a)}else a=b,this.theToken=J.script.T.getTokenFromName(a);null==this.theToken&&(this.theToken=0==a.indexOf("property_")?J.script.T.o(1716520985,a):J.script.T.o(1073741824,
a));this.theTok=this.theToken.tok;return a},$fz.isPrivate=!0,$fz));$_M(c$,"checkSpecialParameterSyntax",($fz=function(){if(this.lookingAtString(!this.implicitString)){if(0>this.cchToken)return this.ERROR(4);var a=this.getUnescapedStringLiteral(null!=this.lastToken&&!this.iHaveQuotedString&&1073741983!=this.lastToken.tok&&(1085443==this.tokCommand&&2==this.nTokens&&545259546==this.lastToken.tok||135271426==this.tokCommand||1610616835==this.tokCommand||135271429==this.tokCommand));this.iHaveQuotedString=
!0;if(135271426==this.tokCommand&&135270407==this.lastToken.tok||135270407==this.tokCommand&&0>a.indexOf("@")){if(!this.getData(a))return this.ERROR(11,"data")}else this.addTokenToPrefix(J.script.T.o(4,a)),this.implicitString&&(this.isEndOfCommand=!0);return 2}if(1074790550==this.lastToken.tok&&this.lookingAtImpliedString(!1,!1,!1))return this.addTokenToPrefix(J.script.T.o(4,this.script.substring(this.ichToken,this.ichToken+this.cchToken))),2;if(this.nTokens==this.ptNewSetModifier){var a=this.script.charAt(this.ichToken),
b=0<="+-\\*/&|=".indexOf(a),c=b||"."==a||"["==a,d=this.charAt(this.ichToken+1);if(!this.isNewSet&&this.isUserToken&&c&&("="==a||d==a||"="==d))this.isNewSet=!0;if(this.isNewSet||1085443==this.tokCommand||J.script.T.tokAttr(this.tokCommand,536870912))if("="==a&&(this.setEqualPt=this.ichToken),J.script.T.tokAttr(this.tokCommand,536870912)&&"="==a||(this.isNewSet||this.isSetBrace)&&c)switch(this.setCommand(b?J.script.T.tokenSet:"["==a&&!this.isSetBrace?J.script.T.tokenSetArray:J.script.T.tokenSetProperty),
this.ltoken.add(0,this.tokenCommand),this.cchToken=1,a){case "[":return this.addTokenToPrefix(J.script.T.o(269484096,"[")),this.bracketCount++,2;case ".":return this.addTokenToPrefix(J.script.T.o(1048584,".")),2;case "-":case "+":case "*":case "/":case "\\":case "&":case "|":if(0==d.charCodeAt(0))return this.ERROR(4);if(d!=a&&"="!=d)return this.ERROR(1,'"'+a+'"');break;default:return this.lastToken=J.script.T.tokenMinus,2}}switch(this.tokCommand){case 135271426:case 135271429:case 135270410:if("@"==
this.script.charAt(this.ichToken))return this.iHaveQuotedString=!0,0;if(135271426==this.tokCommand){if((1==this.nTokens||2==this.nTokens&&1073741839==this.tokAt(1))&&this.lookingAtLoadFormat()){var e=this.script.substring(this.ichToken,this.ichToken+this.cchToken),f=J.script.T.getTokenFromName(e.toLowerCase());switch(null==f?0:f.tok){case 1073742015:case 1073741839:if(1!=this.nTokens)return 4;case 135270407:case 1229984263:case 1073741983:case 1095766028:case 135267336:case 536870926:case 4156:this.addTokenToPrefix(f);
break;default:f=0==e.indexOf("=")||0==e.indexOf("$")?4:J.util.Parser.isOneOf(e=e.toLowerCase(),";xyz;vxyz;vibration;temperature;occupancy;partialcharge;")?1073741824:0,0!=f&&(this.addTokenToPrefix(J.script.T.o(f,e)),this.iHaveQuotedString=4==f)}return 2}if("{"==this.script.charAt(this.ichToken)||0<this.parenCount)break;if(null!=(a=this.lookingAtBitset()))return this.addTokenToPrefix(J.script.T.o(10,a)),2}if(!this.iHaveQuotedString&&this.lookingAtImpliedString(!1,135271426==this.tokCommand,1<this.nTokens||
135271429!=this.tokCommand))return a=this.script.substring(this.ichToken,this.ichToken+this.cchToken),135271429==this.tokCommand&&a.startsWith("javascript:")&&(this.lookingAtImpliedString(!0,!0,!0),a=this.script.substring(this.ichToken,this.ichToken+this.cchToken)),this.iHaveQuotedString=!0,this.addTokenToPrefix(J.script.T.o(4,a)),2;break;case 4156:if(1==this.nTokens&&this.lookForSyncID())return e=this.script.substring(this.ichToken,this.ichToken+this.cchToken),f=JU.ParserJS.parseInt(e),-2147483648==
f||1E3>Math.abs(f)?this.addTokenToPrefix(J.script.T.o(1073741824,e)):this.addTokenToPrefix(J.script.T.i(f)),2;break;case 135270421:if(2==this.nTokens&&4115==this.lastToken.tok&&(this.iHaveQuotedString=!0),!this.iHaveQuotedString){if("@"==this.script.charAt(this.ichToken))return this.iHaveQuotedString=!0,0;if(this.lookingAtImpliedString(!0,!0,!0)){b=this.cchToken;a=this.script.substring(this.ichToken,this.ichToken+this.cchToken);if(0>a.indexOf(" "))return this.addTokenToPrefix(J.script.T.o(4,a)),this.iHaveQuotedString=
!0,2;this.cchToken=b}}}if(this.implicitString&&!(135271429==this.tokCommand&&this.iHaveQuotedString)&&this.lookingAtImpliedString(!0,!0,!0))return a=this.script.substring(this.ichToken,this.ichToken+this.cchToken),1826248715==this.tokCommand&&J.util.Parser.isOneOf(a.toLowerCase(),"on;off;hide;display")?this.addTokenToPrefix(J.script.T.getTokenFromName(a.toLowerCase())):this.addTokenToPrefix(J.script.T.o(4,a)),2;if(this.lookingAtObjectID())return this.addTokenToPrefix(J.script.T.getTokenFromName("$")),
this.addTokenToPrefix(J.script.T.o(1073741824,this.script.substring(this.ichToken,this.ichToken+this.cchToken))),2;if(!Float.isNaN(a=this.lookingAtExponential()))return this.addTokenToPrefix(J.script.T.o(3,Float.$valueOf(a))),2;if(this.lookingAtDecimal())return a=JU.ParserJS.fVal(this.script.substring(this.ichToken,this.ichToken+this.cchToken)),e=J.script.ScriptEvaluator.getFloatEncodedInt(this.script.substring(this.ichToken,this.ichToken+this.cchToken)),this.addTokenToPrefix(J.script.T.tv(3,e,Float.$valueOf(a))),
2;if(this.lookingAtSeqcode()){a=this.script.charAt(this.ichToken);try{e="*"==a||"^"==a?2147483647:Integer.parseInt(this.script.substring(this.ichToken,this.ichToken+this.cchToken-2));f=this.script.charAt(this.ichToken+this.cchToken-1);"^"==f&&(f=" ");0>e&&(e=-e,this.addTokenToPrefix(J.script.T.tokenMinus));var g=J.modelset.Group.getSeqcodeFor(e,f);this.addTokenToPrefix(J.script.T.tv(5,g,"seqcode"))}catch(h){if(Clazz.exceptionOf(h,NumberFormatException))return this.ERROR(9,""+a);throw h;}return 2}e=
this.lookingAtInteger();if(2147483647!=e){f=this.script.substring(this.ichToken,this.ichToken+this.cchToken);if(102407==this.tokCommand||102408==this.tokCommand){if(1!=this.nTokens)return this.ERROR(0);g=null==this.flowContext?null:this.flowContext.getBreakableContext(e=Math.abs(e));if(null==g)return this.ERROR(1,this.tokenCommand.value);this.tokenAt(0).intValue=g.pt0}0==e&&f.equals("-0")&&this.addTokenToPrefix(J.script.T.tokenMinus);this.addTokenToPrefix(J.script.T.tv(2,e,f));return 2}if(!this.isMathExpressionCommand&&
0==this.parenCount||1073741824!=this.lastToken.tok&&!J.script.ScriptCompilationTokenParser.tokenAttr(this.lastToken,135266304)){e="["==this.script.charAt(this.ichToken);a=this.lookingAtBitset();if(null!=a)return this.addTokenToPrefix(J.script.T.o(10,e?new J.modelset.Bond.BondSet(a):a)),2;if(e&&(e=this.lookingAtMatrix(),Clazz.instanceOf(e,JU.M3)||Clazz.instanceOf(e,JU.M4)))return this.addTokenToPrefix(J.script.T.o(Clazz.instanceOf(e,JU.M3)?11:12,e)),2}return 0},$fz.isPrivate=!0,$fz));$_M(c$,"lookingAtMatrix",
($fz=function(){var a,b;if(this.ichToken+4>=this.cchScript||"["!=this.script.charAt(this.ichToken)||"["!=this.script.charAt(this.ichToken+1)||0>(a=this.script.indexOf("]]",this.ichToken))||null==(b=J.util.Escape.unescapeMatrix(this.script.substring(this.ichToken,a+2))))return null;this.cchToken=a+2-this.ichToken;return b},$fz.isPrivate=!0,$fz));$_M(c$,"parseKnownToken",($fz=function(a){var b;0!=this.tokLastMath&&(this.tokLastMath=this.theTok);if(null!=this.flowContext&&102410==this.flowContext.token.tok&&
null!=this.flowContext.$var&&102411!=this.theTok&&102413!=this.theTok&&102410!=this.lastToken.tok)return this.ERROR(1,a);if(1060866==this.lastToken.tok&&1048586!=this.theTok&&1!=this.nTokens)return this.addTokenToPrefix(J.script.T.o(4,a)),2;switch(this.theTok){case 1073741824:if(0==this.nTokens&&!this.checkImpliedScriptCmd){if("'"==a.charAt(0))return this.addTokenToPrefix(this.setCommand(J.script.T.tokenScript)),this.cchToken=0,2;if("."==this.charAt(this.ichToken+this.cchToken))return this.addTokenToPrefix(this.setCommand(J.script.T.tokenScript)),
this.nTokens=1,this.cchToken=0,this.checkImpliedScriptCmd=!0,2}break;case 269484242:if(this.nSemiSkip==this.forPoint3&&this.nTokens==this.ptSemi+2)return b=this.lastToken,this.addTokenToPrefix(J.script.T.tokenEquals),this.addTokenToPrefix(b),b=J.script.T.getTokenFromName(a.substring(0,1)),this.addTokenToPrefix(b),this.addTokenToPrefix(J.script.T.tokenLeftParen),this.needRightParen=!0,2;this.checkNewSetCommand();if(1085443==this.tokCommand){this.tokenAndEquals=J.script.T.getTokenFromName(a.substring(0,
1));this.setEqualPt=this.ichToken;break}if(554176565==this.tokCommand||554176526==this.tokCommand){this.addTokenToPrefix(this.tokenCommand);this.replaceCommand(J.script.T.tokenSet);this.tokenAndEquals=J.script.T.getTokenFromName(a.substring(0,1));this.setEqualPt=this.ichToken;break}return 2;case 1150985:case 364548:null!=this.flowContext&&(this.flowContext.forceEndIf=!1);case 364547:if(0<this.nTokens)return this.isEndOfCommand=!0,this.cchToken=0,2;break;case 135369224:if(0<this.bracketCount)break;
case 102411:case 102413:case 102402:case 135369225:case 102410:case 102406:case 102412:if(1<this.nTokens&&1085443!=this.tokCommand)return this.isEndOfCommand=!0,null!=this.flowContext&&(this.flowContext.forceEndIf=!0),this.cchToken=0,2;break;case 269484225:case 269484226:!this.isNewSet&&1==this.nTokens&&this.checkNewSetCommand();if(this.isNewSet&&0==this.parenCount&&0==this.bracketCount&&this.ichToken<=this.setEqualPt)return this.tokenizePlusPlus(this.theTok,!1),2;if(this.nSemiSkip==this.forPoint3&&
this.nTokens==this.ptSemi+2)return b=this.lastToken,this.addTokenToPrefix(J.script.T.tokenEquals),this.addTokenToPrefix(b),this.addTokenToPrefix(269484225==this.theTok?J.script.T.tokenMinus:J.script.T.tokenPlus),this.addTokenToPrefix(J.script.T.i(1)),2;break;case 269484436:0==this.parenCount&&0==this.bracketCount&&(this.setEqualPt=this.ichToken);break;case 1048584:1085443==this.tokCommand&&(0==this.parenCount&&0==this.bracketCount&&this.ichToken<this.setEqualPt)&&(this.ltoken.add(1,J.script.T.tokenExpressionBegin),
this.addTokenToPrefix(J.script.T.tokenExpressionEnd),this.ltoken.set(0,J.script.T.tokenSetProperty),this.setEqualPt=0);break;case 1048586:if(this.braceCount++,1==this.braceCount&&0==this.parenCount&&this.checkFlowStartBrace(!1))return this.isEndOfCommand=!0,null!=this.flowContext&&(this.flowContext.forceEndIf=!1),2;case 269484048:this.parenCount++;if(1<this.nTokens&&(135280132==this.lastToken.tok||135369224==this.lastToken.tok||135369225==this.lastToken.tok))this.nSemiSkip+=2;break;case 1048590:if(0<
this.iBrace&&0==this.parenCount&&0==this.braceCount)if(this.ichBrace=this.ichToken,0==this.nTokens)this.braceCount=this.parenCount=1;else return this.braceCount=this.parenCount=this.nSemiSkip=0,102411!=this.theToken.tok&&102413!=this.theToken.tok&&this.vBraces.addLast(this.theToken),this.iBrace++,this.isEndOfCommand=!0,this.ichEnd=this.ichToken,2;this.braceCount--;case 269484049:this.parenCount--;if(0>this.parenCount)return this.ERROR(16,a);0==this.parenCount&&(this.nSemiSkip=0);this.needRightParen&&
(this.addTokenToPrefix(J.script.T.tokenRightParen),this.needRightParen=!1);break;case 269484096:0<this.ichToken&&Character.isWhitespace(this.script.charAt(this.ichToken-1))&&this.addTokenToPrefix(J.script.T.tokenSpaceBeforeSquare);this.bracketCount++;break;case 269484097:if(this.bracketCount--,0>this.bracketCount)return this.ERROR(16,"]")}return 0},$fz.isPrivate=!0,$fz),"~S");$_M(c$,"tokenizePlusPlus",($fz=function(a,b){b&&(this.setCommand(J.script.T.tokenSet),this.ltoken.add(0,this.tokenCommand));
this.nTokens=this.ltoken.size();this.addTokenToPrefix(J.script.T.tokenEquals);this.setEqualPt=0;for(var c=1;c<this.nTokens;c++)this.addTokenToPrefix(this.ltoken.get(c));this.addTokenToPrefix(269484225==a?J.script.T.tokenMinus:J.script.T.tokenPlus);this.addTokenToPrefix(J.script.T.i(1))},$fz.isPrivate=!0,$fz),"~N,~B");$_M(c$,"checkNewSetCommand",($fz=function(){var a=this.ltoken.get(0).value.toString();if(!this.isContextVariable(a.toLowerCase()))return!1;a=this.setNewSetCommand(!1,a);this.setCommand(J.script.T.tokenSet);
this.ltoken.add(0,this.tokenCommand);this.ltoken.set(1,a);return!0},$fz.isPrivate=!0,$fz));$_M(c$,"parseCommandParameter",($fz=function(a){this.nTokens=this.ltoken.size();switch(this.tokCommand){case 0:this.lastToken=J.script.T.tokenOff;this.ichCurrentCommand=this.ichEnd=this.ichToken;this.setCommand(this.theToken);J.script.T.tokAttr(this.tokCommand,102400)&&(this.lastFlowCommand=this.tokenCommand);var b=this.checkFlowEndBrace();if(4==b)return 4;if(2==b)return this.isEndOfCommand=!0,this.cchToken=
0,2;if(J.script.T.tokAttr(this.tokCommand,102400)){if(!this.checkFlowCommand(this.tokenCommand.value))return 4;this.theToken=this.tokenCommand;102411==this.theTok&&(this.addTokenToPrefix(this.tokenCommand),this.theToken=J.script.T.tokenLeftParen);break}if(269484066==this.theTok){this.braceCount++;this.isEndOfCommand=!0;break}if(1048590==this.theTok)return this.vBraces.addLast(this.tokenCommand),this.iBrace++,this.tokCommand=0,2;1048586!=this.theTok&&(this.lastFlowCommand=null);if(J.script.T.tokAttr(this.tokCommand,
4096))break;if(this.isSetBrace=1048586==this.theTok)this.lookingAtSetBraceSyntax()||(this.isEndOfCommand=!0,null!=this.flowContext&&(this.flowContext.forceEndIf=!1));else switch(this.theTok){case 269484226:case 269484225:return this.tokInitialPlusPlus=this.theTok,this.tokCommand=0,2;case 1073741824:case 36868:case 1060866:case 269484048:break;default:if(!J.script.T.tokAttr(this.theTok,1073741824)&&!J.script.T.tokAttr(this.theTok,536870912)&&!this.isContextVariable(a))return this.commandExpected(),
4}this.theToken=this.setNewSetCommand(this.isSetBrace,a);break;case 102412:switch(this.nTokens){case 1:if(269484048!=this.theTok)return this.ERROR(15,"(");break;case 2:269484049!=this.theTok&&(this.tokenCommand.name0=a);this.addContextVariable(a);break;case 3:if(269484049!=this.theTok)return this.ERROR(15,")");this.isEndOfCommand=!0;this.ichEnd=this.ichToken+1;this.flowContext.setLine();break;default:return this.ERROR(0)}break;case 102436:case 135368713:if(0==this.tokenCommand.intValue){if(1!=this.nTokens)break;
this.tokenCommand.value=a;return 2}if(1==this.nTokens){null!=this.thisFunction&&this.vFunctionStack.add(0,this.thisFunction);this.thisFunction=102436==this.tokCommand?J.script.ScriptCompiler.newScriptParallelProcessor(a,this.tokCommand):new J.script.ScriptFunction(a,this.tokCommand);this.htUserFunctions.put(a,Boolean.TRUE);this.flowContext.setFunction(this.thisFunction);break}if(2==this.nTokens){if(269484048!=this.theTok)return this.ERROR(15,"(");break}if(3==this.nTokens&&269484049==this.theTok)break;
if(0==this.nTokens%2){if(269484080!=this.theTok&&269484049!=this.theTok)return this.ERROR(15,")");break}this.thisFunction.addVariable(a,!0);break;case 102411:if(1<this.nTokens&&0==this.parenCount&&0==this.braceCount&&269484066==this.theTok)return this.addTokenToPrefix(J.script.T.tokenRightParen),this.braceCount=1,this.isEndOfCommand=!0,this.cchToken=0,2;break;case 102413:if(1<this.nTokens)return this.braceCount=1,this.isEndOfCommand=!0,this.cchToken=0,2;break;case 364547:if(1==this.nTokens&&135369225!=
this.theTok)return this.isEndOfCommand=!0,this.cchToken=0,2;if(1!=this.nTokens||135369225!=this.theTok&&1048586!=this.theTok)return this.ERROR(0);this.replaceCommand(this.flowContext.token=J.script.ContextToken.newCmd(102402,"elseif"));this.tokCommand=102402;return 2;case 36868:if(1!=this.nTokens)break;this.addContextVariable(a);this.replaceCommand(J.script.T.tokenSetVar);this.tokCommand=1085443;break;case 1150985:if(1!=this.nTokens)return this.ERROR(0);if(!this.checkFlowEnd(this.theTok,a,this.ichCurrentCommand))return 4;
if(135368713==this.theTok||102436==this.theTok)return 2;break;case 102410:case 102406:2<this.nTokens&&(0==this.braceCount&&0==this.parenCount)&&(this.isEndOfCommand=!0,this.ichEnd=this.ichToken+1,this.flowContext.setLine());break;case 102402:case 135369225:2<this.nTokens&&(0==this.braceCount&&0==this.parenCount)&&(this.isEndOfCommand=!0,this.ichEnd=this.ichToken+1,this.flowContext.setLine());break;case 102439:this.isEndOfCommand=!0;this.ichEnd=this.ichToken+1;this.flowContext.setLine();break;case 135369224:if(1==
this.nTokens){if(269484048!=this.theTok)return this.ERROR(19,a);this.forPoint3=this.nSemiSkip=0;this.nSemiSkip+=2}else 3==this.nTokens&&36868==this.tokAt(2)?this.addContextVariable(a):(3==this.nTokens||4==this.nTokens)&&1073741980==this.theTok?(this.nSemiSkip-=2,this.forPoint3=2,this.addTokenToPrefix(this.theToken),this.theToken=J.script.T.tokenLeftParen):0==this.braceCount&&0==this.parenCount&&(this.isEndOfCommand=!0,this.ichEnd=this.ichToken+1,this.flowContext.setLine());break;case 1085443:1048586==
this.theTok?this.setBraceCount++:1048590==this.theTok&&(this.setBraceCount--,this.isSetBrace&&(0==this.setBraceCount&&2147483647==this.ptNewSetModifier)&&(this.ptNewSetModifier=this.nTokens+1));if(this.nTokens==this.ptNewSetModifier){b=this.tokenAt(0);if(269484048==this.theTok||this.isUserFunction(b.value.toString())){this.ltoken.set(0,this.setCommand(J.script.T.tv(1073741824,0,b.value)));this.setBraceCount=0;break}if(1073741824!=this.theTok&&269484242!=this.theTok&&1060866!=this.theTok&&!J.script.T.tokAttr(this.theTok,
536870912))return this.isNewSet?this.commandExpected():this.errorIntStr2(18,"SET",": "+a),4;if(1==this.nTokens&&(269484226==this.lastToken.tok||269484225==this.lastToken.tok)){this.replaceCommand(J.script.T.tokenSet);this.addTokenToPrefix(this.lastToken);break}}break;case 135271426:if(1060866==this.theTok&&(1==this.nTokens||1073741940==this.lastToken.tok||1073742152==this.lastToken.tok))return this.addTokenToPrefix(J.script.T.tokenDefineString),2;1073741848==this.theTok&&(this.iHaveQuotedString=!1);
break;case 1610625028:case 12294:case 12295:case 135280132:case 12291:case 1060866:if(1060866==this.tokCommand){if(1==this.nTokens){if(1073741824!=this.theTok)if(this.preDefining){if(!J.script.T.tokAttr(this.theTok,3145728))return this.errorStr2("ERROR IN Token.java or JmolConstants.java -- the following term was used in JmolConstants.java but not listed as predefinedset in Token.java: "+a,null),4}else J.script.T.tokAttr(this.theTok,3145728)?J.util.Logger.warn("WARNING: predefined term '"+a+"' has been redefined by the user until the next file load."):
!this.isCheckOnly&&1<a.length&&(J.util.Logger.warn("WARNING: redefining "+a+"; was "+this.theToken+"not all commands may continue to be functional for the life of the applet!"),this.theTok=this.theToken.tok=1073741824,J.script.T.addToken(a,this.theToken));this.addTokenToPrefix(this.theToken);this.lastToken=J.script.T.tokenComma;return 2}if(2==this.nTokens&&269484436==this.theTok)return this.ltoken.add(0,J.script.T.tokenSet),2}if(0==this.bracketCount&&1073741824!=this.theTok&&!J.script.T.tokAttr(this.theTok,
1048576)&&!J.script.T.tokAttr(this.theTok,1073741824)&&(this.theTok&480)!=this.theTok)return this.ERROR(9,a);break;case 12289:if(1073741824!=this.theTok&&1048583!=this.theTok&&!J.script.T.tokAttr(this.theTok,1048576))return this.ERROR(9,a);break;case 135190:case 135188:case 135180:b=this.charAt(this.ichToken+this.cchToken);0==this.parenCount&&(0==this.bracketCount&&0<=".:/\\+-!?".indexOf(b)&&!("-"==b&&a.equals("=")))&&this.checkUnquotedFileName();break;case 4148:2==this.nTokens&&(1073742158==this.tokAt(1)&&
269484208==this.theTok)&&(this.implicitString=!0)}return 0},$fz.isPrivate=!0,$fz),"~S");c$.newScriptParallelProcessor=$_M(c$,"newScriptParallelProcessor",($fz=function(a,b){var c=J.api.Interface.getOptionInterface("parallel.ScriptParallelProcessor");c.set(a,b);return c},$fz.isPrivate=!0,$fz),"~S,~N");$_M(c$,"setNewSetCommand",($fz=function(a,b){this.tokCommand=1085443;this.isNewSet=!a&&!this.isUserFunction(b);this.setBraceCount=a?1:0;this.bracketCount=0;this.setEqualPt=2147483647;this.ptNewSetModifier=
this.isNewSet?b.equals("(")?2:1:2147483647;return a||269484226==this.theToken.tok||269484225==this.theToken.tok?this.theToken:J.script.T.o(1073741824,b)},$fz.isPrivate=!0,$fz),"~B,~S");$_M(c$,"checkUnquotedFileName",($fz=function(){for(var a=this.ichToken,b;++a<this.cchScript&&!Character.isWhitespace(b=this.script.charAt(a))&&"#"!=b&&";"!=b&&"}"!=b;);b=this.script.substring(this.ichToken,a).$replace("\\","/");this.cchToken=a-this.ichToken;this.theToken=J.script.T.o(4,b)},$fz.isPrivate=!0,$fz));$_M(c$,
"checkFlowStartBrace",($fz=function(a){if(!J.script.T.tokAttr(this.tokCommand,102400)||102407==this.tokCommand||102408==this.tokCommand)return!1;a&&(102411!=this.tokenCommand.tok&&102413!=this.tokenCommand.tok&&(this.iBrace++,this.vBraces.addLast(this.tokenCommand),this.lastFlowCommand=null),this.parenCount=this.braceCount=0);return!0},$fz.isPrivate=!0,$fz),"~B");$_M(c$,"checkFlowEndBrace",($fz=function(){if(0>=this.iBrace||1048590!=this.vBraces.get(this.iBrace-1).tok)return 0;this.vBraces.remove(--this.iBrace);
var a=this.vBraces.remove(--this.iBrace);1048586==this.theTok&&(this.braceCount--,this.parenCount--);if(266280==a.tok)return this.vPush.remove(--this.pushCount),this.addTokenToPrefix(this.setCommand(J.script.ContextToken.newContext(!0))),this.isEndOfCommand=!0,2;switch(null==this.flowContext?0:this.flowContext.token.tok){case 135369225:case 102402:case 364547:if(364547==this.tokCommand||102402==this.tokCommand)return 0;break;case 102410:case 102411:case 102413:if(102411==this.tokCommand||102413==
this.tokCommand)return 0}return this.forceFlowEnd(a)},$fz.isPrivate=!0,$fz));$_M(c$,"forceFlowEnd",($fz=function(a){var b=this.tokenCommand;this.setCommand(J.script.T.o(1150985,"end"));if(!this.checkFlowCommand("end"))return 0;this.addTokenToPrefix(this.tokenCommand);switch(a.tok){case 135369225:case 364547:case 102402:a=J.script.T.tokenIf;break;case 102413:case 102411:a=J.script.T.tokenSwitch;break;default:a=J.script.T.getTokenFromName(a.value)}if(!this.checkFlowEnd(a.tok,a.value,this.ichBrace))return 4;
135368713!=a.tok&&(102436!=a.tok&&364558!=a.tok)&&this.addTokenToPrefix(a);this.setCommand(b);return 2},$fz.isPrivate=!0,$fz),"J.script.T");c$.isBreakableContext=$_M(c$,"isBreakableContext",function(a){return 135369224==a||102439==a||102406==a||102411==a||102413==a},"~N");$_M(c$,"checkFlowCommand",($fz=function(a){var b=this.lltoken.size(),c=!1,d=!0;switch(this.tokCommand){case 135368713:case 102436:if(null!=this.flowContext)return this.errorStr(1,J.script.T.nameOf(this.tokCommand));break;case 1150985:if(null==
this.flowContext)return this.errorStr(1,a);c=!0;135368713!=this.flowContext.token.tok&&(102436!=this.flowContext.token.tok&&364558!=this.flowContext.token.tok)&&this.setCommand(J.script.T.tv(this.tokCommand,0<this.flowContext.ptDefault?this.flowContext.ptDefault:-this.flowContext.pt0,a));break;case 364548:c=!0;if(null==this.flowContext||135369225!=this.flowContext.token.tok&&102439!=this.flowContext.token.tok&&364547!=this.flowContext.token.tok&&102402!=this.flowContext.token.tok)return this.errorStr(1,
a);break;case 364547:if(null==this.flowContext||135369225!=this.flowContext.token.tok&&102402!=this.flowContext.token.tok)return this.errorStr(1,a);this.flowContext.token.intValue=this.flowContext.setPt0(b,!1);break;case 102407:case 102408:var d=!1,e=null==this.flowContext?null:this.flowContext.getBreakableContext(0);if(102408==this.tokCommand)for(;null!=e&&135369224!=e.token.tok&&102406!=e.token.tok;)e=e.getParent();if(null==e)return this.errorStr(1,a);this.setCommand(J.script.T.tv(this.tokCommand,
e.pt0,a));break;case 102413:if(null==this.flowContext||102410!=this.flowContext.token.tok&&102411!=this.flowContext.token.tok&&0<this.flowContext.ptDefault)return this.errorStr(1,a);this.flowContext.token.intValue=this.flowContext.setPt0(b,!0);break;case 102411:if(null==this.flowContext||102410!=this.flowContext.token.tok&&102411!=this.flowContext.token.tok&&102413!=this.flowContext.token.tok)return this.errorStr(1,a);this.flowContext.token.intValue=this.flowContext.setPt0(b,!1);break;case 102402:if(null==
this.flowContext||135369225!=this.flowContext.token.tok&&102402!=this.flowContext.token.tok&&364547!=this.flowContext.token.tok)return this.errorStr(1,"elseif");this.flowContext.token.intValue=this.flowContext.setPt0(b,!1)}if(c)this.flowContext.token.intValue=102412==this.tokCommand?-b:b,364548==this.tokCommand&&(this.flowContext=this.flowContext.getParent());else if(d)switch(a=J.script.ContextToken.newCmd(this.tokCommand,this.tokenCommand.value),102410==this.tokCommand&&a.addName("_var"),this.setCommand(a),
this.tokCommand){case 364558:this.flowContext=new J.script.ScriptFlowContext(this,a,b,this.flowContext);null!=this.thisFunction&&this.vFunctionStack.add(0,this.thisFunction);this.thisFunction=J.script.ScriptCompiler.newScriptParallelProcessor("",this.tokCommand);this.flowContext.setFunction(this.thisFunction);this.pushCount++;this.vPush.addLast(a);break;case 364547:case 102402:this.flowContext.token=a;break;case 102411:case 102413:a.contextVariables=this.flowContext.token.contextVariables;this.flowContext.token=
a;break;case 102439:case 135369224:case 102406:case 102412:this.pushCount++,this.vPush.addLast(a);default:this.flowContext=new J.script.ScriptFlowContext(this,a,b,this.flowContext)}return!0},$fz.isPrivate=!0,$fz),"~S");$_M(c$,"checkFlowEnd",($fz=function(a,b,c){if(null==this.flowContext||this.flowContext.token.tok!=a){var d=!0;switch(a){case 135369225:d=364547==this.flowContext.token.tok||102402==this.flowContext.token.tok;break;case 102410:d=102411==this.flowContext.token.tok||102413==this.flowContext.token.tok;
break;default:d=!1}if(!d)return this.errorStr(1,"end "+b)}switch(a){case 135369225:case 102410:break;case 102412:case 135369224:case 102439:case 102406:this.vPush.remove(--this.pushCount);break;case 102436:case 135368713:case 364558:this.isCheckOnly||(this.addTokenToPrefix(J.script.T.o(a,this.thisFunction)),J.script.ScriptFunction.setFunction(this.thisFunction,this.script,c,this.lltoken.size(),this.lineNumbers,this.lineIndices,this.lltoken));this.thisFunction=0==this.vFunctionStack.size()?null:this.vFunctionStack.remove(0);
this.tokenCommand.intValue=0;364558==a&&this.vPush.remove(--this.pushCount);break;default:return this.errorStr(19,"end "+b)}this.flowContext=this.flowContext.getParent();return!0},$fz.isPrivate=!0,$fz),"~N,~S,~N");$_M(c$,"getData",($fz=function(a){this.addTokenToPrefix(J.script.T.o(4,a));this.ichToken+=a.length+2;"\r"==this.charAt(this.ichToken)&&(this.lineCurrent++,this.ichToken++);"\n"==this.charAt(this.ichToken)&&(this.lineCurrent++,this.ichToken++);var b=this.script.indexOf(this.chFirst+a+this.chFirst,
this.ichToken)-4;if(0>b||!this.script.substring(b,b+4).equalsIgnoreCase("END "))return!1;var c=this.script.substring(this.ichToken,b);this.incrementLineCount(c);this.addTokenToPrefix(J.script.T.o(135270407,c));this.addTokenToPrefix(J.script.T.o(1073741824,"end"));this.addTokenToPrefix(J.script.T.o(4,a));this.cchToken=b-this.ichToken+a.length+6;return!0},$fz.isPrivate=!0,$fz),"~S");$_M(c$,"incrementLineCount",($fz=function(a){var b,c=a.indexOf("\r"),d=a.indexOf("\n");if(0>c&&0>d)return 0;var e=this.lineCurrent;
if(0>c||d<c)c=d;for(d=a.length;--d>=c;)("\n"==(b=a.charAt(d))||"\r"==b)&&this.lineCurrent++;return this.lineCurrent-e},$fz.isPrivate=!0,$fz),"~S");c$.isSpaceOrTab=$_M(c$,"isSpaceOrTab",($fz=function(a){return" "==a||"\t"==a},$fz.isPrivate=!0,$fz),"~S");$_M(c$,"eol",($fz=function(a){return"\x00"==a||"\r"==a||"\n"==a||";"==a&&0>=this.nSemiSkip},$fz.isPrivate=!0,$fz),"~S");$_M(c$,"lookingAtSetBraceSyntax",($fz=function(){for(var a=this.ichToken,b=1;++a<this.cchScript&&0<b;)switch(this.script.charAt(a)){case "{":b++;
break;case "}":b--}if("["==this.charAt(a)&&1==++b)for(;++a<this.cchScript&&0<b;)switch(this.script.charAt(a)){case "[":b++;break;case "]":b--}return"."==this.charAt(a)&&0==b?!0:!1},$fz.isPrivate=!0,$fz));$_M(c$,"lookingAtString",($fz=function(a){if(this.ichToken+2>this.cchScript)return!1;this.chFirst=this.script.charAt(this.ichToken);if('"'!=this.chFirst&&(!a||"'"!=this.chFirst))return!1;a=this.ichToken;for(var b,c=!1;++a<this.cchScript;){b=this.script.charAt(a);if(b==this.chFirst&&!c)break;c="\\"==
b?!c:!1}a==this.cchScript?(this.cchToken=-1,this.ichEnd=this.cchScript):this.cchToken=++a-this.ichToken;return!0},$fz.isPrivate=!0,$fz),"~B");$_M(c$,"getUnescapedStringLiteral",($fz=function(a){if(a)return a=this.script.substring(this.ichToken+1,this.ichToken+this.cchToken-1),0<=a.indexOf("\\u")&&(a=J.util.Escape.unescapeUnicode(a)),a;a=JU.SB.newN(this.cchToken-2);for(var b=this.ichToken+this.cchToken-1,c=this.ichToken+1;c<b;){var d=this.script.charAt(c++);if("\\"==d&&c<b)switch(d=this.script.charAt(c++),
d){case "n":d="\n";break;case "t":d="\t";break;case "r":d="\r";case '"':case "\\":case "'":break;case "x":case "u":var e="x"==d?2:4;if(c<b){for(d=0;0<=--e&&c<b;){var f=this.script.charAt(c),f=J.util.Escape.getHexitValue(f);if(0>f)break;d<<=4;d+=f;++c}d=String.fromCharCode(d)}}a.appendC(d)}return a.toString()},$fz.isPrivate=!0,$fz),"~B");$_M(c$,"lookingAtLoadFormat",($fz=function(){for(var a=this.ichToken,b=J.viewer.Viewer.isDatabaseCode(this.charAt(a)),c;Character.isLetterOrDigit(c=this.charAt(a))&&
(b||Character.isLetter(c))||b&&!this.eol(c)&&!Character.isWhitespace(c);)++a;if(!b&&a==this.ichToken||!J.script.ScriptCompiler.isSpaceOrTab(c))return!1;this.cchToken=a-this.ichToken;return!0},$fz.isPrivate=!0,$fz));$_M(c$,"lookingAtImpliedString",($fz=function(a,b,c){var d=this.ichToken,e=this.script.charAt(d),f=1074790550==this.lastToken.tok,g=f||!J.script.T.tokAttr(this.tokCommand,20480)&&1==(this.tokCommand&1),h="@"==e;if(h&&(d+3<this.cchScript&&"{"==this.script.charAt(d+1))&&g)return d=J.util.Txt.ichMathTerminator(this.script,
this.ichToken+1,this.cchScript),!f&&d!=this.cchScript&&0<(this.cchToken=d+1-this.ichToken);for(var g=f=-1,j=!0,l=0;j&&!this.eol(e=this.charAt(d));){switch(e){case "(":if(!c&&5<=d&&(this.script.substring(d-4,d).equals(".spt")||this.script.substring(d-4,d).equals(".png")||this.script.substring(d-5,d).equals(".pngj"))){j=!1;continue}break;case "=":if(!b){j=!1;continue}break;case "{":l++;break;case "}":l--;if(0>l&&(0<this.braceCount||0<this.iBrace)){j=!1;continue}break;default:Character.isWhitespace(e)?
0>f&&(f=d):g=d}++d}a?d=g+1:0<f&&(d=f);return h&&(!a||0>f&&0>=l&&1<d-this.ichToken)?!1:0<(this.cchToken=d-this.ichToken)},$fz.isPrivate=!0,$fz),"~B,~B,~B");$_M(c$,"lookingAtExponential",($fz=function(){if(this.ichToken==this.cchScript)return NaN;var a=this.ichToken,b=a;"-"==this.script.charAt(a)&&++a;for(var c=!1,d="X";Character.isDigit(d=this.charAt(a));)++a,c=!0;for(a<this.cchScript&&"."==d&&++a;Character.isDigit(d=this.charAt(a));)++a,c=!0;if(a==this.cchScript||!c||(c="E"!=d&&"e"!=d)||++a==this.cchScript)return NaN;
d=this.script.charAt(a);for(("-"==d||"+"==d)&&a++;Character.isDigit(this.charAt(a));)a++,c=!0;if(!c)return NaN;this.cchToken=a-this.ichToken;return JU.ParserJS.dVal(this.script.substring(b,a))},$fz.isPrivate=!0,$fz));$_M(c$,"lookingAtDecimal",($fz=function(){if(this.ichToken==this.cchScript)return!1;var a=this.ichToken;"-"==this.script.charAt(a)&&++a;for(var b=!1,c;Character.isDigit(c=this.charAt(a++));)b=!0;if("."!=c)return!1;if(!this.eol(c=this.charAt(a)))if(Character.isLetter(c)||"?"==c||"*"==
c||Character.isLetter(c=this.charAt(a+1))||"?"==c)return!1;for(;Character.isDigit(this.charAt(a));)++a,b=!0;this.cchToken=a-this.ichToken;return b},$fz.isPrivate=!0,$fz));$_M(c$,"lookingAtSeqcode",($fz=function(){var a=this.ichToken,b;if("^"==this.charAt(a+1)&&"*"==this.script.charAt(a))b="^",++a;else for("-"==this.script.charAt(a)&&++a;Character.isDigit(b=this.charAt(a));)++a;if("^"!=b)return!1;a++;b=a==this.cchScript?" ":this.script.charAt(a++);if(" "!=b&&"*"!=b&&"?"!=b&&!Character.isLetter(b))return!1;
this.cchToken=a-this.ichToken;return!0},$fz.isPrivate=!0,$fz));$_M(c$,"lookingAtInteger",($fz=function(){if(this.ichToken==this.cchScript)return 2147483647;var a=this.ichToken;"-"==this.script.charAt(this.ichToken)&&++a;for(var b=a;Character.isDigit(this.charAt(a));)++a;if(b==a)return 2147483647;this.cchToken=a-this.ichToken;try{return Integer.parseInt(this.script.substring(this.ichToken,a))}catch(c){if(!Clazz.exceptionOf(c,NumberFormatException))throw c;}return 2147483647},$fz.isPrivate=!0,$fz));
$_M(c$,"lookingAtBitset",function(){if(this.script.indexOf("({null})",this.ichToken)==this.ichToken)return this.cchToken=8,new JU.BS;var a;if(this.ichToken+4>this.cchScript||"{"!=this.script.charAt(this.ichToken+1)||0>(a=this.script.indexOf("}",this.ichToken))||a+1==this.cchScript)return null;var b=J.util.Escape.uB(this.script.substring(this.ichToken,a+2));null!=b&&(this.cchToken=a+2-this.ichToken);return b});$_M(c$,"lookingAtObjectID",($fz=function(){var a=1==this.nTokens,b=this.ichToken;if("$"!=
this.charAt(b)||'"'==this.charAt(++b))return!1;for(;b<this.cchScript;){var c;if(Character.isWhitespace(c=this.script.charAt(b))){if(b==this.ichToken+1)return!1;break}if(!Character.isLetterOrDigit(c))switch(c){default:return!1;case "*":if(!a)return!1;case "~":case "_":}b++}this.cchToken=b-++this.ichToken;return!0},$fz.isPrivate=!0,$fz));$_M(c$,"lookingAtLookupToken",($fz=function(a){if(a==this.cchScript)return!1;var b=a;this.tokLastMath=0;var c;switch(c=this.script.charAt(a++)){case "-":case "+":case "&":case "|":case "*":if(a<
this.cchScript)if(this.script.charAt(a)==c){++a;if("-"==c||"+"==c)break;"&"==c&&this.charAt(a)==c&&++a}else"="==this.script.charAt(a)&&++a;this.tokLastMath=1;break;case "/":if("/"==this.charAt(a))break;case "\\":case "!":"="==this.charAt(a)&&++a;this.tokLastMath=1;break;case ")":case "]":case "}":case ".":break;case "@":case "{":this.tokLastMath=2;break;case ":":this.tokLastMath=1;break;case "(":case ",":case "$":case ";":case "[":case "%":this.tokLastMath=1;break;case "<":case "=":case ">":("<"==
(c=this.charAt(a))||"="==c||">"==c)&&++a;this.tokLastMath=1;break;default:if(!Character.isLetter(c))return!1;case "~":case "_":case "'":case "?":"?"==c&&(this.tokLastMath=1);for(;Character.isLetterOrDigit(c=this.charAt(a))||"_"==c||"?"==c||"~"==c||"'"==c||"\\"==c&&"?"==this.charAt(a+1)||"^"==c&&a>b&&Character.isDigit(this.charAt(a-1));)++a}this.cchToken=a-b;return!0},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"lookForSyncID",($fz=function(){var a;if('"'==(a=this.charAt(this.ichToken))||"@"==a||"\x00"==a)return!1;
for(var b=this.ichToken;!J.script.ScriptCompiler.isSpaceOrTab(a=this.charAt(b))&&"#"!=a&&"}"!=a&&!this.eol(a);)++b;this.cchToken=b-this.ichToken;return!0},$fz.isPrivate=!0,$fz));$_M(c$,"ERROR",($fz=function(a){this.errorIntStr2(a,null,null);return 4},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"ERROR",($fz=function(a,b){this.errorStr(a,b);return 4},$fz.isPrivate=!0,$fz),"~N,~S");$_M(c$,"handleError",($fz=function(){this.errorType=this.errorMessage;this.errorLine=this.script.substring(this.ichCurrentCommand,
this.ichEnd<=this.ichCurrentCommand?this.ichToken:this.ichEnd);var a=(this.ichToken<this.ichEnd?this.errorLine.substring(0,this.ichToken-this.ichCurrentCommand)+" >>>> "+this.errorLine.substring(this.ichToken-this.ichCurrentCommand):this.errorLine)+" <<<<";this.errorMessage=J.i18n.GT._("script compiler ERROR: ")+this.errorMessage+J.script.ScriptEvaluator.getErrorLineMessage(null,this.filename,this.lineCurrent,this.iCommand,a);if(!this.isSilent){for(this.ichToken=Math.max(this.ichEnd,this.ichToken);!this.lookingAtEndOfLine()&&
!this.lookingAtTerminator();)this.ichToken++;this.errorLine=this.script.substring(this.ichCurrentCommand,this.ichToken);this.viewer.addCommand(this.errorLine+"#??");J.util.Logger.error(this.errorMessage)}return!1},$fz.isPrivate=!0,$fz));Clazz.defineStatics(c$,"OK",0,"OK2",1,"CONTINUE",2,"EOL",3,"$ERROR",4)});Clazz.declarePackage("J.script");
Clazz.load(null,"J.script.ScriptCompilationTokenParser","java.lang.Float JU.List $.P3 J.i18n.GT J.script.ScriptEvaluator $.T J.util.Logger $.Txt J.viewer.JC".split(" "),function(){c$=Clazz.decorateAsClass(function(){this.script=this.viewer=null;this.isStateScript=!1;this.ichToken=this.ichEnd=this.ichComment=this.ichCurrentCommand=this.iCommand=this.lineCurrent=0;this.tokenAndEquals=this.lastToken=this.tokenCommand=this.lastFlowCommand=this.theToken=null;this.ptNewSetModifier=this.tokCommand=this.nTokens=
this.theTok=0;this.logMessages=this.isNewSet=!1;this.atokenInfix=null;this.itokenInfix=0;this.isSetOrDefine=this.isMathExpressionCommand=this.isSetBrace=!1;this.ltokenPostfix=null;this.isCommaAsOrAllowed=this.isEmbeddedExpression=!1;this.htUserFunctions=this.theValue=null;this.residueSpecCodeGenerated=this.haveString=!1;this.errorType=this.errorLine=this.errorMessageUntranslated=this.errorMessage=null;Clazz.instantialize(this,arguments)},J.script,"ScriptCompilationTokenParser");$_M(c$,"compileExpressions",
function(){var a=135271429==this.tokCommand&&269484048==this.tokAt(2);this.isEmbeddedExpression=a||0!=this.tokCommand&&(135368713!=this.tokCommand&&102436!=this.tokCommand&&364558!=this.tokCommand&&102412!=this.tokCommand||2147483647!=this.tokenCommand.intValue)&&1150985!=this.tokCommand&&!J.script.T.tokAttrOr(this.tokCommand,12288,20480);this.isMathExpressionCommand=1073741824==this.tokCommand||a||J.script.T.tokAttr(this.tokCommand,36864);a=this.isEmbeddedExpression||J.script.T.tokAttr(this.tokCommand,
12288);1048583==this.tokAt(1)&&J.script.T.tokAttr(this.tokCommand,12288)&&(a=!1);if(a&&!this.compileExpression())return!1;for(var a=this.atokenInfix.length,b=0,c=1;c<a;c++)1060866==this.tokAt(c)&&b++;a-=b;this.isNewSet&&1==a&&(this.atokenInfix[0]=J.script.T.tv(135368713,0,this.atokenInfix[0].value),this.isNewSet=!1);return(this.isNewSet||this.isSetBrace)&&a<this.ptNewSetModifier+2?this.commandExpected():1==a||!J.script.T.tokAttr(this.tokCommand,262144)?!0:this.error(0)});$_M(c$,"compileExpression",
function(){var a=this.isSetOrDefine&&!this.isSetBrace?2:1;this.ltokenPostfix=new JU.List;this.itokenInfix=0;var b=null,c=this.tokAt(1);switch(this.tokCommand){case 1060866:2==this.tokAt(1)&&(1048584==this.tokAt(2)&&269484436==this.tokAt(4))&&(this.tokCommand=1085443,this.isSetBrace=!0,this.ptNewSetModifier=4,this.isEmbeddedExpression=this.isMathExpressionCommand=!0,this.addTokenToPostfixToken(J.script.T.tokenSetProperty),this.addTokenToPostfixToken(J.script.T.tokenExpressionBegin),this.addNextToken(),
this.addNextToken(),this.addTokenToPostfixToken(J.script.T.tokenExpressionEnd),a=0);break;case 12295:1678770178==c&&(a=2);break;case 12294:case 1610625028:case 135280132:switch(c){case 1276118017:case 1073742119:a=2,c=this.tokAt(2)}1087373318==c&&a++}for(c=0;c<a&&this.addNextToken();c++);for(;this.moreTokens();){if(this.isEmbeddedExpression){for(;!this.isExpressionNext();){if(this.tokPeekIs(1073741824)&&!(135271426==this.tokCommand&&1==this.itokenInfix)&&(a=this.atokenInfix[this.itokenInfix].value,
c=J.script.T.getTokenFromName(a),null!=c&&(!this.isMathExpressionCommand&&1060866!=this.lastToken.tok||(1048584==this.lastToken.tok||269484048==this.tokAt(this.itokenInfix+1))&&!this.isUserFunction(a))))this.atokenInfix[this.itokenInfix]=c;if(!this.addNextToken())break}if(!this.moreTokens())break}if(1060866==this.lastToken.tok){if(!this.clauseDefine(!0,!1))return!1}else{this.isMathExpressionCommand||this.addTokenToPostfixToken(b=J.script.T.o(1048577,"implicitExpressionBegin"));if(!this.clauseOr(this.isCommaAsOrAllowed||
!this.isMathExpressionCommand&&this.tokPeekIs(269484048)))return!1;!this.isMathExpressionCommand&&!(this.isEmbeddedExpression&&this.lastToken===J.script.T.tokenCoordinateEnd)&&this.addTokenToPostfixToken(J.script.T.tokenExpressionEnd);if(this.moreTokens()){if(135280132!=this.tokCommand&&!this.isEmbeddedExpression)return this.error(5);135280132==this.tokCommand&&(this.tokCommand=b.intValue=0,this.isMathExpressionCommand=this.isEmbeddedExpression=!0,this.isCommaAsOrAllowed=!1)}}}this.atokenInfix=this.ltokenPostfix.toArray(Array(this.ltokenPostfix.size()));
return!0});$_M(c$,"isUserFunction",function(a){return!this.isStateScript&&(this.viewer.isFunction(a)||this.htUserFunctions.containsKey(a))},"~S");$_M(c$,"isExpressionNext",($fz=function(){return this.tokPeekIs(1048586)&&!(4==this.tokAt(this.itokenInfix+1)&&269484066==this.tokAt(this.itokenInfix+2))||!this.isMathExpressionCommand&&this.tokPeekIs(269484048)},$fz.isPrivate=!0,$fz));c$.tokenAttr=$_M(c$,"tokenAttr",function(a,b){return null!=a&&J.script.T.tokAttr(a.tok,b)},"J.script.T,~N");$_M(c$,"moreTokens",
($fz=function(){return this.itokenInfix<this.atokenInfix.length},$fz.isPrivate=!0,$fz));$_M(c$,"tokAt",function(a){return a<this.atokenInfix.length?this.atokenInfix[a].tok:0},"~N");$_M(c$,"tokPeek",($fz=function(){return this.itokenInfix>=this.atokenInfix.length?0:this.atokenInfix[this.itokenInfix].tok},$fz.isPrivate=!0,$fz));$_M(c$,"tokPeekIs",($fz=function(a){return this.tokAt(this.itokenInfix)==a},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"intPeek",($fz=function(){return this.itokenInfix>=this.atokenInfix.length?
2147483647:this.atokenInfix[this.itokenInfix].intValue},$fz.isPrivate=!0,$fz));$_M(c$,"valuePeek",($fz=function(){return this.moreTokens()?this.atokenInfix[this.itokenInfix].value:""},$fz.isPrivate=!0,$fz));$_M(c$,"tokenNext",($fz=function(){return this.itokenInfix>=this.atokenInfix.length?null:this.atokenInfix[this.itokenInfix++]},$fz.isPrivate=!0,$fz));$_M(c$,"tokenNextTok",($fz=function(a){var b=this.tokenNext();return null!=b&&b.tok==a},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"returnToken",($fz=function(){this.itokenInfix--;
return!1},$fz.isPrivate=!0,$fz));$_M(c$,"getToken",($fz=function(){this.theValue=null==(this.theToken=this.tokenNext())?null:this.theToken.value;return this.theToken},$fz.isPrivate=!0,$fz));$_M(c$,"isToken",($fz=function(a){return null!=this.theToken&&this.theToken.tok==a},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"getNumericalToken",($fz=function(){return null!=this.getToken()&&(this.isToken(2)||this.isToken(3))},$fz.isPrivate=!0,$fz));$_M(c$,"floatValue",($fz=function(){switch(this.theToken.tok){case 2:return this.theToken.intValue;
case 3:return this.theValue.floatValue()}return 0},$fz.isPrivate=!0,$fz));$_M(c$,"addTokenToPostfix",($fz=function(a,b){return this.addTokenToPostfixToken(J.script.T.o(a,b))},$fz.isPrivate=!0,$fz),"~N,~O");$_M(c$,"addTokenToPostfixInt",($fz=function(a,b,c){return this.addTokenToPostfixToken(J.script.T.tv(a,b,c))},$fz.isPrivate=!0,$fz),"~N,~N,~O");$_M(c$,"addTokenToPostfixToken",($fz=function(a){if(null==a)return!1;this.logMessages&&J.util.Logger.debug("addTokenToPostfix"+a);this.ltokenPostfix.addLast(a);
this.lastToken=a;return!0},$fz.isPrivate=!0,$fz),"J.script.T");$_M(c$,"addNextToken",($fz=function(){return this.addTokenToPostfixToken(this.tokenNext())},$fz.isPrivate=!0,$fz));$_M(c$,"addNextTokenIf",($fz=function(a){return this.tokPeekIs(a)&&this.addNextToken()},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"addSubstituteTokenIf",($fz=function(a,b){if(!this.tokPeekIs(a))return!1;this.itokenInfix++;return this.addTokenToPostfixToken(b)},$fz.isPrivate=!0,$fz),"~N,J.script.T");$_M(c$,"clauseOr",($fz=function(a){this.haveString=
!1;if(!this.clauseAnd())return!1;if(this.isEmbeddedExpression&&1048578==this.lastToken.tok)return!0;for(var b;269484112==(b=this.tokPeek())||269484113==b||269484114==b||a&&269484080==b;){269484080==b&&!this.haveString?this.addSubstituteTokenIf(269484080,J.script.T.tokenOr):this.addNextToken();if(!this.clauseAnd())return!1;if(a&&(1048590==this.lastToken.tok||10==this.lastToken.tok))this.haveString=!0}return!0},$fz.isPrivate=!0,$fz),"~B");$_M(c$,"clauseAnd",($fz=function(){if(!this.clauseNot())return!1;
if(this.isEmbeddedExpression&&1048578==this.lastToken.tok)return!0;for(;this.tokPeekIs(269484128);)if(this.addNextToken(),!this.clauseNot())return!1;return!0},$fz.isPrivate=!0,$fz));$_M(c$,"clauseNot",($fz=function(){return this.tokPeekIs(269484144)?(this.addNextToken(),this.clauseNot()):this.clausePrimitive()},$fz.isPrivate=!0,$fz));$_M(c$,"clausePrimitive",($fz=function(){var a=this.tokPeek();switch(a){case 1073742195:return this.itokenInfix++,this.clausePrimitive();case 0:return this.error(4);
case 1048579:case 10:case 269484208:case 137363468:case 3145736:case 3145735:case 3145738:case 1048585:case 1048587:case 3145760:return this.addNextToken();case 4:return this.haveString=!0,this.addNextToken();case 3:return this.addTokenToPostfixInt(1048611,this.fixModelSpec(this.getToken()),this.theValue);case 1095761925:case 1095761926:return this.clauseCell(a);case 135266310:return this.clauseConnected();case 135267335:case 135267336:return this.clauseSubstructure();case 135266324:case 135402505:return this.clauseWithin(135266324==
a);case 1060866:return this.clauseDefine(!1,!1);case 1678770178:case 1746538509:this.addNextToken();if(this.tokPeekIs(10))this.addNextToken();else if(this.tokPeekIs(1060866))return this.clauseDefine(!1,!1);return!0;case 269484048:return this.addNextToken(),!this.clauseOr(!0)?!1:!this.addNextTokenIf(269484049)?this.errorStr(15,")"):this.checkForItemSelector(!0);case 1048586:return this.checkForCoordinate(this.isMathExpressionCommand);default:if(this.clauseResidueSpec())return!0;if(this.isError())return!1;
if(J.script.T.tokAttr(a,1078984704)){var b=this.itokenInfix,c=this.clauseComparator(!0);if(c||this.itokenInfix!=b)return c;if(1238369286==a)return this.clauseSubstructure()}return this.addNextToken()}},$fz.isPrivate=!0,$fz));$_M(c$,"checkForCoordinate",($fz=function(a){var b=!1,c=this.ltokenPostfix.size();a?(this.addTokenToPostfixToken(J.script.T.tokenExpressionBegin),this.tokenNext()):this.isEmbeddedExpression?(this.tokenNext(),c--):this.addNextToken();var d=this.tokPeekIs(4);if(d){a=!1;this.returnToken();
this.ltokenPostfix.remove(this.ltokenPostfix.size()-1);this.addNextToken();for(var e=1;0!=e;){if(this.tokPeekIs(1048586))if(this.isExpressionNext()){this.addTokenToPostfixToken(J.script.T.o(1048577,"implicitExpressionBegin"));if(!this.clauseOr(!0))return!1;this.lastToken!==J.script.T.tokenCoordinateEnd&&this.addTokenToPostfixToken(J.script.T.tokenExpressionEnd)}else e++;this.tokPeekIs(1048590)&&e--;this.addNextToken()}}else{if(!this.tokPeekIs(1048590)&&!this.clauseOr(!1))return!1;for(b=1;!this.tokPeekIs(1048590);){e=
this.addNextTokenIf(269484080);if(!this.clauseOr(!1))return e||3>b?!1:this.errorStr(15,"}");b++}b=2<=b}b&&(a||this.isEmbeddedExpression)?(this.ltokenPostfix.set(c,J.script.T.tokenCoordinateBegin),this.addTokenToPostfixToken(J.script.T.tokenCoordinateEnd),this.tokenNext()):a?(this.addTokenToPostfixToken(J.script.T.tokenExpressionEnd),this.tokenNext()):this.isEmbeddedExpression&&!d?this.tokenNext():this.addNextToken();return this.checkForItemSelector(!d)},$fz.isPrivate=!0,$fz),"~B");$_M(c$,"checkForItemSelector",
($fz=function(a){var b;if(269484096==(b=this.tokAt(this.itokenInfix+1))||a&&1048586==b)return!0;for(;this.addNextTokenIf(269484096);){if(!this.clauseItemSelector())return!1;if(!this.addNextTokenIf(269484097))return this.errorStr(15,"]")}return!0},$fz.isPrivate=!0,$fz),"~B");$_M(c$,"clauseWithin",($fz=function(a){this.addNextToken();if(!this.addNextTokenIf(269484048)||null==this.getToken())return!1;var b=3.4028235E38,c=null,d=a,e,f=this.theToken.tok;if(!a){e=-1;for(var g=this.itokenInfix;0!=e;g++)switch(e=
this.tokAt(g)){case 269484080:e=0;break;case 1048586:case 269484048:case 269484049:b=100,this.returnToken(),f=e=0}}switch(f){case 269484192:if(null==this.getToken())return!1;if(2!=this.theToken.tok)return this.error(12);b=-this.theToken.intValue;break;case 2:case 3:b=this.floatValue();break;case 1060866:this.addTokenToPostfixToken(this.theToken);if(!this.clauseDefine(!0,!1))return!1;c="";d=!1}if(a&&3.4028235E38==b)switch(f){case 1060866:break;case 135267335:case 135267336:case 1238369286:this.addTokenToPostfix(4,
this.theValue);if(!this.addNextTokenIf(269484080))return!1;d=!1;e=this.tokPeek();switch(e){case 0:return!1;case 4:this.addNextToken();c="";break;case 1060866:if(!this.clauseDefine(!1,!0))return!1;c="";break;default:return!1}break;case 1048580:d=!1;case 1087375361:case 1087375362:case 1073741864:case 1679429641:case 1087373316:case 1048582:case 1087375365:case 1087373318:case 137363468:case 1095766028:case 1095761934:case 135266319:case 135267841:case 1095761935:case 1087373320:case 3145760:case 1095761938:case 1641025539:case 4:case 1649412120:c=
this.theValue;break;case 1073741824:c=this.theValue.toLowerCase();break;default:return this.errorIntStr2(18,"WITHIN",": "+this.theToken.value)}null==c?this.addTokenToPostfix(3,Float.$valueOf(b)):0<c.length&&this.addTokenToPostfix(4,c);for(g=!1;!g&&(0==f||this.addNextTokenIf(269484080));){0==f&&(f=135402505);var h=!1;e=this.tokPeek();if(a){switch(f){case 2:case 3:if(1048589==e||1048588==e){this.addTokenToPostfixToken(this.getToken());if(!this.addNextTokenIf(269484080))break;e=this.tokPeek()}}if(null==
c){switch(e){case 135267841:case 1048582:case 135266319:h=!0;this.addNextToken();break;case 1048583:this.getToken();this.getToken();this.addTokenToPostfix(4,"$"+this.theValue);g=!0;break;case 1087373318:case 1649412120:this.getToken();this.addTokenToPostfix(4,J.script.T.nameOf(e));break;case 1048586:this.returnToken(),h=!0,this.addTokenToPostfixToken(J.script.T.getTokenFromName(3.4028235E38==b?"plane":"coord"))}g||this.addNextTokenIf(269484080)}}this.tokPeek();if(g)break;if(h)for(;!this.tokPeekIs(269484049);)switch(this.tokPeek()){case 0:return this.error(4);
case 269484048:this.addTokenToPostfixToken(J.script.T.tokenExpressionBegin);this.addNextToken();if(!this.clauseOr(!1))return this.errorIntStr2(18,"WITHIN",": ?");if(!this.addNextTokenIf(269484049))return this.errorStr(15,", / )");this.addTokenToPostfixToken(J.script.T.tokenExpressionEnd);break;case 1060866:if(!this.clauseDefine(!1,!1))return!1;break;default:this.addTokenToPostfixToken(this.getToken())}else this.clauseOr(d)}return!this.addNextTokenIf(269484049)?this.errorStr(15,")"):!0},$fz.isPrivate=
!0,$fz),"~B");$_M(c$,"clauseConnected",($fz=function(){this.addNextToken();if(!this.addNextTokenIf(269484048))return this.addTokenToPostfixToken(J.script.T.tokenLeftParen),this.addTokenToPostfixToken(J.script.T.tokenRightParen),!0;for(;(!this.addNextTokenIf(2)||this.addNextTokenIf(269484080))&&(!this.addNextTokenIf(2)||this.addNextTokenIf(269484080))&&(!this.addNextTokenIf(3)||this.addNextTokenIf(269484080))&&(!this.addNextTokenIf(3)||this.addNextTokenIf(269484080));){var a=this.getToken().value,
a=Clazz.instanceOf(a,String)?a:" ";if(131071==J.script.ScriptEvaluator.getBondOrderFromString(a))this.returnToken();else if(this.addTokenToPostfix(4,a),!this.addNextTokenIf(269484080))break;if(this.addNextTokenIf(269484049))return!0;if(!this.clauseOr(this.tokPeekIs(269484048)))return!1;if(this.addNextTokenIf(269484049))return!0;if(!this.addNextTokenIf(269484080)||!this.clauseOr(this.tokPeekIs(269484048)))return!1;break}return!this.addNextTokenIf(269484049)?this.errorStr(15,")"):!0},$fz.isPrivate=
!0,$fz));$_M(c$,"clauseSubstructure",($fz=function(){this.addNextToken();if(!this.addNextTokenIf(269484048))return!1;if(this.tokPeekIs(1060866)){if(!this.clauseDefine(!1,!0))return!1}else if(!this.addNextTokenIf(4))return this.errorStr(15,'"..."');return this.addNextTokenIf(269484080)&&!this.clauseOr(this.tokPeekIs(269484048))?!1:!this.addNextTokenIf(269484049)?this.errorStr(15,")"):!0},$fz.isPrivate=!0,$fz));$_M(c$,"clauseItemSelector",($fz=function(){for(var a,b=0;0!=(a=this.tokPeek())&&269484097!=
a;)this.addNextToken(),269484096==a&&b++,269484097==this.tokPeek()&&0<b--&&this.addNextToken();return!0},$fz.isPrivate=!0,$fz));$_M(c$,"clauseComparator",($fz=function(a){var b=this.tokenNext(),c=this.tokenNext();if(!J.script.ScriptCompilationTokenParser.tokenAttr(c,269484288)){if(!a)return this.errorStr(15,"== != < > <= >=");null!=c&&this.returnToken();this.returnToken();return!1}if(J.script.ScriptCompilationTokenParser.tokenAttr(b,1087373312)&&269484436!=c.tok&&269484438!=c.tok)return this.errorStr(15,
"== !=");if(null==this.getToken())return this.errorStr(17,""+this.valuePeek());if((a=this.isToken(269484192))&&null==this.getToken())return this.error(12);switch(this.theToken.tok){case 2:case 3:case 1073741824:case 4:case 1048586:case 1060866:break;default:if(!J.script.T.tokAttr(this.theToken.tok,1073741824))return this.error(13)}this.addTokenToPostfixInt(c.tok,b.tok,c.value+(a?" -":""));1716520985==b.tok&&this.addTokenToPostfixToken(b);if(this.isToken(1048586))return this.returnToken(),this.clausePrimitive();
this.addTokenToPostfixToken(this.theToken);return 1060866==this.theToken.tok?this.clauseDefine(!0,!1):!0},$fz.isPrivate=!0,$fz),"~B");$_M(c$,"clauseCell",($fz=function(a){var b=new JU.P3;this.tokenNext();if(!this.tokenNextTok(269484436))return this.errorStr(15,"=");if(null==this.getToken())return this.error(3);if(this.isToken(2)){var c=this.theToken.intValue;b.x=Clazz.doubleToInt(c/100)-4;b.y=Clazz.doubleToInt(c%100/10)-4;b.z=c%10-4;return this.addTokenToPostfix(a,b)}if(!this.isToken(1048586)||!this.getNumericalToken())return this.error(3);
b.x=this.floatValue();this.tokPeekIs(269484080)&&this.tokenNext();if(!this.getNumericalToken())return this.error(3);b.y=this.floatValue();this.tokPeekIs(269484080)&&this.tokenNext();if(!this.getNumericalToken()||!this.tokenNextTok(1048590))return this.error(3);b.z=this.floatValue();return this.addTokenToPostfix(a,b)},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"clauseDefine",($fz=function(a,b){if(!a){var c=this.tokenNext();b&&(c=J.script.T.tokenDefineString);this.addTokenToPostfixToken(c)}if(0==this.tokPeek())return this.error(4);
if(!this.addSubstituteTokenIf(1048586,J.script.T.tokenExpressionBegin))return this.addNextToken()&&this.checkForItemSelector(!0);for(;this.moreTokens()&&!this.tokPeekIs(1048590);)if(this.tokPeekIs(1048586)){if(!this.checkForCoordinate(!0))return!1}else this.addNextToken();return this.addSubstituteTokenIf(1048590,J.script.T.tokenExpressionEnd)&&this.checkForItemSelector(!0)},$fz.isPrivate=!0,$fz),"~B,~B");$_M(c$,"generateResidueSpecCode",($fz=function(a){this.residueSpecCodeGenerated&&this.addTokenToPostfixToken(J.script.T.tokenAND);
this.addTokenToPostfixToken(a);return this.residueSpecCodeGenerated=!0},$fz.isPrivate=!0,$fz),"J.script.T");$_M(c$,"clauseResidueSpec",($fz=function(){var a=this.tokPeek(),b=this.residueSpecCodeGenerated=!1;switch(a){case 0:case 3145732:case 3145750:return!1;case 269484066:case 2:case 269484210:case 5:break;case 269484209:case 269484096:case 1073741824:b=!0;break;default:if(J.script.T.tokAttr(a,269484288))return!1;var c=""+this.valuePeek(),b=2==c.length||3==c.length;if(!b)return!1}c=!1;if(b){if(!this.clauseResNameSpec())return!1;
c=!0;a=this.tokPeek();if(J.script.T.tokAttr(a,269484288))return this.returnToken(),this.ltokenPostfix.remove(this.ltokenPostfix.size()-1),!1}b=!1;if(269484209==a||2==a||5==a){b=2==a;if(this.tokPeekIs(269484209))this.getToken();else if(!this.clauseSequenceSpec())return!1;c=!0;a=this.tokPeek()}if(269484066==a||269484209==a||1073741824==a||1112541205==a||1112541206==a||1112541207==a||1141899280==a||2==a&&!b){if(!this.clauseChainSpec(a))return!1;c=!0;a=this.tokPeek()}if(1048584==a){if(!this.clauseAtomSpec())return!1;
c=!0;a=this.tokPeek()}if(269484210==a){if(!this.clauseAlternateSpec())return!1;c=!0;a=this.tokPeek()}if(269484066==a||269484208==a){if(!this.clauseModelSpec())return!1;c=!0;this.tokPeek()}if(!c)return this.error(14);this.residueSpecCodeGenerated||this.addTokenToPostfixToken(J.script.T.tokenAll);return!0},$fz.isPrivate=!0,$fz));$_M(c$,"clauseResNameSpec",($fz=function(){this.getToken();switch(this.theToken.tok){case 269484209:return!0;case 269484096:for(var a="";null!=this.getToken()&&!this.isToken(269484097);)a+=
this.theValue;if(!this.isToken(269484097))return!1;if(""===a)return!0;var b;if(0<a.length&&0<=(b=a.indexOf("*"))&&b!=a.length-1)return this.error(14);a=a.toUpperCase();return this.generateResidueSpecCode(J.script.T.o(1048612,a));default:return a=this.theValue,this.tokPeekIs(269484209)&&(a=this.theValue+"*",this.getToken()),this.generateResidueSpecCode(J.script.T.o(1073741824,a))}},$fz.isPrivate=!0,$fz));$_M(c$,"clauseSequenceSpec",($fz=function(){var a=this.getSequenceCode(!1);if(null==a)return!1;
var b=this.tokPeek();return 269484192==b||2==b&&0>this.intPeek()?(269484192==b?this.tokenNext():(b=-this.intPeek(),this.tokenNext().intValue=b,this.returnToken()),a.tok=1048615,this.generateResidueSpecCode(a),this.addTokenToPostfixToken(this.getSequenceCode(!0))):this.generateResidueSpecCode(a)},$fz.isPrivate=!0,$fz));$_M(c$,"getSequenceCode",($fz=function(a){var b=2147483647,c=2147483647,d=this.tokPeek();if(5==d)b=this.tokenNext().intValue;else if(2==d)c=this.tokenNext().intValue;else if(!a)return null;
return J.script.T.tv(1048614,c,Integer.$valueOf(b))},$fz.isPrivate=!0,$fz),"~B");$_M(c$,"clauseChainSpec",($fz=function(a){if(269484066==a&&(this.tokenNext(),a=this.tokPeek(),this.isSpecTerminator(a)))return this.generateResidueSpecCode(J.script.T.tv(1048609,0,"spec_chain"));switch(a){case 269484209:return null!=this.getToken();case 2:this.getToken();a=this.theToken.intValue;if(0>a||9999<a)return this.error(8);a=this.viewer.getChainID(""+a);break;default:a=""+this.getToken().value;if(a.equals("?"))return!0;
a=this.viewer.getChainID(a)}return this.generateResidueSpecCode(J.script.T.tv(1048609,a,"spec_chain"))},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"isSpecTerminator",($fz=function(a){switch(a){case 0:case 269484208:case 269484128:case 269484112:case 269484144:case 269484080:case 269484210:case 269484049:case 1048590:return!0}return!1},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"clauseAlternateSpec",($fz=function(){this.tokenNext();var a=this.tokPeek();if(this.isSpecTerminator(a))return this.generateResidueSpecCode(J.script.T.o(1048607,
null));a=this.getToken().value;switch(this.theToken.tok){case 269484209:case 4:case 2:case 1073741824:break;default:return this.error(10)}return this.generateResidueSpecCode(J.script.T.o(1048607,a))},$fz.isPrivate=!0,$fz));$_M(c$,"clauseModelSpec",($fz=function(){this.getToken();if(this.tokPeekIs(269484209))return this.getToken(),!0;switch(this.tokPeek()){case 2:return this.generateResidueSpecCode(J.script.T.o(1048610,Integer.$valueOf(this.getToken().intValue)));case 3:return this.generateResidueSpecCode(J.script.T.tv(1048610,
this.fixModelSpec(this.getToken()),this.theValue));case 269484080:case 1048590:case 0:return this.generateResidueSpecCode(J.script.T.o(1048610,Integer.$valueOf(1)))}return this.error(10)},$fz.isPrivate=!0,$fz));$_M(c$,"fixModelSpec",($fz=function(a){a=a.intValue;if(2147483647==a){var b=this.theValue.floatValue();b==Clazz.floatToInt(b)&&(a=1E6*Clazz.floatToInt(b));0>a&&(a=2147483647)}return a},$fz.isPrivate=!0,$fz),"J.script.T");$_M(c$,"clauseAtomSpec",($fz=function(){if(!this.tokenNextTok(1048584))return this.error(7);
if(null==this.getToken())return!0;var a="";if(this.isToken(2)&&(a+=""+this.theToken.intValue,null==this.getToken()))return this.error(7);switch(this.theToken.tok){case 269484209:return!0}a+=""+this.theToken.value;this.tokPeekIs(269484209)&&(this.tokenNext(),a+="'");var b=J.viewer.JC.lookupSpecialAtomID(a.toUpperCase());return this.generateResidueSpecCode(J.script.T.tv(1048608,b,a))},$fz.isPrivate=!0,$fz));c$.errorString=$_M(c$,"errorString",function(a,b,c,d){var e=!1;!d&&!0==(e=J.i18n.GT.getDoTranslate())&&
J.i18n.GT.setDoTranslate(!1);switch(a){default:a="Unknown compiler error message number: "+a;break;case 0:a=J.i18n.GT._("bad argument count");break;case 1:a=J.i18n.GT._("invalid context for {0}");break;case 2:a=J.i18n.GT._("command expected");break;case 3:a=J.i18n.GT._("{ number number number } expected");break;case 4:a=J.i18n.GT._("unexpected end of script command");break;case 5:a=J.i18n.GT._("end of expression expected");break;case 6:a=J.i18n.GT._("identifier or residue specification expected");
break;case 7:a=J.i18n.GT._("invalid atom specification");break;case 8:a=J.i18n.GT._("invalid chain specification");break;case 9:a=J.i18n.GT._("invalid expression token: {0}");break;case 10:a=J.i18n.GT._("invalid model specification");break;case 11:a=J.i18n.GT._("missing END for {0}");break;case 12:a=J.i18n.GT._("number expected");break;case 13:a=J.i18n.GT._("number or variable name expected");break;case 14:a=J.i18n.GT._("residue specification (ALA, AL?, A*) expected");break;case 15:a=J.i18n.GT._("{0} expected");
break;case 16:a=J.i18n.GT._("{0} unexpected");break;case 17:a=J.i18n.GT._("unrecognized expression token: {0}");break;case 18:a=J.i18n.GT._("unrecognized {0} parameter");break;case 19:a=J.i18n.GT._("unrecognized token: {0}")}0>a.indexOf("{0}")?null!=b&&(a+=": "+b):(a=J.util.Txt.simpleReplace(a,"{0}",b),0<=a.indexOf("{1}")?a=J.util.Txt.simpleReplace(a,"{1}",c):null!=c&&(a+=": "+c));d||J.i18n.GT.setDoTranslate(e);return a},"~N,~S,~S,~B");$_M(c$,"commandExpected",function(){this.ichToken=this.ichCurrentCommand;
return this.error(2)});$_M(c$,"error",function(a){return this.errorIntStr2(a,null,null)},"~N");$_M(c$,"errorStr",function(a,b){return this.errorIntStr2(a,b,null)},"~N,~S");$_M(c$,"errorIntStr2",function(a,b,c){var d=J.script.ScriptCompilationTokenParser.errorString(a,b,c,!0);a=J.i18n.GT.getDoTranslate()?J.script.ScriptCompilationTokenParser.errorString(a,b,c,!1):null;return this.errorStr2(d,a)},"~N,~S,~S");$_M(c$,"isError",($fz=function(){return null!=this.errorMessage},$fz.isPrivate=!0,$fz));$_M(c$,
"errorStr2",function(a,b){this.errorMessage=a;this.errorMessageUntranslated=b;return!1},"~S,~S");Clazz.defineStatics(c$,"ERROR_badArgumentCount",0,"ERROR_badContext",1,"ERROR_commandExpected",2,"ERROR_endOfCommandUnexpected",4,"ERROR_invalidExpressionToken",9,"ERROR_missingEnd",11,"ERROR_tokenExpected",15,"ERROR_tokenUnexpected",16,"ERROR_unrecognizedParameter",18,"ERROR_unrecognizedToken",19,"ERROR_coordinateExpected",3,"ERROR_endOfExpressionExpected",5,"ERROR_identifierOrResidueSpecificationExpected",
6,"ERROR_invalidAtomSpecification",7,"ERROR_invalidChainSpecification",8,"ERROR_invalidModelSpecification",10,"ERROR_numberExpected",12,"ERROR_numberOrVariableNameExpected",13,"ERROR_residueSpecificationExpected",14,"ERROR_unrecognizedExpressionToken",17)});Clazz.declarePackage("J.script");
Clazz.load(null,"J.script.ScriptFlowContext",["J.script.ScriptCompiler"],function(){c$=Clazz.decorateAsClass(function(){this.token=this.compiler=null;this.ptDefault=this.pt0=0;this.parent=this.$var=this.$function=null;this.ptCommand=this.ptLine=this.commandStart=this.lineStart=0;this.forceEndIf=!0;this.ident=null;Clazz.instantialize(this,arguments)},J.script,"ScriptFlowContext");Clazz.makeConstructor(c$,function(a,b,c,d){this.compiler=a;this.token=b;this.ident=b.value;this.pt0=c;this.parent=d;this.lineStart=
this.ptLine=this.compiler.lineCurrent;this.commandStart=this.ptCommand=this.compiler.iCommand},"J.script.ScriptCompiler,J.script.ContextToken,~N,J.script.ScriptFlowContext");$_M(c$,"getBreakableContext",function(a){for(var b=this;null!=b&&(!J.script.ScriptCompiler.isBreakableContext(b.token.tok)||0<a--);)b=b.getParent();return b},"~N");$_M(c$,"checkForceEndIf",function(){var a=this.forceEndIf&&this.ptCommand<this.compiler.iCommand&&this.ptLine==this.compiler.lineCurrent;a&&(this.forceEndIf=!1);return a});
$_M(c$,"setPt0",function(a,b){this.pt0=a;b&&(this.ptDefault=a);this.setLine();return a},"~N,~B");$_M(c$,"setLine",function(){this.ptLine=this.compiler.lineCurrent;this.ptCommand=this.compiler.iCommand+1});Clazz.overrideMethod(c$,"toString",function(){return"ident "+this.ident+" line "+this.lineStart+" command "+this.commandStart});$_M(c$,"getParent",function(){return this.parent});$_M(c$,"path",function(){for(var a="",b=this;null!=b;)a=b.ident+"-"+a,b=b.parent;return"["+a+"]"});$_M(c$,"setFunction",
function(a){this.$function=a},"J.script.ScriptFunction")});Clazz.declarePackage("J.script");
Clazz.load(["J.api.JmolScriptFunction","java.util.Hashtable","JU.List"],"J.script.ScriptFunction",["JU.ArrayUtil","$.SB","J.script.SV","$.T"],function(){c$=Clazz.decorateAsClass(function(){this.chpt0=this.pt0=0;this.cmdpt0=-1;this.name=this.typeName=null;this.nParameters=0;this.names=null;this.tok=0;this.script=this.lineNumbers=this.lineIndices=this.aatoken=this.returnValue=this.variables=null;Clazz.instantialize(this,arguments)},J.script,"ScriptFunction",null,J.api.JmolScriptFunction);Clazz.prepareFields(c$,
function(){this.names=new JU.List;this.variables=new java.util.Hashtable});$_M(c$,"isVariable",function(a){return this.variables.containsKey(a)},"~S");Clazz.makeConstructor(c$,function(){});Clazz.makeConstructor(c$,function(a,b){this.set(a,b);this.typeName=J.script.T.nameOf(b)},"~S,~N");$_M(c$,"set",function(a,b){this.name=a;this.tok=b},"~S,~N");$_M(c$,"setVariables",function(a,b){for(var c=null==b?0:b.size(),d=this.names.size();0<=--d;){var e=this.names.get(d).toLowerCase(),f=d<this.nParameters&&
d<c?b.get(d):null;null!=f&&7!=f.tok&&(f=J.script.SV.newScriptVariableToken(f));a.put(e,null==f?J.script.SV.newVariable(4,"").setName(e):f)}a.put("_retval",J.script.SV.newScriptVariableInt(364558==this.tok?2147483647:0))},"java.util.Map,JU.List");$_M(c$,"unsetVariables",function(a,b){var c=null==b?0:b.size(),d=this.names.size();if(!(0==c||0==d))for(var e=0;e<d&&e<c;e++){var f=b.get(e);if(7==f.tok){var g=a.get(this.names.get(e).toLowerCase());7==g.tok&&(f.value=g.value)}}},"java.util.Map,JU.List");
$_M(c$,"addVariable",function(a,b){this.variables.put(a,a);this.names.addLast(a);b&&this.nParameters++},"~S,~B");c$.setFunction=$_M(c$,"setFunction",function(a,b,c,d,e,f,g){var h=a.cmdpt0,j=a.chpt0,l=d-h;a.setScript(b.substring(j,c));b=a.aatoken=Array(l);a.lineIndices=JU.ArrayUtil.newInt2(l);a.lineNumbers=Clazz.newShortArray(l,0);c=e[h]-1;for(var k=0;k<l;k++)if(a.lineNumbers[k]=e[h+k]-c,a.lineIndices[k]=[f[h+k][0]-j,f[h+k][1]-j],b[k]=g.get(h+k),0<b[k].length){var m=b[k][0];J.script.T.tokAttr(m.tok,
102400)&&(m.intValue-=0>m.intValue?-h:h)}for(k=d;--k>=h;)g.remove(k),f[k][0]=f[k][1]=0},"J.script.ScriptFunction,~S,~N,~N,~A,~A,JU.List");$_M(c$,"setScript",($fz=function(a){this.script=a;null!=this.script&&(""!==this.script&&!this.script.endsWith("\n"))&&(this.script+="\n")},$fz.isPrivate=!0,$fz),"~S");Clazz.overrideMethod(c$,"toString",function(){var a=(new JU.SB).append("/*\n * ").append(this.name).append("\n */\n").append(this.getSignature()).append("{\n");null!=this.script&&a.append(this.script);
a.append("}\n");return a.toString()});Clazz.overrideMethod(c$,"getSignature",function(){for(var a=(new JU.SB).append(this.typeName).append(" ").append(this.name).append(" ("),b=0;b<this.nParameters;b++)0<b&&a.append(", "),a.append(this.names.get(b));a.append(")");return a.toString()});Clazz.overrideMethod(c$,"geTokens",function(){return this.aatoken});Clazz.overrideMethod(c$,"getName",function(){return this.name});Clazz.overrideMethod(c$,"getTok",function(){return this.tok})});Clazz.declarePackage("J.script");
Clazz.load(["J.script.ScriptException"],"J.script.ScriptInterruption",null,function(){c$=Clazz.decorateAsClass(function(){this.willResume=!1;Clazz.instantialize(this,arguments)},J.script,"ScriptInterruption",J.script.ScriptException);Clazz.makeConstructor(c$,function(a,b,c){Clazz.superConstructor(this,J.script.ScriptInterruption,[a,b,"!",a.viewer.autoExit]);this.willResume=2147483647!=c;b.equals("delay")&&a.delayScript(c)},"J.script.ScriptEvaluator,~S,~N")});Clazz.declarePackage("J.script");
Clazz.load(null,"J.script.ScriptMathProcessor","java.lang.Float java.util.Arrays $.Hashtable JU.A4 $.ArrayUtil $.DecimalFormat $.List $.M3 $.M4 $.P3 $.P4 $.V3 J.modelset.Bond J.script.SV $.T J.util.BSUtil $.ColorUtil $.Escape $.Logger $.Quaternion $.Txt".split(" "),function(){c$=Clazz.decorateAsClass(function(){this.logMessages=this.wasSyntaxCheck=this.chk=!1;this.ifStack=this.xStack=this.oStack=this.viewer=this.eval=null;this.xPt=this.oPt=this.ifPt=-1;this.braceCount=this.squareCount=this.parenCount=
0;this.wasX=!1;this.incrementX=0;this.asBitSet=this.asVector=this.isArrayItem=!1;this.ptid=0;this.ptx=2147483647;this.haveSpaceBeforeSquare=this.skipping=!1;this.equalCount=0;Clazz.instantialize(this,arguments)},J.script,"ScriptMathProcessor");Clazz.prepareFields(c$,function(){this.oStack=Array(8);this.xStack=Array(8);this.ifStack=Clazz.newCharArray(8,"\x00")});Clazz.makeConstructor(c$,function(a,b,c,d){this.eval=a;this.viewer=a.viewer;this.logMessages=a.logMessages;this.chk=this.wasSyntaxCheck=a.chk;
this.isArrayItem=b;this.asVector=c||b;this.asBitSet=d;this.wasX=b;this.logMessages&&J.util.Logger.debug("initialize RPN")},"J.script.ScriptEvaluator,~B,~B,~B");$_M(c$,"getResult",function(a){for(var b=!0;b&&0<=this.oPt;)b=this.operate();if(b){if(this.asVector){a=new JU.List;for(b=0;b<=this.xPt;b++)a.addLast(J.script.SV.selectItemVar(this.xStack[b]));return J.script.SV.newVariable(135198,a)}if(0==this.xPt){a=this.xStack[0];if(10==a.tok||7==a.tok||4==a.tok||11==a.tok||12==a.tok)a=J.script.SV.selectItemVar(a);
this.asBitSet&&7==a.tok&&(a=J.script.SV.newVariable(10,J.script.SV.unEscapeBitSetArray(a.value,!1)));return a}}!a&&(0<=this.xPt||0<=this.oPt)&&this.eval.error(22);return null},"~B");$_M(c$,"putX",($fz=function(a){this.skipping||(++this.xPt==this.xStack.length&&(this.xStack=JU.ArrayUtil.doubleLength(this.xStack)),this.logMessages&&J.util.Logger.debug("\nputX: "+a),this.xStack[this.xPt]=a,this.ptx=++this.ptid)},$fz.isPrivate=!0,$fz),"J.script.SV");$_M(c$,"putOp",($fz=function(a){++this.oPt>=this.oStack.length&&
(this.oStack=JU.ArrayUtil.doubleLength(this.oStack));this.oStack[this.oPt]=a;this.ptid++},$fz.isPrivate=!0,$fz),"J.script.T");$_M(c$,"putIf",($fz=function(a){++this.ifPt>=this.ifStack.length&&(this.ifStack=JU.ArrayUtil.doubleLength(this.ifStack));this.ifStack[this.ifPt]=a},$fz.isPrivate=!0,$fz),"~S");$_M(c$,"addXVar",function(a){this.putX(a);return this.wasX=!0},"J.script.SV");$_M(c$,"addXObj",function(a){a=J.script.SV.getVariable(a);if(null==a)return!1;this.putX(a);return this.wasX=!0},"~O");$_M(c$,
"addXStr",function(a){this.putX(J.script.SV.newVariable(4,a));return this.wasX=!0},"~S");$_M(c$,"addXBool",function(a){this.putX(J.script.SV.getBoolean(a));return this.wasX=!0},"~B");$_M(c$,"addXInt",function(a){this.putX(J.script.SV.newScriptVariableInt(a));return this.wasX=!0},"~N");$_M(c$,"addXList",function(a){this.putX(J.script.SV.getVariableList(a));return this.wasX=!0},"JU.List");$_M(c$,"addXMap",function(a){this.putX(J.script.SV.getVariableMap(a));return this.wasX=!0},"java.util.Map");$_M(c$,
"addXM3",function(a){this.putX(J.script.SV.newVariable(11,a));return this.wasX=!0},"JU.M3");$_M(c$,"addXM4",function(a){this.putX(J.script.SV.newVariable(12,a));return this.wasX=!0},"JU.M4");$_M(c$,"addXFloat",function(a){if(Float.isNaN(a))return this.addXStr("NaN");this.putX(J.script.SV.newVariable(3,Float.$valueOf(a)));return this.wasX=!0},"~N");$_M(c$,"addXBs",function(a){this.putX(J.script.SV.newVariable(10,a));return this.wasX=!0},"JU.BS");$_M(c$,"addXPt",function(a){this.putX(J.script.SV.newVariable(8,
a));return this.wasX=!0},"JU.P3");$_M(c$,"addXPt4",function(a){this.putX(J.script.SV.newVariable(9,a));return this.wasX=!0},"JU.P4");$_M(c$,"addXNum",function(a){if(this.wasX)switch(a.tok){case 2:0>a.intValue&&(this.addOp(J.script.T.tokenMinus),a=J.script.SV.newScriptVariableInt(-a.intValue));break;case 3:var b=a.value.floatValue();if(0>b||0==b&&-Infinity==1/b)this.addOp(J.script.T.tokenMinus),a=J.script.SV.newVariable(3,Float.$valueOf(-b))}this.putX(a);return this.wasX=!0},"J.script.SV");$_M(c$,
"addXAV",function(a){this.putX(J.script.SV.getVariableAV(a));return this.wasX=!0},"~A");$_M(c$,"addXAD",function(a){this.putX(J.script.SV.getVariableAD(a));return this.wasX=!0},"~A");$_M(c$,"addXAS",function(a){this.putX(J.script.SV.getVariableAS(a));return this.wasX=!0},"~A");$_M(c$,"addXAI",function(a){this.putX(J.script.SV.getVariableAI(a));return this.wasX=!0},"~A");$_M(c$,"addXAII",function(a){this.putX(J.script.SV.getVariableAII(a));return this.wasX=!0},"~A");$_M(c$,"addXAF",function(a){this.putX(J.script.SV.getVariableAF(a));
return this.wasX=!0},"~A");$_M(c$,"addXAFF",function(a){this.putX(J.script.SV.getVariableAFF(a));return this.wasX=!0},"~A");c$.isOpFunc=$_M(c$,"isOpFunc",($fz=function(a){return J.script.T.tokAttr(a.tok,135266304)&&a!==J.script.T.tokenArraySquare||269484241==a.tok&&J.script.T.tokAttr(a.intValue,135266304)},$fz.isPrivate=!0,$fz),"J.script.T");$_M(c$,"addOp",function(a){return this.addOpAllowMath(a,!0)},"J.script.T");$_M(c$,"addOpAllowMath",function(a,b){this.logMessages&&J.util.Logger.debug("addOp entry\naddOp: "+
a);var c=0<=this.oPt?this.oStack[this.oPt].tok:0;if(this.skipping=0<=this.ifPt&&("F"==this.ifStack[this.ifPt]||"X"==this.ifStack[this.ifPt]))switch(a.tok){case 269484048:return this.putOp(a),!0;case 269484066:if(269484066!=c||"X"==this.ifStack[this.ifPt])return!0;this.ifStack[this.ifPt]="T";this.skipping=this.wasX=!1;return!0;case 269484049:if(269484048==c)return this.oPt--,!0;if(269484066!=c)return this.putOp(a),!0;this.wasX=!0;this.ifPt--;this.oPt-=2;this.skipping=!1;return!0;default:return!0}var d=
null,e=!1,f=269484241==a.tok;if(f&&!this.wasX)return!1;var g=b&&J.script.ScriptMathProcessor.isOpFunc(a);1<=this.oPt&&(269484048!=a.tok&&135266319==c)&&(c=this.oStack[--this.oPt].tok);var h=1<=this.oPt&&269484048==c;switch(a.tok){case 1073742195:return this.haveSpaceBeforeSquare=!0;case 269484080:if(!this.wasX)return!1;break;case 32:case 64:case 96:case 128:case 160:case 192:case 480:c=0>this.oPt?0:c;if(!this.wasX||!(269484241==c||1678770178==c||1141899265==c))return!1;this.oStack[this.oPt].intValue|=
a.tok;return!0;case 269484096:e=!0;if(!this.wasX||this.haveSpaceBeforeSquare)this.squareCount++,a=d=J.script.T.tokenArraySquare,this.haveSpaceBeforeSquare=!1;break;case 269484097:break;case 269484225:case 269484226:this.incrementX=269484226==a.tok?1:-1;if(this.ptid==this.ptx){if(this.chk)return!0;c=this.xStack[this.xPt];this.xStack[this.xPt]=J.script.SV.newVariable(4,"").setv(c,!1);return c.increment(this.incrementX)}break;case 269484192:if(this.wasX)break;this.addXInt(0);a=J.script.SV.newVariable(269484224,
"-");break;case 269484049:if(!this.wasX&&1<=this.oPt&&269484048==c&&!J.script.ScriptMathProcessor.isOpFunc(this.oStack[this.oPt-1]))return!1;break;case 269484144:case 269484048:e=!0;default:if(g){if(!f&&this.wasX&&!h)return!1;d=a;e=!0;break}if(this.wasX==e&&269484241!=c)return!1}for(;0<=this.oPt&&269484066!=c&&(!e||269484241==c&&(269484241==a.tok||269484096==a.tok))&&J.script.T.getPrecedence(c)>=J.script.T.getPrecedence(a.tok);){this.logMessages&&(J.util.Logger.debug("\noperating, oPt="+this.oPt+
" isLeftOp="+e+" oStack[oPt]="+J.script.T.nameOf(c)+"        prec="+J.script.T.getPrecedence(c)+' pending op="'+J.script.T.nameOf(a.tok)+'" prec='+J.script.T.getPrecedence(a.tok)),this.dumpStacks("operating"));if(269484049==a.tok&&269484048==c){0<=this.xPt&&(this.xStack[this.xPt]=J.script.SV.selectItemVar(this.xStack[this.xPt]));break}if(269484097==a.tok&&135266306==c)break;if(269484097==a.tok&&269484096==c){if(this.isArrayItem&&1==this.squareCount&&0==this.equalCount){this.addXVar(J.script.SV.newScriptVariableToken(J.script.T.tokenArraySelector));
break}if(!this.doBitsetSelect())return!1;break}if(!this.operate())return!1;c=0<=this.oPt?this.oStack[this.oPt].tok:0}null!=d&&this.addXVar(J.script.SV.newVariable(269484436,d));switch(a.tok){case 269484048:this.parenCount++;this.wasX=!1;break;case 806354977:return d=this.getX().asBoolean(),269484066==c?this.ifPt--:this.putOp(J.script.T.tokenColon),this.putIf(d?"T":"F"),this.skipping=!d,this.wasX=!1,!0;case 269484066:if(269484066!=c||0>this.ifPt)return!1;this.ifStack[this.ifPt]="X";this.wasX=!1;return this.skipping=
!0;case 269484049:this.wasX=!0;if(0>=this.parenCount--)return!1;269484066==c&&(this.ifPt--,this.oPt--);this.oPt--;if(0>this.oPt)return!0;if(J.script.ScriptMathProcessor.isOpFunc(this.oStack[this.oPt])&&!this.evaluateFunction(0))return!1;this.skipping=0<=this.ifPt&&"X"==this.ifStack[this.ifPt];return!0;case 269484080:return this.wasX=!1,!0;case 269484096:this.squareCount++;this.wasX=!1;break;case 269484097:this.wasX=!0;if(0>=this.squareCount--||0>this.oPt)return!1;if(135266306==this.oStack[this.oPt].tok)return this.evaluateFunction(269484096);
this.oPt--;return!0;case 269484241:this.wasX=!b||!J.script.T.tokAttr(a.intValue,135266304);break;case 1048586:this.braceCount++;this.wasX=!1;break;case 1048590:if(0>=this.braceCount--)return!1;this.wasX=!1;break;case 269484128:case 269484112:if(!this.wasSyntaxCheck&&0>this.xPt)return!1;!this.wasSyntaxCheck&&(10!=this.xStack[this.xPt].tok&&7!=this.xStack[this.xPt].tok)&&(c=this.getX().asBoolean(),this.addXVar(J.script.SV.getBoolean(c)),c==(269484112==a.tok)&&(this.chk=!0,a=269484112==a.tok?J.script.T.tokenOrTRUE:
J.script.T.tokenAndFALSE));this.wasX=!1;break;case 269484436:0==this.squareCount&&this.equalCount++;this.wasX=!1;break;default:this.wasX=!1}this.putOp(a);return 269484241==a.tok&&135368713==(a.intValue&-481)&&135368713!=a.intValue?this.evaluateFunction(0):!0},"J.script.T,~B");$_M(c$,"doBitsetSelect",($fz=function(){if(0>this.xPt||0==this.xPt&&!this.isArrayItem)return!1;var a=this.xStack[this.xPt--],b=this.xStack[this.xPt];7==b.tok&&(4==a.tok&&2147483647!=b.intValue)&&(b=J.script.SV.selectItemVar2(b,
-2147483648));if(6==b.tok)return b=b.mapValue(J.script.SV.sValue(a)),this.xStack[this.xPt]=null==b?J.script.SV.newVariable(4,""):b,!0;a=a.asInt();switch(b.tok){default:b=J.script.SV.newVariable(4,J.script.SV.sValue(b));case 10:case 7:case 4:case 11:case 12:this.xStack[this.xPt]=J.script.SV.selectItemVar2(b,a)}return!0},$fz.isPrivate=!0,$fz));$_M(c$,"dumpStacks",function(a){J.util.Logger.debug("\n\n------------------\nRPN stacks: "+a+"\n");for(a=0;a<=this.xPt;a++)J.util.Logger.debug("x["+a+"]: "+this.xStack[a]);
J.util.Logger.debug("\n");for(a=0;a<=this.oPt;a++)J.util.Logger.debug("o["+a+"]: "+this.oStack[a]+" prec="+J.script.T.getPrecedence(this.oStack[a].tok));J.util.Logger.debug(" ifStack = "+String.instantialize(this.ifStack).substring(0,this.ifPt+1))},"~S");$_M(c$,"getX",function(){0>this.xPt&&this.eval.error(13);var a=J.script.SV.selectItemVar(this.xStack[this.xPt]);this.xStack[this.xPt--]=null;return a});$_M(c$,"evaluateFunction",($fz=function(a){var b=this.oStack[this.oPt--];0==a&&(a=269484241==b.tok?
b.intValue&-481:b.tok);for(var c=J.script.T.getMaxMathParams(a),d=0,e=this.xPt;0<=e&&this.xStack[e--].value!==b;)d++;if(0<c&&d>c)return!1;for(c=Array(d);0<=--d;)c[d]=this.getX();this.xPt--;return!this.chk?this.eval.getExtension().evaluate(this,b,c,a):269484241==b.tok?!0:this.addXBool(!0)},$fz.isPrivate=!0,$fz),"~N");$_M(c$,"operate",($fz=function(){var a=this.oStack[this.oPt--],b,c;this.logMessages&&this.dumpStacks("operate: "+a);if(this.isArrayItem&&0==this.squareCount&&1==this.equalCount&&0>this.oPt&&
269484436==a.tok)return!0;var d=this.getX();if(d===J.script.T.tokenArraySelector)return!1;if(7==d.tok||11==d.tok||12==d.tok)d=J.script.SV.selectItemVar(d);if(269484225==a.tok||269484226==a.tok){if(!this.chk&&!d.increment(this.incrementX))return!1;this.wasX=!0;this.putX(d);return!0}if(269484144==a.tok){if(this.chk)return this.addXBool(!0);switch(d.tok){case 9:return this.addXPt4(J.util.Quaternion.newP4(d.value).inv().toPoint4f());case 11:return c=JU.M3.newM(d.value),c.invert(),this.addXM3(c);case 12:return c=
JU.M4.newM(d.value),c.invert(),this.addXM4(c);case 10:return this.addXBs(J.util.BSUtil.copyInvert(J.script.SV.bsSelectVar(d),Clazz.instanceOf(d.value,J.modelset.Bond.BondSet)?this.viewer.getBondCount():this.viewer.getAtomCount()));default:return this.addXBool(!d.asBoolean())}}c=a.intValue&-481;if(269484241==a.tok){switch(c){case 1073741824:return this.getAllProperties(d,a.value);case 1141899267:case 1276117011:case 1141899270:if(1141899267==c&&Clazz.instanceOf(d.value,J.modelset.Bond.BondSet))break;
return this.addXInt(J.script.SV.sizeOf(d));case 1141899272:return this.addXStr(J.script.ScriptMathProcessor.typeOf(d));case 1141899281:if(6!=d.tok)return this.addXStr("");d=d.value.keySet();d=d.toArray(Array(d.size()));java.util.Arrays.sort(d);return this.addXAS(d);case 1141899268:switch(d.tok){case 11:case 12:b=J.script.SV.sValue(d);b=J.util.Txt.simpleReplace(b.substring(1,b.length-1),"],[","]\n[");break;case 4:b=d.value;break;default:b=J.script.SV.sValue(d)}b=J.util.Txt.simpleReplace(b,"\n\r","\n").$replace("\r",
"\n");return this.addXAS(J.util.Txt.split(b,"\n"));case 1766856708:switch(d.tok){case 4:case 7:return b=J.script.SV.sValue(d),a=new JU.P3,this.addXPt(J.util.ColorUtil.colorPointFromString(b,a));case 2:case 3:return this.addXPt(this.viewer.getColorPointForPropertyValue(J.script.SV.fValue(d)));case 8:return this.addXStr(J.util.Escape.escapeColor(J.util.ColorUtil.colorPtToInt(d.value)))}break;case 1679429641:return this.chk?this.addXStr("x"):this.getBoundBox(d)}if(this.chk)return this.addXStr(J.script.SV.sValue(d));
if(4==d.tok&&(d=J.script.SV.unescapePointOrBitsetAsVariable(J.script.SV.sValue(d)),!Clazz.instanceOf(d,J.script.SV)))return!1;a.tok==d.tok&&(d=this.getX());return this.getPointOrBitsetOperation(a,d)}c=this.getX();if(this.chk){if(a===J.script.T.tokenAndFALSE||a===J.script.T.tokenOrTRUE)this.chk=!1;return this.addXVar(J.script.SV.newScriptVariableToken(c))}switch(a.tok){case 269484160:case 269484128:switch(c.tok){case 10:switch(a=J.script.SV.bsSelectVar(c),d.tok){case 10:return a=J.util.BSUtil.copy(a),
a.and(J.script.SV.bsSelectVar(d)),this.addXBs(a);case 2:var e=d.asInt();return this.addXBool(0>e?!1:a.get(e))}}return this.addXBool(c.asBoolean()&&d.asBoolean());case 269484112:switch(c.tok){case 10:a=J.util.BSUtil.copy(J.script.SV.bsSelectVar(c));switch(d.tok){case 10:return a.or(J.script.SV.bsSelectVar(d)),this.addXBs(a);case 2:e=d.asInt();if(0>e)break;a.set(e);return this.addXBs(a);case 7:e=d.value;for(d=e.size();0<=--d;)c=e.get(d).asInt(),0<=c&&a.set(c);return this.addXBs(a)}break;case 7:return this.addXVar(J.script.SV.concatList(c,
d,!1))}return this.addXBool(c.asBoolean()||d.asBoolean());case 269484113:if(10==c.tok&&10==d.tok)return a=J.util.BSUtil.copy(J.script.SV.bsSelectVar(c)),a.xor(J.script.SV.bsSelectVar(d)),this.addXBs(a);a=c.asBoolean();c=d.asBoolean();return this.addXBool(a&&!c||c&&!a);case 269484114:return 10!=c.tok||10!=d.tok?!1:this.addXBs(J.util.BSUtil.toggleInPlace(J.util.BSUtil.copy(J.script.SV.bsSelectVar(c)),J.script.SV.bsSelectVar(d)));case 269484434:return this.addXBool(c.asFloat()<=d.asFloat());case 269484433:return this.addXBool(c.asFloat()>=
d.asFloat());case 269484432:return this.addXBool(c.asFloat()>d.asFloat());case 269484435:return this.addXBool(c.asFloat()<d.asFloat());case 269484436:return this.addXBool(J.script.SV.areEqual(c,d));case 269484438:return this.addXBool(!J.script.SV.areEqual(c,d));case 269484193:switch(c.tok){default:return this.addXFloat(c.asFloat()+d.asFloat());case 7:return this.addXVar(J.script.SV.concatList(c,d,!0));case 2:switch(d.tok){case 4:if(0>(b=J.script.SV.sValue(d).trim()).indexOf(".")&&0>=b.indexOf("+")&&
0>=b.lastIndexOf("-"))break;break;case 3:return this.addXFloat(c.intValue+d.asFloat())}return this.addXInt(c.intValue+d.asInt());case 4:return this.addXVar(J.script.SV.newVariable(4,J.script.SV.sValue(c)+J.script.SV.sValue(d)));case 9:switch(c=J.util.Quaternion.newP4(c.value),d.tok){default:return this.addXPt4(c.add(d.asFloat()).toPoint4f());case 9:return this.addXPt4(c.mulQ(J.util.Quaternion.newP4(d.value)).toPoint4f())}case 8:switch(a=JU.P3.newP(c.value),d.tok){case 8:return a.add(d.value),this.addXPt(a);
case 9:return b=d.value,a.add(JU.P3.new3(b.x,b.y,b.z)),this.addXPt(a);default:return b=d.asFloat(),this.addXPt(JU.P3.new3(a.x+b,a.y+b,a.z+b))}case 11:switch(d.tok){default:return this.addXFloat(c.asFloat()+d.asFloat());case 11:return c=JU.M3.newM(c.value),c.add(d.value),this.addXM3(c);case 8:return this.addXM4(J.script.ScriptMathProcessor.getMatrix4f(c.value,d.value))}}case 269484192:if(2==c.tok)if(4==d.tok){if(0>(b=J.script.SV.sValue(d).trim()).indexOf(".")&&0>=b.indexOf("+")&&0>=b.lastIndexOf("-"))return this.addXInt(c.intValue-
d.asInt())}else if(3!=d.tok)return this.addXInt(c.intValue-d.asInt());if(4==c.tok&&2==d.tok&&0>(b=J.script.SV.sValue(c).trim()).indexOf(".")&&0>=b.indexOf("+")&&0>=b.lastIndexOf("-"))return this.addXInt(c.asInt()-d.intValue);switch(c.tok){default:return this.addXFloat(c.asFloat()-d.asFloat());case 6:return c=new java.util.Hashtable(c.value),c.remove(J.script.SV.sValue(d)),this.addXVar(J.script.SV.getVariableMap(c));case 11:switch(d.tok){default:return this.addXFloat(c.asFloat()-d.asFloat());case 11:return c=
JU.M3.newM(c.value),c.sub(d.value),this.addXM3(c)}case 12:switch(d.tok){default:return this.addXFloat(c.asFloat()-d.asFloat());case 12:return c=JU.M4.newM(c.value),c.sub(d.value),this.addXM4(c)}case 8:switch(a=JU.P3.newP(c.value),d.tok){default:return b=d.asFloat(),this.addXPt(JU.P3.new3(a.x-b,a.y-b,a.z-b));case 8:return a.sub(d.value),this.addXPt(a);case 9:return b=d.value,a.sub(JU.P3.new3(b.x,b.y,b.z)),this.addXPt(a)}case 9:switch(c=J.util.Quaternion.newP4(c.value),d.tok){default:return this.addXPt4(c.add(-d.asFloat()).toPoint4f());
case 9:return d=J.util.Quaternion.newP4(d.value),this.addXPt4(d.mulQ(c.inv()).toPoint4f())}}case 269484224:switch(d.tok){default:return this.addXFloat(-d.asFloat());case 2:return this.addXInt(-d.asInt());case 8:return a=JU.P3.newP(d.value),a.scale(-1),this.addXPt(a);case 9:return b=JU.P4.newPt(d.value),b.scale(-1),this.addXPt4(b);case 11:return c=JU.M3.newM(d.value),c.transpose(),this.addXM3(c);case 12:return c=JU.M4.newM(d.value),c.transpose(),this.addXM4(c);case 10:return this.addXBs(J.util.BSUtil.copyInvert(J.script.SV.bsSelectVar(d),
Clazz.instanceOf(d.value,J.modelset.Bond.BondSet)?this.viewer.getBondCount():this.viewer.getAtomCount()))}case 269484209:if(2==c.tok&&3!=d.tok)return this.addXInt(c.intValue*d.asInt());a=11==c.tok?this.ptValue(d,!1):11==d.tok?this.ptValue(c,!1):null;b=12==c.tok?this.planeValue(d):12==d.tok?this.planeValue(c):null;switch(d.tok){case 11:if(null!=a)return d=JU.M3.newM(d.value),d.transpose(),d.transform(a),7==c.tok?this.addXVar(J.script.SV.getVariableAF([a.x,a.y,a.z])):this.addXPt(a);if(null!=b)return this.addXPt4(J.util.Quaternion.newP4(b).mulQ(J.util.Quaternion.newM(d.value)).toPoint4f());
break;case 12:if(null!=b)return d=JU.M4.newM(d.value),d.transpose(),d.transform4(b),7==c.tok?this.addXVar(J.script.SV.getVariableAF([b.x,b.y,b.z,b.w])):this.addXPt4(b)}switch(c.tok){default:return this.addXFloat(c.asFloat()*d.asFloat());case 11:e=c.value;if(null!=a)return e.transform(a),7==d.tok?this.addXVar(J.script.SV.getVariableAF([a.x,a.y,a.z])):this.addXPt(a);switch(d.tok){case 11:return c=JU.M3.newM(d.value),c.mul2(e,c),this.addXM3(c);case 9:return this.addXM3(J.util.Quaternion.newM(e).mulQ(J.util.Quaternion.newP4(d.value)).getMatrix());
default:return b=d.asFloat(),d=new JU.A4,d.setM(e),d.angle*=b,c=new JU.M3,c.setAA(d),this.addXM3(c)}case 12:c=c.value;if(null!=a)return c.transform(a),7==d.tok?this.addXVar(J.script.SV.getVariableAF([a.x,a.y,a.z])):this.addXPt(a);if(null!=b)return c.transform4(b),7==d.tok?this.addXVar(J.script.SV.getVariableAF([b.x,b.y,b.z,b.w])):this.addXPt4(b);switch(d.tok){case 12:return d=JU.M4.newM(d.value),d.mul2(c,d),this.addXM4(d);default:return this.addXStr("NaN")}case 8:switch(a=JU.P3.newP(c.value),d.tok){case 8:return d=
d.value,this.addXFloat(a.x*d.x+a.y*d.y+a.z*d.z);default:return b=d.asFloat(),this.addXPt(JU.P3.new3(a.x*b,a.y*b,a.z*b))}case 9:switch(d.tok){case 9:return this.addXPt4(J.util.Quaternion.newP4(c.value).mulQ(J.util.Quaternion.newP4(d.value)).toPoint4f())}return this.addXPt4(J.util.Quaternion.newP4(c.value).mul(d.asFloat()).toPoint4f())}case 269484210:switch(b=null,e=d.asInt(),c.tok){default:return 0==e?this.addXInt(0):this.addXInt(c.asInt()%e);case 3:b=c.asFloat();if(0==e)return this.addXInt(Math.round(b));
b=JU.DecimalFormat.formatDecimal(b,e);return this.addXStr(b);case 4:return b=c.value,0==e?this.addXStr(J.util.Txt.trim(b,"\n\t ")):9999==e?this.addXStr(b.toUpperCase()):-9999==e?this.addXStr(b.toLowerCase()):0<e?this.addXStr(J.util.Txt.formatS(b,e,e,!1,!1)):this.addXStr(J.util.Txt.formatS(b,e,e-1,!0,!1));case 7:c=J.script.SV.listValue(c);for(d=0;d<c.length;d++)c[d]=0==e?c[d].trim():0<e?J.util.Txt.formatS(c[d],e,e,!0,!1):J.util.Txt.formatS(b,-e,e,!1,!1);return this.addXAS(c);case 8:return a=JU.P3.newP(c.value),
this.viewer.toUnitCell(a,JU.P3.new3(e,e,e)),this.addXPt(a);case 9:b=c.value;if(8==d.tok)return this.addXPt(J.util.Quaternion.newP4(b).transformPt(d.value));if(9==d.tok)return d=JU.P4.newPt(d.value),J.util.Quaternion.newP4(b).getThetaDirected(d),this.addXPt4(d);switch(e){case 0:return this.addXFloat(b.w);case 1:return this.addXFloat(b.x);case 2:return this.addXFloat(b.y);case 3:return this.addXFloat(b.z)}d=J.util.Quaternion.newP4(b);switch(e){case 4:return this.addXPt(JU.P3.newP(d.getNormal()));case 5:return this.addXAF(d.getEulerZXZ());
case 6:return this.addXAF(d.getEulerZYZ());case -1:return this.addXPt(JU.P3.newP(d.getVector(-1)));case -2:return this.addXFloat(d.getTheta());case -3:return this.addXPt(JU.P3.newP(d.getVector(0)));case -4:return this.addXPt(JU.P3.newP(d.getVector(1)));case -5:return this.addXPt(JU.P3.newP(d.getVector(2)));case -6:return d=d.toAxisAngle4f(),this.addXPt4(JU.P4.new4(d.x,d.y,d.z,180*d.angle/3.141592653589793));case -9:return this.addXM3(d.getMatrix());default:return this.addXPt4(b)}case 12:switch(c=
c.value,e){case 1:return e=new JU.M3,c.getRotationScale(e),this.addXM3(e);case 2:return d=new JU.V3,c.get(d),this.addXPt(JU.P3.newP(d));default:return!1}case 10:return this.addXBs(J.script.SV.bsSelectRange(c,e))}case 269484208:if(2==c.tok&&2==d.tok&&0!=d.intValue)return this.addXInt(Clazz.doubleToInt(c.intValue/d.intValue));e=d.asFloat();switch(c.tok){default:return d=c.asFloat(),this.addXFloat(d/e);case 8:return a=JU.P3.newP(c.value),0==e?this.addXPt(JU.P3.new3(NaN,NaN,NaN)):this.addXPt(JU.P3.new3(a.x/
e,a.y/e,a.z/e));case 9:return 9==d.tok?this.addXPt4(J.util.Quaternion.newP4(c.value).div(J.util.Quaternion.newP4(d.value)).toPoint4f()):0==e?this.addXPt4(JU.P4.new4(NaN,NaN,NaN,NaN)):this.addXPt4(J.util.Quaternion.newP4(c.value).mul(1/e).toPoint4f())}case 269484211:switch(b=d.asFloat(),c.tok){default:return this.addXInt(0==b?0:Clazz.doubleToInt(Math.floor(c.asFloat()/d.asFloat())));case 9:return 0==b?this.addXPt4(JU.P4.new4(NaN,NaN,NaN,NaN)):9==d.tok?this.addXPt4(J.util.Quaternion.newP4(c.value).divLeft(J.util.Quaternion.newP4(d.value)).toPoint4f()):
this.addXPt4(J.util.Quaternion.newP4(c.value).mul(1/b).toPoint4f())}case 269484227:return b=Math.pow(c.asFloat(),d.asFloat()),2==c.tok&&2==d.tok?this.addXInt(Clazz.floatToInt(b)):this.addXFloat(b)}return!0},$fz.isPrivate=!0,$fz));$_M(c$,"ptValue",function(a,b){var c;if(this.chk)return new JU.P3;switch(a.tok){case 8:return a.value;case 10:return this.eval.getBitsetProperty(J.script.SV.bsSelectVar(a),1146095626,null,null,a.value,null,!1,2147483647,!1);case 4:c=J.util.Escape.uP(J.script.SV.sValue(a));
if(Clazz.instanceOf(c,JU.P3))return c;break;case 7:if(c=J.util.Escape.uP("{"+J.script.SV.sValue(a)+"}"),Clazz.instanceOf(c,JU.P3))return c}if(!b)return null;c=J.script.SV.fValue(a);return JU.P3.new3(c,c,c)},"J.script.SV,~B");$_M(c$,"planeValue",function(a){if(this.chk)return new JU.P4;switch(a.tok){case 9:return a.value;case 7:case 4:return a=J.util.Escape.uP(J.script.SV.sValue(a)),Clazz.instanceOf(a,JU.P4)?a:null}return null},"J.script.T");c$.typeOf=$_M(c$,"typeOf",($fz=function(a){var b=null==a?
0:a.tok;switch(b){case 1048589:case 1048588:return"boolean";case 10:return Clazz.instanceOf(a.value,J.modelset.Bond.BondSet)?"bondset":"bitset";case 2:case 3:case 8:case 9:case 4:case 7:case 6:case 11:case 12:return J.script.T.astrType[b]}return"?"},$fz.isPrivate=!0,$fz),"J.script.SV");$_M(c$,"getAllProperties",($fz=function(a,b){if(10!=a.tok)return!1;if(this.chk)return this.addXStr("");var c=J.script.SV.bsSelectVar(a),d,e=c.cardinality();if(0==e||null==(d=J.script.T.getAtomPropertiesLike(b.substring(0,
b.length-1))))return this.addXStr("");for(var f=new java.util.Hashtable,e=1==e?c.nextSetBit(0):2147483647,g=d.size();0<=--g;){var h=d.get(g),j=h.tok;switch(j){case 1095766022:case 1095761925:continue;default:2147483647==e&&(j|=480),f.put(h.value,J.script.SV.getVariable(this.eval.getBitsetProperty(c,j,null,null,null,null,!1,e,!0)))}}return this.addXMap(f)},$fz.isPrivate=!0,$fz),"J.script.SV,~S");c$.getMatrix4f=$_M(c$,"getMatrix4f",function(a,b){return JU.M4.newMV(a,null==b?new JU.V3:JU.V3.newV(b))},
"JU.M3,JU.T3");$_M(c$,"getBoundBox",($fz=function(a){if(10!=a.tok)return!1;if(this.chk)return this.addXStr("");a=this.viewer.getBoxInfo(J.script.SV.bsSelectVar(a),1).getBoundBoxPoints(!0);for(var b=new JU.List,c=0;4>c;c++)b.addLast(a[c]);return this.addXList(b)},$fz.isPrivate=!0,$fz),"J.script.SV");$_M(c$,"getPointOrBitsetOperation",($fz=function(a,b){switch(b.tok){case 7:switch(a.intValue){case 32:case 64:case 96:case 192:case 128:case 160:return this.addXObj(this.eval.getExtension().getMinMax(b.getList(),
a.intValue));case 1276117010:case 1141899269:return this.addXVar(b.sortOrReverse(1141899269==a.intValue?-2147483648:1))}for(var c=Array(b.getList().size()),d=0;d<c.length;d++){var e=J.script.SV.unescapePointOrBitsetAsVariable(b.getList().get(d));if(!Clazz.instanceOf(e,J.script.SV)||!this.getPointOrBitsetOperation(a,e))return!1;c[d]=this.xStack[this.xPt--]}return this.addXAV(c);case 8:switch(a.intValue){case 1112541185:case 1112541205:return this.addXFloat(b.value.x);case 1112541186:case 1112541206:return this.addXFloat(b.value.y);
case 1112541187:case 1112541207:return this.addXFloat(b.value.z);case 1146095626:return c=JU.P3.newP(b.value),this.viewer.toCartesian(c,!0),this.addXPt(c);case 1112541188:case 1112541189:case 1112541190:case 1146095627:return c=JU.P3.newP(b.value),this.viewer.toFractional(c,!0),1146095627==a.intValue?this.addXPt(c):this.addXFloat(1112541188==a.intValue?c.x:1112541189==a.intValue?c.y:c.z);case 1112541191:case 1112541192:case 1112541193:case 1146095629:return c=JU.P3.newP(b.value),this.viewer.toFractional(c,
!1),1146095627==a.intValue?this.addXPt(c):this.addXFloat(1112541191==a.intValue?c.x:1112541192==a.intValue?c.y:c.z);case 1112539153:case 1112539154:case 1112539155:case 1146093582:return c=JU.P3.newP(b.value),this.viewer.toUnitCell(c,null),this.viewer.toFractional(c,!1),1146093582==a.intValue?this.addXPt(c):this.addXFloat(1112539153==a.intValue?c.x:1112539154==a.intValue?c.y:c.z)}break;case 9:switch(a.intValue){case 1112541185:case 1112541205:return this.addXFloat(b.value.x);case 1112541186:case 1112541206:return this.addXFloat(b.value.y);
case 1112541187:case 1112541207:return this.addXFloat(b.value.z);case 1141899280:return this.addXFloat(b.value.w)}break;case 10:if(1678770178==a.intValue&&Clazz.instanceOf(b.value,J.modelset.Bond.BondSet))return this.addXVar(b);c=J.script.SV.bsSelectVar(b);1==c.cardinality()&&0==(a.intValue&480)&&(a.intValue|=32);d=this.eval.getBitsetProperty(c,a.intValue,null,null,b.value,a.value,!1,b.index,!0);return 1678770178!=a.intValue?this.addXObj(d):this.addXVar(J.script.SV.newVariable(10,new J.modelset.Bond.BondSet(d,
this.viewer.getAtomIndices(c))))}return!1},$fz.isPrivate=!0,$fz),"J.script.T,J.script.SV");$_M(c$,"evalOp",function(a){return!this.addOp(a)||!this.operate()?null:this.xStack[this.xPt--]},"J.script.T")});
