|
|
- "use strict";window.module=function(t){if(""===t)return window;var i=t.split("."),r=i.pop(),s=module(i.join(".")),e=s[r];return e||(s[r]=e={loaded:!1,pending:[],requires:function(t){return{toRun:function(r){function i(){r(),e.loaded=!0,e.pending.forEach(function(e){e()})}t&&!module(t).loaded?module(t).pending.push(i):i()}}}}),e},Object.extend=function(i){for(var e=1;e<arguments.length;e++)if("object"==typeof arguments[e])for(var t in arguments[e])i[t]=arguments[e][t]},Function.prototype.subclass=function(s){var e=function(){return this.initialize&&this.initialize.apply(this,arguments),this},i=function(){};i.prototype=this.prototype,e.prototype=new i;for(var t=1;t<arguments.length;t++)Object.extend(e.prototype,arguments[t]);var r=s.split("."),n=r.pop();return module(r.join("."))[n]=e,e},function(){var e=document.getElementsByTagName("script"),t=e[e.length-1],i=t.src.replace(/[^\/]*$/,"");t.src.match(/squeak\.min\.js$/)||["vm.js","jit.js","plugins/ADPCMCodecPlugin.js","plugins/B2DPlugin.js","plugins/BitBltPlugin.js","plugins/FFTPlugin.js","plugins/FloatArrayPlugin.js","plugins/GeniePlugin.js","plugins/JPEGReaderPlugin.js","plugins/KedamaPlugin.js","plugins/KedamaPlugin2.js","plugins/Klatt.js","plugins/LargeIntegers.js","plugins/Matrix2x3Plugin.js","plugins/MiscPrimitivePlugin.js","plugins/ScratchPlugin.js","plugins/SoundGenerationPlugin.js","plugins/StarSqueakPlugin.js","plugins/ZipPlugin.js","lib/lz-string.js"].forEach(function(t){var e=document.createElement("script");e.setAttribute("type","text/javascript"),e.setAttribute("src",i+t),document.getElementsByTagName("head")[0].appendChild(e)})}(),module("SqueakJS").requires("users.bert.SqueakJS.vm").toRun(function(){function v(i,l,e){function a(r){i.fullscreen=r,t.style.background=r?"black":"",e.header&&(e.header.style.display=r?"none":""),e.footer&&(e.footer.style.display=r?"none":""),e.fullscreenCheckbox&&(e.fullscreenCheckbox.checked=r),setTimeout(window.onresize,0)}var t=l.parentElement,o="fullscreenchange",s="fullscreenElement",u="fullscreenEnabled";t.requestFullscreen||[{req:t.webkitRequestFullscreen,exit:document.webkitExitFullscreen,evt:"webkitfullscreenchange",elem:"webkitFullscreenElement",enable:"webkitFullscreenEnabled"},{req:t.mozRequestFullScreen,exit:document.mozCancelFullScreen,evt:"mozfullscreenchange",elem:"mozFullScreenElement",enable:"mozFullScreenEnabled"},{req:t.msRequestFullscreen,exit:document.msExitFullscreen,evt:"MSFullscreenChange",elem:"msFullscreenElement",enable:"msFullscreenEnabled"}].forEach(function(e){e.req&&(t.requestFullscreen=e.req,document.exitFullscreen=e.exit,o=e.evt,s=e.elem,u=e.enable)});var r;if(t.requestFullscreen)document.addEventListener(o,function(){a(t==document[s])}),r=function(){document[u]&&t==document[s]!=i.fullscreen&&(i.fullscreen?t.requestFullscreen():document.exitFullscreen())};else{var n=!1;r=function(){(e.header||e.footer)&&n!=i.fullscreen&&(n=i.fullscreen,a(n))}}return e.fullscreenCheckbox&&(e.fullscreenCheckbox.onclick=function(){i.fullscreen=e.fullscreenCheckbox.checked,r()}),r}function c(e){if(e.swapCheckbox){var r=t.squeakImageName||"default",i=JSON.parse(t["squeakSettings:"+r]||"{}");"swapButtons"in i&&(e.swapButtons=i.swapButtons),e.swapCheckbox.checked=e.swapButtons,e.swapCheckbox.onclick=function(){e.swapButtons=e.swapCheckbox.checked,i.swapButtons=e.swapButtons,t["squeakSettings:"+r]=JSON.stringify(i)}}}function n(e,t){var r=e.shiftKey,s=e.ctrlKey&&!e.altKey,n=e.metaKey||e.altKey&&!e.ctrlKey,i=(r?Squeak.Keyboard_Shift:0)+(s?Squeak.Keyboard_Ctrl:0)+(n?Squeak.Keyboard_Cmd:0);return t.buttons=t.buttons&~Squeak.Keyboard_All|i,i}function l(i,t,e){var r=u?i.offsetX:i.layerX,s=u?i.offsetY:i.layerY;e.cursorCanvas.style.left=r+t.offsetLeft+e.cursorOffsetX+"px",e.cursorCanvas.style.top=s+t.offsetTop+e.cursorOffsetY+"px";var n=r*t.width/t.offsetWidth|0,a=s*t.height/t.offsetHeight|0;e.mouseX=Math.max(0,Math.min(e.width,n)),e.mouseY=Math.max(0,Math.min(e.height,a))}function e(r,i,a,e,s,o){if(l(i,a,e),e.vm){var t=e.buttons&Squeak.Mouse_All;switch(r){case"mousedown":switch(i.button||0){case 0:t=Squeak.Mouse_Red;break;cas
- }return this.audioOutContext},startAudioIn:function(e,t){return this.audioInContext?(this.audioInSource.disconnect(),e(this.audioInContext,this.audioInSource)):(navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia,navigator.getUserMedia?void navigator.getUserMedia({audio:!0,toString:function(){return"audio"}},function(i){var t=window.AudioContext||window.webkitAudioContext||window.mozAudioContext||window.msAudioContext;this.audioInContext=t&&new t,this.audioInSource=this.audioInContext.createMediaStreamSource(i),e(this.audioInContext,this.audioInSource)},function(){t("cannot access microphone")}):t("test: audio input not supported"))},stopAudio:function(){this.audioInSource&&this.audioInSource.disconnect()}},"time",{Epoch:Date.UTC(1901,0,1)+6e4*(new Date).getTimezoneOffset(),EpochUTC:Date.UTC(1901,0,1),totalSeconds:function(){return Math.floor((Date.now()-Squeak.Epoch)/1e3)}},"utils",{bytesAsString:function(t){for(var i=[],e=0;e<t.length;e++)i.push(String.fromCharCode(t[e]));return i.join("")}}),Object.subclass("Squeak.Image","about",{about:function(){}},"initializing",{initialize:function(e){this.totalMemory=1e8,this.name=e,this.gcCount=0,this.gcTenured=0,this.gcMilliseconds=0,this.allocationCount=0,this.oldSpaceCount=0,this.newSpaceCount=0,this.hasNewInstances={}},readFromBuffer:function(k,d,b){function O(){if(c){for(var e=v+(a.oldSpaceCount/10|0);c&&e>v;)c.installFromImage(i,q,M,l,N),c=c.nextObject,v++;return b&&b(v/a.oldSpaceCount),!0}return a.specialObjectsArray=g,a.decorateKnownObjects(),a.fixCompiledMethods(),a.fixCompactOops(),!1}function w(){O()?window.setTimeout(w,0):d&&d()}console.log("squeak: reading "+this.name+" ("+k.byteLength+" bytes)"),this.startupTime=Date.now();for(var j=new DataView(k),l=!1,s=0,e=function(){var e=j.getUint32(s,l);return s+=4,e},_=function(t,r){if(5>r){for(var i=[];i.length<t;)i.push(e());return i}var n=new Uint32Array(k,s,t);return s+=4*t,n},B=[6501,6502,6504,6505,68e3,68002,68003],o=0,m=0;;){if(l=!l,s=m,o=e(),B.indexOf(o)>=0)break;if(l||(m+=512),m>512)throw Error("bad image version")}this.version=o;var N=[6505,68003].indexOf(o)>=0;if(this.hasClosures=[6504,6505,68002,68003].indexOf(o)>=0,o>=68e3)throw Error("64 bit images not supported yet");var A=e(),P=e(),p=e(),S=e();this.lastHash=e();e(),e(),e();s+=A-36;for(var n,i={},y=m+A;y+P>s;){var h=0,u=0,r=e();switch(r&Squeak.HeaderTypeMask){case Squeak.HeaderTypeSizeAndClass:h=r>>2,u=e(),r=e();break;case Squeak.HeaderTypeClass:u=r-Squeak.HeaderTypeClass,r=e(),h=r>>2&63;break;case Squeak.HeaderTypeShort:h=r>>2&63,u=r>>12&31;break;case Squeak.HeaderTypeFree:throw Error("Unexpected free block")}h--;var I=s-4-y,F=r>>8&15,x=r>>17&4095,C=_(h,F),t=new Squeak.Object;t.initFromImage(I,u,F,x,C),32>u&&(t.hash|=268435456),n&&(n.nextObject=t),this.oldSpaceCount++,n=t,i[p+I]=t}this.firstOldObject=i[p+4],this.lastOldObject=t,this.oldSpaceBytes=P;var V=i[i[S].bits[Squeak.splOb_CompactClasses]].bits,f=null;for(t=this.firstOldObject,n=null;t;)n=f,f=t.renameFromImage(i,V),n&&(n.nextObject=f),i[p+t.oop]=f,t=t.nextObject;this.firstOldObject=i[p+4],this.lastOldObject=f;var g=i[S],q=i[g.bits[Squeak.splOb_CompactClasses]].bits,M=i[g.bits[Squeak.splOb_ClassFloat]],c=this.firstOldObject,v=0,a=this;if(b)window.setTimeout(w,0);else{for(;O(););d&&d()}},decorateKnownObjects:function(){var e=this.specialObjectsArray.pointers;e[Squeak.splOb_NilObject].isNil=!0,e[Squeak.splOb_TrueObject].isTrue=!0,e[Squeak.splOb_FalseObject].isFalse=!0,e[Squeak.splOb_ClassFloat].isFloatClass=!0,this.compactClasses=this.specialObjectsArray.pointers[Squeak.splOb_CompactClasses].pointers;for(var t=0;t<this.compactClasses.length;t++)this.compactClasses[t].isNil||(this.compactClasses[t].isCompact=!0);Number.prototype.sqInstName||Object.defineProperty(Number.prototype,"sqInstName",{enumerable:!1,value:function(){return this.toString()}})},fixCompactOops:function(){for(var e=this.firstOldObject,t=0;e;){var i=e.hash>268435455,s=!!e.sqClass.isCompact;if(i!==s){var r=0===e.snapshotSize().header;i!==r&&(t+=r?-4:4)}e.hash&=26
- var t=0!==this.nextWakeupTick;this.isIdle=t||!e,this.breakOut()},freeze:function(t){var e;this.frozen=!0,this.breakOutOfInterpreter=function(t){if(!t)throw Error("need function to restart interpreter");return e=t,"frozen"}.bind(this);var i=function(){if(this.frozen=!1,!e)throw Error("no continue function");e(0)}.bind(this);return t&&window.setTimeout(function(){t(i)},0),i},breakOut:function(){this.breakOutOfInterpreter=this.breakOutOfInterpreter||!0},nextByte:function(){return this.methodBytes[this.pc++]},nono:function(){throw Error("Oh No!")},forceInterruptCheck:function(){this.interruptCheckCounter=-1e3},checkForInterrupts:function(){var e=this.primHandler.millisecondClockValue();if(e<this.lastTick&&(this.nextPollTick=e+(this.nextPollTick-this.lastTick),this.breakOutTick=e+(this.breakOutTick-this.lastTick),0!==this.nextWakeupTick&&(this.nextWakeupTick=e+(this.nextWakeupTick-this.lastTick))),this.interruptCheckCounter>-100&&(e-this.lastTick<this.interruptChecksEveryNms?this.interruptCheckCounterFeedBackReset+=10:this.interruptCheckCounterFeedBackReset<=1e3?this.interruptCheckCounterFeedBackReset=1e3:this.interruptCheckCounterFeedBackReset-=12),this.interruptCheckCounter=this.interruptCheckCounterFeedBackReset,this.lastTick=e,this.interruptPending){this.interruptPending=!1;var t=this.specialObjects[Squeak.splOb_TheInterruptSemaphore];t.isNil||this.primHandler.synchronousSignal(t)}if(0!==this.nextWakeupTick&&e>=this.nextWakeupTick){this.nextWakeupTick=0;var t=this.specialObjects[Squeak.splOb_TheTimerSemaphore];t.isNil||this.primHandler.synchronousSignal(t)}if(this.pendingFinalizationSignals>0){var t=this.specialObjects[Squeak.splOb_TheFinalizationSemaphore];this.pendingFinalizationSignals=0,t.isNil||this.primHandler.synchronousSignal(t)}this.primHandler.semaphoresToSignal.length>0&&this.primHandler.signalExternalSemaphores(),!this.method.compiled&&this.compiler&&this.compiler.compile(this.method),e>=this.breakOutTick&&this.breakOut()},extendedPush:function(t){var e=63&t;switch(t>>6){case 0:this.push(this.receiver.pointers[e]);break;case 1:this.push(this.homeContext.pointers[Squeak.Context_tempFrameStart+e]);break;case 2:this.push(this.method.methodGetLiteral(e));break;case 3:this.push(this.method.methodGetLiteral(e).pointers[Squeak.Assn_value])}},extendedStore:function(t){var e=63&t;switch(t>>6){case 0:this.receiver.pointers[e]=this.top();break;case 1:this.homeContext.pointers[Squeak.Context_tempFrameStart+e]=this.top();break;case 2:this.nono();break;case 3:this.method.methodGetLiteral(e).pointers[Squeak.Assn_value]=this.top()}},extendedStorePop:function(t){var e=63&t;switch(t>>6){case 0:this.receiver.pointers[e]=this.pop();break;case 1:this.homeContext.pointers[Squeak.Context_tempFrameStart+e]=this.pop();break;case 2:this.nono();break;case 3:this.method.methodGetLiteral(e).pointers[Squeak.Assn_value]=this.pop()}},doubleExtendedDoAnything:function(t){var e=this.nextByte();switch(t>>5){case 0:this.send(this.method.methodGetSelector(e),31&t,!1);break;case 1:this.send(this.method.methodGetSelector(e),31&t,!0);break;case 2:this.push(this.receiver.pointers[e]);break;case 3:this.push(this.method.methodGetLiteral(e));break;case 4:this.push(this.method.methodGetLiteral(e).pointers[Squeak.Assn_value]);break;case 5:this.receiver.pointers[e]=this.top();break;case 6:this.receiver.pointers[e]=this.pop();break;case 7:this.method.methodGetLiteral(e).pointers[Squeak.Assn_value]=this.top()}},jumpIfTrue:function(t){var e=this.pop();return e.isTrue?void(this.pc+=t):void(e.isFalse||(this.push(e),this.send(this.specialObjects[Squeak.splOb_SelectorMustBeBoolean],0,!1)))},jumpIfFalse:function(t){var e=this.pop();return e.isFalse?void(this.pc+=t):void(e.isTrue||(this.push(e),this.send(this.specialObjects[Squeak.splOb_SelectorMustBeBoolean],0,!1)))},sendSpecial:function(e){this.send(this.specialSelectors[2*e],this.specialSelectors[2*e+1],!1)}},"closures",{pushNewArray:function(i){var s=i>127,e=127&i,r=this.instantiateClass(this.specialObjects[Squeak.splOb_ClassArray],e);if(s){for(var t=0;e>t;t++)r.pointers[t]=this.stackValue(e-t-1);this.popN(e)}
- case 106:return this.primitiveScreenSize(e);case 107:return this.primitiveMouseButtons(e);case 108:return this.primitiveKeyboardNext(e);case 109:return this.primitiveKeyboardPeek(e);case 110:return this.pop2andPushBoolIfOK(this.vm.stackValue(1)===this.vm.stackValue(0));case 111:return this.popNandPushIfOK(1,this.vm.getClass(this.vm.top()));case 112:return this.popNandPushIfOK(1,this.vm.image.bytesLeft());case 113:return this.primitiveQuit(e);case 114:return this.primitiveExitToDebugger(e);case 115:return this.primitiveChangeClass(e);case 116:return this.vm.flushMethodCacheForMethod(this.vm.top());case 117:return this.doNamedPrimitive(e,i);case 118:return this.primitiveDoPrimitiveWithArgs(e);case 119:return this.vm.flushMethodCacheForSelector(this.vm.top());case 120:return!1;case 121:return this.primitiveImageName(e);case 122:return this.primitiveReverseDisplay(e);case 124:return this.popNandPushIfOK(2,this.registerSemaphore(Squeak.splOb_TheLowSpaceSemaphore));case 125:return this.popNandPushIfOK(2,this.setLowSpaceThreshold());case 126:return this.primitiveDeferDisplayUpdates(e);case 127:return this.primitiveShowDisplayRect(e)}else if(256>t)switch(t){case 128:return this.primitiveArrayBecome(e,!0);case 129:return this.popNandPushIfOK(1,this.vm.image.specialObjectsArray);case 130:return this.primitiveFullGC(e);case 131:return this.popNandPushIfOK(1,this.vm.image.partialGC());case 132:return this.pop2andPushBoolIfOK(this.pointsTo(this.stackNonInteger(1),this.vm.top()));case 133:return!0;case 134:return this.popNandPushIfOK(2,this.registerSemaphore(Squeak.splOb_TheInterruptSemaphore));case 135:return this.popNandPushIfOK(1,this.millisecondClockValue());case 136:return this.primitiveSignalAtMilliseconds(e);case 137:return this.popNandPushIfOK(1,this.secondClock());case 138:return this.popNandPushIfOK(1,this.someObject());case 139:return this.popNandPushIfOK(1,this.nextObject(this.vm.top()));case 140:return this.primitiveBeep(e);case 141:return this.primitiveClipboardText(e);case 142:return this.popNandPushIfOK(1,this.makeStString(this.filenameToSqueak(Squeak.vmPath)));case 143:case 144:return this.primitiveShortAtAndPut(e);case 145:return this.primitiveConstantFill(e);case 146:return this.namedPrimitive("JoystickTabletPlugin","primitiveReadJoystick",e);case 147:return this.namedPrimitive("BitBltPlugin","primitiveWarpBits",e);case 148:return this.popNandPushIfOK(1,this.vm.image.clone(this.vm.top()));case 149:return this.primitiveGetAttribute(e);case 150:if(this.oldPrims)return this.primitiveFileAtEnd(e);case 151:if(this.oldPrims)return this.primitiveFileClose(e);case 152:if(this.oldPrims)return this.primitiveFileGetPosition(e);case 153:if(this.oldPrims)return this.primitiveFileOpen(e);case 154:if(this.oldPrims)return this.primitiveFileRead(e);case 155:if(this.oldPrims)return this.primitiveFileSetPosition(e);case 156:if(this.oldPrims)return this.primitiveFileDelete(e);case 157:if(this.oldPrims)return this.primitiveFileSize(e);case 158:if(this.oldPrims)return this.primitiveFileWrite(e);case 159:if(this.oldPrims)return this.primitiveFileRename(e);case 160:if(this.oldPrims)return this.primitiveDirectoryCreate(e);case 161:if(this.oldPrims)return this.primitiveDirectoryDelimitor(e);case 162:if(this.oldPrims)return this.primitiveDirectoryLookup(e);case 163:if(this.oldPrims)return this.primitiveDirectoryDelete(e);break;case 165:case 166:return this.primitiveIntegerAtAndPut(e);case 167:return!1;case 168:return this.primitiveCopyObject(e);case 169:return this.oldPrims?this.primitiveDirectorySetMacTypeAndCreator(e):this.primitiveNotIdentical(e);case 170:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundStart",e);case 171:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundStartWithSemaphore",e);case 172:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundStop",e);case 173:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundAvailableSpace",e);case 174:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundPlaySamples",e);case 175:if(th
- if("number"!=typeof t)return!1;if(t!=i.pointersSize())return!1;if(!e.pointers[Squeak.BlockContext_caller].isNil)return!1;this.vm.arrayCopy(i.pointers,0,e.pointers,Squeak.Context_tempFrameStart,t);var s=e.pointers[Squeak.BlockContext_initialIP];return e.pointers[Squeak.Context_instructionPointer]=s,e.pointers[Squeak.Context_stackPointer]=t,e.pointers[Squeak.BlockContext_caller]=this.vm.activeContext,this.vm.popN(r+1),this.vm.newActiveContext(e),!0},primitiveClosureCopyWithCopiedValues:function(){return this.vm.breakNow("primitiveClosureCopyWithCopiedValues"),!1},primitiveClosureValue:function(e){var t=this.vm.stackValue(e),i=t.pointers[Squeak.Closure_numArgs];return e!==i?!1:this.activateNewClosureMethod(t,e)},primitiveClosureValueWithArgs:function(s){var i=this.vm.top(),e=i.pointersSize(),r=this.vm.stackValue(s),n=r.pointers[Squeak.Closure_numArgs];if(e!==n)return!1;this.vm.pop();for(var t=0;e>t;t++)this.vm.push(i.pointers[t]);return this.activateNewClosureMethod(r,e)},primitiveClosureValueNoContextSwitch:function(e){return this.primitiveClosureValue(e)},activateNewClosureMethod:function(i,r){var s=i.pointers[Squeak.Closure_outerContext],o=s.pointers[Squeak.Context_method],e=this.vm.allocateOrRecycleContext(o.methodNeedsLargeFrame()),n=i.pointers.length-Squeak.Closure_firstCopiedValue;e.pointers[Squeak.Context_sender]=this.vm.activeContext,e.pointers[Squeak.Context_instructionPointer]=i.pointers[Squeak.Closure_startpc],e.pointers[Squeak.Context_stackPointer]=r+n,e.pointers[Squeak.Context_method]=s.pointers[Squeak.Context_method],e.pointers[Squeak.Context_closure]=i,e.pointers[Squeak.Context_receiver]=s.pointers[Squeak.Context_receiver];for(var a=Squeak.Context_tempFrameStart,t=0;r>t;t++)e.pointers[a++]=this.vm.stackValue(r-t-1);for(var t=0;n>t;t++)e.pointers[a++]=i.pointers[Squeak.Closure_firstCopiedValue+t];return this.vm.popN(r+1),this.vm.newActiveContext(e),!0}},"scheduling",{primitiveResume:function(){return this.resume(this.vm.top()),!0},primitiveSuspend:function(){var e=this.getScheduler().pointers[Squeak.ProcSched_activeProcess];return this.vm.top()!==e?!1:(this.vm.popNandPush(1,this.vm.nilObj),this.transferTo(this.pickTopProcess()),!0)},getScheduler:function(){var e=this.vm.specialObjects[Squeak.splOb_SchedulerAssociation];return e.pointers[Squeak.Assn_value]},resume:function(e){var t=this.getScheduler().pointers[Squeak.ProcSched_activeProcess],i=t.pointers[Squeak.Proc_priority],r=e.pointers[Squeak.Proc_priority];r>i?(this.putToSleep(t),this.transferTo(e)):this.putToSleep(e)},putToSleep:function(e){var t=e.pointers[Squeak.Proc_priority],i=this.getScheduler().pointers[Squeak.ProcSched_processLists],r=i.pointers[t-1];this.linkProcessToList(e,r)},transferTo:function(e){var t=this.getScheduler(),i=t.pointers[Squeak.ProcSched_activeProcess];t.pointers[Squeak.ProcSched_activeProcess]=e,i.pointers[Squeak.Proc_suspendedContext]=this.vm.activeContext,this.vm.newActiveContext(e.pointers[Squeak.Proc_suspendedContext]),e.pointers[Squeak.Proc_suspendedContext]=this.vm.nilObj,this.vm.reclaimableContextCount=0,this.vm.breakOnContextChanged&&(this.vm.breakOnContextChanged=!1,this.vm.breakNow())},pickTopProcess:function(){var e,t=this.getScheduler().pointers[Squeak.ProcSched_processLists],i=t.pointersSize()-1;do{if(0>i)throw Error("scheduler could not find a runnable process");e=t.pointers[i--]}while(this.isEmptyList(e));return this.removeFirstLinkOfList(e)},linkProcessToList:function(t,e){if(this.isEmptyList(e))e.pointers[Squeak.LinkedList_firstLink]=t;else{var i=e.pointers[Squeak.LinkedList_lastLink];i.pointers[Squeak.Link_nextLink]=t}e.pointers[Squeak.LinkedList_lastLink]=t,t.pointers[Squeak.Proc_myList]=e},isEmptyList:function(e){return e.pointers[Squeak.LinkedList_firstLink].isNil},removeFirstLinkOfList:function(e){var t=e.pointers[Squeak.LinkedList_firstLink],i=e.pointers[Squeak.LinkedList_lastLink];if(t===i)e.pointers[Squeak.LinkedList_firstLink]=this.vm.nilObj,e.pointers[Squeak.LinkedList_lastLink]=this.vm.nilObj;else{var r=t.pointers[Squeak.Link_nextLink];e.pointers[Squeak.LinkedList_firstLink]=r}return t.pointers[Squea
- try{var s=this.js_objectOrGlobal(t),n=this.js_fromStObject(r),a=s[n];e=this.makeStObject(a,t.sqClass)}catch(o){return this.js_setError(o.message)}return this.popNandPushIfOK(i+1,e)},js_primitiveAtPut:function(t){var i=this.stackNonInteger(2),r=this.vm.stackValue(1),e=this.vm.stackValue(0);try{var s=this.js_objectOrGlobal(i),n=this.js_fromStObject(r),a=this.js_fromStObject(e);s[n]=a}catch(o){return this.js_setError(o.message)}return this.popNandPushIfOK(t+1,e)},js_primitiveSqueakAsJSObject:function(e){var t=this.stackNonInteger(1),i=this.vm.stackValue(0);return this.success&&(t.jsObject=i),this.popNIfOK(e)},js_primitiveInitCallbacks:function(e){return this.js_callbackSema=this.stackInteger(0),this.js_activeCallback=null,this.popNIfOK(e)},js_primitiveGetActiveCallbackBlock:function(t){var e=this.js_activeCallback;return e?this.popNandPushIfOK(t,e.block):this.js_setError("No active callback")},js_primitiveGetActiveCallbackArgs:function(r){var n=this.stackNonInteger(r),e=this.js_activeCallback;if(!e)return this.js_setError("No active callback");try{var t=e.block.pointers[Squeak.BlockContext_argumentCount],s=[];"number"!=typeof t&&(t=e.block.pointers[Squeak.Closure_numArgs]);for(var i=0;t>i;i++)s.push(e.args[i]);return this.popNandPushIfOK(r,this.makeStArray(s,n))}catch(a){return this.js_setError(a.message)}},js_primitiveReturnFromCallback:function(e){return 1!==e?!1:this.js_activeCallback?(this.js_activeCallback.result=this.vm.pop(),this.vm.breakOut(),!0):this.js_setError("No active callback")},js_primitiveGetError:function(e){var t=this.makeStObject(this.js_error);return this.js_error=null,this.popNandPushIfOK(e+1,t)},js_setError:function(e){return this.js_error=String(e),!1},js_fromStObject:function(e){if("number"==typeof e)return e;if(e.jsObject)return e.jsObject;if(e.isFloat)return e.float;if(e.isNil)return null;if(e.isTrue)return!0;if(e.isFalse)return!1;if(e.bytes||e.sqClass===this.vm.specialObjects[Squeak.splOb_ClassString])return e.bytesAsString();if(e.sqClass===this.vm.specialObjects[Squeak.splOb_ClassArray])return this.js_fromStArray(e.pointers||[],!0);if(e.sqClass===this.vm.specialObjects[Squeak.splOb_ClassBlockContext]||e.sqClass===this.vm.specialObjects[Squeak.splOb_ClassBlockClosure])return this.js_fromStBlock(e);throw Error("asJSArgument needed for "+e)},js_fromStArray:function(e,r){if(e.length>0&&r&&this.isAssociation(e[0]))return this.js_fromStDict(e);for(var i=[],t=0;t<e.length;t++)i.push(this.js_fromStObject(e[t]));return i},js_fromStDict:function(i){for(var r={},t=0;t<i.length;t++){var e=i[t].pointers;if(!e||2!==e.length)throw Error(e+" is not an Association");var s=this.js_fromStObject(e[0]),n=this.js_fromStObject(e[1]);r[s]=n}return r},js_fromStBlock:function(e){if(!this.js_callbackSema)throw Error("CallbackSemaphore not set");this.vm.reclaimableContextCount=0;var t=this;return function(){return t.js_executeCallback(e,arguments)}},js_executeCallback:function(t,i){if(this.js_activeCallback){if("string"==typeof this.js_activeCallback)throw Error(this.js_activeCallback);return console.error("Callback: already active")}this.js_activeCallback={block:t,args:i,result:null},this.signalSemaphoreWithIndex(this.js_callbackSema),this.vm.forceInterruptCheck();for(var r=Date.now()+500;Date.now()<r&&!this.js_activeCallback.result;)this.vm.interpret();var e=this.js_activeCallback.result;if(this.js_activeCallback=null,e)try{return this.js_fromStObject(e)}catch(s){return e.toString()}else console.error("Callback error: "+(this.vm.frozen?"frozen":"timeout"))},js_objectOrGlobal:function(e){return"jsObject"in e?e.jsObject:window}},"Obsolete",{primitiveFloatArrayAt:function(e){return this.namedPrimitive("FloatArrayPlugin","primitiveAt",e)},primitiveFloatArrayMulFloatArray:function(e){return this.namedPrimitive("FloatArrayPlugin","primitiveMulFloatArray",e)},primitiveFloatArrayAddScalar:function(e){return this.namedPrimitive("FloatArrayPlugin","primitiveAddScalar",e)},primitiveFloatArrayDivFloatArray:function(e){return this.namedPrimitive("FloatArrayPlugin","primitiveDivFloatArray",e)},primitiveFloatArrayDivScalar:function(e)
- },generateJumpIf:function(t,i){var e=this.pc+i;this.debug&&this.generateDebugCode("jump if "+t+" to "+e),this.generateLabel(),this.source.push("var cond = stack[vm.sp--]; if (cond === vm.",t,"Obj) {vm.pc = ",e,"; bytecodes -= ",i,"; "),this.singleStep&&this.source.push("if (vm.breakOutOfInterpreter) return bytecodes + ",e,"; else "),this.source.push("continue}\n","else if (cond !== vm.",!t,"Obj) {vm.sp++; vm.pc = ",this.pc,"; vm.send(vm.specialObjects[25], 0, false); return bytecodes + ",this.pc,"}\n"),this.needsLabel[this.pc]=!0,this.needsLabel[e]=!0,e>this.endPC&&(this.endPC=e)},generateQuickPrim:function(e){switch(this.debug&&this.generateDebugCode("quick prim "+this.specialSelectors[(15&e)+16]),this.generateLabel(),e){case 194:return this.source.push("if (stack[vm.sp].sqClass === vm.specialObjects[7]) stack[vm.sp] = stack[vm.sp].pointersSize();\n","else if (stack[vm.sp].sqClass === vm.specialObjects[6]) stack[vm.sp] = stack[vm.sp].bytesSize();\n","else { vm.pc = ",this.pc,"; vm.sendSpecial(18); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return bytecodes + ",this.pc,"; }\n"),void(this.needsLabel[this.pc]=!0);case 198:return void this.source.push("var cond = stack[vm.sp-1] === stack[vm.sp];\nstack[--vm.sp] = cond ? vm.trueObj : vm.falseObj;\n");case 199:return void this.source.push("stack[vm.sp] = typeof stack[vm.sp] === 'number' ? vm.specialObjects[5] : stack[vm.sp].sqClass;\n");case 200:return this.source.push("vm.pc = ",this.pc,"; if (!vm.primHandler.quickSendOther(rcvr, ",15&e,")) ","{vm.sendSpecial(",(15&e)+16,"); return bytecodes + ",this.pc,"}\n"),this.needsLabel[this.pc]=!0,void(this.needsLabel[this.pc+2]=!0);case 201:case 202:case 203:return this.source.push("vm.pc = ",this.pc,"; if (!vm.primHandler.quickSendOther(rcvr, ",15&e,")) vm.sendSpecial(",(15&e)+16,"); return bytecodes + ",this.pc,";\n"),void(this.needsLabel[this.pc]=!0)}this.source.push("vm.pc = ",this.pc,"; if (!vm.primHandler.quickSendOther(rcvr, ",15&e,"))"," vm.sendSpecial(",(15&e)+16,");\n","if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return bytecodes + ",this.pc,";\n","if (vm.pc !== ",this.pc,") throw Error('Huh?');\n"),this.needsBreak=!1,this.needsLabel[this.pc]=!0},generateNumericOp:function(e){switch(this.debug&&this.generateDebugCode("numeric op "+this.specialSelectors[15&e]),this.generateLabel(),this.needsLabel[this.pc]=!0,e){case 176:return void this.source.push("var a = stack[vm.sp - 1], b = stack[vm.sp];\n","if (typeof a === 'number' && typeof b === 'number') {\n"," stack[--vm.sp] = vm.primHandler.signed32BitIntegerFor(a + b);\n","} else { vm.pc = ",this.pc,"; vm.sendSpecial(0); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return bytecodes + ",this.pc,"}\n");case 177:return void this.source.push("var a = stack[vm.sp - 1], b = stack[vm.sp];\n","if (typeof a === 'number' && typeof b === 'number') {\n"," stack[--vm.sp] = vm.primHandler.signed32BitIntegerFor(a - b);\n","} else { vm.pc = ",this.pc,"; vm.sendSpecial(1); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return bytecodes + ",this.pc,"}\n");case 178:return void this.source.push("var a = stack[vm.sp - 1], b = stack[vm.sp];\n","if (typeof a === 'number' && typeof b === 'number') {\n"," stack[--vm.sp] = a < b ? vm.trueObj : vm.falseObj;\n","} else { vm.pc = ",this.pc,"; vm.sendSpecial(2); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return bytecodes + ",this.pc,"}\n");case 179:return void this.source.push("var a = stack[vm.sp - 1], b = stack[vm.sp];\n","if (typeof a === 'number' && typeof b === 'number') {\n"," stack[--vm.sp] = a > b ? vm.trueObj : vm.falseObj;\n","} else { vm.pc = ",this.pc,"; vm.sendSpecial(3); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return bytecodes + ",this.pc,"}\n");case 180:return void this.source.push("var a = stack[vm.sp - 1], b = stack[vm.sp];\n","if (typeof a === 'number' && typeof b === 'number') {\n"," stack[--vm.sp] = a <= b ? vm.trueObj : vm.falseObj;\n","} else { vm.pc = ",this
- }function rn(e){var t;return ft(e)<=0?null:(t=Fc(e),void Kf(e,t))}function Kf(i,t){var e;if(!au(1))return null;for(e=W()-1;!(t>e);)b[e+1]=b[e],--e;b[t]=i,Ki(W()+1)}function Jf(e){return(J(e)&rr)===da}function $f(e){var t;return t=J(e),t>va?!1:0!==(J(e)&va)}function sh(e){return vr(e)||qu(e)}function vr(e){return 0!==(4278190080&e)}function L(e){return 0===e||vr(e)||Au(e)&&sh(e)}function Iu(e){return(J(e)&rr)===ba}function Au(e){return e>=0&&O>e}function qu(e){return 0!==(J(e)&ga)}function Ut(e){return 0!==(J(e)&vc)}function Nu(){return t[Lo]}function Du(e){return t[Lo]=e}function Di(){return t[Ro]}function Ku(e){return t[Ro]=e}function xt(){return t[Eo]}function Ju(e){return t[Eo]=e}function _t(){return t[Ko]}function Xu(e){return t[Ko]=e}function Nn(e){return n(e,Ka)}function hc(e,t){return a(e,Ka,t)}function xr(e){return n(e,za)}function Ac(e,t){return a(e,za,t)}function wc(e){return n(e,Ua)}function Cc(e,t){return a(e,Ua,t)}function jc(e){return n(e,Ja)}function _c(e,t){return a(e,Ja,t)}function Lc(e){return n(e,Ga)}function ea(e,t){return a(e,Ga,t)}function qr(e){return n(e,eo)}function $c(e,t){return a(e,eo,t)}function Ht(e){return n(e,to)}function mf(e,t){return a(e,to,t)}function kf(e,t){return a(e,uf,t)}function cr(n,a,o,l){var e,u,t,s,i;if(e=Hr(),r)return 0;for(Zs(e,n[0]),Ys(e,n[1]),wi(e,a[0]),Ai(e,a[1]),qi(e,o[0]),xi(e,o[1]),i=u=zf(e,l),t=e;u>=t;t+=6)if(s=Yr(t),s>i&&(i=s),r)return 0;return Ot(i,6)}function If(u,c,f,h,p){var t,s,n,a,o;if(I(i(),e.fetchPointerofObject(0,u)),e.failed())return null;for(s=i()[0],a=i()[1],t=1;c-1>=t;t++){if(I(i(),e.fetchPointerofObject(t,u)),e.failed())return null;if(n=i()[0],o=i()[1],i()[0]=s,i()[1]=a,l()[0]=n,l()[1]=o,at(2),ct(h,i(),l(),p,f,0),r)return null;s=n,a=o}}function Pf(n,k,p,a,o){var t,s,v,h,c,d,m,u,f;for(t=0;k-1>=t;t++){if(s=e.fetchPointerofObject(3*t,n),I(i(),s),s=e.fetchPointerofObject(3*t+1,n),I(l(),s),s=e.fetchPointerofObject(3*t+2,n),I(F(),s),e.failed())return null;if(at(3),h=i()[0],m=i()[1],c=l()[0],u=l()[1],d=F()[0],f=F()[1],h===m&&c===u||c===d&&u===f)ct(a,i(),F(),o,p,0);else{if(v=cr(i(),l(),F(),0!==a&&0!==o),r)return null;ur(a,o,p,0,v)}if(r)return null}}function Vf(r,s,n){var i,t;for(i=0;n-1>=i;i++){if(t=e.fetchPointerofObject(i,r),"number"!=typeof t&&!t.isFloat)return e.primitiveFail();s[i]="number"==typeof t?t:e.floatValueOf(t)}}function xf(e,t,r,s,i){jt(t)>=Ct(t)?(G(e,$t(t)),hi(e,Ct(t)-i),ru(e,Vi(t)),Un(e,Pi(t)-i),$s(e,Tt(t)),Yo(e,jt(t)-i)):(G(e,Tt(t)),hi(e,jt(t)-i),ru(e,Vi(t)),Un(e,Pi(t)-i),$s(e,$t(t)),Yo(e,Ct(t)-i)),tr(e,ks()),as(e,r),ns(e,s)}function pa(e){return Ti||kr()?Ti(e):!1}function Bf(s,u,b,g,k,v,m){var l,d,t,i,o,f,a,h,n,c;if(u.isNil)n=0,h=null;else{if(nt(u)!==e.classBitmap())return e.primitiveFail();n=p(u),h=u.wordsAsInt32Array()}return"number"==typeof s?e.primitiveFail():e.isPointers(s)?p(s)<5?e.primitiveFail():(l=e.fetchPointerofObject(0,s),nt(l)!==e.classBitmap()?e.primitiveFail():(d=p(l),a=e.fetchIntegerofObject(1,s),o=e.fetchIntegerofObject(2,s),t=e.fetchIntegerofObject(3,s),e.failed()?null:a>=0&&o>=0?32!==t&&8!==t&&16!==t&&1!==t&&2!==t&&4!==t?e.primitiveFail():0!==n&&n!==M(1,t)?e.primitiveFail():(c=Ot(32,t),f=Ot(a+(c-1),c),d!==f*o?e.primitiveFail():(i=pf(n,h),r?null:(Mh(i,a),Ll(i,o),mh(i,t),af(i,f),Rh(i,d),Nh(i,b),st(i,m),ho(i,g,k,v,a,o),i))):e.primitiveFail())):e.primitiveFail()}function wa(r){var s,t,n,i;return i=ir(r),i>p(Wi)?null:(n=e.fetchPointerofObject(i,Wi),t=e.fetchPointerofObject(0,n),s=p(t),s!==zh(r)?null:t.wordsAsInt32Array())}function Wf(i){var t,e;return e=$i(),Cr(0),(t=Ao(i,e,8))?(Cr(1),e[1]=256*e[1],e[3]=256*e[3],e[5]=256*e[5],e[7]=256*e[7],t):!1}function Ma(k,e,v,d,p,h,f){var t,m,a,u,n,s,c,o;return d!==p||0!==h&&0!==f?(t=6*k,v?(a=(e.int16Array||(e.int16Array=new Int16Array(e.buffer,e.byteOffset)))[t+0],s=(e.int16Array||(e.int16Array=new Int16Array(e.buffer,e.byteOffset)))[t+1],u=(e.int16Array||(e.int16Array=new Int16Array(e.buffer,e.byteOffset)))[t+2],c=(e.int16Array||(e.int16Array=new Int16Array(e.buffer,e.byteOffset)))[t+3],n=(e.int16Array||(e.int16Array=new Int16Array(e.buffer,e.byteOffset)))[t+4],o=(e.int16Array||(e.int16A
- }function jf(){return Qa(b[w()],y())}function Qa(e,o){var n,r,s,a,t,i;t=nn(e)+1,i=on(e)+1,an(e,t),un(e,i),s=fr(e),r=wt(s),t>=r&&lr(e),i>=0&&or(e),n=A(e),Gr(e,o),a=A(e),(s>=t||i+r>=0)&&xh(e,n,a)}function It(e){di(e),r=!0}function Ur(){return t[iu]}function di(e){return t[iu]=e}function er(i,t){return p(t)<cs?e.primitiveFail():(e.storeIntegerofObjectwithValue(Eu,t,ir(i)),e.storeIntegerofObjectwithValue(gn,t,A(i)),e.storeIntegerofObjectwithValue(bn,t,y()),e.storeIntegerofObjectwithValue(yn,t,Jr(i)),e.storeIntegerofObjectwithValue(kn,t,ft(i)),void Du(i))}function k(){uu(O)}function yo(t){var i,r,s;return i=Di(),r=xt(),s=_t(),p(t)<Or?e.primitiveFail():(e.storeIntegerofObjectwithValue(Sn,t,ir(i)),e.storeIntegerofObjectwithValue(In,t,r),e.storeIntegerofObjectwithValue(On,t,s),void e.storeIntegerofObjectwithValue(Zu,t,y()))}function Xr(){return e.failed()?null:(r&&Lf(e.stackObjectValue(1),e.stackObjectValue(0)),k(o),e.pop(3),void e.pushInteger(Ur()))}function Lf(i,r){var e,t;t=Ur(),t===Cs&&(e=B[Y()],er(e,i),yr(Y()+1)),t===ws&&yo(r),t===Ps&&(e=b[w()],er(e,i))}function Ef(e){var i,t,n,r,a,s;return s=Ct(e),r=jt(e),r===s?e:(t=r-s,0>t&&(t=0-t),t>255?(h(js,1),Fa(e)):(a=$t(e),n=Tt(e),i=n-a,0>i&&(i=0-i),i>32*t?(h(qs,1),Fa(e)):e))}function Yr(e){var t,i,s;return s=Ef(e),s!==e?(t=Yr(e),r?0:(i=Yr(s),r?0:t>=i?t:i)):e}function zf(i,s){var r,e,t;return r=e=t=Uf(i),s&&(e=Oo(i)),e>t&&(t=e),i!==r&&s&&(e=Oo(r)),e>t&&(t=e),t}function Oo(e){var t,r,s,a,i,o,n;return o=$t(e),n=Vi(e),a=Tt(e),r=n-o,s=a-n,r*s>=0?e:(h(Sr,1),t=s-r,i=r,0>i&&(i=0-i),0>t&&(t=0-t),Sa(e,i/t))}function Uf(e){var t,r,s,a,i,o,n;return o=Ct(e),n=Pi(e),a=jt(e),r=n-o,s=a-n,r*s>=0?e:(h(Sr,1),t=s-r,i=r,0>i&&(i=0-i),0>t&&(t=0-t),Sa(e,i/t))}function Io(e,t,i){var r;0===V()?An()&&(is(e),Qr(t),es(i)):(r=oa(e,t),r||ra(e,t,i))}function Hf(t){var i,e;return X(2*N())?(i=Jr(t)<<1,e=wu(t),0!==e&&Io(e,i,999999999),e=mu(t),0!==e&&Io(e,i,999999999),void Xi(A(t))):null}function Xf(e){var s,t,i,a,r,n;switch(n=kh(e),Mi=e,n){case 0:case 1:pi();break;case 2:Bc();break;case 3:qc()}switch(a=Dt,n){case 0:case 1:pi();break;case 2:Mc();break;case 3:xc()}return t=Dt,0===t?null:X(N())?(s=(Jr(e)<<1)+1,r=A(e)+a,i=Tn(t,s),-1===i?ra(t,s,r):dr(i)<r&&Xt(i,r),void Xi(A(e))):null}function Zf(){return 0===V()?-1:Zr()}function Zi(){return 0===V()?0:ts()}function Zr(){return Et(V()-N())}function Qr(e){return yi(V()-N(),e)}function $r(){return dr(V()-N())}function es(e){return Xt(V()-N(),e)}function ts(){return Kt(V()-N())}function is(e){return ki(V()-N(),e)}function rs(){return 0===V()?999999999:$r()}function q(n){var e,a,i,r,s,t;return 0===n||vr(n)?(i=255&n,r=n>>>8&255,s=n>>>16&255,e=n>>>24&255,gr()&&(t=$i(),a=(e*t[6]+t[7])/e,s=(s*t[0]+t[1])*a|0,r=(r*t[2]+t[3])*a|0,i=(i*t[4]+t[5])*a|0,e=e*a|0,s=Math.max(s,0),s=Math.min(s,255),r=Math.max(r,0),r=Math.min(r,255),i=Math.max(i,0),i=Math.min(i,255),e=Math.max(e,0),e=Math.min(e,255)),1>e?0:(255>e&&wo()&&It(Nc),i+(r<<8)+(s<<16)+(e<<24))):n}function Pt(e){_f()?hh(e,e):(e[0]=(e[0]+ms())*P(),e[1]=(e[1]+hs())*P())}function hh(e,t){ph(0|e[0],0|e[1],t)}function ph(t,i,r){var e,s,n;e=ss(),s=(e[0]*t+e[1]*i+e[2])*P()|0,n=(e[3]*t+e[4]*i+e[5])*P()|0,r[0]=s,r[1]=n}function at(e){e>0&&Pt(i()),e>1&&Pt(l()),e>2&&Pt(F()),e>3&&Pt(Ci())}function ci(s){var e,t,r,n;return 0===s?0:(i()[0]=0,i()[1]=0,l()[0]=256*s,l()[1]=0,F()[0]=0,F()[1]=256*s,at(3),e=l()[0]-i()[0],t=l()[1]-i()[1],r=(0|Math.sqrt(e*e+t*t))+128>>8,e=F()[0]-i()[0],t=F()[1]-i()[1],n=(0|Math.sqrt(e*e+t*t))+128>>8,r>n&&(r=n),0===r?1:r)}function ou(n){var e,i,r,s,t;return gr()?(i=255&n,r=n>>>8&255,s=n>>>16&255,e=n>>>24&255,t=$i(),s=s*t[0]+t[1]|0,r=r*t[2]+t[3]|0,i=i*t[4]+t[5]|0,e=e*t[6]+t[7]|0,s=Math.max(s,0),s=Math.min(s,255),r=Math.max(r,0),r=Math.min(r,255),i=Math.max(i,0),i=Math.min(i,255),e=Math.max(e,0),e=Math.min(e,255),16>e?0:i+(r<<8)+(s<<16)+(e<<24)):n}function Qt(){return t[Es]}function gh(e){return t[Es]=e}function vt(){hr(Qt())}function Fh(e){hr($()+e)}function lu(e){return Sc(e)?(hr($()-e),!0):!1}function E(){return Qt()-$()}function dt(e){return t[$()+e]}function ht(e,i){return t[$()+e]=i}function $(){return t[Ms]}function h
- }function Ai(){var t,i,r,n;if(Ct){if(!Nt&&!Rt())return null;r=Nt,n=!1,t=e.fetchPointerofObject(st,K),"number"==typeof t&&(t=t,r(t,y,S,A-y,O-S),s=M=0,n=!0),W||(i=e.fetchPointerofObject(st,T),"number"==typeof i&&(i=i,n&&i===t||r(i,0,0,0,0),f=P=0)),Ct=!1}}function sr(){var t;return t=W,W=!0,vi(),W=t,W||0>=o||0>=h?(y=A=S=O=0,null):Di()?(ni(),rr(),J>0?(y=r,A=r+o):(y=r-o+1,A=r+1),dt>0?(S=a,O=a+h):(S=a-h+1,O=a+1),void Ai()):e.primitiveFail()}function rr(){var st,et,f,tt,u,z,W,Y,it,K,y,J,V,$,Q,O,U,A,P,j,I,S,rt,T,v,M;if(it=n[k+1],!(E(b)>=at+12))return e.primitiveFail();if(u=Ot-1,0>=u&&(u=1),I=H(at,b),f=H(at+3,b),v=wt(I,f,u),0>v&&(I=f-u*v),O=H(at+1,b),f=H(at+4,b),S=wt(O,f,u),0>S&&(O=f-u*S),A=H(at+9,b),f=H(at+6,b),K=wt(A,f,u),0>K&&(A=f-u*K),y=H(at+10,b),f=H(at+7,b),z=wt(y,f,u),0>z&&(y=f-u*z),e.failed())return!1;if(2===e.methodArgumentCount())if(M=e.stackIntegerValue(1),P=e.stackValue(0),P.isNil){if(16>g)return e.primitiveFail()}else{if(E(P)<i(1,g))return e.primitiveFail();P=P.wordsOrBytes()}else M=1,P=e.nilObject();for(u=Z-1,0>=u&&(u=1),Y=c-(r&c-1),rt=(r+o-1&c-1)+1,Y>o&&(Y=o),x>D&&(I+=(x-D)*v,O+=(x-D)*S,A+=(x-D)*K,y+=(x-D)*z),Cs(),M>1&&0===(C&St)&&(X?ci(8,R):16===t&&ci(8,5)),st=C&~St,q?(U=0-t,et=32-t):(U=t,et=0),J=1;h>=J;J++){j=wt(I,A,u),p=j>=0?I:A-u*j,V=wt(O,y,u),m=V>=0?O:y-u*V,G=q?32-((r&c-1)+1)*t:(r&c-1)*t,N>_&&(p+=(N-_)*j,m+=(N-_)*V),$=At?w:Gt(a+J-1),d=F,T=Y,f=B;do tt=1===M?tr(T,j,V,v,S,U,st):ir(T,j,V,v,S,P,M,U),G=et,d===w?(Q=it(tt&$,s[l>>>2]),s[l>>>2]=d&Q):(W=s[l>>>2],Q=it(tt&$,W&d),W=d&Q|W&~d,s[l>>>2]=W),l+=4,2===f?(d=L,T=rt):(d=w,T=c);while(0!==--f);I+=v,O+=S,A+=K,y+=z,l+=Pt}}function Cs(){var e,t;for(zt=0,t=g;1!==t;)++zt,t>>>=1;for(Wi=j[g],bi=5-zt,ki=i(1,bi)-1,e=0;ki>=e;e++)Mi[e]=tt?32-i(e+1,zt):i(e,zt)}function ir(_,c,f,x,A,B,s,M){var P,y,S,q,l,w,I,V,h,e,b,o,F,u,O,n,a,r,d;V=j[t],y=0,2===s?(S=c>>1,l=f>>1,I=x>>1,h=A>>1):(S=v(c,s),l=v(f,s),I=v(x,s),h=v(A,s)),w=_;do{O=p,b=m,n=a=u=o=0,r=0,q=s;do{d=O,F=b,P=s;do e=fi(d,F),(25!==k||0!==e)&&(++r,e=16>g?B[e]:16===g?ui(e):kr(e),o+=255&e,u+=e>>>8&255,a+=e>>>16&255,n+=e>>>24),d+=S,F+=l;while(0!==--P);O+=I,b+=h}while(0!==--q);0===r||25===k&&s*s>>1>r?e=0:(4===r?(a>>>=2,u>>>=2,o>>>=2,n>>>=2):(a=v(a,r),u=v(u,r),o=v(o,r),n=v(n,r)),e=(n<<24)+(a<<16)+(u<<8)+o,0===e&&a+u+o+n>0&&(e=1),e=Dt(e,C)),y|=i(e&V,G),G+=M,p+=c,m+=f}while(0!==--w);return y}function tr(f,u,c,d,h,o,l){var s,a,r,n,e;if(n=j[t],e=0,a=f,l===(Y|ct)){do s=fi(p,m),r=X[s&ut],e|=i(r&n,G),G+=o,p+=u,m+=c;while(0!==--a)}else do s=fi(p,m),r=Dt(s,l),e|=i(r&n,G),G+=o,p+=u,m+=c;while(0!==--a);return e}var er=1,$i=11,w=4294967295,ei=3,Qi=13,Zi=12,Yi=10,Xi=11,Ji=14,Ui=0,pi=4,Ci=5,Gi=2,zi=7,Ki=3,Ei=1,Ri=8,Br=9,at=15,Li=6,_t=2,Si=2,ct=4,St=8,Y=1,qi=16384,st=0,mi=3,ti=2,hi=1,Tt=1,Hi=43,Et=0,O=0,y=0,A=0,S=0,h=0,o=0,b=0,$=0,jt=0,Vt=0,N=0,x=0,R=0,C=0,X=null,ut=0,ot=null,nt=null,k=0,yi=0,$t=0,s=0,Pt=0,t=0,K=0,vt=0,l=0,q=0,d=0,c=0,M=0,ft=0,_=0,D=0,Zt=new Array(4096),Vi=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5],ai=[0,2,4,6,8,12,14,16],li=[0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30],G=0,r=0,a=0,pt=null,J=0,oi=0,lt=0,Bt=0,Ct=0,Ot=0,e=null,Fi=0,It=null,F=0,L=0,j=[0,1,3,0,15,31,0,0,255,0,0,0,0,0,0,0,65535,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1],Yr="BitBltPlugin 3 November 2014 (e)",B=0,At=0,W=0,n=new Array(43),Kt=0,yt=null,V=0,bt=0,f=0,Jt=0,g=0,T=0,rt=0,I=0,tt=0,et=0,P=0,it=0,Ft=0,Yt=0,Wt=0,p=0,m=0,U=null,Nt=null,dt=0,ki=0,bi=0,Mi=new Array(32),Wi=0,zt=0,Z=0;Squeak.registerExternalModule("BitBltPlugin",{primitiveCopyBits:jr,copyBits:qt,moduleUnloaded:Dr,primitiveDrawLoop:Cr,primitiveDisplayString:Vr,initialiseModule:Gr,loadBitBltFrom:Ht,setInterpreter:cr,primitiveWarpBits:Pr,getModuleName:Hr,primitivePixelValueAt:wr,copyBitsFromtoat:rs})}),module("users.bert.SqueakJS.plugins.FFTPlugin").requires("users.bert.SqueakJS.vm").toRun(function(){function s(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function b(e,t){return 0|Math.floor(e/t)}function v(t,e){return e>31?0:t<<e}function c(t){return e.success(e.isWords(t)),e.failed()?0:t.wordsAsFloat32Array()}function P(t){return e.success(
- else for(f=s.wordsAsFloat32Array(),u=e.floatValueOf(n),a=r.wordsAsFloat32Array(),i=0;o-1>=i;i++)a[i]=f[i]+u;e.pop(4),e.push(r)}function A(){var s,h,c,o,i,l,p,a,n,r,f,u,d;if(r=e.stackObjectValue(0),s=e.stackObjectValue(1),n=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(s)),e.success(e.isWords(n)),e.success(e.isWords(r)),e.failed())return null;if(a=t(s),e.success(a===t(n)),e.success(a===t(r)),e.failed())return null;if(l=e.isMemberOf(s,"WordArray"),p=e.isMemberOf(n,"WordArray"),l&&p){if(!e.isMemberOf(r,"WordArray"))return e.primitiveFail(),null}else if(!e.isMemberOf(r,"KedamaFloatArray"))return e.primitiveFail(),null;if(p)if(l)for(u=n.words,f=s.words,d=r.words,i=0;a-1>=i;i++)d[i]=u[i]/f[i];else for(u=n.words,h=s.wordsAsFloat32Array(),o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=u[i]/h[i];else if(l)for(c=n.wordsAsFloat32Array(),f=s.words,o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=c[i]/f[i];else for(c=n.wordsAsFloat32Array(),h=s.wordsAsFloat32Array(),o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=c[i]/h[i];e.pop(4),e.push(r)}function P(){var n,l,h,o,i,p,f,d,u,s,r,c,m;if(r=e.stackObjectValue(0),n=e.stackValue(1),s=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(s)),e.success(e.isWords(r)),e.failed())return null;if(u=t(s),e.success(u===t(r)),e.failed())return null;if(f="number"==typeof n,d=e.isMemberOf(s,"WordArray"),f&&d){if(!e.isMemberOf(r,"WordArray"))return e.primitiveFail(),null}else if(!e.isMemberOf(r,"KedamaFloatArray"))return e.primitiveFail(),null;if(d)if(f)for(c=s.words,p=n,m=r.words,i=0;u-1>=i;i++)m[i]=a(c[i],p);else for(c=s.words,l=e.floatValueOf(n),o=r.wordsAsFloat32Array(),i=0;u-1>=i;i++)o[i]=c[i]/l;else if(f)for(h=s.wordsAsFloat32Array(),p=n,o=r.wordsAsFloat32Array(),i=0;u-1>=i;i++)o[i]=h[i]/p;else for(h=s.wordsAsFloat32Array(),l=e.floatValueOf(n),o=r.wordsAsFloat32Array(),i=0;u-1>=i;i++)o[i]=h[i]/l;e.pop(4),e.push(r)}function w(){var s,h,c,o,i,l,p,a,n,r,f,u,d;if(r=e.stackObjectValue(0),s=e.stackObjectValue(1),n=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(s)),e.success(e.isWords(n)),e.success(e.isWords(r)),e.failed())return null;if(a=t(s),e.success(a===t(n)),e.success(a===t(r)),e.failed())return null;if(l=e.isMemberOf(s,"WordArray"),p=e.isMemberOf(n,"WordArray"),l&&p){if(!e.isMemberOf(r,"WordArray"))return e.primitiveFail(),null}else if(!e.isMemberOf(r,"KedamaFloatArray"))return e.primitiveFail(),null;if(p)if(l)for(u=n.words,f=s.words,d=r.words,i=0;a-1>=i;i++)d[i]=u[i]*f[i];else for(u=n.words,h=s.wordsAsFloat32Array(),o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=u[i]*h[i];else if(l)for(c=n.wordsAsFloat32Array(),f=s.words,o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=c[i]*f[i];else for(c=n.wordsAsFloat32Array(),h=s.wordsAsFloat32Array(),o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=c[i]*h[i];e.pop(4),e.push(r)}function C(){var n,u,f,a,i,h,c,p,o,s,r,l,d;if(r=e.stackObjectValue(0),n=e.stackValue(1),s=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(s)),e.success(e.isWords(r)),e.failed())return null;if(o=t(s),e.success(o===t(r)),e.failed())return null;if(c="number"==typeof n,p=e.isMemberOf(s,"WordArray"),c&&p){if(!e.isMemberOf(r,"WordArray"))return e.primitiveFail(),null}else if(!e.isMemberOf(r,"KedamaFloatArray"))return e.primitiveFail(),null;if(p)if(c)for(l=s.words,h=n,d=r.words,i=0;o-1>=i;i++)d[i]=l[i]*h;else for(l=s.words,u=e.floatValueOf(n),a=r.wordsAsFloat32Array(),i=0;o-1>=i;i++)a[i]=l[i]*u;else if(c)for(f=s.wordsAsFloat32Array(),h=n,a=r.wordsAsFloat32Array(),i=0;o-1>=i;i++)a[i]=f[i]*h;else for(f=s.wordsAsFloat32Array(),u=e.floatValueOf(n),a=r.wordsAsFloat32Array(),i=0;o-1>=i;i++)a[i]=f[i]*u;e.pop(4),e.push(r)}function st(){var s,h,c,o,i,l,p,a,n,r,f,u,d;if(r=e.stackObjectValue(0),s=e.stackObjectValue(1),n=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(s)),e.success(e.isWords(n)),e.success(e.isWords(r)),e.failed())return null;if(a=t(s),e.success(a===t(n)),e.success(a===t(r)),e.failed())return null;if(l=e.isMemberOf(s,"WordArray"),p=e.isMemberOf(n,"WordArray"),l&&p){if(!e.isMemberOf(r,"WordArray"))retur
- else for(c=n.words,u=r.wordsAsFloat32Array(),s=a.bytes,i=0;o-1>=i;i++)s[i]=c[i]<u[i];else if(h)for(l=n.wordsAsFloat32Array(),f=r.words,s=a.bytes,i=0;o-1>=i;i++)s[i]=l[i]<f[i];else for(l=n.wordsAsFloat32Array(),u=r.wordsAsFloat32Array(),s=a.bytes,i=0;o-1>=i;i++)s[i]=l[i]<u[i];e.pop(4),e.push(a)}function W(){var a,r,u,l,i,f,h,p,o,n,s,c;if(s=e.stackObjectValue(0),a=e.stackValue(1),n=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(n)),e.success(e.isBytes(s)),e.failed())return null;if(o=t(n),e.success(o===t(s)),e.failed())return null;if(h="number"==typeof a,p=e.isMemberOf(n,"WordArray"))if(h)for(c=n.words,f=a,r=s.bytes,i=0;o-1>=i;i++)r[i]=c[i]<f;else for(c=n.words,u=e.floatValueOf(a),r=s.bytes,i=0;o-1>=i;i++)r[i]=c[i]<u;else if(h)for(l=n.wordsAsFloat32Array(),f=a,r=s.bytes,i=0;o-1>=i;i++)r[i]=l[i]<f;else for(l=n.wordsAsFloat32Array(),u=e.floatValueOf(a),r=s.bytes,i=0;o-1>=i;i++)r[i]=l[i]<u;e.pop(4),e.push(s)}function D(){var s,h,c,o,i,l,p,a,n,r,f,u,d;if(r=e.stackObjectValue(0),s=e.stackObjectValue(1),n=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(s)),e.success(e.isWords(n)),e.success(e.isWords(r)),e.failed())return null;if(a=t(s),e.success(a===t(n)),e.success(a===t(r)),e.failed())return null;if(l=e.isMemberOf(s,"WordArray"),p=e.isMemberOf(n,"WordArray"),l&&p){if(!e.isMemberOf(r,"WordArray"))return e.primitiveFail(),null}else if(!e.isMemberOf(r,"KedamaFloatArray"))return e.primitiveFail(),null;if(p)if(l)for(u=n.words,f=s.words,d=r.words,i=0;a-1>=i;i++)d[i]=u[i]*f[i];else for(u=n.words,h=s.wordsAsFloat32Array(),o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=u[i]*h[i];else if(l)for(c=n.wordsAsFloat32Array(),f=s.words,o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=c[i]*f[i];else for(c=n.wordsAsFloat32Array(),h=s.wordsAsFloat32Array(),o=r.wordsAsFloat32Array(),i=0;a-1>=i;i++)o[i]=c[i]*h[i];e.pop(4),e.push(r)}function T(){var n,u,f,a,i,h,c,p,o,s,r,l,d;if(r=e.stackObjectValue(0),n=e.stackValue(1),s=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(s)),e.success(e.isWords(r)),e.failed())return null;if(o=t(s),e.success(o===t(r)),e.failed())return null;if(c="number"==typeof n,p=e.isMemberOf(s,"WordArray"),c&&p){if(!e.isMemberOf(r,"WordArray"))return e.primitiveFail(),null}else if(!e.isMemberOf(r,"KedamaFloatArray"))return e.primitiveFail(),null;if(p)if(c)for(l=s.words,h=n,d=r.words,i=0;o-1>=i;i++)d[i]=l[i]*h;else for(l=s.words,u=e.floatValueOf(n),a=r.wordsAsFloat32Array(),i=0;o-1>=i;i++)a[i]=l[i]*u;else if(c)for(f=s.wordsAsFloat32Array(),h=n,a=r.wordsAsFloat32Array(),i=0;o-1>=i;i++)a[i]=f[i]*h;else for(f=s.wordsAsFloat32Array(),u=e.floatValueOf(n),a=r.wordsAsFloat32Array(),i=0;o-1>=i;i++)a[i]=f[i]*u;e.pop(4),e.push(r)}function L(){var r,s,u,l,i,h,p,o,n,a,f,c;if(a=e.stackObjectValue(0),r=e.stackObjectValue(1),n=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(r)),e.success(e.isWords(n)),e.success(e.isBytes(a)),e.failed())return null;if(o=t(r),e.success(o===t(n)),e.success(o===t(a)),e.failed())return null;if(h=e.isMemberOf(r,"WordArray"),p=e.isMemberOf(n,"WordArray"))if(h)for(c=n.words,f=r.words,s=a.bytes,i=0;o-1>=i;i++)s[i]=c[i]!==f[i];else for(c=n.words,u=r.wordsAsFloat32Array(),s=a.bytes,i=0;o-1>=i;i++)s[i]=c[i]!==u[i];else if(h)for(l=n.wordsAsFloat32Array(),f=r.words,s=a.bytes,i=0;o-1>=i;i++)s[i]=l[i]!==f[i];else for(l=n.wordsAsFloat32Array(),u=r.wordsAsFloat32Array(),s=a.bytes,i=0;o-1>=i;i++)s[i]=l[i]!==u[i];e.pop(4),e.push(a)}function wt(){var a,r,u,l,i,f,h,p,o,n,s,c;if(s=e.stackObjectValue(0),a=e.stackValue(1),n=e.stackObjectValue(2),e.failed())return null;if(e.success(e.isWords(n)),e.success(e.isBytes(s)),e.failed())return null;if(o=t(n),e.success(o===t(s)),e.failed())return null;if(h="number"==typeof a,p=e.isMemberOf(n,"WordArray"))if(h)for(c=n.words,f=a,r=s.bytes,i=0;o-1>=i;i++)r[i]=c[i]!==f;else for(c=n.words,u=e.floatValueOf(a),r=s.bytes,i=0;o-1>=i;i++)r[i]=c[i]!==u;else if(h)for(l=n.wordsAsFloat32Array(),f=a,r=s.bytes,i=0;o-1>=i;i++)r[i]=l[i]!==f;else for(l=n.wordsAsFloat32Array(),u=e.floatValueOf(a),r=s.bytes,i=0;o-1>=i;i++)r[i]=l[i]!==u;e.pop(4)
- if(r=p>>3,e=c(p,8),0===e)return F(o,0,l-1,a,r);for(f=8-e,i=u(a[r],e),n=r+1,h=d-1,t=n;h>=t;t++)s=a[t],o[t-n]=255&(i|m(s,f)),i=u(s,e);return 0!==i&&(o[l-1]=i),0}function it(n,i,r,a,s){var e,t;for(t=0,e=0;i-1>=e;e++)t=t+r[e]-n[e],s[e]=255&t,t>>=8;for(e=i;a-1>=e;e++)t+=r[e],s[e]=255&t,t>>=8}function I(i){var e,t;return e=i,t=0,65536>e||(e>>>=16,t+=16),256>e||(e>>>=8,t+=8),16>e||(e>>>=4,t+=4),4>e||(e>>>=2,t+=2),2>e||(e>>>=1,++t),t+e}function t(u){var r,s,n,t,a,i;for(i=u,a=0>i?e.classLargeNegativeInteger():e.classLargePositiveInteger(),r=b(i),s=e.instantiateClassindexableSize(a,r),n=s.bytes,t=1;r>=t;t++)n[t-1]=o(i,t);return s}function h(t,o){var r,s,a,u;return s=i(t),0===(u=g(t.bytes,s))?0:(r=u+o+7>>3,a=e.instantiateClassindexableSize(n(t),r),E(o,t.bytes,s,a.bytes,r),a)}function d(t,o,l){var i,u,r,s,a;return a=g(t.bytes,l),u=a+7>>3,s=a-o,0>=s?e.instantiateClassindexableSize(n(t),0):(r=s+7>>3,i=e.instantiateClassindexableSize(n(t),r),D(o,t.bytes,u,i.bytes,r),i)}function C(s,l){var r,h,p,u,d,c,t,a,o,f;return a=i(s),o=i(l),d=n(s),o>=a?(u=s,h=a,f=l,t=o):(u=l,h=o,f=s,t=a),r=e.instantiateClassindexableSize(d,t),p=gt(u.bytes,h,f.bytes,t,r.bytes),p>0&&(c=e.instantiateClassindexableSize(d,t+1),q(r.bytes,c.bytes,t),r=c,r.bytes[t]=p),r}function p(s,a,v){var p,h,o,r,u,d,c,f,m;if("number"==typeof s){if(0>s)return e.primitiveFail();o=t(s)}else{if(n(s)===e.classLargeNegativeInteger())return e.primitiveFail();o=s}if("number"==typeof a){if(0>a)return e.primitiveFail();r=t(a)}else{if(n(a)===e.classLargeNegativeInteger())return e.primitiveFail();r=a}return c=i(o),f=i(r),f>c?(p=c,h=o,u=f,d=r):(p=f,h=r,u=c,d=o),m=e.instantiateClassindexableSize(e.classLargePositiveInteger(),u),T(v,h.bytes,p,d.bytes,u,m.bytes),e.failed()?0:l(m)}function j(r,s){var t,e;return e=i(r),t=i(s),t!==e?t>e?-1:1:V(r.bytes,s.bytes,e)}function x(m,c,k){var v,r,t,n,o,l,f,p,u;return u=i(m),p=i(c),v=k?e.classLargeNegativeInteger():e.classLargePositiveInteger(),f=u-p+1,0>=f?(r=e.instantiateClassindexableSize(e.classArray(),2),e.stObjectatput(r,1,0),e.stObjectatput(r,2,m),r):(l=8-I(s(c,p)),n=h(c,l),n=A(n,a(n)+1),t=h(m,l),a(t)===u&&(t=A(t,u+1)),o=e.instantiateClassindexableSize(v,f),mt(n.bytes,a(n),t.bytes,a(t),o.bytes,a(o)),t=d(t,l,a(n)-1),r=e.instantiateClassindexableSize(e.classArray(),2),e.stObjectatput(r,1,o),e.stObjectatput(r,2,t),r)}function a(e){return"number"==typeof e?b(e):i(e)}function W(o,u,c,r){var s,t,n,a;return n=i(o),a=i(u),t=i(c),t>=n&&t>=a&&r>=0&&255>=r?(s=e.instantiateClassindexableSize(e.classLargePositiveInteger(),t),R(o.bytes,n,u.bytes,a,c.bytes,t,r,s.bytes),l(s)):e.primitiveFail()}function B(c,a,p){var u,h,t,o,n,l,s,r;return r=i(c),s=i(a),s>=r?(o=c,t=r,u=a,n=s):(o=a,t=s,u=c,n=r),h=p?e.classLargeNegativeInteger():e.classLargePositiveInteger(),l=e.instantiateClassindexableSize(h,n+t),L(o.bytes,t,u.bytes,n,l.bytes),f(l)}function r(e,t){return t>i(e)?0:s(e,t)}function M(a,o){var m,d,u,h,v,c,p,t,s,f;if(p=n(a)===e.classLargeNegativeInteger(),t=i(a),s=i(o),t===s){for(;t>1&&r(a,t)===r(o,t);)--t;s=t}return s>t||t===s&&r(a,t)<r(o,t)?(d=o,c=s,h=a,m=t,f=p===!1):(d=a,c=t,h=o,m=s,f=p),v=c,u=e.instantiateClassindexableSize(f?e.classLargeNegativeInteger():e.classLargePositiveInteger(),v),it(h.bytes,m,d.bytes,c,u.bytes),f?y(u):l(u)}function k(){return yt}function St(e){return g(e.bytes,i(e))}function _(i){var r,u,t,l,c;if("number"==typeof i)return!0;if(u=a(i),0===u)return!1;if(0===s(i,u))return!1;if(t=4,u>t)return!0;if(t>u)return!1;if(n(i)===e.classLargePositiveInteger())return c=1073741823,s(i,t)>o(c,t);if(l=-1073741824,s(i,t)<o(l,t))return!1;for(r=1;t>=r;r++)if(s(i,r)!==o(l,r))return!0;return!1}function f(t){return n(t)===e.classLargePositiveInteger()?l(t):y(t)}function y(t){var i,e,n,u,c,l;for(e=c=a(t);0!==e&&0===s(t,e);)--e;if(0===e)return 0;if(n=4,n>=e){if(u=-1073741824,n>e||r(t,n)<o(u,n)){for(l=0,i=e;i>=1;i+=-1)l=256*l-s(t,i);return l}for(i=1;n>=i;i++)if(r(t,i)!==o(u,i))return c>e?v(t,e):t;return u}return c>e?v(t,e):t}function l(t){var i,e,n,u,l;for(e=l=a(t);0!==e&&0===s(t,e);)--e;if(0===e)return 0;if(n=4,n>=e&&r(t,n)<=o(1073741823,n)){for(u=0,i=e;i>=1;i+=-1)u=256*u+s(
- return d-=k,e.failed()?null:(e.storeIntegerofObjectwithValue(3,i,a),e.storeIntegerofObjectwithValue(4,i,n),e.storeIntegerofObjectwithValue(7,i,d),e.storeIntegerofObjectwithValue(10,i,s),e.storeIntegerofObjectwithValue(15,i,o),void e.pop(5))}function n(){var t,I,c,b,m,k,F,S,u,x,q,j,h,v,O,r,n,P,l,A,p,V,w,y,o,C,g,s,a,d;if(t=e.stackValue(5),I=e.stackIntegerValue(4),c=e.stackInt16Array(3),b=e.stackIntegerValue(2),m=e.stackIntegerValue(1),k=e.stackIntegerValue(0),s=e.fetchIntegerofObject(3,t),a=e.fetchIntegerofObject(4,t),d=e.fetchIntegerofObject(5,t),l=e.fetchIntegerofObject(7,t),w=e.fetchIntegerofObject(8,t),p=e.fetchInt16ArrayofObject(10,t),y=e.fetchInt16ArrayofObject(11,t),A=e.fetchIntegerofObject(16,t),V=e.fetchIntegerofObject(17,t),g=e.fetchIntegerofObject(18,t),o=e.fetchIntegerofObject(19,t),C=e.fetchIntegerofObject(20,t),e.failed())return null;for(x=p!==y,F=m*s>>15,S=k*s>>15,u=2*b-1,q=b+I-1,P=b;q>=P;P++){if(n=(o+=C)>>9,n>V&&l>w&&(n=(o-=g)>>9),(v=n+1)>A){if(n>A)return l=0,e.failed()?null:(e.storeIntegerofObjectwithValue(3,t,s),e.storeIntegerofObjectwithValue(4,t,a),e.storeIntegerofObjectwithValue(7,t,l),e.storeIntegerofObjectwithValue(19,t,o),e.popthenPush(6,null),null);v=0===g?n:(o-g>>9)+1}h=o&f,O=j=p[n-1]*(i-h)+p[v-1]*h>>9,x&&(O=y[n-1]*(i-h)+y[v-1]*h>>9),m>0&&(r=c[u-1]+(F*j>>15),r>32767&&(r=32767),-32767>r&&(r=-32767),c[u-1]=r),++u,k>0&&(r=c[u-1]+(S*O>>15),r>32767&&(r=32767),-32767>r&&(r=-32767),c[u-1]=r),++u,0!==a&&(s+=a,(a>0&&s>=d||0>a&&d>=s)&&(s=d,a=0),F=m*s>>15,S=k*s>>15)}return l-=I,e.failed()?null:(e.storeIntegerofObjectwithValue(3,t,s),e.storeIntegerofObjectwithValue(4,t,a),e.storeIntegerofObjectwithValue(7,t,l),e.storeIntegerofObjectwithValue(19,t,o),void e.pop(5))}function a(){var t,m,u,F,d,y,b,a,S,i,k,r,o,l,v,f,h,O,g,n,s,c;if(t=e.stackValue(5),m=e.stackIntegerValue(4),u=e.stackInt16Array(3),F=e.stackIntegerValue(2),d=e.stackIntegerValue(1),y=e.stackIntegerValue(0),n=e.fetchIntegerofObject(3,t),s=e.fetchIntegerofObject(4,t),c=e.fetchIntegerofObject(5,t),v=e.fetchIntegerofObject(7,t),f=e.fetchInt16ArrayofObject(8,t),h=e.fetchIntegerofObject(9,t),O=e.fetchIntegerofObject(10,t),g=e.fetchIntegerofObject(11,t),e.failed())return null;for(S=F+m-1,o=r=h,l=F;S>=l;l++)r=o+O,r>=g&&(r=p+(r-g)),b=f[(o>>15)-1]+f[(r>>15)-1]>>1,f[(o>>15)-1]=b,k=b*n>>15,o=r,d>0&&(a=2*l-1,i=u[a-1]+(k*d>>15),i>32767&&(i=32767),-32767>i&&(i=-32767),u[a-1]=i),y>0&&(a=2*l,i=u[a-1]+(k*y>>15),i>32767&&(i=32767),-32767>i&&(i=-32767),u[a-1]=i),0!==s&&(n+=s,(s>0&&n>=c||0>s&&c>=n)&&(n=c,s=0));return h=r,v-=m,e.failed()?null:(e.storeIntegerofObjectwithValue(3,t,n),e.storeIntegerofObjectwithValue(4,t,s),e.storeIntegerofObjectwithValue(7,t,v),e.storeIntegerofObjectwithValue(9,t,h),void e.pop(5))}function o(){var t,h,o,v,k,b,a,S,l,g,i,p,c,m,u,F,O,y,r,n,s,f;if(t=e.stackValue(5),h=e.stackIntegerValue(4),o=e.stackInt16Array(3),v=e.stackIntegerValue(2),k=e.stackIntegerValue(1),b=e.stackIntegerValue(0),n=e.fetchIntegerofObject(3,t),s=e.fetchIntegerofObject(4,t),f=e.fetchIntegerofObject(5,t),m=e.fetchIntegerofObject(7,t),F=e.fetchInt16ArrayofObject(8,t),O=e.fetchIntegerofObject(10,t),r=e.fetchIntegerofObject(11,t),u=e.fetchIntegerofObject(12,t),y=e.fetchIntegerofObject(13,t),e.failed())return null;for(S=v+h-1,l=v,c=u+(r>>>16);O>=c&&S>=l;)p=F[c-1]*n>>15,k>0&&(a=2*l-1,i=o[a-1]+(p*k>>15),i>32767&&(i=32767),-32767>i&&(i=-32767),o[a-1]=i),b>0&&(a=2*l,i=o[a-1]+(p*b>>15),i>32767&&(i=32767),-32767>i&&(i=-32767),o[a-1]=i),0!==s&&(n+=s,(s>0&&n>=f||0>s&&f>=n)&&(n=f,s=0)),r+=y,r>=d&&(g=r>>>16,u+=g,r-=g<<16),c=u+(r>>>16),++l;return m-=h,e.failed()?null:(e.storeIntegerofObjectwithValue(3,t,n),e.storeIntegerofObjectwithValue(4,t,s),e.storeIntegerofObjectwithValue(7,t,m),e.storeIntegerofObjectwithValue(11,t,r),e.storeIntegerofObjectwithValue(12,t,u),void e.pop(5))}function r(i){var t;return e=i,t=e.majorVersion()==l,t===!1?!1:t=e.minorVersion()>=c}var l=1,c=11,f=511,i=512,p=32768,d=536870912,e=null,v="SoundGenerationPlugin 3 November 2014 (e)";Squeak.registerExternalModule("SoundGenerationPlugin",{primitiveMixFMSound:s,primitiveMixSampledSound:o,setInterpreter:r,getModuleName:h
- //# sourceMappingURL=squeak.min.js.map
|