text: !function(t){function e(e){for(var i,a,s=e[0],u=e[1],c=e[2],d=0,h=[];d<s.length;d++)a=s[d],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&h.push(o[a][0]),o[a]=0;for(i in u)Object.prototype.hasOwnProperty.call(u,i)&&(t[i]=u[i]);for(f&&f(e);h.length;)h.shift()();return r.push.apply(r,c||[]),n()}function n(){for(var t,e=0;e<r.length;e++){for(var n=r[e],i=!0,s=1;s<n.length;s++){var u=n[s];0!==o[u]&&(i=!1)}i&&(r.splice(e--,1),t=a(a.s=n[0]))}return t}var i={},o={0:0},r=[];function a(e){if(i[e])return i[e].exports;var n=i[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=t,a.c=i,a.d=function(t,e,n){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)a.d(n,i,function(e){return t[e]}.bind(null,i));return n},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="";var s=window.webpackJsonp=window.webpackJsonp||[],u=s.push.bind(s);s.push=e,s=s.slice();for(var c=0;c<s.length;c++)e(s[c]);var f=u;r.push([11,1]),n()}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){}return t.getViewportSize=function(){return{width:window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,height:window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}},t.CanvasWidth=800,t.CanvasHeight=600,t.InnerQuadSize=50,t.BorderSize=10,t.HookSize=10,t.PuzzleTotalSize=t.InnerQuadSize+2*t.BorderSize,t.PuzzleShadowAlpha=.6,t.PuzzleShadowOffset=3,t.Animation={Menu:{MouseOverDuration:100,MouseOverEase:"Linear"}},t.MinDistanceToAutoPut=20,t.FieldShadowAlpha=.2,t.FieldShadowTint=59417,t.Tints={Menu:{HelpButton:13421772,SoundButton:13421772}},t.Scales={Menu:{ShowButton:.7,ShowButtonAnimated:.9,HelpButton:.7,HelpButtonAnimated:.9,SoundButton:.7,SoundButtonAnimated:.9},MiniTarget:.6},t.Depths={Background:0,Field:1,OnTargetPositionPuzzle:2,OnFieldPuzzle:10,OnDragPuzzle:20,Menu:30,Debug:100},t.Sound={enabled:!0},t.Debug={enabled:!1,style:{lineStyle:{width:2,color:16777215}}},t}();e.default=i},,,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ELockType=void 0,function(t){t[t.None=0]="None",t[t.In=1]="In",t[t.Out=2]="Out"}(e.ELockType||(e.ELockType={}))},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=i(n(0)),r=function(){function t(t){this._soundManager=t,this.setMute()}return t.prototype.onPuzzleDrag=function(){this.getClickSound().play()},t.prototype.onPuzzleDragEnd=function(t){t?this.getFittedClickSound().play():this.getClickSound().play()},t.prototype.onMenuItemOver=function(){this.getMenuItemOverSound().play()},t.prototype.onMenuItemClick=function(){this.getMenuItemClickSound().play()},t.prototype.setMute=function(){this._soundManager.mute=!o.default.Sound.enabled},t.prototype.getClickSound=function(){return this._clickSound||(this._clickSound=this._soundManager.add("click")),this._clickSound},t.prototype.getFittedClickSound=function(){return this._fittedClickSound||(this._fittedClickSound=this._soundManager.add("fitted_click")),this._fittedClickSound},t.prototype.getMenuItemOverSound=function(){return this._menuItemOverSound||(this._menuItemOverSound=this._soundManager.add("menu_item_over")),this._menuItemOverSound},t.prototype.getMenuItemClickSound=function(){return this._menuItemClick||(this._menuItemClick=this._soundManager.add("menu_item_click")),this._menuItemClick},t}();e.default=r},function(t,e,n){t.exports=n.p+"a9882238a1bb3d7163780cee658ae487.png"},function(t,e,n){t.exports=n.p+"6a8c48aaa12bbfebad52b7f9edfb6b90.png"},,function(t,e,n){t.exports=n.p+"2c9ec6ff190216c35c0c3e3ef4c2e142.wav"},function(t,e,n){t.exports=n.p+"2328477a30d1c01be28dfebb6ab78c57.wav"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){}return t.ButtonSpritesheet={Widh:202,Height:53,FramesNumber:6},t.ButtonLayout={Offset:10},t.Position={RatioFromWidth:.5,RatioFromHeight:.4},t.InputSettings={pixelPerfect:!0,alphaTolerance:0},t.Gallery={TargetScale:{Normal:1,Over:1.01}},t}();e.default=i},function(t,e,n){t.exports=n(12)},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=i(n(13)),r=i(n(0)),a=i(n(48)),s=i(n(50));!function(){var t=r.default.getViewportSize();r.default.CanvasWidth=t.width-20,r.default.CanvasHeight=t.height-20;var e={type:Phaser.WEBGL,parent:"phaser-example",width:r.default.CanvasWidth,height:r.default.CanvasHeight,scene:[a.default,s.default,o.default],transparent:!0,scale:{mode:Phaser.Scale.WIDTH_CONTROLS_HEIGHT,autoCenter:Phaser.Scale.CENTER_BOTH,width:r.default.CanvasWidth,height:r.default.CanvasHeight}};new Phaser.Game(e)}()},function(t,e,n){"use strict";var i,o=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(n(2)),s=r(n(5)),u=r(n(6)),c=r(n(14)),f=r(n(15)),d=r(n(16)),h=r(n(17)),l=r(n(18)),p=r(n(19)),g=r(n(20)),P=r(n(21)),_=r(n(22)),y=r(n(23)),m=r(n(24)),v=r(n(25)),z=r(n(29)),w=r(n(0)),T=r(n(30)),S=r(n(4)),O=r(n(42)),b=r(n(45)),M=a.default.Geom.Point,k=a.default.Math.Distance,I=r(n(46)),x=r(n(47)),L=function(t){function e(){var e=t.call(this,{key:"game"})||this;return e.runGame=e.runGame.bind(e),e.onPuzzleDrag=e.onPuzzleDrag.bind(e),e._gameState=new I.default,e}return o(e,t),e.prototype.preload=function(){this.load.image("bird",s.default),this.load.image("night_city",u.default),this.load.image("patterns_atlas",f.default),this.load.image("field_shadow",c.default),this.load.image("showButton",d.default),this.load.image("helpButton",h.default),this.load.image("soundButton",l.default),this.load.image("spark0",p.default),this.load.image("spark1",g.default),this.load.image("spark2",P.default),this.load.image("spark3",_.default),this.load.audio("click",y.default),this.load.audio("fitted_click",m.default)},e.prototype.loadImages=function(t,e){var n=this,i=new Image;i.onload=function(){var o=new Image;o.onload=function(){e(i,o)},o.src=n.textures.getBase64(t)},i.src=this.textures.getBase64("patterns_atlas")},e.prototype.showFieldShadow=function(t){var e=this._fieldStartPosition,n=e.x,i=e.y;this.add.image(0,0,"field_shadow").setOrigin(0,0).setPosition(n,i).setScale(t.width,t.height).setTint(w.default.FieldShadowTint).setAlpha(w.default.FieldShadowAlpha).setDepth(w.default.Depths.Field)},e.prototype.onPuzzleDrag=function(t,e){var n=this._gameState.Puzzles.find((function(e){return e.Id==t.PuzzleId}));switch(e.Event){case"end":var i=this.tryAutoPutPuzzle(n,e.Position);this._soundFx.onPuzzleDragEnd(i),this._gameState.Puzzles.every((function(t){return t.IsOnTargetPosition}))&&this._menu.showCongrats();break;case"start":this._soundFx.onPuzzleDrag()}},e.prototype.tryAutoPutPuzzle=function(t,e){if(k.BetweenPoints(t.TargetPosition,e)<w.default.MinDistanceToAutoPut)return this.putPuzzleOnTargetPosition(t);var n=this.findClosestPuzzle(t),i=n.distance,o=n.puzzle;return!(i>w.default.MinDistanceToAutoPut)&&(o.IsOnTargetPosition?this.putPuzzleOnTargetPosition(t):this.mergeNotFixedPuzzles(t,o))},e.prototype.mergeNotFixedPuzzles=function(t,e){var n=e.View.getPosition(),i=e.TargetPosition,o=this.mergePuzzles([t,e]),r=new M(i.x-o.TargetPosition.x,i.y-o.TargetPosition.y),a=new M(n.x-r.x,n.y-r.y);return o.View.setPosition(a),!0},e.prototype.putPuzzleOnTargetPosition=function(t){var e=this.findAllAdjacentPuzzlesOnTargetPosition(t);return e.length>0&&(e.push(t),t=this.mergePuzzles(e)),t.putOnTargetPosition(),!0},e.prototype.mergePuzzles=function(t){var e=this._puzzleMaker.mergePuzzles(t),n=this._gameState.Puzzles.filter((function(e){return t.findIndex((function(t){return t.Id===e.Id}))<0}));return n.push(e),this._gameState.setPuzzles(n),t.forEach((function(t){return t.destroy()})),e},e.prototype.findAllAdjacentPuzzlesOnTargetPosition=function(t){var e=new Set;return t.Pieces.flatMap((function(t){var n=[];return t.Left&&!e.has(t.Left.Parent.Id)&&(n.push(t.Left.Parent),e.add(t.Left.Parent.Id)),t.Top&&!e.has(t.Top.Parent.Id)&&(n.push(t.Top.Parent),e.add(t.Top.Parent.Id)),t.Right&&!e.has(t.Right.Parent.Id)&&(n.push(t.Right.Parent),e.add(t.Right.Parent.Id)),t.Bottom&&!e.has(t.Bottom.Parent.Id)&&(n.push(t.Bottom.Parent),e.add(t.Bottom.Parent.Id)),n})).filter((function(t){return t&&t.IsOnTargetPosition}))},e.prototype.findClosestPuzzle=function(t){for(var e=t.Pieces.map((function(t){return t.Id})),n=[],i=0,o=t.Pieces;i<o.length;i++){var r=o[i];r.Left&&e.indexOf(r.Left.Id)<0&&n.push({distance:k.BetweenPoints(r.getLeftLockPosition(),r.Left.getRightLockPosition()),puzzle:r.Left.Parent}),r.Top&&e.indexOf(r.Top.Id)<0&&n.push({distance:k.BetweenPoints(r.getTopLockPosition(),r.Top.getBottomLockPosition()),puzzle:r.Top.Parent}),r.Right&&e.indexOf(r.Right.Id)<0&&n.push({distance:k.BetweenPoints(r.getRightLockPosition(),r.Right.getLeftLockPosition()),puzzle:r.Right.Parent}),r.Bottom&&e.indexOf(r.Bottom.Id)<0&&n.push({distance:k.BetweenPoints(r.getBottomLockPosition(),r.Bottom.getTopLockPosition()),puzzle:r.Bottom.Parent})}for(var a=0,s=1;s<n.length;++s)n[s].distance<n[a].distance&&(a=s);return n[a]},e.prototype.getField=function(t){var e=t.width/w.default.InnerQuadSize,n=t.height/w.default.InnerQuadSize;return{Width:e,Height:n,Pieces:(new v.default).make(n,e)}},e.prototype.runGame=function(t,e){this.setFieldStartPosition(e),this.showFieldShadow(e),this._puzzleTextureMaker.setPatternsAndTarget(t,e);var n=this.getField(e),i=this._puzzleMaker.constructPuzzlesForGameStart(n.Pieces,n.Width,this._fieldStartPosition);this._gameState.setPuzzles(i)},e.prototype.setFieldStartPosition=function(t){var e=t.width,n=t.height;this._fieldStartPosition=new M((w.default.CanvasWidth-e)/2,(w.default.CanvasHeight-n)/2)},e.prototype.init=function(t){this._gameState.setTarget(t.target)},e.prototype.create=function(){this.initSubsystems(),this._menu.show(),this.loadImages(this._gameState.Target,this.runGame)},e.prototype.initSubsystems=function(){this._soundFx=new S.default(this.sound),this._debugDrawer=new b.default(this.add,this._gameState),this._puzzleTextureMaker=new z.default(this.textures),this._puzzleViewMaker=new T.default(this.add,this.tweens,this.input),this._puzzleViewMaker.DragEvent.subscribe(this.onPuzzleDrag),this._puzzleViewMaker.DragEvent.subscribe(this._debugDrawer.onDragPuzzle),this._puzzleMaker=new O.default(this._puzzleViewMaker,this._puzzleTextureMaker),this._menu=new x.default(this._gameState,this.add,this.tweens,this._soundFx)},e}(a.default.Scene);e.default=L},function(t,e,n){t.exports=n.p+"ce21cbdd9b894e6af794813eb3fdaf60.png"},function(t,e,n){t.exports=n.p+"4b7c61bf12ddd92789647909bbd3c511.png"},function(t,e,n){t.exports=n.p+"2a617a41dc543373278e3863202ed192.png"},function(t,e,n){t.exports=n.p+"98ffaa0bca4b346f999e6bdb0d29b81e.png"},function(t,e,n){t.exports=n.p+"302020cc8ecfd680168888024d3978df.png"},function(t,e,n){t.exports=n.p+"6d6717a4cb187d0000dcdb1f0142ce02.png"},function(t,e,n){t.exports=n.p+"6ce5e3f4e68d8f80ad818e1995c5270d.png"},function(t,e,n){t.exports=n.p+"8b8a21744fac4809cf5f014155a883ff.png"},function(t,e,n){t.exports=n.p+"0b4d44b391613d2c65537cdc0721b610.png"},function(t,e,n){t.exports=n.p+"614fec9801d664ed68dc0feba0d0cb41.wav"},function(t,e,n){t.exports=n.p+"46fbf6805e08cb6849da372142616004.wav"},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=i(n(0)),r=i(n(26)),a=n(3),s=i(n(27)),u=i(n(28)),c=Phaser.Geom.Point,f=function(){function t(){var t;this._oppositeConnection=((t={})[a.ELockType.In]=a.ELockType.Out,t[a.ELockType.Out]=a.ELockType.In,t)}return t.prototype.make=function(t,e){var n=this.generateConnections(t,e);return this.makePieces(n,e)},t.prototype.generateConnections=function(t,e){for(var n=t*e,i=[],o=0;o<n;++o){var r=this.makeLocks(i,n,t,e,o);i.push(r)}return i},t.prototype.makePieces=function(t,e){for(var n=[],i=0;i<t.length;++i){var a=Math.floor(i/e),s=new c((i%e+.5)*o.default.InnerQuadSize,(a+.5)*o.default.InnerQuadSize),u=new r.default(i,s,t[i]);n.push(u)}return n},t.prototype.makeLocks=function(t,e,n,i,o){var r=new s.default;if(o%i>0){var c=o-1,f=this.getOppositeConnection(t[c].Right.LockType);r.Left=new u.default(f,o-1),t[c].Right.PieceId=o}else r.Left=new u.default(a.ELockType.None);if(o-i>=0){var d=o-i;f=this.getOppositeConnection(t[d].Bottom.LockType);r.Top=new u.default(f,d),t[d].Bottom.PieceId=o}else r.Top=new u.default(a.ELockType.None);return r.Right=o%i!=i-1?new u.default(this.getRandomConnection()):new u.default(a.ELockType.None),r.Bottom=o+i<e?new u.default(this.getRandomConnection()):new u.default(a.ELockType.None),r},t.prototype.getRandomConnection=function(){return Math.random()<.5?a.ELockType.In:a.ELockType.Out},t.prototype.getOppositeConnection=function(t){return this._oppositeConnection[t]},t}();e.default=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(t,e,n){this.Id=t,this.TargetImagePosition=e,this.Locks=n};e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){};e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(t,e){void 0===e&&(e=-1),this.PieceId=e,this.LockType=t};e.default=i},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),r=i(n(0)),a=Phaser.Geom.Point,s=function(){function t(t){this._sizeOfInnerPartOfPiece=r.default.InnerQuadSize,this._offset=r.default.BorderSize,this._pieceSize=r.default.PuzzleTotalSize,this._maskPartsAreas={"horiz-out":[0,50,30,10],"vert-out":[70,0,10,30],"horiz-in":[0,0,50,10],"vert-in":[50,0,10,50],quad:[0,20,30,30],"horiz-solid":[0,10,50,10],"vert-solid":[60,0,10,50]},this._borderPartsAreas={"horiz-in-top":[0,60,50,10],"horiz-in-bottom":[0,69,50,10],"horiz-out-top":[0,69,50,10],"horiz-out-bottom":[0,60,50,10],"horiz-solid-top":[0,88,50,1],"horiz-solid-bottom":[0,79,50,10],"vert-in-left":[52,50,10,50],"vert-in-right":[61,50,10,50],"vert-out-left":[61,50,10,50],"vert-out-right":[52,50,10,50],"vert-solid-left":[71,50,10,50],"vert-solid-right":[80,50,1,50]},this._textureManager=t}return t.prototype.setPatternsAndTarget=function(t,e){this._patternsAtlas=t,this._target=e},t.prototype.generateTextureForPieces=function(t,e){var n="puzzlePiece-"+t,i=this.getBoundaries(e),o=i.leftTop,s=i.rightBottom;this._textureManager.exists(n)&&this._textureManager.remove(n);for(var u=this._textureManager.createCanvas(n,s.x-o.x,s.y-o.y),c=u.context,f=e.map((function(t){return t.Origin.TargetImagePosition})),d=Math.min.apply(Math,f.map((function(t){return t.x}))),h=Math.min.apply(Math,f.map((function(t){return t.y}))),l=0,p=e;l<p.length;l++){var g=p[l],P=new a(g.Origin.TargetImagePosition.x-d,g.Origin.TargetImagePosition.y-h);this.drawPuzzlePieceMask(c,P,g.Origin.Locks)}c.globalCompositeOperation="source-in";var _=Math.max.apply(Math,f.map((function(t){return t.x}))),y=Math.max.apply(Math,f.map((function(t){return t.y}))),m=d-r.default.PuzzleTotalSize/2,v=h-r.default.PuzzleTotalSize/2,z=_+r.default.PuzzleTotalSize/2-m,w=y+r.default.PuzzleTotalSize/2-v;c.drawImage(this._target,m,v,z,w,0,0,z,w),c.globalCompositeOperation="source-over";for(var T=new Set(e.map((function(t){return t.Id}))),S=function(t){return T.has(t)},O=0,b=e;O<b.length;O++){g=b[O],P=new a(g.Origin.TargetImagePosition.x-d,g.Origin.TargetImagePosition.y-h);this.drawPuzzlePieceBorder(c,P,g.Origin.Locks,S)}return c.save(),u.refresh(),n},t.prototype.getBoundaries=function(t){var e=t.map((function(t){return t.Origin.TargetImagePosition})),n=e.map((function(t){return t.x})),i=e.map((function(t){return t.y})),o=Math.min.apply(Math,n),s=Math.min.apply(Math,i),u=Math.max.apply(Math,n),c=Math.max.apply(Math,i),f=r.default.PuzzleTotalSize/2;return{leftTop:new a(o-f,s-f),rightBottom:new a(u+f,c+f)}},t.prototype.drawPatternPiece=function(t,e,n,i,o){var r=this._maskPartsAreas[n],a=r[0],s=r[1],u=r[2],c=r[3];e.drawImage(t,a,s,u,c,i,o,u,c)},t.prototype.drawnBorder=function(t,e,n,i,o){var r=this._borderPartsAreas[n],a=r[0],s=r[1],u=r[2],c=r[3];e.drawImage(t,a,s,u,c,i,o,u,c)},t.prototype.drawPuzzlePieceMask=function(t,e,n){this.drawPatternPiece(this._patternsAtlas,t,"quad",e.x+2*this._offset,e.y+2*this._offset),n.Bottom.LockType==o.ELockType.In?this.drawPatternPiece(this._patternsAtlas,t,"horiz-in",e.x+this._offset,e.y+this._sizeOfInnerPartOfPiece):(this.drawPatternPiece(this._patternsAtlas,t,"horiz-solid",e.x+this._offset,e.y+this._sizeOfInnerPartOfPiece),n.Bottom.LockType==o.ELockType.Out&&this.drawPatternPiece(this._patternsAtlas,t,"horiz-out",e.x+this._offset,e.y+this._sizeOfInnerPartOfPiece+this._offset)),n.Top.LockType==o.ELockType.In?this.drawPatternPiece(this._patternsAtlas,t,"horiz-in",e.x+this._offset,e.y+this._offset):(this.drawPatternPiece(this._patternsAtlas,t,"horiz-solid",e.x+this._offset,e.y+this._offset),n.Top.LockType==o.ELockType.Out&&this.drawPatternPiece(this._patternsAtlas,t,"horiz-out",e.x+this._offset,e.y)),n.Right.LockType==o.ELockType.In?this.drawPatternPiece(this._patternsAtlas,t,"vert-in",e.x+this._sizeOfInnerPartOfPiece,e.y+this._offset):(this.drawPatternPiece(this._patternsAtlas,t,"vert-solid",e.x+this._sizeOfInnerPartOfPiece,e.y+this._offset),n.Right.LockType==o.ELockType.Out&&this.drawPatternPiece(this._patternsAtlas,t,"vert-out",e.x+this._sizeOfInnerPartOfPiece+this._offset,e.y+this._offset)),n.Left.LockType==o.ELockType.In?this.drawPatternPiece(this._patternsAtlas,t,"vert-in",e.x+this._offset,e.y+this._offset):(this.drawPatternPiece(this._patternsAtlas,t,"vert-solid",e.x+this._offset,e.y+this._offset),n.Left.LockType==o.ELockType.Out&&this.drawPatternPiece(this._patternsAtlas,t,"vert-out",e.x,e.y+this._offset))},t.prototype.drawPuzzlePieceBorder=function(t,e,n,i){i(n.Bottom.PieceId)||(n.Bottom.LockType==o.ELockType.In?this.drawnBorder(this._patternsAtlas,t,"horiz-in-bottom",e.x+this._offset,e.y+this._sizeOfInnerPartOfPiece):n.Bottom.LockType==o.ELockType.Out?this.drawnBorder(this._patternsAtlas,t,"horiz-out-bottom",e.x+this._offset,e.y+this._sizeOfInnerPartOfPiece+this._offset):this.drawnBorder(this._patternsAtlas,t,"horiz-solid-bottom",e.x+this._offset,e.y+this._sizeOfInnerPartOfPiece)),i(n.Left.PieceId)||(n.Left.LockType==o.ELockType.In?this.drawnBorder(this._patternsAtlas,t,"vert-in-left",e.x+this._offset,e.y+this._offset):n.Left.LockType==o.ELockType.Out?this.drawnBorder(this._patternsAtlas,t,"vert-out-left",e.x,e.y+this._offset):this.drawnBorder(this._patternsAtlas,t,"vert-solid-left",e.x,e.y+this._offset)),i(n.Right.PieceId)||(n.Right.LockType==o.ELockType.In?this.drawnBorder(this._patternsAtlas,t,"vert-in-right",e.x+this._sizeOfInnerPartOfPiece,e.y+this._offset):n.Right.LockType==o.ELockType.Out?this.drawnBorder(this._patternsAtlas,t,"vert-out-right",e.x+this._sizeOfInnerPartOfPiece+this._offset,e.y+this._offset):this.drawnBorder(this._patternsAtlas,t,"vert-solid-right",e.x+this._sizeOfInnerPartOfPiece+this._offset,e.y+this._offset)),i(n.Top.PieceId)||(n.Top.LockType==o.ELockType.In?this.drawnBorder(this._patternsAtlas,t,"horiz-in-top",e.x+this._offset,e.y+this._offset):n.Top.LockType==o.ELockType.Out?this.drawnBorder(this._patternsAtlas,t,"horiz-out-top",e.x+this._offset,e.y):this.drawnBorder(this._patternsAtlas,t,"horiz-solid-top",e.x+this._offset,e.y+this._offset))},t}();e.default=s},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=i(n(0)),r=i(n(31)),a=n(32),s=Phaser.Geom.Point,u=i(n(41)),c=function(){function t(t,e,n){this._puzzleViewByName=new Map,this._dragEvent=new a.EventDispatcher,this._gameObjectFactory=t,this._tweensManager=e,this._inputManager=n,this.onDragStart=this.onDragStart.bind(this),this.onDrag=this.onDrag.bind(this),this.onDragEnd=this.onDragEnd.bind(this),this._inputManager.on("dragstart",this.onDragStart),this._inputManager.on("drag",this.onDrag),this._inputManager.on("dragend",this.onDragEnd)}return Object.defineProperty(t.prototype,"DragEvent",{get:function(){return this._dragEvent.asEvent()},enumerable:!1,configurable:!0}),t.prototype.constructPiecesView=function(t,e,n){var i=this._gameObjectFactory.image(0,0,n).setOrigin(.5,.5).setAlpha(o.default.PuzzleShadowAlpha).setTint(0),a=this._gameObjectFactory.image(0,0,n).setOrigin(.5,.5).setName(t.toString());a.setInteractive({pixelPerfect:!0,alphaTolerance:0}),this._inputManager.setDraggable(a);var s=new r.default(t,n,e,a,i,this._tweensManager);return s.setPosition(e),this._puzzleViewByName[a.name]=s,s},t.prototype.onDragStart=function(t,e){var n=e.name;if(n){var i=this._puzzleViewByName[n];i.onDragStart();var o=new s(t.x,t.y);this._dragEvent.dispatch(i,new u.default("start",o))}},t.prototype.onDragEnd=function(t,e){var n=e.name;if(n){var i=this._puzzleViewByName[n];i.onDragEnd();var o=new s(t.x,t.y);this._dragEvent.dispatch(i,new u.default("end",o))}},t.prototype.onDrag=function(t,e){if(null!=e&&e.name){var n=e.name,i=this._puzzleViewByName[n];if(i){this.setViewPosition(i,t);var o=new s(t.x,t.y);this._dragEvent.dispatch(i,new u.default("drag",o))}}},t.prototype.setViewPosition=function(t,e){var n=new s(e.position.x-e.prevPosition.x,e.position.y-e.prevPosition.y),i=t.getPosition(),o=new s(i.x+n.x,i.y+n.y);t.setPosition(o)},t}();e.default=c},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=i(n(0)),r=Phaser.Geom.Point,a=function(){function t(t,e,n,i,r,a){this.PuzzleId=t,this.Texture=e,this.TargetPosition=n,this.MainSprite=i,this.ShadowSprite=r,this._tweensManager=a,this.setDepth(o.default.Depths.OnFieldPuzzle)}return t.prototype.getPosition=function(){var t=this.MainSprite,e=t.x,n=t.y;return new r(e,n)},t.prototype.setPosition=function(e){var n=t.getSpriteShadowPosition(e);this.MainSprite.setPosition(e.x,e.y),this.ShadowSprite.setPosition(n.x,n.y)},t.prototype.onDragStart=function(){this.setDepth(o.default.Depths.OnDragPuzzle)},t.prototype.onDragEnd=function(){this.setDepth(o.default.Depths.OnFieldPuzzle)},t.prototype.destroy=function(){this.MainSprite.destroy(),this.ShadowSprite.destroy()},t.prototype.switchOffInteractivity=function(){this.MainSprite.disableInteractive(),this.ShadowSprite.disableInteractive()},t.prototype.onTargetPosition=function(){this.setDepth(o.default.Depths.OnTargetPositionPuzzle)},t.prototype.setDepth=function(t){this.MainSprite.setDepth(t),this.ShadowSprite.setDepth(t)},t.startScaleOutTween=function(t,e){e.add({targets:t,scale:{from:1,to:o.default.PuzzleScaleOnOver},ease:o.default.PuzzleScalingOutAnimzationEase,duration:o.default.PuzzleScalingOutAnimzationDuration})},t.startScaleInTween=function(t,e){e.add({targets:t,scale:{from:t.scale,to:1},ease:o.default.PuzzleScalingInAnimzationEase,duration:o.default.PuzzleScalingInAnimzationDuration})},t.getSpriteShadowPosition=function(t){return new r(t.x+o.default.PuzzleShadowOffset,t.y+o.default.PuzzleShadowOffset)},t}();e.default=a},,,,,,,,,,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(t,e){this.Event=t,this.Position=e};e.default=i},function(t,e,n){"use strict";var i=this&&this.__spreadArrays||function(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var i=Array(t),o=0;for(e=0;e<n;e++)for(var r=arguments[e],a=0,s=r.length;a<s;a++,o++)i[o]=r[a];return i},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var r=o(n(0)),a=n(3),s=o(n(43)),u=o(n(44)),c=Phaser.Geom.Point,f=function(){function t(t,e){this._viewMaker=t,this._textureMaker=e}return t.prototype.constructPuzzlesForGameStart=function(t,e,n,i,o){var a=this;void 0===i&&(i=!0),void 0===o&&(o=!1);var s,u=this.constructPieces(t,n);return s=o?this.constructMergedPuzzles(u,e):u.map((function(t){return a.constructPuzzleFromPieces(t.Id,[t])})),i&&s.forEach((function(t){var e=new c(Math.random()*r.default.CanvasWidth,Math.random()*r.default.CanvasHeight);t.View.setPosition(e)})),s},t.prototype.mergePuzzles=function(t){var e=t.flatMap((function(t){return t.Pieces}));return this.constructPuzzleFromPieces(t[0].Pieces[0].Id,e)},t.prototype.constructMergedPuzzles=function(t,e){for(var n=[],o=t.length,r=i(t),a=0;a<o;++a)if(r[a]){var s=this.mergePieces(r[a].Id,r,e,4),u=this.constructPuzzleFromPieces(t[a].Id,s);n.push(u)}return n},t.prototype.constructPuzzleFromPieces=function(t,e){var n=this._textureMaker.generateTextureForPieces(t,e),i=this.getPiecesCenterPoint(e),o=this._viewMaker.constructPiecesView(t,i,n),r=new s.default(t,i,e,o);return this.setPiecesParent(r,e),r},t.prototype.constructPieces=function(t,e){for(var n=t.map((function(t){var n=new c(t.TargetImagePosition.x+e.x,t.TargetImagePosition.y+e.y);return new u.default(t,n)})),i=0,o=n;i<o.length;i++){var r=o[i],a=this.getLockPiece(r.Origin.Locks.Left,n),s=this.getLockPiece(r.Origin.Locks.Top,n),f=this.getLockPiece(r.Origin.Locks.Right,n),d=this.getLockPiece(r.Origin.Locks.Bottom,n);r.setAdjacentPieces(a,s,f,d)}return n},t.prototype.setPiecesParent=function(t,e){for(var n=0,i=e;n<i.length;n++){var o=i[n],r=new c(o.TargetPositionOnField.x-t.TargetPosition.x,o.TargetPositionOnField.y-t.TargetPosition.y);o.setParent(t,r)}},t.prototype.getLockPiece=function(t,e){return t.LockType==a.ELockType.None?null:e[t.PieceId]},t.prototype.mergePieces=function(t,e,n,i){for(var o=[];t>-1&&o.length<i;){o.push(e[t]),e[t]=null;var r=[];t+1<e.length&&e[t+1]&&(t+1)%n!=0&&r.push(t+1),t+n<e.length&&e[t+n]&&r.push(t+n),t=r?r[Math.floor(Math.random()*(r.length+1))]:-1}return o},t.prototype.getPiecesCenterPoint=function(t){var e=t.map((function(t){return t.TargetPositionOnField.x})),n=t.map((function(t){return t.TargetPositionOnField.y})),i=(Math.min.apply(Math,e)+Math.max.apply(Math,e))/2,o=(Math.min.apply(Math,n)+Math.max.apply(Math,n))/2;return new c(i,o)},t}();e.default=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e,n,i){this._isOnTargetPosition=!1,this._adjacentPuzzles=[],this.Pieces=[],this.Id=t,this.TargetPosition=e,this.View=i,this.Pieces=n,this._isOnTargetPosition=!1}return Object.defineProperty(t.prototype,"IsOnTargetPosition",{get:function(){return this._isOnTargetPosition},enumerable:!1,configurable:!0}),t.prototype.putOnTargetPosition=function(){this.View.setPosition(this.TargetPosition),this.View.switchOffInteractivity(),this.View.onTargetPosition(),this._isOnTargetPosition=!0},t.prototype.addAdjacentPuzzle=function(t){this._adjacentPuzzles.push(t)},t.prototype.destroy=function(){this.View.destroy()},t}();e.default=i},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=i(n(0)),r=Phaser.Geom.Point,a=function(){function t(t,e){this.Id=t.Id,this.Origin=t,this.TargetPositionOnField=e}return t.prototype.getLeftLockPosition=function(){var t=this.getAbsolutePosition();return new r(t.x-o.default.InnerQuadSize/2,t.y)},t.prototype.getTopLockPosition=function(){var t=this.getAbsolutePosition();return new r(t.x,t.y-o.default.InnerQuadSize/2)},t.prototype.getRightLockPosition=function(){var t=this.getAbsolutePosition();return new r(t.x+o.default.InnerQuadSize/2,t.y)},t.prototype.getBottomLockPosition=function(){var t=this.getAbsolutePosition();return new r(t.x,t.y+o.default.InnerQuadSize/2)},t.prototype.setParent=function(t,e){this.Parent=t,this._relativePosition=e},t.prototype.setAdjacentPieces=function(t,e,n,i){this.Left=t,this.Top=e,this.Right=n,this.Bottom=i},t.prototype.getAbsolutePosition=function(){return new r(this._relativePosition.x+this.Parent.View.MainSprite.x,this._relativePosition.y+this.Parent.View.MainSprite.y)},t}();e.default=a},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=i(n(0)),r=Phaser.Geom.Line,a=function(){function t(t,e){this._debugGraphics=t.graphics(o.default.Debug.style),this._debugGraphics.setDepth(o.default.Depths.Debug),this._gameState=e,this.onDragPuzzle=this.onDragPuzzle.bind(this)}return t.prototype.onDragPuzzle=function(t,e){switch(e.Event){case"drag":this.drawTargetLines(t.PuzzleId);break;case"end":this.onDragEndPuzzle()}},t.prototype.onDragEndPuzzle=function(){o.default.Debug.enabled&&this._debugGraphics.clear()},t.prototype.drawTargetLines=function(t){if(o.default.Debug.enabled){this._debugGraphics.clear();var e=this._gameState.Puzzles.find((function(e){return e.Id==t}));this.drawLineToTargetPosition(e.View),this.drawLinesToLocks(e.Pieces)}},t.prototype.drawLinesToLocks=function(t){for(var e=t.map((function(t){return t.Id})),n=0,i=t;n<i.length;n++){var o=i[n];o.Left&&e.indexOf(o.Left.Id)<0&&this.lineDrawToLock(o.getLeftLockPosition(),o.Left.getRightLockPosition()),o.Top&&e.indexOf(o.Top.Id)<0&&this.lineDrawToLock(o.getTopLockPosition(),o.Top.getBottomLockPosition()),o.Right&&e.indexOf(o.Right.Id)<0&&this.lineDrawToLock(o.getRightLockPosition(),o.Right.getLeftLockPosition()),o.Bottom&&e.indexOf(o.Bottom.Id)<0&&this.lineDrawToLock(o.getBottomLockPosition(),o.Bottom.getTopLockPosition())}},t.prototype.lineDrawToLock=function(t,e){var n=new r(t.x,t.y,e.x,e.y);this._debugGraphics.strokeLineShape(n)},t.prototype.drawLineToTargetPosition=function(t){var e=t.MainSprite,n=e.x,i=e.y,o=t.TargetPosition,a=o.x,s=o.y,u=new r(n,i,a,s);this._debugGraphics.strokeLineShape(u)},t}();e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){this._puzzles=[]}return Object.defineProperty(t.prototype,"Target",{get:function(){return this._target},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"Puzzles",{get:function(){return this._puzzles},enumerable:!1,configurable:!0}),t.prototype.setPuzzles=function(t){this._puzzles=t},t.prototype.setTarget=function(t){this._target=t},t}();e.default=i},function(t,e,n){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=i(n(0)),r=Phaser.Geom.Point,a=function(){function t(t,e,n,i){this._gameState=t,this._factory=e,this._tweensManager=n,this._soundFx=i}return t.prototype.show=function(){var t=this,e=this._factory.image(o.default.CanvasWidth-30,30,"soundButton").setScale(o.default.Scales.Menu.SoundButton).setDepth(o.default.Depths.Menu),n=this._factory.image(o.default.CanvasWidth-80,30,"helpButton").setScale(o.default.Scales.Menu.HelpButton).setDepth(o.default.Depths.Menu),i=this._factory.image(o.default.CanvasWidth-130,30,"showButton").setScale(o.default.Scales.Menu.ShowButton).setDepth(o.default.Depths.Menu),r=this._factory.image(0,0,this._gameState.Target).setOrigin(1,0).setPosition(i.x-50,i.y).setScale(o.default.Scales.MiniTarget).setDepth(o.default.Depths.Menu).setVisible(!1),a={pixelPerfect:!0,alphaTolerance:0};e.setInteractive(a),n.setInteractive(a),i.setInteractive(a),e.on("pointerover",(function(){return t.startScaleOutTween(e,o.default.Scales.Menu.SoundButton,o.default.Scales.Menu.SoundButtonAnimated)})),e.on("pointerout",(function(){return t.startScaleInTween(e,o.default.Scales.Menu.SoundButton)})),e.on("pointerdown",(function(){o.default.Sound.enabled=!o.default.Sound.enabled,t.setSoundButtonTint(e),t._soundFx.setMute()})),this.setSoundButtonTint(e),n.on("pointerover",(function(){return t.startScaleOutTween(n,o.default.Scales.Menu.HelpButton,o.default.Scales.Menu.HelpButtonAnimated)})),n.on("pointerout",(function(){return t.startScaleInTween(n,o.default.Scales.Menu.HelpButton)})),n.on("pointerdown",(function(){o.default.Debug.enabled=!o.default.Debug.enabled,t.setHelpButtonTint(n)})),this.setHelpButtonTint(n),i.on("pointerover",(function(){return t.startScaleOutTween(i,o.default.Scales.Menu.ShowButton,o.default.Scales.Menu.ShowButtonAnimated)})),i.on("pointerout",(function(){return t.startScaleInTween(i,o.default.Scales.Menu.ShowButton)})),i.on("pointerdown",(function(){r.setVisible(!0)})),i.on("pointerup",(function(){r.setVisible(!1)}))},t.prototype.showCongrats=function(){for(var t=["spark0","spark1","spark2","spark3"],e=[new r(100,100),new r(o.default.CanvasWidth-100,100),new r(o.default.CanvasWidth-100,o.default.CanvasHeight-100),new r(100,o.default.CanvasHeight-100)],n=0;n<4;++n){var i=this._factory.particles(t[n]);i.setDepth(100);i.createEmitter({x:e[n].x,y:e[n].y,speed:200,angle:{min:0,max:360},scale:{start:1,end:0},blendMode:Phaser.BlendModes.SCREEN,lifespan:2e3})}var a=this._factory.text(0,0,"Bingo!",{fontFamily:"Courier",color:"#ffffff",stroke:"#000000",strokeThickness:10,fontSize:"100px",shadow:{offsetX:0,offsetY:0,color:"#000",blur:0,stroke:!1,fill:!1}});a.setOrigin(.5,.5),a.setPosition(o.default.CanvasWidth/2,o.default.CanvasHeight/2),a.setDepth(500)},t.prototype.setHelpButtonTint=function(t){t.setTint(o.default.Debug.enabled?16777215:o.default.Tints.Menu.HelpButton)},t.prototype.setSoundButtonTint=function(t){t.setTint(o.default.Sound.enabled?16777215:o.default.Tints.Menu.SoundButton)},t.prototype.startScaleOutTween=function(t,e,n){this._tweensManager.add({targets:t,scale:{from:e,to:n},ease:o.default.Animation.Menu.MouseOverEase,duration:o.default.Animation.Menu.MouseOverDuration})},t.prototype.startScaleInTween=function(t,e){this._tweensManager.add({targets:t,scale:{from:t.scale,to:e},ease:o.default.Animation.Menu.MouseOverEase,duration:o.default.Animation.Menu.MouseOverDuration})},t}();e.default=a},function(t,e,n){"use strict";var i,o=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(n(2)),s=r(n(49)),u=r(n(8)),c=r(n(9)),f=r(n(0)),d=r(n(10)),h=r(n(4)),l=function(t){function e(){var e=t.call(this,{key:"ui"})||this;return e.startGame=e.startGame.bind(e),e}return o(e,t),e.prototype.preload=function(){var t={frameWidth:d.default.ButtonSpritesheet.Widh,frameHeight:d.default.ButtonSpritesheet.Height,endFrame:d.default.ButtonSpritesheet.FramesNumber-1};this.load.spritesheet("buttons",s.default,t),this.load.audio("menu_item_over",u.default),this.load.audio("menu_item_click",c.default)},e.prototype.create=function(){this._soundFx=new h.default(this.sound),this.createMenu()},e.prototype.createMenu=function(){var t=this.constructMenuContainer(),e=this.constructStartGameButton(),n=this.constructTopButton(),i=this.constructEditorButton();t.add(e),t.add(n),t.add(i)},e.prototype.startGame=function(){this.scene.transition({target:"gallery",duration:100})},e.prototype.getButtonOffsetFromTop=function(t){return t*(d.default.ButtonSpritesheet.Height+d.default.ButtonLayout.Offset)},e.prototype.constructMenuContainer=function(){var t=f.default.getViewportSize(),e=this.add.container();return e.setPosition(t.width*d.default.Position.RatioFromWidth,t.height*d.default.Position.RatioFromHeight),e},e.prototype.constructStartGameButton=function(){var t=this,e=this.add.image(0,this.getButtonOffsetFromTop(0),"buttons",0);return e.setInteractive(d.default.InputSettings),e.on("pointerover",(function(){return t.onItemOver(e,1)})),e.on("pointerout",(function(){return e.setFrame(0)})),e.on("pointerdown",(function(){return t.onItemClick(t.startGame)})),e},e.prototype.constructTopButton=function(){var t=this,e=this.add.image(0,this.getButtonOffsetFromTop(1),"buttons",2);return e.setInteractive(d.default.InputSettings),e.on("pointerover",(function(){return t.onItemOver(e,3)})),e.on("pointerout",(function(){return e.setFrame(2)})),e},e.prototype.constructEditorButton=function(){var t=this,e=this.add.image(0,this.getButtonOffsetFromTop(2),"buttons",4);return e.setInteractive(d.default.InputSettings),e.on("pointerover",(function(){return t.onItemOver(e,5)})),e.on("pointerout",(function(){return e.setFrame(4)})),e},e.prototype.onItemOver=function(t,e){t.setFrame(e),this._soundFx.onMenuItemOver()},e.prototype.onItemClick=function(t){this._soundFx.onMenuItemClick(),t()},e}(a.default.Scene);e.default=l},function(t,e,n){t.exports=n.p+"40881e2b79b137abc02fba31f54fab96.png"},function(t,e,n){"use strict";var i,o=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(n(2)),s=r(n(5)),u=r(n(6)),c=r(n(8)),f=r(n(9)),d=r(n(0)),h=r(n(10)),l=r(n(4)),p=a.default.Geom.Point,g=function(t){function e(){var e=t.call(this,{key:"gallery"})||this;return e._targets=["bird","night_city"],e.startGame=e.startGame.bind(e),e}return o(e,t),e.prototype.preload=function(){this.load.image("bird",s.default),this.load.image("night_city",u.default),this.load.audio("menu_item_over",c.default),this.load.audio("menu_item_click",f.default)},e.prototype.create=function(){this._soundFx=new l.default(this.sound),this.createGallery()},e.prototype.createGallery=function(){for(var t=this.constructGalleryGrid(1,2),e=0;e<this._targets.length;++e)this.constructTarget(this._targets[e],t[e])},e.prototype.constructTarget=function(t,e){var n=this,i=this.add.image(e.x,e.y,t);return i.setScale(h.default.Gallery.TargetScale.Normal),i.setInteractive(h.default.InputSettings),i.on("pointerover",(function(){return n.onTargetOver(i)})),i.on("pointerout",(function(){return i.setScale(h.default.Gallery.TargetScale.Normal)})),i.on("pointerdown",(function(){return n.startGame(t)})),i},e.prototype.onTargetOver=function(t){this._soundFx.onMenuItemOver(),t.setScale(h.default.Gallery.TargetScale.Over)},e.prototype.startGame=function(t){this._soundFx.onMenuItemClick(),this.scene.start("game",{target:t})},e.prototype.constructGalleryGrid=function(t,e){for(var n=d.default.getViewportSize(),i=n.height/(t+1),o=n.width/(e+1),r=[],a=0;a<t;++a)for(var s=0;s<e;++s){var u=new p((s+1)*o,(a+1)*i);r.push(u)}return r},e}(a.default.Scene);e.default=g}]);