@wwawing/all 3.6.11 → 3.6.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,4 +18,4 @@ a.mode.CTRGladman=function(){var t=a.lib.BlockCipherMode.extend();function e(t){
18
18
 
19
19
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
20
20
  */
21
- function(t){var e=a,s=e.lib,i=s.WordArray,o=s.Hasher,r=e.algo,n=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),_=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),h=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),c=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),u=i.create([0,1518500249,1859775393,2400959708,2840853838]),l=i.create([1352829926,1548603684,1836072691,2053994217,0]),p=r.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var s=0;s<16;s++){var a=e+s,i=t[a];t[a]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,r,p,g,A,S,I,T,O,v,D,C=this._hash.words,P=u.words,M=l.words,N=n.words,R=_.words,L=h.words,b=c.words;for(S=o=C[0],I=r=C[1],T=p=C[2],O=g=C[3],v=A=C[4],s=0;s<80;s+=1)D=o+t[e+N[s]]|0,D+=s<16?d(r,p,g)+P[0]:s<32?E(r,p,g)+P[1]:s<48?w(r,p,g)+P[2]:s<64?y(r,p,g)+P[3]:m(r,p,g)+P[4],D=(D=f(D|=0,L[s]))+A|0,o=A,A=g,g=f(p,10),p=r,r=D,D=S+t[e+R[s]]|0,D+=s<16?m(I,T,O)+M[0]:s<32?y(I,T,O)+M[1]:s<48?w(I,T,O)+M[2]:s<64?E(I,T,O)+M[3]:d(I,T,O)+M[4],D=(D=f(D|=0,b[s]))+v|0,S=v,v=O,O=f(T,10),T=I,I=D;D=C[1]+p+O|0,C[1]=C[2]+g+v|0,C[2]=C[3]+A+S|0,C[3]=C[4]+o+I|0,C[4]=C[0]+r+T|0,C[0]=D},_doFinalize:function(){var t=this._data,e=t.words,s=8*this._nDataBytes,a=8*t.sigBytes;e[a>>>5]|=128<<24-a%32,e[14+(a+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),t.sigBytes=4*(e.length+1),this._process();for(var i=this._hash,o=i.words,r=0;r<5;r++){var n=o[r];o[r]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}return i},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function d(t,e,s){return t^e^s}function E(t,e,s){return t&e|~t&s}function w(t,e,s){return(t|~e)^s}function y(t,e,s){return t&s|e&~s}function m(t,e,s){return t^(e|~s)}function f(t,e){return t<<e|t>>>32-e}e.RIPEMD160=o._createHelper(p),e.HmacRIPEMD160=o._createHmacHelper(p)}(Math),a.RIPEMD160)},637:function(t,e,s){var a,i,o,r,n,_,h,c;t.exports=(c=s(359),i=(a=c).lib,o=i.WordArray,r=i.Hasher,n=a.algo,_=[],h=n.SHA1=r.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var s=this._hash.words,a=s[0],i=s[1],o=s[2],r=s[3],n=s[4],h=0;h<80;h++){if(h<16)_[h]=0|t[e+h];else{var c=_[h-3]^_[h-8]^_[h-14]^_[h-16];_[h]=c<<1|c>>>31}var u=(a<<5|a>>>27)+n+_[h];u+=h<20?1518500249+(i&o|~i&r):h<40?1859775393+(i^o^r):h<60?(i&o|i&r|o&r)-1894007588:(i^o^r)-899497514,n=r,r=o,o=i<<30|i>>>2,i=a,a=u}s[0]=s[0]+a|0,s[1]=s[1]+i|0,s[2]=s[2]+o|0,s[3]=s[3]+r|0,s[4]=s[4]+n|0},_doFinalize:function(){var t=this._data,e=t.words,s=8*this._nDataBytes,a=8*t.sigBytes;return e[a>>>5]|=128<<24-a%32,e[14+(a+64>>>9<<4)]=Math.floor(s/4294967296),e[15+(a+64>>>9<<4)]=s,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}}),a.SHA1=r._createHelper(h),a.HmacSHA1=r._createHmacHelper(h),c.SHA1)},640:function(t,e,s){var a,i,o,r,n,_;t.exports=(_=s(359),s(93),i=(a=_).lib.WordArray,o=a.algo,r=o.SHA256,n=o.SHA224=r.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=r._doFinalize.call(this);return t.sigBytes-=4,t}}),a.SHA224=r._createHelper(n),a.HmacSHA224=r._createHmacHelper(n),_.SHA224)},93:function(t,e,s){var a;t.exports=(a=s(359),function(t){var e=a,s=e.lib,i=s.WordArray,o=s.Hasher,r=e.algo,n=[],_=[];!function(){function e(e){for(var s=t.sqrt(e),a=2;a<=s;a++)if(!(e%a))return!1;return!0}function s(t){return 4294967296*(t-(0|t))|0}for(var a=2,i=0;i<64;)e(a)&&(i<8&&(n[i]=s(t.pow(a,.5))),_[i]=s(t.pow(a,1/3)),i++),a++}();var h=[],c=r.SHA256=o.extend({_doReset:function(){this._hash=new i.init(n.slice(0))},_doProcessBlock:function(t,e){for(var s=this._hash.words,a=s[0],i=s[1],o=s[2],r=s[3],n=s[4],c=s[5],u=s[6],l=s[7],p=0;p<64;p++){if(p<16)h[p]=0|t[e+p];else{var d=h[p-15],E=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,w=h[p-2],y=(w<<15|w>>>17)^(w<<13|w>>>19)^w>>>10;h[p]=E+h[p-7]+y+h[p-16]}var m=a&i^a&o^i&o,f=(a<<30|a>>>2)^(a<<19|a>>>13)^(a<<10|a>>>22),g=l+((n<<26|n>>>6)^(n<<21|n>>>11)^(n<<7|n>>>25))+(n&c^~n&u)+_[p]+h[p];l=u,u=c,c=n,n=r+g|0,r=o,o=i,i=a,a=g+(f+m)|0}s[0]=s[0]+a|0,s[1]=s[1]+i|0,s[2]=s[2]+o|0,s[3]=s[3]+r|0,s[4]=s[4]+n|0,s[5]=s[5]+c|0,s[6]=s[6]+u|0,s[7]=s[7]+l|0},_doFinalize:function(){var e=this._data,s=e.words,a=8*this._nDataBytes,i=8*e.sigBytes;return s[i>>>5]|=128<<24-i%32,s[14+(i+64>>>9<<4)]=t.floor(a/4294967296),s[15+(i+64>>>9<<4)]=a,e.sigBytes=4*s.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=o._createHelper(c),e.HmacSHA256=o._createHmacHelper(c)}(Math),a.SHA256)},140:function(t,e,s){var a;t.exports=(a=s(359),s(467),function(t){var e=a,s=e.lib,i=s.WordArray,o=s.Hasher,r=e.x64.Word,n=e.algo,_=[],h=[],c=[];!function(){for(var t=1,e=0,s=0;s<24;s++){_[t+5*e]=(s+1)*(s+2)/2%64;var a=(2*t+3*e)%5;t=e%5,e=a}for(t=0;t<5;t++)for(e=0;e<5;e++)h[t+5*e]=e+(2*t+3*e)%5*5;for(var i=1,o=0;o<24;o++){for(var n=0,u=0,l=0;l<7;l++){if(1&i){var p=(1<<l)-1;p<32?u^=1<<p:n^=1<<p-32}128&i?i=i<<1^113:i<<=1}c[o]=r.create(n,u)}}();var u=[];!function(){for(var t=0;t<25;t++)u[t]=r.create()}();var l=n.SHA3=o.extend({cfg:o.cfg.extend({outputLength:512}),_doReset:function(){for(var t=this._state=[],e=0;e<25;e++)t[e]=new r.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(t,e){for(var s=this._state,a=this.blockSize/2,i=0;i<a;i++){var o=t[e+2*i],r=t[e+2*i+1];o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),(C=s[i]).high^=r,C.low^=o}for(var n=0;n<24;n++){for(var l=0;l<5;l++){for(var p=0,d=0,E=0;E<5;E++)p^=(C=s[l+5*E]).high,d^=C.low;var w=u[l];w.high=p,w.low=d}for(l=0;l<5;l++){var y=u[(l+4)%5],m=u[(l+1)%5],f=m.high,g=m.low;for(p=y.high^(f<<1|g>>>31),d=y.low^(g<<1|f>>>31),E=0;E<5;E++)(C=s[l+5*E]).high^=p,C.low^=d}for(var A=1;A<25;A++){var S=(C=s[A]).high,I=C.low,T=_[A];T<32?(p=S<<T|I>>>32-T,d=I<<T|S>>>32-T):(p=I<<T-32|S>>>64-T,d=S<<T-32|I>>>64-T);var O=u[h[A]];O.high=p,O.low=d}var v=u[0],D=s[0];for(v.high=D.high,v.low=D.low,l=0;l<5;l++)for(E=0;E<5;E++){var C=s[A=l+5*E],P=u[A],M=u[(l+1)%5+5*E],N=u[(l+2)%5+5*E];C.high=P.high^~M.high&N.high,C.low=P.low^~M.low&N.low}C=s[0];var R=c[n];C.high^=R.high,C.low^=R.low}},_doFinalize:function(){var e=this._data,s=e.words,a=(this._nDataBytes,8*e.sigBytes),o=32*this.blockSize;s[a>>>5]|=1<<24-a%32,s[(t.ceil((a+1)/o)*o>>>5)-1]|=128,e.sigBytes=4*s.length,this._process();for(var r=this._state,n=this.cfg.outputLength/8,_=n/8,h=[],c=0;c<_;c++){var u=r[c],l=u.high,p=u.low;l=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),h.push(p),h.push(l)}return new i.init(h,n)},clone:function(){for(var t=o.clone.call(this),e=t._state=this._state.slice(0),s=0;s<25;s++)e[s]=e[s].clone();return t}});e.SHA3=o._createHelper(l),e.HmacSHA3=o._createHmacHelper(l)}(Math),a.SHA3)},716:function(t,e,s){var a,i,o,r,n,_,h,c;t.exports=(c=s(359),s(467),s(834),i=(a=c).x64,o=i.Word,r=i.WordArray,n=a.algo,_=n.SHA512,h=n.SHA384=_.extend({_doReset:function(){this._hash=new r.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var t=_._doFinalize.call(this);return t.sigBytes-=16,t}}),a.SHA384=_._createHelper(h),a.HmacSHA384=_._createHmacHelper(h),c.SHA384)},834:function(t,e,s){var a;t.exports=(a=s(359),s(467),function(){var t=a,e=t.lib.Hasher,s=t.x64,i=s.Word,o=s.WordArray,r=t.algo;function n(){return i.create.apply(i,arguments)}var _=[n(1116352408,3609767458),n(1899447441,602891725),n(3049323471,3964484399),n(3921009573,2173295548),n(961987163,4081628472),n(1508970993,3053834265),n(2453635748,2937671579),n(2870763221,3664609560),n(3624381080,2734883394),n(310598401,1164996542),n(607225278,1323610764),n(1426881987,3590304994),n(1925078388,4068182383),n(2162078206,991336113),n(2614888103,633803317),n(3248222580,3479774868),n(3835390401,2666613458),n(4022224774,944711139),n(264347078,2341262773),n(604807628,2007800933),n(770255983,1495990901),n(1249150122,1856431235),n(1555081692,3175218132),n(1996064986,2198950837),n(2554220882,3999719339),n(2821834349,766784016),n(2952996808,2566594879),n(3210313671,3203337956),n(3336571891,1034457026),n(3584528711,2466948901),n(113926993,3758326383),n(338241895,168717936),n(666307205,1188179964),n(773529912,1546045734),n(1294757372,1522805485),n(1396182291,2643833823),n(1695183700,2343527390),n(1986661051,1014477480),n(2177026350,1206759142),n(2456956037,344077627),n(2730485921,1290863460),n(2820302411,3158454273),n(3259730800,3505952657),n(3345764771,106217008),n(3516065817,3606008344),n(3600352804,1432725776),n(4094571909,1467031594),n(275423344,851169720),n(430227734,3100823752),n(506948616,1363258195),n(659060556,3750685593),n(883997877,3785050280),n(958139571,3318307427),n(1322822218,3812723403),n(1537002063,2003034995),n(1747873779,3602036899),n(1955562222,1575990012),n(2024104815,1125592928),n(2227730452,2716904306),n(2361852424,442776044),n(2428436474,593698344),n(2756734187,3733110249),n(3204031479,2999351573),n(3329325298,3815920427),n(3391569614,3928383900),n(3515267271,566280711),n(3940187606,3454069534),n(4118630271,4000239992),n(116418474,1914138554),n(174292421,2731055270),n(289380356,3203993006),n(460393269,320620315),n(685471733,587496836),n(852142971,1086792851),n(1017036298,365543100),n(1126000580,2618297676),n(1288033470,3409855158),n(1501505948,4234509866),n(1607167915,987167468),n(1816402316,1246189591)],h=[];!function(){for(var t=0;t<80;t++)h[t]=n()}();var c=r.SHA512=e.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var s=this._hash.words,a=s[0],i=s[1],o=s[2],r=s[3],n=s[4],c=s[5],u=s[6],l=s[7],p=a.high,d=a.low,E=i.high,w=i.low,y=o.high,m=o.low,f=r.high,g=r.low,A=n.high,S=n.low,I=c.high,T=c.low,O=u.high,v=u.low,D=l.high,C=l.low,P=p,M=d,N=E,R=w,L=y,b=m,B=f,x=g,U=A,W=S,Y=I,k=T,F=O,G=v,H=D,K=C,V=0;V<80;V++){var j,X,J=h[V];if(V<16)X=J.high=0|t[e+2*V],j=J.low=0|t[e+2*V+1];else{var Z=h[V-15],Q=Z.high,q=Z.low,z=(Q>>>1|q<<31)^(Q>>>8|q<<24)^Q>>>7,$=(q>>>1|Q<<31)^(q>>>8|Q<<24)^(q>>>7|Q<<25),tt=h[V-2],et=tt.high,st=tt.low,at=(et>>>19|st<<13)^(et<<3|st>>>29)^et>>>6,it=(st>>>19|et<<13)^(st<<3|et>>>29)^(st>>>6|et<<26),ot=h[V-7],rt=ot.high,nt=ot.low,_t=h[V-16],ht=_t.high,ct=_t.low;X=(X=(X=z+rt+((j=$+nt)>>>0<$>>>0?1:0))+at+((j+=it)>>>0<it>>>0?1:0))+ht+((j+=ct)>>>0<ct>>>0?1:0),J.high=X,J.low=j}var ut,lt=U&Y^~U&F,pt=W&k^~W&G,dt=P&N^P&L^N&L,Et=M&R^M&b^R&b,wt=(P>>>28|M<<4)^(P<<30|M>>>2)^(P<<25|M>>>7),yt=(M>>>28|P<<4)^(M<<30|P>>>2)^(M<<25|P>>>7),mt=(U>>>14|W<<18)^(U>>>18|W<<14)^(U<<23|W>>>9),ft=(W>>>14|U<<18)^(W>>>18|U<<14)^(W<<23|U>>>9),gt=_[V],At=gt.high,St=gt.low,It=H+mt+((ut=K+ft)>>>0<K>>>0?1:0),Tt=yt+Et;H=F,K=G,F=Y,G=k,Y=U,k=W,U=B+(It=(It=(It=It+lt+((ut+=pt)>>>0<pt>>>0?1:0))+At+((ut+=St)>>>0<St>>>0?1:0))+X+((ut+=j)>>>0<j>>>0?1:0))+((W=x+ut|0)>>>0<x>>>0?1:0)|0,B=L,x=b,L=N,b=R,N=P,R=M,P=It+(wt+dt+(Tt>>>0<yt>>>0?1:0))+((M=ut+Tt|0)>>>0<ut>>>0?1:0)|0}d=a.low=d+M,a.high=p+P+(d>>>0<M>>>0?1:0),w=i.low=w+R,i.high=E+N+(w>>>0<R>>>0?1:0),m=o.low=m+b,o.high=y+L+(m>>>0<b>>>0?1:0),g=r.low=g+x,r.high=f+B+(g>>>0<x>>>0?1:0),S=n.low=S+W,n.high=A+U+(S>>>0<W>>>0?1:0),T=c.low=T+k,c.high=I+Y+(T>>>0<k>>>0?1:0),v=u.low=v+G,u.high=O+F+(v>>>0<G>>>0?1:0),C=l.low=C+K,l.high=D+H+(C>>>0<K>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,s=8*this._nDataBytes,a=8*t.sigBytes;return e[a>>>5]|=128<<24-a%32,e[30+(a+128>>>10<<5)]=Math.floor(s/4294967296),e[31+(a+128>>>10<<5)]=s,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=e.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});t.SHA512=e._createHelper(c),t.HmacSHA512=e._createHmacHelper(c)}(),a.SHA512)},567:function(t,e,s){var a;t.exports=(a=s(359),s(139),s(174),s(844),s(951),function(){var t=a,e=t.lib,s=e.WordArray,i=e.BlockCipher,o=t.algo,r=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],n=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],_=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],h=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],c=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],u=o.DES=i.extend({_doReset:function(){for(var t=this._key.words,e=[],s=0;s<56;s++){var a=r[s]-1;e[s]=t[a>>>5]>>>31-a%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var h=i[o]=[],c=_[o];for(s=0;s<24;s++)h[s/6|0]|=e[(n[s]-1+c)%28]<<31-s%6,h[4+(s/6|0)]|=e[28+(n[s+24]-1+c)%28]<<31-s%6;for(h[0]=h[0]<<1|h[0]>>>31,s=1;s<7;s++)h[s]=h[s]>>>4*(s-1)+3;h[7]=h[7]<<5|h[7]>>>27}var u=this._invSubKeys=[];for(s=0;s<16;s++)u[s]=i[15-s]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,s){this._lBlock=t[e],this._rBlock=t[e+1],l.call(this,4,252645135),l.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),l.call(this,1,1431655765);for(var a=0;a<16;a++){for(var i=s[a],o=this._lBlock,r=this._rBlock,n=0,_=0;_<8;_++)n|=h[_][((r^i[_])&c[_])>>>0];this._lBlock=r,this._rBlock=o^n}var u=this._lBlock;this._lBlock=this._rBlock,this._rBlock=u,l.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),l.call(this,16,65535),l.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function l(t,e){var s=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=s,this._lBlock^=s<<t}function p(t,e){var s=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=s,this._rBlock^=s<<t}t.DES=i._createHelper(u);var d=o.TripleDES=i.extend({_doReset:function(){var t=this._key.words;if(2!==t.length&&4!==t.length&&t.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var e=t.slice(0,2),a=t.length<4?t.slice(0,2):t.slice(2,4),i=t.length<6?t.slice(0,2):t.slice(4,6);this._des1=u.createEncryptor(s.create(e)),this._des2=u.createEncryptor(s.create(a)),this._des3=u.createEncryptor(s.create(i))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});t.TripleDES=i._createHelper(d)}(),a.TripleDES)},467:function(t,e,s){var a;t.exports=(a=s(359),function(t){var e=a,s=e.lib,i=s.Base,o=s.WordArray,r=e.x64={};r.Word=i.extend({init:function(t,e){this.high=t,this.low=e}}),r.WordArray=i.extend({init:function(e,s){e=this.words=e||[],this.sigBytes=s!=t?s:8*e.length},toX32:function(){for(var t=this.words,e=t.length,s=[],a=0;a<e;a++){var i=t[a];s.push(i.high),s.push(i.low)}return o.create(s,this.sigBytes)},clone:function(){for(var t=i.clone.call(this),e=t.words=this.words.slice(0),s=e.length,a=0;a<s;a++)e[a]=e[a].clone();return t}})}(),a)},633:function(){},106:function(){}},e={};function s(a){var i=e[a];if(void 0!==i)return i.exports;var o=e[a]={exports:{}};return t[a].call(o.exports,o,o.exports,s),o.exports}s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,{a:e}),e},s.d=function(t,e){for(var a in e)s.o(e,a)&&!s.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";var t,e;!function(t){t[t.NONE=0]="NONE",t[t.KEYDOWN=1]="KEYDOWN",t[t.KEYPRESS=2]="KEYPRESS",t[t.KEYUP=3]="KEYUP",t[t.KEYPRESS_MESSAGECHANGE=4]="KEYPRESS_MESSAGECHANGE"}(t||(t={})),function(t){t[t.KEY_ENTER=13]="KEY_ENTER",t[t.KEY_SHIFT=16]="KEY_SHIFT",t[t.KEY_ESC=27]="KEY_ESC",t[t.KEY_SPACE=32]="KEY_SPACE",t[t.KEY_LEFT=37]="KEY_LEFT",t[t.KEY_UP=38]="KEY_UP",t[t.KEY_RIGHT=39]="KEY_RIGHT",t[t.KEY_DOWN=40]="KEY_DOWN",t[t.KEY_1=49]="KEY_1",t[t.KEY_2=50]="KEY_2",t[t.KEY_3=51]="KEY_3",t[t.KEY_A=65]="KEY_A",t[t.KEY_C=67]="KEY_C",t[t.KEY_D=68]="KEY_D",t[t.KEY_E=69]="KEY_E",t[t.KEY_I=73]="KEY_I",t[t.KEY_M=77]="KEY_M",t[t.KEY_N=78]="KEY_N",t[t.KEY_P=80]="KEY_P",t[t.KEY_Q=81]="KEY_Q",t[t.KEY_S=83]="KEY_S",t[t.KEY_W=87]="KEY_W",t[t.KEY_X=88]="KEY_X",t[t.KEY_Y=89]="KEY_Y",t[t.KEY_Z=90]="KEY_Z",t[t.KEY_F1=112]="KEY_F1",t[t.KEY_F2=113]="KEY_F2",t[t.KEY_F3=114]="KEY_F3",t[t.KEY_F4=115]="KEY_F4",t[t.KEY_F5=116]="KEY_F5",t[t.KEY_F6=117]="KEY_F6",t[t.KEY_F7=118]="KEY_F7",t[t.KEY_F8=119]="KEY_F8",t[t.KEY_F9=120]="KEY_F9",t[t.KEY_F12=123]="KEY_F12"}(e||(e={}));var a,i,o=function(){function e(){var t;for(this._nextKeyState=new Array(e.KEY_BUFFER_MAX),this._keyState=new Array(e.KEY_BUFFER_MAX),this._prevKeyState=new Array(e.KEY_BUFFER_MAX),this._prevKeyStateOnControllable=new Array(e.KEY_BUFFER_MAX),this._keyInputContinueFrameNum=new Array(e.KEY_BUFFER_MAX),t=0;t<e.KEY_BUFFER_MAX;t++)this._nextKeyState[t]=!1,this._keyState[t]=!1,this._prevKeyState[t]=!1,this._prevKeyStateOnControllable[t]=!1,this._keyInputContinueFrameNum[t]=0}return e.prototype.checkHitKey=function(e){var s=this.getKeyState(e);return s===t.KEYDOWN||s===t.KEYPRESS},e.prototype.getKeyState=function(e){return this._prevKeyState[e]?this._keyState[e]?t.KEYPRESS:t.KEYUP:this._keyState[e]?t.KEYDOWN:t.NONE},e.prototype.getKeyStateForControllPlayer=function(e){return this._prevKeyStateOnControllable[e]?this._keyState[e]?t.KEYPRESS:t.KEYUP:this._keyState[e]?t.KEYDOWN:t.NONE},e.prototype.getKeyStateForMessageCheck=function(e){return this._prevKeyState[e]?this._keyState[e]?this._keyInputContinueFrameNum[e]>=Q.KEYPRESS_MESSAGE_CHANGE_FRAME_NUM?t.KEYPRESS_MESSAGECHANGE:t.KEYPRESS:t.KEYUP:this._keyState[e]?t.KEYDOWN:t.NONE},e.prototype.setPressInfo=function(t){this._nextKeyState[t]=!0,this._keyInputContinueFrameNum[t]=-1},e.prototype.setReleaseInfo=function(t){this._nextKeyState[t]=!1,this._keyInputContinueFrameNum[t]=-1},e.prototype.update=function(){var t;for(this._prevKeyState=this._keyState.slice(),this._keyState=this._nextKeyState.slice(),t=0;t<e.KEY_BUFFER_MAX;t++)this._keyState[t]&&this._keyInputContinueFrameNum[t]++},e.prototype.memorizeKeyStateOnControllableFrame=function(){this._prevKeyStateOnControllable=this._keyState.slice()},e.prototype.allClear=function(){var t;for(this._nextKeyState=new Array(e.KEY_BUFFER_MAX),t=0;t<e.KEY_BUFFER_MAX;t++)this._nextKeyState[t]=!1},e.KEY_BUFFER_MAX=256,e}();!function(t){t[t.NONE=0]="NONE",t[t.MOUSEDOWN=1]="MOUSEDOWN",t[t.MOUSEPRESS=2]="MOUSEPRESS",t[t.MOUSEUP=3]="MOUSEUP"}(a||(a={})),function(t){t[t.DIR_KEY=1]="DIR_KEY"}(i||(i={}));var r,n,_=function(){function t(){this._prevMouseState=!1,this._mouseState=!1,this._nextMouseState=!1}return t.prototype.checkClickMouse=function(t){var e;return(e=void 0!==t?this.getMouseState(t):this.getMouseState())===a.MOUSEDOWN||e===a.MOUSEPRESS},t.prototype.getMouseState=function(t){return void 0!==t&&this._inputDir!==t?a.NONE:this._prevMouseState?this._mouseState?a.MOUSEPRESS:a.MOUSEUP:this._mouseState?a.MOUSEDOWN:a.NONE},t.prototype.getMouseStateForControllPlayer=function(t){return void 0!==t&&this._inputDir!==t?a.NONE:this._prevMouseStateOnControllable?this._mouseState?a.MOUSEPRESS:a.MOUSEUP:this._mouseState?a.MOUSEDOWN:a.NONE},t.prototype.setPressInfo=function(t,e){this._nextMouseState=!0,this._inputDir=t,this._touchID=e},t.prototype.setReleaseInfo=function(){this._touchID=0,this._nextMouseState=!1},t.prototype.touchIDIsSetDir=function(){return this._touchID===i.DIR_KEY},t.prototype.memorizeMouseStateOnControllableFrame=function(){this._prevMouseStateOnControllable=this._mouseState},t.prototype.update=function(){this._prevMouseState=this._mouseState,this._mouseState=this._nextMouseState},t.prototype.clear=function(){this._nextMouseState=!1},t.prototype.getTouchID=function(){return this._touchID},t}();!function(t){t[t.BUTTON_INDEX_B=0]="BUTTON_INDEX_B",t[t.BUTTON_INDEX_A=1]="BUTTON_INDEX_A",t[t.BUTTON_INDEX_Y=2]="BUTTON_INDEX_Y",t[t.BUTTON_INDEX_X=3]="BUTTON_INDEX_X",t[t.BUTTON_INDEX_L=4]="BUTTON_INDEX_L",t[t.BUTTON_INDEX_R=5]="BUTTON_INDEX_R",t[t.BUTTON_INDEX_ZL=6]="BUTTON_INDEX_ZL",t[t.BUTTON_INDEX_ZR=7]="BUTTON_INDEX_ZR",t[t.BUTTON_INDEX_MINUS=8]="BUTTON_INDEX_MINUS",t[t.BUTTON_INDEX_PLUS=9]="BUTTON_INDEX_PLUS",t[t.BUTTON_INDEX_LEFT_STICK=10]="BUTTON_INDEX_LEFT_STICK",t[t.BUTTON_INDEX_RIGHT_STICK=11]="BUTTON_INDEX_RIGHT_STICK",t[t.BUTTON_CROSS_KEY_UP=12]="BUTTON_CROSS_KEY_UP",t[t.BUTTON_CROSS_KEY_DOWN=13]="BUTTON_CROSS_KEY_DOWN",t[t.BUTTON_CROSS_KEY_LEFT=14]="BUTTON_CROSS_KEY_LEFT",t[t.BUTTON_CROSS_KEY_RIGHT=15]="BUTTON_CROSS_KEY_RIGHT"}(r||(r={})),function(t){t[t.AXES_L_HORIZONTAL_INDEX=0]="AXES_L_HORIZONTAL_INDEX",t[t.AXES_L_VERTICAL_INDEX=1]="AXES_L_VERTICAL_INDEX",t[t.AXES_R_HORIZONTAL_INDEX=2]="AXES_R_HORIZONTAL_INDEX",t[t.AXES_R_VERTICAL_INDEX=3]="AXES_R_VERTICAL_INDEX",t[t.AXES_CROSS_KEY=9]="AXES_CROSS_KEY"}(n||(n={}));var h,c,u,l=function(){function t(){var t;for(this.gamepad=null,this.triggers=[],t=0;t<16;t++)this.triggers[t]=!1}return t.prototype.update=function(){this.gamepad=null;var t=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads:[];if(t&&t.length>0&&t[0]){var e=t[0];this.gamepad=e}},t.prototype.buttonTrigger=function(){for(var t,e,s,a,i,o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];if(!this.gamepad)return!1;for(e=o.length,t=0;t<e;t++){s=o[t];var n=this.gamepad.buttons[s];if(!n)return!1;if(a="object"==typeof n?!0===n.pressed:1===n,i=this.triggers[s],this.triggers[s]=a,a&&!i)return!0}return!1},t.prototype.buttonPressed=function(){for(var t,e,s,a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];if(!this.gamepad)return!1;for(e=a.length,t=0;t<e;t++){s=a[t];var o=this.gamepad.buttons[s];if(!o)return!1;if("object"==typeof o?!0===o.pressed:1===o)return!0}return!1},t.prototype.crossPressed=function(){for(var t,e,s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];if(!this.gamepad)return!1;for(e=s.length,t=0;t<e;t++)switch(s[t]){case r.BUTTON_CROSS_KEY_UP:if(this.gamepad.axes[n.AXES_L_VERTICAL_INDEX]<=-.6||this.gamepad.axes[n.AXES_R_VERTICAL_INDEX]<=-.6||-1===this.stickFloor(n.AXES_CROSS_KEY)||this.buttonPressed(r.BUTTON_CROSS_KEY_UP))return!0;break;case r.BUTTON_CROSS_KEY_DOWN:if(this.gamepad.axes[n.AXES_L_VERTICAL_INDEX]>=.7||this.gamepad.axes[n.AXES_R_VERTICAL_INDEX]>=.7||.1===this.stickFloor(n.AXES_CROSS_KEY)||this.buttonPressed(r.BUTTON_CROSS_KEY_DOWN))return!0;break;case r.BUTTON_CROSS_KEY_LEFT:if(this.gamepad.axes[n.AXES_L_HORIZONTAL_INDEX]<=-.7||this.gamepad.axes[n.AXES_R_HORIZONTAL_INDEX]<=-.7||.7===this.stickFloor(n.AXES_CROSS_KEY)||this.buttonPressed(r.BUTTON_CROSS_KEY_LEFT))return!0;break;case r.BUTTON_CROSS_KEY_RIGHT:if(this.gamepad.axes[n.AXES_L_HORIZONTAL_INDEX]>.6||this.gamepad.axes[n.AXES_R_HORIZONTAL_INDEX]>.6||-.5===this.stickFloor(n.AXES_CROSS_KEY)||this.buttonPressed(r.BUTTON_CROSS_KEY_RIGHT))return!0}return!1},t.prototype.vibration=function(t){return!!this.gamepad&&(!!this.gamepad.vibrationActuator&&void(t?this.gamepad.vibrationActuator.playEffect("dual-rumble",{startDelay:0,duration:100,weakMagnitude:1,strongMagnitude:.5}):this.gamepad.vibrationActuator.playEffect("dual-rumble",{startDelay:0,duration:100,weakMagnitude:.5,strongMagnitude:1})))},t.prototype.stickFloor=function(){for(var t,e,s,a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];if(!this.gamepad)return 0;for(e=a.length,t=0;t<e;t++){s=a[t];var o=this.gamepad.axes[s];return"number"!=typeof o?0:Math.floor(10*o)/10}return 0},t}(),p=(h=function(t,e){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},h(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function s(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(s.prototype=e.prototype,new s)}),d=function(){function t(t,e){this.strength=t,this.defence=e}return t.prototype.add=function(t){return this.strength+=t.strength,this.defence+=t.defence,this},t.prototype.plus=function(e){return new t(this.strength+e.strength,this.defence+e.defence)},t.prototype.minus=function(e){return new t(this.strength-e.strength,this.defence-e.defence)},t.prototype.equals=function(t){return this.strength===t.strength&&this.defence===t.defence},t}(),E=function(t){function e(e,s,a,i){var o=t.call(this,s,a)||this;return o.energy=e,o.gold=i,o}return p(e,t),e.prototype.add=function(t){return t instanceof e&&(this.energy+=t.energy,this.gold+=t.gold),this.strength+=t.strength,this.defence+=t.defence,this},e.prototype.plus=function(t){return t instanceof e?new e(this.energy+t.energy,this.strength+t.strength,this.defence+t.defence,this.gold+t.gold):new e(this.energy,this.strength+t.strength,this.defence+t.defence,this.gold)},e.prototype.minus=function(t){return t instanceof e?new e(this.energy-t.energy,this.strength-t.strength,this.defence-t.defence,this.gold-t.gold):new e(this.energy,this.strength-t.strength,this.defence-t.defence,this.gold)},e.prototype.equals=function(t){return this.energy===t.energy&&this.strength===t.strength&&this.defence===t.defence&&this.gold===t.gold},e.prototype.calculateScore=function(t){var e=this;return Object.keys(t).reduce((function(s,a){return s+t[a]*e[a]}),0)},e}(d),w=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}return t.prototype.equals=function(t){return this.x===t.x&&this.y===t.y},t.prototype.substract=function(e){return new t(this.x-e.x,this.y-e.y)},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.convertIntoPosition=function(t){return new y(t,this.x,this.y,0,0)},t.prototype.getDirectionTo=function(t){return this.x<t.x?this.y>t.y?u.RIGHT_UP:this.y===t.y?u.RIGHT:u.RIGHT_DOWN:this.x===t.x?this.y>t.y?u.UP:this.y===t.y?u.NO_DIRECTION:u.DOWN:this.y>t.y?u.LEFT_UP:this.y===t.y?u.LEFT:u.LEFT_DOWN},t.prototype.toString=function(){return"("+this.x+", "+this.y+")"},t}(),y=function(){function t(t,e,s,a,i){if(void 0===a&&(a=0),void 0===i&&(i=0),this._wwa=t,void 0===this._wwa)throw new Error("WWAのインスタンスが存在しません. ");var o=this._wwa.getMapWidth();if(e<0||e>=o||e>=o-1&&a>0||s<0||s>=o||s>=o-1&&i>0)throw new Error("範囲外の座標です!! parts:("+e+", "+s+"), offset:("+a+", "+i+"), mapWidth = "+o);this._partsCoord=new w(e,s),this._offsetCoord=new w(a,i)}return t.prototype.getPartsCoord=function(){return this._partsCoord},t.prototype.getOffsetCoord=function(){return this._offsetCoord},t.prototype.getScreenTopPosition=function(){var e=Math.floor(this._partsCoord.x/(Q.H_PARTS_NUM_IN_WINDOW-1))*(Q.H_PARTS_NUM_IN_WINDOW-1),s=Math.floor(this._partsCoord.y/(Q.V_PARTS_NUM_IN_WINDOW-1))*(Q.V_PARTS_NUM_IN_WINDOW-1);return new t(this._wwa,e,s,0,0)},t.prototype.getDefaultCameraPosition=function(){var t=this.getScreenTopPosition(),e=t.getPartsCoord(),s=this._wwa.getMapWidth(),a=t.getPartsCoord().clone();return e.x===s-1&&a.x--,e.y===s-1&&a.y--,a.convertIntoPosition(this._wwa).getScreenTopPosition()},t.prototype.getNextJustPosition=function(e){if(void 0!==e){var s=this._partsCoord;return new t(this._wwa,s.x+T[e],s.y+O[e],0,0)}var a=this._partsCoord.x,i=this._partsCoord.y;return this._offsetCoord.x<0?a--:this._offsetCoord.x>0&&a++,this._offsetCoord.y<0?i--:this._offsetCoord.y>0&&i++,new t(this._wwa,a,i,0,0)},t.prototype.getNextFramePosition=function(e,s,a){var i=this._partsCoord.x,o=this._partsCoord.y,r=this._offsetCoord.x+T[e]*s,n=this._offsetCoord.y+O[e]*a;if(r<0){var _=Math.floor(Math.abs(r)/Q.CHIP_SIZE);i-=_,r=(r+_*Q.CHIP_SIZE)%Q.CHIP_SIZE}if(n<0){var h=Math.floor(Math.abs(n)/Q.CHIP_SIZE);o-=h,n=(n+h*Q.CHIP_SIZE)%Q.CHIP_SIZE}return r>=Q.CHIP_SIZE&&(i+=Math.floor(r/Q.CHIP_SIZE),r=(r+Q.CHIP_SIZE)%Q.CHIP_SIZE),n>=Q.CHIP_SIZE&&(o+=Math.floor(n/Q.CHIP_SIZE),n=(n+Q.CHIP_SIZE)%Q.CHIP_SIZE),new t(this._wwa,i,o,r,n)},t.prototype.isJustPosition=function(){return 0==this._offsetCoord.x&&0==this._offsetCoord.y},t.prototype.isScreenTopPosition=function(){var t=this.getScreenTopPosition();return this.equals(t)},t.prototype.equals=function(t){return this._partsCoord.equals(t.getPartsCoord())&&this._offsetCoord.equals(t.getOffsetCoord())},t.prototype.isInCameraRange=function(t,e){void 0===e&&(e=!1);var s=t.getPosition()._partsCoord,a=this._partsCoord.x,i=this._partsCoord.y,o=e?1:0;return s.x<=a&&a<s.x+Q.H_PARTS_NUM_IN_WINDOW-o&&s.y<=i&&i<s.y+Q.V_PARTS_NUM_IN_WINDOW-o},t.prototype.hasLocalGate=function(){return this._wwa.getMapTypeByPosition(this)===Q.MAP_LOCALGATE||this._wwa.getObjectTypeByPosition(this)===Q.OBJECT_LOCALGATE},t.prototype.clone=function(){return new t(this._wwa,this._partsCoord.x,this._partsCoord.y,this._offsetCoord.x,this._offsetCoord.y)},t}(),m=function(t,e,s){this.destPos=t.clone(),this.srcPos=e.clone(),this.srcSize=s.clone()},f=function(t,e,s,a,i){this.partsIDObj=t,this.x=e,this.y=s,this.isStatic=a,this.isFighting=i};!function(t){t[t.GOTO_WWA=0]="GOTO_WWA",t[t.BATTLE_REPORT=1]="BATTLE_REPORT",t[t.GAME_END=2]="GAME_END"}(c||(c={})),function(t){t[t.LEFT=0]="LEFT",t[t.RIGHT=1]="RIGHT",t[t.DOWN=2]="DOWN",t[t.UP=3]="UP",t[t.LEFT_DOWN=4]="LEFT_DOWN",t[t.LEFT_UP=5]="LEFT_UP",t[t.RIGHT_DOWN=6]="RIGHT_DOWN",t[t.RIGHT_UP=7]="RIGHT_UP",t[t.NO_DIRECTION=8]="NO_DIRECTION"}(u||(u={}));var g,A,S,I,T=[-1,1,0,0,-1,-1,1,1,0],O=[0,0,1,-1,1,-1,1,-1,0],v=[4,6,2,0],D=[e.KEY_LEFT,e.KEY_RIGHT,e.KEY_DOWN,e.KEY_UP];!function(t){t[t.YES=0]="YES",t[t.NO=1]="NO",t[t.UNSELECTED=2]="UNSELECTED"}(g||(g={})),function(t){t[t.MAP=0]="MAP",t[t.OBJECT=1]="OBJECT",t[t.CHOICE_YES=2]="CHOICE_YES",t[t.CHOICE_NO=3]="CHOICE_NO"}(A||(A={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.CAN_USE=1]="CAN_USE",t[t.NOT_DISAPPEAR=2]="NOT_DISAPPEAR"}(S||(S={})),function(t){t[t.MAP=1]="MAP",t[t.OBJECT=0]="OBJECT"}(I||(I={}));var C,P,M,N,R,L,b,B,x,U=function(){function t(){var t=window.navigator.userAgent;this.os=this._getOS(t),this.browser=this.getBrowser(t),this.device=this.getDevice()}return t.prototype._getOS=function(t){return t.match(/xbox/i)?C.XBOX:t.match(/windows/i)?C.WINDOWS:t.match(/macintosh/i)?"ontouchstart"in document?C.IOS:C.MACINTOSH:t.match(/iphone|ipad|ipod/i)?C.IOS:t.match(/oculus/i)?C.OCULUS:t.match(/android/i)?C.ANDROID:t.match(/nintendo/i)?C.NINTENDO:t.match(/playstation/i)?C.PLAY_STATION:t.match(/linux/i)?C.LINUX:C.OTHERS},t.prototype.getBrowser=function(t){return t.match(/(?:msie|trident)/i)?M.INTERNET_EXPLORER:t.match(/edge/i)?M.EDGE:t.match(/chrome/i)?M.CHROME:t.match(/firefox/i)?M.FIREFOX:t.match(/safari/i)?M.SAFARI:M.OTHERS},t.prototype.getDevice=function(){switch(this.os){case C.WINDOWS:case C.MACINTOSH:case C.LINUX:return P.PC;case C.IOS:case C.ANDROID:return P.SP;case C.OCULUS:return P.VR;case C.NINTENDO:case C.PLAY_STATION:case C.XBOX:return P.GAME}return P.OTHERS},t}();!function(t){t[t.WINDOWS=1]="WINDOWS",t[t.MACINTOSH=2]="MACINTOSH",t[t.LINUX=3]="LINUX",t[t.ANDROID=4]="ANDROID",t[t.IOS=5]="IOS",t[t.NINTENDO=6]="NINTENDO",t[t.PLAY_STATION=7]="PLAY_STATION",t[t.OCULUS=8]="OCULUS",t[t.XBOX=9]="XBOX",t[t.OTHERS=9999]="OTHERS"}(C||(C={})),function(t){t[t.PC=1]="PC",t[t.SP=2]="SP",t[t.VR=3]="VR",t[t.GAME=4]="GAME",t[t.OTHERS=9999]="OTHERS"}(P||(P={})),function(t){t[t.CHROME=1]="CHROME",t[t.FIREFOX=2]="FIREFOX",t[t.SAFARI=3]="SAFARI",t[t.EDGE=4]="EDGE",t[t.INTERNET_EXPLORER=5]="INTERNET_EXPLORER",t[t.OTHERS=9999]="OTHERS"}(M||(M={})),function(t){t[t.NONE=0]="NONE",t[t.CALL_BY_MAP_PARTS=1]="CALL_BY_MAP_PARTS",t[t.CALL_BY_OBJECT_PARTS=2]="CALL_BY_OBJECT_PARTS",t[t.CALL_BY_ITEM_USE=3]="CALL_BY_ITEM_USE",t[t.CALL_BY_QUICK_SAVE=4]="CALL_BY_QUICK_SAVE",t[t.CALL_BY_QUICK_LOAD=5]="CALL_BY_QUICK_LOAD",t[t.CALL_BY_RESTART_GAME=6]="CALL_BY_RESTART_GAME",t[t.CALL_BY_GOTO_WWA=7]="CALL_BY_GOTO_WWA",t[t.CALL_BY_PASSWORD_SAVE=8]="CALL_BY_PASSWORD_SAVE",t[t.CALL_BY_PASSWORD_LOAD=9]="CALL_BY_PASSWORD_LOAD",t[t.CALL_BY_END_GAME=10]="CALL_BY_END_GAME",t[t.CALL_BY_SUSPEND=11]="CALL_BY_SUSPEND",t[t.CALL_BY_LOG_QUICK_SAVE=12]="CALL_BY_LOG_QUICK_SAVE",t[t.CALL_BY_LOG_QUICK_LOAD=13]="CALL_BY_LOG_QUICK_LOAD"}(N||(N={})),function(t){t[t.QUICK_LOAD=0]="QUICK_LOAD",t[t.QUICK_SAVE=1]="QUICK_SAVE",t[t.RESTART_GAME=2]="RESTART_GAME",t[t.GOTO_WWA=3]="GOTO_WWA"}(R||(R={})),function(t){t[t.UP=0]="UP",t[t.DOWN=1]="DOWN"}(L||(L={})),function(t){t[t.QUICK_LOAD=0]="QUICK_LOAD",t[t.RESTART_GAME=1]="RESTART_GAME",t[t.PASSWORD=2]="PASSWORD"}(b||(b={})),function(t){t[t.STATIC=0]="STATIC",t[t.CHASE_PLAYER=1]="CHASE_PLAYER",t[t.RUN_OUT=2]="RUN_OUT",t[t.HANG_AROUND=3]="HANG_AROUND"}(B||(B={})),function(t){t[t.MODE_X=0]="MODE_X",t[t.MODE_Y=1]="MODE_Y",t[t.UNDECIDED=2]="UNDECIDED"}(x||(x={}));var W,Y,k,F=["cell-load","cell-save","cell-restart","cell-gotowwa"];!function(t){t[t.ASK_LINK=5]="ASK_LINK",t[t.NO_MONEY=6]="NO_MONEY",t[t.NO_ITEM=7]="NO_ITEM",t[t.USE_ITEM=8]="USE_ITEM"}(W||(W={})),function(t){t[t.CLICKABLE_ITEM=0]="CLICKABLE_ITEM",t[t.FULL_ITEM=1]="FULL_ITEM",t[t.LOAD_SE=2]="LOAD_SE"}(Y||(Y={})),function(t){t[t.UNDEFINED=0]="UNDEFINED",t[t.IMGPLAYER=1]="IMGPLAYER",t[t.IMGYESNO=2]="IMGYESNO",t[t.HPMAX=3]="HPMAX",t[t.SAVE=4]="SAVE",t[t.ITEM=5]="ITEM",t[t.DEFAULT=6]="DEFAULT",t[t.OLDMAP=7]="OLDMAP",t[t.PARTS=8]="PARTS",t[t.MOVE=9]="MOVE",t[t.MAP=10]="MAP",t[t.DIRMAP=11]="DIRMAP",t[t.IMGFRAME=12]="IMGFRAME",t[t.IMGBOM=13]="IMGBOM",t[t.DELPLAYER=14]="DELPLAYER",t[t.FACE=15]="FACE",t[t.EFFECT=16]="EFFECT",t[t.GAMEOVER=17]="GAMEOVER",t[t.IMGCLICK=18]="IMGCLICK",t[t.STATUS=19]="STATUS",t[t.EFFITEM=20]="EFFITEM",t[t.COLOR=21]="COLOR",t[t.WAIT=22]="WAIT",t[t.SOUND=23]="SOUND",t[t.JUMPGATE=24]="JUMPGATE",t[t.RECPOSITION=25]="RECPOSITION",t[t.JUMPRECPOSITION=26]="JUMPRECPOSITION",t[t.CONSOLE_LOG=27]="CONSOLE_LOG",t[t.COPY_HP_TO=28]="COPY_HP_TO",t[t.SET_HP=29]="SET_HP",t[t.COPY_HPMAX_TO=30]="COPY_HPMAX_TO",t[t.SET_HPMAX=31]="SET_HPMAX",t[t.COPY_AT_TO=32]="COPY_AT_TO",t[t.SET_AT=33]="SET_AT",t[t.COPY_DF_TO=34]="COPY_DF_TO",t[t.SET_DF=35]="SET_DF",t[t.COPY_MONEY_TO=36]="COPY_MONEY_TO",t[t.SET_MOENEY=37]="SET_MOENEY",t[t.COPY_STEP_COUNT_TO=38]="COPY_STEP_COUNT_TO",t[t.VAR_SET_VAL=39]="VAR_SET_VAL",t[t.VAR_SET=40]="VAR_SET",t[t.VAR_ADD=41]="VAR_ADD",t[t.VAR_SUB=42]="VAR_SUB",t[t.VAR_MUL=43]="VAR_MUL",t[t.VAR_DIV=44]="VAR_DIV",t[t.VAR_SET_RAND=45]="VAR_SET_RAND",t[t.SHOW_STR=46]="SHOW_STR",t[t.GAME_SPEED=47]="GAME_SPEED",t[t.IF=50]="IF",t[t.SET_SPEED=51]="SET_SPEED",t[t.COPY_TIME_TO=52]="COPY_TIME_TO",t[t.HIDE_STATUS=53]="HIDE_STATUS",t[t.VAR_MAP=54]="VAR_MAP",t[t.VAR_MOD=55]="VAR_MOD",t[t.GAMEPAD_BUTTON=100]="GAMEPAD_BUTTON",t[t.OLDMOVE=101]="OLDMOVE"}(k||(k={}));var G,H,K,V={"":0,$imgplayer:1,$imgyesno:2,$hpmax:3,$save:4,$item:5,$default:6,$oldmap:7,$parts:8,$move:9,$map:10,$dirmap:11,$imgframe:12,$imgbom:13,$delplayer:14,$face:15,$effect:16,$gameover:17,$imgclick:18,$status:19,$effitem:20,$color:21,$wait:22,$sound:23,$jumpgate:24,$rec_pos:25,$jump_rec_pos:26,$console_log:27,$copy_hp_to:28,$set_hp:29,$copy_hpmax_to:30,$set_hpmax:31,$copy_at_to:32,$set_at:33,$copy_df_to:34,$set_df:35,$copy_money_to:36,$set_money:37,$copy_step_count_to:38,$var_set_val:39,$var_set:40,$var_add:41,$var_sub:42,$var_mul:43,$var_div:44,$var_set_rand:45,$show_str:46,$game_speed:47,$if:50,$set_speed:51,$copy_time_to:52,$hide_status:53,$var_map:54,$var_mod:55,$gamepad_button:100,$oldmove:101};!function(t){t[t.ENERGY=0]="ENERGY",t[t.STRENGTH=1]="STRENGTH",t[t.DEFENCE=2]="DEFENCE",t[t.GOLD=3]="GOLD",t[t.MOVES=4]="MOVES"}(G||(G={})),function(t){t[t.ENERGY=0]="ENERGY",t[t.STRENGTH=1]="STRENGTH",t[t.DEFENCE=2]="DEFENCE",t[t.GOLD=3]="GOLD",t[t.WIDE_CELL_ROW=4]="WIDE_CELL_ROW",t[t.ITEM_BG=5]="ITEM_BG",t[t.MAIN_FRAME=6]="MAIN_FRAME"}(H||(H={})),function(t){t[t.DECISION=1]="DECISION",t[t.ATTACK=3]="ATTACK",t[t.BGM_LB=70]="BGM_LB",t[t.NO_SOUND=99]="NO_SOUND"}(K||(K={}));var j,X=[1,2,5,8,10,20],J=["超低速","低速","準低速","中速","高速","超高速"],Z=["energy","strength","defence","gold"],Q=function(){function t(){}return t.WWA_HOME="http://wwajp.com",t.ITEMBOX_SIZE=12,t.MAP_ATR_MAX=60,t.OBJ_ATR_MAX=60,t.OLD_MAP_ATR_MAX=40,t.OLD_OBJ_ATR_MAX=40,t.ATR_TYPE=3,t.ATR_MODE=4,t.ATR_STRING=5,t.ATR_X=6,t.ATR_Y=7,t.ATR_X2=8,t.ATR_Y2=9,t.ATR_ENERGY=10,t.ATR_STRENGTH=11,t.ATR_DEFENCE=12,t.ATR_GOLD=13,t.ATR_ITEM=14,t.ATR_NUMBER=15,t.ATR_JUMP_X=16,t.ATR_MOVE=16,t.ATR_JUMP_Y=17,t.ATR_SOUND=19,t.ATR_APPERANCE_BASE=20,t.REL_ATR_APPERANCE_ID=0,t.REL_ATR_APPERANCE_X=1,t.REL_ATR_APPERANCE_Y=2,t.REL_ATR_APPERANCE_TYPE=3,t.REL_ATR_APPERANCE_UNIT_LENGTH=4,t.ATR_RANDOM_BASE=10,t.RANDOM_ATR_NUM=10,t.RANDOM_ITERATION_MAX=10,t.MAP_STREET=0,t.MAP_WALL=1,t.MAP_LOCALGATE=2,t.MAP_URLGATE=4,t.OBJECT_NORMAL=0,t.OBJECT_MESSAGE=1,t.OBJECT_URLGATE=2,t.OBJECT_STATUS=3,t.OBJECT_ITEM=4,t.OBJECT_DOOR=5,t.OBJECT_MONSTER=6,t.OBJECT_SCORE=11,t.OBJECT_SELL=14,t.OBJECT_BUY=15,t.OBJECT_RANDOM=16,t.OBJECT_SELECT=17,t.OBJECT_LOCALGATE=18,t.SYSTEM_MESSAGE_NUM=20,t.IMGPOS_DEFAULT_YESNO_X=3,t.IMGPOS_DEFAULT_YESNO_Y=1,t.IMGRELPOS_YESNO_YES_X=0,t.IMGRELPOS_YESNO_NO_X=1,t.IMGRELPOS_YESNO_YESP_X=2,t.IMGRELPOS_YESNO_NOP_X=3,t.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_X=0,t.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_Y=0,t.IMGPOS_DEFAULT_FRAME_X=0,t.IMGPOS_DEFAULT_FRAME_Y=1,t.IMGPOS_DEFAULT_BATTLE_EFFECT_X=3,t.IMGPOS_DEFAULT_BATTLE_EFFECT_Y=3,t.DEFAULT_DISABLE_SAVE=!1,t.DEFAULT_OLDMAP=!1,t.DEFAULT_OBJECT_NO_COLLAPSE=!1,t.SPLASH_SCREEN_DISP_MILLS=100,t.DEFAULT_FRAME_INTERVAL=20,t.GAMEOVER_FRAME_INTERVAL=50,t.YESNO_PRESS_DISP_FRAME_NUM=20,t.WAIT_TIME_FRAME_NUM=6,t.CHIP_SIZE=40,t.MAP_WINDOW_WIDTH=440,t.MAP_WINDOW_HEIGHT=440,t.H_PARTS_NUM_IN_WINDOW=t.MAP_WINDOW_WIDTH/t.CHIP_SIZE,t.V_PARTS_NUM_IN_WINDOW=t.MAP_WINDOW_HEIGHT/t.CHIP_SIZE,t.MIN_SPEED_INDEX=0,t.MAX_SPEED_INDEX=X.length-1,t.QUICK_BATTLE_SPEED_INDECIES=[X.length-2,X.length-1],t.ANIMATION_REP_HALF_FRAME=22,t.PLAYER_LOOKING_AROUND_START_FRAME=4*t.ANIMATION_REP_HALF_FRAME,t.RELATIVE_COORD_BIAS=1e4,t.RELATIVE_COORD_LOWER=t.RELATIVE_COORD_BIAS-1e3,t.PLAYER_COORD=t.RELATIVE_COORD_BIAS-1e3,t.LOCALGATE_PLAYER_WAIT_FRAME=5,t.STATUS_CHANGED_EFFECT_FRAME_NUM=20,t.PASSABLE_OBJECT=1,t.APPERANCE_PARTS_MIN_INDEX=0,t.APPERANCE_PARTS_MAX_INDEX=9,t.APPERANCE_PARTS_MIN_INDEX_NO=5,t.APPERANCE_PARTS_MAX_INDEX_YES=4,t.FADEOUT_SPEED=8,t.STATUS_MINUS_BORDER=3e4,t.ITEMBOX_IS_FULL=-1,t.BATTLE_INTERVAL_FRAME_NUM=10,t.BATTLE_SPEED_CHANGE_TURN_NUM=40,t.RANDOM_MOVE_ITERATION_NUM=50,t.RANDOM_MOVE_ITERATION_NUM_BEFORE_V31=8,t.BATTLE_ESTIMATE_MONSTER_TYPE_MAX=8,t.SOUND_MAX=100,t.ITEM_BORDER_IMG_DATA_URL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAArklEQVRYR+2Y0QqAIAxFt///aENJHwxxuJUSxzeh3S7HXaNpEkly4FIRzba0GEyHeVTN7jqDWvb7V4Y1NLibZIY0NbiL5G3MZLCe / 1fn3XJgJYjB7mgg6O1VCEKwXo79JeklY62nB62kRs9BEIKkeNIDhISQEBJC4k0BBCF4D7D4cV9shf99ixdB + MrM0y3fa3zV05D45GOqhwPMGPkYlccIOEY2VKUN0UNVXxC7ADj7mDi9aFZZAAAAAElFTkSuQmCC",t.LOAD_STAGE_MAX_EXCEPT_AUDIO=7,t.WWA_STYLE_TAG_ID="wwa-additional-style",t.DEFAULT_FRAME_COLOR_R=255,t.DEFAULT_FRAME_COLOR_G=255,t.DEFAULT_FRAME_COLOR_B=255,t.DEFAULT_FRAMEOUT_COLOR_R=96,t.DEFAULT_FRAMEOUT_COLOR_G=96,t.DEFAULT_FRAMEOUT_COLOR_B=96,t.DEFAULT_STRBACK_COLOR_R=0,t.DEFAULT_STRBACK_COLOR_G=0,t.DEFAULT_STRBACK_COLOR_B=0,t.DEFAULT_STATUS_COLOR_R=0,t.DEFAULT_STATUS_COLOR_G=0,t.DEFAULT_STATUS_COLOR_B=0,t.KEYPRESS_MESSAGE_CHANGE_FRAME_NUM=20,t.WWAP_SERVER_OLD="http://wwawing.com/wwap",t.WWAP_SERVER="https://wwaphoenix.github.io",t.WWAP_SERVER_AUDIO_DIR="audio",t.WWAP_SERVER_TITLE_IMG="cover_p.gif",t.WWAP_SERVER_LOADER_NO_WORKER="wwaload.noworker.js",t.SCREEN_WIDTH=560,t.SCREEN_HEIGHT=440,t.LOADING_FONT="Times New Roman",t.MSG_STR_WIDTH=16,t.ITEM_EFFECT_SPEED_PIXEL_PER_FRAME=20,t.ITEMBOX_TOP_Y=140,t.USER_VAR_NUM=256,t.USER_VAR_NUM_MAX_VALUE=9007199254740991,t.USET_VAR_NUM_MIN_VALUE=-9007199254740991,t.CONTROLL_WAIT_FRAME=6,t}(),q=function(){function t(){}return t.QUICK_SAVE_MAX=4,t.QUICK_SAVE_THUMNAIL_WIDTH=99,t.QUICK_SAVE_THUMNAIL_HEIGHT=99,t.SAVE_INTERVAL_MOVE=200,t.INDEXEDDB_DB_NAME="WWA_WING_DB",t.INDEXEDDB_TABLE_NAME="SAVE_TABLE",t.DATE_LAST_SAVE_TEXT_COLOR="rgba(255,255,0,1)",t}(),z=function(){function t(){}return t.EMPTY_LOAD="",t.EMPTY_SAVE="",t.PASSWORD="Password",t.QUICK_SAVE="Quick Save",t.QUICK_LOAD="Quick Load",t.BATTLE_REPORT="Battle Report",t.GAME_END="Game End",t.GOTO_WWA="Goto WWA",t.RESTART_GAME="Restart Game",t}(),$=function(){};!function(t){t[t.INIT=0]="INIT",t[t.MAP_LOAD=1]="MAP_LOAD",t[t.OBJ_LOAD=2]="OBJ_LOAD",t[t.MAP_ATTR=3]="MAP_ATTR",t[t.OBJ_ATTR=4]="OBJ_ATTR",t[t.RAND_PARTS=5]="RAND_PARTS",t[t.MESSAGE=6]="MESSAGE",t[t.GAME_INIT=7]="GAME_INIT",t[t.AUDIO=8]="AUDIO",t[t.FINISH=9]="FINISH"}(j||(j={}));var tt,et,st,at,it,ot=["ロードの準備をしています。","背景パーツを読み込んでいます。","物体パーツを読み込んでます。","背景パーツの属性を読み込んでます。","物体パーツの属性を読み込んでます。","ランダムパーツを置換しています。","メッセージを読み込んでます。","Welcome to WWA Wing!"],rt=["Welcome to WWA Wing!","Now Map Data Loading .....","Now CG Data Loading .....","Now Making chara CG ....."];!function(t){t[t.LINE=30]="LINE",t[t.TITLE_X=100]="TITLE_X",t[t.TITLE_Y=70]="TITLE_Y",t[t.LOADING_X=50]="LOADING_X",t[t.LOADING_Y=140]="LOADING_Y",t[t.ERROR_X=10]="ERROR_X",t[t.ERROR_Y=180]="ERROR_Y",t[t.FOOTER_X=160]="FOOTER_X",t[t.FOOTER_Y=360]="FOOTER_Y",t[t.WORLD_Y=330]="WORLD_Y",t[t.COPYRIGHT_Y=390]="COPYRIGHT_Y"}(tt||(tt={})),function(t){t[t.TITLE=32]="TITLE",t[t.LOADING=22]="LOADING",t[t.FOOTER=18]="FOOTER",t[t.ERRROR=16]="ERRROR"}(et||(et={})),function(t){t[t.COLOR_FRAME=0]="COLOR_FRAME",t[t.COLOR_FRAMEOUT=1]="COLOR_FRAMEOUT",t[t.COLOR_STR=2]="COLOR_STR",t[t.COLOR_STATUS_STR=4]="COLOR_STATUS_STR"}(st||(st={})),function(t){t[t.MESSAGE_WINDOW=0]="MESSAGE_WINDOW",t[t.SIDEBAR=1]="SIDEBAR"}(at||(at={})),function(t){t[t.BITSHIFT=16]="BITSHIFT",t[t.BITMASK=65535]="BITMASK"}(it||(it={}));var nt,_t=function(t){return document.getElementById(t)},ht=function(t){return document.querySelector(t)},ct=function(t){return document.querySelector(t)},ut=function(t){return document.querySelectorAll(t)},lt=function(t,e){var s,a,i=window.pageXOffset||document.body.scrollLeft||document.documentElement.scrollLeft,o=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop;return s=t-_t("wwa-wrapper").offsetLeft+i,a=e-_t("wwa-wrapper").offsetTop+o,new w(s,a)},pt=function(t){return t.match(/^https?:\/\//)||t.match(/^\.\.\//)?t:location.href="./"+t},dt=function(t){var e="";if(t instanceof Array){for(var s=0;s<t.length;s++)e+=dt(t[s])+"/";return e}return t+""},Et=function(){function t(t,e,s){this.cvs=document.createElement("canvas"),this.cvs.width=t,this.cvs.height=e,this.ctx=this.cvs.getContext("2d",{alpha:s}),this._isTransparent=s}return t.prototype.drawCanvas=function(t,e,s,a,i){this.ctx.drawImage(t,Q.CHIP_SIZE*e,Q.CHIP_SIZE*s,Q.CHIP_SIZE,Q.CHIP_SIZE,a,i,Q.CHIP_SIZE,Q.CHIP_SIZE)},t.prototype.clear=function(){this.clearRect(0,0,this.cvs.width,this.cvs.height)},t.prototype.clearRectWithLowerYLimit=function(t){this.clearRect(0,0,this.cvs.width,t)},t.prototype.clearRect=function(t,e,s,a){this._isTransparent?this.ctx.clearRect(t,e,s,a):(this.ctx.fillStyle="#9E9E9E",this.ctx.fillRect(t,e,s,a))},t}(),wt=function(){function t(t,e,s,a){var i;for(this._isLoaded=!1,this.mapCache=void 0,this.mapObjectCache=void 0,this.mapCacheYLimit=0,this._frameCanvas=new Et(Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW,!0),this._backCanvas=new Et(Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW,!1),this._objectCanvases=[],this._effectCanvases=[],i=0;i<2;i++)this._objectCanvases[i]=new Et(Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW,!0);this._ctx=t,this._fileName=e,this._loadCompleteCallBack=a,this._load(),this._frameCoord=s.clone(),this.cpPartsLog=new w(0,0)}return t.prototype._load=function(){var t=this;this._frameCoord,this._isLoaded||(this.mapCache=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],this.mapObjectCache=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],this._image=new Image,this._image.addEventListener("load",(function(){t.createFrame(),t._loadCompleteCallBack()})),this._image.addEventListener("error",(function(){throw new Error("Image Load Failed!!\nfile name:"+t._fileName)})),this._image.src=this._fileName,this._isLoaded=!0)},t.prototype.createFrame=function(){this._frameCanvas.clear(),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y,0,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y,Q.MAP_WINDOW_WIDTH-Q.CHIP_SIZE,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y+2,0,Q.MAP_WINDOW_HEIGHT-Q.CHIP_SIZE),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y+2,Q.MAP_WINDOW_WIDTH-Q.CHIP_SIZE,Q.MAP_WINDOW_HEIGHT-Q.CHIP_SIZE);for(var t=1;t<Q.H_PARTS_NUM_IN_WINDOW-1;t++)this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+1,this._frameCoord.y,Q.CHIP_SIZE*t,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+1,this._frameCoord.y+2,Q.CHIP_SIZE*t,Q.MAP_WINDOW_HEIGHT-Q.CHIP_SIZE);for(t=1;t<Q.V_PARTS_NUM_IN_WINDOW-1;t++)this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y+1,0,Q.CHIP_SIZE*t),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y+1,Q.MAP_WINDOW_WIDTH-Q.CHIP_SIZE,Q.CHIP_SIZE*t)},t.prototype.updateEffects=function(t){var e;if(t){var s,a=t.length;for(e=0;e<a;e++){var i=t[e];(s=this._effectCanvases[e])?s.clear():s=this._effectCanvases[e]=new Et(Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW,!0);for(var o=0;o<Q.V_PARTS_NUM_IN_WINDOW;o++)for(var r=0;r<Q.H_PARTS_NUM_IN_WINDOW;r++)s.drawCanvas(this._image,i.x,i.y,r*Q.CHIP_SIZE,o*Q.CHIP_SIZE)}}},t.prototype.drawFrame=function(){this._ctx.drawImage(this._frameCanvas.cvs,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE),this._ctx.drawImage(this._frameCanvas.cvs,0,Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-1),Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE,0,Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-1),Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE),this._ctx.drawImage(this._frameCanvas.cvs,0,Q.CHIP_SIZE,Q.CHIP_SIZE,Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-2),0,Q.CHIP_SIZE,Q.CHIP_SIZE,Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-2)),this._ctx.drawImage(this._frameCanvas.cvs,Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-1),Q.CHIP_SIZE,Q.CHIP_SIZE,Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-2),Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-1),Q.CHIP_SIZE,Q.CHIP_SIZE,Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-2))},t.prototype.drawEffect=function(t){var e=this._effectCanvases[t];e&&this._ctx.drawImage(e.cvs,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW)},t.prototype.drawCanvas=function(t,e,s,a){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._image,Q.CHIP_SIZE*t,Q.CHIP_SIZE*e,Q.CHIP_SIZE,Q.CHIP_SIZE,s,a,Q.CHIP_SIZE,Q.CHIP_SIZE)},t.prototype.drawCanvasWithSize=function(t,e,s,a,i,o){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._image,Q.CHIP_SIZE*t,Q.CHIP_SIZE*e,Q.CHIP_SIZE*s,Q.CHIP_SIZE*a,i,o,Q.CHIP_SIZE*s,Q.CHIP_SIZE*a)},t.prototype.drawCanvasWithUpperYLimit=function(t,e,s,a,i){if(!this._isLoaded)throw new Error("No image was loaded.");var o=Math.max(0,a+Q.CHIP_SIZE-i);o>=Q.CHIP_SIZE||this._ctx.drawImage(this._image,Q.CHIP_SIZE*t,Q.CHIP_SIZE*e,Q.CHIP_SIZE,Q.CHIP_SIZE-o,s,a,Q.CHIP_SIZE,Q.CHIP_SIZE)},t.prototype.copyCanvas=function(t,e){var s=this;return function(a,i,o,r,n){if(!s._isLoaded)throw new Error("No image was loaded.");var _=Math.max(0,e(r,n));_>=Q.CHIP_SIZE||t.ctx.drawImage(s._image,Q.CHIP_SIZE*a,Q.CHIP_SIZE*i+_,Q.CHIP_SIZE,Q.CHIP_SIZE-_,o,r+_,Q.CHIP_SIZE,Q.CHIP_SIZE)}},t.prototype.copyBackCanvasWithUpperYLimit=function(t,e,s,a,i){this.copyCanvas(this._backCanvas,(function(t,e){return t+Q.CHIP_SIZE-e}))(t,e,s,a,i)},t.prototype.copyBackCanvasWithLowerYLimit=function(t,e,s,a,i){this.copyCanvas(this._backCanvas,(function(t,e){return e-t}))(t,e,s,a,i)},t.prototype.copyObjectCanvasWithUpperYLimit=function(t,e,s,a,i,o){this.copyCanvas(this._objectCanvases[t],(function(t,e){return t+Q.CHIP_SIZE-e}))(e,s,a,i,o)},t.prototype.copyObjectCanvasWithLowerYLimit=function(t,e,s,a,i,o){this.copyCanvas(this._objectCanvases[t],(function(t,e){return e-t}))(e,s,a,i,o)},t.prototype.drawBackCanvas=function(){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._backCanvas.cvs,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW)},t.prototype.drawObjectCanvas=function(t){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._objectCanvases[t].cvs,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW)},t.prototype.clearBackCanvas=function(){this._backCanvas.clear()},t.prototype.clearBackCanvasWithLowerYLimit=function(t){this._backCanvas.clearRectWithLowerYLimit(t)},t.prototype.clearObjectCanvases=function(){var t;for(t=0;t<2;t++)this._objectCanvases[t].clear()},t.prototype.clearObjectCanvasesWithLowerYLimit=function(t){var e;for(e=0;e<2;e++)this._objectCanvases[e].clearRectWithLowerYLimit(t)},t.prototype.drawCanvasWithLowerYLimit=function(t,e,s,a,i){if(!this._isLoaded)throw new Error("No image was loaded.");var o=Math.max(0,i-a);o>=Q.CHIP_SIZE||this._ctx.drawImage(this._image,Q.CHIP_SIZE*t,Q.CHIP_SIZE*e+o,Q.CHIP_SIZE,Q.CHIP_SIZE-o,s,a+o,Q.CHIP_SIZE,Q.CHIP_SIZE)},t.prototype.clearCanvas=function(t,e,s,a){this._ctx.clearRect(t,e,s,a)},t.prototype.drawBase=function(t,e,s,a){this._ctx.fillStyle="#9E9E9E",this._ctx.fillRect(t,e,s,a)},t.prototype.setFrameImage=function(t){this._frameCoord=t,this.createFrame()},t}(),yt=function(){function t(t){this._position=null,this.reset(t)}return t.prototype.setPlayer=function(t){this._player=t},t.prototype.isResetting=function(){return this._isResetting},t.prototype.getPosition=function(){return this._position},t.prototype.getPreviousPosition=function(){return this._positionPrev},t.prototype.resetPreviousPosition=function(){this._positionPrev=null},t.prototype.move=function(t){var e=X[this._player.getSpeedIndex()];this._position=this._position.getNextFramePosition(t,e*(Q.H_PARTS_NUM_IN_WINDOW-1),e*(Q.V_PARTS_NUM_IN_WINDOW-1))},t.prototype.getTransitionStepNum=function(){return this._transitionStep},t.prototype.advanceTransitionStepNum=function(){return++this._transitionStep,this._transitionStep===Q.V_PARTS_NUM_IN_WINDOW&&(this._isResetting=!1,this._transitionStep=0),this._transitionStep},t.prototype.isFinalStep=function(){if(!1===this._isResetting)throw new Error("リセット中ではありません。");return this._transitionStep===Q.V_PARTS_NUM_IN_WINDOW-1},t.prototype.reset=function(t){this._positionPrev=this._position,this._position=t.getDefaultCameraPosition(),this._transitionStep=0,this._isResetting=!0},t}(),mt=function(){var t=function(e,s){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},t(e,s)};return function(e,s){if("function"!=typeof s&&null!==s)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function a(){this.constructor=e}t(e,s),e.prototype=null===s?Object.create(s):(a.prototype=s.prototype,new a)}}(),ft=function(){function t(t){this._position=t}return t.prototype.getPosition=function(){return this._position},t}(),gt=function(t){function e(e){return t.call(this,e)||this}return mt(e,t),e}(ft);!function(t){function e(e){return t.call(this,e)||this}mt(e,t)}(ft);!function(t){t[t.CONTROLLABLE=0]="CONTROLLABLE",t[t.MOVING=1]="MOVING",t[t.CAMERA_MOVING=2]="CAMERA_MOVING",t[t.MESSAGE_WAITING=3]="MESSAGE_WAITING",t[t.LOCALGATE_JUMPED=4]="LOCALGATE_JUMPED",t[t.BATTLE=5]="BATTLE",t[t.ESTIMATE_WINDOW_WAITING=6]="ESTIMATE_WINDOW_WAITING",t[t.PASSWORD_WINDOW_WAITING=7]="PASSWORD_WINDOW_WAITING",t[t.LOCALGATE_JUMPED_WITH_MESSAGE=8]="LOCALGATE_JUMPED_WITH_MESSAGE"}(nt||(nt={}));var At=function(t){function e(e,s,a,i,o,r,n){var _=t.call(this,s)||this;_.itemTransitioningClassName="item-transitioning",_.overwittenItemClassName="item-overwritten",_.overwittenItemSelector=".".concat(_.overwittenItemClassName),_.itemEffectStartTimers=new Array(Q.ITEMBOX_SIZE),_._status=i,_._equipStatus=new d(0,0),_._itemBox=new Array(Q.ITEMBOX_SIZE),_._itemBoxElement=new Array(Q.ITEMBOX_SIZE),_._itemUsingEvent=new Array(Q.ITEMBOX_SIZE);for(var h=0;h<_._itemBox.length;h++)_._itemBox[h]=0,_._itemBoxElement[h]=ct("#item"+h+">.item-disp");return _.updateItemBox(),_._energyMax=o,_._dir=u.DOWN,_._isMovingImage=!1,_._wwa=e,_._state=nt.CONTROLLABLE,_._camera=a,_._isPartsEventExecuted=!1,_._energyValueElement=ct("#disp-energy>.status-value-box"),_._strengthValueElement=ct("#disp-strength>.status-value-box"),_._defenceValueElement=ct("#disp-defence>.status-value-box"),_._goldValueElement=ct("#disp-gold>.status-value-box"),_._isReadyToUseItem=!1,_._isClickableItemGot=!1,_._moves=r,_._frameCount=0,_._moveMacroWaitingRemainMoves=0,_._moveObjectAutoExecTimer=0,_.updateStatusValueBox(),_._partsAppeared=!1,_._afterMoveMacroFlag=!1,_._isPreparedForLookingAround=!0,_._lookingAroundTimer=Q.PLAYER_LOOKING_AROUND_START_FRAME,_._speedIndex=n,_._messageDelayFrameCount=0,_}return mt(e,t),e.prototype.move=function(){if(this.isControllable())this.controll(this._dir);else if(this._state===nt.CAMERA_MOVING){try{this._camera.move(this._dir)}catch(t){}this._isOnCameraStopPosition()&&(this._state=nt.CONTROLLABLE)}else if(this._state===nt.MOVING){try{var t=this._position.getNextFramePosition(this._dir,X[this._speedIndex],X[this._speedIndex])}catch(t){}t.isJustPosition()&&(this._state=nt.CONTROLLABLE,this.toggleMovingImage(),this._moves++,this._isPartsEventExecuted=!1,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0),this._position=t}},e.prototype.controll=function(t){var e,s;if(this.isControllable()){this._isPreparedForLookingAround=!1,this._dir=t;try{e=this._position.getNextFramePosition(this._dir,X[this._speedIndex],X[this._speedIndex]),s=this._position.getNextJustPosition(t)}catch(t){return}if(this._isOnCameraMovingPosition()){if(0!==this._wwa.getMapIdByPosition(s)||this._wwa.isOldMap()||this._wwa.debug)try{this._camera.move(this._dir),this._state=nt.CAMERA_MOVING}catch(t){this._state=nt.CONTROLLABLE}return}if(!this.canMoveTo(s))return this._wwa.getMapTypeByPosition(s)===Q.MAP_WALL&&this._wwa.checkMap(s.getPartsCoord()),void this._wwa.checkObject(s.getPartsCoord());this._position=e,this._state=nt.MOVING,this._wwa.getMapAttributeByPosition(this._position.getNextJustPosition(t),Q.ATR_TYPE)!==Q.MAP_LOCALGATE&&this._wwa.moveObjects(!0)}},e.prototype.setDir=function(t){this._isPreparedForLookingAround=!1,this._dir=t},e.prototype.canMoveTo=function(t){if(null===t)return!1;if(this._wwa.debug)return!0;this._wwa.getMapWidth(),t.getPartsCoord(),t.getOffsetCoord();return!(0===this._wwa.getMapIdByPosition(t)&&!this._wwa.isOldMap())&&(this._wwa.getMapTypeByPosition(t)!==Q.MAP_WALL&&(0===this._wwa.getObjectIdByPosition(t)||(this._wwa.getObjectTypeByPosition(t)===Q.OBJECT_NORMAL&&this._wwa.getObjectAttributeByPosition(t,Q.ATR_MODE)===Q.PASSABLE_OBJECT||this._wwa.getObjectTypeByPosition(t)===Q.OBJECT_DOOR&&this._wwa.getObjectAttributeByPosition(t,Q.ATR_NUMBER)===Q.PASSABLE_OBJECT&&!this.hasItem(this._wwa.getObjectAttributeByPosition(t,Q.ATR_ITEM)))))},e.prototype.isMoving=function(){return this._state==nt.MOVING||this._state==nt.CAMERA_MOVING},e.prototype._isOnCameraMovingPosition=function(){var t=this._camera.getPosition().getPartsCoord(),e=this.getPosition().getPartsCoord();return e.x-t.x==Q.H_PARTS_NUM_IN_WINDOW-1&&this._dir===u.RIGHT||e.x===t.x&&this._dir===u.LEFT||e.y-t.y==Q.V_PARTS_NUM_IN_WINDOW-1&&this._dir===u.DOWN||e.y===t.y&&this._dir===u.UP},e.prototype._isOnCameraStopPosition=function(){var t=this._camera.getPosition().getPartsCoord(),e=this.getPosition().getPartsCoord();return e.x-t.x==Q.H_PARTS_NUM_IN_WINDOW-1&&this._dir===u.LEFT||e.x===t.x&&this._dir===u.RIGHT||e.y-t.y==Q.V_PARTS_NUM_IN_WINDOW-1&&this._dir===u.UP||e.y===t.y&&this._dir===u.DOWN},e.prototype.isControllable=function(){var t=this._afterMoveMacroFlag;return this._afterMoveMacroFlag=!1,this._state===nt.CONTROLLABLE&&!this._partsAppeared&&(this._wwa.getMapTypeByPosition(this._position)!==Q.MAP_LOCALGATE&&this._wwa.getMapTypeByPosition(this._position)!==Q.MAP_URLGATE||!this._wwa.isPrevFrameEventExecuted())&&0===this._moveMacroWaitingRemainMoves&&0===this._moveObjectAutoExecTimer&&!t&&this._wwa.canInput()},e.prototype.getCopyOfItemBox=function(){return this._itemBox.slice()},e.prototype.getDir=function(){return this._dir},e.prototype.isMovingImage=function(){return this._isMovingImage},e.prototype.toggleMovingImage=function(){this._isMovingImage?this._isMovingImage=!1:this._isMovingImage=!0},e.prototype.getEnergyMax=function(){return this._energyMax},e.prototype.isJumped=function(){return this._state===nt.LOCALGATE_JUMPED||this._state===nt.LOCALGATE_JUMPED_WITH_MESSAGE},e.prototype.setMessageWaiting=function(){this._state=nt.MESSAGE_WAITING},e.prototype.isWaitingMessage=function(){return this._state===nt.MESSAGE_WAITING},e.prototype.isDelayFrame=function(){return this._messageDelayFrameCount>0},e.prototype.updateDelayFrame=function(){this._messageDelayFrameCount--},e.prototype.setDelayFrame=function(){this._messageDelayFrameCount=1},e.prototype.clearMessageWaiting=function(){this._state===nt.MESSAGE_WAITING&&(this._state=nt.CONTROLLABLE,this._isPartsEventExecuted=!0,this._isPreparedForLookingAround&&(this._lookingAroundTimer=Q.PLAYER_LOOKING_AROUND_START_FRAME))},e.prototype.setEstimateWindowWating=function(){this._state=nt.ESTIMATE_WINDOW_WAITING},e.prototype.isWatingEstimateWindow=function(){return this._state===nt.ESTIMATE_WINDOW_WAITING},e.prototype.clearEstimateWindowWaiting=function(){this._state===nt.ESTIMATE_WINDOW_WAITING&&(this._state=nt.CONTROLLABLE)},e.prototype.setPasswordWindowWating=function(){this._state=nt.PASSWORD_WINDOW_WAITING},e.prototype.isWaitingPasswordWindow=function(){return this._state===nt.PASSWORD_WINDOW_WAITING},e.prototype.clearPasswordWindowWaiting=function(){this._state===nt.PASSWORD_WINDOW_WAITING&&(this._state=nt.CONTROLLABLE)},e.prototype.isPartsEventExecuted=function(){return this._isPartsEventExecuted},e.prototype.resetEventExecutionInfo=function(){this._isPartsEventExecuted=!1},e.prototype.getLastExecPartsIDOnSamePosition=function(t){return t===I.MAP?this._samePosLastExecutedMapID:this._samePosLastExecutedObjID},e.prototype.setLastExecInfoOnSamePosition=function(t,e){t===I.MAP?this._samePosLastExecutedMapID=e:this._samePosLastExecutedObjID=e},e.prototype.processAfterJump=function(){this._state!==nt.LOCALGATE_JUMPED&&this._state!==nt.LOCALGATE_JUMPED_WITH_MESSAGE||0==--this._jumpWaitFramesRemain&&(this._state=this._state===nt.LOCALGATE_JUMPED?nt.CONTROLLABLE:nt.MESSAGE_WAITING)},e.prototype.jumpTo=function(t){var e=this._camera.getPosition();this.getPosition();return!this._position.equals(t)&&(this._position=t,t.isInCameraRange(this._camera,!0)||this._camera.reset(t),this._state=this._state===nt.MESSAGE_WAITING?nt.LOCALGATE_JUMPED_WITH_MESSAGE:nt.LOCALGATE_JUMPED,this._jumpWaitFramesRemain=Q.LOCALGATE_PLAYER_WAIT_FRAME,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0,t.hasLocalGate()?this._dir=u.DOWN:t.getPartsCoord().y<=this._wwa.getMapWidth()-2&&t.getNextJustPosition(u.DOWN).hasLocalGate()?this._dir=u.UP:t.getPartsCoord().y>=1&&t.getNextJustPosition(u.UP).hasLocalGate()?this._dir=u.DOWN:t.getPartsCoord().x<=this._wwa.getMapWidth()-2&&t.getNextJustPosition(u.RIGHT).hasLocalGate()?this._dir=u.LEFT:t.getPartsCoord().x>=1&&t.getNextJustPosition(u.LEFT).hasLocalGate()?this._dir=u.RIGHT:this._dir=u.DOWN,this._camera.getPosition().equals(e)||(this._isPreparedForLookingAround=!0,this._lookingAroundTimer=Q.PLAYER_LOOKING_AROUND_START_FRAME),!0)},e.prototype.systemJumpTo=function(t){this._position=t,this._camera.reset(t),this._camera.resetPreviousPosition(),this._state=nt.LOCALGATE_JUMPED,this._jumpWaitFramesRemain=Q.LOCALGATE_PLAYER_WAIT_FRAME,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0,this._dir=u.DOWN,this._isPreparedForLookingAround=!0,this._lookingAroundTimer=Q.PLAYER_LOOKING_AROUND_START_FRAME},e.prototype.addStatusAll=function(t){return this._status.add(t),this.isDead()&&(this._status.energy=0),0!==this._energyMax&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox(),this._status},e.prototype.setEnergyMax=function(t){return this._energyMax=t,0!==t&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox(),t},e.prototype.setEnergy=function(t){return this._status.energy=t,this.isDead()&&(this._status.energy=0),0!==this._energyMax&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox(),t},e.prototype.damage=function(t){this._status.energy=Math.max(0,this._status.energy-t),this.isDead()&&(this._status.energy=0),0!==this._energyMax&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox()},e.prototype.setStrength=function(t){return this._status.strength=t,this.updateStatusValueBox(),t},e.prototype.setDefence=function(t){return this._status.defence=t,this.updateStatusValueBox(),t},e.prototype.setGold=function(t){return this._status.gold=t,this.updateStatusValueBox(),t},e.prototype.getStatus=function(){return this._status.plus(this._equipStatus)},e.prototype.getStatusWithoutEquipments=function(){return this._status.plus(new d(0,0))},e.prototype.getStatusOfEquipments=function(){return this._equipStatus.plus(new d(0,0))},e.prototype.updateStatusValueBox=function(){var t,e=this._status.plus(this._equipStatus);this._energyValueElement.textContent=this._wwa.isVisibleStatus("energy")?String(e.energy):"",this._strengthValueElement.textContent=this._wwa.isVisibleStatus("strength")?String(e.strength):"",this._defenceValueElement.textContent=this._wwa.isVisibleStatus("defence")?String(e.defence):"",this._goldValueElement.textContent=this._wwa.isVisibleStatus("gold")?String(e.gold):"",null===(t=this._wwa._messageWindow)||void 0===t||t.update(),this._wwa.updateScore()},e.prototype.updateItemBox=function(t){for(var e=this,s=function(s){var i=a._itemBoxElement[s],o=ht("#item"+s);if(0===a._itemBox[s])return i.style.backgroundPosition="-40px 0px",a.disposeItemEffect(s,a._itemBoxElement[s],o),"continue";var r=a._wwa.getObjectCropXById(a._itemBox[s]),n=a._wwa.getObjectCropYById(a._itemBox[s]);if(!t||s!==t.insertPos-1)return i.style.backgroundPosition="-"+r+"px -"+n+"px",a.disposeItemEffect(s,a._itemBoxElement[s],o),"continue";var _=t.itemScreenPixelCoord.x-t.itemBoxScreenPixelCoord.x,h=t.itemScreenPixelCoord.y-t.itemBoxScreenPixelCoord.y,c=-_*Q.DEFAULT_FRAME_INTERVAL/Q.ITEM_EFFECT_SPEED_PIXEL_PER_FRAME,u=0===t.overwrittenObjectId||void 0===t.overwrittenObjectId,l=u?t.itemBoxBackgroundImageCoord.x:a._wwa.getObjectCropXById(t.overwrittenObjectId),p=u?t.itemBoxBackgroundImageCoord.y:a._wwa.getObjectCropYById(t.overwrittenObjectId);i.style.left=_+"px",i.style.top=h+"px","number"==typeof a.itemEffectStartTimers[s]&&clearInterval(a.itemEffectStartTimers[s]),a.itemEffectStartTimers[s]=window.setTimeout((function(){e.itemEffectStartTimers[s]=void 0,e.startItemEffect(s,i,o,{target:{x:r,y:n},overwritten:{x:l,y:p}},c)}),Q.DEFAULT_FRAME_INTERVAL)},a=this,i=0;i<this._itemBoxElement.length;i++)s(i)},e.prototype.startItemEffect=function(t,e,s,a,i){var o=this,r=s.querySelector(this.overwittenItemSelector);r&&s.removeChild(r);var n=document.createElement("div");n.classList.add(this.overwittenItemClassName),n.style.backgroundPosition="-"+a.overwritten.x+"px -"+a.overwritten.y+"px",n.style.backgroundImage=s.style.backgroundImage,s.appendChild(n),e.style.backgroundPosition="-"+a.target.x+"px -"+a.target.y+"px",e.style.transitionDuration=i+"ms",e.style.transitionProperty="left,top",e.style.transitionTimingFunction="linear",e.style.left="0",e.style.top="0",s.classList.add(this.itemTransitioningClassName),e.addEventListener("transitionend",(function(){o.disposeItemEffect(t,e,s)}),{once:!0})},e.prototype.disposeItemEffect=function(t,e,s){"number"==typeof this.itemEffectStartTimers[t]&&(clearInterval(this.itemEffectStartTimers[t]),this.itemEffectStartTimers[t]=void 0),e.style.transitionDuration="0s",e.style.transitionProperty="",e.style.left="0",e.style.top="0",s.classList.contains(this.itemTransitioningClassName)&&s.classList.remove(this.itemTransitioningClassName);var a=s.querySelector(this.overwittenItemSelector);a&&s.removeChild(a)},e.prototype.isDead=function(){return this._status.energy<=0},e.prototype.addItem=function(t,e,s,a){var i,o,r;void 0===e&&(e=0),void 0===s&&(s=!1);var n=this._wwa.getObjectAttributeById(t,Q.ATR_NUMBER),_=0;if(0===e&&0!==n&&(e=n),0===e){if(0===t)return;if((i=this._getBlankItemPos())===Q.ITEMBOX_IS_FULL)throw new Error("これ以上、アイテムを持てません。");_=this._itemBox[i-1],this._forceSetItemBox(i,t)}else if(!1===s)if(i=e,r=this._itemBox[i-1],this._wwa.getObjectAttributeById(r,Q.ATR_NUMBER)!==this._wwa.getObjectAttributeById(t,Q.ATR_NUMBER)){if((o=this._getBlankItemPos())===Q.ITEMBOX_IS_FULL)throw new Error("これ以上、アイテムを持てません。");this._forceSetItemBox(o,r),this._forceSetItemBox(i,t)}else _=this._itemBox[i-1],this._forceSetItemBox(i,t);else i=e,_=this._itemBox[i-1],this._forceSetItemBox(i,t);this._updateEquipmentStatus(),this.updateItemBox(a?{insertPos:i,itemScreenPixelCoord:a.screenPixelCoord,itemBoxBackgroundImageCoord:a.itemBoxBackgroundImageCoord,itemBoxScreenPixelCoord:new w(Q.MAP_WINDOW_WIDTH+(i-1)%3*Q.CHIP_SIZE,Q.ITEMBOX_TOP_Y+Math.floor((i-1)/3)*Q.CHIP_SIZE),overwrittenObjectId:_}:void 0)},e.prototype._forceSetItemBox=function(t,e){var s=this,a=ct("#item"+(t-1)+">.item-click-border"),i=this._wwa.getObjectAttributeById(e,Q.ATR_MODE);if(this.removeItemByItemPosition(t),this._itemBox[t-1]=e,0!==e&&i!==S.NORMAL){var o=this._wwa.getSystemMessageById(Y.CLICKABLE_ITEM);if(!this._isClickableItemGot){if("BLANK"!==o){var r="";switch(this._wwa.userDevice.device){case P.PC:r="このアイテムは右のボックスを選択することで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case P.VR:r="このアイテムは右のボックスをクリックすることで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case P.SP:r="このアイテムは右のボックスをタップすることで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case P.GAME:switch(this._wwa.userDevice.os){case C.NINTENDO:r="このアイテムはXボタンを押すか、右のボックスをタップすることで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case C.PLAY_STATION:r="このアイテムは△ボタンを押すことで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case C.XBOX:r="このアイテムはYボタンを押すことで使用できます。\n使用できるアイテムは色枠で囲まれます。"}}this._wwa.setMessageQueue(""===o?r:o,!1,!0)}this._isClickableItemGot=!0}a.style.display="block",function(t){s._itemUsingEvent[t-1]=function(){(s.isControllable()||s._wwa._messageWindow.isItemMenuChoice())&&(s._wwa._itemMenu.close(),s._wwa._setNextMessage(),s._wwa.onselectitem(t))}}(t),a.addEventListener("click",this._itemUsingEvent[t-1])}},e.prototype._getBlankItemPos=function(){var t;for(t=1;t<this._itemBox.length+1;t++)if(0===this._itemBox[t-1])return t;return Q.ITEMBOX_IS_FULL},e.prototype._updateEquipmentStatus=function(){var t,e=new d(0,0);for(t=0;t<Q.ITEMBOX_SIZE;t++)0!==this._itemBox[t]&&(e.strength+=this._wwa.getObjectAttributeById(this._itemBox[t],Q.ATR_STRENGTH),e.defence+=this._wwa.getObjectAttributeById(this._itemBox[t],Q.ATR_DEFENCE));var s=e.minus(this._equipStatus);this._wwa.setStatusChangedEffect(s),this._equipStatus=e,this.updateStatusValueBox()},e.prototype.hasItem=function(t){for(var e=0;e<Q.ITEMBOX_SIZE;e++)if(this._itemBox[e]===t)return!0;return!1},e.prototype.canUseItem=function(t){var e=this._itemBox[t-1];return 0!==e&&this._wwa.getObjectAttributeById(e,Q.ATR_MODE)!==S.NORMAL},e.prototype.useItem=function(){var t;t=this._itemBox[this._readyToUseItemPos-1],this._wwa.getObjectAttributeById(t,Q.ATR_MODE)!==S.NOT_DISAPPEAR&&this.removeItemByItemPosition(this._readyToUseItemPos);var e=_t("item"+(this._readyToUseItemPos-1));return setTimeout((function(){e.classList.contains("onpress")&&e.classList.remove("onpress")}),Q.DEFAULT_FRAME_INTERVAL),this._isReadyToUseItem=!1,this._readyToUseItemPos=void 0,t},e.prototype.canHaveMoreItems=function(){return this._getBlankItemPos()!==Q.ITEMBOX_IS_FULL},e.prototype.removeItemByItemPosition=function(t){var e;0!==this._itemBox[t-1]&&(this._wwa.getObjectAttributeById(this._itemBox[t-1],Q.ATR_MODE)!==S.NORMAL&&((e=ct("#item"+(t-1)+">.item-click-border")).removeEventListener("click",this._itemUsingEvent[t-1]),e.style.display="none"),this._itemBox[t-1]=0,this._updateEquipmentStatus(),this.updateItemBox())},e.prototype.removeItemByPartsID=function(t){var e;if(!this.hasItem(t))throw new Error("アイテムを持っていない");for(var s=0;s<Q.ITEMBOX_SIZE;s++)if(this._itemBox[s]===t)return this._wwa.getObjectAttributeById(this._itemBox[s],Q.ATR_MODE)!==S.NORMAL&&((e=ct("#item"+s+">.item-click-border")).removeEventListener("click",this._itemUsingEvent[s]),e.style.display="none"),this._itemBox[s]=0,this._updateEquipmentStatus(),void this.updateItemBox()},e.prototype.clearItemBox=function(){for(var t=1;t<=Q.ITEMBOX_SIZE;t++)this.removeItemByItemPosition(t);this._updateEquipmentStatus(),this.updateItemBox()},e.prototype.hasGold=function(t){return this._status.gold>=t},e.prototype.payGold=function(t){if(!this.hasGold(t))throw new Error("お金が足りない");this.setGold(this._status.gold-t)},e.prototype.earnGold=function(t){this.setGold(this._status.gold+t)},e.prototype.setPartsAppearedFlag=function(){this._partsAppeared=!0},e.prototype.clearPartsAppearedFlag=function(){this._partsAppeared=!1},e.prototype.isPartsAppearedTime=function(){return!0===this._partsAppeared},e.prototype.startBattleWith=function(t){this._isPlayerTurn=!0,this._battleFrameCounter=Q.BATTLE_INTERVAL_FRAME_NUM,this._battleTurnNum=0,this._enemy=t,this._state=nt.BATTLE},e.prototype.isFighting=function(){return this._state===nt.BATTLE},e.prototype.isTurn=function(){return this._isPlayerTurn},e.prototype.getTurnNum=function(){return this._battleTurnNum},e.prototype.isBattleStartFrame=function(){return this._battleFrameCounter===Q.BATTLE_INTERVAL_FRAME_NUM&&0===this._battleTurnNum},e.prototype.fight=function(){if(!this.isFighting())throw new Error("バトルが開始されていません。");if(0===this._battleTurnNum&&this._battleFrameCounter===Q.BATTLE_INTERVAL_FRAME_NUM&&this._wwa.showMonsterWindow(),!(--this._battleFrameCounter>0)){this._battleTurnNum++,this._wwa.isBattleSpeedIndexForQuickBattle(this._speedIndex)||this._battleTurnNum>Q.BATTLE_SPEED_CHANGE_TURN_NUM?(1===this._battleTurnNum&&(this._wwa.playSound(K.ATTACK),this._wwa.vibration(!1)),this._battleFrameCounter=1):(this._battleFrameCounter=Q.BATTLE_INTERVAL_FRAME_NUM,this._wwa.playSound(K.ATTACK),this._wwa.vibration(!0));var t=this.getStatus(),e=this._enemy.status;if(this._isPlayerTurn){if(t.strength>e.defence||t.defence<e.strength)return e.energy>t.strength-e.defence?t.strength>e.defence&&this._enemy.damage(t.strength-e.defence):(this._wwa.playSound(this._wwa.getObjectAttributeById(this._enemy.partsID,Q.ATR_SOUND)),this.earnGold(e.gold),this._wwa.setStatusChangedEffect(new E(0,0,0,e.gold)),0!==this._enemy.item?this._wwa.setPartsOnPosition(I.OBJECT,this._enemy.item,this._enemy.position):this._wwa.setPartsOnPosition(I.OBJECT,0,this._enemy.position),this._wwa.appearParts(this._enemy.position,A.OBJECT,this._enemy.partsID),this._state=nt.CONTROLLABLE,this._wwa.setMessageQueue(this._enemy.message,!1,!1,this._enemy.partsID,I.OBJECT,this._enemy.position),this._enemy.battleEndProcess(),this._battleTurnNum=0,this._enemy=null),void(this._isPlayerTurn=!1);this._enemy.battleEndProcess(),this._wwa.setMessageQueue("相手の防御能力が高すぎる!",!1,!0),this._battleTurnNum=0,this._enemy=null}else e.strength>t.defence&&(t.energy>e.strength-t.defence?this.damage(e.strength-t.defence):(this.setEnergy(0),this._enemy.battleEndProcess(),this._state=nt.CONTROLLABLE,this._battleTurnNum=0,this._enemy=null,this._wwa.gameover()));this._isPlayerTurn=!0}},e.prototype.readyToUseItem=function(t){var e;if(!this.canUseItem(t))throw new Error("アイテムがないか、アイテムが使えません。");e=this._itemBox[t-1],this._wwa.getObjectAttributeById(e,Q.ATR_STRING),this._wwa.appearParts(this._position.getPartsCoord(),A.OBJECT,e),this._readyToUseItemPos=t,this._isReadyToUseItem=!0},e.prototype.isReadyToUseItem=function(){return this._isReadyToUseItem},e.prototype.getDrawingCenterPosition=function(){var t=this._position.getPartsCoord(),e=this._position.getOffsetCoord(),s=this._camera.getPosition(),a=s.getPartsCoord(),i=s.getOffsetCoord(),o=(t.x-a.x)*Q.CHIP_SIZE+e.x-i.x+Q.CHIP_SIZE/2,r=(t.y-a.y)*Q.CHIP_SIZE+e.y-i.y+Q.CHIP_SIZE/2;return new w(o,r)},e.prototype.getPlayTimeText=function(){var t=Math.floor(this._frameCount/60);return t>=36e6?"9999:99:99":("000"+(t/60/60|0)).slice(-4)+":"+("0"+(t/60|0)%60).slice(-2)+":"+("0"+t%60).slice(-2)},e.prototype.mainFrameCount=function(){this._frameCount++},e.prototype.getFrameCount=function(){return this._frameCount},e.prototype.setFrameCount=function(t){return"number"!=typeof t&&(t=0),this._frameCount=t},e.prototype.getMoveCount=function(){return this._moves},e.prototype.setMoveCount=function(t){return this._moves=t},e.prototype.isMoveObjectAutoExecTime=function(){return 0===this._moveObjectAutoExecTimer},e.prototype.setMoveMacroWaiting=function(t){t<0||(this._moveMacroWaitingRemainMoves=t,this._moveObjectAutoExecTimer=0)},e.prototype.resetMoveObjectAutoExecTimer=function(){this._moveObjectAutoExecTimer=Q.CHIP_SIZE/X[this._speedIndex],this._moveMacroWaitingRemainMoves--},e.prototype.decrementMoveObjectAutoExecTimer=function(){return this._moveMacroWaitingRemainMoves>=0&&this._moveObjectAutoExecTimer>0&&(this._moveObjectAutoExecTimer--,0===this._moveMacroWaitingRemainMoves&&0===this._moveObjectAutoExecTimer&&(this._afterMoveMacroFlag=!0)),0},e.prototype.isWaitingMoveMacro=function(){return 0!==this._moveMacroWaitingRemainMoves||0!==this._moveObjectAutoExecTimer},e.prototype.decrementLookingAroundTimer=function(){return this._isPreparedForLookingAround&&this._lookingAroundTimer>0?--this._lookingAroundTimer:0},e.prototype.isLookingAround=function(){return this._isPreparedForLookingAround&&0===this._lookingAroundTimer},e.prototype.getSpeedIndex=function(){return this._speedIndex},e.prototype.speedUp=function(){return this._speedIndex=Math.min(Q.MAX_SPEED_INDEX,this._speedIndex+1)},e.prototype.speedDown=function(){return this._speedIndex=Math.max(Q.MIN_SPEED_INDEX,this._speedIndex-1)},e.prototype.setSpeedIndex=function(t){if(t<Q.MIN_SPEED_INDEX||Q.MAX_SPEED_INDEX<t)throw new Error("#set_speed の引数が異常です:"+t);return this._speedIndex=t,this._speedIndex},e}(gt),St=function(){function t(t,e,s,a,i,o,r){this._partsID=t,this._position=e,this._imgCoord=s,this._status=a,this._message=i,this._item=o,this._battleEndCallback=r}return Object.defineProperty(t.prototype,"partsID",{get:function(){return this._partsID},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this._position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"imgCoord",{get:function(){return this._imgCoord},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"item",{get:function(){return this._item},enumerable:!1,configurable:!0}),t.prototype.damage=function(t){this._status.energy=Math.max(0,this._status.energy-t)},t.prototype.battleEndProcess=function(){this._battleEndCallback()},t}(),It=function(){function t(t,e,s,a,i){this._player=t,this._objectID=e,this._srcPos=s,this._destPos=a,this._dir=i,this._currentPos=this._srcPos.clone()}return t.prototype.update=function(){var t=this._player.getSpeedIndex();return this._currentPos=this._currentPos.getNextFramePosition(this._dir,X[t],X[t]),this._currentPos},Object.defineProperty(t.prototype,"isAchievedDestination",{get:function(){return this._currentPos.equals(this._destPos)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentPosition",{get:function(){return this._currentPos},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"beforePosition",{get:function(){return this._srcPos},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"destination",{get:function(){return this._destPos},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"objID",{get:function(){return this._objectID},enumerable:!1,configurable:!0}),t}(),Tt=function(){function t(t,e){this._wwa=t,this._player=e,this.clear()}return t.prototype.add=function(t,e,s,a){this._queue.push(new It(this._player,t,e,s,a))},t.prototype.update=function(){for(var t=[],e=[],s=0;s<this._queue.length;s++)this._queue[s].update(),this._queue[s].isAchievedDestination?(t.push(this._queue[s]),this._wwa.setPartsOnPosition(I.OBJECT,0,this._queue[s].beforePosition.getPartsCoord()),this._wwa.setPartsOnPosition(I.OBJECT,this._queue[s].objID,this._queue[s].destination.getPartsCoord())):e.push(this._queue[s]);return this._queue=e,t},t.prototype.clear=function(){this._queue=[]},Object.defineProperty(t.prototype,"objectMovingData",{get:function(){return this.objectMovingData},enumerable:!1,configurable:!0}),t.prototype.getOffsetByBeforePartsCoord=function(t){var e=this._queue.filter((function(e){return e.beforePosition.getPartsCoord().equals(t)}));return 0===e.length?null:e[0].currentPosition.getOffsetCoord()},t}(),Ot=function(){var t=function(e,s){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},t(e,s)};return function(e,s){if("function"!=typeof s&&null!==s)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function a(){this.constructor=e}t(e,s),e.prototype=null===s?Object.create(s):(a.prototype=s.prototype,new a)}}(),vt=function(){function t(t,e,s,a){this.isSystemMessage=e,this.isEndOfPartsEvent=s,this.macro=a,this.messageArray="string"==typeof t?[t]:t,void 0===this.macro&&(this.macro=[])}return t.prototype.isEmpty=function(){return 0===this.messageArray.length||1===this.messageArray.length&&""===this.messageArray[0]},t.prototype.generatePrintableMessage=function(){return this.messageArray.reduce((function(t,e){var s="string"==typeof e?e:e();return"".concat(t).concat(s)}),"")},t}(),Dt=function(){function t(t,e,s,a,i,o){this._wwa=t,this._triggerPartsID=e,this._triggerPartsType=s,this._triggerPartsPosition=a,this.macroType=i,this.macroArgs=o}return t.prototype.execute=function(){try{switch(this.macroType){case k.IMGPLAYER:this._executeImgPlayerMacro();break;case k.IMGYESNO:this._executeImgYesNoMacro();break;case k.HPMAX:this._executeHPMaxMacro();break;case k.SAVE:this._executeSaveMacro();break;case k.ITEM:this._executeItemMacro();break;case k.DEFAULT:this._executeDefaultMacro();break;case k.OLDMAP:this._executeOldMapMacro();break;case k.PARTS:this._executePartsMacro();break;case k.MOVE:this._executeMoveMacro();break;case k.MAP:this._executeMapMacro();break;case k.DIRMAP:this._executeDirMapMacro();break;case k.IMGFRAME:this._executeImgFrameMacro();break;case k.IMGBOM:this._executeImgBomMacro();break;case k.DELPLAYER:this._executeDelPlayerMacro();break;case k.FACE:this._executeFaceMacro();break;case k.EFFECT:this._executeEffectMacro();break;case k.GAMEOVER:this._executeGameOverMacro();break;case k.IMGCLICK:this._executeImgClickMacro();break;case k.STATUS:this._executeStatusMacro();break;case k.EFFITEM:this._executeEffItemMacro();break;case k.COLOR:this._executeColorMacro();break;case k.WAIT:this._executeWaitMacro();break;case k.SOUND:this._executeSoundMacro();break;case k.GAMEPAD_BUTTON:this._executeGamePadButtonMacro();break;case k.OLDMOVE:this._executeOldMoveMacro();break;case k.JUMPGATE:this._executeJumpGateMacro();break;case k.RECPOSITION:this._executeRecPositionMacro();break;case k.JUMPRECPOSITION:this._executeJumpRecPositionMacro();break;case k.CONSOLE_LOG:this._executeConsoleLogMacro();break;case k.COPY_HP_TO:this._executeCopyHpToMacro();break;case k.SET_HP:this._executeSetHPMacro();break;case k.COPY_HPMAX_TO:this._executeCopyHpMaxToMacro();break;case k.SET_HPMAX:this._executeSetHpMaxMacro();break;case k.COPY_AT_TO:this._executeCopyAtToMacro();break;case k.SET_AT:this._executeSetAtMacro();break;case k.COPY_DF_TO:this._executeCopyDfToMacro();break;case k.SET_DF:this._executeSetDfMacro();break;case k.COPY_MONEY_TO:this._executeCopyMoneyToMacro();break;case k.SET_MOENEY:this._executeSetMoneyMacro();break;case k.COPY_STEP_COUNT_TO:this._executeSetStepCountMacro();break;case k.VAR_SET_VAL:this._executeVarSetValMacro();break;case k.VAR_SET:this._executeVarSetMacro();break;case k.VAR_ADD:this._executeVarAddMacro();break;case k.VAR_SUB:this._executeVarSubMacro();break;case k.VAR_MUL:this._executeVarMulMacro();break;case k.VAR_DIV:this._executeVarDivMacro();break;case k.VAR_MOD:this._executeVarModMacro();break;case k.VAR_SET_RAND:this._executeVarSetRandMacro();break;case k.GAME_SPEED:this._executeGameSpeedMacro();break;case k.SHOW_STR:break;case k.IF:this._executeIfMacro();break;case k.SET_SPEED:this._executeSetSpeedMacro();break;case k.COPY_TIME_TO:this._executeCopyTimeToMacro();break;case k.HIDE_STATUS:this._hideStatusMacro();break;case k.VAR_MAP:this._varMapMacro();break;default:console.log("不明なマクロIDが実行されました:"+this.macroType)}}catch(t){}},t.prototype._concatEmptyArgs=function(t){if(this.macroArgs.length<t){for(var e=new Array(t-this.macroArgs.length),s=0;s<e.length;s++)e[s]="";this.macroArgs=this.macroArgs.concat(e)}},t.prototype._parseInt=function(t,e){void 0===e&&(e=0);var s=parseInt(this.macroArgs[t]);return isNaN(s)?e:s},t.prototype._executeJumpGateMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.forcedJumpGate(t,e)},t.prototype._executeRecPositionMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.recUserPosition(t,e)},t.prototype._executeJumpRecPositionMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.jumpRecUserPosition(t,e)},t.prototype._executeConsoleLogMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.outputUserVar(t)},t.prototype._executeCopyHpToMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setUserVarHP(t)},t.prototype._executeCopyHpMaxToMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setUserVarHPMAX(t)},t.prototype._executeCopyAtToMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseStatusKind(this._parseInt(1));this._wwa.setUserVarAT(t,e)},t.prototype._executeCopyDfToMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseStatusKind(this._parseInt(1));this._wwa.setUserVarDF(t,e)},t.prototype._parseStatusKind=function(t){switch(t){case 0:default:return"all";case 1:return"bare";case 2:return"equipment"}},t.prototype._executeCopyMoneyToMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setUserVarMONEY(t)},t.prototype._executeSetHPMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setHPUserVar(t)},t.prototype._executeSetHpMaxMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setHPMAXUserVar(t)},t.prototype._executeSetAtMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setATUserVar(t)},t.prototype._executeSetDfMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setDFUserVar(t)},t.prototype._executeSetMoneyMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setMONEYUserVar(t)},t.prototype._executeSetStepCountMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setUserVarStep(t)},t.prototype._executeVarSetValMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserVarVal(t,e)},t.prototype._executeVarSetMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValOtherUserVal(t,e)},t.prototype._executeVarAddMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValAdd(t,e)},t.prototype._executeVarSubMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValSub(t,e)},t.prototype._executeVarMulMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValMul(t,e)},t.prototype._executeVarDivMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValDiv(t,e)},t.prototype._executeVarModMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValMod(t,e)},t.prototype._executeVarSetRandMacro=function(){this._concatEmptyArgs(3);var t=this._parseInt(0),e=this._parseInt(1),s=this._parseInt(2,0);this._wwa.setUserValRandNum(t,e,s)},t.prototype._executeGameSpeedMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(0);this._wwa.speedChangeJudge(t)},t.prototype._executeIfMacro=function(){for(var t=new Array(11),e=0;e<10;e++)t[e]=this.macroArgs[e];this._wwa.userVarUserIf(this._triggerPartsPosition,t)},t.prototype._executeSetSpeedMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setPlayerSpeedIndex(t-1)},t.prototype._executeCopyTimeToMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setUserVarPlayTime(t)},t.prototype._hideStatusMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=0!==this._parseInt(1);this._wwa.hideStatus(t,e)},t.prototype._varMapMacro=function(){this._concatEmptyArgs(4);var t=this._parseInt(0),e=this.macroArgs[1],s=this.macroArgs[2],a=this._parseInt(3,I.OBJECT);if(t<0)throw new Error("入力変数が不正です");this._wwa.varMap(this._triggerPartsPosition,e,s,t,a)},t.prototype._executeImgPlayerMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setPlayerImgCoord(new w(t,e))},t.prototype._executeImgYesNoMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setYesNoImgCoord(new w(t,e))},t.prototype._executeHPMaxMacro=function(){this._concatEmptyArgs(1);var t=Math.max(0,this._parseInt(0));this._wwa.setPlayerEnergyMax(t)},t.prototype._executeSaveMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(0);this._wwa.disableSave(t)},t.prototype._executeItemMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setPlayerGetItem(t,e)},t.prototype._executeDefaultMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(0);this._wwa.setObjectNotCollapseOnPartsOnPlayer(t)},t.prototype._executeOldMapMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(0);this._wwa.setOldMap(t)},t.prototype._executePartsMacro=function(){this._concatEmptyArgs(4);var t=this._parseInt(0),e=this._parseInt(1),s=this._parseInt(2,I.OBJECT),a=this._parseInt(3);if(s!==I.OBJECT&&s!==I.MAP)throw new Error("パーツ種別が不明です");if(0!==a&&1!==a&&(a=1),t<0||e<0)throw new Error("パーツ番号が不正です");if(s===I.OBJECT){if(t>=this._wwa.getObjectPartsNum()||e>=this._wwa.getObjectPartsNum())throw new Error("パーツ番号が不正です")}else if(t>=this._wwa.getMapPartsNum()||e>=this._wwa.getMapPartsNum())throw new Error("パーツ番号が不正です");this._wwa.replaceParts(t,e,s,!!a)},t.prototype._executeMoveMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setMoveMacroWaitingToPlayer(t)},t.prototype._executeMapMacro=function(){this._concatEmptyArgs(4);var t=this._parseInt(0),e=this.macroArgs[1],s=this.macroArgs[2],a=this._parseInt(3,I.OBJECT);if(t<0)throw new Error("パーツ番号が不正です");if(a===I.OBJECT){if(t>=this._wwa.getObjectPartsNum())throw new Error("パーツ番号が不正です")}else if(t>=this._wwa.getMapPartsNum())throw new Error("パーツ番号が不正です");this._wwa.appearPartsEval(this._triggerPartsPosition,e,s,t,a)},t.prototype._executeDirMapMacro=function(){this._concatEmptyArgs(3);var t=this._parseInt(0),e=this._parseInt(1),s=this._parseInt(2,I.OBJECT);if(isNaN(t)||isNaN(e)||isNaN(s))throw new Error("引数が整数ではありません");if(t<0)throw new Error("パーツ番号が不正です");if(s===I.OBJECT){if(t>=this._wwa.getObjectPartsNum())throw new Error("パーツ番号が不正です")}else if(t>=this._wwa.getMapPartsNum())throw new Error("パーツ番号が不正です");this._wwa.appearPartsByDirection(e,t,s)},t.prototype._executeImgFrameMacro=function(){this._concatEmptyArgs(3);var t=this._parseInt(0),e=this._parseInt(1),s=this._parseInt(2);if(e<0||s<0)throw new Error("座標は正でなければなりません。");if(t===H.ENERGY||t===H.STRENGTH||t===H.DEFENCE||t===H.GOLD)this._wwa.setStatusIconCoord(t,new w(e,s));else if(t===H.WIDE_CELL_ROW)this._wwa.setWideCellCoord(new w(e,s));else if(t===H.ITEM_BG)this._wwa.setItemboxBackgroundPosition({x:e,y:s});else{if(t!==H.MAIN_FRAME)throw new Error("種別が不正です。");this._wwa.setFrameCoord(new w(e,s))}},t.prototype._executeImgBomMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);if(t<0||e<0)throw new Error("座標は正でなければなりません。");this._wwa.setBattleEffectCoord(new w(t,e))},t.prototype._executeDelPlayerMacro=function(){this._concatEmptyArgs(1);var t=parseInt(this.macroArgs[0]);this._wwa.setDelPlayer(!!t)},t.prototype._executeFaceMacro=function(){this._concatEmptyArgs(6);var t,e=this._parseInt(0),s=this._parseInt(1),a=this._parseInt(2),i=this._parseInt(3),o=this._parseInt(4),r=this._parseInt(5);if(e<0||s<0||a<0||i<0||o<0||r<0)throw new Error("各引数は0以上の整数でなければなりません。");t=new m(new w(e,s),new w(a,i),new w(o,r)),this._wwa.addFace(t)},t.prototype._executeEffectMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);if(t<0)throw new Error("待ち時間は0以上の整数でなければなりません。");if(0!==t){for(var e=[],s=1;s<this.macroArgs.length;s+=2){var a,i=this._parseInt(s);if(i<0)throw new Error("画像のパーツ座標指定は0以上の整数でなければなりません。");if(s+1===this.macroArgs.length)throw new Error("画像のパーツ座標指定で、Y座標が指定されていません。");if((a=this._parseInt(s+1))<0)throw new Error("画像のパーツ座標指定は0以上の整数でなければなりません。");e.push(new w(i,a))}this._wwa.setEffect(t,e)}else this._wwa.stopEffect()},t.prototype._executeGameOverMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);if(t<0||t>=this._wwa.getMapWidth()||e<0||e>=this._wwa.getMapWidth())throw new Error("マップの範囲外が指定されています!");this._wwa.setGameOverPosition(new w(t,e))},t.prototype._executeImgClickMacro=function(){if(this._concatEmptyArgs(2),this.macroArgs.length<1)throw new Error("引数が少なすぎます");var t=this._parseInt(0),e=this._parseInt(1);if(t<0||e<0)throw new Error("引数が0以上の整数ではありません");this._wwa.setImgClick(new w(t,e))},t.prototype._executeEffItemMacro=function(){if(this.macroArgs.length<1)throw new Error("引数が少なすぎます");var t=this._parseInt(0);this._wwa.updateItemEffectEnabled(!!t)},t.prototype._executeStatusMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);if(t<0||4<t)throw new Error("ステータス種別が範囲外です。");this._wwa.setPlayerStatus(t,e)},t.prototype._executeColorMacro=function(){this._concatEmptyArgs(4);var t=this._parseInt(0),e=this._parseInt(1),s=this._parseInt(2),a=this._parseInt(3);if(t<0||t>5)throw new Error("種別は0から5までです");if(e<0||e>255||s<0||s>255||a<0||a>255)throw new Error("色が範囲外です");this._wwa.changeStyleRule(t,e,s,a)},t.prototype._executeWaitMacro=function(){throw new Error("Not implemented!")},t.prototype._executeSoundMacro=function(){this._concatEmptyArgs(1);var t=parseInt(this.macroArgs[0]);this._wwa.playSound(t)},t.prototype._executeGamePadButtonMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);if(t<0||e<0)throw new Error("各引数は0以上の整数でなければなりません。");if(e>Q.ITEMBOX_SIZE)throw new Error("アイテムボックス上限を超えた数値が指定されました。");this._wwa.setGamePadButtonItemTable(t,e)},t.prototype._executeOldMoveMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(0);this._wwa.setOldMove(t)},t}();function Ct(t,e,s,a,i){var o=i.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)\=(.*)$/);if(null===o||3!==o.length)throw new Error("マクロではありません");var r=o[1],n=V["$"+r.toLowerCase()];return void 0===n?new Dt(t,e,s,a,k.UNDEFINED,o[2].split(",")):new Dt(t,e,s,a,n,o[2].split(",").map((function(t){return t.trim()})))}var Pt,Mt=function(){function t(t,e,s,a,i,o,r){this._wwa=t,this._coord=e,this._width=s,this._height=a,this._isVisible=i,this._parentElement=o,this._element=document.createElement("div"),this._element.style.position="absolute",this._element.style.borderWidth="2px",this._element.style.borderStyle="solid",t.isClassicMode()?this._element.style.borderRadius="15px":this._element.style.borderRadius="10px",this._element.classList.add("wwa-message-window"),this._element.style.zIndex=r+"",this._element.style.left=this._coord.x+"px",this._element.style.top=this._coord.y+"px",this._element.style.width=this._width+"px",this._element.style.height=this._height+"px",this._parentElement.appendChild(this._element)}return t.prototype.update=function(t){},t.prototype.show=function(){this._isVisible=!0,this._element.style.display="block",this.update(),this._wwa.wwaCustomEvent("wwa_window_show",{name:this.windowName,element:this._element,text:this._element.textContent})},t.prototype.hide=function(){this._isVisible=!1,this._element.style.display="none",this.update(),this._wwa.wwaCustomEvent("wwa_window_hide",{name:this.windowName})},t.prototype.isVisible=function(){return this._isVisible},Object.defineProperty(t.prototype,"windowName",{get:function(){return"TextWindow"},enumerable:!1,configurable:!0}),t}(),Nt=function(t){function e(e,s,a,i,o,r,n){var _=t.call(this,e,new w(s.x,s.y),a,i,o,r,201)||this;return _._cgFileName=n,_._monsterBox=document.createElement("div"),_._monsterBox.style.width=Q.CHIP_SIZE+"px",_._monsterBox.style.height=Q.CHIP_SIZE+"px",_._monsterBox.style.position="absolute",_._monsterBox.style.left="10px",_._monsterBox.style.top="10px",_._monsterBox.style.backgroundImage="url("+_._cgFileName.replace("(","\\(").replace(")","\\)")+")",_._monsterBox.style.backgroundPosition="0 0",_._element.appendChild(_._monsterBox),_._energyBox=document.createElement("div"),_._energyBox.style.position="absolute",_._energyBox.style.left="80px",_._energyBox.style.top="10px",_._energyBox.textContent="生命力 0",_._element.appendChild(_._energyBox),_._strengthBox=document.createElement("div"),_._strengthBox.style.position="absolute",_._strengthBox.style.left="80px",_._strengthBox.style.top="30px",_._strengthBox.textContent="攻撃力 0",_._element.appendChild(_._strengthBox),_._defenceBox=document.createElement("div"),_._defenceBox.style.position="absolute",_._defenceBox.style.left="180px",_._defenceBox.style.top="30px",_._defenceBox.textContent="防御力 0",_._element.appendChild(_._defenceBox),_._isVisible?_._element.style.display="block":_._element.style.display="none",_}return Ot(e,t),e.prototype.update=function(t){void 0!==t&&(this._monsterBox.style.backgroundPosition="-"+t.imgCoord.x+"px -"+t.imgCoord.y+"px",this._energyBox.textContent="生命力 "+t.status.energy,this._strengthBox.textContent="攻撃力 "+t.status.strength,this._defenceBox.textContent="防御力 "+t.status.defence)},Object.defineProperty(e.prototype,"windowName",{get:function(){return"MonsterWindow"},enumerable:!1,configurable:!0}),e}(Mt),Rt=function(t){function e(e,s,a,i){var o=this;return e.isClassicMode()?((o=t.call(this,e,new w(2*Q.CHIP_SIZE,30),7*Q.CHIP_SIZE,40,a,i,202)||this)._element.style.borderWidth="0",o._element.style.borderRadius="4px",o._element.style.fontSize="20px",o._element.style.lineHeight="40px"):o=t.call(this,e,new w(s.x,s.y),340,30,a,i,202)||this,o._element.style.textAlign="center",o._isVisible?o._element.style.display="block":o._element.style.display="none",o.update(0),o}return Ot(e,t),e.prototype.update=function(t){void 0!==t&&(this._element.textContent="Score: "+t)},Object.defineProperty(e.prototype,"windowName",{get:function(){return"ScoreWindow"},enumerable:!1,configurable:!0}),e.WINDOW_NAME="ScoreWindow",e}(Mt);!function(t){t[t.TOP=0]="TOP",t[t.CENTER=1]="CENTER",t[t.BOTTOM=2]="BOTTOM",t[t.SCORE=3]="SCORE"}(Pt||(Pt={}));var Lt,bt=function(){function t(t,e,s,a,i,o,r,n,_,h){this._wwaSave=void 0,this._save_select_id=0,this._save_counter=0,this._save_close=!1;var c=this,u=o.replace("(","\\(").replace(")","\\)");switch(this._wwa=t,this._cgFileName=o,this._x=e,this._y=s,this._width=a,this._height=i,this._message=new vt([],!1),this._isVisible=r,this._isYesno=n,this._isItemMenu=_,this._element=document.createElement("div"),this._element.id="wwa-text-message-window",this._element.classList.add("wwa-message-window"),this._msgWrapperElement=document.createElement("div"),this._msgWrapperElement.style.textAlign="left",this._msgWrapperElement.style.wordWrap="break-word",this._msgWrapperElement.style.margin=t.isClassicMode()?"8px 0 8px 16px":"0",this._msgWrapperElement.style.padding=t.isClassicMode()?"0":"7px",this._element.appendChild(this._msgWrapperElement),this._saveElement=document.createElement("div"),this._saveElement.style.padding="0",this._saveElement.style.margin="0",this._element.appendChild(this._saveElement),this._dummyElement=document.createElement("div"),this._dummyElement.style.display="none",this._dummyElement.style.padding="0",this._dummyElement.style.margin="0",this._dummyElement.style.height="55px",this._element.appendChild(this._dummyElement),this._ynWrapperElement=document.createElement("div"),this._ynWrapperElement.classList.add("wwa-yesno-wrapper"),this._element.appendChild(this._ynWrapperElement),this._parentElement=h,this._parentElement.appendChild(this._element),this._divYesElement=document.createElement("div"),this._divYesElement.classList.add("wwa-yes-button"),this._divYesElement.style.background="url("+u+")",this._divYesElement.onclick=function(){c._isInputDisable||(t.setYesNoInput(g.YES),c.update())},this._divYesElement.style.cursor="pointer",this._divNoElement=document.createElement("div"),this._divNoElement.classList.add("wwa-no-button"),this._divNoElement.style.background="url("+u+")",this._divNoElement.onclick=function(){c._isInputDisable||(t.setYesNoInput(g.NO),c.update())},this._ynWrapperElement.appendChild(this._divYesElement),this._ynWrapperElement.appendChild(this._divNoElement),c._isInputDisable=!1,t.userDevice.device){case P.SP:case P.VR:this._parentElement.classList.add("useScaleUp")}this.update()}return t.prototype.setPosition=function(t,e,s,a){this._x=t,this._y=e,this._width=s,this._height=a,this.update()},t.prototype.setPositionByPlayerPosition=function(t,e,s,a,i){var o,r=a.getPartsCoord().substract(i.getPartsCoord()).y;o=t?Pt.BOTTOM:e?Pt.SCORE:s?Pt.CENTER:r>=Math.ceil(Q.V_PARTS_NUM_IN_WINDOW/2)?Pt.TOP:Pt.BOTTOM,this.setPositionEasy(o)},t.prototype.setPositionEasy=function(t){var e=Math.floor(this._element.clientHeight/2);return t===Pt.CENTER?(this._y=Q.MAP_WINDOW_HEIGHT/2-e,void this.update()):t===Pt.TOP?(this._y=Math.max(20,Q.MAP_WINDOW_HEIGHT/4-e)+10,void this.update()):t===Pt.BOTTOM?(this._y=Math.min(Q.MAP_WINDOW_HEIGHT-20-this._element.clientHeight,3*Q.MAP_WINDOW_HEIGHT/4-e),void this.update()):t===Pt.SCORE?(this._y=80,void this.update()):void 0},t.prototype.setParsedMessage=function(t){this._message=t,this.update()},t.prototype.setYesNoChoice=function(t){return this._isInputDisable=!1,this._isYesno=t,this.update(),this._isYesno},t.prototype.isYesNoChoice=function(){return this._isYesno},t.prototype.isSaveChoice=function(){return this._isSave},t.prototype.setItemMenuChoice=function(t){return this._isInputDisable=!1,this._isItemMenu=t,this.update(),this._isItemMenu},t.prototype.isItemMenuChoice=function(){return this._isItemMenu},t.prototype.setInputDisable=function(){this._isInputDisable=!0},t.prototype.isInputDisable=function(){return this._isInputDisable},t.prototype.show=function(){this._isVisible=!0,this.update()},t.prototype.hide=function(){this._isVisible=!1,this.update()},t.prototype.isVisible=function(){return this._isVisible},t.prototype.isWideChar=function(t){return null!==t.match(/^[^\x01-\x7E\xA1-\xDF]+$/)},t.prototype.createClassicTextElement=function(t){for(var e=document.createElement("span"),s=0,a="",i=0;i<t.length||0!=s;i++)if(this.isWideChar(t.charAt(i))?s+=2:s+=1,a+=t.charAt(i),s+1>2*Q.MSG_STR_WIDTH){"。"!==t.charAt(i+1)&&"、"!==t.charAt(i+1)||(a+=t.charAt(i+1),i++);var o=document.createElement("span");o.style.display="inline-block",o.style.width="100%",o.textContent=a,e.appendChild(o),s=0,a=""}return e},t.prototype.update=function(){var t=this,e=this._wwa.getYesNoImgCoord();this._isYesno?(this._wwa.getYesNoState()===g.YES?(this._divYesElement.style.backgroundPosition="-"+(e.x+Q.IMGRELPOS_YESNO_YESP_X)*Q.CHIP_SIZE+"px -"+e.y*Q.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+Q.IMGRELPOS_YESNO_NO_X)*Q.CHIP_SIZE+"px -"+e.y*Q.CHIP_SIZE+"px"):this._wwa.getYesNoState()===g.NO?(this._divYesElement.style.backgroundPosition="-"+(e.x+Q.IMGRELPOS_YESNO_YES_X)*Q.CHIP_SIZE+"px -"+e.y*Q.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+Q.IMGRELPOS_YESNO_NOP_X)*Q.CHIP_SIZE+"px -"+e.y*Q.CHIP_SIZE+"px"):(this._divYesElement.style.backgroundPosition="-"+(e.x+Q.IMGRELPOS_YESNO_YES_X)*Q.CHIP_SIZE+"px -"+e.y*Q.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+Q.IMGRELPOS_YESNO_NO_X)*Q.CHIP_SIZE+"px -"+e.y*Q.CHIP_SIZE+"px"),this._ynWrapperElement.style.display="block"):this._ynWrapperElement.style.display="none",this._msgWrapperElement.textContent="";var s=this._message.generatePrintableMessage().split("\n");s.forEach((function(e,a){var i;t._wwa.isClassicMode()?i=t.createClassicTextElement(e):(i=document.createElement("span")).textContent=s[a],t._msgWrapperElement.appendChild(i),t._msgWrapperElement.appendChild(document.createElement("br"))})),this._isVisible?(this._element.style.left=this._x+"px",this._element.style.top=this._y+"px"):(this._element.style.left="-999999px",this._element.style.top="-999999px"),this._isSave?this._saveElement.style.display="block":this._saveElement.style.display="none",this._element.style.width=this._width+"px",this._element.style.minHeight=this._height+"px"},t.prototype.setWWASave=function(t){this._wwaSave=t},t.prototype.createSaveDom=function(){var t,e,s,a,i,o,r,n,_,h,c,u=this;e=document.createElement("div"),h=(n=document.getElementById("disp-energy")).style.backgroundPosition,c=n.style.backgroundImage;for(var l=this._wwaSave.list.length,p=0;p<l;p++)t=this._wwaSave.list[p],(s=document.createElement("div")).classList.add("savedata"),s.setAttribute("save_id",p),s.addEventListener("click",(function(t){u.setSaveID(0|t.currentTarget.getAttribute("save_id")),u._save_close=!0,t.preventDefault()})),(a=document.createElement("div")).classList.add("ss"),s.appendChild(a),(i=document.createElement("div")).classList.add("wide-cell-row"),i.style.backgroundPosition=h,i.style.backgroundImage=c,s.appendChild(i),e.appendChild(s),t.flag&&(a.appendChild(t.cvs),(o=document.createElement("span")).textContent=t.getDateText(),t.isLastSaveData()&&(o.style.color=q.DATE_LAST_SAVE_TEXT_COLOR),a.appendChild(o),(r=document.createElement("div")).classList.add("status-icon"),r.style.backgroundImage=c,r.style.backgroundPosition="-120px -80px",i.appendChild(r),(_=document.createElement("div")).classList.add("status-value-box"),_.textContent=t.getStatusEnergy(),i.appendChild(_));this._saveElement.textContent="",this._saveElement.appendChild(e),this.setSaveID(this._save_select_id),this._isSave=!0,this._save_counter=0,this._save_close=!1},t.prototype.deleteSaveDom=function(){this._saveElement.textContent="",this._isSave=!1},t.prototype.setSaveID=function(t){this._save_select_id=t;for(var e,s=document.querySelectorAll(".savedata"),a=s.length,i=0;i<a;i++)e=s[i],t===i?e.classList.add("select"):e.classList.remove("select")},t.prototype.save=function(t,e){return this._wwaSave.save(t,e,this._save_select_id)},t.prototype.load=function(){return this._wwaSave.load(this._save_select_id)},t.prototype.saveUpdate=function(){this._save_counter>0&&this._save_counter--},t.prototype.isSaveClose=function(){return this._save_close},t.prototype.cursor_wait=function(){this._save_counter=Q.CONTROLL_WAIT_FRAME},t.prototype.saveControll=function(t){if(!(this._save_counter>0||this._isInputDisable)){switch(t){case u.DOWN:this._save_select_id-=2,this.cursor_wait();break;case u.UP:this._save_select_id+=2,this.cursor_wait();break;case u.LEFT:this._save_select_id--,this.cursor_wait();break;case u.RIGHT:this._save_select_id++,this.cursor_wait()}this.setSaveID((this._save_select_id+q.QUICK_SAVE_MAX)%q.QUICK_SAVE_MAX)}},Object.defineProperty(t.prototype,"windowName",{get:function(){return"MessageWindow"},enumerable:!1,configurable:!0}),t}(),Bt=function(){function t(t,e,s){this.id=t,this.imgFileName=e,this.parent=s,this.elem=document.createElement("div"),this.elem.classList.add("est"),this.elem.setAttribute("id","wwa-est-"+t),this.imgElem=document.createElement("div"),this.imgElem.classList.add("est-img-wrapper"),this.imgElem.style.backgroundImage="url("+this.imgFileName.replace("(","\\(").replace(")","\\)")+")",this.statusElem=document.createElement("div"),this.statusElem.classList.add("est-status-wrapper"),this.energyElem=document.createElement("div"),this.energyElem.classList.add("est-energy"),this.energyDispElem=document.createElement("span"),this.energyDispElem.classList.add("est-energy-disp"),this.energyElem.appendChild(this.energyDispElem),this.statusElem.appendChild(this.energyElem),this.strengthElem=document.createElement("div"),this.strengthElem.classList.add("est-strength"),this.strengthDispElem=document.createElement("span"),this.strengthDispElem.classList.add("est-strength-disp"),this.strengthElem.appendChild(this.strengthDispElem),this.statusElem.appendChild(this.strengthElem),this.defenceElem=document.createElement("div"),this.defenceElem.classList.add("est-defence"),this.defenceDispElem=document.createElement("span"),this.defenceDispElem.classList.add("est-defence-disp"),this.defenceElem.appendChild(this.defenceDispElem),this.statusElem.appendChild(this.defenceElem),this.damageElem=document.createElement("div"),this.damageElem.classList.add("est-damage"),this.damageDispElem=document.createElement("span"),this.damageDispElem.classList.add("est-damage-disp"),this.damageElem.appendChild(this.damageDispElem),this.statusElem.appendChild(this.damageElem),this.elem.appendChild(this.imgElem),this.elem.appendChild(this.statusElem)}return t.prototype.hide=function(){this.elem.style.display="none"},t.prototype.show=function(){this.elem.style.display="block"},t.prototype.setResult=function(t,e,s){this.imgElem.style.backgroundPosition="-"+t.x+"px -"+t.y+"px",this.energyDispElem.textContent="生命力 "+e.energy,this.strengthDispElem.textContent="攻撃力 "+e.strength,this.defenceDispElem.textContent="防御力 "+e.defence,s.isNoEffect?this.damageDispElem.textContent="攻撃無効":s.isOverMaxTurn?this.damageDispElem.textContent="長期戦が予想されます":this.damageDispElem.textContent="予測ダメージ "+s.damage},t}(),xt=function(){function t(t,e,s){var a,i=this;this._wwa=t,this._imgFileName=e,this._parent=s,this._element=document.createElement("div"),this._element.setAttribute("id","wwa-battle-estimate"),this._element.style.display="none",this._edes=[];for(var o=0;o<Q.BATTLE_ESTIMATE_MONSTER_TYPE_MAX;o++)a=new Bt(o,this._imgFileName,this._element),this._edes.push(a),this._element.appendChild(a.elem);this._element.addEventListener("click",(function(){i._wwa.hideBattleEstimateWindow()})),this._parent.appendChild(this._element)}return t.prototype.update=function(t,e){for(var s=0;s<Q.BATTLE_ESTIMATE_MONSTER_TYPE_MAX;s++)if(s>=e.length)this._edes[s].hide();else{var a=this._wwa.getObjectAttributeById(e[s],Q.ATR_X),i=this._wwa.getObjectAttributeById(e[s],Q.ATR_Y),o=new w(a,i),r=this._wwa.getObjectAttributeById(e[s],Q.ATR_ENERGY),n=this._wwa.getObjectAttributeById(e[s],Q.ATR_STRENGTH),_=this._wwa.getObjectAttributeById(e[s],Q.ATR_DEFENCE),h=new E(r,n,_,0),c=Wt(t,h);this._edes[s].setResult(o,h,c),this._edes[s].show()}},t.prototype.show=function(){this._element.style.display="block"},t.prototype.hide=function(){this._element.style.display="none"},t}(),Ut=function(t,e,s){this.isNoEffect=t,this.isOverMaxTurn=e,this.damage=s};function Wt(t,e){var s=e.energy,a=t.strength-e.defence,i=Math.max(0,e.strength-t.defence),o=0,r=0;if(!(a>0))return new Ut(!0,!1,0);for(;;){if(o++,(s-=a)<=0)return new Ut(!1,!1,r);if(r+=i,o>1e4)return new Ut(!1,!0,0)}}!function(t){t[t.SAVE=0]="SAVE",t[t.LOAD=1]="LOAD"}(Lt||(Lt={}));var Yt=function(){function t(t,e,s){var a=this;this._wwa=t,this._parent=e,this._isDisallowLoadOldSave=s,this._element=document.createElement("div"),this._element.setAttribute("id","wwa-password-window"),this._element.style.display="none",this._descriptionElement=document.createElement("div"),this._descriptionElement.classList.add("wwa-password-description"),this._passwordBoxElement=document.createElement("textarea"),this._passwordBoxElement.setAttribute("cols","50"),this._passwordBoxElement.setAttribute("rows","16"),this._passwordBoxElement.addEventListener("focus",(function(t){a._passwordBoxElement.select()})),this._buttonWrapperElement=document.createElement("div"),this._buttonWrapperElement.classList.add("wwa-password-submit"),this._okButtonElement=document.createElement("button"),this._okButtonElement.textContent="OK",this._okButtonElement.addEventListener("click",(function(){a._wwa.hidePasswordWindow()})),this._cancelButtonElement=document.createElement("button"),this._cancelButtonElement.textContent="キャンセル",this._cancelButtonElement.addEventListener("click",(function(){a._wwa.hidePasswordWindow(!0)})),this._buttonWrapperElement.appendChild(this._okButtonElement),this._buttonWrapperElement.appendChild(this._cancelButtonElement),this._mode=Lt.LOAD,this._element.appendChild(this._descriptionElement),this._element.appendChild(this._passwordBoxElement),this._element.appendChild(this._buttonWrapperElement),this._parent.appendChild(this._element),this.update()}return Object.defineProperty(t.prototype,"mode",{get:function(){return this._mode},set:function(t){this._mode=t,t===Lt.LOAD&&(this.password="")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"password",{get:function(){return this._passwordBoxElement.value},set:function(t){this._passwordBoxElement.value=t},enumerable:!1,configurable:!0}),t.prototype.show=function(t){void 0!==t&&(this.mode=t),this._isVisible=!0,this.update()},t.prototype.hide=function(){this._isVisible=!1,this.update()},t.prototype.update=function(){var t,e="";if(this._mode===Lt.LOAD){t=this._isDisallowLoadOldSave,e="下のボックスに前回のプレイで取得した\n復帰用パスワードを貼り付けてください。\nJava 版 WWA で取得したパスワードはご利用になれません。\n作成者が ".concat(t?"マップの内容":"ワールド名 か マップの暗証番号"," を変更した場合は\nそれ以前に取得したパスワードは使えなくなります。");try{this._passwordBoxElement.removeAttribute("readonly")}catch(t){}this._cancelButtonElement.style.display="inline"}else e="下記テキストがデータ復帰用のパスワードになっています。\nコピーしてメモ帳などのテキストエディタに貼り付けて\n保存してください。",this._passwordBoxElement.setAttribute("readonly","readonly"),this._cancelButtonElement.style.display="none";var s=e.split("\n");this._descriptionElement.textContent="";for(var a=0;a<s.length;a++){var i=document.createElement("span");i.textContent=s[a],this._descriptionElement.appendChild(i),this._descriptionElement.appendChild(document.createElement("br"))}this._isVisible?this._element.style.display="block":this._element.style.display="none"},t}();function kt(t,e){var s,a,i=document.createElement("style");i.type="text/css",i.setAttribute("id",Q.WWA_STYLE_TAG_ID),(s="head",document.getElementsByTagName(s))[0].appendChild(i),t.innerHTML=(a=null!==e?'\n <div id="wwa-cover">\n <div id="version"></div>\n <div id="progress-message-container">開始しています...</div>\n <div id="progress-bar-bg"></div>\n <div id="progress-bar" class="progress-bar"></div>\n <div id="progress-bar-audio" class="progress-bar"></div>\n <div id="progress-disp">---</div>\n </div>\n ':'\n <div id="wwa-cover">\n <canvas id="progress-panel" width="'.concat(Q.SCREEN_WIDTH,'" height="').concat(Q.SCREEN_HEIGHT,'"></canvas>\n </div>'),'\n <canvas id="wwa-map" class="wwa-canvas" width="440" height="440">\n このブラウザは、Canvas要素をサポートしていません。\n </canvas>\n <canvas id="wwa-map-sub" class="wwa-canvas" width="440" height="440"></canvas>\n <div id="wwa-sidebar">\n <div class="wide-cell-row" id="disp-energy"><div class="status-icon"></div><div class="status-value-box">0</div></div>\n <div class="wide-cell-row" id="disp-strength"><div class="status-icon"></div><div class="status-value-box"> 0 </div></div>\n <div class="wide-cell-row" id="disp-defence"><div class="status-icon"></div><div class="status-value-box">0</div></div>\n <div class="wide-cell-row" id="disp-gold"><div class="status-icon"></div><div class="status-value-box">0</div></div>\n <div class="item-cell" id="item0"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item1"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item2"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item3"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item4"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item5"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item6"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item7"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item8"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item9"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item10"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item11"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="wide-cell-row" id="cell-load">Password</div><div class="wide-button" id="button-load"></div>\n <div class="wide-cell-row" id="cell-save">Quick Save</div><div class="wide-button" id="button-save"></div>\n <div class="wide-cell-row" id="cell-restart">Restart Game</div><div class="wide-button" id="button-restart"></div>\n <div class="wide-cell-row" id="cell-gotowwa">Goto WWA</div><div class="wide-button" id="button-gotowwa"></div>\n </div>\n <div id="wwa-controller"></div>\n <div id="wwa-fader"></div>\n'.concat(a,'\n <div id="wwa-audio-wrapper"></div>')),null!==e&&(_t("wwa-cover").style.backgroundImage="url(".concat(e,")"),_t("wwa-cover").style.backgroundRepeat="no-repeat",_t("wwa-cover").style.backgroundPosition="0 0")}var Ft=function(){function t(){this.allClear()}return t.prototype.update=function(){this.counter>0&&this.counter--},t.prototype.cursor_wait=function(){this.counter=Q.CONTROLL_WAIT_FRAME},t.prototype.allClear=function(){this.col=0,this.row=0,this.counter=0},t.prototype.controll=function(e){if(!(this.counter>0))switch(e){case u.DOWN:this.row<t.ROW_MAX-1&&(this.row++,this.openView(),this.cursor_wait());break;case u.UP:this.row>0&&(this.row--,this.openView(),this.cursor_wait());break;case u.LEFT:this.col>0&&(this.col--,this.openView(),this.cursor_wait());break;case u.RIGHT:this.col<t.COL_MAX-1&&(this.col++,this.openView(),this.cursor_wait())}},t.prototype.ok=function(){this.close();var e=null;(e=ct(t.CLICK_DOM_QUERY_TABLE[this.row][this.col])).classList.contains("item-click-border")||this.allClear();var s=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});return e.dispatchEvent(s)},t.prototype.ng=function(){this.close()},t.prototype.close=function(){var e,s,a=null;for(e=0;e<t.COL_MAX;e++)for(s=0;s<t.ROW_MAX;s++)(a=_t(t.DOM_ID_TABLE[s][e])).classList.contains("onpress")&&a.classList.remove("onpress")},t.prototype.openView=function(){this.close();_t(t.DOM_ID_TABLE[this.row][this.col]).classList.add("onpress")},t.prototype.init=function(){this.allClear(),this.openView()},t.ROW_MAX=8,t.COL_MAX=3,t.DOM_ID_TABLE=[["item0","item1","item2"],["item3","item4","item5"],["item6","item7","item8"],["item9","item10","item11"],["cell-load","cell-load","cell-load"],["cell-save","cell-save","cell-save"],["cell-restart","cell-restart","cell-restart"],["cell-gotowwa","cell-gotowwa","cell-gotowwa"]],t.CLICK_DOM_QUERY_TABLE=[["#item0 .item-click-border","#item1 .item-click-border","#item2 .item-click-border"],["#item3 .item-click-border","#item4 .item-click-border","#item5 .item-click-border"],["#item6 .item-click-border","#item7 .item-click-border","#item8 .item-click-border"],["#item9 .item-click-border","#item10 .item-click-border","#item11 .item-click-border"],["#button-load","#button-load","#button-load"],["#button-save","#button-save","#button-save"],["#button-restart","#button-restart","#button-restart"],["#button-gotowwa"," #button-gotowwa","#button-gotowwa"]],t}(),Gt=s(23);function Ht(t){return"^ /".concat(231*t+8310,"P+>A[]")}function Kt(t){return(0,Gt.MD5)(t).toString()}var Vt="map",jt="mapObject",Xt="systemMessage",Jt="userVar",Zt={mapAttribute:!0,objectAttribute:!0,message:!0},Qt=function(){},qt=function(){function t(){}return t.compress=function(t){var e,s,a={};for(e in t)if(!Zt[e]){switch(typeof(s=t[e])){case"number":case"string":case"boolean":if(this._restartData[e]===s&&"worldName"!==e)continue;break;case"object":if(null===s){if(this._restartData[e]===s)continue}else if(void 0===(s=this.compressObject(e,s,this._restartData[e])))continue;break;case"undefined":break;case"function":continue}a[e]=s}return a},t.compressObject=function(t,e,s){var a,i,o,r;switch(t){case Vt:case jt:var n,_,h,c,u,l,p,d,E,w,y,m,f,g;for(u in a={},E={},d={},e)for(c in i=e[u],o=s[u],r={},_=-1,i)(p=i[c])!==o[c]&&(r[c]=p,void 0===E[p]&&(E[p]={}),void 0===(y=E[p])[u]&&(y[u]=[]),(f=y[u]).push(Number(c)));for(m in E)for(u in y=E[m],void 0===d[m]&&(d[m]={}),w=d[m],void 0===a[m]&&(a[m]=[]),_=-1,y)1===(f=y[u]).length?(void 0===w[l=f[0]]&&(w[l]=[]),(g=w[l]).push(Number(u))):(h=(n=Number(u))-_-1,_=n,a[m].push(this.getCompressArray(f),h));for(m in d)for(c in p=Number(m),_=-1,w=d[m])g=w[c],h=(n=Number(c))-_-1,_=n,1===g.length?a[m].push(h,g[0]):a[m].push(h,this.getCompressArray(g));var A=[];for(m in _=-1,a)h=(n=Number(m))-_-1,_=n,A.push(h,a[m]);return this._usingByteFlag&&JSON.stringify(A).length>=this._mapByteLength?this.compressMapAllObject(e,s,this._firstRandomMapObjectUtf8Table[t]):A;case Xt:var S;for(t in a={},e)S=e[t],s[t]!==S&&(a[t]=S);break;case Jt:return this.compressUserVars(e);default:return e}if(0!==Object.keys(a).length)return a},t.compressUserVars=function(t){return t.map((function(t,e){return[e,t]})).filter((function(t){t[0];return 0!==t[1]}))},t.compressMapAllObject=function(t,e,s){var a,i,o,r,n,_,h,c,u,l,p,d,E,w,y,m,f=this._restartData.mapWidth,g=new Uint8Array(this._mapByteLength),A=-1;for(o=0,r=0,_=0,h=0,y=0,p=[],w={},u=[],l=[],i=0;i<f;i++)for(a=0;a<f;a++)(c=t[i][a])!==e[i][a]&&(-1===A&&(A=r),g[r]=g[r]|1<<o,_=r,void 0===w[c]&&(w[c]=new zt(c,y++)),w[c].count++),8===++o&&(o=0,r++);for(n in w)p[w[n].index]=w[n];for(d in p.sort(this.idSort),E={},p)E[c=p[d].id]=Number(d),u[d]=c;for(i=0;i<f;i++)for(a=0;a<f;a++)(c=t[i][a])!==e[i][a]&&(l[h++]=E[c]);if(s){for(m=g.length,A=-1,_=0,r=0;r<m;r++)g[r]=g[r]&~s[r],0!==g[r]&&(-1===A&&(A=r),_=r);-1===A&&(A=0,_=0)}return[A,g.subarray(A,_+1),u,this.indexListCompress(l,u.length)]},t.indexListCompress=function(t,e){var s,a,i,o,r,n,_=[];for(o=t.length,a=0,s=0;s<o;s++){for(r=t[s],n=0,i=s+1;i<o&&r===t[i];i++)n++,s=i;switch(n){case 0:_[a++]=r;break;case 1:_[a++]=r,_[a++]=r;break;default:_[a++]=r,_[a++]=e+n}}return _},t.idSort=function(t,e){return e.count-t.count},t.getCompressArray=function(t){var e,s,a,i,o,r,n,_,h=[];for(e=-1,o=t.length,r=0,i=0;i<o;i++){for(s=(a=t[i])-e,n=0,_=i;_<o-1&&t[_]+1===t[_+1];)_++,n++;n<this.MIN_LOOP_COUNT?h[r++]=s:(i=_,a+=n,h[r++]=0,h[r++]=s,h[r++]=n-this.MIN_LOOP_COUNT),e=a}return h},t.getDecompressArray=function(t){var e,s,a,i,o,r,n,_=[];for(e=-1,o=t.length,i=0,n=0;i<o;i++)if(0===(s=t[i])){for(r=(a=e+(s=t[++i]))+t[++i]+this.MIN_LOOP_COUNT;a<=r;a++)_[n++]=a;e=r}else a=e+s,_[n++]=a,e=a;return _},t.decompress=function(t){var e,s,a;for(s in e=JSON.parse(JSON.stringify(this._restartData)),t){switch(typeof(a=t[s])){case"number":case"string":case"boolean":case"undefined":break;case"object":null!==a&&(a=this.decompressObject(s,a,e[s]));break;case"function":continue}e[s]=a}return[e,{isWorldNameEmpty:void 0===t.worldName}]},t.decompressObject=function(t,e,s){var a;switch(t){case Vt:case jt:var i,o,r,n,_,h,c,u;a={},o=-1;var l,p,d=e;if(4===(u=d.length)&&"number"==typeof d[0]&&(d[1]instanceof Uint8Array||d[1]instanceof Array)&&d[2]instanceof Array&&d[3]instanceof Array)return this.decompressAllMapObject(d,s,this._firstRandomMapObjectUtf8Table[t]),s;for(c=0;c<u;c+=2)o=i=o+Number(d[c])+1,_=i,a[i]=d[c+1];for(h in a){for(_=Number(h),u=(d=a[h]).length,l=[],p=[],c=0;c<u;c+=2){var E=d[c],w=d[c+1];E instanceof Array&&(E=this.getDecompressArray(E)),w instanceof Array&&(w=this.getDecompressArray(w)),"object"==typeof E?l.push({x:E,y:w}):p.push({x:E,y:w})}var y;for(y in o=-1,l)if(o=i=o+Number(l[y].y)+1,E=l[y].x,n=String(i),E instanceof Array)for(u=(d=E).length,c=0;c<u;c++)r=String(d[c]),s[n][r]=_;else r=String(E),s[n][r]=_;for(y in o=-1,p)if(o=i=o+Number(p[y].x)+1,w=p[y].y,r=String(i),w instanceof Array)for(u=(d=w).length,c=0;c<u;c++)s[n=String(d[c])][r]=_;else s[n=String(w)][r]=_}return s;case Jt:return this.decompressUserVars(e);default:if(s);else{if(!e)return;s=s instanceof Array?[]:{}}for(t in e)s[t]=e[t];return s}},t.decompressUserVars=function(t){return t.reduce((function(t,e){var s=e[0],a=e[1];return t[s]=a,t}),this.generateEmptyUserVars())},t.generateEmptyUserVars=function(){for(var t=new Array(Q.USER_VAR_NUM),e=0;e<Q.USER_VAR_NUM;e++)t[e]=0;return t},t.decompressAllMapObject=function(t,e,s){var a,i,o,r,n,_,h,c,u,l,p,d=this._restartData.mapWidth,E=new Uint8Array(this._mapByteLength);p=t[0],r=t[2],i=t[3];var w=t[1];if(E.set(w,p),s)for(y=E.length,u=0;u<y;u++)E[u]=E[u]|s[u];o=[];var y,m,f,g,A,S,I=r.length;for(y=i.length,m=0,f=0;m<y;m++){if((n=i[m])>=I)for(g=n-I,A=0;A<g;A++)o[f++]=S;else o[f++]=n;S=n}for(c=0,u=0,l=0,_=0,y=E.length,u=0;u<y;u++)for(c=0;c<8;c++){if(0!=(E[u]&1<<c)){if(void 0===(n=o[_++]))return!1;a=r[n],h=l%d,e[l/d|0][h]=a}l++}return!0},t.setRestartData=function(t,e){this._restartData=t,this._mapByteLength=Math.ceil(t.mapWidth*t.mapWidth/8),this._firstRandomMapObjectUtf8Table[jt]=this.getChangedUint8Array(e[jt],t[jt])},t.getChangedUint8Array=function(t,e){var s,a,i,o,r=this._restartData.mapWidth,n=new Uint8Array(this._mapByteLength),_=-1;for(i=0,o=0,a=0;a<r;a++)for(s=0;s<r;s++)t[a][s]!==e[a][s]&&(-1===_&&(_=o),n[o]=n[o]|1<<i),8===++i&&(i=0,o++);return n},t.getStartWWAData=function(t){if(!t)return this._restartData;try{var e=JSON.parse(t)}catch(t){return this._restartData}var s;if(e)try{if(s=this.decompress(e)[0])return s}catch(t){}return this._restartData},t.usingByte=function(t){this._usingByteFlag=t},t._usingByteFlag=!1,t.MIN_LOOP_COUNT=3,t._restartData=void 0,t._mapByteLength=0,t._firstRandomMapObjectUtf8Table=new Qt,t}(),zt=function(t,e){this.id=0,this.index=0,this.count=0,this.id=t,this.index=e},$t=function(){function t(t,e){this._id=0,this.flag=!1,this.date=void 0,this.cvs=void 0,this.ctx=void 0,this.quickSaveData=void 0,this._id=t,this._parent=e,this.cvs=document.createElement("canvas"),this.cvs.width=q.QUICK_SAVE_THUMNAIL_WIDTH,this.cvs.height=q.QUICK_SAVE_THUMNAIL_HEIGHT,this.ctx=this.cvs.getContext("2d",{alpha:!1})}return t.prototype.showQickLoad=function(){_t("cell-load").textContent=z.QUICK_LOAD},t.prototype.save=function(t,e){return this._statusEnergy=e.statusEnergy,this.ctx.clearRect(0,0,this.cvs.width,this.cvs.height),this.ctx.drawImage(t,0,0,t.width,t.height,0,0,this.cvs.width,this.cvs.height),this.quickSaveData=e,this.flag=!0,this.date=new Date,this.showQickLoad(),!0},t.prototype.getStatusEnergy=function(){return this.flag?this._statusEnergy:-1},t.prototype.load=function(){return this.quickSaveData},t.prototype.saveDataSet=function(t,e,s){var a=this;try{this.quickSaveData=e,this._statusEnergy=e.statusEnergy,this.date=s,this.flag=!0;var i=document.createElement("img");i.src=t,i.addEventListener("load",(function(){a.flag=!0,a.ctx.drawImage(i,0,0,i.width,i.height,0,0,a.cvs.width,a.cvs.height)})),this.showQickLoad()}catch(t){}},t.prototype.getDateText=function(){var t,e,s,a,i,o;return this.date?(t=this.date.getFullYear(),e=this.date.getMonth()+1,s=this.date.getDate(),a=this.date.getHours(),i=this.date.getMinutes(),o=this.date.getSeconds(),(t=("000"+t).slice(-4))+"/"+(e=("0"+e).slice(-2))+"/"+(s=("0"+s).slice(-2))+" "+(a=("0"+a).slice(-2))+":"+(i=("0"+i).slice(-2))+":"+(o=("0"+o).slice(-2))):""},t.prototype.isLastSaveData=function(){return this===this._parent.getLastSaveData()},t}(),te=function(){var t=function(e,s){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},t(e,s)};return function(e,s){if("function"!=typeof s&&null!==s)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function a(){this.constructor=e}t(e,s),e.prototype=null===s?Object.create(s):(a.prototype=s.prototype,new a)}}(),ee=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return te(e,t),e.prototype.save=function(e,s){var a=t.prototype.save.apply(this,arguments);return this._parent.dbUpdateSaveData(this._id,e,s,this.date),a},e}($t),se=ee,ae=function(){var t=function(e,s){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},t(e,s)};return function(e,s){if("function"!=typeof s&&null!==s)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function a(){this.constructor=e}t(e,s),e.prototype=null===s?Object.create(s):(a.prototype=s.prototype,new a)}}(),ie=function(t){function e(){var s=t.call(this)||this;return Object.setPrototypeOf(s,Object.create(e.prototype)),s}return ae(e,t),e.prototype.hasSaveData=function(){for(var t=0;t<q.QUICK_SAVE_MAX;t++)if(this[t].flag)return!0;return!1},e.prototype.getLastSaveData=function(){for(var t,e,s=0;s<q.QUICK_SAVE_MAX;s++)(e=this[s]).flag&&(t?e.date&&t.date&&e.date.getTime()>t.date.getTime()&&(t=e):t=e);return t},e}(Array),oe=function(){var t=function(e,s){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},t(e,s)};return function(e,s){if("function"!=typeof s&&null!==s)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function a(){this.constructor=e}t(e,s),e.prototype=null===s?Object.create(s):(a.prototype=s.prototype,new a)}}(),re=function(t){function e(s,a,i){void 0===i&&(i=e.prototype);var o=t.call(this)||this;o.selectLoad=!1,o.indexedDB=window.indexedDB||window.webkitIndexedDB||window.mozIndexedDB,o.IDBTransaction={READ_ONLY:"readonly",READ_WRITE:"readwrite",VERSION_CHANGE:"versionchangetransaction"},o.keyPath=["id","url"],Object.setPrototypeOf(o,Object.create(i));for(var r=0;r<q.QUICK_SAVE_MAX;r++)o[r]=new se(r,o);if(o.indexedDB)try{o.indexedDB.open||(o.indexedDB=null)}catch(t){o.indexedDB=null}try{o.indexedDB.open("test").error&&(o.indexedDB=null)}catch(t){}return o.indexedDB?(o.onCheckLoadingSaveData=s,o.onCompleteLoadingSaveData=a,o.createDataBase(),o.selectSaveData(),o):o}return oe(e,t),e.prototype.getAlEmulate=function(){var t=function(t){var e=this.openCursor(t),s=[],a={onsuccess:null,onerror:null};return e.onsuccess=function(t){var e=t.target.result;if(null===e){var i={target:{result:s}};"function"==typeof a.onsuccess&&a.onsuccess(i)}else s.push(t.target.result.value),e.continue()},e.onerror=function(t){"function"==typeof a.onerror&&a.onerror(t)},a};void 0===window.IDBIndex.prototype.getAll&&(window.IDBIndex.prototype.getAll=t),void 0===window.IDBObjectStore.prototype.getAll&&(window.IDBObjectStore.prototype.getAll=t)},e.prototype.indexDBOpen=function(){return this.getAlEmulate(),this.indexedDB.open(q.INDEXEDDB_DB_NAME,201205201)},e.prototype.createDataBase=function(){var t=this;try{var s=this.indexDBOpen();s.onupgradeneeded=function(e){var a=s.result,i={keyPath:t.keyPath};a.objectStoreNames.contains(q.INDEXEDDB_TABLE_NAME)||a.createObjectStore(q.INDEXEDDB_TABLE_NAME,i).createIndex("url","url",{unique:!1})},s.onsuccess=e.doNotAnything,s.onerror=e.doNotAnything,s.onblocked=function(e){t.indexedDB=null}}catch(t){}},e.prototype.getObjectStore=function(t){var e=t;try{var s=e.transaction(q.INDEXEDDB_TABLE_NAME,this.IDBTransaction.READ_WRITE).objectStore(q.INDEXEDDB_TABLE_NAME)}catch(t){return}return s},e.prototype.makeSaveDataItem=function(t,e,s,a){return{url:location.href,id:t,hash:ye.checkOriginalMapString,image:e.toDataURL(),data:s,date:a,worldName:ye.worldName,mapDataRevisionKey:ye.mapDataRevisionKey}},e.prototype.getSaveDataResult=function(t,e){var s=this,a=t.index("url"),i=IDBKeyRange.only(location.href),o=a.getAll(i);o.onsuccess=function(){e(o.result)},o.onerror=function(){s.indexedDB=null}},e.prototype.dbUpdateSaveData=function(t,s,a,i){var o=this;if(this.indexedDB){var r=this.indexDBOpen();r.onupgradeneeded=e.doNotAnything,r.onsuccess=function(n){var _=o.getObjectStore(r.result),h=qt.compress(a),c=o.makeSaveDataItem(t,s,h,i);o.selectDatas[t]=c;try{var u=_.put(c)}catch(t){return}u.onsuccess=e.doNotAnything,u.onerror=e.doNotAnything},r.onerror=e.doNotAnything,r.onblocked=e.doNotAnything}},e.prototype.dbDeleteSaveData=function(t){var s=this;if(this.indexedDB){var a=this.indexDBOpen();a.onupgradeneeded=e.doNotAnything,a.onsuccess=function(){var e=s.getObjectStore(a.result);t.forEach((function(t){e.delete([t,location.href])}))},a.onerror=e.doNotAnything,a.onblocked=e.doNotAnything}},e.prototype.selectSaveData=function(){var t=this;if(this.indexedDB){var s=this.indexDBOpen();s.onupgradeneeded=e.doNotAnything,s.onsuccess=function(){var e=t.getObjectStore(s.result);t.selectDatas=[],t.selectLoad=!1;t.getSaveDataResult(e,(function(e){var s,a,i,o=[];for(a=e.length,s=0;s<a;s++){var r=e[s];try{i={id:r.id,hash:r.hash,data:r.data,date:r.date,image:r.image,worldName:r.worldName,mapDataRevisionKey:r.mapDataRevisionKey}}catch(t){continue}var n=t.onCheckLoadingSaveData(i.worldName,i.hash,i.mapDataRevisionKey);if(null===n){if(t[i.id]){var _=qt.decompress(i.data)[0];t[i.id].saveDataSet(i.image,_,i.date)}}else o.push({id:i.id,cause:n})}o.length>0&&t.dbDeleteSaveData(o.map((function(t){return t.id}))),t.selectLoad=!0;var h=o.map((function(t){return t.cause})).filter((function(t,e,s){return s.indexOf(t)===e}));t.onCompleteLoadingSaveData(h)}))},s.onerror=e.doNotAnything,s.onblocked=e.doNotAnything}},e.doNotAnything=function(){},e}(ie),ne=function(){var t=function(e,s){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},t(e,s)};return function(e,s){if("function"!=typeof s&&null!==s)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function a(){this.constructor=e}t(e,s),e.prototype=null===s?Object.create(s):(a.prototype=s.prototype,new a)}}(),_e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ne(e,t),e}($t),he=_e,ce=function(){var t=function(e,s){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},t(e,s)};return function(e,s){if("function"!=typeof s&&null!==s)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function a(){this.constructor=e}t(e,s),e.prototype=null===s?Object.create(s):(a.prototype=s.prototype,new a)}}(),ue=function(t){function e(){var s=t.call(this)||this;s._saveNo=0,s._lastAutoSaveMove=0,s._autoInterval=q.SAVE_INTERVAL_MOVE,Object.setPrototypeOf(s,Object.create(e.prototype));for(var a=0;a<q.QUICK_SAVE_MAX;a++)s[a]=new he(a,s);return s._saveNo=0,s._lastAutoSaveMove=0,s}return ce(e,t),e.prototype.resumeStart=function(){this._lastAutoSaveMove=-1},e.prototype.setPlayer=function(t){this._lastAutoSaveMove=t.getMoveCount()},e.prototype.isAutoSaveFrame=function(t){if(0===this._autoInterval)return!1;var e=t.getMoveCount();return!(this._lastAutoSaveMove>=e)&&(e%this._autoInterval==0&&(this._lastAutoSaveMove=e,!0))},e.prototype.autoSave=function(t,e){this[this._saveNo].save(t,e),this._saveNo++,this._saveNo=this._saveNo%q.QUICK_SAVE_MAX},e.prototype.setAutoSaveInterval=function(t){t<0?console.warn("オートセーブの歩数 (".concat(t,") に負の値が設定されています。")):this._autoInterval=0|t},e}(ie),le=function(){var t=function(e,s){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},t(e,s)};return function(e,s){if("function"!=typeof s&&null!==s)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function a(){this.constructor=e}t(e,s),e.prototype=null===s?Object.create(s):(a.prototype=s.prototype,new a)}}(),pe=function(t){function e(s,a){var i=t.call(this,s,a,e.prototype)||this;return i.keyPath="urlWithId",i}return le(e,t),e.prototype.makeSaveDataItem=function(t,e,s,a){return{url:location.href,id:t,hash:ye.checkOriginalMapString,image:e.toDataURL(),data:s,date:a,worldName:ye.worldName,urlWithId:location.href+" "+t,mapDataRevisionKey:ye.mapDataRevisionKey}},e.prototype.getSaveDataResult=function(t,e){for(var s=[],a=0,i=function(i){var o=t.get(location.href+" "+i);o.onsuccess=function(){s.push(o.result),++a>=q.QUICK_SAVE_MAX&&e(s)},o.onerror=function(){s.push(null),++a>=q.QUICK_SAVE_MAX&&e(s)}},o=0;o<q.QUICK_SAVE_MAX;o++)i(o)},e}(re);function de(t,e){return(0,Gt.MD5)(t+e).toString()}var Ee,we=function(){function t(e,s,a,i,o){t.checkOriginalMapString=e.checkOriginalMapString,t.worldName=s,t.mapDataRevisionKey=de(s,a),e.userDevice.browser===M.INTERNET_EXPLORER?this._wwaDBSaveList=new pe(i,o):this._wwaDBSaveList=new re(i,o),this._wwaLogSaveList=new ue,this.selectDBSaveDataList()}return t.prototype.resumeStart=function(){this._wwaLogSaveList.resumeStart()},t.prototype.isAutoSaveFrame=function(t){return this._wwaLogSaveList.isAutoSaveFrame(t)},t.prototype.autoSave=function(t,e){this._wwaLogSaveList.autoSave(t,e)},t.prototype.selectDBSaveDataList=function(){this.list=this._wwaDBSaveList},t.prototype.selectLogSaveDataList=function(){this.list=this._wwaLogSaveList},t.prototype.save=function(t,e,s){var a=this.list[s];return!!a&&a.save(t,e)},t.prototype.load=function(t){var e=this.list[t];return e?e.load():null},t.prototype.hasSaveData=function(){return this.list.hasSaveData()},t.prototype.setAutoSaveInterval=function(t){return this._wwaLogSaveList.setAutoSaveInterval(t)},t.prototype.getFirstSaveChoiceCallInfo=function(t){return t?N.CALL_BY_PASSWORD_LOAD:this._wwaDBSaveList.hasSaveData()?N.CALL_BY_QUICK_LOAD:this._wwaLogSaveList.hasSaveData()?N.CALL_BY_LOG_QUICK_LOAD:N.CALL_BY_PASSWORD_LOAD},t.prototype.getSecondSaveChoiceCallInfo=function(t){return this.list===this._wwaDBSaveList&&this._wwaLogSaveList.hasSaveData()?N.CALL_BY_LOG_QUICK_LOAD:t?N.CALL_BY_PASSWORD_LOAD:N.NONE},t.prototype.gameStart=function(t,e){this._wwaLogSaveList.setPlayer(e),this.quickSaveButtonUpdate(t)},t.prototype.quickSaveButtonUpdate=function(t){t.disableSaveFlag?_t("cell-save").textContent=z.EMPTY_SAVE:_t("cell-save").textContent=z.QUICK_SAVE},t}(),ye=we;!function(t){t.UNMATCHED_WORLD_NAME="UNMATCHED_WORLD_NAME",t.UNMATCHED_WORLD_PASS_NUMBER="UNMATCHED_WORLD_PASS_NUMBER",t.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA="DISALLOW_OLD_REVISION_WORLD_SAVE_DATA"}(Ee||(Ee={}));var me,fe=function(){function t(t){this.idx=t}return t.prototype.play=function(){},t.prototype.pause=function(){},t.prototype.isBgm=function(){return this.idx>=K.BGM_LB},t.prototype.hasData=function(){return!1},t.prototype.isError=function(){return!0},t}(),ge=function(){var t=function(e,s){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},t(e,s)};return function(e,s){if("function"!=typeof s&&null!==s)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function a(){this.constructor=e}t(e,s),e.prototype=null===s?Object.create(s):(a.prototype=s.prototype,new a)}}(),Ae=function(t){function e(e,s,a,i){var o=t.call(this,e)||this;return o.audioContext=a,o.audioGain=i,o.audioBuffer=null,o.bufferSources=[],o.isLoaded=!1,o.pos=0,o._load(e,s),o}return ge(e,t),e.prototype._load=function(t,e){var s=this,a=this.audioContext,i=new XMLHttpRequest,o=0;i.responseType="arraybuffer",i.addEventListener("load",(function(r){var n=i.status;if(0!==n&&200!==n)return console.warn("サウンド ".concat(t," 番の音声ファイルが見つかりません! HTTPエラー番号: ").concat(n)),void s._cancelLoad();a.decodeAudioData(i.response,(function(a){if(0===a.length){if(!(o>10))return setTimeout((function(){s._load(t,e)}),100),void o++;console.log("error audio file! ".concat(e," buffer size ").concat(a.length))}s._setData(a)}))})),i.open("GET",e,!0),i.send("")},e.prototype._setData=function(t){this.audioBuffer=t,this.isLoaded=!0},e.prototype._cancelLoad=function(){this.audioBuffer=null,this.isLoaded=!0},e.prototype.play=function(){var t=this;this.pos=0;var e=this.audioContext.createBufferSource();this.bufferSources.push(e),e.buffer=this.audioBuffer,this.isBgm()&&(e.loop=!0),e.connect(this.audioGain);var s=e.duration;(!isFinite(s)||s<0||"number"!=typeof s)&&(s=0),e.start(0,this.pos*s),e.onended=function(){var s=t.bufferSources.indexOf(e);-1!==s&&t.bufferSources.splice(s,1);try{e.stop(),e.disconnect(t.audioGain),e.buffer=null}catch(t){}e.onended=null},this.audioGain.connect(this.audioContext.destination)},e.prototype.pause=function(){var t=this;this.bufferSources.forEach((function(e){try{e.stop(),e.disconnect(t.audioGain),e.buffer=null}catch(t){}e.onended=null})),this.bufferSources.length=0},e.prototype.hasData=function(){return null!==this.audioBuffer},e.prototype.isLoading=function(){return!this.isLoaded},e.prototype.isError=function(){return this.isLoaded&&null===this.audioBuffer},e}(fe),Se=function(){var t=function(e,s){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},t(e,s)};return function(e,s){if("function"!=typeof s&&null!==s)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function a(){this.constructor=e}t(e,s),e.prototype=null===s?Object.create(s):(a.prototype=s.prototype,new a)}}(),Ie=function(t){function e(e,s,a){var i=t.call(this,e)||this;return i._mainElement=i._createElement(s),i._mainElement.addEventListener("error",(function(){console.warn("サウンド ".concat(e," 番の音声ファイルが見つかりません!"))})),i._subElement=i.isBgm()?null:i._createElement(s),i._currentElement=i._mainElement,i._nextIsSub=!0,a.appendChild(i._mainElement),i}return Se(e,t),e.prototype._createElement=function(t){var e=new Audio(t);return e.preload="auto",e.loop=this.isBgm(),e},e.prototype.play=function(){this._currentElement.currentTime=0,this._currentElement.play(),this.isBgm()||(this._currentElement=this._nextIsSub?this._subElement:this._mainElement,this._nextIsSub=!this._nextIsSub)},e.prototype.pause=function(){this._currentElement.pause()},e.prototype.hasData=function(){return this._mainElement.readyState>=2},e.prototype.isError=function(){return null!==this._mainElement.error},e}(fe),Te=function(t,e){for(var s=new Array(t),a=0;a<s.length;a++)s[a]=new Array(e);return s};function Oe(t,e){var s=function(t){return t[me.CHECK]+256*t[me.CHECK+1]}(t),a=function(t,e){var s,a=0;if(t[me.VERSION]>=29){for(var i=2;i<e;i++)a+=(s=t[i],((s%=256)>=128?s-256:s)*(i%8+1));a=a%65536&65535}return a}(t,e);if(s!==a)throw new Error("マップデータが壊れているようです。\n チェックサムの値は"+s+"ですが、実際の和は"+a+"でした。")}!function(t){t[t.CHECK=0]="CHECK",t[t.VERSION=2]="VERSION",t[t.OLD_MAP_COUNT=3]="OLD_MAP_COUNT",t[t.OLD_OBJ_COUNT=4]="OLD_OBJ_COUNT",t[t.OLD_PLAYER_X=5]="OLD_PLAYER_X",t[t.OLD_PLAYER_Y=6]="OLD_PLAYER_Y",t[t.STATUS_ENERGY=10]="STATUS_ENERGY",t[t.STATUS_STRENGTH=12]="STATUS_STRENGTH",t[t.STATUS_DEFENCE=14]="STATUS_DEFENCE",t[t.STATUS_GOLD=16]="STATUS_GOLD",t[t.OLD_GAMEOVER_X=18]="OLD_GAMEOVER_X",t[t.OLD_GAMEOVER_Y=19]="OLD_GAMEOVER_Y",t[t.OLD_ITEMBOX_TOP=20]="OLD_ITEMBOX_TOP",t[t.STATUS_ENERGY_MAX=32]="STATUS_ENERGY_MAX",t[t.MAP_COUNT=34]="MAP_COUNT",t[t.OBJ_COUNT=36]="OBJ_COUNT",t[t.PLAYER_X=38]="PLAYER_X",t[t.PLAYER_Y=40]="PLAYER_Y",t[t.GAMEOVER_X=42]="GAMEOVER_X",t[t.GAMEOVER_Y=44]="GAMEOVER_Y",t[t.MAP_SIZE=46]="MAP_SIZE",t[t.MESSAGE_NUM=48]="MESSAGE_NUM",t[t.ITEMBOX_TOP=60]="ITEMBOX_TOP",t[t.MAPDATA_TOP=90]="MAPDATA_TOP",t[t.OLD_MAPDATA_TOP=100]="OLD_MAPDATA_TOP"}(me||(me={}));var ve,De,Ce=function(){function t(){}return t.ITEMBOX_SIZE=12,t.MAP_ATR_MAX=60,t.OBJ_ATR_MAX=60,t.OLD_MAP_ATR_MAX=40,t.OLD_OBJ_ATR_MAX=40,t.ATR_CROP1=1,t.ATR_CROP2=2,t.ATR_TYPE=3,t.ATR_JUMP_X=16,t.ATR_JUMP_Y=17,t.MAP_LOCALGATE=2,t.OBJECT_LOCALGATE=18,t.SYSTEM_MESSAGE_NUM=20,t.IMGPOS_DEFAULT_YESNO_X=3,t.IMGPOS_DEFAULT_YESNO_Y=1,t.IMGPOS_DEFAULT_PLAYER_X=2,t.IMGPOS_DEFAULT_PLAYER_Y=0,t.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_X=0,t.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_Y=0,t.IMGPOS_DEFAULT_STATUS_X=3,t.IMGPOS_DEFAULT_STATUS_Y=2,t.IMGRELPOS_ENERGY_ICON_X=0,t.IMGRELPOS_STRENGTH_ICON_X=1,t.IMGRELPOS_DEFENCE_ICON_X=2,t.IMGRELPOS_GOLD_ICON_X=3,t.IMGPOS_DEFAULT_WIDE_CELL_X=4,t.IMGPOS_DEFAULT_WIDE_CELL_Y=3,t.IMGPOS_DEFAULT_ITEMBOX_X=1,t.IMGPOS_DEFAULT_ITEMBOX_Y=2,t.IMGPOS_DEFAULT_FRAME_X=0,t.IMGPOS_DEFAULT_FRAME_Y=1,t.IMGPOS_DEFAULT_BATTLE_EFFECT_X=3,t.IMGPOS_DEFAULT_BATTLE_EFFECT_Y=3,t.DEFAULT_DISABLE_SAVE=!1,t.DEFAULT_OLDMAP=!1,t.DEFAULT_OBJECT_NO_COLLAPSE=!1,t.DEFAULT_FRAME_COLOR_R=255,t.DEFAULT_FRAME_COLOR_G=255,t.DEFAULT_FRAME_COLOR_B=255,t.DEFAULT_FRAMEOUT_COLOR_R=96,t.DEFAULT_FRAMEOUT_COLOR_G=96,t.DEFAULT_FRAMEOUT_COLOR_B=96,t.DEFAULT_STR_COLOR_R=0,t.DEFAULT_STR_COLOR_G=0,t.DEFAULT_STR_COLOR_B=0,t.DEFAULT_STATUS_COLOR_R=0,t.DEFAULT_STATUS_COLOR_G=0,t.DEFAULT_STATUS_COLOR_B=0,t.DEFAULT_MOVES=0,t.DEFAULT_SPEED_INDEX=3,t.USER_VAR_NUM=256,t}();!function(t){t[t.MAP=1]="MAP",t[t.OBJECT=0]="OBJECT"}(ve||(ve={})),function(t){t[t.INIT=0]="INIT",t[t.MAP_LOAD=1]="MAP_LOAD",t[t.OBJ_LOAD=2]="OBJ_LOAD",t[t.MAP_ATTR=3]="MAP_ATTR",t[t.OBJ_ATTR=4]="OBJ_ATTR",t[t.RAND_PARTS=5]="RAND_PARTS",t[t.MESSAGE=6]="MESSAGE"}(De||(De={}));var Pe=function(){function t(t,e,s){this.byteMapData=t,this.eventEmitter=s,Oe(t,e),this.wwaData={version:void 0,gameoverX:void 0,gameoverY:void 0,playerX:void 0,playerY:void 0,mapPartsMax:void 0,objPartsMax:void 0,isOldMap:void 0,isOldMove:void 0,statusEnergyMax:void 0,statusEnergy:void 0,statusStrength:void 0,statusDefence:void 0,statusGold:void 0,itemBox:void 0,mapWidth:void 0,messageNum:void 0,map:void 0,mapObject:void 0,mapCompressed:void 0,mapObjectCompressed:void 0,mapAttribute:void 0,objectAttribute:void 0,worldPassword:void 0,message:void 0,worldName:void 0,worldPassNumber:void 0,charCGName:void 0,mapCGName:void 0,systemMessage:void 0,moves:void 0,yesnoImgPosX:void 0,yesnoImgPosY:void 0,playerImgPosX:void 0,playerImgPosY:void 0,clickableItemSignImgPosX:void 0,clickableItemSignImgPosY:void 0,disableSaveFlag:void 0,compatibleForOldMapFlag:void 0,objectNoCollapseDefaultFlag:void 0,delPlayerFlag:void 0,bgm:void 0,effectCoords:void 0,effectWaits:void 0,imgStatusEnergyX:void 0,imgStatusEnergyY:void 0,imgStatusStrengthX:void 0,imgStatusStrengthY:void 0,imgStatusDefenceX:void 0,imgStatusDefenceY:void 0,imgStatusGoldX:void 0,imgStatusGoldY:void 0,imgWideCellX:void 0,imgWideCellY:void 0,imgItemboxX:void 0,imgItemboxY:void 0,imgFrameX:void 0,imgFrameY:void 0,imgBattleEffectX:void 0,imgBattleEffectY:void 0,imgClickX:void 0,imgClickY:void 0,frameColorR:void 0,frameColorG:void 0,frameColorB:void 0,frameOutColorR:void 0,frameOutColorG:void 0,frameOutColorB:void 0,fontColorR:void 0,fontColorG:void 0,fontColorB:void 0,statusColorR:void 0,statusColorG:void 0,statusColorB:void 0,checkOriginalMapString:void 0,checkString:void 0,isItemEffectEnabled:void 0,frameCount:void 0,gamePadButtonItemTable:void 0,userVar:void 0,permitChangeGameSpeed:void 0,gameSpeedIndex:void 0,playTime:void 0,isVisibleStatusEnergy:void 0,isVisibleStatusStrength:void 0,isVisibleStatusDefence:void 0,isVisibleStatusGold:void 0}}return t.prototype.extractAllData=function(){var t,e;return this.wwaData.version=this.byteMapData[me.VERSION],this._extractInitialParameters(),this.wwaData.version>=29?this.currentPosition=me.MAPDATA_TOP:this.currentPosition=me.OLD_MAPDATA_TOP,this.wwaData.map=this._getFieldDataFromBits(ve.MAP,this.wwaData.mapPartsMax).concat(),this.wwaData.mapObject=this._getFieldDataFromBits(ve.OBJECT,this.wwaData.objPartsMax).concat(),t=this.wwaData.version>29?Ce.MAP_ATR_MAX:Ce.OLD_MAP_ATR_MAX,e=this.wwaData.version>29?Ce.OBJ_ATR_MAX:Ce.OLD_OBJ_ATR_MAX,this.wwaData.mapAttribute=this._getPartsDataFromBits(ve.MAP,this.wwaData.mapPartsMax,t).concat(),this.wwaData.objectAttribute=this._getPartsDataFromBits(ve.OBJECT,this.wwaData.objPartsMax,e).concat(),this.wwaData.version<=29&&(this._convertAttributeV2toV3(ve.MAP),this._convertAttributeV2toV3(ve.OBJECT)),this._replaceAllRandomObjects(),this.wwaData},t.prototype._convertAttributeV2toV3=function(t){var e,s,a;if(t==ve.MAP)e=this.wwaData.mapPartsMax,s=this.wwaData.mapAttribute,a=Ce.MAP_LOCALGATE;else{if(t!=ve.OBJECT)throw new Error("謎のパーツ種別が指定されました");e=this.wwaData.objPartsMax,s=this.wwaData.objectAttribute,a=Ce.OBJECT_LOCALGATE}for(var i=0;i<e;i++){for(var o=9;o>=0;o--){var r=255&s[i][20+2*o],n=s[i][20+2*o]>>8,_=255&s[i][20+2*o+1],h=s[i][20+2*o+1]>>8;250===_?_=9e3:_>100&&(_+=9840),250===h?h=9e3:h>100&&(h+=9840),s[i][20+4*o]=r,s[i][20+4*o+3]=n,s[i][20+4*o+1]=_,s[i][20+4*o+2]=h}s[i][Ce.ATR_TYPE]===a&&(s[i][Ce.ATR_JUMP_X]>100&&(s[i][Ce.ATR_JUMP_X]+=9840),s[i][Ce.ATR_JUMP_Y]>100&&(s[i][Ce.ATR_JUMP_Y]+=9840))}},t.prototype._get1ByteNumber=function(t){return this.byteMapData[t]},t.prototype._get2BytesNumber=function(t){return this.byteMapData[t]+256*this.byteMapData[t+1]},t.prototype._extractInitialParameters=function(){this.wwaData.version>29?(this.wwaData.gameoverX=this._get2BytesNumber(me.GAMEOVER_X),this.wwaData.gameoverY=this._get2BytesNumber(me.GAMEOVER_Y),this.wwaData.playerX=this._get2BytesNumber(me.PLAYER_X),this.wwaData.playerY=this._get2BytesNumber(me.PLAYER_Y),this.wwaData.mapPartsMax=this._get2BytesNumber(me.MAP_COUNT),this.wwaData.objPartsMax=this._get2BytesNumber(me.OBJ_COUNT),this.wwaData.isOldMap=!1):(this.wwaData.gameoverX=this._get1ByteNumber(me.OLD_GAMEOVER_X),this.wwaData.gameoverY=this._get1ByteNumber(me.OLD_GAMEOVER_Y),this.wwaData.playerX=this._get1ByteNumber(me.OLD_PLAYER_X),this.wwaData.playerY=this._get1ByteNumber(me.OLD_PLAYER_Y),this.wwaData.mapPartsMax=this._get1ByteNumber(me.OLD_MAP_COUNT),this.wwaData.objPartsMax=this._get1ByteNumber(me.OLD_OBJ_COUNT),this.wwaData.isOldMap=!0),this.wwaData.statusEnergyMax=this._get2BytesNumber(me.STATUS_ENERGY_MAX),this.wwaData.statusEnergy=this._get2BytesNumber(me.STATUS_ENERGY),this.wwaData.statusStrength=this._get2BytesNumber(me.STATUS_STRENGTH),this.wwaData.statusDefence=this._get2BytesNumber(me.STATUS_DEFENCE),this.wwaData.statusGold=this._get2BytesNumber(me.STATUS_GOLD),this._extractInitialItemData(),this.wwaData.mapWidth=this._get2BytesNumber(me.MAP_SIZE),this.wwaData.messageNum=this._get2BytesNumber(me.MESSAGE_NUM),this.wwaData.version<28?this.wwaData.mapWidth=71:this.wwaData.version<=29&&(this.wwaData.mapWidth=101)},t.prototype._extractInitialItemData=function(){var t=this.wwaData.version>29?me.ITEMBOX_TOP:me.OLD_ITEMBOX_TOP;this.wwaData.itemBox=new Array(Ce.ITEMBOX_SIZE);for(var e=0;e<Ce.ITEMBOX_SIZE;e++)this.wwaData.itemBox[e]=this._get1ByteNumber(t+e)},t.prototype._getFieldDataFromBits=function(t,e){var s,a,i;for(i=Te(this.wwaData.mapWidth,this.wwaData.mapWidth),s=0;s<this.wwaData.mapWidth;s++)for(a=0;a<this.wwaData.mapWidth;a++)this.wwaData.version>29?(i[s][a]=this._get2BytesNumber(this.currentPosition),this.currentPosition+=2):(i[s][a]=this._get1ByteNumber(this.currentPosition),this.currentPosition+=1),(s*this.wwaData.mapWidth+a)%200==0&&this.emitProgress(s*this.wwaData.mapWidth+a,this.wwaData.mapWidth*this.wwaData.mapWidth,t===ve.MAP?De.MAP_LOAD:De.OBJ_LOAD),i[s][a]>=e&&(i[s][a]=0);return this.emitProgress(this.wwaData.mapWidth*this.wwaData.mapWidth,this.wwaData.mapWidth*this.wwaData.mapWidth,t===ve.MAP?De.MAP_LOAD:De.OBJ_LOAD),i},t.prototype._getPartsDataFromBits=function(t,e,s){var a,i,o;for(o=Te(e,s),a=0;a<e;a++)for(i=0;i<s;i++)(a*this.wwaData.mapWidth+i)%200==0&&this.emitProgress(a*s+i,e*s,t===ve.MAP?De.MAP_ATTR:De.OBJ_ATTR),i!==Ce.ATR_CROP1&&i!==Ce.ATR_CROP2?(o[a][i]=this._get2BytesNumber(this.currentPosition),this.currentPosition+=2):(o[a][i]=0,this.currentPosition+=2);return this.emitProgress(e*s,e*s,t===ve.MAP?De.MAP_ATTR:De.OBJ_ATTR),o},t.prototype._replaceAllRandomObjects=function(){this.emitProgress(this.wwaData.mapWidth*this.wwaData.mapWidth,this.wwaData.mapWidth*this.wwaData.mapWidth,De.RAND_PARTS)},t.prototype.emitProgress=function(t,e,s){this.eventEmitter.dispatch("progress",{current:t,total:e,stage:s})},t}();var Me,Ne=function(){function t(t,e,s,a){this.wwaData=t,this.compressedMapData=e,this.startPosition=s,this.eventEmitter=a,this.OLDVER_MESSAGE_MAX=400}return t.prototype.load=function(){var t=this.wwaData;this.currentPos=this.startPosition,t.version>=30&&(t.worldPassword=this.getMessageFromData()),t.version<=29&&(t.messageNum=this.OLDVER_MESSAGE_MAX),t.message=new Array(t.messageNum);for(var e=0;e<t.message.length;e++)t.message[e]=this.getMessageFromData(),e%200==0&&this.eventEmitter.dispatch("progress",{current:e,total:t.message.length,stage:De.MESSAGE});for(;t.messageNum<10;)t.message.push(""),t.messageNum++;this.eventEmitter.dispatch("progress",{current:t.message.length,total:t.message.length,stage:De.MESSAGE}),t.worldName=this.getMessageFromData(),t.version<=29?t.worldPassword=this.getMessageFromData():this.getMessageFromData(),""===t.worldPassword?t.worldPassNumber=0:t.version>=29?t.worldPassNumber=(parseInt(t.worldPassword)/10-1197)/17-2357:t.worldPassNumber=parseInt(t.worldPassword),t.charCGName=this.getMessageFromData(),t.mapCGName=this.getMessageFromData(),t.systemMessage=new Array(Ce.SYSTEM_MESSAGE_NUM);for(e=0;e<Ce.SYSTEM_MESSAGE_NUM;e++)t.version>=30?t.systemMessage[e]=this.getMessageFromData():t.systemMessage[e]="";t.yesnoImgPosX=Ce.IMGPOS_DEFAULT_YESNO_X,t.yesnoImgPosY=Ce.IMGPOS_DEFAULT_YESNO_Y,t.playerImgPosX=Ce.IMGPOS_DEFAULT_PLAYER_X,t.playerImgPosY=Ce.IMGPOS_DEFAULT_PLAYER_Y,t.clickableItemSignImgPosX=Ce.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_X,t.clickableItemSignImgPosY=Ce.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_Y,t.disableSaveFlag=Ce.DEFAULT_DISABLE_SAVE,t.isOldMap=Ce.DEFAULT_OLDMAP,t.isOldMove=t.version<31,t.objectNoCollapseDefaultFlag=Ce.DEFAULT_OBJECT_NO_COLLAPSE,t.delPlayerFlag=!1,t.bgm=0,t.effectCoords=[],t.effectWaits=0,t.imgStatusEnergyX=Ce.IMGPOS_DEFAULT_STATUS_X+Ce.IMGRELPOS_ENERGY_ICON_X,t.imgStatusEnergyY=Ce.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusStrengthX=Ce.IMGPOS_DEFAULT_STATUS_X+Ce.IMGRELPOS_STRENGTH_ICON_X,t.imgStatusStrengthY=Ce.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusDefenceX=Ce.IMGPOS_DEFAULT_STATUS_X+Ce.IMGRELPOS_DEFENCE_ICON_X,t.imgStatusDefenceY=Ce.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusGoldX=Ce.IMGPOS_DEFAULT_STATUS_X+Ce.IMGRELPOS_GOLD_ICON_X,t.imgStatusGoldY=Ce.IMGPOS_DEFAULT_STATUS_Y,t.imgWideCellX=Ce.IMGPOS_DEFAULT_WIDE_CELL_X,t.imgWideCellY=Ce.IMGPOS_DEFAULT_WIDE_CELL_Y,t.imgItemboxX=Ce.IMGPOS_DEFAULT_ITEMBOX_X,t.imgItemboxY=Ce.IMGPOS_DEFAULT_ITEMBOX_Y,t.imgFrameX=Ce.IMGPOS_DEFAULT_FRAME_X,t.imgFrameY=Ce.IMGPOS_DEFAULT_FRAME_Y,t.imgBattleEffectX=Ce.IMGPOS_DEFAULT_BATTLE_EFFECT_X,t.imgBattleEffectY=Ce.IMGPOS_DEFAULT_BATTLE_EFFECT_Y,t.imgClickX=0,t.imgClickY=0,t.frameColorR=Ce.DEFAULT_FRAME_COLOR_R,t.frameColorG=Ce.DEFAULT_FRAME_COLOR_G,t.frameColorB=Ce.DEFAULT_FRAME_COLOR_B,t.frameOutColorR=Ce.DEFAULT_FRAMEOUT_COLOR_R,t.frameOutColorG=Ce.DEFAULT_FRAMEOUT_COLOR_G,t.frameOutColorB=Ce.DEFAULT_FRAMEOUT_COLOR_B,t.fontColorR=Ce.DEFAULT_STR_COLOR_R,t.fontColorG=Ce.DEFAULT_STR_COLOR_G,t.fontColorB=Ce.DEFAULT_STR_COLOR_B,t.statusColorR=Ce.DEFAULT_STATUS_COLOR_R,t.statusColorG=Ce.DEFAULT_STATUS_COLOR_G,t.statusColorB=Ce.DEFAULT_STATUS_COLOR_B,t.moves=Ce.DEFAULT_MOVES,t.gameSpeedIndex=Ce.DEFAULT_SPEED_INDEX,t.permitChangeGameSpeed=!0,t.userVar=new Array(Ce.USER_VAR_NUM);for(e=0;e<Ce.USER_VAR_NUM;e++)t.userVar[e]=0;return t.playTime=0,t.isVisibleStatusEnergy=!0,t.isVisibleStatusStrength=!0,t.isVisibleStatusDefence=!0,t.isVisibleStatusGold=!0,t},t.prototype.getMessageFromData=function(){var t="",e=0;for(e=0;e<1500&&(0!=this.compressedMapData[this.currentPos+2*e]||0!=this.compressedMapData[this.currentPos+2*e+1]);e++)t+=String.fromCharCode((this.compressedMapData[this.currentPos+2*e+1]<<8)+this.compressedMapData[this.currentPos+2*e]);return this.currentPos+=2*e+2,t},t}(),Re=function(){},Le=function(){var t=function(e,s){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},t(e,s)};return function(e,s){if("function"!=typeof s&&null!==s)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function a(){this.constructor=e}t(e,s),e.prototype=null===s?Object.create(s):(a.prototype=s.prototype,new a)}}(),be=function(t){function e(e){var s=t.call(this)||this;return s.uri=e,s}return Le(e,t),e.prototype.request=function(t){var e=this,s=new XMLHttpRequest;try{s.open("GET",this.uri,!0),s.responseType="arraybuffer",s.onloadend=function(){try{if(200!==s.status&&304!==s.status)throw 404===s.status?new Error("マップデータ「"+e.uri+"」が見つかりませんでした。\nHTTPステータスコードは "+s.status+"です。"):403===s.status?new Error("マップデータ「"+e.uri+"」を読み取る権限がないようです。\n管理者の方へ: マップデータのパーミッションを確認してください。\nHTTPステータスコードは "+s.status+"です。"):new Error("マップデータ「"+e.uri+"」の読み込みに失敗しました。\nHTTPステータスコードは "+s.status+"です。");t(void 0,s.response)}catch(e){t(e)}},s.send(null)}catch(e){t(new Error("ロードエラー: ローカルテストの場合は、ブラウザが対応していない可能性があります。\n"+e.message))}},e}(Re),Be=s(106),xe=s.n(Be),Ue=function(){var t=function(e,s){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},t(e,s)};return function(e,s){if("function"!=typeof s&&null!==s)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function a(){this.constructor=e}t(e,s),e.prototype=null===s?Object.create(s):(a.prototype=s.prototype,new a)}}(),We=function(t){function e(e){var s=t.call(this)||this;return s.fileName=e,s}return Ue(e,t),e.prototype.request=function(t){xe().readFile(this.fileName,(function(e,s){e?t(e):t(void 0,s.buffer)}))},e}(Re),Ye=function(){function t(t,e){this.fileName=t,this.eventEmitter=e}return t.prototype.requestAndLoadMapData=function(){var t,e=this;(t=this.fileName,"undefined"!=typeof window?new be(t):new We(t)).request((function(t,s){if(t){var a=t.name||"",i=t.message||"";e.eventEmitter.dispatch("error",{name:a,message:i})}else if(s){var o=e.loadMapData(s);e.eventEmitter.dispatch("mapData",o)}else e.eventEmitter.dispatch("error",{name:"マップデータ取得に失敗しました",message:"mapdata is empty"})}))},t.prototype.loadMapData=function(t){try{var e=new Uint8Array(t),s=function(t){var e,s,a=new Uint8Array(t.length);for(e=0,s=0;e<t.length&&(0!==t[e]||0!==t[e+1]||0!==t[e+2]);e++){if(a[s++]=t[e],t[e]===t[e+1]){for(var i=t[e+2],o=0;o<i;o++)a[s++]=t[e];e+=2}if(s+255>=a.length){var r=new Uint8Array(a.length+65e3);r.set(a),a=r}}return console.log("EXTRACT DATA = "+s+" "+e),{byteMapData:a,byteMapLength:s,compressedEndPosition:e+3}}(e),a=s.byteMapData,i=s.byteMapLength,o=s.compressedEndPosition,r=new Pe(a,i,this.eventEmitter).extractAllData();return new Ne(r,e,o,this.eventEmitter).load()}catch(t){throw t}},t}(),ke=function(){function t(t){this.target=null!=t?t:document.createElement("div")}return t.prototype.dispatch=function(t,e){var s;"function"==typeof window.CustomEvent?s=new CustomEvent(t,{detail:e}):(s=document.createEvent("CustomEvent")).initCustomEvent(t,!1,!1,e),this.target.dispatchEvent(s)},t.prototype.addListener=function(t,e){var s=function(t){return e(t.detail)};return this.target.addEventListener(t,s),s},t.prototype.removeListener=function(t,e){this.target.removeEventListener(t,e)},t}(),Fe=function(t,e,s){if(s||2===arguments.length)for(var a,i=0,o=e.length;i<o;i++)!a&&i in e||(a||(a=Array.prototype.slice.call(e,0,i)),a[i]=e[i]);return t.concat(a||Array.prototype.slice.call(e))};function Ge(t,e,s){var a=new $;return a.current=t,a.total=e,a.stage=s,a}var He=function(){function s(s,i,n,h,p,d,m,f,A){var S,I=this;void 0===i&&(i=!1),void 0===m&&(m=""),void 0===f&&(f=!1),void 0===A&&(A=null),this._useSuspend=!1,this._useLookingAround=!0,this._isDisallowLoadOldSave=!1,this.audioExtension="",this.soundLoadedCheckTimer=void 0,this.mainCaller=function(){return I._main()},this.soundCheckCaller=function(){return I.checkAllSoundLoaded()},this._checkTurnKeyPressed=function(){return I._keyStore.checkHitKey(e.KEY_ESC)||I._keyStore.checkHitKey(e.KEY_SHIFT)||I._keyStore.checkHitKey(e.KEY_N)},this._saveDataList=[],this.wwaCustomEventEmitter=new ke(_t("wwa-wrapper")),window.addEventListener("click",(function(t){I._isActive=!1})),_t("wwa-wrapper").addEventListener("click",(function(t){t.stopPropagation(),I._isActive=!0})),this._isActive=!0,null===n?(this._hasTitleImg=!1,this._cvsCover=_t("progress-panel"),(S=this._cvsCover.getContext("2d")).fillStyle="rgb(0, 0, 0)"):this._hasTitleImg=!0;try{this._hasTitleImg?_t("version").textContent="WWA Wing Ver.3.6.11":this._setLoadingMessage(S,0)}catch(t){}this._dumpElement=A;var T=window.AudioContext||window.webkitAudioContext;T&&(this.audioContext=new T,this.audioGain=this.audioContext.createGain(),this.audioGain.gain.setValueAtTime(1,this.audioContext.currentTime));var O=new Audio;"no"!==O.canPlayType("audio/mpeg")&&""!==O.canPlayType("audio/mpeg")?this.audioExtension="mp3":this.audioExtension="m4a",this.userDevice=new U,this._isURLGateEnable=i,this._isClassicModeEnable=h,this._mainCallCounter=0,this._animationCounter=0,this._statusPressCounter=new E(0,0,0,0),m?"/"!==m[m.length-1]&&(m+="/"):m="./audio/",this._audioDirectory=m,this._bottomButtonType=d?c.GOTO_WWA:c.BATTLE_REPORT;var v=(new Date).getTime();if(!!location.href.match(/^file/))if(this.userDevice.device===P.GAME){if(this.userDevice.os===C.NINTENDO)Q.BATTLE_INTERVAL_FRAME_NUM=5;this._bottomButtonType=c.GAME_END}else alert("【警告】直接HTMLファイルを開いているようです。\nこのプログラムは正常に動作しない可能性があります。\nマップデータの確認を行う場合には同梱の「wwa-server.exe」をご利用ください。\n"+(this.userDevice.browser===M.FIREFOX?"Firefoxの場合も、バージョン68以降はローカルのHTMLファイルを直接開いた場合、通常起動できないことを確認しております。":""));switch(this.userDevice.device){case P.VR:case P.GAME:this._usePassword=!1;break;default:this._usePassword=!0}switch(_t("cell-save").textContent=z.QUICK_SAVE,this._usePassword?_t("cell-load").textContent=z.PASSWORD:_t("cell-load").textContent=z.EMPTY_LOAD,this._bottomButtonType){case c.GOTO_WWA:_t("cell-gotowwa").textContent=z.GOTO_WWA;break;case c.BATTLE_REPORT:_t("cell-gotowwa").textContent=z.BATTLE_REPORT;break;case c.GAME_END:_t("cell-gotowwa").textContent=z.GAME_END}this._loadHandler=function(s){I._wwaData=s,I._wwaData.isItemEffectEnabled=p;try{I._hasTitleImg?_t("version").textContent+=" (Map data Ver. "+Math.floor(I._wwaData.version/10)+"."+ +I._wwaData.version%10+")":I._setLoadingMessage(S,1)}catch(t){}var i=_t("wwa-wrapper").getAttribute("data-wwa-mapdata").split("/");i.pop(),i.push(I._wwaData.mapCGName),I._wwaData.mapCGName=i.join("/"),I._startTime=(new Date).getTime(),I._restartData=JSON.parse(JSON.stringify(I._wwaData)),I.checkOriginalMapString=I._generateMapDataHash(I._restartData),I.initCSSRule(),I._setProgressBar(Ge(0,4,j.GAME_INIT)),I._setLoadingMessage(S,2);var n=new Image;n.src=I._wwaData.mapCGName,n.addEventListener("error",(function(){I._setErrorMessage("画像ファイル「"+I._wwaData.mapCGName+"」が見つかりませんでした。\n管理者の方へ: データがアップロードされているか、\nパーミッションを確かめてください。",S)}));var h=I._wwaData.mapCGName.replace("(","\\(").replace(")","\\)"),c=function(t){t.style.backgroundImage="url("+h+")"};Array.prototype.forEach.call(ut("div.item-cell"),(function(t){t.style.backgroundPosition="-".concat(I._wwaData.imgItemboxX*Q.CHIP_SIZE,"px -").concat(I._wwaData.imgItemboxY*Q.CHIP_SIZE,"px"),t.style.backgroundImage="url("+h+")"})),Array.prototype.forEach.call(ut("div.wide-cell-row"),(function(t){t.style.backgroundPosition="-160px -120px",t.style.backgroundImage="url("+h+")"})),Array.prototype.forEach.call(ut(".item-cell>.item-click-border"),(function(t){t.style.backgroundImage="url('"+Q.ITEM_BORDER_IMG_DATA_URL+"')",t.style.backgroundPosition="0 0",t.style.display="none",t.style.cursor="pointer"})),Array.prototype.forEach.call(ut(".item-cell>.item-disp"),c),Array.prototype.forEach.call(ut("div.wide-cell-row>.status-icon"),c),I.setStatusIconCoord(H.ENERGY,new w(I._wwaData.imgStatusEnergyX,I._wwaData.imgStatusEnergyY)),I.setStatusIconCoord(H.STRENGTH,new w(I._wwaData.imgStatusStrengthX,I._wwaData.imgStatusStrengthY)),I.setStatusIconCoord(H.DEFENCE,new w(I._wwaData.imgStatusDefenceX,I._wwaData.imgStatusDefenceY)),I.setStatusIconCoord(H.GOLD,new w(I._wwaData.imgStatusGoldX,I._wwaData.imgStatusGoldY)),I._setProgressBar(Ge(1,4,j.GAME_INIT)),I._setLoadingMessage(S,3),I._mapIDTableCreate(),I._replaceAllRandomObjects();var d=(new Date).getTime();console.log("Loading Complete!"+(d-v)+"ms"),I._cvs=_t("wwa-map");var m=I._cvs.getContext("2d",{alpha:!1});m.fillStyle="rgba( 255, 255, 255, 0.5)",m.fillRect(0,0,440,440);var A=new y(I,I._wwaData.playerX,I._wwaData.playerY);I._camera=new yt(A),I._itemMenu=new Ft;var T=new E(I._wwaData.statusEnergy,I._wwaData.statusStrength,I._wwaData.statusDefence,I._wwaData.statusGold);I._player=new At(I,A,I._camera,T,I._wwaData.statusEnergyMax,I._wwaData.moves,I._wwaData.gameSpeedIndex),I._objectMovingDataManager=new Tt(I,I._player),I._camera.setPlayer(I._player),I._keyStore=new o,I._mouseStore=new _,I._gamePadStore=new l,I._messageQueue=[],I._yesNoJudge=g.UNSELECTED,I._yesNoJudgeInNextFrame=g.UNSELECTED,I._yesNoChoiceCallInfo=N.NONE,I._prevFrameEventExected=!1,I._lastMessage=new vt([],!1,!1,[]),I._execMacroListInNextFrame=[],I._passwordLoadExecInNextFrame=!1,I._messageWindow=new bt(I,50,180,340,0,I._wwaData.mapCGName,!1,!0,!1,_t("wwa-wrapper")),I._scoreWindow=new Rt(I,new w(50,50),!1,_t("wwa-wrapper")),I._wwaSave=new ye(Me,Me._wwaData.worldName,Me._wwaData.worldPassNumber,I._checkSaveDataCompatibility.bind(I),(function(t){if(t.length>0){var e="これまでに保存されていたセーブデータは、下記の理由により消えたものがあります。";t.forEach((function(t){switch(t){case Ee.UNMATCHED_WORLD_NAME:e+="\n・制作者によるマップデータのワールド名の変更";break;case Ee.UNMATCHED_WORLD_PASS_NUMBER:e+="\n・制作者によるマップデータの暗証番号の変更";break;case Ee.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA:e+="\n・制作者によるマップデータの内容変更 (マップデータ制作者の設定により、内容が変更されるとセーブデータが消去されます)"}})),alert(e)}})),I._isDisallowLoadOldSave=f,I._messageWindow.setWWASave(I._wwaSave),qt.setRestartData(I._restartData,I._wwaData),I.clearFaces();var O=_t("wwa-wrapper").getAttribute("data-wwa-resume-savedata");if("string"==typeof O&&(I._useSuspend=!0,O)){var D=qt.getStartWWAData(O);I._restartData!==D&&(I._applyQuickLoad(D),I._wwaSave.resumeStart())}var M=_t("wwa-wrapper").getAttribute("data-wwa-autosave");null!==M&&I._wwaSave.setAutoSaveInterval(0|Number(M));var L=_t("wwa-wrapper").getAttribute("data-wwa-looking-around");if(I._useLookingAround=!(L&&L.match(/false/i)),I._setProgressBar(Ge(2,4,j.GAME_INIT)),I._setLoadingMessage(S,4),window.addEventListener("keydown",(function(t){if(I._isActive){if(I.userDevice.os===C.NINTENDO)return t.preventDefault(),void t.stopPropagation();I._keyStore.setPressInfo(t.keyCode),t.keyCode!==e.KEY_F5?I._player.isWaitingMessage()?t.keyCode!==e.KEY_DOWN&&t.keyCode!==e.KEY_LEFT&&t.keyCode!==e.KEY_RIGHT&&t.keyCode!==e.KEY_UP&&t.keyCode!==e.KEY_SHIFT&&t.keyCode!==e.KEY_ENTER&&t.keyCode!==e.KEY_ESC&&t.keyCode!==e.KEY_SPACE||t.preventDefault():I._player.isWaitingPasswordWindow()||t.keyCode!==e.KEY_DOWN&&t.keyCode!==e.KEY_LEFT&&t.keyCode!==e.KEY_RIGHT&&t.keyCode!==e.KEY_UP&&t.keyCode!==e.KEY_SHIFT&&t.keyCode!==e.KEY_ENTER&&t.keyCode!==e.KEY_1&&t.keyCode!==e.KEY_2&&t.keyCode!==e.KEY_3&&t.keyCode!==e.KEY_A&&t.keyCode!==e.KEY_C&&t.keyCode!==e.KEY_D&&t.keyCode!==e.KEY_E&&t.keyCode!==e.KEY_M&&t.keyCode!==e.KEY_N&&t.keyCode!==e.KEY_Q&&t.keyCode!==e.KEY_S&&t.keyCode!==e.KEY_W&&t.keyCode!==e.KEY_X&&t.keyCode!==e.KEY_Y&&t.keyCode!==e.KEY_Z&&t.keyCode!==e.KEY_ESC&&t.keyCode!==e.KEY_F1&&t.keyCode!==e.KEY_F2&&t.keyCode!==e.KEY_F3&&t.keyCode!==e.KEY_F4&&t.keyCode!==e.KEY_F6&&t.keyCode!==e.KEY_F7&&t.keyCode!==e.KEY_F8&&t.keyCode!==e.KEY_F12&&t.keyCode!==e.KEY_SPACE||t.preventDefault():t.preventDefault()}})),window.addEventListener("keyup",(function(t){if(I._isActive){if(I.userDevice.os===C.NINTENDO)return t.preventDefault(),void t.stopPropagation();I._keyStore.setReleaseInfo(t.keyCode),t.keyCode===e.KEY_F5?t.preventDefault():t.keyCode!==e.KEY_DOWN&&t.keyCode!==e.KEY_LEFT&&t.keyCode!==e.KEY_RIGHT&&t.keyCode!==e.KEY_UP&&t.keyCode!==e.KEY_SHIFT&&t.keyCode!==e.KEY_ENTER&&t.keyCode!==e.KEY_1&&t.keyCode!==e.KEY_2&&t.keyCode!==e.KEY_3&&t.keyCode!==e.KEY_A&&t.keyCode!==e.KEY_C&&t.keyCode!==e.KEY_D&&t.keyCode!==e.KEY_E&&t.keyCode!==e.KEY_M&&t.keyCode!==e.KEY_N&&t.keyCode!==e.KEY_Q&&t.keyCode!==e.KEY_S&&t.keyCode!==e.KEY_W&&t.keyCode!==e.KEY_X&&t.keyCode!==e.KEY_Y&&t.keyCode!==e.KEY_Z&&t.keyCode!==e.KEY_ESC&&t.keyCode!==e.KEY_F1&&t.keyCode!==e.KEY_F3&&t.keyCode!==e.KEY_F4&&t.keyCode!==e.KEY_F6&&t.keyCode!==e.KEY_F7&&t.keyCode!==e.KEY_F8&&t.keyCode!==e.KEY_F9&&t.keyCode!==e.KEY_F12&&t.keyCode!==e.KEY_SPACE||I._player.isWaitingMessage()||I._player.isWaitingPasswordWindow()||t.preventDefault()}})),window.addEventListener("blur",(function(t){I._keyStore.allClear(),I._mouseStore.clear()})),window.addEventListener("contextmenu",(function(t){I._keyStore.allClear(),I._mouseStore.clear()})),window.addEventListener("help",(function(t){I._isActive&&t.preventDefault()})),I._mouseControllerElement=_t("wwa-controller"),I._mouseControllerElement.addEventListener("mousedown",(function(t){if(I._isActive&&1===t.which){if(I._mouseStore.getMouseState()!==a.NONE)return void t.preventDefault();var e=lt(t.clientX,t.clientY),s=I._player.getDrawingCenterPosition(),i=e.substract(s),o=Math.abs(i.x),r=Math.abs(i.y),n=void 0,_=!1;if(o<Q.CHIP_SIZE&&r<Q.CHIP_SIZE){switch(s.x/Q.CHIP_SIZE|0){case 0:_=!0,n=u.LEFT;break;case Q.H_PARTS_NUM_IN_WINDOW-1:_=!0,n=u.RIGHT}switch(s.y/Q.CHIP_SIZE|0){case 0:_=!0,n=u.UP;break;case Q.V_PARTS_NUM_IN_WINDOW-1:_=!0,n=u.DOWN}}_||(i.y>0&&r>o?n=u.DOWN:i.y<0&&r>o?n=u.UP:i.x>0&&r<o?n=u.RIGHT:i.x<0&&r<o&&(n=u.LEFT)),I._mouseStore.setPressInfo(n,0)}})),I._mouseControllerElement.addEventListener("mouseleave",(function(t){I._mouseStore.clear()})),I._mouseControllerElement.addEventListener("mouseup",(function(t){I._isActive&&1===t.which&&(I._mouseStore.setReleaseInfo(),t.preventDefault())})),window.TouchEvent){if(I.audioContext){var b=function(){I.audioContext.createBufferSource().start(0),I._mouseControllerElement.removeEventListener("touchstart",b),b=null};I._mouseControllerElement.addEventListener("touchstart",b)}I._mouseControllerElement.addEventListener("touchstart",(function(t){if(I._isActive)if(I._mouseStore.getMouseState()===a.NONE){for(var e=t.changedTouches,s=e.length,i=0;i<s;i++){var o=e[i],r=lt(o.clientX,o.clientY),n=I._player.getDrawingCenterPosition(),_=r.substract(n),h=Math.abs(_.x),c=Math.abs(_.y),l=void 0,p=!1;if(h<Q.CHIP_SIZE&&c<Q.CHIP_SIZE){switch(n.x/Q.CHIP_SIZE|0){case 0:p=!0,l=u.LEFT;break;case Q.H_PARTS_NUM_IN_WINDOW-1:p=!0,l=u.RIGHT}switch(n.y/Q.CHIP_SIZE|0){case 0:p=!0,l=u.UP;break;case Q.V_PARTS_NUM_IN_WINDOW-1:p=!0,l=u.DOWN}}p||(_.y>0&&c>h?l=u.DOWN:_.y<0&&c>h?l=u.UP:_.x>0&&c<h?l=u.RIGHT:_.x<0&&c<h&&(l=u.LEFT)),I._mouseStore.setPressInfo(l,o.identifier)}t.cancelable&&t.preventDefault()}else t.preventDefault()}));var B=function(t){if(I._isActive)for(var e=0;e<t.changedTouches.length;e++)if(I._mouseStore.getTouchID()===t.changedTouches[e].identifier){I._mouseStore.setReleaseInfo(),t.preventDefault();break}};I._mouseControllerElement.addEventListener("touchend",B),I._mouseControllerElement.addEventListener("touchcancel",B)}_t("button-load").addEventListener("click",(function(){(I._player.isControllable()||I._messageWindow.isItemMenuChoice())&&I.onselectbutton(R.QUICK_LOAD)})),_t("button-save").addEventListener("click",(function(){(I._player.isControllable()||I._messageWindow.isItemMenuChoice())&&I.onselectbutton(R.QUICK_SAVE)})),_t("button-restart").addEventListener("click",(function(){(I._player.isControllable()||I._messageWindow.isItemMenuChoice())&&I.onselectbutton(R.RESTART_GAME)})),_t("button-gotowwa").addEventListener("click",(function(){(I._player.isControllable()||I._messageWindow.isItemMenuChoice())&&I.onselectbutton(R.GOTO_WWA,!1,!1)})),Array.prototype.forEach.call(ut(".wide-cell-row"),(function(t){t.addEventListener("click",(function(){I._displayHelp()}))})),I._frameCoord=new w(Q.IMGPOS_DEFAULT_FRAME_X,Q.IMGPOS_DEFAULT_YESNO_Y),I._battleEffectCoord=new w(Q.IMGPOS_DEFAULT_BATTLE_EFFECT_X,Q.IMGPOS_DEFAULT_BATTLE_EFFECT_Y),I._battleEstimateWindow=new xt(I,I._wwaData.mapCGName,_t("wwa-wrapper")),I._passwordWindow=new Yt(I,_t("wwa-wrapper"),f),I._monsterWindow=new Nt(I,new w(50,180),340,60,!1,_t("wwa-wrapper"),I._wwaData.mapCGName),I._setProgressBar(Ge(3,4,j.GAME_INIT)),I._isLoadedSound=!1,I._temporaryInputDisable=!1,I._paintSkipByDoorOpen=!1,I._clearFacesInNextFrame=!1,I._useConsole=!1,I.wwaCustomEvent("wwa_startup"),I._cgManager=new wt(m,I._wwaData.mapCGName,I._frameCoord,(function(){I._isSkippedSoundMessage=!0;var s=function(){switch(I.userDevice.device){case P.PC:I.setMessageQueue("ゲームを開始します。\n画面をクリックしてください。",!1,!0);break;case P.SP:I.setMessageQueue("ゲームを開始します。\n画面にふれてください。",!1,!0)}};if("ON"===I._wwaData.systemMessage[Y.LOAD_SE])return I._isLoadedSound=!0,s(),I._setLoadingMessage(S,j.AUDIO),I.loadSound(),void window.requestAnimationFrame(I.soundCheckCaller);if("OFF"===I._wwaData.systemMessage[Y.LOAD_SE])return I._isLoadedSound=!1,s(),void I.openGameWindow();if(I._isSkippedSoundMessage=!1,I._hasTitleImg||S.clearRect(0,0,Q.SCREEN_WIDTH,Q.SCREEN_HEIGHT),I._usePassword){I._messageWindow.setParsedMessage(new vt(""===I._wwaData.systemMessage[Y.LOAD_SE]?"効果音・BGMデータをロードしますか?":I._wwaData.systemMessage[Y.LOAD_SE],!0)),I._messageWindow.show(),I._setProgressBar(Ge(4,4,j.GAME_INIT));var a=setInterval((function(){I._keyStore.update(),I._gamePadStore.update(),I._yesNoJudgeInNextFrame===g.UNSELECTED&&(I._keyStore.getKeyState(e.KEY_ENTER)===t.KEYDOWN||I._keyStore.getKeyState(e.KEY_Y)===t.KEYDOWN||I._gamePadStore.buttonTrigger(r.BUTTON_INDEX_A)?I._yesNoJudgeInNextFrame=g.YES:(I._keyStore.getKeyState(e.KEY_N)===t.KEYDOWN||I._keyStore.getKeyState(e.KEY_ESC)===t.KEYDOWN||I._gamePadStore.buttonTrigger(r.BUTTON_INDEX_B))&&(I._yesNoJudgeInNextFrame=g.NO)),I._yesNoJudgeInNextFrame===g.YES?(clearInterval(a),I._messageWindow.update(),I._yesNoJudge=I._yesNoJudgeInNextFrame,I._messageWindow.setInputDisable(),setTimeout((function(){I._player.setDelayFrame(),I._messageWindow.hide(),I._yesNoJudge=g.UNSELECTED,I._yesNoJudgeInNextFrame=g.UNSELECTED,I._isLoadedSound=!0,I._setLoadingMessage(S,j.AUDIO),I.loadSound(),window.requestAnimationFrame(I.soundCheckCaller)}),Q.YESNO_PRESS_DISP_FRAME_NUM*Q.DEFAULT_FRAME_INTERVAL)):I._yesNoJudgeInNextFrame===g.NO&&(clearInterval(a),I._messageWindow.update(),I._yesNoJudge=I._yesNoJudgeInNextFrame,I._messageWindow.setInputDisable(),setTimeout((function(){I._player.setDelayFrame(),I._messageWindow.hide(),I._yesNoJudge=g.UNSELECTED,I._yesNoJudgeInNextFrame=g.UNSELECTED,I._isLoadedSound=!1,I.openGameWindow()}),Q.YESNO_PRESS_DISP_FRAME_NUM*Q.DEFAULT_FRAME_INTERVAL))}),Q.DEFAULT_FRAME_INTERVAL)}else clearInterval(a),I._player.setDelayFrame(),I._messageWindow.hide(),I._yesNoJudge=g.UNSELECTED,I._yesNoJudgeInNextFrame=g.UNSELECTED,I._isLoadedSound=!0,I.loadSound(),window.requestAnimationFrame(I.soundCheckCaller)})),I.wwaCustomEvent("wwa_start")};var D=new ke;D.addListener("mapData",(function(t){return I._loadHandler(t)})),D.addListener("progress",(function(t){return I._setProgressBar(t)})),D.addListener("error",(function(t){return I._setErrorMessage("下記のエラーが発生しました。: \n"+t.message,S)})),new Ye(s,D).requestAndLoadMapData()}return s.prototype._setProgressBar=function(t){this._hasTitleImg&&(t.stage<=Q.LOAD_STAGE_MAX_EXCEPT_AUDIO?(_t("progress-message-container").textContent=t.stage===Q.LOAD_STAGE_MAX_EXCEPT_AUDIO?"World Name: "+this._wwaData.worldName:ot[t.stage],_t("progress-bar").style.width=(1*t.stage+t.current/t.total*1)/(Q.LOAD_STAGE_MAX_EXCEPT_AUDIO+1)*Q.MAP_WINDOW_WIDTH+"px",_t("progress-disp").textContent=((1*t.stage+t.current/t.total*1)/(Q.LOAD_STAGE_MAX_EXCEPT_AUDIO+1)*100).toFixed(2)+"%"):(this._usePassword?_t("progress-message-container").textContent="効果音/BGMを読み込んでいます。(スペースキーでスキップ)":_t("progress-message-container").textContent="ゲームデータを読み込んでいます。",_t("progress-bar-audio").style.width=t.current*Q.MAP_WINDOW_WIDTH/t.total+"px",_t("progress-disp").textContent=(t.current/t.total*100).toFixed(2)+"%"))},s.prototype._setLoadingMessage=function(t,e){if(!this._hasTitleImg)if(e<=0)t.font=et.TITLE+"px "+Q.LOADING_FONT,t.fillText(rt[0],tt.TITLE_X,tt.TITLE_Y),t.font=et.FOOTER+"px "+Q.LOADING_FONT,t.fillText("WWA Wing Ver.3.6.11",tt.FOOTER_X,tt.COPYRIGHT_Y);else if(e<=rt.length)t.font=et.LOADING+"px "+Q.LOADING_FONT,e>=2&&(t.clearRect(tt.LOADING_X,tt.LOADING_Y+tt.LINE*(e-3),Q.SCREEN_WIDTH-tt.LOADING_X,tt.LINE),t.fillText(rt[e-1]+" Complete!",tt.LOADING_X,tt.LOADING_Y+tt.LINE*(e-2))),e<rt.length&&t.fillText(rt[e],tt.LOADING_X,tt.LOADING_Y+tt.LINE*(e-1)),1==e&&(t.font=et.FOOTER+"px "+Q.LOADING_FONT,t.fillText("World Name "+this._wwaData.worldName,tt.FOOTER_X,tt.WORLD_Y),t.fillText(" (Map data Ver. "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10+")",tt.FOOTER_X,tt.WORLD_Y+tt.LINE));else{var s;s=this._isSkippedSoundMessage?tt.LOADING_Y+tt.LINE*(rt.length-1):tt.FOOTER_Y,e<=j.AUDIO?t.fillText("Now Sound data Loading .....",tt.LOADING_X,s):(t.clearRect(tt.LOADING_X,s-tt.LINE,Q.SCREEN_WIDTH-tt.LOADING_X,tt.LINE),t.fillText("Now Sound data Loading ..... Complete!",tt.LOADING_X,s))}},s.prototype._setErrorMessage=function(t,e){this._hasTitleImg?alert(t):(e.clearRect(0,0,Q.SCREEN_WIDTH,Q.SCREEN_HEIGHT),e.font=et.ERRROR+"px "+Q.LOADING_FONT,t.split("\n").forEach((function(t,s){e.fillText(t,tt.ERROR_X,tt.ERROR_Y+tt.LINE*s)})))},s.prototype.createWWAAudioInstance=function(t){if(0!==t&&t!==K.NO_SOUND){var e=this.audioContext;if(void 0===this._audioInstances[t]){var s=this._audioDirectory+t+"."+this.audioExtension;this._audioInstances[t]=e?new Ae(t,s,this.audioContext,this.audioGain):new Ie(t,s,_t("wwa-audio-wrapper"))}}},s.prototype.loadSound=function(){var t=this;this._audioInstances=new Array(Q.SOUND_MAX+1),this.createWWAAudioInstance(K.DECISION),this.createWWAAudioInstance(K.ATTACK);for(var e=1;e<this._wwaData.mapPartsMax;e++){var s=this._wwaData.mapAttribute[e][Q.ATR_SOUND];this.createWWAAudioInstance(s)}for(e=1;e<this._wwaData.objPartsMax;e++)if(this._wwaData.objectAttribute[e][Q.ATR_TYPE]!==Q.OBJECT_RANDOM){s=this._wwaData.objectAttribute[e][Q.ATR_SOUND];this.createWWAAudioInstance(s)}this._wwaData.message.forEach((function(e){return e.split("\n").forEach((function(e){var s=e.match(/^\$sound=(\d+)/);if(s&&!(s.length<2)){var a=parseInt(s[1],10);!isNaN(a)&&0<a&&a<K.NO_SOUND&&t.createWWAAudioInstance(a)}}))})),this._wwaData.bgm=0,this._soundLoadSkipFlag=!1},s.prototype.checkAllSoundLoaded=function(){var s=0,a=0;if(!this._hasTitleImg)var i=this._cvsCover.getContext("2d");this._keyStore.update(),this._keyStore.getKeyState(e.KEY_SPACE)===t.KEYDOWN&&(this._soundLoadSkipFlag=!0);for(var o=1;o<=Q.SOUND_MAX;o++){var r=this._audioInstances[o];void 0===r||r.isError()||(a++,r.hasData()&&s++)}if(s<a&&!this._soundLoadSkipFlag)return this._setProgressBar(Ge(s,a,j.AUDIO)),void window.requestAnimationFrame(this.soundCheckCaller);this._setProgressBar(Ge(Q.SOUND_MAX,Q.SOUND_MAX,j.AUDIO)),this._setLoadingMessage(i,j.FINISH),this.openGameWindow()},s.prototype._setSoundLoadedCheckTimer=function(t){var e=this,s=this._audioInstances[t];s.isError()||(this.soundLoadedCheckTimer=window.setInterval((function(){e._wwaData.bgm===t?s.hasData()?(s.play(),e._wwaData.bgm=t,e._clearSoundLoadedCheckTimer()):s.isError()&&e._clearSoundLoadedCheckTimer():e._clearSoundLoadedCheckTimer()}),100))},s.prototype._clearSoundLoadedCheckTimer=function(){this.soundLoadedCheckTimer&&(clearInterval(this.soundLoadedCheckTimer),this.soundLoadedCheckTimer=void 0)},s.prototype.playSound=function(t){if(this._isLoadedSound){if(t<0||t>Q.SOUND_MAX)throw new Error("サウンド番号が範囲外です。");if(!(t>=K.BGM_LB&&this._wwaData.bgm===t))if((t===K.NO_SOUND||t>=K.BGM_LB)&&0!==this._wwaData.bgm&&(this._audioInstances[this._wwaData.bgm].hasData()&&this._audioInstances[this._wwaData.bgm].pause(),this._wwaData.bgm=0),0!==t&&t!==K.NO_SOUND)this._audioInstances[t].hasData()?t>=K.BGM_LB?(this._audioInstances[t].play(),this._wwaData.bgm=t):this._audioInstances[t].play():t>=K.BGM_LB&&(this._wwaData.bgm=t,this._setSoundLoadedCheckTimer(t))}else t===K.NO_SOUND?this._wwaData.bgm=0:t>=K.BGM_LB&&(this._wwaData.bgm=t)},s.prototype.openGameWindow=function(){var t=this,e=this._player.getPosition();_t("wwa-cover").style.opacity="0",0!==this.getObjectIdByPosition(e)&&this._player.setPartsAppearedFlag();var s=_t("wwa-wrapper").getAttribute("data-wwa-resume-savedata");if("string"==typeof s&&(this._useSuspend=!0,s)){var a=qt.getStartWWAData(s);this._restartData!==a&&(this._applyQuickLoad(a),this._wwaSave.resumeStart())}setTimeout((function(){_t("wwa-wrapper").removeChild(_t("wwa-cover")),t._main()}),Q.SPLASH_SCREEN_DISP_MILLS)},s.prototype.onselectitem=function(t){if(this._player.canUseItem(t)){if(_t("item"+(t-1)).classList.add("onpress"),this.playSound(K.DECISION),"BLANK"===this._wwaData.message[W.USE_ITEM]){this._player.readyToUseItem(t);var e=this._player.useItem(),s=this.getObjectAttributeById(e,Q.ATR_STRING);this.setMessageQueue(this.getMessageById(s),!1,!1,e,I.OBJECT,this._player.getPosition().getPartsCoord())}else this.setMessageQueue(""===this._wwaData.message[W.USE_ITEM]?"このアイテムを使用します。\nよろしいですか?":this._wwaData.message[W.USE_ITEM],!0,!0),this._yesNoChoiceCallInfo=N.CALL_BY_ITEM_USE,this._yesNoUseItemPos=t;return!0}return!1},s.prototype.onselectbutton=function(t,e,s){void 0===e&&(e=!1),void 0===s&&(s=!1);var a=_t(F[t]);if(this.playSound(K.DECISION),this._itemMenu.close(),a.classList.add("onpress"),t===R.QUICK_LOAD)switch(this._yesNoChoiceCallInfo=this._wwaSave.getFirstSaveChoiceCallInfo(e),this._yesNoChoiceCallInfo){case N.CALL_BY_QUICK_LOAD:case N.CALL_BY_LOG_QUICK_LOAD:var i,o="";switch(this._yesNoChoiceCallInfo){case N.CALL_BY_QUICK_LOAD:o="読み込むデータを選んでください。",this._wwaSave.selectDBSaveDataList();break;case N.CALL_BY_LOG_QUICK_LOAD:o="読み込むオートセーブを選んでください。",this._wwaSave.selectLogSaveDataList()}switch(i=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword),this._messageWindow.createSaveDom(),i){case N.CALL_BY_LOG_QUICK_LOAD:this.setMessageQueue(o+"\n→Noでオートセーブ復帰画面に移ります。",!0,!0);break;case N.CALL_BY_PASSWORD_LOAD:this.setMessageQueue(o+"\n→Noでデータ復帰用パスワードの\n 入力選択ができます。",!0,!0);break;case N.NONE:this.setMessageQueue(o,!0,!0)}break;case N.CALL_BY_PASSWORD_LOAD:this.onpasswordloadcalled()}else if(t===R.QUICK_SAVE)this._wwaData.disableSaveFlag?this.setMessageQueue("ここではセーブ機能は\n使用できません。",!1,!0):(this._wwaSave.selectDBSaveDataList(),this._messageWindow.createSaveDom(),this._usePassword?(this.setMessageQueue("データの一時保存先を選んでください。\n→Noでデータ復帰用パスワードの\n 表示選択ができます。",!0,!0),this._yesNoChoiceCallInfo=N.CALL_BY_QUICK_SAVE):(this.setMessageQueue("データの一時保存先を選んでください。",!0,!0),this._yesNoChoiceCallInfo=N.CALL_BY_QUICK_SAVE));else if(t===R.RESTART_GAME)this.setMessageQueue("初めからスタートしなおしますか?",!0,!0),this._yesNoChoiceCallInfo=N.CALL_BY_RESTART_GAME;else if(t===R.GOTO_WWA)if(s)this._bottomButtonType!==c.GOTO_WWA&&_t(F[R.GOTO_WWA]).classList.remove("onpress"),this.setMessageQueue("WWAの公式サイトを開きますか?",!0,!0),this._yesNoChoiceCallInfo=N.CALL_BY_GOTO_WWA;else switch(this._bottomButtonType){case c.GOTO_WWA:this._yesNoChoiceCallInfo=N.CALL_BY_GOTO_WWA,this.setMessageQueue("WWAの公式サイトを開きますか?",!0,!0);break;case c.GAME_END:this._yesNoChoiceCallInfo=N.CALL_BY_END_GAME,this.setMessageQueue("WWAゲームを終了しますか?",!0,!0);break;case c.BATTLE_REPORT:this.launchBattleEstimateWindow()}},s.prototype.onpasswordloadcalled=function(){this._usePassword?(_t(F[R.QUICK_LOAD]).classList.add("onpress"),this.setMessageQueue("データ復帰用のパスワードを入力しますか?",!0,!0),this._yesNoChoiceCallInfo=N.CALL_BY_PASSWORD_LOAD):this.setMessageQueue("セーブデータがありません。",!1,!0)},s.prototype.onpasswordsavecalled=function(){_t(F[R.QUICK_SAVE]).classList.add("onpress"),this._wwaData.disableSaveFlag?this.setMessageQueue("ここではセーブ機能は\n使用できません。",!1,!0):this._useSuspend?(this.setMessageQueue("ゲームを中断しますか?",!0,!0),this._yesNoChoiceCallInfo=N.CALL_BY_SUSPEND):this._usePassword&&(this.setMessageQueue("データ復帰用のパスワードを表示しますか?",!0,!0),this._yesNoChoiceCallInfo=N.CALL_BY_PASSWORD_SAVE)},s.prototype.onpasssuspendsavecalled=function(){_t(F[R.QUICK_SAVE]).classList.add("onpress"),this._wwaData.disableSaveFlag?this.setMessageQueue("ここではセーブ機能は\n使用できません。",!1,!0):(this.setMessageQueue("ゲームを中断しますか?",!0,!0),this._yesNoChoiceCallInfo=N.CALL_BY_SUSPEND)},s.prototype.onitemmenucalled=function(){this.setMessageQueue("右のメニューを選択してください。",!1,!0),this._messageWindow.setItemMenuChoice(!0),this.playSound(K.DECISION),this._itemMenu.openView()},s.prototype.onchangespeed=function(t){if(this._wwaData.permitChangeGameSpeed){var e,s;if(e=t===L.UP?this._player.speedUp():this._player.speedDown(),s="移動速度を【"+J[e]+"】に切り替えました。\n"+(this.isBattleSpeedIndexForQuickBattle(e)?"戦闘も速くなります。\n":"")+"("+(Q.MAX_SPEED_INDEX+1)+"段階中"+(e+1)+")",this.userDevice.os===C.NINTENDO)s+="速度を落とすには-ボタン, 速度を上げるには+ボタンを押してください。";else s+="速度を落とすにはIキー, 速度を上げるにはPキーを押してください。";this.setMessageQueue(s,!1,!0)}else this.setMessageQueue("ここでは移動速度を\n変更できません。",!1,!0)},s.prototype.isBattleSpeedIndexForQuickBattle=function(t){return Q.QUICK_BATTLE_SPEED_INDECIES.some((function(e){return e===t}))},s.prototype._main=function(){var s=this;if(this._temporaryInputDisable=!1,this._stopUpdateByLoadFlag=!1,this._keyStore.update(),this._mouseStore.update(),this._gamePadStore.update(),this._waitFrame-- >0)window.requestAnimationFrame(this.mainCaller);else{this._waitFrame=0,void 0!==this._yesNoJudgeInNextFrame&&(this._yesNoJudge=this._yesNoJudgeInNextFrame,this._yesNoJudgeInNextFrame=void 0),this._clearFacesInNextFrame&&(this.clearFaces(),this._clearFacesInNextFrame=!1);for(var i=0;i<this._execMacroListInNextFrame.length;i++)this._execMacroListInNextFrame[i].execute();this._lastMessage.isEmpty()&&this._lastMessage.isEndOfPartsEvent&&void 0!==this._reservedMoveMacroTurn&&(this._player.setMoveMacroWaiting(this._reservedMoveMacroTurn),this._reservedMoveMacroTurn=void 0),this._execMacroListInNextFrame=[],this._player.mainFrameCount();this._player.getPosition();var o=this._player.getDir();if(this._player.isControllable())this._wwaData.disableSaveFlag||this._wwaSave.isAutoSaveFrame(this._player)&&this._quickSave(N.CALL_BY_LOG_QUICK_SAVE),this._player.isDelayFrame()?this._player.updateDelayFrame():this._actionGamePadButtonItemMacro()||(this._keyStore.getKeyStateForControllPlayer(e.KEY_LEFT)===t.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(e.KEY_UP)===t.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(e.KEY_RIGHT)===t.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(e.KEY_DOWN)===t.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.LEFT)===a.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.UP)===a.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.RIGHT)===a.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.DOWN)===a.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(D[o])?this._checkTurnKeyPressed()?this._player.setDir(o):(this._player.controll(o),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(e.KEY_LEFT)?this._checkTurnKeyPressed()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(e.KEY_UP)?this._checkTurnKeyPressed()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(e.KEY_RIGHT)?this._checkTurnKeyPressed()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(e.KEY_DOWN)?this._checkTurnKeyPressed()?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(u.LEFT)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(u.UP)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(u.RIGHT)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(u.DOWN)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_LEFT)?this._gamePadStore.buttonPressed(r.BUTTON_INDEX_B)?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_UP)?this._gamePadStore.buttonPressed(r.BUTTON_INDEX_B)?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_RIGHT)?this._gamePadStore.buttonPressed(r.BUTTON_INDEX_B)?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_DOWN)?this._gamePadStore.buttonPressed(r.BUTTON_INDEX_B)?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._keyStore.getKeyState(e.KEY_1)===t.KEYDOWN?this.onselectitem(1):this._keyStore.getKeyState(e.KEY_2)===t.KEYDOWN?this.onselectitem(2):this._keyStore.getKeyState(e.KEY_3)===t.KEYDOWN?this.onselectitem(3):this._keyStore.getKeyState(e.KEY_Q)===t.KEYDOWN?this.onselectitem(4):this._keyStore.getKeyState(e.KEY_W)===t.KEYDOWN?this.onselectitem(5):this._keyStore.getKeyState(e.KEY_E)===t.KEYDOWN?this.onselectitem(6):this._keyStore.getKeyState(e.KEY_A)===t.KEYDOWN?this.onselectitem(7):this._keyStore.getKeyState(e.KEY_S)===t.KEYDOWN?this.onselectitem(8):this._keyStore.getKeyState(e.KEY_D)===t.KEYDOWN?this.onselectitem(9):this._keyStore.getKeyState(e.KEY_Z)===t.KEYDOWN?this.onselectitem(10):this._keyStore.getKeyState(e.KEY_X)===t.KEYDOWN?this.onselectitem(11):this._keyStore.getKeyState(e.KEY_C)===t.KEYDOWN?this.onselectitem(12):this._keyStore.getKeyState(e.KEY_I)||this._gamePadStore.buttonTrigger(r.BUTTON_INDEX_MINUS)?this.onchangespeed(L.DOWN):this._keyStore.checkHitKey(e.KEY_P)||this._keyStore.checkHitKey(e.KEY_F2)||this._gamePadStore.buttonTrigger(r.BUTTON_INDEX_PLUS)?this.onchangespeed(L.UP):this._keyStore.getKeyState(e.KEY_F1)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_M)===t.KEYDOWN||this._gamePadStore.buttonTrigger(r.BUTTON_INDEX_A)?this.launchBattleEstimateWindow():this._keyStore.checkHitKey(e.KEY_F3)?(this.playSound(K.DECISION),this.onselectbutton(R.QUICK_LOAD,!0)):this._keyStore.checkHitKey(e.KEY_F4)?(this.playSound(K.DECISION),this._useSuspend?this.onpasssuspendsavecalled():this._usePassword&&this.onpasswordsavecalled()):this._keyStore.checkHitKey(e.KEY_F5)||this._gamePadStore.buttonTrigger(r.BUTTON_INDEX_A,r.BUTTON_INDEX_ZR)?this.onselectbutton(R.QUICK_LOAD):this._keyStore.checkHitKey(e.KEY_F6)||this._gamePadStore.buttonTrigger(r.BUTTON_INDEX_A,r.BUTTON_INDEX_ZL)?this.onselectbutton(R.QUICK_SAVE):this._keyStore.checkHitKey(e.KEY_F7)||this._gamePadStore.buttonTrigger(r.BUTTON_INDEX_A,r.BUTTON_INDEX_R)?this.onselectbutton(R.RESTART_GAME):this._keyStore.checkHitKey(e.KEY_F8)?this.onselectbutton(R.GOTO_WWA,!1,!0):this._keyStore.checkHitKey(e.KEY_F9)||this._gamePadStore.buttonTrigger(r.BUTTON_INDEX_X)?(this._player.isControllable()||this._messageWindow.isItemMenuChoice())&&this.onitemmenucalled():(this._keyStore.checkHitKey(e.KEY_F12)||this._gamePadStore.buttonTrigger(r.BUTTON_INDEX_Y))&&this._displayHelp()),this._keyStore.memorizeKeyStateOnControllableFrame(),this._mouseStore.memorizeMouseStateOnControllableFrame();else if(this._player.isJumped())this._camera.isResetting()||this._player.processAfterJump();else if(this._player.isMoving())this._player.move(),this._objectMovingDataManager.update();else if(this._player.isWaitingMessage())if(this._messageWindow.isVisible()||this._messageWindow.show(),this._messageWindow.isYesNoChoice())this._messageWindow.isSaveChoice()&&(this._messageWindow.saveUpdate(),this._messageWindow.isSaveClose()||(this._keyStore.checkHitKey(e.KEY_LEFT)||this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_LEFT)?this._messageWindow.saveControll(u.LEFT):this._keyStore.checkHitKey(e.KEY_UP)||this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_UP)?this._messageWindow.saveControll(u.UP):this._keyStore.checkHitKey(e.KEY_RIGHT)||this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_RIGHT)?this._messageWindow.saveControll(u.RIGHT):(this._keyStore.checkHitKey(e.KEY_DOWN)||this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_DOWN))&&this._messageWindow.saveControll(u.DOWN))),this._messageWindow.isInputDisable()||(this._yesNoJudge===g.UNSELECTED&&(this._keyStore.getKeyState(e.KEY_ENTER)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_Y)===t.KEYDOWN||this._gamePadStore.buttonTrigger(r.BUTTON_INDEX_A)?this._yesNoJudge=g.YES:(this._keyStore.getKeyState(e.KEY_N)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_ESC)===t.KEYDOWN||this._gamePadStore.buttonTrigger(r.BUTTON_INDEX_B))&&(this._yesNoJudge=g.NO)),(this._yesNoJudge===g.YES||this._yesNoJudge===g.NO)&&(this.playSound(K.DECISION),this._yesNoDispCounter=Q.YESNO_PRESS_DISP_FRAME_NUM,this._messageWindow.setInputDisable(),this._messageWindow.update()));else if(this._messageWindow.isItemMenuChoice()){if(this._itemMenu.update(),this._keyStore.checkHitKey(e.KEY_LEFT)||this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_LEFT)?this._itemMenu.controll(u.LEFT):this._keyStore.checkHitKey(e.KEY_UP)||this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_UP)?this._itemMenu.controll(u.UP):this._keyStore.checkHitKey(e.KEY_RIGHT)||this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_RIGHT)?this._itemMenu.controll(u.RIGHT):(this._keyStore.checkHitKey(e.KEY_DOWN)||this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_DOWN))&&this._itemMenu.controll(u.DOWN),this._keyStore.getKeyState(e.KEY_ENTER)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_Y)===t.KEYDOWN||this._gamePadStore.buttonTrigger(r.BUTTON_INDEX_A))this._setNextMessage(),this._messageWindow.setItemMenuChoice(!1),this._itemMenu.ok();else if(this._mouseStore.checkClickMouse(u.LEFT)||this._mouseStore.checkClickMouse(u.UP)||this._mouseStore.checkClickMouse(u.RIGHT)||this._mouseStore.checkClickMouse(u.DOWN)||this._keyStore.getKeyState(e.KEY_N)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_ESC)===t.KEYDOWN||this._gamePadStore.buttonTrigger(r.BUTTON_INDEX_B)){for(i=0;i<F.length;i++){(c=_t(F[i])).classList.contains("onpress")&&c.classList.remove("onpress")}this._itemMenu.ng(),this._setNextMessage(),this.playSound(K.DECISION),this._messageWindow.setItemMenuChoice(!1)}}else{var n=this._keyStore.getKeyStateForMessageCheck(e.KEY_ENTER),_=this._keyStore.getKeyStateForMessageCheck(e.KEY_SPACE),h=this._keyStore.getKeyStateForMessageCheck(e.KEY_ESC);if(n===t.KEYDOWN||n===t.KEYPRESS_MESSAGECHANGE||_===t.KEYDOWN||_===t.KEYPRESS_MESSAGECHANGE||h===t.KEYDOWN||h===t.KEYPRESS_MESSAGECHANGE||this._mouseStore.getMouseState()===a.MOUSEDOWN||this._gamePadStore.buttonTrigger(r.BUTTON_INDEX_A,r.BUTTON_INDEX_B)){for(i=0;i<F.length;i++){var c;(c=_t(F[i])).classList.contains("onpress")&&c.classList.remove("onpress")}this._setNextMessage()}}else this._player.isWatingEstimateWindow()?(this._keyStore.getKeyState(e.KEY_ENTER)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_SPACE)===t.KEYDOWN||this._gamePadStore.buttonTrigger(r.BUTTON_INDEX_A,r.BUTTON_INDEX_B))&&this.hideBattleEstimateWindow():this._player.isFighting()?(this._player.fight(),this._monsterWindow.update(this._monster)):this._player.isWaitingMoveMacro()&&(this._player.isMoveObjectAutoExecTime()&&(this.moveObjects(!1),this._player.resetMoveObjectAutoExecTimer()),this._objectMovingDataManager.update());if(this._prevFrameEventExected=!1,this._player.getPosition().isJustPosition()&&this._camera.getPosition().isScreenTopPosition()){if(!(this._player.isJumped()||this._player.isWaitingMessage()||this._player.isWatingEstimateWindow()||this._player.isWaitingMoveMacro()||this._player.isFighting())){this._player.isPartsAppearedTime()&&this._player.clearPartsAppearedFlag(),this._replaceRandomObjectsInScreen();var l=this.checkMap();l||this.checkObject(),this._prevFrameEventExected=l}this._player.isWaitingMessage()&&this._messageWindow.isYesNoChoice()&&this._yesNoJudge!==g.UNSELECTED&&!this._player.isWaitingMoveMacro()&&!this._player.isFighting()&&this._execChoiceWindowRunningEvent()}if(this._passwordLoadExecInNextFrame&&(this._stopUpdateByLoadFlag=!0,this._loadType=b.PASSWORD,this._player.clearPasswordWindowWaiting(),this._passwordLoadExecInNextFrame=!1),this._drawAll(),this._mainCallCounter++,this._mainCallCounter%=1e9,this._player.isWaitingMessage()&&this._isClassicModeEnable||(this._animationCounter=(this._animationCounter+1)%(2*Q.ANIMATION_REP_HALF_FRAME)),this._camera.isResetting()&&this._camera.advanceTransitionStepNum(),this._player.isWaitingMessage()||(this._player.decrementLookingAroundTimer(),this._statusPressCounter.energy>0&&0==--this._statusPressCounter.energy&&_t("disp-energy").classList.remove("onpress"),this._statusPressCounter.strength>0&&0==--this._statusPressCounter.strength&&_t("disp-strength").classList.remove("onpress"),this._statusPressCounter.defence>0&&0==--this._statusPressCounter.defence&&_t("disp-defence").classList.remove("onpress"),this._statusPressCounter.gold>0&&0==--this._statusPressCounter.gold&&_t("disp-gold").classList.remove("onpress")),this._player.isWaitingMoveMacro()&&this._player.decrementMoveObjectAutoExecTimer(),this._stopUpdateByLoadFlag?this._fadeout((function(){s._loadType===b.QUICK_LOAD?(s._quickLoad(),s.wwaCustomEvent("wwa_quickload")):s._loadType===b.RESTART_GAME?(s._restartGame(),s.wwaCustomEvent("wwa_restert")):s._loadType===b.PASSWORD&&(s._applyQuickLoad(s._passwordSaveExtractData),s._passwordSaveExtractData=void 0,s.wwaCustomEvent("wwa_passwordload")),setTimeout(s.mainCaller,Q.DEFAULT_FRAME_INTERVAL,s)})):window.requestAnimationFrame(this.mainCaller),null!==this._dumpElement)for(i=0;i<Q.USER_VAR_NUM;i++)this._dumpElement.querySelector(".var"+i.toString(10)).textContent=this._wwaData.userVar[i]+""}},s.prototype.vibration=function(t){this._gamePadStore.vibration(t)},s.prototype._drawAll=function(){var t,e,s=this._camera.getPosition().getPartsCoord(),a=this._camera.getPosition().getOffsetCoord(),i=Q.MAP_WINDOW_HEIGHT,o=this._player.getPosition().getPartsCoord();if(this._paintSkipByDoorOpen)this._paintSkipByDoorOpen=!1;else{if(this._cgManager.clearCanvas(0,0,Q.MAP_WINDOW_WIDTH,Q.MAP_WINDOW_HEIGHT),this._cgManager.drawBase(0,0,Q.MAP_WINDOW_WIDTH,Q.MAP_WINDOW_HEIGHT),this._camera.isResetting()){if(null!==this._camera.getPreviousPosition())var r=this._camera.getPreviousPosition().getPartsCoord(),n=this._camera.getPreviousPosition().getOffsetCoord();i=this._camera.getTransitionStepNum()*Q.CHIP_SIZE}var _=!1;if(i!==this._cgManager.mapCacheYLimit&&(this._cgManager.mapCacheYLimit=i,_=!0),s.x===this._cgManager.cpPartsLog.x&&s.y===this._cgManager.cpPartsLog.y||(this._cgManager.cpPartsLog.x=s.x,this._cgManager.cpPartsLog.y=s.y,_=!0),_&&(this._cgManager.clearBackCanvas(),this._cgManager.clearObjectCanvases()),this._camera.isResetting()&&(this._drawMap(r,n,i,!0),this._drawPlayer(r,n,i,!0),this._drawObjects(r,n,i,!0),this._camera.isFinalStep()))var h=255,c=setInterval((function(){var t=_t("wwa-fader");if((h-=3*Q.FADEOUT_SPEED)<=0)return clearInterval(c),t.style.backgroundColor="transparent",t.removeAttribute("style"),void(t.style.display="none");t.style.opacity=h/255+""}),20);this._drawMap(s,a,i,!1,_),this._drawPlayer(s,a,i),this._drawObjects(s,a,i,!1,_),this._player.isFighting()&&!this._player.isBattleStartFrame()&&(t=this._player.isTurn()?this._monster.position.x:o.x,e=this._player.isTurn()?this._monster.position.y:o.y,this._cgManager.drawCanvas(this._battleEffectCoord.x,this._battleEffectCoord.y,Q.CHIP_SIZE*(t-s.x)-a.x,Q.CHIP_SIZE*(e-s.y)-a.y)),this._drawEffect(),this._drawFaces(),this._drawFrame()}},s.prototype._drawMap=function(t,e,s,a,i){if(void 0===a&&(a=!1),void 0===i&&(i=!1),void 0!==t){var o,r=Math.max(0,t.x-1),n=Math.min(this._wwaData.mapWidth-1,t.x+Q.H_PARTS_NUM_IN_WINDOW),_=Math.max(0,t.y-1),h=Math.min(this._wwaData.mapWidth-1,t.y+Q.V_PARTS_NUM_IN_WINDOW);if(o=0,a)for(var c=r;c<=n;c++)for(var u=_;u<=h;u++){var l=this._wwaData.map[u][c],p=this._wwaData.mapAttribute[l][Q.ATR_X]/Q.CHIP_SIZE,d=this._wwaData.mapAttribute[l][Q.ATR_Y]/Q.CHIP_SIZE,E=Q.CHIP_SIZE*(c-t.x)-e.x,w=Q.CHIP_SIZE*(u-t.y)-e.y;this._cgManager.copyBackCanvasWithLowerYLimit(p,d,E,w,s)}else{for(c=r;c<=n;c++)for(u=_;u<=h;u++){l=this._wwaData.map[u][c];this._cgManager.mapCache[o]!==l&&(this._cgManager.mapCache[o]=l,i=!0),o++}if(i){this._cgManager.clearBackCanvasWithLowerYLimit(s);for(c=r;c<=n;c++)for(u=_;u<=h;u++){l=this._wwaData.map[u][c],p=this._wwaData.mapAttribute[l][Q.ATR_X]/Q.CHIP_SIZE,d=this._wwaData.mapAttribute[l][Q.ATR_Y]/Q.CHIP_SIZE,E=Q.CHIP_SIZE*(c-t.x)-e.x,w=Q.CHIP_SIZE*(u-t.y)-e.y;this._cgManager.copyBackCanvasWithUpperYLimit(p,d,E,w,s)}}this._cgManager.drawBackCanvas()}}},s.prototype._drawPlayer=function(t,e,s,a){if(void 0===a&&(a=!1),void 0!==t&&!this._wwaData.delPlayerFlag){var i,o=this._player.getPosition().getPartsCoord(),r=this._player.getPosition().getOffsetCoord(),n=v[this._player.getDir()],_=(o.x-t.x)*Q.CHIP_SIZE+r.x-e.x,h=(o.y-t.y)*Q.CHIP_SIZE+r.y-e.y;Math.abs(r.x),Math.abs(r.y),this._player.getDir();i=this._useLookingAround&&this._player.isLookingAround()&&!this._player.isWaitingMessage()?this._wwaData.playerImgPosX+[2,3,4,5,0,1,6,7][Math.floor(this._mainCallCounter%64/8)]:this._player.isMovingImage()?this._wwaData.playerImgPosX+n+1:this._wwaData.playerImgPosX+n,a?this._cgManager.drawCanvasWithLowerYLimit(i,this._wwaData.playerImgPosY,_,h,s):this._cgManager.drawCanvasWithUpperYLimit(i,this._wwaData.playerImgPosY,_,h,s)}},s.prototype._drawObjects=function(t,e,s,a,i){if(void 0===a&&(a=!1),void 0===i&&(i=!1),void 0!==t){var o,r,n,_,h,c,u,l,p,d,E,y,m,g,A=Math.max(0,t.x-1),S=Math.min(this._wwaData.mapWidth-1,t.x+Q.H_PARTS_NUM_IN_WINDOW),I=Math.max(0,t.y-1),T=Math.min(this._wwaData.mapWidth-1,t.y+Q.V_PARTS_NUM_IN_WINDOW),O=0,v=this._animationCounter>Q.ANIMATION_REP_HALF_FRAME,D=this._player.isFighting()&&this._player.isTurn()&&this._player.getPosition().getPartsCoord().equals(this._monster.position);if(a)for(d=A;d<=S;d++)for(E=I;E<=T;E++)D&&new w(d,E).equals(this._monster.position)||(y=this._wwaData.mapObject[E][d],o=new w(0,0),this._wwaData.objectAttribute[y][Q.ATR_MOVE]!==B.STATIC&&null!==(p=this._objectMovingDataManager.getOffsetByBeforePartsCoord(new w(d,E)))&&(o=p),h=Q.CHIP_SIZE*(d-t.x)+o.x-e.x,c=Q.CHIP_SIZE*(E-t.y)+o.y-e.y,r=v||0===this._wwaData.objectAttribute[y][Q.ATR_X2]&&0===this._wwaData.objectAttribute[y][Q.ATR_Y2],n=this._wwaData.objectAttribute[y][r?Q.ATR_X:Q.ATR_X2]/Q.CHIP_SIZE,_=this._wwaData.objectAttribute[y][r?Q.ATR_Y:Q.ATR_Y2]/Q.CHIP_SIZE,u=this._wwaData.objectAttribute[y][Q.ATR_TYPE],l=this._wwaData.objectAttribute[y][Q.ATR_NUMBER],0===y||this._checkNoDrawObject(new w(d,E),u,l)||this._cgManager.copyObjectCanvasWithLowerYLimit(v?1:0,n,_,h,c,s));else{var C,P,M,N,R,L=[],b=[];for(d=A;d<=S;d++)for(E=I;E<=T;E++)m=y=this._wwaData.mapObject[E][d],u=this._wwaData.objectAttribute[y][Q.ATR_TYPE],l=this._wwaData.objectAttribute[y][Q.ATR_NUMBER],this._checkNoDrawObject(new w(d,E),u,l)&&(m=0),P=this._wwaData.objectAttribute[y][Q.ATR_MOVE]===B.STATIC,0!==m&&(M=!(!D||!new w(d,E).equals(this._monster.position)),P?b.push(new f(y,d,E,P,M)):(L.push(new f(y,d,E,P,M)),m=0),M&&(m=0)),this._cgManager.mapObjectCache[O]!==m&&(this._cgManager.mapObjectCache[O]=m,i=!0),O++;for(i&&(this._cgManager.clearObjectCanvasesWithLowerYLimit(s),Array.prototype.push.apply(L,b)),R=L.length,N=0;N<R;N++)if(d=(C=L[N]).x,E=C.y,y=C.partsIDObj,P=C.isStatic,M=C.isFighting,h=Q.CHIP_SIZE*(d-t.x)-e.x,c=Q.CHIP_SIZE*(E-t.y)-e.y,P){if(M)continue;for(g=0;g<2;g++)r=!!g||0===this._wwaData.objectAttribute[y][Q.ATR_X2]&&0===this._wwaData.objectAttribute[y][Q.ATR_Y2],n=this._wwaData.objectAttribute[y][r?Q.ATR_X:Q.ATR_X2]/Q.CHIP_SIZE,_=this._wwaData.objectAttribute[y][r?Q.ATR_Y:Q.ATR_Y2]/Q.CHIP_SIZE,this._cgManager.copyObjectCanvasWithUpperYLimit(g,n,_,h,c,s)}else null!==(p=this._objectMovingDataManager.getOffsetByBeforePartsCoord(new w(d,E)))&&(h+=p.x,c+=p.y),r=v||0===this._wwaData.objectAttribute[y][Q.ATR_X2]&&0===this._wwaData.objectAttribute[y][Q.ATR_Y2],n=this._wwaData.objectAttribute[y][r?Q.ATR_X:Q.ATR_X2]/Q.CHIP_SIZE,_=this._wwaData.objectAttribute[y][r?Q.ATR_Y:Q.ATR_Y2]/Q.CHIP_SIZE,this._cgManager.drawCanvasWithUpperYLimit(n,_,h,c,s);this._cgManager.drawObjectCanvas(v?1:0)}}},s.prototype._drawEffect=function(){if(0!==this._wwaData.effectCoords.length&&0!==this._wwaData.effectWaits){var t=Math.floor(this._mainCallCounter%(this._wwaData.effectCoords.length*this._wwaData.effectWaits)/this._wwaData.effectWaits);this._cgManager.drawEffect(t)}},s.prototype._drawFaces=function(){for(var t=0;t<this._faces.length;t++)this._cgManager.drawCanvasWithSize(this._faces[t].srcPos.x,this._faces[t].srcPos.y,this._faces[t].srcSize.x,this._faces[t].srcSize.y,this._faces[t].destPos.x,this._faces[t].destPos.y)},s.prototype._drawFrame=function(){this._cgManager.drawFrame()},s.prototype._checkNoDrawObject=function(t,e,s){var a=this._player.getPosition(),i=a.getPartsCoord();return!(!a.isJustPosition()||i.x!==t.x||i.y!==t.y||this._wwaData.objectNoCollapseDefaultFlag)&&(e===Q.OBJECT_DOOR&&0===s||(e===Q.OBJECT_STATUS||e===Q.OBJECT_MESSAGE||e===Q.OBJECT_ITEM||e===Q.OBJECT_SELL||e===Q.OBJECT_BUY||e===Q.OBJECT_SELL||e===Q.OBJECT_LOCALGATE))},s.prototype.getMapWidth=function(){if(void 0===this._wwaData)throw new Error("マップデータがロードされていません");return this._wwaData.mapWidth},s.prototype.getMapIdByPosition=function(t){var e=t.getPartsCoord();return this._wwaData.map[e.y][e.x]},s.prototype.getObjectIdByPosition=function(t){var e=t.getPartsCoord();return this._wwaData.mapObject[e.y][e.x]},s.prototype.getMapTypeByPosition=function(t){var e=t.getPartsCoord(),s=this._wwaData.map[e.y][e.x];return this._wwaData.mapAttribute[s][Q.ATR_TYPE]},s.prototype.getObjectTypeByPosition=function(t){var e=t.getPartsCoord(),s=this._wwaData.mapObject[e.y][e.x];return this._wwaData.objectAttribute[s][Q.ATR_TYPE]},s.prototype.getMapAttributeByPosition=function(t,e){var s=t.getPartsCoord(),a=this._wwaData.map[s.y][s.x];return this._wwaData.mapAttribute[a][e]},s.prototype.isCurrentPosMapPartsIncludingMessage=function(t){return 0!==this.getMapAttributeByPosition(t,Q.ATR_STRING)},s.prototype.getObjectAttributeByPosition=function(t,e){var s=t.getPartsCoord(),a=this._wwaData.mapObject[s.y][s.x];return this._wwaData.objectAttribute[a][e]},s.prototype.getMapAttributeById=function(t,e){return this._wwaData.mapAttribute[t][e]},s.prototype.getObjectAttributeById=function(t,e){return this._wwaData.objectAttribute[t][e]},s.prototype.getObjectCropXById=function(t){return this._wwaData.objectAttribute[t][Q.ATR_X]},s.prototype.getObjectCropYById=function(t){return this._wwaData.objectAttribute[t][Q.ATR_Y]},s.prototype.getMessageById=function(t){return this._wwaData.message[t]},s.prototype.getSystemMessageById=function(t){return this._wwaData.systemMessage[t]},s.prototype.checkMap=function(t){var e=this._player.getPosition().getPartsCoord();t=null!=t?t:e;var s=this._wwaData.map[t.y][t.x],a=this._wwaData.mapAttribute[s][Q.ATR_TYPE],i=t.x===e.x&&t.y===e.y,o=!1;return(!i||this._player.getLastExecPartsIDOnSamePosition(I.MAP)!==s)&&(a===Q.MAP_STREET?o=this._execMapStreetEvent(t,s,a):a===Q.MAP_WALL?o=this._execMapWallEvent(t,s,a):a===Q.MAP_LOCALGATE?o=this._execMapLocalGateEvent(t,s,a):a===Q.MAP_URLGATE&&(o=this._execMapUrlGateEvent(t,s,a)),i&&!this._player.isJumped()&&this._player.setLastExecInfoOnSamePosition(I.MAP,s),o)},s.prototype.checkObject=function(t){var e=this._player.getPosition().getPartsCoord();t=null!=t?t:e;var s=this._wwaData.mapObject[t.y][t.x],a=this._wwaData.objectAttribute[s][Q.ATR_TYPE],i=t.x===e.x&&t.y===e.y;i&&this._player.getLastExecPartsIDOnSamePosition(I.OBJECT)===s||(a===Q.OBJECT_NORMAL?this._execObjectNormalEvent(t,s,a):a===Q.OBJECT_MESSAGE?this._execObjectMessageEvent(t,s,a):a===Q.OBJECT_MONSTER?this._execObjectMonsterEvent(t,s,a):a===Q.OBJECT_ITEM?this._execObjectItemEvent(t,s,a):a===Q.OBJECT_DOOR?this._execObjectDoorEvent(t,s,a):a===Q.OBJECT_STATUS?this._execObjectStatusEvent(t,s,a):a===Q.OBJECT_BUY?this._execObjectBuyEvent(t,s,a):a===Q.OBJECT_SELL?this._execObjectSellEvent(t,s,a):a===Q.OBJECT_URLGATE?this._execObjectUrlGateEvent(t,s,a):a===Q.OBJECT_SCORE?this._execObjectScoreEvent(t,s,a):a===Q.OBJECT_SELECT?this._execObjectYesNoChoiceEvent(t,s,a):a===Q.OBJECT_LOCALGATE&&this._execObjectLocalGateEvent(t,s,a),i&&!this._player.isJumped()&&this._player.setLastExecInfoOnSamePosition(I.OBJECT,s))},s.prototype._execMapStreetEvent=function(t,e,s){var a=this._wwaData.mapAttribute[e][Q.ATR_ITEM];if(0!==a&&!this._player.hasItem(a))return!1;this.appearParts(t,A.MAP);var i=this._wwaData.mapAttribute[e][Q.ATR_STRING],o=this._wwaData.message[i];this._waitFrame+=this._wwaData.mapAttribute[e][Q.ATR_NUMBER]*Q.WAIT_TIME_FRAME_NUM,this._temporaryInputDisable=!0;var r=this.setMessageQueue(o,!1,!1,e,I.MAP,t.clone());return this.playSound(this._wwaData.mapAttribute[e][Q.ATR_SOUND]),0!==i&&r},s.prototype._execMapWallEvent=function(t,e,s){var a=this.getObjectIdByPosition(t.convertIntoPosition(this)),i=this.getObjectAttributeById(a,Q.ATR_TYPE);if(0===a||i===Q.OBJECT_NORMAL||i===Q.OBJECT_DOOR&&(!this._player.hasItem(this.getObjectAttributeById(a,Q.ATR_ITEM))||this.getObjectAttributeById(i,Q.ATR_MODE)===Q.PASSABLE_OBJECT)){this.appearParts(t,A.MAP);var o=this._wwaData.mapAttribute[e][Q.ATR_STRING],r=this._wwaData.message[o];return this.setMessageQueue(r,!1,!1,e,I.MAP,t.clone()),this.playSound(this._wwaData.mapAttribute[e][Q.ATR_SOUND]),!1}return!1},s.prototype._execMapLocalGateEvent=function(t,e,s){var a=this._player.getPosition().getPartsCoord(),i=this._wwaData.mapAttribute[e][Q.ATR_JUMP_X],o=this._wwaData.mapAttribute[e][Q.ATR_JUMP_Y];return i>Q.RELATIVE_COORD_LOWER&&(i=t.x+i-Q.RELATIVE_COORD_BIAS),o>Q.RELATIVE_COORD_LOWER&&(o=t.y+o-Q.RELATIVE_COORD_BIAS),this.appearParts(t,A.MAP),0<=i&&0<=o&&i<this._wwaData.mapWidth&&o<this._wwaData.mapWidth&&(i!==a.x||o!==a.y)&&(this._player.jumpTo(new y(this,i,o,0,0)),this.playSound(this._wwaData.mapAttribute[e][Q.ATR_SOUND]),!0)},s.prototype._execMapUrlGateEvent=function(t,e,s){var a=this._wwaData.mapAttribute[e][Q.ATR_STRING];return!this._isURLGateEnable||("BLANK"!==this._wwaData.message[W.ASK_LINK]?(this.setMessageQueue(""===this._wwaData.message[W.ASK_LINK]?"他のページにリンクします。\nよろしいですか?":this._wwaData.message[W.ASK_LINK],!0,!0),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=N.CALL_BY_MAP_PARTS,this._yesNoURL=this._wwaData.message[a].split(/\s/g)[0],!0):void(location.href=pt(this._wwaData.message[a].split(/\s/g)[0])))},s.prototype._execObjectNormalEvent=function(t,e,s){},s.prototype._execObjectMessageEvent=function(t,e,s){var a=this._wwaData.objectAttribute[e][Q.ATR_STRING],i=this._wwaData.message[a],o=this._player.getPosition().getPartsCoord(),r=this._wwaData.objectAttribute[e][Q.ATR_SOUND];t.x!==o.x||t.y!==o.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(I.OBJECT,0,t),this.setMessageQueue(i,!1,!1,e,I.OBJECT,t),this._waitFrame+=this._wwaData.objectAttribute[e][Q.ATR_NUMBER]*Q.WAIT_TIME_FRAME_NUM,this._temporaryInputDisable=!0,this.appearParts(t,A.OBJECT,e),this.playSound(r)},s.prototype._execObjectStatusEvent=function(t,e,s){var a=new E(this._wwaData.objectAttribute[e][Q.ATR_ENERGY],this._wwaData.objectAttribute[e][Q.ATR_STRENGTH],this._wwaData.objectAttribute[e][Q.ATR_DEFENCE],this._wwaData.objectAttribute[e][Q.ATR_GOLD]),i=this._wwaData.objectAttribute[e][Q.ATR_STRING],o=this._wwaData.message[i],r=this._player.getStatusWithoutEquipments();if(a.strength>Q.STATUS_MINUS_BORDER&&r.strength<a.strength-Q.STATUS_MINUS_BORDER||a.defence>Q.STATUS_MINUS_BORDER&&r.defence<a.defence-Q.STATUS_MINUS_BORDER||a.gold>Q.STATUS_MINUS_BORDER&&r.gold<a.gold-Q.STATUS_MINUS_BORDER)return this.setPartsOnPosition(I.OBJECT,0,t),this._keyStore.allClear(),void this._mouseStore.clear();a.energy=a.energy>Q.STATUS_MINUS_BORDER?Q.STATUS_MINUS_BORDER-a.energy:a.energy,a.strength=a.strength>Q.STATUS_MINUS_BORDER?Q.STATUS_MINUS_BORDER-a.strength:a.strength,a.defence=a.defence>Q.STATUS_MINUS_BORDER?Q.STATUS_MINUS_BORDER-a.defence:a.defence,a.gold=a.gold>Q.STATUS_MINUS_BORDER?Q.STATUS_MINUS_BORDER-a.gold:a.gold,this._player.addStatusAll(a),this.setStatusChangedEffect(a),this._player.isDead()&&0!==this._wwaData.objectAttribute[e][Q.ATR_ENERGY]?this.gameover():(this.setMessageQueue(o,!1,!1,e,I.OBJECT,t.clone()),this.setPartsOnPosition(I.OBJECT,0,t),this.appearParts(t,A.OBJECT,e),this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND]))},s.prototype._execObjectMonsterEvent=function(t,e,s){var a=this,i=new w(this._wwaData.objectAttribute[e][Q.ATR_X],this._wwaData.objectAttribute[e][Q.ATR_Y]),o=new E(this._wwaData.objectAttribute[e][Q.ATR_ENERGY],this._wwaData.objectAttribute[e][Q.ATR_STRENGTH],this._wwaData.objectAttribute[e][Q.ATR_DEFENCE],this._wwaData.objectAttribute[e][Q.ATR_GOLD]),r=this._wwaData.message[this._wwaData.objectAttribute[e][Q.ATR_STRING]],n=this._wwaData.objectAttribute[e][Q.ATR_ITEM];this._monster=new St(e,t,i,o,r,n,(function(){a._monsterWindow.hide()})),this._player.startBattleWith(this._monster)},s.prototype._execObjectBuyEvent=function(t,e,s){var a=this._wwaData.objectAttribute[e][Q.ATR_STRING],i=this._wwaData.message[a],o=this._player.getPosition().getPartsCoord();t.x!==o.x||t.y!==o.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(I.OBJECT,0,t),this.setMessageQueue(i,!0,!1,e,I.OBJECT,t.clone()),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=N.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND])},s.prototype._execObjectSellEvent=function(t,e,s){var a=this._wwaData.objectAttribute[e][Q.ATR_STRING],i=this._wwaData.message[a],o=this._player.getPosition().getPartsCoord();t.x!==o.x||t.y!==o.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(I.OBJECT,0,t),this.setMessageQueue(i,!0,!1,e,I.OBJECT,t.clone()),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=N.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND])},s.prototype._execObjectItemEvent=function(t,e,s){var a=this._wwaData.objectAttribute[e][Q.ATR_STRING],i=this._wwaData.message[a];try{var o=this._camera.getPosition().getScreenTopPosition().getPartsCoord(),r=(t.x-o.x)*Q.CHIP_SIZE,n=(t.y-o.y)*Q.CHIP_SIZE;this._player.addItem(e,this._wwaData.objectAttribute[e][Q.ATR_NUMBER],!1,this._wwaData.isItemEffectEnabled?{screenPixelCoord:new w(r,n),itemBoxBackgroundImageCoord:new w(this._wwaData.imgItemboxX*Q.CHIP_SIZE,this._wwaData.imgItemboxY*Q.CHIP_SIZE)}:void 0),this.setPartsOnPosition(I.OBJECT,0,t),0!==this._wwaData.objectAttribute[e][Q.ATR_MODE]||(this.setMessageQueue(i,!1,!1,e,I.OBJECT,t.clone()),this.appearParts(t,A.OBJECT,e))}catch(t){"BLANK"!==this._wwaData.systemMessage[Y.FULL_ITEM]&&this.setMessageQueue(""===this._wwaData.systemMessage[Y.FULL_ITEM]?"これ以上、アイテムを持てません。":this._wwaData.systemMessage[Y.FULL_ITEM],!1,!0)}this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND])},s.prototype._execObjectDoorEvent=function(t,e,s){var a=this._wwaData.objectAttribute[e][Q.ATR_ITEM],i=this._wwaData.objectAttribute[e][Q.ATR_STRING],o=this._wwaData.message[i];this._player.hasItem(a)&&(0===this._wwaData.objectAttribute[e][Q.ATR_MODE]&&this._player.removeItemByPartsID(a),this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND]),this.setMessageQueue(o,!1,!1,e,I.OBJECT,t.clone()),this.setPartsOnPosition(I.OBJECT,0,t),this.appearParts(t,A.OBJECT,e),this._paintSkipByDoorOpen=!0)},s.prototype._execObjectYesNoChoiceEvent=function(t,e,s){var a=this._wwaData.objectAttribute[e][Q.ATR_STRING],i=this._wwaData.message[a],o=this._player.getPosition().getPartsCoord();t.x!==o.x||t.y!==o.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(I.OBJECT,0,t),this.setMessageQueue(i,!0,!1,e,I.OBJECT,t.clone()),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=N.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND])},s.prototype._execObjectLocalGateEvent=function(t,e,s){var a=this._player.getPosition().getPartsCoord();t.x!==a.x||t.y!==a.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(I.OBJECT,0,t);var i=this._wwaData.objectAttribute[e][Q.ATR_JUMP_X],o=this._wwaData.objectAttribute[e][Q.ATR_JUMP_Y];i>Q.RELATIVE_COORD_LOWER&&(i=a.x+i-Q.RELATIVE_COORD_BIAS),o>Q.RELATIVE_COORD_LOWER&&(o=a.y+o-Q.RELATIVE_COORD_BIAS),this.appearParts(t,A.OBJECT,e),0<=i&&0<=o&&i<this._wwaData.mapWidth&&o<this._wwaData.mapWidth&&(i!==a.x||o!==a.y)&&(this._player.jumpTo(new y(this,i,o,0,0)),this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND]))},s.prototype._execObjectUrlGateEvent=function(t,e,s){var a=this._wwaData.objectAttribute[e][Q.ATR_STRING];this._isURLGateEnable&&("BLANK"!==this._wwaData.message[W.ASK_LINK]?(this.setMessageQueue(""===this._wwaData.message[W.ASK_LINK]?"他のページにリンクします。\nよろしいですか?":this._wwaData.message[W.ASK_LINK],!0,!0),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=N.CALL_BY_OBJECT_PARTS,this._yesNoURL=this._wwaData.message[a].split(/\s/g)[0]):location.href=pt(this._wwaData.message[a].split(/\s/g)[0]))},s.prototype._execObjectScoreEvent=function(t,e,s){var a=this._wwaData.objectAttribute[e][Q.ATR_STRING],i=0===a?"スコアを表示します。":this._wwaData.message[a];this.getMessageQueueByRawMessage(i,e,I.OBJECT,t).reduce((function(t,e){return t||!e.isEmpty()}),!1)&&(this._scoreRates={energy:this._wwaData.objectAttribute[e][Q.ATR_ENERGY],strength:this._wwaData.objectAttribute[e][Q.ATR_STRENGTH],defence:this._wwaData.objectAttribute[e][Q.ATR_DEFENCE],gold:this._wwaData.objectAttribute[e][Q.ATR_GOLD]},this.updateScore(),this._scoreWindow.show()),this.setMessageQueue(i,!1,!1,e,I.OBJECT,t),this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND])},s.prototype.updateScore=function(){if(this._scoreRates){var t=this._player.getStatus().calculateScore(this._scoreRates);this._scoreWindow.update(t)}},s.prototype._execChoiceWindowRunningEvent=function(){var t,e;if(0==--this._yesNoDispCounter)if(this._yesNoJudge===g.YES){if(this._yesNoChoiceCallInfo===N.CALL_BY_MAP_PARTS)(t=this._wwaData.mapAttribute[this._yesNoChoicePartsID][Q.ATR_TYPE])===Q.MAP_URLGATE&&(location.href=pt(this._yesNoURL));else if(this._yesNoChoiceCallInfo===N.CALL_BY_OBJECT_PARTS)if((t=this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_TYPE])===Q.OBJECT_BUY)this._player.hasItem(this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_ITEM])?(this._player.removeItemByPartsID(this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_ITEM]),e=this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_GOLD],this._player.earnGold(e),this.setStatusChangedEffect(new E(0,0,0,e)),this.appearParts(this._yesNoChoicePartsCoord,A.OBJECT,this._yesNoChoicePartsID)):"BLANK"!==this._wwaData.message[W.NO_ITEM]&&this._messageQueue.push(new vt(""===this._wwaData.message[W.NO_ITEM]?"アイテムを持っていない。":this._wwaData.message[W.NO_ITEM],!0));else if(t===Q.OBJECT_SELL)if(this._player.hasGold(this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_GOLD]))if(this._player.canHaveMoreItems()||0===this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_ITEM]){if(0!==this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_ITEM]){var s=this._yesNoChoicePartsCoord,a=this._camera.getPosition().getScreenTopPosition().getPartsCoord(),i=(s.x-a.x)*Q.CHIP_SIZE,o=(s.y-a.y)*Q.CHIP_SIZE;this._player.addItem(this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_ITEM],0,!1,this._wwaData.isItemEffectEnabled?{screenPixelCoord:new w(i,o),itemBoxBackgroundImageCoord:new w(this._wwaData.imgItemboxX*Q.CHIP_SIZE,this._wwaData.imgItemboxY*Q.CHIP_SIZE)}:void 0)}var r=new E(this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_ENERGY],this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_STRENGTH],this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_DEFENCE],-this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_GOLD]);this._player.getStatusWithoutEquipments();if(r.energy=r.energy>Q.STATUS_MINUS_BORDER?Q.STATUS_MINUS_BORDER-r.energy:r.energy,this.setStatusChangedEffect(r),this._player.addStatusAll(r),this._player.isDead()&&0!==this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_ENERGY])return void this.gameover();this.appearParts(this._yesNoChoicePartsCoord,A.OBJECT,this._yesNoChoicePartsID)}else"BLANK"!==this._wwaData.systemMessage[Y.FULL_ITEM]&&this._messageQueue.push(new vt(""===this._wwaData.systemMessage[Y.FULL_ITEM]?"これ以上、アイテムを持てません。":this._wwaData.systemMessage[Y.FULL_ITEM],!0));else"BLANK"!==this._wwaData.message[W.NO_MONEY]&&this._messageQueue.push(new vt(""===this._wwaData.message[W.NO_MONEY]?"所持金がたりない。":this._wwaData.message[W.NO_MONEY],!0));else t===Q.OBJECT_SELECT?this.appearParts(this._yesNoChoicePartsCoord,A.CHOICE_YES,this._yesNoChoicePartsID):t===Q.OBJECT_URLGATE&&(location.href=pt(this._yesNoURL));else this._yesNoChoiceCallInfo===N.CALL_BY_ITEM_USE?this._player.readyToUseItem(this._yesNoUseItemPos):this._yesNoChoiceCallInfo===N.CALL_BY_QUICK_LOAD||this._yesNoChoiceCallInfo===N.CALL_BY_LOG_QUICK_LOAD?(this._messageWindow.deleteSaveDom(),_t(F[R.QUICK_LOAD]).classList.remove("onpress"),this._messageWindow.load()&&(this._stopUpdateByLoadFlag=!0,this._loadType=b.QUICK_LOAD)):this._yesNoChoiceCallInfo===N.CALL_BY_QUICK_SAVE?(this._messageWindow.deleteSaveDom(),_t(F[R.QUICK_SAVE]).classList.remove("onpress"),this._quickSave(N.CALL_BY_QUICK_SAVE)):this._yesNoChoiceCallInfo===N.CALL_BY_RESTART_GAME?(_t(F[R.RESTART_GAME]).classList.remove("onpress"),this._stopUpdateByLoadFlag=!0,this._loadType=b.RESTART_GAME):this._yesNoChoiceCallInfo===N.CALL_BY_END_GAME?(window.history.back(-1),_t(F[R.GOTO_WWA]).classList.remove("onpress")):this._yesNoChoiceCallInfo===N.CALL_BY_GOTO_WWA?(location.href=pt(Q.WWA_HOME),_t(F[R.GOTO_WWA]).classList.remove("onpress")):this._yesNoChoiceCallInfo===N.CALL_BY_PASSWORD_LOAD?(_t(F[R.QUICK_LOAD]).classList.remove("onpress"),this._player.setPasswordWindowWating(),this._passwordWindow.show(Lt.LOAD)):this._yesNoChoiceCallInfo===N.CALL_BY_PASSWORD_SAVE?(_t(F[R.QUICK_SAVE]).classList.remove("onpress"),this._player.setPasswordWindowWating(),this._passwordWindow.password=this._quickSave(N.CALL_BY_PASSWORD_SAVE),this._passwordWindow.show(Lt.SAVE)):this._yesNoChoiceCallInfo===N.CALL_BY_SUSPEND&&(_t(F[R.QUICK_SAVE]).classList.remove("onpress"),this._quickSave(N.CALL_BY_SUSPEND));this._yesNoJudge=g.UNSELECTED,this._setNextMessage(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=N.NONE,this._messageWindow.setYesNoChoice(!1)}else if(this._yesNoJudge===g.NO){if(this._yesNoChoiceCallInfo===N.CALL_BY_MAP_PARTS)t=this._wwaData.mapAttribute[this._yesNoChoicePartsID][Q.ATR_TYPE],Q.MAP_URLGATE;else if(this._yesNoChoiceCallInfo===N.CALL_BY_OBJECT_PARTS)(t=this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_TYPE])===Q.OBJECT_BUY||t===Q.OBJECT_SELL||(t===Q.OBJECT_SELECT?this.appearParts(this._yesNoChoicePartsCoord,A.CHOICE_NO,this._yesNoChoicePartsID):Q.OBJECT_URLGATE);else if(this._yesNoChoiceCallInfo===N.CALL_BY_ITEM_USE){_t("item"+(this._yesNoUseItemPos-1)).classList.remove("onpress")}else if(this._yesNoChoiceCallInfo===N.CALL_BY_QUICK_LOAD||this._yesNoChoiceCallInfo===N.CALL_BY_LOG_QUICK_LOAD)switch(this._messageWindow.deleteSaveDom(),this._yesNoChoiceCallInfo=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword),this._yesNoChoiceCallInfo){case N.NONE:_t(F[R.QUICK_LOAD]).classList.remove("onpress");break;case N.CALL_BY_PASSWORD_LOAD:return this._yesNoJudge=g.UNSELECTED,void this.onpasswordloadcalled();case N.CALL_BY_LOG_QUICK_LOAD:this._wwaSave.selectLogSaveDataList(),this._messageWindow.createSaveDom();var n=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword);switch(this._yesNoJudge=g.UNSELECTED,n){case N.CALL_BY_PASSWORD_LOAD:this.setMessageQueue("読み込むオートセーブを選んでください。\n→Noでデータ復帰用パスワードの\n 入力選択ができます。",!0,!0);break;case N.NONE:this.setMessageQueue("読み込むオートセーブを選んでください。",!0,!0)}return}else if(this._yesNoChoiceCallInfo===N.CALL_BY_QUICK_SAVE){if(this._messageWindow.deleteSaveDom(),this._usePassword||this._useSuspend)return this._yesNoJudge=g.UNSELECTED,void(this._useSuspend?this.onpasssuspendsavecalled():this._usePassword&&this.onpasswordsavecalled());_t(F[R.QUICK_SAVE]).classList.remove("onpress")}else if(this._yesNoChoiceCallInfo===N.CALL_BY_RESTART_GAME)_t(F[R.RESTART_GAME]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===N.CALL_BY_END_GAME)_t(F[R.GOTO_WWA]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===N.CALL_BY_GOTO_WWA)_t(F[R.GOTO_WWA]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===N.CALL_BY_PASSWORD_LOAD)_t(F[R.QUICK_LOAD]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===N.CALL_BY_PASSWORD_SAVE)_t(F[R.QUICK_SAVE]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===N.CALL_BY_SUSPEND){if(this._usePassword)return this._yesNoJudge=g.UNSELECTED,void this.onpasswordsavecalled();_t(F[R.QUICK_SAVE]).classList.remove("onpress")}this._yesNoJudge=g.UNSELECTED,this._setNextMessage(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=N.NONE,this._messageWindow.setYesNoChoice(!1)}},s.prototype.setMessageQueue=function(t,e,s,a,i,o,r){if(void 0===a&&(a=0),void 0===i&&(i=I.OBJECT),void 0===o&&(o=new w(0,0)),void 0===r&&(r=!1),this._messageQueue=this._messageQueue.concat(this.getMessageQueueByRawMessage(t,a,i,o)),this._lastMessage.isEndOfPartsEvent&&void 0!==this._reservedMoveMacroTurn&&(this._player.setMoveMacroWaiting(this._reservedMoveMacroTurn),this._reservedMoveMacroTurn=void 0),0!==this._messageQueue.length){for(var n=this._messageQueue.shift(),_=0;_<n.macro.length;_++)this._execMacroListInNextFrame.push(n.macro[_]);if(this._lastMessage=n,!n.isEmpty())return this._messageWindow.setParsedMessage(n),this._messageWindow.setYesNoChoice(e),this._messageWindow.setPositionByPlayerPosition(0!==this._faces.length,this._scoreWindow.isVisible(),s,this._player.getPosition(),this._camera.getPosition()),this._player.setMessageWaiting(),!0;0===this._messageQueue.length?this._hideMessageWindow(r):this._setNextMessage()}return!1},s.prototype.getMessageQueueByRawMessage=function(t,e,s,a,i){void 0===i&&(i=!1);var o=t.split(/\n\<c\>/i)[0].split(/\<c\>/i)[0].replace(/\n\<p\>\n/gi,"<P>").replace(/\n\<p\>/gi,"<P>").replace(/\<p\>\n/gi,"<P>").replace(/\<p\>/gi,"<P>"),r=[];if(""!==o)for(var n=o.split(/\<p\>/gi),_=0;_<n.length;_++){for(var h=n[_].split("\n"),c=[],u=[],l=0;l<h.length;l++){var p=h[l].match(/(\$(?:[a-zA-Z_][a-zA-Z0-9_]*)\=(?:.*))/);if(null!==p&&p.length>=2){var d=Ct(this,e,s,a,p[1]);d.macroType===k.SHOW_STR?c.push(this._generateUserValString(d.macroArgs)):u.push(d)}else h[l].match(/^\$/)||c.push([h[l]])}var E=c.reduce((function(t,e,s){var a=0===s?[]:["\n"];return Fe(Fe(Fe([],t,!0),a,!0),e,!0)}),[]);r.push(new vt(E,i,_===n.length-1,u))}return r},s.prototype.appearParts=function(t,e,s){var a;void 0===s&&(s=0);var i,o,r,n,_,h=e===A.CHOICE_NO?Q.APPERANCE_PARTS_MIN_INDEX_NO:Q.APPERANCE_PARTS_MIN_INDEX,c=e===A.CHOICE_YES?Q.APPERANCE_PARTS_MAX_INDEX_YES:Q.APPERANCE_PARTS_MAX_INDEX;for(e===A.MAP?(s=0===s?this._wwaData.map[t.y][t.x]:s,a=I.MAP):(s=0===s?this._wwaData.mapObject[t.y][t.x]:s,a=I.OBJECT),_=h;_<=c;_++){var u=Q.ATR_APPERANCE_BASE+_*Q.REL_ATR_APPERANCE_UNIT_LENGTH,l=u+Q.REL_ATR_APPERANCE_ID,p=u+Q.REL_ATR_APPERANCE_X,d=u+Q.REL_ATR_APPERANCE_Y,E=u+Q.REL_ATR_APPERANCE_TYPE;if(i=a===I.MAP?this._wwaData.mapAttribute[s][l]:this._wwaData.objectAttribute[s][l],o=a===I.MAP?this._wwaData.mapAttribute[s][E]:this._wwaData.objectAttribute[s][E],r=a===I.MAP?this._wwaData.mapAttribute[s][p]:this._wwaData.objectAttribute[s][p],n=a===I.MAP?this._wwaData.mapAttribute[s][d]:this._wwaData.objectAttribute[s][d],r===Q.PLAYER_COORD?(r=this._player.getPosition().getPartsCoord().x,this._player.resetEventExecutionInfo()):r>Q.RELATIVE_COORD_LOWER&&(r=t.x+r-Q.RELATIVE_COORD_BIAS),n===Q.PLAYER_COORD?(n=this._player.getPosition().getPartsCoord().y,this._player.resetEventExecutionInfo()):n>Q.RELATIVE_COORD_LOWER&&(n=t.y+n-Q.RELATIVE_COORD_BIAS),0!==r||0!==n)try{if(new y(this,r,n,0,0),o===I.MAP){if(i>=this._wwaData.mapPartsMax)throw new Error("背景パーツの範囲外IDが指定されました");var m=new w(r,n);this.setPartsOnPosition(I.MAP,i,m)}else{if(i>=this._wwaData.objPartsMax)throw new Error("物体パーツの範囲外IDが指定されました");m=new w(r,n);this.setPartsOnPosition(I.OBJECT,i,m),this._replaceRandomObject(new w(r,n)),r===this._player.getPosition().getPartsCoord().x&&n===this._player.getPosition().getPartsCoord().y&&this._player.setPartsAppearedFlag()}}catch(t){}}},s.prototype.appearPartsByDirection=function(t,e,s){var a=this._player.getPosition().getPartsCoord(),i=this._player.getDir(),o=T[i],r=O[i];this.appearPartsEval(a,(o>=0?"+":"-")+Math.abs(o)*t,(r>=0?"+":"-")+Math.abs(r)*t,e,s)},s.prototype.appearPartsEval=function(t,e,s,a,i){var o,r,n=this._player.getPosition().getPartsCoord();if("P"===e||"p"===e)o=n.x;else if("+"===e[0])o=t.x+parseInt(e.substr(1));else if("-"===e[0])o=t.x-parseInt(e.substr(1));else if(o=parseInt(e),isNaN(o))throw new Error("座標として解釈できない文字が含まれています。");if("P"===s||"p"===s)r=n.y;else if("+"===s[0])r=t.y+parseInt(s.substr(1));else if("-"===s[0])r=t.y-parseInt(s.substr(1));else if(r=parseInt(s),isNaN(r))throw new Error("座標として解釈できない文字が含まれています。");try{new y(this,o,r,0,0);if(i===I.MAP){if(a>=this._wwaData.mapPartsMax)throw new Error("背景パーツの範囲外IDが指定されました");var _=new w(o,r);this.setPartsOnPosition(I.MAP,a,_)}else{if(a>=this._wwaData.objPartsMax)throw new Error("物体パーツの範囲外IDが指定されました");_=new w(o,r);this.setPartsOnPosition(I.OBJECT,a,_),this._replaceRandomObject(new w(o,r)),o===this._player.getPosition().getPartsCoord().x&&r===this._player.getPosition().getPartsCoord().y&&this._player.setPartsAppearedFlag()}}catch(t){}},s.prototype._replaceRandomObject=function(t){var e,s,a=this._wwaData.mapObject[t.y][t.x];if(this._wwaData.objectAttribute[a][Q.ATR_TYPE]===Q.OBJECT_RANDOM){for(var i=0;i<Q.RANDOM_ITERATION_MAX;i++){if(s=Math.floor(10*Math.random()),(e=this._wwaData.objectAttribute[a][Q.ATR_RANDOM_BASE+s])>=this._wwaData.objPartsMax){e=0;break}if(this._wwaData.objectAttribute[e][Q.ATR_TYPE]!==Q.OBJECT_RANDOM)break;a=e}this.setPartsOnPosition(I.OBJECT,e,t)}},s.prototype._replaceRandomObjectsInScreen=function(){for(var t=this._camera.getPosition().getPartsCoord(),e=Math.max(0,t.x-1),s=Math.min(this._wwaData.mapWidth-1,t.x+Q.H_PARTS_NUM_IN_WINDOW),a=Math.max(0,t.y-1),i=Math.min(this._wwaData.mapWidth-1,t.y+Q.V_PARTS_NUM_IN_WINDOW),o=e;o<=s;o++)for(var r=a;r<i;r++)this._replaceRandomObject(new w(o,r))},s.prototype._replaceAllRandomObjects=function(){for(var t=0;t<this._wwaData.mapWidth;t++)for(var e=0;e<this._wwaData.mapWidth;e++)this._replaceRandomObject(new w(t,e))},s.prototype.gameover=function(){var t=this._wwaData.gameoverX,e=this._wwaData.gameoverY;this._messageWindow.isVisible()&&(this._yesNoJudge=g.UNSELECTED,this._messageQueue=[],this._player.setDelayFrame(),this._messageWindow.hide(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=N.NONE,this._messageWindow.setYesNoChoice(!1)),this._waitFrame=0,this._temporaryInputDisable=!0,this._execMacroListInNextFrame=[],this._player.jumpTo(new y(this,t,e,0,0))},s.prototype.setYesNoInput=function(t){this._yesNoJudgeInNextFrame=t},s.prototype.getYesNoState=function(){return void 0!==this._yesNoJudgeInNextFrame?this._yesNoJudgeInNextFrame:this._yesNoJudge},s.prototype.setStatusChangedEffect=function(t){this._wwaData.isItemEffectEnabled&&(0!==t.strength&&(_t("disp-strength").classList.add("onpress"),this._statusPressCounter.strength=Q.STATUS_CHANGED_EFFECT_FRAME_NUM),0!==t.defence&&(_t("disp-defence").classList.add("onpress"),this._statusPressCounter.defence=Q.STATUS_CHANGED_EFFECT_FRAME_NUM),t instanceof E&&(0!==t.energy&&(_t("disp-energy").classList.add("onpress"),this._statusPressCounter.energy=Q.STATUS_CHANGED_EFFECT_FRAME_NUM),0!==t.gold&&(_t("disp-gold").classList.add("onpress"),this._statusPressCounter.gold=Q.STATUS_CHANGED_EFFECT_FRAME_NUM)))},s.prototype.setPartsOnPosition=function(t,e,s){var a,i,o=s.y<<it.BITSHIFT|s.x;t===I.MAP?(a=this._wwaData.map[s.y][s.x],e=this.loadMapPartsID(e),a=this.loadMapPartsID(a),this._wwaData.map[s.y][s.x]=e,-1!==(i=this._mapIDTable[a].indexOf(o))&&this._mapIDTable[a].splice(i,1),-1===(i=this._mapIDTable[e].indexOf(o))&&this._mapIDTable[e].push(o)):(a=this._wwaData.mapObject[s.y][s.x],e=this.loadMapPartsObjectID(e),a=this.loadMapPartsObjectID(a),this._wwaData.mapObject[s.y][s.x]=e,-1!==(i=this._mapObjectIDTable[a].indexOf(o))&&this._mapObjectIDTable[a].splice(i,1),-1===(i=this._mapObjectIDTable[e].indexOf(o))&&this._mapObjectIDTable[e].push(o))},s.prototype._countSamePartsLength=function(t,e){var s;for(s=e+1;s<t.length&&t[s]===t[s-1];s++);return s-e},s.prototype._compressMap=function(t){for(var e=[],s=0;s<t.length;s++){e[s]=[];for(var a=0;a<t[s].length;){var i=this._countSamePartsLength(t[s],a);e[s].push([t[s][a],i]),a+=i}}return e},s.prototype._decompressMap=function(t){for(var e=[],s=0;s<t.length;s++){e[s]=[],0;for(var a=0;a<t[s].length;a++)for(var i=t[s][a][1],o=0;o<i;o++)e[s].push(t[s][a][0])}return e},s.prototype._generateMapDataHash=function(t){var e="A",s=0,a=0,i=0;for(i=0;i<t.map.length;i++){for(a=0;a<t.map[i].length;)s=this._countSamePartsLength(t.map[i],a),e+=t.map[i][a]+"|"+s+"/",a+=s;for(a=0;a<t.mapObject[i].length;)s=this._countSamePartsLength(t.mapObject[i],a),e+=t.mapObject[i][a]+"|"+s+"/",a+=s}for(var o=0;o<t.mapAttribute.length;o++)for(var r=0;r<t.mapAttribute[o].length;r++)e+=t.mapAttribute[o][r]+"/";for(var n=0;n<t.objectAttribute.length;n++)for(var _=0;_<t.objectAttribute[n].length;_++)e+=t.objectAttribute[n][_]+"/";return Kt(e+="Z")},s.prototype._generateSaveDataHash=function(t){var e=this._generateMapDataHash(t),s=[];for(var a in t)"map"!==a&&"mapObject"!==a&&"mapCompressed"!==a&&"mapObjectCompressed"!==a&&"mapAttribute"!==a&&"objectAttribute"!==a&&"checkString"!==a&&s.push(a);s.sort();for(var i=0;i<s.length;i++)e+=dt(t[s[i]]);return Kt(e)},s.prototype.compressSystem=function(){return qt},s.prototype._quickSave=function(t){var e,s,a=JSON.parse(JSON.stringify(this._wwaData)),i=this._player.getPosition().getPartsCoord(),o=this._player.getStatusWithoutEquipments();switch(a.itemBox=this._player.getCopyOfItemBox(),a.playerX=i.x,a.playerY=i.y,a.statusEnergyMax=this._player.getEnergyMax(),a.statusEnergy=o.energy,a.statusStrength=o.strength,a.statusDefence=o.defence,a.statusGold=o.gold,a.moves=this._player.getMoveCount(),a.frameCount=this._player.getFrameCount(),a.gameSpeedIndex=this._player.getSpeedIndex(),t){case N.CALL_BY_LOG_QUICK_SAVE:case N.CALL_BY_QUICK_SAVE:case N.CALL_BY_SUSPEND:break;case N.CALL_BY_PASSWORD_SAVE:a.checkOriginalMapString=this.checkOriginalMapString,a.checkString=this._generateSaveDataHash(a)}switch(a.message=void 0,a.mapAttribute=void 0,a.objectAttribute=void 0,t){case N.CALL_BY_QUICK_SAVE:return this._messageWindow.save(this._cvs,a),this.wwaCustomEvent("wwa_quicksave",{data:a}),"";case N.CALL_BY_PASSWORD_SAVE:var r=qt.compress(a);r.isCompress=1;var n=JSON.stringify(r);return this.wwaCustomEvent("wwa_passwordsave",{data:a,compress:r}),e=n,s=this._wwaData.worldPassNumber,console.warn(Gt.enc.Utf8.parse(e)),Gt.AES.encrypt(Gt.enc.Utf8.parse(e),Ht(s)).toString();case N.CALL_BY_SUSPEND:this.wwaCustomEvent("wwa_suspend",{data:a,compress:qt.compress(a)});break;case N.CALL_BY_LOG_QUICK_SAVE:this.wwaCustomEvent("wwa_autosave",{data:a}),this._wwaSave.autoSave(this._cvs,a)}},s.prototype.wwaCustomEvent=function(t,e){void 0===e&&(e={}),this.wwaCustomEventEmitter.dispatch(t,e)},s.prototype._decodePassword=function(t){var e,s,a,i="",o=void 0;try{e=t,s=this._wwaData.worldPassNumber,i=Gt.AES.decrypt(e,Ht(s)).toString(Gt.enc.Utf8)}catch(t){o=t}if(!i){console.warn("新方式でのパスワード暗号化解除失敗:",o);try{i=function(t,e,s){return Gt.AES.decrypt(t,function(t,e){return"^ /".concat(231*t+8310+e,"P+>A[]")}(e,s)).toString(Gt.enc.Utf8)}(t,this._wwaData.worldPassNumber,this.checkOriginalMapString)}catch(t){o=t}}if(!i){console.warn("旧方式でのパスワード暗号化解除失敗:",o);var r=o&&o.message?o.message:"";throw new Error("パスワード取得時からワールド制作者によってマップの暗証番号が変更されたか、\nパスワードが壊れているために正常にセーブデータが復元できませんでした。\n"+r)}try{a=JSON.parse(i)}catch(t){throw new Error("マップデータ以外のものが暗号化されたか、マップデータに何かが不足しているようです。\nJSON PARSE FAILED")}return a.isCompress?(delete a.isCompress,qt.decompress(a)):[a,{isWorldNameEmpty:!1}]},s.prototype._quickLoad=function(t,e,s){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===s&&(s=!0),!t&&void 0===this._wwaSave.hasSaveData()&&null===e)throw new Error("セーブデータがありません。");var a,i=!1;if(null!==e){var o=this._decodePassword(e);a=o[0],i=o[1].isWorldNameEmpty}else a=JSON.parse(JSON.stringify(t?this._restartData:this._messageWindow.load()));if(a.message=JSON.parse(JSON.stringify(this._restartData.message)),a.mapAttribute=JSON.parse(JSON.stringify(this._restartData.mapAttribute)),a.objectAttribute=JSON.parse(JSON.stringify(this._restartData.objectAttribute)),void 0===a.map&&(a.map=this._decompressMap(a.mapCompressed)),void 0===a.mapObject&&(a.mapObject=this._decompressMap(a.mapObjectCompressed)),delete a.mapCompressed,delete a.mapObjectCompressed,null!==e){if(!i&&a.worldName!==this._wwaData.worldName)throw console.error("Invalid title","(password)=".concat(a.worldName," (current map)=").concat(this._wwaData.worldName)),new Error("前回パスワード取得時から、制作者によってワールド名が変更されたためロードできませんでした。\n予めご了承ください。");var r=this.checkOriginalMapString;if(this._isDisallowLoadOldSave&&a.checkOriginalMapString!==r)throw console.error("Invalid hash","(password)=".concat(a.checkOriginalMapString," (current map)=").concat(r)),new Error("前回パスワード取得時から、制作者によってマップが変更されたためロードできませんでした。\n(マップデータ制作者の設定により、内容が変更されると以前のパスワードは利用できなくなります。)\n予めご了承ください。");console.log("Valid Password!")}return s&&this._applyQuickLoad(a),a},s.prototype._applyQuickLoad=function(t){this._player.setEnergyMax(t.statusEnergyMax),this._player.setEnergy(t.statusEnergy),this._player.setStrength(t.statusStrength),this._player.setDefence(t.statusDefence),this._player.setGold(t.statusGold),this._player.setMoveCount(t.moves),this._player.setFrameCount(t.frameCount),this._player.clearItemBox();for(var e=0;e<t.itemBox.length;e++)this._player.addItem(t.itemBox[e],e+1,!0);this._player.systemJumpTo(new y(this,t.playerX,t.playerY,0,0)),0===t.bgm?this.playSound(K.NO_SOUND):this.playSound(t.bgm),this.setImgClick(new w(t.imgClickX,t.imgClickY)),0!==this.getObjectIdByPosition(this._player.getPosition())&&this._player.setPartsAppearedFlag(),this._wwaData=t,this._mapIDTableCreate(),this._replaceAllRandomObjects(),this.setStatusIconCoord(H.ENERGY,new w(t.imgStatusEnergyX,t.imgStatusEnergyY)),this.setStatusIconCoord(H.STRENGTH,new w(t.imgStatusStrengthX,t.imgStatusStrengthY)),this.setStatusIconCoord(H.DEFENCE,new w(t.imgStatusDefenceX,t.imgStatusDefenceY)),this.setStatusIconCoord(H.GOLD,new w(t.imgStatusGoldX,t.imgStatusGoldY)),this.setWideCellCoord(new w(t.imgWideCellX,t.imgWideCellY)),this.setItemboxBackgroundPosition({x:t.imgItemboxX,y:t.imgItemboxY}),this.setFrameCoord(new w(t.imgFrameX,t.imgFrameY)),this.setPlayerSpeedIndex(t.gameSpeedIndex),this.updateCSSRule(),this.updateEffect(),this._player.updateStatusValueBox(),this._wwaSave.quickSaveButtonUpdate(this._wwaData)},s.prototype._mapIDTableCreate=function(){var t;for(this._mapIDTable=[],this._mapObjectIDTable=[],t=0;t<this._wwaData.mapPartsMax;t++)this._mapIDTable[t]=[];for(t=0;t<this._wwaData.objPartsMax;t++)this._mapObjectIDTable[t]=[];for(var e=0;e<this._wwaData.mapWidth;e++)for(var s=0;s<this._wwaData.mapWidth;s++){var a=s<<it.BITSHIFT|e;t=this._wwaData.map[s][e],this._mapIDTable[t]instanceof Array||(this._mapIDTable[t]=[]),this._mapIDTable[t].push(a),t=this._wwaData.mapObject[s][e],this._mapObjectIDTable[t]instanceof Array||(this._mapObjectIDTable[t]=[]),this._mapObjectIDTable[t].push(a)}},s.prototype._restartGame=function(){this._quickLoad(!0)},s.prototype._fadeout=function(t){var e=0,s=Q.MAP_WINDOW_WIDTH,a=Q.FADEOUT_SPEED,i=_t("wwa-fader");i.style.display="block";var o=setInterval((function(){if(e+=a,(s-=2*a)<=0||2*e>Q.MAP_WINDOW_WIDTH)return i.removeAttribute("style"),i.style.display="block",i.style.borderWidth="0",i.style.width=Q.MAP_WINDOW_WIDTH+"px",i.style.height=Q.MAP_WINDOW_HEIGHT+"px",i.style.backgroundColor="#808080",clearInterval(o),void t();i.style.width=s+"px",i.style.height=s+"px",i.style.borderWidth=e+"px"}),20)},s.prototype.moveObjects=function(t){var e,s,a,i=this._camera.getPosition(),o=(this._player.getPosition(),i.getPartsCoord(),i.getPartsCoord().x),r=i.getPartsCoord().y;if(this.getMapAttributeByPosition(this._player.getPosition(),Q.ATR_TYPE)!==Q.MAP_LOCALGATE&&this.getObjectAttributeByPosition(this._player.getPosition(),Q.ATR_TYPE)!==Q.OBJECT_LOCALGATE){for(e=new Array(Q.V_PARTS_NUM_IN_WINDOW+2),this.hoge=new Array(Q.V_PARTS_NUM_IN_WINDOW+2),a=-1;a<=Q.V_PARTS_NUM_IN_WINDOW;a++)for(e[a+1]=new Array(Q.H_PARTS_NUM_IN_WINDOW+2),this.hoge[a+1]=new Array(Q.H_PARTS_NUM_IN_WINDOW+2),s=-1;s<=Q.H_PARTS_NUM_IN_WINDOW;s++)if(r+a<0||r+a>=this._wwaData.mapWidth||o+s<0||o+s>=this._wwaData.mapWidth)e[a+1][s+1]=0,this.hoge[a+1][s+1]=0;else{try{var n=(_=new y(this,o+s,r+a,0,0)).getPartsCoord()}catch(t){e[a+1][s+1]=0,this.hoge[a+1][s+1]=0;continue}this._wwaData.mapObject[n.y][n.x];e[a+1][s+1]=this._wwaData.mapObject[n.y][n.x],this.hoge[a+1][s+1]=-this._wwaData.mapObject[n.y][n.x]}for(s=-1;s<=Q.H_PARTS_NUM_IN_WINDOW;s++)if(!(o+s<0||o+s>=this._wwaData.mapWidth))for(a=-1;a<=Q.V_PARTS_NUM_IN_WINDOW;a++)if(!(r+a<0||r+a>=this._wwaData.mapWidth)){try{var _;n=(_=new y(this,o+s,r+a,0,0)).getPartsCoord()}catch(t){continue}var h=this._wwaData.mapObject[n.y][n.x];if(0!==h&&this._wwaData.objectAttribute[h][Q.ATR_MOVE]!==B.STATIC&&this._wwaData.objectAttribute[h][Q.ATR_TYPE]!==Q.OBJECT_LOCALGATE&&this._wwaData.objectAttribute[h][Q.ATR_TYPE]!==Q.OBJECT_RANDOM&&(this._wwaData.objectAttribute[h][Q.ATR_MOVE]===B.CHASE_PLAYER||this._wwaData.objectAttribute[h][Q.ATR_MOVE]===B.RUN_OUT||this._wwaData.objectAttribute[h][Q.ATR_MOVE]===B.HANG_AROUND)){var c=this._wwaData.objectAttribute[h][Q.ATR_MOVE];if(c!==B.HANG_AROUND){var u,l=this._getCandidateCoord(t,_,c),p=new w(l.x,n.y),d=new w(n.x,l.y),E=null;if(this._objectCanMoveTo(t,l,e))this._setObjectsInNextFrame(n,l,o,r,e,h);else{var m=this._getSecondCandidateMoveMode(t,n,l,p,d,this._wwaData.objectAttribute[h][Q.ATR_TYPE]===Q.OBJECT_MONSTER,e);m===x.MODE_X?this._setObjectsInNextFrame(n,p,o,r,e,h):m===x.MODE_Y?this._setObjectsInNextFrame(n,d,o,r,e,h):null===(E=this._getThirdCandidate(t,_,l,c,e))||this._wwaData.isOldMove?(u=this._getRandomMoveCoord(t,_,e),this._setObjectsInNextFrame(n,u,o,r,e,h)):this._setObjectsInNextFrame(n,E,o,r,e,h)}}else u=this._getRandomMoveCoord(t,_,e),this._setObjectsInNextFrame(n,u,o,r,e,h)}}}},s.prototype._getCandidateCoord=function(t,e,s){var a=e.getPartsCoord();this._player.getPosition().getOffsetCoord(),this._player.getPosition().getPartsCoord();try{var i=t?this._player.getPosition().getNextJustPosition().getPartsCoord():this._player.getPosition().getPartsCoord()}catch(t){throw new Error("予期せぬ方向への移動のようです。")}var o=a.clone(),r=0,n=0;return s===B.CHASE_PLAYER?(r=a.x>i.x?-1:a.x<i.x?1:0,n=a.y>i.y?-1:a.y<i.y?1:0):s===B.RUN_OUT&&(r=a.x>i.x?1:a.x<i.x?-1:0,n=a.y>i.y?1:a.y<i.y?-1:0),o.x+=r,o.y+=n,o.x=Math.min(this._wwaData.mapWidth-1,Math.max(0,o.x)),o.y=Math.min(this._wwaData.mapWidth-1,Math.max(0,o.y)),o},s.prototype._getSecondCandidateMoveMode=function(t,e,s,a,i,o,r){return!t||(this._player.getDir()!==u.UP&&this._player.getDir()!==u.DOWN||!o)&&(this._player.getDir()!==u.LEFT&&this._player.getDir()!==u.RIGHT||o)?this._objectCanMoveTo(t,a,r)?x.MODE_X:this._objectCanMoveTo(t,i,r)?x.MODE_Y:x.UNDECIDED:this._objectCanMoveTo(t,i,r)?x.MODE_Y:this._objectCanMoveTo(t,a,r)?x.MODE_X:x.UNDECIDED},s.prototype._getThirdCandidate=function(t,e,s,a,i){var o,r=a===B.CHASE_PLAYER?1:a===B.RUN_OUT?-1:0,n=t?this._player.getPosition().getNextJustPosition().getPartsCoord():this._player.getPosition().getPartsCoord(),_=e.getPartsCoord();if(n.x!==_.x){if(o=new w(s.x,_.y+1*r),this._objectCanMoveTo(t,o,i))return o;if(o=new w(s.x,_.y-1*r),this._objectCanMoveTo(t,o,i))return o;if(o=new w(_.x,_.y+1*r),this._objectCanMoveTo(t,o,i))return o;if(o=new w(_.x,_.y-1*r),this._objectCanMoveTo(t,o,i))return o}if(n.y!==_.y){if(o=new w(_.x+1*r,s.y),this._objectCanMoveTo(t,o,i))return o;if(o=new w(_.x-1*r,s.y),this._objectCanMoveTo(t,o,i))return o;if(o=new w(_.x+1*r,_.y),this._objectCanMoveTo(t,o,i))return o;if(o=new w(_.x-1*r,_.y),this._objectCanMoveTo(t,o,i))return o}return null},s.prototype._getRandomMoveCoord=function(t,e,s){for(var a=e.getPartsCoord(),i=a.clone(),o=this._wwaData.isOldMove?Q.RANDOM_MOVE_ITERATION_NUM_BEFORE_V31:Q.RANDOM_MOVE_ITERATION_NUM,r=0;r<o;r++){var n=Math.floor(8*Math.random());if(i.x=a.x+T[n],i.y=a.y+O[n],this._objectCanMoveTo(t,i,s))return i}return a},s.prototype.isPrevFrameEventExecuted=function(){return this._prevFrameEventExected},s.prototype._objectCanMoveTo=function(t,e,s){if(e.x<0||e.y<0||this._wwaData.mapWidth<=e.x||this._wwaData.mapWidth<=e.y)return!1;var a=this._wwaData.map[e.y][e.x],i=this._wwaData.mapObject[e.y][e.x],o=this._wwaData.mapAttribute[a][Q.ATR_TYPE],r=this._camera.getPosition(),n=r.getPartsCoord().x,_=r.getPartsCoord().y;if(0===a&&!this.isOldMap()||o===Q.MAP_WALL)return!1;var h=e.x-n+1,c=e.y-_+1;if(0<=h&&0<=c&&h<s.length&&c<s.length){if(0!==s[c][h])return!1}else if(0!==i)return!1;if(t){if(this._player.getPosition().getNextJustPosition().getPartsCoord().equals(e))return!1}else if(this._player.getPosition().getPartsCoord().equals(e))return!1;return!0},s.prototype._setObjectsInNextFrame=function(t,e,s,a,i,o){var r=e.x-s+1,n=e.y-a+1;0<=e.x&&e.x<=this._wwaData.mapWidth&&0<=e.y&&e.y<=this._wwaData.mapWidth&&(0<=r&&r<i.length&&0<=n&&n<i.length&&(i[t.y-a+1][t.x-s+1]=0,i[e.y-a+1][e.x-s+1]=o,this.hoge[e.y-a+1][e.x-s+1]=o),this._objectMovingDataManager.add(o,t.convertIntoPosition(this),e.convertIntoPosition(this),t.getDirectionTo(e)))},s.prototype.launchBattleEstimateWindow=function(){var t=this._camera.getPosition().getPartsCoord(),e=Math.max(0,t.x),s=Math.min(this._wwaData.mapWidth-1,t.x+Q.H_PARTS_NUM_IN_WINDOW-1),a=Math.max(0,t.y),i=Math.min(this._wwaData.mapWidth-1,t.y+Q.V_PARTS_NUM_IN_WINDOW-1),o=[];this.playSound(K.DECISION);for(var r=e;r<=s;r++)for(var n=a;n<=i;n++){var _=this._wwaData.mapObject[n][r];this._wwaData.objectAttribute[_][Q.ATR_TYPE]===Q.OBJECT_MONSTER&&-1===o.indexOf(_)&&o.push(_)}return this._bottomButtonType===c.BATTLE_REPORT&&_t(F[R.GOTO_WWA]).classList.add("onpress"),0===o.length?(_t(F[R.GOTO_WWA]).classList.remove("onpress"),this.hideBattleEstimateWindow(),!1):(this._battleEstimateWindow.update(this._player.getStatus(),o),this._battleEstimateWindow.show(),this._player.setEstimateWindowWating(),!0)},s.prototype.hideBattleEstimateWindow=function(){this._battleEstimateWindow.hide(),this._player.clearEstimateWindowWaiting(),_t(F[R.GOTO_WWA]).classList.remove("onpress")},s.prototype.hidePasswordWindow=function(t){if(void 0===t&&(t=!1),this._passwordWindow.hide(),t||this._passwordWindow.mode===Lt.SAVE)this._player.clearPasswordWindowWaiting();else{try{var e=this._quickLoad(!1,this._passwordWindow.password,!1)}catch(t){return this._player.clearPasswordWindowWaiting(),void alert("セーブデータの復元に失敗しました。\nエラー詳細:\n"+t.message)}this._passwordLoadExecInNextFrame=!0,this._passwordSaveExtractData=e}},s.prototype._displayHelp=function(){if(this._player.isControllable()){this.setNowPlayTime();var t="";switch(this.userDevice.device){case P.GAME:switch(this.userDevice.os){case C.NINTENDO:t=" 【操作方法】\nA:Yes,戦闘結果予測の表示\nB:No\nX:メニュー\nY:このリストの表示\nR:初めからスタート\nZL:データの一時保存\nZR:一時保存データの読み込み\n+: 移動速度を上げる\n-: 移動速度を落とす\n WWA Wing バージョン:3.6.11\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;case C.PLAY_STATION:t=" 【操作方法】\n〇:Yes,戦闘結果予測の表示\n×:No\n△:メニュー\n□:このリストの表示\nR1:初めからスタート\nL2:データの一時保存\nR2:一時保存データの読み込み\nOPTIONS: 移動速度を上げる\nSHARE: 移動速度を落とす\n  現在の移動回数:"+this._player.getMoveCount()+"\n  プレイ時間:"+this._player.getPlayTimeText()+"\n WWA Wing バージョン:3.6.11\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;case C.XBOX:t=" 【操作方法】\nB:Yes,戦闘結果予測の表示\nA:No\nY:メニュー\nX:このリストの表示\nRB:初めからスタート\nLT:データの一時保存\nRT:一時保存データの読み込み\nMENU: 移動速度を上げる\nWINDOW: 移動速度を落とす\n  現在の移動回数:"+this._player.getMoveCount()+"\n  プレイ時間:"+this._player.getPlayTimeText()+"\n WWA Wing バージョン:3.6.11\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;default:return}break;case P.SP:case P.VR:return;case P.PC:t=" 【操作方法】\nF1、M:戦闘結果予測の表示\nF3:復帰用パスワード入力\nF4:復帰用パスワード表示\nF5:一時保存データの読み込み\nF6:データの一時保存\nF7:初めからスタート\nF8:WWA公式ページにリンク\nF12:このリストの表示\nキーボードの「123、QWE、ASD、ZXC」は右のアイテムボックスに対応。\n「Enter、Y」はYes,\n「Esc、N」はNoに対応。\n   I: 移動速度を落とす/\nF2、P: 移動速度を上げる\n  現在の移動回数:"+this._player.getMoveCount()+"\n  プレイ時間:"+this._player.getPlayTimeText()+"\n WWA Wing バージョン:3.6.11\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;default:return}t&&this.setMessageQueue(t,!1,!0)}},s.prototype._setNextMessage=function(t){if(void 0===t&&(t=!1),this._clearFacesInNextFrame=!0,this._scoreWindow.isVisible()&&(this._scoreWindow.hide(),this._scoreRates=void 0),this._lastMessage.isEndOfPartsEvent&&void 0!==this._reservedMoveMacroTurn&&(this._player.setMoveMacroWaiting(this._reservedMoveMacroTurn),this._reservedMoveMacroTurn=void 0),0===this._messageQueue.length)this._hideMessageWindow();else{var e=this._messageQueue.shift(),s=e.macro;this._lastMessage=e;for(var a=0;a<s.length;a++)this._execMacroListInNextFrame.push(s[a]);e.isEmpty()?0===this._messageQueue.length?this._hideMessageWindow():this._setNextMessage():(this._player.setDelayFrame(),this._messageWindow.hide(),this._messageWindow.setParsedMessage(e),this._messageWindow.setPositionByPlayerPosition(0!==this._faces.length,this._scoreWindow.isVisible(),t,this._player.getPosition(),this._camera.getPosition()),this._messageWindow.show(),this._player.setMessageWaiting())}},s.prototype._hideMessageWindow=function(t){void 0===t&&(t=!0);var e=0;this._player.isReadyToUseItem()&&(e=this._player.useItem());var s=this.getObjectAttributeById(e,Q.ATR_STRING);this.clearFaces(),0===s?(t&&(this._player.setDelayFrame(),this._messageWindow.hide(),this._keyStore.allClear(),this._mouseStore.clear()),this._player.clearMessageWaiting()):this.setMessageQueue(this.getMessageById(s),!1,!1,e,I.OBJECT,this._player.getPosition().getPartsCoord(),!0)},s.prototype.loadMapPartsObjectID=function(t){return(t|=0)<0||t>=this._wwaData.objPartsMax?0:t},s.prototype.loadMapPartsID=function(t){return(t|=0)<0||t>=this._wwaData.mapPartsMax?0:t},s.prototype.replaceParts=function(t,e,s,a){void 0===s&&(s=I.OBJECT),void 0===a&&(a=!1);var i,o,r,n,_,h,c,u,l=this._camera.getPosition().getPartsCoord(),p=a?Math.max(0,l.x):0,d=a?Math.min(this._wwaData.mapWidth-1,l.x+Q.H_PARTS_NUM_IN_WINDOW-1):this._wwaData.mapWidth-1,E=a?Math.max(0,l.y):0,w=a?Math.min(this._wwaData.mapWidth-1,l.y+Q.V_PARTS_NUM_IN_WINDOW)-1:this._wwaData.mapWidth-1;if(a=0!==p||d!==this._wwaData.mapWidth-1||0!==E||w!==this._wwaData.mapWidth-1,s===I.OBJECT)if(t=this.loadMapPartsObjectID(t),e=this.loadMapPartsObjectID(e),n=this._mapObjectIDTable[t].concat(),(c=this._mapObjectIDTable[t]).length=0,u=this._mapObjectIDTable[e],o=n.length,a)for(r=0;r<o;r++)_=(i=n[r])&it.BITMASK,h=i>>>it.BITSHIFT&it.BITMASK,p<=_&&_<=d&&E<=h&&h<=w?(this._wwaData.mapObject[h][_]=e,u.push(i)):c.push(i);else{for(r=0;r<o;r++)_=(i=n[r])&it.BITMASK,h=i>>>it.BITSHIFT&it.BITMASK,this._wwaData.mapObject[h][_]=e;Array.prototype.push.apply(u,n)}else if(t=this.loadMapPartsID(t),e=this.loadMapPartsID(e),n=this._mapIDTable[t].concat(),(c=this._mapIDTable[t]).length=0,u=this._mapIDTable[e],o=n.length,a)for(r=0;r<o;r++)_=(i=n[r])&it.BITMASK,h=i>>>it.BITSHIFT&it.BITMASK,p<=_&&_<=d&&E<=h&&h<=w?(this._wwaData.map[h][_]=e,u.push(i)):c.push(i);else{for(r=0;r<o;r++)_=(i=n[r])&it.BITMASK,h=i>>>it.BITSHIFT&it.BITMASK,this._wwaData.map[h][_]=e;Array.prototype.push.apply(u,n)}},s.prototype.getYesNoImgCoord=function(){return new w(this._wwaData.yesnoImgPosX,this._wwaData.yesnoImgPosY)},s.prototype.setYesNoImgCoord=function(t){return this._wwaData.yesnoImgPosX=t.x,this._wwaData.yesnoImgPosY=t.y,t},s.prototype.getPlayerImgCoord=function(){return new w(this._wwaData.playerImgPosX,this._wwaData.playerImgPosY)},s.prototype.setPlayerImgCoord=function(t){return this._wwaData.playerImgPosX=t.x,this._wwaData.playerImgPosY=t.y,t},s.prototype.setPlayerEnergyMax=function(t){return this._player.setEnergyMax(t)},s.prototype.getMapPartsNum=function(){return this._wwaData.mapPartsMax},s.prototype.getObjectPartsNum=function(){return this._wwaData.objPartsMax},s.prototype.setMoveMacroWaitingToPlayer=function(t){this._reservedMoveMacroTurn=t},s.prototype.disableSave=function(t){return this._wwaData.disableSaveFlag=t,this._wwaSave.quickSaveButtonUpdate(this._wwaData),t},s.prototype.isOldMap=function(){return this._wwaData.isOldMap},s.prototype.setOldMap=function(t){return this._wwaData.isOldMap=t},s.prototype.setObjectNotCollapseOnPartsOnPlayer=function(t){return this._wwaData.objectNoCollapseDefaultFlag=t},s.prototype.setGameOverPosition=function(t){if(t.x<0||t.x>=this.getMapWidth()||t.y<0||t.y>=this.getMapWidth())throw new Error("マップの範囲外が指定されています!");return this._wwaData.gameoverX=t.x,this._wwaData.gameoverY=t.y,t},s.prototype.setPlayerStatus=function(t,e){if(t===G.ENERGY)this._player.setEnergy(e);else if(t===G.STRENGTH)this._player.setStrength(e);else if(t===G.DEFENCE)this._player.setDefence(e);else if(t===G.GOLD)this._player.setGold(e);else{if(t!==G.MOVES)throw new Error("未定義のステータスタイプです");this._player.setMoveCount(e)}},s.prototype.setDelPlayer=function(t){return this._wwaData.delPlayerFlag=t},s.prototype.setPlayerGetItem=function(t,e){try{this._player.addItem(e,t,!0)}catch(t){}},s.prototype.setStatusIconCoord=function(t,e){var s=e.x*Q.CHIP_SIZE,a=e.y*Q.CHIP_SIZE,i=function(t){ct("".concat(t,">.status-icon")).style.backgroundPosition="-".concat(s,"px -").concat(a,"px")};switch(t){case H.ENERGY:this._wwaData.imgStatusEnergyX=e.x,this._wwaData.imgStatusEnergyY=e.y,i("#disp-energy");break;case H.STRENGTH:this._wwaData.imgStatusStrengthX=e.x,this._wwaData.imgStatusStrengthY=e.y,i("#disp-strength");break;case H.DEFENCE:this._wwaData.imgStatusDefenceX=e.x,this._wwaData.imgStatusDefenceY=e.y,i("#disp-defence");break;case H.GOLD:this._wwaData.imgStatusGoldX=e.x,this._wwaData.imgStatusGoldY=e.y,i("#disp-gold");break;default:throw new Error("種別が不正です。")}return e.clone()},s.prototype.setWideCellCoord=function(t){this._wwaData.imgWideCellX=t.x,this._wwaData.imgWideCellY=t.y;var e=t.x*Q.CHIP_SIZE,s=t.y*Q.CHIP_SIZE;return Array.prototype.forEach.call(ut("div.wide-cell-row"),(function(t){t.style.backgroundPosition="-"+e+"px -"+s+"px"})),t.clone()},s.prototype.setFrameCoord=function(t){return this._wwaData.imgFrameX=t.x,this._wwaData.imgFrameY=t.y,this._cgManager.setFrameImage(t),t.clone()},s.prototype.setBattleEffectCoord=function(t){return this._battleEffectCoord=t.clone()},s.prototype.canInput=function(){return!this._temporaryInputDisable},s.prototype.setEffect=function(t,e){this._wwaData.effectWaits=t,this._wwaData.effectCoords=e,this.updateEffect()},s.prototype.stopEffect=function(){this._wwaData.effectCoords=[],this.updateEffect()},s.prototype.updateEffect=function(){this._cgManager.updateEffects(this._wwaData.effectCoords)},s.prototype.setImgClick=function(t){if(this._wwaData.imgClickX=t.x,this._wwaData.imgClickY=t.y,t.equals(new w(0,0)))Array.prototype.forEach.call(ut(".item-cell>.item-click-border"),(function(t){t.style.backgroundImage="url('"+Q.ITEM_BORDER_IMG_DATA_URL+"')",t.style.backgroundPosition="0 0"}));else{var e=this._wwaData.mapCGName.replace("(","\\(").replace(")","\\)");Array.prototype.forEach.call(ut(".item-cell>.item-click-border"),(function(s){s.style.backgroundImage="url('"+e+"')",s.style.backgroundPosition="-"+t.x*Q.CHIP_SIZE+"px -"+t.y*Q.CHIP_SIZE+"px"}))}},s.prototype.addFace=function(t){this._faces.push(t)},s.prototype.clearFaces=function(){this._faces=[]},s.prototype.updateItemEffectEnabled=function(t){this._wwaData.isItemEffectEnabled=t},s.prototype.setOldMove=function(t){this._wwaData.isOldMove=t},s.prototype.initCSSRule=function(){this._styleElm=_t(Q.WWA_STYLE_TAG_ID),this._sheet=this._styleElm.sheet,this.updateCSSRule()},s.prototype.updateCSSRule=function(){if(void 0===this._stylePos)this._stylePos=new Array(2);else if(void 0!==this._sheet.addRule)for(var t=0;t<this._stylePos.length;t++)this._sheet.removeRule(this._stylePos[this._styleElm[t]]);else for(t=0;t<this._stylePos.length;t++)this._sheet.deleteRule(this._stylePos[this._styleElm[t]]);var e="div.wwa-message-window, div#wwa-text-message-window, div#wwa-battle-estimate, div#wwa-password-window",s=this._isClassicModeEnable?1:.9,a="\nbackground-color: rgba(".concat(this._wwaData.frameColorR,", ").concat(this._wwaData.frameColorG,", ").concat(this._wwaData.frameColorB,", ").concat(s,");\nborder-color: rgba(").concat(this._wwaData.frameOutColorR,", ").concat(this._wwaData.frameOutColorG,", ").concat(this._wwaData.frameOutColorB,", 1);\ncolor: rgba(").concat(this._wwaData.fontColorR,", ").concat(this._wwaData.fontColorG,", ").concat(this._wwaData.fontColorB,", 1);\nwhite-space: pre-wrap;\n"),i="div#wwa-sidebar",o="\ncolor: rgba(".concat(this._wwaData.statusColorR,", ").concat(this._wwaData.statusColorG,", ").concat(this._wwaData.statusColorB,",1);\nfont-weight: bold;\n");void 0!==this._sheet.addRule?(this._stylePos[at.MESSAGE_WINDOW]=this._sheet.addRule(e,a),this._stylePos[at.SIDEBAR]=this._sheet.addRule(i,o)):(this._stylePos[at.MESSAGE_WINDOW]=this._sheet.insertRule("".concat(e," { ").concat(a," }"),0),this._stylePos[at.SIDEBAR]=this._sheet.insertRule("".concat(i," { ").concat(o," }"),1))},s.prototype.changeStyleRule=function(t,e,s,a){t===st.COLOR_FRAME?(this._wwaData.frameColorR=e,this._wwaData.frameColorG=s,this._wwaData.frameColorB=a):t===st.COLOR_FRAMEOUT?(this._wwaData.frameOutColorR=e,this._wwaData.frameOutColorG=s,this._wwaData.frameOutColorB=a):t===st.COLOR_STR?(this._wwaData.fontColorR=e,this._wwaData.fontColorG=s,this._wwaData.fontColorB=a):t===st.COLOR_STATUS_STR&&(this._wwaData.statusColorR=e,this._wwaData.statusColorG=s,this._wwaData.statusColorB=a),this.updateCSSRule()},s.prototype.showMonsterWindow=function(){this._monsterWindow.show()},s.prototype.isClassicMode=function(){return this._isClassicModeEnable},s.prototype.isConsoleOutputMode=function(){return this._useConsole},s.prototype.forcedJumpGate=function(t,e){this._player.jumpTo(new y(this,t,e,0,0))},s.prototype.setUserVar=function(t,e){if(this.isNotNumberTypeOrNaN(t)||!this.isValidUserVarIndex(t))throw new Error("代入先のユーザ変数の番号 が 0 以上 ".concat(Q.USER_VAR_NUM-1," 以下の数値になっていません!"));this._wwaData.userVar[t]=this.toAssignableValue(e),this._messageWindow.update()},s.prototype.toAssignableValue=function(t){var e=0|t,s=Math.max(Math.min(e,Q.USER_VAR_NUM_MAX_VALUE),Q.USET_VAR_NUM_MIN_VALUE);return this.isNotNumberTypeOrNaN(s)?0:s},s.prototype.isValidUserVarIndex=function(t){return"number"==typeof t&&t>=0&&t<Q.USER_VAR_NUM&&(0|t)===t},s.prototype.isNotNumberTypeOrNaN=function(t){return"number"!=typeof t||t!=t},s.prototype.getUserVar=function(t){return this._wwaData.userVar[t]},s.prototype.recUserPosition=function(t,e){var s=this._player.getPosition().getPartsCoord();this.setUserVar(t,s.x),this.setUserVar(e,s.y)},s.prototype.jumpRecUserPosition=function(t,e){this.forcedJumpGate(this._wwaData.userVar[t],this._wwaData.userVar[e])},s.prototype.outputUserVar=function(t){console.log("Var["+t+"] = "+this._wwaData.userVar[t])},s.prototype.setUserVarHP=function(t){this.setUserVar(t,this._player.getStatus().energy)},s.prototype.setUserVarHPMAX=function(t){this.setUserVar(t,this._player.getEnergyMax())},s.prototype.setUserVarAT=function(t,e){switch(e){case"bare":return void this.setUserVar(t,this._player.getStatusWithoutEquipments().strength);case"equipment":return void this.setUserVar(t,this._player.getStatusOfEquipments().strength);default:return void this.setUserVar(t,this._player.getStatus().strength)}},s.prototype.setUserVarDF=function(t,e){switch(e){case"bare":return void this.setUserVar(t,this._player.getStatusWithoutEquipments().defence);case"equipment":return void this.setUserVar(t,this._player.getStatusOfEquipments().defence);default:return void this.setUserVar(t,this._player.getStatus().defence)}},s.prototype.setUserVarMONEY=function(t){this.setUserVar(t,this._player.getStatus().gold)},s.prototype.toValidStatusValue=function(t){return this.isNotNumberTypeOrNaN(t)||t<0?0:0|t},s.prototype.setHPUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setEnergy(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.isDead()&&this.gameover(),this._player.updateStatusValueBox()},s.prototype.setHPMAXUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setEnergyMax(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},s.prototype.setATUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setStrength(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},s.prototype.setDFUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setDefence(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},s.prototype.setMONEYUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setGold(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},s.prototype.setUserVarStep=function(t){this.setUserVar(t,this._player.getMoveCount())},s.prototype.setUserVarVal=function(t,e){this.setUserVar(t,e)},s.prototype.setUserValOtherUserVal=function(t,e){this.setUserVar(t,this._wwaData.userVar[e])},s.prototype.setUserValAdd=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]+this._wwaData.userVar[e])},s.prototype.setUserValSub=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]-this._wwaData.userVar[e])},s.prototype.setUserValMul=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]*this._wwaData.userVar[e])},s.prototype.setUserValDiv=function(t,e){this.setUserVar(t,0===e?0:this._wwaData.userVar[t]/this._wwaData.userVar[e])},s.prototype.setUserValMod=function(t,e){this.setUserVar(t,0===e?0:this._wwaData.userVar[t]%this._wwaData.userVar[e])},s.prototype.setUserValRandNum=function(t,e,s){this.setUserVar(t,Math.floor(Math.random()*this.toAssignableValue(e))+s)},s.prototype._generateUserValString=function(t){var e=this;return t.map((function(t){var s=parseInt(t,10);return isNaN(s)?t.replace(/\\n/g,"\n"):function(){return e._wwaData.userVar[s]}}))},s.prototype.speedChangeJudge=function(t){this._wwaData.permitChangeGameSpeed=t},s.prototype.userVarUserIf=function(t,e){if(void 0===e[5])throw new Error("$if の引数不足 str="+e);var s=parseInt(e[0],10),a=parseInt(e[2],10);if(!this.isValidUserVarIndex(s)||!this.isValidUserVarIndex(a))throw new Error("判定対象のユーザ変数の添字が範囲外です!");var i=this._wwaData.userVar[s],o=e[1],r=this._wwaData.userVar[a],n=function(t){return parseInt(t,10)?I.MAP:I.OBJECT};if(this.compareUserVar(i,o,r)){var _=parseInt(e[3],10),h=e[4],c=e[5],u=n(e[6]);this.appearPartsEval(t,h,c,_,u)}else if(void 0!==e[9]){var l=parseInt(e[7],10),p=e[8],d=e[9],E=n(e[10]);this.appearPartsEval(t,p,d,l,E)}},s.prototype.compareUserVar=function(t,e,s){switch(e){case"==":return t===s;case"!=":return t!==s;case">=":return t>=s;case">":return t>s;case"<=":return t<=s;case"<":return t<s;default:throw new Error("未定義の演算子です: ".concat(e))}},s.prototype.setPlayerSpeedIndex=function(t){if(t<Q.MIN_SPEED_INDEX||Q.MAX_SPEED_INDEX<t)throw new Error("#set_speed の引数が異常です:"+t);this._wwaData.gameSpeedIndex=this._player.setSpeedIndex(t)},s.prototype.setUserVarPlayTime=function(t){this.setNowPlayTime(),this.setUserVar(t,this._wwaData.playTime)},s.prototype.setNowPlayTime=function(){var t=new Date;this._wwaData.playTime+=t.getTime()-this._startTime,this._startTime=t.getTime()},s.prototype.hideStatus=function(t,e){if(t<0||t>Z.length)throw new Error("隠すパラメータは0から3の間で指定してください。");this._changeStatusVisibility(Z[t],!e),this._player.updateStatusValueBox()},s.prototype.varMap=function(t,e,s,a,i){if(!this.isValidUserVarIndex(a))throw new Error("対象のユーザ変数の添字が範囲外です");var o=this._wwaData.userVar[a];if(o<0)throw new Error("負のパーツ番号は指定できません");if(i===I.OBJECT&&o>=this.getObjectPartsNum())throw new Error("物体パーツ番号の最大値を超えるパーツ番号が指定されました");if(i===I.MAP&&o>=this.getMapPartsNum())throw new Error("背景パーツ番号の最大値を超えるパーツ番号が指定されました");this.appearPartsEval(t,e,s,o,i)},s.prototype.setItemboxBackgroundPosition=function(t){this._wwaData.imgItemboxX=t.x,this._wwaData.imgItemboxY=t.y,Array.prototype.forEach.call(ut("div.item-cell"),(function(e){e.style.backgroundPosition="-".concat(t.x*Q.CHIP_SIZE,"px -").concat(t.y*Q.CHIP_SIZE,"px")}))},s.prototype._actionGamePadButtonItemMacro=function(){if(!this._wwaData.gamePadButtonItemTable)return!1;var t,e,s,a;for(t=this._wwaData.gamePadButtonItemTable.length,e=0;e<t;e++)if(s=this._wwaData.gamePadButtonItemTable[e]){switch(a=!1,e){case r.BUTTON_CROSS_KEY_LEFT:this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_LEFT)&&(a=!0);break;case r.BUTTON_CROSS_KEY_RIGHT:this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_RIGHT)&&(a=!0);break;case r.BUTTON_CROSS_KEY_UP:this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_UP)&&(a=!0);break;case r.BUTTON_CROSS_KEY_DOWN:this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_DOWN)&&(a=!0)}if(this._gamePadStore.buttonTrigger(e)&&(a=!0),a&&this.onselectitem(s))return!0}return!1},s.prototype.setGamePadButtonItemTable=function(t,e){var s,a;if(!this._wwaData.gamePadButtonItemTable)for(a in this._wwaData.gamePadButtonItemTable=[],r)s=a,this._wwaData.gamePadButtonItemTable[s]=0;this._wwaData.gamePadButtonItemTable.length>t&&(this._wwaData.gamePadButtonItemTable[t]=e)},s.prototype._checkSaveDataCompatibility=function(t,e,s){return void 0!==t&&t!==this._wwaData.worldName?Ee.UNMATCHED_WORLD_NAME:s&&s!==de(this._wwaData.worldName,this._wwaData.worldPassNumber)?Ee.UNMATCHED_WORLD_PASS_NUMBER:this._isDisallowLoadOldSave&&e!==this.checkOriginalMapString?Ee.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA:null},s.prototype.isVisibleStatus=function(t){switch(t){case"energy":return this._wwaData.isVisibleStatusEnergy;case"strength":return this._wwaData.isVisibleStatusStrength;case"defence":return this._wwaData.isVisibleStatusDefence;case"gold":return this._wwaData.isVisibleStatusGold;default:throw new Error("存在しないステータスが与えられました")}},s.prototype._changeStatusVisibility=function(t,e){switch(t){case"energy":return void(this._wwaData.isVisibleStatusEnergy=e);case"strength":return void(this._wwaData.isVisibleStatusStrength=e);case"defence":return void(this._wwaData.isVisibleStatusDefence=e);case"gold":return void(this._wwaData.isVisibleStatusGold=e);default:throw new Error("存在しないステータスが与えられました")}},s}(),Ke=!1;function Ve(){Array.prototype.forEach.call(ut("a.wwa-copyright"),(function(t){t.addEventListener("click",(function(){Ke=!0}))})),window.addEventListener("beforeunload",(function(t){var e="このページを離れますか?";if(Ke)return Ke=!1,t.returnValue=e,e}));var t=_t("wwa-wrapper").getAttribute("data-wwa-title-img");kt(_t("wwa-wrapper"),t);var e=_t("wwa-wrapper").getAttribute("data-wwa-mapdata"),s=_t("wwa-wrapper").getAttribute("data-wwa-audio-dir"),a=_t("wwa-wrapper").getAttribute("data-wwa-var-dump-elm"),i=null;_t("wwa-wrapper").hasAttribute("data-wwa-var-dump-elm")&&(i=function(t){var e=ht(t);if(!e)return null;e.classList.add("wwa-vardump-wrapper");var s=document.createElement("table"),a=document.createElement("tr"),i=document.createElement("th"),o=document.createElement("button");o.textContent="隠す",i.textContent="変数一覧",i.setAttribute("colspan","10"),i.classList.add("varlist-header"),i.appendChild(o),a.appendChild(i),s.appendChild(a);for(var r=null,n=null,_=0;_<Q.USER_VAR_NUM;_++){_%10==0&&(null!==r&&(s.appendChild(r),s.appendChild(n)),(r=document.createElement("tr")).classList.add("var-number"),(n=document.createElement("tr")).classList.add("var-val"));var h=document.createElement("th"),c=document.createElement("td");h.textContent=_+"",c.classList.add("var"+_),c.textContent="-",r.appendChild(h),n.appendChild(c)}Q.USER_VAR_NUM%10!=0&&(s.appendChild(r),s.appendChild(n)),e.appendChild(s);var u=!0;return o.addEventListener("click",(function(t){u?(this.textContent="表示",Array.prototype.forEach.call(s.querySelectorAll("tr.var-number"),(function(t){t.style.display="none"})),Array.prototype.forEach.call(s.querySelectorAll("tr.var-val"),(function(t){t.style.display="none"})),u=!1):(this.textContent="隠す",Array.prototype.forEach.call(s.querySelectorAll("tr.var-number"),(function(t){t.style.display="table-row"})),Array.prototype.forEach.call(s.querySelectorAll("tr.var-val"),(function(t){t.style.display="table-row"})),u=!0)})),e}(a));var o=!0;_t("wwa-wrapper").getAttribute("data-wwa-urlgate-enable").match(/^false$/i)&&(o=!1);var r=_t("wwa-wrapper").getAttribute("data-wwa-classic-mode-enable"),n=!1;null!==r&&r.match(/^true$/i)&&(n=!0);var _=!0,h=_t("wwa-wrapper").getAttribute("data-wwa-item-effect-enable");null!==h&&h.match(/^false$/i)&&(_=!1);var c=!1,u=_t("wwa-wrapper").getAttribute("data-wwa-use-go-to-wwa");null!==u&&u.match(/^true$/i)&&(c=!0);var l,p=!(null===(l=_t("wwa-wrapper").getAttribute("data-wwa-disallow-load-old-save"))||!l.match(/^true$/i));Me=new He(e,o,t,n,_,c,s,p,i)}"complete"===document.readyState?setTimeout(Ve):window.addEventListener("load",(function(){setTimeout(Ve)}))}()}();
21
+ function(t){var e=a,s=e.lib,i=s.WordArray,o=s.Hasher,r=e.algo,n=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),_=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),h=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),c=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),u=i.create([0,1518500249,1859775393,2400959708,2840853838]),l=i.create([1352829926,1548603684,1836072691,2053994217,0]),p=r.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var s=0;s<16;s++){var a=e+s,i=t[a];t[a]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,r,p,g,A,S,I,T,O,v,D,C=this._hash.words,P=u.words,M=l.words,N=n.words,R=_.words,L=h.words,b=c.words;for(S=o=C[0],I=r=C[1],T=p=C[2],O=g=C[3],v=A=C[4],s=0;s<80;s+=1)D=o+t[e+N[s]]|0,D+=s<16?d(r,p,g)+P[0]:s<32?E(r,p,g)+P[1]:s<48?w(r,p,g)+P[2]:s<64?y(r,p,g)+P[3]:m(r,p,g)+P[4],D=(D=f(D|=0,L[s]))+A|0,o=A,A=g,g=f(p,10),p=r,r=D,D=S+t[e+R[s]]|0,D+=s<16?m(I,T,O)+M[0]:s<32?y(I,T,O)+M[1]:s<48?w(I,T,O)+M[2]:s<64?E(I,T,O)+M[3]:d(I,T,O)+M[4],D=(D=f(D|=0,b[s]))+v|0,S=v,v=O,O=f(T,10),T=I,I=D;D=C[1]+p+O|0,C[1]=C[2]+g+v|0,C[2]=C[3]+A+S|0,C[3]=C[4]+o+I|0,C[4]=C[0]+r+T|0,C[0]=D},_doFinalize:function(){var t=this._data,e=t.words,s=8*this._nDataBytes,a=8*t.sigBytes;e[a>>>5]|=128<<24-a%32,e[14+(a+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),t.sigBytes=4*(e.length+1),this._process();for(var i=this._hash,o=i.words,r=0;r<5;r++){var n=o[r];o[r]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}return i},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function d(t,e,s){return t^e^s}function E(t,e,s){return t&e|~t&s}function w(t,e,s){return(t|~e)^s}function y(t,e,s){return t&s|e&~s}function m(t,e,s){return t^(e|~s)}function f(t,e){return t<<e|t>>>32-e}e.RIPEMD160=o._createHelper(p),e.HmacRIPEMD160=o._createHmacHelper(p)}(Math),a.RIPEMD160)},637:function(t,e,s){var a,i,o,r,n,_,h,c;t.exports=(c=s(359),i=(a=c).lib,o=i.WordArray,r=i.Hasher,n=a.algo,_=[],h=n.SHA1=r.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var s=this._hash.words,a=s[0],i=s[1],o=s[2],r=s[3],n=s[4],h=0;h<80;h++){if(h<16)_[h]=0|t[e+h];else{var c=_[h-3]^_[h-8]^_[h-14]^_[h-16];_[h]=c<<1|c>>>31}var u=(a<<5|a>>>27)+n+_[h];u+=h<20?1518500249+(i&o|~i&r):h<40?1859775393+(i^o^r):h<60?(i&o|i&r|o&r)-1894007588:(i^o^r)-899497514,n=r,r=o,o=i<<30|i>>>2,i=a,a=u}s[0]=s[0]+a|0,s[1]=s[1]+i|0,s[2]=s[2]+o|0,s[3]=s[3]+r|0,s[4]=s[4]+n|0},_doFinalize:function(){var t=this._data,e=t.words,s=8*this._nDataBytes,a=8*t.sigBytes;return e[a>>>5]|=128<<24-a%32,e[14+(a+64>>>9<<4)]=Math.floor(s/4294967296),e[15+(a+64>>>9<<4)]=s,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}}),a.SHA1=r._createHelper(h),a.HmacSHA1=r._createHmacHelper(h),c.SHA1)},640:function(t,e,s){var a,i,o,r,n,_;t.exports=(_=s(359),s(93),i=(a=_).lib.WordArray,o=a.algo,r=o.SHA256,n=o.SHA224=r.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=r._doFinalize.call(this);return t.sigBytes-=4,t}}),a.SHA224=r._createHelper(n),a.HmacSHA224=r._createHmacHelper(n),_.SHA224)},93:function(t,e,s){var a;t.exports=(a=s(359),function(t){var e=a,s=e.lib,i=s.WordArray,o=s.Hasher,r=e.algo,n=[],_=[];!function(){function e(e){for(var s=t.sqrt(e),a=2;a<=s;a++)if(!(e%a))return!1;return!0}function s(t){return 4294967296*(t-(0|t))|0}for(var a=2,i=0;i<64;)e(a)&&(i<8&&(n[i]=s(t.pow(a,.5))),_[i]=s(t.pow(a,1/3)),i++),a++}();var h=[],c=r.SHA256=o.extend({_doReset:function(){this._hash=new i.init(n.slice(0))},_doProcessBlock:function(t,e){for(var s=this._hash.words,a=s[0],i=s[1],o=s[2],r=s[3],n=s[4],c=s[5],u=s[6],l=s[7],p=0;p<64;p++){if(p<16)h[p]=0|t[e+p];else{var d=h[p-15],E=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,w=h[p-2],y=(w<<15|w>>>17)^(w<<13|w>>>19)^w>>>10;h[p]=E+h[p-7]+y+h[p-16]}var m=a&i^a&o^i&o,f=(a<<30|a>>>2)^(a<<19|a>>>13)^(a<<10|a>>>22),g=l+((n<<26|n>>>6)^(n<<21|n>>>11)^(n<<7|n>>>25))+(n&c^~n&u)+_[p]+h[p];l=u,u=c,c=n,n=r+g|0,r=o,o=i,i=a,a=g+(f+m)|0}s[0]=s[0]+a|0,s[1]=s[1]+i|0,s[2]=s[2]+o|0,s[3]=s[3]+r|0,s[4]=s[4]+n|0,s[5]=s[5]+c|0,s[6]=s[6]+u|0,s[7]=s[7]+l|0},_doFinalize:function(){var e=this._data,s=e.words,a=8*this._nDataBytes,i=8*e.sigBytes;return s[i>>>5]|=128<<24-i%32,s[14+(i+64>>>9<<4)]=t.floor(a/4294967296),s[15+(i+64>>>9<<4)]=a,e.sigBytes=4*s.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=o._createHelper(c),e.HmacSHA256=o._createHmacHelper(c)}(Math),a.SHA256)},140:function(t,e,s){var a;t.exports=(a=s(359),s(467),function(t){var e=a,s=e.lib,i=s.WordArray,o=s.Hasher,r=e.x64.Word,n=e.algo,_=[],h=[],c=[];!function(){for(var t=1,e=0,s=0;s<24;s++){_[t+5*e]=(s+1)*(s+2)/2%64;var a=(2*t+3*e)%5;t=e%5,e=a}for(t=0;t<5;t++)for(e=0;e<5;e++)h[t+5*e]=e+(2*t+3*e)%5*5;for(var i=1,o=0;o<24;o++){for(var n=0,u=0,l=0;l<7;l++){if(1&i){var p=(1<<l)-1;p<32?u^=1<<p:n^=1<<p-32}128&i?i=i<<1^113:i<<=1}c[o]=r.create(n,u)}}();var u=[];!function(){for(var t=0;t<25;t++)u[t]=r.create()}();var l=n.SHA3=o.extend({cfg:o.cfg.extend({outputLength:512}),_doReset:function(){for(var t=this._state=[],e=0;e<25;e++)t[e]=new r.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(t,e){for(var s=this._state,a=this.blockSize/2,i=0;i<a;i++){var o=t[e+2*i],r=t[e+2*i+1];o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),(C=s[i]).high^=r,C.low^=o}for(var n=0;n<24;n++){for(var l=0;l<5;l++){for(var p=0,d=0,E=0;E<5;E++)p^=(C=s[l+5*E]).high,d^=C.low;var w=u[l];w.high=p,w.low=d}for(l=0;l<5;l++){var y=u[(l+4)%5],m=u[(l+1)%5],f=m.high,g=m.low;for(p=y.high^(f<<1|g>>>31),d=y.low^(g<<1|f>>>31),E=0;E<5;E++)(C=s[l+5*E]).high^=p,C.low^=d}for(var A=1;A<25;A++){var S=(C=s[A]).high,I=C.low,T=_[A];T<32?(p=S<<T|I>>>32-T,d=I<<T|S>>>32-T):(p=I<<T-32|S>>>64-T,d=S<<T-32|I>>>64-T);var O=u[h[A]];O.high=p,O.low=d}var v=u[0],D=s[0];for(v.high=D.high,v.low=D.low,l=0;l<5;l++)for(E=0;E<5;E++){var C=s[A=l+5*E],P=u[A],M=u[(l+1)%5+5*E],N=u[(l+2)%5+5*E];C.high=P.high^~M.high&N.high,C.low=P.low^~M.low&N.low}C=s[0];var R=c[n];C.high^=R.high,C.low^=R.low}},_doFinalize:function(){var e=this._data,s=e.words,a=(this._nDataBytes,8*e.sigBytes),o=32*this.blockSize;s[a>>>5]|=1<<24-a%32,s[(t.ceil((a+1)/o)*o>>>5)-1]|=128,e.sigBytes=4*s.length,this._process();for(var r=this._state,n=this.cfg.outputLength/8,_=n/8,h=[],c=0;c<_;c++){var u=r[c],l=u.high,p=u.low;l=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),h.push(p),h.push(l)}return new i.init(h,n)},clone:function(){for(var t=o.clone.call(this),e=t._state=this._state.slice(0),s=0;s<25;s++)e[s]=e[s].clone();return t}});e.SHA3=o._createHelper(l),e.HmacSHA3=o._createHmacHelper(l)}(Math),a.SHA3)},716:function(t,e,s){var a,i,o,r,n,_,h,c;t.exports=(c=s(359),s(467),s(834),i=(a=c).x64,o=i.Word,r=i.WordArray,n=a.algo,_=n.SHA512,h=n.SHA384=_.extend({_doReset:function(){this._hash=new r.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var t=_._doFinalize.call(this);return t.sigBytes-=16,t}}),a.SHA384=_._createHelper(h),a.HmacSHA384=_._createHmacHelper(h),c.SHA384)},834:function(t,e,s){var a;t.exports=(a=s(359),s(467),function(){var t=a,e=t.lib.Hasher,s=t.x64,i=s.Word,o=s.WordArray,r=t.algo;function n(){return i.create.apply(i,arguments)}var _=[n(1116352408,3609767458),n(1899447441,602891725),n(3049323471,3964484399),n(3921009573,2173295548),n(961987163,4081628472),n(1508970993,3053834265),n(2453635748,2937671579),n(2870763221,3664609560),n(3624381080,2734883394),n(310598401,1164996542),n(607225278,1323610764),n(1426881987,3590304994),n(1925078388,4068182383),n(2162078206,991336113),n(2614888103,633803317),n(3248222580,3479774868),n(3835390401,2666613458),n(4022224774,944711139),n(264347078,2341262773),n(604807628,2007800933),n(770255983,1495990901),n(1249150122,1856431235),n(1555081692,3175218132),n(1996064986,2198950837),n(2554220882,3999719339),n(2821834349,766784016),n(2952996808,2566594879),n(3210313671,3203337956),n(3336571891,1034457026),n(3584528711,2466948901),n(113926993,3758326383),n(338241895,168717936),n(666307205,1188179964),n(773529912,1546045734),n(1294757372,1522805485),n(1396182291,2643833823),n(1695183700,2343527390),n(1986661051,1014477480),n(2177026350,1206759142),n(2456956037,344077627),n(2730485921,1290863460),n(2820302411,3158454273),n(3259730800,3505952657),n(3345764771,106217008),n(3516065817,3606008344),n(3600352804,1432725776),n(4094571909,1467031594),n(275423344,851169720),n(430227734,3100823752),n(506948616,1363258195),n(659060556,3750685593),n(883997877,3785050280),n(958139571,3318307427),n(1322822218,3812723403),n(1537002063,2003034995),n(1747873779,3602036899),n(1955562222,1575990012),n(2024104815,1125592928),n(2227730452,2716904306),n(2361852424,442776044),n(2428436474,593698344),n(2756734187,3733110249),n(3204031479,2999351573),n(3329325298,3815920427),n(3391569614,3928383900),n(3515267271,566280711),n(3940187606,3454069534),n(4118630271,4000239992),n(116418474,1914138554),n(174292421,2731055270),n(289380356,3203993006),n(460393269,320620315),n(685471733,587496836),n(852142971,1086792851),n(1017036298,365543100),n(1126000580,2618297676),n(1288033470,3409855158),n(1501505948,4234509866),n(1607167915,987167468),n(1816402316,1246189591)],h=[];!function(){for(var t=0;t<80;t++)h[t]=n()}();var c=r.SHA512=e.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var s=this._hash.words,a=s[0],i=s[1],o=s[2],r=s[3],n=s[4],c=s[5],u=s[6],l=s[7],p=a.high,d=a.low,E=i.high,w=i.low,y=o.high,m=o.low,f=r.high,g=r.low,A=n.high,S=n.low,I=c.high,T=c.low,O=u.high,v=u.low,D=l.high,C=l.low,P=p,M=d,N=E,R=w,L=y,b=m,B=f,x=g,U=A,W=S,Y=I,k=T,F=O,G=v,H=D,K=C,V=0;V<80;V++){var j,X,J=h[V];if(V<16)X=J.high=0|t[e+2*V],j=J.low=0|t[e+2*V+1];else{var Z=h[V-15],Q=Z.high,q=Z.low,z=(Q>>>1|q<<31)^(Q>>>8|q<<24)^Q>>>7,$=(q>>>1|Q<<31)^(q>>>8|Q<<24)^(q>>>7|Q<<25),tt=h[V-2],et=tt.high,st=tt.low,at=(et>>>19|st<<13)^(et<<3|st>>>29)^et>>>6,it=(st>>>19|et<<13)^(st<<3|et>>>29)^(st>>>6|et<<26),ot=h[V-7],rt=ot.high,nt=ot.low,_t=h[V-16],ht=_t.high,ct=_t.low;X=(X=(X=z+rt+((j=$+nt)>>>0<$>>>0?1:0))+at+((j+=it)>>>0<it>>>0?1:0))+ht+((j+=ct)>>>0<ct>>>0?1:0),J.high=X,J.low=j}var ut,lt=U&Y^~U&F,pt=W&k^~W&G,dt=P&N^P&L^N&L,Et=M&R^M&b^R&b,wt=(P>>>28|M<<4)^(P<<30|M>>>2)^(P<<25|M>>>7),yt=(M>>>28|P<<4)^(M<<30|P>>>2)^(M<<25|P>>>7),mt=(U>>>14|W<<18)^(U>>>18|W<<14)^(U<<23|W>>>9),ft=(W>>>14|U<<18)^(W>>>18|U<<14)^(W<<23|U>>>9),gt=_[V],At=gt.high,St=gt.low,It=H+mt+((ut=K+ft)>>>0<K>>>0?1:0),Tt=yt+Et;H=F,K=G,F=Y,G=k,Y=U,k=W,U=B+(It=(It=(It=It+lt+((ut+=pt)>>>0<pt>>>0?1:0))+At+((ut+=St)>>>0<St>>>0?1:0))+X+((ut+=j)>>>0<j>>>0?1:0))+((W=x+ut|0)>>>0<x>>>0?1:0)|0,B=L,x=b,L=N,b=R,N=P,R=M,P=It+(wt+dt+(Tt>>>0<yt>>>0?1:0))+((M=ut+Tt|0)>>>0<ut>>>0?1:0)|0}d=a.low=d+M,a.high=p+P+(d>>>0<M>>>0?1:0),w=i.low=w+R,i.high=E+N+(w>>>0<R>>>0?1:0),m=o.low=m+b,o.high=y+L+(m>>>0<b>>>0?1:0),g=r.low=g+x,r.high=f+B+(g>>>0<x>>>0?1:0),S=n.low=S+W,n.high=A+U+(S>>>0<W>>>0?1:0),T=c.low=T+k,c.high=I+Y+(T>>>0<k>>>0?1:0),v=u.low=v+G,u.high=O+F+(v>>>0<G>>>0?1:0),C=l.low=C+K,l.high=D+H+(C>>>0<K>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,s=8*this._nDataBytes,a=8*t.sigBytes;return e[a>>>5]|=128<<24-a%32,e[30+(a+128>>>10<<5)]=Math.floor(s/4294967296),e[31+(a+128>>>10<<5)]=s,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=e.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});t.SHA512=e._createHelper(c),t.HmacSHA512=e._createHmacHelper(c)}(),a.SHA512)},567:function(t,e,s){var a;t.exports=(a=s(359),s(139),s(174),s(844),s(951),function(){var t=a,e=t.lib,s=e.WordArray,i=e.BlockCipher,o=t.algo,r=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],n=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],_=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],h=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],c=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],u=o.DES=i.extend({_doReset:function(){for(var t=this._key.words,e=[],s=0;s<56;s++){var a=r[s]-1;e[s]=t[a>>>5]>>>31-a%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var h=i[o]=[],c=_[o];for(s=0;s<24;s++)h[s/6|0]|=e[(n[s]-1+c)%28]<<31-s%6,h[4+(s/6|0)]|=e[28+(n[s+24]-1+c)%28]<<31-s%6;for(h[0]=h[0]<<1|h[0]>>>31,s=1;s<7;s++)h[s]=h[s]>>>4*(s-1)+3;h[7]=h[7]<<5|h[7]>>>27}var u=this._invSubKeys=[];for(s=0;s<16;s++)u[s]=i[15-s]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,s){this._lBlock=t[e],this._rBlock=t[e+1],l.call(this,4,252645135),l.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),l.call(this,1,1431655765);for(var a=0;a<16;a++){for(var i=s[a],o=this._lBlock,r=this._rBlock,n=0,_=0;_<8;_++)n|=h[_][((r^i[_])&c[_])>>>0];this._lBlock=r,this._rBlock=o^n}var u=this._lBlock;this._lBlock=this._rBlock,this._rBlock=u,l.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),l.call(this,16,65535),l.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function l(t,e){var s=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=s,this._lBlock^=s<<t}function p(t,e){var s=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=s,this._rBlock^=s<<t}t.DES=i._createHelper(u);var d=o.TripleDES=i.extend({_doReset:function(){var t=this._key.words;if(2!==t.length&&4!==t.length&&t.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var e=t.slice(0,2),a=t.length<4?t.slice(0,2):t.slice(2,4),i=t.length<6?t.slice(0,2):t.slice(4,6);this._des1=u.createEncryptor(s.create(e)),this._des2=u.createEncryptor(s.create(a)),this._des3=u.createEncryptor(s.create(i))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});t.TripleDES=i._createHelper(d)}(),a.TripleDES)},467:function(t,e,s){var a;t.exports=(a=s(359),function(t){var e=a,s=e.lib,i=s.Base,o=s.WordArray,r=e.x64={};r.Word=i.extend({init:function(t,e){this.high=t,this.low=e}}),r.WordArray=i.extend({init:function(e,s){e=this.words=e||[],this.sigBytes=s!=t?s:8*e.length},toX32:function(){for(var t=this.words,e=t.length,s=[],a=0;a<e;a++){var i=t[a];s.push(i.high),s.push(i.low)}return o.create(s,this.sigBytes)},clone:function(){for(var t=i.clone.call(this),e=t.words=this.words.slice(0),s=e.length,a=0;a<s;a++)e[a]=e[a].clone();return t}})}(),a)},633:function(){},106:function(){}},e={};function s(a){var i=e[a];if(void 0!==i)return i.exports;var o=e[a]={exports:{}};return t[a].call(o.exports,o,o.exports,s),o.exports}s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,{a:e}),e},s.d=function(t,e){for(var a in e)s.o(e,a)&&!s.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:e[a]})},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";var t,e;!function(t){t[t.NONE=0]="NONE",t[t.KEYDOWN=1]="KEYDOWN",t[t.KEYPRESS=2]="KEYPRESS",t[t.KEYUP=3]="KEYUP",t[t.KEYPRESS_MESSAGECHANGE=4]="KEYPRESS_MESSAGECHANGE"}(t||(t={})),function(t){t[t.KEY_ENTER=13]="KEY_ENTER",t[t.KEY_SHIFT=16]="KEY_SHIFT",t[t.KEY_ESC=27]="KEY_ESC",t[t.KEY_SPACE=32]="KEY_SPACE",t[t.KEY_LEFT=37]="KEY_LEFT",t[t.KEY_UP=38]="KEY_UP",t[t.KEY_RIGHT=39]="KEY_RIGHT",t[t.KEY_DOWN=40]="KEY_DOWN",t[t.KEY_1=49]="KEY_1",t[t.KEY_2=50]="KEY_2",t[t.KEY_3=51]="KEY_3",t[t.KEY_A=65]="KEY_A",t[t.KEY_C=67]="KEY_C",t[t.KEY_D=68]="KEY_D",t[t.KEY_E=69]="KEY_E",t[t.KEY_I=73]="KEY_I",t[t.KEY_M=77]="KEY_M",t[t.KEY_N=78]="KEY_N",t[t.KEY_P=80]="KEY_P",t[t.KEY_Q=81]="KEY_Q",t[t.KEY_S=83]="KEY_S",t[t.KEY_W=87]="KEY_W",t[t.KEY_X=88]="KEY_X",t[t.KEY_Y=89]="KEY_Y",t[t.KEY_Z=90]="KEY_Z",t[t.KEY_F1=112]="KEY_F1",t[t.KEY_F2=113]="KEY_F2",t[t.KEY_F3=114]="KEY_F3",t[t.KEY_F4=115]="KEY_F4",t[t.KEY_F5=116]="KEY_F5",t[t.KEY_F6=117]="KEY_F6",t[t.KEY_F7=118]="KEY_F7",t[t.KEY_F8=119]="KEY_F8",t[t.KEY_F9=120]="KEY_F9",t[t.KEY_F12=123]="KEY_F12"}(e||(e={}));var a,i,o=function(){function e(){var t;for(this._nextKeyState=new Array(e.KEY_BUFFER_MAX),this._keyState=new Array(e.KEY_BUFFER_MAX),this._prevKeyState=new Array(e.KEY_BUFFER_MAX),this._prevKeyStateOnControllable=new Array(e.KEY_BUFFER_MAX),this._keyInputContinueFrameNum=new Array(e.KEY_BUFFER_MAX),t=0;t<e.KEY_BUFFER_MAX;t++)this._nextKeyState[t]=!1,this._keyState[t]=!1,this._prevKeyState[t]=!1,this._prevKeyStateOnControllable[t]=!1,this._keyInputContinueFrameNum[t]=0}return e.prototype.checkHitKey=function(e){var s=this.getKeyState(e);return s===t.KEYDOWN||s===t.KEYPRESS},e.prototype.getKeyState=function(e){return this._prevKeyState[e]?this._keyState[e]?t.KEYPRESS:t.KEYUP:this._keyState[e]?t.KEYDOWN:t.NONE},e.prototype.getKeyStateForControllPlayer=function(e){return this._prevKeyStateOnControllable[e]?this._keyState[e]?t.KEYPRESS:t.KEYUP:this._keyState[e]?t.KEYDOWN:t.NONE},e.prototype.getKeyStateForMessageCheck=function(e){return this._prevKeyState[e]?this._keyState[e]?this._keyInputContinueFrameNum[e]>=Q.KEYPRESS_MESSAGE_CHANGE_FRAME_NUM?t.KEYPRESS_MESSAGECHANGE:t.KEYPRESS:t.KEYUP:this._keyState[e]?t.KEYDOWN:t.NONE},e.prototype.setPressInfo=function(t){this._nextKeyState[t]=!0,this._keyInputContinueFrameNum[t]=-1},e.prototype.setReleaseInfo=function(t){this._nextKeyState[t]=!1,this._keyInputContinueFrameNum[t]=-1},e.prototype.update=function(){var t;for(this._prevKeyState=this._keyState.slice(),this._keyState=this._nextKeyState.slice(),t=0;t<e.KEY_BUFFER_MAX;t++)this._keyState[t]&&this._keyInputContinueFrameNum[t]++},e.prototype.memorizeKeyStateOnControllableFrame=function(){this._prevKeyStateOnControllable=this._keyState.slice()},e.prototype.allClear=function(){var t;for(this._nextKeyState=new Array(e.KEY_BUFFER_MAX),t=0;t<e.KEY_BUFFER_MAX;t++)this._nextKeyState[t]=!1},e.KEY_BUFFER_MAX=256,e}();!function(t){t[t.NONE=0]="NONE",t[t.MOUSEDOWN=1]="MOUSEDOWN",t[t.MOUSEPRESS=2]="MOUSEPRESS",t[t.MOUSEUP=3]="MOUSEUP"}(a||(a={})),function(t){t[t.DIR_KEY=1]="DIR_KEY"}(i||(i={}));var r,n,_=function(){function t(){this._prevMouseState=!1,this._mouseState=!1,this._nextMouseState=!1}return t.prototype.checkClickMouse=function(t){var e;return(e=void 0!==t?this.getMouseState(t):this.getMouseState())===a.MOUSEDOWN||e===a.MOUSEPRESS},t.prototype.getMouseState=function(t){return void 0!==t&&this._inputDir!==t?a.NONE:this._prevMouseState?this._mouseState?a.MOUSEPRESS:a.MOUSEUP:this._mouseState?a.MOUSEDOWN:a.NONE},t.prototype.getMouseStateForControllPlayer=function(t){return void 0!==t&&this._inputDir!==t?a.NONE:this._prevMouseStateOnControllable?this._mouseState?a.MOUSEPRESS:a.MOUSEUP:this._mouseState?a.MOUSEDOWN:a.NONE},t.prototype.setPressInfo=function(t,e){this._nextMouseState=!0,this._inputDir=t,this._touchID=e},t.prototype.setReleaseInfo=function(){this._touchID=0,this._nextMouseState=!1},t.prototype.touchIDIsSetDir=function(){return this._touchID===i.DIR_KEY},t.prototype.memorizeMouseStateOnControllableFrame=function(){this._prevMouseStateOnControllable=this._mouseState},t.prototype.update=function(){this._prevMouseState=this._mouseState,this._mouseState=this._nextMouseState},t.prototype.clear=function(){this._nextMouseState=!1},t.prototype.getTouchID=function(){return this._touchID},t}();!function(t){t[t.BUTTON_INDEX_B=0]="BUTTON_INDEX_B",t[t.BUTTON_INDEX_A=1]="BUTTON_INDEX_A",t[t.BUTTON_INDEX_Y=2]="BUTTON_INDEX_Y",t[t.BUTTON_INDEX_X=3]="BUTTON_INDEX_X",t[t.BUTTON_INDEX_L=4]="BUTTON_INDEX_L",t[t.BUTTON_INDEX_R=5]="BUTTON_INDEX_R",t[t.BUTTON_INDEX_ZL=6]="BUTTON_INDEX_ZL",t[t.BUTTON_INDEX_ZR=7]="BUTTON_INDEX_ZR",t[t.BUTTON_INDEX_MINUS=8]="BUTTON_INDEX_MINUS",t[t.BUTTON_INDEX_PLUS=9]="BUTTON_INDEX_PLUS",t[t.BUTTON_INDEX_LEFT_STICK=10]="BUTTON_INDEX_LEFT_STICK",t[t.BUTTON_INDEX_RIGHT_STICK=11]="BUTTON_INDEX_RIGHT_STICK",t[t.BUTTON_CROSS_KEY_UP=12]="BUTTON_CROSS_KEY_UP",t[t.BUTTON_CROSS_KEY_DOWN=13]="BUTTON_CROSS_KEY_DOWN",t[t.BUTTON_CROSS_KEY_LEFT=14]="BUTTON_CROSS_KEY_LEFT",t[t.BUTTON_CROSS_KEY_RIGHT=15]="BUTTON_CROSS_KEY_RIGHT"}(r||(r={})),function(t){t[t.AXES_L_HORIZONTAL_INDEX=0]="AXES_L_HORIZONTAL_INDEX",t[t.AXES_L_VERTICAL_INDEX=1]="AXES_L_VERTICAL_INDEX",t[t.AXES_R_HORIZONTAL_INDEX=2]="AXES_R_HORIZONTAL_INDEX",t[t.AXES_R_VERTICAL_INDEX=3]="AXES_R_VERTICAL_INDEX",t[t.AXES_CROSS_KEY=9]="AXES_CROSS_KEY"}(n||(n={}));var h,c,u,l=function(){function t(){var t;for(this.gamepad=null,this.triggers=[],t=0;t<16;t++)this.triggers[t]=!1}return t.prototype.update=function(){this.gamepad=null;var t=navigator.getGamepads?navigator.getGamepads():navigator.webkitGetGamepads?navigator.webkitGetGamepads:[];if(t&&t.length>0&&t[0]){var e=t[0];this.gamepad=e}},t.prototype.buttonTrigger=function(){for(var t,e,s,a,i,o=[],r=0;r<arguments.length;r++)o[r]=arguments[r];if(!this.gamepad)return!1;for(e=o.length,t=0;t<e;t++){s=o[t];var n=this.gamepad.buttons[s];if(!n)return!1;if(a="object"==typeof n?!0===n.pressed:1===n,i=this.triggers[s],this.triggers[s]=a,a&&!i)return!0}return!1},t.prototype.buttonPressed=function(){for(var t,e,s,a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];if(!this.gamepad)return!1;for(e=a.length,t=0;t<e;t++){s=a[t];var o=this.gamepad.buttons[s];if(!o)return!1;if("object"==typeof o?!0===o.pressed:1===o)return!0}return!1},t.prototype.crossPressed=function(){for(var t,e,s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];if(!this.gamepad)return!1;for(e=s.length,t=0;t<e;t++)switch(s[t]){case r.BUTTON_CROSS_KEY_UP:if(this.gamepad.axes[n.AXES_L_VERTICAL_INDEX]<=-.6||this.gamepad.axes[n.AXES_R_VERTICAL_INDEX]<=-.6||-1===this.stickFloor(n.AXES_CROSS_KEY)||this.buttonPressed(r.BUTTON_CROSS_KEY_UP))return!0;break;case r.BUTTON_CROSS_KEY_DOWN:if(this.gamepad.axes[n.AXES_L_VERTICAL_INDEX]>=.7||this.gamepad.axes[n.AXES_R_VERTICAL_INDEX]>=.7||.1===this.stickFloor(n.AXES_CROSS_KEY)||this.buttonPressed(r.BUTTON_CROSS_KEY_DOWN))return!0;break;case r.BUTTON_CROSS_KEY_LEFT:if(this.gamepad.axes[n.AXES_L_HORIZONTAL_INDEX]<=-.7||this.gamepad.axes[n.AXES_R_HORIZONTAL_INDEX]<=-.7||.7===this.stickFloor(n.AXES_CROSS_KEY)||this.buttonPressed(r.BUTTON_CROSS_KEY_LEFT))return!0;break;case r.BUTTON_CROSS_KEY_RIGHT:if(this.gamepad.axes[n.AXES_L_HORIZONTAL_INDEX]>.6||this.gamepad.axes[n.AXES_R_HORIZONTAL_INDEX]>.6||-.5===this.stickFloor(n.AXES_CROSS_KEY)||this.buttonPressed(r.BUTTON_CROSS_KEY_RIGHT))return!0}return!1},t.prototype.vibration=function(t){return!!this.gamepad&&(!!this.gamepad.vibrationActuator&&void(t?this.gamepad.vibrationActuator.playEffect("dual-rumble",{startDelay:0,duration:100,weakMagnitude:1,strongMagnitude:.5}):this.gamepad.vibrationActuator.playEffect("dual-rumble",{startDelay:0,duration:100,weakMagnitude:.5,strongMagnitude:1})))},t.prototype.stickFloor=function(){for(var t,e,s,a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];if(!this.gamepad)return 0;for(e=a.length,t=0;t<e;t++){s=a[t];var o=this.gamepad.axes[s];return"number"!=typeof o?0:Math.floor(10*o)/10}return 0},t}(),p=(h=function(t,e){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},h(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function s(){this.constructor=t}h(t,e),t.prototype=null===e?Object.create(e):(s.prototype=e.prototype,new s)}),d=function(){function t(t,e){this.strength=t,this.defence=e}return t.prototype.add=function(t){return this.strength+=t.strength,this.defence+=t.defence,this},t.prototype.plus=function(e){return new t(this.strength+e.strength,this.defence+e.defence)},t.prototype.minus=function(e){return new t(this.strength-e.strength,this.defence-e.defence)},t.prototype.equals=function(t){return this.strength===t.strength&&this.defence===t.defence},t}(),E=function(t){function e(e,s,a,i){var o=t.call(this,s,a)||this;return o.energy=e,o.gold=i,o}return p(e,t),e.prototype.add=function(t){return t instanceof e&&(this.energy+=t.energy,this.gold+=t.gold),this.strength+=t.strength,this.defence+=t.defence,this},e.prototype.plus=function(t){return t instanceof e?new e(this.energy+t.energy,this.strength+t.strength,this.defence+t.defence,this.gold+t.gold):new e(this.energy,this.strength+t.strength,this.defence+t.defence,this.gold)},e.prototype.minus=function(t){return t instanceof e?new e(this.energy-t.energy,this.strength-t.strength,this.defence-t.defence,this.gold-t.gold):new e(this.energy,this.strength-t.strength,this.defence-t.defence,this.gold)},e.prototype.equals=function(t){return this.energy===t.energy&&this.strength===t.strength&&this.defence===t.defence&&this.gold===t.gold},e.prototype.calculateScore=function(t){var e=this;return Object.keys(t).reduce((function(s,a){return s+t[a]*e[a]}),0)},e}(d),w=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}return t.prototype.equals=function(t){return this.x===t.x&&this.y===t.y},t.prototype.substract=function(e){return new t(this.x-e.x,this.y-e.y)},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.convertIntoPosition=function(t){return new y(t,this.x,this.y,0,0)},t.prototype.getDirectionTo=function(t){return this.x<t.x?this.y>t.y?u.RIGHT_UP:this.y===t.y?u.RIGHT:u.RIGHT_DOWN:this.x===t.x?this.y>t.y?u.UP:this.y===t.y?u.NO_DIRECTION:u.DOWN:this.y>t.y?u.LEFT_UP:this.y===t.y?u.LEFT:u.LEFT_DOWN},t.prototype.toString=function(){return"("+this.x+", "+this.y+")"},t}(),y=function(){function t(t,e,s,a,i){if(void 0===a&&(a=0),void 0===i&&(i=0),this._wwa=t,void 0===this._wwa)throw new Error("WWAのインスタンスが存在しません. ");var o=this._wwa.getMapWidth();if(e<0||e>=o||e>=o-1&&a>0||s<0||s>=o||s>=o-1&&i>0)throw new Error("範囲外の座標です!! parts:("+e+", "+s+"), offset:("+a+", "+i+"), mapWidth = "+o);this._partsCoord=new w(e,s),this._offsetCoord=new w(a,i)}return t.prototype.getPartsCoord=function(){return this._partsCoord},t.prototype.getOffsetCoord=function(){return this._offsetCoord},t.prototype.getScreenTopPosition=function(){var e=Math.floor(this._partsCoord.x/(Q.H_PARTS_NUM_IN_WINDOW-1))*(Q.H_PARTS_NUM_IN_WINDOW-1),s=Math.floor(this._partsCoord.y/(Q.V_PARTS_NUM_IN_WINDOW-1))*(Q.V_PARTS_NUM_IN_WINDOW-1);return new t(this._wwa,e,s,0,0)},t.prototype.getDefaultCameraPosition=function(){var t=this.getScreenTopPosition(),e=t.getPartsCoord(),s=this._wwa.getMapWidth(),a=t.getPartsCoord().clone();return e.x===s-1&&a.x--,e.y===s-1&&a.y--,a.convertIntoPosition(this._wwa).getScreenTopPosition()},t.prototype.getNextJustPosition=function(e){if(void 0!==e){var s=this._partsCoord;return new t(this._wwa,s.x+T[e],s.y+O[e],0,0)}var a=this._partsCoord.x,i=this._partsCoord.y;return this._offsetCoord.x<0?a--:this._offsetCoord.x>0&&a++,this._offsetCoord.y<0?i--:this._offsetCoord.y>0&&i++,new t(this._wwa,a,i,0,0)},t.prototype.getNextFramePosition=function(e,s,a){var i=this._partsCoord.x,o=this._partsCoord.y,r=this._offsetCoord.x+T[e]*s,n=this._offsetCoord.y+O[e]*a;if(r<0){var _=Math.floor(Math.abs(r)/Q.CHIP_SIZE);i-=_,r=(r+_*Q.CHIP_SIZE)%Q.CHIP_SIZE}if(n<0){var h=Math.floor(Math.abs(n)/Q.CHIP_SIZE);o-=h,n=(n+h*Q.CHIP_SIZE)%Q.CHIP_SIZE}return r>=Q.CHIP_SIZE&&(i+=Math.floor(r/Q.CHIP_SIZE),r=(r+Q.CHIP_SIZE)%Q.CHIP_SIZE),n>=Q.CHIP_SIZE&&(o+=Math.floor(n/Q.CHIP_SIZE),n=(n+Q.CHIP_SIZE)%Q.CHIP_SIZE),new t(this._wwa,i,o,r,n)},t.prototype.isJustPosition=function(){return 0==this._offsetCoord.x&&0==this._offsetCoord.y},t.prototype.isScreenTopPosition=function(){var t=this.getScreenTopPosition();return this.equals(t)},t.prototype.equals=function(t){return this._partsCoord.equals(t.getPartsCoord())&&this._offsetCoord.equals(t.getOffsetCoord())},t.prototype.isInCameraRange=function(t,e){void 0===e&&(e=!1);var s=t.getPosition()._partsCoord,a=this._partsCoord.x,i=this._partsCoord.y,o=e?1:0;return s.x<=a&&a<s.x+Q.H_PARTS_NUM_IN_WINDOW-o&&s.y<=i&&i<s.y+Q.V_PARTS_NUM_IN_WINDOW-o},t.prototype.hasLocalGate=function(){return this._wwa.getMapTypeByPosition(this)===Q.MAP_LOCALGATE||this._wwa.getObjectTypeByPosition(this)===Q.OBJECT_LOCALGATE},t.prototype.clone=function(){return new t(this._wwa,this._partsCoord.x,this._partsCoord.y,this._offsetCoord.x,this._offsetCoord.y)},t}(),m=function(t,e,s){this.destPos=t.clone(),this.srcPos=e.clone(),this.srcSize=s.clone()},f=function(t,e,s,a,i){this.partsIDObj=t,this.x=e,this.y=s,this.isStatic=a,this.isFighting=i};!function(t){t[t.GOTO_WWA=0]="GOTO_WWA",t[t.BATTLE_REPORT=1]="BATTLE_REPORT",t[t.GAME_END=2]="GAME_END"}(c||(c={})),function(t){t[t.LEFT=0]="LEFT",t[t.RIGHT=1]="RIGHT",t[t.DOWN=2]="DOWN",t[t.UP=3]="UP",t[t.LEFT_DOWN=4]="LEFT_DOWN",t[t.LEFT_UP=5]="LEFT_UP",t[t.RIGHT_DOWN=6]="RIGHT_DOWN",t[t.RIGHT_UP=7]="RIGHT_UP",t[t.NO_DIRECTION=8]="NO_DIRECTION"}(u||(u={}));var g,A,S,I,T=[-1,1,0,0,-1,-1,1,1,0],O=[0,0,1,-1,1,-1,1,-1,0],v=[4,6,2,0],D=[e.KEY_LEFT,e.KEY_RIGHT,e.KEY_DOWN,e.KEY_UP];!function(t){t[t.YES=0]="YES",t[t.NO=1]="NO",t[t.UNSELECTED=2]="UNSELECTED"}(g||(g={})),function(t){t[t.MAP=0]="MAP",t[t.OBJECT=1]="OBJECT",t[t.CHOICE_YES=2]="CHOICE_YES",t[t.CHOICE_NO=3]="CHOICE_NO"}(A||(A={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.CAN_USE=1]="CAN_USE",t[t.NOT_DISAPPEAR=2]="NOT_DISAPPEAR"}(S||(S={})),function(t){t[t.MAP=1]="MAP",t[t.OBJECT=0]="OBJECT"}(I||(I={}));var C,P,M,N,R,L,b,B,x,U=function(){function t(){var t=window.navigator.userAgent;this.os=this._getOS(t),this.browser=this.getBrowser(t),this.device=this.getDevice()}return t.prototype._getOS=function(t){return t.match(/xbox/i)?C.XBOX:t.match(/windows/i)?C.WINDOWS:t.match(/macintosh/i)?"ontouchstart"in document?C.IOS:C.MACINTOSH:t.match(/iphone|ipad|ipod/i)?C.IOS:t.match(/oculus/i)?C.OCULUS:t.match(/android/i)?C.ANDROID:t.match(/nintendo/i)?C.NINTENDO:t.match(/playstation/i)?C.PLAY_STATION:t.match(/linux/i)?C.LINUX:C.OTHERS},t.prototype.getBrowser=function(t){return t.match(/(?:msie|trident)/i)?M.INTERNET_EXPLORER:t.match(/edge/i)?M.EDGE:t.match(/chrome/i)?M.CHROME:t.match(/firefox/i)?M.FIREFOX:t.match(/safari/i)?M.SAFARI:M.OTHERS},t.prototype.getDevice=function(){switch(this.os){case C.WINDOWS:case C.MACINTOSH:case C.LINUX:return P.PC;case C.IOS:case C.ANDROID:return P.SP;case C.OCULUS:return P.VR;case C.NINTENDO:case C.PLAY_STATION:case C.XBOX:return P.GAME}return P.OTHERS},t}();!function(t){t[t.WINDOWS=1]="WINDOWS",t[t.MACINTOSH=2]="MACINTOSH",t[t.LINUX=3]="LINUX",t[t.ANDROID=4]="ANDROID",t[t.IOS=5]="IOS",t[t.NINTENDO=6]="NINTENDO",t[t.PLAY_STATION=7]="PLAY_STATION",t[t.OCULUS=8]="OCULUS",t[t.XBOX=9]="XBOX",t[t.OTHERS=9999]="OTHERS"}(C||(C={})),function(t){t[t.PC=1]="PC",t[t.SP=2]="SP",t[t.VR=3]="VR",t[t.GAME=4]="GAME",t[t.OTHERS=9999]="OTHERS"}(P||(P={})),function(t){t[t.CHROME=1]="CHROME",t[t.FIREFOX=2]="FIREFOX",t[t.SAFARI=3]="SAFARI",t[t.EDGE=4]="EDGE",t[t.INTERNET_EXPLORER=5]="INTERNET_EXPLORER",t[t.OTHERS=9999]="OTHERS"}(M||(M={})),function(t){t[t.NONE=0]="NONE",t[t.CALL_BY_MAP_PARTS=1]="CALL_BY_MAP_PARTS",t[t.CALL_BY_OBJECT_PARTS=2]="CALL_BY_OBJECT_PARTS",t[t.CALL_BY_ITEM_USE=3]="CALL_BY_ITEM_USE",t[t.CALL_BY_QUICK_SAVE=4]="CALL_BY_QUICK_SAVE",t[t.CALL_BY_QUICK_LOAD=5]="CALL_BY_QUICK_LOAD",t[t.CALL_BY_RESTART_GAME=6]="CALL_BY_RESTART_GAME",t[t.CALL_BY_GOTO_WWA=7]="CALL_BY_GOTO_WWA",t[t.CALL_BY_PASSWORD_SAVE=8]="CALL_BY_PASSWORD_SAVE",t[t.CALL_BY_PASSWORD_LOAD=9]="CALL_BY_PASSWORD_LOAD",t[t.CALL_BY_END_GAME=10]="CALL_BY_END_GAME",t[t.CALL_BY_SUSPEND=11]="CALL_BY_SUSPEND",t[t.CALL_BY_LOG_QUICK_SAVE=12]="CALL_BY_LOG_QUICK_SAVE",t[t.CALL_BY_LOG_QUICK_LOAD=13]="CALL_BY_LOG_QUICK_LOAD"}(N||(N={})),function(t){t[t.QUICK_LOAD=0]="QUICK_LOAD",t[t.QUICK_SAVE=1]="QUICK_SAVE",t[t.RESTART_GAME=2]="RESTART_GAME",t[t.GOTO_WWA=3]="GOTO_WWA"}(R||(R={})),function(t){t[t.UP=0]="UP",t[t.DOWN=1]="DOWN"}(L||(L={})),function(t){t[t.QUICK_LOAD=0]="QUICK_LOAD",t[t.RESTART_GAME=1]="RESTART_GAME",t[t.PASSWORD=2]="PASSWORD"}(b||(b={})),function(t){t[t.STATIC=0]="STATIC",t[t.CHASE_PLAYER=1]="CHASE_PLAYER",t[t.RUN_OUT=2]="RUN_OUT",t[t.HANG_AROUND=3]="HANG_AROUND"}(B||(B={})),function(t){t[t.MODE_X=0]="MODE_X",t[t.MODE_Y=1]="MODE_Y",t[t.UNDECIDED=2]="UNDECIDED"}(x||(x={}));var W,Y,k,F=["cell-load","cell-save","cell-restart","cell-gotowwa"];!function(t){t[t.ASK_LINK=5]="ASK_LINK",t[t.NO_MONEY=6]="NO_MONEY",t[t.NO_ITEM=7]="NO_ITEM",t[t.USE_ITEM=8]="USE_ITEM"}(W||(W={})),function(t){t[t.CLICKABLE_ITEM=0]="CLICKABLE_ITEM",t[t.FULL_ITEM=1]="FULL_ITEM",t[t.LOAD_SE=2]="LOAD_SE"}(Y||(Y={})),function(t){t[t.UNDEFINED=0]="UNDEFINED",t[t.IMGPLAYER=1]="IMGPLAYER",t[t.IMGYESNO=2]="IMGYESNO",t[t.HPMAX=3]="HPMAX",t[t.SAVE=4]="SAVE",t[t.ITEM=5]="ITEM",t[t.DEFAULT=6]="DEFAULT",t[t.OLDMAP=7]="OLDMAP",t[t.PARTS=8]="PARTS",t[t.MOVE=9]="MOVE",t[t.MAP=10]="MAP",t[t.DIRMAP=11]="DIRMAP",t[t.IMGFRAME=12]="IMGFRAME",t[t.IMGBOM=13]="IMGBOM",t[t.DELPLAYER=14]="DELPLAYER",t[t.FACE=15]="FACE",t[t.EFFECT=16]="EFFECT",t[t.GAMEOVER=17]="GAMEOVER",t[t.IMGCLICK=18]="IMGCLICK",t[t.STATUS=19]="STATUS",t[t.EFFITEM=20]="EFFITEM",t[t.COLOR=21]="COLOR",t[t.WAIT=22]="WAIT",t[t.SOUND=23]="SOUND",t[t.JUMPGATE=24]="JUMPGATE",t[t.RECPOSITION=25]="RECPOSITION",t[t.JUMPRECPOSITION=26]="JUMPRECPOSITION",t[t.CONSOLE_LOG=27]="CONSOLE_LOG",t[t.COPY_HP_TO=28]="COPY_HP_TO",t[t.SET_HP=29]="SET_HP",t[t.COPY_HPMAX_TO=30]="COPY_HPMAX_TO",t[t.SET_HPMAX=31]="SET_HPMAX",t[t.COPY_AT_TO=32]="COPY_AT_TO",t[t.SET_AT=33]="SET_AT",t[t.COPY_DF_TO=34]="COPY_DF_TO",t[t.SET_DF=35]="SET_DF",t[t.COPY_MONEY_TO=36]="COPY_MONEY_TO",t[t.SET_MOENEY=37]="SET_MOENEY",t[t.COPY_STEP_COUNT_TO=38]="COPY_STEP_COUNT_TO",t[t.VAR_SET_VAL=39]="VAR_SET_VAL",t[t.VAR_SET=40]="VAR_SET",t[t.VAR_ADD=41]="VAR_ADD",t[t.VAR_SUB=42]="VAR_SUB",t[t.VAR_MUL=43]="VAR_MUL",t[t.VAR_DIV=44]="VAR_DIV",t[t.VAR_SET_RAND=45]="VAR_SET_RAND",t[t.SHOW_STR=46]="SHOW_STR",t[t.GAME_SPEED=47]="GAME_SPEED",t[t.IF=50]="IF",t[t.SET_SPEED=51]="SET_SPEED",t[t.COPY_TIME_TO=52]="COPY_TIME_TO",t[t.HIDE_STATUS=53]="HIDE_STATUS",t[t.VAR_MAP=54]="VAR_MAP",t[t.VAR_MOD=55]="VAR_MOD",t[t.GAMEPAD_BUTTON=100]="GAMEPAD_BUTTON",t[t.OLDMOVE=101]="OLDMOVE"}(k||(k={}));var G,H,K,V={"":0,$imgplayer:1,$imgyesno:2,$hpmax:3,$save:4,$item:5,$default:6,$oldmap:7,$parts:8,$move:9,$map:10,$dirmap:11,$imgframe:12,$imgbom:13,$delplayer:14,$face:15,$effect:16,$gameover:17,$imgclick:18,$status:19,$effitem:20,$color:21,$wait:22,$sound:23,$jumpgate:24,$rec_pos:25,$jump_rec_pos:26,$console_log:27,$copy_hp_to:28,$set_hp:29,$copy_hpmax_to:30,$set_hpmax:31,$copy_at_to:32,$set_at:33,$copy_df_to:34,$set_df:35,$copy_money_to:36,$set_money:37,$copy_step_count_to:38,$var_set_val:39,$var_set:40,$var_add:41,$var_sub:42,$var_mul:43,$var_div:44,$var_set_rand:45,$show_str:46,$game_speed:47,$if:50,$set_speed:51,$copy_time_to:52,$hide_status:53,$var_map:54,$var_mod:55,$gamepad_button:100,$oldmove:101};!function(t){t[t.ENERGY=0]="ENERGY",t[t.STRENGTH=1]="STRENGTH",t[t.DEFENCE=2]="DEFENCE",t[t.GOLD=3]="GOLD",t[t.MOVES=4]="MOVES"}(G||(G={})),function(t){t[t.ENERGY=0]="ENERGY",t[t.STRENGTH=1]="STRENGTH",t[t.DEFENCE=2]="DEFENCE",t[t.GOLD=3]="GOLD",t[t.WIDE_CELL_ROW=4]="WIDE_CELL_ROW",t[t.ITEM_BG=5]="ITEM_BG",t[t.MAIN_FRAME=6]="MAIN_FRAME"}(H||(H={})),function(t){t[t.DECISION=1]="DECISION",t[t.ATTACK=3]="ATTACK",t[t.BGM_LB=70]="BGM_LB",t[t.NO_SOUND=99]="NO_SOUND"}(K||(K={}));var j,X=[1,2,5,8,10,20],J=["超低速","低速","準低速","中速","高速","超高速"],Z=["energy","strength","defence","gold"],Q=function(){function t(){}return t.WWA_HOME="http://wwajp.com",t.ITEMBOX_SIZE=12,t.MAP_ATR_MAX=60,t.OBJ_ATR_MAX=60,t.OLD_MAP_ATR_MAX=40,t.OLD_OBJ_ATR_MAX=40,t.ATR_TYPE=3,t.ATR_MODE=4,t.ATR_STRING=5,t.ATR_X=6,t.ATR_Y=7,t.ATR_X2=8,t.ATR_Y2=9,t.ATR_ENERGY=10,t.ATR_STRENGTH=11,t.ATR_DEFENCE=12,t.ATR_GOLD=13,t.ATR_ITEM=14,t.ATR_NUMBER=15,t.ATR_JUMP_X=16,t.ATR_MOVE=16,t.ATR_JUMP_Y=17,t.ATR_SOUND=19,t.ATR_APPERANCE_BASE=20,t.REL_ATR_APPERANCE_ID=0,t.REL_ATR_APPERANCE_X=1,t.REL_ATR_APPERANCE_Y=2,t.REL_ATR_APPERANCE_TYPE=3,t.REL_ATR_APPERANCE_UNIT_LENGTH=4,t.ATR_RANDOM_BASE=10,t.RANDOM_ATR_NUM=10,t.RANDOM_ITERATION_MAX=10,t.MAP_STREET=0,t.MAP_WALL=1,t.MAP_LOCALGATE=2,t.MAP_URLGATE=4,t.OBJECT_NORMAL=0,t.OBJECT_MESSAGE=1,t.OBJECT_URLGATE=2,t.OBJECT_STATUS=3,t.OBJECT_ITEM=4,t.OBJECT_DOOR=5,t.OBJECT_MONSTER=6,t.OBJECT_SCORE=11,t.OBJECT_SELL=14,t.OBJECT_BUY=15,t.OBJECT_RANDOM=16,t.OBJECT_SELECT=17,t.OBJECT_LOCALGATE=18,t.SYSTEM_MESSAGE_NUM=20,t.IMGPOS_DEFAULT_YESNO_X=3,t.IMGPOS_DEFAULT_YESNO_Y=1,t.IMGRELPOS_YESNO_YES_X=0,t.IMGRELPOS_YESNO_NO_X=1,t.IMGRELPOS_YESNO_YESP_X=2,t.IMGRELPOS_YESNO_NOP_X=3,t.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_X=0,t.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_Y=0,t.IMGPOS_DEFAULT_FRAME_X=0,t.IMGPOS_DEFAULT_FRAME_Y=1,t.IMGPOS_DEFAULT_BATTLE_EFFECT_X=3,t.IMGPOS_DEFAULT_BATTLE_EFFECT_Y=3,t.DEFAULT_DISABLE_SAVE=!1,t.DEFAULT_OLDMAP=!1,t.DEFAULT_OBJECT_NO_COLLAPSE=!1,t.SPLASH_SCREEN_DISP_MILLS=100,t.DEFAULT_FRAME_INTERVAL=20,t.GAMEOVER_FRAME_INTERVAL=50,t.YESNO_PRESS_DISP_FRAME_NUM=20,t.WAIT_TIME_FRAME_NUM=6,t.CHIP_SIZE=40,t.MAP_WINDOW_WIDTH=440,t.MAP_WINDOW_HEIGHT=440,t.H_PARTS_NUM_IN_WINDOW=t.MAP_WINDOW_WIDTH/t.CHIP_SIZE,t.V_PARTS_NUM_IN_WINDOW=t.MAP_WINDOW_HEIGHT/t.CHIP_SIZE,t.MIN_SPEED_INDEX=0,t.MAX_SPEED_INDEX=X.length-1,t.QUICK_BATTLE_SPEED_INDECIES=[X.length-2,X.length-1],t.ANIMATION_REP_HALF_FRAME=22,t.PLAYER_LOOKING_AROUND_START_FRAME=4*t.ANIMATION_REP_HALF_FRAME,t.RELATIVE_COORD_BIAS=1e4,t.RELATIVE_COORD_LOWER=t.RELATIVE_COORD_BIAS-1e3,t.PLAYER_COORD=t.RELATIVE_COORD_BIAS-1e3,t.LOCALGATE_PLAYER_WAIT_FRAME=5,t.STATUS_CHANGED_EFFECT_FRAME_NUM=20,t.PASSABLE_OBJECT=1,t.APPERANCE_PARTS_MIN_INDEX=0,t.APPERANCE_PARTS_MAX_INDEX=9,t.APPERANCE_PARTS_MIN_INDEX_NO=5,t.APPERANCE_PARTS_MAX_INDEX_YES=4,t.FADEOUT_SPEED=8,t.STATUS_MINUS_BORDER=3e4,t.ITEMBOX_IS_FULL=-1,t.BATTLE_INTERVAL_FRAME_NUM=10,t.BATTLE_SPEED_CHANGE_TURN_NUM=40,t.RANDOM_MOVE_ITERATION_NUM=50,t.RANDOM_MOVE_ITERATION_NUM_BEFORE_V31=8,t.BATTLE_ESTIMATE_MONSTER_TYPE_MAX=8,t.SOUND_MAX=100,t.ITEM_BORDER_IMG_DATA_URL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAArklEQVRYR+2Y0QqAIAxFt///aENJHwxxuJUSxzeh3S7HXaNpEkly4FIRzba0GEyHeVTN7jqDWvb7V4Y1NLibZIY0NbiL5G3MZLCe / 1fn3XJgJYjB7mgg6O1VCEKwXo79JeklY62nB62kRs9BEIKkeNIDhISQEBJC4k0BBCF4D7D4cV9shf99ixdB + MrM0y3fa3zV05D45GOqhwPMGPkYlccIOEY2VKUN0UNVXxC7ADj7mDi9aFZZAAAAAElFTkSuQmCC",t.LOAD_STAGE_MAX_EXCEPT_AUDIO=7,t.WWA_STYLE_TAG_ID="wwa-additional-style",t.DEFAULT_FRAME_COLOR_R=255,t.DEFAULT_FRAME_COLOR_G=255,t.DEFAULT_FRAME_COLOR_B=255,t.DEFAULT_FRAMEOUT_COLOR_R=96,t.DEFAULT_FRAMEOUT_COLOR_G=96,t.DEFAULT_FRAMEOUT_COLOR_B=96,t.DEFAULT_STRBACK_COLOR_R=0,t.DEFAULT_STRBACK_COLOR_G=0,t.DEFAULT_STRBACK_COLOR_B=0,t.DEFAULT_STATUS_COLOR_R=0,t.DEFAULT_STATUS_COLOR_G=0,t.DEFAULT_STATUS_COLOR_B=0,t.KEYPRESS_MESSAGE_CHANGE_FRAME_NUM=20,t.WWAP_SERVER_OLD="http://wwawing.com/wwap",t.WWAP_SERVER="https://wwaphoenix.github.io",t.WWAP_SERVER_AUDIO_DIR="audio",t.WWAP_SERVER_TITLE_IMG="cover_p.gif",t.WWAP_SERVER_LOADER_NO_WORKER="wwaload.noworker.js",t.SCREEN_WIDTH=560,t.SCREEN_HEIGHT=440,t.LOADING_FONT="Times New Roman",t.MSG_STR_WIDTH=16,t.ITEM_EFFECT_SPEED_PIXEL_PER_FRAME=20,t.ITEMBOX_TOP_Y=140,t.USER_VAR_NUM=256,t.USER_VAR_NUM_MAX_VALUE=9007199254740991,t.USET_VAR_NUM_MIN_VALUE=-9007199254740991,t.CONTROLL_WAIT_FRAME=6,t}(),q=function(){function t(){}return t.QUICK_SAVE_MAX=4,t.QUICK_SAVE_THUMNAIL_WIDTH=99,t.QUICK_SAVE_THUMNAIL_HEIGHT=99,t.SAVE_INTERVAL_MOVE=200,t.INDEXEDDB_DB_NAME="WWA_WING_DB",t.INDEXEDDB_TABLE_NAME="SAVE_TABLE",t.DATE_LAST_SAVE_TEXT_COLOR="rgba(255,255,0,1)",t}(),z=function(){function t(){}return t.EMPTY_LOAD="",t.EMPTY_SAVE="",t.PASSWORD="Password",t.QUICK_SAVE="Quick Save",t.QUICK_LOAD="Quick Load",t.BATTLE_REPORT="Battle Report",t.GAME_END="Game End",t.GOTO_WWA="Goto WWA",t.RESTART_GAME="Restart Game",t}(),$=function(){};!function(t){t[t.INIT=0]="INIT",t[t.MAP_LOAD=1]="MAP_LOAD",t[t.OBJ_LOAD=2]="OBJ_LOAD",t[t.MAP_ATTR=3]="MAP_ATTR",t[t.OBJ_ATTR=4]="OBJ_ATTR",t[t.RAND_PARTS=5]="RAND_PARTS",t[t.MESSAGE=6]="MESSAGE",t[t.GAME_INIT=7]="GAME_INIT",t[t.AUDIO=8]="AUDIO",t[t.FINISH=9]="FINISH"}(j||(j={}));var tt,et,st,at,it,ot=["ロードの準備をしています。","背景パーツを読み込んでいます。","物体パーツを読み込んでます。","背景パーツの属性を読み込んでます。","物体パーツの属性を読み込んでます。","ランダムパーツを置換しています。","メッセージを読み込んでます。","Welcome to WWA Wing!"],rt=["Welcome to WWA Wing!","Now Map Data Loading .....","Now CG Data Loading .....","Now Making chara CG ....."];!function(t){t[t.LINE=30]="LINE",t[t.TITLE_X=100]="TITLE_X",t[t.TITLE_Y=70]="TITLE_Y",t[t.LOADING_X=50]="LOADING_X",t[t.LOADING_Y=140]="LOADING_Y",t[t.ERROR_X=10]="ERROR_X",t[t.ERROR_Y=180]="ERROR_Y",t[t.FOOTER_X=160]="FOOTER_X",t[t.FOOTER_Y=360]="FOOTER_Y",t[t.WORLD_Y=330]="WORLD_Y",t[t.COPYRIGHT_Y=390]="COPYRIGHT_Y"}(tt||(tt={})),function(t){t[t.TITLE=32]="TITLE",t[t.LOADING=22]="LOADING",t[t.FOOTER=18]="FOOTER",t[t.ERRROR=16]="ERRROR"}(et||(et={})),function(t){t[t.COLOR_FRAME=0]="COLOR_FRAME",t[t.COLOR_FRAMEOUT=1]="COLOR_FRAMEOUT",t[t.COLOR_STR=2]="COLOR_STR",t[t.COLOR_STATUS_STR=4]="COLOR_STATUS_STR"}(st||(st={})),function(t){t[t.MESSAGE_WINDOW=0]="MESSAGE_WINDOW",t[t.SIDEBAR=1]="SIDEBAR"}(at||(at={})),function(t){t[t.BITSHIFT=16]="BITSHIFT",t[t.BITMASK=65535]="BITMASK"}(it||(it={}));var nt,_t=function(t){return document.getElementById(t)},ht=function(t){return document.querySelector(t)},ct=function(t){return document.querySelector(t)},ut=function(t){return document.querySelectorAll(t)},lt=function(t,e){var s,a,i=window.pageXOffset||document.body.scrollLeft||document.documentElement.scrollLeft,o=window.pageYOffset||document.body.scrollTop||document.documentElement.scrollTop;return s=t-_t("wwa-wrapper").offsetLeft+i,a=e-_t("wwa-wrapper").offsetTop+o,new w(s,a)},pt=function(t){return t.match(/^https?:\/\//)||t.match(/^\.\.\//)?t:location.href="./"+t},dt=function(t){var e="";if(t instanceof Array){for(var s=0;s<t.length;s++)e+=dt(t[s])+"/";return e}return t+""},Et=function(){function t(t,e,s){this.cvs=document.createElement("canvas"),this.cvs.width=t,this.cvs.height=e,this.ctx=this.cvs.getContext("2d",{alpha:s}),this._isTransparent=s}return t.prototype.drawCanvas=function(t,e,s,a,i){this.ctx.drawImage(t,Q.CHIP_SIZE*e,Q.CHIP_SIZE*s,Q.CHIP_SIZE,Q.CHIP_SIZE,a,i,Q.CHIP_SIZE,Q.CHIP_SIZE)},t.prototype.clear=function(){this.clearRect(0,0,this.cvs.width,this.cvs.height)},t.prototype.clearRectWithLowerYLimit=function(t){this.clearRect(0,0,this.cvs.width,t)},t.prototype.clearRect=function(t,e,s,a){this._isTransparent?this.ctx.clearRect(t,e,s,a):(this.ctx.fillStyle="#9E9E9E",this.ctx.fillRect(t,e,s,a))},t}(),wt=function(){function t(t,e,s,a){var i;for(this._isLoaded=!1,this.mapCache=void 0,this.mapObjectCache=void 0,this.mapCacheYLimit=0,this._frameCanvas=new Et(Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW,!0),this._backCanvas=new Et(Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW,!1),this._objectCanvases=[],this._effectCanvases=[],i=0;i<2;i++)this._objectCanvases[i]=new Et(Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW,!0);this._ctx=t,this._fileName=e,this._loadCompleteCallBack=a,this._load(),this._frameCoord=s.clone(),this.cpPartsLog=new w(0,0)}return t.prototype._load=function(){var t=this;this._frameCoord,this._isLoaded||(this.mapCache=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],this.mapObjectCache=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],this._image=new Image,this._image.addEventListener("load",(function(){t.createFrame(),t._loadCompleteCallBack()})),this._image.addEventListener("error",(function(){throw new Error("Image Load Failed!!\nfile name:"+t._fileName)})),this._image.src=this._fileName,this._isLoaded=!0)},t.prototype.createFrame=function(){this._frameCanvas.clear(),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y,0,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y,Q.MAP_WINDOW_WIDTH-Q.CHIP_SIZE,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y+2,0,Q.MAP_WINDOW_HEIGHT-Q.CHIP_SIZE),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y+2,Q.MAP_WINDOW_WIDTH-Q.CHIP_SIZE,Q.MAP_WINDOW_HEIGHT-Q.CHIP_SIZE);for(var t=1;t<Q.H_PARTS_NUM_IN_WINDOW-1;t++)this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+1,this._frameCoord.y,Q.CHIP_SIZE*t,0),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+1,this._frameCoord.y+2,Q.CHIP_SIZE*t,Q.MAP_WINDOW_HEIGHT-Q.CHIP_SIZE);for(t=1;t<Q.V_PARTS_NUM_IN_WINDOW-1;t++)this._frameCanvas.drawCanvas(this._image,this._frameCoord.x,this._frameCoord.y+1,0,Q.CHIP_SIZE*t),this._frameCanvas.drawCanvas(this._image,this._frameCoord.x+2,this._frameCoord.y+1,Q.MAP_WINDOW_WIDTH-Q.CHIP_SIZE,Q.CHIP_SIZE*t)},t.prototype.updateEffects=function(t){var e;if(t){var s,a=t.length;for(e=0;e<a;e++){var i=t[e];(s=this._effectCanvases[e])?s.clear():s=this._effectCanvases[e]=new Et(Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW,!0);for(var o=0;o<Q.V_PARTS_NUM_IN_WINDOW;o++)for(var r=0;r<Q.H_PARTS_NUM_IN_WINDOW;r++)s.drawCanvas(this._image,i.x,i.y,r*Q.CHIP_SIZE,o*Q.CHIP_SIZE)}}},t.prototype.drawFrame=function(){this._ctx.drawImage(this._frameCanvas.cvs,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE),this._ctx.drawImage(this._frameCanvas.cvs,0,Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-1),Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE,0,Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-1),Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE),this._ctx.drawImage(this._frameCanvas.cvs,0,Q.CHIP_SIZE,Q.CHIP_SIZE,Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-2),0,Q.CHIP_SIZE,Q.CHIP_SIZE,Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-2)),this._ctx.drawImage(this._frameCanvas.cvs,Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-1),Q.CHIP_SIZE,Q.CHIP_SIZE,Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-2),Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-1),Q.CHIP_SIZE,Q.CHIP_SIZE,Q.CHIP_SIZE*(Q.H_PARTS_NUM_IN_WINDOW-2))},t.prototype.drawEffect=function(t){var e=this._effectCanvases[t];e&&this._ctx.drawImage(e.cvs,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW)},t.prototype.drawCanvas=function(t,e,s,a){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._image,Q.CHIP_SIZE*t,Q.CHIP_SIZE*e,Q.CHIP_SIZE,Q.CHIP_SIZE,s,a,Q.CHIP_SIZE,Q.CHIP_SIZE)},t.prototype.drawCanvasWithSize=function(t,e,s,a,i,o){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._image,Q.CHIP_SIZE*t,Q.CHIP_SIZE*e,Q.CHIP_SIZE*s,Q.CHIP_SIZE*a,i,o,Q.CHIP_SIZE*s,Q.CHIP_SIZE*a)},t.prototype.drawCanvasWithUpperYLimit=function(t,e,s,a,i){if(!this._isLoaded)throw new Error("No image was loaded.");var o=Math.max(0,a+Q.CHIP_SIZE-i);o>=Q.CHIP_SIZE||this._ctx.drawImage(this._image,Q.CHIP_SIZE*t,Q.CHIP_SIZE*e,Q.CHIP_SIZE,Q.CHIP_SIZE-o,s,a,Q.CHIP_SIZE,Q.CHIP_SIZE)},t.prototype.copyCanvas=function(t,e){var s=this;return function(a,i,o,r,n){if(!s._isLoaded)throw new Error("No image was loaded.");var _=Math.max(0,e(r,n));_>=Q.CHIP_SIZE||t.ctx.drawImage(s._image,Q.CHIP_SIZE*a,Q.CHIP_SIZE*i+_,Q.CHIP_SIZE,Q.CHIP_SIZE-_,o,r+_,Q.CHIP_SIZE,Q.CHIP_SIZE)}},t.prototype.copyBackCanvasWithUpperYLimit=function(t,e,s,a,i){this.copyCanvas(this._backCanvas,(function(t,e){return t+Q.CHIP_SIZE-e}))(t,e,s,a,i)},t.prototype.copyBackCanvasWithLowerYLimit=function(t,e,s,a,i){this.copyCanvas(this._backCanvas,(function(t,e){return e-t}))(t,e,s,a,i)},t.prototype.copyObjectCanvasWithUpperYLimit=function(t,e,s,a,i,o){this.copyCanvas(this._objectCanvases[t],(function(t,e){return t+Q.CHIP_SIZE-e}))(e,s,a,i,o)},t.prototype.copyObjectCanvasWithLowerYLimit=function(t,e,s,a,i,o){this.copyCanvas(this._objectCanvases[t],(function(t,e){return e-t}))(e,s,a,i,o)},t.prototype.drawBackCanvas=function(){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._backCanvas.cvs,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW)},t.prototype.drawObjectCanvas=function(t){if(!this._isLoaded)throw new Error("No image was loaded.");this._ctx.drawImage(this._objectCanvases[t].cvs,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW,0,0,Q.CHIP_SIZE*Q.V_PARTS_NUM_IN_WINDOW,Q.CHIP_SIZE*Q.H_PARTS_NUM_IN_WINDOW)},t.prototype.clearBackCanvas=function(){this._backCanvas.clear()},t.prototype.clearBackCanvasWithLowerYLimit=function(t){this._backCanvas.clearRectWithLowerYLimit(t)},t.prototype.clearObjectCanvases=function(){var t;for(t=0;t<2;t++)this._objectCanvases[t].clear()},t.prototype.clearObjectCanvasesWithLowerYLimit=function(t){var e;for(e=0;e<2;e++)this._objectCanvases[e].clearRectWithLowerYLimit(t)},t.prototype.drawCanvasWithLowerYLimit=function(t,e,s,a,i){if(!this._isLoaded)throw new Error("No image was loaded.");var o=Math.max(0,i-a);o>=Q.CHIP_SIZE||this._ctx.drawImage(this._image,Q.CHIP_SIZE*t,Q.CHIP_SIZE*e+o,Q.CHIP_SIZE,Q.CHIP_SIZE-o,s,a+o,Q.CHIP_SIZE,Q.CHIP_SIZE)},t.prototype.clearCanvas=function(t,e,s,a){this._ctx.clearRect(t,e,s,a)},t.prototype.drawBase=function(t,e,s,a){this._ctx.fillStyle="#9E9E9E",this._ctx.fillRect(t,e,s,a)},t.prototype.setFrameImage=function(t){this._frameCoord=t,this.createFrame()},t}(),yt=function(){function t(t){this._position=null,this.reset(t)}return t.prototype.setPlayer=function(t){this._player=t},t.prototype.isResetting=function(){return this._isResetting},t.prototype.getPosition=function(){return this._position},t.prototype.getPreviousPosition=function(){return this._positionPrev},t.prototype.resetPreviousPosition=function(){this._positionPrev=null},t.prototype.move=function(t){var e=X[this._player.getSpeedIndex()];this._position=this._position.getNextFramePosition(t,e*(Q.H_PARTS_NUM_IN_WINDOW-1),e*(Q.V_PARTS_NUM_IN_WINDOW-1))},t.prototype.getTransitionStepNum=function(){return this._transitionStep},t.prototype.advanceTransitionStepNum=function(){return++this._transitionStep,this._transitionStep===Q.V_PARTS_NUM_IN_WINDOW&&(this._isResetting=!1,this._transitionStep=0),this._transitionStep},t.prototype.isFinalStep=function(){if(!1===this._isResetting)throw new Error("リセット中ではありません。");return this._transitionStep===Q.V_PARTS_NUM_IN_WINDOW-1},t.prototype.reset=function(t){this._positionPrev=this._position,this._position=t.getDefaultCameraPosition(),this._transitionStep=0,this._isResetting=!0},t}(),mt=function(){var t=function(e,s){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},t(e,s)};return function(e,s){if("function"!=typeof s&&null!==s)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function a(){this.constructor=e}t(e,s),e.prototype=null===s?Object.create(s):(a.prototype=s.prototype,new a)}}(),ft=function(){function t(t){this._position=t}return t.prototype.getPosition=function(){return this._position},t}(),gt=function(t){function e(e){return t.call(this,e)||this}return mt(e,t),e}(ft);!function(t){function e(e){return t.call(this,e)||this}mt(e,t)}(ft);!function(t){t[t.CONTROLLABLE=0]="CONTROLLABLE",t[t.MOVING=1]="MOVING",t[t.CAMERA_MOVING=2]="CAMERA_MOVING",t[t.MESSAGE_WAITING=3]="MESSAGE_WAITING",t[t.LOCALGATE_JUMPED=4]="LOCALGATE_JUMPED",t[t.BATTLE=5]="BATTLE",t[t.ESTIMATE_WINDOW_WAITING=6]="ESTIMATE_WINDOW_WAITING",t[t.PASSWORD_WINDOW_WAITING=7]="PASSWORD_WINDOW_WAITING",t[t.LOCALGATE_JUMPED_WITH_MESSAGE=8]="LOCALGATE_JUMPED_WITH_MESSAGE"}(nt||(nt={}));var At=function(t){function e(e,s,a,i,o,r,n){var _=t.call(this,s)||this;_.itemTransitioningClassName="item-transitioning",_.overwittenItemClassName="item-overwritten",_.overwittenItemSelector=".".concat(_.overwittenItemClassName),_.itemEffectStartTimers=new Array(Q.ITEMBOX_SIZE),_._status=i,_._equipStatus=new d(0,0),_._itemBox=new Array(Q.ITEMBOX_SIZE),_._itemBoxElement=new Array(Q.ITEMBOX_SIZE),_._itemUsingEvent=new Array(Q.ITEMBOX_SIZE);for(var h=0;h<_._itemBox.length;h++)_._itemBox[h]=0,_._itemBoxElement[h]=ct("#item"+h+">.item-disp");return _.updateItemBox(),_._energyMax=o,_._dir=u.DOWN,_._isMovingImage=!1,_._wwa=e,_._state=nt.CONTROLLABLE,_._camera=a,_._isPartsEventExecuted=!1,_._energyValueElement=ct("#disp-energy>.status-value-box"),_._strengthValueElement=ct("#disp-strength>.status-value-box"),_._defenceValueElement=ct("#disp-defence>.status-value-box"),_._goldValueElement=ct("#disp-gold>.status-value-box"),_._isReadyToUseItem=!1,_._isClickableItemGot=!1,_._moves=r,_._frameCount=0,_._moveMacroWaitingRemainMoves=0,_._moveObjectAutoExecTimer=0,_.updateStatusValueBox(),_._partsAppeared=!1,_._afterMoveMacroFlag=!1,_._isPreparedForLookingAround=!0,_._lookingAroundTimer=Q.PLAYER_LOOKING_AROUND_START_FRAME,_._speedIndex=n,_._messageDelayFrameCount=0,_}return mt(e,t),e.prototype.move=function(){if(this.isControllable())this.controll(this._dir);else if(this._state===nt.CAMERA_MOVING){try{this._camera.move(this._dir)}catch(t){}this._isOnCameraStopPosition()&&(this._state=nt.CONTROLLABLE)}else if(this._state===nt.MOVING){try{var t=this._position.getNextFramePosition(this._dir,X[this._speedIndex],X[this._speedIndex])}catch(t){}t.isJustPosition()&&(this._state=nt.CONTROLLABLE,this.toggleMovingImage(),this._moves++,this._isPartsEventExecuted=!1,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0),this._position=t}},e.prototype.controll=function(t){var e,s;if(this.isControllable()){this._isPreparedForLookingAround=!1,this._dir=t;try{e=this._position.getNextFramePosition(this._dir,X[this._speedIndex],X[this._speedIndex]),s=this._position.getNextJustPosition(t)}catch(t){return}if(this._isOnCameraMovingPosition()){if(0!==this._wwa.getMapIdByPosition(s)||this._wwa.isOldMap()||this._wwa.debug)try{this._camera.move(this._dir),this._state=nt.CAMERA_MOVING}catch(t){this._state=nt.CONTROLLABLE}return}if(!this.canMoveTo(s))return this._wwa.getMapTypeByPosition(s)===Q.MAP_WALL&&this._wwa.checkMap(s.getPartsCoord()),void this._wwa.checkObject(s.getPartsCoord());this._position=e,this._state=nt.MOVING,this._wwa.getMapAttributeByPosition(this._position.getNextJustPosition(t),Q.ATR_TYPE)!==Q.MAP_LOCALGATE&&this._wwa.moveObjects(!0)}},e.prototype.setDir=function(t){this._isPreparedForLookingAround=!1,this._dir=t},e.prototype.canMoveTo=function(t){if(null===t)return!1;if(this._wwa.debug)return!0;this._wwa.getMapWidth(),t.getPartsCoord(),t.getOffsetCoord();return!(0===this._wwa.getMapIdByPosition(t)&&!this._wwa.isOldMap())&&(this._wwa.getMapTypeByPosition(t)!==Q.MAP_WALL&&(0===this._wwa.getObjectIdByPosition(t)||(this._wwa.getObjectTypeByPosition(t)===Q.OBJECT_NORMAL&&this._wwa.getObjectAttributeByPosition(t,Q.ATR_MODE)===Q.PASSABLE_OBJECT||this._wwa.getObjectTypeByPosition(t)===Q.OBJECT_DOOR&&this._wwa.getObjectAttributeByPosition(t,Q.ATR_NUMBER)===Q.PASSABLE_OBJECT&&!this.hasItem(this._wwa.getObjectAttributeByPosition(t,Q.ATR_ITEM)))))},e.prototype.isMoving=function(){return this._state==nt.MOVING||this._state==nt.CAMERA_MOVING},e.prototype._isOnCameraMovingPosition=function(){var t=this._camera.getPosition().getPartsCoord(),e=this.getPosition().getPartsCoord();return e.x-t.x==Q.H_PARTS_NUM_IN_WINDOW-1&&this._dir===u.RIGHT||e.x===t.x&&this._dir===u.LEFT||e.y-t.y==Q.V_PARTS_NUM_IN_WINDOW-1&&this._dir===u.DOWN||e.y===t.y&&this._dir===u.UP},e.prototype._isOnCameraStopPosition=function(){var t=this._camera.getPosition().getPartsCoord(),e=this.getPosition().getPartsCoord();return e.x-t.x==Q.H_PARTS_NUM_IN_WINDOW-1&&this._dir===u.LEFT||e.x===t.x&&this._dir===u.RIGHT||e.y-t.y==Q.V_PARTS_NUM_IN_WINDOW-1&&this._dir===u.UP||e.y===t.y&&this._dir===u.DOWN},e.prototype.isControllable=function(){var t=this._afterMoveMacroFlag;return this._afterMoveMacroFlag=!1,this._state===nt.CONTROLLABLE&&!this._partsAppeared&&(this._wwa.getMapTypeByPosition(this._position)!==Q.MAP_LOCALGATE&&this._wwa.getMapTypeByPosition(this._position)!==Q.MAP_URLGATE||!this._wwa.isPrevFrameEventExecuted())&&0===this._moveMacroWaitingRemainMoves&&0===this._moveObjectAutoExecTimer&&!t&&this._wwa.canInput()},e.prototype.getCopyOfItemBox=function(){return this._itemBox.slice()},e.prototype.getDir=function(){return this._dir},e.prototype.isMovingImage=function(){return this._isMovingImage},e.prototype.toggleMovingImage=function(){this._isMovingImage?this._isMovingImage=!1:this._isMovingImage=!0},e.prototype.getEnergyMax=function(){return this._energyMax},e.prototype.isJumped=function(){return this._state===nt.LOCALGATE_JUMPED||this._state===nt.LOCALGATE_JUMPED_WITH_MESSAGE},e.prototype.setMessageWaiting=function(){this._state=nt.MESSAGE_WAITING},e.prototype.isWaitingMessage=function(){return this._state===nt.MESSAGE_WAITING},e.prototype.isDelayFrame=function(){return this._messageDelayFrameCount>0},e.prototype.updateDelayFrame=function(){this._messageDelayFrameCount--},e.prototype.setDelayFrame=function(){this._messageDelayFrameCount=1},e.prototype.clearMessageWaiting=function(){this._state===nt.MESSAGE_WAITING&&(this._state=nt.CONTROLLABLE,this._isPartsEventExecuted=!0,this._isPreparedForLookingAround&&(this._lookingAroundTimer=Q.PLAYER_LOOKING_AROUND_START_FRAME))},e.prototype.setEstimateWindowWating=function(){this._state=nt.ESTIMATE_WINDOW_WAITING},e.prototype.isWatingEstimateWindow=function(){return this._state===nt.ESTIMATE_WINDOW_WAITING},e.prototype.clearEstimateWindowWaiting=function(){this._state===nt.ESTIMATE_WINDOW_WAITING&&(this._state=nt.CONTROLLABLE)},e.prototype.setPasswordWindowWating=function(){this._state=nt.PASSWORD_WINDOW_WAITING},e.prototype.isWaitingPasswordWindow=function(){return this._state===nt.PASSWORD_WINDOW_WAITING},e.prototype.clearPasswordWindowWaiting=function(){this._state===nt.PASSWORD_WINDOW_WAITING&&(this._state=nt.CONTROLLABLE)},e.prototype.isPartsEventExecuted=function(){return this._isPartsEventExecuted},e.prototype.resetEventExecutionInfo=function(){this._isPartsEventExecuted=!1},e.prototype.getLastExecPartsIDOnSamePosition=function(t){return t===I.MAP?this._samePosLastExecutedMapID:this._samePosLastExecutedObjID},e.prototype.setLastExecInfoOnSamePosition=function(t,e){t===I.MAP?this._samePosLastExecutedMapID=e:this._samePosLastExecutedObjID=e},e.prototype.processAfterJump=function(){this._state!==nt.LOCALGATE_JUMPED&&this._state!==nt.LOCALGATE_JUMPED_WITH_MESSAGE||0==--this._jumpWaitFramesRemain&&(this._state=this._state===nt.LOCALGATE_JUMPED?nt.CONTROLLABLE:nt.MESSAGE_WAITING)},e.prototype.jumpTo=function(t){var e=this._camera.getPosition();this.getPosition();return!this._position.equals(t)&&(this._position=t,t.isInCameraRange(this._camera,!0)||this._camera.reset(t),this._state=this._state===nt.MESSAGE_WAITING?nt.LOCALGATE_JUMPED_WITH_MESSAGE:nt.LOCALGATE_JUMPED,this._jumpWaitFramesRemain=Q.LOCALGATE_PLAYER_WAIT_FRAME,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0,t.hasLocalGate()?this._dir=u.DOWN:t.getPartsCoord().y<=this._wwa.getMapWidth()-2&&t.getNextJustPosition(u.DOWN).hasLocalGate()?this._dir=u.UP:t.getPartsCoord().y>=1&&t.getNextJustPosition(u.UP).hasLocalGate()?this._dir=u.DOWN:t.getPartsCoord().x<=this._wwa.getMapWidth()-2&&t.getNextJustPosition(u.RIGHT).hasLocalGate()?this._dir=u.LEFT:t.getPartsCoord().x>=1&&t.getNextJustPosition(u.LEFT).hasLocalGate()?this._dir=u.RIGHT:this._dir=u.DOWN,this._camera.getPosition().equals(e)||(this._isPreparedForLookingAround=!0,this._lookingAroundTimer=Q.PLAYER_LOOKING_AROUND_START_FRAME),!0)},e.prototype.systemJumpTo=function(t){this._position=t,this._camera.reset(t),this._camera.resetPreviousPosition(),this._state=nt.LOCALGATE_JUMPED,this._jumpWaitFramesRemain=Q.LOCALGATE_PLAYER_WAIT_FRAME,this._samePosLastExecutedMapID=void 0,this._samePosLastExecutedObjID=void 0,this._dir=u.DOWN,this._isPreparedForLookingAround=!0,this._lookingAroundTimer=Q.PLAYER_LOOKING_AROUND_START_FRAME},e.prototype.addStatusAll=function(t){return this._status.add(t),this.isDead()&&(this._status.energy=0),0!==this._energyMax&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox(),this._status},e.prototype.setEnergyMax=function(t){return this._energyMax=t,0!==t&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox(),t},e.prototype.setEnergy=function(t){return this._status.energy=t,this.isDead()&&(this._status.energy=0),0!==this._energyMax&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox(),t},e.prototype.damage=function(t){this._status.energy=Math.max(0,this._status.energy-t),this.isDead()&&(this._status.energy=0),0!==this._energyMax&&(this._status.energy=Math.min(this._status.energy,this._energyMax)),this.updateStatusValueBox()},e.prototype.setStrength=function(t){return this._status.strength=t,this.updateStatusValueBox(),t},e.prototype.setDefence=function(t){return this._status.defence=t,this.updateStatusValueBox(),t},e.prototype.setGold=function(t){return this._status.gold=t,this.updateStatusValueBox(),t},e.prototype.getStatus=function(){return this._status.plus(this._equipStatus)},e.prototype.getStatusWithoutEquipments=function(){return this._status.plus(new d(0,0))},e.prototype.getStatusOfEquipments=function(){return this._equipStatus.plus(new d(0,0))},e.prototype.updateStatusValueBox=function(){var t,e=this._status.plus(this._equipStatus);this._energyValueElement.textContent=this._wwa.isVisibleStatus("energy")?String(e.energy):"",this._strengthValueElement.textContent=this._wwa.isVisibleStatus("strength")?String(e.strength):"",this._defenceValueElement.textContent=this._wwa.isVisibleStatus("defence")?String(e.defence):"",this._goldValueElement.textContent=this._wwa.isVisibleStatus("gold")?String(e.gold):"",null===(t=this._wwa._messageWindow)||void 0===t||t.update(),this._wwa.updateScore()},e.prototype.updateItemBox=function(t){for(var e=this,s=function(s){var i=a._itemBoxElement[s],o=ht("#item"+s);if(0===a._itemBox[s])return i.style.backgroundPosition="-40px 0px",a.disposeItemEffect(s,a._itemBoxElement[s],o),"continue";var r=a._wwa.getObjectCropXById(a._itemBox[s]),n=a._wwa.getObjectCropYById(a._itemBox[s]);if(!t||s!==t.insertPos-1)return i.style.backgroundPosition="-"+r+"px -"+n+"px",a.disposeItemEffect(s,a._itemBoxElement[s],o),"continue";var _=t.itemScreenPixelCoord.x-t.itemBoxScreenPixelCoord.x,h=t.itemScreenPixelCoord.y-t.itemBoxScreenPixelCoord.y,c=-_*Q.DEFAULT_FRAME_INTERVAL/Q.ITEM_EFFECT_SPEED_PIXEL_PER_FRAME,u=0===t.overwrittenObjectId||void 0===t.overwrittenObjectId,l=u?t.itemBoxBackgroundImageCoord.x:a._wwa.getObjectCropXById(t.overwrittenObjectId),p=u?t.itemBoxBackgroundImageCoord.y:a._wwa.getObjectCropYById(t.overwrittenObjectId);i.style.left=_+"px",i.style.top=h+"px","number"==typeof a.itemEffectStartTimers[s]&&clearInterval(a.itemEffectStartTimers[s]),a.itemEffectStartTimers[s]=window.setTimeout((function(){e.itemEffectStartTimers[s]=void 0,e.startItemEffect(s,i,o,{target:{x:r,y:n},overwritten:{x:l,y:p}},c)}),Q.DEFAULT_FRAME_INTERVAL)},a=this,i=0;i<this._itemBoxElement.length;i++)s(i)},e.prototype.startItemEffect=function(t,e,s,a,i){var o=this,r=s.querySelector(this.overwittenItemSelector);r&&s.removeChild(r);var n=document.createElement("div");n.classList.add(this.overwittenItemClassName),n.style.backgroundPosition="-"+a.overwritten.x+"px -"+a.overwritten.y+"px",n.style.backgroundImage=s.style.backgroundImage,s.appendChild(n),e.style.backgroundPosition="-"+a.target.x+"px -"+a.target.y+"px",e.style.transitionDuration=i+"ms",e.style.transitionProperty="left,top",e.style.transitionTimingFunction="linear",e.style.left="0",e.style.top="0",s.classList.add(this.itemTransitioningClassName),e.addEventListener("transitionend",(function(){o.disposeItemEffect(t,e,s)}),{once:!0})},e.prototype.disposeItemEffect=function(t,e,s){"number"==typeof this.itemEffectStartTimers[t]&&(clearInterval(this.itemEffectStartTimers[t]),this.itemEffectStartTimers[t]=void 0),e.style.transitionDuration="0s",e.style.transitionProperty="",e.style.left="0",e.style.top="0",s.classList.contains(this.itemTransitioningClassName)&&s.classList.remove(this.itemTransitioningClassName);var a=s.querySelector(this.overwittenItemSelector);a&&s.removeChild(a)},e.prototype.isDead=function(){return this._status.energy<=0},e.prototype.addItem=function(t,e,s,a){var i,o,r;void 0===e&&(e=0),void 0===s&&(s=!1);var n=this._wwa.getObjectAttributeById(t,Q.ATR_NUMBER),_=0;if(0===e&&0!==n&&(e=n),0===e){if(0===t)return;if((i=this._getBlankItemPos())===Q.ITEMBOX_IS_FULL)throw new Error("これ以上、アイテムを持てません。");_=this._itemBox[i-1],this._forceSetItemBox(i,t)}else if(!1===s)if(i=e,r=this._itemBox[i-1],this._wwa.getObjectAttributeById(r,Q.ATR_NUMBER)!==this._wwa.getObjectAttributeById(t,Q.ATR_NUMBER)){if((o=this._getBlankItemPos())===Q.ITEMBOX_IS_FULL)throw new Error("これ以上、アイテムを持てません。");this._forceSetItemBox(o,r),this._forceSetItemBox(i,t)}else _=this._itemBox[i-1],this._forceSetItemBox(i,t);else i=e,_=this._itemBox[i-1],this._forceSetItemBox(i,t);this._updateEquipmentStatus(),this.updateItemBox(a?{insertPos:i,itemScreenPixelCoord:a.screenPixelCoord,itemBoxBackgroundImageCoord:a.itemBoxBackgroundImageCoord,itemBoxScreenPixelCoord:new w(Q.MAP_WINDOW_WIDTH+(i-1)%3*Q.CHIP_SIZE,Q.ITEMBOX_TOP_Y+Math.floor((i-1)/3)*Q.CHIP_SIZE),overwrittenObjectId:_}:void 0)},e.prototype._forceSetItemBox=function(t,e){var s=this,a=ct("#item"+(t-1)+">.item-click-border"),i=this._wwa.getObjectAttributeById(e,Q.ATR_MODE);if(this.removeItemByItemPosition(t),this._itemBox[t-1]=e,0!==e&&i!==S.NORMAL){var o=this._wwa.getSystemMessageById(Y.CLICKABLE_ITEM);if(!this._isClickableItemGot){if("BLANK"!==o){var r="";switch(this._wwa.userDevice.device){case P.PC:r="このアイテムは右のボックスを選択することで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case P.VR:r="このアイテムは右のボックスをクリックすることで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case P.SP:r="このアイテムは右のボックスをタップすることで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case P.GAME:switch(this._wwa.userDevice.os){case C.NINTENDO:r="このアイテムはXボタンを押すか、右のボックスをタップすることで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case C.PLAY_STATION:r="このアイテムは△ボタンを押すことで使用できます。\n使用できるアイテムは色枠で囲まれます。";break;case C.XBOX:r="このアイテムはYボタンを押すことで使用できます。\n使用できるアイテムは色枠で囲まれます。"}}this._wwa.setMessageQueue(""===o?r:o,!1,!0)}this._isClickableItemGot=!0}a.style.display="block",function(t){s._itemUsingEvent[t-1]=function(){(s.isControllable()||s._wwa._messageWindow.isItemMenuChoice())&&(s._wwa._itemMenu.close(),s._wwa._setNextMessage(),s._wwa.onselectitem(t))}}(t),a.addEventListener("click",this._itemUsingEvent[t-1])}},e.prototype._getBlankItemPos=function(){var t;for(t=1;t<this._itemBox.length+1;t++)if(0===this._itemBox[t-1])return t;return Q.ITEMBOX_IS_FULL},e.prototype._updateEquipmentStatus=function(){var t,e=new d(0,0);for(t=0;t<Q.ITEMBOX_SIZE;t++)0!==this._itemBox[t]&&(e.strength+=this._wwa.getObjectAttributeById(this._itemBox[t],Q.ATR_STRENGTH),e.defence+=this._wwa.getObjectAttributeById(this._itemBox[t],Q.ATR_DEFENCE));var s=e.minus(this._equipStatus);this._wwa.setStatusChangedEffect(s),this._equipStatus=e,this.updateStatusValueBox()},e.prototype.hasItem=function(t){for(var e=0;e<Q.ITEMBOX_SIZE;e++)if(this._itemBox[e]===t)return!0;return!1},e.prototype.canUseItem=function(t){var e=this._itemBox[t-1];return 0!==e&&this._wwa.getObjectAttributeById(e,Q.ATR_MODE)!==S.NORMAL},e.prototype.useItem=function(){var t;t=this._itemBox[this._readyToUseItemPos-1],this._wwa.getObjectAttributeById(t,Q.ATR_MODE)!==S.NOT_DISAPPEAR&&this.removeItemByItemPosition(this._readyToUseItemPos);var e=_t("item"+(this._readyToUseItemPos-1));return setTimeout((function(){e.classList.contains("onpress")&&e.classList.remove("onpress")}),Q.DEFAULT_FRAME_INTERVAL),this._isReadyToUseItem=!1,this._readyToUseItemPos=void 0,t},e.prototype.canHaveMoreItems=function(){return this._getBlankItemPos()!==Q.ITEMBOX_IS_FULL},e.prototype.removeItemByItemPosition=function(t){var e;0!==this._itemBox[t-1]&&(this._wwa.getObjectAttributeById(this._itemBox[t-1],Q.ATR_MODE)!==S.NORMAL&&((e=ct("#item"+(t-1)+">.item-click-border")).removeEventListener("click",this._itemUsingEvent[t-1]),e.style.display="none"),this._itemBox[t-1]=0,this._updateEquipmentStatus(),this.updateItemBox())},e.prototype.removeItemByPartsID=function(t){var e;if(!this.hasItem(t))throw new Error("アイテムを持っていない");for(var s=0;s<Q.ITEMBOX_SIZE;s++)if(this._itemBox[s]===t)return this._wwa.getObjectAttributeById(this._itemBox[s],Q.ATR_MODE)!==S.NORMAL&&((e=ct("#item"+s+">.item-click-border")).removeEventListener("click",this._itemUsingEvent[s]),e.style.display="none"),this._itemBox[s]=0,this._updateEquipmentStatus(),void this.updateItemBox()},e.prototype.clearItemBox=function(){for(var t=1;t<=Q.ITEMBOX_SIZE;t++)this.removeItemByItemPosition(t);this._updateEquipmentStatus(),this.updateItemBox()},e.prototype.hasGold=function(t){return this._status.gold>=t},e.prototype.payGold=function(t){if(!this.hasGold(t))throw new Error("お金が足りない");this.setGold(this._status.gold-t)},e.prototype.earnGold=function(t){this.setGold(this._status.gold+t)},e.prototype.setPartsAppearedFlag=function(){this._partsAppeared=!0},e.prototype.clearPartsAppearedFlag=function(){this._partsAppeared=!1},e.prototype.isPartsAppearedTime=function(){return!0===this._partsAppeared},e.prototype.startBattleWith=function(t){this._isPlayerTurn=!0,this._battleFrameCounter=Q.BATTLE_INTERVAL_FRAME_NUM,this._battleTurnNum=0,this._enemy=t,this._state=nt.BATTLE},e.prototype.isFighting=function(){return this._state===nt.BATTLE},e.prototype.isTurn=function(){return this._isPlayerTurn},e.prototype.getTurnNum=function(){return this._battleTurnNum},e.prototype.isBattleStartFrame=function(){return this._battleFrameCounter===Q.BATTLE_INTERVAL_FRAME_NUM&&0===this._battleTurnNum},e.prototype.fight=function(){if(!this.isFighting())throw new Error("バトルが開始されていません。");if(0===this._battleTurnNum&&this._battleFrameCounter===Q.BATTLE_INTERVAL_FRAME_NUM&&this._wwa.showMonsterWindow(),!(--this._battleFrameCounter>0)){this._battleTurnNum++,this._wwa.isBattleSpeedIndexForQuickBattle(this._speedIndex)||this._battleTurnNum>Q.BATTLE_SPEED_CHANGE_TURN_NUM?(1===this._battleTurnNum&&(this._wwa.playSound(K.ATTACK),this._wwa.vibration(!1)),this._battleFrameCounter=1):(this._battleFrameCounter=Q.BATTLE_INTERVAL_FRAME_NUM,this._wwa.playSound(K.ATTACK),this._wwa.vibration(!0));var t=this.getStatus(),e=this._enemy.status;if(this._isPlayerTurn){if(t.strength>e.defence||t.defence<e.strength)return e.energy>t.strength-e.defence?t.strength>e.defence&&this._enemy.damage(t.strength-e.defence):(this._wwa.playSound(this._wwa.getObjectAttributeById(this._enemy.partsID,Q.ATR_SOUND)),this.earnGold(e.gold),this._wwa.setStatusChangedEffect(new E(0,0,0,e.gold)),0!==this._enemy.item?this._wwa.setPartsOnPosition(I.OBJECT,this._enemy.item,this._enemy.position):this._wwa.setPartsOnPosition(I.OBJECT,0,this._enemy.position),this._wwa.appearParts(this._enemy.position,A.OBJECT,this._enemy.partsID),this._state=nt.CONTROLLABLE,this._wwa.setMessageQueue(this._enemy.message,!1,!1,this._enemy.partsID,I.OBJECT,this._enemy.position),this._enemy.battleEndProcess(),this._battleTurnNum=0,this._enemy=null),void(this._isPlayerTurn=!1);this._enemy.battleEndProcess(),this._wwa.setMessageQueue("相手の防御能力が高すぎる!",!1,!0),this._battleTurnNum=0,this._enemy=null}else e.strength>t.defence&&(t.energy>e.strength-t.defence?this.damage(e.strength-t.defence):(this.setEnergy(0),this._enemy.battleEndProcess(),this._state=nt.CONTROLLABLE,this._battleTurnNum=0,this._enemy=null,this._wwa.gameover()));this._isPlayerTurn=!0}},e.prototype.readyToUseItem=function(t){var e;if(!this.canUseItem(t))throw new Error("アイテムがないか、アイテムが使えません。");e=this._itemBox[t-1],this._wwa.getObjectAttributeById(e,Q.ATR_STRING),this._wwa.appearParts(this._position.getPartsCoord(),A.OBJECT,e),this._readyToUseItemPos=t,this._isReadyToUseItem=!0},e.prototype.isReadyToUseItem=function(){return this._isReadyToUseItem},e.prototype.getDrawingCenterPosition=function(){var t=this._position.getPartsCoord(),e=this._position.getOffsetCoord(),s=this._camera.getPosition(),a=s.getPartsCoord(),i=s.getOffsetCoord(),o=(t.x-a.x)*Q.CHIP_SIZE+e.x-i.x+Q.CHIP_SIZE/2,r=(t.y-a.y)*Q.CHIP_SIZE+e.y-i.y+Q.CHIP_SIZE/2;return new w(o,r)},e.prototype.getPlayTimeText=function(){var t=Math.floor(this._frameCount/60);return t>=36e6?"9999:99:99":("000"+(t/60/60|0)).slice(-4)+":"+("0"+(t/60|0)%60).slice(-2)+":"+("0"+t%60).slice(-2)},e.prototype.mainFrameCount=function(){this._frameCount++},e.prototype.getFrameCount=function(){return this._frameCount},e.prototype.setFrameCount=function(t){return"number"!=typeof t&&(t=0),this._frameCount=t},e.prototype.getMoveCount=function(){return this._moves},e.prototype.setMoveCount=function(t){return this._moves=t},e.prototype.isMoveObjectAutoExecTime=function(){return 0===this._moveObjectAutoExecTimer},e.prototype.setMoveMacroWaiting=function(t){t<0||(this._moveMacroWaitingRemainMoves=t,this._moveObjectAutoExecTimer=0)},e.prototype.resetMoveObjectAutoExecTimer=function(){this._moveObjectAutoExecTimer=Q.CHIP_SIZE/X[this._speedIndex],this._moveMacroWaitingRemainMoves--},e.prototype.decrementMoveObjectAutoExecTimer=function(){return this._moveMacroWaitingRemainMoves>=0&&this._moveObjectAutoExecTimer>0&&(this._moveObjectAutoExecTimer--,0===this._moveMacroWaitingRemainMoves&&0===this._moveObjectAutoExecTimer&&(this._afterMoveMacroFlag=!0)),0},e.prototype.isWaitingMoveMacro=function(){return 0!==this._moveMacroWaitingRemainMoves||0!==this._moveObjectAutoExecTimer},e.prototype.decrementLookingAroundTimer=function(){return this._isPreparedForLookingAround&&this._lookingAroundTimer>0?--this._lookingAroundTimer:0},e.prototype.isLookingAround=function(){return this._isPreparedForLookingAround&&0===this._lookingAroundTimer},e.prototype.getSpeedIndex=function(){return this._speedIndex},e.prototype.speedUp=function(){return this._speedIndex=Math.min(Q.MAX_SPEED_INDEX,this._speedIndex+1)},e.prototype.speedDown=function(){return this._speedIndex=Math.max(Q.MIN_SPEED_INDEX,this._speedIndex-1)},e.prototype.setSpeedIndex=function(t){if(t<Q.MIN_SPEED_INDEX||Q.MAX_SPEED_INDEX<t)throw new Error("#set_speed の引数が異常です:"+t);return this._speedIndex=t,this._speedIndex},e}(gt),St=function(){function t(t,e,s,a,i,o,r){this._partsID=t,this._position=e,this._imgCoord=s,this._status=a,this._message=i,this._item=o,this._battleEndCallback=r}return Object.defineProperty(t.prototype,"partsID",{get:function(){return this._partsID},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this._position},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"imgCoord",{get:function(){return this._imgCoord},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"item",{get:function(){return this._item},enumerable:!1,configurable:!0}),t.prototype.damage=function(t){this._status.energy=Math.max(0,this._status.energy-t)},t.prototype.battleEndProcess=function(){this._battleEndCallback()},t}(),It=function(){function t(t,e,s,a,i){this._player=t,this._objectID=e,this._srcPos=s,this._destPos=a,this._dir=i,this._currentPos=this._srcPos.clone()}return t.prototype.update=function(){var t=this._player.getSpeedIndex();return this._currentPos=this._currentPos.getNextFramePosition(this._dir,X[t],X[t]),this._currentPos},Object.defineProperty(t.prototype,"isAchievedDestination",{get:function(){return this._currentPos.equals(this._destPos)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentPosition",{get:function(){return this._currentPos},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"beforePosition",{get:function(){return this._srcPos},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"destination",{get:function(){return this._destPos},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"objID",{get:function(){return this._objectID},enumerable:!1,configurable:!0}),t}(),Tt=function(){function t(t,e){this._wwa=t,this._player=e,this.clear()}return t.prototype.add=function(t,e,s,a){this._queue.push(new It(this._player,t,e,s,a))},t.prototype.update=function(){for(var t=[],e=[],s=0;s<this._queue.length;s++)this._queue[s].update(),this._queue[s].isAchievedDestination?(t.push(this._queue[s]),this._wwa.setPartsOnPosition(I.OBJECT,0,this._queue[s].beforePosition.getPartsCoord()),this._wwa.setPartsOnPosition(I.OBJECT,this._queue[s].objID,this._queue[s].destination.getPartsCoord())):e.push(this._queue[s]);return this._queue=e,t},t.prototype.clear=function(){this._queue=[]},Object.defineProperty(t.prototype,"objectMovingData",{get:function(){return this.objectMovingData},enumerable:!1,configurable:!0}),t.prototype.getOffsetByBeforePartsCoord=function(t){var e=this._queue.filter((function(e){return e.beforePosition.getPartsCoord().equals(t)}));return 0===e.length?null:e[0].currentPosition.getOffsetCoord()},t}(),Ot=function(){var t=function(e,s){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},t(e,s)};return function(e,s){if("function"!=typeof s&&null!==s)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function a(){this.constructor=e}t(e,s),e.prototype=null===s?Object.create(s):(a.prototype=s.prototype,new a)}}(),vt=function(){function t(t,e,s,a){this.isSystemMessage=e,this.isEndOfPartsEvent=s,this.macro=a,this.messageArray="string"==typeof t?[t]:t,void 0===this.macro&&(this.macro=[])}return t.prototype.isEmpty=function(){return 0===this.messageArray.length||1===this.messageArray.length&&""===this.messageArray[0]},t.prototype.generatePrintableMessage=function(){return this.messageArray.reduce((function(t,e){var s="string"==typeof e?e:e();return"".concat(t).concat(s)}),"")},t}(),Dt=function(){function t(t,e,s,a,i,o){this._wwa=t,this._triggerPartsID=e,this._triggerPartsType=s,this._triggerPartsPosition=a,this.macroType=i,this.macroArgs=o}return t.prototype.execute=function(){try{switch(this.macroType){case k.IMGPLAYER:this._executeImgPlayerMacro();break;case k.IMGYESNO:this._executeImgYesNoMacro();break;case k.HPMAX:this._executeHPMaxMacro();break;case k.SAVE:this._executeSaveMacro();break;case k.ITEM:this._executeItemMacro();break;case k.DEFAULT:this._executeDefaultMacro();break;case k.OLDMAP:this._executeOldMapMacro();break;case k.PARTS:this._executePartsMacro();break;case k.MOVE:this._executeMoveMacro();break;case k.MAP:this._executeMapMacro();break;case k.DIRMAP:this._executeDirMapMacro();break;case k.IMGFRAME:this._executeImgFrameMacro();break;case k.IMGBOM:this._executeImgBomMacro();break;case k.DELPLAYER:this._executeDelPlayerMacro();break;case k.FACE:this._executeFaceMacro();break;case k.EFFECT:this._executeEffectMacro();break;case k.GAMEOVER:this._executeGameOverMacro();break;case k.IMGCLICK:this._executeImgClickMacro();break;case k.STATUS:this._executeStatusMacro();break;case k.EFFITEM:this._executeEffItemMacro();break;case k.COLOR:this._executeColorMacro();break;case k.WAIT:this._executeWaitMacro();break;case k.SOUND:this._executeSoundMacro();break;case k.GAMEPAD_BUTTON:this._executeGamePadButtonMacro();break;case k.OLDMOVE:this._executeOldMoveMacro();break;case k.JUMPGATE:this._executeJumpGateMacro();break;case k.RECPOSITION:this._executeRecPositionMacro();break;case k.JUMPRECPOSITION:this._executeJumpRecPositionMacro();break;case k.CONSOLE_LOG:this._executeConsoleLogMacro();break;case k.COPY_HP_TO:this._executeCopyHpToMacro();break;case k.SET_HP:this._executeSetHPMacro();break;case k.COPY_HPMAX_TO:this._executeCopyHpMaxToMacro();break;case k.SET_HPMAX:this._executeSetHpMaxMacro();break;case k.COPY_AT_TO:this._executeCopyAtToMacro();break;case k.SET_AT:this._executeSetAtMacro();break;case k.COPY_DF_TO:this._executeCopyDfToMacro();break;case k.SET_DF:this._executeSetDfMacro();break;case k.COPY_MONEY_TO:this._executeCopyMoneyToMacro();break;case k.SET_MOENEY:this._executeSetMoneyMacro();break;case k.COPY_STEP_COUNT_TO:this._executeSetStepCountMacro();break;case k.VAR_SET_VAL:this._executeVarSetValMacro();break;case k.VAR_SET:this._executeVarSetMacro();break;case k.VAR_ADD:this._executeVarAddMacro();break;case k.VAR_SUB:this._executeVarSubMacro();break;case k.VAR_MUL:this._executeVarMulMacro();break;case k.VAR_DIV:this._executeVarDivMacro();break;case k.VAR_MOD:this._executeVarModMacro();break;case k.VAR_SET_RAND:this._executeVarSetRandMacro();break;case k.GAME_SPEED:this._executeGameSpeedMacro();break;case k.SHOW_STR:break;case k.IF:this._executeIfMacro();break;case k.SET_SPEED:this._executeSetSpeedMacro();break;case k.COPY_TIME_TO:this._executeCopyTimeToMacro();break;case k.HIDE_STATUS:this._hideStatusMacro();break;case k.VAR_MAP:this._varMapMacro();break;default:console.log("不明なマクロIDが実行されました:"+this.macroType)}}catch(t){}},t.prototype._concatEmptyArgs=function(t){if(this.macroArgs.length<t){for(var e=new Array(t-this.macroArgs.length),s=0;s<e.length;s++)e[s]="";this.macroArgs=this.macroArgs.concat(e)}},t.prototype._parseInt=function(t,e){void 0===e&&(e=0);var s=parseInt(this.macroArgs[t]);return isNaN(s)?e:s},t.prototype._executeJumpGateMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.forcedJumpGate(t,e)},t.prototype._executeRecPositionMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.recUserPosition(t,e)},t.prototype._executeJumpRecPositionMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.jumpRecUserPosition(t,e)},t.prototype._executeConsoleLogMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.outputUserVar(t)},t.prototype._executeCopyHpToMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setUserVarHP(t)},t.prototype._executeCopyHpMaxToMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setUserVarHPMAX(t)},t.prototype._executeCopyAtToMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseStatusKind(this._parseInt(1));this._wwa.setUserVarAT(t,e)},t.prototype._executeCopyDfToMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseStatusKind(this._parseInt(1));this._wwa.setUserVarDF(t,e)},t.prototype._parseStatusKind=function(t){switch(t){case 0:default:return"all";case 1:return"bare";case 2:return"equipment"}},t.prototype._executeCopyMoneyToMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setUserVarMONEY(t)},t.prototype._executeSetHPMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setHPUserVar(t)},t.prototype._executeSetHpMaxMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setHPMAXUserVar(t)},t.prototype._executeSetAtMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setATUserVar(t)},t.prototype._executeSetDfMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setDFUserVar(t)},t.prototype._executeSetMoneyMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setMONEYUserVar(t)},t.prototype._executeSetStepCountMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setUserVarStep(t)},t.prototype._executeVarSetValMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserVarVal(t,e)},t.prototype._executeVarSetMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValOtherUserVal(t,e)},t.prototype._executeVarAddMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValAdd(t,e)},t.prototype._executeVarSubMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValSub(t,e)},t.prototype._executeVarMulMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValMul(t,e)},t.prototype._executeVarDivMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValDiv(t,e)},t.prototype._executeVarModMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setUserValMod(t,e)},t.prototype._executeVarSetRandMacro=function(){this._concatEmptyArgs(3);var t=this._parseInt(0),e=this._parseInt(1),s=this._parseInt(2,0);this._wwa.setUserValRandNum(t,e,s)},t.prototype._executeGameSpeedMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(0);this._wwa.speedChangeJudge(t)},t.prototype._executeIfMacro=function(){for(var t=new Array(11),e=0;e<10;e++)t[e]=this.macroArgs[e];this._wwa.userVarUserIf(this._triggerPartsPosition,t)},t.prototype._executeSetSpeedMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setPlayerSpeedIndex(t-1)},t.prototype._executeCopyTimeToMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setUserVarPlayTime(t)},t.prototype._hideStatusMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=0!==this._parseInt(1);this._wwa.hideStatus(t,e)},t.prototype._varMapMacro=function(){this._concatEmptyArgs(4);var t=this._parseInt(0),e=this.macroArgs[1],s=this.macroArgs[2],a=this._parseInt(3,I.OBJECT);if(t<0)throw new Error("入力変数が不正です");this._wwa.varMap(this._triggerPartsPosition,e,s,t,a)},t.prototype._executeImgPlayerMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setPlayerImgCoord(new w(t,e))},t.prototype._executeImgYesNoMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setYesNoImgCoord(new w(t,e))},t.prototype._executeHPMaxMacro=function(){this._concatEmptyArgs(1);var t=Math.max(0,this._parseInt(0));this._wwa.setPlayerEnergyMax(t)},t.prototype._executeSaveMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(0);this._wwa.disableSave(t)},t.prototype._executeItemMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);this._wwa.setPlayerGetItem(t,e)},t.prototype._executeDefaultMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(0);this._wwa.setObjectNotCollapseOnPartsOnPlayer(t)},t.prototype._executeOldMapMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(0);this._wwa.setOldMap(t)},t.prototype._executePartsMacro=function(){this._concatEmptyArgs(4);var t=this._parseInt(0),e=this._parseInt(1),s=this._parseInt(2,I.OBJECT),a=this._parseInt(3);if(s!==I.OBJECT&&s!==I.MAP)throw new Error("パーツ種別が不明です");if(0!==a&&1!==a&&(a=1),t<0||e<0)throw new Error("パーツ番号が不正です");if(s===I.OBJECT){if(t>=this._wwa.getObjectPartsNum()||e>=this._wwa.getObjectPartsNum())throw new Error("パーツ番号が不正です")}else if(t>=this._wwa.getMapPartsNum()||e>=this._wwa.getMapPartsNum())throw new Error("パーツ番号が不正です");this._wwa.replaceParts(t,e,s,!!a)},t.prototype._executeMoveMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);this._wwa.setMoveMacroWaitingToPlayer(t)},t.prototype._executeMapMacro=function(){this._concatEmptyArgs(4);var t=this._parseInt(0),e=this.macroArgs[1],s=this.macroArgs[2],a=this._parseInt(3,I.OBJECT);if(t<0)throw new Error("パーツ番号が不正です");if(a===I.OBJECT){if(t>=this._wwa.getObjectPartsNum())throw new Error("パーツ番号が不正です")}else if(t>=this._wwa.getMapPartsNum())throw new Error("パーツ番号が不正です");this._wwa.appearPartsEval(this._triggerPartsPosition,e,s,t,a)},t.prototype._executeDirMapMacro=function(){this._concatEmptyArgs(3);var t=this._parseInt(0),e=this._parseInt(1),s=this._parseInt(2,I.OBJECT);if(isNaN(t)||isNaN(e)||isNaN(s))throw new Error("引数が整数ではありません");if(t<0)throw new Error("パーツ番号が不正です");if(s===I.OBJECT){if(t>=this._wwa.getObjectPartsNum())throw new Error("パーツ番号が不正です")}else if(t>=this._wwa.getMapPartsNum())throw new Error("パーツ番号が不正です");this._wwa.appearPartsByDirection(e,t,s)},t.prototype._executeImgFrameMacro=function(){this._concatEmptyArgs(3);var t=this._parseInt(0),e=this._parseInt(1),s=this._parseInt(2);if(e<0||s<0)throw new Error("座標は正でなければなりません。");if(t===H.ENERGY||t===H.STRENGTH||t===H.DEFENCE||t===H.GOLD)this._wwa.setStatusIconCoord(t,new w(e,s));else if(t===H.WIDE_CELL_ROW)this._wwa.setWideCellCoord(new w(e,s));else if(t===H.ITEM_BG)this._wwa.setItemboxBackgroundPosition({x:e,y:s});else{if(t!==H.MAIN_FRAME)throw new Error("種別が不正です。");this._wwa.setFrameCoord(new w(e,s))}},t.prototype._executeImgBomMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);if(t<0||e<0)throw new Error("座標は正でなければなりません。");this._wwa.setBattleEffectCoord(new w(t,e))},t.prototype._executeDelPlayerMacro=function(){this._concatEmptyArgs(1);var t=parseInt(this.macroArgs[0]);this._wwa.setDelPlayer(!!t)},t.prototype._executeFaceMacro=function(){this._concatEmptyArgs(6);var t,e=this._parseInt(0),s=this._parseInt(1),a=this._parseInt(2),i=this._parseInt(3),o=this._parseInt(4),r=this._parseInt(5);if(e<0||s<0||a<0||i<0||o<0||r<0)throw new Error("各引数は0以上の整数でなければなりません。");t=new m(new w(e,s),new w(a,i),new w(o,r)),this._wwa.addFace(t)},t.prototype._executeEffectMacro=function(){this._concatEmptyArgs(1);var t=this._parseInt(0);if(t<0)throw new Error("待ち時間は0以上の整数でなければなりません。");if(0!==t){for(var e=[],s=1;s<this.macroArgs.length;s+=2){var a,i=this._parseInt(s);if(i<0)throw new Error("画像のパーツ座標指定は0以上の整数でなければなりません。");if(s+1===this.macroArgs.length)throw new Error("画像のパーツ座標指定で、Y座標が指定されていません。");if((a=this._parseInt(s+1))<0)throw new Error("画像のパーツ座標指定は0以上の整数でなければなりません。");e.push(new w(i,a))}this._wwa.setEffect(t,e)}else this._wwa.stopEffect()},t.prototype._executeGameOverMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);if(t<0||t>=this._wwa.getMapWidth()||e<0||e>=this._wwa.getMapWidth())throw new Error("マップの範囲外が指定されています!");this._wwa.setGameOverPosition(new w(t,e))},t.prototype._executeImgClickMacro=function(){if(this._concatEmptyArgs(2),this.macroArgs.length<1)throw new Error("引数が少なすぎます");var t=this._parseInt(0),e=this._parseInt(1);if(t<0||e<0)throw new Error("引数が0以上の整数ではありません");this._wwa.setImgClick(new w(t,e))},t.prototype._executeEffItemMacro=function(){if(this.macroArgs.length<1)throw new Error("引数が少なすぎます");var t=this._parseInt(0);this._wwa.updateItemEffectEnabled(!!t)},t.prototype._executeStatusMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);if(t<0||4<t)throw new Error("ステータス種別が範囲外です。");this._wwa.setPlayerStatus(t,e)},t.prototype._executeColorMacro=function(){this._concatEmptyArgs(4);var t=this._parseInt(0),e=this._parseInt(1),s=this._parseInt(2),a=this._parseInt(3);if(t<0||t>5)throw new Error("種別は0から5までです");if(e<0||e>255||s<0||s>255||a<0||a>255)throw new Error("色が範囲外です");this._wwa.changeStyleRule(t,e,s,a)},t.prototype._executeWaitMacro=function(){throw new Error("Not implemented!")},t.prototype._executeSoundMacro=function(){this._concatEmptyArgs(1);var t=parseInt(this.macroArgs[0]);this._wwa.playSound(t)},t.prototype._executeGamePadButtonMacro=function(){this._concatEmptyArgs(2);var t=this._parseInt(0),e=this._parseInt(1);if(t<0||e<0)throw new Error("各引数は0以上の整数でなければなりません。");if(e>Q.ITEMBOX_SIZE)throw new Error("アイテムボックス上限を超えた数値が指定されました。");this._wwa.setGamePadButtonItemTable(t,e)},t.prototype._executeOldMoveMacro=function(){this._concatEmptyArgs(1);var t=!!this._parseInt(0);this._wwa.setOldMove(t)},t}();function Ct(t,e,s,a,i){var o=i.match(/^\$([a-zA-Z_][a-zA-Z0-9_]*)\=(.*)$/);if(null===o||3!==o.length)throw new Error("マクロではありません");var r=o[1],n=V["$"+r.toLowerCase()];return void 0===n?new Dt(t,e,s,a,k.UNDEFINED,o[2].split(",")):new Dt(t,e,s,a,n,o[2].split(",").map((function(t){return t.trim()})))}var Pt,Mt=function(){function t(t,e,s,a,i,o,r){this._wwa=t,this._coord=e,this._width=s,this._height=a,this._isVisible=i,this._parentElement=o,this._element=document.createElement("div"),this._element.style.position="absolute",this._element.style.borderWidth="2px",this._element.style.borderStyle="solid",t.isClassicMode()?this._element.style.borderRadius="15px":this._element.style.borderRadius="10px",this._element.classList.add("wwa-message-window"),this._element.style.zIndex=r+"",this._element.style.left=this._coord.x+"px",this._element.style.top=this._coord.y+"px",this._element.style.width=this._width+"px",this._element.style.height=this._height+"px",this._parentElement.appendChild(this._element)}return t.prototype.update=function(t){},t.prototype.show=function(){this._isVisible=!0,this._element.style.display="block",this.update(),this._wwa.wwaCustomEvent("wwa_window_show",{name:this.windowName,element:this._element,text:this._element.textContent})},t.prototype.hide=function(){this._isVisible=!1,this._element.style.display="none",this.update(),this._wwa.wwaCustomEvent("wwa_window_hide",{name:this.windowName})},t.prototype.isVisible=function(){return this._isVisible},Object.defineProperty(t.prototype,"windowName",{get:function(){return"TextWindow"},enumerable:!1,configurable:!0}),t}(),Nt=function(t){function e(e,s,a,i,o,r,n){var _=t.call(this,e,new w(s.x,s.y),a,i,o,r,201)||this;return _._cgFileName=n,_._monsterBox=document.createElement("div"),_._monsterBox.style.width=Q.CHIP_SIZE+"px",_._monsterBox.style.height=Q.CHIP_SIZE+"px",_._monsterBox.style.position="absolute",_._monsterBox.style.left="10px",_._monsterBox.style.top="10px",_._monsterBox.style.backgroundImage="url("+_._cgFileName.replace("(","\\(").replace(")","\\)")+")",_._monsterBox.style.backgroundPosition="0 0",_._element.appendChild(_._monsterBox),_._energyBox=document.createElement("div"),_._energyBox.style.position="absolute",_._energyBox.style.left="80px",_._energyBox.style.top="10px",_._energyBox.textContent="生命力 0",_._element.appendChild(_._energyBox),_._strengthBox=document.createElement("div"),_._strengthBox.style.position="absolute",_._strengthBox.style.left="80px",_._strengthBox.style.top="30px",_._strengthBox.textContent="攻撃力 0",_._element.appendChild(_._strengthBox),_._defenceBox=document.createElement("div"),_._defenceBox.style.position="absolute",_._defenceBox.style.left="180px",_._defenceBox.style.top="30px",_._defenceBox.textContent="防御力 0",_._element.appendChild(_._defenceBox),_._isVisible?_._element.style.display="block":_._element.style.display="none",_}return Ot(e,t),e.prototype.update=function(t){void 0!==t&&(this._monsterBox.style.backgroundPosition="-"+t.imgCoord.x+"px -"+t.imgCoord.y+"px",this._energyBox.textContent="生命力 "+t.status.energy,this._strengthBox.textContent="攻撃力 "+t.status.strength,this._defenceBox.textContent="防御力 "+t.status.defence)},Object.defineProperty(e.prototype,"windowName",{get:function(){return"MonsterWindow"},enumerable:!1,configurable:!0}),e}(Mt),Rt=function(t){function e(e,s,a,i){var o=this;return e.isClassicMode()?((o=t.call(this,e,new w(2*Q.CHIP_SIZE,30),7*Q.CHIP_SIZE,40,a,i,202)||this)._element.style.borderWidth="0",o._element.style.borderRadius="4px",o._element.style.fontSize="20px",o._element.style.lineHeight="40px"):o=t.call(this,e,new w(s.x,s.y),340,30,a,i,202)||this,o._element.style.textAlign="center",o._isVisible?o._element.style.display="block":o._element.style.display="none",o.update(0),o}return Ot(e,t),e.prototype.update=function(t){void 0!==t&&(this._element.textContent="Score: "+t)},Object.defineProperty(e.prototype,"windowName",{get:function(){return"ScoreWindow"},enumerable:!1,configurable:!0}),e.WINDOW_NAME="ScoreWindow",e}(Mt);!function(t){t[t.TOP=0]="TOP",t[t.CENTER=1]="CENTER",t[t.BOTTOM=2]="BOTTOM",t[t.SCORE=3]="SCORE"}(Pt||(Pt={}));var Lt,bt=function(){function t(t,e,s,a,i,o,r,n,_,h){this._wwaSave=void 0,this._save_select_id=0,this._save_counter=0,this._save_close=!1;var c=this,u=o.replace("(","\\(").replace(")","\\)");switch(this._wwa=t,this._cgFileName=o,this._x=e,this._y=s,this._width=a,this._height=i,this._message=new vt([],!1),this._isVisible=r,this._isYesno=n,this._isItemMenu=_,this._element=document.createElement("div"),this._element.id="wwa-text-message-window",this._element.classList.add("wwa-message-window"),this._msgWrapperElement=document.createElement("div"),this._msgWrapperElement.style.textAlign="left",this._msgWrapperElement.style.wordWrap="break-word",this._msgWrapperElement.style.margin=t.isClassicMode()?"8px 0 8px 16px":"0",this._msgWrapperElement.style.padding=t.isClassicMode()?"0":"7px",this._element.appendChild(this._msgWrapperElement),this._saveElement=document.createElement("div"),this._saveElement.style.padding="0",this._saveElement.style.margin="0",this._element.appendChild(this._saveElement),this._dummyElement=document.createElement("div"),this._dummyElement.style.display="none",this._dummyElement.style.padding="0",this._dummyElement.style.margin="0",this._dummyElement.style.height="55px",this._element.appendChild(this._dummyElement),this._ynWrapperElement=document.createElement("div"),this._ynWrapperElement.classList.add("wwa-yesno-wrapper"),this._element.appendChild(this._ynWrapperElement),this._parentElement=h,this._parentElement.appendChild(this._element),this._divYesElement=document.createElement("div"),this._divYesElement.classList.add("wwa-yes-button"),this._divYesElement.style.background="url("+u+")",this._divYesElement.onclick=function(){c._isInputDisable||(t.setYesNoInput(g.YES),c.update())},this._divYesElement.style.cursor="pointer",this._divNoElement=document.createElement("div"),this._divNoElement.classList.add("wwa-no-button"),this._divNoElement.style.background="url("+u+")",this._divNoElement.onclick=function(){c._isInputDisable||(t.setYesNoInput(g.NO),c.update())},this._ynWrapperElement.appendChild(this._divYesElement),this._ynWrapperElement.appendChild(this._divNoElement),c._isInputDisable=!1,t.userDevice.device){case P.SP:case P.VR:this._parentElement.classList.add("useScaleUp")}this.update()}return t.prototype.setPosition=function(t,e,s,a){this._x=t,this._y=e,this._width=s,this._height=a,this.update()},t.prototype.setPositionByPlayerPosition=function(t,e,s,a,i){var o,r=a.getPartsCoord().substract(i.getPartsCoord()).y;o=t?Pt.BOTTOM:e?Pt.SCORE:s?Pt.CENTER:r>=Math.ceil(Q.V_PARTS_NUM_IN_WINDOW/2)?Pt.TOP:Pt.BOTTOM,this.setPositionEasy(o)},t.prototype.setPositionEasy=function(t){var e=Math.floor(this._element.clientHeight/2);return t===Pt.CENTER?(this._y=Q.MAP_WINDOW_HEIGHT/2-e,void this.update()):t===Pt.TOP?(this._y=Math.max(20,Q.MAP_WINDOW_HEIGHT/4-e)+10,void this.update()):t===Pt.BOTTOM?(this._y=Math.min(Q.MAP_WINDOW_HEIGHT-20-this._element.clientHeight,3*Q.MAP_WINDOW_HEIGHT/4-e),void this.update()):t===Pt.SCORE?(this._y=80,void this.update()):void 0},t.prototype.setParsedMessage=function(t){this._message=t,this.update()},t.prototype.setYesNoChoice=function(t){return this._isInputDisable=!1,this._isYesno=t,this.update(),this._isYesno},t.prototype.isYesNoChoice=function(){return this._isYesno},t.prototype.isSaveChoice=function(){return this._isSave},t.prototype.setItemMenuChoice=function(t){return this._isInputDisable=!1,this._isItemMenu=t,this.update(),this._isItemMenu},t.prototype.isItemMenuChoice=function(){return this._isItemMenu},t.prototype.setInputDisable=function(){this._isInputDisable=!0},t.prototype.isInputDisable=function(){return this._isInputDisable},t.prototype.show=function(){this._isVisible=!0,this.update()},t.prototype.hide=function(){this._isVisible=!1,this.update()},t.prototype.isVisible=function(){return this._isVisible},t.prototype.isWideChar=function(t){return null!==t.match(/^[^\x01-\x7E\xA1-\xDF]+$/)},t.prototype.createClassicTextElement=function(t){for(var e=document.createElement("span"),s=0,a="",i=0;i<t.length||0!=s;i++)if(this.isWideChar(t.charAt(i))?s+=2:s+=1,a+=t.charAt(i),s+1>2*Q.MSG_STR_WIDTH){"。"!==t.charAt(i+1)&&"、"!==t.charAt(i+1)||(a+=t.charAt(i+1),i++);var o=document.createElement("span");o.style.display="inline-block",o.style.width="100%",o.textContent=a,e.appendChild(o),s=0,a=""}return e},t.prototype.update=function(){var t=this,e=this._wwa.getYesNoImgCoord();this._isYesno?(this._wwa.getYesNoState()===g.YES?(this._divYesElement.style.backgroundPosition="-"+(e.x+Q.IMGRELPOS_YESNO_YESP_X)*Q.CHIP_SIZE+"px -"+e.y*Q.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+Q.IMGRELPOS_YESNO_NO_X)*Q.CHIP_SIZE+"px -"+e.y*Q.CHIP_SIZE+"px"):this._wwa.getYesNoState()===g.NO?(this._divYesElement.style.backgroundPosition="-"+(e.x+Q.IMGRELPOS_YESNO_YES_X)*Q.CHIP_SIZE+"px -"+e.y*Q.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+Q.IMGRELPOS_YESNO_NOP_X)*Q.CHIP_SIZE+"px -"+e.y*Q.CHIP_SIZE+"px"):(this._divYesElement.style.backgroundPosition="-"+(e.x+Q.IMGRELPOS_YESNO_YES_X)*Q.CHIP_SIZE+"px -"+e.y*Q.CHIP_SIZE+"px",this._divNoElement.style.backgroundPosition="-"+(e.x+Q.IMGRELPOS_YESNO_NO_X)*Q.CHIP_SIZE+"px -"+e.y*Q.CHIP_SIZE+"px"),this._ynWrapperElement.style.display="block"):this._ynWrapperElement.style.display="none",this._msgWrapperElement.textContent="";var s=this._message.generatePrintableMessage().split("\n");s.forEach((function(e,a){var i;t._wwa.isClassicMode()?i=t.createClassicTextElement(e):(i=document.createElement("span")).textContent=s[a],t._msgWrapperElement.appendChild(i),t._msgWrapperElement.appendChild(document.createElement("br"))})),this._isVisible?(this._element.style.left=this._x+"px",this._element.style.top=this._y+"px"):(this._element.style.left="-999999px",this._element.style.top="-999999px"),this._isSave?this._saveElement.style.display="block":this._saveElement.style.display="none",this._element.style.width=this._width+"px",this._element.style.minHeight=this._height+"px"},t.prototype.setWWASave=function(t){this._wwaSave=t},t.prototype.createSaveDom=function(){var t,e,s,a,i,o,r,n,_,h,c,u=this;e=document.createElement("div"),h=(n=document.getElementById("disp-energy")).style.backgroundPosition,c=n.style.backgroundImage;for(var l=this._wwaSave.list.length,p=0;p<l;p++)t=this._wwaSave.list[p],(s=document.createElement("div")).classList.add("savedata"),s.setAttribute("save_id",p),s.addEventListener("click",(function(t){u.setSaveID(0|t.currentTarget.getAttribute("save_id")),u._save_close=!0,t.preventDefault()})),(a=document.createElement("div")).classList.add("ss"),s.appendChild(a),(i=document.createElement("div")).classList.add("wide-cell-row"),i.style.backgroundPosition=h,i.style.backgroundImage=c,s.appendChild(i),e.appendChild(s),t.flag&&(a.appendChild(t.cvs),(o=document.createElement("span")).textContent=t.getDateText(),t.isLastSaveData()&&(o.style.color=q.DATE_LAST_SAVE_TEXT_COLOR),a.appendChild(o),(r=document.createElement("div")).classList.add("status-icon"),r.style.backgroundImage=c,r.style.backgroundPosition="-120px -80px",i.appendChild(r),(_=document.createElement("div")).classList.add("status-value-box"),_.textContent=t.getStatusEnergy(),i.appendChild(_));this._saveElement.textContent="",this._saveElement.appendChild(e),this.setSaveID(this._save_select_id),this._isSave=!0,this._save_counter=0,this._save_close=!1},t.prototype.deleteSaveDom=function(){this._saveElement.textContent="",this._isSave=!1},t.prototype.setSaveID=function(t){this._save_select_id=t;for(var e,s=document.querySelectorAll(".savedata"),a=s.length,i=0;i<a;i++)e=s[i],t===i?e.classList.add("select"):e.classList.remove("select")},t.prototype.save=function(t,e){return this._wwaSave.save(t,e,this._save_select_id)},t.prototype.load=function(){return this._wwaSave.load(this._save_select_id)},t.prototype.saveUpdate=function(){this._save_counter>0&&this._save_counter--},t.prototype.isSaveClose=function(){return this._save_close},t.prototype.cursor_wait=function(){this._save_counter=Q.CONTROLL_WAIT_FRAME},t.prototype.saveControll=function(t){if(!(this._save_counter>0||this._isInputDisable)){switch(t){case u.DOWN:this._save_select_id-=2,this.cursor_wait();break;case u.UP:this._save_select_id+=2,this.cursor_wait();break;case u.LEFT:this._save_select_id--,this.cursor_wait();break;case u.RIGHT:this._save_select_id++,this.cursor_wait()}this.setSaveID((this._save_select_id+q.QUICK_SAVE_MAX)%q.QUICK_SAVE_MAX)}},Object.defineProperty(t.prototype,"windowName",{get:function(){return"MessageWindow"},enumerable:!1,configurable:!0}),t}(),Bt=function(){function t(t,e,s){this.id=t,this.imgFileName=e,this.parent=s,this.elem=document.createElement("div"),this.elem.classList.add("est"),this.elem.setAttribute("id","wwa-est-"+t),this.imgElem=document.createElement("div"),this.imgElem.classList.add("est-img-wrapper"),this.imgElem.style.backgroundImage="url("+this.imgFileName.replace("(","\\(").replace(")","\\)")+")",this.statusElem=document.createElement("div"),this.statusElem.classList.add("est-status-wrapper"),this.energyElem=document.createElement("div"),this.energyElem.classList.add("est-energy"),this.energyDispElem=document.createElement("span"),this.energyDispElem.classList.add("est-energy-disp"),this.energyElem.appendChild(this.energyDispElem),this.statusElem.appendChild(this.energyElem),this.strengthElem=document.createElement("div"),this.strengthElem.classList.add("est-strength"),this.strengthDispElem=document.createElement("span"),this.strengthDispElem.classList.add("est-strength-disp"),this.strengthElem.appendChild(this.strengthDispElem),this.statusElem.appendChild(this.strengthElem),this.defenceElem=document.createElement("div"),this.defenceElem.classList.add("est-defence"),this.defenceDispElem=document.createElement("span"),this.defenceDispElem.classList.add("est-defence-disp"),this.defenceElem.appendChild(this.defenceDispElem),this.statusElem.appendChild(this.defenceElem),this.damageElem=document.createElement("div"),this.damageElem.classList.add("est-damage"),this.damageDispElem=document.createElement("span"),this.damageDispElem.classList.add("est-damage-disp"),this.damageElem.appendChild(this.damageDispElem),this.statusElem.appendChild(this.damageElem),this.elem.appendChild(this.imgElem),this.elem.appendChild(this.statusElem)}return t.prototype.hide=function(){this.elem.style.display="none"},t.prototype.show=function(){this.elem.style.display="block"},t.prototype.setResult=function(t,e,s){this.imgElem.style.backgroundPosition="-"+t.x+"px -"+t.y+"px",this.energyDispElem.textContent="生命力 "+e.energy,this.strengthDispElem.textContent="攻撃力 "+e.strength,this.defenceDispElem.textContent="防御力 "+e.defence,s.isNoEffect?this.damageDispElem.textContent="攻撃無効":s.isOverMaxTurn?this.damageDispElem.textContent="長期戦が予想されます":this.damageDispElem.textContent="予測ダメージ "+s.damage},t}(),xt=function(){function t(t,e,s){var a,i=this;this._wwa=t,this._imgFileName=e,this._parent=s,this._element=document.createElement("div"),this._element.setAttribute("id","wwa-battle-estimate"),this._element.style.display="none",this._edes=[];for(var o=0;o<Q.BATTLE_ESTIMATE_MONSTER_TYPE_MAX;o++)a=new Bt(o,this._imgFileName,this._element),this._edes.push(a),this._element.appendChild(a.elem);this._element.addEventListener("click",(function(){i._wwa.hideBattleEstimateWindow()})),this._parent.appendChild(this._element)}return t.prototype.update=function(t,e){for(var s=0;s<Q.BATTLE_ESTIMATE_MONSTER_TYPE_MAX;s++)if(s>=e.length)this._edes[s].hide();else{var a=this._wwa.getObjectAttributeById(e[s],Q.ATR_X),i=this._wwa.getObjectAttributeById(e[s],Q.ATR_Y),o=new w(a,i),r=this._wwa.getObjectAttributeById(e[s],Q.ATR_ENERGY),n=this._wwa.getObjectAttributeById(e[s],Q.ATR_STRENGTH),_=this._wwa.getObjectAttributeById(e[s],Q.ATR_DEFENCE),h=new E(r,n,_,0),c=Wt(t,h);this._edes[s].setResult(o,h,c),this._edes[s].show()}},t.prototype.show=function(){this._element.style.display="block"},t.prototype.hide=function(){this._element.style.display="none"},t}(),Ut=function(t,e,s){this.isNoEffect=t,this.isOverMaxTurn=e,this.damage=s};function Wt(t,e){var s=e.energy,a=t.strength-e.defence,i=Math.max(0,e.strength-t.defence),o=0,r=0;if(!(a>0))return new Ut(!0,!1,0);for(;;){if(o++,(s-=a)<=0)return new Ut(!1,!1,r);if(r+=i,o>1e4)return new Ut(!1,!0,0)}}!function(t){t[t.SAVE=0]="SAVE",t[t.LOAD=1]="LOAD"}(Lt||(Lt={}));var Yt=function(){function t(t,e,s){var a=this;this._wwa=t,this._parent=e,this._isDisallowLoadOldSave=s,this._element=document.createElement("div"),this._element.setAttribute("id","wwa-password-window"),this._element.style.display="none",this._descriptionElement=document.createElement("div"),this._descriptionElement.classList.add("wwa-password-description"),this._passwordBoxElement=document.createElement("textarea"),this._passwordBoxElement.setAttribute("cols","50"),this._passwordBoxElement.setAttribute("rows","16"),this._passwordBoxElement.addEventListener("focus",(function(t){a._passwordBoxElement.select()})),this._buttonWrapperElement=document.createElement("div"),this._buttonWrapperElement.classList.add("wwa-password-submit"),this._okButtonElement=document.createElement("button"),this._okButtonElement.textContent="OK",this._okButtonElement.addEventListener("click",(function(){a._wwa.hidePasswordWindow()})),this._cancelButtonElement=document.createElement("button"),this._cancelButtonElement.textContent="キャンセル",this._cancelButtonElement.addEventListener("click",(function(){a._wwa.hidePasswordWindow(!0)})),this._buttonWrapperElement.appendChild(this._okButtonElement),this._buttonWrapperElement.appendChild(this._cancelButtonElement),this._mode=Lt.LOAD,this._element.appendChild(this._descriptionElement),this._element.appendChild(this._passwordBoxElement),this._element.appendChild(this._buttonWrapperElement),this._parent.appendChild(this._element),this.update()}return Object.defineProperty(t.prototype,"mode",{get:function(){return this._mode},set:function(t){this._mode=t,t===Lt.LOAD&&(this.password="")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"password",{get:function(){return this._passwordBoxElement.value},set:function(t){this._passwordBoxElement.value=t},enumerable:!1,configurable:!0}),t.prototype.show=function(t){void 0!==t&&(this.mode=t),this._isVisible=!0,this.update()},t.prototype.hide=function(){this._isVisible=!1,this.update()},t.prototype.update=function(){var t,e="";if(this._mode===Lt.LOAD){t=this._isDisallowLoadOldSave,e="下のボックスに前回のプレイで取得した\n復帰用パスワードを貼り付けてください。\nJava 版 WWA で取得したパスワードはご利用になれません。\n作成者が ".concat(t?"マップの内容":"ワールド名 か マップの暗証番号"," を変更した場合は\nそれ以前に取得したパスワードは使えなくなります。");try{this._passwordBoxElement.removeAttribute("readonly")}catch(t){}this._cancelButtonElement.style.display="inline"}else e="下記テキストがデータ復帰用のパスワードになっています。\nコピーしてメモ帳などのテキストエディタに貼り付けて\n保存してください。",this._passwordBoxElement.setAttribute("readonly","readonly"),this._cancelButtonElement.style.display="none";var s=e.split("\n");this._descriptionElement.textContent="";for(var a=0;a<s.length;a++){var i=document.createElement("span");i.textContent=s[a],this._descriptionElement.appendChild(i),this._descriptionElement.appendChild(document.createElement("br"))}this._isVisible?this._element.style.display="block":this._element.style.display="none"},t}();function kt(t,e){var s,a,i=document.createElement("style");i.type="text/css",i.setAttribute("id",Q.WWA_STYLE_TAG_ID),(s="head",document.getElementsByTagName(s))[0].appendChild(i),t.innerHTML=(a=null!==e?'\n <div id="wwa-cover">\n <div id="version"></div>\n <div id="progress-message-container">開始しています...</div>\n <div id="progress-bar-bg"></div>\n <div id="progress-bar" class="progress-bar"></div>\n <div id="progress-bar-audio" class="progress-bar"></div>\n <div id="progress-disp">---</div>\n </div>\n ':'\n <div id="wwa-cover">\n <canvas id="progress-panel" width="'.concat(Q.SCREEN_WIDTH,'" height="').concat(Q.SCREEN_HEIGHT,'"></canvas>\n </div>'),'\n <canvas id="wwa-map" class="wwa-canvas" width="440" height="440">\n このブラウザは、Canvas要素をサポートしていません。\n </canvas>\n <canvas id="wwa-map-sub" class="wwa-canvas" width="440" height="440"></canvas>\n <div id="wwa-sidebar">\n <div class="wide-cell-row" id="disp-energy"><div class="status-icon"></div><div class="status-value-box">0</div></div>\n <div class="wide-cell-row" id="disp-strength"><div class="status-icon"></div><div class="status-value-box"> 0 </div></div>\n <div class="wide-cell-row" id="disp-defence"><div class="status-icon"></div><div class="status-value-box">0</div></div>\n <div class="wide-cell-row" id="disp-gold"><div class="status-icon"></div><div class="status-value-box">0</div></div>\n <div class="item-cell" id="item0"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item1"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item2"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item3"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item4"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item5"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item6"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item7"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item8"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item9"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item10"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="item-cell" id="item11"><div class="item-click-border"></div><div class="item-disp"></div></div>\n <div class="wide-cell-row" id="cell-load">Password</div><div class="wide-button" id="button-load"></div>\n <div class="wide-cell-row" id="cell-save">Quick Save</div><div class="wide-button" id="button-save"></div>\n <div class="wide-cell-row" id="cell-restart">Restart Game</div><div class="wide-button" id="button-restart"></div>\n <div class="wide-cell-row" id="cell-gotowwa">Goto WWA</div><div class="wide-button" id="button-gotowwa"></div>\n </div>\n <div id="wwa-controller"></div>\n <div id="wwa-fader"></div>\n'.concat(a,'\n <div id="wwa-audio-wrapper"></div>')),null!==e&&(_t("wwa-cover").style.backgroundImage="url(".concat(e,")"),_t("wwa-cover").style.backgroundRepeat="no-repeat",_t("wwa-cover").style.backgroundPosition="0 0")}var Ft=function(){function t(){this.allClear()}return t.prototype.update=function(){this.counter>0&&this.counter--},t.prototype.cursor_wait=function(){this.counter=Q.CONTROLL_WAIT_FRAME},t.prototype.allClear=function(){this.col=0,this.row=0,this.counter=0},t.prototype.controll=function(e){if(!(this.counter>0))switch(e){case u.DOWN:this.row<t.ROW_MAX-1&&(this.row++,this.openView(),this.cursor_wait());break;case u.UP:this.row>0&&(this.row--,this.openView(),this.cursor_wait());break;case u.LEFT:this.col>0&&(this.col--,this.openView(),this.cursor_wait());break;case u.RIGHT:this.col<t.COL_MAX-1&&(this.col++,this.openView(),this.cursor_wait())}},t.prototype.ok=function(){this.close();var e=null;(e=ct(t.CLICK_DOM_QUERY_TABLE[this.row][this.col])).classList.contains("item-click-border")||this.allClear();var s=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0});return e.dispatchEvent(s)},t.prototype.ng=function(){this.close()},t.prototype.close=function(){var e,s,a=null;for(e=0;e<t.COL_MAX;e++)for(s=0;s<t.ROW_MAX;s++)(a=_t(t.DOM_ID_TABLE[s][e])).classList.contains("onpress")&&a.classList.remove("onpress")},t.prototype.openView=function(){this.close();_t(t.DOM_ID_TABLE[this.row][this.col]).classList.add("onpress")},t.prototype.init=function(){this.allClear(),this.openView()},t.ROW_MAX=8,t.COL_MAX=3,t.DOM_ID_TABLE=[["item0","item1","item2"],["item3","item4","item5"],["item6","item7","item8"],["item9","item10","item11"],["cell-load","cell-load","cell-load"],["cell-save","cell-save","cell-save"],["cell-restart","cell-restart","cell-restart"],["cell-gotowwa","cell-gotowwa","cell-gotowwa"]],t.CLICK_DOM_QUERY_TABLE=[["#item0 .item-click-border","#item1 .item-click-border","#item2 .item-click-border"],["#item3 .item-click-border","#item4 .item-click-border","#item5 .item-click-border"],["#item6 .item-click-border","#item7 .item-click-border","#item8 .item-click-border"],["#item9 .item-click-border","#item10 .item-click-border","#item11 .item-click-border"],["#button-load","#button-load","#button-load"],["#button-save","#button-save","#button-save"],["#button-restart","#button-restart","#button-restart"],["#button-gotowwa"," #button-gotowwa","#button-gotowwa"]],t}(),Gt=s(23);function Ht(t){return"^ /".concat(231*t+8310,"P+>A[]")}function Kt(t){return(0,Gt.MD5)(t).toString()}var Vt="map",jt="mapObject",Xt="systemMessage",Jt="userVar",Zt={mapAttribute:!0,objectAttribute:!0,message:!0},Qt=function(){},qt=function(){function t(){}return t.compress=function(t){var e,s,a={};for(e in t)if(!Zt[e]){switch(typeof(s=t[e])){case"number":case"string":case"boolean":if(this._restartData[e]===s&&"worldName"!==e)continue;break;case"object":if(null===s){if(this._restartData[e]===s)continue}else if(void 0===(s=this.compressObject(e,s,this._restartData[e])))continue;break;case"undefined":break;case"function":continue}a[e]=s}return a},t.compressObject=function(t,e,s){var a,i,o,r;switch(t){case Vt:case jt:var n,_,h,c,u,l,p,d,E,w,y,m,f,g;for(u in a={},E={},d={},e)for(c in i=e[u],o=s[u],r={},_=-1,i)(p=i[c])!==o[c]&&(r[c]=p,void 0===E[p]&&(E[p]={}),void 0===(y=E[p])[u]&&(y[u]=[]),(f=y[u]).push(Number(c)));for(m in E)for(u in y=E[m],void 0===d[m]&&(d[m]={}),w=d[m],void 0===a[m]&&(a[m]=[]),_=-1,y)1===(f=y[u]).length?(void 0===w[l=f[0]]&&(w[l]=[]),(g=w[l]).push(Number(u))):(h=(n=Number(u))-_-1,_=n,a[m].push(this.getCompressArray(f),h));for(m in d)for(c in p=Number(m),_=-1,w=d[m])g=w[c],h=(n=Number(c))-_-1,_=n,1===g.length?a[m].push(h,g[0]):a[m].push(h,this.getCompressArray(g));var A=[];for(m in _=-1,a)h=(n=Number(m))-_-1,_=n,A.push(h,a[m]);return this._usingByteFlag&&JSON.stringify(A).length>=this._mapByteLength?this.compressMapAllObject(e,s,this._firstRandomMapObjectUtf8Table[t]):A;case Xt:var S;for(t in a={},e)S=e[t],s[t]!==S&&(a[t]=S);break;case Jt:return this.compressUserVars(e);default:return e}if(0!==Object.keys(a).length)return a},t.compressUserVars=function(t){return t.map((function(t,e){return[e,t]})).filter((function(t){t[0];return 0!==t[1]}))},t.compressMapAllObject=function(t,e,s){var a,i,o,r,n,_,h,c,u,l,p,d,E,w,y,m,f=this._restartData.mapWidth,g=new Uint8Array(this._mapByteLength),A=-1;for(o=0,r=0,_=0,h=0,y=0,p=[],w={},u=[],l=[],i=0;i<f;i++)for(a=0;a<f;a++)(c=t[i][a])!==e[i][a]&&(-1===A&&(A=r),g[r]=g[r]|1<<o,_=r,void 0===w[c]&&(w[c]=new zt(c,y++)),w[c].count++),8===++o&&(o=0,r++);for(n in w)p[w[n].index]=w[n];for(d in p.sort(this.idSort),E={},p)E[c=p[d].id]=Number(d),u[d]=c;for(i=0;i<f;i++)for(a=0;a<f;a++)(c=t[i][a])!==e[i][a]&&(l[h++]=E[c]);if(s){for(m=g.length,A=-1,_=0,r=0;r<m;r++)g[r]=g[r]&~s[r],0!==g[r]&&(-1===A&&(A=r),_=r);-1===A&&(A=0,_=0)}return[A,g.subarray(A,_+1),u,this.indexListCompress(l,u.length)]},t.indexListCompress=function(t,e){var s,a,i,o,r,n,_=[];for(o=t.length,a=0,s=0;s<o;s++){for(r=t[s],n=0,i=s+1;i<o&&r===t[i];i++)n++,s=i;switch(n){case 0:_[a++]=r;break;case 1:_[a++]=r,_[a++]=r;break;default:_[a++]=r,_[a++]=e+n}}return _},t.idSort=function(t,e){return e.count-t.count},t.getCompressArray=function(t){var e,s,a,i,o,r,n,_,h=[];for(e=-1,o=t.length,r=0,i=0;i<o;i++){for(s=(a=t[i])-e,n=0,_=i;_<o-1&&t[_]+1===t[_+1];)_++,n++;n<this.MIN_LOOP_COUNT?h[r++]=s:(i=_,a+=n,h[r++]=0,h[r++]=s,h[r++]=n-this.MIN_LOOP_COUNT),e=a}return h},t.getDecompressArray=function(t){var e,s,a,i,o,r,n,_=[];for(e=-1,o=t.length,i=0,n=0;i<o;i++)if(0===(s=t[i])){for(r=(a=e+(s=t[++i]))+t[++i]+this.MIN_LOOP_COUNT;a<=r;a++)_[n++]=a;e=r}else a=e+s,_[n++]=a,e=a;return _},t.decompress=function(t){var e,s,a;for(s in e=JSON.parse(JSON.stringify(this._restartData)),t){switch(typeof(a=t[s])){case"number":case"string":case"boolean":case"undefined":break;case"object":null!==a&&(a=this.decompressObject(s,a,e[s]));break;case"function":continue}e[s]=a}return[e,{isWorldNameEmpty:void 0===t.worldName}]},t.decompressObject=function(t,e,s){var a;switch(t){case Vt:case jt:var i,o,r,n,_,h,c,u;a={},o=-1;var l,p,d=e;if(4===(u=d.length)&&"number"==typeof d[0]&&(d[1]instanceof Uint8Array||d[1]instanceof Array)&&d[2]instanceof Array&&d[3]instanceof Array)return this.decompressAllMapObject(d,s,this._firstRandomMapObjectUtf8Table[t]),s;for(c=0;c<u;c+=2)o=i=o+Number(d[c])+1,_=i,a[i]=d[c+1];for(h in a){for(_=Number(h),u=(d=a[h]).length,l=[],p=[],c=0;c<u;c+=2){var E=d[c],w=d[c+1];E instanceof Array&&(E=this.getDecompressArray(E)),w instanceof Array&&(w=this.getDecompressArray(w)),"object"==typeof E?l.push({x:E,y:w}):p.push({x:E,y:w})}var y;for(y in o=-1,l)if(o=i=o+Number(l[y].y)+1,E=l[y].x,n=String(i),E instanceof Array)for(u=(d=E).length,c=0;c<u;c++)r=String(d[c]),s[n][r]=_;else r=String(E),s[n][r]=_;for(y in o=-1,p)if(o=i=o+Number(p[y].x)+1,w=p[y].y,r=String(i),w instanceof Array)for(u=(d=w).length,c=0;c<u;c++)s[n=String(d[c])][r]=_;else s[n=String(w)][r]=_}return s;case Jt:return this.decompressUserVars(e);default:if(s);else{if(!e)return;s=s instanceof Array?[]:{}}for(t in e)s[t]=e[t];return s}},t.decompressUserVars=function(t){return t.reduce((function(t,e){var s=e[0],a=e[1];return t[s]=a,t}),this.generateEmptyUserVars())},t.generateEmptyUserVars=function(){for(var t=new Array(Q.USER_VAR_NUM),e=0;e<Q.USER_VAR_NUM;e++)t[e]=0;return t},t.decompressAllMapObject=function(t,e,s){var a,i,o,r,n,_,h,c,u,l,p,d=this._restartData.mapWidth,E=new Uint8Array(this._mapByteLength);p=t[0],r=t[2],i=t[3];var w=t[1];if(E.set(w,p),s)for(y=E.length,u=0;u<y;u++)E[u]=E[u]|s[u];o=[];var y,m,f,g,A,S,I=r.length;for(y=i.length,m=0,f=0;m<y;m++){if((n=i[m])>=I)for(g=n-I,A=0;A<g;A++)o[f++]=S;else o[f++]=n;S=n}for(c=0,u=0,l=0,_=0,y=E.length,u=0;u<y;u++)for(c=0;c<8;c++){if(0!=(E[u]&1<<c)){if(void 0===(n=o[_++]))return!1;a=r[n],h=l%d,e[l/d|0][h]=a}l++}return!0},t.setRestartData=function(t,e){this._restartData=t,this._mapByteLength=Math.ceil(t.mapWidth*t.mapWidth/8),this._firstRandomMapObjectUtf8Table[jt]=this.getChangedUint8Array(e[jt],t[jt])},t.getChangedUint8Array=function(t,e){var s,a,i,o,r=this._restartData.mapWidth,n=new Uint8Array(this._mapByteLength),_=-1;for(i=0,o=0,a=0;a<r;a++)for(s=0;s<r;s++)t[a][s]!==e[a][s]&&(-1===_&&(_=o),n[o]=n[o]|1<<i),8===++i&&(i=0,o++);return n},t.getStartWWAData=function(t){if(!t)return this._restartData;try{var e=JSON.parse(t)}catch(t){return this._restartData}var s;if(e)try{if(s=this.decompress(e)[0])return s}catch(t){}return this._restartData},t.usingByte=function(t){this._usingByteFlag=t},t._usingByteFlag=!1,t.MIN_LOOP_COUNT=3,t._restartData=void 0,t._mapByteLength=0,t._firstRandomMapObjectUtf8Table=new Qt,t}(),zt=function(t,e){this.id=0,this.index=0,this.count=0,this.id=t,this.index=e},$t=function(){function t(t,e){this._id=0,this.flag=!1,this.date=void 0,this.cvs=void 0,this.ctx=void 0,this.quickSaveData=void 0,this._id=t,this._parent=e,this.cvs=document.createElement("canvas"),this.cvs.width=q.QUICK_SAVE_THUMNAIL_WIDTH,this.cvs.height=q.QUICK_SAVE_THUMNAIL_HEIGHT,this.ctx=this.cvs.getContext("2d",{alpha:!1})}return t.prototype.showQickLoad=function(){_t("cell-load").textContent=z.QUICK_LOAD},t.prototype.save=function(t,e){return this._statusEnergy=e.statusEnergy,this.ctx.clearRect(0,0,this.cvs.width,this.cvs.height),this.ctx.drawImage(t,0,0,t.width,t.height,0,0,this.cvs.width,this.cvs.height),this.quickSaveData=e,this.flag=!0,this.date=new Date,this.showQickLoad(),!0},t.prototype.getStatusEnergy=function(){return this.flag?this._statusEnergy:-1},t.prototype.load=function(){return this.quickSaveData},t.prototype.saveDataSet=function(t,e,s){var a=this;try{this.quickSaveData=e,this._statusEnergy=e.statusEnergy,this.date=s,this.flag=!0;var i=document.createElement("img");i.src=t,i.addEventListener("load",(function(){a.flag=!0,a.ctx.drawImage(i,0,0,i.width,i.height,0,0,a.cvs.width,a.cvs.height)})),this.showQickLoad()}catch(t){}},t.prototype.getDateText=function(){var t,e,s,a,i,o;return this.date?(t=this.date.getFullYear(),e=this.date.getMonth()+1,s=this.date.getDate(),a=this.date.getHours(),i=this.date.getMinutes(),o=this.date.getSeconds(),(t=("000"+t).slice(-4))+"/"+(e=("0"+e).slice(-2))+"/"+(s=("0"+s).slice(-2))+" "+(a=("0"+a).slice(-2))+":"+(i=("0"+i).slice(-2))+":"+(o=("0"+o).slice(-2))):""},t.prototype.isLastSaveData=function(){return this===this._parent.getLastSaveData()},t}(),te=function(){var t=function(e,s){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},t(e,s)};return function(e,s){if("function"!=typeof s&&null!==s)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function a(){this.constructor=e}t(e,s),e.prototype=null===s?Object.create(s):(a.prototype=s.prototype,new a)}}(),ee=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return te(e,t),e.prototype.save=function(e,s){var a=t.prototype.save.apply(this,arguments);return this._parent.dbUpdateSaveData(this._id,e,s,this.date),a},e}($t),se=ee,ae=function(){var t=function(e,s){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},t(e,s)};return function(e,s){if("function"!=typeof s&&null!==s)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function a(){this.constructor=e}t(e,s),e.prototype=null===s?Object.create(s):(a.prototype=s.prototype,new a)}}(),ie=function(t){function e(){var s=t.call(this)||this;return Object.setPrototypeOf(s,Object.create(e.prototype)),s}return ae(e,t),e.prototype.hasSaveData=function(){for(var t=0;t<q.QUICK_SAVE_MAX;t++)if(this[t].flag)return!0;return!1},e.prototype.getLastSaveData=function(){for(var t,e,s=0;s<q.QUICK_SAVE_MAX;s++)(e=this[s]).flag&&(t?e.date&&t.date&&e.date.getTime()>t.date.getTime()&&(t=e):t=e);return t},e}(Array),oe=function(){var t=function(e,s){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},t(e,s)};return function(e,s){if("function"!=typeof s&&null!==s)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function a(){this.constructor=e}t(e,s),e.prototype=null===s?Object.create(s):(a.prototype=s.prototype,new a)}}(),re=function(t){function e(s,a,i){void 0===i&&(i=e.prototype);var o=t.call(this)||this;o.selectLoad=!1,o.indexedDB=window.indexedDB||window.webkitIndexedDB||window.mozIndexedDB,o.IDBTransaction={READ_ONLY:"readonly",READ_WRITE:"readwrite",VERSION_CHANGE:"versionchangetransaction"},o.keyPath=["id","url"],Object.setPrototypeOf(o,Object.create(i));for(var r=0;r<q.QUICK_SAVE_MAX;r++)o[r]=new se(r,o);if(o.indexedDB)try{o.indexedDB.open||(o.indexedDB=null)}catch(t){o.indexedDB=null}try{o.indexedDB.open("test").error&&(o.indexedDB=null)}catch(t){}return o.indexedDB?(o.onCheckLoadingSaveData=s,o.onCompleteLoadingSaveData=a,o.createDataBase(),o.selectSaveData(),o):o}return oe(e,t),e.prototype.getAlEmulate=function(){var t=function(t){var e=this.openCursor(t),s=[],a={onsuccess:null,onerror:null};return e.onsuccess=function(t){var e=t.target.result;if(null===e){var i={target:{result:s}};"function"==typeof a.onsuccess&&a.onsuccess(i)}else s.push(t.target.result.value),e.continue()},e.onerror=function(t){"function"==typeof a.onerror&&a.onerror(t)},a};void 0===window.IDBIndex.prototype.getAll&&(window.IDBIndex.prototype.getAll=t),void 0===window.IDBObjectStore.prototype.getAll&&(window.IDBObjectStore.prototype.getAll=t)},e.prototype.indexDBOpen=function(){return this.getAlEmulate(),this.indexedDB.open(q.INDEXEDDB_DB_NAME,201205201)},e.prototype.createDataBase=function(){var t=this;try{var s=this.indexDBOpen();s.onupgradeneeded=function(e){var a=s.result,i={keyPath:t.keyPath};a.objectStoreNames.contains(q.INDEXEDDB_TABLE_NAME)||a.createObjectStore(q.INDEXEDDB_TABLE_NAME,i).createIndex("url","url",{unique:!1})},s.onsuccess=e.doNotAnything,s.onerror=e.doNotAnything,s.onblocked=function(e){t.indexedDB=null}}catch(t){}},e.prototype.getObjectStore=function(t){var e=t;try{var s=e.transaction(q.INDEXEDDB_TABLE_NAME,this.IDBTransaction.READ_WRITE).objectStore(q.INDEXEDDB_TABLE_NAME)}catch(t){return}return s},e.prototype.makeSaveDataItem=function(t,e,s,a){return{url:location.href,id:t,hash:ye.checkOriginalMapString,image:e.toDataURL(),data:s,date:a,worldName:ye.worldName,mapDataRevisionKey:ye.mapDataRevisionKey}},e.prototype.getSaveDataResult=function(t,e){var s=this,a=t.index("url"),i=IDBKeyRange.only(location.href),o=a.getAll(i);o.onsuccess=function(){e(o.result)},o.onerror=function(){s.indexedDB=null}},e.prototype.dbUpdateSaveData=function(t,s,a,i){var o=this;if(this.indexedDB){var r=this.indexDBOpen();r.onupgradeneeded=e.doNotAnything,r.onsuccess=function(n){var _=o.getObjectStore(r.result),h=qt.compress(a),c=o.makeSaveDataItem(t,s,h,i);o.selectDatas[t]=c;try{var u=_.put(c)}catch(t){return}u.onsuccess=e.doNotAnything,u.onerror=e.doNotAnything},r.onerror=e.doNotAnything,r.onblocked=e.doNotAnything}},e.prototype.dbDeleteSaveData=function(t){var s=this;if(this.indexedDB){var a=this.indexDBOpen();a.onupgradeneeded=e.doNotAnything,a.onsuccess=function(){var e=s.getObjectStore(a.result);t.forEach((function(t){e.delete([t,location.href])}))},a.onerror=e.doNotAnything,a.onblocked=e.doNotAnything}},e.prototype.selectSaveData=function(){var t=this;if(this.indexedDB){var s=this.indexDBOpen();s.onupgradeneeded=e.doNotAnything,s.onsuccess=function(){var e=t.getObjectStore(s.result);t.selectDatas=[],t.selectLoad=!1;t.getSaveDataResult(e,(function(e){var s,a,i,o=[];for(a=e.length,s=0;s<a;s++){var r=e[s];try{i={id:r.id,hash:r.hash,data:r.data,date:r.date,image:r.image,worldName:r.worldName,mapDataRevisionKey:r.mapDataRevisionKey}}catch(t){continue}var n=t.onCheckLoadingSaveData(i.worldName,i.hash,i.mapDataRevisionKey);if(null===n){if(t[i.id]){var _=qt.decompress(i.data)[0];t[i.id].saveDataSet(i.image,_,i.date)}}else o.push({id:i.id,cause:n})}o.length>0&&t.dbDeleteSaveData(o.map((function(t){return t.id}))),t.selectLoad=!0;var h=o.map((function(t){return t.cause})).filter((function(t,e,s){return s.indexOf(t)===e}));t.onCompleteLoadingSaveData(h)}))},s.onerror=e.doNotAnything,s.onblocked=e.doNotAnything}},e.doNotAnything=function(){},e}(ie),ne=function(){var t=function(e,s){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},t(e,s)};return function(e,s){if("function"!=typeof s&&null!==s)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function a(){this.constructor=e}t(e,s),e.prototype=null===s?Object.create(s):(a.prototype=s.prototype,new a)}}(),_e=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ne(e,t),e}($t),he=_e,ce=function(){var t=function(e,s){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},t(e,s)};return function(e,s){if("function"!=typeof s&&null!==s)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function a(){this.constructor=e}t(e,s),e.prototype=null===s?Object.create(s):(a.prototype=s.prototype,new a)}}(),ue=function(t){function e(){var s=t.call(this)||this;s._saveNo=0,s._lastAutoSaveMove=0,s._autoInterval=q.SAVE_INTERVAL_MOVE,Object.setPrototypeOf(s,Object.create(e.prototype));for(var a=0;a<q.QUICK_SAVE_MAX;a++)s[a]=new he(a,s);return s._saveNo=0,s._lastAutoSaveMove=0,s}return ce(e,t),e.prototype.resumeStart=function(){this._lastAutoSaveMove=-1},e.prototype.setPlayer=function(t){this._lastAutoSaveMove=t.getMoveCount()},e.prototype.isAutoSaveFrame=function(t){if(0===this._autoInterval)return!1;var e=t.getMoveCount();return!(this._lastAutoSaveMove>=e)&&(e%this._autoInterval==0&&(this._lastAutoSaveMove=e,!0))},e.prototype.autoSave=function(t,e){this[this._saveNo].save(t,e),this._saveNo++,this._saveNo=this._saveNo%q.QUICK_SAVE_MAX},e.prototype.setAutoSaveInterval=function(t){t<0?console.warn("オートセーブの歩数 (".concat(t,") に負の値が設定されています。")):this._autoInterval=0|t},e}(ie),le=function(){var t=function(e,s){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},t(e,s)};return function(e,s){if("function"!=typeof s&&null!==s)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function a(){this.constructor=e}t(e,s),e.prototype=null===s?Object.create(s):(a.prototype=s.prototype,new a)}}(),pe=function(t){function e(s,a){var i=t.call(this,s,a,e.prototype)||this;return i.keyPath="urlWithId",i}return le(e,t),e.prototype.makeSaveDataItem=function(t,e,s,a){return{url:location.href,id:t,hash:ye.checkOriginalMapString,image:e.toDataURL(),data:s,date:a,worldName:ye.worldName,urlWithId:location.href+" "+t,mapDataRevisionKey:ye.mapDataRevisionKey}},e.prototype.getSaveDataResult=function(t,e){for(var s=[],a=0,i=function(i){var o=t.get(location.href+" "+i);o.onsuccess=function(){s.push(o.result),++a>=q.QUICK_SAVE_MAX&&e(s)},o.onerror=function(){s.push(null),++a>=q.QUICK_SAVE_MAX&&e(s)}},o=0;o<q.QUICK_SAVE_MAX;o++)i(o)},e}(re);function de(t,e){return(0,Gt.MD5)(t+e).toString()}var Ee,we=function(){function t(e,s,a,i,o){t.checkOriginalMapString=e.checkOriginalMapString,t.worldName=s,t.mapDataRevisionKey=de(s,a),e.userDevice.browser===M.INTERNET_EXPLORER?this._wwaDBSaveList=new pe(i,o):this._wwaDBSaveList=new re(i,o),this._wwaLogSaveList=new ue,this.selectDBSaveDataList()}return t.prototype.resumeStart=function(){this._wwaLogSaveList.resumeStart()},t.prototype.isAutoSaveFrame=function(t){return this._wwaLogSaveList.isAutoSaveFrame(t)},t.prototype.autoSave=function(t,e){this._wwaLogSaveList.autoSave(t,e)},t.prototype.selectDBSaveDataList=function(){this.list=this._wwaDBSaveList},t.prototype.selectLogSaveDataList=function(){this.list=this._wwaLogSaveList},t.prototype.save=function(t,e,s){var a=this.list[s];return!!a&&a.save(t,e)},t.prototype.load=function(t){var e=this.list[t];return e?e.load():null},t.prototype.hasSaveData=function(){return this.list.hasSaveData()},t.prototype.setAutoSaveInterval=function(t){return this._wwaLogSaveList.setAutoSaveInterval(t)},t.prototype.getFirstSaveChoiceCallInfo=function(t){return t?N.CALL_BY_PASSWORD_LOAD:this._wwaDBSaveList.hasSaveData()?N.CALL_BY_QUICK_LOAD:this._wwaLogSaveList.hasSaveData()?N.CALL_BY_LOG_QUICK_LOAD:N.CALL_BY_PASSWORD_LOAD},t.prototype.getSecondSaveChoiceCallInfo=function(t){return this.list===this._wwaDBSaveList&&this._wwaLogSaveList.hasSaveData()?N.CALL_BY_LOG_QUICK_LOAD:t?N.CALL_BY_PASSWORD_LOAD:N.NONE},t.prototype.gameStart=function(t,e){this._wwaLogSaveList.setPlayer(e),this.quickSaveButtonUpdate(t)},t.prototype.quickSaveButtonUpdate=function(t){t.disableSaveFlag?_t("cell-save").textContent=z.EMPTY_SAVE:_t("cell-save").textContent=z.QUICK_SAVE},t}(),ye=we;!function(t){t.UNMATCHED_WORLD_NAME="UNMATCHED_WORLD_NAME",t.UNMATCHED_WORLD_PASS_NUMBER="UNMATCHED_WORLD_PASS_NUMBER",t.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA="DISALLOW_OLD_REVISION_WORLD_SAVE_DATA"}(Ee||(Ee={}));var me,fe=function(){function t(t){this.idx=t}return t.prototype.play=function(){},t.prototype.pause=function(){},t.prototype.isBgm=function(){return this.idx>=K.BGM_LB},t.prototype.hasData=function(){return!1},t.prototype.isError=function(){return!0},t}(),ge=function(){var t=function(e,s){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},t(e,s)};return function(e,s){if("function"!=typeof s&&null!==s)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function a(){this.constructor=e}t(e,s),e.prototype=null===s?Object.create(s):(a.prototype=s.prototype,new a)}}(),Ae=function(t){function e(e,s,a,i){var o=t.call(this,e)||this;return o.audioContext=a,o.audioGain=i,o.audioBuffer=null,o.bufferSources=[],o.isLoaded=!1,o.pos=0,o._load(e,s),o}return ge(e,t),e.prototype._load=function(t,e){var s=this,a=this.audioContext,i=new XMLHttpRequest,o=0;i.responseType="arraybuffer",i.addEventListener("load",(function(r){var n=i.status;if(0!==n&&200!==n)return console.warn("サウンド ".concat(t," 番の音声ファイルが見つかりません! HTTPエラー番号: ").concat(n)),void s._cancelLoad();a.decodeAudioData(i.response,(function(a){if(0===a.length){if(!(o>10))return setTimeout((function(){s._load(t,e)}),100),void o++;console.log("error audio file! ".concat(e," buffer size ").concat(a.length))}s._setData(a)}))})),i.open("GET",e,!0),i.send("")},e.prototype._setData=function(t){this.audioBuffer=t,this.isLoaded=!0},e.prototype._cancelLoad=function(){this.audioBuffer=null,this.isLoaded=!0},e.prototype.play=function(){var t=this;this.pos=0;var e=this.audioContext.createBufferSource();this.bufferSources.push(e),e.buffer=this.audioBuffer,this.isBgm()&&(e.loop=!0),e.connect(this.audioGain);var s=e.duration;(!isFinite(s)||s<0||"number"!=typeof s)&&(s=0),e.start(0,this.pos*s),e.onended=function(){var s=t.bufferSources.indexOf(e);-1!==s&&t.bufferSources.splice(s,1);try{e.stop(),e.disconnect(t.audioGain),e.buffer=null}catch(t){}e.onended=null},this.audioGain.connect(this.audioContext.destination)},e.prototype.pause=function(){var t=this;this.bufferSources.forEach((function(e){try{e.stop(),e.disconnect(t.audioGain),e.buffer=null}catch(t){}e.onended=null})),this.bufferSources.length=0},e.prototype.hasData=function(){return null!==this.audioBuffer},e.prototype.isLoading=function(){return!this.isLoaded},e.prototype.isError=function(){return this.isLoaded&&null===this.audioBuffer},e}(fe),Se=function(){var t=function(e,s){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},t(e,s)};return function(e,s){if("function"!=typeof s&&null!==s)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function a(){this.constructor=e}t(e,s),e.prototype=null===s?Object.create(s):(a.prototype=s.prototype,new a)}}(),Ie=function(t){function e(e,s,a){var i=t.call(this,e)||this;return i._mainElement=i._createElement(s),i._mainElement.addEventListener("error",(function(){console.warn("サウンド ".concat(e," 番の音声ファイルが見つかりません!"))})),i._subElement=i.isBgm()?null:i._createElement(s),i._currentElement=i._mainElement,i._nextIsSub=!0,a.appendChild(i._mainElement),i}return Se(e,t),e.prototype._createElement=function(t){var e=new Audio(t);return e.preload="auto",e.loop=this.isBgm(),e},e.prototype.play=function(){this._currentElement.currentTime=0,this._currentElement.play(),this.isBgm()||(this._currentElement=this._nextIsSub?this._subElement:this._mainElement,this._nextIsSub=!this._nextIsSub)},e.prototype.pause=function(){this._currentElement.pause()},e.prototype.hasData=function(){return this._mainElement.readyState>=2},e.prototype.isError=function(){return null!==this._mainElement.error},e}(fe),Te=function(t,e){for(var s=new Array(t),a=0;a<s.length;a++)s[a]=new Array(e);return s};function Oe(t,e){var s=function(t){return t[me.CHECK]+256*t[me.CHECK+1]}(t),a=function(t,e){var s,a=0;if(t[me.VERSION]>=29){for(var i=2;i<e;i++)a+=(s=t[i],((s%=256)>=128?s-256:s)*(i%8+1));a=a%65536&65535}return a}(t,e);if(s!==a)throw new Error("マップデータが壊れているようです。\n チェックサムの値は"+s+"ですが、実際の和は"+a+"でした。")}!function(t){t[t.CHECK=0]="CHECK",t[t.VERSION=2]="VERSION",t[t.OLD_MAP_COUNT=3]="OLD_MAP_COUNT",t[t.OLD_OBJ_COUNT=4]="OLD_OBJ_COUNT",t[t.OLD_PLAYER_X=5]="OLD_PLAYER_X",t[t.OLD_PLAYER_Y=6]="OLD_PLAYER_Y",t[t.STATUS_ENERGY=10]="STATUS_ENERGY",t[t.STATUS_STRENGTH=12]="STATUS_STRENGTH",t[t.STATUS_DEFENCE=14]="STATUS_DEFENCE",t[t.STATUS_GOLD=16]="STATUS_GOLD",t[t.OLD_GAMEOVER_X=18]="OLD_GAMEOVER_X",t[t.OLD_GAMEOVER_Y=19]="OLD_GAMEOVER_Y",t[t.OLD_ITEMBOX_TOP=20]="OLD_ITEMBOX_TOP",t[t.STATUS_ENERGY_MAX=32]="STATUS_ENERGY_MAX",t[t.MAP_COUNT=34]="MAP_COUNT",t[t.OBJ_COUNT=36]="OBJ_COUNT",t[t.PLAYER_X=38]="PLAYER_X",t[t.PLAYER_Y=40]="PLAYER_Y",t[t.GAMEOVER_X=42]="GAMEOVER_X",t[t.GAMEOVER_Y=44]="GAMEOVER_Y",t[t.MAP_SIZE=46]="MAP_SIZE",t[t.MESSAGE_NUM=48]="MESSAGE_NUM",t[t.ITEMBOX_TOP=60]="ITEMBOX_TOP",t[t.MAPDATA_TOP=90]="MAPDATA_TOP",t[t.OLD_MAPDATA_TOP=100]="OLD_MAPDATA_TOP"}(me||(me={}));var ve,De,Ce=function(){function t(){}return t.ITEMBOX_SIZE=12,t.MAP_ATR_MAX=60,t.OBJ_ATR_MAX=60,t.OLD_MAP_ATR_MAX=40,t.OLD_OBJ_ATR_MAX=40,t.ATR_CROP1=1,t.ATR_CROP2=2,t.ATR_TYPE=3,t.ATR_JUMP_X=16,t.ATR_JUMP_Y=17,t.MAP_LOCALGATE=2,t.OBJECT_LOCALGATE=18,t.SYSTEM_MESSAGE_NUM=20,t.IMGPOS_DEFAULT_YESNO_X=3,t.IMGPOS_DEFAULT_YESNO_Y=1,t.IMGPOS_DEFAULT_PLAYER_X=2,t.IMGPOS_DEFAULT_PLAYER_Y=0,t.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_X=0,t.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_Y=0,t.IMGPOS_DEFAULT_STATUS_X=3,t.IMGPOS_DEFAULT_STATUS_Y=2,t.IMGRELPOS_ENERGY_ICON_X=0,t.IMGRELPOS_STRENGTH_ICON_X=1,t.IMGRELPOS_DEFENCE_ICON_X=2,t.IMGRELPOS_GOLD_ICON_X=3,t.IMGPOS_DEFAULT_WIDE_CELL_X=4,t.IMGPOS_DEFAULT_WIDE_CELL_Y=3,t.IMGPOS_DEFAULT_ITEMBOX_X=1,t.IMGPOS_DEFAULT_ITEMBOX_Y=2,t.IMGPOS_DEFAULT_FRAME_X=0,t.IMGPOS_DEFAULT_FRAME_Y=1,t.IMGPOS_DEFAULT_BATTLE_EFFECT_X=3,t.IMGPOS_DEFAULT_BATTLE_EFFECT_Y=3,t.DEFAULT_DISABLE_SAVE=!1,t.DEFAULT_OLDMAP=!1,t.DEFAULT_OBJECT_NO_COLLAPSE=!1,t.DEFAULT_FRAME_COLOR_R=255,t.DEFAULT_FRAME_COLOR_G=255,t.DEFAULT_FRAME_COLOR_B=255,t.DEFAULT_FRAMEOUT_COLOR_R=96,t.DEFAULT_FRAMEOUT_COLOR_G=96,t.DEFAULT_FRAMEOUT_COLOR_B=96,t.DEFAULT_STR_COLOR_R=0,t.DEFAULT_STR_COLOR_G=0,t.DEFAULT_STR_COLOR_B=0,t.DEFAULT_STATUS_COLOR_R=0,t.DEFAULT_STATUS_COLOR_G=0,t.DEFAULT_STATUS_COLOR_B=0,t.DEFAULT_MOVES=0,t.DEFAULT_SPEED_INDEX=3,t.USER_VAR_NUM=256,t}();!function(t){t[t.MAP=1]="MAP",t[t.OBJECT=0]="OBJECT"}(ve||(ve={})),function(t){t[t.INIT=0]="INIT",t[t.MAP_LOAD=1]="MAP_LOAD",t[t.OBJ_LOAD=2]="OBJ_LOAD",t[t.MAP_ATTR=3]="MAP_ATTR",t[t.OBJ_ATTR=4]="OBJ_ATTR",t[t.RAND_PARTS=5]="RAND_PARTS",t[t.MESSAGE=6]="MESSAGE"}(De||(De={}));var Pe=function(){function t(t,e,s){this.byteMapData=t,this.eventEmitter=s,Oe(t,e),this.wwaData={version:void 0,gameoverX:void 0,gameoverY:void 0,playerX:void 0,playerY:void 0,mapPartsMax:void 0,objPartsMax:void 0,isOldMap:void 0,isOldMove:void 0,statusEnergyMax:void 0,statusEnergy:void 0,statusStrength:void 0,statusDefence:void 0,statusGold:void 0,itemBox:void 0,mapWidth:void 0,messageNum:void 0,map:void 0,mapObject:void 0,mapCompressed:void 0,mapObjectCompressed:void 0,mapAttribute:void 0,objectAttribute:void 0,worldPassword:void 0,message:void 0,worldName:void 0,worldPassNumber:void 0,charCGName:void 0,mapCGName:void 0,systemMessage:void 0,moves:void 0,yesnoImgPosX:void 0,yesnoImgPosY:void 0,playerImgPosX:void 0,playerImgPosY:void 0,clickableItemSignImgPosX:void 0,clickableItemSignImgPosY:void 0,disableSaveFlag:void 0,compatibleForOldMapFlag:void 0,objectNoCollapseDefaultFlag:void 0,delPlayerFlag:void 0,bgm:void 0,effectCoords:void 0,effectWaits:void 0,imgStatusEnergyX:void 0,imgStatusEnergyY:void 0,imgStatusStrengthX:void 0,imgStatusStrengthY:void 0,imgStatusDefenceX:void 0,imgStatusDefenceY:void 0,imgStatusGoldX:void 0,imgStatusGoldY:void 0,imgWideCellX:void 0,imgWideCellY:void 0,imgItemboxX:void 0,imgItemboxY:void 0,imgFrameX:void 0,imgFrameY:void 0,imgBattleEffectX:void 0,imgBattleEffectY:void 0,imgClickX:void 0,imgClickY:void 0,frameColorR:void 0,frameColorG:void 0,frameColorB:void 0,frameOutColorR:void 0,frameOutColorG:void 0,frameOutColorB:void 0,fontColorR:void 0,fontColorG:void 0,fontColorB:void 0,statusColorR:void 0,statusColorG:void 0,statusColorB:void 0,checkOriginalMapString:void 0,checkString:void 0,isItemEffectEnabled:void 0,frameCount:void 0,gamePadButtonItemTable:void 0,userVar:void 0,permitChangeGameSpeed:void 0,gameSpeedIndex:void 0,playTime:void 0,isVisibleStatusEnergy:void 0,isVisibleStatusStrength:void 0,isVisibleStatusDefence:void 0,isVisibleStatusGold:void 0}}return t.prototype.extractAllData=function(){var t,e;return this.wwaData.version=this.byteMapData[me.VERSION],this._extractInitialParameters(),this.wwaData.version>=29?this.currentPosition=me.MAPDATA_TOP:this.currentPosition=me.OLD_MAPDATA_TOP,this.wwaData.map=this._getFieldDataFromBits(ve.MAP,this.wwaData.mapPartsMax).concat(),this.wwaData.mapObject=this._getFieldDataFromBits(ve.OBJECT,this.wwaData.objPartsMax).concat(),t=this.wwaData.version>29?Ce.MAP_ATR_MAX:Ce.OLD_MAP_ATR_MAX,e=this.wwaData.version>29?Ce.OBJ_ATR_MAX:Ce.OLD_OBJ_ATR_MAX,this.wwaData.mapAttribute=this._getPartsDataFromBits(ve.MAP,this.wwaData.mapPartsMax,t).concat(),this.wwaData.objectAttribute=this._getPartsDataFromBits(ve.OBJECT,this.wwaData.objPartsMax,e).concat(),this.wwaData.version<=29&&(this._convertAttributeV2toV3(ve.MAP),this._convertAttributeV2toV3(ve.OBJECT)),this._replaceAllRandomObjects(),this.wwaData},t.prototype._convertAttributeV2toV3=function(t){var e,s,a;if(t==ve.MAP)e=this.wwaData.mapPartsMax,s=this.wwaData.mapAttribute,a=Ce.MAP_LOCALGATE;else{if(t!=ve.OBJECT)throw new Error("謎のパーツ種別が指定されました");e=this.wwaData.objPartsMax,s=this.wwaData.objectAttribute,a=Ce.OBJECT_LOCALGATE}for(var i=0;i<e;i++){for(var o=9;o>=0;o--){var r=255&s[i][20+2*o],n=s[i][20+2*o]>>8,_=255&s[i][20+2*o+1],h=s[i][20+2*o+1]>>8;250===_?_=9e3:_>100&&(_+=9840),250===h?h=9e3:h>100&&(h+=9840),s[i][20+4*o]=r,s[i][20+4*o+3]=n,s[i][20+4*o+1]=_,s[i][20+4*o+2]=h}s[i][Ce.ATR_TYPE]===a&&(s[i][Ce.ATR_JUMP_X]>100&&(s[i][Ce.ATR_JUMP_X]+=9840),s[i][Ce.ATR_JUMP_Y]>100&&(s[i][Ce.ATR_JUMP_Y]+=9840))}},t.prototype._get1ByteNumber=function(t){return this.byteMapData[t]},t.prototype._get2BytesNumber=function(t){return this.byteMapData[t]+256*this.byteMapData[t+1]},t.prototype._extractInitialParameters=function(){this.wwaData.version>29?(this.wwaData.gameoverX=this._get2BytesNumber(me.GAMEOVER_X),this.wwaData.gameoverY=this._get2BytesNumber(me.GAMEOVER_Y),this.wwaData.playerX=this._get2BytesNumber(me.PLAYER_X),this.wwaData.playerY=this._get2BytesNumber(me.PLAYER_Y),this.wwaData.mapPartsMax=this._get2BytesNumber(me.MAP_COUNT),this.wwaData.objPartsMax=this._get2BytesNumber(me.OBJ_COUNT),this.wwaData.isOldMap=!1):(this.wwaData.gameoverX=this._get1ByteNumber(me.OLD_GAMEOVER_X),this.wwaData.gameoverY=this._get1ByteNumber(me.OLD_GAMEOVER_Y),this.wwaData.playerX=this._get1ByteNumber(me.OLD_PLAYER_X),this.wwaData.playerY=this._get1ByteNumber(me.OLD_PLAYER_Y),this.wwaData.mapPartsMax=this._get1ByteNumber(me.OLD_MAP_COUNT),this.wwaData.objPartsMax=this._get1ByteNumber(me.OLD_OBJ_COUNT),this.wwaData.isOldMap=!0),this.wwaData.statusEnergyMax=this._get2BytesNumber(me.STATUS_ENERGY_MAX),this.wwaData.statusEnergy=this._get2BytesNumber(me.STATUS_ENERGY),this.wwaData.statusStrength=this._get2BytesNumber(me.STATUS_STRENGTH),this.wwaData.statusDefence=this._get2BytesNumber(me.STATUS_DEFENCE),this.wwaData.statusGold=this._get2BytesNumber(me.STATUS_GOLD),this._extractInitialItemData(),this.wwaData.mapWidth=this._get2BytesNumber(me.MAP_SIZE),this.wwaData.messageNum=this._get2BytesNumber(me.MESSAGE_NUM),this.wwaData.version<28?this.wwaData.mapWidth=71:this.wwaData.version<=29&&(this.wwaData.mapWidth=101)},t.prototype._extractInitialItemData=function(){var t=this.wwaData.version>29?me.ITEMBOX_TOP:me.OLD_ITEMBOX_TOP;this.wwaData.itemBox=new Array(Ce.ITEMBOX_SIZE);for(var e=0;e<Ce.ITEMBOX_SIZE;e++)this.wwaData.itemBox[e]=this._get1ByteNumber(t+e)},t.prototype._getFieldDataFromBits=function(t,e){var s,a,i;for(i=Te(this.wwaData.mapWidth,this.wwaData.mapWidth),s=0;s<this.wwaData.mapWidth;s++)for(a=0;a<this.wwaData.mapWidth;a++)this.wwaData.version>29?(i[s][a]=this._get2BytesNumber(this.currentPosition),this.currentPosition+=2):(i[s][a]=this._get1ByteNumber(this.currentPosition),this.currentPosition+=1),(s*this.wwaData.mapWidth+a)%200==0&&this.emitProgress(s*this.wwaData.mapWidth+a,this.wwaData.mapWidth*this.wwaData.mapWidth,t===ve.MAP?De.MAP_LOAD:De.OBJ_LOAD),i[s][a]>=e&&(i[s][a]=0);return this.emitProgress(this.wwaData.mapWidth*this.wwaData.mapWidth,this.wwaData.mapWidth*this.wwaData.mapWidth,t===ve.MAP?De.MAP_LOAD:De.OBJ_LOAD),i},t.prototype._getPartsDataFromBits=function(t,e,s){var a,i,o;for(o=Te(e,s),a=0;a<e;a++)for(i=0;i<s;i++)(a*this.wwaData.mapWidth+i)%200==0&&this.emitProgress(a*s+i,e*s,t===ve.MAP?De.MAP_ATTR:De.OBJ_ATTR),i!==Ce.ATR_CROP1&&i!==Ce.ATR_CROP2?(o[a][i]=this._get2BytesNumber(this.currentPosition),this.currentPosition+=2):(o[a][i]=0,this.currentPosition+=2);return this.emitProgress(e*s,e*s,t===ve.MAP?De.MAP_ATTR:De.OBJ_ATTR),o},t.prototype._replaceAllRandomObjects=function(){this.emitProgress(this.wwaData.mapWidth*this.wwaData.mapWidth,this.wwaData.mapWidth*this.wwaData.mapWidth,De.RAND_PARTS)},t.prototype.emitProgress=function(t,e,s){this.eventEmitter.dispatch("progress",{current:t,total:e,stage:s})},t}();var Me,Ne=function(){function t(t,e,s,a){this.wwaData=t,this.compressedMapData=e,this.startPosition=s,this.eventEmitter=a,this.OLDVER_MESSAGE_MAX=400}return t.prototype.load=function(){var t=this.wwaData;this.currentPos=this.startPosition,t.version>=30&&(t.worldPassword=this.getMessageFromData()),t.version<=29&&(t.messageNum=this.OLDVER_MESSAGE_MAX),t.message=new Array(t.messageNum);for(var e=0;e<t.message.length;e++)t.message[e]=this.getMessageFromData(),e%200==0&&this.eventEmitter.dispatch("progress",{current:e,total:t.message.length,stage:De.MESSAGE});for(;t.messageNum<10;)t.message.push(""),t.messageNum++;this.eventEmitter.dispatch("progress",{current:t.message.length,total:t.message.length,stage:De.MESSAGE}),t.worldName=this.getMessageFromData(),t.version<=29?t.worldPassword=this.getMessageFromData():this.getMessageFromData(),""===t.worldPassword?t.worldPassNumber=0:t.version>=29?t.worldPassNumber=(parseInt(t.worldPassword)/10-1197)/17-2357:t.worldPassNumber=parseInt(t.worldPassword),t.charCGName=this.getMessageFromData(),t.mapCGName=this.getMessageFromData(),t.systemMessage=new Array(Ce.SYSTEM_MESSAGE_NUM);for(e=0;e<Ce.SYSTEM_MESSAGE_NUM;e++)t.version>=30?t.systemMessage[e]=this.getMessageFromData():t.systemMessage[e]="";t.yesnoImgPosX=Ce.IMGPOS_DEFAULT_YESNO_X,t.yesnoImgPosY=Ce.IMGPOS_DEFAULT_YESNO_Y,t.playerImgPosX=Ce.IMGPOS_DEFAULT_PLAYER_X,t.playerImgPosY=Ce.IMGPOS_DEFAULT_PLAYER_Y,t.clickableItemSignImgPosX=Ce.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_X,t.clickableItemSignImgPosY=Ce.IMGPOS_DEFAULT_CLICKABLE_ITEM_SIGN_Y,t.disableSaveFlag=Ce.DEFAULT_DISABLE_SAVE,t.isOldMap=Ce.DEFAULT_OLDMAP,t.isOldMove=t.version<31,t.objectNoCollapseDefaultFlag=Ce.DEFAULT_OBJECT_NO_COLLAPSE,t.delPlayerFlag=!1,t.bgm=0,t.effectCoords=[],t.effectWaits=0,t.imgStatusEnergyX=Ce.IMGPOS_DEFAULT_STATUS_X+Ce.IMGRELPOS_ENERGY_ICON_X,t.imgStatusEnergyY=Ce.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusStrengthX=Ce.IMGPOS_DEFAULT_STATUS_X+Ce.IMGRELPOS_STRENGTH_ICON_X,t.imgStatusStrengthY=Ce.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusDefenceX=Ce.IMGPOS_DEFAULT_STATUS_X+Ce.IMGRELPOS_DEFENCE_ICON_X,t.imgStatusDefenceY=Ce.IMGPOS_DEFAULT_STATUS_Y,t.imgStatusGoldX=Ce.IMGPOS_DEFAULT_STATUS_X+Ce.IMGRELPOS_GOLD_ICON_X,t.imgStatusGoldY=Ce.IMGPOS_DEFAULT_STATUS_Y,t.imgWideCellX=Ce.IMGPOS_DEFAULT_WIDE_CELL_X,t.imgWideCellY=Ce.IMGPOS_DEFAULT_WIDE_CELL_Y,t.imgItemboxX=Ce.IMGPOS_DEFAULT_ITEMBOX_X,t.imgItemboxY=Ce.IMGPOS_DEFAULT_ITEMBOX_Y,t.imgFrameX=Ce.IMGPOS_DEFAULT_FRAME_X,t.imgFrameY=Ce.IMGPOS_DEFAULT_FRAME_Y,t.imgBattleEffectX=Ce.IMGPOS_DEFAULT_BATTLE_EFFECT_X,t.imgBattleEffectY=Ce.IMGPOS_DEFAULT_BATTLE_EFFECT_Y,t.imgClickX=0,t.imgClickY=0,t.frameColorR=Ce.DEFAULT_FRAME_COLOR_R,t.frameColorG=Ce.DEFAULT_FRAME_COLOR_G,t.frameColorB=Ce.DEFAULT_FRAME_COLOR_B,t.frameOutColorR=Ce.DEFAULT_FRAMEOUT_COLOR_R,t.frameOutColorG=Ce.DEFAULT_FRAMEOUT_COLOR_G,t.frameOutColorB=Ce.DEFAULT_FRAMEOUT_COLOR_B,t.fontColorR=Ce.DEFAULT_STR_COLOR_R,t.fontColorG=Ce.DEFAULT_STR_COLOR_G,t.fontColorB=Ce.DEFAULT_STR_COLOR_B,t.statusColorR=Ce.DEFAULT_STATUS_COLOR_R,t.statusColorG=Ce.DEFAULT_STATUS_COLOR_G,t.statusColorB=Ce.DEFAULT_STATUS_COLOR_B,t.moves=Ce.DEFAULT_MOVES,t.gameSpeedIndex=Ce.DEFAULT_SPEED_INDEX,t.permitChangeGameSpeed=!0,t.userVar=new Array(Ce.USER_VAR_NUM);for(e=0;e<Ce.USER_VAR_NUM;e++)t.userVar[e]=0;return t.playTime=0,t.isVisibleStatusEnergy=!0,t.isVisibleStatusStrength=!0,t.isVisibleStatusDefence=!0,t.isVisibleStatusGold=!0,t},t.prototype.getMessageFromData=function(){var t="",e=0;for(e=0;e<1500&&(0!=this.compressedMapData[this.currentPos+2*e]||0!=this.compressedMapData[this.currentPos+2*e+1]);e++)t+=String.fromCharCode((this.compressedMapData[this.currentPos+2*e+1]<<8)+this.compressedMapData[this.currentPos+2*e]);return this.currentPos+=2*e+2,t},t}(),Re=function(){},Le=function(){var t=function(e,s){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},t(e,s)};return function(e,s){if("function"!=typeof s&&null!==s)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function a(){this.constructor=e}t(e,s),e.prototype=null===s?Object.create(s):(a.prototype=s.prototype,new a)}}(),be=function(t){function e(e){var s=t.call(this)||this;return s.uri=e,s}return Le(e,t),e.prototype.request=function(t){var e=this,s=new XMLHttpRequest;try{s.open("GET",this.uri,!0),s.responseType="arraybuffer",s.onloadend=function(){try{if(200!==s.status&&304!==s.status)throw 404===s.status?new Error("マップデータ「"+e.uri+"」が見つかりませんでした。\nHTTPステータスコードは "+s.status+"です。"):403===s.status?new Error("マップデータ「"+e.uri+"」を読み取る権限がないようです。\n管理者の方へ: マップデータのパーミッションを確認してください。\nHTTPステータスコードは "+s.status+"です。"):new Error("マップデータ「"+e.uri+"」の読み込みに失敗しました。\nHTTPステータスコードは "+s.status+"です。");t(void 0,s.response)}catch(e){t(e)}},s.send(null)}catch(e){t(new Error("ロードエラー: ローカルテストの場合は、ブラウザが対応していない可能性があります。\n"+e.message))}},e}(Re),Be=s(106),xe=s.n(Be),Ue=function(){var t=function(e,s){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s])},t(e,s)};return function(e,s){if("function"!=typeof s&&null!==s)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");function a(){this.constructor=e}t(e,s),e.prototype=null===s?Object.create(s):(a.prototype=s.prototype,new a)}}(),We=function(t){function e(e){var s=t.call(this)||this;return s.fileName=e,s}return Ue(e,t),e.prototype.request=function(t){xe().readFile(this.fileName,(function(e,s){e?t(e):t(void 0,s.buffer)}))},e}(Re),Ye=function(){function t(t,e){this.fileName=t,this.eventEmitter=e}return t.prototype.requestAndLoadMapData=function(){var t,e=this;(t=this.fileName,"undefined"!=typeof window?new be(t):new We(t)).request((function(t,s){if(t){var a=t.name||"",i=t.message||"";e.eventEmitter.dispatch("error",{name:a,message:i})}else if(s){var o=e.loadMapData(s);e.eventEmitter.dispatch("mapData",o)}else e.eventEmitter.dispatch("error",{name:"マップデータ取得に失敗しました",message:"mapdata is empty"})}))},t.prototype.loadMapData=function(t){try{var e=new Uint8Array(t),s=function(t){var e,s,a=new Uint8Array(t.length);for(e=0,s=0;e<t.length&&(0!==t[e]||0!==t[e+1]||0!==t[e+2]);e++){if(a[s++]=t[e],t[e]===t[e+1]){for(var i=t[e+2],o=0;o<i;o++)a[s++]=t[e];e+=2}if(s+255>=a.length){var r=new Uint8Array(a.length+65e3);r.set(a),a=r}}return console.log("EXTRACT DATA = "+s+" "+e),{byteMapData:a,byteMapLength:s,compressedEndPosition:e+3}}(e),a=s.byteMapData,i=s.byteMapLength,o=s.compressedEndPosition,r=new Pe(a,i,this.eventEmitter).extractAllData();return new Ne(r,e,o,this.eventEmitter).load()}catch(t){throw t}},t}(),ke=function(){function t(t){this.target=null!=t?t:document.createElement("div")}return t.prototype.dispatch=function(t,e){var s;"function"==typeof window.CustomEvent?s=new CustomEvent(t,{detail:e}):(s=document.createEvent("CustomEvent")).initCustomEvent(t,!1,!1,e),this.target.dispatchEvent(s)},t.prototype.addListener=function(t,e){var s=function(t){return e(t.detail)};return this.target.addEventListener(t,s),s},t.prototype.removeListener=function(t,e){this.target.removeEventListener(t,e)},t}(),Fe=function(t,e,s){if(s||2===arguments.length)for(var a,i=0,o=e.length;i<o;i++)!a&&i in e||(a||(a=Array.prototype.slice.call(e,0,i)),a[i]=e[i]);return t.concat(a||Array.prototype.slice.call(e))};function Ge(t,e,s){var a=new $;return a.current=t,a.total=e,a.stage=s,a}var He=function(){function s(s,i,n,h,p,d,m,f,A){var S,I=this;void 0===i&&(i=!1),void 0===m&&(m=""),void 0===f&&(f=!1),void 0===A&&(A=null),this._useSuspend=!1,this._useLookingAround=!0,this._isDisallowLoadOldSave=!1,this.audioExtension="",this.soundLoadedCheckTimer=void 0,this.mainCaller=function(){return I._main()},this.soundCheckCaller=function(){return I.checkAllSoundLoaded()},this._checkTurnKeyPressed=function(){return I._keyStore.checkHitKey(e.KEY_ESC)||I._keyStore.checkHitKey(e.KEY_SHIFT)||I._keyStore.checkHitKey(e.KEY_N)},this._saveDataList=[],this.wwaCustomEventEmitter=new ke(_t("wwa-wrapper")),window.addEventListener("click",(function(t){I._isActive=!1})),_t("wwa-wrapper").addEventListener("click",(function(t){t.stopPropagation(),I._isActive=!0})),this._isActive=!0,null===n?(this._hasTitleImg=!1,this._cvsCover=_t("progress-panel"),(S=this._cvsCover.getContext("2d")).fillStyle="rgb(0, 0, 0)"):this._hasTitleImg=!0;try{this._hasTitleImg?_t("version").textContent="WWA Wing Ver.3.6.12":this._setLoadingMessage(S,0)}catch(t){}this._dumpElement=A;var T=window.AudioContext||window.webkitAudioContext;T&&(this.audioContext=new T,this.audioGain=this.audioContext.createGain(),this.audioGain.gain.setValueAtTime(1,this.audioContext.currentTime));var O=new Audio;"no"!==O.canPlayType("audio/mpeg")&&""!==O.canPlayType("audio/mpeg")?this.audioExtension="mp3":this.audioExtension="m4a",this.userDevice=new U,this._isURLGateEnable=i,this._isClassicModeEnable=h,this._mainCallCounter=0,this._animationCounter=0,this._statusPressCounter=new E(0,0,0,0),m?"/"!==m[m.length-1]&&(m+="/"):m="./audio/",this._audioDirectory=m,this._bottomButtonType=d?c.GOTO_WWA:c.BATTLE_REPORT;var v=(new Date).getTime();if(!!location.href.match(/^file/))if(this.userDevice.device===P.GAME){if(this.userDevice.os===C.NINTENDO)Q.BATTLE_INTERVAL_FRAME_NUM=5;this._bottomButtonType=c.GAME_END}else alert("【警告】直接HTMLファイルを開いているようです。\nこのプログラムは正常に動作しない可能性があります。\nマップデータの確認を行う場合には同梱の「wwa-server.exe」をご利用ください。\n"+(this.userDevice.browser===M.FIREFOX?"Firefoxの場合も、バージョン68以降はローカルのHTMLファイルを直接開いた場合、通常起動できないことを確認しております。":""));switch(this.userDevice.device){case P.VR:case P.GAME:this._usePassword=!1;break;default:this._usePassword=!0}switch(_t("cell-save").textContent=z.QUICK_SAVE,this._usePassword?_t("cell-load").textContent=z.PASSWORD:_t("cell-load").textContent=z.EMPTY_LOAD,this._bottomButtonType){case c.GOTO_WWA:_t("cell-gotowwa").textContent=z.GOTO_WWA;break;case c.BATTLE_REPORT:_t("cell-gotowwa").textContent=z.BATTLE_REPORT;break;case c.GAME_END:_t("cell-gotowwa").textContent=z.GAME_END}this._loadHandler=function(s){I._wwaData=s,I._wwaData.isItemEffectEnabled=p;try{I._hasTitleImg?_t("version").textContent+=" (Map data Ver. "+Math.floor(I._wwaData.version/10)+"."+ +I._wwaData.version%10+")":I._setLoadingMessage(S,1)}catch(t){}var i=_t("wwa-wrapper").getAttribute("data-wwa-mapdata").split("/");i.pop(),i.push(I._wwaData.mapCGName),I._wwaData.mapCGName=i.join("/"),I._startTime=(new Date).getTime(),I._restartData=JSON.parse(JSON.stringify(I._wwaData)),I.checkOriginalMapString=I._generateMapDataHash(I._restartData),I.initCSSRule(),I._setProgressBar(Ge(0,4,j.GAME_INIT)),I._setLoadingMessage(S,2);var n=new Image;n.src=I._wwaData.mapCGName,n.addEventListener("error",(function(){I._setErrorMessage("画像ファイル「"+I._wwaData.mapCGName+"」が見つかりませんでした。\n管理者の方へ: データがアップロードされているか、\nパーミッションを確かめてください。",S)}));var h=I._wwaData.mapCGName.replace("(","\\(").replace(")","\\)"),c=function(t){t.style.backgroundImage="url("+h+")"};Array.prototype.forEach.call(ut("div.item-cell"),(function(t){t.style.backgroundPosition="-".concat(I._wwaData.imgItemboxX*Q.CHIP_SIZE,"px -").concat(I._wwaData.imgItemboxY*Q.CHIP_SIZE,"px"),t.style.backgroundImage="url("+h+")"})),Array.prototype.forEach.call(ut("div.wide-cell-row"),(function(t){t.style.backgroundPosition="-160px -120px",t.style.backgroundImage="url("+h+")"})),Array.prototype.forEach.call(ut(".item-cell>.item-click-border"),(function(t){t.style.backgroundImage="url('"+Q.ITEM_BORDER_IMG_DATA_URL+"')",t.style.backgroundPosition="0 0",t.style.display="none",t.style.cursor="pointer"})),Array.prototype.forEach.call(ut(".item-cell>.item-disp"),c),Array.prototype.forEach.call(ut("div.wide-cell-row>.status-icon"),c),I.setStatusIconCoord(H.ENERGY,new w(I._wwaData.imgStatusEnergyX,I._wwaData.imgStatusEnergyY)),I.setStatusIconCoord(H.STRENGTH,new w(I._wwaData.imgStatusStrengthX,I._wwaData.imgStatusStrengthY)),I.setStatusIconCoord(H.DEFENCE,new w(I._wwaData.imgStatusDefenceX,I._wwaData.imgStatusDefenceY)),I.setStatusIconCoord(H.GOLD,new w(I._wwaData.imgStatusGoldX,I._wwaData.imgStatusGoldY)),I._setProgressBar(Ge(1,4,j.GAME_INIT)),I._setLoadingMessage(S,3),I._mapIDTableCreate(),I._replaceAllRandomObjects();var d=(new Date).getTime();console.log("Loading Complete!"+(d-v)+"ms"),I._cvs=_t("wwa-map");var m=I._cvs.getContext("2d",{alpha:!1});m.fillStyle="rgba( 255, 255, 255, 0.5)",m.fillRect(0,0,440,440);var A=new y(I,I._wwaData.playerX,I._wwaData.playerY);I._camera=new yt(A),I._itemMenu=new Ft;var T=new E(I._wwaData.statusEnergy,I._wwaData.statusStrength,I._wwaData.statusDefence,I._wwaData.statusGold);I._player=new At(I,A,I._camera,T,I._wwaData.statusEnergyMax,I._wwaData.moves,I._wwaData.gameSpeedIndex),I._objectMovingDataManager=new Tt(I,I._player),I._camera.setPlayer(I._player),I._keyStore=new o,I._mouseStore=new _,I._gamePadStore=new l,I._messageQueue=[],I._yesNoJudge=g.UNSELECTED,I._yesNoJudgeInNextFrame=g.UNSELECTED,I._yesNoChoiceCallInfo=N.NONE,I._prevFrameEventExected=!1,I._lastMessage=new vt([],!1,!1,[]),I._execMacroListInNextFrame=[],I._passwordLoadExecInNextFrame=!1,I._messageWindow=new bt(I,50,180,340,0,I._wwaData.mapCGName,!1,!0,!1,_t("wwa-wrapper")),I._scoreWindow=new Rt(I,new w(50,50),!1,_t("wwa-wrapper")),I._wwaSave=new ye(Me,Me._wwaData.worldName,Me._wwaData.worldPassNumber,I._checkSaveDataCompatibility.bind(I),(function(t){if(t.length>0){var e="これまでに保存されていたセーブデータは、下記の理由により消えたものがあります。";t.forEach((function(t){switch(t){case Ee.UNMATCHED_WORLD_NAME:e+="\n・制作者によるマップデータのワールド名の変更";break;case Ee.UNMATCHED_WORLD_PASS_NUMBER:e+="\n・制作者によるマップデータの暗証番号の変更";break;case Ee.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA:e+="\n・制作者によるマップデータの内容変更 (マップデータ制作者の設定により、内容が変更されるとセーブデータが消去されます)"}})),alert(e)}})),I._isDisallowLoadOldSave=f,I._messageWindow.setWWASave(I._wwaSave),qt.setRestartData(I._restartData,I._wwaData),I.clearFaces();var O=_t("wwa-wrapper").getAttribute("data-wwa-resume-savedata");if("string"==typeof O&&(I._useSuspend=!0,O)){var D=qt.getStartWWAData(O);I._restartData!==D&&(I._applyQuickLoad(D),I._wwaSave.resumeStart())}var M=_t("wwa-wrapper").getAttribute("data-wwa-autosave");null!==M&&I._wwaSave.setAutoSaveInterval(0|Number(M));var L=_t("wwa-wrapper").getAttribute("data-wwa-looking-around");if(I._useLookingAround=!(L&&L.match(/false/i)),I._setProgressBar(Ge(2,4,j.GAME_INIT)),I._setLoadingMessage(S,4),window.addEventListener("keydown",(function(t){if(I._isActive){if(I.userDevice.os===C.NINTENDO)return t.preventDefault(),void t.stopPropagation();I._keyStore.setPressInfo(t.keyCode),t.keyCode!==e.KEY_F5?I._player.isWaitingMessage()?t.keyCode!==e.KEY_DOWN&&t.keyCode!==e.KEY_LEFT&&t.keyCode!==e.KEY_RIGHT&&t.keyCode!==e.KEY_UP&&t.keyCode!==e.KEY_SHIFT&&t.keyCode!==e.KEY_ENTER&&t.keyCode!==e.KEY_ESC&&t.keyCode!==e.KEY_SPACE||t.preventDefault():I._player.isWaitingPasswordWindow()||t.keyCode!==e.KEY_DOWN&&t.keyCode!==e.KEY_LEFT&&t.keyCode!==e.KEY_RIGHT&&t.keyCode!==e.KEY_UP&&t.keyCode!==e.KEY_SHIFT&&t.keyCode!==e.KEY_ENTER&&t.keyCode!==e.KEY_1&&t.keyCode!==e.KEY_2&&t.keyCode!==e.KEY_3&&t.keyCode!==e.KEY_A&&t.keyCode!==e.KEY_C&&t.keyCode!==e.KEY_D&&t.keyCode!==e.KEY_E&&t.keyCode!==e.KEY_M&&t.keyCode!==e.KEY_N&&t.keyCode!==e.KEY_Q&&t.keyCode!==e.KEY_S&&t.keyCode!==e.KEY_W&&t.keyCode!==e.KEY_X&&t.keyCode!==e.KEY_Y&&t.keyCode!==e.KEY_Z&&t.keyCode!==e.KEY_ESC&&t.keyCode!==e.KEY_F1&&t.keyCode!==e.KEY_F2&&t.keyCode!==e.KEY_F3&&t.keyCode!==e.KEY_F4&&t.keyCode!==e.KEY_F6&&t.keyCode!==e.KEY_F7&&t.keyCode!==e.KEY_F8&&t.keyCode!==e.KEY_F12&&t.keyCode!==e.KEY_SPACE||t.preventDefault():t.preventDefault()}})),window.addEventListener("keyup",(function(t){if(I._isActive){if(I.userDevice.os===C.NINTENDO)return t.preventDefault(),void t.stopPropagation();I._keyStore.setReleaseInfo(t.keyCode),t.keyCode===e.KEY_F5?t.preventDefault():t.keyCode!==e.KEY_DOWN&&t.keyCode!==e.KEY_LEFT&&t.keyCode!==e.KEY_RIGHT&&t.keyCode!==e.KEY_UP&&t.keyCode!==e.KEY_SHIFT&&t.keyCode!==e.KEY_ENTER&&t.keyCode!==e.KEY_1&&t.keyCode!==e.KEY_2&&t.keyCode!==e.KEY_3&&t.keyCode!==e.KEY_A&&t.keyCode!==e.KEY_C&&t.keyCode!==e.KEY_D&&t.keyCode!==e.KEY_E&&t.keyCode!==e.KEY_M&&t.keyCode!==e.KEY_N&&t.keyCode!==e.KEY_Q&&t.keyCode!==e.KEY_S&&t.keyCode!==e.KEY_W&&t.keyCode!==e.KEY_X&&t.keyCode!==e.KEY_Y&&t.keyCode!==e.KEY_Z&&t.keyCode!==e.KEY_ESC&&t.keyCode!==e.KEY_F1&&t.keyCode!==e.KEY_F3&&t.keyCode!==e.KEY_F4&&t.keyCode!==e.KEY_F6&&t.keyCode!==e.KEY_F7&&t.keyCode!==e.KEY_F8&&t.keyCode!==e.KEY_F9&&t.keyCode!==e.KEY_F12&&t.keyCode!==e.KEY_SPACE||I._player.isWaitingMessage()||I._player.isWaitingPasswordWindow()||t.preventDefault()}})),window.addEventListener("blur",(function(t){I._keyStore.allClear(),I._mouseStore.clear()})),window.addEventListener("contextmenu",(function(t){I._keyStore.allClear(),I._mouseStore.clear()})),window.addEventListener("help",(function(t){I._isActive&&t.preventDefault()})),I._mouseControllerElement=_t("wwa-controller"),I._mouseControllerElement.addEventListener("mousedown",(function(t){if(I._isActive&&1===t.which){if(I._mouseStore.getMouseState()!==a.NONE)return void t.preventDefault();var e=lt(t.clientX,t.clientY),s=I._player.getDrawingCenterPosition(),i=e.substract(s),o=Math.abs(i.x),r=Math.abs(i.y),n=void 0,_=!1;if(o<Q.CHIP_SIZE&&r<Q.CHIP_SIZE){switch(s.x/Q.CHIP_SIZE|0){case 0:_=!0,n=u.LEFT;break;case Q.H_PARTS_NUM_IN_WINDOW-1:_=!0,n=u.RIGHT}switch(s.y/Q.CHIP_SIZE|0){case 0:_=!0,n=u.UP;break;case Q.V_PARTS_NUM_IN_WINDOW-1:_=!0,n=u.DOWN}}_||(i.y>0&&r>o?n=u.DOWN:i.y<0&&r>o?n=u.UP:i.x>0&&r<o?n=u.RIGHT:i.x<0&&r<o&&(n=u.LEFT)),I._mouseStore.setPressInfo(n,0)}})),I._mouseControllerElement.addEventListener("mouseleave",(function(t){I._mouseStore.clear()})),I._mouseControllerElement.addEventListener("mouseup",(function(t){I._isActive&&1===t.which&&(I._mouseStore.setReleaseInfo(),t.preventDefault())})),window.TouchEvent){if(I.audioContext){var b=function(){I.audioContext.createBufferSource().start(0),I._mouseControllerElement.removeEventListener("touchstart",b),b=null};I._mouseControllerElement.addEventListener("touchstart",b)}I._mouseControllerElement.addEventListener("touchstart",(function(t){if(I._isActive)if(I._mouseStore.getMouseState()===a.NONE){for(var e=t.changedTouches,s=e.length,i=0;i<s;i++){var o=e[i],r=lt(o.clientX,o.clientY),n=I._player.getDrawingCenterPosition(),_=r.substract(n),h=Math.abs(_.x),c=Math.abs(_.y),l=void 0,p=!1;if(h<Q.CHIP_SIZE&&c<Q.CHIP_SIZE){switch(n.x/Q.CHIP_SIZE|0){case 0:p=!0,l=u.LEFT;break;case Q.H_PARTS_NUM_IN_WINDOW-1:p=!0,l=u.RIGHT}switch(n.y/Q.CHIP_SIZE|0){case 0:p=!0,l=u.UP;break;case Q.V_PARTS_NUM_IN_WINDOW-1:p=!0,l=u.DOWN}}p||(_.y>0&&c>h?l=u.DOWN:_.y<0&&c>h?l=u.UP:_.x>0&&c<h?l=u.RIGHT:_.x<0&&c<h&&(l=u.LEFT)),I._mouseStore.setPressInfo(l,o.identifier)}t.cancelable&&t.preventDefault()}else t.preventDefault()}));var B=function(t){if(I._isActive)for(var e=0;e<t.changedTouches.length;e++)if(I._mouseStore.getTouchID()===t.changedTouches[e].identifier){I._mouseStore.setReleaseInfo(),t.preventDefault();break}};I._mouseControllerElement.addEventListener("touchend",B),I._mouseControllerElement.addEventListener("touchcancel",B)}_t("button-load").addEventListener("click",(function(){(I._player.isControllable()||I._messageWindow.isItemMenuChoice())&&I.onselectbutton(R.QUICK_LOAD)})),_t("button-save").addEventListener("click",(function(){(I._player.isControllable()||I._messageWindow.isItemMenuChoice())&&I.onselectbutton(R.QUICK_SAVE)})),_t("button-restart").addEventListener("click",(function(){(I._player.isControllable()||I._messageWindow.isItemMenuChoice())&&I.onselectbutton(R.RESTART_GAME)})),_t("button-gotowwa").addEventListener("click",(function(){(I._player.isControllable()||I._messageWindow.isItemMenuChoice())&&I.onselectbutton(R.GOTO_WWA,!1,!1)})),Array.prototype.forEach.call(ut(".wide-cell-row"),(function(t){t.addEventListener("click",(function(){I._displayHelp()}))})),I._frameCoord=new w(Q.IMGPOS_DEFAULT_FRAME_X,Q.IMGPOS_DEFAULT_YESNO_Y),I._battleEffectCoord=new w(Q.IMGPOS_DEFAULT_BATTLE_EFFECT_X,Q.IMGPOS_DEFAULT_BATTLE_EFFECT_Y),I._battleEstimateWindow=new xt(I,I._wwaData.mapCGName,_t("wwa-wrapper")),I._passwordWindow=new Yt(I,_t("wwa-wrapper"),f),I._monsterWindow=new Nt(I,new w(50,180),340,60,!1,_t("wwa-wrapper"),I._wwaData.mapCGName),I._setProgressBar(Ge(3,4,j.GAME_INIT)),I._isLoadedSound=!1,I._temporaryInputDisable=!1,I._paintSkipByDoorOpen=!1,I._clearFacesInNextFrame=!1,I._useConsole=!1,I.wwaCustomEvent("wwa_startup"),I._cgManager=new wt(m,I._wwaData.mapCGName,I._frameCoord,(function(){I._isSkippedSoundMessage=!0;var s=function(){switch(I.userDevice.device){case P.PC:I.setMessageQueue("ゲームを開始します。\n画面をクリックしてください。",!1,!0);break;case P.SP:I.setMessageQueue("ゲームを開始します。\n画面にふれてください。",!1,!0)}};if("ON"===I._wwaData.systemMessage[Y.LOAD_SE])return I._isLoadedSound=!0,s(),I._setLoadingMessage(S,j.AUDIO),I.loadSound(),void window.requestAnimationFrame(I.soundCheckCaller);if("OFF"===I._wwaData.systemMessage[Y.LOAD_SE])return I._isLoadedSound=!1,s(),void I.openGameWindow();if(I._isSkippedSoundMessage=!1,I._hasTitleImg||S.clearRect(0,0,Q.SCREEN_WIDTH,Q.SCREEN_HEIGHT),I._usePassword){I._messageWindow.setParsedMessage(new vt(""===I._wwaData.systemMessage[Y.LOAD_SE]?"効果音・BGMデータをロードしますか?":I._wwaData.systemMessage[Y.LOAD_SE],!0)),I._messageWindow.show(),I._setProgressBar(Ge(4,4,j.GAME_INIT));var a=setInterval((function(){I._keyStore.update(),I._gamePadStore.update(),I._yesNoJudgeInNextFrame===g.UNSELECTED&&(I._keyStore.getKeyState(e.KEY_ENTER)===t.KEYDOWN||I._keyStore.getKeyState(e.KEY_Y)===t.KEYDOWN||I._gamePadStore.buttonTrigger(r.BUTTON_INDEX_A)?I._yesNoJudgeInNextFrame=g.YES:(I._keyStore.getKeyState(e.KEY_N)===t.KEYDOWN||I._keyStore.getKeyState(e.KEY_ESC)===t.KEYDOWN||I._gamePadStore.buttonTrigger(r.BUTTON_INDEX_B))&&(I._yesNoJudgeInNextFrame=g.NO)),I._yesNoJudgeInNextFrame===g.YES?(clearInterval(a),I._messageWindow.update(),I._yesNoJudge=I._yesNoJudgeInNextFrame,I._messageWindow.setInputDisable(),setTimeout((function(){I._player.setDelayFrame(),I._messageWindow.hide(),I._yesNoJudge=g.UNSELECTED,I._yesNoJudgeInNextFrame=g.UNSELECTED,I._isLoadedSound=!0,I._setLoadingMessage(S,j.AUDIO),I.loadSound(),window.requestAnimationFrame(I.soundCheckCaller)}),Q.YESNO_PRESS_DISP_FRAME_NUM*Q.DEFAULT_FRAME_INTERVAL)):I._yesNoJudgeInNextFrame===g.NO&&(clearInterval(a),I._messageWindow.update(),I._yesNoJudge=I._yesNoJudgeInNextFrame,I._messageWindow.setInputDisable(),setTimeout((function(){I._player.setDelayFrame(),I._messageWindow.hide(),I._yesNoJudge=g.UNSELECTED,I._yesNoJudgeInNextFrame=g.UNSELECTED,I._isLoadedSound=!1,I.openGameWindow()}),Q.YESNO_PRESS_DISP_FRAME_NUM*Q.DEFAULT_FRAME_INTERVAL))}),Q.DEFAULT_FRAME_INTERVAL)}else clearInterval(a),I._player.setDelayFrame(),I._messageWindow.hide(),I._yesNoJudge=g.UNSELECTED,I._yesNoJudgeInNextFrame=g.UNSELECTED,I._isLoadedSound=!0,I.loadSound(),window.requestAnimationFrame(I.soundCheckCaller)})),I.wwaCustomEvent("wwa_start")};var D=new ke;D.addListener("mapData",(function(t){return I._loadHandler(t)})),D.addListener("progress",(function(t){return I._setProgressBar(t)})),D.addListener("error",(function(t){return I._setErrorMessage("下記のエラーが発生しました。: \n"+t.message,S)})),new Ye(s,D).requestAndLoadMapData()}return s.prototype._setProgressBar=function(t){this._hasTitleImg&&(t.stage<=Q.LOAD_STAGE_MAX_EXCEPT_AUDIO?(_t("progress-message-container").textContent=t.stage===Q.LOAD_STAGE_MAX_EXCEPT_AUDIO?"World Name: "+this._wwaData.worldName:ot[t.stage],_t("progress-bar").style.width=(1*t.stage+t.current/t.total*1)/(Q.LOAD_STAGE_MAX_EXCEPT_AUDIO+1)*Q.MAP_WINDOW_WIDTH+"px",_t("progress-disp").textContent=((1*t.stage+t.current/t.total*1)/(Q.LOAD_STAGE_MAX_EXCEPT_AUDIO+1)*100).toFixed(2)+"%"):(this._usePassword?_t("progress-message-container").textContent="効果音/BGMを読み込んでいます。(スペースキーでスキップ)":_t("progress-message-container").textContent="ゲームデータを読み込んでいます。",_t("progress-bar-audio").style.width=t.current*Q.MAP_WINDOW_WIDTH/t.total+"px",_t("progress-disp").textContent=(t.current/t.total*100).toFixed(2)+"%"))},s.prototype._setLoadingMessage=function(t,e){if(!this._hasTitleImg)if(e<=0)t.font=et.TITLE+"px "+Q.LOADING_FONT,t.fillText(rt[0],tt.TITLE_X,tt.TITLE_Y),t.font=et.FOOTER+"px "+Q.LOADING_FONT,t.fillText("WWA Wing Ver.3.6.12",tt.FOOTER_X,tt.COPYRIGHT_Y);else if(e<=rt.length)t.font=et.LOADING+"px "+Q.LOADING_FONT,e>=2&&(t.clearRect(tt.LOADING_X,tt.LOADING_Y+tt.LINE*(e-3),Q.SCREEN_WIDTH-tt.LOADING_X,tt.LINE),t.fillText(rt[e-1]+" Complete!",tt.LOADING_X,tt.LOADING_Y+tt.LINE*(e-2))),e<rt.length&&t.fillText(rt[e],tt.LOADING_X,tt.LOADING_Y+tt.LINE*(e-1)),1==e&&(t.font=et.FOOTER+"px "+Q.LOADING_FONT,t.fillText("World Name "+this._wwaData.worldName,tt.FOOTER_X,tt.WORLD_Y),t.fillText(" (Map data Ver. "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10+")",tt.FOOTER_X,tt.WORLD_Y+tt.LINE));else{var s;s=this._isSkippedSoundMessage?tt.LOADING_Y+tt.LINE*(rt.length-1):tt.FOOTER_Y,e<=j.AUDIO?t.fillText("Now Sound data Loading .....",tt.LOADING_X,s):(t.clearRect(tt.LOADING_X,s-tt.LINE,Q.SCREEN_WIDTH-tt.LOADING_X,tt.LINE),t.fillText("Now Sound data Loading ..... Complete!",tt.LOADING_X,s))}},s.prototype._setErrorMessage=function(t,e){this._hasTitleImg?alert(t):(e.clearRect(0,0,Q.SCREEN_WIDTH,Q.SCREEN_HEIGHT),e.font=et.ERRROR+"px "+Q.LOADING_FONT,t.split("\n").forEach((function(t,s){e.fillText(t,tt.ERROR_X,tt.ERROR_Y+tt.LINE*s)})))},s.prototype.createWWAAudioInstance=function(t){if(0!==t&&t!==K.NO_SOUND){var e=this.audioContext;if(void 0===this._audioInstances[t]){var s=this._audioDirectory+t+"."+this.audioExtension;this._audioInstances[t]=e?new Ae(t,s,this.audioContext,this.audioGain):new Ie(t,s,_t("wwa-audio-wrapper"))}}},s.prototype.loadSound=function(){var t=this;this._audioInstances=new Array(Q.SOUND_MAX+1),this.createWWAAudioInstance(K.DECISION),this.createWWAAudioInstance(K.ATTACK);for(var e=1;e<this._wwaData.mapPartsMax;e++){var s=this._wwaData.mapAttribute[e][Q.ATR_SOUND];this.createWWAAudioInstance(s)}for(e=1;e<this._wwaData.objPartsMax;e++)if(this._wwaData.objectAttribute[e][Q.ATR_TYPE]!==Q.OBJECT_RANDOM){s=this._wwaData.objectAttribute[e][Q.ATR_SOUND];this.createWWAAudioInstance(s)}this._wwaData.message.forEach((function(e){return e.split("\n").forEach((function(e){var s=e.match(/^\$sound=(\d+)/);if(s&&!(s.length<2)){var a=parseInt(s[1],10);!isNaN(a)&&0<a&&a<K.NO_SOUND&&t.createWWAAudioInstance(a)}}))})),this._wwaData.bgm=0,this._soundLoadSkipFlag=!1},s.prototype.checkAllSoundLoaded=function(){var s=0,a=0;if(!this._hasTitleImg)var i=this._cvsCover.getContext("2d");this._keyStore.update(),this._keyStore.getKeyState(e.KEY_SPACE)===t.KEYDOWN&&(this._soundLoadSkipFlag=!0);for(var o=1;o<=Q.SOUND_MAX;o++){var r=this._audioInstances[o];void 0===r||r.isError()||(a++,r.hasData()&&s++)}if(s<a&&!this._soundLoadSkipFlag)return this._setProgressBar(Ge(s,a,j.AUDIO)),void window.requestAnimationFrame(this.soundCheckCaller);this._setProgressBar(Ge(Q.SOUND_MAX,Q.SOUND_MAX,j.AUDIO)),this._setLoadingMessage(i,j.FINISH),this.openGameWindow()},s.prototype._setSoundLoadedCheckTimer=function(t){var e=this,s=this._audioInstances[t];s.isError()||(this.soundLoadedCheckTimer=window.setInterval((function(){e._wwaData.bgm===t?s.hasData()?(s.play(),e._wwaData.bgm=t,e._clearSoundLoadedCheckTimer()):s.isError()&&e._clearSoundLoadedCheckTimer():e._clearSoundLoadedCheckTimer()}),100))},s.prototype._clearSoundLoadedCheckTimer=function(){this.soundLoadedCheckTimer&&(clearInterval(this.soundLoadedCheckTimer),this.soundLoadedCheckTimer=void 0)},s.prototype.playSound=function(t){if(this._isLoadedSound){if(t<0||t>Q.SOUND_MAX)throw new Error("サウンド番号が範囲外です。");if(!(t>=K.BGM_LB&&this._wwaData.bgm===t))if((t===K.NO_SOUND||t>=K.BGM_LB)&&0!==this._wwaData.bgm&&(this._audioInstances[this._wwaData.bgm].hasData()&&this._audioInstances[this._wwaData.bgm].pause(),this._wwaData.bgm=0),0!==t&&t!==K.NO_SOUND)this._audioInstances[t].hasData()?t>=K.BGM_LB?(this._audioInstances[t].play(),this._wwaData.bgm=t):this._audioInstances[t].play():t>=K.BGM_LB&&(this._wwaData.bgm=t,this._setSoundLoadedCheckTimer(t))}else t===K.NO_SOUND?this._wwaData.bgm=0:t>=K.BGM_LB&&(this._wwaData.bgm=t)},s.prototype.openGameWindow=function(){var t=this,e=this._player.getPosition();_t("wwa-cover").style.opacity="0",0!==this.getObjectIdByPosition(e)&&this._player.setPartsAppearedFlag();var s=_t("wwa-wrapper").getAttribute("data-wwa-resume-savedata");if("string"==typeof s&&(this._useSuspend=!0,s)){var a=qt.getStartWWAData(s);this._restartData!==a&&(this._applyQuickLoad(a),this._wwaSave.resumeStart())}setTimeout((function(){_t("wwa-wrapper").removeChild(_t("wwa-cover")),t._main()}),Q.SPLASH_SCREEN_DISP_MILLS)},s.prototype.onselectitem=function(t){if(this._player.canUseItem(t)){if(_t("item"+(t-1)).classList.add("onpress"),this.playSound(K.DECISION),"BLANK"===this._wwaData.message[W.USE_ITEM]){this._player.readyToUseItem(t);var e=this._player.useItem(),s=this.getObjectAttributeById(e,Q.ATR_STRING);this.setMessageQueue(this.getMessageById(s),!1,!1,e,I.OBJECT,this._player.getPosition().getPartsCoord())}else this.setMessageQueue(""===this._wwaData.message[W.USE_ITEM]?"このアイテムを使用します。\nよろしいですか?":this._wwaData.message[W.USE_ITEM],!0,!0),this._yesNoChoiceCallInfo=N.CALL_BY_ITEM_USE,this._yesNoUseItemPos=t;return!0}return!1},s.prototype.onselectbutton=function(t,e,s){void 0===e&&(e=!1),void 0===s&&(s=!1);var a=_t(F[t]);if(this.playSound(K.DECISION),this._itemMenu.close(),a.classList.add("onpress"),t===R.QUICK_LOAD)switch(this._yesNoChoiceCallInfo=this._wwaSave.getFirstSaveChoiceCallInfo(e),this._yesNoChoiceCallInfo){case N.CALL_BY_QUICK_LOAD:case N.CALL_BY_LOG_QUICK_LOAD:var i,o="";switch(this._yesNoChoiceCallInfo){case N.CALL_BY_QUICK_LOAD:o="読み込むデータを選んでください。",this._wwaSave.selectDBSaveDataList();break;case N.CALL_BY_LOG_QUICK_LOAD:o="読み込むオートセーブを選んでください。",this._wwaSave.selectLogSaveDataList()}switch(i=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword),this._messageWindow.createSaveDom(),i){case N.CALL_BY_LOG_QUICK_LOAD:this.setMessageQueue(o+"\n→Noでオートセーブ復帰画面に移ります。",!0,!0);break;case N.CALL_BY_PASSWORD_LOAD:this.setMessageQueue(o+"\n→Noでデータ復帰用パスワードの\n 入力選択ができます。",!0,!0);break;case N.NONE:this.setMessageQueue(o,!0,!0)}break;case N.CALL_BY_PASSWORD_LOAD:this.onpasswordloadcalled()}else if(t===R.QUICK_SAVE)this._wwaData.disableSaveFlag?this.setMessageQueue("ここではセーブ機能は\n使用できません。",!1,!0):(this._wwaSave.selectDBSaveDataList(),this._messageWindow.createSaveDom(),this._usePassword?(this.setMessageQueue("データの一時保存先を選んでください。\n→Noでデータ復帰用パスワードの\n 表示選択ができます。",!0,!0),this._yesNoChoiceCallInfo=N.CALL_BY_QUICK_SAVE):(this.setMessageQueue("データの一時保存先を選んでください。",!0,!0),this._yesNoChoiceCallInfo=N.CALL_BY_QUICK_SAVE));else if(t===R.RESTART_GAME)this.setMessageQueue("初めからスタートしなおしますか?",!0,!0),this._yesNoChoiceCallInfo=N.CALL_BY_RESTART_GAME;else if(t===R.GOTO_WWA)if(s)this._bottomButtonType!==c.GOTO_WWA&&_t(F[R.GOTO_WWA]).classList.remove("onpress"),this.setMessageQueue("WWAの公式サイトを開きますか?",!0,!0),this._yesNoChoiceCallInfo=N.CALL_BY_GOTO_WWA;else switch(this._bottomButtonType){case c.GOTO_WWA:this._yesNoChoiceCallInfo=N.CALL_BY_GOTO_WWA,this.setMessageQueue("WWAの公式サイトを開きますか?",!0,!0);break;case c.GAME_END:this._yesNoChoiceCallInfo=N.CALL_BY_END_GAME,this.setMessageQueue("WWAゲームを終了しますか?",!0,!0);break;case c.BATTLE_REPORT:this.launchBattleEstimateWindow()}},s.prototype.onpasswordloadcalled=function(){this._usePassword?(_t(F[R.QUICK_LOAD]).classList.add("onpress"),this.setMessageQueue("データ復帰用のパスワードを入力しますか?",!0,!0),this._yesNoChoiceCallInfo=N.CALL_BY_PASSWORD_LOAD):this.setMessageQueue("セーブデータがありません。",!1,!0)},s.prototype.onpasswordsavecalled=function(){_t(F[R.QUICK_SAVE]).classList.add("onpress"),this._wwaData.disableSaveFlag?this.setMessageQueue("ここではセーブ機能は\n使用できません。",!1,!0):this._useSuspend?(this.setMessageQueue("ゲームを中断しますか?",!0,!0),this._yesNoChoiceCallInfo=N.CALL_BY_SUSPEND):this._usePassword&&(this.setMessageQueue("データ復帰用のパスワードを表示しますか?",!0,!0),this._yesNoChoiceCallInfo=N.CALL_BY_PASSWORD_SAVE)},s.prototype.onpasssuspendsavecalled=function(){_t(F[R.QUICK_SAVE]).classList.add("onpress"),this._wwaData.disableSaveFlag?this.setMessageQueue("ここではセーブ機能は\n使用できません。",!1,!0):(this.setMessageQueue("ゲームを中断しますか?",!0,!0),this._yesNoChoiceCallInfo=N.CALL_BY_SUSPEND)},s.prototype.onitemmenucalled=function(){this.setMessageQueue("右のメニューを選択してください。",!1,!0),this._messageWindow.setItemMenuChoice(!0),this.playSound(K.DECISION),this._itemMenu.openView()},s.prototype.onchangespeed=function(t){if(this._wwaData.permitChangeGameSpeed){var e,s;if(e=t===L.UP?this._player.speedUp():this._player.speedDown(),s="移動速度を【"+J[e]+"】に切り替えました。\n"+(this.isBattleSpeedIndexForQuickBattle(e)?"戦闘も速くなります。\n":"")+"("+(Q.MAX_SPEED_INDEX+1)+"段階中"+(e+1)+")",this.userDevice.os===C.NINTENDO)s+="速度を落とすには-ボタン, 速度を上げるには+ボタンを押してください。";else s+="速度を落とすにはIキー, 速度を上げるにはPキーを押してください。";this.setMessageQueue(s,!1,!0)}else this.setMessageQueue("ここでは移動速度を\n変更できません。",!1,!0)},s.prototype.isBattleSpeedIndexForQuickBattle=function(t){return Q.QUICK_BATTLE_SPEED_INDECIES.some((function(e){return e===t}))},s.prototype._main=function(){var s=this;if(this._temporaryInputDisable=!1,this._stopUpdateByLoadFlag=!1,this._keyStore.update(),this._mouseStore.update(),this._gamePadStore.update(),this._waitFrame-- >0)window.requestAnimationFrame(this.mainCaller);else{this._waitFrame=0,void 0!==this._yesNoJudgeInNextFrame&&(this._yesNoJudge=this._yesNoJudgeInNextFrame,this._yesNoJudgeInNextFrame=void 0),this._clearFacesInNextFrame&&(this.clearFaces(),this._clearFacesInNextFrame=!1);for(var i=0;i<this._execMacroListInNextFrame.length;i++)this._execMacroListInNextFrame[i].execute();this._lastMessage.isEmpty()&&this._lastMessage.isEndOfPartsEvent&&void 0!==this._reservedMoveMacroTurn&&(this._player.setMoveMacroWaiting(this._reservedMoveMacroTurn),this._reservedMoveMacroTurn=void 0),this._execMacroListInNextFrame=[],this._player.mainFrameCount();this._player.getPosition();var o=this._player.getDir();if(this._player.isControllable())this._wwaData.disableSaveFlag||this._wwaSave.isAutoSaveFrame(this._player)&&this._quickSave(N.CALL_BY_LOG_QUICK_SAVE),this._player.isDelayFrame()?this._player.updateDelayFrame():this._actionGamePadButtonItemMacro()||(this._keyStore.getKeyStateForControllPlayer(e.KEY_LEFT)===t.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(e.KEY_UP)===t.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(e.KEY_RIGHT)===t.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._keyStore.getKeyStateForControllPlayer(e.KEY_DOWN)===t.KEYDOWN?this._checkTurnKeyPressed()?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.LEFT)===a.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.UP)===a.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.RIGHT)===a.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._mouseStore.getMouseStateForControllPlayer(u.DOWN)===a.MOUSEDOWN?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(D[o])?this._checkTurnKeyPressed()?this._player.setDir(o):(this._player.controll(o),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(e.KEY_LEFT)?this._checkTurnKeyPressed()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(e.KEY_UP)?this._checkTurnKeyPressed()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(e.KEY_RIGHT)?this._checkTurnKeyPressed()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._keyStore.checkHitKey(e.KEY_DOWN)?this._checkTurnKeyPressed()?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(u.LEFT)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(u.UP)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(u.RIGHT)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._mouseStore.checkClickMouse(u.DOWN)?this._mouseStore.touchIDIsSetDir()?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_LEFT)?this._gamePadStore.buttonPressed(r.BUTTON_INDEX_B)?this._player.setDir(u.LEFT):(this._player.controll(u.LEFT),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_UP)?this._gamePadStore.buttonPressed(r.BUTTON_INDEX_B)?this._player.setDir(u.UP):(this._player.controll(u.UP),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_RIGHT)?this._gamePadStore.buttonPressed(r.BUTTON_INDEX_B)?this._player.setDir(u.RIGHT):(this._player.controll(u.RIGHT),this._objectMovingDataManager.update()):this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_DOWN)?this._gamePadStore.buttonPressed(r.BUTTON_INDEX_B)?this._player.setDir(u.DOWN):(this._player.controll(u.DOWN),this._objectMovingDataManager.update()):this._keyStore.getKeyState(e.KEY_1)===t.KEYDOWN?this.onselectitem(1):this._keyStore.getKeyState(e.KEY_2)===t.KEYDOWN?this.onselectitem(2):this._keyStore.getKeyState(e.KEY_3)===t.KEYDOWN?this.onselectitem(3):this._keyStore.getKeyState(e.KEY_Q)===t.KEYDOWN?this.onselectitem(4):this._keyStore.getKeyState(e.KEY_W)===t.KEYDOWN?this.onselectitem(5):this._keyStore.getKeyState(e.KEY_E)===t.KEYDOWN?this.onselectitem(6):this._keyStore.getKeyState(e.KEY_A)===t.KEYDOWN?this.onselectitem(7):this._keyStore.getKeyState(e.KEY_S)===t.KEYDOWN?this.onselectitem(8):this._keyStore.getKeyState(e.KEY_D)===t.KEYDOWN?this.onselectitem(9):this._keyStore.getKeyState(e.KEY_Z)===t.KEYDOWN?this.onselectitem(10):this._keyStore.getKeyState(e.KEY_X)===t.KEYDOWN?this.onselectitem(11):this._keyStore.getKeyState(e.KEY_C)===t.KEYDOWN?this.onselectitem(12):this._keyStore.getKeyState(e.KEY_I)||this._gamePadStore.buttonTrigger(r.BUTTON_INDEX_MINUS)?this.onchangespeed(L.DOWN):this._keyStore.checkHitKey(e.KEY_P)||this._keyStore.checkHitKey(e.KEY_F2)||this._gamePadStore.buttonTrigger(r.BUTTON_INDEX_PLUS)?this.onchangespeed(L.UP):this._keyStore.getKeyState(e.KEY_F1)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_M)===t.KEYDOWN||this._gamePadStore.buttonTrigger(r.BUTTON_INDEX_A)?this.launchBattleEstimateWindow():this._keyStore.checkHitKey(e.KEY_F3)?(this.playSound(K.DECISION),this.onselectbutton(R.QUICK_LOAD,!0)):this._keyStore.checkHitKey(e.KEY_F4)?(this.playSound(K.DECISION),this._useSuspend?this.onpasssuspendsavecalled():this._usePassword&&this.onpasswordsavecalled()):this._keyStore.checkHitKey(e.KEY_F5)||this._gamePadStore.buttonTrigger(r.BUTTON_INDEX_A,r.BUTTON_INDEX_ZR)?this.onselectbutton(R.QUICK_LOAD):this._keyStore.checkHitKey(e.KEY_F6)||this._gamePadStore.buttonTrigger(r.BUTTON_INDEX_A,r.BUTTON_INDEX_ZL)?this.onselectbutton(R.QUICK_SAVE):this._keyStore.checkHitKey(e.KEY_F7)||this._gamePadStore.buttonTrigger(r.BUTTON_INDEX_A,r.BUTTON_INDEX_R)?this.onselectbutton(R.RESTART_GAME):this._keyStore.checkHitKey(e.KEY_F8)?this.onselectbutton(R.GOTO_WWA,!1,!0):this._keyStore.checkHitKey(e.KEY_F9)||this._gamePadStore.buttonTrigger(r.BUTTON_INDEX_X)?(this._player.isControllable()||this._messageWindow.isItemMenuChoice())&&this.onitemmenucalled():(this._keyStore.checkHitKey(e.KEY_F12)||this._gamePadStore.buttonTrigger(r.BUTTON_INDEX_Y))&&this._displayHelp()),this._keyStore.memorizeKeyStateOnControllableFrame(),this._mouseStore.memorizeMouseStateOnControllableFrame();else if(this._player.isJumped())this._camera.isResetting()||this._player.processAfterJump();else if(this._player.isMoving())this._player.move(),this._objectMovingDataManager.update();else if(this._player.isWaitingMessage())if(this._messageWindow.isVisible()||this._messageWindow.show(),this._messageWindow.isYesNoChoice())this._messageWindow.isSaveChoice()&&(this._messageWindow.saveUpdate(),this._messageWindow.isSaveClose()||(this._keyStore.checkHitKey(e.KEY_LEFT)||this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_LEFT)?this._messageWindow.saveControll(u.LEFT):this._keyStore.checkHitKey(e.KEY_UP)||this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_UP)?this._messageWindow.saveControll(u.UP):this._keyStore.checkHitKey(e.KEY_RIGHT)||this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_RIGHT)?this._messageWindow.saveControll(u.RIGHT):(this._keyStore.checkHitKey(e.KEY_DOWN)||this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_DOWN))&&this._messageWindow.saveControll(u.DOWN))),this._messageWindow.isInputDisable()||(this._yesNoJudge===g.UNSELECTED&&(this._keyStore.getKeyState(e.KEY_ENTER)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_Y)===t.KEYDOWN||this._gamePadStore.buttonTrigger(r.BUTTON_INDEX_A)?this._yesNoJudge=g.YES:(this._keyStore.getKeyState(e.KEY_N)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_ESC)===t.KEYDOWN||this._gamePadStore.buttonTrigger(r.BUTTON_INDEX_B))&&(this._yesNoJudge=g.NO)),(this._yesNoJudge===g.YES||this._yesNoJudge===g.NO)&&(this.playSound(K.DECISION),this._yesNoDispCounter=Q.YESNO_PRESS_DISP_FRAME_NUM,this._messageWindow.setInputDisable(),this._messageWindow.update()));else if(this._messageWindow.isItemMenuChoice()){if(this._itemMenu.update(),this._keyStore.checkHitKey(e.KEY_LEFT)||this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_LEFT)?this._itemMenu.controll(u.LEFT):this._keyStore.checkHitKey(e.KEY_UP)||this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_UP)?this._itemMenu.controll(u.UP):this._keyStore.checkHitKey(e.KEY_RIGHT)||this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_RIGHT)?this._itemMenu.controll(u.RIGHT):(this._keyStore.checkHitKey(e.KEY_DOWN)||this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_DOWN))&&this._itemMenu.controll(u.DOWN),this._keyStore.getKeyState(e.KEY_ENTER)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_Y)===t.KEYDOWN||this._gamePadStore.buttonTrigger(r.BUTTON_INDEX_A))this._setNextMessage(),this._messageWindow.setItemMenuChoice(!1),this._itemMenu.ok();else if(this._mouseStore.checkClickMouse(u.LEFT)||this._mouseStore.checkClickMouse(u.UP)||this._mouseStore.checkClickMouse(u.RIGHT)||this._mouseStore.checkClickMouse(u.DOWN)||this._keyStore.getKeyState(e.KEY_N)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_ESC)===t.KEYDOWN||this._gamePadStore.buttonTrigger(r.BUTTON_INDEX_B)){for(i=0;i<F.length;i++){(c=_t(F[i])).classList.contains("onpress")&&c.classList.remove("onpress")}this._itemMenu.ng(),this._setNextMessage(),this.playSound(K.DECISION),this._messageWindow.setItemMenuChoice(!1)}}else{var n=this._keyStore.getKeyStateForMessageCheck(e.KEY_ENTER),_=this._keyStore.getKeyStateForMessageCheck(e.KEY_SPACE),h=this._keyStore.getKeyStateForMessageCheck(e.KEY_ESC);if(n===t.KEYDOWN||n===t.KEYPRESS_MESSAGECHANGE||_===t.KEYDOWN||_===t.KEYPRESS_MESSAGECHANGE||h===t.KEYDOWN||h===t.KEYPRESS_MESSAGECHANGE||this._mouseStore.getMouseState()===a.MOUSEDOWN||this._gamePadStore.buttonTrigger(r.BUTTON_INDEX_A,r.BUTTON_INDEX_B)){for(i=0;i<F.length;i++){var c;(c=_t(F[i])).classList.contains("onpress")&&c.classList.remove("onpress")}this._setNextMessage()}}else this._player.isWatingEstimateWindow()?(this._keyStore.getKeyState(e.KEY_ENTER)===t.KEYDOWN||this._keyStore.getKeyState(e.KEY_SPACE)===t.KEYDOWN||this._gamePadStore.buttonTrigger(r.BUTTON_INDEX_A,r.BUTTON_INDEX_B))&&this.hideBattleEstimateWindow():this._player.isFighting()?(this._player.fight(),this._monsterWindow.update(this._monster)):this._player.isWaitingMoveMacro()&&(this._player.isMoveObjectAutoExecTime()&&(this.moveObjects(!1),this._player.resetMoveObjectAutoExecTimer()),this._objectMovingDataManager.update());if(this._prevFrameEventExected=!1,this._player.getPosition().isJustPosition()&&this._camera.getPosition().isScreenTopPosition()){if(!(this._player.isJumped()||this._player.isWaitingMessage()||this._player.isWatingEstimateWindow()||this._player.isWaitingMoveMacro()||this._player.isFighting())){this._player.isPartsAppearedTime()&&this._player.clearPartsAppearedFlag(),this._replaceRandomObjectsInScreen();var l=this.checkMap();l||this.checkObject(),this._prevFrameEventExected=l}this._player.isWaitingMessage()&&this._messageWindow.isYesNoChoice()&&this._yesNoJudge!==g.UNSELECTED&&!this._player.isWaitingMoveMacro()&&!this._player.isFighting()&&this._execChoiceWindowRunningEvent()}if(this._passwordLoadExecInNextFrame&&(this._stopUpdateByLoadFlag=!0,this._loadType=b.PASSWORD,this._player.clearPasswordWindowWaiting(),this._passwordLoadExecInNextFrame=!1),this._drawAll(),this._mainCallCounter++,this._mainCallCounter%=1e9,this._player.isWaitingMessage()&&this._isClassicModeEnable||(this._animationCounter=(this._animationCounter+1)%(2*Q.ANIMATION_REP_HALF_FRAME)),this._camera.isResetting()&&this._camera.advanceTransitionStepNum(),this._player.isWaitingMessage()||(this._player.decrementLookingAroundTimer(),this._statusPressCounter.energy>0&&0==--this._statusPressCounter.energy&&_t("disp-energy").classList.remove("onpress"),this._statusPressCounter.strength>0&&0==--this._statusPressCounter.strength&&_t("disp-strength").classList.remove("onpress"),this._statusPressCounter.defence>0&&0==--this._statusPressCounter.defence&&_t("disp-defence").classList.remove("onpress"),this._statusPressCounter.gold>0&&0==--this._statusPressCounter.gold&&_t("disp-gold").classList.remove("onpress")),this._player.isWaitingMoveMacro()&&this._player.decrementMoveObjectAutoExecTimer(),this._stopUpdateByLoadFlag?this._fadeout((function(){s._loadType===b.QUICK_LOAD?(s._quickLoad(),s.wwaCustomEvent("wwa_quickload")):s._loadType===b.RESTART_GAME?(s._restartGame(),s.wwaCustomEvent("wwa_restert")):s._loadType===b.PASSWORD&&(s._applyQuickLoad(s._passwordSaveExtractData),s._passwordSaveExtractData=void 0,s.wwaCustomEvent("wwa_passwordload")),setTimeout(s.mainCaller,Q.DEFAULT_FRAME_INTERVAL,s)})):window.requestAnimationFrame(this.mainCaller),null!==this._dumpElement)for(i=0;i<Q.USER_VAR_NUM;i++)this._dumpElement.querySelector(".var"+i.toString(10)).textContent=this._wwaData.userVar[i]+""}},s.prototype.vibration=function(t){this._gamePadStore.vibration(t)},s.prototype._drawAll=function(){var t,e,s=this._camera.getPosition().getPartsCoord(),a=this._camera.getPosition().getOffsetCoord(),i=Q.MAP_WINDOW_HEIGHT,o=this._player.getPosition().getPartsCoord();if(this._paintSkipByDoorOpen)this._paintSkipByDoorOpen=!1;else{if(this._cgManager.clearCanvas(0,0,Q.MAP_WINDOW_WIDTH,Q.MAP_WINDOW_HEIGHT),this._cgManager.drawBase(0,0,Q.MAP_WINDOW_WIDTH,Q.MAP_WINDOW_HEIGHT),this._camera.isResetting()){if(null!==this._camera.getPreviousPosition())var r=this._camera.getPreviousPosition().getPartsCoord(),n=this._camera.getPreviousPosition().getOffsetCoord();i=this._camera.getTransitionStepNum()*Q.CHIP_SIZE}var _=!1;if(i!==this._cgManager.mapCacheYLimit&&(this._cgManager.mapCacheYLimit=i,_=!0),s.x===this._cgManager.cpPartsLog.x&&s.y===this._cgManager.cpPartsLog.y||(this._cgManager.cpPartsLog.x=s.x,this._cgManager.cpPartsLog.y=s.y,_=!0),_&&(this._cgManager.clearBackCanvas(),this._cgManager.clearObjectCanvases()),this._camera.isResetting()&&(this._drawMap(r,n,i,!0),this._drawPlayer(r,n,i,!0),this._drawObjects(r,n,i,!0),this._camera.isFinalStep()))var h=255,c=setInterval((function(){var t=_t("wwa-fader");if((h-=3*Q.FADEOUT_SPEED)<=0)return clearInterval(c),t.style.backgroundColor="transparent",t.removeAttribute("style"),void(t.style.display="none");t.style.opacity=h/255+""}),20);this._drawMap(s,a,i,!1,_),this._drawPlayer(s,a,i),this._drawObjects(s,a,i,!1,_),this._player.isFighting()&&!this._player.isBattleStartFrame()&&(t=this._player.isTurn()?this._monster.position.x:o.x,e=this._player.isTurn()?this._monster.position.y:o.y,this._cgManager.drawCanvas(this._battleEffectCoord.x,this._battleEffectCoord.y,Q.CHIP_SIZE*(t-s.x)-a.x,Q.CHIP_SIZE*(e-s.y)-a.y)),this._drawEffect(),this._drawFaces(),this._drawFrame()}},s.prototype._drawMap=function(t,e,s,a,i){if(void 0===a&&(a=!1),void 0===i&&(i=!1),void 0!==t){var o,r=Math.max(0,t.x-1),n=Math.min(this._wwaData.mapWidth-1,t.x+Q.H_PARTS_NUM_IN_WINDOW),_=Math.max(0,t.y-1),h=Math.min(this._wwaData.mapWidth-1,t.y+Q.V_PARTS_NUM_IN_WINDOW);if(o=0,a)for(var c=r;c<=n;c++)for(var u=_;u<=h;u++){var l=this._wwaData.map[u][c],p=this._wwaData.mapAttribute[l][Q.ATR_X]/Q.CHIP_SIZE,d=this._wwaData.mapAttribute[l][Q.ATR_Y]/Q.CHIP_SIZE,E=Q.CHIP_SIZE*(c-t.x)-e.x,w=Q.CHIP_SIZE*(u-t.y)-e.y;this._cgManager.copyBackCanvasWithLowerYLimit(p,d,E,w,s)}else{for(c=r;c<=n;c++)for(u=_;u<=h;u++){l=this._wwaData.map[u][c];this._cgManager.mapCache[o]!==l&&(this._cgManager.mapCache[o]=l,i=!0),o++}if(i){this._cgManager.clearBackCanvasWithLowerYLimit(s);for(c=r;c<=n;c++)for(u=_;u<=h;u++){l=this._wwaData.map[u][c],p=this._wwaData.mapAttribute[l][Q.ATR_X]/Q.CHIP_SIZE,d=this._wwaData.mapAttribute[l][Q.ATR_Y]/Q.CHIP_SIZE,E=Q.CHIP_SIZE*(c-t.x)-e.x,w=Q.CHIP_SIZE*(u-t.y)-e.y;this._cgManager.copyBackCanvasWithUpperYLimit(p,d,E,w,s)}}this._cgManager.drawBackCanvas()}}},s.prototype._drawPlayer=function(t,e,s,a){if(void 0===a&&(a=!1),void 0!==t&&!this._wwaData.delPlayerFlag){var i,o=this._player.getPosition().getPartsCoord(),r=this._player.getPosition().getOffsetCoord(),n=v[this._player.getDir()],_=(o.x-t.x)*Q.CHIP_SIZE+r.x-e.x,h=(o.y-t.y)*Q.CHIP_SIZE+r.y-e.y;Math.abs(r.x),Math.abs(r.y),this._player.getDir();i=this._useLookingAround&&this._player.isLookingAround()&&!this._player.isWaitingMessage()?this._wwaData.playerImgPosX+[2,3,4,5,0,1,6,7][Math.floor(this._mainCallCounter%64/8)]:this._player.isMovingImage()?this._wwaData.playerImgPosX+n+1:this._wwaData.playerImgPosX+n,a?this._cgManager.drawCanvasWithLowerYLimit(i,this._wwaData.playerImgPosY,_,h,s):this._cgManager.drawCanvasWithUpperYLimit(i,this._wwaData.playerImgPosY,_,h,s)}},s.prototype._drawObjects=function(t,e,s,a,i){if(void 0===a&&(a=!1),void 0===i&&(i=!1),void 0!==t){var o,r,n,_,h,c,u,l,p,d,E,y,m,g,A=Math.max(0,t.x-1),S=Math.min(this._wwaData.mapWidth-1,t.x+Q.H_PARTS_NUM_IN_WINDOW),I=Math.max(0,t.y-1),T=Math.min(this._wwaData.mapWidth-1,t.y+Q.V_PARTS_NUM_IN_WINDOW),O=0,v=this._animationCounter>Q.ANIMATION_REP_HALF_FRAME,D=this._player.isFighting()&&this._player.isTurn()&&this._player.getPosition().getPartsCoord().equals(this._monster.position);if(a)for(d=A;d<=S;d++)for(E=I;E<=T;E++)D&&new w(d,E).equals(this._monster.position)||(y=this._wwaData.mapObject[E][d],o=new w(0,0),this._wwaData.objectAttribute[y][Q.ATR_MOVE]!==B.STATIC&&null!==(p=this._objectMovingDataManager.getOffsetByBeforePartsCoord(new w(d,E)))&&(o=p),h=Q.CHIP_SIZE*(d-t.x)+o.x-e.x,c=Q.CHIP_SIZE*(E-t.y)+o.y-e.y,r=v||0===this._wwaData.objectAttribute[y][Q.ATR_X2]&&0===this._wwaData.objectAttribute[y][Q.ATR_Y2],n=this._wwaData.objectAttribute[y][r?Q.ATR_X:Q.ATR_X2]/Q.CHIP_SIZE,_=this._wwaData.objectAttribute[y][r?Q.ATR_Y:Q.ATR_Y2]/Q.CHIP_SIZE,u=this._wwaData.objectAttribute[y][Q.ATR_TYPE],l=this._wwaData.objectAttribute[y][Q.ATR_NUMBER],0===y||this._checkNoDrawObject(new w(d,E),u,l)||this._cgManager.copyObjectCanvasWithLowerYLimit(v?1:0,n,_,h,c,s));else{var C,P,M,N,R,L=[],b=[];for(d=A;d<=S;d++)for(E=I;E<=T;E++)m=y=this._wwaData.mapObject[E][d],u=this._wwaData.objectAttribute[y][Q.ATR_TYPE],l=this._wwaData.objectAttribute[y][Q.ATR_NUMBER],this._checkNoDrawObject(new w(d,E),u,l)&&(m=0),P=this._wwaData.objectAttribute[y][Q.ATR_MOVE]===B.STATIC,0!==m&&(M=!(!D||!new w(d,E).equals(this._monster.position)),P?b.push(new f(y,d,E,P,M)):(L.push(new f(y,d,E,P,M)),m=0),M&&(m=0)),this._cgManager.mapObjectCache[O]!==m&&(this._cgManager.mapObjectCache[O]=m,i=!0),O++;for(i&&(this._cgManager.clearObjectCanvasesWithLowerYLimit(s),Array.prototype.push.apply(L,b)),R=L.length,N=0;N<R;N++)if(d=(C=L[N]).x,E=C.y,y=C.partsIDObj,P=C.isStatic,M=C.isFighting,h=Q.CHIP_SIZE*(d-t.x)-e.x,c=Q.CHIP_SIZE*(E-t.y)-e.y,P){if(M)continue;for(g=0;g<2;g++)r=!!g||0===this._wwaData.objectAttribute[y][Q.ATR_X2]&&0===this._wwaData.objectAttribute[y][Q.ATR_Y2],n=this._wwaData.objectAttribute[y][r?Q.ATR_X:Q.ATR_X2]/Q.CHIP_SIZE,_=this._wwaData.objectAttribute[y][r?Q.ATR_Y:Q.ATR_Y2]/Q.CHIP_SIZE,this._cgManager.copyObjectCanvasWithUpperYLimit(g,n,_,h,c,s)}else null!==(p=this._objectMovingDataManager.getOffsetByBeforePartsCoord(new w(d,E)))&&(h+=p.x,c+=p.y),r=v||0===this._wwaData.objectAttribute[y][Q.ATR_X2]&&0===this._wwaData.objectAttribute[y][Q.ATR_Y2],n=this._wwaData.objectAttribute[y][r?Q.ATR_X:Q.ATR_X2]/Q.CHIP_SIZE,_=this._wwaData.objectAttribute[y][r?Q.ATR_Y:Q.ATR_Y2]/Q.CHIP_SIZE,this._cgManager.drawCanvasWithUpperYLimit(n,_,h,c,s);this._cgManager.drawObjectCanvas(v?1:0)}}},s.prototype._drawEffect=function(){if(0!==this._wwaData.effectCoords.length&&0!==this._wwaData.effectWaits){var t=Math.floor(this._mainCallCounter%(this._wwaData.effectCoords.length*this._wwaData.effectWaits)/this._wwaData.effectWaits);this._cgManager.drawEffect(t)}},s.prototype._drawFaces=function(){for(var t=0;t<this._faces.length;t++)this._cgManager.drawCanvasWithSize(this._faces[t].srcPos.x,this._faces[t].srcPos.y,this._faces[t].srcSize.x,this._faces[t].srcSize.y,this._faces[t].destPos.x,this._faces[t].destPos.y)},s.prototype._drawFrame=function(){this._cgManager.drawFrame()},s.prototype._checkNoDrawObject=function(t,e,s){var a=this._player.getPosition(),i=a.getPartsCoord();return!(!a.isJustPosition()||i.x!==t.x||i.y!==t.y||this._wwaData.objectNoCollapseDefaultFlag)&&(e===Q.OBJECT_DOOR&&0===s||(e===Q.OBJECT_STATUS||e===Q.OBJECT_MESSAGE||e===Q.OBJECT_ITEM||e===Q.OBJECT_SELL||e===Q.OBJECT_BUY||e===Q.OBJECT_SELL||e===Q.OBJECT_LOCALGATE))},s.prototype.getMapWidth=function(){if(void 0===this._wwaData)throw new Error("マップデータがロードされていません");return this._wwaData.mapWidth},s.prototype.getMapIdByPosition=function(t){var e=t.getPartsCoord();return this._wwaData.map[e.y][e.x]},s.prototype.getObjectIdByPosition=function(t){var e=t.getPartsCoord();return this._wwaData.mapObject[e.y][e.x]},s.prototype.getMapTypeByPosition=function(t){var e=t.getPartsCoord(),s=this._wwaData.map[e.y][e.x];return this._wwaData.mapAttribute[s][Q.ATR_TYPE]},s.prototype.getObjectTypeByPosition=function(t){var e=t.getPartsCoord(),s=this._wwaData.mapObject[e.y][e.x];return this._wwaData.objectAttribute[s][Q.ATR_TYPE]},s.prototype.getMapAttributeByPosition=function(t,e){var s=t.getPartsCoord(),a=this._wwaData.map[s.y][s.x];return this._wwaData.mapAttribute[a][e]},s.prototype.isCurrentPosMapPartsIncludingMessage=function(t){return 0!==this.getMapAttributeByPosition(t,Q.ATR_STRING)},s.prototype.getObjectAttributeByPosition=function(t,e){var s=t.getPartsCoord(),a=this._wwaData.mapObject[s.y][s.x];return this._wwaData.objectAttribute[a][e]},s.prototype.getMapAttributeById=function(t,e){return this._wwaData.mapAttribute[t][e]},s.prototype.getObjectAttributeById=function(t,e){return this._wwaData.objectAttribute[t][e]},s.prototype.getObjectCropXById=function(t){return this._wwaData.objectAttribute[t][Q.ATR_X]},s.prototype.getObjectCropYById=function(t){return this._wwaData.objectAttribute[t][Q.ATR_Y]},s.prototype.getMessageById=function(t){return this._wwaData.message[t]},s.prototype.getSystemMessageById=function(t){return this._wwaData.systemMessage[t]},s.prototype.checkMap=function(t){var e=this._player.getPosition().getPartsCoord();t=null!=t?t:e;var s=this._wwaData.map[t.y][t.x],a=this._wwaData.mapAttribute[s][Q.ATR_TYPE],i=t.x===e.x&&t.y===e.y,o=!1;return(!i||this._player.getLastExecPartsIDOnSamePosition(I.MAP)!==s)&&(a===Q.MAP_STREET?o=this._execMapStreetEvent(t,s,a):a===Q.MAP_WALL?o=this._execMapWallEvent(t,s,a):a===Q.MAP_LOCALGATE?o=this._execMapLocalGateEvent(t,s,a):a===Q.MAP_URLGATE&&(o=this._execMapUrlGateEvent(t,s,a)),i&&!this._player.isJumped()&&this._player.setLastExecInfoOnSamePosition(I.MAP,s),o)},s.prototype.checkObject=function(t){var e=this._player.getPosition().getPartsCoord();t=null!=t?t:e;var s=this._wwaData.mapObject[t.y][t.x],a=this._wwaData.objectAttribute[s][Q.ATR_TYPE],i=t.x===e.x&&t.y===e.y;i&&this._player.getLastExecPartsIDOnSamePosition(I.OBJECT)===s||(a===Q.OBJECT_NORMAL?this._execObjectNormalEvent(t,s,a):a===Q.OBJECT_MESSAGE?this._execObjectMessageEvent(t,s,a):a===Q.OBJECT_MONSTER?this._execObjectMonsterEvent(t,s,a):a===Q.OBJECT_ITEM?this._execObjectItemEvent(t,s,a):a===Q.OBJECT_DOOR?this._execObjectDoorEvent(t,s,a):a===Q.OBJECT_STATUS?this._execObjectStatusEvent(t,s,a):a===Q.OBJECT_BUY?this._execObjectBuyEvent(t,s,a):a===Q.OBJECT_SELL?this._execObjectSellEvent(t,s,a):a===Q.OBJECT_URLGATE?this._execObjectUrlGateEvent(t,s,a):a===Q.OBJECT_SCORE?this._execObjectScoreEvent(t,s,a):a===Q.OBJECT_SELECT?this._execObjectYesNoChoiceEvent(t,s,a):a===Q.OBJECT_LOCALGATE&&this._execObjectLocalGateEvent(t,s,a),i&&!this._player.isJumped()&&this._player.setLastExecInfoOnSamePosition(I.OBJECT,s))},s.prototype._execMapStreetEvent=function(t,e,s){var a=this._wwaData.mapAttribute[e][Q.ATR_ITEM];if(0!==a&&!this._player.hasItem(a))return!1;this.appearParts(t,A.MAP);var i=this._wwaData.mapAttribute[e][Q.ATR_STRING],o=this._wwaData.message[i];this._waitFrame+=this._wwaData.mapAttribute[e][Q.ATR_NUMBER]*Q.WAIT_TIME_FRAME_NUM,this._temporaryInputDisable=!0;var r=this.setMessageQueue(o,!1,!1,e,I.MAP,t.clone());return this.playSound(this._wwaData.mapAttribute[e][Q.ATR_SOUND]),0!==i&&r},s.prototype._execMapWallEvent=function(t,e,s){var a=this.getObjectIdByPosition(t.convertIntoPosition(this)),i=this.getObjectAttributeById(a,Q.ATR_TYPE);if(0===a||i===Q.OBJECT_NORMAL||i===Q.OBJECT_DOOR&&(!this._player.hasItem(this.getObjectAttributeById(a,Q.ATR_ITEM))||this.getObjectAttributeById(i,Q.ATR_MODE)===Q.PASSABLE_OBJECT)){this.appearParts(t,A.MAP);var o=this._wwaData.mapAttribute[e][Q.ATR_STRING],r=this._wwaData.message[o];return this.setMessageQueue(r,!1,!1,e,I.MAP,t.clone()),this.playSound(this._wwaData.mapAttribute[e][Q.ATR_SOUND]),!1}return!1},s.prototype._execMapLocalGateEvent=function(t,e,s){var a=this._player.getPosition().getPartsCoord(),i=this._wwaData.mapAttribute[e][Q.ATR_JUMP_X],o=this._wwaData.mapAttribute[e][Q.ATR_JUMP_Y];return i>Q.RELATIVE_COORD_LOWER&&(i=t.x+i-Q.RELATIVE_COORD_BIAS),o>Q.RELATIVE_COORD_LOWER&&(o=t.y+o-Q.RELATIVE_COORD_BIAS),this.appearParts(t,A.MAP),0<=i&&0<=o&&i<this._wwaData.mapWidth&&o<this._wwaData.mapWidth&&(i!==a.x||o!==a.y)&&(this._player.jumpTo(new y(this,i,o,0,0)),this.playSound(this._wwaData.mapAttribute[e][Q.ATR_SOUND]),!0)},s.prototype._execMapUrlGateEvent=function(t,e,s){var a=this._wwaData.mapAttribute[e][Q.ATR_STRING];return!this._isURLGateEnable||("BLANK"!==this._wwaData.message[W.ASK_LINK]?(this.setMessageQueue(""===this._wwaData.message[W.ASK_LINK]?"他のページにリンクします。\nよろしいですか?":this._wwaData.message[W.ASK_LINK],!0,!0),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=N.CALL_BY_MAP_PARTS,this._yesNoURL=this._wwaData.message[a].split(/\s/g)[0],!0):void(location.href=pt(this._wwaData.message[a].split(/\s/g)[0])))},s.prototype._execObjectNormalEvent=function(t,e,s){},s.prototype._execObjectMessageEvent=function(t,e,s){var a=this._wwaData.objectAttribute[e][Q.ATR_STRING],i=this._wwaData.message[a],o=this._player.getPosition().getPartsCoord(),r=this._wwaData.objectAttribute[e][Q.ATR_SOUND];t.x!==o.x||t.y!==o.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(I.OBJECT,0,t),this.setMessageQueue(i,!1,!1,e,I.OBJECT,t),this._waitFrame+=this._wwaData.objectAttribute[e][Q.ATR_NUMBER]*Q.WAIT_TIME_FRAME_NUM,this._temporaryInputDisable=!0,this.appearParts(t,A.OBJECT,e),this.playSound(r)},s.prototype._execObjectStatusEvent=function(t,e,s){var a=new E(this._wwaData.objectAttribute[e][Q.ATR_ENERGY],this._wwaData.objectAttribute[e][Q.ATR_STRENGTH],this._wwaData.objectAttribute[e][Q.ATR_DEFENCE],this._wwaData.objectAttribute[e][Q.ATR_GOLD]),i=this._wwaData.objectAttribute[e][Q.ATR_STRING],o=this._wwaData.message[i],r=this._player.getStatusWithoutEquipments();if(a.strength>Q.STATUS_MINUS_BORDER&&r.strength<a.strength-Q.STATUS_MINUS_BORDER||a.defence>Q.STATUS_MINUS_BORDER&&r.defence<a.defence-Q.STATUS_MINUS_BORDER||a.gold>Q.STATUS_MINUS_BORDER&&r.gold<a.gold-Q.STATUS_MINUS_BORDER)return this.setPartsOnPosition(I.OBJECT,0,t),this._keyStore.allClear(),void this._mouseStore.clear();a.energy=a.energy>Q.STATUS_MINUS_BORDER?Q.STATUS_MINUS_BORDER-a.energy:a.energy,a.strength=a.strength>Q.STATUS_MINUS_BORDER?Q.STATUS_MINUS_BORDER-a.strength:a.strength,a.defence=a.defence>Q.STATUS_MINUS_BORDER?Q.STATUS_MINUS_BORDER-a.defence:a.defence,a.gold=a.gold>Q.STATUS_MINUS_BORDER?Q.STATUS_MINUS_BORDER-a.gold:a.gold,this._player.addStatusAll(a),this.setStatusChangedEffect(a),this._player.isDead()&&0!==this._wwaData.objectAttribute[e][Q.ATR_ENERGY]?this.gameover():(this.setMessageQueue(o,!1,!1,e,I.OBJECT,t.clone()),this.setPartsOnPosition(I.OBJECT,0,t),this.appearParts(t,A.OBJECT,e),this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND]))},s.prototype._execObjectMonsterEvent=function(t,e,s){var a=this,i=new w(this._wwaData.objectAttribute[e][Q.ATR_X],this._wwaData.objectAttribute[e][Q.ATR_Y]),o=new E(this._wwaData.objectAttribute[e][Q.ATR_ENERGY],this._wwaData.objectAttribute[e][Q.ATR_STRENGTH],this._wwaData.objectAttribute[e][Q.ATR_DEFENCE],this._wwaData.objectAttribute[e][Q.ATR_GOLD]),r=this._wwaData.message[this._wwaData.objectAttribute[e][Q.ATR_STRING]],n=this._wwaData.objectAttribute[e][Q.ATR_ITEM];this._monster=new St(e,t,i,o,r,n,(function(){a._monsterWindow.hide()})),this._player.startBattleWith(this._monster)},s.prototype._execObjectBuyEvent=function(t,e,s){var a=this._wwaData.objectAttribute[e][Q.ATR_STRING],i=this._wwaData.message[a],o=this._player.getPosition().getPartsCoord();t.x!==o.x||t.y!==o.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(I.OBJECT,0,t),this.setMessageQueue(i,!0,!1,e,I.OBJECT,t.clone()),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=N.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND])},s.prototype._execObjectSellEvent=function(t,e,s){var a=this._wwaData.objectAttribute[e][Q.ATR_STRING],i=this._wwaData.message[a],o=this._player.getPosition().getPartsCoord();t.x!==o.x||t.y!==o.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(I.OBJECT,0,t),this.setMessageQueue(i,!0,!1,e,I.OBJECT,t.clone()),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=N.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND])},s.prototype._execObjectItemEvent=function(t,e,s){var a=this._wwaData.objectAttribute[e][Q.ATR_STRING],i=this._wwaData.message[a];try{var o=this._camera.getPosition().getScreenTopPosition().getPartsCoord(),r=(t.x-o.x)*Q.CHIP_SIZE,n=(t.y-o.y)*Q.CHIP_SIZE;this._player.addItem(e,this._wwaData.objectAttribute[e][Q.ATR_NUMBER],!1,this._wwaData.isItemEffectEnabled?{screenPixelCoord:new w(r,n),itemBoxBackgroundImageCoord:new w(this._wwaData.imgItemboxX*Q.CHIP_SIZE,this._wwaData.imgItemboxY*Q.CHIP_SIZE)}:void 0),this.setPartsOnPosition(I.OBJECT,0,t),0!==this._wwaData.objectAttribute[e][Q.ATR_MODE]||(this.setMessageQueue(i,!1,!1,e,I.OBJECT,t.clone()),this.appearParts(t,A.OBJECT,e))}catch(t){"BLANK"!==this._wwaData.systemMessage[Y.FULL_ITEM]&&this.setMessageQueue(""===this._wwaData.systemMessage[Y.FULL_ITEM]?"これ以上、アイテムを持てません。":this._wwaData.systemMessage[Y.FULL_ITEM],!1,!0)}this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND])},s.prototype._execObjectDoorEvent=function(t,e,s){var a=this._wwaData.objectAttribute[e][Q.ATR_ITEM],i=this._wwaData.objectAttribute[e][Q.ATR_STRING],o=this._wwaData.message[i];this._player.hasItem(a)&&(0===this._wwaData.objectAttribute[e][Q.ATR_MODE]&&this._player.removeItemByPartsID(a),this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND]),this.setMessageQueue(o,!1,!1,e,I.OBJECT,t.clone()),this.setPartsOnPosition(I.OBJECT,0,t),this.appearParts(t,A.OBJECT,e),this._paintSkipByDoorOpen=!0)},s.prototype._execObjectYesNoChoiceEvent=function(t,e,s){var a=this._wwaData.objectAttribute[e][Q.ATR_STRING],i=this._wwaData.message[a],o=this._player.getPosition().getPartsCoord();t.x!==o.x||t.y!==o.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(I.OBJECT,0,t),this.setMessageQueue(i,!0,!1,e,I.OBJECT,t.clone()),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=N.CALL_BY_OBJECT_PARTS,this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND])},s.prototype._execObjectLocalGateEvent=function(t,e,s){var a=this._player.getPosition().getPartsCoord();t.x!==a.x||t.y!==a.y||this._wwaData.objectNoCollapseDefaultFlag||this.setPartsOnPosition(I.OBJECT,0,t);var i=this._wwaData.objectAttribute[e][Q.ATR_JUMP_X],o=this._wwaData.objectAttribute[e][Q.ATR_JUMP_Y];i>Q.RELATIVE_COORD_LOWER&&(i=a.x+i-Q.RELATIVE_COORD_BIAS),o>Q.RELATIVE_COORD_LOWER&&(o=a.y+o-Q.RELATIVE_COORD_BIAS),this.appearParts(t,A.OBJECT,e),0<=i&&0<=o&&i<this._wwaData.mapWidth&&o<this._wwaData.mapWidth&&(i!==a.x||o!==a.y)&&(this._player.jumpTo(new y(this,i,o,0,0)),this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND]))},s.prototype._execObjectUrlGateEvent=function(t,e,s){var a=this._wwaData.objectAttribute[e][Q.ATR_STRING];this._isURLGateEnable&&("BLANK"!==this._wwaData.message[W.ASK_LINK]?(this.setMessageQueue(""===this._wwaData.message[W.ASK_LINK]?"他のページにリンクします。\nよろしいですか?":this._wwaData.message[W.ASK_LINK],!0,!0),this._yesNoChoicePartsCoord=t,this._yesNoChoicePartsID=e,this._yesNoChoiceCallInfo=N.CALL_BY_OBJECT_PARTS,this._yesNoURL=this._wwaData.message[a].split(/\s/g)[0]):location.href=pt(this._wwaData.message[a].split(/\s/g)[0]))},s.prototype._execObjectScoreEvent=function(t,e,s){var a=this._wwaData.objectAttribute[e][Q.ATR_STRING],i=0===a?"スコアを表示します。":this._wwaData.message[a];this.getMessageQueueByRawMessage(i,e,I.OBJECT,t).reduce((function(t,e){return t||!e.isEmpty()}),!1)&&(this._scoreRates={energy:this._wwaData.objectAttribute[e][Q.ATR_ENERGY],strength:this._wwaData.objectAttribute[e][Q.ATR_STRENGTH],defence:this._wwaData.objectAttribute[e][Q.ATR_DEFENCE],gold:this._wwaData.objectAttribute[e][Q.ATR_GOLD]},this.updateScore(),this._scoreWindow.show()),this.setMessageQueue(i,!1,!1,e,I.OBJECT,t),this.playSound(this._wwaData.objectAttribute[e][Q.ATR_SOUND])},s.prototype.updateScore=function(){if(this._scoreRates){var t=this._player.getStatus().calculateScore(this._scoreRates);this._scoreWindow.update(t)}},s.prototype._execChoiceWindowRunningEvent=function(){var t,e;if(0==--this._yesNoDispCounter)if(this._yesNoJudge===g.YES){if(this._yesNoChoiceCallInfo===N.CALL_BY_MAP_PARTS)(t=this._wwaData.mapAttribute[this._yesNoChoicePartsID][Q.ATR_TYPE])===Q.MAP_URLGATE&&(location.href=pt(this._yesNoURL));else if(this._yesNoChoiceCallInfo===N.CALL_BY_OBJECT_PARTS)if((t=this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_TYPE])===Q.OBJECT_BUY)this._player.hasItem(this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_ITEM])?(this._player.removeItemByPartsID(this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_ITEM]),e=this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_GOLD],this._player.earnGold(e),this.setStatusChangedEffect(new E(0,0,0,e)),this.appearParts(this._yesNoChoicePartsCoord,A.OBJECT,this._yesNoChoicePartsID)):"BLANK"!==this._wwaData.message[W.NO_ITEM]&&this._messageQueue.push(new vt(""===this._wwaData.message[W.NO_ITEM]?"アイテムを持っていない。":this._wwaData.message[W.NO_ITEM],!0));else if(t===Q.OBJECT_SELL)if(this._player.hasGold(this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_GOLD]))if(this._player.canHaveMoreItems()||0===this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_ITEM]){if(0!==this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_ITEM]){var s=this._yesNoChoicePartsCoord,a=this._camera.getPosition().getScreenTopPosition().getPartsCoord(),i=(s.x-a.x)*Q.CHIP_SIZE,o=(s.y-a.y)*Q.CHIP_SIZE;this._player.addItem(this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_ITEM],0,!1,this._wwaData.isItemEffectEnabled?{screenPixelCoord:new w(i,o),itemBoxBackgroundImageCoord:new w(this._wwaData.imgItemboxX*Q.CHIP_SIZE,this._wwaData.imgItemboxY*Q.CHIP_SIZE)}:void 0)}var r=new E(this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_ENERGY],this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_STRENGTH],this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_DEFENCE],-this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_GOLD]);this._player.getStatusWithoutEquipments();if(r.energy=r.energy>Q.STATUS_MINUS_BORDER?Q.STATUS_MINUS_BORDER-r.energy:r.energy,this.setStatusChangedEffect(r),this._player.addStatusAll(r),this._player.isDead()&&0!==this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_ENERGY])return void this.gameover();this.appearParts(this._yesNoChoicePartsCoord,A.OBJECT,this._yesNoChoicePartsID)}else"BLANK"!==this._wwaData.systemMessage[Y.FULL_ITEM]&&this._messageQueue.push(new vt(""===this._wwaData.systemMessage[Y.FULL_ITEM]?"これ以上、アイテムを持てません。":this._wwaData.systemMessage[Y.FULL_ITEM],!0));else"BLANK"!==this._wwaData.message[W.NO_MONEY]&&this._messageQueue.push(new vt(""===this._wwaData.message[W.NO_MONEY]?"所持金がたりない。":this._wwaData.message[W.NO_MONEY],!0));else t===Q.OBJECT_SELECT?this.appearParts(this._yesNoChoicePartsCoord,A.CHOICE_YES,this._yesNoChoicePartsID):t===Q.OBJECT_URLGATE&&(location.href=pt(this._yesNoURL));else this._yesNoChoiceCallInfo===N.CALL_BY_ITEM_USE?this._player.readyToUseItem(this._yesNoUseItemPos):this._yesNoChoiceCallInfo===N.CALL_BY_QUICK_LOAD||this._yesNoChoiceCallInfo===N.CALL_BY_LOG_QUICK_LOAD?(this._messageWindow.deleteSaveDom(),_t(F[R.QUICK_LOAD]).classList.remove("onpress"),this._messageWindow.load()&&(this._stopUpdateByLoadFlag=!0,this._loadType=b.QUICK_LOAD)):this._yesNoChoiceCallInfo===N.CALL_BY_QUICK_SAVE?(this._messageWindow.deleteSaveDom(),_t(F[R.QUICK_SAVE]).classList.remove("onpress"),this._quickSave(N.CALL_BY_QUICK_SAVE)):this._yesNoChoiceCallInfo===N.CALL_BY_RESTART_GAME?(_t(F[R.RESTART_GAME]).classList.remove("onpress"),this._stopUpdateByLoadFlag=!0,this._loadType=b.RESTART_GAME):this._yesNoChoiceCallInfo===N.CALL_BY_END_GAME?(window.history.back(-1),_t(F[R.GOTO_WWA]).classList.remove("onpress")):this._yesNoChoiceCallInfo===N.CALL_BY_GOTO_WWA?(location.href=pt(Q.WWA_HOME),_t(F[R.GOTO_WWA]).classList.remove("onpress")):this._yesNoChoiceCallInfo===N.CALL_BY_PASSWORD_LOAD?(_t(F[R.QUICK_LOAD]).classList.remove("onpress"),this._player.setPasswordWindowWating(),this._passwordWindow.show(Lt.LOAD)):this._yesNoChoiceCallInfo===N.CALL_BY_PASSWORD_SAVE?(_t(F[R.QUICK_SAVE]).classList.remove("onpress"),this._player.setPasswordWindowWating(),this._passwordWindow.password=this._quickSave(N.CALL_BY_PASSWORD_SAVE),this._passwordWindow.show(Lt.SAVE)):this._yesNoChoiceCallInfo===N.CALL_BY_SUSPEND&&(_t(F[R.QUICK_SAVE]).classList.remove("onpress"),this._quickSave(N.CALL_BY_SUSPEND));this._yesNoJudge=g.UNSELECTED,this._setNextMessage(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=N.NONE,this._messageWindow.setYesNoChoice(!1)}else if(this._yesNoJudge===g.NO){if(this._yesNoChoiceCallInfo===N.CALL_BY_MAP_PARTS)t=this._wwaData.mapAttribute[this._yesNoChoicePartsID][Q.ATR_TYPE],Q.MAP_URLGATE;else if(this._yesNoChoiceCallInfo===N.CALL_BY_OBJECT_PARTS)(t=this._wwaData.objectAttribute[this._yesNoChoicePartsID][Q.ATR_TYPE])===Q.OBJECT_BUY||t===Q.OBJECT_SELL||(t===Q.OBJECT_SELECT?this.appearParts(this._yesNoChoicePartsCoord,A.CHOICE_NO,this._yesNoChoicePartsID):Q.OBJECT_URLGATE);else if(this._yesNoChoiceCallInfo===N.CALL_BY_ITEM_USE){_t("item"+(this._yesNoUseItemPos-1)).classList.remove("onpress")}else if(this._yesNoChoiceCallInfo===N.CALL_BY_QUICK_LOAD||this._yesNoChoiceCallInfo===N.CALL_BY_LOG_QUICK_LOAD)switch(this._messageWindow.deleteSaveDom(),this._yesNoChoiceCallInfo=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword),this._yesNoChoiceCallInfo){case N.NONE:_t(F[R.QUICK_LOAD]).classList.remove("onpress");break;case N.CALL_BY_PASSWORD_LOAD:return this._yesNoJudge=g.UNSELECTED,void this.onpasswordloadcalled();case N.CALL_BY_LOG_QUICK_LOAD:this._wwaSave.selectLogSaveDataList(),this._messageWindow.createSaveDom();var n=this._wwaSave.getSecondSaveChoiceCallInfo(this._usePassword);switch(this._yesNoJudge=g.UNSELECTED,n){case N.CALL_BY_PASSWORD_LOAD:this.setMessageQueue("読み込むオートセーブを選んでください。\n→Noでデータ復帰用パスワードの\n 入力選択ができます。",!0,!0);break;case N.NONE:this.setMessageQueue("読み込むオートセーブを選んでください。",!0,!0)}return}else if(this._yesNoChoiceCallInfo===N.CALL_BY_QUICK_SAVE){if(this._messageWindow.deleteSaveDom(),this._usePassword||this._useSuspend)return this._yesNoJudge=g.UNSELECTED,void(this._useSuspend?this.onpasssuspendsavecalled():this._usePassword&&this.onpasswordsavecalled());_t(F[R.QUICK_SAVE]).classList.remove("onpress")}else if(this._yesNoChoiceCallInfo===N.CALL_BY_RESTART_GAME)_t(F[R.RESTART_GAME]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===N.CALL_BY_END_GAME)_t(F[R.GOTO_WWA]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===N.CALL_BY_GOTO_WWA)_t(F[R.GOTO_WWA]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===N.CALL_BY_PASSWORD_LOAD)_t(F[R.QUICK_LOAD]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===N.CALL_BY_PASSWORD_SAVE)_t(F[R.QUICK_SAVE]).classList.remove("onpress");else if(this._yesNoChoiceCallInfo===N.CALL_BY_SUSPEND){if(this._usePassword)return this._yesNoJudge=g.UNSELECTED,void this.onpasswordsavecalled();_t(F[R.QUICK_SAVE]).classList.remove("onpress")}this._yesNoJudge=g.UNSELECTED,this._setNextMessage(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=N.NONE,this._messageWindow.setYesNoChoice(!1)}},s.prototype.setMessageQueue=function(t,e,s,a,i,o,r){if(void 0===a&&(a=0),void 0===i&&(i=I.OBJECT),void 0===o&&(o=new w(0,0)),void 0===r&&(r=!1),this._messageQueue=this._messageQueue.concat(this.getMessageQueueByRawMessage(t,a,i,o)),this._lastMessage.isEndOfPartsEvent&&void 0!==this._reservedMoveMacroTurn&&(this._player.setMoveMacroWaiting(this._reservedMoveMacroTurn),this._reservedMoveMacroTurn=void 0),0!==this._messageQueue.length){for(var n=this._messageQueue.shift(),_=0;_<n.macro.length;_++)this._execMacroListInNextFrame.push(n.macro[_]);if(this._lastMessage=n,!n.isEmpty())return this._messageWindow.setParsedMessage(n),this._messageWindow.setYesNoChoice(e),this._messageWindow.setPositionByPlayerPosition(0!==this._faces.length,this._scoreWindow.isVisible(),s,this._player.getPosition(),this._camera.getPosition()),this._player.setMessageWaiting(),!0;0===this._messageQueue.length?this._hideMessageWindow(r):this._setNextMessage()}return!1},s.prototype.getMessageQueueByRawMessage=function(t,e,s,a,i){void 0===i&&(i=!1);var o=t.split(/\n\<c\>/i)[0].split(/\<c\>/i)[0].replace(/\n\<p\>\n/gi,"<P>").replace(/\n\<p\>/gi,"<P>").replace(/\<p\>\n/gi,"<P>").replace(/\<p\>/gi,"<P>"),r=[];if(""!==o)for(var n=o.split(/\<p\>/gi),_=0;_<n.length;_++){for(var h=n[_].split("\n"),c=[],u=[],l=0;l<h.length;l++){var p=h[l].match(/(\$(?:[a-zA-Z_][a-zA-Z0-9_]*)\=(?:.*))/);if(null!==p&&p.length>=2){var d=Ct(this,e,s,a,p[1]);d.macroType===k.SHOW_STR?c.push(this._generateUserValString(d.macroArgs)):u.push(d)}else h[l].match(/^\$/)||c.push([h[l]])}var E=c.reduce((function(t,e,s){var a=0===s?[]:["\n"];return Fe(Fe(Fe([],t,!0),a,!0),e,!0)}),[]);r.push(new vt(E,i,_===n.length-1,u))}return r},s.prototype.appearParts=function(t,e,s){var a;void 0===s&&(s=0);var i,o,r,n,_,h=e===A.CHOICE_NO?Q.APPERANCE_PARTS_MIN_INDEX_NO:Q.APPERANCE_PARTS_MIN_INDEX,c=e===A.CHOICE_YES?Q.APPERANCE_PARTS_MAX_INDEX_YES:Q.APPERANCE_PARTS_MAX_INDEX;for(e===A.MAP?(s=0===s?this._wwaData.map[t.y][t.x]:s,a=I.MAP):(s=0===s?this._wwaData.mapObject[t.y][t.x]:s,a=I.OBJECT),_=h;_<=c;_++){var u=Q.ATR_APPERANCE_BASE+_*Q.REL_ATR_APPERANCE_UNIT_LENGTH,l=u+Q.REL_ATR_APPERANCE_ID,p=u+Q.REL_ATR_APPERANCE_X,d=u+Q.REL_ATR_APPERANCE_Y,E=u+Q.REL_ATR_APPERANCE_TYPE;if(i=a===I.MAP?this._wwaData.mapAttribute[s][l]:this._wwaData.objectAttribute[s][l],o=a===I.MAP?this._wwaData.mapAttribute[s][E]:this._wwaData.objectAttribute[s][E],r=a===I.MAP?this._wwaData.mapAttribute[s][p]:this._wwaData.objectAttribute[s][p],n=a===I.MAP?this._wwaData.mapAttribute[s][d]:this._wwaData.objectAttribute[s][d],r===Q.PLAYER_COORD?(r=this._player.getPosition().getPartsCoord().x,this._player.resetEventExecutionInfo()):r>Q.RELATIVE_COORD_LOWER&&(r=t.x+r-Q.RELATIVE_COORD_BIAS),n===Q.PLAYER_COORD?(n=this._player.getPosition().getPartsCoord().y,this._player.resetEventExecutionInfo()):n>Q.RELATIVE_COORD_LOWER&&(n=t.y+n-Q.RELATIVE_COORD_BIAS),0!==r||0!==n)try{if(new y(this,r,n,0,0),o===I.MAP){if(i>=this._wwaData.mapPartsMax)throw new Error("背景パーツの範囲外IDが指定されました");var m=new w(r,n);this.setPartsOnPosition(I.MAP,i,m)}else{if(i>=this._wwaData.objPartsMax)throw new Error("物体パーツの範囲外IDが指定されました");m=new w(r,n);this.setPartsOnPosition(I.OBJECT,i,m),this._replaceRandomObject(new w(r,n)),r===this._player.getPosition().getPartsCoord().x&&n===this._player.getPosition().getPartsCoord().y&&this._player.setPartsAppearedFlag()}}catch(t){}}},s.prototype.appearPartsByDirection=function(t,e,s){var a=this._player.getPosition().getPartsCoord(),i=this._player.getDir(),o=T[i],r=O[i];this.appearPartsEval(a,(o>=0?"+":"-")+Math.abs(o)*t,(r>=0?"+":"-")+Math.abs(r)*t,e,s)},s.prototype.appearPartsEval=function(t,e,s,a,i){var o,r,n=this._player.getPosition().getPartsCoord();if("P"===e||"p"===e)o=n.x;else if("+"===e[0])o=t.x+parseInt(e.substr(1));else if("-"===e[0])o=t.x-parseInt(e.substr(1));else if(o=parseInt(e),isNaN(o))throw new Error("座標として解釈できない文字が含まれています。");if("P"===s||"p"===s)r=n.y;else if("+"===s[0])r=t.y+parseInt(s.substr(1));else if("-"===s[0])r=t.y-parseInt(s.substr(1));else if(r=parseInt(s),isNaN(r))throw new Error("座標として解釈できない文字が含まれています。");try{new y(this,o,r,0,0);if(i===I.MAP){if(a>=this._wwaData.mapPartsMax)throw new Error("背景パーツの範囲外IDが指定されました");var _=new w(o,r);this.setPartsOnPosition(I.MAP,a,_)}else{if(a>=this._wwaData.objPartsMax)throw new Error("物体パーツの範囲外IDが指定されました");_=new w(o,r);this.setPartsOnPosition(I.OBJECT,a,_),this._replaceRandomObject(new w(o,r)),o===this._player.getPosition().getPartsCoord().x&&r===this._player.getPosition().getPartsCoord().y&&this._player.setPartsAppearedFlag()}}catch(t){}},s.prototype._replaceRandomObject=function(t){var e,s,a=this._wwaData.mapObject[t.y][t.x];if(this._wwaData.objectAttribute[a][Q.ATR_TYPE]===Q.OBJECT_RANDOM){for(var i=0;i<Q.RANDOM_ITERATION_MAX;i++){if(s=Math.floor(10*Math.random()),(e=this._wwaData.objectAttribute[a][Q.ATR_RANDOM_BASE+s])>=this._wwaData.objPartsMax){e=0;break}if(this._wwaData.objectAttribute[e][Q.ATR_TYPE]!==Q.OBJECT_RANDOM)break;a=e}this.setPartsOnPosition(I.OBJECT,e,t)}},s.prototype._replaceRandomObjectsInScreen=function(){for(var t=this._camera.getPosition().getPartsCoord(),e=Math.max(0,t.x-1),s=Math.min(this._wwaData.mapWidth-1,t.x+Q.H_PARTS_NUM_IN_WINDOW),a=Math.max(0,t.y-1),i=Math.min(this._wwaData.mapWidth-1,t.y+Q.V_PARTS_NUM_IN_WINDOW),o=e;o<=s;o++)for(var r=a;r<i;r++)this._replaceRandomObject(new w(o,r))},s.prototype._replaceAllRandomObjects=function(){for(var t=0;t<this._wwaData.mapWidth;t++)for(var e=0;e<this._wwaData.mapWidth;e++)this._replaceRandomObject(new w(t,e))},s.prototype.gameover=function(){var t=this._wwaData.gameoverX,e=this._wwaData.gameoverY;this._messageWindow.isVisible()&&(this._yesNoJudge=g.UNSELECTED,this._messageQueue=[],this._player.setDelayFrame(),this._messageWindow.hide(),this._yesNoChoicePartsCoord=void 0,this._yesNoChoicePartsID=void 0,this._yesNoUseItemPos=void 0,this._yesNoChoiceCallInfo=N.NONE,this._messageWindow.setYesNoChoice(!1)),this._waitFrame=0,this._temporaryInputDisable=!0,this._execMacroListInNextFrame=[],this._player.jumpTo(new y(this,t,e,0,0))},s.prototype.setYesNoInput=function(t){this._yesNoJudgeInNextFrame=t},s.prototype.getYesNoState=function(){return void 0!==this._yesNoJudgeInNextFrame?this._yesNoJudgeInNextFrame:this._yesNoJudge},s.prototype.setStatusChangedEffect=function(t){this._wwaData.isItemEffectEnabled&&(0!==t.strength&&(_t("disp-strength").classList.add("onpress"),this._statusPressCounter.strength=Q.STATUS_CHANGED_EFFECT_FRAME_NUM),0!==t.defence&&(_t("disp-defence").classList.add("onpress"),this._statusPressCounter.defence=Q.STATUS_CHANGED_EFFECT_FRAME_NUM),t instanceof E&&(0!==t.energy&&(_t("disp-energy").classList.add("onpress"),this._statusPressCounter.energy=Q.STATUS_CHANGED_EFFECT_FRAME_NUM),0!==t.gold&&(_t("disp-gold").classList.add("onpress"),this._statusPressCounter.gold=Q.STATUS_CHANGED_EFFECT_FRAME_NUM)))},s.prototype.setPartsOnPosition=function(t,e,s){var a,i,o=s.y<<it.BITSHIFT|s.x;t===I.MAP?(a=this._wwaData.map[s.y][s.x],e=this.loadMapPartsID(e),a=this.loadMapPartsID(a),this._wwaData.map[s.y][s.x]=e,-1!==(i=this._mapIDTable[a].indexOf(o))&&this._mapIDTable[a].splice(i,1),-1===(i=this._mapIDTable[e].indexOf(o))&&this._mapIDTable[e].push(o)):(a=this._wwaData.mapObject[s.y][s.x],e=this.loadMapPartsObjectID(e),a=this.loadMapPartsObjectID(a),this._wwaData.mapObject[s.y][s.x]=e,-1!==(i=this._mapObjectIDTable[a].indexOf(o))&&this._mapObjectIDTable[a].splice(i,1),-1===(i=this._mapObjectIDTable[e].indexOf(o))&&this._mapObjectIDTable[e].push(o))},s.prototype._countSamePartsLength=function(t,e){var s;for(s=e+1;s<t.length&&t[s]===t[s-1];s++);return s-e},s.prototype._compressMap=function(t){for(var e=[],s=0;s<t.length;s++){e[s]=[];for(var a=0;a<t[s].length;){var i=this._countSamePartsLength(t[s],a);e[s].push([t[s][a],i]),a+=i}}return e},s.prototype._decompressMap=function(t){for(var e=[],s=0;s<t.length;s++){e[s]=[],0;for(var a=0;a<t[s].length;a++)for(var i=t[s][a][1],o=0;o<i;o++)e[s].push(t[s][a][0])}return e},s.prototype._generateMapDataHash=function(t){var e="A",s=0,a=0,i=0;for(i=0;i<t.map.length;i++){for(a=0;a<t.map[i].length;)s=this._countSamePartsLength(t.map[i],a),e+=t.map[i][a]+"|"+s+"/",a+=s;for(a=0;a<t.mapObject[i].length;)s=this._countSamePartsLength(t.mapObject[i],a),e+=t.mapObject[i][a]+"|"+s+"/",a+=s}for(var o=0;o<t.mapAttribute.length;o++)for(var r=0;r<t.mapAttribute[o].length;r++)e+=t.mapAttribute[o][r]+"/";for(var n=0;n<t.objectAttribute.length;n++)for(var _=0;_<t.objectAttribute[n].length;_++)e+=t.objectAttribute[n][_]+"/";return Kt(e+="Z")},s.prototype._generateSaveDataHash=function(t){var e=this._generateMapDataHash(t),s=[];for(var a in t)"map"!==a&&"mapObject"!==a&&"mapCompressed"!==a&&"mapObjectCompressed"!==a&&"mapAttribute"!==a&&"objectAttribute"!==a&&"checkString"!==a&&s.push(a);s.sort();for(var i=0;i<s.length;i++)e+=dt(t[s[i]]);return Kt(e)},s.prototype.compressSystem=function(){return qt},s.prototype._quickSave=function(t){var e,s,a=JSON.parse(JSON.stringify(this._wwaData)),i=this._player.getPosition().getPartsCoord(),o=this._player.getStatusWithoutEquipments();switch(a.itemBox=this._player.getCopyOfItemBox(),a.playerX=i.x,a.playerY=i.y,a.statusEnergyMax=this._player.getEnergyMax(),a.statusEnergy=o.energy,a.statusStrength=o.strength,a.statusDefence=o.defence,a.statusGold=o.gold,a.moves=this._player.getMoveCount(),a.frameCount=this._player.getFrameCount(),a.gameSpeedIndex=this._player.getSpeedIndex(),t){case N.CALL_BY_LOG_QUICK_SAVE:case N.CALL_BY_QUICK_SAVE:case N.CALL_BY_SUSPEND:break;case N.CALL_BY_PASSWORD_SAVE:a.checkOriginalMapString=this.checkOriginalMapString,a.checkString=this._generateSaveDataHash(a)}switch(a.message=void 0,a.mapAttribute=void 0,a.objectAttribute=void 0,t){case N.CALL_BY_QUICK_SAVE:return this._messageWindow.save(this._cvs,a),this.wwaCustomEvent("wwa_quicksave",{data:a}),"";case N.CALL_BY_PASSWORD_SAVE:var r=qt.compress(a);r.isCompress=1;var n=JSON.stringify(r);return this.wwaCustomEvent("wwa_passwordsave",{data:a,compress:r}),e=n,s=this._wwaData.worldPassNumber,console.warn(Gt.enc.Utf8.parse(e)),Gt.AES.encrypt(Gt.enc.Utf8.parse(e),Ht(s)).toString();case N.CALL_BY_SUSPEND:this.wwaCustomEvent("wwa_suspend",{data:a,compress:qt.compress(a)});break;case N.CALL_BY_LOG_QUICK_SAVE:this.wwaCustomEvent("wwa_autosave",{data:a}),this._wwaSave.autoSave(this._cvs,a)}},s.prototype.wwaCustomEvent=function(t,e){void 0===e&&(e={}),this.wwaCustomEventEmitter.dispatch(t,e)},s.prototype._decodePassword=function(t){var e,s,a,i="",o=void 0;try{e=t,s=this._wwaData.worldPassNumber,i=Gt.AES.decrypt(e,Ht(s)).toString(Gt.enc.Utf8)}catch(t){o=t}if(!i){console.warn("新方式でのパスワード暗号化解除失敗:",o);try{i=function(t,e,s){return Gt.AES.decrypt(t,function(t,e){return"^ /".concat(231*t+8310+e,"P+>A[]")}(e,s)).toString(Gt.enc.Utf8)}(t,this._wwaData.worldPassNumber,this.checkOriginalMapString)}catch(t){o=t}}if(!i){console.warn("旧方式でのパスワード暗号化解除失敗:",o);var r=o&&o.message?o.message:"";throw new Error("パスワード取得時からワールド制作者によってマップの暗証番号が変更されたか、\nパスワードが壊れているために正常にセーブデータが復元できませんでした。\n"+r)}try{a=JSON.parse(i)}catch(t){throw new Error("マップデータ以外のものが暗号化されたか、マップデータに何かが不足しているようです。\nJSON PARSE FAILED")}return a.isCompress?(delete a.isCompress,qt.decompress(a)):[a,{isWorldNameEmpty:!1}]},s.prototype._quickLoad=function(t,e,s){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===s&&(s=!0),!t&&void 0===this._wwaSave.hasSaveData()&&null===e)throw new Error("セーブデータがありません。");var a,i=!1;if(null!==e){var o=this._decodePassword(e);a=o[0],i=o[1].isWorldNameEmpty}else a=JSON.parse(JSON.stringify(t?this._restartData:this._messageWindow.load()));if(a.message=JSON.parse(JSON.stringify(this._restartData.message)),a.mapAttribute=JSON.parse(JSON.stringify(this._restartData.mapAttribute)),a.objectAttribute=JSON.parse(JSON.stringify(this._restartData.objectAttribute)),void 0===a.map&&(a.map=this._decompressMap(a.mapCompressed)),void 0===a.mapObject&&(a.mapObject=this._decompressMap(a.mapObjectCompressed)),delete a.mapCompressed,delete a.mapObjectCompressed,null!==e){if(!i&&a.worldName!==this._wwaData.worldName)throw console.error("Invalid title","(password)=".concat(a.worldName," (current map)=").concat(this._wwaData.worldName)),new Error("前回パスワード取得時から、制作者によってワールド名が変更されたためロードできませんでした。\n予めご了承ください。");var r=this.checkOriginalMapString;if(this._isDisallowLoadOldSave&&a.checkOriginalMapString!==r)throw console.error("Invalid hash","(password)=".concat(a.checkOriginalMapString," (current map)=").concat(r)),new Error("前回パスワード取得時から、制作者によってマップが変更されたためロードできませんでした。\n(マップデータ制作者の設定により、内容が変更されると以前のパスワードは利用できなくなります。)\n予めご了承ください。");console.log("Valid Password!")}return s&&this._applyQuickLoad(a),a},s.prototype._applyQuickLoad=function(t){this._player.setEnergyMax(t.statusEnergyMax),this._player.setEnergy(t.statusEnergy),this._player.setStrength(t.statusStrength),this._player.setDefence(t.statusDefence),this._player.setGold(t.statusGold),this._player.setMoveCount(t.moves),this._player.setFrameCount(t.frameCount),this._player.clearItemBox();for(var e=0;e<t.itemBox.length;e++)this._player.addItem(t.itemBox[e],e+1,!0);this._player.systemJumpTo(new y(this,t.playerX,t.playerY,0,0)),0===t.bgm?this.playSound(K.NO_SOUND):this.playSound(t.bgm),this.setImgClick(new w(t.imgClickX,t.imgClickY)),0!==this.getObjectIdByPosition(this._player.getPosition())&&this._player.setPartsAppearedFlag(),this._wwaData=t,this._mapIDTableCreate(),this._replaceAllRandomObjects(),this.setStatusIconCoord(H.ENERGY,new w(t.imgStatusEnergyX,t.imgStatusEnergyY)),this.setStatusIconCoord(H.STRENGTH,new w(t.imgStatusStrengthX,t.imgStatusStrengthY)),this.setStatusIconCoord(H.DEFENCE,new w(t.imgStatusDefenceX,t.imgStatusDefenceY)),this.setStatusIconCoord(H.GOLD,new w(t.imgStatusGoldX,t.imgStatusGoldY)),this.setWideCellCoord(new w(t.imgWideCellX,t.imgWideCellY)),this.setItemboxBackgroundPosition({x:t.imgItemboxX,y:t.imgItemboxY}),this.setFrameCoord(new w(t.imgFrameX,t.imgFrameY)),this.setPlayerSpeedIndex(t.gameSpeedIndex),this.updateCSSRule(),this.updateEffect(),this._player.updateStatusValueBox(),this._wwaSave.quickSaveButtonUpdate(this._wwaData)},s.prototype._mapIDTableCreate=function(){var t;for(this._mapIDTable=[],this._mapObjectIDTable=[],t=0;t<this._wwaData.mapPartsMax;t++)this._mapIDTable[t]=[];for(t=0;t<this._wwaData.objPartsMax;t++)this._mapObjectIDTable[t]=[];for(var e=0;e<this._wwaData.mapWidth;e++)for(var s=0;s<this._wwaData.mapWidth;s++){var a=s<<it.BITSHIFT|e;t=this._wwaData.map[s][e],this._mapIDTable[t]instanceof Array||(this._mapIDTable[t]=[]),this._mapIDTable[t].push(a),t=this._wwaData.mapObject[s][e],this._mapObjectIDTable[t]instanceof Array||(this._mapObjectIDTable[t]=[]),this._mapObjectIDTable[t].push(a)}},s.prototype._restartGame=function(){this._quickLoad(!0)},s.prototype._fadeout=function(t){var e=0,s=Q.MAP_WINDOW_WIDTH,a=Q.FADEOUT_SPEED,i=_t("wwa-fader");i.style.display="block";var o=setInterval((function(){if(e+=a,(s-=2*a)<=0||2*e>Q.MAP_WINDOW_WIDTH)return i.removeAttribute("style"),i.style.display="block",i.style.borderWidth="0",i.style.width=Q.MAP_WINDOW_WIDTH+"px",i.style.height=Q.MAP_WINDOW_HEIGHT+"px",i.style.backgroundColor="#808080",clearInterval(o),void t();i.style.width=s+"px",i.style.height=s+"px",i.style.borderWidth=e+"px"}),20)},s.prototype.moveObjects=function(t){var e,s,a,i=this._camera.getPosition(),o=(this._player.getPosition(),i.getPartsCoord(),i.getPartsCoord().x),r=i.getPartsCoord().y;if(this.getMapAttributeByPosition(this._player.getPosition(),Q.ATR_TYPE)!==Q.MAP_LOCALGATE&&this.getObjectAttributeByPosition(this._player.getPosition(),Q.ATR_TYPE)!==Q.OBJECT_LOCALGATE){for(e=new Array(Q.V_PARTS_NUM_IN_WINDOW+2),this.hoge=new Array(Q.V_PARTS_NUM_IN_WINDOW+2),a=-1;a<=Q.V_PARTS_NUM_IN_WINDOW;a++)for(e[a+1]=new Array(Q.H_PARTS_NUM_IN_WINDOW+2),this.hoge[a+1]=new Array(Q.H_PARTS_NUM_IN_WINDOW+2),s=-1;s<=Q.H_PARTS_NUM_IN_WINDOW;s++)if(r+a<0||r+a>=this._wwaData.mapWidth||o+s<0||o+s>=this._wwaData.mapWidth)e[a+1][s+1]=0,this.hoge[a+1][s+1]=0;else{try{var n=(_=new y(this,o+s,r+a,0,0)).getPartsCoord()}catch(t){e[a+1][s+1]=0,this.hoge[a+1][s+1]=0;continue}this._wwaData.mapObject[n.y][n.x];e[a+1][s+1]=this._wwaData.mapObject[n.y][n.x],this.hoge[a+1][s+1]=-this._wwaData.mapObject[n.y][n.x]}for(s=-1;s<=Q.H_PARTS_NUM_IN_WINDOW;s++)if(!(o+s<0||o+s>=this._wwaData.mapWidth))for(a=-1;a<=Q.V_PARTS_NUM_IN_WINDOW;a++)if(!(r+a<0||r+a>=this._wwaData.mapWidth)){try{var _;n=(_=new y(this,o+s,r+a,0,0)).getPartsCoord()}catch(t){continue}var h=this._wwaData.mapObject[n.y][n.x];if(0!==h&&this._wwaData.objectAttribute[h][Q.ATR_MOVE]!==B.STATIC&&this._wwaData.objectAttribute[h][Q.ATR_TYPE]!==Q.OBJECT_LOCALGATE&&this._wwaData.objectAttribute[h][Q.ATR_TYPE]!==Q.OBJECT_RANDOM&&(this._wwaData.objectAttribute[h][Q.ATR_MOVE]===B.CHASE_PLAYER||this._wwaData.objectAttribute[h][Q.ATR_MOVE]===B.RUN_OUT||this._wwaData.objectAttribute[h][Q.ATR_MOVE]===B.HANG_AROUND)){var c=this._wwaData.objectAttribute[h][Q.ATR_MOVE];if(c!==B.HANG_AROUND){var u,l=this._getCandidateCoord(t,_,c),p=new w(l.x,n.y),d=new w(n.x,l.y),E=null;if(this._objectCanMoveTo(t,l,e))this._setObjectsInNextFrame(n,l,o,r,e,h);else{var m=this._getSecondCandidateMoveMode(t,n,l,p,d,this._wwaData.objectAttribute[h][Q.ATR_TYPE]===Q.OBJECT_MONSTER,e);m===x.MODE_X?this._setObjectsInNextFrame(n,p,o,r,e,h):m===x.MODE_Y?this._setObjectsInNextFrame(n,d,o,r,e,h):null===(E=this._getThirdCandidate(t,_,l,c,e))||this._wwaData.isOldMove?(u=this._getRandomMoveCoord(t,_,e),this._setObjectsInNextFrame(n,u,o,r,e,h)):this._setObjectsInNextFrame(n,E,o,r,e,h)}}else u=this._getRandomMoveCoord(t,_,e),this._setObjectsInNextFrame(n,u,o,r,e,h)}}}},s.prototype._getCandidateCoord=function(t,e,s){var a=e.getPartsCoord();this._player.getPosition().getOffsetCoord(),this._player.getPosition().getPartsCoord();try{var i=t?this._player.getPosition().getNextJustPosition().getPartsCoord():this._player.getPosition().getPartsCoord()}catch(t){throw new Error("予期せぬ方向への移動のようです。")}var o=a.clone(),r=0,n=0;return s===B.CHASE_PLAYER?(r=a.x>i.x?-1:a.x<i.x?1:0,n=a.y>i.y?-1:a.y<i.y?1:0):s===B.RUN_OUT&&(r=a.x>i.x?1:a.x<i.x?-1:0,n=a.y>i.y?1:a.y<i.y?-1:0),o.x+=r,o.y+=n,o.x=Math.min(this._wwaData.mapWidth-1,Math.max(0,o.x)),o.y=Math.min(this._wwaData.mapWidth-1,Math.max(0,o.y)),o},s.prototype._getSecondCandidateMoveMode=function(t,e,s,a,i,o,r){return!t||(this._player.getDir()!==u.UP&&this._player.getDir()!==u.DOWN||!o)&&(this._player.getDir()!==u.LEFT&&this._player.getDir()!==u.RIGHT||o)?this._objectCanMoveTo(t,a,r)?x.MODE_X:this._objectCanMoveTo(t,i,r)?x.MODE_Y:x.UNDECIDED:this._objectCanMoveTo(t,i,r)?x.MODE_Y:this._objectCanMoveTo(t,a,r)?x.MODE_X:x.UNDECIDED},s.prototype._getThirdCandidate=function(t,e,s,a,i){var o,r=a===B.CHASE_PLAYER?1:a===B.RUN_OUT?-1:0,n=t?this._player.getPosition().getNextJustPosition().getPartsCoord():this._player.getPosition().getPartsCoord(),_=e.getPartsCoord();if(n.x!==_.x){if(o=new w(s.x,_.y+1*r),this._objectCanMoveTo(t,o,i))return o;if(o=new w(s.x,_.y-1*r),this._objectCanMoveTo(t,o,i))return o;if(o=new w(_.x,_.y+1*r),this._objectCanMoveTo(t,o,i))return o;if(o=new w(_.x,_.y-1*r),this._objectCanMoveTo(t,o,i))return o}if(n.y!==_.y){if(o=new w(_.x+1*r,s.y),this._objectCanMoveTo(t,o,i))return o;if(o=new w(_.x-1*r,s.y),this._objectCanMoveTo(t,o,i))return o;if(o=new w(_.x+1*r,_.y),this._objectCanMoveTo(t,o,i))return o;if(o=new w(_.x-1*r,_.y),this._objectCanMoveTo(t,o,i))return o}return null},s.prototype._getRandomMoveCoord=function(t,e,s){for(var a=e.getPartsCoord(),i=a.clone(),o=this._wwaData.isOldMove?Q.RANDOM_MOVE_ITERATION_NUM_BEFORE_V31:Q.RANDOM_MOVE_ITERATION_NUM,r=0;r<o;r++){var n=Math.floor(8*Math.random());if(i.x=a.x+T[n],i.y=a.y+O[n],this._objectCanMoveTo(t,i,s))return i}return a},s.prototype.isPrevFrameEventExecuted=function(){return this._prevFrameEventExected},s.prototype._objectCanMoveTo=function(t,e,s){if(e.x<0||e.y<0||this._wwaData.mapWidth<=e.x||this._wwaData.mapWidth<=e.y)return!1;var a=this._wwaData.map[e.y][e.x],i=this._wwaData.mapObject[e.y][e.x],o=this._wwaData.mapAttribute[a][Q.ATR_TYPE],r=this._camera.getPosition(),n=r.getPartsCoord().x,_=r.getPartsCoord().y;if(0===a&&!this.isOldMap()||o===Q.MAP_WALL)return!1;var h=e.x-n+1,c=e.y-_+1;if(0<=h&&0<=c&&h<s.length&&c<s.length){if(0!==s[c][h])return!1}else if(0!==i)return!1;if(t){if(this._player.getPosition().getNextJustPosition().getPartsCoord().equals(e))return!1}else if(this._player.getPosition().getPartsCoord().equals(e))return!1;return!0},s.prototype._setObjectsInNextFrame=function(t,e,s,a,i,o){var r=e.x-s+1,n=e.y-a+1;0<=e.x&&e.x<=this._wwaData.mapWidth&&0<=e.y&&e.y<=this._wwaData.mapWidth&&(0<=r&&r<i.length&&0<=n&&n<i.length&&(i[t.y-a+1][t.x-s+1]=0,i[e.y-a+1][e.x-s+1]=o,this.hoge[e.y-a+1][e.x-s+1]=o),this._objectMovingDataManager.add(o,t.convertIntoPosition(this),e.convertIntoPosition(this),t.getDirectionTo(e)))},s.prototype.launchBattleEstimateWindow=function(){var t=this._camera.getPosition().getPartsCoord(),e=Math.max(0,t.x),s=Math.min(this._wwaData.mapWidth-1,t.x+Q.H_PARTS_NUM_IN_WINDOW-1),a=Math.max(0,t.y),i=Math.min(this._wwaData.mapWidth-1,t.y+Q.V_PARTS_NUM_IN_WINDOW-1),o=[];this.playSound(K.DECISION);for(var r=e;r<=s;r++)for(var n=a;n<=i;n++){var _=this._wwaData.mapObject[n][r];this._wwaData.objectAttribute[_][Q.ATR_TYPE]===Q.OBJECT_MONSTER&&-1===o.indexOf(_)&&o.push(_)}return this._bottomButtonType===c.BATTLE_REPORT&&_t(F[R.GOTO_WWA]).classList.add("onpress"),0===o.length?(_t(F[R.GOTO_WWA]).classList.remove("onpress"),this.hideBattleEstimateWindow(),!1):(this._battleEstimateWindow.update(this._player.getStatus(),o),this._battleEstimateWindow.show(),this._player.setEstimateWindowWating(),!0)},s.prototype.hideBattleEstimateWindow=function(){this._battleEstimateWindow.hide(),this._player.clearEstimateWindowWaiting(),_t(F[R.GOTO_WWA]).classList.remove("onpress")},s.prototype.hidePasswordWindow=function(t){if(void 0===t&&(t=!1),this._passwordWindow.hide(),t||this._passwordWindow.mode===Lt.SAVE)this._player.clearPasswordWindowWaiting();else{try{var e=this._quickLoad(!1,this._passwordWindow.password,!1)}catch(t){return this._player.clearPasswordWindowWaiting(),void alert("セーブデータの復元に失敗しました。\nエラー詳細:\n"+t.message)}this._passwordLoadExecInNextFrame=!0,this._passwordSaveExtractData=e}},s.prototype._displayHelp=function(){if(this._player.isControllable()){this.setNowPlayTime();var t="";switch(this.userDevice.device){case P.GAME:switch(this.userDevice.os){case C.NINTENDO:t=" 【操作方法】\nA:Yes,戦闘結果予測の表示\nB:No\nX:メニュー\nY:このリストの表示\nR:初めからスタート\nZL:データの一時保存\nZR:一時保存データの読み込み\n+: 移動速度を上げる\n-: 移動速度を落とす\n WWA Wing バージョン:3.6.12\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;case C.PLAY_STATION:t=" 【操作方法】\n〇:Yes,戦闘結果予測の表示\n×:No\n△:メニュー\n□:このリストの表示\nR1:初めからスタート\nL2:データの一時保存\nR2:一時保存データの読み込み\nOPTIONS: 移動速度を上げる\nSHARE: 移動速度を落とす\n  現在の移動回数:"+this._player.getMoveCount()+"\n  プレイ時間:"+this._player.getPlayTimeText()+"\n WWA Wing バージョン:3.6.12\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;case C.XBOX:t=" 【操作方法】\nB:Yes,戦闘結果予測の表示\nA:No\nY:メニュー\nX:このリストの表示\nRB:初めからスタート\nLT:データの一時保存\nRT:一時保存データの読み込み\nMENU: 移動速度を上げる\nWINDOW: 移動速度を落とす\n  現在の移動回数:"+this._player.getMoveCount()+"\n  プレイ時間:"+this._player.getPlayTimeText()+"\n WWA Wing バージョン:3.6.12\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;default:return}break;case P.SP:case P.VR:return;case P.PC:t=" 【操作方法】\nF1、M:戦闘結果予測の表示\nF3:復帰用パスワード入力\nF4:復帰用パスワード表示\nF5:一時保存データの読み込み\nF6:データの一時保存\nF7:初めからスタート\nF8:WWA公式ページにリンク\nF12:このリストの表示\nキーボードの「123、QWE、ASD、ZXC」は右のアイテムボックスに対応。\n「Enter、Y」はYes,\n「Esc、N」はNoに対応。\n   I: 移動速度を落とす/\nF2、P: 移動速度を上げる\n  現在の移動回数:"+this._player.getMoveCount()+"\n  プレイ時間:"+this._player.getPlayTimeText()+"\n WWA Wing バージョン:3.6.12\n マップデータ バージョン: "+Math.floor(this._wwaData.version/10)+"."+this._wwaData.version%10;break;default:return}t&&this.setMessageQueue(t,!1,!0)}},s.prototype._setNextMessage=function(t){if(void 0===t&&(t=!1),this._clearFacesInNextFrame=!0,this._scoreWindow.isVisible()&&(this._scoreWindow.hide(),this._scoreRates=void 0),this._lastMessage.isEndOfPartsEvent&&void 0!==this._reservedMoveMacroTurn&&(this._player.setMoveMacroWaiting(this._reservedMoveMacroTurn),this._reservedMoveMacroTurn=void 0),0===this._messageQueue.length)this._hideMessageWindow();else{var e=this._messageQueue.shift(),s=e.macro;this._lastMessage=e;for(var a=0;a<s.length;a++)this._execMacroListInNextFrame.push(s[a]);e.isEmpty()?0===this._messageQueue.length?this._hideMessageWindow():this._setNextMessage():(this._player.setDelayFrame(),this._messageWindow.hide(),this._messageWindow.setParsedMessage(e),this._messageWindow.setPositionByPlayerPosition(0!==this._faces.length,this._scoreWindow.isVisible(),t,this._player.getPosition(),this._camera.getPosition()),this._messageWindow.show(),this._player.setMessageWaiting())}},s.prototype._hideMessageWindow=function(t){void 0===t&&(t=!0);var e=0;this._player.isReadyToUseItem()&&(e=this._player.useItem());var s=this.getObjectAttributeById(e,Q.ATR_STRING);this.clearFaces(),0===s?(t&&(this._player.setDelayFrame(),this._messageWindow.hide(),this._keyStore.allClear(),this._mouseStore.clear()),this._player.clearMessageWaiting()):this.setMessageQueue(this.getMessageById(s),!1,!1,e,I.OBJECT,this._player.getPosition().getPartsCoord(),!0)},s.prototype.loadMapPartsObjectID=function(t){return(t|=0)<0||t>=this._wwaData.objPartsMax?0:t},s.prototype.loadMapPartsID=function(t){return(t|=0)<0||t>=this._wwaData.mapPartsMax?0:t},s.prototype.replaceParts=function(t,e,s,a){void 0===s&&(s=I.OBJECT),void 0===a&&(a=!1);var i,o,r,n,_,h,c,u,l=this._camera.getPosition().getPartsCoord(),p=a?Math.max(0,l.x):0,d=a?Math.min(this._wwaData.mapWidth-1,l.x+Q.H_PARTS_NUM_IN_WINDOW-1):this._wwaData.mapWidth-1,E=a?Math.max(0,l.y):0,w=a?Math.min(this._wwaData.mapWidth-1,l.y+Q.V_PARTS_NUM_IN_WINDOW)-1:this._wwaData.mapWidth-1;if(a=0!==p||d!==this._wwaData.mapWidth-1||0!==E||w!==this._wwaData.mapWidth-1,s===I.OBJECT)if(t=this.loadMapPartsObjectID(t),e=this.loadMapPartsObjectID(e),n=this._mapObjectIDTable[t].concat(),(c=this._mapObjectIDTable[t]).length=0,u=this._mapObjectIDTable[e],o=n.length,a)for(r=0;r<o;r++)_=(i=n[r])&it.BITMASK,h=i>>>it.BITSHIFT&it.BITMASK,p<=_&&_<=d&&E<=h&&h<=w?(this._wwaData.mapObject[h][_]=e,u.push(i)):c.push(i);else{for(r=0;r<o;r++)_=(i=n[r])&it.BITMASK,h=i>>>it.BITSHIFT&it.BITMASK,this._wwaData.mapObject[h][_]=e;Array.prototype.push.apply(u,n)}else if(t=this.loadMapPartsID(t),e=this.loadMapPartsID(e),n=this._mapIDTable[t].concat(),(c=this._mapIDTable[t]).length=0,u=this._mapIDTable[e],o=n.length,a)for(r=0;r<o;r++)_=(i=n[r])&it.BITMASK,h=i>>>it.BITSHIFT&it.BITMASK,p<=_&&_<=d&&E<=h&&h<=w?(this._wwaData.map[h][_]=e,u.push(i)):c.push(i);else{for(r=0;r<o;r++)_=(i=n[r])&it.BITMASK,h=i>>>it.BITSHIFT&it.BITMASK,this._wwaData.map[h][_]=e;Array.prototype.push.apply(u,n)}},s.prototype.getYesNoImgCoord=function(){return new w(this._wwaData.yesnoImgPosX,this._wwaData.yesnoImgPosY)},s.prototype.setYesNoImgCoord=function(t){return this._wwaData.yesnoImgPosX=t.x,this._wwaData.yesnoImgPosY=t.y,t},s.prototype.getPlayerImgCoord=function(){return new w(this._wwaData.playerImgPosX,this._wwaData.playerImgPosY)},s.prototype.setPlayerImgCoord=function(t){return this._wwaData.playerImgPosX=t.x,this._wwaData.playerImgPosY=t.y,t},s.prototype.setPlayerEnergyMax=function(t){return this._player.setEnergyMax(t)},s.prototype.getMapPartsNum=function(){return this._wwaData.mapPartsMax},s.prototype.getObjectPartsNum=function(){return this._wwaData.objPartsMax},s.prototype.setMoveMacroWaitingToPlayer=function(t){this._reservedMoveMacroTurn=t},s.prototype.disableSave=function(t){return this._wwaData.disableSaveFlag=t,this._wwaSave.quickSaveButtonUpdate(this._wwaData),t},s.prototype.isOldMap=function(){return this._wwaData.isOldMap},s.prototype.setOldMap=function(t){return this._wwaData.isOldMap=t},s.prototype.setObjectNotCollapseOnPartsOnPlayer=function(t){return this._wwaData.objectNoCollapseDefaultFlag=t},s.prototype.setGameOverPosition=function(t){if(t.x<0||t.x>=this.getMapWidth()||t.y<0||t.y>=this.getMapWidth())throw new Error("マップの範囲外が指定されています!");return this._wwaData.gameoverX=t.x,this._wwaData.gameoverY=t.y,t},s.prototype.setPlayerStatus=function(t,e){if(t===G.ENERGY)this._player.setEnergy(e);else if(t===G.STRENGTH)this._player.setStrength(e);else if(t===G.DEFENCE)this._player.setDefence(e);else if(t===G.GOLD)this._player.setGold(e);else{if(t!==G.MOVES)throw new Error("未定義のステータスタイプです");this._player.setMoveCount(e)}},s.prototype.setDelPlayer=function(t){return this._wwaData.delPlayerFlag=t},s.prototype.setPlayerGetItem=function(t,e){try{this._player.addItem(e,t,!0)}catch(t){}},s.prototype.setStatusIconCoord=function(t,e){var s=e.x*Q.CHIP_SIZE,a=e.y*Q.CHIP_SIZE,i=function(t){ct("".concat(t,">.status-icon")).style.backgroundPosition="-".concat(s,"px -").concat(a,"px")};switch(t){case H.ENERGY:this._wwaData.imgStatusEnergyX=e.x,this._wwaData.imgStatusEnergyY=e.y,i("#disp-energy");break;case H.STRENGTH:this._wwaData.imgStatusStrengthX=e.x,this._wwaData.imgStatusStrengthY=e.y,i("#disp-strength");break;case H.DEFENCE:this._wwaData.imgStatusDefenceX=e.x,this._wwaData.imgStatusDefenceY=e.y,i("#disp-defence");break;case H.GOLD:this._wwaData.imgStatusGoldX=e.x,this._wwaData.imgStatusGoldY=e.y,i("#disp-gold");break;default:throw new Error("種別が不正です。")}return e.clone()},s.prototype.setWideCellCoord=function(t){this._wwaData.imgWideCellX=t.x,this._wwaData.imgWideCellY=t.y;var e=t.x*Q.CHIP_SIZE,s=t.y*Q.CHIP_SIZE;return Array.prototype.forEach.call(ut("div.wide-cell-row"),(function(t){t.style.backgroundPosition="-"+e+"px -"+s+"px"})),t.clone()},s.prototype.setFrameCoord=function(t){return this._wwaData.imgFrameX=t.x,this._wwaData.imgFrameY=t.y,this._cgManager.setFrameImage(t),t.clone()},s.prototype.setBattleEffectCoord=function(t){return this._battleEffectCoord=t.clone()},s.prototype.canInput=function(){return!this._temporaryInputDisable},s.prototype.setEffect=function(t,e){this._wwaData.effectWaits=t,this._wwaData.effectCoords=e,this.updateEffect()},s.prototype.stopEffect=function(){this._wwaData.effectCoords=[],this.updateEffect()},s.prototype.updateEffect=function(){this._cgManager.updateEffects(this._wwaData.effectCoords)},s.prototype.setImgClick=function(t){if(this._wwaData.imgClickX=t.x,this._wwaData.imgClickY=t.y,t.equals(new w(0,0)))Array.prototype.forEach.call(ut(".item-cell>.item-click-border"),(function(t){t.style.backgroundImage="url('"+Q.ITEM_BORDER_IMG_DATA_URL+"')",t.style.backgroundPosition="0 0"}));else{var e=this._wwaData.mapCGName.replace("(","\\(").replace(")","\\)");Array.prototype.forEach.call(ut(".item-cell>.item-click-border"),(function(s){s.style.backgroundImage="url('"+e+"')",s.style.backgroundPosition="-"+t.x*Q.CHIP_SIZE+"px -"+t.y*Q.CHIP_SIZE+"px"}))}},s.prototype.addFace=function(t){this._faces.push(t)},s.prototype.clearFaces=function(){this._faces=[]},s.prototype.updateItemEffectEnabled=function(t){this._wwaData.isItemEffectEnabled=t},s.prototype.setOldMove=function(t){this._wwaData.isOldMove=t},s.prototype.initCSSRule=function(){this._styleElm=_t(Q.WWA_STYLE_TAG_ID),this._sheet=this._styleElm.sheet,this.updateCSSRule()},s.prototype.updateCSSRule=function(){if(void 0===this._stylePos)this._stylePos=new Array(2);else if(void 0!==this._sheet.addRule)for(var t=0;t<this._stylePos.length;t++)this._sheet.removeRule(this._stylePos[this._styleElm[t]]);else for(t=0;t<this._stylePos.length;t++)this._sheet.deleteRule(this._stylePos[this._styleElm[t]]);var e="div.wwa-message-window, div#wwa-text-message-window, div#wwa-battle-estimate, div#wwa-password-window",s=this._isClassicModeEnable?1:.9,a="\nbackground-color: rgba(".concat(this._wwaData.frameColorR,", ").concat(this._wwaData.frameColorG,", ").concat(this._wwaData.frameColorB,", ").concat(s,");\nborder-color: rgba(").concat(this._wwaData.frameOutColorR,", ").concat(this._wwaData.frameOutColorG,", ").concat(this._wwaData.frameOutColorB,", 1);\ncolor: rgba(").concat(this._wwaData.fontColorR,", ").concat(this._wwaData.fontColorG,", ").concat(this._wwaData.fontColorB,", 1);\nwhite-space: pre-wrap;\n"),i="div#wwa-sidebar",o="\ncolor: rgba(".concat(this._wwaData.statusColorR,", ").concat(this._wwaData.statusColorG,", ").concat(this._wwaData.statusColorB,",1);\nfont-weight: bold;\n");void 0!==this._sheet.addRule?(this._stylePos[at.MESSAGE_WINDOW]=this._sheet.addRule(e,a),this._stylePos[at.SIDEBAR]=this._sheet.addRule(i,o)):(this._stylePos[at.MESSAGE_WINDOW]=this._sheet.insertRule("".concat(e," { ").concat(a," }"),0),this._stylePos[at.SIDEBAR]=this._sheet.insertRule("".concat(i," { ").concat(o," }"),1))},s.prototype.changeStyleRule=function(t,e,s,a){t===st.COLOR_FRAME?(this._wwaData.frameColorR=e,this._wwaData.frameColorG=s,this._wwaData.frameColorB=a):t===st.COLOR_FRAMEOUT?(this._wwaData.frameOutColorR=e,this._wwaData.frameOutColorG=s,this._wwaData.frameOutColorB=a):t===st.COLOR_STR?(this._wwaData.fontColorR=e,this._wwaData.fontColorG=s,this._wwaData.fontColorB=a):t===st.COLOR_STATUS_STR&&(this._wwaData.statusColorR=e,this._wwaData.statusColorG=s,this._wwaData.statusColorB=a),this.updateCSSRule()},s.prototype.showMonsterWindow=function(){this._monsterWindow.show()},s.prototype.isClassicMode=function(){return this._isClassicModeEnable},s.prototype.isConsoleOutputMode=function(){return this._useConsole},s.prototype.forcedJumpGate=function(t,e){this._player.jumpTo(new y(this,t,e,0,0))},s.prototype.setUserVar=function(t,e){if(this.isNotNumberTypeOrNaN(t)||!this.isValidUserVarIndex(t))throw new Error("代入先のユーザ変数の番号 が 0 以上 ".concat(Q.USER_VAR_NUM-1," 以下の数値になっていません!"));this._wwaData.userVar[t]=this.toAssignableValue(e),this._messageWindow.update()},s.prototype.toAssignableValue=function(t){var e=t>0?Math.floor(t):Math.ceil(t),s=Math.max(Math.min(e,Q.USER_VAR_NUM_MAX_VALUE),Q.USET_VAR_NUM_MIN_VALUE);return this.isNotNumberTypeOrNaN(s)?0:s},s.prototype.isValidUserVarIndex=function(t){return"number"==typeof t&&t>=0&&t<Q.USER_VAR_NUM&&(0|t)===t},s.prototype.isNotNumberTypeOrNaN=function(t){return"number"!=typeof t||t!=t},s.prototype.getUserVar=function(t){return this._wwaData.userVar[t]},s.prototype.recUserPosition=function(t,e){var s=this._player.getPosition().getPartsCoord();this.setUserVar(t,s.x),this.setUserVar(e,s.y)},s.prototype.jumpRecUserPosition=function(t,e){this.forcedJumpGate(this._wwaData.userVar[t],this._wwaData.userVar[e])},s.prototype.outputUserVar=function(t){console.log("Var["+t+"] = "+this._wwaData.userVar[t])},s.prototype.setUserVarHP=function(t){this.setUserVar(t,this._player.getStatus().energy)},s.prototype.setUserVarHPMAX=function(t){this.setUserVar(t,this._player.getEnergyMax())},s.prototype.setUserVarAT=function(t,e){switch(e){case"bare":return void this.setUserVar(t,this._player.getStatusWithoutEquipments().strength);case"equipment":return void this.setUserVar(t,this._player.getStatusOfEquipments().strength);default:return void this.setUserVar(t,this._player.getStatus().strength)}},s.prototype.setUserVarDF=function(t,e){switch(e){case"bare":return void this.setUserVar(t,this._player.getStatusWithoutEquipments().defence);case"equipment":return void this.setUserVar(t,this._player.getStatusOfEquipments().defence);default:return void this.setUserVar(t,this._player.getStatus().defence)}},s.prototype.setUserVarMONEY=function(t){this.setUserVar(t,this._player.getStatus().gold)},s.prototype.toValidStatusValue=function(t){return this.isNotNumberTypeOrNaN(t)||t<0?0:Math.floor(t)},s.prototype.setHPUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setEnergy(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.isDead()&&this.gameover(),this._player.updateStatusValueBox()},s.prototype.setHPMAXUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setEnergyMax(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},s.prototype.setATUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setStrength(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},s.prototype.setDFUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setDefence(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},s.prototype.setMONEYUserVar=function(t){if(!this.isValidUserVarIndex(t))throw new Error("ユーザ変数の添字が範囲外です。");this._player.setGold(this.toValidStatusValue(this._wwaData.userVar[t])),this._player.updateStatusValueBox()},s.prototype.setUserVarStep=function(t){this.setUserVar(t,this._player.getMoveCount())},s.prototype.setUserVarVal=function(t,e){this.setUserVar(t,e)},s.prototype.setUserValOtherUserVal=function(t,e){this.setUserVar(t,this._wwaData.userVar[e])},s.prototype.setUserValAdd=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]+this._wwaData.userVar[e])},s.prototype.setUserValSub=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]-this._wwaData.userVar[e])},s.prototype.setUserValMul=function(t,e){this.setUserVar(t,this._wwaData.userVar[t]*this._wwaData.userVar[e])},s.prototype.setUserValDiv=function(t,e){this.setUserVar(t,0===e?0:this._wwaData.userVar[t]/this._wwaData.userVar[e])},s.prototype.setUserValMod=function(t,e){this.setUserVar(t,0===e?0:this._wwaData.userVar[t]%this._wwaData.userVar[e])},s.prototype.setUserValRandNum=function(t,e,s){this.setUserVar(t,Math.floor(Math.random()*this.toAssignableValue(e))+s)},s.prototype._generateUserValString=function(t){var e=this;return t.map((function(t){var s=parseInt(t,10);return isNaN(s)?t.replace(/\\n/g,"\n"):function(){return e._wwaData.userVar[s]}}))},s.prototype.speedChangeJudge=function(t){this._wwaData.permitChangeGameSpeed=t},s.prototype.userVarUserIf=function(t,e){if(void 0===e[5])throw new Error("$if の引数不足 str="+e);var s=parseInt(e[0],10),a=parseInt(e[2],10);if(!this.isValidUserVarIndex(s)||!this.isValidUserVarIndex(a))throw new Error("判定対象のユーザ変数の添字が範囲外です!");var i=this._wwaData.userVar[s],o=e[1],r=this._wwaData.userVar[a],n=function(t){return parseInt(t,10)?I.MAP:I.OBJECT};if(this.compareUserVar(i,o,r)){var _=parseInt(e[3],10),h=e[4],c=e[5],u=n(e[6]);this.appearPartsEval(t,h,c,_,u)}else if(void 0!==e[9]){var l=parseInt(e[7],10),p=e[8],d=e[9],E=n(e[10]);this.appearPartsEval(t,p,d,l,E)}},s.prototype.compareUserVar=function(t,e,s){switch(e){case"==":return t===s;case"!=":return t!==s;case">=":return t>=s;case">":return t>s;case"<=":return t<=s;case"<":return t<s;default:throw new Error("未定義の演算子です: ".concat(e))}},s.prototype.setPlayerSpeedIndex=function(t){if(t<Q.MIN_SPEED_INDEX||Q.MAX_SPEED_INDEX<t)throw new Error("#set_speed の引数が異常です:"+t);this._wwaData.gameSpeedIndex=this._player.setSpeedIndex(t)},s.prototype.setUserVarPlayTime=function(t){this.setNowPlayTime(),this.setUserVar(t,this._wwaData.playTime)},s.prototype.setNowPlayTime=function(){var t=new Date;this._wwaData.playTime+=t.getTime()-this._startTime,this._startTime=t.getTime()},s.prototype.hideStatus=function(t,e){if(t<0||t>Z.length)throw new Error("隠すパラメータは0から3の間で指定してください。");this._changeStatusVisibility(Z[t],!e),this._player.updateStatusValueBox()},s.prototype.varMap=function(t,e,s,a,i){if(!this.isValidUserVarIndex(a))throw new Error("対象のユーザ変数の添字が範囲外です");var o=this._wwaData.userVar[a];if(o<0)throw new Error("負のパーツ番号は指定できません");if(i===I.OBJECT&&o>=this.getObjectPartsNum())throw new Error("物体パーツ番号の最大値を超えるパーツ番号が指定されました");if(i===I.MAP&&o>=this.getMapPartsNum())throw new Error("背景パーツ番号の最大値を超えるパーツ番号が指定されました");this.appearPartsEval(t,e,s,o,i)},s.prototype.setItemboxBackgroundPosition=function(t){this._wwaData.imgItemboxX=t.x,this._wwaData.imgItemboxY=t.y,Array.prototype.forEach.call(ut("div.item-cell"),(function(e){e.style.backgroundPosition="-".concat(t.x*Q.CHIP_SIZE,"px -").concat(t.y*Q.CHIP_SIZE,"px")}))},s.prototype._actionGamePadButtonItemMacro=function(){if(!this._wwaData.gamePadButtonItemTable)return!1;var t,e,s,a;for(t=this._wwaData.gamePadButtonItemTable.length,e=0;e<t;e++)if(s=this._wwaData.gamePadButtonItemTable[e]){switch(a=!1,e){case r.BUTTON_CROSS_KEY_LEFT:this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_LEFT)&&(a=!0);break;case r.BUTTON_CROSS_KEY_RIGHT:this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_RIGHT)&&(a=!0);break;case r.BUTTON_CROSS_KEY_UP:this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_UP)&&(a=!0);break;case r.BUTTON_CROSS_KEY_DOWN:this._gamePadStore.crossPressed(r.BUTTON_CROSS_KEY_DOWN)&&(a=!0)}if(this._gamePadStore.buttonTrigger(e)&&(a=!0),a&&this.onselectitem(s))return!0}return!1},s.prototype.setGamePadButtonItemTable=function(t,e){var s,a;if(!this._wwaData.gamePadButtonItemTable)for(a in this._wwaData.gamePadButtonItemTable=[],r)s=a,this._wwaData.gamePadButtonItemTable[s]=0;this._wwaData.gamePadButtonItemTable.length>t&&(this._wwaData.gamePadButtonItemTable[t]=e)},s.prototype._checkSaveDataCompatibility=function(t,e,s){return void 0!==t&&t!==this._wwaData.worldName?Ee.UNMATCHED_WORLD_NAME:s&&s!==de(this._wwaData.worldName,this._wwaData.worldPassNumber)?Ee.UNMATCHED_WORLD_PASS_NUMBER:this._isDisallowLoadOldSave&&e!==this.checkOriginalMapString?Ee.DISALLOW_OLD_REVISION_WORLD_SAVE_DATA:null},s.prototype.isVisibleStatus=function(t){switch(t){case"energy":return this._wwaData.isVisibleStatusEnergy;case"strength":return this._wwaData.isVisibleStatusStrength;case"defence":return this._wwaData.isVisibleStatusDefence;case"gold":return this._wwaData.isVisibleStatusGold;default:throw new Error("存在しないステータスが与えられました")}},s.prototype._changeStatusVisibility=function(t,e){switch(t){case"energy":return void(this._wwaData.isVisibleStatusEnergy=e);case"strength":return void(this._wwaData.isVisibleStatusStrength=e);case"defence":return void(this._wwaData.isVisibleStatusDefence=e);case"gold":return void(this._wwaData.isVisibleStatusGold=e);default:throw new Error("存在しないステータスが与えられました")}},s}(),Ke=!1;function Ve(){Array.prototype.forEach.call(ut("a.wwa-copyright"),(function(t){t.addEventListener("click",(function(){Ke=!0}))})),window.addEventListener("beforeunload",(function(t){var e="このページを離れますか?";if(Ke)return Ke=!1,t.returnValue=e,e}));var t=_t("wwa-wrapper").getAttribute("data-wwa-title-img");kt(_t("wwa-wrapper"),t);var e=_t("wwa-wrapper").getAttribute("data-wwa-mapdata"),s=_t("wwa-wrapper").getAttribute("data-wwa-audio-dir"),a=_t("wwa-wrapper").getAttribute("data-wwa-var-dump-elm"),i=null;_t("wwa-wrapper").hasAttribute("data-wwa-var-dump-elm")&&(i=function(t){var e=ht(t);if(!e)return null;e.classList.add("wwa-vardump-wrapper");var s=document.createElement("table"),a=document.createElement("tr"),i=document.createElement("th"),o=document.createElement("button");o.textContent="隠す",i.textContent="変数一覧",i.setAttribute("colspan","10"),i.classList.add("varlist-header"),i.appendChild(o),a.appendChild(i),s.appendChild(a);for(var r=null,n=null,_=0;_<Q.USER_VAR_NUM;_++){_%10==0&&(null!==r&&(s.appendChild(r),s.appendChild(n)),(r=document.createElement("tr")).classList.add("var-number"),(n=document.createElement("tr")).classList.add("var-val"));var h=document.createElement("th"),c=document.createElement("td");h.textContent=_+"",c.classList.add("var"+_),c.textContent="-",r.appendChild(h),n.appendChild(c)}Q.USER_VAR_NUM%10!=0&&(s.appendChild(r),s.appendChild(n)),e.appendChild(s);var u=!0;return o.addEventListener("click",(function(t){u?(this.textContent="表示",Array.prototype.forEach.call(s.querySelectorAll("tr.var-number"),(function(t){t.style.display="none"})),Array.prototype.forEach.call(s.querySelectorAll("tr.var-val"),(function(t){t.style.display="none"})),u=!1):(this.textContent="隠す",Array.prototype.forEach.call(s.querySelectorAll("tr.var-number"),(function(t){t.style.display="table-row"})),Array.prototype.forEach.call(s.querySelectorAll("tr.var-val"),(function(t){t.style.display="table-row"})),u=!0)})),e}(a));var o=!0;_t("wwa-wrapper").getAttribute("data-wwa-urlgate-enable").match(/^false$/i)&&(o=!1);var r=_t("wwa-wrapper").getAttribute("data-wwa-classic-mode-enable"),n=!1;null!==r&&r.match(/^true$/i)&&(n=!0);var _=!0,h=_t("wwa-wrapper").getAttribute("data-wwa-item-effect-enable");null!==h&&h.match(/^false$/i)&&(_=!1);var c=!1,u=_t("wwa-wrapper").getAttribute("data-wwa-use-go-to-wwa");null!==u&&u.match(/^true$/i)&&(c=!0);var l,p=!(null===(l=_t("wwa-wrapper").getAttribute("data-wwa-disallow-load-old-save"))||!l.match(/^true$/i));Me=new He(e,o,t,n,_,c,s,p,i)}"complete"===document.readyState?setTimeout(Ve):window.addEventListener("load",(function(){setTimeout(Ve)}))}()}();