From c8bfa85c6e59759da06b39c071102f2dadc410a6 Mon Sep 17 00:00:00 2001 From: Vanessa Freudenberg Date: Fri, 15 Dec 2023 00:14:12 -0800 Subject: [PATCH] MPEG: add audio --- plopp-mpeg3-plugin.js | 193 +++++++++++++++++++++++++++++------------- squeak.js | 2 +- 2 files changed, 134 insertions(+), 61 deletions(-) diff --git a/plopp-mpeg3-plugin.js b/plopp-mpeg3-plugin.js index f19ef48..6a6ea90 100644 --- a/plopp-mpeg3-plugin.js +++ b/plopp-mpeg3-plugin.js @@ -1,5 +1,8 @@ -// fake Mpeg3Plugin, we play videos as overlay in the browser -// hardcoded to play videos at 800x600, 25fps +// Plopp Mpeg3Plugin, we play mp3 and mpg (but use mp4 for mpg) +// hardcoded to pretend we play videos at 800x600, 25fps +// and audio at 44100Hz +// empty video frames are sent to Squeak, videos are shown as overlay in the browser +// silent audio is sent to Squeak, we play directly via browser var firstTime = true; @@ -7,37 +10,41 @@ function PloppMpeg3Plugin() { "use strict"; return { - getModuleName: function () { return 'Mpeg3Plugin'; }, + getModuleName: function() { return 'Mpeg3Plugin'; }, interpreterProxy: null, primHandler: null, vm: null, - setInterpreter: function (anInterpreter) { + setInterpreter: function(anInterpreter) { this.interpreterProxy = anInterpreter; this.vm = this.interpreterProxy.vm; this.primHandler = this.vm.primHandler; return true; }, - primitiveMPEG3CheckSig: function (argCount) { + primitiveMPEG3CheckSig: function(argCount) { + // assume any file is valid return this.primHandler.popNandPushBoolIfOK(argCount + 1, true); }, - primitiveMPEG3Open: function (argCount) { + primitiveMPEG3Open: function(argCount) { var pathObj = this.interpreterProxy.stackObjectValue(0); var path = pathObj.bytesAsString(); // hack to find mp4 in Plopp directory path = path.replace(/.*\/Plopp\//, ""); path = path.replace(/\.mpg$/, ".mp4"); - // create video element - var video = document.createElement("video"); - video.src = path; - video.playsInline = true; // Safari - document.body.appendChild(video); + var isAudio = path.match(/\.mp3$/); + // create player element + var player = document.createElement(isAudio ? "audio" : "video"); + player.src = path; + player.playsInline = true; // Safari + player.isAudio = isAudio; + player.isVideo = !isAudio; + if (player.isVideo) document.body.appendChild(player); // create handle var handle = this.primHandler.makeStString("squeakjs-mpeg:" + path); - handle.video = video; - // freeze VM until video is actually playing + handle.player = player; + // freeze VM until player is actually playing // which may need a user gesture var button; if (firstTime) { // only show button once @@ -46,29 +53,31 @@ function PloppMpeg3Plugin() { button.style.opacity = 0.01; button.style.transition = "opacity 0.5s"; setTimeout(function() { button.style.opacity = 1; }, 100); - button.onclick = function() { video.play(); }; + button.onclick = function() { player.play(); }; document.body.appendChild(button); firstTime = false; } try { // this works in Chrome and Firefox - video.play(); + player.play(); // once playing, we'll remove the button // on Safari, user will have to click it } catch (err) {}; this.vm.freeze(function(unfreeze) { - video.addEventListener('timeupdate', - function () { - if (video.currentTime < 0.1) return; // not playing yet + player.addEventListener('timeupdate', + function() { + if (player.currentTime < 0.1) return; // not playing yet if (!unfreeze) return; // already failed or started - console.log("primitiveMPEG3Open: " + video.videoWidth + "x" + video.videoHeight + ", " + video.duration + "s " + video.src); + console.log("primitiveMPEG3Open: " + + (player.isVideo? player.videoWidth + "x" + player.videoHeight + ", " : "") + + player.duration + "s " + player.src); // continue if (button) button.style.display = "none"; unfreeze(); unfreeze = null; // don't unfreeze twice }, ); - video.onerror = function (err) { + player.onerror = function(err) { if (!unfreeze) return; // too late console.error("primitiveMPEG3Open: error", err); if (button) button.style.display = "none"; @@ -82,94 +91,158 @@ function PloppMpeg3Plugin() { return true; }, - videoFromStackArg: function (n) { + primitiveMPEG3Close: function(argCount) { + var player = this.playerFromStackArg(0); + if (!player) return false; + console.log("primitiveMPEG3Close", player.src); + player.pause(); + if (player.isVideo) player.remove(); + try { + player.removeAttribute('src'); + player.load(); + } catch (err) {} + this.interpreterProxy.pop(argCount); + return true; + }, + + playerFromStackArg: function(n) { var handle = this.interpreterProxy.stackObjectValue(n); if (this.interpreterProxy.failed()) return null; - return handle.video; + return handle.player; }, - primitiveMPEG3HasAudio: function (argCount) { - return this.primHandler.popNandPushBoolIfOK(argCount + 1, false); + primitiveMPEG3HasAudio: function(argCount) { + var player = this.playerFromStackArg(0); + return this.primHandler.popNandPushBoolIfOK(argCount + 1, player && player.isAudio); }, - primitiveMPEG3HasVideo: function (argCount) { - return this.primHandler.popNandPushBoolIfOK(argCount + 1, true); + primitiveMPEG3HasVideo: function(argCount) { + var player = this.playerFromStackArg(0); + return this.primHandler.popNandPushBoolIfOK(argCount + 1, player && player.isVideo); }, - primitiveMPEG3TotalVStreams: function (argCount) { - return this.primHandler.popNandPushIntIfOK(argCount + 1, 1); + //////////// VIDEO ///////////// + + primitiveMPEG3TotalVStreams: function(argCount) { + var player = this.playerFromStackArg(0); + return this.primHandler.popNandPushIntIfOK(argCount + 1, player && player.isVideo ? 1 : 0); }, - primitiveMPEG3FrameRate: function (argCount) { + primitiveMPEG3FrameRate: function(argCount) { return this.primHandler.popNandPushIntIfOK(argCount + 1, 25); }, - primitiveMPEG3VideoWidth: function (argCount) { + primitiveMPEG3VideoWidth: function(argCount) { return this.primHandler.popNandPushIntIfOK(argCount + 1, 800); }, - primitiveMPEG3VideoHeight: function (argCount) { + primitiveMPEG3VideoHeight: function(argCount) { return this.primHandler.popNandPushIntIfOK(argCount + 1, 600); }, - primitiveMPEG3ReadFrame: function (argCount) { + primitiveMPEG3ReadFrame: function(argCount) { + // console.log("primitiveMPEG3ReadFrame"); this.interpreterProxy.pop(argCount); return true; }, - primitiveMPEG3GetFrame: function (argCount) { - var video = this.videoFromStackArg(1); - if (!video) return false; - var frame = Math.floor(video.currentTime * 25); - // var frames = Math.floor(video.duration * 25); - // console.log("frame", frame, "of", frames); + primitiveMPEG3GetFrame: function(argCount) { + var player = this.playerFromStackArg(1); + if (!player) return false; + var frame = Math.floor(player.currentTime * 25); + var frames = Math.floor(player.duration * 25); + // console.log("primitiveMPEG3GetFrame", frame, "of", frames); + if (frame >= frames) frame = frames - 1; return this.primHandler.popNandPushIntIfOK(argCount + 1, frame); }, - primitiveMPEG3VideoFrames: function (argCount) { - var video = this.videoFromStackArg(1); - if (!video) return false; - var frames = Math.floor(video.duration * 25); + primitiveMPEG3VideoFrames: function(argCount) { + var player = this.playerFromStackArg(1); + if (!player) return false; + var frames = Math.floor(player.duration * 25); + // console.log("primitiveMPEG3VideoFrames", frames); return this.primHandler.popNandPushIntIfOK(argCount + 1, frames); }, - primitiveMPEG3SetFrame: function (argCount) { - var video = this.videoFromStackArg(2); - if (!video) return false; + primitiveMPEG3SetFrame: function(argCount) { + var player = this.playerFromStackArg(2); + if (!player) return false; var frame = this.interpreterProxy.stackIntegerValue(1); - video.currentTime = frame / 25; + // player.currentTime = frame / 25; + console.log("IGNORING primitiveMPEG3SetFrame", frame, "(current time is", player.currentTime, ")"); this.interpreterProxy.pop(argCount); return true; }, - primitiveMPEG3DropFrames: function (argCount) { + primitiveMPEG3DropFrames: function(argCount) { + var count = this.interpreterProxy.stackIntegerValue(1); + // console.log("primitiveMPEG3DropFrames", count); this.interpreterProxy.pop(argCount); return true; }, - primitiveMPEG3ReadFrameBufferOffset: function (argCount) { + primitiveMPEG3ReadFrameBufferOffset: function(argCount) { return this.primHandler.popNandPushIntIfOK(argCount + 1, 0); }, - primitiveMPEG3EndOfVideo: function (argCount) { - var video = this.videoFromStackArg(1); - if (!video) return false; - // console.log("primitiveMPEG3EndOfVideo:", video.ended); - return this.primHandler.popNandPushBoolIfOK(argCount + 1, video.ended); + primitiveMPEG3EndOfVideo: function(argCount) { + var player = this.playerFromStackArg(1); + if (!player) return false; + // console.log("primitiveMPEG3EndOfVideo:", player.ended); + return this.primHandler.popNandPushBoolIfOK(argCount + 1, player.ended); + }, + + //////////// AUDIO ///////////// + + primitiveMPEG3AudioChannels: function(argCount) { + // console.log("primitiveMPEG3AudioChannels", 1); + // Plopp audio is always mono + // but even if it was stereo - we're not sending samples to Squeak + // so it doesn't matter + return this.primHandler.popNandPushIntIfOK(argCount + 1, 1); + }, + + primitiveMPEG3SampleRate: function(argCount) { + // console.log("primitiveMPEG3SampleRate", 44100); + return this.primHandler.popNandPushIntIfOK(argCount + 1, 44100); + }, + + primitiveMPEG3GetSample: function(argCount) { + var player = this.playerFromStackArg(1); + if (!player) return false; + var sample = Math.floor(player.currentTime * 44100); + var samples = Math.floor(player.duration * 44100); + // console.log("primitiveMPEG3GetSample", sample, "of", samples); + if (sample >= samples) sample = samples - 1; + return this.primHandler.popNandPushIntIfOK(argCount + 1, sample); + }, + + primitiveMPEG3AudioSamples: function(argCount) { + var player = this.playerFromStackArg(1); + if (!player) return false; + var samples = Math.floor(player.duration * 44100); + // console.log("primitiveMPEG3AudioSamples", samples); + return this.primHandler.popNandPushIntIfOK(argCount + 1, samples); }, - primitiveMPEG3Close: function (argCount) { - var video = this.videoFromStackArg(0); - if (!video) return false; - video.pause(); - video.remove(); - console.log("primitiveMPEG3Close", video.src); + primitiveMPEG3ReadAudio: function(argCount) { + // console.log("primitiveMPEG3ReadAudio"); this.interpreterProxy.pop(argCount); return true; }, + + primitiveMPEG3EndOfAudio: function(argCount) { + var player = this.playerFromStackArg(1); + if (!player) return false; + if (player.ended) { + console.log("primitiveMPEG3EndOfAudio:", player.ended); + debugger + } + return this.primHandler.popNandPushBoolIfOK(argCount + 1, player.ended); + } }; } -document.addEventListener("DOMContentLoaded", function () { +document.addEventListener("DOMContentLoaded", function() { Squeak.registerExternalModule('Mpeg3Plugin', PloppMpeg3Plugin()); }, false); \ No newline at end of file diff --git a/squeak.js b/squeak.js index d9ee1c7..129a27e 100644 --- a/squeak.js +++ b/squeak.js @@ -1 +1 @@ -!function(){"use strict";if(self.Squeak||(self.Squeak={}),!Squeak.Settings){var settings;try{if(settings=self.localStorage,settings["squeak-foo:"]="bar","bar"!==settings["squeak-foo:"])throw Error();delete settings["squeak-foo:"]}catch(e){settings={}}Squeak.Settings=settings}function yS(e,t){return 31>>t}function HS(){return FS}function IS(e,t){var r,i,a;for((i=t-e)<0&&(i=0-i),r=63,a=1;a<=62;a++)63===r&&GS[a-1]>=i&&(r=a);return r}function JS(e){var t,r,i;for(r=0,t=e;;){if(!(0<(i=t-AS)))return r+=zS(CS,0-i),CS&=zS(255,8-(AS-=t)),r;r+=yS(CS,i),t-=AS,CS=DS[++BS-1],AS=8}}function KS(e,t){var r,i,a,s;for(i=t,a=e;;){if(!((s=(r=8-AS)-a)<0))return CS+=yS(i,s),AS+=a,self;CS+=zS(i,0-s),DS[++BS-1]=CS,i&=yS(1,(CS=AS=0)-s)-1,a-=r}}function LS(){var e,t,r,i,a,s,n,o,u,l,c,h,f,d,p,b,m;if(e=ES.stackValue(1),t=ES.stackIntegerValue(0),p=ES.fetchIntegerofObject(0,e),f=ES.fetchIntegerofObject(1,e),u=ES.fetchIntegerofObject(2,e),c=ES.fetchIntegerofObject(3,e),l=ES.fetchIntegerofObject(4,e),h=ES.fetchIntegerofObject(5,e),CS=ES.fetchIntegerofObject(6,e),AS=ES.fetchIntegerofObject(7,e),BS=ES.fetchIntegerofObject(8,e),DS=ES.fetchBytesofObject(9,e),m=ES.fetchInt16ArrayofObject(10,e),b=ES.fetchIntegerofObject(12,e),o=ES.fetchIntegerofObject(13,e),GS=ES.fetchInt16ArrayofObject(14,e),d=ES.fetchInt16ArrayofObject(15,e),ES.failed())return null;for(a=1;a<=t;a++)if(1==(a&h))32767<(p=JS(16))&&(p-=65536),f=JS(6),m[++b-1]=p;else{for(i=JS(o),n=GS[f],s=0,r=l;0>>=1,r>>>=1;s+=n,0<(i&u)?p-=s:p+=s,32767>>=1,d>>>=1,r>>>=1;u+=f,l+=d,0<(i&b)?c-=u:c+=u,0<(a&b)?h-=l:h+=l,32767>>=1,r>>>=1;o+=l,0=xS}var wS,xS,AS,BS,CS,DS,ES,FS,GS,uU,vU,FU,GU,HU,IU,JU,KU,LU,MU,NU,OU,PU,QU,RU,SU,TU,UU,VU,WU,XU,YU,ZU,$U,_U,aV,bV,cV,dV,eV,fV,gV,hV,iV,jV,kV,lV,mV,nV,oV,pV,qV,rV,sV,tV,uV,vV,wV,xV,yV,zV,AV,BV,CV,DV,EV,FV,GV,HV,IV,JV,KV,LV,MV,NV,OV,PV,QV,RV,SV,TV,UV,VV,WV,XV,YV,ZV,$V,_V,aW,bW,cW,dW,eW,fW,gW,hW,iW,jW,kW,lW,mW,nW,oW,pW,qW,rW,sW,tW,uW,vW,wW,xW,yW,zW,AW,BW,CW,DW,EW,FW,GW,HW,IW,JW,KW,LW,MW,NW,OW,PW,QW,RW,SW,TW,UW,VW,WW,XW,YW,ZW,$W,_W,aX,bX,cX,dX,eX,fX,gX,hX,iX,jX,kX,lX,mX,nX,oX,pX,qX,rX,sX,tX,uX,vX,wX,xX,yX,zX,AX,BX,CX,DX,EX,FX,GX,HX,IX,JX,KX,LX,MX,NX,OX,PX,QX,RX,SX,TX,UX,VX,WX,XX,YX,ZX,$X,_X,aY,bY,cY,dY,eY,fY,gY,hY,iY,jY,kY,lY,mY,nY,oY,pY,qY,rY,sY,tY,uY,vY,wY,xY,yY,zY,AY,BY,CY,DY,EY,FY,GY,HY,IY,JY,KY,LY,MY,NY,OY,Psa,Qsa,Zsa,$sa,_sa,ata,bta,cta,dta,eta,fta,gta,hta,ita,jta,kta,lta,mta,nta,ota,pta,qta,rta,sta,tta,uta,vta,wta,xta,yta,zta,Ata,Bta,Cta,Dta,Eta,Fta,Gta,Hta,Ita,Jta,Kta,Lta,Mta,Nta,Ota,Pta,Qta,Rta,Sta,Tta,Uta,Vta,Wta,Xta,Yta,Zta,$ta,_ta,aua,bua,cua,dua,eua,fua,gua,hua,iua,jua,kua,lua,mua,nua,oua,pua,qua,rua,sua,tua,uua,vua,wua,xua,yua,zua,Aua,Bua,Cua,Dua,Eua,Fua,Gua,Hua,Iua,Jua,Kua,Lua,Mua,Nua,Oua,Pua,Qua,Rua,Sua,Tua,Uua,Vua,Wua,Xua,Yua,Zua,$ua,_ua,ava,bva,cva,dva,eva,fva,gva,nIa,oIa,sIa,tIa,uIa,vIa,wIa,xIa,yIa,zIa,AIa,BIa,CIa,DIa,DJa,EJa,GJa,HJa,KLa,LLa,OLa,PLa,mNa,nNa,tNa,uNa,vNa,wNa,xNa,yNa,zNa,ANa,BNa,CNa,DNa,ENa,FNa,GNa,HNa,INa,JNa,KNa,LNa,MNa,NNa,ONa,PNa,QNa,RNa,SNa,TNa,UNa,VNa,WNa,XNa,YNa,ZNa,$Na,_Na,aOa,bOa,cOa,dOa,eOa,fOa,gOa,hOa,iOa,jOa,kOa,lOa,mOa,nOa,oOa,pOa,qOa,rOa,sOa,tOa,uOa,UQa,VQa,$Qa,_Qa,aRa,bRa,cRa,dRa,eRa,V$a,W$a,_$a,a_a,b_a,c_a,d_a,e_a,f_a,zeb,Aeb,Eeb,Feb,Geb,Heb,Ieb,Jeb,Keb,Leb,Meb,Neb,Oeb,Peb,Qeb,Reb,Seb,Teb,Ueb,Veb,Web,Xeb,Yeb,Zeb,$eb,_eb,afb,bfb,cfb,dfb,efb,ffb,gfb,hfb,ifb,jfb,kfb,lfb,mfb,nfb,ofb,pfb,qfb,rfb,sfb,tfb,ufb,vfb,wfb,xfb,yfb,zfb,Afb,Bfb,Cfb,Dfb,Efb,Ffb,Gfb,Hfb,Ifb,Jfb,Kfb,Lfb,Mfb,Nfb,Ofb,Pfb,Qfb,Rfb,Sfb,Tfb,Ufb,Vfb,Wfb,Xfb,Yfb,Zfb,$fb,_fb,agb,bgb,cgb,dgb,egb,fgb,ggb,hgb,igb,jgb,kgb,lgb,mgb,ngb,ogb,pgb,qgb,rgb,sgb,tgb,ugb,vgb,ekb,fkb,mkb,nkb,okb,pkb,qkb,Usb,Vsb,Ysb,Zsb,$sb,_sb,atb,btb,Qub,Rub,Vub,Wub,$wb,_wb,dxb,exb,THb,UHb,XHb,YHb,ZHb,$Hb,_Hb,aIb,zKb,AKb,EKb,FKb,JLb,KLb,SLb,TLb,ULb,VLb,WLb,XLb,YLb,ZLb,$Lb,_Lb,aMb,bMb,cMb,dMb,eMb,fMb,gMb,hMb,iMb,jMb,kMb,lMb,mMb,nMb,oMb,pMb,qMb,rMb,sMb,tMb,uMb,vMb,wMb,xMb,yMb,zMb,AMb,BMb,CMb,DMb,EMb,FMb,GMb,HMb,IMb,JMb,KMb;function wU(e){return"number"==typeof e?IY.classSmallInteger():e.sqClass}function xU(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function zU(e,t){return 0|Math.floor(e/t)}function BU(e,t){return 31>>t}function DU(e,t){return new Int32Array(e.buffer,e.byteOffset+4*t)}function EU(e,t){return new Float32Array(e.buffer,e.byteOffset+4*t)}function PY(){return OY[dX]}function QY(e){return OY[dX]=e}function RY(){return OY[eX]}function TY(e,t){var r;return t<(r=e+WY()-1&~(WY()-1))?t:r}function VY(e,t){return t-1&~(WY()-1)}function WY(){return OY[gX]}function YY(){return OY[hX]}function ZY(e){return OY[hX]=e}function $Y(){return OY[iX]}function _Y(e){return OY[iX]=e}function bZ(e,t){var r;return 0===e?t<0?0-t:t:0===t?e<0?0-e:e:(r=e*e+t*t)<32?[0,1,1,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,6][r]:Math.sqrt(r)+.5|0}function cZ(e){oZ(1)&&(HY[e0()]=e,f0(e0()+1))}function gZ(){return OY[jX]}function hZ(e){return OY[jX]=e}function iZ(){return OY[kX]}function jZ(e){return OY[kX]=e}function kZ(e){return K1(e)}function mZ(){return J4(6),K4()}function nZ(e,t){var r,i,a,s;if(!rZ(a=eV+e))return 0;if(MY=(i=MY)+a,$1(i,cW),W1(i,0),Y1(i,a),r=F$(i),j0())for(s=0;s<=e-1;s++)r[s]=y4(t[s]);else for(s=0;s<=e-1;s++)r[s]=t[s];return P1(i,aV,e),i}function oZ(e){var t,r,i,a;if(kZ(e)){if(0!==iZ())for(i=iZ(),t=iZ()+e,r=1,a=iZ();r<=a;r++)xY[--t]=xY[--i];return xY=DU(xY,e),1}}function pZ(e,t,r){var i,a,s,n;if(!rZ(a=PW+t))return 0;if(MY=(i=MY)+a,$1(i,r?jW:iW),W1(i,0),Y1(i,a),n=i0(i),j0())for(s=0;s<=t-1;s++)n[s]=y4(e[s]);else for(s=0;s<=t-1;s++)n[s]=e[s];return P1(i,NW,t),i}function rZ(e){var t,r,i,a;if(oZ(e)){if(0!==e0())for(i=e0(),t=e0()+e,r=1,a=e0();r<=a;r++)HY[--t]=HY[--i];return HY=DU(HY,e),1}}function tZ(){return J4(3)}function wZ(e){return 0==(O1(e,aW)&yV)}function xZ(e,t,r){if(r>>5&31)<<3,l=(h>>>10&31)<<3,h=(a+=a>>>5)+((u+=u>>>5)<<8)+((l+=l>>>5)<<16)+(255<<24)):h=0===O1(e,aV)?0:F$(e)[h]),E4(h)}function WZ(e){return O1(e,$U)}function YZ(e){return L4(K4()-e+4)}function ZZ(e,t){return M4(K4()-e+4,t)}function $Z(e){return L4(K4()-e+5)}function _Z(e,t){return M4(K4()-e+5,t)}function a$(e){return L4(K4()-e+0)}function b$(e,t){return M4(K4()-e+0,t)}function c$(e){return L4(K4()-e+1)}function d$(e,t){return M4(K4()-e+1,t)}function e$(e){return L4(K4()-e+2)}function f$(e,t){return M4(K4()-e+2,t)}function g$(e){return L4(K4()-e+3)}function h$(e,t){return M4(K4()-e+3,t)}function i$(e,t,r){var i,a,s,n,o,u;for(s=xU(e),i=e.wordsAsInt32Array(),a=n=0;a<=s-1;a++){if(o=m3(a,i),!(0<=(u=n3(a,i))&&u<=t))return;n+=o}return n===r}function m$(e,t,r,i,a,s,n){var o,u,l,c;if((u=e,l=t,IY.isWords(u)&&((c=xU(u))===3*l||c===6*l))&&(function(e){var t,r,i;if(IY.isWords(e)){for(i=xU(e),t=e.wordsAsInt32Array(),r=0;r<=i-1;r++)if(!C0(t[r]))return;return 1}}(n)&&i$(r,o=xU(n),t)&&i$(i,o,t)&&i$(s,o,t)&&function(e,t){var r,i,a,s;for(i=xU(e),s=e.wordsAsInt32Array(),r=a=0;r<=i-1;r++)a+=m3(r,s);return a===t}(a,t)))return 1}function o$(e){return(Z1(e)&oW)===hW?function(e){var t;t=G0(e)?c5(e):0;if(R0(e)+t=x_()&&P0(e)-t>=x_())return 0;cZ(e)}(e):(Z1(e)&oW)===bW?(r=G0(t=e)?T4(t):0,!(AZ(t)+r=x_()&&yZ(t)-r>=x_())&&void cZ(t)):void cZ(e);var t,r}function q$(){return[1,.98078528040323,.923879532511287,.831469612302545,.7071067811865475,.555570233019602,.38268343236509,.1950903220161286,0,-.1950903220161283,-.3826834323650896,-.555570233019602,-.707106781186547,-.831469612302545,-.9238795325112865,-.98078528040323,-1,-.98078528040323,-.923879532511287,-.831469612302545,-.707106781186548,-.555570233019602,-.3826834323650903,-.1950903220161287,0,.1950903220161282,.38268343236509,.555570233019602,.707106781186547,.831469612302545,.9238795325112865,.98078528040323,1]}function r$(){return[0,.1950903220161282,.3826834323650897,.555570233019602,.707106781186547,.831469612302545,.923879532511287,.98078528040323,1,.98078528040323,.923879532511287,.831469612302545,.7071067811865475,.555570233019602,.38268343236509,.1950903220161286,0,-.1950903220161283,-.3826834323650896,-.555570233019602,-.707106781186547,-.831469612302545,-.9238795325112865,-.98078528040323,-1,-.98078528040323,-.923879532511287,-.831469612302545,-.707106781186548,-.555570233019602,-.3826834323650903,-.1950903220161287,0]}function s$(e,t){return e<0?0:t<=e?t-1:e}function t$(){var e,t;for((e=CU(x3(),$Y()))<0&&(e=0),(t=CU(t3(),$Y())+1)>v3()&&(t=v3());e>1,l=o+=(r=$Z(e))-d>>1,u+=(i+=f-c>>1)-n>>1,l+=(a+=d-h>>1)-o>>1,f$(e,i),h$(e,a),ZZ(e,u),_Z(e,l),b$(s,u),d$(s,l),f$(s,n),h$(s,o),ZZ(s,t),_Z(s,r),s)}function I$(e,t){var r,i,a;r=EZ(e)[lV]>>8,(i=X4(e)[lV]>>8)w$()&&(r=w$()),(i=CU(e,$Y()))=y$()||r=w$()||(a=t,s=r,n=i,(zY||u0())&&zY(a,s,n))}function V$(e){return $1(e,Z1(e)|yV)}function W$(e){return $1(e,Z1(e)&~yV)}function Y$(e,t){return P1(e,XV,t)}function Z$(e){return O1(e,ZV)}function $$(e,t){return P1(e,ZV,t)}function a_(e,t){return P1(e,YV,t)}function b_(){return EU(OY,JX)}function d_(e){return O1(e,yW)}function e_(e,t){return P1(e,yW,t)}function f_(e){return O1(e,zW)}function g_(e,t){return P1(e,zW,t)}function h_(e){return O1(e,AW)}function i_(e,t){return P1(e,AW,t)}function j_(e,t){var r,i,a;for(r=q4(),i=e,a=x4();a>16,O=b>>16,S||(I=s$(I,u),O=s$(O,o)),0<=I&&0<=O&&I>16,O=b>>16,S||(I=s$(I,u),O=s$(O,o)),0<=I&&0<=O&&I>16,O=b>>16,S||(I=s$(I,u),O=s$(O,o)),0<=I&&0<=O&&I>16,g=h>>16,p||(v=s$(v,n),g=s$(g,s)),0<=v&&0<=g&&v>16)<0||u<=o)&&l>16)>16,h=TY(v=a,s),d=VY(0,s),u=PY(),l=RY();for(;v>16===p;)f=CU(v,o),NY[f]=NY[f]+m,++v,c+=i;p=c>>16}u=4042322160|CU(PY(),$Y()),l=$Y();for(;v>16===p;)f=CU(v,o),NY[f]=NY[f]+m,v+=n,c+=BU(i,l);p=c>>16}u=PY(),l=RY();for(;v>16===p;)f=CU(v,o),NY[f]=NY[f]+m,++v,c+=i;p=c>>16}return v}(e,n,a,s,l,r);l>16,l>>16)>=h&&p>16,(u=0|r[1])>>16)],l=(h-1)*(h-1),d=s,(p=n)>J_(e)&&(p=J_(e));d>16,u>>16)>=l;)NY[d]=f,++d,o+=i,u+=a;for(c=z3(o>>16,u>>16);c>16,f>>16))-1)*(g-1),_=s,n<(S=J_(e))&&(S=n),d=TY(s,S),b=VY(0,S),_>16,f>>16)>=m;)p=CU(_,u),NY[p]=NY[p]+k,++_,h+=i,f+=a;for(v=z3(h>>16,f>>16);v>16,f>>16)>=m;)p=CU(_,u),NY[p]=NY[p]+k,_+=o,h+=BU(i,c),f+=BU(a,c);for(v=z3(h>>16,f>>16);v>16,f>>16)>=m;)p=CU(_,u),NY[p]=NY[p]+k,++_,h+=i,f+=a;for(v=z3(h>>16,f>>16);v>16,u>>16),p=t[f],d=g0(e),c=(d-1)*(d-1),h=(f+1)*(f+1),l=z3(o>>16,u>>16),b=s,m=n;for(;b>16,u>>16)<=h;)NY[b]=p,++b,o+=i,u+=a;for(l=z3(o>>16,u>>16);h>16,f>>16),_=g0(e),v=(_-1)*(_-1),g=(k+1)*(k+1),b=z3(h>>16,f>>16),d=TY(y=s,n),m=VY(0,n),y>16,f>>16)<=g;)p=CU(y,u),NY[p]=NY[p]+S,++y,h+=i,f+=a;for(b=z3(h>>16,f>>16);g>16,f>>16)<=g;)p=CU(y,u),NY[p]=NY[p]+S,y+=o,h+=BU(i,c),f+=BU(a,c);for(b=z3(h>>16,f>>16);g>16,f>>16)<=g;)p=CU(y,u),NY[p]=NY[p]+S,++y,h+=i,f+=a;for(b=z3(h>>16,f>>16);g>>0>>0}function U_(e,t,r){var i,a,s,n,o,u;if(0===e)return!1;if(a=tBU(v3(),$Y())?BU(v3(),$Y()):r,ax_()&&(s=x_()),at3()&&u3(s),s>r3()&&s3(s),s<=a)return!1;if(B0(e))o_(e,a,s);else{if(u=e,OY[UX]=u,o=a,OY[VX]=o,n=s,OY[WX]=n,(i=(Z1(e)&gW)>>>8)<=1)return!0;switch(i){case 0:case 1:break;case 2:u_();break;case 3:P_();break;case 4:case 5:k_()}}return!1}function W_(){var e,t,r;for(r=M$();c0()r)return!1;if(((t=Z1(e))&oW)===dW)return!0;if(!K1(1))return!1;switch(t){case 0:case 1:case 2:case 3:break;case 4:N3(HY[c0()],M$());break;case 5:!function(e,t){var r,i,a,s,n,o,u,l;a=c5(e),i=_1(a),n=d_(e),o=f_(e),N3(e,o),s=Z$(e),u=Z0(e),e_(e,n-i),$$(e,s+a),0=x_())return!1;if(_2(t),G0(e)&&o4(e),wZ(e)&&(n4(e),EY))return!1;hZ(gZ()+1),gZ()=B_()&&j_(t,r)}return r=F3()?-1:r}function $_(){return I3()===rW}function __(){var e;e=3,O4(N4()+e)}function a0(){return KY}function b0(e,t){var r;return e===t||(0!==(r=f_(e)-f_(t))?r<0:(r=d_(e)-d_(t))<0)}function c0(){return OY[OX]}function d0(e){return OY[OX]=e}function e0(){return OY[PX]}function f0(e){return OY[PX]=e}function g0(e){return O1(e,NW)}function i0(e){return DU(LY,e+OW)}function j0(){return 0!==OY[QX]}function l0(e){return OY[QX]=e}function m0(){return 0!==OY[RX]}function o0(e){return OY[RX]=e}function p0(e,t){var r,i,a,s,n;if(-1===(r=Z_(e,t)))return!1;if(0===r)return __(),!0;if(H3(r,G3(0)),B3(r,A3(0)),E3(r,D3(0)),__(),F3()<=3)return!0;for(n=0,r=3;rv3()&&x$(v3()),e=BU(A$(),$Y()),OY[MX]=e,t=BU(C$(),$Y()),OY[NX]=t,r=BU(w$(),$Y()),OY[KX]=r,i=BU(y$(),$Y()),OY[LX]=i,f0(0),jZ(0),HY=DU(LY,MY),xY=DU(LY,MY),function(){var e,t;for(t=0,e=MY;t=z_()||o$(t)),t+=O1(t,_V)}(),EY||(0!==e0()?(function e(t,r,i){var a;var s;var n;var o;var u;var l;var c;var h;var f;var d;var p;if((f=i+1-r)<=1)return 0;n=t[r];u=t[i];s=b0(n,u);s||(d=t[r],t[r]=t[i],t[i]=d,p=n,n=u,u=p);if(f<=2)return 0;l=r+i>>1;o=t[l];s=b0(n,o);s?(s=b0(o,u))||(d=t[i],t[i]=t[l],t[l]=d,o=u):(d=t[r],t[r]=t[l],t[l]=d,o=n);if(f<=3)return 0;c=r;h=i;a=!0;for(;a;){for(s=!0;s;)s=c<=--h&&(d=t[h],b0(o,d));for(s=!0;s;)s=++c<=h&&b0(d=t[c],o);(a=c<=h)&&(d=t[c],t[c]=t[h],t[h]=d)}e(t,r,h);e(t,c,i)}(HY,0,e0()-1),N$(f_(HY[0])),M$()xU(FY)?null:(r=IY.fetchPointerofObject(i,FY),xU(t=IY.fetchPointerofObject(0,r))!==O1(e,ZU)?null:t.wordsAsInt32Array())}function l1(e,t,r,i,a,s,n){var o,u,l,c,h,f,d,p;if(i!==a||0!==s&&0!==n){if(o=6*e,p=r?(l=(t.int16Array||(t.int16Array=new Int16Array(t.buffer,t.byteOffset)))[0+o],f=(t.int16Array||(t.int16Array=new Int16Array(t.buffer,t.byteOffset)))[1+o],c=(t.int16Array||(t.int16Array=new Int16Array(t.buffer,t.byteOffset)))[2+o],d=(t.int16Array||(t.int16Array=new Int16Array(t.buffer,t.byteOffset)))[3+o],h=(t.int16Array||(t.int16Array=new Int16Array(t.buffer,t.byteOffset)))[4+o],(t.int16Array||(t.int16Array=new Int16Array(t.buffer,t.byteOffset)))[5+o]):(l=0|t[0+o],f=0|t[1+o],c=0|t[2+o],d=0|t[3+o],h=0|t[4+o],0|t[5+o]),l===c&&f===d||c===h&&d===p)return(l!==h||f!==p)&&(a2()[0]=l,a2()[1]=f,b2()[0]=h,b2()[1]=p,C4(2),D1(s,a2(),b2(),n,i,a));a2()[0]=l,a2()[1]=f,b2()[0]=c,b2()[1]=d,c2()[0]=h,c2()[1]=p,C4(3),u=c1(a2(),b2(),c2(),0!==s&&0!==n),EY||C1(s,n,i,a,u)}}function n1(e){var t;return t=OY[TX],xU(e)>1),l=2*(l=r$()[2*e+1]*r+a|0)-(u+c>>1),b2()[0]=n,b2()[1]=l}function v1(e,t){var r;return wU(t)===IY.classPoint()&&("number"==typeof(r=IY.fetchPointerofObject(0,t))||r.isFloat)?(e[0]="number"==typeof r?r:0|IY.floatValueOf(r),"number"==typeof(r=IY.fetchPointerofObject(1,t))||r.isFloat?void(e[1]="number"==typeof r?r:0|IY.floatValueOf(r)):IY.primitiveFail()):IY.primitiveFail()}function y1(){var e,t,r,i;return 2!==IY.methodArgumentCount()?wY:0!==(t=Y2(IY.stackValue(2)))?t:(r=IY.stackObjectValue(0),e=IY.stackObjectValue(1),IY.failed()?vY:0!==(t=A1(IY.fetchPointerofObject(IU,DY)))?t:h1(IY.fetchPointerofObject(GU,DY))?q1(IY.fetchPointerofObject(HU,DY))?xU(e)=c$(c)?(e_(l,a$(c)),g_(l,c$(c)-d),GZ(l,e$(c)),IZ(l,g$(c)-d),zZ(l,YZ(c)),BZ(l,$Z(c)-d)):(e_(l,YZ(c)),g_(l,$Z(c)-d),GZ(l,e$(c)),IZ(l,g$(c)-d),zZ(l,a$(c)),BZ(l,c$(c)-d)),i_(l,O$()),Y$(l,h),a_(l,f),u&&(P1(s,sV,t),Z4(s,e),P1(s,rV,e)),n-=6}H4()}function D1(e,t,r,i,a,s){var n,o,u,l;if(o=0===e||0===i?(n=rZ(QW)?(MY=(l=MY)+QW,$1(l,hW),W1(l,0),Y1(l,QW),l):0,0):(n=rZ($W)?(MY=(u=MY)+$W,$1(u,nW),W1(u,0),Y1(u,$W),u):0,_1(e)),EY)return 0;s1(n,t,r,o,a,s),G0(n)&&(P1(n,ZW,i),h5(n,e),P1(n,YW,e))}function F1(e){return"number"==typeof e?OV:IY.isWords(e)?xU(e)F4()?TV:0)):PV}function I1(e){0===strcmp(e,yY)&&(zY=JY=0)}function K1(e){return!(SX+MY+e0()+iZ()+e>N4())||(_3(GW),!1)}function L1(){return 0!==OY[$X]}function N1(e){return OY[$X]=e}function O1(e,t){return LY[e+t]}function P1(e,t,r){return LY[e+t]=r}function Q1(){return OY[_X]}function S1(){return OY[aY]}function T1(e){return OY[aY]=e}function V1(e){return O1(e,$V)}function W1(e,t){return P1(e,$V,t)}function Y1(e,t){return P1(e,_V,t)}function Z1(e){return O1(e,aW)&kW}function $1(e,t){return P1(e,aW,t)}function _1(e){return e>>1}function a2(){return DU(OY,bY)}function b2(){return DU(OY,cY)}function c2(){return DU(OY,dY)}function d2(){return DU(OY,eY)}function e2(){c0()>=e0()&&0===iZ()&&J3(rW),M$()>=z_()&&J3(rW)}function f2(){var e;return 0!==IY.methodArgumentCount()?IY.primitiveFailFor(wY):0!==(e=Y2(IY.stackValue(0)))?IY.primitiveFailFor(e):(J3(rW),void d4())}function g2(){var e,t,r;return CY&&(GY=IY.ioMicroMSecs()),1!==IY.methodArgumentCount()?IY.primitiveFailFor(wY):0!==(r=Z2(IY.stackValue(1),wW))?IY.primitiveFailFor(r):(t=IY.stackObjectValue(0),IY.failed()?IY.primitiveFailFor(vY):(e=n1(t))?K1(1)?(0>1,n=b2()[1]-a2()[1]>>1,a=b2()[0]+a2()[0]>>1,s=b2()[1]+a2()[1]>>1,o=0;o<=15;o++){if(u1(o,l,n,a,s),C4(3),u=c1(a2(),b2(),c2(),0!==e&&0!==t),EY)return;if(C1(e,t,r,i,u),EY)return}}(t,e,0,a),EY?(H4(),IY.primitiveFailFor(GV)):IY.failed()?IY.primitiveFailFor(JV):(N1(1),d4(),void IY.pop(5)))):IY.primitiveFailFor(TV)):IY.primitiveFailFor(VV))}function o2(){var e,t,r,i,a,s,n,o;if(5!==IY.methodArgumentCount())return IY.primitiveFailFor(wY);if(i=IY.positive32BitValueOf(IY.stackValue(0)),a=IY.stackIntegerValue(1),t=IY.positive32BitValueOf(IY.stackValue(2)),s=IY.stackIntegerValue(3),n=IY.stackObjectValue(4),IY.failed())return IY.primitiveFailFor(vY);if(0!==(e=Z2(IY.stackValue(5),tW)))return IY.primitiveFailFor(e);if(r=xU(n),IY.isWords(n)){if(o=!1,r!==s&&2*s!==r)return IY.primitiveFailFor(vY)}else{if(!IY.isArray(n))return IY.primitiveFailFor(vY);if(r!==s)return IY.primitiveFailFor(vY);o=!0}return K1((0===a||0===i?QW:$W)*s)?C0(i)&&C0(t)?(i=y4(i),t=y4(t),EY?IY.primitiveFailFor(GV):0!==i&&0!==a||0!==t?(0!==a&&(a=D4(a)),o?function(e,t,r,i,a){var s,n,o,u,l;if(v1(a2(),IY.fetchPointerofObject(0,e)),!IY.failed())for(n=a2()[0],u=a2()[1],s=1;s<=t-1;s++){if(v1(a2(),IY.fetchPointerofObject(s,e)),IY.failed())return;if(o=a2()[0],l=a2()[1],a2()[0]=n,a2()[1]=u,b2()[0]=o,b2()[1]=l,C4(2),D1(i,a2(),b2(),a,r,0),EY)return;n=o,u=l}}(n,s,t,a,i):function(e,t,r,i,a,s){var n,o,u,l,c;for(l=s?(o=(e.int16Array||(e.int16Array=new Int16Array(e.buffer,e.byteOffset)))[0],(e.int16Array||(e.int16Array=new Int16Array(e.buffer,e.byteOffset)))[1]):(o=0|e[0],0|e[1]),n=1;n<=t-1;n++){if(c=s?(u=(e.int16Array||(e.int16Array=new Int16Array(e.buffer,e.byteOffset)))[2*n],(e.int16Array||(e.int16Array=new Int16Array(e.buffer,e.byteOffset)))[2*n+1]):(u=0|e[2*n],0|e[2*n+1]),a2()[0]=o,a2()[1]=l,b2()[0]=u,b2()[1]=c,C4(2),D1(i,a2(),b2(),a,r,0),EY)return;o=u,l=c}}(n.wordsAsInt32Array(),s,t,a,i,s===r),EY?IY.primitiveFailFor(GV):IY.failed()?IY.primitiveFailFor(JV):(N1(1),d4(),void IY.pop(5))):IY.pop(5)):IY.primitiveFailFor(VV):IY.primitiveFail()}function p2(){var e,t,r,i,a,s,n,o,u,l;return 5!==IY.methodArgumentCount()?IY.primitiveFailFor(wY):(e=IY.positive32BitValueOf(IY.stackValue(0)),t=IY.stackIntegerValue(1),a=IY.positive32BitValueOf(IY.stackValue(2)),r=IY.stackObjectValue(3),s=IY.stackObjectValue(4),IY.failed()?IY.primitiveFailFor(vY):0!==(i=Z2(IY.stackValue(5),tW))?IY.primitiveFailFor(i):C0(e)&&C0(a)?(e=y4(e),a=y4(a),EY?IY.primitiveFailFor(GV):0!==a||0!==e&&0!==t?K1(4*QW)?(t=0t3()&&u3(c),c>r3()&&s3(c)}(e.wordsAsInt32Array(),L0(),N0()),J3(sW),d4(),IY.pop(2),void(CY&&(q0(BX,1),q0(rY,IY.ioMicroMSecs()-GY))))))))}function G2(){var e,t;return 0!==IY.methodArgumentCount()?IY.primitiveFailFor(wY):0!==(e=Y2(IY.stackValue(0)))?IY.primitiveFailFor(e):(t=L1(),d4(),IY.pop(1),void IY.pushBool(t))}function H2(){var e,t;return 1!==IY.methodArgumentCount()?IY.primitiveFailFor(wY):0!==(e=Y2(IY.stackValue(1)))?IY.primitiveFailFor(e):(t=IY.booleanValueOf(IY.stackValue(0)),IY.failed()?IY.primitiveFailFor(vY):(N1(!0===t?1:0),d4(),void IY.pop(1)))}function I2(){var e,t,r,i,a,s,n;return CY&&(GY=IY.ioMicroMSecs()),1!==IY.methodArgumentCount()?IY.primitiveFailFor(wY):0!==(i=IY.stackValue(1),a=uW,s=rW,t=0===(n=Y2(i))?I3()!==a&&I3()!==s?(b4(CW),WV):0:n)?IY.primitiveFailFor(t):(e=IY.stackObjectValue(0),IY.failed()?IY.primitiveFailFor(vY):(r=!1,I3()!==rW&&((r=Y_())?(c4(xY[gZ()],e),J3(vW)):J3(pW)),IY.failed()?null:(d4(),IY.pop(2),IY.pushBool(!r),void(CY&&(q0(CX,1),q0(sY,IY.ioMicroMSecs()-GY))))))}function J2(){var e,t,r;return CY&&(GY=IY.ioMicroMSecs()),1!==IY.methodArgumentCount()?IY.primitiveFailFor(wY):0!==(e=Z2(IY.stackValue(1),sW))||0!==(e=A1(IY.fetchPointerofObject(IU,DY)))?IY.primitiveFailFor(e):q1(IY.fetchPointerofObject(HU,DY))?(0!==u$()&&(0==(M$()&YY())&&t$(),v$(0)),t=IY.stackObjectValue(0),r=X_(),EY?IY.primitiveFailFor(GV):(r&&e4(t),IY.failed()?IY.primitiveFailFor(VV):(r?J3(xW):(H4(),s3(0),J3(qW)),d4(),IY.pop(2),IY.pushBool(!r),void(CY&&(q0(DX,1),q0(tY,IY.ioMicroMSecs()-GY)))))):IY.primitiveFailFor(LV)}function K2(){var e,t,r;return CY&&(GY=IY.ioMicroMSecs()),1!==IY.methodArgumentCount()?IY.primitiveFailFor(wY):0!==(t=Z2(IY.stackValue(1),pW))?IY.primitiveFailFor(t):(e=IY.stackObjectValue(0),(r=W_())&&(c4(HY[c0()],e),d0(c0()+1)),IY.failed()?IY.primitiveFailFor(UV):(r?J3(wW):(J3(sW),v$(1),hZ(0),H4()),d4(),IY.pop(2),IY.pushBool(!r),void(CY&&(q0(EX,1),q0(uY,IY.ioMicroMSecs()-GY)))))}function L2(){var e,t,r,i,a,s,n,o;return 6!==IY.methodArgumentCount()?IY.primitiveFailFor(wY):0!==(t=Z2(IY.stackValue(6),tW))?IY.primitiveFailFor(t):(o=IY.positive32BitValueOf(IY.stackValue(0)),n=IY.positive32BitValueOf(IY.stackValue(1)),s=IY.stackIntegerValue(2),a=IY.stackIntegerValue(3),i=IY.stackIntegerValue(4),r=IY.stackIntegerValue(5),IY.failed()?IY.primitiveFailFor(vY):rZ(wV)?C0(n)&&C0(o)?(MY=(e=MY)+wV,$1(e,dW),Y1(e,wV),W1(e,r),e_(e,i),g_(e,a),i_(e,s),Y$(e,y4(n)),a_(e,y4(o)),EY?IY.primitiveFailFor(GV):void(IY.failed()||(d4(),IY.pop(6)))):IY.primitiveFailFor(VV):IY.primitiveFailFor(TV))}function M2(){var e,t,r;if(1!==IY.methodArgumentCount())return IY.primitiveFailFor(wY);if(0!==(e=Z2(IY.stackValue(1),tW)))return IY.primitiveFailFor(e);if(r=IY.stackIntegerValue(0),IY.failed())return IY.primitiveFailFor(vY);for(t=0;0===t;){if(!rZ(wV))return IY.primitiveFailFor(TV);MY=(t=MY)+xV,$1(t,fW),Y1(t,xV),W1(t,r)}IY.failed()||(d4(),IY.pop(2),IY.pushInteger(t))}function N2(){var e;return 0!==(e=y1())?IY.primitiveFailFor(e):(X2(),EY?f4():(function(){var e;for(;!$_();){if(CY&&(GY=IY.ioMicroMSecs()),e=W_(),CY&&(q0(EX,1),q0(uY,IY.ioMicroMSecs()-GY)),EY)return J3(pW);if(e)return J3(wW),_3(EW);if(hZ(0),H4(),v$(1),CY&&(GY=IY.ioMicroMSecs()),0!==u$()&&0==(M$()&YY())&&t$(),v$(0),e=X_(),CY&&(q0(DX,1),q0(tY,IY.ioMicroMSecs()-GY)),EY)return J3(sW);if(e)return J3(xW),_3(DW);if(H4(),s3(0),CY&&(GY=IY.ioMicroMSecs()),(M$()&YY())===YY()&&(U$(M$()),e2()),CY&&(q0(yX,1),q0(oY,IY.ioMicroMSecs()-GY)),EY)return J3(qW);if($_())return;if(hZ(0),N$(M$()+1),CY&&(GY=IY.ioMicroMSecs()),e=Y_(),CY&&(q0(CX,1),q0(sY,IY.ioMicroMSecs()-GY)),EY)return J3(uW);if(e)return J3(vW),_3(BW)}}(),void f4()))}function O2(){var e;if(0!==(e=y1()))return IY.primitiveFailFor(e);X2(),f4()}function P2(){var e,t;return 1!==IY.methodArgumentCount()?IY.primitiveFailFor(wY):0!==(e=Z2(IY.stackValue(1),tW))?IY.primitiveFailFor(e):(t=IY.stackIntegerValue(0),IY.failed()?IY.primitiveFailFor(vY):(k3(t),d4(),void IY.pop(1)))}function Q2(){var e,t,r;if(t=IY.stackValue(0),!IY.isBytes(t))return IY.primitiveFail();if(256<=((r=t).bytes?r.bytes.length:r.words?4*r.words.length:0))return IY.primitiveFail();t.bytes,e=!1;var i=t.bytesAsString();if(i!==yY&&(yY=i,e=!0),e&&!u0())return IY.primitiveFail();IY.pop(1)}function R2(){var e,t;return 1!==IY.methodArgumentCount()?IY.primitiveFailFor(wY):0!==(e=Z2(IY.stackValue(1),tW))?IY.primitiveFailFor(e):(t=IY.stackObjectValue(0),!IY.failed()&&IY.isPointers(t)&&2<=xU(t)?(v1(a2(),IY.fetchPointerofObject(0,t)),v1(b2(),IY.fetchPointerofObject(1,t)),IY.failed()?IY.primitiveFailFor(vY):(B$(a2()[0]),D$(a2()[1]),x$(b2()[0]),z$(b2()[1]),d4(),void IY.pop(1))):IY.primitiveFailFor(vY))}function S2(){var e,t,r,i;return 1!==IY.methodArgumentCount()?IY.primitiveFailFor(wY):0!==(e=Z2(IY.stackValue(1),tW))?IY.primitiveFailFor(e):(t=IY.stackObjectValue(0),IY.failed()?IY.primitiveFailFor(vY):(r=t,i=E$(),l0(0),B1(r,i,8)&&(l0(1),i[1]=256*i[1],i[3]=256*i[3],i[5]=256*i[5],i[7]=256*i[7]),IY.failed()?IY.primitiveFailFor(JV):(d4(),void IY.pop(1))))}function T2(){var e,t;return 1!==IY.methodArgumentCount()?IY.primitiveFailFor(wY):0!==(t=Z2(IY.stackValue(1),tW))?IY.primitiveFailFor(t):(e=IY.stackIntegerValue(0),IY.failed()?IY.primitiveFailFor(vY):(P$(e),d4(),void IY.pop(1)))}function U2(){var e,t,r,i,a;return 1!==IY.methodArgumentCount()?IY.primitiveFailFor(wY):0!==(e=Z2(IY.stackValue(1),tW))?IY.primitiveFailFor(e):(t=IY.stackObjectValue(0),IY.failed()?IY.primitiveFailFor(vY):(r=t,o0(0),i=B1(r,a=b_(),6),!IY.failed()&&i&&(o0(1),a[2]=a[2]+Q$(),a[5]=a[5]+S$()),IY.failed()?IY.primitiveFailFor(vY):(d4(),void IY.pop(1))))}function V2(){var e,t,r,i;return 1!==IY.methodArgumentCount()?IY.primitiveFailFor(wY):0!==(e=Z2(IY.stackValue(1),tW))?IY.primitiveFailFor(e):wU(t=IY.stackValue(0))!==IY.classPoint()?IY.primitiveFailFor(vY):(v1(a2(),t),IY.failed()?IY.primitiveFailFor(vY):(r=a2()[0],OY[HX]=r,i=a2()[1],OY[IX]=i,d4(),void IY.pop(1)))}function X2(){var e,t;if((t=I3())===tW){if(v0(),EY)return;t=pW}if(t===pW){if(CY&&(GY=IY.ioMicroMSecs()),e=W_(),CY&&(q0(EX,1),q0(uY,IY.ioMicroMSecs()-GY)),EY)return J3(pW);if(e)return J3(wW),_3(EW);hZ(0),H4(),v$(1),t=sW}if(t===sW){if(CY&&(GY=IY.ioMicroMSecs()),0!==u$()&&0==(M$()&YY())&&t$(),v$(0),e=X_(),CY&&(q0(DX,1),q0(tY,IY.ioMicroMSecs()-GY)),EY)return J3(sW);if(e)return J3(xW),_3(DW);t=qW,H4(),s3(0)}if(t===qW){if(CY&&(GY=IY.ioMicroMSecs()),(M$()&YY())===YY()&&(U$(M$()),e2()),CY&&(q0(yX,1),q0(oY,IY.ioMicroMSecs()-GY)),EY)return J3(qW);if($_())return;t=uW,hZ(0),N$(M$()+1)}if(t===uW){if(CY&&(GY=IY.ioMicroMSecs()),e=Y_(),CY&&(q0(CX,1),q0(sY,IY.ioMicroMSecs()-GY)),EY)return J3(uW);if(e)return J3(vW),_3(BW);J3(pW)}}function Y2(e){var t;return IY.failed()?zV:"number"==typeof e?EV:IY.isPointers(e)?xU(e)r;)xY[i]=xY[i-1],--i;xY[i]=t}(gZ(),e,t))}function g3(){return AY=O1(BY,sV)}function h3(){return AY=O1(BY,vV)}function i3(){return AY=O1(BY,ZW)}function k3(e){var t,r,i,a;4<=e&&(t=4),2<=e&&e<4&&(t=2),e<2&&(t=1),r=t,OY[gX]=r,1===t&&(_Y(0),QY(4294967295),ZY(0)),2===t&&(_Y(1),QY(4244438268),ZY(1)),4===t&&(_Y(2),QY(4042322160),ZY(3)),i=2*$Y(),OY[eX]=i,a=$Y(),OY[fX]=a}function l3(e){return!1!=((IY=e).majorVersion()==uU)&&IY.minorVersion()>=vU}function m3(e,t){return(0|t[e])>>>16}function n3(e,t){return 65535&(0|t[e])}function o3(e,t,r){tZ()&&(H3(0,e),B3(0,t),E3(0,r),3!==F3()&&T_(0,F3()-3)&&(H3(0,v4()),B3(0,r4()),E3(0,t4()),w4(e),s4(t),u4(r)))}function r3(){return OY[hY]}function s3(e){return OY[hY]=e}function t3(){return OY[gY]}function u3(e){return OY[gY]=e}function v3(){return OY[iY]}function x3(){return OY[jY]}function y3(e){return OY[jY]=e}function z3(e,t){return e*e+t*t}function A3(e){return L4(e+1)}function B3(e,t){return M4(e+1,t)}function D3(e){return L4(e+2)}function E3(e,t){return M4(e+2,t)}function F3(){return K4()}function G3(e){return L4(e)}function H3(e,t){return M4(e,t)}function I3(){return OY[kY]}function J3(e){return OY[kY]=e}function L3(e,t){var r,i,a,s,n,o,u,l,c,h,f,d,p,b,m,v,g,k,_,S,y;if(!G0(e)&&t>=AZ(e))return $$(e,0);b=d_(e),m=f_(e),g=O1(e,nV),k=O1(e,oV),u=2*(g-b),l=b+yZ(e)-2*g,c=2*(k-m),h=m+(i=AZ(e))-2*k,(f=2*(r=i-m))<2&&(f=2),d=zU(16777216,f),n=u*(_=d),n+=(a=l*(p=((S=65535&_)*S>>>16)+S*(y=_>>>16&255)*2+(y*y<<16)>>>8)*2)>>1,o=c*d,o+=(s=h*p*2)>>1,$$(e,r),(v=EZ(e))[lV]=256*b,v[mV]=256*m,v[iV]=n,v[jV]=o,v[gV]=a,v[hV]=s,(m=f_(e))!==t&&(U3(e,t),$$(e,r-(t-m)))}function N3(e,t){var r,i,a,s,n,o,u,l,c,h,f;if(!G0(e)&&t>=R0(e))return $$(e,0);if(r=P0(e)-d_(e),i=R0(e)-f_(e),a=0<=r?(l=1,u=r,0):(l=-1,u=0-r,1-i),s=0==i?(c=r,a=0):u>16,s+=i+32768>>16,r+=e[gV],i+=e[hV];return e[lV]=a,e[mV]=s,e[iV]=r,e[jV]=i,a>>8}function U3(e,t){e_(e,T3(EZ(e),t))}function W3(e){var t,r;r=d_(e)+_0(e),0<(t=O1(e,TW)+O1(e,VW))&&(r+=Z0(e),t-=O1(e,UW)),Y0(e,t),e_(e,r)}function Y3(e,t){var r,i,a,s;r=_1(i=T4(e)),a=O1(e,pV)+1,s=O1(e,qV)+1,Q4(e,a),S4(e,s),r<=a&&W$(e),0<=s&&V$(e),s+r<0?T3(EZ(e),t):EZ(e)[lV]=256*CZ(e),T3(X4(e),t),I$(e,i)}function $3(e){var t,r,i,a,s,n,o,u,l,c,h,f,d,p,b,m;s=$4(e)+1,n=a5(e)+1,_4(e,s),b5(e,n),(r=_1(i=c5(e)))<=s&&W$(e),0<=n&&V$(e),t=d_(e),W3(e),a=d_(e),(s<=i||0<=n+r)&&(u=t,l=a,b=$4(o=e),m=a5(o),f=_1(c=c5(o)),d=g5(o),p=Z0(o),h=l-u,b>>1,BY=e,n){case 0:case 1:break;case 2:AY=g5(BY);break;case 3:h3()}switch(a=AY,n){case 0:case 1:break;case 2:i3();break;case 3:g3()}0!==(r=AY)&&K1(3)&&(t=1+(h_(e)<<1),s=d_(e)+a,-1===(i=Z_(r,t))?o3(r,t,s):D3(i)>>8&255,s=e>>>16&255,t=e>>>24&255,j0()&&(r=(t*(n=E$())[6]+n[7])/t,s=(s*n[0]+n[1])*r|0,a=(a*n[2]+n[3])*r|0,i=(i*n[4]+n[5])*r|0,t=t*r|0,s=Math.max(s,0),s=Math.min(s,255),a=Math.max(a,0),a=Math.min(a,255),i=Math.max(i,0),i=Math.min(i,255),t=Math.max(t,0),t=Math.min(t,255)),t<1?0:(t<255&&L1()&&_3(FW),i+(a<<8)+(s<<16)+(t<<24))):e}function z4(e){var t,r;m0()?(r=t=e,function(e,t,r){var i,a,s;i=b_(),a=(i[0]*e+i[1]*t+i[2])*WY()|0,s=(i[3]*e+i[4]*t+i[5])*WY()|0,r[0]=a,r[1]=s}(0|t[0],0|t[1],r)):(e[0]=(e[0]+Q$())*WY(),e[1]=(e[1]+S$())*WY())}function C4(e){0>8,t=c2()[0]-a2()[0],r=c2()[1]-a2()[1],(a=128+(0|Math.sqrt(t*t+r*r))>>8)>>8&255,t=e>>>24&255,a=(a=e>>>16&255)*(s=E$())[0]+s[1]|0,i=i*s[2]+s[3]|0,r=r*s[4]+s[5]|0,t=t*s[6]+s[7]|0,a=Math.max(a,0),a=Math.min(a,255),i=Math.max(i,0),i=Math.min(i,255),r=Math.max(r,0),r=Math.min(r,255),t=Math.max(t,0),(t=Math.min(t,255))<16?0:r+(i<<8)+(a<<16)+(t<<24)):e}function F4(){return OY[fY]}function H4(){O4(F4())}function J4(e){return!!K1(e)&&(O4(N4()-e),!0)}function K4(){return F4()-N4()}function L4(e){return OY[N4()+e]}function M4(e,t){return OY[N4()+e]=t}function N4(){return OY[pX]}function O4(e){return OY[pX]=e}function Q4(e,t){return P1(e,pV,t)}function S4(e,t){return P1(e,qV,t)}function T4(e){return O1(e,rV)}function X4(e){return DU(LY,e+uV)}function Z4(e,t){return P1(e,vV,t)}function $4(e){return O1(e,WW)}function _4(e,t){return P1(e,WW,t)}function a5(e){return O1(e,XW)}function b5(e,t){return P1(e,XW,t)}function c5(e){return O1(e,YW)}function g5(e){return O1(e,_W)}function h5(e,t){return P1(e,_W,t)}function i5(e){OY=e.wordsAsInt32Array()}function Rsa(e){return"number"==typeof e?wua.classSmallInteger():e.sqClass}function Ssa(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function Tsa(e){return e.bytes?e.bytes.length:e.words?4*e.words.length:0}function Usa(e,t){return 0|Math.floor(e/t)}function Wsa(e,t){return 31>>t}function Ysa(e,t){return t<0?t<-31?0:e>>>0-t:31>>5&31)+(r>>>10&31),r=wwa(e>>>16,t>>>16,5,3),Jta+(31&r)+(r>>>5&31)+(r>>>10&31)):(r=wwa(e,t,8,3),Jta+(255&r)+(r>>>8&255)+(r>>>16&255)),t}function iva(e,t){var r,i,a,s;if((Pta&(tta|rta))!=(tta|rta))return t;if(Zta<16){for(r=Bua[Zta]&Rta,s=t,a=1;a<=dua;a++)ixa(i=s&r,hxa(i)+1),s=Xsa(s,Zta);return t}return 16===Zta?(ixa(i=Uwa(65535&t,5,Ota),hxa(i)+1),ixa(i=Uwa(t>>>16,5,Ota),hxa(i)+1)):ixa(i=Uwa(t,8,Ota),hxa(i)+1),t}function jva(e,t){return e+t}function kva(e,t){var r,i,a,s;return 0==(s=e>>>24)?t:255==s?e:(i=(i=(16711935&e)*s+(16711935&t)*(r=255-s)+16711935)+(i-65537>>>8&16711935)>>>8&16711935)|(a=(a=(16711935&(e>>>8|16711680))*s+(t>>>8&16711935)*r+16711935)+(a-65537>>>8&16711935)>>>8&16711935)<<8}function lva(e,t){return mva(e,t,!1)}function mva(e,t,r){var i,a,s,n,o,u,l,c,h,f,d,p,b,m;if(Zta<16)return t;if(h=255-Kua,o=t,1===dua)r&&0===e||(o=(d=(d=(16711935&e)*Kua+(16711935&t)*h+16711935)+(d-65537>>>8&16711935)>>>8&16711935)|(p=(p=(e>>>8&16711935)*Kua+(t>>>8&16711935)*h+16711935)+(p-65537>>>8&16711935)>>>8&16711935)<<8);else for(i=Bua[Zta],m=cua,b=t,n=e,s=1;s<=dua;s++){if(l=n&i,!(0==(m&i)||r&&0==l)){for(f=b&i,a=0,c=1;c<=3;c++)a|=Wsa(31&Usa((31&Xsa(l,u=5*(c-1)))*Kua+(31&Xsa(f,u))*h+254,255),u);o=o&~Wsa(i,16*(s-1))|Wsa(a,16*(s-1))}m=Xsa(m,Zta),n=Xsa(n,Zta),b=Xsa(b,Zta)}return o}function nva(e,t){var r,i,a;return(a=(16711935&(a=((t>>>8&16711935)*(r=255-(e>>>24))>>>8&16711935)+(e>>>8&16711935)))<<8|255*(16777472&a))|(i=16711935&(i=((16711935&t)*r>>>8&16711935)+(16711935&e))|255*(16777472&i)>>>8)}function ova(e,t){return 0===e?t:mva(e,t,!0)}function sva(e,t){return e&t}function tva(e,t){return e&~t}function uva(e,t){return~e&t}function vva(e,t){return~e&~t}function wva(e,t){return~t}function xva(e,t){return~e|t}function yva(e,t){return~e|~t}function zva(e,t){return~e}function Ava(e,t){return~e^t}function Bva(e,t){return e|t}function Cva(e,t){return e|~t}function Dva(e,t){return e^t}function Fva(e,t){return 0}function Gva(){Mta<=gua?(Yua=Vua,nua=gua,Hta=gva):(Yua=Vua+(Mta-gua),Hta=gva-(Mta-gua),nua=Mta),Mta+Lta>>2],0==(16777215&e)){for(t+=4,i+=4;0!=--r&&0==(16777215&(e=Lua[t>>>2]));)t+=4,i+=4;++r}else n=Xta[i>>>2],n=Owa(e,n),Xta[i>>>2]=n,t+=4,i+=4;++s,++o}}(),Eta=(Dta=nua)+Hta,Cta=(Fta=oua)+Gta,!0):16===Zta?(function(){var e,t,r,i,a,s,n,o,u,l,c,h,f;u=Gta+1,l=Zua,h=oua,r=16*(1&nua),bua&&(r=16-r);zua=Wsa(65535,16-r);for(;0!=--u;){for(a=l*Tua+4*Yua,n=h*eua+4*(nua>>1),e=4*(3&h),f=(3&Yua)-1,s=Hta+1,r=65535===(o=zua)?16:0;0!=--s;)t=jua[e+(f=f+1&3)],i=Lua[a>>>2],0!=(16777215&i)&&(c=Xta[n>>>2],c=Xsa(c&=~o,r),i=Wsa(0===(i=Sva(i=Owa(i,c=(31744&c)<<9|(992&c)<<6|(31&c)<<3|4278190080),t))?1:i,r),Uva(n,i,o)),a+=4,bua?0===r&&(n+=4):0!==r&&(n+=4),r^=16,o=~o;++l,++h}}(),Eta=(Dta=nua)+Hta,Cta=(Fta=oua)+Gta,!0):8===Zta&&(function(){var e,t,r,i,a,s,n,o,u,l,c,h,f,d;a=Ova(),o=Pta&~sta,c=Gta+1,h=Zua,zua=8*(3&nua),bua&&(zua=24-zua);Aua=Zsa^Wsa(255,zua),n=0==(1&nua)?0:522133279;0==(1&(d=oua))&&(n^=522133279);for(;0!=--c;){for(n^=522133279,r=h*Tua+4*Yua,s=d*eua+4*(nua>>2),i=Hta+1,e=zua,l=Aua;0!=--i;)t=(Lua[r>>>2]&~n)+n,31<(u=Usa(((u=16777215&t)>>>16)+(u>>>8&255)+(255&u),3))&&(224>>2],f=Xsa(f&=~l,e),f=a[f],t=Wsa(t=owa(t=Owa(t,f),o),e),Uva(s,t,l)),r+=4,l=bua?0===e?(s+=4,e=24,16777215):(e-=8,l>>>8|4278190080):32===e?(s+=4,e=0,4294967040):(e+=8,l<<8|255),n^=522133279;++h,++d}}(),Eta=(Dta=nua)+Hta,Cta=(Fta=oua)+Gta,!0);if(Zta<8)return!1;if(8===Zta&&0==(Pta&tta))return!1;32===Zta&&function(){var e,t,r,i,a,s,n,o,u;for(s=Gta+1,n=Zua,u=oua;0!=--s;){for(t=n*Tua+4*Yua,i=u*eua+4*nua,r=Hta+1;0!=--r;)if(255==(a=(e=Lua[t>>>2])>>>24)){for(Xta[i>>>2]=e,t+=4,i+=4;0!=--r&&(e=Lua[t>>>2])>>>24==255;)Xta[i>>>2]=e,t+=4,i+=4;++r}else if(0==a){for(t+=4,i+=4;0!=--r&&(e=Lua[t>>>2])>>>24==0;)t+=4,i+=4;++r}else o=nva(e,o=Xta[i>>>2]),Xta[i>>>2]=o,t+=4,i+=4;++n,++u}}();16===Zta&&function(){var e,t,r,i,a,s,n,o,u,l,c,h,f,d;for(l=Gta+1,c=Zua,f=oua,r=16*(1&nua),bua&&(r=16-r),zua=Wsa(65535,16-r);0!=--l;){for(a=c*Tua+4*Yua,n=f*eua+4*(nua>>1),e=4*(3&f),d=(3&Yua)-1,s=Hta+1,r=65535===(u=zua)?16:0;0!=--s;)t=jua[e+(d=d+1&3)],255==(o=(i=Lua[a>>>2])>>>24)?Uva(n,i=Wsa(0===(i=Sva(i,t))?1:i,r),u):0!=o&&(h=Xta[n>>>2],Uva(n,i=Wsa(0===(i=Sva(i=nva(i,h=(31744&(h=Xsa(h&=~u,r)))<<9|(992&h)<<6|(31&h)<<3|4278190080),t))?1:i,r),u)),a+=4,bua?0===r&&(n+=4):0!==r&&(n+=4),r^=16,u=~u;++c,++f}}();8===Zta&&function(){var e,t,r,i,a,s,n,o,u,l,c,h,f,d;for(a=Ova(),o=Pta&~sta,c=Gta+1,h=Zua,zua=8*(3&nua),bua&&(zua=24-zua),Aua=Zsa^Wsa(255,zua),n=0==(1&nua)?0:522133279,0==(1&(d=oua))&&(n^=522133279);0!=--c;){for(n^=522133279,r=h*Tua+4*Yua,s=d*eua+4*(nua>>2),i=Hta+1,e=zua,l=Aua;0!=--i;)31<(u=(t=(Lua[r>>>2]&~n)+n)>>>24)&&(u<224&&(f=Xta[s>>>2],t=nva(t,f=a[f=Xsa(f&=~l,e)])),Uva(s,t=Wsa(t=owa(t,o),e),l)),r+=4,l=bua?0===e?(s+=4,e=24,16777215):(e-=8,l>>>8|4278190080):24===e?(s+=4,e=0,4294967040):(e+=8,l<<8|255),n^=522133279;++h,++d}}();return Eta=(Dta=nua)+Hta,Cta=(Fta=oua)+Gta,!0}())return;if(30===Uta||31===Uta){if(1!==wua.methodArgumentCount())return wua.primitiveFail();if(Kua=wua.stackIntegerValue(0),!(!wua.failed()&&0<=Kua&&Kua<=255))return wua.primitiveFail()}Jta=0,Qva(),Fua?function(){var e,t,r,i,a,s;for(r=Gua[Uta+1],s=1;s<=Gta;s++){if(t=Eua?Zsa:$va(oua+s-1),cua=zua,i=Xta[aua>>>2],e=r(t,i),i=cua&e|i&~cua,Xta[aua>>>2]=i,aua+=4,cua=Zsa,3===Uta)for(i=t,a=2;a<=Dua-1;a++)Xta[aua>>>2]=i,aua+=4;else for(a=2;a<=Dua-1;a++)i=Xta[aua>>>2],e=r(t,i),Xta[aua>>>2]=e,aua+=4;1>>2],e=r(t,i),i=cua&e|i&~cua,Xta[aua>>>2]=i,aua+=4),aua+=Yta}}():(function(){var e;Oua===$ta&&Zua<=oua&&(Zua>>2],Qua+=n):l=0,cua=zua,f=Lua[Qua>>>2],Qua+=n,t=Ysa(l&d,a)|Ysa(f&r,Jua),l=f,o=Xta[aua>>>2],e=s(t&i,o),o=cua&e|o&~cua,Xta[aua>>>2]=o,aua+=n,cua=Zsa,3===Uta)if(0===Jua&&i===Zsa)if(-1===qua)for(u=2;u<=Dua-1;u++)f=Lua[Qua>>>2],Qua+=n,Xta[aua>>>2]=f,aua+=n;else for(u=2;u<=Dua-1;u++)Xta[aua>>>2]=l,aua+=n,l=Lua[Qua>>>2],Qua+=n;else for(u=2;u<=Dua-1;u++)f=Lua[Qua>>>2],Qua+=n,t=Ysa(l&d,a)|Ysa(f&r,Jua),l=f,Xta[aua>>>2]=t&i,aua+=n;else for(u=2;u<=Dua-1;u++)f=Lua[Qua>>>2],Qua+=n,t=Ysa(l&d,a)|Ysa(f&r,Jua),l=f,e=s(t&i,Xta[aua>>>2]),Xta[aua>>>2]=e,aua+=n;1>>2],Qua+=n,t=Ysa(l&d,a)|Ysa(f&r,Jua),o=Xta[aua>>>2],e=s(t&i,o),o=cua&e|o&~cua,Xta[aua>>>2]=o,aua+=n),Qua+=Mua,aua+=Yta}}())),22!==Uta&&32!==Uta||(Dta=Eta=Fta=Cta=0);Eta=0>>2]),Xta[aua>>>2]=cua&d):(d=l(s&f,(o=Xta[aua>>>2])&cua),o=cua&d|o&~cua,Xta[aua>>>2]=o),aua+=4,g=2===n?(cua=Aua,v):(cua=Zsa,dua),0!=--n;);Qua+=Mua,aua+=Yta}}function Ova(){return[0,4278190081,4294967295,4286611584,4294901760,4278255360,4278190335,4278255615,4294967040,4294902015,4280295456,4282400832,4284506208,4288651167,4290756543,4292861919,4278716424,4279242768,4279769112,4280821800,4281348144,4281874488,4282927176,4283453520,4283979864,4285032552,4285558896,4286085240,4287072135,4287598479,4288124823,4289177511,4289703855,4290230199,4291282887,4291809231,4292335575,4293388263,4293914607,4294440951,4278190081,4278203136,4278216192,4278229248,4278242304,4278255360,4278190131,4278203187,4278216243,4278229299,4278242355,4278255411,4278190182,4278203238,4278216294,4278229350,4278242406,4278255462,4278190233,4278203289,4278216345,4278229401,4278242457,4278255513,4278190284,4278203340,4278216396,4278229452,4278242508,4278255564,4278190335,4278203391,4278216447,4278229503,4278242559,4278255615,4281532416,4281545472,4281558528,4281571584,4281584640,4281597696,4281532467,4281545523,4281558579,4281571635,4281584691,4281597747,4281532518,4281545574,4281558630,4281571686,4281584742,4281597798,4281532569,4281545625,4281558681,4281571737,4281584793,4281597849,4281532620,4281545676,4281558732,4281571788,4281584844,4281597900,4281532671,4281545727,4281558783,4281571839,4281584895,4281597951,4284874752,4284887808,4284900864,4284913920,4284926976,4284940032,4284874803,4284887859,4284900915,4284913971,4284927027,4284940083,4284874854,4284887910,4284900966,4284914022,4284927078,4284940134,4284874905,4284887961,4284901017,4284914073,4284927129,4284940185,4284874956,4284888012,4284901068,4284914124,4284927180,4284940236,4284875007,4284888063,4284901119,4284914175,4284927231,4284940287,4288217088,4288230144,4288243200,4288256256,4288269312,4288282368,4288217139,4288230195,4288243251,4288256307,4288269363,4288282419,4288217190,4288230246,4288243302,4288256358,4288269414,4288282470,4288217241,4288230297,4288243353,4288256409,4288269465,4288282521,4288217292,4288230348,4288243404,4288256460,4288269516,4288282572,4288217343,4288230399,4288243455,4288256511,4288269567,4288282623,4291559424,4291572480,4291585536,4291598592,4291611648,4291624704,4291559475,4291572531,4291585587,4291598643,4291611699,4291624755,4291559526,4291572582,4291585638,4291598694,4291611750,4291624806,4291559577,4291572633,4291585689,4291598745,4291611801,4291624857,4291559628,4291572684,4291585740,4291598796,4291611852,4291624908,4291559679,4291572735,4291585791,4291598847,4291611903,4291624959,4294901760,4294914816,4294927872,4294940928,4294953984,4294967040,4294901811,4294914867,4294927923,4294940979,4294954035,4294967091,4294901862,4294914918,4294927974,4294941030,4294954086,4294967142,4294901913,4294914969,4294928025,4294941081,4294954137,4294967193,4294901964,4294915020,4294928076,4294941132,4294954188,4294967244,4294902015,4294915071,4294928127,4294941183,4294954239,4294967295]}function Pva(e,t,r){return e>>16&255)]<<10)+(iua[r+(e>>>8&255)]<<5)+iua[r+(255&e)]}function Uva(e,t,r){var i;i=Xta[e>>>2],i&=r,i|=t,Xta[e>>>2]=i}function Wva(e,t){var r,i;return"number"==typeof(i=wua.fetchPointerofObject(e,t))?i:-2147483648<=(r=wua.floatValueOf(i))&&r<=2147483647?0|r:(wua.primitiveFail(),0)}function Xva(e,t,r){var i,a;return"number"==typeof(a=wua.fetchPointerofObject(e,t))?a:a.isNil?r:-2147483648<=(i=wua.floatValueOf(a))&&i<=2147483647?0|i:(wua.primitiveFail(),0)}function Yva(e,t){return 32!==Zta?t:0===t?0:0!=(4278190080&t)?t:t|4278190080&e}function Zva(){return Cua}function $va(e){return rua[(t=e)-Usa(t,r=tua)*r|0];var t,r}function _va(e){return!!e.isNil||(0===Uta||(5===Uta||(10===Uta||15===Uta)))}function cwa(){return Gua[1]=Fva,Gua[2]=sva,Gua[3]=tva,Gua[4]=exa,Gua[5]=uva,Gua[6]=Rva,Gua[7]=Dva,Gua[8]=Bva,Gua[9]=vva,Gua[10]=Ava,Gua[11]=wva,Gua[12]=Cva,Gua[13]=zva,Gua[14]=xva,Gua[15]=yva,Gua[16]=Rva,Gua[17]=Rva,Gua[18]=Rva,Gua[19]=jva,Gua[20]=fxa,Gua[21]=Lwa,Gua[22]=$wa,Gua[23]=hva,Gua[24]=iva,Gua[25]=kva,Gua[26]=Cwa,Gua[27]=Bwa,Gua[28]=Wwa,Gua[29]=Xwa,Gua[30]=Ywa,Gua[31]=lva,Gua[32]=ova,Gua[33]=Rwa,Gua[34]=gxa,Gua[35]=nva,Gua[36]=nva,Gua[37]=nva,Gua[38]=Zwa,Gua[39]=Dwa,Gua[40]=Awa,Gua[41]=Yva,Gua[42]=Qwa,function(){var e,t,r,i,a,s,n,o,u;for(t=0;t<=255;t++)for(e=0;e<=15;e++)a=e,u=o=n=s=void 0,n=kua[7&(s=255&(i=t))],o=lua[s>>>3],u=a>>8&255)],o=lua[s>>>3],u|=a>>16&255)],o=lua[s>>>3],r=u|=a>loadBitBltDestForm: destBitsSize != destPitch * destHeight, expected "+eua+"*"+_ta+"="+eua*_ta+", got "+e)}Xta=Xta.wordsOrBytes()}return!0}function fwa(e){return gwa(e,!1)}function gwa(e,t){if(Ita=e,xua=t,Uta=wua.fetchIntegerofObject(jta,Ita),wua.failed()||Uta<0||Ata-2>loadBitBltSourceForm: sourceBitsSize != sourcePitch * sourceHeight, expected "+Tua+"*"+Pua+"="+Tua*Pua+", got "+e)}Lua=Lua.wordsOrBytes()}return!0}())return!1;if(!function(){var e,t,r,i;if(Pta=Rta=Ota=0,Qta=Sta=Tta=null,(t=wua.fetchPointerofObject(dta,Ita)).isNil)return!0;if(Pta=tta,i=!1,wua.isWords(t))r=Ssa(t),Qta=t.words,i=!0;else{if(!(wua.isPointers(t)&&3<=Ssa(t)))return!1;if(Tta=jwa(wua.fetchPointerofObject(0,t)),Sta=jwa(wua.fetchPointerofObject(1,t)),(e=wua.fetchPointerofObject(2,t)).isNil)r=0;else{if(!wua.isWords(e))return!1;r=Ssa(e),Qta=e.words}Pta|=sta}if(0!=(r&r-1))return!1;Rta=r-1,Ota=0,512===r&&(Ota=3);4096===r&&(Ota=4);32768===r&&(Ota=5);0===r?(Qta=null,Rta=0):Pta|=rta;i&&axa();!function(e,t){return!e||!t||0===e[Bta]&&0===e[zta]&&0===e[pta]&&0===e[$sa]&&16711680===t[Bta]&&65280===t[zta]&&255===t[pta]&&4278190080===t[$sa]}(Tta,Sta)?Pta|=qta:Tta=Sta=null;return!0}())return!1;0==(Pta&sta)&&axa(),Vua=Xva(lta,Ita,0),Wua=Xva(mta,Ita,0)}return!!function(){var e;if(Eua)return!(rua=null);if(wua.isPointers(sua)&&4<=Ssa(sua))e=wua.fetchPointerofObject(vta,sua),tua=wua.fetchIntegerofObject(xta,sua),wua.isWords(e)||(Eua=!0);else{if(wua.isPointers(sua)||!wua.isWords(sua))return!1;tua=Ssa(e=sua)}return rua=e.wordsOrBytes(),!0}()&&(Mta=Xva(bta,Ita,0),Nta=Xva(cta,Ita,0),Lta=Xva(ata,Ita,fua),Kta=Xva(_sa,Ita,_ta),!wua.failed()&&(Mta<0&&(Lta+=Mta,Mta=0),Nta<0&&(Kta+=Nta,Nta=0),fua>>2],h=0,o=Xua,l=mua,c=e,t===(tta|rta))for(;n=Xsa(u,o)&r,h|=Wsa(Qta[n&Rta]&i,l),l+=s,0!=(4294967264&(o+=a))&&(Rua?o+=32:o-=32,u=Lua[(Qua+=4)>>>2]),0!=--c;);else for(;h|=Wsa(owa(n=Xsa(u,o)&r,t)&i,l),l+=s,0!=(4294967264&(o+=a))&&(Rua?o+=32:o-=32,u=Lua[(Qua+=4)>>>2]),0!=--c;);return Xua=o,h}function zwa(e,t){var r,i,a;return e<0||t<0||(i=e>>>14)>=Uua||(a=t>>>14)>=Pua?0:(r=a*Tua+4*Xsa(i,cva),Xsa(Lua[r>>>2],Xua=dva[i&bva])&eva)}function Awa(e,t){var r,i,a,s,n;if(32===Zta)return e===t?0:t;for(n=Bua[i=Zta],a=0,s=1;s<=dua;s++)(e&n)===(r=t&n)&&(r=0),a|=r,n=Wsa(n,i);return a}function Bwa(e,t){return qwa(~e,t,Zta,dua)}function Cwa(e,t){return 0===e?t:e|qwa(~e,t,Zta,dua)}function Dwa(e,t){var r,i,a,s,n;if(1===dua)return t;if(r=0,a=Wsa(1,Zta)-1,s=Wsa(a,(dua-1)*Zta),r|=Wsa(t&a,i=32-Zta)|Xsa(t&s,i),dua<=2)return r;for(n=2;n<=dua>>1;n++)a=Wsa(a,Zta),s=Xsa(s,Zta),r|=Wsa(t&a,i-=2*Zta)|Xsa(t&s,i);return r}function Ewa(){return fwa(wua.stackValue(wua.methodArgumentCount()))?(Hva(),wua.failed()?null:(cxa(),wua.failed()?null:(wua.pop(wua.methodArgumentCount()),22===Uta||32===Uta?(wua.pop(1),wua.pushInteger(Jta)):void 0))):wua.primitiveFail()}function Fwa(){var e,t,r,i,a,s,n,o,u,l,c,h,f,d;if(6!==wua.methodArgumentCount())return wua.primitiveFail();if(c=wua.stackIntegerValue(0),a=wua.stackObjectValue(1),u=wua.stackObjectValue(2),Rsa(a)!==wua.classArray()||Rsa(u)!==wua.classArray())return wua.primitiveFail();if(256!==Ssa(u))return wua.primitiveFail();if(wua.failed())return null;if(s=Ssa(a)-2,r=wua.stackIntegerValue(3),h=wua.stackIntegerValue(4),d=wua.stackObjectValue(5),!wua.isBytes(d))return wua.primitiveFail();if(!(0>1,l=1;l<=u;l++)if(gua+=a,(r-=s)<0&&(hua+=h,r+=u),l>1,l=1;l<=s;l++)if(hua+=h,(r-=u)<0&&(gua+=a,r+=s),l=nta+12))return wua.primitiveFail();(a=vua-1)<=0&&(a=1);_=Wva(nta,Ita),r=Wva(nta+3,Ita),(O=Pva(_,r,a))<0&&(_=r-a*O);b=Wva(nta+1,Ita),r=Wva(nta+4,Ita),(S=Pva(b,r,a))<0&&(b=r-a*S);v=Wva(nta+9,Ita),r=Wva(nta+6,Ita),(l=Pva(v,r,a))<0&&(v=r-a*l);c=Wva(nta+10,Ita),r=Wva(nta+7,Ita),(s=Pva(c,r,a))<0&&(c=r-a*s);if(wua.failed())return;if(2===wua.methodArgumentCount())if(w=wua.stackIntegerValue(1),(g=wua.stackValue(0)).isNil){if(Nua<16)return wua.primitiveFail()}else{if(Ssa(g)>>=1;for(eva=Bua[Nua],bva=Wsa(1,cva=5-fva)-1,e=0;e<=bva;e++)dva[e]=Rua?32-Wsa(e+1,fva):Wsa(e,fva)})(),1>>2]),Xta[aua>>>2]=cua&p):(n=Xta[aua>>>2],p=u(i&d,n&cua),n=cua&p|n&~cua,Xta[aua>>>2]=n),aua+=4,I=2===r?(cua=Aua,y):(cua=Zsa,dua),0!=--r;);_+=O,b+=S,v+=l,c+=s,aua+=Yta}}(),Eta=0>>=8),u=255&(p>>>=8),o=255&(p>>>=8),255!=(c=255&Vta)&&(o=o*c>>>8,u=u*c>>>8,a=a*c>>>8,d=d*c>>>8),s=255&(l=t),b=255&(i=Wta),$ua&&(s=$ua[s],b=$ua[b]),255<(f=(s*(255-d)>>>8)+(b*d>>>8))&&(f=255),pua&&(f=pua[f]),s=255&(l>>>=8),b=255&(i>>>=8),$ua&&(s=$ua[s],b=$ua[b]),255<(r=(s*(255-a)>>>8)+(b*a>>>8))&&(r=255),pua&&(r=pua[r]),s=255&(l>>>=8),b=255&(i>>>=8),$ua&&(s=$ua[s],b=$ua[b]),255<(h=(s*(255-u)>>>8)+(b*u>>>8))&&(h=255),pua&&(h=pua[h]),i>>>=8,255<(n=((255&(l>>>=8))*(255-o)>>>8)+o)&&(n=255),(((n<<8)+h<<8)+r<<8)+f)}function Qwa(e,t){return 0===e?t:function(e,t,r,i){var a,s,n,o,u,l;for(l=Bua[r],s=0,o=1;o<=i;o++)n=Xsa(e&l,(o-1)*r),a=Xsa(t&l,(o-1)*r),32!==r&&(a=16===r?(n=4278190080|Swa(n),4278190080|Swa(a)):(n=4278190080|Uwa(n,r,32),4278190080|Uwa(a,r,32))),u=Owa(n,a),32!==r&&(u=Uwa(u,32,r)),s|=Wsa(u,(o-1)*r),l=Wsa(l,r);return s}(e,t,Zta,dua)}function Rwa(e,t){var r,i,a,s,n,o,u,l,c,h;for(n=Bua[Zta],o=16===Zta?(i=5,31):(i=8,255),c=cua,u=t,s=e,l=1;l<=dua;l++)0<(c&n)&&(h=u&n,r=s&n,a=Zta<16?r==h?0:1:((a=wwa(r,h,i,3))&o)+(Xsa(a,i)&o)+(Xsa(Xsa(a,i),i)&o),Jta+=a),c=Xsa(c,Zta),s=Xsa(s,Zta),u=Xsa(u,Zta);return t}function Swa(e){return(31&e)<<3|(992&e)<<6|(31744&e)<<9}function Uwa(e,t,r){var i,a,s,n;return 0<(i=r-t)?(n=Wsa(1,t)-1,a=(s=Wsa(e,i))&(n=Wsa(n,i)),n=Wsa(n,r),a+((s=Wsa(s,i))&n)+(Wsa(s,i)&Wsa(n,r))):0===i?5===t?32767&e:8===t?16777215&e:e:0===e?e:(n=Wsa(1,r)-1,a=(s=Xsa(e,i=t-r))&n,n=Wsa(n,r),0===(a=a+((s=Xsa(s,i))&n)+(Xsa(s,i)&Wsa(n,r)))?1:a)}function Wwa(e,t){return Zta<16?swa(e,t,Zta,dua):16===Zta?swa(e,t,5,3)+(swa(e>>>16,t>>>16,5,3)<<16):swa(e,t,8,4)}function Xwa(e,t){return Zta<16?twa(e,t,Zta,dua):16===Zta?twa(e,t,5,3)+(twa(e>>>16,t>>>16,5,3)<<16):twa(e,t,8,4)}function Ywa(e,t){var r;return r=~e,Zta<16?twa(r,t,Zta,dua):16===Zta?twa(r,t,5,3)+(twa(r>>>16,t>>>16,5,3)<<16):twa(r,t,8,4)}function Zwa(e,t){return Zta<16?uwa(e,t,Zta,dua):16===Zta?uwa(e,t,5,3)+(uwa(e>>>16,t>>>16,5,3)<<16):uwa(e,t,8,4)}function $wa(e,t){return Zta<16?wwa(e,t,Zta,dua):16===Zta?wwa(e,t,5,3)+(wwa(e>>>16,t>>>16,5,3)<<16):wwa(e,t,8,4)}function _wa(e){return!1!=((wua=e).majorVersion()==Psa)&&wua.minorVersion()>=Qsa}function axa(){var e,t;if(e=t=0,!(Nua<=8)){if(16===Nua&&(e=5),32===Nua&&(e=8),0===Ota){if(Zta<=8)return;16===Zta&&(t=5),32===Zta&&(t=8)}else t=Ota;bxa(e,t)}}function bxa(e,t){var r,i,a=[0,0,0,0],s=[0,0,0,0];0!=(r=t-e)&&(r<=0?(i=Wsa(1,t)-1,s[Bta]=Wsa(i,2*e-r),s[zta]=Wsa(i,e-r),s[pta]=Wsa(i,0-r),s[$sa]=0):(i=Wsa(1,e)-1,s[Bta]=Wsa(i,2*e),s[zta]=Wsa(i,e),s[pta]=i),a[Bta]=3*r,a[zta]=2*r,a[pta]=r,a[$sa]=0,Tta=a,Sta=s,Pta=Pta|tta|qta)}function cxa(){wua.showDisplayBitsLeftTopRightBottom($ta,Dta,Fta,Eta,Cta)}function exa(e,t){return e}function fxa(e,t){return e-t}function gxa(e,t){var r,i,a,s,n,o;if((Pta&(tta|rta))!=(tta|rta))return t;for(r=Bua[Zta],a=t,n=cua,s=1;s<=dua;s++)0!=(n&r)&&(o=a&r,ixa(i=Zta<16?o:Uwa(o,16===Zta?5:8,Ota),hxa(i)+1)),n=Xsa(n,Zta),a=Xsa(a,Zta);return t}function hxa(e){return Qta[e&Rta]}function ixa(e,t){return Qta[e&Rta]=t}function kxa(){var e,t,r,i;if(uua){if(!_ua&&!lwa())return;r=_ua,i=!1,"number"==typeof(e=wua.fetchPointerofObject(vta,$ta))&&(r(e=e,Dta,Fta,Eta-Dta,Cta-Fta),Xta=eua=0,i=!0),Fua||"number"==typeof(t=wua.fetchPointerofObject(vta,Oua))&&(t=t,i&&t===e||r(t,0,0,0,0),Lua=Tua=0),uua=!1}}function oxa(e,t,r,i,a,s,n,o){var u,l,c,h,f,d,p,b,m,v,g,k,_,S,y,I,O,w,F;b=Bua[Zta],l=0,m=2===n?(c=t>>1,f=r>>1,p=i>>1,a>>1):(c=Usa(t,n),f=Usa(r,n),p=Usa(i,n),Usa(a,n)),d=e;do{y=Yua,g=Zua,I=O=S=k=0,w=0,h=n;do{for(F=y,_=g,u=n;v=zwa(F,_),25===Uta&&0===v||(++w,k+=255&(v=Nua<16?s[v]:16===Nua?Swa(v):v),S+=v>>>8&255,O+=v>>>16&255,I+=v>>>24),F+=c,_+=f,0!=--u;);y+=p,g+=m}while(0!=--h);l|=Wsa((v=0===w||25===Uta&&w>1?0:(4===w?(O>>>=2,S>>>=2,k>>>=2,I>>>=2):(O=Usa(O,w),S=Usa(S,w),k=Usa(k,w),I=Usa(I,w)),0===(v=(I<<24)+(O<<16)+(S<<8)+k)&&0>2)===DIa&&sIa===BIa&&sIa===uIa&&BIa===uIa),!1===vIa.failed())}function IIa(){var e,t,r,i,a;for(i=0,r=zIa;i>1,i=sIa>>2,f=1;f<=xIa;f++)for(c=rIa(1,f),h=c>>1,m=sIa,v=c,t=0|Math.floor(m/v),l=1;l<=h;l++)for(o=(b=(l-1)*t)=oIa}function FJa(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function IJa(){return HJa}function JJa(){var e,t,r,i,a,s;if(e=GJa.stackObjectValue(0),a=GJa.stackObjectValue(1),GJa.failed())return null;if(GJa.success(GJa.isWords(e)),GJa.success(GJa.isWords(a)),GJa.failed())return null;if(i=FJa(e),GJa.success(i===FJa(a)),GJa.failed())return null;for(s=a.wordsAsFloat32Array(),t=e.wordsAsFloat32Array(),r=0;r<=i-1;r++)s[r]=s[r]+t[r];GJa.pop(1)}function KJa(){var e,t,r,i,a;if(a=GJa.stackFloatValue(0),r=GJa.stackObjectValue(1),GJa.failed())return null;if(GJa.success(GJa.isWords(r)),GJa.failed())return null;for(t=FJa(r),i=r.wordsAsFloat32Array(),e=0;e<=t-1;e++)i[e]=i[e]+a;GJa.pop(1)}function LJa(){var e,t,r;return t=GJa.stackIntegerValue(0),r=GJa.stackObjectValue(1),GJa.failed()?null:(GJa.success(GJa.isWords(r)),GJa.success(0=EJa}function MLa(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function NLa(e,t){return new Int32Array(e.buffer,e.byteOffset+4*t)}function QLa(e,t){var r,i,a,s;return r=e[0],a=e[1],(i=t[0]-r)*i+(s=t[1]-a)*s}function SLa(){return PLa}function VLa(e){console.log(PLa+": "+e)}function WLa(){var e,t,r,i,a,s,n,o,u,l,c,h,f,d,p,b,m,v,g,k,_,S,y,I,O,w,F,C,x,A,P,$,V,Y,M,j,N,q,B,W,E,L,T,R,Q,D,U,z,X,G;if(M=OLa.stackValue(11),j=OLa.stackValue(10),N=OLa.stackValue(9),q=OLa.stackValue(8),B=OLa.stackValue(7),W=OLa.stackValue(6),E=OLa.stackValue(5),L=OLa.stackValue(4),T=OLa.stackIntegerValue(3),R=OLa.stackValue(2),Q=OLa.stackValue(1),D=OLa.stackValue(0),OLa.failed())return null;if(OLa.failed())return VLa("failed 1"),null;if(OLa.success(OLa.isWords(M)&&OLa.isWords(j)&&OLa.isWords(N)&&OLa.isWords(q)&&OLa.isWords(B)&&OLa.isWords(W)&&OLa.isWords(E)&&OLa.isWords(L)&&OLa.isWords(R)&&OLa.isWords(Q)&&OLa.isWords(D)),OLa.failed())return VLa("failed 2"),null;if(OLa.success(OLa.isMemberOf(M,"PointArray")&&OLa.isMemberOf(j,"PointArray")),OLa.failed())return VLa("failed 3"),null;if(f=M.wordsAsInt32Array(),v=j.wordsAsInt32Array(),k=N.wordsAsInt32Array(),u=q.wordsAsInt32Array(),p=B.wordsAsInt32Array(),c=W.wordsAsInt32Array(),P=E.wordsAsInt32Array(),e=L.wordsAsInt32Array(),S=R.wordsAsInt32Array(),V=Q.wordsAsInt32Array(),_=D.wordsAsInt32Array(),g=MLa(j)>>>1,F=MLa(N)>>>1,l=MLa(q)>>>1,t=MLa(W),h=MLa(R),OLa.success(h===MLa(Q)&&h===MLa(D)&&l=F-1&&MLa(M)>>>1>=F&&l-1<=t&&l<=g&&MLa(E)>=F-1&&MLa(L)>=l-1),OLa.failed())return VLa("failed 5"),null;if(C=T>>>1,b=(r=1&T)?0:C*C>>>10,_[V[S[0]=0]=0]=2,O=0-b,!((d=l)-1<=g&&d-1<=t))return OLa.primitiveFail(),null;for(I=1;I<=d;I++)O=O+(c[i=I-1]+QLa(NLa(v,i<<1),f)>>>7)+b,V[I]=O,S[I]=O*I,_[I]=I+1;for(O=V[0]-b,w=1;w<=F;w++){for(y=(a=w-1)<<1,A=S[0],O=O+(p[a]+QLa(NLa(f,y),v)>>>7)+b,V[0]=O,S[0]=O*w,_[0]=w+1,d=l,I=1;I<=d;I++)s=(i=I-1)<<1,x=S[I],Y=S[i],m=p[a]+QLa(NLa(f,y),NLa(v,I<<1))>>>7,0===(O=V[I])?x+=m:(x=x+O+m*_[I],m+=O),o=c[i]+QLa(NLa(v,s),NLa(f,w<<1))>>>7,0===(O=V[i])?Y+=o:(Y=Y+O+o*_[i],o+=O),r?A=1<<29:A+=(QLa(NLa(u,s),NLa(k,y))+QLa(NLa(v,s),NLa(f,y)))*(16+(z=e[i],X=P[a],G=void 0,180<(G=Math.abs(X-z))&&(G=360-G),G*G>>>6))>>>11,$=A<=x&&A<=Y?(n=A,O=0,1):x<=Y?(n=x,O=m+b,_[I]+1):(n=Y,O=o+b,_[i]+1),A=S[I],S[I]=Math.min(n,1<<29),V[I]=Math.min(O,1<<29),_[I]=$;O=V[0]}return U=n,OLa.failed()||OLa.popthenPush(13,U),null}function XLa(){return OLa.failed()||OLa.popthenPush(1,2e3),null}function YLa(e){return!1!=((OLa=e).majorVersion()==KLa)&&OLa.minorVersion()>=LLa}function oNa(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function qNa(e,t){return 0|Math.floor(e/t)}function rNa(e,t){return 31>>r)}function EOa(){return rOa}function GOa(e,t){var r,i,a,s,n;if(i=e[0]>>>24,TNa>>24&255))return-1}return-1}function IOa(){var e,t,r,i,a,s,n,o;return r=t=cOa[vNa],i=cOa[wNa],n=cOa[QNa],o=cOa[$Na],0!==n&&0!==o&&(r=qNa(r,n),i=qNa(i,o)),e=(i>>>3)*cOa[tNa]+(r>>>3),s=((7&i)<<3)+(7&r),a=bOa[e][s],++t<8*cOa[SNa]?cOa[vNa]=t:(cOa[vNa]=0,cOa[wNa]++),a}function JOa(){var e,t,r,i,a,s,n,o;return r=t=eOa[vNa],i=eOa[wNa],n=eOa[QNa],o=eOa[$Na],0!==n&&0!==o&&(r=qNa(r,n),i=qNa(i,o)),e=(i>>>3)*eOa[tNa]+(r>>>3),s=((7&i)<<3)+(7&r),a=dOa[e][s],++t<8*eOa[SNa]?eOa[vNa]=t:(eOa[vNa]=0,eOa[wNa]++),a}function KOa(){var e,t,r,i,a,s,n,o;return r=t=uOa[vNa],i=uOa[wNa],n=uOa[QNa],o=uOa[$Na],0!==n&&0!==o&&(r=qNa(r,n),i=qNa(i,o)),e=(i>>>3)*uOa[tNa]+(r>>>3),s=((7&i)<<3)+(7&r),a=tOa[e][s],++t<8*uOa[SNa]?uOa[vNa]=t:(uOa[vNa]=0,uOa[wNa]++),a}function LOa(){var e;return 4!==iOa.methodArgumentCount()?iOa.primitiveFail():(hOa=iOa.stackIntegerValue(0),e=iOa.stackObjectValue(1),iOa.failed()?null:iOa.isWords(e)&&3===oNa(e)?(sOa=e.wordsAsInt32Array(),e=iOa.stackObjectValue(2),iOa.failed()?null:iOa.isWords(e)?(kOa=oNa(e),jOa=e.wordsAsInt32Array(),e=iOa.stackObjectValue(3),iOa.failed()?null:SOa(e)?(function(){var e,t;for(uOa[vNa]=0,e=uOa[wNa]=0;e<=kOa-1;e++)t=KOa(),t+=sOa[PNa],t=Math.min(t,VNa),sOa[PNa]=t&hOa,t&=VNa-hOa,t=Math.max(t,1),jOa[e]=4278190080+(t<<16)+(t<<8)+t}(),void iOa.pop(4)):iOa.primitiveFail()):iOa.primitiveFail()):iOa.primitiveFail())}function MOa(){var e,t,r;return 4!==iOa.methodArgumentCount()?iOa.primitiveFail():(hOa=iOa.stackIntegerValue(0),e=iOa.stackObjectValue(1),iOa.failed()?null:iOa.isWords(e)&&3===oNa(e)?(sOa=e.wordsAsInt32Array(),e=iOa.stackObjectValue(2),iOa.failed()?null:iOa.isWords(e)?(kOa=oNa(e),jOa=e.wordsAsInt32Array(),e=iOa.stackObjectValue(3),iOa.failed()?null:iOa.isPointers(e)&&3===oNa(e)&&SOa(iOa.fetchPointerofObject(0,e))?(t=iOa.fetchPointerofObject(1,e),wOa(cOa,t)&&xOa(bOa,t)?(r=iOa.fetchPointerofObject(2,e),wOa(eOa,r)&&xOa(dOa,r)?(function(){var e,t,r,i,a,s,n;for(uOa[vNa]=0,uOa[wNa]=0,cOa[vNa]=0,cOa[wNa]=0,eOa[vNa]=0,a=eOa[wNa]=0;a<=kOa-1;a++)n=KOa(),t=IOa(),t-=ZNa,r=JOa(),s=n+(HNa*(r-=ZNa)>>16)+sOa[YNa],s=Math.min(s,VNa),s=Math.max(s,0),sOa[YNa]=s&hOa,s&=VNa-hOa,s=Math.max(s,1),i=n-(ANa*t>>16)-(DNa*r>>16)+sOa[PNa],i=Math.min(i,VNa),i=Math.max(i,0),sOa[PNa]=i&hOa,i&=VNa-hOa,i=Math.max(i,1),e=n+(JNa*t>>16)+sOa[uNa],e=Math.min(e,VNa),e=Math.max(e,0),sOa[uNa]=e&hOa,e&=VNa-hOa,e=Math.max(e,1),jOa[a]=4278190080+(s<<16)+(i<<8)+e}(),void iOa.pop(4)):iOa.primitiveFail()):iOa.primitiveFail()):iOa.primitiveFail()):iOa.primitiveFail()):iOa.primitiveFail())}function NOa(){var e,t,r,i;return 5!==iOa.methodArgumentCount()?iOa.primitiveFail():(r=iOa.stackObjectValue(0),iOa.failed()?null:function(e){var t,r,i;if(!(oNa(e)<5)&&iOa.isPointers(e)&&"number"!=typeof(t=iOa.fetchPointerofObject(0,e))&&iOa.isBytes(t)&&(oOa=t.bytes,r=(i=t).bytes?i.bytes.length:i.words?4*i.words.length:0,pOa=iOa.fetchIntegerofObject(1,e),qOa=iOa.fetchIntegerofObject(2,e),mOa=iOa.fetchIntegerofObject(3,e),nOa=iOa.fetchIntegerofObject(4,e),!iOa.failed()&&!(r>>4,0!==(r&=15)){if(a+=s,r=POa(DOa(r),r),a<0||yNa<=a)return iOa.primitiveFail();e[lOa[a]]=r}else{if(15!=s)return;a+=s}++a}}(e,uOa),iOa.failed()?null:(i=iOa.stackValue(0),iOa.storeIntegerofObjectwithValue(1,i,pOa),iOa.storeIntegerofObjectwithValue(3,i,mOa),iOa.storeIntegerofObjectwithValue(4,i,nOa),iOa.storeIntegerofObjectwithValue(XNa,iOa.stackValue(3),uOa[XNa]),void iOa.pop(5))))):iOa.primitiveFail()):iOa.primitiveFail()):iOa.primitiveFail()):iOa.primitiveFail())}function OOa(){var e,t;return 2!==iOa.methodArgumentCount()?iOa.primitiveFail():(e=iOa.stackObjectValue(0),iOa.failed()?null:iOa.isWords(e)&&oNa(e)===yNa?(t=e.wordsAsInt32Array(),e=iOa.stackObjectValue(1),iOa.failed()?null:iOa.isWords(e)&&oNa(e)===yNa?(function(e,t){var r,i,a,s,n,o,u,l,c,h,f,d,p,b,m,v,g,k,_,S=new Array(64);for(a=0;a<=xNa-1;a++){for(r=-1,n=1;n<=xNa-1;n++)-1===r&&0!==e[n*xNa+a]&&(r=n);if(-1===r)for(i=e[a]*t[0]<<2,s=0;s<=xNa-1;s++)S[s*xNa+a]=i;else d=(m=((v=e[2*xNa+a]*t[2*xNa+a])+(g=e[6*xNa+a]*t[6*xNa+a]))*CNa)+g*(0-KNa),p=m+v*ENa,l=(o=(v=e[a]*t[a])+(g=e[4*xNa+a]*t[4*xNa+a])<<13)+p,f=o-p,c=(u=v-g<<13)+d,h=u-d,o=e[7*xNa+a]*t[7*xNa+a],u=e[5*xNa+a]*t[5*xNa+a],d=e[3*xNa+a]*t[3*xNa+a],m=o+(p=e[xNa+a]*t[xNa+a]),v=u+d,_=((g=o+d)+(k=u+p))*GNa,g*=0-LNa,k*=0-BNa,o=(o*=zNa)+(m*=0-FNa)+(g+=_),u=(u*=MNa)+(v*=0-NNa)+(k+=_),d=(d*=ONa)+v+g,p=(p*=INa)+m+k,S[a]=l+p>>11,S[7*xNa+a]=l-p>>11,S[+xNa+a]=c+d>>11,S[6*xNa+a]=c-d>>11,S[2*xNa+a]=h+u>>11,S[5*xNa+a]=h-u>>11,S[3*xNa+a]=f+o>>11,S[4*xNa+a]=f-o>>11}for(a=0;a<=yNa-xNa;a+=xNa)d=(m=((v=S[a+2])+(g=S[a+6]))*CNa)+g*(0-KNa),p=m+v*ENa,l=(o=S[a]+S[a+4]<<13)+p,f=o-p,c=(u=S[a]-S[a+4]<<13)+d,h=u-d,o=S[a+7],u=S[a+5],d=S[a+3],m=o+(p=S[a+1]),v=u+d,_=((g=o+d)+(k=u+p))*GNa,g*=0-LNa,k*=0-BNa,o=(o*=zNa)+(m*=0-FNa)+(g+=_),u=(u*=MNa)+(v*=0-NNa)+(k+=_),d=(d*=ONa)+v+g,b=(l+(p=(p*=INa)+m+k)>>18)+ZNa,b=Math.min(b,VNa),b=Math.max(b,0),e[a]=b,b=(l-p>>18)+ZNa,b=Math.min(b,VNa),b=Math.max(b,0),e[a+7]=b,b=(c+d>>18)+ZNa,b=Math.min(b,VNa),b=Math.max(b,0),e[a+1]=b,b=(c-d>>18)+ZNa,b=Math.min(b,VNa),b=Math.max(b,0),e[a+6]=b,b=(h+u>>18)+ZNa,b=Math.min(b,VNa),b=Math.max(b,0),e[a+2]=b,b=(h-u>>18)+ZNa,b=Math.min(b,VNa),b=Math.max(b,0),e[a+5]=b,b=(f+o>>18)+ZNa,b=Math.min(b,VNa),b=Math.max(b,0),e[a+3]=b,b=(f-o>>18)+ZNa,b=Math.min(b,VNa),b=Math.max(b,0),e[a+4]=b}(e.wordsAsInt32Array(),t),void iOa.pop(2)):iOa.primitiveFail()):iOa.primitiveFail())}function POa(e,t){return e=nNa}function SOa(e){return wOa(uOa,e)&&xOa(tOa,e)}function WQa(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function XQa(e,t){return 0|Math.floor(e/t)}function YQa(e,t){return e-XQa(e,t)*t|0}function fRa(e,t){var r,i;return 0===e?0<=t?90:270:(r=t/e,i=Math.atan(r),0<=e?0<=t?i/.0174532925199433:360+i/.0174532925199433:180+i/.0174532925199433)}function gRa(e){var t,r;return r=(t=90-e)/360|0,t<0&&--r,.0174532925199433*(t-360*r)}function hRa(){var e,t,r,i,a,s,n,o,u,l,c,h,f,d,p,b;if(l=$Qa.stackValue(0),t=$Qa.stackValue(1),b=$Qa.stackValue(2),f=$Qa.stackValue(3),i=$Qa.stackIntegerValue(4),s=$Qa.stackIntegerValue(5),a=$Qa.stackValue(6),$Qa.failed())return null;if(!$Qa.isWords(a))return $Qa.primitiveFail(),null;if(!$Qa.isWords(f))return $Qa.primitiveFail(),null;if(!$Qa.isWords(b))return $Qa.primitiveFail(),null;if(!$Qa.isWords(t))return $Qa.primitiveFail(),null;if(!$Qa.isBytes(l))return $Qa.primitiveFail(),null;if(i*s!==WQa(a))return $Qa.primitiveFail(),null;if(o=WQa(f),WQa(b)!==o)return $Qa.primitiveFail(),null;if(WQa(t)!==o)return $Qa.primitiveFail(),null;if(WQa(l)!==o)return $Qa.primitiveFail(),null;for(h=f.wordsAsFloat32Array(),p=b.wordsAsFloat32Array(),e=t.words,u=l.bytes,r=a.words,n=0;n<=o-1;n++)c=0|h[n],d=0|p[n],0!==u[n]&&0<=c&&0<=d&&c>>16,e<0?0-a:a}function nRa(){var e;if(e=$Qa.stackIntegerValue(0),$Qa.failed())return null;_Qa=65536&e,$Qa.pop(1)}function oRa(){var e,t,r,i,a,s,n,o,u,l,c,h;if(l=$Qa.stackIntegerValue(0),u=$Qa.stackIntegerValue(1),o=$Qa.stackValue(2),i=$Qa.stackValue(3),$Qa.failed())return null;if((a=WQa(i))!==WQa(o))return $Qa.primitiveFail(),null;if(l<-32)return $Qa.primitiveFail(),null;if(8>>0-h:31=VQa}function QRa(){var e,t,r;return e=$Qa.stackFloatValue(0),t=$Qa.stackValue(1),r=$Qa.stackIntegerValue(2),$Qa.failed()?null:!$Qa.isWords(t)||WQa(t)>>16,e<0?0-a:a}function o_a(){var e;if(e=_$a.stackIntegerValue(0),_$a.failed())return null;a_a=65536&e,_$a.pop(1)}function p_a(){var e,t,r,i,a,s,n,o,u,l,c,h;if(l=_$a.stackIntegerValue(0),u=_$a.stackIntegerValue(1),o=_$a.stackValue(2),i=_$a.stackValue(3),_$a.failed())return null;if((a=X$a(i))!==X$a(o))return _$a.primitiveFail(),null;if(l<-32)return _$a.primitiveFail(),null;if(8>>0-h:31=l[a];else for(c=o.words,r=e.wordsAsFloat32Array(),t=u.bytes,a=0;a<=n-1;a++)t[a]=c[a]>=r[a];else if(s)for(i=o.wordsAsFloat32Array(),l=e.words,t=u.bytes,a=0;a<=n-1;a++)t[a]=i[a]>=l[a];else for(i=o.wordsAsFloat32Array(),r=e.wordsAsFloat32Array(),t=u.bytes,a=0;a<=n-1;a++)t[a]=i[a]>=r[a];_$a.pop(4),_$a.push(u)}function H_a(){var e,t,r,i,a,s,n,o,u,l,c;if(l=_$a.stackObjectValue(0),e=_$a.stackValue(1),u=_$a.stackObjectValue(2),_$a.failed())return null;if(_$a.success(_$a.isWords(u)),_$a.success(_$a.isBytes(l)),_$a.failed())return null;if(o=X$a(u),_$a.success(o===X$a(l)),_$a.failed())return null;if(n="number"==typeof e,_$a.isMemberOf(u,"WordArray"))if(n)for(c=u.words,s=e,t=l.bytes,a=0;a<=o-1;a++)t[a]=c[a]>=s;else for(c=u.words,r=_$a.floatValueOf(e),t=l.bytes,a=0;a<=o-1;a++)t[a]=c[a]>=r;else if(n)for(i=u.wordsAsFloat32Array(),s=e,t=l.bytes,a=0;a<=o-1;a++)t[a]=i[a]>=s;else for(i=u.wordsAsFloat32Array(),r=_$a.floatValueOf(e),t=l.bytes,a=0;a<=o-1;a++)t[a]=i[a]>=r;_$a.pop(4),_$a.push(l)}function I_a(){var e,t,r,i,a,s,n,o,u,l,c;if(u=_$a.stackObjectValue(0),e=_$a.stackObjectValue(1),o=_$a.stackObjectValue(2),_$a.failed())return null;if(_$a.success(_$a.isWords(e)),_$a.success(_$a.isWords(o)),_$a.success(_$a.isBytes(u)),_$a.failed())return null;if(n=X$a(e),_$a.success(n===X$a(o)),_$a.success(n===X$a(u)),_$a.failed())return null;if(s=_$a.isMemberOf(e,"WordArray"),_$a.isMemberOf(o,"WordArray"))if(s)for(c=o.words,l=e.words,t=u.bytes,a=0;a<=n-1;a++)t[a]=c[a]>l[a];else for(c=o.words,r=e.wordsAsFloat32Array(),t=u.bytes,a=0;a<=n-1;a++)t[a]=c[a]>r[a];else if(s)for(i=o.wordsAsFloat32Array(),l=e.words,t=u.bytes,a=0;a<=n-1;a++)t[a]=i[a]>l[a];else for(i=o.wordsAsFloat32Array(),r=e.wordsAsFloat32Array(),t=u.bytes,a=0;a<=n-1;a++)t[a]=i[a]>r[a];_$a.pop(4),_$a.push(u)}function J_a(){var e,t,r,i,a,s,n,o,u,l,c;if(l=_$a.stackObjectValue(0),e=_$a.stackValue(1),u=_$a.stackObjectValue(2),_$a.failed())return null;if(_$a.success(_$a.isWords(u)),_$a.success(_$a.isBytes(l)),_$a.failed())return null;if(o=X$a(u),_$a.success(o===X$a(l)),_$a.failed())return null;if(n="number"==typeof e,_$a.isMemberOf(u,"WordArray"))if(n)for(c=u.words,s=e,t=l.bytes,a=0;a<=o-1;a++)t[a]=c[a]>s;else for(c=u.words,r=_$a.floatValueOf(e),t=l.bytes,a=0;a<=o-1;a++)t[a]=c[a]>r;else if(n)for(i=u.wordsAsFloat32Array(),s=e,t=l.bytes,a=0;a<=o-1;a++)t[a]=i[a]>s;else for(i=u.wordsAsFloat32Array(),r=_$a.floatValueOf(e),t=l.bytes,a=0;a<=o-1;a++)t[a]=i[a]>r;_$a.pop(4),_$a.push(l)}function K_a(){var e,t,r,i,a,s,n,o,u,l,c;if(u=_$a.stackObjectValue(0),e=_$a.stackObjectValue(1),o=_$a.stackObjectValue(2),_$a.failed())return null;if(_$a.success(_$a.isWords(e)),_$a.success(_$a.isWords(o)),_$a.success(_$a.isBytes(u)),_$a.failed())return null;if(n=X$a(e),_$a.success(n===X$a(o)),_$a.success(n===X$a(u)),_$a.failed())return null;if(s=_$a.isMemberOf(e,"WordArray"),_$a.isMemberOf(o,"WordArray"))if(s)for(c=o.words,l=e.words,t=u.bytes,a=0;a<=n-1;a++)t[a]=c[a]<=l[a];else for(c=o.words,r=e.wordsAsFloat32Array(),t=u.bytes,a=0;a<=n-1;a++)t[a]=c[a]<=r[a];else if(s)for(i=o.wordsAsFloat32Array(),l=e.words,t=u.bytes,a=0;a<=n-1;a++)t[a]=i[a]<=l[a];else for(i=o.wordsAsFloat32Array(),r=e.wordsAsFloat32Array(),t=u.bytes,a=0;a<=n-1;a++)t[a]=i[a]<=r[a];_$a.pop(4),_$a.push(u)}function L_a(){var e,t,r,i,a,s,n,o,u,l,c;if(l=_$a.stackObjectValue(0),e=_$a.stackValue(1),u=_$a.stackObjectValue(2),_$a.failed())return null;if(_$a.success(_$a.isWords(u)),_$a.success(_$a.isBytes(l)),_$a.failed())return null;if(o=X$a(u),_$a.success(o===X$a(l)),_$a.failed())return null;if(n="number"==typeof e,_$a.isMemberOf(u,"WordArray"))if(n)for(c=u.words,s=e,t=l.bytes,a=0;a<=o-1;a++)t[a]=c[a]<=s;else for(c=u.words,r=_$a.floatValueOf(e),t=l.bytes,a=0;a<=o-1;a++)t[a]=c[a]<=r;else if(n)for(i=u.wordsAsFloat32Array(),s=e,t=l.bytes,a=0;a<=o-1;a++)t[a]=i[a]<=s;else for(i=u.wordsAsFloat32Array(),r=_$a.floatValueOf(e),t=l.bytes,a=0;a<=o-1;a++)t[a]=i[a]<=r;_$a.pop(4),_$a.push(l)}function M_a(){var e,t,r,i,a,s,n,o,u,l,c;if(u=_$a.stackObjectValue(0),e=_$a.stackObjectValue(1),o=_$a.stackObjectValue(2),_$a.failed())return null;if(_$a.success(_$a.isWords(e)),_$a.success(_$a.isWords(o)),_$a.success(_$a.isBytes(u)),_$a.failed())return null;if(n=X$a(e),_$a.success(n===X$a(o)),_$a.success(n===X$a(u)),_$a.failed())return null;if(s=_$a.isMemberOf(e,"WordArray"),_$a.isMemberOf(o,"WordArray"))if(s)for(c=o.words,l=e.words,t=u.bytes,a=0;a<=n-1;a++)t[a]=c[a]>>0,m[i]=r);if(!b&&!o)for(m=v.words,h=l.words,i=d-1;i<=p-1;i++)1===a[i]&&(m[i]=h[c+i-d]);_$a.pop(4)}function $_a(){var e,t,r,i,a,s,n,o,u,l,c,h,f,d,p,b,m,v,g;if(f=_$a.stackObjectValue(0),e=_$a.stackObjectValue(1),h=_$a.stackObjectValue(2),_$a.failed())return null;if(_$a.success(_$a.isWords(e)),_$a.success(_$a.isWords(h)),_$a.success(_$a.isWords(f)),_$a.failed())return null;if(c=X$a(e),_$a.success(c===X$a(h)),_$a.success(c===X$a(f)),_$a.failed())return null;if(u=_$a.isMemberOf(e,"WordArray"),l=_$a.isMemberOf(h,"WordArray"),u&&l){if(!_$a.isMemberOf(f,"WordArray"))return _$a.primitiveFail(),null}else if(!_$a.isMemberOf(f,"KedamaFloatArray"))return _$a.primitiveFail(),null;if(l)if(u)for(v=h.words,m=e.words,g=f.words,o=0;o<=c-1;o++)b=Z$a(p=v[o],d=m[o]),g[o]=b;else for(v=h.words,a=e.wordsAsFloat32Array(),n=f.wordsAsFloat32Array(),o=0;o<=c-1;o++)i=(p=v[o])/(t=a[o]),i=Math.floor(i),n[o]=p-i*t;else if(u)for(s=h.wordsAsFloat32Array(),m=e.words,n=f.wordsAsFloat32Array(),o=0;o<=c-1;o++)i=(r=s[o])/(d=m[o]),i=Math.floor(i),n[o]=r-i*d;else for(s=h.wordsAsFloat32Array(),a=e.wordsAsFloat32Array(),n=f.wordsAsFloat32Array(),o=0;o<=c-1;o++)i=(r=s[o])/(t=a[o]),i=Math.floor(i),n[o]=r-i*t;_$a.pop(4),_$a.push(f)}function __a(){var e,t,r,i,a,s,n,o,u,l,c,h,f,d,p,b;if(f=_$a.stackObjectValue(0),e=_$a.stackValue(1),h=_$a.stackObjectValue(2),_$a.failed())return null;if(_$a.success(_$a.isWords(h)),_$a.success(_$a.isWords(f)),_$a.failed())return null;if(c=X$a(h),_$a.success(c===X$a(f)),_$a.failed())return null;if(u="number"==typeof e,l=_$a.isMemberOf(h,"WordArray"),u&&l){if(!_$a.isMemberOf(f,"WordArray"))return _$a.primitiveFail(),null}else if(!_$a.isMemberOf(f,"KedamaFloatArray"))return _$a.primitiveFail(),null;if(l)if(u)for(p=h.words,o=e,b=f.words,n=0;n<=c-1;n++)b[n]=Z$a(p[n],o);else for(p=h.words,t=_$a.floatValueOf(e),s=f.wordsAsFloat32Array(),n=0;n<=c-1;n++)i=(d=p[n])/t,i=Math.floor(i),s[n]=d-i*t;else if(u)for(a=h.wordsAsFloat32Array(),o=e,s=f.wordsAsFloat32Array(),n=0;n<=c-1;n++)i=(r=a[n])/o,i=Math.floor(i),s[n]=r-i*o;else for(a=h.wordsAsFloat32Array(),t=_$a.floatValueOf(e),s=f.wordsAsFloat32Array(),n=0;n<=c-1;n++)i=(r=a[n])/t,i=Math.floor(i),s[n]=r-i*t;_$a.pop(4),_$a.push(f)}function a0a(){var e,t,r,i,a,s,n,o,u,l,c,h,f;if(l=_$a.stackObjectValue(0),e=_$a.stackObjectValue(1),u=_$a.stackObjectValue(2),_$a.failed())return null;if(_$a.success(_$a.isWords(e)),_$a.success(_$a.isWords(u)),_$a.success(_$a.isWords(l)),_$a.failed())return null;if(o=X$a(e),_$a.success(o===X$a(u)),_$a.success(o===X$a(l)),_$a.failed())return null;if(s=_$a.isMemberOf(e,"WordArray"),n=_$a.isMemberOf(u,"WordArray"),s&&n){if(!_$a.isMemberOf(l,"WordArray"))return _$a.primitiveFail(),null}else if(!_$a.isMemberOf(l,"KedamaFloatArray"))return _$a.primitiveFail(),null;if(n)if(s)for(h=u.words,c=e.words,f=l.words,a=0;a<=o-1;a++)f[a]=h[a]-c[a];else for(h=u.words,t=e.wordsAsFloat32Array(),i=l.wordsAsFloat32Array(),a=0;a<=o-1;a++)i[a]=h[a]-t[a];else if(s)for(r=u.wordsAsFloat32Array(),c=e.words,i=l.wordsAsFloat32Array(),a=0;a<=o-1;a++)i[a]=r[a]-c[a];else for(r=u.wordsAsFloat32Array(),t=e.wordsAsFloat32Array(),i=l.wordsAsFloat32Array(),a=0;a<=o-1;a++)i[a]=r[a]-t[a];_$a.pop(4),_$a.push(l)}function b0a(){var e,t,r,i,a,s,n,o,u,l,c,h,f;if(c=_$a.stackObjectValue(0),e=_$a.stackValue(1),l=_$a.stackObjectValue(2),_$a.failed())return null;if(_$a.success(_$a.isWords(l)),_$a.success(_$a.isWords(c)),_$a.failed())return null;if(u=X$a(l),_$a.success(u===X$a(c)),_$a.failed())return null;if(n="number"==typeof e,o=_$a.isMemberOf(l,"WordArray"),n&&o){if(!_$a.isMemberOf(c,"WordArray"))return _$a.primitiveFail(),null}else if(!_$a.isMemberOf(c,"KedamaFloatArray"))return _$a.primitiveFail(),null;if(o)if(n)for(h=l.words,s=e,f=c.words,a=0;a<=u-1;a++)f[a]=h[a]-s;else for(h=l.words,t=_$a.floatValueOf(e),i=c.wordsAsFloat32Array(),a=0;a<=u-1;a++)i[a]=h[a]-t;else if(n)for(r=l.wordsAsFloat32Array(),s=e,i=c.wordsAsFloat32Array(),a=0;a<=u-1;a++)i[a]=r[a]-s;else for(r=l.wordsAsFloat32Array(),t=_$a.floatValueOf(e),i=c.wordsAsFloat32Array(),a=0;a<=u-1;a++)i[a]=r[a]-t;_$a.pop(4),_$a.push(c)}function c0a(e){var t;return 0<(t=90-e/.0174532925199433)||(t+=360),t}function d0a(){var e,t,r,i,a,s,n;if(e=_$a.stackFloatValue(0),r=_$a.stackValue(1),n=_$a.stackIntegerValue(2),i=_$a.stackIntegerValue(3),s=_$a.stackIntegerValue(4),_$a.failed())return null;if(!_$a.isWords(r))return _$a.primitiveFail(),null;if(!(n<=X$a(r)&&1<=i&&i<=n))return _$a.primitiveFail(),null;if(t=r.wordsAsFloat32Array(),_$a.failed())return null;for(a=i;a<=n;a++)t[a-1]=n_a(s)*e;_$a.pop(5)}function e0a(){var e,t,r,i,a,s,n;if(e=_$a.stackFloatValue(0),a=_$a.stackValue(1),n=_$a.stackIntegerValue(2),t=_$a.stackIntegerValue(3),s=_$a.stackIntegerValue(4),_$a.failed())return null;if(!_$a.isWords(a))return _$a.primitiveFail(),null;if(!(n<=X$a(a)&&1<=t&&t<=n))return _$a.primitiveFail(),null;if(i=a.words,_$a.failed())return null;for(r=t;r<=n;r++)i[r-1]=n_a(s)*e|0;_$a.pop(5)}function f0a(){var e,t;return e=_$a.stackIntegerValue(0),_$a.failed()?null:(t=n_a(e),_$a.failed()?null:(_$a.pop(2),void _$a.pushInteger(t)))}function g0a(){var e,t,r,i,a;return t=_$a.stackFloatValue(0),e=_$a.stackFloatValue(1),a=_$a.stackFloatValue(2),i=_$a.stackFloatValue(3),_$a.failed()?null:(r=g_a(i-e,a-t),360<(r+=90)&&(r-=360),_$a.failed()?null:(_$a.pop(5),void _$a.pushFloat(r)))}function h0a(){var e,t,r,i,a,s,n;return t=_$a.stackFloatValue(0),e=_$a.stackFloatValue(1),a=_$a.stackFloatValue(2),i=_$a.stackFloatValue(3),_$a.failed()?null:(s=e-i,n=t-a,r=Math.sqrt(s*s+n*n),_$a.failed()?null:(_$a.pop(5),void _$a.pushFloat(r)))}function i0a(e,t,r,i,a,s,n){var o,u;(u=i)<0&&(1===s&&(u+=a),2===s&&(u=0),3===s&&(u=0-u,o=r[e],r[e]=o<3.141592653589793?3.141592653589793-o:9.42477796076938-o)),a<=u&&(1===n&&(u-=a),2===n&&(u=a-1e-6),3===n&&(u=a-1e-6-(u-a),o=r[e],r[e]=o<3.141592653589793?3.141592653589793-o:9.42477796076938-o)),t[e]=u}function j0a(e,t,r,i,a,s,n){var o;(o=i)<0&&(1===s&&(o+=a),2===s&&(o=0),3===s&&(o=0-o,r[e]=6.283185307179586-r[e])),a<=o&&(1===n&&(o-=a),2===n&&(o=a-1e-6),3===n&&(o=a-1e-6-(o-a),r[e]=6.283185307179586-r[e])),t[e]=o}function k0a(){var e,t,r,i,a,s,n,o,u,l;if(u=_$a.stackValue(0),r=_$a.stackValue(1),n=_$a.stackValue(2),_$a.failed())return null;if(!_$a.isBytes(n))return _$a.primitiveFail(),null;if(!_$a.isWords(r))return _$a.primitiveFail(),null;if(l=X$a(r),u.isFloat)a=!1;else{if(!_$a.isWords(u))return _$a.primitiveFail(),null;if(X$a(u)!==l)return _$a.primitiveFail(),null;a=!0}for(s=n.bytes,t=r.wordsAsFloat32Array(),a?o=u.wordsAsFloat32Array():e=h_a(e=_$a.floatValueOf(u)),i=0;i<=l-1;i++)1===s[i]&&(a&&(e=h_a(e=o[i])),t[i]=e);if(_$a.failed())return null;_$a.pop(3)}function l0a(e){return!1!=((_$a=e).majorVersion()==V$a)&&_$a.minorVersion()>=W$a}function m0a(){var e,t,r;return e=_$a.stackFloatValue(0),t=_$a.stackValue(1),r=_$a.stackIntegerValue(2),_$a.failed()?null:!_$a.isWords(t)||X$a(t)>=1);jgb=sgb*dgb[Sfb]|0,function(e,t,r){var i,a,s,n,o,u,l,c,h,f,d,p,b,m;f=(p=sgb*e|0)/sgb,h=r,a=(l=t)<=0?1:1-(u=(1-f)/l)/(Math.exp(u)-1);o=vfb*(h+1),i=Math.cos(o),d=Math.sin(o),m=function(e,t,r,i){var a,s,n,o,u,l,c;if(0<(o=Qgb(0,e,t,r,i)))for(u=0,a=o,s=Qgb(l=1,e,t,r,i);0=pgb),fgb.failed()?null:(function(e,t,r){var i,a,s,n,o,u,l,c,h,f,d,p,b,m,v,g,k,_,S;(function(e){var t,r,i,a,s,n,o,u,l,c,h;c=.6*Igb((dgb=e)[Neb]),h=.6*Igb(dgb[Peb]),t=.4*Igb(dgb[Eeb]),i=.15*Igb(dgb[Geb]),s=.06*Igb(dgb[Ieb]),o=.04*Igb(dgb[Keb]),r=.15*Igb(dgb[Feb]),a=.06*Igb(dgb[Heb]),n=.04*Igb(dgb[Jeb]),u=.022*Igb(dgb[Leb]),l=.03*Igb(dgb[Meb]),8<=cgb&&(16e3<=qgb?Rgb(Mfb,7500,600):cgb=6);7<=cgb&&(16e3<=qgb?Rgb(Lfb,6500,500):cgb=6);6<=cgb&&Rgb(Jfb,dgb[mfb],dgb[Zeb]);5<=cgb&&Rgb(Hfb,dgb[lfb],dgb[Xeb]);Rgb(Efb,dgb[kfb],dgb[Veb]),Rgb(Bfb,dgb[jfb],dgb[Teb]),Rgb(yfb,dgb[ifb],dgb[Reb]),Rgb(wfb,dgb[hfb],dgb[Qeb]),Rgb(Pfb,dgb[ofb],dgb[_eb]),Rgb(Ufb,dgb[rfb],dgb[bfb]),Bgb(Rfb,dgb[pfb],dgb[afb]),Bgb(Wfb,dgb[sfb],dgb[cfb]),Sgb(Qfb,dgb[ofb],dgb[_eb],c),Sgb(Vfb,dgb[rfb],dgb[bfb],h),Sgb(xfb,dgb[hfb],dgb[Qeb],t),Sgb(Afb,dgb[ifb],dgb[Reb],i),Sgb(Dfb,dgb[jfb],dgb[Teb],s),Sgb(Gfb,dgb[kfb],dgb[Veb],o),Sgb(zfb,dgb[ifb],dgb[Seb],r),Sgb(Cfb,dgb[jfb],dgb[Ueb],a),Sgb(Ffb,dgb[kfb],dgb[Web],n),Sgb(Ifb,dgb[lfb],dgb[Yeb],u),Sgb(Kfb,dgb[mfb],dgb[$eb],l)})(e),0=Aeb}function gkb(e){return"number"==typeof e?nkb.classSmallInteger():e.sqClass}function hkb(e){return e.bytes?e.bytes.length:e.words?4*e.words.length:0}function ikb(e,t){return 0|Math.floor(e/t)}function jkb(e,t){return e-ikb(e,t)*t|0}function kkb(e,t){return 31>>t}function rkb(e,t,r){var i,a,s,n,o,u,l,c,h;if(t<1||r<1)return nkb.primitiveFail();if(a=e,!((u=Math.min(r,zkb((h=a).bytes,hkb(h))))>3),i=1+(u-1>>3),n=jkb(t-1,8),s=7-jkb(u-1,8),o==i)return l=kkb(255,n)&lkb(255,s),0!=(Ukb(a,o)&l);if(0!==lkb(Ukb(a,o),n))return 1;for(c=1+o;c<=i-1;c++)if(0!==Ukb(a,c))return 1;return 0!=(255&kkb(Ukb(a,i),s))}}function skb(e,t){var r,i,a;return a=nkb.instantiateClassindexableSize(gkb(e),t),i=(r=hkb(e))>>=16,r+=16),t<256||(t>>>=8,r+=8),t<16||(t>>>=4,r+=4),t<4||(t>>>=2,r+=2),t<2||(t>>>=1,++r),r+t}function Kkb(e){var t,r,i,a,s,n;for(s=(n=e)<0?nkb.classLargeNegativeInteger():nkb.classLargePositiveInteger(),t=Akb(n),i=(r=nkb.instantiateClassindexableSize(s,t)).bytes,a=1;a<=t;a++)i[a-1]=Ekb(n,a);return r}function Lkb(e,t){var r,i,a,s;return i=hkb(e),0===(s=zkb(e.bytes,i))?0:(r=s+t+7>>3,a=nkb.instantiateClassindexableSize(gkb(e),r),function(e,t,r,i,a){var s,n,o,u,l,c,h;for(s=e>>3,l=jkb(e,8),h=s-1,u=0;u<=h;u++)i[u]=0;if(0===l)return Gkb(i,s,a-1,t,0);for(c=8-l,h=r-1,u=n=0;u<=h;u++)o=t[u],i[u+s]=255&(n|kkb(o,l)),n=lkb(o,c);0!==n&&(i[a-1]=n)}(t,e.bytes,i,a.bytes,r),a)}function Mkb(e,t,r){var i,a,s,n,o;return a=(o=zkb(e.bytes,r))+7>>3,(n=o-t)<=0?nkb.instantiateClassindexableSize(gkb(e),0):(s=7+n>>3,i=nkb.instantiateClassindexableSize(gkb(e),s),function(e,t,r,i,a){var s,n,o,u,l,c,h,f;if(n=e>>3,0===(l=jkb(e,8)))return Gkb(i,0,a-1,t,n);for(c=8-l,o=lkb(t[n],l),h=r-1,s=f=1+n;s<=h;s++)u=t[s],i[s-f]=255&(o|kkb(u,c)),o=lkb(u,l);0!==o&&(i[a-1]=o)}(t,e.bytes,a,i.bytes,s),i)}function Nkb(e,t){var r,i,a,s,n,o,u,l,c,h;return l=hkb(e),c=hkb(t),n=gkb(e),u=l<=c?(s=e,i=l,h=t,c):(s=t,i=c,h=e,l),r=nkb.instantiateClassindexableSize(n,u),0<(a=function(e,t,r,i,a){var s,n,o;for(n=t-1,s=o=0;s<=n;s++)o=(o>>>8)+e[s]+r[s],a[s]=255&o;for(n=i-1,s=t;s<=n;s++)o=(o>>>8)+r[s],a[s]=255&o;return o>>>8}(s.bytes,i,h.bytes,u,r.bytes))&&(o=nkb.instantiateClassindexableSize(n,u+1),xkb(r.bytes,o.bytes,u),(r=o).bytes[u]=a),r}function Okb(e,t,r){var i,a,s,n,o,u,l,c,h;if("number"==typeof e){if(e<0)return nkb.primitiveFail();s=Kkb(e)}else{if(gkb(e)===nkb.classLargeNegativeInteger())return nkb.primitiveFail();s=e}if("number"==typeof t){if(t<0)return nkb.primitiveFail();n=Kkb(t)}else{if(gkb(t)===nkb.classLargeNegativeInteger())return nkb.primitiveFail();n=t}return u=(l=hkb(s))<(c=hkb(n))?(i=l,a=s,o=c,n):(i=c,a=n,o=l,s),h=nkb.instantiateClassindexableSize(nkb.classLargePositiveInteger(),o),function(e,t,r,i,a,s){var n,o;if(o=r-1,e!==mkb)if(e!==pkb){if(e!==qkb)return nkb.primitiveFail();for(n=0;n<=o;n++)s[n]=t[n]^i[n];for(o=a-1,n=r;n<=o;n++)s[n]=i[n]}else{for(n=0;n<=o;n++)s[n]=t[n]|i[n];for(o=a-1,n=r;n<=o;n++)s[n]=i[n]}else{for(n=0;n<=o;n++)s[n]=t[n]&i[n];for(o=a-1,n=r;n<=o;n++)s[n]=0}}(r,a.bytes,i,u.bytes,o,h.bytes),nkb.failed()?0:_kb(h)}function Pkb(e,t){var r,i;return i=hkb(e),(r=hkb(t))!==i?i>>8,c=255&d,f=m<3?0:r[m-3];(y>>8),c=e[v-1]*(255&o),n=r[p-1]-u-(255&c),r[p-1]=255&n,u=h+(c>>>8)-(n>>=8),++p;if(0>>8)+r[p-1]+e[v-1],r[p-1]=255&u,++p;a[s-b]=o}}(n.bytes,Rkb(n),s.bytes,Rkb(s),o.bytes,Rkb(o)),s=Mkb(s,u,Rkb(n)-1),a=nkb.instantiateClassindexableSize(nkb.classArray(),2),nkb.stObjectatput(a,1,o),nkb.stObjectatput(a,2,s)),a}function Rkb(e){return("number"==typeof e?Akb:hkb)(e)}function Skb(e,t,r,i){var a,s,n,o;return n=hkb(e),o=hkb(t),n<=(s=hkb(r))&&o<=s&&0<=i&&i<=255?(a=nkb.instantiateClassindexableSize(nkb.classLargePositiveInteger(),s),function(e,t,r,i,a,s,n,o){var u,l,c,h,f,d,p,b;for(d=t-1,f=i-1,h=s-1,l=c=0;l<=d;l++){for(b=o[0]+e[l]*r[0],b+=(p=b*n&255)*a[0],u=1;u<=f;u++)b=(b>>>8)+o[u]+e[l]*r[u]+p*a[u],o[u-1]=255&b;for(u=i;u<=h;u++)b=(b>>>8)+o[u]+p*a[u],o[u-1]=255&b;b=(b>>>8)+c,o[h]=255&b,c=b>>>8}for(l=t;l<=h;l++){for(b=o[0],b+=(p=b*n&255)*a[0],u=1;u<=h;u++)b=(b>>>8)+o[u]+p*a[u],o[u-1]=255&b;b=(b>>>8)+c,o[h]=255&b,c=b>>>8}if(0!==c||1!==wkb(a,o,s))for(l=b=0;l<=h;l++)b=b+o[l]-a[l],o[l]=255&b,b>>=8}(e.bytes,n,t.bytes,o,r.bytes,s,i,a.bytes),_kb(a)):nkb.primitiveFail()}function Tkb(e,t,r){var i,a,s,n,o,u,l,c;return o=(c=hkb(e))<=(l=hkb(t))?(n=e,s=c,i=t,l):(n=t,s=l,i=e,c),a=r?nkb.classLargeNegativeInteger():nkb.classLargePositiveInteger(),u=nkb.instantiateClassindexableSize(a,o+s),function(e,t,r,i,a){var s,n,o,u,l,c,h,f;if(!(1===t&&0===e[0]||1===i&&0===r[0]))for(f=t-1,c=i-1,l=0;l<=f;l++)if(0!==(o=e[l])){for(h=l,n=u=0;n<=c;n++)u=(s=(s=r[n])*o+u+a[h])>>>8,a[h]=255&s,++h;a[h]=u}}(n.bytes,s,i.bytes,o,u.bytes),Zkb(u)}function Ukb(e,t){return t>hkb(e)?0:Alb(e,t)}function Vkb(e,t){var r,i,a,s,n,o,u,l,c,h;if(u=gkb(e)===nkb.classLargeNegativeInteger(),(l=hkb(e))===(c=hkb(t))){for(;1>=8;for(s=t;s<=i-1;s++)n+=r[s],a[s]=255&n,n>>=8}(s.bytes,r,i.bytes,o,a.bytes),(h?$kb:_kb)(a)}function Wkb(){return okb}function Ykb(e){var t,r;if("number"==typeof e)return 1;if(0!==(r=Rkb(e))&&0!==Alb(e,r)){if(4Ekb(1073741823,4);if(!(Alb(e,4)(r=i)?(a=1,nkb.failed()||nkb.popthenPush(2,a),null):(a=e(t=i)?(a=1,nkb.failed()||nkb.popthenPush(3,a),null):(a=e=fkb}function Alb(e,t){return e.bytes[t-1]}function Wsb(e){return"number"==typeof e?Ysb.classSmallInteger():e.sqClass}function Xsb(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function ctb(){return btb}function dtb(e){return Ysb.failed()?null:Ysb.isWords(e)&&6===Xsb(e)?e.wordsAsFloat32Array():(Ysb.primitiveFail(),null)}function etb(e){var t,r;if(!Ysb.failed()){if(Wsb(e)!==Ysb.classPoint())return Ysb.primitiveFail();if(!(t="number"==typeof(r=Ysb.fetchPointerofObject(0,e)))&&!r.isFloat)return Ysb.primitiveFail();if(Zsb=t?r:Ysb.floatValueOf(r),!(t="number"==typeof(r=Ysb.fetchPointerofObject(1,e)))&&!r.isFloat)return Ysb.primitiveFail();$sb=t?r:Ysb.floatValueOf(r)}}function gtb(e){var t,r,i,a,s;if(a=Zsb-e[2],s=$sb-e[5],0===(t=e[0]*e[4]-e[1]*e[3]))return Ysb.primitiveFail();t=1/t,r=a*e[4]-e[1]*s,i=e[0]*s-a*e[3],_sb=r*t,atb=i*t}function htb(e){_sb=Zsb*e[0]+$sb*e[1]+e[2],atb=Zsb*e[3]+$sb*e[4]+e[5]}function itb(e){return-1073741824<=e&&_sb<=1073741823}function jtb(e){var t,r,i,a,s,n,o,u,l,c,h,f,d;if(i=dtb(a=Ysb.stackObjectValue(0)),r=dtb(Ysb.stackObjectValue(1)),t=dtb(Ysb.stackObjectValue(2)),Ysb.failed())return null;n=r,o=i,u=(s=t)[0]*n[0]+s[1]*n[3],l=s[0]*n[1]+s[1]*n[4],c=s[0]*n[2]+s[1]*n[5]+s[2],h=s[3]*n[0]+s[4]*n[3],f=s[3]*n[1]+s[4]*n[4],d=s[3]*n[2]+s[4]*n[5]+s[5],o[0]=u,o[1]=l,o[2]=c,o[3]=h,o[4]=f,o[5]=d,Ysb.popthenPush(e+1,a)}function ktb(e){var t;if(etb(Ysb.stackObjectValue(0)),t=dtb(Ysb.stackObjectValue(1)),Ysb.failed())return null;gtb(t),Ysb.failed()||qtb(e)}function ltb(e){var t,r,i,a,s,n,o,u,l,c,h;return i=Ysb.stackObjectValue(0),h=Ysb.stackObjectValue(1),a=dtb(Ysb.stackObjectValue(2)),Ysb.failed()?null:Wsb(h)!==Wsb(i)||!Ysb.isPointers(h)||2!==Xsb(h)?Ysb.primitiveFail():(etb(Ysb.fetchPointerofObject(0,h)),Ysb.failed()?null:(l=Zsb,c=$sb,gtb(a),o=s=_sb,u=n=atb,etb(Ysb.fetchPointerofObject(1,h)),Ysb.failed()?null:(t=Zsb,r=$sb,gtb(a),o=Math.min(o,_sb),s=Math.max(s,_sb),u=Math.min(u,atb),n=Math.max(n,atb),Zsb=t,$sb=c,gtb(a),o=Math.min(o,_sb),s=Math.max(s,_sb),u=Math.min(u,atb),n=Math.max(n,atb),Zsb=l,$sb=r,gtb(a),o=Math.min(o,_sb),s=Math.max(s,_sb),u=Math.min(u,atb),n=Math.max(n,atb),Ysb.failed()||(i=rtb(i,o,u,s,n)),void(Ysb.failed()||Ysb.popthenPush(e+1,i)))))}function mtb(e){var t;if(t=dtb(Ysb.stackObjectValue(0)),Ysb.failed())return null;Ysb.pop(1),Ysb.pushBool(1===t[0]&&0===t[1]&&0===t[2]&&0===t[3]&&1===t[4]&&0===t[5])}function ntb(e){var t;if(t=dtb(Ysb.stackObjectValue(0)),Ysb.failed())return null;Ysb.pop(1),Ysb.pushBool(1===t[0]&&0===t[1]&&0===t[3]&&1===t[4])}function otb(e){var t;if(etb(Ysb.stackObjectValue(0)),t=dtb(Ysb.stackObjectValue(1)),Ysb.failed())return null;htb(t),qtb(e)}function ptb(e){var t,r,i,a,s,n,o,u,l,c,h;return i=Ysb.stackObjectValue(0),h=Ysb.stackObjectValue(1),a=dtb(Ysb.stackObjectValue(2)),Ysb.failed()?null:Wsb(h)!==Wsb(i)||!Ysb.isPointers(h)||2!==Xsb(h)?Ysb.primitiveFail():(etb(Ysb.fetchPointerofObject(0,h)),Ysb.failed()?null:(l=Zsb,c=$sb,htb(a),o=s=_sb,u=n=atb,etb(Ysb.fetchPointerofObject(1,h)),Ysb.failed()?null:(t=Zsb,r=$sb,htb(a),o=Math.min(o,_sb),s=Math.max(s,_sb),u=Math.min(u,atb),n=Math.max(n,atb),Zsb=t,$sb=c,htb(a),o=Math.min(o,_sb),s=Math.max(s,_sb),u=Math.min(u,atb),n=Math.max(n,atb),Zsb=l,$sb=r,htb(a),o=Math.min(o,_sb),s=Math.max(s,_sb),i=rtb(i,o,u=Math.min(u,atb),s,n=Math.max(n,atb)),void(Ysb.failed()||Ysb.popthenPush(e+1,i)))))}function qtb(e){return atb+=.5,itb(_sb+=.5)&&itb(atb)?void Ysb.popthenPush(e+1,Ysb.makePointwithxValueyValue(0|_sb,0|atb)):Ysb.primitiveFail()}function rtb(e,t,r,i,a){var s,n,o,u,l,c,h;return itb(u=t+.5)&&itb(n=i+.5)&&itb(l=r+.5)&&itb(o=a+.5)?(Ysb.pushRemappableOop(e),c=Ysb.makePointwithxValueyValue(0|u,0|l),Ysb.pushRemappableOop(c),s=Ysb.makePointwithxValueyValue(0|n,0|o),c=Ysb.popRemappableOop(),h=Ysb.popRemappableOop(),Ysb.storePointerofObjectwithValue(0,h,c),Ysb.storePointerofObjectwithValue(1,h,s),h):Ysb.primitiveFail()}function stb(e){return!1!=((Ysb=e).majorVersion()==Usb)&&Ysb.minorVersion()>=Vsb}function Tub(e,t){return e-(r=e,i=t,(0|Math.floor(r/i))*t)|0;var r,i}function Xub(e,t,r){var i,a,s;for(i=0;i<=3;i++)t[r+i-1]=255&(a=e,31<(s=8*(3-i))?0:a>>>s);return r+4}function Yub(e,t,r){return e<=223?(t[r-1]=e,r+1):e<=7935?(t[r-1]=224+(e>>8),t[r]=Tub(e,256),r+2):(t[r-1]=255,Xub(e,t,r+1))}function Zub(){return Wub}function $ub(e){var t,r,i,a,s,n,o,u;if(Vub.stackValue(3),t=Vub.stackBytes(2),r=Vub.stackBytes(1),i=Vub.stackBytes(0),Vub.failed())return null;for(o=t.length,u=r.length,n=1;n<=Math.min(o,u);n++)if((a=i[t[n-1]])!==(s=i[r[n-1]]))return a>>8&255)==(o=255&c)&&(c>>>16&255)==o&&(c>>>24&255)==o,s=n;s>>2))return Vub.primitiveFail(),null;if(1==(s=3&a))for(n=r[u-1],++u,n|=n<<8,n|=n<<16,l=1;l<=f;l++)t[c-1]=n,++c;if(2==s){for(n=0,l=1;l<=4;l++)n=n<<8|r[u-1],++u;for(l=1;l<=f;l++)t[c-1]=n,++c}if(3==s)for(h=1;h<=f;h++){for(n=0,l=1;l<=4;l++)n=n<<8|r[u-1],++u;t[c-1]=n,++c}}if(Vub.failed())return null;Vub.pop(e)}function cvb(e){var t,r,i,a,s;if(Vub.stackValue(3),t=Vub.stackBytes(2),r=Vub.stackBytes(1),i=Vub.stackIntegerValue(0),Vub.failed())return null;if(256!==r.length)return Vub.failed()||Vub.popthenPush(e+1,0),null;for(a=i,s=t.length;a<=s&&0===r[t[a-1]];)++a;return s>>14)+101*s&16383)&268435455;return Vub.failed()||Vub.popthenPush(e+1,a),null}function gvb(e){var t,r,i,a,s;if(Vub.stackValue(4),t=Vub.stackBytes(3),r=Vub.stackIntegerValue(2),i=Vub.stackIntegerValue(1),a=Vub.stackBytes(0),Vub.failed())return null;for(s=r;s<=i;s++)t[s-1]=a[t[s-1]];if(Vub.failed())return null;Vub.pop(e)}function hvb(e){return!1!=((Vub=e).majorVersion()==Qub)&&Vub.minorVersion()>=Rub}function axb(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function bxb(e,t){return 0|Math.floor(e/t)}function cxb(e,t){return e-bxb(e,t)*t|0}function fxb(e,t,r,i,a){var s,n,o,u,l,c,h;n=bxb(r,60),u=(1e3-i)*a,l=(1e3-bxb(i*(s=cxb(r,60)),60))*a,c=(1e3-bxb(i*(60-s),60))*a,h=bxb(1e3*a,3922),u=bxb(u,3922),l=bxb(l,3922),c=bxb(c,3922),0===n&&(o=(h<<16)+(c<<8)+u),1===n&&(o=(l<<16)+(h<<8)+u),2===n&&(o=(u<<16)+(h<<8)+c),3===n&&(o=(u<<16)+(l<<8)+h),4===n&&(o=(c<<16)+(u<<8)+h),5===n&&(o=(h<<16)+(u<<8)+l),0===o&&(o=1),e[t]=o}function gxb(e){return dxb.success(dxb.isWordsOrBytes(e)),dxb.failed()?0:e.wordsAsFloat64Array()}function hxb(e){return dxb.success(dxb.isWords(e)),dxb.failed()?0:e.words}function ixb(){return exb}function jxb(e,t,r,i,a){var s,n;return 0==(n=a-i)?0:(s=e===a?bxb(60*(t-r),n):t===a?120+bxb(60*(r-e),n):240+bxb(60*(e-t),n))<0?s+360:s}function kxb(e,t,r){var i,a;return 0===e?t:0===t?e:(0===(a=((i=1024-r)*(e>>>16&255)+r*(t>>>16&255)>>10<<16)+(i*(e>>>8&255)+r*(t>>>8&255)>>10<<8)+(i*(255&e)+r*(255&t)>>10))&&(a=1),a)}function lxb(e,t,r,i,a){var s,n,o,u,l,c,h;return(u=t>>>10)<-1||i<=u||(c=r>>>10)<-1||a<=c?0:(l=1023&t,-1===u&&(l=u=0),u===i-1&&(l=0),h=1023&r,-1===c&&(h=c=0),c===a-1&&(h=0),o=16777215&e[n=c*i+u],0>>16&255,i+=h>>>8&255,e+=255&h,++o);c=0===o?0:(bxb(f,o)<<16)+(bxb(i,o)<<8)+bxb(e,o),u[m*p+b]=c}return dxb.pop(3),0}function nxb(){var e,t,r,i,a,s,n,o,u,l,c,h,f,d,p,b;if(n=dxb.stackValue(2),c=dxb.stackValue(1),p=dxb.stackIntegerValue(0),s=hxb(n),b=axb(n),l=hxb(c),dxb.success(axb(c)===b),dxb.failed())return null;for(a=0;a<=b-1;a++)0!=(h=16777215&s[a])&&((o=u=f=h>>>16&255)<(r=h>>>8&255)&&(o=r),o<(e=255&h)&&(o=e),r=n>>1),dxb.failed())return null;for(a=s.wordsAsInt16Array(),e=t.wordsAsInt16Array(),i&&o++,r=1;r<=n;r++)e[u++]=a[o],o+=2;return dxb.pop(3),0}function rxb(){var e,t,r,i,a,s,n,o,u,l,c,h,f,d,p,b,m,v,g,k;if(o=dxb.stackValue(3),l=dxb.stackValue(2),v=dxb.stackIntegerValue(1),h=dxb.stackIntegerValue(0),n=hxb(o),u=hxb(l),m=axb(o),dxb.success(axb(l)===m),dxb.failed())return null;for(s=bxb(m,v),t=v>>1,r=(s=bxb(m,v))>>1,d=h/100,g=0;g<=v-1;g++)for(k=0;k<=s-1;k++)i=(g-t)/t,a=(k-r)/r,b=(f=Math.pow(Math.sqrt(i*i+a*a),d))<=1?(e=Math.atan2(a,i),p=1024*(t+f*Math.cos(e)*t)|0,1024*(r+f*Math.sin(e)*r)|0):(p=1024*g,1024*k),c=lxb(n,p,b,v,s),u[k*v+g]=c;return dxb.pop(4),0}function sxb(){var e,t,r,i,a,s,n,o,u,l,c,h,f,d,p,b,m,v,g,k;if(o=hxb(dxb.stackValue(11)),l=dxb.stackIntegerValue(10),u=dxb.stackIntegerValue(9),c=hxb(dxb.stackValue(8)),f=dxb.stackIntegerValue(7),h=dxb.stackIntegerValue(6),m=dxb.stackIntegerValue(5),v=dxb.stackIntegerValue(4),a=dxb.stackIntegerValue(3),s=dxb.stackIntegerValue(2),i=dxb.stackIntegerValue(1),t=dxb.stackIntegerValue(0),dxb.success(0<=m&&0<=v),dxb.success(m+2*i<=l),dxb.success(v+2*t<=u),dxb.success(0<=a&&0<=s),dxb.success(a+i<=f),dxb.success(s+t<=h),dxb.failed())return null;for(k=0;k<=t-1;k++)for(b=l*(v+2*k)+m,r=f*(s+k)+a,g=0;g<=i-1;g++)p=16711680&(d=o[b]),n=65280&d,e=255&d,p+=16711680&(d=o[b+1]),n+=65280&d,e+=255&d,p+=16711680&(d=o[b+l]),n+=65280&d,e+=255&d,p+=16711680&(d=o[b+l+1]),n+=65280&d,e+=255&d,c[r]=p>>>2&16711680|n>>>2&65280|e>>>2,b+=2,++r;return dxb.pop(12),0}function txb(){var e,t,r,i,a,s,n,o,u,l,c,h,f,d,p,b,m,v,g,k,_;if(o=hxb(dxb.stackValue(11)),l=dxb.stackIntegerValue(10),u=dxb.stackIntegerValue(9),c=hxb(dxb.stackValue(8)),f=dxb.stackIntegerValue(7),h=dxb.stackIntegerValue(6),v=dxb.stackIntegerValue(5),g=dxb.stackIntegerValue(4),a=dxb.stackIntegerValue(3),s=dxb.stackIntegerValue(2),i=dxb.stackIntegerValue(1),t=dxb.stackIntegerValue(0),dxb.success(0<=v&&0<=g),dxb.success(v+2*i<=l),dxb.success(g+2*t<=u),dxb.success(0<=a&&0<=s),dxb.success(a+i<=f),dxb.success(s+t<=h),dxb.failed())return null;for(_=0;_<=t-1;_++)for(m=l*(g+2*_)+v,r=f*(s+_)+a,k=0;k<=i-1;k++)b=(16711680&(d=o[m]))+(16711680&(p=o[m+l+1]))>>>1&16711680,n=(65280&d)+(65280&p)>>>1&65280,e=(255&d)+(255&p)>>>1,c[r]=n|e|b,m+=2,++r;return dxb.pop(12),0}function uxb(){var e,t,r,i,a,s,n,o,u,l,c,h,f,d,p;if(s=dxb.stackValue(2),l=dxb.stackValue(1),d=dxb.stackIntegerValue(0),a=hxb(s),p=axb(s),u=hxb(l),dxb.success(axb(l)===p),dxb.failed())return null;for(i=0;i<=p-1;i++)0!=(c=16777215&a[i])&&((n=o=h=c>>>16&255)<(r=c>>>8&255)&&(n=r),n<(e=255&c)&&(n=e),r>>16&255)<(r=c>>>8&255)&&(n=r),n<(e=255&c)&&(n=e),r>>10)*i+(a>>>10)],p=a>>>10>>10>>10>>16&255)+_*(p>>>16&255)+S*(b>>>16&255)+y*(m>>>16&255))>>>20&255)<<16,l|=((v=k*(d>>>8&255)+_*(p>>>8&255)+S*(b>>>8&255)+y*(m>>>8&255))>>>20&255)<<8,0===(l|=(v=k*(255&d)+_*(255&p)+S*(255&b)+y*(255&m))>>>20&255)&&(l=1)),n[f*c+h]=l,a+=I;s+=O}return dxb.pop(6),0}function yxb(){var e,t,r,i,a,s,n,o,u,l,c,h,f,d,p,b,m,v,g,k,_,S,y,I,O,w,F,C,x,A,P,$,V,Y;if(g=dxb.stackValue(5),y=dxb.stackValue(4),$=dxb.stackIntegerValue(3),v=hxb(g),S=hxb(y),r=axb(g),F=dxb.stackIntegerValue(2),e=dxb.stackValue(1),i=dxb.stackValue(0),t=gxb(e),a=gxb(i),dxb.success(axb(y)===r),dxb.failed())return null;for(b=bxb(r,$),s=cxb(Math.random(),F)-1,C=0;C<=s/2-1;C++)for(V=cxb(Math.random(),$),Y=cxb(Math.random(),b),O=cxb(Math.random(),8),d=-4;d<=4;d++)for(p=-4;p<=4;p++)(o=d*d+p*p)<25&&0>1)<(r=(l=bxb(_,y))>>1)?(v=r/(b=t),1):(v=1,(b=r)=_wb}function SocketPlugin(){return{getModuleName:function(){return"SocketPlugin (http-only)"},interpreterProxy:null,primHandler:null,handleCounter:0,needProxy:new Set,status:0,lookupCache:{localhost:{address:[127,0,0,1],validUntil:Number.MAX_SAFE_INTEGER}},lastLookup:null,lookupSemaIdx:0,TCP_Socket_Type:0,Resolver_Uninitialized:0,Resolver_Ready:1,Resolver_Busy:2,Resolver_Error:3,Socket_InvalidSocket:-1,Socket_Unconnected:0,Socket_WaitingForConnection:1,Socket_Connected:2,Socket_OtherEndClosed:3,Socket_ThisEndClosed:4,setInterpreter:function(e){return this.interpreterProxy=e,this.primHandler=this.interpreterProxy.vm.primHandler,!0},_signalSemaphore:function(e){e<=0||this.primHandler.signalSemaphoreWithIndex(e)},_signalLookupSemaphore:function(){this._signalSemaphore(this.lookupSemaIdx)},_getAddressFromLookupCache:function(e,t){if(e){if(e.match(/^\d+\.\d+\.\d+\.\d+$/)){var r=e.split(".").map(function(e){return+e});if(r.every(function(e){return e<=255}))return new Uint8Array(r)}var i=this.lookupCache[e];if(i&&(t||i.validUntil>=Date.now()))return new Uint8Array(i.address)}return null},_addAddressFromResponseToLookupCache:function(e){if(e&&0===e.Status&&e.Question&&e.Answer){var t=function(e,t){e[t]&&e[t].replace&&(e[t]=e[t].replace(/\.$/,""))},r=e.Question[0];t(r,"name"),e.Answer.forEach(function(e){t(e,"name"),t(e,"data")});var i=r.name,a=null,s=86400;e.Answer.some(function(e){if(e.name===i){if(e.TTL&&(s=Math.min(s,e.TTL)),1===e.type)return a=e.data.split(".").map(function(e){return+e}),!0;5===e.type&&(i=e.data)}return!1})&&(this.lookupCache[r.name]={address:a,validUntil:Date.now()+1e3*s})}},_compareAddresses:function(e,r){return e.every(function(e,t){return r[t]===e})},_reverseLookupNameForAddress:function(t){var r=this,i=null;return Object.keys(this.lookupCache).some(function(e){return!!r._compareAddresses(t,r.lookupCache[e].address)&&(i=e,!0)}),i||t.join(".")},_newSocketHandle:function(e,t,r,i){var c=this;return{hostAddress:null,host:null,port:null,connSemaIndex:t,readSemaIndex:r,writeSemaIndex:i,webSocket:null,sendBuffer:null,sendTimeout:null,response:null,responseReadUntil:0,responseReceived:!1,status:c.Socket_Unconnected,_signalConnSemaphore:function(){c._signalSemaphore(this.connSemaIndex)},_signalReadSemaphore:function(){c._signalSemaphore(this.readSemaIndex)},_signalWriteSemaphore:function(){c._signalSemaphore(this.writeSemaIndex)},_otherEndClosed:function(){this.status=c.Socket_OtherEndClosed,this.webSocket=null,this._signalConnSemaphore()},_hostAndPort:function(){return this.host+":"+this.port},_requestNeedsProxy:function(){return c.needProxy.has(this._hostAndPort())},_getURL:function(e,t){var r="";(t||this._requestNeedsProxy())&&(r="object"==typeof SqueakJS&&SqueakJS.options.proxy||"https://corsproxy.io/?");return 443!==this.port?r+="http://"+this._hostAndPort()+e:r+="https://"+this.host+e,r},_performRequest:function(){if(this.webSocket)this._performWebSocketSend();else{var e=new TextDecoder("utf-8").decode(this.sendBuffer),t=this.sendBuffer.findIndex(function(e,t,r){return"\r"===r[t]&&"\r"===r[t+2]&&"\n"===r[t+1]&&"\n"===r[t+3]});this.sendBuffer=0<=t?this.sendBuffer.subarray(t+4):null;var r=e.split("\r\n\r\n")[0].split("\n"),i=r[0].split(" "),a=i[0];if("GET"!==a&&"PUT"!==a&&"POST"!==a)return this._otherEndClosed(),-1;for(var s=i[1],n=!1,o=!1,u=null,l=1;l>>8,n[3]=255&e.length,4):127===i?(n[2]=e.length>>>56,n[3]=e.length>>>48&255,n[4]=e.length>>>40&255,n[5]=e.length>>>32&255,n[6]=e.length>>>24&255,n[7]=e.length>>>16&255,n[8]=e.length>>>8&255,n[9]=255&e.length,10):2;var o=new Uint8Array(4);n.set(o,s),s+=4;var u=e;n.set(u,s),e=n}this.response&&this.response.length?this.response.push(e):this.response=[e],this.responseReceived=!0,this._signalReadSemaphore()},_performWebSocketSend:function(){var e,t=15&this.sendBuffer[0];if(0==t)return console.error("No support for WebSocket frame continuation yet!"),!0;if(1==t)e=!1;else{if(2!=t)return 8==t?(this.webSocket.close(),void(this.webSocket=null)):9==t||10==t?void 0:void console.error("Unsupported WebSocket frame opcode "+t);e=!0}var r,i,a=this.sendBuffer[1],s=a>>>7,n=127&a;r=126===n?(n=this.sendBuffer[2]<<8|this.sendBuffer[3],4):127===n?(n=this.sendBuffer[2]<<56|this.sendBuffer[3]<<48|this.sendBuffer[4]<<40|this.sendBuffer[5]<<32|this.sendBuffer[6]<<24|this.sendBuffer[7]<<16|this.sendBuffer[8]<<8|this.sendBuffer[9],10):2,s&&(i=this.sendBuffer.subarray(r,r+4),r+=4);var o,u=this.sendBuffer.subarray(r,r+n);r+=n,s&&(u=u.map(function(e,t){return e^i[3&t]})),o=e?u:Squeak.bytesAsString(u),this.sendBuffer=this.sendBuffer.subarray(r),this.webSocket.send(o),0e){var r=t.subarray(e);r?this.response[0]=r:this.response.shift(),t=t.subarray(0,e)}else this.response.shift();return this.responseReceived&&0===this.response.length&&!this.webSocket&&(this.responseSentCompletly=!0),t},send:function(e,t,r){null!==this.sendTimeout&&self.clearTimeout(this.sendTimeout),this.lastSend=Date.now();var i=e.bytes.subarray(t,r);if(null===this.sendBuffer)this.sendBuffer=i.slice();else{var a=this.sendBuffer.byteLength+i.byteLength,s=new Uint8Array(a);s.set(this.sendBuffer,0),s.set(i,this.sendBuffer.byteLength),this.sendBuffer=s}return this.sendTimeout=self.setTimeout(this._performRequest.bind(this),50),i.byteLength}}},primitiveHasSocketAccess:function(e){return this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.trueObject()),!0},primitiveInitializeNetwork:function(e){return 1===e&&(this.lookupSemaIdx=this.interpreterProxy.stackIntegerValue(0),this.status=this.Resolver_Ready,this.interpreterProxy.pop(e),!0)},primitiveResolverNameLookupResult:function(e){if(0!==e)return!1;if(!this.lastLookup||!this.lastLookup.substr)return this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),!0;var t=this._getAddressFromLookupCache(this.lastLookup,!0);return this.interpreterProxy.popthenPush(e+1,t?this.primHandler.makeStByteArray(t):this.interpreterProxy.nilObject()),!0},primitiveResolverStartNameLookup:function(e){if(1!==e)return!1;var t=this.lastLookup=this.interpreterProxy.stackValue(0).bytesAsString();if(this._getAddressFromLookupCache(t,!1))this.status=this.Resolver_Ready,this._signalLookupSemaphore();else{var r="https://9.9.9.9:5053/dns-query?name="+encodeURIComponent(this.lastLookup)+"&type=A",i=!1;if(self.fetch){var a=this;self.fetch(r,{method:"GET",mode:"cors",credentials:"omit",cache:"no-store",referrer:"no-referrer",referrerPolicy:"no-referrer"}).then(function(e){return e.json()}).then(function(e){a._addAddressFromResponseToLookupCache(e)}).catch(function(e){console.error("Name lookup failed",e)}).then(function(){t===a.lastLookup&&(a.status=a.Resolver_Ready,a._signalLookupSemaphore())}),i=!0}else{a=this;var s=function(){t===a.lastLookup&&(a.status=a.Resolver_Ready,a._signalLookupSemaphore())},n=new XMLHttpRequest;n.open("GET",r,!0),n.timeout=2e3,n.responseType="json",n.onload=function(e){a._addAddressFromResponseToLookupCache(this.response),s()},n.onerror=function(){console.error("Name lookup failed",n.statusText),s()},n.send(),i=!0}i&&(this.status=this.Resolver_Busy,this._signalLookupSemaphore())}return this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),!0},primitiveResolverAddressLookupResult:function(e){if(0!==e)return!1;if(!this.lastLookup||!this.lastLookup.every)return this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),!0;var t=this._reverseLookupNameForAddress(this.lastLookup),r=this.primHandler.makeStString(t);return this.interpreterProxy.popthenPush(e+1,r),!0},primitiveResolverStartAddressLookup:function(e){return 1===e&&(this.lastLookup=this.interpreterProxy.stackBytes(0),this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),this.status=this.Resolver_Ready,this._signalLookupSemaphore(),!0)},primitiveResolverStatus:function(e){return 0===e&&(this.interpreterProxy.popthenPush(e+1,this.status),!0)},primitiveResolverAbortLookup:function(e){return 0===e&&(this.lastLookup=null,this.status=this.Resolver_Ready,this._signalLookupSemaphore(),this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),!0)},primitiveSocketRemoteAddress:function(e){if(1!==e)return!1;var t=this.interpreterProxy.stackObjectValue(0).handle;return void 0!==t&&(this.interpreterProxy.popthenPush(e+1,t.hostAddress?this.primHandler.makeStByteArray(t.hostAddress):this.interpreterProxy.nilObject()),!0)},primitiveSocketRemotePort:function(e){if(1!==e)return!1;var t=this.interpreterProxy.stackObjectValue(0).handle;return void 0!==t&&(this.interpreterProxy.popthenPush(e+1,t.port),!0)},primitiveSocketConnectionStatus:function(e){if(1!==e)return!1;var t=this.interpreterProxy.stackObjectValue(0).handle;if(void 0===t)return!1;var r=t.status;return void 0===r&&(r=this.Socket_InvalidSocket),this.interpreterProxy.popthenPush(e+1,r),!0},primitiveSocketConnectToPort:function(e){if(3!==e)return!1;var t=this.interpreterProxy.stackObjectValue(2).handle;if(void 0===t)return!1;var r=this.interpreterProxy.stackBytes(1),i=this.interpreterProxy.stackIntegerValue(0);return t.connect(r,i),this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),!0},primitiveSocketCloseConnection:function(e){if(1!==e)return!1;var t=this.interpreterProxy.stackObjectValue(0).handle;return void 0!==t&&(t.close(),this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),!0)},primitiveSocketCreate3Semaphores:function(e){if(7!==e)return!1;var t=this.interpreterProxy.stackIntegerValue(0),r=this.interpreterProxy.stackIntegerValue(1),i=this.interpreterProxy.stackIntegerValue(2),a=this.interpreterProxy.stackIntegerValue(3);if(this.interpreterProxy.stackIntegerValue(5)!==this.TCP_Socket_Type)return!1;var s="{SqueakJS Socket #"+ ++this.handleCounter+"}",n=this.primHandler.makeStString(s);return n.handle=this._newSocketHandle(a,i,r,t),this.interpreterProxy.popthenPush(e+1,n),!0},primitiveSocketDestroy:function(e){if(1!==e)return!1;var t=this.interpreterProxy.stackObjectValue(0).handle;return void 0!==t&&(t.destroy(),this.interpreterProxy.popthenPush(e+1,t.status),!0)},primitiveSocketReceiveDataAvailable:function(e){if(1!==e)return!1;var t=this.interpreterProxy.stackObjectValue(0).handle;if(void 0===t)return!1;var r=this.interpreterProxy.falseObject();return t.dataAvailable()&&(r=this.interpreterProxy.trueObject()),this.interpreterProxy.popthenPush(e+1,r),!0},primitiveSocketReceiveDataBufCount:function(e){if(4!==e)return!1;var t=this.interpreterProxy.stackObjectValue(3).handle;if(void 0===t)return!1;var r=this.interpreterProxy.stackObjectValue(2),i=this.interpreterProxy.stackIntegerValue(1)-1,a=this.interpreterProxy.stackIntegerValue(0);if(i+a>r.bytes.length)return!1;var s=t.recv(a);return r.bytes.set(s,i),this.interpreterProxy.popthenPush(e+1,s.length),!0},primitiveSocketSendDataBufCount:function(e){if(4!==e)return!1;var t=this.interpreterProxy.stackObjectValue(3).handle;if(void 0===t)return!1;var r=this.interpreterProxy.stackObjectValue(2),i=this.interpreterProxy.stackIntegerValue(1)-1;if(i<0)return!1;var a=i+this.interpreterProxy.stackIntegerValue(0);if(a>r.length)return!1;var s=t.send(r,i,a);return this.interpreterProxy.popthenPush(e+1,s),!0},primitiveSocketSendDone:function(e){return 1===e&&(this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.trueObject()),!0)},primitiveSocketListenWithOrWithoutBacklog:function(e){return!(e<2)&&(this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),!0)}}}function registerSocketPlugin(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("SocketPlugin",SocketPlugin()):self.setTimeout(registerSocketPlugin,100)}function SpeechPlugin(){return{getModuleName:function(){return"SpeechPlugin"},interpreterProxy:null,primHandler:null,voiceInput:null,semaphoreIndex:null,shouldListen:!1,recognition:null,synth:self.speechSynthesis,setInterpreter:function(e){return this.interpreterProxy=e,this.primHandler=this.interpreterProxy.vm.primHandler,!0},primitiveSpeak:function(e){var t,r;if(1===e)t=this.interpreterProxy.stackValue(0).bytesAsString();else{if(2!==e)return!1;t=this.interpreterProxy.stackValue(1).bytesAsString();var i=this.interpreterProxy.stackValue(0).bytesAsString();r=this.synth.getVoices().filter(function(e){return e.name===i})}var a=new SpeechSynthesisUtterance(t);return r&&0>15))&&(u=32767),u<-32767&&(u=-32767),t[o-1]=u,p[f-1]=u,32767<(u=t[++o-1]+(s>>15))&&(u=32767),u<-32767&&(u=-32767),t[o-1]=u,b[f-1]=u,f=WHb(f,d)+1}if(_Hb.failed())return null;_Hb.storeIntegerofObjectwithValue(11,e,f),_Hb.pop(3)}function dIb(){var e,t,r,i,a,s,n,o,u,l,c,h,f,d,p,b,m,v,g,k,_,S,y,I;if(e=_Hb.stackValue(5),t=_Hb.stackIntegerValue(4),r=_Hb.stackInt16Array(3),i=_Hb.stackIntegerValue(2),a=_Hb.stackIntegerValue(1),s=_Hb.stackIntegerValue(0),k=_Hb.fetchIntegerofObject(3,e),_=_Hb.fetchIntegerofObject(4,e),S=_Hb.fetchIntegerofObject(5,e),d=_Hb.fetchIntegerofObject(7,e),I=_Hb.fetchInt16ArrayofObject(8,e),y=_Hb.fetchIntegerofObject(9,e),b=_Hb.fetchIntegerofObject(10,e),m=_Hb.fetchIntegerofObject(11,e),p=_Hb.fetchIntegerofObject(14,e),v=_Hb.fetchIntegerofObject(15,e),g=_Hb.fetchIntegerofObject(16,e),_Hb.failed())return null;for(n=0!==p&&0!==g,u=i+t-1,f=i;f<=u;f++)h=k*I[b>>15]>>15,n?(l=p*I[v>>15],(v=WHb(v+g,y))<0&&(v+=y),(b=WHb(b+m+l,y))<0&&(b+=y)):b=WHb(b+m,y),0>15))&&(c=32767),c<-32767&&(c=-32767),r[o-1]=c),0>15))&&(c=32767),c<-32767&&(c=-32767),r[o-1]=c),0!==_&&(k+=_,(0<_&&S<=k||_<0&&k<=S)&&(k=S,_=0));if(d-=t,_Hb.failed())return null;_Hb.storeIntegerofObjectwithValue(3,e,k),_Hb.storeIntegerofObjectwithValue(4,e,_),_Hb.storeIntegerofObjectwithValue(7,e,d),_Hb.storeIntegerofObjectwithValue(10,e,b),_Hb.storeIntegerofObjectwithValue(15,e,v),_Hb.pop(5)}function eIb(){var e,t,r,i,a,s,n,o,u,l,c,h,f,d,p,b,m,v,g,k,_,S,y,I,O,w,F,C,x,A;if(e=_Hb.stackValue(5),t=_Hb.stackIntegerValue(4),r=_Hb.stackInt16Array(3),i=_Hb.stackIntegerValue(2),a=_Hb.stackIntegerValue(1),s=_Hb.stackIntegerValue(0),C=_Hb.fetchIntegerofObject(3,e),x=_Hb.fetchIntegerofObject(4,e),A=_Hb.fetchIntegerofObject(5,e),g=_Hb.fetchIntegerofObject(7,e),y=_Hb.fetchIntegerofObject(8,e),_=_Hb.fetchInt16ArrayofObject(10,e),I=_Hb.fetchInt16ArrayofObject(11,e),k=_Hb.fetchIntegerofObject(16,e),S=_Hb.fetchIntegerofObject(17,e),F=_Hb.fetchIntegerofObject(18,e),O=_Hb.fetchIntegerofObject(19,e),w=_Hb.fetchIntegerofObject(20,e),_Hb.failed())return null;for(l=_!==I,n=a*C>>15,o=s*C>>15,u=2*i-1,c=i+t-1,v=i;v<=c;v++){if(S<(m=(O+=w)>>9)&&y>9),(d=m+1)>k){if(k>9)}f=O&XHb,p=h=_[m-1]*(YHb-f)+_[d-1]*f>>9,l&&(p=I[m-1]*(YHb-f)+I[d-1]*f>>9),0>15))&&(b=32767),b<-32767&&(b=-32767),r[u-1]=b),++u,0>15))&&(b=32767),b<-32767&&(b=-32767),r[u-1]=b),++u,0!==x&&(C+=x,(0>15,o=s*C>>15)}if(g-=t,_Hb.failed())return null;_Hb.storeIntegerofObjectwithValue(3,e,C),_Hb.storeIntegerofObjectwithValue(4,e,x),_Hb.storeIntegerofObjectwithValue(7,e,g),_Hb.storeIntegerofObjectwithValue(19,e,O),_Hb.pop(5)}function fIb(){var e,t,r,i,a,s,n,o,u,l,c,h,f,d,p,b,m,v,g,k,_,S;if(e=_Hb.stackValue(5),t=_Hb.stackIntegerValue(4),r=_Hb.stackInt16Array(3),i=_Hb.stackIntegerValue(2),a=_Hb.stackIntegerValue(1),s=_Hb.stackIntegerValue(0),k=_Hb.fetchIntegerofObject(3,e),_=_Hb.fetchIntegerofObject(4,e),S=_Hb.fetchIntegerofObject(5,e),p=_Hb.fetchIntegerofObject(7,e),b=_Hb.fetchInt16ArrayofObject(8,e),m=_Hb.fetchIntegerofObject(9,e),v=_Hb.fetchIntegerofObject(10,e),g=_Hb.fetchIntegerofObject(11,e),_Hb.failed())return null;for(u=i+t-1,f=h=m,d=i;d<=u;d++)g<=(h=f+v)&&(h=ZHb+(h-g)),n=b[(f>>15)-1]+b[(h>>15)-1]>>1,c=(b[(f>>15)-1]=n)*k>>15,f=h,0>15))&&(l=32767),l<-32767&&(l=-32767),r[o-1]=l),0>15))&&(l=32767),l<-32767&&(l=-32767),r[o-1]=l),0!==_&&(k+=_,(0<_&&S<=k||_<0&&k<=S)&&(k=S,_=0));if(m=h,p-=t,_Hb.failed())return null;_Hb.storeIntegerofObjectwithValue(3,e,k),_Hb.storeIntegerofObjectwithValue(4,e,_),_Hb.storeIntegerofObjectwithValue(7,e,p),_Hb.storeIntegerofObjectwithValue(9,e,m),_Hb.pop(5)}function gIb(){var e,t,r,i,a,s,n,o,u,l,c,h,f,d,p,b,m,v,g,k,_,S;if(e=_Hb.stackValue(5),t=_Hb.stackIntegerValue(4),r=_Hb.stackInt16Array(3),i=_Hb.stackIntegerValue(2),a=_Hb.stackIntegerValue(1),s=_Hb.stackIntegerValue(0),k=_Hb.fetchIntegerofObject(3,e),_=_Hb.fetchIntegerofObject(4,e),S=_Hb.fetchIntegerofObject(5,e),d=_Hb.fetchIntegerofObject(7,e),b=_Hb.fetchInt16ArrayofObject(8,e),m=_Hb.fetchIntegerofObject(10,e),g=_Hb.fetchIntegerofObject(11,e),p=_Hb.fetchIntegerofObject(12,e),v=_Hb.fetchIntegerofObject(13,e),_Hb.failed())return null;for(o=i+t-1,u=i,f=p+(g>>>16);f<=m&&u<=o;)h=b[f-1]*k>>15,0>15))&&(c=32767),c<-32767&&(c=-32767),r[n-1]=c),0>15))&&(c=32767),c<-32767&&(c=-32767),r[n-1]=c),0!==_&&(k+=_,(0<_&&S<=k||_<0&&k<=S)&&(k=S,_=0)),$Hb<=(g+=v)&&(p+=l=g>>>16,g-=l<<16),f=p+(g>>>16),++u;if(d-=t,_Hb.failed())return null;_Hb.storeIntegerofObjectwithValue(3,e,k),_Hb.storeIntegerofObjectwithValue(4,e,_),_Hb.storeIntegerofObjectwithValue(7,e,d),_Hb.storeIntegerofObjectwithValue(11,e,g),_Hb.storeIntegerofObjectwithValue(12,e,p),_Hb.pop(5)}function hIb(e){return!1!=((_Hb=e).majorVersion()==THb)&&_Hb.minorVersion()>=UHb}function BKb(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function CKb(e,t){return 0|Math.floor(e/t)}function GKb(e){return EKb.success(EKb.isWords(e)),EKb.failed()?0:e.words}function HKb(){return FKb}function IKb(){var e,t,r,i,a,s,n,o,u,l,c,h,f,d,p,b,m,v;if(l=EKb.stackValue(4),i=EKb.stackValue(3),d=EKb.stackIntegerValue(2),n=EKb.stackIntegerValue(1),t=EKb.stackIntegerValue(0),u=GKb(l),r=GKb(i),EKb.success(BKb(l)===BKb(i)),EKb.success(BKb(l)===d*n),EKb.failed())return null;for(e=(2*t+1)*(2*t+1),m=0;m<=n-1;m++)for((h=m-t)<0&&(h=0),n<=(s=m+t)&&(s=n-1),p=0;p<=d-1;p++){for((c=p-t)<0&&(c=0),d<=(a=p+t)&&(a=d-1),f=0,v=h;v<=s;v++)for(o=v*d,b=c;b<=a;b++)f+=u[o+b];r[m*d+p]=CKb(f,e)}EKb.pop(5)}function JKb(){var e,t,r,i,a;if(r=EKb.stackValue(1),i=EKb.stackIntegerValue(0),t=GKb(r),a=BKb(r),EKb.failed())return null;for(e=0;e<=a-1;e++)t[e]=t[e]*i>>>10;EKb.pop(2)}function KKb(){var e,t,r,i,a,s,n,o,u,l,c,h,f,d,p,b,m,v,g,k;if(p=EKb.stackValue(6),r=EKb.stackValue(5),b=EKb.stackIntegerValue(4),i=EKb.stackIntegerValue(3),n=EKb.stackIntegerValue(2),u=EKb.stackIntegerValue(1),h=EKb.stackIntegerValue(0),f=GKb(p),e=GKb(r),EKb.success(BKb(r)===b*i),EKb.success(BKb(r)===BKb(p)*n*n),EKb.failed())return null;for((l=0)<(4&u)&&(l+=65536),0<(2&u)&&(l+=256),0<(1&u)&&++l,d=-1,v=0;v<=CKb(i,n)-1;v++)for(m=0;m<=CKb(b,n)-1;m++)for(g=f[++d],255<(a=(k=h)<0?k<-31?0:g>>>0-k:31=AKb}function LLb(e){return"number"==typeof e?bMb.classSmallInteger():e.sqClass}function MLb(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function NLb(e){return e.bytes?e.bytes.length:e.words?4*e.words.length:0}function PLb(e,t){return e-(r=e,i=t,(0|Math.floor(r/i))*t)|0;var r,i}function QLb(e,t){return 31>>7)],qMb[r]++,++DMb,++zMb===BMb||0==(4095&zMb)&&dNb()}function RMb(e,t,r,i,a){var s,n,o,u,l,c,h;if(h=t<<16|r,XLb<=t)return h;if(!(0<(o=e-(c=uMb[fNb(e+YLb-1)]))&&o>2t))return bMb.primitiveFail();for(hMb|=QLb(t,iMb),iMb+=e;8<=iMb&&FMb>>=8,iMb-=8}function XMb(){var e,t,r,i,a;return 3!==bMb.methodArgumentCount()?bMb.primitiveFail():(t=bMb.stackIntegerValue(0),e=bMb.stackIntegerValue(1),r=bMb.stackIntegerValue(2),i=bMb.stackObjectValue(3),bMb.failed()?null:function(e){var t;if(bMb.isPointers(e)&&15<=MLb(e)&&(t=bMb.fetchPointerofObject(0,e),bMb.isBytes(t))){if(0===eMb){if(!OMb(e))return;if(MLb(e)=BMb&&(rMb=t.words,t=bMb.fetchPointerofObject(eMb+7,e),bMb.isWords(t)&&MLb(t)===WLb&&(AMb=t.words,t=bMb.fetchPointerofObject(eMb+8,e),bMb.isWords(t)&&MLb(t)===VLb))))))return qMb=t.words,zMb=bMb.fetchIntegerofObject(eMb+9,e),DMb=bMb.fetchIntegerofObject(eMb+10,e),!bMb.failed()}}(i)?(a=function(e,t,r){var i,a,s,n,o,u,l,c,h;if(e>>16),h=65535&(l=RMb(s+1,n,o,t,r)),(c=l>>>16)<=n&&YLb<=n){for(i=QMb(n,s-o),u=1;u<=n-1;u++)TMb(++s);a=!1,++s}else i=PMb(kMb[s]),++s<=e&&!i&&(TMb(s),a=!0,o=h,n=c);if(i)return jMb=s,!0}return jMb=s,!1}(r,e,t),bMb.failed()||(bMb.storeIntegerofObjectwithValue(eMb+2,i,wMb),bMb.storeIntegerofObjectwithValue(eMb+3,i,jMb),bMb.storeIntegerofObjectwithValue(eMb+9,i,zMb),bMb.storeIntegerofObjectwithValue(eMb+10,i,DMb)),void(bMb.failed()||(bMb.pop(4),bMb.pushBool(a)))):bMb.primitiveFail())}function YMb(){var e,t,r,i,a,s;if(2!==bMb.methodArgumentCount())return bMb.primitiveFail();if(e=bMb.stackIntegerValue(0),i=bMb.stackObjectValue(1),bMb.failed())return null;if(!bMb.isWords(i))return bMb.primitiveFail();for(s=MLb(i),a=i.wordsAsInt32Array(),r=0;r<=s-1;r++)t=a[r],a[r]=e<=t?t-e:0;bMb.pop(2)}function ZMb(){var e,t;if(2!==bMb.methodArgumentCount())return bMb.primitiveFail();if(e=bMb.stackValue(0),!bMb.isWords(e))return bMb.primitiveFail();if(nMb=e.words,oMb=MLb(e),e=bMb.stackValue(1),!bMb.isWords(e))return bMb.primitiveFail();if(xMb=e.words,yMb=MLb(e),t=bMb.stackValue(2),!bMb.isPointers(t))return bMb.primitiveFail();if(0===dMb){if(!function(e){var t;for(t=LLb(e);!t.isNil&&13<=t.classInstSize();)t=t.superclass();return!t.isNil&&(dMb=t.classInstSize(),1)}(t))return bMb.primitiveFail();if(MLb(t)>>16)-1)&&(a+=iNb(r)),c=gNb(nMb,oMb),e=65535&c,0<(r=c>>>16)&&(e+=iNb(r)),s<=GMb+a)return hMb=o,iMb=n,JMb=u;for(l=(t=GMb)-e,i=1;i<=a;i++)kMb[t+i]=kMb[l+i];GMb+=a}}(),void(bMb.failed()||(bMb.storeIntegerofObjectwithValue(2,t,GMb+1),bMb.storeIntegerofObjectwithValue(dMb+0,t,KMb),bMb.storeIntegerofObjectwithValue(dMb+1,t,hMb),bMb.storeIntegerofObjectwithValue(dMb+2,t,iMb),bMb.storeIntegerofObjectwithValue(dMb+4,t,JMb+1),bMb.pop(2)))):bMb.primitiveFail()):bMb.primitiveFail()))}function $Mb(){var e,t,r,i,a,s,n,o;if(4!==bMb.methodArgumentCount())return bMb.primitiveFail();if(r=bMb.stackObjectValue(0),o=bMb.stackIntegerValue(1),n=bMb.stackIntegerValue(2),e=bMb.positive32BitValueOf(bMb.stackValue(3)),bMb.failed())return 0;if(!(bMb.isBytes(r)&&n<=o&&0>>16&65535,i=--n;i<=o;i++)a=PLb(a+t[i],65521),s=PLb(s+a,65521);e=(s<<16)+a,bMb.popthenPush(5,bMb.positive32BitIntegerFor(e))}function _Mb(){var e,t,r,i,a,s;if(4!==bMb.methodArgumentCount())return bMb.primitiveFail();if(t=bMb.stackObjectValue(0),s=bMb.stackIntegerValue(1),a=bMb.stackIntegerValue(2),r=bMb.positive32BitValueOf(bMb.stackValue(3)),bMb.failed())return 0;if(!(bMb.isBytes(t)&&a<=s&&0>>8;bMb.popthenPush(5,bMb.positive32BitIntegerFor(r))}function aNb(){var e,t,r,i,a,s;return 4!==bMb.methodArgumentCount()?bMb.primitiveFail():(t=bMb.stackObjectValue(0),i=bMb.stackObjectValue(1),e=bMb.stackObjectValue(2),r=bMb.stackObjectValue(3),a=bMb.stackObjectValue(4),bMb.failed()?null:function(e){var t;if(0===eMb){if(!OMb(e))return;if(MLb(e)=eMb+3&&(t=bMb.fetchPointerofObject(0,e),bMb.isBytes(t)?(kMb=t.bytes,lMb=NLb(t),FMb=bMb.fetchIntegerofObject(1,e),GMb=bMb.fetchIntegerofObject(2,e),hMb=bMb.fetchIntegerofObject(eMb+0,e),iMb=bMb.fetchIntegerofObject(eMb+1,e),!bMb.failed()):bMb.primitiveFail())}(a)&&bMb.isPointers(t)&&2<=MLb(t)&&bMb.isPointers(i)&&2<=MLb(i)&&bMb.isPointers(r)&&3<=MLb(r)&&bMb.isPointers(e)&&3<=MLb(e)?(s=function(e,t,r,i){var a,s,n,o,u,l,c,h,f,d,p,b,m,v,g,k;if(g=bMb.fetchPointerofObject(0,e),b=bMb.fetchIntegerofObject(1,e),p=bMb.fetchIntegerofObject(2,e),!(b<=p&&bMb.isBytes(g)&&p<=NLb(g)))return bMb.primitiveFail();if(f=g.bytes,g=bMb.fetchPointerofObject(0,t),!(bMb.isWords(g)&&p<=MLb(g)&&bMb.fetchIntegerofObject(1,t)===b&&bMb.fetchIntegerofObject(2,t)===p))return bMb.primitiveFail();if(n=g.words,g=bMb.fetchPointerofObject(0,r),!bMb.isWords(g))return bMb.primitiveFail();if(d=MLb(g),m=g.words,g=bMb.fetchPointerofObject(1,r),!bMb.isWords(g)||d!==MLb(g))return bMb.primitiveFail();if(v=g.words,g=bMb.fetchPointerofObject(0,i),!bMb.isWords(g))return bMb.primitiveFail();if(u=MLb(g),o=g.words,g=bMb.fetchPointerofObject(1,i),!bMb.isWords(g)||u!==MLb(g))return bMb.primitiveFail();l=g.words,WMb(0,0),k=0;for(;b>>7)])=KLb}function dNb(){var e;return zMb===BMb||0==(4095&zMb)&&(!(10*DMb<=zMb)&&(!((e=zMb-DMb)<=DMb)&&4*e<=DMb))}function fNb(e){return t=kMb[e],(wMb<<5^t)&SLb;var t}function gNb(e,t){var r,i,a,s;if(r=e[0]>>>24,_Lb>>24&255))return bMb.primitiveFail(),0}return 0}function iNb(e){for(var t,r,i,a;iMb>>a,iMb-=e,t}Object.extend||(Object.extend=function(e){for(var t=1;t>0)+t:[e,t]}}),Object.subclass("Squeak.Object","initialization",{initInstanceOf:function(e,t,r,i){this.sqClass=e,this.hash=r;var a=e.pointers[Squeak.Class_format],s=(a>>1&63)+(a>>10&192)-1;this._format=a>>7&15,this._format<8?6!=this._format?0>10&255;l=this.decodeWords(1+c,o,a);this.pointers=this.decodePointers(1+c,l,e),this.bytes=this.decodeBytes(u-(1+c),o,1+c,3&this._format)}else 8<=this._format?0>1:r[s]||42424242}return i},decodeWords:function(e,t,r){for(var i=new DataView(t.buffer,t.byteOffset),a=new Uint32Array(e),s=0;s>4]),r.push(t[15&this.bytes[a]]),i=256*i+this.bytes[a];var s=e?"-":"",n=9007199254740991");case"LargePositiveInteger":return this.bytesAsNumberString(!1);case"LargeNegativeInteger":return this.bytesAsNumberString(!0);case"Character":var r=this.pointers?this.pointers[0]:this.hash;return"$"+String.fromCharCode(r)+" ("+r.toString()+")";case"CompiledMethod":return this.methodAsString();case"CompiledBlock":return"[] in "+this.blockOuterCode().sqInstName()}return/^[aeiou]/i.test(t)?"an"+t:"a"+t}},"accessing",{pointersSize:function(){return this.pointers?this.pointers.length:0},bytesSize:function(){return this.bytes?this.bytes.length:0},wordsSize:function(){return this.isFloat?2:this.words?this.words.length:0},instSize:function(){var e=this._format;return 4>>2):null},setAddr:function(e){var t=this.snapshotSize();return this.oop=e+4*t.header,e+4*(t.header+t.body)},snapshotSize:function(){var e=this.isFloat?2:this.words?this.words.length:this.pointers?this.pointers.length:0;return this.bytes&&(e+=this.bytes.length+3>>>2),{header:63<++e?2:this.sqClass.isCompact?0:1,body:e}},addr:function(){return this.oop-4*this.snapshotSize().header},totalBytes:function(){var e=this.snapshotSize();return 4*(e.header+e.body)},writeTo:function(e,t,r){this.bytes&&(this._format|=3&-this.bytes.length);var i=t,a=this.snapshotSize(),s=(15&this._format)<<8|(4095&this.hash)<<17;switch(a.header){case 2:e.setUint32(t,a.body<<2|Squeak.HeaderTypeSizeAndClass),t+=4,e.setUint32(t,this.sqClass.oop|Squeak.HeaderTypeSizeAndClass),t+=4,e.setUint32(t,s|Squeak.HeaderTypeSizeAndClass),t+=4;break;case 1:e.setUint32(t,this.sqClass.oop|Squeak.HeaderTypeClass),t+=4,e.setUint32(t,s|a.body<<2|Squeak.HeaderTypeClass),t+=4;break;case 0:var n=r.compactClasses.indexOf(this.sqClass)+1;e.setUint32(t,s|n<<12|a.body<<2|Squeak.HeaderTypeShort),t+=4}if(this.isFloat)e.setFloat64(t,this.float),t+=8;else if(this.words)for(var o=0;o>7&15},classInstSize:function(){var e=this.pointers[Squeak.Class_format];return(e>>10&192)+(e>>1&63)-1},classInstIsBytes:function(){var e=this.classInstFormat();return 8<=e&&e<=11},classInstIsPointers:function(){return this.classInstFormat()<=4},instVarNames:function(){for(var e=3;e<=4;e++){var t=this.pointers[e].pointers;if(t&&t.length&&t[0].bytes)return t.map(function(e){return e.bytesAsString()})}return[]},allInstVarNames:function(){var e=this.superclass();return e.isNil?this.instVarNames():e.allInstVarNames().concat(this.instVarNames())},superclass:function(){return this.pointers[0]},className:function(){if(!this.pointers)return"_NOTACLASS_";for(var e=6;e<=7;e++){if((i=this.pointers[e])&&i.bytes)return i.bytesAsString()}for(var t=5;t<=6;t++){var r=this.pointers[t];if(r&&r.pointers)for(e=6;e<=7;e++){var i;if((i=r.pointers[e])&&i.bytes)return i.bytesAsString()+" class"}}return"_SOMECLASS_"},defaultInst:function(){return Squeak.Object},classInstProto:function(e){if(this.instProto)return this.instProto;var t=this.defaultInst();try{var r=(e=e||this.className()).replace(/[^A-Za-z0-9]/g,"_");r="UndefinedObject"===r?"nil":"True"===r?"true_":"False"===r?"false_":(/^[AEIOU]/.test(r)?"an":"a")+r,(t=new Function("return function "+r+"() {};")()).prototype=this.defaultInst().prototype}catch(e){}return Object.defineProperty(this,"instProto",{value:t}),t}},"as method",{methodSignFlag:function(){return!1},methodNumLits:function(){return this.pointers[0]>>9&255},methodNumArgs:function(){return this.pointers[0]>>24&15},methodPrimitiveIndex:function(){var e=805306879&this.pointers[0];return 511>19):e},methodClassForSuper:function(){return this.pointers[this.methodNumLits()].pointers[Squeak.Assn_value]},methodNeedsLargeFrame:function(){return 0<(131072&this.pointers[0])},methodAddPointers:function(e){this.pointers=e},methodTempCount:function(){return this.pointers[0]>>18&63},methodGetLiteral:function(e){return this.pointers[1+e]},methodGetSelector:function(e){return this.pointers[1+e]},methodAsString:function(){return"aCompiledMethod"}},"as context",{contextHome:function(){return this.contextIsBlock()?this.pointers[Squeak.BlockContext_home]:this},contextIsBlock:function(){return"number"==typeof this.pointers[Squeak.BlockContext_argumentCount]},contextMethod:function(){return this.contextHome().pointers[Squeak.Context_method]},contextSender:function(){return this.pointers[Squeak.Context_sender]},contextSizeWithStack:function(e){if(e&&e.activeContext===this)return e.sp+1;var t=this.pointers[Squeak.Context_stackPointer];return Squeak.Context_tempFrameStart+("number"==typeof t?t:0)}}),Squeak.Object.subclass("Squeak.ObjectSpur","initialization",{initInstanceOf:function(e,t,r,i){this.sqClass=e,this.hash=r;var a=e.pointers[Squeak.Class_format],s=65535&a,n=a>>16&31;(this._format=n)<12?n<10?0>(n?3:1),f=32767&h,d=(c=n?this.decodeWords64(1+f,u,a):this.decodeWords(1+f,u,a),n?2*(1+f):1+f);this.pointers=this.decodePointers(1+f,c,e,s,n),this.bytes=this.decodeBytes(l-d,u,d,3&this._format),n&&(this.pointers[0]=2147483648&u[1]|h);break;default:throw Error("Unknown object format: "+this._format)}this.mark=!1},decodeWords64:function(e,t,r){for(var i=new Array(e),a=0;a>1:a.makeLargeFromSmall((o-(o>>>0))/4294967296>>>0,o>>>0):o>>1;else if(2==(3&o)){if(o<0||8589934591>>(a?3:2))}else a&&4==(7&o)?s[n]=this.decodeSmallFloat((o-(o>>>0))/4294967296>>>0,o>>>0,a):(s[n]=r[o]||42424242,s[n])}return s},decodeSmallFloat:function(e,t,r){var i=0,a=0,s=(8&t)<<28;return 0==(e|4294967280&t)?i=s:(i=939524096+(e>>>4)|s,a=t>>>4|(15&e)<<28),r.makeFloat(new Uint32Array([a,i]))},overhead64:function(e){var t=0,r=0,i=0;if(this._format<=5)t=-2&e.length;else if(24<=this._format){var a=1==(1&(t=1+(e[0]>>3&32767))),s=28<=this._format;a&&(t+=s?1:-1),i=e.length/2,r=e.length-t}else i=(r=e.length)/2;return{bytes:4*t,sizeHeader:255<=r&&i<255}},initInstanceOfChar:function(e,t){this.oop=t<<2|2,this.sqClass=e,this.hash=t,this._format=7,this.mark=!0},initInstanceOfFloat:function(e,t){this.sqClass=e,this.hash=0,this._format=10,this.isFloat=!0,this.float=this.decodeFloat(t,!0,!0)},initInstanceOfLargeInt:function(e,t){this.sqClass=e,this.hash=0,this._format=16,this.bytes=new Uint8Array(t)},classNameFromImage:function(e,t){var r=e[t[this.oop][Squeak.Class_name]];if(r&&16<=r._format&&r._format<24){var i=t[r.oop],a=r.decodeBytes(i.length,i,0,7&r._format);return Squeak.bytesAsString(a)}return"Class"},renameFromImage:function(e,t,r){var i=r[this.sqClass];if(!i)return this;var a=i.instProto||i.classInstProto(i.classNameFromImage(e,t));if(!a)return this;var s=new a;return s.oop=this.oop,s.sqClass=this.sqClass,s._format=this._format,s.hash=this.hash,s}},"accessing",{instSize:function(){return this._format<2?this.pointersSize():this.sqClass.classInstSize()},indexableSize:function(e){var t=this._format;return t<2?-1:3===t&&e.vm.isContext(this)?this.pointers[Squeak.Context_stackPointer]:t<6?this.pointersSize()-this.instSize():t<12?this.wordsSize():t<16?this.shortsSize():t<24?this.bytesSize():4*this.pointersSize()+this.bytesSize()},snapshotSize:function(){var e=this.isFloat?2:this.words?this.words.length:this.pointers?this.pointers.length:0;this.bytes&&(e+=this.bytes.length+3>>>2);var t=255<=e?2:0;return e+=1&e,(e+=2)<4&&(e=4),{header:t,body:e}},writeTo:function(e,t,r,i){var a=this.isFloat?2:this.words?this.words.length:this.pointers?this.pointers.length:0;this.bytes&&(a+=this.bytes.length+3>>>2,this._format|=3&-this.bytes.length);var s=t,n=this._format<<24|4194303&this.sqClass.hash,o=a<<24|4194303&this.hash;if(255<=a&&(e.setUint32(t,a,r),t+=4,o=255<<24|4194303&this.hash,e.setUint32(t,o,r),t+=4),e.setUint32(t,n,r),t+=4,e.setUint32(t,o,r),t+=4,this.isFloat)e.setFloat64(t,this.float,r),t+=8;else if(this.words)for(var u=0;u>16&31},classInstSize:function(){return 65535&this.pointers[Squeak.Class_format]},classInstIsBytes:function(){var e=this.classInstFormat();return 16<=e&&e<=23},classInstIsPointers:function(){return this.classInstFormat()<=6},classByteSizeOfInstance:function(e){var t=this.classInstFormat(),r=this.classInstSize();return r+=t<9?e:16<=t?(e+3)/4|0:12<=t?(e+1)/2|0:10<=t?e:2*e,r+=1&r,(r+=255<=r?4:2)<4&&(r=4),4*r}},"as compiled block",{blockOuterCode:function(){return this.pointers[this.pointers.length-1]}},"as method",{methodSignFlag:function(){return this.pointers[0]<0},methodNumLits:function(){return 32767&this.pointers[0]},methodPrimitiveIndex:function(){return 0==(65536&this.pointers[0])?0:this.bytes[1]+256*this.bytes[2]},methodAsString:function(){var e=this.pointers[this.pointers.length-1].pointers[Squeak.ClassBinding_value],t=this.pointers[this.pointers.length-2];return t.pointers&&(t=t.pointers[Squeak.AdditionalMethodState_selector]),e.className()+">>"+t.bytesAsString()}}),Object.subclass("Squeak.Image","about",{about:function(){}},"initializing",{initialize:function(e){this.headRoom=1e8,this.totalMemory=0,this.name=e,this.gcCount=0,this.gcMilliseconds=0,this.pgcCount=0,this.pgcMilliseconds=0,this.gcTenured=0,this.allocationCount=0,this.oldSpaceCount=0,this.youngSpaceCount=0,this.newSpaceCount=0,this.hasNewInstances={}},readFromBuffer:function(a,t,r){console.log("squeak: reading "+this.name+" ("+a.byteLength+" bytes)"),this.startupTime=Date.now();for(var i=new DataView(a),s=!1,n=0,e=function(){var e=i.getUint32(n,s);return n+=4,e},o=e,u=4,l=function(e,t){if(t){for(var r=[];r.length>>24;255===Y&&(Y=$,$=e(),V=e());D=F+n-8-O;var M=4194303&$;U=4194303&V,z=l(Y,(R=$>>>24&31)<10&&0>>2,L=o(),T=o();break;case Squeak.HeaderTypeClass:L=T-Squeak.HeaderTypeClass,E=(T=o())>>>2&63;break;case Squeak.HeaderTypeShort:E=T>>>2&63,L=T>>>12&31;break;case Squeak.HeaderTypeFree:throw Error("Unexpected free block")}var R,Q,D=n-4-O,U=T>>>17&4095,z=l(--E,(R=T>>>8&15)<5);(Q=new Squeak.Object).initFromImage(D,L,R,U),L<32&&(Q.hash|=268435456),_&&(_.nextObject=Q),this.oldSpaceCount++,_=Q,y[v+D]=Q,I[D]=z}this.firstOldObject=y[v+4],this.lastOldObject=Q,this.lastOldObject.nextObject=null,this.oldSpaceBytes=m}this.totalMemory=this.oldSpaceBytes+this.headRoom,this.totalMemory=1e6*Math.ceil(this.totalMemory/1e6);var X=y[g],G=this.isSpur?this.spurClassTable(y,I,C,X):I[y[I[X.oop][Squeak.splOb_CompactClasses]].oop],H=null;for(Q=this.firstOldObject,_=null;Q;)_=H,H=Q.renameFromImage(y,I,G),_?_.nextObject=H:this.firstOldObject=H,y[v+Q.oop]=H,Q=Q.nextObject;this.lastOldObject=H,this.lastOldObject.nextObject=null;var Z=y[g],K=I[y[I[Z.oop][Squeak.splOb_CompactClasses]].oop],J=y[I[Z.oop][Squeak.splOb_ClassFloat]];this.isSpur&&(this.initImmediateClasses(y,I,Z),K=this.spurClassTable(y,I,C,Z),d=this.getCharacter.bind(this),this.initSpurOverrides());var ee=this.firstOldObject,te=0,re=function(){if(ee){for(var e=te+(this.oldSpaceCount/20|0);ee&&te=s.length)return 0;t=2147483652+4*n,s[n++]=e}else{if(a+e.totalBytes()>i.byteLength)return 0;t=a+4*(e.snapshotSize().header+1),a=e.writeTo(i,a,this),l.push(e)}u[e.oop]=t}return t}function h(){for(var e=this.firstOldObject;e;)e.mark=!1,e=e.nextObject;return this.weakObjects=null,!1}for(c=c.bind(this),h=h.bind(this),c(r);0>>2,p=a(),b=a();break;case Squeak.HeaderTypeClass:p=b-Squeak.HeaderTypeClass,d=(b=a())>>>2&63;break;case Squeak.HeaderTypeShort:d=b>>>2&63,p=b>>>12&31;break;case Squeak.HeaderTypeFree:throw Error("Unexpected free block")}var m=n,v=b>>>8&15,g=b>>>17&4095,k=r(--d,v),_=new Squeak.Object;_.initFromImage(m+c,p,v,g),u.nextObject=_,this.oldSpaceCount++,u=_,h[m]=_,f[m+c]=k}_.nextObject=l;for(var S=0;S>>3;var r=(e>>=3)<0;r&&(e=-e,0!==(t=-t)&&e--);var i=0===e?4:e<=255?5:e<=65535?6:e<=16777215?7:8,a=r?this.largeNegIntClass:this.largePosIntClass,s=new a.instProto;this.registerObjectSpur(s),this.hasNewInstances[a.oop]=!0,s.initInstanceOfLargeInt(a,i);for(var n=s.bytes,o=0;o<4;o++)n[o]=255&t,t>>=8;for(o=4;o>=8;return s},ensureClassesInTable:function(){for(var e=this.firstOldObject,t=1024;e;){var r=e.sqClass;if(0===r.hash&&this.enterIntoClassTable(r),r.hash>t&&(t=r.hash),this.classTable[r.hash]!==r)throw Error("Class not in class table");e=e.nextObject}return 1+(t>>10)},classTableBytes:function(e){return 4*(4108+1028*e)},writeFreeLists:function(e,t,r,i){return e.setUint32(t,167772178,r),t+=4,e.setUint32(t,536870912,r),t+=4,t+=128},writeClassTable:function(e,t,r,i,a){e.setUint32(t,4104,r),t+=4,e.setUint32(t,4278190080,r),t+=4,e.setUint32(t,33554448,r),t+=4,e.setUint32(t,4278190080,r),t+=4;for(var s=0;s>2||2!=(3&e.oop))throw Error("Bad immediate char");return e.oop}if(e.oop<0)throw Error("temporary oop");return e.oop<48?e.oop:e.oop+t}for(n(this.formatVersion()),n(64),n(t+this.oldSpaceBytes+16),n(this.firstOldObject.addr()),n(o(this.specialObjectsArray)),this.savedHeaderWords.forEach(n),n(t+this.oldSpaceBytes+16);s<64;)n(0);var u=this.firstOldObject,l=0;for(s=u.writeTo(r,s,i,o),u=u.nextObject,l++,s=u.writeTo(r,s,i,o),u=u.nextObject,l++,s=u.writeTo(r,s,i,o),u=u.nextObject,l++,s=this.writeFreeLists(r,s,i,o),s=this.writeClassTable(r,s,i,o,e);u;)s=u.writeTo(r,s,i,o),u=u.nextObject,l++;if(n(1241513987),n(8388608),n(0),n(0),s!==r.byteLength)throw Error("wrong image size");if(l!==this.oldSpaceCount)throw Error("wrong object count");var c=Date.now()-a;return console.log("Wrote "+l+" objects in "+c+" ms, image size "+s+" bytes"),r.buffer},storeImageSegmentSpur:function(e,t,r){return this.vm.warnOnce("not implemented for Spur yet: primitive 98 (primitiveStoreImageSegment)"),!1},loadImageSegmentSpur:function(e,t){return this.vm.warnOnce("not implemented for Spur yet: primitive 99 (primitiveLoadImageSegment)"),null}}),Object.subclass("Squeak.Interpreter","initialization",{initialize:function(e,t){console.log("squeak: initializing interpreter "+Squeak.vmVersion),this.Squeak=Squeak,this.image=e,(this.image.vm=this).primHandler=new Squeak.Primitives(this,t),this.loadImageState(),this.hackImage(),this.initVMState(),this.loadInitialContext(),this.initCompiler(),console.log("squeak: ready")},loadImageState:function(){this.specialObjects=this.image.specialObjectsArray.pointers,this.specialSelectors=this.specialObjects[Squeak.splOb_SpecialSelectors].pointers,this.nilObj=this.specialObjects[Squeak.splOb_NilObject],this.falseObj=this.specialObjects[Squeak.splOb_FalseObject],this.trueObj=this.specialObjects[Squeak.splOb_TrueObject],this.hasClosures=this.image.hasClosures,this.getGlobals=this.globalsGetter(),this.hasClosures||this.findMethod("UnixFileDirectory class>>pathNameDelimiter")||(this.primHandler.emulateMac=!0),6501==this.image.version&&(this.primHandler.reverseDisplay=!0)},initVMState:function(){this.byteCodeCount=0,this.sendCount=0,this.interruptCheckCounter=0,this.interruptCheckCounterFeedBackReset=1e3,this.interruptChecksEveryNms=3,this.lowSpaceThreshold=1e6,this.signalLowSpace=!1,this.nextPollTick=0,this.nextWakeupTick=0,this.lastTick=0,this.interruptKeycode=2094,this.interruptPending=!1,this.pendingFinalizationSignals=0,this.freeContexts=this.nilObj,this.freeLargeContexts=this.nilObj,this.reclaimableContextCount=0,this.nRecycledContexts=0,this.nAllocatedContexts=0,this.methodCacheSize=1024,this.methodCacheMask=this.methodCacheSize-1,this.methodCacheRandomish=0,this.methodCache=[];for(var e=0;e>wordSize",literal:{index:1,old:8,hack:4},enabled:!0},{method:"ReleaseBuilder class>>prepareEnvironment",bytecode:{pc:28,old:216,hack:135},enabled:("object"==typeof location?location.hash:"").includes("wizard=false")}].forEach(function(t){try{var e=t.enabled&&this.findMethod(t.method);if(e){var r=t.primitive,i=t.bytecode,a=t.literal,s=!0;r?e.pointers[0]|=r:i&&e.bytes[i.pc]===i.old?e.bytes[i.pc]=i.hack:i&&e.bytes[i.pc]===i.hack?s=!1:a&&e.pointers[a.index].pointers[1]===a.old?e.pointers[a.index].pointers[1]=a.hack:a&&e.pointers[a.index].pointers[1]===a.hack?s=!1:(s=!1,console.warn("Not hacking "+t.method)),s&&console.warn("Hacking "+t.method)}}catch(e){console.error("Failed to hack "+t.method+" with error "+e)}},this)}},"interpreting",{interpretOne:function(e){if(this.method.methodSignFlag())return this.interpretOneSistaWithExtensions(e,0,0);if(!this.method.compiled){var t,r,i=this.Squeak;switch(this.byteCodeCount++,t=this.nextByte()){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return void this.push(this.receiver.pointers[15&t]);case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:case 26:case 27:case 28:case 29:case 30:case 31:return void this.push(this.homeContext.pointers[i.Context_tempFrameStart+(15&t)]);case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 58:case 59:case 60:case 61:case 62:case 63:return void this.push(this.method.methodGetLiteral(31&t));case 64:case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 91:case 92:case 93:case 94:case 95:return void this.push(this.method.methodGetLiteral(31&t).pointers[i.Assn_value]);case 96:case 97:case 98:case 99:case 100:case 101:case 102:case 103:return this.receiver.dirty=!0,void(this.receiver.pointers[7&t]=this.pop());case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:return void(this.homeContext.pointers[i.Context_tempFrameStart+(7&t)]=this.pop());case 112:return void this.push(this.receiver);case 113:return void this.push(this.trueObj);case 114:return void this.push(this.falseObj);case 115:return void this.push(this.nilObj);case 116:return void this.push(-1);case 117:return void this.push(0);case 118:return void this.push(1);case 119:return void this.push(2);case 120:return void this.doReturn(this.receiver);case 121:return void this.doReturn(this.trueObj);case 122:return void this.doReturn(this.falseObj);case 123:return void this.doReturn(this.nilObj);case 124:return void this.doReturn(this.pop());case 125:return void this.doReturn(this.pop(),this.activeContext.pointers[i.BlockContext_caller]);case 126:case 127:return void this.nono();case 128:return void this.extendedPush(this.nextByte());case 129:return void this.extendedStore(this.nextByte());case 130:return void this.extendedStorePop(this.nextByte());case 131:return r=this.nextByte(),void this.send(this.method.methodGetSelector(31&r),r>>5,!1);case 132:return void this.doubleExtendedDoAnything(this.nextByte());case 133:return r=this.nextByte(),void this.send(this.method.methodGetSelector(31&r),r>>5,!0);case 134:return r=this.nextByte(),void this.send(this.method.methodGetSelector(63&r),r>>6,!1);case 135:return void this.pop();case 136:return void this.push(this.top());case 137:return void this.push(this.exportThisContext());case 138:return void this.pushNewArray(this.nextByte());case 139:return void this.callPrimBytecode(129);case 140:return r=this.nextByte(),void this.push(this.homeContext.pointers[i.Context_tempFrameStart+this.nextByte()].pointers[r]);case 141:return r=this.nextByte(),void(this.homeContext.pointers[i.Context_tempFrameStart+this.nextByte()].pointers[r]=this.top());case 142:return r=this.nextByte(),void(this.homeContext.pointers[i.Context_tempFrameStart+this.nextByte()].pointers[r]=this.pop());case 143:return void this.pushClosureCopy();case 144:case 145:case 146:case 147:case 148:case 149:case 150:case 151:return void(this.pc+=1+(7&t));case 152:case 153:case 154:case 155:case 156:case 157:case 158:case 159:return void this.jumpIfFalse(1+(7&t));case 160:case 161:case 162:case 163:case 164:case 165:case 166:case 167:return r=this.nextByte(),this.pc+=256*((7&t)-4)+r,void((7&t)<4&&this.interruptCheckCounter--<=0&&this.checkForInterrupts());case 168:case 169:case 170:case 171:return void this.jumpIfTrue(256*(3&t)+this.nextByte());case 172:case 173:case 174:case 175:return void this.jumpIfFalse(256*(3&t)+this.nextByte());case 176:return this.success=!0,this.resultIsFloat=!1,void(this.pop2AndPushNumResult(this.stackIntOrFloat(1)+this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 177:return this.success=!0,this.resultIsFloat=!1,void(this.pop2AndPushNumResult(this.stackIntOrFloat(1)-this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 178:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 180:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)<=this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 181:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)>=this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 182:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)===this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 183:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)!==this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 184:return this.success=!0,this.resultIsFloat=!1,void(this.pop2AndPushNumResult(this.stackIntOrFloat(1)*this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 185:return this.success=!0,void(this.pop2AndPushIntResult(this.quickDivide(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&t));case 186:return this.success=!0,void(this.pop2AndPushIntResult(this.mod(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&t));case 187:return this.success=!0,void(this.primHandler.primitiveMakePoint(1,!0)||this.sendSpecial(15&t));case 188:return this.success=!0,void(this.pop2AndPushIntResult(this.safeShift(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&t));case 189:return this.success=!0,void(this.pop2AndPushIntResult(this.div(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&t));case 190:return this.success=!0,void(this.pop2AndPushIntResult(this.stackInteger(1)&this.stackInteger(0))||this.sendSpecial(15&t));case 191:return this.success=!0,void(this.pop2AndPushIntResult(this.stackInteger(1)|this.stackInteger(0))||this.sendSpecial(15&t));case 192:case 193:case 194:case 195:case 196:case 197:case 198:case 199:case 200:case 201:case 202:case 203:case 204:case 205:case 206:case 207:return void(this.primHandler.quickSendOther(this.receiver,15&t)||this.sendSpecial(16+(15&t)));case 208:case 209:case 210:case 211:case 212:case 213:case 214:case 215:case 216:case 217:case 218:case 219:case 220:case 221:case 222:case 223:return void this.send(this.method.methodGetSelector(15&t),0,!1);case 224:case 225:case 226:case 227:case 228:case 229:case 230:case 231:case 232:case 233:case 234:case 235:case 236:case 237:case 238:case 239:return void this.send(this.method.methodGetSelector(15&t),1,!1);case 240:case 241:case 242:case 243:case 244:case 245:case 246:case 247:case 248:case 249:case 250:case 251:case 252:case 253:case 254:case 255:return void this.send(this.method.methodGetSelector(15&t),2,!1)}throw Error("not a bytecode: "+t)}if(e){if(!this.compiler.enableSingleStepping(this.method))return this.method.compiled=null,this.interpretOne(e);this.breakNow()}this.method.compiled(this)},interpretOneSistaWithExtensions:function(e,t,r){var i,a,s=this.Squeak;switch(this.byteCodeCount++,i=this.nextByte()){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return void this.push(this.receiver.pointers[15&i]);case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:case 26:case 27:case 28:case 29:case 30:case 31:return void this.push(this.method.methodGetLiteral(15&i).pointers[s.Assn_value]);case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 58:case 59:case 60:case 61:case 62:case 63:return void this.push(this.method.methodGetLiteral(31&i));case 64:case 65:case 66:case 67:case 68:case 69:case 70:case 71:return void this.push(this.homeContext.pointers[s.Context_tempFrameStart+(7&i)]);case 72:case 73:case 74:case 75:return void this.push(this.homeContext.pointers[s.Context_tempFrameStart+(3&i)+8]);case 76:return void this.push(this.receiver);case 77:return void this.push(this.trueObj);case 78:return void this.push(this.falseObj);case 79:return void this.push(this.nilObj);case 80:return void this.push(0);case 81:return void this.push(1);case 82:return 0==r?void this.push(this.exportThisContext()):void this.nono();case 83:return void this.push(this.top());case 84:case 85:case 86:case 87:return void this.nono();case 88:return void this.doReturn(this.receiver);case 89:return void this.doReturn(this.trueObj);case 90:return void this.doReturn(this.falseObj);case 91:return void this.doReturn(this.nilObj);case 92:return void this.doReturn(this.pop());case 93:return void this.doReturn(this.nilObj,this.activeContext.pointers[s.BlockContext_caller]);case 94:return 0==t?void this.doReturn(this.pop(),this.activeContext.pointers[s.BlockContext_caller]):void this.nono();case 95:return;case 96:return this.success=!0,this.resultIsFloat=!1,void(this.pop2AndPushNumResult(this.stackIntOrFloat(1)+this.stackIntOrFloat(0))||this.sendSpecial(15&i));case 97:return this.success=!0,this.resultIsFloat=!1,void(this.pop2AndPushNumResult(this.stackIntOrFloat(1)-this.stackIntOrFloat(0))||this.sendSpecial(15&i));case 98:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)this.stackIntOrFloat(0))||this.sendSpecial(15&i));case 100:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)<=this.stackIntOrFloat(0))||this.sendSpecial(15&i));case 101:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)>=this.stackIntOrFloat(0))||this.sendSpecial(15&i));case 102:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)===this.stackIntOrFloat(0))||this.sendSpecial(15&i));case 103:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)!==this.stackIntOrFloat(0))||this.sendSpecial(15&i));case 104:return this.success=!0,this.resultIsFloat=!1,void(this.pop2AndPushNumResult(this.stackIntOrFloat(1)*this.stackIntOrFloat(0))||this.sendSpecial(15&i));case 105:return this.success=!0,void(this.pop2AndPushIntResult(this.quickDivide(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&i));case 106:return this.success=!0,void(this.pop2AndPushIntResult(this.mod(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&i));case 107:return this.success=!0,void(this.primHandler.primitiveMakePoint(1,!0)||this.sendSpecial(15&i));case 108:return this.success=!0,void(this.pop2AndPushIntResult(this.safeShift(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&i));case 109:return this.success=!0,void(this.pop2AndPushIntResult(this.div(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&i));case 110:return this.success=!0,void(this.pop2AndPushIntResult(this.stackInteger(1)&this.stackInteger(0))||this.sendSpecial(15&i));case 111:return this.success=!0,void(this.pop2AndPushIntResult(this.stackInteger(1)|this.stackInteger(0))||this.sendSpecial(15&i));case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:case 123:case 124:case 125:case 126:case 127:return void(this.primHandler.quickSendOther(this.receiver,15&i)||this.sendSpecial(16+(15&i)));case 128:case 129:case 130:case 131:case 132:case 133:case 134:case 135:case 136:case 137:case 138:case 139:case 140:case 141:case 142:case 143:return void this.send(this.method.methodGetSelector(15&i),0,!1);case 144:case 145:case 146:case 147:case 148:case 149:case 150:case 151:case 152:case 153:case 154:case 155:case 156:case 157:case 158:case 159:return void this.send(this.method.methodGetSelector(15&i),1,!1);case 160:case 161:case 162:case 163:case 164:case 165:case 166:case 167:case 168:case 169:case 170:case 171:case 172:case 173:case 174:case 175:return void this.send(this.method.methodGetSelector(15&i),2,!1);case 176:case 177:case 178:case 179:case 180:case 181:case 182:case 183:return void(this.pc+=1+(7&i));case 184:case 185:case 186:case 187:case 188:case 189:case 190:case 191:return void this.jumpIfTrue(1+(7&i));case 192:case 193:case 194:case 195:case 196:case 197:case 198:case 199:return void this.jumpIfFalse(1+(7&i));case 200:case 201:case 202:case 203:case 204:case 205:case 206:case 207:return this.receiver.dirty=!0,void(this.receiver.pointers[7&i]=this.pop());case 208:case 209:case 210:case 211:case 212:case 213:case 214:case 215:return void(this.homeContext.pointers[s.Context_tempFrameStart+(7&i)]=this.pop());case 216:return void this.pop();case 217:return void this.nono();case 218:case 219:case 220:case 221:case 222:case 223:return void this.nono();case 224:return a=this.nextByte(),void this.interpretOneSistaWithExtensions(e,(t<<8)+a,r);case 225:return a=this.nextByte(),void this.interpretOneSistaWithExtensions(e,t,(r<<8)+(a<128?a:a-256));case 226:return a=this.nextByte(),void this.push(this.receiver.pointers[a+(t<<8)]);case 227:return a=this.nextByte(),void this.push(this.method.methodGetLiteral(a+(t<<8)).pointers[s.Assn_value]);case 228:return a=this.nextByte(),void this.push(this.method.methodGetLiteral(a+(t<<8)));case 229:return a=this.nextByte(),void this.push(this.homeContext.pointers[s.Context_tempFrameStart+a]);case 230:return void this.nono();case 231:return void this.pushNewArray(this.nextByte());case 232:return a=this.nextByte(),void this.push(a+(r<<8));case 233:return a=this.nextByte(),void this.push(this.image.getCharacter(a+(r<<8)));case 234:return a=this.nextByte(),void this.send(this.method.methodGetSelector((a>>3)+(t<<5)),(7&a)+(r<<3),!1);case 235:a=this.nextByte();var n=this.method.methodGetSelector((a>>3)+(t<<5));return 64<=r?void this.sendSuperDirected(n,(7&a)+((63&r)<<3)):void this.send(n,(7&a)+(r<<3),!0);case 236:return void this.nono();case 237:var o=this.nextByte()+(r<<8);return this.pc+=o,void(o<0&&this.interruptCheckCounter--<=0&&this.checkForInterrupts());case 238:return void this.jumpIfTrue(this.nextByte()+(r<<8));case 239:return void this.jumpIfFalse(this.nextByte()+(r<<8));case 240:return this.receiver.dirty=!0,void(this.receiver.pointers[this.nextByte()+(t<<8)]=this.pop());case 241:return(u=this.method.methodGetLiteral(this.nextByte()+(t<<8))).dirty=!0,void(u.pointers[s.Assn_value]=this.pop());case 242:return void(this.homeContext.pointers[s.Context_tempFrameStart+this.nextByte()]=this.pop());case 243:return this.receiver.dirty=!0,void(this.receiver.pointers[this.nextByte()+(t<<8)]=this.top());case 244:var u;return(u=this.method.methodGetLiteral(this.nextByte()+(t<<8))).dirty=!0,void(u.pointers[s.Assn_value]=this.top());case 245:return void(this.homeContext.pointers[s.Context_tempFrameStart+this.nextByte()]=this.top());case 246:case 247:return void this.nono();case 248:return void this.callPrimBytecode(245);case 249:return void this.pushFullClosure(t);case 250:return void this.pushClosureCopyExtended(t,r);case 251:return a=this.nextByte(),void this.push(this.homeContext.pointers[s.Context_tempFrameStart+this.nextByte()].pointers[a]);case 252:return a=this.nextByte(),void(this.homeContext.pointers[s.Context_tempFrameStart+this.nextByte()].pointers[a]=this.top());case 253:return a=this.nextByte(),void(this.homeContext.pointers[s.Context_tempFrameStart+this.nextByte()].pointers[a]=this.pop());case 254:case 255:return void this.nono()}throw Error("not a bytecode: "+i)},interpret:function(e,t){if(this.frozen)return"frozen";for(this.isIdle=!1,this.breakOutOfInterpreter=!1,this.breakOutTick=this.primHandler.millisecondClockValue()+(e||500);!1===this.breakOutOfInterpreter;)this.method.compiled?this.method.compiled(this):this.interpretOne();if("function"==typeof this.breakOutOfInterpreter)return this.breakOutOfInterpreter(t);var r="break"==this.breakOutOfInterpreter?"break":this.isIdle?this.nextWakeupTick?Math.max(1,this.nextWakeupTick-this.primHandler.millisecondClockValue()):"sleep":0;return t&&t(r),r},goIdle:function(){var e=0!==this.nextWakeupTick;this.forceInterruptCheck(),this.checkForInterrupts();var t=0!==this.nextWakeupTick;this.isIdle=t||!e,this.breakOut()},freeze:function(e){var t;this.frozen=!0,this.breakOutOfInterpreter=function(e){if(!e)throw Error("need function to restart interpreter");return t=e,"frozen"}.bind(this);var r=function(){if(this.frozen=!1,!t)throw Error("no continue function");t(0)}.bind(this);return e&&self.setTimeout(function(){e(r)},0),r},breakOut:function(){this.breakOutOfInterpreter=this.breakOutOfInterpreter||!0},nextByte:function(){return this.method.bytes[this.pc++]},nono:function(){throw Error("Oh No!")},forceInterruptCheck:function(){this.interruptCheckCounter=-1e3},checkForInterrupts:function(){var e=this.primHandler.millisecondClockValue();e=this.nextWakeupTick&&(this.nextWakeupTick=0,(t=this.specialObjects[Squeak.splOb_TheTimerSemaphore]).isNil||this.primHandler.synchronousSignal(t));if(0=this.breakOutTick&&this.breakOut()},extendedPush:function(e){var t=63&e;switch(e>>6){case 0:this.push(this.receiver.pointers[t]);break;case 1:this.push(this.homeContext.pointers[Squeak.Context_tempFrameStart+t]);break;case 2:this.push(this.method.methodGetLiteral(t));break;case 3:this.push(this.method.methodGetLiteral(t).pointers[Squeak.Assn_value])}},extendedStore:function(e){var t=63&e;switch(e>>6){case 0:this.receiver.dirty=!0,this.receiver.pointers[t]=this.top();break;case 1:this.homeContext.pointers[Squeak.Context_tempFrameStart+t]=this.top();break;case 2:this.nono();break;case 3:var r=this.method.methodGetLiteral(t);r.dirty=!0,r.pointers[Squeak.Assn_value]=this.top()}},extendedStorePop:function(e){var t=63&e;switch(e>>6){case 0:this.receiver.dirty=!0,this.receiver.pointers[t]=this.pop();break;case 1:this.homeContext.pointers[Squeak.Context_tempFrameStart+t]=this.pop();break;case 2:this.nono();break;case 3:var r=this.method.methodGetLiteral(t);r.dirty=!0,r.pointers[Squeak.Assn_value]=this.pop()}},doubleExtendedDoAnything:function(e){var t=this.nextByte();switch(e>>5){case 0:this.send(this.method.methodGetSelector(t),31&e,!1);break;case 1:this.send(this.method.methodGetSelector(t),31&e,!0);break;case 2:this.push(this.receiver.pointers[t]);break;case 3:this.push(this.method.methodGetLiteral(t));break;case 4:this.push(this.method.methodGetLiteral(t).pointers[Squeak.Assn_value]);break;case 5:this.receiver.dirty=!0,this.receiver.pointers[t]=this.top();break;case 6:this.receiver.dirty=!0,this.receiver.pointers[t]=this.pop();break;case 7:var r=this.method.methodGetLiteral(t);r.dirty=!0,r.pointers[Squeak.Assn_value]=this.top()}},jumpIfTrue:function(e){var t=this.pop();t.isTrue?this.pc+=e:t.isFalse||(this.push(t),this.send(this.specialObjects[Squeak.splOb_SelectorMustBeBoolean],0,!1))},jumpIfFalse:function(e){var t=this.pop();t.isFalse?this.pc+=e:t.isTrue||(this.push(t),this.send(this.specialObjects[Squeak.splOb_SelectorMustBeBoolean],0,!1))},sendSpecial:function(e){this.send(this.specialSelectors[2*e],this.specialSelectors[2*e+1],!1)},callPrimBytecode:function(e){this.pc+=2,this.primFailCode&&(this.method.bytes[this.pc]===e&&this.stackTopPut(this.getErrorObjectFromPrimFailCode()),this.primFailCode=0)},getErrorObjectFromPrimFailCode:function(){var e=this.specialObjects[Squeak.splOb_PrimErrTableIndex];if(e&&e.pointers){var t=e.pointers[this.primFailCode-1];if(t)return t}return this.primFailCode}},"closures",{pushNewArray:function(e){var t=127>4,i=256*this.nextByte()+this.nextByte(),a=this.encodeSqueakPC(this.pc,this.method),s=this.newClosure(t,a,r);if(s.pointers[Squeak.Closure_outerContext]=this.activeContext,(this.reclaimableContextCount=0)>3&7)+8*this.div(e,16),n=i+(t<<8),o=this.encodeSqueakPC(this.pc,this.method),u=this.newClosure(a,o,s);if(u.pointers[Squeak.Closure_outerContext]=this.activeContext,(this.reclaimableContextCount=0)>6&1)?this.vm.nilObj:this.activeContext;var n=this.method.methodGetLiteral(a),o=this.newFullClosure(t,s,n);if(1==(i>>7&1))throw Error("on-stack receiver not yet supported");if(o.pointers[Squeak.ClosureFull_receiver]=this.receiver,(this.reclaimableContextCount=0)Squeak.Message_lookupClass&&(i.pointers[Squeak.Message_lookupClass]=r),i},primitivePerform:function(e){var t=this.stackValue(e-1),r=this.stackValue(e),i=e-1,a=this.sp-i,s=this.activeContext.pointers;this.arrayCopy(s,1+a,s,a,i),this.sp--;var n=this.findSelectorInClass(t,i,this.getClass(r));return this.executeNewMethod(r,n.method,n.argCount,n.primIndex,n.mClass,t),!0},primitivePerformWithArgs:function(e,t){var r=t?3:2,i=this.stackValue(r),a=this.stackValue(r-1),s=this.stackValue(r-2);if(s.sqClass!==this.specialObjects[Squeak.splOb_ClassArray])return!1;var n=t?this.top():this.getClass(i);if(t)for(var o=this.getClass(i);o!==n;)if((o=o.pointers[Squeak.Class_superclass]).isNil)return!1;var u=s.pointersSize(),l=this.sp-(r-1),c=this.activeContext.pointers;this.arrayCopy(s.pointers,0,c,l,u),this.sp+=u-e;var h=this.findSelectorInClass(a,u,n);return this.executeNewMethod(i,h.method,h.argCount,h.primIndex,h.mClass,a),!0},primitiveInvokeObjectAsMethod:function(e,t){for(var r=this.instantiateClass(this.specialObjects[Squeak.splOb_ClassArray],e),i=0;i=Squeak.MinSmallInt&&e<=Squeak.MaxSmallInt)return this.popNandPush(2,e),!0;if(-4294967295<=e&&e<=4294967295){var t=e<0,r=t?-e:e,i=t?Squeak.splOb_ClassLargeNegativeInteger:Squeak.splOb_ClassLargePositiveInteger,a=this.instantiateClass(this.specialObjects[i],4),s=a.bytes;return s[0]=255&r,s[1]=r>>8&255,s[2]=r>>16&255,s[3]=r>>24&255,this.popNandPush(2,a),!0}}return!1},pop2AndPushBoolResult:function(e){return!!this.success&&(this.popNandPush(2,e?this.trueObj:this.falseObj),!0)}},"numbers",{getClass:function(e){return this.isSmallInt(e)?this.specialObjects[Squeak.splOb_ClassInteger]:e.sqClass},canBeSmallInt:function(e){return e>=Squeak.MinSmallInt&&e<=Squeak.MaxSmallInt},isSmallInt:function(e){return"number"==typeof e},checkSmallInt:function(e){return"number"==typeof e?e:(this.success=!1,1)},quickDivide:function(e,t){if(0===t)return Squeak.NonSmallInt;var r=e/t|0;return r*t===e?r:Squeak.NonSmallInt},div:function(e,t){return 0===t?Squeak.NonSmallInt:Math.floor(e/t)},mod:function(e,t){return 0===t?Squeak.NonSmallInt:e-Math.floor(e/t)*t},safeShift:function(e,t){if(t<0)return t<-31?e<0?-1:0:e>>-t;if(31>t===e?r:Squeak.NonSmallInt}},"utils",{isContext:function(e){return e.sqClass===this.specialObjects[Squeak.splOb_ClassMethodContext]||e.sqClass===this.specialObjects[Squeak.splOb_ClassBlockContext]},isMethodContext:function(e){return e.sqClass===this.specialObjects[Squeak.splOb_ClassMethodContext]},instantiateClass:function(e,t){return this.image.instantiateClass(e,t,this.nilObj)},arrayFill:function(e,t,r,i){for(var a=t;a>"+t.bytesAsString():(i=i||this.activeContext.contextMethod(),this.allMethodsDo(function(e,t,r){if(t===i)return a=e.className()+">>"+r.bytesAsString()}),a||(e?"("+e.pointers[Squeak.Context_receiver]+")>>?":"?>>?"));var a},allInstancesOf:function(e,t){"string"==typeof e&&(e=this.globalNamed(e));for(var r=[],i=this.image.someInstanceOf(e);i;)t?t(i):r.push(i),i=this.image.nextInstanceAfter(i);return r},globalNamed:function(r){return this.allGlobalsDo(function(e,t){if(e.bytesAsString()===r)return t})},allGlobalsDo:function(e){for(var t=this.getGlobals(),r=0;rt+200&&(e.isNil||r.push("..."),r=r.slice(0,t).concat(["..."]).concat(r.slice(-200)));for(var a=[],s=r.length;0>")[0],s=e.split(">>")[1];return this.allMethodsDo(function(e,t,r){if(s.length==r.bytesSize()&&s==r.bytesAsString()&&a==e.className())return i=t}),i},breakNow:function(e){e&&console.log("Break: "+e),this.breakOutOfInterpreter="break"},breakOn:function(e){return this.breakOnMethod=e&&this.findMethod(e)},breakOnReturnFromThisContext:function(){this.breakOnContextChanged=!1,this.breakOnContextReturned=this.activeContext},breakOnSendOrReturn:function(){this.breakOnContextChanged=!0,this.breakOnContextReturned=null},printContext:function(e,r){if(!this.isContext(e))return"NOT A CONTEXT: "+t(e);function t(e){var t="number"==typeof e||"object"==typeof e?e.sqInstName():"<"+e+">";return(t=JSON.stringify(t).slice(1,-1)).length>r-3&&(t=t.slice(0,r-3)+"..."),t}r=r||72;for(var i="number"==typeof e.pointers[Squeak.BlockContext_argumentCount],a=e.pointers[Squeak.Context_closure],s=!i&&!a.isNil,n=i?e.pointers[Squeak.BlockContext_home]:e,o=s?a.pointers[Squeak.Closure_numArgs]:n.pointers[Squeak.Context_method].methodTempCount(),u=this.decodeSqueakSP(0),l=n.contextSizeWithStack(this)-1,c=u+1,h=c+o-1,f="",d=u;d<=l;d++){var p="";d==u?p="=rcvr":d<=h&&(p="=tmp"+(d-c)),f+="\nctx["+d+"]"+p+": "+t(n.pointers[d])}if(i){f+="\n";var b=e.pointers[Squeak.BlockContext_argumentCount],m=this.decodeSqueakSP(1),v=m+b,g=e===this.activeContext?this.sp:e.pointers[Squeak.Context_stackPointer];for(d=m;d<=g;d++){p="";d<=v&&(p="=arg"+(d-m)),f+="\nblk["+d+"]"+p+": "+t(e.pointers[d])}}return f},printActiveContext:function(e){return this.printContext(this.activeContext,e)},printAllProcesses:function(){for(var e=this.specialObjects[Squeak.splOb_SchedulerAssociation].pointers[Squeak.Assn_value],t=e.pointers[Squeak.ProcSched_activeProcess],r="Active: "+this.printProcess(t,!0),i=e.pointers[Squeak.ProcSched_processLists].pointers,a=i.length-1;0<=a;a--)for(var s=i[a].pointers[Squeak.LinkedList_firstLink];!s.isNil;)r+="\nRunnable: "+this.printProcess(s),s=s.pointers[Squeak.Link_nextLink];for(var n=this.specialObjects[Squeak.splOb_ClassSemaphore],o=this.image.someInstanceOf(n);o;){for(s=o.pointers[Squeak.LinkedList_firstLink];!s.isNil;)r+="\nWaiting: "+this.printProcess(s),s=s.pointers[Squeak.Link_nextLink];o=this.image.nextInstanceAfter(o)}return r},printProcess:function(e,t){var r=e.pointers[Squeak.Proc_suspendedContext],i=e.pointers[Squeak.Proc_priority],a=this.printStack(t?null:r),s=this.printContext(r);return e.toString()+" at priority "+i+"\n"+a+s+"\n"},printByteCodes:function(e,t,r,i){return e=e||this.method,new Squeak.InstructionPrinter(e,this).printInstructions(t,r,i)},logStack:function(){console.log(this.printStack()+this.printActiveContext()+"\n\n"+this.printByteCodes(this.method,"   ","=> ",this.pc),this.activeContext.pointers.slice(0,this.sp+1))},willSendOrReturn:function(){var e=this.method.bytes[this.pc];if(this.method.methodSignFlag()){if(96<=e&&e<=127)r=this.specialSelectors[2*(e-96)];else if(128<=e&&e<=175)r=this.method.methodGetSelector(15&e);else if(234==e||235==e)this.method.methodGetSelector(this.method.bytes[this.pc+1]>>3);else if(88<=e&&e<=94)return!0}else{if(120<=e&&e<=125)return!0;if(e<131||200==e)return!1;if(176<=e)return!0;if(e<=134){var t;if(132===e){if(1>5)return!1;t=this.method.bytes[this.pc+2]}else t=this.method.bytes[this.pc+1]&(134===e?63:31);var r=this.method.methodGetLiteral(t);if("blockCopy:"!==r.bytesAsString())return!0}}return!1},nextSendSelector:function(){var e,t=this.method.bytes[this.pc];if(this.method.methodSignFlag())if(96<=t&&t<=127)e=this.specialSelectors[2*(t-96)];else if(128<=t&&t<=175)e=this.method.methodGetSelector(15&t);else{if(234!=t&&235!=t)return null;this.method.methodGetSelector(this.method.bytes[this.pc+1]>>3)}else{if(t<131||200==t)return null;if(208<=t)e=this.method.methodGetLiteral(15&t);else if(176<=t)e=this.specialSelectors[2*(t-176)];else if(t<=134){var r;if(132===t){if(1>5)return null;r=this.method.bytes[this.pc+2]}else r=this.method.bytes[this.pc+1]&(134===t?63:31);e=this.method.methodGetLiteral(r)}}if(e){var i=e.bytesAsString();if("blockCopy:"!==i)return i}}}),Object.subclass("Squeak.InterpreterProxy","initialization",{VM_PROXY_MAJOR:1,VM_PROXY_MINOR:11,initialize:function(t){this.vm=t,this.remappableOops=[],Object.defineProperty(this,"successFlag",{get:function(){return t.primHandler.success},set:function(e){t.primHandler.success=e}})},majorVersion:function(){return this.VM_PROXY_MAJOR},minorVersion:function(){return this.VM_PROXY_MINOR}},"success",{failed:function(){return!this.successFlag},primitiveFail:function(){this.successFlag=!1},primitiveFailFor:function(e){this.successFlag=!1},success:function(e){e||(this.successFlag=!1)}},"stack access",{pop:function(e){this.vm.popN(e)},popthenPush:function(e,t){this.vm.popNandPush(e,t)},push:function(e){this.vm.push(e)},pushBool:function(e){this.vm.push(e?this.vm.trueObj:this.vm.falseObj)},pushInteger:function(e){this.vm.push(e)},pushFloat:function(e){this.vm.push(this.floatObjectOf(e))},stackValue:function(e){return this.vm.stackValue(e)},stackIntegerValue:function(e){var t=this.vm.stackValue(e);return"number"==typeof t?t:(this.successFlag=!1,0)},stackFloatValue:function(e){this.vm.success=!0;var t=this.vm.stackIntOrFloat(e);return this.vm.success?t:(this.successFlag=!1,0)},stackObjectValue:function(e){var t=this.vm.stackValue(e);return"number"!=typeof t?t:(this.successFlag=!1,this.vm.nilObj)},stackBytes:function(e){var t=this.vm.stackValue(e);return t.bytes?t.bytes:("number"!=typeof t&&t.isBytes()||(this.successFlag=!1),[])},stackWords:function(e){var t=this.vm.stackValue(e);return t.words?t.words:("number"!=typeof t&&t.isWords()||(this.successFlag=!1),[])},stackInt32Array:function(e){var t=this.vm.stackValue(e);return t.words?t.wordsAsInt32Array():("number"!=typeof t&&t.isWords()||(this.successFlag=!1),[])},stackInt16Array:function(e){var t=this.vm.stackValue(e);return t.words?t.wordsAsInt16Array():("number"!=typeof t&&t.isWords()||(this.successFlag=!1),[])},stackUint16Array:function(e){var t=this.vm.stackValue(e);return t.words?t.wordsAsUint16Array():("number"!=typeof t&&t.isWords()||(this.successFlag=!1),[])}},"object access",{isBytes:function(e){return"number"!=typeof e&&e.isBytes()},isWords:function(e){return"number"!=typeof e&&e.isWords()},isWordsOrBytes:function(e){return"number"!=typeof e&&e.isWordsOrBytes()},isPointers:function(e){return"number"!=typeof e&&e.isPointers()},isIntegerValue:function(e){return"number"==typeof e&&-1073741824<=e&&e<=1073741823},isArray:function(e){return e.sqClass===this.vm.specialObjects[Squeak.splOb_ClassArray]},isMemberOf:function(e,t){var r=e.sqClass.pointers[Squeak.Class_name].bytes;if(t.length!==r.length)return!1;for(var i=0;i=e.pointers.length)return this.successFlag=!1;e.pointers[t]=r}},"constant access",{isKindOfInteger:function(e){return"number"==typeof e||e.sqClass==this.classLargeNegativeInteger()||e.sqClass==this.classLargePositiveInteger()},classArray:function(){return this.vm.specialObjects[Squeak.splOb_ClassArray]},classBitmap:function(){return this.vm.specialObjects[Squeak.splOb_ClassBitmap]},classSmallInteger:function(){return this.vm.specialObjects[Squeak.splOb_ClassInteger]},classLargePositiveInteger:function(){return this.vm.specialObjects[Squeak.splOb_ClassLargePositiveInteger]},classLargeNegativeInteger:function(){return this.vm.specialObjects[Squeak.splOb_ClassLargeNegativeInteger]},classPoint:function(){return this.vm.specialObjects[Squeak.splOb_ClassPoint]},classString:function(){return this.vm.specialObjects[Squeak.splOb_ClassString]},nilObject:function(){return this.vm.nilObj},falseObject:function(){return this.vm.falseObj},trueObject:function(){return this.vm.trueObj}},"vm functions",{clone:function(e){return this.vm.image.clone(e)},instantiateClassindexableSize:function(e,t){return this.vm.instantiateClass(e,t)},methodArgumentCount:function(){return this.argCount},makePointwithxValueyValue:function(e,t){return this.vm.primHandler.makePointWithXandY(e,t)},pushRemappableOop:function(e){this.remappableOops.push(e)},popRemappableOop:function(){return this.remappableOops.pop()},showDisplayBitsLeftTopRightBottom:function(e,t,r,i,a){if(t>5,!0);if(6===e)return r.send(this.method.methodGetLiteral(63&i),i>>6,!1)}if(7===e)return r.doPop();if(8===e)return r.doDup();if(9===e)return r.pushActiveContext();i=this.method.bytes[this.pc++];if(10===e)return i<128?r.pushNewArray(i):r.popIntoNewArray(i-128);n=this.method.bytes[this.pc++];if(11===e)return r.callPrimitive(i+256*n);if(12===e)return r.pushRemoteTemp(i,n);if(13===e)return r.storeIntoRemoteTemp(i,n);if(14===e)return r.popIntoRemoteTemp(i,n);var o=this.method.bytes[this.pc++];return r.pushClosureCopy(i>>4,15&i,256*n+o)}}),Squeak.InstructionStream.subclass("Squeak.InstructionStreamSista","decoding",{interpretNextInstructionFor:function(e){return this.interpretNextInstructionExtFor(e,0,0)},interpretNextInstructionExtFor:function(e,t,r){this.Squeak;var i=this.method.bytes[this.pc++];switch(i){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return e.pushReceiverVariable(15&i);case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:case 26:case 27:case 28:case 29:case 30:case 31:return e.pushLiteralVariable(this.method.methodGetLiteral(15&i));case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 58:case 59:case 60:case 61:case 62:case 63:return e.pushConstant(this.method.methodGetLiteral(31&i));case 64:case 65:case 66:case 67:case 68:case 69:case 70:case 71:return e.pushTemporaryVariable(15&i);case 72:case 73:case 74:case 75:return e.pushTemporaryVariable(8+(3&i));case 76:return e.pushReceiver();case 77:return e.pushConstant(this.vm.trueObj);case 78:return e.pushConstant(this.vm.falseObj);case 79:return e.pushConstant(this.vm.nilObj);case 80:return e.pushConstant(0);case 81:return e.pushConstant(1);case 82:return e.pushActiveContext();case 83:return e.doDup();case 88:return e.methodReturnReceiver();case 89:return e.methodReturnConstant(this.vm.trueObj);case 90:return e.methodReturnConstant(this.vm.falseObj);case 91:return e.methodReturnConstant(this.vm.nilObj);case 92:return e.methodReturnTop();case 93:return e.blockReturnConstant(this.vm.nilObj);case 94:if(0===t)return e.blockReturnTop();break;case 95:return e.nop();case 96:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:case 123:case 124:case 125:case 126:case 127:return e.send(this.vm.specialSelectors[2*(i-96)],this.vm.specialSelectors[2*(i-96)+1],!1);case 128:case 129:case 130:case 131:case 132:case 133:case 134:case 135:case 136:case 137:case 138:case 139:case 140:case 141:case 142:case 143:return e.send(this.method.methodGetLiteral(15&i),0,!1);case 144:case 145:case 146:case 147:case 148:case 149:case 150:case 151:case 152:case 153:case 154:case 155:case 156:case 157:case 158:case 159:return e.send(this.method.methodGetLiteral(15&i),1,!1);case 160:case 161:case 162:case 163:case 164:case 165:case 166:case 167:case 168:case 169:case 170:case 171:case 172:case 173:case 174:case 175:return e.send(this.method.methodGetLiteral(15&i),2,!1);case 176:case 177:case 178:case 179:case 180:case 181:case 182:case 183:return e.jump(1+(7&i));case 184:case 185:case 186:case 187:case 188:case 189:case 190:case 191:return e.jumpIf(!0,1+(7&i));case 192:case 193:case 194:case 195:case 196:case 197:case 198:case 199:return e.jumpIf(!1,1+(7&i));case 200:case 201:case 202:case 203:case 204:case 205:case 206:case 207:return e.popIntoReceiverVariable(7&i);case 208:case 209:case 210:case 211:case 212:case 213:case 214:case 215:return e.popIntoTemporaryVariable(i-208);case 216:return e.doPop()}var a=this.method.bytes[this.pc++];switch(i){case 224:return this.interpretNextInstructionExtFor(e,(t<<8)+a,r);case 225:return this.interpretNextInstructionExtFor(e,t,(r<<8)+(a<128?a:a-256));case 226:return e.pushReceiverVariable(a+(t<<8));case 227:return e.pushLiteralVariable(this.method.methodGetLiteral(a+(t<<8)));case 228:return e.pushConstant(this.method.methodGetLiteral(a+(t<<8)));case 229:return e.pushTemporaryVariable(a);case 231:return a<128?e.pushNewArray(a):e.popIntoNewArray(a-128);case 232:return e.pushConstant(a+(r<<8));case 233:return e.pushConstant("$"+a+(r<<8));case 234:return e.send(this.method.methodGetSelector((a>>3)+(t<<5)),(7&a)+(r<<3),!1);case 235:var s=this.method.methodGetSelector((a>>3)+(t<<5));return 64<=r?e.sendSuperDirected(s):e.send(s,(7&a)+(r<<3),!0);case 237:return e.jump(a+(r<<8));case 238:return e.jumpIf(!0,a+(r<<8));case 239:return e.jumpIf(!1,a+(r<<8));case 240:return e.popIntoReceiverVariable(a+(t<<8));case 241:return e.popIntoLiteralVariable(this.method.methodGetLiteral(a+(t<<8)));case 242:return e.popIntoTemporaryVariable(a);case 243:return e.storeIntoReceiverVariable(a+(t<<8));case 244:return e.storeIntoLiteralVariable(this.method.methodGetLiteral(a+(t<<8)));case 245:return e.storeIntoTemporaryVariable(a)}var n=this.method.bytes[this.pc++];switch(i){case 248:return e.callPrimitive(a+(n<<8));case 249:var o=a+(t<<8),u=63&n,l=this.method.methodGetLiteral(o);return e.pushFullClosure(o,u,l.methodNumArgs());case 250:var c=(7&a)+8*this.mod(t,16),h=(u=(a>>3&7)+8*this.div(t,16),n+(r<<8));return e.pushClosureCopy(u,c,h);case 251:return e.pushRemoteTemp(a,n);case 252:return e.storeIntoRemoteTemp(a,n);case 253:return e.popIntoRemoteTemp(a,n)}throw Error("Unknown bytecode: "+i)}}),Object.subclass("Squeak.InstructionPrinter","initialization",{initialize:function(e,t){this.method=e,this.vm=t}},"printing",{printInstructions:function(e,t,r){this.indent=e,this.highlight=t,this.highlightPC=r,this.innerIndents={},this.result="",this.scanner=this.method.methodSignFlag()?new Squeak.InstructionStreamSista(this.method,this.vm):new Squeak.InstructionStream(this.method,this.vm),this.oldPC=this.scanner.pc,this.endPC=0,this.done=!1;try{for(;!this.done;)this.scanner.interpretNextInstructionFor(this)}catch(e){this.print("!!! "+e.message)}return this.result},print:function(e){this.oldPC===this.highlightPC?this.highlight&&(this.result+=this.highlight):this.indent&&(this.result+=this.indent),this.result+=this.oldPC;for(var t=0;tthis.oldPC&&(this.result+=" "),this.result+=(this.method.bytes[t]+256).toString(16).substr(-2).toUpperCase();this.result+="> "+e+"\n",this.oldPC=this.scanner.pc}},"decoding",{blockReturnConstant:function(e){this.print("blockReturn: "+e.toString())},blockReturnTop:function(){this.print("blockReturn")},doDup:function(){this.print("dup")},doPop:function(){this.print("pop")},jump:function(e){this.print("jumpTo: "+(this.scanner.pc+e)),this.scanner.pc+e>this.endPC&&(this.endPC=this.scanner.pc+e)},jumpIf:function(e,t){this.print((e?"jumpIfTrue: ":"jumpIfFalse: ")+(this.scanner.pc+t)),this.scanner.pc+t>this.endPC&&(this.endPC=this.scanner.pc+t)},methodReturnReceiver:function(){this.print("return: receiver"),this.done=this.scanner.pc>this.endPC},methodReturnTop:function(){this.print("return: topOfStack"),this.done=this.scanner.pc>this.endPC},methodReturnConstant:function(e){this.print("returnConst: "+e.toString()),this.done=this.scanner.pc>this.endPC},nop:function(){this.print("nop")},popIntoLiteralVariable:function(e){this.print("popIntoBinding: "+e.assnKeyAsString())},popIntoReceiverVariable:function(e){this.print("popIntoInstVar: "+e)},popIntoTemporaryVariable:function(e){this.print("popIntoTemp: "+e)},pushActiveContext:function(){this.print("push: thisContext")},pushConstant:function(e){var t=e.sqInstName?e.sqInstName():e.toString();this.print("pushConst: "+t)},pushLiteralVariable:function(e){this.print("pushBinding: "+e.assnKeyAsString())},pushReceiver:function(){this.print("push: self")},pushReceiverVariable:function(e){this.print("pushInstVar: "+e)},pushTemporaryVariable:function(e){this.print("pushTemp: "+e)},send:function(e,t,r){this.print((r?"superSend: #":"send: #")+(e.bytesAsString?e.bytesAsString():e))},sendSuperDirected:function(e){this.print("directedSuperSend: #"+(e.bytesAsString?e.bytesAsString():e))},storeIntoLiteralVariable:function(e){this.print("storeIntoBinding: "+e.assnKeyAsString())},storeIntoReceiverVariable:function(e){this.print("storeIntoInstVar: "+e)},storeIntoTemporaryVariable:function(e){this.print("storeIntoTemp: "+e)},pushNewArray:function(e){this.print("push: (Array new: "+e+")")},popIntoNewArray:function(e){this.print("pop: "+e+" into: (Array new: "+e+")")},pushRemoteTemp:function(e,t){this.print("push: "+e+" ofTemp: "+t)},storeIntoRemoteTemp:function(e,t){this.print("storeInto: "+e+" ofTemp: "+t)},popIntoRemoteTemp:function(e,t){this.print("popInto: "+e+" ofTemp: "+t)},pushClosureCopy:function(e,t,r){var i=this.scanner.pc,a=i+r;this.print("closure("+i+"-"+(a-1)+"): "+e+" copied, "+t+" args");for(var s=i;sthis.endPC&&(this.endPC=a)},pushFullClosure:function(e,t,r){this.print("pushFullClosure: (self literalAt: "+e+") numCopied: "+t+" numArgs: "+r)},callPrimitive:function(e){this.print("primitive: "+e)}}),Object.subclass("Squeak.Primitives","initialization",{initialize:function(e,t){this.vm=e,this.oldPrims=!this.vm.image.hasClosures,this.allowAccessBeyondSP=this.oldPrims,this.deferDisplayUpdates=!1,this.semaphoresToSignal=[],this.initDisplay(t),this.initAtCache(),this.initModules(),this.initPlugins(),e.image.isSpur&&(this.charFromInt=this.charFromIntSpur,this.charToInt=this.charToIntSpur,this.identityHash=this.identityHashSpur)},initDisplay:function(e){this.display=e},initModules:function(){this.loadedModules={},this.builtinModules={},this.patchModules={},this.interpreterProxy=new Squeak.InterpreterProxy(this.vm)},initPlugins:function(){}},"dispatch",{quickSendOther:function(e,t){switch(this.success=!0,t){case 0:return this.popNandPushIfOK(2,this.objectAt(!0,!0,!1));case 1:return this.popNandPushIfOK(3,this.objectAtPut(!0,!0,!1));case 2:return this.popNandPushIfOK(1,this.objectSize(!0));case 6:return this.popNandPushBoolIfOK(2,this.vm.stackValue(1)===this.vm.stackValue(0));case 7:return this.popNandPushIfOK(1,this.vm.getClass(this.vm.top()));case 8:return this.popNandPushIfOK(2,this.doBlockCopy());case 9:return this.primitiveBlockValue(0);case 10:return this.primitiveBlockValue(1)}return!1},doPrimitive:function(e,t,r){switch(this.success=!0,e){case 1:return this.popNandPushIntIfOK(t+1,this.stackInteger(1)+this.stackInteger(0));case 2:return this.popNandPushIntIfOK(t+1,this.stackInteger(1)-this.stackInteger(0));case 3:return this.popNandPushBoolIfOK(t+1,this.stackInteger(1)this.stackInteger(0));case 5:return this.popNandPushBoolIfOK(t+1,this.stackInteger(1)<=this.stackInteger(0));case 6:return this.popNandPushBoolIfOK(t+1,this.stackInteger(1)>=this.stackInteger(0));case 7:return this.popNandPushBoolIfOK(t+1,this.stackInteger(1)===this.stackInteger(0));case 8:return this.popNandPushBoolIfOK(t+1,this.stackInteger(1)!==this.stackInteger(0));case 9:return this.popNandPushIntIfOK(t+1,this.stackInteger(1)*this.stackInteger(0));case 10:return this.popNandPushIntIfOK(t+1,this.vm.quickDivide(this.stackInteger(1),this.stackInteger(0)));case 11:return this.popNandPushIntIfOK(t+1,this.vm.mod(this.stackInteger(1),this.stackInteger(0)));case 12:return this.popNandPushIntIfOK(t+1,this.vm.div(this.stackInteger(1),this.stackInteger(0)));case 13:return this.popNandPushIntIfOK(t+1,this.stackInteger(1)/this.stackInteger(0)|0);case 14:return this.popNandPushIfOK(t+1,this.doBitAnd());case 15:return this.popNandPushIfOK(t+1,this.doBitOr());case 16:return this.popNandPushIfOK(t+1,this.doBitXor());case 17:return this.popNandPushIfOK(t+1,this.doBitShift());case 18:return this.primitiveMakePoint(t,!1);case 19:return!1;case 20:return this.vm.warnOnce("missing primitive: 20 (primitiveRemLargeIntegers)"),!1;case 21:return this.vm.warnOnce("missing primitive: 21 (primitiveAddLargeIntegers)"),!1;case 22:return this.vm.warnOnce("missing primitive: 22 (primitiveSubtractLargeIntegers)"),!1;case 23:return this.primitiveLessThanLargeIntegers(t);case 24:return this.primitiveGreaterThanLargeIntegers(t);case 25:return this.primitiveLessOrEqualLargeIntegers(t);case 26:return this.primitiveGreaterOrEqualLargeIntegers(t);case 27:return this.primitiveEqualLargeIntegers(t);case 28:return this.primitiveNotEqualLargeIntegers(t);case 29:return this.vm.warnOnce("missing primitive: 29 (primitiveMultiplyLargeIntegers)"),!1;case 30:return this.vm.warnOnce("missing primitive: 30 (primitiveDivideLargeIntegers)"),!1;case 31:return this.vm.warnOnce("missing primitive: 31 (primitiveModLargeIntegers)"),!1;case 32:return this.vm.warnOnce("missing primitive: 32 (primitiveDivLargeIntegers)"),!1;case 33:return this.vm.warnOnce("missing primitive: 33 (primitiveQuoLargeIntegers)"),!1;case 34:return this.vm.warnOnce("missing primitive: 34 (primitiveBitAndLargeIntegers)"),!1;case 35:return this.vm.warnOnce("missing primitive: 35 (primitiveBitOrLargeIntegers)"),!1;case 36:return this.vm.warnOnce("missing primitive: 36 (primitiveBitXorLargeIntegers)"),!1;case 37:return this.vm.warnOnce("missing primitive: 37 (primitiveBitShiftLargeIntegers)"),!1;case 38:return this.popNandPushIfOK(t+1,this.objectAt(!1,!1,!1));case 39:return this.popNandPushIfOK(t+1,this.objectAtPut(!1,!1,!1));case 40:return this.popNandPushFloatIfOK(t+1,this.stackInteger(0));case 41:return this.popNandPushFloatIfOK(t+1,this.stackFloat(1)+this.stackFloat(0));case 42:return this.popNandPushFloatIfOK(t+1,this.stackFloat(1)-this.stackFloat(0));case 43:return this.popNandPushBoolIfOK(t+1,this.stackFloat(1)this.stackFloat(0));case 45:return this.popNandPushBoolIfOK(t+1,this.stackFloat(1)<=this.stackFloat(0));case 46:return this.popNandPushBoolIfOK(t+1,this.stackFloat(1)>=this.stackFloat(0));case 47:return this.popNandPushBoolIfOK(t+1,this.stackFloat(1)===this.stackFloat(0));case 48:return this.popNandPushBoolIfOK(t+1,this.stackFloat(1)!==this.stackFloat(0));case 49:return this.popNandPushFloatIfOK(t+1,this.stackFloat(1)*this.stackFloat(0));case 50:return this.popNandPushFloatIfOK(t+1,this.safeFDiv(this.stackFloat(1),this.stackFloat(0)));case 51:return this.popNandPushIfOK(t+1,this.floatAsSmallInt(this.stackFloat(0)));case 52:return this.popNandPushFloatIfOK(t+1,this.floatFractionPart(this.stackFloat(0)));case 53:return this.popNandPushIntIfOK(t+1,this.frexp_exponent(this.stackFloat(0))-1);case 54:return this.popNandPushFloatIfOK(t+1,this.ldexp(this.stackFloat(1),this.stackFloat(0)));case 55:return this.popNandPushFloatIfOK(t+1,Math.sqrt(this.stackFloat(0)));case 56:return this.popNandPushFloatIfOK(t+1,Math.sin(this.stackFloat(0)));case 57:return this.popNandPushFloatIfOK(t+1,Math.atan(this.stackFloat(0)));case 58:return this.popNandPushFloatIfOK(t+1,Math.log(this.stackFloat(0)));case 59:return this.popNandPushFloatIfOK(t+1,Math.exp(this.stackFloat(0)));case 60:return this.popNandPushIfOK(t+1,this.objectAt(!1,!1,!1));case 61:return this.popNandPushIfOK(t+1,this.objectAtPut(!1,!1,!1));case 62:return this.popNandPushIfOK(t+1,this.objectSize(!1));case 63:return this.popNandPushIfOK(t+1,this.objectAt(!1,!0,!1));case 64:return this.popNandPushIfOK(t+1,this.objectAtPut(!1,!0,!1));case 65:return this.vm.warnOnce("missing primitive: 65 (primitiveNext)"),!1;case 66:return this.vm.warnOnce("missing primitive: 66 (primitiveNextPut)"),!1;case 67:return this.vm.warnOnce("missing primitive: 67 (primitiveAtEnd)"),!1;case 68:return this.popNandPushIfOK(t+1,this.objectAt(!1,!1,!0));case 69:return this.popNandPushIfOK(t+1,this.objectAtPut(!1,!1,!0));case 70:return this.popNandPushIfOK(t+1,this.instantiateClass(this.stackNonInteger(0),0));case 71:return this.popNandPushIfOK(t+1,this.instantiateClass(this.stackNonInteger(1),this.stackPos32BitInt(0)));case 72:return this.primitiveArrayBecome(t,!1,!0);case 73:return this.popNandPushIfOK(t+1,this.objectAt(!1,!1,!0));case 74:return this.popNandPushIfOK(t+1,this.objectAtPut(!1,!1,!0));case 75:return this.popNandPushIfOK(t+1,this.identityHash(this.stackNonInteger(0)));case 76:return this.primitiveStoreStackp(t);case 77:return this.popNandPushIfOK(t+1,this.someInstanceOf(this.stackNonInteger(0)));case 78:return this.popNandPushIfOK(t+1,this.nextInstanceAfter(this.stackNonInteger(0)));case 79:return this.primitiveNewMethod(t);case 80:return this.popNandPushIfOK(t+1,this.doBlockCopy());case 81:return this.primitiveBlockValue(t);case 82:return this.primitiveBlockValueWithArgs(t);case 83:return this.vm.primitivePerform(t);case 84:return this.vm.primitivePerformWithArgs(t,!1);case 85:return this.primitiveSignal();case 86:return this.primitiveWait();case 87:return this.primitiveResume();case 88:return this.primitiveSuspend();case 89:return this.vm.flushMethodCache();case 90:return this.primitiveMousePoint(t);case 91:return this.primitiveTestDisplayDepth(t);case 92:return this.vm.warnOnce("missing primitive: 92 (primitiveSetDisplayMode)"),!1;case 93:return this.primitiveInputSemaphore(t);case 94:return this.primitiveGetNextEvent(t);case 95:return this.primitiveInputWord(t);case 96:return this.namedPrimitive("BitBltPlugin","primitiveCopyBits",t);case 97:return this.primitiveSnapshot(t);case 98:return this.primitiveStoreImageSegment(t);case 99:return this.primitiveLoadImageSegment(t);case 100:return this.vm.primitivePerformWithArgs(t,!0);case 101:return this.primitiveBeCursor(t);case 102:return this.primitiveBeDisplay(t);case 103:return this.primitiveScanCharacters(t);case 104:return this.vm.warnOnce("missing primitive: 104 (primitiveDrawLoop)"),!1;case 105:return this.popNandPushIfOK(t+1,this.doStringReplace());case 106:return this.primitiveScreenSize(t);case 107:return this.primitiveMouseButtons(t);case 108:return this.primitiveKeyboardNext(t);case 109:return this.primitiveKeyboardPeek(t);case 110:return this.popNandPushBoolIfOK(t+1,this.vm.stackValue(1)===this.vm.stackValue(0));case 111:return this.popNandPushIfOK(t+1,this.vm.getClass(this.vm.top()));case 112:return this.popNandPushIfOK(t+1,this.vm.image.bytesLeft());case 113:return this.primitiveQuit(t);case 114:return this.primitiveExitToDebugger(t);case 115:return this.primitiveChangeClass(t);case 116:return this.vm.flushMethodCacheForMethod(this.vm.top());case 117:return this.doNamedPrimitive(t,r);case 118:return this.primitiveDoPrimitiveWithArgs(t);case 119:return this.vm.flushMethodCacheForSelector(this.vm.top());case 120:return this.primitiveCalloutToFFI(t,r);case 121:return this.primitiveImageName(t);case 122:return this.primitiveReverseDisplay(t);case 123:return this.vm.warnOnce("missing primitive: 123 (primitiveValueUninterruptably)"),!1;case 124:return this.popNandPushIfOK(t+1,this.registerSemaphore(Squeak.splOb_TheLowSpaceSemaphore));case 125:return this.popNandPushIfOK(t+1,this.setLowSpaceThreshold());case 126:return this.primitiveDeferDisplayUpdates(t);case 127:return this.primitiveShowDisplayRect(t);case 128:return this.primitiveArrayBecome(t,!0,!0);case 129:return this.popNandPushIfOK(t+1,this.vm.image.specialObjectsArray);case 130:return this.primitiveFullGC(t);case 131:return this.primitivePartialGC(t);case 132:return this.popNandPushBoolIfOK(t+1,this.pointsTo(this.stackNonInteger(1),this.vm.top()));case 133:return this.popNIfOK(t);case 134:return this.popNandPushIfOK(t+1,this.registerSemaphore(Squeak.splOb_TheInterruptSemaphore));case 135:return this.popNandPushIfOK(t+1,this.millisecondClockValue());case 136:return this.primitiveSignalAtMilliseconds(t);case 137:return this.popNandPushIfOK(t+1,this.secondClock());case 138:return this.popNandPushIfOK(t+1,this.someObject());case 139:return this.popNandPushIfOK(t+1,this.nextObject(this.vm.top()));case 140:return this.primitiveBeep(t);case 141:return this.primitiveClipboardText(t);case 142:return this.popNandPushIfOK(t+1,this.makeStString(this.filenameToSqueak(Squeak.vmPath)));case 143:case 144:return this.primitiveShortAtAndPut(t);case 145:return this.primitiveConstantFill(t);case 146:return this.namedPrimitive("JoystickTabletPlugin","primitiveReadJoystick",t);case 147:return this.namedPrimitive("BitBltPlugin","primitiveWarpBits",t);case 148:return this.popNandPushIfOK(t+1,this.vm.image.clone(this.vm.top()));case 149:return this.primitiveGetAttribute(t);case 150:if(this.oldPrims)return this.primitiveFileAtEnd(t);case 151:if(this.oldPrims)return this.primitiveFileClose(t);case 152:if(this.oldPrims)return this.primitiveFileGetPosition(t);case 153:if(this.oldPrims)return this.primitiveFileOpen(t);case 154:if(this.oldPrims)return this.primitiveFileRead(t);case 155:if(this.oldPrims)return this.primitiveFileSetPosition(t);case 156:if(this.oldPrims)return this.primitiveFileDelete(t);case 157:if(this.oldPrims)return this.primitiveFileSize(t);break;case 158:return this.oldPrims?this.primitiveFileWrite(t):(this.vm.warnOnce("missing primitive: 158 (primitiveCompareWith)"),!1);case 159:return this.oldPrims?this.primitiveFileRename(t):this.popNandPushIntIfOK(t+1,1664525*this.stackSigned53BitInt(0)&268435455);case 160:return this.oldPrims?this.primitiveDirectoryCreate(t):this.primitiveAdoptInstance(t);case 161:return this.oldPrims?this.primitiveDirectoryDelimitor(t):(this.vm.warnOnce("missing primitive: 161 (primitiveSetIdentityHash)"),!1);case 162:if(this.oldPrims)return this.primitiveDirectoryLookup(t);break;case 163:return this.oldPrims?this.primitiveDirectoryDelete(t):(this.vm.warnOnce("missing primitive: 163 (primitiveGetImmutability)"),!1);case 164:return this.popNandPushIfOK(t+1,this.vm.trueObj);case 165:case 166:return this.primitiveIntegerAtAndPut(t);case 167:return!1;case 168:return this.primitiveCopyObject(t);case 169:return this.oldPrims?this.primitiveDirectorySetMacTypeAndCreator(t):this.popNandPushBoolIfOK(t+1,this.vm.stackValue(1)!==this.vm.stackValue(0));case 170:return this.oldPrims?this.namedPrimitive("SoundPlugin","primitiveSoundStart",t):this.primitiveAsCharacter(t);case 171:return this.oldPrims?this.namedPrimitive("SoundPlugin","primitiveSoundStartWithSemaphore",t):this.popNandPushIfOK(t+1,this.stackNonInteger(0).hash);case 172:return this.oldPrims?this.namedPrimitive("SoundPlugin","primitiveSoundStop",t):(this.vm.warnOnce("missing primitive: 172 (primitiveFetchMourner)"),this.popNandPushIfOK(t,this.vm.nilObj));case 173:return this.oldPrims?this.namedPrimitive("SoundPlugin","primitiveSoundAvailableSpace",t):this.popNandPushIfOK(t+1,this.objectAt(!1,!1,!0));case 174:return this.oldPrims?this.namedPrimitive("SoundPlugin","primitiveSoundPlaySamples",t):this.popNandPushIfOK(t+1,this.objectAtPut(!1,!1,!0));case 175:return this.oldPrims?this.namedPrimitive("SoundPlugin","primitiveSoundPlaySilence",t):this.vm.image.isSpur?this.popNandPushIfOK(t+1,this.behaviorHash(this.stackNonInteger(0))):(this.vm.warnOnce("primitive 175 called in non-spur image"),this.popNandPushIfOK(t+1,this.identityHash(this.stackNonInteger(0))));case 176:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primWaveTableSoundmixSampleCountintostartingAtpan",t):this.popNandPushIfOK(t+1,this.vm.image.isSpur?4194303:4095);case 177:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primFMSoundmixSampleCountintostartingAtpan",t):this.popNandPushIfOK(t+1,this.allInstancesOf(this.stackNonInteger(0)));case 178:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primPluckedSoundmixSampleCountintostartingAtpan",t):!1;case 179:if(this.oldPrims)return this.namedPrimitive("SoundGenerationPlugin","primSampledSoundmixSampleCountintostartingAtpan",t);break;case 180:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primitiveMixFMSound",t):!1;case 181:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primitiveMixPluckedSound",t):this.primitiveSizeInBytesOfInstance(t);case 182:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","oldprimSampledSoundmixSampleCountintostartingAtleftVolrightVol",t):this.primitiveSizeInBytes(t);case 183:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primitiveApplyReverb",t):this.primitiveIsPinned(t);case 184:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primitiveMixLoopedSampledSound",t):this.primitivePin(t);case 185:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primitiveMixSampledSound",t):this.primitiveExitCriticalSection(t);case 186:if(this.oldPrims)break;return this.primitiveEnterCriticalSection(t);case 187:if(this.oldPrims)break;return this.primitiveTestAndSetOwnershipOfCriticalSection(t);case 188:if(this.oldPrims)break;return this.primitiveExecuteMethodArgsArray(t);case 189:return this.oldPrims?this.namedPrimitive("SoundPlugin","primitiveSoundInsertSamples",t):!1;case 190:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundStartRecording",t);case 191:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundStopRecording",t);case 192:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundGetRecordingSampleRate",t);case 193:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundRecordSamples",t);case 194:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundSetRecordLevel",t);break;case 195:case 196:case 197:case 198:case 199:return!1;case 200:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveInitializeNetwork",t):this.primitiveClosureCopyWithCopiedValues(t);case 201:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverStartNameLookup",t):this.primitiveClosureValue(t);case 202:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverNameLookupResult",t):this.primitiveClosureValue(t);case 203:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverStartAddressLookup",t):this.primitiveClosureValue(t);case 204:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverAddressLookupResult",t):this.primitiveClosureValue(t);case 205:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverAbortLookup",t):this.primitiveClosureValue(t);case 206:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverLocalAddress",t):this.primitiveClosureValueWithArgs(t);case 207:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverStatus",t):this.primitiveFullClosureValue(t);case 208:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverError",t):this.primitiveFullClosureValueWithArgs(t);case 209:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketCreate",t):this.primitiveFullClosureValueNoContextSwitch(t);case 210:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketDestroy",t):this.popNandPushIfOK(t+1,this.objectAt(!1,!1,!1));case 211:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketConnectionStatus",t):this.popNandPushIfOK(t+1,this.objectAtPut(!1,!1,!1));case 212:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketError",t):this.popNandPushIfOK(t+1,this.objectSize(!1));case 213:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketLocalAddress",t);case 214:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketLocalPort",t);case 215:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketRemoteAddress",t);case 216:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketRemotePort",t);case 217:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketConnectToPort",t);case 218:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketListenOnPort",t):(this.vm.warnOnce("missing primitive: 218 (tryNamedPrimitiveInForWithArgs"),!1);case 219:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketCloseConnection",t);case 220:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketAbortConnection",t);break;case 221:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketReceiveDataBufCount",t):this.primitiveClosureValueNoContextSwitch(t);case 222:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketReceiveDataAvailable",t):this.primitiveClosureValueNoContextSwitch(t);case 223:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketSendDataBufCount",t);case 224:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketSendDone",t);break;case 230:return this.primitiveRelinquishProcessorForMicroseconds(t);case 231:return this.primitiveForceDisplayUpdate(t);case 232:return this.vm.warnOnce("missing primitive: 232 (primitiveFormPrint)"),!1;case 233:return this.primitiveSetFullScreen(t);case 234:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveDecompressFromByteArray",t);case 235:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveCompareString",t);case 236:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveConvert8BitSigned",t);case 237:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveCompressToByteArray",t);case 238:if(this.oldPrims)return this.namedPrimitive("SerialPlugin","primitiveSerialPortOpen",t);case 239:if(this.oldPrims)return this.namedPrimitive("SerialPlugin","primitiveSerialPortClose",t);break;case 240:return this.oldPrims?this.namedPrimitive("SerialPlugin","primitiveSerialPortWrite",t):this.popNandPushIfOK(t+1,this.microsecondClockUTC());case 241:return this.oldPrims?this.namedPrimitive("SerialPlugin","primitiveSerialPortRead",t):this.popNandPushIfOK(t+1,this.microsecondClockLocal());case 242:if(this.oldPrims)break;return this.primitiveSignalAtUTCMicroseconds(t);case 243:return this.oldPrims?this.namedPrimitive("MiscPrimitivePlugin","primitiveTranslateStringWithTable",t):(this.vm.warnOnce("missing primitive: 243 (primitiveUpdateTimeZone)"),!1);case 244:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveFindFirstInString",t);case 245:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveIndexOfAsciiInString",t);case 246:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveFindSubstring",t);break;case 248:return this.primitiveArrayBecome(t,!1,!1);case 249:return this.primitiveArrayBecome(t,!1,!0);case 254:return this.primitiveVMParameter(t);case 521:return this.namedPrimitive("MIDIPlugin","primitiveMIDIClosePort",t);case 522:return this.namedPrimitive("MIDIPlugin","primitiveMIDIGetClock",t);case 523:return this.namedPrimitive("MIDIPlugin","primitiveMIDIGetPortCount",t);case 524:return this.namedPrimitive("MIDIPlugin","primitiveMIDIGetPortDirectionality",t);case 525:return this.namedPrimitive("MIDIPlugin","primitiveMIDIGetPortName",t);case 526:return this.namedPrimitive("MIDIPlugin","primitiveMIDIOpenPort",t);case 527:return this.namedPrimitive("MIDIPlugin","primitiveMIDIParameterGetOrSet",t);case 528:return this.namedPrimitive("MIDIPlugin","primitiveMIDIRead",t);case 529:return this.namedPrimitive("MIDIPlugin","primitiveMIDIWrite",t);case 550:return this.namedPrimitive("ADPCMCodecPlugin","primitiveDecodeMono",t);case 551:return this.namedPrimitive("ADPCMCodecPlugin","primitiveDecodeStereo",t);case 552:return this.namedPrimitive("ADPCMCodecPlugin","primitiveEncodeMono",t);case 553:return this.namedPrimitive("ADPCMCodecPlugin","primitiveEncodeStereo",t);case 571:return this.primitiveUnloadModule(t);case 572:return this.primitiveListBuiltinModule(t);case 573:return this.primitiveListLoadedModule(t);case 575:return this.vm.warnOnce("missing primitive: 575 (primitiveHighBit)"),!1;case 576:return this.vm.primitiveInvokeObjectAsMethod(t,r);case 578:return this.vm.warnOnce("missing primitive: 578 (primitiveSuspendAndBackupPC)"),!1}return console.error("primitive "+e+" not implemented yet"),!1},namedPrimitive:function(e,t,r){var i=""===e?this:this.loadedModules[e];void 0===i&&(i=this.loadModule(e),this.loadedModules[e]=i);var a=!1,s=this.vm.sp;if(i){this.interpreterProxy.argCount=r;var n=i[t];"function"==typeof n?a=i[t](r):"string"==typeof n?a=this[n](r):this.vm.warnOnce("missing primitive: "+e+"."+t)}else this.vm.warnOnce("missing module: "+e+" ("+t+")");return(!0===a||!1!==a&&this.success)&&this.vm.sp!==s-r&&!this.vm.frozen&&this.vm.warnOnce("stack unbalanced after primitive "+e+"."+t,"error"),!0===a||!1===a?a:this.success},doNamedPrimitive:function(e,t){if(t.pointersSize()<2)return!1;var r=t.pointers[1];if(4!==r.pointersSize())return!1;this.primMethod=t;var i=r.pointers[0].bytesAsString(),a=r.pointers[1].bytesAsString();return this.namedPrimitive(i,a,e)},fakePrimitive:function(e,t,r){return this.vm.warnOnce("faking primitive: "+e),void 0===t?this.vm.popN(r):this.vm.popNandPush(r+1,this.makeStObject(t)),!0}},"modules",{loadModule:function(e){var t=Squeak.externalModules[e]||this.builtinModules[e]||this.loadModuleDynamically(e);if(!t)return null;if(this.patchModules[e]&&this.patchModule(t,e),t.setInterpreter&&!t.setInterpreter(this.interpreterProxy))return console.log("Wrong interpreter proxy version: "+e),null;var r=t.initialiseModule;return"function"==typeof r?t.initialiseModule():"string"==typeof r&&this[r](),this.interpreterProxy.failed()?(console.log("Module initialization failed: "+e),null):(console.log("Loaded module: "+e),t)},loadModuleDynamically:function(e){},patchModule:function(e,t){var r=this.patchModules[t];for(var i in r)e[i]=r[i]},unloadModule:function(e){var t=this.loadedModules[e];if(!e||!t||t===this)return null;delete this.loadedModules[e];var r=t.unloadModule;return"function"==typeof r?t.unloadModule(this):"string"==typeof r&&this[r](this),console.log("Unloaded module: "+e),t},loadFunctionFrom:function(e,t){var r=""===t?this:this.loadedModules[t];if(void 0===r&&(r=this.loadModule(t),this.loadedModules[t]=r),!r)return null;var i=r[e];return"function"==typeof i?i.bind(r):"string"==typeof i?this[i].bind(this):(this.vm.warnOnce("missing primitive: "+t+"."+e),null)},primitiveUnloadModule:function(e){var t=this.stackNonInteger(0).bytesAsString();return!!t&&(this.unloadModule(t),this.popNIfOK(e))},primitiveListBuiltinModule:function(e){var t=this.stackInteger(0)-1;if(!this.success)return!1;var r=Object.keys(this.builtinModules);return this.popNandPushIfOK(e+1,this.makeStObject(r[t]))},primitiveListLoadedModule:function(e){var t=this.stackInteger(0)-1;if(!this.success)return!1;var r=[];for(var i in this.loadedModules){var a=this.loadedModules[i];if(a){var s=a.getModuleName?a.getModuleName():i;r.push(s)}}return this.popNandPushIfOK(e+1,this.makeStObject(r[t]))}},"stack access",{popNIfOK:function(e){return!!this.success&&(this.vm.popN(e),!0)},pop2andPushBoolIfOK:function(e){return this.vm.success=this.success,this.vm.pop2AndPushBoolResult(e)},popNandPushBoolIfOK:function(e,t){return!!this.success&&(this.vm.popNandPush(e,t?this.vm.trueObj:this.vm.falseObj),!0)},popNandPushIfOK:function(e,t){return!(!this.success||null==t)&&(this.vm.popNandPush(e,t),!0)},popNandPushIntIfOK:function(e,t){return!(!this.success||!this.vm.canBeSmallInt(t))&&(this.vm.popNandPush(e,t),!0)},popNandPushFloatIfOK:function(e,t){return!!this.success&&(this.vm.popNandPush(e,this.makeFloat(t)),!0)},stackNonInteger:function(e){return this.checkNonInteger(this.vm.stackValue(e))},stackInteger:function(e){return this.checkSmallInt(this.vm.stackValue(e))},stackPos32BitInt:function(e){return this.positive32BitValueOf(this.vm.stackValue(e))},pos32BitIntFor:function(e){if(0<=e&&e<=Squeak.MaxSmallInt)return e;for(var t=this.vm.specialObjects[Squeak.splOb_ClassLargePositiveInteger],r=this.vm.instantiateClass(t,4),i=r.bytes,a=0;a<4;a++)i[a]=e>>>8*a&255;return r},pos53BitIntFor:function(e){if(e<=4294967295)return this.pos32BitIntFor(e);if(9007199254740991=Squeak.MinSmallInt&&e<=Squeak.MaxSmallInt)return e;for(var t=e<0,r=t?-e:e,i=t?Squeak.splOb_ClassLargeNegativeInteger:Squeak.splOb_ClassLargePositiveInteger,a=this.vm.instantiateClass(this.vm.specialObjects[i],4),s=a.bytes,n=0;n<4;n++)s[n]=r>>>8*n&255;return a},stackFloat:function(e){return this.checkFloat(this.vm.stackValue(e))},stackBoolean:function(e){return this.checkBoolean(this.vm.stackValue(e))},stackSigned53BitInt:function(e){var t=this.vm.stackValue(e);if("number"==typeof t)return t;var r=t.bytesSize();if(r<=7){for(var i=t.bytes,a=0,s=0,n=1;s>>20&2047;return 0===r&&(t.setFloat64(0,e*Math.pow(2,64)),r=(t.getUint32(0)>>>20&2047)-64),r-1022},ldexp:function(e,t){for(var r=Math.min(3,Math.ceil(Math.abs(t)/1023)),i=e,a=0;athis.stackSigned53BitInt(0))},primitiveLessOrEqualLargeIntegers:function(e){return this.popNandPushBoolIfOK(e+1,this.stackSigned53BitInt(1)<=this.stackSigned53BitInt(0))},primitiveGreaterOrEqualLargeIntegers:function(e){return this.popNandPushBoolIfOK(e+1,this.stackSigned53BitInt(1)>=this.stackSigned53BitInt(0))},primitiveEqualLargeIntegers:function(e){return this.popNandPushBoolIfOK(e+1,this.stackSigned53BitInt(1)===this.stackSigned53BitInt(0))},primitiveNotEqualLargeIntegers:function(e){return this.popNandPushBoolIfOK(e+1,this.stackSigned53BitInt(1)!==this.stackSigned53BitInt(0))}},"utils",{floatOrInt:function(e){return e.isFloat?e.float:"number"==typeof e?e:0},positive32BitValueOf:function(e){if("number"==typeof e)return 0<=e?e:(this.success=!1,0);if(!this.isA(e,Squeak.splOb_ClassLargePositiveInteger)||4!==e.bytesSize())return this.success=!1,0;for(var t=e.bytes,r=0,i=0,a=1;i<4;i++,a*=256)r+=t[i]*a;return r},checkFloat:function(e){return e.isFloat?e.float:"number"==typeof e?e:(this.success=!1,0)},checkSmallInt:function(e){return"number"==typeof e?e:(this.success=!1,0)},checkNonInteger:function(e){return"number"!=typeof e?e:(this.success=!1,this.vm.nilObj)},checkBoolean:function(e){return!!e.isTrue||!e.isFalse&&(this.success=!1)},indexableSize:function(e){return"number"==typeof e?-1:e.indexableSize(this)},isA:function(e,t){return e.sqClass===this.vm.specialObjects[t]},isKindOf:function(e,t){for(var r=e.sqClass,i=this.vm.specialObjects[t];!r.isNil;){if(r===i)return!0;r=r.pointers[Squeak.Class_superclass]}return!1},isAssociation:function(e){return"number"!=typeof e&&2==e.pointersSize()},ensureSmallInt:function(e){return e===(0|e)&&this.vm.canBeSmallInt(e)?e:(this.success=!1,0)},charFromInt:function(e){var t=this.vm.specialObjects[Squeak.splOb_CharacterTable].pointers[e];if(t)return t;var r=this.vm.specialObjects[Squeak.splOb_ClassCharacter];return(t=this.vm.instantiateClass(r,0)).pointers[0]=e,t},charFromIntSpur:function(e){return this.vm.image.getCharacter(e)},charToInt:function(e){return e.pointers[0]},charToIntSpur:function(e){return e.hash},makeFloat:function(e){var t=this.vm.specialObjects[Squeak.splOb_ClassFloat],r=this.vm.instantiateClass(t,2);return r.float=e,r},makeLargeIfNeeded:function(e){return this.vm.canBeSmallInt(e)?e:this.makeLargeInt(e)},makeLargeInt:function(e){if(e<0)throw Error("negative large ints not implemented yet");if(4294967295i.size)return this.success=!1,a;if(r)return a.pointers[s-1];if(a.isPointers())return a.pointers[s-1+i.ivarOffset];if(a.isWords())return i.convertChars?this.charFromInt(1073741823&a.words[s-1]):this.pos32BitIntFor(a.words[s-1]);if(a.isBytes())return i.convertChars?this.charFromInt(255&a.bytes[s-1]):255&a.bytes[s-1];var o=4*a.pointersSize();return s-1-o<0?(this.success=!1,a):255&a.bytes[s-1-o]},objectAtPut:function(e,t,r){var i,a=this.stackNonInteger(2),s=this.stackPos32BitInt(1);if(!this.success)return a;if(e){if((i=this.atPutCache[a.hash&this.atCacheMask]).array!==a)return this.success=!1,a}else{if(a.isFloat){var n=this.stackPos32BitInt(0);if(!this.success||1!=s&&2!=s)this.success=!1;else{var o=a.floatData();o.setUint32(1==s?0:4,n,!1),a.float=o.getFloat64(0)}return this.vm.stackValue(0)}i=this.makeAtCacheInfo(this.atPutCache,this.vm.specialSelectors[34],a,t,r)}if(s<1||s>i.size)return this.success=!1,a;var u,l=this.vm.stackValue(0);if(r)return a.dirty=!0,a.pointers[s-1]=l;if(a.isPointers())return a.dirty=!0,a.pointers[s-1+i.ivarOffset]=l;if(a.isWords()){if(t){if(l.sqClass!==this.vm.specialObjects[Squeak.splOb_ClassCharacter])return this.success=!1,l;if("number"!=typeof(u=this.charToInt(l)))return this.success=!1,l}else u=this.stackPos32BitInt(0);return this.success&&(a.words[s-1]=u),l}if(t){if(l.sqClass!==this.vm.specialObjects[Squeak.splOb_ClassCharacter])return this.success=!1,l;if("number"!=typeof(u=this.charToInt(l)))return this.success=!1,l}else{if("number"!=typeof l)return this.success=!1,l;u=l}if(u<0||255this.vm.image.bytesLeft()?(console.warn("squeak: out of memory, failing allocation"),this.success=!1,this.vm.primFailCode=Squeak.PrimErrNoMemory,null):this.vm.instantiateClass(e,t)},someObject:function(){return this.vm.image.firstOldObject},nextObject:function(e){return this.vm.image.objectAfter(e)||0},someInstanceOf:function(e){var t=this.vm.image.someInstanceOf(e);return t||(this.success=!1,0)},nextInstanceAfter:function(e){var t=this.vm.image.nextInstanceAfter(e);return t||(this.success=!1,0)},allInstancesOf:function(e){var t=this.vm.image.allInstancesOf(e),r=this.vm.instantiateClass(this.vm.specialObjects[Squeak.splOb_ClassArray],t.length);return r.pointers=t,r},identityHash:function(e){return e.hash},identityHashSpur:function(e){var t=e.hash;return 0=t.pointers.length)return!1;for(var i=t.pointers[Squeak.Context_stackPointer];i=a)return!1;this.vm.popN(2);for(var s=0;s=a.length)return!1;if(e<2)t=a[i];else{if((t=this.stackInteger(0))<-32768||32767=a.length)return!1;if(e<2)t=this.signed32BitIntegerFor(a[i]);else{if(t=this.stackSigned32BitInt(0),!this.success)return!1;a[i]=t}return this.popNandPushIfOK(e+1,t),!0},primitiveConstantFill:function(e){var t=this.stackNonInteger(1),r=this.stackPos32BitInt(0);if(!this.success||!t.isWordsOrBytes())return!1;var i=t.words||t.bytes;if(i){if(i===t.bytes&&255t)a=r[t];else{if(!(t<0&&i&&i.length>-t-1))return!1;a=i[-t-1]}}return this.vm.popNandPush(e+1,this.makeStObject(a)),!0},setLowSpaceThreshold:function(){var e=this.stackInteger(0);return this.success&&(this.vm.lowSpaceThreshold=e),this.vm.stackValue(1)},primitiveVMParameter:function(e){var t=this.vm.image.isSpur?71:44;switch(e){case 0:for(var r=this.vm.instantiateClass(this.vm.specialObjects[Squeak.splOb_ClassArray],t),i=0;i","<=",">=","=","~=","*","/","\\\\","@","bitShift:","//","bitAnd:","bitOr:","at:","at:put:","size","next","nextPut:","atEnd","==","class","blockCopy:","value","value:","do:","new","new:","x","y"],this.doitCounter=0}},"accessing",{compile:function(e,t,r){if(!e.methodSignFlag())if(void 0===e.compiled)e.compiled=!1;else{this.singleStep=!1,this.debug=this.comments;var i=t&&t.className(),a=r&&r.bytesAsString();e.compiled=this.generate(e,i,a)}},enableSingleStepping:function(i,a,s){if(!i.compiled||!i.compiled.canSingleStep){this.singleStep=!0,this.debug=!0,a||this.vm.allMethodsDo(function(e,t,r){if(t===i)return a=e,s=r,!0});var e=a&&a.className(),t=s&&s.bytesAsString(),r=a&&a.allInstVarNames();i.compiled=this.generate(i,e,t,r),i.compiled.canSingleStep=!0}return!0},functionNameFor:function(e,t){if(void 0===e||"?"===e)return"DOIT_"+ ++this.doitCounter;if(!/[^a-zA-Z0-9:_]/.test(t))return(e+"_"+t).replace(/[: ]/g,"_");var r=t.replace(/./g,function(e){return{"|":"OR","~":"NOT","<":"LT","=":"EQ",">":"GT","&":"AND","@":"AT","*":"TIMES","+":"PLUS","\\":"MOD","-":"MINUS",",":"COMMA","/":"DIV","?":"IF"}[e]||"OPERATOR"});return e.replace(/[ ]/,"_")+"__"+r+"__"}},"generating",{generate:function(e,t,r,i){for(this.method=e,this.pc=0,this.endPC=0,this.prevPC=0,this.source=[],this.sourceLabels={},this.needsLabel={},this.sourcePos={},this.needsVar={},this.needsBreak=!1,t&&r&&this.source.push("// ",t,">>",r,"\n"),this.instVarNames=i,this.allVars=["context","stack","rcvr","inst[","temp[","lit["],this.sourcePos.context=this.source.length,this.source.push("var context = vm.activeContext;\n"),this.sourcePos.stack=this.source.length,this.source.push("var stack = context.pointers;\n"),this.sourcePos.rcvr=this.source.length,this.source.push("var rcvr = vm.receiver;\n"),this.sourcePos["inst["]=this.source.length,this.source.push("var inst = rcvr.pointers;\n"),this.sourcePos["temp["]=this.source.length,this.source.push("var temp = vm.homeContext.pointers;\n"),this.sourcePos["lit["]=this.source.length,this.source.push("var lit = vm.method.pointers;\n"),this.sourcePos["loop-start"]=this.source.length,this.source.push("while (true) switch (vm.pc) {\ncase 0:\n"),this.done=!1;!this.done;){var a=e.bytes[this.pc++],s=0;switch(248&a){case 0:case 8:this.generatePush("inst[",15&a,"]");break;case 16:case 24:this.generatePush("temp[",6+(15&a),"]");break;case 32:case 40:case 48:case 56:this.generatePush("lit[",1+(31&a),"]");break;case 64:case 72:case 80:case 88:this.generatePush("lit[",1+(31&a),"].pointers[1]");break;case 96:this.generatePopInto("inst[",7&a,"]");break;case 104:this.generatePopInto("temp[",6+(7&a),"]");break;case 112:switch(a){case 112:this.generatePush("rcvr");break;case 113:this.generatePush("vm.trueObj");break;case 114:this.generatePush("vm.falseObj");break;case 115:this.generatePush("vm.nilObj");break;case 116:this.generatePush("-1");break;case 117:this.generatePush("0");break;case 118:this.generatePush("1");break;case 119:this.generatePush("2")}break;case 120:switch(a){case 120:this.generateReturn("rcvr");break;case 121:this.generateReturn("vm.trueObj");break;case 122:this.generateReturn("vm.falseObj");break;case 123:this.generateReturn("vm.nilObj");break;case 124:this.generateReturn("stack[vm.sp]");break;case 125:this.generateBlockReturn();break;default:throw Error("unusedBytecode")}break;case 128:case 136:this.generateExtended(a);break;case 144:this.generateJump(1+(7&a));break;case 152:this.generateJumpIf(!1,1+(7&a));break;case 160:s=e.bytes[this.pc++],this.generateJump(256*((7&a)-4)+s);break;case 168:s=e.bytes[this.pc++],this.generateJumpIf(a<172,256*(3&a)+s);break;case 176:case 184:this.generateNumericOp(a);break;case 192:case 200:this.generateQuickPrim(a);break;case 208:case 216:this.generateSend("lit[",1+(15&a),"]",0,!1);break;case 224:case 232:this.generateSend("lit[",1+(15&a),"]",1,!1);break;case 240:case 248:this.generateSend("lit[",1+(15&a),"]",2,!1)}}var n=this.functionNameFor(t,r);return this.singleStep?(this.debug&&this.source.push("// all valid PCs have a label;\n"),this.source.push("default: throw Error('invalid PC');\n}")):(this.sourcePos["loop-end"]=this.source.length,this.source.push("default: vm.interpretOne(true); return;\n}"),this.deleteUnneededLabels()),this.deleteUnneededVariables(),new Function("'use strict';\nreturn function "+n+"(vm) {\n"+this.source.join("")+"}")()},generateExtended:function(e){var t,r;switch(e){case 128:switch((t=this.method.bytes[this.pc++])>>6){case 0:return void this.generatePush("inst[",63&t,"]");case 1:return void this.generatePush("temp[",6+(63&t),"]");case 2:return void this.generatePush("lit[",1+(63&t),"]");case 3:return void this.generatePush("lit[",1+(63&t),"].pointers[1]")}case 129:switch((t=this.method.bytes[this.pc++])>>6){case 0:return void this.generateStoreInto("inst[",63&t,"]");case 1:return void this.generateStoreInto("temp[",6+(63&t),"]");case 2:throw Error("illegal store into literal");case 3:return void this.generateStoreInto("lit[",1+(63&t),"].pointers[1]")}return;case 130:switch((t=this.method.bytes[this.pc++])>>6){case 0:return void this.generatePopInto("inst[",63&t,"]");case 1:return void this.generatePopInto("temp[",6+(63&t),"]");case 2:throw Error("illegal pop into literal");case 3:return void this.generatePopInto("lit[",1+(63&t),"].pointers[1]")}case 131:return t=this.method.bytes[this.pc++],void this.generateSend("lit[",1+(31&t),"]",t>>5,!1);case 132:switch(t=this.method.bytes[this.pc++],r=this.method.bytes[this.pc++],t>>5){case 0:return void this.generateSend("lit[",1+r,"]",31&t,!1);case 1:return void this.generateSend("lit[",1+r,"]",31&t,!0);case 2:return void this.generatePush("inst[",r,"]");case 3:return void this.generatePush("lit[",1+r,"]");case 4:return void this.generatePush("lit[",1+r,"].pointers[1]");case 5:return void this.generateStoreInto("inst[",r,"]");case 6:return void this.generatePopInto("inst[",r,"]");case 7:return void this.generateStoreInto("lit[",1+r,"].pointers[1]")}case 133:return t=this.method.bytes[this.pc++],void this.generateSend("lit[",1+(31&t),"]",t>>5,!0);case 134:return t=this.method.bytes[this.pc++],void this.generateSend("lit[",1+(63&t),"]",t>>6,!1);case 135:return void this.generateInstruction("pop","vm.sp--");case 136:return this.needsVar.stack=!0,void this.generateInstruction("dup","var dup = stack[vm.sp]; stack[++vm.sp] = dup");case 137:return this.needsVar.stack=!0,void this.generateInstruction("push thisContext","stack[++vm.sp] = vm.exportThisContext()");case 138:var i=127<(t=this.method.bytes[this.pc++]),a=127&t;return void this.generateClosureTemps(a,i);case 139:return t=this.method.bytes[this.pc++],r=this.method.bytes[this.pc++],void this.generateCallPrimitive(t+256*r);case 140:return t=this.method.bytes[this.pc++],r=this.method.bytes[this.pc++],void this.generatePush("temp[",6+r,"].pointers[",t,"]");case 141:return t=this.method.bytes[this.pc++],r=this.method.bytes[this.pc++],void this.generateStoreInto("temp[",6+r,"].pointers[",t,"]");case 142:return t=this.method.bytes[this.pc++],r=this.method.bytes[this.pc++],void this.generatePopInto("temp[",6+r,"].pointers[",t,"]");case 143:var s=15&(t=this.method.bytes[this.pc++]),n=t>>4,o=(r=this.method.bytes[this.pc++])<<8|this.method.bytes[this.pc++];return void this.generateClosureCopy(s,n,o)}},generatePush:function(e,t,r,i,a){this.debug&&this.generateDebugCode("push",e,t,r,i,a),this.generateLabel(),this.needsVar[e]=!0,this.needsVar.stack=!0,this.source.push("stack[++vm.sp] = ",e),void 0!==t&&(this.source.push(t,r),void 0!==i&&this.source.push(i,a)),this.source.push(";\n")},generateStoreInto:function(e,t,r,i,a){this.debug&&this.generateDebugCode("store into",e,t,r,i,a),this.generateLabel(),this.needsVar[e]=!0,this.needsVar.stack=!0,this.source.push(e),void 0!==t&&(this.source.push(t,r),void 0!==i&&this.source.push(i,a)),this.source.push(" = stack[vm.sp];\n"),this.generateDirty(e,t)},generatePopInto:function(e,t,r,i,a){this.debug&&this.generateDebugCode("pop into",e,t,r,i,a),this.generateLabel(),this.needsVar[e]=!0,this.needsVar.stack=!0,this.source.push(e),void 0!==t&&(this.source.push(t,r),void 0!==i&&this.source.push(i,a)),this.source.push(" = stack[vm.sp--];\n"),this.generateDirty(e,t)},generateReturn:function(e){this.debug&&this.generateDebugCode("return",e),this.generateLabel(),this.needsVar[e]=!0,this.source.push("vm.pc = ",this.pc,"; vm.doReturn(",e,"); return;\n"),this.needsBreak=!1,this.done=this.pc>this.endPC},generateBlockReturn:function(){this.debug&&this.generateDebugCode("block return"),this.generateLabel(),this.needsVar.stack=!0,this.source.push("vm.pc = ",this.pc,"; vm.doReturn(stack[vm.sp--], context.pointers[0]); return;\n"),this.needsBreak=!1},generateJump:function(e){var t=this.pc+e;this.debug&&this.generateDebugCode("jump to "+t),this.generateLabel(),this.needsVar.context=!0,this.source.push("vm.pc = ",t,"; "),e<0&&this.source.push("\nif (vm.interruptCheckCounter-- <= 0) {\n"," vm.checkForInterrupts();\n"," if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return;\n","}\n"),this.singleStep&&this.source.push("\nif (vm.breakOutOfInterpreter) return;\n"),this.source.push("continue;\n"),this.needsBreak=!1,this.needsLabel[t]=!0,t>this.endPC&&(this.endPC=t)},generateJumpIf:function(e,t){var r=this.pc+t;this.debug&&this.generateDebugCode("jump if "+e+" to "+r),this.generateLabel(),this.needsVar.stack=!0,this.source.push("var cond = stack[vm.sp--]; if (cond === vm.",e,"Obj) {vm.pc = ",r,"; "),this.singleStep&&this.source.push("if (vm.breakOutOfInterpreter) return; else "),this.source.push("continue}\n","else if (cond !== vm.",!e,"Obj) {vm.sp++; vm.pc = ",this.pc,"; vm.send(vm.specialObjects[25], 0, false); return}\n"),this.needsLabel[this.pc]=!0,this.needsLabel[r]=!0,r>this.endPC&&(this.endPC=r)},generateQuickPrim:function(e){switch(this.debug&&this.generateDebugCode("quick send #"+this.specialSelectors[16+(15&e)]),this.generateLabel(),e){case 192:return this.needsVar.stack=!0,this.source.push("var a, b; if ((a=stack[vm.sp-1]).sqClass === vm.specialObjects[7] && typeof (b=stack[vm.sp]) === 'number' && b>0 && b<=a.pointers.length) {\n"," stack[--vm.sp] = a.pointers[b-1];","} else { var c = vm.primHandler.objectAt(true,true,false); if (vm.primHandler.success) stack[--vm.sp] = c; else {\n"," vm.pc = ",this.pc,"; vm.sendSpecial(16); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return; }}\n"),void(this.needsLabel[this.pc]=!0);case 193:return this.needsVar.stack=!0,this.source.push("var a, b; if ((a=stack[vm.sp-2]).sqClass === vm.specialObjects[7] && typeof (b=stack[vm.sp-1]) === 'number' && b>0 && b<=a.pointers.length) {\n"," var c = stack[vm.sp]; stack[vm.sp-=2] = a.pointers[b-1] = c; a.dirty = true;","} else { vm.primHandler.objectAtPut(true,true,false); if (vm.primHandler.success) stack[vm.sp-=2] = c; else {\n"," vm.pc = ",this.pc,"; vm.sendSpecial(17); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return; }}\n"),void(this.needsLabel[this.pc]=!0);case 194:return this.needsVar.stack=!0,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; }\n"),void(this.needsLabel[this.pc]=!0);case 198:return this.needsVar.stack=!0,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 this.needsVar.stack=!0,void this.source.push("stack[vm.sp] = typeof stack[vm.sp] === 'number' ? vm.specialObjects[5] : stack[vm.sp].sqClass;\n");case 200:return this.needsVar.rcvr=!0,this.source.push("vm.pc = ",this.pc,"; if (!vm.primHandler.quickSendOther(rcvr, ",15&e,")) ","{vm.sendSpecial(",16+(15&e),"); return}\n"),this.needsLabel[this.pc]=!0,void(this.needsLabel[this.pc+2]=!0);case 201:case 202:case 203:return this.needsVar.rcvr=!0,this.source.push("vm.pc = ",this.pc,"; if (!vm.primHandler.quickSendOther(rcvr, ",15&e,")) vm.sendSpecial(",16+(15&e),"); return;\n"),void(this.needsLabel[this.pc]=!0)}this.needsVar.rcvr=!0,this.needsVar.context=!0,this.source.push("vm.pc = ",this.pc,"; if (!vm.primHandler.quickSendOther(rcvr, ",15&e,"))"," vm.sendSpecial(",16+(15&e),");\n","if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return;\n"),this.needsBreak=!1,this.needsLabel[this.pc]=!0},generateNumericOp:function(e){switch(this.debug&&this.generateDebugCode("quick send #"+this.specialSelectors[15&e]),this.generateLabel(),this.needsLabel[this.pc]=!0,e){case 176:return this.needsVar.stack=!0,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}\n");case 177:return this.needsVar.stack=!0,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}\n");case 178:return this.needsVar.stack=!0,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}\n");case 179:return this.needsVar.stack=!0,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}\n");case 180:return this.needsVar.stack=!0,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(4); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return}\n");case 181:return this.needsVar.stack=!0,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(5); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return}\n");case 182:return this.needsVar.stack=!0,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 if (a === b && a.float === a.float) {\n"," stack[--vm.sp] = vm.trueObj;\n","} else { vm.pc = ",this.pc,"; vm.sendSpecial(6); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return}\n");case 183:return this.needsVar.stack=!0,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 if (a === b && a.float === a.float) {\n"," stack[--vm.sp] = vm.falseObj;\n","} else { vm.pc = ",this.pc,"; vm.sendSpecial(7); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return}\n");case 184:return void this.source.push("vm.success = true; vm.resultIsFloat = false; if(!vm.pop2AndPushNumResult(vm.stackIntOrFloat(1) * vm.stackIntOrFloat(0))) { vm.pc = ",this.pc,"; vm.sendSpecial(8); return}\n");case 185:return void this.source.push("vm.success = true; if(!vm.pop2AndPushIntResult(vm.quickDivide(vm.stackInteger(1),vm.stackInteger(0)))) { vm.pc = ",this.pc,"; vm.sendSpecial(9); return}\n");case 186:return void this.source.push("vm.success = true; if(!vm.pop2AndPushIntResult(vm.mod(vm.stackInteger(1),vm.stackInteger(0)))) { vm.pc = ",this.pc,"; vm.sendSpecial(10); return}\n");case 187:return void this.source.push("vm.success = true; if(!vm.primHandler.primitiveMakePoint(1, true)) { vm.pc = ",this.pc,"; vm.sendSpecial(11); return}\n");case 188:return void this.source.push("vm.success = true; if(!vm.pop2AndPushIntResult(vm.safeShift(vm.stackInteger(1),vm.stackInteger(0)))) { vm.pc = ",this.pc,"; vm.sendSpecial(12); return}\n");case 189:return void this.source.push("vm.success = true; if(!vm.pop2AndPushIntResult(vm.div(vm.stackInteger(1),vm.stackInteger(0)))) { vm.pc = ",this.pc,"; vm.sendSpecial(13); return}\n");case 190:return void this.source.push("vm.success = true; if(!vm.pop2AndPushIntResult(vm.stackInteger(1) & vm.stackInteger(0))) { vm.pc = ",this.pc,"; vm.sendSpecial(14); return}\n");case 191:return void this.source.push("vm.success = true; if(!vm.pop2AndPushIntResult(vm.stackInteger(1) | vm.stackInteger(0))) { vm.pc = ",this.pc,"; vm.sendSpecial(15); return}\n")}},generateSend:function(e,t,r,i,a){this.debug&&this.generateDebugCode("send "+("lit["===e?this.method.pointers[t].bytesAsString():"...")),this.generateLabel(),this.needsVar[e]=!0,this.needsVar.context=!0,this.source.push("vm.pc = ",this.pc,"; vm.send(",e,t,r,", ",i,", ",a,"); ","if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return;\n"),this.needsBreak=!1,this.needsLabel[this.pc]=!0},generateClosureTemps:function(e,t){if(this.debug&&this.generateDebugCode("closure temps"),this.generateLabel(),this.needsVar.stack=!0,this.source.push("var array = vm.instantiateClass(vm.specialObjects[7], ",e,");\n"),t){for(var r=0;rthis.endPC&&(this.endPC=a)},generateCallPrimitive:function(e){this.debug&&this.generateDebugCode("call primitive "+e),this.generateLabel(),129===this.method.bytes[this.pc]&&(this.needsVar.stack=!0,this.source.push("if (vm.primFailCode) {stack[vm.sp] = vm.getErrorObjectFromPrimFailCode(); vm.primFailCode = 0;}\n"))},generateDirty:function(e,t){switch(e){case"inst[":this.source.push("rcvr.dirty = true;\n");break;case"lit[":this.source.push(e,t,"].dirty = true;\n");break;case"temp[":break;default:throw Error("unexpected target "+e)}},generateLabel:function(){this.prevPC&&(this.sourceLabels[this.prevPC]=this.source.length,this.source.push("case ",this.prevPC,":\n")),this.prevPC=this.pc},generateDebugCode:function(e,t,r,i,a,s){this.needsBreak&&(this.source.push("if (vm.breakOutOfInterpreter) {vm.pc = ",this.prevPC,"; return}\n"),this.needsLabel[this.prevPC]=!0);for(var n=[],o=this.prevPC;o ",e),t)switch(this.source.push(" "),t){case"vm.nilObj":this.source.push("nil");break;case"vm.trueObj":this.source.push("true");break;case"vm.falseObj":this.source.push("false");break;case"rcvr":this.source.push("self");break;case"stack[vm.sp]":this.source.push("top of stack");break;case"inst[":this.instVarNames?this.source.push(this.instVarNames[r]):this.source.push("inst var ",r);break;case"temp[":this.source.push("tmp",r-6),"]"!==i&&this.source.push("[",a,"]");break;case"lit[":var u=this.method.pointers[r];"]"===i?this.source.push(u):this.source.push(u.pointers[0].bytesAsString());break;default:this.source.push(t)}this.source.push("\n"),this.needsBreak=this.singleStep},generateInstruction:function(e,t){this.debug&&this.generateDebugCode(e),this.generateLabel(),this.source.push(t,";\n")},deleteUnneededLabels:function(){var e=!1;for(var t in this.sourceLabels)if(this.needsLabel[t])e=!0;else for(var r=0;r<3;r++)this.source[this.sourceLabels[t]+r]="";e||(this.source[this.sourcePos["loop-start"]]="",this.source[this.sourcePos["loop-end"]]="")},deleteUnneededVariables:function(){this.needsVar.stack&&(this.needsVar.context=!0),this.needsVar["inst["]&&(this.needsVar.rcvr=!0);for(var e=0;e>u|(a&n)>>u+1,n>>>=1;r[i]=o}return{obj:e.obj,bits:r,depth:2,width:16,height:16,offsetX:e.offsetX,offsetY:e.offsetY,msb:!0,pixPerWord:16,pitch:1}},primitiveBeDisplay:function(e){var t=this.vm.stackValue(0);return this.vm.specialObjects[Squeak.splOb_TheDisplay]=t,this.vm.popN(e),!0},primitiveReverseDisplay:function(e){if(this.reverseDisplay=!this.reverseDisplay,this.redrawDisplay(),this.display.cursorCanvas){for(var t=this.display.cursorCanvas,r=t.getContext("2d"),i=r.getImageData(0,0,t.width,t.height),a=new Uint32Array(i.data.buffer),s=0;sr.left&&(r.left=e.left),e.rightr.top&&(r.top=e.top),e.bottom>16)+((255&O)<<16);h[f]=d}this.swappedColors=h}this.reverseDisplay&&(h=i?i.map(function(e){return 16777215^e}):(this.reversedColors||(this.reversedColors=h.map(function(e){return 16777215^e})),this.reversedColors));for(var p=(1<>>g&p],(g-=t.depth)<0&&(g=32-t.depth,k=t.bits[++v]);s++}break;case 16:for(b=a%2?0:16,m=0;m>>g;c[_++]=((31744&y)>>7)+((992&y)<<6)+((31&y)<<19)+4278190080,(g-=16)<0&&(g=16,k=t.bits[++v])}s++}break;case 32:var I=i?0:4278190080;for(m=0;m>16|(255&O)<<16|I;c[_++]=d}s++}break;default:throw Error("depth not implemented")}u.data!==l&&u.data.set(l),e.putImageData(u,r.left,r.top)}},primitiveDeferDisplayUpdates:function(e){var t=this.stackBoolean(0);return!!this.success&&(this.deferDisplayUpdates=t,this.vm.popN(e),!0)},primitiveForceDisplayUpdate:function(e){return this.vm.breakOut(),this.vm.popN(e),!0},primitiveScanCharacters:function(e){if(6!==e)return!1;var t=this.stackInteger(0),r=this.stackNonInteger(1),i=this.stackInteger(2),a=this.stackNonInteger(3),s=this.stackInteger(4),n=this.stackInteger(5);if(!this.success)return!1;if(r.pointersSize()<258||!a.isBytes())return!1;if(!(0r.pitch*r.height))return null;this.vm.warnOnce("loadForm(): "+r.bits.length+" !== "+r.pitch+"*"+r.height+"="+r.pitch*r.height)}return r},theDisplay:function(){return this.loadForm(this.vm.specialObjects[Squeak.splOb_TheDisplay])},displayDirty:function(e,t){this.deferDisplayUpdates||e!=this.vm.specialObjects[Squeak.splOb_TheDisplay]||this.displayUpdate(this.theDisplay(),t)},displayUpdate:function(e,t){this.showForm(this.display.context,e,t),this.display.lastTick=this.vm.lastTick,this.display.idle=0},primitiveBeep:function(e){var t=Squeak.startAudioOut();if(t){var r=t.createOscillator();r.connect(t.destination),r.type="square",r.frequency.value=880,r.start(),r.stop(t.currentTime+.05)}else this.vm.warnOnce("could not initialize audio");return this.popNIfOK(e)}}),Object.extend(Squeak,"files",{fsck:function(r,i,a,s){if(i=i||"",s=s||{dirs:0,files:0,bytes:0,deleted:0},!a&&(a={},Object.keys(Squeak.Settings).forEach(function(e){var t=e.match(/squeak-file(\.lz)?:(.*)$/);t&&(a[t[2]]=!0)}),window.SqueakDBFake&&Object.keys(SqueakDBFake.bigFiles).forEach(function(e){a[e]=!0}),"undefined"!=typeof indexedDB))return this.dbTransaction("readonly","fsck cursor",function(e){var t=e.openCursor();t.onsuccess=function(e){var t=e.target.result;t?(a[t.key]=!0,t.continue()):Squeak.fsck(r,i,a,s)},t.onerror=function(e){console.error("fsck failed")}});var e=Squeak.dirList(i);for(var t in e){var n=i+"/"+t;if(e[t][3])"squeak:"+n in Squeak.Settings?(Squeak.fsck(null,n,a,s),s.dirs++):(console.log("Deleting stale directory "+n),Squeak.dirDelete(n),s.deleted++);else a[n]?(a[n]=!1,s.files++,s.bytes+=e[t][4]):(console.log("Deleting stale file entry "+n),Squeak.fileDelete(n,!0),s.deleted++)}if(""===i){console.log("squeak fsck: "+s.dirs+" directories, "+s.files+" files, "+(s.bytes/1e6).toFixed(1)+" MBytes");var o=[];for(var n in a)a[n]&&o.push(n);if(0SqueakDBFake.bigFileThreshold)SqueakDBFake.bigFiles[t]||console.log("File "+t+" ("+e.byteLength+" bytes) too large, storing in memory only"),SqueakDBFake.bigFiles[t]=e;else{var r=Squeak.bytesAsString(new Uint8Array(e));if("object"==typeof LZString){var i=LZString.compressToUTF16(r);Squeak.Settings["squeak-file.lz:"+t]=i,delete Squeak.Settings["squeak-file:"+t]}else Squeak.Settings["squeak-file:"+t]=r}var a={};return setTimeout(function(){a.onsuccess&&a.onsuccess()},0),a},delete:function(e){delete Squeak.Settings["squeak-file:"+e],delete Squeak.Settings["squeak-file.lz:"+e],delete SqueakDBFake.bigFiles[e];var t={};return setTimeout(function(){t.onsuccess&&t.onsuccess()},0),t},openCursor:function(){var e={};return setTimeout(function(){e.onsuccess&&e.onsuccess({target:e})},0),e}}),SqueakDBFake},fileGet:function(e,r,i){i=i||function(e){console.log(e)};var a=this.splitFilePath(e);if(!a.basename)return i("Invalid path: "+e);if(Squeak.debugFiles){console.log("Reading "+a.fullname);var t=r;r=function(e){console.log("Read "+e.byteLength+" bytes from "+a.fullname),t(e)}}if(window.SqueakDBFake&&SqueakDBFake.bigFiles[a.fullname])return r(SqueakDBFake.bigFiles[a.fullname]);this.dbTransaction("readonly","get "+e,function(e){var t=e.get(a.fullname);t.onerror=function(e){i(e.target.error.name)},t.onsuccess=function(e){if(void 0!==this.result)return r(this.result);Squeak.fetchTemplateFile(a.fullname,function(e){r(e)},function(){if("undefined"==typeof indexedDB)return i("file not found: "+a.fullname);var e=Squeak.dbFake().get(a.fullname);e.onerror=function(e){i("file not found: "+a.fullname)},e.onsuccess=function(e){r(this.result)}})}})},filePut:function(e,t,r){var i=this.splitFilePath(e);if(!i.basename)return null;var a=this.dirList(i.dirname);if(!a)return null;var s=a[i.basename],n=this.totalSeconds();if(s){if(s[3])return null}else s=[i.basename,n,0,!1,0],a[i.basename]=s;return Squeak.debugFiles&&(console.log("Writing "+i.fullname+" ("+t.byteLength+" bytes)"),0>Squeak.FFIAtomicTypeShift){case Squeak.FFITypeVoid:return null;case Squeak.FFITypeBool:return!e.isFalse;case Squeak.FFITypeUnsignedInt8:case Squeak.FFITypeSignedInt8:case Squeak.FFITypeUnsignedInt16:case Squeak.FFITypeSignedInt16:case Squeak.FFITypeUnsignedInt32:case Squeak.FFITypeSignedInt32:case Squeak.FFITypeUnsignedInt64:case Squeak.FFITypeSignedInt64:case Squeak.FFITypeUnsignedChar8:case Squeak.FFITypeSignedChar8:case Squeak.FFITypeUnsignedChar16:case Squeak.FFITypeUnsignedChar32:if("number"==typeof e)return e;throw Error("FFI: expected integer, got "+e);case Squeak.FFITypeSingleFloat:case Squeak.FFITypeDoubleFloat:return"number"==typeof e?e:(e.isFloat,e.float);default:throw Error("FFI: unimplemented atomic arg type: "+i)}case Squeak.FFIFlagAtomicPointer:var i;switch(i=(r&Squeak.FFIAtomicTypeMask)>>Squeak.FFIAtomicTypeShift){case Squeak.FFITypeUnsignedChar8:if(e.bytes)return e.bytesAsString();throw Error("FFI: expected string, got "+e);case Squeak.FFITypeUnsignedInt8:if(e.bytes)return e.bytes;if(e.words)return e.wordsAsUint8Array();throw Error("FFI: expected bytes, got "+e);case Squeak.FFITypeUnsignedInt32:if(e.words)return e.words;throw Error("FFI: expected words, got "+e);case Squeak.FFITypeSignedInt32:if(e.words)return e.wordsAsInt32Array();throw Error("FFI: expected words, got "+e);case Squeak.FFITypeSingleFloat:if(e.words)return e.wordsAsFloat32Array();if(e.isFloat)return new Float32Array([e.float]);throw Error("FFI: expected floats, got "+e);case Squeak.FFITypeVoid:if(e.words)return e.words.buffer;if(e.bytes)return e.bytes.buffer;throw Error("FFI: expected words or bytes, got "+e);default:throw Error("FFI: unimplemented atomic array arg type: "+i)}default:throw Error("FFI: unimplemented arg type flags: "+r)}},ffiResultToSt:function(e,t){var r=t.pointers[0].words[0];switch(r&Squeak.FFIFlagMask){case Squeak.FFIFlagAtomic:switch(i=(r&Squeak.FFIAtomicTypeMask)>>Squeak.FFIAtomicTypeShift){case Squeak.FFITypeVoid:return this.vm.nilObj;case Squeak.FFITypeBool:return e?this.vm.trueObj:this.vm.falseObj;case Squeak.FFITypeUnsignedInt8:case Squeak.FFITypeSignedInt8:case Squeak.FFITypeUnsignedInt16:case Squeak.FFITypeSignedInt16:case Squeak.FFITypeUnsignedInt32:case Squeak.FFITypeSignedInt32:case Squeak.FFITypeUnsignedInt64:case Squeak.FFITypeSignedInt64:case Squeak.FFITypeUnsignedChar8:case Squeak.FFITypeSignedChar8:case Squeak.FFITypeUnsignedChar16:case Squeak.FFITypeUnsignedChar32:case Squeak.FFITypeSingleFloat:case Squeak.FFITypeDoubleFloat:if("number"!=typeof e)throw Error("FFI: expected number, got "+e);return this.makeStObject(e);default:throw Error("FFI: unimplemented atomic return type: "+i)}case Squeak.FFIFlagAtomicPointer:var i;switch(i=(r&Squeak.FFIAtomicTypeMask)>>Squeak.FFIAtomicTypeShift){case Squeak.FFITypeSignedChar8:case Squeak.FFITypeUnsignedChar8:return this.makeStString(e);default:return this.makeStExternalData(e,t)}default:throw Error("FFI: unimplemented return type flags: "+r)}},makeStExternalData:function(e,t){var r=this.vm.instantiateClass(this.vm.specialObjects[Squeak.splOb_ClassExternalAddress],4);r.jsData=e;var i=this.vm.instantiateClass(this.vm.specialObjects[Squeak.splOb_ClassExternalData],0);return i.pointers[0]=r,i.pointers[1]=t,i},primitiveCalloutToFFI:function(e,t){var r=t.pointers[1];if(!this.isKindOf(r,Squeak.splOb_ClassExternalFunction))return!1;for(var i=[],a=e-1;0<=a;a--)i.push(this.vm.stackValue(a));return this.calloutToFFI(e,r,i)},ffi_primitiveCalloutWithArgs:function(e){var t=this.stackNonInteger(1),r=this.stackNonInteger(0);return!!this.isKindOf(t,Squeak.splOb_ClassExternalFunction)&&this.calloutToFFI(e,t,r.pointers)},ffi_primitiveFFIGetLastError:function(e){return this.popNandPushIfOK(e+1,this.ffi_lastError)},ffi_primitiveFFIIntegerAt:function(e){var t=this.stackNonInteger(3),r=this.stackInteger(2),i=this.stackInteger(1),a=this.stackBoolean(0);if(!this.success)return!1;if(r<0||i<1||8=t.file.size)),!0)},primitiveFileClose:function(e){var t=this.stackNonInteger(0);return!(!this.success||!t.file)&&("string"==typeof t.file?this.fileConsoleFlush(t.file):(this.fileClose(t.file),this.vm.breakOut(),t.file=null),this.popNIfOK(e))},primitiveFileDelete:function(e){var t=this.stackNonInteger(0);if(!this.success)return!1;var r=this.filenameFromSqueak(t.bytesAsString());return this.success=Squeak.fileDelete(r),this.popNIfOK(e)},primitiveFileFlush:function(e){var t=this.stackNonInteger(0);return!(!this.success||!t.file)&&("string"==typeof t.file?this.fileConsoleFlush(t.file):(Squeak.flushFile(t.file),this.vm.breakOut()),this.popNIfOK(e))},primitiveFileGetPosition:function(e){var t=this.stackNonInteger(0);return!(!this.success||!t.file)&&(this.popNandPushIfOK(e+1,this.makeLargeIfNeeded(t.filePos)),!0)},makeFileHandle:function(e,t,r){var i=this.makeStString("squeakjs:"+e);return i.file=t,i.fileWrite=r,i.filePos=0,i},primitiveFileOpen:function(e){var t=this.stackBoolean(0),r=this.stackNonInteger(1);if(!this.success)return!1;var i=this.filenameFromSqueak(r.bytesAsString()),a=this.fileOpen(i,t);if(!a)return!1;var s=this.makeFileHandle(a.name,a,t);return this.popNandPushIfOK(e+1,s),!0},primitiveFileRead:function(a){var s=this.stackInteger(0),n=this.stackInteger(1)-1,e=this.stackNonInteger(2),o=this.stackNonInteger(3);if(!this.success||!e.isWordsOrBytes()||!o.file)return!1;if(!s)return this.popNandPushIfOK(a+1,0);var u=e.bytes;return u||(u=e.wordsAsUint8Array(),n*=4,s*=4),!(n<0||n+s>u.length)&&("string"==typeof o.file?(this.popNandPushIfOK(a+1,0),!0):this.fileContentsDo(o.file,function(e){if(!e.contents)return this.popNandPushIfOK(a+1,0);var t=e.contents,r=u;s=Math.min(s,e.size-o.filePos);for(var i=0;it&&(r.file.size=t,r.file.modified=!0,r.filePos>r.file.size&&(r.filePos=r.file.size)),this.popNIfOK(e))},primitiveDisableFileAccess:function(e){return this.fakePrimitive("FilePlugin.primitiveDisableFileAccess",0,e)},primitiveFileWrite:function(s){var n=this.stackInteger(0),o=this.stackInteger(1)-1,e=this.stackNonInteger(2),u=this.stackNonInteger(3);if(!this.success||!u.file||!u.fileWrite)return!1;if(!n)return this.popNandPushIfOK(s+1,0);var l=e.bytes;return l||(l=e.wordsAsUint8Array(),o*=4,n*=4),!!l&&(!(o<0||o+n>l.length)&&("string"==typeof u.file?(this.fileConsoleWrite(u.file,l,o,n),this.popNandPushIfOK(s+1,n),!0):this.fileContentsDo(u.file,function(e){var t=l,r=e.contents||[];if(u.filePos+n>r.length){var i=0===r.length?u.filePos+n:Math.max(u.filePos+n,r.length+1e4);e.contents=new Uint8Array(i),e.contents.set(r),r=e.contents}for(var a=0;ae.size&&(e.size=u.filePos),e.modified=!0,this.popNandPushIfOK(s+1,n)}.bind(this))))},fileOpen:function(e,t){"undefined"==typeof SqueakFiles&&(window.SqueakFiles={});var r=Squeak.splitFilePath(e);if(!r.basename)return null;var i=Squeak.dirList(r.dirname,!0);if(!i)return null;var a=i[r.basename],s=null;if(a){if(n=SqueakFiles[r.fullname])return++n.refCount,n}else{if(!t)return console.log("File not found: "+r.fullname),null;if(s=new Uint8Array,!(a=Squeak.filePut(r.fullname,s.buffer)))return console.log("Cannot create file: "+r.fullname),null}var n={name:r.fullname,size:a[4],contents:s,modified:!1,refCount:1};return SqueakFiles[n.name]=n},fileClose:function(e){Squeak.flushFile(e),0==--e.refCount&&delete SqueakFiles[e.name]},fileContentsDo:function(i,a){if(i.contents)a(i);else{if(!1===i.contents)return!1;this.vm.freeze(function(t){var r=function(e){console.log("File get failed: "+e),i.contents=!1,t(),a(i)}.bind(this),e=function(e){if(null==e)return r(i.name);i.contents=this.asUint8Array(e),t(),a(i)}.bind(this);Squeak.fileGet(i.name,e,r)}.bind(this))}return!0},fileConsoleBuffer:{log:"",error:""},fileConsoleWrite:function(e,t,r,i){var a=t.subarray(r,r+i),s=this.fileConsoleBuffer[e]+Squeak.bytesAsString(a),n=s.match("([^]*)\n(.*)");n&&(console[e](n[1]),s=n[2]),this.fileConsoleBuffer[e]=s},fileConsoleFlush:function(e){var t=this.fileConsoleBuffer[e];t&&(console[e](t),this.fileConsoleBuffer[e]="")}}),Object.extend(Squeak.Primitives.prototype,"JPEGReadWriter2Plugin",{jpeg2_primJPEGPluginIsPresent:function(e){return this.popNandPushIfOK(e+1,this.vm.trueObj)},jpeg2_primImageHeight:function(e){var t=this.stackNonInteger(0).wordsOrBytes();if(!t)return!1;var r=t[1];return this.popNandPushIfOK(e+1,r)},jpeg2_primImageWidth:function(e){var t=this.stackNonInteger(0).wordsOrBytes();if(!t)return!1;var r=t[0];return this.popNandPushIfOK(e+1,r)},jpeg2_primJPEGCompressStructSize:function(e){return this.popNandPushIfOK(e+1,0)},jpeg2_primJPEGDecompressStructSize:function(e){return this.popNandPushIfOK(e+1,8)},jpeg2_primJPEGErrorMgr2StructSize:function(e){return this.popNandPushIfOK(e+1,0)},jpeg2_primJPEGReadHeaderfromByteArrayerrorMgr:function(e){var t=this.stackNonInteger(2).wordsOrBytes(),r=this.stackNonInteger(1).bytes;if(!t||!r)return!1;var i=this.vm.freeze();return this.jpeg2_readImageFromBytes(r,function(e){this.jpeg2state={src:r,img:e},t[0]=e.width,t[1]=e.height,i()}.bind(this),function(){t[0]=0,t[1]=0,i()}.bind(this)),this.popNIfOK(e)},jpeg2_primJPEGReadImagefromByteArrayonFormdoDitheringerrorMgr:function(e){var t=this.stackNonInteger(3).bytes,r=this.stackNonInteger(2).pointers,i=this.stackBoolean(1);if(!this.success||!t||!r)return!1;var a=this.jpeg2state;if(!a||a.src!==t)return console.error("jpeg read did not match header info"),!1;var s=r[Squeak.Form_depth],n=this.jpeg2_getPixelsFromImage(a.img),o=r[Squeak.Form_bits].words;if(32===s)this.jpeg2_copyPixelsToForm32(n,o);else{if(16!==s)return!1;i?this.jpeg2_ditherPixelsToForm16(n,o):this.jpeg2_copyPixelsToForm16(n,o)}return this.popNIfOK(e)},jpeg2_primJPEGWriteImageonByteArrayformqualityprogressiveJPEGerrorMgr:function(e){return this.vm.warnOnce("JPEGReadWritePlugin2: writing not implemented yet"),!1},jpeg2_readImageFromBytes:function(e,t,r){var i=new Blob([e],{type:"image/jpeg"}),a=new Image;a.onload=function(){t(a)},a.onerror=function(){console.warn("could not render JPEG"),r()},a.src=(window.URL||window.webkitURL).createObjectURL(i)},jpeg2_getPixelsFromImage:function(e){var t=document.createElement("canvas"),r=t.getContext("2d");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height)},jpeg2_copyPixelsToForm32:function(e,t){for(var r=e.data,i=0;i>3<<10|a[4*o+1]>>3<<5|a[4*o+2]>>3;0===u&&(u=1),0==(65535&(u=u<<16|a[4*o+4]>>3<<10|a[4*o+5]>>3<<5|a[4*o+6]>>3))&&(u|=1),t[o>>1]=u}},jpeg2_ditherPixelsToForm16:function(e,t){for(var r=e.width>>1,i=e.height,a=e.data,s=[2,0,14,12,1,3,13,15],n=[10,8,6,4,9,11,5,7],o=0;o>8)>>4,f=k<(15&l)?c+1:c,c=(l=496*d>>8)>>4,d=k<(15&l)?c+1:c,c=(l=496*p>>8)>>4,p=k<(15&l)?c+1:c,c=(l=496*b>>8)>>4,b=_<(15&l)?c+1:c,c=(l=496*m>>8)>>4,m=_<(15&l)?c+1:c,c=(l=496*v>>8)>>4;var S=f<<10|d<<5|p;0===S&&(S=1),0==(65535&(S=S<<16|b<<10|m<<5|(v=_<(15&l)?c+1:c)))&&(S|=1),t[h>>3]=S}}}),Object.extend(Squeak.Primitives.prototype,"ScratchPluginAdditions",{scratch_primitiveOpenURL:function(e){var t=this.stackNonInteger(0).bytesAsString();if(""==t)return!1;if(/^\/SqueakJS\//.test(t)){t=t.slice(10);var r=Squeak.splitFilePath(t),i=Squeak.Settings["squeak-template:"+r.dirname];i&&(t=JSON.parse(i).url+"/"+r.basename)}return window.open(t,"_blank"),this.popNIfOK(e)},scratch_primitiveGetFolderPath:function(e){var t,r=this.stackInteger(0);if(!this.success)return!1;switch(r){case 1:t="/"}return!!t&&(this.vm.popNandPush(e+1,this.makeStString(this.filenameToSqueak(t))),!0)}}),Object.extend(Squeak.Primitives.prototype,"SoundPlugin",{snd_primitiveSoundStart:function(e){return this.snd_primitiveSoundStartWithSemaphore(e)},snd_primitiveSoundStartWithSemaphore:function(e){var t=this.stackInteger(e-1),r=this.stackInteger(e-2),i=this.stackBoolean(e-3),a=3>8,r=255&e.charCodeAt(l/2),i=l/2+1>8:NaN):(t=255&e.charCodeAt((l-1)/2),(l+1)/2>8,i=255&e.charCodeAt((l+1)/2)):r=i=NaN),l+=3,a=t>>2,s=(3&t)<<4|r>>4,n=(15&r)<<2|i>>6,o=63&i,isNaN(r)?n=o=64:isNaN(i)&&(o=64),u=u+LZString$1._keyStr.charAt(a)+LZString$1._keyStr.charAt(s)+LZString$1._keyStr.charAt(n)+LZString$1._keyStr.charAt(o);return u},decompressFromBase64:function(e){if(null==e)return"";var t,r,i,a,s,n,o,u="",l=0,c=0,h=LZString$1._f;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");c>4,i=(15&s)<<4|(n=LZString$1._keyStr.indexOf(e.charAt(c++)))>>2,a=(3&n)<<6|(o=LZString$1._keyStr.indexOf(e.charAt(c++))),l%2==0?(t=r<<8,64!=n&&(u+=h(t|i)),64!=o&&(t=a<<8)):(u+=h(t|r),64!=n&&(t=i<<8),64!=o&&(u+=h(t|a))),l+=3;return LZString$1.decompress(u)},compressToUTF16:function(e){if(null==e)return"";var t,r,i,a="",s=0,n=LZString$1._f;for(e=LZString$1.compress(e),t=0;t>1)),i=(1&r)<<14;break;case 1:a+=n(i+(r>>2)+32),i=(3&r)<<13;break;case 2:a+=n(i+(r>>3)+32),i=(7&r)<<12;break;case 3:a+=n(i+(r>>4)+32),i=(15&r)<<11;break;case 4:a+=n(i+(r>>5)+32),i=(31&r)<<10;break;case 5:a+=n(i+(r>>6)+32),i=(63&r)<<9;break;case 6:a+=n(i+(r>>7)+32),i=(127&r)<<8;break;case 7:a+=n(i+(r>>8)+32),i=(255&r)<<7;break;case 8:a+=n(i+(r>>9)+32),i=(511&r)<<6;break;case 9:a+=n(i+(r>>10)+32),i=(1023&r)<<5;break;case 10:a+=n(i+(r>>11)+32),i=(2047&r)<<4;break;case 11:a+=n(i+(r>>12)+32),i=(4095&r)<<3;break;case 12:a+=n(i+(r>>13)+32),i=(8191&r)<<2;break;case 13:a+=n(i+(r>>14)+32),i=(16383&r)<<1;break;case 14:a+=n(i+(r>>15)+32,32+(32767&r)),s=0}return a+n(i+32)},decompressFromUTF16:function(e){if(null==e)return"";for(var t,r,i="",a=0,s=0,n=LZString$1._f;s>14),t=(16383&r)<<2;break;case 2:i+=n(t|r>>13),t=(8191&r)<<3;break;case 3:i+=n(t|r>>12),t=(4095&r)<<4;break;case 4:i+=n(t|r>>11),t=(2047&r)<<5;break;case 5:i+=n(t|r>>10),t=(1023&r)<<6;break;case 6:i+=n(t|r>>9),t=(511&r)<<7;break;case 7:i+=n(t|r>>8),t=(255&r)<<8;break;case 8:i+=n(t|r>>7),t=(127&r)<<9;break;case 9:i+=n(t|r>>6),t=(63&r)<<10;break;case 10:i+=n(t|r>>5),t=(31&r)<<11;break;case 11:i+=n(t|r>>4),t=(15&r)<<12;break;case 12:i+=n(t|r>>3),t=(7&r)<<13;break;case 13:i+=n(t|r>>2),t=(3&r)<<14;break;case 14:i+=n(t|r>>1),t=(1&r)<<15;break;case 15:i+=n(t|r),a=0}s++}return LZString$1.decompress(i)},compress:function(e){if(null==e)return"";var t,r,i,a={},s={},n="",o="",u="",l=2,c=3,h=2,f="",d=0,p=0,b=LZString$1._f;for(i=0;i>=1}else{for(r=1,t=0;t>=1}0==--l&&(l=Math.pow(2,h),h++),delete s[u]}else for(r=a[u],t=0;t>=1;0==--l&&(l=Math.pow(2,h),h++),a[o]=c++,u=String(n)}if(""!==u){if(Object.prototype.hasOwnProperty.call(s,u)){if(u.charCodeAt(0)<256){for(t=0;t>=1}else{for(r=1,t=0;t>=1}0==--l&&(l=Math.pow(2,h),h++),delete s[u]}else for(r=a[u],t=0;t>=1;0==--l&&(l=Math.pow(2,h),h++)}for(r=2,t=0;t>=1;for(;;){if(d<<=1,15==p){f+=b(d);break}p++}return f},decompress:function(e){if(null==e)return"";if(""==e)return null;var t,r,i,a,s,n,o,u=[],l=4,c=4,h=3,f="",d="",p=LZString$1._f,b={string:e,val:e.charCodeAt(0),position:32768,index:1};for(t=0;t<3;t+=1)u[t]=t;for(i=0,s=Math.pow(2,2),n=1;n!=s;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=32768,b.val=b.string.charCodeAt(b.index++)),i|=(0>=1,0==b.position&&(b.position=32768,b.val=b.string.charCodeAt(b.index++)),i|=(0>=1,0==b.position&&(b.position=32768,b.val=b.string.charCodeAt(b.index++)),i|=(0b.string.length)return"";for(i=0,s=Math.pow(2,h),n=1;n!=s;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=32768,b.val=b.string.charCodeAt(b.index++)),i|=(0>=1,0==b.position&&(b.position=32768,b.val=b.string.charCodeAt(b.index++)),i|=(0>=1,0==b.position&&(b.position=32768,b.val=b.string.charCodeAt(b.index++)),i|=(0>2,s=(3&t)<<4|r>>4,n=1>6:64,o=2>4,r=(15&a)<<4|(s=p.indexOf(e.charAt(u++)))>>2,i=(3&s)<<6|(n=p.indexOf(e.charAt(u++))),o[l++]=t,64!==s&&(o[l++]=r),64!==n&&(o[l++]=i);return o}},{"./support":27,"./utils":29}],2:[function(e,t,r){var i=e("./external"),a=e("./stream/DataWorker"),s=e("./stream/DataLengthProbe"),n=e("./stream/Crc32Probe");s=e("./stream/DataLengthProbe");function o(e,t,r,i,a){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=i,this.compressedContent=a}o.prototype={getContentWorker:function(){var e=new a(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new s("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new a(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},o.createWorkerFrom=function(e,t,r){return e.pipe(new n).pipe(new s("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new s("compressedSize")).withStreamInfo("compression",t)},t.exports=o},{"./external":6,"./stream/Crc32Probe":22,"./stream/DataLengthProbe":23,"./stream/DataWorker":24}],3:[function(e,t,r){var i=e("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(e){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},r.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":25}],4:[function(e,t,r){var i=e("./utils");var o=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?("string"!==i.getTypeOf(e)?function(e,t,r,i){var a=o,s=i+r;e^=-1;for(var n=i;n>>8^a[255&(e^t[n])];return-1^e}:function(e,t,r,i){var a=o,s=i+r;e^=-1;for(var n=i;n>>8^a[255&(e^t.charCodeAt(n))];return-1^e})(0|t,e,e.length,0):0}},{"./utils":29}],5:[function(e,t,r){r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(e,t,r){var i=e("es6-promise").Promise;t.exports={Promise:i}},{"es6-promise":37}],7:[function(e,t,r){var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,a=e("pako"),s=e("./utils"),n=e("./stream/GenericWorker"),o=i?"uint8array":"array";function u(e,t){n.call(this,"FlateWorker/"+e),this._pako=new a[e]({raw:!0,level:t.level||-1}),this.meta={};var r=this;this._pako.onData=function(e){r.push({data:e,meta:r.meta})}}r.magic="\b\0",s.inherits(u,n),u.prototype.processChunk=function(e){this.meta=e.meta,this._pako.push(s.transformTo(o,e.data),!1)},u.prototype.flush=function(){n.prototype.flush.call(this),this._pako.push([],!0)},u.prototype.cleanUp=function(){n.prototype.cleanUp.call(this),this._pako=null},r.compressWorker=function(e){return new u("Deflate",e)},r.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":25,"./utils":29,pako:38}],8:[function(e,t,r){function $(e,t){var r,i="";for(r=0;r>>=8;return i}function i(e,t,r,i,a,s){var n,o,u=e.file,l=e.compression,c=s!==Y.utf8encode,h=V.transformTo("string",s(u.name)),f=V.transformTo("string",Y.utf8encode(u.name)),d=u.comment,p=V.transformTo("string",s(d)),b=V.transformTo("string",Y.utf8encode(d)),m=f.length!==u.name.length,v=b.length!==d.length,g="",k="",_="",S=u.dir,y=u.date,I={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(I.crc32=e.crc32,I.compressedSize=e.compressedSize,I.uncompressedSize=e.uncompressedSize);var O=0;t&&(O|=8),c||!m&&!v||(O|=2048);var w,F,C,x=0,A=0;S&&(x|=16),"UNIX"===a?(A=798,x|=(w=u.unixPermissions,F=S,(C=w)||(C=F?16893:33204),(65535&C)<<16)):(A=20,x|=63&(u.dosPermissions||0)),n=y.getUTCHours(),n<<=6,n|=y.getUTCMinutes(),n<<=5,n|=y.getUTCSeconds()/2,o=y.getUTCFullYear()-1980,o<<=4,o|=y.getUTCMonth()+1,o<<=5,o|=y.getUTCDate(),m&&(k=$(1,1)+$(M(h),4)+f,g+="up"+$(k.length,2)+k),v&&(_=$(1,1)+$(M(p),4)+b,g+="uc"+$(_.length,2)+_);var P="";return P+="\n\0",P+=$(O,2),P+=l.magic,P+=$(n,2),P+=$(o,2),P+=$(I.crc32,4),P+=$(I.compressedSize,4),P+=$(I.uncompressedSize,4),P+=$(h.length,2),P+=$(g.length,2),{fileRecord:j.LOCAL_FILE_HEADER+P+h+g,dirRecord:j.CENTRAL_FILE_HEADER+$(A,2)+P+$(p.length,2)+"\0\0\0\0"+$(x,4)+$(i,4)+h+g+p}}var V=e("../utils"),a=e("../stream/GenericWorker"),Y=e("../utf8"),M=e("../crc32"),j=e("../signature");function s(e,t,r,i){a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=i,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}V.inherits(s,a),s.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,a.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-i-1))/r:100}}))},s.prototype.openedSource=function(e){if(this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name,this.streamFiles&&!e.file.dir){var t=i(e,this.streamFiles,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:t.fileRecord,meta:{percent:0}})}else this.accumulate=!0},s.prototype.closedSource=function(e){this.accumulate=!1;var t,r=i(e,this.streamFiles,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),this.streamFiles&&!e.file.dir)this.push({data:(t=e,j.DATA_DESCRIPTOR+$(t.crc32,4)+$(t.compressedSize,4)+$(t.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},s.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return i.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=a},{"../utils":29}],16:[function(e,t,r){var i=e("./Uint8ArrayReader");function a(e){i.call(this,e)}e("../utils").inherits(a,i),a.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=a},{"../utils":29,"./Uint8ArrayReader":18}],17:[function(e,t,r){var i=e("./DataReader");function a(e){i.call(this,e)}e("../utils").inherits(a,i),a.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},a.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},a.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},a.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=a},{"../utils":29,"./DataReader":15}],18:[function(e,t,r){var i=e("./ArrayReader");function a(e){i.call(this,e)}e("../utils").inherits(a,i),a.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=a},{"../utils":29,"./ArrayReader":14}],19:[function(e,t,r){var i=e("../utils"),a=e("../support"),s=e("./ArrayReader"),n=e("./StringReader"),o=e("./NodeBufferReader"),u=e("./Uint8ArrayReader");t.exports=function(e){var t=i.getTypeOf(e);return i.checkSupport(t),"string"!==t||a.uint8array?"nodebuffer"===t?new o(e):a.uint8array?new u(i.transformTo("uint8array",e)):new s(i.transformTo("array",e)):new n(e)}},{"../support":27,"../utils":29,"./ArrayReader":14,"./NodeBufferReader":16,"./StringReader":17,"./Uint8ArrayReader":18}],20:[function(e,t,r){r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b"},{}],21:[function(e,t,r){var i=e("./GenericWorker"),a=e("../utils");function s(e){i.call(this,"ConvertWorker to "+e),this.destType=e}a.inherits(s,i),s.prototype.processChunk=function(e){this.push({data:a.transformTo(this.destType,e.data),meta:e.meta})},t.exports=s},{"../utils":29,"./GenericWorker":25}],22:[function(e,t,r){var i=e("./GenericWorker"),a=e("../crc32");function s(){i.call(this,"Crc32Probe")}e("../utils").inherits(s,i),s.prototype.processChunk=function(e){this.streamInfo.crc32=a(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=s},{"../crc32":4,"../utils":29,"./GenericWorker":25}],23:[function(e,t,r){var i=e("../utils"),a=e("./GenericWorker");function s(e){a.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}i.inherits(s,a),s.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}a.prototype.processChunk.call(this,e)},t.exports=s},{"../utils":29,"./GenericWorker":25}],24:[function(e,t,r){var i=e("../utils"),a=e("./GenericWorker");function s(e){a.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=i.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}i.inherits(s,a),s.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=s},{"../utils":29,"./GenericWorker":25}],25:[function(e,t,r){function i(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}i.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r "+e:e}},t.exports=i},{}],26:[function(n,o,e){(function(u){var l=n("../utils"),a=n("./ConvertWorker"),s=n("./GenericWorker"),c=n("../base64"),t=n("../nodejs/NodejsStreamOutputAdapter"),r=n("../external");function i(e,o){return new r.Promise(function(t,r){var i=[],a=e._internalType,s=e._outputType,n=e._mimeType;e.on("data",function(e,t){i.push(e),o&&o(t)}).on("error",function(e){i=[],r(e)}).on("end",function(){try{var e=function(e,t,r){switch(e){case"blob":return l.newBlob(l.transformTo("arraybuffer",t),r);case"base64":return c.encode(t);default:return l.transformTo(e,t)}}(s,function(e,t){var r,i=0,a=null,s=0;for(r=0;r>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t}(e)},s.utf8decode=function(e){return u.nodebuffer?o.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,r,i,a,s=e.length,n=new Array(2*s);for(t=r=0;t>10&1023,n[r++]=56320|1023&i)}return n.length!==r&&(n.subarray?n=n.subarray(0,r):n.length=r),o.applyFromCharCode(n)}(e=o.transformTo(u.uint8array?"uint8array":"array",e))},o.inherits(n,i),n.prototype.processChunk=function(e){var t=o.transformTo(u.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(u.uint8array){var r=t;(t=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),t.set(r,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var i=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return!(r<0)&&0!==r&&r+l[e[r]]>t?r:t}(t),a=t;i!==t.length&&(u.uint8array?(a=t.subarray(0,i),this.leftOver=t.subarray(i,t.length)):(a=t.slice(0,i),this.leftOver=t.slice(i,t.length))),this.push({data:s.utf8decode(a),meta:e.meta})},n.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=n,o.inherits(c,i),c.prototype.processChunk=function(e){this.push({data:s.utf8encode(e.data),meta:e.meta})},s.Utf8EncodeWorker=c},{"./nodejsUtils":12,"./stream/GenericWorker":25,"./support":27,"./utils":29}],29:[function(e,t,u){var l=e("./support"),c=e("./base64"),r=e("./nodejsUtils"),i=e("asap"),h=e("./external");function a(e){return e}function f(e,t){for(var r=0;r>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var t=i(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(e){var t,r,i,a=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t},r.buf2binstring=function(e){return c(e,e.length)},r.binstring2buf=function(e){for(var t=new u.Buf8(e.length),r=0,i=t.length;r>10&1023,o[i++]=56320|1023&a)}return c(o,i)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return!(r<0)&&0!==r&&r+l[e[r]]>t?r:t}},{"./common":41}],43:[function(e,t,r){t.exports=function(e,t,r,i){for(var a=65535&e|0,s=e>>>16&65535|0,n=0;0!==r;){for(r-=n=2e3>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var a=o,s=i+r;e^=-1;for(var n=i;n>>8^a[255&(e^t[n])];return-1^e}},{}],46:[function(e,t,r){var u,f=e("../utils/common"),l=e("./trees"),d=e("./adler32"),p=e("./crc32"),i=e("./messages"),c=0,h=4,b=0,m=-2,v=-1,g=4,a=2,k=8,_=9,s=286,n=30,o=19,S=2*s+1,y=15,I=3,O=258,w=O+I+1,F=42,C=113,x=1,A=2,P=3,$=4;function V(e,t){return e.msg=i[t],t}function Y(e){return(e<<1)-(4e.avail_out&&(r=e.avail_out),0!==r&&(f.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function N(e,t){l._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,j(e.strm)}function q(e,t){e.pending_buf[e.pending++]=t}function B(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function W(e,t){var r,i,a=e.max_chain_length,s=e.strstart,n=e.prev_length,o=e.nice_match,u=e.strstart>e.w_size-w?e.strstart-(e.w_size-w):0,l=e.window,c=e.w_mask,h=e.prev,f=e.strstart+O,d=l[s+n-1],p=l[s+n];e.prev_length>=e.good_match&&(a>>=2),o>e.lookahead&&(o=e.lookahead);do{if(l[(r=t)+n]===p&&l[r+n-1]===d&&l[r]===l[s]&&l[++r]===l[s+1]){s+=2,r++;do{}while(l[++s]===l[++r]&&l[++s]===l[++r]&&l[++s]===l[++r]&&l[++s]===l[++r]&&l[++s]===l[++r]&&l[++s]===l[++r]&&l[++s]===l[++r]&&l[++s]===l[++r]&&su&&0!=--a);return n<=e.lookahead?n:e.lookahead}function E(e){var t,r,i,a,s,n,o,u,l,c,h=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=h+(h-w)){for(f.arraySet(e.window,e.window,h,h,0),e.match_start-=h,e.strstart-=h,e.block_start-=h,t=r=e.hash_size;i=e.head[--t],e.head[t]=h<=i?i-h:0,--r;);for(t=r=h;i=e.prev[--t],e.prev[t]=h<=i?i-h:0,--r;);a+=h}if(0===e.strm.avail_in)break;if(n=e.strm,o=e.window,u=e.strstart+e.lookahead,l=a,c=void 0,c=n.avail_in,l=I)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<=I&&(e.ins_h=(e.ins_h<=I)if(i=l._tr_tally(e,e.strstart-e.match_start,e.match_length-I),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=I){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=I&&(e.ins_h=(e.ins_h<=I&&e.match_length<=e.prev_length){for(a=e.strstart+e.lookahead-I,i=l._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-I),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=a&&(e.ins_h=(e.ins_h<>1,o.l_buf=3*o.lit_bufsize,o.level=t,o.strategy=s,o.method=r,U(e)}u=[new R(0,0,0,0,function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(E(e),0===e.lookahead&&t===c)return x;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+r;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,N(e,!1),0===e.strm.avail_out))return x;if(e.strstart-e.block_start>=e.w_size-w&&(N(e,!1),0===e.strm.avail_out))return x}return e.insert=0,t===h?(N(e,!0),0===e.strm.avail_out?P:$):(e.strstart>e.block_start&&(N(e,!1),e.strm.avail_out),x)}),new R(4,4,8,4,L),new R(4,5,16,8,L),new R(4,6,32,32,L),new R(4,4,16,16,T),new R(8,16,32,32,T),new R(8,16,128,128,T),new R(8,32,128,256,T),new R(32,128,258,1024,T),new R(32,258,258,4096,T)],r.deflateInit=function(e,t){return z(e,t,k,15,8,0)},r.deflateInit2=z,r.deflateReset=U,r.deflateResetKeep=D,r.deflateSetHeader=function(e,t){return!e||!e.state||2!==e.state.wrap?m:(e.state.gzhead=t,b)},r.deflate=function(e,t){var r,i,a,s;if(!e||!e.state||5>8&255),q(i,i.gzhead.time>>16&255),q(i,i.gzhead.time>>24&255),q(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),q(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(q(i,255&i.gzhead.extra.length),q(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=p(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(q(i,0),q(i,0),q(i,0),q(i,0),q(i,0),q(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),q(i,3),i.status=C);else{var n=k+(i.w_bits-8<<4)<<8;n|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(n|=32),n+=31-n%31,i.status=C,B(i,n),0!==i.strstart&&(B(i,e.adler>>>16),B(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(e.adler=p(e.adler,i.pending_buf,i.pending-a,a)),j(e),a=i.pending,i.pending!==i.pending_buf_size));)q(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(e.adler=p(e.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=p(e.adler,i.pending_buf,i.pending-a,a)),j(e),a=i.pending,i.pending===i.pending_buf_size)){s=1;break}s=i.gzindexa&&(e.adler=p(e.adler,i.pending_buf,i.pending-a,a)),0===s&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=p(e.adler,i.pending_buf,i.pending-a,a)),j(e),a=i.pending,i.pending===i.pending_buf_size)){s=1;break}s=i.gzindexa&&(e.adler=p(e.adler,i.pending_buf,i.pending-a,a)),0===s&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&j(e),i.pending+2<=i.pending_buf_size&&(q(i,255&e.adler),q(i,e.adler>>8&255),e.adler=0,i.status=C)):i.status=C),0!==i.pending){if(j(e),0===e.avail_out)return i.last_flush=-1,b}else if(0===e.avail_in&&Y(t)<=Y(r)&&t!==h)return V(e,-5);if(666===i.status&&0!==e.avail_in)return V(e,-5);if(0!==e.avail_in||0!==i.lookahead||t!==c&&666!==i.status){var o=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(E(e),0===e.lookahead)){if(t===c)return x;break}if(e.match_length=0,r=l._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(N(e,!1),0===e.strm.avail_out))return x}return e.insert=0,t===h?(N(e,!0),0===e.strm.avail_out?P:$):e.last_lit&&(N(e,!1),0===e.strm.avail_out)?x:A}(i,t):3===i.strategy?function(e,t){for(var r,i,a,s,n=e.window;;){if(e.lookahead<=O){if(E(e),e.lookahead<=O&&t===c)return x;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=I&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=I?(r=l._tr_tally(e,1,e.match_length-I),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=l._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(N(e,!1),0===e.strm.avail_out))return x}return e.insert=0,t===h?(N(e,!0),0===e.strm.avail_out?P:$):e.last_lit&&(N(e,!1),0===e.strm.avail_out)?x:A}(i,t):u[i.level].func(i,t);if(o!==P&&o!==$||(i.status=666),o===x||o===P)return 0===e.avail_out&&(i.last_flush=-1),b;if(o===A&&(1===t?l._tr_align(i):5!==t&&(l._tr_stored_block(i,0,0,!1),3===t&&(M(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),j(e),0===e.avail_out))return i.last_flush=-1,b}return t!==h?b:i.wrap<=0?1:(2===i.wrap?(q(i,255&e.adler),q(i,e.adler>>8&255),q(i,e.adler>>16&255),q(i,e.adler>>24&255),q(i,255&e.total_in),q(i,e.total_in>>8&255),q(i,e.total_in>>16&255),q(i,e.total_in>>24&255)):(B(i,e.adler>>>16),B(i,65535&e.adler)),j(e),0=r.w_size&&(0===s&&(M(r.head),r.strstart=0,r.block_start=0,r.insert=0),l=new f.Buf8(r.w_size),f.arraySet(l,t,c-r.w_size,r.w_size,0),t=l,c=r.w_size),n=e.avail_in,o=e.next_in,u=e.input,e.avail_in=c,e.next_in=0,e.input=t,E(r);r.lookahead>=I;){for(i=r.strstart,a=r.lookahead-(I-1);r.ins_h=(r.ins_h<>>=_=k>>>24,p-=_,0===(_=k>>>16&255))F[s++]=65535&k;else{if(!(16&_)){if(0==(64&_)){k=b[(65535&k)+(d&(1<<_)-1)];continue t}if(32&_){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}S=65535&k,(_&=15)&&(p<_&&(d+=w[i++]<>>=_,p-=_),p<15&&(d+=w[i++]<>>=_=k>>>24,p-=_,!(16&(_=k>>>16&255))){if(0==(64&_)){k=m[(65535&k)+(d&(1<<_)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(y=65535&k,p<(_&=15)&&(d+=w[i++]<>>=_,p-=_,(_=s-n)>3,d&=(1<<(p-=S<<3))-1,e.next_in=i,e.next_out=s,e.avail_in=i>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function s(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new A.Buf16(320),this.work=new A.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function n(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=B,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new A.Buf32(i),t.distcode=t.distdyn=new A.Buf32(a),t.sane=1,t.back=-1,N):q}function o(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,n(e)):q}function u(e,t){var r,i;return e&&e.state?(i=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=s.wsize?(A.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(i<(a=s.wsize-s.wnext)&&(a=i),A.arraySet(s.window,t,r-i,a,s.wnext),(i-=a)?(A.arraySet(s.window,t,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=a,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=$(r.check,C,2,0),c=l=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&l)){e.msg="unknown compression method",r.mode=30;break}if(c-=4,y=8+(15&(l>>>=4)),0===r.wbits)r.wbits=y;else if(y>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(C[0]=255&l,C[1]=l>>>8&255,r.check=$(r.check,C,2,0)),c=l=0,r.mode=3;case 3:for(;c<32;){if(0===o)break e;o--,l+=i[s++]<>>8&255,C[2]=l>>>16&255,C[3]=l>>>24&255,r.check=$(r.check,C,4,0)),c=l=0,r.mode=4;case 4:for(;c<16;){if(0===o)break e;o--,l+=i[s++]<>8),512&r.flags&&(C[0]=255&l,C[1]=l>>>8&255,r.check=$(r.check,C,2,0)),c=l=0,r.mode=5;case 5:if(1024&r.flags){for(;c<16;){if(0===o)break e;o--,l+=i[s++]<>>8&255,r.check=$(r.check,C,2,0)),c=l=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(o<(d=r.length)&&(d=o),d&&(r.head&&(y=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),A.arraySet(r.head.extra,i,s,d,y)),512&r.flags&&(r.check=$(r.check,i,d,s)),o-=d,s+=d,r.length-=d),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===o)break e;for(d=0;y=i[s+d++],r.head&&y&&r.length<65536&&(r.head.name+=String.fromCharCode(y)),y&&d>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;c<32;){if(0===o)break e;o--,l+=i[s++]<>>=7&c,c-=7&c,r.mode=27;break}for(;c<3;){if(0===o)break e;o--,l+=i[s++]<>>=1)){case 0:r.mode=14;break;case 1:if(E(r),r.mode=20,6!==t)break;l>>>=2,c-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}l>>>=2,c-=2;break;case 14:for(l>>>=7&c,c-=7&c;c<32;){if(0===o)break e;o--,l+=i[s++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&l,c=l=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(d=r.length){if(o>>=5,c-=5,r.ndist=1+(31&l),l>>>=5,c-=5,r.ncode=4+(15&l),l>>>=4,c-=4,286>>=3,c-=3}for(;r.have<19;)r.lens[x[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,O={bits:r.lenbits},I=Y(0,r.lens,0,19,r.lencode,0,r.work,O),r.lenbits=O.bits,I){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,g=65535&F,!((m=F>>>24)<=c);){if(0===o)break e;o--,l+=i[s++]<>>=m,c-=m,r.lens[r.have++]=g;else{if(16===g){for(w=m+2;c>>=m,c-=m,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}y=r.lens[r.have-1],d=3+(3&l),l>>>=2,c-=2}else if(17===g){for(w=m+3;c>>=m)),l>>>=3,c-=3}else{for(w=m+7;c>>=m)),l>>>=7,c-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;d--;)r.lens[r.have++]=y}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,O={bits:r.lenbits},I=Y(M,r.lens,0,r.nlen,r.lencode,0,r.work,O),r.lenbits=O.bits,I){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,O={bits:r.distbits},I=Y(j,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,O),r.distbits=O.bits,I){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=o&&258<=u){e.next_out=n,e.avail_out=u,e.next_in=s,e.avail_in=o,r.hold=l,r.bits=c,V(e,f),n=e.next_out,a=e.output,u=e.avail_out,s=e.next_in,i=e.input,o=e.avail_in,l=r.hold,c=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;v=(F=r.lencode[l&(1<>>16&255,g=65535&F,!((m=F>>>24)<=c);){if(0===o)break e;o--,l+=i[s++]<>k)])>>>16&255,g=65535&F,!(k+(m=F>>>24)<=c);){if(0===o)break e;o--,l+=i[s++]<>>=k,c-=k,r.back+=k}if(l>>>=m,c-=m,r.back+=m,r.length=g,0===v){r.mode=26;break}if(32&v){r.back=-1,r.mode=12;break}if(64&v){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&v,r.mode=22;case 22:if(r.extra){for(w=r.extra;c>>=r.extra,c-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;v=(F=r.distcode[l&(1<>>16&255,g=65535&F,!((m=F>>>24)<=c);){if(0===o)break e;o--,l+=i[s++]<>k)])>>>16&255,g=65535&F,!(k+(m=F>>>24)<=c);){if(0===o)break e;o--,l+=i[s++]<>>=k,c-=k,r.back+=k}if(l>>>=m,c-=m,r.back+=m,64&v){e.msg="invalid distance code",r.mode=30;break}r.offset=g,r.extra=15&v,r.mode=24;case 24:if(r.extra){for(w=r.extra;c>>=r.extra,c-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===u)break e;if(d=f-u,r.offset>d){if((d=r.offset-d)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}p=d>r.wnext?(d-=r.wnext,r.wsize-d):r.wnext-d,d>r.length&&(d=r.length),b=r.window}else b=a,p=n-r.offset,d=r.length;for(ud?(b=V[Y+n[k]],x[A+n[k]]):(b=96,0),u=1<>O)+(l-=u)]=p<<24|b<<16|m|0,0!==l;);for(u=1<>=1;if(0!==u?(C&=u-1,C+=u):C=0,k++,0==--P[g]){if(g===S)break;g=t[r+n[k]]}if(y>>7)]}function q(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function B(e,t,r){e.bi_valid>a-r?(e.bi_buf|=t<>a-e.bi_valid,e.bi_valid+=r-a):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function L(e,t,r){var i,a,s=new Array(v+1),n=0;for(i=1;i<=v;i++)s[i]=n=n+r[i-1]<<1;for(a=0;a<=t;a++){var o=e[2*a+1];0!==o&&(e[2*a]=E(s[o]++,o))}}function T(e){var t;for(t=0;t>1;1<=r;r--)D(e,s,r);for(a=u;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],D(e,s,1),i=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=i,s[2*a]=s[2*r]+s[2*i],e.depth[a]=(e.depth[r]>=e.depth[i]?e.depth[r]:e.depth[i])+1,s[2*r+1]=s[2*i+1]=a,e.heap[1]=a++,D(e,s,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,i,a,s,n,o,u=t.dyn_tree,l=t.max_code,c=t.stat_desc.static_tree,h=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,b=0;for(s=0;s<=v;s++)e.bl_count[s]=0;for(u[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r>=7;i>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return o;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return l;for(t=32;t>>3,(s=e.static_len+3+7>>>3)<=a&&(a=s)):a=s=r+5,r+4<=a&&-1!==t?Z(e,t,r,i):4===e.strategy||s===a?(B(e,2+(i?1:0),3),U(e,F,C)):(B(e,4+(i?1:0),3),function(e,t,r,i){var a;for(B(e,t-257,5),B(e,r-1,5),B(e,i-4,4),a=0;a>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(A[r]+h+1)]++,e.dyn_dtree[2*N(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){var t;B(e,2,3),W(e,g,F),16===(t=e).bi_valid?(q(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},{"../utils/common":41}],53:[function(e,t,r){t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}]},{},[10])(10)}),function(o){if(!(void 0===o||"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent))){var e=o.document,u=function(){return o.URL||o.webkitURL||o},l=e.createElementNS("http://www.w3.org/1999/xhtml","a"),c="download"in l,h=/constructor/i.test(o.HTMLElement)||o.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent),d=o.setImmediate||o.setTimeout,p=function(e){d(function(){throw e},0)},b=function(e){setTimeout(function(){"string"==typeof e?u().revokeObjectURL(e):e.remove()},4e4)},m=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e},i=function(e,r,t){t||(e=m(e));function i(){!function(e,t,r){for(var i=(t=[].concat(t)).length;i--;){var a=e["on"+t[i]];if("function"==typeof a)try{a.call(e,r||e)}catch(e){p(e)}}}(s,"writestart progress write writeend".split(" "))}var a,s=this,n="application/octet-stream"===e.type;if(s.readyState=s.INIT,c)return a=u().createObjectURL(e),void d(function(){var e,t;l.href=a,l.download=r,e=l,t=new MouseEvent("click"),e.dispatchEvent(t),i(),b(a),s.readyState=s.DONE},0);!function(){if((f||n&&h)&&o.FileReader){var t=new FileReader;return t.onloadend=function(){var e=f?t.result:t.result.replace(/^data:[^;]*;/,"data:attachment/file;");o.open(e,"_blank")||(o.location.href=e),e=void 0,s.readyState=s.DONE,i()},t.readAsDataURL(e),s.readyState=s.INIT}(a=a||u().createObjectURL(e),n)?o.location.href=a:o.open(a,"_blank")||(o.location.href=a);s.readyState=s.DONE,i(),b(a)}()},t=i.prototype;if("undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob)return;t.abort=function(){},t.readyState=t.INIT=0,t.WRITING=1,t.DONE=2,t.error=t.onwritestart=t.onprogress=t.onwrite=t.onabort=t.onerror=t.onwriteend=null,o.FileSaver_saveAs=function(e,t,r){return new i(e,t||e.name||"download",r)}}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||void 0),function(){var root="object"==typeof window?window:{},NODE_JS=!root.JS_SHA1_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS&&(root=global);var COMMON_JS=!root.JS_SHA1_NO_COMMON_JS&&"object"==typeof module&&module.exports,AMD="function"==typeof define&&define.amd,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[],createOutputMethod=function(t){return function(e){return new Sha1(!0).update(e)[t]()}},createMethod=function(){var t=createOutputMethod("hex");NODE_JS&&(t=nodeWrap(t)),t.create=function(){return new Sha1},t.update=function(e){return t.create().update(e)};for(var e=0;e>2]|=e[a]<>2]|=r<>2]|=(192|r>>6)<>2]|=(224|r>>12)<>2]|=(240|r>>18)<>2]|=(128|r>>12&63)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<>2]|=EXTRA[3&t],this.block=e[16],56<=t&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},Sha1.prototype.hash=function(){var e,t,r=this.h0,i=this.h1,a=this.h2,s=this.h3,n=this.h4,o=this.blocks;for(e=16;e<80;++e)t=o[e-3]^o[e-8]^o[e-14]^o[e-16],o[e]=t<<1|t>>>31;for(e=0;e<20;e+=5)r=(t=(i=(t=(a=(t=(s=(t=(n=(t=r<<5|r>>>27)+(i&a|~i&s)+n+1518500249+o[e]<<0)<<5|n>>>27)+(r&(i=i<<30|i>>>2)|~r&a)+s+1518500249+o[e+1]<<0)<<5|s>>>27)+(n&(r=r<<30|r>>>2)|~n&i)+a+1518500249+o[e+2]<<0)<<5|a>>>27)+(s&(n=n<<30|n>>>2)|~s&r)+i+1518500249+o[e+3]<<0)<<5|i>>>27)+(a&(s=s<<30|s>>>2)|~a&n)+r+1518500249+o[e+4]<<0,a=a<<30|a>>>2;for(;e<40;e+=5)r=(t=(i=(t=(a=(t=(s=(t=(n=(t=r<<5|r>>>27)+(i^a^s)+n+1859775393+o[e]<<0)<<5|n>>>27)+(r^(i=i<<30|i>>>2)^a)+s+1859775393+o[e+1]<<0)<<5|s>>>27)+(n^(r=r<<30|r>>>2)^i)+a+1859775393+o[e+2]<<0)<<5|a>>>27)+(s^(n=n<<30|n>>>2)^r)+i+1859775393+o[e+3]<<0)<<5|i>>>27)+(a^(s=s<<30|s>>>2)^n)+r+1859775393+o[e+4]<<0,a=a<<30|a>>>2;for(;e<60;e+=5)r=(t=(i=(t=(a=(t=(s=(t=(n=(t=r<<5|r>>>27)+(i&a|i&s|a&s)+n-1894007588+o[e]<<0)<<5|n>>>27)+(r&(i=i<<30|i>>>2)|r&a|i&a)+s-1894007588+o[e+1]<<0)<<5|s>>>27)+(n&(r=r<<30|r>>>2)|n&i|r&i)+a-1894007588+o[e+2]<<0)<<5|a>>>27)+(s&(n=n<<30|n>>>2)|s&r|n&r)+i-1894007588+o[e+3]<<0)<<5|i>>>27)+(a&(s=s<<30|s>>>2)|a&n|s&n)+r-1894007588+o[e+4]<<0,a=a<<30|a>>>2;for(;e<80;e+=5)r=(t=(i=(t=(a=(t=(s=(t=(n=(t=r<<5|r>>>27)+(i^a^s)+n-899497514+o[e]<<0)<<5|n>>>27)+(r^(i=i<<30|i>>>2)^a)+s-899497514+o[e+1]<<0)<<5|s>>>27)+(n^(r=r<<30|r>>>2)^i)+a-899497514+o[e+2]<<0)<<5|a>>>27)+(s^(n=n<<30|n>>>2)^r)+i-899497514+o[e+3]<<0)<<5|i>>>27)+(a^(s=s<<30|s>>>2)^n)+r-899497514+o[e+4]<<0,a=a<<30|a>>>2;this.h0=this.h0+r<<0,this.h1=this.h1+i<<0,this.h2=this.h2+a<<0,this.h3=this.h3+s<<0,this.h4=this.h4+n<<0},Sha1.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,i=this.h3,a=this.h4;return HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[15&a]},Sha1.prototype.toString=Sha1.prototype.hex,Sha1.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,i=this.h3,a=this.h4;return[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24&255,r>>16&255,r>>8&255,255&r,i>>24&255,i>>16&255,i>>8&255,255&i,a>>24&255,a>>16&255,a>>8&255,255&a]},Sha1.prototype.array=Sha1.prototype.digest,Sha1.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(20),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),e};var exports=createMethod();COMMON_JS?module.exports=exports:(root.sha1=exports,AMD&&define(function(){return exports}))}(),Object.extend(Squeak,{vmPath:"/",platformSubtype:"Browser",osVersion:navigator.userAgent,windowSystem:"HTML"}),window.SqueakJS={};var canUseMouseOffset=navigator.userAgent.match("AppleWebKit/");function updateMousePos(e,t,r){var i=canUseMouseOffset?e.offsetX:e.layerX,a=canUseMouseOffset?e.offsetY:e.layerY;r.cursorCanvas&&(r.cursorCanvas.style.left=i+t.offsetLeft+r.cursorOffsetX+"px",r.cursorCanvas.style.top=a+t.offsetTop+r.cursorOffsetY+"px");var s=i*t.width/t.offsetWidth|0,n=a*t.height/t.offsetHeight|0;r.mouseX=Math.max(0,Math.min(r.width,s)),r.mouseY=Math.max(0,Math.min(r.height,n))}function recordMouseEvent(e,t,r,i,a){if(updateMousePos(t,r,i),i.vm){var s=i.buttons&Squeak.Mouse_All;switch(e){case"mousedown":switch(t.button||0){case 0:s=Squeak.Mouse_Red;break;case 1:s=Squeak.Mouse_Yellow;break;case 2:s=Squeak.Mouse_Blue}a.swapButtons&&(s==Squeak.Mouse_Yellow?s=Squeak.Mouse_Blue:s==Squeak.Mouse_Blue&&(s=Squeak.Mouse_Yellow));break;case"mousemove":break;case"mouseup":s=0}i.buttons=s|recordModifiers(t,i),i.eventQueue&&(i.eventQueue.push([Squeak.EventTypeMouse,t.timeStamp,i.mouseX,i.mouseY,i.buttons&Squeak.Mouse_All,i.buttons>>3]),i.signalInputEvent&&i.signalInputEvent()),i.idle=0,"mouseup"==e?i.runFor&&i.runFor(100):i.runNow&&i.runNow()}}function recordKeyboardEvent(e,t,r){if(r.vm){var i=r.buttons>>3<<8|e;r.eventQueue?(r.eventQueue.push([Squeak.EventTypeKeyboard,t,e,Squeak.EventKeyChar,r.buttons>>3,e]),r.signalInputEvent&&r.signalInputEvent(),r.keys[0]=i):i===r.vm.interruptKeycode?r.vm.interruptPending=!0:r.keys.push(i),r.idle=0,r.runNow&&r.runNow()}}function recordDragDropEvent(e,t,r,i){i.vm&&i.eventQueue&&(updateMousePos(t,r,i),i.eventQueue.push([Squeak.EventTypeDragDropFiles,t.timeStamp,e,i.mouseX,i.mouseY,i.buttons>>3,i.droppedFiles.length]),i.signalInputEvent&&i.signalInputEvent())}function fakeCmdOrCtrlKey(e,t,r){r.buttons&=~Squeak.Keyboard_All,r.buttons|=Squeak.Keyboard_Cmd|Squeak.Keyboard_Ctrl,r.keys=[],recordKeyboardEvent(e,t,r)}function makeSqueakEvent(e,t,r){t[0]=e[0],t[1]=e[1]-r&Squeak.MillisecondClockMask;for(var i=2;ib.width&&(r.font="bold 24px sans-serif"),r.textAlign="center",r.textBaseline="middle",r.fillText(e,b.width/2,b.height/2)},v.showProgress=function(e,t){t=t||{};var r=v.context,i=b.width/3|0,a=.5*b.width-i/2,s=.5*b.height+48;r.fillStyle=t.background||"#000",r.fillRect(a,s,i,24),r.lineWidth=2,r.strokeStyle=t.color||"#F90",r.strokeRect(a,s,i,24),r.fillStyle=t.color||"#F90",r.fillRect(a,s,i*e,24)},v.executeClipboardPaste=function(e,t){if(!v.vm)return!0;try{v.clipboardString=e,fakeCmdOrCtrlKey("v".charCodeAt(0),t,v)}catch(e){console.error("paste error "+e)}},v.executeClipboardCopy=function(e,t){if(!v.vm)return!0;v.clipboardStringChanged=!1,fakeCmdOrCtrlKey((e||"c").charCodeAt(0),t,v);for(var r=Date.now();!v.clipboardStringChanged&&Date.now()-r<500;)v.vm.interpret(20);if(v.clipboardStringChanged)try{return v.clipboardString}catch(e){console.error("copy error "+e)}},b.onmousedown=function(e){return o(),recordMouseEvent("mousedown",e,b,v,m),e.preventDefault(),!1},b.onmouseup=function(e){recordMouseEvent("mouseup",e,b,v,m),o(),e.preventDefault()},b.onmousemove=function(e){recordMouseEvent("mousemove",e,b,v,m),e.preventDefault()},b.oncontextmenu=function(){return!1};var g={state:"idle",button:0,x:0,y:0,dist:0,down:{}};function u(e){if(e.touches.length){g.x=g.y=0;for(var t=0;t',t.setAttribute("style","position:fixed;right:0;bottom:0;background-color:rgba(128,128,128,0.5);border-radius:5px"),b.parentElement.appendChild(t),t.onmousedown=function(e){b.contentEditable=!0,b.setAttribute("autocomplete","off"),b.setAttribute("autocorrect","off"),b.setAttribute("autocapitalize","off"),b.setAttribute("spellcheck","off"),b.focus(),e.preventDefault()},t.ontouchstart=t.onmousedown}function f(e){for(var t=0;t>>t}function PS(){return NS}function QS(e,t){var r,i,a;for((i=t-e)<0&&(i=0-i),r=63,a=1;a<=62;a++)63===r&&OS[a-1]>=i&&(r=a);return r}function RS(e){var t,r,i;for(r=0,t=e;;){if(!(0<(i=t-IS)))return r+=HS(KS,0-i),KS&=HS(255,8-(IS-=t)),r;r+=GS(KS,i),t-=IS,KS=LS[++JS-1],IS=8}}function SS(e,t){var r,i,a,s;for(i=t,a=e;;){if(!((s=(r=8-IS)-a)<0))return KS+=GS(i,s),IS+=a,self;KS+=HS(i,0-s),LS[++JS-1]=KS,i&=GS(1,(KS=IS=0)-s)-1,a-=r}}function TS(){var e,t,r,i,a,s,n,o,u,l,c,h,f,p,d,b,m;if(e=MS.stackValue(1),t=MS.stackIntegerValue(0),d=MS.fetchIntegerofObject(0,e),f=MS.fetchIntegerofObject(1,e),u=MS.fetchIntegerofObject(2,e),c=MS.fetchIntegerofObject(3,e),l=MS.fetchIntegerofObject(4,e),h=MS.fetchIntegerofObject(5,e),KS=MS.fetchIntegerofObject(6,e),IS=MS.fetchIntegerofObject(7,e),JS=MS.fetchIntegerofObject(8,e),LS=MS.fetchBytesofObject(9,e),m=MS.fetchInt16ArrayofObject(10,e),b=MS.fetchIntegerofObject(12,e),o=MS.fetchIntegerofObject(13,e),OS=MS.fetchInt16ArrayofObject(14,e),p=MS.fetchInt16ArrayofObject(15,e),MS.failed())return null;for(a=1;a<=t;a++)if(1==(a&h))32767<(d=RS(16))&&(d-=65536),f=RS(6),m[++b-1]=d;else{for(i=RS(o),n=OS[f],s=0,r=l;0>>=1,r>>>=1;s+=n,0<(i&u)?d-=s:d+=s,32767>>=1,p>>>=1,r>>>=1;u+=f,l+=p,0<(i&b)?c-=u:c+=u,0<(a&b)?h-=l:h+=l,32767>>=1,r>>>=1;o+=l,0=FS}var ES,FS,IS,JS,KS,LS,MS,NS,OS,CU,DU,NU,OU,PU,QU,RU,SU,TU,UU,VU,WU,XU,YU,ZU,$U,_U,aV,bV,cV,dV,eV,fV,gV,hV,iV,jV,kV,lV,mV,nV,oV,pV,qV,rV,sV,tV,uV,vV,wV,xV,yV,zV,AV,BV,CV,DV,EV,FV,GV,HV,IV,JV,KV,LV,MV,NV,OV,PV,QV,RV,SV,TV,UV,VV,WV,XV,YV,ZV,$V,_V,aW,bW,cW,dW,eW,fW,gW,hW,iW,jW,kW,lW,mW,nW,oW,pW,qW,rW,sW,tW,uW,vW,wW,xW,yW,zW,AW,BW,CW,DW,EW,FW,GW,HW,IW,JW,KW,LW,MW,NW,OW,PW,QW,RW,SW,TW,UW,VW,WW,XW,YW,ZW,$W,_W,aX,bX,cX,dX,eX,fX,gX,hX,iX,jX,kX,lX,mX,nX,oX,pX,qX,rX,sX,tX,uX,vX,wX,xX,yX,zX,AX,BX,CX,DX,EX,FX,GX,HX,IX,JX,KX,LX,MX,NX,OX,PX,QX,RX,SX,TX,UX,VX,WX,XX,YX,ZX,$X,_X,aY,bY,cY,dY,eY,fY,gY,hY,iY,jY,kY,lY,mY,nY,oY,pY,qY,rY,sY,tY,uY,vY,wY,xY,yY,zY,AY,BY,CY,DY,EY,FY,GY,HY,IY,JY,KY,LY,MY,NY,OY,PY,QY,RY,SY,TY,UY,VY,WY,Xsa,Ysa,fta,gta,hta,ita,jta,kta,lta,mta,nta,ota,pta,qta,rta,sta,tta,uta,vta,wta,xta,yta,zta,Ata,Bta,Cta,Dta,Eta,Fta,Gta,Hta,Ita,Jta,Kta,Lta,Mta,Nta,Ota,Pta,Qta,Rta,Sta,Tta,Uta,Vta,Wta,Xta,Yta,Zta,$ta,_ta,aua,bua,cua,dua,eua,fua,gua,hua,iua,jua,kua,lua,mua,nua,oua,pua,qua,rua,sua,tua,uua,vua,wua,xua,yua,zua,Aua,Bua,Cua,Dua,Eua,Fua,Gua,Hua,Iua,Jua,Kua,Lua,Mua,Nua,Oua,Pua,Qua,Rua,Sua,Tua,Uua,Vua,Wua,Xua,Yua,Zua,$ua,_ua,ava,bva,cva,dva,eva,fva,gva,hva,iva,jva,kva,lva,mva,nva,ova,vIa,wIa,AIa,BIa,CIa,DIa,EIa,FIa,GIa,HIa,IIa,JIa,KIa,LIa,LJa,MJa,OJa,PJa,SLa,TLa,WLa,XLa,uNa,vNa,BNa,CNa,DNa,ENa,FNa,GNa,HNa,INa,JNa,KNa,LNa,MNa,NNa,ONa,PNa,QNa,RNa,SNa,TNa,UNa,VNa,WNa,XNa,YNa,ZNa,$Na,_Na,aOa,bOa,cOa,dOa,eOa,fOa,gOa,hOa,iOa,jOa,kOa,lOa,mOa,nOa,oOa,pOa,qOa,rOa,sOa,tOa,uOa,vOa,wOa,xOa,yOa,zOa,AOa,BOa,COa,aRa,bRa,gRa,hRa,iRa,jRa,kRa,lRa,mRa,b_a,c_a,h_a,i_a,j_a,k_a,l_a,m_a,n_a,Heb,Ieb,Meb,Neb,Oeb,Peb,Qeb,Reb,Seb,Teb,Ueb,Veb,Web,Xeb,Yeb,Zeb,$eb,_eb,afb,bfb,cfb,dfb,efb,ffb,gfb,hfb,ifb,jfb,kfb,lfb,mfb,nfb,ofb,pfb,qfb,rfb,sfb,tfb,ufb,vfb,wfb,xfb,yfb,zfb,Afb,Bfb,Cfb,Dfb,Efb,Ffb,Gfb,Hfb,Ifb,Jfb,Kfb,Lfb,Mfb,Nfb,Ofb,Pfb,Qfb,Rfb,Sfb,Tfb,Ufb,Vfb,Wfb,Xfb,Yfb,Zfb,$fb,_fb,agb,bgb,cgb,dgb,egb,fgb,ggb,hgb,igb,jgb,kgb,lgb,mgb,ngb,ogb,pgb,qgb,rgb,sgb,tgb,ugb,vgb,wgb,xgb,ygb,zgb,Agb,Bgb,Cgb,Dgb,mkb,nkb,ukb,vkb,wkb,xkb,ykb,atb,btb,etb,ftb,gtb,htb,itb,jtb,Yub,Zub,bvb,cvb,gxb,hxb,lxb,mxb,_Hb,aIb,dIb,eIb,fIb,gIb,hIb,iIb,HKb,IKb,MKb,NKb,RLb,SLb,$Lb,_Lb,aMb,bMb,cMb,dMb,eMb,fMb,gMb,hMb,iMb,jMb,kMb,lMb,mMb,nMb,oMb,pMb,qMb,rMb,sMb,tMb,uMb,vMb,wMb,xMb,yMb,zMb,AMb,BMb,CMb,DMb,EMb,FMb,GMb,HMb,IMb,JMb,KMb,LMb,MMb,NMb,OMb,PMb,QMb,RMb,SMb;function EU(e){return"number"==typeof e?QY.classSmallInteger():e.sqClass}function FU(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function HU(e,t){return 0|Math.floor(e/t)}function JU(e,t){return 31>>t}function LU(e,t){return new Int32Array(e.buffer,e.byteOffset+4*t)}function MU(e,t){return new Float32Array(e.buffer,e.byteOffset+4*t)}function XY(){return WY[lX]}function YY(e){return WY[lX]=e}function ZY(){return WY[mX]}function _Y(e,t){var r;return t<(r=e+cZ()-1&~(cZ()-1))?t:r}function bZ(e,t){return t-1&~(cZ()-1)}function cZ(){return WY[oX]}function eZ(){return WY[pX]}function fZ(e){return WY[pX]=e}function gZ(){return WY[qX]}function hZ(e){return WY[qX]=e}function jZ(e,t){var r;return 0===e?t<0?0-t:t:0===t?e<0?0-e:e:(r=e*e+t*t)<32?[0,1,1,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,6][r]:Math.sqrt(r)+.5|0}function kZ(e){wZ(1)&&(PY[m0()]=e,n0(m0()+1))}function oZ(){return WY[rX]}function pZ(e){return WY[rX]=e}function qZ(){return WY[sX]}function rZ(e){return WY[sX]=e}function sZ(e){return S1(e)}function uZ(){return R4(6),S4()}function vZ(e,t){var r,i,a,s;if(!zZ(a=mV+e))return 0;if(UY=(i=UY)+a,g2(i,kW),c2(i,0),e2(i,a),r=N$(i),r0())for(s=0;s<=e-1;s++)r[s]=G4(t[s]);else for(s=0;s<=e-1;s++)r[s]=t[s];return X1(i,iV,e),i}function wZ(e){var t,r,i,a;if(sZ(e)){if(0!==qZ())for(i=qZ(),t=qZ()+e,r=1,a=qZ();r<=a;r++)FY[--t]=FY[--i];return FY=LU(FY,e),1}}function xZ(e,t,r){var i,a,s,n;if(!zZ(a=XW+t))return 0;if(UY=(i=UY)+a,g2(i,r?rW:qW),c2(i,0),e2(i,a),n=q0(i),r0())for(s=0;s<=t-1;s++)n[s]=G4(e[s]);else for(s=0;s<=t-1;s++)n[s]=e[s];return X1(i,VW,t),i}function zZ(e){var t,r,i,a;if(wZ(e)){if(0!==m0())for(i=m0(),t=m0()+e,r=1,a=m0();r<=a;r++)PY[--t]=PY[--i];return PY=LU(PY,e),1}}function BZ(){return R4(3)}function EZ(e){return 0==(W1(e,iW)&GV)}function FZ(e,t,r){if(r>>5&31)<<3,l=(h>>>10&31)<<3,h=(a+=a>>>5)+((u+=u>>>5)<<8)+((l+=l>>>5)<<16)+(255<<24)):h=0===W1(e,iV)?0:N$(e)[h]),M4(h)}function c$(e){return W1(e,gV)}function e$(e){return T4(S4()-e+4)}function f$(e,t){return U4(S4()-e+4,t)}function g$(e){return T4(S4()-e+5)}function h$(e,t){return U4(S4()-e+5,t)}function i$(e){return T4(S4()-e+0)}function j$(e,t){return U4(S4()-e+0,t)}function k$(e){return T4(S4()-e+1)}function l$(e,t){return U4(S4()-e+1,t)}function m$(e){return T4(S4()-e+2)}function n$(e,t){return U4(S4()-e+2,t)}function o$(e){return T4(S4()-e+3)}function p$(e,t){return U4(S4()-e+3,t)}function q$(e,t,r){var i,a,s,n,o,u;for(s=FU(e),i=e.wordsAsInt32Array(),a=n=0;a<=s-1;a++){if(o=u3(a,i),!(0<=(u=v3(a,i))&&u<=t))return;n+=o}return n===r}function u$(e,t,r,i,a,s,n){var o,u,l,c;if((u=e,l=t,QY.isWords(u)&&((c=FU(u))===3*l||c===6*l))&&(function(e){var t,r,i;if(QY.isWords(e)){for(i=FU(e),t=e.wordsAsInt32Array(),r=0;r<=i-1;r++)if(!K0(t[r]))return;return 1}}(n)&&q$(r,o=FU(n),t)&&q$(i,o,t)&&q$(s,o,t)&&function(e,t){var r,i,a,s;for(i=FU(e),s=e.wordsAsInt32Array(),r=a=0;r<=i-1;r++)a+=u3(r,s);return a===t}(a,t)))return 1}function w$(e){return(f2(e)&wW)===pW?function(e){var t;t=O0(e)?k5(e):0;if(Z0(e)+t=F_()&&X0(e)-t>=F_())return 0;kZ(e)}(e):(f2(e)&wW)===jW?(r=O0(t=e)?_4(t):0,!(IZ(t)+r=F_()&&GZ(t)-r>=F_())&&void kZ(t)):void kZ(e);var t,r}function y$(){return[1,.98078528040323,.923879532511287,.831469612302545,.7071067811865475,.555570233019602,.38268343236509,.1950903220161286,0,-.1950903220161283,-.3826834323650896,-.555570233019602,-.707106781186547,-.831469612302545,-.9238795325112865,-.98078528040323,-1,-.98078528040323,-.923879532511287,-.831469612302545,-.707106781186548,-.555570233019602,-.3826834323650903,-.1950903220161287,0,.1950903220161282,.38268343236509,.555570233019602,.707106781186547,.831469612302545,.9238795325112865,.98078528040323,1]}function z$(){return[0,.1950903220161282,.3826834323650897,.555570233019602,.707106781186547,.831469612302545,.923879532511287,.98078528040323,1,.98078528040323,.923879532511287,.831469612302545,.7071067811865475,.555570233019602,.38268343236509,.1950903220161286,0,-.1950903220161283,-.3826834323650896,-.555570233019602,-.707106781186547,-.831469612302545,-.9238795325112865,-.98078528040323,-1,-.98078528040323,-.923879532511287,-.831469612302545,-.707106781186548,-.555570233019602,-.3826834323650903,-.1950903220161287,0]}function A$(e,t){return e<0?0:t<=e?t-1:e}function B$(){var e,t;for((e=KU(F3(),gZ()))<0&&(e=0),(t=KU(B3(),gZ())+1)>D3()&&(t=D3());e>1,l=o+=(r=g$(e))-p>>1,u+=(i+=f-c>>1)-n>>1,l+=(a+=p-h>>1)-o>>1,n$(e,i),p$(e,a),f$(e,u),h$(e,l),j$(s,u),l$(s,l),n$(s,n),p$(s,o),f$(s,t),h$(s,r),s)}function Q$(e,t){var r,i,a;r=MZ(e)[tV]>>8,(i=d5(e)[tV]>>8)E$()&&(r=E$()),(i=KU(e,gZ()))=G$()||r=E$()||(a=t,s=r,n=i,(HY||C0())&&HY(a,s,n))}function b_(e){return g2(e,f2(e)|GV)}function c_(e){return g2(e,f2(e)&~GV)}function e_(e,t){return X1(e,dW,t)}function f_(e){return W1(e,fW)}function g_(e,t){return X1(e,fW,t)}function i_(e,t){return X1(e,eW,t)}function j_(){return MU(WY,RX)}function l_(e){return W1(e,GW)}function m_(e,t){return X1(e,GW,t)}function n_(e){return W1(e,HW)}function o_(e,t){return X1(e,HW,t)}function p_(e){return W1(e,IW)}function q_(e,t){return X1(e,IW,t)}function r_(e,t){var r,i,a;for(r=y4(),i=e,a=F4();a>16,I=b>>16,_||(O=A$(O,u),I=A$(I,o)),0<=O&&0<=I&&O>16,I=b>>16,_||(O=A$(O,u),I=A$(I,o)),0<=O&&0<=I&&O>16,I=b>>16,_||(O=A$(O,u),I=A$(I,o)),0<=O&&0<=I&&O>16,g=h>>16,d||(v=A$(v,n),g=A$(g,s)),0<=v&&0<=g&&v>16)<0||u<=o)&&l>16)>16,h=_Y(v=a,s),p=bZ(0,s),u=XY(),l=ZY();for(;v>16===d;)f=KU(v,o),VY[f]=VY[f]+m,++v,c+=i;d=c>>16}u=4042322160|KU(XY(),gZ()),l=gZ();for(;v>16===d;)f=KU(v,o),VY[f]=VY[f]+m,v+=n,c+=JU(i,l);d=c>>16}u=XY(),l=ZY();for(;v>16===d;)f=KU(v,o),VY[f]=VY[f]+m,++v,c+=i;d=c>>16}return v}(e,n,a,s,l,r);l>16,l>>16)>=h&&d>16,(u=0|r[1])>>16)],l=(h-1)*(h-1),p=s,(d=n)>R_(e)&&(d=R_(e));p>16,u>>16)>=l;)VY[p]=f,++p,o+=i,u+=a;for(c=H3(o>>16,u>>16);c>16,f>>16))-1)*(g-1),S=s,n<(_=R_(e))&&(_=n),p=_Y(s,_),b=bZ(0,_),S>16,f>>16)>=m;)d=KU(S,u),VY[d]=VY[d]+k,++S,h+=i,f+=a;for(v=H3(h>>16,f>>16);v>16,f>>16)>=m;)d=KU(S,u),VY[d]=VY[d]+k,S+=o,h+=JU(i,c),f+=JU(a,c);for(v=H3(h>>16,f>>16);v>16,f>>16)>=m;)d=KU(S,u),VY[d]=VY[d]+k,++S,h+=i,f+=a;for(v=H3(h>>16,f>>16);v>16,u>>16),d=t[f],p=o0(e),c=(p-1)*(p-1),h=(f+1)*(f+1),l=H3(o>>16,u>>16),b=s,m=n;for(;b>16,u>>16)<=h;)VY[b]=d,++b,o+=i,u+=a;for(l=H3(o>>16,u>>16);h>16,f>>16),S=o0(e),v=(S-1)*(S-1),g=(k+1)*(k+1),b=H3(h>>16,f>>16),p=_Y(y=s,n),m=bZ(0,n),y>16,f>>16)<=g;)d=KU(y,u),VY[d]=VY[d]+_,++y,h+=i,f+=a;for(b=H3(h>>16,f>>16);g>16,f>>16)<=g;)d=KU(y,u),VY[d]=VY[d]+_,y+=o,h+=JU(i,c),f+=JU(a,c);for(b=H3(h>>16,f>>16);g>16,f>>16)<=g;)d=KU(y,u),VY[d]=VY[d]+_,++y,h+=i,f+=a;for(b=H3(h>>16,f>>16);g>>0>>0}function a0(e,t,r){var i,a,s,n,o,u;if(0===e)return!1;if(a=tJU(D3(),gZ())?JU(D3(),gZ()):r,aF_()&&(s=F_()),aB3()&&C3(s),s>z3()&&A3(s),s<=a)return!1;if(J0(e))w_(e,a,s);else{if(u=e,WY[aY]=u,o=a,WY[bY]=o,n=s,WY[cY]=n,(i=(f2(e)&oW)>>>8)<=1)return!0;switch(i){case 0:case 1:break;case 2:C_();break;case 3:X_();break;case 4:case 5:s_()}}return!1}function c0(){var e,t,r;for(r=U$();k0()r)return!1;if(((t=f2(e))&wW)===lW)return!0;if(!S1(1))return!1;switch(t){case 0:case 1:case 2:case 3:break;case 4:V3(PY[k0()],U$());break;case 5:!function(e,t){var r,i,a,s,n,o,u,l;a=k5(e),i=h2(a),n=l_(e),o=n_(e),V3(e,o),s=f_(e),u=f1(e),m_(e,n-i),g_(e,s+a),0=F_())return!1;if(h3(t),O0(e)&&w4(e),EZ(e)&&(v4(e),MY))return!1;pZ(oZ()+1),oZ()=J_()&&r_(t,r)}return r=N3()?-1:r}function g0(){return Q3()===zW}function h0(){var e;e=3,W4(V4()+e)}function i0(){return SY}function j0(e,t){var r;return e===t||(0!==(r=n_(e)-n_(t))?r<0:(r=l_(e)-l_(t))<0)}function k0(){return WY[WX]}function l0(e){return WY[WX]=e}function m0(){return WY[XX]}function n0(e){return WY[XX]=e}function o0(e){return W1(e,VW)}function q0(e){return LU(TY,e+WW)}function r0(){return 0!==WY[YX]}function t0(e){return WY[YX]=e}function u0(){return 0!==WY[ZX]}function w0(e){return WY[ZX]=e}function x0(e,t){var r,i,a,s,n;if(-1===(r=f0(e,t)))return!1;if(0===r)return h0(),!0;if(P3(r,O3(0)),J3(r,I3(0)),M3(r,L3(0)),h0(),N3()<=3)return!0;for(n=0,r=3;rD3()&&F$(D3()),e=JU(I$(),gZ()),WY[UX]=e,t=JU(K$(),gZ()),WY[VX]=t,r=JU(E$(),gZ()),WY[SX]=r,i=JU(G$(),gZ()),WY[TX]=i,n0(0),rZ(0),PY=LU(TY,UY),FY=LU(TY,UY),function(){var e,t;for(t=0,e=UY;t=H_()||w$(t)),t+=W1(t,hW)}(),MY||(0!==m0()?(function e(t,r,i){var a;var s;var n;var o;var u;var l;var c;var h;var f;var p;var d;if((f=i+1-r)<=1)return 0;n=t[r];u=t[i];s=j0(n,u);s||(p=t[r],t[r]=t[i],t[i]=p,d=n,n=u,u=d);if(f<=2)return 0;l=r+i>>1;o=t[l];s=j0(n,o);s?(s=j0(o,u))||(p=t[i],t[i]=t[l],t[l]=p,o=u):(p=t[r],t[r]=t[l],t[l]=p,o=n);if(f<=3)return 0;c=r;h=i;a=!0;for(;a;){for(s=!0;s;)s=c<=--h&&(p=t[h],j0(o,p));for(s=!0;s;)s=++c<=h&&j0(p=t[c],o);(a=c<=h)&&(p=t[c],t[c]=t[h],t[h]=p)}e(t,r,h);e(t,c,i)}(PY,0,m0()-1),V$(n_(PY[0])),U$()FU(NY)?null:(r=QY.fetchPointerofObject(i,NY),FU(t=QY.fetchPointerofObject(0,r))!==W1(e,fV)?null:t.wordsAsInt32Array())}function t1(e,t,r,i,a,s,n){var o,u,l,c,h,f,p,d;if(i!==a||0!==s&&0!==n){if(o=6*e,d=r?(l=(t.int16Array||(t.int16Array=new Int16Array(t.buffer,t.byteOffset)))[0+o],f=(t.int16Array||(t.int16Array=new Int16Array(t.buffer,t.byteOffset)))[1+o],c=(t.int16Array||(t.int16Array=new Int16Array(t.buffer,t.byteOffset)))[2+o],p=(t.int16Array||(t.int16Array=new Int16Array(t.buffer,t.byteOffset)))[3+o],h=(t.int16Array||(t.int16Array=new Int16Array(t.buffer,t.byteOffset)))[4+o],(t.int16Array||(t.int16Array=new Int16Array(t.buffer,t.byteOffset)))[5+o]):(l=0|t[0+o],f=0|t[1+o],c=0|t[2+o],p=0|t[3+o],h=0|t[4+o],0|t[5+o]),l===c&&f===p||c===h&&p===d)return(l!==h||f!==d)&&(i2()[0]=l,i2()[1]=f,j2()[0]=h,j2()[1]=d,K4(2),L1(s,i2(),j2(),n,i,a));i2()[0]=l,i2()[1]=f,j2()[0]=c,j2()[1]=p,k2()[0]=h,k2()[1]=d,K4(3),u=k1(i2(),j2(),k2(),0!==s&&0!==n),MY||K1(s,n,i,a,u)}}function v1(e){var t;return t=WY[_X],FU(e)>1),l=2*(l=z$()[2*e+1]*r+a|0)-(u+c>>1),j2()[0]=n,j2()[1]=l}function D1(e,t){var r;return EU(t)===QY.classPoint()&&("number"==typeof(r=QY.fetchPointerofObject(0,t))||r.isFloat)?(e[0]="number"==typeof r?r:0|QY.floatValueOf(r),"number"==typeof(r=QY.fetchPointerofObject(1,t))||r.isFloat?void(e[1]="number"==typeof r?r:0|QY.floatValueOf(r)):QY.primitiveFail()):QY.primitiveFail()}function G1(){var e,t,r,i;return 2!==QY.methodArgumentCount()?EY:0!==(t=e3(QY.stackValue(2)))?t:(r=QY.stackObjectValue(0),e=QY.stackObjectValue(1),QY.failed()?DY:0!==(t=I1(QY.fetchPointerofObject(QU,LY)))?t:p1(QY.fetchPointerofObject(OU,LY))?y1(QY.fetchPointerofObject(PU,LY))?FU(e)=k$(c)?(m_(l,i$(c)),o_(l,k$(c)-p),OZ(l,m$(c)),QZ(l,o$(c)-p),HZ(l,e$(c)),JZ(l,g$(c)-p)):(m_(l,e$(c)),o_(l,g$(c)-p),OZ(l,m$(c)),QZ(l,o$(c)-p),HZ(l,i$(c)),JZ(l,k$(c)-p)),q_(l,W$()),e_(l,h),i_(l,f),u&&(X1(s,AV,t),f5(s,e),X1(s,zV,e)),n-=6}P4()}function L1(e,t,r,i,a,s){var n,o,u,l;if(o=0===e||0===i?(n=zZ(YW)?(UY=(l=UY)+YW,g2(l,pW),c2(l,0),e2(l,YW),l):0,0):(n=zZ(gX)?(UY=(u=UY)+gX,g2(u,vW),c2(u,0),e2(u,gX),u):0,h2(e)),MY)return 0;A1(n,t,r,o,a,s),O0(n)&&(X1(n,fX,i),p5(n,e),X1(n,eX,e))}function N1(e){return"number"==typeof e?WV:QY.isWords(e)?FU(e)N4()?_V:0)):XV}function Q1(e){0===strcmp(e,GY)&&(HY=RY=0)}function S1(e){return!($X+UY+m0()+qZ()+e>V4())||(h4(OW),!1)}function T1(){return 0!==WY[gY]}function V1(e){return WY[gY]=e}function W1(e,t){return TY[e+t]}function X1(e,t,r){return TY[e+t]=r}function Y1(){return WY[hY]}function $1(){return WY[iY]}function _1(e){return WY[iY]=e}function b2(e){return W1(e,gW)}function c2(e,t){return X1(e,gW,t)}function e2(e,t){return X1(e,hW,t)}function f2(e){return W1(e,iW)&sW}function g2(e,t){return X1(e,iW,t)}function h2(e){return e>>1}function i2(){return LU(WY,jY)}function j2(){return LU(WY,kY)}function k2(){return LU(WY,lY)}function l2(){return LU(WY,mY)}function m2(){k0()>=m0()&&0===qZ()&&R3(zW),U$()>=H_()&&R3(zW)}function n2(){var e;return 0!==QY.methodArgumentCount()?QY.primitiveFailFor(EY):0!==(e=e3(QY.stackValue(0)))?QY.primitiveFailFor(e):(R3(zW),void l4())}function o2(){var e,t,r;return KY&&(OY=QY.ioMicroMSecs()),1!==QY.methodArgumentCount()?QY.primitiveFailFor(EY):0!==(r=f3(QY.stackValue(1),EW))?QY.primitiveFailFor(r):(t=QY.stackObjectValue(0),QY.failed()?QY.primitiveFailFor(DY):(e=v1(t))?S1(1)?(0>1,n=j2()[1]-i2()[1]>>1,a=j2()[0]+i2()[0]>>1,s=j2()[1]+i2()[1]>>1,o=0;o<=15;o++){if(C1(o,l,n,a,s),K4(3),u=k1(i2(),j2(),k2(),0!==e&&0!==t),MY)return;if(K1(e,t,r,i,u),MY)return}}(t,e,0,a),MY?(P4(),QY.primitiveFailFor(OV)):QY.failed()?QY.primitiveFailFor(RV):(V1(1),l4(),void QY.pop(5)))):QY.primitiveFailFor(_V)):QY.primitiveFailFor(bW))}function w2(){var e,t,r,i,a,s,n,o;if(5!==QY.methodArgumentCount())return QY.primitiveFailFor(EY);if(i=QY.positive32BitValueOf(QY.stackValue(0)),a=QY.stackIntegerValue(1),t=QY.positive32BitValueOf(QY.stackValue(2)),s=QY.stackIntegerValue(3),n=QY.stackObjectValue(4),QY.failed())return QY.primitiveFailFor(DY);if(0!==(e=f3(QY.stackValue(5),BW)))return QY.primitiveFailFor(e);if(r=FU(n),QY.isWords(n)){if(o=!1,r!==s&&2*s!==r)return QY.primitiveFailFor(DY)}else{if(!QY.isArray(n))return QY.primitiveFailFor(DY);if(r!==s)return QY.primitiveFailFor(DY);o=!0}return S1((0===a||0===i?YW:gX)*s)?K0(i)&&K0(t)?(i=G4(i),t=G4(t),MY?QY.primitiveFailFor(OV):0!==i&&0!==a||0!==t?(0!==a&&(a=L4(a)),o?function(e,t,r,i,a){var s,n,o,u,l;if(D1(i2(),QY.fetchPointerofObject(0,e)),!QY.failed())for(n=i2()[0],u=i2()[1],s=1;s<=t-1;s++){if(D1(i2(),QY.fetchPointerofObject(s,e)),QY.failed())return;if(o=i2()[0],l=i2()[1],i2()[0]=n,i2()[1]=u,j2()[0]=o,j2()[1]=l,K4(2),L1(i,i2(),j2(),a,r,0),MY)return;n=o,u=l}}(n,s,t,a,i):function(e,t,r,i,a,s){var n,o,u,l,c;for(l=s?(o=(e.int16Array||(e.int16Array=new Int16Array(e.buffer,e.byteOffset)))[0],(e.int16Array||(e.int16Array=new Int16Array(e.buffer,e.byteOffset)))[1]):(o=0|e[0],0|e[1]),n=1;n<=t-1;n++){if(c=s?(u=(e.int16Array||(e.int16Array=new Int16Array(e.buffer,e.byteOffset)))[2*n],(e.int16Array||(e.int16Array=new Int16Array(e.buffer,e.byteOffset)))[2*n+1]):(u=0|e[2*n],0|e[2*n+1]),i2()[0]=o,i2()[1]=l,j2()[0]=u,j2()[1]=c,K4(2),L1(i,i2(),j2(),a,r,0),MY)return;o=u,l=c}}(n.wordsAsInt32Array(),s,t,a,i,s===r),MY?QY.primitiveFailFor(OV):QY.failed()?QY.primitiveFailFor(RV):(V1(1),l4(),void QY.pop(5))):QY.pop(5)):QY.primitiveFailFor(bW):QY.primitiveFail()}function x2(){var e,t,r,i,a,s,n,o,u,l;return 5!==QY.methodArgumentCount()?QY.primitiveFailFor(EY):(e=QY.positive32BitValueOf(QY.stackValue(0)),t=QY.stackIntegerValue(1),a=QY.positive32BitValueOf(QY.stackValue(2)),r=QY.stackObjectValue(3),s=QY.stackObjectValue(4),QY.failed()?QY.primitiveFailFor(DY):0!==(i=f3(QY.stackValue(5),BW))?QY.primitiveFailFor(i):K0(e)&&K0(a)?(e=G4(e),a=G4(a),MY?QY.primitiveFailFor(OV):0!==a||0!==e&&0!==t?S1(4*YW)?(t=0B3()&&C3(c),c>z3()&&A3(c)}(e.wordsAsInt32Array(),T0(),V0()),R3(AW),l4(),QY.pop(2),void(KY&&(y0(JX,1),y0(zY,QY.ioMicroMSecs()-OY))))))))}function O2(){var e,t;return 0!==QY.methodArgumentCount()?QY.primitiveFailFor(EY):0!==(e=e3(QY.stackValue(0)))?QY.primitiveFailFor(e):(t=T1(),l4(),QY.pop(1),void QY.pushBool(t))}function P2(){var e,t;return 1!==QY.methodArgumentCount()?QY.primitiveFailFor(EY):0!==(e=e3(QY.stackValue(1)))?QY.primitiveFailFor(e):(t=QY.booleanValueOf(QY.stackValue(0)),QY.failed()?QY.primitiveFailFor(DY):(V1(!0===t?1:0),l4(),void QY.pop(1)))}function Q2(){var e,t,r,i,a,s,n;return KY&&(OY=QY.ioMicroMSecs()),1!==QY.methodArgumentCount()?QY.primitiveFailFor(EY):0!==(i=QY.stackValue(1),a=CW,s=zW,t=0===(n=e3(i))?Q3()!==a&&Q3()!==s?(j4(KW),cW):0:n)?QY.primitiveFailFor(t):(e=QY.stackObjectValue(0),QY.failed()?QY.primitiveFailFor(DY):(r=!1,Q3()!==zW&&((r=e0())?(k4(FY[oZ()],e),R3(DW)):R3(xW)),QY.failed()?null:(l4(),QY.pop(2),QY.pushBool(!r),void(KY&&(y0(KX,1),y0(AY,QY.ioMicroMSecs()-OY))))))}function R2(){var e,t,r;return KY&&(OY=QY.ioMicroMSecs()),1!==QY.methodArgumentCount()?QY.primitiveFailFor(EY):0!==(e=f3(QY.stackValue(1),AW))||0!==(e=I1(QY.fetchPointerofObject(QU,LY)))?QY.primitiveFailFor(e):y1(QY.fetchPointerofObject(PU,LY))?(0!==C$()&&(0==(U$()&eZ())&&B$(),D$(0)),t=QY.stackObjectValue(0),r=d0(),MY?QY.primitiveFailFor(OV):(r&&m4(t),QY.failed()?QY.primitiveFailFor(bW):(r?R3(FW):(P4(),A3(0),R3(yW)),l4(),QY.pop(2),QY.pushBool(!r),void(KY&&(y0(LX,1),y0(BY,QY.ioMicroMSecs()-OY)))))):QY.primitiveFailFor(TV)}function S2(){var e,t,r;return KY&&(OY=QY.ioMicroMSecs()),1!==QY.methodArgumentCount()?QY.primitiveFailFor(EY):0!==(t=f3(QY.stackValue(1),xW))?QY.primitiveFailFor(t):(e=QY.stackObjectValue(0),(r=c0())&&(k4(PY[k0()],e),l0(k0()+1)),QY.failed()?QY.primitiveFailFor(aW):(r?R3(EW):(R3(AW),D$(1),pZ(0),P4()),l4(),QY.pop(2),QY.pushBool(!r),void(KY&&(y0(MX,1),y0(CY,QY.ioMicroMSecs()-OY)))))}function T2(){var e,t,r,i,a,s,n,o;return 6!==QY.methodArgumentCount()?QY.primitiveFailFor(EY):0!==(t=f3(QY.stackValue(6),BW))?QY.primitiveFailFor(t):(o=QY.positive32BitValueOf(QY.stackValue(0)),n=QY.positive32BitValueOf(QY.stackValue(1)),s=QY.stackIntegerValue(2),a=QY.stackIntegerValue(3),i=QY.stackIntegerValue(4),r=QY.stackIntegerValue(5),QY.failed()?QY.primitiveFailFor(DY):zZ(EV)?K0(n)&&K0(o)?(UY=(e=UY)+EV,g2(e,lW),e2(e,EV),c2(e,r),m_(e,i),o_(e,a),q_(e,s),e_(e,G4(n)),i_(e,G4(o)),MY?QY.primitiveFailFor(OV):void(QY.failed()||(l4(),QY.pop(6)))):QY.primitiveFailFor(bW):QY.primitiveFailFor(_V))}function U2(){var e,t,r;if(1!==QY.methodArgumentCount())return QY.primitiveFailFor(EY);if(0!==(e=f3(QY.stackValue(1),BW)))return QY.primitiveFailFor(e);if(r=QY.stackIntegerValue(0),QY.failed())return QY.primitiveFailFor(DY);for(t=0;0===t;){if(!zZ(EV))return QY.primitiveFailFor(_V);UY=(t=UY)+FV,g2(t,nW),e2(t,FV),c2(t,r)}QY.failed()||(l4(),QY.pop(2),QY.pushInteger(t))}function V2(){var e;return 0!==(e=G1())?QY.primitiveFailFor(e):(d3(),MY?n4():(function(){var e;for(;!g0();){if(KY&&(OY=QY.ioMicroMSecs()),e=c0(),KY&&(y0(MX,1),y0(CY,QY.ioMicroMSecs()-OY)),MY)return R3(xW);if(e)return R3(EW),h4(MW);if(pZ(0),P4(),D$(1),KY&&(OY=QY.ioMicroMSecs()),0!==C$()&&0==(U$()&eZ())&&B$(),D$(0),e=d0(),KY&&(y0(LX,1),y0(BY,QY.ioMicroMSecs()-OY)),MY)return R3(AW);if(e)return R3(FW),h4(LW);if(P4(),A3(0),KY&&(OY=QY.ioMicroMSecs()),(U$()&eZ())===eZ()&&(a_(U$()),m2()),KY&&(y0(GX,1),y0(wY,QY.ioMicroMSecs()-OY)),MY)return R3(yW);if(g0())return;if(pZ(0),V$(U$()+1),KY&&(OY=QY.ioMicroMSecs()),e=e0(),KY&&(y0(KX,1),y0(AY,QY.ioMicroMSecs()-OY)),MY)return R3(CW);if(e)return R3(DW),h4(JW)}}(),void n4()))}function W2(){var e;if(0!==(e=G1()))return QY.primitiveFailFor(e);d3(),n4()}function X2(){var e,t;return 1!==QY.methodArgumentCount()?QY.primitiveFailFor(EY):0!==(e=f3(QY.stackValue(1),BW))?QY.primitiveFailFor(e):(t=QY.stackIntegerValue(0),QY.failed()?QY.primitiveFailFor(DY):(s3(t),l4(),void QY.pop(1)))}function Y2(){var e,t,r;if(t=QY.stackValue(0),!QY.isBytes(t))return QY.primitiveFail();if(256<=((r=t).bytes?r.bytes.length:r.words?4*r.words.length:0))return QY.primitiveFail();t.bytes,e=!1;var i=t.bytesAsString();if(i!==GY&&(GY=i,e=!0),e&&!C0())return QY.primitiveFail();QY.pop(1)}function Z2(){var e,t;return 1!==QY.methodArgumentCount()?QY.primitiveFailFor(EY):0!==(e=f3(QY.stackValue(1),BW))?QY.primitiveFailFor(e):(t=QY.stackObjectValue(0),!QY.failed()&&QY.isPointers(t)&&2<=FU(t)?(D1(i2(),QY.fetchPointerofObject(0,t)),D1(j2(),QY.fetchPointerofObject(1,t)),QY.failed()?QY.primitiveFailFor(DY):(J$(i2()[0]),L$(i2()[1]),F$(j2()[0]),H$(j2()[1]),l4(),void QY.pop(1))):QY.primitiveFailFor(DY))}function $2(){var e,t,r,i;return 1!==QY.methodArgumentCount()?QY.primitiveFailFor(EY):0!==(e=f3(QY.stackValue(1),BW))?QY.primitiveFailFor(e):(t=QY.stackObjectValue(0),QY.failed()?QY.primitiveFailFor(DY):(r=t,i=M$(),t0(0),J1(r,i,8)&&(t0(1),i[1]=256*i[1],i[3]=256*i[3],i[5]=256*i[5],i[7]=256*i[7]),QY.failed()?QY.primitiveFailFor(RV):(l4(),void QY.pop(1))))}function _2(){var e,t;return 1!==QY.methodArgumentCount()?QY.primitiveFailFor(EY):0!==(t=f3(QY.stackValue(1),BW))?QY.primitiveFailFor(t):(e=QY.stackIntegerValue(0),QY.failed()?QY.primitiveFailFor(DY):(X$(e),l4(),void QY.pop(1)))}function a3(){var e,t,r,i,a;return 1!==QY.methodArgumentCount()?QY.primitiveFailFor(EY):0!==(e=f3(QY.stackValue(1),BW))?QY.primitiveFailFor(e):(t=QY.stackObjectValue(0),QY.failed()?QY.primitiveFailFor(DY):(r=t,w0(0),i=J1(r,a=j_(),6),!QY.failed()&&i&&(w0(1),a[2]=a[2]+Y$(),a[5]=a[5]+$$()),QY.failed()?QY.primitiveFailFor(DY):(l4(),void QY.pop(1))))}function b3(){var e,t,r,i;return 1!==QY.methodArgumentCount()?QY.primitiveFailFor(EY):0!==(e=f3(QY.stackValue(1),BW))?QY.primitiveFailFor(e):EU(t=QY.stackValue(0))!==QY.classPoint()?QY.primitiveFailFor(DY):(D1(i2(),t),QY.failed()?QY.primitiveFailFor(DY):(r=i2()[0],WY[PX]=r,i=i2()[1],WY[QX]=i,l4(),void QY.pop(1)))}function d3(){var e,t;if((t=Q3())===BW){if(D0(),MY)return;t=xW}if(t===xW){if(KY&&(OY=QY.ioMicroMSecs()),e=c0(),KY&&(y0(MX,1),y0(CY,QY.ioMicroMSecs()-OY)),MY)return R3(xW);if(e)return R3(EW),h4(MW);pZ(0),P4(),D$(1),t=AW}if(t===AW){if(KY&&(OY=QY.ioMicroMSecs()),0!==C$()&&0==(U$()&eZ())&&B$(),D$(0),e=d0(),KY&&(y0(LX,1),y0(BY,QY.ioMicroMSecs()-OY)),MY)return R3(AW);if(e)return R3(FW),h4(LW);t=yW,P4(),A3(0)}if(t===yW){if(KY&&(OY=QY.ioMicroMSecs()),(U$()&eZ())===eZ()&&(a_(U$()),m2()),KY&&(y0(GX,1),y0(wY,QY.ioMicroMSecs()-OY)),MY)return R3(yW);if(g0())return;t=CW,pZ(0),V$(U$()+1)}if(t===CW){if(KY&&(OY=QY.ioMicroMSecs()),e=e0(),KY&&(y0(KX,1),y0(AY,QY.ioMicroMSecs()-OY)),MY)return R3(CW);if(e)return R3(DW),h4(JW);R3(xW)}}function e3(e){var t;return QY.failed()?HV:"number"==typeof e?MV:QY.isPointers(e)?FU(e)r;)FY[i]=FY[i-1],--i;FY[i]=t}(oZ(),e,t))}function o3(){return IY=W1(JY,AV)}function p3(){return IY=W1(JY,DV)}function q3(){return IY=W1(JY,fX)}function s3(e){var t,r,i,a;4<=e&&(t=4),2<=e&&e<4&&(t=2),e<2&&(t=1),r=t,WY[oX]=r,1===t&&(hZ(0),YY(4294967295),fZ(0)),2===t&&(hZ(1),YY(4244438268),fZ(1)),4===t&&(hZ(2),YY(4042322160),fZ(3)),i=2*gZ(),WY[mX]=i,a=gZ(),WY[nX]=a}function t3(e){return!1!=((QY=e).majorVersion()==CU)&&QY.minorVersion()>=DU}function u3(e,t){return(0|t[e])>>>16}function v3(e,t){return 65535&(0|t[e])}function w3(e,t,r){BZ()&&(P3(0,e),J3(0,t),M3(0,r),3!==N3()&&__(0,N3()-3)&&(P3(0,D4()),J3(0,z4()),M3(0,B4()),E4(e),A4(t),C4(r)))}function z3(){return WY[pY]}function A3(e){return WY[pY]=e}function B3(){return WY[oY]}function C3(e){return WY[oY]=e}function D3(){return WY[qY]}function F3(){return WY[rY]}function G3(e){return WY[rY]=e}function H3(e,t){return e*e+t*t}function I3(e){return T4(e+1)}function J3(e,t){return U4(e+1,t)}function L3(e){return T4(e+2)}function M3(e,t){return U4(e+2,t)}function N3(){return S4()}function O3(e){return T4(e)}function P3(e,t){return U4(e,t)}function Q3(){return WY[sY]}function R3(e){return WY[sY]=e}function T3(e,t){var r,i,a,s,n,o,u,l,c,h,f,p,d,b,m,v,g,k,S,_,y;if(!O0(e)&&t>=IZ(e))return g_(e,0);b=l_(e),m=n_(e),g=W1(e,vV),k=W1(e,wV),u=2*(g-b),l=b+GZ(e)-2*g,c=2*(k-m),h=m+(i=IZ(e))-2*k,(f=2*(r=i-m))<2&&(f=2),p=HU(16777216,f),n=u*(S=p),n+=(a=l*(d=((_=65535&S)*_>>>16)+_*(y=S>>>16&255)*2+(y*y<<16)>>>8)*2)>>1,o=c*p,o+=(s=h*d*2)>>1,g_(e,r),(v=MZ(e))[tV]=256*b,v[uV]=256*m,v[qV]=n,v[rV]=o,v[oV]=a,v[pV]=s,(m=n_(e))!==t&&(a4(e,t),g_(e,r-(t-m)))}function V3(e,t){var r,i,a,s,n,o,u,l,c,h,f;if(!O0(e)&&t>=Z0(e))return g_(e,0);if(r=X0(e)-l_(e),i=Z0(e)-n_(e),a=0<=r?(l=1,u=r,0):(l=-1,u=0-r,1-i),s=0==i?(c=r,a=0):u>16,s+=i+32768>>16,r+=e[oV],i+=e[pV];return e[tV]=a,e[uV]=s,e[qV]=r,e[rV]=i,a>>8}function a4(e,t){m_(e,_3(MZ(e),t))}function c4(e){var t,r;r=l_(e)+h1(e),0<(t=W1(e,_W)+W1(e,bX))&&(r+=f1(e),t-=W1(e,aX)),e1(e,t),m_(e,r)}function e4(e,t){var r,i,a,s;r=h2(i=_4(e)),a=W1(e,xV)+1,s=W1(e,yV)+1,Y4(e,a),$4(e,s),r<=a&&c_(e),0<=s&&b_(e),s+r<0?_3(MZ(e),t):MZ(e)[tV]=256*KZ(e),_3(d5(e),t),Q$(e,i)}function g4(e){var t,r,i,a,s,n,o,u,l,c,h,f,p,d,b,m;s=g5(e)+1,n=i5(e)+1,h5(e,s),j5(e,n),(r=h2(i=k5(e)))<=s&&c_(e),0<=n&&b_(e),t=l_(e),c4(e),a=l_(e),(s<=i||0<=n+r)&&(u=t,l=a,b=g5(o=e),m=i5(o),f=h2(c=k5(o)),p=o5(o),d=f1(o),h=l-u,b>>1,JY=e,n){case 0:case 1:break;case 2:IY=o5(JY);break;case 3:p3()}switch(a=IY,n){case 0:case 1:break;case 2:q3();break;case 3:o3()}0!==(r=IY)&&S1(3)&&(t=1+(p_(e)<<1),s=l_(e)+a,-1===(i=f0(r,t))?w3(r,t,s):L3(i)>>8&255,s=e>>>16&255,t=e>>>24&255,r0()&&(r=(t*(n=M$())[6]+n[7])/t,s=(s*n[0]+n[1])*r|0,a=(a*n[2]+n[3])*r|0,i=(i*n[4]+n[5])*r|0,t=t*r|0,s=Math.max(s,0),s=Math.min(s,255),a=Math.max(a,0),a=Math.min(a,255),i=Math.max(i,0),i=Math.min(i,255),t=Math.max(t,0),t=Math.min(t,255)),t<1?0:(t<255&&T1()&&h4(NW),i+(a<<8)+(s<<16)+(t<<24))):e}function H4(e){var t,r;u0()?(r=t=e,function(e,t,r){var i,a,s;i=j_(),a=(i[0]*e+i[1]*t+i[2])*cZ()|0,s=(i[3]*e+i[4]*t+i[5])*cZ()|0,r[0]=a,r[1]=s}(0|t[0],0|t[1],r)):(e[0]=(e[0]+Y$())*cZ(),e[1]=(e[1]+$$())*cZ())}function K4(e){0>8,t=k2()[0]-i2()[0],r=k2()[1]-i2()[1],(a=128+(0|Math.sqrt(t*t+r*r))>>8)>>8&255,t=e>>>24&255,a=(a=e>>>16&255)*(s=M$())[0]+s[1]|0,i=i*s[2]+s[3]|0,r=r*s[4]+s[5]|0,t=t*s[6]+s[7]|0,a=Math.max(a,0),a=Math.min(a,255),i=Math.max(i,0),i=Math.min(i,255),r=Math.max(r,0),r=Math.min(r,255),t=Math.max(t,0),(t=Math.min(t,255))<16?0:r+(i<<8)+(a<<16)+(t<<24)):e}function N4(){return WY[nY]}function P4(){W4(N4())}function R4(e){return!!S1(e)&&(W4(V4()-e),!0)}function S4(){return N4()-V4()}function T4(e){return WY[V4()+e]}function U4(e,t){return WY[V4()+e]=t}function V4(){return WY[xX]}function W4(e){return WY[xX]=e}function Y4(e,t){return X1(e,xV,t)}function $4(e,t){return X1(e,yV,t)}function _4(e){return W1(e,zV)}function d5(e){return LU(TY,e+CV)}function f5(e,t){return X1(e,DV,t)}function g5(e){return W1(e,cX)}function h5(e,t){return X1(e,cX,t)}function i5(e){return W1(e,dX)}function j5(e,t){return X1(e,dX,t)}function k5(e){return W1(e,eX)}function o5(e){return W1(e,hX)}function p5(e,t){return X1(e,hX,t)}function q5(e){WY=e.wordsAsInt32Array()}function Zsa(e){return"number"==typeof e?Eua.classSmallInteger():e.sqClass}function $sa(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function _sa(e){return e.bytes?e.bytes.length:e.words?4*e.words.length:0}function ata(e,t){return 0|Math.floor(e/t)}function cta(e,t){return 31>>t}function eta(e,t){return t<0?t<-31?0:e>>>0-t:31>>5&31)+(r>>>10&31),r=Ewa(e>>>16,t>>>16,5,3),Rta+(31&r)+(r>>>5&31)+(r>>>10&31)):(r=Ewa(e,t,8,3),Rta+(255&r)+(r>>>8&255)+(r>>>16&255)),t}function qva(e,t){var r,i,a,s;if((Xta&(Bta|zta))!=(Bta|zta))return t;if(fua<16){for(r=Jua[fua]&Zta,s=t,a=1;a<=lua;a++)qxa(i=s&r,pxa(i)+1),s=dta(s,fua);return t}return 16===fua?(qxa(i=axa(65535&t,5,Wta),pxa(i)+1),qxa(i=axa(t>>>16,5,Wta),pxa(i)+1)):qxa(i=axa(t,8,Wta),pxa(i)+1),t}function rva(e,t){return e+t}function sva(e,t){var r,i,a,s;return 0==(s=e>>>24)?t:255==s?e:(i=(i=(16711935&e)*s+(16711935&t)*(r=255-s)+16711935)+(i-65537>>>8&16711935)>>>8&16711935)|(a=(a=(16711935&(e>>>8|16711680))*s+(t>>>8&16711935)*r+16711935)+(a-65537>>>8&16711935)>>>8&16711935)<<8}function tva(e,t){return uva(e,t,!1)}function uva(e,t,r){var i,a,s,n,o,u,l,c,h,f,p,d,b,m;if(fua<16)return t;if(h=255-Sua,o=t,1===lua)r&&0===e||(o=(p=(p=(16711935&e)*Sua+(16711935&t)*h+16711935)+(p-65537>>>8&16711935)>>>8&16711935)|(d=(d=(e>>>8&16711935)*Sua+(t>>>8&16711935)*h+16711935)+(d-65537>>>8&16711935)>>>8&16711935)<<8);else for(i=Jua[fua],m=kua,b=t,n=e,s=1;s<=lua;s++){if(l=n&i,!(0==(m&i)||r&&0==l)){for(f=b&i,a=0,c=1;c<=3;c++)a|=cta(31&ata((31&dta(l,u=5*(c-1)))*Sua+(31&dta(f,u))*h+254,255),u);o=o&~cta(i,16*(s-1))|cta(a,16*(s-1))}m=dta(m,fua),n=dta(n,fua),b=dta(b,fua)}return o}function vva(e,t){var r,i,a;return(a=(16711935&(a=((t>>>8&16711935)*(r=255-(e>>>24))>>>8&16711935)+(e>>>8&16711935)))<<8|255*(16777472&a))|(i=16711935&(i=((16711935&t)*r>>>8&16711935)+(16711935&e))|255*(16777472&i)>>>8)}function wva(e,t){return 0===e?t:uva(e,t,!0)}function Ava(e,t){return e&t}function Bva(e,t){return e&~t}function Cva(e,t){return~e&t}function Dva(e,t){return~e&~t}function Eva(e,t){return~t}function Fva(e,t){return~e|t}function Gva(e,t){return~e|~t}function Hva(e,t){return~e}function Iva(e,t){return~e^t}function Jva(e,t){return e|t}function Kva(e,t){return e|~t}function Lva(e,t){return e^t}function Nva(e,t){return 0}function Ova(){Uta<=oua?(eva=bva,vua=oua,Pta=ova):(eva=bva+(Uta-oua),Pta=ova-(Uta-oua),vua=Uta),Uta+Tta>>2],0==(16777215&e)){for(t+=4,i+=4;0!=--r&&0==(16777215&(e=Tua[t>>>2]));)t+=4,i+=4;++r}else n=dua[i>>>2],n=Wwa(e,n),dua[i>>>2]=n,t+=4,i+=4;++s,++o}}(),Mta=(Lta=vua)+Pta,Kta=(Nta=wua)+Ota,!0):16===fua?(function(){var e,t,r,i,a,s,n,o,u,l,c,h,f;u=Ota+1,l=fva,h=wua,r=16*(1&vua),jua&&(r=16-r);Hua=cta(65535,16-r);for(;0!=--u;){for(a=l*_ua+4*eva,n=h*mua+4*(vua>>1),e=4*(3&h),f=(3&eva)-1,s=Pta+1,r=65535===(o=Hua)?16:0;0!=--s;)t=rua[e+(f=f+1&3)],i=Tua[a>>>2],0!=(16777215&i)&&(c=dua[n>>>2],c=dta(c&=~o,r),i=cta(0===(i=$va(i=Wwa(i,c=(31744&c)<<9|(992&c)<<6|(31&c)<<3|4278190080),t))?1:i,r),awa(n,i,o)),a+=4,jua?0===r&&(n+=4):0!==r&&(n+=4),r^=16,o=~o;++l,++h}}(),Mta=(Lta=vua)+Pta,Kta=(Nta=wua)+Ota,!0):8===fua&&(function(){var e,t,r,i,a,s,n,o,u,l,c,h,f,p;a=Wva(),o=Xta&~Ata,c=Ota+1,h=fva,Hua=8*(3&vua),jua&&(Hua=24-Hua);Iua=fta^cta(255,Hua),n=0==(1&vua)?0:522133279;0==(1&(p=wua))&&(n^=522133279);for(;0!=--c;){for(n^=522133279,r=h*_ua+4*eva,s=p*mua+4*(vua>>2),i=Pta+1,e=Hua,l=Iua;0!=--i;)t=(Tua[r>>>2]&~n)+n,31<(u=ata(((u=16777215&t)>>>16)+(u>>>8&255)+(255&u),3))&&(224>>2],f=dta(f&=~l,e),f=a[f],t=cta(t=wwa(t=Wwa(t,f),o),e),awa(s,t,l)),r+=4,l=jua?0===e?(s+=4,e=24,16777215):(e-=8,l>>>8|4278190080):32===e?(s+=4,e=0,4294967040):(e+=8,l<<8|255),n^=522133279;++h,++p}}(),Mta=(Lta=vua)+Pta,Kta=(Nta=wua)+Ota,!0);if(fua<8)return!1;if(8===fua&&0==(Xta&Bta))return!1;32===fua&&function(){var e,t,r,i,a,s,n,o,u;for(s=Ota+1,n=fva,u=wua;0!=--s;){for(t=n*_ua+4*eva,i=u*mua+4*vua,r=Pta+1;0!=--r;)if(255==(a=(e=Tua[t>>>2])>>>24)){for(dua[i>>>2]=e,t+=4,i+=4;0!=--r&&(e=Tua[t>>>2])>>>24==255;)dua[i>>>2]=e,t+=4,i+=4;++r}else if(0==a){for(t+=4,i+=4;0!=--r&&(e=Tua[t>>>2])>>>24==0;)t+=4,i+=4;++r}else o=vva(e,o=dua[i>>>2]),dua[i>>>2]=o,t+=4,i+=4;++n,++u}}();16===fua&&function(){var e,t,r,i,a,s,n,o,u,l,c,h,f,p;for(l=Ota+1,c=fva,f=wua,r=16*(1&vua),jua&&(r=16-r),Hua=cta(65535,16-r);0!=--l;){for(a=c*_ua+4*eva,n=f*mua+4*(vua>>1),e=4*(3&f),p=(3&eva)-1,s=Pta+1,r=65535===(u=Hua)?16:0;0!=--s;)t=rua[e+(p=p+1&3)],255==(o=(i=Tua[a>>>2])>>>24)?awa(n,i=cta(0===(i=$va(i,t))?1:i,r),u):0!=o&&(h=dua[n>>>2],awa(n,i=cta(0===(i=$va(i=vva(i,h=(31744&(h=dta(h&=~u,r)))<<9|(992&h)<<6|(31&h)<<3|4278190080),t))?1:i,r),u)),a+=4,jua?0===r&&(n+=4):0!==r&&(n+=4),r^=16,u=~u;++c,++f}}();8===fua&&function(){var e,t,r,i,a,s,n,o,u,l,c,h,f,p;for(a=Wva(),o=Xta&~Ata,c=Ota+1,h=fva,Hua=8*(3&vua),jua&&(Hua=24-Hua),Iua=fta^cta(255,Hua),n=0==(1&vua)?0:522133279,0==(1&(p=wua))&&(n^=522133279);0!=--c;){for(n^=522133279,r=h*_ua+4*eva,s=p*mua+4*(vua>>2),i=Pta+1,e=Hua,l=Iua;0!=--i;)31<(u=(t=(Tua[r>>>2]&~n)+n)>>>24)&&(u<224&&(f=dua[s>>>2],t=vva(t,f=a[f=dta(f&=~l,e)])),awa(s,t=cta(t=wwa(t,o),e),l)),r+=4,l=jua?0===e?(s+=4,e=24,16777215):(e-=8,l>>>8|4278190080):24===e?(s+=4,e=0,4294967040):(e+=8,l<<8|255),n^=522133279;++h,++p}}();return Mta=(Lta=vua)+Pta,Kta=(Nta=wua)+Ota,!0}())return;if(30===aua||31===aua){if(1!==Eua.methodArgumentCount())return Eua.primitiveFail();if(Sua=Eua.stackIntegerValue(0),!(!Eua.failed()&&0<=Sua&&Sua<=255))return Eua.primitiveFail()}Rta=0,Yva(),Nua?function(){var e,t,r,i,a,s;for(r=Oua[aua+1],s=1;s<=Ota;s++){if(t=Mua?fta:gwa(wua+s-1),kua=Hua,i=dua[iua>>>2],e=r(t,i),i=kua&e|i&~kua,dua[iua>>>2]=i,iua+=4,kua=fta,3===aua)for(i=t,a=2;a<=Lua-1;a++)dua[iua>>>2]=i,iua+=4;else for(a=2;a<=Lua-1;a++)i=dua[iua>>>2],e=r(t,i),dua[iua>>>2]=e,iua+=4;1>>2],e=r(t,i),i=kua&e|i&~kua,dua[iua>>>2]=i,iua+=4),iua+=eua}}():(function(){var e;Wua===gua&&fva<=wua&&(fva>>2],Yua+=n):l=0,kua=Hua,f=Tua[Yua>>>2],Yua+=n,t=eta(l&p,a)|eta(f&r,Rua),l=f,o=dua[iua>>>2],e=s(t&i,o),o=kua&e|o&~kua,dua[iua>>>2]=o,iua+=n,kua=fta,3===aua)if(0===Rua&&i===fta)if(-1===yua)for(u=2;u<=Lua-1;u++)f=Tua[Yua>>>2],Yua+=n,dua[iua>>>2]=f,iua+=n;else for(u=2;u<=Lua-1;u++)dua[iua>>>2]=l,iua+=n,l=Tua[Yua>>>2],Yua+=n;else for(u=2;u<=Lua-1;u++)f=Tua[Yua>>>2],Yua+=n,t=eta(l&p,a)|eta(f&r,Rua),l=f,dua[iua>>>2]=t&i,iua+=n;else for(u=2;u<=Lua-1;u++)f=Tua[Yua>>>2],Yua+=n,t=eta(l&p,a)|eta(f&r,Rua),l=f,e=s(t&i,dua[iua>>>2]),dua[iua>>>2]=e,iua+=n;1>>2],Yua+=n,t=eta(l&p,a)|eta(f&r,Rua),o=dua[iua>>>2],e=s(t&i,o),o=kua&e|o&~kua,dua[iua>>>2]=o,iua+=n),Yua+=Uua,iua+=eua}}())),22!==aua&&32!==aua||(Lta=Mta=Nta=Kta=0);Mta=0>>2]),dua[iua>>>2]=kua&p):(p=l(s&f,(o=dua[iua>>>2])&kua),o=kua&p|o&~kua,dua[iua>>>2]=o),iua+=4,g=2===n?(kua=Iua,v):(kua=fta,lua),0!=--n;);Yua+=Uua,iua+=eua}}function Wva(){return[0,4278190081,4294967295,4286611584,4294901760,4278255360,4278190335,4278255615,4294967040,4294902015,4280295456,4282400832,4284506208,4288651167,4290756543,4292861919,4278716424,4279242768,4279769112,4280821800,4281348144,4281874488,4282927176,4283453520,4283979864,4285032552,4285558896,4286085240,4287072135,4287598479,4288124823,4289177511,4289703855,4290230199,4291282887,4291809231,4292335575,4293388263,4293914607,4294440951,4278190081,4278203136,4278216192,4278229248,4278242304,4278255360,4278190131,4278203187,4278216243,4278229299,4278242355,4278255411,4278190182,4278203238,4278216294,4278229350,4278242406,4278255462,4278190233,4278203289,4278216345,4278229401,4278242457,4278255513,4278190284,4278203340,4278216396,4278229452,4278242508,4278255564,4278190335,4278203391,4278216447,4278229503,4278242559,4278255615,4281532416,4281545472,4281558528,4281571584,4281584640,4281597696,4281532467,4281545523,4281558579,4281571635,4281584691,4281597747,4281532518,4281545574,4281558630,4281571686,4281584742,4281597798,4281532569,4281545625,4281558681,4281571737,4281584793,4281597849,4281532620,4281545676,4281558732,4281571788,4281584844,4281597900,4281532671,4281545727,4281558783,4281571839,4281584895,4281597951,4284874752,4284887808,4284900864,4284913920,4284926976,4284940032,4284874803,4284887859,4284900915,4284913971,4284927027,4284940083,4284874854,4284887910,4284900966,4284914022,4284927078,4284940134,4284874905,4284887961,4284901017,4284914073,4284927129,4284940185,4284874956,4284888012,4284901068,4284914124,4284927180,4284940236,4284875007,4284888063,4284901119,4284914175,4284927231,4284940287,4288217088,4288230144,4288243200,4288256256,4288269312,4288282368,4288217139,4288230195,4288243251,4288256307,4288269363,4288282419,4288217190,4288230246,4288243302,4288256358,4288269414,4288282470,4288217241,4288230297,4288243353,4288256409,4288269465,4288282521,4288217292,4288230348,4288243404,4288256460,4288269516,4288282572,4288217343,4288230399,4288243455,4288256511,4288269567,4288282623,4291559424,4291572480,4291585536,4291598592,4291611648,4291624704,4291559475,4291572531,4291585587,4291598643,4291611699,4291624755,4291559526,4291572582,4291585638,4291598694,4291611750,4291624806,4291559577,4291572633,4291585689,4291598745,4291611801,4291624857,4291559628,4291572684,4291585740,4291598796,4291611852,4291624908,4291559679,4291572735,4291585791,4291598847,4291611903,4291624959,4294901760,4294914816,4294927872,4294940928,4294953984,4294967040,4294901811,4294914867,4294927923,4294940979,4294954035,4294967091,4294901862,4294914918,4294927974,4294941030,4294954086,4294967142,4294901913,4294914969,4294928025,4294941081,4294954137,4294967193,4294901964,4294915020,4294928076,4294941132,4294954188,4294967244,4294902015,4294915071,4294928127,4294941183,4294954239,4294967295]}function Xva(e,t,r){return e>>16&255)]<<10)+(qua[r+(e>>>8&255)]<<5)+qua[r+(255&e)]}function awa(e,t,r){var i;i=dua[e>>>2],i&=r,i|=t,dua[e>>>2]=i}function cwa(e,t){var r,i;return"number"==typeof(i=Eua.fetchPointerofObject(e,t))?i:-2147483648<=(r=Eua.floatValueOf(i))&&r<=2147483647?0|r:(Eua.primitiveFail(),0)}function dwa(e,t,r){var i,a;return"number"==typeof(a=Eua.fetchPointerofObject(e,t))?a:a.isNil?r:-2147483648<=(i=Eua.floatValueOf(a))&&i<=2147483647?0|i:(Eua.primitiveFail(),0)}function ewa(e,t){return 32!==fua?t:0===t?0:0!=(4278190080&t)?t:t|4278190080&e}function fwa(){return Kua}function gwa(e){return zua[(t=e)-ata(t,r=Bua)*r|0];var t,r}function hwa(e){return!!e.isNil||(0===aua||(5===aua||(10===aua||15===aua)))}function kwa(){return Oua[1]=Nva,Oua[2]=Ava,Oua[3]=Bva,Oua[4]=mxa,Oua[5]=Cva,Oua[6]=Zva,Oua[7]=Lva,Oua[8]=Jva,Oua[9]=Dva,Oua[10]=Iva,Oua[11]=Eva,Oua[12]=Kva,Oua[13]=Hva,Oua[14]=Fva,Oua[15]=Gva,Oua[16]=Zva,Oua[17]=Zva,Oua[18]=Zva,Oua[19]=rva,Oua[20]=nxa,Oua[21]=Twa,Oua[22]=gxa,Oua[23]=pva,Oua[24]=qva,Oua[25]=sva,Oua[26]=Kwa,Oua[27]=Jwa,Oua[28]=cxa,Oua[29]=dxa,Oua[30]=exa,Oua[31]=tva,Oua[32]=wva,Oua[33]=Zwa,Oua[34]=oxa,Oua[35]=vva,Oua[36]=vva,Oua[37]=vva,Oua[38]=fxa,Oua[39]=Lwa,Oua[40]=Iwa,Oua[41]=ewa,Oua[42]=Ywa,function(){var e,t,r,i,a,s,n,o,u;for(t=0;t<=255;t++)for(e=0;e<=15;e++)a=e,u=o=n=s=void 0,n=sua[7&(s=255&(i=t))],o=tua[s>>>3],u=a>>8&255)],o=tua[s>>>3],u|=a>>16&255)],o=tua[s>>>3],r=u|=a>loadBitBltDestForm: destBitsSize != destPitch * destHeight, expected "+mua+"*"+hua+"="+mua*hua+", got "+e)}dua=dua.wordsOrBytes()}return!0}function nwa(e){return owa(e,!1)}function owa(e,t){if(Qta=e,Fua=t,aua=Eua.fetchIntegerofObject(rta,Qta),Eua.failed()||aua<0||Ita-2>loadBitBltSourceForm: sourceBitsSize != sourcePitch * sourceHeight, expected "+_ua+"*"+Xua+"="+_ua*Xua+", got "+e)}Tua=Tua.wordsOrBytes()}return!0}())return!1;if(!function(){var e,t,r,i;if(Xta=Zta=Wta=0,Yta=$ta=_ta=null,(t=Eua.fetchPointerofObject(lta,Qta)).isNil)return!0;if(Xta=Bta,i=!1,Eua.isWords(t))r=$sa(t),Yta=t.words,i=!0;else{if(!(Eua.isPointers(t)&&3<=$sa(t)))return!1;if(_ta=rwa(Eua.fetchPointerofObject(0,t)),$ta=rwa(Eua.fetchPointerofObject(1,t)),(e=Eua.fetchPointerofObject(2,t)).isNil)r=0;else{if(!Eua.isWords(e))return!1;r=$sa(e),Yta=e.words}Xta|=Ata}if(0!=(r&r-1))return!1;Zta=r-1,Wta=0,512===r&&(Wta=3);4096===r&&(Wta=4);32768===r&&(Wta=5);0===r?(Yta=null,Zta=0):Xta|=zta;i&&ixa();!function(e,t){return!e||!t||0===e[Jta]&&0===e[Hta]&&0===e[xta]&&0===e[gta]&&16711680===t[Jta]&&65280===t[Hta]&&255===t[xta]&&4278190080===t[gta]}(_ta,$ta)?Xta|=yta:_ta=$ta=null;return!0}())return!1;0==(Xta&Ata)&&ixa(),bva=dwa(tta,Qta,0),cva=dwa(uta,Qta,0)}return!!function(){var e;if(Mua)return!(zua=null);if(Eua.isPointers(Aua)&&4<=$sa(Aua))e=Eua.fetchPointerofObject(Dta,Aua),Bua=Eua.fetchIntegerofObject(Fta,Aua),Eua.isWords(e)||(Mua=!0);else{if(Eua.isPointers(Aua)||!Eua.isWords(Aua))return!1;Bua=$sa(e=Aua)}return zua=e.wordsOrBytes(),!0}()&&(Uta=dwa(jta,Qta,0),Vta=dwa(kta,Qta,0),Tta=dwa(ita,Qta,nua),Sta=dwa(hta,Qta,hua),!Eua.failed()&&(Uta<0&&(Tta+=Uta,Uta=0),Vta<0&&(Sta+=Vta,Vta=0),nua>>2],h=0,o=dva,l=uua,c=e,t===(Bta|zta))for(;n=dta(u,o)&r,h|=cta(Yta[n&Zta]&i,l),l+=s,0!=(4294967264&(o+=a))&&(Zua?o+=32:o-=32,u=Tua[(Yua+=4)>>>2]),0!=--c;);else for(;h|=cta(wwa(n=dta(u,o)&r,t)&i,l),l+=s,0!=(4294967264&(o+=a))&&(Zua?o+=32:o-=32,u=Tua[(Yua+=4)>>>2]),0!=--c;);return dva=o,h}function Hwa(e,t){var r,i,a;return e<0||t<0||(i=e>>>14)>=ava||(a=t>>>14)>=Xua?0:(r=a*_ua+4*dta(i,kva),dta(Tua[r>>>2],dva=lva[i&jva])&mva)}function Iwa(e,t){var r,i,a,s,n;if(32===fua)return e===t?0:t;for(n=Jua[i=fua],a=0,s=1;s<=lua;s++)(e&n)===(r=t&n)&&(r=0),a|=r,n=cta(n,i);return a}function Jwa(e,t){return ywa(~e,t,fua,lua)}function Kwa(e,t){return 0===e?t:e|ywa(~e,t,fua,lua)}function Lwa(e,t){var r,i,a,s,n;if(1===lua)return t;if(r=0,a=cta(1,fua)-1,s=cta(a,(lua-1)*fua),r|=cta(t&a,i=32-fua)|dta(t&s,i),lua<=2)return r;for(n=2;n<=lua>>1;n++)a=cta(a,fua),s=dta(s,fua),r|=cta(t&a,i-=2*fua)|dta(t&s,i);return r}function Mwa(){return nwa(Eua.stackValue(Eua.methodArgumentCount()))?(Pva(),Eua.failed()?null:(kxa(),Eua.failed()?null:(Eua.pop(Eua.methodArgumentCount()),22===aua||32===aua?(Eua.pop(1),Eua.pushInteger(Rta)):void 0))):Eua.primitiveFail()}function Nwa(){var e,t,r,i,a,s,n,o,u,l,c,h,f,p;if(6!==Eua.methodArgumentCount())return Eua.primitiveFail();if(c=Eua.stackIntegerValue(0),a=Eua.stackObjectValue(1),u=Eua.stackObjectValue(2),Zsa(a)!==Eua.classArray()||Zsa(u)!==Eua.classArray())return Eua.primitiveFail();if(256!==$sa(u))return Eua.primitiveFail();if(Eua.failed())return null;if(s=$sa(a)-2,r=Eua.stackIntegerValue(3),h=Eua.stackIntegerValue(4),p=Eua.stackObjectValue(5),!Eua.isBytes(p))return Eua.primitiveFail();if(!(0>1,l=1;l<=u;l++)if(oua+=a,(r-=s)<0&&(pua+=h,r+=u),l>1,l=1;l<=s;l++)if(pua+=h,(r-=u)<0&&(oua+=a,r+=s),l=vta+12))return Eua.primitiveFail();(a=Dua-1)<=0&&(a=1);S=cwa(vta,Qta),r=cwa(vta+3,Qta),(I=Xva(S,r,a))<0&&(S=r-a*I);b=cwa(vta+1,Qta),r=cwa(vta+4,Qta),(_=Xva(b,r,a))<0&&(b=r-a*_);v=cwa(vta+9,Qta),r=cwa(vta+6,Qta),(l=Xva(v,r,a))<0&&(v=r-a*l);c=cwa(vta+10,Qta),r=cwa(vta+7,Qta),(s=Xva(c,r,a))<0&&(c=r-a*s);if(Eua.failed())return;if(2===Eua.methodArgumentCount())if(F=Eua.stackIntegerValue(1),(g=Eua.stackValue(0)).isNil){if(Vua<16)return Eua.primitiveFail()}else{if($sa(g)>>=1;for(mva=Jua[Vua],jva=cta(1,kva=5-nva)-1,e=0;e<=jva;e++)lva[e]=Zua?32-cta(e+1,nva):cta(e,nva)})(),1>>2]),dua[iua>>>2]=kua&d):(n=dua[iua>>>2],d=u(i&p,n&kua),n=kua&d|n&~kua,dua[iua>>>2]=n),iua+=4,O=2===r?(kua=Iua,y):(kua=fta,lua),0!=--r;);S+=I,b+=_,v+=l,c+=s,iua+=eua}}(),Mta=0>>=8),u=255&(d>>>=8),o=255&(d>>>=8),255!=(c=255&bua)&&(o=o*c>>>8,u=u*c>>>8,a=a*c>>>8,p=p*c>>>8),s=255&(l=t),b=255&(i=cua),gva&&(s=gva[s],b=gva[b]),255<(f=(s*(255-p)>>>8)+(b*p>>>8))&&(f=255),xua&&(f=xua[f]),s=255&(l>>>=8),b=255&(i>>>=8),gva&&(s=gva[s],b=gva[b]),255<(r=(s*(255-a)>>>8)+(b*a>>>8))&&(r=255),xua&&(r=xua[r]),s=255&(l>>>=8),b=255&(i>>>=8),gva&&(s=gva[s],b=gva[b]),255<(h=(s*(255-u)>>>8)+(b*u>>>8))&&(h=255),xua&&(h=xua[h]),i>>>=8,255<(n=((255&(l>>>=8))*(255-o)>>>8)+o)&&(n=255),(((n<<8)+h<<8)+r<<8)+f)}function Ywa(e,t){return 0===e?t:function(e,t,r,i){var a,s,n,o,u,l;for(l=Jua[r],s=0,o=1;o<=i;o++)n=dta(e&l,(o-1)*r),a=dta(t&l,(o-1)*r),32!==r&&(a=16===r?(n=4278190080|$wa(n),4278190080|$wa(a)):(n=4278190080|axa(n,r,32),4278190080|axa(a,r,32))),u=Wwa(n,a),32!==r&&(u=axa(u,32,r)),s|=cta(u,(o-1)*r),l=cta(l,r);return s}(e,t,fua,lua)}function Zwa(e,t){var r,i,a,s,n,o,u,l,c,h;for(n=Jua[fua],o=16===fua?(i=5,31):(i=8,255),c=kua,u=t,s=e,l=1;l<=lua;l++)0<(c&n)&&(h=u&n,r=s&n,a=fua<16?r==h?0:1:((a=Ewa(r,h,i,3))&o)+(dta(a,i)&o)+(dta(dta(a,i),i)&o),Rta+=a),c=dta(c,fua),s=dta(s,fua),u=dta(u,fua);return t}function $wa(e){return(31&e)<<3|(992&e)<<6|(31744&e)<<9}function axa(e,t,r){var i,a,s,n;return 0<(i=r-t)?(n=cta(1,t)-1,a=(s=cta(e,i))&(n=cta(n,i)),n=cta(n,r),a+((s=cta(s,i))&n)+(cta(s,i)&cta(n,r))):0===i?5===t?32767&e:8===t?16777215&e:e:0===e?e:(n=cta(1,r)-1,a=(s=dta(e,i=t-r))&n,n=cta(n,r),0===(a=a+((s=dta(s,i))&n)+(dta(s,i)&cta(n,r)))?1:a)}function cxa(e,t){return fua<16?Awa(e,t,fua,lua):16===fua?Awa(e,t,5,3)+(Awa(e>>>16,t>>>16,5,3)<<16):Awa(e,t,8,4)}function dxa(e,t){return fua<16?Bwa(e,t,fua,lua):16===fua?Bwa(e,t,5,3)+(Bwa(e>>>16,t>>>16,5,3)<<16):Bwa(e,t,8,4)}function exa(e,t){var r;return r=~e,fua<16?Bwa(r,t,fua,lua):16===fua?Bwa(r,t,5,3)+(Bwa(r>>>16,t>>>16,5,3)<<16):Bwa(r,t,8,4)}function fxa(e,t){return fua<16?Cwa(e,t,fua,lua):16===fua?Cwa(e,t,5,3)+(Cwa(e>>>16,t>>>16,5,3)<<16):Cwa(e,t,8,4)}function gxa(e,t){return fua<16?Ewa(e,t,fua,lua):16===fua?Ewa(e,t,5,3)+(Ewa(e>>>16,t>>>16,5,3)<<16):Ewa(e,t,8,4)}function hxa(e){return!1!=((Eua=e).majorVersion()==Xsa)&&Eua.minorVersion()>=Ysa}function ixa(){var e,t;if(e=t=0,!(Vua<=8)){if(16===Vua&&(e=5),32===Vua&&(e=8),0===Wta){if(fua<=8)return;16===fua&&(t=5),32===fua&&(t=8)}else t=Wta;jxa(e,t)}}function jxa(e,t){var r,i,a=[0,0,0,0],s=[0,0,0,0];0!=(r=t-e)&&(r<=0?(i=cta(1,t)-1,s[Jta]=cta(i,2*e-r),s[Hta]=cta(i,e-r),s[xta]=cta(i,0-r),s[gta]=0):(i=cta(1,e)-1,s[Jta]=cta(i,2*e),s[Hta]=cta(i,e),s[xta]=i),a[Jta]=3*r,a[Hta]=2*r,a[xta]=r,a[gta]=0,_ta=a,$ta=s,Xta=Xta|Bta|yta)}function kxa(){Eua.showDisplayBitsLeftTopRightBottom(gua,Lta,Nta,Mta,Kta)}function mxa(e,t){return e}function nxa(e,t){return e-t}function oxa(e,t){var r,i,a,s,n,o;if((Xta&(Bta|zta))!=(Bta|zta))return t;for(r=Jua[fua],a=t,n=kua,s=1;s<=lua;s++)0!=(n&r)&&(o=a&r,qxa(i=fua<16?o:axa(o,16===fua?5:8,Wta),pxa(i)+1)),n=dta(n,fua),a=dta(a,fua);return t}function pxa(e){return Yta[e&Zta]}function qxa(e,t){return Yta[e&Zta]=t}function sxa(){var e,t,r,i;if(Cua){if(!hva&&!twa())return;r=hva,i=!1,"number"==typeof(e=Eua.fetchPointerofObject(Dta,gua))&&(r(e=e,Lta,Nta,Mta-Lta,Kta-Nta),dua=mua=0,i=!0),Nua||"number"==typeof(t=Eua.fetchPointerofObject(Dta,Wua))&&(t=t,i&&t===e||r(t,0,0,0,0),Tua=_ua=0),Cua=!1}}function wxa(e,t,r,i,a,s,n,o){var u,l,c,h,f,p,d,b,m,v,g,k,S,_,y,O,I,F,w;b=Jua[fua],l=0,m=2===n?(c=t>>1,f=r>>1,d=i>>1,a>>1):(c=ata(t,n),f=ata(r,n),d=ata(i,n),ata(a,n)),p=e;do{y=eva,g=fva,O=I=_=k=0,F=0,h=n;do{for(w=y,S=g,u=n;v=Hwa(w,S),25===aua&&0===v||(++F,k+=255&(v=Vua<16?s[v]:16===Vua?$wa(v):v),_+=v>>>8&255,I+=v>>>16&255,O+=v>>>24),w+=c,S+=f,0!=--u;);y+=d,g+=m}while(0!=--h);l|=cta((v=0===F||25===aua&&F>1?0:(4===F?(I>>>=2,_>>>=2,k>>>=2,O>>>=2):(I=ata(I,F),_=ata(_,F),k=ata(k,F),O=ata(O,F)),0===(v=(O<<24)+(I<<16)+(_<<8)+k)&&0>2)===LIa&&AIa===JIa&&AIa===CIa&&JIa===CIa),!1===DIa.failed())}function QIa(){var e,t,r,i,a;for(i=0,r=HIa;i>1,i=AIa>>2,f=1;f<=FIa;f++)for(c=zIa(1,f),h=c>>1,m=AIa,v=c,t=0|Math.floor(m/v),l=1;l<=h;l++)for(o=(b=(l-1)*t)=wIa}function NJa(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function QJa(){return PJa}function RJa(){var e,t,r,i,a,s;if(e=OJa.stackObjectValue(0),a=OJa.stackObjectValue(1),OJa.failed())return null;if(OJa.success(OJa.isWords(e)),OJa.success(OJa.isWords(a)),OJa.failed())return null;if(i=NJa(e),OJa.success(i===NJa(a)),OJa.failed())return null;for(s=a.wordsAsFloat32Array(),t=e.wordsAsFloat32Array(),r=0;r<=i-1;r++)s[r]=s[r]+t[r];OJa.pop(1)}function SJa(){var e,t,r,i,a;if(a=OJa.stackFloatValue(0),r=OJa.stackObjectValue(1),OJa.failed())return null;if(OJa.success(OJa.isWords(r)),OJa.failed())return null;for(t=NJa(r),i=r.wordsAsFloat32Array(),e=0;e<=t-1;e++)i[e]=i[e]+a;OJa.pop(1)}function TJa(){var e,t,r;return t=OJa.stackIntegerValue(0),r=OJa.stackObjectValue(1),OJa.failed()?null:(OJa.success(OJa.isWords(r)),OJa.success(0=MJa}function ULa(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function VLa(e,t){return new Int32Array(e.buffer,e.byteOffset+4*t)}function YLa(e,t){var r,i,a,s;return r=e[0],a=e[1],(i=t[0]-r)*i+(s=t[1]-a)*s}function $La(){return XLa}function bMa(e){console.log(XLa+": "+e)}function cMa(){var e,t,r,i,a,s,n,o,u,l,c,h,f,p,d,b,m,v,g,k,S,_,y,O,I,F,w,C,A,x,P,V,M,j,R,Y,q,N,W,B,E,L,T,D,Q,U,z,K,X,H;if(R=WLa.stackValue(11),Y=WLa.stackValue(10),q=WLa.stackValue(9),N=WLa.stackValue(8),W=WLa.stackValue(7),B=WLa.stackValue(6),E=WLa.stackValue(5),L=WLa.stackValue(4),T=WLa.stackIntegerValue(3),D=WLa.stackValue(2),Q=WLa.stackValue(1),U=WLa.stackValue(0),WLa.failed())return null;if(WLa.failed())return bMa("failed 1"),null;if(WLa.success(WLa.isWords(R)&&WLa.isWords(Y)&&WLa.isWords(q)&&WLa.isWords(N)&&WLa.isWords(W)&&WLa.isWords(B)&&WLa.isWords(E)&&WLa.isWords(L)&&WLa.isWords(D)&&WLa.isWords(Q)&&WLa.isWords(U)),WLa.failed())return bMa("failed 2"),null;if(WLa.success(WLa.isMemberOf(R,"PointArray")&&WLa.isMemberOf(Y,"PointArray")),WLa.failed())return bMa("failed 3"),null;if(f=R.wordsAsInt32Array(),v=Y.wordsAsInt32Array(),k=q.wordsAsInt32Array(),u=N.wordsAsInt32Array(),d=W.wordsAsInt32Array(),c=B.wordsAsInt32Array(),P=E.wordsAsInt32Array(),e=L.wordsAsInt32Array(),_=D.wordsAsInt32Array(),M=Q.wordsAsInt32Array(),S=U.wordsAsInt32Array(),g=ULa(Y)>>>1,w=ULa(q)>>>1,l=ULa(N)>>>1,t=ULa(B),h=ULa(D),WLa.success(h===ULa(Q)&&h===ULa(U)&&l=w-1&&ULa(R)>>>1>=w&&l-1<=t&&l<=g&&ULa(E)>=w-1&&ULa(L)>=l-1),WLa.failed())return bMa("failed 5"),null;if(C=T>>>1,b=(r=1&T)?0:C*C>>>10,S[M[_[0]=0]=0]=2,I=0-b,!((p=l)-1<=g&&p-1<=t))return WLa.primitiveFail(),null;for(O=1;O<=p;O++)I=I+(c[i=O-1]+YLa(VLa(v,i<<1),f)>>>7)+b,M[O]=I,_[O]=I*O,S[O]=O+1;for(I=M[0]-b,F=1;F<=w;F++){for(y=(a=F-1)<<1,x=_[0],I=I+(d[a]+YLa(VLa(f,y),v)>>>7)+b,M[0]=I,_[0]=I*F,S[0]=F+1,p=l,O=1;O<=p;O++)s=(i=O-1)<<1,A=_[O],j=_[i],m=d[a]+YLa(VLa(f,y),VLa(v,O<<1))>>>7,0===(I=M[O])?A+=m:(A=A+I+m*S[O],m+=I),o=c[i]+YLa(VLa(v,s),VLa(f,F<<1))>>>7,0===(I=M[i])?j+=o:(j=j+I+o*S[i],o+=I),r?x=1<<29:x+=(YLa(VLa(u,s),VLa(k,y))+YLa(VLa(v,s),VLa(f,y)))*(16+(K=e[i],X=P[a],H=void 0,180<(H=Math.abs(X-K))&&(H=360-H),H*H>>>6))>>>11,V=x<=A&&x<=j?(n=x,I=0,1):A<=j?(n=A,I=m+b,S[O]+1):(n=j,I=o+b,S[i]+1),x=_[O],_[O]=Math.min(n,1<<29),M[O]=Math.min(I,1<<29),S[O]=V;I=M[0]}return z=n,WLa.failed()||WLa.popthenPush(13,z),null}function dMa(){return WLa.failed()||WLa.popthenPush(1,2e3),null}function eMa(e){return!1!=((WLa=e).majorVersion()==SLa)&&WLa.minorVersion()>=TLa}function wNa(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function yNa(e,t){return 0|Math.floor(e/t)}function zNa(e,t){return 31>>r)}function MOa(){return zOa}function OOa(e,t){var r,i,a,s,n;if(i=e[0]>>>24,_Na>>24&255))return-1}return-1}function QOa(){var e,t,r,i,a,s,n,o;return r=t=kOa[DNa],i=kOa[ENa],n=kOa[YNa],o=kOa[gOa],0!==n&&0!==o&&(r=yNa(r,n),i=yNa(i,o)),e=(i>>>3)*kOa[BNa]+(r>>>3),s=((7&i)<<3)+(7&r),a=jOa[e][s],++t<8*kOa[$Na]?kOa[DNa]=t:(kOa[DNa]=0,kOa[ENa]++),a}function ROa(){var e,t,r,i,a,s,n,o;return r=t=mOa[DNa],i=mOa[ENa],n=mOa[YNa],o=mOa[gOa],0!==n&&0!==o&&(r=yNa(r,n),i=yNa(i,o)),e=(i>>>3)*mOa[BNa]+(r>>>3),s=((7&i)<<3)+(7&r),a=lOa[e][s],++t<8*mOa[$Na]?mOa[DNa]=t:(mOa[DNa]=0,mOa[ENa]++),a}function SOa(){var e,t,r,i,a,s,n,o;return r=t=COa[DNa],i=COa[ENa],n=COa[YNa],o=COa[gOa],0!==n&&0!==o&&(r=yNa(r,n),i=yNa(i,o)),e=(i>>>3)*COa[BNa]+(r>>>3),s=((7&i)<<3)+(7&r),a=BOa[e][s],++t<8*COa[$Na]?COa[DNa]=t:(COa[DNa]=0,COa[ENa]++),a}function TOa(){var e;return 4!==qOa.methodArgumentCount()?qOa.primitiveFail():(pOa=qOa.stackIntegerValue(0),e=qOa.stackObjectValue(1),qOa.failed()?null:qOa.isWords(e)&&3===wNa(e)?(AOa=e.wordsAsInt32Array(),e=qOa.stackObjectValue(2),qOa.failed()?null:qOa.isWords(e)?(sOa=wNa(e),rOa=e.wordsAsInt32Array(),e=qOa.stackObjectValue(3),qOa.failed()?null:$Oa(e)?(function(){var e,t;for(COa[DNa]=0,e=COa[ENa]=0;e<=sOa-1;e++)t=SOa(),t+=AOa[XNa],t=Math.min(t,bOa),AOa[XNa]=t&pOa,t&=bOa-pOa,t=Math.max(t,1),rOa[e]=4278190080+(t<<16)+(t<<8)+t}(),void qOa.pop(4)):qOa.primitiveFail()):qOa.primitiveFail()):qOa.primitiveFail())}function UOa(){var e,t,r;return 4!==qOa.methodArgumentCount()?qOa.primitiveFail():(pOa=qOa.stackIntegerValue(0),e=qOa.stackObjectValue(1),qOa.failed()?null:qOa.isWords(e)&&3===wNa(e)?(AOa=e.wordsAsInt32Array(),e=qOa.stackObjectValue(2),qOa.failed()?null:qOa.isWords(e)?(sOa=wNa(e),rOa=e.wordsAsInt32Array(),e=qOa.stackObjectValue(3),qOa.failed()?null:qOa.isPointers(e)&&3===wNa(e)&&$Oa(qOa.fetchPointerofObject(0,e))?(t=qOa.fetchPointerofObject(1,e),EOa(kOa,t)&&FOa(jOa,t)?(r=qOa.fetchPointerofObject(2,e),EOa(mOa,r)&&FOa(lOa,r)?(function(){var e,t,r,i,a,s,n;for(COa[DNa]=0,COa[ENa]=0,kOa[DNa]=0,kOa[ENa]=0,mOa[DNa]=0,a=mOa[ENa]=0;a<=sOa-1;a++)n=SOa(),t=QOa(),t-=fOa,r=ROa(),s=n+(PNa*(r-=fOa)>>16)+AOa[eOa],s=Math.min(s,bOa),s=Math.max(s,0),AOa[eOa]=s&pOa,s&=bOa-pOa,s=Math.max(s,1),i=n-(INa*t>>16)-(LNa*r>>16)+AOa[XNa],i=Math.min(i,bOa),i=Math.max(i,0),AOa[XNa]=i&pOa,i&=bOa-pOa,i=Math.max(i,1),e=n+(RNa*t>>16)+AOa[CNa],e=Math.min(e,bOa),e=Math.max(e,0),AOa[CNa]=e&pOa,e&=bOa-pOa,e=Math.max(e,1),rOa[a]=4278190080+(s<<16)+(i<<8)+e}(),void qOa.pop(4)):qOa.primitiveFail()):qOa.primitiveFail()):qOa.primitiveFail()):qOa.primitiveFail()):qOa.primitiveFail())}function VOa(){var e,t,r,i;return 5!==qOa.methodArgumentCount()?qOa.primitiveFail():(r=qOa.stackObjectValue(0),qOa.failed()?null:function(e){var t,r,i;if(!(wNa(e)<5)&&qOa.isPointers(e)&&"number"!=typeof(t=qOa.fetchPointerofObject(0,e))&&qOa.isBytes(t)&&(wOa=t.bytes,r=(i=t).bytes?i.bytes.length:i.words?4*i.words.length:0,xOa=qOa.fetchIntegerofObject(1,e),yOa=qOa.fetchIntegerofObject(2,e),uOa=qOa.fetchIntegerofObject(3,e),vOa=qOa.fetchIntegerofObject(4,e),!qOa.failed()&&!(r>>4,0!==(r&=15)){if(a+=s,r=XOa(LOa(r),r),a<0||GNa<=a)return qOa.primitiveFail();e[tOa[a]]=r}else{if(15!=s)return;a+=s}++a}}(e,COa),qOa.failed()?null:(i=qOa.stackValue(0),qOa.storeIntegerofObjectwithValue(1,i,xOa),qOa.storeIntegerofObjectwithValue(3,i,uOa),qOa.storeIntegerofObjectwithValue(4,i,vOa),qOa.storeIntegerofObjectwithValue(dOa,qOa.stackValue(3),COa[dOa]),void qOa.pop(5))))):qOa.primitiveFail()):qOa.primitiveFail()):qOa.primitiveFail()):qOa.primitiveFail())}function WOa(){var e,t;return 2!==qOa.methodArgumentCount()?qOa.primitiveFail():(e=qOa.stackObjectValue(0),qOa.failed()?null:qOa.isWords(e)&&wNa(e)===GNa?(t=e.wordsAsInt32Array(),e=qOa.stackObjectValue(1),qOa.failed()?null:qOa.isWords(e)&&wNa(e)===GNa?(function(e,t){var r,i,a,s,n,o,u,l,c,h,f,p,d,b,m,v,g,k,S,_=new Array(64);for(a=0;a<=FNa-1;a++){for(r=-1,n=1;n<=FNa-1;n++)-1===r&&0!==e[n*FNa+a]&&(r=n);if(-1===r)for(i=e[a]*t[0]<<2,s=0;s<=FNa-1;s++)_[s*FNa+a]=i;else p=(m=((v=e[2*FNa+a]*t[2*FNa+a])+(g=e[6*FNa+a]*t[6*FNa+a]))*KNa)+g*(0-SNa),d=m+v*MNa,l=(o=(v=e[a]*t[a])+(g=e[4*FNa+a]*t[4*FNa+a])<<13)+d,f=o-d,c=(u=v-g<<13)+p,h=u-p,o=e[7*FNa+a]*t[7*FNa+a],u=e[5*FNa+a]*t[5*FNa+a],p=e[3*FNa+a]*t[3*FNa+a],m=o+(d=e[FNa+a]*t[FNa+a]),v=u+p,S=((g=o+p)+(k=u+d))*ONa,g*=0-TNa,k*=0-JNa,o=(o*=HNa)+(m*=0-NNa)+(g+=S),u=(u*=UNa)+(v*=0-VNa)+(k+=S),p=(p*=WNa)+v+g,d=(d*=QNa)+m+k,_[a]=l+d>>11,_[7*FNa+a]=l-d>>11,_[+FNa+a]=c+p>>11,_[6*FNa+a]=c-p>>11,_[2*FNa+a]=h+u>>11,_[5*FNa+a]=h-u>>11,_[3*FNa+a]=f+o>>11,_[4*FNa+a]=f-o>>11}for(a=0;a<=GNa-FNa;a+=FNa)p=(m=((v=_[a+2])+(g=_[a+6]))*KNa)+g*(0-SNa),d=m+v*MNa,l=(o=_[a]+_[a+4]<<13)+d,f=o-d,c=(u=_[a]-_[a+4]<<13)+p,h=u-p,o=_[a+7],u=_[a+5],p=_[a+3],m=o+(d=_[a+1]),v=u+p,S=((g=o+p)+(k=u+d))*ONa,g*=0-TNa,k*=0-JNa,o=(o*=HNa)+(m*=0-NNa)+(g+=S),u=(u*=UNa)+(v*=0-VNa)+(k+=S),p=(p*=WNa)+v+g,b=(l+(d=(d*=QNa)+m+k)>>18)+fOa,b=Math.min(b,bOa),b=Math.max(b,0),e[a]=b,b=(l-d>>18)+fOa,b=Math.min(b,bOa),b=Math.max(b,0),e[a+7]=b,b=(c+p>>18)+fOa,b=Math.min(b,bOa),b=Math.max(b,0),e[a+1]=b,b=(c-p>>18)+fOa,b=Math.min(b,bOa),b=Math.max(b,0),e[a+6]=b,b=(h+u>>18)+fOa,b=Math.min(b,bOa),b=Math.max(b,0),e[a+2]=b,b=(h-u>>18)+fOa,b=Math.min(b,bOa),b=Math.max(b,0),e[a+5]=b,b=(f+o>>18)+fOa,b=Math.min(b,bOa),b=Math.max(b,0),e[a+3]=b,b=(f-o>>18)+fOa,b=Math.min(b,bOa),b=Math.max(b,0),e[a+4]=b}(e.wordsAsInt32Array(),t),void qOa.pop(2)):qOa.primitiveFail()):qOa.primitiveFail())}function XOa(e,t){return e=vNa}function $Oa(e){return EOa(COa,e)&&FOa(BOa,e)}function cRa(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function dRa(e,t){return 0|Math.floor(e/t)}function eRa(e,t){return e-dRa(e,t)*t|0}function nRa(e,t){var r,i;return 0===e?0<=t?90:270:(r=t/e,i=Math.atan(r),0<=e?0<=t?i/.0174532925199433:360+i/.0174532925199433:180+i/.0174532925199433)}function oRa(e){var t,r;return r=(t=90-e)/360|0,t<0&&--r,.0174532925199433*(t-360*r)}function pRa(){var e,t,r,i,a,s,n,o,u,l,c,h,f,p,d,b;if(l=gRa.stackValue(0),t=gRa.stackValue(1),b=gRa.stackValue(2),f=gRa.stackValue(3),i=gRa.stackIntegerValue(4),s=gRa.stackIntegerValue(5),a=gRa.stackValue(6),gRa.failed())return null;if(!gRa.isWords(a))return gRa.primitiveFail(),null;if(!gRa.isWords(f))return gRa.primitiveFail(),null;if(!gRa.isWords(b))return gRa.primitiveFail(),null;if(!gRa.isWords(t))return gRa.primitiveFail(),null;if(!gRa.isBytes(l))return gRa.primitiveFail(),null;if(i*s!==cRa(a))return gRa.primitiveFail(),null;if(o=cRa(f),cRa(b)!==o)return gRa.primitiveFail(),null;if(cRa(t)!==o)return gRa.primitiveFail(),null;if(cRa(l)!==o)return gRa.primitiveFail(),null;for(h=f.wordsAsFloat32Array(),d=b.wordsAsFloat32Array(),e=t.words,u=l.bytes,r=a.words,n=0;n<=o-1;n++)c=0|h[n],p=0|d[n],0!==u[n]&&0<=c&&0<=p&&c>>16,e<0?0-a:a}function vRa(){var e;if(e=gRa.stackIntegerValue(0),gRa.failed())return null;hRa=65536&e,gRa.pop(1)}function wRa(){var e,t,r,i,a,s,n,o,u,l,c,h;if(l=gRa.stackIntegerValue(0),u=gRa.stackIntegerValue(1),o=gRa.stackValue(2),i=gRa.stackValue(3),gRa.failed())return null;if((a=cRa(i))!==cRa(o))return gRa.primitiveFail(),null;if(l<-32)return gRa.primitiveFail(),null;if(8>>0-h:31=bRa}function YRa(){var e,t,r;return e=gRa.stackFloatValue(0),t=gRa.stackValue(1),r=gRa.stackIntegerValue(2),gRa.failed()?null:!gRa.isWords(t)||cRa(t)>>16,e<0?0-a:a}function w_a(){var e;if(e=h_a.stackIntegerValue(0),h_a.failed())return null;i_a=65536&e,h_a.pop(1)}function x_a(){var e,t,r,i,a,s,n,o,u,l,c,h;if(l=h_a.stackIntegerValue(0),u=h_a.stackIntegerValue(1),o=h_a.stackValue(2),i=h_a.stackValue(3),h_a.failed())return null;if((a=d_a(i))!==d_a(o))return h_a.primitiveFail(),null;if(l<-32)return h_a.primitiveFail(),null;if(8>>0-h:31=l[a];else for(c=o.words,r=e.wordsAsFloat32Array(),t=u.bytes,a=0;a<=n-1;a++)t[a]=c[a]>=r[a];else if(s)for(i=o.wordsAsFloat32Array(),l=e.words,t=u.bytes,a=0;a<=n-1;a++)t[a]=i[a]>=l[a];else for(i=o.wordsAsFloat32Array(),r=e.wordsAsFloat32Array(),t=u.bytes,a=0;a<=n-1;a++)t[a]=i[a]>=r[a];h_a.pop(4),h_a.push(u)}function P_a(){var e,t,r,i,a,s,n,o,u,l,c;if(l=h_a.stackObjectValue(0),e=h_a.stackValue(1),u=h_a.stackObjectValue(2),h_a.failed())return null;if(h_a.success(h_a.isWords(u)),h_a.success(h_a.isBytes(l)),h_a.failed())return null;if(o=d_a(u),h_a.success(o===d_a(l)),h_a.failed())return null;if(n="number"==typeof e,h_a.isMemberOf(u,"WordArray"))if(n)for(c=u.words,s=e,t=l.bytes,a=0;a<=o-1;a++)t[a]=c[a]>=s;else for(c=u.words,r=h_a.floatValueOf(e),t=l.bytes,a=0;a<=o-1;a++)t[a]=c[a]>=r;else if(n)for(i=u.wordsAsFloat32Array(),s=e,t=l.bytes,a=0;a<=o-1;a++)t[a]=i[a]>=s;else for(i=u.wordsAsFloat32Array(),r=h_a.floatValueOf(e),t=l.bytes,a=0;a<=o-1;a++)t[a]=i[a]>=r;h_a.pop(4),h_a.push(l)}function Q_a(){var e,t,r,i,a,s,n,o,u,l,c;if(u=h_a.stackObjectValue(0),e=h_a.stackObjectValue(1),o=h_a.stackObjectValue(2),h_a.failed())return null;if(h_a.success(h_a.isWords(e)),h_a.success(h_a.isWords(o)),h_a.success(h_a.isBytes(u)),h_a.failed())return null;if(n=d_a(e),h_a.success(n===d_a(o)),h_a.success(n===d_a(u)),h_a.failed())return null;if(s=h_a.isMemberOf(e,"WordArray"),h_a.isMemberOf(o,"WordArray"))if(s)for(c=o.words,l=e.words,t=u.bytes,a=0;a<=n-1;a++)t[a]=c[a]>l[a];else for(c=o.words,r=e.wordsAsFloat32Array(),t=u.bytes,a=0;a<=n-1;a++)t[a]=c[a]>r[a];else if(s)for(i=o.wordsAsFloat32Array(),l=e.words,t=u.bytes,a=0;a<=n-1;a++)t[a]=i[a]>l[a];else for(i=o.wordsAsFloat32Array(),r=e.wordsAsFloat32Array(),t=u.bytes,a=0;a<=n-1;a++)t[a]=i[a]>r[a];h_a.pop(4),h_a.push(u)}function R_a(){var e,t,r,i,a,s,n,o,u,l,c;if(l=h_a.stackObjectValue(0),e=h_a.stackValue(1),u=h_a.stackObjectValue(2),h_a.failed())return null;if(h_a.success(h_a.isWords(u)),h_a.success(h_a.isBytes(l)),h_a.failed())return null;if(o=d_a(u),h_a.success(o===d_a(l)),h_a.failed())return null;if(n="number"==typeof e,h_a.isMemberOf(u,"WordArray"))if(n)for(c=u.words,s=e,t=l.bytes,a=0;a<=o-1;a++)t[a]=c[a]>s;else for(c=u.words,r=h_a.floatValueOf(e),t=l.bytes,a=0;a<=o-1;a++)t[a]=c[a]>r;else if(n)for(i=u.wordsAsFloat32Array(),s=e,t=l.bytes,a=0;a<=o-1;a++)t[a]=i[a]>s;else for(i=u.wordsAsFloat32Array(),r=h_a.floatValueOf(e),t=l.bytes,a=0;a<=o-1;a++)t[a]=i[a]>r;h_a.pop(4),h_a.push(l)}function S_a(){var e,t,r,i,a,s,n,o,u,l,c;if(u=h_a.stackObjectValue(0),e=h_a.stackObjectValue(1),o=h_a.stackObjectValue(2),h_a.failed())return null;if(h_a.success(h_a.isWords(e)),h_a.success(h_a.isWords(o)),h_a.success(h_a.isBytes(u)),h_a.failed())return null;if(n=d_a(e),h_a.success(n===d_a(o)),h_a.success(n===d_a(u)),h_a.failed())return null;if(s=h_a.isMemberOf(e,"WordArray"),h_a.isMemberOf(o,"WordArray"))if(s)for(c=o.words,l=e.words,t=u.bytes,a=0;a<=n-1;a++)t[a]=c[a]<=l[a];else for(c=o.words,r=e.wordsAsFloat32Array(),t=u.bytes,a=0;a<=n-1;a++)t[a]=c[a]<=r[a];else if(s)for(i=o.wordsAsFloat32Array(),l=e.words,t=u.bytes,a=0;a<=n-1;a++)t[a]=i[a]<=l[a];else for(i=o.wordsAsFloat32Array(),r=e.wordsAsFloat32Array(),t=u.bytes,a=0;a<=n-1;a++)t[a]=i[a]<=r[a];h_a.pop(4),h_a.push(u)}function T_a(){var e,t,r,i,a,s,n,o,u,l,c;if(l=h_a.stackObjectValue(0),e=h_a.stackValue(1),u=h_a.stackObjectValue(2),h_a.failed())return null;if(h_a.success(h_a.isWords(u)),h_a.success(h_a.isBytes(l)),h_a.failed())return null;if(o=d_a(u),h_a.success(o===d_a(l)),h_a.failed())return null;if(n="number"==typeof e,h_a.isMemberOf(u,"WordArray"))if(n)for(c=u.words,s=e,t=l.bytes,a=0;a<=o-1;a++)t[a]=c[a]<=s;else for(c=u.words,r=h_a.floatValueOf(e),t=l.bytes,a=0;a<=o-1;a++)t[a]=c[a]<=r;else if(n)for(i=u.wordsAsFloat32Array(),s=e,t=l.bytes,a=0;a<=o-1;a++)t[a]=i[a]<=s;else for(i=u.wordsAsFloat32Array(),r=h_a.floatValueOf(e),t=l.bytes,a=0;a<=o-1;a++)t[a]=i[a]<=r;h_a.pop(4),h_a.push(l)}function U_a(){var e,t,r,i,a,s,n,o,u,l,c;if(u=h_a.stackObjectValue(0),e=h_a.stackObjectValue(1),o=h_a.stackObjectValue(2),h_a.failed())return null;if(h_a.success(h_a.isWords(e)),h_a.success(h_a.isWords(o)),h_a.success(h_a.isBytes(u)),h_a.failed())return null;if(n=d_a(e),h_a.success(n===d_a(o)),h_a.success(n===d_a(u)),h_a.failed())return null;if(s=h_a.isMemberOf(e,"WordArray"),h_a.isMemberOf(o,"WordArray"))if(s)for(c=o.words,l=e.words,t=u.bytes,a=0;a<=n-1;a++)t[a]=c[a]>>0,m[i]=r);if(!b&&!o)for(m=v.words,h=l.words,i=p-1;i<=d-1;i++)1===a[i]&&(m[i]=h[c+i-p]);h_a.pop(4)}function g0a(){var e,t,r,i,a,s,n,o,u,l,c,h,f,p,d,b,m,v,g;if(f=h_a.stackObjectValue(0),e=h_a.stackObjectValue(1),h=h_a.stackObjectValue(2),h_a.failed())return null;if(h_a.success(h_a.isWords(e)),h_a.success(h_a.isWords(h)),h_a.success(h_a.isWords(f)),h_a.failed())return null;if(c=d_a(e),h_a.success(c===d_a(h)),h_a.success(c===d_a(f)),h_a.failed())return null;if(u=h_a.isMemberOf(e,"WordArray"),l=h_a.isMemberOf(h,"WordArray"),u&&l){if(!h_a.isMemberOf(f,"WordArray"))return h_a.primitiveFail(),null}else if(!h_a.isMemberOf(f,"KedamaFloatArray"))return h_a.primitiveFail(),null;if(l)if(u)for(v=h.words,m=e.words,g=f.words,o=0;o<=c-1;o++)b=f_a(d=v[o],p=m[o]),g[o]=b;else for(v=h.words,a=e.wordsAsFloat32Array(),n=f.wordsAsFloat32Array(),o=0;o<=c-1;o++)i=(d=v[o])/(t=a[o]),i=Math.floor(i),n[o]=d-i*t;else if(u)for(s=h.wordsAsFloat32Array(),m=e.words,n=f.wordsAsFloat32Array(),o=0;o<=c-1;o++)i=(r=s[o])/(p=m[o]),i=Math.floor(i),n[o]=r-i*p;else for(s=h.wordsAsFloat32Array(),a=e.wordsAsFloat32Array(),n=f.wordsAsFloat32Array(),o=0;o<=c-1;o++)i=(r=s[o])/(t=a[o]),i=Math.floor(i),n[o]=r-i*t;h_a.pop(4),h_a.push(f)}function h0a(){var e,t,r,i,a,s,n,o,u,l,c,h,f,p,d,b;if(f=h_a.stackObjectValue(0),e=h_a.stackValue(1),h=h_a.stackObjectValue(2),h_a.failed())return null;if(h_a.success(h_a.isWords(h)),h_a.success(h_a.isWords(f)),h_a.failed())return null;if(c=d_a(h),h_a.success(c===d_a(f)),h_a.failed())return null;if(u="number"==typeof e,l=h_a.isMemberOf(h,"WordArray"),u&&l){if(!h_a.isMemberOf(f,"WordArray"))return h_a.primitiveFail(),null}else if(!h_a.isMemberOf(f,"KedamaFloatArray"))return h_a.primitiveFail(),null;if(l)if(u)for(d=h.words,o=e,b=f.words,n=0;n<=c-1;n++)b[n]=f_a(d[n],o);else for(d=h.words,t=h_a.floatValueOf(e),s=f.wordsAsFloat32Array(),n=0;n<=c-1;n++)i=(p=d[n])/t,i=Math.floor(i),s[n]=p-i*t;else if(u)for(a=h.wordsAsFloat32Array(),o=e,s=f.wordsAsFloat32Array(),n=0;n<=c-1;n++)i=(r=a[n])/o,i=Math.floor(i),s[n]=r-i*o;else for(a=h.wordsAsFloat32Array(),t=h_a.floatValueOf(e),s=f.wordsAsFloat32Array(),n=0;n<=c-1;n++)i=(r=a[n])/t,i=Math.floor(i),s[n]=r-i*t;h_a.pop(4),h_a.push(f)}function i0a(){var e,t,r,i,a,s,n,o,u,l,c,h,f;if(l=h_a.stackObjectValue(0),e=h_a.stackObjectValue(1),u=h_a.stackObjectValue(2),h_a.failed())return null;if(h_a.success(h_a.isWords(e)),h_a.success(h_a.isWords(u)),h_a.success(h_a.isWords(l)),h_a.failed())return null;if(o=d_a(e),h_a.success(o===d_a(u)),h_a.success(o===d_a(l)),h_a.failed())return null;if(s=h_a.isMemberOf(e,"WordArray"),n=h_a.isMemberOf(u,"WordArray"),s&&n){if(!h_a.isMemberOf(l,"WordArray"))return h_a.primitiveFail(),null}else if(!h_a.isMemberOf(l,"KedamaFloatArray"))return h_a.primitiveFail(),null;if(n)if(s)for(h=u.words,c=e.words,f=l.words,a=0;a<=o-1;a++)f[a]=h[a]-c[a];else for(h=u.words,t=e.wordsAsFloat32Array(),i=l.wordsAsFloat32Array(),a=0;a<=o-1;a++)i[a]=h[a]-t[a];else if(s)for(r=u.wordsAsFloat32Array(),c=e.words,i=l.wordsAsFloat32Array(),a=0;a<=o-1;a++)i[a]=r[a]-c[a];else for(r=u.wordsAsFloat32Array(),t=e.wordsAsFloat32Array(),i=l.wordsAsFloat32Array(),a=0;a<=o-1;a++)i[a]=r[a]-t[a];h_a.pop(4),h_a.push(l)}function j0a(){var e,t,r,i,a,s,n,o,u,l,c,h,f;if(c=h_a.stackObjectValue(0),e=h_a.stackValue(1),l=h_a.stackObjectValue(2),h_a.failed())return null;if(h_a.success(h_a.isWords(l)),h_a.success(h_a.isWords(c)),h_a.failed())return null;if(u=d_a(l),h_a.success(u===d_a(c)),h_a.failed())return null;if(n="number"==typeof e,o=h_a.isMemberOf(l,"WordArray"),n&&o){if(!h_a.isMemberOf(c,"WordArray"))return h_a.primitiveFail(),null}else if(!h_a.isMemberOf(c,"KedamaFloatArray"))return h_a.primitiveFail(),null;if(o)if(n)for(h=l.words,s=e,f=c.words,a=0;a<=u-1;a++)f[a]=h[a]-s;else for(h=l.words,t=h_a.floatValueOf(e),i=c.wordsAsFloat32Array(),a=0;a<=u-1;a++)i[a]=h[a]-t;else if(n)for(r=l.wordsAsFloat32Array(),s=e,i=c.wordsAsFloat32Array(),a=0;a<=u-1;a++)i[a]=r[a]-s;else for(r=l.wordsAsFloat32Array(),t=h_a.floatValueOf(e),i=c.wordsAsFloat32Array(),a=0;a<=u-1;a++)i[a]=r[a]-t;h_a.pop(4),h_a.push(c)}function k0a(e){var t;return 0<(t=90-e/.0174532925199433)||(t+=360),t}function l0a(){var e,t,r,i,a,s,n;if(e=h_a.stackFloatValue(0),r=h_a.stackValue(1),n=h_a.stackIntegerValue(2),i=h_a.stackIntegerValue(3),s=h_a.stackIntegerValue(4),h_a.failed())return null;if(!h_a.isWords(r))return h_a.primitiveFail(),null;if(!(n<=d_a(r)&&1<=i&&i<=n))return h_a.primitiveFail(),null;if(t=r.wordsAsFloat32Array(),h_a.failed())return null;for(a=i;a<=n;a++)t[a-1]=v_a(s)*e;h_a.pop(5)}function m0a(){var e,t,r,i,a,s,n;if(e=h_a.stackFloatValue(0),a=h_a.stackValue(1),n=h_a.stackIntegerValue(2),t=h_a.stackIntegerValue(3),s=h_a.stackIntegerValue(4),h_a.failed())return null;if(!h_a.isWords(a))return h_a.primitiveFail(),null;if(!(n<=d_a(a)&&1<=t&&t<=n))return h_a.primitiveFail(),null;if(i=a.words,h_a.failed())return null;for(r=t;r<=n;r++)i[r-1]=v_a(s)*e|0;h_a.pop(5)}function n0a(){var e,t;return e=h_a.stackIntegerValue(0),h_a.failed()?null:(t=v_a(e),h_a.failed()?null:(h_a.pop(2),void h_a.pushInteger(t)))}function o0a(){var e,t,r,i,a;return t=h_a.stackFloatValue(0),e=h_a.stackFloatValue(1),a=h_a.stackFloatValue(2),i=h_a.stackFloatValue(3),h_a.failed()?null:(r=o_a(i-e,a-t),360<(r+=90)&&(r-=360),h_a.failed()?null:(h_a.pop(5),void h_a.pushFloat(r)))}function p0a(){var e,t,r,i,a,s,n;return t=h_a.stackFloatValue(0),e=h_a.stackFloatValue(1),a=h_a.stackFloatValue(2),i=h_a.stackFloatValue(3),h_a.failed()?null:(s=e-i,n=t-a,r=Math.sqrt(s*s+n*n),h_a.failed()?null:(h_a.pop(5),void h_a.pushFloat(r)))}function q0a(e,t,r,i,a,s,n){var o,u;(u=i)<0&&(1===s&&(u+=a),2===s&&(u=0),3===s&&(u=0-u,o=r[e],r[e]=o<3.141592653589793?3.141592653589793-o:9.42477796076938-o)),a<=u&&(1===n&&(u-=a),2===n&&(u=a-1e-6),3===n&&(u=a-1e-6-(u-a),o=r[e],r[e]=o<3.141592653589793?3.141592653589793-o:9.42477796076938-o)),t[e]=u}function r0a(e,t,r,i,a,s,n){var o;(o=i)<0&&(1===s&&(o+=a),2===s&&(o=0),3===s&&(o=0-o,r[e]=6.283185307179586-r[e])),a<=o&&(1===n&&(o-=a),2===n&&(o=a-1e-6),3===n&&(o=a-1e-6-(o-a),r[e]=6.283185307179586-r[e])),t[e]=o}function s0a(){var e,t,r,i,a,s,n,o,u,l;if(u=h_a.stackValue(0),r=h_a.stackValue(1),n=h_a.stackValue(2),h_a.failed())return null;if(!h_a.isBytes(n))return h_a.primitiveFail(),null;if(!h_a.isWords(r))return h_a.primitiveFail(),null;if(l=d_a(r),u.isFloat)a=!1;else{if(!h_a.isWords(u))return h_a.primitiveFail(),null;if(d_a(u)!==l)return h_a.primitiveFail(),null;a=!0}for(s=n.bytes,t=r.wordsAsFloat32Array(),a?o=u.wordsAsFloat32Array():e=p_a(e=h_a.floatValueOf(u)),i=0;i<=l-1;i++)1===s[i]&&(a&&(e=p_a(e=o[i])),t[i]=e);if(h_a.failed())return null;h_a.pop(3)}function t0a(e){return!1!=((h_a=e).majorVersion()==b_a)&&h_a.minorVersion()>=c_a}function u0a(){var e,t,r;return e=h_a.stackFloatValue(0),t=h_a.stackValue(1),r=h_a.stackIntegerValue(2),h_a.failed()?null:!h_a.isWords(t)||d_a(t)>=1);rgb=Agb*lgb[$fb]|0,function(e,t,r){var i,a,s,n,o,u,l,c,h,f,p,d,b,m;f=(d=Agb*e|0)/Agb,h=r,a=(l=t)<=0?1:1-(u=(1-f)/l)/(Math.exp(u)-1);o=Dfb*(h+1),i=Math.cos(o),p=Math.sin(o),m=function(e,t,r,i){var a,s,n,o,u,l,c;if(0<(o=Ygb(0,e,t,r,i)))for(u=0,a=o,s=Ygb(l=1,e,t,r,i);0=xgb),ngb.failed()?null:(function(e,t,r){var i,a,s,n,o,u,l,c,h,f,p,d,b,m,v,g,k,S,_;(function(e){var t,r,i,a,s,n,o,u,l,c,h;c=.6*Qgb((lgb=e)[Veb]),h=.6*Qgb(lgb[Xeb]),t=.4*Qgb(lgb[Meb]),i=.15*Qgb(lgb[Oeb]),s=.06*Qgb(lgb[Qeb]),o=.04*Qgb(lgb[Seb]),r=.15*Qgb(lgb[Neb]),a=.06*Qgb(lgb[Peb]),n=.04*Qgb(lgb[Reb]),u=.022*Qgb(lgb[Teb]),l=.03*Qgb(lgb[Ueb]),8<=kgb&&(16e3<=ygb?Zgb(Ufb,7500,600):kgb=6);7<=kgb&&(16e3<=ygb?Zgb(Tfb,6500,500):kgb=6);6<=kgb&&Zgb(Rfb,lgb[ufb],lgb[ffb]);5<=kgb&&Zgb(Pfb,lgb[tfb],lgb[dfb]);Zgb(Mfb,lgb[sfb],lgb[bfb]),Zgb(Jfb,lgb[rfb],lgb[_eb]),Zgb(Gfb,lgb[qfb],lgb[Zeb]),Zgb(Efb,lgb[pfb],lgb[Yeb]),Zgb(Xfb,lgb[wfb],lgb[hfb]),Zgb(agb,lgb[zfb],lgb[jfb]),Jgb(Zfb,lgb[xfb],lgb[ifb]),Jgb(cgb,lgb[Afb],lgb[kfb]),$gb(Yfb,lgb[wfb],lgb[hfb],c),$gb(bgb,lgb[zfb],lgb[jfb],h),$gb(Ffb,lgb[pfb],lgb[Yeb],t),$gb(Ifb,lgb[qfb],lgb[Zeb],i),$gb(Lfb,lgb[rfb],lgb[_eb],s),$gb(Ofb,lgb[sfb],lgb[bfb],o),$gb(Hfb,lgb[qfb],lgb[$eb],r),$gb(Kfb,lgb[rfb],lgb[afb],a),$gb(Nfb,lgb[sfb],lgb[cfb],n),$gb(Qfb,lgb[tfb],lgb[efb],u),$gb(Sfb,lgb[ufb],lgb[gfb],l)})(e),0=Ieb}function okb(e){return"number"==typeof e?vkb.classSmallInteger():e.sqClass}function pkb(e){return e.bytes?e.bytes.length:e.words?4*e.words.length:0}function qkb(e,t){return 0|Math.floor(e/t)}function rkb(e,t){return e-qkb(e,t)*t|0}function skb(e,t){return 31>>t}function zkb(e,t,r){var i,a,s,n,o,u,l,c,h;if(t<1||r<1)return vkb.primitiveFail();if(a=e,!((u=Math.min(r,Hkb((h=a).bytes,pkb(h))))>3),i=1+(u-1>>3),n=rkb(t-1,8),s=7-rkb(u-1,8),o==i)return l=skb(255,n)&tkb(255,s),0!=(alb(a,o)&l);if(0!==tkb(alb(a,o),n))return 1;for(c=1+o;c<=i-1;c++)if(0!==alb(a,c))return 1;return 0!=(255&skb(alb(a,i),s))}}function Akb(e,t){var r,i,a;return a=vkb.instantiateClassindexableSize(okb(e),t),i=(r=pkb(e))>>=16,r+=16),t<256||(t>>>=8,r+=8),t<16||(t>>>=4,r+=4),t<4||(t>>>=2,r+=2),t<2||(t>>>=1,++r),r+t}function Skb(e){var t,r,i,a,s,n;for(s=(n=e)<0?vkb.classLargeNegativeInteger():vkb.classLargePositiveInteger(),t=Ikb(n),i=(r=vkb.instantiateClassindexableSize(s,t)).bytes,a=1;a<=t;a++)i[a-1]=Mkb(n,a);return r}function Tkb(e,t){var r,i,a,s;return i=pkb(e),0===(s=Hkb(e.bytes,i))?0:(r=s+t+7>>3,a=vkb.instantiateClassindexableSize(okb(e),r),function(e,t,r,i,a){var s,n,o,u,l,c,h;for(s=e>>3,l=rkb(e,8),h=s-1,u=0;u<=h;u++)i[u]=0;if(0===l)return Okb(i,s,a-1,t,0);for(c=8-l,h=r-1,u=n=0;u<=h;u++)o=t[u],i[u+s]=255&(n|skb(o,l)),n=tkb(o,c);0!==n&&(i[a-1]=n)}(t,e.bytes,i,a.bytes,r),a)}function Ukb(e,t,r){var i,a,s,n,o;return a=(o=Hkb(e.bytes,r))+7>>3,(n=o-t)<=0?vkb.instantiateClassindexableSize(okb(e),0):(s=7+n>>3,i=vkb.instantiateClassindexableSize(okb(e),s),function(e,t,r,i,a){var s,n,o,u,l,c,h,f;if(n=e>>3,0===(l=rkb(e,8)))return Okb(i,0,a-1,t,n);for(c=8-l,o=tkb(t[n],l),h=r-1,s=f=1+n;s<=h;s++)u=t[s],i[s-f]=255&(o|skb(u,c)),o=tkb(u,l);0!==o&&(i[a-1]=o)}(t,e.bytes,a,i.bytes,s),i)}function Vkb(e,t){var r,i,a,s,n,o,u,l,c,h;return l=pkb(e),c=pkb(t),n=okb(e),u=l<=c?(s=e,i=l,h=t,c):(s=t,i=c,h=e,l),r=vkb.instantiateClassindexableSize(n,u),0<(a=function(e,t,r,i,a){var s,n,o;for(n=t-1,s=o=0;s<=n;s++)o=(o>>>8)+e[s]+r[s],a[s]=255&o;for(n=i-1,s=t;s<=n;s++)o=(o>>>8)+r[s],a[s]=255&o;return o>>>8}(s.bytes,i,h.bytes,u,r.bytes))&&(o=vkb.instantiateClassindexableSize(n,u+1),Fkb(r.bytes,o.bytes,u),(r=o).bytes[u]=a),r}function Wkb(e,t,r){var i,a,s,n,o,u,l,c,h;if("number"==typeof e){if(e<0)return vkb.primitiveFail();s=Skb(e)}else{if(okb(e)===vkb.classLargeNegativeInteger())return vkb.primitiveFail();s=e}if("number"==typeof t){if(t<0)return vkb.primitiveFail();n=Skb(t)}else{if(okb(t)===vkb.classLargeNegativeInteger())return vkb.primitiveFail();n=t}return u=(l=pkb(s))<(c=pkb(n))?(i=l,a=s,o=c,n):(i=c,a=n,o=l,s),h=vkb.instantiateClassindexableSize(vkb.classLargePositiveInteger(),o),function(e,t,r,i,a,s){var n,o;if(o=r-1,e!==ukb)if(e!==xkb){if(e!==ykb)return vkb.primitiveFail();for(n=0;n<=o;n++)s[n]=t[n]^i[n];for(o=a-1,n=r;n<=o;n++)s[n]=i[n]}else{for(n=0;n<=o;n++)s[n]=t[n]|i[n];for(o=a-1,n=r;n<=o;n++)s[n]=i[n]}else{for(n=0;n<=o;n++)s[n]=t[n]&i[n];for(o=a-1,n=r;n<=o;n++)s[n]=0}}(r,a.bytes,i,u.bytes,o,h.bytes),vkb.failed()?0:hlb(h)}function Xkb(e,t){var r,i;return i=pkb(e),(r=pkb(t))!==i?i>>8,c=255&p,f=m<3?0:r[m-3];(y>>8),c=e[v-1]*(255&o),n=r[d-1]-u-(255&c),r[d-1]=255&n,u=h+(c>>>8)-(n>>=8),++d;if(0>>8)+r[d-1]+e[v-1],r[d-1]=255&u,++d;a[s-b]=o}}(n.bytes,Zkb(n),s.bytes,Zkb(s),o.bytes,Zkb(o)),s=Ukb(s,u,Zkb(n)-1),a=vkb.instantiateClassindexableSize(vkb.classArray(),2),vkb.stObjectatput(a,1,o),vkb.stObjectatput(a,2,s)),a}function Zkb(e){return("number"==typeof e?Ikb:pkb)(e)}function $kb(e,t,r,i){var a,s,n,o;return n=pkb(e),o=pkb(t),n<=(s=pkb(r))&&o<=s&&0<=i&&i<=255?(a=vkb.instantiateClassindexableSize(vkb.classLargePositiveInteger(),s),function(e,t,r,i,a,s,n,o){var u,l,c,h,f,p,d,b;for(p=t-1,f=i-1,h=s-1,l=c=0;l<=p;l++){for(b=o[0]+e[l]*r[0],b+=(d=b*n&255)*a[0],u=1;u<=f;u++)b=(b>>>8)+o[u]+e[l]*r[u]+d*a[u],o[u-1]=255&b;for(u=i;u<=h;u++)b=(b>>>8)+o[u]+d*a[u],o[u-1]=255&b;b=(b>>>8)+c,o[h]=255&b,c=b>>>8}for(l=t;l<=h;l++){for(b=o[0],b+=(d=b*n&255)*a[0],u=1;u<=h;u++)b=(b>>>8)+o[u]+d*a[u],o[u-1]=255&b;b=(b>>>8)+c,o[h]=255&b,c=b>>>8}if(0!==c||1!==Ekb(a,o,s))for(l=b=0;l<=h;l++)b=b+o[l]-a[l],o[l]=255&b,b>>=8}(e.bytes,n,t.bytes,o,r.bytes,s,i,a.bytes),hlb(a)):vkb.primitiveFail()}function _kb(e,t,r){var i,a,s,n,o,u,l,c;return o=(c=pkb(e))<=(l=pkb(t))?(n=e,s=c,i=t,l):(n=t,s=l,i=e,c),a=r?vkb.classLargeNegativeInteger():vkb.classLargePositiveInteger(),u=vkb.instantiateClassindexableSize(a,o+s),function(e,t,r,i,a){var s,n,o,u,l,c,h,f;if(!(1===t&&0===e[0]||1===i&&0===r[0]))for(f=t-1,c=i-1,l=0;l<=f;l++)if(0!==(o=e[l])){for(h=l,n=u=0;n<=c;n++)u=(s=(s=r[n])*o+u+a[h])>>>8,a[h]=255&s,++h;a[h]=u}}(n.bytes,s,i.bytes,o,u.bytes),flb(u)}function alb(e,t){return t>pkb(e)?0:Ilb(e,t)}function blb(e,t){var r,i,a,s,n,o,u,l,c,h;if(u=okb(e)===vkb.classLargeNegativeInteger(),(l=pkb(e))===(c=pkb(t))){for(;1>=8;for(s=t;s<=i-1;s++)n+=r[s],a[s]=255&n,n>>=8}(s.bytes,r,i.bytes,o,a.bytes),(h?glb:hlb)(a)}function clb(){return wkb}function elb(e){var t,r;if("number"==typeof e)return 1;if(0!==(r=Zkb(e))&&0!==Ilb(e,r)){if(4Mkb(1073741823,4);if(!(Ilb(e,4)(r=i)?(a=1,vkb.failed()||vkb.popthenPush(2,a),null):(a=e(t=i)?(a=1,vkb.failed()||vkb.popthenPush(3,a),null):(a=e=nkb}function Ilb(e,t){return e.bytes[t-1]}function ctb(e){return"number"==typeof e?etb.classSmallInteger():e.sqClass}function dtb(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function ktb(){return jtb}function ltb(e){return etb.failed()?null:etb.isWords(e)&&6===dtb(e)?e.wordsAsFloat32Array():(etb.primitiveFail(),null)}function mtb(e){var t,r;if(!etb.failed()){if(ctb(e)!==etb.classPoint())return etb.primitiveFail();if(!(t="number"==typeof(r=etb.fetchPointerofObject(0,e)))&&!r.isFloat)return etb.primitiveFail();if(ftb=t?r:etb.floatValueOf(r),!(t="number"==typeof(r=etb.fetchPointerofObject(1,e)))&&!r.isFloat)return etb.primitiveFail();gtb=t?r:etb.floatValueOf(r)}}function otb(e){var t,r,i,a,s;if(a=ftb-e[2],s=gtb-e[5],0===(t=e[0]*e[4]-e[1]*e[3]))return etb.primitiveFail();t=1/t,r=a*e[4]-e[1]*s,i=e[0]*s-a*e[3],htb=r*t,itb=i*t}function ptb(e){htb=ftb*e[0]+gtb*e[1]+e[2],itb=ftb*e[3]+gtb*e[4]+e[5]}function qtb(e){return-1073741824<=e&&htb<=1073741823}function rtb(e){var t,r,i,a,s,n,o,u,l,c,h,f,p;if(i=ltb(a=etb.stackObjectValue(0)),r=ltb(etb.stackObjectValue(1)),t=ltb(etb.stackObjectValue(2)),etb.failed())return null;n=r,o=i,u=(s=t)[0]*n[0]+s[1]*n[3],l=s[0]*n[1]+s[1]*n[4],c=s[0]*n[2]+s[1]*n[5]+s[2],h=s[3]*n[0]+s[4]*n[3],f=s[3]*n[1]+s[4]*n[4],p=s[3]*n[2]+s[4]*n[5]+s[5],o[0]=u,o[1]=l,o[2]=c,o[3]=h,o[4]=f,o[5]=p,etb.popthenPush(e+1,a)}function stb(e){var t;if(mtb(etb.stackObjectValue(0)),t=ltb(etb.stackObjectValue(1)),etb.failed())return null;otb(t),etb.failed()||ytb(e)}function ttb(e){var t,r,i,a,s,n,o,u,l,c,h;return i=etb.stackObjectValue(0),h=etb.stackObjectValue(1),a=ltb(etb.stackObjectValue(2)),etb.failed()?null:ctb(h)!==ctb(i)||!etb.isPointers(h)||2!==dtb(h)?etb.primitiveFail():(mtb(etb.fetchPointerofObject(0,h)),etb.failed()?null:(l=ftb,c=gtb,otb(a),o=s=htb,u=n=itb,mtb(etb.fetchPointerofObject(1,h)),etb.failed()?null:(t=ftb,r=gtb,otb(a),o=Math.min(o,htb),s=Math.max(s,htb),u=Math.min(u,itb),n=Math.max(n,itb),ftb=t,gtb=c,otb(a),o=Math.min(o,htb),s=Math.max(s,htb),u=Math.min(u,itb),n=Math.max(n,itb),ftb=l,gtb=r,otb(a),o=Math.min(o,htb),s=Math.max(s,htb),u=Math.min(u,itb),n=Math.max(n,itb),etb.failed()||(i=ztb(i,o,u,s,n)),void(etb.failed()||etb.popthenPush(e+1,i)))))}function utb(e){var t;if(t=ltb(etb.stackObjectValue(0)),etb.failed())return null;etb.pop(1),etb.pushBool(1===t[0]&&0===t[1]&&0===t[2]&&0===t[3]&&1===t[4]&&0===t[5])}function vtb(e){var t;if(t=ltb(etb.stackObjectValue(0)),etb.failed())return null;etb.pop(1),etb.pushBool(1===t[0]&&0===t[1]&&0===t[3]&&1===t[4])}function wtb(e){var t;if(mtb(etb.stackObjectValue(0)),t=ltb(etb.stackObjectValue(1)),etb.failed())return null;ptb(t),ytb(e)}function xtb(e){var t,r,i,a,s,n,o,u,l,c,h;return i=etb.stackObjectValue(0),h=etb.stackObjectValue(1),a=ltb(etb.stackObjectValue(2)),etb.failed()?null:ctb(h)!==ctb(i)||!etb.isPointers(h)||2!==dtb(h)?etb.primitiveFail():(mtb(etb.fetchPointerofObject(0,h)),etb.failed()?null:(l=ftb,c=gtb,ptb(a),o=s=htb,u=n=itb,mtb(etb.fetchPointerofObject(1,h)),etb.failed()?null:(t=ftb,r=gtb,ptb(a),o=Math.min(o,htb),s=Math.max(s,htb),u=Math.min(u,itb),n=Math.max(n,itb),ftb=t,gtb=c,ptb(a),o=Math.min(o,htb),s=Math.max(s,htb),u=Math.min(u,itb),n=Math.max(n,itb),ftb=l,gtb=r,ptb(a),o=Math.min(o,htb),s=Math.max(s,htb),i=ztb(i,o,u=Math.min(u,itb),s,n=Math.max(n,itb)),void(etb.failed()||etb.popthenPush(e+1,i)))))}function ytb(e){return itb+=.5,qtb(htb+=.5)&&qtb(itb)?void etb.popthenPush(e+1,etb.makePointwithxValueyValue(0|htb,0|itb)):etb.primitiveFail()}function ztb(e,t,r,i,a){var s,n,o,u,l,c,h;return qtb(u=t+.5)&&qtb(n=i+.5)&&qtb(l=r+.5)&&qtb(o=a+.5)?(etb.pushRemappableOop(e),c=etb.makePointwithxValueyValue(0|u,0|l),etb.pushRemappableOop(c),s=etb.makePointwithxValueyValue(0|n,0|o),c=etb.popRemappableOop(),h=etb.popRemappableOop(),etb.storePointerofObjectwithValue(0,h,c),etb.storePointerofObjectwithValue(1,h,s),h):etb.primitiveFail()}function Atb(e){return!1!=((etb=e).majorVersion()==atb)&&etb.minorVersion()>=btb}function _ub(e,t){return e-(r=e,i=t,(0|Math.floor(r/i))*t)|0;var r,i}function dvb(e,t,r){var i,a,s;for(i=0;i<=3;i++)t[r+i-1]=255&(a=e,31<(s=8*(3-i))?0:a>>>s);return r+4}function evb(e,t,r){return e<=223?(t[r-1]=e,r+1):e<=7935?(t[r-1]=224+(e>>8),t[r]=_ub(e,256),r+2):(t[r-1]=255,dvb(e,t,r+1))}function fvb(){return cvb}function gvb(e){var t,r,i,a,s,n,o,u;if(bvb.stackValue(3),t=bvb.stackBytes(2),r=bvb.stackBytes(1),i=bvb.stackBytes(0),bvb.failed())return null;for(o=t.length,u=r.length,n=1;n<=Math.min(o,u);n++)if((a=i[t[n-1]])!==(s=i[r[n-1]]))return a>>8&255)==(o=255&c)&&(c>>>16&255)==o&&(c>>>24&255)==o,s=n;s>>2))return bvb.primitiveFail(),null;if(1==(s=3&a))for(n=r[u-1],++u,n|=n<<8,n|=n<<16,l=1;l<=f;l++)t[c-1]=n,++c;if(2==s){for(n=0,l=1;l<=4;l++)n=n<<8|r[u-1],++u;for(l=1;l<=f;l++)t[c-1]=n,++c}if(3==s)for(h=1;h<=f;h++){for(n=0,l=1;l<=4;l++)n=n<<8|r[u-1],++u;t[c-1]=n,++c}}if(bvb.failed())return null;bvb.pop(e)}function kvb(e){var t,r,i,a,s;if(bvb.stackValue(3),t=bvb.stackBytes(2),r=bvb.stackBytes(1),i=bvb.stackIntegerValue(0),bvb.failed())return null;if(256!==r.length)return bvb.failed()||bvb.popthenPush(e+1,0),null;for(a=i,s=t.length;a<=s&&0===r[t[a-1]];)++a;return s>>14)+101*s&16383)&268435455;return bvb.failed()||bvb.popthenPush(e+1,a),null}function ovb(e){var t,r,i,a,s;if(bvb.stackValue(4),t=bvb.stackBytes(3),r=bvb.stackIntegerValue(2),i=bvb.stackIntegerValue(1),a=bvb.stackBytes(0),bvb.failed())return null;for(s=r;s<=i;s++)t[s-1]=a[t[s-1]];if(bvb.failed())return null;bvb.pop(e)}function pvb(e){return!1!=((bvb=e).majorVersion()==Yub)&&bvb.minorVersion()>=Zub}function ixb(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function jxb(e,t){return 0|Math.floor(e/t)}function kxb(e,t){return e-jxb(e,t)*t|0}function nxb(e,t,r,i,a){var s,n,o,u,l,c,h;n=jxb(r,60),u=(1e3-i)*a,l=(1e3-jxb(i*(s=kxb(r,60)),60))*a,c=(1e3-jxb(i*(60-s),60))*a,h=jxb(1e3*a,3922),u=jxb(u,3922),l=jxb(l,3922),c=jxb(c,3922),0===n&&(o=(h<<16)+(c<<8)+u),1===n&&(o=(l<<16)+(h<<8)+u),2===n&&(o=(u<<16)+(h<<8)+c),3===n&&(o=(u<<16)+(l<<8)+h),4===n&&(o=(c<<16)+(u<<8)+h),5===n&&(o=(h<<16)+(u<<8)+l),0===o&&(o=1),e[t]=o}function oxb(e){return lxb.success(lxb.isWordsOrBytes(e)),lxb.failed()?0:e.wordsAsFloat64Array()}function pxb(e){return lxb.success(lxb.isWords(e)),lxb.failed()?0:e.words}function qxb(){return mxb}function rxb(e,t,r,i,a){var s,n;return 0==(n=a-i)?0:(s=e===a?jxb(60*(t-r),n):t===a?120+jxb(60*(r-e),n):240+jxb(60*(e-t),n))<0?s+360:s}function sxb(e,t,r){var i,a;return 0===e?t:0===t?e:(0===(a=((i=1024-r)*(e>>>16&255)+r*(t>>>16&255)>>10<<16)+(i*(e>>>8&255)+r*(t>>>8&255)>>10<<8)+(i*(255&e)+r*(255&t)>>10))&&(a=1),a)}function txb(e,t,r,i,a){var s,n,o,u,l,c,h;return(u=t>>>10)<-1||i<=u||(c=r>>>10)<-1||a<=c?0:(l=1023&t,-1===u&&(l=u=0),u===i-1&&(l=0),h=1023&r,-1===c&&(h=c=0),c===a-1&&(h=0),o=16777215&e[n=c*i+u],0>>16&255,i+=h>>>8&255,e+=255&h,++o);c=0===o?0:(jxb(f,o)<<16)+(jxb(i,o)<<8)+jxb(e,o),u[m*d+b]=c}return lxb.pop(3),0}function vxb(){var e,t,r,i,a,s,n,o,u,l,c,h,f,p,d,b;if(n=lxb.stackValue(2),c=lxb.stackValue(1),d=lxb.stackIntegerValue(0),s=pxb(n),b=ixb(n),l=pxb(c),lxb.success(ixb(c)===b),lxb.failed())return null;for(a=0;a<=b-1;a++)0!=(h=16777215&s[a])&&((o=u=f=h>>>16&255)<(r=h>>>8&255)&&(o=r),o<(e=255&h)&&(o=e),r=n>>1),lxb.failed())return null;for(a=s.wordsAsInt16Array(),e=t.wordsAsInt16Array(),i&&o++,r=1;r<=n;r++)e[u++]=a[o],o+=2;return lxb.pop(3),0}function zxb(){var e,t,r,i,a,s,n,o,u,l,c,h,f,p,d,b,m,v,g,k;if(o=lxb.stackValue(3),l=lxb.stackValue(2),v=lxb.stackIntegerValue(1),h=lxb.stackIntegerValue(0),n=pxb(o),u=pxb(l),m=ixb(o),lxb.success(ixb(l)===m),lxb.failed())return null;for(s=jxb(m,v),t=v>>1,r=(s=jxb(m,v))>>1,p=h/100,g=0;g<=v-1;g++)for(k=0;k<=s-1;k++)i=(g-t)/t,a=(k-r)/r,b=(f=Math.pow(Math.sqrt(i*i+a*a),p))<=1?(e=Math.atan2(a,i),d=1024*(t+f*Math.cos(e)*t)|0,1024*(r+f*Math.sin(e)*r)|0):(d=1024*g,1024*k),c=txb(n,d,b,v,s),u[k*v+g]=c;return lxb.pop(4),0}function Axb(){var e,t,r,i,a,s,n,o,u,l,c,h,f,p,d,b,m,v,g,k;if(o=pxb(lxb.stackValue(11)),l=lxb.stackIntegerValue(10),u=lxb.stackIntegerValue(9),c=pxb(lxb.stackValue(8)),f=lxb.stackIntegerValue(7),h=lxb.stackIntegerValue(6),m=lxb.stackIntegerValue(5),v=lxb.stackIntegerValue(4),a=lxb.stackIntegerValue(3),s=lxb.stackIntegerValue(2),i=lxb.stackIntegerValue(1),t=lxb.stackIntegerValue(0),lxb.success(0<=m&&0<=v),lxb.success(m+2*i<=l),lxb.success(v+2*t<=u),lxb.success(0<=a&&0<=s),lxb.success(a+i<=f),lxb.success(s+t<=h),lxb.failed())return null;for(k=0;k<=t-1;k++)for(b=l*(v+2*k)+m,r=f*(s+k)+a,g=0;g<=i-1;g++)d=16711680&(p=o[b]),n=65280&p,e=255&p,d+=16711680&(p=o[b+1]),n+=65280&p,e+=255&p,d+=16711680&(p=o[b+l]),n+=65280&p,e+=255&p,d+=16711680&(p=o[b+l+1]),n+=65280&p,e+=255&p,c[r]=d>>>2&16711680|n>>>2&65280|e>>>2,b+=2,++r;return lxb.pop(12),0}function Bxb(){var e,t,r,i,a,s,n,o,u,l,c,h,f,p,d,b,m,v,g,k,S;if(o=pxb(lxb.stackValue(11)),l=lxb.stackIntegerValue(10),u=lxb.stackIntegerValue(9),c=pxb(lxb.stackValue(8)),f=lxb.stackIntegerValue(7),h=lxb.stackIntegerValue(6),v=lxb.stackIntegerValue(5),g=lxb.stackIntegerValue(4),a=lxb.stackIntegerValue(3),s=lxb.stackIntegerValue(2),i=lxb.stackIntegerValue(1),t=lxb.stackIntegerValue(0),lxb.success(0<=v&&0<=g),lxb.success(v+2*i<=l),lxb.success(g+2*t<=u),lxb.success(0<=a&&0<=s),lxb.success(a+i<=f),lxb.success(s+t<=h),lxb.failed())return null;for(S=0;S<=t-1;S++)for(m=l*(g+2*S)+v,r=f*(s+S)+a,k=0;k<=i-1;k++)b=(16711680&(p=o[m]))+(16711680&(d=o[m+l+1]))>>>1&16711680,n=(65280&p)+(65280&d)>>>1&65280,e=(255&p)+(255&d)>>>1,c[r]=n|e|b,m+=2,++r;return lxb.pop(12),0}function Cxb(){var e,t,r,i,a,s,n,o,u,l,c,h,f,p,d;if(s=lxb.stackValue(2),l=lxb.stackValue(1),p=lxb.stackIntegerValue(0),a=pxb(s),d=ixb(s),u=pxb(l),lxb.success(ixb(l)===d),lxb.failed())return null;for(i=0;i<=d-1;i++)0!=(c=16777215&a[i])&&((n=o=h=c>>>16&255)<(r=c>>>8&255)&&(n=r),n<(e=255&c)&&(n=e),r>>16&255)<(r=c>>>8&255)&&(n=r),n<(e=255&c)&&(n=e),r>>10)*i+(a>>>10)],d=a>>>10>>10>>10>>16&255)+S*(d>>>16&255)+_*(b>>>16&255)+y*(m>>>16&255))>>>20&255)<<16,l|=((v=k*(p>>>8&255)+S*(d>>>8&255)+_*(b>>>8&255)+y*(m>>>8&255))>>>20&255)<<8,0===(l|=(v=k*(255&p)+S*(255&d)+_*(255&b)+y*(255&m))>>>20&255)&&(l=1)),n[f*c+h]=l,a+=O;s+=I}return lxb.pop(6),0}function Gxb(){var e,t,r,i,a,s,n,o,u,l,c,h,f,p,d,b,m,v,g,k,S,_,y,O,I,F,w,C,A,x,P,V,M,j;if(g=lxb.stackValue(5),y=lxb.stackValue(4),V=lxb.stackIntegerValue(3),v=pxb(g),_=pxb(y),r=ixb(g),w=lxb.stackIntegerValue(2),e=lxb.stackValue(1),i=lxb.stackValue(0),t=oxb(e),a=oxb(i),lxb.success(ixb(y)===r),lxb.failed())return null;for(b=jxb(r,V),s=kxb(Math.random(),w)-1,C=0;C<=s/2-1;C++)for(M=kxb(Math.random(),V),j=kxb(Math.random(),b),I=kxb(Math.random(),8),p=-4;p<=4;p++)for(d=-4;d<=4;d++)(o=p*p+d*d)<25&&0>1)<(r=(l=jxb(S,y))>>1)?(v=r/(b=t),1):(v=1,(b=r)=hxb}function SocketPlugin(){return{getModuleName:function(){return"SocketPlugin (http-only)"},interpreterProxy:null,primHandler:null,handleCounter:0,needProxy:new Set,status:0,lookupCache:{localhost:{address:[127,0,0,1],validUntil:Number.MAX_SAFE_INTEGER}},lastLookup:null,lookupSemaIdx:0,TCP_Socket_Type:0,Resolver_Uninitialized:0,Resolver_Ready:1,Resolver_Busy:2,Resolver_Error:3,Socket_InvalidSocket:-1,Socket_Unconnected:0,Socket_WaitingForConnection:1,Socket_Connected:2,Socket_OtherEndClosed:3,Socket_ThisEndClosed:4,setInterpreter:function(e){return this.interpreterProxy=e,this.primHandler=this.interpreterProxy.vm.primHandler,!0},_signalSemaphore:function(e){e<=0||this.primHandler.signalSemaphoreWithIndex(e)},_signalLookupSemaphore:function(){this._signalSemaphore(this.lookupSemaIdx)},_getAddressFromLookupCache:function(e,t){if(e){if(e.match(/^\d+\.\d+\.\d+\.\d+$/)){var r=e.split(".").map(function(e){return+e});if(r.every(function(e){return e<=255}))return new Uint8Array(r)}var i=this.lookupCache[e];if(i&&(t||i.validUntil>=Date.now()))return new Uint8Array(i.address)}return null},_addAddressFromResponseToLookupCache:function(e){if(e&&0===e.Status&&e.Question&&e.Answer){var t=function(e,t){e[t]&&e[t].replace&&(e[t]=e[t].replace(/\.$/,""))},r=e.Question[0];t(r,"name"),e.Answer.forEach(function(e){t(e,"name"),t(e,"data")});var i=r.name,a=null,s=86400;e.Answer.some(function(e){if(e.name===i){if(e.TTL&&(s=Math.min(s,e.TTL)),1===e.type)return a=e.data.split(".").map(function(e){return+e}),!0;5===e.type&&(i=e.data)}return!1})&&(this.lookupCache[r.name]={address:a,validUntil:Date.now()+1e3*s})}},_compareAddresses:function(e,r){return e.every(function(e,t){return r[t]===e})},_reverseLookupNameForAddress:function(t){var r=this,i=null;return Object.keys(this.lookupCache).some(function(e){return!!r._compareAddresses(t,r.lookupCache[e].address)&&(i=e,!0)}),i||t.join(".")},_newSocketHandle:function(e,t,r,i){var c=this;return{hostAddress:null,host:null,port:null,connSemaIndex:t,readSemaIndex:r,writeSemaIndex:i,webSocket:null,sendBuffer:null,sendTimeout:null,response:null,responseReadUntil:0,responseReceived:!1,status:c.Socket_Unconnected,_signalConnSemaphore:function(){c._signalSemaphore(this.connSemaIndex)},_signalReadSemaphore:function(){c._signalSemaphore(this.readSemaIndex)},_signalWriteSemaphore:function(){c._signalSemaphore(this.writeSemaIndex)},_otherEndClosed:function(){this.status=c.Socket_OtherEndClosed,this.webSocket=null,this._signalConnSemaphore()},_hostAndPort:function(){return this.host+":"+this.port},_requestNeedsProxy:function(){return c.needProxy.has(this._hostAndPort())},_getURL:function(e,t){var r="";(t||this._requestNeedsProxy())&&(r="object"==typeof SqueakJS&&SqueakJS.options.proxy||"https://corsproxy.io/?");return 443!==this.port?r+="http://"+this._hostAndPort()+e:r+="https://"+this.host+e,r},_performRequest:function(){if(this.webSocket)this._performWebSocketSend();else{var e=new TextDecoder("utf-8").decode(this.sendBuffer),t=this.sendBuffer.findIndex(function(e,t,r){return"\r"===r[t]&&"\r"===r[t+2]&&"\n"===r[t+1]&&"\n"===r[t+3]});this.sendBuffer=0<=t?this.sendBuffer.subarray(t+4):null;var r=e.split("\r\n\r\n")[0].split("\n"),i=r[0].split(" "),a=i[0];if("GET"!==a&&"PUT"!==a&&"POST"!==a)return this._otherEndClosed(),-1;for(var s=i[1],n=!1,o=!1,u=null,l=1;l>>8,n[3]=255&e.length,4):127===i?(n[2]=e.length>>>56,n[3]=e.length>>>48&255,n[4]=e.length>>>40&255,n[5]=e.length>>>32&255,n[6]=e.length>>>24&255,n[7]=e.length>>>16&255,n[8]=e.length>>>8&255,n[9]=255&e.length,10):2;var o=new Uint8Array(4);n.set(o,s),s+=4;var u=e;n.set(u,s),e=n}this.response&&this.response.length?this.response.push(e):this.response=[e],this.responseReceived=!0,this._signalReadSemaphore()},_performWebSocketSend:function(){var e,t=15&this.sendBuffer[0];if(0==t)return console.error("No support for WebSocket frame continuation yet!"),!0;if(1==t)e=!1;else{if(2!=t)return 8==t?(this.webSocket.close(),void(this.webSocket=null)):9==t||10==t?void 0:void console.error("Unsupported WebSocket frame opcode "+t);e=!0}var r,i,a=this.sendBuffer[1],s=a>>>7,n=127&a;r=126===n?(n=this.sendBuffer[2]<<8|this.sendBuffer[3],4):127===n?(n=this.sendBuffer[2]<<56|this.sendBuffer[3]<<48|this.sendBuffer[4]<<40|this.sendBuffer[5]<<32|this.sendBuffer[6]<<24|this.sendBuffer[7]<<16|this.sendBuffer[8]<<8|this.sendBuffer[9],10):2,s&&(i=this.sendBuffer.subarray(r,r+4),r+=4);var o,u=this.sendBuffer.subarray(r,r+n);r+=n,s&&(u=u.map(function(e,t){return e^i[3&t]})),o=e?u:Squeak.bytesAsString(u),this.sendBuffer=this.sendBuffer.subarray(r),this.webSocket.send(o),0e){var r=t.subarray(e);r?this.response[0]=r:this.response.shift(),t=t.subarray(0,e)}else this.response.shift();return this.responseReceived&&0===this.response.length&&!this.webSocket&&(this.responseSentCompletly=!0),t},send:function(e,t,r){null!==this.sendTimeout&&self.clearTimeout(this.sendTimeout),this.lastSend=Date.now();var i=e.bytes.subarray(t,r);if(null===this.sendBuffer)this.sendBuffer=i.slice();else{var a=this.sendBuffer.byteLength+i.byteLength,s=new Uint8Array(a);s.set(this.sendBuffer,0),s.set(i,this.sendBuffer.byteLength),this.sendBuffer=s}return this.sendTimeout=self.setTimeout(this._performRequest.bind(this),50),i.byteLength}}},primitiveHasSocketAccess:function(e){return this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.trueObject()),!0},primitiveInitializeNetwork:function(e){return 1===e&&(this.lookupSemaIdx=this.interpreterProxy.stackIntegerValue(0),this.status=this.Resolver_Ready,this.interpreterProxy.pop(e),!0)},primitiveResolverNameLookupResult:function(e){if(0!==e)return!1;if(!this.lastLookup||!this.lastLookup.substr)return this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),!0;var t=this._getAddressFromLookupCache(this.lastLookup,!0);return this.interpreterProxy.popthenPush(e+1,t?this.primHandler.makeStByteArray(t):this.interpreterProxy.nilObject()),!0},primitiveResolverStartNameLookup:function(e){if(1!==e)return!1;var t=this.lastLookup=this.interpreterProxy.stackValue(0).bytesAsString();if(this._getAddressFromLookupCache(t,!1))this.status=this.Resolver_Ready,this._signalLookupSemaphore();else{var r="https://9.9.9.9:5053/dns-query?name="+encodeURIComponent(this.lastLookup)+"&type=A",i=!1;if(self.fetch){var a=this;self.fetch(r,{method:"GET",mode:"cors",credentials:"omit",cache:"no-store",referrer:"no-referrer",referrerPolicy:"no-referrer"}).then(function(e){return e.json()}).then(function(e){a._addAddressFromResponseToLookupCache(e)}).catch(function(e){console.error("Name lookup failed",e)}).then(function(){t===a.lastLookup&&(a.status=a.Resolver_Ready,a._signalLookupSemaphore())}),i=!0}else{a=this;var s=function(){t===a.lastLookup&&(a.status=a.Resolver_Ready,a._signalLookupSemaphore())},n=new XMLHttpRequest;n.open("GET",r,!0),n.timeout=2e3,n.responseType="json",n.onload=function(e){a._addAddressFromResponseToLookupCache(this.response),s()},n.onerror=function(){console.error("Name lookup failed",n.statusText),s()},n.send(),i=!0}i&&(this.status=this.Resolver_Busy,this._signalLookupSemaphore())}return this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),!0},primitiveResolverAddressLookupResult:function(e){if(0!==e)return!1;if(!this.lastLookup||!this.lastLookup.every)return this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),!0;var t=this._reverseLookupNameForAddress(this.lastLookup),r=this.primHandler.makeStString(t);return this.interpreterProxy.popthenPush(e+1,r),!0},primitiveResolverStartAddressLookup:function(e){return 1===e&&(this.lastLookup=this.interpreterProxy.stackBytes(0),this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),this.status=this.Resolver_Ready,this._signalLookupSemaphore(),!0)},primitiveResolverStatus:function(e){return 0===e&&(this.interpreterProxy.popthenPush(e+1,this.status),!0)},primitiveResolverAbortLookup:function(e){return 0===e&&(this.lastLookup=null,this.status=this.Resolver_Ready,this._signalLookupSemaphore(),this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),!0)},primitiveSocketRemoteAddress:function(e){if(1!==e)return!1;var t=this.interpreterProxy.stackObjectValue(0).handle;return void 0!==t&&(this.interpreterProxy.popthenPush(e+1,t.hostAddress?this.primHandler.makeStByteArray(t.hostAddress):this.interpreterProxy.nilObject()),!0)},primitiveSocketRemotePort:function(e){if(1!==e)return!1;var t=this.interpreterProxy.stackObjectValue(0).handle;return void 0!==t&&(this.interpreterProxy.popthenPush(e+1,t.port),!0)},primitiveSocketConnectionStatus:function(e){if(1!==e)return!1;var t=this.interpreterProxy.stackObjectValue(0).handle;if(void 0===t)return!1;var r=t.status;return void 0===r&&(r=this.Socket_InvalidSocket),this.interpreterProxy.popthenPush(e+1,r),!0},primitiveSocketConnectToPort:function(e){if(3!==e)return!1;var t=this.interpreterProxy.stackObjectValue(2).handle;if(void 0===t)return!1;var r=this.interpreterProxy.stackBytes(1),i=this.interpreterProxy.stackIntegerValue(0);return t.connect(r,i),this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),!0},primitiveSocketCloseConnection:function(e){if(1!==e)return!1;var t=this.interpreterProxy.stackObjectValue(0).handle;return void 0!==t&&(t.close(),this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),!0)},primitiveSocketCreate3Semaphores:function(e){if(7!==e)return!1;var t=this.interpreterProxy.stackIntegerValue(0),r=this.interpreterProxy.stackIntegerValue(1),i=this.interpreterProxy.stackIntegerValue(2),a=this.interpreterProxy.stackIntegerValue(3);if(this.interpreterProxy.stackIntegerValue(5)!==this.TCP_Socket_Type)return!1;var s="{SqueakJS Socket #"+ ++this.handleCounter+"}",n=this.primHandler.makeStString(s);return n.handle=this._newSocketHandle(a,i,r,t),this.interpreterProxy.popthenPush(e+1,n),!0},primitiveSocketDestroy:function(e){if(1!==e)return!1;var t=this.interpreterProxy.stackObjectValue(0).handle;return void 0!==t&&(t.destroy(),this.interpreterProxy.popthenPush(e+1,t.status),!0)},primitiveSocketReceiveDataAvailable:function(e){if(1!==e)return!1;var t=this.interpreterProxy.stackObjectValue(0).handle;if(void 0===t)return!1;var r=this.interpreterProxy.falseObject();return t.dataAvailable()&&(r=this.interpreterProxy.trueObject()),this.interpreterProxy.popthenPush(e+1,r),!0},primitiveSocketReceiveDataBufCount:function(e){if(4!==e)return!1;var t=this.interpreterProxy.stackObjectValue(3).handle;if(void 0===t)return!1;var r=this.interpreterProxy.stackObjectValue(2),i=this.interpreterProxy.stackIntegerValue(1)-1,a=this.interpreterProxy.stackIntegerValue(0);if(i+a>r.bytes.length)return!1;var s=t.recv(a);return r.bytes.set(s,i),this.interpreterProxy.popthenPush(e+1,s.length),!0},primitiveSocketSendDataBufCount:function(e){if(4!==e)return!1;var t=this.interpreterProxy.stackObjectValue(3).handle;if(void 0===t)return!1;var r=this.interpreterProxy.stackObjectValue(2),i=this.interpreterProxy.stackIntegerValue(1)-1;if(i<0)return!1;var a=i+this.interpreterProxy.stackIntegerValue(0);if(a>r.length)return!1;var s=t.send(r,i,a);return this.interpreterProxy.popthenPush(e+1,s),!0},primitiveSocketSendDone:function(e){return 1===e&&(this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.trueObject()),!0)},primitiveSocketListenWithOrWithoutBacklog:function(e){return!(e<2)&&(this.interpreterProxy.popthenPush(e+1,this.interpreterProxy.nilObject()),!0)}}}function registerSocketPlugin(){"object"==typeof Squeak&&Squeak.registerExternalModule?Squeak.registerExternalModule("SocketPlugin",SocketPlugin()):self.setTimeout(registerSocketPlugin,100)}function SpeechPlugin(){return{getModuleName:function(){return"SpeechPlugin"},interpreterProxy:null,primHandler:null,voiceInput:null,semaphoreIndex:null,shouldListen:!1,recognition:null,synth:self.speechSynthesis,setInterpreter:function(e){return this.interpreterProxy=e,this.primHandler=this.interpreterProxy.vm.primHandler,!0},primitiveSpeak:function(e){var t,r;if(1===e)t=this.interpreterProxy.stackValue(0).bytesAsString();else{if(2!==e)return!1;t=this.interpreterProxy.stackValue(1).bytesAsString();var i=this.interpreterProxy.stackValue(0).bytesAsString();r=this.synth.getVoices().filter(function(e){return e.name===i})}var a=new SpeechSynthesisUtterance(t);return r&&0>15))&&(u=32767),u<-32767&&(u=-32767),t[o-1]=u,d[f-1]=u,32767<(u=t[++o-1]+(s>>15))&&(u=32767),u<-32767&&(u=-32767),t[o-1]=u,b[f-1]=u,f=cIb(f,p)+1}if(hIb.failed())return null;hIb.storeIntegerofObjectwithValue(11,e,f),hIb.pop(3)}function lIb(){var e,t,r,i,a,s,n,o,u,l,c,h,f,p,d,b,m,v,g,k,S,_,y,O;if(e=hIb.stackValue(5),t=hIb.stackIntegerValue(4),r=hIb.stackInt16Array(3),i=hIb.stackIntegerValue(2),a=hIb.stackIntegerValue(1),s=hIb.stackIntegerValue(0),k=hIb.fetchIntegerofObject(3,e),S=hIb.fetchIntegerofObject(4,e),_=hIb.fetchIntegerofObject(5,e),p=hIb.fetchIntegerofObject(7,e),O=hIb.fetchInt16ArrayofObject(8,e),y=hIb.fetchIntegerofObject(9,e),b=hIb.fetchIntegerofObject(10,e),m=hIb.fetchIntegerofObject(11,e),d=hIb.fetchIntegerofObject(14,e),v=hIb.fetchIntegerofObject(15,e),g=hIb.fetchIntegerofObject(16,e),hIb.failed())return null;for(n=0!==d&&0!==g,u=i+t-1,f=i;f<=u;f++)h=k*O[b>>15]>>15,n?(l=d*O[v>>15],(v=cIb(v+g,y))<0&&(v+=y),(b=cIb(b+m+l,y))<0&&(b+=y)):b=cIb(b+m,y),0>15))&&(c=32767),c<-32767&&(c=-32767),r[o-1]=c),0>15))&&(c=32767),c<-32767&&(c=-32767),r[o-1]=c),0!==S&&(k+=S,(0>15,o=s*C>>15,u=2*i-1,c=i+t-1,v=i;v<=c;v++){if(_<(m=(I+=F)>>9)&&y>9),(p=m+1)>k){if(k>9)}f=I&dIb,d=h=S[m-1]*(eIb-f)+S[p-1]*f>>9,l&&(d=O[m-1]*(eIb-f)+O[p-1]*f>>9),0>15))&&(b=32767),b<-32767&&(b=-32767),r[u-1]=b),++u,0>15))&&(b=32767),b<-32767&&(b=-32767),r[u-1]=b),++u,0!==A&&(C+=A,(0>15,o=s*C>>15)}if(g-=t,hIb.failed())return null;hIb.storeIntegerofObjectwithValue(3,e,C),hIb.storeIntegerofObjectwithValue(4,e,A),hIb.storeIntegerofObjectwithValue(7,e,g),hIb.storeIntegerofObjectwithValue(19,e,I),hIb.pop(5)}function nIb(){var e,t,r,i,a,s,n,o,u,l,c,h,f,p,d,b,m,v,g,k,S,_;if(e=hIb.stackValue(5),t=hIb.stackIntegerValue(4),r=hIb.stackInt16Array(3),i=hIb.stackIntegerValue(2),a=hIb.stackIntegerValue(1),s=hIb.stackIntegerValue(0),k=hIb.fetchIntegerofObject(3,e),S=hIb.fetchIntegerofObject(4,e),_=hIb.fetchIntegerofObject(5,e),d=hIb.fetchIntegerofObject(7,e),b=hIb.fetchInt16ArrayofObject(8,e),m=hIb.fetchIntegerofObject(9,e),v=hIb.fetchIntegerofObject(10,e),g=hIb.fetchIntegerofObject(11,e),hIb.failed())return null;for(u=i+t-1,f=h=m,p=i;p<=u;p++)g<=(h=f+v)&&(h=fIb+(h-g)),n=b[(f>>15)-1]+b[(h>>15)-1]>>1,c=(b[(f>>15)-1]=n)*k>>15,f=h,0>15))&&(l=32767),l<-32767&&(l=-32767),r[o-1]=l),0>15))&&(l=32767),l<-32767&&(l=-32767),r[o-1]=l),0!==S&&(k+=S,(0>>16);f<=m&&u<=o;)h=b[f-1]*k>>15,0>15))&&(c=32767),c<-32767&&(c=-32767),r[n-1]=c),0>15))&&(c=32767),c<-32767&&(c=-32767),r[n-1]=c),0!==S&&(k+=S,(0>>16,g-=l<<16),f=d+(g>>>16),++u;if(p-=t,hIb.failed())return null;hIb.storeIntegerofObjectwithValue(3,e,k),hIb.storeIntegerofObjectwithValue(4,e,S),hIb.storeIntegerofObjectwithValue(7,e,p),hIb.storeIntegerofObjectwithValue(11,e,g),hIb.storeIntegerofObjectwithValue(12,e,d),hIb.pop(5)}function pIb(e){return!1!=((hIb=e).majorVersion()==_Hb)&&hIb.minorVersion()>=aIb}function JKb(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function KKb(e,t){return 0|Math.floor(e/t)}function OKb(e){return MKb.success(MKb.isWords(e)),MKb.failed()?0:e.words}function PKb(){return NKb}function QKb(){var e,t,r,i,a,s,n,o,u,l,c,h,f,p,d,b,m,v;if(l=MKb.stackValue(4),i=MKb.stackValue(3),p=MKb.stackIntegerValue(2),n=MKb.stackIntegerValue(1),t=MKb.stackIntegerValue(0),u=OKb(l),r=OKb(i),MKb.success(JKb(l)===JKb(i)),MKb.success(JKb(l)===p*n),MKb.failed())return null;for(e=(2*t+1)*(2*t+1),m=0;m<=n-1;m++)for((h=m-t)<0&&(h=0),n<=(s=m+t)&&(s=n-1),d=0;d<=p-1;d++){for((c=d-t)<0&&(c=0),p<=(a=d+t)&&(a=p-1),f=0,v=h;v<=s;v++)for(o=v*p,b=c;b<=a;b++)f+=u[o+b];r[m*p+d]=KKb(f,e)}MKb.pop(5)}function RKb(){var e,t,r,i,a;if(r=MKb.stackValue(1),i=MKb.stackIntegerValue(0),t=OKb(r),a=JKb(r),MKb.failed())return null;for(e=0;e<=a-1;e++)t[e]=t[e]*i>>>10;MKb.pop(2)}function SKb(){var e,t,r,i,a,s,n,o,u,l,c,h,f,p,d,b,m,v,g,k;if(d=MKb.stackValue(6),r=MKb.stackValue(5),b=MKb.stackIntegerValue(4),i=MKb.stackIntegerValue(3),n=MKb.stackIntegerValue(2),u=MKb.stackIntegerValue(1),h=MKb.stackIntegerValue(0),f=OKb(d),e=OKb(r),MKb.success(JKb(r)===b*i),MKb.success(JKb(r)===JKb(d)*n*n),MKb.failed())return null;for((l=0)<(4&u)&&(l+=65536),0<(2&u)&&(l+=256),0<(1&u)&&++l,p=-1,v=0;v<=KKb(i,n)-1;v++)for(m=0;m<=KKb(b,n)-1;m++)for(g=f[++p],255<(a=(k=h)<0?k<-31?0:g>>>0-k:31=IKb}function TLb(e){return"number"==typeof e?jMb.classSmallInteger():e.sqClass}function ULb(e){return e.pointers?e.pointers.length:e.words?e.words.length:e.bytes?e.bytes.length:0}function VLb(e){return e.bytes?e.bytes.length:e.words?4*e.words.length:0}function XLb(e,t){return e-(r=e,i=t,(0|Math.floor(r/i))*t)|0;var r,i}function YLb(e,t){return 31>>7)],yMb[r]++,++LMb,++HMb===JMb||0==(4095&HMb)&&lNb()}function ZMb(e,t,r,i,a){var s,n,o,u,l,c,h;if(h=t<<16|r,dMb<=t)return h;if(!(0<(o=e-(c=CMb[nNb(e+eMb-1)]))&&o>2t))return jMb.primitiveFail();for(pMb|=YLb(t,qMb),qMb+=e;8<=qMb&&NMb>>=8,qMb-=8}function dNb(){var e,t,r,i,a;return 3!==jMb.methodArgumentCount()?jMb.primitiveFail():(t=jMb.stackIntegerValue(0),e=jMb.stackIntegerValue(1),r=jMb.stackIntegerValue(2),i=jMb.stackObjectValue(3),jMb.failed()?null:function(e){var t;if(jMb.isPointers(e)&&15<=ULb(e)&&(t=jMb.fetchPointerofObject(0,e),jMb.isBytes(t))){if(0===mMb){if(!WMb(e))return;if(ULb(e)=JMb&&(zMb=t.words,t=jMb.fetchPointerofObject(mMb+7,e),jMb.isWords(t)&&ULb(t)===cMb&&(IMb=t.words,t=jMb.fetchPointerofObject(mMb+8,e),jMb.isWords(t)&&ULb(t)===bMb))))))return yMb=t.words,HMb=jMb.fetchIntegerofObject(mMb+9,e),LMb=jMb.fetchIntegerofObject(mMb+10,e),!jMb.failed()}}(i)?(a=function(e,t,r){var i,a,s,n,o,u,l,c,h;if(e>>16),h=65535&(l=ZMb(s+1,n,o,t,r)),(c=l>>>16)<=n&&eMb<=n){for(i=YMb(n,s-o),u=1;u<=n-1;u++)_Mb(++s);a=!1,++s}else i=XMb(sMb[s]),++s<=e&&!i&&(_Mb(s),a=!0,o=h,n=c);if(i)return rMb=s,!0}return rMb=s,!1}(r,e,t),jMb.failed()||(jMb.storeIntegerofObjectwithValue(mMb+2,i,EMb),jMb.storeIntegerofObjectwithValue(mMb+3,i,rMb),jMb.storeIntegerofObjectwithValue(mMb+9,i,HMb),jMb.storeIntegerofObjectwithValue(mMb+10,i,LMb)),void(jMb.failed()||(jMb.pop(4),jMb.pushBool(a)))):jMb.primitiveFail())}function eNb(){var e,t,r,i,a,s;if(2!==jMb.methodArgumentCount())return jMb.primitiveFail();if(e=jMb.stackIntegerValue(0),i=jMb.stackObjectValue(1),jMb.failed())return null;if(!jMb.isWords(i))return jMb.primitiveFail();for(s=ULb(i),a=i.wordsAsInt32Array(),r=0;r<=s-1;r++)t=a[r],a[r]=e<=t?t-e:0;jMb.pop(2)}function fNb(){var e,t;if(2!==jMb.methodArgumentCount())return jMb.primitiveFail();if(e=jMb.stackValue(0),!jMb.isWords(e))return jMb.primitiveFail();if(vMb=e.words,wMb=ULb(e),e=jMb.stackValue(1),!jMb.isWords(e))return jMb.primitiveFail();if(FMb=e.words,GMb=ULb(e),t=jMb.stackValue(2),!jMb.isPointers(t))return jMb.primitiveFail();if(0===lMb){if(!function(e){var t;for(t=TLb(e);!t.isNil&&13<=t.classInstSize();)t=t.superclass();return!t.isNil&&(lMb=t.classInstSize(),1)}(t))return jMb.primitiveFail();if(ULb(t)>>16)-1)&&(a+=qNb(r)),c=oNb(vMb,wMb),e=65535&c,0<(r=c>>>16)&&(e+=qNb(r)),s<=OMb+a)return pMb=o,qMb=n,RMb=u;for(l=(t=OMb)-e,i=1;i<=a;i++)sMb[t+i]=sMb[l+i];OMb+=a}}(),void(jMb.failed()||(jMb.storeIntegerofObjectwithValue(2,t,OMb+1),jMb.storeIntegerofObjectwithValue(lMb+0,t,SMb),jMb.storeIntegerofObjectwithValue(lMb+1,t,pMb),jMb.storeIntegerofObjectwithValue(lMb+2,t,qMb),jMb.storeIntegerofObjectwithValue(lMb+4,t,RMb+1),jMb.pop(2)))):jMb.primitiveFail()):jMb.primitiveFail()))}function gNb(){var e,t,r,i,a,s,n,o;if(4!==jMb.methodArgumentCount())return jMb.primitiveFail();if(r=jMb.stackObjectValue(0),o=jMb.stackIntegerValue(1),n=jMb.stackIntegerValue(2),e=jMb.positive32BitValueOf(jMb.stackValue(3)),jMb.failed())return 0;if(!(jMb.isBytes(r)&&n<=o&&0>>16&65535,i=--n;i<=o;i++)a=XLb(a+t[i],65521),s=XLb(s+a,65521);e=(s<<16)+a,jMb.popthenPush(5,jMb.positive32BitIntegerFor(e))}function hNb(){var e,t,r,i,a,s;if(4!==jMb.methodArgumentCount())return jMb.primitiveFail();if(t=jMb.stackObjectValue(0),s=jMb.stackIntegerValue(1),a=jMb.stackIntegerValue(2),r=jMb.positive32BitValueOf(jMb.stackValue(3)),jMb.failed())return 0;if(!(jMb.isBytes(t)&&a<=s&&0>>8;jMb.popthenPush(5,jMb.positive32BitIntegerFor(r))}function iNb(){var e,t,r,i,a,s;return 4!==jMb.methodArgumentCount()?jMb.primitiveFail():(t=jMb.stackObjectValue(0),i=jMb.stackObjectValue(1),e=jMb.stackObjectValue(2),r=jMb.stackObjectValue(3),a=jMb.stackObjectValue(4),jMb.failed()?null:function(e){var t;if(0===mMb){if(!WMb(e))return;if(ULb(e)=mMb+3&&(t=jMb.fetchPointerofObject(0,e),jMb.isBytes(t)?(sMb=t.bytes,tMb=VLb(t),NMb=jMb.fetchIntegerofObject(1,e),OMb=jMb.fetchIntegerofObject(2,e),pMb=jMb.fetchIntegerofObject(mMb+0,e),qMb=jMb.fetchIntegerofObject(mMb+1,e),!jMb.failed()):jMb.primitiveFail())}(a)&&jMb.isPointers(t)&&2<=ULb(t)&&jMb.isPointers(i)&&2<=ULb(i)&&jMb.isPointers(r)&&3<=ULb(r)&&jMb.isPointers(e)&&3<=ULb(e)?(s=function(e,t,r,i){var a,s,n,o,u,l,c,h,f,p,d,b,m,v,g,k;if(g=jMb.fetchPointerofObject(0,e),b=jMb.fetchIntegerofObject(1,e),d=jMb.fetchIntegerofObject(2,e),!(b<=d&&jMb.isBytes(g)&&d<=VLb(g)))return jMb.primitiveFail();if(f=g.bytes,g=jMb.fetchPointerofObject(0,t),!(jMb.isWords(g)&&d<=ULb(g)&&jMb.fetchIntegerofObject(1,t)===b&&jMb.fetchIntegerofObject(2,t)===d))return jMb.primitiveFail();if(n=g.words,g=jMb.fetchPointerofObject(0,r),!jMb.isWords(g))return jMb.primitiveFail();if(p=ULb(g),m=g.words,g=jMb.fetchPointerofObject(1,r),!jMb.isWords(g)||p!==ULb(g))return jMb.primitiveFail();if(v=g.words,g=jMb.fetchPointerofObject(0,i),!jMb.isWords(g))return jMb.primitiveFail();if(u=ULb(g),o=g.words,g=jMb.fetchPointerofObject(1,i),!jMb.isWords(g)||u!==ULb(g))return jMb.primitiveFail();l=g.words,cNb(0,0),k=0;for(;b>>7)])=SLb}function lNb(){var e;return HMb===JMb||0==(4095&HMb)&&(!(10*LMb<=HMb)&&(!((e=HMb-LMb)<=LMb)&&4*e<=LMb))}function nNb(e){return t=sMb[e],(EMb<<5^t)&$Lb;var t}function oNb(e,t){var r,i,a,s;if(r=e[0]>>>24,hMb>>24&255))return jMb.primitiveFail(),0}return 0}function qNb(e){for(var t,r,i,a;qMb>>a,qMb-=e,t}Object.extend||(Object.extend=function(e){for(var t=1;t>0)+t:[e,t]}}),Object.subclass("Squeak.Object","initialization",{initInstanceOf:function(e,t,r,i){this.sqClass=e,this.hash=r;var a=e.pointers[Squeak.Class_format],s=(a>>1&63)+(a>>10&192)-1;this._format=a>>7&15,this._format<8?6!=this._format?0>10&255;l=this.decodeWords(1+c,o,a);this.pointers=this.decodePointers(1+c,l,e),this.bytes=this.decodeBytes(u-(1+c),o,1+c,3&this._format)}else 8<=this._format?0>1:r[s]||42424242}return i},decodeWords:function(e,t,r){for(var i=new DataView(t.buffer,t.byteOffset),a=new Uint32Array(e),s=0;s>4]),r.push(t[15&this.bytes[a]]),i=256*i+this.bytes[a];var s=e?"-":"",n=9007199254740991");case"LargePositiveInteger":return this.bytesAsNumberString(!1);case"LargeNegativeInteger":return this.bytesAsNumberString(!0);case"Character":var r=this.pointers?this.pointers[0]:this.hash;return"$"+String.fromCharCode(r)+" ("+r.toString()+")";case"CompiledMethod":return this.methodAsString();case"CompiledBlock":return"[] in "+this.blockOuterCode().sqInstName()}return/^[aeiou]/i.test(t)?"an"+t:"a"+t}},"accessing",{pointersSize:function(){return this.pointers?this.pointers.length:0},bytesSize:function(){return this.bytes?this.bytes.length:0},wordsSize:function(){return this.isFloat?2:this.words?this.words.length:0},instSize:function(){var e=this._format;return 4>>2):null},setAddr:function(e){var t=this.snapshotSize();return this.oop=e+4*t.header,e+4*(t.header+t.body)},snapshotSize:function(){var e=this.isFloat?2:this.words?this.words.length:this.pointers?this.pointers.length:0;return this.bytes&&(e+=this.bytes.length+3>>>2),{header:63<++e?2:this.sqClass.isCompact?0:1,body:e}},addr:function(){return this.oop-4*this.snapshotSize().header},totalBytes:function(){var e=this.snapshotSize();return 4*(e.header+e.body)},writeTo:function(e,t,r){this.bytes&&(this._format|=3&-this.bytes.length);var i=t,a=this.snapshotSize(),s=(15&this._format)<<8|(4095&this.hash)<<17;switch(a.header){case 2:e.setUint32(t,a.body<<2|Squeak.HeaderTypeSizeAndClass),t+=4,e.setUint32(t,this.sqClass.oop|Squeak.HeaderTypeSizeAndClass),t+=4,e.setUint32(t,s|Squeak.HeaderTypeSizeAndClass),t+=4;break;case 1:e.setUint32(t,this.sqClass.oop|Squeak.HeaderTypeClass),t+=4,e.setUint32(t,s|a.body<<2|Squeak.HeaderTypeClass),t+=4;break;case 0:var n=r.compactClasses.indexOf(this.sqClass)+1;e.setUint32(t,s|n<<12|a.body<<2|Squeak.HeaderTypeShort),t+=4}if(this.isFloat)e.setFloat64(t,this.float),t+=8;else if(this.words)for(var o=0;o>7&15},classInstSize:function(){var e=this.pointers[Squeak.Class_format];return(e>>10&192)+(e>>1&63)-1},classInstIsBytes:function(){var e=this.classInstFormat();return 8<=e&&e<=11},classInstIsPointers:function(){return this.classInstFormat()<=4},instVarNames:function(){for(var e=3;e<=4;e++){var t=this.pointers[e].pointers;if(t&&t.length&&t[0].bytes)return t.map(function(e){return e.bytesAsString()})}return[]},allInstVarNames:function(){var e=this.superclass();return e.isNil?this.instVarNames():e.allInstVarNames().concat(this.instVarNames())},superclass:function(){return this.pointers[0]},className:function(){if(!this.pointers)return"_NOTACLASS_";for(var e=6;e<=7;e++){if((i=this.pointers[e])&&i.bytes)return i.bytesAsString()}for(var t=5;t<=6;t++){var r=this.pointers[t];if(r&&r.pointers)for(e=6;e<=7;e++){var i;if((i=r.pointers[e])&&i.bytes)return i.bytesAsString()+" class"}}return"_SOMECLASS_"},defaultInst:function(){return Squeak.Object},classInstProto:function(e){if(this.instProto)return this.instProto;var t=this.defaultInst();try{var r=(e=e||this.className()).replace(/[^A-Za-z0-9]/g,"_");r="UndefinedObject"===r?"nil":"True"===r?"true_":"False"===r?"false_":(/^[AEIOU]/.test(r)?"an":"a")+r,(t=new Function("return function "+r+"() {};")()).prototype=this.defaultInst().prototype}catch(e){}return Object.defineProperty(this,"instProto",{value:t}),t}},"as method",{methodSignFlag:function(){return!1},methodNumLits:function(){return this.pointers[0]>>9&255},methodNumArgs:function(){return this.pointers[0]>>24&15},methodPrimitiveIndex:function(){var e=805306879&this.pointers[0];return 511>19):e},methodClassForSuper:function(){return this.pointers[this.methodNumLits()].pointers[Squeak.Assn_value]},methodNeedsLargeFrame:function(){return 0<(131072&this.pointers[0])},methodAddPointers:function(e){this.pointers=e},methodTempCount:function(){return this.pointers[0]>>18&63},methodGetLiteral:function(e){return this.pointers[1+e]},methodGetSelector:function(e){return this.pointers[1+e]},methodAsString:function(){return"aCompiledMethod"}},"as context",{contextHome:function(){return this.contextIsBlock()?this.pointers[Squeak.BlockContext_home]:this},contextIsBlock:function(){return"number"==typeof this.pointers[Squeak.BlockContext_argumentCount]},contextMethod:function(){return this.contextHome().pointers[Squeak.Context_method]},contextSender:function(){return this.pointers[Squeak.Context_sender]},contextSizeWithStack:function(e){if(e&&e.activeContext===this)return e.sp+1;var t=this.pointers[Squeak.Context_stackPointer];return Squeak.Context_tempFrameStart+("number"==typeof t?t:0)}}),Squeak.Object.subclass("Squeak.ObjectSpur","initialization",{initInstanceOf:function(e,t,r,i){this.sqClass=e,this.hash=r;var a=e.pointers[Squeak.Class_format],s=65535&a,n=a>>16&31;(this._format=n)<12?n<10?0>(n?3:1),f=32767&h,p=(c=n?this.decodeWords64(1+f,u,a):this.decodeWords(1+f,u,a),n?2*(1+f):1+f);this.pointers=this.decodePointers(1+f,c,e,s,n),this.bytes=this.decodeBytes(l-p,u,p,3&this._format),n&&(this.pointers[0]=2147483648&u[1]|h);break;default:throw Error("Unknown object format: "+this._format)}this.mark=!1},decodeWords64:function(e,t,r){for(var i=new Array(e),a=0;a>1:a.makeLargeFromSmall((o-(o>>>0))/4294967296>>>0,o>>>0):o>>1;else if(2==(3&o)){if(o<0||8589934591>>(a?3:2))}else a&&4==(7&o)?s[n]=this.decodeSmallFloat((o-(o>>>0))/4294967296>>>0,o>>>0,a):(s[n]=r[o]||42424242,s[n])}return s},decodeSmallFloat:function(e,t,r){var i=0,a=0,s=(8&t)<<28;return 0==(e|4294967280&t)?i=s:(i=939524096+(e>>>4)|s,a=t>>>4|(15&e)<<28),r.makeFloat(new Uint32Array([a,i]))},overhead64:function(e){var t=0,r=0,i=0;if(this._format<=5)t=-2&e.length;else if(24<=this._format){var a=1==(1&(t=1+(e[0]>>3&32767))),s=28<=this._format;a&&(t+=s?1:-1),i=e.length/2,r=e.length-t}else i=(r=e.length)/2;return{bytes:4*t,sizeHeader:255<=r&&i<255}},initInstanceOfChar:function(e,t){this.oop=t<<2|2,this.sqClass=e,this.hash=t,this._format=7,this.mark=!0},initInstanceOfFloat:function(e,t){this.sqClass=e,this.hash=0,this._format=10,this.isFloat=!0,this.float=this.decodeFloat(t,!0,!0)},initInstanceOfLargeInt:function(e,t){this.sqClass=e,this.hash=0,this._format=16,this.bytes=new Uint8Array(t)},classNameFromImage:function(e,t){var r=e[t[this.oop][Squeak.Class_name]];if(r&&16<=r._format&&r._format<24){var i=t[r.oop],a=r.decodeBytes(i.length,i,0,7&r._format);return Squeak.bytesAsString(a)}return"Class"},renameFromImage:function(e,t,r){var i=r[this.sqClass];if(!i)return this;var a=i.instProto||i.classInstProto(i.classNameFromImage(e,t));if(!a)return this;var s=new a;return s.oop=this.oop,s.sqClass=this.sqClass,s._format=this._format,s.hash=this.hash,s}},"accessing",{instSize:function(){return this._format<2?this.pointersSize():this.sqClass.classInstSize()},indexableSize:function(e){var t=this._format;return t<2?-1:3===t&&e.vm.isContext(this)?this.pointers[Squeak.Context_stackPointer]:t<6?this.pointersSize()-this.instSize():t<12?this.wordsSize():t<16?this.shortsSize():t<24?this.bytesSize():4*this.pointersSize()+this.bytesSize()},snapshotSize:function(){var e=this.isFloat?2:this.words?this.words.length:this.pointers?this.pointers.length:0;this.bytes&&(e+=this.bytes.length+3>>>2);var t=255<=e?2:0;return e+=1&e,(e+=2)<4&&(e=4),{header:t,body:e}},writeTo:function(e,t,r,i){var a=this.isFloat?2:this.words?this.words.length:this.pointers?this.pointers.length:0;this.bytes&&(a+=this.bytes.length+3>>>2,this._format|=3&-this.bytes.length);var s=t,n=this._format<<24|4194303&this.sqClass.hash,o=a<<24|4194303&this.hash;if(255<=a&&(e.setUint32(t,a,r),t+=4,o=255<<24|4194303&this.hash,e.setUint32(t,o,r),t+=4),e.setUint32(t,n,r),t+=4,e.setUint32(t,o,r),t+=4,this.isFloat)e.setFloat64(t,this.float,r),t+=8;else if(this.words)for(var u=0;u>16&31},classInstSize:function(){return 65535&this.pointers[Squeak.Class_format]},classInstIsBytes:function(){var e=this.classInstFormat();return 16<=e&&e<=23},classInstIsPointers:function(){return this.classInstFormat()<=6},classByteSizeOfInstance:function(e){var t=this.classInstFormat(),r=this.classInstSize();return r+=t<9?e:16<=t?(e+3)/4|0:12<=t?(e+1)/2|0:10<=t?e:2*e,r+=1&r,(r+=255<=r?4:2)<4&&(r=4),4*r}},"as compiled block",{blockOuterCode:function(){return this.pointers[this.pointers.length-1]}},"as method",{methodSignFlag:function(){return this.pointers[0]<0},methodNumLits:function(){return 32767&this.pointers[0]},methodPrimitiveIndex:function(){return 0==(65536&this.pointers[0])?0:this.bytes[1]+256*this.bytes[2]},methodAsString:function(){var e=this.pointers[this.pointers.length-1].pointers[Squeak.ClassBinding_value],t=this.pointers[this.pointers.length-2];return t.pointers&&(t=t.pointers[Squeak.AdditionalMethodState_selector]),e.className()+">>"+t.bytesAsString()}}),Object.subclass("Squeak.Image","about",{about:function(){}},"initializing",{initialize:function(e){this.headRoom=1e8,this.totalMemory=0,this.name=e,this.gcCount=0,this.gcMilliseconds=0,this.pgcCount=0,this.pgcMilliseconds=0,this.gcTenured=0,this.allocationCount=0,this.oldSpaceCount=0,this.youngSpaceCount=0,this.newSpaceCount=0,this.hasNewInstances={}},readFromBuffer:function(a,t,r){console.log("squeak: reading "+this.name+" ("+a.byteLength+" bytes)"),this.startupTime=Date.now();for(var i=new DataView(a),s=!1,n=0,e=function(){var e=i.getUint32(n,s);return n+=4,e},o=e,u=4,l=function(e,t){if(t){for(var r=[];r.length>>24;255===j&&(j=V,V=e(),M=e());U=w+n-8-I;var R=4194303&V;z=4194303&M,K=l(j,(D=V>>>24&31)<10&&0>>2,L=o(),T=o();break;case Squeak.HeaderTypeClass:L=T-Squeak.HeaderTypeClass,E=(T=o())>>>2&63;break;case Squeak.HeaderTypeShort:E=T>>>2&63,L=T>>>12&31;break;case Squeak.HeaderTypeFree:throw Error("Unexpected free block")}var D,Q,U=n-4-I,z=T>>>17&4095,K=l(--E,(D=T>>>8&15)<5);(Q=new Squeak.Object).initFromImage(U,L,D,z),L<32&&(Q.hash|=268435456),S&&(S.nextObject=Q),this.oldSpaceCount++,S=Q,y[v+U]=Q,O[U]=K}this.firstOldObject=y[v+4],this.lastOldObject=Q,this.lastOldObject.nextObject=null,this.oldSpaceBytes=m}this.totalMemory=this.oldSpaceBytes+this.headRoom,this.totalMemory=1e6*Math.ceil(this.totalMemory/1e6);var X=y[g],H=this.isSpur?this.spurClassTable(y,O,C,X):O[y[O[X.oop][Squeak.splOb_CompactClasses]].oop],J=null;for(Q=this.firstOldObject,S=null;Q;)S=J,J=Q.renameFromImage(y,O,H),S?S.nextObject=J:this.firstOldObject=J,y[v+Q.oop]=J,Q=Q.nextObject;this.lastOldObject=J,this.lastOldObject.nextObject=null;var Z=y[g],$=O[y[O[Z.oop][Squeak.splOb_CompactClasses]].oop],G=y[O[Z.oop][Squeak.splOb_ClassFloat]];this.isSpur&&(this.initImmediateClasses(y,O,Z),$=this.spurClassTable(y,O,C,Z),p=this.getCharacter.bind(this),this.initSpurOverrides());var ee=this.firstOldObject,te=0,re=function(){if(ee){for(var e=te+(this.oldSpaceCount/20|0);ee&&te=s.length)return 0;t=2147483652+4*n,s[n++]=e}else{if(a+e.totalBytes()>i.byteLength)return 0;t=a+4*(e.snapshotSize().header+1),a=e.writeTo(i,a,this),l.push(e)}u[e.oop]=t}return t}function h(){for(var e=this.firstOldObject;e;)e.mark=!1,e=e.nextObject;return this.weakObjects=null,!1}for(c=c.bind(this),h=h.bind(this),c(r);0>>2,d=a(),b=a();break;case Squeak.HeaderTypeClass:d=b-Squeak.HeaderTypeClass,p=(b=a())>>>2&63;break;case Squeak.HeaderTypeShort:p=b>>>2&63,d=b>>>12&31;break;case Squeak.HeaderTypeFree:throw Error("Unexpected free block")}var m=n,v=b>>>8&15,g=b>>>17&4095,k=r(--p,v),S=new Squeak.Object;S.initFromImage(m+c,d,v,g),u.nextObject=S,this.oldSpaceCount++,u=S,h[m]=S,f[m+c]=k}S.nextObject=l;for(var _=0;_>>3;var r=(e>>=3)<0;r&&(e=-e,0!==(t=-t)&&e--);var i=0===e?4:e<=255?5:e<=65535?6:e<=16777215?7:8,a=r?this.largeNegIntClass:this.largePosIntClass,s=new a.instProto;this.registerObjectSpur(s),this.hasNewInstances[a.oop]=!0,s.initInstanceOfLargeInt(a,i);for(var n=s.bytes,o=0;o<4;o++)n[o]=255&t,t>>=8;for(o=4;o>=8;return s},ensureClassesInTable:function(){for(var e=this.firstOldObject,t=1024;e;){var r=e.sqClass;if(0===r.hash&&this.enterIntoClassTable(r),r.hash>t&&(t=r.hash),this.classTable[r.hash]!==r)throw Error("Class not in class table");e=e.nextObject}return 1+(t>>10)},classTableBytes:function(e){return 4*(4108+1028*e)},writeFreeLists:function(e,t,r,i){return e.setUint32(t,167772178,r),t+=4,e.setUint32(t,536870912,r),t+=4,t+=128},writeClassTable:function(e,t,r,i,a){e.setUint32(t,4104,r),t+=4,e.setUint32(t,4278190080,r),t+=4,e.setUint32(t,33554448,r),t+=4,e.setUint32(t,4278190080,r),t+=4;for(var s=0;s>2||2!=(3&e.oop))throw Error("Bad immediate char");return e.oop}if(e.oop<0)throw Error("temporary oop");return e.oop<48?e.oop:e.oop+t}for(n(this.formatVersion()),n(64),n(t+this.oldSpaceBytes+16),n(this.firstOldObject.addr()),n(o(this.specialObjectsArray)),this.savedHeaderWords.forEach(n),n(t+this.oldSpaceBytes+16);s<64;)n(0);var u=this.firstOldObject,l=0;for(s=u.writeTo(r,s,i,o),u=u.nextObject,l++,s=u.writeTo(r,s,i,o),u=u.nextObject,l++,s=u.writeTo(r,s,i,o),u=u.nextObject,l++,s=this.writeFreeLists(r,s,i,o),s=this.writeClassTable(r,s,i,o,e);u;)s=u.writeTo(r,s,i,o),u=u.nextObject,l++;if(n(1241513987),n(8388608),n(0),n(0),s!==r.byteLength)throw Error("wrong image size");if(l!==this.oldSpaceCount)throw Error("wrong object count");var c=Date.now()-a;return console.log("Wrote "+l+" objects in "+c+" ms, image size "+s+" bytes"),r.buffer},storeImageSegmentSpur:function(e,t,r){return this.vm.warnOnce("not implemented for Spur yet: primitive 98 (primitiveStoreImageSegment)"),!1},loadImageSegmentSpur:function(e,t){return this.vm.warnOnce("not implemented for Spur yet: primitive 99 (primitiveLoadImageSegment)"),null}}),Object.subclass("Squeak.Interpreter","initialization",{initialize:function(e,t){console.log("squeak: initializing interpreter "+Squeak.vmVersion),this.Squeak=Squeak,this.image=e,(this.image.vm=this).primHandler=new Squeak.Primitives(this,t),this.loadImageState(),this.hackImage(),this.initVMState(),this.loadInitialContext(),this.initCompiler(),console.log("squeak: ready")},loadImageState:function(){this.specialObjects=this.image.specialObjectsArray.pointers,this.specialSelectors=this.specialObjects[Squeak.splOb_SpecialSelectors].pointers,this.nilObj=this.specialObjects[Squeak.splOb_NilObject],this.falseObj=this.specialObjects[Squeak.splOb_FalseObject],this.trueObj=this.specialObjects[Squeak.splOb_TrueObject],this.hasClosures=this.image.hasClosures,this.getGlobals=this.globalsGetter(),this.hasClosures||this.findMethod("UnixFileDirectory class>>pathNameDelimiter")||(this.primHandler.emulateMac=!0),6501==this.image.version&&(this.primHandler.reverseDisplay=!0)},initVMState:function(){this.byteCodeCount=0,this.sendCount=0,this.interruptCheckCounter=0,this.interruptCheckCounterFeedBackReset=1e3,this.interruptChecksEveryNms=3,this.lowSpaceThreshold=1e6,this.signalLowSpace=!1,this.nextPollTick=0,this.nextWakeupTick=0,this.lastTick=0,this.interruptKeycode=2094,this.interruptPending=!1,this.pendingFinalizationSignals=0,this.freeContexts=this.nilObj,this.freeLargeContexts=this.nilObj,this.reclaimableContextCount=0,this.nRecycledContexts=0,this.nAllocatedContexts=0,this.methodCacheSize=1024,this.methodCacheMask=this.methodCacheSize-1,this.methodCacheRandomish=0,this.methodCache=[];for(var e=0;e>wordSize",literal:{index:1,old:8,hack:4},enabled:!0},{method:"ReleaseBuilder class>>prepareEnvironment",bytecode:{pc:28,old:216,hack:135},enabled:("object"==typeof location?location.hash:"").includes("wizard=false")}].forEach(function(t){try{var e=t.enabled&&this.findMethod(t.method);if(e){var r=t.primitive,i=t.bytecode,a=t.literal,s=!0;r?e.pointers[0]|=r:i&&e.bytes[i.pc]===i.old?e.bytes[i.pc]=i.hack:i&&e.bytes[i.pc]===i.hack?s=!1:a&&e.pointers[a.index].pointers[1]===a.old?e.pointers[a.index].pointers[1]=a.hack:a&&e.pointers[a.index].pointers[1]===a.hack?s=!1:(s=!1,console.warn("Not hacking "+t.method)),s&&console.warn("Hacking "+t.method)}}catch(e){console.error("Failed to hack "+t.method+" with error "+e)}},this)}},"interpreting",{interpretOne:function(e){if(this.method.methodSignFlag())return this.interpretOneSistaWithExtensions(e,0,0);if(!this.method.compiled){var t,r,i=this.Squeak;switch(this.byteCodeCount++,t=this.nextByte()){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return void this.push(this.receiver.pointers[15&t]);case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:case 26:case 27:case 28:case 29:case 30:case 31:return void this.push(this.homeContext.pointers[i.Context_tempFrameStart+(15&t)]);case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 58:case 59:case 60:case 61:case 62:case 63:return void this.push(this.method.methodGetLiteral(31&t));case 64:case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 91:case 92:case 93:case 94:case 95:return void this.push(this.method.methodGetLiteral(31&t).pointers[i.Assn_value]);case 96:case 97:case 98:case 99:case 100:case 101:case 102:case 103:return this.receiver.dirty=!0,void(this.receiver.pointers[7&t]=this.pop());case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:return void(this.homeContext.pointers[i.Context_tempFrameStart+(7&t)]=this.pop());case 112:return void this.push(this.receiver);case 113:return void this.push(this.trueObj);case 114:return void this.push(this.falseObj);case 115:return void this.push(this.nilObj);case 116:return void this.push(-1);case 117:return void this.push(0);case 118:return void this.push(1);case 119:return void this.push(2);case 120:return void this.doReturn(this.receiver);case 121:return void this.doReturn(this.trueObj);case 122:return void this.doReturn(this.falseObj);case 123:return void this.doReturn(this.nilObj);case 124:return void this.doReturn(this.pop());case 125:return void this.doReturn(this.pop(),this.activeContext.pointers[i.BlockContext_caller]);case 126:case 127:return void this.nono();case 128:return void this.extendedPush(this.nextByte());case 129:return void this.extendedStore(this.nextByte());case 130:return void this.extendedStorePop(this.nextByte());case 131:return r=this.nextByte(),void this.send(this.method.methodGetSelector(31&r),r>>5,!1);case 132:return void this.doubleExtendedDoAnything(this.nextByte());case 133:return r=this.nextByte(),void this.send(this.method.methodGetSelector(31&r),r>>5,!0);case 134:return r=this.nextByte(),void this.send(this.method.methodGetSelector(63&r),r>>6,!1);case 135:return void this.pop();case 136:return void this.push(this.top());case 137:return void this.push(this.exportThisContext());case 138:return void this.pushNewArray(this.nextByte());case 139:return void this.callPrimBytecode(129);case 140:return r=this.nextByte(),void this.push(this.homeContext.pointers[i.Context_tempFrameStart+this.nextByte()].pointers[r]);case 141:return r=this.nextByte(),void(this.homeContext.pointers[i.Context_tempFrameStart+this.nextByte()].pointers[r]=this.top());case 142:return r=this.nextByte(),void(this.homeContext.pointers[i.Context_tempFrameStart+this.nextByte()].pointers[r]=this.pop());case 143:return void this.pushClosureCopy();case 144:case 145:case 146:case 147:case 148:case 149:case 150:case 151:return void(this.pc+=1+(7&t));case 152:case 153:case 154:case 155:case 156:case 157:case 158:case 159:return void this.jumpIfFalse(1+(7&t));case 160:case 161:case 162:case 163:case 164:case 165:case 166:case 167:return r=this.nextByte(),this.pc+=256*((7&t)-4)+r,void((7&t)<4&&this.interruptCheckCounter--<=0&&this.checkForInterrupts());case 168:case 169:case 170:case 171:return void this.jumpIfTrue(256*(3&t)+this.nextByte());case 172:case 173:case 174:case 175:return void this.jumpIfFalse(256*(3&t)+this.nextByte());case 176:return this.success=!0,this.resultIsFloat=!1,void(this.pop2AndPushNumResult(this.stackIntOrFloat(1)+this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 177:return this.success=!0,this.resultIsFloat=!1,void(this.pop2AndPushNumResult(this.stackIntOrFloat(1)-this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 178:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 180:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)<=this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 181:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)>=this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 182:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)===this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 183:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)!==this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 184:return this.success=!0,this.resultIsFloat=!1,void(this.pop2AndPushNumResult(this.stackIntOrFloat(1)*this.stackIntOrFloat(0))||this.sendSpecial(15&t));case 185:return this.success=!0,void(this.pop2AndPushIntResult(this.quickDivide(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&t));case 186:return this.success=!0,void(this.pop2AndPushIntResult(this.mod(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&t));case 187:return this.success=!0,void(this.primHandler.primitiveMakePoint(1,!0)||this.sendSpecial(15&t));case 188:return this.success=!0,void(this.pop2AndPushIntResult(this.safeShift(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&t));case 189:return this.success=!0,void(this.pop2AndPushIntResult(this.div(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&t));case 190:return this.success=!0,void(this.pop2AndPushIntResult(this.stackInteger(1)&this.stackInteger(0))||this.sendSpecial(15&t));case 191:return this.success=!0,void(this.pop2AndPushIntResult(this.stackInteger(1)|this.stackInteger(0))||this.sendSpecial(15&t));case 192:case 193:case 194:case 195:case 196:case 197:case 198:case 199:case 200:case 201:case 202:case 203:case 204:case 205:case 206:case 207:return void(this.primHandler.quickSendOther(this.receiver,15&t)||this.sendSpecial(16+(15&t)));case 208:case 209:case 210:case 211:case 212:case 213:case 214:case 215:case 216:case 217:case 218:case 219:case 220:case 221:case 222:case 223:return void this.send(this.method.methodGetSelector(15&t),0,!1);case 224:case 225:case 226:case 227:case 228:case 229:case 230:case 231:case 232:case 233:case 234:case 235:case 236:case 237:case 238:case 239:return void this.send(this.method.methodGetSelector(15&t),1,!1);case 240:case 241:case 242:case 243:case 244:case 245:case 246:case 247:case 248:case 249:case 250:case 251:case 252:case 253:case 254:case 255:return void this.send(this.method.methodGetSelector(15&t),2,!1)}throw Error("not a bytecode: "+t)}if(e){if(!this.compiler.enableSingleStepping(this.method))return this.method.compiled=null,this.interpretOne(e);this.breakNow()}this.method.compiled(this)},interpretOneSistaWithExtensions:function(e,t,r){var i,a,s=this.Squeak;switch(this.byteCodeCount++,i=this.nextByte()){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return void this.push(this.receiver.pointers[15&i]);case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:case 26:case 27:case 28:case 29:case 30:case 31:return void this.push(this.method.methodGetLiteral(15&i).pointers[s.Assn_value]);case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 58:case 59:case 60:case 61:case 62:case 63:return void this.push(this.method.methodGetLiteral(31&i));case 64:case 65:case 66:case 67:case 68:case 69:case 70:case 71:return void this.push(this.homeContext.pointers[s.Context_tempFrameStart+(7&i)]);case 72:case 73:case 74:case 75:return void this.push(this.homeContext.pointers[s.Context_tempFrameStart+(3&i)+8]);case 76:return void this.push(this.receiver);case 77:return void this.push(this.trueObj);case 78:return void this.push(this.falseObj);case 79:return void this.push(this.nilObj);case 80:return void this.push(0);case 81:return void this.push(1);case 82:return 0==r?void this.push(this.exportThisContext()):void this.nono();case 83:return void this.push(this.top());case 84:case 85:case 86:case 87:return void this.nono();case 88:return void this.doReturn(this.receiver);case 89:return void this.doReturn(this.trueObj);case 90:return void this.doReturn(this.falseObj);case 91:return void this.doReturn(this.nilObj);case 92:return void this.doReturn(this.pop());case 93:return void this.doReturn(this.nilObj,this.activeContext.pointers[s.BlockContext_caller]);case 94:return 0==t?void this.doReturn(this.pop(),this.activeContext.pointers[s.BlockContext_caller]):void this.nono();case 95:return;case 96:return this.success=!0,this.resultIsFloat=!1,void(this.pop2AndPushNumResult(this.stackIntOrFloat(1)+this.stackIntOrFloat(0))||this.sendSpecial(15&i));case 97:return this.success=!0,this.resultIsFloat=!1,void(this.pop2AndPushNumResult(this.stackIntOrFloat(1)-this.stackIntOrFloat(0))||this.sendSpecial(15&i));case 98:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)this.stackIntOrFloat(0))||this.sendSpecial(15&i));case 100:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)<=this.stackIntOrFloat(0))||this.sendSpecial(15&i));case 101:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)>=this.stackIntOrFloat(0))||this.sendSpecial(15&i));case 102:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)===this.stackIntOrFloat(0))||this.sendSpecial(15&i));case 103:return this.success=!0,void(this.pop2AndPushBoolResult(this.stackIntOrFloat(1)!==this.stackIntOrFloat(0))||this.sendSpecial(15&i));case 104:return this.success=!0,this.resultIsFloat=!1,void(this.pop2AndPushNumResult(this.stackIntOrFloat(1)*this.stackIntOrFloat(0))||this.sendSpecial(15&i));case 105:return this.success=!0,void(this.pop2AndPushIntResult(this.quickDivide(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&i));case 106:return this.success=!0,void(this.pop2AndPushIntResult(this.mod(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&i));case 107:return this.success=!0,void(this.primHandler.primitiveMakePoint(1,!0)||this.sendSpecial(15&i));case 108:return this.success=!0,void(this.pop2AndPushIntResult(this.safeShift(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&i));case 109:return this.success=!0,void(this.pop2AndPushIntResult(this.div(this.stackInteger(1),this.stackInteger(0)))||this.sendSpecial(15&i));case 110:return this.success=!0,void(this.pop2AndPushIntResult(this.stackInteger(1)&this.stackInteger(0))||this.sendSpecial(15&i));case 111:return this.success=!0,void(this.pop2AndPushIntResult(this.stackInteger(1)|this.stackInteger(0))||this.sendSpecial(15&i));case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:case 123:case 124:case 125:case 126:case 127:return void(this.primHandler.quickSendOther(this.receiver,15&i)||this.sendSpecial(16+(15&i)));case 128:case 129:case 130:case 131:case 132:case 133:case 134:case 135:case 136:case 137:case 138:case 139:case 140:case 141:case 142:case 143:return void this.send(this.method.methodGetSelector(15&i),0,!1);case 144:case 145:case 146:case 147:case 148:case 149:case 150:case 151:case 152:case 153:case 154:case 155:case 156:case 157:case 158:case 159:return void this.send(this.method.methodGetSelector(15&i),1,!1);case 160:case 161:case 162:case 163:case 164:case 165:case 166:case 167:case 168:case 169:case 170:case 171:case 172:case 173:case 174:case 175:return void this.send(this.method.methodGetSelector(15&i),2,!1);case 176:case 177:case 178:case 179:case 180:case 181:case 182:case 183:return void(this.pc+=1+(7&i));case 184:case 185:case 186:case 187:case 188:case 189:case 190:case 191:return void this.jumpIfTrue(1+(7&i));case 192:case 193:case 194:case 195:case 196:case 197:case 198:case 199:return void this.jumpIfFalse(1+(7&i));case 200:case 201:case 202:case 203:case 204:case 205:case 206:case 207:return this.receiver.dirty=!0,void(this.receiver.pointers[7&i]=this.pop());case 208:case 209:case 210:case 211:case 212:case 213:case 214:case 215:return void(this.homeContext.pointers[s.Context_tempFrameStart+(7&i)]=this.pop());case 216:return void this.pop();case 217:return void this.nono();case 218:case 219:case 220:case 221:case 222:case 223:return void this.nono();case 224:return a=this.nextByte(),void this.interpretOneSistaWithExtensions(e,(t<<8)+a,r);case 225:return a=this.nextByte(),void this.interpretOneSistaWithExtensions(e,t,(r<<8)+(a<128?a:a-256));case 226:return a=this.nextByte(),void this.push(this.receiver.pointers[a+(t<<8)]);case 227:return a=this.nextByte(),void this.push(this.method.methodGetLiteral(a+(t<<8)).pointers[s.Assn_value]);case 228:return a=this.nextByte(),void this.push(this.method.methodGetLiteral(a+(t<<8)));case 229:return a=this.nextByte(),void this.push(this.homeContext.pointers[s.Context_tempFrameStart+a]);case 230:return void this.nono();case 231:return void this.pushNewArray(this.nextByte());case 232:return a=this.nextByte(),void this.push(a+(r<<8));case 233:return a=this.nextByte(),void this.push(this.image.getCharacter(a+(r<<8)));case 234:return a=this.nextByte(),void this.send(this.method.methodGetSelector((a>>3)+(t<<5)),(7&a)+(r<<3),!1);case 235:a=this.nextByte();var n=this.method.methodGetSelector((a>>3)+(t<<5));return 64<=r?void this.sendSuperDirected(n,(7&a)+((63&r)<<3)):void this.send(n,(7&a)+(r<<3),!0);case 236:return void this.nono();case 237:var o=this.nextByte()+(r<<8);return this.pc+=o,void(o<0&&this.interruptCheckCounter--<=0&&this.checkForInterrupts());case 238:return void this.jumpIfTrue(this.nextByte()+(r<<8));case 239:return void this.jumpIfFalse(this.nextByte()+(r<<8));case 240:return this.receiver.dirty=!0,void(this.receiver.pointers[this.nextByte()+(t<<8)]=this.pop());case 241:return(u=this.method.methodGetLiteral(this.nextByte()+(t<<8))).dirty=!0,void(u.pointers[s.Assn_value]=this.pop());case 242:return void(this.homeContext.pointers[s.Context_tempFrameStart+this.nextByte()]=this.pop());case 243:return this.receiver.dirty=!0,void(this.receiver.pointers[this.nextByte()+(t<<8)]=this.top());case 244:var u;return(u=this.method.methodGetLiteral(this.nextByte()+(t<<8))).dirty=!0,void(u.pointers[s.Assn_value]=this.top());case 245:return void(this.homeContext.pointers[s.Context_tempFrameStart+this.nextByte()]=this.top());case 246:case 247:return void this.nono();case 248:return void this.callPrimBytecode(245);case 249:return void this.pushFullClosure(t);case 250:return void this.pushClosureCopyExtended(t,r);case 251:return a=this.nextByte(),void this.push(this.homeContext.pointers[s.Context_tempFrameStart+this.nextByte()].pointers[a]);case 252:return a=this.nextByte(),void(this.homeContext.pointers[s.Context_tempFrameStart+this.nextByte()].pointers[a]=this.top());case 253:return a=this.nextByte(),void(this.homeContext.pointers[s.Context_tempFrameStart+this.nextByte()].pointers[a]=this.pop());case 254:case 255:return void this.nono()}throw Error("not a bytecode: "+i)},interpret:function(e,t){if(this.frozen)return"frozen";for(this.isIdle=!1,this.breakOutOfInterpreter=!1,this.breakOutTick=this.primHandler.millisecondClockValue()+(e||500);!1===this.breakOutOfInterpreter;)this.method.compiled?this.method.compiled(this):this.interpretOne();if("function"==typeof this.breakOutOfInterpreter)return this.breakOutOfInterpreter(t);var r="break"==this.breakOutOfInterpreter?"break":this.isIdle?this.nextWakeupTick?Math.max(1,this.nextWakeupTick-this.primHandler.millisecondClockValue()):"sleep":0;return t&&t(r),r},goIdle:function(){var e=0!==this.nextWakeupTick;this.forceInterruptCheck(),this.checkForInterrupts();var t=0!==this.nextWakeupTick;this.isIdle=t||!e,this.breakOut()},freeze:function(e){var t;this.frozen=!0,this.breakOutOfInterpreter=function(e){if(!e)throw Error("need function to restart interpreter");return t=e,"frozen"}.bind(this);var r=function(){if(this.frozen=!1,!t)throw Error("no continue function");t(0)}.bind(this);return e&&self.setTimeout(function(){e(r)},0),r},breakOut:function(){this.breakOutOfInterpreter=this.breakOutOfInterpreter||!0},nextByte:function(){return this.method.bytes[this.pc++]},nono:function(){throw Error("Oh No!")},forceInterruptCheck:function(){this.interruptCheckCounter=-1e3},checkForInterrupts:function(){var e=this.primHandler.millisecondClockValue();e=this.nextWakeupTick&&(this.nextWakeupTick=0,(t=this.specialObjects[Squeak.splOb_TheTimerSemaphore]).isNil||this.primHandler.synchronousSignal(t));if(0=this.breakOutTick&&this.breakOut()},extendedPush:function(e){var t=63&e;switch(e>>6){case 0:this.push(this.receiver.pointers[t]);break;case 1:this.push(this.homeContext.pointers[Squeak.Context_tempFrameStart+t]);break;case 2:this.push(this.method.methodGetLiteral(t));break;case 3:this.push(this.method.methodGetLiteral(t).pointers[Squeak.Assn_value])}},extendedStore:function(e){var t=63&e;switch(e>>6){case 0:this.receiver.dirty=!0,this.receiver.pointers[t]=this.top();break;case 1:this.homeContext.pointers[Squeak.Context_tempFrameStart+t]=this.top();break;case 2:this.nono();break;case 3:var r=this.method.methodGetLiteral(t);r.dirty=!0,r.pointers[Squeak.Assn_value]=this.top()}},extendedStorePop:function(e){var t=63&e;switch(e>>6){case 0:this.receiver.dirty=!0,this.receiver.pointers[t]=this.pop();break;case 1:this.homeContext.pointers[Squeak.Context_tempFrameStart+t]=this.pop();break;case 2:this.nono();break;case 3:var r=this.method.methodGetLiteral(t);r.dirty=!0,r.pointers[Squeak.Assn_value]=this.pop()}},doubleExtendedDoAnything:function(e){var t=this.nextByte();switch(e>>5){case 0:this.send(this.method.methodGetSelector(t),31&e,!1);break;case 1:this.send(this.method.methodGetSelector(t),31&e,!0);break;case 2:this.push(this.receiver.pointers[t]);break;case 3:this.push(this.method.methodGetLiteral(t));break;case 4:this.push(this.method.methodGetLiteral(t).pointers[Squeak.Assn_value]);break;case 5:this.receiver.dirty=!0,this.receiver.pointers[t]=this.top();break;case 6:this.receiver.dirty=!0,this.receiver.pointers[t]=this.pop();break;case 7:var r=this.method.methodGetLiteral(t);r.dirty=!0,r.pointers[Squeak.Assn_value]=this.top()}},jumpIfTrue:function(e){var t=this.pop();t.isTrue?this.pc+=e:t.isFalse||(this.push(t),this.send(this.specialObjects[Squeak.splOb_SelectorMustBeBoolean],0,!1))},jumpIfFalse:function(e){var t=this.pop();t.isFalse?this.pc+=e:t.isTrue||(this.push(t),this.send(this.specialObjects[Squeak.splOb_SelectorMustBeBoolean],0,!1))},sendSpecial:function(e){this.send(this.specialSelectors[2*e],this.specialSelectors[2*e+1],!1)},callPrimBytecode:function(e){this.pc+=2,this.primFailCode&&(this.method.bytes[this.pc]===e&&this.stackTopPut(this.getErrorObjectFromPrimFailCode()),this.primFailCode=0)},getErrorObjectFromPrimFailCode:function(){var e=this.specialObjects[Squeak.splOb_PrimErrTableIndex];if(e&&e.pointers){var t=e.pointers[this.primFailCode-1];if(t)return t}return this.primFailCode}},"closures",{pushNewArray:function(e){var t=127>4,i=256*this.nextByte()+this.nextByte(),a=this.encodeSqueakPC(this.pc,this.method),s=this.newClosure(t,a,r);if(s.pointers[Squeak.Closure_outerContext]=this.activeContext,(this.reclaimableContextCount=0)>3&7)+8*this.div(e,16),n=i+(t<<8),o=this.encodeSqueakPC(this.pc,this.method),u=this.newClosure(a,o,s);if(u.pointers[Squeak.Closure_outerContext]=this.activeContext,(this.reclaimableContextCount=0)>6&1)?this.vm.nilObj:this.activeContext;var n=this.method.methodGetLiteral(a),o=this.newFullClosure(t,s,n);if(1==(i>>7&1))throw Error("on-stack receiver not yet supported");if(o.pointers[Squeak.ClosureFull_receiver]=this.receiver,(this.reclaimableContextCount=0)Squeak.Message_lookupClass&&(i.pointers[Squeak.Message_lookupClass]=r),i},primitivePerform:function(e){var t=this.stackValue(e-1),r=this.stackValue(e),i=e-1,a=this.sp-i,s=this.activeContext.pointers;this.arrayCopy(s,1+a,s,a,i),this.sp--;var n=this.findSelectorInClass(t,i,this.getClass(r));return this.executeNewMethod(r,n.method,n.argCount,n.primIndex,n.mClass,t),!0},primitivePerformWithArgs:function(e,t){var r=t?3:2,i=this.stackValue(r),a=this.stackValue(r-1),s=this.stackValue(r-2);if(s.sqClass!==this.specialObjects[Squeak.splOb_ClassArray])return!1;var n=t?this.top():this.getClass(i);if(t)for(var o=this.getClass(i);o!==n;)if((o=o.pointers[Squeak.Class_superclass]).isNil)return!1;var u=s.pointersSize(),l=this.sp-(r-1),c=this.activeContext.pointers;this.arrayCopy(s.pointers,0,c,l,u),this.sp+=u-e;var h=this.findSelectorInClass(a,u,n);return this.executeNewMethod(i,h.method,h.argCount,h.primIndex,h.mClass,a),!0},primitiveInvokeObjectAsMethod:function(e,t){for(var r=this.instantiateClass(this.specialObjects[Squeak.splOb_ClassArray],e),i=0;i=Squeak.MinSmallInt&&e<=Squeak.MaxSmallInt)return this.popNandPush(2,e),!0;if(-4294967295<=e&&e<=4294967295){var t=e<0,r=t?-e:e,i=t?Squeak.splOb_ClassLargeNegativeInteger:Squeak.splOb_ClassLargePositiveInteger,a=this.instantiateClass(this.specialObjects[i],4),s=a.bytes;return s[0]=255&r,s[1]=r>>8&255,s[2]=r>>16&255,s[3]=r>>24&255,this.popNandPush(2,a),!0}}return!1},pop2AndPushBoolResult:function(e){return!!this.success&&(this.popNandPush(2,e?this.trueObj:this.falseObj),!0)}},"numbers",{getClass:function(e){return this.isSmallInt(e)?this.specialObjects[Squeak.splOb_ClassInteger]:e.sqClass},canBeSmallInt:function(e){return e>=Squeak.MinSmallInt&&e<=Squeak.MaxSmallInt},isSmallInt:function(e){return"number"==typeof e},checkSmallInt:function(e){return"number"==typeof e?e:(this.success=!1,1)},quickDivide:function(e,t){if(0===t)return Squeak.NonSmallInt;var r=e/t|0;return r*t===e?r:Squeak.NonSmallInt},div:function(e,t){return 0===t?Squeak.NonSmallInt:Math.floor(e/t)},mod:function(e,t){return 0===t?Squeak.NonSmallInt:e-Math.floor(e/t)*t},safeShift:function(e,t){if(t<0)return t<-31?e<0?-1:0:e>>-t;if(31>t===e?r:Squeak.NonSmallInt}},"utils",{isContext:function(e){return e.sqClass===this.specialObjects[Squeak.splOb_ClassMethodContext]||e.sqClass===this.specialObjects[Squeak.splOb_ClassBlockContext]},isMethodContext:function(e){return e.sqClass===this.specialObjects[Squeak.splOb_ClassMethodContext]},instantiateClass:function(e,t){return this.image.instantiateClass(e,t,this.nilObj)},arrayFill:function(e,t,r,i){for(var a=t;a>"+t.bytesAsString():(i=i||this.activeContext.contextMethod(),this.allMethodsDo(function(e,t,r){if(t===i)return a=e.className()+">>"+r.bytesAsString()}),a||(e?"("+e.pointers[Squeak.Context_receiver]+")>>?":"?>>?"));var a},allInstancesOf:function(e,t){"string"==typeof e&&(e=this.globalNamed(e));for(var r=[],i=this.image.someInstanceOf(e);i;)t?t(i):r.push(i),i=this.image.nextInstanceAfter(i);return r},globalNamed:function(r){return this.allGlobalsDo(function(e,t){if(e.bytesAsString()===r)return t})},allGlobalsDo:function(e){for(var t=this.getGlobals(),r=0;rt+200&&(e.isNil||r.push("..."),r=r.slice(0,t).concat(["..."]).concat(r.slice(-200)));for(var a=[],s=r.length;0>")[0],s=e.split(">>")[1];return this.allMethodsDo(function(e,t,r){if(s.length==r.bytesSize()&&s==r.bytesAsString()&&a==e.className())return i=t}),i},breakNow:function(e){e&&console.log("Break: "+e),this.breakOutOfInterpreter="break"},breakOn:function(e){return this.breakOnMethod=e&&this.findMethod(e)},breakOnReturnFromThisContext:function(){this.breakOnContextChanged=!1,this.breakOnContextReturned=this.activeContext},breakOnSendOrReturn:function(){this.breakOnContextChanged=!0,this.breakOnContextReturned=null},printContext:function(e,r){if(!this.isContext(e))return"NOT A CONTEXT: "+t(e);function t(e){var t="number"==typeof e||"object"==typeof e?e.sqInstName():"<"+e+">";return(t=JSON.stringify(t).slice(1,-1)).length>r-3&&(t=t.slice(0,r-3)+"..."),t}r=r||72;for(var i="number"==typeof e.pointers[Squeak.BlockContext_argumentCount],a=e.pointers[Squeak.Context_closure],s=!i&&!a.isNil,n=i?e.pointers[Squeak.BlockContext_home]:e,o=s?a.pointers[Squeak.Closure_numArgs]:n.pointers[Squeak.Context_method].methodTempCount(),u=this.decodeSqueakSP(0),l=n.contextSizeWithStack(this)-1,c=u+1,h=c+o-1,f=c+n.pointers[Squeak.Context_method].methodNumArgs()-1,p="",d=u;d<=l;d++){var b="";d===u?b="=rcvr":(d<=h&&(b="=tmp"+(d-c)),d<=f&&(b+="/arg"+(d-c))),p+="\nctx["+d+"]"+b+": "+t(n.pointers[d])}if(i){p+="\n";var m=e.pointers[Squeak.BlockContext_argumentCount],v=this.decodeSqueakSP(1),g=(f=v+m,e===this.activeContext?this.sp:e.pointers[Squeak.Context_stackPointer]);g");for(d=v;d<=g;d++){b="";d ",this.pc),this.activeContext.pointers.slice(0,this.sp+1))},willSendOrReturn:function(){var e=this.method.bytes[this.pc];if(this.method.methodSignFlag()){if(96<=e&&e<=127)r=this.specialSelectors[2*(e-96)];else if(128<=e&&e<=175)r=this.method.methodGetSelector(15&e);else if(234==e||235==e)this.method.methodGetSelector(this.method.bytes[this.pc+1]>>3);else if(88<=e&&e<=94)return!0}else{if(120<=e&&e<=125)return!0;if(e<131||200==e)return!1;if(176<=e)return!0;if(e<=134){var t;if(132===e){if(1>5)return!1;t=this.method.bytes[this.pc+2]}else t=this.method.bytes[this.pc+1]&(134===e?63:31);var r=this.method.methodGetLiteral(t);if("blockCopy:"!==r.bytesAsString())return!0}}return!1},nextSendSelector:function(){var e,t=this.method.bytes[this.pc];if(this.method.methodSignFlag())if(96<=t&&t<=127)e=this.specialSelectors[2*(t-96)];else if(128<=t&&t<=175)e=this.method.methodGetSelector(15&t);else{if(234!=t&&235!=t)return null;this.method.methodGetSelector(this.method.bytes[this.pc+1]>>3)}else{if(t<131||200==t)return null;if(208<=t)e=this.method.methodGetLiteral(15&t);else if(176<=t)e=this.specialSelectors[2*(t-176)];else if(t<=134){var r;if(132===t){if(1>5)return null;r=this.method.bytes[this.pc+2]}else r=this.method.bytes[this.pc+1]&(134===t?63:31);e=this.method.methodGetLiteral(r)}}if(e){var i=e.bytesAsString();if("blockCopy:"!==i)return i}}}),Object.subclass("Squeak.InterpreterProxy","initialization",{VM_PROXY_MAJOR:1,VM_PROXY_MINOR:11,initialize:function(t){this.vm=t,this.remappableOops=[],Object.defineProperty(this,"successFlag",{get:function(){return t.primHandler.success},set:function(e){t.primHandler.success=e}})},majorVersion:function(){return this.VM_PROXY_MAJOR},minorVersion:function(){return this.VM_PROXY_MINOR}},"success",{failed:function(){return!this.successFlag},primitiveFail:function(){this.successFlag=!1},primitiveFailFor:function(e){this.successFlag=!1},success:function(e){e||(this.successFlag=!1)}},"stack access",{pop:function(e){this.vm.popN(e)},popthenPush:function(e,t){this.vm.popNandPush(e,t)},push:function(e){this.vm.push(e)},pushBool:function(e){this.vm.push(e?this.vm.trueObj:this.vm.falseObj)},pushInteger:function(e){this.vm.push(e)},pushFloat:function(e){this.vm.push(this.floatObjectOf(e))},stackValue:function(e){return this.vm.stackValue(e)},stackIntegerValue:function(e){var t=this.vm.stackValue(e);return"number"==typeof t?t:(this.successFlag=!1,0)},stackFloatValue:function(e){this.vm.success=!0;var t=this.vm.stackIntOrFloat(e);return this.vm.success?t:(this.successFlag=!1,0)},stackObjectValue:function(e){var t=this.vm.stackValue(e);return"number"!=typeof t?t:(this.successFlag=!1,this.vm.nilObj)},stackBytes:function(e){var t=this.vm.stackValue(e);return t.bytes?t.bytes:("number"!=typeof t&&t.isBytes()||(this.successFlag=!1),[])},stackWords:function(e){var t=this.vm.stackValue(e);return t.words?t.words:("number"!=typeof t&&t.isWords()||(this.successFlag=!1),[])},stackInt32Array:function(e){var t=this.vm.stackValue(e);return t.words?t.wordsAsInt32Array():("number"!=typeof t&&t.isWords()||(this.successFlag=!1),[])},stackInt16Array:function(e){var t=this.vm.stackValue(e);return t.words?t.wordsAsInt16Array():("number"!=typeof t&&t.isWords()||(this.successFlag=!1),[])},stackUint16Array:function(e){var t=this.vm.stackValue(e);return t.words?t.wordsAsUint16Array():("number"!=typeof t&&t.isWords()||(this.successFlag=!1),[])}},"object access",{isBytes:function(e){return"number"!=typeof e&&e.isBytes()},isWords:function(e){return"number"!=typeof e&&e.isWords()},isWordsOrBytes:function(e){return"number"!=typeof e&&e.isWordsOrBytes()},isPointers:function(e){return"number"!=typeof e&&e.isPointers()},isIntegerValue:function(e){return"number"==typeof e&&-1073741824<=e&&e<=1073741823},isArray:function(e){return e.sqClass===this.vm.specialObjects[Squeak.splOb_ClassArray]},isMemberOf:function(e,t){var r=e.sqClass.pointers[Squeak.Class_name].bytes;if(t.length!==r.length)return!1;for(var i=0;i=e.pointers.length)return this.successFlag=!1;e.pointers[t]=r}},"constant access",{isKindOfInteger:function(e){return"number"==typeof e||e.sqClass==this.classLargeNegativeInteger()||e.sqClass==this.classLargePositiveInteger()},classArray:function(){return this.vm.specialObjects[Squeak.splOb_ClassArray]},classBitmap:function(){return this.vm.specialObjects[Squeak.splOb_ClassBitmap]},classSmallInteger:function(){return this.vm.specialObjects[Squeak.splOb_ClassInteger]},classLargePositiveInteger:function(){return this.vm.specialObjects[Squeak.splOb_ClassLargePositiveInteger]},classLargeNegativeInteger:function(){return this.vm.specialObjects[Squeak.splOb_ClassLargeNegativeInteger]},classPoint:function(){return this.vm.specialObjects[Squeak.splOb_ClassPoint]},classString:function(){return this.vm.specialObjects[Squeak.splOb_ClassString]},nilObject:function(){return this.vm.nilObj},falseObject:function(){return this.vm.falseObj},trueObject:function(){return this.vm.trueObj}},"vm functions",{clone:function(e){return this.vm.image.clone(e)},instantiateClassindexableSize:function(e,t){return this.vm.instantiateClass(e,t)},methodArgumentCount:function(){return this.argCount},makePointwithxValueyValue:function(e,t){return this.vm.primHandler.makePointWithXandY(e,t)},pushRemappableOop:function(e){this.remappableOops.push(e)},popRemappableOop:function(){return this.remappableOops.pop()},showDisplayBitsLeftTopRightBottom:function(e,t,r,i,a){if(t>5,!0);if(6===e)return r.send(this.method.methodGetLiteral(63&i),i>>6,!1)}if(7===e)return r.doPop();if(8===e)return r.doDup();if(9===e)return r.pushActiveContext();i=this.method.bytes[this.pc++];if(10===e)return i<128?r.pushNewArray(i):r.popIntoNewArray(i-128);n=this.method.bytes[this.pc++];if(11===e)return r.callPrimitive(i+256*n);if(12===e)return r.pushRemoteTemp(i,n);if(13===e)return r.storeIntoRemoteTemp(i,n);if(14===e)return r.popIntoRemoteTemp(i,n);var o=this.method.bytes[this.pc++];return r.pushClosureCopy(i>>4,15&i,256*n+o)}}),Squeak.InstructionStream.subclass("Squeak.InstructionStreamSista","decoding",{interpretNextInstructionFor:function(e){return this.interpretNextInstructionExtFor(e,0,0)},interpretNextInstructionExtFor:function(e,t,r){this.Squeak;var i=this.method.bytes[this.pc++];switch(i){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return e.pushReceiverVariable(15&i);case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:case 26:case 27:case 28:case 29:case 30:case 31:return e.pushLiteralVariable(this.method.methodGetLiteral(15&i));case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 58:case 59:case 60:case 61:case 62:case 63:return e.pushConstant(this.method.methodGetLiteral(31&i));case 64:case 65:case 66:case 67:case 68:case 69:case 70:case 71:return e.pushTemporaryVariable(15&i);case 72:case 73:case 74:case 75:return e.pushTemporaryVariable(8+(3&i));case 76:return e.pushReceiver();case 77:return e.pushConstant(this.vm.trueObj);case 78:return e.pushConstant(this.vm.falseObj);case 79:return e.pushConstant(this.vm.nilObj);case 80:return e.pushConstant(0);case 81:return e.pushConstant(1);case 82:return e.pushActiveContext();case 83:return e.doDup();case 88:return e.methodReturnReceiver();case 89:return e.methodReturnConstant(this.vm.trueObj);case 90:return e.methodReturnConstant(this.vm.falseObj);case 91:return e.methodReturnConstant(this.vm.nilObj);case 92:return e.methodReturnTop();case 93:return e.blockReturnConstant(this.vm.nilObj);case 94:if(0===t)return e.blockReturnTop();break;case 95:return e.nop();case 96:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:case 123:case 124:case 125:case 126:case 127:return e.send(this.vm.specialSelectors[2*(i-96)],this.vm.specialSelectors[2*(i-96)+1],!1);case 128:case 129:case 130:case 131:case 132:case 133:case 134:case 135:case 136:case 137:case 138:case 139:case 140:case 141:case 142:case 143:return e.send(this.method.methodGetLiteral(15&i),0,!1);case 144:case 145:case 146:case 147:case 148:case 149:case 150:case 151:case 152:case 153:case 154:case 155:case 156:case 157:case 158:case 159:return e.send(this.method.methodGetLiteral(15&i),1,!1);case 160:case 161:case 162:case 163:case 164:case 165:case 166:case 167:case 168:case 169:case 170:case 171:case 172:case 173:case 174:case 175:return e.send(this.method.methodGetLiteral(15&i),2,!1);case 176:case 177:case 178:case 179:case 180:case 181:case 182:case 183:return e.jump(1+(7&i));case 184:case 185:case 186:case 187:case 188:case 189:case 190:case 191:return e.jumpIf(!0,1+(7&i));case 192:case 193:case 194:case 195:case 196:case 197:case 198:case 199:return e.jumpIf(!1,1+(7&i));case 200:case 201:case 202:case 203:case 204:case 205:case 206:case 207:return e.popIntoReceiverVariable(7&i);case 208:case 209:case 210:case 211:case 212:case 213:case 214:case 215:return e.popIntoTemporaryVariable(i-208);case 216:return e.doPop()}var a=this.method.bytes[this.pc++];switch(i){case 224:return this.interpretNextInstructionExtFor(e,(t<<8)+a,r);case 225:return this.interpretNextInstructionExtFor(e,t,(r<<8)+(a<128?a:a-256));case 226:return e.pushReceiverVariable(a+(t<<8));case 227:return e.pushLiteralVariable(this.method.methodGetLiteral(a+(t<<8)));case 228:return e.pushConstant(this.method.methodGetLiteral(a+(t<<8)));case 229:return e.pushTemporaryVariable(a);case 231:return a<128?e.pushNewArray(a):e.popIntoNewArray(a-128);case 232:return e.pushConstant(a+(r<<8));case 233:return e.pushConstant("$"+a+(r<<8));case 234:return e.send(this.method.methodGetSelector((a>>3)+(t<<5)),(7&a)+(r<<3),!1);case 235:var s=this.method.methodGetSelector((a>>3)+(t<<5));return 64<=r?e.sendSuperDirected(s):e.send(s,(7&a)+(r<<3),!0);case 237:return e.jump(a+(r<<8));case 238:return e.jumpIf(!0,a+(r<<8));case 239:return e.jumpIf(!1,a+(r<<8));case 240:return e.popIntoReceiverVariable(a+(t<<8));case 241:return e.popIntoLiteralVariable(this.method.methodGetLiteral(a+(t<<8)));case 242:return e.popIntoTemporaryVariable(a);case 243:return e.storeIntoReceiverVariable(a+(t<<8));case 244:return e.storeIntoLiteralVariable(this.method.methodGetLiteral(a+(t<<8)));case 245:return e.storeIntoTemporaryVariable(a)}var n=this.method.bytes[this.pc++];switch(i){case 248:return e.callPrimitive(a+(n<<8));case 249:var o=a+(t<<8),u=63&n,l=this.method.methodGetLiteral(o);return e.pushFullClosure(o,u,l.methodNumArgs());case 250:var c=(7&a)+8*this.mod(t,16),h=(u=(a>>3&7)+8*this.div(t,16),n+(r<<8));return e.pushClosureCopy(u,c,h);case 251:return e.pushRemoteTemp(a,n);case 252:return e.storeIntoRemoteTemp(a,n);case 253:return e.popIntoRemoteTemp(a,n)}throw Error("Unknown bytecode: "+i)}}),Object.subclass("Squeak.InstructionPrinter","initialization",{initialize:function(e,t){this.method=e,this.vm=t}},"printing",{printInstructions:function(e,t,r){this.indent=e,this.highlight=t,this.highlightPC=r,this.innerIndents={},this.result="",this.scanner=this.method.methodSignFlag()?new Squeak.InstructionStreamSista(this.method,this.vm):new Squeak.InstructionStream(this.method,this.vm),this.oldPC=this.scanner.pc,this.endPC=0,this.done=!1;try{for(;!this.done;)this.scanner.interpretNextInstructionFor(this)}catch(e){this.print("!!! "+e.message)}return this.result},print:function(e){this.oldPC===this.highlightPC?this.highlight&&(this.result+=this.highlight):this.indent&&(this.result+=this.indent),this.result+=this.oldPC;for(var t=0;tthis.oldPC&&(this.result+=" "),this.result+=(this.method.bytes[t]+256).toString(16).substr(-2).toUpperCase();this.result+="> "+e+"\n",this.oldPC=this.scanner.pc}},"decoding",{blockReturnConstant:function(e){this.print("blockReturn: "+e.toString())},blockReturnTop:function(){this.print("blockReturn")},doDup:function(){this.print("dup")},doPop:function(){this.print("pop")},jump:function(e){this.print("jumpTo: "+(this.scanner.pc+e)),this.scanner.pc+e>this.endPC&&(this.endPC=this.scanner.pc+e)},jumpIf:function(e,t){this.print((e?"jumpIfTrue: ":"jumpIfFalse: ")+(this.scanner.pc+t)),this.scanner.pc+t>this.endPC&&(this.endPC=this.scanner.pc+t)},methodReturnReceiver:function(){this.print("return: receiver"),this.done=this.scanner.pc>this.endPC},methodReturnTop:function(){this.print("return: topOfStack"),this.done=this.scanner.pc>this.endPC},methodReturnConstant:function(e){this.print("returnConst: "+e.toString()),this.done=this.scanner.pc>this.endPC},nop:function(){this.print("nop")},popIntoLiteralVariable:function(e){this.print("popIntoBinding: "+e.assnKeyAsString())},popIntoReceiverVariable:function(e){this.print("popIntoInstVar: "+e)},popIntoTemporaryVariable:function(e){this.print("popIntoTemp: "+e)},pushActiveContext:function(){this.print("push: thisContext")},pushConstant:function(e){var t=e.sqInstName?e.sqInstName():e.toString();this.print("pushConst: "+t)},pushLiteralVariable:function(e){this.print("pushBinding: "+e.assnKeyAsString())},pushReceiver:function(){this.print("push: self")},pushReceiverVariable:function(e){this.print("pushInstVar: "+e)},pushTemporaryVariable:function(e){this.print("pushTemp: "+e)},send:function(e,t,r){this.print((r?"superSend: #":"send: #")+(e.bytesAsString?e.bytesAsString():e))},sendSuperDirected:function(e){this.print("directedSuperSend: #"+(e.bytesAsString?e.bytesAsString():e))},storeIntoLiteralVariable:function(e){this.print("storeIntoBinding: "+e.assnKeyAsString())},storeIntoReceiverVariable:function(e){this.print("storeIntoInstVar: "+e)},storeIntoTemporaryVariable:function(e){this.print("storeIntoTemp: "+e)},pushNewArray:function(e){this.print("push: (Array new: "+e+")")},popIntoNewArray:function(e){this.print("pop: "+e+" into: (Array new: "+e+")")},pushRemoteTemp:function(e,t){this.print("push: "+e+" ofTemp: "+t)},storeIntoRemoteTemp:function(e,t){this.print("storeInto: "+e+" ofTemp: "+t)},popIntoRemoteTemp:function(e,t){this.print("popInto: "+e+" ofTemp: "+t)},pushClosureCopy:function(e,t,r){var i=this.scanner.pc,a=i+r;this.print("closure("+i+"-"+(a-1)+"): "+e+" copied, "+t+" args");for(var s=i;sthis.endPC&&(this.endPC=a)},pushFullClosure:function(e,t,r){this.print("pushFullClosure: (self literalAt: "+e+") numCopied: "+t+" numArgs: "+r)},callPrimitive:function(e){this.print("primitive: "+e)}}),Object.subclass("Squeak.Primitives","initialization",{initialize:function(e,t){this.vm=e,this.oldPrims=!this.vm.image.hasClosures,this.allowAccessBeyondSP=this.oldPrims,this.deferDisplayUpdates=!1,this.semaphoresToSignal=[],this.initDisplay(t),this.initAtCache(),this.initModules(),this.initPlugins(),e.image.isSpur&&(this.charFromInt=this.charFromIntSpur,this.charToInt=this.charToIntSpur,this.identityHash=this.identityHashSpur)},initDisplay:function(e){this.display=e},initModules:function(){this.loadedModules={},this.builtinModules={},this.patchModules={},this.interpreterProxy=new Squeak.InterpreterProxy(this.vm)},initPlugins:function(){}},"dispatch",{quickSendOther:function(e,t){switch(this.success=!0,t){case 0:return this.popNandPushIfOK(2,this.objectAt(!0,!0,!1));case 1:return this.popNandPushIfOK(3,this.objectAtPut(!0,!0,!1));case 2:return this.popNandPushIfOK(1,this.objectSize(!0));case 6:return this.popNandPushBoolIfOK(2,this.vm.stackValue(1)===this.vm.stackValue(0));case 7:return this.popNandPushIfOK(1,this.vm.getClass(this.vm.top()));case 8:return this.popNandPushIfOK(2,this.doBlockCopy());case 9:return this.primitiveBlockValue(0);case 10:return this.primitiveBlockValue(1)}return!1},doPrimitive:function(e,t,r){switch(this.success=!0,e){case 1:return this.popNandPushIntIfOK(t+1,this.stackInteger(1)+this.stackInteger(0));case 2:return this.popNandPushIntIfOK(t+1,this.stackInteger(1)-this.stackInteger(0));case 3:return this.popNandPushBoolIfOK(t+1,this.stackInteger(1)this.stackInteger(0));case 5:return this.popNandPushBoolIfOK(t+1,this.stackInteger(1)<=this.stackInteger(0));case 6:return this.popNandPushBoolIfOK(t+1,this.stackInteger(1)>=this.stackInteger(0));case 7:return this.popNandPushBoolIfOK(t+1,this.stackInteger(1)===this.stackInteger(0));case 8:return this.popNandPushBoolIfOK(t+1,this.stackInteger(1)!==this.stackInteger(0));case 9:return this.popNandPushIntIfOK(t+1,this.stackInteger(1)*this.stackInteger(0));case 10:return this.popNandPushIntIfOK(t+1,this.vm.quickDivide(this.stackInteger(1),this.stackInteger(0)));case 11:return this.popNandPushIntIfOK(t+1,this.vm.mod(this.stackInteger(1),this.stackInteger(0)));case 12:return this.popNandPushIntIfOK(t+1,this.vm.div(this.stackInteger(1),this.stackInteger(0)));case 13:return this.popNandPushIntIfOK(t+1,this.stackInteger(1)/this.stackInteger(0)|0);case 14:return this.popNandPushIfOK(t+1,this.doBitAnd());case 15:return this.popNandPushIfOK(t+1,this.doBitOr());case 16:return this.popNandPushIfOK(t+1,this.doBitXor());case 17:return this.popNandPushIfOK(t+1,this.doBitShift());case 18:return this.primitiveMakePoint(t,!1);case 19:return!1;case 20:return this.vm.warnOnce("missing primitive: 20 (primitiveRemLargeIntegers)"),!1;case 21:return this.vm.warnOnce("missing primitive: 21 (primitiveAddLargeIntegers)"),!1;case 22:return this.vm.warnOnce("missing primitive: 22 (primitiveSubtractLargeIntegers)"),!1;case 23:return this.primitiveLessThanLargeIntegers(t);case 24:return this.primitiveGreaterThanLargeIntegers(t);case 25:return this.primitiveLessOrEqualLargeIntegers(t);case 26:return this.primitiveGreaterOrEqualLargeIntegers(t);case 27:return this.primitiveEqualLargeIntegers(t);case 28:return this.primitiveNotEqualLargeIntegers(t);case 29:return this.vm.warnOnce("missing primitive: 29 (primitiveMultiplyLargeIntegers)"),!1;case 30:return this.vm.warnOnce("missing primitive: 30 (primitiveDivideLargeIntegers)"),!1;case 31:return this.vm.warnOnce("missing primitive: 31 (primitiveModLargeIntegers)"),!1;case 32:return this.vm.warnOnce("missing primitive: 32 (primitiveDivLargeIntegers)"),!1;case 33:return this.vm.warnOnce("missing primitive: 33 (primitiveQuoLargeIntegers)"),!1;case 34:return this.vm.warnOnce("missing primitive: 34 (primitiveBitAndLargeIntegers)"),!1;case 35:return this.vm.warnOnce("missing primitive: 35 (primitiveBitOrLargeIntegers)"),!1;case 36:return this.vm.warnOnce("missing primitive: 36 (primitiveBitXorLargeIntegers)"),!1;case 37:return this.vm.warnOnce("missing primitive: 37 (primitiveBitShiftLargeIntegers)"),!1;case 38:return this.popNandPushIfOK(t+1,this.objectAt(!1,!1,!1));case 39:return this.popNandPushIfOK(t+1,this.objectAtPut(!1,!1,!1));case 40:return this.popNandPushFloatIfOK(t+1,this.stackInteger(0));case 41:return this.popNandPushFloatIfOK(t+1,this.stackFloat(1)+this.stackFloat(0));case 42:return this.popNandPushFloatIfOK(t+1,this.stackFloat(1)-this.stackFloat(0));case 43:return this.popNandPushBoolIfOK(t+1,this.stackFloat(1)this.stackFloat(0));case 45:return this.popNandPushBoolIfOK(t+1,this.stackFloat(1)<=this.stackFloat(0));case 46:return this.popNandPushBoolIfOK(t+1,this.stackFloat(1)>=this.stackFloat(0));case 47:return this.popNandPushBoolIfOK(t+1,this.stackFloat(1)===this.stackFloat(0));case 48:return this.popNandPushBoolIfOK(t+1,this.stackFloat(1)!==this.stackFloat(0));case 49:return this.popNandPushFloatIfOK(t+1,this.stackFloat(1)*this.stackFloat(0));case 50:return this.popNandPushFloatIfOK(t+1,this.safeFDiv(this.stackFloat(1),this.stackFloat(0)));case 51:return this.popNandPushIfOK(t+1,this.floatAsSmallInt(this.stackFloat(0)));case 52:return this.popNandPushFloatIfOK(t+1,this.floatFractionPart(this.stackFloat(0)));case 53:return this.popNandPushIntIfOK(t+1,this.frexp_exponent(this.stackFloat(0))-1);case 54:return this.popNandPushFloatIfOK(t+1,this.ldexp(this.stackFloat(1),this.stackFloat(0)));case 55:return this.popNandPushFloatIfOK(t+1,Math.sqrt(this.stackFloat(0)));case 56:return this.popNandPushFloatIfOK(t+1,Math.sin(this.stackFloat(0)));case 57:return this.popNandPushFloatIfOK(t+1,Math.atan(this.stackFloat(0)));case 58:return this.popNandPushFloatIfOK(t+1,Math.log(this.stackFloat(0)));case 59:return this.popNandPushFloatIfOK(t+1,Math.exp(this.stackFloat(0)));case 60:return this.popNandPushIfOK(t+1,this.objectAt(!1,!1,!1));case 61:return this.popNandPushIfOK(t+1,this.objectAtPut(!1,!1,!1));case 62:return this.popNandPushIfOK(t+1,this.objectSize(!1));case 63:return this.popNandPushIfOK(t+1,this.objectAt(!1,!0,!1));case 64:return this.popNandPushIfOK(t+1,this.objectAtPut(!1,!0,!1));case 65:return this.vm.warnOnce("missing primitive: 65 (primitiveNext)"),!1;case 66:return this.vm.warnOnce("missing primitive: 66 (primitiveNextPut)"),!1;case 67:return this.vm.warnOnce("missing primitive: 67 (primitiveAtEnd)"),!1;case 68:return this.popNandPushIfOK(t+1,this.objectAt(!1,!1,!0));case 69:return this.popNandPushIfOK(t+1,this.objectAtPut(!1,!1,!0));case 70:return this.popNandPushIfOK(t+1,this.instantiateClass(this.stackNonInteger(0),0));case 71:return this.popNandPushIfOK(t+1,this.instantiateClass(this.stackNonInteger(1),this.stackPos32BitInt(0)));case 72:return this.primitiveArrayBecome(t,!1,!0);case 73:return this.popNandPushIfOK(t+1,this.objectAt(!1,!1,!0));case 74:return this.popNandPushIfOK(t+1,this.objectAtPut(!1,!1,!0));case 75:return this.popNandPushIfOK(t+1,this.identityHash(this.stackNonInteger(0)));case 76:return this.primitiveStoreStackp(t);case 77:return this.popNandPushIfOK(t+1,this.someInstanceOf(this.stackNonInteger(0)));case 78:return this.popNandPushIfOK(t+1,this.nextInstanceAfter(this.stackNonInteger(0)));case 79:return this.primitiveNewMethod(t);case 80:return this.popNandPushIfOK(t+1,this.doBlockCopy());case 81:return this.primitiveBlockValue(t);case 82:return this.primitiveBlockValueWithArgs(t);case 83:return this.vm.primitivePerform(t);case 84:return this.vm.primitivePerformWithArgs(t,!1);case 85:return this.primitiveSignal();case 86:return this.primitiveWait();case 87:return this.primitiveResume();case 88:return this.primitiveSuspend();case 89:return this.vm.flushMethodCache();case 90:return this.primitiveMousePoint(t);case 91:return this.primitiveTestDisplayDepth(t);case 92:return this.vm.warnOnce("missing primitive: 92 (primitiveSetDisplayMode)"),!1;case 93:return this.primitiveInputSemaphore(t);case 94:return this.primitiveGetNextEvent(t);case 95:return this.primitiveInputWord(t);case 96:return this.namedPrimitive("BitBltPlugin","primitiveCopyBits",t);case 97:return this.primitiveSnapshot(t);case 98:return this.primitiveStoreImageSegment(t);case 99:return this.primitiveLoadImageSegment(t);case 100:return this.vm.primitivePerformWithArgs(t,!0);case 101:return this.primitiveBeCursor(t);case 102:return this.primitiveBeDisplay(t);case 103:return this.primitiveScanCharacters(t);case 104:return this.vm.warnOnce("missing primitive: 104 (primitiveDrawLoop)"),!1;case 105:return this.popNandPushIfOK(t+1,this.doStringReplace());case 106:return this.primitiveScreenSize(t);case 107:return this.primitiveMouseButtons(t);case 108:return this.primitiveKeyboardNext(t);case 109:return this.primitiveKeyboardPeek(t);case 110:return this.popNandPushBoolIfOK(t+1,this.vm.stackValue(1)===this.vm.stackValue(0));case 111:return this.popNandPushIfOK(t+1,this.vm.getClass(this.vm.top()));case 112:return this.popNandPushIfOK(t+1,this.vm.image.bytesLeft());case 113:return this.primitiveQuit(t);case 114:return this.primitiveExitToDebugger(t);case 115:return this.primitiveChangeClass(t);case 116:return this.vm.flushMethodCacheForMethod(this.vm.top());case 117:return this.doNamedPrimitive(t,r);case 118:return this.primitiveDoPrimitiveWithArgs(t);case 119:return this.vm.flushMethodCacheForSelector(this.vm.top());case 120:return this.primitiveCalloutToFFI(t,r);case 121:return this.primitiveImageName(t);case 122:return this.primitiveReverseDisplay(t);case 123:return this.vm.warnOnce("missing primitive: 123 (primitiveValueUninterruptably)"),!1;case 124:return this.popNandPushIfOK(t+1,this.registerSemaphore(Squeak.splOb_TheLowSpaceSemaphore));case 125:return this.popNandPushIfOK(t+1,this.setLowSpaceThreshold());case 126:return this.primitiveDeferDisplayUpdates(t);case 127:return this.primitiveShowDisplayRect(t);case 128:return this.primitiveArrayBecome(t,!0,!0);case 129:return this.popNandPushIfOK(t+1,this.vm.image.specialObjectsArray);case 130:return this.primitiveFullGC(t);case 131:return this.primitivePartialGC(t);case 132:return this.popNandPushBoolIfOK(t+1,this.pointsTo(this.stackNonInteger(1),this.vm.top()));case 133:return this.popNIfOK(t);case 134:return this.popNandPushIfOK(t+1,this.registerSemaphore(Squeak.splOb_TheInterruptSemaphore));case 135:return this.popNandPushIfOK(t+1,this.millisecondClockValue());case 136:return this.primitiveSignalAtMilliseconds(t);case 137:return this.popNandPushIfOK(t+1,this.secondClock());case 138:return this.popNandPushIfOK(t+1,this.someObject());case 139:return this.popNandPushIfOK(t+1,this.nextObject(this.vm.top()));case 140:return this.primitiveBeep(t);case 141:return this.primitiveClipboardText(t);case 142:return this.popNandPushIfOK(t+1,this.makeStString(this.filenameToSqueak(Squeak.vmPath)));case 143:case 144:return this.primitiveShortAtAndPut(t);case 145:return this.primitiveConstantFill(t);case 146:return this.namedPrimitive("JoystickTabletPlugin","primitiveReadJoystick",t);case 147:return this.namedPrimitive("BitBltPlugin","primitiveWarpBits",t);case 148:return this.popNandPushIfOK(t+1,this.vm.image.clone(this.vm.top()));case 149:return this.primitiveGetAttribute(t);case 150:if(this.oldPrims)return this.primitiveFileAtEnd(t);case 151:if(this.oldPrims)return this.primitiveFileClose(t);case 152:if(this.oldPrims)return this.primitiveFileGetPosition(t);case 153:if(this.oldPrims)return this.primitiveFileOpen(t);case 154:if(this.oldPrims)return this.primitiveFileRead(t);case 155:if(this.oldPrims)return this.primitiveFileSetPosition(t);case 156:if(this.oldPrims)return this.primitiveFileDelete(t);case 157:if(this.oldPrims)return this.primitiveFileSize(t);break;case 158:return this.oldPrims?this.primitiveFileWrite(t):(this.vm.warnOnce("missing primitive: 158 (primitiveCompareWith)"),!1);case 159:return this.oldPrims?this.primitiveFileRename(t):this.popNandPushIntIfOK(t+1,1664525*this.stackSigned53BitInt(0)&268435455);case 160:return this.oldPrims?this.primitiveDirectoryCreate(t):this.primitiveAdoptInstance(t);case 161:return this.oldPrims?this.primitiveDirectoryDelimitor(t):(this.vm.warnOnce("missing primitive: 161 (primitiveSetIdentityHash)"),!1);case 162:if(this.oldPrims)return this.primitiveDirectoryLookup(t);break;case 163:return this.oldPrims?this.primitiveDirectoryDelete(t):(this.vm.warnOnce("missing primitive: 163 (primitiveGetImmutability)"),!1);case 164:return this.popNandPushIfOK(t+1,this.vm.trueObj);case 165:case 166:return this.primitiveIntegerAtAndPut(t);case 167:return!1;case 168:return this.primitiveCopyObject(t);case 169:return this.oldPrims?this.primitiveDirectorySetMacTypeAndCreator(t):this.popNandPushBoolIfOK(t+1,this.vm.stackValue(1)!==this.vm.stackValue(0));case 170:return this.oldPrims?this.namedPrimitive("SoundPlugin","primitiveSoundStart",t):this.primitiveAsCharacter(t);case 171:return this.oldPrims?this.namedPrimitive("SoundPlugin","primitiveSoundStartWithSemaphore",t):this.popNandPushIfOK(t+1,this.stackNonInteger(0).hash);case 172:return this.oldPrims?this.namedPrimitive("SoundPlugin","primitiveSoundStop",t):(this.vm.warnOnce("missing primitive: 172 (primitiveFetchMourner)"),this.popNandPushIfOK(t,this.vm.nilObj));case 173:return this.oldPrims?this.namedPrimitive("SoundPlugin","primitiveSoundAvailableSpace",t):this.popNandPushIfOK(t+1,this.objectAt(!1,!1,!0));case 174:return this.oldPrims?this.namedPrimitive("SoundPlugin","primitiveSoundPlaySamples",t):this.popNandPushIfOK(t+1,this.objectAtPut(!1,!1,!0));case 175:return this.oldPrims?this.namedPrimitive("SoundPlugin","primitiveSoundPlaySilence",t):this.vm.image.isSpur?this.popNandPushIfOK(t+1,this.behaviorHash(this.stackNonInteger(0))):(this.vm.warnOnce("primitive 175 called in non-spur image"),this.popNandPushIfOK(t+1,this.identityHash(this.stackNonInteger(0))));case 176:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primWaveTableSoundmixSampleCountintostartingAtpan",t):this.popNandPushIfOK(t+1,this.vm.image.isSpur?4194303:4095);case 177:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primFMSoundmixSampleCountintostartingAtpan",t):this.popNandPushIfOK(t+1,this.allInstancesOf(this.stackNonInteger(0)));case 178:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primPluckedSoundmixSampleCountintostartingAtpan",t):!1;case 179:if(this.oldPrims)return this.namedPrimitive("SoundGenerationPlugin","primSampledSoundmixSampleCountintostartingAtpan",t);break;case 180:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primitiveMixFMSound",t):!1;case 181:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primitiveMixPluckedSound",t):this.primitiveSizeInBytesOfInstance(t);case 182:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","oldprimSampledSoundmixSampleCountintostartingAtleftVolrightVol",t):this.primitiveSizeInBytes(t);case 183:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primitiveApplyReverb",t):this.primitiveIsPinned(t);case 184:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primitiveMixLoopedSampledSound",t):this.primitivePin(t);case 185:return this.oldPrims?this.namedPrimitive("SoundGenerationPlugin","primitiveMixSampledSound",t):this.primitiveExitCriticalSection(t);case 186:if(this.oldPrims)break;return this.primitiveEnterCriticalSection(t);case 187:if(this.oldPrims)break;return this.primitiveTestAndSetOwnershipOfCriticalSection(t);case 188:if(this.oldPrims)break;return this.primitiveExecuteMethodArgsArray(t);case 189:return this.oldPrims?this.namedPrimitive("SoundPlugin","primitiveSoundInsertSamples",t):!1;case 190:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundStartRecording",t);case 191:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundStopRecording",t);case 192:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundGetRecordingSampleRate",t);case 193:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundRecordSamples",t);case 194:if(this.oldPrims)return this.namedPrimitive("SoundPlugin","primitiveSoundSetRecordLevel",t);break;case 195:case 196:case 197:case 198:case 199:return!1;case 200:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveInitializeNetwork",t):this.primitiveClosureCopyWithCopiedValues(t);case 201:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverStartNameLookup",t):this.primitiveClosureValue(t);case 202:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverNameLookupResult",t):this.primitiveClosureValue(t);case 203:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverStartAddressLookup",t):this.primitiveClosureValue(t);case 204:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverAddressLookupResult",t):this.primitiveClosureValue(t);case 205:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverAbortLookup",t):this.primitiveClosureValue(t);case 206:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverLocalAddress",t):this.primitiveClosureValueWithArgs(t);case 207:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverStatus",t):this.primitiveFullClosureValue(t);case 208:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveResolverError",t):this.primitiveFullClosureValueWithArgs(t);case 209:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketCreate",t):this.primitiveFullClosureValueNoContextSwitch(t);case 210:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketDestroy",t):this.popNandPushIfOK(t+1,this.objectAt(!1,!1,!1));case 211:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketConnectionStatus",t):this.popNandPushIfOK(t+1,this.objectAtPut(!1,!1,!1));case 212:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketError",t):this.popNandPushIfOK(t+1,this.objectSize(!1));case 213:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketLocalAddress",t);case 214:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketLocalPort",t);case 215:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketRemoteAddress",t);case 216:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketRemotePort",t);case 217:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketConnectToPort",t);case 218:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketListenOnPort",t):(this.vm.warnOnce("missing primitive: 218 (tryNamedPrimitiveInForWithArgs"),!1);case 219:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketCloseConnection",t);case 220:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketAbortConnection",t);break;case 221:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketReceiveDataBufCount",t):this.primitiveClosureValueNoContextSwitch(t);case 222:return this.oldPrims?this.namedPrimitive("SocketPlugin","primitiveSocketReceiveDataAvailable",t):this.primitiveClosureValueNoContextSwitch(t);case 223:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketSendDataBufCount",t);case 224:if(this.oldPrims)return this.namedPrimitive("SocketPlugin","primitiveSocketSendDone",t);break;case 230:return this.primitiveRelinquishProcessorForMicroseconds(t);case 231:return this.primitiveForceDisplayUpdate(t);case 232:return this.vm.warnOnce("missing primitive: 232 (primitiveFormPrint)"),!1;case 233:return this.primitiveSetFullScreen(t);case 234:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveDecompressFromByteArray",t);case 235:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveCompareString",t);case 236:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveConvert8BitSigned",t);case 237:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveCompressToByteArray",t);case 238:if(this.oldPrims)return this.namedPrimitive("SerialPlugin","primitiveSerialPortOpen",t);case 239:if(this.oldPrims)return this.namedPrimitive("SerialPlugin","primitiveSerialPortClose",t);break;case 240:return this.oldPrims?this.namedPrimitive("SerialPlugin","primitiveSerialPortWrite",t):this.popNandPushIfOK(t+1,this.microsecondClockUTC());case 241:return this.oldPrims?this.namedPrimitive("SerialPlugin","primitiveSerialPortRead",t):this.popNandPushIfOK(t+1,this.microsecondClockLocal());case 242:if(this.oldPrims)break;return this.primitiveSignalAtUTCMicroseconds(t);case 243:return this.oldPrims?this.namedPrimitive("MiscPrimitivePlugin","primitiveTranslateStringWithTable",t):(this.vm.warnOnce("missing primitive: 243 (primitiveUpdateTimeZone)"),!1);case 244:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveFindFirstInString",t);case 245:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveIndexOfAsciiInString",t);case 246:if(this.oldPrims)return this.namedPrimitive("MiscPrimitivePlugin","primitiveFindSubstring",t);break;case 248:return this.primitiveArrayBecome(t,!1,!1);case 249:return this.primitiveArrayBecome(t,!1,!0);case 254:return this.primitiveVMParameter(t);case 521:return this.namedPrimitive("MIDIPlugin","primitiveMIDIClosePort",t);case 522:return this.namedPrimitive("MIDIPlugin","primitiveMIDIGetClock",t);case 523:return this.namedPrimitive("MIDIPlugin","primitiveMIDIGetPortCount",t);case 524:return this.namedPrimitive("MIDIPlugin","primitiveMIDIGetPortDirectionality",t);case 525:return this.namedPrimitive("MIDIPlugin","primitiveMIDIGetPortName",t);case 526:return this.namedPrimitive("MIDIPlugin","primitiveMIDIOpenPort",t);case 527:return this.namedPrimitive("MIDIPlugin","primitiveMIDIParameterGetOrSet",t);case 528:return this.namedPrimitive("MIDIPlugin","primitiveMIDIRead",t);case 529:return this.namedPrimitive("MIDIPlugin","primitiveMIDIWrite",t);case 550:return this.namedPrimitive("ADPCMCodecPlugin","primitiveDecodeMono",t);case 551:return this.namedPrimitive("ADPCMCodecPlugin","primitiveDecodeStereo",t);case 552:return this.namedPrimitive("ADPCMCodecPlugin","primitiveEncodeMono",t);case 553:return this.namedPrimitive("ADPCMCodecPlugin","primitiveEncodeStereo",t);case 571:return this.primitiveUnloadModule(t);case 572:return this.primitiveListBuiltinModule(t);case 573:return this.primitiveListLoadedModule(t);case 575:return this.vm.warnOnce("missing primitive: 575 (primitiveHighBit)"),!1;case 576:return this.vm.primitiveInvokeObjectAsMethod(t,r);case 578:return this.vm.warnOnce("missing primitive: 578 (primitiveSuspendAndBackupPC)"),!1}return console.error("primitive "+e+" not implemented yet"),!1},namedPrimitive:function(e,t,r){var i=""===e?this:this.loadedModules[e];void 0===i&&(i=this.loadModule(e),this.loadedModules[e]=i);var a=!1,s=this.vm.sp;if(i){this.interpreterProxy.argCount=r;var n=i[t];"function"==typeof n?a=i[t](r):"string"==typeof n?a=this[n](r):this.vm.warnOnce("missing primitive: "+e+"."+t)}else this.vm.warnOnce("missing module: "+e+" ("+t+")");return(!0===a||!1!==a&&this.success)&&this.vm.sp!==s-r&&!this.vm.frozen&&this.vm.warnOnce("stack unbalanced after primitive "+e+"."+t,"error"),!0===a||!1===a?a:this.success},doNamedPrimitive:function(e,t){if(t.pointersSize()<2)return!1;var r=t.pointers[1];if(4!==r.pointersSize())return!1;this.primMethod=t;var i=r.pointers[0].bytesAsString(),a=r.pointers[1].bytesAsString();return this.namedPrimitive(i,a,e)},fakePrimitive:function(e,t,r){return this.vm.warnOnce("faking primitive: "+e),void 0===t?this.vm.popN(r):this.vm.popNandPush(r+1,this.makeStObject(t)),!0}},"modules",{loadModule:function(e){var t=Squeak.externalModules[e]||this.builtinModules[e]||this.loadModuleDynamically(e);if(!t)return null;if(this.patchModules[e]&&this.patchModule(t,e),t.setInterpreter&&!t.setInterpreter(this.interpreterProxy))return console.log("Wrong interpreter proxy version: "+e),null;var r=t.initialiseModule;return"function"==typeof r?t.initialiseModule():"string"==typeof r&&this[r](),this.interpreterProxy.failed()?(console.log("Module initialization failed: "+e),null):(console.log("Loaded module: "+e),t)},loadModuleDynamically:function(e){},patchModule:function(e,t){var r=this.patchModules[t];for(var i in r)e[i]=r[i]},unloadModule:function(e){var t=this.loadedModules[e];if(!e||!t||t===this)return null;delete this.loadedModules[e];var r=t.unloadModule;return"function"==typeof r?t.unloadModule(this):"string"==typeof r&&this[r](this),console.log("Unloaded module: "+e),t},loadFunctionFrom:function(e,t){var r=""===t?this:this.loadedModules[t];if(void 0===r&&(r=this.loadModule(t),this.loadedModules[t]=r),!r)return null;var i=r[e];return"function"==typeof i?i.bind(r):"string"==typeof i?this[i].bind(this):(this.vm.warnOnce("missing primitive: "+t+"."+e),null)},primitiveUnloadModule:function(e){var t=this.stackNonInteger(0).bytesAsString();return!!t&&(this.unloadModule(t),this.popNIfOK(e))},primitiveListBuiltinModule:function(e){var t=this.stackInteger(0)-1;if(!this.success)return!1;var r=Object.keys(this.builtinModules);return this.popNandPushIfOK(e+1,this.makeStObject(r[t]))},primitiveListLoadedModule:function(e){var t=this.stackInteger(0)-1;if(!this.success)return!1;var r=[];for(var i in this.loadedModules){var a=this.loadedModules[i];if(a){var s=a.getModuleName?a.getModuleName():i;r.push(s)}}return this.popNandPushIfOK(e+1,this.makeStObject(r[t]))}},"stack access",{popNIfOK:function(e){return!!this.success&&(this.vm.popN(e),!0)},pop2andPushBoolIfOK:function(e){return this.vm.success=this.success,this.vm.pop2AndPushBoolResult(e)},popNandPushBoolIfOK:function(e,t){return!!this.success&&(this.vm.popNandPush(e,t?this.vm.trueObj:this.vm.falseObj),!0)},popNandPushIfOK:function(e,t){return!(!this.success||null==t)&&(this.vm.popNandPush(e,t),!0)},popNandPushIntIfOK:function(e,t){return!(!this.success||!this.vm.canBeSmallInt(t))&&(this.vm.popNandPush(e,t),!0)},popNandPushFloatIfOK:function(e,t){return!!this.success&&(this.vm.popNandPush(e,this.makeFloat(t)),!0)},stackNonInteger:function(e){return this.checkNonInteger(this.vm.stackValue(e))},stackInteger:function(e){return this.checkSmallInt(this.vm.stackValue(e))},stackPos32BitInt:function(e){return this.positive32BitValueOf(this.vm.stackValue(e))},pos32BitIntFor:function(e){if(0<=e&&e<=Squeak.MaxSmallInt)return e;for(var t=this.vm.specialObjects[Squeak.splOb_ClassLargePositiveInteger],r=this.vm.instantiateClass(t,4),i=r.bytes,a=0;a<4;a++)i[a]=e>>>8*a&255;return r},pos53BitIntFor:function(e){if(e<=4294967295)return this.pos32BitIntFor(e);if(9007199254740991=Squeak.MinSmallInt&&e<=Squeak.MaxSmallInt)return e;for(var t=e<0,r=t?-e:e,i=t?Squeak.splOb_ClassLargeNegativeInteger:Squeak.splOb_ClassLargePositiveInteger,a=this.vm.instantiateClass(this.vm.specialObjects[i],4),s=a.bytes,n=0;n<4;n++)s[n]=r>>>8*n&255;return a},stackFloat:function(e){return this.checkFloat(this.vm.stackValue(e))},stackBoolean:function(e){return this.checkBoolean(this.vm.stackValue(e))},stackSigned53BitInt:function(e){var t=this.vm.stackValue(e);if("number"==typeof t)return t;var r=t.bytesSize();if(r<=7){for(var i=t.bytes,a=0,s=0,n=1;s>>20&2047;return 0===r&&(t.setFloat64(0,e*Math.pow(2,64)),r=(t.getUint32(0)>>>20&2047)-64),r-1022},ldexp:function(e,t){for(var r=Math.min(3,Math.ceil(Math.abs(t)/1023)),i=e,a=0;athis.stackSigned53BitInt(0))},primitiveLessOrEqualLargeIntegers:function(e){return this.popNandPushBoolIfOK(e+1,this.stackSigned53BitInt(1)<=this.stackSigned53BitInt(0))},primitiveGreaterOrEqualLargeIntegers:function(e){return this.popNandPushBoolIfOK(e+1,this.stackSigned53BitInt(1)>=this.stackSigned53BitInt(0))},primitiveEqualLargeIntegers:function(e){return this.popNandPushBoolIfOK(e+1,this.stackSigned53BitInt(1)===this.stackSigned53BitInt(0))},primitiveNotEqualLargeIntegers:function(e){return this.popNandPushBoolIfOK(e+1,this.stackSigned53BitInt(1)!==this.stackSigned53BitInt(0))}},"utils",{floatOrInt:function(e){return e.isFloat?e.float:"number"==typeof e?e:0},positive32BitValueOf:function(e){if("number"==typeof e)return 0<=e?e:(this.success=!1,0);if(!this.isA(e,Squeak.splOb_ClassLargePositiveInteger)||4!==e.bytesSize())return this.success=!1,0;for(var t=e.bytes,r=0,i=0,a=1;i<4;i++,a*=256)r+=t[i]*a;return r},checkFloat:function(e){return e.isFloat?e.float:"number"==typeof e?e:(this.success=!1,0)},checkSmallInt:function(e){return"number"==typeof e?e:(this.success=!1,0)},checkNonInteger:function(e){return"number"!=typeof e?e:(this.success=!1,this.vm.nilObj)},checkBoolean:function(e){return!!e.isTrue||!e.isFalse&&(this.success=!1)},indexableSize:function(e){return"number"==typeof e?-1:e.indexableSize(this)},isA:function(e,t){return e.sqClass===this.vm.specialObjects[t]},isKindOf:function(e,t){for(var r=e.sqClass,i=this.vm.specialObjects[t];!r.isNil;){if(r===i)return!0;r=r.pointers[Squeak.Class_superclass]}return!1},isAssociation:function(e){return"number"!=typeof e&&2==e.pointersSize()},ensureSmallInt:function(e){return e===(0|e)&&this.vm.canBeSmallInt(e)?e:(this.success=!1,0)},charFromInt:function(e){var t=this.vm.specialObjects[Squeak.splOb_CharacterTable].pointers[e];if(t)return t;var r=this.vm.specialObjects[Squeak.splOb_ClassCharacter];return(t=this.vm.instantiateClass(r,0)).pointers[0]=e,t},charFromIntSpur:function(e){return this.vm.image.getCharacter(e)},charToInt:function(e){return e.pointers[0]},charToIntSpur:function(e){return e.hash},makeFloat:function(e){var t=this.vm.specialObjects[Squeak.splOb_ClassFloat],r=this.vm.instantiateClass(t,2);return r.float=e,r},makeLargeIfNeeded:function(e){return this.vm.canBeSmallInt(e)?e:this.makeLargeInt(e)},makeLargeInt:function(e){if(e<0)throw Error("negative large ints not implemented yet");if(4294967295i.size)return this.success=!1,a;if(r)return a.pointers[s-1];if(a.isPointers())return a.pointers[s-1+i.ivarOffset];if(a.isWords())return i.convertChars?this.charFromInt(1073741823&a.words[s-1]):this.pos32BitIntFor(a.words[s-1]);if(a.isBytes())return i.convertChars?this.charFromInt(255&a.bytes[s-1]):255&a.bytes[s-1];var o=4*a.pointersSize();return s-1-o<0?(this.success=!1,a):255&a.bytes[s-1-o]},objectAtPut:function(e,t,r){var i,a=this.stackNonInteger(2),s=this.stackPos32BitInt(1);if(!this.success)return a;if(e){if((i=this.atPutCache[a.hash&this.atCacheMask]).array!==a)return this.success=!1,a}else{if(a.isFloat){var n=this.stackPos32BitInt(0);if(!this.success||1!=s&&2!=s)this.success=!1;else{var o=a.floatData();o.setUint32(1==s?0:4,n,!1),a.float=o.getFloat64(0)}return this.vm.stackValue(0)}i=this.makeAtCacheInfo(this.atPutCache,this.vm.specialSelectors[34],a,t,r)}if(s<1||s>i.size)return this.success=!1,a;var u,l=this.vm.stackValue(0);if(r)return a.dirty=!0,a.pointers[s-1]=l;if(a.isPointers())return a.dirty=!0,a.pointers[s-1+i.ivarOffset]=l;if(a.isWords()){if(t){if(l.sqClass!==this.vm.specialObjects[Squeak.splOb_ClassCharacter])return this.success=!1,l;if("number"!=typeof(u=this.charToInt(l)))return this.success=!1,l}else u=this.stackPos32BitInt(0);return this.success&&(a.words[s-1]=u),l}if(t){if(l.sqClass!==this.vm.specialObjects[Squeak.splOb_ClassCharacter])return this.success=!1,l;if("number"!=typeof(u=this.charToInt(l)))return this.success=!1,l}else{if("number"!=typeof l)return this.success=!1,l;u=l}if(u<0||255this.vm.image.bytesLeft()?(console.warn("squeak: out of memory, failing allocation"),this.success=!1,this.vm.primFailCode=Squeak.PrimErrNoMemory,null):this.vm.instantiateClass(e,t)},someObject:function(){return this.vm.image.firstOldObject},nextObject:function(e){return this.vm.image.objectAfter(e)||0},someInstanceOf:function(e){var t=this.vm.image.someInstanceOf(e);return t||(this.success=!1,0)},nextInstanceAfter:function(e){var t=this.vm.image.nextInstanceAfter(e);return t||(this.success=!1,0)},allInstancesOf:function(e){var t=this.vm.image.allInstancesOf(e),r=this.vm.instantiateClass(this.vm.specialObjects[Squeak.splOb_ClassArray],t.length);return r.pointers=t,r},identityHash:function(e){return e.hash},identityHashSpur:function(e){var t=e.hash;return 0=t.pointers.length)return!1;for(var i=t.pointers[Squeak.Context_stackPointer];i=a)return!1;this.vm.popN(2);for(var s=0;s=a.length)return!1;if(e<2)t=a[i];else{if((t=this.stackInteger(0))<-32768||32767=a.length)return!1;if(e<2)t=this.signed32BitIntegerFor(a[i]);else{if(t=this.stackSigned32BitInt(0),!this.success)return!1;a[i]=t}return this.popNandPushIfOK(e+1,t),!0},primitiveConstantFill:function(e){var t=this.stackNonInteger(1),r=this.stackPos32BitInt(0);if(!this.success||!t.isWordsOrBytes())return!1;var i=t.words||t.bytes;if(i){if(i===t.bytes&&255t)a=r[t];else{if(!(t<0&&i&&i.length>-t-1))return!1;a=i[-t-1]}}return this.vm.popNandPush(e+1,this.makeStObject(a)),!0},setLowSpaceThreshold:function(){var e=this.stackInteger(0);return this.success&&(this.vm.lowSpaceThreshold=e),this.vm.stackValue(1)},primitiveVMParameter:function(e){var t=this.vm.image.isSpur?71:44;switch(e){case 0:for(var r=this.vm.instantiateClass(this.vm.specialObjects[Squeak.splOb_ClassArray],t),i=0;i","<=",">=","=","~=","*","/","\\\\","@","bitShift:","//","bitAnd:","bitOr:","at:","at:put:","size","next","nextPut:","atEnd","==","class","blockCopy:","value","value:","do:","new","new:","x","y"],this.doitCounter=0}},"accessing",{compile:function(e,t,r){if(!e.methodSignFlag())if(void 0===e.compiled)e.compiled=!1;else{this.singleStep=!1,this.debug=this.comments;var i=t&&t.className(),a=r&&r.bytesAsString();e.compiled=this.generate(e,i,a)}},enableSingleStepping:function(i,a,s){if(!i.compiled||!i.compiled.canSingleStep){this.singleStep=!0,this.debug=!0,a||this.vm.allMethodsDo(function(e,t,r){if(t===i)return a=e,s=r,!0});var e=a&&a.className(),t=s&&s.bytesAsString(),r=a&&a.allInstVarNames();i.compiled=this.generate(i,e,t,r),i.compiled.canSingleStep=!0}return!0},functionNameFor:function(e,t){if(void 0===e||"?"===e)return"DOIT_"+ ++this.doitCounter;if(!/[^a-zA-Z0-9:_]/.test(t))return(e+"_"+t).replace(/[: ]/g,"_");var r=t.replace(/./g,function(e){return{"|":"OR","~":"NOT","<":"LT","=":"EQ",">":"GT","&":"AND","@":"AT","*":"TIMES","+":"PLUS","\\":"MOD","-":"MINUS",",":"COMMA","/":"DIV","?":"IF"}[e]||"OPERATOR"});return e.replace(/[ ]/,"_")+"__"+r+"__"}},"generating",{generate:function(e,t,r,i){for(this.method=e,this.pc=0,this.endPC=0,this.prevPC=0,this.source=[],this.sourceLabels={},this.needsLabel={},this.sourcePos={},this.needsVar={},this.needsBreak=!1,t&&r&&this.source.push("// ",t,">>",r,"\n"),this.instVarNames=i,this.allVars=["context","stack","rcvr","inst[","temp[","lit["],this.sourcePos.context=this.source.length,this.source.push("var context = vm.activeContext;\n"),this.sourcePos.stack=this.source.length,this.source.push("var stack = context.pointers;\n"),this.sourcePos.rcvr=this.source.length,this.source.push("var rcvr = vm.receiver;\n"),this.sourcePos["inst["]=this.source.length,this.source.push("var inst = rcvr.pointers;\n"),this.sourcePos["temp["]=this.source.length,this.source.push("var temp = vm.homeContext.pointers;\n"),this.sourcePos["lit["]=this.source.length,this.source.push("var lit = vm.method.pointers;\n"),this.sourcePos["loop-start"]=this.source.length,this.source.push("while (true) switch (vm.pc) {\ncase 0:\n"),this.done=!1;!this.done;){var a=e.bytes[this.pc++],s=0;switch(248&a){case 0:case 8:this.generatePush("inst[",15&a,"]");break;case 16:case 24:this.generatePush("temp[",6+(15&a),"]");break;case 32:case 40:case 48:case 56:this.generatePush("lit[",1+(31&a),"]");break;case 64:case 72:case 80:case 88:this.generatePush("lit[",1+(31&a),"].pointers[1]");break;case 96:this.generatePopInto("inst[",7&a,"]");break;case 104:this.generatePopInto("temp[",6+(7&a),"]");break;case 112:switch(a){case 112:this.generatePush("rcvr");break;case 113:this.generatePush("vm.trueObj");break;case 114:this.generatePush("vm.falseObj");break;case 115:this.generatePush("vm.nilObj");break;case 116:this.generatePush("-1");break;case 117:this.generatePush("0");break;case 118:this.generatePush("1");break;case 119:this.generatePush("2")}break;case 120:switch(a){case 120:this.generateReturn("rcvr");break;case 121:this.generateReturn("vm.trueObj");break;case 122:this.generateReturn("vm.falseObj");break;case 123:this.generateReturn("vm.nilObj");break;case 124:this.generateReturn("stack[vm.sp]");break;case 125:this.generateBlockReturn();break;default:throw Error("unusedBytecode")}break;case 128:case 136:this.generateExtended(a);break;case 144:this.generateJump(1+(7&a));break;case 152:this.generateJumpIf(!1,1+(7&a));break;case 160:s=e.bytes[this.pc++],this.generateJump(256*((7&a)-4)+s);break;case 168:s=e.bytes[this.pc++],this.generateJumpIf(a<172,256*(3&a)+s);break;case 176:case 184:this.generateNumericOp(a);break;case 192:case 200:this.generateQuickPrim(a);break;case 208:case 216:this.generateSend("lit[",1+(15&a),"]",0,!1);break;case 224:case 232:this.generateSend("lit[",1+(15&a),"]",1,!1);break;case 240:case 248:this.generateSend("lit[",1+(15&a),"]",2,!1)}}var n=this.functionNameFor(t,r);return this.singleStep?(this.debug&&this.source.push("// all valid PCs have a label;\n"),this.source.push("default: throw Error('invalid PC');\n}")):(this.sourcePos["loop-end"]=this.source.length,this.source.push("default: vm.interpretOne(true); return;\n}"),this.deleteUnneededLabels()),this.deleteUnneededVariables(),new Function("'use strict';\nreturn function "+n+"(vm) {\n"+this.source.join("")+"}")()},generateExtended:function(e){var t,r;switch(e){case 128:switch((t=this.method.bytes[this.pc++])>>6){case 0:return void this.generatePush("inst[",63&t,"]");case 1:return void this.generatePush("temp[",6+(63&t),"]");case 2:return void this.generatePush("lit[",1+(63&t),"]");case 3:return void this.generatePush("lit[",1+(63&t),"].pointers[1]")}case 129:switch((t=this.method.bytes[this.pc++])>>6){case 0:return void this.generateStoreInto("inst[",63&t,"]");case 1:return void this.generateStoreInto("temp[",6+(63&t),"]");case 2:throw Error("illegal store into literal");case 3:return void this.generateStoreInto("lit[",1+(63&t),"].pointers[1]")}return;case 130:switch((t=this.method.bytes[this.pc++])>>6){case 0:return void this.generatePopInto("inst[",63&t,"]");case 1:return void this.generatePopInto("temp[",6+(63&t),"]");case 2:throw Error("illegal pop into literal");case 3:return void this.generatePopInto("lit[",1+(63&t),"].pointers[1]")}case 131:return t=this.method.bytes[this.pc++],void this.generateSend("lit[",1+(31&t),"]",t>>5,!1);case 132:switch(t=this.method.bytes[this.pc++],r=this.method.bytes[this.pc++],t>>5){case 0:return void this.generateSend("lit[",1+r,"]",31&t,!1);case 1:return void this.generateSend("lit[",1+r,"]",31&t,!0);case 2:return void this.generatePush("inst[",r,"]");case 3:return void this.generatePush("lit[",1+r,"]");case 4:return void this.generatePush("lit[",1+r,"].pointers[1]");case 5:return void this.generateStoreInto("inst[",r,"]");case 6:return void this.generatePopInto("inst[",r,"]");case 7:return void this.generateStoreInto("lit[",1+r,"].pointers[1]")}case 133:return t=this.method.bytes[this.pc++],void this.generateSend("lit[",1+(31&t),"]",t>>5,!0);case 134:return t=this.method.bytes[this.pc++],void this.generateSend("lit[",1+(63&t),"]",t>>6,!1);case 135:return void this.generateInstruction("pop","vm.sp--");case 136:return this.needsVar.stack=!0,void this.generateInstruction("dup","var dup = stack[vm.sp]; stack[++vm.sp] = dup");case 137:return this.needsVar.stack=!0,void this.generateInstruction("push thisContext","stack[++vm.sp] = vm.exportThisContext()");case 138:var i=127<(t=this.method.bytes[this.pc++]),a=127&t;return void this.generateClosureTemps(a,i);case 139:return t=this.method.bytes[this.pc++],r=this.method.bytes[this.pc++],void this.generateCallPrimitive(t+256*r);case 140:return t=this.method.bytes[this.pc++],r=this.method.bytes[this.pc++],void this.generatePush("temp[",6+r,"].pointers[",t,"]");case 141:return t=this.method.bytes[this.pc++],r=this.method.bytes[this.pc++],void this.generateStoreInto("temp[",6+r,"].pointers[",t,"]");case 142:return t=this.method.bytes[this.pc++],r=this.method.bytes[this.pc++],void this.generatePopInto("temp[",6+r,"].pointers[",t,"]");case 143:var s=15&(t=this.method.bytes[this.pc++]),n=t>>4,o=(r=this.method.bytes[this.pc++])<<8|this.method.bytes[this.pc++];return void this.generateClosureCopy(s,n,o)}},generatePush:function(e,t,r,i,a){this.debug&&this.generateDebugCode("push",e,t,r,i,a),this.generateLabel(),this.needsVar[e]=!0,this.needsVar.stack=!0,this.source.push("stack[++vm.sp] = ",e),void 0!==t&&(this.source.push(t,r),void 0!==i&&this.source.push(i,a)),this.source.push(";\n")},generateStoreInto:function(e,t,r,i,a){this.debug&&this.generateDebugCode("store into",e,t,r,i,a),this.generateLabel(),this.needsVar[e]=!0,this.needsVar.stack=!0,this.source.push(e),void 0!==t&&(this.source.push(t,r),void 0!==i&&this.source.push(i,a)),this.source.push(" = stack[vm.sp];\n"),this.generateDirty(e,t)},generatePopInto:function(e,t,r,i,a){this.debug&&this.generateDebugCode("pop into",e,t,r,i,a),this.generateLabel(),this.needsVar[e]=!0,this.needsVar.stack=!0,this.source.push(e),void 0!==t&&(this.source.push(t,r),void 0!==i&&this.source.push(i,a)),this.source.push(" = stack[vm.sp--];\n"),this.generateDirty(e,t)},generateReturn:function(e){this.debug&&this.generateDebugCode("return",e),this.generateLabel(),this.needsVar[e]=!0,this.source.push("vm.pc = ",this.pc,"; vm.doReturn(",e,"); return;\n"),this.needsBreak=!1,this.done=this.pc>this.endPC},generateBlockReturn:function(){this.debug&&this.generateDebugCode("block return"),this.generateLabel(),this.needsVar.stack=!0,this.source.push("vm.pc = ",this.pc,"; vm.doReturn(stack[vm.sp--], context.pointers[0]); return;\n"),this.needsBreak=!1},generateJump:function(e){var t=this.pc+e;this.debug&&this.generateDebugCode("jump to "+t),this.generateLabel(),this.needsVar.context=!0,this.source.push("vm.pc = ",t,"; "),e<0&&this.source.push("\nif (vm.interruptCheckCounter-- <= 0) {\n"," vm.checkForInterrupts();\n"," if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return;\n","}\n"),this.singleStep&&this.source.push("\nif (vm.breakOutOfInterpreter) return;\n"),this.source.push("continue;\n"),this.needsBreak=!1,this.needsLabel[t]=!0,t>this.endPC&&(this.endPC=t)},generateJumpIf:function(e,t){var r=this.pc+t;this.debug&&this.generateDebugCode("jump if "+e+" to "+r),this.generateLabel(),this.needsVar.stack=!0,this.source.push("var cond = stack[vm.sp--]; if (cond === vm.",e,"Obj) {vm.pc = ",r,"; "),this.singleStep&&this.source.push("if (vm.breakOutOfInterpreter) return; else "),this.source.push("continue}\n","else if (cond !== vm.",!e,"Obj) {vm.sp++; vm.pc = ",this.pc,"; vm.send(vm.specialObjects[25], 0, false); return}\n"),this.needsLabel[this.pc]=!0,this.needsLabel[r]=!0,r>this.endPC&&(this.endPC=r)},generateQuickPrim:function(e){switch(this.debug&&this.generateDebugCode("quick send #"+this.specialSelectors[16+(15&e)]),this.generateLabel(),e){case 192:return this.needsVar.stack=!0,this.source.push("var a, b; if ((a=stack[vm.sp-1]).sqClass === vm.specialObjects[7] && typeof (b=stack[vm.sp]) === 'number' && b>0 && b<=a.pointers.length) {\n"," stack[--vm.sp] = a.pointers[b-1];","} else { var c = vm.primHandler.objectAt(true,true,false); if (vm.primHandler.success) stack[--vm.sp] = c; else {\n"," vm.pc = ",this.pc,"; vm.sendSpecial(16); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return; }}\n"),void(this.needsLabel[this.pc]=!0);case 193:return this.needsVar.stack=!0,this.source.push("var a, b; if ((a=stack[vm.sp-2]).sqClass === vm.specialObjects[7] && typeof (b=stack[vm.sp-1]) === 'number' && b>0 && b<=a.pointers.length) {\n"," var c = stack[vm.sp]; stack[vm.sp-=2] = a.pointers[b-1] = c; a.dirty = true;","} else { vm.primHandler.objectAtPut(true,true,false); if (vm.primHandler.success) stack[vm.sp-=2] = c; else {\n"," vm.pc = ",this.pc,"; vm.sendSpecial(17); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return; }}\n"),void(this.needsLabel[this.pc]=!0);case 194:return this.needsVar.stack=!0,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; }\n"),void(this.needsLabel[this.pc]=!0);case 198:return this.needsVar.stack=!0,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 this.needsVar.stack=!0,void this.source.push("stack[vm.sp] = typeof stack[vm.sp] === 'number' ? vm.specialObjects[5] : stack[vm.sp].sqClass;\n");case 200:return this.needsVar.rcvr=!0,this.source.push("vm.pc = ",this.pc,"; if (!vm.primHandler.quickSendOther(rcvr, ",15&e,")) ","{vm.sendSpecial(",16+(15&e),"); return}\n"),this.needsLabel[this.pc]=!0,void(this.needsLabel[this.pc+2]=!0);case 201:case 202:case 203:return this.needsVar.rcvr=!0,this.source.push("vm.pc = ",this.pc,"; if (!vm.primHandler.quickSendOther(rcvr, ",15&e,")) vm.sendSpecial(",16+(15&e),"); return;\n"),void(this.needsLabel[this.pc]=!0)}this.needsVar.rcvr=!0,this.needsVar.context=!0,this.source.push("vm.pc = ",this.pc,"; if (!vm.primHandler.quickSendOther(rcvr, ",15&e,"))"," vm.sendSpecial(",16+(15&e),");\n","if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return;\n"),this.needsBreak=!1,this.needsLabel[this.pc]=!0},generateNumericOp:function(e){switch(this.debug&&this.generateDebugCode("quick send #"+this.specialSelectors[15&e]),this.generateLabel(),this.needsLabel[this.pc]=!0,e){case 176:return this.needsVar.stack=!0,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}\n");case 177:return this.needsVar.stack=!0,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}\n");case 178:return this.needsVar.stack=!0,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}\n");case 179:return this.needsVar.stack=!0,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}\n");case 180:return this.needsVar.stack=!0,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(4); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return}\n");case 181:return this.needsVar.stack=!0,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(5); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return}\n");case 182:return this.needsVar.stack=!0,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 if (a === b && a.float === a.float) {\n"," stack[--vm.sp] = vm.trueObj;\n","} else { vm.pc = ",this.pc,"; vm.sendSpecial(6); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return}\n");case 183:return this.needsVar.stack=!0,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 if (a === b && a.float === a.float) {\n"," stack[--vm.sp] = vm.falseObj;\n","} else { vm.pc = ",this.pc,"; vm.sendSpecial(7); if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return}\n");case 184:return void this.source.push("vm.success = true; vm.resultIsFloat = false; if(!vm.pop2AndPushNumResult(vm.stackIntOrFloat(1) * vm.stackIntOrFloat(0))) { vm.pc = ",this.pc,"; vm.sendSpecial(8); return}\n");case 185:return void this.source.push("vm.success = true; if(!vm.pop2AndPushIntResult(vm.quickDivide(vm.stackInteger(1),vm.stackInteger(0)))) { vm.pc = ",this.pc,"; vm.sendSpecial(9); return}\n");case 186:return void this.source.push("vm.success = true; if(!vm.pop2AndPushIntResult(vm.mod(vm.stackInteger(1),vm.stackInteger(0)))) { vm.pc = ",this.pc,"; vm.sendSpecial(10); return}\n");case 187:return void this.source.push("vm.success = true; if(!vm.primHandler.primitiveMakePoint(1, true)) { vm.pc = ",this.pc,"; vm.sendSpecial(11); return}\n");case 188:return void this.source.push("vm.success = true; if(!vm.pop2AndPushIntResult(vm.safeShift(vm.stackInteger(1),vm.stackInteger(0)))) { vm.pc = ",this.pc,"; vm.sendSpecial(12); return}\n");case 189:return void this.source.push("vm.success = true; if(!vm.pop2AndPushIntResult(vm.div(vm.stackInteger(1),vm.stackInteger(0)))) { vm.pc = ",this.pc,"; vm.sendSpecial(13); return}\n");case 190:return void this.source.push("vm.success = true; if(!vm.pop2AndPushIntResult(vm.stackInteger(1) & vm.stackInteger(0))) { vm.pc = ",this.pc,"; vm.sendSpecial(14); return}\n");case 191:return void this.source.push("vm.success = true; if(!vm.pop2AndPushIntResult(vm.stackInteger(1) | vm.stackInteger(0))) { vm.pc = ",this.pc,"; vm.sendSpecial(15); return}\n")}},generateSend:function(e,t,r,i,a){this.debug&&this.generateDebugCode("send "+("lit["===e?this.method.pointers[t].bytesAsString():"...")),this.generateLabel(),this.needsVar[e]=!0,this.needsVar.context=!0,this.source.push("vm.pc = ",this.pc,"; vm.send(",e,t,r,", ",i,", ",a,"); ","if (context !== vm.activeContext || vm.breakOutOfInterpreter !== false) return;\n"),this.needsBreak=!1,this.needsLabel[this.pc]=!0},generateClosureTemps:function(e,t){if(this.debug&&this.generateDebugCode("closure temps"),this.generateLabel(),this.needsVar.stack=!0,this.source.push("var array = vm.instantiateClass(vm.specialObjects[7], ",e,");\n"),t){for(var r=0;rthis.endPC&&(this.endPC=a)},generateCallPrimitive:function(e){this.debug&&this.generateDebugCode("call primitive "+e),this.generateLabel(),129===this.method.bytes[this.pc]&&(this.needsVar.stack=!0,this.source.push("if (vm.primFailCode) {stack[vm.sp] = vm.getErrorObjectFromPrimFailCode(); vm.primFailCode = 0;}\n"))},generateDirty:function(e,t){switch(e){case"inst[":this.source.push("rcvr.dirty = true;\n");break;case"lit[":this.source.push(e,t,"].dirty = true;\n");break;case"temp[":break;default:throw Error("unexpected target "+e)}},generateLabel:function(){this.prevPC&&(this.sourceLabels[this.prevPC]=this.source.length,this.source.push("case ",this.prevPC,":\n")),this.prevPC=this.pc},generateDebugCode:function(e,t,r,i,a,s){this.needsBreak&&(this.source.push("if (vm.breakOutOfInterpreter) {vm.pc = ",this.prevPC,"; return}\n"),this.needsLabel[this.prevPC]=!0);for(var n=[],o=this.prevPC;o ",e),t)switch(this.source.push(" "),t){case"vm.nilObj":this.source.push("nil");break;case"vm.trueObj":this.source.push("true");break;case"vm.falseObj":this.source.push("false");break;case"rcvr":this.source.push("self");break;case"stack[vm.sp]":this.source.push("top of stack");break;case"inst[":this.instVarNames?this.source.push(this.instVarNames[r]):this.source.push("inst var ",r);break;case"temp[":this.source.push("tmp",r-6),"]"!==i&&this.source.push("[",a,"]");break;case"lit[":var u=this.method.pointers[r];"]"===i?this.source.push(u):this.source.push(u.pointers[0].bytesAsString());break;default:this.source.push(t)}this.source.push("\n"),this.needsBreak=this.singleStep},generateInstruction:function(e,t){this.debug&&this.generateDebugCode(e),this.generateLabel(),this.source.push(t,";\n")},deleteUnneededLabels:function(){var e=!1;for(var t in this.sourceLabels)if(this.needsLabel[t])e=!0;else for(var r=0;r<3;r++)this.source[this.sourceLabels[t]+r]="";e||(this.source[this.sourcePos["loop-start"]]="",this.source[this.sourcePos["loop-end"]]="")},deleteUnneededVariables:function(){this.needsVar.stack&&(this.needsVar.context=!0),this.needsVar["inst["]&&(this.needsVar.rcvr=!0);for(var e=0;e>u|(a&n)>>u+1,n>>>=1;r[i]=o}return{obj:e.obj,bits:r,depth:2,width:16,height:16,offsetX:e.offsetX,offsetY:e.offsetY,msb:!0,pixPerWord:16,pitch:1}},primitiveBeDisplay:function(e){var t=this.vm.stackValue(0);return this.vm.specialObjects[Squeak.splOb_TheDisplay]=t,this.vm.popN(e),!0},primitiveReverseDisplay:function(e){if(this.reverseDisplay=!this.reverseDisplay,this.redrawDisplay(),this.display.cursorCanvas){for(var t=this.display.cursorCanvas,r=t.getContext("2d"),i=r.getImageData(0,0,t.width,t.height),a=new Uint32Array(i.data.buffer),s=0;sr.left&&(r.left=e.left),e.rightr.top&&(r.top=e.top),e.bottom>16)+((255&I)<<16);h[f]=p}this.swappedColors=h}this.reverseDisplay&&(h=i?i.map(function(e){return 16777215^e}):(this.reversedColors||(this.reversedColors=h.map(function(e){return 16777215^e})),this.reversedColors));for(var d=(1<>>g&d],(g-=t.depth)<0&&(g=32-t.depth,k=t.bits[++v]);s++}break;case 16:for(b=a%2?0:16,m=0;m>>g;c[S++]=((31744&y)>>7)+((992&y)<<6)+((31&y)<<19)+4278190080,(g-=16)<0&&(g=16,k=t.bits[++v])}s++}break;case 32:var O=i?0:4278190080;for(m=0;m>16|(255&I)<<16|O;c[S++]=p}s++}break;default:throw Error("depth not implemented")}u.data!==l&&u.data.set(l),e.putImageData(u,r.left,r.top)}},primitiveDeferDisplayUpdates:function(e){var t=this.stackBoolean(0);return!!this.success&&(this.deferDisplayUpdates=t,this.vm.popN(e),!0)},primitiveForceDisplayUpdate:function(e){return this.vm.breakOut(),this.vm.popN(e),!0},primitiveScanCharacters:function(e){if(6!==e)return!1;var t=this.stackInteger(0),r=this.stackNonInteger(1),i=this.stackInteger(2),a=this.stackNonInteger(3),s=this.stackInteger(4),n=this.stackInteger(5);if(!this.success)return!1;if(r.pointersSize()<258||!a.isBytes())return!1;if(!(0r.pitch*r.height))return null;this.vm.warnOnce("loadForm(): "+r.bits.length+" !== "+r.pitch+"*"+r.height+"="+r.pitch*r.height)}return r},theDisplay:function(){return this.loadForm(this.vm.specialObjects[Squeak.splOb_TheDisplay])},displayDirty:function(e,t){this.deferDisplayUpdates||e!=this.vm.specialObjects[Squeak.splOb_TheDisplay]||this.displayUpdate(this.theDisplay(),t)},displayUpdate:function(e,t){this.showForm(this.display.context,e,t),this.display.lastTick=this.vm.lastTick,this.display.idle=0},primitiveBeep:function(e){var t=Squeak.startAudioOut();if(t){var r=t.createOscillator();r.connect(t.destination),r.type="square",r.frequency.value=880,r.start(),r.stop(t.currentTime+.05)}else this.vm.warnOnce("could not initialize audio");return this.popNIfOK(e)}}),Object.extend(Squeak,"files",{fsck:function(r,i,a,s){if(i=i||"",s=s||{dirs:0,files:0,bytes:0,deleted:0},!a&&(a={},Object.keys(Squeak.Settings).forEach(function(e){var t=e.match(/squeak-file(\.lz)?:(.*)$/);t&&(a[t[2]]=!0)}),window.SqueakDBFake&&Object.keys(SqueakDBFake.bigFiles).forEach(function(e){a[e]=!0}),"undefined"!=typeof indexedDB))return this.dbTransaction("readonly","fsck cursor",function(e){var t=e.openCursor();t.onsuccess=function(e){var t=e.target.result;t?(a[t.key]=!0,t.continue()):Squeak.fsck(r,i,a,s)},t.onerror=function(e){console.error("fsck failed")}});var e=Squeak.dirList(i);for(var t in e){var n=i+"/"+t;if(e[t][3])"squeak:"+n in Squeak.Settings?(Squeak.fsck(null,n,a,s),s.dirs++):(console.log("Deleting stale directory "+n),Squeak.dirDelete(n),s.deleted++);else a[n]?(a[n]=!1,s.files++,s.bytes+=e[t][4]):(console.log("Deleting stale file entry "+n),Squeak.fileDelete(n,!0),s.deleted++)}if(""===i){console.log("squeak fsck: "+s.dirs+" directories, "+s.files+" files, "+(s.bytes/1e6).toFixed(1)+" MBytes");var o=[];for(var n in a)a[n]&&o.push(n);if(0SqueakDBFake.bigFileThreshold)SqueakDBFake.bigFiles[t]||console.log("File "+t+" ("+e.byteLength+" bytes) too large, storing in memory only"),SqueakDBFake.bigFiles[t]=e;else{var r=Squeak.bytesAsString(new Uint8Array(e));if("object"==typeof LZString){var i=LZString.compressToUTF16(r);Squeak.Settings["squeak-file.lz:"+t]=i,delete Squeak.Settings["squeak-file:"+t]}else Squeak.Settings["squeak-file:"+t]=r}var a={};return setTimeout(function(){a.onsuccess&&a.onsuccess()},0),a},delete:function(e){delete Squeak.Settings["squeak-file:"+e],delete Squeak.Settings["squeak-file.lz:"+e],delete SqueakDBFake.bigFiles[e];var t={};return setTimeout(function(){t.onsuccess&&t.onsuccess()},0),t},openCursor:function(){var e={};return setTimeout(function(){e.onsuccess&&e.onsuccess({target:e})},0),e}}),SqueakDBFake},fileGet:function(e,r,i){i=i||function(e){console.log(e)};var a=this.splitFilePath(e);if(!a.basename)return i("Invalid path: "+e);if(Squeak.debugFiles){console.log("Reading "+a.fullname);var t=r;r=function(e){console.log("Read "+e.byteLength+" bytes from "+a.fullname),t(e)}}if(window.SqueakDBFake&&SqueakDBFake.bigFiles[a.fullname])return r(SqueakDBFake.bigFiles[a.fullname]);this.dbTransaction("readonly","get "+e,function(e){var t=e.get(a.fullname);t.onerror=function(e){i(e.target.error.name)},t.onsuccess=function(e){if(void 0!==this.result)return r(this.result);Squeak.fetchTemplateFile(a.fullname,function(e){r(e)},function(){if("undefined"==typeof indexedDB)return i("file not found: "+a.fullname);var e=Squeak.dbFake().get(a.fullname);e.onerror=function(e){i("file not found: "+a.fullname)},e.onsuccess=function(e){r(this.result)}})}})},filePut:function(e,t,r){var i=this.splitFilePath(e);if(!i.basename)return null;var a=this.dirList(i.dirname);if(!a)return null;var s=a[i.basename],n=this.totalSeconds();if(s){if(s[3])return null}else s=[i.basename,n,0,!1,0],a[i.basename]=s;return Squeak.debugFiles&&(console.log("Writing "+i.fullname+" ("+t.byteLength+" bytes)"),0>Squeak.FFIAtomicTypeShift){case Squeak.FFITypeVoid:return null;case Squeak.FFITypeBool:return!e.isFalse;case Squeak.FFITypeUnsignedInt8:case Squeak.FFITypeSignedInt8:case Squeak.FFITypeUnsignedInt16:case Squeak.FFITypeSignedInt16:case Squeak.FFITypeUnsignedInt32:case Squeak.FFITypeSignedInt32:case Squeak.FFITypeUnsignedInt64:case Squeak.FFITypeSignedInt64:case Squeak.FFITypeUnsignedChar8:case Squeak.FFITypeSignedChar8:case Squeak.FFITypeUnsignedChar16:case Squeak.FFITypeUnsignedChar32:if("number"==typeof e)return e;throw Error("FFI: expected integer, got "+e);case Squeak.FFITypeSingleFloat:case Squeak.FFITypeDoubleFloat:return"number"==typeof e?e:(e.isFloat,e.float);default:throw Error("FFI: unimplemented atomic arg type: "+i)}case Squeak.FFIFlagAtomicPointer:var i;switch(i=(r&Squeak.FFIAtomicTypeMask)>>Squeak.FFIAtomicTypeShift){case Squeak.FFITypeUnsignedChar8:if(e.bytes)return e.bytesAsString();throw Error("FFI: expected string, got "+e);case Squeak.FFITypeUnsignedInt8:if(e.bytes)return e.bytes;if(e.words)return e.wordsAsUint8Array();throw Error("FFI: expected bytes, got "+e);case Squeak.FFITypeUnsignedInt32:if(e.words)return e.words;throw Error("FFI: expected words, got "+e);case Squeak.FFITypeSignedInt32:if(e.words)return e.wordsAsInt32Array();throw Error("FFI: expected words, got "+e);case Squeak.FFITypeSingleFloat:if(e.words)return e.wordsAsFloat32Array();if(e.isFloat)return new Float32Array([e.float]);throw Error("FFI: expected floats, got "+e);case Squeak.FFITypeVoid:if(e.words)return e.words.buffer;if(e.bytes)return e.bytes.buffer;throw Error("FFI: expected words or bytes, got "+e);default:throw Error("FFI: unimplemented atomic array arg type: "+i)}default:throw Error("FFI: unimplemented arg type flags: "+r)}},ffiResultToSt:function(e,t){var r=t.pointers[0].words[0];switch(r&Squeak.FFIFlagMask){case Squeak.FFIFlagAtomic:switch(i=(r&Squeak.FFIAtomicTypeMask)>>Squeak.FFIAtomicTypeShift){case Squeak.FFITypeVoid:return this.vm.nilObj;case Squeak.FFITypeBool:return e?this.vm.trueObj:this.vm.falseObj;case Squeak.FFITypeUnsignedInt8:case Squeak.FFITypeSignedInt8:case Squeak.FFITypeUnsignedInt16:case Squeak.FFITypeSignedInt16:case Squeak.FFITypeUnsignedInt32:case Squeak.FFITypeSignedInt32:case Squeak.FFITypeUnsignedInt64:case Squeak.FFITypeSignedInt64:case Squeak.FFITypeUnsignedChar8:case Squeak.FFITypeSignedChar8:case Squeak.FFITypeUnsignedChar16:case Squeak.FFITypeUnsignedChar32:case Squeak.FFITypeSingleFloat:case Squeak.FFITypeDoubleFloat:if("number"!=typeof e)throw Error("FFI: expected number, got "+e);return this.makeStObject(e);default:throw Error("FFI: unimplemented atomic return type: "+i)}case Squeak.FFIFlagAtomicPointer:var i;switch(i=(r&Squeak.FFIAtomicTypeMask)>>Squeak.FFIAtomicTypeShift){case Squeak.FFITypeSignedChar8:case Squeak.FFITypeUnsignedChar8:return this.makeStString(e);default:return this.makeStExternalData(e,t)}default:throw Error("FFI: unimplemented return type flags: "+r)}},makeStExternalData:function(e,t){var r=this.vm.instantiateClass(this.vm.specialObjects[Squeak.splOb_ClassExternalAddress],4);r.jsData=e;var i=this.vm.instantiateClass(this.vm.specialObjects[Squeak.splOb_ClassExternalData],0);return i.pointers[0]=r,i.pointers[1]=t,i},primitiveCalloutToFFI:function(e,t){var r=t.pointers[1];if(!this.isKindOf(r,Squeak.splOb_ClassExternalFunction))return!1;for(var i=[],a=e-1;0<=a;a--)i.push(this.vm.stackValue(a));return this.calloutToFFI(e,r,i)},ffi_primitiveCalloutWithArgs:function(e){var t=this.stackNonInteger(1),r=this.stackNonInteger(0);return!!this.isKindOf(t,Squeak.splOb_ClassExternalFunction)&&this.calloutToFFI(e,t,r.pointers)},ffi_primitiveFFIGetLastError:function(e){return this.popNandPushIfOK(e+1,this.ffi_lastError)},ffi_primitiveFFIIntegerAt:function(e){var t=this.stackNonInteger(3),r=this.stackInteger(2),i=this.stackInteger(1),a=this.stackBoolean(0);if(!this.success)return!1;if(r<0||i<1||8=t.file.size)),!0)},primitiveFileClose:function(e){var t=this.stackNonInteger(0);return!(!this.success||!t.file)&&("string"==typeof t.file?this.fileConsoleFlush(t.file):(this.fileClose(t.file),this.vm.breakOut(),t.file=null),this.popNIfOK(e))},primitiveFileDelete:function(e){var t=this.stackNonInteger(0);if(!this.success)return!1;var r=this.filenameFromSqueak(t.bytesAsString());return this.success=Squeak.fileDelete(r),this.popNIfOK(e)},primitiveFileFlush:function(e){var t=this.stackNonInteger(0);return!(!this.success||!t.file)&&("string"==typeof t.file?this.fileConsoleFlush(t.file):(Squeak.flushFile(t.file),this.vm.breakOut()),this.popNIfOK(e))},primitiveFileGetPosition:function(e){var t=this.stackNonInteger(0);return!(!this.success||!t.file)&&(this.popNandPushIfOK(e+1,this.makeLargeIfNeeded(t.filePos)),!0)},makeFileHandle:function(e,t,r){var i=this.makeStString("squeakjs:"+e);return i.file=t,i.fileWrite=r,i.filePos=0,i},primitiveFileOpen:function(e){var t=this.stackBoolean(0),r=this.stackNonInteger(1);if(!this.success)return!1;var i=this.filenameFromSqueak(r.bytesAsString()),a=this.fileOpen(i,t);if(!a)return!1;var s=this.makeFileHandle(a.name,a,t);return this.popNandPushIfOK(e+1,s),!0},primitiveFileRead:function(a){var s=this.stackInteger(0),n=this.stackInteger(1)-1,e=this.stackNonInteger(2),o=this.stackNonInteger(3);if(!this.success||!e.isWordsOrBytes()||!o.file)return!1;if(!s)return this.popNandPushIfOK(a+1,0);var u=e.bytes;return u||(u=e.wordsAsUint8Array(),n*=4,s*=4),!(n<0||n+s>u.length)&&("string"==typeof o.file?(this.popNandPushIfOK(a+1,0),!0):this.fileContentsDo(o.file,function(e){if(!e.contents)return this.popNandPushIfOK(a+1,0);var t=e.contents,r=u;s=Math.min(s,e.size-o.filePos);for(var i=0;it&&(r.file.size=t,r.file.modified=!0,r.filePos>r.file.size&&(r.filePos=r.file.size)),this.popNIfOK(e))},primitiveDisableFileAccess:function(e){return this.fakePrimitive("FilePlugin.primitiveDisableFileAccess",0,e)},primitiveFileWrite:function(s){var n=this.stackInteger(0),o=this.stackInteger(1)-1,e=this.stackNonInteger(2),u=this.stackNonInteger(3);if(!this.success||!u.file||!u.fileWrite)return!1;if(!n)return this.popNandPushIfOK(s+1,0);var l=e.bytes;return l||(l=e.wordsAsUint8Array(),o*=4,n*=4),!!l&&(!(o<0||o+n>l.length)&&("string"==typeof u.file?(this.fileConsoleWrite(u.file,l,o,n),this.popNandPushIfOK(s+1,n),!0):this.fileContentsDo(u.file,function(e){var t=l,r=e.contents||[];if(u.filePos+n>r.length){var i=0===r.length?u.filePos+n:Math.max(u.filePos+n,r.length+1e4);e.contents=new Uint8Array(i),e.contents.set(r),r=e.contents}for(var a=0;ae.size&&(e.size=u.filePos),e.modified=!0,this.popNandPushIfOK(s+1,n)}.bind(this))))},fileOpen:function(e,t){"undefined"==typeof SqueakFiles&&(window.SqueakFiles={});var r=Squeak.splitFilePath(e);if(!r.basename)return null;var i=Squeak.dirList(r.dirname,!0);if(!i)return null;var a=i[r.basename],s=null;if(a){if(n=SqueakFiles[r.fullname])return++n.refCount,n}else{if(!t)return console.log("File not found: "+r.fullname),null;if(s=new Uint8Array,!(a=Squeak.filePut(r.fullname,s.buffer)))return console.log("Cannot create file: "+r.fullname),null}var n={name:r.fullname,size:a[4],contents:s,modified:!1,refCount:1};return SqueakFiles[n.name]=n},fileClose:function(e){Squeak.flushFile(e),0==--e.refCount&&delete SqueakFiles[e.name]},fileContentsDo:function(i,a){if(i.contents)a(i);else{if(!1===i.contents)return!1;this.vm.freeze(function(t){var r=function(e){console.log("File get failed: "+e),i.contents=!1,t(),a(i)}.bind(this),e=function(e){if(null==e)return r(i.name);i.contents=this.asUint8Array(e),t(),a(i)}.bind(this);Squeak.fileGet(i.name,e,r)}.bind(this))}return!0},fileConsoleBuffer:{log:"",error:""},fileConsoleWrite:function(e,t,r,i){var a=t.subarray(r,r+i),s=this.fileConsoleBuffer[e]+Squeak.bytesAsString(a),n=s.match("([^]*)\n(.*)");n&&(console[e](n[1]),s=n[2]),this.fileConsoleBuffer[e]=s},fileConsoleFlush:function(e){var t=this.fileConsoleBuffer[e];t&&(console[e](t),this.fileConsoleBuffer[e]="")}}),Object.extend(Squeak.Primitives.prototype,"JPEGReadWriter2Plugin",{jpeg2_primJPEGPluginIsPresent:function(e){return this.popNandPushIfOK(e+1,this.vm.trueObj)},jpeg2_primImageHeight:function(e){var t=this.stackNonInteger(0).wordsOrBytes();if(!t)return!1;var r=t[1];return this.popNandPushIfOK(e+1,r)},jpeg2_primImageWidth:function(e){var t=this.stackNonInteger(0).wordsOrBytes();if(!t)return!1;var r=t[0];return this.popNandPushIfOK(e+1,r)},jpeg2_primJPEGCompressStructSize:function(e){return this.popNandPushIfOK(e+1,0)},jpeg2_primJPEGDecompressStructSize:function(e){return this.popNandPushIfOK(e+1,8)},jpeg2_primJPEGErrorMgr2StructSize:function(e){return this.popNandPushIfOK(e+1,0)},jpeg2_primJPEGReadHeaderfromByteArrayerrorMgr:function(e){var t=this.stackNonInteger(2).wordsOrBytes(),r=this.stackNonInteger(1).bytes;if(!t||!r)return!1;var i=this.vm.freeze();return this.jpeg2_readImageFromBytes(r,function(e){this.jpeg2state={src:r,img:e},t[0]=e.width,t[1]=e.height,i()}.bind(this),function(){t[0]=0,t[1]=0,i()}.bind(this)),this.popNIfOK(e)},jpeg2_primJPEGReadImagefromByteArrayonFormdoDitheringerrorMgr:function(e){var t=this.stackNonInteger(3).bytes,r=this.stackNonInteger(2).pointers,i=this.stackBoolean(1);if(!this.success||!t||!r)return!1;var a=this.jpeg2state;if(!a||a.src!==t)return console.error("jpeg read did not match header info"),!1;var s=r[Squeak.Form_depth],n=this.jpeg2_getPixelsFromImage(a.img),o=r[Squeak.Form_bits].words;if(32===s)this.jpeg2_copyPixelsToForm32(n,o);else{if(16!==s)return!1;i?this.jpeg2_ditherPixelsToForm16(n,o):this.jpeg2_copyPixelsToForm16(n,o)}return this.popNIfOK(e)},jpeg2_primJPEGWriteImageonByteArrayformqualityprogressiveJPEGerrorMgr:function(e){return this.vm.warnOnce("JPEGReadWritePlugin2: writing not implemented yet"),!1},jpeg2_readImageFromBytes:function(e,t,r){var i=new Blob([e],{type:"image/jpeg"}),a=new Image;a.onload=function(){t(a)},a.onerror=function(){console.warn("could not render JPEG"),r()},a.src=(window.URL||window.webkitURL).createObjectURL(i)},jpeg2_getPixelsFromImage:function(e){var t=document.createElement("canvas"),r=t.getContext("2d");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height)},jpeg2_copyPixelsToForm32:function(e,t){for(var r=e.data,i=0;i>3<<10|a[4*o+1]>>3<<5|a[4*o+2]>>3;0===u&&(u=1),0==(65535&(u=u<<16|a[4*o+4]>>3<<10|a[4*o+5]>>3<<5|a[4*o+6]>>3))&&(u|=1),t[o>>1]=u}},jpeg2_ditherPixelsToForm16:function(e,t){for(var r=e.width>>1,i=e.height,a=e.data,s=[2,0,14,12,1,3,13,15],n=[10,8,6,4,9,11,5,7],o=0;o>8)>>4,f=k<(15&l)?c+1:c,c=(l=496*p>>8)>>4,p=k<(15&l)?c+1:c,c=(l=496*d>>8)>>4,d=k<(15&l)?c+1:c,c=(l=496*b>>8)>>4,b=S<(15&l)?c+1:c,c=(l=496*m>>8)>>4,m=S<(15&l)?c+1:c,c=(l=496*v>>8)>>4;var _=f<<10|p<<5|d;0===_&&(_=1),0==(65535&(_=_<<16|b<<10|m<<5|(v=S<(15&l)?c+1:c)))&&(_|=1),t[h>>3]=_}}}),Object.extend(Squeak.Primitives.prototype,"ScratchPluginAdditions",{scratch_primitiveOpenURL:function(e){var t=this.stackNonInteger(0).bytesAsString();if(""==t)return!1;if(/^\/SqueakJS\//.test(t)){t=t.slice(10);var r=Squeak.splitFilePath(t),i=Squeak.Settings["squeak-template:"+r.dirname];i&&(t=JSON.parse(i).url+"/"+r.basename)}return window.open(t,"_blank"),this.popNIfOK(e)},scratch_primitiveGetFolderPath:function(e){var t,r=this.stackInteger(0);if(!this.success)return!1;switch(r){case 1:t="/"}return!!t&&(this.vm.popNandPush(e+1,this.makeStString(this.filenameToSqueak(t))),!0)}}),Object.extend(Squeak.Primitives.prototype,"SoundPlugin",{snd_primitiveSoundStart:function(e){return this.snd_primitiveSoundStartWithSemaphore(e)},snd_primitiveSoundStartWithSemaphore:function(e){var t=this.stackInteger(e-1),r=this.stackInteger(e-2),i=this.stackBoolean(e-3),a=3>8,r=255&e.charCodeAt(l/2),i=l/2+1>8:NaN):(t=255&e.charCodeAt((l-1)/2),(l+1)/2>8,i=255&e.charCodeAt((l+1)/2)):r=i=NaN),l+=3,a=t>>2,s=(3&t)<<4|r>>4,n=(15&r)<<2|i>>6,o=63&i,isNaN(r)?n=o=64:isNaN(i)&&(o=64),u=u+LZString$1._keyStr.charAt(a)+LZString$1._keyStr.charAt(s)+LZString$1._keyStr.charAt(n)+LZString$1._keyStr.charAt(o);return u},decompressFromBase64:function(e){if(null==e)return"";var t,r,i,a,s,n,o,u="",l=0,c=0,h=LZString$1._f;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");c>4,i=(15&s)<<4|(n=LZString$1._keyStr.indexOf(e.charAt(c++)))>>2,a=(3&n)<<6|(o=LZString$1._keyStr.indexOf(e.charAt(c++))),l%2==0?(t=r<<8,64!=n&&(u+=h(t|i)),64!=o&&(t=a<<8)):(u+=h(t|r),64!=n&&(t=i<<8),64!=o&&(u+=h(t|a))),l+=3;return LZString$1.decompress(u)},compressToUTF16:function(e){if(null==e)return"";var t,r,i,a="",s=0,n=LZString$1._f;for(e=LZString$1.compress(e),t=0;t>1)),i=(1&r)<<14;break;case 1:a+=n(i+(r>>2)+32),i=(3&r)<<13;break;case 2:a+=n(i+(r>>3)+32),i=(7&r)<<12;break;case 3:a+=n(i+(r>>4)+32),i=(15&r)<<11;break;case 4:a+=n(i+(r>>5)+32),i=(31&r)<<10;break;case 5:a+=n(i+(r>>6)+32),i=(63&r)<<9;break;case 6:a+=n(i+(r>>7)+32),i=(127&r)<<8;break;case 7:a+=n(i+(r>>8)+32),i=(255&r)<<7;break;case 8:a+=n(i+(r>>9)+32),i=(511&r)<<6;break;case 9:a+=n(i+(r>>10)+32),i=(1023&r)<<5;break;case 10:a+=n(i+(r>>11)+32),i=(2047&r)<<4;break;case 11:a+=n(i+(r>>12)+32),i=(4095&r)<<3;break;case 12:a+=n(i+(r>>13)+32),i=(8191&r)<<2;break;case 13:a+=n(i+(r>>14)+32),i=(16383&r)<<1;break;case 14:a+=n(i+(r>>15)+32,32+(32767&r)),s=0}return a+n(i+32)},decompressFromUTF16:function(e){if(null==e)return"";for(var t,r,i="",a=0,s=0,n=LZString$1._f;s>14),t=(16383&r)<<2;break;case 2:i+=n(t|r>>13),t=(8191&r)<<3;break;case 3:i+=n(t|r>>12),t=(4095&r)<<4;break;case 4:i+=n(t|r>>11),t=(2047&r)<<5;break;case 5:i+=n(t|r>>10),t=(1023&r)<<6;break;case 6:i+=n(t|r>>9),t=(511&r)<<7;break;case 7:i+=n(t|r>>8),t=(255&r)<<8;break;case 8:i+=n(t|r>>7),t=(127&r)<<9;break;case 9:i+=n(t|r>>6),t=(63&r)<<10;break;case 10:i+=n(t|r>>5),t=(31&r)<<11;break;case 11:i+=n(t|r>>4),t=(15&r)<<12;break;case 12:i+=n(t|r>>3),t=(7&r)<<13;break;case 13:i+=n(t|r>>2),t=(3&r)<<14;break;case 14:i+=n(t|r>>1),t=(1&r)<<15;break;case 15:i+=n(t|r),a=0}s++}return LZString$1.decompress(i)},compress:function(e){if(null==e)return"";var t,r,i,a={},s={},n="",o="",u="",l=2,c=3,h=2,f="",p=0,d=0,b=LZString$1._f;for(i=0;i>=1}else{for(r=1,t=0;t>=1}0==--l&&(l=Math.pow(2,h),h++),delete s[u]}else for(r=a[u],t=0;t>=1;0==--l&&(l=Math.pow(2,h),h++),a[o]=c++,u=String(n)}if(""!==u){if(Object.prototype.hasOwnProperty.call(s,u)){if(u.charCodeAt(0)<256){for(t=0;t>=1}else{for(r=1,t=0;t>=1}0==--l&&(l=Math.pow(2,h),h++),delete s[u]}else for(r=a[u],t=0;t>=1;0==--l&&(l=Math.pow(2,h),h++)}for(r=2,t=0;t>=1;for(;;){if(p<<=1,15==d){f+=b(p);break}d++}return f},decompress:function(e){if(null==e)return"";if(""==e)return null;var t,r,i,a,s,n,o,u=[],l=4,c=4,h=3,f="",p="",d=LZString$1._f,b={string:e,val:e.charCodeAt(0),position:32768,index:1};for(t=0;t<3;t+=1)u[t]=t;for(i=0,s=Math.pow(2,2),n=1;n!=s;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=32768,b.val=b.string.charCodeAt(b.index++)),i|=(0>=1,0==b.position&&(b.position=32768,b.val=b.string.charCodeAt(b.index++)),i|=(0>=1,0==b.position&&(b.position=32768,b.val=b.string.charCodeAt(b.index++)),i|=(0b.string.length)return"";for(i=0,s=Math.pow(2,h),n=1;n!=s;)a=b.val&b.position,b.position>>=1,0==b.position&&(b.position=32768,b.val=b.string.charCodeAt(b.index++)),i|=(0>=1,0==b.position&&(b.position=32768,b.val=b.string.charCodeAt(b.index++)),i|=(0>=1,0==b.position&&(b.position=32768,b.val=b.string.charCodeAt(b.index++)),i|=(0>2,s=(3&t)<<4|r>>4,n=1>6:64,o=2>4,r=(15&a)<<4|(s=d.indexOf(e.charAt(u++)))>>2,i=(3&s)<<6|(n=d.indexOf(e.charAt(u++))),o[l++]=t,64!==s&&(o[l++]=r),64!==n&&(o[l++]=i);return o}},{"./support":27,"./utils":29}],2:[function(e,t,r){var i=e("./external"),a=e("./stream/DataWorker"),s=e("./stream/DataLengthProbe"),n=e("./stream/Crc32Probe");s=e("./stream/DataLengthProbe");function o(e,t,r,i,a){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=i,this.compressedContent=a}o.prototype={getContentWorker:function(){var e=new a(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new s("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new a(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},o.createWorkerFrom=function(e,t,r){return e.pipe(new n).pipe(new s("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new s("compressedSize")).withStreamInfo("compression",t)},t.exports=o},{"./external":6,"./stream/Crc32Probe":22,"./stream/DataLengthProbe":23,"./stream/DataWorker":24}],3:[function(e,t,r){var i=e("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(e){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},r.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":25}],4:[function(e,t,r){var i=e("./utils");var o=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?("string"!==i.getTypeOf(e)?function(e,t,r,i){var a=o,s=i+r;e^=-1;for(var n=i;n>>8^a[255&(e^t[n])];return-1^e}:function(e,t,r,i){var a=o,s=i+r;e^=-1;for(var n=i;n>>8^a[255&(e^t.charCodeAt(n))];return-1^e})(0|t,e,e.length,0):0}},{"./utils":29}],5:[function(e,t,r){r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(e,t,r){var i=e("es6-promise").Promise;t.exports={Promise:i}},{"es6-promise":37}],7:[function(e,t,r){var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,a=e("pako"),s=e("./utils"),n=e("./stream/GenericWorker"),o=i?"uint8array":"array";function u(e,t){n.call(this,"FlateWorker/"+e),this._pako=new a[e]({raw:!0,level:t.level||-1}),this.meta={};var r=this;this._pako.onData=function(e){r.push({data:e,meta:r.meta})}}r.magic="\b\0",s.inherits(u,n),u.prototype.processChunk=function(e){this.meta=e.meta,this._pako.push(s.transformTo(o,e.data),!1)},u.prototype.flush=function(){n.prototype.flush.call(this),this._pako.push([],!0)},u.prototype.cleanUp=function(){n.prototype.cleanUp.call(this),this._pako=null},r.compressWorker=function(e){return new u("Deflate",e)},r.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":25,"./utils":29,pako:38}],8:[function(e,t,r){function V(e,t){var r,i="";for(r=0;r>>=8;return i}function i(e,t,r,i,a,s){var n,o,u=e.file,l=e.compression,c=s!==j.utf8encode,h=M.transformTo("string",s(u.name)),f=M.transformTo("string",j.utf8encode(u.name)),p=u.comment,d=M.transformTo("string",s(p)),b=M.transformTo("string",j.utf8encode(p)),m=f.length!==u.name.length,v=b.length!==p.length,g="",k="",S="",_=u.dir,y=u.date,O={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(O.crc32=e.crc32,O.compressedSize=e.compressedSize,O.uncompressedSize=e.uncompressedSize);var I=0;t&&(I|=8),c||!m&&!v||(I|=2048);var F,w,C,A=0,x=0;_&&(A|=16),"UNIX"===a?(x=798,A|=(F=u.unixPermissions,w=_,(C=F)||(C=w?16893:33204),(65535&C)<<16)):(x=20,A|=63&(u.dosPermissions||0)),n=y.getUTCHours(),n<<=6,n|=y.getUTCMinutes(),n<<=5,n|=y.getUTCSeconds()/2,o=y.getUTCFullYear()-1980,o<<=4,o|=y.getUTCMonth()+1,o<<=5,o|=y.getUTCDate(),m&&(k=V(1,1)+V(R(h),4)+f,g+="up"+V(k.length,2)+k),v&&(S=V(1,1)+V(R(d),4)+b,g+="uc"+V(S.length,2)+S);var P="";return P+="\n\0",P+=V(I,2),P+=l.magic,P+=V(n,2),P+=V(o,2),P+=V(O.crc32,4),P+=V(O.compressedSize,4),P+=V(O.uncompressedSize,4),P+=V(h.length,2),P+=V(g.length,2),{fileRecord:Y.LOCAL_FILE_HEADER+P+h+g,dirRecord:Y.CENTRAL_FILE_HEADER+V(x,2)+P+V(d.length,2)+"\0\0\0\0"+V(A,4)+V(i,4)+h+g+d}}var M=e("../utils"),a=e("../stream/GenericWorker"),j=e("../utf8"),R=e("../crc32"),Y=e("../signature");function s(e,t,r,i){a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=i,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}M.inherits(s,a),s.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,a.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-i-1))/r:100}}))},s.prototype.openedSource=function(e){if(this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name,this.streamFiles&&!e.file.dir){var t=i(e,this.streamFiles,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:t.fileRecord,meta:{percent:0}})}else this.accumulate=!0},s.prototype.closedSource=function(e){this.accumulate=!1;var t,r=i(e,this.streamFiles,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),this.streamFiles&&!e.file.dir)this.push({data:(t=e,Y.DATA_DESCRIPTOR+V(t.crc32,4)+V(t.compressedSize,4)+V(t.uncompressedSize,4)),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},s.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return i.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=a},{"../utils":29}],16:[function(e,t,r){var i=e("./Uint8ArrayReader");function a(e){i.call(this,e)}e("../utils").inherits(a,i),a.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=a},{"../utils":29,"./Uint8ArrayReader":18}],17:[function(e,t,r){var i=e("./DataReader");function a(e){i.call(this,e)}e("../utils").inherits(a,i),a.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},a.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},a.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},a.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=a},{"../utils":29,"./DataReader":15}],18:[function(e,t,r){var i=e("./ArrayReader");function a(e){i.call(this,e)}e("../utils").inherits(a,i),a.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=a},{"../utils":29,"./ArrayReader":14}],19:[function(e,t,r){var i=e("../utils"),a=e("../support"),s=e("./ArrayReader"),n=e("./StringReader"),o=e("./NodeBufferReader"),u=e("./Uint8ArrayReader");t.exports=function(e){var t=i.getTypeOf(e);return i.checkSupport(t),"string"!==t||a.uint8array?"nodebuffer"===t?new o(e):a.uint8array?new u(i.transformTo("uint8array",e)):new s(i.transformTo("array",e)):new n(e)}},{"../support":27,"../utils":29,"./ArrayReader":14,"./NodeBufferReader":16,"./StringReader":17,"./Uint8ArrayReader":18}],20:[function(e,t,r){r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b"},{}],21:[function(e,t,r){var i=e("./GenericWorker"),a=e("../utils");function s(e){i.call(this,"ConvertWorker to "+e),this.destType=e}a.inherits(s,i),s.prototype.processChunk=function(e){this.push({data:a.transformTo(this.destType,e.data),meta:e.meta})},t.exports=s},{"../utils":29,"./GenericWorker":25}],22:[function(e,t,r){var i=e("./GenericWorker"),a=e("../crc32");function s(){i.call(this,"Crc32Probe")}e("../utils").inherits(s,i),s.prototype.processChunk=function(e){this.streamInfo.crc32=a(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=s},{"../crc32":4,"../utils":29,"./GenericWorker":25}],23:[function(e,t,r){var i=e("../utils"),a=e("./GenericWorker");function s(e){a.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}i.inherits(s,a),s.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}a.prototype.processChunk.call(this,e)},t.exports=s},{"../utils":29,"./GenericWorker":25}],24:[function(e,t,r){var i=e("../utils"),a=e("./GenericWorker");function s(e){a.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=i.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}i.inherits(s,a),s.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=s},{"../utils":29,"./GenericWorker":25}],25:[function(e,t,r){function i(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}i.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r "+e:e}},t.exports=i},{}],26:[function(n,o,e){(function(u){var l=n("../utils"),a=n("./ConvertWorker"),s=n("./GenericWorker"),c=n("../base64"),t=n("../nodejs/NodejsStreamOutputAdapter"),r=n("../external");function i(e,o){return new r.Promise(function(t,r){var i=[],a=e._internalType,s=e._outputType,n=e._mimeType;e.on("data",function(e,t){i.push(e),o&&o(t)}).on("error",function(e){i=[],r(e)}).on("end",function(){try{var e=function(e,t,r){switch(e){case"blob":return l.newBlob(l.transformTo("arraybuffer",t),r);case"base64":return c.encode(t);default:return l.transformTo(e,t)}}(s,function(e,t){var r,i=0,a=null,s=0;for(r=0;r>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t}(e)},s.utf8decode=function(e){return u.nodebuffer?o.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,r,i,a,s=e.length,n=new Array(2*s);for(t=r=0;t>10&1023,n[r++]=56320|1023&i)}return n.length!==r&&(n.subarray?n=n.subarray(0,r):n.length=r),o.applyFromCharCode(n)}(e=o.transformTo(u.uint8array?"uint8array":"array",e))},o.inherits(n,i),n.prototype.processChunk=function(e){var t=o.transformTo(u.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(u.uint8array){var r=t;(t=new Uint8Array(r.length+this.leftOver.length)).set(this.leftOver,0),t.set(r,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var i=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return!(r<0)&&0!==r&&r+l[e[r]]>t?r:t}(t),a=t;i!==t.length&&(u.uint8array?(a=t.subarray(0,i),this.leftOver=t.subarray(i,t.length)):(a=t.slice(0,i),this.leftOver=t.slice(i,t.length))),this.push({data:s.utf8decode(a),meta:e.meta})},n.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=n,o.inherits(c,i),c.prototype.processChunk=function(e){this.push({data:s.utf8encode(e.data),meta:e.meta})},s.Utf8EncodeWorker=c},{"./nodejsUtils":12,"./stream/GenericWorker":25,"./support":27,"./utils":29}],29:[function(e,t,u){var l=e("./support"),c=e("./base64"),r=e("./nodejsUtils"),i=e("asap"),h=e("./external");function a(e){return e}function f(e,t){for(var r=0;r>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var t=i(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(e){var t,r,i,a=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t},r.buf2binstring=function(e){return c(e,e.length)},r.binstring2buf=function(e){for(var t=new u.Buf8(e.length),r=0,i=t.length;r>10&1023,o[i++]=56320|1023&a)}return c(o,i)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return!(r<0)&&0!==r&&r+l[e[r]]>t?r:t}},{"./common":41}],43:[function(e,t,r){t.exports=function(e,t,r,i){for(var a=65535&e|0,s=e>>>16&65535|0,n=0;0!==r;){for(r-=n=2e3>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var a=o,s=i+r;e^=-1;for(var n=i;n>>8^a[255&(e^t[n])];return-1^e}},{}],46:[function(e,t,r){var u,f=e("../utils/common"),l=e("./trees"),p=e("./adler32"),d=e("./crc32"),i=e("./messages"),c=0,h=4,b=0,m=-2,v=-1,g=4,a=2,k=8,S=9,s=286,n=30,o=19,_=2*s+1,y=15,O=3,I=258,F=I+O+1,w=42,C=113,A=1,x=2,P=3,V=4;function M(e,t){return e.msg=i[t],t}function j(e){return(e<<1)-(4e.avail_out&&(r=e.avail_out),0!==r&&(f.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function q(e,t){l._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Y(e.strm)}function N(e,t){e.pending_buf[e.pending++]=t}function W(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function B(e,t){var r,i,a=e.max_chain_length,s=e.strstart,n=e.prev_length,o=e.nice_match,u=e.strstart>e.w_size-F?e.strstart-(e.w_size-F):0,l=e.window,c=e.w_mask,h=e.prev,f=e.strstart+I,p=l[s+n-1],d=l[s+n];e.prev_length>=e.good_match&&(a>>=2),o>e.lookahead&&(o=e.lookahead);do{if(l[(r=t)+n]===d&&l[r+n-1]===p&&l[r]===l[s]&&l[++r]===l[s+1]){s+=2,r++;do{}while(l[++s]===l[++r]&&l[++s]===l[++r]&&l[++s]===l[++r]&&l[++s]===l[++r]&&l[++s]===l[++r]&&l[++s]===l[++r]&&l[++s]===l[++r]&&l[++s]===l[++r]&&su&&0!=--a);return n<=e.lookahead?n:e.lookahead}function E(e){var t,r,i,a,s,n,o,u,l,c,h=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=h+(h-F)){for(f.arraySet(e.window,e.window,h,h,0),e.match_start-=h,e.strstart-=h,e.block_start-=h,t=r=e.hash_size;i=e.head[--t],e.head[t]=h<=i?i-h:0,--r;);for(t=r=h;i=e.prev[--t],e.prev[t]=h<=i?i-h:0,--r;);a+=h}if(0===e.strm.avail_in)break;if(n=e.strm,o=e.window,u=e.strstart+e.lookahead,l=a,c=void 0,c=n.avail_in,l=O)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<=O&&(e.ins_h=(e.ins_h<=O)if(i=l._tr_tally(e,e.strstart-e.match_start,e.match_length-O),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=O){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=O&&(e.ins_h=(e.ins_h<=O&&e.match_length<=e.prev_length){for(a=e.strstart+e.lookahead-O,i=l._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-O),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=a&&(e.ins_h=(e.ins_h<>1,o.l_buf=3*o.lit_bufsize,o.level=t,o.strategy=s,o.method=r,z(e)}u=[new D(0,0,0,0,function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(E(e),0===e.lookahead&&t===c)return A;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+r;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,q(e,!1),0===e.strm.avail_out))return A;if(e.strstart-e.block_start>=e.w_size-F&&(q(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===h?(q(e,!0),0===e.strm.avail_out?P:V):(e.strstart>e.block_start&&(q(e,!1),e.strm.avail_out),A)}),new D(4,4,8,4,L),new D(4,5,16,8,L),new D(4,6,32,32,L),new D(4,4,16,16,T),new D(8,16,32,32,T),new D(8,16,128,128,T),new D(8,32,128,256,T),new D(32,128,258,1024,T),new D(32,258,258,4096,T)],r.deflateInit=function(e,t){return K(e,t,k,15,8,0)},r.deflateInit2=K,r.deflateReset=z,r.deflateResetKeep=U,r.deflateSetHeader=function(e,t){return!e||!e.state||2!==e.state.wrap?m:(e.state.gzhead=t,b)},r.deflate=function(e,t){var r,i,a,s;if(!e||!e.state||5>8&255),N(i,i.gzhead.time>>16&255),N(i,i.gzhead.time>>24&255),N(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),N(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(N(i,255&i.gzhead.extra.length),N(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=d(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(N(i,0),N(i,0),N(i,0),N(i,0),N(i,0),N(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),N(i,3),i.status=C);else{var n=k+(i.w_bits-8<<4)<<8;n|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(n|=32),n+=31-n%31,i.status=C,W(i,n),0!==i.strstart&&(W(i,e.adler>>>16),W(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(e.adler=d(e.adler,i.pending_buf,i.pending-a,a)),Y(e),a=i.pending,i.pending!==i.pending_buf_size));)N(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(e.adler=d(e.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=d(e.adler,i.pending_buf,i.pending-a,a)),Y(e),a=i.pending,i.pending===i.pending_buf_size)){s=1;break}s=i.gzindexa&&(e.adler=d(e.adler,i.pending_buf,i.pending-a,a)),0===s&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=d(e.adler,i.pending_buf,i.pending-a,a)),Y(e),a=i.pending,i.pending===i.pending_buf_size)){s=1;break}s=i.gzindexa&&(e.adler=d(e.adler,i.pending_buf,i.pending-a,a)),0===s&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&Y(e),i.pending+2<=i.pending_buf_size&&(N(i,255&e.adler),N(i,e.adler>>8&255),e.adler=0,i.status=C)):i.status=C),0!==i.pending){if(Y(e),0===e.avail_out)return i.last_flush=-1,b}else if(0===e.avail_in&&j(t)<=j(r)&&t!==h)return M(e,-5);if(666===i.status&&0!==e.avail_in)return M(e,-5);if(0!==e.avail_in||0!==i.lookahead||t!==c&&666!==i.status){var o=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(E(e),0===e.lookahead)){if(t===c)return A;break}if(e.match_length=0,r=l._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(q(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===h?(q(e,!0),0===e.strm.avail_out?P:V):e.last_lit&&(q(e,!1),0===e.strm.avail_out)?A:x}(i,t):3===i.strategy?function(e,t){for(var r,i,a,s,n=e.window;;){if(e.lookahead<=I){if(E(e),e.lookahead<=I&&t===c)return A;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=O&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=O?(r=l._tr_tally(e,1,e.match_length-O),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=l._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(q(e,!1),0===e.strm.avail_out))return A}return e.insert=0,t===h?(q(e,!0),0===e.strm.avail_out?P:V):e.last_lit&&(q(e,!1),0===e.strm.avail_out)?A:x}(i,t):u[i.level].func(i,t);if(o!==P&&o!==V||(i.status=666),o===A||o===P)return 0===e.avail_out&&(i.last_flush=-1),b;if(o===x&&(1===t?l._tr_align(i):5!==t&&(l._tr_stored_block(i,0,0,!1),3===t&&(R(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),Y(e),0===e.avail_out))return i.last_flush=-1,b}return t!==h?b:i.wrap<=0?1:(2===i.wrap?(N(i,255&e.adler),N(i,e.adler>>8&255),N(i,e.adler>>16&255),N(i,e.adler>>24&255),N(i,255&e.total_in),N(i,e.total_in>>8&255),N(i,e.total_in>>16&255),N(i,e.total_in>>24&255)):(W(i,e.adler>>>16),W(i,65535&e.adler)),Y(e),0=r.w_size&&(0===s&&(R(r.head),r.strstart=0,r.block_start=0,r.insert=0),l=new f.Buf8(r.w_size),f.arraySet(l,t,c-r.w_size,r.w_size,0),t=l,c=r.w_size),n=e.avail_in,o=e.next_in,u=e.input,e.avail_in=c,e.next_in=0,e.input=t,E(r);r.lookahead>=O;){for(i=r.strstart,a=r.lookahead-(O-1);r.ins_h=(r.ins_h<>>=S=k>>>24,d-=S,0===(S=k>>>16&255))w[s++]=65535&k;else{if(!(16&S)){if(0==(64&S)){k=b[(65535&k)+(p&(1<>>=S,d-=S),d<15&&(p+=F[i++]<>>=S=k>>>24,d-=S,!(16&(S=k>>>16&255))){if(0==(64&S)){k=m[(65535&k)+(p&(1<>>=S,d-=S,(S=s-n)>3,p&=(1<<(d-=_<<3))-1,e.next_in=i,e.next_out=s,e.avail_in=i>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function s(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new x.Buf16(320),this.work=new x.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function n(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=W,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new x.Buf32(i),t.distcode=t.distdyn=new x.Buf32(a),t.sane=1,t.back=-1,q):N}function o(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,n(e)):N}function u(e,t){var r,i;return e&&e.state?(i=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=s.wsize?(x.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(i<(a=s.wsize-s.wnext)&&(a=i),x.arraySet(s.window,t,r-i,a,s.wnext),(i-=a)?(x.arraySet(s.window,t,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=a,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=V(r.check,C,2,0),c=l=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&l)){e.msg="unknown compression method",r.mode=30;break}if(c-=4,y=8+(15&(l>>>=4)),0===r.wbits)r.wbits=y;else if(y>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(C[0]=255&l,C[1]=l>>>8&255,r.check=V(r.check,C,2,0)),c=l=0,r.mode=3;case 3:for(;c<32;){if(0===o)break e;o--,l+=i[s++]<>>8&255,C[2]=l>>>16&255,C[3]=l>>>24&255,r.check=V(r.check,C,4,0)),c=l=0,r.mode=4;case 4:for(;c<16;){if(0===o)break e;o--,l+=i[s++]<>8),512&r.flags&&(C[0]=255&l,C[1]=l>>>8&255,r.check=V(r.check,C,2,0)),c=l=0,r.mode=5;case 5:if(1024&r.flags){for(;c<16;){if(0===o)break e;o--,l+=i[s++]<>>8&255,r.check=V(r.check,C,2,0)),c=l=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(o<(p=r.length)&&(p=o),p&&(r.head&&(y=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),x.arraySet(r.head.extra,i,s,p,y)),512&r.flags&&(r.check=V(r.check,i,p,s)),o-=p,s+=p,r.length-=p),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===o)break e;for(p=0;y=i[s+p++],r.head&&y&&r.length<65536&&(r.head.name+=String.fromCharCode(y)),y&&p>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;c<32;){if(0===o)break e;o--,l+=i[s++]<>>=7&c,c-=7&c,r.mode=27;break}for(;c<3;){if(0===o)break e;o--,l+=i[s++]<>>=1)){case 0:r.mode=14;break;case 1:if(E(r),r.mode=20,6!==t)break;l>>>=2,c-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}l>>>=2,c-=2;break;case 14:for(l>>>=7&c,c-=7&c;c<32;){if(0===o)break e;o--,l+=i[s++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&l,c=l=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(p=r.length){if(o>>=5,c-=5,r.ndist=1+(31&l),l>>>=5,c-=5,r.ncode=4+(15&l),l>>>=4,c-=4,286>>=3,c-=3}for(;r.have<19;)r.lens[A[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,I={bits:r.lenbits},O=j(0,r.lens,0,19,r.lencode,0,r.work,I),r.lenbits=I.bits,O){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,g=65535&w,!((m=w>>>24)<=c);){if(0===o)break e;o--,l+=i[s++]<>>=m,c-=m,r.lens[r.have++]=g;else{if(16===g){for(F=m+2;c>>=m,c-=m,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}y=r.lens[r.have-1],p=3+(3&l),l>>>=2,c-=2}else if(17===g){for(F=m+3;c>>=m)),l>>>=3,c-=3}else{for(F=m+7;c>>=m)),l>>>=7,c-=7}if(r.have+p>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;p--;)r.lens[r.have++]=y}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,I={bits:r.lenbits},O=j(R,r.lens,0,r.nlen,r.lencode,0,r.work,I),r.lenbits=I.bits,O){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,I={bits:r.distbits},O=j(Y,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,I),r.distbits=I.bits,O){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=o&&258<=u){e.next_out=n,e.avail_out=u,e.next_in=s,e.avail_in=o,r.hold=l,r.bits=c,M(e,f),n=e.next_out,a=e.output,u=e.avail_out,s=e.next_in,i=e.input,o=e.avail_in,l=r.hold,c=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;v=(w=r.lencode[l&(1<>>16&255,g=65535&w,!((m=w>>>24)<=c);){if(0===o)break e;o--,l+=i[s++]<>k)])>>>16&255,g=65535&w,!(k+(m=w>>>24)<=c);){if(0===o)break e;o--,l+=i[s++]<>>=k,c-=k,r.back+=k}if(l>>>=m,c-=m,r.back+=m,r.length=g,0===v){r.mode=26;break}if(32&v){r.back=-1,r.mode=12;break}if(64&v){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&v,r.mode=22;case 22:if(r.extra){for(F=r.extra;c>>=r.extra,c-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;v=(w=r.distcode[l&(1<>>16&255,g=65535&w,!((m=w>>>24)<=c);){if(0===o)break e;o--,l+=i[s++]<>k)])>>>16&255,g=65535&w,!(k+(m=w>>>24)<=c);){if(0===o)break e;o--,l+=i[s++]<>>=k,c-=k,r.back+=k}if(l>>>=m,c-=m,r.back+=m,64&v){e.msg="invalid distance code",r.mode=30;break}r.offset=g,r.extra=15&v,r.mode=24;case 24:if(r.extra){for(F=r.extra;c>>=r.extra,c-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===u)break e;if(p=f-u,r.offset>p){if((p=r.offset-p)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}d=p>r.wnext?(p-=r.wnext,r.wsize-p):r.wnext-p,p>r.length&&(p=r.length),b=r.window}else b=a,d=n-r.offset,p=r.length;for(up?(b=M[j+n[k]],A[x+n[k]]):(b=96,0),u=1<>I)+(l-=u)]=d<<24|b<<16|m|0,0!==l;);for(u=1<>=1;if(0!==u?(C&=u-1,C+=u):C=0,k++,0==--P[g]){if(g===_)break;g=t[r+n[k]]}if(y>>7)]}function N(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function W(e,t,r){e.bi_valid>a-r?(e.bi_buf|=t<>a-e.bi_valid,e.bi_valid+=r-a):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function L(e,t,r){var i,a,s=new Array(v+1),n=0;for(i=1;i<=v;i++)s[i]=n=n+r[i-1]<<1;for(a=0;a<=t;a++){var o=e[2*a+1];0!==o&&(e[2*a]=E(s[o]++,o))}}function T(e){var t;for(t=0;t>1;1<=r;r--)U(e,s,r);for(a=u;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],U(e,s,1),i=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=i,s[2*a]=s[2*r]+s[2*i],e.depth[a]=(e.depth[r]>=e.depth[i]?e.depth[r]:e.depth[i])+1,s[2*r+1]=s[2*i+1]=a,e.heap[1]=a++,U(e,s,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,i,a,s,n,o,u=t.dyn_tree,l=t.max_code,c=t.stat_desc.static_tree,h=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,p=t.stat_desc.extra_base,d=t.stat_desc.max_length,b=0;for(s=0;s<=v;s++)e.bl_count[s]=0;for(u[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r>=7;i>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return o;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return l;for(t=32;t>>3,(s=e.static_len+3+7>>>3)<=a&&(a=s)):a=s=r+5,r+4<=a&&-1!==t?Z(e,t,r,i):4===e.strategy||s===a?(W(e,2+(i?1:0),3),z(e,w,C)):(W(e,4+(i?1:0),3),function(e,t,r,i){var a;for(W(e,t-257,5),W(e,r-1,5),W(e,i-4,4),a=0;a>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(x[r]+h+1)]++,e.dyn_dtree[2*q(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){var t;W(e,2,3),B(e,g,w),16===(t=e).bi_valid?(N(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):8<=t.bi_valid&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}},{"../utils/common":41}],53:[function(e,t,r){t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}]},{},[10])(10)}),function(o){if(!(void 0===o||"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent))){var e=o.document,u=function(){return o.URL||o.webkitURL||o},l=e.createElementNS("http://www.w3.org/1999/xhtml","a"),c="download"in l,h=/constructor/i.test(o.HTMLElement)||o.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent),p=o.setImmediate||o.setTimeout,d=function(e){p(function(){throw e},0)},b=function(e){setTimeout(function(){"string"==typeof e?u().revokeObjectURL(e):e.remove()},4e4)},m=function(e){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e},i=function(e,r,t){t||(e=m(e));function i(){!function(e,t,r){for(var i=(t=[].concat(t)).length;i--;){var a=e["on"+t[i]];if("function"==typeof a)try{a.call(e,r||e)}catch(e){d(e)}}}(s,"writestart progress write writeend".split(" "))}var a,s=this,n="application/octet-stream"===e.type;if(s.readyState=s.INIT,c)return a=u().createObjectURL(e),void p(function(){var e,t;l.href=a,l.download=r,e=l,t=new MouseEvent("click"),e.dispatchEvent(t),i(),b(a),s.readyState=s.DONE},0);!function(){if((f||n&&h)&&o.FileReader){var t=new FileReader;return t.onloadend=function(){var e=f?t.result:t.result.replace(/^data:[^;]*;/,"data:attachment/file;");o.open(e,"_blank")||(o.location.href=e),e=void 0,s.readyState=s.DONE,i()},t.readAsDataURL(e),s.readyState=s.INIT}(a=a||u().createObjectURL(e),n)?o.location.href=a:o.open(a,"_blank")||(o.location.href=a);s.readyState=s.DONE,i(),b(a)}()},t=i.prototype;if("undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob)return;t.abort=function(){},t.readyState=t.INIT=0,t.WRITING=1,t.DONE=2,t.error=t.onwritestart=t.onprogress=t.onwrite=t.onabort=t.onerror=t.onwriteend=null,o.FileSaver_saveAs=function(e,t,r){return new i(e,t||e.name||"download",r)}}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||void 0),function(){var root="object"==typeof window?window:{},NODE_JS=!root.JS_SHA1_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS&&(root=global);var COMMON_JS=!root.JS_SHA1_NO_COMMON_JS&&"object"==typeof module&&module.exports,AMD="function"==typeof define&&define.amd,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-2147483648,8388608,32768,128],SHIFT=[24,16,8,0],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[],createOutputMethod=function(t){return function(e){return new Sha1(!0).update(e)[t]()}},createMethod=function(){var t=createOutputMethod("hex");NODE_JS&&(t=nodeWrap(t)),t.create=function(){return new Sha1},t.update=function(e){return t.create().update(e)};for(var e=0;e>2]|=e[a]<>2]|=r<>2]|=(192|r>>6)<>2]|=(224|r>>12)<>2]|=(240|r>>18)<>2]|=(128|r>>12&63)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<>2]|=EXTRA[3&t],this.block=e[16],56<=t&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},Sha1.prototype.hash=function(){var e,t,r=this.h0,i=this.h1,a=this.h2,s=this.h3,n=this.h4,o=this.blocks;for(e=16;e<80;++e)t=o[e-3]^o[e-8]^o[e-14]^o[e-16],o[e]=t<<1|t>>>31;for(e=0;e<20;e+=5)r=(t=(i=(t=(a=(t=(s=(t=(n=(t=r<<5|r>>>27)+(i&a|~i&s)+n+1518500249+o[e]<<0)<<5|n>>>27)+(r&(i=i<<30|i>>>2)|~r&a)+s+1518500249+o[e+1]<<0)<<5|s>>>27)+(n&(r=r<<30|r>>>2)|~n&i)+a+1518500249+o[e+2]<<0)<<5|a>>>27)+(s&(n=n<<30|n>>>2)|~s&r)+i+1518500249+o[e+3]<<0)<<5|i>>>27)+(a&(s=s<<30|s>>>2)|~a&n)+r+1518500249+o[e+4]<<0,a=a<<30|a>>>2;for(;e<40;e+=5)r=(t=(i=(t=(a=(t=(s=(t=(n=(t=r<<5|r>>>27)+(i^a^s)+n+1859775393+o[e]<<0)<<5|n>>>27)+(r^(i=i<<30|i>>>2)^a)+s+1859775393+o[e+1]<<0)<<5|s>>>27)+(n^(r=r<<30|r>>>2)^i)+a+1859775393+o[e+2]<<0)<<5|a>>>27)+(s^(n=n<<30|n>>>2)^r)+i+1859775393+o[e+3]<<0)<<5|i>>>27)+(a^(s=s<<30|s>>>2)^n)+r+1859775393+o[e+4]<<0,a=a<<30|a>>>2;for(;e<60;e+=5)r=(t=(i=(t=(a=(t=(s=(t=(n=(t=r<<5|r>>>27)+(i&a|i&s|a&s)+n-1894007588+o[e]<<0)<<5|n>>>27)+(r&(i=i<<30|i>>>2)|r&a|i&a)+s-1894007588+o[e+1]<<0)<<5|s>>>27)+(n&(r=r<<30|r>>>2)|n&i|r&i)+a-1894007588+o[e+2]<<0)<<5|a>>>27)+(s&(n=n<<30|n>>>2)|s&r|n&r)+i-1894007588+o[e+3]<<0)<<5|i>>>27)+(a&(s=s<<30|s>>>2)|a&n|s&n)+r-1894007588+o[e+4]<<0,a=a<<30|a>>>2;for(;e<80;e+=5)r=(t=(i=(t=(a=(t=(s=(t=(n=(t=r<<5|r>>>27)+(i^a^s)+n-899497514+o[e]<<0)<<5|n>>>27)+(r^(i=i<<30|i>>>2)^a)+s-899497514+o[e+1]<<0)<<5|s>>>27)+(n^(r=r<<30|r>>>2)^i)+a-899497514+o[e+2]<<0)<<5|a>>>27)+(s^(n=n<<30|n>>>2)^r)+i-899497514+o[e+3]<<0)<<5|i>>>27)+(a^(s=s<<30|s>>>2)^n)+r-899497514+o[e+4]<<0,a=a<<30|a>>>2;this.h0=this.h0+r<<0,this.h1=this.h1+i<<0,this.h2=this.h2+a<<0,this.h3=this.h3+s<<0,this.h4=this.h4+n<<0},Sha1.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,i=this.h3,a=this.h4;return HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[15&a]},Sha1.prototype.toString=Sha1.prototype.hex,Sha1.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,i=this.h3,a=this.h4;return[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24&255,r>>16&255,r>>8&255,255&r,i>>24&255,i>>16&255,i>>8&255,255&i,a>>24&255,a>>16&255,a>>8&255,255&a]},Sha1.prototype.array=Sha1.prototype.digest,Sha1.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(20),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),e};var exports=createMethod();COMMON_JS?module.exports=exports:(root.sha1=exports,AMD&&define(function(){return exports}))}(),Object.extend(Squeak,{vmPath:"/",platformSubtype:"Browser",osVersion:navigator.userAgent,windowSystem:"HTML"}),window.SqueakJS={};var canUseMouseOffset=navigator.userAgent.match("AppleWebKit/");function updateMousePos(e,t,r){var i=canUseMouseOffset?e.offsetX:e.layerX,a=canUseMouseOffset?e.offsetY:e.layerY;r.cursorCanvas&&(r.cursorCanvas.style.left=i+t.offsetLeft+r.cursorOffsetX+"px",r.cursorCanvas.style.top=a+t.offsetTop+r.cursorOffsetY+"px");var s=i*t.width/t.offsetWidth|0,n=a*t.height/t.offsetHeight|0;r.mouseX=Math.max(0,Math.min(r.width,s)),r.mouseY=Math.max(0,Math.min(r.height,n))}function recordMouseEvent(e,t,r,i,a){if(updateMousePos(t,r,i),i.vm){var s=i.buttons&Squeak.Mouse_All;switch(e){case"mousedown":switch(t.button||0){case 0:s=Squeak.Mouse_Red;break;case 1:s=Squeak.Mouse_Yellow;break;case 2:s=Squeak.Mouse_Blue}a.swapButtons&&(s==Squeak.Mouse_Yellow?s=Squeak.Mouse_Blue:s==Squeak.Mouse_Blue&&(s=Squeak.Mouse_Yellow));break;case"mousemove":break;case"mouseup":s=0}i.buttons=s|recordModifiers(t,i),i.eventQueue&&(i.eventQueue.push([Squeak.EventTypeMouse,t.timeStamp,i.mouseX,i.mouseY,i.buttons&Squeak.Mouse_All,i.buttons>>3]),i.signalInputEvent&&i.signalInputEvent()),i.idle=0,"mouseup"==e?i.runFor&&i.runFor(100):i.runNow&&i.runNow()}}function recordKeyboardEvent(e,t,r){if(r.vm){var i=r.buttons>>3<<8|e;r.eventQueue?(r.eventQueue.push([Squeak.EventTypeKeyboard,t,e,Squeak.EventKeyChar,r.buttons>>3,e]),r.signalInputEvent&&r.signalInputEvent(),r.keys[0]=i):i===r.vm.interruptKeycode?r.vm.interruptPending=!0:r.keys.push(i),r.idle=0,r.runNow&&r.runNow()}}function recordDragDropEvent(e,t,r,i){i.vm&&i.eventQueue&&(updateMousePos(t,r,i),i.eventQueue.push([Squeak.EventTypeDragDropFiles,t.timeStamp,e,i.mouseX,i.mouseY,i.buttons>>3,i.droppedFiles.length]),i.signalInputEvent&&i.signalInputEvent())}function fakeCmdOrCtrlKey(e,t,r){r.buttons&=~Squeak.Keyboard_All,r.buttons|=Squeak.Keyboard_Cmd|Squeak.Keyboard_Ctrl,r.keys=[],recordKeyboardEvent(e,t,r)}function makeSqueakEvent(e,t,r){t[0]=e[0],t[1]=e[1]-r&Squeak.MillisecondClockMask;for(var i=2;ib.width&&(r.font="bold 24px sans-serif"),r.textAlign="center",r.textBaseline="middle",r.fillText(e,b.width/2,b.height/2)},v.showProgress=function(e,t){t=t||{};var r=v.context,i=b.width/3|0,a=.5*b.width-i/2,s=.5*b.height+48;r.fillStyle=t.background||"#000",r.fillRect(a,s,i,24),r.lineWidth=2,r.strokeStyle=t.color||"#F90",r.strokeRect(a,s,i,24),r.fillStyle=t.color||"#F90",r.fillRect(a,s,i*e,24)},v.executeClipboardPaste=function(e,t){if(!v.vm)return!0;try{v.clipboardString=e,fakeCmdOrCtrlKey("v".charCodeAt(0),t,v)}catch(e){console.error("paste error "+e)}},v.executeClipboardCopy=function(e,t){if(!v.vm)return!0;v.clipboardStringChanged=!1,fakeCmdOrCtrlKey((e||"c").charCodeAt(0),t,v);for(var r=Date.now();!v.clipboardStringChanged&&Date.now()-r<500;)v.vm.interpret(20);if(v.clipboardStringChanged)try{return v.clipboardString}catch(e){console.error("copy error "+e)}},b.onmousedown=function(e){return o(),recordMouseEvent("mousedown",e,b,v,m),e.preventDefault(),!1},b.onmouseup=function(e){recordMouseEvent("mouseup",e,b,v,m),o(),e.preventDefault()},b.onmousemove=function(e){recordMouseEvent("mousemove",e,b,v,m),e.preventDefault()},b.oncontextmenu=function(){return!1};var g={state:"idle",button:0,x:0,y:0,dist:0,down:{}};function u(e){if(e.touches.length){g.x=g.y=0;for(var t=0;t',t.setAttribute("style","position:fixed;right:0;bottom:0;background-color:rgba(128,128,128,0.5);border-radius:5px"),b.parentElement.appendChild(t),t.onmousedown=function(e){b.contentEditable=!0,b.setAttribute("autocomplete","off"),b.setAttribute("autocorrect","off"),b.setAttribute("autocapitalize","off"),b.setAttribute("spellcheck","off"),b.focus(),e.preventDefault()},t.ontouchstart=t.onmousedown}function f(e){for(var t=0;t