if(null===revision||"undefined"===typeof revision)var revision=1234;var cc=cc||{};cc._tmp=cc._tmp||{};cc._LogInfos={};var _p=window,_p=Object.prototype,_p=null;cc._drawingUtil=null;cc._renderContext=null;cc._supportRender=!1;cc._canvas=null;cc.container=null;cc._gameDiv=null;cc.each=function(a,b,c){if(a)if(a instanceof Array)for(var d=0,e=a.length;d=a._limit)){var b=a._pool.shift(),c=b.value,d=b.index;a._workingSize++;a._iterator.call(a._iteratorTarget,c,d,function(b,c){if(!a._finished)if(b?a._errors[this.index]=b:a._results[this.index]=c,a.finishedSize++,a._workingSize--,a.finishedSize===a.size)a.onEnd(0===a._errors.length?null:a._errors,a._results);else a._handleItem()}.bind(b),a)}};f.flow=function(){if(0===this._pool.length)this._onEnd&&this._onEnd.call(this._onEndTarget,null,[]);else for(var a= 0;ac?a+b+d:a.substring(0,c)+b+d},changeBasename:function(a,b,c){if(0===b.indexOf("."))return this.changeExtname(a,b);var d=a.indexOf("?"),e="";c=c?this.extname(a):"";0=d?0:d+1)+b+c+e},_normalize:function(a){var b=a=String(a);do b=a,a=a.replace(this.normalizeRE,"");while(b.length!==a.length);return a}}; cc.loader=function(){var a={},b={},c={},d={},e={},f=/^(?:https?|ftp):\/\/\S*$/i;return{resPath:"",audioPath:"",cache:{},getXMLHttpRequest:function(){var a=window.XMLHttpRequest?new window.XMLHttpRequest:new ActiveXObject("MSXML2.XMLHTTP");void 0===a.ontimeout&&(a._timeoutId=-1);return a},_getArgs4Js:function(a){var b=a[0],c=a[1],d=a[2],e=["",null,null];if(1===a.length)e[1]=b instanceof Array?b:[b];else if(2===a.length)"function"===typeof c?(e[1]=b instanceof Array?b:[b],e[2]=c):(e[0]=b||"",e[1]=c instanceof Array?c:[c]);else if(3===a.length)e[0]=b||"",e[1]=c instanceof Array?c:[c],e[2]=d;else throw Error("arguments error to load js!");return e},isLoading:function(a){return void 0!==e[a]},loadJs:function(b,c,d){var e=this,f=e._getArgs4Js(arguments),p=f[0],r=f[1],f=f[2];-1=b.length)d&&d();else{var e=this;e._createScript(cc.path.join(a,b[c]),!1,function(f){if(f)return d(f);e._loadJs4Dependency(a,b,c+1,d)})}},_loadJsImg:function(){var a=document,b=a.getElementById("cocos2d_loadJsImg");if(!b){b=document.createElement("img");cc._loadingImage&&(b.src=cc._loadingImage);a=a.getElementById(cc.game.config.id); a.style.backgroundColor="transparent";a.parentNode.appendChild(b);var c=getComputedStyle?getComputedStyle(a):a.currentStyle;c||(c={width:a.width,height:a.height});b.style.left=a.offsetLeft+(parseFloat(c.width)-b.width)/2+"px";b.style.top=a.offsetTop+(parseFloat(c.height)-b.height)/2+"px";b.style.position="absolute"}return b},loadTxt:function(a,b){if(cc._isNodeJs)require("fs").readFile(a,function(a,c){a?b(a):b(null,c.toString())});else{var c=this.getXMLHttpRequest(),d="load "+a+" failed!";c.open("GET", a,!0);/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent)?(c.setRequestHeader("Accept-Charset","utf-8"),c.onreadystatechange=function(){4===c.readyState&&(200===c.status?b(null,c.responseText):b({status:c.status,errorMessage:d},null))}):(c.overrideMimeType&&c.overrideMimeType("text/plain; charset\x3dutf-8"),c.onload=function(){0<=c._timeoutId&&clearTimeout(c._timeoutId);4===c.readyState&&(200===c.status?b(null,c.responseText):b({status:c.status,errorMessage:d},null))},c.onerror= function(){b({status:c.status,errorMessage:d},null)},void 0===c.ontimeout&&(c._timeoutId=setTimeout(function(){c.ontimeout()},c.timeout)),c.ontimeout=function(){b({status:c.status,errorMessage:"Request timeout: "+d},null)});c.send(null)}},loadCsb:function(a,b){var c=cc.loader.getXMLHttpRequest(),d="load "+a+" failed!";c.open("GET",a,!0);c.responseType="arraybuffer";c.onload=function(){0<=c._timeoutId&&clearTimeout(c._timeoutId);var a=c.response;a&&(window.msg=a);4===c.readyState&&(200===c.status? b(null,c.response):b({status:c.status,errorMessage:d},null))};c.onerror=function(){b({status:c.status,errorMessage:d},null)};void 0===c.ontimeout&&(c._timeoutId=setTimeout(function(){c.ontimeout()},c.timeout));c.ontimeout=function(){b({status:c.status,errorMessage:"Request timeout: "+d},null)};c.send(null)},loadJson:function(a,b){this.loadTxt(a,function(c,d){if(c)b(c);else{try{var e=JSON.parse(d)}catch(f){throw Error("parse json ["+a+"] failed : "+f);}b(null,e)}})},_checkIsImageURL:function(a){return null!= /(\.png)|(\.jpg)|(\.bmp)|(\.jpeg)|(\.gif)/.exec(a)},loadImg:function(a,b,c){var d={isCrossOrigin:!0};void 0!==c?d.isCrossOrigin=void 0===b.isCrossOrigin?d.isCrossOrigin:b.isCrossOrigin:void 0!==b&&(c=b);var n=this.getRes(a);if(n)return c&&c(null,n),n;if(b=e[a])return b.callbacks.push(c),b.img;n=new Image;d.isCrossOrigin&&"file://"!==location.origin&&(n.crossOrigin="Anonymous");var p=function(){this.removeEventListener("load",p,!1);this.removeEventListener("error",s,!1);f.test(a)||(cc.loader.cache[a]= n);var b=e[a];if(b){for(var c=b.callbacks,d=0;db)return"";var c=a[0],d=!0;"object"===typeof c&&(d=!1);for(var e=1;ec)a[b.renderMode]=0;cc._renderType=cc.game.RENDER_TYPE_CANVAS;cc._supportRender=!1;0===c?(a=-1,/iP(hone|od|ad)/.test(navigator.platform)&&(a=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),a=parseInt(a[1],10)),cc.sys.capabilities.opengl&&14>a?(cc._renderType=cc.game.RENDER_TYPE_WEBGL,cc._supportRender=!0):cc.sys.capabilities.canvas&&(cc._renderType=cc.game.RENDER_TYPE_CANVAS,cc._supportRender= !0)):1===c&&cc.sys.capabilities.canvas?(cc._renderType=cc.game.RENDER_TYPE_CANVAS,cc._supportRender=!0):2===c&&cc.sys.capabilities.opengl&&(cc._renderType=cc.game.RENDER_TYPE_WEBGL,cc._supportRender=!0)}function b(a,c,d){if(h[c])return null;d=d||"";var e=[],f=a[c];if(!f)throw Error("can not find module ["+c+"]");c=cc.path;for(var g=0,k=f.length;gg.indexOf("base4webgl")?g.splice(0,0,"base4webgl"):0>g.indexOf("core")&&g.splice(0,0,"core");for(var m=0,s=g.length;mc.indexOf("core")&&c.splice(0,0,"core");c&&(a[b.modules]=c);this.config=a;this._configLoaded=!0},_initRenderer:function(a,b){if(!this._rendererInitialized){if(!cc._supportRender)throw Error("The renderer doesn't support the renderMode "+this.config[this.CONFIG_KEY.renderMode]);var c=this.config[cc.game.CONFIG_KEY.id],d=window,c=cc.$(c)||cc.$("#"+c),e,f;"CANVAS"===c.tagName?(a=a||c.width,b=b||c.height,this.canvas=cc._canvas=e=c,this.container= cc.container=f=document.createElement("DIV"),e.parentNode&&e.parentNode.insertBefore(f,e)):("DIV"!==c.tagName&&cc.log("Warning: target element is not a DIV or CANVAS"),a=a||c.clientWidth,b=b||c.clientHeight,this.canvas=cc._canvas=e=document.createElement("CANVAS"),this.container=cc.container=f=document.createElement("DIV"),c.appendChild(f));f.setAttribute("id","Cocos2dGameContainer");f.appendChild(e);this.frame=f.parentNode===document.body?document.documentElement:f.parentNode;e.addClass("gameCanvas"); e.setAttribute("width",a||480);e.setAttribute("height",b||320);e.setAttribute("tabindex",99);cc._renderType===cc.game.RENDER_TYPE_WEBGL&&(this._renderContext=cc._renderContext=cc.webglContext=cc.create3DContext(e,{stencil:!0,alpha:!1}));this._renderContext?(cc.renderer=cc.rendererWebGL,d.gl=this._renderContext,cc.renderer.init(),cc._drawingUtil=new cc.DrawingPrimitiveWebGL(this._renderContext),cc.textureCache._initializingRenderer(),cc.glExt={},cc.glExt.instanced_arrays=d.gl.getExtension("ANGLE_instanced_arrays"), cc.glExt.element_uint=d.gl.getExtension("OES_element_index_uint")):(cc._renderType=cc.game.RENDER_TYPE_CANVAS,cc.renderer=cc.rendererCanvas,this._renderContext=cc._renderContext=new cc.CanvasContextWrapper(e.getContext("2d")),cc._drawingUtil=cc.DrawingPrimitiveCanvas?new cc.DrawingPrimitiveCanvas(this._renderContext):null);cc._gameDiv=f;cc.game.canvas.oncontextmenu=function(){if(!cc._isContextMenuEnable)return!1};this.dispatchEvent(this.EVENT_RENDERER_INITED,!0);this._rendererInitialized=!0}},_initEvents:function(){var a= window,b,c;this._eventHide=this._eventHide||new cc.EventCustom(this.EVENT_HIDE);this._eventHide.setUserData(this);this._eventShow=this._eventShow||new cc.EventCustom(this.EVENT_SHOW);this._eventShow.setUserData(this);this.config[this.CONFIG_KEY.registerSystemEvent]&&cc.inputManager.registerSystemEvent(this.canvas);cc.isUndefined(document.hidden)?cc.isUndefined(document.mozHidden)?cc.isUndefined(document.msHidden)?cc.isUndefined(document.webkitHidden)||(b="webkitHidden",c="webkitvisibilitychange"): (b="msHidden",c="msvisibilitychange"):(b="mozHidden",c="mozvisibilitychange"):(b="hidden",c="visibilitychange");var d=function(){},e=function(){};b?document.addEventListener(c,function(){},!1):(a.addEventListener("blur",d,!1),a.addEventListener("focus",e,!1));-1b.DEBUG_MODE_ERROR?(c=cc._logToWebPage.bind(cc),cc.error=function(){c("ERROR : "+cc.formatStr.apply(cc,arguments))},cc.assert=function(a,b){if(!a&&b){for(var f=2;fc;c++)for(var d=0;256>d;d++)b[String.fromCharCode(c+256*d)]=String.fromCharCode(c)+String.fromCharCode(d);c=IEBinaryToArray_ByteStr(a);a=IEBinaryToArray_ByteStr_Last(a);return c.replace(/[\s\S]/g,function(a){return b[a]})+a}};cc=cc||{};cc._loadingImage="data:image/gif;base64,R0lGODlhEAAQALMNAD8/P7+/vyoqKlVVVX9/fxUVFUBAQGBgYMDAwC8vL5CQkP///wAAAP///wAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFAAANACwAAAAAEAAQAAAEO5DJSau9OOvNex0IMnDIsiCkiW6g6BmKYlBFkhSUEgQKlQCARG6nEBwOgl+QApMdCIRD7YZ5RjlGpCUCACH5BAUAAA0ALAAAAgAOAA4AAAQ6kLGB0JA4M7QW0hrngRllkYyhKAYqKUGguAws0ypLS8JxCLQDgXAIDg+FRKIA6v0SAECCBpXSkstMBAAh+QQFAAANACwAAAAACgAQAAAEOJDJORAac6K1kDSKYmydpASBUl0mqmRfaGTCcQgwcxDEke+9XO2WkxQSiUIuAQAkls0n7JgsWq8RACH5BAUAAA0ALAAAAAAOAA4AAAQ6kMlplDIzTxWC0oxwHALnDQgySAdBHNWFLAvCukc215JIZihVIZEogDIJACBxnCSXTcmwGK1ar1hrBAAh+QQFAAANACwAAAAAEAAKAAAEN5DJKc4RM+tDyNFTkSQF5xmKYmQJACTVpQSBwrpJNteZSGYoFWjIGCAQA2IGsVgglBOmEyoxIiMAIfkEBQAADQAsAgAAAA4ADgAABDmQSVZSKjPPBEDSGucJxyGA1XUQxAFma/tOpDlnhqIYN6MEAUXvF+zldrMBAjHoIRYLhBMqvSmZkggAIfkEBQAADQAsBgAAAAoAEAAABDeQyUmrnSWlYhMASfeFVbZdjHAcgnUQxOHCcqWylKEohqUEAYVkgEAMfkEJYrFA6HhKJsJCNFoiACH5BAUAAA0ALAIAAgAOAA4AAAQ3kMlJq704611SKloCAEk4lln3DQgyUMJxCBKyLAh1EMRR3wiDQmHY9SQslyIQUMRmlmVTIyRaIgA7"; cc._fpsImage="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAAgCAYAAAD9qabkAAAKQ2lDQ1BJQ0MgcHJvZmlsZQAAeNqdU3dYk/cWPt/3ZQ9WQtjwsZdsgQAiI6wIyBBZohCSAGGEEBJAxYWIClYUFRGcSFXEgtUKSJ2I4qAouGdBiohai1VcOO4f3Ke1fXrv7e371/u855zn/M55zw+AERImkeaiagA5UoU8Otgfj09IxMm9gAIVSOAEIBDmy8JnBcUAAPADeXh+dLA//AGvbwACAHDVLiQSx+H/g7pQJlcAIJEA4CIS5wsBkFIAyC5UyBQAyBgAsFOzZAoAlAAAbHl8QiIAqg0A7PRJPgUA2KmT3BcA2KIcqQgAjQEAmShHJAJAuwBgVYFSLALAwgCgrEAiLgTArgGAWbYyRwKAvQUAdo5YkA9AYACAmUIszAAgOAIAQx4TzQMgTAOgMNK/4KlfcIW4SAEAwMuVzZdL0jMUuJXQGnfy8ODiIeLCbLFCYRcpEGYJ5CKcl5sjE0jnA0zODAAAGvnRwf44P5Dn5uTh5mbnbO/0xaL+a/BvIj4h8d/+vIwCBAAQTs/v2l/l5dYDcMcBsHW/a6lbANpWAGjf+V0z2wmgWgrQevmLeTj8QB6eoVDIPB0cCgsL7SViob0w44s+/zPhb+CLfvb8QB7+23rwAHGaQJmtwKOD/XFhbnauUo7nywRCMW735yP+x4V//Y4p0eI0sVwsFYrxWIm4UCJNx3m5UpFEIcmV4hLpfzLxH5b9CZN3DQCshk/ATrYHtctswH7uAQKLDljSdgBAfvMtjBoLkQAQZzQyefcAAJO/+Y9AKwEAzZek4wAAvOgYXKiUF0zGCAAARKCBKrBBBwzBFKzADpzBHbzAFwJhBkRADCTAPBBCBuSAHAqhGJZBGVTAOtgEtbADGqARmuEQtMExOA3n4BJcgetwFwZgGJ7CGLyGCQRByAgTYSE6iBFijtgizggXmY4EImFINJKApCDpiBRRIsXIcqQCqUJqkV1II/ItchQ5jVxA+pDbyCAyivyKvEcxlIGyUQPUAnVAuagfGorGoHPRdDQPXYCWomvRGrQePYC2oqfRS+h1dAB9io5jgNExDmaM2WFcjIdFYIlYGibHFmPlWDVWjzVjHVg3dhUbwJ5h7wgkAouAE+wIXoQQwmyCkJBHWExYQ6gl7CO0EroIVwmDhDHCJyKTqE+0JXoS+cR4YjqxkFhGrCbuIR4hniVeJw4TX5NIJA7JkuROCiElkDJJC0lrSNtILaRTpD7SEGmcTCbrkG3J3uQIsoCsIJeRt5APkE+S+8nD5LcUOsWI4kwJoiRSpJQSSjVlP+UEpZ8yQpmgqlHNqZ7UCKqIOp9aSW2gdlAvU4epEzR1miXNmxZDy6Qto9XQmmlnafdoL+l0ugndgx5Fl9CX0mvoB+nn6YP0dwwNhg2Dx0hiKBlrGXsZpxi3GS+ZTKYF05eZyFQw1zIbmWeYD5hvVVgq9ip8FZHKEpU6lVaVfpXnqlRVc1U/1XmqC1SrVQ+rXlZ9pkZVs1DjqQnUFqvVqR1Vu6k2rs5Sd1KPUM9RX6O+X/2C+mMNsoaFRqCGSKNUY7fGGY0hFsYyZfFYQtZyVgPrLGuYTWJbsvnsTHYF+xt2L3tMU0NzqmasZpFmneZxzQEOxrHg8DnZnErOIc4NznstAy0/LbHWaq1mrX6tN9p62r7aYu1y7Rbt69rvdXCdQJ0snfU6bTr3dQm6NrpRuoW623XP6j7TY+t56Qn1yvUO6d3RR/Vt9KP1F+rv1u/RHzcwNAg2kBlsMThj8MyQY+hrmGm40fCE4agRy2i6kcRoo9FJoye4Ju6HZ+M1eBc+ZqxvHGKsNN5l3Gs8YWJpMtukxKTF5L4pzZRrmma60bTTdMzMyCzcrNisyeyOOdWca55hvtm82/yNhaVFnMVKizaLx5balnzLBZZNlvesmFY+VnlW9VbXrEnWXOss623WV2xQG1ebDJs6m8u2qK2brcR2m23fFOIUjynSKfVTbtox7PzsCuya7AbtOfZh9iX2bfbPHcwcEh3WO3Q7fHJ0dcx2bHC866ThNMOpxKnD6VdnG2ehc53zNRemS5DLEpd2lxdTbaeKp26fesuV5RruutK10/Wjm7ub3K3ZbdTdzD3Ffav7TS6bG8ldwz3vQfTw91jicczjnaebp8LzkOcvXnZeWV77vR5Ps5wmntYwbcjbxFvgvct7YDo+PWX6zukDPsY+Ap96n4e+pr4i3z2+I37Wfpl+B/ye+zv6y/2P+L/hefIW8U4FYAHBAeUBvYEagbMDawMfBJkEpQc1BY0FuwYvDD4VQgwJDVkfcpNvwBfyG/ljM9xnLJrRFcoInRVaG/owzCZMHtYRjobPCN8Qfm+m+UzpzLYIiOBHbIi4H2kZmRf5fRQpKjKqLupRtFN0cXT3LNas5Fn7Z72O8Y+pjLk722q2cnZnrGpsUmxj7Ju4gLiquIF4h/hF8ZcSdBMkCe2J5MTYxD2J43MC52yaM5zkmlSWdGOu5dyiuRfm6c7Lnnc8WTVZkHw4hZgSl7I/5YMgQlAvGE/lp25NHRPyhJuFT0W+oo2iUbG3uEo8kuadVpX2ON07fUP6aIZPRnXGMwlPUit5kRmSuSPzTVZE1t6sz9lx2S05lJyUnKNSDWmWtCvXMLcot09mKyuTDeR55m3KG5OHyvfkI/lz89sVbIVM0aO0Uq5QDhZML6greFsYW3i4SL1IWtQz32b+6vkjC4IWfL2QsFC4sLPYuHhZ8eAiv0W7FiOLUxd3LjFdUrpkeGnw0n3LaMuylv1Q4lhSVfJqedzyjlKD0qWlQyuCVzSVqZTJy26u9Fq5YxVhlWRV72qX1VtWfyoXlV+scKyorviwRrjm4ldOX9V89Xlt2treSrfK7etI66Trbqz3Wb+vSr1qQdXQhvANrRvxjeUbX21K3nShemr1js20zcrNAzVhNe1bzLas2/KhNqP2ep1/XctW/a2rt77ZJtrWv913e/MOgx0VO97vlOy8tSt4V2u9RX31btLugt2PGmIbur/mft24R3dPxZ6Pe6V7B/ZF7+tqdG9s3K+/v7IJbVI2jR5IOnDlm4Bv2pvtmne1cFoqDsJB5cEn36Z8e+NQ6KHOw9zDzd+Zf7f1COtIeSvSOr91rC2jbaA9ob3v6IyjnR1eHUe+t/9+7zHjY3XHNY9XnqCdKD3x+eSCk+OnZKeenU4/PdSZ3Hn3TPyZa11RXb1nQ8+ePxd07ky3X/fJ897nj13wvHD0Ivdi2yW3S609rj1HfnD94UivW2/rZffL7Vc8rnT0Tes70e/Tf/pqwNVz1/jXLl2feb3vxuwbt24m3Ry4Jbr1+Hb27Rd3Cu5M3F16j3iv/L7a/eoH+g/qf7T+sWXAbeD4YMBgz8NZD+8OCYee/pT/04fh0kfMR9UjRiONj50fHxsNGr3yZM6T4aeypxPPyn5W/3nrc6vn3/3i+0vPWPzY8Av5i8+/rnmp83Lvq6mvOscjxx+8znk98ab8rc7bfe+477rfx70fmSj8QP5Q89H6Y8en0E/3Pud8/vwv94Tz+4A5JREAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfcAgcQLxxUBNp/AAAQZ0lEQVR42u2be3QVVZbGv1N17829eRLyIKAEOiISEtPhJTJAYuyBDmhWjAEx4iAGBhxA4wABbVAMWUAeykMCM+HRTcBRWkNH2l5moS0LCCrQTkYeQWBQSCAIgYRXEpKbW/XNH5zS4noR7faPEeu31l0h4dSpvc+t/Z199jkFWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhY/H9D/MR9qfKnLj/00U71aqfJn9+HCkCR/Wk36ddsgyJ/1wF4fkDfqqm9/gPsUeTnVr6a2xlQfnxdI7zs0W7irzD17Ytb2WT7EeNv/r4ox1O3Quf2QP2pgt9utwfout4FQE8AVBSlnaRmfvAURQkg2RlAbwB9AThlW5L0GaiKojhJhgOIBqDa7XaPrusdPtr5kQwF0BVAAoBIABRCKDd5aFUhRDAAw57eAOwAhKIoupft3zoqhB1AqLwuHIBut9uFt02qqvqRDJR2dAEQJj/BAOjn56dqmma+xiaECAEQAWAggLsB6A6HQ2iaZggBhBAqgEAAnQB0kzaEmT4hAITT6VQ8Ho/HJAKKECJQtr8LwD1y/A1/vcdfEUIEyfZ9AcQbYvZ942Px88L2UwlJR0dH0EMPPbRj5syZPUeNGrXR7Xb/641xIwJ1XY9NSUlZm52dfW+XLl1w8uRJzJ8//+OGhoYJqqqe1TSt1Wsm9NN1PSIqKmr12rVrR5WUlHy1bdu2AQCumWc3IYRD1/UwVVXnFRQUTIuNjUVzczN2797dWFJSkq8oymZd15sAGAEnFEUJ1nX9nzIzM1dnZmZGh4SE4OTJk5g5c+Zf29vbp9pstrMej6fVOyhIhgAYU1hY+B+hoaGoqKg4XVlZea+XTULTNFdCQsLGiRMnPuR2u3UhBOV9eeDAAWXTpk095DUe6WsoyRE5OTlr0tLSAux2O/bs2cO5c+e+pijKUpIXSHaQVAGkvPLKK++6XK4OksJLCFlXV2cvKSlJBFAjhU+x2WwhHo9nUHp6+urMzMy7wsLCUF9fjxdffPHjxsbGiTab7WuPx9NiEutOuq4PyMjI+M+srKyYqKgoHD58GDNmzNjq8XhyVFU9b/q+LH7hBAEYu3PnTlZVVRFAGgCX6f/tAHoOHDjwa0p27txp/JO9e/f+QM7cipw9nfL3kQBKt2zZQpJ87rnn6mQmoHilw2EACs+cOUOSrK+vZ1NTE0nyo48+IoBpxswoBcMJ4Ndjx471kOTFixe5d+9ekqTH42H//v13A4jyzpAURfEH0H/OnDnthu1z5sw558MmFUCPWbNmnaMP3nrrLZoyDmP8Hl68eDFJ8siRI9/Yc+zYMQKYKdtAztrTrl27xptRXV1NAKMAOAyBBBA/Y8aMdpLs6Ojgxx9//E37+++//29yvFXppwvAwMcee8xjtDHsuXLlCqOjo//ia3wsfpkoALqFhoZuIckJEyackimm3dQmEMDUmpoakmRISMhhAHOHDx/eQJIbN24kgKEyMAHAFRMTs2XXrl1saWkhSZ0kp0+ffhrAr3wEW/S8efOukORLL72kA1gKYMPWrVtJkk899dRJAHeYrgsEsIQkjx8/TgDvAPjd448/3kaSb7zxBmUa7vC6z53BwcFbSHL9+vU6Sc6aNes8gF5ewWAH0PfVV18lSQL4DMBGIcQ6AKtcLleBFC2jXtFt8ODBe0iyoqKCAJYByC8qKmJDQwOzsrK+MAmqo1OnTveHhoa+GRkZ+XZkZOSWiIiIvzgcjk9mzpypkWRmZuZpmbYbGV4AgPnNzc1sa2sjgN0A5iQmJtaSZHl5OQHcb/K3s81mW0uSTU1NBFAFYFbfvn1Pk+Tbb79NAA8IIVzW42/hByA+Pz/fLR/2ZXIda05NI/z9/TeR5J49ewhgqlxTrtI0jY2NjQQw3zTLuWJiYjaUlJToS5Ys6fjkk080kwDEeAmADcA9GzZsIElGRUW9CyAWwLApU6Y0kOSKFSsog9QICGdERMTGsrIyZmVlEcC9AB4IDw/fTpLbtm0jgN94CUAnAJmVlZVcs2aNZ/LkyRdJcvbs2b4EwAkgZfPmzTxw4AABFAN4BkC6vFeUSewcAO5duXIlSTIhIaEawGMAxgKYAmAGgCS73e5vrKVk/yGythANYEhCQsIhkly+fDkBpKqqGmL6DgIALDKN/3yZpVWQZGVlJQE8aPI3KiMjo5okV61aRQAjAPQBMPfIkSN0u90EUCBtsPiFEwpgbn19PdetW2fM5N4zQ9ekpKQqkty0aRMBpMjiWM6JEydIkoqirJUFJ6iq6pAPVy8A6cZMehMBUACEuVyuFwG8HBwcPEIWx367ZMkSjSQXLVrUJouTRorrkAHdA8BdQogsAOsKCwtJkmPGjDkvMw2bDDo/ADEjRoz4XylyFbm5uY0mAbjLyyZ/AOOrq6tZVlbWsWDBgo69e/eyoqKCgwcPPg4gSQaoIRbp27dvN7KF+tLSUr28vJwFBQXtMpvpYRIM7+wrAkDeqVOnePbsWQIoNKfzpiXPg8uXLydJJicnNwF4f+nSpW6STEtLq5fjYwhk1wkTJtSQ5Ouvv04AqTKj+N2xY8dIkgEBAW/Ie1v8wncRegwZMmQvSfbr12+3Ua33WqPfOWbMmP0kWVpaSgCDZAqcfejQIWNZsEGKgvnh9gfQb9myZd8nAEJVVZtMkUNk8CcNHTq0liR1XWdYWNhmH1mJIme80OnTp18x1rp5eXkEsNJms92Fb7e/IgEsvHz5Mp999tkmAI/l5uZeMC0B7vEqqAYAyL106RJJsra2lpWVld+sucePH38ZQG+5NncBeOrgwYMkqbe3t/Po0aOsra011wAWyl0H7x0JJ4DE+fPnu0kyPT29DsDdUrBuyNKEEAkAdpw/f/6GeoEM8GUmfwEgPCIiopwkGxsbabPZPgOw6L777vvm4p49e26VGYjFLxUhhD+ApLKyMp44ccIoVnXybgbgzkcfffRzklyzZg0BDJYCMMmoCwQFBXkLgLGWvvcWAgBToSsKwNPTp09vMR7UuLi4rwH0lgU8c/Db5ezbeeTIkRWzZ8++aMxu+fn5BPCADBwHgP4LFy701NXVEUAJgAnPP/98kyxMNgHo53A4zH77BQQETMvPz7+Um5vbBuAlAFMSExPPmdbVL0qh8Acw8fDhw5SCchVAEYAVb775JknyhRdeaJYztHfxMwLAaqNwCGC2FArv8x0hAHKNLGPKlCme5OTk/Zs3bzb7O0wKiiG8KXl5ed8IxenTp0mSR48e1UmyW7duWywBuD2xyQcgFECgoih+8H1gyJgZV5Lkyy+/3CbTRIePtl2HDBmyw1QBHyGDdXZdXR1JUghRKkXBjOMHCoBdpr0L3nvvPZLkF198wejo6O0A4lVVDTb74HQ6AwD8Wq7Jh8rgGgDgQ13XjVR8qaxJuADMbmlpYXl5uV5UVNRWUFDgfv/993Vj/ZydnU1c37eHXML4S3viAcQqitJD2l104cIFY8lTKsXSBWBMVVWVcd9yed2A1NTUQ6Zl00CvLMMOoHdubm6zFIlWOf5+PsY/Kj09vdrU11QAwwGsv3jxIk21m2DZr10I0RXAuAcffPBgaWkpV69eTYfDcdiwUxY0w6xw+flX8L1xApjevXv3lREREaW6rofB93aPDUDQpEmTMgHgtddeqwBwEd/utZvpqK6uPgEAcXFxkA94NwB9unfvjrNnz4LklwDcf08iIqv66Zs2bXrl4YcfxooVKxAbG7uqrq5uAYA2TdOEqqpGYIi2tjbl6aeffu/YsWPv5uTk7JaC1wHg4Pnz542MwoVvTx+21dbWYvjw4WLixIl+2dnZ9lGjRgmSTE1NRUpKCkwFTGiaxtTU1OXTpk3707Bhw/6g67pDipnT4biuj7qut+Lbk3Vf1tTUXI9qu91Pjq1QFEUBgJaWFgBo8yGOQ8eNGxcAAOvXr/8QwBUfYygAKL169eoCABcuXACAWtn2hOGv0+kMNO1KiPDw8F4A4rZv3/7R1KlTR0+bNu1ht9u9r1+/fqitrQXJgwDarRC6/QjPzs4+QJIffPCB9/aQmSAA43ft2mW0e1QGoi8CAPyLsZccExNTC2BlRkbGRdOyYJCP2csBIN6UAZzCd7cBbQCijYp/dXU1ExMTz6SmptaMHj36f9LS0vYlJCRsl6mxIWSdu3fv/g5J7t+/nwC2AShMTk6+SJKff/45AWRLYbD7+fndAeDf5BJnLoCCyZMnt5JkdnZ2C4B/F0KEm1Pu+Pj4rST55ZdfEsBWAK+mpaVdMo3raDn7KwDuSEpK+m+S3LBhAwG8DuCtHTt2UBbpjgC408vvcFVV15HkuXPnjMp+p5uMf0RcXNyHJNnQ0EBVVfcCWBQXF3fG+Jv0yxABPwB5LS0tRmFxN4BlTzzxxGWSXLx4sS5F3GGFy+1Hp5SUlJq6ujoWFxdTpsZ2H+0iIyMj/0iSWVlZX5mr5jfJFroPGzasxlhTnjp1iiTZ3NxMl8tlrCd9pfa9SkpKSJI5OTmnZOageLUZZqxvfVFWVkZcPwdgNwnSCKPqb17jkmR8fPzfZMDZ5CRsFBmNI7h95s2b1yhT7/MAYmStwCx4vy0uLqa3v5qmEcCfvSr1QQAeXb16NY3Cm3HQ55133iGAp+SxZTNhKSkpfzUddkrFjYevzAQCeGjp0qXfsYckY2NjTwD4leGDLCL2HTdunNtoY+zWSHFcIHdsFCtcfuZ1vO9Eqs3m7/F47sb1k2qX/f3997W2tl7BjWfpBYDOzzzzzIVJkyZh0KBBCwEsB3AJvl9AETabLcDj8dwRFRW1ctasWb8JCgpSzp07d62wsPC/Wltb8xRFadR1/ZqPXYbgAQMGbI2Pjw/+6quv9ldVVT0r01ezuPRJSUn5Y9euXXVd11WzDaqq6kePHm3+7LPPRgO4KlNuxWazhXo8nuTk5OSXMjIyEl0uFxoaGtqKior+dPXq1VdUVT0jj7r68ieoT58+vx8yZMjdx48fP1JVVTVF9m20VW02WyfZf97YsWPjXS4X6urqWvPy8jYCWCyEuEDS8FdVFKWzruv//OSTTy5OTk7uqWkaPv3007qysrJ8RVH+LI8ym8/rB3Tu3HnRI488knLo0KG2ffv2ZQI4C98vP6mqqoZqmpaclpa2cOTIkX39/f3R0NDQUVxc/G5TU9PLqqrWa5rWLH1QVFUN0TStX1JSUvH48eP7BwYG4uDBg1cKCgpeBbBe2u+2Qug2EwD5N5sMPuNtMe8XP4TT6Qxoa2sbIGeXvUKIK7d4IISiKC5d1wPljOfA9bPwzYqiXNV13dd6Uqiq6qdpml2mpe02m63d4/G4vcTF5fF47LJf71nJA6BZVVW3pmntuPHlmAD5wk6Q9NnbHp9vHaqq6tA0zU/64PZhk1FfCZB9G/23ALiqKEqzD39tpvbGUqoFwFUhRLP3yzpCCDtJpxyXDulfG27+pqRR3DXsUWVd4Yq0x/taVQjhIhksC8L+ABpM9ljBf5sKwI8pIBr75L5E4vvu+UNeG/a+hv+AL7yFH8qPtOfHjtOP6V/Bja8D6z/B2Nys/1u9Xv33tLf4GfF/LC4GCJwByWIAAAAASUVORK5CYII\x3d"; cc._loaderImage="data:image/jpeg;base64,/9j/4QAYRXhpZgAASUkqAAgAAAAAAAAAAAAAAP/sABFEdWNreQABAAQAAAAlAAD/4QMpaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLwA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/PiA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjAtYzA2MCA2MS4xMzQ3NzcsIDIwMTAvMDIvMTItMTc6MzI6MDAgICAgICAgICI+IDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+IDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjM4MDBEMDY2QTU1MjExRTFBQTAzQjEzMUNFNzMxRkQwIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjM4MDBEMDY1QTU1MjExRTFBQTAzQjEzMUNFNzMxRkQwIiB4bXA6Q3JlYXRvclRvb2w9IkFkb2JlIFBob3Rvc2hvcCBDUzUgV2luZG93cyI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkU2RTk0OEM4OERCNDExRTE5NEUyRkE3M0M3QkE1NTlEIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkU2RTk0OEM5OERCNDExRTE5NEUyRkE3M0M3QkE1NTlEIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+/+4ADkFkb2JlAGTAAAAAAf/bAIQADQkJCQoJDQoKDRMMCwwTFhENDREWGhUVFhUVGhkUFhUVFhQZGR0fIB8dGScnKionJzk4ODg5QEBAQEBAQEBAQAEODAwOEA4RDw8RFA4RDhQVERISERUfFRUXFRUfKB0ZGRkZHSgjJiAgICYjLCwoKCwsNzc1NzdAQEBAQEBAQEBA/8AAEQgAyACgAwEiAAIRAQMRAf/EALAAAAEFAQEAAAAAAAAAAAAAAAQAAgMFBgcBAQEAAwEBAAAAAAAAAAAAAAAAAQMEAgUQAAIBAgIEBwoLBgQGAwAAAAECAwAEEQUhMRIGQVFxsTITFGGBwdEiQlKSMzWRoeFicqKyI1NzFYJjJDQWB9KjVCbxwkNkJWXik3QRAAIBAgMFBQcDBQEAAAAAAAABAhEDIRIEMUFRcTJhwVIUBZGhsSJyEzOB0ULhYpIjUxX/2gAMAwEAAhEDEQA/AMJSpUqAVKlXuFAeUq9wpUB5XuFe4V6ooDzZHDox0CnGMinzwl7Z8NajaHeoO3vmTBZBtp9YUIqTEV5ROxHKnWRnaU8VRMhFBUjpV7hSoSeUq9pUB5Sr2lhQHlKvcK8oBV7hSFSRrtaKAZs07YNPM1pG2xJIAw1jSeandry/8X4m8VCKkWwaWwam7Xl/4v1W8VLtmX/i/VbxUoKkWwakSM407tmX/i/VbxUmzGwjQsjdY41IARie/U0IbZO0kNtCXnOCkEBeFu4KI3Bs7DNb27ya+jDx3kJeEnpJJEcQVbWDsk17u5urd591ucZkWhym2Vnd9RkCDEpFxDRpbw0bunu5mlp2De2FMLYXOD2wB2xbOeraUcYGJ72mlSUiqzzdzMd3Z3mixltA2yzcK/NlHM1DQyRXce1HocdNOEfJXZ88y9ZojOqhiBszIRiHQ8Y4cK5TvHuzLljHNMqxNoDjLFraHHnjPxcNCGVbxEUzYNTx5jZSxhpW6qTzlwJ+DCvO2Zf+L9VvFSgqyHYNLYNTdssPxfibxUu15f8Ai/VPiqCakOwa82DU/a8v/F+JvFTDdWPBL8R8VKCvYRYV5UzoMAy6QdIIqI0B4KJtxiRQwou16QoGUkntH5Tz0RbZbmF2hktraSVBo2lUkY8tDye0flPPXTslVUyiyVRsjqUOA4yMT8dW2ram2m6UVTNq9S7EIyUVJydMTn/6DnP+im9Wl+g5z/opvVrpteEhQWY4AaSTwAVf5WPiZh/9S5/zj7zltzlmYWkfWXNvJDGTgGcYDHirR7i7mSbwXParsFMrgb7w6jKw/wCmnc9I14kF3vpvCljbMyWMOJL4aEiB8qU/ObUK7HYWVrl1pFZWiCOCBQqKOLjPGTrNZZqKbUXVHq2nNwTuJRk1VpbgXN8s7Rk5ym0UQQzhIG2NAjhxHWbI+gCBVjBBFbwxwQqEiiUJGg1BVGAFe7dV28WYLYZFmF2Th1UD7JGjymGyn1iK5OyzIBGB1HgrLZhamzumQAGJwSqnSCh1q3GOCodxt4cxurdcpzuN4cyhiWaF5Bg09udUmnWw1H/jV9nFuJ7Quo+8h8peThFA+047vduyMtk7fYqTl07YFdfUufMPzT5p71UdtlmYXaGS2t3mQHAsgxANdadYJopLe4QS2867EsZ4QfCNYrCFbjdDPmgkYyWFxgVf04ifJf6ScNdRUW1XBb6FU5TjF5EpSSrGu/s5lN+g5z/opvVpfoOc/wCim9WtdHnatvObJXDW7xLGhB8nrPaY9/HCr+tEdPCVaSeDoYLnqF63lzW4/PFSW3ecxbI84VSzWUwUaSdg0DXXK5nvAipnd6qgKvWnQO7pri9ZUEmm3Vl2j1kr8pRlFRyquBNZjGxQ/S56Y1S2fu9OVueon11Szahoou06QoQUXadIVCD2FJJ7R+U89dMydv8Axdn+TH9muZye0flPPXQstlK5Tbka1gUjlC1q0vVLkeb6r+O3Tx9xcY1nt8c0NrZCyiOE1108NYjGv1joo7Js1jzKyScYLIvkzL6LDwHXVJksH9Sb49dKNq0tj1jA6uriOCL+02FWX7iVtZX1/AzaHTyeoauKn2MX9W79zebiZCuR5MjSrhfXuEtwTrUeZH+yNfdrRNcxI6IzhXlJEak6WIGJ2Rw4ChWnChndtlVBLMdQA0k1gbXNMzzDfDLs6mjaPKppJbWwJ1bOwwxw43OnHh71YT3DpfWUJmFlb5jHHDdeXBHIsrRea5TSqvxqG04cNN62vetoCS4tre5mgnkGE9q+3DKOkuI2WX6LDQRRHWDh1UCtwj7QRg2wdl8Djgw1qe7XvW0BQ3kfZ7mSLgU+T9E6RVbnuVrnWVSWqj+Lt8ZbRuHEdKPkYVcZ2MJY5fSGyeVar45+rkWQHAqccalPE5km1htWK5nK4Wnt5FuUBUwOMG4nGkA/BXUrW4S6torlOjMgcd/xVn7rLo7zKs0uEjCNeSvdwoBhgsZxX1l2j36k3Lu+uyprdj5Vs5A+i/lD48a0aaVJOPi7jB6lbzWozpjB48pf1NDXNN4vfl7+Z4BXS65pvF78vfzPAK71XTHmZ/S/yT+jvJ7L3fHytz1E+upbL+Qj5W56jfXWRnsIYKLtekKEFGWvSFQgyjk9o/Keet3YthlMP/5x9msJJ7R+U89biyb/AMXEv7gD6tadL1T+kwepRrC39ZkLDMbiwMvUHRPG0bjlGg8ore/23sxBldxfMPLupNhT8yL/AORNZbdzJ484scytxgLqJY5LZj6Q2sV5G1Vud1mjjyG0ij0NEGSZToKyhjtqw4waztuiXA3qKTbSxltfGhbZlE95ZtZqxVbgiOZhrER9ph3Svk9+pJILZ4Y4DGBFCUMKjRsGPobPFhUfW0NJmljE2xJcIrcI2vFUEln1lRXd6lrazXT9GCNpD+yNqoI7mOVduNw6nzlOIoPOUa6yye1XXcbMR5GdQ3xY0BSbj31/FcTQZirJ+q431q7anbHCTZ72Bw7lbPrKBMcBWNNgbMBBh+bsjBdni0VJ1lARZs6yWiupxCuMDy6KpS2IwOo6DTr3Mre3e5tZZVUM4ZBjqOOJoWO4jkXajcOOMHGgDISvWIrdAkKR80+TzVl908bPPL3LzxOuHdifxVfiTAg92qI/w+/8gGgSyN/mR7XPVlp0lF/3L3mbVKtu5Hjbk/8AHE2Fc03i9+Xv5ngFdKNc13i9+Xv5ngFaNV0x5nn+l/kn9HeEWXu+PlbnqJ9dS2Xu9OVueon11kZ7CGCjLXpCgxRlr0hUIPYUcntH5Tz1s8vb+Bt1/dqPirGSe0flPPWusG/g4Py15q06XqlyMWvVYQ+ruI9xJOqzO9hOto/sP8tbGOFIrmWeM7IuMDMnAXXQJOUjQeOsJk0nY96ip0CYunrjaHx1t+srPJUbXBm2LrFPikwTOb+T+VhbZxGMrDXp83x1QSy2tucJpUjPETp+Cn5/ftaRvKvtp3Kx48HG3erHMzOxZiWZtLMdJNQSbbL71Vk6yynViOkqnEEfOWtPbXi3EQkGg6mXiNckjeSJxJGxR10qw0GtxuxmvbImD4CZMFlA4fRfv0BqesqqzTMZNMEDbIHtHH2QeCiZJSqMQdOGiue53mz3czQwsRbIcNHnkec3c4qAMuriz68gTIToxwOOnlp0MjxMJYW741Gs3RVldtbygE/dMcHX/moDaxTiWNZB53B3arb8/wC+4SOF4sf/AKxU9kcBsfOGHfoUHtG/RbzY5Die5HHhXdvavqiZ9Q8Jdlq4/gbKua7xe/L38zwCuhpf2Uk/Zo50kmwJKIdogDjw1VzzeL35e/meAVp1LTgqY4nn+mRauzqmqwrjzCLL3fHytz1E+upLL+Qj5W56jfXWRnroYKLtekKEFF2vSFQg9hSSe0flPPWosm/hIfoLzVl5PaPynnrRWb/w0X0F5q06XqlyM2sVYx5gmbFre/t71NY2T+0h8VbSO5SWNJUOKSAMp7jDGspmMPaLRlXS6eWve1/FRO7WYdbZm1Y/eW/R7qHxHRXGojlm3ulid6aVbaW+OALvgCLq2Hm9WxHKWqjhj6xsK1e8dm15l4niG1LZkswGsxtrPeOmsvayBJA1VItlWjptLuTdPMo7LtjRDq9naK4+WF9IrUW7BaHOljGqVHB7w2hzVoZt87d8vaNYSLl02CcRsDEbJbj71Uu7UBkvJ7/D7q2QoDxySaAO8MTXdxRVMpRp5XZOWdF/ms7R5XdyKfKWJsO/5PhrG5XlNxmEywW6bTnTxAAcJNbGSMXkM1pjgbiNo1PziPJ+Os7u7m/6ReM00ZOgxSpqYYHT3wRXMKN4ll9zUG4bQfNshu8sZVuEA2hirA4qe/VOwwrVbzbww5mI44UKRRYkbWG0S3JWctbd7u5WFfOOLHiUdJqmaipfLsIsObhWe001lMkMVvJNjhghIALMcBxCs7fxXQmkupx1bXDswGPlaTidVaEyKNXkoo4eBV+Sq7L7Vs9zcBgeyQ4GQ/MB1crmoim2orezqcowTuSeEY48jQ7oZX2PLzdyLhNd6RjrEY6I7+uspvH78vfzPAK6UAAAFGAGgAcArmu8Xvy9/M8ArTfio24RW5nnaG67uou3H/KPuqT2X8hHytz1G+upLL3enK3PUb66ys9RDBRdr0hQgou06QqEGUkntH5Tz1e238vF9BeaqKT2j8p56vbb+Xi+gvNWjTdUuRn1XTHmTh8KrJTJlt8t1CPIY44cGnpJVjTJYkmjaN9Ib4u7V923njTethRauZJV3PaW1rfLIiXEDYg6R4VYc9CXW7thfOZbKdbGZtLW8uPVY/u3GrkNUkM9zlcxUjbhfWOA90cRq4gv4LhdqN+VToNYWmnRm9NNVWNTyHc6VWBv8wt4YeHqm6xyPmroq1Z7WGFLSxTq7WLSuPSdjrkfumq5yHXDUeA92oO2SKpVumNAaoJLMXH3myp0rpJ4uKhc3tbDM5BMri1zAj79j7KTiY8TcdBpcsith0286o+sPCagEX9Pzg4zXUCp6QYse8oouCG3tk6m1BYv05W6T+IdyolxbHDAAa2OgDlNCz3ryN2WxBd5PJMg1t81eId2ukqnLlTBbfcuY+9uJLiRcvtPvHdsHK+cfRHcHDWsyawjyy0WBcDI3lTP6TeIcFV+S5OmXx9bJg1048o8Cj0V8Jq2DVu09nL80up7OxHi+oal3P8AXB/IsZS8T/YOV65zvCcc7vfzPAK3ivWCz445zeH954BXOr6I8yfSfyz+jvCLP3fHytz1G+upLP3fHytz1E+usbPaQ0UXadIUIKLtekKhB7Ckk9o/Keer22/l4/oLzVRSe0flPPV7b/y8X0F5q0abqlyM+q6Y8yQsBTDMor1o8aiaE1pbluMqS3sbLLHIhSRQyngqukhaJ9uBjo+H5aOa3ao2t34qouRlLajTalGP8v0IY8ylXQ+PKPFU/bYXOLPge6CKia0LaxTOxHu1Q7cuBd9yPEJ7TbjXKO8CajbMIF6CNIeNvJHjqIWJ7tSpYkalqVblwIdyG+RGXur0hXYJFxal+Dhq5y3slkv3Y2pD0pTr+QUClpJRUdo9XW4OLrTHtM16cZLLWkeC7y4jvlNEpcRtw1Ux27Ci448NZrTFy3nn3IQWxlgGrDZ3pza7/M8ArZo+ArF5171uvp+CqdV0R5l/psUrs2vB3hdl7vTlbnqJ9dS2Xu+PlbnqJ9dY2eshooq16QoQUXa9IVCD2FLJ7RuU89WNtmUSQqkgYMgw0accKrpPaPynnrZWG4Vi+VWmY5tnMWXG+XrIYnA0rhj0mdcTgdNdwnKDqjmduM1SRR/qlr8/4KX6pa8T/BVzDuLZXudRZblmbxXcPUNPc3KqCIwrbOzgrHEnHjoyD+3eSXkht7DeKG4umDGOJVUklfouThXfmbnZ7Cvy1vt9pmv1W1+d8FL9VteJvgq5yrcOGfLmzHN80iyyETPbptAEFo2ZG8pmUa1OFNn3Ky6W/sbDKM5hv5bx2WTZA+7RF2y52WOPJTzE+z2Dy1vt9pT/AKpacTerS/U7Tib1a04/t7kDXPY03jhN0W6sQ7K7W3q2dnrMccaDy/8At80kuZfqWYxWNtlcvUPPhiGYhWDeUy7IwYU8xPs9g8tb7faUn6pacTerTxm9oOBvVq3v9z927aynuId44LiWKNnjhAXF2UYhRg516qpsryjLr21665zFLSTaK9U2GOA87SwqY37knRU+BzOzags0s1Oyr+BKM6sxwP6tSDPLMen6vy0rvdm3Sxlu7K/S7WDDrFUDUTxgnTU826eXW7KlxmqQuwDBXUKcD+1Xee/wXuKX5XDGWLapSVcOyhEM/seJ/V+WnjeGx4pPV+Wkm6kKZlFay3Jlt7iFpYZY8ASVK6DjtDDA0f8A0Tl340/1f8Ndx8xJVWXB0KbktFFpNzdVXAC/qOwA0CQni2flrO3Vwbm5lnI2TKxbDirX/wBE5d+NcfV/wVR7xZPa5U9utvI8nWhmbbw0YEAYYAVxfhfy5rlKR4Fulu6X7mW1mzT8S4Yis/5CPlbnqJ9dSWfu9OVueon11mZvQ2i7XpChKKtekKhBlNJ7R+U89bDfGTb3a3ZX0Lcj6kdY+T2j8p560288m1kWQr6MJ+ylSAr+2cnV5renjs3H1loX+3j9XvbbtxLN9lqW4UnV5jdnjtXHxihtyZNjeSBu5J9k1BJe7xy7W5CJ/wCzuD/mTVTf2+fq97LJuLrPsNRueS7W6aJ/38x+vLVXuY+xvHaNxbf2GoCezf8A36j/APsSf8w1sLnqczTefJluYoLm5uo5F61sBshItP1cNFYe1f8A3ir/APfE/wCZUe9bB94r5jwuPsrQFhmG4l/Z2M17HdW90tuu3IkTHaCjWdIw0VVZdks9/C06yJFEp2dp+E1bbqybGTZ8vpQD7L1XRv8A7blT96Oda7tpNuuNE37Cq9KSisjyuUoxrStKllHbLlWTXsMs8chuSuwEPDqwoLe5y+YRE/gLzmqRekvKKtd4327yM/ulHxmrHJStySWVRyrjxKI2XC/CTlnlPPKTpTdFbP0L1bgrf5Lp0G3dPhQHwV0S1lzBsns3sESR8Crh9WAJGjSOKuU3E+zdZQ3oJh8IArdZXFDmOTpHa3i2+YrI2KtKy4ricBsBuHHgFXSo440+Wa2qqxjvM9uMoy+WvzWpLCWWWE28HxL6e43ojgkeSCBY1Ri5BGIUDT51cl3vm276BBqSEH4WbxV0tlkyXJcxTMb+OW6uY9mGHrCzDQwwAbTp2uKuTZ9N1uYsfRRR8WPhrm419mSSjRyiqxVK7y23B/ftuTm2oSdJyzNVw3BFn7vTlbnqF9dS2fu9OVueon11lZuQ2iLdsGFD05H2dNQGV0ntG5Tz1dWm9N1b2kVq8EVwsI2UaQaQOKhmitZGLOmk68DhSFvY+gfWNSAg7z3Qvo7yKCKIohiaNR5LKxx8qpxvjcqS0VpbxvwOAcRQPZ7D0G9Y0uz2HoH1jUCpLY7zXlpbm3eKO5QuzjrBqZji3x17PvNcyT288VvDBJbMWUovS2hslW7mFQ9nsPQPrGl2ew9A+saCod/WNxtbYsrfb17WBxx5ddD2281xC88klvDcSXEnWuzrqOGGC9zRUPZ7D0G9Y0uzWHoH1jQVCLreq6ntZbaO3it1mGy7RjTs1X2mYy20ZiCq8ZOODcdEdmsPQb1jS7PYegfWNdJuLqnQiSUlRqpFLmryxtH1Ma7Qw2gNNPOdSt0oI27p007s9h6B9Y0uz2HoH1jXX3Z+I4+1b8IJdX89xLHKQFMXQUahpxoiPN5P+onfU+A0/s9h6DesaXZ7D0D6xpG7OLbUtu0StW5JJx2bBsmbtiSiEk+cxoCWWSaVpZOk2vDVo0VYdnsPQb1jSNvZcCH1jSd2c+p1XAmFqEOmOPEfaH+BQd1ueo211IzrgFUYKNAAqI1WztCpUqVCRUqVKgFSpUqAVKlSoBUqVKgFSpUqAVKlSoBUqVKgFSpUqAVKlSoD/9k\x3d";cc=cc||{}; cc.defineGetterSetter=function(a,b,c,d,e,f){if(a.__defineGetter__)c&&a.__defineGetter__(b,c),d&&a.__defineSetter__(b,d);else if(Object.defineProperty){var g={enumerable:!1,configurable:!0};c&&(g.get=c);d&&(g.set=d);Object.defineProperty(a,b,g)}else throw Error("browser does not support getters");if(!e&&!f)for(var g=null!=c,h=void 0!=d,k=Object.getOwnPropertyNames(a),m=0;m=b.x||a.y>=b.y||a.x+a.width<=b.x+b.width||a.y+a.height<=b.y+b.height):!1};cc.rectGetMaxX=function(a){return a.x+a.width};cc.rectGetMidX=function(a){return a.x+a.width/2};cc.rectGetMinX=function(a){return a.x};cc.rectGetMaxY=function(a){return a.y+a.height};cc.rectGetMidY=function(a){return a.y+a.height/2};cc.rectGetMinY=function(a){return a.y}; cc.rectContainsPoint=function(a,b){return b.x>=cc.rectGetMinX(a)&&b.x<=cc.rectGetMaxX(a)&&b.y>=cc.rectGetMinY(a)&&b.y<=cc.rectGetMaxY(a)};cc.rectIntersectsRect=function(a,b){var c=a.y+a.height,d=b.x+b.width,e=b.y+b.height;return!(a.x+a.width>>0)+((b||0)<<16)+((c||0)<<8)+(d||0)};_p=cc.Color.prototype;_p._getR=function(){return(this._val&4278190080)>>>24};_p._setR=function(a){this._val=this._val&16777215|a<<24>>>0};_p._getG=function(){return(this._val&16711680)>>16};_p._setG=function(a){this._val=this._val&4278255615|a<<16};_p._getB=function(){return(this._val&65280)>>8};_p._setB=function(a){this._val=this._val&4294902015|a<<8};_p._getA=function(){return this._val&255}; _p._setA=function(a){this._val=this._val&4294967040|a};cc.defineGetterSetter(_p,"r",_p._getR,_p._setR);cc.defineGetterSetter(_p,"g",_p._getG,_p._setG);cc.defineGetterSetter(_p,"b",_p._getB,_p._setB);cc.defineGetterSetter(_p,"a",_p._getA,_p._setA);cc.color=function(a,b,c,d){return void 0===a?new cc.Color(0,0,0,255):"object"===typeof a?new cc.Color(a.r,a.g,a.b,null==a.a?255:a.a):"string"===typeof a?cc.hexToColor(a):new cc.Color(a,b,c,null==d?255:d)}; cc.colorEqual=function(a,b){return a.r===b.r&&a.g===b.g&&a.b===b.b};cc.Acceleration=function(a,b,c,d){this.x=a||0;this.y=b||0;this.z=c||0;this.timestamp=d||0};cc.Vertex2F=function(a,b,c,d){this._arrayBuffer=c||new ArrayBuffer(cc.Vertex2F.BYTES_PER_ELEMENT);this._offset=d||0;this._view=new Float32Array(this._arrayBuffer,this._offset,2);this._view[0]=a||0;this._view[1]=b||0};cc.Vertex2F.BYTES_PER_ELEMENT=8;_p=cc.Vertex2F.prototype;_p._getX=function(){return this._view[0]}; _p._setX=function(a){this._view[0]=a};_p._getY=function(){return this._view[1]};_p._setY=function(a){this._view[1]=a};cc.defineGetterSetter(_p,"x",_p._getX,_p._setX);cc.defineGetterSetter(_p,"y",_p._getY,_p._setY);cc.Vertex3F=function(a,b,c,d,e){this._arrayBuffer=d||new ArrayBuffer(cc.Vertex3F.BYTES_PER_ELEMENT);this._offset=e||0;this._view=new Float32Array(this._arrayBuffer,this._offset,3);this._view[0]=a||0;this._view[1]=b||0;this._view[2]=c||0};cc.Vertex3F.BYTES_PER_ELEMENT=12;_p=cc.Vertex3F.prototype; _p._getX=function(){return this._view[0]};_p._setX=function(a){this._view[0]=a};_p._getY=function(){return this._view[1]};_p._setY=function(a){this._view[1]=a};_p._getZ=function(){return this._view[2]};_p._setZ=function(a){this._view[2]=a};cc.defineGetterSetter(_p,"x",_p._getX,_p._setX);cc.defineGetterSetter(_p,"y",_p._getY,_p._setY);cc.defineGetterSetter(_p,"z",_p._getZ,_p._setZ); cc.Tex2F=function(a,b,c,d){this._arrayBuffer=c||new ArrayBuffer(cc.Tex2F.BYTES_PER_ELEMENT);this._offset=d||0;this._view=new Float32Array(this._arrayBuffer,this._offset,2);this._view[0]=a||0;this._view[1]=b||0};cc.Tex2F.BYTES_PER_ELEMENT=8;_p=cc.Tex2F.prototype;_p._getU=function(){return this._view[0]};_p._setU=function(a){this._view[0]=a};_p._getV=function(){return this._view[1]};_p._setV=function(a){this._view[1]=a};cc.defineGetterSetter(_p,"u",_p._getU,_p._setU); cc.defineGetterSetter(_p,"v",_p._getV,_p._setV); cc.Quad2=function(a,b,c,d,e,f){this._arrayBuffer=e||new ArrayBuffer(cc.Quad2.BYTES_PER_ELEMENT);this._offset=f||0;e=this._arrayBuffer;f=this._offset;var g=cc.Vertex2F.BYTES_PER_ELEMENT;this._tl=a?new cc.Vertex2F(a.x,a.y,e,f):new cc.Vertex2F(0,0,e,f);f+=g;this._tr=b?new cc.Vertex2F(b.x,b.y,e,f):new cc.Vertex2F(0,0,e,f);f+=g;this._bl=c?new cc.Vertex2F(c.x,c.y,e,f):new cc.Vertex2F(0,0,e,f);f+=g;this._br=d?new cc.Vertex2F(d.x,d.y,e,f):new cc.Vertex2F(0,0,e,f)};cc.Quad2.BYTES_PER_ELEMENT=32;_p=cc.Quad2.prototype; _p._getTL=function(){return this._tl};_p._setTL=function(a){this._tl._view[0]=a.x;this._tl._view[1]=a.y};_p._getTR=function(){return this._tr};_p._setTR=function(a){this._tr._view[0]=a.x;this._tr._view[1]=a.y};_p._getBL=function(){return this._bl};_p._setBL=function(a){this._bl._view[0]=a.x;this._bl._view[1]=a.y};_p._getBR=function(){return this._br};_p._setBR=function(a){this._br._view[0]=a.x;this._br._view[1]=a.y};cc.defineGetterSetter(_p,"tl",_p._getTL,_p._setTL); cc.defineGetterSetter(_p,"tr",_p._getTR,_p._setTR);cc.defineGetterSetter(_p,"bl",_p._getBL,_p._setBL);cc.defineGetterSetter(_p,"br",_p._getBR,_p._setBR); cc.Quad3=function(a,b,c,d,e,f){this._arrayBuffer=e||new ArrayBuffer(cc.Quad3.BYTES_PER_ELEMENT);this._offset=f||0;e=this._arrayBuffer;f=this._offset;var g=cc.Vertex3F.BYTES_PER_ELEMENT;this.bl=a?new cc.Vertex3F(a.x,a.y,a.z,e,f):new cc.Vertex3F(0,0,0,e,f);f+=g;this.br=b?new cc.Vertex3F(b.x,b.y,b.z,e,f):new cc.Vertex3F(0,0,0,e,f);f+=g;this.tl=c?new cc.Vertex3F(c.x,c.y,c.z,e,f):new cc.Vertex3F(0,0,0,e,f);f+=g;this.tr=d?new cc.Vertex3F(d.x,d.y,d.z,e,f):new cc.Vertex3F(0,0,0,e,f)}; cc.Quad3.BYTES_PER_ELEMENT=48;cc.V3F_C4B_T2F=function(a,b,c,d,e){this._arrayBuffer=d||new ArrayBuffer(cc.V3F_C4B_T2F.BYTES_PER_ELEMENT);this._offset=e||0;d=this._arrayBuffer;e=this._offset;this._vertices=a?new cc.Vertex3F(a.x,a.y,a.z,d,e):new cc.Vertex3F(0,0,0,d,e);e+=cc.Vertex3F.BYTES_PER_ELEMENT;this._colors=b?new cc._WebGLColor(b.r,b.g,b.b,b.a,d,e):new cc._WebGLColor(0,0,0,0,d,e);e+=cc._WebGLColor.BYTES_PER_ELEMENT;this._texCoords=c?new cc.Tex2F(c.u,c.v,d,e):new cc.Tex2F(0,0,d,e)}; cc.V3F_C4B_T2F.BYTES_PER_ELEMENT=24;_p=cc.V3F_C4B_T2F.prototype;_p._getVertices=function(){return this._vertices};_p._setVertices=function(a){var b=this._vertices;b._view[0]=a.x;b._view[1]=a.y;b._view[2]=a.z};_p._getColor=function(){return this._colors};_p._setColor=function(a){var b=this._colors;b._view[0]=a.r;b._view[1]=a.g;b._view[2]=a.b;b._view[3]=a.a};_p._getTexCoords=function(){return this._texCoords};_p._setTexCoords=function(a){this._texCoords._view[0]=a.u;this._texCoords._view[1]=a.v}; cc.defineGetterSetter(_p,"vertices",_p._getVertices,_p._setVertices);cc.defineGetterSetter(_p,"colors",_p._getColor,_p._setColor);cc.defineGetterSetter(_p,"texCoords",_p._getTexCoords,_p._setTexCoords); cc.V3F_C4B_T2F_Quad=function(a,b,c,d,e,f){this._arrayBuffer=e||new ArrayBuffer(cc.V3F_C4B_T2F_Quad.BYTES_PER_ELEMENT);this._offset=f||0;e=this._arrayBuffer;f=this._offset;var g=cc.V3F_C4B_T2F.BYTES_PER_ELEMENT;this._tl=a?new cc.V3F_C4B_T2F(a.vertices,a.colors,a.texCoords,e,f):new cc.V3F_C4B_T2F(null,null,null,e,f);f+=g;this._bl=b?new cc.V3F_C4B_T2F(b.vertices,b.colors,b.texCoords,e,f):new cc.V3F_C4B_T2F(null,null,null,e,f);f+=g;this._tr=c?new cc.V3F_C4B_T2F(c.vertices,c.colors,c.texCoords,e,f):new cc.V3F_C4B_T2F(null, null,null,e,f);f+=g;this._br=d?new cc.V3F_C4B_T2F(d.vertices,d.colors,d.texCoords,e,f):new cc.V3F_C4B_T2F(null,null,null,e,f)};cc.V3F_C4B_T2F_Quad.BYTES_PER_ELEMENT=96;_p=cc.V3F_C4B_T2F_Quad.prototype;_p._getTL=function(){return this._tl};_p._setTL=function(a){var b=this._tl;b.vertices=a.vertices;b.colors=a.colors;b.texCoords=a.texCoords};_p._getBL=function(){return this._bl};_p._setBL=function(a){var b=this._bl;b.vertices=a.vertices;b.colors=a.colors;b.texCoords=a.texCoords};_p._getTR=function(){return this._tr}; _p._setTR=function(a){var b=this._tr;b.vertices=a.vertices;b.colors=a.colors;b.texCoords=a.texCoords};_p._getBR=function(){return this._br};_p._setBR=function(a){var b=this._br;b.vertices=a.vertices;b.colors=a.colors;b.texCoords=a.texCoords};_p._getArrayBuffer=function(){return this._arrayBuffer};cc.defineGetterSetter(_p,"tl",_p._getTL,_p._setTL);cc.defineGetterSetter(_p,"tr",_p._getTR,_p._setTR);cc.defineGetterSetter(_p,"bl",_p._getBL,_p._setBL);cc.defineGetterSetter(_p,"br",_p._getBR,_p._setBR); cc.defineGetterSetter(_p,"arrayBuffer",_p._getArrayBuffer,null);cc.V3F_C4B_T2F_QuadZero=function(){return new cc.V3F_C4B_T2F_Quad}; cc.V3F_C4B_T2F_QuadCopy=function(a){if(!a)return cc.V3F_C4B_T2F_QuadZero();var b=a.tl,c=a.bl,d=a.tr;a=a.br;return{tl:{vertices:{x:b.vertices.x,y:b.vertices.y,z:b.vertices.z},colors:{r:b.colors.r,g:b.colors.g,b:b.colors.b,a:b.colors.a},texCoords:{u:b.texCoords.u,v:b.texCoords.v}},bl:{vertices:{x:c.vertices.x,y:c.vertices.y,z:c.vertices.z},colors:{r:c.colors.r,g:c.colors.g,b:c.colors.b,a:c.colors.a},texCoords:{u:c.texCoords.u,v:c.texCoords.v}},tr:{vertices:{x:d.vertices.x,y:d.vertices.y,z:d.vertices.z}, colors:{r:d.colors.r,g:d.colors.g,b:d.colors.b,a:d.colors.a},texCoords:{u:d.texCoords.u,v:d.texCoords.v}},br:{vertices:{x:a.vertices.x,y:a.vertices.y,z:a.vertices.z},colors:{r:a.colors.r,g:a.colors.g,b:a.colors.b,a:a.colors.a},texCoords:{u:a.texCoords.u,v:a.texCoords.v}}}};cc.V3F_C4B_T2F_QuadsCopy=function(a){if(!a)return[];for(var b=[],c=0;c>16,(a>>8)%256,a%256)};cc.colorToHex=function(a){var b=a.r.toString(16),c=a.g.toString(16),d=a.b.toString(16);return"#"+(16>a.r?"0"+b:b)+(16>a.g?"0"+c:c)+(16>a.b?"0"+d:d)};cc.TEXT_ALIGNMENT_LEFT=0;cc.TEXT_ALIGNMENT_CENTER=1;cc.TEXT_ALIGNMENT_RIGHT=2;cc.VERTICAL_TEXT_ALIGNMENT_TOP=0;cc.VERTICAL_TEXT_ALIGNMENT_CENTER=1; cc.VERTICAL_TEXT_ALIGNMENT_BOTTOM=2; cc._Dictionary=cc.Class.extend({_keyMapTb:null,_valueMapTb:null,__currId:0,ctor:function(){this._keyMapTb={};this._valueMapTb={};this.__currId=2<<(0|10*Math.random())},__getKey:function(){this.__currId++;return"key_"+this.__currId},setObject:function(a,b){if(null!=b){var c=this.__getKey();this._keyMapTb[c]=b;this._valueMapTb[c]=a}},objectForKey:function(a){if(null==a)return null;var b=this._keyMapTb,c;for(c in b)if(b[c]===a)return this._valueMapTb[c];return null},valueForKey:function(a){return this.objectForKey(a)}, removeObjectForKey:function(a){if(null!=a){var b=this._keyMapTb,c;for(c in b)if(b[c]===a){delete this._valueMapTb[c];delete b[c];break}}},removeObjectsForKeys:function(a){if(null!=a)for(var b=0;ba?0:a},_p._getG=function(){return this._view[1]},_p._setG=function(a){this._view[1]=0>a?0:a},_p._getB=function(){return this._view[2]},_p._setB=function(a){this._view[2]=0>a?0:a},_p._getA=function(){return this._view[3]},_p._setA=function(a){this._view[3]=0>a?0:a},cc.defineGetterSetter(_p,"r",_p._getR,_p._setR),cc.defineGetterSetter(_p,"g",_p._getG,_p._setG),cc.defineGetterSetter(_p,"b",_p._getB,_p._setB),cc.defineGetterSetter(_p,"a",_p._getA,_p._setA))});_p=cc.color; _p._getWhite=function(){return cc.color(255,255,255)};_p._getYellow=function(){return cc.color(255,255,0)};_p._getBlue=function(){return cc.color(0,0,255)};_p._getGreen=function(){return cc.color(0,255,0)};_p._getRed=function(){return cc.color(255,0,0)};_p._getMagenta=function(){return cc.color(255,0,255)};_p._getBlack=function(){return cc.color(0,0,0)};_p._getOrange=function(){return cc.color(255,127,0)};_p._getGray=function(){return cc.color(166,166,166)};cc.defineGetterSetter(_p,"WHITE",_p._getWhite); cc.defineGetterSetter(_p,"YELLOW",_p._getYellow);cc.defineGetterSetter(_p,"BLUE",_p._getBlue);cc.defineGetterSetter(_p,"GREEN",_p._getGreen);cc.defineGetterSetter(_p,"RED",_p._getRed);cc.defineGetterSetter(_p,"MAGENTA",_p._getMagenta);cc.defineGetterSetter(_p,"BLACK",_p._getBlack);cc.defineGetterSetter(_p,"ORANGE",_p._getOrange);cc.defineGetterSetter(_p,"GRAY",_p._getGray);cc.BlendFunc._disable=function(){return new cc.BlendFunc(cc.ONE,cc.ZERO)}; cc.BlendFunc._alphaPremultiplied=function(){return new cc.BlendFunc(cc.ONE,cc.ONE_MINUS_SRC_ALPHA)};cc.BlendFunc._alphaNonPremultiplied=function(){return new cc.BlendFunc(cc.SRC_ALPHA,cc.ONE_MINUS_SRC_ALPHA)};cc.BlendFunc._additive=function(){return new cc.BlendFunc(cc.SRC_ALPHA,cc.ONE)};cc.defineGetterSetter(cc.BlendFunc,"DISABLE",cc.BlendFunc._disable);cc.defineGetterSetter(cc.BlendFunc,"ALPHA_PREMULTIPLIED",cc.BlendFunc._alphaPremultiplied); cc.defineGetterSetter(cc.BlendFunc,"ALPHA_NON_PREMULTIPLIED",cc.BlendFunc._alphaNonPremultiplied);cc.defineGetterSetter(cc.BlendFunc,"ADDITIVE",cc.BlendFunc._additive);cc.Touches=[];cc.TouchesIntergerDict={};cc.DENSITYDPI_DEVICE="device-dpi";cc.DENSITYDPI_HIGH="high-dpi";cc.DENSITYDPI_MEDIUM="medium-dpi";cc.DENSITYDPI_LOW="low-dpi";var __BrowserGetter={init:function(){this.html=document.getElementsByTagName("html")[0]},availWidth:function(a){return a&&a!==this.html?a.clientWidth:window.innerWidth},availHeight:function(a){return a&&a!==this.html?a.clientHeight:window.innerHeight},meta:{width:"device-width"},adaptationType:cc.sys.browserType}; -1=c;!this._orientationChanging|| !cc.sys.isMobile||d&&this._orientation&cc.ORIENTATION_LANDSCAPE||!d&&this._orientation&cc.ORIENTATION_PORTRAIT?(a.width=b,a.height=c,cc.container.style["-webkit-transform"]="rotate(0deg)",cc.container.style.transform="rotate(0deg)",this._isRotated=!1):(a.width=c,a.height=b,cc.container.style["-webkit-transform"]="rotate(90deg)",cc.container.style.transform="rotate(90deg)",cc.container.style["-webkit-transform-origin"]="0px 0px 0px",cc.container.style.transformOrigin="0px 0px 0px",this._isRotated= !0);setTimeout(function(){cc.view._orientationChanging=!1},1E3)},_adjustSizeKeepCanvasSize:function(){var a=this._originalDesignResolutionSize.width,b=this._originalDesignResolutionSize.height;0Math.abs(a-c)&&(c=a);2>Math.abs(b-d)&&(d=b);a=cc.rect(Math.round((a-c)/2),Math.round((b-d)/2),c,d);this._result.scale=[e,f];this._result.viewport=a;return this._result},preApply:function(a){},apply:function(a,b){return{scale:[1,1]}},postApply:function(a){}}); (function(){var a=cc.ContainerStrategy.extend({apply:function(a){var b=a._frameSize.height,c=cc.container.style;this._setupContainer(a,a._frameSize.width,a._frameSize.height);a._isRotated?c.marginLeft=b+"px":c.margin="0px"}}),b=cc.ContainerStrategy.extend({apply:function(a,b){var c=a._frameSize.width,d=a._frameSize.height,e=cc.container.style,n=b.width,p=b.height,r=c/n,s=d/p,u,t;rthis.TOUCH_TIMEOUT)return this._removeUsedIndexBit(c), delete this._touchesIntegerDict[d.getID()],c}else return this._indexBitsUsed|=1<>=1}return-1},_removeUsedIndexBit:function(a){0>a||a>=this._maxTouches||(a=~(1<=c.length?c.push(a):(c[this._preTouchPoolPointer]= a,this._preTouchPoolPointer=(this._preTouchPoolPointer+1)%50))},getTouchByXY:function(a,b,c){var d=this._preTouchPoint;a=this._glView.convertToLocationInView(a,b,c);b=new cc.Touch(a.x,a.y);b._setPrevPoint(d.x,d.y);d.x=a.x;d.y=a.y;return b},getMouseEvent:function(a,b,c){var d=this._prevMousePoint;this._glView._convertMouseToLocationInView(a,b);b=new cc.EventMouse(c);b.setLocation(a.x,a.y);b._setPrevCursor(d.x,d.y);d.x=a.x;d.y=a.y;return b},getPointByEvent:function(a,b){if(null!=a.pageX)return{x:a.pageX, y:a.pageY};b.left-=document.body.scrollLeft;b.top-=document.body.scrollTop;return{x:a.clientX,y:a.clientY}},getTouchesByEvent:function(a,b){for(var c=[],d=this._glView,e,f,g=this._preTouchPoint,h=a.changedTouches.length,k=0;kthis._accelInterval&&(this._accelCurTime-=this._accelInterval,cc.eventManager.dispatchEvent(new cc.EventAcceleration(this._acceleration))); this._accelCurTime+=a}};_p=cc.inputManager;_p.setAccelerometerEnabled=function(a){this._accelEnabled!==a&&(this._accelEnabled=a,a=cc.director.getScheduler(),this._accelCurTime=0,a.scheduleUpdate(this))};_p.setAccelerometerInterval=function(a){this._accelInterval!==a&&(this._accelInterval=a)}; _p._registerKeyboardEvent=function(){cc._canvas.addEventListener("keydown",function(a){cc.eventManager.dispatchEvent(new cc.EventKeyboard(a.keyCode,!0));a.stopPropagation();a.preventDefault()},!1);cc._canvas.addEventListener("keyup",function(a){cc.eventManager.dispatchEvent(new cc.EventKeyboard(a.keyCode,!1));a.stopPropagation();a.preventDefault()},!1)}; _p._registerAccelerometerEvent=function(){var a=window;this._acceleration=new cc.Acceleration;this._accelDeviceEvent=a.DeviceMotionEvent||a.DeviceOrientationEvent;cc.sys.browserType===cc.sys.BROWSER_TYPE_MOBILE_QQ&&(this._accelDeviceEvent=window.DeviceOrientationEvent);var b=this._accelDeviceEvent===a.DeviceMotionEvent?"devicemotion":"deviceorientation",c=navigator.userAgent;if(/Android/.test(c)||/Adr/.test(c)&&cc.sys.browserType===cc.BROWSER_TYPE_UC)this._minus=-1;a.addEventListener(b,this.didAccelerate.bind(this), !1)}; _p.didAccelerate=function(a){var b=window;if(this._accelEnabled){var c=this._acceleration,d,e,f;this._accelDeviceEvent===window.DeviceMotionEvent?(f=a.accelerationIncludingGravity,d=this._accelMinus*f.x*0.1,e=this._accelMinus*f.y*0.1,f=0.1*f.z):(d=a.gamma/90*0.981,e=0.981*-(a.beta/90),f=a.alpha/90*0.981);c.x=d;c.y=e;c.z=f;c.timestamp=a.timeStamp||Date.now();a=c.x;b.orientation===cc.UIInterfaceOrientationLandscapeRight?(c.x=-c.y,c.y=a):b.orientation===cc.UIInterfaceOrientationLandscapeLeft?(c.x=c.y, c.y=-a):b.orientation===cc.UIInterfaceOrientationPortraitUpsideDown&&(c.x=-c.x,c.y=-c.y)}};delete _p;cc.AffineTransform=function(a,b,c,d,e,f){this.a=a;this.b=b;this.c=c;this.d=d;this.tx=e;this.ty=f};cc.affineTransformMake=function(a,b,c,d,e,f){return{a:a,b:b,c:c,d:d,tx:e,ty:f}};cc.pointApplyAffineTransform=function(a,b,c){var d;void 0===c?(c=b,d=a.x,a=a.y):(d=a,a=b);return{x:c.a*d+c.c*a+c.tx,y:c.b*d+c.d*a+c.ty}};cc._pointApplyAffineTransform=function(a,b,c){return cc.pointApplyAffineTransform(a,b,c)}; cc.sizeApplyAffineTransform=function(a,b){return{width:b.a*a.width+b.c*a.height,height:b.b*a.width+b.d*a.height}};cc.affineTransformMakeIdentity=function(){return{a:1,b:0,c:0,d:1,tx:0,ty:0}};cc.affineTransformIdentity=function(){return{a:1,b:0,c:0,d:1,tx:0,ty:0}}; cc.rectApplyAffineTransform=function(a,b){var c=cc.rectGetMinY(a),d=cc.rectGetMinX(a),e=cc.rectGetMaxX(a),f=cc.rectGetMaxY(a),g=cc.pointApplyAffineTransform(d,c,b),c=cc.pointApplyAffineTransform(e,c,b),d=cc.pointApplyAffineTransform(d,f,b),h=cc.pointApplyAffineTransform(e,f,b),e=Math.min(g.x,c.x,d.x,h.x),f=Math.max(g.x,c.x,d.x,h.x),k=Math.min(g.y,c.y,d.y,h.y),g=Math.max(g.y,c.y,d.y,h.y);return cc.rect(e,k,f-e,g-k)}; cc._rectApplyAffineTransformIn=function(a,b){var c=cc.rectGetMinY(a),d=cc.rectGetMinX(a),e=cc.rectGetMaxX(a),f=cc.rectGetMaxY(a),g=cc.pointApplyAffineTransform(d,c,b),c=cc.pointApplyAffineTransform(e,c,b),d=cc.pointApplyAffineTransform(d,f,b),h=cc.pointApplyAffineTransform(e,f,b),e=Math.min(g.x,c.x,d.x,h.x),f=Math.max(g.x,c.x,d.x,h.x),k=Math.min(g.y,c.y,d.y,h.y),g=Math.max(g.y,c.y,d.y,h.y);a.x=e;a.y=k;a.width=f-e;a.height=g-k;return a}; cc.affineTransformTranslate=function(a,b,c){return{a:a.a,b:a.b,c:a.c,d:a.d,tx:a.tx+a.a*b+a.c*c,ty:a.ty+a.b*b+a.d*c}};cc.affineTransformScale=function(a,b,c){return{a:a.a*b,b:a.b*b,c:a.c*c,d:a.d*c,tx:a.tx,ty:a.ty}};cc.affineTransformRotate=function(a,b){var c=Math.sin(b),d=Math.cos(b);return{a:a.a*d+a.c*c,b:a.b*d+a.d*c,c:a.c*d-a.a*c,d:a.d*d-a.b*c,tx:a.tx,ty:a.ty}}; cc.affineTransformConcat=function(a,b){return{a:a.a*b.a+a.b*b.c,b:a.a*b.b+a.b*b.d,c:a.c*b.a+a.d*b.c,d:a.c*b.b+a.d*b.d,tx:a.tx*b.a+a.ty*b.c+b.tx,ty:a.tx*b.b+a.ty*b.d+b.ty}};cc.affineTransformConcatIn=function(a,b){var c=a.a,d=a.b,e=a.c,f=a.d,g=a.tx,h=a.ty;a.a=c*b.a+d*b.c;a.b=c*b.b+d*b.d;a.c=e*b.a+f*b.c;a.d=e*b.b+f*b.d;a.tx=g*b.a+h*b.c+b.tx;a.ty=g*b.b+h*b.d+b.ty;return a};cc.affineTransformEqualToTransform=function(a,b){return a.a===b.a&&a.b===b.b&&a.c===b.c&&a.d===b.d&&a.tx===b.tx&&a.ty===b.ty}; cc.affineTransformInvert=function(a){var b=1/(a.a*a.d-a.b*a.c);return{a:b*a.d,b:-b*a.b,c:-b*a.c,d:b*a.a,tx:b*(a.c*a.ty-a.d*a.tx),ty:b*(a.b*a.tx-a.a*a.ty)}};cc.affineTransformInvertOut=function(a,b){var c=a.a,d=a.b,e=a.c,f=a.d,g=1/(c*f-d*e);b.a=g*f;b.b=-g*d;b.c=-g*e;b.d=g*c;b.tx=g*(e*a.ty-f*a.tx);b.ty=g*(d*a.tx-c*a.ty)};cc.POINT_EPSILON=parseFloat("1.192092896e-07F");cc.pNeg=function(a){return cc.p(-a.x,-a.y)};cc.pAdd=function(a,b){return cc.p(a.x+b.x,a.y+b.y)};cc.pSub=function(a,b){return cc.p(a.x-b.x,a.y-b.y)};cc.pMult=function(a,b){return cc.p(a.x*b,a.y*b)};cc.pMidpoint=function(a,b){return cc.pMult(cc.pAdd(a,b),0.5)};cc.pDot=function(a,b){return a.x*b.x+a.y*b.y};cc.pCross=function(a,b){return a.x*b.y-a.y*b.x};cc.pPerp=function(a){return cc.p(-a.y,a.x)};cc.pRPerp=function(a){return cc.p(a.y,-a.x)}; cc.pProject=function(a,b){return cc.pMult(b,cc.pDot(a,b)/cc.pDot(b,b))};cc.pRotate=function(a,b){return cc.p(a.x*b.x-a.y*b.y,a.x*b.y+a.y*b.x)};cc.pUnrotate=function(a,b){return cc.p(a.x*b.x+a.y*b.y,a.y*b.x-a.x*b.y)};cc.pLengthSQ=function(a){return cc.pDot(a,a)};cc.pDistanceSQ=function(a,b){return cc.pLengthSQ(cc.pSub(a,b))};cc.pLength=function(a){return Math.sqrt(cc.pLengthSQ(a))};cc.pDistance=function(a,b){return cc.pLength(cc.pSub(a,b))}; cc.pNormalize=function(a){var b=cc.pLength(a);return 0===b?cc.p(a):cc.pMult(a,1/b)};cc.pForAngle=function(a){return cc.p(Math.cos(a),Math.sin(a))};cc.pToAngle=function(a){return Math.atan2(a.y,a.x)};cc.clampf=function(a,b,c){if(b>c){var d=b;b=c;c=d}return a=e.x&&0<=e.y&&1>=e.y?!0:!1};cc.pIntersectPoint=function(a,b,c,d){var e=cc.p(0,0);return cc.pLineIntersect(a,b,c,d,e)?(c=cc.p(0,0),c.x=a.x+e.x*(b.x-a.x),c.y=a.y+e.x*(b.y-a.y),c):cc.p(0,0)};cc.pSameAs=function(a,b){return null!=a&&null!=b?a.x===b.x&&a.y===b.y:!1};cc.pZeroIn=function(a){a.x=0;a.y=0};cc.pIn=function(a,b){a.x=b.x;a.y=b.y};cc.pMultIn=function(a,b){a.x*=b;a.y*=b}; cc.pSubIn=function(a,b){a.x-=b.x;a.y-=b.y};cc.pAddIn=function(a,b){a.x+=b.x;a.y+=b.y};cc.pNormalizeIn=function(a){cc.pMultIn(a,1/Math.sqrt(a.x*a.x+a.y*a.y))};cc.vertexLineToPolygon=function(a,b,c,d,e){e+=d;if(!(1>=e)){b*=0.5;for(var f,g=e-1,h=d;hb.value||1k.getLocalZOrder())this._visitTarget(k,!1);else break;null!=h[a.__instanceId]&&(g[a.getGlobalZOrder()]||(g[a.getGlobalZOrder()]=[]),g[a.getGlobalZOrder()].push(a.__instanceId));for(;e=c?(delete this._spaces[a],d>c&&(this._spaces[a+c]=d-c),!0):!1},requestBuffer:function(a){var c,d,e;for(c in this._spaces)if(d=parseInt(c),e=this._spaces[c],e>=a&&this.allocBuffer(d,a))return d;return-1},freeBuffer:function(a,c){var d=this._spaces,e,f;for(f in d){e=parseInt(f);if(e>a)break;if(e+d[f]>=a){c=c+a-e;a=e;break}}d=a+c;this._spaces[d]&&(c+=this._spaces[d],delete this._spaces[d]);this._spaces[a]=c},setDirty:function(){this._dirty=!0},update:function(){this._dirty&&(this.gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer),this.gl.bufferSubData(gl.ARRAY_BUFFER,0,this.dataArray),this._dirty=!1)},updateSubData:function(a,c){this.gl.bindBuffer(gl.ARRAY_BUFFER,this.vertexBuffer);this.gl.bufferSubData(gl.ARRAY_BUFFER,a,c)},destroy:function(){this.gl.deleteBuffer(this.vertexBuffer);this.vertexBuffer=this.texCoords=this.colors=this.positions=this.data=null}};return a}();cc.rendererCanvas={childrenOrderDirty:!0,assignedZ:0,assignedZStep:1E-4,_transformNodePool:[],_renderCmds:[],_isCacheToCanvasOn:!1,_cacheToCanvasCmds:{},_cacheInstanceIds:[],_currentID:0,_clearColor:cc.color(),_clearFillStyle:"rgb(0, 0, 0)",_dirtyRegion:null,_allNeedDraw:!0,_enableDirtyRegion:!1,_debugDirtyRegion:!1,_canUseDirtyRegion:!1,_dirtyRegionCountThreshold:10,getRenderCmd:function(a){return a._createRenderCmd()},enableDirtyRegion:function(a){this._enableDirtyRegion=a},isDirtyRegionEnabled:function(){return this._enableDirtyRegion}, setDirtyRegionCountThreshold:function(a){this._dirtyRegionCountThreshold=a},_collectDirtyRegion:function(){var a=this._renderCmds,b,c,d=this._dirtyRegion,e=0,f=!0,g=cc.Node.CanvasRenderCmd.RegionStatus;b=0;for(c=a.length;bg.NotDirty&&(++e,e>this._dirtyRegionCountThreshold&&(f=!1),f&&(!m.isEmpty()&&d.addRegion(m),h._regionFlag>g.Dirty&&!k.isEmpty()&&d.addRegion(k)),h._regionFlag=g.NotDirty)}return f},_beginDrawDirtyRegion:function(a){var b= a.getContext(),c=this._dirtyRegion.getDirtyRegions();b.save();a.setTransform({a:1,b:0,c:0,d:1,tx:0,ty:0},a._scaleX,a._scaleY);b.beginPath();a=0;for(var d=c.length;ar;r+=6)e[r]=p+0,e[r+1]=p+1,e[r+2]=p+2,e[r+3]=p+1,e[r+4]=p+2,e[r+5]=p+3,p+=4;a.bufferData(a.ELEMENT_ARRAY_BUFFER,e,a.STATIC_DRAW)}c&&(g=12E3,f=new ArrayBuffer(4*g),h=new Float32Array(f),k=new Uint32Array(f),a.bindBuffer(a.ARRAY_BUFFER,c),a.bufferData(a.ARRAY_BUFFER,h,a.DYNAMIC_DRAW));d=2E3},getVertexSize:function(){return d}, getRenderCmd:function(a){return a._createRenderCmd()},_turnToCacheMode:function(a){this._isCacheToBufferOn=!0;a=a||0;this._cacheToBufferCmds[a]?this._cacheToBufferCmds[a].length=0:this._cacheToBufferCmds[a]=[];-1===this._cacheInstanceIds.indexOf(a)&&this._cacheInstanceIds.push(a);this._currentID=a},_turnToNormalMode:function(){this._isCacheToBufferOn=!1},_removeCache:function(a){a=a||this._currentID;var b=this._cacheToBufferCmds[a];b&&(b.length=0,delete this._cacheToBufferCmds[a]);cc.arrayRemoveObject(this._cacheInstanceIds, a)},_renderingToBuffer:function(a){a=a||this._currentID;this.rendering(cc._renderContext,this._cacheToBufferCmds[a]);this._removeCache(a);a=this._cacheInstanceIds;0===a.length?this._isCacheToBufferOn=!1:this._currentID=a[a.length-1]},resetFlag:function(){this.childrenOrderDirty&&(this.childrenOrderDirty=!1);this._transformNodePool.length=0},transform:function(){var a=this._transformNodePool;a.sort(this._sortNodeByLevelAsc);var b,c,d;b=0;for(c=a.length;b=d&&this._batchRendering();var c=b._node,f=c._texture||(c._spriteFrame?c._spriteFrame._texture:null);if(f){var g=c._blendFunc.src,c=c._blendFunc.dst,s=b._shaderProgram; if(a.texture!==f||a.blendSrc!==g||a.blendDst!==c||a.shader!==s)this._batchRendering(),a.texture=f,a.blendSrc=g,a.blendDst=c,a.shader=s;b=b.uploadData(h,k,6*e);00.5*d?f.bufferData(f.ARRAY_BUFFER,h,f.DYNAMIC_DRAW):(g=h.subarray(0,6*e),f.bufferData(f.ARRAY_BUFFER, g,f.DYNAMIC_DRAW));f.enableVertexAttribArray(cc.VERTEX_ATTRIB_POSITION);f.enableVertexAttribArray(cc.VERTEX_ATTRIB_COLOR);f.enableVertexAttribArray(cc.VERTEX_ATTRIB_TEX_COORDS);f.vertexAttribPointer(cc.VERTEX_ATTRIB_POSITION,3,f.FLOAT,!1,24,0);f.vertexAttribPointer(cc.VERTEX_ATTRIB_COLOR,4,f.UNSIGNED_BYTE,!0,24,12);f.vertexAttribPointer(cc.VERTEX_ATTRIB_TEX_COORDS,2,f.FLOAT,!1,24,16);f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,b);f.drawElements(f.TRIANGLES,6*r,f.UNSIGNED_SHORT,0);cc.g_NumberOfDraws++;e=0}}, rendering:function(b,c){var d=c||this._renderCmds,f,g,h,k=b||cc._renderContext;k.bindBuffer(gl.ARRAY_BUFFER,null);f=0;for(g=d.length;f=this._width||0>=this._height?this.setTo(a._minX,a._minY,a._maxX,a._maxY):(this._minX>a._minX&&(this._minX=a._minX),this._minY>a._minY&&(this._minY=a._minY),this._maxX=this._width||0>=this._height}; regionProto.intersects=function(a){if(0>=this._width||0>=this._height||0>=a._width||0>=a._height)return!1;var b=this._minX>a._minX?this._minX:a._minX,c=this._maxXc)return!1;b=this._minY>a._minY?this._minY:a._minY;c=this._maxYu&&(p=r,r=u,u=p);t>g&&(p=t,t=g,g=p);r=(rg?u:g)+1;s>m&&(p=s,s=m,m=p);n>h&&(p=n,n=h,h=p);s=(sh?m:h)+1}this._minX=r;this._minY=s;this._maxX= u;this._maxY=m;this._width=u-r;this._height=m-s;this._area=this._width*this._height}};function unionArea(a,b){return((a._maxX>b._maxX?a._maxX:b._maxX)-(a._minXb._maxY?a._maxY:b._maxY)-(a._minYb&&(b=0),0>c&&(c=0),d>this.clipWidth&&(d=this.clipWidth),a>this.clipHeight&&(a=this.clipHeight));if(b>=d||c>=a)return!1;if(this.clipRectChanged)return!0;var e=this.dirtyList,f=regionCreate();e.push(f.setTo(b,c,d,a));this.mergeDirtyList(e);return!0};dirtyRegionProto.clear=function(){for(var a=this.dirtyList,b=a.length,c=0;cb)return!1;for(var c=this.hasClipRect,d=3n&&(e=h,f=m,d=n)}}c&&0.95=b.max)){var c=0,d,e,f,g,h,k=cc.Node._performStacks[cc.Node._performing];k||(k=[],cc.Node._performStacks.push(k));k.length=0;cc.Node._performing++; for(f=k[0]=this;f;){if((d=f._children)&&0f._localZOrder)f.visit(this);else break;for(b.pushRenderCommand(c);ad||c>d)return cc.log(cc._LogInfos.Texture2D_initWithImage_2,b,c,d,d),!1;this._textureLoaded=!0;return this._initPremultipliedATextureWithImage(a,b,c)},initWithElement:function(a){a&&(this._webTextureObj=cc._renderContext.createTexture(), this._htmlElementObj=a,this._hasPremultipliedAlpha=this._textureLoaded=!0)},getHtmlElementObj:function(){return this._htmlElementObj},isLoaded:function(){return this._textureLoaded},handleLoadedTexture:function(a){a=void 0!==a?a:this._hasPremultipliedAlpha;if(cc.game._rendererInitialized){if(!this._htmlElementObj){var b=cc.loader.getRes(this.url);if(!b)return;this.initWithElement(b)}this._htmlElementObj.width&&this._htmlElementObj.height&&(b=cc._renderContext,cc.glBindTexture2D(this),b.pixelStorei(b.UNPACK_ALIGNMENT, 4),a&&b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL,1),b.texImage2D(b.TEXTURE_2D,0,b.RGBA,b.RGBA,b.UNSIGNED_BYTE,this._htmlElementObj),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.LINEAR),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.LINEAR),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE),this.shaderProgram=cc.shaderCache.programForKey(cc.SHADER_POSITION_TEXTURE),cc.glBindTexture2D(null),a&&b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 0),b=this._htmlElementObj.height,this._pixelsWide=this._contentSize.width=this._htmlElementObj.width,this._pixelsHigh=this._contentSize.height=b,this._pixelFormat=cc.Texture2D.PIXEL_FORMAT_RGBA8888,this.maxT=this.maxS=1,this._hasPremultipliedAlpha=a,this._hasMipmaps=!1,this.dispatchEvent("load"))}},initWithString:function(a,b,c,d,e,f){cc.log(cc._LogInfos.Texture2D_initWithString);return null},initWithETCFile:function(a){cc.log(cc._LogInfos.Texture2D_initWithETCFile_2);return!1},initWithPVRFile:function(a){cc.log(cc._LogInfos.Texture2D_initWithPVRFile_2); return!1},initWithPVRTCData:function(a,b,c,d,e,f){cc.log(cc._LogInfos.Texture2D_initWithPVRTCData_2);return!1},setTexParameters:function(a,b,c,d){var e=cc._renderContext;void 0!==b&&(a={minFilter:a,magFilter:b,wrapS:c,wrapT:d});cc.assert(this._pixelsWide===cc.NextPOT(this._pixelsWide)&&this._pixelsHigh===cc.NextPOT(this._pixelsHigh)||a.wrapS===e.CLAMP_TO_EDGE&&a.wrapT===e.CLAMP_TO_EDGE,"WebGLRenderingContext.CLAMP_TO_EDGE should be used in NPOT textures");cc.glBindTexture2D(this);e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER,a.minFilter);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,a.magFilter);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,a.wrapS);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,a.wrapT)},setAntiAliasTexParameters:function(){var a=cc._renderContext;cc.glBindTexture2D(this);this._hasMipmaps?a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR_MIPMAP_NEAREST):a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR)}, setAliasTexParameters:function(){var a=cc._renderContext;cc.glBindTexture2D(this);this._hasMipmaps?a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.NEAREST_MIPMAP_NEAREST):a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.NEAREST);a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.NEAREST)},generateMipmap:function(){cc.assert(this._pixelsWide===cc.NextPOT(this._pixelsWide)&&this._pixelsHigh===cc.NextPOT(this._pixelsHigh),"Mimpap texture only works in POT textures");cc.glBindTexture2D(this); cc._renderContext.generateMipmap(cc._renderContext.TEXTURE_2D);this._hasMipmaps=!0},stringForFormat:function(){return cc.Texture2D._M[this._pixelFormat]},bitsPerPixelForFormat:function(a){a=a||this._pixelFormat;var b=cc.Texture2D._B[a];if(null!=b)return b;cc.log(cc._LogInfos.Texture2D_bitsPerPixelForFormat,a);return-1},_initPremultipliedATextureWithImage:function(a,b,c){var d=cc.Texture2D,e=a.getData(),f=null,f=null,g=a.hasAlpha(),h=cc.size(a.getWidth(),a.getHeight()),k=d.defaultPixelFormat,m=a.getBitsPerComponent(); g||(8<=m?k=d.PIXEL_FORMAT_RGB888:(cc.log(cc._LogInfos.Texture2D__initPremultipliedATextureWithImage),k=d.PIXEL_FORMAT_RGB565));var n=b*c;if(k===d.PIXEL_FORMAT_RGB565)if(g)for(e=new Uint16Array(b*c),f=a.getData(),m=0;m>0&255)>>3<<11|(f[m]>>8&255)>>2<<5|(f[m]>>16&255)>>3<<0;else for(e=new Uint16Array(b*c),f=a.getData(),m=0;m>3<<11|(f[m]&255)>>2<<5|(f[m]&255)>>3<<0;else if(k===d.PIXEL_FORMAT_RGBA4444)for(e=new Uint16Array(b*c),f=a.getData(),m=0;m> 0&255)>>4<<12|(f[m]>>8&255)>>4<<8|(f[m]>>16&255)>>4<<4|(f[m]>>24&255)>>4<<0;else if(k===d.PIXEL_FORMAT_RGB5A1)for(e=new Uint16Array(b*c),f=a.getData(),m=0;m>0&255)>>3<<11|(f[m]>>8&255)>>3<<6|(f[m]>>16&255)>>3<<1|(f[m]>>24&255)>>7<<0;else if(k===d.PIXEL_FORMAT_A8)for(e=new Uint8Array(b*c),f=a.getData(),m=0;m>24&255;if(g&&k===d.PIXEL_FORMAT_RGB888)for(f=a.getData(),e=new Uint8Array(b*c*3),m=0;m>0&255,e[3*m+1]=f>>8&255,e[3*m+2]=f>>16&255;this.initWithData(e, k,b,c,h);a.getData();this._hasPremultipliedAlpha=a.isPremultipliedAlpha();return!0},addLoadedEventListener:function(a,b){this.addEventListener("load",a,b)},removeLoadedEventListener:function(a){this.removeEventTarget("load",a)}})}; cc._tmp.WebGLTextureAtlas=function(){var a=cc.TextureAtlas.prototype;a._setupVBO=function(){var a=cc._renderContext;this._buffersVBO[0]=a.createBuffer();this._buffersVBO[1]=a.createBuffer();this._quadsWebBuffer=a.createBuffer();this._mapBuffers()};a._mapBuffers=function(){var a=cc._renderContext;a.bindBuffer(a.ARRAY_BUFFER,this._quadsWebBuffer);a.bufferData(a.ARRAY_BUFFER,this._quadsArrayBuffer,a.DYNAMIC_DRAW);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this._buffersVBO[1]);a.bufferData(a.ELEMENT_ARRAY_BUFFER, this._indices,a.STATIC_DRAW)};a.drawNumberOfQuads=function(a,c){c=c||0;if(0!==a&&this.texture&&this.texture.isLoaded()){var d=cc._renderContext;cc.glBindTexture2D(this.texture);d.bindBuffer(d.ARRAY_BUFFER,this._quadsWebBuffer);this.dirty&&(d.bufferData(d.ARRAY_BUFFER,this._quadsArrayBuffer,d.DYNAMIC_DRAW),this.dirty=!1);d.enableVertexAttribArray(cc.VERTEX_ATTRIB_POSITION);d.enableVertexAttribArray(cc.VERTEX_ATTRIB_COLOR);d.enableVertexAttribArray(cc.VERTEX_ATTRIB_TEX_COORDS);d.vertexAttribPointer(cc.VERTEX_ATTRIB_POSITION, 3,d.FLOAT,!1,24,0);d.vertexAttribPointer(cc.VERTEX_ATTRIB_COLOR,4,d.UNSIGNED_BYTE,!0,24,12);d.vertexAttribPointer(cc.VERTEX_ATTRIB_TEX_COORDS,2,d.FLOAT,!1,24,16);d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,this._buffersVBO[1]);cc.TEXTURE_ATLAS_USE_TRIANGLE_STRIP?d.drawElements(d.TRIANGLE_STRIP,6*a,d.UNSIGNED_SHORT,6*c*this._indices.BYTES_PER_ELEMENT):d.drawElements(d.TRIANGLES,6*a,d.UNSIGNED_SHORT,6*c*this._indices.BYTES_PER_ELEMENT);cc.g_NumberOfDraws++}}}; cc._tmp.WebGLTextureCache=function(){var a=cc.textureCache;a.handleLoadedTexture=function(a){var c=this._textures,d;cc.game._rendererInitialized||(c=this._loadedTexturesBefore);d=c[a];d||(d=c[a]=new cc.Texture2D,d.url=a);".png"===cc.path.extname(a)?d.handleLoadedTexture(!0):d.handleLoadedTexture()};a.addImage=function(a,c,d){cc.assert(a,cc._LogInfos.Texture2D_addImage_2);var e=this._textures;cc.game._rendererInitialized||(e=this._loadedTexturesBefore);var f=e[a]||e[cc.loader._getAliase(a)];if(f)return f.isLoaded()? c&&c.call(d,f):f.addEventListener("load",function(){c&&c.call(d,f)},d),f;f=e[a]=new cc.Texture2D;f.url=a;var g=cc.loader.getBasePath?cc.loader.getBasePath():cc.loader.resPath;cc.loader.loadImg(cc.path.join(g||"",a),function(f,g){if(f)return c&&c.call(d,f);cc.loader.cache[a]||(cc.loader.cache[a]=g);cc.textureCache.handleLoadedTexture(a);var m=e[a];c&&c.call(d,m)});return f};a.addImageAsync=a.addImage;a=null};cc._tmp.PrototypeTexture2D=function(){var a=cc.Texture2D;a.PVRImagesHavePremultipliedAlpha=function(a){cc.PVRHaveAlphaPremultiplied_=a};a.PIXEL_FORMAT_RGBA8888=2;a.PIXEL_FORMAT_RGB888=3;a.PIXEL_FORMAT_RGB565=4;a.PIXEL_FORMAT_A8=5;a.PIXEL_FORMAT_I8=6;a.PIXEL_FORMAT_AI88=7;a.PIXEL_FORMAT_RGBA4444=8;a.PIXEL_FORMAT_RGB5A1=7;a.PIXEL_FORMAT_PVRTC4=9;a.PIXEL_FORMAT_PVRTC2=10;a.PIXEL_FORMAT_DEFAULT=a.PIXEL_FORMAT_RGBA8888;a.defaultPixelFormat=a.PIXEL_FORMAT_DEFAULT;var b=cc.Texture2D._M={};b[a.PIXEL_FORMAT_RGBA8888]= "RGBA8888";b[a.PIXEL_FORMAT_RGB888]="RGB888";b[a.PIXEL_FORMAT_RGB565]="RGB565";b[a.PIXEL_FORMAT_A8]="A8";b[a.PIXEL_FORMAT_I8]="I8";b[a.PIXEL_FORMAT_AI88]="AI88";b[a.PIXEL_FORMAT_RGBA4444]="RGBA4444";b[a.PIXEL_FORMAT_RGB5A1]="RGB5A1";b[a.PIXEL_FORMAT_PVRTC4]="PVRTC4";b[a.PIXEL_FORMAT_PVRTC2]="PVRTC2";b=cc.Texture2D._B={};b[a.PIXEL_FORMAT_RGBA8888]=32;b[a.PIXEL_FORMAT_RGB888]=24;b[a.PIXEL_FORMAT_RGB565]=16;b[a.PIXEL_FORMAT_A8]=8;b[a.PIXEL_FORMAT_I8]=8;b[a.PIXEL_FORMAT_AI88]=16;b[a.PIXEL_FORMAT_RGBA4444]= 16;b[a.PIXEL_FORMAT_RGB5A1]=16;b[a.PIXEL_FORMAT_PVRTC4]=4;b[a.PIXEL_FORMAT_PVRTC2]=3;a=cc.Texture2D.prototype;cc.defineGetterSetter(a,"name",a.getName);cc.defineGetterSetter(a,"pixelFormat",a.getPixelFormat);cc.defineGetterSetter(a,"pixelsWidth",a.getPixelsWide);cc.defineGetterSetter(a,"pixelsHeight",a.getPixelsHigh);cc.defineGetterSetter(a,"width",a._getWidth);cc.defineGetterSetter(a,"height",a._getHeight)}; cc._tmp.PrototypeTextureAtlas=function(){var a=cc.TextureAtlas.prototype;cc.defineGetterSetter(a,"totalQuads",a.getTotalQuads);cc.defineGetterSetter(a,"capacity",a.getCapacity);cc.defineGetterSetter(a,"quads",a.getQuads,a.setQuads)};cc.ALIGN_CENTER=51;cc.ALIGN_TOP=19;cc.ALIGN_TOP_RIGHT=18;cc.ALIGN_RIGHT=50;cc.ALIGN_BOTTOM_RIGHT=34;cc.ALIGN_BOTTOM=35;cc.ALIGN_BOTTOM_LEFT=33;cc.ALIGN_LEFT=49;cc.ALIGN_TOP_LEFT=17;cc.PVRHaveAlphaPremultiplied_=!1; cc.game.addEventListener(cc.game.EVENT_RENDERER_INITED,function(){if(cc._renderType===cc.game.RENDER_TYPE_CANVAS){var a={_contentSize:null,_textureLoaded:!1,_htmlElementObj:null,url:null,_pattern:null,ctor:function(){this._contentSize=cc.size(0,0);this._textureLoaded=!1;this._htmlElementObj=null;this._pattern="";this._pixelsHigh=this._pixelsWide=0},getPixelsWide:function(){return this._pixelsWide},getPixelsHigh:function(){return this._pixelsHigh},getContentSize:function(){var a=cc.contentScaleFactor(); return cc.size(this._contentSize.width/a,this._contentSize.height/a)},_getWidth:function(){return this._contentSize.width/cc.contentScaleFactor()},_getHeight:function(){return this._contentSize.height/cc.contentScaleFactor()},getContentSizeInPixels:function(){return this._contentSize},initWithElement:function(a){a&&(this._htmlElementObj=a,this._pixelsWide=this._contentSize.width=a.width,this._pixelsHigh=this._contentSize.height=a.height,this._textureLoaded=!0)},getHtmlElementObj:function(){return this._htmlElementObj}, isLoaded:function(){return this._textureLoaded},handleLoadedTexture:function(){if(!this._textureLoaded){if(!this._htmlElementObj){var a=cc.loader.getRes(this.url);if(!a)return;this.initWithElement(a)}a=this._htmlElementObj;this._pixelsWide=this._contentSize.width=a.width;this._pixelsHigh=this._contentSize.height=a.height;this.dispatchEvent("load")}},description:function(){return"\x3ccc.Texture2D | width \x3d "+this._contentSize.width+" height "+this._contentSize.height+"\x3e"},initWithData:function(a, c,d,e,f){return!1},initWithImage:function(a){return!1},initWithString:function(a,c,d,e,f,g){return!1},releaseTexture:function(){cc.loader.release(this.url)},getName:function(){return null},getMaxS:function(){return 1},setMaxS:function(a){},getMaxT:function(){return 1},setMaxT:function(a){},getPixelFormat:function(){return null},getShaderProgram:function(){return null},setShaderProgram:function(a){},hasPremultipliedAlpha:function(){return!1},hasMipmaps:function(){return!1},releaseData:function(a){}, keepData:function(a,c){return a},drawAtPoint:function(a){},drawInRect:function(a){},initWithETCFile:function(a){cc.log(cc._LogInfos.Texture2D_initWithETCFile);return!1},initWithPVRFile:function(a){cc.log(cc._LogInfos.Texture2D_initWithPVRFile);return!1},initWithPVRTCData:function(a,c,d,e,f,g){cc.log(cc._LogInfos.Texture2D_initWithPVRTCData);return!1},setTexParameters:function(a,c,d,e){void 0!==c&&(a={minFilter:a,magFilter:c,wrapS:d,wrapT:e});this._pattern=a.wrapS===cc.REPEAT&&a.wrapT===cc.REPEAT? "repeat":a.wrapS===cc.REPEAT?"repeat-x":a.wrapT===cc.REPEAT?"repeat-y":""},setAntiAliasTexParameters:function(){},setAliasTexParameters:function(){},generateMipmap:function(){},stringForFormat:function(){return""},bitsPerPixelForFormat:function(a){return-1},addLoadedEventListener:function(a,c){this.addEventListener("load",a,c)},removeLoadedEventListener:function(a){this.removeEventTarget("load",a)},_generateColorTexture:function(){},_generateTextureCacheForColor:function(){if(this.channelCache)return this.channelCache; var a=[document.createElement("canvas"),document.createElement("canvas"),document.createElement("canvas"),document.createElement("canvas")],c=this._htmlElementObj,d=c.width,e=c.height;a[0].width=d;a[0].height=e;a[1].width=d;a[1].height=e;a[2].width=d;a[2].height=e;a[3].width=d;a[3].height=e;var f=a[3].getContext("2d");f.drawImage(c,0,0);for(var f=f.getImageData(0,0,d,e).data,g,h=0;4>h;h++){g=a[h].getContext("2d");for(var k=g.getImageData(0,0,d,e),m=k.data,n=0;nthis._capacity)cc.log(cc._LogInfos.TextureAtlas_insertQuad);else{var c=cc.V3F_C4B_T2F_Quad.BYTES_PER_ELEMENT,d=b*c,e=(this._totalQuads- 1-b)*c;this._quads[this._totalQuads-1]=new cc.V3F_C4B_T2F_Quad(null,null,null,null,this._quadsArrayBuffer,(this._totalQuads-1)*c);this._quadsReader.set(this._quadsReader.subarray(d,d+e),d+c);this._setQuadToArray(a,b);this.dirty=!0}},insertQuads:function(a,b,c){c=c||a.length;cc.assert(b+c<=this._capacity,cc._LogInfos.TextureAtlas_insertQuads);var d=cc.V3F_C4B_T2F_Quad.BYTES_PER_ELEMENT;this._totalQuads+=c;if(this._totalQuads>this._capacity)cc.log(cc._LogInfos.TextureAtlas_insertQuad);else{var e=b* d,f=(this._totalQuads-1-b-c)*d,g=this._totalQuads-1-c,h;for(h=0;hb?(f=b*c,d.set(d.subarray(f,f+(a-b)*c),f+c),d.set(e,f)):(f=(a+1)*c,d.set(d.subarray(f,f+(b-a)*c),f-c),d.set(e,b*c));this.dirty=!0}},removeQuadAtIndex:function(a){cc.assert(ac){f=[];g=new ArrayBuffer(b*d);for(a=0;ac?(b=new Uint16Array(6*d),b.set(this._indices,0),this._indices=b):this._indices=this._indices.subarray(0,6*d);this._setupIndices();this._mapBuffers(); return this.dirty=!0},increaseTotalQuadsWith:function(a){this._totalQuads+=a},moveQuadsFromIndex:function(a,b,c){if(void 0===c){if(c=b,b=this._totalQuads-a,cc.assert(c+(this._totalQuads-a)<=this._capacity,cc._LogInfos.TextureAtlas_moveQuadsFromIndex),0===b)return}else if(cc.assert(c+b<=this._totalQuads,cc._LogInfos.TextureAtlas_moveQuadsFromIndex_2),cc.assert(af._localZOrder)f.visit(this);else break;for(b.pushRenderCommand(c);achild._localZOrder)child.visit(this);else break;for(b.pushRenderCommand(c);a=this._layers.length?cc.log(cc._LogInfos.LayerMultiplex_switchTo):(this.removeChild(this._layers[this._enabledLayer],!0),this._enabledLayer=a,this.addChild(this._layers[a]))},switchToAndReleaseMe:function(a){a>=this._layers.length?cc.log(cc._LogInfos.LayerMultiplex_switchToAndReleaseMe):(this.removeChild(this._layers[this._enabledLayer],!0),this._layers[this._enabledLayer]=null,this._enabledLayer=a,this.addChild(this._layers[a]))},addLayer:function(a){a?this._layers.push(a): cc.log(cc._LogInfos.LayerMultiplex_addLayer)}});cc.LayerMultiplex.create=function(){return new cc.LayerMultiplex(Array.prototype.slice.call(arguments))};(function(){cc.Layer.CanvasRenderCmd=function(a){this._rootCtor(a);this._isBaked=!1;this._bakeSprite=null;this._canUseDirtyRegion=!0;this._updateCache=2};var a=cc.Layer.CanvasRenderCmd.prototype=Object.create(cc.Node.CanvasRenderCmd.prototype);a.constructor=cc.Layer.CanvasRenderCmd;a._layerCmdCtor=cc.Layer.CanvasRenderCmd;a._setCacheDirty=function(a){a&&0===this._updateCache&&(this._updateCache=2);!1===this._cacheDirty&&(this._cacheDirty=!0,(a=this._cachedParent)&&a!==this&&a._setNodeDirtyForCache&& a._setNodeDirtyForCache())};a.updateStatus=function(){var a=cc.Node._dirtyFlags;this._dirtyFlag&a.orderDirty&&(this._cacheDirty=!0,0===this._updateCache&&(this._updateCache=2),this._dirtyFlag&=~a.orderDirty);this.originUpdateStatus()};a._syncStatus=function(a){var c=cc.Node._dirtyFlags,d=this._dirtyFlag;if(this._isBaked||d&c.orderDirty)this._cacheDirty=!0,0===this._updateCache&&(this._updateCache=2),this._dirtyFlag&=~c.orderDirty;this._originSyncStatus(a)};a.transform=function(a,c){this._worldTransform|| (this._worldTransform={a:1,b:0,c:0,d:1,tx:0,ty:0});var d=this._worldTransform,e=d.a,f=d.b,g=d.c,h=d.d;this.originTransform(a,c);d.a===e&&d.b===f&&d.c===g&&d.d===h||0!==this._updateCache||(this._updateCache=2)};a.bake=function(){if(!this._isBaked){this._needDraw=!0;this._isBaked=this._cacheDirty=cc.renderer.childrenOrderDirty=!0;0===this._updateCache&&(this._updateCache=2);for(var a=this._node._children,c=0,d=a.length;ch._localZOrder)h.visit(a);else break;for(cc.renderer.pushRenderCommand(this);ec;c++)a[4*c+3]=this._color[0];this._dataDirty=!0};a.rendering=function(a){a=a||cc._renderContext; var c=this._node;this._matrix||(this._matrix=new cc.math.Matrix4,this._matrix.identity());var d=this._worldTransform;this._matrix.mat[0]=d.a;this._matrix.mat[4]=d.c;this._matrix.mat[12]=d.tx;this._matrix.mat[1]=d.b;this._matrix.mat[5]=d.d;this._matrix.mat[13]=d.ty;this._dataDirty&&(this._vertexBuffer||(this._vertexBuffer=a.createBuffer()),a.bindBuffer(a.ARRAY_BUFFER,this._vertexBuffer),a.bufferData(a.ARRAY_BUFFER,this._data,a.DYNAMIC_DRAW),this._dataDirty=!1);this._shaderProgram.use();this._shaderProgram._setUniformForMVPMatrixWithMat4(this._matrix); cc.glBlendFunc(c._blendFunc.src,c._blendFunc.dst);a.bindBuffer(a.ARRAY_BUFFER,this._vertexBuffer);a.enableVertexAttribArray(cc.VERTEX_ATTRIB_POSITION);a.enableVertexAttribArray(cc.VERTEX_ATTRIB_COLOR);a.vertexAttribPointer(cc.VERTEX_ATTRIB_POSITION,3,a.FLOAT,!1,16,0);a.vertexAttribPointer(cc.VERTEX_ATTRIB_COLOR,4,a.UNSIGNED_BYTE,!0,16,12);a.drawArrays(a.TRIANGLE_STRIP,0,4)};a.updateBlendFunc=function(a){}})(); (function(){cc.LayerGradient.WebGLRenderCmd=function(a){cc.LayerColor.WebGLRenderCmd.call(this,a);this._needDraw=!0;this._clipRect=new cc.Rect;this._clippingRectDirty=!1};var a=cc.LayerGradient.WebGLRenderCmd.prototype=Object.create(cc.LayerColor.WebGLRenderCmd.prototype);a.constructor=cc.LayerGradient.WebGLRenderCmd;a.updateStatus=function(){var a=cc.Node._dirtyFlags;this._dirtyFlag&a.gradientDirty&&(this._dirtyFlag|=a.colorDirty,this._updateVertex(),this._dirtyFlag&=~a.gradientDirty);this.originUpdateStatus()}; a._syncStatus=function(a){var c=cc.Node._dirtyFlags;this._dirtyFlag&c.gradientDirty&&(this._dirtyFlag|=c.colorDirty,this._updateVertex(),this._dirtyFlag&=~c.gradientDirty);this._originSyncStatus(a)};a.transform=function(a,c){this.originTransform(a,c);this._updateVertex()};a._updateVertex=function(){var a=this._node,c=a._colorStops;if(c&&!(2>c.length)){this._clippingRectDirty=!0;var d,e=c.length,f=2*e,g=a._contentSize;this._positionView.length/4d?(m=cc.p(-f.x,f.y),d=cc.p(f.x,f.y)):180>d?(m=cc.p(f.x,f.y),d=cc.p(f.x,-f.y)):270>d?(m=cc.p(f.x,-f.y),d=cc.p(-f.x,-f.y)):(m=cc.p(-f.x,-f.y),d=cc.p(-f.x,f.y));var n=Math.sin(h),h=Math.cos(h);m=Math.abs((m.x*h-m.y*n)/f.x);d=Math.abs((d.x*n+d.y*h)/f.y);k=cc.affineTransformScale(k,m,d);n=this._positionView;for(d=0;da.length)){var c=a.length,d,e=this._colorView,f=this._displayedOpacity/255;for(i=0;ia.width&&cc.error(cc._LogInfos.RectWidth,a.url),d>a.height&&cc.error(cc._LogInfos.RectHeight, a.url))};a.rendering=function(a,c,d){var e=this._node,f=this._textureCoord,g=this._displayedOpacity/255,h=this._textureToRender||e._texture;if((!h||0!==f.width&&0!==f.height&&h._textureLoaded)&&0!==g){a=a||cc._renderContext;var k=a.getContext(),m=e._offsetPosition.x,n=e._rect.height,p=e._rect.width,r=-e._offsetPosition.y-n;a.setTransform(this._worldTransform,c,d);a.setCompositeOperation(this._blendFuncStr);a.setGlobalAlpha(g);(e._flippedX||e._flippedY)&&a.save();e._flippedX&&(m=-m-p,k.scale(-1,1)); e._flippedY&&(r=e._offsetPosition.y,k.scale(1,-1));var s,u,t;this._colorized?s=g=0:(g=f.renderX,s=f.renderY);u=f.width;t=f.height;h&&h._htmlElementObj?(c=h._htmlElementObj,""!==h._pattern?(a.setFillStyle(k.createPattern(c,h._pattern)),k.fillRect(m,r,p,n)):k.drawImage(c,g,s,u,t,m,r,p,n)):(h=e._contentSize,f.validRect&&(f=this._displayedColor,a.setFillStyle("rgba("+f.r+","+f.g+","+f.b+",1)"),k.fillRect(m,r,h.width*c,h.height*d)));(e._flippedX||e._flippedY)&&a.restore();cc.g_NumberOfDraws++}};a._updateColor= function(){var a=this._node._texture,c=this._textureCoord,d=this._displayedColor;a&&(255!==d.r||255!==d.g||255!==d.b?(this._textureToRender=a._generateColorTexture(d.r,d.g,d.b,c),this._colorized=!0):a&&(this._textureToRender=a,this._colorized=!1))};a._textureLoadedCallback=function(a){if(!this._textureLoaded){this._textureLoaded=!0;var c=this._rect,d=this._renderCmd;c?cc._rectEqualToZero(c)&&(c.width=a.width,c.height=a.height):c=cc.rect(0,0,a.width,a.height);this.texture=a;this.setTextureRect(c,this._rectRotated); a=d._displayedColor;255===a.r&&255===a.g&&255===a.b||d._updateColor();this.setBatchNode(this._batchNode);this.dispatchEvent("load")}};a._setTextureCoords=function(a,c){void 0===c&&(c=!0);var d=this._textureCoord,e=c?cc.contentScaleFactor():1;d.renderX=d.x=0|a.x*e;d.renderY=d.y=0|a.y*e;d.width=0|a.width*e;d.height=0|a.height*e;d.validRect=!(0===d.width||0===d.height||0>d.x||0>d.y)};cc.Sprite.CanvasRenderCmd._cutRotateImageToCanvas=function(a,c,d){if(!a)return null;if(!c)return a;d=null==d?!0:d;var e= document.createElement("canvas");e.width=c.width;e.height=c.height;var f=e.getContext("2d");f.translate(e.width/2,e.height/2);d?f.rotate(-1.5707963267948966):f.rotate(1.5707963267948966);f.drawImage(a,c.x,c.y,c.height,c.width,-c.height/2,-c.width/2,c.height,c.width);return e}})();(function(){cc.Sprite.WebGLRenderCmd=function(a){this._rootCtor(a);this._needDraw=!0;this._vertices=[{x:0,y:0,u:0,v:0},{x:0,y:0,u:0,v:0},{x:0,y:0,u:0,v:0},{x:0,y:0,u:0,v:0}];this._color=new Uint32Array(1);this._recursiveDirty=this._dirty=!1;this._shaderProgram=cc.shaderCache.programForKey(cc.SHADER_SPRITE_POSITION_TEXTURECOLOR)};var a=cc.Sprite.WebGLRenderCmd.prototype=Object.create(cc.Node.WebGLRenderCmd.prototype);a.constructor=cc.Sprite.WebGLRenderCmd;a._spriteCmdCtor=cc.Sprite.WebGLRenderCmd; a.updateBlendFunc=function(a){};a.setDirtyFlag=function(a){cc.Node.WebGLRenderCmd.prototype.setDirtyFlag.call(this,a);this._dirty=!0};a.setDirtyRecursively=function(a){this._dirty=this._recursiveDirty=a;for(var c=this._node._children,d,e=c?c.length:0,f=0;fa.width&&cc.error(cc._LogInfos.RectWidth,a.url),c>a.height&&cc.error(cc._LogInfos.RectHeight,a.url))};a.transform=function(a,c){this.originTransform(a,c);var d=this._node,e=d._offsetPosition.x, f=e+d._rect.width,g=d._offsetPosition.y,h=g+d._rect.height,k=this._worldTransform,d=k.tx,m=k.ty,n=e*k.a,e=e*k.b,p=f*k.a,f=f*k.b,r=h*k.c,h=h*k.d,s=g*k.c,g=g*k.d,k=this._vertices;k[0].x=n+r+d;k[0].y=e+h+m;k[1].x=n+s+d;k[1].y=e+g+m;k[2].x=p+r+d;k[2].y=f+h+m;k[3].x=p+s+d;k[3].y=f+g+m};a.needDraw=function(){var a=this._node._texture;return this._needDraw&&a};a.uploadData=function(a,c,d){var e=this._node,f=e._texture;if(!(f&&f._textureLoaded&&e._rect.width&&e._rect.height&&this._displayedOpacity))return!1; var f=this._displayedOpacity,g=this._displayedColor.r,h=this._displayedColor.g,k=this._displayedColor.b;if(e._opacityModifyRGB)var m=f/255,g=g*m,h=h*m,k=k*m;this._color[0]=f<<24|k<<16|h<<8|g;e=e._vertexZ;f=this._vertices;g=f.length;k=d;for(d=0;da.getPixelsWide()&&cc.error(cc._LogInfos.RectWidth,a.url);g>a.getPixelsHigh()&&cc.error(cc._LogInfos.RectHeight,a.url)}this._offsetInPixels.x= d.x;this._offsetInPixels.y=d.y;cc._pointPixelsToPointsOut(d,this._offset);this._originalSizeInPixels.width=e.width;this._originalSizeInPixels.height=e.height;cc._sizePixelsToPointsOut(e,this._originalSize);this._rotated=c;return!0}});cc.EventHelper.prototype.apply(cc.SpriteFrame.prototype);cc.SpriteFrame.create=function(a,b,c,d,e){return new cc.SpriteFrame(a,b,c,d,e)};cc.SpriteFrame.createWithTexture=cc.SpriteFrame.create; cc.SpriteFrame._frameWithTextureForCanvas=function(a,b,c,d,e){var f=new cc.SpriteFrame;f._texture=a;f._rectInPixels=b;f._rect=cc.rectPixelsToPoints(b);f._offsetInPixels.x=d.x;f._offsetInPixels.y=d.y;cc._pointPixelsToPointsOut(f._offsetInPixels,f._offset);f._originalSizeInPixels.width=e.width;f._originalSizeInPixels.height=e.height;cc._sizePixelsToPointsOut(f._originalSizeInPixels,f._originalSize);f._rotated=c;return f};cc.spriteFrameCache={_CCNS_REG1:/^\s*\{\s*([\-]?\d+[.]?\d*)\s*,\s*([\-]?\d+[.]?\d*)\s*\}\s*$/,_CCNS_REG2:/^\s*\{\s*\{\s*([\-]?\d+[.]?\d*)\s*,\s*([\-]?\d+[.]?\d*)\s*\}\s*,\s*\{\s*([\-]?\d+[.]?\d*)\s*,\s*([\-]?\d+[.]?\d*)\s*\}\s*\}\s*$/,_spriteFrames:{},_spriteFramesAliases:{},_frameConfigCache:{},_rectFromString:function(a){return(a=this._CCNS_REG2.exec(a))?cc.rect(parseFloat(a[1]),parseFloat(a[2]),parseFloat(a[3]),parseFloat(a[4])):cc.rect(0,0,0,0)},_pointFromString:function(a){return(a=this._CCNS_REG1.exec(a))? cc.p(parseFloat(a[1]),parseFloat(a[2])):cc.p(0,0)},_sizeFromString:function(a){return(a=this._CCNS_REG1.exec(a))?cc.size(parseFloat(a[1]),parseFloat(a[2])):cc.size(0,0)},_getFrameConfig:function(a){var b=cc.loader.getRes(a);cc.assert(b,cc._LogInfos.spriteFrameCache__getFrameConfig_2,a);cc.loader.release(a);if(b._inited)return this._frameConfigCache[a]=b;this._frameConfigCache[a]=this._parseFrameConfig(b);return this._frameConfigCache[a]},_getFrameConfigByJsonObject:function(a,b){cc.assert(b,cc._LogInfos.spriteFrameCache__getFrameConfig_2, a);this._frameConfigCache[a]=this._parseFrameConfig(b);return this._frameConfigCache[a]},_parseFrameConfig:function(a){var b=a.frames,c=a.metadata||a.meta;a={};var d={},e=0;c&&(e=c.format,e=1>=e.length?parseInt(e):e,d.image=c.textureFileName||c.textureFileName||c.image);for(var f in b){var g=b[f];if(g){c={};if(0==e){c.rect=cc.rect(g.x,g.y,g.width,g.height);c.rotated=!1;c.offset=cc.p(g.offsetX,g.offsetY);var h=g.originalWidth,g=g.originalHeight;h&&g||cc.log(cc._LogInfos.spriteFrameCache__getFrameConfig); h=Math.abs(h);g=Math.abs(g);c.size=cc.size(h,g)}else if(1==e||2==e)c.rect=this._rectFromString(g.frame),c.rotated=g.rotated||!1,c.offset=this._pointFromString(g.offset),c.size=this._sizeFromString(g.sourceSize);else if(3==e){var h=this._sizeFromString(g.spriteSize),k=this._rectFromString(g.textureRect);h&&(k=cc.rect(k.x,k.y,h.width,h.height));c.rect=k;c.rotated=g.textureRotated||!1;c.offset=this._pointFromString(g.spriteOffset);c.size=this._sizeFromString(g.spriteSourceSize);c.aliases=g.aliases}else h= g.frame,k=g.sourceSize,f=g.filename||f,c.rect=cc.rect(h.x,h.y,h.w,h.h),c.rotated=g.rotated||!1,c.offset=cc.p(0,0),c.size=cc.size(k.w,k.h);a[f]=c}}return{_inited:!0,frames:a,meta:d}},_addSpriteFramesByObject:function(a,b,c){cc.assert(a,cc._LogInfos.spriteFrameCache_addSpriteFrames_2);b&&b.frames&&(b=this._frameConfigCache[a]||this._getFrameConfigByJsonObject(a,b),this._createSpriteFrames(a,b,c))},_createSpriteFrames:function(a,b,c){var d=b.frames;b=b.meta;c?c instanceof cc.Texture2D||(cc.isString(c)? c=cc.textureCache.addImage(c):cc.assert(0,cc._LogInfos.spriteFrameCache_addSpriteFrames_3)):(c=cc.path.changeBasename(a,b.image||".png"),c=cc.textureCache.addImage(c));a=this._spriteFramesAliases;b=this._spriteFrames;for(var e in d){var f=d[e],g=b[e];if(!g){g=new cc.SpriteFrame(c,f.rect,f.rotated,f.offset,f.size);if(f=f.aliases)for(var h=0,k=f.length;h=c)){for(;c>a;){var d=b.pop();d.running&&(d._performRecursive(cc.Node._stateCallbackType.onExitTransitionDidStart),d._performRecursive(cc.Node._stateCallbackType.onExit));d._performRecursive(cc.Node._stateCallbackType.cleanup);c--}this._nextScene=b[b.length-1];this._sendCleanupToScene=!0}},getScheduler:function(){return this._scheduler}, setScheduler:function(a){this._scheduler!==a&&(this._scheduler=a)},getActionManager:function(){return this._actionManager},setActionManager:function(a){this._actionManager!==a&&(this._actionManager=a)},getDeltaTime:function(){return this._deltaTime},_calculateMPF:function(){this._secondsPerFrame=(Date.now()-this._lastUpdate)/1E3}});cc.Director.EVENT_PROJECTION_CHANGED="director_projection_changed";cc.Director.EVENT_AFTER_UPDATE="director_after_update";cc.Director.EVENT_AFTER_VISIT="director_after_visit"; cc.Director.EVENT_AFTER_DRAW="director_after_draw";cc.DisplayLinkDirector=cc.Director.extend({invalid:!1,startAnimation:function(){this._nextDeltaTimeZero=!0;this.invalid=!1},mainLoop:function(){this._purgeDirectorInNextLoop?(this._purgeDirectorInNextLoop=!1,this.purgeDirector()):this.invalid||this.drawScene()},stopAnimation:function(){this.invalid=!0},setAnimationInterval:function(a){this._animationInterval=a;this.invalid||(this.stopAnimation(),this.startAnimation())}}); cc.Director.sharedDirector=null;cc.Director.firstUseDirector=!0;cc.Director._getInstance=function(){cc.Director.firstUseDirector&&(cc.Director.firstUseDirector=!1,cc.Director.sharedDirector=new cc.DisplayLinkDirector,cc.Director.sharedDirector.init());return cc.Director.sharedDirector};cc.defaultFPS=60;cc.Director.PROJECTION_2D=0;cc.Director.PROJECTION_3D=1;cc.Director.PROJECTION_CUSTOM=3;cc.Director.PROJECTION_DEFAULT=cc.Director.PROJECTION_2D;cc.game.addEventListener(cc.game.EVENT_RENDERER_INITED,function(){if(cc._renderType===cc.game.RENDER_TYPE_CANVAS){var a=cc.Director.prototype;a.getProjection=function(a){return this._projection};a.setProjection=function(a){this._projection=a;cc.eventManager.dispatchEvent(this._eventProjectionChanged)};a.setDepthTest=function(){};a.setClearColor=function(a){cc.renderer._clearColor=a;cc.renderer._clearFillStyle="rgb("+a.r+","+a.g+","+a.b+")"};a.setOpenGLView=function(a){this._winSizeInPoints.width= cc._canvas.width;this._winSizeInPoints.height=cc._canvas.height;this._openGLView=a||cc.view;cc.eventManager&&cc.eventManager.setEnabled(!0)};a.getVisibleSize=function(){return this.getWinSize()};a.getVisibleOrigin=function(){return cc.p(0,0)}}else cc.Director._fpsImage=new Image,cc.Director._fpsImage.addEventListener("load",function(){cc.Director._fpsImageLoaded=!0}),cc._fpsImage&&(cc.Director._fpsImage.src=cc._fpsImage)});cc.game.addEventListener(cc.game.EVENT_RENDERER_INITED,function(){if(cc._renderType===cc.game.RENDER_TYPE_WEBGL){cc.DirectorDelegate=cc.Class.extend({updateProjection:function(){}});var a=cc.Director.prototype,b=function(a){if(a&&a._renderCmd){a._renderCmd.setDirtyFlag(cc.Node._dirtyFlags.transformDirty);var d=a._children;for(a=0;ab.length&&b.push(a)};var c=function(a,b,c,d){this.list= a;this.entry=b;this.target=c;this.callback=d},d=[];c.get=function(a,b,e,f){var g=d.pop();g?(g.list=a,g.entry=b,g.target=e,g.callback=f):g=new c(a,b,e,f);return g};c.put=function(a){a.list=null;a.entry=null;a.target=null;a.callback=null;20>d.length&&d.push(a)};var e=function(a,b,c,d,e,f){this.timers=a;this.target=b;this.timerIndex=c;this.currentTimer=d;this.currentTimerSalvaged=e;this.paused=f},f=[];e.get=function(a,b,c,d,g,h){var u=f.pop();u?(u.timers=a,u.target=b,u.timerIndex=c,u.currentTimer=d, u.currentTimerSalvaged=g,u.paused=h):u=new e(a,b,c,d,g,h);return u};e.put=function(a){a.timers=null;a.target=null;a.timerIndex=0;a.currentTimer=null;a.currentTimerSalvaged=!1;a.paused=!1;20>f.length&&f.push(a)};var g=function(){this._scheduler=null;this._elapsed=-1;this._useDelay=this._runForever=!1;this._interval=this._delay=this._repeat=this._timesExecuted=0;this._key=this._callback=this._target=null};cc.inject({initWithCallback:function(a,b,c,d,e,f,g){this._scheduler=a;this._target=c;this._callback= b;g&&(this._key=g);this._elapsed=-1;this._interval=d;this._delay=f;this._useDelay=0=this._interval&&(this.trigger(),this._elapsed=0):(this._useDelay?this._elapsed>=this._delay&& (this.trigger(),this._elapsed-=this._delay,this._timesExecuted+=1,this._useDelay=!1):this._elapsed>=this._interval&&(this.trigger(),this._elapsed=0,this._timesExecuted+=1),b!=this._key?this._elapsed=-1:this._callback&&!this._runForever&&this._timesExecuted>this._repeat&&this.cancel()))},getCallback:function(){return this._callback},getKey:function(){return this._key},trigger:function(){this._target&&this._callback&&this._callback.call(this._target,this._elapsed)},cancel:function(){this._scheduler.unschedule(this._callback, this._target)}},g.prototype);var h=[];g.get=function(){return h.pop()||new g};g.put=function(a){a._scheduler=null;a._elapsed=-1;a._runForever=!1;a._useDelay=!1;a._timesExecuted=0;a._repeat=0;a._delay=0;a._interval=0;a._target=null;a._callback=null;a._key=null;20>h.length&&h.push(a)};cc.Scheduler=cc.Class.extend({_timeScale:1,_updatesNegList:null,_updates0List:null,_updatesPosList:null,_hashForTimers:null,_arrayForTimers:null,_hashForUpdates:null,_currentTarget:null,_currentTargetSalvaged:!1,_updateHashLocked:!1, ctor:function(){this._timeScale=1;this._updatesNegList=[];this._updates0List=[];this._updatesPosList=[];this._hashForUpdates={};this._hashForTimers={};this._currentTarget=null;this._updateHashLocked=this._currentTargetSalvaged=!1;this._arrayForTimers=[]},_schedulePerFrame:function(a,b,c,d){var e=this._hashForUpdates[b.__instanceId];if(e&&e.entry)if(e.entry.priority!==c){if(this._updateHashLocked){cc.log("warning: you CANNOT change update priority in scheduled function");e.entry.markedForDeletion= !1;e.entry.paused=d;return}this.unscheduleUpdate(b)}else{e.entry.markedForDeletion=!1;e.entry.paused=d;return}0===c?this._appendIn(this._updates0List,a,b,d):0>c?this._priorityIn(this._updatesNegList,a,b,c,d):this._priorityIn(this._updatesPosList,a,b,c,d)},_removeHashElement:function(a){delete this._hashForTimers[a.target.__instanceId];for(var b=this._arrayForTimers,c=0,d=b.length;c=e&&c.timerIndex--;0===d.length&&(this._currentTarget===c?this._currentTargetSalvaged=!0:this._removeHashElement(c));break}}}},unscheduleUpdate:function(a){a&&(a=this._hashForUpdates[a.__instanceId])&&(this._updateHashLocked?a.entry.markedForDeletion=!0:this._removeUpdateFromHash(a.entry))},unscheduleAllForTarget:function(a){if(a){var b=this._hashForTimers[a.__instanceId];if(b){var c=b.timers;-1a)for(b=0;b=a&&this.unscheduleUpdate(c.target),d==this._updatesNegList.length&&b++;if(0>=a)for(b=0;b=a&&this.unscheduleUpdate(c.target),d==this._updatesPosList.length&&b++},isScheduled:function(a,b){cc.assert(a,"Argument callback must not be empty"); cc.assert(b,"Argument target must be non-nullptr");var c=this._hashForTimers[b.__instanceId];if(!c)return!1;if(null!=c.timers)for(var c=c.timers,d=0;da)for(e=0;e=a&&(c.paused=!0,b.push(c.target));if(0>=a)for(e=0;e=a&&(c.paused=!0,b.push(c.target));return b},resumeTargets:function(a){if(a)for(var b=0;ba.length)throw Error("Polygon's point must greater than 2");var e=a[0];b=this._renderContext.getContext();cc.view.getScaleX();cc.view.getScaleY();b.beginPath();b.moveTo(e.x,-e.y);for(var e=1,f=a.length;e\u3001\u2018\u201c\u300b\uff1f\u3002\uff0c\uff01]/;cc.LabelTTF._lastWordRex=/([a-zA-Z0-9\u00c4\u00d6\u00dc\u00e4\u00f6\u00fc\u00df\u00e9\u00e8\u00e7\u00e0\u00f9\u00ea\u00e2\u00ee\u00f4\u00fb]+|\S)$/; cc.LabelTTF._lastEnglish=/[a-zA-Z0-9\u00c4\u00d6\u00dc\u00e4\u00f6\u00fc\u00df\u00e9\u00e8\u00e7\u00e0\u00f9\u00ea\u00e2\u00ee\u00f4\u00fb]+$/;cc.LabelTTF._firsrEnglish=/^[a-zA-Z0-9\u00c4\u00d6\u00dc\u00e4\u00f6\u00fc\u00df\u00e9\u00e8\u00e7\u00e0\u00f9\u00ea\u00e2\u00ee\u00f4\u00fb]/; (function(){cc.LabelTTF.RenderCmd=function(){this._fontClientHeight=18;this._fontStyleStr="";this._shadowColorStr="rgba(128, 128, 128, 0.5)";this._strokeColorStr="";this._fillColorStr="rgba(255,255,255,1)";this._labelContext=this._labelCanvas=null;this._lineWidths=[];this._strings=[];this._isMultiLine=!1;this._status=[];this._renderingIndex=0;this._canUseDirtyRegion=!0};var a=cc.LabelTTF.RenderCmd.prototype;a.constructor=cc.LabelTTF.RenderCmd;a._labelCmdCtor=cc.LabelTTF.RenderCmd;a._setFontStyle= function(a,b,e,f){if(a instanceof cc.FontDefinition)this._fontStyleStr=a._getCanvasFontStr(),this._fontClientHeight=cc.LabelTTF.__getFontHeightByDiv(a);else{var g=b*cc.view.getDevicePixelRatio();this._fontStyleStr=e+" "+f+" "+g+"px '"+a+"'";this._fontClientHeight=cc.LabelTTF.__getFontHeightByDiv(a,b)}};a._getFontStyle=function(){return this._fontStyleStr};a._getFontClientHeight=function(){return this._fontClientHeight};a._updateColor=function(){this._setColorsString();this._updateTexture()};a._setColorsString= function(){var a=this._displayedColor,b=this._node,e=b._shadowColor||this._displayedColor,f=b._strokeColor,g=b._textFillColor,h=a.r/255,k=a.g/255,a=a.b/255;this._shadowColorStr="rgba("+(0|h*e.r)+","+(0|k*e.g)+","+(0|a*e.b)+","+b._shadowOpacity+")";this._fillColorStr="rgba("+(0|h*g.r)+","+(0|k*g.g)+","+(0|a*g.b)+", 1)";this._strokeColorStr="rgba("+(0|h*f.r)+","+(0|k*f.g)+","+(0|a*f.b)+", 1)"};var b=new cc.Rect;a.getLocalBB=function(){var a=this._node;b.x=b.y=0;var d=cc.view.getDevicePixelRatio();b.width= a._getWidth()*d;b.height=a._getHeight()*d;return b};a._updateTTF=function(){var a=this._node,b=cc.view.getDevicePixelRatio(),e=a._dimensions.width*b,f,g,h=this._lineWidths;h.length=0;this._isMultiLine=!1;this._measureConfig();var k={};if(0!==e)for(this._strings=a._string.split("\n"),f=0;fe&&1e&&100>r++;)h*=e/m,h|=0,k=f.substr(h), m=g-this._measure(k);for(r=0;mr++;)k&&(p=(n=cc.LabelTTF._wordRex.exec(k))?n[0].length:1,n=k),h+=p,k=f.substr(h),m=g-this._measure(k);h-=p;0===h&&(h=1,n=n.substr(1));e=f.substr(0,h);cc.LabelTTF.wrapInspection&&cc.LabelTTF._symbolRex.test(n||k)&&(g=cc.LabelTTF._lastWordRex.exec(e),h-=g?g[0].length:0,0===h&&(h=1),n=f.substr(h),e=f.substr(0,h));cc.LabelTTF._firsrEnglish.test(n)&&(g=cc.LabelTTF._lastEnglish.exec(e))&&e!==g[0]&&(h-=g[0].length,n=f.substr(h),e=f.substr(0,h));a[b]=n||k;a.splice(b, 0,e)}};a.updateStatus=function(){this._dirtyFlag&cc.Node._dirtyFlags.textDirty&&this._updateTexture();this.originUpdateStatus()};a._syncStatus=function(a){var b=cc.Node._dirtyFlags,e=this._dirtyFlag;e&b.textDirty&&this._updateTexture();this._originSyncStatus(a);(cc._renderType===cc.game.RENDER_TYPE_WEBGL||e&b.transformDirty)&&this.transform(a)};a.drawLabels=function(a,b,e){var f=this._node;if(f._shadowEnabled){var g=f._shadowOffset;a.shadowColor=this._shadowColorStr;a.shadowOffsetX=g.x;a.shadowOffsetY= -g.y;a.shadowBlur=f._shadowBlur}var g=f._hAlignment,h=f._vAlignment,k=f._strokeSize;a.font!==this._fontStyleStr&&(a.font=this._fontStyleStr);a.fillStyle=this._fillColorStr;if(f=f._strokeEnabled)a.lineWidth=2*k,a.strokeStyle=this._strokeColorStr;a.textBaseline=cc.LabelTTF._textBaseline[h];a.textAlign=cc.LabelTTF._textAlign[g];g=this._strings.length;for(h=0;h=this._status.length)){var g= this._renderingIndex>=this._status.length?this._renderingIndex-this._status.length:this._renderingIndex,h=this._status[g];this._renderingIndex=g+1;var k=f._offsetPosition.x,g=-f._offsetPosition.y-f._rect.height,m=this._displayedOpacity/255;a.setTransform(this._worldTransform,c,d);a.setCompositeOperation(this._blendFuncStr);a.setGlobalAlpha(m);a.save();f._flippedX&&(k=-k-f._rect.width,e.scale(-1,1));f._flippedY&&(g=f._offsetPosition.y,e.scale(1,-1));c=h.xOffset+h.contextTransform.x+k*c;f=[];k=this._strings.length; for(m=0;m=a&&b.actionIndex--;0===b.actions.length&&(this._currentTarget===b?this._currentTargetSalvaged=!0:this._deleteHashElement(b))},_deleteHashElement:function(a){var b=!1;if(a&&this._hashTargets[a.target.__instanceId]){delete this._hashTargets[a.target.__instanceId];for(var b=this._arrayTargets,c=0,d=b.length;cx;++x){var B=w[x].style;B.color="rgb(0, 255, 255)";B.font="bold 12px Helvetica, Arial";B.lineHeight="20px";B.width="100%";n.appendChild(w[x])}var y=function(){e=cc.director.getSecondsPerFrame();c++;f+=cc.director.getDeltaTime();if(f>cc.DIRECTOR_FPS_INTERVAL){d=c/f;f=c=0;if(z.onFrameRateChange){var b=d,g=r.length-1,n=g,w=0;t++;for(v+=b;0<=n;n--)if(b>=r[n]){s[n]++;break}if(t>=p){w=v/p;for(n=g;0=r[n]){n!=u&&(u=n,z.onFrameRateChange&&z.onFrameRateChange(w.toFixed(2))); break}v=t=_changeCount=0;for(n=g;0b&&a-cc.math.EPSILONb.x-a.math.EPSILON&&this.yb.y-a.math.EPSILON}})(cc);(function(a){a.math.Vec3=a.kmVec3=function(a,b,e){a&&void 0===b?(this.x=a.x,this.y=a.y,this.z=a.z):(this.x=a||0,this.y=b||0,this.z=e||0)};a.math.vec3=function(b,d,e){return new a.math.Vec3(b,d,e)};var b=a.math.Vec3.prototype;b.fill=function(a,b,e){a&&void 0===b?(this.x=a.x,this.y=a.y,this.z=a.z):(this.x=a,this.y=b,this.z=e);return this};b.length=function(){return Math.sqrt(a.math.square(this.x)+a.math.square(this.y)+a.math.square(this.z))};b.lengthSq=function(){return a.math.square(this.x)+a.math.square(this.y)+ a.math.square(this.z)};b.normalize=function(){var a=1/this.length();this.x*=a;this.y*=a;this.z*=a;return this};b.cross=function(a){var b=this.x,e=this.y,f=this.z;this.x=e*a.z-f*a.y;this.y=f*a.x-b*a.z;this.z=b*a.y-e*a.x;return this};b.dot=function(a){return this.x*a.x+this.y*a.y+this.z*a.z};b.add=function(a){this.x+=a.x;this.y+=a.y;this.z+=a.z;return this};b.subtract=function(a){this.x-=a.x;this.y-=a.y;this.z-=a.z;return this};b.transform=function(a){var b=this.x,e=this.y,f=this.z;a=a.mat;this.x=b* a[0]+e*a[4]+f*a[8]+a[12];this.y=b*a[1]+e*a[5]+f*a[9]+a[13];this.z=b*a[2]+e*a[6]+f*a[10]+a[14];return this};b.transformNormal=function(a){var b=this.x,e=this.y,f=this.z;a=a.mat;this.x=b*a[0]+e*a[4]+f*a[8];this.y=b*a[1]+e*a[5]+f*a[9];this.z=b*a[2]+e*a[6]+f*a[10];return this};b.transformCoord=function(b){var d=new a.math.Vec4(this.x,this.y,this.z,1);d.transform(b);this.x=d.x/d.w;this.y=d.y/d.w;this.z=d.z/d.w;return this};b.scale=function(a){this.x*=a;this.y*=a;this.z*=a;return this};b.equals=function(b){var d= a.math.EPSILON;return this.xb.x-d&&this.yb.y-d&&this.zb.z-d};b.inverseTransform=function(b){b=b.mat;var d=new a.math.Vec3(this.x-b[12],this.y-b[13],this.z-b[14]);this.x=d.x*b[0]+d.y*b[1]+d.z*b[2];this.y=d.x*b[4]+d.y*b[5]+d.z*b[6];this.z=d.x*b[8]+d.y*b[9]+d.z*b[10];return this};b.inverseTransformNormal=function(a){var b=this.x,e=this.y,f=this.z;a=a.mat;this.x=b*a[0]+e*a[1]+f*a[2];this.y=b*a[4]+e*a[5]+f*a[6];this.z=b*a[8]+e*a[9]+f*a[10];return this};b.assignFrom= function(a){if(!a)return this;this.x=a.x;this.y=a.y;this.z=a.z;return this};a.math.Vec3.zero=function(a){a.x=a.y=a.z=0;return a};b.toTypeArray=function(){var a=new Float32Array(3);a[0]=this.x;a[1]=this.y;a[2]=this.z;return a}})(cc);(function(a){a.math.Vec4=function(a,b,e,f){a&&void 0===b?(this.x=a.x,this.y=a.y,this.z=a.z,this.w=a.w):(this.x=a||0,this.y=b||0,this.z=e||0,this.w=f||0)};a.kmVec4=a.math.Vec4;var b=a.math.Vec4.prototype;b.fill=function(a,b,e,f){a&&void 0===b?(this.x=a.x,this.y=a.y,this.z=a.z,this.w=a.w):(this.x=a,this.y=b,this.z=e,this.w=f)};b.add=function(a){if(!a)return this;this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this};b.dot=function(a){return this.x*a.x+this.y*a.y+this.z*a.z+this.w*a.w};b.length= function(){return Math.sqrt(a.math.square(this.x)+a.math.square(this.y)+a.math.square(this.z)+a.math.square(this.w))};b.lengthSq=function(){return a.math.square(this.x)+a.math.square(this.y)+a.math.square(this.z)+a.math.square(this.w)};b.lerp=function(a,b){return this};b.normalize=function(){var a=1/this.length();this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this};b.scale=function(a){this.normalize();this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this};b.subtract=function(a){this.x-=a.x;this.y-= a.y;this.z-=a.z;this.w-=a.w};b.transform=function(a){var b=this.x,e=this.y,f=this.z,g=this.w;a=a.mat;this.x=b*a[0]+e*a[4]+f*a[8]+g*a[12];this.y=b*a[1]+e*a[5]+f*a[9]+g*a[13];this.z=b*a[2]+e*a[6]+f*a[10]+g*a[14];this.w=b*a[3]+e*a[7]+f*a[11]+g*a[15];return this};a.math.Vec4.transformArray=function(b,d){for(var e=[],f=0;fb.x-d&&this.yb.y-d&& this.zb.z-d&&this.wb.w-d};b.assignFrom=function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this};b.toTypeArray=function(){var a=new Float32Array(4);a[0]=this.x;a[1]=this.y;a[2]=this.z;a[3]=this.w;return a}})(cc);(function(a){function b(b,d,e){d=new a.math.Vec2(d);d.subtract(b);e.x=-d.y;e.y=d.x;e.normalize()}a.math.Ray2=function(b,d){this.start=b||new a.math.Vec2;this.dir=d||new a.math.Vec2};a.math.Ray2.prototype.fill=function(a,b,e,f){this.start.x=a;this.start.y=b;this.dir.x=e;this.dir.y=f};a.math.Ray2.prototype.intersectLineSegment=function(b,d,e){var f=this.start.x,g=this.start.y,h=this.start.x+this.dir.x,k=this.start.y+this.dir.y,m=b.x,n=b.y,p=d.x,r=d.y,s=(r-n)*(h-f)-(p-m)*(k-g);if(s>-a.math.EPSILON&& sMath.max(b.x,d.x)+a.math.EPSILON||nMath.max(b.y,d.y)+a.math.EPSILON||mMath.max(f,h)+a.math.EPSILON||nMath.max(g,k)+a.math.EPSILON)return!1;e.x=m;e.y=n;return!0};a.math.Ray2.prototype.intersectTriangle=function(c,d,e,f,g){var h=new a.math.Vec2,k=new a.math.Vec2,m=new a.math.Vec2, n=1E4,p=!1,r;this.intersectLineSegment(c,d,h)&&(p=!0,r=h.subtract(this.start).length(),rg;++g)if(!(f[g]+c>b[g]&&f[g]-cc;c++)b[c]=a[c];return this};a.kmMat4Identity=function(a){var b=a.mat;b[1]=b[2]=b[3]=b[4]=b[6]=b[7]=b[8]=b[9]=b[11]=b[12]=b[13]=b[14]=0;b[0]=b[5]=b[10]=b[15]=1;return a};b.identity=function(){var a=this.mat;a[1]=a[2]=a[3]=a[4]=a[6]=a[7]=a[8]=a[9]=a[11]=a[12]=a[13]=a[14]=0;a[0]=a[5]=a[10]=a[15]=1; return this};b.get=function(a,b){return this.mat[a+4*b]};b.set=function(a,b,c){this.mat[a+4*b]=c};b.swap=function(a,b,c,d){var k=this.mat,m=k[a+4*b];k[a+4*b]=k[c+4*d];k[c+4*d]=m};a.math.Matrix4._gaussj=function(a,b){var c,d=0,k=0,m,n,p,r,s=[0,0,0,0],u=[0,0,0,0],t=[0,0,0,0];for(c=0;4>c;c++){for(m=r=0;4>m;m++)if(1!==t[m])for(n=0;4>n;n++)0===t[n]&&(p=Math.abs(a.get(m,n)),p>=r&&(r=p,k=m,d=n));++t[d];if(k!==d){for(m=0;4>m;m++)a.swap(k,m,d,m);for(m=0;4>m;m++)b.swap(k,m,d,m)}u[c]=k;s[c]=d;if(0===a.get(d, d))return!1;n=1/a.get(d,d);a.set(d,d,1);for(m=0;4>m;m++)a.set(d,m,a.get(d,m)*n);for(m=0;4>m;m++)b.set(d,m,b.get(d,m)*n);for(n=0;4>n;n++)if(n!==d){p=a.get(n,d);a.set(n,d,0);for(m=0;4>m;m++)a.set(n,m,a.get(n,m)-a.get(d,m)*p);for(m=0;4>m;m++)b.set(n,m,a.get(n,m)-b.get(d,m)*p)}}for(m=3;0<=m;m--)if(u[m]!==s[m])for(n=0;4>n;n++)a.swap(n,u[m],n,s[m]);return!0};var c=(new a.math.Matrix4).identity();a.kmMat4Inverse=function(b,d){var g=new a.math.Matrix4(d),h=new a.math.Matrix4(c);if(!1===a.math.Matrix4._gaussj(g, h))return null;b.assignFrom(g);return b};b.inverse=function(){var b=new a.math.Matrix4(this),d=new a.math.Matrix4(c);return!1===a.math.Matrix4._gaussj(b,d)?null:b};b.isIdentity=function(){var a=this.mat;return 1===a[0]&&0===a[1]&&0===a[2]&&0===a[3]&&0===a[4]&&1===a[5]&&0===a[6]&&0===a[7]&&0===a[8]&&0===a[9]&&1===a[10]&&0===a[11]&&0===a[12]&&0===a[13]&&0===a[14]&&1===a[15]};b.transpose=function(){var a=this.mat,b=a[1],c=a[2],d=a[3],k=a[6],m=a[7],n=a[8],p=a[9],r=a[11],s=a[12],u=a[13],t=a[14];a[1]=a[4]; a[2]=n;a[3]=s;a[4]=b;a[6]=p;a[7]=u;a[8]=c;a[9]=k;a[11]=t;a[12]=d;a[13]=m;a[14]=r;return this};a.kmMat4Multiply=function(a,b,c){var d=a.mat,k=b.mat,m=c.mat;c=k[0];b=k[1];var n=k[2],p=k[3],r=k[4],s=k[5],u=k[6],t=k[7],v=k[8],w=k[9],x=k[10],B=k[11],y=k[12],z=k[13],C=k[14],k=k[15],A=m[0],D=m[1],F=m[2],M=m[3],E=m[4],N=m[5],Q=m[6],H=m[7],R=m[8],K=m[9],I=m[10],P=m[11],T=m[12],S=m[13],O=m[14],m=m[15];d[0]=A*c+D*r+F*v+M*y;d[1]=A*b+D*s+F*w+M*z;d[2]=A*n+D*u+F*x+M*C;d[3]=A*p+D*t+F*B+M*k;d[4]=E*c+N*r+Q*v+H*y;d[5]= E*b+N*s+Q*w+H*z;d[6]=E*n+N*u+Q*x+H*C;d[7]=E*p+N*t+Q*B+H*k;d[8]=R*c+K*r+I*v+P*y;d[9]=R*b+K*s+I*w+P*z;d[10]=R*n+K*u+I*x+P*C;d[11]=R*p+K*t+I*B+P*k;d[12]=T*c+S*r+O*v+m*y;d[13]=T*b+S*s+O*w+m*z;d[14]=T*n+S*u+O*x+m*C;d[15]=T*p+S*t+O*B+m*k;return a};b.multiply=function(a){var b=this.mat,c=a.mat;a=b[0];var d=b[1],k=b[2],m=b[3],n=b[4],p=b[5],r=b[6],s=b[7],u=b[8],t=b[9],v=b[10],w=b[11],x=b[12],B=b[13],y=b[14],z=b[15],C=c[0],A=c[1],D=c[2],F=c[3],M=c[4],E=c[5],N=c[6],Q=c[7],H=c[8],R=c[9],K=c[10],I=c[11],P=c[12], T=c[13],S=c[14],c=c[15];b[0]=C*a+A*n+D*u+F*x;b[1]=C*d+A*p+D*t+F*B;b[2]=C*k+A*r+D*v+F*y;b[3]=C*m+A*s+D*w+F*z;b[4]=M*a+E*n+N*u+Q*x;b[5]=M*d+E*p+N*t+Q*B;b[6]=M*k+E*r+N*v+Q*y;b[7]=M*m+E*s+N*w+Q*z;b[8]=H*a+R*n+K*u+I*x;b[9]=H*d+R*p+K*t+I*B;b[10]=H*k+R*r+K*v+I*y;b[11]=H*m+R*s+K*w+I*z;b[12]=P*a+T*n+S*u+c*x;b[13]=P*d+T*p+S*t+c*B;b[14]=P*k+T*r+S*v+c*y;b[15]=P*m+T*s+S*w+c*z;return this};a.getMat4MultiplyValue=function(a,b){var c=a.mat,d=b.mat,k=new Float32Array(16);k[0]=c[0]*d[0]+c[4]*d[1]+c[8]*d[2]+c[12]*d[3]; k[1]=c[1]*d[0]+c[5]*d[1]+c[9]*d[2]+c[13]*d[3];k[2]=c[2]*d[0]+c[6]*d[1]+c[10]*d[2]+c[14]*d[3];k[3]=c[3]*d[0]+c[7]*d[1]+c[11]*d[2]+c[15]*d[3];k[4]=c[0]*d[4]+c[4]*d[5]+c[8]*d[6]+c[12]*d[7];k[5]=c[1]*d[4]+c[5]*d[5]+c[9]*d[6]+c[13]*d[7];k[6]=c[2]*d[4]+c[6]*d[5]+c[10]*d[6]+c[14]*d[7];k[7]=c[3]*d[4]+c[7]*d[5]+c[11]*d[6]+c[15]*d[7];k[8]=c[0]*d[8]+c[4]*d[9]+c[8]*d[10]+c[12]*d[11];k[9]=c[1]*d[8]+c[5]*d[9]+c[9]*d[10]+c[13]*d[11];k[10]=c[2]*d[8]+c[6]*d[9]+c[10]*d[10]+c[14]*d[11];k[11]=c[3]*d[8]+c[7]*d[9]+c[11]* d[10]+c[15]*d[11];k[12]=c[0]*d[12]+c[4]*d[13]+c[8]*d[14]+c[12]*d[15];k[13]=c[1]*d[12]+c[5]*d[13]+c[9]*d[14]+c[13]*d[15];k[14]=c[2]*d[12]+c[6]*d[13]+c[10]*d[14]+c[14]*d[15];k[15]=c[3]*d[12]+c[7]*d[13]+c[11]*d[14]+c[15]*d[15];return k};a.kmMat4Assign=function(b,c){if(b===c)return a.log("cc.kmMat4Assign(): pOut equals pIn"),b;var d=b.mat,h=c.mat;d[0]=h[0];d[1]=h[1];d[2]=h[2];d[3]=h[3];d[4]=h[4];d[5]=h[5];d[6]=h[6];d[7]=h[7];d[8]=h[8];d[9]=h[9];d[10]=h[10];d[11]=h[11];d[12]=h[12];d[13]=h[13];d[14]=h[14]; d[15]=h[15];return b};b.assignFrom=function(b){if(this===b)return a.log("cc.mat.Matrix4.assignFrom(): mat4 equals current matrix"),this;var c=this.mat;b=b.mat;c[0]=b[0];c[1]=b[1];c[2]=b[2];c[3]=b[3];c[4]=b[4];c[5]=b[5];c[6]=b[6];c[7]=b[7];c[8]=b[8];c[9]=b[9];c[10]=b[10];c[11]=b[11];c[12]=b[12];c[13]=b[13];c[14]=b[14];c[15]=b[15];return this};b.equals=function(b){if(this===b)return a.log("cc.kmMat4AreEqual(): pMat1 and pMat2 are same object."),!0;var c=this.mat;b=b.mat;for(var d=a.math.EPSILON,h=0;16> h;h++)if(!(c[h]+d>b[h]&&c[h]-db?a.math.Plane.POINT_BEHIND_PLANE:a.math.Plane.POINT_ON_PLANE}})(cc);(function(a){a.math.Quaternion=function(a,b,e,f){a&&void 0===b?(this.x=a.x,this.y=a.y,this.z=a.z,this.w=a.w):(this.x=a||0,this.y=b||0,this.z=e||0,this.w=f||0)};a.kmQuaternion=a.math.Quaternion;var b=a.math.Quaternion.prototype;b.conjugate=function(a){this.x=-a.x;this.y=-a.y;this.z=-a.z;this.w=a.w;return this};b.dot=function(a){return this.w*a.w+this.x*a.x+this.y*a.y+this.z*a.z};b.exponential=function(){return this};b.identity=function(){this.z=this.y=this.x=0;this.w=1;return this};b.inverse=function(){var b= this.length();if(Math.abs(b)>a.math.EPSILON)return this.w=this.z=this.y=this.x=0,this;this.conjugate(this).scale(1/b);return this};b.isIdentity=function(){return 0===this.x&&0===this.y&&0===this.z&&1===this.w};b.length=function(){return Math.sqrt(this.lengthSq())};b.lengthSq=function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w};b.multiply=function(a){var b=this.x,e=this.y,f=this.z,g=this.w;this.w=g*a.w-b*a.x-e*a.y-f*a.z;this.x=g*a.x+b*a.w+e*a.z-f*a.y;this.y=g*a.y+e*a.w+f*a.x- b*a.z;this.z=g*a.z+f*a.w+b*a.y-e*a.x;return this};b.normalize=function(){var b=this.length();if(Math.abs(b)<=a.math.EPSILON)throw Error("current quaternion is an invalid value");this.scale(1/b);return this};b.rotationAxis=function(a,b){var e=0.5*b,f=Math.sin(e);this.w=Math.cos(e);this.x=a.x*f;this.y=a.y*f;this.z=a.z*f;return this};a.math.Quaternion.rotationMatrix=function(b){if(!b)return null;var d,e,f;d=[];e=b.mat;b=0;d[0]=e[0];d[1]=e[3];d[2]=e[6];d[4]=e[1];d[5]=e[4];d[6]=e[7];d[8]=e[2];d[9]=e[5]; d[10]=e[8];d[15]=1;var g=d[0];b=g[0]+g[5]+g[10]+1;b>a.math.EPSILON?(b=2*Math.sqrt(b),d=(g[9]-g[6])/b,e=(g[2]-g[8])/b,f=(g[4]-g[1])/b,b*=0.25):g[0]>g[5]&&g[0]>g[10]?(b=2*Math.sqrt(1+g[0]-g[5]-g[10]),d=0.25*b,e=(g[4]+g[1])/b,f=(g[2]+g[8])/b,b=(g[9]-g[6])/b):g[5]>g[10]?(b=2*Math.sqrt(1+g[5]-g[0]-g[10]),d=(g[4]+g[1])/b,e=0.25*b,f=(g[9]+g[6])/b,b=(g[2]-g[8])/b):(b=2*Math.sqrt(1+g[10]-g[0]-g[5]),d=(g[2]+g[8])/b,e=(g[9]+g[6])/b,f=0.25*b,b=(g[4]-g[1])/b);return new a.math.Quaternion(d,e,f,b)};a.math.Quaternion.rotationYawPitchRoll= function(b,d,e){var f,g,h,k,m;f=a.degreesToRadians(d)/2;g=a.degreesToRadians(b)/2;h=a.degreesToRadians(e)/2;e=Math.cos(f);b=Math.cos(g);d=Math.cos(h);f=Math.sin(f);g=Math.sin(g);h=Math.sin(h);k=b*d;m=g*h;var n=new a.math.Quaternion;n.w=e*k+f*m;n.x=f*k-e*m;n.y=e*g*d+f*b*h;n.z=e*b*h-f*g*d;n.normalize();return n};b.slerp=function(b,d){if(this.x===b.x&&this.y===b.y&&this.z===b.z&&this.w===b.w)return this;var e=this.dot(b),f=Math.acos(e),g=Math.sqrt(1-a.math.square(e)),e=Math.sin(d*f)/g,f=Math.sin((1- d)*f)/g,g=new a.math.Quaternion(b);this.scale(f);g.scale(e);this.add(g);return this};b.toAxisAndAngle=function(){var b,d,e=new a.math.Vec3;b=Math.acos(this.w);d=Math.sqrt(a.math.square(this.x)+a.math.square(this.y)+a.math.square(this.z));d>-a.math.EPSILON&&d2*Math.PI-a.math.EPSILON?(b=0,e.x=0,e.y=0,e.z=1):(b*=2,e.x=this.x/d,e.y=this.y/d,e.z=this.z/d,e.normalize());return{axis:e,angle:b}};b.scale=function(a){this.x*=a;this.y*=a;this.z*=a;this.w*=a;return this}; b.assignFrom=function(a){this.x=a.x;this.y=a.y;this.z=a.z;this.w=a.w;return this};b.add=function(a){this.x+=a.x;this.y+=a.y;this.z+=a.z;this.w+=a.w;return this};a.math.Quaternion.rotationBetweenVec3=function(b,d,e){var f=new a.math.Vec3(b),g=new a.math.Vec3(d);f.normalize();g.normalize();var h=f.dot(g);d=new a.math.Quaternion;if(1<=h)return d.identity(),d;-0.999999>h?Math.abs(e.lengthSq())=this.min.x&&a.x<=this.max.x&&a.y>=this.min.y&&a.y<=this.max.y&&a.z>=this.min.z&&a.z<=this.max.z};cc.math.AABB.containsPoint=function(a,b){return a.x>=b.min.x&&a.x<=b.max.x&&a.y>=b.min.y&&a.y<=b.max.y&&a.z>=b.min.z&&a.z<=b.max.z};cc.math.AABB.prototype.assignFrom=function(a){this.min.assignFrom(a.min);this.max.assignFrom(a.max)}; cc.math.AABB.assign=function(a,b){a.min.assignFrom(b.min);a.max.assignFrom(b.max);return a};(function(a){a.math.Matrix4Stack=function(a,b){this.top=a;this.stack=b||[];this.lastUpdated=0};a.km_mat4_stack=a.math.Matrix4Stack;var b=a.math.Matrix4Stack.prototype;b.initialize=function(){this.stack.length=0;this.top=null};a.km_mat4_stack_push=function(b,d){b.stack.push(b.top);b.top=new a.math.Matrix4(d)};a.km_mat4_stack_pop=function(a,b){a.top=a.stack.pop()};a.km_mat4_stack_release=function(a){a.stack=null;a.top=null};b.push=function(b){b=b||this.top;this.stack.push(this.top);this.top=new a.math.Matrix4(b)}; b.pop=function(){this.top=this.stack.pop()};b.release=function(){this._matrixPool=this.top=this.stack=null};b._getFromPool=function(b){var d=this._matrixPool;if(0===d.length)return new a.math.Matrix4(b);d=d.pop();d.assignFrom(b);return d};b._putInPool=function(a){this._matrixPool.push(a)}})(cc);(function(a){a.KM_GL_MODELVIEW=5888;a.KM_GL_PROJECTION=5889;a.KM_GL_TEXTURE=5890;a.modelview_matrix_stack=new a.math.Matrix4Stack;a.projection_matrix_stack=new a.math.Matrix4Stack;a.texture_matrix_stack=new a.math.Matrix4Stack;a.current_stack=null;a.lazyInitialize=function(){var b=new a.math.Matrix4;a.modelview_matrix_stack.initialize();a.projection_matrix_stack.initialize();a.texture_matrix_stack.initialize();a.current_stack=a.modelview_matrix_stack;a.initialized=!0;b.identity();a.modelview_matrix_stack.push(b); a.projection_matrix_stack.push(b);a.texture_matrix_stack.push(b)};a.lazyInitialize();a.kmGLFreeAll=function(){a.modelview_matrix_stack.release();a.modelview_matrix_stack=null;a.projection_matrix_stack.release();a.projection_matrix_stack=null;a.texture_matrix_stack.release();a.texture_matrix_stack=null;a.initialized=!1;a.current_stack=null};a.kmGLPushMatrix=function(){a.current_stack.push(a.current_stack.top)};a.kmGLPushMatrixWitMat4=function(b){a.current_stack.stack.push(a.current_stack.top);b.assignFrom(a.current_stack.top); a.current_stack.top=b};a.kmGLPopMatrix=function(){a.current_stack.top=a.current_stack.stack.pop()};a.kmGLMatrixMode=function(b){switch(b){case a.KM_GL_MODELVIEW:a.current_stack=a.modelview_matrix_stack;break;case a.KM_GL_PROJECTION:a.current_stack=a.projection_matrix_stack;break;case a.KM_GL_TEXTURE:a.current_stack=a.texture_matrix_stack;break;default:throw Error("Invalid matrix mode specified");}a.current_stack.lastUpdated=a.director.getTotalFrames()};a.kmGLLoadIdentity=function(){a.current_stack.top.identity()}; a.kmGLLoadMatrix=function(b){a.current_stack.top.assignFrom(b)};a.kmGLMultMatrix=function(b){a.current_stack.top.multiply(b)};var b=new a.math.Matrix4;a.kmGLTranslatef=function(c,e,f){c=a.math.Matrix4.createByTranslation(c,e,f,b);a.current_stack.top.multiply(c)};var c=new a.math.Vec3;a.kmGLRotatef=function(d,e,f,g){c.fill(e,f,g);d=a.math.Matrix4.createByAxisAndAngle(c,a.degreesToRadians(d),b);a.current_stack.top.multiply(d)};a.kmGLScalef=function(c,e,f){c=a.math.Matrix4.createByScale(c,e,f,b);a.current_stack.top.multiply(c)}; a.kmGLGetMatrix=function(b,c){switch(b){case a.KM_GL_MODELVIEW:c.assignFrom(a.modelview_matrix_stack.top);break;case a.KM_GL_PROJECTION:c.assignFrom(a.projection_matrix_stack.top);break;case a.KM_GL_TEXTURE:c.assignFrom(a.texture_matrix_stack.top);break;default:throw Error("Invalid matrix mode specified");}}})(cc);cc.SHADER_POSITION_UCOLOR_FRAG="precision lowp float;\nvarying vec4 v_fragmentColor;\nvoid main() \n{ \n gl_FragColor \x3d v_fragmentColor; \n}\n";cc.SHADER_POSITION_UCOLOR_VERT="attribute vec4 a_position;\nuniform vec4 u_color;\nuniform float u_pointSize;\nvarying lowp vec4 v_fragmentColor; \nvoid main(void) \n{\n gl_Position \x3d (CC_PMatrix * CC_MVMatrix) * a_position; \n gl_PointSize \x3d u_pointSize; \n v_fragmentColor \x3d u_color; \n}"; cc.SHADER_POSITION_COLOR_FRAG="precision lowp float; \nvarying vec4 v_fragmentColor; \nvoid main() \n{ \n gl_FragColor \x3d v_fragmentColor; \n} ";cc.SHADER_POSITION_COLOR_VERT="attribute vec4 a_position;\nattribute vec4 a_color;\nvarying lowp vec4 v_fragmentColor;\nvoid main()\n{\n gl_Position \x3d (CC_PMatrix * CC_MVMatrix) * a_position; \n v_fragmentColor \x3d a_color; \n}";cc.SHADER_SPRITE_POSITION_COLOR_VERT="attribute vec4 a_position;\nattribute vec4 a_color;\nvarying lowp vec4 v_fragmentColor;\nvoid main()\n{\n gl_Position \x3d CC_PMatrix * a_position; \n v_fragmentColor \x3d a_color; \n}"; cc.SHADER_POSITION_COLOR_LENGTH_TEXTURE_FRAG="// #extension GL_OES_standard_derivatives : enable\nvarying mediump vec4 v_color;\nvarying mediump vec2 v_texcoord;\nvoid main()\t\n{ \n// #if defined GL_OES_standard_derivatives\t\n// gl_FragColor \x3d v_color*smoothstep(0.0, length(fwidth(v_texcoord)), 1.0 - length(v_texcoord)); \n// #else\t\ngl_FragColor \x3d v_color * step(0.0, 1.0 - length(v_texcoord)); \n// #endif \n}";cc.SHADER_POSITION_COLOR_LENGTH_TEXTURE_VERT="attribute mediump vec4 a_position; \nattribute mediump vec2 a_texcoord; \nattribute mediump vec4 a_color;\t\nvarying mediump vec4 v_color; \nvarying mediump vec2 v_texcoord;\t\nvoid main() \n{ \n v_color \x3d a_color;//vec4(a_color.rgb * a_color.a, a_color.a); \n v_texcoord \x3d a_texcoord; \n gl_Position \x3d (CC_PMatrix * CC_MVMatrix) * a_position; \n}"; cc.SHADER_POSITION_TEXTURE_FRAG="precision lowp float; \nvarying vec2 v_texCoord; \nvoid main() \n{ \n gl_FragColor \x3d texture2D(CC_Texture0, v_texCoord); \n}";cc.SHADER_POSITION_TEXTURE_VERT="attribute vec4 a_position; \nattribute vec2 a_texCoord; \nvarying mediump vec2 v_texCoord; \nvoid main() \n{ \n gl_Position \x3d (CC_PMatrix * CC_MVMatrix) * a_position; \n v_texCoord \x3d a_texCoord; \n}";cc.SHADER_POSITION_TEXTURE_UCOLOR_FRAG="precision lowp float; \nuniform vec4 u_color; \nvarying vec2 v_texCoord; \nvoid main() \n{ \n gl_FragColor \x3d texture2D(CC_Texture0, v_texCoord) * u_color; \n}"; cc.SHADER_POSITION_TEXTURE_UCOLOR_VERT="attribute vec4 a_position;\nattribute vec2 a_texCoord; \nvarying mediump vec2 v_texCoord; \nvoid main() \n{ \n gl_Position \x3d (CC_PMatrix * CC_MVMatrix) * a_position; \n v_texCoord \x3d a_texCoord; \n}";cc.SHADER_POSITION_TEXTURE_A8COLOR_FRAG="precision lowp float; \nvarying vec4 v_fragmentColor; \nvarying vec2 v_texCoord; \nvoid main() \n{ \n gl_FragColor \x3d vec4( v_fragmentColor.rgb, \n v_fragmentColor.a * texture2D(CC_Texture0, v_texCoord).a \n ); \n}"; cc.SHADER_POSITION_TEXTURE_A8COLOR_VERT="attribute vec4 a_position; \nattribute vec2 a_texCoord; \nattribute vec4 a_color; \nvarying lowp vec4 v_fragmentColor; \nvarying mediump vec2 v_texCoord; \nvoid main() \n{ \n gl_Position \x3d (CC_PMatrix * CC_MVMatrix) * a_position; \n v_fragmentColor \x3d a_color; \n v_texCoord \x3d a_texCoord; \n}";cc.SHADER_POSITION_TEXTURE_COLOR_FRAG="precision lowp float;\nvarying vec4 v_fragmentColor; \nvarying vec2 v_texCoord; \nvoid main() \n{ \n gl_FragColor \x3d v_fragmentColor * texture2D(CC_Texture0, v_texCoord); \n}"; cc.SHADER_POSITION_TEXTURE_COLOR_VERT="attribute vec4 a_position; \nattribute vec2 a_texCoord; \nattribute vec4 a_color; \nvarying lowp vec4 v_fragmentColor; \nvarying mediump vec2 v_texCoord; \nvoid main() \n{ \n gl_Position \x3d (CC_PMatrix * CC_MVMatrix) * a_position; \n v_fragmentColor \x3d a_color; \n v_texCoord \x3d a_texCoord; \n}";cc.SHADER_SPRITE_POSITION_TEXTURE_COLOR_VERT="attribute vec4 a_position; \nattribute vec2 a_texCoord; \nattribute vec4 a_color; \nvarying lowp vec4 v_fragmentColor; \nvarying mediump vec2 v_texCoord; \nvoid main() \n{ \n gl_Position \x3d CC_PMatrix * a_position; \n v_fragmentColor \x3d a_color; \n v_texCoord \x3d a_texCoord; \n}"; cc.SHADER_SPRITE_POSITION_TEXTURE_COLOR_GRAY_FRAG="precision lowp float;\nvarying vec4 v_fragmentColor; \nvarying vec2 v_texCoord; \nvoid main() \n{ \n vec4 c \x3d texture2D(CC_Texture0, v_texCoord); \n gl_FragColor.xyz \x3d vec3(0.2126*c.r + 0.7152*c.g + 0.0722*c.b); \n gl_FragColor.w \x3d c.w ; \n}";cc.SHADER_POSITION_TEXTURE_COLOR_ALPHATEST_FRAG="precision lowp float; \nvarying vec4 v_fragmentColor; \nvarying vec2 v_texCoord; \nuniform float CC_alpha_value; \nvoid main() \n{ \n vec4 texColor \x3d texture2D(CC_Texture0, v_texCoord); \n if ( texColor.a \x3c\x3d CC_alpha_value ) \n discard; \n gl_FragColor \x3d texColor * v_fragmentColor; \n}"; cc.SHADEREX_SWITCHMASK_FRAG="precision lowp float; \nvarying vec4 v_fragmentColor; \nvarying vec2 v_texCoord; \nuniform sampler2D u_texture; \nuniform sampler2D u_mask; \nvoid main() \n{ \n vec4 texColor \x3d texture2D(u_texture, v_texCoord); \n vec4 maskColor \x3d texture2D(u_mask, v_texCoord); \n vec4 finalColor \x3d vec4(texColor.r, texColor.g, texColor.b, maskColor.a * texColor.a); \n gl_FragColor \x3d v_fragmentColor * finalColor; \n}";cc.shaderCache={TYPE_POSITION_TEXTURECOLOR:0,TYPE_POSITION_TEXTURECOLOR_ALPHATEST:1,TYPE_POSITION_COLOR:2,TYPE_POSITION_TEXTURE:3,TYPE_POSITION_TEXTURE_UCOLOR:4,TYPE_POSITION_TEXTURE_A8COLOR:5,TYPE_POSITION_UCOLOR:6,TYPE_POSITION_LENGTH_TEXTURECOLOR:7,TYPE_SPRITE_POSITION_TEXTURECOLOR:8,TYPE_SPRITE_POSITION_TEXTURECOLOR_ALPHATEST:9,TYPE_SPRITE_POSITION_COLOR:10,TYPE_SPRITE_POSITION_TEXTURECOLOR_GRAY:11,TYPE_MAX:11,_programs:{},_init:function(){return!0},_loadDefaultShader:function(a,b){switch(b){case cc.SHADER_POSITION_TEXTURECOLOR:a.initWithVertexShaderByteArray(cc.SHADER_POSITION_TEXTURE_COLOR_VERT, cc.SHADER_POSITION_TEXTURE_COLOR_FRAG);a.addAttribute(cc.ATTRIBUTE_NAME_POSITION,cc.VERTEX_ATTRIB_POSITION);a.addAttribute(cc.ATTRIBUTE_NAME_COLOR,cc.VERTEX_ATTRIB_COLOR);a.addAttribute(cc.ATTRIBUTE_NAME_TEX_COORD,cc.VERTEX_ATTRIB_TEX_COORDS);break;case cc.SHADER_SPRITE_POSITION_TEXTURECOLOR:a.initWithVertexShaderByteArray(cc.SHADER_SPRITE_POSITION_TEXTURE_COLOR_VERT,cc.SHADER_POSITION_TEXTURE_COLOR_FRAG);a.addAttribute(cc.ATTRIBUTE_NAME_POSITION,cc.VERTEX_ATTRIB_POSITION);a.addAttribute(cc.ATTRIBUTE_NAME_COLOR, cc.VERTEX_ATTRIB_COLOR);a.addAttribute(cc.ATTRIBUTE_NAME_TEX_COORD,cc.VERTEX_ATTRIB_TEX_COORDS);break;case cc.SHADER_SPRITE_POSITION_TEXTURECOLOR_GRAY:a.initWithVertexShaderByteArray(cc.SHADER_SPRITE_POSITION_TEXTURE_COLOR_VERT,cc.SHADER_SPRITE_POSITION_TEXTURE_COLOR_GRAY_FRAG);a.addAttribute(cc.ATTRIBUTE_NAME_POSITION,cc.VERTEX_ATTRIB_POSITION);a.addAttribute(cc.ATTRIBUTE_NAME_COLOR,cc.VERTEX_ATTRIB_COLOR);a.addAttribute(cc.ATTRIBUTE_NAME_TEX_COORD,cc.VERTEX_ATTRIB_TEX_COORDS);break;case cc.SHADER_POSITION_TEXTURECOLORALPHATEST:a.initWithVertexShaderByteArray(cc.SHADER_POSITION_TEXTURE_COLOR_VERT, cc.SHADER_POSITION_TEXTURE_COLOR_ALPHATEST_FRAG);a.addAttribute(cc.ATTRIBUTE_NAME_POSITION,cc.VERTEX_ATTRIB_POSITION);a.addAttribute(cc.ATTRIBUTE_NAME_COLOR,cc.VERTEX_ATTRIB_COLOR);a.addAttribute(cc.ATTRIBUTE_NAME_TEX_COORD,cc.VERTEX_ATTRIB_TEX_COORDS);break;case cc.SHADER_SPRITE_POSITION_TEXTURECOLORALPHATEST:a.initWithVertexShaderByteArray(cc.SHADER_SPRITE_POSITION_TEXTURE_COLOR_VERT,cc.SHADER_POSITION_TEXTURE_COLOR_ALPHATEST_FRAG);a.addAttribute(cc.ATTRIBUTE_NAME_POSITION,cc.VERTEX_ATTRIB_POSITION); a.addAttribute(cc.ATTRIBUTE_NAME_COLOR,cc.VERTEX_ATTRIB_COLOR);a.addAttribute(cc.ATTRIBUTE_NAME_TEX_COORD,cc.VERTEX_ATTRIB_TEX_COORDS);break;case cc.SHADER_POSITION_COLOR:a.initWithVertexShaderByteArray(cc.SHADER_POSITION_COLOR_VERT,cc.SHADER_POSITION_COLOR_FRAG);a.addAttribute(cc.ATTRIBUTE_NAME_POSITION,cc.VERTEX_ATTRIB_POSITION);a.addAttribute(cc.ATTRIBUTE_NAME_COLOR,cc.VERTEX_ATTRIB_COLOR);break;case cc.SHADER_SPRITE_POSITION_COLOR:a.initWithVertexShaderByteArray(cc.SHADER_SPRITE_POSITION_COLOR_VERT, cc.SHADER_POSITION_COLOR_FRAG);a.addAttribute(cc.ATTRIBUTE_NAME_POSITION,cc.VERTEX_ATTRIB_POSITION);a.addAttribute(cc.ATTRIBUTE_NAME_COLOR,cc.VERTEX_ATTRIB_COLOR);break;case cc.SHADER_POSITION_TEXTURE:a.initWithVertexShaderByteArray(cc.SHADER_POSITION_TEXTURE_VERT,cc.SHADER_POSITION_TEXTURE_FRAG);a.addAttribute(cc.ATTRIBUTE_NAME_POSITION,cc.VERTEX_ATTRIB_POSITION);a.addAttribute(cc.ATTRIBUTE_NAME_TEX_COORD,cc.VERTEX_ATTRIB_TEX_COORDS);break;case cc.SHADER_POSITION_TEXTURE_UCOLOR:a.initWithVertexShaderByteArray(cc.SHADER_POSITION_TEXTURE_UCOLOR_VERT, cc.SHADER_POSITION_TEXTURE_UCOLOR_FRAG);a.addAttribute(cc.ATTRIBUTE_NAME_POSITION,cc.VERTEX_ATTRIB_POSITION);a.addAttribute(cc.ATTRIBUTE_NAME_TEX_COORD,cc.VERTEX_ATTRIB_TEX_COORDS);break;case cc.SHADER_POSITION_TEXTUREA8COLOR:a.initWithVertexShaderByteArray(cc.SHADER_POSITION_TEXTURE_A8COLOR_VERT,cc.SHADER_POSITION_TEXTURE_A8COLOR_FRAG);a.addAttribute(cc.ATTRIBUTE_NAME_POSITION,cc.VERTEX_ATTRIB_POSITION);a.addAttribute(cc.ATTRIBUTE_NAME_COLOR,cc.VERTEX_ATTRIB_COLOR);a.addAttribute(cc.ATTRIBUTE_NAME_TEX_COORD, cc.VERTEX_ATTRIB_TEX_COORDS);break;case cc.SHADER_POSITION_UCOLOR:a.initWithVertexShaderByteArray(cc.SHADER_POSITION_UCOLOR_VERT,cc.SHADER_POSITION_UCOLOR_FRAG);a.addAttribute("aVertex",cc.VERTEX_ATTRIB_POSITION);break;case cc.SHADER_POSITION_LENGTHTEXTURECOLOR:a.initWithVertexShaderByteArray(cc.SHADER_POSITION_COLOR_LENGTH_TEXTURE_VERT,cc.SHADER_POSITION_COLOR_LENGTH_TEXTURE_FRAG);a.addAttribute(cc.ATTRIBUTE_NAME_POSITION,cc.VERTEX_ATTRIB_POSITION);a.addAttribute(cc.ATTRIBUTE_NAME_TEX_COORD,cc.VERTEX_ATTRIB_TEX_COORDS); a.addAttribute(cc.ATTRIBUTE_NAME_COLOR,cc.VERTEX_ATTRIB_COLOR);break;default:cc.log("cocos2d: cc.shaderCache._loadDefaultShader, error shader type");return}a.link();a.updateUniforms()},loadDefaultShaders:function(){},reloadDefaultShaders:function(){var a=this.programForKey(cc.SHADER_POSITION_TEXTURECOLOR);a.reset();this._loadDefaultShader(a,this.TYPE_POSITION_TEXTURECOLOR);a=this.programForKey(cc.SHADER_SPRITE_POSITION_TEXTURECOLOR);a.reset();this._loadDefaultShader(a,this.TYPE_SPRITE_POSITION_TEXTURECOLOR); a=this.programForKey(cc.SHADER_POSITION_TEXTURECOLORALPHATEST);a.reset();this._loadDefaultShader(a,this.TYPE_POSITION_TEXTURECOLOR_ALPHATEST);a=this.programForKey(cc.SHADER_SPRITE_POSITION_TEXTURECOLORALPHATEST);a.reset();this._loadDefaultShader(a,this.TYPE_SPRITE_POSITION_TEXTURECOLOR_ALPHATEST);a=this.programForKey(cc.SHADER_POSITION_COLOR);a.reset();this._loadDefaultShader(a,this.TYPE_POSITION_COLOR);a=this.programForKey(cc.SHADER_POSITION_TEXTURE);a.reset();this._loadDefaultShader(a,this.TYPE_POSITION_TEXTURE); a=this.programForKey(cc.SHADER_SPRITE_POSITION_TEXTURE_COLOR_GRAY_FRAG);a.reset();this._loadDefaultShader(a,this.TYPE_SPRITE_POSITION_TEXTURECOLOR_GRAY);a=this.programForKey(cc.SHADER_POSITION_TEXTURE_UCOLOR);a.reset();this._loadDefaultShader(a,this.TYPE_POSITION_TEXTURE_UCOLOR);a=this.programForKey(cc.SHADER_POSITION_TEXTUREA8COLOR);a.reset();this._loadDefaultShader(a,this.TYPE_POSITION_TEXTURE_A8COLOR);a=this.programForKey(cc.SHADER_POSITION_UCOLOR);a.reset();this._loadDefaultShader(a,this.TYPE_POSITION_UCOLOR)}, programForKey:function(a){if(!this._programs[a]){var b=new cc.GLProgram;this._loadDefaultShader(b,a);this._programs[a]=b}return this._programs[a]},getProgram:function(a){return this.programForKey(a)},addProgram:function(a,b){this._programs[b]=a}};cc.GLProgram=cc.Class.extend({_glContext:null,_programObj:null,_vertShader:null,_fragShader:null,_uniforms:null,_hashForUniforms:null,_usesTime:!1,_projectionUpdated:-1,_updateUniformLocation:function(a){if(!a)return!1;var b,c=this._hashForUniforms[a];if(c){b=!1;for(var d=arguments.length-1,e=0;earguments.length))switch(arguments.length){case 2:this.setUniformLocationWith1f(arguments[0],arguments[1]);break;case 3:this.setUniformLocationWith2f(arguments[0], arguments[1],arguments[2]);break;case 4:this.setUniformLocationWith3f(arguments[0],arguments[1],arguments[2],arguments[3]);break;case 5:this.setUniformLocationWith4f(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4])}},setUniformsForBuiltins:function(){var a=new cc.math.Matrix4,b=new cc.math.Matrix4,c=new cc.math.Matrix4;cc.kmGLGetMatrix(cc.KM_GL_PROJECTION,a);cc.kmGLGetMatrix(cc.KM_GL_MODELVIEW,b);cc.kmMat4Multiply(c,a,b);this.setUniformLocationWithMatrix4fv(this._uniforms[cc.UNIFORM_PMATRIX_S], a.mat,1);this.setUniformLocationWithMatrix4fv(this._uniforms[cc.UNIFORM_MVMATRIX_S],b.mat,1);this.setUniformLocationWithMatrix4fv(this._uniforms[cc.UNIFORM_MVPMATRIX_S],c.mat,1);this._usesTime&&(a=cc.director,a=a.getTotalFrames()*a.getAnimationInterval(),this.setUniformLocationWith4f(this._uniforms[cc.UNIFORM_TIME_S],a/10,a,2*a,4*a),this.setUniformLocationWith4f(this._uniforms[cc.UNIFORM_SINTIME_S],a/8,a/4,a/2,Math.sin(a)),this.setUniformLocationWith4f(this._uniforms[cc.UNIFORM_COSTIME_S],a/8,a/4, a/2,Math.cos(a)));-1!==this._uniforms[cc.UNIFORM_RANDOM01_S]&&this.setUniformLocationWith4f(this._uniforms[cc.UNIFORM_RANDOM01_S],Math.random(),Math.random(),Math.random(),Math.random())},_setUniformsForBuiltinsForRenderer:function(a){if(a&&a._renderCmd){var b=new cc.math.Matrix4,c=new cc.math.Matrix4;cc.kmGLGetMatrix(cc.KM_GL_PROJECTION,b);cc.kmMat4Multiply(c,b,a._renderCmd._stackMatrix);this.setUniformLocationWithMatrix4fv(this._uniforms[cc.UNIFORM_PMATRIX_S],b.mat,1);this.setUniformLocationWithMatrix4fv(this._uniforms[cc.UNIFORM_MVMATRIX_S], a._renderCmd._stackMatrix.mat,1);this.setUniformLocationWithMatrix4fv(this._uniforms[cc.UNIFORM_MVPMATRIX_S],c.mat,1);this._usesTime&&(a=cc.director,a=a.getTotalFrames()*a.getAnimationInterval(),this.setUniformLocationWith4f(this._uniforms[cc.UNIFORM_TIME_S],a/10,a,2*a,4*a),this.setUniformLocationWith4f(this._uniforms[cc.UNIFORM_SINTIME_S],a/8,a/4,a/2,Math.sin(a)),this.setUniformLocationWith4f(this._uniforms[cc.UNIFORM_COSTIME_S],a/8,a/4,a/2,Math.cos(a)));-1!==this._uniforms[cc.UNIFORM_RANDOM01_S]&& this.setUniformLocationWith4f(this._uniforms[cc.UNIFORM_RANDOM01_S],Math.random(),Math.random(),Math.random(),Math.random())}},setUniformForModelViewProjectionMatrix:function(){this._glContext.uniformMatrix4fv(this._uniforms[cc.UNIFORM_MVPMATRIX_S],!1,cc.getMat4MultiplyValue(cc.projection_matrix_stack.top,cc.modelview_matrix_stack.top))},setUniformForModelViewProjectionMatrixWithMat4:function(a){cc.kmMat4Multiply(a,cc.projection_matrix_stack.top,cc.modelview_matrix_stack.top);this._glContext.uniformMatrix4fv(this._uniforms[cc.UNIFORM_MVPMATRIX_S], !1,a.mat)},setUniformForModelViewAndProjectionMatrixWithMat4:function(){this._glContext.uniformMatrix4fv(this._uniforms[cc.UNIFORM_MVMATRIX_S],!1,cc.modelview_matrix_stack.top.mat);this._glContext.uniformMatrix4fv(this._uniforms[cc.UNIFORM_PMATRIX_S],!1,cc.projection_matrix_stack.top.mat)},_setUniformForMVPMatrixWithMat4:function(a){if(!a)throw Error("modelView matrix is undefined.");this._glContext.uniformMatrix4fv(this._uniforms[cc.UNIFORM_MVMATRIX_S],!1,a.mat);this._glContext.uniformMatrix4fv(this._uniforms[cc.UNIFORM_PMATRIX_S], !1,cc.projection_matrix_stack.top.mat)},_updateProjectionUniform:function(){var a=cc.projection_matrix_stack;a.lastUpdated!==this._projectionUpdated&&(this._glContext.uniformMatrix4fv(this._uniforms[cc.UNIFORM_PMATRIX_S],!1,a.top.mat),this._projectionUpdated=a.lastUpdated)},vertexShaderLog:function(){return this._glContext.getShaderInfoLog(this._vertShader)},getVertexShaderLog:function(){return this._glContext.getShaderInfoLog(this._vertShader)},getFragmentShaderLog:function(){return this._glContext.getShaderInfoLog(this._vertShader)}, fragmentShaderLog:function(){return this._glContext.getShaderInfoLog(this._fragShader)},programLog:function(){return this._glContext.getProgramInfoLog(this._programObj)},getProgramLog:function(){return this._glContext.getProgramInfoLog(this._programObj)},reset:function(){this._fragShader=this._vertShader=null;this._uniforms.length=0;this._glContext.deleteProgram(this._programObj);this._programObj=null;for(var a in this._hashForUniforms)this._hashForUniforms[a].length=0,delete this._hashForUniforms[a]}, getProgram:function(){return this._programObj},retain:function(){},release:function(){}});cc.GLProgram.create=function(a,b){return new cc.GLProgram(a,b)};cc.GLProgram._highpSupported=null;cc.GLProgram._isHighpSupported=function(){if(null==cc.GLProgram._highpSupported){var a=cc._renderContext,a=a.getShaderPrecisionFormat(a.FRAGMENT_SHADER,a.HIGH_FLOAT);cc.GLProgram._highpSupported=0!==a.precision}return cc.GLProgram._highpSupported}; cc.setProgram=function(a,b){a.shaderProgram=b;var c=a.children;if(c)for(var d=0;d>1;a|=a>>2;a|=a>>4;a|=a>>8;return(a|a>>16)+1}; cc.RenderTexture=cc.Node.extend({sprite:null,clearFlags:0,clearDepthVal:0,autoDraw:!1,_texture:null,_pixelFormat:0,clearStencilVal:0,_clearColor:null,_className:"RenderTexture",ctor:function(a,b,c,d){cc.Node.prototype.ctor.call(this);this._cascadeOpacityEnabled=this._cascadeColorEnabled=!0;this._pixelFormat=cc.Texture2D.PIXEL_FORMAT_RGBA8888;this._clearColor=new cc.Color(0,0,0,255);void 0!==a&&void 0!==b&&(c=c||cc.Texture2D.PIXEL_FORMAT_RGBA8888,this.initWithWidthAndHeight(a,b,c,d||0));this.setAnchorPoint(0, 0)},_createRenderCmd:function(){return cc._renderType===cc.game.RENDER_TYPE_CANVAS?new cc.RenderTexture.CanvasRenderCmd(this):new cc.RenderTexture.WebGLRenderCmd(this)},visit:function(a){if(this._visible){var b=cc.renderer,c=this._renderCmd;c.visit(a&&a._renderCmd);b.pushRenderCommand(c);this.sprite.visit(this);c._dirtyFlag=0}},cleanup:function(){cc.Node.prototype.onExit.call(this);this._renderCmd.cleanup()},getSprite:function(){return this.sprite},setSprite:function(a){this.sprite=a},setVirtualViewport:function(a, b,c){this._renderCmd.setVirtualViewport(a,b,c)},initWithWidthAndHeight:function(a,b,c,d){return this._renderCmd.initWithWidthAndHeight(a,b,c,d)},begin:function(){cc.renderer._turnToCacheMode(this.__instanceId);this._renderCmd.begin()},beginWithClear:function(a,b,c,d,e,f){var g=cc._renderContext;e=e||g.COLOR_BUFFER_BIT;f=f||g.COLOR_BUFFER_BIT|g.DEPTH_BUFFER_BIT;this._beginWithClear(a,b,c,d,e,f,g.COLOR_BUFFER_BIT|g.DEPTH_BUFFER_BIT|g.STENCIL_BUFFER_BIT)},_beginWithClear:function(a,b,c,d,e,f,g){this.begin(); this._renderCmd._beginWithClear(a,b,c,d,e,f,g)},end:function(){this._renderCmd.end()},clear:function(a,b,c,d){this.beginWithClear(a,b,c,d);this.end()},clearRect:function(a,b,c,d){this._renderCmd.clearRect(a,b,c,d)},clearDepth:function(a){this._renderCmd.clearDepth(a)},clearStencil:function(a){this._renderCmd.clearStencil(a)},getClearFlags:function(){return this.clearFlags},setClearFlags:function(a){this.clearFlags=a},getClearColor:function(){return this._clearColor},setClearColor:function(a){var b= this._clearColor;b.r=a.r;b.g=a.g;b.b=a.b;b.a=a.a;this._renderCmd.updateClearColor(a)},getClearDepth:function(){return this.clearDepthVal},setClearDepth:function(a){this.clearDepthVal=a},getClearStencil:function(){return this.clearStencilVal},setClearStencil:function(a){this.clearStencilVal=a},isAutoDraw:function(){return this.autoDraw},setAutoDraw:function(a){this.autoDraw=a},saveToFile:function(a,b){cc.log("saveToFile isn't supported on Cocos2d-Html5")},newCCImage:function(a){cc.log("saveToFile isn't supported on cocos2d-html5"); return null},listenToBackground:function(a){},listenToForeground:function(a){}});_p=cc.RenderTexture.prototype;cc.defineGetterSetter(_p,"clearColorVal",_p.getClearColor,_p.setClearColor);cc.RenderTexture.create=function(a,b,c,d){return new cc.RenderTexture(a,b,c,d)};(function(){cc.RenderTexture.CanvasRenderCmd=function(a){this._rootCtor(a);this._needDraw=!1;this._clearColorStr="rgba(255,255,255,1)";this._cacheCanvas=document.createElement("canvas");this._cacheContext=new cc.CanvasContextWrapper(this._cacheCanvas.getContext("2d"))};var a=cc.RenderTexture.CanvasRenderCmd.prototype=Object.create(cc.Node.CanvasRenderCmd.prototype);a.constructor=cc.RenderTexture.CanvasRenderCmd;a.cleanup=function(){this._cacheCanvas=this._cacheContext=null};a.clearStencil=function(a){}; a.setVirtualViewport=function(a,c,d){};a.updateClearColor=function(a){this._clearColorStr="rgba("+(0|a.r)+","+(0|a.g)+","+(0|a.b)+","+a.a/255+")"};a.initWithWidthAndHeight=function(a,c,d,e){d=this._node;e=this._cacheCanvas;var f=cc.contentScaleFactor();e.width=0|a*f;e.height=0|c*f;a=new cc.Texture2D;a.initWithElement(e);a.handleLoadedTexture();a=d.sprite=new cc.Sprite(a);a.setBlendFunc(cc.ONE,cc.ONE_MINUS_SRC_ALPHA);d.autoDraw=!1;d.addChild(a);return!0};a.begin=function(){};a._beginWithClear=function(a, c,d,e,f,g,h){a=a||0;c=c||0;d=d||0;e=isNaN(e)?255:e;f=this._cacheContext.getContext();g=this._cacheCanvas;f.setTransform(1,0,0,1,0,0);this._cacheContext.setFillStyle("rgba("+(0|a)+","+(0|c)+","+(0|d)+","+e/255+")");f.clearRect(0,0,g.width,g.height);f.fillRect(0,0,g.width,g.height)};a.end=function(){var a=this._node,c=cc.contentScaleFactor();cc.renderer._renderingToCacheCanvas(this._cacheContext,a.__instanceId,c,c);a=a.sprite._renderCmd;a._notifyRegionStatus&&a._notifyRegionStatus(cc.Node.CanvasRenderCmd.RegionStatus.Dirty)}; a.clearRect=function(a,c,d,e){this._cacheContext.clearRect(a,c,d,-e)};a.clearDepth=function(a){cc.log("clearDepth isn't supported on Cocos2d-Html5")}})();(function(){cc.RenderTexture.WebGLRenderCmd=function(a){this._rootCtor(a);this._needDraw=!0;this._depthRenderBuffer=this._textureCopy=this._oldFBO=this._fBO=null;this._rtTextureRect=new cc.Rect;this._fullRect=new cc.Rect;this._fullViewport=new cc.Rect};var a=cc.RenderTexture.WebGLRenderCmd.prototype=Object.create(cc.Node.WebGLRenderCmd.prototype);a.constructor=cc.RenderTexture.WebGLRenderCmd;a.setVirtualViewport=function(a,c,d){this._rtTextureRect.x=a.x;this._rtTextureRect.y=a.y;this._fullRect=c; this._fullViewport=d};a.needDraw=function(){return this._needDraw&&this._node.autoDraw};a.rendering=function(a){var c=a||cc._renderContext;a=this._node;if(a.autoDraw){a.begin();var d=a.clearFlags;if(d){var e=[0,0,0,0],f=0,g=0;d&c.COLOR_BUFFER_BIT&&(e=c.getParameter(c.COLOR_CLEAR_VALUE),c.clearColor(a._clearColor.r/255,a._clearColor.g/255,a._clearColor.b/255,a._clearColor.a/255));d&c.DEPTH_BUFFER_BIT&&(f=c.getParameter(c.DEPTH_CLEAR_VALUE),c.clearDepth(a.clearDepthVal));d&c.STENCIL_BUFFER_BIT&&(g= c.getParameter(c.STENCIL_CLEAR_VALUE),c.clearStencil(a.clearStencilVal));c.clear(d);d&c.COLOR_BUFFER_BIT&&c.clearColor(e[0],e[1],e[2],e[3]);d&c.DEPTH_BUFFER_BIT&&c.clearDepth(f);d&c.STENCIL_BUFFER_BIT&&c.clearStencil(g)}a.sortAllChildren();c=a._children;for(d=0;d=b)return 0;var c=this.getChildByTag(a),d=this.getChildByTag(a+b);return this._getLetterPosXLeft(d)-this._getLetterPosXLeft(c)},_checkWarp:function(a,b,c,d){for(var e=a[b],f=0,g=0;gc&&1c&&100>p++;)d*=c/k,d|=0,g=e.substr(d),k=h-this._getCharsWidth(f+d,g.length-1);for(p=0;kp++;)g&&(n=(m=cc.LabelTTF._wordRex.exec(g))?m[0].length:1,m=g),this._lineBreakWithoutSpaces&&(n=0),d+=n,g=e.substr(d),k=h-this._getCharsWidth(f+d,g.length-1);d-=n;0===d&&(d=1,m=m.substr(1));c=e.substr(0,d);cc.LabelTTF.wrapInspection&&cc.LabelTTF._symbolRex.test(m||g)&&(n=(f=cc.LabelTTF._lastWordRex.exec(c))? f[0].length:0,this._lineBreakWithoutSpaces&&(n=0),d-=n,m=e.substr(d),c=e.substr(0,d));cc.LabelTTF._firsrEnglish.test(m)&&(f=cc.LabelTTF._lastEnglish.exec(c))&&c!==f[0]&&(n=f[0].length,this._lineBreakWithoutSpaces&&(n=0),d-=n,m=e.substr(d),c=e.substr(0,d));a[b]=m||g;a.splice(b,0,c)}},updateLabel:function(){this.string=this._initialString;var a,b,c;if(0c)){var k=this.getChildByTag(c);if(null!=k){b=k.getPositionX()+k._getWidth()/2;k=0;switch(this._alignment){case cc.TEXT_ALIGNMENT_CENTER:k=this.width/2-b/2;break;case cc.TEXT_ALIGNMENT_RIGHT:k=this.width-b}if(0!== k)for(b=0;bc||(c=this.getChildByTag(c))&&(c.x+=k);a+=h;d++;f.length=0}}}else f.push(this._string[a])},setAlignment:function(a){this._alignment=a;this.updateLabel()},_getAlignment:function(){return this._alignment},setBoundingWidth:function(a){this._width=a;this.updateLabel()},_getBoundingWidth:function(){return this._width},setLineBreakWithoutSpace:function(a){this._lineBreakWithoutSpaces=a;this.updateLabel()},setScale:function(a,b){cc.Node.prototype.setScale.call(this,a,b);this.updateLabel()}, setScaleX:function(a){cc.Node.prototype.setScaleX.call(this,a);this.updateLabel()},setScaleY:function(a){cc.Node.prototype.setScaleY.call(this,a);this.updateLabel()},setFntFile:function(a){if(null!=a&&a!==this._fntFile){var b=cc.loader.getRes(a);b?(this._fntFile=a,this._config=b,a=cc.textureCache.addImage(b.atlasName),(this._textureLoaded=b=a.isLoaded())?(this.setTexture(a),this._string&&0=a||32===a||133===a||160===a||5760===a||8192<=a&&8202>=a||8232===a||8233===a||8239===a||8287===a||12288===a},_utf8_trim_ws:function(a){var b=a.length;if(!(0>=b)&&(b-=1,this._isspace_unicode(a[b]))){for(var c=b-1;0<=c;--c)if(this._isspace_unicode(a[c]))b=c;else break;this._utf8_trim_from(a,b)}},_utf8_trim_from:function(a,b){var c=a.length;b>=c||0>b||a.splice(b,c)}}); (function(){var a=cc.LabelBMFont.prototype;cc.EventHelper.prototype.apply(a);cc.defineGetterSetter(a,"string",a.getString,a._setStringForSetter);cc.defineGetterSetter(a,"boundingWidth",a._getBoundingWidth,a.setBoundingWidth);cc.defineGetterSetter(a,"textAlign",a._getAlignment,a.setAlignment);cc.defineGetterSetter(a,"texture",a.getTexture,a.setTexture)})();cc.LabelBMFont.create=function(a,b,c,d,e){return new cc.LabelBMFont(a,b,c,d,e)};cc.FntFrameCache={}; var _fntLoader={FNT_HEAD:/fntframes [^\n]*(\n|$)/gi,FNT_FRAME_NAME:/fntframe [^\n]*(\n|$)/gi,INFO_EXP:/info [^\n]*(\n|$)/gi,COMMON_EXP:/common [^\n]*(\n|$)/gi,PAGE_EXP:/page [^\n]*(\n|$)/gi,CHAR_EXP:/char [^\n]*(\n|$)/gi,KERNING_EXP:/kerning [^\n]*(\n|$)/gi,ITEM_EXP:/\w+=[^ \r\n]+/gi,INT_EXP:/^[\-]?\d+$/,_parseStrToObj:function(a){a=a.match(this.ITEM_EXP);var b={};if(a)for(var c=0,d=a.length;cf.width||e.scaleH>f.height)&&cc.log("cc.LabelBMFont._parseCommonArguments(): page can't be larger than supported")}1!==e.pages&&cc.log("cc.LabelBMFont._parseCommonArguments(): only supports 1 page");e=this._parseStrToObj(b.match(this.PAGE_EXP)[0]); 0!==e.id&&cc.log("cc.LabelBMFont._parseImageFileName() : file could not be found");a.atlasName=d?cc.path.join(cc.path.dirname(d.path)+e.file):cc.path.changeBasename(c,e.file);e=b.match(this.CHAR_EXP);f=a.fontDefDictionary={};c=0;for(d=e.length;cn||0>m||(n=cc.rect(n*f,m*g,f,g),m=e._contentSize,0>n.x||0>n.y||n.x+n.width>m.width||n.y+n.height>m.height))){k++;var m=c.charCodeAt(h),p=a.getChildByTag(h);p?32===m?(p.init(),p.setTextureRect(cc.rect(0,0,10,10),!1,cc.size(0,0))):(p.initWithTexture(e,n),p.visible=!0):(p=new cc.Sprite,32===m?(p.init(),p.setTextureRect(cc.rect(0,0,10,10),!1,cc.size(0,0))):p.initWithTexture(e,n),cc.Node.prototype.addChild.call(a, p,0,h));p.setPosition(k*f+f/2,g/2)}}this.updateContentSize(h,k+1)};a.updateContentSize=function(a,c){var d=this._node,e=d._contentSize;a!==c&&a*d._itemWidth===e.width&&d._itemHeight===e.height&&d.setContentSize(c*d._itemWidth,d._itemHeight)};a.setString=function(a){a=this._node;if(a._children){a=a._children;for(var c=a.length,d=0;de.getCapacity()&&cc.log("cc.LabelAtlas._updateAtlasValues(): Invalid String length");for(var m=e.quads,n=a._itemWidth,p=a._itemHeight,r=0,s=-1;rt||0>v||t*n+n>g||v*p+p>f)){s++;var w;cc.FIX_ARTIFACTS_BY_STRECHING_TEXEL?(t=(2*t*h+1)/(2*g),u=t+(2*h-2)/(2*g),v=(2*v*k+1)/(2*f),w=v+(2*k-2)/(2*f)):(t=t*h/g,u=t+h/g,v=v*k/f,w=v+k/f);var x=m[r],B=x.tl,y=x.tr,z=x.bl,x=x.br;B.texCoords.u=t;B.texCoords.v=v;y.texCoords.u=u;y.texCoords.v=v;z.texCoords.u=t;z.texCoords.v=w;x.texCoords.u=u;x.texCoords.v=w;z.vertices.x=s*n;z.vertices.y=0;z.vertices.z=0;x.vertices.x=s*n+n;x.vertices.y=0;x.vertices.z=0;B.vertices.x= s*n;B.vertices.y=a._itemHeight;B.vertices.z=0;y.vertices.x=s*n+n;y.vertices.y=a._itemHeight;y.vertices.z=0}}this._updateColor();this.updateContentSize(r,s+1);0a&&e.increaseTotalQuadsWith(d-a))};a.updateContentSize=function(a,c){var d=this._node,e=d._contentSize;a!==c&&a*d._itemWidth===e.width&&d._itemHeight===e.height&&d.setContentSize(c*d._itemWidth,d._itemHeight)};a.setString=function(a){a=a.length;a>this._textureAtlas.totalQuads&&this._textureAtlas.resizeCapacity(a)}; a._addChild=function(){}})();cc.MotionStreak=cc.Node.extend({texture:null,fastMode:!1,startingPositionInitialized:!1,_blendFunc:null,_stroke:0,_fadeDelta:0,_minSeg:0,_maxPoints:0,_nuPoints:0,_previousNuPoints:0,_pointVertexes:null,_pointState:null,_vertices:null,_colorPointer:null,_texCoords:null,_verticesBuffer:null,_colorPointerBuffer:null,_texCoordsBuffer:null,_className:"MotionStreak",ctor:function(a,b,c,d,e){cc.Node.prototype.ctor.call(this);this._positionR=cc.p(0,0);this._blendFunc=new cc.BlendFunc(cc.SRC_ALPHA,cc.ONE_MINUS_SRC_ALPHA); this.startingPositionInitialized=this.fastMode=!1;this.texture=null;this._previousNuPoints=this._nuPoints=this._maxPoints=this._minSeg=this._fadeDelta=this._stroke=0;this._texCoordsBuffer=this._colorPointerBuffer=this._verticesBuffer=this._texCoords=this._colorPointer=this._vertices=this._pointState=this._pointVertexes=null;void 0!==e&&this.initWithFade(a,b,c,d,e)},getTexture:function(){return this.texture},setTexture:function(a){this.texture!==a&&(this.texture=a)},getBlendFunc:function(){return this._blendFunc}, setBlendFunc:function(a,b){void 0===b?this._blendFunc=a:(this._blendFunc.src=a,this._blendFunc.dst=b)},getOpacity:function(){cc.log("cc.MotionStreak.getOpacity has not been supported.");return 0},setOpacity:function(a){cc.log("cc.MotionStreak.setOpacity has not been supported.")},setOpacityModifyRGB:function(a){},isOpacityModifyRGB:function(){return!1},isFastMode:function(){return this.fastMode},setFastMode:function(a){this.fastMode=a},isStartingPositionInitialized:function(){return this.startingPositionInitialized}, setStartingPositionInitialized:function(a){this.startingPositionInitialized=a},getStroke:function(){return this._stroke},setStroke:function(a){this._stroke=a},initWithFade:function(a,b,c,d,e){if(!e)throw Error("cc.MotionStreak.initWithFade(): Invalid filename or texture");cc.isString(e)&&(e=cc.textureCache.addImage(e));cc.Node.prototype.setPosition.call(this,cc.p(0,0));this.anchorY=this.anchorX=0;this.ignoreAnchor=!0;this.startingPositionInitialized=!1;this.fastMode=!0;this._minSeg=-1===b?c/5:b;this._minSeg*= this._minSeg;this._stroke=c;this._fadeDelta=1/a;this._maxPoints=a=(0|60*a)+2;this._nuPoints=0;this._pointState=new Float32Array(a);this._pointVertexes=new Float32Array(2*a);this._vertices=new Float32Array(4*a);this._texCoords=new Float32Array(4*a);this._colorPointer=new Uint8Array(8*a);this._verticesBuffer=gl.createBuffer();this._texCoordsBuffer=gl.createBuffer();this._colorPointerBuffer=gl.createBuffer();this._blendFunc.src=gl.SRC_ALPHA;this._blendFunc.dst=gl.ONE_MINUS_SRC_ALPHA;this.texture=e;this.color= d;this.scheduleUpdate();gl.bindBuffer(gl.ARRAY_BUFFER,this._verticesBuffer);gl.bufferData(gl.ARRAY_BUFFER,this._vertices,gl.DYNAMIC_DRAW);gl.bindBuffer(gl.ARRAY_BUFFER,this._texCoordsBuffer);gl.bufferData(gl.ARRAY_BUFFER,this._texCoords,gl.DYNAMIC_DRAW);gl.bindBuffer(gl.ARRAY_BUFFER,this._colorPointerBuffer);gl.bufferData(gl.ARRAY_BUFFER,this._colorPointer,gl.DYNAMIC_DRAW);return!0},tintWithColor:function(a){this.color=a;for(var b=this._colorPointer,c=0,d=2*this._nuPoints;c=h[b]?f++:(c=b-f,0=this._maxPoints?b=!1:0=b._nuPoints)&&b.texture&&b.texture.isLoaded()){a=a||cc._renderContext;var c=this._worldTransform;this._matrix.mat[0]=c.a;this._matrix.mat[4]=c.c;this._matrix.mat[12]=c.tx;this._matrix.mat[1]=c.b;this._matrix.mat[5]=c.d;this._matrix.mat[13]=c.ty;this._shaderProgram.use();this._shaderProgram._setUniformForMVPMatrixWithMat4(this._matrix);cc.glBlendFunc(b._blendFunc.src,b._blendFunc.dst);cc.glBindTexture2D(b.texture); a.enableVertexAttribArray(cc.VERTEX_ATTRIB_POSITION);a.enableVertexAttribArray(cc.VERTEX_ATTRIB_COLOR);a.enableVertexAttribArray(cc.VERTEX_ATTRIB_TEX_COORDS);a.bindBuffer(a.ARRAY_BUFFER,b._verticesBuffer);a.bufferData(a.ARRAY_BUFFER,b._vertices,a.DYNAMIC_DRAW);a.vertexAttribPointer(cc.VERTEX_ATTRIB_POSITION,2,a.FLOAT,!1,0,0);a.bindBuffer(a.ARRAY_BUFFER,b._texCoordsBuffer);a.bufferData(a.ARRAY_BUFFER,b._texCoords,a.DYNAMIC_DRAW);a.vertexAttribPointer(cc.VERTEX_ATTRIB_TEX_COORDS,2,a.FLOAT,!1,0,0);a.bindBuffer(a.ARRAY_BUFFER, b._colorPointerBuffer);a.bufferData(a.ARRAY_BUFFER,b._colorPointer,a.DYNAMIC_DRAW);a.vertexAttribPointer(cc.VERTEX_ATTRIB_COLOR,4,a.UNSIGNED_BYTE,!0,0,0);a.drawArrays(a.TRIANGLE_STRIP,0,2*b._nuPoints);cc.g_NumberOfDraws++}};cc.NodeGrid=cc.Node.extend({grid:null,_target:null,_gridRect:null,ctor:function(a){cc.Node.prototype.ctor.call(this);void 0===a&&(a=cc.rect());this._gridRect=a},getGrid:function(){return this.grid},setGrid:function(a){this.grid=a},setGridRect:function(a){this._gridRect=a},getGridRect:function(){return this._gridRect},setTarget:function(a){this._target=a},_createRenderCmd:function(){return cc._renderType===cc.game.RENDER_TYPE_WEBGL?new cc.NodeGrid.WebGLRenderCmd(this):new cc.Node.CanvasRenderCmd(this)}}); _p=cc.NodeGrid.prototype;cc.defineGetterSetter(_p,"target",null,_p.setTarget);cc.NodeGrid.create=function(){return new cc.NodeGrid};(function(){cc.NodeGrid.WebGLRenderCmd=function(a){this._rootCtor(a);this._needDraw=!1;this._gridBeginCommand=new cc.CustomRenderCmd(this,this.onGridBeginDraw);this._gridEndCommand=new cc.CustomRenderCmd(this,this.onGridEndDraw)};var a=cc.NodeGrid.WebGLRenderCmd.prototype=Object.create(cc.Node.WebGLRenderCmd.prototype);a.constructor=cc.NodeGrid.WebGLRenderCmd;a.visit=function(a){var c=this._node;if(c._visible){if(a=a||this.getParentRenderCmd())this._curLevel=a._curLevel+1;var d=cc.current_stack;d.stack.push(d.top); this._syncStatus(a);d.top=this._stackMatrix;cc.renderer.pushRenderCommand(this._gridBeginCommand);c._target&&c._target.visit();if((a=c._children)&&0c||this._bufferCapacity>c){var e=Math.max(Math.min(c+c,200),b,this._bufferCapacity);0!==c&&(a.freeBuffer(d,20*c),this._occupiedSize=0);b=this._offset=a.requestBuffer(20*e);if(0<=b){this._occupiedSize=this._bufferCapacity=e;this._f32Buffer=new Float32Array(a.data,b,5*this._occupiedSize);this._ui32Buffer=new Uint32Array(a.data,b,5*this._occupiedSize);if(0!==c&&d!==b)for(c=(d+c)/4,b/=4,d/=4;dthis._offset||0>=this._vertexCount||(this._dirty?(a.updateSubData(this._offset,this._f32Buffer),this._dirty=!1):b.bindBuffer(b.ARRAY_BUFFER, a.vertexBuffer),b.enableVertexAttribArray(cc.VERTEX_ATTRIB_POSITION),b.enableVertexAttribArray(cc.VERTEX_ATTRIB_COLOR),b.enableVertexAttribArray(cc.VERTEX_ATTRIB_TEX_COORDS),b.vertexAttribPointer(cc.VERTEX_ATTRIB_POSITION,2,b.FLOAT,!1,20,0),b.vertexAttribPointer(cc.VERTEX_ATTRIB_COLOR,4,b.UNSIGNED_BYTE,!0,20,8),b.vertexAttribPointer(cc.VERTEX_ATTRIB_TEX_COORDS,2,b.FLOAT,!1,20,12),b.drawArrays(b.TRIANGLES,this._offset/20,this._vertexCount),cc.incrementGLDraws(1))},appendVertexData:function(a,b,c,d, f){var g=this._f32Buffer,h=5*this._vertexCount;g[h]=a;g[h+1]=b;e[0]=c.a<<24|c.b<<16|c.g<<8|c.r;this._ui32Buffer[h+2]=e[0];g[h+3]=d;g[h+4]=f;this._vertexCount++},drawDot:function(a,b,c){c=c||this._drawColor;null==c.a&&(c.a=255);var d=a.x-b,e=a.y-b,f=a.x+b;a=a.y+b;this._ensureCapacity(this._vertexCount+6)&&(this.appendVertexData(d,e,c,-1,-1),this.appendVertexData(d,a,c,-1,1),this.appendVertexData(f,a,c,1,1),this.appendVertexData(d,e,c,-1,-1),this.appendVertexData(f,a,c,1,1),this.appendVertexData(f, e,c,1,-1),this._dirty=!0)},drawSegment:function(a,b,c,d){d=d||this.getDrawColor();null==d.a&&(d.a=255);c=c||0.5*this._lineWidth;if(this._ensureCapacity(this._vertexCount+18)){f.x=a.y-b.y;f.y=b.x-a.x;cc.pNormalizeIn(f);g.x=-f.y;g.y=f.x;var e=c;h.x=f.x*e;h.y=f.y*e;k.x=g.x*c;k.y=g.y*c;c=b.x+h.x-k.x;var e=b.y+h.y-k.y,m=f.x-g.x,v=f.y-g.y,w=b.x-h.x,x=b.y-h.y,B=-f.x,y=-f.y,z=b.x+h.x,C=b.y+h.y,A=f.x,D=f.y,F=a.x-h.x,M=a.y-h.y,E=a.x+h.x,N=a.y+h.y,Q=f.x,H=f.y,R=a.x-h.x+k.x,K=a.y-h.y+k.y,I=g.x-f.x,P=g.y-f.y, T=a.x+h.x+k.x;a=a.y+h.y+k.y;var S=f.x+g.x,O=f.y+g.y;this.appendVertexData(b.x-h.x-k.x,b.y-h.y-k.y,d,-(f.x+g.x),-(f.y+g.y));this.appendVertexData(c,e,d,m,v);this.appendVertexData(w,x,d,B,y);this.appendVertexData(z,C,d,A,D);this.appendVertexData(c,e,d,m,v);this.appendVertexData(w,x,d,B,y);this.appendVertexData(z,C,d,A,D);this.appendVertexData(F,M,d,B,y);this.appendVertexData(w,x,d,B,y);this.appendVertexData(z,C,d,A,D);this.appendVertexData(F,M,d,B,y);this.appendVertexData(E,N,d,Q,H);this.appendVertexData(R, K,d,I,P);this.appendVertexData(F,M,d,B,y);this.appendVertexData(E,N,d,Q,H);this.appendVertexData(R,K,d,I,P);this.appendVertexData(T,a,d,S,O);this.appendVertexData(E,N,d,Q,H);this._dirty=!0}},drawPoly:function(a,c,d,e){if("object"===typeof a[0]){for(var g=b.length=0;g=b)){c=c||this._drawColor;null==c.a&&(c.a=255);b*=0.5;var e,g,k,w,x,B,y,z=a.length;for(y=m.length=0;y=cc.stencilBits&&cc.log("Stencil buffer is not enabled."),cc.ClippingNode.WebGLRenderCmd._init_once=!1)};a.transform=function(a,c){var d=this._node;this.originTransform(a, c);d._stencil&&(d._stencil._renderCmd.transform(this,!0),d._stencil._dirtyFlag&=~cc.Node._dirtyFlags.transformDirty)};a.clippingVisit=function(a){var c=this._node;a=a||this.getParentRenderCmd();this.visit(a);if(1>cc.stencilBits)c._visitChildren();else if(c._stencil&&c._stencil.visible)if(cc.ClippingNode.WebGLRenderCmd._layer+1===cc.stencilBits)cc.ClippingNode.WebGLRenderCmd._visit_once=!0,cc.ClippingNode.WebGLRenderCmd._visit_once&&(cc.log("Nesting more than "+cc.stencilBits+"stencils is not supported. Everything will be drawn without stencil for this node and its children."), cc.ClippingNode.WebGLRenderCmd._visit_once=!1),c._visitChildren();else{cc.renderer.pushRenderCommand(this._beforeVisitCmd);c._stencil.visit(c);cc.renderer.pushRenderCommand(this._afterDrawStencilCmd);if((a=c._children)&&0a.alphaThreshold&&(c=cc.shaderCache.programForKey(cc.SHADER_POSITION_TEXTURECOLORALPHATEST),cc.glUseProgram(c.getProgram()),c.setUniformLocationWith1f(cc.UNIFORM_ALPHA_TEST_VALUE_S,a.alphaThreshold),c.setUniformLocationWithMatrix4fv(cc.UNIFORM_MVMATRIX_S,cc.renderer.mat4Identity.mat),cc.setProgram(a._stencil,c))};a._onAfterDrawStencil=function(a){a=a||cc._renderContext;a.depthMask(!0);a.stencilFunc(this._node.inverted?a.NOTEQUAL:a.EQUAL,this._mask_layer_le, this._mask_layer_le);a.stencilOp(a.KEEP,a.KEEP,a.KEEP)};a._onAfterVisit=function(a){a=a||cc._renderContext;cc.ClippingNode.WebGLRenderCmd._layer--;if(this._currentStencilEnabled){var c=1<h;++h)p[r[h]]=y[h].x,p[r[h]+1]=y[h].y,p[r[h]+2]=y[h].z,m[v[h]]=s[h].x/b,m[v[h]+1]=n?(d-s[h].y)/c:s[h].y/c}this._originalVertices=new Float32Array(this._vertices);a.bindBuffer(a.ARRAY_BUFFER,this._verticesBuffer);a.bufferData(a.ARRAY_BUFFER,this._vertices,a.DYNAMIC_DRAW);a.bindBuffer(a.ARRAY_BUFFER,this._texCoordinateBuffer);a.bufferData(a.ARRAY_BUFFER,this._texCoordinates,a.DYNAMIC_DRAW);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this._indicesBuffer);a.bufferData(a.ELEMENT_ARRAY_BUFFER, this._indices,a.STATIC_DRAW);this._dirty=!0},setNeedDepthTestForBlit:function(a){this._needDepthTestForBlit=a},getNeedDepthTestForBlit:function(){return this._needDepthTestForBlit}});cc.Grid3D.create=function(a,b,c){return new cc.Grid3D(a,b,c)}; cc.TiledGrid3D=cc.GridBase.extend({_texCoordinates:null,_vertices:null,_originalVertices:null,_indices:null,_texCoordinateBuffer:null,_verticesBuffer:null,_indicesBuffer:null,ctor:function(a,b,c,d){cc.GridBase.prototype.ctor.call(this);this._indicesBuffer=this._verticesBuffer=this._texCoordinateBuffer=this._indices=this._originalVertices=this._vertices=this._texCoordinates=null;this._matrix=new cc.math.Matrix4;this._matrix.identity();void 0!==a&&this.initWithSize(a,b,c,d)},tile:function(a){return this.getTile(a)}, getTile:function(a){a.x===(0|a.x)&&a.y===(0|a.y)||cc.log("cc.TiledGrid3D.tile() : Numbers must be integers");a=12*(this._gridSize.height*a.x+a.y);var b=this._vertices;return new cc.Quad3(new cc.Vertex3F(b[a],b[a+1],b[a+2]),new cc.Vertex3F(b[a+3],b[a+4],b[a+5]),new cc.Vertex3F(b[a+6],b[a+7],b[a+8]),new cc.Vertex3F(b[a+9],b[a+10],b[a+11]))},getOriginalTile:function(a){a.x===(0|a.x)&&a.y===(0|a.y)||cc.log("cc.TiledGrid3D.originalTile() : Numbers must be integers");a=12*(this._gridSize.height*a.x+a.y); var b=this._originalVertices;return new cc.Quad3(new cc.Vertex3F(b[a],b[a+1],b[a+2]),new cc.Vertex3F(b[a+3],b[a+4],b[a+5]),new cc.Vertex3F(b[a+6],b[a+7],b[a+8]),new cc.Vertex3F(b[a+9],b[a+10],b[a+11]))},originalTile:function(a){return this.getOriginalTile(a)},setTile:function(a,b){a.x===(0|a.x)&&a.y===(0|a.y)||cc.log("cc.TiledGrid3D.setTile() : Numbers must be integers");var c=12*(this._gridSize.height*a.x+a.y),d=this._vertices;d[c]=b.bl.x;d[c+1]=b.bl.y;d[c+2]=b.bl.z;d[c+3]=b.br.x;d[c+4]=b.br.y;d[c+ 5]=b.br.z;d[c+6]=b.tl.x;d[c+7]=b.tl.y;d[c+8]=b.tl.z;d[c+9]=b.tr.x;d[c+10]=b.tr.y;d[c+11]=b.tr.z;this._dirty=!0},blit:function(a){var b=this._gridSize.width*this._gridSize.height;a=a._renderCmd._worldTransform;this._matrix.mat[0]=a.a;this._matrix.mat[4]=a.c;this._matrix.mat[12]=a.tx;this._matrix.mat[1]=a.b;this._matrix.mat[5]=a.d;this._matrix.mat[13]=a.ty;this._shaderProgram.use();this._shaderProgram._setUniformForMVPMatrixWithMat4(this._matrix);a=cc._renderContext;var c=this._dirty;a.enableVertexAttribArray(cc.VERTEX_ATTRIB_POSITION); a.enableVertexAttribArray(cc.VERTEX_ATTRIB_TEX_COORDS);a.bindBuffer(a.ARRAY_BUFFER,this._verticesBuffer);c&&a.bufferData(a.ARRAY_BUFFER,this._vertices,a.DYNAMIC_DRAW);a.vertexAttribPointer(cc.VERTEX_ATTRIB_POSITION,3,a.FLOAT,!1,0,this._vertices);a.bindBuffer(a.ARRAY_BUFFER,this._texCoordinateBuffer);c&&a.bufferData(a.ARRAY_BUFFER,this._texCoordinates,a.DYNAMIC_DRAW);a.vertexAttribPointer(cc.VERTEX_ATTRIB_TEX_COORDS,2,a.FLOAT,!1,0,this._texCoordinates);a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this._indicesBuffer); c&&a.bufferData(a.ELEMENT_ARRAY_BUFFER,this._indices,a.STATIC_DRAW);a.drawElements(a.TRIANGLES,6*b,a.UNSIGNED_SHORT,0);c&&(this._dirty=!1);cc.incrementGLDraws(1)},reuse:function(){if(0=this._duration},_cloneDecoration:function(a){a._repeatForever=this._repeatForever;a._speed=this._speed;a._timesForRepeat=this._timesForRepeat;a._easeList=this._easeList;a._speedMethod=this._speedMethod;a._repeatMethod=this._repeatMethod},_reverseEaseList:function(a){if(this._easeList){a._easeList=[];for(var b=0;ba? a:1;this.update(0=a)return cc.log("The speed parameter error"),this;this._speedMethod=!0;this._speed*=a;return this},getSpeed:function(){return this._speed},setSpeed:function(a){this._speed=a;return this},repeat:function(a){a=Math.round(a);if(isNaN(a)||1>a)return cc.log("The repeat parameter error"),this;this._repeatMethod=!0;this._timesForRepeat*=a;return this},repeatForever:function(){this._repeatMethod= !0;this._timesForRepeat=this.MAX_VALUE;this._repeatForever=!0;return this}});cc.actionInterval=function(a){return new cc.ActionInterval(a)};cc.ActionInterval.create=cc.actionInterval; cc.Sequence=cc.ActionInterval.extend({_actions:null,_split:null,_last:0,ctor:function(a){cc.ActionInterval.prototype.ctor.call(this);this._actions=[];var b=a instanceof Array?a:arguments,c=b.length-1;0<=c&&null==b[c]&&cc.log("parameters should not be ending with null in Javascript");if(0<=c){for(var d=b[0],e=1;e=e){for(;a>e&&this._totale?this._two=cc.Sequence._actionOneTwo(b,cc.delayTime(d-e)):dc&&(c+=360);this._startAngleX=b;this._diffAngleX=c;this._startAngleY=a.rotationY%360;a=this._dstAngleY-this._startAngleY;180a&&(a+=360);this._diffAngleY=a},reverse:function(){cc.log("cc.RotateTo.reverse(): it should be overridden in subclass.")},update:function(a){a=this._computeEaseTime(a);this.target&&(this.target.rotationX= this._startAngleX+this._diffAngleX*a,this.target.rotationY=this._startAngleY+this._diffAngleY*a)}});cc.rotateTo=function(a,b,c){return new cc.RotateTo(a,b,c)};cc.RotateTo.create=cc.rotateTo; cc.RotateBy=cc.ActionInterval.extend({_angleX:0,_startAngleX:0,_angleY:0,_startAngleY:0,ctor:function(a,b,c){cc.ActionInterval.prototype.ctor.call(this);void 0!==b&&this.initWithDuration(a,b,c)},initWithDuration:function(a,b,c){return cc.ActionInterval.prototype.initWithDuration.call(this,a)?(this._angleX=b||0,this._angleY=c||this._angleX,!0):!1},clone:function(){var a=new cc.RotateBy;this._cloneDecoration(a);a.initWithDuration(this._duration,this._angleX,this._angleY);return a},startWithTarget:function(a){cc.ActionInterval.prototype.startWithTarget.call(this, a);this._startAngleX=a.rotationX;this._startAngleY=a.rotationY},update:function(a){a=this._computeEaseTime(a);this.target&&(this.target.rotationX=this._startAngleX+this._angleX*a,this.target.rotationY=this._startAngleY+this._angleY*a)},reverse:function(){var a=new cc.RotateBy(this._duration,-this._angleX,-this._angleY);this._cloneDecoration(a);this._reverseEaseList(a);return a}});cc.rotateBy=function(a,b,c){return new cc.RotateBy(a,b,c)};cc.RotateBy.create=cc.rotateBy; cc.MoveBy=cc.ActionInterval.extend({_positionDelta:null,_startPosition:null,_previousPosition:null,ctor:function(a,b,c){cc.ActionInterval.prototype.ctor.call(this);this._positionDelta=cc.p(0,0);this._startPosition=cc.p(0,0);this._previousPosition=cc.p(0,0);void 0!==b&&this.initWithDuration(a,b,c)},initWithDuration:function(a,b,c){return cc.ActionInterval.prototype.initWithDuration.call(this,a)?(void 0!==b.x&&(c=b.y,b=b.x),this._positionDelta.x=b,this._positionDelta.y=c,!0):!1},clone:function(){var a= new cc.MoveBy;this._cloneDecoration(a);a.initWithDuration(this._duration,this._positionDelta);return a},startWithTarget:function(a){cc.ActionInterval.prototype.startWithTarget.call(this,a);var b=a.getPositionX();a=a.getPositionY();this._previousPosition.x=b;this._previousPosition.y=a;this._startPosition.x=b;this._startPosition.y=a},update:function(a){a=this._computeEaseTime(a);if(this.target){var b=this._positionDelta.x*a;a*=this._positionDelta.y;var c=this._startPosition;if(cc.ENABLE_STACKABLE_ACTIONS){var d= this.target.getPositionX(),e=this.target.getPositionY(),f=this._previousPosition;c.x=c.x+d-f.x;c.y=c.y+e-f.y;b+=c.x;a+=c.y;f.x=b;f.y=a;this.target.setPosition(b,a)}else this.target.setPosition(c.x+b,c.y+a)}},reverse:function(){var a=new cc.MoveBy(this._duration,cc.p(-this._positionDelta.x,-this._positionDelta.y));this._cloneDecoration(a);this._reverseEaseList(a);return a}});cc.moveBy=function(a,b,c){return new cc.MoveBy(a,b,c)};cc.MoveBy.create=cc.moveBy; cc.MoveTo=cc.MoveBy.extend({_endPosition:null,ctor:function(a,b,c){cc.MoveBy.prototype.ctor.call(this);this._endPosition=cc.p(0,0);void 0!==b&&this.initWithDuration(a,b,c)},initWithDuration:function(a,b,c){return cc.MoveBy.prototype.initWithDuration.call(this,a,b,c)?(void 0!==b.x&&(c=b.y,b=b.x),this._endPosition.x=b,this._endPosition.y=c,!0):!1},clone:function(){var a=new cc.MoveTo;this._cloneDecoration(a);a.initWithDuration(this._duration,this._endPosition);return a},startWithTarget:function(a){cc.MoveBy.prototype.startWithTarget.call(this, a);this._positionDelta.x=this._endPosition.x-a.getPositionX();this._positionDelta.y=this._endPosition.y-a.getPositionY()}});cc.moveTo=function(a,b,c){return new cc.MoveTo(a,b,c)};cc.MoveTo.create=cc.moveTo; cc.SkewTo=cc.ActionInterval.extend({_skewX:0,_skewY:0,_startSkewX:0,_startSkewY:0,_endSkewX:0,_endSkewY:0,_deltaX:0,_deltaY:0,ctor:function(a,b,c){cc.ActionInterval.prototype.ctor.call(this);void 0!==c&&this.initWithDuration(a,b,c)},initWithDuration:function(a,b,c){var d=!1;cc.ActionInterval.prototype.initWithDuration.call(this,a)&&(this._endSkewX=b,this._endSkewY=c,d=!0);return d},clone:function(){var a=new cc.SkewTo;this._cloneDecoration(a);a.initWithDuration(this._duration,this._endSkewX,this._endSkewY); return a},startWithTarget:function(a){cc.ActionInterval.prototype.startWithTarget.call(this,a);this._startSkewX=a.skewX%180;this._deltaX=this._endSkewX-this._startSkewX;180this._deltaX&&(this._deltaX+=360);this._startSkewY=a.skewY%360;this._deltaY=this._endSkewY-this._startSkewY;180this._deltaY&&(this._deltaY+=360)},update:function(a){a=this._computeEaseTime(a);this.target.skewX=this._startSkewX+this._deltaX*a;this.target.skewY= this._startSkewY+this._deltaY*a}});cc.skewTo=function(a,b,c){return new cc.SkewTo(a,b,c)};cc.SkewTo.create=cc.skewTo; cc.SkewBy=cc.SkewTo.extend({ctor:function(a,b,c){cc.SkewTo.prototype.ctor.call(this);void 0!==c&&this.initWithDuration(a,b,c)},initWithDuration:function(a,b,c){var d=!1;cc.SkewTo.prototype.initWithDuration.call(this,a,b,c)&&(this._skewX=b,this._skewY=c,d=!0);return d},clone:function(){var a=new cc.SkewBy;this._cloneDecoration(a);a.initWithDuration(this._duration,this._skewX,this._skewY);return a},startWithTarget:function(a){cc.SkewTo.prototype.startWithTarget.call(this,a);this._deltaX=this._skewX; this._deltaY=this._skewY;this._endSkewX=this._startSkewX+this._deltaX;this._endSkewY=this._startSkewY+this._deltaY},reverse:function(){var a=new cc.SkewBy(this._duration,-this._skewX,-this._skewY);this._cloneDecoration(a);this._reverseEaseList(a);return a}});cc.skewBy=function(a,b,c){return new cc.SkewBy(a,b,c)};cc.SkewBy.create=cc.skewBy; cc.JumpBy=cc.ActionInterval.extend({_startPosition:null,_delta:null,_height:0,_jumps:0,_previousPosition:null,ctor:function(a,b,c,d,e){cc.ActionInterval.prototype.ctor.call(this);this._startPosition=cc.p(0,0);this._previousPosition=cc.p(0,0);this._delta=cc.p(0,0);void 0!==d&&this.initWithDuration(a,b,c,d,e)},initWithDuration:function(a,b,c,d,e){return cc.ActionInterval.prototype.initWithDuration.call(this,a)?(void 0===e&&(e=d,d=c,c=b.y,b=b.x),this._delta.x=b,this._delta.y=c,this._height=d,this._jumps= e,!0):!1},clone:function(){var a=new cc.JumpBy;this._cloneDecoration(a);a.initWithDuration(this._duration,this._delta,this._height,this._jumps);return a},startWithTarget:function(a){cc.ActionInterval.prototype.startWithTarget.call(this,a);var b=a.getPositionX();a=a.getPositionY();this._previousPosition.x=b;this._previousPosition.y=a;this._startPosition.x=b;this._startPosition.y=a},update:function(a){a=this._computeEaseTime(a);if(this.target){var b=a*this._jumps%1,b=4*this._height*b*(1-b),b=b+this._delta.y* a;a*=this._delta.x;var c=this._startPosition;if(cc.ENABLE_STACKABLE_ACTIONS){var d=this.target.getPositionX(),e=this.target.getPositionY(),f=this._previousPosition;c.x=c.x+d-f.x;c.y=c.y+e-f.y;a+=c.x;b+=c.y;f.x=a;f.y=b;this.target.setPosition(a,b)}else this.target.setPosition(c.x+a,c.y+b)}},reverse:function(){var a=new cc.JumpBy(this._duration,cc.p(-this._delta.x,-this._delta.y),this._height,this._jumps);this._cloneDecoration(a);this._reverseEaseList(a);return a}}); cc.jumpBy=function(a,b,c,d,e){return new cc.JumpBy(a,b,c,d,e)};cc.JumpBy.create=cc.jumpBy; cc.JumpTo=cc.JumpBy.extend({_endPosition:null,ctor:function(a,b,c,d,e){cc.JumpBy.prototype.ctor.call(this);this._endPosition=cc.p(0,0);void 0!==d&&this.initWithDuration(a,b,c,d,e)},initWithDuration:function(a,b,c,d,e){return cc.JumpBy.prototype.initWithDuration.call(this,a,b,c,d,e)?(void 0===e&&(c=b.y,b=b.x),this._endPosition.x=b,this._endPosition.y=c,!0):!1},startWithTarget:function(a){cc.JumpBy.prototype.startWithTarget.call(this,a);this._delta.x=this._endPosition.x-this._startPosition.x;this._delta.y= this._endPosition.y-this._startPosition.y},clone:function(){var a=new cc.JumpTo;this._cloneDecoration(a);a.initWithDuration(this._duration,this._endPosition,this._height,this._jumps);return a}});cc.jumpTo=function(a,b,c,d,e){return new cc.JumpTo(a,b,c,d,e)};cc.JumpTo.create=cc.jumpTo;cc.bezierAt=function(a,b,c,d,e){return Math.pow(1-e,3)*a+3*e*Math.pow(1-e,2)*b+3*Math.pow(e,2)*(1-e)*c+Math.pow(e,3)*d}; cc.BezierBy=cc.ActionInterval.extend({_config:null,_startPosition:null,_previousPosition:null,ctor:function(a,b){cc.ActionInterval.prototype.ctor.call(this);this._config=[];this._startPosition=cc.p(0,0);this._previousPosition=cc.p(0,0);b&&this.initWithDuration(a,b)},initWithDuration:function(a,b){return cc.ActionInterval.prototype.initWithDuration.call(this,a)?(this._config=b,!0):!1},clone:function(){var a=new cc.BezierBy;this._cloneDecoration(a);for(var b=[],c=0;cb/2}},startWithTarget:function(a){cc.ActionInterval.prototype.startWithTarget.call(this,a);this._originalState=a.visible},stop:function(){this.target.visible=this._originalState;cc.ActionInterval.prototype.stop.call(this)},reverse:function(){var a=new cc.Blink(this._duration,this._times);this._cloneDecoration(a);this._reverseEaseList(a);return a}});cc.blink=function(a,b){return new cc.Blink(a,b)};cc.Blink.create=cc.blink; cc.FadeTo=cc.ActionInterval.extend({_toOpacity:0,_fromOpacity:0,ctor:function(a,b){cc.ActionInterval.prototype.ctor.call(this);void 0!==b&&this.initWithDuration(a,b)},initWithDuration:function(a,b){return cc.ActionInterval.prototype.initWithDuration.call(this,a)?(this._toOpacity=b,!0):!1},clone:function(){var a=new cc.FadeTo;this._cloneDecoration(a);a.initWithDuration(this._duration,this._toOpacity);return a},update:function(a){a=this._computeEaseTime(a);var b=void 0!==this._fromOpacity?this._fromOpacity: 255;this.target.opacity=b+(this._toOpacity-b)*a},startWithTarget:function(a){cc.ActionInterval.prototype.startWithTarget.call(this,a);this._fromOpacity=a.opacity}});cc.fadeTo=function(a,b){return new cc.FadeTo(a,b)};cc.FadeTo.create=cc.fadeTo; cc.FadeIn=cc.FadeTo.extend({_reverseAction:null,ctor:function(a){cc.FadeTo.prototype.ctor.call(this);null==a&&(a=0);this.initWithDuration(a,255)},reverse:function(){var a=new cc.FadeOut;a.initWithDuration(this._duration,0);this._cloneDecoration(a);this._reverseEaseList(a);return a},clone:function(){var a=new cc.FadeIn;this._cloneDecoration(a);a.initWithDuration(this._duration,this._toOpacity);return a},startWithTarget:function(a){this._reverseAction&&(this._toOpacity=this._reverseAction._fromOpacity); cc.FadeTo.prototype.startWithTarget.call(this,a)}});cc.fadeIn=function(a){return new cc.FadeIn(a)};cc.FadeIn.create=cc.fadeIn; cc.FadeOut=cc.FadeTo.extend({ctor:function(a){cc.FadeTo.prototype.ctor.call(this);null==a&&(a=0);this.initWithDuration(a,0)},reverse:function(){var a=new cc.FadeIn;a._reverseAction=this;a.initWithDuration(this._duration,255);this._cloneDecoration(a);this._reverseEaseList(a);return a},clone:function(){var a=new cc.FadeOut;this._cloneDecoration(a);a.initWithDuration(this._duration,this._toOpacity);return a}});cc.fadeOut=function(a){return new cc.FadeOut(a)};cc.FadeOut.create=cc.fadeOut; cc.TintTo=cc.ActionInterval.extend({_to:null,_from:null,ctor:function(a,b,c,d){cc.ActionInterval.prototype.ctor.call(this);this._to=cc.color(0,0,0);this._from=cc.color(0,0,0);void 0!==d&&this.initWithDuration(a,b,c,d)},initWithDuration:function(a,b,c,d){return cc.ActionInterval.prototype.initWithDuration.call(this,a)?(this._to=cc.color(b,c,d),!0):!1},clone:function(){var a=new cc.TintTo;this._cloneDecoration(a);var b=this._to;a.initWithDuration(this._duration,b.r,b.g,b.b);return a},startWithTarget:function(a){cc.ActionInterval.prototype.startWithTarget.call(this, a);this._from=this.target.color},update:function(a){a=this._computeEaseTime(a);var b=this._from,c=this._to;b&&this.target.setColor(cc.color(b.r+(c.r-b.r)*a,b.g+(c.g-b.g)*a,b.b+(c.b-b.b)*a))}});cc.tintTo=function(a,b,c,d){return new cc.TintTo(a,b,c,d)};cc.TintTo.create=cc.tintTo; cc.TintBy=cc.ActionInterval.extend({_deltaR:0,_deltaG:0,_deltaB:0,_fromR:0,_fromG:0,_fromB:0,ctor:function(a,b,c,d){cc.ActionInterval.prototype.ctor.call(this);void 0!==d&&this.initWithDuration(a,b,c,d)},initWithDuration:function(a,b,c,d){return cc.ActionInterval.prototype.initWithDuration.call(this,a)?(this._deltaR=b,this._deltaG=c,this._deltaB=d,!0):!1},clone:function(){var a=new cc.TintBy;this._cloneDecoration(a);a.initWithDuration(this._duration,this._deltaR,this._deltaG,this._deltaB);return a}, startWithTarget:function(a){cc.ActionInterval.prototype.startWithTarget.call(this,a);a=a.color;this._fromR=a.r;this._fromG=a.g;this._fromB=a.b},update:function(a){a=this._computeEaseTime(a);this.target.color=cc.color(this._fromR+this._deltaR*a,this._fromG+this._deltaG*a,this._fromB+this._deltaB*a)},reverse:function(){var a=new cc.TintBy(this._duration,-this._deltaR,-this._deltaG,-this._deltaB);this._cloneDecoration(a);this._reverseEaseList(a);return a}}); cc.tintBy=function(a,b,c,d){return new cc.TintBy(a,b,c,d)};cc.TintBy.create=cc.tintBy;cc.DelayTime=cc.ActionInterval.extend({update:function(a){},reverse:function(){var a=new cc.DelayTime(this._duration);this._cloneDecoration(a);this._reverseEaseList(a);return a},clone:function(){var a=new cc.DelayTime;this._cloneDecoration(a);a.initWithDuration(this._duration);return a}});cc.delayTime=function(a){return new cc.DelayTime(a)};cc.DelayTime.create=cc.delayTime; cc.ReverseTime=cc.ActionInterval.extend({_other:null,ctor:function(a){cc.ActionInterval.prototype.ctor.call(this);this._other=null;a&&this.initWithAction(a)},initWithAction:function(a){if(!a)throw Error("cc.ReverseTime.initWithAction(): action must be non null");if(a===this._other)throw Error("cc.ReverseTime.initWithAction(): the action was already passed in.");return cc.ActionInterval.prototype.initWithDuration.call(this,a._duration)?(this._other=a,!0):!1},clone:function(){var a=new cc.ReverseTime; this._cloneDecoration(a);a.initWithAction(this._other.clone());return a},startWithTarget:function(a){cc.ActionInterval.prototype.startWithTarget.call(this,a);this._other.startWithTarget(a)},update:function(a){a=this._computeEaseTime(a);this._other&&this._other.update(1-a)},reverse:function(){return this._other.clone()},stop:function(){this._other.stop();cc.Action.prototype.stop.call(this)}});cc.reverseTime=function(a){return new cc.ReverseTime(a)};cc.ReverseTime.create=cc.reverseTime; cc.Animate=cc.ActionInterval.extend({_animation:null,_nextFrame:0,_origFrame:null,_executedLoops:0,_splitTimes:null,_currFrameIndex:0,ctor:function(a){cc.ActionInterval.prototype.ctor.call(this);this._splitTimes=[];a&&this.initWithAnimation(a)},getAnimation:function(){return this._animation},setAnimation:function(a){this._animation=a},getCurrentFrameIndex:function(){return this._currFrameIndex},initWithAnimation:function(a){if(!a)throw Error("cc.Animate.initWithAnimation(): animation must be non-NULL"); var b=a.getDuration();if(this.initWithDuration(b*a.getLoops())){this._nextFrame=0;this.setAnimation(a);this._origFrame=null;this._executedLoops=0;var c=this._splitTimes,d=c.length=0,e=b/a.getTotalDelayUnits();a=a.getFrames();cc.arrayVerifyType(a,cc.AnimationFrame);for(var f=0;fa&&(a*=this._animation.getLoops(),(0|a)>this._executedLoops&&(this._nextFrame=0,this._executedLoops++),a%=1);for(var b=this._animation.getFrames(),c=b.length,d=this._splitTimes,e=this._nextFrame;ea?this._inner.update(0.5*Math.pow(a,this._rate)):this._inner.update(1-0.5*Math.pow(2-a,this._rate))},clone:function(){var a=new cc.EaseInOut;a.initWithAction(this._inner.clone(),this._rate);return a},reverse:function(){return new cc.EaseInOut(this._inner.reverse(),this._rate)}}); cc.EaseInOut.create=function(a,b){return new cc.EaseInOut(a,b)};cc.easeInOut=function(a){return{_rate:a,easing:function(a){a*=2;return 1>a?0.5*Math.pow(a,this._rate):1-0.5*Math.pow(2-a,this._rate)},reverse:function(){return cc.easeInOut(this._rate)}}}; cc.EaseExponentialIn=cc.ActionEase.extend({update:function(a){this._inner.update(0===a?0:Math.pow(2,10*(a-1)))},reverse:function(){return new cc.EaseExponentialOut(this._inner.reverse())},clone:function(){var a=new cc.EaseExponentialIn;a.initWithAction(this._inner.clone());return a}});cc.EaseExponentialIn.create=function(a){return new cc.EaseExponentialIn(a)};cc._easeExponentialInObj={easing:function(a){return 0===a?0:Math.pow(2,10*(a-1))},reverse:function(){return cc._easeExponentialOutObj}}; cc.easeExponentialIn=function(){return cc._easeExponentialInObj};cc.EaseExponentialOut=cc.ActionEase.extend({update:function(a){this._inner.update(1===a?1:-Math.pow(2,-10*a)+1)},reverse:function(){return new cc.EaseExponentialIn(this._inner.reverse())},clone:function(){var a=new cc.EaseExponentialOut;a.initWithAction(this._inner.clone());return a}});cc.EaseExponentialOut.create=function(a){return new cc.EaseExponentialOut(a)}; cc._easeExponentialOutObj={easing:function(a){return 1===a?1:-Math.pow(2,-10*a)+1},reverse:function(){return cc._easeExponentialInObj}};cc.easeExponentialOut=function(){return cc._easeExponentialOutObj}; cc.EaseExponentialInOut=cc.ActionEase.extend({update:function(a){1!==a&&0!==a&&(a*=2,a=1>a?0.5*Math.pow(2,10*(a-1)):0.5*(-Math.pow(2,-10*(a-1))+2));this._inner.update(a)},reverse:function(){return new cc.EaseExponentialInOut(this._inner.reverse())},clone:function(){var a=new cc.EaseExponentialInOut;a.initWithAction(this._inner.clone());return a}});cc.EaseExponentialInOut.create=function(a){return new cc.EaseExponentialInOut(a)}; cc._easeExponentialInOutObj={easing:function(a){return 1!==a&&0!==a?(a*=2,1>a?0.5*Math.pow(2,10*(a-1)):0.5*(-Math.pow(2,-10*(a-1))+2)):a},reverse:function(){return cc._easeExponentialInOutObj}};cc.easeExponentialInOut=function(){return cc._easeExponentialInOutObj}; cc.EaseSineIn=cc.ActionEase.extend({update:function(a){a=0===a||1===a?a:-1*Math.cos(a*Math.PI/2)+1;this._inner.update(a)},reverse:function(){return new cc.EaseSineOut(this._inner.reverse())},clone:function(){var a=new cc.EaseSineIn;a.initWithAction(this._inner.clone());return a}});cc.EaseSineIn.create=function(a){return new cc.EaseSineIn(a)};cc._easeSineInObj={easing:function(a){return 0===a||1===a?a:-1*Math.cos(a*Math.PI/2)+1},reverse:function(){return cc._easeSineOutObj}};cc.easeSineIn=function(){return cc._easeSineInObj}; cc.EaseSineOut=cc.ActionEase.extend({update:function(a){a=0===a||1===a?a:Math.sin(a*Math.PI/2);this._inner.update(a)},reverse:function(){return new cc.EaseSineIn(this._inner.reverse())},clone:function(){var a=new cc.EaseSineOut;a.initWithAction(this._inner.clone());return a}});cc.EaseSineOut.create=function(a){return new cc.EaseSineOut(a)};cc._easeSineOutObj={easing:function(a){return 0===a||1===a?a:Math.sin(a*Math.PI/2)},reverse:function(){return cc._easeSineInObj}};cc.easeSineOut=function(){return cc._easeSineOutObj}; cc.EaseSineInOut=cc.ActionEase.extend({update:function(a){a=0===a||1===a?a:-0.5*(Math.cos(Math.PI*a)-1);this._inner.update(a)},clone:function(){var a=new cc.EaseSineInOut;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseSineInOut(this._inner.reverse())}});cc.EaseSineInOut.create=function(a){return new cc.EaseSineInOut(a)};cc._easeSineInOutObj={easing:function(a){return 0===a||1===a?a:-0.5*(Math.cos(Math.PI*a)-1)},reverse:function(){return cc._easeSineInOutObj}}; cc.easeSineInOut=function(){return cc._easeSineInOutObj}; cc.EaseElastic=cc.ActionEase.extend({_period:0.3,ctor:function(a,b){cc.ActionEase.prototype.ctor.call(this);a&&this.initWithAction(a,b)},getPeriod:function(){return this._period},setPeriod:function(a){this._period=a},initWithAction:function(a,b){cc.ActionEase.prototype.initWithAction.call(this,a);this._period=null==b?0.3:b;return!0},reverse:function(){cc.log("cc.EaseElastic.reverse(): it should be overridden in subclass.");return null},clone:function(){var a=new cc.EaseElastic;a.initWithAction(this._inner.clone(), this._period);return a}});cc.EaseElastic.create=function(a,b){return new cc.EaseElastic(a,b)};cc.EaseElasticIn=cc.EaseElastic.extend({update:function(a){var b=0;0===a||1===a?b=a:(b=this._period/4,a-=1,b=-Math.pow(2,10*a)*Math.sin((a-b)*Math.PI*2/this._period));this._inner.update(b)},reverse:function(){return new cc.EaseElasticOut(this._inner.reverse(),this._period)},clone:function(){var a=new cc.EaseElasticIn;a.initWithAction(this._inner.clone(),this._period);return a}}); cc.EaseElasticIn.create=function(a,b){return new cc.EaseElasticIn(a,b)};cc._easeElasticInObj={easing:function(a){if(0===a||1===a)return a;a-=1;return-Math.pow(2,10*a)*Math.sin((a-0.075)*Math.PI*2/0.3)},reverse:function(){return cc._easeElasticOutObj}};cc.easeElasticIn=function(a){return a&&0.3!==a?{_period:a,easing:function(a){if(0===a||1===a)return a;a-=1;return-Math.pow(2,10*a)*Math.sin((a-this._period/4)*Math.PI*2/this._period)},reverse:function(){return cc.easeElasticOut(this._period)}}:cc._easeElasticInObj}; cc.EaseElasticOut=cc.EaseElastic.extend({update:function(a){var b=0;0===a||1===a?b=a:(b=this._period/4,b=Math.pow(2,-10*a)*Math.sin((a-b)*Math.PI*2/this._period)+1);this._inner.update(b)},reverse:function(){return new cc.EaseElasticIn(this._inner.reverse(),this._period)},clone:function(){var a=new cc.EaseElasticOut;a.initWithAction(this._inner.clone(),this._period);return a}});cc.EaseElasticOut.create=function(a,b){return new cc.EaseElasticOut(a,b)}; cc._easeElasticOutObj={easing:function(a){return 0===a||1===a?a:Math.pow(2,-10*a)*Math.sin((a-0.075)*Math.PI*2/0.3)+1},reverse:function(){return cc._easeElasticInObj}};cc.easeElasticOut=function(a){return a&&0.3!==a?{_period:a,easing:function(a){return 0===a||1===a?a:Math.pow(2,-10*a)*Math.sin((a-this._period/4)*Math.PI*2/this._period)+1},reverse:function(){return cc.easeElasticIn(this._period)}}:cc._easeElasticOutObj}; cc.EaseElasticInOut=cc.EaseElastic.extend({update:function(a){var b=0,b=this._period;if(0===a||1===a)b=a;else{b||(b=this._period=0.3*1.5);var c=b/4;a=2*a-1;b=0>a?-0.5*Math.pow(2,10*a)*Math.sin((a-c)*Math.PI*2/b):Math.pow(2,-10*a)*Math.sin((a-c)*Math.PI*2/b)*0.5+1}this._inner.update(b)},reverse:function(){return new cc.EaseElasticInOut(this._inner.reverse(),this._period)},clone:function(){var a=new cc.EaseElasticInOut;a.initWithAction(this._inner.clone(),this._period);return a}}); cc.EaseElasticInOut.create=function(a,b){return new cc.EaseElasticInOut(a,b)};cc.easeElasticInOut=function(a){return{_period:a||0.3,easing:function(a){var c=0,c=this._period;if(0===a||1===a)c=a;else{c||(c=this._period=0.3*1.5);var d=c/4;a=2*a-1;c=0>a?-0.5*Math.pow(2,10*a)*Math.sin((a-d)*Math.PI*2/c):Math.pow(2,-10*a)*Math.sin((a-d)*Math.PI*2/c)*0.5+1}return c},reverse:function(){return cc.easeElasticInOut(this._period)}}}; cc.EaseBounce=cc.ActionEase.extend({bounceTime:function(a){if(a<1/2.75)return 7.5625*a*a;if(a<2/2.75)return a-=1.5/2.75,7.5625*a*a+0.75;if(a<2.5/2.75)return a-=2.25/2.75,7.5625*a*a+0.9375;a-=2.625/2.75;return 7.5625*a*a+0.984375},clone:function(){var a=new cc.EaseBounce;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseBounce(this._inner.reverse())}});cc.EaseBounce.create=function(a){return new cc.EaseBounce(a)}; cc.EaseBounceIn=cc.EaseBounce.extend({update:function(a){a=1-this.bounceTime(1-a);this._inner.update(a)},reverse:function(){return new cc.EaseBounceOut(this._inner.reverse())},clone:function(){var a=new cc.EaseBounceIn;a.initWithAction(this._inner.clone());return a}});cc.EaseBounceIn.create=function(a){return new cc.EaseBounceIn(a)}; cc._bounceTime=function(a){if(a<1/2.75)return 7.5625*a*a;if(a<2/2.75)return a-=1.5/2.75,7.5625*a*a+0.75;if(a<2.5/2.75)return a-=2.25/2.75,7.5625*a*a+0.9375;a-=2.625/2.75;return 7.5625*a*a+0.984375};cc._easeBounceInObj={easing:function(a){return 1-cc._bounceTime(1-a)},reverse:function(){return cc._easeBounceOutObj}};cc.easeBounceIn=function(){return cc._easeBounceInObj}; cc.EaseBounceOut=cc.EaseBounce.extend({update:function(a){a=this.bounceTime(a);this._inner.update(a)},reverse:function(){return new cc.EaseBounceIn(this._inner.reverse())},clone:function(){var a=new cc.EaseBounceOut;a.initWithAction(this._inner.clone());return a}});cc.EaseBounceOut.create=function(a){return new cc.EaseBounceOut(a)};cc._easeBounceOutObj={easing:function(a){return cc._bounceTime(a)},reverse:function(){return cc._easeBounceInObj}};cc.easeBounceOut=function(){return cc._easeBounceOutObj}; cc.EaseBounceInOut=cc.EaseBounce.extend({update:function(a){var b=0,b=0.5>a?0.5*(1-this.bounceTime(1-2*a)):0.5*this.bounceTime(2*a-1)+0.5;this._inner.update(b)},clone:function(){var a=new cc.EaseBounceInOut;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseBounceInOut(this._inner.reverse())}});cc.EaseBounceInOut.create=function(a){return new cc.EaseBounceInOut(a)}; cc._easeBounceInOutObj={easing:function(a){return a=0.5>a?0.5*(1-cc._bounceTime(1-2*a)):0.5*cc._bounceTime(2*a-1)+0.5},reverse:function(){return cc._easeBounceInOutObj}};cc.easeBounceInOut=function(){return cc._easeBounceInOutObj};cc.EaseBackIn=cc.ActionEase.extend({update:function(a){this._inner.update(0===a||1===a?a:a*a*(2.70158*a-1.70158))},reverse:function(){return new cc.EaseBackOut(this._inner.reverse())},clone:function(){var a=new cc.EaseBackIn;a.initWithAction(this._inner.clone());return a}}); cc.EaseBackIn.create=function(a){return new cc.EaseBackIn(a)};cc._easeBackInObj={easing:function(a){return 0===a||1===a?a:a*a*(2.70158*a-1.70158)},reverse:function(){return cc._easeBackOutObj}};cc.easeBackIn=function(){return cc._easeBackInObj}; cc.EaseBackOut=cc.ActionEase.extend({update:function(a){a-=1;this._inner.update(a*a*(2.70158*a+1.70158)+1)},reverse:function(){return new cc.EaseBackIn(this._inner.reverse())},clone:function(){var a=new cc.EaseBackOut;a.initWithAction(this._inner.clone());return a}});cc.EaseBackOut.create=function(a){return new cc.EaseBackOut(a)};cc._easeBackOutObj={easing:function(a){a-=1;return a*a*(2.70158*a+1.70158)+1},reverse:function(){return cc._easeBackInObj}};cc.easeBackOut=function(){return cc._easeBackOutObj}; cc.EaseBackInOut=cc.ActionEase.extend({update:function(a){a*=2;1>a?this._inner.update(a*a*(3.5949095*a-2.5949095)/2):(a-=2,this._inner.update(a*a*(3.5949095*a+2.5949095)/2+1))},clone:function(){var a=new cc.EaseBackInOut;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseBackInOut(this._inner.reverse())}});cc.EaseBackInOut.create=function(a){return new cc.EaseBackInOut(a)}; cc._easeBackInOutObj={easing:function(a){a*=2;if(1>a)return a*a*(3.5949095*a-2.5949095)/2;a-=2;return a*a*(3.5949095*a+2.5949095)/2+1},reverse:function(){return cc._easeBackInOutObj}};cc.easeBackInOut=function(){return cc._easeBackInOutObj}; cc.EaseBezierAction=cc.ActionEase.extend({_p0:null,_p1:null,_p2:null,_p3:null,ctor:function(a){cc.ActionEase.prototype.ctor.call(this,a)},_updateTime:function(a,b,c,d,e){return Math.pow(1-e,3)*a+3*e*Math.pow(1-e,2)*b+3*Math.pow(e,2)*(1-e)*c+Math.pow(e,3)*d},update:function(a){a=this._updateTime(this._p0,this._p1,this._p2,this._p3,a);this._inner.update(a)},clone:function(){var a=new cc.EaseBezierAction;a.initWithAction(this._inner.clone());a.setBezierParamer(this._p0,this._p1,this._p2,this._p3);return a}, reverse:function(){var a=new cc.EaseBezierAction(this._inner.reverse());a.setBezierParamer(this._p3,this._p2,this._p1,this._p0);return a},setBezierParamer:function(a,b,c,d){this._p0=a||0;this._p1=b||0;this._p2=c||0;this._p3=d||0}});cc.EaseBezierAction.create=function(a){return new cc.EaseBezierAction(a)};cc.easeBezierAction=function(a,b,c,d){return{easing:function(e){return cc.EaseBezierAction.prototype._updateTime(a,b,c,d,e)},reverse:function(){return cc.easeBezierAction(d,c,b,a)}}}; cc.EaseQuadraticActionIn=cc.ActionEase.extend({_updateTime:function(a){return Math.pow(a,2)},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseQuadraticActionIn;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseQuadraticActionIn(this._inner.reverse())}});cc.EaseQuadraticActionIn.create=function(a){return new cc.EaseQuadraticActionIn(a)};cc._easeQuadraticActionIn={easing:cc.EaseQuadraticActionIn.prototype._updateTime,reverse:function(){return cc._easeQuadraticActionIn}}; cc.easeQuadraticActionIn=function(){return cc._easeQuadraticActionIn};cc.EaseQuadraticActionOut=cc.ActionEase.extend({_updateTime:function(a){return-a*(a-2)},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseQuadraticActionOut;a.initWithAction();return a},reverse:function(){return new cc.EaseQuadraticActionOut(this._inner.reverse())}});cc.EaseQuadraticActionOut.create=function(a){return new cc.EaseQuadraticActionOut(a)}; cc._easeQuadraticActionOut={easing:cc.EaseQuadraticActionOut.prototype._updateTime,reverse:function(){return cc._easeQuadraticActionOut}};cc.easeQuadraticActionOut=function(){return cc._easeQuadraticActionOut}; cc.EaseQuadraticActionInOut=cc.ActionEase.extend({_updateTime:function(a){var b=a;a*=2;1>a?b=a*a*0.5:(--a,b=-0.5*(a*(a-2)-1));return b},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseQuadraticActionInOut;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseQuadraticActionInOut(this._inner.reverse())}});cc.EaseQuadraticActionInOut.create=function(a){return new cc.EaseQuadraticActionInOut(a)}; cc._easeQuadraticActionInOut={easing:cc.EaseQuadraticActionInOut.prototype._updateTime,reverse:function(){return cc._easeQuadraticActionInOut}};cc.easeQuadraticActionInOut=function(){return cc._easeQuadraticActionInOut};cc.EaseQuarticActionIn=cc.ActionEase.extend({_updateTime:function(a){return a*a*a*a},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseQuarticActionIn;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseQuarticActionIn(this._inner.reverse())}}); cc.EaseQuarticActionIn.create=function(a){return new cc.EaseQuarticActionIn(a)};cc._easeQuarticActionIn={easing:cc.EaseQuarticActionIn.prototype._updateTime,reverse:function(){return cc._easeQuarticActionIn}};cc.easeQuarticActionIn=function(){return cc._easeQuarticActionIn}; cc.EaseQuarticActionOut=cc.ActionEase.extend({_updateTime:function(a){a-=1;return-(a*a*a*a-1)},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseQuarticActionOut;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseQuarticActionOut(this._inner.reverse())}});cc.EaseQuarticActionOut.create=function(a){return new cc.EaseQuarticActionOut(a)};cc._easeQuarticActionOut={easing:cc.EaseQuarticActionOut.prototype._updateTime,reverse:function(){return cc._easeQuarticActionOut}}; cc.easeQuarticActionOut=function(){return cc._easeQuarticActionOut};cc.EaseQuarticActionInOut=cc.ActionEase.extend({_updateTime:function(a){a*=2;if(1>a)return 0.5*a*a*a*a;a-=2;return-0.5*(a*a*a*a-2)},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseQuarticActionInOut;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseQuarticActionInOut(this._inner.reverse())}});cc.EaseQuarticActionInOut.create=function(a){return new cc.EaseQuarticActionInOut(a)}; cc._easeQuarticActionInOut={easing:cc.EaseQuarticActionInOut.prototype._updateTime,reverse:function(){return cc._easeQuarticActionInOut}};cc.easeQuarticActionInOut=function(){return cc._easeQuarticActionInOut};cc.EaseQuinticActionIn=cc.ActionEase.extend({_updateTime:function(a){return a*a*a*a*a},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseQuinticActionIn;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseQuinticActionIn(this._inner.reverse())}}); cc.EaseQuinticActionIn.create=function(a){return new cc.EaseQuinticActionIn(a)};cc._easeQuinticActionIn={easing:cc.EaseQuinticActionIn.prototype._updateTime,reverse:function(){return cc._easeQuinticActionIn}};cc.easeQuinticActionIn=function(){return cc._easeQuinticActionIn}; cc.EaseQuinticActionOut=cc.ActionEase.extend({_updateTime:function(a){a-=1;return a*a*a*a*a+1},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseQuinticActionOut;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseQuinticActionOut(this._inner.reverse())}});cc.EaseQuinticActionOut.create=function(a){return new cc.EaseQuinticActionOut(a)};cc._easeQuinticActionOut={easing:cc.EaseQuinticActionOut.prototype._updateTime,reverse:function(){return cc._easeQuinticActionOut}}; cc.easeQuinticActionOut=function(){return cc._easeQuinticActionOut};cc.EaseQuinticActionInOut=cc.ActionEase.extend({_updateTime:function(a){a*=2;if(1>a)return 0.5*a*a*a*a*a;a-=2;return 0.5*(a*a*a*a*a+2)},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseQuinticActionInOut;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseQuinticActionInOut(this._inner.reverse())}});cc.EaseQuinticActionInOut.create=function(a){return new cc.EaseQuinticActionInOut(a)}; cc._easeQuinticActionInOut={easing:cc.EaseQuinticActionInOut.prototype._updateTime,reverse:function(){return cc._easeQuinticActionInOut}};cc.easeQuinticActionInOut=function(){return cc._easeQuinticActionInOut};cc.EaseCircleActionIn=cc.ActionEase.extend({_updateTime:function(a){return-1*(Math.sqrt(1-a*a)-1)},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseCircleActionIn;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseCircleActionIn(this._inner.reverse())}}); cc.EaseCircleActionIn.create=function(a){return new cc.EaseCircleActionIn(a)};cc._easeCircleActionIn={easing:cc.EaseCircleActionIn.prototype._updateTime,reverse:function(){return cc._easeCircleActionIn}};cc.easeCircleActionIn=function(){return cc._easeCircleActionIn}; cc.EaseCircleActionOut=cc.ActionEase.extend({_updateTime:function(a){a-=1;return Math.sqrt(1-a*a)},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseCircleActionOut;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseCircleActionOut(this._inner.reverse())}});cc.EaseCircleActionOut.create=function(a){return new cc.EaseCircleActionOut(a)};cc._easeCircleActionOut={easing:cc.EaseCircleActionOut.prototype._updateTime,reverse:function(){return cc._easeCircleActionOut}}; cc.easeCircleActionOut=function(){return cc._easeCircleActionOut};cc.EaseCircleActionInOut=cc.ActionEase.extend({_updateTime:function(a){a*=2;if(1>a)return-0.5*(Math.sqrt(1-a*a)-1);a-=2;return 0.5*(Math.sqrt(1-a*a)+1)},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseCircleActionInOut;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseCircleActionInOut(this._inner.reverse())}});cc.EaseCircleActionInOut.create=function(a){return new cc.EaseCircleActionInOut(a)}; cc._easeCircleActionInOut={easing:cc.EaseCircleActionInOut.prototype._updateTime,reverse:function(){return cc._easeCircleActionInOut}};cc.easeCircleActionInOut=function(){return cc._easeCircleActionInOut};cc.EaseCubicActionIn=cc.ActionEase.extend({_updateTime:function(a){return a*a*a},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseCubicActionIn;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseCubicActionIn(this._inner.reverse())}}); cc.EaseCubicActionIn.create=function(a){return new cc.EaseCubicActionIn(a)};cc._easeCubicActionIn={easing:cc.EaseCubicActionIn.prototype._updateTime,reverse:function(){return cc._easeCubicActionIn}};cc.easeCubicActionIn=function(){return cc._easeCubicActionIn}; cc.EaseCubicActionOut=cc.ActionEase.extend({_updateTime:function(a){a-=1;return a*a*a+1},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseCubicActionOut;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseCubicActionOut(this._inner.reverse())}});cc.EaseCubicActionOut.create=function(a){return new cc.EaseCubicActionOut(a)};cc._easeCubicActionOut={easing:cc.EaseCubicActionOut.prototype._updateTime,reverse:function(){return cc._easeCubicActionOut}}; cc.easeCubicActionOut=function(){return cc._easeCubicActionOut};cc.EaseCubicActionInOut=cc.ActionEase.extend({_updateTime:function(a){a*=2;if(1>a)return 0.5*a*a*a;a-=2;return 0.5*(a*a*a+2)},update:function(a){this._inner.update(this._updateTime(a))},clone:function(){var a=new cc.EaseCubicActionInOut;a.initWithAction(this._inner.clone());return a},reverse:function(){return new cc.EaseCubicActionInOut(this._inner.reverse())}});cc.EaseCubicActionInOut.create=function(a){return new cc.EaseCubicActionInOut(a)}; cc._easeCubicActionInOut={easing:cc.EaseCubicActionInOut.prototype._updateTime,reverse:function(){return cc._easeCubicActionInOut}};cc.easeCubicActionInOut=function(){return cc._easeCubicActionInOut};cc.cardinalSplineAt=function(a,b,c,d,e,f,g){var h=f*f,k=h*f,m=(1-e)/2;e=m*(-k+2*h-f);var n=m*(-k+h)+(2*k-3*h+1);f=m*(k-2*h+f)+(-2*k+3*h);k=m*(k-h);h=a.x*e+b.x*n+c.x*f+d.x*k;a=a.y*e+b.y*n+c.y*f+d.y*k;if(void 0!==g)g.x=h,g.y=a;else return cc.p(h,a)};cc.reverseControlPoints=function(a){for(var b=[],c=a.length-1;0<=c;c--)b.push(cc.p(a[c].x,a[c].y));return b};cc.cloneControlPoints=function(a){for(var b=[],c=0;cg?(e=cc.p(0,0),d=cc.p(0,1),h=cc.p(1,0),k=cc.p(1,1)):(h=cc.p(0,0),k=cc.p(0,1),e=cc.p(1,0),d=cc.p(1,1),f=g);b.x=f-f*c;b.z=Math.abs(parseFloat(f*a/4));a=this.originalVertex(e);a.x=b.x;a.z+=b.z;this.setVertex(e,a);a=this.originalVertex(d);a.x=b.x;a.z+=b.z;this.setVertex(d,a);a=this.originalVertex(h);a.x-=b.x;a.z-=b.z;this.setVertex(h,a);a=this.originalVertex(k);a.x-=b.x;a.z-=b.z;this.setVertex(k, a)}});cc.flipX3D=function(a){return new cc.FlipX3D(a)};cc.FlipX3D.create=cc.flipX3D; cc.FlipY3D=cc.FlipX3D.extend({ctor:function(a){void 0!==a?cc.GridAction.prototype.ctor.call(this,a,cc.size(1,1)):cc.GridAction.prototype.ctor.call(this)},update:function(a){var b=Math.PI*a;a=Math.sin(b);var c=Math.cos(b/2),b=new cc.Vertex3F,d=cc.p(0,0);d.x=d.y=1;var e=this.originalVertex(d);d.x=d.y=0;var d=this.originalVertex(d),f=e.y,g=d.y,h,k;f>g?(e=cc.p(0,0),d=cc.p(0,1),h=cc.p(1,0),k=cc.p(1,1)):(d=cc.p(0,0),e=cc.p(0,1),k=cc.p(1,0),h=cc.p(1,1),f=g);b.y=f-f*c;b.z=Math.abs(parseFloat(f*a)/4);a=this.originalVertex(e); a.y=b.y;a.z+=b.z;this.setVertex(e,a);a=this.originalVertex(d);a.y-=b.y;a.z-=b.z;this.setVertex(d,a);a=this.originalVertex(h);a.y=b.y;a.z+=b.z;this.setVertex(h,a);a=this.originalVertex(k);a.y-=b.y;a.z-=b.z;this.setVertex(k,a)}});cc.flipY3D=function(a){return new cc.FlipY3D(a)};cc.FlipY3D.create=cc.flipY3D; cc.Lens3D=cc.Grid3DAction.extend({_position:null,_radius:0,_lensEffect:0,_concave:!1,_dirty:!1,ctor:function(a,b,c,d){cc.GridAction.prototype.ctor.call(this);this._position=cc.p(0,0);void 0!==d&&this.initWithDuration(a,b,c,d)},getLensEffect:function(){return this._lensEffect},setLensEffect:function(a){this._lensEffect=a},setConcave:function(a){this._concave=a},getPosition:function(){return this._position},setPosition:function(a){cc.pointEqualToPoint(a,this._position)||(this._position.x=a.x,this._position.y= a.y,this._dirty=!0)},initWithDuration:function(a,b,c,d){return cc.Grid3DAction.prototype.initWithDuration.call(this,a,b)?(this.setPosition(c),this._radius=d,this._lensEffect=0.7,this._dirty=!0):!1},update:function(a){if(this._dirty){a=this._gridSize.width;for(var b=this._gridSize.height,c=this._radius,d=this._lensEffect,e=cc.p(0,0),f=cc.p(0,0),g,h,k,m=0;md?this.transformTile(c,d):this.turnOnTile(c)}});cc.fadeOutTRTiles=function(a,b){return new cc.FadeOutTRTiles(a,b)};cc.FadeOutTRTiles.create=cc.fadeOutTRTiles; cc.FadeOutBLTiles=cc.FadeOutTRTiles.extend({testFunc:function(a,b){var c=this._gridSize.width*(1-b),d=this._gridSize.height*(1-b);return 0===c+d?0:0===a.x+a.y?1:Math.pow((c+d)/(a.x+a.y),6)}});cc.fadeOutBLTiles=function(a,b){return new cc.FadeOutBLTiles(a,b)};cc.FadeOutBLTiles.create=cc.fadeOutBLTiles; cc.FadeOutUpTiles=cc.FadeOutTRTiles.extend({testFunc:function(a,b){var c=this._gridSize.height*b;return c===this._gridSize.height?0:0===c?1:Math.pow(a.y/c,6)},transformTile:function(a,b){var c=this.originalTile(a),d=this.target.grid.getStep();c.bl.y+=d.y/2*(1-b);c.br.y+=d.y/2*(1-b);c.tl.y-=d.y/2*(1-b);c.tr.y-=d.y/2*(1-b);this.setTile(a,c)}});cc.fadeOutUpTiles=function(a,b){return new cc.FadeOutUpTiles(a,b)};cc.FadeOutUpTiles.create=cc.fadeOutUpTiles; cc.FadeOutDownTiles=cc.FadeOutUpTiles.extend({testFunc:function(a,b){var c=this._gridSize.height*(1-b);return 0===c?0:0===a.y?1:Math.pow(c/a.y,6)}});cc.fadeOutDownTiles=function(a,b){return new cc.FadeOutDownTiles(a,b)};cc.FadeOutDownTiles.create=cc.fadeOutDownTiles; cc.TurnOffTiles=cc.TiledGrid3DAction.extend({_seed:null,_tilesCount:0,_tilesOrder:null,ctor:function(a,b,c){cc.GridAction.prototype.ctor.call(this);this._tilesOrder=[];void 0!==b&&this.initWithDuration(a,b,c)},initWithDuration:function(a,b,c){return cc.TiledGrid3DAction.prototype.initWithDuration.call(this,a,b)?(this._seed=c||0,this._tilesOrder.length=0,!0):!1},shuffle:function(a,b){for(var c=b-1;0<=c;c--){var d=0|cc.rand()%(c+1),e=a[c];a[c]=a[d];a[d]=e}},turnOnTile:function(a){this.setTile(a,this.originalTile(a))}, turnOffTile:function(a){this.setTile(a,new cc.Quad3)},startWithTarget:function(a){cc.TiledGrid3DAction.prototype.startWithTarget.call(this,a);this._tilesCount=this._gridSize.width*this._gridSize.height;a=this._tilesOrder;for(var b=a.length=0;bk.z&&(k.z=0.5);k.x+=this.getGridRect().x;this.setVertex(f,k)}}});cc.pageTurn3D=function(a,b){return new cc.PageTurn3D(a,b)};cc.PageTurn3D.create=cc.pageTurn3D;cc.ProgressTimer=cc.Node.extend({_type:null,_percentage:0,_sprite:null,_midPoint:null,_barChangeRate:null,_reverseDirection:!1,_className:"ProgressTimer",ctor:function(a){cc.Node.prototype.ctor.call(this);this._type=cc.ProgressTimer.TYPE_RADIAL;this._percentage=0;this._midPoint=cc.p(0,0);this._barChangeRate=cc.p(0,0);this._reverseDirection=!1;this._sprite=null;a&&this.initWithSprite(a)},onEnter:function(){this._super();cc._renderType===cc.game.RENDER_TYPE_WEBGL&&(this._renderCmd.initCmd(),this._renderCmd._updateProgress())}, cleanup:function(){cc._renderType===cc.game.RENDER_TYPE_WEBGL&&this._renderCmd.releaseData();this._super()},getMidpoint:function(){return cc.p(this._midPoint.x,this._midPoint.y)},setMidpoint:function(a){this._midPoint=cc.pClamp(a,cc.p(0,0),cc.p(1,1))},getBarChangeRate:function(){return cc.p(this._barChangeRate.x,this._barChangeRate.y)},setBarChangeRate:function(a){this._barChangeRate=cc.pClamp(a,cc.p(0,0),cc.p(1,1))},getType:function(){return this._type},getPercentage:function(){return this._percentage}, getSprite:function(){return this._sprite},setPercentage:function(a){this._percentage!==a&&(this._percentage=cc.clampf(a,0,100),this._renderCmd._updateProgress())},setOpacityModifyRGB:function(a){},isOpacityModifyRGB:function(){return!1},isReverseDirection:function(){return this._reverseDirection},setColor:function(a){this._sprite.color=a;this._renderCmd.setDirtyFlag(cc.Node._dirtyFlags.colorDirty)},setOpacity:function(a){this._sprite.opacity=a;this._renderCmd.setDirtyFlag(cc.Node._dirtyFlags.opacityDirty)}, getColor:function(){return this._sprite.color},getOpacity:function(){return this._sprite.opacity},setReverseProgress:function(a){this._reverseDirection!==a&&(this._reverseDirection=a,this._renderCmd.resetVertexData())},setSprite:function(a){this._sprite!==a&&((this._sprite=a)?(this.setContentSize(a.width,a.height),a.ignoreAnchorPointForPosition(!0)):this.setContentSize(0,0),this._renderCmd.resetVertexData())},setType:function(a){a!==this._type&&(this._type=a,this._renderCmd.resetVertexData())},setReverseDirection:function(a){this._reverseDirection!== a&&(this._reverseDirection=a,this._renderCmd.resetVertexData())},initWithSprite:function(a){this.percentage=0;this.setAnchorPoint(0.5,0.5);this._type=cc.ProgressTimer.TYPE_RADIAL;this._reverseDirection=!1;this.midPoint=cc.p(0.5,0.5);this.barChangeRate=cc.p(1,1);this.setSprite(a);this._renderCmd.resetVertexData();return!0},_createRenderCmd:function(){return cc._renderType===cc.game.RENDER_TYPE_CANVAS?new cc.ProgressTimer.CanvasRenderCmd(this):new cc.ProgressTimer.WebGLRenderCmd(this)}});_p=cc.ProgressTimer.prototype; cc.defineGetterSetter(_p,"midPoint",_p.getMidpoint,_p.setMidpoint);cc.defineGetterSetter(_p,"barChangeRate",_p.getBarChangeRate,_p.setBarChangeRate);cc.defineGetterSetter(_p,"type",_p.getType,_p.setType);cc.defineGetterSetter(_p,"percentage",_p.getPercentage,_p.setPercentage);cc.defineGetterSetter(_p,"sprite",_p.getSprite,_p.setSprite);cc.defineGetterSetter(_p,"reverseDir",_p.isReverseDirection,_p.setReverseDirection);cc.ProgressTimer.create=function(a){return new cc.ProgressTimer(a)}; cc.ProgressTimer.TEXTURE_COORDS_COUNT=4;cc.ProgressTimer.TEXTURE_COORDS=75;cc.ProgressTimer.TYPE_RADIAL=0;cc.ProgressTimer.TYPE_BAR=1;cc.ProgressTo=cc.ActionInterval.extend({_to:0,_from:0,ctor:function(a,b){cc.ActionInterval.prototype.ctor.call(this);this._from=this._to=0;void 0!==b&&this.initWithDuration(a,b)},initWithDuration:function(a,b){return cc.ActionInterval.prototype.initWithDuration.call(this,a)?(this._to=b,!0):!1},clone:function(){var a=new cc.ProgressTo;a.initWithDuration(this._duration,this._to);return a},reverse:function(){cc.log("cc.ProgressTo.reverse(): reverse hasn't been supported.");return null},startWithTarget:function(a){cc.ActionInterval.prototype.startWithTarget.call(this, a);this._from=a.percentage},update:function(a){this.target instanceof cc.ProgressTimer&&(this.target.percentage=this._from+(this._to-this._from)*a)}});cc.progressTo=function(a,b){return new cc.ProgressTo(a,b)};cc.ProgressTo.create=cc.progressTo; cc.ProgressFromTo=cc.ActionInterval.extend({_to:0,_from:0,ctor:function(a,b,c){cc.ActionInterval.prototype.ctor.call(this);this._from=this._to=0;void 0!==c&&this.initWithDuration(a,b,c)},initWithDuration:function(a,b,c){return cc.ActionInterval.prototype.initWithDuration.call(this,a)?(this._to=c,this._from=b,!0):!1},clone:function(){var a=new cc.ProgressFromTo;a.initWithDuration(this._duration,this._from,this._to);return a},reverse:function(){return cc.progressFromTo(this._duration,this._to,this._from)}, startWithTarget:function(a){cc.ActionInterval.prototype.startWithTarget.call(this,a)},update:function(a){this.target instanceof cc.ProgressTimer&&(this.target.percentage=this._from+(this._to-this._from)*a)}});cc.progressFromTo=function(a,b,c){return new cc.ProgressFromTo(a,b,c)};cc.ProgressFromTo.create=cc.progressFromTo;(function(){cc.ProgressTimer.CanvasRenderCmd=function(a){this._rootCtor(a);this._needDraw=!0;this._PI180=Math.PI/180;this._barRect=cc.rect(0,0,0,0);this._origin=cc.p(0,0);this._radius=0;this._endAngle=this._startAngle=270;this._counterClockWise=!1;this._canUseDirtyRegion=!0};var a=cc.ProgressTimer.CanvasRenderCmd.prototype=Object.create(cc.Node.CanvasRenderCmd.prototype);a.constructor=cc.ProgressTimer.CanvasRenderCmd;a.rendering=function(a,c,d){a=a||cc._renderContext;var e=a.getContext(),f=this._node, g=f._sprite,h=g._renderCmd._textureCoord,k=g._renderCmd._displayedOpacity/255;if(0!==h.width&&0!==h.height&&g._texture&&h.validRect&&0!==k){a.setTransform(this._worldTransform,c,d);a.setCompositeOperation(g._blendFuncStr);a.setGlobalAlpha(k);var m=g._rect,n=g._offsetPosition;c=n.x;d=-n.y-m.height;k=m.width;m=m.height;a.save();g._flippedX&&(c=-c-k,e.scale(-1,1));g._flippedY&&(d=n.y,e.scale(1,-1));f._type===cc.ProgressTimer.TYPE_BAR?(f=this._barRect,e.beginPath(),e.rect(f.x,f.y,f.width,f.height),e.clip(), e.closePath()):f._type===cc.ProgressTimer.TYPE_RADIAL&&(f=this._origin.x,n=this._origin.y,e.beginPath(),e.arc(f,n,this._radius,this._PI180*this._startAngle,this._PI180*this._endAngle,this._counterClockWise),e.lineTo(f,n),e.clip(),e.closePath());f=(g._renderCmd._textureToRender||g._texture).getHtmlElementObj();g._renderCmd._colorized?e.drawImage(f,0,0,h.width,h.height,c,d,k,m):e.drawImage(f,h.renderX,h.renderY,h.width,h.height,c,d,k,m);a.restore();cc.g_NumberOfDraws++}};a.releaseData=function(){}; a.resetVertexData=function(){};a._updateProgress=function(){this.setDirtyFlag(cc.Node._dirtyFlags.contentDirty);var a=this._node,c=a._sprite,d=c.width,e=c.height,f=a._midPoint;if(a._type===cc.ProgressTimer.TYPE_RADIAL){this._radius=Math.round(Math.sqrt(d*d+e*e));var g,h=!1,k=this._origin;k.x=d*f.x;k.y=-e*f.y;a._reverseDirection?(g=270,f=270-3.6*a._percentage):(f=-90,g=-90+3.6*a._percentage);c._flippedX&&(k.x-=2*d*a._midPoint.x,f=-f-180,g=-g-180,h=!h);c._flippedY&&(k.y+=2*e*a._midPoint.y,h=!h,f=-f, g=-g);this._startAngle=f;this._endAngle=g;this._counterClockWise=h}else h=a._barChangeRate,k=a._percentage/100,a=this._barRect,h=cc.size(d*(1-h.x),e*(1-h.y)),k=cc.size((d-h.width)*k,(e-h.height)*k),h=cc.size(h.width+k.width,h.height+k.height),g=cc.p(d*f.x,e*f.y),k=g.x-h.width/2,0.5=d-g.x&&(k=d-h.width),d=g.y-h.height/2,0.5=e-g.y&&(d=e-h.height),a.x=0,e=1,c._flippedX&&(a.x-=h.width,e=-1),0c;c++)this._vertexData[c]=new cc.V3F_C4B_T2F(null,null,null,this._vertexArrayBuffer,c*a);gl.bindBuffer(gl.ARRAY_BUFFER,this._vertexWebGLBuffer);gl.bufferData(gl.ARRAY_BUFFER,this._float32View,gl.DYNAMIC_DRAW);this._vertexDataCount=0;this._vertexDataDirty=!0;this._shaderProgram=cc.shaderCache.programForKey(cc.SHADER_SPRITE_POSITION_TEXTURECOLOR)}}; a.resetVertexData=function(){this._vertexDataCount=0};a._updateProgressData=function(){var a=this._node._type;a===cc.ProgressTimer.TYPE_RADIAL?this._updateRadial():a===cc.ProgressTimer.TYPE_BAR&&this._updateBar();this._vertexDataDirty=!0};a._updateProgress=function(){this.setDirtyFlag(cc.Node._dirtyFlags.textureDirty)};a._updateBar=function(){var a=this._node;if(a._sprite){var c=a._percentage/100,d=a._barChangeRate,d=cc.pMult(cc.p(1-d.x+c*d.x,1-d.y+c*d.y),0.5),c=cc.pSub(a._midPoint,d),a=cc.pAdd(a._midPoint, d);0>c.x&&(a.x+=-c.x,c.x=0);1c.y&&(a.y+=-c.y,c.y=0);1=n.x)&& 0<=n.y&&n.y>7-(a<<1)&1,c>>7-((a<<1)+1)&1):cc.p(c>>(a<<1)+1&1,c>>(a<<1)&1)}return cc.p(0,0)};a._textureCoordFromAlphaPoint=function(a,c,d){var e=this._node._sprite;if(e){var f=e._renderCmd._vertices, g=f[1],f=f[2],g=cc.p(g.u,g.v),f=cc.p(f.u,f.v);e.textureRectRotated&&(e=c,c=d,d=e);a.u=g.x*(1-c)+f.x*c;a.v=g.y*(1-d)+f.y*d}else a.u=0,a.v=0};a._vertexFromAlphaPoint=function(a,c,d){a.x=this._bl.x*(1-c)+this._tr.x*c;a.y=this._bl.y*(1-d)+this._tr.y*d;a.z=this._node._vertexZ};a._updateColor=function(){var a=this._node._sprite;if(this._vertexDataCount&&a){var c=this._displayedColor,d=a._renderCmd._displayedColor,e=d.r,f=d.g,d=d.b,g=a._renderCmd._displayedOpacity/255;a._opacityModifyRGB&&(e*=g,f*=g,d*= g);c.r=e;c.g=f;c.b=d;c.a=a._renderCmd._displayedOpacity;a=this._vertexData;e=0;for(f=this._vertexDataCount;ea.height?(a=16,b=12):(a=12,b=16);a=this.actionWithSize(cc.size(a,b));b=this._gridProxy;this._back?(b.setTarget(this._inScene),b._performRecursive(cc.Node._stateCallbackType.onEnter),this._inScene.visible=!1,b.runAction(cc.sequence(a,cc.callFunc(this.finish,this),cc.stopGrid())),this._inScene.runAction(cc.show())):(b.setTarget(this._outScene),b._performRecursive(cc.Node._stateCallbackType.onEnter),b.runAction(cc.sequence(a,cc.callFunc(this.finish,this),cc.stopGrid())))}, visit:function(){this._back?this._outScene.visit():this._inScene.visit();this._gridProxy.visit()},_sceneOrder:function(){this._isInSceneOnTop=this._back}});cc.TransitionPageTurn.create=function(a,b,c){return new cc.TransitionPageTurn(a,b,c)};cc.Codec={name:"Jacob__Codec"};cc.unzip=function(){return cc.Codec.GZip.gunzip.apply(cc.Codec.GZip,arguments)};cc.unzipBase64=function(){var a=cc.Codec.Base64.decode.apply(cc.Codec.Base64,arguments);return cc.Codec.GZip.gunzip.apply(cc.Codec.GZip,[a])};cc.unzipBase64AsArray=function(a,b){b=b||1;var c=this.unzipBase64(a),d=[],e,f,g;e=0;for(g=c.length/b;e>4,d=(d&15)<<4|f>>2,e=(f&3)<<6|g,b.push(String.fromCharCode(c)),64!==f&&b.push(String.fromCharCode(d)),64!==g&&b.push(String.fromCharCode(e));return b=b.join("")}; cc.Codec.Base64.decodeAsArray=function(a,b){var c=this.decode(a),d=[],e,f,g;e=0;for(g=c.length/b;ea;++a)e.push(String.fromCharCode(this.data[this.pos++]));a=e.join("");switch(a){case "IHDR":this.width=this.readUInt32();this.height=this.readUInt32();this.bits=this.data[this.pos++];this.colorType=this.data[this.pos++];this.compressionMethod=this.data[this.pos++];this.filterMethod= this.data[this.pos++];this.interlaceMethod=this.data[this.pos++];break;case "acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||Infinity,frames:[]};break;case "PLTE":this.palette=this.read(b);break;case "fcTL":d&&this.animation.frames.push(d);this.pos+=4;d={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()};a=this.readUInt16();b=this.readUInt16()||100;d.delay=1E3*a/b;d.disposeOp=this.data[this.pos++];d.blendOp=this.data[this.pos++]; d.data=[];break;case "IDAT":case "fdAT":"fdAT"===a&&(this.pos+=4,b-=4);a=(null!=d?d.data:void 0)||this.imgData;for(e=0;0<=b?eb;0<=b?++e:--e)a.push(this.data[this.pos++]);break;case "tRNS":this.transparency={};switch(this.colorType){case 3:this.transparency.indexed=this.read(b);b=255-this.transparency.indexed.length;if(0b;0<=b?++a:--a)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(b)[0];break;case 2:this.transparency.rgb=this.read(b)}break; case "tEXt":e=this.read(b);b=e.indexOf(0);a=String.fromCharCode.apply(String,e.slice(0,b));this.text[a]=String.fromCharCode.apply(String,e.slice(b+1));break;case "IEND":d&&this.animation.frames.push(d);a:{switch(this.colorType){case 0:case 3:case 4:d=1;break a;case 2:case 6:d=3;break a}d=void 0}this.colors=d;this.hasAlphaChannel=4===(c=this.colorType)||6===c;c=this.colors+(this.hasAlphaChannel?1:0);this.pixelBitlength=this.bits*c;a:{switch(this.colors){case 1:c="DeviceGray";break a;case 3:c="DeviceRGB"; break a}c=void 0}this.colorSpace=c;Uint8Array!=Array&&(this.imgData=new Uint8Array(this.imgData));return;default:this.pos+=b}this.pos+=4;if(this.pos>this.data.length)throw Error("Incomplete or corrupt PNG file");}},read:function(a){var b,c;c=[];for(b=0;0<=a?ba;0<=a?++b:--b)c.push(this.data[this.pos++]);return c},readUInt32:function(){var a,b,c,d;a=this.data[this.pos++]<<24;b=this.data[this.pos++]<<16;c=this.data[this.pos++]<<8;d=this.data[this.pos++];return a|b|c|d},readUInt16:function(){var a, b;a=this.data[this.pos++]<<8;b=this.data[this.pos++];return a|b},decodePixels:function(a){var b,c,d,e,f,g,h,k,m,n,p,r,s,u,t;null==a&&(a=this.imgData);if(0===a.length)return new Uint8Array(0);a=(new Zlib.Inflate(a,{index:0,verify:!1})).decompress();k=this.pixelBitlength/8;r=k*this.width;m=new Uint8Array(r*this.height);g=a.length;for(c=n=p=0;n=e*c)!1===this.littleEndian?a.push(d>>>8*(4-e)):a.push(d);else for(var f=0;f=a)cc.log("No bytes requested");else{if(1>=a)return this.getUint8(b);if(2>=a)return this.getUint16(b);if(3>=a)return this.getUint32(b)>>>8;if(4>=a)return this.getUint32(b);cc.log("Too many bytes requested")}},getBits:function(a,b,c){c=c||0;b+=Math.floor(c/8);var d=c+a;a=32-a;var e,f;0>=d?console.log("No bits requested"):8>=d?(e=24+c,f=this.getUint8(b)):16>=d?(e=16+c,f=this.getUint16(b)):32>=d?(e=c,f=this.getUint32(b)):console.log("Too many bits requested"); return{bits:f<>>a,byteOffset:b+Math.floor(d/8),bitOffset:d%8}},parseFileDirectory:function(a){var b=this.getUint16(a),c=[];a+=2;for(var d=0;d=y?E=y+1:-127<=y&&-1>=y?N=-y+1:z=!0}else{for(var Q=this.getUint8(v+x),y=0;y= this._totalParticles},updateQuadWithParticle:function(a,b){this._renderCmd.updateQuadWithParticle(a,b)},postStep:function(){this._renderCmd.postStep()},update:function(a){if(this._isActive&&this.emissionRate){var b=1/this.emissionRate;this.particleCountb;)this.addParticle(),this._emitCounter-=b;this._elapsed+=a;-1!==this.duration&&this.durationa?a:200};a.addParticle=function(){var a=this._node,c=a._particles;a.particleCountc._allocatedParticles){var d=cc.V3F_C4B_T2F_Quad.BYTES_PER_ELEMENT;this._indices= new Uint16Array(6*a);var e=new ArrayBuffer(a*d),f=c._particles;f.length=0;for(var g=this._quads,h=g.length=0;hd.getCapacity()&&(this._increaseAtlasCapacityTo(e+c),d.fillWithEmptyQuadsFromIndex(d.getCapacity()-c,c));a.getAtlasIndex()+c!==e&&d.moveQuadsFromIndex(b,b+c);d.increaseTotalQuadsWith(c);this._updateAllAtlasIndexes()},removeChild:function(a, b){if(null!=a){if(!(a instanceof cc.ParticleSystem))throw Error("cc.ParticleBatchNode.removeChild(): only supports cc.ParticleSystem as children");if(-1===this._children.indexOf(a))cc.log("cc.ParticleBatchNode.removeChild(): doesn't contain the sprite. Can't remove it");else{cc.Node.prototype.removeChild.call(this,a,b);var c=this.textureAtlas;c.removeQuadsAtIndex(a.getAtlasIndex(),a.getTotalParticles());c.fillWithEmptyQuadsFromIndex(c.totalQuads,a.getTotalParticles());a.setBatchNode(null);this._updateAllAtlasIndexes()}}}, reorderChild:function(a,b){if(!a)throw Error("cc.ParticleBatchNode.reorderChild(): child should be non-null");if(!(a instanceof cc.ParticleSystem))throw Error("cc.ParticleBatchNode.reorderChild(): only supports cc.QuadParticleSystems as children");if(-1===this._children.indexOf(a))cc.log("cc.ParticleBatchNode.reorderChild(): Child doesn't belong to batch");else if(b!==a.zIndex){if(1a)return d;return c},_getCurrentIndex:function(a,b){for(var c=!1,d=!1,e=0,f=0,g=0,h=this._children,k=h.length,m=0;mb&&!d&&(e=m,d=!0,c&&d))break;if(a===n&&(f=m,c=!0,d||(g=-1),c&&d))break}d||(e=k);return{newIndex:e+ g,oldIndex:f}},_addChildHelper:function(a,b,c){if(!a)throw Error("cc.ParticleBatchNode._addChildHelper(): child should be non-null");if(a.parent)return cc.log("cc.ParticleBatchNode._addChildHelper(): child already added. It can't be added again"),null;this._children||(this._children=[]);var d=this._searchNewPositionInChildrenForZ(b);this._children.splice(d,0,a);a.tag=c;a._setLocalZOrder(b);a.parent=this;this._running&&(a._performRecursive(cc.Node._stateCallbackType.onEnter),a._performRecursive(cc.Node._stateCallbackType.onEnterTransitionDidFinish)); return d},_updateBlendFunc:function(){this.textureAtlas.texture.hasPremultipliedAlpha()||(this._blendFunc.src=cc.SRC_ALPHA,this._blendFunc.dst=cc.ONE_MINUS_SRC_ALPHA)},getTextureAtlas:function(){return this.textureAtlas},setTextureAtlas:function(a){this.textureAtlas=a}});_p=cc.ParticleBatchNode.prototype;cc.defineGetterSetter(_p,"texture",_p.getTexture,_p.setTexture);cc.ParticleBatchNode.create=function(a,b){return new cc.ParticleBatchNode(a,b)};(function(){cc.ParticleBatchNode.CanvasRenderCmd=function(a){this._rootCtor(a);this._needDraw=!1};var a=cc.ParticleBatchNode.CanvasRenderCmd.prototype=Object.create(cc.Node.CanvasRenderCmd.prototype);a.constructor=cc.ParticleBatchNode.CanvasRenderCmd;a._initWithTexture=function(){}})();(function(){cc.ParticleBatchNode.WebGLRenderCmd=function(a){this._rootCtor(a);this._needDraw=!0;this._matrix=new cc.math.Matrix4;this._matrix.identity()};var a=cc.ParticleBatchNode.WebGLRenderCmd.prototype=Object.create(cc.Node.WebGLRenderCmd.prototype);a.constructor=cc.ParticleBatchNode.WebGLRenderCmd;a.rendering=function(a){a=this._node;if(0!==a.textureAtlas.totalQuads){var c=this._worldTransform;this._matrix.mat[0]=c.a;this._matrix.mat[4]=c.c;this._matrix.mat[12]=c.tx;this._matrix.mat[1]=c.b;this._matrix.mat[5]= c.d;this._matrix.mat[13]=c.ty;this._shaderProgram.use();this._shaderProgram._setUniformForMVPMatrixWithMat4(this._matrix);cc.glBlendFuncForParticle(a._blendFunc.src,a._blendFunc.dst);a.textureAtlas.drawQuads()}};a._initWithTexture=function(){this._shaderProgram=cc.shaderCache.programForKey(cc.SHADER_POSITION_TEXTURECOLOR)}})();cc.IMEKeyboardNotificationInfo=function(a,b,c){this.begin=a||cc.rect(0,0,0,0);this.end=b||cc.rect(0,0,0,0);this.duration=c||0}; cc.IMEDelegate=cc.Class.extend({ctor:function(){cc.imeDispatcher.addDelegate(this)},removeDelegate:function(){cc.imeDispatcher.removeDelegate(this)},attachWithIME:function(){return cc.imeDispatcher.attachDelegateWithIME(this)},detachWithIME:function(){return cc.imeDispatcher.detachDelegateWithIME(this)},canAttachWithIME:function(){return!1},didAttachWithIME:function(){},canDetachWithIME:function(){return!1},didDetachWithIME:function(){},insertText:function(a,b){},deleteBackward:function(){},getContentText:function(){return""}, keyboardWillShow:function(a){},keyboardDidShow:function(a){},keyboardWillHide:function(a){},keyboardDidHide:function(a){}}); cc.IMEDispatcher=cc.Class.extend({_domInputControl:null,impl:null,_currentInputString:"",_lastClickPosition:null,ctor:function(){this.impl=new cc.IMEDispatcher.Impl;this._lastClickPosition=cc.p(0,0)},init:function(){if(!cc.sys.isMobile){this._domInputControl=cc.$("#imeDispatcherInput");this._domInputControl||(this._domInputControl=cc.$new("input"),this._domInputControl.setAttribute("type","text"),this._domInputControl.setAttribute("id","imeDispatcherInput"),this._domInputControl.resize(0,0),this._domInputControl.translates(0, 0),this._domInputControl.style.opacity="0",this._domInputControl.style.fontSize="1px",this._domInputControl.setAttribute("tabindex",2),this._domInputControl.style.position="absolute",this._domInputControl.style.top=0,this._domInputControl.style.left=0,document.body.appendChild(this._domInputControl));var a=this;this._domInputControl.addEventListener("input",function(){a._processDomInputString(a._domInputControl.value)},!1);this._domInputControl.addEventListener("keydown",function(b){b.keyCode===cc.KEY.tab? (b.stopPropagation(),b.preventDefault()):b.keyCode===cc.KEY.enter&&(a.dispatchInsertText("\n",1),b.stopPropagation(),b.preventDefault())},!1);/msie/i.test(navigator.userAgent)&&this._domInputControl.addEventListener("keyup",function(b){b.keyCode===cc.KEY.backspace&&a._processDomInputString(a._domInputControl.value)},!1);window.addEventListener("mousedown",function(b){var c=b.pageY||0;a._lastClickPosition.x=b.pageX||0;a._lastClickPosition.y=c},!1)}},_processDomInputString:function(a){var b,c;b=this._currentInputString.length< a.length?this._currentInputString.length:a.length;for(c=0;c=b||this.impl._delegateWithIme&&this.impl._delegateWithIme.insertText(a,b)},dispatchDeleteBackward:function(){this.impl&&this.impl._delegateWithIme&&this.impl._delegateWithIme.deleteBackward()}, getContentText:function(){if(this.impl&&this.impl._delegateWithIme){var a=this.impl._delegateWithIme.getContentText();return a?a:""}return""},dispatchKeyboardWillShow:function(a){if(this.impl)for(var b=0;ba?a===cc.KEY.backspace?this.dispatchDeleteBackward():a===cc.KEY.enter&&this.dispatchInsertText("\n",1):255>a&&this.dispatchInsertText(String.fromCharCode(a),1)}});cc.IMEDispatcher.Impl=cc.Class.extend({_delegateWithIme:null,_delegateList:null,ctor:function(){this._delegateList=[]},findDelegate:function(a){for(var b=0;b=a?(this._inputText="",this._charCount=0,cc.LabelTTF.prototype.setString.call(this,this._placeHolder),this.setColor(this.colorSpaceHolder)):this.string= this._inputText.substring(0,a-1))},removeDelegate:function(){cc.imeDispatcher.removeDelegate(this)},_tipMessage:"please enter your word:",setTipMessage:function(a){null!=a&&(this._tipMessage=a)},getTipMessage:function(){return this._tipMessage},insertText:function(a,b){var c=a,d=c.indexOf("\n");-1=b.length||!(g=b[d])||(h=m[a].height,e=e>=h||isNaN(h)?e:h,++f,f>=g&&(c+=e+5,e=f=0,++d));var n=cc.director.getWinSize(),p=g=e=d=0,r=0,c=c/2;if(m&&0=h||isNaN(h)?e:h;s.setPosition(r-n.width/2,c-h/2);r+=p;++f;f>=g&&(c-=e+5,e=g=f=0,++d)}},alignItemsInRows:function(){0< arguments.length&&null==arguments[arguments.length-1]&&cc.log("parameters should not be ending with null in Javascript");var a,b=[];for(a=0;a=b.length||!(m=b[g]))||(r=n.width,h=h>=r||isNaN(r)?h:r,f+=n.height+5,++k,k>=m&&(c.push(h),d.push(f),e+=h+10,h=k=0,f=-5,++g));f=cc.director.getWinSize();m=h=g=0;var e=-e/2,u=0;if(s&&0=r||isNaN(r)?h:r,n.setPosition(e+c[g]/2,u-f.height/2),u-=n.height+10,++k,k>=m&&(e+=h+5,h=m=k=0,++g)},removeChild:function(a,b){null!=a&&(a instanceof cc.MenuItem?(this._selectedItem===a&&(this._selectedItem=null),cc.Node.prototype.removeChild.call(this,a,b)):cc.log("cc.Menu.removeChild():Menu only supports MenuItem objects as children"))},_onTouchBegan:function(a,b){var c=b.getCurrentTarget();if(c._state!==cc.MENU_STATE_WAITING||!c._visible|| !c.enabled)return!1;for(var d=c.parent;null!=d;d=d.parent)if(!d.isVisible())return!1;c._selectedItem=c._itemForTouch(a);return c._selectedItem?(c._state=cc.MENU_STATE_TRACKING_TOUCH,c._selectedItem.selected(),c._selectedItem.setNodeDirty(),!0):!1},_onTouchEnded:function(a,b){var c=b.getCurrentTarget();c._state!==cc.MENU_STATE_TRACKING_TOUCH?cc.log("cc.Menu.onTouchEnded(): invalid state"):(c._selectedItem&&(c._selectedItem.unselected(),c._selectedItem.setNodeDirty(),c._selectedItem.activate()),c._state= cc.MENU_STATE_WAITING)},_onTouchCancelled:function(a,b){var c=b.getCurrentTarget();c._state!==cc.MENU_STATE_TRACKING_TOUCH?cc.log("cc.Menu.onTouchCancelled(): invalid state"):(c._selectedItem&&(c._selectedItem.unselected(),c._selectedItem.setNodeDirty()),c._state=cc.MENU_STATE_WAITING)},_onTouchMoved:function(a,b){var c=b.getCurrentTarget();if(c._state!==cc.MENU_STATE_TRACKING_TOUCH)cc.log("cc.Menu.onTouchMoved(): invalid state");else{var d=c._itemForTouch(a);d!==c._selectedItem&&(c._selectedItem&& (c._selectedItem.unselected(),c._selectedItem.setNodeDirty()),c._selectedItem=d,c._selectedItem&&(c._selectedItem.selected(),c._selectedItem.setNodeDirty()))}},onExit:function(){this._state===cc.MENU_STATE_TRACKING_TOUCH&&(this._selectedItem&&(this._selectedItem.unselected(),this._selectedItem=null),this._state=cc.MENU_STATE_WAITING);cc.Node.prototype.onExit.call(this)},setOpacityModifyRGB:function(a){},isOpacityModifyRGB:function(){return!1},_itemForTouch:function(a){a=a.getLocation();var b=this._children, c;if(b&&0>=1;0===this.bb&&(this.bb=this.readByte(),a=this.bb&1,this.bb=this.bb>>1|128);return a}; cc.Codec.GZip.prototype.readBits=function(a){for(var b=0,c=a;c--;)b=b<<1|this.readBit();a&&(b=cc.Codec.GZip.bitReverse[b]>>8-a);return b};cc.Codec.GZip.prototype.flushBuffer=function(){this.bIdx=0};cc.Codec.GZip.prototype.addBuffer=function(a){this.buf32k[this.bIdx++]=a;this.outputArr.push(String.fromCharCode(a));32768===this.bIdx&&(this.bIdx=0)}; cc.Codec.GZip.prototype.IsPat=function(){for(;;){if(this.fpos[this.len]>=this.fmax)return-1;if(this.flens[this.fpos[this.len]]===this.len)return this.fpos[this.len]++;this.fpos[this.len]++}}; cc.Codec.GZip.prototype.Rec=function(){var a=this.Places[this.treepos],b;if(17===this.len)return-1;this.treepos++;this.len++;b=this.IsPat();if(0<=b)a.b0=b;else if(a.b0=32768,this.Rec())return-1;b=this.IsPat();if(0<=b)a.b1=b,a.jump=null;else if(a.b1=32768,a.jump=this.Places[this.treepos],a.jumppos=this.treepos,this.Rec())return-1;this.len--;return 0}; cc.Codec.GZip.prototype.CreateTree=function(a,b,c,d){this.Places=a;this.treepos=0;this.flens=c;this.fmax=b;for(a=0;17>a;a++)this.fpos[a]=0;this.len=0;return this.Rec()?-1:0};cc.Codec.GZip.prototype.DecodeValue=function(a){for(var b,c,d=0,e=a[d];;)if(b=this.readBit()){if(!(e.b1&32768))return e.b1;e=e.jump;b=a.length;for(c=0;c>1,23c)this.addBuffer(c); else if(256===c)break;else{var f;c-=257;e=this.readBits(cc.Codec.GZip.cplext[c])+cc.Codec.GZip.cplens[c];c=cc.Codec.GZip.bitReverse[this.readBits(5)]>>3;8c;c++)g[c]= 0;for(c=0;cc)g[d++]=c;else if(16===c){var k;c=3+this.readBits(2);if(d+c>e)return this.flushBuffer(),1;for(k=d?g[d-1]:0;c--;)g[d++]=k}else{c=17===c?3+this.readBits(3):11+this.readBits(7);if(d+c>e)return this.flushBuffer(), 1;for(;c--;)g[d++]=0}e=this.literalTree.length;for(d=0;d>>0}b=1;c=0;for(var d=a.length,e,f=0;0>>0}function d(b,c){this.index="number"===typeof c?c:0; this.i=0;this.buffer=b instanceof(z?Uint8Array:Array)?b:new (z?Uint8Array:Array)(32768);2*this.buffer.length<=this.index&&a(Error("invalid index"));this.buffer.length<=this.index&&this.f()}function e(a){this.buffer=new (z?Uint16Array:Array)(2*a);this.length=0}function f(a){var b=a.length,c=0,d=Number.POSITIVE_INFINITY,e,f,g,h,k,m,n,p,s;for(p=0;pc&&(c=a[p]),a[p]>=1;for(s=m;s=b:return[265,b-11,1];case 14>=b:return[266,b-13,1];case 16>=b:return[267,b-15,1];case 18>=b:return[268,b-17,1];case 22>=b:return[269,b-19,2];case 26>=b:return[270,b-23,2];case 30>=b:return[271,b-27,2];case 34>=b:return[272,b-31,2];case 42>=b:return[273,b-35,3];case 50>= b:return[274,b-43,3];case 58>=b:return[275,b-51,3];case 66>=b:return[276,b-59,3];case 82>=b:return[277,b-67,4];case 98>=b:return[278,b-83,4];case 114>=b:return[279,b-99,4];case 130>=b:return[280,b-115,4];case 162>=b:return[281,b-131,5];case 194>=b:return[282,b-163,5];case 226>=b:return[283,b-195,5];case 257>=b:return[284,b-227,5];case 258===b:return[285,b-258,0];default:a("invalid length: "+b)}}function m(b,c){function d(b,c){var e=b.G,f=[],g=0,h;h=R[b.length];f[g++]=h&65535;f[g++]=h>>16&255;f[g++]= h>>24;var k;switch(B){case 1===e:k=[0,e-1,0];break;case 2===e:k=[1,e-2,0];break;case 3===e:k=[2,e-3,0];break;case 4===e:k=[3,e-4,0];break;case 6>=e:k=[4,e-5,1];break;case 8>=e:k=[5,e-7,1];break;case 12>=e:k=[6,e-9,2];break;case 16>=e:k=[7,e-13,2];break;case 24>=e:k=[8,e-17,3];break;case 32>=e:k=[9,e-25,3];break;case 48>=e:k=[10,e-33,4];break;case 64>=e:k=[11,e-49,4];break;case 96>=e:k=[12,e-65,5];break;case 128>=e:k=[13,e-97,5];break;case 192>=e:k=[14,e-129,6];break;case 256>=e:k=[15,e-193,6];break; case 384>=e:k=[16,e-257,7];break;case 512>=e:k=[17,e-385,7];break;case 768>=e:k=[18,e-513,8];break;case 1024>=e:k=[19,e-769,8];break;case 1536>=e:k=[20,e-1025,9];break;case 2048>=e:k=[21,e-1537,9];break;case 3072>=e:k=[22,e-2049,10];break;case 4096>=e:k=[23,e-3073,10];break;case 6144>=e:k=[24,e-4097,11];break;case 8192>=e:k=[25,e-6145,11];break;case 12288>=e:k=[26,e-8193,12];break;case 16384>=e:k=[27,e-12289,12];break;case 24576>=e:k=[28,e-16385,13];break;case 32768>=e:k=[29,e-24577,13];break;default:a("invalid distance")}h= k;f[g++]=h[0];f[g++]=h[1];f[g++]=h[2];e=0;for(g=f.length;e=g;)u[g++]=0;for(g=0;29>=g;)v[g++]=0}u[256]=1;e=0;for(f=c.length;e=f){p&&d(p,-1);g=0; for(k=f-e;gC&&e+CA&&(m=k,A=C);if(258===C)break}k=new h(A,e-m);p?p.length2*k[v-1]+f[v]&&(k[v]=2*k[v-1]+f[v]),m[v]=Array(k[v]),s[v]=Array(k[v]);for(t=0;th[t]?(m[v][u]=w,s[v][u]=n,x+=2):(m[v][u]=h[t], s[v][u]=t,++t);r[v]=0;1===f[v]&&c(v)}h=p;k=0;for(m=d.length;k1<f&&a("undercommitted");g=0;for(h=b.length;g>>=1;return c}function r(a,b){this.input=a;this.a=new (z?Uint8Array:Array)(32768);this.h= K.j;var c={},d;!b&&(b={})||"number"!==typeof b.compressionType||(this.h=b.compressionType);for(d in b)c[d]=b[d];c.outputBuffer=this.a;this.z=new g(this.input,c)}function s(b,c){this.k=[];this.l=32768;this.e=this.g=this.c=this.q=0;this.input=z?new Uint8Array(b):b;this.s=!1;this.m=P;this.B=!1;if(c||!(c={}))c.index&&(this.c=c.index),c.bufferSize&&(this.l=c.bufferSize),c.bufferType&&(this.m=c.bufferType),c.resize&&(this.B=c.resize);switch(this.m){case I:this.b=32768;this.a=new (z?Uint8Array:Array)(32768+ this.l+258);break;case P:this.b=0;this.a=new (z?Uint8Array:Array)(this.l);this.f=this.J;this.t=this.H;this.o=this.I;break;default:a(Error("invalid inflate mode"))}}function u(b,c){for(var d=b.g,e=b.e,f=b.input,g=b.c,h;e>>c;b.e=e-c;b.c=g;return d&(1<>>16;b.g=d>>h;b.e= e-h;b.c=g;return f&65535}function v(a){function b(a,c,d){var e,f,g,h;for(h=0;h>>8&255]<<16|E[a>>>16&255]<<8|E[a>>>24&255])>>32-b:E[a]>>8-b);if(8>b+f)g=g<>b-c-1&1,8===++f&&(f=0,d[e++]=E[g],g=0,e===d.length&&(d=this.f())); d[e]=g;this.buffer=d;this.i=f;this.index=e};d.prototype.finish=function(){var a=this.buffer,b=this.index,c;0A;++A){for(var D=A,F=D,M=7,D=D>>>1;D;D>>>=1)F<<=1,F|=D&1,--M;C[A]=(F<>>0}var E=C,C=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049, 498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275, 3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277, 2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143, 2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112, 2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746, 711928724,3020668471,3272380065,1510334235,755167117];z&&new Uint32Array(C);e.prototype.getParent=function(a){return 2*((a-2)/4|0)};e.prototype.push=function(a,b){var c,d,e=this.buffer,f;c=this.length;e[this.length++]=b;for(e[this.length++]=a;0e[d])f=e[c],e[c]=e[d],e[d]=f,f=e[c+1],e[c+1]=e[d+1],e[d+1]=f,c=d;else break;return this.length};e.prototype.pop=function(){var a,b,c=this.buffer,d,e,f;b=c[0];a=c[1];this.length-=2;c[0]=c[this.length];c[1]=c[this.length+1];for(f= 0;;){e=2*f+2;if(e>=this.length)break;e+2c[e]&&(e+=2);if(c[e]>c[f])d=c[f],c[f]=c[e],c[e]=d,d=c[f+1],c[f+1]=c[e+1],c[e+1]=d;else break;f=e}return{index:a,value:b,length:this.length}};var N=2,C={NONE:0,r:1,j:N,N:3},Q=[];for(A=0;288>A;A++)switch(B){case 143>=A:Q.push([A+48,8]);break;case 255>=A:Q.push([A-144+400,9]);break;case 279>=A:Q.push([A-256+0,7]);break;case 287>=A:Q.push([A-280+192,8]);break;default:a("invalid literal: "+A)}g.prototype.n=function(){var b,c,e,f,g=this.input; switch(this.h){case 0:e=0;for(f=g.length;e>>8&255;r[t++]=s&255;r[t++]=s>>>8&255;if(z)r.set(c,t),t+=c.length,r=r.subarray(0,t);else{k=0;for(s=c.length;kD)for(;0D?D:138,W>D-3&&W=W?(F[E++]=17,F[E++]=W-3,C[17]++):(F[E++]=18,F[E++]=W-11,C[18]++),D-=W;else if(F[E++]= b[G],C[b[G]]++,D--,3>D)for(;0D?D:6,W>D-3&&WG;G++)k[G]=C[y[G]];for(w=19;4=H;H++)D=k(),A[H]=D[2]<<24|D[1]<<16|D[0];var R=z?new Uint32Array(A):A,K=C;r.prototype.n=function(){var b,d,e,f,g=0;f=this.a;b=la;switch(b){case la:d=Math.LOG2E*Math.log(32768)-8;break;default:a(Error("invalid compression method"))}d= d<<4|b;f[g++]=d;switch(b){case la:switch(this.h){case K.NONE:e=0;break;case K.r:e=1;break;case K.j:e=2;break;default:a(Error("unsupported compression type"))}break;default:a(Error("invalid compression method"))}b=e<<6|0;f[g++]=b|31-(256*d+b)%31;b=c(this.input);this.z.b=g;f=this.z.n();g=f.length;z&&(f=new Uint8Array(f.buffer),f.length<=g+4&&(this.a=new Uint8Array(f.length+4),this.a.set(f),f=this.a),f=f.subarray(0,g+4));f[g++]=b>>24&255;f[g++]=b>>16&255;f[g++]=b>>8&255;f[g++]=b&255;return f};b("Zlib.Deflate", r);b("Zlib.Deflate.compress",function(a,b){return(new r(a,b)).n()});b("Zlib.Deflate.CompressionType",K);b("Zlib.Deflate.CompressionType.NONE",K.NONE);b("Zlib.Deflate.CompressionType.FIXED",K.r);b("Zlib.Deflate.CompressionType.DYNAMIC",K.j);var I=0,P=1,C={D:I,C:P};s.prototype.p=function(){for(;!this.s;){var b=u(this,3);b&1&&(this.s=B);b>>>=1;switch(b){case 0:var b=this.input,c=this.c,d=this.a,e=this.b,f=x,g=x,h=x,k=d.length,f=x;this.e=this.g=0;f=b[c++];f===x&&a(Error("invalid uncompressed block header: LEN (first byte)")); g=f;f=b[c++];f===x&&a(Error("invalid uncompressed block header: LEN (second byte)"));g|=f<<8;f=b[c++];f===x&&a(Error("invalid uncompressed block header: NLEN (first byte)"));h=f;f=b[c++];f===x&&a(Error("invalid uncompressed block header: NLEN (second byte)"));h|=f<<8;g===~h&&a(Error("invalid uncompressed block header: length verify"));c+g>b.length&&a(Error("input buffer is broken"));switch(this.m){case I:for(;e+g>d.length;){f=k-e;g-=f;if(z)d.set(b.subarray(c,c+f),e),e+=f,c+=f;else for(;f--;)d[e++]= b[c++];this.b=e;d=this.f();e=this.b}break;case P:for(;e+g>d.length;)d=this.f({v:2});break;default:a(Error("invalid inflate mode"))}if(z)d.set(b.subarray(c,c+g),e),e+=g,c+=g;else for(;g--;)d[e++]=b[c++];this.c=c;this.b=e;this.a=d;break;case 1:this.o(W,ga);break;case 2:v(this);break;default:a(Error("unknown BTYPE: "+b))}}return this.t()};A=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];var T=z?new Uint16Array(A):A;A=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227, 258,258,258];var S=z?new Uint16Array(A):A;A=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0];var O=z?new Uint8Array(A):A;A=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];var G=z?new Uint16Array(A):A;A=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];var U=z?new Uint8Array(A):A;A=new (z?Uint8Array:Array)(288);D=0;for(F=A.length;D=D?8:255>=D?9:279>=D?7:8;var W=f(A);A=new (z?Uint8Array: Array)(30);D=0;for(F=A.length;Df)d>=e&&(this.b=d,c=this.f(),d=this.b),c[d++]=f;else for(f-=257,h=S[f],0=e&&(this.b=d,c=this.f(),d=this.b);h--;)c[d]=c[d++-g];for(;8<=this.e;)this.e-=8,this.c--;this.b=d};s.prototype.I=function(a,b){var c=this.a,d=this.b;this.u=a;for(var e=c.length,f,g,h;256!== (f=t(this,a));)if(256>f)d>=e&&(c=this.f(),e=c.length),c[d++]=f;else for(f-=257,h=S[f],0e&&(c=this.f(),e=c.length);h--;)c[d]=c[d++-g];for(;8<=this.e;)this.e-=8,this.c--;this.b=d};s.prototype.f=function(){var a=new (z?Uint8Array:Array)(this.b-32768),b=this.b-32768,c,d,e=this.a;if(z)a.set(e.subarray(32768,a.length));else for(c=0,d=a.length;cc;++c)e[c]=e[b+c];this.b=32768;return e};s.prototype.J=function(a){var b,c=this.input.length/this.c+1|0,d,e,f,g=this.input,h=this.a;a&&("number"===typeof a.v&&(c=a.v),"number"===typeof a.F&&(c+=a.F));2>c?(d=(g.length-this.c)/this.u[2],f=d/2*258|0,e=fb&&(this.a.length=b),a=this.a);return this.buffer=a};w.prototype.p=function(){var b=this.input,d,e;d=this.A.p();this.c=this.A.c;this.M&&(e=(b[this.c++]<<24|b[this.c++]<< 16|b[this.c++]<<8|b[this.c++])>>>0,e!==c(d)&&a(Error("invalid adler-32 checksum")));return d};b("Zlib.Inflate",w);b("Zlib.Inflate.BufferType",C);C.ADAPTIVE=C.C;C.BLOCK=C.D;b("Zlib.Inflate.prototype.decompress",w.prototype.p);C=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];z&&new Uint16Array(C);C=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258];z&&new Uint16Array(C);C=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0];z&&new Uint8Array(C); C=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];z&&new Uint16Array(C);C=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];z&&new Uint8Array(C);C=new (z?Uint8Array:Array)(288);A=0;for(D=C.length;A=A?8:255>=A?9:279>=A?7:8;f(C);C=new (z?Uint8Array:Array)(30);A=0;for(D=C.length;Ab)return!1;a=new cc.BinaryStreamReader(a);a.setOffset(d);c.type=a.readByte();d+=10;if(d+4+1>b)return!1;a.setOffset(d);c.width=a.readUnsignedShort();c.height=a.readUnsignedInteger();c.pixelDepth=a.readByte();if(d+5+1>b)return!1;b=a.readByte();c.flipped=0;b&32&&(c.flipped=1);return!0}; cc.tgaLoadImageData=function(a,b,c){var d,e;d=0|c.pixelDepth/2;e=c.height*c.width*d;if(18+e>b)return!1;c.imageData=cc.__getSubArray(a,18,18+e);if(3<=d)for(a=0;ab)break;n=a[p];p+=1;(k=n&128)&&(n-=128);h=0}if(!h){if(p+d>b)break;m=cc.__getSubArray(a,p,p+d);p+=d;3<=d&&(h=m[0],m[0]=m[2],m[2]=h)}for(h=0;h>3;this._checkSize(c);var c=Math.pow(2,b-1)-1,e=this._readBits(a+b,1,d),f=this._readBits(a,b,d),g=0,h=2,k=0;do for(var m=this._readByte(++k, d),n=a%8||8,p=1<>=1;)m&p&&(g+=1/h),h*=2;while(a-=n);this._offset+=d;return f===(c<<1)+1?g?NaN:e?-Infinity:Infinity:(1+-2*e)*(f||g?f?Math.pow(2,f-c)*(1+g):Math.pow(2,-c+1)*g:0)},_readByte:function(a,b){return this._data[this._offset+b-a-1]},_decodeInt:function(a,b){var c=this._readBits(0,a,a/8),d=Math.pow(2,a);this._offset+=a/8;return b&&c>=d/2?c-d:c},_shl:function(a,b){for(++b;--b;a=1073741824===((a%=2147483648)&1073741824)?2*a:2*(a-1073741824)+2147483648);return a},_readBits:function(a,b,c){var d= (a+b)%8,e=a%8,f=c-(a>>3)-1;a=c+(-(a+b)>>3);var g=f-a;b=this._readByte(f,c)>>e&(1<<(g?8-e:b))-1;for(g&&d&&(b+=(this._readByte(a++,c)&(1<>>0>=f.firstGid)return f}}cc.log("cocos2d: Warning: TMX Layer "+a.name+" has no tiles");return null}});_p=cc.TMXTiledMap.prototype;cc.defineGetterSetter(_p,"mapWidth",_p._getMapWidth,_p._setMapWidth);cc.defineGetterSetter(_p,"mapHeight",_p._getMapHeight,_p._setMapHeight);cc.defineGetterSetter(_p,"tileWidth",_p._getTileWidth,_p._setTileWidth);cc.defineGetterSetter(_p,"tileHeight",_p._getTileHeight,_p._setTileHeight); cc.TMXTiledMap.create=function(a,b){return new cc.TMXTiledMap(a,b)};cc.TMX_PROPERTY_NONE=0;cc.TMX_PROPERTY_MAP=1;cc.TMX_PROPERTY_LAYER=2;cc.TMX_PROPERTY_OBJECTGROUP=3;cc.TMX_PROPERTY_OBJECT=4;cc.TMX_PROPERTY_TILE=5;cc.TMX_TILE_HORIZONTAL_FLAG=2147483648;cc.TMX_TILE_VERTICAL_FLAG=1073741824;cc.TMX_TILE_DIAGONAL_FLAG=536870912;cc.TMX_TILE_FLIPPED_ALL=(cc.TMX_TILE_HORIZONTAL_FLAG|cc.TMX_TILE_VERTICAL_FLAG|cc.TMX_TILE_DIAGONAL_FLAG)>>>0;cc.TMX_TILE_FLIPPED_MASK=~cc.TMX_TILE_FLIPPED_ALL>>>0; cc.TMXLayerInfo=cc.Class.extend({properties:null,name:"",_layerSize:null,_tiles:null,visible:null,_opacity:null,ownTiles:!0,_minGID:1E5,_maxGID:0,offset:null,ctor:function(){this.properties=[];this.name="";this._tiles=this._layerSize=null;this.visible=!0;this._opacity=0;this.ownTiles=!0;this._minGID=1E5;this._maxGID=0;this.offset=cc.p(0,0)},getProperties:function(){return this.properties},setProperties:function(a){this.properties=a}}); cc.TMXTilesetInfo=cc.Class.extend({name:"",firstGid:0,_tileSize:null,spacing:0,margin:0,sourceImage:"",imageSize:null,ctor:function(){this._tileSize=cc.size(0,0);this.imageSize=cc.size(0,0)},rectForGID:function(a,b){var c=b||cc.rect(0,0,0,0);c.width=this._tileSize.width;c.height=this._tileSize.height;a&=cc.TMX_TILE_FLIPPED_MASK;a-=parseInt(this.firstGid,10);var d=parseInt((this.imageSize.width-2*this.margin+this.spacing)/(this._tileSize.width+this.spacing),10);c.x=parseInt(a%d*(this._tileSize.width+ this.spacing)+this.margin,10);c.y=parseInt(parseInt(a/d,10)*(this._tileSize.height+this.spacing)+this.margin,10);return c}}); cc.TMXMapInfo=cc.SAXParser.extend({properties:null,orientation:null,parentElement:null,parentGID:null,layerAttrs:0,storingCharacters:!1,tmxFileName:null,currentString:null,_objectGroups:null,_mapSize:null,_tileSize:null,_layers:null,_tilesets:null,_tileProperties:null,_resources:"",_currentFirstGID:0,ctor:function(a,b){cc.SAXParser.prototype.ctor.apply(this);this._mapSize=cc.size(0,0);this._tileSize=cc.size(0,0);this._layers=[];this._tilesets=[];this._objectGroups=[];this.properties=[];this._tileProperties= {};this._currentFirstGID=0;void 0!==b?this.initWithXML(a,b):void 0!==a&&this.initWithTMXFile(a)},getOrientation:function(){return this.orientation},setOrientation:function(a){this.orientation=a},getMapSize:function(){return cc.size(this._mapSize.width,this._mapSize.height)},setMapSize:function(a){this._mapSize.width=a.width;this._mapSize.height=a.height},_getMapWidth:function(){return this._mapSize.width},_setMapWidth:function(a){this._mapSize.width=a},_getMapHeight:function(){return this._mapSize.height}, _setMapHeight:function(a){this._mapSize.height=a},getTileSize:function(){return cc.size(this._tileSize.width,this._tileSize.height)},setTileSize:function(a){this._tileSize.width=a.width;this._tileSize.height=a.height},_getTileWidth:function(){return this._tileSize.width},_setTileWidth:function(a){this._tileSize.width=a},_getTileHeight:function(){return this._tileSize.height},_setTileHeight:function(a){this._tileSize.height=a},getLayers:function(){return this._layers},setLayers:function(a){this._layers.push(a)}, getTilesets:function(){return this._tilesets},setTilesets:function(a){this._tilesets.push(a)},getObjectGroups:function(){return this._objectGroups},setObjectGroups:function(a){this._objectGroups.push(a)},getParentElement:function(){return this.parentElement},setParentElement:function(a){this.parentElement=a},getParentGID:function(){return this.parentGID},setParentGID:function(a){this.parentGID=a},getLayerAttribs:function(){return this.layerAttrs},setLayerAttribs:function(a){this.layerAttrs=a},getStoringCharacters:function(){return this.storingCharacters}, setStoringCharacters:function(a){this.storingCharacters=a},getProperties:function(){return this.properties},setProperties:function(a){this.properties=a},initWithTMXFile:function(a){this._internalInit(a,null);return this.parseXMLFile(a)},initWithXML:function(a,b){this._internalInit(null,b);return this.parseXMLString(a)},parseXMLFile:function(a,b){var c=(b=b||!1)?a:cc.loader.getRes(a);if(!c)throw Error("Please load the resource first : "+a);var d,e,c=this._parseXML(c).documentElement;d=c.getAttribute("version"); e=c.getAttribute("orientation");if("map"===c.nodeName&&("1.0"!==d&&null!==d&&cc.log("cocos2d: TMXFormat: Unsupported TMX version:"+d),"orthogonal"===e?this.orientation=cc.TMX_ORIENTATION_ORTHO:"isometric"===e?this.orientation=cc.TMX_ORIENTATION_ISO:"hexagonal"===e?this.orientation=cc.TMX_ORIENTATION_HEX:null!==e&&cc.log("cocos2d: TMXFomat: Unsupported orientation:"+e),d=cc.size(0,0),d.width=parseFloat(c.getAttribute("width")),d.height=parseFloat(c.getAttribute("height")),this.setMapSize(d),d=cc.size(0, 0),d.width=parseFloat(c.getAttribute("tilewidth")),d.height=parseFloat(c.getAttribute("tileheight")),this.setTileSize(d),e=c.querySelectorAll("map \x3e properties \x3e property"))){var f={};for(d=0;d=this._layerSize.width||b>=this._layerSize.height||0>c||0>b)throw Error("cc.TMXLayer.getTileAt(): invalid position");if(!this.tiles)return cc.log("cc.TMXLayer.getTileAt(): TMXLayer: the tiles map has been released"),null;var d=null,e=this.getTileGIDAt(c,b);if(0===e)return d;var f=0|c+b*this._layerSize.width,d=this._spriteTiles[f]; d||(d=this._texGrids[e],e=this._textures[d.texId],d=cc.rectPixelsToPoints(d),d=new cc.Sprite(e,d),d.setPosition(this.getPositionAt(c,b)),c=this._vertexZForPos(c,b),d.setVertexZ(c),d.setAnchorPoint(0,0),d.setOpacity(this._opacity),this.addChild(d,c,f));return d},getTileGIDAt:function(a,b){if(void 0===a)throw Error("cc.TMXLayer.getTileGIDAt(): pos should be non-null");var c=a;void 0===b&&(c=a.x,b=a.y);if(c>=this._layerSize.width||b>=this._layerSize.height||0>c||0>b)throw Error("cc.TMXLayer.getTileGIDAt(): invalid position"); return this.tiles?(this.tiles[0|c+b*this._layerSize.width]&cc.TMX_TILE_FLIPPED_MASK)>>>0:(cc.log("cc.TMXLayer.getTileGIDAt(): TMXLayer: the tiles map has been released"),null)},setTileGID:function(a,b,c,d){if(void 0===b)throw Error("cc.TMXLayer.setTileGID(): pos should be non-null");void 0!==d?b=cc.p(b,c):d=c;if(b.x>=this._layerSize.width||b.y>=this._layerSize.height||0>b.x||0>b.y)throw Error("cc.TMXLayer.setTileGID(): invalid position");if(this.tiles)if(0!==a&&a>>0,0===a)this.removeTileAt(b);else if(0===e)this._updateTileForGID(c,b);else{var e=b.x+b.y*this._layerSize.width,f=this.getChildByTag(e);if(f){a=this._texGrids[a];var g=this._textures[a.texId];a=cc.rectPixelsToPoints(a);f.setTexture(g);f.setTextureRect(a,!1);null!=d&&this._setupTileSprite(f,b,c);this.tiles[e]=c}else this._updateTileForGID(c,b)}}else cc.log("cc.TMXLayer.setTileGID(): TMXLayer: the tiles map has been released")}, addChild:function(a,b,c){cc.Node.prototype.addChild.call(this,a,b,c);void 0!==c&&(this._spriteTiles[c]=a,a._vertexZ=this._vertexZ+cc.renderer.assignedZStep*c/this.tiles.length)},removeChild:function(a,b){this._spriteTiles[a.tag]&&(this._spriteTiles[a.tag]=null);cc.Node.prototype.removeChild.call(this,a,b)},getTileFlagsAt:function(a,b){if(!a)throw Error("cc.TMXLayer.getTileFlagsAt(): pos should be non-null");void 0!==b&&(a=cc.p(a,b));if(a.x>=this._layerSize.width||a.y>=this._layerSize.height||0>a.x|| 0>a.y)throw Error("cc.TMXLayer.getTileFlagsAt(): invalid position");return this.tiles?(this.tiles[0|a.x+a.y*this._layerSize.width]&cc.TMX_TILE_FLIPPED_ALL)>>>0:(cc.log("cc.TMXLayer.getTileFlagsAt(): TMXLayer: the tiles map has been released"),null)},removeTileAt:function(a,b){if(!a)throw Error("cc.TMXLayer.removeTileAt(): pos should be non-null");void 0!==b&&(a=cc.p(a,b));if(a.x>=this._layerSize.width||a.y>=this._layerSize.height||0>a.x||0>a.y)throw Error("cc.TMXLayer.removeTileAt(): invalid position"); if(!this.tiles)cc.log("cc.TMXLayer.removeTileAt(): TMXLayer: the tiles map has been released");else if(0!==this.getTileGIDAt(a)){var c=0|a.x+a.y*this._layerSize.width;this.tiles[c]=0;(c=this._spriteTiles[c])&&this.removeChild(c,!0)}},getPositionAt:function(a,b){void 0!==b&&(a=cc.p(a,b));var c=cc.p(0,0);switch(this.layerOrientation){case cc.TMX_ORIENTATION_ORTHO:c=this._positionForOrthoAt(a);break;case cc.TMX_ORIENTATION_ISO:c=this._positionForIsoAt(a);break;case cc.TMX_ORIENTATION_HEX:c=this._positionForHexAt(a)}return cc.pointPixelsToPoints(c)}, _positionForIsoAt:function(a){return cc.p(this._mapTileSize.width/2*(this._layerSize.width+a.x-a.y-1),this._mapTileSize.height/2*(2*this._layerSize.height-a.x-a.y-2))},_positionForOrthoAt:function(a){return cc.p(a.x*this._mapTileSize.width,(this._layerSize.height-a.y-1)*this._mapTileSize.height)},_positionForHexAt:function(a){return cc.p(a.x*this._mapTileSize.width*3/4,(this._layerSize.height-a.y-1)*this._mapTileSize.height+(1===a.x%2?-this._mapTileSize.height/2:0))},_calculateLayerOffset:function(a){var b= cc.p(0,0);switch(this.layerOrientation){case cc.TMX_ORIENTATION_ORTHO:b=cc.p(a.x*this._mapTileSize.width,-a.y*this._mapTileSize.height);break;case cc.TMX_ORIENTATION_ISO:b=cc.p(this._mapTileSize.width/2*(a.x-a.y),this._mapTileSize.height/2*(-a.x-a.y));break;case cc.TMX_ORIENTATION_HEX:0===a.x&&0===a.y||cc.log("offset for hexagonal map not implemented yet")}return b},_updateTileForGID:function(a,b){if(this._texGrids[a]){var c=0|b.x+b.y*this._layerSize.width;c>>0?(a.setAnchorPoint(0.5,0.5),a.setPosition(d.x+a.width/2,d.y+a.height/2),b=(c&(cc.TMX_TILE_HORIZONTAL_FLAG|cc.TMX_TILE_VERTICAL_FLAG)>>>0)>>>0,b===cc.TMX_TILE_HORIZONTAL_FLAG?a.setRotation(90):b===cc.TMX_TILE_VERTICAL_FLAG?a.setRotation(270):(b===(cc.TMX_TILE_VERTICAL_FLAG|cc.TMX_TILE_HORIZONTAL_FLAG)>>> 0?a.setRotation(90):a.setRotation(270),a.setFlippedX(!0))):((c&cc.TMX_TILE_HORIZONTAL_FLAG)>>>0&&a.setFlippedX(!0),(c&cc.TMX_TILE_VERTICAL_FLAG)>>>0&&a.setFlippedY(!0))},_vertexZForPos:function(a,b){void 0===b&&(b=a.y,a=a.x);var c=0,d=0;if(this._useAutomaticVertexZ)switch(this.layerOrientation){case cc.TMX_ORIENTATION_ISO:d=this._layerSize.width+this._layerSize.height;c=-(d-(a+b));break;case cc.TMX_ORIENTATION_ORTHO:c=-(this._layerSize.height-b);break;case cc.TMX_ORIENTATION_HEX:cc.log("TMX Hexa zOrder not supported"); break;default:cc.log("TMX invalid value")}else c=this._vertexZvalue;return c}});_p=cc.TMXLayer.prototype;cc.defineGetterSetter(_p,"layerWidth",_p._getLayerWidth,_p._setLayerWidth);cc.defineGetterSetter(_p,"layerHeight",_p._getLayerHeight,_p._setLayerHeight);cc.defineGetterSetter(_p,"tileWidth",_p._getTileWidth,_p._setTileWidth);cc.defineGetterSetter(_p,"tileHeight",_p._getTileHeight,_p._setTileHeight);cc.TMXLayer.create=function(a,b,c){return new cc.TMXLayer(a,b,c)};(function(){cc.TMXLayer.CanvasRenderCmd=function(a){this._rootCtor(a);this._needDraw=!0};var a=cc.TMXLayer.CanvasRenderCmd.prototype=Object.create(cc.Node.CanvasRenderCmd.prototype);a.constructor=cc.TMXLayer.CanvasRenderCmd;a.visit=function(a){var c=this._node,d=cc.renderer;if(a=a||this.getParentRenderCmd())this._curLevel=a._curLevel+1;if(c._visible){isNaN(c._customZ)&&(c._vertexZ=d.assignedZ,d.assignedZ+=d.assignedZStep);this._syncStatus(a);a=c._children;var e=c._spriteTiles,f,g=a.length;if(0c._localZOrder)c._renderCmd.visit(this);else break;for(d.pushRenderCommand(this);f=h)){var k=e._mapTileSize.width,m=e._mapTileSize.height, n=e.tileset._tileSize.width/cc.director._contentScaleFactor,p=e.tileset._tileSize.height/cc.director._contentScaleFactor,r=n-k,s=p-m,u=cc.winSize.width,t=cc.winSize.height,v=e._layerSize.height,w=e._layerSize.width,x=e._texGrids,B=e._spriteTiles,y=this._worldTransform,z=-e._contentSize.width*e._anchorPoint.x,C=-e._contentSize.height*e._anchorPoint.y,A=y.a,D=y.d,F=z*A+C*y.c+y.tx,z=z*y.b+C*D+y.ty,C=a||cc._renderContext,M=C.getContext(),E=0,N=0,Q=w,H=v;f||g!==cc.TMX_ORIENTATION_ORTHO||(E=Math.floor(-(F- r*A)/(k*A)),N=Math.floor((z-s*D+m*v*D-t)/(m*D)),Q=Math.ceil((u-F+r*A)/(k*A)),H=v-Math.floor(-(z+s*D)/(m*D)),0>E&&(E=0),0>N&&(N=0),Q>w&&(Q=w),H>v&&(H=v));var R,K,r=N*w,I,P,T,S=cc.TMX_TILE_FLIPPED_MASK,O,G,U,W,ga=n*A,la=p*D,ba,ta,pa=!1,qa=!1,s=r+E;for(R in B)if(R=s)break;C.setTransform(y,c,d);for(C.setGlobalAlpha(h);N>>0])&&(T=e._textures[P.texId])&&T._htmlElementObj){switch(g){case cc.TMX_ORIENTATION_ORTHO:G=K*k;U=-(v-N-1)*m;break;case cc.TMX_ORIENTATION_ISO:G=k/2*(w+K-N-1);U=-m/2*(2*v-K-N-2);break;case cc.TMX_ORIENTATION_HEX:G=K*k*3/4,U=-(v-N-1)*m+(1===K%2?-m/2:0)}W=G+n;O=U-p;if(!f&&g===cc.TMX_ORIENTATION_ISO){ba=-z+U*D;if(ba<-t-la){K+=Math.floor(2*(-t-ba)/la)-1;continue}ba=F+W*A;if(ba<-ga){K+=Math.floor(2*-ba/ga)- 1;continue}ta=F+G*A;ba=-z+O*D;if(ta>u||0cc.TMX_TILE_DIAGONAL_FLAG&&(pa=(I&cc.TMX_TILE_HORIZONTAL_FLAG)>>>0,qa=(I&cc.TMX_TILE_VERTICAL_FLAG)>>>0);pa&&(G=-W,M.scale(-1,1));qa&&(O=-U,M.scale(1,-1));M.drawImage(T._htmlElementObj,P.x,P.y,P.width,P.height,G,O,n,p);pa&&M.scale(-1,1);qa&&M.scale(1,-1);cc.g_NumberOfDraws++}r+=w}for(R in B)R>s&&B[R]&&(I=B[R]._renderCmd,0===B[R]._localZOrder&&I.rendering&&I.rendering(a,c,d))}}})();(function(){cc.TMXLayer.WebGLRenderCmd=function(a){this._rootCtor(a);this._needDraw=!0;this._vertices=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}];this._color=new Uint32Array(1);this._shaderProgram=cc.shaderCache.programForKey(cc.SHADER_SPRITE_POSITION_TEXTURECOLORALPHATEST);a=90*Math.PI/180;this._sin90=Math.sin(a);this._cos90=Math.cos(a);a*=3;this._sin270=Math.sin(a);this._cos270=Math.cos(a)};var a=cc.TMXLayer.WebGLRenderCmd.prototype=Object.create(cc.Node.WebGLRenderCmd.prototype);a.constructor=cc.TMXLayer.WebGLRenderCmd; a.uploadData=function(a,c,d){var e=this._node,f=e._rotationX||e._rotationY,g=e.layerOrientation,h=e.tiles;if(!h)return 0;var k=e._mapTileSize.width,m=e._mapTileSize.height,n=e.tileset._tileSize.width/cc.director._contentScaleFactor,p=e.tileset._tileSize.height/cc.director._contentScaleFactor,r=n-k,s=p-m,u=cc.winSize.width,t=cc.winSize.height,v=e._layerSize.height,w=e._layerSize.width,x=e._texGrids,B=e._spriteTiles,y=this._worldTransform,z=y.a,C=y.b,A=y.c,D=y.d,F=y.tx,y=y.ty,M=-e._contentSize.width* e._anchorPoint.x,E=-e._contentSize.height*e._anchorPoint.y,N=M*z+E*A+F,M=M*C+E*D+y,E=e._opacity,Q=this._displayedColor.r,H=this._displayedColor.g,R=this._displayedColor.b;if(e._opacityModifyRGB)var K=E/255,Q=Q*K,H=H*K,R=R*K;this._color[0]=E<<24|R<<16|H<<8|Q;var I=E=0,Q=w,H=v;f||g!==cc.TMX_ORIENTATION_ORTHO||(E=Math.floor(-(N-r*z)/(k*z)),I=Math.floor((M-s*D+m*v*D-t)/(m*D)),Q=Math.ceil((u-N+r*z)/(k*z)),H=v-Math.floor(-(M+s*D)/(m*D)),0>E&&(E=0),0>I&&(I=0),Q>w&&(Q=w),H>v&&(H=v));for(var P,r=d,s=I*w,T, S,O,R=cc.TMX_TILE_FLIPPED_MASK,G,U,W,ga,K=n*z,la=p*D,ba,ta,pa=z,qa=C,ka=A,xa=D,wa=F,ya=y,za=!1,na=!1,ua=!1,fa=this._vertices;Ia.length&&(cc.renderer._increaseBatchingSize((r-d)/6),cc.renderer._batchRendering(),r=d=0),T=s+P,!B[T]&&(S=e.tiles[T],O=x[(S&R)>>>0])){switch(g){case cc.TMX_ORIENTATION_ORTHO:U=P*k;W=(v-I-1)*m;T=e._vertexZ+cc.renderer.assignedZStep*T/h.length;break;case cc.TMX_ORIENTATION_ISO:U=k/2*(w+P-I-1);W=m/2*(2*v-P-I-2);T=e._vertexZ+cc.renderer.assignedZStep* (e.height-W)/e.height;break;case cc.TMX_ORIENTATION_HEX:U=P*k*3/4,W=(v-I-1)*m+(1===P%2?-m/2:0),T=e._vertexZ+cc.renderer.assignedZStep*(e.height-W)/e.height}ga=U+n;G=W+p;if(!f&&g===cc.TMX_ORIENTATION_ISO){ba=M+W*D;if(ba>t+la){P+=Math.floor(2*(ba-t)/la)-1;continue}ba=N+ga*z;if(ba<-K){P+=Math.floor(2*-ba/K)-1;continue}ta=N+U*z;ba=M+G*D;if(ta>u||0>ba){P=Q;continue}}S>cc.TMX_TILE_DIAGONAL_FLAG&&(za=!0,na=(S&cc.TMX_TILE_HORIZONTAL_FLAG)>>>0,ua=(S&cc.TMX_TILE_VERTICAL_FLAG)>>>0);fa[0].x=U*pa+G*ka+wa;fa[0].y= U*qa+G*xa+ya;fa[1].x=U*pa+W*ka+wa;fa[1].y=U*qa+W*xa+ya;fa[2].x=ga*pa+G*ka+wa;fa[2].y=ga*qa+G*xa+ya;fa[3].x=ga*pa+W*ka+wa;fa[3].y=ga*qa+W*xa+ya;for(S=0;4>S;++S){a[r]=fa[S].x;a[r+1]=fa[S].y;a[r+2]=T;c[r+3]=this._color[0];switch(S){case 0:a[r+4]=na?O.r:O.l;a[r+5]=ua?O.b:O.t;break;case 1:a[r+4]=na?O.r:O.l;a[r+5]=ua?O.t:O.b;break;case 2:a[r+4]=na?O.l:O.r;a[r+5]=ua?O.b:O.t;break;case 3:a[r+4]=na?O.l:O.r,a[r+5]=ua?O.t:O.b}r+=6}za&&(pa=z,qa=C,ka=A,xa=D,wa=F,ya=y,za=ua=na=!1)}s+=w}return(r-d)/6}})();cc.PointObject=cc.Class.extend({_ratio:null,_offset:null,_child:null,ctor:function(a,b){this.initWithCCPoint(a,b)},getRatio:function(){return this._ratio},setRatio:function(a){this._ratio=a},getOffset:function(){return this._offset},setOffset:function(a){this._offset=a},getChild:function(){return this._child},setChild:function(a){this._child=a},initWithCCPoint:function(a,b){this._ratio=a;this._offset=b;this._child=null;return!0}});cc.PointObject.create=function(a,b){return new cc.PointObject(a,b)}; cc.ParallaxNode=cc.Node.extend({parallaxArray:null,_lastPosition:null,_className:"ParallaxNode",getParallaxArray:function(){return this.parallaxArray},setParallaxArray:function(a){this.parallaxArray=a},ctor:function(){cc.Node.prototype.ctor.call(this);this.parallaxArray=[];this._lastPosition=cc.p(-100,-100)},addChild:function(a,b,c,d){if(3===arguments.length)cc.log("ParallaxNode: use addChild(child, z, ratio, offset) instead");else{if(!a)throw Error("cc.ParallaxNode.addChild(): child should be non-null"); var e=new cc.PointObject(c,d);e.setChild(a);this.parallaxArray.push(e);a.setPosition(this._position.x*c.x+d.x,this._position.y*c.y+d.y);cc.Node.prototype.addChild.call(this,a,b,a.tag)}},removeChild:function(a,b){for(var c=this.parallaxArray,d=0;dthis.buffer.duration},set paused(a){},get loop(){return this._loop},set loop(a){return this._loop=a},get volume(){return this._volume.gain.value},set volume(a){return this._volume.gain.value=a},get currentTime(){return this.playedLength},set currentTime(a){return this.playedLength=a},play:function(a){this._currentSource&& !this.paused&&(this._currentSource.stop(0),this.playedLength=0);var b=this.context.createBufferSource();b.buffer=this.buffer;b.connect(this._volume);b.loop=this._loop;this._startTime=this.context.currentTime;a=a||this.playedLength;var c=this.buffer.duration;this._loop?b.start?b.start(0):b.notoGrainOn?b.noteGrainOn(0):b.noteOn(0):b.start?b.start(0,a,c-a):b.notoGrainOn?b.noteGrainOn(0,a,c-a):b.noteOn(0,a,c-a);this._currentSource=b;if(0===this.context.currentTime){var d=this;clearTimeout(this._currextTimer); this._currextTimer=setTimeout(function(){0===d.context.currentTime&&cc.Audio.touchPlayList.push({offset:a,audio:d})},10)}},pause:function(){this.playedLength=this.context.currentTime-this._startTime;this.playedLength%=this.buffer.duration;var a=this._currentSource;this._currentSource=null;this._startTime=-1;a&&a.stop(0)}}; (function(a){var b=a.WEB_AUDIO,c=a.ONLY_ONE,d=[];(function(){var a=document.createElement("audio");if(a.canPlayType){var b=a.canPlayType('audio/ogg; codecs\x3d"vorbis"');b&&""!==b&&d.push(".ogg");(b=a.canPlayType("audio/mpeg"))&&""!==b&&d.push(".mp3");(b=a.canPlayType('audio/wav; codecs\x3d"1"'))&&""!==b&&d.push(".wav");(b=a.canPlayType("audio/mp4"))&&""!==b&&d.push(".mp4");(a=a.canPlayType("audio/x-m4a"))&&""!==a&&d.push(".m4a")}})();try{if(b){var e=new (window.AudioContext||window.webkitAudioContext|| window.mozAudioContext);cc.Audio._context=e;a.DELAY_CREATE_CTX&&setTimeout(function(){e=new (window.AudioContext||window.webkitAudioContext||window.mozAudioContext);cc.Audio._context=e},0)}}catch(f){b=!1,cc.log("browser don't support web audio")}var g={cache:{},useWebAudio:!0,loadBuffer:function(a,c){if(b){var d=cc.loader.getXMLHttpRequest();d.open("GET",a,!0);d.responseType="arraybuffer";d.onload=function(){0<=d._timeoutId&&clearTimeout(d._timeoutId);e.decodeAudioData(d.response,function(a){c(null, a)},function(){c("decode error - "+a)})};d.onerror=function(){c("request error - "+a)};void 0===d.ontimeout&&(d._timeoutId=setTimeout(function(){d.ontimeout()},d.timeout));d.ontimeout=function(){c("request timeout - "+a)};d.send()}},load:function(a,b,c,e){if(0===d.length)return e("can not support audio!");var f=cc.loader.getRes(b);if(f)return e(null,f);cc.loader.audioPath&&(a=cc.path.join(cc.loader.audioPath,a));f=cc.path.extname(a);c=[f];for(var g=0;ga&&(a=0);this._musicVolume=a;var b=this._currMusic;b&&b.setVolume(a)},isMusicPlaying:function(){var a=this._currMusic;return a?a.getPlaying():!1},_audioPool:{},_maxAudioInstance:10,_effectVolume:1,playEffect:function(a,d){if(c&&this._currMusic&&this._currMusic.getPlaying())return cc.log("Browser is only allowed to play one audio"), null;var e=this._audioPool[a];e||(e=this._audioPool[a]=[]);for(var f=0;fthis._maxAudioInstance&&(f=e.shift(),f.stop(),e.push(f),f=e.length-1);var p;if(e[f])return p=e[f],p.setVolume(this._effectVolume),p.play(0,d||!1),p;(p=cc.loader.getRes(a))&&b&&"AUDIO"===p._AUDIO_TYPE&&(cc.loader.release(a),p=null);if(p)if(b&&"AUDIO"===p._AUDIO_TYPE)g.loadBuffer(a,function(a,b){p.setBuffer(b);p.setVolume(cc.audioEngine._effectVolume);p.getPlaying()||p.play(0,d||!1)});else return p= p.cloneNode(),p.setVolume(this._effectVolume),p.play(0,d||!1),e.push(p),p;f=g.useWebAudio;g.useWebAudio=!0;cc.loader.load(a,function(b){b=cc.loader.getRes(a);b=b.cloneNode();b.setVolume(cc.audioEngine._effectVolume);b.play(0,d||!1);e.push(b)});g.useWebAudio=f;return p},setEffectsVolume:function(a){a-=0;isNaN(a)&&(a=1);1a&&(a=0);this._effectVolume=a;var b=this._audioPool,c;for(c in b){var d=b[c];if(Array.isArray(d))for(var e=0;e=d.width&&(d.width=c.width),0>=d.height&&(d.height=c.height),a.setContentSize(d));c=b?b.getBoundingBox():cc.rect(0,0,0,0);d=a?a.getBoundingBox():cc.rect(0, 0,0,0);c=cc.rectUnion(c,d);this.setContentSize(c.width,c.height);c=this.getContentSize();b&&(b.setPosition(c.width/2,c.height/2),b.setVisible(!0));a&&(a.setPosition(c.width/2,c.height/2),a.setVisible(!0))}},initWithLabelAndBackgroundSprite:function(a,b){if(!a)throw Error("cc.ControlButton.initWithLabelAndBackgroundSprite(): label should be non-null");if(!b)throw Error("cc.ControlButton.initWithLabelAndBackgroundSprite(): backgroundSprite should be non-null");if(cc.Control.prototype.init.call(this, !0)){this._parentInited=!0;this._titleDispatchTable={};this._titleColorDispatchTable={};this._titleLabelDispatchTable={};this._backgroundSpriteDispatchTable={};this._isPushed=!1;this.zoomOnTouchDown=!0;this._currentTitle=null;this.setAdjustBackgroundImage(!0);this.setPreferredSize(cc.size(0,0));this.zoomOnTouchDown=!0;this.ignoreAnchorPointForPosition(!1);this.setAnchorPoint(0.5,0.5);this._titleLabel=a;this._backgroundSprite=b;this.setOpacity(255);this.setOpacityModifyRGB(!0);var c=a.getString(); this.setTitleForState(c,cc.CONTROL_STATE_NORMAL);this.setTitleColorForState(a.getColor(),cc.CONTROL_STATE_NORMAL);this.setTitleLabelForState(a,cc.CONTROL_STATE_NORMAL);this.setBackgroundSpriteForState(b,cc.CONTROL_STATE_NORMAL);this._state=cc.CONTROL_STATE_NORMAL;this._marginH=24;this._marginV=12;this._labelAnchorPoint=cc.p(0.5,0.5);this.setPreferredSize(cc.size(0,0));this.needsLayout();return!0}return!1},initWithTitleAndFontNameAndFontSize:function(a,b,c){a=new cc.LabelTTF(a,b,c);return this.initWithLabelAndBackgroundSprite(a, new cc.Scale9Sprite)},initWithBackgroundSprite:function(a){var b=new cc.LabelTTF("","Arial",30);return this.initWithLabelAndBackgroundSprite(b,a)},doesAdjustBackgroundImage:function(){return this._doesAdjustBackgroundImage},setAdjustBackgroundImage:function(a){this._doesAdjustBackgroundImage=a;this.needsLayout()},getZoomOnTouchDown:function(){return this.zoomOnTouchDown},setZoomOnTouchDown:function(a){return this.zoomOnTouchDown=a},getPreferredSize:function(){return this._preferredSize},setPreferredSize:function(a){if(0=== a.width&&0===a.height)this._doesAdjustBackgroundImage=!0;else{this._doesAdjustBackgroundImage=!1;var b=this._backgroundSpriteDispatchTable,c;for(c in b)b[c].setPreferredSize(a)}this._preferredSize=a;this.needsLayout()},getLabelAnchorPoint:function(){return this._labelAnchorPoint},setLabelAnchorPoint:function(a){this._labelAnchorPoint=a;this._titleLabel&&this._titleLabel.setAnchorPoint(a)},_getCurrentTitle:function(){return this._currentTitle},_getCurrentTitleColor:function(){return this._currentTitleColor}, getOpacity:function(){return this._opacity},setOpacity:function(a){cc.Control.prototype.setOpacity.call(this,a);var b=this._backgroundSpriteDispatchTable,c;for(c in b)b[c].setOpacity(a)},setColor:function(a){cc.Control.prototype.setColor.call(this,a);var b=this._backgroundSpriteDispatchTable,c;for(c in b)b[c].setColor(a)},getColor:function(){var a=this._realColor;return cc.color(a.r,a.g,a.b,a.a)},isPushed:function(){return this._isPushed},_getVerticalMargin:function(){return this._marginV},_getHorizontalOrigin:function(){return this._marginH}, setMargins:function(a,b){this._marginV=b;this._marginH=a;this.needsLayout()},setEnabled:function(a){cc.Control.prototype.setEnabled.call(this,a);this.needsLayout()},setSelected:function(a){cc.Control.prototype.setSelected.call(this,a);this.needsLayout()},setHighlighted:function(a){this._state=a?cc.CONTROL_STATE_HIGHLIGHTED:cc.CONTROL_STATE_NORMAL;cc.Control.prototype.setHighlighted.call(this,a);(a=this.getActionByTag(cc.CONTROL_ZOOM_ACTION_TAG))&&this.stopAction(a);this.zoomOnTouchDown&&(a=this.isHighlighted()&& this.isEnabled()&&!this.isSelected()?1.1:1,a=cc.scaleTo(0.05,a),a.setTag(cc.CONTROL_ZOOM_ACTION_TAG),this.runAction(a))},onTouchBegan:function(a,b){if(!(this.isTouchInside(a)&&this.isEnabled()&&this.isVisible()&&this.hasVisibleParents()))return!1;this._isPushed=!0;this.setHighlighted(!0);this.sendActionsForControlEvents(cc.CONTROL_EVENT_TOUCH_DOWN);return!0},onTouchMoved:function(a,b){if(this._enabled&&this._isPushed&&!this._selected){var c=this.isTouchInside(a);c&&!this._highlighted?(this.setHighlighted(!0), this.sendActionsForControlEvents(cc.CONTROL_EVENT_TOUCH_DRAG_ENTER)):c&&this._highlighted?this.sendActionsForControlEvents(cc.CONTROL_EVENT_TOUCH_DRAG_INSIDE):!c&&this._highlighted?(this.setHighlighted(!1),this.sendActionsForControlEvents(cc.CONTROL_EVENT_TOUCH_DRAG_EXIT)):c||this._highlighted||this.sendActionsForControlEvents(cc.CONTROL_EVENT_TOUCH_DRAG_OUTSIDE)}else this._highlighted&&this.setHighlighted(!1)},onTouchEnded:function(a,b){this._isPushed=!1;this.setHighlighted(!1);this.isTouchInside(a)? this.sendActionsForControlEvents(cc.CONTROL_EVENT_TOUCH_UP_INSIDE):this.sendActionsForControlEvents(cc.CONTROL_EVENT_TOUCH_UP_OUTSIDE)},onTouchCancelled:function(a,b){this._isPushed=!1;this.setHighlighted(!1);this.sendActionsForControlEvents(cc.CONTROL_EVENT_TOUCH_CANCEL)},getTitleForState:function(a){var b=this._titleDispatchTable;return b?b[a]?b[a]:b[cc.CONTROL_STATE_NORMAL]:""},setTitleForState:function(a,b){this._titleDispatchTable[b]=a||"";this.getState()===b&&this.needsLayout()},getTitleColorForState:function(a){return(a= this._titleColorDispatchTable[a])?a:(a=this._titleColorDispatchTable[cc.CONTROL_STATE_NORMAL])?a:cc.color.WHITE},setTitleColorForState:function(a,b){this._titleColorDispatchTable[b]=a;this.getState()===b&&this.needsLayout()},getTitleLabelForState:function(a){var b=this._titleLabelDispatchTable;return b[a]?b[a]:b[cc.CONTROL_STATE_NORMAL]},setTitleLabelForState:function(a,b){var c=this._titleLabelDispatchTable;if(c[b]){var d=c[b];d&&this.removeChild(d,!0)}c[b]=a;a.setVisible(!1);a.setAnchorPoint(0.5, 0.5);this.addChild(a,1);this.getState()===b&&this.needsLayout()},setTitleTTFForState:function(a,b){var c=this.getTitleForState(b);c||(c="");this.setTitleLabelForState(new cc.LabelTTF(c,a,12),b)},getTitleTTFForState:function(a){a=this.getTitleLabelForState(a);return null!=a&&a instanceof cc.LabelTTF?a.getFontName():""},setTitleTTFSizeForState:function(a,b){var c=this.getTitleLabelForState(b);null!=c&&c instanceof cc.LabelTTF&&c.setFontSize(a)},getTitleTTFSizeForState:function(a){a=this.getTitleLabelForState(a); return null!=a&&a instanceof cc.LabelTTF?a.getFontSize():0},setTitleBMFontForState:function(a,b){var c=this.getTitleForState(b);c||(c="");this.setTitleLabelForState(new cc.LabelBMFont(c,a),b)},getTitleBMFontForState:function(a){a=this.getTitleLabelForState(a);return null!=a&&a instanceof cc.LabelBMFont?a.getFntFile():""},getBackgroundSpriteForState:function(a){var b=this._backgroundSpriteDispatchTable;return b[a]?b[a]:b[cc.CONTROL_STATE_NORMAL]},setBackgroundSpriteForState:function(a,b){var c=this._backgroundSpriteDispatchTable; if(c[b]){var d=c[b];d&&this.removeChild(d,!0)}c[b]=a;a.setVisible(!1);a.setAnchorPoint(0.5,0.5);this.addChild(a);c=this._preferredSize;0===c.width&&0===c.height||a.setPreferredSize(c);this._state===b&&this.needsLayout()},setBackgroundSpriteFrameForState:function(a,b){var c=cc.Scale9Sprite.createWithSpriteFrame(a);this.setBackgroundSpriteForState(c,b)}});_p=cc.ControlButton.prototype;cc.defineGetterSetter(_p,"adjustBackground",_p.getAdjustBackgroundImage,_p.setAdjustBackgroundImage); cc.defineGetterSetter(_p,"preferredSize",_p.getPreferredSize,_p.setPreferredSize);cc.defineGetterSetter(_p,"labelAnchor",_p.getLabelAnchorPoint,_p.setLabelAnchorPoint);_p=null;cc.ControlButton.create=function(a,b,c){return new cc.ControlButton(a,b,c)};cc.RGBA=function(a,b,c,d){this.r=a;this.g=b;this.b=c;this.a=d};cc.HSV=function(a,b,c){this.h=a;this.s=b;this.v=c};cc.ControlUtils={};cc.ControlUtils.addSpriteToTargetWithPosAndAnchor=function(a,b,c,d){a=new cc.Sprite("#"+a);if(!a)return null;a.setPosition(c);a.setAnchorPoint(d);b.addChild(a);return a}; cc.ControlUtils.HSVfromRGB=function(a){var b=new cc.HSV,c,d;c=a.ra.g?a.r:a.g;d=d>a.b?d:a.b;b.v=d;c=d-c;if(0=d?(a.g-a.b)/c:a.g>=d?2+(a.b-a.r)/c:4+(a.r-a.g)/c;b.h*=60;0>b.h&&(b.h+=360);return b}; cc.ControlUtils.RGBfromHSV=function(a){var b,c,d,e,f=new cc.RGBA;f.a=1;if(0>=a.s){if(!a.h)return f.r=a.v,f.g=a.v,f.b=a.v,f;f.r=0;f.g=0;f.b=0;return f}b=a.h;360<=b&&(b=0);b/=60;e=0|b;d=b-e;b=a.v*(1-a.s);c=a.v*(1-a.s*d);d=a.v*(1-a.s*(1-d));switch(e){case 0:f.r=a.v;f.g=d;f.b=b;break;case 1:f.r=c;f.g=a.v;f.b=b;break;case 2:f.r=b;f.g=a.v;f.b=d;break;case 3:f.r=b;f.g=c;f.b=a.v;break;case 4:f.r=d;f.g=b;f.b=a.v;break;default:f.r=a.v,f.g=b,f.b=c}return f}; cc.ControlUtils.CCRectUnion=function(a,b){return cc.rectUnion(a,b)};cc.Invocation=cc.Class.extend({_action:null,_target:null,_controlEvent:null,ctor:function(a,b,c){this._target=a;this._action=b;this._controlEvent=c},getAction:function(){return this._action},getTarget:function(){return this._target},getControlEvent:function(){return this._controlEvent},invoke:function(a){if(this._target&&this._action)if(cc.isString(this._action))this._target[this._action](a,this._controlEvent);else this._action.call(this._target,a,this._controlEvent)}});cc.Spacer=cc.Layer.extend({});cc.Spacer.verticalSpacer=function(a){var b=new cc.Spacer;b.init();b.setContentSize(0,a);return b};cc.Spacer.horizontalSpacer=function(a){var b=new cc.Spacer;b.init();b.setContentSize(a,0);return b}; cc.MenuPassive=cc.Layer.extend({_color:null,_opacity:0,_className:"MenuPassive",ctor:function(){},getColor:function(){var a=this._color;return cc.color(a.r,a.g,a.b,a.a)},setColor:function(a){var b=this._color;b.r=a.r;b.g=a.g;b.b=a.b;if(this._children&&0=b.length?cc.log("cc.MenuPassive.alignItemsInColumns(): invalid row index"):(h=b[e])?(k=this._children[c].getContentSize().height,f=0|(f>=k||null==k?f:k),++g,g>=h&&(d+=f+5,f=g=0,++e)):cc.log("cc.MenuPassive.alignItemsInColumns(): can not have zero columns on a row"));var m=cc.director.getWinSize(),n=h=f=e=0,p=0,d=d/2;if(this._children&&0=k||null==k?f:k),this._children[c].setPosition(p-m.width/2,d-this._children[c].getContentSize().height/2),p+=n,++g,g>=h&&(d-=f+5,f=h=g=0,++e))},alignItemsInRows:function(a){var b=[],c;for(c=1;c=b.length?cc.log("cc.MenuPassive.alignItemsInRows(): invalid row index"):(n=b[h])?(p=this._children[c].getContentSize().width, k=0|(k>=p||null==p?k:p),g+=0|this._children[c].getContentSize().height+5,++m,m>=n&&(d.push(k),e.push(g),f+=k+10,k=m=0,g=-5,++h)):cc.log("cc.MenuPassive.alignItemsInColumns(): can't have zero rows on a column"));g=cc.director.getWinSize();k=h=0;n=null;var f=-f/2,r=0;if(this._children&&0=p||null==p?k:p),this._children[c].setPosition(f+d[h]/2,r-g.height/ 2),r-=this._children[c].getContentSize().height+10,++m,m>=n&&(f+=k+5,k=n=m=0,++h))},setOpacityModifyRGB:function(a){},isOpacityModifyRGB:function(){return!1}});cc.MenuPassive.create=function(a){a||(a=null);for(var b=[],c=1;ce&&(a.x=b+e*Math.cos(d),a.y=c+e*Math.sin(d));this._slider.setPosition(a);a.xthis._startPos.x+this._boxPos+this._boxSize-1&&(a.x=this._startPos.x+this._boxPos+this._boxSize-1);a.ythis._startPos.y+this._boxPos+this._boxSize&&(a.y=this._startPos.y+this._boxPos+this._boxSize);this._saturation=1-Math.abs((this._startPos.x+this._boxPos-a.x)/this._boxSize);this._brightness=Math.abs((this._startPos.y+this._boxPos-a.y)/this._boxSize)},_checkSliderPosition:function(a){var b=this._startPos.x+ 0.5*this._background.getBoundingBox().width,c=this._startPos.y+0.5*this._background.getBoundingBox().height,b=a.x-b,c=a.y-c;return Math.sqrt(b*b+c*c)<=0.5*this._background.getBoundingBox().width?(this._updateSliderPosition(a),this.sendActionsForControlEvents(cc.CONTROL_EVENT_VALUECHANGED),!0):!1},onTouchBegan:function(a,b){if(!this.isEnabled()||!this.isVisible())return!1;var c=this.getTouchLocation(a);return this._checkSliderPosition(c)},onTouchMoved:function(a,b){var c=this.getTouchLocation(a);this._checkSliderPosition(c)}}); _p=cc.ControlSaturationBrightnessPicker.prototype;cc.defineGetterSetter(_p,"saturation",_p.getSaturation);cc.defineGetterSetter(_p,"brightness",_p.getBrightness);cc.defineGetterSetter(_p,"background",_p.getBackground);cc.defineGetterSetter(_p,"overlay",_p.getOverlay);cc.defineGetterSetter(_p,"shadow",_p.getShadow);cc.defineGetterSetter(_p,"slider",_p.getSlider);cc.defineGetterSetter(_p,"startPos",_p.getStartPos);_p=null; cc.ControlSaturationBrightnessPicker.create=function(a,b){return new cc.ControlSaturationBrightnessPicker(a,b)};cc.ControlHuePicker=cc.Control.extend({_hue:0,_huePercentage:0,_background:null,_slider:null,_startPos:null,_className:"ControlHuePicker",ctor:function(a,b){cc.Control.prototype.ctor.call(this);b&&this.initWithTargetAndPos(a,b)},getHue:function(){return this._hue},setHue:function(a){this._hue=a;this.setHuePercentage(this._hue/360)},getHuePercentage:function(){return this._huePercentage},setHuePercentage:function(a){this._huePercentage=a;this._hue=360*this._huePercentage;var b=this._background.getBoundingBox(), c=this._startPos.x+0.5*b.width;a=this._startPos.y+0.5*b.height;var b=0.5*b.width-15,d=cc.degreesToRadians(360*this._huePercentage-180),c=c+b*Math.cos(d);a+=b*Math.sin(d);this._slider.setPosition(c,a)},setEnabled:function(a){cc.Control.prototype.setEnabled.call(this,a);this._slider&&this._slider.setOpacity(a?255:128)},getBackground:function(){return this._background},getSlider:function(){return this._slider},getStartPos:function(){return this._startPos},initWithTargetAndPos:function(a,b){return cc.Control.prototype.init.call(this)? (this._background=cc.ControlUtils.addSpriteToTargetWithPosAndAnchor("huePickerBackground.png",a,b,cc.p(0,0)),this._slider=cc.ControlUtils.addSpriteToTargetWithPosAndAnchor("colourPicker.png",a,b,cc.p(0.5,0.5)),this._slider.setPosition(b.x,b.y+0.5*this._background.getBoundingBox().height),this._startPos=b,this._huePercentage=this._hue=0,!0):!1},_updateSliderPosition:function(a){var b=this._background.getBoundingBox();a=Math.atan2(a.y-(this._startPos.y+0.5*b.height),a.x-(this._startPos.x+0.5*b.width)); a=cc.radiansToDegrees(a)+180;this.setHue(a);this.sendActionsForControlEvents(cc.CONTROL_EVENT_VALUECHANGED)},_checkSliderPosition:function(a){var b=Math.sqrt(Math.pow(a.x+10,2)+Math.pow(a.y,2));return 80>b&&59=this._maximumValue&&(this._maximumValue=this._minimumValue+1);this.setValue(this._value)},getMaximumValue:function(){return this._maximumValue},setMaximumValue:function(a){this._maximumAllowedValue=this._maximumValue=a;this._maximumValue<=this._minimumValue&&(this._minimumValue= this._maximumValue-1);this.setValue(this._value)},isTouchInside:function(a){a=a.getLocation();a=this.getParent().convertToNodeSpace(a);var b=this.getBoundingBox();b.width+=this._thumbSprite.getContentSize().width;b.x-=this._thumbSprite.getContentSize().width/2;return cc.rectContainsPoint(b,a)},locationFromTouch:function(a){a=a.getLocation();a=this.convertToNodeSpace(a);0>a.x?a.x=0:a.x>this._backgroundSprite.getContentSize().width&&(a.x=this._backgroundSprite.getContentSize().width);return a},getMinimumAllowedValue:function(){return this._minimumAllowedValue}, setMinimumAllowedValue:function(a){this._minimumAllowedValue=a},getMaximumAllowedValue:function(){return this._maximumAllowedValue},setMaximumAllowedValue:function(a){this._maximumAllowedValue=a},getThumbSprite:function(){return this._thumbSprite},getProgressSprite:function(){return this._progressSprite},getBackgroundSprite:function(){return this._backgroundSprite},initWithSprites:function(a,b,c){return cc.Control.prototype.init.call(this)?(this.ignoreAnchorPointForPosition(!1),this._backgroundSprite= a,this._progressSprite=b,this._thumbSprite=c,a=cc.ControlUtils.CCRectUnion(a.getBoundingBox(),c.getBoundingBox()),this.setContentSize(a.width,a.height),this._backgroundSprite.setAnchorPoint(0.5,0.5),this._backgroundSprite.setPosition(a.width/2,a.height/2),this.addChild(this._backgroundSprite),this._progressSprite.setAnchorPoint(0,0.5),this._progressSprite.setPosition(0,a.height/2),this.addChild(this._progressSprite),this._thumbSprite.setPosition(0,a.height/2),this.addChild(this._thumbSprite),this._minimumValue= 0,this._maximumValue=1,this.setValue(this._minimumValue),!0):!1},setEnabled:function(a){cc.Control.prototype.setEnabled.call(this,a);this._thumbSprite&&this._thumbSprite.setOpacity(a?255:128)},sliderBegan:function(a){this.setSelected(!0);this._thumbSprite.setColor(cc.color.GRAY);this.setValue(this.valueForLocation(a))},sliderMoved:function(a){this.setValue(this.valueForLocation(a))},sliderEnded:function(a){this.isSelected()&&this.setValue(this.valueForLocation(this._thumbSprite.getPosition()));this._thumbSprite.setColor(cc.color.WHITE); this.setSelected(!1)},getTouchLocationInControl:function(a){a=a.getLocation();a=this.convertToNodeSpace(a);0>a.x?a.x=0:a.x>this._backgroundSprite.getContentSize().width+cc.SLIDER_MARGIN_H&&(a.x=this._backgroundSprite.getContentSize().width+cc.SLIDER_MARGIN_H);return a},onTouchBegan:function(a,b){if(!this.isTouchInside(a)||!this.isEnabled()||!this.isVisible())return!1;var c=this.locationFromTouch(a);this.sliderBegan(c);return!0},onTouchMoved:function(a,b){var c=this.locationFromTouch(a);this.sliderMoved(c)}, onTouchEnded:function(a,b){this.sliderEnded(cc.p(0,0))},needsLayout:function(){this._thumbSprite.setPositionX((this._value-this._minimumValue)/(this._maximumValue-this._minimumValue)*this._backgroundSprite.getContentSize().width);var a=this._progressSprite.getTextureRect(),a=cc.rect(a.x,a.y,this._thumbSprite.getPositionX(),a.height);this._progressSprite.setTextureRect(a,this._progressSprite.isTextureRectRotated());this._thumbSprite._renderCmd.transform(this._renderCmd)},valueForLocation:function(a){a= a.x/this._backgroundSprite.getContentSize().width;return Math.max(Math.min(this._minimumValue+a*(this._maximumValue-this._minimumValue),this._maximumAllowedValue),this._minimumAllowedValue)}});_p=cc.ControlSlider.prototype;cc.defineGetterSetter(_p,"value",_p.getValue,_p.setValue);cc.defineGetterSetter(_p,"minValue",_p.getMinimumValue,_p.setMinimumValue);cc.defineGetterSetter(_p,"maxValue",_p.getMaximumValue,_p.setMaximumValue);cc.defineGetterSetter(_p,"minAllowedValue",_p.getMinimumAllowedValue,_p.setMinimumAllowedValue); cc.defineGetterSetter(_p,"maxAllowedValue",_p.getMaximumAllowedValue,_p.setMaximumAllowedValue);cc.defineGetterSetter(_p,"thumbSprite",_p.getThumbSprite);cc.defineGetterSetter(_p,"progressSprite",_p.getProgressSprite);cc.defineGetterSetter(_p,"backgroundSprite",_p.getBackgroundSprite);_p=null;cc.ControlSlider.create=function(a,b,c){return new cc.ControlSlider(a,b,c)};cc.ControlSwitch=cc.Control.extend({_switchSprite:null,_initialTouchXPosition:0,_moved:!1,_on:!1,_className:"ControlSwitch",ctor:function(a,b,c,d,e,f){cc.Control.prototype.ctor.call(this);f&&this.initWithMaskSprite(a,b,c,d,e,f)},initWithMaskSprite:function(a,b,c,d,e,f){if(!a)throw Error("cc.ControlSwitch.initWithMaskSprite(): maskSprite should be non-null.");if(!b)throw Error("cc.ControlSwitch.initWithMaskSprite(): onSprite should be non-null.");if(!c)throw Error("cc.ControlSwitch.initWithMaskSprite(): offSprite should be non-null."); if(!d)throw Error("cc.ControlSwitch.initWithMaskSprite(): thumbSprite should be non-null.");return this.init()?(this._on=!0,this._switchSprite=new cc.ControlSwitchSprite,this._switchSprite.initWithMaskSprite(a,b,c,d,e,f),this._switchSprite.setPosition(this._switchSprite.getContentSize().width/2,this._switchSprite.getContentSize().height/2),this.addChild(this._switchSprite),this.ignoreAnchorPointForPosition(!1),this.setAnchorPoint(0.5,0.5),this.setContentSize(this._switchSprite.getContentSize()),!0): !1},setOn:function(a,b){b=b||!1;var c=(this._on=a)?this._switchSprite.getOnPosition():this._switchSprite.getOffPosition();b?this._switchSprite.runAction(new cc.ActionTween(0.2,"sliderXPosition",this._switchSprite.getSliderXPosition(),c)):this._switchSprite.setSliderXPosition(c);this.sendActionsForControlEvents(cc.CONTROL_EVENT_VALUECHANGED)},isOn:function(){return this._on},hasMoved:function(){return this._moved},setEnabled:function(a){this._enabled=a;this._switchSprite.setOpacity(a?255:128)},locationFromTouch:function(a){a= a.getLocation();return a=this.convertToNodeSpace(a)},onTouchBegan:function(a,b){if(!this.isTouchInside(a)||!this.isEnabled()||!this.isVisible())return!1;this._moved=!1;this._initialTouchXPosition=this.locationFromTouch(a).x-this._switchSprite.getSliderXPosition();this._switchSprite.getThumbSprite().setColor(cc.color.GRAY);this._switchSprite.needsLayout();return!0},onTouchMoved:function(a,b){var c=this.locationFromTouch(a),c=cc.p(c.x-this._initialTouchXPosition,0);this._moved=!0;this._switchSprite.setSliderXPosition(c.x)}, onTouchEnded:function(a,b){var c=this.locationFromTouch(a);this._switchSprite.getThumbSprite().setColor(cc.color.WHITE);this.hasMoved()?this.setOn(!(c.x=this._onPosition&&(a=this._onPosition);this._sliderXPosition=a;this.needsLayout()},getSliderXPosition:function(){return this._sliderXPosition},_getOnSideWidth:function(){return this._onSprite.getContentSize().width},_getOffSideWidth:function(){return this._offSprite.getContentSize().height},updateTweenAction:function(a,b){"sliderXPosition"===b&&this.setSliderXPosition(a)},setOnPosition:function(a){this._onPosition= a},getOnPosition:function(){return this._onPosition},setOffPosition:function(a){this._offPosition=a},getOffPosition:function(){return this._offPosition},setMaskTexture:function(a){this._stencil.setTexture(a)},getMaskTexture:function(){return this._stencil.getTexture()},setTextureLocation:function(a){this._textureLocation=a},getTextureLocation:function(){return this._textureLocation},setMaskLocation:function(a){this._maskLocation=a},getMaskLocation:function(){return this._maskLocation},setOnSprite:function(a){this._onSprite= a},getOnSprite:function(){return this._onSprite},setOffSprite:function(a){this._offSprite=a},getOffSprite:function(){return this._offSprite},setThumbSprite:function(a){this._thumbSprite=a},getThumbSprite:function(){return this._thumbSprite},setOnLabel:function(a){this._onLabel=a},getOnLabel:function(){return this._onLabel},setOffLabel:function(a){this._offLabel=a},getOffLabel:function(){return this._offLabel}});_p=cc.ControlSwitchSprite.prototype; cc.defineGetterSetter(_p,"sliderX",_p.getSliderXPosition,_p.setSliderXPosition);cc.defineGetterSetter(_p,"onPos",_p.getOnPosition,_p.setOnPosition);cc.defineGetterSetter(_p,"offPos",_p.getOffPosition,_p.setOffPosition);cc.defineGetterSetter(_p,"maskTexture",_p.getMaskTexture,_p.setMaskTexture);cc.defineGetterSetter(_p,"maskPos",_p.getMaskLocation,_p.setMaskLocation);cc.defineGetterSetter(_p,"onSprite",_p.getOnSprite,_p.setOnSprite);cc.defineGetterSetter(_p,"offSprite",_p.getOffSprite,_p.setOffSprite); cc.defineGetterSetter(_p,"thumbSprite",_p.getThumbSprite,_p.setThumbSprite);cc.defineGetterSetter(_p,"onLabel",_p.getOnLabel,_p.setOnLabel);cc.defineGetterSetter(_p,"offLabel",_p.getOffLabel,_p.setOffLabel);cc.defineGetterSetter(_p,"onSideWidth",_p._getOnSideWidth);cc.defineGetterSetter(_p,"offSideWidth",_p._getOffSideWidth);_p=null;cc.CONTROL_STEPPER_PARTMINUS=0;cc.CONTROL_STEPPER_PARTPLUS=1;cc.CONTROL_STEPPER_PARTNONE=2;cc.CONTROL_STEPPER_LABELCOLOR_ENABLED=cc.color(55,55,55);cc.CONTROL_STEPPER_LABELCOLOR_DISABLED=cc.color(147,147,147);cc.CONTROL_STEPPER_LABELFONT="CourierNewPSMT";cc.AUTOREPEAT_DELTATIME=0.15;cc.AUTOREPEAT_INCREASETIME_INCREMENT=12; cc.ControlStepper=cc.Control.extend({_minusSprite:null,_plusSprite:null,_minusLabel:null,_plusLabel:null,_value:0,_continuous:!1,_autorepeat:!1,_wraps:!1,_minimumValue:0,_maximumValue:0,_stepValue:0,_touchInsideFlag:!1,_touchedPart:cc.CONTROL_STEPPER_PARTNONE,_autorepeatCount:0,_className:"ControlStepper",ctor:function(a,b){cc.Control.prototype.ctor.call(this);this._plusLabel=this._minusLabel=this._plusSprite=this._minusSprite=null;this._value=0;this._wraps=this._autorepeat=this._continuous=!1;this._stepValue= this._maximumValue=this._minimumValue=0;this._touchInsideFlag=!1;this._touchedPart=cc.CONTROL_STEPPER_PARTNONE;this._autorepeatCount=0;b&&this.initWithMinusSpriteAndPlusSprite(a,b)},initWithMinusSpriteAndPlusSprite:function(a,b){if(!a)throw Error("cc.ControlStepper.initWithMinusSpriteAndPlusSprite(): Minus sprite should be non-null.");if(!b)throw Error("cc.ControlStepper.initWithMinusSpriteAndPlusSprite(): Plus sprite should be non-null.");if(this.init()){this._continuous=this._autorepeat=!0;this._minimumValue= 0;this._maximumValue=100;this._value=0;this._stepValue=1;this._wraps=!1;this.ignoreAnchorPointForPosition(!1);this.setMinusSprite(a);this._minusSprite.setPosition(a.getContentSize().width/2,a.getContentSize().height/2);this.addChild(this._minusSprite);this.setMinusLabel(new cc.LabelTTF("-",cc.CONTROL_STEPPER_LABELFONT,40,cc.size(40,40),cc.TEXT_ALIGNMENT_CENTER,cc.VERTICAL_TEXT_ALIGNMENT_CENTER));this._minusLabel.setColor(cc.CONTROL_STEPPER_LABELCOLOR_DISABLED);this._minusLabel.setPosition(this._minusSprite.getContentSize().width/ 2,this._minusSprite.getContentSize().height/2);this._minusSprite.addChild(this._minusLabel);this.setPlusSprite(b);this._plusSprite.setPosition(a.getContentSize().width+b.getContentSize().width/2,a.getContentSize().height/2);this.addChild(this._plusSprite);this.setPlusLabel(new cc.LabelTTF("+",cc.CONTROL_STEPPER_LABELFONT,40,cc.size(40,40),cc.TEXT_ALIGNMENT_CENTER,cc.VERTICAL_TEXT_ALIGNMENT_CENTER));this._plusLabel.setColor(cc.CONTROL_STEPPER_LABELCOLOR_ENABLED);this._plusLabel.setPosition(this._plusSprite.getContentSize().width/ 2,this._plusSprite.getContentSize().height/2);this._plusSprite.addChild(this._plusLabel);var c=cc.ControlUtils.CCRectUnion(this._minusSprite.getBoundingBox(),this._plusSprite.getBoundingBox());this.setContentSize(this._minusSprite.getContentSize().width+this._plusSprite.getContentSize().height,c.height);return!0}return!1},setWraps:function(a){if(this._wraps=a)this._minusLabel.setColor(cc.CONTROL_STEPPER_LABELCOLOR_ENABLED),this._plusLabel.setColor(cc.CONTROL_STEPPER_LABELCOLOR_ENABLED);this.setValue(this._value)}, getWraps:function(){return this._wraps},setMinimumValue:function(a){if(a>=this._maximumValue)throw Error("cc.ControlStepper.setMinimumValue(): minimumValue should be numerically less than maximumValue.");this._minimumValue=a;this.setValue(this._value)},getMinimumValue:function(){return this._minimumValue},setMaximumValue:function(a){if(a<=this._minimumValue)throw Error("cc.ControlStepper.setMaximumValue(): maximumValue should be numerically less than maximumValue.");this._maximumValue=a;this.setValue(this._value)}, getMaximumValue:function(){return this._maximumValue},setValue:function(a){this.setValueWithSendingEvent(a,!0)},getValue:function(){return this._value},setStepValue:function(a){if(0>=a)throw Error("cc.ControlStepper.setMaximumValue(): stepValue should be numerically greater than 0.");this._stepValue=a},getStepValue:function(){return this._stepValue},isContinuous:function(){return this._continuous},setValueWithSendingEvent:function(a,b){athis._maximumValue&&(a=this._wraps?this._minimumValue:this._maximumValue);this._value=a;this._wraps||(this._minusLabel.setColor(a===this._minimumValue?cc.CONTROL_STEPPER_LABELCOLOR_DISABLED:cc.CONTROL_STEPPER_LABELCOLOR_ENABLED),this._plusLabel.setColor(a===this._maximumValue?cc.CONTROL_STEPPER_LABELCOLOR_DISABLED:cc.CONTROL_STEPPER_LABELCOLOR_ENABLED));b&&this.sendActionsForControlEvents(cc.CONTROL_EVENT_VALUECHANGED)},startAutorepeat:function(){this._autorepeatCount=-1;this.schedule(this.update, cc.AUTOREPEAT_DELTATIME,cc.REPEAT_FOREVER,3*cc.AUTOREPEAT_DELTATIME)},stopAutorepeat:function(){this.unschedule(this.update)},update:function(a){this._autorepeatCount++;this._autorepeatCountthis._minimumValue?(this._touchedPart=cc.CONTROL_STEPPER_PARTMINUS,this._minusSprite.setColor(cc.color.GRAY),this._plusSprite.setColor(cc.color.WHITE)):a.x>=this._minusSprite.getContentSize().width&&this._valuethis._maximumValue&&(a=this._maximumValue);this._value=a;a=(a-this._minimumValue)/(this._maximumValue- this._minimumValue);this._progressTimer.setPercentage(100*a);this._thumbSprite.setRotation(360*a);this.sendActionsForControlEvents(cc.CONTROL_EVENT_VALUECHANGED)},getValue:function(){return this._value},setMinimumValue:function(a){this._minimumValue=a;this._minimumValue>=this._maximumValue&&(this._maximumValue=this._minimumValue+1);this.setValue(this._maximumValue)},getMinimumValue:function(){return this._minimumValue},setMaximumValue:function(a){this._maximumValue=a;this._maximumValue<=this._minimumValue&& (this._minimumValue=this._maximumValue-1);this.setValue(this._minimumValue)},getMaximumValue:function(){return this._maximumValue},isTouchInside:function(a){a=this.getTouchLocation(a);return this.distanceBetweenPointAndPoint(this._progressTimer.getPosition(),a)b&&(b+=360);this.setValue(this._value+b/360*(this._maximumValue-this._minimumValue));this._previousLocation=a},potentiometerEnded:function(a){this.getThumbSprite().setColor(cc.color.WHITE);this.setSelected(!1)},setThumbSprite:function(a){this._thumbSprite=a},getThumbSprite:function(){return this._thumbSprite}, setProgressTimer:function(a){this._progressTimer=a},getProgressTimer:function(){return this._progressTimer},setPreviousLocation:function(a){this._previousLocation=a},getPreviousLocation:function(){return this._previousLocation}});_p=cc.ControlPotentiometer.prototype;cc.defineGetterSetter(_p,"value",_p.getValue,_p.setValue);cc.defineGetterSetter(_p,"minValue",_p.getMinimumValue,_p.setMinimumValue);cc.defineGetterSetter(_p,"maxValue",_p.getMaximumValue,_p.setMaximumValue); cc.defineGetterSetter(_p,"progressTimer",_p.getProgressTimer,_p.setProgressTimer);cc.defineGetterSetter(_p,"thumbSprite",_p.getThumbSprite,_p.setThumbSprite);cc.defineGetterSetter(_p,"prevLocation",_p.getPreviousLocation,_p.setPreviousLocation);_p=null;cc.ControlPotentiometer.create=function(a,b,c){return new cc.ControlPotentiometer(a,b,c)};cc.SCROLLVIEW_DIRECTION_NONE=-1;cc.SCROLLVIEW_DIRECTION_HORIZONTAL=0;cc.SCROLLVIEW_DIRECTION_VERTICAL=1;cc.SCROLLVIEW_DIRECTION_BOTH=2;var SCROLL_DEACCEL_RATE=0.95,SCROLL_DEACCEL_DIST=1,BOUNCE_DURATION=0.15,INSET_RATIO=0.2,MOVE_INCH=0.04375,BOUNCE_BACK_FACTOR=0.35;cc.convertDistanceFromPointToInch=function(a){var b=cc.view,b=(b.getScaleX()+b.getScaleY())/2;return a*b/160};cc.ScrollViewDelegate=cc.Class.extend({scrollViewDidScroll:function(a){},scrollViewDidZoom:function(a){}}); cc.ScrollView=cc.Layer.extend({_zoomScale:0,_minZoomScale:0,_maxZoomScale:0,_delegate:null,_direction:cc.SCROLLVIEW_DIRECTION_BOTH,_dragging:!1,_contentOffset:null,_container:null,_touchMoved:!1,_maxInset:null,_minInset:null,_bounceable:!1,_clippingToBounds:!1,_scrollDistance:null,_touchPoint:null,_touchLength:0,_touches:null,_viewSize:null,_minScale:0,_maxScale:0,_parentScissorRect:null,_scissorRestored:!1,_tmpViewRect:null,_touchListener:null,_className:"ScrollView",ctor:function(a,b){cc.Layer.prototype.ctor.call(this); this._contentOffset=cc.p(0,0);this._maxInset=cc.p(0,0);this._minInset=cc.p(0,0);this._scrollDistance=cc.p(0,0);this._touchPoint=cc.p(0,0);this._touches=[];this._viewSize=cc.size(0,0);this._parentScissorRect=new cc.Rect(0,0,0,0);this._tmpViewRect=new cc.Rect(0,0,0,0);void 0!=b?this.initWithViewSize(a,b):this.initWithViewSize(cc.size(200,200),null)},init:function(){return this.initWithViewSize(cc.size(200,200),null)},initWithViewSize:function(a,b){var c=cc.p(0,0);return cc.Layer.prototype.init.call(this)? (b||this._container||(b=new cc.Layer),b&&this.setContainer(b),this.setViewSize(a),this.setTouchEnabled(!0),this._touches.length=0,this._delegate=null,this._clippingToBounds=this._bounceable=!0,this._direction=cc.SCROLLVIEW_DIRECTION_BOTH,this._container.setPosition(c),this._touchLength=0,this._minScale=this._maxScale=1,!0):!1},visit:function(a){if(this._visible){var b=cc.renderer,c=this._renderCmd;c.visit(a&&a._renderCmd);this._clippingToBounds&&b.pushRenderCommand(c.startCmd);var d=this._children, e=d.length;if(0b.y||eb.x||dc&&(a.x+=b.width*c,c=-c);0>d&&(a.y+=b.height*d,d=-d);e=this._tmpViewRect;e.x=a.x;e.y=a.y;e.width=b.width*c;e.height=b.height*d;return e},_createRenderCmd:function(){return cc._renderType===cc.game.RENDER_TYPE_CANVAS?new cc.ScrollView.CanvasRenderCmd(this):new cc.ScrollView.WebGLRenderCmd(this)}});_p=cc.ScrollView.prototype;cc.defineGetterSetter(_p,"minOffset",_p.minContainerOffset);cc.defineGetterSetter(_p,"maxOffset",_p.maxContainerOffset); cc.defineGetterSetter(_p,"bounceable",_p.isBounceable,_p.setBounceable);cc.defineGetterSetter(_p,"viewSize",_p.getViewSize,_p.setViewSize);cc.defineGetterSetter(_p,"container",_p.getContainer,_p.setContainer);cc.defineGetterSetter(_p,"direction",_p.getDirection,_p.setDirection);cc.defineGetterSetter(_p,"delegate",_p.getDelegate,_p.setDelegate);cc.defineGetterSetter(_p,"clippingToBounds",_p.isClippingToBounds,_p.setClippingToBounds);_p=null; cc.ScrollView.create=function(a,b){return new cc.ScrollView(a,b)};(function(){cc.ScrollView.CanvasRenderCmd=function(a){this._layerCmdCtor(a);this._needDraw=!1;this.startCmd=new cc.CustomRenderCmd(this,this._startCmd);this.startCmd._canUseDirtyRegion=!0;this.endCmd=new cc.CustomRenderCmd(this,this._endCmd);this.endCmd._canUseDirtyRegion=!0};var a=cc.ScrollView.CanvasRenderCmd.prototype=Object.create(cc.Layer.CanvasRenderCmd.prototype);a.constructor=cc.ScrollView.CanvasRenderCmd;a._startCmd=function(a,c,d){var e=this._node,f=a||cc._renderContext;a=f.getContext(); f.save();e._clippingToBounds&&(this._scissorRestored=!1,f.setTransform(this._worldTransform,c,d),d=e.getScaleX(),c=e.getScaleY(),d*=e._viewSize.width,e=e._viewSize.height*c,a.beginPath(),a.rect(0,0,d,-e),a.closePath(),a.clip())};a._endCmd=function(a){a=a||cc._renderContext;a.restore()}})();(function(){cc.ScrollView.WebGLRenderCmd=function(a){this._layerCmdCtor(a);this._needDraw=!1;this.startCmd=new cc.CustomRenderCmd(this,this._startCmd);this.endCmd=new cc.CustomRenderCmd(this,this._endCmd)};var a=cc.ScrollView.WebGLRenderCmd.prototype=Object.create(cc.Layer.WebGLRenderCmd.prototype);a.constructor=cc.ScrollView.WebGLRenderCmd;a._startCmd=function(){var a=this._node,c=cc.view,d=a._getViewRect();if(c.isScissorEnabled()){if(a._scissorRestored=!0,a._parentScissorRect=c.getScissorRect(), cc.rectIntersection(d,a._parentScissorRect)){var e=a._parentScissorRect,a=Math.max(d.x,e.x),f=Math.max(d.y,e.y),g=Math.min(d.x+d.width,e.x+e.width),d=Math.min(d.y+d.height,e.y+e.height);c.setScissorInPoints(a,f,g-a,d-f)}}else a=cc._renderContext,a.enable(a.SCISSOR_TEST),c.setScissorInPoints(d.x,d.y,d.width,d.height)};a._endCmd=function(){var a=this._node;a._scissorRestored?(a=a._parentScissorRect,cc.view.setScissorInPoints(a.x,a.y,a.width,a.height)):(a=cc._renderContext,a.disable(a.SCISSOR_TEST))}})();cc.SortableObject=cc.Class.extend({setObjectID:function(a){},getObjectID:function(){return 0}});cc.SortedObject=cc.SortableObject.extend({_objectID:0,ctor:function(){this._objectID=0},setObjectID:function(a){this._objectID=a},getObjectID:function(){return this._objectID}});var _compareObject=function(a,b){return a.getObjectID()-b.getObjectID()}; cc.ArrayForObjectSorting=cc.Class.extend({_saveObjectArr:null,ctor:function(){this._saveObjectArr=[]},insertSortedObject:function(a){if(!a)throw Error("cc.ArrayForObjectSorting.insertSortedObject(): addObject should be non-null.");var b=this.indexOfSortedObject(a);this.insertObject(a,b)},removeSortedObject:function(a){if(0!==this.count()){var b=this.indexOfSortedObject(a);b=c&&a=b;){var e=0|b+(c-b)/2,f=d[e],g=d[e+1];if(a>=f&&a<=g)return e;a=b?0:-1},_indexFromOffset:function(a){var b={x:a.x,y:a.y};a=this._dataSource.numberOfCellsInTableView(this)-1;this._vOrdering===cc.TABLEVIEW_FILL_TOPDOWN&&(b.y=this.getContainer().getContentSize().height-b.y);b=this.__indexFromOffset(b);-1!==b&&(b=Math.max(0,b),b>a&&(b=cc.INVALID_INDEX)); return b},__offsetFromIndex:function(a){switch(this.getDirection()){case cc.SCROLLVIEW_DIRECTION_HORIZONTAL:a=cc.p(this._cellsPositions[a],0);break;default:a=cc.p(0,this._cellsPositions[a])}return a},_offsetFromIndex:function(a){var b=this.__offsetFromIndex(a);a=this._dataSource.tableCellSizeForIndex(this,a);this._vOrdering===cc.TABLEVIEW_FILL_TOPDOWN&&(b.y=this.getContainer().getContentSize().height-b.y-a.height);return b},_updateCellPositions:function(){var a=this._dataSource.numberOfCellsInTableView(this), b=this._cellsPositions;if(0this._dataSource.numberOfCellsInTableView(this)-1)){var b=this.cellAtIndex(a);b&&this._moveCellOutOfSight(b);b=this._dataSource.tableCellAtIndex(this,a);this._setIndexForCell(a,b);this._addCellIfNecessary(b)}},insertCellAtIndex:function(a){if(!(a===cc.INVALID_INDEX||a>this._dataSource.numberOfCellsInTableView(this)- 1)){var b,c=this._cellsUsed;if(b=c.objectWithObjectID(a))for(var d=b=c.indexOfSortedObject(b);dthis._dataSource.numberOfCellsInTableView(this)-1)){var b=this.cellAtIndex(a);if(b){var c=this._cellsUsed,d=c.indexOfSortedObject(b); this._moveCellOutOfSight(b);cc.arrayRemoveObject(this._indices,a);this._updateCellPositions();for(a=c.count()-1;a>d;a--)b=c.objectAtIndex(a),this._setIndexForCell(b.getIdx()-1,b)}}},reloadData:function(){this._oldDirection=cc.SCROLLVIEW_DIRECTION_NONE;for(var a=this._cellsUsed,b=this._cellsFreed,c=this.getContainer(),d=0,e=a.count();dd;)if(this._moveCellOutOfSight(b),0=d,h=c.readInt(!1),k=c.readCachedString(),m=!1,n=c._data[c._currentByte++]; if(n===CCB_PLATFORM_ALL||n===CCB_PLATFORM_IOS||n===CCB_PLATFORM_MAC)m=!0;g&&(a.ccbFileNode?(a=a.ccbFileNode,m=-1!==a.userObject.indexOf(k)):a===c._animationManager.getRootNode()&&(g=a.userObject,g||(g=[],a.userObject=g),g.push(k)));switch(h){case CCB_PROPTYPE_POSITION:h=this.parsePropTypePosition(a,b,c,k);if(m)this.onHandlePropTypePosition(a,b,k,h,c);break;case CCB_PROPTYPE_POINT:h=this.parsePropTypePoint(a,b,c);if(m)this.onHandlePropTypePoint(a,b,k,h,c);break;case CCB_PROPTYPE_POINTLOCK:h=this.parsePropTypePointLock(a, b,c);if(m)this.onHandlePropTypePointLock(a,b,k,h,c);break;case CCB_PROPTYPE_SIZE:h=this.parsePropTypeSize(a,b,c);if(m)this.onHandlePropTypeSize(a,b,k,h,c);break;case CCB_PROPTYPE_SCALELOCK:h=this.parsePropTypeScaleLock(a,b,c,k);if(m)this.onHandlePropTypeScaleLock(a,b,k,h,c);break;case CCB_PROPTYPE_FLOATXY:h=this.parsePropTypeFloatXY(a,b,c);if(m)this.onHandlePropTypeFloatXY(a,b,k,h,c);break;case CCB_PROPTYPE_FLOAT:h=this.parsePropTypeFloat(a,b,c);if(m)this.onHandlePropTypeFloat(a,b,k,h,c);break;case CCB_PROPTYPE_DEGREES:h= this.parsePropTypeDegrees(a,b,c,k);if(m)this.onHandlePropTypeDegrees(a,b,k,h,c);break;case CCB_PROPTYPE_FLOATSCALE:h=this.parsePropTypeFloatScale(a,b,c);if(m)this.onHandlePropTypeFloatScale(a,b,k,h,c);break;case CCB_PROPTYPE_INTEGER:h=this.parsePropTypeInteger(a,b,c);if(m)this.onHandlePropTypeInteger(a,b,k,h,c);break;case CCB_PROPTYPE_INTEGERLABELED:h=this.parsePropTypeIntegerLabeled(a,b,c);if(m)this.onHandlePropTypeIntegerLabeled(a,b,k,h,c);break;case CCB_PROPTYPE_FLOATVAR:h=this.parsePropTypeFloatVar(a, b,c);if(m)this.onHandlePropTypeFloatVar(a,b,k,h,c);break;case CCB_PROPTYPE_CHECK:h=this.parsePropTypeCheck(a,b,c,k);if(m)this.onHandlePropTypeCheck(a,b,k,h,c);break;case CCB_PROPTYPE_SPRITEFRAME:h=this.parsePropTypeSpriteFrame(a,b,c,k);if(m)this.onHandlePropTypeSpriteFrame(a,b,k,h,c);break;case CCB_PROPTYPE_ANIMATION:h=this.parsePropTypeAnimation(a,b,c);if(m)this.onHandlePropTypeAnimation(a,b,k,h,c);break;case CCB_PROPTYPE_TEXTURE:h=this.parsePropTypeTexture(a,b,c);if(m)this.onHandlePropTypeTexture(a, b,k,h,c);break;case CCB_PROPTYPE_BYTE:h=this.parsePropTypeByte(a,b,c,k);if(m)this.onHandlePropTypeByte(a,b,k,h,c);break;case CCB_PROPTYPE_COLOR3:h=this.parsePropTypeColor3(a,b,c,k);if(m)this.onHandlePropTypeColor3(a,b,k,h,c);break;case CCB_PROPTYPE_COLOR4VAR:h=this.parsePropTypeColor4FVar(a,b,c);if(m)this.onHandlePropTypeColor4FVar(a,b,k,h,c);break;case CCB_PROPTYPE_FLIP:h=this.parsePropTypeFlip(a,b,c);if(m)this.onHandlePropTypeFlip(a,b,k,h,c);break;case CCB_PROPTYPE_BLENDMODE:h=this.parsePropTypeBlendFunc(a, b,c);if(m)this.onHandlePropTypeBlendFunc(a,b,k,h,c);break;case CCB_PROPTYPE_FNTFILE:h=c.getCCBRootPath()+this.parsePropTypeFntFile(a,b,c);if(m)this.onHandlePropTypeFntFile(a,b,k,h,c);break;case CCB_PROPTYPE_FONTTTF:h=this.parsePropTypeFontTTF(a,b,c);if(m)this.onHandlePropTypeFontTTF(a,b,k,h,c);break;case CCB_PROPTYPE_STRING:h=this.parsePropTypeString(a,b,c);if(m)this.onHandlePropTypeString(a,b,k,h,c);break;case CCB_PROPTYPE_TEXT:h=this.parsePropTypeText(a,b,c);if(m)this.onHandlePropTypeText(a,b,k, h,c);break;case CCB_PROPTYPE_BLOCK:h=this.parsePropTypeBlock(a,b,c);if(m)this.onHandlePropTypeBlock(a,b,k,h,c);break;case CCB_PROPTYPE_BLOCKCCCONTROL:h=this.parsePropTypeBlockCCControl(a,b,c);if(m&&null!=h)this.onHandlePropTypeBlockCCControl(a,b,k,h,c);break;case CCB_PROPTYPE_CCBFILE:h=this.parsePropTypeCCBFile(a,b,c);if(m)this.onHandlePropTypeCCBFile(a,b,k,h,c);break;default:ASSERT_FAIL_UNEXPECTED_PROPERTYTYPE(h)}}},getCustomProperties:function(){return this._customProperties},_createCCNode:function(a, b){return new cc.Node},parsePropTypePosition:function(a,b,c,d){var e=c.readFloat(),f=c.readFloat(),g=c.readInt(!1);cc.getAbsolutePosition(e,f,g,b?b._contentSize:c._animationManager._rootContainerSize,d,this._pt);a.setPosition(this._pt);-1=e?0|255*e:e,f=0|255*c.readFloat(),g=0|255*c.readFloat(),h=0|255*c.readFloat();c=c.readFloat();this._arr2[0]={r:a,g:b,b:d,a:e};this._arr2[1]={r:f,g:g,b:h,a:1>=c?0|255*c:c};return this._arr2},parsePropTypeFlip:function(a,b,c){this._arr2[0]=!!c._data[c._currentByte++];this._arr2[1]=!!c._data[c._currentByte++];return this._arr2},parsePropTypeBlendFunc:function(a,b,c){a=c.readInt(!1);c=c.readInt(!1);return new cc.BlendFunc(a,c)},parsePropTypeFntFile:function(a,b,c){return c.readCachedString()}, parsePropTypeString:function(a,b,c){return c.readCachedString()},parsePropTypeText:function(a,b,c){return c.readCachedString()},parsePropTypeFontTTF:function(a,b,c){return c.readCachedString()},parsePropTypeBlock:function(a,b,c){b=c.readCachedString();var d=c.readInt(!1);if(d!==CCB_TARGETTYPE_NONE){var e=null;if(c._jsControlled)d===CCB_TARGETTYPE_DOCUMENTROOT?(c.addDocumentCallbackNode(a),c.addDocumentCallbackName(b),c.addDocumentCallbackControlEvents(0)):(c.addOwnerCallbackNode(a),c.addOwnerCallbackName(b), c.addOwnerCallbackControlEvents(0));else if(d===CCB_TARGETTYPE_DOCUMENTROOT?e=c._animationManager._rootNode:d===CCB_TARGETTYPE_OWNER&&(e=c._owner),null!==e)if(0this._data.length))throw Error("out of the data bound"); for(var e=0,f=b-1;0<=f;f--){d=!!(c&1<this._data.length))throw Error("out of the data bound");d&&(e|=1<>3;if(this._currentByte+c>=this._data.length)throw Error("Index out of bound");var d=Math.pow(2,b-1)-1,e=this._readBitsOnly(a+b,1,c),f=this._readBitsOnly(a,b,c),g=0,h=2,k=0;do for(var m=this._data[this._currentByte+c-++k-1],n=a%8||8,p=1<>=1;)m&p&&(g+=1/h),h*=2;while(a-=n);this._currentByte+= c;return f===(d<<1)+1?g?NaN:e?-Infinity:Infinity:(1+-2*e)*(f||g?f?Math.pow(2,f-d)*(1+g):Math.pow(2,-d+1)*g:0)},_readBitsOnly:function(a,b,c){var d=(a+b)%8,e=a%8,f=c-(a>>3)-1;a=c+(-(a+b)>>3);var g=f-a;b=this._data[this._currentByte+c-f-1]>>e&(1<<(g?8-e:b))-1;g&&d&&(b+=(this._data[this._currentByte+c-a-1]&(1<a.length||a.toLowerCase().lastIndexOf(".ccbi")!==a.length-5)a+=".ccbi";a=e.readNodeGraphFromFile(a,b,c);var f,g,h;if(b){d=e.getOwnerCallbackNames();var k=e.getOwnerCallbackNodes(),m=e.getOwnerCallbackControlEvents();for(c=0;c=b.length?0===a.lastIndexOf(b):!1};cc.BuilderReader.concat=function(a,b){return a+b};cc.loader.register(["ccbi"],cc._binaryLoader);cc.INT_VALUE=0;cc.FLOAT_VALUE=1;cc.POINTER_VALUE=2;cc.BOOL_VALUE=3;cc.UNSIGNEDCHAR_VALUE=4;cc.BuilderValue=cc.Class.extend({_value:null,_type:0,getIntValue:function(){},getFloatValue:function(){},getBoolValue:function(){},getByteValue:function(){},getPointer:function(){},getValue:function(){return this._value}});cc.BuilderValue.create=function(a){return new cc.BuilderValue};cc.BuilderKeyframe=cc.Class.extend({_value:null,_time:0,_easingType:0,_easingOpt:0,getValue:function(){return this._value},setValue:function(a){this._value=a},getTime:function(){return this._time},setTime:function(a){this._time=a},getEasingType:function(){return this._easingType},setEasingType:function(a){this._easingType=a},getEasingOpt:function(){return this._easingOpt},setEasingOpt:function(a){this._easingOpt=a}});cc.BuilderSequence=cc.Class.extend({_duration:0,_name:"",_sequenceId:0,_chainedSequenceId:0,_callbackChannel:null,_soundChannel:null,ctor:function(){this._name=""},getDuration:function(){return this._duration},setDuration:function(a){this._duration=a},getName:function(){return this._name},setName:function(a){this._name=a},getSequenceId:function(){return this._sequenceId},setSequenceId:function(a){this._sequenceId=a},getChainedSequenceId:function(){return this._chainedSequenceId},setChainedSequenceId:function(a){this._chainedSequenceId= a},getCallbackChannel:function(){return this._callbackChannel},setCallbackChannel:function(a){this._callbackChannel=a},getSoundChannel:function(){return this._soundChannel},setSoundChannel:function(a){this._soundChannel=a}}); cc.BuilderSequenceProperty=cc.Class.extend({_name:null,_type:0,_keyFrames:null,ctor:function(){this.init()},init:function(){this._keyFrames=[];this._name=""},getName:function(){return this._name},setName:function(a){this._name=a},getType:function(){return this._type},setType:function(a){this._type=a},getKeyframes:function(){return this._keyFrames}});cc.getAbsolutePosition=function(a,b,c,d,e,f){e=f||cc.p(0,0);c===CCB_POSITIONTYPE_RELATIVE_BOTTOM_LEFT?(e.x=a,e.y=b):c===CCB_POSITIONTYPE_RELATIVE_TOP_LEFT?(e.x=a,e.y=d.height-b):c===CCB_POSITIONTYPE_RELATIVE_TOP_RIGHT?(e.x=d.width-a,e.y=d.height-b):c===CCB_POSITIONTYPE_RELATIVE_BOTTOM_RIGHT?(e.x=d.width-a,e.y=b):c===CCB_POSITIONTYPE_PERCENT?(e.x=d.width*a/100,e.y=d.height*b/100):c===CCB_POSITIONTYPE_MULTIPLY_RESOLUTION&&(c=cc.BuilderReader.getResolutionScale(),e.x=a*c,e.y=b*c);return e}; cc.setRelativeScale=function(a,b,c,d,e){if(!a)throw Error("cc.setRelativeScale(): node should be non-null");d===CCB_POSITIONTYPE_MULTIPLY_RESOLUTION&&(d=cc.BuilderReader.getResolutionScale(),b*=d,c*=d);a.setScale(b,c)};(function(){var a=cc.p();cc.BuilderAnimationManagerDelegate=cc.Class.extend({completedAnimationSequenceNamed:function(a){}});cc.BuilderAnimationManager=cc.Class.extend({_sequences:null,_nodeSequences:null,_baseValues:null,_autoPlaySequenceId:0,_rootNode:null,_owner:null,_rootContainerSize:null,_delegate:null,_runningSequence:null,_documentOutletNames:null,_documentOutletNodes:null,_documentCallbackNames:null,_documentCallbackNodes:null,_documentCallbackControlEvents:null,_documentControllerName:"", _lastCompletedSequenceName:"",_keyframeCallbacks:null,_keyframeCallFuncs:null,_animationCompleteCallbackFunc:null,_target:null,_jsControlled:!1,ctor:function(){this._rootContainerSize=cc.size(0,0);this.init()},init:function(){this._sequences=[];this._nodeSequences=new cc._Dictionary;this._baseValues=new cc._Dictionary;this._documentOutletNames=[];this._documentOutletNodes=[];this._documentCallbackNames=[];this._documentCallbackNodes=[];this._documentCallbackControlEvents=[];this._keyframeCallbacks= [];this._keyframeCallFuncs={};return!0},getSequences:function(){return this._sequences},setSequences:function(a){this._sequences=a},getAutoPlaySequenceId:function(){return this._autoPlaySequenceId},setAutoPlaySequenceId:function(a){this._autoPlaySequenceId=a},getRootNode:function(){return this._rootNode},setRootNode:function(a){this._rootNode=a},getOwner:function(){return this._owner},setOwner:function(a){this._owner=a},addDocumentCallbackNode:function(a){this._documentCallbackNodes.push(a)},addDocumentCallbackName:function(a){this._documentCallbackNames.push(a)}, addDocumentCallbackControlEvents:function(a){this._documentCallbackControlEvents.push(a)},addDocumentOutletNode:function(a){this._documentOutletNodes.push(a)},addDocumentOutletName:function(a){this._documentOutletNames.push(a)},setDocumentControllerName:function(a){this._documentControllerName=a},getDocumentControllerName:function(){return this._documentControllerName},getDocumentCallbackNames:function(){return this._documentCallbackNames},getDocumentCallbackNodes:function(){return this._documentCallbackNodes}, getDocumentCallbackControlEvents:function(){return this._documentCallbackControlEvents},getDocumentOutletNames:function(){return this._documentOutletNames},getDocumentOutletNodes:function(){return this._documentOutletNodes},getLastCompletedSequenceName:function(){return this._lastCompletedSequenceName},getKeyframeCallbacks:function(){return this._keyframeCallbacks},getRootContainerSize:function(){return this._rootContainerSize},setRootContainerSize:function(a){this._rootContainerSize=cc.size(a.width, a.height)},getDelegate:function(){return this._delegate},setDelegate:function(a){this._delegate=a},getRunningSequenceName:function(){return this._runningSequence?this._runningSequence.getName():null},getContainerSize:function(a){return a?a.getContentSize():this._rootContainerSize},addNode:function(a,c){this._nodeSequences.setObject(c,a)},setBaseValue:function(a,c,d){var e=this._baseValues.objectForKey(c);e||(e=new cc._Dictionary,this._baseValues.setObject(e,c));e.setObject(a,d)},moveAnimationsFromNode:function(a, c){var d=this._baseValues,e=d.objectForKey(a);null!==e&&(d.setObject(e,c),d.removeObjectForKey(a));d=this._nodeSequences;e=d.objectForKey(a);null!=e&&(d.setObject(e,c),d.removeObjectForKey(a))},getActionForCallbackChannel:function(a){var c=0,d=[];a=a.getKeyframes();for(var e=a.length,f=0;fd.length?null:cc.sequence(d)},getActionForSoundChannel:function(a){var c=0,d=[];a=a.getKeyframes();for(var e=a.length,f=0;fd.length?null:cc.sequence(d)},runAnimationsForSequenceNamed:function(a){this.runAnimationsForSequenceIdTweenDuration(this._getSequenceId(a),0)},runAnimationsForSequenceNamedTweenDuration:function(a,c){this.runAnimationsForSequenceIdTweenDuration(this._getSequenceId(a),c)},runAnimationsForSequenceIdTweenDuration:function(a, c){if(-1===a)throw Error("cc.BuilderAnimationManager.runAnimationsForSequenceIdTweenDuration(): Sequence id should not be -1");c=c||0;this._rootNode.stopAllActions();for(var d=this._nodeSequences.allKeys(),e=0,f=d.length;e= this._maxLength&&(a=a.slice(0,this._maxLength));this._text=a;this._renderCmd.setString(a)},setFontColor:function(a){this._textColor=a;this._renderCmd.setFontColor(a)},setMaxLength:function(a){isNaN(a)||(0>a&&(a=65535),this._maxLength=a,this._renderCmd.setMaxLength(a))},getMaxLength:function(){return this._maxLength},setPlaceHolder:function(a){null!==a&&(this._renderCmd.setPlaceHolder(a),this._placeholderText=a)},setPlaceholderFont:function(a,b){this._placeholderFontName=a;this._placeholderFontSize= b;this._renderCmd._updateDOMPlaceholderFontStyle()},_setPlaceholderFont:function(a){if(a=cc.LabelTTF._fontStyleRE.exec(a))this._placeholderFontName=a[2],this._placeholderFontSize=parseInt(a[1]),this._renderCmd._updateDOMPlaceholderFontStyle()},setPlaceholderFontName:function(a){this._placeholderFontName=a;this._renderCmd._updateDOMPlaceholderFontStyle()},setPlaceholderFontSize:function(a){this._placeholderFontSize=a;this._renderCmd._updateDOMPlaceholderFontStyle()},setPlaceholderFontColor:function(a){this._placeholderColor= a;this._renderCmd.setPlaceholderFontColor(a)},setInputFlag:function(a){this._editBoxInputFlag=a;this._renderCmd.setInputFlag(a)},getString:function(){return this._text},initWithSizeAndBackgroundSprite:function(a,b){this._backgroundSprite&&this._backgroundSprite.removeFromParent();this._backgroundSprite=b;this.setContentSize(a);this._backgroundSprite&&!this._backgroundSprite.parent&&(this._backgroundSprite.setAnchorPoint(cc.p(0,0)),this.addChild(this._backgroundSprite),this._updateBackgroundSpriteSize(a.width, a.height));this.y=this.x=0;return!0},setDelegate:function(a){this._delegate=a},getPlaceHolder:function(){return this._placeholderText},setInputMode:function(a){if(this._editBoxInputMode!==a){var b=this.getString();this._editBoxInputMode=a;this._renderCmd.setInputMode(a);this._renderCmd.transform();this.setString(b);this._renderCmd._updateLabelPosition(this.getContentSize())}},setReturnType:function(a){this._keyboardReturnType=a},initWithBackgroundColor:function(a,b){this._edWidth=a.width;this.dom.style.width= this._edWidth.toString()+"px";this._edHeight=a.height;this.dom.style.height=this._edHeight.toString()+"px";this.dom.style.backgroundColor=cc.colorToHex(b)}});_p=cc.EditBox.prototype;cc.defineGetterSetter(_p,"font",null,_p._setFont);cc.defineGetterSetter(_p,"fontName",null,_p.setFontName);cc.defineGetterSetter(_p,"fontSize",null,_p.setFontSize);cc.defineGetterSetter(_p,"fontColor",null,_p.setFontColor);cc.defineGetterSetter(_p,"string",_p.getString,_p.setString); cc.defineGetterSetter(_p,"maxLength",_p.getMaxLength,_p.setMaxLength);cc.defineGetterSetter(_p,"placeholder",_p.getPlaceHolder,_p.setPlaceHolder);cc.defineGetterSetter(_p,"placeholderFont",null,_p._setPlaceholderFont);cc.defineGetterSetter(_p,"placeholderFontName",null,_p.setPlaceholderFontName);cc.defineGetterSetter(_p,"placeholderFontSize",null,_p.setPlaceholderFontSize);cc.defineGetterSetter(_p,"placeholderFontColor",null,_p.setPlaceholderFontColor);cc.defineGetterSetter(_p,"inputFlag",null,_p.setInputFlag); cc.defineGetterSetter(_p,"delegate",null,_p.setDelegate);cc.defineGetterSetter(_p,"inputMode",null,_p.setInputMode);cc.defineGetterSetter(_p,"returnType",null,_p.setReturnType);_p=null;cc.EditBox.create=function(a,b,c,d){return new cc.EditBox(a,b,c,d)};(function(a){a._polyfill={zoomInvalid:!1};cc.sys.OS_ANDROID!==cc.sys.os||cc.sys.browserType!==cc.sys.BROWSER_TYPE_SOUGOU&&cc.sys.browserType!==cc.sys.BROWSER_TYPE_360||(a._polyfill.zoomInvalid=!0)})(cc.EditBox); (function(a){function b(a){var b=a.convertToWorldSpace(cc.p(0,0)),c=cc.visibleRect.height,d=0.5;cc.visibleRect.width>c&&(d=0.7);setTimeout(function(){if(window.scrollYa&&(a=35);320this.maxLength&&(this.value=this.value.slice(0,this.maxLength));b._delegate&&b._delegate.editBoxTextChanged&&b._text.toLowerCase()!==this.value.toLowerCase()&&(b._text=this.value,a._updateEditBoxContentStyle(),b._delegate.editBoxTextChanged(b,b._text))}); c.addEventListener("keypress",function(b){var c=a._editBox;b.keyCode===cc.KEY.enter&&(b.stopPropagation(),b.preventDefault(),""===this.value&&(this.style.fontSize=c._placeholderFontSize+"px",this.style.color=cc.colorToHex(c._placeholderColor)),c._text=this.value,a._updateEditBoxContentStyle(),a.hidden(),c._delegate&&c._delegate.editBoxEditingReturn&&c._delegate.editBoxEditingReturn(c),cc._canvas.focus())});c.addEventListener("focus",function(){var c=a._editBox;this.style.fontSize=a._edFontSize+"px"; this.style.color=cc.colorToHex(c._textColor);a._hiddenLabels();cc.view.isAutoFullScreenEnabled()?(a.__fullscreen=!0,cc.view.enableAutoFullScreen(!1),cc.screen.exitFullScreen()):a.__fullscreen=!1;this.__autoResize=cc.view.__resizeWithBrowserSize;cc.view.resizeWithBrowserSize(!1);b(c);c._delegate&&c._delegate.editBoxEditingDidBegan&&c._delegate.editBoxEditingDidBegan(c)});c.addEventListener("blur",function(){var b=a._editBox;b._text=this.value;a._updateEditBoxContentStyle();a.__fullscreen&&cc.view.enableAutoFullScreen(!0); this.__autoResize&&cc.view.resizeWithBrowserSize(!0);window.scrollY=0;b._delegate&&b._delegate.editBoxEditingDidEnded&&b._delegate.editBoxEditingDidEnded(b);""===this.value&&(this.style.fontSize=b._placeholderFontSize+"px",this.style.color=cc.colorToHex(b._placeholderColor));a.hidden()});return c};g._createDomTextArea=function(){this._removeDomInputControl();var a=this,b=this._edTxt=document.createElement("textarea");b.type="text";b.style.fontSize=this._edFontSize+"px";b.style.color="#000000";b.style.border= 0;b.style.background="transparent";b.style.width="100%";b.style.height="100%";b.style.active=0;b.style.outline="medium";b.style.padding="0";b.style.resize="none";b.style.textTransform="uppercase";b.style.overflow_y="scroll";b.style.display="none";b.style.position="absolute";b.style.bottom="0px";b.style.left="2px";b.style.className="cocosEditBox";this.setMaxLength(a._editBox._maxLength);b.addEventListener("input",function(){this.value.length>this.maxLength&&(this.value=this.value.slice(0,this.maxLength)); var b=a._editBox;b._delegate&&b._delegate.editBoxTextChanged&&b._text.toLowerCase()!==this.value.toLowerCase()&&(b._text=this.value,a._updateEditBoxContentStyle(),b._delegate.editBoxTextChanged(b,b._text))});b.addEventListener("focus",function(){var b=a._editBox;a._hiddenLabels();this.style.fontSize=a._edFontSize+"px";this.style.color=cc.colorToHex(b._textColor);cc.view.isAutoFullScreenEnabled()?(a.__fullscreen=!0,cc.view.enableAutoFullScreen(!1),cc.screen.exitFullScreen()):a.__fullscreen=!1;this.__autoResize= cc.view.__resizeWithBrowserSize;cc.view.resizeWithBrowserSize(!0);b._delegate&&b._delegate.editBoxEditingDidBegan&&b._delegate.editBoxEditingDidBegan(b)});b.addEventListener("keypress",function(b){var c=a._editBox;b.keyCode===cc.KEY.enter&&(b.stopPropagation(),c._delegate&&c._delegate.editBoxEditingReturn&&c._delegate.editBoxEditingReturn(c))});b.addEventListener("blur",function(){var b=a._editBox;b._text=this.value;a._updateEditBoxContentStyle();window.scrollY=0;a.__fullscreen&&cc.view.enableAutoFullScreen(!0); this.__autoResize&&cc.view.resizeWithBrowserSize(!0);b._delegate&&b._delegate.editBoxEditingDidEnded&&b._delegate.editBoxEditingDidEnded(b);""===this.value&&(this.style.fontSize=b._placeholderFontSize+"px",this.style.color=cc.colorToHex(b._placeholderColor));a.hidden()});return b};g._createLabels=function(){var a=this._editBox.getContentSize();this._textLabel||(this._textLabel=new cc.LabelTTF,this._textLabel.setVisible(!1),this._textLabel.setAnchorPoint(cc.p(0,1)),this._editBox.addChild(this._textLabel, 100));this._placeholderLabel||(this._placeholderLabel=new cc.LabelTTF,this._placeholderLabel.setAnchorPoint(cc.p(0,1)),this._placeholderLabel.setColor(cc.color.GRAY),this._editBox.addChild(this._placeholderLabel,100));this._updateLabelPosition(a)};g._removeLabels=function(){this._textLabel&&(this._editBox.removeChild(this._textLabel),this._textLabel=null)};g._updateLabelPosition=function(a){if(this._textLabel&&this._placeholderLabel){var b=cc.size(a.width-2,a.height);this._textLabel.setContentSize(b); this._textLabel.setDimensions(b);this._placeholderLabel.setLineHeight(a.height);b=this._placeholderLabel.getContentSize();this._editBox._editBoxInputMode===cc.EDITBOX_INPUT_MODE_ANY?(this._textLabel.setPosition(2,a.height),this._placeholderLabel.setPosition(2,a.height),this._placeholderLabel.setVerticalAlignment(cc.VERTICAL_TEXT_ALIGNMENT_TOP),this._textLabel.setVerticalAlignment(cc.VERTICAL_TEXT_ALIGNMENT_TOP)):(this._textLabel.setPosition(2,a.height),this._placeholderLabel.setPosition(2,(a.height+ b.height)/2),this._placeholderLabel.setVerticalAlignment(cc.VERTICAL_TEXT_ALIGNMENT_CENTER),this._textLabel.setVerticalAlignment(cc.VERTICAL_TEXT_ALIGNMENT_CENTER))}};g.setLineHeight=function(a){this._textLabel&&this._textLabel.setLineHeight(a)};g._hiddenLabels=function(){this._textLabel&&this._textLabel.setVisible(!1);this._placeholderLabel&&this._placeholderLabel.setVisible(!1)};g._updateEditBoxContentStyle=function(){var a=this._editBox._editBoxInputFlag;if(a===cc.EDITBOX_INPUT_FLAG_INITIAL_CAPS_ALL_CHARACTERS)this._editBox._text= this._editBox._text.toUpperCase();else if(a===cc.EDITBOX_INPUT_FLAG_INITIAL_CAPS_WORD)this._editBox._text=c(this._editBox._text);else if(a===cc.EDITBOX_INPUT_FLAG_INITIAL_CAPS_SENTENCE){var a=this._editBox,b;b=this._editBox._text;b=b.charAt(0).toUpperCase()+b.slice(1);a._text=b}};g._updateLabelString=function(){this._updateInputType();this._textLabel&&(this._textLabel.setVisible(!0),this._textLabel.setString(this._editBox._text));if("password"===this._edTxt.type){for(var a="",b=this._editBox._text.length, c=0;cf._localZOrder)f.visit(this);else break;for(f=0;fk._localZOrder)c._changeProtectedChild(k),k.visit(this);else break;for(b.pushRenderCommand(c);a=a.width||0>=a.height?this._positionPercent.x=this._positionPercent.y=0:(this._positionPercent.x=b.x/a.width,this._positionPercent.y=b.y/a.height);break;case ccui.Widget.POSITION_PERCENT:b=cc.p(a.width*this._positionPercent.x,a.height*this._positionPercent.y)}if(this._parent instanceof ccui.ImageView&&(a=this._parent._imageRenderer)&& !a._textureLoaded)return;this.setPosition(b)},setSizeType:function(a){this._sizeType=a;this._usingLayoutComponent&&this._getOrCreateLayoutComponent().setUsingPercentContentSize(this._sizeType===ccui.SIZE_PERCENT)},getSizeType:function(){return this._sizeType},ignoreContentAdaptWithSize:function(a){this._unifySize?this.setContentSize(this._customSize):this._ignoreSize!==a&&(this._ignoreSize=a,this.setContentSize(a?this.getVirtualRendererSize():this._customSize))},isIgnoreContentAdaptWithSize:function(){return this._ignoreSize}, getCustomSize:function(){return cc.size(this._customSize)},getLayoutSize:function(){return cc.size(this._contentSize)},getSizePercent:function(){this._usingLayoutComponent&&(this._sizePercent=this._getOrCreateLayoutComponent().getPercentContentSize());return this._sizePercent},_getWidthPercent:function(){return this._sizePercent.x},_getHeightPercent:function(){return this._sizePercent.y},getWorldPosition:function(){return this.convertToWorldSpace(cc.p(this._anchorPoint.x*this._contentSize.width,this._anchorPoint.y* this._contentSize.height))},getVirtualRenderer:function(){return this},getVirtualRendererSize:function(){return cc.size(this._contentSize)},_onSizeChanged:function(){if(!this._usingLayoutComponent){for(var a=this.getChildren(),b=0,c=a.length;b=c.width||0>=c.height?(this._positionPercent.x=0,this._positionPercent.y=0):void 0===b?(this._positionPercent.x=a.x/c.width,this._positionPercent.y=a.y/c.height):(this._positionPercent.x=a/c.width,this._positionPercent.y=b/c.height))}cc.Node.prototype.setPosition.call(this,a,b)},setPositionX:function(a){if(this._running){var b=this.getWidgetParent(); b&&(b=b.width,this._positionPercent.x=0>=b?0:a/b)}cc.Node.prototype.setPositionX.call(this,a)},setPositionY:function(a){if(this._running){var b=this.getWidgetParent();b&&(b=b.height,this._positionPercent.y=0>=b?0:a/b)}cc.Node.prototype.setPositionY.call(this,a)},setPositionPercent:function(a){if(this._usingLayoutComponent){var b=this._getOrCreateLayoutComponent();b.setPositionPercentX(a.x);b.setPositionPercentY(a.y);b.refreshLayout()}else this._setXPercent(a.x),this._setYPercent(a.y),this._renderCmd.setDirtyFlag(cc.Node._dirtyFlags.transformDirty)}, _setXPercent:function(a){if(this._usingLayoutComponent){var b=this._getOrCreateLayoutComponent();b.setPositionPercentX(a.x);b.refreshLayout()}else this._positionPercent.x=a,this._renderCmd.setDirtyFlag(cc.Node._dirtyFlags.transformDirty)},_setYPercent:function(a){if(this._usingLayoutComponent){var b=this._getOrCreateLayoutComponent();b.setPositionPercentY(a.x);b.refreshLayout()}else this._positionPercent.y=a,this._renderCmd.setDirtyFlag(cc.Node._dirtyFlags.transformDirty)},getPositionPercent:function(){if(this._usingLayoutComponent){var a= this._getOrCreateLayoutComponent();this._positionPercent.x=a.getPositionPercentX();this._positionPercent.y=a.getPositionPercentY()}return cc.p(this._positionPercent)},_getXPercent:function(){if(this._usingLayoutComponent){var a=this._getOrCreateLayoutComponent();this._positionPercent.x=a.getPositionPercentX();this._positionPercent.y=a.getPositionPercentY()}return this._positionPercent.x},_getYPercent:function(){if(this._usingLayoutComponent){var a=this._getOrCreateLayoutComponent();this._positionPercent.x= a.getPositionPercentX();this._positionPercent.y=a.getPositionPercentY()}return this._positionPercent.y},setPositionType:function(a){this._positionType=a;if(this._usingLayoutComponent){var b=this._getOrCreateLayoutComponent();a===ccui.POSITION_ABSOLUTE?(b.setPositionPercentXEnabled(!1),b.setPositionPercentYEnabled(!1)):(b.setPositionPercentXEnabled(!0),b.setPositionPercentYEnabled(!0))}this._renderCmd.setDirtyFlag(cc.Node._dirtyFlags.transformDirty)},getPositionType:function(){return this._positionType}, setFlippedX:function(a){var b=this.getScaleX();this._flippedX=a;this.setScaleX(b)},isFlippedX:function(){return this._flippedX},setFlippedY:function(a){var b=this.getScaleY();this._flippedY=a;this.setScaleY(b)},isFlippedY:function(){return this._flippedY},_adaptRenderers:function(){},isBright:function(){return this._bright},isEnabled:function(){return this._enabled},getLeftBoundary:function(){return this.getPositionX()-this._getAnchorX()*this._contentSize.width},getBottomBoundary:function(){return this.getPositionY()- this._getAnchorY()*this._contentSize.height},getRightBoundary:function(){return this.getLeftBoundary()+this._contentSize.width},getTopBoundary:function(){return this.getBottomBoundary()+this._contentSize.height},getTouchBeganPosition:function(){return cc.p(this._touchBeganPosition)},getTouchMovePosition:function(){return cc.p(this._touchMovePosition)},getTouchEndPosition:function(){return cc.p(this._touchEndPosition)},getWidgetType:function(){return this._widgetType},setLayoutParameter:function(a){a&& (this._layoutParameterDictionary[a.getLayoutType()]=a,this._layoutParameterType=a.getLayoutType())},getLayoutParameter:function(a){a=a||this._layoutParameterType;return this._layoutParameterDictionary[a]},getDescription:function(){return"Widget"},clone:function(){var a=this._createCloneInstance();a._copyProperties(this);a._copyClonedWidgetChildren(this);return a},_createCloneInstance:function(){return new ccui.Widget},_copyClonedWidgetChildren:function(a){a=a.getChildren();for(var b=0;b=a){b=this._lengths[c];break}if(b)return this._pool[b].pop()}},b=cc.FIX_ARTIFACTS_BY_STRECHING_TEXEL,c,d={_rebuildQuads_base:function(b,d,e,f){var g=b._vertices,r=b._renderCmd._worldTransform,s,u,t;if(f)u=s=0,t=e.width,e=e.height;else{s=d._originalSize; var v=d._rect,w=d._offset;t=e.width/s.width;f=e.height/s.height;var x=w.x-(s.width-v.width)/2;u=w.y+(s.height-v.height)/2;var B=w.y-(s.height-v.height)/2;s=(w.x+(s.width-v.width)/2)*t;u*=f;t=e.width+x*t;e=e.height+B*f}8>g.length&&(a.put(g),g=a.get(8)||new Float32Array(8),b._vertices=g);c?(g[0]=s*r.a+u*r.c+r.tx,g[1]=s*r.b+u*r.d+r.ty,g[2]=t*r.a+u*r.c+r.tx,g[3]=t*r.b+u*r.d+r.ty,g[4]=s*r.a+e*r.c+r.tx,g[5]=s*r.b+e*r.d+r.ty,g[6]=t*r.a+e*r.c+r.tx,g[7]=t*r.b+e*r.d+r.ty):(g[0]=s,g[1]=u,g[2]=t,g[3]=u,g[4]= s,g[5]=e,g[6]=t,g[7]=e);b._uvsDirty&&this._calculateUVs(b,d);b._vertCount=4},_calculateUVs:function(c,d){var e=c._uvs,f=d._texture._pixelsWide,g=d._texture._pixelsHigh,r=d._rect;8>e.length&&(a.put(e),e=a.get(8)||new Float32Array(8),c._uvs=e);var s,u,t=b?0.5:0;d._rotated?(s=(r.x+t)/f,u=(r.y+r.width-t)/g,f=(r.x+r.height-t)/f,g=(r.y+t)/g,e[0]=s,e[1]=g,e[2]=s,e[3]=u,e[4]=f,e[5]=g,e[6]=f,e[7]=u):(s=(r.x+t)/f,u=(r.y+r.height-t)/g,f=(r.x+r.width-t)/f,g=(r.y+t)/g,e[0]=s,e[1]=u,e[2]=f,e[3]=u,e[4]=s,e[5]=g, e[6]=f,e[7]=g)}},e={x:Array(4),y:Array(4),_rebuildQuads_base:function(b,d,e,f,g,r,s){var u=b._vertices,t=b._renderCmd._worldTransform,v=e.width-f-g,w=e.height-r-s,x=e.width/(f+g),B=e.height/(r+s),y=this.x,z=this.y;y[0]=0;y[1]=f*(1v?0:v);y[3]=e.width;z[0]=0;z[1]=s*(1w?0:w);z[3]=e.height;32>u.length&&(a.put(u),u=a.get(32)||new Float32Array(32),b._vertices=u);e=0;if(c)for(v=0;4>v;v++)for(w=0;4>w;w++)u[e]=y[w]*t.a+z[v]*t.c+t.tx,u[e+1]=y[w]*t.b+z[v]*t.d+t.ty,e+= 2;else for(v=0;4>v;v++)for(w=0;4>w;w++)u[e]=y[w],u[e+1]=z[v],e+=2;b._uvsDirty&&this._calculateUVs(b,d,f,g,r,s)},_calculateUVs:function(c,d,e,f,g,r){var s=c._uvs,u=d._rect,t=d._texture._pixelsWide,v=d._texture._pixelsHigh,w,x=d._rect;f=u.width-e-f;w=u.height-g-r;32>s.length&&(a.put(s),s=a.get(32)||new Float32Array(32),c._uvs=s);c=this.x;var u=this.y,B=b?0.5:0,y=0;if(d._rotated)for(c[0]=(x.x+B)/t,c[1]=(r+x.x)/t,c[2]=(r+w+x.x)/t,c[3]=(x.x+x.height-B)/t,u[3]=(x.y+B)/v,u[2]=(e+x.y)/v,u[1]=(e+f+x.y)/v, u[0]=(x.y+x.width-B)/v,d=0;4>d;d++)for(e=0;4>e;e++)s[y]=c[d],s[y+1]=u[3-e],y+=2;else for(c[0]=(x.x+B)/t,c[1]=(e+x.x)/t,c[2]=(e+f+x.x)/t,c[3]=(x.x+x.width-B)/t,u[3]=(x.y+B)/v,u[2]=(g+x.y)/v,u[1]=(g+w+x.y)/v,u[0]=(x.y+x.height-B)/v,d=0;4>d;d++)for(e=0;4>e;e++)s[y]=c[e],s[y+1]=u[d],y+=2}};ccui.Scale9Sprite=cc.Scale9Sprite=cc.Node.extend({_spriteFrame:null,_scale9Image:null,_insetLeft:0,_insetRight:0,_insetTop:0,_insetBottom:0,_blendFunc:null,_renderingType:1,_brightState:0,_opacityModifyRGB:!1,_rawVerts:null, _rawUvs:null,_vertices:null,_uvs:null,_vertCount:0,_quadsDirty:!0,_uvsDirty:!0,_isTriangle:!1,_isTrimmedContentSize:!1,_flippedX:!1,_flippedY:!1,_className:"Scale9Sprite",ctor:function(b,d,e){cc.Node.prototype.ctor.call(this);this._loader=new cc.Sprite.LoadManager;this._renderCmd.setState(this._brightState);this._blendFunc=cc.BlendFunc._alphaPremultiplied();this.setAnchorPoint(cc.p(0.5,0.5));this._rawUvs=this._rawVerts=null;this._vertices=a.get(8)||new Float32Array(8);this._uvs=a.get(8)||new Float32Array(8); if(void 0!==b)if(b instanceof cc.SpriteFrame)this.initWithSpriteFrame(b,d);else{var f=cc.spriteFrameCache.getSpriteFrame(b);f?this.initWithSpriteFrame(f,d):this.initWithFile(b,d,e)}void 0===c&&(c=cc._renderType===cc.game.RENDER_TYPE_WEBGL)},getCapInsets:function(){return cc.rect(this._capInsetsInternal)},_asyncSetCapInsets:function(){this.removeEventListener("load",this._asyncSetCapInsets,this);this.setCapInsets(this._cacheCapInsets);this._cacheCapInsets=null},setCapInsets:function(a){if(!this.loaded())return this._cacheCapInsets= a,this.removeEventListener("load",this._asyncSetCapInsets,this),this.addEventListener("load",this._asyncSetCapInsets,this),!1;this._capInsetsInternal=a;this._updateCapInsets(this._spriteFrame._rect,this._capInsetsInternal)},_updateCapInsets:function(a,b){b&&a&&!cc._rectEqualToZero(b)?this._capInsetsInternal=b:(a=a||{x:0,y:0,width:this._contentSize.width,height:this._contentSize.height},this._capInsetsInternal=cc.rect(a.width/3,a.height/3,a.width/3,a.height/3));cc._rectEqualToZero(a)||(this._insetLeft= this._capInsetsInternal.x,this._insetTop=this._capInsetsInternal.y,this._insetRight=a.width-this._insetLeft-this._capInsetsInternal.width,this._insetBottom=a.height-this._insetTop-this._capInsetsInternal.height)},initWithFile:function(a,b,c){a instanceof cc.Rect?(c=a=b,b=cc.rect(0,0,0,0)):(b=b||cc.rect(0,0,0,0),c=c||cc.rect(0,0,0,0));if(!a)throw Error("ccui.Scale9Sprite.initWithFile(): file should be non-null");var d=cc.textureCache.getTextureForKey(a);d||(d=cc.textureCache.addImage(a));var e=d.isLoaded(); this._loader.clear();if(!e)return this._loader.once(d,function(){this.initWithFile(a,b,c);this.dispatchEvent("load")},this),!1;cc._rectEqualToZero(b)&&(e=d.getContentSize(),b=cc.rect(0,0,e.width,e.height));this.setTexture(d,b);this._updateCapInsets(b,c);return!0},updateWithBatchNode:function(a,b,c,d){if(!a)return!1;var e=a.getTexture();this._loader.clear();if(!e.isLoaded())return this._loader.once(e,function(){this.updateWithBatchNode(a,b,c,d);this.dispatchEvent("load")},this),!1;this.setTexture(e, b);this._updateCapInsets(b,d);return!0},initWithSpriteFrame:function(a,b){this.setSpriteFrame(a);b=b||cc.rect(0,0,0,0);this._updateCapInsets(a._rect,b)},initWithSpriteFrameName:function(a,b){if(!a)throw Error("ccui.Scale9Sprite.initWithSpriteFrameName(): spriteFrameName should be non-null");b=b||cc.rect(0,0,0,0);var c=cc.spriteFrameCache.getSpriteFrame(a);if(null==c)return cc.log("ccui.Scale9Sprite.initWithSpriteFrameName(): can't find the sprite frame by spriteFrameName"),!1;this.setSpriteFrame(c); b=b||cc.rect(0,0,0,0);this._updateCapInsets(c._rect,b)},loaded:function(){return null===this._spriteFrame?!1:this._spriteFrame.textureLoaded()},setTexture:function(a,b){var c=new cc.SpriteFrame(a,b);this.setSpriteFrame(c)},_updateBlendFunc:function(){var a=this._blendFunc;this._spriteFrame&&this._spriteFrame._texture.hasPremultipliedAlpha()?(a.src===cc.SRC_ALPHA&&a.dst===cc.BLEND_DST&&(a.src=cc.ONE),this._opacityModifyRGB=!0):(a.src===cc.ONE&&a.dst===cc.BLEND_DST&&(a.src=cc.SRC_ALPHA),this._opacityModifyRGB= !1)},setOpacityModifyRGB:function(a){this._opacityModifyRGB!==a&&(this._opacityModifyRGB=a,this._renderCmd._setColorDirty())},isOpacityModifyRGB:function(){return this._opacityModifyRGB},setSpriteFrame:function(a){if(a){this._spriteFrame=a;this._uvsDirty=this._quadsDirty=!0;var b=this,c=function(){cc.sizeEqualToSize(b._contentSize,cc.size(0,0))&&b.setContentSize(b._spriteFrame._rect);b._renderCmd.setDirtyFlag(cc.Node._dirtyFlags.contentDirty);cc.renderer.childrenOrderDirty=!0};a.textureLoaded()?c(): (this._loader.clear(),this._loader.once(a,function(){c();this.dispatchEvent("load")},this))}},setBlendFunc:function(a,b){void 0===b?(this._blendFunc.src=a.src||cc.BLEND_SRC,this._blendFunc.dst=a.dst||cc.BLEND_DST):(this._blendFunc.src=a||cc.BLEND_SRC,this._blendFunc.dst=b||cc.BLEND_DST);this._renderCmd.setDirtyFlag(cc.Node._dirtyFlags.contentDirty)},getBlendFunc:function(){return new cc.BlendFunc(this._blendFunc.src,this._blendFunc.dst)},setPreferredSize:function(a){a&&!cc.sizeEqualToSize(this._contentSize, a)&&this.setContentSize(a)},getPreferredSize:function(){return this.getContentSize()},setContentSize:function(a,b){void 0===b&&(b=a.height,a=a.width);if(a!==this._contentSize.width||b!==this._contentSize.height)cc.Node.prototype.setContentSize.call(this,a,b),this._quadsDirty=!0},getContentSize:function(){return this._renderingType===ccui.Scale9Sprite.RenderingType.SIMPLE?this._spriteFrame?this._spriteFrame._originalSize:cc.size(this._contentSize):cc.size(this._contentSize)},_setWidth:function(a){cc.Node.prototype._setWidth.call(this, a);this._quadsDirty=!0},_setHeight:function(a){cc.Node.prototype._setHeight.call(this,a);this._quadsDirty=!0},setState:function(a){this._brightState=a;this._renderCmd.setState(a);this._renderCmd.setDirtyFlag(cc.Node._dirtyFlags.contentDirty)},getState:function(){return this._brightState},setRenderingType:function(a){this._renderingType!==a&&(this._renderingType=a,this._uvsDirty=this._quadsDirty=!0,this._renderCmd.setDirtyFlag(cc.Node._dirtyFlags.contentDirty))},getRenderingType:function(){return this._renderingType}, setInsetLeft:function(a){this._insetLeft=a;this._uvsDirty=this._quadsDirty=!0;this._renderCmd.setDirtyFlag(cc.Node._dirtyFlags.contentDirty)},getInsetLeft:function(){return this._insetLeft},setInsetTop:function(a){this._insetTop=a;this._uvsDirty=this._quadsDirty=!0;this._renderCmd.setDirtyFlag(cc.Node._dirtyFlags.contentDirty)},getInsetTop:function(){return this._insetTop},setInsetRight:function(a){this._insetRight=a;this._uvsDirty=this._quadsDirty=!0;this._renderCmd.setDirtyFlag(cc.Node._dirtyFlags.contentDirty)}, getInsetRight:function(){return this._insetRight},setInsetBottom:function(a){this._insetBottom=a;this._uvsDirty=this._quadsDirty=!0;this._renderCmd.setDirtyFlag(cc.Node._dirtyFlags.contentDirty)},getInsetBottom:function(){return this._insetBottom},_rebuildQuads:function(){if(this._spriteFrame&&this._spriteFrame._textureLoaded){this._updateBlendFunc();this._isTriangle=!1;switch(this._renderingType){case g.SIMPLE:d._rebuildQuads_base(this,this._spriteFrame,this._contentSize,this._isTrimmedContentSize); break;case g.SLICED:e._rebuildQuads_base(this,this._spriteFrame,this._contentSize,this._insetLeft,this._insetRight,this._insetTop,this._insetBottom);break;default:this._uvsDirty=this._quadsDirty=!1;cc.error("Can not generate quad");return}this._uvsDirty=this._quadsDirty=!1}},_createRenderCmd:function(){return cc._renderType===cc.game.RENDER_TYPE_CANVAS?new ccui.Scale9Sprite.CanvasRenderCmd(this):new ccui.Scale9Sprite.WebGLRenderCmd(this)}});var f=ccui.Scale9Sprite.prototype;cc.EventHelper.prototype.apply(f); cc.defineGetterSetter(f,"preferredSize",f.getPreferredSize,f.setPreferredSize);cc.defineGetterSetter(f,"capInsets",f.getCapInsets,f.setCapInsets);cc.defineGetterSetter(f,"insetLeft",f.getInsetLeft,f.setInsetLeft);cc.defineGetterSetter(f,"insetTop",f.getInsetTop,f.setInsetTop);cc.defineGetterSetter(f,"insetRight",f.getInsetRight,f.setInsetRight);cc.defineGetterSetter(f,"insetBottom",f.getInsetBottom,f.setInsetBottom);f=null;ccui.Scale9Sprite.create=function(a,b,c){return new ccui.Scale9Sprite(a,b, c)};ccui.Scale9Sprite.createWithSpriteFrame=function(a,b){return new ccui.Scale9Sprite(a,b)};ccui.Scale9Sprite.createWithSpriteFrameName=function(a,b){return new ccui.Scale9Sprite(a,b)};ccui.Scale9Sprite.POSITIONS_CENTRE=0;ccui.Scale9Sprite.POSITIONS_TOP=1;ccui.Scale9Sprite.POSITIONS_LEFT=2;ccui.Scale9Sprite.POSITIONS_RIGHT=3;ccui.Scale9Sprite.POSITIONS_BOTTOM=4;ccui.Scale9Sprite.POSITIONS_TOPRIGHT=5;ccui.Scale9Sprite.POSITIONS_TOPLEFT=6;ccui.Scale9Sprite.POSITIONS_BOTTOMRIGHT=7;ccui.Scale9Sprite.state= {NORMAL:0,GRAY:1};var g=ccui.Scale9Sprite.RenderingType={SIMPLE:0,SLICED:1}})();(function(){ccui.Scale9Sprite.CanvasRenderCmd=function(a){cc.Node.CanvasRenderCmd.call(this,a);this._needDraw=!0;this._state=ccui.Scale9Sprite.state.NORMAL;this._originalTexture=this._textureToRender=null};var a=ccui.Scale9Sprite.CanvasRenderCmd.prototype=Object.create(cc.Node.CanvasRenderCmd.prototype);a.constructor=ccui.Scale9Sprite.CanvasRenderCmd;a.transform=function(a,c){this.originTransform(a,c);this._node._rebuildQuads()};a.needDraw=function(){return this._needDraw&&this._node.loaded()};a._updateDisplayColor= function(a){cc.Node.RenderCmd.prototype._updateDisplayColor.call(this,a);this._originalTexture=this._textureToRender=null};a.setState=function(a){this._state!==a&&(this._state=a,this._originalTexture=this._textureToRender=null)};a._setColorDirty=function(){this.setDirtyFlag(cc.Node._dirtyFlags.colorDirty|cc.Node._dirtyFlags.opacityDirty)};a.rendering=function(a,c,d){var e=this._node,f=this._displayedOpacity,g=f/255,h=null;e._spriteFrame&&(h=e._spriteFrame._texture);if(e.loaded()&&0!==f){if(null=== this._textureToRender||this._originalTexture!==h)this._textureToRender=this._originalTexture=h,cc.Scale9Sprite.state.GRAY===this._state&&(this._textureToRender=this._textureToRender._switchToGray()),f=e.getDisplayedColor(),!h||255===f.r&&255===f.g&&255===f.b||(this._textureToRender=this._textureToRender._generateColorTexture(f.r,f.g,f.b));h=a||cc._renderContext;a=h.getContext();h.setTransform(this._worldTransform,c,d);h.setCompositeOperation(cc.Node.CanvasRenderCmd._getCompositeOperationByBlendFunc(e._blendFunc)); h.setGlobalAlpha(g);if(this._textureToRender){e._quadsDirty&&e._rebuildQuads();var k,m,n,p,r,s,u;c=this._textureToRender._pixelsWide;d=this._textureToRender._pixelsHigh;var g=this._textureToRender._htmlElementObj,f=e._vertices,t=e._uvs,v=0,w=0;if(e._renderingType===cc.Scale9Sprite.RenderingType.SLICED){for(h=0;3>h;++h)for(v=0;3>v;++v)w=8*h+2*v,p=f[w],r=f[w+1],s=f[w+10]-p,u=f[w+11]-r,r=-r-u,e=t[w]*c,k=t[w+11]*d,m=(t[w+10]-t[w])*c,n=(t[w+1]-t[w+11])*d,0n;++n)for(var p=0;3>p;++p)m=8*n+2*p,g[k]=a[m],g[k+1]=a[m+1],g[k+2]=f,h[k+3]=e[0],g[k+4]=b[m],g[k+5]=b[m+1],k+=6,g[k]=a[m+2],g[k+1]=a[m+3],g[k+2]=f,h[k+3]=e[0],g[k+4]=b[m+2],g[k+5]=b[m+3],k+=6,g[k]=a[m+8],g[k+1]=a[m+9],g[k+2]=f,h[k+3]=e[0],g[k+4]=b[m+8],g[k+5]=b[m+9],k+=6,g[k]=a[m+10],g[k+1]=a[m+11],g[k+2]=f,h[k+3]=e[0],g[k+4]=b[m+10],g[k+5]=b[m+11],k+=6;return 36};b.transform=function(a,b){this.originTransform(a,b);this._node._rebuildQuads()}; b._setColorDirty=function(){};b.uploadData=function(b,d,e){var f=this._node;if(0===this._displayedOpacity)return 0;f._quadsDirty&&f._rebuildQuads();var g=this._displayedOpacity,h=this._displayedColor.r,k=this._displayedColor.g,m=this._displayedColor.b;if(f._opacityModifyRGB)var n=g/255,h=h*n,k=k*n,m=m*n;this._color[0]=g<<24|m<<16|k<<8|h;g=f._vertexZ;h=f._vertices;k=f._uvs;n=a.RenderingType;m=0;switch(f._renderingType){case n.SIMPLE:m=this._node._vertCount;for(n=f=0;fg._localZOrder)g.visit(this);else break;for(g=0;gm._localZOrder)b._changeProtectedChild(m),m.visit(this);else break;for(;cf&&(g=c,f=k));c++}return g}cc.log("invalid focus direction!!!");return 0},_calculateNearestDistance:function(a){for(var b=cc.FLT_MAX,c=this._getWorldCenterPoint(a),d=this._children,e=0,f=d.length;eb&&(b=g)}return b},_findProperSearchingFunctor:function(a,b){if(void 0!==b){var c=this._getWorldCenterPoint(b),d=this._getWorldCenterPoint(this._findFirstNonLayoutWidget());a===ccui.Widget.LEFT?this.onPassFocusToChild=c.x>d.x?this._findNearestChildWidgetIndex:this._findFarthestChildWidgetIndex:a===ccui.Widget.RIGHT?this.onPassFocusToChild=c.x>d.x?this._findFarthestChildWidgetIndex:this._findNearestChildWidgetIndex:a===ccui.Widget.DOWN?this.onPassFocusToChild=c.y>d.y?this._findNearestChildWidgetIndex: this._findFarthestChildWidgetIndex:a===ccui.Widget.UP?this.onPassFocusToChild=c.yb.width?a.width:b.width,a.height>b.height?a.height:b.height)}});_p=ccui.Button.prototype;cc.defineGetterSetter(_p,"titleText",_p.getTitleText,_p.setTitleText);cc.defineGetterSetter(_p,"titleFont",_p._getTitleFont,_p._setTitleFont);cc.defineGetterSetter(_p,"titleFontSize",_p.getTitleFontSize,_p.setTitleFontSize); cc.defineGetterSetter(_p,"titleFontName",_p.getTitleFontName,_p.setTitleFontName);cc.defineGetterSetter(_p,"titleColor",_p.getTitleColor,_p.setTitleColor);_p=null;ccui.Button.create=function(a,b,c,d){return new ccui.Button(a,b,c,d)};ccui.Button.NORMAL_RENDERER_ZORDER=-2;ccui.Button.PRESSED_RENDERER_ZORDER=-2;ccui.Button.DISABLED_RENDERER_ZORDER=-2;ccui.Button.TITLE_RENDERER_ZORDER=-1;ccui.Button.ZOOM_ACTION_TIME_STEP=0.05;ccui.Button.SYSTEM=0;ccui.Button.TTF=1;ccui.CheckBox=ccui.Widget.extend({_backGroundBoxRenderer:null,_backGroundSelectedBoxRenderer:null,_frontCrossRenderer:null,_backGroundBoxDisabledRenderer:null,_frontCrossDisabledRenderer:null,_isSelected:!0,_checkBoxEventListener:null,_checkBoxEventSelector:null,_backGroundTexType:ccui.Widget.LOCAL_TEXTURE,_backGroundSelectedTexType:ccui.Widget.LOCAL_TEXTURE,_frontCrossTexType:ccui.Widget.LOCAL_TEXTURE,_backGroundDisabledTexType:ccui.Widget.LOCAL_TEXTURE,_frontCrossDisabledTexType:ccui.Widget.LOCAL_TEXTURE, _backGroundFileName:"",_backGroundSelectedFileName:"",_frontCrossFileName:"",_backGroundDisabledFileName:"",_frontCrossDisabledFileName:"",_className:"CheckBox",_zoomScale:0.1,_backgroundTextureScaleX:0.1,_backgroundTextureScaleY:0.1,_backGroundBoxRendererAdaptDirty:!0,_backGroundSelectedBoxRendererAdaptDirty:!0,_frontCrossRendererAdaptDirty:!0,_backGroundBoxDisabledRendererAdaptDirty:!0,_frontCrossDisabledRendererAdaptDirty:!0,ctor:function(a,b,c,d,e,f){ccui.Widget.prototype.ctor.call(this);this.setTouchEnabled(!0); for(var g=0,h=0;h=c.width||0>=c.height){a.setScale(1);this._backgroundTextureScaleX=this._backgroundTextureScaleY=1;return}var d=b.width/c.width,c=b.height/c.height;this._backgroundTextureScaleX=d;this._backgroundTextureScaleY=c;a.setScaleX(d);a.setScaleY(c)}a.setPosition(0.5*b.width,0.5*b.height)},_backGroundSelectedTextureScaleChangedWithSize:function(){var a=this._backGroundSelectedBoxRenderer,b=this._contentSize;if(this._ignoreSize)a.setScale(1);else{var c=a.getContentSize();if(0>=c.width||0>=c.height){a.setScale(1); return}var d=b.height/c.height;a.setScaleX(b.width/c.width);a.setScaleY(d)}a.setPosition(0.5*b.width,0.5*b.height)},_frontCrossTextureScaleChangedWithSize:function(){var a=this._frontCrossRenderer,b=this._contentSize;if(this._ignoreSize)a.setScale(1);else{var c=a.getContentSize();if(0>=c.width||0>=c.height){a.setScale(1);return}var d=b.height/c.height;a.setScaleX(b.width/c.width);a.setScaleY(d)}a.setPosition(0.5*b.width,0.5*b.height)},_backGroundDisabledTextureScaleChangedWithSize:function(){var a= this._backGroundBoxDisabledRenderer,b=this._contentSize;if(this._ignoreSize)a.setScale(1);else{var c=a.getContentSize();if(0>=c.width||0>=c.height){a.setScale(1);return}var d=b.height/c.height;a.setScaleX(b.width/c.width);a.setScaleY(d)}a.setPosition(0.5*b.width,0.5*b.height)},_frontCrossDisabledTextureScaleChangedWithSize:function(){var a=this._frontCrossDisabledRenderer,b=this._contentSize;if(this._ignoreSize)a.setScale(1);else{var c=a.getContentSize();if(0>=c.width||0>=c.height){a.setScale(1); return}var d=b.height/c.height;a.setScaleX(b.width/c.width);a.setScaleY(d)}a.setPosition(0.5*b.width,0.5*b.height)},getDescription:function(){return"CheckBox"},_createCloneInstance:function(){return new ccui.CheckBox},_copySpecialProperties:function(a){a instanceof ccui.CheckBox&&(this.loadTextureBackGround(a._backGroundFileName,a._backGroundTexType),this.loadTextureBackGroundSelected(a._backGroundSelectedFileName,a._backGroundSelectedTexType),this.loadTextureFrontCross(a._frontCrossFileName,a._frontCrossTexType), this.loadTextureBackGroundDisabled(a._backGroundDisabledFileName,a._backGroundDisabledTexType),this.loadTextureFrontCrossDisabled(a._frontCrossDisabledFileName,a._frontCrossDisabledTexType),this.setSelected(a._isSelected),this._checkBoxEventListener=a._checkBoxEventListener,this._checkBoxEventSelector=a._checkBoxEventSelector,this._ccEventCallback=a._ccEventCallback,this._zoomScale=a._zoomScale,this._backgroundTextureScaleX=a._backgroundTextureScaleX,this._backgroundTextureScaleY=a._backgroundTextureScaleY)}, _adaptRenderers:function(){this._backGroundBoxRendererAdaptDirty&&(this._backGroundTextureScaleChangedWithSize(),this._backGroundBoxRendererAdaptDirty=!1);this._backGroundSelectedBoxRendererAdaptDirty&&(this._backGroundSelectedTextureScaleChangedWithSize(),this._backGroundSelectedBoxRendererAdaptDirty=!1);this._frontCrossRendererAdaptDirty&&(this._frontCrossTextureScaleChangedWithSize(),this._frontCrossRendererAdaptDirty=!1);this._backGroundBoxDisabledRendererAdaptDirty&&(this._backGroundDisabledTextureScaleChangedWithSize(), this._backGroundBoxDisabledRendererAdaptDirty=!1);this._frontCrossDisabledRendererAdaptDirty&&(this._frontCrossDisabledTextureScaleChangedWithSize(),this._frontCrossDisabledRendererAdaptDirty=!1)}});_p=ccui.CheckBox.prototype;cc.defineGetterSetter(_p,"selected",_p.isSelected,_p.setSelected);_p=null;ccui.CheckBox.create=function(a,b,c,d,e,f){return new ccui.CheckBox(a,b,c,d,e,f)};ccui.CheckBox.EVENT_SELECTED=0;ccui.CheckBox.EVENT_UNSELECTED=1;ccui.CheckBox.BOX_RENDERER_ZORDER=-1; ccui.CheckBox.BOX_SELECTED_RENDERER_ZORDER=-1;ccui.CheckBox.BOX_DISABLED_RENDERER_ZORDER=-1;ccui.CheckBox.FRONT_CROSS_RENDERER_ZORDER=-1;ccui.CheckBox.FRONT_CROSS_DISABLED_RENDERER_ZORDER=-1;ccui.ImageView=ccui.Widget.extend({_scale9Enabled:!1,_prevIgnoreSize:!0,_capInsets:null,_imageRenderer:null,_textureFile:"",_imageTexType:ccui.Widget.LOCAL_TEXTURE,_imageTextureSize:null,_className:"ImageView",_imageRendererAdaptDirty:!0,ctor:function(a,b){this._capInsets=cc.rect(0,0,0,0);this._imageTextureSize=cc.size(this._capInsets.width,this._capInsets.height);ccui.Widget.prototype.ctor.call(this);a?this.loadTexture(a,void 0===b?0:b):this._imageTexType=ccui.Widget.LOCAL_TEXTURE},_initRenderer:function(){this._imageRenderer= new ccui.Scale9Sprite;this._imageRenderer.setRenderingType(ccui.Scale9Sprite.RenderingType.SIMPLE);this.addProtectedChild(this._imageRenderer,ccui.ImageView.RENDERER_ZORDER,-1)},loadTexture:function(a,b){if(a&&(this._textureFile!=a||this._imageTexType!=b)){var c=this;b=b||ccui.Widget.LOCAL_TEXTURE;this._textureFile=a;this._imageTexType=b;var d=c._imageRenderer;d._textureLoaded||d.addEventListener("load",function(){!c._ignoreSize&&cc.sizeEqualToSize(c._customSize,cc.size(0,0))&&(c._customSize=c._imageRenderer.getContentSize()); c._imageTextureSize=d.getContentSize();c._updateChildrenDisplayedRGBA();c._updateContentSizeWithTextureSize(c._imageTextureSize)});switch(c._imageTexType){case ccui.Widget.LOCAL_TEXTURE:c._scale9Enabled?(d.initWithFile(a),d.setCapInsets(c._capInsets)):d.initWithFile(a);break;case ccui.Widget.PLIST_TEXTURE:c._scale9Enabled?(d.initWithSpriteFrameName(a),d.setCapInsets(c._capInsets)):d.initWithSpriteFrameName(a)}!this._ignoreSize&&cc.sizeEqualToSize(this._customSize,cc.size(0,0))&&(this._customSize= this._imageRenderer.getContentSize());c._imageTextureSize=d.getContentSize();this._updateChildrenDisplayedRGBA();c._updateContentSizeWithTextureSize(c._imageTextureSize);c._imageRendererAdaptDirty=!0;c._findLayout()}},setTextureRect:function(){cc.warn("ImageView.setTextureRect is deprecated!")},setScale9Enabled:function(a){this._scale9Enabled!==a&&((this._scale9Enabled=a)?this._imageRenderer.setRenderingType(ccui.Scale9Sprite.RenderingType.SLICED):this._imageRenderer.setRenderingType(ccui.Scale9Sprite.RenderingType.SIMPLE), this._scale9Enabled?(a=this._ignoreSize,this.ignoreContentAdaptWithSize(!1),this._prevIgnoreSize=a):this.ignoreContentAdaptWithSize(this._prevIgnoreSize),this.setCapInsets(this._capInsets),this._imageRendererAdaptDirty=!0)},isScale9Enabled:function(){return this._scale9Enabled},ignoreContentAdaptWithSize:function(a){if(!this._scale9Enabled||this._scale9Enabled&&!a)ccui.Widget.prototype.ignoreContentAdaptWithSize.call(this,a),this._prevIgnoreSize=a},setCapInsets:function(a){if(a){var b=this._capInsets; b.x=a.x;b.y=a.y;b.width=a.width;b.height=a.height;this._scale9Enabled&&this._imageRenderer.setCapInsets(a)}},getCapInsets:function(){return cc.rect(this._capInsets)},_onSizeChanged:function(){ccui.Widget.prototype._onSizeChanged.call(this);this._imageRendererAdaptDirty=!0},_adaptRenderers:function(){this._imageRendererAdaptDirty&&(this._imageTextureScaleChangedWithSize(),this._imageRendererAdaptDirty=!1)},getVirtualRendererSize:function(){return cc.size(this._imageTextureSize)},getVirtualRenderer:function(){return this._imageRenderer}, _imageTextureScaleChangedWithSize:function(){this._imageRenderer.setContentSize(this._contentSize);this._imageRenderer.setPosition(this._contentSize.width/2,this._contentSize.height/2)},getDescription:function(){return"ImageView"},_createCloneInstance:function(){return new ccui.ImageView},_copySpecialProperties:function(a){a instanceof ccui.ImageView&&(this._prevIgnoreSize=a._prevIgnoreSize,this._capInsets=a._capInsets,this.loadTexture(a._textureFile,a._imageTexType),this.setScale9Enabled(a._scale9Enabled))}, setContentSize:function(a,b){b&&(a=cc.size(a,b));ccui.Widget.prototype.setContentSize.call(this,a);this._imageRenderer.setContentSize(a)}});ccui.ImageView.create=function(a,b){return new ccui.ImageView(a,b)};ccui.ImageView.RENDERER_ZORDER=-1;ccui.LoadingBar=ccui.Widget.extend({_direction:null,_percent:100,_totalLength:0,_barRenderer:null,_renderBarTexType:ccui.Widget.LOCAL_TEXTURE,_barRendererTextureSize:null,_scale9Enabled:!1,_prevIgnoreSize:!0,_capInsets:null,_textureFile:"",_isTextureLoaded:!1,_className:"LoadingBar",_barRendererAdaptDirty:!0,ctor:function(a,b){this._direction=ccui.LoadingBar.TYPE_LEFT;this._barRendererTextureSize=cc.size(0,0);this._capInsets=cc.rect(0,0,0,0);ccui.Widget.prototype.ctor.call(this);void 0!==a&&this.loadTexture(a); void 0!==b&&this.setPercent(b)},_initRenderer:function(){this._barRenderer=new cc.Sprite;this.addProtectedChild(this._barRenderer,ccui.LoadingBar.RENDERER_ZORDER,-1);this._barRenderer.setAnchorPoint(0,0.5)},setDirection:function(a){if(this._direction!==a)switch(this._direction=a,this._direction){case ccui.LoadingBar.TYPE_LEFT:this._barRenderer.setAnchorPoint(0,0.5);this._barRenderer.setPosition(0,0.5*this._contentSize.height);this._scale9Enabled||this._barRenderer.setFlippedX(!1);break;case ccui.LoadingBar.TYPE_RIGHT:this._barRenderer.setAnchorPoint(1, 0.5),this._barRenderer.setPosition(this._totalLength,0.5*this._contentSize.height),this._scale9Enabled||this._barRenderer.setFlippedX(!0)}},getDirection:function(){return this._direction},loadTexture:function(a,b){if(a){this._renderBarTexType=b=b||ccui.Widget.LOCAL_TEXTURE;this._textureFile=a;var c=this._barRenderer,d=this;c._textureLoaded||c.addEventListener("load",function(){d.loadTexture(d._textureFile,d._renderBarTexType);d._setPercent(d._percent)});switch(this._renderBarTexType){case ccui.Widget.LOCAL_TEXTURE:c.initWithFile(a); break;case ccui.Widget.PLIST_TEXTURE:c.initWithSpriteFrameName(a)}var e=c.getContentSize();this._barRendererTextureSize.width=e.width;this._barRendererTextureSize.height=e.height;switch(this._direction){case ccui.LoadingBar.TYPE_LEFT:c.setAnchorPoint(0,0.5);this._scale9Enabled||c.setFlippedX(!1);break;case ccui.LoadingBar.TYPE_RIGHT:c.setAnchorPoint(1,0.5),this._scale9Enabled||c.setFlippedX(!0)}this._scale9Enabled&&c.setCapInsets(this._capInsets);this._updateChildrenDisplayedRGBA();this._barRendererScaleChangedWithSize(); this._updateContentSizeWithTextureSize(this._barRendererTextureSize);this._barRendererAdaptDirty=!0;this._findLayout()}},setScale9Enabled:function(a){this._scale9Enabled!==a&&(this._scale9Enabled=a,this.removeProtectedChild(this._barRenderer),this._barRenderer=this._scale9Enabled?new ccui.Scale9Sprite:new cc.Sprite,this.loadTexture(this._textureFile,this._renderBarTexType),this.addProtectedChild(this._barRenderer,ccui.LoadingBar.RENDERER_ZORDER,-1),this._scale9Enabled?(a=this._ignoreSize,this.ignoreContentAdaptWithSize(!1), this._prevIgnoreSize=a):this.ignoreContentAdaptWithSize(this._prevIgnoreSize),this.setCapInsets(this._capInsets),this.setPercent(this._percent),this._barRendererAdaptDirty=!0)},isScale9Enabled:function(){return this._scale9Enabled},setCapInsets:function(a){if(a){var b=this._capInsets;b.x=a.x;b.y=a.y;b.width=a.width;b.height=a.height;this._scale9Enabled&&this._barRenderer.setCapInsets(a)}},getCapInsets:function(){return cc.rect(this._capInsets)},setPercent:function(a){100a&&(a=0);a!== this._percent&&(this._percent=a,this._setPercent(a))},_setPercent:function(){var a,b,c,d;0>=this._totalLength||(a=this._percent/100,this._scale9Enabled?this._setScale9Scale():(c=this._barRenderer,d=this._barRendererTextureSize,b=c.getTextureRect(),b.width=d.width*a,c.setTextureRect(cc.rect(b.x,b.y,d.width*a,d.height),c._rectRotated)))},setContentSize:function(a,b){ccui.Widget.prototype.setContentSize.call(this,a,b);this._totalLength=void 0===b?a.width:a},getPercent:function(){return this._percent}, _onSizeChanged:function(){ccui.Widget.prototype._onSizeChanged.call(this);this._barRendererAdaptDirty=!0},_adaptRenderers:function(){this._barRendererAdaptDirty&&(this._barRendererScaleChangedWithSize(),this._barRendererAdaptDirty=!1)},ignoreContentAdaptWithSize:function(a){if(!this._scale9Enabled||this._scale9Enabled&&!a)ccui.Widget.prototype.ignoreContentAdaptWithSize.call(this,a),this._prevIgnoreSize=a},getVirtualRendererSize:function(){return cc.size(this._barRendererTextureSize)},getVirtualRenderer:function(){return this._barRenderer}, _barRendererScaleChangedWithSize:function(){var a=this._barRenderer,b=this._contentSize;if(this._unifySize)this._totalLength=this._contentSize.width,this.setPercent(this._percent);else if(this._ignoreSize)this._scale9Enabled||(this._totalLength=this._barRendererTextureSize.width,a.setScale(1));else if(this._totalLength=b.width,this._scale9Enabled)this._setScale9Scale(),a.setScale(1);else{var c=this._barRendererTextureSize;if(0>=c.width||0>=c.height){a.setScale(1);return}var d=b.height/c.height;a.setScaleX(b.width/ c.width);a.setScaleY(d)}switch(this._direction){case ccui.LoadingBar.TYPE_LEFT:a.setPosition(0,0.5*b.height);break;case ccui.LoadingBar.TYPE_RIGHT:a.setPosition(this._totalLength,0.5*b.height)}},_setScale9Scale:function(){this._barRenderer.setPreferredSize(cc.size(this._percent/100*this._totalLength,this._contentSize.height))},getDescription:function(){return"LoadingBar"},_createCloneInstance:function(){return new ccui.LoadingBar},_copySpecialProperties:function(a){a instanceof ccui.LoadingBar&&(this._prevIgnoreSize= a._prevIgnoreSize,this.setScale9Enabled(a._scale9Enabled),this.loadTexture(a._textureFile,a._renderBarTexType),this.setCapInsets(a._capInsets),this.setPercent(a._percent),this.setDirection(a._direction))}});_p=ccui.LoadingBar.prototype;cc.defineGetterSetter(_p,"direction",_p.getDirection,_p.setDirection);cc.defineGetterSetter(_p,"percent",_p.getPercent,_p.setPercent);_p=null;ccui.LoadingBar.create=function(a,b){return new ccui.LoadingBar(a,b)};ccui.LoadingBar.TYPE_LEFT=0; ccui.LoadingBar.TYPE_RIGHT=1;ccui.LoadingBar.RENDERER_ZORDER=-1;ccui.Slider=ccui.Widget.extend({_barRenderer:null,_progressBarRenderer:null,_barTextureSize:null,_progressBarTextureSize:null,_slidBallNormalRenderer:null,_slidBallPressedRenderer:null,_slidBallDisabledRenderer:null,_slidBallRenderer:null,_barLength:0,_percent:0,_scale9Enabled:!1,_prevIgnoreSize:!0,_textureFile:"",_progressBarTextureFile:"",_slidBallNormalTextureFile:"",_slidBallPressedTextureFile:"",_slidBallDisabledTextureFile:"",_capInsetsBarRenderer:null,_capInsetsProgressBarRenderer:null,_sliderEventListener:null, _sliderEventSelector:null,_barTexType:ccui.Widget.LOCAL_TEXTURE,_progressBarTexType:ccui.Widget.LOCAL_TEXTURE,_ballNTexType:ccui.Widget.LOCAL_TEXTURE,_ballPTexType:ccui.Widget.LOCAL_TEXTURE,_ballDTexType:ccui.Widget.LOCAL_TEXTURE,_isTextureLoaded:!1,_className:"Slider",_barRendererAdaptDirty:!0,_progressBarRendererDirty:!0,_unifySize:!1,_zoomScale:0.1,_sliderBallNormalTextureScaleX:1,_sliderBallNormalTextureScaleY:1,ctor:function(a,b,c){this._barTextureSize=cc.size(0,0);this._progressBarTextureSize= cc.size(0,0);this._capInsetsBarRenderer=cc.rect(0,0,0,0);this._capInsetsProgressBarRenderer=cc.rect(0,0,0,0);ccui.Widget.prototype.ctor.call(this);c=c||0;this.setTouchEnabled(!0);a&&this.loadBarTexture(a,c);b&&this.loadSlidBallTextures(b,c)},_initRenderer:function(){this._barRenderer=new cc.Sprite;this._progressBarRenderer=new cc.Sprite;this._progressBarRenderer.setAnchorPoint(0,0.5);this.addProtectedChild(this._barRenderer,ccui.Slider.BASEBAR_RENDERER_ZORDER,-1);this.addProtectedChild(this._progressBarRenderer, ccui.Slider.PROGRESSBAR_RENDERER_ZORDER,-1);this._slidBallNormalRenderer=new cc.Sprite;this._slidBallPressedRenderer=new cc.Sprite;this._slidBallPressedRenderer.setVisible(!1);this._slidBallDisabledRenderer=new cc.Sprite;this._slidBallDisabledRenderer.setVisible(!1);this._slidBallRenderer=new cc.Node;this._slidBallRenderer.addChild(this._slidBallNormalRenderer);this._slidBallRenderer.addChild(this._slidBallPressedRenderer);this._slidBallRenderer.addChild(this._slidBallDisabledRenderer);this._slidBallRenderer.setCascadeColorEnabled(!0); this._slidBallRenderer.setCascadeOpacityEnabled(!0);this.addProtectedChild(this._slidBallRenderer,ccui.Slider.BALL_RENDERER_ZORDER,-1)},loadBarTexture:function(a,b){if(a){b=b||ccui.Widget.LOCAL_TEXTURE;this._textureFile=a;this._barTexType=b;var c=this._barRenderer,d=this;c._textureLoaded||c.addEventListener("load",function(){d.loadBarTexture(d._textureFile,d._barTexType)});switch(this._barTexType){case ccui.Widget.LOCAL_TEXTURE:c.initWithFile(a);break;case ccui.Widget.PLIST_TEXTURE:c.initWithSpriteFrameName(a)}this._updateChildrenDisplayedRGBA(); this._progressBarRendererDirty=this._barRendererAdaptDirty=!0;this._updateContentSizeWithTextureSize(this._barRenderer.getContentSize());this._findLayout();this._barTextureSize=this._barRenderer.getContentSize()}},loadProgressBarTexture:function(a,b){if(a){b=b||ccui.Widget.LOCAL_TEXTURE;this._progressBarTextureFile=a;this._progressBarTexType=b;var c=this._progressBarRenderer,d=this;c._textureLoaded||c.addEventListener("load",function(){d.loadProgressBarTexture(d._progressBarTextureFile,d._progressBarTexType)}); switch(this._progressBarTexType){case ccui.Widget.LOCAL_TEXTURE:c.initWithFile(a);break;case ccui.Widget.PLIST_TEXTURE:c.initWithSpriteFrameName(a)}this._updateChildrenDisplayedRGBA();this._progressBarRenderer.setAnchorPoint(cc.p(0,0.5));c=this._progressBarRenderer.getContentSize();this._progressBarTextureSize={width:c.width,height:c.height};this._progressBarRendererDirty=!0;this._findLayout()}},setScale9Enabled:function(a){this._scale9Enabled!==a&&(this._scale9Enabled=a,this.removeProtectedChild(this._barRenderer, !0),this.removeProtectedChild(this._progressBarRenderer,!0),this._progressBarRenderer=this._barRenderer=null,this._scale9Enabled?(this._barRenderer=new ccui.Scale9Sprite,this._progressBarRenderer=new ccui.Scale9Sprite):(this._barRenderer=new cc.Sprite,this._progressBarRenderer=new cc.Sprite),this.loadBarTexture(this._textureFile,this._barTexType),this.loadProgressBarTexture(this._progressBarTextureFile,this._progressBarTexType),this.addProtectedChild(this._barRenderer,ccui.Slider.BASEBAR_RENDERER_ZORDER, -1),this.addProtectedChild(this._progressBarRenderer,ccui.Slider.PROGRESSBAR_RENDERER_ZORDER,-1),this._scale9Enabled?(a=this._ignoreSize,this.ignoreContentAdaptWithSize(!1),this._prevIgnoreSize=a):this.ignoreContentAdaptWithSize(this._prevIgnoreSize),this.setCapInsetsBarRenderer(this._capInsetsBarRenderer),this.setCapInsetProgressBarRenderer(this._capInsetsProgressBarRenderer),this._progressBarRendererDirty=this._barRendererAdaptDirty=!0)},isScale9Enabled:function(){return this._scale9Enabled},ignoreContentAdaptWithSize:function(a){if(!this._scale9Enabled|| this._scale9Enabled&&!a)ccui.Widget.prototype.ignoreContentAdaptWithSize.call(this,a),this._prevIgnoreSize=a},setCapInsets:function(a){this.setCapInsetsBarRenderer(a);this.setCapInsetProgressBarRenderer(a)},setCapInsetsBarRenderer:function(a){if(a){var b=this._capInsetsBarRenderer;b.x=a.x;b.y=a.y;b.width=a.width;b.height=a.height;this._scale9Enabled&&this._barRenderer.setCapInsets(a)}},getCapInsetsBarRenderer:function(){return cc.rect(this._capInsetsBarRenderer)},setCapInsetProgressBarRenderer:function(a){if(a){var b= this._capInsetsProgressBarRenderer;b.x=a.x;b.y=a.y;b.width=a.width;b.height=a.height;this._scale9Enabled&&this._progressBarRenderer.setCapInsets(a)}},getCapInsetsProgressBarRenderer:function(){return cc.rect(this._capInsetsProgressBarRenderer)},loadSlidBallTextures:function(a,b,c,d){this.loadSlidBallTextureNormal(a,d);this.loadSlidBallTexturePressed(b,d);this.loadSlidBallTextureDisabled(c,d)},loadSlidBallTextureNormal:function(a,b){if(a){b=b||ccui.Widget.LOCAL_TEXTURE;this._slidBallNormalTextureFile= a;this._ballNTexType=b;var c=this;this._slidBallNormalRenderer._textureLoaded||this._slidBallNormalRenderer.addEventListener("load",function(){c.loadSlidBallTextureNormal(c._slidBallNormalTextureFile,c._ballNTexType)});switch(this._ballNTexType){case ccui.Widget.LOCAL_TEXTURE:this._slidBallNormalRenderer.initWithFile(a);break;case ccui.Widget.PLIST_TEXTURE:this._slidBallNormalRenderer.initWithSpriteFrameName(a)}this._updateChildrenDisplayedRGBA();this._findLayout()}},loadSlidBallTexturePressed:function(a, b){if(a){b=b||ccui.Widget.LOCAL_TEXTURE;this._slidBallPressedTextureFile=a;this._ballPTexType=b;var c=this;this._slidBallPressedRenderer._textureLoaded||this._slidBallPressedRenderer.addEventListener("load",function(){c.loadSlidBallTexturePressed(c._slidBallPressedTextureFile,c._ballPTexType)});switch(this._ballPTexType){case ccui.Widget.LOCAL_TEXTURE:this._slidBallPressedRenderer.initWithFile(a);break;case ccui.Widget.PLIST_TEXTURE:this._slidBallPressedRenderer.initWithSpriteFrameName(a)}this._updateChildrenDisplayedRGBA(); this._findLayout()}},loadSlidBallTextureDisabled:function(a,b){if(a){b=b||ccui.Widget.LOCAL_TEXTURE;this._slidBallDisabledTextureFile=a;this._ballDTexType=b;var c=this;this._slidBallDisabledRenderer._textureLoaded||this._slidBallDisabledRenderer.addEventListener("load",function(){c.loadSlidBallTextureDisabled(c._slidBallDisabledTextureFile,c._ballDTexType)});switch(this._ballDTexType){case ccui.Widget.LOCAL_TEXTURE:this._slidBallDisabledRenderer.initWithFile(a);break;case ccui.Widget.PLIST_TEXTURE:this._slidBallDisabledRenderer.initWithSpriteFrameName(a)}this._updateChildrenDisplayedRGBA(); this._findLayout()}},setPercent:function(a){100a&&(a=0);this._percent=a;a=a/100*this._barLength;this._slidBallRenderer.setPosition(a,this._contentSize.height/2);if(this._scale9Enabled)this._progressBarRenderer.setPreferredSize(cc.size(a,this._contentSize.height));else{var b=this._progressBarRenderer,c=b.getTextureRect();b.setTextureRect(cc.rect(c.x,c.y,a/b._scaleX,c.height),b.isTextureRectRotated())}},hitTest:function(a){a=this._slidBallNormalRenderer.convertToNodeSpace(a);var b=this._slidBallNormalRenderer.getContentSize(), b=cc.rect(0,0,b.width,b.height);return a.x>=b.x&&a.x<=b.x+b.width&&a.y>=b.y&&a.y<=b.y+b.height},onTouchBegan:function(a,b){var c=ccui.Widget.prototype.onTouchBegan.call(this,a,b);if(this._hit){var d=this.convertToNodeSpace(this._touchBeganPosition);this.setPercent(this._getPercentWithBallPos(d.x));this._percentChangedEvent()}return c},onTouchMoved:function(a,b){var c=a.getLocation(),c=this.convertToNodeSpace(c);this.setPercent(this._getPercentWithBallPos(c.x));this._percentChangedEvent()},onTouchEnded:function(a, b){ccui.Widget.prototype.onTouchEnded.call(this,a,b)},onTouchCancelled:function(a,b){ccui.Widget.prototype.onTouchCancelled.call(this,a,b)},_getPercentWithBallPos:function(a){return a/this._barLength*100},addEventListenerSlider:function(a,b){this.addEventListener(a,b)},addEventListener:function(a,b){this._sliderEventSelector=a;this._sliderEventListener=b},_percentChangedEvent:function(){this._sliderEventSelector&&(this._sliderEventListener?this._sliderEventSelector.call(this._sliderEventListener, this,ccui.Slider.EVENT_PERCENT_CHANGED):this._sliderEventSelector(this,ccui.Slider.EVENT_PERCENT_CHANGED));this._ccEventCallback&&this._ccEventCallback(this,ccui.Slider.EVENT_PERCENT_CHANGED)},getPercent:function(){return this._percent},_onSizeChanged:function(){ccui.Widget.prototype._onSizeChanged.call(this);this._progressBarRendererDirty=this._barRendererAdaptDirty=!0},_adaptRenderers:function(){this._barRendererAdaptDirty&&(this._barRendererScaleChangedWithSize(),this._barRendererAdaptDirty=!1); this._progressBarRendererDirty&&(this._progressBarRendererScaleChangedWithSize(),this._progressBarRendererDirty=!1)},getVirtualRendererSize:function(){return this._barRenderer.getContentSize()},getVirtualRenderer:function(){return this._barRenderer},_barRendererScaleChangedWithSize:function(){if(this._unifySize)this._barLength=this._contentSize.width,this._barRenderer.setPreferredSize(this._contentSize);else if(this._ignoreSize)this._barRenderer.setScale(1),this._barLength=this._contentSize.width; else if(this._barLength=this._contentSize.width,this._scale9Enabled)this._barRenderer.setPreferredSize(this._contentSize),this._barRenderer.setScale(1);else{var a=this._barTextureSize;if(0>=a.width||0>=a.height)this._barRenderer.setScale(1);else{var b=this._contentSize.height/a.height;this._barRenderer.setScaleX(this._contentSize.width/a.width);this._barRenderer.setScaleY(b)}}this._barRenderer.setPosition(this._contentSize.width/2,this._contentSize.height/2);this.setPercent(this._percent)},_progressBarRendererScaleChangedWithSize:function(){if(this._unifySize)this._progressBarRenderer.setPreferredSize(this._contentSize); else if(this._ignoreSize){if(!this._scale9Enabled){var a=this._progressBarTextureSize,b=this._contentSize.width/a.width,a=this._contentSize.height/a.height;this._progressBarRenderer.setScaleX(b);this._progressBarRenderer.setScaleY(a)}}else if(this._scale9Enabled)this._progressBarRenderer.setPreferredSize(this._contentSize),this._progressBarRenderer.setScale(1);else{a=this._progressBarTextureSize;if(0>=a.width||0>=a.height){this._progressBarRenderer.setScale(1);return}b=this._contentSize.width/a.width; a=this._contentSize.height/a.height;this._progressBarRenderer.setScaleX(b);this._progressBarRenderer.setScaleY(a)}this._progressBarRenderer.setPosition(0,this._contentSize.height/2);this.setPercent(this._percent)},_onPressStateChangedToNormal:function(){this._slidBallNormalRenderer.setVisible(!0);this._slidBallPressedRenderer.setVisible(!1);this._slidBallDisabledRenderer.setVisible(!1);this._slidBallNormalRenderer.setScale(this._sliderBallNormalTextureScaleX,this._sliderBallNormalTextureScaleY);cc._renderType=== cc.game.RENDER_TYPE_WEBGL&&(this._slidBallNormalRenderer._renderCmd._shaderProgram=this._getNormalGLProgram())},_onPressStateChangedToPressed:function(){this._slidBallPressedTextureFile?(this._slidBallNormalRenderer.setVisible(!1),this._slidBallPressedRenderer.setVisible(!0),this._slidBallDisabledRenderer.setVisible(!1)):this._slidBallNormalRenderer.setScale(this._sliderBallNormalTextureScaleX+this._zoomScale,this._sliderBallNormalTextureScaleY+this._zoomScale);cc._renderType===cc.game.RENDER_TYPE_WEBGL&& (this._slidBallNormalRenderer._renderCmd._shaderProgram=this._getNormalGLProgram())},_onPressStateChangedToDisabled:function(){this._slidBallDisabledTextureFile?(this._slidBallNormalRenderer.setVisible(!1),this._slidBallDisabledRenderer.setVisible(!0)):(this._slidBallNormalRenderer.setVisible(!0),cc._renderType===cc.game.RENDER_TYPE_WEBGL&&(this._slidBallNormalRenderer._renderCmd._shaderProgram=this._getGrayGLProgram()));this._slidBallNormalRenderer.setScale(this._sliderBallNormalTextureScaleX,this._sliderBallNormalTextureScaleY); this._slidBallPressedRenderer.setVisible(!1)},setZoomScale:function(a){this._zoomScale=a},getZoomScale:function(){return this._zoomScale},getSlidBallNormalRenderer:function(){return this._slidBallNormalRenderer},getSlidBallPressedRenderer:function(){return this._slidBallPressedRenderer},getSlidBallDisabledRenderer:function(){return this._slidBallDisabledRenderer},getSlidBallRenderer:function(){return this._slidBallRenderer},getDescription:function(){return"Slider"},_createCloneInstance:function(){return new ccui.Slider}, _copySpecialProperties:function(a){this._prevIgnoreSize=a._prevIgnoreSize;this.setScale9Enabled(a._scale9Enabled);this.loadBarTexture(a._textureFile,a._barTexType);this.loadProgressBarTexture(a._progressBarTextureFile,a._progressBarTexType);this.loadSlidBallTextureNormal(a._slidBallNormalTextureFile,a._ballNTexType);this.loadSlidBallTexturePressed(a._slidBallPressedTextureFile,a._ballPTexType);this.loadSlidBallTextureDisabled(a._slidBallDisabledTextureFile,a._ballDTexType);this.setPercent(a.getPercent()); this._sliderEventListener=a._sliderEventListener;this._sliderEventSelector=a._sliderEventSelector;this._zoomScale=a._zoomScale;this._ccEventCallback=a._ccEventCallback}});_p=ccui.Slider.prototype;cc.defineGetterSetter(_p,"percent",_p.getPercent,_p.setPercent);_p=null;ccui.Slider.create=function(a,b,c){return new ccui.Slider(a,b,c)};ccui.Slider.EVENT_PERCENT_CHANGED=0;ccui.Slider.BASEBAR_RENDERER_ZORDER=-3;ccui.Slider.PROGRESSBAR_RENDERER_ZORDER=-2;ccui.Slider.BALL_RENDERER_ZORDER=-1;ccui.Text=ccui.Widget.extend({_touchScaleChangeEnabled:!1,_normalScaleValueX:1,_normalScaleValueY:1,_fontName:"Arial",_fontSize:16,_onSelectedScaleOffset:0.5,_labelRenderer:null,_textAreaSize:null,_textVerticalAlignment:0,_textHorizontalAlignment:0,_className:"Text",_type:null,_labelRendererAdaptDirty:!0,ctor:function(a,b,c){this._type=ccui.Text.Type.SYSTEM;this._textAreaSize=cc.size(0,0);ccui.Widget.prototype.ctor.call(this);void 0!==c?(this.setFontName(b),this.setFontSize(c),this.setString(a)): this.setFontName(this._fontName)},_initRenderer:function(){this._labelRenderer=new cc.LabelTTF;this.addProtectedChild(this._labelRenderer,ccui.Text.RENDERER_ZORDER,-1)},setText:function(a){cc.log("Please use the setString");this.setString(a)},setString:function(a){a!==this._labelRenderer.getString()&&(this._labelRenderer.setString(a),this._updateContentSizeWithTextureSize(this._labelRenderer.getContentSize()),this._labelRendererAdaptDirty=!0)},_setString:function(a){a!==this._labelRenderer.getString()&& (this._labelRenderer.setString(a),this._labelRendererAdaptDirty=!0)},getStringValue:function(){cc.log("Please use the getString");return this._labelRenderer.getString()},getString:function(){return this._labelRenderer.getString()},getStringLength:function(){return this._labelRenderer.getStringLength()},setFontSize:function(a){this._labelRenderer.setFontSize(a);this._fontSize=a;this._updateContentSizeWithTextureSize(this._labelRenderer.getContentSize());this._labelRendererAdaptDirty=!0},_setFontSize:function(a){this._labelRenderer.setFontSize(a); this._fontSize=a;this._labelRendererAdaptDirty=!0},getFontSize:function(){return this._fontSize},setFontName:function(a){this._fontName=a;this._labelRenderer.setFontName(a);this._updateContentSizeWithTextureSize(this._labelRenderer.getContentSize());this._labelRendererAdaptDirty=!0},_setFontName:function(a){this._fontName=a;this._labelRenderer.setFontName(a);this._labelRendererAdaptDirty=!0},_updateUITextContentSize:function(){this._updateContentSizeWithTextureSize(this._labelRenderer.getContentSize())}, getFontName:function(){return this._fontName},_setFont:function(a){var b=cc.LabelTTF._fontStyleRE.exec(a);b&&(this._fontSize=parseInt(b[1]),this._fontName=b[2],this._labelRenderer._setFont(a),this._labelScaleChangedWithSize())},_getFont:function(){return this._labelRenderer._getFont()},getType:function(){return this._type},setTextAreaSize:function(a){this._labelRenderer.setDimensions(a);this._ignoreSize||(this._customSize=a);this._updateContentSizeWithTextureSize(this._labelRenderer.getContentSize()); this._labelRendererAdaptDirty=!0},_setTextAreaSize:function(a){this._labelRenderer.setDimensions(a);this._ignoreSize||(this._customSize=a);this._labelRendererAdaptDirty=!0},getTextAreaSize:function(){return this._labelRenderer.getDimensions()},setTextHorizontalAlignment:function(a){this._labelRenderer.setHorizontalAlignment(a);this._updateContentSizeWithTextureSize(this._labelRenderer.getContentSize());this._labelRendererAdaptDirty=!0},_setTextHorizontalAlignment:function(a){this._labelRenderer.setHorizontalAlignment(a); this._labelRendererAdaptDirty=!0},getTextHorizontalAlignment:function(){return this._labelRenderer.getHorizontalAlignment()},setTextVerticalAlignment:function(a){this._labelRenderer.setVerticalAlignment(a);this._updateContentSizeWithTextureSize(this._labelRenderer.getContentSize());this._labelRendererAdaptDirty=!0},_setTextVerticalAlignment:function(a){this._labelRenderer.setVerticalAlignment(a);this._labelRendererAdaptDirty=!0},getTextVerticalAlignment:function(){return this._labelRenderer.getVerticalAlignment()}, setTouchScaleChangeEnabled:function(a){this._touchScaleChangeEnabled=a},isTouchScaleChangeEnabled:function(){return this._touchScaleChangeEnabled},_onPressStateChangedToNormal:function(){this._touchScaleChangeEnabled&&(this._labelRenderer.setScaleX(this._normalScaleValueX),this._labelRenderer.setScaleY(this._normalScaleValueY))},_onPressStateChangedToPressed:function(){this._touchScaleChangeEnabled&&(this._labelRenderer.setScaleX(this._normalScaleValueX+this._onSelectedScaleOffset),this._labelRenderer.setScaleY(this._normalScaleValueY+ this._onSelectedScaleOffset))},_onPressStateChangedToDisabled:function(){},_onSizeChanged:function(){ccui.Widget.prototype._onSizeChanged.call(this);this._labelRendererAdaptDirty=!0},_adaptRenderers:function(){this._labelRendererAdaptDirty&&(this._labelScaleChangedWithSize(),this._labelRendererAdaptDirty=!1)},getVirtualRendererSize:function(){return this._labelRenderer.getContentSize()},getVirtualRenderer:function(){return this._labelRenderer},getAutoRenderSize:function(){var a=this._labelRenderer.getContentSize(); this._ignoreSize||(this._labelRenderer.setDimensions(0,0),a=this._labelRenderer.getContentSize(),this._labelRenderer.setDimensions(this._contentSize.width,this._contentSize.height));return a},_labelScaleChangedWithSize:function(){var a=this._contentSize;if(this._ignoreSize)this._labelRenderer.setDimensions(0,0),this._labelRenderer.setScale(1),this._normalScaleValueX=this._normalScaleValueY=1;else{this._labelRenderer.setDimensions(cc.size(a.width,a.height));var b=this._labelRenderer.getContentSize(); if(0>=b.width||0>=b.height){this._labelRenderer.setScale(1);return}var c=a.width/b.width,b=a.height/b.height;this._labelRenderer.setScaleX(c);this._labelRenderer.setScaleY(b);this._normalScaleValueX=c;this._normalScaleValueY=b}this._labelRenderer.setPosition(a.width/2,a.height/2)},getDescription:function(){return"Label"},enableShadow:function(a,b,c){this._labelRenderer.enableShadow(a,b,c)},enableOutline:function(a,b){this._labelRenderer.enableStroke(a,b)},enableGlow:function(a){this._type===ccui.Text.Type.TTF&& this._labelRenderer.enableGlow(a)},disableEffect:function(){this._labelRenderer.disableEffect&&this._labelRenderer.disableEffect()},_createCloneInstance:function(){return new ccui.Text},_copySpecialProperties:function(a){a instanceof ccui.Text&&(this.setFontName(a._fontName),this.setFontSize(a.getFontSize()),this.setString(a.getString()),this.setTouchScaleChangeEnabled(a.touchScaleEnabled),this.setTextAreaSize(a._textAreaSize),this.setTextHorizontalAlignment(a._labelRenderer.getHorizontalAlignment()), this.setTextVerticalAlignment(a._labelRenderer.getVerticalAlignment()),this.setContentSize(a.getContentSize()),this.setTextColor(a.getTextColor()))},_setBoundingWidth:function(a){this._textAreaSize.width=a;this._labelRenderer._setBoundingWidth(a);this._labelScaleChangedWithSize()},_setBoundingHeight:function(a){this._textAreaSize.height=a;this._labelRenderer._setBoundingHeight(a);this._labelScaleChangedWithSize()},_getBoundingWidth:function(){return this._textAreaSize.width},_getBoundingHeight:function(){return this._textAreaSize.height}, _changePosition:function(){this._adaptRenderers()},setColor:function(a){cc.ProtectedNode.prototype.setColor.call(this,a);this._labelRenderer.setColor(a)},setTextColor:function(a){this._labelRenderer.setFontFillColor(a)},getTextColor:function(){return this._labelRenderer._getFillStyle()}});_p=ccui.Text.prototype;cc.defineGetterSetter(_p,"boundingWidth",_p._getBoundingWidth,_p._setBoundingWidth);cc.defineGetterSetter(_p,"boundingHeight",_p._getBoundingHeight,_p._setBoundingHeight); cc.defineGetterSetter(_p,"string",_p.getString,_p.setString);cc.defineGetterSetter(_p,"stringLength",_p.getStringLength);cc.defineGetterSetter(_p,"font",_p._getFont,_p._setFont);cc.defineGetterSetter(_p,"fontSize",_p.getFontSize,_p.setFontSize);cc.defineGetterSetter(_p,"fontName",_p.getFontName,_p.setFontName);cc.defineGetterSetter(_p,"textAlign",_p.getTextHorizontalAlignment,_p.setTextHorizontalAlignment);cc.defineGetterSetter(_p,"verticalAlign",_p.getTextVerticalAlignment,_p.setTextVerticalAlignment); _p=null;ccui.Label=ccui.Text.create=function(a,b,c){return new ccui.Text(a,b,c)};ccui.Text.RENDERER_ZORDER=-1;ccui.Text.Type={SYSTEM:0,TTF:1};ccui.TextAtlas=ccui.Widget.extend({_labelAtlasRenderer:null,_stringValue:"",_charMapFileName:"",_itemWidth:0,_itemHeight:0,_startCharMap:"",_className:"TextAtlas",_labelAtlasRendererAdaptDirty:null,ctor:function(a,b,c,d,e){ccui.Widget.prototype.ctor.call(this);void 0!==e&&this.setProperty(a,b,c,d,e)},_initRenderer:function(){this._labelAtlasRenderer=new cc.LabelAtlas;this._labelAtlasRenderer.setAnchorPoint(cc.p(0.5,0.5));this.addProtectedChild(this._labelAtlasRenderer,ccui.TextAtlas.RENDERER_ZORDER, -1);this._labelAtlasRenderer.addEventListener("load",function(){this._updateContentSizeWithTextureSize(this._labelAtlasRenderer.getContentSize());this._findLayout()},this)},setProperty:function(a,b,c,d,e){this._stringValue=a;this._charMapFileName=b;this._itemWidth=c;this._itemHeight=d;this._startCharMap=e;this._labelAtlasRenderer.initWithString(a,this._charMapFileName,this._itemWidth,this._itemHeight,this._startCharMap[0]);this._updateContentSizeWithTextureSize(this._labelAtlasRenderer.getContentSize()); this._labelAtlasRendererAdaptDirty=!0},setString:function(a){a!==this._labelAtlasRenderer.getString()&&(this._stringValue=a,this._labelAtlasRenderer.setString(a),this._updateContentSizeWithTextureSize(this._labelAtlasRenderer.getContentSize()),this._labelAtlasRendererAdaptDirty=!0)},setStringValue:function(a){cc.log("Please use the setString");this.setString(a)},getStringValue:function(){cc.log("Please use the getString");return this.getString()},getString:function(){return this._labelAtlasRenderer.getString()}, getStringLength:function(){return this._labelAtlasRenderer.getStringLength()},_onSizeChanged:function(){ccui.Widget.prototype._onSizeChanged.call(this);this._labelAtlasRendererAdaptDirty=!0},_adaptRenderers:function(){this._labelAtlasRendererAdaptDirty&&(this._labelAtlasScaleChangedWithSize(),this._labelAtlasRendererAdaptDirty=!1)},getVirtualRendererSize:function(){return this._labelAtlasRenderer.getContentSize()},getVirtualRenderer:function(){return this._labelAtlasRenderer},_labelAtlasScaleChangedWithSize:function(){var a= this._labelAtlasRenderer;if(this._ignoreSize)a.setScale(1);else{var b=a.getContentSize();if(0>=b.width||0>=b.height){a.setScale(1);return}a.setScaleX(this._contentSize.width/b.width);a.setScaleY(this._contentSize.height/b.height)}a.setPosition(this._contentSize.width/2,this._contentSize.height/2)},getDescription:function(){return"LabelAtlas"},_copySpecialProperties:function(a){a&&this.setProperty(a._stringValue,a._charMapFileName,a._itemWidth,a._itemHeight,a._startCharMap)},_createCloneInstance:function(){return new ccui.TextAtlas}}); _p=ccui.TextAtlas.prototype;cc.defineGetterSetter(_p,"string",_p.getString,_p.setString);_p=null;ccui.TextAtlas.create=function(a,b,c,d,e){return new ccui.TextAtlas(a,b,c,d,e)};ccui.TextAtlas.RENDERER_ZORDER=-1;ccui.LabelBMFont=ccui.TextBMFont=ccui.Widget.extend({_labelBMFontRenderer:null,_fntFileHasInit:!1,_fntFileName:"",_stringValue:"",_className:"TextBMFont",_labelBMFontRendererAdaptDirty:!0,ctor:function(a,b){ccui.Widget.prototype.ctor.call(this);this._loader=new cc.Sprite.LoadManager;void 0!==b&&(this.setFntFile(b),this.setString(a))},_initRenderer:function(){this._labelBMFontRenderer=new cc.LabelBMFont;this.addProtectedChild(this._labelBMFontRenderer,ccui.TextBMFont.RENDERER_ZORDER,-1)},setFntFile:function(a){if(a){this._fntFileName= a;this._fntFileHasInit=!0;this._labelBMFontRenderer.initWithString(this._stringValue,a);this._updateContentSizeWithTextureSize(this._labelBMFontRenderer.getContentSize());this._labelBMFontRendererAdaptDirty=!0;var b=this;a=b._labelBMFontRenderer;a._textureLoaded||a.addEventListener("load",function(){b.setFntFile(b._fntFileName)})}},setText:function(a){cc.log("Please use the setString");this.setString(a)},setString:function(a){this._loader.clear();this._labelBMFontRenderer._textureLoaded?a!==this._labelBMFontRenderer.getString()&& (this._stringValue=a,this._labelBMFontRenderer.setString(a),this._fntFileHasInit&&(this._updateContentSizeWithTextureSize(this._labelBMFontRenderer.getContentSize()),this._labelBMFontRendererAdaptDirty=!0)):this._loader.add(this._labelBMFontRenderer,function(){this.setString(a)},this)},getString:function(){return this._stringValue},getStringLength:function(){return this._labelBMFontRenderer.getStringLength()},_onSizeChanged:function(){ccui.Widget.prototype._onSizeChanged.call(this);this._labelBMFontRendererAdaptDirty= !0},_adaptRenderers:function(){this._labelBMFontRendererAdaptDirty&&(this._labelBMFontScaleChangedWithSize(),this._labelBMFontRendererAdaptDirty=!1)},getVirtualRendererSize:function(){return this._labelBMFontRenderer.getContentSize()},getVirtualRenderer:function(){return this._labelBMFontRenderer},_labelBMFontScaleChangedWithSize:function(){var a=this._labelBMFontRenderer;if(this._ignoreSize)a.setScale(1);else{var b=a.getContentSize();if(0>=b.width||0>=b.height){a.setScale(1);return}a.setScaleX(this._contentSize.width/ b.width);a.setScaleY(this._contentSize.height/b.height)}a.setPosition(this._contentSize.width/2,this._contentSize.height/2)},getDescription:function(){return"TextBMFont"},_createCloneInstance:function(){return new ccui.TextBMFont},_copySpecialProperties:function(a){this.setFntFile(a._fntFileName);this.setString(a._stringValue)}});_p=ccui.TextBMFont.prototype;cc.defineGetterSetter(_p,"string",_p.getString,_p.setString);_p=null;ccui.TextBMFont.create=function(a,b){return new ccui.TextBMFont(a,b)}; ccui.TextBMFont.RENDERER_ZORDER=-1;ccui._TextFieldRenderer=cc.TextFieldTTF.extend({_maxLengthEnabled:!1,_maxLength:0,_passwordEnabled:!1,_passwordStyleText:"",_attachWithIME:!1,_detachWithIME:!1,_insertText:!1,_deleteBackward:!1,_className:"_TextFieldRenderer",ctor:function(){cc.TextFieldTTF.prototype.ctor.call(this);this._maxLengthEnabled=!1;this._maxLength=0;this._passwordEnabled=!1;this._passwordStyleText="*";this._deleteBackward=this._insertText=this._detachWithIME=this._attachWithIME=!1},onEnter:function(){cc.TextFieldTTF.prototype.onEnter.call(this); cc.TextFieldTTF.prototype.setDelegate.call(this,this)},onTextFieldAttachWithIME:function(a){this.setAttachWithIME(!0);return!1},onTextFieldInsertText:function(a,b,c){if(1===c&&"\n"===b)return!1;this.setInsertText(!0);return this._maxLengthEnabled&&cc.TextFieldTTF.prototype.getCharCount.call(this)>=this._maxLength},onTextFieldDeleteBackward:function(a,b,c){this.setDeleteBackward(!0);return!1},onTextFieldDetachWithIME:function(a){this.setDetachWithIME(!0);return!1},insertText:function(a,b){"\n"!==a&& this._maxLengthEnabled&&this.getString().length>=this._maxLength?this._passwordEnabled&&this.setPasswordText(this.getString()):(cc.TextFieldTTF.prototype.insertText.call(this,a,b),this._passwordEnabled&&0b||126this._maxLength&&(a=this._maxLength);for(c=0;c=b.x&&a.x<=b.x+b.width&&a.y>=b.y&&a.y<=b.y+b.height}return ccui.Widget.prototype.hitTest.call(this,a)},getTouchSize:function(){return cc.size(this._touchWidth,this._touchHeight)},setText:function(a){cc.log("Please use the setString");this.setString(a)},setString:function(a){null!=a&&(a=String(a),this.isMaxLengthEnabled()&&(a=a.substr(0,this.getMaxLength())),this.isPasswordEnabled()?(this._textFieldRenderer.setPasswordText(a),this._textFieldRenderer.setString(""),this._textFieldRenderer.insertText(a, a.length)):this._textFieldRenderer.setString(a),this._textFieldRendererAdaptDirty=!0,this._updateContentSizeWithTextureSize(this._textFieldRenderer.getContentSize()))},setPlaceHolder:function(a){this._textFieldRenderer.setPlaceHolder(a);this._textFieldRendererAdaptDirty=!0;this._updateContentSizeWithTextureSize(this._textFieldRenderer.getContentSize())},getPlaceHolder:function(){return this._textFieldRenderer.getPlaceHolder()},getPlaceHolderColor:function(){return this._textFieldRenderer.getPlaceHolderColor()}, setPlaceHolderColor:function(a){this._textFieldRenderer.setColorSpaceHolder(a)},setTextColor:function(a){this._textFieldRenderer.setTextColor(a)},setFontSize:function(a){this._textFieldRenderer.setFontSize(a);this._fontSize=a;this._textFieldRendererAdaptDirty=!0;this._updateContentSizeWithTextureSize(this._textFieldRenderer.getContentSize())},getFontSize:function(){return this._fontSize},setFontName:function(a){this._textFieldRenderer.setFontName(a);this._fontName=a;this._textFieldRendererAdaptDirty= !0;this._updateContentSizeWithTextureSize(this._textFieldRenderer.getContentSize())},getFontName:function(){return this._fontName},didNotSelectSelf:function(){this._textFieldRenderer.detachWithIME()},getStringValue:function(){cc.log("Please use the getString");return this.getString()},getString:function(){return this._textFieldRenderer.getString()},getStringLength:function(){return this._textFieldRenderer.getStringLength()},onTouchBegan:function(a,b){var c=this,d=ccui.Widget.prototype.onTouchBegan.call(c, a,b);c._hit?setTimeout(function(){c._textFieldRenderer.attachWithIME()},0):setTimeout(function(){c._textFieldRenderer.detachWithIME()},0);return d},setMaxLengthEnabled:function(a){this._textFieldRenderer.setMaxLengthEnabled(a)},isMaxLengthEnabled:function(){return this._textFieldRenderer.isMaxLengthEnabled()},setMaxLength:function(a){this._textFieldRenderer.setMaxLength(a);this.setString(this.getString())},getMaxLength:function(){return this._textFieldRenderer.getMaxLength()},setPasswordEnabled:function(a){this._textFieldRenderer.setPasswordEnabled(a)}, isPasswordEnabled:function(){return this._textFieldRenderer.isPasswordEnabled()},setPasswordStyleText:function(a){this._textFieldRenderer.setPasswordStyleText(a);this._passwordStyleText=a;this.setString(this.getString())},getPasswordStyleText:function(){return this._passwordStyleText},update:function(a){this.getDetachWithIME()&&(this._detachWithIMEEvent(),this.setDetachWithIME(!1));this.getAttachWithIME()&&(this._attachWithIMEEvent(),this.setAttachWithIME(!1));this.getInsertText()&&(this._textFieldRendererAdaptDirty= !0,this._updateContentSizeWithTextureSize(this._textFieldRenderer.getContentSize()),this._insertTextEvent(),this.setInsertText(!1));this.getDeleteBackward()&&(this._textFieldRendererAdaptDirty=!0,this._updateContentSizeWithTextureSize(this._textFieldRenderer.getContentSize()),this._deleteBackwardEvent(),this.setDeleteBackward(!1))},getAttachWithIME:function(){return this._textFieldRenderer.getAttachWithIME()},setAttachWithIME:function(a){this._textFieldRenderer.setAttachWithIME(a)},getDetachWithIME:function(){return this._textFieldRenderer.getDetachWithIME()}, setDetachWithIME:function(a){this._textFieldRenderer.setDetachWithIME(a)},getInsertText:function(){return this._textFieldRenderer.getInsertText()},setInsertText:function(a){this._textFieldRenderer.setInsertText(a)},getDeleteBackward:function(){return this._textFieldRenderer.getDeleteBackward()},setDeleteBackward:function(a){this._textFieldRenderer.setDeleteBackward(a)},_attachWithIMEEvent:function(){this._textFieldEventSelector&&(this._textFieldEventListener?this._textFieldEventSelector.call(this._textFieldEventListener, this,ccui.TextField.EVENT_ATTACH_WITH_IME):this._textFieldEventSelector(this,ccui.TextField.EVENT_ATTACH_WITH_IME));this._ccEventCallback&&this._ccEventCallback(this,ccui.TextField.EVENT_ATTACH_WITH_IME)},_detachWithIMEEvent:function(){this._textFieldEventSelector&&(this._textFieldEventListener?this._textFieldEventSelector.call(this._textFieldEventListener,this,ccui.TextField.EVENT_DETACH_WITH_IME):this._textFieldEventSelector(this,ccui.TextField.EVENT_DETACH_WITH_IME));this._ccEventCallback&&this._ccEventCallback(this, ccui.TextField.EVENT_DETACH_WITH_IME)},_insertTextEvent:function(){this._textFieldEventSelector&&(this._textFieldEventListener?this._textFieldEventSelector.call(this._textFieldEventListener,this,ccui.TextField.EVENT_INSERT_TEXT):this._textFieldEventSelector(this,ccui.TextField.EVENT_INSERT_TEXT));this._ccEventCallback&&this._ccEventCallback(this,ccui.TextField.EVENT_INSERT_TEXT)},_deleteBackwardEvent:function(){this._textFieldEventSelector&&(this._textFieldEventListener?this._textFieldEventSelector.call(this._textFieldEventListener, this,ccui.TextField.EVENT_DELETE_BACKWARD):this._textFieldEventSelector(this,ccui.TextField.EVENT_DELETE_BACKWARD));this._ccEventCallback&&this._ccEventCallback(this,ccui.TextField.EVENT_DELETE_BACKWARD)},addEventListenerTextField:function(a,b){this.addEventListener(a,b)},addEventListener:function(a,b){this._textFieldEventSelector=a;this._textFieldEventListener=b},_onSizeChanged:function(){ccui.Widget.prototype._onSizeChanged.call(this);this._textFieldRendererAdaptDirty=!0},_adaptRenderers:function(){this._textFieldRendererAdaptDirty&& (this._textfieldRendererScaleChangedWithSize(),this._textFieldRendererAdaptDirty=!1)},_textfieldRendererScaleChangedWithSize:function(){this._ignoreSize||this._textFieldRenderer.setDimensions(this._contentSize);this._textFieldRenderer.setPosition(this._contentSize.width/2,this._contentSize.height/2)},getAutoRenderSize:function(){var a=this._textFieldRenderer.getContentSize();this._ignoreSize||(this._textFieldRenderer.setDimensions(0,0),a=this._textFieldRenderer.getContentSize(),this._textFieldRenderer.setDimensions(this._contentSize.width, this._contentSize.height));return a},getVirtualRendererSize:function(){return this._textFieldRenderer.getContentSize()},getVirtualRenderer:function(){return this._textFieldRenderer},getDescription:function(){return"TextField"},attachWithIME:function(){this._textFieldRenderer.attachWithIME()},_createCloneInstance:function(){return new ccui.TextField},_copySpecialProperties:function(a){this.setString(a._textFieldRenderer.getString());this.setPlaceHolder(a.getString());this.setFontSize(a._textFieldRenderer.getFontSize()); this.setFontName(a._textFieldRenderer.getFontName());this.setMaxLengthEnabled(a.isMaxLengthEnabled());this.setMaxLength(a.getMaxLength());this.setPasswordEnabled(a.isPasswordEnabled());this.setPasswordStyleText(a._passwordStyleText);this.setAttachWithIME(a.getAttachWithIME());this.setDetachWithIME(a.getDetachWithIME());this.setInsertText(a.getInsertText());this.setDeleteBackward(a.getDeleteBackward());this._ccEventCallback=a._ccEventCallback;this._textFieldEventListener=a._textFieldEventListener; this._textFieldEventSelector=a._textFieldEventSelector},setTextAreaSize:function(a){this.setContentSize(a)},setTextHorizontalAlignment:function(a){this._textFieldRenderer.setHorizontalAlignment(a)},setTextVerticalAlignment:function(a){this._textFieldRenderer.setVerticalAlignment(a)},_setFont:function(a){this._textFieldRenderer._setFont(a);this._textFieldRendererAdaptDirty=!0},_getFont:function(){return this._textFieldRenderer._getFont()},_changePosition:function(){this._adaptRenderers()}}); ccui.TextField.create=function(a,b,c){return new ccui.TextField(a,b,c)};_p=ccui.TextField.prototype;cc.defineGetterSetter(_p,"string",_p.getString,_p.setString);cc.defineGetterSetter(_p,"placeHolder",_p.getPlaceHolder,_p.setPlaceHolder);cc.defineGetterSetter(_p,"font",_p._getFont,_p._setFont);cc.defineGetterSetter(_p,"fontSize",_p.getFontSize,_p.setFontSize);cc.defineGetterSetter(_p,"fontName",_p.getFontName,_p.setFontName);cc.defineGetterSetter(_p,"maxLengthEnabled",_p.isMaxLengthEnabled,_p.setMaxLengthEnabled); cc.defineGetterSetter(_p,"maxLength",_p.getMaxLength,_p.setMaxLength);cc.defineGetterSetter(_p,"passwordEnabled",_p.isPasswordEnabled,_p.setPasswordEnabled);_p=null;ccui.TextField.EVENT_ATTACH_WITH_IME=0;ccui.TextField.EVENT_DETACH_WITH_IME=1;ccui.TextField.EVENT_INSERT_TEXT=2;ccui.TextField.EVENT_DELETE_BACKWARD=3;ccui.TextField.RENDERER_ZORDER=-1;ccui.VideoPlayer=ccui.Widget.extend({_played:!1,_playing:!1,_stopped:!0,ctor:function(a){ccui.Widget.prototype.ctor.call(this);this._EventList={};a&&this.setURL(a)},_createRenderCmd:function(){return new ccui.VideoPlayer.RenderCmd(this)},visit:function(){var a=this._renderCmd,b=cc.container,c=cc.eventManager;if(this._visible)b.appendChild(a._video),null===this._listener&&(this._listener=cc.eventManager.addCustomListener(cc.game.EVENT_RESIZE,function(){a.resize()}));else{var d=!1;(d="contains"in b? b.contains(a._video):b.compareDocumentPosition(a._video)%16)&&b.removeChild(a._video);c.removeListener(a._listener);a._listener=null}a.updateStatus();a.resize()},setURL:function(a){this._renderCmd.updateURL(a)},getURL:function(){return this._renderCmd._url},play:function(){var a=this,b=this._renderCmd._video;if(b){this._played=!0;b.pause();if(!1!==this._stopped||!1!==this._playing||!0!==this._played)b.currentTime=0;ccui.VideoPlayer._polyfill.autoplayAfterOperation?setTimeout(function(){b.play();a._playing= !0;a._stopped=!1},20):(b.play(),this._playing=!0,this._stopped=!1)}},pause:function(){var a=this._renderCmd._video;a&&!0===this._playing&&!1===this._stopped&&(a.pause(),this._playing=!1)},resume:function(){!1===this._stopped&&!1===this._playing&&!0===this._played&&this.play()},stop:function(){var a=this,b=this._renderCmd._video;b&&(b.pause(),b.currentTime=0,this._playing=!1,this._stopped=!0);setTimeout(function(){a._dispatchEvent(ccui.VideoPlayer.EventType.STOPPED)},0)},seekTo:function(a){var b=this._renderCmd._video; b&&(b.currentTime=a,ccui.VideoPlayer._polyfill.autoplayAfterOperation&&this.isPlaying()&&setTimeout(function(){b.play()},20))},isPlaying:function(){ccui.VideoPlayer._polyfill.autoplayAfterOperation&&this._playing&&setTimeout(function(){video.play()},20);return this._playing},setKeepAspectRatioEnabled:function(a){cc.log("On the web is always keep the aspect ratio")},isKeepAspectRatioEnabled:function(){return!1},setFullScreenEnabled:function(a){var b=this._renderCmd._video;b&&(a?cc.screen.requestFullScreen(b): cc.screen.exitFullScreen(b))},isFullScreenEnabled:function(){cc.log("Can't know status")},setEventListener:function(a,b){this._EventList[a]=b},removeEventListener:function(a){this._EventList[a]=null},_dispatchEvent:function(a){(a=this._EventList[a])&&a.call(this,this,this._renderCmd._video.src)},onPlayEvent:function(){var a=this._EventList[ccui.VideoPlayer.EventType.PLAYING];if(a)for(var b=0;bthis._leftSpaceWidth){var e=a.length*(1- -this._leftSpaceWidth/f),f=a.substr(0,e),g=a.substr(e,a.length-1),h=0this._leftSpaceWidth?(this._addNewLine(),this._pushToContainer(a), this._leftSpaceWidth-=b.width):this._pushToContainer(a)},_addNewLine:function(){this._leftSpaceWidth=this._customSize.width;this._elementRenders.push([])},formatRenderers:function(){var a=0,b=this._elementRenderersContainer,c=this._elementRenders,d,e,f,g,h,k;if(this._ignoreSize){d=0;f=c[0];for(e=g=0;e=this._elementRenders.length||this._elementRenders[this._elementRenders.length-1].push(a)},_adaptRenderers:function(){this.formatText()},setVerticalSpace:function(a){this._verticalSpace=a},setAnchorPoint:function(a){ccui.Widget.prototype.setAnchorPoint.call(this,a);this._elementRenderersContainer.setAnchorPoint(a)},_setAnchorX:function(a){ccui.Widget.prototype._setAnchorX.call(this,a);this._elementRenderersContainer._setAnchorX(a)}, _setAnchorY:function(a){ccui.Widget.prototype._setAnchorY.call(this,a);this._elementRenderersContainer._setAnchorY(a)},getVirtualRendererSize:function(){return this._elementRenderersContainer.getContentSize()},ignoreContentAdaptWithSize:function(a){this._ignoreSize!==a&&(this._formatTextDirty=!0,ccui.Widget.prototype.ignoreContentAdaptWithSize.call(this,a))},getContentSize:function(){this.formatText();return cc.Node.prototype.getContentSize.call(this)},_getWidth:function(){this.formatText();return cc.Node.prototype._getWidth.call(this)}, _getHeight:function(){this.formatText();return cc.Node.prototype._getHeight.call(this)},setContentSize:function(a,b){ccui.Widget.prototype.setContentSize.call(this,void 0===b?a.width:a,void 0===b?a.height:b);this._formatTextDirty=!0},getDescription:function(){return"RichText"},setCascadeOpacityEnabled:function(a){ccui.Widget.prototype.setCascadeOpacityEnabled.call(this,a);this._elementRenderersContainer.setCascadeOpacityEnabled(a)},setLineBreakOnSpace:function(a){this._lineBreakOnSpace=a;this._formatTextDirty= !0;this.formatText()},setTextHorizontalAlignment:function(a){a!==this._textHorizontalAlignment&&(this._textHorizontalAlignment=a,this.formatText())},setTextVerticalAlignment:function(a){a!==this._textVerticalAlignment&&(this._textVerticalAlignment=a,this.formatText())}});ccui.RichText.create=function(){return new ccui.RichText};ccui.RichElement.TEXT=0;ccui.RichElement.IMAGE=1;ccui.RichElement.CUSTOM=2;ccui.WebView=ccui.Widget.extend({ctor:function(a){ccui.Widget.prototype.ctor.call(this);this._EventList={};a&&this.loadURL(a)},visit:function(){var a=this._renderCmd,b=a._div,c=cc.container,d=cc.eventManager;if(this._visible)c.appendChild(b),null===this._listener&&(this._listener=d.addCustomListener(cc.game.EVENT_RESIZE,function(){a.resize()}));else{var e=!1;(e="contains"in c?c.contains(b):c.compareDocumentPosition(b)%16)&&c.removeChild(b);b=d._listenersMap[cc.game.EVENT_RESIZE].getFixedPriorityListeners(); d._removeListenerInVector(b,a._listener);a._listener=null}a.updateStatus();a.resize(cc.view)},setJavascriptInterfaceScheme:function(a){},loadData:function(a,b,c,d){},loadHTMLString:function(a,b){},loadURL:function(a){this._renderCmd.updateURL(a);this._dispatchEvent(ccui.WebView.EventType.LOADING)},stopLoading:function(){cc.log("Web does not support loading")},reload:function(){var a=this._renderCmd._iframe;a&&(a=a.contentWindow)&&a.location&&a.location.reload()},canGoBack:function(){cc.log("Web does not support query history"); return!0},canGoForward:function(){cc.log("Web does not support query history");return!0},goBack:function(){try{if(ccui.WebView._polyfill.closeHistory)return cc.log("The current browser does not support the GoBack");var a=this._renderCmd._iframe;if(a){var b=a.contentWindow;if(b&&b.location)try{b.history.back.call(b)}catch(c){b.history.back()}}}catch(d){cc.log(d)}},goForward:function(){try{if(ccui.WebView._polyfill.closeHistory)return cc.log("The current browser does not support the GoForward");var a= this._renderCmd._iframe;if(a){var b=a.contentWindow;if(b&&b.location)try{b.history.forward.call(b)}catch(c){b.history.forward()}}}catch(d){cc.log(d)}},evaluateJS:function(a){var b=this._renderCmd._iframe;if(b){b=b.contentWindow;try{b.eval(a),this._dispatchEvent(ccui.WebView.EventType.JS_EVALUATED)}catch(c){console.error(c)}}},setScalesPageToFit:function(){cc.log("Web does not support zoom")},setEventListener:function(a,b){this._EventList[a]=b},removeEventListener:function(a){this._EventList[a]=null}, _dispatchEvent:function(a){(a=this._EventList[a])&&a.call(this,this,this._renderCmd._iframe.src)},_createRenderCmd:function(){return new ccui.WebView.RenderCmd(this)},setContentSize:function(a,b){ccui.Widget.prototype.setContentSize.call(this,a,b);void 0===b&&(b=a.height,a=a.width);this._renderCmd.changeSize(a,b)},cleanup:function(){this._renderCmd.removeDom();this.stopAllActions();this.unscheduleAllCallbacks()}});ccui.WebView.EventType={LOADING:"loading",LOADED:"load",ERROR:"error",JS_EVALUATED:"js"}; (function(){var a=ccui.WebView._polyfill={devicePixelRatio:!1,enableDiv:!1};cc.sys.os===cc.sys.OS_IOS&&(a.enableDiv=!0);cc.sys.isMobile?cc.sys.browserType===cc.sys.BROWSER_TYPE_FIREFOX&&(a.enableBG=!0):cc.sys.browserType===cc.sys.BROWSER_TYPE_IE&&(a.closeHistory=!0)})(); (function(a){var b=null,b=cc._renderType===cc.game.RENDER_TYPE_WEBGL?cc.Node.WebGLRenderCmd:cc.Node.CanvasRenderCmd;ccui.WebView.RenderCmd=function(b){this._rootCtor(b);this._iframe=this._div=null;a.enableDiv?(this._div=document.createElement("div"),this._div.style["-webkit-overflow"]="auto",this._div.style["-webkit-overflow-scrolling"]="touch",this._iframe=document.createElement("iframe"),this._iframe.style.width="100%",this._iframe.style.height="100%",this._div.appendChild(this._iframe)):this._div= this._iframe=document.createElement("iframe");a.enableBG&&(this._div.style.background="#FFF");this._iframe.addEventListener("load",function(){b._dispatchEvent(ccui.WebView.EventType.LOADED)});this._iframe.addEventListener("error",function(){b._dispatchEvent(ccui.WebView.EventType.ERROR)});this._div.style.background="#FFF";this._div.style.height="200px";this._div.style.width="300px";this._div.style.overflow="scroll";this._div.style.border="none";this._listener=null;this.initStyle()};b=ccui.WebView.RenderCmd.prototype= Object.create(b.prototype);b.constructor=ccui.WebView.RenderCmd;b.transform=function(a,b){this.originTransform(a,b);this.updateMatrix(this._worldTransform,cc.view._scaleX,cc.view._scaleY)};b.updateStatus=function(){a.devicePixelRatio=cc.view.isRetinaEnabled();var b=cc.Node._dirtyFlags,d=this._dirtyFlag;d&b.transformDirty&&(this.transform(this.getParentRenderCmd(),!0),this.updateMatrix(this._worldTransform,cc.view._scaleX,cc.view._scaleY),this._dirtyFlag^=this._dirtyFlag&cc.Node._dirtyFlags.transformDirty); d&b.orderDirty&&(this._dirtyFlag^=this._dirtyFlag&b.orderDirty)};b.resize=function(a){a=a||cc.view;var b=this._node,e=cc.eventManager;b._parent&&b._visible?this.updateMatrix(this._worldTransform,a._scaleX,a._scaleY):(a=e._listenersMap[cc.game.EVENT_RESIZE].getFixedPriorityListeners(),e._removeListenerInVector(a,this._listener),this._listener=null)};b.updateMatrix=function(b,d,e){var f=this._node;if(a.devicePixelRatio){var g=cc.view.getDevicePixelRatio();d/=g;e/=g}if(!1!==this._loaded){var h=cc.game.container.style, g=parseInt(h.paddingLeft),h=parseInt(h.paddingBottom),k=f._contentSize.width,m=f._contentSize.height;b="matrix("+b.a*d+","+b.b+","+b.c+","+b.d*e+","+(g+b.tx*d-k/2+k*f._scaleX/2*d)+","+-(h+b.ty*e-m/2+m*f._scaleY/2*e)+")";this._div.style.transform=b;this._div.style["-webkit-transform"]=b}};b.initStyle=function(){if(this._div){var a=this._div;a.style.position="absolute";a.style.bottom="0px";a.style.left="0px"}};b.updateURL=function(a){var b=this._iframe;b.src=a;var e=this,f=function(){e._loaded=!0;b.removeEventListener("load", f)};b.addEventListener("load",f)};b.changeSize=function(a,b){var e=this._div;e&&(e.style.width=a+"px",e.style.height=b+"px")};b.removeDom=function(){var a=this._div;if(a){var b=!1;(b="contains"in cc.container?cc.container.contains(a):cc.container.compareDocumentPosition(a)%16)&&cc.container.removeChild(a)}}})(ccui.WebView._polyfill);ccui.ScrollViewBar=ccui.ProtectedNode.extend({_parentScroll:null,_direction:null,_upperHalfCircle:null,_lowerHalfCircle:null,_body:null,_opacity:255,_marginFromBoundary:0,_marginForLength:0,_touching:!1,_autoHideEnabled:!0,autoHideTime:0,_autoHideRemainingTime:0,_className:"ScrollViewBar",ctor:function(a,b){cc.ProtectedNode.prototype.ctor.call(this);this._direction=b;this._parentScroll=a;this._marginForLength=this._marginFromBoundary=ccui.ScrollViewBar.DEFAULT_MARGIN;this.opacity=255*ccui.ScrollViewBar.DEFAULT_SCROLLBAR_OPACITY; this.autoHideTime=ccui.ScrollViewBar.DEFAULT_AUTO_HIDE_TIME;this._autoHideEnabled=!0;ccui.ScrollViewBar.prototype.init.call(this);this.setCascadeColorEnabled(!0);this.setCascadeOpacityEnabled(!0)},init:function(){this._upperHalfCircle=ccui.helper._createSpriteFromBase64(ccui.ScrollViewBar.HALF_CIRCLE_IMAGE,ccui.ScrollViewBar.HALF_CIRCLE_IMAGE_KEY);this._upperHalfCircle.setAnchorPoint(cc.p(0.5,0));this._lowerHalfCircle=ccui.helper._createSpriteFromBase64(ccui.ScrollViewBar.HALF_CIRCLE_IMAGE,ccui.ScrollViewBar.HALF_CIRCLE_IMAGE_KEY); this._lowerHalfCircle.setAnchorPoint(cc.p(0.5,0));this._lowerHalfCircle.setScaleY(-1);this.addProtectedChild(this._upperHalfCircle);this.addProtectedChild(this._lowerHalfCircle);this._body=ccui.helper._createSpriteFromBase64(ccui.ScrollViewBar.BODY_IMAGE_1_PIXEL_HEIGHT,ccui.ScrollViewBar.BODY_IMAGE_1_PIXEL_HEIGHT_KEY);this._body.setAnchorPoint(cc.p(0.5,0));this.addProtectedChild(this._body);this.setColor(ccui.ScrollViewBar.DEFAULT_COLOR);this.onScrolled(cc.p(0,0));cc.ProtectedNode.prototype.setOpacity.call(this, 0);this._autoHideRemainingTime=0;this._direction===ccui.ScrollView.DIR_HORIZONTAL&&this.setRotation(90)},setPositionFromCorner:function(a){this._direction===ccui.ScrollView.DIR_VERTICAL?(this._marginForLength=a.y,this._marginFromBoundary=a.x):(this._marginForLength=a.x,this._marginFromBoundary=a.y)},onEnter:function(){cc.ProtectedNode.prototype.onEnter.call(this);this.scheduleUpdate()},getPositionFromCorner:function(){return this._direction===ccui.ScrollView.DIR_VERTICAL?cc.p(this._marginFromBoundary, this._marginForLength):cc.p(this._marginForLength,this._marginFromBoundary)},setWidth:function(a){a/=this._body.width;this._body.setScaleX(a);this._upperHalfCircle.setScale(a);this._lowerHalfCircle.setScale(-a)},getWidth:function(){return this._body.getBoundingBox().width},setAutoHideEnabled:function(a){this._autoHideEnabled=a;!this._autoHideEnabled&&!this._touching&&0>=this._autoHideRemainingTime?cc.ProtectedNode.prototype.setOpacity.call(this,this.opacity):cc.ProtectedNode.prototype.setOpacity.call(this, 0)},isAutoHideEnabled:function(){return this._autoHideEnabled},setOpacity:function(a){this._opacity=a},getOpacity:function(){return this._opacity},_updateLength:function(a){var b=a/this._body.getTextureRect().height;this._body.setScaleY(b);this._upperHalfCircle.setPositionY(this._body.getPositionY()+a)},_processAutoHide:function(a){!this._autoHideEnabled||0>=this._autoHideRemainingTime||this._touching||(this._autoHideRemainingTime-=a,this._autoHideRemainingTime<=this.autoHideTime&&(this._autoHideRemainingTime= Math.max(0,this._autoHideRemainingTime),cc.ProtectedNode.prototype.setOpacity.call(this,this._autoHideRemainingTime/this.autoHideTime*this._opacity)))},update:function(a){this._processAutoHide(a)},onTouchBegan:function(){this._autoHideEnabled&&(this._touching=!0)},onTouchEnded:function(){this._autoHideEnabled&&(this._touching=!1,0>=this._autoHideRemainingTime||(this._autoHideRemainingTime=this.autoHideTime))},onScrolled:function(a){this._autoHideEnabled&&(this._autoHideRemainingTime=this.autoHideTime, cc.ProtectedNode.prototype.setOpacity.call(this,this.opacity));var b=this._parentScroll.getInnerContainer(),c=0,d=0,e=0,f=0;this._direction===ccui.ScrollView.DIR_VERTICAL?(c=b.height,d=this._parentScroll.height,e=a.y,f=-b.getPositionY()):this._direction===ccui.ScrollView.DIR_HORIZONTAL&&(c=b.width,d=this._parentScroll.width,e=a.x,f=-b.getPositionX());a=this._calculateLength(c,d,e);c=this._calculatePosition(c,d,f,e,a);this._updateLength(a);this.setPosition(c)},_calculateLength:function(a,b,c){0!== c&&(a+=20*(0=d.height-e.y||f+c.height<=-e.y||(g=b.x-a.x*c.width)>=d.width-e.x||g+c.width<=-e.x?!1:!0},updateChildren:function(){var a, b,c,d=this._innerContainer._children;b=0;for(c=d.length;bthis._leftBoundary?b.x=this._leftBoundary-(this._innerContainer.getLeftBoundary()+a.x):this._innerContainer.getRightBoundary()+a.xthis._bottomBoundary&&(b.y=this._bottomBoundary-(this._innerContainer.getBottomBoundary()+a.y));0===a.x&&0===a.y&&(this._outOfBoundaryAmount=b,this._outOfBoundaryAmountDirty=!1);return b},_isOutOfBoundary:function(a){var b=this._getHowMuchOutOfBoundary();if(void 0!==a)switch(a){case ccui.ScrollView.MOVEDIR_TOP:return 0b.y;case ccui.ScrollView.MOVEDIR_LEFT:return 0> b.x;case ccui.ScrollView.MOVEDIR_RIGHT:return 0=this._touchTotalTimeThreshold)return cc.p(0,0);for(var c=cc.p(0,0),b=0;b=Math.abs(a.x)&&1E-4>=Math.abs(a.y)},_processAutoScrolling:function(a){var b=this._isNecessaryAutoScrollBrake()?0.05:1;this._autoScrollAccumulatedTime+=1/b*a;var c=Math.min(1,this._autoScrollAccumulatedTime/this._autoScrollTotalTime);this._autoScrollAttenuate&&(c-=1,c=c*c*c*c*c+1);a=cc.pAdd(this._autoScrollStartPosition, cc.pMult(this._autoScrollTargetDelta,c));c=Math.abs(c-1)<=this._getAutoScrollStopEpsilon();this.bounceEnabled?a=cc.pAdd(this._autoScrollBrakingStartPosition,cc.pMult(cc.pSub(a,this._autoScrollBrakingStartPosition),b)):(b=cc.pSub(a,this.getInnerContainerPosition()),b=this._getHowMuchOutOfBoundary(b),this._fltEqualZero(b)||(a.x+=b.x,a.y+=b.y,c=!0));c&&(this._autoScrolling=!1,this._dispatchEvent(ccui.ScrollView.EVENT_AUTOSCROLL_ENDED));this._moveInnerContainer(cc.pSub(a,this.getInnerContainerPosition()), c)},_jumpToDestination:function(a,b){void 0===a.x&&(a=cc.p(a,b));this._autoScrolling=!1;this._moveInnerContainer(cc.pSub(a,this.getInnerContainerPosition()),!0)},_scrollChildren:function(a){if(this.bounceEnabled){var b=this._getHowMuchOutOfBoundary();a.x*=0==b.x?1:0.5;a.y*=0==b.y?1:0.5}this.bounceEnabled||(b=this._getHowMuchOutOfBoundary(a),a.x+=b.x,a.y+=b.y);var c=b=!1,d=!1,e=!1;0=this._bottomBoundary&&(e=!0):0>a.y&&this._innerContainer.getTopBoundary()+ a.y<=this._topBoundary&&(d=!0);0>a.x?this._innerContainer.getRightBoundary()+a.x<=this._rightBoundary&&(c=!0):0=this._leftBoundary&&(b=!0);this._moveInnerContainer(a,!1);0==a.x&&0==a.y||this._processScrollingEvent();e&&this._processScrollEvent(ccui.ScrollView.MOVEDIR_BOTTOM,!1);d&&this._processScrollEvent(ccui.ScrollView.MOVEDIR_TOP,!1);b&&this._processScrollEvent(ccui.ScrollView.MOVEDIR_LEFT,!1);c&&this._processScrollEvent(ccui.ScrollView.MOVEDIR_RIGHT, !1)},scrollToBottom:function(a,b){this._startAutoScrollToDestination(cc.p(this._innerContainer.getPositionX(),0),a,b)},scrollToTop:function(a,b){this._startAutoScrollToDestination(cc.p(this._innerContainer.getPositionX(),this._contentSize.height-this._innerContainer.getContentSize().height),a,b)},scrollToLeft:function(a,b){this._startAutoScrollToDestination(cc.p(0,this._innerContainer.getPositionY()),a,b)},scrollToRight:function(a,b){this._startAutoScrollToDestination(cc.p(this._contentSize.width- this._innerContainer.getContentSize().width,this._innerContainer.getPositionY()),a,b)},scrollToTopLeft:function(a,b){this._direction!==ccui.ScrollView.DIR_BOTH?cc.log("Scroll direction is not both!"):this._startAutoScrollToDestination(cc.p(0,this._contentSize.height-this._innerContainer.getContentSize().height),a,b)},scrollToTopRight:function(a,b){if(this._direction!==ccui.ScrollView.DIR_BOTH)cc.log("Scroll direction is not both!");else{var c=this._innerContainer.getContentSize();this._startAutoScrollToDestination(cc.p(this._contentSize.width- c.width,this._contentSize.height-c.height),a,b)}},scrollToBottomLeft:function(a,b){this._direction!==ccui.ScrollView.DIR_BOTH?cc.log("Scroll direction is not both!"):this._startAutoScrollToDestination(cc.p(0,0),a,b)},scrollToBottomRight:function(a,b){this._direction!==ccui.ScrollView.DIR_BOTH?cc.log("Scroll direction is not both!"):this._startAutoScrollToDestination(cc.p(this._contentSize.width-this._innerContainer.getContentSize().width,0),a,b)},scrollToPercentVertical:function(a,b,c){var d=this._contentSize.height- this._innerContainer.getContentSize().height,e=-d;this._startAutoScrollToDestination(cc.p(this._innerContainer.getPositionX(),d+a*e/100),b,c)},scrollToPercentHorizontal:function(a,b,c){var d=this._innerContainer.getContentSize().width-this._contentSize.width;this._startAutoScrollToDestination(cc.p(-(a*d/100),this._innerContainer.getPositionY()),b,c)},scrollToPercentBothDirection:function(a,b,c){if(this._direction===ccui.ScrollView.DIR_BOTH){var d=this._contentSize.height-this._innerContainer.getContentSize().height, e=-d,f=this._innerContainer.getContentSize().width-this._contentSize.width;this._startAutoScrollToDestination(cc.p(-(a.x*f/100),d+a.y*e/100),b,c)}},jumpToBottom:function(){this._jumpToDestination(this._innerContainer.getPositionX(),0)},jumpToTop:function(){this._jumpToDestination(this._innerContainer.getPositionX(),this._contentSize.height-this._innerContainer.getContentSize().height)},jumpToLeft:function(){this._jumpToDestination(0,this._innerContainer.getPositionY())},jumpToRight:function(){this._jumpToDestination(this._contentSize.width- this._innerContainer.getContentSize().width,this._innerContainer.getPositionY())},jumpToTopLeft:function(){this._direction!==ccui.ScrollView.DIR_BOTH?cc.log("Scroll _direction is not both!"):this._jumpToDestination(0,this._contentSize.height-this._innerContainer.getContentSize().height)},jumpToTopRight:function(){if(this._direction!==ccui.ScrollView.DIR_BOTH)cc.log("Scroll _direction is not both!");else{var a=this._innerContainer.getContentSize();this._jumpToDestination(this._contentSize.width-a.width, this._contentSize.height-a.height)}},jumpToBottomLeft:function(){this._direction!==ccui.ScrollView.DIR_BOTH?cc.log("Scroll _direction is not both!"):this._jumpToDestination(0,0)},jumpToBottomRight:function(){this._direction!==ccui.ScrollView.DIR_BOTH?cc.log("Scroll _direction is not both!"):this._jumpToDestination(this._contentSize.width-this._innerContainer.getContentSize().width,0)},jumpToPercentVertical:function(a){var b=this._contentSize.height-this._innerContainer.getContentSize().height,c=-b; this._jumpToDestination(this._innerContainer.getPositionX(),b+a*c/100)},jumpToPercentHorizontal:function(a){var b=this._innerContainer.getContentSize().width-this._contentSize.width;this._jumpToDestination(-(a*b/100),this._innerContainer.getPositionY())},jumpToPercentBothDirection:function(a){if(this._direction===ccui.ScrollView.DIR_BOTH){var b=this._innerContainer.getContentSize(),c=this._contentSize.height-b.height;this._jumpToDestination(-(a.x*(b.width-this._contentSize.width)/100),c+a.y*-c/100)}}, _gatherTouchMove:function(a){for(;5<=this._touchMoveDisplacements.length;)this._touchMoveDisplacements.splice(0,1),this._touchMoveTimeDeltas.splice(0,1);this._touchMoveDisplacements.push(a);a=(new Date).getTime();this._touchMoveTimeDeltas.push((a-this._touchMovePreviousTimestamp)/1E3);this._touchMovePreviousTimestamp=a},_handlePressLogic:function(a){this._bePressed=!0;this._autoScrolling=!1;this._touchMovePreviousTimestamp=(new Date).getTime();this._touchMoveDisplacements.length=0;this._touchMoveTimeDeltas.length= 0;if(this._verticalScrollBar)this._verticalScrollBar.onTouchBegan();if(this._horizontalScrollBar)this._horizontalScrollBar.onTouchBegan()},_handleMoveLogic:function(a){var b=this.convertToNodeSpace(a.getLocation());a=this.convertToNodeSpace(a.getPreviousLocation());b=cc.pSub(b,a);this._scrollChildren(b);this._gatherTouchMove(b)},_handleReleaseLogic:function(a){var b=this.convertToNodeSpace(a.getLocation());a=this.convertToNodeSpace(a.getPreviousLocation());b=cc.pSub(b,a);this._gatherTouchMove(b); this._bePressed=!1;!this._startBounceBackIfNeeded()&&this.inertiaScrollEnabled&&(b=this._calculateTouchMoveVelocity(),0===b.x&&0===b.y||this._startInertiaScroll(b));if(this._verticalScrollBar)this._verticalScrollBar.onTouchEnded();if(this._horizontalScrollBar)this._horizontalScrollBar.onTouchEnded()},onTouchBegan:function(a,b){var c=ccui.Layout.prototype.onTouchBegan.call(this,a,b);this._isInterceptTouch||this._hit&&this._handlePressLogic(a);return c},onTouchMoved:function(a,b){ccui.Layout.prototype.onTouchMoved.call(this, a,b);this._isInterceptTouch||this._handleMoveLogic(a)},onTouchEnded:function(a,b){ccui.Layout.prototype.onTouchEnded.call(this,a,b);this._isInterceptTouch||this._handleReleaseLogic(a);this._isInterceptTouch=!1},onTouchCancelled:function(a,b){ccui.Layout.prototype.onTouchCancelled.call(this,a,b);this._isInterceptTouch||this._handleReleaseLogic(a);this._isInterceptTouch=!1},update:function(a){this._autoScrolling&&this._processAutoScrolling(a)},interceptTouchEvent:function(a,b,c){if(!this._touchEnabled)ccui.Layout.prototype.interceptTouchEvent.call(this, a,b,c);else if(this._direction!==ccui.ScrollView.DIR_NONE){var d=c.getLocation();switch(a){case ccui.Widget.TOUCH_BEGAN:this._isInterceptTouch=!0;this._touchBeganPosition.x=d.x;this._touchBeganPosition.y=d.y;this._handlePressLogic(c);break;case ccui.Widget.TOUCH_MOVED:a=cc.pLength(cc.pSub(b.getTouchBeganPosition(),d));this._touchMovePosition.x=d.x;this._touchMovePosition.y=d.y;a>this._childFocusCancelOffset&&(b.setHighlighted(!1),this._handleMoveLogic(c));break;case ccui.Widget.TOUCH_CANCELED:case ccui.Widget.TOUCH_ENDED:this._touchEndPosition.x= d.x,this._touchEndPosition.y=d.y,this._handleReleaseLogic(c),b.isSwallowTouches()&&(this._isInterceptTouch=!1)}}},_processScrollEvent:function(a,b){var c=0;switch(a){case ccui.ScrollView.MOVEDIR_TOP:c=b?ccui.ScrollView.EVENT_BOUNCE_TOP:ccui.ScrollView.EVENT_SCROLL_TO_TOP;break;case ccui.ScrollView.MOVEDIR_BOTTOM:c=b?ccui.ScrollView.EVENT_BOUNCE_BOTTOM:ccui.ScrollView.EVENT_SCROLL_TO_BOTTOM;break;case ccui.ScrollView.MOVEDIR_LEFT:c=b?ccui.ScrollView.EVENT_BOUNCE_LEFT:ccui.ScrollView.EVENT_SCROLL_TO_LEFT; break;case ccui.ScrollView.MOVEDIR_RIGHT:c=b?ccui.ScrollView.EVENT_BOUNCE_RIGHT:ccui.ScrollView.EVENT_SCROLL_TO_RIGHT}this._dispatchEvent(c)},_processScrollingEvent:function(){this._dispatchEvent(ccui.ScrollView.EVENT_SCROLLING)},_dispatchEvent:function(a){this._scrollViewEventSelector&&(this._scrollViewEventListener?this._scrollViewEventSelector.call(this._scrollViewEventListener,this,a):this._scrollViewEventSelector(this,a));this._ccEventCallback&&this._ccEventCallback(this,a)},addEventListenerScrollView:function(a, b){this._scrollViewEventSelector=a;this._scrollViewEventListener=b},addEventListener:function(a){this._ccEventCallback=a},setDirection:function(a){this._direction=a;this._scrollBarEnabled&&(this._removeScrollBar(),this._initScrollBar())},getDirection:function(){return this._direction},setBounceEnabled:function(a){this.bounceEnabled=a},isBounceEnabled:function(){return this.bounceEnabled},setInertiaScrollEnabled:function(a){this.inertiaScrollEnabled=a},isInertiaScrollEnabled:function(){return this.inertiaScrollEnabled}, setScrollBarEnabled:function(a){this._scrollBarEnabled!==a&&(this._scrollBarEnabled&&this._removeScrollBar(),(this._scrollBarEnabled=a)&&this._initScrollBar())},isScrollBarEnabled:function(){return this._scrollBarEnabled},setScrollBarPositionFromCorner:function(a){this._direction!==ccui.ScrollView.DIR_HORIZONTAL&&this.setScrollBarPositionFromCornerForVertical(a);this._direction!==ccui.ScrollView.DIR_VERTICAL&&this.setScrollBarPositionFromCornerForHorizontal(a)},setScrollBarPositionFromCornerForVertical:function(a){cc.assert(this._scrollBarEnabled, "Scroll bar should be enabled!");cc.assert(this._direction!==ccui.ScrollView.DIR_HORIZONTAL,"Scroll view doesn't have a vertical scroll bar!");this._verticalScrollBar.setPositionFromCorner(a)},getScrollBarPositionFromCornerForVertical:function(){cc.assert(this._scrollBarEnabled,"Scroll bar should be enabled!");cc.assert(this._direction!==ccui.ScrollView.DIR_HORIZONTAL,"Scroll view doesn't have a vertical scroll bar!");return this._verticalScrollBar.getPositionFromCorner()},setScrollBarPositionFromCornerForHorizontal:function(a){cc.assert(this._scrollBarEnabled, "Scroll bar should be enabled!");cc.assert(this._direction!==ccui.ScrollView.DIR_VERTICAL,"Scroll view doesn't have a horizontal scroll bar!");this._horizontalScrollBar.setPositionFromCorner(a)},getScrollBarPositionFromCornerForHorizontal:function(){cc.assert(this._scrollBarEnabled,"Scroll bar should be enabled!");cc.assert(this._direction!==ccui.ScrollView.DIR_VERTICAL,"Scroll view doesn't have a horizontal scroll bar!");return this._horizontalScrollBar.getPositionFromCorner()},setScrollBarWidth:function(a){cc.assert(this._scrollBarEnabled, "Scroll bar should be enabled!");this._verticalScrollBar&&this._verticalScrollBar.setWidth(a);this._horizontalScrollBar&&this._horizontalScrollBar.setWidth(a)},getScrollBarWidth:function(){cc.assert(this._scrollBarEnabled,"Scroll bar should be enabled!");return this._verticalScrollBar?this._verticalScrollBar.getWidth():this._horizontalScrollBar?this._horizontalScrollBar.getWidth():0},setScrollBarColor:function(a){cc.assert(this._scrollBarEnabled,"Scroll bar should be enabled!");this._verticalScrollBar&& this._verticalScrollBar.setColor(a);this._horizontalScrollBar&&this._horizontalScrollBar.setColor(a)},getScrollBarColor:function(){cc.assert(this._scrollBarEnabled,"Scroll bar should be enabled!");this._verticalScrollBar&&this._verticalScrollBar.getColor();this._horizontalScrollBar&&this._horizontalScrollBar.getColor();return cc.color.WHITE},setScrollBarOpacity:function(a){cc.assert(this._scrollBarEnabled,"Scroll bar should be enabled!");this._verticalScrollBar&&(this._verticalScrollBar.opacity=a); this._horizontalScrollBar&&(this._horizontalScrollBar.opacity=a)},getScrollBarOpacity:function(){cc.assert(this._scrollBarEnabled,"Scroll bar should be enabled!");return this._verticalScrollBar?this._verticalScrollBar.opacity:this._horizontalScrollBar?this._horizontalScrollBar.opacity:-1},setScrollBarAutoHideEnabled:function(a){cc.assert(this._scrollBarEnabled,"Scroll bar should be enabled!");this._verticalScrollBar&&(this._verticalScrollBar.autoHideEnabled=a);this._horizontalScrollBar&&(this._horizontalScrollBar.autoHideEnabled= a)},isScrollBarAutoHideEnabled:function(){cc.assert(this._scrollBarEnabled,"Scroll bar should be enabled!");return this._verticalScrollBar?this._verticalScrollBar.autoHideEnabled:this._horizontalScrollBar?this._horizontalScrollBar.autoHideEnabled:!1},setScrollBarAutoHideTime:function(a){cc.assert(this._scrollBarEnabled,"Scroll bar should be enabled!");this._verticalScrollBar&&(this._verticalScrollBar.autoHideTime=a);this._horizontalScrollBar&&(this._horizontalScrollBar.autoHideTime=a)},getScrollBarAutoHideTime:function(){cc.assert(this._scrollBarEnabled, "Scroll bar should be enabled!");return this._verticalScrollBar?this._verticalScrollBar.autoHideTime:this._horizontalScrollBar?this._horizontalScrollBar.autoHideTime:0},getInnerContainer:function(){return this._innerContainer},setLayoutType:function(a){this._innerContainer.setLayoutType(a)},getLayoutType:function(){return this._innerContainer.getLayoutType()},_doLayout:function(){this._doLayoutDirty&&(this._doLayoutDirty=!1)},getDescription:function(){return"ScrollView"},_createCloneInstance:function(){return new ccui.ScrollView}, _copyClonedWidgetChildren:function(a){ccui.Layout.prototype._copyClonedWidgetChildren.call(this,a)},_copySpecialProperties:function(a){a instanceof ccui.ScrollView&&(ccui.Layout.prototype._copySpecialProperties.call(this,a),this.setInnerContainerSize(a.getInnerContainerSize()),this.setInnerContainerPosition(a.getInnerContainerPosition()),this.setDirection(a._direction),this._topBoundary=a._topBoundary,this._bottomBoundary=a._bottomBoundary,this._leftBoundary=a._leftBoundary,this._rightBoundary=a._rightBoundary, this._bePressed=a._bePressed,this._childFocusCancelOffset=a._childFocusCancelOffset,this._touchMoveDisplacements=a._touchMoveDisplacements,this._touchMoveTimeDeltas=a._touchMoveTimeDeltas,this._touchMovePreviousTimestamp=a._touchMovePreviousTimestamp,this._autoScrolling=a._autoScrolling,this._autoScrollAttenuate=a._autoScrollAttenuate,this._autoScrollStartPosition=a._autoScrollStartPosition,this._autoScrollTargetDelta=a._autoScrollTargetDelta,this._autoScrollTotalTime=a._autoScrollTotalTime,this._autoScrollAccumulatedTime= a._autoScrollAccumulatedTime,this._autoScrollCurrentlyOutOfBoundary=a._autoScrollCurrentlyOutOfBoundary,this._autoScrollBraking=a._autoScrollBraking,this._autoScrollBrakingStartPosition=a._autoScrollBrakingStartPosition,this.setBounceEnabled(a.bounceEnabled),this.setInertiaScrollEnabled(a.inertiaScrollEnabled),this._scrollViewEventListener=a._scrollViewEventListener,this._scrollViewEventSelector=a._scrollViewEventSelector,this._ccEventCallback=a._ccEventCallback,this.setScrollBarEnabled(a.isScrollBarEnabled()), this.isScrollBarEnabled()&&(this._direction!==ccui.ScrollView.DIR_HORIZONTAL&&this.setScrollBarPositionFromCornerForVertical(a.getScrollBarPositionFromCornerForVertical()),this._direction!==ccui.ScrollView.DIR_VERTICAL&&this.setScrollBarPositionFromCornerForHorizontal(a.getScrollBarPositionFromCornerForHorizontal()),this.setScrollBarWidth(a.getScrollBarWidth()),this.setScrollBarColor(a.getScrollBarColor()),this.setScrollBarAutoHideEnabled(a.isScrollBarAutoHideEnabled()),this.setScrollBarAutoHideTime(a.getScrollBarAutoHideTime())))}, _initScrollBar:function(){this._direction===ccui.ScrollView.DIR_HORIZONTAL||this._verticalScrollBar||(this._verticalScrollBar=new ccui.ScrollViewBar(this,ccui.ScrollView.DIR_VERTICAL),this.addProtectedChild(this._verticalScrollBar,2));this._direction===ccui.ScrollView.DIR_VERTICAL||this._horizontalScrollBar||(this._horizontalScrollBar=new ccui.ScrollViewBar(this,ccui.ScrollView.DIR_HORIZONTAL),this.addProtectedChild(this._horizontalScrollBar,2))},_removeScrollBar:function(){this._verticalScrollBar&& (this.removeProtectedChild(this._verticalScrollBar),this._verticalScrollBar=null);this._horizontalScrollBar&&(this.removeProtectedChild(this._horizontalScrollBar),this._horizontalScrollBar=null)},getNodeByTag:function(a){return this._innerContainer.getNodeByTag(a)},getNodes:function(){return this._innerContainer.getNodes()},removeNode:function(a){this._innerContainer.removeNode(a)},removeNodeByTag:function(a){this._innerContainer.removeNodeByTag(a)},removeAllNodes:function(){this._innerContainer.removeAllNodes()}, addNode:function(a,b,c){this._innerContainer.addNode(a,b,c)}});_p=ccui.ScrollView.prototype;cc.defineGetterSetter(_p,"innerWidth",_p._getInnerWidth,_p._setInnerWidth);cc.defineGetterSetter(_p,"innerHeight",_p._getInnerHeight,_p._setInnerHeight);cc.defineGetterSetter(_p,"direction",_p.getDirection,_p.setDirection);cc.defineGetterSetter(_p,"touchTotalTimeThreshold",_p.getTouchTotalTimeThreshold,_p.setTouchTotalTimeThreshold);_p=null;ccui.ScrollView.create=function(){return new ccui.ScrollView}; ccui.ScrollView.DIR_NONE=0;ccui.ScrollView.DIR_VERTICAL=1;ccui.ScrollView.DIR_HORIZONTAL=2;ccui.ScrollView.DIR_BOTH=3;ccui.ScrollView.EVENT_SCROLL_TO_TOP=0;ccui.ScrollView.EVENT_SCROLL_TO_BOTTOM=1;ccui.ScrollView.EVENT_SCROLL_TO_LEFT=2;ccui.ScrollView.EVENT_SCROLL_TO_RIGHT=3;ccui.ScrollView.EVENT_SCROLLING=4;ccui.ScrollView.EVENT_BOUNCE_TOP=5;ccui.ScrollView.EVENT_BOUNCE_BOTTOM=6;ccui.ScrollView.EVENT_BOUNCE_LEFT=7;ccui.ScrollView.EVENT_BOUNCE_RIGHT=8;ccui.ScrollView.EVENT_CONTAINER_MOVED=9; ccui.ScrollView.EVENT_AUTOSCROLL_ENDED=10;ccui.ScrollView.MOVEDIR_TOP=0;ccui.ScrollView.MOVEDIR_BOTTOM=1;ccui.ScrollView.MOVEDIR_LEFT=2;ccui.ScrollView.MOVEDIR_RIGHT=3;ccui.ListView=ccui.ScrollView.extend({_model:null,_items:null,_gravity:null,_itemsMargin:0,_curSelectedIndex:0,_refreshViewDirty:!0,_listViewEventListener:null,_listViewEventSelector:null,_ccListViewEventCallback:null,_magneticAllowedOutOfBoundary:!0,_magneticType:0,_className:"ListView",ctor:function(){this._items=[];ccui.ScrollView.prototype.ctor.call(this);this._gravity=ccui.ListView.GRAVITY_CENTER_VERTICAL;this.setTouchEnabled(!0);this.setDirection(ccui.ScrollView.DIR_VERTICAL)},setItemModel:function(a){a? this._model=a:cc.log("Can't set a null to item model!")},_handleReleaseLogic:function(a){ccui.ScrollView.prototype._handleReleaseLogic.call(this,a);this._autoScrolling||this._startMagneticScroll()},_onItemListChanged:function(){this._outOfBoundaryAmountDirty=!0},_updateInnerContainerSize:function(){var a,b=this._items,c;switch(this.direction){case ccui.ScrollView.DIR_VERTICAL:c=b.length;var d=(c-1)*this._itemsMargin;for(a=0;aa||a>=this._items.length? null:this._items[a]},getItems:function(){return this._items},getIndex:function(a){return null==a?-1:this._items.indexOf(a)},setGravity:function(a){this._gravity!==a&&(this._gravity=a,this._refreshViewDirty=!0)},setMagneticType:function(a){this._magneticType=a;this._onItemListChanged();this._startMagneticScroll()},getMagneticType:function(){return this._magneticType},setMagneticAllowedOutOfBoundary:function(a){this._magneticAllowedOutOfBoundary=a},getMagneticAllowedOutOfBoundary:function(){return this._magneticAllowedOutOfBoundary}, setItemsMargin:function(a){this._itemsMargin!==a&&(this._itemsMargin=a,this._refreshViewDirty=!0)},getItemsMargin:function(){return this._itemsMargin},setDirection:function(a){switch(a){case ccui.ScrollView.DIR_VERTICAL:this.setLayoutType(ccui.Layout.LINEAR_VERTICAL);break;case ccui.ScrollView.DIR_HORIZONTAL:this.setLayoutType(ccui.Layout.LINEAR_HORIZONTAL);break;case ccui.ScrollView.DIR_BOTH:return;default:return}ccui.ScrollView.prototype.setDirection.call(this,a)},_getHowMuchOutOfBoundary:function(a){void 0=== a&&(a=cc.p(0,0));if(this._magneticAllowedOutOfBoundary&&0!==this._items.length){if(this._magneticType===ccui.ListView.MAGNETIC_NONE||this._magneticType===ccui.ListView.MAGNETIC_BOTH_END)return ccui.ScrollView.prototype._getHowMuchOutOfBoundary.call(this,a);if(0===a.x&&0===a.y&&!this._outOfBoundaryAmountDirty)return this._outOfBoundaryAmount}else return ccui.ScrollView.prototype._getHowMuchOutOfBoundary.call(this,a);var b=this._leftBoundary,c=this._rightBoundary,d=this._topBoundary,e=this._bottomBoundary, f=this._items.length-1,g=this.getContentSize(),h=cc.p(0,0),k=cc.p(0,0);switch(this._magneticType){case ccui.ListView.MAGNETIC_CENTER:h.x=(g.width-this._items[0].width)/2;h.y=(g.height-this._items[0].height)/2;k.x=(g.width-this._items[f].width)/2;k.y=(g.height-this._items[f].height)/2;break;case ccui.ListView.MAGNETIC_LEFT:case ccui.ListView.MAGNETIC_TOP:k.x=g.width-this._items[f].width;k.y=g.height-this._items[f].height;break;case ccui.ListView.MAGNETIC_RIGHT:case ccui.ListView.MAGNETIC_BOTTOM:h.x= g.width-this._items[0].width,h.y=g.height-this._items[0].height}b+=h.x;c-=k.x;d-=h.y;e+=k.y;f=cc.p(0,0);this._innerContainer.getLeftBoundary()+a.x>b?f.x=b-(this._innerContainer.getLeftBoundary()+a.x):this._innerContainer.getRightBoundary()+a.xe&&(f.y=e-(this._innerContainer.getBottomBoundary()+a.y));0=== a.x&&0===a.y&&(this._outOfBoundaryAmount=f,this._outOfBoundaryAmountDirty=!1);return f},_calculateItemPositionWithAnchor:function(a,b){var c=cc.p(a.getLeftBoundary(),a.getBottomBoundary()),d=a.getContentSize();return cc.p(c.x+d.width*b.x,c.y+d.height*b.y)},_findClosestItem:function(a,b,c,d,e,f,g){cc.assert(0<=d&&f=this._items.length))if(a=this._flattenVectorByDirection(this._calculateTouchMoveVelocity()),500>cc.pLength(a))this._startMagneticScroll();else{var b=this.getItem(this._curPageIdx),b=this._calculateItemDestination(cc.p(0.5,0.5),b,cc.p(0.5,0.5)),b=cc.pSub(b,this.getInnerContainerPosition()),b=this._flattenVectorByDirection(b);0a.x||0a;)this._decreaseNumberOfPages();this._rearrange();this._currentIndexNode.setVisible(0< this._indexNodes.length)},indicate:function(a){0>a||a>=this._indexNodes.length||this._currentIndexNode.setPosition(this._indexNodes[a].getPosition())},_rearrange:function(){if(0!==this._indexNodes.length)for(var a=this._direction===ccui.ScrollView.DIR_HORIZONTAL,b=this._indexNodes[0].getContentSize(),c=a?b.width:b.height,d=this._indexNodes.length,d=-((c*d+this._spaceBetweenIndexNodes*(d-1))/2)+c/2,e=0;ed.width&&(d.width=0),e.x=this._leftMargin+c.x*d.width):(this._usingPercentWidth&&(d.width=a.width*this._percentWidth),e.x=a.width*this._positionPercentX)}switch(this._verticalEdge){case ccui.LayoutComponent.verticalEdge.NONE:this._usingStretchHeight&& !this._isPercentOnly?(d.height=a.height*this._percentHeight,e.y=this._bottomMargin+c.y*d.height):(this._usingPositionPercentY&&(e.y=a.height*this._positionPercentY),this._usingPercentHeight&&(d.height=a.height*this._percentHeight));break;case ccui.LayoutComponent.verticalEdge.BOTTOM:if(this._isPercentOnly)break;if(this._usingPercentHeight||this._usingStretchHeight)d.height=a.height*this._percentHeight;e.y=this._bottomMargin+c.y*d.height;break;case ccui.LayoutComponent.verticalEdge.TOP:if(this._isPercentOnly)break; if(this._usingPercentHeight||this._usingStretchHeight)d.height=a.height*this._percentHeight;e.y=a.height-(this._topMargin+(1-c.y)*d.height);break;case ccui.LayoutComponent.verticalEdge.CENTER:if(this._isPercentOnly)break;this._usingStretchHeight?(d.height=a.height-this._topMargin-this._bottomMargin,0>d.height&&(d.height=0),e.y=this._bottomMargin+c.y*d.height):(this._usingPercentHeight&&(d.height=a.height*this._percentHeight),e.y=a.height*this._positionPercentY)}b.setPosition(e);b.setContentSize(d); if(b instanceof ccui.PageView)for(b.forceDoLayout(),a=b.getPages(),b=0;b=f+h:1);)k=m[n], f+=h,h=parseFloat(k.getAttribute(ccs.CONST_A_DURATION)),n++;s=this.decodeFrame(s,k,c,d);e.addFrameData(s);s.frameID=p;p+=s.duration;e.duration=p}b=e.frameList;c=Math.PI;for(g=b.length-1;0<=g;g--)if(0c)b[g-1].skewX=0>d?b[g-1].skewX-2*c:b[g-1].skewX+2*c;if(f<-c||f>c)b[g-1].skewY=0>f?b[g-1].skewY-2*c:b[g-1].skewY+2*c}b=new ccs.FrameData;b.copy(e.frameList[e.frameList.length-1]);b.frameID=e.duration;e.addFrameData(b);return e},decodeMovementBoneFromJson:function(a, b){var c=new ccs.MovementBoneData;c.init();c.delay=a[ccs.CONST_A_MOVEMENT_DELAY]||0;var d=a[ccs.CONST_A_NAME];d&&(c.name=d);for(var e=(a[ccs.CONST_FRAME_DATA]||[]).length,d=0;df)e[d-1].skewX=0>g?e[d-1].skewX-2*f:e[d-1].skewX+2*f;if(h<-f||h>f)e[d-1].skewY=0>h?e[d-1].skewY-2*f:e[d-1].skewY+2*f}b.cocoStudioVersion=ccs.CONST_VERSION_2_0){if(e=a.getAttribute(ccs.CONST_A_COCOS2DX_X))c.x=parseFloat(e),c.x*=this._positionReadScale;e=a.getAttribute(ccs.CONST_A_COCOS2DX_Y)}else{if(e=a.getAttribute(ccs.CONST_A_X))c.x= parseFloat(e),c.x*=this._positionReadScale;e=a.getAttribute(ccs.CONST_A_Y)}e&&(c.y=-parseFloat(e),c.y*=this._positionReadScale);e=a.getAttribute(ccs.CONST_A_SCALE_X);null!=e&&(c.scaleX=parseFloat(e));e=a.getAttribute(ccs.CONST_A_SCALE_Y);null!=e&&(c.scaleY=parseFloat(e));e=a.getAttribute(ccs.CONST_A_SKEW_X);null!=e&&(c.skewX=cc.degreesToRadians(parseFloat(e)));e=a.getAttribute(ccs.CONST_A_SKEW_Y);null!=e&&(c.skewY=cc.degreesToRadians(-parseFloat(e)));e=a.getAttribute(ccs.CONST_A_DURATION);null!=e&& (c.duration=parseFloat(e));e=a.getAttribute(ccs.CONST_A_DISPLAY_INDEX);null!=e&&(c.displayIndex=parseFloat(e));e=a.getAttribute(ccs.CONST_A_Z);null!=e&&(c.zOrder=parseInt(e));e=a.getAttribute(ccs.CONST_A_TWEEN_ROTATE);null!=e&&(c.tweenRotate=parseFloat(e));e=a.getAttribute(ccs.CONST_A_BLEND_TYPE);if(null!=e){var f=c.blendFunc;switch(e){case ccs.BLEND_TYPE_NORMAL:f.src=cc.BLEND_SRC;f.dst=cc.BLEND_DST;break;case ccs.BLEND_TYPE_ADD:f.src=cc.SRC_ALPHA;f.dst=cc.ONE;break;case ccs.BLEND_TYPE_MULTIPLY:f.src= cc.DST_COLOR;f.dst=cc.ONE_MINUS_SRC_ALPHA;break;case ccs.BLEND_TYPE_SCREEN:f.src=cc.ONE;f.dst=cc.ONE_MINUS_DST_COLOR;break;default:c.blendFunc.src=cc.BLEND_SRC,c.blendFunc.dst=cc.BLEND_DST}}var g=a.querySelectorAll(ccs.CONST_FRAME+" \x3e "+ccs.CONST_A_COLOR_TRANSFORM);if(g&&0=ccs.CONST_VERSION_2_0?(a.x=parseFloat(b.getAttribute(ccs.CONST_A_COCOS2DX_X)),a.y=parseFloat(b.getAttribute(ccs.CONST_A_COCOS2DX_Y))):(a.x=parseFloat(b.getAttribute(ccs.CONST_A_X)),a.y=parseFloat(b.getAttribute(ccs.CONST_A_Y))),a.skewX=parseFloat(b.getAttribute(ccs.CONST_A_SKEW_X)),a.skewY=parseFloat(b.getAttribute(ccs.CONST_A_SKEW_Y)),a.y=-a.y,a.skewX=cc.degreesToRadians(a.skewX),a.skewY=cc.degreesToRadians(-a.skewY),ccs.TransformHelp.transformFromParent(c, a));return c},decodeFrameFromJson:function(a,b){var c=new ccs.FrameData;this.decodeNodeFromJson(c,a,b);c.tweenEasing=a[ccs.CONST_A_TWEEN_EASING]||ccs.TweenType.LINEAR;c.displayIndex=a[ccs.CONST_A_DISPLAY_INDEX];var d=null==a[ccs.CONST_A_BLEND_DST]?cc.BLEND_DST:a[ccs.CONST_A_BLEND_DST];c.blendFunc.src=null==a[ccs.CONST_A_BLEND_SRC]?cc.BLEND_SRC:a[ccs.CONST_A_BLEND_SRC];c.blendFunc.dst=d;c.isTween=null==a[ccs.CONST_A_TWEEN_FRAME]?!0:a[ccs.CONST_A_TWEEN_FRAME];d=a[ccs.CONST_A_EVENT];null!=d&&(c.strEvent= d,c.event=d);b.cocoStudioVersion=ccs.CONST_VERSION_2_0?(d=parseFloat(a.getAttribute(ccs.CONST_A_COCOS2D_PIVOT_X))|| 0,e=parseFloat(a.getAttribute(ccs.CONST_A_COCOS2D_PIVOT_Y))||0):(d=parseFloat(a.getAttribute(ccs.CONST_A_PIVOT_X))||0,e=parseFloat(a.getAttribute(ccs.CONST_A_PIVOT_Y))||0);var f=parseFloat(a.getAttribute(ccs.CONST_A_WIDTH))||0,g=parseFloat(a.getAttribute(ccs.CONST_A_HEIGHT))||0;c.pivotX=d/f;c.pivotY=(g-e)/g;d=a.querySelectorAll(ccs.CONST_SUB_TEXTURE+" \x3e "+ccs.CONST_CONTOUR);for(e=0;ea)return 0.5*a*a;--a;return-0.5*(a*(a-2)-1)};ccs.TweenFunction.cubicEaseIn=function(a){return a*a*a};ccs.TweenFunction.cubicEaseOut=function(a){a-=1;return a*a*a+1};ccs.TweenFunction.cubicEaseInOut=function(a){a*=2;if(1>a)return 0.5*a*a*a;a-=2;return 0.5*(a*a*a+2)};ccs.TweenFunction.quartEaseIn=function(a){return a*a*a*a}; ccs.TweenFunction.quartEaseOut=function(a){a-=1;return-(a*a*a*a-1)};ccs.TweenFunction.quartEaseInOut=function(a){a*=2;if(1>a)return 0.5*a*a*a*a;a-=2;return-0.5*(a*a*a*a-2)};ccs.TweenFunction.quintEaseIn=function(a){return a*a*a*a*a};ccs.TweenFunction.quintEaseOut=function(a){a-=1;return a*a*a*a*a+1};ccs.TweenFunction.quintEaseInOut=function(a){a*=2;if(1>a)return 0.5*a*a*a*a*a;a-=2;return 0.5*(a*a*a*a*a+2)};ccs.TweenFunction.expoEaseIn=function(a){return 0===a?0:Math.pow(2,10*(a-1))-0.001}; ccs.TweenFunction.expoEaseOut=function(a){return 1===a?1:-Math.pow(2,-10*a)+1};ccs.TweenFunction.expoEaseInOut=function(a){a/=0.5;return a=1>a?0.5*Math.pow(2,10*(a-1)):0.5*(-Math.pow(2,-10*(a-1))+2)};ccs.TweenFunction.circEaseIn=function(a){return-1*(Math.sqrt(1-a*a)-1)};ccs.TweenFunction.circEaseOut=function(a){a-=1;return Math.sqrt(1-a*a)};ccs.TweenFunction.circEaseInOut=function(a){a*=2;if(1>a)return-0.5*(Math.sqrt(1-a*a)-1);a-=2;return 0.5*(Math.sqrt(1-a*a)+1)}; ccs.TweenFunction.elasticEaseIn=function(a,b){var c=0.3;0a?-0.5*Math.pow(2,10*a)*Math.sin((a-d)*ccs.DOUBLE_PI/c):Math.pow(2,-10*a)*Math.sin((a-d)*ccs.DOUBLE_PI/c)*0.5+1);return d};ccs.TweenFunction.backEaseIn=function(a){return a*a*(2.70158*a-1.70158)};ccs.TweenFunction.backEaseOut=function(a){a-=1;return a*a*(2.70158*a+1.70158)+1}; ccs.TweenFunction.backEaseInOut=function(a){a*=2;if(1>a)return a*a*(3.5949095*a-2.5949095)/2;a-=2;return a*a*(3.5949095*a+2.5949095)/2+1};ccs.bounceTime=function(a){if(a<1/2.75)return 7.5625*a*a;if(a<2/2.75)return a-=1.5/2.75,7.5625*a*a+0.75;if(a<2.5/2.75)return a-=2.25/2.75,7.5625*a*a+0.9375;a-=2.625/2.75;return 7.5625*a*a+0.984375};ccs.TweenFunction.bounceEaseIn=function(a){return 1-ccs.bounceTime(1-a)};ccs.TweenFunction.bounceEaseOut=function(a){return ccs.bounceTime(a)}; ccs.TweenFunction.bounceEaseInOut=function(a){var b=0;return b=0.5>a?0.5*(1-ccs.bounceTime(1-2*a)):0.5*ccs.bounceTime(2*a-1)+0.5};ccs.TweenFunction.customEase=function(a,b){if(0a?0.5*Math.pow(a,b):1-0.5*Math.pow(2-a,b)}; ccs.TweenFunction.quadraticIn=function(a){return Math.pow(a,2)};ccs.TweenFunction.quadraticOut=function(a){return-a*(a-2)};ccs.TweenFunction.bezieratFunction=function(a,b,c,d,e){return Math.pow(1-e,3)*a+3*e*Math.pow(1-e,2)*b+3*Math.pow(e,2)*(1-e)*c+Math.pow(e,3)*d};var ENABLE_PHYSICS_DETECT=!1;ccs.fmodf=function(a,b){for(;a>b;)a-=b;return a};var CC_SAFE_RELEASE=function(a){a&&a.release&&a.release()};ccs.isSpriteContainPoint=function(a,b,c){b=a.convertToNodeSpace(b);c&&(c.x=b.x,c.y=b.y);a=a.getContentSize();return cc.rectContainsPoint(cc.rect(0,0,a.width,a.height),b)};ccs.SPRITE_CONTAIN_POINT=ccs.isSpriteContainPoint;ccs.SPRITE_CONTAIN_POINT_WITH_RETURN=ccs.isSpriteContainPoint; ccs.extBezierTo=function(a,b,c,d,e){var f=cc.p(0,0);d&&!e&&(f.x=Math.pow(1-a,2)*b.x+2*a*(1-a)*c.x+Math.pow(a,2)*d.x,f.y=Math.pow(1-a,2)*b.y+2*a*(1-a)*c.y+Math.pow(a,2)*d.y);e&&(f.x=b.x*Math.pow(1-a,3)+3*a*c.x*Math.pow(1-a,2)+3*d.x*Math.pow(a,2)*(1-a)+e.x*Math.pow(a,3),f.y=b.y*Math.pow(1-a,3)+3*a*c.y*Math.pow(1-a,2)+3*d.y*Math.pow(a,2)*(1-a)+e.y*Math.pow(a,3));return f};ccs.extCircleTo=function(a,b,c,d,e){var f=cc.p(0,0);f.x=b.x+c*Math.cos(d+e*a);f.y=b.y+c*Math.sin(d+e*a);return f};ccs.RelativeData=function(){this.plistFiles=[];this.armatures=[];this.animations=[];this.textures=[]}; ccs.armatureDataManager={_animationDatas:{},_armatureDatas:{},_textureDatas:{},_autoLoadSpriteFile:!1,_relativeDatas:{},s_sharedArmatureDataManager:null,removeArmatureFileInfo:function(a){var b=this.getRelativeData(a);if(b){var c,d;for(c=0;cccs.M_PI&&(this.skewX-=ccs.DOUBLE_PI),this.skewX<-ccs.M_PI&&(this.skewX+=ccs.DOUBLE_PI),this.skewY>ccs.M_PI&&(this.skewY-=ccs.DOUBLE_PI),this.skewY<-ccs.M_PI&&(this.skewY+=ccs.DOUBLE_PI));b.tweenRotate&&(this.skewX+=b.tweenRotate*ccs.PI*2,this.skewY-=b.tweenRotate*ccs.PI*2)}}); ccs.DisplayData=ccs.Class.extend({displayType:ccs.DISPLAY_TYPE_MAX,displayName:"",ctor:function(){this.displayType=ccs.DISPLAY_TYPE_MAX},changeDisplayToTexture:function(a){var b=a.lastIndexOf(".");-1!==b&&(a=a.substring(0,b));return a},copy:function(a){this.displayName=a.displayName;this.displayType=a.displayType}}); ccs.SpriteDisplayData=ccs.DisplayData.extend({skinData:null,ctor:function(){this.skinData=new ccs.BaseData;this.displayType=ccs.DISPLAY_TYPE_SPRITE},copy:function(a){ccs.DisplayData.prototype.copy.call(this,a);this.skinData=a.skinData}});ccs.ArmatureDisplayData=ccs.DisplayData.extend({ctor:function(){this.displayName="";this.displayType=ccs.DISPLAY_TYPE_ARMATURE}});ccs.ParticleDisplayData=ccs.DisplayData.extend({ctor:function(){this.displayType=ccs.DISPLAY_TYPE_PARTICLE}}); ccs.BoneData=ccs.BaseData.extend({displayDataList:null,name:"",parentName:"",boneDataTransform:null,ctor:function(){this.displayDataList=[];this.parentName=this.name="";this.boneDataTransform=null},init:function(){this.displayDataList.length=0;return!0},addDisplayData:function(a){this.displayDataList.push(a)},getDisplayData:function(a){return this.displayDataList[a]}}); ccs.ArmatureData=ccs.Class.extend({boneDataDic:null,name:"",dataVersion:0.1,ctor:function(){this.boneDataDic={};this.name="";this.dataVersion=0.1},init:function(){return!0},addBoneData:function(a){this.boneDataDic[a.name]=a},getBoneDataDic:function(){return this.boneDataDic},getBoneData:function(a){return this.boneDataDic[a]}}); ccs.FrameData=ccs.BaseData.extend({duration:0,tweenEasing:0,easingParamNumber:0,easingParams:null,displayIndex:-1,movement:"",event:"",sound:"",soundEffect:"",blendFunc:null,frameID:0,isTween:!0,ctor:function(){ccs.BaseData.prototype.ctor.call(this);this.duration=1;this.tweenEasing=ccs.TweenType.LINEAR;this.easingParamNumber=0;this.easingParams=[];this.displayIndex=0;this.soundEffect=this.sound=this.event=this.movement="";this.blendFunc=new cc.BlendFunc(cc.BLEND_SRC,cc.BLEND_DST);this.frameID=0;this.isTween= !0},copy:function(a){ccs.BaseData.prototype.copy.call(this,a);this.duration=a.duration;this.displayIndex=a.displayIndex;this.tweenEasing=a.tweenEasing;this.easingParamNumber=a.easingParamNumber;if(0!==this.easingParamNumber)for(var b=this.easingParams.length=0;b=ccs.CONST_VERSION_COMBINED?c.setSkinData(d.skinData):c.setSkinData(a.boneData))},initSpriteDisplay:function(a,b,c,d){var e=c.lastIndexOf("."); -1!==e&&(c=c.substring(0,e));(c=ccs.armatureDataManager.getTextureData(c))&&d.setAnchorPoint(cc.p(c.pivotX,c.pivotY));(ccs.ENABLE_PHYSICS_CHIPMUNK_DETECT||ccs.ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX)&&c&&0=this._decoDisplayList.length?cc.log("the index value is out of range"):(this._forceChangeDisplay=b,this._displayIndex!==a&&(this._displayIndex=a,0>a?this._displayRenderNode&&(this._displayRenderNode.removeFromParent(!0),this.setCurrentDecorativeDisplay(null)):this.setCurrentDecorativeDisplay(this._decoDisplayList[a])))},changeDisplayWithName:function(a,b){for(var c=this._decoDisplayList, d=0;dthis._displayIndex)return!1;void 0!==b&&(a=cc.p(a,b));if(this._currentDecoDisplay.getDisplayData().displayType===ccs.DISPLAY_TYPE_SPRITE){var c=this._currentDecoDisplay.getDisplay(),c=c.getChildByTag(0);return ccs.SPRITE_CONTAIN_POINT_WITH_RETURN(c,a)}return!1}, setVisible:function(a){this._displayRenderNode&&(this._visible=a,this._displayRenderNode.setVisible(a))},isVisible:function(){return this._visible},getContentSize:function(){return this._displayRenderNode?this._displayRenderNode.getContentSize():cc.size(0,0)},getBoundingBox:function(){return this._displayRenderNode?this._displayRenderNode.getBoundingBox():cc.rect(0,0,0,0)},getAnchorPoint:function(){return this._displayRenderNode?this._displayRenderNode.getAnchorPoint():cc.p(0,0)},getAnchorPointInPoints:function(){return this._displayRenderNode? this._displayRenderNode.getAnchorPointInPoints():cc.p(0,0)},getForceChangeDisplay:function(){return this._forceChangeDisplay},release:function(){this._decoDisplayList=null;this._displayRenderNode&&(this._displayRenderNode.removeFromParent(!0),this._displayRenderNode=null)}});ccs.DisplayManager.create=function(a){return new ccs.DisplayManager(a)};ccs.Skin=ccs.Sprite.extend({_skinData:null,bone:null,_skinTransform:null,_displayName:"",_armature:null,_className:"Skin",ctor:function(a,b){cc.Sprite.prototype.ctor.call(this);this.bone=this._skinData=null;this._displayName="";this._skinTransform=cc.affineTransformIdentity();this._armature=null;null==a||""===a?ccs.Skin.prototype.init.call(this):"#"===a[0]?ccs.Skin.prototype.initWithSpriteFrameName.call(this,a.substr(1)):ccs.Skin.prototype.initWithFile.call(this,a,b)},initWithSpriteFrameName:function(a){if(""=== a)return!1;var b=cc.spriteFrameCache.getSpriteFrame(a),c=!0;b?this.initWithSpriteFrame(b):(cc.log("Can't find CCSpriteFrame with %s. Please check your .plist file",a),c=!1);this._displayName=a;return c},initWithFile:function(a,b){var c=b?cc.Sprite.prototype.initWithFile.call(this,a,b):cc.Sprite.prototype.initWithFile.call(this,a);this._displayName=a;return c},setSkinData:function(a){this._skinData=a;this.setScaleX(a.scaleX);this.setScaleY(a.scaleY);this.setRotationX(cc.radiansToDegrees(a.skewX)); this.setRotationY(cc.radiansToDegrees(-a.skewY));this.setPosition(a.x,a.y);this._renderCmd.transform()},getSkinData:function(){return this._skinData},updateArmatureTransform:function(){this._renderCmd.transform()},getNodeToWorldTransform:function(){return this._renderCmd.getNodeToWorldTransform()},getNodeToWorldTransformAR:function(){return this._renderCmd.getNodeToWorldTransformAR()},setBone:function(a){this.bone=a;if(a=this.bone.getArmature())this._armature=a},getBone:function(){return this.bone}, getDisplayName:function(){return this._displayName},_createRenderCmd:function(){return cc._renderType===cc.game.RENDER_TYPE_CANVAS?new ccs.Skin.CanvasRenderCmd(this):new ccs.Skin.WebGLRenderCmd(this)}});_p=ccs.Skin.prototype;cc.defineGetterSetter(_p,"skinData",_p.getSkinData,_p.setSkinData);cc.defineGetterSetter(_p,"displayName",_p.getDisplayName);_p=null;ccs.Skin.create=function(a,b){return new ccs.Skin(a,b)};ccs.Skin.createWithSpriteFrameName=function(a){return new ccs.Skin("#"+a)};(function(){ccs.Skin.RenderCmd={_realWorldTM:null,transform:function(a,c){this._transform||(this._transform={a:1,b:0,c:0,d:1,tx:0,ty:0},this._worldTransform={a:1,b:0,c:0,d:1,tx:0,ty:0});var d=this._node,e=a?a._worldTransform:null,f=this._transform,g=this._worldTransform;if(this._dirtyFlag&cc.Node._dirtyFlags.transformDirty||e)this.originTransform(),cc.affineTransformConcatIn(this._transform,d.bone.getNodeToArmatureTransform()),this._dirtyFlag&=~cc.Node._dirtyFlags.transformDirty;if(e){if(g.a=f.a* e.a+f.b*e.c,g.b=f.a*e.b+f.b*e.d,g.c=f.c*e.a+f.d*e.c,g.d=f.c*e.b+f.d*e.d,g.tx=f.tx*e.a+f.ty*e.c+e.tx,g.ty=f.tx*e.b+f.ty*e.d+e.ty,e=this._vertices){var h=d._offsetPosition.x,k=h+d._rect.width,m=d._offsetPosition.y,d=m+d._rect.height;e[0].x=h*g.a+d*g.c+g.tx;e[0].y=h*g.b+d*g.d+g.ty;e[1].x=h*g.a+m*g.c+g.tx;e[1].y=h*g.b+m*g.d+g.ty;e[2].x=k*g.a+d*g.c+g.tx;e[2].y=k*g.b+d*g.d+g.ty;e[3].x=k*g.a+m*g.c+g.tx;e[3].y=k*g.b+m*g.d+g.ty}}else g.a=f.a,g.b=f.b,g.c=f.c,g.d=f.d,g.tx=f.tx,g.ty=f.ty;if(g=this._realWorldTM)g.a= f.a,g.b=f.b,g.c=f.c,g.d=f.d,g.tx=f.tx,g.ty=f.ty,cc.affineTransformConcatIn(g,this._node.bone.getArmature()._renderCmd._worldTransform)},getNodeToWorldTransform:function(){return cc.affineTransformConcat(this._transform,this._node.bone.getArmature().getNodeToWorldTransform())},getNodeToWorldTransformAR:function(){var a=this._transform,c=this._node;this._anchorPointInPoints=cc.pointApplyAffineTransform(this._anchorPointInPoints,a);a.tx=this._anchorPointInPoints.x;a.ty=this._anchorPointInPoints.y;return cc.affineTransformConcat(a, c.bone.getArmature().getNodeToWorldTransform())}};ccs.Skin.CanvasRenderCmd=function(a){this._spriteCmdCtor(a);this._realWorldTM={a:1,b:0,c:0,d:1,tx:0,ty:0}};var a=ccs.Skin.CanvasRenderCmd.prototype=Object.create(cc.Sprite.CanvasRenderCmd.prototype);cc.inject(ccs.Skin.RenderCmd,a);a.constructor=ccs.Skin.CanvasRenderCmd;a._updateCurrentRegions=function(){var a=this._currentRegion;this._currentRegion=this._oldRegion;this._oldRegion=a;cc.Node.CanvasRenderCmd.RegionStatus.DirtyDouble!==this._regionFlag|| this._currentRegion.isEmpty()||this._oldRegion.union(this._currentRegion);this._currentRegion.updateRegion(this.getLocalBB(),this._realWorldTM)};ccs.Skin.WebGLRenderCmd=function(a){this._spriteCmdCtor(a)};a=ccs.Skin.WebGLRenderCmd.prototype=Object.create(cc.Sprite.WebGLRenderCmd.prototype);cc.inject(ccs.Skin.RenderCmd,a);a.constructor=ccs.Skin.WebGLRenderCmd})();ccs.ANIMATION_TYPE_SINGLE_FRAME=-4;ccs.ANIMATION_TYPE_NO_LOOP=-3;ccs.ANIMATION_TYPE_TO_LOOP_FRONT=-2;ccs.ANIMATION_TYPE_TO_LOOP_BACK=-1;ccs.ANIMATION_TYPE_LOOP_FRONT=0;ccs.ANIMATION_TYPE_LOOP_BACK=1;ccs.ANIMATION_TYPE_MAX=2; ccs.ProcessBase=ccs.Class.extend({_processScale:1,_isComplete:!0,_isPause:!0,_isPlaying:!1,_currentPercent:0,_rawDuration:0,_loopType:0,_tweenEasing:0,animationInternal:null,_currentFrame:0,_durationTween:0,_nextFrameIndex:0,_curFrameIndex:null,_isLoopBack:!1,ctor:function(){this._processScale=1;this._isPause=this._isComplete=!0;this._isPlaying=!1;this._rawDuration=this._durationTween=this._currentPercent=this._currentFrame=0;this._loopType=ccs.ANIMATION_TYPE_LOOP_BACK;this._tweenEasing=ccs.TweenType.LINEAR; this.animationInternal=1/60;this._durationTween=this._curFrameIndex=0;this._isLoopBack=!1},pause:function(){this._isPause=!0;this._isPlaying=!1},resume:function(){this._isPause=!1;this._isPlaying=!0},stop:function(){this._isComplete=!0;this._isPlaying=!1},play:function(a,b,c,d){this._isPause=this._isComplete=!1;this._isPlaying=!0;this._currentFrame=0;this._nextFrameIndex=a;this._tweenEasing=d},update:function(a){if(!(this._isComplete||this._isPause||0>=this._rawDuration||1=b?(this._currentPercent=1,c=0):(c+=a/this.animationInternal*this._processScale,this._currentPercent=c/b,c=ccs.fmodf(c,b));this._currentFrame=c;this.updateHandler()}},gotoFrame:function(a){var b=this._loopType;b===ccs.ANIMATION_TYPE_NO_LOOP?b=ccs.ANIMATION_TYPE_MAX:b===ccs.ANIMATION_TYPE_TO_LOOP_FRONT&&(b=ccs.ANIMATION_TYPE_LOOP_FRONT);this._loopType=b;this._curFrameIndex=a;this._nextFrameIndex=this._durationTween},getCurrentFrameIndex:function(){return this._curFrameIndex= (this._rawDuration-1)*this._currentPercent},updateHandler:function(){},isPause:function(){return this._isPause},isComplete:function(){return this._isComplete},getCurrentPercent:function(){return this._currentPercent},getRawDuration:function(){return this._rawDuration},getLoop:function(){return this._loopType},getTweenEasing:function(){return this._tweenEasing},getAnimationInternal:function(){return this.animationInternal},setAnimationInternal:function(a){this.animationInternal=a},getProcessScale:function(){return this._processScale}, setProcessScale:function(a){this._processScale=a},isPlaying:function(){return this._isPlaying}});_p=ccs.ProcessBase.prototype;cc.defineGetterSetter(_p,"currentFrameIndex",_p.getCurrentFrameIndex);cc.defineGetterSetter(_p,"paused",_p.isPause);cc.defineGetterSetter(_p,"completed",_p.isComplete);cc.defineGetterSetter(_p,"currentPercent",_p.getCurrentPercent);cc.defineGetterSetter(_p,"rawDuration",_p.getRawDuration);cc.defineGetterSetter(_p,"loop",_p.getLoop);cc.defineGetterSetter(_p,"tweenEasing",_p.getTweenEasing); cc.defineGetterSetter(_p,"playing",_p.isPlaying);_p=null;ccs.MovementEventType={start:0,complete:1,loopComplete:2};ccs.AnimationEvent=ccs.Class.extend({_arguments:null,_callFunc:null,_selectorTarget:null,ctor:function(a,b,c){this._data=c;this._callFunc=a;this._selectorTarget=b},call:function(){this._callFunc&&this._callFunc.apply(this._selectorTarget,this._arguments)},setArguments:function(a){this._arguments=a}});ccs.MovementEvent=function(){this.armature=null;this.movementType=ccs.MovementEventType.start;this.movementID=""}; ccs.FrameEvent=function(){this.bone=null;this.frameEventName="";this.currentFrameIndex=this.originFrameIndex=0}; ccs.ArmatureAnimation=ccs.ProcessBase.extend({_animationData:null,_movementData:null,_armature:null,_movementID:"",_toIndex:0,_tweenList:null,_speedScale:1,_ignoreFrameEvent:!1,_frameEventQueue:null,_movementEventQueue:null,_movementList:null,_onMovementList:!1,_movementListLoop:!1,_movementIndex:0,_movementListDurationTo:-1,_movementEventCallFunc:null,_frameEventCallFunc:null,_movementEventTarget:null,_frameEventTarget:null,_movementEventListener:null,_frameEventListener:null,ctor:function(a){ccs.ProcessBase.prototype.ctor.call(this); this._tweenList=[];this._movementList=[];this._frameEventQueue=[];this._movementEventQueue=[];this._armature=null;a&&ccs.ArmatureAnimation.prototype.init.call(this,a)},init:function(a){this._armature=a;this._tweenList.length=0;return!0},pause:function(){for(var a=this._tweenList,b=0;bc?this._movementData.loop:c;this._onMovementList=!1;ccs.ProcessBase.prototype.play.call(this,b,a,c,d);0===this._rawDuration?this._loopType=ccs.ANIMATION_TYPE_SINGLE_FRAME:(this._loopType=c?ccs.ANIMATION_TYPE_TO_LOOP_FRONT:ccs.ANIMATION_TYPE_NO_LOOP,this._durationTween=a);this._tweenList.length=0;var e,f=this._armature.getBoneDic(),g;for(g in f){var h= f[g];e=this._movementData.movBoneDataDic[h.getName()];var k=h.getTween();e&&0a||a>=this._movementData.duration)cc.log("Please ensure you have played a movement, and the frameIndex is in the range.");else{var b=this._ignoreFrameEvent;this._isPlaying= this._ignoreFrameEvent=!0;this._isComplete=this._isPause=!1;ccs.ProcessBase.prototype.gotoFrame.call(this,a);this._currentPercent=this._curFrameIndex/(this._movementData.duration-1);this._currentFrame=this._nextFrameIndex*this._currentPercent;for(var c=this._tweenList,d=0;da){this._nextFrameIndex=this._durationTween;this.movementEvent(this._armature, ccs.MovementEventType.start,this._movementID);break}break;case ccs.ANIMATION_TYPE_MAX:case ccs.ANIMATION_TYPE_SINGLE_FRAME:a=1;this._isComplete=!0;this._isPlaying=!1;this.movementEvent(this._armature,ccs.MovementEventType.complete,this._movementID);this.updateMovementList();break;case ccs.ANIMATION_TYPE_TO_LOOP_FRONT:this._loopType=ccs.ANIMATION_TYPE_LOOP_FRONT;a=ccs.fmodf(a,1);this._currentFrame=0===this._nextFrameIndex?0:ccs.fmodf(this._currentFrame,this._nextFrameIndex);this._nextFrameIndex=0< this._durationTween?this._durationTween:1;this.movementEvent(this,ccs.MovementEventType.start,this._movementID);break;default:this._currentFrame=ccs.fmodf(this._currentFrame,this._nextFrameIndex),this._toIndex=0,this.movementEvent(this._armature,ccs.MovementEventType.loopComplete,this._movementID)}this._currentPercent=a}},getCurrentMovementID:function(){return this._isComplete?"":this._movementID},setMovementEventCallFunc:function(a,b){1===arguments.length?this._movementEventListener=a:2===arguments.length&& (this._movementEventTarget=b,this._movementEventCallFunc=a)},setFrameEventCallFunc:function(a,b){1===arguments.length?this._frameEventListener=a:2===arguments.length&&(this._frameEventTarget=b,this._frameEventCallFunc=a)},setUserObject:function(a){this._userObject=a},frameEvent:function(a,b,c,d){if(this._frameEventTarget&&this._frameEventCallFunc||this._frameEventListener){var e=new ccs.FrameEvent;e.bone=a;e.frameEventName=b;e.originFrameIndex=c;e.currentFrameIndex=d;this._frameEventQueue.push(e)}}, movementEvent:function(a,b,c){if(this._movementEventTarget&&this._movementEventCallFunc||this._movementEventListener){var d=new ccs.MovementEvent;d.armature=a;d.movementType=b;d.movementID=c;this._movementEventQueue.push(d)}},updateMovementList:function(){if(this._onMovementList){var a,b=this._movementList;this._movementListLoop?(a=b[this._movementIndex],this.play(a,a.durationTo,0),this._movementIndex++,this._movementIndex>=b.length&&(this._movementIndex=0)):this._movementIndex=ccs.CONST_VERSION_COMBINED&&(ccs.TransformHelp.nodeSub(this._tweenData,this._bone.getBoneData()),this._tweenData.scaleX+=1,this._tweenData.scaleY+=1);0===this._rawDuration?(this._loopType=ccs.ANIMATION_TYPE_SINGLE_FRAME,0===b?this.setBetween(a,a):this.setBetween(this._tweenData,a),this._frameTweenEasing=ccs.TweenType.LINEAR):1=this._durationTween?1:(a-1)*this._nextFrameIndex/this._durationTween;1<=a?(a=1,this._isComplete=!0,this._isPlaying= !1):(this._nextFrameIndex=this._durationTween,this._currentFrame=a*this._nextFrameIndex,this._fromIndex=this._toIndex=this._betweenDuration=this._totalDuration=0);break;case ccs.ANIMATION_TYPE_TO_LOOP_FRONT:b=ccs.ANIMATION_TYPE_LOOP_FRONT;this._nextFrameIndex=0a&&bccs.ANIMATION_TYPE_TO_LOOP_BACK&&(a=this.updateFrameData(a));this._frameTweenEasing!==ccs.TweenType.TWEEN_EASING_MAX&&this.tweenNodeTo(a)},setBetween:function(a,b,c){void 0===c&&(c=!0);0>a.displayIndex&& 0<=b.displayIndex?(this._from.copy(b),this._between.subtract(b,b,c)):0>b.displayIndex&&0<=a.displayIndex?(this._from.copy(a),this._between.subtract(b,b,c)):(this._from.copy(a),this._between.subtract(a,b,c));a.isTween||(this._tweenData.copy(a),this._tweenData.isTween=!0);this.arriveKeyFrame(a)},arriveKeyFrame:function(a){if(a){var b=this._bone,c=b.getDisplayManager(),d=a.displayIndex;c.getForceChangeDisplay()||c.changeDisplayWithIndex(d,!1);this._tweenData.zOrder=a.zOrder;b.updateZOrder();this._bone.setBlendFunc(a.blendFunc); (b=b.getChildArmature())&&""!==a.movement&&b.getAnimation().play(a.movement)}},tweenNodeTo:function(a,b){b||(b=this._tweenData);var c=this._from,d=this._between;c.isTween||(a=0);b.x=c.x+a*d.x;b.y=c.y+a*d.y;b.scaleX=c.scaleX+a*d.scaleX;b.scaleY=c.scaleY+a*d.scaleY;b.skewX=c.skewX+a*d.skewX;b.skewY=c.skewY+a*d.skewY;this._bone.setTransformDirty(!0);b&&d.isUseColorInfo&&this.tweenColorTo(a,b);return b},tweenColorTo:function(a,b){var c=this._from,d=this._between;b.a=c.a+a*d.a;b.r=c.r+a*d.r;b.g=c.g+a* d.g;b.b=c.b+a*d.b;this._bone.updateColor()},updateFrameData:function(a){1=d+e){var e=this._movementBoneData.frameList,g=e.length;if(a=e[g-1].frameID){if(this._passLastFrame)return b=c=e[g-1],this.setBetween(b,c),this._currentPercent;this._passLastFrame=!0}else this._passLastFrame= !1;do if(this._fromIndex=f,b=e[this._fromIndex],d=b.frameID,f=this._fromIndex+1,f>=g&&(f=0),c=e[f],b.strEvent&&!this._animation.isIgnoreFrameEvent()&&this._animation.frameEvent(this._bone,b.strEvent,b.frameID,a),a===b.frameID||this._passLastFrame&&this._fromIndex===g-1)break;while(a=c.frameID);e=c.frameID-b.frameID;this._frameTweenEasing=b.tweenEasing;this.setBetween(b,c,!1);this._totalDuration=d;this._betweenDuration=e;this._toIndex=f}a=0===e?0:(a-this._totalDuration)/this._betweenDuration; b=this._frameTweenEasing!==ccs.TweenType.LINEAR?this._frameTweenEasing:this._tweenEasing;b===ccs.TweenType.TWEEN_EASING_MAX||b===ccs.TweenType.LINEAR||this._passLastFrame||(a=ccs.TweenFunction.tweenTo(a,b,this._from.easingParams));return a},setAnimation:function(a){this._animation=a},getAnimation:function(){return this._animation},setMovementBoneData:function(a){this._movementBoneData=a}});_p=ccs.Tween.prototype;cc.defineGetterSetter(_p,"animation",_p.getAnimation,_p.setAnimation);_p=null; ccs.Tween.create=function(a){return new ccs.Tween(a)};ccs.PT_RATIO=32;ccs.ColliderFilter=ccs.Class.extend({_collisionType:0,_group:0,_categoryBits:0,_groupIndex:0,_maskBits:0,ctor:function(a,b){this._collisionType=a||0;this._group=b||0},updateShape:function(a){if(a instanceof cp.Shape)a.collision_type=this._collisionType,a.group=this._group;else if(a instanceof Box2D.b2FilterData){var b=new Box2D.b2FilterData;b.categoryBits=this._categoryBits;b.groupIndex=this._groupIndex;b.maskBits=this._maskBits;a.SetFilterData(b)}}}); ccs.ColliderBody=ccs.Class.extend({shape:null,coutourData:null,colliderFilter:null,_calculatedVertexList:null,ctor:function(a){this.shape=null;this.coutourData=a;this.colliderFilter=new ccs.ColliderFilter;ccs.ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX&&(this._calculatedVertexList=[])},getContourData:function(){return this.coutourData},setColliderFilter:function(a){this.colliderFilter=a},getCalculatedVertexList:function(){return this._calculatedVertexList},setB2Fixture:function(a){this._fixture=a},getB2Fixture:function(){return this._fixture}, setShape:function(a){this.shape=a},getShape:function(){return this.shape},setContourData:function(a){this.coutourData=a},getColliderFilter:function(){return this.colliderFilter}}); ccs.ColliderDetector=ccs.Class.extend({_colliderBodyList:null,_bone:null,_body:null,_active:!1,_filter:null,helpPoint:cc.p(0,0),ctor:function(a){this._colliderBodyList=[];this._body=this._bone=null;this._active=!1;this._filter=null;ccs.ColliderDetector.prototype.init.call(this,a)},init:function(a){this._colliderBodyList.length=0;a&&(this._bone=a);this._filter=new ccs.ColliderFilter;return!0},addContourData:function(a){var b=new ccs.ColliderBody(a);this._colliderBodyList.push(b);if(ccs.ENABLE_PHYSICS_SAVE_CALCULATED_VERTEX){b= b.getCalculatedVertexList();a=a.vertexList;for(var c=0;c=f.frameList.length)&&(f=f.getFrameData(0))&&(c.getTweenData().copy(f),c.changeDisplayWithIndex(f.displayIndex,!1))}this.update(0);this.updateOffsetPoint()}else a="new_armature",this.armatureData=new ccs.ArmatureData,this.armatureData.name=a,d=new ccs.AnimationData,d.name=a,c.addArmatureData(a,this.armatureData),c.addAnimationData(a,d),this.animation.setAnimationData(d);this._renderCmd.initShaderCache();this.setCascadeOpacityEnabled(!0);this.setCascadeColorEnabled(!0); return!0},visit:function(a){this._visible&&(this._renderCmd.visit(a&&a._renderCmd),this._renderCmd._dirtyFlag=0)},addChild:function(a,b,c){a instanceof ccui.Widget?cc.log("Armature doesn't support to add Widget as its child, it will be fix soon."):cc.Node.prototype.addChild.call(this,a,b,c)},createBone:function(a){var b=this.getBone(a);if(b)return b;var b=this.armatureData.getBoneData(a),c=b.parentName,d=null;c?(this.createBone(c),d=new ccs.Bone(a),this.addBone(d,c)):(d=new ccs.Bone(a),this.addBone(d, ""));d.setBoneData(b);d.getDisplayManager().changeDisplayWithIndex(-1,!1);return d},addBone:function(a,b){cc.assert(a,"Argument must be non-nil");var c=this._boneDic;a.getName()&&cc.assert(!c[a.getName()],"bone already added. It can't be added again");if(b){var d=c[b];d?d.addChildBone(a):this._topBoneList.push(a)}else this._topBoneList.push(a);a.setArmature(this);c[a.getName()]=a;this.addChild(a)},removeBone:function(a,b){cc.assert(a,"bone must be added to the bone dictionary!");a.setArmature(null); a.removeFromParent(b);cc.arrayRemoveObject(this._topBoneList,a);delete this._boneDic[a.getName()];this.removeChild(a,!0)},getBone:function(a){return this._boneDic[a]},changeBoneParent:function(a,b){cc.assert(a,"bone must be added to the bone dictionary!");var c=a.getParentBone();c&&(cc.arrayRemoveObject(c.getChildren(),a),a.setParentBone(null));b&&((c=this._boneDic[b])?(c.addChildBone(a),cc.arrayRemoveObject(this._topBoneList,a)):this._topBoneList.push(a))},getBoneDic:function(){return this._boneDic}, updateOffsetPoint:function(){var a=this.getBoundingBox();this.setContentSize(a);var b=this._offsetPoint;b.x=-a.x;b.y=-a.y;0!==a.width&&0!==a.height&&this.setAnchorPoint(b.x/a.width,b.y/a.height)},getOffsetPoints:function(){return{x:this._offsetPoint.x,y:this._offsetPoint.y}},setAnimation:function(a){this.animation=a},getAnimation:function(){return this.animation},getArmatureTransformDirty:function(){return this._armatureTransformDirty},update:function(a){this.animation.update(a);for(var b=this._topBoneList, c=0;cf.x+f.width?d.x+d.width:f.x+f.width,d=d.y+d.height>f.y+f.height?d.y+d.height:f.y+f.height),f.x=a,f.y=b,f.width=c-a,f.height=d-b;return cc.rectApplyAffineTransform(f,this.getNodeToParentTransform())},getBoneAtPoint:function(a,b){for(var c=this._children,d=c.length-1;0<=d;d--){var e=c[d];if(e instanceof ccs.Bone&&e.getDisplayManager().containPoint(a,b))return e}return null},setParentBone:function(a){this._parentBone=a;a=this._boneDic;for(var b in a)a[b].setArmature(this)}, getParentBone:function(){return this._parentBone},drawContour:function(){cc._drawingUtil.setDrawColor(255,255,255,255);cc._drawingUtil.setLineWidth(1);var a=this._boneDic,b;for(b in a){var c=a[b].getColliderDetector();if(c)for(var c=c.getColliderBodyList(),d=0;df._localZOrder)f.visit(a);else break;for(cc.renderer.pushRenderCommand(c);d< g;d++)e[d].visit(a)}else cc.renderer.pushRenderCommand(c);this._dirtyFlag=0}}};a.visit=function(a){var c=this._node;c._visible&&(this._syncStatus(a),c.sortAllChildren(),cc.renderer.pushRenderCommand(this._startRenderCmd),this.rendering(),cc.renderer.pushRenderCommand(this._RestoreRenderCmd),this._cacheDirty=!1)}})();(function(){ccs.Armature.WebGLRenderCmd=function(a){this._rootCtor(a);this._needDraw=!0;this._parentCmd=null;this._realAnchorPointInPoints=new cc.Point(0,0);this._transform={a:1,b:0,c:0,d:1,tx:0,ty:0};this._worldTransform={a:1,b:0,c:0,d:1,tx:0,ty:0}};var a=ccs.Armature.WebGLRenderCmd.prototype=Object.create(cc.Node.WebGLRenderCmd.prototype);cc.inject(ccs.Armature.RenderCmd,a);a.constructor=ccs.Armature.WebGLRenderCmd;a.uploadData=function(a,c,d){a=this._node;d=this._parentCmd||this;for(var e=a._children, f=cc.BlendFunc.ALPHA_PREMULTIPLIED,g=cc.BlendFunc.ALPHA_NON_PREMULTIPLIED,h=0,k=e.length;hc._localZOrder)isNaN(c._customZ)&&(c._vertexZ=a.assignedZ,a.assignedZ+=a.assignedZStep);else break; for(a.pushRenderCommand(this);e=ccs.CONST_VERSION_COMBINED&&(ccs.TransformHelp.nodeConcat(b,this._boneData),b.scaleX-=1,b.scaleY-=1);var c=this._worldInfo;c.copy(b);c.x=b.x+this._position.x;c.y=b.y+this._position.y; c.scaleX=b.scaleX*this._scaleX;c.scaleY=b.scaleY*this._scaleY;c.skewX=b.skewX+this._skewX+cc.degreesToRadians(this._rotationX);c.skewY=b.skewY+this._skewY-cc.degreesToRadians(this._rotationY);this._parentBone?this._applyParentTransform(this._parentBone):this._armatureParentBone&&this._applyParentTransform(this._armatureParentBone);ccs.TransformHelp.nodeToMatrix(c,this._worldTransform);this._armatureParentBone&&cc.affineTransformConcatIn(this._worldTransform,this._armature.getNodeToParentTransform())}ccs.displayFactory.updateDisplay(this, a,this._boneTransformDirty||this._armature.getArmatureTransformDirty());for(b=0;b=ccs.CONST_VERSION_COMBINED?this.setLocalZOrder(this._tweenData.zOrder+this._boneData.zOrder): this.setLocalZOrder(this._tweenData.zOrder)},addChildBone:function(a){cc.assert(a,"Argument must be non-nil");cc.assert(!a.parentBone,"child already added. It can't be added again");0>this._children.indexOf(a)&&(this._children.push(a),a.setParentBone(this))},removeChildBone:function(a,b){if(0=c.length)){for(var d=[],e=0;e=f.length||(b=!0,f=f[0].frameIndex,a=a>f?f:a)}b||(a=0);return a},getLastFrameIndex:function(){for(var a=-1,b=!1,c=this._frameArray,d=0,e=this._frameArrayNum;d=f.length||(b=!0,f=f[f.length-1].frameIndex,a=aa){0===f?(this._easingToFrame(1,1,g),b=!1):(b=e[f-1],e=(g.frameIndex-b.frameIndex)*c,f=a-b.frameIndex*c,this._easingToFrame(e,1,b),this._easingToFrame(e,f/e,g),b=!0);break}}}return b},_easingToFrame:function(a,b,c){a=c.getAction(a);c=this.getActionNode();null!=a&&null!=c&&(a.startWithTarget(c),a.update(b))},isActionDoneOnce:function(){return this._action?this._action.isDone():!0}});ccs.ActionObject=ccs.Class.extend({_actionNodeList:null,_name:"",_loop:!1,_pause:!1,_playing:!1,_unitTime:0,_currentTime:0,_scheduler:null,_callback:null,_fTotalTime:0,ctor:function(){this._actionNodeList=[];this._name="";this._playing=this._pause=this._loop=!1;this._unitTime=0.1;this._fTotalTime=this._currentTime=0;this._scheduler=cc.director.getScheduler()},setName:function(a){this._name=a},getName:function(){return this._name},setLoop:function(a){this._loop=a},getLoop:function(){return this._loop}, setUnitTime:function(a){this._unitTime=a;a=this._actionNodeList.length;for(var b=0;bd&&(d=f)}this._fTotalTime=d*this._unitTime},addActionNode:function(a){a&&(this._actionNodeList.push(a),a.setUnitTime(this._unitTime))},removeActionNode:function(a){null!=a&&cc.arrayRemoveObject(this._actionNodeList,a)},play:function(a){this.stop();this.updateToFrameByTime(0);for(var b=this._actionNodeList,c=b.length, d=0;d=this._eventTriggers.length},addArmatureMovementCallBack:function(a,b,c){if(null!=a&&null!=c&&null!=b){for(var d,e=!1,f=0;fd||this._vInt.push(d)},getId:function(){return this._id},setEnable:function(a){this._enable=a},getEvents:function(){return this._vInt}});ccs.TriggerObj.create=function(){return new ccs.TriggerObj};ccs.ActionTimelineData=ccs.Class.extend({_actionTag:0,ctor:function(a){this._init(a)},_init:function(a){this._actionTag=a;return!0},setActionTag:function(a){this._actionTag=a},getActionTag:function(){return this._actionTag}});ccs.AnimationInfo=function(a,b,c){this.name=a;this.startIndex=b;this.endIndex=c}; ccs.ComExtensionData=ccs.Component.extend({_customProperty:null,_timelineData:null,_name:"ComExtensionData",ctor:function(){this._customProperty="";this._timelineData=new ccs.ActionTimelineData(0);return!0},setActionTag:function(a){this._timelineData.setActionTag(a)},getActionTag:function(){return this._timelineData.getActionTag()},setCustomProperty:function(a){this._customProperty=a},getCustomProperty:function(){return this._customProperty}});ccs.ComExtensionData.create=function(){return new ccs.ComExtensionData}; ccs.ActionTimelineData.create=function(a){return new ccs.ActionTimelineData(a)}; ccs.ActionTimeline=cc.Action.extend({_timelineMap:null,_timelineList:null,_duration:0,_time:null,_timeSpeed:1,_frameInternal:1/60,_playing:!1,_currentFrame:0,_startFrame:0,_endFrame:0,_loop:null,_frameEventListener:null,_animationInfos:null,_lastFrameListener:null,ctor:function(){cc.Action.prototype.ctor.call(this);this._timelineMap={};this._timelineList=[];this._animationInfos={};this.init()},_gotoFrame:function(a){for(var b=this._timelineList.length,c=0;c=this._startFrame&&a<=this._endFrame?(this._currentFrame=a,this._time=this._currentFrame*this._frameInternal):cc.log("frame index is not between start frame and end frame")},getCurrentFrame:function(){return this._currentFrame},addTimeline:function(a){var b=a.getActionTag();this._timelineMap[b]||(this._timelineMap[b]=[]);-1=== this._timelineMap[b].indexOf(a)&&(this._timelineList.push(a),this._timelineMap[b].push(a),a.setActionTimeline(this))},removeTimeline:function(a){var b=a.getActionTag();this._timelineMap[b]&&this._timelineMap[b].some(function(b){if(b===a)return!0})&&(cc.arrayRemoveObject(this._timelineMap[b],a),cc.arrayRemoveObject(this._timelineList,a),a.setActionTimeline(null))},getTimelines:function(){return this._timelineList},setFrameEventCallFunc:function(a){this._frameEventListener=a},clearFrameEventCallFunc:function(){this._frameEventListener= null},clone:function(){var a=new ccs.ActionTimeline;a.setDuration(this._duration);a.setTimeSpeed(this._timeSpeed);for(var b in this._timelineMap){var c=this._timelineMap[b],d;for(d in c){var e=c[d].clone();a.addTimeline(e)}}return a},reverse:function(){return null},step:function(a){this._playing&&0!==this._timelineMap.length&&0!==this._duration&&(this._time+=a*this._timeSpeed,a=this._time-this._endFrame*this._frameInternal,ad&&(c+=d);ccs.InnerActionType.NoLoopAction===this._innerActionType?a.gotoFrameAndPlay(b,c,!1):ccs.InnerActionType.LoopAction=== this._innerActionType&&a.gotoFrameAndPlay(b,c,!0)}},setAnimationName:function(a){this._animationName=a},setSingleFrameIndex:function(a){this._singleFrameIndex=a},getSingleFrameIndex:function(){return this._startFrameIndex},setEnterWithName:function(a){this._enterWithName=a},getEnterWithName:function(){return this._enterWithName},clone:function(){var a=new ccs.InnerActionFrame;a.setInnerActionType(this._innerActionType);a.setStartFrameIndex(this._startFrameIndex);a.setEnterWithName(this._enterWithName); a.setAnimationName(this._animationName);a.setSingleFrameIndex(this._singleFrameIndex);a._cloneProperty(this);return a},setInnerActionType:function(a){this._innerActionType=a},getInnerActionType:function(){return this._innerActionType},setStartFrameIndex:function(a){this._startFrameIndex=a},getStartFrameIndex:function(){return this._startFrameIndex}});ccs.InnerActionFrame.create=function(){return new ccs.InnerActionFrame}; ccs.ColorFrame=ccs.Frame.extend({_alpha:null,_color:null,_betweenAlpha:null,_betweenRed:null,_betweenGreen:null,_betweenBlue:null,ctor:function(){ccs.Frame.prototype.ctor.call(this);this._color=cc.color(255,255,255)},onEnter:function(a){this._node&&(this._node.setColor(this._color),this._tween&&(a=a._color,this._betweenRed=a.r-this._color.r,this._betweenGreen=a.g-this._color.g,this._betweenBlue=a.b-this._color.b))},_onApply:function(a){if(this._node&&this._tween&&(0!==this._betweenAlpha||0!==this._betweenRed|| 0!==this._betweenGreen||0!==this._betweenBlue)){var b=cc.color(255,255,255);b.r=this._color.r+this._betweenRed*a;b.g=this._color.g+this._betweenGreen*a;b.b=this._color.b+this._betweenBlue*a;this._node.setColor(b);null!==this._alpha&&this._node.setOpacity(this._alpha+this._betweenAlpha*a)}},clone:function(){var a=new ccs.ColorFrame;a.setColor(this._color);a._cloneProperty(this);return a},setColor:function(a){this._color=a},getColor:function(){return this._color}});ccs.ColorFrame.create=function(){return new ccs.ColorFrame}; ccs.AlphaFrame=ccs.Frame.extend({_alpha:null,_betweenAlpha:null,ctor:function(){ccs.Frame.prototype.ctor.call(this);this._alpha=255},onEnter:function(a){this._node&&(this._node.setOpacity(this._alpha),this._tween&&(this._betweenAlpha=a._alpha-this._alpha))},_onApply:function(a){this._node&&this._node.setOpacity(this._alpha+this._betweenAlpha*a)},setAlpha:function(a){this._alpha=a},getAlpha:function(){return this._alpha},clone:function(){var a=new ccs.AlphaFrame;a.setAlpha(this._alpha);a._cloneProperty(this); return a}});ccs.EventFrame=ccs.Frame.extend({_event:null,ctor:function(){ccs.Frame.prototype.ctor.call(this);this._event="";this._enterWhenPassed=!0},onEnter:function(a){this._emitEvent()},clone:function(){var a=new ccs.EventFrame;a.setEvent(this._event);a._cloneProperty(this);return a},setEvent:function(a){this._event=a},getEvent:function(){return this._event}});ccs.EventFrame.create=function(){return new ccs.EventFrame}; ccs.ZOrderFrame=ccs.Frame.extend({_zorder:0,onEnter:function(a){this._node&&this._node.setLocalZOrder(this._zorder)},clone:function(){var a=new ccs.ZOrderFrame;a.setZOrder(this._zorder);a._cloneProperty(this);return a},setZOrder:function(a){this._zorder=a},getZOrder:function(){return this._zorder}});ccs.ZOrderFrame.create=function(){return new ccs.ZOrderFrame}; ccs.BlendFuncFrame=ccs.Frame.extend({ctor:function(){this._super();this._blendFunc=null},onEnter:function(a,b){this._node&&this._blendFunc&&this._node.setBlendFunc(this._blendFunc)},clone:function(){var a=new ccs.BlendFuncFrame;a.setBlendFunc(this._blendFunc);a._cloneProperty(this);return a},setBlendFunc:function(a){a&&a.src&&a.dst&&(this._blendFunc=a)},getBlendFunc:function(){return this._blendFunc}});ccs.BlendFuncFrame.create=function(){return new ccs.BlendFuncFrame};ccs.Timeline=ccs.Class.extend({_frames:null,_currentKeyFrame:null,_currentKeyFrameIndex:null,_fromIndex:null,_toIndex:null,_betweenDuration:null,_actionTag:null,_ActionTimeline:null,_node:null,ctor:function(){this._frames=[];this._currentKeyFrame=null;this._actionTag=this._betweenDuration=this._toIndex=this._fromIndex=this._currentKeyFrameIndex=0;this._node=this._ActionTimeline=null},_gotoFrame:function(a){0!==this._frames.length&&(this._binarySearchKeyFrame(a),this._apply(a))},_stepToFrame:function(a){0!== this._frames.length&&(this._updateCurrentKeyFrame(a),this._apply(a))},getFrames:function(){return this._frames},addFrame:function(a){this._frames.push(a);a.setTimeline(this)},insertFrame:function(a,b){this._frames.splice(b,0,a);a.setTimeline(this)},removeFrame:function(a){cc.arrayRemoveObject(this._frames,a);a.setTimeline(null)},setActionTag:function(a){this._actionTag=a},getActionTag:function(){return this._actionTag},setNode:function(a){for(var b=0;b=this._betweenDuration?0:(a-this._currentKeyFrameIndex)/this._betweenDuration)},_binarySearchKeyFrame:function(a){var b= null,c=null,d=this._frames.length,e=!1;do if(a=this._frames[0].getFrameIndex()&&(e=!0),this._toIndex=this._fromIndex=0,b=c=this._frames[0],this._currentKeyFrameIndex=0,this._betweenDuration=this._frames[0].getFrameIndex();else if(a>=this._frames[d-1].getFrameIndex())this._fromIndex=d-1,this._toIndex=0,b=c=this._frames[d-1],this._currentKeyFrameIndex=this._frames[d-1].getFrameIndex(),this._betweenDuration=0;else{for(var f=-1,b=0,c=d-1,g=0;b<= c;){g=Math.ceil((b+c)/2);if(a>=this._frames[g].getFrameIndex()&&aa?c=g-1:b=g+1}this._fromIndex=f;this._toIndex=1=this._currentKeyFrameIndex+this._betweenDuration){var b=null,c=null;do{var d=this._frames.length;if(a=this._frames[d-1].getFrameIndex()&&(a=this._frames[d-1].getFrameIndex(),this._currentKeyFrameIndex>=a))return;do{this._fromIndex=this._toIndex;b=this._frames[this._fromIndex];this._currentKeyFrameIndex= b.getFrameIndex();this._toIndex=this._fromIndex+1;this._toIndex>=d&&(this._toIndex=0);c=this._frames[this._toIndex];if(a===b.getFrameIndex())break;if(a>b.getFrameIndex()&&ad._localZOrder)d.visit(this);else break;for(;bp?b.rotationIK=g+(Math.atan2(d,c)*spine.radDeg-h-g)*f:(p= (c*c+d*d-m*m-n*n)/p,-1>p?p=-1:1c&&(c+=360),a.rotationIK=h+c*f,c=(e+k)*spine.radDeg-g,180c&&(c+=360),b.rotationIK=g+(c+a.worldRotation-b.parent.worldRotation)*f)}else b.rotationIK=g,a.rotationIK=h};spine.Skin=function(a){this.name=a;this.attachments={}}; spine.Skin.prototype={addAttachment:function(a,b,c){this.attachments[a+":"+b]=c},getAttachment:function(a,b){return this.attachments[a+":"+b]},_attachAll:function(a,b){for(var c in b.attachments){var d=c.indexOf(":"),e=parseInt(c.substring(0,d)),f=c.substring(d+1),d=a.slots[e];d.attachment&&d.attachment.name==f&&(e=this.getAttachment(e,f))&&d.setAttachment(e)}}};spine.Animation=function(a,b,c){this.name=a;this.timelines=b;this.duration=c}; spine.Animation.prototype={apply:function(a,b,c,d,e){d&&0!=this.duration&&(c%=this.duration,b%=this.duration);d=this.timelines;for(var f=0,g=d.length;f>>1;;){a[(f+1)*c]<=b?d=f+1:e=f;if(d==e)return(d+1)*c;f=d+e>>>1}};spine.Animation.binarySearch1=function(a,b){var c=0,d=a.length-2;if(!d)return 1;for(var e=d>>>1;;){a[e+1]<=b?c=e+1:d=e;if(c==d)return c+1;e=c+d>>>1}};spine.Animation.linearSearch=function(a,b,c){for(var d=0,e=a.length-c;d<=e;d+=c)if(a[d]>b)return d;return-1};spine.Curves=function(a){this.curves=[]}; spine.Curves.prototype={setLinear:function(a){this.curves[19*a]=0},setStepped:function(a){this.curves[19*a]=1},setCurve:function(a,b,c,d,e){var f=0.1*0.1,g=0.1*f,h=3*0.1,k=3*f,m=6*f,f=6*g,n=2*-b+d,p=2*-c+e;d=3*(b-d)+1;e=3*(c-e)+1;b=b*h+n*k+d*g;c=c*h+p*k+e*g;g=n*m+d*f;m=p*m+e*f;p=d*f;f*=e;a*=19;d=this.curves;d[a++]=2;e=b;h=c;for(k=a+19-1;ab?0:1=b)return d==f?g=f=0:(f=c[d-2],g=c[d-1]),g+(c[d+1]-g)*(b-f)/(e-f);c=c[d-1];return c+(1-c)*(b-e)/(1-e)}};spine.RotateTimeline=function(a){this.boneIndex=0;this.curves=new spine.Curves(a);this.frames=[];this.frames.length=2*a}; spine.RotateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(a,b,c){a*=2;this.frames[a]=b;this.frames[a+1]=c},apply:function(a,b,c,d,e){b=this.frames;if(!(c=b[b.length-2])b=a.data.rotation+b[b.length-1]-a.rotation;else{var f=spine.Animation.binarySearch(b,c,2);d=b[f-1];var g=b[f];c=1-(c-g)/(b[f-2]-g);c=this.curves.getCurvePercent(f/2-1,c);for(b=b[f+1]-d;180b;)b+=360;b=a.data.rotation+ (d+b*c)-a.rotation}for(;180b;)b+=360;a.rotation+=b*e}}};spine.TranslateTimeline=function(a){this.boneIndex=0;this.curves=new spine.Curves(a);this.frames=[];this.frames.length=3*a}; spine.TranslateTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(a,b,c,d){a*=3;this.frames[a]=b;this.frames[a+1]=c;this.frames[a+2]=d},apply:function(a,b,c,d,e){b=this.frames;if(!(c=b[b.length-3])a.x+=(a.data.x+b[b.length-2]-a.x)*e,a.y+=(a.data.y+b[b.length-1]-a.y)*e;else{d=spine.Animation.binarySearch(b,c,3);var f=b[d-2],g=b[d-1],h=b[d];c=1-(c-h)/(b[d+-3]-h);c=this.curves.getCurvePercent(d/3-1,c);a.x+=(a.data.x+ f+(b[d+1]-f)*c-a.x)*e;a.y+=(a.data.y+g+(b[d+2]-g)*c-a.y)*e}}};spine.ScaleTimeline=function(a){this.boneIndex=0;this.curves=new spine.Curves(a);this.frames=[];this.frames.length=3*a}; spine.ScaleTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/3},setFrame:function(a,b,c,d){a*=3;this.frames[a]=b;this.frames[a+1]=c;this.frames[a+2]=d},apply:function(a,b,c,d,e){b=this.frames;if(!(c=b[b.length-3])a.scaleX+=(a.data.scaleX*b[b.length-2]-a.scaleX)*e,a.scaleY+=(a.data.scaleY*b[b.length-1]-a.scaleY)*e;else{d=spine.Animation.binarySearch(b,c,3);var f=b[d-2],g=b[d-1],h=b[d];c=1-(c-h)/(b[d+-3]-h);c=this.curves.getCurvePercent(d/ 3-1,c);a.scaleX+=(a.data.scaleX*(f+(b[d+1]-f)*c)-a.scaleX)*e;a.scaleY+=(a.data.scaleY*(g+(b[d+2]-g)*c)-a.scaleY)*e}}};spine.ColorTimeline=function(a){this.boneIndex=0;this.curves=new spine.Curves(a);this.frames=[];this.frames.length=5*a}; spine.ColorTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length/5},setFrame:function(a,b,c,d,e,f){a*=5;this.frames[a]=b;this.frames[a+1]=c;this.frames[a+2]=d;this.frames[a+3]=e;this.frames[a+4]=f},apply:function(a,b,c,d,e){b=this.frames;if(!(c=b[b.length-5])d=b.length-1,c=b[d-3],f=b[d-2],g=b[d-1],b=b[d];else{d=spine.Animation.binarySearch(b,c,5);var h=b[d-4];f=b[d-3];g=b[d-2];var k=b[d-1],m=b[d],m=1-(c-m)/(b[d-5]-m),m=this.curves.getCurvePercent(d/ 5-1,m);c=h+(b[d+1]-h)*m;f+=(b[d+2]-f)*m;g+=(b[d+3]-g)*m;b=k+(b[d+4]-k)*m}a=a.slots[this.slotIndex];1>e?(a.r+=(c-a.r)*e,a.g+=(f-a.g)*e,a.b+=(g-a.b)*e,a.a+=(b-a.a)*e):(a.r=c,a.g=f,a.b=g,a.a=b)}}};spine.AttachmentTimeline=function(a){this.slotIndex=0;this.curves=new spine.Curves(a);this.frames=[];this.frames.length=a;this.attachmentNames=[];this.attachmentNames.length=a}; spine.AttachmentTimeline.prototype={slotIndex:0,getFrameCount:function(){return this.frames.length},setFrame:function(a,b,c){this.frames[a]=b;this.attachmentNames[a]=c},apply:function(a,b,c,d,e){d=this.frames;cc&&this.apply(a,b,Number.MAX_VALUE,null,0):(b>c&&(b=-1),c=c>=d[d.length-1]?d.length-1:spine.Animation.binarySearch1(d,c)-1,d[c]c)this.apply(a,b,Number.MAX_VALUE,d,e),b=-1;else if(b>=f[g-1])return;if(!(c=f[a];a++)d.push(b[a])}}}}; spine.DrawOrderTimeline=function(a){this.frames=[];this.frames.length=a;this.drawOrders=[];this.drawOrders.length=a}; spine.DrawOrderTimeline.prototype={getFrameCount:function(){return this.frames.length},setFrame:function(a,b,c){this.frames[a]=b;this.drawOrders[a]=c},apply:function(a,b,c,d,e){b=this.frames;if(!(c=b[b.length-1]?b.length-1:spine.Animation.binarySearch1(b,c)-1,c=a.drawOrder,b=a.slots,d=this.drawOrders[d])for(e=0,f=d.length;e=f[f.length-1])if(c=d[f.length-1],1>e)for(d=0;dc?0:1e)for(d=0;d=b[b.length-3])a.mix+=(b[b.length-2]-a.mix)*e,a.bendDirection=b[b.length-1];else{d=spine.Animation.binarySearch(b,c,3);var f=b[d+-2],g=b[d];c=1-(c-g)/(b[d+-3]-g);c=this.curves.getCurvePercent(d/3-1,c); a.mix+=(f+(b[d+1]-f)*c-a.mix)*e;a.bendDirection=b[d+-1]}}};spine.FlipXTimeline=function(a){this.boneIndex=0;this.curves=new spine.Curves(a);this.frames=[];this.frames.length=2*a}; spine.FlipXTimeline.prototype={boneIndex:0,getFrameCount:function(){return this.frames.length/2},setFrame:function(a,b,c){a*=2;this.frames[a]=b;this.frames[a+1]=c?1:0},apply:function(a,b,c,d,e){d=this.frames;cc&&this.apply(a,b,Number.MAX_VALUE,null,0):(b>c&&(b=-1),c=(c>=d[d.length-2]?d.length:spine.Animation.binarySearch(d,c,2))-2,d[c]c&&this.apply(a,b,Number.MAX_VALUE,null,0):(b>c&&(b=-1),c=(c>=d[d.length-2]?d.length:spine.Animation.binarySearch(d,c,2))-2,d[c]c&&(d.length=c);for(var e=0,f=d.length;e=c.endTime&&this.clearTrack(b)}}},apply:function(a){for(var b=0;bf&&(d=f);var h=c.previous;if(h){var k=h.time;!h.loop&&k>h.endTime&&(k=h.endTime);h.animation.apply(a,k,k,h.loop,null);h=c.mixTime/c.mixDuration*c.mix;1<=h&&(h=1,c.previous=null);c.animation.mix(a,c.lastTime,d,g,this.events,h)}else 1==c.mix?c.animation.apply(a,c.lastTime,d,g,this.events):c.animation.mix(a,c.lastTime,d,g,this.events,c.mix);h=0;for(k=this.events.length;hd%f:e=f){d=Math.floor(d/f);if(c.onComplete)c.onComplete(b,d);if(this.onComplete)this.onComplete(b,d)}c.lastTime=c.time}}},clearTracks:function(){for(var a=0,b=this.tracks.length;a=this.tracks.length)){var b=this.tracks[a];if(b){if(b.onEnd)b.onEnd(a);if(this.onEnd)this.onEnd(a);this.tracks[a]=null}}},_expandToIndex:function(a){if(a=this.tracks.length;)this.tracks.push(null); return null},setCurrent:function(a,b){var c=this._expandToIndex(a);if(c){var d=c.previous;c.previous=null;if(c.onEnd)c.onEnd(a);if(this.onEnd)this.onEnd(a);b.mixDuration=this.data.getMix(c.animation,b.animation);0c.mixTime/c.mixDuration?d:c)}this.tracks[a]=b;if(b.onStart)b.onStart(a);if(this.onStart)this.onStart(a)},setAnimationByName:function(a,b,c){var d=this.data.skeletonData.findAnimation(b);if(!d)throw Error("Animation not found: "+b);return this.setAnimation(a, d,c)},setAnimation:function(a,b,c){var d=new spine.TrackEntry;d.animation=b;d.loop=c;d.endTime=b.duration;this.setCurrent(a,d);return d},addAnimationByName:function(a,b,c,d){var e=this.data.skeletonData.findAnimation(b);if(!e)throw Error("Animation not found: "+b);return this.addAnimation(a,e,c,d)},addAnimation:function(a,b,c,d){var e=new spine.TrackEntry;e.animation=b;e.loop=c;e.endTime=b.duration;if(c=this._expandToIndex(a)){for(;c.next;)c=c.next;c.next=e}else this.tracks[a]=e;0>=d&&(d=c?d+(c.endTime- this.data.getMix(c.animation,b)):0);e.delay=d;return e},getCurrent:function(a){return a>=this.tracks.length?null:this.tracks[a]}};spine.SkeletonJson=function(a){this.scale=1;this.attachmentLoader=a}; spine.SkeletonJson.prototype={scale:1,readSkeletonData:function(a,b){var c=new spine.SkeletonData;c.name=b;var d=a.skeleton;d&&(c.hash=d.hash,c.version=d.spine,c.width=d.width||0,c.height=d.height||0);for(var e=a.bones,d=0,f=e.length;d=this.lines.length?null:this.lines[this.index++]},readValue:function(){var a=this.readLine(),b=a.indexOf(":");if(-1==b)throw Error("Invalid line: "+a);return this.trim(a.substring(b+1))},readTuple:function(a){var b=this.readLine(),c=b.indexOf(":");if(-1==c)throw Error("Invalid line: "+b);for(var d=0,c=c+1;3>d;d++){var e=b.indexOf(",",c);if(-1==e)break;a[d]=this.trim(b.substr(c, e-c));c=e+1}a[d]=this.trim(b.substring(c));return d+1}};spine.AtlasAttachmentLoader=function(a){this.atlas=a}; spine.AtlasAttachmentLoader.prototype={newRegionAttachment:function(a,b,c){a=this.atlas.findRegion(c);if(!a)throw Error("Region not found in atlas: "+c+" (region attachment: "+b+")");b=new spine.RegionAttachment(b);b.rendererObject=a;b.setUVs(a.u,a.v,a.u2,a.v2,a.rotate);b.regionOffsetX=a.offsetX;b.regionOffsetY=a.offsetY;b.regionWidth=a.width;b.regionHeight=a.height;b.regionOriginalWidth=a.originalWidth;b.regionOriginalHeight=a.originalHeight;return b},newMeshAttachment:function(a,b,c){a=this.atlas.findRegion(c); if(!a)throw Error("Region not found in atlas: "+c+" (mesh attachment: "+b+")");b=new spine.MeshAttachment(b);b.rendererObject=a;b.regionU=a.u;b.regionV=a.v;b.regionU2=a.u2;b.regionV2=a.v2;b.regionRotate=a.rotate;b.regionOffsetX=a.offsetX;b.regionOffsetY=a.offsetY;b.regionWidth=a.width;b.regionHeight=a.height;b.regionOriginalWidth=a.originalWidth;b.regionOriginalHeight=a.originalHeight;return b},newSkinnedMeshAttachment:function(a,b,c){a=this.atlas.findRegion(c);if(!a)throw Error("Region not found in atlas: "+ c+" (skinned mesh attachment: "+b+")");b=new spine.SkinnedMeshAttachment(b);b.rendererObject=a;b.regionU=a.u;b.regionV=a.v;b.regionU2=a.u2;b.regionV2=a.v2;b.regionRotate=a.rotate;b.regionOffsetX=a.offsetX;b.regionOffsetY=a.offsetY;b.regionWidth=a.width;b.regionHeight=a.height;b.regionOriginalWidth=a.originalWidth;b.regionOriginalHeight=a.originalHeight;return b},newBoundingBoxAttachment:function(a,b){return new spine.BoundingBoxAttachment(b)}}; spine.SkeletonBounds=function(){this.minX=this.minY=this.maxX=this.maxY=0;this.polygonPool=[];this.polygons=[];this.boundingBoxes=[]}; spine.SkeletonBounds.prototype={minX:0,minY:0,maxX:0,maxY:0,update:function(a,b){for(var c=a.slots,d=c.length,e=a.x,f=a.y,g=this.boundingBoxes,h=this.polygonPool,k=this.polygons,m=g.length=0,n=k.length;m=this.minX&&a<=this.maxX&&b>=this.minY&&b<=this.maxY},aabbIntersectsSegment:function(a,b,c,d){var e=this.minX,f=this.minY,g=this.maxX,h=this.maxY;if(a<=e&&c<=e||b<=f&&d<=f||a>= g&&c>=g||b>=h&&d>=h)return!1;c=(d-b)/(c-a);d=c*(e-a)+b;if(d>f&&df&&de&&fe&&fa.minX&&this.minYa.minY},containsPoint:function(a,b){for(var c=this.polygons,d=0,e=c.length;d=c||k=c){var m=a[g];m+(c-h)/(k-h)*(a[e]-m)=m&&t<=r||t>=r&&t<=m)&&(t>= b&&t<=d||t>=d&&t<=b)&&(m=(k*v-h*u)/w,(m>=n&&m<=s||m>=s&&m<=n)&&(m>=c&&m<=e||m>=e&&m<=c)))return!0;m=r;n=s}return!1},getPolygon:function(a){a=this.boundingBoxes.indexOf(a);return-1==a?null:this.polygons[a]},getWidth:function(){return this.maxX-this.minX},getHeight:function(){return this.maxY-this.minY}};var sp=sp||{};sp.VERTEX_INDEX={X1:0,Y1:1,X2:2,Y2:3,X3:4,Y3:5,X4:6,Y4:7};sp.ATTACHMENT_TYPE={REGION:0,BOUNDING_BOX:1,MESH:2,SKINNED_MESH:3}; sp.Skeleton=cc.Node.extend({_skeleton:null,_rootBone:null,_timeScale:1,_debugSlots:!1,_debugBones:!1,_premultipliedAlpha:!1,_ownsSkeletonData:null,_atlas:null,_blendFunc:null,ctor:function(a,b,c){cc.Node.prototype.ctor.call(this);0===arguments.length?this.init():this.initWithArgs(a,b,c)},_createRenderCmd:function(){return cc._renderType===cc.game.RENDER_TYPE_CANVAS?new sp.Skeleton.CanvasRenderCmd(this):new sp.Skeleton.WebGLRenderCmd(this)},init:function(){cc.Node.prototype.init.call(this);this._premultipliedAlpha= cc._renderType===cc.game.RENDER_TYPE_WEBGL&&cc.OPTIMIZE_BLEND_FUNC_FOR_PREMULTIPLIED_ALPHA;this._blendFunc={src:cc.BLEND_SRC,dst:cc.BLEND_DST};this.scheduleUpdate()},setDebugSolots:function(a){this._debugSlots=a},setDebugBones:function(a){this._debugBones=a},setDebugSlotsEnabled:function(a){this._debugSlots=a},getDebugSlotsEnabled:function(){return this._debugSlots},setDebugBonesEnabled:function(a){this._debugBones=a},getDebugBonesEnabled:function(){return this._debugBones},setTimeScale:function(a){this._timeScale= a},getTimeScale:function(){return this._timeScale},initWithArgs:function(a,b,c){if(cc.isString(a)){if(cc.isString(b)){var d=cc.loader.getRes(b);sp._atlasLoader.setAtlasFile(b);b=new spine.Atlas(d,sp._atlasLoader)}c=c||1/cc.director.getContentScaleFactor();d=new spine.AtlasAttachmentLoader(b);d=new spine.SkeletonJson(d);d.scale=c;a=cc.loader.getRes(a);a=d.readSkeletonData(a);b.dispose(d);c=!0}else c=b;this.setSkeletonData(a,c);this.init()},getBoundingBox:function(){for(var a=cc.FLT_MAX,b=cc.FLT_MAX, c=cc.FLT_MIN,d=cc.FLT_MIN,e=this.getScaleX(),f=this.getScaleY(),g=[],h=this._skeleton.slots,k=sp.VERTEX_INDEX,m=0,n=h.length;mTimeManager[b(214)]().currentServerTime&&(TimeManager[b(214)]()[b(213)]=Number(a[b(315)])));null!=a[b(298)][b(296)]&&(RSBingoManager[b(214)]().cheatEnabled=a[b(298)][b(296)]); RSEventManager[b(214)]()[b(187)](b(207))};events[a0_0x3480f4(309)]=function(a){var b=a0_0x3480f4;a=a[b(171)];RSCasinoManager[b(291)](a)};events[a0_0x3480f4(218)]=function(a){var b=a0_0x3480f4;a=a[b(171)];RSCasinoManager[b(205)](a)};events[a0_0x3480f4(289)]=function(a){var b=a0_0x3480f4,c=TOASTER_FOLDER,d=a[b(210)],e=a[b(246)],f=a[b(240)],g=a[b(167)],h=a.text,k=a[b(220)];a=a[b(258)];RSCasinoManager[b(294)](c,d,e,f,g,h,k,a)}; events.post_message=function(a){var b=a0_0x3480f4,c=a[b(175)];a=a[b(262)];RSCasinoManager[b(188)](c,a)};events.post_hydra_message=function(a){var b=a0_0x3480f4;a=JSON[b(312)](a[b(262)]);var c=a.data[b(288)];RSCasinoManager[b(188)](c,a)};events[a0_0x3480f4(196)]=function(a){var b=a0_0x3480f4;APIAdapter[b(283)]&&(a=a[b(237)],APIAdapter[b(283)](a),APIAdapter[b(283)]=null)};events[a0_0x3480f4(229)]=function(a){var b=a0_0x3480f4;if(typeof SideMenuController!==b(308))SideMenuController.getInstance()[b(272)](a[b(262)])}; events.loyaltymall=function(a){var b=a0_0x3480f4;RSGame[b(214)]().getGameManager()[b(191)](a)}; window.addEventListener(a0_0x3480f4(262),function(a){var b=a0_0x3480f4;try{var c="";"object"===typeof a.data?c=JSON[b(312)](JSON[b(195)](a[b(215)])):c=JSON[b(312)](a.data);var d=c[b(224)];c[b(200)]&&c[b(200)]==b(251)&&RSEngine[b(305)][b(259)](c[b(200)],a[b(215)]);if(d==b(229))events[d][b(184)](null,c);else if(d==b(267))events[d].call(null,c);else if("afWebUserId"==d)window[b(199)]=c.id;else if(events[d]){var e=c[b(315)];if(e>API_TIME_STAMP){API_TIME_STAMP=e;var f=c[b(193)];delete c[b(193)];var g= JSON.stringify(c),h=APIAdapter.getHash(MACHINE_NAME+"|"+g);h==f?events[d].call(null,c):API[b(173)](b(271),h+b(255)+f+b(198)+btoa(encodeURIComponent(JSON[b(195)](c))))}else API[b(173)](b(179),e+b(253)+API_TIME_STAMP+b(198)+btoa(encodeURIComponent(JSON[b(195)](c))))}else RSEngine[b(305)]?(c[b(170)]==b(222)&&RSEngine[b(305)][b(295)](a[b(276)],a[b(293)]),RSEngine.externalGameManager[b(259)](d,c),null!=c&&null!=c[b(175)]&&null!=c[b(215)]&&(null!=a[b(293)]&&null!=a[b(276)]&&RSEngine[b(305)][b(185)](a[b(276)], a.origin),RSEngine[b(305)].updateFromExternalGame(c[b(175)],c.data))):window!=parent&&API[b(263)](c);delete c[b(224)]}catch(k){}},!1);function RootClass(){}RootClass.prototype.init=function(){};RootClass.__asMethod__=function(a,b){return function(){var c=this._super;this._super=b;var d=a.apply(this,arguments);this._super=c;return d}};RootClass.extend=function(a){var b=function(){arguments[0]!==RootClass&&this.init.apply(this,arguments)},c=new this(RootClass),d=this.prototype,e;for(e in a){var f=a[e];f instanceof Function&&(f=RootClass.__asMethod__(f,d));c[e]=f}c._super=d;b.prototype=c;b.extend=this.extend;return b};var Interface=function(a,b){if(2!=arguments.length)throw Error("There should be 2 arguments for an interface");this.name=a;this.methods=[];for(var c=0,d=b.length;carguments.length)throw Error("Function Interface.ensureImplements called with "+arguments.length+"arguments, but expected at least 2.");for(var b=1,c=arguments.length;b=this._popupLayer.getChildrenCount()&&this._popupLayer.setVisible(!1);null!=b&&void 0!=b&&b()},showLoader:function(a){if(null== this._loaderLayer){this._loaderLayer=new cc.Layer;this.addChild(this._loaderLayer,2);var b=new cc.LayerColor(cc.color(0,0,0,0));b.setScale(3);this._loaderLayer.addChild(b);a&&this._loaderLayer.addChild(a.getDisplayObject())}},removeLoader:function(){null!=this._loaderLayer&&(this._loaderLayer.removeAllChildren(!0),this.removeChild(this._loaderLayer),this._loaderLayer=null)},setTouchEnabled:function(a){var b=this._layers.length;0b&&RSErrorTracker.getInstance().trackErrorMessage("FRAME_RATE","Frame Rate "+b+"Render Mode "+c,"mahesh.jose@rubyseven.net,lijith.puthiyoottil@rubyseven.net");this._isFrameRateTracked=!0}RSEngine.popupManager.update(a)},getCurrentScreen:function(){return 0< this._screens.length?this._screens[this._screens.length-1]:null},getCurrentScene:function(){if(null!=this._currentScene)return this._currentScene},addOverlay:function(a){this._currentScene.showLoader(new RSLoaderLayer(a));this._currentScene.setTouchEnabled(!1);this._currentScene.setPopupTouchEnabled(!1);this._isOverlayAdded=!0},removeOverlay:function(){this._currentScene.removeLoader();this._isOverlayAdded=!1;RSEngine.popupManager.isPopupActive()||this._currentScene.setTouchEnabled(!0);this._currentScene.setPopupTouchEnabled(!0)}, isOverlayActive:function(){return this._isOverlayAdded},onConnectionLost:function(){for(var a=0;a=this._activePopups.indexOf(a)||("undefined"!==typeof RSGame&&!0==this._isSfxActive&&RSGame.getInstance().getAssetPath("PopupExit_SFX")&& RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetPath("PopupExit_SFX"),!1),RSEngine.screenManager.getCurrentScene().removePopup(a,function(){b.onRemoveAnimComplete(a)}))},onRemoveAnimComplete:function(a){var b=RSEngine.screenManager.getCurrentScene();a.unload();this._activePopupCount--;RSUtils.removeFromArray(this._activePopups,a);0>=this._activePopupCount?(RSEngine.externalGameManager&&"undefined"!==typeof RSGame&&(RSGame.getInstance().getGameManager()?RSGame.getInstance().getGameManager().getMachineOpenPopupStatus()|| GlobalVars.isVIPSurfacingAnimationActive||RSEngine.externalGameManager.showExternalGame():RSEngine.externalGameManager.showExternalGame()),0=a._retryCount&&a.onProgress)a.onProgress(b)},function(b){b?a._onErrorLoading(b):a.cb&&a.cb()})},_onErrorLoading:function(a){this._retryCount++;if(3>=this._retryCount){for(var b=this.resources.length=0;b=j;j++)b+=hex_chr.charAt(a>>8*j+4&15)+hex_chr.charAt(a>>8*j&15);return b}function str2blks_MD5(a){var b=(a.length+8>>6)+1,c=Array(16*b);for(i=0;i<16*b;i++)c[i]=0;for(i=0;i>2]|=a.charCodeAt(i)<>2]|=128<>16)+(b>>16)+(c>>16)<<16|c&65535}function rol(a,b){return a<>>32-b} function cmn(a,b,c,d,e,f){return add(rol(add(add(b,a),add(d,f)),e),c)}function ff(a,b,c,d,e,f,g){return cmn(b&c|~b&d,a,b,e,f,g)}function gg(a,b,c,d,e,f,g){return cmn(b&d|c&~d,a,b,e,f,g)}function hh(a,b,c,d,e,f,g){return cmn(b^c^d,a,b,e,f,g)}function ii(a,b,c,d,e,f,g){return cmn(c^(b|~d),a,b,e,f,g)} function calcMD5(a){a=str2blks_MD5(a);for(var b=1732584193,c=-271733879,d=-1732584194,e=271733878,f=b,g=c,h=d,k=e,m=0;m>>0;for(this.mti=1;this.mti>>30,this.mt[this.mti]=(1812433253*((a&4294901760)>>>16)<<16)+1812433253*(a&65535)+this.mti,this.mt[this.mti]>>>=0}; MersenneTwister.prototype.init_by_array=function(a,b){var c,d,e;this.init_genrand(19650218);c=1;d=0;for(e=this.N>b?this.N:b;e;e--){var f=this.mt[c-1]^this.mt[c-1]>>>30;this.mt[c]=(this.mt[c]^(1664525*((f&4294901760)>>>16)<<16)+1664525*(f&65535))+a[d]+d;this.mt[c]>>>=0;c++;d++;c>=this.N&&(this.mt[0]=this.mt[this.N-1],c=1);d>=b&&(d=0)}for(e=this.N-1;e;e--)f=this.mt[c-1]^this.mt[c-1]>>>30,this.mt[c]=(this.mt[c]^(1566083941*((f&4294901760)>>>16)<<16)+1566083941*(f&65535))-c,this.mt[c]>>>=0,c++,c>=this.N&& (this.mt[0]=this.mt[this.N-1],c=1);this.mt[0]=2147483648}; MersenneTwister.prototype.genrand_int32=function(){var a,b=[0,this.MATRIX_A];if(this.mti>=this.N){var c;this.mti===this.N+1&&this.init_genrand(5489);for(c=0;c>>1^b[a&1];for(;c>>1^b[a&1];a=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK;this.mt[this.N-1]=this.mt[this.M- 1]^a>>>1^b[a&1];this.mti=0}a=this.mt[this.mti++];a^=a>>>11;a^=a<<7&2636928640;a^=a<<15&4022730752;return(a^a>>>18)>>>0};MersenneTwister.prototype.genrand_int31=function(){return this.genrand_int32()>>>1};MersenneTwister.prototype.genrand_real1=function(){return this.genrand_int32()*(1/4294967295)};MersenneTwister.prototype.random=function(){return this.genrand_int32()*(1/4294967296)};MersenneTwister.prototype.genrand_real3=function(){return(this.genrand_int32()+0.5)*(1/4294967296)}; MersenneTwister.prototype.genrand_res53=function(){var a=this.genrand_int32()>>>5,b=this.genrand_int32()>>>6;return 1.1102230246251565E-16*(67108864*a+b)};var MotherRNG=function(){var a,b=RSClass.extend({init:function(){this._mStart=1;this._mother1=[];this._mother2=[];this._m16Long=65536;this._m16Mask=65535;this._m15Mask=32767;this._m31Mask=2147483647;this._m32Double=4294967295},getRandom:function(a){if(this._mStart){a||(a=(new Date).getTime());var b=this._unsign(a&this._m16Mask);a=this._unsign(a&this._m31Mask);for(var e=0;9>e;e++)a=30903*b+this._unsign(a>>16),this._mother1[e]=b=this._unsign(a&this._m16Mask);for(e=0;9>e;e++)a=30903*b+this._unsign(a>> 16),this._mother2[e]=b=this._unsign(a&this._m16Mask);this._mother1[0]=this._unsign(this._mother1[0]&this._m15Mask);this._mother2[0]=this._unsign(this._mother2[0]&this._m15Mask);this._mStart=0}for(e=8;1<=e;e--)this._mother1[e+1]=this._mother1[e],this._mother2[e+1]=this._mother2[e];b=this._mother1[0];a=this._mother2[0];b+=1941*this._mother1[2]+1860*this._mother1[3]+1812*this._mother1[4]+1776*this._mother1[5]+1492*this._mother1[6]+1215*this._mother1[7]+1066*this._mother1[8]+12013*this._mother1[9];a+= 1111*this._mother2[2]+2222*this._mother2[3]+3333*this._mother2[4]+4444*this._mother2[5]+5555*this._mother2[6]+6666*this._mother2[7]+7777*this._mother2[8]+9272*this._mother2[9];this._mother1[0]=b/this._m16Long;this._mother2[0]=a/this._m16Long;this._mother1[1]=this._unsign(this._m16Mask&b);this._mother2[1]=this._unsign(this._m16Mask&a);a=this._unsign(this._mother1[1]<<16)+this._mother2[1];return a/this._m32Double},_unsign:function(a){return a>>>0}});return{getInstance:function(){a||(a=new b);return a}}}();var a0_0x1b7462=a0_0x1cac;(function(a,b){for(var c=a0_0x1cac,d=a();;)try{if(-parseInt(c(359))/1+-parseInt(c(403))/2+parseInt(c(405))/3*(-parseInt(c(360))/4)+parseInt(c(363))/5+parseInt(c(417))/6+-parseInt(c(351))/7*(-parseInt(c(293))/8)+-parseInt(c(393))/9*(-parseInt(c(309))/10)===b)break;else d.push(d.shift())}catch(e){d.push(d.shift())}})(a0_0x1197,610308);function a0_0x1cac(a,b){var c=a0_0x1197();return a0_0x1cac=function(a,b){return c[a-266]},a0_0x1cac(a,b)}var RSUtils=function(){}; RSUtils[a0_0x1b7462(327)]=function(a,b){var c=a0_0x1b7462;if(a>b){RSErrorTracker[c(355)]()[c(302)]("RNG_ERROR",c(377)+a+c(428)+b,c(345));var d=a;a=b;b=d}d=a-1;do d=Math[c(332)](MotherRNG[c(355)]().getRandom()*(b+1-(a-1))+(a-1));while(d>b||d=g){f=h[k];a=Math.floor(a/g);break}else g=Math[d(381)](g/1E3);if(a=a.length?c(f):(g++,h())}})};h()};RSUtils[a0_0x1b7462(376)]=function(a){var b=a0_0x1b7462;return a=a.toString(),a[b(375)](/(\d)(?=(\d{3})+(?!\d))/g,b(395))};RSUtils[a0_0x1b7462(288)]=function(a,b){var c=a0_0x1b7462;cc[c(344)][c(299)][c(392)](a,b)}; RSUtils[a0_0x1b7462(334)]=function(a,b){var c=a0_0x1b7462,d=b,e=cc.sys[c(299)].getItem(a);if(e!=c(415)&&null!=e)try{d=JSON.parse(e)}catch(f){d=e}return d};RSUtils.getLocalStorageItemAfterDecryption=function(a,b){var c=a0_0x1b7462,d=b,e=cc[c(344)][c(299)][c(414)](a);if(e!=c(415)&&null!=e)try{d=JSON[c(410)](e)}catch(f){d=e}return atob(d)};RSUtils[a0_0x1b7462(282)]=function(a){var b=a0_0x1b7462;cc[b(344)][b(299)][b(275)](a)}; RSUtils[a0_0x1b7462(425)]=function(){var a=a0_0x1b7462,b=cc[a(427)][a(304)]();return new RSSize(b[a(346)],b[a(416)])};RSUtils.callFunctionWithDelay=function(a,b,c){var d=a0_0x1b7462;a=cc[d(342)](a);c=cc[d(364)](c,this,this);return b[d(436)](cc[d(343)](a,c))};RSUtils.replaceChar=function(a,b,c){var d=a0_0x1b7462;return a[d(347)](0,b)+c+a[d(347)](b+1)};RSUtils[a0_0x1b7462(273)]=function(a){var b=a.lastIndexOf(".");return a.substring(b)}; RSUtils[a0_0x1b7462(420)]=function(a,b,c){var d=a0_0x1b7462,e=Math.floor(a/86400),d=Math[d(381)](a%86400/3600),f=Math.floor(a%86400%3600/60);a=Math.floor(a%86400%3600%60);var g="",g="00";(0d?e+"D:"+("0"+d):e+"D:"+(""+d):g=10>d?"0"+d:""+d);return b?(c?g=10>a?"0"+a:""+a:(g=10>f?"0"+f:""+f,g=g+":"+(10>a?"0"+a:""+a)),g):(g=g+":"+(10>f?"0"+f:""+f),g=g+":"+(10>a?"0"+a:""+a),g)}; RSUtils[a0_0x1b7462(335)]=function(a){var b=a0_0x1b7462,c;do{c=!1;for(var d=0;dg))switch(g%10){case 1:k="st";break;case 2:k="nd";break;case 3:k="rd";break;default:k="th"}var m="";b?m=f[h]+", "+e+" "+g+k+" "+d[c(354)]():m=e+" "+g+k+", "+d[c(354)]()}else m=" ";return m}; RSUtils[a0_0x1b7462(401)]=function(a,b){return a[a0_0x1b7462(367)](function(a,d){return parseInt(a[b])-parseInt(d[b])})};RSUtils[a0_0x1b7462(341)]=function(a,b){return a[a0_0x1b7462(367)](function(a,d){return parseFloat(a[b])-parseFloat(d[b])})};RSUtils[a0_0x1b7462(316)]=function(a,b,c){var d=a0_0x1b7462;return cc[d(316)](cc[d(267)](a.getX(),a[d(318)](),a[d(352)](),a[d(324)]()),cc.p(b,c))};RSUtils[a0_0x1b7462(268)]=function(a){var b=a0_0x1b7462;return calcMD5(a[b(356)]("|")+"|"+RSEngine[b(311)])}; RSUtils[a0_0x1b7462(336)]=function(){var a=a0_0x1b7462;GameFeatureTypeEnum[a(319)]?RSLoginManager.getInstance()[a(353)]():toggleLoginBox()};RSUtils[a0_0x1b7462(366)]=function(){setFacebookSession()};RSUtils.createUUID=function(a){var b=a0_0x1b7462,c=0,d=a.length;return 0=d?0:c,("x"==e?f:f&3|8).toString(16)}):null};RSUtils[a0_0x1b7462(388)]=function(a,b){return a.match(RegExp(b))?!0:!1}; RSUtils[a0_0x1b7462(269)]=function(a,b,c){return a[a0_0x1b7462(375)](b,c)};RSUtils[a0_0x1b7462(266)]=function(a){var b=a0_0x1b7462,c;for(c in a)if(a[b(276)](c))return!1;return!0}; RSUtils[a0_0x1b7462(371)]=function(a){var b=a0_0x1b7462,c=a==b(406)?b(357):b(286)+a,c=c.toString(),c=c[b(279)](""),d=0;for(a=0;aa;a++){var f="A";0==a%3&&(f="a");c.push(f[b(390)](0)+e%26);e+=d+parseInt(Math[b(429)](parseFloat(e)))}d="";for(a=0;32>a;a++)d+=String[b(337)](c[a%16]);return d};var RSEasing=function(){};RSEasing.easeElasticIn=function(a){return cc.easeElasticIn(a)};RSEasing.easeElasticOut=function(a){return cc.easeElasticOut(a)};RSEasing.easeBounceOut=function(){return cc.easeBounceOut()};var RSActions=function(){};RSActions.scaleTo=function(a,b,c){return cc.scaleTo(a,b,c)};RSActions.scaleBy=function(a,b,c){return cc.scaleBy(a,b,c)};RSActions.rotateTo=function(a,b,c){return cc.rotateTo(a,b,c)};RSActions.rotateBy=function(a,b,c){return cc.rotateBy(a,b,c)};RSActions.moveTo=function(a,b,c){return cc.moveTo(a,b,c)};RSActions.moveBy=function(a,b,c){return cc.moveBy(a,b,c)};RSActions.tintTo=function(a,b,c,d){return cc.tintTo(a,b,c,d)}; RSActions.tintBy=function(a,b,c,d){return cc.tintBy(a,b,c,d)};RSActions.skewTo=function(a,b,c){return cc.skewTo(a,b,c)};RSActions.skewBy=function(a,b,c){return cc.skewBy(a,b,c)};RSActions.bezierTo=function(a,b){for(var c=[],d=0;d=c||(this._children.splice(c,1),this.getDisplayObject().removeChild(a.getDisplayObject(),!0),b&&a.unload())},removeAllChildren:function(){for(;null!= this._children&&0=c?cc.log("Object not found to remove"):(this._children.splice(c,1),c=this.getDisplayObject(),this._screenClipper&&(c=this._screenClipper.getDisplayObject()), null!=a.getDisplayObject&&(c.removeChild(a.getDisplayObject(),b),b&&(a.unload(),delete a)))},removeAllChildren:function(){for(;0=c||(this._children.splice(c,1),this.getDisplayObject().removeChild(a.getDisplayObject(),b),b&&a.unload())},removeAllChildren:function(){for(;0this._popupSizeObject.getWidth()&&this._popupSizeObject.setWidth(b._contentSize.width),b._contentSize.height>this._popupSizeObject.getHeight()&& this._popupSizeObject.setHeight(b._contentSize.height))}}this._super.onReveal.call(this)},_addLoadingImage:function(){this._image=new RSImageObject;this._image.setAnchorPoint(0.5,0.5);var a=RSEngine.getLoadingAnimation();a&&(this._image.setImageFromUrl(a,0,0,75,75),this.addChild(this._image),this._image.setZOrder(1),this._image.setPosition(RSEngine.screenWidth/2,RSEngine.screenHeight/2),this._actionId=this._image.actionRotateBy(4,360,-1))},_removeLoadingImage:function(){this._image&&(this._actionId&& this._image.stopAllActions(),this.removeChild(this._image))},unloadContent:function(){if(null!=this._callback||void 0!=this._callback)this._callback(),this._callback=null;this._super.unloadContent.call(this)},handleTouchAt:function(a,b,c){},handleTouchMoveAt:function(a,b,c){},handleTouchEndAt:function(a,b,c){null!=this._popupSizeObject&&(RSUtils.rectContainsPoint(new RSRect(RSEngine.screenWidth/2-this._popupSizeObject.getWidth()/2,RSEngine.screenHeight/2-this._popupSizeObject.getHeight()/2,this._popupSizeObject.getWidth(), this._popupSizeObject.getHeight()),b,c)||this.closePopup())},closePopup:function(){this._closeTimeOut&&clearTimeout(this._closeTimeOut);this._isAssetsLoaded&&(this._backgroundHidden?RSEngine.screenManager.removeScreen(this):RSEngine.popupManager.removePopup(this))}});var RSGenericPopup=RSPopup.extend({_screenLayout:null,_callBack:null,_buttonArray:[],_assetConfig:{},init:function(a,b){this._callBack=a;(this._assetConfig=b)?RSUtils.loadSprite(b.assetPath):RSUtils.loadSprite(RSGame.getInstance().getAssetPath("GenericPopup"));this._screenName="GenericPopup";this._super.init.call(this,a)},createCustomObject:function(a,b){var c=null;if("CP"==b.type.substring(0,2)||"CP"==b.name.substring(0,2)){switch(b.type){case "CP_CloseBtn":c=RSUtils.createButton(this._screenName, b);this.addTouchListenerToButton(c);this._buttonArray.push(c);break;case (b.type.match(/CP_Button/)||{}).input:var d=RSUtils.createButton(this._screenName,b),e=null,c=null;e=this._assetConfig?this._assetConfig.font:(e=RSGame.getInstance().getGameManager().getGenericButtonFont())?e:RSGame.getInstance().getGameManager().getDefaultCasinoFont("medium","bold","stroke");this._assetConfig&&(c=this._assetConfig.wordList);c=new RSGenericButton(d,b,a,e,this.onButtonClicked.bind(this),c);this._buttonArray.push(d); break;case (b.type.match(/FLIP/)||{}).input:c=RSUtils.createBasicObject(this._screenName,b);c.setScaleX(-1);break;default:c=RSUtils.createBasicObject(this._screenName,b)}return c}},onButtonClicked:function(a){switch(a){case "CloseBtn":this.closePopup()}}});var RS_ERROR_TRACKER_QUEUE_KEY="RS_ERROR_TRACKER_QUEUE_KEY",RS_ERROR_TRACKER_DEFAULT_OWNER_ID="prajosh.sasidharan@rubyseven.net",RS_ERROR_TRACKER_SHOW_DEBUG_LOG=!1,RS_CLIENT_DETAILS={updateData:function(a,b){"undefined"!==typeof b&&(RS_CLIENT_DETAILS[a]=b)}}; window.addEventListener("error",function(a){try{var b=a.error.stack,c=a.error.toString();-1=this._currentPage||(this._currentPage--,this._setButtonStates(this._currentPage),this.scrollPage(this._currentPage))},btnRightClicked:function(a,b,c){this._currentPage>this._totalPages-1||(this._currentPage++,this._setButtonStates(this._currentPage),this.scrollPage(this._currentPage))},jumpToNextElement:function(){this._isReversing?(this._currentPage--,0==this._currentPage?(this._isReversing= !1,this.scrollPageReverse(this._currentPage)):0>this._currentPage?(this._isReversing=!1,this._currentPage=1,this.scrollPage(this._currentPage)):this.scrollPageReverse(this._currentPage)):this._currentPage>=this._totalPages-1&&!this._isReversing?(this._isReversing=!0,this._currentPage-=1,this.scrollPageReverse(this._currentPage)):(this._currentPage++,this.scrollPage(this._currentPage))},scrollPage:function(a){a=a*this._rows*this._columns+this._columns*(this._rows-1);a>=this._scroller._ccObject.getChildrenCount()&& (a=this._scroller._ccObject.getChildrenCount()-2);this._scroller.scrollToItem(a,1)},scrollPageReverse:function(a){this._scroller.scrollToItem(a,1)},removeAllItemsFromScroller:function(){this._scroller&&this._scroller.removeAllChildren()},removeAllChildren:function(){this.removeAllItemsFromScroller();this._super.removeAllChildren.call(this)},unload:function(){this._super.unload.call(this);this._scroller=this._totalPages=this._currentPage=this._toggleButtonArray=this._toggleButtonDetails=this._btnRight= this._btnLeft=this._columns=this._rows=null}});var RSBarScroller=RSScroller.extend({_btnUp:null,_btnDown:null,_btnScroll:null,_scrollBase:null,_scrollBg:null,_scrollButtonTouchStarted:!1,_btnUpCallback:null,_btnDownCallback:null,setButtonUp:function(a,b){this._btnUp=a;this._btnUp.setTouchEnabled(!1);this._btnUpCallback=b;this._btnUp.addTouchEventListener(this,this.btnUpClicked.bind(this))},setButtonDown:function(a,b){this._btnDown=a;this._btnDown.setTouchEnabled(!1);this._btnDownCallback=b;this._btnDown.addTouchEventListener(this,this.btnDownClicked.bind(this))}, setMouseWheelScrollBase:function(a,b,c){var d=this;this._mouseScrollObject=a;if(void 0==b||null==b)b=20;if(void 0==c||null==c)c=0.2;this.listViewMouseListener=cc.EventListener.create({event:cc.EventListener.MOUSE,swallowTouches:!0,onMouseScroll:function(a){var f=a.getCurrentTarget(),g=f.convertToNodeSpace(a.getLocation()),f=f.getContentSize(),f=cc.rect(0,0,f.width,f.height);return cc.rectContainsPoint(f,g)?(a=-a.getScrollY(),g=-(d._ccObject._contentSize.height-d._ccObject._innerContainer.getContentSize().height), f=d._ccObject._innerContainer.getBottomBoundary(),d._scrolledPercent=(g+f)/g*100,d._scrolledPercent=0>d._scrolledPercent+a/b?0:100=d._scrolledPercent&&0<=d._scrolledPercent&&d._ccObject.scrollToPercentVertical(d._scrolledPercent,c,!0),!0):!1}});cc.eventManager.addListener(this.listViewMouseListener,this._mouseScrollObject._ccObject)},setItemMouseScroll:function(a){this._ccObject.setTouchEnabled(a)},setClippingState:function(a){this._ccObject.setClippingEnabled(a)}, enableScrollButton:function(a){this._btnScroll.setTouchEnabled(a)},setScrollBg:function(a){this._scrollBg=a;this._scrollBg.setVisible(!1)},setScrollBase:function(a){this._scrollBase=a=new RSRect(a.x,a.y,a.w,a.h);this._scrollBaseRect=new RSDisplayObject(a);this._scrollBaseRect.setAnchorPoint(0.5,0.5);this._scrollBaseRect.setName("scrollBaseRect");this._scrollBaseRect.addTouchListenerWithDelegate(this);this._scrollBaseRect.removeMoveListener();this.getDisplayObject().getParent().addChild(this._scrollBaseRect.getDisplayObject())}, addChild:function(a){this._super.addChild.call(this,a);this._objectSize.getHeight()*this._ccObject.getChildrenCount()/this._itemsPerRowCol>this._scrollerRect.getHeight()&&this.activateScrollerButtons()},removeAllChildren:function(){this._super.removeAllChildren.call(this);this.deactivateScrollerButtons()},activateScrollerButtons:function(){null==this._btnScroll||this._btnScroll.isVisible()||(this._btnScroll.setVisible(!0),this.setScrollBarVisibleStatus(!0));null==this._btnDown||this._btnDown.isTouchEnabled()|| this._btnDown.setTouchEnabled(!0);null==this._btnUp||this._btnUp.isTouchEnabled()||this._btnUp.setTouchEnabled(!0)},deactivateScrollerButtons:function(){null!=this._btnScroll&&(this._btnScroll.setVisible(!1),this.setScrollBarVisibleStatus(!1));null!=this._btnDown&&this._btnDown.isTouchEnabled()&&this._btnDown.setTouchEnabled(!1);null!=this._btnUp&&this._btnUp.isTouchEnabled()&&this._btnUp.setTouchEnabled(!1)},setScrollBarVisibleStatus:function(a){null!=this._btnScroll&&this._btnScroll.setVisible(a); null!=this._btnDown&&this._btnDown.setVisible(a);null!=this._btnUp&&this._btnUp.setVisible(a);null!=this._scrollBg&&this._scrollBg.setVisible(a)},onTouchScroll:function(){var a=this._scrollBase.getY()+this._scrollBase.getHeight()/2-this._btnScroll.getSize().getHeight()/2,b=this._scrollBase.getY()-this._scrollBase.getHeight()/2+this._btnScroll.getSize().getHeight()/2,c=this.getPercentVertical();isNaN(c)||(c=a-c/100*(a-b),c>a?c=a:cb?d=b:da&&(a=0),this._btnUpCallback&& a!=this.getPercentVertical()&&this._btnUpCallback(),this.scrollOnUpDownClick(a))},btnDownClicked:function(a,b,c){a=this.getPercentVertical();isNaN(a)||(a+=this._btnScrollFactor?this._btnScrollFactor:10,100b?d=b:da?b=a:bc&&dc&&db?"000"+b+".png":100>b?"00"+b+".png":1E3>b?"0"+b+".png":b+".png"; a=a.slice(0,-8);return a+c},getAnimationFrameCount:function(a){var b=0,c=null,d=0;do c=this.getFormattedAnimationName(a,d),c=cc.spriteFrameCache.getSpriteFrame(c),null!=c&&(d++,b++);while(null!=c);return b},loadMotionTweenFromFile:function(a){this.stopMotionTween();var b=this;RSUtils.loadJsonAsyc(a,null,function(a){b.parseMotionTweenFileData(a)})},parseMotionTweenFileData:function(a){var b=a.Motion.source.Source;this._motionTweenStartState._scaleX=parseFloat(b.scaleX);this._motionTweenStartState._scaleY= parseFloat(b.scaleY);this._motionTweenStartState._rotation=parseFloat(b.rotation);this._motionTweenStartState._x=parseFloat(b.x);this._motionTweenStartState._y=parseFloat(b.y);this._motionTweenStartState._startingPosition=new RSPoint(this._motionTweenStartState._x,this._motionTweenStartState._y);this._loadedMotionTween.length=0;a=a.Motion.Keyframe;for(b=0;b=this._loadedMotionTween.length||(this.stopMotionTween(),this._motionTweenStartState._startingPosition=a?this.getPosition():new RSPoint(this._motionTweenStartState._x, this._motionTweenStartState._y),void 0!==c&&(this._motionTweenCallback=c),this.setScaleX(this._motionTweenStartState._scaleX),this.setScaleY(this._motionTweenStartState._scaleY),this.setRotation(this._motionTweenStartState._rotation),this.setPosition(this._motionTweenStartState._startingPosition.getX(),this._motionTweenStartState._startingPosition.getY()),a=this._currentMotionTweenFrame=0,void 0!==b&&(a=b),this._motionTweenFunc=this.setMotionTweenFrame.bind(this,d),this._ccObject.schedule(this._motionTweenFunc, a,this._loadedMotionTween.length-1,0))},stopMotionTween:function(){this._motionTweenFunc&&(this._ccObject.unschedule(this._motionTweenFunc),this._motionTweenFunc=null)},setMotionTweenFrame:function(a){var b=this._currentMotionTweenFrame++,c=this._loadedMotionTween[b]._x,d=this._loadedMotionTween[b]._y,e=this._loadedMotionTween[b]._scaleX,f=this._loadedMotionTween[b]._scaleY,g=this._loadedMotionTween[b]._rotation,h=this._loadedMotionTween[b]._alphaMultiplier;isNaN(c)||this.setX(this._motionTweenStartState._startingPosition.getX()+ c);isNaN(d)||this.setY(this._motionTweenStartState._startingPosition.getY()+d);isNaN(e)||this.setScaleX(this._motionTweenStartState._scaleX*e);isNaN(f)||this.setScaleY(this._motionTweenStartState._scaleY*f);isNaN(g)||this.setRotation(this._motionTweenStartState._rotation+g);isNaN(h)||this.setOpacity(h);this._currentMotionTweenFrame>=this._loadedMotionTween.length-1&&this._motionTweenCallback&&(this._motionTweenCallback(this),this._motionTweenCallback=null);a&&a(b)},applyShader:function(a,b,c,d){this._loadedShader&& this._loadedShader.unload();this._loadedShader=new RSGLProgram(this,a,b,c,d)},setUniformLocationForShader:function(a,b){switch(b.length){case 1:this._loadedShader.setUniformLocationWith1f(a,b[0]);break;case 2:this._loadedShader.setUniformLocationWith2f(a,b[0],b[1]);break;case 3:this._loadedShader.setUniformLocationWith3f(a,b[0],b[1],b[2]);break;case 4:this._loadedShader.setUniformLocationWith4f(a,b[0],b[1],b[2],b[3])}},updateUniformLocationForShader:function(a,b,c,d,e){this._loadedShader.updateUniformLocationWith1f(this.getDisplayObject(), a,b,c,d,e)},stopUpdatingUniformLocationForShader:function(a){this._loadedShader.stopUpdatingUniformLocationWith1f(this.getDisplayObject(),a)},unload:function(){this.stopAnimation();void 0!=this._animationFrames&&(this._animationFrames.length=0,this._animationFrames=null);this._ccObject.getParent()&&this._ccObject.getParent().removeChild(this._ccObject,!0);this._loadedShader&&this._loadedShader.unload();void 0!=this._loadedMotionTween&&(this._loadedMotionTween.length=0,this._motionTweenStartState= this._loadedMotionTween=null);this._super.unload.call(this)}});var IImageLoadListener=new Interface("IImageLoaderListener",["onImageLoaded","onImageLoadFailed"]),RSImageObject=RSBasicObject.extend({init:function(a){this._url="";this._imageLoadDelegate=this._actionId=this._image=null;a&&this.setDelegate(a);this._super.init.call(this)},setDelegate:function(a){this._imageLoadDelegate=a;this._imageLoadDelegate.implements(IImageLoadListener)},_addLoadingImage:function(a,b,c,d){c>d?c=d:d=c;this._image=new RSImageObject;this._image.setAnchorPoint(0.5,0.5);var e=RSEngine.getLoadingAnimation(); e&&(this._image.setImageFromUrl(e,0,0,c,d),this.addChild(this._image),this._image.setZOrder(1),this._image.setPosition(a,b),this._actionId=this._image.actionRotateBy(4,360,-1))},_removeLoadingImage:function(){this._image&&(this._actionId&&this._image.stopAllActions(),this.removeChild(this._image))},setImageFromUrlWithPreloader:function(a,b,c,d,e){this.setImageFromUrl(a,b,c,d,e,!0)},setImageFromUrl:function(a,b,c,d,e,f,g){this._url=a;f&&(g?(f=(new RSPanel(b,c,d,e)).convertToNodeSpace(b,c),this._addLoadingImage(f.getX(), f.getY(),d/4,e/4)):this._addLoadingImage(b,c,d/2,e/2));void 0!=b&&void 0!=c&&void 0!=d&&void 0!=e&&this.setRect(b,c,d,e);-1==a.indexOf("http")&&(a=cc.loader.resPath+a);cc.loader.loadImg(a,{isCrossOrigin:!0},this.setImage.bind(this))},setImage:function(a,b){if(null==a){var c=new cc.Texture2D;c.initWithElement(b);c.handleLoadedTexture();if(c instanceof cc.Texture2D&&this._ccObject)this.onImageLoadSuccess(c);else if(this._imageLoadDelegate)this._imageLoadDelegate.onImageLoadFailed(this)}},onImageLoadSuccess:function(a){this._removeLoadingImage(); var b=this.getSize();this._ccObject.initWithTexture(a);a=this.getSize();var c=b._height/a._height;this.setScaleX(b._width/a._width);this.setScaleY(c);if(this._imageLoadDelegate)this._imageLoadDelegate.onImageLoaded(this)},getURL:function(){return this._url},unload:function(){this._removeLoadingImage();this._image=null;this._super.unload.call(this)}});var RSButton=RSBasicObject.extend({_target:null,_callback:null,_moveOnEventListener:null,_moveOutEventListener:null,_animationForIdleState:null,init:function(){this._buttonSound=void 0;this._moveOutEventListener=this._moveOnEventListener=null;this._buttonRadius=0;this._glowOnHover=!1;this._ccObject=new ccui.Button;this._ccObject.setTouchEnabled(!0);this._ccObject.setScale9Enabled(!1);RSEngine.isMobile&&this._ccObject.retain();"undefined"!==typeof RSGame&&RSGame.getInstance().getAssetPath("ButtonClick_SFX")&& this.setButtonSound(RSGame.getInstance().getAssetPath("ButtonClick_SFX"))},setTouchAreaAsCircleOfRadius:function(a){this._buttonRadius=a;this._ccObject._circleButtonRadiusSquare=a*a;this._ccObject.hitTest=function(a){a=this.convertToNodeSpace(a);return(a.x-this._contentSize.width/2)*(a.x-this._contentSize.width/2)+(a.y-this._contentSize.height/2)*(a.y-this._contentSize.height/2)<=this._circleButtonRadiusSquare?!0:!1}},enableGlowOnHover:function(){this._glowOnHover=!0},setButtonSound:function(a){this._buttonSound= a},setSelected:function(a){this._ccObject.setTouchEnabled(!a);this._ccObject.setEnabled(!a);this._ccObject.setBright(!a)},setTouchEnabled:function(a){a?this.addMoveListener():(this.removeMoveListener(),this._ccObject.setHighlighted(!1),this._animationForIdleState instanceof Object&&this._animationForIdleState.setVisible(!1));this._ccObject.setTouchEnabled(a);this._ccObject.setEnabled(a);this._ccObject.setBright(a)},addAnimation:function(a,b){if(a instanceof Object){this._animationForIdleState=a;var c= this.convertToNodeSpace(this._animationForIdleState.getRect().getX(),this._animationForIdleState.getRect().getY());this._animationForIdleState.setPosition(c.getX(),c.getY());this.addChild(this._animationForIdleState);this._animationForIdleState.stopAnimation();this._animationForIdleState.playAnimation(-1,void 0!=b?b:1);this._animationForIdleState.setTouchEnabled(!1)}},removeAnimation:function(){this._animationForIdleState&&(this.removeChild(this._animationForIdleState),this._animationForIdleState= null)},isTouchEnabled:function(){return this._ccObject.isTouchEnabled()},addTouchEventListener:function(a,b){this._ccObject.addTouchEventListener(this.handleButtonClick,this);this._touchTarget=a;this._touchCallback=b;this.addMoveListener()},handleButtonClick:function(a,b){switch(b){case ccui.Widget.TOUCH_BEGAN:void 0!=this._buttonSound&&RSEngine.audioManager.playEffect(this._buttonSound,!1)}this._touchCallback.call(this._touchTarget,a,b)},removeMoveListener:function(){null!=this._moveOnEventListener&& (cc.eventManager.removeListener(this._moveOnEventListener),this._moveOnEventListener=null);null!=this._moveOutEventListener&&(cc.eventManager.removeListener(this._moveOutEventListener),this._moveOutEventListener=null);cc.$("#gameCanvas").style.cursor="default"},addMoveListener:function(){var a=this;null!=this._moveOnEventListener&&(cc.eventManager.removeListener(this._moveOnEventListener),this._moveOnEventListener=null);null!=this._moveOutEventListener&&(cc.eventManager.removeListener(this._moveOutEventListener), this._moveOutEventListener=null,cc.$("#gameCanvas").style.cursor="default");this._moveOnEventListener=cc.eventManager.addListener({event:cc.EventListener.MOUSE,onMouseMove:function(b){if(a.isVisible()){var c=b.getCurrentTarget();b=c.convertToNodeSpace(b.getLocation());if(a.isPointerOnButton(c,b))return cc.$("#gameCanvas").style.cursor="pointer",a.addMoveOutListener(),a._glowOnHover&&c.setHighlighted(!0),!0}}},this._ccObject)},addMoveOutListener:function(){var a=this;null==this._moveOutEventListener&& (this._moveOutEventListener=cc.eventManager.addListener({event:cc.EventListener.MOUSE,onMouseMove:function(b){var c=b.getCurrentTarget();b=c.convertToNodeSpace(b.getLocation());if(!a.isPointerOnButton(c,b))return cc.$("#gameCanvas").style.cursor="default",cc.eventManager.removeListener(a._moveOutEventListener),a._moveOutEventListener=null,a._glowOnHover&&c.setHighlighted(!1),!0}},this._ccObject))},isPointerOnButton:function(a,b){var c=a.getContentSize();if(0c;c++){var d=""+a+"_0"+c+"/"+b+"/"+b+"_00.png";if(null!=cc.spriteFrameCache.getSpriteFrame(d)){this._ccObject.loadTextures(d,""+a+"_0"+c+"/"+b+"/"+b+"_01.png",""+a+"_0"+c+"/"+b+"/"+b+"_02.png",ccui.Widget.PLIST_TEXTURE);break}}this._ccObject.setTitleText("");this._ccObject.setName(b)}, getButtonAnimationForIdleState:function(){return this._animationForIdleState},unload:function(){this.removeAnimation();this._ccObject.setTouchEnabled(!1);cc.eventManager.removeListener(this._moveOnEventListener);this._moveOnEventListener=null;null!=this._moveOutEventListener&&(cc.$("#gameCanvas").style.cursor="default",cc.eventManager.removeListener(this._moveOutEventListener),this._moveOutEventListener=null);this._super.unload.call(this)}});var RSGenericButton=RSBasicObject.extend({_size:null,_labelString:"",_label:null,_positionOffsetX:null,_positionOffsetY:null,_onClick:null,_btn:null,init:function(a,b,c,d,e,f){this._super.init.call(this);this._font=d;this._btn=a;this._btnRect=b;this._onClick=e;this.addChild(a);d=null;d=f?f:RSGame.getInstance().getStringDictionary(c);this.addTouchListenerToButton(a);d?(c=b.type.split("_"),this._labelString=d[c[c.length-1]]):this._labelString=" ";this.createLabel(b,a)},createLabel:function(a,b){var c= new RSScaledLabel(this._labelString,this._font,a,kTEXT_ALIGNMENT_CENTER);c.setCenter(a.x,a.y);this._label=c;"MS"==GameConfig.GAME_ID&&this._label.setScale(0.735);"UP"==GameConfig.GAME_ID?this._label.setScale(1):this._label.setScale(0.75);this._label.setAnchorPoint(0.5,0.5);this.addChild(c);"UP"==GameConfig.GAME_ID&&(this._label.setX(101.4*a.x/100),this._label.setY(102.6*a.y/100));"CS"==GameConfig.GAME_ID&&(this._label.setX(100.6*a.x/100),this._label.setY(101.6*a.y/100))},setSelected:function(a){var b; b=a?new RSColor(255,255,255,255):new RSColor(100,100,100,255);this._btn.setColor(b);this._btn.setTouchEnabled(a);this._label.setColor(b)},setText:function(a){this._labelString=a;this._label.setString(a)},setOnClickListener:function(a){this._onClick=a},setEnabled:function(a){this._btn.setTouchEnabled(a)},setTouchEnabled:function(a){this.setSelected(a)},getLabel:function(){return this._label},getButtonObj:function(){return this._btn},onButtonClicked:function(a){this._onClick(this._btnRect.type,this)}, loadContent:function(){this.loadLayout(this._assetPath)}});var RSClippingNode=RSClass.extend({_ccObject:null,init:function(a){this._ccObject=null;this._super.init.call(this);this._ccObject=new cc.ClippingNode(a.getDisplayObject());this._maskObject=a;RSEngine.isMobile&&this._ccObject.retain()},getDisplayObject:function(){if(null==this._ccObject)cc.log("Object is NULL!");else return this._ccObject},setName:function(a){this._ccObject.setName(a)},getName:function(){return this._ccObject.getName()},convertToNodeSpace:function(a,b){var c=this._ccObject.convertToNodeSpace(cc.p(a, b));return new RSPoint(c.x,c.y)},convertToWorldSpace:function(a,b){var c=this._ccObject.convertToWorldSpace(cc.p(a,b));return new RSPoint(c.x,c.y)},setAlphaThreshold:function(a){this._ccObject.setAlphaThreshold(a/255)},setInverted:function(a){this._ccObject.setInverted(a)},addChild:function(a){this._ccObject.addChild(a.getDisplayObject())},setCenter:function(a,b){this.setAnchorPoint(0.5,0.5);this.setPosition(a,b)},setAnchorPoint:function(a,b){this._ccObject.setAnchorPoint(a,b)},setPosition:function(a, b){this._ccObject.setPosition(a,b)},stopAllActions:function(){this._ccObject.stopAllActions()},removeChild:function(a,b){this.getDisplayObject().removeChild(a.getDisplayObject(),b);b&&a.unload()},unload:function(){this._maskObject.unload();this._ccObject.removeAllChildren(!0);this._ccObject=null}});var RSDrawNode=RSClass.extend({_ccObject:null,init:function(){this._ccObject=null;this._super.init.call(this);this._ccObject=new cc.DrawNode;RSEngine.isMobile&&this._ccObject.retain()},getDisplayObject:function(){if(null==this._ccObject)cc.log("Object is NULL!");else return this._ccObject},setZOrder:function(a){this._ccObject.setLocalZOrder(a)},getZOrder:function(){return this._ccObject.getLocalZOrder()},drawSegment:function(a,b,c,d){this._ccObject.drawSegment(cc.p(a.getX(),a.getY()),cc.p(b.getX(), b.getY()),c,cc.color(d.getR(),d.getG(),d.getB(),d.getA()))},drawRect:function(a,b,c){this._ccObject.drawRect(cc.p(a.getX(),a.getY()),cc.p(b.getX(),b.getY()),cc.color(c.getR(),c.getG(),c.getB(),c.getA()),0.1,cc.color(c.getR(),c.getG(),c.getB(),c.getA()))},drawRectWithBorder:function(a,b,c,d,e){this._ccObject.drawRect(cc.p(a.getX(),a.getY()),cc.p(b.getX(),b.getY()),cc.color(c.getR(),c.getG(),c.getB(),c.getA()),d,cc.color(e.getR(),e.getG(),e.getB(),e.getA()))},drawCircle:function(a,b,c,d,e,f,g){this._ccObject.drawCircle(cc.p(a.getX(), a.getY()),b,c,d,e,f,g)},drawDot:function(a,b,c){this._ccObject.drawDot(cc.p(a.getX(),a.getY()),b,cc.color(c.getR(),c.getG(),c.getB(),c.getA()))},setVisible:function(a){this._ccObject.setVisible(a)},clearNode:function(){this._ccObject.clear()},unload:function(){this.clearNode();this._ccObject.cleanup();this._ccObject.release();this._ccObject=null;this._super.unload.call(this)},stopAllActions:function(){this._ccObject.stopAllActions()}});var RSColor=RSClass.extend({_r:null,_g:null,_b:null,_a:null,init:function(a,b,c,d){this._super.init.call(this);this._r=a;this._g=b;this._b=c;void 0==d&&(d=255);this._a=d},getR:function(){return this._r},getG:function(){return this._g},getB:function(){return this._b},getA:function(){return this._a}});var RSPoint=RSClass.extend({_x:null,_y:null,init:function(a,b){this._super.init.call(this);this.setPoint(a,b)},setX:function(a){this._x=a},setY:function(a){this._y=a},getX:function(){return this._x},getY:function(){return this._y},setPoint:function(a,b){this.setX(a);this.setY(b)}});var RSRect=RSClass.extend({_x:null,_y:null,_width:null,_height:null,init:function(a,b,c,d){this._super.init.call(this);this.setRect(a,b,c,d)},setX:function(a){this._x=a},setY:function(a){this._y=a},getX:function(){return this._x},getY:function(){return this._y},setPoint:function(a,b){this.setX(a);this.setY(b)},setWidth:function(a){this._width=a},setHeight:function(a){this._height=a},getWidth:function(){return this._width},getHeight:function(){return this._height},setSize:function(a,b){this.setWidth(a); this.setHeight(b)},setRect:function(a,b,c,d){this.setPoint(a,b);this.setSize(c,d)},containsPoint:function(a,b){return cc.rectContainsPoint(cc.rect(this._x,this._y,this._width,this._height),cc.p(a,b))}});var RSSize=RSClass.extend({_width:null,_height:null,init:function(a,b){this._super.init.call(this);this.setSize(a,b)},setWidth:function(a){this._width=a},setHeight:function(a){this._height=a},getWidth:function(){return this._width},getHeight:function(){return this._height},setSize:function(a,b){this.setWidth(a);this.setHeight(b)}});var RSEmitterParticle=RSBasicObject.extend({init:function(a){this._super.init.call(this);this._delayAction=null;var b=RSUtils.getRandomInt(0,a._spriteFrames.length-1);this._spriteFrame=a._spriteFrames[b];this._tweenRate=a._tweenRate;this.setProperties(a)},setProperties:function(a){this._spriteAnimationSpeed=a._spriteAnimationSpeed+this.getVariance()*a._spriteAnimationSpeedVariance;this._origin=new RSPoint(a._origin.getX()+this.getVariance()*a._originVariance.getX(),a._origin.getY()+this.getVariance()* a._originVariance.getY());this._displacement=new RSPoint(a._displacement.getX()+this.getVariance()*a._displacementVariance.getX(),a._displacement.getY()+this.getVariance()*a._displacementVariance.getY());this._deviation=a._deviation+this.getVariance()*a._deviationVariance;this._startScale=a._startScale+this.getVariance()*a._startScaleVariance;this._endScale=a._endScale+this.getVariance()*a._endScaleVariance;this._scalingDuration=a._scalingDuration+this.getVariance()*a._scalingDurationVariance;this._speed= (a._speed+this.getVariance()*a._speedVariance)*RSEngine.resolutionFactor;this._startDelay=a._startDelay+this.getVariance()*a._startDelayVariance;this._rotationAngle=360*this.getVariance();this._rotationDuration=a._360rotationDuration+this.getVariance()*a._360rotationDurationVariance;this._fadeInDuration=a._fadeInDuration+this.getVariance()*a._fadeInDurationVariance;this._fadeOutDuration=a._fadeOutDuration+this.getVariance()*a._fadeOutDurationVariance;this._colors=a._colors},getVariance:function(){var a= RSUtils.getRandomInt(0,1);0==a&&(a=-1);return a*RSUtils.getRandomFloat()},loadAnimation:function(){this.loadAnimationWithName(this._spriteFrame);this.setVisible(!1)},startEmitting:function(a){this.playAnimation(-1,this._spriteAnimationSpeed);this.setCenter(this._origin.getX(),this._origin.getY());this.setScale(this._startScale);this.setOpacity(255);0a?this.fadeOut(this._lifeTime):this.scheduleFunctionOnce(this.fadeOut.bind(this,this._fadeOutDuration,null),a))},stopQueuedEmission:function(){return null!= this._delayAction?(this.unscheduleFunction(this._delayAction),this._delayAction=null,this.setVisible(!1),!0):!1},stopEmitting:function(){this.stopAnimation();this.stopAllActions();this.setVisible(!1)}}),RSVerticalSnakeEmitterObject=RSEmitterParticle.extend({init:function(a){this._points=[];this._curveCount=3;this._super.init.call(this,a)},setProperties:function(a){this._super.setProperties.call(this,a);this._points.length=0;a=this._displacement.getX()/this._curveCount;for(var b=this._displacement.getY()/ this._curveCount,c=this._origin.getX(),d=this._origin.getY(),e=this._deviation,f=0==this._displacement.getY()?0:0<=this._displacement.getX()?1:-1,g=0==this._displacement.getX()?0:0>=this._displacement.getY()?1:-1,h=0;hMath.abs(this._displacement.getX())?this._lifeTime=Math.abs(this._displacement.getY())/this._speed:this._lifeTime=Math.abs(this._displacement.getX())/this._speed},startActions:function(a){this._super.startActions.call(this,a);a=this.actionMoveBy(this._lifeTime,this._displacement.getX(), this._displacement.getY(),a);RSTweener.easeIn(a,this._tweenRate)}}),RSCustomEmitterType={USER_DEFINED:-1,FOUNTAIN:0,FIREWORK:1,VERTICAL_SNAKE:2,CLUSTER_MOVEMENT:3},RSEmitterParticleParams=function(){this._spriteFrames=[];this._startDelayVariance=this._startDelay=this._spriteAnimationSpeedVariance=this._spriteAnimationSpeed=0;this._origin=null;this._originVariance=new RSPoint(0,0);this._deviationVariance=this._deviation=0;this._displacement=null;this._displacementVariance=new RSPoint(0,0);this._speed= 1;this._speedVariance=0;this._startScale=1;this._startScaleVariance=0;this._endScale=1;this._360rotationDurationVariance=this._360rotationDuration=this._fadeOutDurationVariance=this._fadeOutDuration=this._fadeInDurationVariance=this._fadeInDuration=this._scalingDurationVariance=this._scalingDuration=this._endScaleVariance=0;this._tweenRate=1},RSCustomAnimationEmitter=RSDisplayObject.extend({init:function(a,b,c,d,e){this._super.init.call(this,new RSRect(0,0,0,0));this._params=a;this._repeatForever= b;this._emitterType=c;this._particleCount=d;void 0==e&&(e=null);this._callback=e;this._stoppedParticleCount=0},loadEmitter:function(){for(var a=0;aMath.abs(this._displacement.getX())? this._lifeTime=Math.abs(this._displacement.getY())/this._speed:this._lifeTime=Math.abs(this._displacement.getX())/this._speed},startActions:function(a){this._super.startActions.call(this,a);a=this.actionMoveBy(this._lifeTime,this._displacement.getX(),this._displacement.getY(),a);RSTweener.easeIn(a,this._tweenRate)}}),BlastEmitter=RSCustomAnimationEmitter.extend({createCustomEmitterObject:function(a){return new BlastEmitterParticle(a)}});var IInputBoxDelegate=new Interface("IInputBoxDelegate",["editBoxEditingDidBegan","editBoxEditingDidEnded","editBoxTextChanged","editBoxEditingReturn"]),RSInputBox=RSDisplayObject.extend({_width:null,_height:null,_x:null,_y:null,_inputDelegate:null,init:function(a,b){this._ccObject=null;var c=new cc.Size(a,b);this._width=a;this._height=b;this._ccObject=new cc.EditBox(c);RSEngine.isMobile&&this._ccObject.retain()},setInputMode:function(a){this._ccObject.setInputMode(a)},setTouchEnabled:function(a){}, setInputFlag:function(a){this._ccObject.setInputFlag(a)},setDelegate:function(a){this._inputDelegate=a;a.implements(IInputBoxDelegate);this._ccObject.setDelegate(this)},startTouch:function(){this._ccObject._onTouchEnded()},editBoxEditingDidBegan:function(a){this._inputDelegate.editBoxEditingDidBegan(this)},editBoxEditingDidEnded:function(a){this._inputDelegate.editBoxEditingDidEnded(this)},editBoxTextChanged:function(a,b){this._inputDelegate.editBoxTextChanged(this,b)},editBoxEditingReturn:function(a){this._inputDelegate.editBoxEditingReturn(this)}, setPosition:function(a,b){this._x=a;this._y=b;this._super.setPosition.call(this,a,b);this._ccObject.setPosition(a,b)},setBackgroundColor:function(a,b,c,d){var e=new cc.Size(this._width,this._height);a=new cc.LayerColor(cc.color(a,b,c,d));this._ccObject.initWithSizeAndBackgroundSprite(e,a);this.setPosition(this._x,this._y)},setBackgroundImage:function(a){var b=new cc.Size(this._width,this._height);this._ccObject.initWithSizeAndBackgroundSprite(b,a.getDisplayObject());this.setPosition(this._x,this._y)}, setFont:function(a,b){this._ccObject.setFont(a,b)},setFontColor:function(a,b,c,d){this._ccObject.setFontColor(cc.color(a,b,c,d))},setPlaceholderFont:function(a,b){this._ccObject.setPlaceholderFont(a,b)},setPlaceholderFontColor:function(a,b,c,d){this._ccObject.setPlaceholderFontColor(cc.color(a,b,c,d))},setString:function(a){this._ccObject.setString(a)},getString:function(){return this._ccObject.getString()},setPlaceholderText:function(a){this._ccObject.setPlaceHolder(a)},getPlaceholderText:function(){return this._ccObject.getPlaceHolder()}, setMaxLength:function(a){this._ccObject.setMaxLength(a)},getMaxLength:function(){return this._ccObject.getMaxLength()},unload:function(){this._ccObject.unscheduleAllCallbacks();this._super.unload.call(this)},setSize:function(a){this.setContentSize(a)}});var kTEXT_ALIGNMENT_CENTER=cc.TEXT_ALIGNMENT_CENTER,kTEXT_ALIGNMENT_LEFT=cc.TEXT_ALIGNMENT_LEFT,kTEXT_ALIGNMENT_RIGHT=cc.TEXT_ALIGNMENT_RIGHT,RSLabel=RSDisplayObject.extend({init:function(a,b,c){void 0==c&&(c=kTEXT_ALIGNMENT_CENTER);var d=new ccui.Text;d.ignoreContentAdaptWithSize(!1);d.setContentSize(a.getWidth(),a.getHeight());d.setAnchorPoint(0.5,0.5);d.setColor(new cc.Color(255,255,255,255));d.setTextHorizontalAlignment(c);d.setTextVerticalAlignment(cc.VERTICAL_TEXT_ALIGNMENT_CENTER);d.setPosition(a.getX(), a.getY());d.setFontSize(b);this._ccObject=d;RSEngine.isMobile&&this._ccObject.retain()},loadString:function(a,b,c){this.setString(a);this.setFontSize(c);this._ccObject.setTextHorizontalAlignment(b)},setFontSize:function(a){this._ccObject.setFontSize(a)},setString:function(a){a&&(a=a.toString(),a=a.replace("\\n","\n"));this._ccObject.setString(a)},getString:function(){return this._ccObject.getString()},getDisplayObject:function(){return this._ccObject},setTextAlignment:function(a){this._ccObject.setTextHorizontalAlignment(a)}, setCenter:function(a,b){this.setPosition(a,b)},unload:function(){this._super.unload.call(this)}});var ScaledLabelFormat={REGULAR:"Regular",COMMA_SEPARATED:"CommaSeparated",FORMATTED:"Formatted",FORMATTED_FIXED_DECIMAL:"FormattedFixedDecimal"},RSScaledLabel=RSLabel.extend({_baseRect:null,_alignment:null,_isTTF:null,_initialString:null,_textFormatting:null,init:function(a,b,c,d,e,f,g){this._textFormatting=g;this._textFormatting||(this._textFormatting=ScaledLabelFormat.COMMA_SEPARATED);this._initialString=a;this._baseRect=c;this._alignment=d;this._loadedActionTweens={};(this._isTTF=e)?this._createTTFFont(a, b,f):this._createBMFont(a,b);this._autoScaleText();this.setPosition(c.x,c.y);RSEngine.isMobile&&this._ccObject.retain()},_createTTFFont:function(a,b,c){this._ccObject=new cc.LabelTTF(a,b,c,null,this._alignment,cc.VERTICAL_TEXT_ALIGNMENT_CENTER);this._setAlignment();this.setFontColor(255,255,255,255)},_createBMFont:function(a,b){this._ccObject=new cc.LabelBMFont(a,b,-1,this._alignment,0);this._setAlignment()},setTextAlignment:function(a){this._alignment=a;this._setAlignment()},_setAlignment:function(){switch(this._alignment){case kTEXT_ALIGNMENT_RIGHT:this._ccObject.setAnchorPoint(1, 0.5);break;case kTEXT_ALIGNMENT_LEFT:this._ccObject.setAnchorPoint(0,0.5);break;case kTEXT_ALIGNMENT_CENTER:this._ccObject.setAnchorPoint(0.5,0.5)}},setPosition:function(a,b){switch(this._alignment){case kTEXT_ALIGNMENT_RIGHT:this._super.setPosition.call(this,a+this._baseRect.w/2,b);break;case kTEXT_ALIGNMENT_LEFT:this._super.setPosition.call(this,a-this._baseRect.w/2,b);break;case kTEXT_ALIGNMENT_CENTER:this._super.setPosition.call(this,a,b)}},setFontColor:function(a,b,c,d){this._isTTF?this._ccObject.setFontFillColor(new cc.Color(a, b,c,d)):this.setColor(new RSColor(a,b,c,d))},setInitialString:function(a){this._initialString=a;this.setString(a)},getInitialString:function(){return this._initialString},setString:function(a){this._ccObject.setString(a);this._autoScaleText()},startTweenForLabel:function(a,b){this.stopActionTweenForKey("tweenKey");this._finalValue=b;/^\d+$/.test(this._initialString)||(this._initialString="0");this.startActionTweenForKey("tweenKey",a,parseInt(this._initialString),b);this._initialString=b},actionOnUpdate:function(a, b){switch(this._textFormatting){case ScaledLabelFormat.REGULAR:this.setString(""+parseInt(b));break;case ScaledLabelFormat.COMMA_SEPARATED:this.setString(""+RSUtils.formatNumberWithComma(parseInt(b)));break;case ScaledLabelFormat.FORMATTED:this.setString(""+RSUtils.formatNumber(parseInt(b)));break;case ScaledLabelFormat.FORMATTED_FIXED_DECIMAL:this.setString(""+RSUtils.formatNumber(parseInt(b),4,2))}},actionOnComplete:function(){this.stopActionTweenForKey("tweenKey")},_autoScaleText:function(){var a= this.getSize();this.setScale(Math.min(this._baseRect.w/a._width,this._baseRect.h/a._height))},reInitText:function(){if(this._finalValue)switch(this._textFormatting){case ScaledLabelFormat.REGULAR:this.setString(""+parseInt(this._finalValue));break;case ScaledLabelFormat.COMMA_SEPARATED:this.setString(""+RSUtils.formatNumberWithComma(parseInt(this._finalValue)));break;case ScaledLabelFormat.FORMATTED:this.setString(""+RSUtils.formatNumber(parseInt(this._finalValue)))}},rescaleToRect:function(a){this._baseRect= a;this._autoScaleText();this.setPosition(a.x,a.y)}});var RSLabelBMFont=RSLabel.extend({init:function(a,b,c,d){this._ccObject=new cc.LabelBMFont(a,b,c,d,0);this.setTextAlignment(d);RSEngine.isMobile&&this._ccObject.retain()},setTextAlignment:function(a){switch(a){case kTEXT_ALIGNMENT_RIGHT:this._ccObject.setAnchorPoint(1,0.5);break;case kTEXT_ALIGNMENT_LEFT:this._ccObject.setAnchorPoint(0,0.5);break;case kTEXT_ALIGNMENT_CENTER:this._ccObject.setAnchorPoint(0.5,0.5)}},setFontColor:function(a,b,c,d){this._isTTF?this._ccObject.setFontFillColor(new cc.Color(a, b,c,d)):this.setColor(new RSColor(a,b,c,d))}});var RSLabelBMFontIncrementerlabel=RSLabel.extend({init:function(a,b,c,d,e,f){this._ccObject=new cc.LabelBMFont(a,b,c,d,0);this.setTextAlignment(d);this._initialString=a;this._loadedActionTweens={};this._tweenKeyName=e;this._finalValue=f;RSEngine.isMobile&&this._ccObject.retain()},setTextAlignment:function(a){switch(a){case kTEXT_ALIGNMENT_RIGHT:this._ccObject.setAnchorPoint(1,0.5);break;case kTEXT_ALIGNMENT_LEFT:this._ccObject.setAnchorPoint(0,0.5);break;case kTEXT_ALIGNMENT_CENTER:this._ccObject.setAnchorPoint(0.5, 0.5)}},setFontColor:function(a,b,c,d){this._isTTF?this._ccObject.setFontFillColor(new cc.Color(a,b,c,d)):this.setColor(new RSColor(a,b,c,d))},setString:function(a){a&&(a=a.toString(),a=a.replace("\\n","\n"));this._ccObject.setString(a);this._initialString=a},startTweenForLabel:function(a,b){this.stopActionTweenForKey(this._tweenKeyName);b&&(this._finalValue=b);var c=this._initialString.replace(/,/g,"");/^\d+$/.test(c)||(c="0");this.startActionTweenForKey(this._tweenKeyName,a,parseInt(c),this._finalValue)}, playAnimation:function(a,b){this.startTweenForLabel(b)},stopAnimation:function(){this.actionOnComplete()},actionOnUpdate:function(a,b){this.setString(RSUtils.formatNumberWithComma(parseInt(b)))},actionOnComplete:function(){this.stopActionTweenForKey(this._tweenKeyName)},reInitText:function(){if(this._finalValue)switch(this._textFormatting){case ScaledLabelFormat.REGULAR:this.setString(""+parseInt(this._finalValue));break;case ScaledLabelFormat.COMMA_SEPARATED:this.setString(""+RSUtils.formatNumberWithComma(parseInt(this._finalValue))); break;case ScaledLabelFormat.FORMATTED:this.setString(""+RSUtils.formatNumber(parseInt(this._finalValue)))}},setFinalValue:function(a){this._finalValue=a}});var RSLabelTTF=RSLabel.extend({init:function(a,b,c,d,e,f){a=new cc.LabelTTF(a,b,c,cc.size(d,e),f,cc.VERTICAL_TEXT_ALIGNMENT_CENTER);switch(f){case kTEXT_ALIGNMENT_RIGHT:a.setAnchorPoint(1,0.5);break;case kTEXT_ALIGNMENT_LEFT:a.setAnchorPoint(0,0.5);break;case kTEXT_ALIGNMENT_CENTER:a.setAnchorPoint(0.5,0.5)}this._ccObject=a;this.setFontColor(255,255,255,255);RSEngine.isMobile&&this._ccObject.retain()},setFontColor:function(a,b,c,d){this._ccObject.setFontFillColor(new cc.Color(a,b,c,d))},addStroke:function(a){this._ccObject._strokeEnabled= !0;this._ccObject._strokeSize=a}});var RSAudioManager=RSClass.extend({init:function(){this._effectsVolume=this._musicVolume=1;this._voicesMuted=this._effectsMuted=this._musicMuted=!1;this._func=this._object=null;this._voiceList=[];this._effectList=[]},reInitializeAudioContext:function(){cc.Audio._context.resume()},isMusicPlaying:function(){return cc.audioEngine.isMusicPlaying()},playMusic:function(a,b){void 0==b&&(b=!0);this._stopFade();cc.audioEngine.playMusic(a,b);this.setMusicVolume(this._musicVolume)},getDurationOfCurrentMusic:function(){return cc.audioEngine.getDurationOfCurrentMusic()}, stopMusic:function(){this._stopFade();cc.audioEngine.stopMusic()},fadeMusicVolumeTo:function(a,b,c){1b?cc.log("Volume should be in [0,1]"):(this._stopFade(),this._object=c,this._func=this._fadeTo.bind(this,-((this._musicVolume-b)/(cc.defaultFPS*a)),b),this._object.schedule(this._func))},fadeOutMusic:function(a,b){this._stopFade();0this._musicVolume&&(this._object=b,this._func=this._fade.bind(this,(1-this._musicVolume)/(cc.defaultFPS*a)),this._object.schedule(this._func))},fadeInEffect:function(a,b){this._stopFade();1>this._effectsVolume&&(this._object=b,this._func=this._fadeEffect.bind(this,(1-this._effectsVolume)/(cc.defaultFPS*a)),this._object.schedule(this._func))},_fadeTo:function(a,b){var c=this._musicVolume+a,c=0>=a?Math.max(c,b):Math.min(c,b);this.setMusicVolume(c);c===b&&this._stopFade()},_fade:function(a){a= this._musicVolume+a;this.setMusicVolume(a);(1<=a||0>=a)&&this._stopFade()},_fadeEffect:function(a){a=this._effectsVolume+a;this.setEffectsVolume(a);(1<=a||0>=a)&&this._stopFade()},_stopFade:function(){null!=this._func&&(this._object.unschedule(this._func),this._object=this._func=null)},setMusicVolume:function(a){1a&&(a=0);this._musicVolume=a;this._musicMuted||cc.audioEngine.setMusicVolume(a)},setEffectsVolume:function(a){1a&&(a=0);this._effectsVolume=a;cc.audioEngine.setEffectsVolume(a)}, muteMusic:function(){this._musicMuted=!0;cc.audioEngine.setMusicVolume(0)},unMuteMusic:function(){this._musicMuted=!1;cc.audioEngine.setMusicVolume(this._musicVolume)},playEffect:function(a,b,c){if(!c||!c){if(this._effectsMuted)return null;void 0==b&&(b=!1)}a=cc.audioEngine.playEffect(a,b);this._effectList.push(a);return a},playEffectWithVolume:function(a,b,c){(a=this.playEffect(a,c))&&a.setVolume(b);return a},areEffectsActive:function(){return 0this[a(560)])setTimeout(this[a(488)](this.validationResponseObject)[a(500)](this),5E3);else{this[a(560)]=0;this[a(503)]=null;RSErrorTracker[a(315)]()[a(298)](a(311), a(389),a(349));var b={};b[a(473)]=a(502);this[a(580)](b);this[a(580)]=null;if(this[a(459)].type==a(282)&&1this[e(560)])setTimeout(this[e(488)](this[e(503)])[e(500)](this), 5E3);else if(RSErrorTracker[e(315)]()[e(298)](e(311),e(389),e(349)),a={},a.error_message=e(502),this[e(580)](a),this[e(580)]=null,"coins"==this[e(459)][e(531)]&&1this[a(405)]?(this._retryCount++,this[a(348)](this[a(518)],this[a(624)],this[a(417)],this[a(582)],this[a(287)],this._billingId)):this._retryCount=0},afterTokenGenerated:function(a){this[a0_0x5008(354)]()},showCard:function(){var a=a0_0x5008,b=document[a(498)](a(448)), e,f,g;for(g in this[a(371)]){f="";switch(this[a(371)][g][a(316)]){case a(435):f=a(307);break;case a(365):f=a(450);break;case a(278):f=a(556);break;case a(508):f=a(589);break;case a(472):f=a(612);break;case a(421):f=a(420);break;case a(546):f=a(269)}var h=this[a(371)][g][a(429)][a(320)](0,2)+"-"+this[a(371)][g].expirationDate.slice(2);e=a(477)+this._savedCards[g][a(327)]+a(535);e+=a(581)+this[a(371)][g][a(327)]+a(368)+"'"[a(460)](this[a(371)][g][a(327)],"'")[a(338)]()+a(458)+this[a(371)][g][a(327)]+ "'/\x3e"+a(383)+this._savedCards[g][a(452)]+a(430);e+="\x3clabel style\x3d'padding-top: 2%' class\x3d'col-md-2 col-xs-2'\x3e "+h+a(597)+f+"\x3e "+a(620)+"'"[a(460)](this[a(371)][g][a(327)],"'")[a(338)]()+")\x3e\x3cspan aria-hidden\x3d'true'"+a(558);this._savedCards[g][a(316)]=this._savedCards[g][a(316)][a(476)](/'/g,a(579));e+=a(606)+this[a(371)][g][a(327)]+a(462)+"'".concat(this[a(371)][g][a(512)],"'")[a(338)]()+","+"'"[a(460)](encodeURIComponent(this._savedCards[g][a(316)]),"'")[a(338)]()+","+"'"[a(460)](this[a(371)][g][a(327)], "'")[a(338)]()+a(532);b[a(345)]+=e}},getTotalNumberOfCards:function(){var a=a0_0x5008;return this[a(371)]?this[a(371)][a(294)]:0},cardTokenGenerate:function(a){var b=a0_0x5008,e;for(e in this[b(371)])this._savedCards[e].billingId==a?(document[b(498)](b(619)+this[b(371)][e].billingId).style[b(534)]=b(522),document[b(498)](b(619)+this._savedCards[e].billingId)[b(369)]=!1,document.getElementById(b(607)+this[b(371)][e][b(327)]).checked=!0,document[b(498)](b(607)+this[b(371)][e][b(327)])[b(369)]=!0,this.isTaxEnabled()&& (this[b(283)]=this._savedCards[e][b(545)],this[b(394)](this._zipCode)),!this[b(371)][e][b(586)]&&(!$(b(445))[b(294)]&&$(b(370)).append('\x3cdiv id\x3d"preloader" class \x3d "preload"\x3e\x3c/div\x3e'),this[b(290)](a))):(document[b(498)]("pay-"+this._savedCards[e].billingId)[b(369)]=!0,document[b(498)]("radio-"+this[b(371)][e][b(327)]).checked=!1,document[b(498)](b(607)+this[b(371)][e][b(327)]).disabled=!1)},cardTokenGenerated:function(a){this[a0_0x5008(465)](a)},clearNonce:function(){var a=a0_0x5008; if(this[a(459)][a(531)]==a(282)&&1=a){c._volume=a;if(c._muted)return c; c.usingWebAudio&&(c.masterGain.gain.value=a);for(var d=0;dparseInt(e[0].split("/")[1],10);a._codecs={mp3:!(e||!d&&!c.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!d,opus:!!c.canPlayType('audio/ogg; codecs\x3d"opus"').replace(/^no$/,""),ogg:!!c.canPlayType('audio/ogg; codecs\x3d"vorbis"').replace(/^no$/,""),oga:!!c.canPlayType('audio/ogg; codecs\x3d"vorbis"').replace(/^no$/, ""),wav:!!c.canPlayType('audio/wav; codecs\x3d"1"').replace(/^no$/,""),aac:!!c.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!c.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(c.canPlayType("audio/x-m4a;")||c.canPlayType("audio/m4a;")||c.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(c.canPlayType("audio/x-mp4;")||c.canPlayType("audio/mp4;")||c.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!c.canPlayType('audio/webm; codecs\x3d"vorbis"').replace(/^no$/,""),webm:!!c.canPlayType('audio/webm; codecs\x3d"vorbis"').replace(/^no$/, ""),dolby:!!c.canPlayType('audio/mp4; codecs\x3d"ec-3"').replace(/^no$/,""),flac:!!(c.canPlayType("audio/x-flac;")||c.canPlayType("audio/flac;")).replace(/^no$/,"")};return a},_enableMobileAudio:function(){var a=this||b,c=/iPhone|iPad|iPod|Android|BlackBerry|BB10|Silk|Mobi/i.test(a._navigator&&a._navigator.userAgent),d=!!("ontouchend"in window||a._navigator&&0=d){if("loaded"!==a._state)return a._queue.push({event:"volume",action:function(){a.volume.apply(a,c)}}),a;"undefined"===typeof e&&(a._volume=d);e=a._getSoundIds(e);for(var g=0;gc?"out":"in",k=g/0.01,g=0g&&(k=Math.ceil(k/(4/g)),g=4);if("loaded"!==f._state)return f._queue.push({event:"fade",action:function(){f.fade(a,c,d,e)}}),f;f.volume(a,e);for(var m=f._getSoundIds(e), B=0;Bf&&(c=/safari/.test(b._navigator&&b._navigator.userAgent.toLowerCase()),b._navigator&&b._navigator.standalone&&!c||b._navigator&&!b._navigator.standalone&& !c)&&(b.usingWebAudio=!1);b.usingWebAudio&&(b.masterGain="undefined"===typeof b.ctx.createGain?b.ctx.createGainNode():b.ctx.createGain(),b.masterGain.gain.value=1,b.masterGain.connect(b.ctx.destination));b._setup()};"function"===typeof define&&define.amd&&define([],function(){return{Howler:b,Howl:c}});"undefined"!==typeof exports&&(exports.Howler=b,exports.Howl=c);"undefined"!==typeof window?(window.HowlerGlobal=a,window.Howler=b,window.Howl=c,window.Sound=d):"undefined"!==typeof global&&(global.HowlerGlobal= a,global.Howler=b,global.Howl=c,global.Sound=d)})();var RSAnalyticsPlatform={iOS:"iOS",android:"android",amazon:"amazon",canvas:"canvas",web:"web"},RSAnalyticsSource={free:0,paid:1},RSAnalyticsSink={free:0,paid:1},RSAnalyticsGenre={slots:"slots",poker:"poker",bingo:"bingo",blackjack:"blackjack",trivia:"trivia",keno:"keno"},RSEventCategory={SYS_OPS:"sysops",PLAYER_ACTION:"player_action",GAME_ACTION:"game_action",PLAYER_BEHAVIOR:"player_behavior",ECONOMY:"economy",VIRALITY:"virality",GUI:"gui",TUTORIAL:"tutorial",VIDEO_BONUS:"video_bonus",SLOT_GAME_ACTION:"slot_game_action", BINGO_GAME_ACTION:"bingo_game_action",POKER_GAME_ACTION:"poker_game_action",KENO_GAME_ACTION:"keno_game_action",BLACKJACK_GAME_ACTION:"blackjack_game_action",ROULETTE_GAME_ACTION:"roulette_game_action",SCRATCHER_GAME_ACTION:"scratcher_game_action",SCOREBOX_GAME_ACTION:"scorebox_game_action",GAME_EXPERIENCE:"game_experience"},RSAnalyticsManager=function(){var a,b=RSClass.extend({init:function(){this._inHouseAnalytics=null;this._loadingTimeOffset=this._loadingPauseTime=this._loadingStartTime=0;this._primaryCurrency= "primary";this._secondaryCurrency="secondary";this._currentMachineAnalytics="";this._screens=[]},setCurrentMachineAnalyticsName:function(a){this._currentMachineAnalytics=a},getCurrentMachineAnalyticsName:function(){return this._currentMachineAnalytics},pushCurrentScreen:function(a){this._screens.push(a)},getScreenArray:function(){return this._screens},popCurrentScreen:function(){this._screens.pop()},getCurrentScreen:function(){return this._screens[this._screens.length-1]},removeAllScreensExceptMainLobby:function(){for(;1< this._screens.length;)this._screens.pop()},getCurrentMachineName:function(){var a="";return a="gameplay_screen"==RSAnalyticsManager.getInstance().getCurrentScreen()?this.getCurrentMachineAnalyticsName():this.getCurrentScreen()},setInGameCurrencyNames:function(a,b){this._primaryCurrency=a;this._secondaryCurrency=b},initializeInHouseAnalytics:function(a,b,e,f){if(null==this._inHouseAnalytics){GlobalVars.analyticsPlatformName=b;if(b==RSAnalyticsPlatform.web){var g=window.location.href;g.includes("indexpwa")&& (b="web_mobile",g.includes("source\x3d")&&(b="web_pwa"))}"pwa"==getUrlParametersByName("source")&&"MS"==GameConfig.GAME_ID&&(b="ms_store");GlobalVars.analyticsPlatformName=b;this._inHouseAnalytics=new RSInHouseAnalytics(a,b,e,f)}},reinitializeInHouseAnalyticsWithUser:function(a,b,e,f,g,h){null!=this._inHouseAnalytics&&this._inHouseAnalytics.initialize(a,b,e,f,g,h)},onServerTimeUpdate:function(a){null!=this._inHouseAnalytics&&this._inHouseAnalytics.updateSessionID(a)},startSession:function(a){null!= this._inHouseAnalytics&&this._inHouseAnalytics.startSession(a);0TimeManager.getInstance().getCurrentServerTime()&&this.trackEvent(RSEventCategory.GAME_ACTION,"session_stop","","","",""),this._sessionActive=!1,this.processQueue(!0),clearInterval(this._callAnalyticsInterval))},resumeSession:function(a){this._sessionActive||0==this._userID.length||(this._sessionActive=!0,this.trackEvent(RSEventCategory.GAME_ACTION,"session_resumed",a,"","",""),this.processQueue(!1),this._callAnalyticsInterval=setInterval(this.processQueue.bind(this,!1),RS_INHOUSE_SYNC_TIME))}, updateSessionID:function(a){var b=Date.now();if(17280060*RS_INHOUSE_SESSION_RENEWAL&&(this._sessionID=this._userID+"_"+a,this._localMinimizeTime=this._recordedSessionTime=0);return!0},getCurrentSessionId:function(){return this._sessionID},processQueue:function(a){if(0!=this._queue.length){var b=0;a?(this._requestInProgress&&this._queue.splice(0,1),b=this._queue.length):this._queueLimitProcessed?b=1:(b=this._queue.length, b>RS_INHOUSE_QUEUE_LIMIT&&(this._queueLimitProcessed=!0,b=RS_INHOUSE_QUEUE_LIMIT));if(0!=b){this._requestInProgress=!0;a=this._queue[0];this._queue.splice(0,1);for(var c=1;c=d.getJackPotTier()?d.getSecondaryCurrency():d.getJackPotTier(),g.level=d.getUserLevel(),g.monetization_factor=d.getMonetizationFactor()),c=RSVIPManager.getInstance().getVIPUserStatus(),null==c?(g.vip_tier="",g.vip_status_points="",g.vip_reward_points=""):(g.vip_tier=c._currentTier,g.vip_status_points= c._vipPoints._statusPoints,g.vip_reward_points=c._vipPoints._rewardPoints),g.opt_counter=this._eventCounter,g.version=this._version,g.session_duration=this.getCurrentSessionDuration(),g.event_time=TimeManager.getInstance().getCurrentServerTime(),g.session_id=this._sessionID,"game_action"==a&&"session_stop"==b&&2400=RSEngine.popupManager.getPopupCount()&&RSCasinoManager._interruptAllowed&&(null!=RSCasinoManager._customCasinoInterface?RSCasinoManager._customCasinoInterface.triggerInterrupts():API.trigger_interrupts(),RSCasinoManager._interruptAllowed=!1)};RSCasinoManager.disableAllHUDButtons=function(){null!=RSCasinoManager._HUD?RSCasinoManager._HUD.disableAllButtons():API.disable_hud()}; RSCasinoManager.triggerMachineEvent=function(a,b,c,d,e,f){void 0==d&&(d="");void 0==e&&(e="");void 0==f&&(f="");null!=RSCasinoManager._customCasinoInterface?RSCasinoManager._customCasinoInterface.triggerMachineEvent(a,b,c,d,e,f):API.machine_event(a,b,c,d,e,f)};RSCasinoManager.triggerPrimarySourceEvent=function(a,b,c,d,e,f){null!=RSCasinoManager._customCasinoInterface?RSCasinoManager._customCasinoInterface.triggerPrimarySourceEvent(a,b,c,d,e,f):API.analytics_primary_source(a,b,c,d)}; RSCasinoManager.triggerPrimarySinkEvent=function(a,b,c,d,e){null!=RSCasinoManager._customCasinoInterface?RSCasinoManager._customCasinoInterface.triggerPrimarySinkEvent(a,b,c,d,e):API.analytics_primary_sink(a,b,c)};RSCasinoManager.triggerSecondarySourceEvent=function(a,b,c,d){null!=RSCasinoManager._customCasinoInterface?RSCasinoManager._customCasinoInterface.triggerSecondarySourceEvent(a,b,c,d):API.analytics_secondary_source(a,b,c,d)}; RSCasinoManager.triggerSecondarySinkEvent=function(a,b,c){null!=RSCasinoManager._customCasinoInterface?RSCasinoManager._customCasinoInterface.triggerSecondarySinkEvent(a,b,c):API.analytics_secondary_sink(a,b,c)};RSCasinoManager.triggerButtonClickEvent=function(a,b,c){void 0==c&&(c="");null!=RSCasinoManager._customCasinoInterface?RSCasinoManager._customCasinoInterface.triggerButtonClickEvent(a,b,c):API.button_click(a,b,c)}; RSCasinoManager.showToaster=function(a,b,c,d,e,f,g,h){new RSToaster(a,b,c,d,e,f,g,h)};RSCasinoManager.postMessage=function(a,b){RSEventManager.getInstance().dispatchEvent(a,b)};var RSCasinoInterface=RSClass.extend({init:function(){this._super.init.call(this)},notifyMachineLoadingStart:function(){},notifyLoadingCompleteToCasino:function(a){},notifyLoadingFailureToCasino:function(a){},notifySpinStartToCasino:function(a){},notifyBetAmountChangeToCasino:function(a){},notifyResultToCasino:function(a){},notifyOutOfCurrencyToCasino:function(a){},notifyMachineExitToCasino:function(a){},getPrimaryCurrency:function(){return 0},addPrimaryCurrency:function(a,b){},addPrimaryCurrencyForDisplay:function(a, b,c){},getSecondaryCurrency:function(){return 0},addSecondaryCurrency:function(a){},addSecondaryCurrencyForDisplay:function(a,b){},triggerMachineEvent:function(a,b,c,d,e,f){},triggerPrimarySourceEvent:function(a,b,c,d,e){},triggerPrimarySinkEvent:function(a,b,c){},triggerSecondarySourceEvent:function(a,b,c,d){},triggerSecondarySinkEvent:function(a,b,c){},triggerButtonClickEvent:function(a,b,c){},triggerInterrupts:function(){},postTournamentMachineData:function(){},handleResultComplete:function(a, b,c){},notifySalePurchaseResponseToCasino:function(a,b,c,d){},showPurchaseUI:function(a,b,c,d){},showRoundCompletePopups:function(){},isFreeSpinAvailable:function(){return!1},showCollectibleEngagementPopup:function(a){},isTutorialRoom:function(){return!1},postMessageToBingo:function(a,b){},showDaubAlertCart:function(a){}});var RSCasinoScreen=RSGameScreen.extend({init:function(){this._super.init.call(this)},loadContent:function(){this._super.loadContent.call(this);null==RSCasinoManager.getCasinoInterface()&&RSCasinoManager.setCasinoInterface(this.getCasinoInterface());null!=RSEngine.externalGameManager&&null==RSEngine.externalGameManager.getCustomExternalGameInterface()&&RSEngine.externalGameManager.setCustomExternalGameInterface(this.getExternalGameInterface());null==RSCasinoManager.getCasinoHUD()&&RSCasinoManager.setCasinoHUD(this.getCasinoHUD())}, unloadContent:function(){this.removeChild(RSCasinoManager.getCasinoHUD(),!1);this._super.unloadContent.call(this)},onLayoutCompleted:function(){this.addHUDToScreen();this._super.onLayoutCompleted.call(this)},onReveal:function(){RSEngine.loginMode!=LOGIN_MODE.INSTANT_GAME&&RSGame.getInstance().getTutorialManager().addTutorialOverlayForCurrentIndex();RSCasinoManager.getCasinoHUD().enableAllButtons()},addHUDToScreen:function(){var a=RSCasinoManager.getCasinoHUD();a.reInitButtonHoverCursor();this.addChild(a)}, getCasinoHUD:function(){return null},getCasinoInterface:function(){return null},getExternalGameInterface:function(){return new RSExternalGameInterface}});var RSCasinoHUD=RSGameScreen.extend({init:function(a){this._super.init.call(this);this._layout=a;this._xp=this._secondaryCurrency=this._primaryCurrency=0},loadContent:function(){this.layoutScreen(this._layout);this._super.loadContent.call(this)},update:function(a){this._super.update.call(this,a)},onLayoutCompleted:function(){},onObjectCreated:function(a,b,c){},createCustomObject:function(a,b){},setPrimaryCurrency:function(a){this._primaryCurrency=a;this.setCurrencyValue(a)},setSecondaryCurrency:function(a){this._secondaryCurrency= a},setXP:function(a){this._xp=a},enableAllButtons:function(){},disableAllButtons:function(){},enableBackButtonForDirectLoading:function(){},refreshAvatar:function(){},setNewsFeedCount:function(a){},onSettingsButtonClicked:function(){},showHUD:function(a){},updateXPBar:function(){},showHudBackground:function(){},notifyToHud:function(){},moveUp:function(){this.actionMoveBy(0.5,0,75)},moveDown:function(){this.actionMoveBy(0.5,0,-75)},animatePiggyBank:function(){},isLevelUpInitiated:function(){return!1}, setFullScreenButtonStatus:function(a){return!1}});var kREQUEST_TYPE_POST="POST",kREQUEST_TYPE_GET="GET",RSHTTPRequest=function(){}; RSHTTPRequest.sendRequest=function(a,b,c,d,e,f,g){null==e&&(e=function(a){cc.log(a)});null==d&&(d=function(a){cc.log(a)});var h=cc.loader.getXMLHttpRequest();h.open(b,a,f);h.setRequestHeader("Content-Type","application/json;charset\x3dUTF-8");if(g)for(var k in g)h.setRequestHeader(k,g[k]);h.onreadystatechange=function(){4==h.readyState&&200==h.status&&clearTimeout(m)};h.onload=function(){try{var a=null;if(GameConfig.IS_ENCRYPTION_ENABLED){var b=RSUtils.genHkey32(GameConfig.CASINO_NAME.toLowerCase()), e=GameConfig.IV_VALUE,f=null;0===h.responseText.indexOf("[")?f=JSON.parse(h.responseText):f=h.responseText;Array.isArray(f)&&(f=f[0]);var g=CryptoJS.AES.decrypt(f,CryptoJS.enc.Utf8.parse(b),{algorithm:"aes-256",iv:CryptoJS.enc.Utf8.parse(e),padding:CryptoJS.pad.Pkcs7,mode:CryptoJS.mode.CBC}),g=g.toString(CryptoJS.enc.Utf8),a=JSON.parse(g)}else a=JSON.parse(h.responseText);d(a);null!=a.error&&RSErrorTracker.getInstance().trackErrorMessage("SERVICE_CALL_METHOD_MISSING",c,"mahesh.jose@rubyseven.net,lijith.puthiyoottil@rubyseven.net")}catch(k){}}; h.onerror=function(){e("Error: Network Error");clearTimeout(m)};var m=setTimeout(function(){h.abort();e("Error: Network Time out")},6E4);try{h.send(c)}catch(n){clearTimeout(m),e("Error: Network Unavailable")}};var INetworkEvent=new Interface("INetworkEvent",["onNoNetwork","networkConnectionActive"]),RSNetworkManager=function(){var a,b=RSClass.extend({_serviceURL:null,delegate:null,intervalTimer:null,checkInterval:1E4,_connectionLostPopup:null,_connectionResumeExternalCb:null,_connectionLostCount:0,_isTriggeredPopup:!1,init:function(){this._connectionLostCount=0;this._super.init.call(this)},initialize:function(a){this._serviceURL=a},sendJSONRPCRequest:function(a,b,e,f){var g={};g.method=a;g.params=b;g.id= "1";var g=JSON.stringify(g),h=""!=RSAnalyticsManager.getInstance().getCurrentSessionId()?RSAnalyticsManager.getInstance().getCurrentSessionId():0;b=b[0];null!=RSGame.getInstance().getUserDataManager().getMe()&&(b=RSGame.getInstance().getUserDataManager().getMe().getId());a="?user_id\x3d"+b+"\x26r7call\x3d"+a+"\x26session_id\x3d"+h+"\x26appId\x3d"+GameConfig.APP_ID+"\x26appPlatform\x3dcanvas\x26appVersion\x3d1";GameConfig.IS_ENCRYPTION_ENABLED&&(b=RSUtils.genHkey32(GameConfig.CASINO_NAME.toLowerCase()), h=GameConfig.IV_VALUE,g=CryptoJS.AES.encrypt(g,CryptoJS.enc.Utf8.parse(b),{algorithm:"aes-256",iv:CryptoJS.enc.Utf8.parse(h),padding:CryptoJS.pad.Pkcs7,mode:CryptoJS.mode.CBC}));RSHTTPRequest.sendRequest(this._serviceURL+a,kREQUEST_TYPE_POST,g,e,f,!0)},sendJSONRPCRequestSync:function(a,b,e,f){var g={};g.method=a;g.params=b;g.id="1";var g=JSON.stringify(g),h=""!=RSAnalyticsManager.getInstance().getCurrentSessionId()?RSAnalyticsManager.getInstance().getCurrentSessionId():0;b=b[0];null!=RSGame.getInstance().getUserDataManager().getMe()&& (b=RSGame.getInstance().getUserDataManager().getMe().getId());a="?user_id\x3d"+b+"\x26r7call\x3d"+a+"\x26session_id\x3d"+h+"\x26appId\x3d"+GameConfig.APP_ID+"\x26appPlatform\x3dcanvas\x26appVersion\x3d1";GameConfig.IS_ENCRYPTION_ENABLED&&(b=RSUtils.genHkey32(GameConfig.CASINO_NAME.toLowerCase()),h=GameConfig.IV_VALUE,g=CryptoJS.AES.encrypt(g,CryptoJS.enc.Utf8.parse(b),{algorithm:"aes-256",iv:CryptoJS.enc.Utf8.parse(h),padding:CryptoJS.pad.Pkcs7,mode:CryptoJS.mode.CBC}));RSHTTPRequest.sendRequest(this._serviceURL+ a,kREQUEST_TYPE_POST,g,e,f,!1)},sendURLRequest:function(a,b,e){RSHTTPRequest.sendRequest(a,kREQUEST_TYPE_GET,null,b,e,!0)},unload:function(){},setDelegate:function(a){a.implements(INetworkEvent);this.delegate=a},removeNetworkCheck:function(){null!=this.intervalTimer&&(clearInterval(this.intervalTimer),this.intervalTimer=null)},enableNetworkCheck:function(a,b){this.checkInterval=null==b?1E4:b;null==a||a?this.checkNetwork():(this.removeNetworkCheck(),this.intervalTimer=setInterval(this.checkNetwork.bind(this), this.checkInterval))},checkNetwork:function(){if(null==this.delegate)throw Error("Delegate Not set for NetworkManager");var a=new XMLHttpRequest,b=this;a.onreadystatechange=function(){if(4==a.readyState)if(200<=a.status&&(300>a.status||304===a.status))b._connectionLostCount&&(null!=b.delegate&&b.delegate.networkConnectionActive(),b.onNetworkConnectionActive(!0));else{cc.log("Connection Lost -\x3e onReadyStateChange!!!!");if(null!=b.delegate)b.delegate.onNoNetwork();b.onNetworkConnectionFail()}};a.onerror= function(a){cc.log("Connection Lost -\x3e onError!!!!");if(null!=b.delegate)b.delegate.onNoNetwork();b.onNetworkConnectionFail()};var e=window.location.hostname;""!=window.location.port&&(e+=":"+window.location.port);a.open("HEAD","//"+e+"/res/ping.html?v\x3d"+Math.floor(65536*(1+Math.random())),!0);a.timeout=6E4;a.ontimeout=function(){cc.log("Connection Lost -\x3e Timeout!!!!");if(null!=b.delegate)b.delegate.onNoNetwork();b.onNetworkConnectionFail()};try{a.send(null)}catch(f){cc.log("Connection Lost -\x3e Error Catch!!!!"+ f);if(null!=b.delegate)b.delegate.onNoNetwork();b.onNetworkConnectionFail()}},onConnectionLostPopupAction:function(){this._isTriggeredPopup=!1;3<=this._connectionLostCount?RSEngine.reloadPage():(this._connectionResumeExternalCb&&this._connectionResumeExternalCb(),this._connectionLostPopup&&this._connectionLostPopup.enableButtons(!1))},initializeConnectionLostPopup:function(a){null===this._connectionLostPopup&&(this._connectionLostPopup=new RSNetworkDisconnectPopup(a),this._connectionLostPopup.loadContent())}, onNetworkConnectionActive:function(){if(null==this._connectionResumeExternalCb)this.onConnectionSuccess(!0)},onNetworkConnectionFail:function(){this.showNetworkError(null,null)},onConnectionSuccess:function(a){this._connectionLostCount&&(RSEventManager.getInstance().dispatchEvent("RS_CONNECTION_RE_ESTABLISHED"),this.hideConnectionLostPopup(),setTimeout(function(){RSEngine.externalGameManager.reloadExternalGame()},100),this._connectionResumeExternalCb=null,a&&(this._connectionLostCount=0))},showNetworkError:function(a, b){if(!this._isTriggeredPopup){this._connectionLostCount++;if(3<=this._connectionLostCount)a="Sorry! There seems to be some issue. Please reload the game.";else{null==a&&(a="Oops! Your connection to the internet \n was temporarily lost.\n Please check WiFi or Cellular connection.");if(null!=this._connectionResumeExternalCb){cc.warn("Already another instance triggered connection lost popup");return}b&&(this._connectionResumeExternalCb=b)}b=this.onConnectionLostPopupAction.bind(this);this.showConnectionLostPopup(a, b);this._isTriggeredPopup=!0}},showConnectionLostPopup:function(a,b,e){URLConfig.NMI_SCRIPT_TOKEN&&RSInAppPurchaseManager.getInstance().isPurchaseUIOnDisplay&&($("#preloader").length&&$("#preloader").remove(),closePurchaseUIPopup(),RSEngine.screenManager.removeOverlay());null==this._connectionLostPopup?cc.warn("Connection lost popup has not been set!!"):(this._connectionLostPopup.enableButtons(!0),RSEngine.popupManager.isPopupAdded(this._connectionLostPopup)?this._connectionLostPopup.setPopupData(a, null,b):(this._connectionLostPopup.setPopupData(a,b,e),RSEngine.popupManager.addPopup(this._connectionLostPopup,!0,!0,!0)))},showGameReloadPopup:function(a){this.removeNetworkCheck();this._connectionLostCount=3;this._connectionLostPopup.enableButtons(!0);this.showConnectionLostPopup(a,this.onConnectionLostPopupAction.bind(this),!0);this._isTriggeredPopup=!0},hideConnectionLostPopup:function(){this._isTriggeredPopup=!1;this._connectionLostPopup.closePopup()},unloadConnectionLostPopup:function(){null!= this._connectionLostPopup&&(this._connectionLostPopup.unloadPopup(),this._connectionLostPopup=null)},getGameConfigDetails:function(a,b,e,f){RSHTTPRequest.sendRequest(a,kREQUEST_TYPE_POST,b,e,f,!0)},getEventStatusFromDashBoard:function(a,b,e,f){if(GameConfig.DASHBOARD_URL&&GameConfig.PLATFORM_EVENT_MANAGER_ENABLED){a=GameConfig.DASHBOARD_URL+a;b=JSON.stringify(b);var g=[];g.appId=GameConfig.APP_ID;g.vName=GameConfig.VERSION;g.platform=RSEngine.platform==PLATFORM.MOBILE?"mobile":"html5";if(GameConfig.IS_ENCRYPTION_ENABLED){var h= RSUtils.genHkey32(GameConfig.CASINO_NAME.toLowerCase()),k=GameConfig.IV_VALUE;b=CryptoJS.AES.encrypt(b,CryptoJS.enc.Utf8.parse(h),{algorithm:"aes-256",iv:CryptoJS.enc.Utf8.parse(k),padding:CryptoJS.pad.Pkcs7,mode:CryptoJS.mode.CBC})}RSHTTPRequest.sendRequest(a,kREQUEST_TYPE_POST,b,e,f,!0,g)}},sendGiftCenterPushNotification:function(a,b,e,f){if(GameConfig.DASHBOARD_URL&&GameConfig.GIFTING_ENABLED){a=GameConfig.DASHBOARD_URL+a;b=JSON.stringify(b);var g=[];g.appId=GameConfig.APP_ID;g.vName=GameConfig.VERSION; g.platform=RSEngine.platform==PLATFORM.MOBILE?"mobile":"html5";if(GameConfig.IS_ENCRYPTION_ENABLED){var h=RSUtils.genHkey32(GameConfig.CASINO_NAME.toLowerCase()),k=GameConfig.IV_VALUE;b=CryptoJS.AES.encrypt(b,CryptoJS.enc.Utf8.parse(h),{algorithm:"aes-256",iv:CryptoJS.enc.Utf8.parse(k),padding:CryptoJS.pad.Pkcs7,mode:CryptoJS.mode.CBC})}RSHTTPRequest.sendRequest(a,kREQUEST_TYPE_POST,b,e,f,!0,g)}}});return{getInstance:function(){a||(a=new b);return a}}}();var DynamoDBParser=function(){};DynamoDBParser.encode=function(a){var b={},c;for(c in a){var d={Value:{}},e=a[c];"undefined"==typeof e||null==e?cc.log("Value for "+c+" is null!!!!!!!"):DynamoDBParser.isNumber(e)?(d.Value.N=Number(e).toString(),b[c]=d):DynamoDBParser.isString(e)?(d.Value.S=e,b[c]=d):(d.Value.S=JSON.stringify(e),b[c+"_"]=d)}return b}; DynamoDBParser.decode=function(a){var b={},c;for(c in a){var d=a[c];if(!DynamoDBParser.isNumber(d)&&!DynamoDBParser.isString(d)){null!=d.Value&&(d=d.Value);for(var e in d)switch(e){case "N":b[c]=Number(d[e]);break;case "S":var f=c.split("_"),g=1this._dataHolder.slotsStats.highest_win&&(this._dataHolder.slotsStats.highest_win=a)},getSlotWin:function(){return this._dataHolder.slotsStats.highest_win}, setBlackjackTutorialShownStatus:function(a){0==this._dataHolder.blackjackTutorialsShown.length?this._dataHolder.blackjackTutorialsShown.push(a):-1==this._dataHolder.blackjackTutorialsShown.indexOf(a)&&this._dataHolder.blackjackTutorialsShown.push(a)},getBlackjackTutorialShownStatus:function(){null==this._dataHolder.blackjackTutorialsShown&&(this._dataHolder.blackjackTutorialsShown=[]);return this._dataHolder.blackjackTutorialsShown},setBlackjackHighestWin:function(a){this._dataHolder.blackjackStats.highest_win|| (this._dataHolder.blackjackStats.highest_win=0);this._dataHolder.blackjackStats.highest_win=d)b=this.getDateInStringFormat(this._dataHolder.bingoStats.first_played);break;case "TableGames":if(0!==this._dataHolder.rouletteStats.first_played)var e=this._dataHolder.rouletteStats.first_played; if(0!==this._dataHolder.blackjackStats.first_played)var f=this._dataHolder.blackjackStats.first_played;if(void 0==f||e<=f)b=this.getDateInStringFormat(this._dataHolder.rouletteStats.first_played);else if(void 0==e||e>=f)b=this.getDateInStringFormat(this._dataHolder.blackjackStats.first_played)}return b},getDateInStringFormat:function(a){a*=1E3;if(0c))switch(c%10){case 1:d="st";break;case 2:d="nd";break;case 3:d="rd";break;default:d="th"}a=b+" "+c+d+", "+a.getFullYear()}else a=" ";return a},getProfileStatusValue:function(a){switch(a){case "getSlotWin":return this.getSlotWin();case "getSpins":return this.getSpins();case "ScratcherStatsGetHighestWin":return this.ScratcherStatsGetHighestWin();case "getScratcherRounds":return RSGame.getInstance().getGameManager().getScratcherRounds(RSGameTypes.Scratcher);default:return 0}}, setNewAvatar:function(a){this._dataHolder.newAvatar=a},getNewAvatar:function(){return this._dataHolder.newAvatar?this._dataHolder.newAvatar:!1},getSweepstakesSurfaceShownStatus:function(){if(null==this._dataHolder.isSweepstakesSurfacingShown||void 0==this._dataHolder.isSweepstakesSurfacingShown)this._dataHolder.isSweepstakesSurfacingShown=!1;return this._dataHolder.isSweepstakesSurfacingShown},setSweepstakesSurfaceShownStatus:function(){this._dataHolder.isSweepstakesSurfacingShown=!0},setPreviousTierData:function(a){this._dataHolder.previousTier= a},getPreviousTierData:function(){return this._dataHolder.previousTier},getLoginRewardStatus:function(){if(null==this._dataHolder.isSSOLoginBonusAwarded||void 0==this._dataHolder.isSSOLoginBonusAwarded)this._dataHolder.isSSOLoginBonusAwarded=!1;return this._dataHolder.isSSOLoginBonusAwarded},setLoginRewardStatus:function(){this._dataHolder.isSSOLoginBonusAwarded=!0},getMigratedUserPopupTriggerStatus:function(){if(null==this._dataHolder.isMigratedUserPopupShown||void 0==this._dataHolder.isMigratedUserPopupShown)this._dataHolder.isMigratedUserPopupShown= !1;return this._dataHolder.isMigratedUserPopupShown},setMigratedUserPopupTriggeredStatus:function(){this._dataHolder.isMigratedUserPopupShown=!0},getFbLoginRewardStatus:function(){if(null==this._dataHolder.isFBLoginBonusAwarded||void 0==this._dataHolder.isFBLoginBonusAwarded)this._dataHolder.isFBLoginBonusAwarded=!1;return this._dataHolder.isFBLoginBonusAwarded},setFbLoginRewardStatus:function(){this._dataHolder.isFBLoginBonusAwarded=!0},getTournamaniaSurfacingShownStatus:function(){if(null==this._dataHolder.tournamaniaSurfacingShown|| void 0==this._dataHolder.tournamaniaSurfacingShown)this._dataHolder.tournamaniaSurfacingShown=!1;return this._dataHolder.tournamaniaSurfacingShown},setTournamaniaSurfacingShownStatus:function(){this._dataHolder.tournamaniaSurfacingShown=!0},getLocalSessionData:function(a){this._dataHolder.localSessionData||(this._dataHolder.localSessionData={});this._dataHolder.localSessionData[a]||(this._dataHolder.localSessionData[a]={});return this._dataHolder.localSessionData[a]},setLocalSessionData:function(a, b){this._dataHolder.localSessionData||(this._dataHolder.localSessionData={});this._dataHolder.localSessionData[a]=b},getVikingLoungePopupShownStatus:function(){if(null==this._dataHolder.isVikingLoungePopupShown||void 0==this._dataHolder.isVikingLoungePopupShown)this._dataHolder.isVikingLoungePopupShown=!1;return this._dataHolder.isVikingLoungePopupShown},setVikingLoungePopupShownStatus:function(){this._dataHolder.isVikingLoungePopupShown=!0},setCustomLoungePopupShownStatus:function(a){if(null==this._dataHolder.customLoungePopupShown|| void 0==this._dataHolder.customLoungePopupShown)this._dataHolder.customLoungePopupShown=[];this._dataHolder.customLoungePopupShown.includes(a)||this._dataHolder.customLoungePopupShown.push(a)},getCustomLoungePopupShownStatus:function(a){if(null==this._dataHolder.customLoungePopupShown||void 0==this._dataHolder.customLoungePopupShown)this._dataHolder.customLoungePopupShown=[];return this._dataHolder.customLoungePopupShown.includes(a)},getMachineUnlockList:function(a){return this._dataHolder["machineUnlocks"+ parseInt(a+1).toString()]},setMachineUnlockList:function(a,b){isNaN(b)||(this._dataHolder["machineUnlocks"+parseInt(a+1).toString()]=b)},setScoreBoxDisplayedValues:function(a,b,c){void 0===this._dataHolder.scoreboxResultsDisplayed[a]&&(this._dataHolder.scoreboxResultsDisplayed[a]={});void 0===this._dataHolder.scoreboxResultsDisplayed[a][b]&&(this._dataHolder.scoreboxResultsDisplayed[a][b]={});this._dataHolder.scoreboxResultsDisplayed[a][b]=c.toString()},getScoreBoxDisplayedValues:function(){void 0=== this._dataHolder.scoreboxResultsDisplayed&&(this._dataHolder.scoreboxResultsDisplayed={});return this._dataHolder.scoreboxResultsDisplayed},getLMAnnouncementShownStatus:function(){if(null==this._dataHolder.isLMAnnouncementShown||void 0==this._dataHolder.isLMAnnouncementShown)this._dataHolder.isLMAnnouncementShown=!1;return this._dataHolder.isLMAnnouncementShown},setLMAnnouncementShownStatus:function(){this._dataHolder.isLMAnnouncementShown=!0},getPlayerConnectUpdateStatus:function(){null==this._dataHolder.propertyLinkState&& (this._dataHolder.propertyLinkState=0);return 0a&&(c+=a,this[b(467)]()[b(308)](c)),this.getMe()[b(391)](e)):(c-=d,this[b(467)]()[b(308)](c),this[b(467)]()[b(391)](0))},addPaidCoinsForInternalAristocrat:function(a){var b= a0_0x3ce7,c=this[b(467)]()[b(305)]()+a;0a&&this[b(467)]()[b(391)](c):this[b(467)]().setPaidCoins(0)},addXP:function(a){var b=a0_0x3ce7;0!=a&&(this[b(300)].addXP(a),this[b(458)]=!0)},createGiftingLink:function(a,b,c){var d=a0_0x3ce7,e=[];e[0]=RSEngine[d(373)].getMe()[d(345)]();e[1]=a;e[2]=RSEngine[d(285)]==PLATFORM[d(347)]?d(431):"html5";e[3]="";RSEngine[d(418)].sendJSONRPCRequest("Gifting.createGiftingLink",e,b,c)},enableGiftingLink:function(a,b,c){var d=a0_0x3ce7,e=[];e[0]=RSEngine[d(373)][d(467)]()[d(345)](); e[1]=a;e[2]=RSEngine.platform==PLATFORM[d(347)]?d(431):d(442);e[3]="";RSEngine[d(418)][d(357)](d(411),e,b,c)},collectBotGift:function(a,b){var c=a0_0x3ce7,d=[];d[0]=RSEngine.dataManager.getMe()[c(345)]();d[1]=RSEngine.platform==PLATFORM[c(347)]?c(431):c(442);d[2]="";RSEngine.networkManager[c(357)](c(497),d,a,b)},collectGift:function(a,b,c){var d=a0_0x3ce7,e=[];e[0]=RSEngine[d(373)].getMe()[d(345)]();e[1]=RSEngine.platform==PLATFORM[d(347)]?d(431):"html5";e[2]="";e[3]=a;e[4]=d(262);RSEngine.networkManager.sendJSONRPCRequest(d(332), e,b,c)},collectAllGift:function(a,b,c,d){var e=a0_0x3ce7,f=[];f[0]=RSEngine[e(373)].getMe()[e(345)]();f[1]=RSEngine[e(285)]==PLATFORM[e(347)]?e(431):e(442);f[2]="";f[3]=a;f[4]=e(262);f[5]=b;RSEngine[e(418)].sendJSONRPCRequest(e(430),f,c,d)},getGiftingData:function(a,b){var c=a0_0x3ce7,d=[];d[0]=RSEngine[c(373)][c(467)]().getId();d[1]=RSEngine.platform==PLATFORM[c(347)]?c(431):c(442);RSEngine[c(418)][c(357)]("Gifting.getGiftData",d,a,b)},getDailyBonusStatus:function(a,b,c,d,e){c=a0_0x3ce7;var f=[]; f[0]=b;var f=RSUtils[c(279)](f),g=[];g[0]=RSEngine[c(373)][c(467)]()[c(345)]();g[1]=RSEngine.platform==PLATFORM.MOBILE?c(431):c(442);g[2]="";g[3]=a;g[4]=b;g[5]=f;RSEngine[c(418)][c(357)](c(434),g,d,e)},getDailyBonusStatusV2:function(a,b,c,d,e,f){var g=a0_0x3ce7,h=[];h[0]=b;h[1]=d?1:0;h[2]=c;var h=RSUtils[g(279)](h),k=[];k[0]=RSEngine.dataManager[g(467)]()[g(345)]();k[1]=RSEngine.platform==PLATFORM[g(347)]?"mobile":g(442);k[2]=GameConfig[g(466)];k[3]=a;k[4]=b;k[5]=d?1:0;k[6]=c;k[7]=h;RSEngine[g(418)][g(357)](g(314), k,e,f)},getDailyBonusStatusV3:function(a,b,c,d,e,f){var g=a0_0x3ce7,h=[];h[0]=b;h[1]=d?1:0;h[2]=c;var h=RSUtils[g(279)](h),k=[];k[0]=RSEngine[g(373)].getMe()[g(345)]();k[1]=RSEngine[g(285)]==PLATFORM.MOBILE?"mobile":g(442);k[2]=GameConfig[g(466)];k[3]=a;k[4]=b;k[5]=d?1:0;k[6]=c;k[7]=h;RSEngine[g(418)][g(357)](g(289),k,e,f)},getHourlyBonusStatus:function(a,b,c,d){var e=a0_0x3ce7,f=[];f[0]=b;var f=RSUtils.getHashValue(f),g=[];g[0]=RSEngine[e(373)][e(467)]().getId();g[1]=RSEngine[e(285)]==PLATFORM.MOBILE? e(431):e(442);g[2]="";g[3]=a;g[4]=b;g[5]=f;RSEngine[e(418)][e(357)]("User.getHourlyBonusStatus",g,c,d)},setLeaderBoardByGameType:function(a,b,c,d,e,f,g){var h=a0_0x3ce7,k={};k[h(414)]=RSEngine[h(373)][h(467)]()[h(345)]();k[h(376)]=RSEngine[h(373)][h(467)]()[h(393)]();k[h(407)]=RSEngine[h(373)].getMe()[h(293)]();k[h(440)]=RSEngine.dataManager[h(467)]().getAvatar();k[h(303)]=RSAnalyticsManager[h(362)]().getCurrentMachineAnalyticsName();var m;switch(b){case RSGameTypes.Poker:k[h(449)]=a;k[h(486)]=d; k[h(389)]=e;k[h(268)]=JSON.stringify(f);k[h(317)]=g;m=[k.userId,k[h(376)],k.lastName,k[h(440)],k[h(303)],k.coins,k.handRank,k[h(389)],k[h(268)],k[h(317)]];break;case RSGameTypes[h(451)]:k[h(449)]=a;m=[k[h(414)],k[h(376)],k[h(407)],k[h(440)],k[h(303)],k[h(449)]];break;case RSGameTypes[h(266)]:k[h(449)]=a;m=[k[h(414)],k[h(376)],k[h(407)],k.avatarId,k[h(303)],k[h(449)]];break;case RSGameTypes.Bingo:k[h(395)]=a;m=[k[h(414)],k[h(376)],k[h(407)],k.avatarId,k[h(303)],k.bingoPoints];break;case RSGameTypes[h(503)]:k.blackjackcount= a,m=[k[h(414)],k[h(376)],k.lastName,k[h(440)],k.machine_identifier,k[h(498)]]}a=RSUtils.getHashValue(m);k=JSON[h(410)](k)+"|"+a;a=[];a[0]=k;a[1]=c;a[2]=RSEngine[h(285)]==PLATFORM[h(347)]?h(431):h(442);a[3]=GameConfig.VERSION;a[4]=RSEngine[h(373)][h(467)]()[h(345)]();if(RSEngine[h(417)]==LOGIN_MODE[h(309)]||RSEngine[h(417)]==LOGIN_MODE[h(327)])switch(b){case RSGameTypes[h(463)]:this[h(334)]("pokerLeaderBoard.setLeaderBoard",a,0);break;case RSGameTypes[h(451)]:this.setLeaderboardData(h(359),a,0);break; case RSGameTypes.Keno:this[h(334)]("kenoLeaderBoard.setLeaderBoard",a,0);break;case RSGameTypes.Bingo:this[h(334)](h(369),a,0);break;case RSGameTypes[h(503)]:this[h(334)]("blackjackLeaderBoard.setLeaderBoard",a,0)}else if(RSEngine[h(417)]==LOGIN_MODE.EMAIL)switch(b){case RSGameTypes[h(463)]:this.setLeaderboardData(h(480),a,0);break;case RSGameTypes.Slots:this.setLeaderboardData("slotsLeaderBoard_Web.setLeaderBoard",a,0);break;case RSGameTypes.Keno:this[h(334)](h(392),a,0);break;case RSGameTypes[h(286)]:this[h(334)](h(487), a,0);break;case RSGameTypes.Blackjack:this[h(334)](h(358),a,0)}},setLeaderboardData:function(a,b,c){var d=a0_0x3ce7;RSEngine[d(418)][d(357)](a,b,this.setUserLeaderBoardDataResponse[d(435)](this),this.setUserLeaderBoardDataResponseFailed[d(435)](this,a,b,c))},setUserLeaderBoardDataResponse:function(a){var b=a0_0x3ce7;a&&(GameConfig[b(426)]?!a[b(416)][b(448)](b(355))&&RSErrorTracker.getInstance().trackErrorMessage(b(352),b(370)+JSON[b(410)](a[b(416)]),b(405)):a[b(416)]!=b(265)&&RSErrorTracker[b(362)]().trackErrorMessage(b(352), b(370)+JSON[b(410)](a.result),b(405)));if(this[b(469)])if(a&&a[b(416)]&&a[b(416)][b(355)]&&a[b(416)][b(301)])this[b(469)](a.result[b(355)],!1);else a&&a[b(416)]&&a[b(416)].userRank&&this[b(469)](a[b(416)][b(355)],!0)},setUserLeaderBoardDataResponseFailed:function(a,b,c){var d=a0_0x3ce7;3>c&&(c++,this[d(334)](a,b,c))},getAllLeaderBoard:function(a){var b=a0_0x3ce7,c=[],d;for(d in RSSocialManager.getInstance()[b(423)]){var e=RSSocialManager[b(362)]()[b(423)][d].id;c[b(489)](RSEngine.dataManager[b(473)]+ e)}d=[];RSEngine[b(417)]==LOGIN_MODE[b(309)]||RSEngine[b(417)]==LOGIN_MODE[b(327)]?(d[0]=GameConfig[b(382)]+RSEngine[b(373)][b(467)]()[b(325)](),d[1]=c,d[2]=b(424),d[3]=RSEngine[b(285)]==PLATFORM[b(347)]?"mobile":b(442),d[4]=RSEngine.dataManager.getMe()[b(345)](),RSEngine[b(418)].sendJSONRPCRequest(b(470),d,a,null)):RSEngine[b(417)]==LOGIN_MODE[b(319)]&&(d[0]=RSEngine[b(373)][b(467)]()[b(345)](),d[1]=c,d[2]=b(424),d[3]=RSEngine.platform==PLATFORM[b(347)]?"mobile":"html5",RSEngine[b(418)][b(357)](b(302), d,a,null))},getUserLeaderboard:function(a){var b=a0_0x3ce7,c=[];RSEngine[b(417)]==LOGIN_MODE[b(309)]||RSEngine[b(417)]==LOGIN_MODE.FACEBOOK?(c[0]=GameConfig[b(382)]+RSEngine[b(373)][b(467)]()[b(325)](),c[1]=RSEngine[b(373)][b(467)]()[b(345)](),RSEngine.networkManager[b(357)](b(496),c,a,null)):RSEngine[b(417)]==LOGIN_MODE[b(319)]&&(c[0]=RSEngine.dataManager.getMe()[b(345)](),RSEngine.networkManager[b(357)](b(261),c,a,null))},webSignIn:function(a,b,c){var d=a0_0x3ce7,e=[];e[0]=a;e[1]=b;GameConfig[d(476)]? (a=RSLoginManager.getInstance()[d(311)](GameConfig[d(379)]+"-blobId"),e[2]=a?a:"",e[3]="",e[4]=RSEngine[d(285)]==PLATFORM[d(347)]?"mobile":d(442),e[5]=GameConfig[d(466)]):(e[2]=RSEngine[d(285)]==PLATFORM[d(347)]?d(431):d(442),e[3]=GameConfig[d(466)]);RSEngine[d(418)][d(287)]("Web.signin",e,c)},webSignUp:function(a,b,c,d){var e=a0_0x3ce7,f=[];f[0]=a;f[1]=b;GameConfig.SSO_ENABLED?(a=RSLoginManager[e(362)]()[e(311)](GameConfig[e(379)]+e(406)),f[2]=d?d:"",f[3]=a?a:"",f[4]="",f[5]=RSEngine.platform==PLATFORM[e(347)]? e(431):e(442),f[6]=GameConfig[e(466)]):(f[2]=RSEngine[e(285)]==PLATFORM.MOBILE?e(431):e(442),f[3]=GameConfig[e(466)]);RSEngine.networkManager.sendJSONRPCRequestSync(e(505),f,c)},updateReward:function(a,b,c){var d=a0_0x3ce7,e=[];e[0]=RSEngine[d(373)][d(467)]()[d(345)]();e[1]=RSEngine.platform==PLATFORM[d(347)]?"mobile":"html5";e[2]=GameConfig[d(466)];e[3]=a;RSEngine[d(418)][d(357)]("RewardsManager.updateReward",e,b,c)},loginWithCookie:function(a,b,c,d){var e=a0_0x3ce7,f=[];f[0]=a;f[1]=b;f[2]=c;f[3]= RSEngine[e(285)]==PLATFORM[e(347)]?e(431):"html5";f[4]=GameConfig[e(466)];RSEngine.networkManager[e(287)](e(310),f,d)},loginFacebook:function(a){var b=a0_0x3ce7,c=[];c[0]=RSEngine[b(285)]==PLATFORM[b(347)]?b(431):"html5";c[1]=GameConfig[b(466)];RSEngine[b(418)][b(287)](b(471),c,a)},logout:function(a){var b=a0_0x3ce7,c=[];c[0]=RSEngine[b(285)]==PLATFORM[b(347)]?b(431):b(442);c[1]=GameConfig[b(466)];RSEngine[b(418)][b(287)]("Web.logout",c,a)},forgotPassword:function(a,b){var c=a0_0x3ce7,d=[];d[0]=a; d[1]=RSEngine[c(285)]==PLATFORM[c(347)]?"mobile":c(442);d[2]=GameConfig.VERSION;RSEngine.networkManager.sendJSONRPCRequestSync("Web.forgotPassword",d,b)},getCurrentCoinBalance:function(a){var b=a0_0x3ce7;this[b(441)]=a;a=[];a[0]=RSGame[b(362)]().getUserDataManager()[b(467)]()[b(345)]();a[1]=RSEngine.platform==PLATFORM.MOBILE?b(431):b(442);var c=this;RSEngine[b(418)][b(357)]("User.getCoinBalance",a,function(a){RSGame[b(362)]()[b(294)]()[b(467)]().syncBlobVars(a[b(416)][b(348)]);c._currentCoinBalanceCallBack.call(this, "success",a)},function(){cc[b(455)](b(307));c._currentCoinBalanceCallBack[b(331)](this,b(349))})},getCurrentBlackjackMachineTutorialStatus:function(a){var b=a0_0x3ce7,c=RSGame[b(362)]()[b(294)]()[b(467)]().getBlackjackTutorialShownStatus();return 0==c[b(479)]?!1:-1!=c[b(338)](a)?!0:!1},getApiToken:function(a,b){var c=a0_0x3ce7;RSEngine[c(418)][c(357)](c(456),[RSGame[c(362)]().getUserDataManager()[c(467)]()[c(345)]()],a,b)},sinkPowerups:function(){},saveBingoRewards:function(){},getUserIdForBingo:function(){var a= a0_0x3ce7;return RSEngine.loginMode!=LOGIN_MODE[a(319)]?RSEngine[a(373)][a(467)]()[a(325)]():RSEngine[a(373)][a(467)]().getId()},saveSpinWheelRewards:function(a,b,c,d){},setLoyaltyRewardPoints:function(a){var b=a0_0x3ce7,c=[];c[0]=RSGame[b(362)]().getUserDataManager().getMe().getId();c[1]=RSEngine[b(285)]==PLATFORM[b(347)]?b(431):b(442);c[2]=GameConfig[b(466)];RSEngine.networkManager[b(287)](b(264),c,a)},getLoyaltyRewardPoints:function(a){var b=a0_0x3ce7,c=[];c[0]=RSGame[b(362)]()[b(294)]()[b(467)]()[b(345)](); RSEngine[b(418)][b(287)]("Vip.getRewardPoints",c,a)},loadLoyaltyMallStoreLayer:function(a){var b=a0_0x3ce7,c=document[b(422)](b(377));c.id="loyaltyMallDiv";c[b(399)]="\x3ciframe id\x3d'loyaltyMall' height\x3d'100%' frameborder\x3d'0' width\x3d'100%' marginheight\x3d'0' marginwidth\x3d'0' src\x3d'"+a+b(425)+b(333);document[b(351)]("Cocos2dGameContainer").appendChild(c)},onCloseLoyaltyMallStore:function(){var a=a0_0x3ce7,b=$(a(372));null!=b&&b[a(326)]()},updateWelcomeBonus:function(a){var b=a0_0x3ce7, c=[];c[0]=JSON[b(410)](a);var c=RSUtils[b(279)](c),d=[];d[0]=RSEngine.dataManager[b(467)]()[b(345)]();d[1]=JSON[b(410)](a);d[2]=c;d[3]=RSEngine[b(285)]==PLATFORM[b(347)]?b(431):b(442);RSEngine[b(418)].sendJSONRPCRequest("User.collectWelcomeBonus",d,this[b(320)][b(435)](this),this.onWelcomeBonusUpdateFailed[b(435)](this))},onWelcomeBonusUpdated:function(a){var b=a0_0x3ce7,c=0;if(200==a.result[b(348)][b(306)]){if(void 0!=a[b(416)][b(348)].data[b(329)]){RSGame[b(362)]()[b(294)]().getMe()[b(267)](a[b(416)][b(348)][b(348)].powerUps); for(var d=1;8>=d;d++)c+=a.result[b(348)].data[b(329)][b(318)+String(d)]}RSGame.getInstance()[b(294)]()[b(467)]()[b(493)](!0);GameConfig[b(476)]&&(RSAnalyticsManager.getInstance().trackPrimarySource(RSAnalyticsSource[b(397)],b(381),a[b(416)].data.data[b(449)],b(504)),RSAnalyticsManager.getInstance()[b(380)](c,b(381),b(504)))}},onWelcomeBonusUpdateFailed:function(a){a=a0_0x3ce7;for(var b=RSGame.getInstance()[a(437)]()[a(366)](),c={},d=0;dthis.coinUpdateCallCount?setTimeout(this.getCoinBalance.bind(this),5E3):(this.coinUpdateCallCount=0,this.callBackAfterBlobVarsUpdate(!0,a))},_onRetrieveCoinBalanceFailed:function(){3>this.coinUpdateCallCount?setTimeout(this.getCoinBalance.bind(this),5E3):(this.coinUpdateCallCount=0,this.callBackAfterBlobVarsUpdate(!1))},getMonetizationBalance:function(a){a&&(this.callBackAfterMonetBlobVarsUpdate= a);this.monetUpdateCallCount++;a=[];a[0]=RSEngine.dataManager.getMe().getId();a[1]=RSEngine.platform==PLATFORM.MOBILE?"mobile":"html5";RSEngine.networkManager.sendJSONRPCRequest("User.getCoinBalance",a,this._onRetrieveMonetizationBalanceSuccess.bind(this),this._onRetrieveMonetBalanceFailed.bind(this))},_onRetrieveMonetizationBalanceSuccess:function(a){RSEngine.dataManager.getMe().getMonetizationCount()!=parseInt(a.result.data.monetization_count)&&0==RSEngine.dataManager.getMe().getCoinOffset()?(1== parseInt(a.result.data.monetization_count)&&GameConfig.IS_ADJUST_ENABLED&&RSAdjustManager.getInstance().trackEvent(RSAdjustEventToken.FirstPurchase),this.monetUpdateCallCount=0,RSEngine.dataManager.getMe().syncBlobVars(a.result.data),this.callBackAfterMonetBlobVarsUpdate("success",a.result.data)):3>this.monetUpdateCallCount?setTimeout(this.getMonetizationBalance.bind(this),8E3):(this.monetUpdateCallCount=0,this.callBackAfterMonetBlobVarsUpdate(!1))},_onRetrieveMonetBalanceFailed:function(){3>this.monetUpdateCallCount? setTimeout(this.getMonetizationBalance.bind(this),8E3):(this.monetUpdateCallCount=0,this.callBackAfterMonetBlobVarsUpdate(!1))},trackUrlReward:function(a,b,c){var d=[];d[0]=RSEngine.dataManager.getMe().getId();d[1]=RSEngine.platform==PLATFORM.MOBILE?"mobile":"html5";d[2]=a;RSEngine.networkManager.sendJSONRPCRequest("TimeEventData.updateURIReward",d,b,c)},getLinkReward:function(a,b,c){var d=[];d[0]=RSEngine.dataManager.getMe().getId();d[1]=RSEngine.platform==PLATFORM.MOBILE?"mobile":"html5";d[2]=a; RSEngine.networkManager.sendJSONRPCRequest("TimeEventData.getLinkReward",d,b,c)},purchasePowerUp:function(a,b,c,d,e){this.onPowerupPurchaseCallback=d;this.currentPurchaseType=c;b=[];b[0]=RSEngine.dataManager.getMe().getId();b[1]=a;b[2]=RSEngine.platform==PLATFORM.MOBILE?"mobile":"html5";b[3]=GameConfig.VERSION;RSEngine.networkManager.sendJSONRPCRequest("InGamePurchase.updatePowerUpsV1",b,this.onCallBackForUpdatePowerUps.bind(this),e)},onCallBackForUpdatePowerUps:function(a){if("success"==a.result.status)if(void 0!= a.result.powerUps&&(RSEngine.dataManager.getMe().setPowerUps(a.result.powerUps),RSEngine.externalGameManager.setBingoData()),RSEngine.dataManager.getMe().getMonetizationCount()==parseInt(a.result.monetization_count)&&"powerup_coins"!=this.currentPurchaseType||0!=RSEngine.dataManager.getMe().getCoinOffset())this.getMonetizationBalance(this.onPowerupPurchaseCallback.bind(this));else{if(RSEngine.dataManager.getMe().syncBlobVars(a.result),null!=this.onPowerupPurchaseCallback)this.onPowerupPurchaseCallback("success", a)}else if(null!=this.onPowerupPurchaseCallback)this.onPowerupPurchaseCallback("failure",a)},onUpdateSyncBonusCallback:function(a){null!=this.syncBonusUpdateCallback&&this.syncBonusUpdateCallback(a)},onUpdateDailyBonusCallback:function(a){200==a.result.data.status&&(this._me.setDailyBonusPickedTime(a.result.data.collectedTime),GlobalVars.dailyScratcherBonusInterval=Number(a.result.data.interval));null!=this.dailyBonusUpdateCallback&&this.dailyBonusUpdateCallback(a)},onUpdateHourlyBonusCallback:function(a){200== a.result.data.status&&(this._me.setHourlyBonusPickedTime(a.result.data.collectedTime),GlobalVars.hourlyBonusInterval=parseInt(a.result.data.interval));null!=this.hourlyBonusUpdateCallback&&this.hourlyBonusUpdateCallback(a)},saveStatsInfo:function(a,b){},_onRewardSaveSuccess:function(a){this._retryCount=0;RSCasinoManager.getCasinoInterface().postMessageToBingo("round_over_result_updated","round_over_result_updated");this.callBackAfterSaveRewards&&this.callBackAfterSaveRewards(a)},_onRewardSaveFailed:function(a, b,c,d,e,f,g,h,k,m,n,p){3>=this._retryCount?this.saveBingoRewards(a,b,c,d,e,f,g,h,k,m,n):(this.callBackAfterSaveRewards&&this.callBackAfterSaveRewards(p),this._retryCount=0)},redeemItem:function(a,b,c,d,e){var f=[];f[0]=RSEngine.dataManager.getMe().getId();f[1]=JSON.stringify(a)+"|"+b+"|"+c;f[2]=RSEngine.loginMode==LOGIN_MODE.FACEBOOK?"canvas":"web";RSEngine.networkManager.sendJSONRPCRequest("Loyaltymall.createOrder",f,d,e)},getLoyaltyMallPoints:function(a){var b=[];b[0]=RSGame.getInstance().getUserDataManager().getMe().getId(); RSEngine.networkManager.sendJSONRPCRequestSync("User.getRewardPoints",b,a)},validatePlayerConnectUser:function(a,b,c,d,e){if(RSEngine.loginMode!=LOGIN_MODE.GUEST&&null!=a&&null!=b){var f=TimeManager.getInstance().getCurrentServerTime();a={parameter1:a,parameter2:b,parameter3:c,advId:f,vendorId:f};b=[];b[0]=this._me.getId();b[1]="canvas";b[2]=GameConfig.VERSION?GameConfig.VERSION:"1.0";b[3]=a;RSEngine.networkManager.sendJSONRPCRequest("PlayerConnect.validateUser",b,d,e)}},playerConnectContactUs:function(a, b,c){var d=[];this._me&&(d[0]=this._me.getId());d[1]=RSEngine.platform==PLATFORM.MOBILE?"mobile":"html5";d[2]=GameConfig.VERSION?GameConfig.VERSION:"1.0";d[3]=a;RSEngine.networkManager.sendJSONRPCRequest("PlayerConnect.contactUs",d,b,c)},setCCPA:function(a,b,c,d){var e=[];e[0]=a;e[1]=RSEngine.platform==PLATFORM.MOBILE?"mobile":"html5";e[2]=GameConfig.VERSION?GameConfig.VERSION:"1.0";e[3]=b;RSEngine.networkManager.sendJSONRPCRequest("Privacy.setCCPA",e,c,d)},checkNameIsValideOrNot:function(a,b,c){var d= [];this._me&&(d[0]=this._me.getId());d[1]=RSEngine.platform==PLATFORM.MOBILE?"mobile":"html5";d[2]=a;var e=RSUtils.getHashValue(d);d[2]=GameConfig.VERSION?GameConfig.VERSION:"1.0";d[3]=a;d[4]=e;RSEngine.networkManager.sendJSONRPCRequest("User.badWordFilter",d,b,c)},GiftCardLinkCreation:function(a,b,c,d,e){var f=[];this._me&&(f[0]=this._me.getId());f[1]=RSEngine.loginMode==LOGIN_MODE.FACEBOOK?"canvas":"web";f[2]=GameConfig.VERSION?GameConfig.VERSION:"1.0";f[3]=b;f[4]=c;f[5]=a;a=RSUtils.getHashValue(f); f[6]=a;RSEngine.networkManager.sendJSONRPCRequest("Gcow.redeemLinkCreation",f,d,e)}});function a0_0x2fc5(a,b){var c=a0_0x370e();return a0_0x2fc5=function(a,b){return c[a-355]},a0_0x2fc5(a,b)}(function(a,b){for(var c=a0_0x2fc5,d=a();;)try{if(-parseInt(c(392))/1*(parseInt(c(374))/2)+parseInt(c(494))/3*(-parseInt(c(515))/4)+-parseInt(c(514))/5+parseInt(c(441))/6+parseInt(c(433))/7*(parseInt(c(376))/8)+parseInt(c(384))/9*(-parseInt(c(429))/10)+parseInt(c(475))/11===b)break;else d.push(d.shift())}catch(e){d.push(d.shift())}})(a0_0x370e,478907); var RSGameData=RSClass.extend({_gameData:null,_id:null,_platform:null,_version:null,_vipBenefits:[],_powerUps:null,init:function(a,b,c){var d=a0_0x2fc5;a&&this[d(477)][d(395)](this,arguments)},initialize:function(a,b,c){this._id=a;this._platform=b;this._version=c},updateUserIDForSSO:function(a){var b=a0_0x2fc5;cc[b(368)](b(482)+a);this[b(489)]=a},readGameData:function(a,b){var c=a0_0x2fc5,d=[];d[0]=this[c(489)];d[1]=this[c(493)];d[2]=this._version;var e=this;RSEngine[c(365)][c(417)](c(363),d,function(b){e[c(449)](b); a()},function(){e.onGameDataLoadFailed(d);b()})},onGameDataLoaded:function(a){var b=a0_0x2fc5;this[b(471)]=a[b(366)][b(394)]},onGameDataLoadFailed:function(){},readBingoMachineConfig:function(a,b){var c=a0_0x2fc5,d=[];d[0]=c(399);d[1]=c(375);d[2]=this._version;d[3]=this[c(489)];RSEngine[c(365)][c(417)](c(508),d,function(b){a(b.result[c(355)])},function(){b()})},readLTEMGameDataEvents:function(a,b,c){var d=a0_0x2fc5,e=[];null!=c&&void 0!=c&&""!=c||(c="gamedata");e[0]=c;e[1]=this[d(489)];e[2]=d(375); e[3]=this[d(479)];var f=this;RSEngine[d(365)][d(417)](d(486),e,function(b){f[d(464)](b,c);a(b)},function(){f[d(478)]();b()})},gameDataskipDailyChallengeEvents:function(a,b,c,d){var e=a0_0x2fc5,f=[];f[0]=this[e(489)];f[1]="html5";f[2]=this[e(479)];f[3]=d;f[4]=c;var g=this;RSEngine[e(365)][e(417)](e(407),f,function(b){g[e(498)](b);a(b)},function(){g.onEventDataLoadFailed();b()})},onEventDataSuccess:function(a){var b=a0_0x2fc5;if(0!=a.result.status)for(var c in a.result.data)this[b(471)][c]=a[b(366)][b(483)][c]}, onEventDataLoaded:function(a,b){var c=a0_0x2fc5;if(0!=a.result[c(396)])for(var d=0;d=k&&(f=parseInt(d[h][a]),g!=f&&(g=f,e.push(parseInt(d[h][a]))))}return e},getSlotBetStructureByName:function(a){for(var b=a0_0x2fc5,c=this[b(444)](),d=[],e=0;eb);f++)e=parseInt(d[f][a]);return e},getSlotDefaultBet:function(a,b){var c=a0_0x2fc5,d=RSGame[c(506)]().getUserDataManager()[c(389)]()[c(500)](),e=RSGame[c(506)]()[c(484)]()[c(428)](),f=RSGame.getInstance()[c(473)]()[c(444)](),g=-1,h,k,m,n,p=0,r;for(r in f)if(k=parseInt(f[r][c(434)]),m=parseInt(f[r][b]),h=Math[c(414)](parseFloat(f[r].defaultBetPercent)*d),n=m*a,h>=n&&e>=k)if(p!=m)g++,p=m;else return g; return 0>g&&(g=0),g},getMaxBetValueForBlackjack:function(a,b){for(var c=a0_0x2fc5,d=RSEngine[c(472)][c(453)](a),e=0,f=0;f=parseInt(d[f].levels))e=parseInt(d[f][c(425)]);else break;return e},getMaximumBetByGameTypeAndName:function(a,b,c){var d=a0_0x2fc5,e=0;switch(a){case RSGameTypes[d(445)]:e=b[d(378)]*b[d(431)];break;case RSGameTypes[d(504)]:a=this[d(453)]("bingoMachinesDetails");for(var f in a)a[f][d(485)]===b[d(485)]&&(e=a[f][d(358)]);break;case RSGameTypes.Blackjack:e=RSGame[d(506)]()[d(473)]().getMaxBetValueForBlackjack(c.betStructure, RSGame[d(506)]()[d(484)]()[d(428)]());break;case RSGameTypes[d(463)]:e=b[d(431)];break;case RSGameTypes[d(388)]:RSUtils[d(361)](b[d(360)],"RSP_")?e=b._maxBetAmount:RSUtils[d(361)](b[d(360)],"MSP_")?e=4*b._maxBetAmount:RSUtils.isStringContains(b[d(360)],"MSP_")?e=25*b._maxBetAmount:RSUtils.isStringContains(b[d(360)],"PKR_")&&(e=b[d(431)])}return parseInt(e)},getMinimumBetByGameTypeAndName:function(a,b){var c=a0_0x2fc5;switch(a){case RSGameTypes[c(445)]:return this.getSlotBetStructureByName(b[c(485)])[0]* b.payLines;case RSGameTypes[c(504)]:return this[c(497)]();case RSGameTypes[c(509)]:return this[c(439)](b.machine_identifier);case RSGameTypes[c(463)]:return this.getSheetData(c(512))[0][b[c(485)]];case RSGameTypes[c(388)]:return this[c(400)](b[c(462)],b[c(421)],b[c(485)]);case RSGameTypes[c(422)]:return RSGame[c(506)]()[c(473)]()[c(490)](c(415),b.machine_identifier);case RSGameTypes[c(503)]:return RSGame[c(506)]()[c(473)]()[c(403)](b.machine_identifier,RSGame.getInstance().getLevelManager()[c(428)]())}}, getBingoMinimumBetRoomValue:function(){var a=a0_0x2fc5;if(RSEngine[a(472)][a(413)]()[a(458)])return RSEngine[a(472)][a(413)]()[a(458)]},getBlackJackBetStructureByName:function(a){var b=a0_0x2fc5;switch(a){case b(438):case b(466):return this[b(453)](b(359))}return this[b(453)](b(362))},getMinBetValueForBlackJack:function(a){return this.getBlackJackBetStructureByName(a)[0].defaultBet},getMinChipValueForBlackJack:function(a){var b=a0_0x2fc5;return this.getBlackJackBetStructureByName(a)[0][b(495)]},getChipSetArrayForBlackjack:function(a){var b= a0_0x2fc5;a=this.getBlackJackBetStructureByName(a);var c=[],d;for(d in a)a[d].chips&&c.push(parseInt(a[d][b(495)]));return c},getChipSetArrayForRoulette:function(){var a=a0_0x2fc5,b=this[a(453)](a(420)),c=[],d;for(d in b)b[d][a(495)]&&c[a(386)](parseInt(b[d][a(495)]));return c},getMaxChipUnlocked:function(a){var b=a0_0x2fc5;a=this.getBlackJackBetStructureByName(a);var c=RSGame.getInstance()[b(484)]()[b(428)](),d=0,e;for(e in a)a[e][b(434)]<=c&&(d=a[e][b(476)]);return parseInt(d)},getRouletteMaxChipUnlocked:function(a){a= a0_0x2fc5;var b=this[a(453)]("rouletteBetValues"),c=RSGame[a(506)]()[a(484)]()[a(428)](),d=0,e;for(e in b)b[e][a(434)]<=c&&(d=b[e][a(476)]);return parseInt(d)},getAristocratMachineURL:function(a){for(var b=a0_0x2fc5,c=RSEngine[b(472)][b(453)]("aristocratURLs"),d=c[b(385)]-1;0<=d;d--)for(var e=d;0<=e;e--)if(RSGame[b(506)]()[b(484)]()[b(423)]()[b(391)]>=c[e][b(434)]&&RSCasinoManager.getPrimaryCurrency()>=c[d][b(432)])return c[e][a]},getAristocratMachineMinBetRow:function(a){a=a0_0x2fc5;for(var b=RSEngine[a(472)][a(453)](a(406)), c=b[a(385)]-1;0<=c;c--)for(var d=c;0<=d;d--)if(RSGame[a(506)]()[a(484)]()[a(423)]()[a(391)]>=b[d][a(434)]&&RSCasinoManager.getPrimaryCurrency()>=b[c][a(432)])return d},getSlotMachineTypeByName:function(a){for(var b=a0_0x2fc5,c=RSGame[b(506)]()[b(473)]()[b(510)](RSGameTypes[b(445)]),d=0;d=a[e].level)c=parseInt(a[e][b(456)]);else break;return c},getMinBetValueForPoker:function(a,b,c){var d=a0_0x2fc5;a=RSEngine[d(472)].getSheetData(a);a=parseInt(a[0][d(456)]);if("MSP"==b){if(RSUtils[d(361)](c,d(443)))return 4*a;if(RSUtils[d(361)](c,d(474)))return 12*a}return"MPP"==b?5*a:a},getMaxBetValueForKeno:function(a,b){for(var c=a0_0x2fc5,d=RSEngine[c(472)][c(453)](a),e=parseInt(d[0][b]),c=RSGame[c(506)]().getLevelManager()[c(428)](),f=0;f=d[f].levels)e= parseInt(d[f][b]);else break;return e},getDonPacks:function(){var a=a0_0x2fc5,b=this[a(453)](a(502));RSUtils[a(457)](b,a(357));for(var c=[],d=0;d=h&&e>=a[f].level)c=h;else break}return c},getBetStructure:function(a){var b=a0_0x2fc5,c=[];a=RSGame[b(506)]()[b(473)]().getSheetData(a);for(var d=0;d=d[f][c(434)]&&e.push(parseInt(d[f][a]));return e},getKenoFullBetStructureByName:function(a){var b=a0_0x2fc5,b=this[b(453)](b(512)),c=[],d;for(d in b)c.push(parseInt(b[d][a]));return c},getRouletteBetStructureByName:function(a,b){var c=a0_0x2fc5,d=this.getSheetData(c(420)),e=[],f;for(f in d)b>=d[f][c(434)]&&e[c(386)](parseInt(d[f][c(425)]));return e},getScratcherBetStructureByName:function(a,b){var c=a0_0x2fc5,d=this.getSheetData(c(415)),e=[];if(void 0==b){for(var f= 0;f=d[f][c(434)]&&e.push(parseInt(d[f].betValues));return e},getMachineDetailsByName:function(a,b){for(var c=a0_0x2fc5,d=this[c(510)](a),e=0;e=n&&f>=k)if(p!=m)g++,p=m;else return g;return 0>g&&(g=0),parseInt(g)},getDefaultValues:function(){var a=a0_0x2fc5;return RSEngine.gameData[a(453)](a(499))[0]},getAppsFlyerValues:function(){var a= a0_0x2fc5;return(a=RSEngine.gameData[a(453)](a(448)))?a[0]:null},getPowerupDetails:function(a){for(var b=a0_0x2fc5,c=this.getPowerups(),d,e=0;e>2,g=(g&3)<<4|h>>4,n=(h&15)<<2|k>>6,p=k&63,isNaN(h)?n=p=64:isNaN(k)&&(p=64),c=c+this._keyStr.charAt(m)+this._keyStr.charAt(g)+this._keyStr.charAt(n)+this._keyStr.charAt(p);return c},decode:function(a){var c= "",g,h,k,m,n,p=0;for(a=a.replace(/[^A-Za-z0-9+/=]/g,"");p>4,h=(h&15)<<4|m>>2,k=(m&3)<<6|n,c+=String.fromCharCode(g),64!=m&&(c+=String.fromCharCode(h)),64!=n&&(c+=String.fromCharCode(k));return c=b._utf8_decode(c)},_utf8_encode:function(a){a=a.replace(/rn/g,"n");for(var b="",c=0;cd?b+=String.fromCharCode(d): (127d?b+=String.fromCharCode(d>>6|192):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128)),b+=String.fromCharCode(d&63|128))}return b},_utf8_decode:function(a){for(var b="",c=0,d=c1=c2=0;cd?(b+=String.fromCharCode(d),c++):191d?(c2=a.charCodeAt(c+1),b+=String.fromCharCode((d&31)<<6|c2&63),c+=2):(c2=a.charCodeAt(c+1),c3=a.charCodeAt(c+2),b+=String.fromCharCode((d&15)<<12|(c2&63)<<6|c3&63),c+=3);return b}};return b.encode(a)},_showInviteWindowResponse:function(a, b){cc.log("Response From Invite Window");a?cc.log("FB UI response :"+a+":"+b.error_message):(cc.log("Invitation send successfully !!"),b.to&&RSAnalyticsManager.getInstance().trackFBInvite(b.to.length))},showPurchaseWindow:function(a,b,e){"subscription"==e?RSFBManager.getInstance().canvas.subscribe({product:a},function(a,c){b(a,c)}):RSFBManager.getInstance().canvas.pay({product:a},function(a,c){b(a,c)})}});return{getInstance:function(){a||(a=new b);return a}}}();var RSFBManager=function(){var a,b=RSClass.extend({name:"",version:"",_userInfo:null,_isLoggedIn:!1,HttpMethod:{GET:"get",POST:"post",DELETE:"delete"},CODE_SUCCEED:0,AppEvent:{ACTIVATED_APP:FB.AppEvents.EventNames.ACTIVATED_APP,COMPLETED_REGISTRATION:FB.AppEvents.EventNames.COMPLETED_REGISTRATION,VIEWED_CONTENT:FB.AppEvents.EventNames.VIEWED_CONTENT,SEARCHED:FB.AppEvents.EventNames.SEARCHED,RATED:FB.AppEvents.EventNames.RATED,COMPLETED_TUTORIAL:FB.AppEvents.EventNames.COMPLETED_TUTORIAL,ADDED_TO_CART:FB.AppEvents.EventNames.ADDED_TO_CART, ADDED_TO_WISHLIST:FB.AppEvents.EventNames.ADDED_TO_WISHLIST,INITIATED_CHECKOUT:FB.AppEvents.EventNames.INITIATED_CHECKOUT,ADDED_PAYMENT_INFO:FB.AppEvents.EventNames.ADDED_PAYMENT_INFO,PURCHASED:FB.AppEvents.EventNames.PURCHASED,ACHIEVED_LEVEL:FB.AppEvents.EventNames.ACHIEVED_LEVEL,UNLOCKED_ACHIEVEMENT:FB.AppEvents.EventNames.UNLOCKED_ACHIEVEMENT,SPENT_CREDITS:FB.AppEvents.EventNames.SPENT_CREDITS},AppEventParam:{CURRENCY:FB.AppEvents.ParameterNames.CURRENCY,REGISTRATION_METHOD:FB.AppEvents.ParameterNames.REGISTRATION_METHOD, CONTENT_TYPE:FB.AppEvents.ParameterNames.CONTENT_TYPE,CONTENT_ID:FB.AppEvents.ParameterNames.CONTENT_ID,SEARCH_STRING:FB.AppEvents.ParameterNames.SEARCH_STRING,SUCCESS:FB.AppEvents.ParameterNames.SUCCESS,MAX_RATING_VALUE:FB.AppEvents.ParameterNames.MAX_RATING_VALUE,PAYMENT_INFO_AVAILABLE:FB.AppEvents.ParameterNames.PAYMENT_INFO_AVAILABLE,NUM_ITEMS:FB.AppEvents.ParameterNames.NUM_ITEMS,LEVEL:FB.AppEvents.ParameterNames.LEVEL,DESCRIPTION:FB.AppEvents.ParameterNames.DESCRIPTION},AppEventParamValue:{VALUE_YES:"1", VALUE_NO:"0"},checkFBConnected:function(a){this._loginResponseStatus=!1;var b=this;this._loginCallback=a;try{this._fbLoginHackTimer=setTimeout(function(){b._isLoggedIn=!1;b._userInfo={};b._loginCallback("notconnected");console.log("inside fbLoginHackTimer")},15E3),FB.getLoginStatus(function(a){b._loginResponseStatus=!0;a&&"connected"===a.status?(b._isLoggedIn=!0,b._userInfo=a.authResponse,b._loginCallback("connected")):(b._isLoggedIn=!1,b._userInfo={},b._loginCallback("notconnected"));clearTimeout(b._fbLoginHackTimer)})}catch(e){b._isLoggedIn= !1,b._userInfo={},a("notconnected")}},_checkLoginStatus:function(){},initialize:function(a){this.name="facebook";this.version="v4.0";this._userInfo={};this._isLoggedIn=!1;FB&&(cc.log("Config :"+JSON.stringify(a)),FB.init(a),this._checkLoginStatus())},login:function(a,b){var e=this;"function"==typeof a&&(b=a,a=[]);a.every(function(a){if("public_profile"!=a)return!0})&&a.push("public_profile");var f=a.join(",");FB.login(function(a){if(a.authResponse){e._isLoggedIn=!0;e._userInfo=a.authResponse;var c= [];a.authResponse.grantedScopes&&(c=a.authResponse.grantedScopes.split(","));"function"===typeof b&&b(0,{accessToken:a.authResponse.accessToken,permissions:c})}else e._isLoggedIn=!1,e._userInfo={},"function"===typeof b&&b(a.error_code||1,{error_message:a.error_message||"Unknown error"})},{scope:f,return_scopes:!0,auth_type:"rerequest"})},isLoggedIn:function(){return this._isLoggedIn},logout:function(a){var b=this;FB.logout(function(e){e.authResponse?(b._isLoggedIn=!1,b._userInfo={},"function"===typeof a&& a(0,{isLoggedIn:!1})):"function"===typeof a&&a(e.error_code||1,{error_message:e.error_message||"Unknown error"})})},_requestPermissions:function(a,b){var e=a.join(","),f=this;FB.login(function(a){if(a.authResponse){var c=a.authResponse.grantedScopes.split(",");f._isLoggedIn=!0;f._userInfo=a.authResponse;"function"===typeof b&&b(0,{permissions:c})}else f._isLoggedIn=!1,f._userInfo={},"function"===typeof b&&b(a.error_code||1,{error_message:a.error_message||"Unknown error"})},{scope:e,return_scopes:!0})}, getAccessToken:function(){return this._userInfo?this._userInfo.accessToken:null},getUserID:function(){return this._userInfo?this._userInfo.userID:null},_share:function(a,b){FB.ui({method:"share",name:a.title,caption:a.caption,description:a.text,href:a.link,picture:a.imageUrl},function(a){a?a.post_id?"function"===typeof b&&b(0,{didComplete:!0,post_id:a.post_id}):"function"===typeof b&&b(a.error_code||1,{error_message:a.error_message||"Unknown error"}):"function"===typeof b&&b(1,{error_message:"Unknown error"})})}, ui:function(a,b,e,f){FB.ui({method:a,href:b,display:f?"popup":"dialog",size:{width:680,height:500}},function(a){var b=!0;a&&a.error_message&&(b=!1);null!=e&&e(b)})},dialog:function(a,b){if(a)if(this.canPresentDialog(a)){a.name=a.name||a.site;delete a.site;a.href=a.href||a.link||a.siteUrl;delete a.siteUrl;delete a.link;a.picture=a.picture||a.image||a.photo||a.imageUrl||a.imagePath;delete a.imageUrl;delete a.imagePath;delete a.photo;delete a.image;a.caption=a.title||a.caption;delete a.title;a.description= a.text||a.description;delete a.text;var e=a.dialog;delete a.dialog;if("shareLink"===e||"feedDialog"==e)a.method="share";else if("messageLink"==e)a.method="send",a.link=a.href;else if("shareOpenGraph"==e&&(a.method="share_open_graph",a.url)){e={};a.preview_property_name?e[a.preview_property_name]=a.url:e.object=a.url;for(var f in a)"method"!=f&&"action_type"!=f&&"action_properties"!=f&&(a[f]&&(e[f]=a[f]),delete a[f]);a.action_properties=JSON.stringify(e)}FB.ui(a,function(a){a&&"function"===typeof b? a.post_id||a.success?b(0,{didComplete:!0,post_id:a.post_id||""}):a.error_code?b(a.error_code,{error_message:a.error_message||"Unknown error"}):b(0,a):void 0==a&&"function"===typeof b&&b(1,{error_message:"Unknown error"})})}else"function"===typeof b&&b(1,{error_message:"The requested dialog: "+a.dialog+" can not be presented on Web"});else"function"===typeof b&&b(1,{error_message:"No info parameter provided"})},canPresentDialog:function(a){return a&&a.dialog&&("shareLink"===a.dialog||"feedDialog"=== a.dialog||"shareOpenGraph"===a.dialog||"messageLink"===a.dialog)?!0:!1},api:function(a,b,e,f){"function"===typeof e&&(f=e,e={});FB.api(a,b,e,function(a){a.error?"function"===typeof f&&f(a.error.code,{error_message:a.error.message||"Unknown error"}):"function"===typeof f&&f(0,a)})},getPermissionList:function(a){FB.api("/me/permissions",function(b){if(b.data){for(var e=[],f=0;fe)this.onVIPTierUpgrade()},checkForVIPTierUpgrade:function(){this._vipUserStatus._upgradableTier&&this._vipUserStatus._vipPoints._statusPoints>= this._vipUserStatus._upgradePoint&&(this._vipUserStatus._currentTier+=1,this.setCurrentTierDetails(),this.checkForVIPTierUpgrade())},setCurrentTierDetails:function(){var a=this._vipTierInfo[this._vipUserStatus._currentTier];this._vipUserStatus._pointsRequired=a.pointsRequired;this._vipUserStatus._upgradePoint=a.upgradePoint;this._vipUserStatus._upgradableTier=a.upgradableTier},onVIPTierUpgrade:function(){var a=this.getVIPUserTier();RSEventManager.getInstance().dispatchEvent(RSVIPTierUpEvent,a);RSPlatformSDKManager.getInstance().updateVipTierUp(a); RSAnalyticsManager.getInstance().trackVIPTierUp(a)},getBonusDataForPurchase:function(a,b,e,f,g){var h=this.getPointsForPack(a,e),k=this._vipTierInfo[this._vipUserStatus._currentTier];e=h._statusPoints+k.additionalStatusPointsOnPurchase*h._statusPoints;h=h._rewardPoints+k.additionalRewardPointsOnPurchase*h._rewardPoints;k=k.additionalCoinsOnPurchase;void 0!=f&&(k+=f);f=Math.round(k*b);b=parseInt(b)+f;g&&this.updateVIPUserStatus(e,h);this.getVIPUserDataFromServer(a);a=new RSVIPBonusData;a._valueAwarded= b;a._statusPointsAwarded=e;a._rewardPointsAwarded=h;a._bonusFactor=k;a._bonusValue=f;return a},getPointsForPack:function(a,b){var e=this._vipPurchaseBenefits[a],f=new RSVIPPoints;b?(f._statusPoints=e.firstPurchaseStatusPoints,f._rewardPoints=e.firstPurchaseRewardPoints):(f._statusPoints=e.recurringPurchaseStatusPoints,f._rewardPoints=e.recurringPurchaseRewardPoints);return f},getBonusDataForLevelUp:function(a,b,e){if(null==e||void 0==e)e=1;var f=this._vipTierInfo[this._vipUserStatus._currentTier], g=f.statusPointsForLevelUp*e,h=f.rewardPointsForLevelUp*e,f=f.additionalBonusForLevelUp,k=Math.round(f*b);b+=k;this.updateVIPUserStatus(g,h);this.getVIPLevelUpStatusFromServer(a,e);a=new RSVIPBonusData;a._valueAwarded=b;a._statusPointsAwarded=g;a._rewardPointsAwarded=h;a._bonusFactor=f;a._bonusValue=k;return a},getBonusDataForEvent:function(a,b,e){var f=this._vipTierInfo[this._vipUserStatus._currentTier][a],g=f.statusPointsForEvent*e,h=f.rewardPointsForEvent*e,f=f.additionalBonusForEvent,k=Math.round(f* b);b+=k;this.updateVIPUserStatus(g,h);this.getVIPEventStatusFromServer(a,e);a=new RSVIPBonusData;a._valueAwarded=b;a._statusPointsAwarded=g;a._rewardPointsAwarded=h;a._bonusFactor=f;a._bonusValue=k;return a},getVIPUserDataFromServer:function(a){var b=this,e=[];e[0]=RSEngine.dataManager.getMe().getId();e[1]=a;RSEngine.loginMode==LOGIN_MODE.GUEST?this.getVIPStatusSuccess({result:{data:{tier:0,statusPoints:0,rewardPoints:0}}}):RSEngine.networkManager.sendJSONRPCRequest("Vip.getVipData",e,function(a){b.getVIPStatusSuccess(a)}, function(){b.getVIPStatusFailed(a)})},getVIPLevelUpStatusFromServer:function(a,b){var e=this,f=[];f.level=a;f.levelJump=b;f.event="vip_levelup";this._currentLevel=a;this._levelJump=b;if(RSEngine.loginMode==LOGIN_MODE.GUEST)this.getVIPStatusSuccess({result:{data:{tier:0,statusPoints:0,rewardPoints:0,event:f.event}}});else{var g=this.getVIPEncodedData(f);f.length=0;f=null;RSEngine.networkManager.sendJSONRPCRequest("Vip.setVIPLevelUpStatusPoints",g,function(a){e.getVIPStatusSuccess(a)},function(){e.setVIPStatusFailed()})}}, getVIPEncodedData:function(a){var b=[],e=[],f=RSEngine.dataManager.getMe().getId(),g=TimeManager.getInstance().getCurrentServerTime();a=JSON.stringify(DynamoDBParser.encode(a));e[0]=a;e[1]=g;b[0]=f;b[1]=a+"|"+g+"|"+RSUtils.getHashValue(e);b[2]=GameConfig.PLATFORM;return b},getVIPEventStatusFromServer:function(a,b){var e=this,f=[];f.event=a;f.count=b;if(RSEngine.loginMode==LOGIN_MODE.GUEST)this.getVIPStatusSuccess({result:{data:{tier:0,statusPoints:0,rewardPoints:0,event:f.event}}});else{var g=this.getVIPEncodedData(f); f.length=0;f=null;RSEngine.networkManager.sendJSONRPCRequest("Vip.setVIPCustomStatusPoints",g,function(a){e.getVIPStatusSuccess(a)},function(){e.setVIPStatusFailed(a)})}},getVIPStatusSuccess:function(a){this._retryCount=0;a=a.result.data;if(null!=a){var b=parseInt(a.tier),e=parseInt(a.statusPoints),f=parseInt(a.rewardPoints);null!=e&&(this._vipUserStatus._vipPoints._statusPoints=e);null==f||isNaN(f)||(this._vipUserStatus._vipPoints._rewardPoints=f);null!=b&&(void 0==this._vipUserStatus._currentTier? this._vipUserStatus._currentTier=b:b>this._vipUserStatus._currentTier&&(this._vipUserStatus._currentTier=b,this.onVIPTierUpgrade()),this.setCurrentTierDetails());var g=a.event,h=this;this._dispatchTimer=setInterval(function(){RSEventManager.getInstance().dispatchEvent(RSVIPSyncEvent,g);clearInterval(h._dispatchTimer)},100);"vip_initialize"==g&&RSEngine.loginMode!=LOGIN_MODE.GUEST&&RSGame.getInstance().getUserDataManager().getMe().getFirstSignIn()&&RSGame.getInstance().getGameManager().getVipStatusPointUpdateEnabledStatus()&& this.getVIPEventStatusFromServer("fbLogin",1)}},getVIPStatusFailed:function(a){RSErrorTracker.getInstance().trackErrorMessage("VIP_RESPONSE","VIP response failed from server.","mahesh.jose@rubyseven.net,lijith.puthiyoottil@rubyseven.net");this.getVIPUserDataFromServer(a)},setVIPStatusFailed:function(a){3>this._retryCount?(this._retryCount++,a?this.getVIPEventStatusFromServer(a,1):this.getVIPLevelUpStatusFromServer(this._currentLevel,this._levelJump)):(this._retryCount=0,RSErrorTracker.getInstance().trackErrorMessage("VIP_RESPONSE", "VIP response failed from server.","mahesh.jose@rubyseven.net,lijith.puthiyoottil@rubyseven.net"))}});return{getInstance:function(){a||(a=new b);return a}}}();var RS_CONNECTION_LOST_EVENT="RS_CONNECTION_LOST_EVENT",RS_CONNECTION_RETRY="RS_CONNECTION_RETRY",RSExternalGameParams=function(){this._gameName=this._gameType="";this._betStructure=null;this._betIndex=0;this._soundFlag=null;this._gameURL=this._analyticsID=""},RSExternalGameManager=RSClass.extend({_machineParams:null,_externalGameInterface:null,_spinGameDiv:null,_parentDiv:null,_toasterDiv:null,_iFrameSpin:null,_bingoEntryCoins:0,_casinoResult:null,_currentHandNumber:5,_bingoRewards:null,_dodMachineLoaded:!1, _dodTutorialActive:!1,_contentTimestamp:0,_konami_wager:0,_leaderboardWinAmount:0,_questActionData:null,_risingDigitalFreespinTotal:0,_risingBetAmount:0,_agsOOC:!1,_oddsWorksBetAmount:0,_oddsWorksWinAmount:0,_oddsWorkEventSource:null,_oddsWorkEventOrigin:null,_ainsworthEventSource:null,_ainsworthEventOrigin:null,_ainsworthBetAmount:0,_ainsworthWinAmount:0,_ainsworthOOC:!1,_ainsworthSpinStatus:0,_fincoreBetAmount:0,_fincoreWinAmount:0,_fincoreOOC:!1,_fincoreSpinStatus:0,_bGamingBetAmount:0,_bGamingCurrentBetAmountOnBetChange:0, _bGamingWinAmount:0,_bGamingOOC:!1,_bGamingSpinStatus:0,_yfageoBetAmount:0,_yfageoWinAmount:0,_yfageoOOC:!1,_yfageoSpinStatus:0,_wazdenWinAmount:0,_wazdenBetAmount:0,_highFiveBetAmount:0,_highFiveWinAmount:0,_high5GamesSpinStatus:0,_highFiveOOC:!1,_keno_totalWin:0,_risingDigitalSoundStatus:!1,_isScratcherLoadingInProgress:!1,_rouletteOOCStatus:0,init:function(){this._super.init.call(this);RSEventManager.getInstance().addEventListener(RS_CONNECTION_LOST_EVENT,this,this._onconnectionLost.bind(this)); RSEventManager.getInstance().addEventListener(RS_CONNECTION_RETRY,this,this._onconnectionRetry.bind(this))},getName:function(){return"RSExternalGameManager"},setMachineParams:function(a){this._machineParams=a},getCustomExternalGameInterface:function(){return this._externalGameInterface},setCustomExternalGameInterface:function(a){this._externalGameInterface=a},loadExternalGame:function(a){GlobalVars.lastEventTimeStamp=Date.now();this._machineParams=a;a=document.createElement("div");a.id="SpinGame"; this._machineParams._thirdPartyOwnerType&&RSGame.getInstance().getGameManager().getGameType()==RSGameTypes.Slots&&parseInt(this._machineParams._thirdPartyOwnerType)==CasinoExternalGameType.ROCKET_MAN?a.innerHTML="\x3ciframe id\x3d'spin' allow\x3d'autoplay' scrolling\x3d'yes' height\x3d'100%' frameborder\x3d'0' width\x3d'100%' marginheight\x3d'0' marginwidth\x3d'0' src\x3d'"+this._machineParams._gameURL+"'\x3e\x3c/iframe\x3e":a.innerHTML="\x3ciframe id\x3d'spin' allow\x3d'autoplay' scrolling\x3d'no' height\x3d'100%' frameborder\x3d'0' width\x3d'100%' marginheight\x3d'0' marginwidth\x3d'0' src\x3d'"+ this._machineParams._gameURL+"'\x3e\x3c/iframe\x3e";null==this._parentDiv&&(this._parentDiv=document.getElementById("Cocos2dGameContainer"));this._machineParams._thirdPartyOwnerType&&RSGame.getInstance().getGameManager().getGameType()==RSGameTypes.Slots&&parseInt(this._machineParams._thirdPartyOwnerType)==CasinoExternalGameType.ROCKET_MAN?(this._parentDiv.after(a),resize()):this._parentDiv.appendChild(a);this.loadDivPreloader();a.onload=this.spinGameDivOnload();this._externalGameInterface.notifyLoadStart(); this.resizeSpinGameDiv();"undefined"!==typeof SideMenuController&&SideMenuController.getInstance().handlePositionAndOffset()},loadToasterImage:function(a){if(null==this._toasterDiv){var b=document.createElement("iframe");b.setAttribute("id","ToasterIFrame");b.setAttribute("scrolling","no");b.setAttribute("disabled","true");b.setAttribute("style","position:absolute;left: 140px;top: 35px; border: 0; width: 225px; height: 126px; display: block; z-index: 999;");b.setAttribute("src","/res/WebAssets/Toaster.html?ToasterImage\x3d"+ a);a=document.getElementById("Cocos2dGameContainer");this._machineParams._thirdPartyOwnerType&&RSGame.getInstance().getGameManager().getGameType()==RSGameTypes.Slots&&parseInt(this._machineParams._thirdPartyOwnerType)==CasinoExternalGameType.ROCKET_MAN?a.after(b):a.appendChild(b);this.handleToasterPosition()}},handleToasterPosition:function(){var a=document.getElementById("ToasterIFrame");null!=a&&null==this._toasterDiv&&(this._toasterDiv=a);var b=document.getElementById("Cocos2dGameContainer"),c= b.style.height,d=b.style.width,b=document.getElementById("Cocos2dGameContainer").style.paddingLeft,c=parseInt(c.substring(0,c.length-2))/640;this._toasterData=RSGame.getInstance().getGameManager().getToasterStyleData();a.style.top=this._toasterData.topPosition*c+"px";d=parseInt(d.substring(0,d.length-2))/1136;a.style.left=140*d+"px";a.style.width=225*c+"px";a.style.height=126*c+"px";"RSVP"==GameConfig.GAME_ID&&this._toasterData.LeftPosition&&(a.style.left=this._toasterData.LeftPosition*c+"px");a.style.paddingLeft= b},hideToaster:function(){null==this._toasterDiv&&(this._toasterDiv=document.getElementById("ToasterIFrame"));null!=this._toasterDiv&&this._toasterDiv.parentNode&&this._toasterDiv.parentNode.removeChild(this._toasterDiv);this._toasterDiv=null},loadDivPreloader:function(){null==this._spinGameDiv&&(this._spinGameDiv=document.getElementById("SpinGame"));null!=this._spinGameDiv&&(this._spinGameDiv.style.visibility="hidden")},spinGameDivOnload:function(){null==this._spinGameDiv&&(this._spinGameDiv=document.getElementById("SpinGame")); this._spinGameDiv.style.visibility="visible"},resizeSpinGameDiv:function(){null==this._spinGameDiv&&(this._spinGameDiv=document.getElementById("SpinGame"));null!=this._spinGameDiv&&(RSGame&&RSGame.getInstance().getGameManager()&&RSGame.getInstance().getGameManager().resizeSpinGameDivFromExternalGame(this._machineParams,this._spinGameDiv),this._iFrameSpin=document.getElementById("spin").contentWindow)},reloadExternalGame:function(){if(this._machineParams&&RSGame.getInstance().getGameManager().getGameType()== RSGameTypes.Slots){var a=RSGame.getInstance().getGameManager().getCurrentMachineVO();if(""!=a&&a.gameType!=CasinoExternalGameType.INTERNAL&&GlobalVars.isInsideMachine){var b=document.getElementById("spin"),c=b.src;if(a.gameType==CasinoExternalGameType.RISING_DIGITAL_GAME)var c=decodeURI(c),d=c.lastIndexOf("|"),a=c.substr(0,d+1),d=c.substr(d+11,c.length),e=TimeManager.getInstance().getCurrentServerTime(),c=a+e+d,c=encodeURI(c);b.src="";setTimeout(function(){b.src=c+"\x26r7cache\x3d"+Math.floor(1E4* Math.random())+" "},2E3)}}},reloadTableGame:function(){if(GlobalVars.isInsideMachine){var a=document.getElementById("spin"),b=a.src,b=decodeURI(b),c=b.lastIndexOf("|"),d=b.substr(0,c+1),c=b.substr(c+11,b.length),e=TimeManager.getInstance().getCurrentServerTime(),b=d+e+c,b=encodeURI(b);a.src="";setTimeout(function(){a.src=b+"\x26r7cache\x3d"+Math.floor(1E4*Math.random())+" "},1E3)}},customResizeSpinDiv:function(a,b,c,d){null==this._spinGameDiv&&(this._spinGameDiv=document.getElementById("SpinGame")); null!=this._spinGameDiv&&(this._spinGameDiv.style.marginTop=b+"px",this._spinGameDiv.style.marginLeft=a+"px",this._spinGameDiv.style.width=c+"px",this._spinGameDiv.style.height=d+"px")},updateFromExternalGame:function(a,b){"appsflyer_log_error"==a&&RSErrorTracker.getInstance().trackErrorMessage(a,"Error - "+b,"mahesh.jose@rubyseven.net,lijith.puthiyoottil@rubyseven.net");if(b.hashValue&&this._machineParams){var c=b.timeStamp;if(c>this._contentTimestamp){if(this._contentTimestamp=c,c=b.hashValue,delete b.hashValue, this._getHashValue(b)!=c){RSErrorTracker.getInstance().trackErrorMessage("EVENT HASH FAILED"," For Event "+JSON.stringify(b),"mahesh.jose@rubyseven.net");return}}else{RSErrorTracker.getInstance().trackErrorMessage("EVENT TIMESTAMP MISMATCH"," For Event "+JSON.stringify(b),"mahesh.jose@rubyseven.net");return}}c=Math.floor(b.balance)-RSGame.getInstance().getUserDataManager().getMe().getCoins();if(this._machineParams)if(this._machineParams._gameType==RSGameTypes.Slots||this._machineParams._gameType== RSGameTypes.TableGames)this._machineParams._thirdPartyOwnerType&&this._machineParams._thirdPartyOwnerType==CasinoExternalGameType.EVERI_GAME?void 0!=b.id&&(a=b.id):this._machineParams._thirdPartyOwnerType&&this._machineParams._thirdPartyOwnerType==CasinoExternalGameType.AGS_GAME?void 0!=b&&(a=b.action,b=b.data):this._machineParams._thirdPartyOwnerType&&this._machineParams._thirdPartyOwnerType==CasinoExternalGameType.RISING_DIGITAL_GAME?void 0!=b&&(b.state?a=b.state.name:b.event&&(a=b.event.name), b.state&&(b=b.state)):this._machineParams._thirdPartyOwnerType&&this._machineParams._thirdPartyOwnerType==CasinoExternalGameType.ODDS_WORKS_GAME?b.configData?this._iFrameSpin&&this.isSpinGameActive()&&this._oddsWorkEventSource&&this._oddsWorkEventSource.postMessage(JSON.stringify({msgId:"broadcastToCasino",status:!0}),this._oddsWorkEventOrigin):(a=b.msgId,this._oddsWorkobject=b):this._machineParams._thirdPartyOwnerType&&this._machineParams._thirdPartyOwnerType==CasinoExternalGameType.WAZDEN_RGS_GAME? b.method&&(a=b.method):this._machineParams._thirdPartyOwnerType&&this._machineParams._thirdPartyOwnerType==CasinoExternalGameType.HIGH_FIVE_GAME?b.type&&(a=b.type.enumName):this._machineParams._thirdPartyOwnerType&&this._machineParams._thirdPartyOwnerType==CasinoExternalGameType.AINSWORTH?b.type?a=b.type.enumName:b.name&&"quit"==b.name&&(a=b.name):this._machineParams._thirdPartyOwnerType&&this._machineParams._thirdPartyOwnerType==CasinoExternalGameType.FINCORE&&b&&(a=b.name);else if(this._machineParams._gameType== RSGameTypes.Poker&&this._machineParams._thirdPartyOwnerType==CasinoExternalPokerGameType.DOD){this._handleDODMachineEvents(a,b);return}if(this._machineParams._thirdPartyOwnerType)switch(parseInt(this._machineParams._thirdPartyOwnerType)){case CasinoExternalGameType.EVERI_GAME:this.handleEveriMachineEvents(a,b);break;case CasinoExternalGameType.AGS_GAME:this.handleAGSMachineEvents(a,b);break;case CasinoExternalGameType.RISING_DIGITAL_GAME:this.handleRisingDigitalMachineEvents(a,b);break;case CasinoExternalGameType.ODDS_WORKS_GAME:this.handleOddsworksMachineEvents(a, b);break;case CasinoExternalGameType.WAZDEN_RGS_GAME:this.handleWazdenMachineEvents(a,b);break;case CasinoExternalGameType.HIGH_FIVE_GAME:this.handleHighFiveMachineEvents(a,b);break;case CasinoExternalGameType.AINSWORTH:this.handleAinsworthMachineEvents(a,b);break;case CasinoExternalGameType.FINCORE:this.handleFincoreMachineEvents(a,b);break;case CasinoExternalGameType.BGAMING:this.handleBGamingMachineEvents(a,b);break;case CasinoExternalGameType.YFAGEO:this.handleYfageoMachineEvents(a,b)}if(this._machineParams._gameType== RSGameTypes.Slots&&this._machineParams._thirdPartyOwnerType&&(this._machineParams._thirdPartyOwnerType==CasinoExternalGameType.INTERNAL||this._machineParams._thirdPartyOwnerType==CasinoExternalGameType.SPIN_GAME||this._machineParams._thirdPartyOwnerType==CasinoExternalGameType.SPIN_GAME_V2||this._machineParams._thirdPartyOwnerType==CasinoExternalGameType.ARISTOCRAT||this._machineParams._thirdPartyOwnerType==CasinoExternalGameType.KONAMI_GAME||this._machineParams._thirdPartyOwnerType==CasinoExternalGameType.ROCKET_MAN)|| this._machineParams._gameType!=RSGameTypes.Slots||GlobalVars.isjackpotLoaded||GlobalVars.isTournamentLoaded)switch(a){case "loading_failed":RSCasinoManager.getCasinoInterface().triggerAssetLoadingFailedEvent&&RSCasinoManager.getCasinoInterface().triggerAssetLoadingFailedEvent(b);break;case "loyaltymall_machine_data_request":this._postLoyaltyMallMachineData();break;case "machine_event":c=[];c.push(b.name);for(i in b)-1!=i.indexOf("param")&&(c[i.split("param")[1]]=b[i]);RSCasinoManager.getCasinoInterface().triggerMachineEvent.apply(RSCasinoManager.getCasinoInterface(), c);if(b.name==RSAnalyticsManager.getInstance().getCurrentMachineAnalyticsName()+"_FS_PENDING"){var d=[],e=JSON.stringify(c[1]);d[0]=e;this._pendingSpinsDataKey&&(RSUtils.setLocalStorageItem(this._pendingSpinsDataKey+"_HashValue",RSUtils.getHashValue(d)),RSUtils.setLocalStorageItem(this._pendingSpinsDataKey,e))}"scratcher_game_action"==b.name&&this.triggerScratcherGameActionEvents.apply(this,c);"roulette_game_action"==b.name&&this.triggerRouletteGameActionEvents.apply(this,c);"ACTIVE_POKER_HANDS"== b.name&&"MPP"==b.param1.split("_")[0]&&(this._currentHandNumber=b.param2);if("RS_SLOTS_BONUS_GAME_WIN"==b.name||"RS_KENO_BONUS_GAME_WIN"==b.name)!this._questActionData&&this._casinoResult&&(this._questActionData=this._casinoResult),this._questActionData._totalWinAmount+=b.param1;else if("RS_PREVIOUS_SCRATCHER"==b.name){if(this._isScratcherLoadingInProgress)break;this._isScratcherLoadingInProgress=!0;d=parseInt(b.param1);c=b.param2;d=RSGame.getInstance().getGameData().getNextScratcherMachineToLoad(d, c,"previous");e=RSGame.getInstance().getGameData().getMachineDetails(RSGameTypes.Scratcher,d);setTimeout(function(){RSEngine.externalGameManager.unLoadExternalGame()},400);RSGame.getInstance().getGameManager().setLocationForMachineOpenPopup(null,null);RSGameScreenManager.getInstance().removeAllScreensExceptMainLobby();GlobalVars.isjackpotLoaded=!1;RSGame.getInstance().getGameManager().disableMachineOpenPopup();this.triggerScratcherGameActionEvents("scratcher_game_action","last_card","",d,c,"");RSCasinoManager.getCasinoInterface().loadMachine(RSGameTypes.Scratcher, e.machine_identifier,RSGameScreens.Machine)}else if("RS_NEXT_SCRATCHER"==b.name){if(this._isScratcherLoadingInProgress)break;this._isScratcherLoadingInProgress=!0;d=parseInt(b.param1);c=b.param2;d=RSGame.getInstance().getGameData().getNextScratcherMachineToLoad(d,c,"next");e=RSGame.getInstance().getGameData().getMachineDetails(RSGameTypes.Scratcher,d);setTimeout(function(){RSEngine.externalGameManager.unLoadExternalGame()},400);RSGame.getInstance().getGameManager().setLocationForMachineOpenPopup(null, null);RSGameScreenManager.getInstance().removeAllScreensExceptMainLobby();GlobalVars.isjackpotLoaded=!1;RSGame.getInstance().getGameManager().disableMachineOpenPopup();this.triggerScratcherGameActionEvents("scratcher_game_action","next_card","",d,c,"");RSCasinoManager.getCasinoInterface().loadMachine(RSGameTypes.Scratcher,e.machine_identifier,RSGameScreens.Machine)}else"SCORE_BOX_USER_DATA"===b.name?(0=parseInt(b.bonusRemaining)?c=!0:"BonusGame"==this.risingDigitalGameType&&null==b.bonusRemaining&&(c=!0);c?(0RSCasinoManager.getPrimaryCurrency()){this._agsOOC=!0;break}1==parseInt(RSGame.getInstance().getGameData().getDefaultValues().isFavoritesEnabled)&&RSGame.getInstance().getGameManager().isFavoritedMachine(RSGameTypes.Slots,this._machineParams._analyticsID)? RSCasinoManager.triggerPrimarySinkEvent("spin",this._oddsWorksBetAmount,this._machineParams._analyticsID,RSGameScreens.FavoritesLobby):RSCasinoManager.triggerPrimarySinkEvent("spin",this._oddsWorksBetAmount,this._machineParams._analyticsID);RSCasinoManager.addPrimaryCurrencyForDisplay("wager",-this._oddsWorksBetAmount);this._externalGameInterface.notifyRoundStart()}break;case "rg2xcGameResultShown":RSCasinoManager.getCasinoHUD().enableAllButtons();break;case "rg2xcGameWagerUpdated":this._oddsWorksBetAmount= this._oddsWorkobject.value;break;case "rg2xcGameWonUpdated":this._oddsWorksWinAmount=this._oddsWorkobject.value}},handleWazdenMachineEvents:function(a,b){switch(a){case "WGEAPI.status.ready":RSCasinoManager.getCasinoHUD().enableAllButtons();this._externalGameInterface.notifyGameLoaded(this._machineParams._analyticsID,RSGameTypes.Slots);break;case "WGEAPI.roundEnded":if(!0==this._agsFeatureModeStatus)break;null!=b.win&&(this._wazdenWinAmount=parseInt(b.win));0RSCasinoManager.getPrimaryCurrency()){this._agsOOC=!0;break}RSCasinoManager.addPrimaryCurrencyForDisplay("bonus_game",-this._wazdenBetAmount);1==parseInt(RSGame.getInstance().getGameData().getDefaultValues().isFavoritesEnabled)&&RSGame.getInstance().getGameManager().isFavoritedMachine(RSGameTypes.Slots,this._machineParams._analyticsID)?RSCasinoManager.triggerPrimarySinkEvent("bonus_game", this._wazdenBetAmount,this._machineParams._analyticsID,RSGameScreens.FavoritesLobby):RSCasinoManager.triggerPrimarySinkEvent("bonus_game",this._wazdenBetAmount,this._machineParams._analyticsID);RSCasinoManager.getCasinoHUD().disableAllButtons();break;case "WGEAPI.insufficientCredits":RSCasinoManager.getCasinoHUD().enableAllButtons();0RSCasinoManager.getPrimaryCurrency()){this._highFiveOOC=!0;break}this._highFiveBetAmount=parseInt(b.bet);1==parseInt(RSGame.getInstance().getGameData().getDefaultValues().isFavoritesEnabled)&&RSGame.getInstance().getGameManager().isFavoritedMachine(RSGameTypes.Slots,this._machineParams._analyticsID)?RSCasinoManager.triggerPrimarySinkEvent("spin",this._highFiveBetAmount,this._machineParams._analyticsID, RSGameScreens.FavoritesLobby):RSCasinoManager.triggerPrimarySinkEvent("spin",this._highFiveBetAmount,this._machineParams._analyticsID);this._externalGameInterface.notifyRoundStart();RSCasinoManager.addPrimaryCurrencyForDisplay("wager",-this._highFiveBetAmount);RSCasinoManager.getCasinoHUD().disableAllButtons()}else if("RoundEndedEvent"==b.type.name){if(2==this._high5GamesSpinStatus)break;this._high5GamesSpinStatus=2;this._highFiveWinAmount=0;null!=b.win&&(this._highFiveWinAmount=parseInt(b.win)); if(this._highFiveOOC){RSCasinoManager.getCasinoHUD().enableAllButtons();this._highFiveOOC=!1;break}0RSCasinoManager.getPrimaryCurrency()){this._highFiveOOC=!0;break}RSCasinoManager.addPrimaryCurrencyForDisplay("bonus_game",-this._highFiveBetAmount);1==parseInt(RSGame.getInstance().getGameData().getDefaultValues().isFavoritesEnabled)&&RSGame.getInstance().getGameManager().isFavoritedMachine(RSGameTypes.Slots,this._machineParams._analyticsID)?RSCasinoManager.triggerPrimarySinkEvent("bonus_game",this._highFiveBetAmount,this._machineParams._analyticsID, RSGameScreens.FavoritesLobby):RSCasinoManager.triggerPrimarySinkEvent("bonus_game",this._highFiveBetAmount,this._machineParams._analyticsID);RSCasinoManager.getCasinoHUD().disableAllButtons()}}},handleAinsworthMachineEvents:function(a,b){switch(a){case "gameReady":RSCasinoManager.getCasinoHUD().enableAllButtons();this._externalGameInterface.notifyGameLoaded(this._machineParams._analyticsID,RSGameTypes.Slots);this.setBetForAinsworth(this._machineParams._betStructure,this._machineParams._betIndex); this.setVolumeForAinsworth();break;case "gameStart":this._ainsworthOOC=!1;b.hasOwnProperty("totalBet")&&(this._ainsworthBetAmount=parseInt(b.totalBet));if(this._ainsworthBetAmount>RSCasinoManager.getPrimaryCurrency()){this._ainsworthOOC=!0;break}if(1==this._ainsworthSpinStatus)break;this._ainsworthSpinStatus=1;this._ainsworthBetAmount=parseInt(b.totalBet);1==parseInt(RSGame.getInstance().getGameData().getDefaultValues().isFavoritesEnabled)&&RSGame.getInstance().getGameManager().isFavoritedMachine(RSGameTypes.Slots, this._machineParams._analyticsID)?RSCasinoManager.triggerPrimarySinkEvent("spin",this._ainsworthBetAmount,this._machineParams._analyticsID,RSGameScreens.FavoritesLobby):RSCasinoManager.triggerPrimarySinkEvent("spin",this._ainsworthBetAmount,this._machineParams._analyticsID);this._externalGameInterface.notifyRoundStart();RSCasinoManager.addPrimaryCurrencyForDisplay("wager",-this._ainsworthBetAmount);RSCasinoManager.getCasinoHUD().disableAllButtons();break;case "gameEnd":if(2==this._ainsworthSpinStatus)break; this._ainsworthSpinStatus=2;this._ainsworthWinAmount=0;null!=b.totalWon&&(this._ainsworthWinAmount=parseInt(b.totalWon));if(this._ainsworthOOC){RSCasinoManager.getCasinoHUD().enableAllButtons();this._ainsworthOOC=!1;break}0RSCasinoManager.getPrimaryCurrency()){this._fincoreOOC=!0;break}1==parseInt(RSGame.getInstance().getGameData().getDefaultValues().isFavoritesEnabled)&&RSGame.getInstance().getGameManager().isFavoritedMachine(RSGameTypes.Slots,this._machineParams._analyticsID)? RSCasinoManager.triggerPrimarySinkEvent("spin",this._fincoreBetAmount,this._machineParams._analyticsID,RSGameScreens.FavoritesLobby):RSCasinoManager.triggerPrimarySinkEvent("spin",this._fincoreBetAmount,this._machineParams._analyticsID);this._externalGameInterface.notifyRoundStart();RSCasinoManager.addPrimaryCurrencyForDisplay("wager",-this._fincoreBetAmount);RSCasinoManager.getCasinoHUD().disableAllButtons();break;case "gameEnd":if(2==this._fincoreSpinStatus)break;this._fincoreSpinStatus=2;this._fincoreWinAmount= 0;null!=b.data.amountWon&&(this._fincoreWinAmount=parseInt(b.data.amountWon));0RSCasinoManager.getPrimaryCurrency()){this._bGamingOOC=!0;break}if(1==this._bGamingSpinStatus)break;this._bGamingSpinStatus=1;1==parseInt(RSGame.getInstance().getGameData().getDefaultValues().isFavoritesEnabled)&&RSGame.getInstance().getGameManager().isFavoritedMachine(RSGameTypes.Slots, this._machineParams._analyticsID)?RSCasinoManager.triggerPrimarySinkEvent("spin",this._bGamingBetAmount,this._machineParams._analyticsID,RSGameScreens.FavoritesLobby):RSCasinoManager.triggerPrimarySinkEvent("spin",this._bGamingBetAmount,this._machineParams._analyticsID);this._externalGameInterface.notifyRoundStart();RSCasinoManager.addPrimaryCurrencyForDisplay("wager",-this._bGamingBetAmount);RSCasinoManager.getCasinoHUD().disableAllButtons();break;case "round_result":if(this._bGamingOOC){RSCasinoManager.getCasinoHUD().enableAllButtons(); this._bGamingOOC=!1;break}this._bGamingWinAmount=0;null!=b.win&&(this._bGamingWinAmount=parseInt(b.win));break;case "round_complete":if(2==this._bGamingSpinStatus)break;this._bGamingSpinStatus=2;0RSCasinoManager.getPrimaryCurrency()){this._yfageoOOC=!0;break}if(1==this._yfageoSpinStatus)break;this._yfageoSpinStatus=1;1==parseInt(RSGame.getInstance().getGameData().getDefaultValues().isFavoritesEnabled)&&RSGame.getInstance().getGameManager().isFavoritedMachine(RSGameTypes.Slots,this._machineParams._analyticsID)?RSCasinoManager.triggerPrimarySinkEvent("spin",this._yfageoBetAmount,this._machineParams._analyticsID, RSGameScreens.FavoritesLobby):RSCasinoManager.triggerPrimarySinkEvent("spin",this._yfageoBetAmount,this._machineParams._analyticsID);this._externalGameInterface.notifyRoundStart();RSCasinoManager.addPrimaryCurrencyForDisplay("wager",-this._yfageoBetAmount);RSCasinoManager.getCasinoHUD().disableAllButtons();break;case "round_result":if(this._yfageoOOC){RSCasinoManager.getCasinoHUD().enableAllButtons();this._yfageoOOC=!1;break}this._yfageoWinAmount=0;null!=b.win&&(this._yfageoWinAmount=parseInt(b.win)); break;case "round_complete":2==this._yfageoSpinStatus&&RSErrorTracker.getInstance().trackErrorMessage("YFAGEO_RARECASE_WINAMOUNT",this._yfageoWinAmount,"mahesh.jose@rubyseven.net,lijith.puthiyoottil@rubyseven.net");this._yfageoSpinStatus=2;0=a._retryCount&&a.onProgress)a.onProgress(b)},function(b){b?a._onErrorLoading(b):a.cb&&a.cb()})},_onErrorLoading:function(a){this._retryCount++;if(3>=this._retryCount){for(var b=this.resources.length=0;b=this._currentMachineDepth)return this._resetMachineStatus(),this._sinkBeforeSpin=this._currentMachineID=null,this._checkValidity(),this._super.notifyMachineExitToCasino.apply(this,arguments)}else this._onInconsistentState()},triggerMachineEvent:function(a,b,c){this.getIsAnyFeatureActive()|| a!=RS_SLOTS_MACHINE_STATUS||b!=RSSlotMachineStatus.READY_FOR_SPIN||(this._fsStarted||(this._readyForSpin=!0),this._refreshSpinCompleteStatus())},triggerPrimarySinkEvent:function(a,b,c){a==this.const.analytics.spin&&(this._spinStarted?this._slotResultAbridged.totalBet+=b:this._sinkBeforeSpin=b)},_addWin:function(a){this._slotResultAbridged.totalWin+=a;this._spinStarted||cc.error("[RSCasinoInterfaceSlotSimplifier.js]: Win event received outside of spinning state")},triggerPrimarySourceEvent:function(a, b,c,d){switch(b){case this.const.analytics.bonus:this._addWin(c);this._slotResultAbridged.bonusWin+=c;this._onBonusGame||this._onUnknownFeature?(this._onBonusGame?this._onBonusGame=!1:this._onUnknownFeature=!1,this._refreshSpinCompleteStatus()):this._bonusResultAlreadyTriggered=!0;break;case this.const.analytics.fs:this._addWin(c);this._slotResultAbridged.fsWin+=c;if(this._onFreeSpin||this._onUnknownFeature)this._onFreeSpin?this._onFreeSpin=!1:this._onUnknownFeature=!1,this._fsStarted=!1,this._refreshSpinCompleteStatus(); this._fsResultAlreadyTriggered=!0;break;case this.const.analytics.lineWin:this._addWin(c),this._slotResultAbridged.lineWin+=c}return this._super.triggerPrimarySourceEvent.apply(this,arguments)},notifyResultToCasino:function(a){this._fsStarted||(this._resultReceived=!0);if(this._spinStarted){if(a._gameResult){var b=a._gameResult,c;(0a?c=a:ca&&(a=0),this.scrollOnUpDownClick(a))},btnDownClicked:function(a,b,c){a=this.getPercentVertical();isNaN(a)||(a+=10,100b?d=b:da?c=a:cthis._whaleMonetizationFactor&&(b=!0);this._currentMonetizationUserStatus=a;this._currentWhaleUserStatus=b;var c={};c[SDK_ATTRIBUTE_TYPE.coins]=this._coins;c[SDK_ATTRIBUTE_TYPE.xp]=this._xp;c[SDK_ATTRIBUTE_TYPE.level]=this._level;c[SDK_ATTRIBUTE_TYPE.isMonetizingUser]=a;c[SDK_ATTRIBUTE_TYPE.isWhaleUser]=b;c[SDK_ATTRIBUTE_TYPE.leaderboardRank]=parseInt(RSLeaderboard.getUserRank()); c[SDK_ATTRIBUTE_TYPE.firstName]=this._firstName;c[SDK_ATTRIBUTE_TYPE.Name]=this._firstName;c[SDK_ATTRIBUTE_TYPE.lastLogin]=new Date;URLConfig.CLEVERTAP_ENABLED&&this._facebookId&&(c[SDK_ATTRIBUTE_TYPE.facebookId]=this._facebookId);this._isFreshUser&&GameConfig.SSO_ENABLED&&1!=RSSSOManager.getFoxwoodsPlayerStatus()?(c[SDK_ATTRIBUTE_TYPE.vipTier]=0,this.trackEvent(SDK_EVENT_TYPE.gameInstall)):c[SDK_ATTRIBUTE_TYPE.vipTier]=this._vipTier;this._isFreshUser&&GameConfig.SSO_ENABLED&&1==RSSSOManager.getFoxwoodsPlayerStatus()&& (c[SDK_ATTRIBUTE_TYPE.spend]=Number(5*this._monetizationFactor).toFixed(2));RSSaleManager.getInstance().getNSPActivedState()&&(c[SDK_ATTRIBUTE_TYPE.isNPSBought]=!1);RSEngine.loginMode==LOGIN_MODE.FACEBOOK?postMessage({type:"setAttribute",data:{Site:c}},"*"):parent.postMessage({type:"setAttribute",data:{Site:c}},"*");this.trackEvent(SDK_EVENT_TYPE.loadingComplete)}},updateVipTierUp:function(a){this._isGuestLogin||this._vipTier==a||(this._vipTier=a,this.setAttribute(SDK_ATTRIBUTE_TYPE.vipTier,this._vipTier))}, updateLOC:function(a){this._isGuestLogin||a==this._isLOC||(this._isLOC=a,this.setAttribute(SDK_ATTRIBUTE_TYPE.isLowOnCoins,a))},updateCoinXpLevel:function(a,b,c){if(!this._isGuestLogin){var d={};d[SDK_ATTRIBUTE_TYPE.coins]=a;d[SDK_ATTRIBUTE_TYPE.xp]=b;d[SDK_ATTRIBUTE_TYPE.level]=c;RSEngine.loginMode==LOGIN_MODE.FACEBOOK?postMessage({type:"setAttribute",data:{Site:d}},"*"):parent.postMessage({type:"setAttribute",data:{Site:d}},"*")}},logPurchase:function(a,b,c){if(!this._isGuestLogin){b=a=!1;0this._whaleMonetizationFactor&&(b=!0);var d={};d[SDK_ATTRIBUTE_TYPE.isWhaleUser]=b;d[SDK_ATTRIBUTE_TYPE.isMonetizingUser]=a;d[SDK_ATTRIBUTE_TYPE.spend]=Number(5*c).toFixed(2);a&&(d[SDK_ATTRIBUTE_TYPE.isNPSActive]=!1);RSEngine.loginMode==LOGIN_MODE.FACEBOOK?postMessage({type:"setAttribute",data:{Site:d}},"*"):parent.postMessage({type:"setAttribute",data:{Site:d}},"*")}},showNewsFeed:function(){},showInAppMessage:function(a){},updateTopHUDWithMessageCount:function(a){RSPlatformSDKManager.getInstance().updateTopHUDWithMessageCount(a)}, setUserAttributeNPSBought:function(a){this.setAttribute(SDK_ATTRIBUTE_TYPE.isNPSBought,a)},setUserAttributeNPSActive:function(a){this.setAttribute(SDK_ATTRIBUTE_TYPE.isNPSActive,a)},setUserAttributeLastGamePlayed:function(a){this.setAttribute(SDK_ATTRIBUTE_TYPE.lastPlayedGame,a)},setUserAttributeHourlyBonusReady:function(a){this.setAttribute(SDK_ATTRIBUTE_TYPE.hourlyBonusReady,a)},setUserAttributeLastSlotUnlocked:function(a){this.setAttribute(SDK_ATTRIBUTE_TYPE.lastSlotUnlocked,a)},setUserAttributeNextSlotToBeUnlocked:function(a){this.setAttribute(SDK_ATTRIBUTE_TYPE.nextSlotToBeUnlocked, a)},setUserAttributeMostPlayedGame:function(a){this.setAttribute(SDK_ATTRIBUTE_TYPE.mostPlayedGame,a)},setUserAttributeGameWithLastBigWin:function(a){this.setAttribute(SDK_ATTRIBUTE_TYPE.gameWithLastBigWin,a)},setUserAttributeLastCancelledInAppPack:function(a){this.setAttribute(SDK_ATTRIBUTE_TYPE.lastCancelledInAppPack,a)},setUserAttributeLastCancelledDollarAmount:function(a){this.setAttribute(SDK_ATTRIBUTE_TYPE.lastCancelledDollarAmount,a)},setUserAttributeLeaderboardRank:function(a){this.setAttribute(SDK_ATTRIBUTE_TYPE.leaderboardRank, a)},setUserAttributeJoiningDate:function(a){this.setAttribute(SDK_ATTRIBUTE_TYPE.joiningDate,new Date(1E3*a))},setUserAttributeUserIdGroup:function(a){this.setAttribute(SDK_ATTRIBUTE_TYPE.userIdGroup,a)},setUserAttributeLastLogin:function(a){this.setAttribute(SDK_ATTRIBUTE_TYPE.lastLogin,new Date(1E3*a))},setUserAttributeLastPurchaseAmount:function(a){a=parseFloat(a);this.setAttribute(SDK_ATTRIBUTE_TYPE.lastPurchaseAmount,a)},setUserAttributePowerUp:function(a){this.setAttribute(SDK_ATTRIBUTE_TYPE.powerUp, a)},setUserAttributeName:function(a){this.setAttribute(SDK_ATTRIBUTE_TYPE.firstName,a);this.setAttribute(SDK_ATTRIBUTE_TYPE.Name,a)},setUserAttributeDQRewardPending:function(a){this.setAttribute(SDK_ATTRIBUTE_TYPE.DQRewardPending,a)},setUserAttributeDailyQuestPoints:function(a){this.setAttribute(SDK_ATTRIBUTE_TYPE.DQRewardPoints,a)},setUserAttributePlayerConnect:function(a){this.setAttribute(SDK_ATTRIBUTE_TYPE.isPlayerConnect,a)},setUserAttributePlaysTournament:function(a){this.setAttribute(SDK_ATTRIBUTE_TYPE.playsTournament, a)}});function externalLeanplumCallback(a,b){cc.log("externalSDKCallback called");RSLeanPlum.closeNewsFeed();RSPlatformSDKManager.getInstance().externalCallback(a,b);GameConfig.PLATFORM_EVENT_MANAGER_ENABLED&&RSEventManager.getInstance().dispatchEvent(RSPlatformEventTypeKeys.POPUP_CLOSE,RSPlatformPopupNameKeys.APP_INBOX)};var RSPlatformSDKVO=RSVO.extend({sdkName:null,userId:null,facebookId:null,lastLoginDate:null,isFreshUser:null,coins:null,xp:null,level:null,vipTier:null,monetizationFactor:null,email:null,joinDate:null,firstName:null,leanplumAppId:null,leanplumDevKey:null,leanplumLiveKey:null,isLeanplumLive:null,isGuestLogin:null,isFacebookPlayer:null,appId:null,gameId:null,platform:null,init:function(a){this._super.init.call(this,a)}});var RSLoaderLayer=RSPanel.extend({init:function(a,b){a||(a=!1);b||(b=!1);this._super.init.call(this,RSEngine.screenWidth/2,RSEngine.screenHeight/2,RSEngine.screenWidth,RSEngine.screenHeight);this._image=null;this.addTouchListener();this.setSwallowTouches(!0);a?this.setBackgroundColor(0,0,0,0):this.setBackgroundColor(0,0,0,180);a||b||this.addLoadingImage()},addLoadingImage:function(){var a=RSEngine.getLoadingAnimation();a&&(this._image=new RSImageObject,this._image.setImageFromUrl(a,0,0,75,75),this._image.setAnchorPoint(0.5, 0.5),this._image.setPosition(RSEngine.screenWidth/2,RSEngine.screenHeight/2),this._image.setZOrder(1),this._image.actionRotateBy(4,360,-1),this.addChild(this._image))}});var RSLayerGradient=RSClass.extend({init:function(a){this._ccObject=null;this._super.init.call(this);this._ccObject=new cc.LayerGradient;this.setSize(a.getWidth(),a.getHeight());this.setPosition(a.getX(),a.getY());RSEngine.isMobile&&this._ccObject.retain()},setStartColor:function(a){this.getDisplayObject().setStartColor(new cc.Color(a.getR(),a.getG(),a.getB()))},setEndColor:function(a){this.getDisplayObject().setEndColor(new cc.Color(a.getR(),a.getG(),a.getB()))},setStartOpacity:function(a){this.getDisplayObject().setStartOpacity(a)}, setEndOpacity:function(a){this.getDisplayObject().setEndOpacity(a)},setVector:function(a){this.getDisplayObject().setVector(new cc.Point(a.getX(),a.getY()))},setSize:function(a,b){this._ccObject.setContentSize(a,b)},setOpacity:function(a){this._ccObject.setOpacity(a)},setAnchorPoint:function(a,b){this._ccObject.setAnchorPoint(a,b)},stopAllActions:function(){},setPosition:function(a,b){this._ccObject.setPosition(a,b)},setColor:function(a){this._ccObject.setColor(cc.color(a.getR(),a.getG(),a.getB(), a.getA()))},getDisplayObject:function(){if(null==this._ccObject)cc.log("Object is NULL!");else return this._ccObject},actionMoveBy:function(a,b,c,d){var e=this;a=cc.moveBy(a,b,c);b=cc.callFunc(function(){null!=d&&d(e)},this,this);return this.runAction(cc.sequence(a,b))},runAction:function(a){return this._ccObject.runAction(a)},setZOrder:function(a){this._ccObject.setLocalZOrder(a)},unload:function(){this._super.unload.call(this);this._ccObject&&this._ccObject.cleanup();RSEngine.isMobile&&this._ccObject.release(); delete this._ccObject;this._ccObject=null;for(var a in this)this[a]=null}});var CarouselWidgetType={EMAIL_CONNECT:"EmailConnect",PLAYER_CONNECT:"PlayerConnect",HOUSE_ADS:"HouseAds"},RSSalePopupGlobal,RSSalePopup=RSPopup.extend({_callBack:null,_assetList:null,_saleDetails:null,_currentPowerPackData:null,_layoutLoadedCount:null,_selectedType:null,_currentPackData:null,_bannerBar:null,_usBannerBar:null,_purchasedTag:[],_purchaseReward:[],_purchasePrice:[],_purchaseRewardData:[],_purchasePriceData:[],_packSelected:0,_popupTimerObject:null,_popupTimerText:null,_timeRemaining:0, _onSaleTriggered:!1,_buttonList:[],_pricePosition:{},_amountTxts:[],_amountTxt:null,_termsUrl:null,_openFrom:null,init:function(a,b,c,d){this._subscriptionSource=d;this._layoutLoadedCount=0;this._openFrom=b;this._assetList=[{name:RSSaleManager.getInstance().getSaleResourcesName(),count:1}];this._super.init.call(this);this._purchasedTag=[];this._buttonList=[];this._purchaseReward=[];this._purchasePrice=[];this._purchaseRewardData=[];this._purchasePriceData=[];this._callBack=a;this._amountTxts=[];this._selectedType= this._amountTxt="";this._isCloseButtonClicked=this._onSaleTriggered=!1;this._termsUrl=GameConfig.TERMS_OF_SERVICE_URL+"#subscription";this._tag=c;RSSalePopupGlobal=this;RSEventManager.getInstance().addEventListener("onTimerTick",this,this._setTimerValues.bind(this));RSEventManager.getInstance().addEventListener("onPurchaseSuccessClosed",this,this.closePopup.bind(this))},getName:function(){return"RSSalePopup"},_setTimerValues:function(a){this._timeRemaining=a._userData.timeRemaining;0=this._saleDetails.userPurchasableCount)for(a=0;a=this._saleDetails.userPurchasableCount)for(var g=0;g this._alreadyFetchedResources.indexOf(this._allSalesData[g].assets[f].assetLink)&&this._resourcesToBeFetched.push(this._allSalesData[g].assets[f].assetLink);0==this.NPSOTEndTime&&null!=this._allSalesData.nps_ot&&(this.NPSOTEndTime=TimeManager.getInstance().currentServerTime+this._allSalesData.nps_ot.tagTime);1this._alreadyFetchedResources.indexOf(this._purchaseCartCoinVO.assets[h].assetLink)&&this._resourcesToBeFetched.push(this._purchaseCartCoinVO.assets[h].assetLink);if(0<=this._purchaseCartCoinVO.assets[h].assetLink.indexOf("PurchaseCartPopup")){var k=this._purchaseCartCoinVO.assets[h].assetLink.split("_layout_iPad")[0],k=k.split("_layout_iPhone5")[0],k=k.split("_layout_iPhone4")[0],k=k.split("_00-hd")[0],k=k.split("/"),k=k[k.length-1];this.purchaseCartAssetChangeType.coin= k}0<=this._purchaseCartCoinVO.assets[h].assetLink.indexOf(".png")&&0>this._purchaseCartCoinVO.assets[h].assetLink.indexOf(this._purchaseCartCoinVO.saleName)&&(this._purchaseCartCoinResourceName=this._purchaseCartCoinVO.assets[h].assetLink.split("_00-hd.png")[0]);0<=this._purchaseCartCoinVO.assets[h].assetLink.indexOf(this._purchaseCartCoinVO.saleName)&&b.push(this._purchaseCartCoinVO.assets[h].assetLink)}break;case "energy":"purchase_cart"==a.result.purchaseCarts[f].saleType&&(this._purchaseCartSaleActiveStatus.energy= !0);this._purchaseCartEnergyVO=new RSSaleVO(a.result.purchaseCarts[f]);for(h=0;hthis._alreadyFetchedResources.indexOf(this._purchaseCartEnergyVO.assets[h].assetLink)&&this._resourcesToBeFetched.push(this._purchaseCartEnergyVO.assets[h].assetLink),0<=this._purchaseCartEnergyVO.assets[h].assetLink.indexOf("PurchaseCartPopup")&&(k=this._purchaseCartEnergyVO.assets[h].assetLink.split("_layout_iPad")[0],k=k.split("_layout_iPhone5")[0],k=k.split("_layout_iPhone4")[0], k=k.split("_00-hd")[0],k=k.split("/"),k=k[k.length-1],this.purchaseCartAssetChangeType.energy=k),0<=this._purchaseCartEnergyVO.assets[h].assetLink.indexOf(".png")&&0>this._purchaseCartEnergyVO.assets[h].assetLink.indexOf(this._purchaseCartEnergyVO.saleName)&&(this._purchaseCartEnergyResourceName=this._purchaseCartEnergyVO.assets[h].assetLink.split("_00-hd.png")[0]),0<=this._purchaseCartEnergyVO.assets[h].assetLink.indexOf(this._purchaseCartEnergyVO.saleName)&&b.push(this._purchaseCartEnergyVO.assets[h].assetLink); break;case "powerup":"purchase_cart"==a.result.purchaseCarts[f].saleType&&(this._purchaseCartSaleActiveStatus.powerup=!0);this._purchaseCartPowerupVO=new RSSaleVO(a.result.purchaseCarts[f]);for(h=0;hthis._alreadyFetchedResources.indexOf(this._purchaseCartPowerupVO.assets[h].assetLink)&&this._resourcesToBeFetched.push(this._purchaseCartPowerupVO.assets[h].assetLink),0<=this._purchaseCartPowerupVO.assets[h].assetLink.indexOf("PurchaseCartPopup")&&(k= this._purchaseCartPowerupVO.assets[h].assetLink.split("_layout_iPad")[0],k=k.split("_layout_iPhone5")[0],k=k.split("_layout_iPhone4")[0],k=k.split("_00-hd")[0],k=k.split("/"),k=k[k.length-1],this.purchaseCartAssetChangeType.powerup=k),0<=this._purchaseCartPowerupVO.assets[h].assetLink.indexOf(".png")&&0>this._purchaseCartPowerupVO.assets[h].assetLink.indexOf(this._purchaseCartPowerupVO.saleName)&&(this._purchaseCartPowerupResourceName=this._purchaseCartPowerupVO.assets[h].assetLink.split("_00-hd.png")[0]), 0<=this._purchaseCartPowerupVO.assets[h].assetLink.indexOf(this._purchaseCartPowerupVO.saleName)&&b.push(this._purchaseCartPowerupVO.assets[h].assetLink);break;case "daubAlert":for("purchase_cart"==a.result.purchaseCarts[f].saleType&&(this._purchaseCartSaleActiveStatus.daubAlert=!0),this._daubAlertVO=new RSSaleVO(a.result.purchaseCarts[f]),h=0;hthis._alreadyFetchedResources.indexOf(this._daubAlertVO.assets[h].assetLink)&&this._resourcesToBeFetched.push(this._daubAlertVO.assets[h].assetLink), 0<=this._daubAlertVO.assets[h].assetLink.indexOf("DaubAlert")&&(k=this._daubAlertVO.assets[h].assetLink.split("_layout_iPad")[0],k=k.split("_layout_iPhone5")[0],k=k.split("_layout_iPhone4")[0],k=k.split("_00-hd")[0],k=k.split("/"),k=k[k.length-1],this.daubAlertAssetChangeType.daubAlert=k),0<=this._daubAlertVO.assets[h].assetLink.indexOf(".png")&&0>this._daubAlertVO.assets[h].assetLink.indexOf(this._daubAlertVO.saleName)&&(this._daubAlertResourceName=this._daubAlertVO.assets[h].assetLink.split("_00-hd.png")[0]), 0<=this._daubAlertVO.assets[h].assetLink.indexOf(this._daubAlertVO.saleName)&&b.push(this._daubAlertVO.assets[h].assetLink)}if(a.result.voucherSale){this._voucherData=a.result.voucherSale[0];for(f=0;fthis._alreadyFetchedResources.indexOf(this._voucherData.assets[f].assetLink)&&this._resourcesToBeFetched.push(this._voucherData.assets[f].assetLink);if(this._VoucherSaleEndTime<=TimeManager.getInstance().getCurrentServerTime()||this._VoucherSaleEndTime!=this._voucherData.remainingTime+ TimeManager.getInstance().getCurrentServerTime())this._VoucherSaleEndTime=this._voucherData.remainingTime+TimeManager.getInstance().getCurrentServerTime()}else this._voucherData=[],this._VoucherSaleEndTime=0;0TimeManager.getInstance().getCurrentServerTime()&&null==a||this._VoucherSaleEndTime&&this._VoucherSaleEndTimethis.purchaseCartAssets.indexOf(e)&&this.purchaseCartAssets.push(e)}},getNSPActivedState:function(){return this._NPSSaleActived}, setCartsNeededForGame:function(a){this._cartsNeeded=a},getPurchaseCartSaleStatus:function(){for(var a in this._purchaseCartSaleActiveStatus)if(!0==this._purchaseCartSaleActiveStatus[a])return!0;return!1},pushSaleToPurchaseCart:function(){if(null!=this._allSalesData.sale&&null!=this.saleCartIndex[this._allSalesData.sale.monetizationCategory])for(var a=this._allSalesData.sale.monetizationCategory,b=0;b=f&&!RSGame.getInstance().getUserDataManager().getMe().getAppsFlayerEventStatus("event4")&&(RSAppsFlyerManager.getInstance().trackEvent("event4",a),RSGame.getInstance().getUserDataManager().getMe().setAppsFlayerEvents("event4")),f=RSEngine.dataManager.getMe().getMonetizationCount(),2=e&&!RSGame.getInstance().getUserDataManager().getMe().getAppsFlayerEventStatus("event2")&&(RSAppsFlyerManager.getInstance().trackEvent("event2",a),RSGame.getInstance().getUserDataManager().getMe().setAppsFlayerEvents("event2")))}},onRetrieveCoinsPurchase:function(a,b){if(a){"function"=== typeof RSEngine.dataManager.getMe().setLastPurchasePack?RSEngine.dataManager.getMe().setLastPurchasePack(this._purchasePackData.inAppPack):cc.log("Did not find set last purchase pack on blob function needed for exit cart");this._currentPack={value:this._purchasePackData.coin,isCredit:!0,type:"coins",id:this._purchasePackData.inAppPack};for(var e in this._purchasePackData)this._purchasePackData.hasOwnProperty(e)&&(this._currentPack[e]=this._purchasePackData[e]);this._purchasePackData.powerup&&(this._currentPack.powerupPacks= this._purchasePackData.powerup);this._purchasePackData.energy&&(this._currentPack.energy=this._purchasePackData.energy);this._currentPack.analyticsName=this._saleVO.analyticsName+String(this._purchasePackData.price).replace(".","");this._currentPack.analyticsPrice=this._purchasePackData.price;"LNC"!=GameConfig.GAME_ID&&"BBC"!=GameConfig.GAME_ID&&"MS"!=GameConfig.GAME_ID&&"CS"!=GameConfig.GAME_ID&&"AP"!=GameConfig.GAME_ID&&"FPC"!=GameConfig.GAME_ID&&"UP"!=GameConfig.GAME_ID&&"BPVP"!=GameConfig.GAME_ID&& "RSVP"!=GameConfig.GAME_ID||RSPlatformSDKManager.getInstance().logPurchase(this._currentPack.analyticsName,this._currentPack.analyticsPrice,b.result.data.monetization_factor);b&&(this._purchaseResponseObject.clubMPoints=b.result.data.clubMPoints?b.result.data.clubMPoints:0,this._purchaseResponseObject.LoyaltyPoint=b.result.data.LoyaltyPoint?b.result.data.LoyaltyPoint:0,this._purchaseResponseObject.playerConnectPoints=b.result.data.playerConnectPoints?b.result.data.playerConnectPoints:0,this._purchaseResponseObject.gcowRewardedCount= b.result.data.gcowRewardedCount?b.result.data.gcowRewardedCount:0,this._purchaseResponseObject.isGCOWRewardAvailable=b.result.data.isGCOWRewardAvailable?b.result.data.isGCOWRewardAvailable:!1);this.setUserDataOnSalePurchaseComplete();this.onPurchaseSuccessCallBack(this._currentPack.analyticsName)}},onPurchaseSuccessNotifyResponseToCasino:function(){this._hideOverlayLayer();RSGame.getInstance().getGameManager().notifySalePurchaseResponseToCasino(this._purchaseResponseObject,this._currentPack,"success", null);var a=this._purchasePackData.inAppPack,b=RSEngine.gameData.getPackById(this._purchasePackData.inAppPack);b&&(a=b.analyticsName);this.trackAppsFlyerEventsAfterPurchase(a);this._currentPack=null},setUserDataOnSalePurchaseComplete:function(){var a=RSEngine.dataManager.getMe().getSalePurchaseData(),b=this._saleVO.saleId,e=this._saleVO.eventId,f=this._purchasePackData.offerId;null!=a[b+"_"+e]?(a[b+"_"+e].count=null!=a[b+"_"+e].count?0=this._timeRemaining&&(this._saleVO.remainingTime=0,this._callSaleDetailsTimer=setTimeout(this.checkForNewSale.bind(this), 2E3),this.setSaleStatus(),clearInterval(this._bonusTimer),this._bonusTimer=null);RSEventManager.getInstance().dispatchEvent("onTimerTick",{timeRemaining:this._timeRemaining})},checkForNewSale:function(a){this._refreshOnceCalled=a?a:!1;this._isRecheckCall=a;this.callSaleDetails(this.reInitializeSale.bind(this),null);clearTimeout(this._callSaleDetailsTimer)},reInitializeSale:function(){this._saleVO=null;this.getSaleActiveStatus();this.setSaleStatus()},getSaleActiveStatus:function(a){if(null!=this._allSalesData.nps_ot){if(this.getNPS_OTStatus)return!0}else if(null!= this._allSalesData.nps||null!=this._allSalesData.sale&&(a||null!=this._saleVO||(this._saleVO=this._allSalesData.sale),this.getGeneralSaleActiveStatus()))return!0;return!1},getLocOocStatus:function(){return null!=this._allSalesData.ooc||null!=this._allSalesData.loc||null!=this._allSalesData.loe||null!=this._allSalesData.ooe?!0:!1},getSubscriptionSaleStatus:function(){return null!=this._allSalesData.subscription?!0:!1},getLocOocSaleData:function(a){return null!=this._allSalesData[a]?this._allSalesData[a]: null},getCartBundleStatus:function(){return null!=this._allSalesData.cartbundle?!0:!1},getCartBundleSaleData:function(){if(null!=this._allSalesData.cartbundle)return this._allSalesData.cartbundle},getGeneralSaleActiveStatus:function(){if(0!=this._saleStatus&&0=this._saleVO.userPurchasableCount&&f++;if(fthis._saleVO.assets[a].assetLink.indexOf("LoyaltyPreviewWidget")&&(this._saleResourceName=this._saleVO.assets[a].assetLink.split("_00-hd.png")[0]);this._timeRemaining=this._saleVO.remainingTime; if(this._saleEndTime<=TimeManager.getInstance().getCurrentServerTime()||this._saleEndTime!=this._saleVO.remainingTime+TimeManager.getInstance().getCurrentServerTime())this._saleEndTime=this._saleVO.remainingTime+TimeManager.getInstance().getCurrentServerTime()},showSubscriptionSalePopup:function(a,b,e){"US"==RSGame.getInstance().getUserDataManager().getMe().getCountryCode()&&this.showSalePopupWithTag("subscription",!1,b,null,a,e)},getOptValForSubscriptionPlacement:function(){return this._optValForSubsPlacement? this._optValForSubsPlacement:null},getSaleResourceByName:function(a,b){var e=null;if(b)for(var f=0;f60*RS_SALEANALTYICS_SESSION_RENEWAL&&(this._sessionID=this._userID+"_"+a,RSSaleManager.getInstance().setSessionID(this._userID+"_"+a),this._localMinimizeTime=this._recordedSessionTime=0);return!0},processQueue:function(a){if(0!=this._queue.length){var b=0;a?(this._requestInProgress&&this._queue.splice(0,1),b=this._queue.length): this._queueLimitProcessed?b=1:(b=this._queue.length,b>RS_INHOUSE_QUEUE_LIMIT&&(this._queueLimitProcessed=!0,b=RS_INHOUSE_QUEUE_LIMIT));if(0!=b){this._requestInProgress=!0;a=this._queue[0];this._queue.splice(0,1);for(var c=1;cc&&(c="0"+c);var d=a.getDate();10>d&&(d="0"+d);var e=a.getHours();10>e&&(e="0"+e);var f=a.getMinutes();10>f&&(f="0"+f);a=a.getSeconds();10>a&&(a="0"+a);return b+"-"+c+"-"+d+" "+e+":"+f+":"+a},incrementCounter:function(){this._eventCounter+=1;RSSaleManager.getInstance().setSessionCounter(this._eventCounter)},trackEvent:function(a,b,c,d,e,f,g){if(void 0==a||void 0==b||void 0==c||void 0==d|| void 0==e||void 0==f||void 0==g)cc.log("ANALYTICS ERROR---undefined FROM....eventName"+a+"eventAction"+b+"dollarValue"+c+"tier"+d+"saleId"+e+"eventId"+f+"packId"+g);else if(null==a||null==b||null==c||null==d||null==e||null==f||null==g)cc.log("ANALYTICS ERROR---NULL FROM....eventName"+a+"eventAction"+b+"dollarValue"+c+"tier"+d+"saleId"+e+"eventId"+f+"packId"+g);else{this.incrementCounter();var h={};h.appId=this._appID;h.userId=this._userID;h.fbId=this._fbID;h.platform=this._platform;h.saleId=e;h.eventId= f;h.packId=g;h.eventName=a;h.eventAction=b;h.dollarValue=c;h.tier=d;h.counter=this._eventCounter;h.version=this._version;h.date=this.getCurrentSessionDuration();h.event_time=TimeManager.getInstance().getCurrentServerTime();h.sessionId=this._sessionID;a=JSON.stringify(h);this._queue.push(a);h.length=0;this.saveQueueToLocalStorage()}}});var RSSaleVO=RSVO.extend({analyticsName:null,assetLink:null,checksum:null,eventId:null,monetizationCategory:null,packs:null,remainingTime:null,saleId:null,saleName:null,timer:null,userPurchasableCount:null,userPurchasableType:null,tag:null,type:null,saleVersion:null,strikeOutData:null,init:function(a){this.analyticsName="";this.assets=[];this.monetizationCategory=this.eventId=this.checksum=this.assetLink="";this.packs=[];this.remainingTime=0;this.saleVersion=this.pushToCart=this.type=this.tag=this.userPurchasableType= this.userPurchasableCount=this.timer=this.saleName=this.saleId="";this.strikeOutData=null;this._super.init.call(this,a)}});var RSMachine=RSGameScreen.extend({init:function(){this._super.init.call(this);this._machineScale=1;this._machineAnchorPoint=new RSPoint(0.5,0.5);this._machineSizeModified=!1;this._machineOrientation=RSEngine.orientation;this._machinePosition=new RSPoint(0,0);this._paddingImage=this._paddingImageURL=null;this._checkAndSetOrientation=!1;this._minMachineSize=new RSSize(900*RSEngine.resolutionFactor,1E3*RSEngine.resolutionFactor);this._loadingProgressDiv=this._loadingBgDiv=null},setPaddingForMachine:function(a){this._paddingImageURL= a;a=SCREEN_SIZES[RSEngine.layout].height;var b=SCREEN_SIZES[RSEngine.layout].width;if(RSEngine.orientation==SCREEN_ORIENTATION.PORTRAIT){var c=a;a=b;b=c}this._paddingImage=new RSImageObject(this);this._paddingImage.setName("MachinePaddingImage");this._paddingImage.setImageFromUrl(this._paddingImageURL,0,0,a,b);this._paddingImage.setCenter(RSEngine.screenWidth/2,RSEngine.screenHeight/2);this._paddingImage.setScale(1/this._machineScale);this._paddingImage.setZOrder(-1);this.getDisplayObject().addChild(this._paddingImage.getDisplayObject())}, onImageLoaded:function(a){"MachinePaddingImage"==a.getName()&&this._paddingImage.setScale(1/this._machineScale)},onImageLoadFailed:function(a){"MachinePaddingImage"==a.getName()&&(a=this.getSize(),this._paddingImage.setImageFromUrl(this._paddingImageURL,0,0,a.getWidth(),a.getHeight()))},layoutMachine:function(){this.layoutScreen(this.getLayouts())},setLoadingDivs:function(a,b){this._loadingBgDiv=a;this._loadingProgressDiv=b},revealScreen:function(){this._super.revealScreen.call(this);this._loadingBgDiv&& (document.getElementById("Cocos2dGameContainer").appendChild(this._loadingBgDiv),this._loadingBgDiv.style.zIndex="-1",this._loadingBgDiv.style.filter="blur(10px)",this._loadingBgDiv.style.WebkitFilter="blur(10px)");this._loadingProgressDiv&&(this._loadingProgressDiv.style.visibility="hidden")},getLayouts:function(){return[]},onScreenOrientationChanged:function(a){this._machineOrientation=a;this._machineScale=1;this._machinePosition.setPoint(0,0);if(this._isScreenActive){this._machineOrientation!= RSEngine.orientation&&(this._machineScale=RSEngine.orientation==SCREEN_ORIENTATION.LANDSCAPE?RSEngine.screenHeight/this._minMachineSize.getWidth():RSEngine.screenWidth/RSEngine.screenHeight,this._machinePosition.setPoint(RSEngine.screenHeight/2-RSEngine.screenWidth/2,RSEngine.screenWidth/2-RSEngine.screenHeight/2));this.setScale(this._machineScale);this.setPosition(this._machinePosition.getX(),this._machinePosition.getY());this._paddingImage&&this._paddingImage.setScale(1/this._machineScale);for(a= 0;a= this[a(564)])break;RSEngine[a(529)][a(453)]()[a(466)](this[a(564)]);RSEngine.dataManager[a(453)]()[a(532)](this[a(437)][a(504)]);RSEngine[a(529)][a(453)]()[a(542)](this[a(437)].xp_duration);RSEngine.dataManager[a(453)]()[a(530)](a(534));RSAnalyticsManager[a(515)]().trackPlayerAction("xp_blast","start",a(534),parseInt(60*RSEngine[a(529)][a(453)]()[a(544)]()),RSEngine[a(529)][a(453)]()[a(450)]());RSEngine[a(529)].saveUserData(a(466));this._popupList.push(function(){RSEngine[a(445)][a(509)](new XPBlastRewardPopup)}[a(513)](this))}if(b[a(543)].events[c][a(462)][a(524)]&& (b[a(543)].events[c][a(462)][a(524)][a(558)]==a(451)?(this._machineUnlockObject[a(439)]=!0,this[a(526)].duration=b.result[a(471)][c][a(520)],this[a(549)]=setInterval(this._allSlotTimer.bind(this),1E3)):b[a(543)][a(471)][c][a(462)][a(524)][a(558)]==a(464)&&(this[a(526)][a(464)]=b[a(543)].events[c].data[a(524)][a(464)]),b[a(543)][a(471)][c][a(462)][a(524)][a(558)]==a(476)&&RSEngine[a(569)]!==LOGIN_MODE[a(486)]&&0==RSGame[a(515)]()[a(566)]()[a(453)]()[a(568)]()%5))this[a(551)][a(516)](function(){var b= RSGame.getInstance()[a(496)]()[a(481)]();RSGame.getInstance()[a(525)]()[a(474)](b)}[a(513)](this))}},onLTEMInfoDataLoadingFailed:function(){cc[a(444)](a(505));RSErrorTracker[a(515)]()[a(469)](a(553),a(487),"mahesh.jose@rubyseven.net,lijith.puthiyoottil@rubyseven.net");RSEngine.gameData[a(480)](this[a(497)][a(513)](this),this[a(479)][a(513)](this),"infoPopup")},onUrlRewardRespone:function(b){this._retryCount=0;this[a(482)]();if(b[a(543)]){null!=b[a(543)].reward&&b.result[a(521)].urlType&&(this[a(546)]= RSEngine.gameData[a(561)](b.result.reward.urlType));if(b.result[a(537)]==a(563)){if(null!=b[a(543)][a(521)]){this[a(550)]=new RewardsVO(b[a(543)].reward);void 0!=b[a(543)][a(562)]&&(this[a(541)]=JSON[a(523)](b[a(543)].powerUps),RSEngine[a(529)][a(453)]()[a(570)](this._powerupObject));if(b[a(543)].reward){if(parseInt(b[a(543)][a(521)][a(489)])){if(this[a(550)][a(489)]=parseInt(b.result[a(521)][a(489)]),this[a(461)]=!0,this[a(493)]=1,this[a(500)]=b[a(543)][a(536)],RSEngine.loginMode==LOGIN_MODE.GUEST){var c= {trackingId:null,coins:null};c[a(442)]=this._trackingId;c[a(489)]=parseInt(b[a(543)][a(521)][a(489)]);RSGame[a(515)]()[a(566)]()[a(453)]()[a(514)](a(576),c);cc[a(444)](a(512))}}else this._rewardVO[a(489)]=0;b[a(543)][a(521)].powerup?(this._rewardVO[a(455)]=b[a(543)][a(521)][a(455)],b[a(543)][a(521)][a(454)]&&(this[a(499)]=b.result[a(521)].powerups),this.linkRewardsEnabled=!0,this[a(493)]=1):this._rewardVO[a(455)]="";parseInt(b.result[a(521)][a(573)])?(this[a(550)].energy=parseInt(b.result[a(521)][a(573)]), this.linkRewardsEnabled=!0,this[a(493)]=1):this[a(550)].energy=0}b[a(543)][a(478)]&&(this[a(550)][a(478)]=b[a(543)][a(478)]);b[a(543)][a(494)]&&(this[a(550)].opt_value2=b[a(543)][a(494)]);b[a(543)][a(521)].urlType==a(531)&&(this.linkRewardsEnabled=!0,this[a(493)]=4,this[a(456)]=b[a(543)][a(531)],RSEngine[a(529)][a(453)]()[a(475)](this[a(456)]));if(b[a(543)][a(521)].xp_blast){this[a(550)][a(494)]=a(460);this[a(437)]=new RewardsVO(b[a(543)].reward[a(460)]);this[a(564)]=this[a(437)][a(485)]+TimeManager[a(515)]().getCurrentServerTime(); if(RSEngine[a(529)][a(453)]().getXpBlastEndTime()>=this[a(564)])return;RSEngine.dataManager.getMe().setXpBlastEndTime(this[a(564)]);RSEngine[a(529)][a(453)]()[a(532)](this[a(437)][a(504)]);RSEngine[a(529)][a(453)]()[a(542)](this[a(437)][a(485)]);c="";c=this[a(545)]?"appboy":a(468);RSEngine[a(529)][a(453)]()[a(530)](c);RSEngine[a(529)][a(519)](a(466));RSAnalyticsManager.getInstance()[a(463)](a(460),a(492),c,60*RSEngine.dataManager[a(453)]()[a(544)](),RSEngine.dataManager[a(453)]()[a(450)]());this[a(461)]= !0;this[a(493)]=1}b[a(543)][a(521)][a(524)]&&(MachineGiftingManager.getInstance()[a(473)](b[a(543)].reward.metatype,b[a(543)][a(537)],b[a(543)][a(521)].unlockedGifts_),this[a(461)]=!0,this[a(493)]=5)}}else"invalid"==b[a(543)][a(537)]?this[a(461)]=!1:b[a(543)][a(537)]==a(533)?(this.linkRewardsEnabled=!0,this.linkRewardsSatus=2):(this[a(461)]=!0,this.linkRewardsSatus=3);5!=this[a(493)]&&this[a(574)]()&&this[a(567)]();this[a(545)]&&this[a(440)]()}this.urlRewardCallBack&&this[a(565)](a(548))},showPopups:function(b){this._onPopUpCloseCallBack= b;5==this.linkRewardsSatus&&MachineGiftingManager[a(515)]()[a(440)]();for(!this._popupList[a(506)]&&this[a(577)]&&(this[a(577)](),this[a(577)]=null);0=this[a(526)][a(470)]&&(clearInterval(this[a(549)]),this._machineUnlockObject={duration:0,allMachineUnlock:!0,machinesToUnlock:[]})},getMachineUnlockStatus:function(a){return this._machineUnlockObject.allMachineUnlock? !0:0<=this._machineUnlockObject.machinesToUnlock.indexOf(a)?!0:!1},getMachineUnlockDurationInSeconds:function(){return this[a(526)][a(470)]},getAllMachineUnlockStatus:function(){return this[a(526)][a(439)]},getXpRewardStatus:function(){return TimeManager.getInstance()[a(540)]()RSEngine[a(529)].getMe()[a(507)]()||0==RSEngine[a(529)][a(453)]()[a(507)]()?this._xpBlastVO=new RewardsVO({xp_duration:0,xp_multiplier:1}):this[a(437)]=new RewardsVO({xp_duration:RSEngine.dataManager[a(453)]()[a(544)](),xp_multiplier:RSEngine[a(529)][a(453)]()[a(450)]()}),this[a(437)]},onUrlRewardFetchFailed:function(){3>this._retryCount?(this._retryCount++, this[a(457)](this[a(501)],this[a(545)],this[a(565)])):(this[a(517)]=0,this[a(482)](),this[a(565)]&&this[a(565)](a(548)),cc[a(444)](a(560)))},onUrlRewardDataFetchFailedForGuestPlayers:function(){3>this[a(517)]?(this[a(517)]++,this.getUrlRewardNotificationDataForGuestPlayers(this[a(501)],this._fromAppboy,this.urlRewardCallBack)):(this[a(517)]=0,this[a(482)](),this.urlRewardCallBack&&this[a(565)](a(548)),cc.log("URL REWARDING FAILED\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x3c\x3e\x3e\x3e\x3e\x3e\x3e\x3e\x3e\x3e\x3e\x3e\x3e\x3e\x3e\x3e"))}, checkTheTrackingIdIsFromGuestUserOrNot:function(){if(RSEngine[a(569)]!=LOGIN_MODE[a(486)]&&RSEngine[a(569)]!=LOGIN_MODE.FACEBOOK){var b=RSGame.getInstance().getUserDataManager()[a(453)]()[a(518)](a(576));if(b){if(b.trackingId!=this._trackingId)return!0}else return!0;RSAnalyticsManager[a(515)]()[a(438)](a(483),a(446),b.coins,"","");RSAnalyticsManager[a(515)]().trackGUIEvent(a(483),a(436),b[a(489)],"","");1==this[a(493)]&&(RSAnalyticsManager[a(515)]().trackPrimarySource(RSAnalyticsSource[a(572)],a(502), parseInt(UrlNotificationManager[a(515)]()[a(550)][a(489)]),a(448)),UrlNotificationManager[a(515)]()[a(550)][a(455)]&&RSAnalyticsManager[a(515)]().trackSecondarySource(RSAnalyticsSource[a(572)],a(502),parseInt(UrlNotificationManager[a(515)]()[a(550)][a(455)]),a(448)));RSEngine[a(529)][a(511)](this[a(539)][a(513)](this));return RSGame[a(515)]()[a(566)]()[a(453)]()[a(514)](a(576),{trackingId:null,coins:null},!0),!1}return!0},onCoinUpdate:function(){RSCasinoManager[a(552)](0)},onPopupClosed:function(){this[a(577)]&& (this[a(577)](),this._onPopUpCloseCallBack=null)}});return{getInstance:function(){return!b&&(b=new c),b}}}();var GameVariables=RSClass.extend({_isPurchaseEnabled:!0,_sevenDayBonusData:{},_time:0,_userGroup:"",_isGDPR:!1,_gdprUrl:"",_backgroundSessionTimeout:0,_isSubscriptionEnabled:0,_gcowRewardedCount:0,_isCCPA:!1,_isFPVPUserMigrated:!1,init:function(){this._super.init.call(this)},initializeData:function(a){this._time=a.time?a.time:0;this._isPurchaseEnabled=a.isPurchaseEnabled;this._userGroup=a.user_group?a.user_group:"A";this._sevenDayBonusData=a.sevenDayBonus?a.sevenDayBonus:null;this._isGDPR=a.isGDPR; this._gdprUrl=a.GDPRUrl;this._isCCPA=a.isCCPA?a.isCCPA:!1;this._backgroundSessionTimeout=a.backgroundSessionTimeout;this._loyaltyUrl=a.loyaltyUrl?a.loyaltyUrl:null;this._gameDataSource=a.gameDataSource?a.gameDataSource:"A";this._isSweepstakesEnabled=a.isSweepstakesEnabled?a.isSweepstakesEnabled:!1;this._isSubscriptionEnabled=a.isSubscriptionEnabled?a.isSubscriptionEnabled:0;this._gcowRewardedCount=a.gcowRewardedCount?parseInt(a.gcowRewardedCount):0;this._isFPVPUserMigrated=a.isFPVPUserMigrated?a.isFPVPUserMigrated: !1;this._isRSVPMigrated=a.isRSVPMigrated?a.isRSVPMigrated:!1},isGDPR:function(){return this._isGDPR},getGDPRUrl:function(){return this._gdprUrl},isPurchaseEnabled:function(){return this._isPurchaseEnabled},getTimeOnInit:function(){return this._time},getSevenDayBonusData:function(){return this._sevenDayBonusData},isSubscriptionEnabled:function(){return this._isSubscriptionEnabled},getUserGroup:function(){return this._userGroup},getBackgroundSessionTimeout:function(){return this._backgroundSessionTimeout}, getLoyaltyUrl:function(){return this._loyaltyUrl},getgameDataSource:function(){return this._gameDataSource},getSweepstakeEnabledStatus:function(){return this._isSweepstakesEnabled},isRSVPMigrated:function(){return this._isRSVPMigrated},isCCPA:function(){return this._isCCPA},incrementGCOWRewardedCount:function(){this._gcowRewardedCount++},geGCOWRewardedCount:function(){return this._gcowRewardedCount},getFPVPUserMigratedStatus:function(){return this._isFPVPUserMigrated}});var IScreenFactory=new Interface("IScreenFactory","getLoadingScreen getMachineLoaderScreen getMainLobbyScreen getBingoSubLobby getSlotsSubLobby getPokerSubLobby getBlackjackSubLobby getKenoSubLobby getBonusSubLobby getVipSubLobby getFavoritesSubLobby getTableGamesSubLobby".split(" ")),RSGameTypes={Slots:"slots",Poker:"poker",Bingo:"bingo",Blackjack:"blackjack",Trivia:"trivia",Keno:"keno",Roulette:"roulette",Scratcher:"scratcher",Scorebox:"scorebox",TableGames:"tablegames"},RSGame=function(){var a, b=RSClass.extend({_tutorialManager:null,_isScreenFactorySet:!1,_idPrefix:"",_dataManager:null,_gameData:null,_gameManager:null,_loadingManager:null,_gameTypeFactor:127,_timeManager:TimeManager.getInstance(),_rsPwa:null,_hardwareInfo:null,_loginMode:null,_platformType:null,_urlNotificationManager:UrlNotificationManager.getInstance(),_errorTracker:RSErrorTracker.getInstance(),_analyticsManager:RSAnalyticsManager.getInstance(),_levelManager:null,_platformEventManager:null,_gameVariables:new GameVariables, _gameConfiguration:null,_gameFolderList:{},_resourceConfigData:null,_resourceGroupConfigData:null,_losingStreakManager:null,_getInitCalled:!1,_initialResourcesLoaded:!1,_customLobbyResources:[],_customLobbyRetryCount:0,_languageConfigData:null,init:function(){this._super.init.call(this)},setPlatform:function(a){RSEngine.layout=a.LAYOUT_SUFFIX;RSEngine.screenWidth=a.SCREEN_WIDTH;RSEngine.screenHeight=a.SCREEN_HEIGHT;this._platformType=a.PLATFORM;this._loginMode=RSEngine.loginMode;RS_ERROR_TRACKER_SHOW_DEBUG_LOG= a.SHOW_DEBUG_LOG},initialize:function(a,b,e){this._gameConfiguration=b;this._resourceConfigFile=e;RSGame.getInstance().populateHardwareInfo();RSGameScreenManager.getInstance().setScreenFactory(b.getScreenFactory());this._isScreenFactorySet=!0;a&&(RSEngine.userConfig=a,RSEngine.loginMode=a.loginMode,GameFeatureTypeEnum.CLIENT_SIDE_SIGNIN&&(RSLoginManager.getInstance().isURLParamsPresent()&&RSLoginManager.getInstance().fetchURLParamsAndSetCookieToNewDomain(),RSLoginManager.getInstance().initFormValidation())); cc.log("Initializing RSEngine");this.setPlatform(GameConfig);this._idPrefix=GameConfig.USER_ID_PREFIX;a=void 0;RSEngine.loginMode==LOGIN_MODE.INSTANT_GAME&&(a="Portrait");RSEngine.initialize(GameConfig.PLATFORM,GameConfig.LAYOUT_SUFFIX,a,void 0,this.isFBGameRoom());RSEngine.initializeNetworkManager(GameConfig.JSON_RPC_PATH);RSEngine.setHashKey(GameConfig.HASH_KEY);RSEngine.setGameVersion(GameConfig.VERSION);this.setCustomManagers(b.getUserDataManager(),b.getGameData(),b.getLevelManager(),b.getGameManager(), b.getPlatformEventManager());GameConfig.CUSTOM_LOBBY?this.getCustomLobbyEventFromDashboard(null):this.continueLoadingAfterFetchingCustomLobby()},getCustomLobbyEventFromDashboard:function(a){var b={};b.user_id=a;RSEngine.networkManager.getEventStatusFromDashBoard("getCustomAssets",b,this.customLobbyResponseSuccess.bind(this),this.continueLoadingAfterFetchingCustomLobby.bind(this))},customLobbyResponseSuccess:function(a){this._modifiedData=null;null!=a&&void 0!=a.data&&(GlobalVars.customLobbyStatus= !0,this._modifiedData=RSUtils.cloneJSON(this.modifyJsonFormat(a.data)));null!=this._modifiedData?null==RSEngine.dataManager.getMe()?(this.modifyResourceConfigWithCustomLobbyData(),this.continueLoadingAfterFetchingCustomLobby()):(this._customLobbyResources=this.getCustomLobbyAssetList(a.data),this.startCustomLobbyAssetLoading(),this.modifyResourceConfigWithCustomLobbyData()):null==RSEngine.dataManager.getMe()&&this.continueLoadingAfterFetchingCustomLobby()},startCustomLobbyAssetLoading:function(){var a= this;cc.loader.load(a._customLobbyResources,function(a,b,c){console.log("loading success")},function(b){b&&a._onErrorLoading(b)})},_onErrorLoading:function(a){this._customLobbyRetryCount++;if(3>=this._customLobbyRetryCount){for(var b=this.resources.length=0;b=this._screens.length)){do this._removedLobbyName=this._screens[this._screens.length- 1],this._screens.pop(),RSAnalyticsManager.getInstance().popCurrentScreen();while(this._screens[this._screens.length-1]==RSGameScreens.Machine);var a=this._screens[this._screens.length-1];this.load(a);this.updateCoinXpLevelToPlatform(a)}},load:function(a){var b,e;switch(a){case RSGameScreens.MainLobby:b=this._screenFactory.getMainLobbyScreen();e=[];break;default:var f=!1,g;for(g in RSGameScreens.CustomScreens)if(a==RSGameScreens.CustomScreens[g]){f=!0;b=this._screenFactory.getSubLobby(g);e=this._screenFactory.getResourceListLobby(g); break}f||(b=this._screenFactory.getSubLobby(a),e=this._screenFactory.getResourceListLobby(a))}this._removedLobbyName!=RSGameScreens.Machine&&(f=null,f=this._oldLobbyName?this._oldLobbyName:RSGameScreenManager.getInstance().getPreviousScreen(),RSGameScreenManager.getInstance().getCurrentScreen()==RSGameScreens.MainLobby&&null!==this._removedLobbyName&&(this._oldLobbyName=null,f=this._removedLobbyName),RSAnalyticsManager.getInstance().trackLobbyEntry(a,"","open_from_"+f),this._oldLobbyName==RSGameScreens.JackpotMainLobby&& (this._oldLobbyName=null));this._removedLobbyName=null;null==RS_SCREEN_LOADED[a]?(RS_SCREEN_LOADED[a]=!0,RSEngine.screenManager.loadNewScreen(new RSSecondaryLoadingScreen(e,b))):RSEngine.screenManager.loadNewScreen(b)},getCurrentScreen:function(){return this._screens[this._screens.length-1]},getPreviousScreen:function(){return 1c){f=g;break}for(g=f;g=c&&0===parseInt(b[e][a(328)]))if(b[e][a(144)](a(467))){if(b[e][a(467)]==MACHINE_STATUS.ENABLED){d[a(288)](b[e]);break}}else{d.push(b[e]);break}return d?d:[]},_setUnlockObjFromBlob:function(){for(var a=a0_0x3351, b=0;7>b;b++)if(RSGame[a(241)]()[a(657)]()[a(341)]()[a(287)](b)){var c=RSGame[a(241)]()[a(657)]()[a(341)]().getMachineUnlockList(b)[a(618)](2)[a(346)]("")[a(492)]()[a(284)]();if(parseInt(c[a(671)]("")))for(var d=0;db;b++){var c=this[a(546)]["unlockList"+b].slice();RSGame[a(241)]()[a(657)]()[a(341)]().setMachineUnlockList(b,parseInt(c[a(284)]().join(""),2))}},setGameType:function(a){this[a0_0x3351(195)]= a},getGameType:function(){return this[a0_0x3351(195)]},setCurrentMachine:function(a){var b=a0_0x3351;GlobalVars[b(395)]=!0;this[b(154)]=a},getCurrentMachine:function(){return this._currentMachine},setCurrentMachineVO:function(a){this[a0_0x3351(300)]=a},getCurrentMachineVO:function(){return this[a0_0x3351(300)]},getCurrentMachineAnalyticsName:function(){return this[a0_0x3351(494)]},calculateAverageBet:function(a,b){var c=a0_0x3351;0=RSGame[c(241)]().getUserDataManager()[c(341)]()[c(158)]()&& RSEngine[c(200)][c(554)](RSGame[c(241)]()[c(657)]()[c(341)]()[c(158)](),this.onEmailOptoutSuccess.bind(this),this[c(676)].bind(this))},setLocationAndWebhookForCleverTap:function(){var a=a0_0x3351;RSEngine[a(572)]==LOGIN_MODE[a(459)]?(postMessage({type:a(382),data:""},"*"),postMessage({type:a(168),data:""},"*")):(parent[a(514)]({type:"getClevertapLocationPermission",data:""},"*"),parent.postMessage({type:a(168),data:""},"*"))},_successCallBack:function(a){var b=a0_0x3351;a[b(275)].status==b(301)&& (GlobalVars.CallCCPA=!1,null!=this._optOutStatus&&1>=this[b(201)]&&RSEngine.dataManager[b(554)](RSGame[b(241)]().getUserDataManager()[b(341)]()[b(158)](),this[b(368)][b(635)](this),this[b(676)][b(635)](this)))},setOptOutStatusFromCCPA:function(a){this._optOutStatus=a},getOptOutStatusFromCCPA:function(){return this[a0_0x3351(201)]},_failedCallBack:function(){var a=a0_0x3351;RSEngine[a(200)].setCCPA(this[a(296)],this[a(753)].bind(this),this[a(608)][a(635)](this))},onEmailOptoutSuccess:function(){var a= a0_0x3351,b=0==this[a(201)]?a(215):a(386),c=RSGame.getInstance()[a(396)]().isCCPA()?a(611):a(708);RSAnalyticsManager[a(241)]()[a(624)](a(305),b,c,"","");this[a(201)]=null;cc.log(a(590))},onEmailOptoutFailed:function(){var a=a0_0x3351;this[a(455)]++;3>=this[a(455)]?1>RSGame[a(241)]().getUserDataManager().getMe()[a(158)]()&&RSEngine[a(200)][a(554)](RSGame[a(241)]()[a(657)]().getMe()[a(158)](),this[a(368)][a(635)](this),this.onEmailOptoutFailed.bind(this)):RSErrorTracker[a(241)]()[a(414)]("optout error", a(261),a(280))},initializeGameSpecificCallbacks:function(){var a=a0_0x3351;RSEventManager.getInstance()[a(326)]("onSaleClosed",this,this[a(308)].bind(this))},showPurchaseCartAfterSalePopupClose:function(a){var b=a0_0x3351,c=!1;a&&(!0==a._userData.forceShow?c=!0:c=!1);if(!1==PurchaseFlowManager[b(241)]()[b(225)]())PurchaseFlowManager.getInstance()[b(591)](!0);else this[b(331)](c)},onPlatformSDKManagerCallback:function(a,b){var c=a0_0x3351;if(RSEngine[c(572)]==LOGIN_MODE[c(359)])return!0;switch(a){case c(677):switch(b){case "PURCHASE_CART":this[c(331)](); break;case c(260):this[c(253)]();break;case c(502):RSSubscrptionSaleManager[c(361)]("appinbox");break;case c(315):RSTournamentManager[c(197)](!0)}break;case c(701):case "xp_blast":UrlNotificationManager[c(241)]().trackUrlRewardNotification(b,!0);break;case c(160):this._navigateToLobby=b,this[c(571)]()}},showPurchaseCart:function(){},showSalesPopup:function(){},getApprovalForNavigation:function(){},platformSDKScreenNavigation:function(a){},callScreenNavigation:function(){},confirmBackButtonStatus:function(){}, updateTopHUDWithMessageCount:function(a){var b=a0_0x3351;RSCasinoManager[b(741)]()[b(470)](a)},showPokerOpenGraphPopup:function(a,b){},showOverlayLayer:function(){RSEngine.screenManager[a0_0x3351(478)]()},hideOverlayLayer:function(){var a=a0_0x3351;RSEngine[a(625)][a(207)]()},getAristocratHUD:function(){var a=a0_0x3351;return new AristocratHUD(RSGame[a(241)]()[a(352)]("AristocratHud"))},setCasinoHUD:function(){var a=a0_0x3351;RSCasinoManager[a(416)](this[a(741)]())},getCasinoHUD:function(){var a= a0_0x3351;return new TopHUD(RSGame[a(241)]()[a(352)](a(406)))},getSlotMachineRootPath:function(){return"res/SlotResources/SlotMachines/"},getContentResourceRootFolder:function(){return a0_0x3351(541)},getMachineUnlockOGRootFolder:function(){return"res/SlotResources/Sublobby/icons/"},tutorialComplete:function(){var a=a0_0x3351;RSGame[a(241)]()[a(657)]()[a(341)]()[a(388)]()},updateCoinXpLevel:function(){var a=a0_0x3351,b=RSGame[a(241)]()[a(657)]()[a(341)]().getCoins(),c=RSGame[a(241)]()[a(657)]()[a(341)]()[a(498)](), d=RSGame[a(241)]().getUserDataManager()[a(341)]()[a(313)]();RSPlatformSDKManager.getInstance()[a(580)](b,c,d)},notifySalePurchaseResponseToCasino:function(a,b,c,d){var e=a0_0x3351;null!=RSCasinoManager[e(137)]&&RSCasinoManager[e(137)][e(366)](a,b,c,d)},showPurchaseUI:function(a,b,c,d){var e=a0_0x3351;null!=RSCasinoManager._customCasinoInterface&&RSCasinoManager[e(137)][e(505)](a,b,c,d)},setLoadingStartTime:function(){var a=a0_0x3351;this._startTime=TimeManager[a(241)]()[a(130)]()},calculateLoadingTime:function(a){var b= a0_0x3351;if(null!=this[b(114)]){var c=TimeManager[b(241)]().getCurrentServerTime()-this[b(114)],c=Math[b(240)](c);this[b(114)]=null;RSAnalyticsManager.getInstance()[b(574)](c,a)}},getDefaultCasinoFont:function(a,b,c){var d=a0_0x3351,e=null;"stroke"==c?e=RSGame[d(241)]()[d(352)](d(517)+a+"_"+b+"_"+c):e=RSGame[d(241)]()[d(352)](d(517)+a+"_"+b);return e?e:RSGame.getInstance().getAssetPath(d(292))},getDefaultCasinoFontForHeading:function(){return null},getPurchaseCartVipExtraCoinFont:function(){return null}, getDefaultFontForDailyQuestTimerandCoinText:function(){return null},getOgUnlockAssetPath:function(){return GameConfig[a0_0x3351(518)]+"/assets/"},getSlotMachineIconRootPath:function(){return a0_0x3351(614)},getCasinoName:function(){return"Lucky North Casino"},showActionShare:function(a,b){var c=a0_0x3351;RSActionShareManager.getInstance()[c(531)](a,b)},getLeaderboardGameType:function(){var a=a0_0x3351;return RSGame.getInstance()[a(542)]()[a(347)]()},getFandFPurchaseRemainingTime:function(){return 0}, getHashValueForInternalGames:function(a){var b=a0_0x3351;return calcMD5(a[b(671)]("|")+b(340))},getApiTokenValues:function(){var a=a0_0x3351;RSEngine[a(572)]!=LOGIN_MODE[a(359)]&&RSGame[a(241)]()[a(657)]().getApiToken(this[a(578)][a(635)](this),this.spinGameTokenFail[a(635)](this))},spinGameTokenSuccess:function(a){var b=a0_0x3351;this[b(595)]=a[b(275)][b(536)];this[b(374)]=a[b(275)].everiLaunchToken;a.result[b(532)]&&(this[b(594)]=a.result[b(532)]);a.result[b(610)]&&(this[b(304)]=a[b(275)][b(610)]); a[b(275)][b(349)]&&(this[b(239)]=a[b(275)][b(349)]);a.result[b(142)]&&(this[b(204)]=a[b(275)][b(142)]);a[b(275)].high5GamesLaunchToken&&(this._highFiveToken=a[b(275)][b(613)]);a[b(275)][b(450)]&&(this._rocketManToken=a.result[b(450)]);a[b(275)][b(233)]&&(this[b(655)]=a.result[b(233)]);a[b(275)][b(294)]&&(this[b(699)]=a.result[b(294)]);a[b(275)][b(214)]&&(this._yfageoToken=a.result[b(214)])},spinGameTokenFail:function(a){this[a0_0x3351(609)]()},getSpinGameToken:function(){return this[a0_0x3351(595)]}, getEveriGameToken:function(){return this[a0_0x3351(374)]},getAGSGameToken:function(){return this._agsGameToken},getRisingDigitalGameToken:function(){return this._risingDigitalToken},getOddsWorksGameToken:function(){return this._oddsWorksToken},getWazdenRGSGameToken:function(){return this[a0_0x3351(204)]},getHighFiveGameToken:function(){return this[a0_0x3351(552)]},getRocketManGameToken:function(){return this[a0_0x3351(512)]},getAinsworthGameToken:function(){return this._ainsworthToken},getFincoreGameToken:function(){return this[a0_0x3351(699)]}, getYfageoGameToken:function(){return this[a0_0x3351(593)]},setUserAttributeNextSlotToBeUnlocked:function(){var a=a0_0x3351,b=RSGame[a(241)]()[a(295)]()[a(483)](RSGameTypes[a(506)]),c,d=b[a(211)];for(c=0;cd&&(d=g,c=b[e])}return 0==d&&(c=this.getDefaultMachine(a(721),a(124))),c},getMostPlayedMachineInSlots:function(){var a=a0_0x3351,b=RSGame[a(241)]().getGameData()[a(483)](RSGameTypes[a(506)]);if(b){var c=0,d="",e="",f=RSEngine[a(200)][a(341)]()[a(627)](),g,h=b.length;for(g=0;g c&&(m>=b[g].levelRequired||parseInt(b[g].VIPTier)<=n&&0c&&(c=k,d=b[g][a(264)],e=b[g].machineDisplayName)}return""!=d?{machine_identifier:d,machine_type:"scratcher",count:c,machineDisplayName:e}:{machine_identifier:b[0][a(264)],machine_type:a(384),count:c,machineDisplayName:b[0][a(665)]}}},getMostPlayedMachineInBingo:function(){var a=a0_0x3351,b=RSGame[a(241)]().getGameData().getMachineDetails(RSGameTypes[a(713)]);if(b){var c=RSEngine.dataManager[a(341)]()[a(731)](),d,e=0,f= "",g="";if(null!=c){for(var h in c)c[h]>e&&(e=c[h],d=h);if(null!=d)return g=this[a(117)](d,b),{machine_identifier:d,machine_type:a(482),count:e,machineDisplayName:g};f=b[0][a(264)];g=b[0][a(183)];return{machine_identifier:f,machine_type:a(482),count:e,machineDisplayName:g}}return f=b[0][a(264)],{machine_identifier:f,machine_type:a(482),count:e,machineDisplayName:b[0][a(665)]}}},getMostPlayedMachineInPoker:function(){var a=a0_0x3351,b=RSGame.getInstance().getGameData()[a(483)](RSGameTypes[a(688)]); if(b){var c=0,d="",e="",f=RSEngine[a(200)].getMe()[a(334)](),g,h=b[a(211)];for(g=0;gc&&(c=k,d=b[g][a(264)],e=b[g][a(665)])}return""!=d?{machine_identifier:d,machine_type:a(243),count:c,machineDisplayName:e}:{machine_identifier:b[0][a(264)],machine_type:a(243),count:c,machinedisplayName:b[0][a(665)]}}},getMostPlayedMachineInKeno:function(){var a=a0_0x3351,b=RSGame[a(241)]().getGameData()[a(483)](RSGameTypes.Keno);if(b){var c=0,d="",e="",f,g=b[a(211)],h= RSEngine[a(200)].getMe()[a(481)]();for(f=0;fc&&(c=k,d=b[f][a(264)],e=b[f][a(665)])}return""!=d?{machine_identifier:d,machine_type:a(581),count:c,machineDisplayName:e}:{machine_identifier:b[0][a(264)],machine_type:a(581),count:c,machineDisplayName:b[0][a(665)]}}},getMostPlayedMachineInBlackJack:function(){var a=a0_0x3351,b=RSGame[a(241)]()[a(295)]().getMachineDetails(RSGameTypes[a(311)]);if(b){var c=0,d="",e="",f,g=b.length,h=RSEngine[a(200)].getMe().getBlackjackDealCount(); for(f=0;fc&&(c=k,d=b[f][a(264)],e=b[f].machineDisplayName)}return""!=d?{machine_identifier:d,machine_type:a(121),count:c,machineDisplayName:e}:{machine_identifier:b[0][a(264)],machine_type:a(121),count:c,machineDisplayName:b[0][a(665)]}}},_getMachineUseCount:function(a,b){return null!=b[a]?b[a]:0},getMachinesPlayed:function(a){var b=a0_0x3351;a=RSGame[b(241)]()[b(295)]()[b(483)](a);var c=RSEngine[b(200)].getMe().getPokerDealCount();if(RSUtils[b(238)](c))return 0; var d,e=a[b(211)],f=0;for(d=0;d=e&&(e=600,g=e+d+7,parent[c(514)]({type:"changeFrameHeight",height:g},"*"));b.style.border=c(324); b[c(425)][c(180)]=d+"px";b[c(425)][c(257)]=e+"px"}else b[c(425)][c(180)]=0.102*parseInt(this._parentDiv[c(425)][c(257)][c(673)](0,this[c(277)][c(425)].height[c(211)]-2))+"px",b.style[c(257)]=0.892*parseInt(this[c(277)].style.height[c(673)](0,this[c(277)].style.height[c(211)]-2))+"px"},getLoyaltyMallStatus:function(){return this[a0_0x3351(544)]},loadPreviousScreen:function(){},dailyBonusCollectCallback:function(){},playMusicWithFadeIn:function(a,b,c){var d=a0_0x3351;RSEngine[d(549)].setMusicVolume(0.2); RSEngine[d(549)].playMusic(a,b);c&&RSEngine[d(549)][d(387)](1.5,c);this[d(526)]()},playButtonClickSFX:function(){},initializeMachineOpenPopup:function(a){if(a instanceof Object)for(var b in a)this._machineOpenPopupAssets[b]=a[b];else this._machineOpenPopupAssets.iconPath=a},setLocationForMachineOpenPopup:function(a,b){var c=a0_0x3351;this.machineOpenX=a;this[c(538)]=b},callMachineOpenPopup:function(a,b,c){var d=a0_0x3351;null==this[d(523)]&&(this.machineOpenX=RSEngine[d(419)]/2);null==this[d(538)]&& (this[d(538)]=RSEngine[d(651)]/2);if(this[d(504)]){var e=this._machineOpenPopupAssets[d(744)];-1==e.indexOf(d(443))&&-1==e[d(733)](d(272))&&(e+=".png");var f=RSGame[d(241)]()[d(295)]()[d(483)](this[d(454)][d(493)],this[d(454)][d(412)]),g=null;null!=f&&(f.iconUrlLarge||f.iconUrlTall)?g=f.iconUrlTall?f[d(509)]:f.iconUrlLarge:g=this[d(413)][RSGame[d(241)]()[d(542)]().getGameType()]+e;a=new MachineOpenPopup(g,this[d(523)],this.machineOpenY,a,b,c);RSEngine[d(732)][d(672)](a,!1,!1,!0);this.machineOpenY= this[d(523)]=null}else this[d(504)]=!0},setMachineOpenPopupStatus:function(a){this[a0_0x3351(337)]=a},getMachineOpenPopupStatus:function(){return this[a0_0x3351(337)]},getIconType:function(){var a=a0_0x3351;return this[a(413)][a(516)]?this[a(413)][a(516)]:null},disableMachineOpenPopup:function(){this._machineOpenPopupEnabled=!1},saveLevelUpReward:function(a){},updateLevelUpReward:function(a){},setSideMenuVisibility:function(a){var b=a0_0x3351;typeof SideMenuController!==b(565)&&SideMenuController.getInstance()[b(452)](a)}, checkAndShowPurchaseFailurePopups:function(a,b){var c=a0_0x3351;this[c(654)]=a;if(RSGame[c(241)]()[c(295)]()[c(433)]()[c(445)])this[c(756)](b);else{var d=RSEngine[c(332)][c(433)]()[c(182)],d=d?d:2;if(this[c(234)]=TimeManager.getInstance().getCurrentServerTime()&&parseFloat(c.syncedCoins/c.coinsPurchased)>=parseFloat(this._LSBonusSheet.lossPercent)&&(RSEngine.externalGameManager.hideToaster(),RSGame.getInstance().getGameManager().showLosingStreakPopup(this._losingStreakPopupClosed.bind(this)),this._isLosingStreakPopupActive= !0))}},_startLSBonusTimer:function(){if(GameFeatureTypeEnum.LOSING_STREAK){var a=this.getLosingStreakingValues();0==a.timerValue&&(a.timerValue=TimeManager.getInstance().getCurrentServerTime()+parseInt(this._LSBonusSheet.time),RSGame.getInstance().getUserDataManager().getMe().setLosingStreakingValues(a),RSGame.getInstance().getUserDataManager().saveUserData("setLosingStreakingValues"))}},_losingStreakPopupClosed:function(){GameFeatureTypeEnum.LOSING_STREAK&&(this._losingStreakPopup=null,void 0!=this._locCallback&& null!=this._locCallback&&(this._locCallback(),this._locCallback=null),this._isLosingStreakPopupActive&&RSGame.getInstance().getGameManager().calculateAverageBet(0),this._isLosingStreakPopupActive=!1,this.setLSBonusValues(0))},setLSBonusValues:function(a){if(GameFeatureTypeEnum.LOSING_STREAK){var b={};b.coinsPurchased=a;b.timerValue=0;b.syncedCoins=0;RSGame.getInstance().getUserDataManager().getMe().setLosingStreakingValues(b);RSGame.getInstance().getUserDataManager().saveUserData("setLosingStreakingValues")}}, getLSBonusSheet:function(){return GameFeatureTypeEnum.LOSING_STREAK?this._LSBonusSheet:null}});var RSMachineLoader=RSMachine.extend({init:function(a,b,c,d,e,f,g){this._super.init.call(this);this._rsLayerObject=null;this._resourceFolders=a.filter(function(a){return a});this._buildTimestamp=b;this._bgURL=d+"?_t\x3d"+this._buildTimestamp;this._nextScreen=c;this._nextScreen.setLoadingDivs(f,e);this._progressDivAdded=!1;e&&(e.style.visibility="visible",this._progressDivAdded=!0);f&&(f.style.visibility="visible");g&&(this._paddingImageURL=g+"?_t\x3d"+this._buildTimestamp);this._bg=null;this._preloadRes= [];this._configCount=0;this._rsLayerObject=new RSScreenLoader;this._rsLayerObject.init();this._lastPostedProgress=this._progress=0;RSEngine.isMobile&&this._rsLayerObject.retain()},loadContent:function(){this._paddingImageURL&&(this.clipScreen(),this.setPaddingForMachine(this._paddingImageURL));var a=SCREEN_SIZES[RSEngine.layout].height,b=SCREEN_SIZES[RSEngine.layout].width;if(RSEngine.orientation==SCREEN_ORIENTATION.PORTRAIT)var c=a,a=b,b=c;this._bg=new RSImageObject(this);this._bg.setName("MachineLoadingImage"); this._bg.setImageFromUrl(this._bgURL,0,0,a,b);this._bg.setCenter(this._rsScreenRect.getWidth()/2,this._rsScreenRect.getHeight()/2);this.addChild(this._bg)},onImageLoaded:function(a){if("MachineLoadingImage"==a.getName())this.onLayoutCompleted();else this._super.onImageLoaded.call(this,a)},onImageLoadFailed:function(a){"MachineLoadingImage"==a.getName()?(a=this.getSize(),this._bg.setImageFromUrl(this._bgURL,0,0,a.getWidth(),a.getHeight())):this._super.onImageLoadFailed.call(this,a)},onReveal:function(){this._super.onReveal.call(this); this.getPreloadResources();RSCasinoManager.notifyMachineLoadingStart()},startPreload:function(){for(var a=this,b=[],c=0;cthis._lastPostedProgress&&(this._lastPostedProgress=this._progress)},onPreloadCompleted:function(){var a=document.getElementById("OrientationInfo");a&&(a.style.display="none");this.loadNextScreen()},loadNextScreen:function(){this.loadNewScreen(this._nextScreen)},unloadContent:function(){this._rsLayerObject.unload();this._super.unloadContent.call(this)},getPreloadResources:function(){for(var a=0;aa.length)&&(b=a.length);for(var e=0,f=Array(b);ed.status,g=f(d.responseText);if(0!==d.status)return g?b(e?function(a,b){var c=JSON.parse(a.responseText),d={status:"success",adid:c.adid,timestamp:c.timestamp,ask_in:c.ask_in,retry_in:c.retry_in,continue_in:c.continue_in, tracking_state:c.tracking_state,attribution:void 0,message:void 0};return m(b,"attribution")&&(d.attribution=c.attribution,d.message=c.message),r(d).filter(function(a){return!!Y()(a,2)[1]}).reduce(n,{})}(d,c):ka(d,"SERVER_CANNOT_PROCESS",!0)):a(ka(d,e?"SERVER_MALFORMED_RESPONSE":"SERVER_INTERNAL_ERROR"));a(ka(d,"NO_CONNECTION"))}}function za(a,b,c){var d=a.url,e=a.method,f=void 0===e?"GET":e;a=a.params;b=function(a,b,c){var d=a.url,e=a.method;a=wa(a.params,b);return{fullUrl:c["/gdpr_forget_device"=== d?"gdpr":"app"]+d+("GET"===e?"?".concat(a):""),encodedParams:a}}({url:d,method:f,params:void 0===a?{}:a},b,c);var g=b.fullUrl,h=b.encodedParams;return new wc(function(a,b){var c=new XMLHttpRequest;c.open(f,g,!0);(function(a,b){var c=[["Client-SDK","js".concat(Ia.version)],["Content-Type","POST"===b?"application/x-www-form-urlencoded":"application/json"]];L.log("REQUEST HEADERS:");c.forEach(function(b){var c=Y()(b,2);b=c[0];c=c[1];a.setRequestHeader(b,c);L.log(xa("REQUEST HEADERS:",b),c)})})(c,f); c.onreadystatechange=function(){return ya(b,a,{xhr:c,url:d})};c.onerror=function(){return b(ka(c,"TRANSACTION_ERROR"))};c.send("GET"===f?void 0:h)})}function na(a,b){return function(a){var b=1=ha.sessionWindow?Xa().then(function(a){var b,c;Ha({url:"/session",method:"POST",params:(b=a.callbackParams,c=a.partnerParams,{callbackParams:b.length?h(b):null,partnerParams:c.length?h(c):null})},{auto:!0})}): (S("attribution:check"),Ba())}function ec(a){var b=Aa();return a||"on"===b?ha.isInitialised()?(fc.send({params:J()({},V.getParams())}).then(function(){S("sdk:gdpr-forget-me")}),!0):(L.log(Nb.pending),!0):(L.log(Nb[b]),!1)}function gc(){var a=ga()||{};return a.reason?a.pending?"pending":"off":"on"}function hc(a){var b=gc();return a||"on"===b?ha.isInitialised()?(Ha({url:"/disable_third_party_sharing",method:"POST"}),!0):(L.log(bb.delayed),!0):(L.log(bb[b]),!1)}function ic(a,b){var c,d,e=ga()||{},f= "start"===b&&a?"start":"finish",g="finish"===b&&e.reason&&!e.pending;return"start"===b&&e.reason||g?(L.log(bb[f].inProgress),!1):(L.log(bb[f].done),d=(c={reason:"general",pending:a},J()({},c)),ca.stores[Ra]=J()(J()({},O()),{},{thirdPartySharingDisabled:d}),G(),!0)}function Cc(){return ic(!1,"finish")}function jc(){"pending"===gc()&&(L.log(bb.running),hc(!0))}function Dc(a){return a?aa.getAll("eventDeduplication").then(function(a){return a.map(function(a){return a.id})}).then(function(b){return-1=== b.indexOf(a)?function(a){var b=ha.getCustomConfig().eventDeduplicationListLimit,c=0=c&&(a=a-c+1,L.log("Event deduplication list limit has been reached. Oldest ids are about to be removed (".concat(a," of them)")),b=aa.trimItems("eventDeduplication",a));return b}).then(function(){return L.info("New event deduplication id is added to the list: ".concat(a)),aa.addItem("eventDeduplication",{id:a})})}(a):Ob.reject({message:"Event won't be tracked, since it was previously tracked with the same deduplication id ".concat(a)})}): Ob.resolve()}function Ec(a){return{clickTime:z(),source:"web_referrer",referrer:decodeURIComponent(a)}}function Fc(){var a=window.location.search.substring(1).split("\x26").map(function(a){return a.split("\x3d")}).reduce(n,{}).adjust_referrer;a&&Ha({url:"/sdk_click",method:"POST",params:Ec(a)})}function Gc(){hc()&&ic(!0,"start")}function Hc(){var a;"paused"===Aa()&&(da({reason:"gdpr",pending:!1},"finish"),ob.all([(a={uuid:"unknown"},V.current=a,aa.clear("activityState").then(function(){return aa.addItem("activityState", a)})),aa.clear("globalParams"),aa.clear("queue")]).then(kc))}function Pb(){pb=Ua=!1;qb=[];$b.clear();ra.running=!1;ra.timestamp=null;ra.pause=null;Lb=!1;V.toBackground();clearInterval(nb);Fa&&(clearTimeout(Mb),Ta.removeEventListener&&Ta.removeEventListener(Fa.visibilityChange,bc,!1));lc.clear()}function cb(a){a&&L.log("Adjust SDK has been shutdown due to asynchronous disable");Pb();Db.forEach(clearTimeout);Db=[];La={};V.destroy();window.removeEventListener&&window.removeEventListener("online",fa, !1);window.removeEventListener&&window.removeEventListener("offline",Na,!1);aa.destroy();ha.destroy()}function kc(){Qb=!1;cb();fc.clear();rb=null;L.log("Adjust SDK instance has been destroyed")}function Ic(a){L.log("Adjust SDK is starting with web_uuid set to ".concat(a.uuid));var b=V.current.installed;"paused"===Aa()&&(L.log(Nb.running),ec(!0));b||jc();a=Aa();var c=function(a){return"Adjust SDK start has been interrupted ".concat(a)};return"off"===a?(cb(),ob.reject({interrupted:!0,message:c("due to complete async disable")})): "paused"===a?(Pb(),ob.reject({interrupted:!0,message:c("due to partial async disable")})):pb?ob.reject({interrupted:!0,message:c("due to multiple synchronous start attempt")}):(Oa({cleanUp:!0}),sa().then(function(){Ua=!1;pb=!0;b&&(mc(),jc())}))}function mc(){Qb=!0;qb.forEach(function(a){"function"==typeof a.method&&(L.log("Delayed ".concat(a.description," task is running now")),a.method(a.timestamp))});qb=[];r(La).some(function(a){var b=Y()(a,2)[1];return b.some(function(a,c){if("sdk:installed"=== a.id)return b.splice(c,1),!0})})}function Jc(a){if(a.interrupted)L.log(a.message);else if(cb(),L.error("Adjust SDK start has been canceled due to an error",a),a.stack)throw a;}function nc(a){"off"!==Aa()?(ha.set(a),window.addEventListener&&window.addEventListener("online",fa,!1),window.addEventListener&&window.addEventListener("offline",Na,!1),T("sdk:installed",mc),T("sdk:shutdown",function(){return cb(!0)}),T("sdk:gdpr-forget-me",Hc),T("sdk:third-party-sharing-opt-out",Cc),T("attribution:check", function(a,b){return c=b,d=V.current,(e=(c||{}).ask_in)||!d.attribution&&d.installed?(lc.send({params:J()({initiatedBy:c?"backend":"sdk"},V.getParams()),wait:e}),V.updateSessionOffset(),Ba()):Rb.resolve(d);var c,d,e}),"function"==typeof a.attributionCallback&&T("attribution:change",a.attributionCallback),(sb?Zb.reject({interrupted:!0,message:"Adjust SDK start already in progress"}):(sb=!0,aa.getFirst("activityState").then(jb).then(function(a){if(a.exists)return sb=!1,a.stored;var b,c=d(V.current)? {uuid:(b=Date.now(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var c=(b+16*Math.random())%16|0;return b=Math.floor(b/16),("x"===a?c:11&c).toString(16)}))}:V.current;return aa.addItem("activityState",c).then(function(){return V.init(c),la(),sb=!1,c})}))).then(Ic).then(Fc).catch(Jc)):L.log("Adjust SDK is disabled, can not start the sdk")}function Ca(a,b){var c=2a.length))return c.addBulk(e,a,!0)}).then(function(){c.indexedDbConnection=f});var e,f}}).reduce(function(a,b){return a.then(b)},oa.resolve())}},{key:"migrateDb",value:function(a,b){var c=this;return this.databaseExists(a).then(function(d){return d?oa.all([c.openDatabase(a,c.dbVersion,c.handleUpgradeNeeded),c.openDatabase(b,c.dbVersion,c.handleUpgradeNeeded)]).then(function(b){b=Y()(b,2);var d=b[0],e=b[1];return c.cloneData(d,e).then(function(){return c.indexedDbConnection=e,d.close(),c.deleteDatabaseByName(a)})}).then(function(){return L.info("Database migration finished")}): c.openDatabase(b,c.dbVersion,c.handleUpgradeNeeded).then(function(a){c.indexedDbConnection=a})})}},{key:"handleUpgradeNeeded",value:function(a,b){var c=a.target.result;a.target.transaction.onerror=b;a.target.transaction.onabort=b;var e=ia.storeNames.left,f=V.current||{},g=f&&!d(f);r(e).filter(function(a){return!Y()(a,2)[1].permanent}).forEach(function(a){var b=Y()(a,2);a=b[0];var b=b[1],d=ia.right[a],h=c.createObjectStore(b.name,{keyPath:d.keyPath,autoIncrement:d.autoIncrement||!1});d.index&&h.createIndex("".concat(d.index, "Index"),d.index);b.name===e.activityState.name&&g?(h.add(H({storeName:a,record:f,dir:Z.left})),L.info("Activity state has been recovered")):ca.stores[b.name]&&(ca.stores[b.name].forEach(function(a){return h.add(a)}),L.info("Migration from localStorage done for ".concat(a," store")))});ba();ca.clear()}},{key:"open",value:function(){var a=this;return this.indexedDbConnection?oa.resolve({success:!0}):this.openDatabase(this.dbName,this.dbVersion,this.handleUpgradeNeeded).then(function(b){return a.indexedDbConnection= b,a.indexedDbConnection.onclose=function(){return a.destroy},{success:!0}})}},{key:"getTransactionStore",value:function(a,b,c){var d,e=a.storeName;a=c.transaction([e],a.mode);c=a.objectStore(e);e=ia.right[I({storeName:e,dir:Z.right})];return e.index&&(d=c.index("".concat(e.index,"Index"))),a.onerror=b,a.onabort=b,{transaction:a,store:c,index:d,options:e}}},{key:"overrideError",value:function(a,b){var c=b.target.error;return a({name:c.name,message:c.message})}},{key:"getCompositeKeys",value:function(a){return a.fields[a.keyPath].composite|| null}},{key:"prepareTarget",value:function(a,b,c){c=-1!==[ma.add,ma.put].indexOf(c);var d=this.getCompositeKeys(a);return d?c?J()(X()({},a.keyPath,d.map(function(a){return b[a]}).join("")),b):b?b.join(""):null:b}},{key:"prepareResult",value:function(a,b){var c=this.getCompositeKeys(a);return c&&e(b)?c.map(function(a){return b[a]}):null}},{key:"initRequest",value:function(a){var b=this,c=a.storeName,d=a.target,e=void 0===d?null:d,f=a.action;a=a.mode;var g=void 0===a?"readonly":a;return this.open().then(function(){return new oa(function(a, d){if(b.indexedDbConnection){var h=b.getTransactionStore({storeName:c,mode:g},d,b.indexedDbConnection),k=h.options,m=h.store[f](b.prepareTarget(k,e,f)),n=b.prepareResult(k,e);m.onsuccess=function(){f!==ma.get||m.result?a(n||m.result||e):d({name:"NotRecordFoundError",message:'Requested record not found in "'.concat(c,'" store')})};m.onerror=function(a){return b.overrideError(d,a)}}else d(b.noConnectionError)})})}},{key:"initBulkRequest",value:function(a){var b=this,c=a.storeName,d=a.target,e=a.action; a=a.mode;var f=void 0===a?"readwrite":a;return!d||d&&!d.length?oa.reject({name:"NoTargetDefined",message:"No array provided to perform ".concat(e,' bulk operation into "').concat(c,'" store')}):this.open().then(function(){return new oa(function(a,g){if(b.indexedDbConnection){var h=b.getTransactionStore({storeName:c,mode:f},g,b.indexedDbConnection),k=h.store,m=h.options,n=[],p=d[0];h.transaction.oncomplete=function(){return a(n)};!function xc(a){a.onerror=function(a){return b.overrideError(g,a)};a.onsuccess= function(){n.push(b.prepareResult(m,p)||a.result);p=d[n.length];n.lengtha[e]:a[e]>b[e],f=(c?c===a[e]:a[e]=d.value&&(d={value:a[e][b],index:e});return d.index}},{key:"deleteBulk",value:function(a,b,c){var d=this;return this.getAll(a).then(function(e){var f= d.getKeys(a),g=ia.right[I({storeName:a,dir:Z.right})].index||f[0];e=d.sort(e,f,c?null:b);var h=d.findMax(e,g,b);if(-1===h)return[];h=e.splice("lowerBound"===c?h:0,c&&"upperBound"!==c?e.length:h+1).map(function(a){return 1===f.length?a[g]:f.map(function(b){return a[b]})});return ca.stores[a]=e,h})}},{key:"trimItems",value:function(a,b){var c=this,d=ia.right[I({storeName:a,dir:Z.right})];return this.getAll(a).then(function(a){return a.length?a[b-1]:null}).then(function(b){return b?c.deleteBulk(a,b[d.keyPath], "upperBound"):[]})}},{key:"count",value:function(a){return this.open().then(function(b){return"error"===b.status?Da.reject(b.error):Da.resolve(ca.stores[a].length)})}},{key:"clear",value:function(a){return this.open().then(function(b){return"error"===b.status?Da.reject(b.error):new Da(function(b){ca.stores[a]=[];b({})})})}},{key:"destroy",value:function(){}},{key:"deleteDatabase",value:function(){}}],[{key:"isSupported",value:function(){if(a.isSupportedPromise)return a.isSupportedPromise;var b=(new Date).toString(), c=window.localStorage;return a.isSupportedPromise=(new Da(function(a){c.setItem(b,b);var d=c.getItem(b)===b;c.removeItem(b);a(!(!d||!c))})).catch(function(){return L.warn("LocalStorage is not supported in this browser"),Da.resolve(!1)}),a.isSupportedPromise}}]),a}();X()(Fb,"isSupportedPromise",null);var $a,Va,Sa="undefined"==typeof Promise?c(3).Promise:Promise;(Va=$a||($a={}))[Va.noStorage=Sb]="noStorage";Va[Va.indexedDB="indexedDB"]="indexedDB";Va[Va.localStorage="localStorage"]="localStorage";var Za, Eb=null,fb,gb,aa=J()({init:ta,getType:function(){return Za}},r({getAll:function(a,b){return a.getAll(b).then(function(a){return R({storeName:b,dir:Z.right,records:a})})},getFirst:function(a,b){return a.getFirst(b).then(function(a){return H({storeName:b,dir:Z.right,record:a})})},getItem:function(a,b,c){return a.getItem(b,K({storeName:b,dir:Z.left,target:c})).then(function(a){return H({storeName:b,dir:Z.right,record:a})}).catch(function(a){return Sa.reject(P({storeName:b,error:a}))})},filterBy:function(a, b,c){return a.filterBy(b,ia.values[c]||c).then(function(a){return R({storeName:b,dir:Z.right,records:a})})},addItem:function(a,b,c){return a.addItem(b,H({storeName:b,dir:Z.left,record:c})).then(function(a){return K({storeName:b,dir:Z.right,target:a})}).catch(function(a){return Sa.reject(P({storeName:b,error:a}))})},addBulk:function(a,b,c,d){return a.addBulk(b,R({storeName:b,dir:Z.left,records:c}),d).then(function(a){return a.map(function(a){return K({storeName:b,dir:Z.right,target:a})})}).catch(function(a){return Sa.reject(P({storeName:b, error:a}))})},updateItem:function(a,b,c){return a.updateItem(b,H({storeName:b,dir:Z.left,record:c})).then(function(a){return K({storeName:b,dir:Z.right,target:a})})},deleteItem:function(a,b,c){return a.deleteItem(b,K({storeName:b,dir:Z.left,target:c})).then(function(a){return K({storeName:b,dir:Z.right,target:a})})},deleteBulk:function(a,b,c,d){return a.deleteBulk(b,ia.values[c]||c,d).then(function(a){return a.map(function(a){return K({storeName:b,dir:Z.right,target:a})})})},trimItems:function(a, b,c){return a.trimItems(b,c)},count:function(a,b){return a.count(b)},clear:function(a,b){return a.clear(b)},destroy:function(a){return a.destroy()},deleteDatabase:function(a){return a.deleteDatabase()}}).map(function(a){a=Y()(a,2);var b=a[1];return[a[0],function(a){for(var c=arguments.length,d=Array(1(f=parseFloat(f))||!g?{}:{revenue:f.toFixed(5),currency:g}));f=J()(J()({},h(k)),h(a.callbackParams));g=J()(J()({},h(m)),h(a.partnerParams));c=(d(f)||(c.callbackParams=f),d(g)||(c.partnerParams=g),J()(J()({},n),c)); e({url:"/event",method:"POST",params:c},{timestamp:b})}).catch(function(a){a&&a.message&&L.error(a.message)});L.error("You must provide event token in order to track event")}(a,b)},{schedule:!0,stopBeforeInit:!0})},addGlobalCallbackParameters:function(a){Ca("add global callback parameters",function(){return Ka(a,"callback")})},addGlobalPartnerParameters:function(a){Ca("add global partner parameters",function(){return Ka(a,"partner")})},removeGlobalCallbackParameter:function(a){Ca("remove global callback parameter", function(){return ib(a,"callback")})},removeGlobalPartnerParameter:function(a){Ca("remove global partner parameter",function(){return ib(a,"partner")})},clearGlobalCallbackParameters:function(){Ca("remove all global callback parameters",function(){return Ea("callback")})},clearGlobalPartnerParameters:function(){Ca("remove all global partner parameters",function(){return Ea("partner")})},switchToOfflineMode:function(){Ca("set offline mode",function(){return Wa(!0)})},switchBackToOnlineMode:function(){Ca("set online mode", function(){return Wa(!1)})},stop:function(){Ga()&&ha.isInitialised()&&cb()},restart:function(){var a;("gdpr"===(a=U()||{}).reason?(L.log("Adjust SDK is disabled due to GDPR-Forget-Me request and it can not be re-enabled"),1):a.reason?(L.log("Adjust SDK has been enabled"),W(null),0):(L.log("Adjust SDK is already enabled"),1))||!rb||nc(rb)},gdprForgetMe:function(){ec()&&Ga("gdpr",!0)&&ha.isInitialised()&&Pb()},disableThirdPartySharing:function(){Ca("disable third-party sharing",Gc,{schedule:!0,stopBeforeInit:!1})}, __testonly__:{destroy:kc,clearDatabase:function(){return aa.deleteDatabase()}}}}]).default});var RSAdjustEventToken={Install:"56etgr",Purchase:"nexwvn",Levelup10:"hnh688",Levelup20:"jl5q7r",FirstPurchase:"pejwka"},RSAdjustManager=function(){var a,b=RSClass.extend({init:function(){this._adjustObj=null},initializeAdjust:function(){if(GameConfig.ADJUST_CUSTOM_EVENT_KEYS)for(var a in GameConfig.ADJUST_CUSTOM_EVENT_KEYS)RSAdjustEventToken[a]=GameConfig.ADJUST_CUSTOM_EVENT_KEYS[a];Adjust.initSdk({appToken:GameConfig.ADJUST_APP_TOKEN,environment:GameConfig.ADJUST_LIVE_MODE?"production":"sandbox", logLevel:"error",logOutput:"#output"});Adjust.restart()},trackSession:function(){},trackEvent:function(a){Adjust.trackEvent({eventToken:a})},trackSessionStop:function(){},trackPurchase:function(a){Adjust.trackEvent({eventToken:RSAdjustEventToken.Purchase,revenue:a,currency:"USD"})}});return{getInstance:function(){a||(a=new b);return a}}}();var RSAppsFlyerManager=function(){var a,b=RSClass.extend({isLive:!1,reInitializeTimer:null,reInitializeCounter:0,init:function(){},initialize:function(a){this.isLive=a;parent.postMessage({type:"appsFlyerInit",data:this.isLive},"*");this.reInitializeTimer=setInterval(this.reInitialize.bind(this),3E3)},reInitialize:function(){null==window.afWebUserId&&4>this.reInitializeCounter?(this.reInitializeCounter+=1,parent.postMessage({type:"appsFlyerInit",data:this.isLive},"*")):(null==window.afWebUserId&&RSErrorTracker.getInstance().trackErrorMessage("AFWEBUSERID", "UserID setting Failed","mahesh.jose@rubyseven.net"),clearTimeout(this.reInitializeTimer),this.reInitializeTimer=null)},setCustomerId:function(a){parent.postMessage({type:"setCustomerUserId",data:a},"*")},trackEvent:function(a,b){parent.postMessage({type:"event",data:{eventType:"EVENT",eventName:a,eventValue:RSGame.getInstance().getGameManager().getAppsFlyerParameters(b)}},"*")},trackPurchase:function(a){}});return{getInstance:function(){a||(a=new b);return a}}}();var RSSalePopupV2=RSPopup.extend({_callBack:null,_assetList:null,_saleDetails:null,_currentPowerPackData:null,_layoutLoadedCount:null,_selectedType:null,_currentPackData:null,_bannerBar:null,_usBannerBar:null,_purchasedTag:[],_purchaseReward:[],_purchasePrice:[],_purchaseRewardData:[],_purchasePriceData:[],_packSelected:0,_popupTimerObject:null,_popupTimerText:null,_saleWidget:null,_timeRemaining:0,_onSaleTriggered:!1,_buttonList:[],_pricePosition:{},_amountTxts:[],_isPurhcaseCart:!1,_openFrom:null, init:function(a,b,c,d){this._layoutLoadedCount=0;this._openFrom=c;this._isPurchaseCart&&RSPlatformFontAssetManager.loadFontConfigFile(RSGame.getInstance().getAssetPath("SaleFontConfigJson"),"SaleCartWidgetFontConfig.json");c=null;c=b?RSSaleManager.getInstance().getSaleCartResourceByName("RSCartPopup")?RSSaleManager.getInstance().getSaleCartResourceByName("RSCartPopup"):RSGame.getInstance().getAssetPath("RSCartPopup"):RSSaleManager.getInstance().getSaleResourceByName("RSSalePopup")?RSSaleManager.getInstance().getSaleResourceByName("RSSalePopup"): RSGame.getInstance().getAssetPath("RSSalePopup");this._assetList=[{name:c,count:1}];this._super.init.call(this,a);this._isPurhcaseCart=b;this._purchasedTag=[];this._buttonList=[];this._purchaseReward=[];this._purchasePrice=[];this._purchaseRewardData=[];this._purchasePriceData=[];this._callBack=a;this._amountTxts=[];this._tag=d;this._selectedType="";this._isCloseButtonClicked=this._onSaleTriggered=!1;RSSalePopupGlobal=this;b||RSEventManager.getInstance().addEventListener("onTimerTick",this,this._setTimerValues.bind(this)); RSEventManager.getInstance().addEventListener("onPurchaseSuccessClosed",this,this.closePopup.bind(this))},getName:function(){return"RSSalePopup"},_setTimerValues:function(a){this._timeRemaining=a._userData.timeRemaining;if(0=this._saleDetails.userPurchasableCount)for(a=0;a=this._saleDetails.userPurchasableCount)for(var g=0;gthis._saleDetails.packs.length?(this.scheduleFunctionOnce(this.startTogglingSection1.bind(this),2.1),RSEventManager.getInstance().dispatchEvent("playTextAndProgressBarZoomAnim")):this._animationSequencerObject.playAnimationWithoutInit("RollUpAnimation"+a,0)},startWinRollup:function(a,b,c){var d=parseInt(c);c=parseInt(this._saleDetails.packs[d].all.value)*(this._currentVoucherMultiplier-1);d=parseInt(this._saleDetails.packs[d].all.value)*this._currentVoucherMultiplier; this.startActionTweenForKey(b,a,c,d)},actionOnUpdate:function(a,b){this[a].setString(RSUtils.formatNumberWithComma(Math.floor(b)))},actionOnComplete:function(a,b){RSGame.getInstance().getUserDataManager().getMe().setLastUnlockedMultiplier(this._voucherID,this._currentVoucherMultiplier);var c=parseInt(a[a.length-1])+1;this.startRollupAnimation(c)},startTogglingSection1:function(){if(this._voucherUnlockCountBadgePanel){this._voucherUnlockCountBadgePanel.setVisible(!1);this._voucherNextUnlockBadge.setVisible(!0); this._voucherNextUnlockBadge.setScaleX(1);this._playFlipAudio&&(RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetPath("Voucher_SFX")+"Circle_flip.mp3",!1),this._playFlipAudio=!1);var a=this._voucherNextUnlockBadge.actionScale(0.25,0.3,1,this._onScaleDownCompletedForBadge1.bind(this));RSTweener.easeSineIn(a)}},_onScaleDownCompletedForBadge1:function(){this._voucherNextUnlockBadge.setVisible(!1);this._voucherUnlockCountBadgePanel.setScaleX(0.3);this._voucherUnlockCountBadgePanel.setVisible(!0); var a=this._voucherUnlockCountBadgePanel.actionScale(0.25,1,1,this.onScaleUpCompletedBadge2.bind(this));RSTweener.easeSineIn(a)},onScaleUpCompletedBadge2:function(){RSUtils.callFunctionWithDelay(2,this,this.startTogglingSection2.bind(this))},startTogglingSection2:function(){this._playFlipAudio&&(RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetPath("Voucher_SFX")+"Circle_flip.mp3",!1),this._playFlipAudio=!1);var a=this._voucherUnlockCountBadgePanel.actionScale(0.25,0.3,1,this.onScaleDownCompletedBadge2.bind(this)); RSTweener.easeSineIn(a)},onScaleDownCompletedBadge2:function(){this._voucherUnlockCountBadgePanel.setVisible(!1);this._voucherNextUnlockBadge.setVisible(!0);this._voucherNextUnlockBadge.setScaleX(0.3);var a=this._voucherNextUnlockBadge.actionScale(0.25,1,1,this.onScaleUpCompletedBadge1.bind(this));RSTweener.easeSineIn(a)},onScaleUpCompletedBadge1:function(){RSUtils.callFunctionWithDelay(2,this,this.startTogglingSection1.bind(this))},playBadgeZoomInAnim:function(){RSEventManager.getInstance().removeListenersForEvent("playBadgeZoomInAnim"); this._voucherNextUnlockBadge.setVisible(!0);this._voucherNextUnlockBadge.setScale(5);this._playFlipAudio=!0;RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetPath("Voucher_SFX")+"Unlock.mp3",!1);var a=this._voucherNextUnlockBadge.actionScale(0.15,1,1);RSTweener.easeSineIn(a)},voucherCountAnim:function(){RSEventManager.getInstance().removeListenersForEvent("playVoucherCountAnim");this._voucherCountScale=this._voucherUnlockCountBadgePanel.getScale();RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetPath("Voucher_SFX")+ "Circle_Glow.mp3",!1);this._voucherUnlockCountBadgeAnim.playAnimation(1,0.5);this._voucherUnlockCountBadgeAnim.setVisible(!0);var a=this._voucherUnlockCountBadgePanel.actionFadeOut(0.6);RSTweener.easeSineIn(a);a=this._voucherUnlockCountBadgePanel.actionScale(0.6,0,0,this.onVoucherLabelZoomOut.bind(this));RSTweener.easeSineIn(a)},onVoucherLabelZoomOut:function(){this._voucherUnlockCountLabel.setString(this._nextMultiplierUnlockCount);var a=this._voucherUnlockCountBadgePanel.actionFadeIn(0.6);RSTweener.easeSineIn(a); a=this._voucherUnlockCountBadgePanel.actionScale(0.6,this._voucherCountScale,this._voucherCountScale,this.onZoomInOutBadgeAnimComplete.bind(this));RSTweener.easeSineIn(a)},onZoomInOutBadgeAnimComplete:function(){this.scheduleFunctionOnce(this.hideVoucherBadgeAnim.bind(this),1)},hideVoucherBadgeAnim:function(){this._voucherUnlockCountBadgeAnim.stopAnimation();this._voucherUnlockCountBadgeAnim.actionFadeOut(1);this.onScaleUpCompletedBadge2()},initializeSale:function(a,b){this._onSaleTriggered=!1;if(a)RSSaleManager.getInstance().onPurchaseSuccessNotifyResponseToCasino(); if(RSSaleManager.getInstance().getSaleActiveStatus()||RSSaleManager.getInstance().getLocOocStatus()||this._isPurchaseCart){var c=RSSaleManager.getInstance().getSaleVO();RSSaleManager.getInstance().getLocOocStatus()&&!RSSaleManager.getInstance().getSaleActiveStatus()&&RSSaleManager.getInstance().getLocOocSaleData(this._saleDetails.tag)&&(c=RSSaleManager.getInstance().getLocOocSaleData(this._saleDetails.tag));this._isPurchaseCart||this._saleDetails.eventId==c.eventId?!a||"loc"!=this._saleDetails.tag&& "ooc"!=this._saleDetails.tag&&"ooe"!=this._saleDetails.tag?(this._isPurchaseCart?this._saleDetails=RSSaleManager.getInstance().getPurchaseCartV2VO(this._currencyType):(this._saleDetails=RSSaleManager.getInstance().getSaleVO(),RSSaleManager.getInstance().startSaleTimer()),this.handlePurchasedTagVisibility(),this.handlePurchaseInfoPriceVisibility()):(RSEventManager.getInstance().dispatchEvent("onSaleClosed",{}),this.closePopup()):(RSEventManager.getInstance().dispatchEvent("onSaleClosed",{}),this.closePopup())}else RSEventManager.getInstance().dispatchEvent("onSaleClosed", {}),this.closePopup();b&&this.setTextLabels()},createCustomObject:function(a,b){switch(b.type){case "RSLabel":var c=RSSaleManager.getInstance().getSaleFont(SaleFontType.TIMER);this._popupTimerText=new RSLabelBMFont("",c,-1,kTEXT_ALIGNMENT_CENTER);this._popupTimerText.setScale(0.5);this._popupTimerText.setCenter(b.x,b.y);this.addChild(this._popupTimerText);break;case "Holder":"VIPStatusTier"==b.name&&(c=new RSRect(b.x,b.y,b.w,b.h),c=new VIPTierWidget(c),c.setAnchorPoint(0.5,0.5),this.addChild(c)); break;case "BG":this.addChild(RSUtils.createBasicObject(a,b));break;case "PurchasedStamp":c=RSUtils.createBasicObject(a,b);this.addChild(c);this._purchasedTag.push(c);this[b.name]=c;break;case "BuyBtn":this._submitButton=RSUtils.createButton(a,b);this.addTouchListenerToButton(this._submitButton);this.addChild(this._submitButton);this._buttonList.push(this._submitButton);break;case "Coin":c=RSPlatformFontAssetManager.createCustomLabel("",b);this.addChild(c);this._rewardTxts.push(c);this[b.name]=c; break;case "Energy":c=RSPlatformFontAssetManager.createCustomLabel("",b);this.addChild(c);this._rewardEnergyTxts.push(c);break;case "Powerup":c=RSPlatformFontAssetManager.createCustomLabel("",b);this.addChild(c);this._rewardPowerupTxts.push(c);break;case "InstantBingo":c=RSPlatformFontAssetManager.createCustomLabel("",b);this.addChild(c);this._rewardInstantBingoTxts.push(c);break;case "Price":c=RSPlatformFontAssetManager.createCustomLabel("",b);this.addChild(c);this._priceTxts.push(c);this[b.name]= c;break;case "StrikeOutPrice":c=RSPlatformFontAssetManager.createCustomLabel("",b);this.addChild(c);this._strikeOutPriceTxts.push(c);this[b.name]=c;break;case "Timer":this._popupTimerText=RSPlatformFontAssetManager.createCustomLabel("",b);this.addChild(this._popupTimerText);this[b.name]=this._popupTimerText;break;case "MutiplierTag":c=RSPlatformFontAssetManager.createCustomLabel("",b);this.addChild(c);this._multiplierTxts.push(c);this[b.name]=c;break;case "CoinStrikeOutAnimation":c=RSUtils.createAnimation(a, b,1);this[b.name]=c;this.addChild(c);break;case "PriceStrikeOutAnimation":c=RSUtils.createAnimation(a,b,1);this[b.name]=c;this.addChild(c);break;case "VoucherMultiplier":0!=this._currentVoucherMultiplier&&b.name[b.name.length-1]==this._voucherNextMultiplierIndex+1&&(this._voucherNextUnlockBadge=RSUtils.createAnimation(a,b,1),this.addChild(this._voucherNextUnlockBadge),this._voucherNextUnlockBadge.stopAnimation(),this._voucherNextUnlockBadge.setFrame(this._currentVoucherMultiplier-1),this[b.name]= this._voucherNextUnlockBadge);break;case "UnlockCountBadge":0!=this._currentVoucherMultiplier&&b.name[b.name.length-1]==this._voucherNextMultiplierIndex+1&&(this._voucherUnlockCountBadgePanel=new RSDisplayObject(new RSRect(b.x,b.y,b.w,b.h)),this.addChild(this._voucherUnlockCountBadgePanel),this._voucherUnlockCountBadgePanel.setCenter(b.x,b.y),this._voucherUnlockCountBadge=RSUtils.createAnimation(a,b,1),this._voucherUnlockCountBadgePanel.addChild(this._voucherUnlockCountBadge),this._voucherUnlockCountBadge.stopAnimation(), this._voucherUnlockCountBadge.setFrame(this._currentVoucherMultiplier-1),this[b.name]=this._voucherUnlockCountBadge);break;case "UnlockCount":if(0!=this._currentVoucherMultiplier&&b.name[b.name.length-1]==this._voucherNextMultiplierIndex+1){c=1==this._currentVoucherMultiplier?RSGame.getInstance().getAssetPath("Voucher_2X_Font"):2==this._currentVoucherMultiplier?RSGame.getInstance().getAssetPath("Voucher_3X_Font"):3==this._currentVoucherMultiplier?RSGame.getInstance().getAssetPath("Voucher_4X_Font"): 4==this._currentVoucherMultiplier?RSGame.getInstance().getAssetPath("Voucher_5X_Font"):RSGame.getInstance().getGameManager().getDefaultCasinoFont("large","bold");this._voucherCountRect=b;var d=RSPlatformFontAssetManager.getCustomFontVOFromConfig(RSPlatformFontAssetManager.getFontNameForLabelName("UnlockCount")),e=this._nextMultiplierUnlockCount;GlobalVars.showVoucherCountUpdateAnim&&(e+=1);this._voucherUnlockCountLabel=new RSLabelBMFont(e,c,b.w,kTEXT_ALIGNMENT_CENTER);this._voucherUnlockCountLabel.setScale(d.fontSize); this._voucherUnlockCountBadgePanel.addChild(this._voucherUnlockCountLabel);this[b.name]=this._voucherUnlockCountLabel}break;case "UnlockCountBadgeAnim":0!=this._currentVoucherMultiplier&&b.name[b.name.length-1]==this._voucherNextMultiplierIndex+1&&GlobalVars.showVoucherCountUpdateAnim&&(this._voucherUnlockCountBadgeAnim=RSUtils.createAnimation(a,b,1),this.addChild(this._voucherUnlockCountBadgeAnim),this._voucherUnlockCountBadgeAnim.stopAnimation(),this._voucherUnlockCountBadgeAnim.setVisible(!1))}this._super.createCustomObject.call(this, a,b)},setTouchEnabled:function(a){a?this.handlePurchasedTagVisibility():this._super.setTouchEnabled(!1)},onButtonClicked:function(a){if(0<=a.indexOf("BuyButton")){if(!1==this._onSaleTriggered){var b=a.match(/\d+/)[0]-1,c=null,c=null!=this._saleDetails.packs[b][this._saleDetails.monetizationCategory]?this._saleDetails.packs[b][this._saleDetails.monetizationCategory]:this._saleDetails.packs[b].all;this._onSaleTriggered=!0;this._packSelected=a.match(/\d+/)[0];b={analyticsName:this._saleDetails.analyticsName, monetizationCategory:this._saleDetails.monetizationCategory,saleId:this._saleDetails.saleId,eventId:this._saleDetails.eventId,saleTypePurhchasecart:this._isPurchaseCart,currencyType:this._currencyType?this._currencyType:"coins"};"1"==RSEngine.gameData.getDefaultValues().isVoucherSaleActive&&a[a.length-1]==this._voucherNextMultiplierIndex+1&&(RSSaleManager.getInstance().setNextMultiplierUnlockPackDetails(this._currentVoucherMultiplier),GlobalVars.showVoucherCountUpdateAnim=!0);RSSaleManager.getInstance().showFBPurchaseUI(c, b,this.onPurchaseSuccess.bind(this),this.onPurchaseFail.bind(this))}}else if(0<=a.indexOf("CloseBtn"))if(this._delegate)this._delegate.onButtonClicked(a);else!0!=this._isCloseButtonClicked&&(this._isCloseButtonClicked=!0,RSInAppPurchaseManager.getInstance().trackGUIEventForPurchaseCartClose(RSSaleManager.getInstance().getSaleTagForTrackingEvents(this._saleDetails.tag),"close","open_from_"+this.getCurrentMachineName(),"",this._saleDetails.eventId),RSEventManager.getInstance().dispatchEvent("onSaleClosed", {}),this._onSaleTriggered=!1,this.closePopup())},setDelegate:function(a){this._delegate=a},onPurchaseSuccess:function(){this._onSaleTriggered=!1;RSSaleManager.getInstance().setNextMultiplierUnlockPackDetails();RSSaleManager.getInstance().callSaleDetails(this.initializeSale.bind(this,!0),null)},onPurchaseFail:function(){this._onSaleTriggered=!1;GlobalVars.showVoucherCountUpdateAnim=!1;RSSaleManager.getInstance().setNextMultiplierUnlockPackDetails();this.initializeSale()},handlePurchasedTagVisibility:function(){for(var a= 0;a=this._saleDetails.userPurchasableCount)for(a=0;a=this._saleDetails.userPurchasableCount)for(var g=0;gthis._rsGame.getUserDataManager().getMe().getCurrentDay()? (this._rsGame.getUserDataManager().getMe().setCurrentDay(a),this._rsGame.getUserDataManager().getMe().setCurrentSession(0)):(a=this._rsGame.getUserDataManager().getMe().getCurrentSession()+1,this._rsGame.getUserDataManager().getMe().setCurrentSession(a))},stringToBoolean:function(a){switch(a){case "true":case "yes":case "1":return!0;case "false":case "no":case "0":case null:return!1;default:return Boolean(a)}},onMyDataLoadFailed:function(){this._rsGame.getErrorTracker().trackErrorMessage("SERVER_RESPONSE", "Failed to fetch User Blob","mahesh.jose@rubyseven.net,lijith.puthiyoottil@rubyseven.net");this.onStateUpdate()},saleAssetsLoader:function(){DEFAULT_LOADING_CONFIG.SALE_DATA&&RSEngine.loginMode!=LOGIN_MODE.GUEST?(RSGame.getInstance()._resourceConfigData?RSSaleManager.getInstance().setSaleFont(RSGame.getInstance().getAssetPath("DefaultSaleFont")):RSSaleManager.getInstance().setSaleFont(RSGame.getInstance().getResourceFolderFor("res/CommonFonts")+"Verdana_42-hd.fnt"),this._isSaleDataLoaded=!1,this._isNextSaleTimerLoaded= !0,RSSaleManager.getInstance().callSaleDetails(this.onSaleAssetsLoaded.bind(this),this.onSaleAssetsLoadingFailed.bind(this)),RSGame.getInstance().getGameManager().isSaleRefreshEnabled()&&(this._isNextSaleTimerLoaded=!1,RSSaleManager.getInstance().getNextSaleTime(this.onNextSaleTimeLoaded.bind(this),this.onNextSaleTimeFailed.bind(this)))):(this.onStateUpdate(!0),this.incrementLoadingProgress(LOAD_PERCENTAGE.SALE_DATA_LOAD))},onNextSaleTimeFailed:function(){this.onNextSaleTimeLoaded()},onNextSaleTimeLoaded:function(){(this._isNextSaleTimerLoaded= !0)&&this._isSaleDataLoaded&&(this.onStateUpdate(!0),this.incrementLoadingProgress(LOAD_PERCENTAGE.SALE_DATA_LOAD))},onSaleAssetsLoadingFailed:function(){this.saleAssetsLoader()},onSaleAssetsLoaded:function(){this._isSaleDataLoaded=!0;this._isNextSaleTimerLoaded&&this._isSaleDataLoaded&&(this.onStateUpdate(!0),this.incrementLoadingProgress(LOAD_PERCENTAGE.SALE_DATA_LOAD))},onGameDataReadSuccess:function(){this._loadingScreen.enableTapBlast();this.onStateUpdate(!0)},onGameDataReadFailed:function(){RSErrorTracker.getInstance().trackErrorMessage("SERVER_RESPONSE", "Failed to fetch Gamedata","mahesh.jose@rubyseven.net,lijith.puthiyoottil@rubyseven.net");this.onStateUpdate()},onWebStoreDataUpdated:function(a){400===a.result.status?cc.log("service call success...No purchase happened."):200===a.result.status&&(RSGame.getInstance().getGameManager().setWebStorePurchaseDetails(a.result.data),cc.log("service call success. Purchase happened and need to show purchase success popup"));this.onStateUpdate(!0)},onWebStoreDataUpdateFailed:function(){cc.log("[WEBStore]: WEB STORE data Loading Failed..."); RSErrorTracker.getInstance().trackErrorMessage("SERVER_RESPONSE","Failed to fetch WEB STORE data...","mahesh.jose@rubyseven.net,lijith.puthiyoottil@rubyseven.net");this.onStateUpdate(!0)},onLTEMGameDataLoaded:function(){this._rsGame.getLevelManager().initializeManager();var a=Date.now()-this._gameDataLoadingStartTime,a=Math.ceil(a/1E3);this._rsGame.getAnalyticsManager().trackGameDataLoadingComplete(a);this.incrementLoadingProgress(LOAD_PERCENTAGE.GAME_DATA_READ);this.onStateUpdate(!0)},onLTEMGameDataLoadingFailed:function(){cc.log("[LTEMGameDataLoader]: LTEM GameData Loading Failed"); RSErrorTracker.getInstance().trackErrorMessage("SERVER_RESPONSE","Failed to fetch LTEM Gamedata","mahesh.jose@rubyseven.net,lijith.puthiyoottil@rubyseven.net");this.onStateUpdate()},loadMarketingEvents:function(){RSMEConfigManager.getInstance().fetchActiveEventData(this.onMarketingEventsResponse.bind(this))},UrlDataReadComplete:function(a){"success"==a&&(this.incrementLoadingProgress(LOAD_PERCENTAGE.URL_REWARD_TRACK),this.onStateUpdate(!0))},onMarketingEventsResponse:function(a){"success"==a?(this.incrementLoadingProgress(LOAD_PERCENTAGE.MARKET_EVENT_DATA), this.onStateUpdate(!0)):RSErrorTracker.getInstance().trackErrorMessage("SERVER_RESPONSE","Fetching Marketing events failed: "+a,"mahesh.jose@rubyseven.net,lijith.puthiyoottil@rubyseven.net,muhammed.niyas@rubyseven.net")},onCustomLoadUpdate:function(a){100>a?this.incrementLoadingProgress(LOAD_PERCENTAGE.CUSTOM_DATA*a*0.01):(this._dataLoadingCompleted=!0,this.incrementLoadingProgress(LOAD_PERCENTAGE.CUSTOM_DATA))},getGameReLoadingScreenStatus:function(){return this._reloadGameWithoutLoadingScreen}, resetGameReLoadingScreenStatus:function(){this._reloadGameWithoutLoadingScreen=!1;GameConfig.IS_EDIT_FIELDS_ENABLED&&RSEngine.loginMode!=LOGIN_MODE.GUEST&&RSLoginManager.getInstance().setNameAndAvatar();RSLoginManager.getInstance().trackLinkingTime();RSAnalyticsManager.getInstance().trackGameLoadingComplete();RSEngine.loginMode!=LOGIN_MODE.GUEST&&parent.postMessage({type:"gtm",data:{event:"loading_complete",blob_id:RSGame.getInstance().getUserDataManager().getMe().getId()}},"*");RSAnalyticsManager.getInstance().trackRetention(RSEngine.dataManager.getMe().getRetentionCount())}, setLoadingModuleStatus:function(a){this._loadingModuleActive=a},getLoadingModuleStatus:function(){return this._loadingModuleActive}});function a0_0x52c4(){var a="init setPiggyBankValue piggyBankRoundOffFactor split _xpFractionFactor abs length ceil _piggyBonusFactor bet0 _betFactor setBetBucketFactor updateLevelTier _levelUpTriggered _levelUpList 4529720BQuAvM getLevelBarProgress _betsArray 3888696IttDXj 1148067Vbjdlw _xp getDefaultValues getPiggyBankValue containsBlackjackBetArray bet getLevelFactor _currentLevelVO isStringContains updateVOWithPiggyBank 14Govpqp getBonusFactorDetails _user getGameManager setXpFraction call 1nXZHCI getCasinoHUD startPiggyBankAnimations getLevelManager push gameData round 8440983DWnNZp piggyBonus _previousCoinSink _currentLevel animatePiggyBank _levelData _betBucket setLevelXPOffset getVO setRewardedLevel level getGameData bingoXPIncrementPercentage cXp getInstance _customCasinoInterface _betBuckets getXp getLevelBucketData _addedXp houseHold getXpWithoutFraction _levelBarProgress _xpProgressThreshold getSheetData isLevelUpTriggered _xpDifferenceFactor getXpFraction _levelTier setCurrentXPOffset _updateLevelProgressBar setLevelFactor betFactor0 getUserDataManager 2506756qFmUKh houseHoldIndex minBet Bingo 945426MaEGjQ 545498gjoxxS getMe levelBonus _super getCurrentLevel getGameType getLevelXPOffset setUserLevel getBlackjackBet getLevelUpList reward getLevelVOForLevel".split(" "); a0_0x52c4=function(){return a};return a0_0x52c4()}(function(a,b){for(var c=a0_0x1b20,d=a();;)try{if(parseInt(c(207))/1*(parseInt(c(160))/2)+parseInt(c(191))/3+parseInt(c(248))/4+-parseInt(c(187))/5+parseInt(c(159))/6*(-parseInt(c(201))/7)+-parseInt(c(190))/8+parseInt(c(214))/9===b)break;else d.push(d.shift())}catch(e){d.push(d.shift())}})(a0_0x52c4,512841);function a0_0x1b20(a,b){var c=a0_0x52c4();return a0_0x1b20=function(a,b){return c[a-158]},a0_0x1b20(a,b)} var RSLevelManagerV2=function(){var a,b=RSClass.extend({_user:null,_xp:null,_levelData:null,_currentLevel:null,_levelUpList:[],_levelUpTriggered:null,_levelBarProgress:0,_previousCoinSink:0,_betBucket:0,_xpFractionFactor:1E4,_xpProgressThreshold:1E12,_xpDifferenceFactor:0.01,_piggyBonusFactor:0,_levelTier:0,_betsArray:[],init:function(){var a=a0_0x1b20;this[a(163)][a(172)][a(206)](this)},initializeManager:function(){var a=a0_0x1b20;this[a(203)]=RSGame.getInstance().getUserDataManager().getMe();this[a(219)]= RSGame.getInstance()[a(225)]()[a(238)]("levelData");this._currentLevel=this[a(203)].getUserLevel();this._xp=this[a(203)][a(166)]();this[a(198)]=this[a(171)](this[a(217)]);RSGame.getInstance()[a(247)]().getMe()[a(223)](this[a(198)][a(224)]);this[a(243)]();this[a(244)](this[a(192)]);this[a(230)]=RSGame[a(228)]()[a(225)]()[a(232)]();this._levelTier=0;this[a(184)]();this._previousCoinSink=0},getLevelVOForLevel:function(a){var b=a0_0x1b20,e=0;if(a<=this[b(219)][b(178)])for(var f in this._levelData){if(parseInt(this[b(219)][f][b(224)])=== parseInt(a)){var g=this[b(222)](this[b(219)][f]);return g[b(224)]=parseInt(this._levelData[f][b(224)]),g[b(162)]=parseInt(this[b(219)][f].reward),g}}else return e=a-this[b(219)].length,g=this.getVO(this[b(219)][this[b(219)][b(178)]-1]),g.level=a,g[b(227)]+=g.xp*e,g[b(162)]=parseInt(this[b(219)][this._levelData[b(178)]-1][b(170)]),g},getVO:function(a){return new RSLevelVO(a)},_getHouseHoldFactor:function(){var a=a0_0x1b20,b=RSGame.getInstance()[a(225)]()[a(202)]();return this[a(198)][a(224)]=a)return 0;switch(RSGame.getInstance().getGameManager()[b(165)]()){case RSGameTypes[b(158)]:a/=RSGame[b(228)]()[b(225)]()[b(193)]()[b(226)]?RSGame[b(228)]()[b(225)]().getDefaultValues().bingoXPIncrementPercentage:10}a=RSGame[b(228)]()[b(204)]()[b(165)]()===RSGameTypes.Bingo?this[b(235)](a):this[b(231)](a);this[b(233)]=a;if(0=== a)return 0;for(this._xp=this[b(203)][b(166)]();0=this[b(198)].xp?(this._levelUpTriggered=!0,a-=this[b(198)].xp-this[b(192)],this[b(192)]=0,this._currentLevelVO=this.getLevelVOForLevel(++this[b(217)]),this[b(200)](),this[b(186)][b(211)](this[b(222)](this[b(198)]))):(this._xp+=a,a=0);return this[b(185)]&&(this[b(184)](),this[b(216)]=0),this._user[b(221)](this[b(192)]),this[b(203)][b(167)](this[b(217)]),this[b(244)](this[b(192)]),this[b(203)][b(245)](parseInt(this[b(188)]()% 1*this[b(237)])),this[b(233)]},getXp:function(a){var b=a0_0x1b20;return this[b(183)](a),this[b(235)](this[b(182)])},getXpWithoutFraction:function(a){var b=a0_0x1b20;a+=RSGame[b(228)]()[b(247)]()[b(161)]()[b(241)]()/this._xpFractionFactor;var e=a%1;return RSGame.getInstance().getUserDataManager()[b(161)]()[b(205)](e*this[b(176)]-e*this[b(176)]%1),a-e},setBetBucketFactor:function(a){var b=a0_0x1b20;if(this[b(216)]!==a){this._previousCoinSink=a;for(var e in this._betBuckets[this[b(242)]])RSUtils[b(199)](e, b(181))&&parseInt(this[b(230)][this._levelTier][e])<=a&&(this._betBucket=e);this[b(220)]=this[b(220)][b(175)]("0");this[b(182)]=parseInt(this._betBuckets[this._levelTier][b(246)+this[b(220)][this[b(220)].length-1]])/this[b(176)]}},updatePiggyBank:function(a,b){var e=a0_0x1b20,f=0;!a||1==a||a>this._betsArray[0]&&a=this._betsArray[1]? a>=this._betsArray[this._betsArray[f(178)]-1]?"maxBet":f(196):f(250)))},getPiggyBankBonus:function(){var a=a0_0x1b20,b=RSGame[a(228)]()[a(247)]()[a(161)]()[a(194)]();RSGame[a(228)]()[a(247)]()[a(161)]()[a(173)](0);var e=RSGame[a(228)]()[a(225)]()[a(193)]().piggyBankRoundOffFactor?RSGame.getInstance()[a(225)]()[a(193)]()[a(174)]:1E3;return Math[a(179)](b/e)*e},updateVOWithPiggyBank:function(){var a=a0_0x1b20,b=RSGame[a(228)]().getUserDataManager().getMe().getPiggyBankValue(),b=100*Math[a(179)](b/100); this[a(198)][a(215)]=b},updateLevelTier:function(){for(var a=a0_0x1b20;this._levelTierparseInt(this[a(230)][this._levelTier][a(224)])&&this._levelTier===this[a(230)].length-1)break;this._betsArray=[];for(var b in this._betBuckets[this[a(242)]])RSUtils[a(199)](b,"bet0")&& this._betsArray[a(211)](this._betBuckets[this._levelTier][b])},getCurrentLevelVO:function(){return this[a0_0x1b20(198)]},getCurrentLevel:function(){return parseInt(this._currentLevelVO.level)},getLevelBarProgress:function(){var a=a0_0x1b20;if(1<=this[a(236)]){var b=this[a(236)];return this[a(236)]=this[a(236)]%1,b}return 0e&&(this[a(192)]=b,this._user.setLevelXPOffset(this[a(192)]))},getLevelPercent:function(a,b,e){var f=a0_0x1b20;a=this.getLevelVOForLevel(a);b=Math[f(213)](a.xp*b/this._xpProgressThreshold);var g=a.xp*this[f(240)];Math[f(177)](b-e)>g&&(e=b);return e/a.xp},updateLevelDataInAristocratMachine:function(a){0this._retryCount?(this._retryCount++,this.fetchActiveEventData(this._callback)):(this._retryCount=0,this._callback(a))},getTimeLeft:function(a){if(!this.getDataForEvent(a))return 0; a=this._eventData[a].remainingTime-(TimeManager.getInstance().getCurrentServerTime()-this._startTime);return 0=g&&e>=h&&(c=a[f][b(528)])}return c},getBlackJackBetValues:function(a){var b=a0_0x2830d1;a=RSGame.getInstance()[b(490)]()[b(518)](a);for(var c=[],d=0;d=this._maxColIdx&&(this._cellSize=this._dataSource.tableCellSizeForIndex(this, 0),a.x+this._margin.left>(this._maxColIdx+1)*(this._cellSize.width+this._horizontalPadding)+this._margin.left))return-1}else c=this.colFromOffset(a);1this._cellSize.height?(b=this._verticalPadding,a+=this._cellSize.width+this._horizontalPadding,this._maxColIdx++,d=0):b+=this._cellSize.height+this._verticalPadding);var e=d%this._rowNum;this._colToIndexMap[this._maxColIdx]||(this._colToIndexMap[this._maxColIdx]=[]);this._colToIndexMap[this._maxColIdx].push(c);this._dataSource.tableCellAtIndex(this,c).setRowAndCol(e,this._maxColIdx);this._vCellsPositions[c]=cc.p(a,b);this._dataSource.tableCellSizeForIndex(this, c).height>this._cellSize.height?d+=2:d++}}}}},getPositionOffsetFor:function(a){var b=0;switch(this.getDirection()){case cc.SCROLLVIEW_DIRECTION_HORIZONTAL:this._vCellsPositions.length>a&&(b=this._vCellsPositions[a].x)}return b},colOfIndex:function(a){return this._dataSource.tableCellAtIndex(this,a).getCol()},rowOfIndex:function(a){return this._dataSource.tableCellAtIndex(this,a).getRow()},maxRowIdx:function(){return this._maxRowIdx},maxColIdx:function(){return this._maxColIdx},rowFromOffset:function(a){this._cellSize= this._dataSource.tableCellSizeForIndex(this,0);a=Math.floor(a.y/(this._cellSize.height+2*this._verticalPadding));0>a?a=0:a>this.maxRowIdx()&&(a=this.maxRowIdx());return a},colFromOffset:function(a){this._cellSize=this._dataSource.tableCellSizeForIndex(this,0);a=Math.floor(a.x/(this._cellSize.width+this._horizontalPadding));0>a?a=0:a>this.maxColIdx()&&(a=this.maxColIdx());return a},updateCellAtIndex:function(a){if(!(a===cc.INVALID_INDEX||a>this._dataSource.numberOfCellsInTableView(this)-1)){var b= this.cellAtIndex(a);b&&this._moveCellOutOfSight(b);b=this._dataSource.tableCellAtIndex(this,a);b.enableEvent.call(b);this._setIndexForCell(a,b);this._addCellIfNecessary(b)}},scrollViewDidScroll:function(a){if(0!==this._dataSource.numberOfCellsInTableView(this)){null!==this._tableViewDelegate&&this._tableViewDelegate.scrollViewDidScroll&&this._tableViewDelegate.scrollViewDidScroll(this);var b=0,c=0;a=0;a=this.getContentOffset();a.x*=-1;a.y*=-1;switch(this.getDirection()){case cc.SCROLLVIEW_DIRECTION_HORIZONTAL:b= this.getContainer();this._vOrdering===cc.TABLEVIEW_FILL_TOPDOWN&&(a.y+=this._viewSize.height/b.getScaleY());c=this.colFromOffset(a);a.y=this._vOrdering===cc.TABLEVIEW_FILL_TOPDOWN?a.y-this._viewSize.height/b.getScaleY():a.y+this._viewSize.height/b.getScaleY();a.x+=this._viewSize.width/b.getScaleX();a=this.colFromOffset(a);if(0a;)if(this._moveCellOutOfSight(d),0=this._maxOffset&&this._slider.setVisible(!1)},setCustomSlider:function(a){this._slider&&this._slider.removeFromParent(!0);this._slider=a;this._maxOffset=this._tableView.getContentSize().width-this._scrollerSize.width;this._slider.setDelegate(this);this._slider.setVisible(this.isVisible());0>=this._maxOffset&&this.isVisible()&& this._slider.setVisible(!1)},setAutoScrollConfig:function(a,b,c){this._maxOffset||(this._maxOffset=Math.max(this._scrollerSize.width,this._tableView.getContentSize().width-this._scrollerSize.width));b=this._tableView.getPositionOffsetFor(b)/this._maxOffset*100;c=this._tableView.getPositionOffsetFor(c)/this._maxOffset*100;c=Math.min(100,Math.max(0,c));b=Math.min(100,Math.max(0,b));this._atuoScrollDuration=a;this._autoScrollStartValue=b;this._autoScrollEndValue=c;this._tableView&&(a=this._maxOffset* b.toFixed(2)*0.01,this._tableView.setContentOffset(cc.p(-a,0)))},startAutoScroll:function(a){if(!this._autoScrollActive&&0=this._maxOffset&&a&&this._slider.setVisible(!1));this._tableView&&this._tableView.setVisible(a);cc.Layer.prototype.setVisible.call(this,a)},getDisplayObject:function(){return this},unload:function(){this._dataSource&&(this._dataSource.unload(),delete this._dataSource,this._dataSource=null);this._slider&&(this._slider.removeFromParent(!0),delete this._slider,this._slider=null);this._tableView&&(this._tableView.removeFromParent(!0),delete this._tableView, this._tableView=null)}});var RSTweenAction=cc.ActionInterval.extend({key:"",from:0,to:0,delta:0,ctor:function(a,b,c,d){cc.ActionInterval.prototype.ctor.call(this);this.key="";void 0!==d&&this.initWithDuration(a,b,c,d)},initWithDuration:function(a,b,c,d){return cc.ActionInterval.prototype.initWithDuration.call(this,a)?(this.key=b,this.to=d,this.from=c,!0):!1},startWithTarget:function(a){if(!a||!a.updateTweenAction)throw Error("cc.ActionTween.startWithTarget(): target must be non-null, and target must implement updateTweenAction function"); cc.ActionInterval.prototype.startWithTarget.call(this,a);this.delta=this.to-this.from},update:function(a){a=this._computeEaseTime(a);this.target.updateTweenAction(this.from+this.delta*a,this.key)},reverse:function(){return new cc.ActionTween(this.duration,this.key,this.to,this.from)},clone:function(){var a=new cc.ActionTween;a.initWithDuration(this._duration,this.key,this.from,this.to);return a}});var RSControlSlider=cc.ControlSlider.extend({ctor:function(a,b,c,d,e){cc.ControlSlider.prototype.ctor.call(this);a=new cc.Sprite(a);a.setContentSize(b.width,b.height);b=new cc.Sprite;c=new cc.Sprite(c);c.setContentSize(d.width,d.height);this.initWithSprites(a,b,c);this.setAnchorPoint(0.5,1);this.setMinimumValue(0);this.setMaximumValue(100);this.setEnabled(!0);e&&this.setPosition(this.convertToNodeSpace(e));this.addTargetWithActionForControlEvents(this,this._valueChanged,cc.CONTROL_EVENT_VALUECHANGED)}, _valueChanged:function(a,b){this._delegate&&this._delegate.onSliderValueChanged.call(this._delegate,a,b)},setDelegate:function(a){this._delegate=a},getDisplayObject:function(){return this},unload:function(){this.removeFromParent(!0)}});var RSCasinoIconHolder=RSDisplayObject.extend({TALL_ICON_VIP:"TALL_ICON_VIP",LONG_ICON_VIP:"LONG_ICON_VIP",LONG_ICON:"LONG_ICON",LONG_ICON_ALLSLOTS:"LONG_ICON_ALLSLOTS",LONG_ICON_WITHOUT_BET:"LONG_ICON_WITHOUT_BET",SMALL_ICON:"SMALL_ICON",TINY_ICON:"TINY_ICON",TALL_ICON:"TALL_ICON",CUSTOM_ICON:"CUSTOM_ICON",VIP_ICON:"VIP_ICON",MACHINE_UNLOCK_ICON:"MACHINE_UNLOCK_LAYOUT",LARGE_LAYOUT:"res/PlatformWidgets/RSCasinoIconHolder/IconBig",SMALL_LAYOUT:"res/PlatformWidgets/RSCasinoIconHolder/IconSmall",TINY_LAYOUT:"res/PlatformWidgets/RSCasinoIconHolder/IconTiny", TALL_LAYOUT:"res/PlatformWidgets/RSCasinoIconHolder/IconTall",LONG_WITHOUT_BET_LAYOUT:"res/PlatformWidgets/RSCasinoIconHolder/IconBigWithNoBet",MACHINE_UNLOCK_LAYOUT:"res/PlatformWidgets/RSIconHolder/MachineUnlockIcon",OFFSETCHANGE_Y:0,zoomed:!1,init:function(a,b,c,d,e,f,g,h,k,m,n,p,r,s,u,t){this._gameUnavailable=this._underMaintenance=null;var v=c.split("/");v.pop();this._iconFolder=v.join("/");this._iconFont=g.FONT_ICON;g.JL_FONT_ICON&&(this._JLFont=g.JL_FONT_ICON);g.JL_FONT_COLOR&&(this._JLFontColor= g.JL_FONT_COLOR);this._iconRect=RSUtils.cloneJSON(b);b=new RSRect(this._iconRect.x,this._iconRect.y,this._iconRect.w,this._iconRect.h);this._super.init.call(this,b);this._machineDetails=e;this._iconUrl=c;this._onPlayClicked=d;this._enabled=!1;this._unlockedTier=RSGame.getInstance().getGameManager().isVipEnabled()?RSVIPManager.getInstance().getVIPUserTier():0;this._minBetTxt="";this._layoutType=a;s&&(this._gameType=s.gameType,this._isFavEnabled=s.isFavEnabled);this._onUnFavoriteMachine=u;this._isFavDummyIcon= t?t:!1;this._angleToRotate="TALL_ICON"==a?1.5:2;this._iconAnimationCounter=1;this._maxAnimationCounter=7;this._currIndex=n;this._jackPotName=m?m:null;this.OFFSETCHANGE_Y=void 0==k||null==k?0:k;this._unlockMachine=f;this._isFeatured=p;this._isTopFeatured=0;this._usePreloader=null==h?!0:h;this._lockAnimStarted=!1;e&&(this._showJackpotLoungeHeader=void 0!==e.showJackpotLoungeHeader?e.showJackpotLoungeHeader:!0);this._skipIconLoading=r;this._isUnFavoriteConfirmToolTipVisible=this._lockStatus=!1;this._imageObj= new RSImageObject;this._machineStatus=MACHINE_STATUS.ENABLED;this._machineDetails&&this._machineDetails.hasOwnProperty("machine_disableMachine")&&(this._machineStatus=this._machineDetails.machine_disableMachine);this.loadLayout()},loadLayout:function(){var a=null;switch(this._layoutType){case this.TINY_ICON:a=this.TINY_LAYOUT;break;case this.SMALL_ICON:a=this.SMALL_LAYOUT;break;case this.TALL_ICON_VIP:a=this.TALL_LAYOUT;break;case this.LONG_ICON:case this.LONG_ICON_VIP:case this.LONG_ICON_ALLSLOTS:a= this.LARGE_LAYOUT;break;case this.LONG_ICON_WITHOUT_BET:a=this.LONG_WITHOUT_BET_LAYOUT;break;case this.CUSTOM_ICON:a=this.CUSTOM_LAYOUT;break;case this.VIP_ICON:a=this.LARGE_LAYOUT;break;case this.MACHINE_UNLOCK_ICON:a=this.MACHINE_UNLOCK_LAYOUT;break;case this.TALL_ICON:a=this.TALL_LAYOUT}this._super.loadLayout.call(this,a)},setUnlock:function(){var a=RSGame.getInstance().getGameManager().getGameType();this._machineDetails&&(this._machineDetails.machine_identifier.includes("R_")?a=RSGameTypes.Roulette: this._machineDetails.machine_identifier.includes("B_")?a=RSGameTypes.Bingo:this._machineDetails.machine_identifier.includes("BJ_")?a=RSGameTypes.Blackjack:this._machineDetails.machine_identifier.includes("K_")?a=RSGameTypes.Keno:this._machineDetails.machine_identifier.includes("BR_")?a=RSGameTypes.TableGames:this._machineDetails.machine_identifier.includes("CP_")||this._machineDetails.machine_identifier.includes("MPP_")||this._machineDetails.machine_identifier.includes("MSP_")||this._machineDetails.machine_identifier.includes("MSPT_")|| this._machineDetails.machine_identifier.includes("PKR_")?a=RSGameTypes.Poker:this._machineDetails.machine_identifier.includes("S_")?a=RSGameTypes.Slots:this._machineDetails.machine_identifier.includes("L_")?a=RSGameTypes.Scratcher:this._machineDetails.machine_identifier.includes("X_")&&(a=RSGameTypes.Scorebox));a==RSGameTypes.Scratcher?(this._enabled=!0,this._setMinBet(a),this._setMinBetCoinAndUnlockVisibility(),this._unlocksAtLabel&&this._unlocksAtLabel.setVisible(!1),this._unLockLevelText&&this._unLockLevelText.setVisible(!1), this._unLockLevelTextLabel&&this._unLockLevelTextLabel.setVisible(!1),this._minBet&&this._minBet.setVisible(!1)):a==RSGameTypes.Slots?(this._setMinBet(a),this._checkMachineUnlockStatus(),this._setMinBetCoinAndUnlockVisibility()):(this._enabled=!0,RSGame.getInstance().getGameManager().getGameType()==RSGameTypes.Poker&&this._machineDetails.comingSoon&&parseInt(this._machineDetails.comingSoon)&&(this._enabled=!1),this._setMinBetCoinAndUnlockVisibility(),this._minBetTxt&&this._minBetTxt.setVisible(!1), this._minBet&&this._minBet.setVisible(!1),this._labelrightText&&this._labelrightText.setVisible(!1),this._unLockLevelText&&this._unLockLevelText.setVisible(!1),this._unlocksAtLabel&&this._unlocksAtLabel.setVisible(!1),this._unLockLevelTextLabel&&this._unLockLevelTextLabel.setVisible(!1))},_createTouchArea:function(a){var b=null,b=new RSRect(a.x-a.w/2,a.y-a.h/2,a.w,a.h);this._touchArea=new RSDisplayObject(b);this._touchArea.getDisplayObject()._name="touchAreaTemp";this.addChild(this._touchArea)},setYPositionAdjust:function(a){this._layoutType== this.LONG_ICON_ALLSLOTS&&(a.y-=this.OFFSETCHANGE_Y)},enableEvent:function(){this._isFavDummyIcon||(this.addMoveListener(),this._animation1&&(this._animation1.stopAnimation(),this._animation1.playAnimation(-1,0.25)),this._animation2&&(this._animation2.stopAnimation(),this._animation2.playAnimation(-1,0.25)),this._newBadge&&(this._newBadge.stopAnimation(),this._newBadge.playAnimation(-1,0.3)),this._vipOverlay&&this._vipOverlay.hideToolTip(),this._JLInfoToolTip&&this.hideJLToolTip())},tableCellTouched:function(a){if(this.containsPoint(a.x, a.y)&&!this._isFavDummyIcon&&!this._isUnFavoriteConfirmToolTipVisible)if(d||this._machineStatus!=MACHINE_STATUS.UNAVAILABLE)if(this._enabled)RSGame.getInstance().getGameManager().setLocationForMachineOpenPopup(a.x,a.y),this._onPlayClicked(this._machineDetails,this._enabled,this._jackPotName,this._layoutType,this._currIndex);else{a=this._machineDetails.machine_identifier;var b=this._machineDetails.levelRequired,c="";this._vipOverlay&&(b="VIP",this._machineDetails.isEnabled&&parseInt(this._machineDetails.isEnabled)&& this._vipOverlay.showToolTip());null==this._jackPotName||this._layoutType!=this.LONG_ICON_ALLSLOTS&&this._layoutType!=this.TALL_ICON&&this._layoutType!=this.LONG_ICON_WITHOUT_BET||!GameConfig.JACKPOT_LOUNGE_ENABLE?this.showLockAnimation():(b=GameConfig.JACKPOT_LOUNGE_LEVEL,a=this._machineDetails.machine_identifier+"_JL",c=this._jackPotName,this.showLockAnimation(),this.showJLToolTip());for(var d=!1,e=0;e=GameConfig.JACKPOT_LOUNGE_LEVEL||d&&!this._showJackpotLoungeHeader?this._enabled=!0:c||f?"1"==RSEngine.gameData.getSheetData("platformDataConfig")[0].isJLSelectPopupDisabled?this._enabled= !1:this._enabled=!0:this._enabled=!1);else if(b||c||d||e||this._unlockMachine||f)if(0=this._machineDetails.VIPTier||c||f)this._enabled=!0}else this._enabled=!0;else GameFeatureTypeEnum.MACHINE_GIFT?MachineGiftingManager.getInstance().isMachineGifted(this._machineDetails.machine_identifier)&&(this._enabled=!0,this._timerBG&&(this._timerBG.setVisible(!0),this._timerText.setVisible(!0))): a&&!this._skipIconLoading&&(this._enabled=!0);this._machineDetails.isEnabled&&!parseInt(this._machineDetails.isEnabled)&&(this._enabled=!1);b&&(this.showVIPOverlay(),!this._enabled||"AP"!=GameConfig.GAME_ID&&"UP"!=GameConfig.GAME_ID||this._imageObj.setColor(new RSColor(255,255,255,255)))},getMachineIdentifier:function(){return this._machineDetails.machine_identifier},getJackpotName:function(){return this._jackPotName},_setMinBet:function(a){this._minBetTxt=RSUtils.formatNumberWithComma(RSGame.getInstance().getGameData().getMinimumBetByGameTypeAndName(a? a:RSGame.getInstance().getGameManager().getGameType(),this._machineDetails));this._labelrightText&&this._labelrightText.setString(this._minBetTxt)},checkMachineUnlockShown:function(){var a=RSGame.getInstance().getUserDataManager().getMe().getVipMachineUnlocked();this._iconTier=this._machineDetails.VIPTier;this._unlockedTier=RSVIPManager.getInstance().getVIPUserTier();this._lockStatus=a>=this._iconTier?!1:!0;this._unlockedTier>a&&this._unlockedTier>=this._iconTier&&this._lockStatus&&(this._lockStatus= !1,RSGame.getInstance().getUserDataManager().getMe().setVipMachineUnlocked(this._iconTier))},_checkAndEnableMachineLock:function(){this._checkMachineUnlockStatus();this._setMinBetCoinAndUnlockVisibility()},_setMinBetCoinAndUnlockVisibility:function(){var a=GameConfig.MACHINE_UNDERMAINTENANCE_FEATURE&&!parseInt(this._machineDetails.isEnabled);RSGame.getInstance().getGameManager().getGameType()==RSGameTypes.Poker&&this._machineDetails.comingSoon&&parseInt(this._machineDetails.comingSoon)&&(this._enabled= a=!1);(a=a&&null!==this._underMaintenance)&&this._underMaintenance&&(this._underMaintenance.setVisible(!0),this._enabled=!1);this._minBet&&!this._isFavEnabled&&this._minBet.setVisible(a?!1:this._enabled);this._cardCost&&RSGame.getInstance().getGameManager().getGameType()==RSGameTypes.Scratcher&&this._cardCost.setVisible(a?!1:this._enabled);this._labelrightText&&!this._isFavEnabled&&this._labelrightText.setVisible(a?!1:this._enabled);this._unlocksAtLabel&&(this._unlocksAtLabel.setVisible(a?!1:!this._enabled), this._unLockLevelText.setVisible(a?!1:!this._enabled),this._machineDetails.isEnabled&&!parseInt(this._machineDetails.isEnabled)&&(this._unlocksAtLabel.setVisible(!1),this._unLockLevelText.setVisible(!1)));this._unLockLevelTextLabel&&this._unLockLevelTextLabel.setVisible(a?!1:!this._enabled);this._vipOverlay&&a&&this._machineStatus!=MACHINE_STATUS.UNAVAILABLE&&this._layoutType==this.TALL_ICON&&this.removeChild(this._vipOverlay);0=k+m)break;if(t.levelRequired>h&&n=t.VIPTier)if("SMALL_ICON"==a||"TALL_ICON"==a&&null==u){if(e>=k&&(r||v||w))continue;if(e=k)continue}else if(e>k&&("LONG_ICON_ALLSLOTS"==a||"TALL_ICON"==a&&null!=u))continue}r= {isFavEnabled:g?g:0,gameType:RSGameTypes.Slots};r=f&&e>k&&!UrlNotificationManager.getInstance().getAllMachineUnlockStatus()?new RSCasinoIconHolder(a,c,b,this.onAllSlotsIconClicked.bind(this),t,!1,this._assetList.fonts,!0,this._assetList.Y_offSetForBigIcon,u,s,!1,!0,r):new RSCasinoIconHolder(a,c,b,this.onAllSlotsIconClicked.bind(this),t,!1,this._assetList.fonts,!0,this._assetList.Y_offSetForBigIcon,u,s,!1,!1,r);r.getDisplayObject()._name="allSlotsIcon";null==u||"LONG_ICON_ALLSLOTS"!=a&&"TALL_ICON"!= a||this.JLMachineHolderList.push(r);this.machineList.push(r)}}1==g&&RSFavoritesLobbyWidgetManager.getInstance().removeUnWantedMachines();0=this._iconTier||this._enabled?(this._vipTierTag.setVisible(!1),this._vipUnlockTag.setVisible(!1)):(this._vipTierTag.setFrame(this._iconTier- 1),this._vipTierTag.setVisible(!0),this._machineStatus==MACHINE_STATUS.UNAVAILABLE?this._vipTierTag.setVisible(!1):this._machineDetails.isEnabled&&!parseInt(this._machineDetails.isEnabled)&&this._vipTierTag.setVisible(!1),this._vipUnlockTag.setVisible(!0))},onObjectCreated:function(a,b,c){switch(c.type){case "Animation":switch(c.name){case "VIPUnlockedTagAnim":this._vipTierTag=a,this._vipTierTag.stopAnimation(),this._vipTierTag.setVisible(!1)}}},showLockAnimation:function(){!1==this._lockAnimStarted&& (this._lockAnimStarted=!0,this._vipTierTag.actionScaleInOut(0.3,1.09,1,1.02,1,2,this.onLockAnimCompleted.bind(this)))},onLockAnimCompleted:function(){this._lockAnimStarted=!1},createCustomObject:function(a,b){this._super.createCustomObject.call(this,a,b);switch(b.name){case "VIPUnlockTag":this._vipUnlockTag=RSUtils.createBasicObject(a,b);this.addChild(this._vipUnlockTag);this._vipUnlockTag.setVisible(!1);break;case "VIPUnlockedTag":this._vipUnlockedTag=RSUtils.createBasicObject(a,b);this.addChild(this._vipUnlockedTag); this._vipUnlockedTag.setVisible(!1);break;case "VIPLockedInfo":this._vipLockedInfo=RSUtils.createBasicObject(a,b),this._vipLockedInfo.setVisible(!1),this.addChild(this._vipLockedInfo)}},handleObjectTouchAt:function(a,b,c){},handleObjectTouchMoveAt:function(a,b,c){},handleObjectTouchEndAt:function(a,b,c){switch(a._ccObject._name){case "VIPLockedInfo":GlobalVars.isMachineLoadingInProgress||RSGame.getInstance().getGameManager().showVIPBenefitsPopup()}},unloadContent:function(){this._super.unloadContent.call(this)}});var VIPIconMiniOverlay=RSDisplayObject.extend({init:function(a,b,c,d){b=new RSRect(0,0,b.w,b.h);this._super.init.call(this,b);this._enabled=c;this._machineStatus=d;this._assetPath=RSGame.getInstance().getAssetPath("VIPIconMiniOverlay");this._machineDetails=a;this._lockAnimStarted=!1;this.loadContent()},loadContent:function(){this.loadLayout(this._assetPath)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);this.handleVIPTierStatus()},handleVIPTierStatus:function(){var a=RSVIPManager.getInstance().getVIPUserTier(); this._iconTier=this._machineDetails.VIPTier;a>=this._iconTier||this._enabled?this._vipTierTag.setVisible(!1):(this._vipTierTag.setFrame(this._iconTier-1),this._vipTierTag.setVisible(!0),this._machineStatus==MACHINE_STATUS.UNAVAILABLE?this._vipTierTag.setVisible(!1):this._machineDetails.isEnabled&&!parseInt(this._machineDetails.isEnabled)&&this._vipTierTag.setVisible(!1))},onObjectCreated:function(a,b,c){switch(c.type){case "Animation":switch(c.name){case "VIPUnlockedTagAnim":this._vipTierTag=a,this._vipTierTag.stopAnimation(), this._vipTierTag.setVisible(!1)}}},showLockAnimation:function(){!1==this._lockAnimStarted&&(this._lockAnimStarted=!0,this._vipTierTag.actionScaleInOut(0.3,1.09,1,1.02,1,2,this.onLockAnimCompleted.bind(this)))},onLockAnimCompleted:function(){this._lockAnimStarted=!1},showToolTip:function(){this._vipLockedInfo&&!this._vipLockedInfo.isVisible()&&(this._vipLockedInfo.addTouchListenerWithDelegate(this,!0),this._vipLockedInfo.setVisible(!0),this.scheduleFunctionOnce(this.hideToolTip.bind(this),3),this.showLockAnimation())}, hideToolTip:function(){this._vipLockedInfo&&this._vipLockedInfo.setVisible(!1)},createCustomObject:function(a,b){this._super.createCustomObject.call(this,a,b);switch(b.name){case "VIPFrame":this._vipFrame=RSUtils.createBasicObject(a,b);this._vipFrame.setVisible(!0);this.addChild(this._vipFrame);break;case "VIPLockedInfo":this._vipLockedInfo=RSUtils.createBasicObject(a,b),this._vipLockedInfo.setVisible(!1),this.addChild(this._vipLockedInfo)}},handleObjectTouchAt:function(a,b,c){},handleObjectTouchMoveAt:function(a, b,c){},handleObjectTouchEndAt:function(a,b,c){switch(a._ccObject._name){case "VIPLockedInfo":GlobalVars.isMachineLoadingInProgress||RSGame.getInstance().getGameManager().showVIPBenefitsPopup()}},unloadContent:function(){this._super.unloadContent.call(this)}});var SlotsLobbyVIPBottomWidget=RSBasicObject.extend({init:function(){this._assetPath=RSGame.getInstance().getAssetPath("SlotsLobbyVIPBottomWidget");this._buttonSound=null;this._buttonSound=RSGame.getInstance().getAssetPath("ButtonSFX");this._super.init.call(this);this.loadContent()},loadContent:function(){this.loadLayout(this._assetPath)},setVIPTier:function(){this._currentVIPTier=RSVIPManager.getInstance().getVIPUserTier();0==this._currentVIPTier?(this._vipTierAnim.setVisible(!1),this._yourStatusLabel.setVisible(!1), this._vipLockedText.setVisible(!0)):(this._vipTierAnim.setVisible(!0),this._yourStatusLabel.setVisible(!0),this._vipLockedText.setVisible(!1),this._vipTierAnim.setFrame(this._currentVIPTier-1))},onObjectCreated:function(a,b,c){"YourStatus"==c.name?(this._yourStatusLabel=a,this._yourStatusLabel.setVisible(!1)):"VipLockedText"==c.name&&(this._vipLockedText=a,this._vipLockedText.setVisible(!1));switch(c.type){case "Animation":switch(c.name){case "TierUpAnim":this._vipTierAnim=a,this._vipTierAnim.stopAnimation()}}}, onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);this.setVIPTier()},onButtonClicked:function(a){switch(a){case "Benefits":RSGame.getInstance().getGameManager().showVIPBenefitsPopup()}},unloadContent:function(){this._super.unloadContent.call(this)}});var RSSlotsLobbyVIP=RSDisplayObject.extend({init:function(a,b){var c=new RSRect(0,0,0,0);this._super.init.call(this,c);this._assetList=a;this._scrollRect=this._assetList.widget;this.machineList=[];this._delegate=b;this.loadContent()},loadContent:function(){this.loadLayout(RSGame.getInstance().getAssetPath("SlotsLobbyVIPWidget"),1)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);this._addVIPMachinesToScroller();this.setVisible(!1);this.setTouchEnabled(!1)},setVisible:function(a){this._scroller&& this._scroller.setVisible(a);this._super.setVisible.call(this,a)},createCustomObject:function(a,b){switch(b.name){case "BigMachineIcon":this._iconHolder=b;break;case "VipBottomWidget":this.vipBottomWidget=b,this.panel=new RSPanel(b.x,b.y,b.w,b.h),this.addChild(this.panel),this.panel.setAnchorPoint(0,0),this.panel.setZOrder(2),this._slotsLobbyVIPBottomWidget=new SlotsLobbyVIPBottomWidget(this),this.panel.addChild(this._slotsLobbyVIPBottomWidget),this._slotsLobbyVIPBottomWidget.setVisible(!0)}},setCustomSlider:function(a){a instanceof RSControlSlider&&this._scroller&&this._scroller.setCustomSlider(a)},reInitializeVIPMachinesOnTierUpdate:function(){if(0this._scrollerInitialValue&& (this._scrollerInitialValue=0),this._scrollerTargetValue>b&&(this._scrollerTargetValue=b)):(this._scrollerInitialValue=this._scrollerTargetValue+a,this._scrollerInitialValue>b&&(this._scrollerInitialValue=b),0>this._scrollerTargetValue&&(this._scrollerTargetValue=0))},getSlotsLobbyTargetIndex:function(){return this._scrollerTargetValue},getSlotsLobbyFromIndex:function(){return this._scrollerInitialValue},getMergedSlotMachinesData:function(){var a=0;this._slotsLobbyMergedMachines=[];if(this._slotsLobbyJackPotMachines)for(var b= 0;bd?(d={},d[b]=c,p.push(a),r.push(d)):(r[d]||(r[d]={}),r[d][b]=c)},t=[],v=!1,w=function(a){if(null===a)return null;a=a.getBoundingClientRect();return{width:a.width,height:a.height}},x=function(a){var b=s(a,"lastScheduleResizeCheckSize")||w(a),c=s(a,"lastKnownSize");c&&c.width===b.width&&c.height===b.height||(s(a,"resizeCallback")(b),u(a,"lastKnownSize",b));u(a,"resizeCheckIsScheduled", !1)},B=function(a,b){u(a,"lastScheduleResizeCheckSize",b);s(a,"resizeCheckIsScheduled")||(u(a,"resizeCheckIsScheduled",!0),"function"==typeof requestAnimationFrame?window.requestAnimationFrame(function(){x(a)}):setTimeout(function(){x(a)},1E3/60))},y=function(a,b){u(a,"resizeCallback",b);s(a,"isObserved")||(u(a,"isObserved",!0),"undefined"!=typeof ResizeObserver?(c||(c=new ResizeObserver(function(a){var b=!0,c=!1,d=void 0;try{for(var e,f=a[Symbol.iterator]();!(b=(e=f.next()).done);b=!0){var g=e.value; B(g.target,g.contentBoxSize?{width:g.contentBoxSize.inlineSize,height:g.contentBoxSize.blockSize}:{width:g.contentRect.width,height:g.contentRect.height})}}catch(h){c=!0,d=h}finally{try{b||null==f.return||f.return()}finally{if(c)throw d;}}})),c.observe(a)):v||(window.addEventListener("resize",function(){t.forEach(function(a){return B(a)})}),"undefined"!=typeof MutationObserver&&(new MutationObserver(function(){t.forEach(function(a){return B(a)})})).observe(document,{attributes:!0,childList:!0,characterData:!0, subtree:!0}),v=!0),t.push(a))},z={small:{height:44,width:24,logoWidth:12,path:"M12.2337427,16.9879688 C12.8896607,16.9879688 13.7118677,16.5445313 14.2014966,15.9532812 C14.6449341,15.4174609 14.968274,14.6691602 14.968274,13.9208594 C14.968274,13.8192383 14.9590357,13.7176172 14.9405591,13.6344727 C14.2107349,13.6621875 13.3330982,14.1241016 12.8065162,14.7430664 C12.3907935,15.2142188 12.012024,15.9532812 12.012024,16.7108203 C12.012024,16.8216797 12.0305005,16.9325391 12.0397388,16.9694922 C12.0859302,16.9787305 12.1598365,16.9879688 12.2337427,16.9879688 Z M9.92417241,28.1662891 C10.8202857,28.1662891 11.2175318,27.5658008 12.3353638,27.5658008 C13.4716724,27.5658008 13.721106,28.1478125 14.7188404,28.1478125 C15.6980982,28.1478125 16.3540162,27.2424609 16.972981,26.3555859 C17.6658521,25.339375 17.9522388,24.3416406 17.9707154,24.2954492 C17.9060474,24.2769727 16.0306763,23.5101953 16.0306763,21.3576758 C16.0306763,19.491543 17.5088013,18.6508594 17.5919459,18.5861914 C16.612688,17.1819727 15.1253248,17.1450195 14.7188404,17.1450195 C13.6194849,17.1450195 12.7233716,17.8101758 12.1598365,17.8101758 C11.5501099,17.8101758 10.7463794,17.1819727 9.79483648,17.1819727 C7.98413335,17.1819727 6.14571538,18.6785742 6.14571538,21.5054883 C6.14571538,23.2607617 6.8293482,25.1176563 7.67003179,26.3186328 C8.39061773,27.3348438 9.01882085,28.1662891 9.92417241,28.1662891 Z"}, medium:{height:44,width:31,logoWidth:17,path:"M15.7099491,14.8846154 C16.5675461,14.8846154 17.642562,14.3048315 18.28274,13.5317864 C18.8625238,12.8312142 19.2852829,11.852829 19.2852829,10.8744437 C19.2852829,10.7415766 19.2732041,10.6087095 19.2490464,10.5 C18.2948188,10.5362365 17.1473299,11.140178 16.4588366,11.9494596 C15.9152893,12.56548 15.4200572,13.5317864 15.4200572,14.5222505 C15.4200572,14.6671964 15.4442149,14.8121424 15.4562937,14.8604577 C15.5166879,14.8725366 15.6133185,14.8846154 15.7099491,14.8846154 Z M12.6902416,29.5 C13.8618881,29.5 14.3812778,28.714876 15.8428163,28.714876 C17.3285124,28.714876 17.6546408,29.4758423 18.9591545,29.4758423 C20.2395105,29.4758423 21.0971074,28.292117 21.9063891,27.1325493 C22.8123013,25.8038779 23.1867451,24.4993643 23.2109027,24.4389701 C23.1263509,24.4148125 20.6743484,23.4122695 20.6743484,20.5979021 C20.6743484,18.1579784 22.6069612,17.0588048 22.7156707,16.974253 C21.4353147,15.1382708 19.490623,15.0899555 18.9591545,15.0899555 C17.5217737,15.0899555 16.3501271,15.9596313 15.6133185,15.9596313 C14.8161157,15.9596313 13.7652575,15.1382708 12.521138,15.1382708 C10.1536872,15.1382708 7.75,17.0950413 7.75,20.7911634 C7.75,23.0861411 8.64383344,25.513986 9.74300699,27.0842339 C10.6851558,28.4129053 11.5065162,29.5 12.6902416,29.5 Z"}, large:{height:44,width:39,logoWidth:21,path:"M19.8196726,13.1384615 C20.902953,13.1384615 22.2608678,12.406103 23.0695137,11.4296249 C23.8018722,10.5446917 24.3358837,9.30883662 24.3358837,8.07298156 C24.3358837,7.9051494 24.3206262,7.73731723 24.2901113,7.6 C23.0847711,7.64577241 21.6353115,8.4086459 20.7656357,9.43089638 C20.0790496,10.2090273 19.4534933,11.4296249 19.4534933,12.6807374 C19.4534933,12.8638271 19.4840083,13.0469167 19.4992657,13.1079466 C19.5755531,13.1232041 19.6976128,13.1384615 19.8196726,13.1384615 Z M16.0053051,31.6 C17.4852797,31.6 18.1413509,30.6082645 19.9875048,30.6082645 C21.8641736,30.6082645 22.2761252,31.5694851 23.923932,31.5694851 C25.5412238,31.5694851 26.6245041,30.074253 27.6467546,28.6095359 C28.7910648,26.9312142 29.2640464,25.2834075 29.2945613,25.2071202 C29.1877591,25.1766052 26.0904927,23.9102352 26.0904927,20.3552448 C26.0904927,17.2732359 28.5316879,15.8848061 28.6690051,15.7780038 C27.0517133,13.4588684 24.5952606,13.3978385 23.923932,13.3978385 C22.1082931,13.3978385 20.6283185,14.4963764 19.6976128,14.4963764 C18.6906198,14.4963764 17.36322,13.4588684 15.7917006,13.4588684 C12.8012365,13.4588684 9.765,15.9305785 9.765,20.5993643 C9.765,23.4982835 10.8940528,26.565035 12.2824825,28.548506 C13.4725652,30.2268277 14.5100731,31.6 16.0053051,31.6 Z"}}, C=function(a){var b=1b&&(b=130);64<(c=Math.floor(c))?c=64:30>c&&(c=30);e=Math.floor(e);a=Math.floor(a);var f,g,d=(g=c/(f=z[d]).height,Math.floor(f.logoWidth*g));f=Math.floor(0.5* d);g=Math.floor(0.7*d);var h=f+d+g,k=Math.floor(b/2);e>k?e=k:eg?a=g:ab||arguments.length<=b?void 0:arguments[b],d=Object.keys(c),e=0;ethis._textLength&&(a=this._emailValue.substring(0,this._textLength-1),this._email.setString(a+".."));break;case "Password":this._passwdValue=a._ccObject._text, 21this._passwdValue.length?(this._passwordMustBeAtLeast5Characters.setVisible(!0),!1):!0;this._paswdRequired.setVisible(!0);return!1}this._invalidEmail.setVisible(!0);return!1},userChanged:function(a){cc.log("USER ID:::"+gapi.auth2.getAuthInstance().currentUser.get().getBasicProfile().getId()); cc.log("USER Name: "+gapi.auth2.getAuthInstance().currentUser.get().getBasicProfile().getName());cc.log("USER Image URL: "+gapi.auth2.getAuthInstance().currentUser.get().getBasicProfile().getImageUrl());cc.log("USER Email: "+gapi.auth2.getAuthInstance().currentUser.get().getBasicProfile().getEmail())},signInFailed:function(a){cc.log("Response: "+a);!0==a?cc.log("Succes"):(this._email.setTouchEnabled(!0),this._passwd.setTouchEnabled(!0));this._loginFailed.setVisible(!0)},signUpFailed:function(a){cc.log("Response: "+ a);!0==a?cc.log("Succes"):(this._email.setTouchEnabled(!0),this._passwd.setTouchEnabled(!0),this._emailIdExist.setVisible(!0))},removeVisibilityOfNotificationTexts:function(){this._loginFailed.setVisible(!1);this._emailIdExist.setVisible(!1);this._paswdRequired.setVisible(!1);this._invalidEmail.setVisible(!1);this._passwordMustBeAtLeast5Characters.setVisible(!1)},onUpdateSocialLogin:function(a){cc.log("on social update event:"+a);this.closePopup()},closePopup:function(){this._loginCallback&&this._loginCallback(); RSEventManager.getInstance().removeListenersForEvent("onUpdateSocialLogin");this._super.closePopup.call(this)}});var RSAccountManagementPopup=RSGenericPopup.extend({init:function(a,b){this._assetList=[{name:RSGame.getInstance().getAssetPath("RSAccountManagementPopup"),count:1}];this._super.init.call(this);this._userId=RSGame.getInstance().getGameManager().getUpdatedUserForDisplay(RSLoginManager.getInstance().getCookie(GameConfig.COOKIE_PREFIX+"-blobId")?RSLoginManager.getInstance().getCookie(GameConfig.COOKIE_PREFIX+"-blobId"):RSSSOManager.getBlobIdData().blobId);this._textLength=27;var c=RSLoginManager.getInstance().getCookie(GameConfig.COOKIE_PREFIX+ "-loginType");this._loginType=c?c.split("|"):null;this._tickStatus=!1;this._openedFrom=a;this._callback=b;this._signupbtn=this._loginbtn=null;this._emailSentOnceInPopupSession=!1;this._signintab_enabled=RSEngine.gameData.getDefaultValues().isSSOSignInTabEnabled;RSEventManager.getInstance().removeListenersForEvent("onUpdateSocialLogin");RSEventManager.getInstance().removeListenersForEvent("GAME_RELOAD");RSEventManager.getInstance().addEventListener("onUpdateSocialLogin",this,this.onUpdateSocialLogin.bind(this)); RSEventManager.getInstance().addEventListener("GAME_RELOAD",this,this.onGameReload.bind(this));RSPlatformFontAssetManager.loadFontConfigFile(RSGame.getInstance().getAssetPath("AccountManagementConfigJson"),"AccountManagementConfig.json")},loadContent:function(){this.layoutScreen(this._assetList);this._super.loadContent.call(this)},onLayoutCompleted:function(){if(this._openedFrom){var a="logout"==this._openedFrom?"logout":"",b="logout"==this._openedFrom?RSAnalyticsManager.getInstance().getCurrentMachineName(): this._openedFrom;RSAnalyticsManager.getInstance().trackPlayerAction("manage_account","open",a,"open_from_"+b,"")}this.controlVisibility();this.handleSigninLogoutButtonVisibility();this._super.onLayoutCompleted.call(this)},onObjectCreated:function(a,b,c){this._super.onObjectCreated.call(this,a,b,c);switch(c.name){case "SubBg":this._subBg=a;break;case "Icons":this._icons=a;break;case "Title2":this._title2=a;this._title2.setVisible(!0);break;case "UnlinkFbBtn":this._unlinkFbBtn=a;this._unlinkFbBtn.setVisible(!1); break;case "UnlinkAppleBtn":this._unlinkAppleBtn=a;this._unlinkAppleBtn.setVisible(!1);break;case "UnlinkGoogleBtn":this._unlinkGoogleBtn=a;this._unlinkGoogleBtn.setVisible(!1);break;case "FBLoginBtn":this._fBLoginBtn=a;this._fBLoginBtn.setVisible(!0);break;case "AppleBtn":this._appleBtn=a;this._appleBtn.setVisible(!0);break;case "GoogleBtn":this._googleBtn=a;this._googleBtn.setVisible(!0);break;case "LogOut":this._logOutBtn=a;this._logOutBtn.setVisible(!1);break;case "EmailBox":this._emailBox=a; this._emailBoxHeight=c.h;break;case "PasswordBox":this._passwordBox=a;this._passwordBoxHeight=c.h;break;case "ThisEmailIDisnotvalid":this._invalidEmail=a;this._invalidEmail.setVisible(!1);break;case "Thepasswordisrequired":this._paswdRequired=a;this._paswdRequired.setVisible(!1);break;case "Signin":this._signInBtn=a;break;case "SignIn":this._signIn=a;this._signIn.addTouchListenerWithDelegate(this);break;case "SignUpAndPlay":this._signUpAndPlayBtn=a;this._signUpAndPlayBtn.addTouchListenerWithDelegate(this); break;case "Alreadyregistered":this._alreadyRegisterd=a;break;case "Newplayer":this._newPlayer=a;break;case "TikAnim":this._tickAnim=a;this._tickAnim.stopAnimation();this._tickAnim.addTouchListenerWithDelegate(this);break;case "RememberMe":this._rememberMe=a;this._rememberMe.setVisible(!1);break;case "Registernow":this._registerNow=a;this._registerNow.addTouchListenerWithDelegate(this);break;case "ForgotPassword":this._forgotPassword=a;break;case "LoginfailedTryAgain":this._loginFailed=a;this._loginFailed.setVisible(!1); break;case "EmailIDalreadyexists":this._emailIdExist=a;this._emailIdExist.setVisible(!1);break;case "PasswordMustBeAtLeast5Characters":this._passwordMustBeAtLeast5Characters=a;this._passwordMustBeAtLeast5Characters.setVisible(!1);break;case "SendLinkAgainBtn":this._sendLinkAgainBtn=a;this._sendLinkAgainBtn.setVisible(!1);break;case "VerificationPendingText":this._verificationPendingText=a;this._verificationPendingText.setVisible(!1);break;case "LogInBtn":this._loginbtn=a;this._loginType.includes("email")? this._loginbtn.setVisible(!1):this._loginbtn.setSelected(!0);break;case "SignupBtn":this._signupbtn=a;this._loginType.includes("email")&&this._signupbtn.setVisible(!1);break;case "TabsBase":this._tabsbase=a;this._loginType.includes("email")&&this._tabsbase.setVisible(!1);break;case "EmailSentText":this._emailSentText=a;this._emailSentText.setVisible(!1);break;case "RestorePointsBtn":a.setVisible(!1)}},setLoggedInSignInBtnVisibility:function(a){this._signUpAndPlayBtn.setVisible(!1);this._signIn.setVisible(!1); this._passwd.setVisible(a);this._email.setVisible(a);this._text1.setVisible(!a);this._mailAddress.setVisible(!a);this._signInBtn.setVisible(a);this._emailBox.setVisible(a);this._passwordBox.setVisible(a);this._forgotPassword.setVisible(a);this._forgotPassword.isVisible()?this._forgotPassword.addTouchListenerWithDelegate(this):this._forgotPassword.removeTouchListener();null!=this._rememberMe&&this._rememberMe.setVisible(a);this._signintab_enabled||(this._newPlayer.setVisible(a),this._registerNow.setVisible(a)); this._alreadyRegisterd.setVisible(!1);this._logOutBtn.setVisible(!a);this._signintab_enabled&&(this._logOutBtn.isVisible()?(this._loginbtn.setVisible(!1),this._signupbtn.setVisible(!1),this._tabsbase.setVisible(!1)):(this._loginbtn.setVisible(!0),this._loginbtn.setSelected(!0),this._signupbtn.setVisible(!0),this._signupbtn.setSelected(!1),this._tabsbase.setVisible(!0)));null!=this._tickAnim&&(this._tickAnim.setVisible(a),this._tickAnim.setFrame(0));this.emailVerificationCheck(a)},emailVerificationCheck:function(a){RSSSOManager.getBlobIdData().emailVerificationDetails? 0==RSSSOManager.getBlobIdData().emailVerificationDetails.verified?(this._sendLinkAgainBtn.setVisible(!a),this._verificationPendingText.setVisible(!a),RSSSOManager.getCookieEmailVerificationData()&&0!=RSSSOManager.getCookieEmailVerificationData().verified&&(this._sendLinkAgainBtn.setVisible(!1),this._verificationPendingText.setVisible(!1))):RSSSOManager.getCookieEmailVerificationData()&&0==RSSSOManager.getCookieEmailVerificationData().verified&&(this._sendLinkAgainBtn.setVisible(!a),this._verificationPendingText.setVisible(!a)): RSSSOManager.getCookieEmailVerificationData()&&0==RSSSOManager.getCookieEmailVerificationData().verified&&(this._sendLinkAgainBtn.setVisible(!a),this._verificationPendingText.setVisible(!a));this._emailSentOnceInPopupSession&&this._sendLinkAgainBtn.setVisible(!1)},controlVisibility:function(){this._unlinkAppleBtn.setVisible(!1);this._appleBtn.setVisible(!0);this._unlinkGoogleBtn.setVisible(!1);this._googleBtn.setVisible(!0);this._unlinkFbBtn.setVisible(!1);this._fBLoginBtn.setVisible(!0);if(this._loginType)for(var a= 0;athis._textLength&&(a=this._emailValue.substring(0,this._textLength-1),this._email.setString(a+".."));break;case "Password":this._passwdValue=a._ccObject._text,21this._passwdValue.length?(this._passwordMustBeAtLeast5Characters.setVisible(!0),!1):!0;this._paswdRequired.setVisible(!0);return!1}this._invalidEmail.setVisible(!0);return!1},signInFailed:function(a){cc.log("Response: "+a);!0==a?cc.log("Succes"):(this._email.setTouchEnabled(!0),this._passwd.setTouchEnabled(!0),this._loginFailed.setVisible(!0))},signUpFailed:function(a){cc.log("Response: "+a);!0==a?(cc.log("Succes"),RSAnalyticsManager.getInstance().trackPlayerAction("manage_account","register_now", "success",RSGame.getInstance().getUserDataManager().getMe().getId(),"")):(this._email.setTouchEnabled(!0),this._passwd.setTouchEnabled(!0),this._emailIdExist.setVisible(!0))},removeVisibilityOfNotificationTexts:function(){this._loginFailed.setVisible(!1);this._emailIdExist.setVisible(!1);this._paswdRequired.setVisible(!1);this._invalidEmail.setVisible(!1);this._passwordMustBeAtLeast5Characters.setVisible(!1)},onUpdateSocialLogin:function(a){cc.log("on social update event:"+a)},onGameReload:function(a){a&& (cc.log("Closing popup on game reload"),RSEventManager.getInstance().removeListenersForEvent("onUpdateSocialLogin"),this.closePopup())},closePopup:function(){RSEventManager.getInstance().removeListenersForEvent("GAME_RELOAD");if(this._openedFrom){var a="logout"==this._openedFrom?"logout":"",b="logout"==this._openedFrom?RSAnalyticsManager.getInstance().getCurrentMachineName():this._openedFrom;RSAnalyticsManager.getInstance().trackPlayerAction("manage_account","close",a,"open_from_"+b,"")}this._callback&& this._callback();this._super.closePopup.call(this)}});var RSSwitchAccountsPopup=RSGenericPopup.extend({init:function(a,b){this._assetList=[{name:RSGame.getInstance().getAssetPath("RSSwitchAccountsPopup"),count:1}];RSPlatformFontAssetManager.loadFontConfigFile(RSGame.getInstance().getAssetPath("SwitchAccountFontConfigJson"),"SwitchAccountFontConfig.json");this._switchAccountDetails=a;cc.spriteFrameCache.addSpriteFrames(RSGame.getInstance().getAssetFolder("AvatarPopup")+"AvatarImages_00-hd.plist");this._blobdetails=b;this._super.init.call(this)},loadContent:function(){this.layoutScreen(this._assetList); this._super.loadContent.call(this)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);this.setProfileImage()},setProfileImage:function(){var a,b=RSGame.getInstance().getUserDataManager().getMe().getImageUrl();b&&this._profileObject.setVisible(!1);if(GameConfig.IS_EDIT_FIELDS_ENABLED&&this._switchAccountDetails.avathar_ID&&"facebook"!=this._switchAccountDetails.loginMode)a=GameConfig.BASE_URL+"/res/AvatarImages/"+this._switchAccountDetails.avathar_ID+".png";else if("facebook"== this._switchAccountDetails.loginMode)a=RSLoginManager.getInstance().getTemporaryFbData(),a="https://graph.facebook.com/"+a.id+"/picture?type\x3dsquare\x26access_token\x3d"+RSGame.getInstance().getGameManager().getFBAccessToken();else if("google"==this._switchAccountDetails.loginMode)a=getUserProfileImageUrl();else if("email"==this._switchAccountDetails.loginMode||this._switchAccountDetails.avathar_ID)a=GameConfig.BASE_URL+"/res/AvatarImages/"+this._switchAccountDetails.avathar_ID+".png";this.setProfilePic(this._profileObject, "SwitchAccountsPopup",this._objectData,b,RSEngine.loginMode);this.setProfilePic(this._profileObject1,"SwitchAccountsPopup",this._objectData1,a,this._switchAccountDetails.loginMode)},onObjectCreated:function(a,b,c){this._super.onObjectCreated.call(this,a,b,c);switch(c.name){case "OverviewBg1":this._overviewBg1=a;this._overviewBg1.setVisible(!0);break;case "ProfilePic1":this._objectData1=c;this._profileObject1=a;break;case "Frame1":this._frame1=a;this._frame1.setVisible(!0);break;case "SwitchAccountBtn":this._switchAccountBtn= a;this._switchAccountBtn.setVisible(!0);break;case "OverviewBg":this._overviewBg=a;this._overviewBg.setVisible(!0);break;case "ProfilePic":this._objectData=c;this._profileObject=a;break;case "Frame":this._frame=a;this._frame.setVisible(!0);break;case "ContinuePlayingBtn":this._continuePlayingBtn=a,this._continuePlayingBtn.setVisible(!0)}},createCustomObject:function(a,b){var c=RSPlatformFontAssetManager.getCustomFontVOFromConfig(RSPlatformFontAssetManager.getFontNameForLabelName(b.name));if(c)var d= RSGame.getInstance().getAssetPath(c.fontName);switch(b.name){case "Title":this._title=RSPlatformFontAssetManager.createCustomLabel(" SWITCH ACCOUNT?",b);this.addChild(this._title);break;case "SwitchConfirmationText":this._switchConfirmationText=RSPlatformFontAssetManager.createCustomLabel("Do you wish to switch to your previous account \nor continue playing?",b);this.addChild(this._switchConfirmationText);break;case "CoinIcon":this._coinIcon=RSUtils.createBasicObject(a,b);this.addChild(this._coinIcon); break;case "CoinIcon1":this._coinIcon1=RSUtils.createBasicObject(a,b);this.addChild(this._coinIcon1);break;case "Star1":this._star1=RSUtils.createBasicObject(a,b);this.addChild(this._star1);break;case "Star":this._star=RSUtils.createBasicObject(a,b);this.addChild(this._star);break;case "MeterBg":this._meterBg=RSUtils.createBasicObject(a,b);this.addChild(this._meterBg);break;case "MeterBg1":this._meterBg1=RSUtils.createBasicObject(a,b);this.addChild(this._meterBg1);break;case "CoinValue1":c=this.convertToNewFormat(this._switchAccountDetails.coinValue); this._coinValue1=new RSScaledLabel(c,d,b,kTEXT_ALIGNMENT_CENTER);this.addChild(this._coinValue1);break;case "CoinValue":c=this.convertToNewFormat(RSGame.getInstance().getUserDataManager().getMe().getCoins());this._coinValue=new RSScaledLabel(c,d,b,kTEXT_ALIGNMENT_CENTER);this.addChild(this._coinValue);break;case "LevelsLabel1":RSEngine.gameData.getDefaultValues().isLevelPrefixInSwitchAccount&&1==parseInt(RSEngine.gameData.getDefaultValues().isLevelPrefixInSwitchAccount)?this._levelsLabel1=new RSScaledLabel("LVL "+ this._switchAccountDetails.level,d,b,kTEXT_ALIGNMENT_CENTER):this._levelsLabel1=new RSScaledLabel(this._switchAccountDetails.level,d,b,kTEXT_ALIGNMENT_LEFT);this._levelsLabel1.setScale(c.fontSize);this.addChild(this._levelsLabel1);break;case "LevelsLabel":RSEngine.gameData.getDefaultValues().isLevelPrefixInSwitchAccount&&1==parseInt(RSEngine.gameData.getDefaultValues().isLevelPrefixInSwitchAccount)?this._levelsLabel=new RSScaledLabel("LVL "+RSGame.getInstance().getLevelManager().getCurrentLevel(), d,b,kTEXT_ALIGNMENT_CENTER):this._levelsLabel=new RSScaledLabel(RSGame.getInstance().getLevelManager().getCurrentLevel(),d,b,kTEXT_ALIGNMENT_LEFT);this._levelsLabel.setScale(c.fontSize);this.addChild(this._levelsLabel);break;case "ProgressMeter":this._progressMeter=RSUtils.createBasicObject(a,b);d=RSGame.getInstance().getLevelManager().getLevelBarProgress();1=a.length?RSUtils.formatNumberWithComma(a):14>=a.length?RSUtils.formatNumberWithComma(a.substr(0, a.length-6))+"M":RSUtils.formatNumberWithComma(a.substr(0,a.length-9))+"B"},setProfilePic:function(a,b,c,d,e){b&&(this._screenName=b);a=new RSImageObject;GameConfig.IS_EDIT_FIELDS_ENABLED&&d.includes("AvatarImages")?(d=d.replace("guestplayer","1"),a.setImageFromUrl(d,c.x,c.y,c.w,c.h)):d?(e==LOGIN_MODE.EMAIL&&(d=d.replace("guestplayer","1")),a.setImageFromUrl(d,c.x,c.y,c.w,c.h)):a.setImageFromUrl(GameConfig.BASE_URL+"/res/AvatarImages/guestplayer.png",c.x,c.y,c.w,c.h);this._profileImage=a;this.createProfilePicObject(c)}, createProfilePicObject:function(a){this._profileImage&&a&&(this.mask=new RSClippingNode(RSUtils.createBasicObject(this._screenName,a)),this.mask.setAlphaThreshold(80),this.mask.addChild(this._profileImage),this.addChild(this.mask))},switchAccounts:function(){RSEngine.screenManager.addOverlay();RSLoginManager.getInstance().syncBlobId(this._blobdetails.loginType,this._blobdetails.loginId,this._blobdetails.email,this._blobdetails.oldBlobId,this._blobdetails.newBlobId);this.closePopup();RSLoginManager.getInstance().callFBCarousalCallback(!0)}});var RSEmailEditPopup=RSGenericPopup.extend({init:function(a,b){this._assetList=[{name:RSGame.getInstance().getAssetPath("EditEmailPopup"),count:1}];this._super.init.call(this);this._callBack=a;this._emailVerified=!1;RSPlatformFontAssetManager.loadFontConfigFile(RSGame.getInstance().getAssetPath("EmailEditFontConfig"),"EmailEditFontConfig.json");this._updatedEmail=b},loadContent:function(){this.layoutScreen(this._assetList);this._super.loadContent.call(this)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this)}, onObjectCreated:function(a,b,c){switch(c.name){case "NextBtn":this._nextBtn=a;break;case "EmailInvalidText":this._invalidEmail=a;this._invalidEmail.setVisible(!1);break;case "EmailExistText":this._emailIdExist=a,this._emailIdExist.setVisible(!1)}this._super.onObjectCreated.call(this,a,b,c)},createCustomObject:function(a,b){var c=RSPlatformFontAssetManager.getCustomFontVOFromConfig(RSPlatformFontAssetManager.getFontNameForLabelName(b.name));c&&RSGame.getInstance().getAssetPath(c.fontName);var d=""; switch(b.name){case "EmailEditText":d=RSGame.getInstance().getStringDictionary("RSEmailVerificationPopup")?RSGame.getInstance().getStringDictionary("RSEmailEditPopup").T1:RSGame.getInstance().getGameData().getPopupTextWithKey("EditEmailText");d=d.replace("\\n","\n");this._title=RSPlatformFontAssetManager.createCustomLabel(d,b);this.addChild(this._title);break;case "EmailAddress":this._email=new RSInputBox(b.w,b.h),this._email.setPosition(b.x,b.y-b.h/5),this._email.setFont(c.fontName,b.h/c.fontSize), this._email.setFontColor(c.fontColor.r,c.fontColor.g,c.fontColor.b),this._email.setName("Email"),this._email.setInputMode(1),this._email.setInputFlag(1),this._email.setPlaceholderFont(c.fontName,b.h/c.fontSize),this._email.setPlaceholderFontColor(c.fontColor.r,c.fontColor.g,c.fontColor.b),this._email.setPlaceholderText("Email Address"),this._email.setDelegate(this),this.addChild(this._email)}return this._super.createCustomObject.call(this,a,b)},onButtonClicked:function(a){switch(a){case "CloseBtn":if(this._callBack){this._callBack(); this.closePopup();break}RSEngine.screenManager.addOverlay();RSLoginManager.getInstance().updateSocialLogin("email",this._updatedEmail,null);this.closePopup();break;case "NextBtn":this._invalidEmail.setVisible(!1),this._emailIdExist.setVisible(!1),this._emailVerified?RSLoginManager.getInstance().webSignUp(this._emailEntered,"",this.signUpFailed.bind(this),this._updatedEmail):this._invalidEmail.setVisible(!0)}},editBoxEditingDidEnded:function(a){switch(a.getName()){case "Email":this._emailEntered=a._ccObject._text, this._isEmailValid=this._emailEntered.match(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/),this.setEmailValid(!1),null!=this._isEmailValid?this.setEmailValid(!0):this.setEmailValid(!1)}},editBoxEditingDidBegan:function(a){this._invalidEmail.setVisible(!1);this._emailIdExist.setVisible(!1)},editBoxTextChanged:function(a,b){switch(a.getName()){case "Email":this._email=b;break;case "Password":this._passwd=b}},setEmailValid:function(a){this._invalidEmail.setVisible(!a);this._emailVerified=a},signUpFailed:function(a){cc.log("Response: "+ a);!0==a?(this._callBack&&this._callBack(!0,this._emailEntered),this.closePopup()):this._emailIdExist.setVisible(!0)}});var googleInitializationCompleted=!1,getUserDetailsOnce=!1,GoogleAuth,client;function init(){cc.log("Init completed")}function initializeGoogleSignIn(a,b){a&&initiateAlternateGoogleSignIn()}function getUserProfileImageUrl(){return RSLoginManager.getInstance().getCookie("imageUrl")}function onError(){console.log("Authentication failed");RSAnalyticsManager.getInstance().trackPlayerAction("manage_account","link_google","fail","","Authentication failed")} function initiateAlternateGoogleSignIn(){cc.log("sign in initiated");client=google.accounts.oauth2.initTokenClient({client_id:GameConfig.GOOGLE_CLIENT_ID,scope:"https://www.googleapis.com/auth/userinfo.email",callback:googleSignInCallBack});client.requestAccessToken()} function googleSignInCallBack(a){cc.log("here");var b=new XMLHttpRequest;b.open("GET","https://www.googleapis.com/oauth2/v1/userinfo?alt\x3djson\x26access_token\x3d"+a.access_token,!0);b.setRequestHeader("Content-Type","application/json;charset\x3dUTF-8");b.send();b.onload=function(){try{var a=JSON.parse(b.responseText);onSuccess(a)}catch(d){}}} function onSuccess(a){cc.log("data received");var b={};b.imageUrl=a.picture;RSLoginManager.getInstance().setCookie(GameConfig.SSO_COOKIE_DOMAIN,null,b);RSEngine.screenManager.addOverlay();RSLoginManager.getInstance().updateSocialLogin("google",a.id,a.email)}function signOut(){cc.log("User signed out.")};var RSRestorePasswordPopup=RSGenericPopup.extend({init:function(){this._assetList=[{name:RSGame.getInstance().getAssetPath("RestorePasswordPopup"),count:1}];RSPlatformFontAssetManager.loadFontConfigFile(RSGame.getInstance().getAssetPath("RestorePasswordFontConfig"),"RestorePasswordFontConfig.json");this._super.init.call(this);this._emailVerified=!1},loadContent:function(){this.layoutScreen(this._assetList);this._super.loadContent.call(this)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this); RSAnalyticsManager.getInstance().trackPlayerAction("manage_account","forgot_password","open","","")},onObjectCreated:function(a,b,c){this._super.onObjectCreated.call(this,a,b,c);switch(c.name){case "SendBtn":this._sendBtn=a;break;case "SentEmailText":this._sentEmailText=a;this._sentEmailText.setVisible(!1);break;case "EmailInvalidText":this._emailInvalidText=a,this._emailInvalidText.setVisible(!1)}},createCustomObject:function(a,b){var c=RSPlatformFontAssetManager.getCustomFontVOFromConfig(RSPlatformFontAssetManager.getFontNameForLabelName(b.name)); c&&RSGame.getInstance().getAssetPath(c.fontName);switch(b.name){case "EditEmailTextRestorePassword":c=RSGame.getInstance().getStringDictionary("EditEmailTextRestorePassword")?RSGame.getInstance().getStringDictionary("EditEmailTextRestorePassword").T1:RSGame.getInstance().getGameData().getPopupTextWithKey("EditEmailTextRestorePassword");c=c.replace("\\n","\n");this._msgBody=RSPlatformFontAssetManager.createCustomLabel(c,b);this.addChild(this._msgBody);break;case "EmailAddress":this._email=new RSInputBox(b.w, b.h),this._email.setPosition(b.x,b.y-b.h/5),this._email.setFont(c.fontName,b.h/c.fontSize),this._email.setFontColor(c.fontColor.r,c.fontColor.g,c.fontColor.b),this._email.setName("Email"),this._email.setPlaceholderFont(c.fontName,b.h/c.fontSize),this._email.setPlaceholderFontColor(c.fontColor.r,c.fontColor.g,c.fontColor.b),this._email.setPlaceholderText("Email Address"),this._email.setDelegate(this),this._email.setInputMode(1),this._email.setInputFlag(1),this.addChild(this._email)}return this._super.createCustomObject.call(this, a,b)},onButtonClicked:function(a){switch(a){case "CloseBtn":RSAnalyticsManager.getInstance().trackPlayerAction("manage_account","forgot_password","close","","");this.closePopup();break;case "SendBtn":this._emailVerified?(RSAnalyticsManager.getInstance().trackPlayerAction("manage_account","forgot_password","send","",""),RSLoginManager.getInstance().forgotPassword(this._email,this.onforgotPasswordCallComplete.bind(this))):this._emailInvalidText.setVisible(!0)}},editBoxEditingDidEnded:function(a){switch(a.getName()){case "Email":this._emailEntered= a._ccObject._text,this._isEmailValid=this._emailEntered.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/),this.setEmailValid(!1),null!=this._isEmailValid?this.setEmailValid(!0):this.setEmailValid(!1)}},editBoxEditingDidBegan:function(a){this._emailInvalidText.setVisible(!1);this._sentEmailText.setVisible(!1)},editBoxTextChanged:function(a,b){switch(a.getName()){case "Email":this._email=b}},setEmailValid:function(a){this._emailVerified=a},onforgotPasswordCallComplete:function(a){200==a.result.status?a.result.message? this._emailInvalidText.setVisible(!0):this._sentEmailText.setVisible(!0):this._emailInvalidText.setVisible(!0)}});var RSLogOutPopup=RSPopup.extend({init:function(a){this._super.init.call(this);this._callBack=a;RSPlatformFontAssetManager.loadFontConfigFile(RSGame.getInstance().getAssetPath("RSLogoutFontConfig"),"RSLogoutFontConfig.json");this._msg="Are you sure you would\nlike to log out?"},loadContent:function(){this.layoutScreen(RSGame.getInstance().getAssetPath("RSLogOutPopup"));this._super.loadContent.call(this)},createCustomObject:function(a,b){switch(b.type){case "Label":this._subText=RSPlatformFontAssetManager.createCustomLabel(this._msg, b),this.addChild(this._subText)}},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this)},onButtonClicked:function(a){switch(a){case "No":case "Stay":this._callBack("stay");this.closePopup();break;case "Yes":case "LogOut":this._callBack("logout"),this.closePopup()}},unloadContent:function(){this._callBack=null;this._super.unloadContent.call(this)}});var RSEmailVerificationPopup=RSGenericPopup.extend({init:function(a,b,c){this._assetList=[{name:RSGame.getInstance().getAssetPath("EmailVerificationPopup"),count:1}];RSPlatformFontAssetManager.loadFontConfigFile(RSGame.getInstance().getAssetPath("EmailVerificationFontConfigJson"),"EmailVerificationFontConfig.json");this._super.init.call(this);this._remainigTime=TimeManager.getInstance().getCurrentServerTime()+b;this._timeAtLaunch=TimeManager.getInstance().getCurrentServerTime();this._updatedEmail= a?a:RSEngine.userConfig.email;this._verifiedStatus=this._verificationInProgress=this._timerExpired=!1;this._callBack=c;this._popupClosed=!1;this._editEmailPopup=null},loadContent:function(){this.layoutScreen(this._assetList);this._super.loadContent.call(this);this.scheduleFunctionOnce(this.checkEmailVerifiedORNot.bind(this),5)},onLayoutCompleted:function(){RSAnalyticsManager.getInstance().trackGUIEvent("verification","trigger","","open_from_"+RSAnalyticsManager.getInstance().getCurrentMachineName()); this._super.onLayoutCompleted.call(this)},onObjectCreated:function(a,b,c){this._super.onObjectCreated.call(this,a,b,c);switch(c.name){case "EditHereBtn":this._editHereBtn=a;this._editHereBtn.setVisible(!0);this._editHereBtn.setTouchEnabled(!0);break;case "SendLinkAgain1Btn":this._sendLinkAgain1Btn=a;this._sendLinkAgain1Btn.setVisible(!0);this._sendLinkAgain1Btn.setTouchEnabled(!0);break;case "SendLinkAgain2Btn":this._sendLinkAgain2Btn=a;this._sendLinkAgain2Btn.setVisible(!1);this._sendLinkAgain2Btn.setTouchEnabled(!1); break;case "BottomLine1":this._bottomLine1=a;this._bottomLine1.setVisible(!0);break;case "BottomLine2":this._bottomLine2=a,this._bottomLine2.setVisible(!1)}},createCustomObject:function(a,b){var c=RSPlatformFontAssetManager.getCustomFontVOFromConfig(RSPlatformFontAssetManager.getFontNameForLabelName(b.name)),d="";switch(b.name){case "VerificationTitle":d=RSGame.getInstance().getStringDictionary("RSEmailVerificationPopup")?RSGame.getInstance().getStringDictionary("RSEmailVerificationPopup").T1:RSGame.getInstance().getGameData().getPopupTextWithKey("VerificationTitle"); this._title=RSPlatformFontAssetManager.createCustomLabel(d,b);this.addChild(this._title);break;case "VerificationEmailAddress":d=RSGame.getInstance().getStringDictionary("RSEmailVerificationPopup")?RSGame.getInstance().getStringDictionary("RSEmailVerificationPopup").H1:RSGame.getInstance().getGameData().getPopupTextWithKey("VerificationEmailAddress");RSEngine.loginMode==LOGIN_MODE.GUEST&&(d=RSGame.getInstance().getStringDictionary("RSEmailVerificationPopup")?RSGame.getInstance().getStringDictionary("RSEmailVerificationPopup").H2: RSGame.getInstance().getGameData().getPopupTextWithKey("verificationTextFOrFreshUsers"),d=d.replace("\\n","\n"),b.y+=15);this._emailAddress=RSPlatformFontAssetManager.createCustomLabel(d+"\n"+this._updatedEmail,b);this.addChild(this._emailAddress);break;case "VerificationEmailAddress1":this._emailIdTxt=RSPlatformFontAssetManager.createCustomLabel(this._updatedEmail,b);this._emailIdTxt.setFontColor(c.fontColor.r,c.fontColor.g,c.fontColor.b,255);this.addChild(this._emailIdTxt);break;case "VerificationMessage1":d= RSGame.getInstance().getStringDictionary("RSEmailVerificationPopup")?RSGame.getInstance().getStringDictionary("RSEmailVerificationPopup").H1:RSGame.getInstance().getGameData().getPopupTextWithKey("VerificationEmailAddress");RSEngine.loginMode==LOGIN_MODE.GUEST&&(d=RSGame.getInstance().getStringDictionary("RSEmailVerificationPopup")?RSGame.getInstance().getStringDictionary("RSEmailVerificationPopup").H2:RSGame.getInstance().getGameData().getPopupTextWithKey("verificationTextFOrFreshUsers"),d=d.replace("\\n", "\n"),b.y+=15);this._validationMsg1=RSPlatformFontAssetManager.createCustomLabel(d,b);this.addChild(this._validationMsg1);break;case "VerificationEmailValidationText":d=RSGame.getInstance().getStringDictionary("RSEmailVerificationPopup")?RSGame.getInstance().getStringDictionary("RSEmailVerificationPopup").H3:RSGame.getInstance().getGameData().getPopupTextWithKey("VerificationEmailValidationText");d=d.replace("\\n","\n");this._emailValidationText=RSPlatformFontAssetManager.createCustomLabel(d,b);this.addChild(this._emailValidationText); break;case "Timer":this._timer=RSPlatformFontAssetManager.createCustomLabel("24:00:00",b),this.addChild(this._timer)}return this._super.createCustomObject.call(this,a,b)},onButtonClicked:function(a){switch(a){case "CloseBtn":RSAnalyticsManager.getInstance().trackPlayerAction("verification","close","","open_from_"+RSAnalyticsManager.getInstance().getCurrentMachineName(),"");if(RSLoginManager.getInstance().getCookie(GameConfig.COOKIE_PREFIX+"-blobId")){a=GameConfig.COOKIE_PREFIX+"-email";var b=GameConfig.COOKIE_PREFIX+ "-emailValue",c=GameConfig.COOKIE_PREFIX+"-loginType",d=RSLoginManager.getInstance().getUpdatedLoginTypes("email"),e={};e[a]=this._updatedEmail;e[b]=this._updatedEmail;e[c]=d;RSLoginManager.getInstance().setCookie(GameConfig.SSO_COOKIE_DOMAIN,null,e)}else RSEngine.screenManager.addOverlay(),RSLoginManager.getInstance().updateSocialLogin("email",this._updatedEmail,null);this._callBack&&this._callBack();this.closePopup();break;case "SendLinkAgain1Btn":this._editHereBtn.setTouchEnabled(!1);this._sendLinkAgain1Btn.setTouchEnabled(!1); RSAnalyticsManager.getInstance().trackPlayerAction("verification","resend_email","","open_from_"+RSAnalyticsManager.getInstance().getCurrentMachineName(),"");RSLoginManager.getInstance().resendEmailVerificationCode(this._updatedEmail,this._ongetResponse.bind(this));break;case "SendLinkAgain2Btn":this._editHereBtn.setTouchEnabled(!1);this._sendLinkAgain2Btn.setTouchEnabled(!1);RSAnalyticsManager.getInstance().trackPlayerAction("verification","resend_email","","open_from_"+RSAnalyticsManager.getInstance().getCurrentMachineName(), "");RSLoginManager.getInstance().resendEmailVerificationCode(this._updatedEmail,this._ongetResponse.bind(this));break;case "EditHereBtn":RSAnalyticsManager.getInstance().trackPlayerAction("verification","edit_email","","open_from_"+RSAnalyticsManager.getInstance().getCurrentMachineName(),""),this._editHereBtn.setTouchEnabled(!1),this._editEmailPopup=new RSEmailEditPopup(this.onEmailEditPopupClosed.bind(this),this._updatedEmail),RSEngine.popupManager.addPopup(this._editEmailPopup,!0)}},checkEmailVerifiedORNot:function(){this._verificationInProgress|| (this._verificationInProgress=!0,cc.log("check for email verification"),RSLoginManager.getInstance().checkEmailVerificationStatus(this._updatedEmail,this.onEmailVerificationResponse.bind(this)))},onEmailVerificationResponse:function(a){this._verificationInProgress=!1;cc.log("On Email Verification Response:"+JSON.stringify(a));200==a.result.status&&"1"==a.result.verified?(RSSSOManager.setCookieEmailVerificationStatus(a.result),cc.log("email Verified"),this._verifiedStatus=!0,this.checkForVerificationProgressAndClosePopup()): (a=this.getTimeoutTime(),cc.log("nextCall in :"+a),this.scheduleFunctionOnce(this.checkEmailVerifiedORNot.bind(this),a))},checkForVerificationProgressAndClosePopup:function(){this._verifiedStatus&&(RSEngine.screenManager.addOverlay(),RSLoginManager.getInstance().updateSocialLogin("email",this._updatedEmail,null),this._callBack&&this._callBack(),this._editEmailPopup&&(this._editEmailPopup.closePopup(),this._editEmailPopup=null),this.closePopup())},_ongetResponse:function(){this._editHereBtn.setTouchEnabled(!0); this._sendLinkAgain1Btn.setTouchEnabled(!1);this._sendLinkAgain2Btn.setTouchEnabled(!0);this._bottomLine1.setVisible(!1);this._bottomLine2.setVisible(!0);this._sendLinkAgain1Btn.setVisible(!1);this._sendLinkAgain2Btn.setVisible(!0)},onEmailEditPopupClosed:function(a){this._editEmailPopup=null;this._editHereBtn.setTouchEnabled(!0);a&&this.closePopup()},update:function(){var a=this._remainigTime-TimeManager.getInstance().getCurrentServerTime();0a-this._timeAtLaunch?5:180>a-this._timeAtLaunch?10:30}});var RSEmailVerificationPromptPopup=RSGenericPopup.extend({init:function(a,b,c){this._assetList=[{name:RSGame.getInstance().getAssetPath("EmailVerificationPopup"),count:1}];RSPlatformFontAssetManager.loadFontConfigFile(RSGame.getInstance().getAssetPath("EmailVerificationFontConfigJson"),"EmailVerificationFontConfig.json");this._assetConfig.font=RSGame.getInstance().getAssetPath(RSPlatformFontAssetManager.getFontNameForLabelName("Button"));this._super.init.call(this);this._mailId=a?a:RSEngine.userConfig.email; this._remainigTime=TimeManager.getInstance().getCurrentServerTime()+300;this._timeAtLaunch=TimeManager.getInstance().getCurrentServerTime();this._verifiedStatus=this._verificationInProgress=this._timerExpired=!1;this._callBack=b;this._openFrom=c?c:RSAnalyticsManager.getInstance().getCurrentMachineName();this._editEmailPopup=null},loadContent:function(){this.layoutScreen(this._assetList);this._super.loadContent.call(this);this.scheduleFunctionOnce(this.checkEmailVerifiedORNot.bind(this),5)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this); "giftcenter"==this._openFrom?RSAnalyticsManager.getInstance().trackPlayerAction("verification","open","","open_from_"+this._openFrom,""):RSAnalyticsManager.getInstance().trackGUIEvent("verification","trigger","","open_from_"+this._openFrom)},onObjectCreated:function(a,b,c){this._super.onObjectCreated.call(this,a,b,c);switch(c.name){case "EditHereBtn":this._editHereBtn=a;this._editHereBtn.setVisible(!0);this._editHereBtn.setTouchEnabled(!0);break;case "SendLinkAgain1Btn":this._sendLinkAgain1Btn=a; this._sendLinkAgain1Btn.setVisible(!0);this._sendLinkAgain1Btn.setTouchEnabled(!0);break;case "SendLinkAgain2Btn":this._sendLinkAgain2Btn=a;this._sendLinkAgain2Btn.setVisible(!1);this._sendLinkAgain2Btn.setTouchEnabled(!1);break;case "BottomLine1":this._bottomLine1=a;this._bottomLine1.setVisible(!0);break;case "BottomLine2":this._bottomLine2=a,this._bottomLine2.setVisible(!1)}},createCustomObject:function(a,b){var c=RSPlatformFontAssetManager.getCustomFontVOFromConfig(RSPlatformFontAssetManager.getFontNameForLabelName(b.name)), d="";switch(b.name){case "VerificationTitle":d=RSGame.getInstance().getStringDictionary("RSEmailVerificationPromptPopup")?RSGame.getInstance().getStringDictionary("RSEmailVerificationPromptPopup").T1:RSGame.getInstance().getGameData().getPopupTextWithKey("VerificationTitle");this._title=RSPlatformFontAssetManager.createCustomLabel(d,b);this.addChild(this._title);break;case "VerificationEmailAddress":d=RSGame.getInstance().getStringDictionary("RSEmailVerificationPromptPopup")?RSGame.getInstance().getStringDictionary("RSEmailVerificationPromptPopup").H1: RSGame.getInstance().getGameData().getPopupTextWithKey("VerificationEmailAddress");if(RSEngine.loginMode==LOGIN_MODE.GUEST||"giftcenter"==this._openFrom||!RSSSOManager.checkForMigratedUserOrNOt()&&!RSGame.getInstance().getUserDataManager().getMe().getLoginRewardStatus())d=RSGame.getInstance().getStringDictionary("RSEmailVerificationPromptPopup")?RSGame.getInstance().getStringDictionary("RSEmailVerificationPromptPopup").H2:RSGame.getInstance().getGameData().getPopupTextWithKey("verificationTextFOrFreshUsers"), b.y+=15;d=d.replace("\\n","\n");this._emailAddress=RSPlatformFontAssetManager.createCustomLabel(d+"\n"+this._mailId,b);this.addChild(this._emailAddress);break;case "VerificationEmailAddress1":this._emailIdTxt=RSPlatformFontAssetManager.createCustomLabel(this._mailId,b);this._emailIdTxt.setFontColor(c.fontColor.r,c.fontColor.g,c.fontColor.b,255);this.addChild(this._emailIdTxt);break;case "VerificationMessage1":d=RSGame.getInstance().getStringDictionary("RSEmailVerificationPopup")?RSGame.getInstance().getStringDictionary("RSEmailVerificationPopup").H1: RSGame.getInstance().getGameData().getPopupTextWithKey("VerificationEmailAddress");if(RSEngine.loginMode==LOGIN_MODE.GUEST||"giftcenter"==this._openFrom||!RSSSOManager.checkForMigratedUserOrNOt()&&!RSGame.getInstance().getUserDataManager().getMe().getLoginRewardStatus())d=RSGame.getInstance().getStringDictionary("RSEmailVerificationPopup")?RSGame.getInstance().getStringDictionary("RSEmailVerificationPopup").H2:RSGame.getInstance().getGameData().getPopupTextWithKey("verificationTextFOrFreshUsers"), b.y+=15;d=d.replace("\\n","\n");this._validationMsg1=RSPlatformFontAssetManager.createCustomLabel(d,b);this.addChild(this._validationMsg1);break;case "VerificationPromptEmailValidationText":d=RSGame.getInstance().getStringDictionary("RSEmailVerificationPromptPopup")?RSGame.getInstance().getStringDictionary("RSEmailVerificationPromptPopup").H3:RSGame.getInstance().getGameData().getPopupTextWithKey("VerificationPromptEmailValidationText");this._emailValidationText=RSPlatformFontAssetManager.createCustomLabel(d, b);this.addChild(this._emailValidationText);break;case "Timer":this._emailValidationTimer=RSPlatformFontAssetManager.createCustomLabel("00:00:00",b),this.addChild(this._emailValidationTimer)}return this._super.createCustomObject.call(this,a,b)},onButtonClicked:function(a){switch(a){case "CloseBtn":RSAnalyticsManager.getInstance().trackPlayerAction("verification","close","","open_from_"+this._openFrom,"");RSSSOManager.checkForMigratedUserOrNOt()||RSLoginManager.getInstance().removeLoginData("email"); this._callBack&&this._callBack();this.closePopup();break;case "EditHereBtn":this._editHereBtn.setTouchEnabled(!1);RSAnalyticsManager.getInstance().trackPlayerAction("verification","edit_email","","open_from_"+this._openFrom,"");this._editEmailPopup=new RSEmailEditPopup(this.onEmailEditPopupClosed.bind(this),this._mailId);RSEngine.popupManager.addPopup(this._editEmailPopup,!0);break;case "SendLinkAgain1Btn":this._editHereBtn.setTouchEnabled(!1);this._sendLinkAgain1Btn.setTouchEnabled(!1);RSAnalyticsManager.getInstance().trackPlayerAction("verification", "resend_email","","open_from_"+this._openFrom,"");RSLoginManager.getInstance().resendEmailVerificationCode(this._mailId,this._ongetResponse.bind(this));break;case "SendLinkAgain2Btn":this._editHereBtn.setTouchEnabled(!1),this._sendLinkAgain2Btn.setTouchEnabled(!1),RSAnalyticsManager.getInstance().trackPlayerAction("verification","resend_email","","open_from_"+this._openFrom,""),RSLoginManager.getInstance().resendEmailVerificationCode(this._mailId,this._ongetResponse.bind(this))}},onEmailEditPopupClosed:function(a, b){this._editEmailPopup=null;if(this._editHereBtn&&(this._editHereBtn.setTouchEnabled(!0),a)){if(b){var c=GameConfig.COOKIE_PREFIX+"-email",d=GameConfig.COOKIE_PREFIX+"-emailValue",e=GameConfig.COOKIE_PREFIX+"-loginType",f=RSLoginManager.getInstance().getUpdatedLoginTypes("email"),g={};g[c]=b;g[d]=b;g[e]=f;RSLoginManager.getInstance().setCookie(GameConfig.SSO_COOKIE_DOMAIN,null,g);RSGame.getInstance().getUserDataManager().getMe().setEmail(b)}this.closePopup()}},_ongetResponse:function(){this._editHereBtn.setTouchEnabled(!0); this._sendLinkAgain1Btn.setTouchEnabled(!1);this._sendLinkAgain2Btn.setTouchEnabled(!0);this._bottomLine1.setVisible(!1);this._bottomLine2.setVisible(!0);this._sendLinkAgain1Btn.setVisible(!1);this._sendLinkAgain2Btn.setVisible(!0)},update:function(){if(this._emailValidationTimer){var a=this._remainigTime-TimeManager.getInstance().getCurrentServerTime();0a-this._timeAtLaunch?5:180>a-this._timeAtLaunch?10:30}});var RSGameReloadPopup=RSGenericPopup.extend({init:function(a){this._assetList=[{name:RSGame.getInstance().getAssetPath("GameReloadPopup"),count:1}];this._loginType=a;RSGame.getInstance().getLoadingManger().getProgressPercentage(!0);this._super.init.call(this);this.string=["SYNCING...","SETTING UP YOUR PROFILE...","ALMOST THERE...","COMPLETE!"];this._msgID=1;cc.spriteFrameCache.addSpriteFrames(RSGame.getInstance().getAssetFolder("AvatarPopup")+"AvatarImages_00-hd.plist");RSPlatformFontAssetManager.loadFontConfigFile(RSGame.getInstance().getAssetPath("GameReloadFontConfig"), "GameReloadFontConfig.json");this._prevPercentage=0;this._displaypercert=1},loadContent:function(){this.layoutScreen(this._assetList);this._super.loadContent.call(this)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);this._percentageValue=RSGame.getInstance().getLoadingManger().getProgressPercentage()},onObjectCreated:function(a,b,c){switch(c.name){case "ProfileFrame":this._profileFrame=a;this._profileFrame.setVisible(!0);break;case "GameLoading":this._gameLoading=a;this._gameLoading.setVisible(!0); break;case "Title":this._title=a,this._title.stopAnimation(),"google"==this._loginType?this._title.setFrame(2):"apple"==this._loginType?this._title.setFrame(1):"facebook"==this._loginType?this._title.setFrame(0):"email"==this._loginType&&this._title.setFrame(3)}this._super.onObjectCreated.call(this,a,b,c)},actionOnUpdate:function(a,b){"progressMove"==a&&(this._bar.setPosition(this._barPos.getX(),this._barPos.getY()),this._bar.moveX(-this._barWidth/2),this._bar.setScaleX(b),this._barPercent=b%1,this._displaypercert= Math.floor(100*b),this._progression.setString("PLEASE WAIT... "+this._displaypercert+"%"))},actionOnComplete:function(a){"ReloadRollUp"==a&&this.stopActionTweenForKey("ReloadRollUp");100==this._displaypercert&&(this._userText.setString(this.string[3]),this._userText.getString()==this.string[3]&&this.scheduleFunctionOnce(function(){this.closePopup()}.bind(this),0.5))},moveBarTo:function(a,b){var c=this._barPercent;this.stopActionTweenForKey("progressMove");this.startActionTweenForKey("progressMove", 0.3,c,a)},update:function(){this._percentageValue=2*RSGame.getInstance().getLoadingManger().getProgressPercentage();this._percentageValue>=this._prevPercentage&&(this.displayMessages(),this.showRollups(),this._prevPercentage=this._percentageValue)},displayMessages:function(){this._userText&&this._percentageValue>100*this._msgID/3&&4>this._msgID&&(this._userText.setString(this.string[this._msgID]),this._msgID+=1)},showRollups:function(){this._prevPercentage=GameConfig.JACKPOT_LOUNGE_LEVEL&&(GameConfig.SWEEPSTAKES_ENABLED&&!RSGame.getInstance().getUserDataManager().getMe().getSweepstakesSurfaceShownStatus()&&RSGame.getInstance().getGameVariable().getSweepstakeEnabledStatus()&&!RSSweepstakesManager.getCoolDownTimeEnableStatus()||RSGame.getInstance().getGameManager().showIntroScreenForJL())},slotsLobbyTabSelected:function(a){for(var b= 0;b=this._vipTierValue&&(this._enabled=!0)):this._enabled=!0:GameFeatureTypeEnum.MACHINE_GIFT&&MachineGiftingManager.getInstance().isMachineGifted(this._machineDetails.machine_identifier)&&(this._enabled=!0,this._timerBG.setVisible(!0),this._timerText.setVisible(!0)); this._setTouchEventListener(this._enabled,this._vipTierValue)},_setMinBet:function(){this._minBetTxt=RSGame.getInstance().getGameData().getMinimumBetByGameTypeAndName(RSGame.getInstance().getGameManager().getGameType(),this._machineDetails);this._labelrightText&&this._labelrightText.setString(RSUtils.formatNumber(this._minBetTxt))},handleObjectTouchAt:function(a,b,c){},handleObjectTouchMoveAt:function(a,b,c){},handleObjectTouchEndAt:function(a,b,c){this._machineStatus==MACHINE_STATUS.UNAVAILABLE? RSGame.getInstance().getGameManager().triggerMachineUnAvailablePopup(this._machineDetails.machine_identifier):this._enabled&&(RSGame.getInstance().getGameManager().setLocationForMachineOpenPopup(b,c),a.setTouchEnabled(!1),this._onPlayClicked(this._machineDetails,this._enabled,a,b,c))},handleButtonClick:function(a,b){this._enabled&&(a.setTouchEnabled(!1),this._onPlayClicked(this._machineDetails,this._enabled,a))},_setTouchEventListener:function(a,b){!this._isClickDisabled&&this._touchArea&&(0=this._iconTier?!1:!0;this._unlockedTier>a&&this._unlockedTier>=this._iconTier&&this._lockStatus&&(this._lockStatus=!1,RSGame.getInstance().getUserDataManager().getMe().setVipMachineUnlocked(this._iconTier), this.unlockIcon())},setTempUnlockValues:function(a,b){var c=RSUtils.formattedTime(parseInt(a));if(this._timerBG){if(0==a)if(this._timerBG.setVisible(!1),this._timerText.setVisible(!1),MachineGiftingManager.getInstance().getFreeSpinStatus())UrlNotificationManager.getInstance().getAllMachineUnlockStatus()&&this._checkAndEnableMachineLock();else{MachineGiftingManager.getInstance().resetTempUnlockvalues(b);this._checkAndEnableMachineLock();return}this._timerText.setString(c)}},_checkAndEnableMachineLock:function(){this._checkMachineUnlockStatus(); this._setMinBetCoinAndUnlockVisibility();this._setIconLockAndVipTexts()},_setIconLockAndVipTexts:function(){this._enabled?(this._layoutType!=this.VIP_ICON?this._iconLock&&this._iconLock.setVisible(!1):this._iconLock&&(this._iconLock.stopAnimation(),this._iconLock.setFrame(this._vipTierValue-1)),this._locked&&this._locked.setVisible(!1),this._leftText&&this._leftText.setVisible(!0),this._rightText&&this._labelrightText.setVisible(!0),this._VIPlabel&&this._VIPlabel.setVisible(!1),this._VIPTier&&this._VIPTier.setVisible(!1), this._levelValue&&this._machineDetails.levelRequired<=RSGame.getInstance().getLevelManager().getCurrentLevel()&&this._levelValue.setVisible(!1)):0=this._tutorialStateCount&&a!==RSGameScreens.Machine)this.showTutorialEndPopup();else{var b=this._tutorialDataVOArray[this._currentTutorialStateIndex].screenName; this._currentTutorialStateIndexe&&(f=!0);break;case "\x3c\x3d":a<=e&&(f=!0);break;case "\x3e\x3d":a>=e&&(f=!0);break;case "\x3d\x3d":a==e&&(f=!0);break;case "!\x3d":a!= e&&(f=!0);break;case "%":0==a%e&&(f=!0)}return f},_getReward:function(){var a=0;"TBD"==this._placementObject.Reward?"ExitDailyBonusPoker"==this._placement?(a=RSGame.getInstance().getGameData().getSheetData("retentionBonus"),a=RSUtils.sortObjectWithIntKey(a,"day"),a=parseInt(a[GlobalVars.sevenDayBonusDay-1].coin)):"ExitBihourlyBonusPoker"==this._placement&&(a=RSGame.getInstance().getGameData().getSheetData("hourlyBonusConfig"),a=parseInt(a[0].hourlyBonusCoins)):null!=this._placementObject.Reward&& (a=parseInt(this._placementObject.Reward));return a},showAd:function(a,b,e,f){RSEngine.audioManager.setMusicVolume(0);this._isQuestAd=f;if(f=document.getElementById("SpinGame"))f.style.visibility="hidden";f=a?a:"rewarded";e&&this._setVideoWatchReward(e);this._placementName=b?b:"Ad_PD";this._videoWatchCount++;b=document.createElement("LifeStreet");b.id="LifeStreet";b.innerHTML="\x3ciframe id\x3d'lifeStreet' scrolling\x3d'no' height\x3d'100%' frameborder\x3d'0' width\x3d'100%' marginheight\x3d'0' marginwidth\x3d'0' src\x3d'res/WebAssets/lifeStreet.html?type\x3d"+ f+"'\x3e\x3c/iframe\x3e";document.getElementById("Cocos2dGameContainer").appendChild(b);RSEngine.closeFullScreen();(b=document.getElementById("lifeStreet"))&&b.contentWindow.focus();GameConfig.PLATFORM_EVENT_MANAGER_ENABLED?this._type=a:RSGame.getInstance().getUserDataManager().getMe().setVideoWatchCount(this._videoWatchCount);RSAnalyticsManager.getInstance().trackVideoBonusEvent("ad",this._type,"started",this._placementName,"lifeStreet");RSGame.getInstance().getGameManager().setSideMenuVisibility(!1)}, onCrossLinkClosed:function(a){var b=document.getElementById("SpinGame");b&&(b.style.visibility="visible");GlobalVars.musicVolumeLevel&&RSEngine.audioManager.setMusicVolume(GlobalVars.musicVolumeLevel);document.getElementById("LifeStreet")&&document.getElementById("LifeStreet").remove();a&&("PurchaseCartCloseWithoutPurchase"==this._placement&&GlobalVars.videoWatchCountForPurchaseCartClose++,!0==a.detail.status?(RSAnalyticsManager.getInstance().trackVideoBonusEvent("ad",this._type,"completed",this._placementName, "lifeStreet"),GameConfig.PLATFORM_EVENT_MANAGER_ENABLED?this._isQuestAd?("undefined"!==typeof SideMenuController&&SideMenuController.getInstance().setSideMenuVisibility(!0),RSEventManager.getInstance().dispatchEvent(RSGeneralQuestEventKeys.WATCH_AD_ACTION,1)):RSEventManager.getInstance().dispatchEvent(RSPlatformEventTypeKeys.COLLECT_AD_REWARD,AD_REWARD_STATUS.COMPLETED):(RSEngine.screenManager.addOverlay(),this._updateVideoReward())):"EXCEPTION"==a.detail.event?GameConfig.PLATFORM_EVENT_MANAGER_ENABLED? RSEventManager.getInstance().dispatchEvent(RSPlatformEventTypeKeys.COLLECT_AD_REWARD,AD_REWARD_STATUS.EXCEPTION):(this._istriggered||RSEventManager.getInstance().dispatchEvent(videoNotAvailable),null!=this._callBack&&this._callBack()):("interstitial"==this._type&&RSAnalyticsManager.getInstance().trackVideoBonusEvent("ad",this._type,"completed",this._placementName,"lifeStreet"),RSAnalyticsManager.getInstance().trackVideoBonusEvent("ad",this._type,"closed",this._placementName,"lifeStreet"),GameConfig.PLATFORM_EVENT_MANAGER_ENABLED? (this._isQuestAd&&(RSEventManager.getInstance().dispatchEvent(RSGeneralQuestEventKeys.WATCH_AD_ACTION,1),RSEventManager.getInstance().dispatchEvent("WatchAdCompleted"),RSEngine.dataManager.getMe().setWatchAdQuestSetId(RSQuestManager.getInstance().getCurrentQuestSetId()),RSEngine.popupManager.addPopup(new RSDailyQuestPopup(RSGame.getInstance().getAssetPath("DailyChallengePopup"),RSGame.getInstance().getGameManager().getDefaultFontForDailyQuestRewardText()))),RSEventManager.getInstance().dispatchEvent(RSPlatformEventTypeKeys.COLLECT_AD_REWARD, AD_REWARD_STATUS.CANCELLED)):(this._istriggered||RSEventManager.getInstance().dispatchEvent(videoAvailable),null!=this._callBack&&this._callBack())),!1!=a.detail.status||this._videoPopup||"undefined"===typeof SideMenuController||this._isQuestAd||RSGame.getInstance().getGameManager().setSideMenuVisibility(!0));this._isQuestAd=!1},_updateVideoReward:function(){RSGame.getInstance().getUserDataManager().rewardVideoBonus(this._placement,this.onVideoBonusUpdated.bind(this),this.onVideoBonusUpdateFailed.bind(this))}, onVideoBonusUpdated:function(a){this._retryCount=0;RSEngine.screenManager.removeOverlay();a.result.data&&(this._istriggered||RSEventManager.getInstance().dispatchEvent(videoAvailable),RSEngine.popupManager.addPopup(new VideoRewardPopup(this._reward,!0,this.freeChipsPopupsCallback.bind(this)),!1),RSCasinoManager.triggerPrimarySourceEvent(RSAnalyticsSource.paid,"video_bonus",this._reward,this._placementName,"lifeStreet"))},freeChipsPopupsCallback:function(){null!=this._callBack&&this._callBack()},onCallBackOnCoinSuccess:function(){RSPlatformSDKManager.getInstance().setAttribute(SDK_ATTRIBUTE_TYPE.coins, RSGame.getInstance().getUserDataManager().getMe().getCoins())},onVideoBonusUpdateFailed:function(a){3>this._retryCount?(this._retryCount++,this._updateVideoReward()):(this._retryCount=0,RSErrorTracker.getInstance().trackErrorMessage("REWARD_VIDEO_BONUS","Error collecting video reward bonus","mahesh.jose@rubyseven.net,lijith.puthiyoottil@rubyseven.net"))},_setVideoWatchReward:function(a){this._reward=a},getAdBlockerStatus:function(){return this._adBlockerEnabled},unload:function(){this._super.unload.call(this)}}); return{getInstance:function(){a||(a=new b);return a}}}();var VideoRewardPopup=RSGenericPopup.extend({init:function(a,b,c,d,e){this._coinAwarded=a;this._messages=e?RSGame.getInstance().getGameData().getPopupMessagesWithKey(e):RSGame.getInstance().getGameData().getPopupMessagesWithKey("videoReward");this._claimReward=b;this._assetList=[{name:RSGame.getInstance().getAssetPath("AdMobPopup"),count:1}];this._coinAnim=null;this._videoNotAvailable=e;d&&(this._placementName=d);(this._adPopupFonts=RSGame.getInstance().getGameManager().getAdPopupFonts())&&(this._assetConfig.font= this._adPopupFonts.BUTTON_TEXT.stroke?RSGame.getInstance().getGameManager().getDefaultCasinoFont(this._adPopupFonts.BUTTON_TEXT.size,this._adPopupFonts.BUTTON_TEXT.type,this._adPopupFonts.BUTTON_TEXT.stroke):RSGame.getInstance().getGameManager().getDefaultCasinoFont(this._adPopupFonts.BUTTON_TEXT.size,this._adPopupFonts.BUTTON_TEXT.type));this._super.init.call(this,c,this._assetConfig)},loadContent:function(){this.layoutScreen(this._assetList);this._super.loadContent.call(this)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this); this._claimReward?(this._thanksButton.setVisible(!0),this._claimButton.setVisible(!1),this._continueButton&&this._continueButton.setVisible(!1)):(this._coinPanel.setVisible(!1),this._coinStack&&this._coinStack.setVisible(!1),this._coinStackLeft&&this._coinStackLeft.setVisible(!1),this._coinStackRight&&this._coinStackRight.setVisible(!1),this._char&&this._char.setVisible(!1),this._videoNotAvailable?(this._continueButton.setVisible(!0),this._claimButton.setVisible(!1),this._thanksButton.setVisible(!1), "adnotAvailable"==this._videoNotAvailable&&(this._continueButton.setVisible(!1),this._claimButton.setVisible(!1),this._thanksButton.setVisible(!1),this._tryAgainButton.setVisible(!0),this._subHeading.setVisible(!1),this._subHeading1.setVisible(!0))):(this._claimButton.setVisible(!0),this._thanksButton.setVisible(!1)))},onObjectCreated:function(a,b,c){this._super.onObjectCreated.call(this,a,b,c);switch(c.name){case "CoinPanel":this._coinPanel=a;break;case "CoinStack":this._coinStack=a;break;case "CoinStacksLeft":this._coinStackLeft= a;break;case "CoinStacksRight":this._coinStackRight=a;break;case (c.name.match(/CP_Char/)||{}).input:this._char=a;break;case "CloseBtn":this._closeButton=a}switch(c.type){case "CP_Button_T1":this._thanksButton=a;this._coinAnim=c;break;case "CP_Button_T2":this._claimButton=a;this._coinAnim=c;break;case "CP_Button_T3":this._continueButton=a;this._continueButton.setVisible(!1);break;case "CP_Button_T4":this._tryAgainButton=a,this._tryAgainButton.setVisible(!1)}},createCustomObject:function(a,b){switch(b.name){case "SubTitle":this._subtitleFont= this._adPopupFonts.SUBTITLE?RSGame.getInstance().getGameManager().getDefaultCasinoFont(this._adPopupFonts.SUBTITLE.size,this._adPopupFonts.SUBTITLE.type):RSGame.getInstance().getGameManager().getDefaultCasinoFont("medium","bold");this._subHeading=new RSLabelBMFont("",this._subtitleFont,2*b.w,kTEXT_ALIGNMENT_CENTER);this._subHeading.setCenter(b.x,b.y);var c="";this._claimReward?(c=this._messages.messageBodyAvailable,this._subHeading.setString(c),"AP"==GameConfig.GAME_ID||"UP"==GameConfig.GAME_ID?this._subHeading.setScale(1.2): this._subHeading.setScale(0.9)):(c=this._messages.messageBodyClaimed,this._subHeading.setString(c),"AP"==GameConfig.GAME_ID||"UP"==GameConfig.GAME_ID?(this._subHeading.setCenter(b.x,b.y-32),this._subHeading.setScale(0.8)):this._subHeading.setScale(0.6));this.addChild(this._subHeading);break;case "SubTitle1":this._subtitleFont=this._adPopupFonts.SUBTITLE?RSGame.getInstance().getGameManager().getDefaultCasinoFont(this._adPopupFonts.SUBTITLE.size,this._adPopupFonts.SUBTITLE.type):RSGame.getInstance().getGameManager().getDefaultCasinoFont("medium", "bold");this._subHeading1=new RSLabelBMFont("",this._subtitleFont,2*b.w,kTEXT_ALIGNMENT_CENTER);this._subHeading1.setCenter(b.x,b.y);c=this._messages.messageBodyClaimed;this._subHeading1.setString(c);this._subHeading1.setScale(0.9);this._subHeading1.setVisible(!1);this.addChild(this._subHeading1);break;case "CoinText":if(isNaN(this._coinAwarded)||0>=this._coinAwarded)return;null!=RSGame.getInstance().getGameManager().getVideoRewardPopupFont()?this._coinTextFont=RSGame.getInstance().getGameManager().getVideoRewardPopupFont(): this._coinTextFont=this._adPopupFonts.REWARDTYPE1?RSGame.getInstance().getGameManager().getDefaultCasinoFont(this._adPopupFonts.REWARDTYPE1.size,this._adPopupFonts.REWARDTYPE1.type):RSGame.getInstance().getGameManager().getDefaultCasinoFont("large","bold");this._titleText=new RSScaledLabel("",this._coinTextFont,b,kTEXT_ALIGNMENT_CENTER);this.addChild(this._titleText);this._titleText.setString(RSUtils.formatNumber(this._coinAwarded));break;case "Title":c=this._claimReward?this._messages.messageTitleAvailable: this._messages.messageTitleClaimed,this._titleFont=this._adPopupFonts.TITLE?RSGame.getInstance().getGameManager().getDefaultCasinoFont(this._adPopupFonts.TITLE.size,this._adPopupFonts.TITLE.type):RSGame.getInstance().getGameManager().getDefaultCasinoFont("large","bold"),this._heading=new RSScaledLabel(c,this._titleFont,b,kTEXT_ALIGNMENT_CENTER),this.addChild(this._heading)}return this._super.createCustomObject.call(this,a,b)},onCallBackOnCoinSuccess:function(){var a=new RSRect(0,0,0,0);this._diplayPanel= new RSDisplayObject(a);this.addChild(this._diplayPanel);this._diplayPanel.setZOrder(1);a=this._diplayPanel.convertToNodeSpace(this._coinAnim.x,this._coinAnim.y);RSEngine.screenManager.removeOverlay();RSGame.getInstance().getGameManager().getGameType()==RSGameTypes.Bingo&&RSEngine.externalGameManager.setBingoData();RSCasinoManager.getCasinoHUD().playCoinReceivedAnimation(a,this._diplayPanel,this.closePopup.bind(this));RSPlatformSDKManager.getInstance().setAttribute(SDK_ATTRIBUTE_TYPE.coins,RSGame.getInstance().getUserDataManager().getMe().getCoins())}, onButtonClicked:function(a){switch(a){case "CP_Button_T2":!this._claimReward&&this._placementName&&RSAnalyticsManager.getInstance().trackGUIEvent("max_ad_limit","click","",this._placementName);this.closePopup();break;case "CP_Button_T3":this.closePopup();break;case "CP_Button_T4":this.closePopup();break;case "CP_Button_T1":case "CloseBtn":this._claimReward?(this._claimButton.setTouchEnabled(!1),this._closeButton.setTouchEnabled(!1),RSEngine.screenManager.addOverlay(),RSGame.getInstance().getUserDataManager().getCoinBalance(this.onCallBackOnCoinSuccess.bind(this))): (this.closePopup(),this._videoNotAvailable||this._placementName&&RSAnalyticsManager.getInstance().trackGUIEvent("max_ad_limit","close","",this._placementName))}}});var videoNotAvailable="videoNotAvailable",videoAvailable="videoAvailable",VideoPopup=RSGenericPopup.extend({init:function(a,b,c,d){this._assetList=[{name:RSGame.getInstance().getAssetPath("PurchaseDisabledPopup"),count:1}];var e=new RSRect(0,0,0,0);this._diplayPanel=new RSDisplayObject(e);this._super.init.call(this,d);this._playButton=this._closeButton=null;this._source=c;this._noAdIcon=this._adIcon=this._loadingCircle=this._txtCredits=null;this._reward=b;this._placement=a;this._adPopupFonts=RSGame.getInstance().getGameManager().getAdPopupFonts(); GameConfig.HOUSE_ADS_ENABLED||RSAnalyticsManager.getInstance().trackVideoBonusEvent("lifeStreet","ad","trigger","Ad_PD");RSAnalyticsManager.getInstance().trackGUIEvent("purchase_disable_popup","trigger",this._source,"");RSEventManager.getInstance().addEventListener(videoNotAvailable,this,this._onVideoNotAvailable.bind(this));RSEventManager.getInstance().addEventListener(videoAvailable,this,this._onVideoAvailable.bind(this))},getName:function(){return"VideoPopup"},loadContent:function(){this.layoutScreen(this._assetList); this._super.loadContent.call(this)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);this.addChild(this._diplayPanel)},onObjectCreated:function(a,b,c){this._super.onObjectCreated.call(this,a,b,c);switch(c.name){case "CloseBtn":this._closeButton=a;break;case "MediumBtn":case "MediumBtnType2":this._playButton=a;break;case "LoadingCircle":this._loadingCircle=a,this._loadingCircle.stopAnimation(),this._loadingCircle.setVisible(!1)}},createCustomObject:function(a,b){var c=RSGame.getInstance().getGameData().getPopupMessagesWithKey("purchaseDisabled"); switch(b.name){case "Title":this._titleFont=this._adPopupFonts.TITLE?RSGame.getInstance().getGameManager().getDefaultCasinoFont(this._adPopupFonts.TITLE.size,this._adPopupFonts.TITLE.type):RSGame.getInstance().getGameManager().getDefaultCasinoFont("large","bold");c=new RSLabelBMFont(c.messageTitleClaimed,this._titleFont,2*b.w,kTEXT_ALIGNMENT_CENTER);c.setScale(this._adPopupFonts.TITLE_TEXT_SCALE?this._adPopupFonts.TITLE_TEXT_SCALE:".9");this.addChild(c);c.setCenter(b.x,b.y);break;case "Heading":this._subtitleFont= this._adPopupFonts.SUBTITLE?RSGame.getInstance().getGameManager().getDefaultCasinoFont(this._adPopupFonts.SUBTITLE.size,this._adPopupFonts.SUBTITLE.type):RSGame.getInstance().getGameManager().getDefaultCasinoFont("medium","bold");"AP"==GameConfig.GAME_ID?(this._txtHeading=new RSLabelBMFont(c.messageBodyClaimed,this._subtitleFont,1.5*b.w,kTEXT_ALIGNMENT_CENTER),this._txtHeading.setScale(0.63)):"FPC"==GameConfig.GAME_ID?(this._txtHeading=new RSLabelBMFont(c.messageBodyClaimed,this._subtitleFont,1.65* b.w,kTEXT_ALIGNMENT_CENTER),this._txtHeading.setScale(0.6)):"UP"==GameConfig.GAME_ID?(this._txtHeading=new RSLabelBMFont(c.messageBodyClaimed,this._subtitleFont,1.5*b.w,kTEXT_ALIGNMENT_CENTER),this._txtHeading.setScale(0.59)):(this._txtHeading=new RSLabelBMFont(c.messageBodyClaimed,this._subtitleFont,2*b.w,kTEXT_ALIGNMENT_CENTER),this._txtHeading.setScale(0.5));this.addChild(this._txtHeading);this._txtHeading.setCenter(b.x,b.y);break;case "AdIcon":this._adIcon=RSUtils.createBasicObject(a,b);this.addChild(this._adIcon); break;case "NoAds":this._noAdIcon=RSUtils.createBasicObject(a,b),this.addChild(this._noAdIcon),this._noAdIcon.setVisible(!1)}return this._super.createCustomObject.call(this,a,b)},onButtonClicked:function(a){switch(a){case "CloseBtn":this._closeButton.setTouchEnabled(!1);RSAnalyticsManager.getInstance().trackVideoBonusEvent("lifeStreet","ad","close","Ad_PD");RSAnalyticsManager.getInstance().trackGUIEvent("purchase_disable_popup","close",this._source,"");this.closePopup();break;case "CP_Button_T2":this._playButton.setTouchEnabled(!1); RSAnalyticsManager.getInstance().trackVideoBonusEvent("lifeStreet","ad","close","Ad_PD");RSAnalyticsManager.getInstance().trackGUIEvent("purchase_disable_popup","close",this._source,"");this.closePopup();break;case "CP_Button_T1":this._playButton.setTouchEnabled(!1),this.closePopup(),RSAnalyticsManager.getInstance().trackGUIEvent("purchase_disable_popup","watch_ad",this._source,""),a=(a=(a=RSGame.getInstance().getPlatformEventManager())?a.getUserEventStatus():null)?a.ClickToWatchAd:null,GameConfig.PLATFORM_EVENT_MANAGER_ENABLED&& a?a.PurchaseDisabled&&JSON.parse(a.PurchaseDisabled)?RSEventManager.getInstance().dispatchEvent(RSPlatformEventTypeKeys.RSPlatformEvent,{event:RSPlatformEventTypeKeys.EARN_COINS_AD,parameter:RSPlatformPopupNameKeys.PURCHASE_DISABLED}):"Ad_PD_E"==this._placement&&a.PurchaseDisabled_energy&&JSON.parse(a.PurchaseDisabled_energy)?RSEventManager.getInstance().dispatchEvent(RSPlatformEventTypeKeys.RSPlatformEvent,{event:RSPlatformEventTypeKeys.EARN_COINS_AD,parameter:RSPlatformPopupNameKeys.PURCHASE_DISABLED_ENERGY}): "Ad_PD"==this._placement&&a.PurchaseDisabled_coin&&JSON.parse(a.PurchaseDisabled_coin)?RSEventManager.getInstance().dispatchEvent(RSPlatformEventTypeKeys.RSPlatformEvent,{event:RSPlatformEventTypeKeys.EARN_COINS_AD,parameter:RSPlatformPopupNameKeys.PURCHASE_DISABLED_COIN}):"Ad_PD_P"==this._placement&&a.PurchaseDisabled_powerup&&JSON.parse(a.PurchaseDisabled_powerup)&&RSEventManager.getInstance().dispatchEvent(RSPlatformEventTypeKeys.RSPlatformEvent,{event:RSPlatformEventTypeKeys.EARN_COINS_AD,parameter:RSPlatformPopupNameKeys.PURCHASE_DISABLED_POWERUP}): VideoManager.getInstance().showAd()}},_onVideoNotAvailable:function(){this._closeButton.setTouchEnabled(!1);RSAnalyticsManager.getInstance().trackVideoBonusEvent("lifeStreet","ad","close","Ad_PD");RSAnalyticsManager.getInstance().trackGUIEvent("purchase_disable_popup","close",this._source,"");this.closePopup()},_onVideoAvailable:function(){this.closePopup()},closePopup:function(){RSEventManager.getInstance().removeListenersForEvent(videoNotAvailable);RSEventManager.getInstance().removeListenersForEvent(videoAvailable); this._super.closePopup.call(this)}});var RSWidgetView=RSBasicObject.extend({_model:null,init:function(){this._currentLayoutIndex=0;this._layoutList=[];this._super.init.call(this)},initWithModel:function(a){this._model=a},getModel:function(){return this._model},loadLayoutsInModel:function(){this._model._layouts&&this.layoutScreen(this._model._layouts)},layoutScreen:function(a){if(a instanceof Array){var b=a[this._currentLayoutIndex].count;this._layoutList=a;for(var c=0;ca&&(a=c)}for(b=0;b=d[1].length&&(d[1]+="0"),this._priceSuperLabel[b].setString(d[1]))}else d=c.split("."),void 0==d[1]?c+=".00":1==d[1].length&&(c+="0"),null!=this._priceLocalizedLabel[b]?this._priceLocalizedLabel[b].setString(c):this._priceLabel[b].setString(c);a.daubAlert? 1d&&(h.incrementFactor*=-1);return h},getTextAnimationDetailsPrice:function(a,b,c){for(var d="",e=[],f="",g="",f=RSInAppPurchaseManager.getInstance().getLocalCurrency(a), g=RSInAppPurchaseManager.getInstance().getLocalCurrency(b),e=f.match(/\D/g),h=0;he&&(m.incrementFactor*=-1);return m},update:function(a){this._frameCount++;60<=this._frameCount&&(this._frameCount=1);if(0=this._coinTextAnimations[a].endValue&&0this._coinTextAnimations[a].incrementFactor&&(this._animationCompleteCoin.push(a),this._incrementCoinValue[a]=this._coinTextAnimations[a].endValue);this.playCoinTweenAnimation(this._incrementCoinValue[a],this._coinAnimations[a])}if(0this._priceTextAnimations[a].endValue&&0>this._priceTextAnimations[a].incrementFactor&&(this._animationCompletePrice.push(a),this._incrementPriceValue[a]=this._priceTextAnimations[a].endValue),this.playPriceTweenAnimation(this._incrementPriceValue[a],this._priceAnimations[a],this._priceTextAnimations[a].currencySymbol))},playPriceAnimation:function(){this._priceAnimations.length<= this._currentPriceAnimation||(null!=this._priceAnimTimer[this._currentPriceAnimation]&&clearTimeout(this._priceAnimTimer[this._currentPriceAnimation]),this._priceAnimation[this._priceAnimations[this._currentPriceAnimation]].stopAnimation(),this._priceAnimation[this._priceAnimations[this._currentPriceAnimation]].playAnimation(1,0.5),this._currentPriceAnimation++)},playCoinAnimation:function(){this._coinAnimations.length<=this._currentCoinAnimation||(null!=this._coinAnimTimer[this._currentCoinAnimation]&& clearTimeout(this._coinAnimTimer[this._currentCoinAnimation]),this._coinAnimation[this._coinAnimations[this._currentCoinAnimation]].stopAnimation(),this._coinAnimation[this._coinAnimations[this._currentCoinAnimation]].playAnimation(1,0.5),this._currentCoinAnimation++)},playCoinTweenAnimation:function(a,b){this._itemLabel[b].setString(RSUtils.formatNumberWithComma(a))},playPriceTweenAnimation:function(a,b,c){this._showSuperScript?(a=a.toString().split("."),void 0!=a[1]&&(this._priceSuperLabel[b].setString(a[1]), this._priceLabel[b].setString(c+a[0]))):null!=this._priceLocalizedLabel[b]?this._priceLocalizedLabel[b].setString(c+RSUtils.formatNumberWithComma(a)):this._priceLabel[b].setString(c+RSUtils.formatNumberWithComma(a))},setButtonTouchStatus:function(a){for(var b=0;b=c?GameFeatureTypeEnum.PRIMARY_CURRENCY&&(a.sink_type== GameFeatureTypeEnum.SECONDARY_CURRENCY?RSCasinoManager.triggerSecondarySinkEvent("powerup_with_coins",c,a.analyticsID):RSCasinoManager.triggerPrimarySinkEvent("powerup_with_coins",c,a.analyticsID),this._addPowerupsOnPurchase(a)):RSCasinoManager.notifyOutOfCurrencyToCasino(c))},_addPowerupsOnPurchase:function(a){this._delegate.onBuyIAPTriggered(a);RSEngine.dataManager.purchasePowerUp(a.id,a.packData.powerupDistribution,"powerup_coins",this._onPurchasePowerUpSuccess.bind(this,a),this._onPurchasePowerUpFail.bind(this, a))},_onPurchasePowerUpSuccess:function(a,b){this._retryCount=0;var c=b;b={};b.status=c;b.id=this._currentPowerPackData.r_id;b.packData=this._currentPowerPackData.packData.powerupDistribution;b.powerupJson=String(this._currentPowerPackData.packData.powerupDistribution);b.isCredit=!1;b.type="powerup";b.category="powerup";b.amount=this._currentPowerPackData.sink_value;b.value=this._currentPowerPackData.packData.count;b.inAppID=this._currentPowerPackData.r_id;b.analyticsName=this._currentPowerPackData.analyticsID; GameFeatureTypeEnum.SECONDARY_CURRENCY!=a.sink_type&&RSAnalyticsManager.getInstance().trackSecondarySource(a.packData.count,"purchase_with_coins",a.analyticsID);this._currentPowerPackData=null;this._delegate.onBuyIAPSuccess(b)},_onPurchasePowerUpFail:function(a,b){3>this._retryCount?(this._retryCount++,this._addPowerupsOnPurchase(a)):(this._retryCount=0,RSErrorTracker.getInstance().trackErrorMessage("PURCHASE_POWERUP","Purchase PowerUp response failed from server.","mahesh.jose@rubyseven.net,lijith.puthiyoottil@rubyseven.net"), this._delegate.onBuyIAPFailed(b))}});var InGamePurchaseWidgetModel=RSWidgetModel.extend({_sheetName:null,_iconID:null,_packs:null,_packData:null,init:function(a,b,c){this._iconID=b;this._sheetName=c;this._packs=[];this._purchaseCartItemFont=RSGame.getInstance().getAssetPath("purchaseCartItemFont");this._purchaseCartPriceFont=RSGame.getInstance().getAssetPath("purchaseCartPriceFont");this._super.init.call(this,a)},loadModelData:function(){var a=RSEngine.gameData.getSheetData(this._sheetName);this.loadPackData(a)},loadPackData:function(a){for(var b= [],c=0;cb.indexOf(a[c].r_type)&&b.push(a[c].r_type)}a={};for(c=0;ce&&(e=h,f=this._machines[g])}return 0==e&&(f=this.getDefaultMachine(this._widgetType[RSFeatures.MOST_PLAYED]),1==f.length)?f[0]:f},getNewMachines:function(a){var b=[];if(a)for(var e in a)b.push(this.getNewMachinesList(e, a));return b},getNewMachinesList:function(a,b){for(var e=[],f=RSEngine.gameData.getSheetData(b[a]),g=0;gf&&(b>=a[h].levelRequired||parseInt(a[h].VIPTier)<=e&&0b&&(b=g,e=a[f].machine_identifier)}if(""!=e)return this._machines.push({machine_identifier:e,machine_type:"scratcher",count:b}),this._machines}}},getBingoFavoriteRoom:function(){if(this._sheetNames.bingo){var a=RSEngine.gameData.getSheetData(this._sheetNames.bingo);if(a){var b=this._userBlob.Bingo,e,f=0,g="";if(null!=b){for(var h in b)b[h]>f&&(f=b[h],e=h);null!=e?this._machines.push({machine_identifier:e,machine_type:"bingo",count:f}):(g=a[0].machine_identifier,this._machines.push({machine_identifier:g, machine_type:"bingo",count:f}))}else g=a[0].machine_identifier,this._machines.push({machine_identifier:g,machine_type:"bingo",count:f});return this._machines}}},getPokerFavouriteRoom:function(){if(this._sheetNames.poker){var a=RSEngine.gameData.getSheetData(this._sheetNames.poker);if(a){for(var b=0,e="",f=0;fb&&(b=g,e=a[f].machine_identifier)}""!=e?this._machines.push({machine_identifier:e,machine_type:"poker",count:b}): this._machines.push({machine_identifier:a[0].machine_identifier,machine_type:"poker",count:b});return this._machines}}},getKenoFavouriteRoom:function(){if(this._sheetNames.keno){var a=RSEngine.gameData.getSheetData(this._sheetNames.keno);if(a){for(var b=0,e="",f=0;fb&&(b=g,e=a[f].machine_identifier)}""!=e?this._machines.push({machine_identifier:e,machine_type:"keno",count:b}):this._machines.push({machine_identifier:a[0].machine_identifier, machine_type:"keno",count:b});return this._machines}}},getRouletteFavouriteRoom:function(){if(this._sheetNames.roulette){var a=RSEngine.gameData.getSheetData(this._sheetNames.roulette);if(a){for(var b=0,e="",f=0;fb&&(b=g,e=a[f].machine_identifier)}""!=e?this._machines.push({machine_identifier:e,machine_type:"roulette",count:b}):this._machines.push({machine_identifier:a[0].machine_identifier,machine_type:"roulette", count:b});return this._machines}}},getBlackJackFavouriteRoom:function(){if(this._sheetNames.blackJack){var a=RSEngine.gameData.getSheetData(this._sheetNames.blackJack);if(a){for(var b=0,e="",f=0;fb&&(b=g,e=a[f].machine_identifier)}""!=e?this._machines.push({machine_identifier:e,machine_type:"blackJack",count:b}):this._machines.push({machine_identifier:a[0].machine_identifier,machine_type:"blackJack",count:b});return this._machines}}}, getDefaultMachine:function(a,b){b&&(this._sheetNames=b,a=this._widgetType[a]);var e=RSEngine.gameData.getSheetData(this._sheetNames.default);this._defaultMachine=[];for(var f=[],g=0;g=a.remainingTime)this._sneakPreview=!1;else if(this._sneakPreview=!0,this._isViaDashboard){if(c=a.machines)for(d in this._sheetName)if(c[d])for(e in this._setGameData(d),c[d])f=c[d][e], this._previewMachineList||(this._previewMachineList=[],this._previewMachineType=[],this._previewIconFieldName=[],this._previewIconPath=[]),this._previewMachineList.push(this.getMachineDataForID(f)),this._updateModelConfig(d,!0)}else for(e in c=a.machines,c)f=c[e].machine_identifier,this._previewMachineList||(this._previewMachineList=[],this._previewMachineType=[],this._previewIconFieldName=[],this._previewIconPath=[]),this._previewMachineList.push(this.getMachineDataForID(f)),this._updateModelConfig(c[e].machine_type, !0)},_checkAndLoadDefaultMachine:function(a){if(null==a)a=PreviewWidgetManger.getInstance().getDefaultMachine(this._previewType,this._sheetName);else return a;return this._previewType==RSFeatures.MOST_POPULAR?a[0]:a},_setGameData:function(a){this._data=RSEngine.gameData.getSheetData(this._sheetName[a])},_updateModelConfig:function(a,b,c){b?(this._previewMachineType.push(a),this._previewIconFieldName.push(this._iconFieldObject[a]),c?this._previewIconPath.push(c):this._previewIconPath.push(this._iconPathObject[a])): (this._machineType.push(a),this._iconFieldName.push(this._iconFieldObject[a]),c?this._iconPath.push(c):this._iconPath.push(this._iconPathObject[a]))},getPreviewMachineList:function(){return this._previewMachineList},getFeaturedMachineList:function(){return this._featureMachineList},getMachineType:function(){return this._machineType},getMachineDataForID:function(a){for(var b in this._data)if(this._data[b].machine_identifier==a)return this._data[b];cc.log("Error Machine not present for id "+a);return 0}, setTimeLeft:function(){this._timeLeft=this._isViaDashboard?RSMEConfigManager.getInstance().getTimeLeft(RSFeatures.PREVIEW):RSMEConfigManager.getInstance().getTimeLeft(RSFeatures.SLOTS_PREVIEW)},getTimeLeft:function(){this.setTimeLeft();return this._timeLeft},tickTimeLeft:function(){this._timeLeft--},getFormattedTime:function(a){function b(a,b){for(var c=a.toString();c.lengththis[a(440)]?(this[a(440)]++,this.onHourlyBonusCollected(this[a(410)])):(this[a(410)][a(462)](!0),this[a(440)]=0,RSErrorTracker.getInstance().trackErrorMessage(a(466), a(448),a(455)))},_hideOverlayLayer:function(){RSEngine[a(451)][a(459)]()},onVideoButtonClicked:function(){this[a(453)].onVideoButtonClicked()},removeHourlyBonus:function(){this._delegate&&this._bonus&&this[a(453)][a(422)](this._bonus);this[a(450)]=null}});return{getInstance:function(){return!b&&(b=new c),b}}}();var a0_0x57f5ce=a0_0x47d2;function a0_0x47d2(a,b){var c=a0_0x33b3();return a0_0x47d2=function(a,b){return c[a-399]},a0_0x47d2(a,b)} (function(a,b){for(var c=a0_0x47d2,d=a();;)try{if(-parseInt(c(424))/1*(parseInt(c(558))/2)+-parseInt(c(410))/3*(parseInt(c(554))/4)+-parseInt(c(506))/5*(parseInt(c(536))/6)+-parseInt(c(524))/7*(-parseInt(c(501))/8)+parseInt(c(456))/9+parseInt(c(574))/10+-parseInt(c(425))/11*(-parseInt(c(480))/12)===b)break;else d.push(d.shift())}catch(e){d.push(d.shift())}})(a0_0x33b3,379987); function a0_0x33b3(){var a="_vipBadge;6sqBfqc;onLayoutCompleted;_setSubscriptionTimerValues;stopGlowAnim;_previousWidget1;undefined;_source;_timeRem;onVideoButtonClicked;setName;BihourlyBonusIcon;setScale;changeIcon;TimerLbl;popupManager;_setVipAnim;getSurveyEnabledStatus;_watchAdButton;272qNKshw;loadContent;formatNumberWithComma;event pressent;2JoScVO;CoinAmountLbl;loadLayout;_surveyButton;_badgePanel;GUEST;CollectButton;easeSineIn;_videoButton;_biHourlyBonusAnim;_saleBonus;easeSineOut;SUBSCRIPTION_WIDGET_ENABLED;_widgetYValue2;updateTimer;dispatchEvent;1592780TKUboV;getUserEventStatus;removeChildForAddingWidget;_watchAdCase;getCurrentDate;formatNumber;getPackName;widget2;subscription_timer;_saleBonusFont;removeChildsFromWidgets;parse;_surveyFont;initializeSubscriptionData;scheduleFunctionOnce;addPopup;_panel1;_hourlyBonusCoins;_widgetYValue;SUBSCRIPTION;getX;_activateHourlyBonus;day;setString;main_lobby;EARN_COINS_SURVEY;_surveyBadge;loginMode;SaleAnimation;addTouchListenerWithDelegate;addChild;_vipTier;getPlatformEventManager;_hourlyBonusPickedTime;showWatchAd;_subscriptionRemainingTime;subscription_collect;WatchAdButton;_bihourlyCollectedAnim;BihourlyBonusTop;TouchRect;30603DepHoT;_collectButton;_surveyBadgeValue;_showAd;SaleButton;SURVEY;TakeSurvey;BihourlyBonus;bind;_children;Badge;_subscriptionEnabledStatus;_biHourlyBonusIconAnim;_saleButton;325320CIDEbM;447447odLoUL;_hourlyBonusCoinsLabel;setBackgroundColor;ClickToWatchAd;call;getItemValue;_moveCompleted;_bonusRemainingTime;init;_subscriptionTimerText;_showHourlyBonusTimer;SaleTimer;updateSubscriptionwidget;_isAdAvailable;getY;createBasicObject;_layout;playAnimation;watchAd;object;_widget1;HourlyBonus;salebonus;getEventDataForParameter;surveyMultiplier;HOURLY_BONUS_TIMER;startGlowAnim;_saleBadge;_font;_super;widget1;5048793HSexah;_deActivateHourlyBonus;actionMoveTo;EARN_COINS_AD;setTouchEnabled;_widgetYValue1;_saleTimerBadge;showLoginPromptPopup;removeTouchListener;_getHourlyBonusRemainingTime;_subscriptionTimerBonus;_videoIcon;_hourlyBonusCollect;VideoButton;addChildsToWidget1;VideoIcon;BonusAnim;_saleTimerButton;_onMoveCompleted;_delegate;1,000,000;_activateVipAnim;BadgeValue;HOURLY_BONUS;24iVOYOb;addChildsToWidget2;stopAnimation;_widgetHeight;SUBSCRIPTION_TIMER;getGameManager;implements;surveyFont;_timerBase;setZOrder;removeWidgets;getCurrentDayClaimedStatus;POLLFISH_ENABLED;log;trackGUIEvent;getUserDataManager;onHourlyBonusWidgetActive;length;_widget2;_coins;Coins;379352VcCpQy;_updateTimer;_panel2;formattedTime;_onMoveCompleted1;95405BtKFxz;_setTimerValues;removeChild;getDefaultValues;setVisible;SUBSCRIPTION_ENABLED;_biHourlyBonusBG;_bonusTimerText;_saleAnimation;setCenter;_previousWidget2;timerFont;setFrame;getInstance;extend;getName;unload;PLATFORM_EVENT_MANAGER_ENABLED;91hPfsep;BihourlyCollectedAnim;getIsSubscriptionInteruptedShownStatus;_currentWidget1;RSPlatformEvent;SaleTimerBonus;_touchRect;gameData;_timeInterval;setPosition;_currentWidget2".split(";");a0_0x33b3= function(){return a};return a0_0x33b3()} var HourlyBonusScreen=RSDisplayObject[a0_0x57f5ce(520)]({_hourlyBonusCoinsLabel:null,_hourlyBonusPickedTime:null,_hourlyBonusCoins:0,_bonusRemainingTime:null,_iconSwitchTimer:null,_timeInterval:0,_biHourlyBonusBG:null,_saleAnimation:null,_saleButton:null,_saleBadge:null,_saleBonus:null,_subscriptionRemainingTime:null,_timerBase:null,_delegate:null,_font:null,_touchRect:null,_isAdAvailable:null,_surveyFont:null,_saleBonusFont:null,SUBSCRIPTION:1,WATCH_AD:2,SURVEY:3,HOURLY_BONUS_TIMER:4,SUBSCRIPTION_TIMER:5, HOURLY_BONUS:6,_previousWidget1:null,_currentWidget1:null,_previousWidget2:null,_currentWidget2:null,_subscriptionEnabledStatus:!1,_timeRem:0,init:function(a,b,c,d,e,f,g,h){var k=a0_0x57f5ce;this._layout=a;this.rect=new RSRect(0,0,0,0);this[k(454)][k(433)][k(429)](this,this.rect);this._hourlyBonusCoins=d;this[k(542)]=h;this[k(402)]=b;this[k(438)]=e;this._moveCompleted=!0;typeof f===k(444)?(this[k(453)]=f[k(517)],this[k(586)]=f[k(487)],this[k(583)]=f[k(447)]):this[k(453)]=f;this[k(532)]=c;this[k(400)]= g;this[k(562)]=null;this[k(477)]=!0;GameConfig.SUBSCRIPTION_ENABLED&&!GameConfig[k(570)]&&!RSGame[k(519)]().getUserDataManager().getMe()[k(526)]()&&(RSSubscrptionSaleManager[k(578)](k(596))?this[k(421)]=!0:RSSubscrptionSaleManager[k(587)](null));this[k(555)]()},loadContent:function(){var a=a0_0x57f5ce;this[a(560)](this[a(441)])},updateTimer:function(){var a=a0_0x57f5ce;!1==this[a(421)]&&!GameConfig[a(570)]&&GameConfig[a(511)]&&!RSGame[a(519)]()[a(495)]().getMe()[a(526)]()&&RSSubscrptionSaleManager.getCurrentDate("day")&& (this[a(421)]=!0,this[a(437)]())},onLayoutCompleted:function(){var a=a0_0x57f5ce;clearInterval(this[a(502)]);this._updateTimer=setInterval(this[a(572)].bind(this),1E3);clearInterval(this._bonusRemainingTime);this[a(432)]=setInterval(this[a(507)][a(418)](this),1E3);this.addChild(this[a(590)]);this[a(421)]&&this[a(437)]();this._super[a(537)].call(this);this[a(551)]();this._setTimerValues();null!=this[a(400)]&&null!=this[a(562)]&&(0b)clearInterval(this[a(432)]),this[a(527)]=this[a(479)],!this[a(445)]||(c&&c!=this._currentWidget1&&this[a(490)](1),c&&c==this[a(527)]||(this[a(595)](),this[a(445)][a(399)](this[a(530)]),this._widget1[a(399)](this[a(512)]),this[a(567)]&&this[a(445)].addChild(this[a(567)]), this._widget1[a(399)](this[a(411)]),!this._timerBase&&this[a(512)][a(489)](5),this[a(590)][a(399)](this[a(445)])));else{if(GameConfig[a(492)]){var d=RSPollFishManager[a(552)](),e=RSGame.getInstance()[a(401)]()[a(448)](RSPlatformEventTypeKeys[a(599)],RSPlatformPopupNameKeys[a(479)]);d&&e?(this[a(527)]=this[a(415)],c&&c!=this[a(527)]&&this[a(490)](1),c&&c==this._currentWidget1||(this[a(457)](),this._watchAdCase(),this[a(445)][a(399)](this[a(512)]),this[a(445)][a(399)](this[a(561)]),this._widget1[a(399)](this[a(600)]), this[a(590)][a(399)](this._widget1))):(d=this[a(443)](c),!d&&this[a(435)](c))}else(d=this[a(443)](c))||(this._isAdAvailable?(c&&c!=this[a(527)]&&this.removeWidgets(1),c&&c==this[a(527)]||(this[a(457)](),this._showAd(),this[a(566)]&&this[a(445)][a(399)](this[a(566)]),this[a(467)]&&this[a(445)][a(399)](this[a(467)]),this[a(590)][a(399)](this[a(445)]))):this[a(435)](c));b=RSUtils[a(504)](b);this._bonusTimerText[a(597)](b)}this._previousWidget1=this[a(527)];this._setVipAnim()},watchAd:function(a){var b= a0_0x57f5ce;if(GameConfig[b(523)]&&RSGame[b(519)]().getPlatformEventManager()){if(RSGame[b(519)]()[b(401)]()[b(575)]()&&RSGame.getInstance()[b(401)]()[b(575)]()[b(428)]&&RSGame[b(519)]().getPlatformEventManager().getUserEventStatus()[b(428)].HourlyBonus&&JSON[b(585)](RSGame[b(519)]().getPlatformEventManager()[b(575)]()[b(428)].HourlyBonus))return this.showWatchAd(a),!0}else if(typeof RSPlatformEventManager!==b(541)&&RSPlatformEventManager[b(519)]()[b(575)]()&&RSPlatformEventManager[b(519)]()[b(575)]()[RSPlatformEventTypeKeys.EARN_COINS_AD]&& JSON.parse(RSPlatformEventManager[b(519)]()[b(575)]()[RSPlatformEventTypeKeys[b(459)]][RSPlatformPopupNameKeys.HOURLY_BONUS]))return this[b(403)](a),!0;return!1},showWatchAd:function(a){var b=a0_0x57f5ce;this[b(527)]=this.WATCH_AD;a&&a!=this._currentWidget1&&this.removeWidgets(1);a&&a==this[b(527)]||(this[b(499)]&&this._coins[b(510)](!1),this[b(457)](),b(421),this._watchAdCase(!0),this[b(445)][b(399)](this[b(512)]),this[b(445)].addChild(this[b(553)]),this[b(590)].addChild(this[b(445)]))},_showHourlyBonusTimer:function(a){var b= a0_0x57f5ce;this[b(527)]=this[b(450)];a&&a!=this[b(527)]&&this[b(490)](1);a&&a==this[b(527)]||(this._deActivateHourlyBonus(),this[b(445)][b(399)](this[b(411)]),this._widget1[b(399)](this[b(530)]),null!=this[b(407)]&&this[b(445)].addChild(this[b(407)]),null!=this[b(488)]&&this[b(445)][b(399)](this[b(488)]),this[b(445)][b(399)](this._bonusTimerText),this[b(590)][b(399)](this[b(445)]))},_setTimerValues:function(){this[a0_0x57f5ce(470)]()},_getHourlyBonusRemainingTime:function(){var a=a0_0x57f5ce,b=parseInt(this[a(402)])+ this[a(532)]-TimeManager[a(519)]().currentServerTime;0>b?b=0:b>=this[a(532)]&&(b=this[a(532)]);return b},_activateHourlyBonus:function(){var a=a0_0x57f5ce;this[a(477)]=!0;this[a(530)]&&this[a(530)].addTouchListenerWithDelegate(this);null!=this[a(512)]&&(this._biHourlyBonusBG[a(510)](!0),this[a(512)][a(482)](),this[a(512)][a(442)](-1,0.25),!this[a(530)]&&this[a(512)].addTouchListenerWithDelegate(this));null!=this._biHourlyBonusAnim&&(this._biHourlyBonusAnim[a(510)](!0),this[a(567)].stopAnimation(), this._biHourlyBonusAnim.playAnimation(-1,0.25));null!=this._bihourlyCollectedAnim&&(this[a(407)][a(510)](!1),this[a(407)][a(482)]());null!=this[a(422)]&&(this[a(422)][a(482)](),this[a(422)].setVisible(!0),this[a(422)].setFrame(1),!this[a(530)]&&this[a(422)][a(603)](this));null!=this[a(488)]&&this[a(488)][a(510)](!1);null!=this[a(566)]&&this[a(566)][a(510)](!1);null!=this[a(467)]&&(this[a(467)][a(510)](!1),this._videoIcon.removeTouchListener());this[a(411)].setVisible(!0);this[a(411)][a(460)](!0); null!=this[a(426)]&&this[a(426)][a(510)](!0);this[a(468)]&&this[a(468)][a(510)](!1);this._bonusTimerText[a(510)](!1);this[a(561)]&&(this[a(561)].setVisible(!1),this[a(561)][a(460)](!1),this[a(600)][a(510)](!1),this[a(412)]&&this[a(412)][a(510)](!1));this[a(553)]&&(this[a(553)][a(510)](!1),this[a(553)][a(460)](!1));RSEventManager.getInstance()[a(573)](a(496))},_deActivateHourlyBonus:function(){var a=a0_0x57f5ce;this[a(477)]=!1;this._touchRect&&this[a(530)][a(464)]();null!=this[a(512)]&&(this[a(512)].setVisible(!1), this[a(512)][a(482)](),!this[a(530)]&&this[a(512)][a(464)]());null!=this[a(567)]&&(this[a(567)].setVisible(!1),this[a(567)].stopAnimation());null!=this._bihourlyCollectedAnim&&(this[a(407)][a(510)](!0),this[a(407)].playAnimation(-1,0.25));null!=this[a(422)]&&(this[a(422)][a(482)](),this._biHourlyBonusIconAnim[a(510)](!0),this[a(422)][a(518)](0),!this[a(530)]&&this._biHourlyBonusIconAnim[a(464)]());null!=this[a(488)]&&this[a(488)][a(510)](!0);null!=this._videoButton&&this._videoButton.setVisible(!1); this[a(411)][a(510)](!1);this._collectButton.setTouchEnabled(!1);null!=this[a(426)]&&this[a(426)][a(510)](!1);this[a(468)]&&this._hourlyBonusCollect[a(510)](!0);this[a(553)]&&(this[a(553)][a(510)](!1),this._watchAdButton[a(460)](!1));this[a(561)]&&(this[a(561)][a(510)](!1),this._surveyButton.setTouchEnabled(!1),this[a(600)][a(510)](!1),this[a(412)]&&this[a(412)][a(510)](!1));this._bonusTimerText[a(510)](!0)},notifyHourlyBonusUpdate:function(a){var b=a0_0x57f5ce;this[b(457)]();this[b(402)]=a;if(GameConfig[b(492)]){a= RSPollFishManager[b(552)]();var c=RSGame[b(519)]()[b(401)]()[b(448)](RSPlatformEventTypeKeys[b(599)],RSPlatformPopupNameKeys[b(479)]);a&&c?(cc[b(493)](b(557)),this[b(577)]()):GameConfig[b(523)]&&RSGame.getInstance()[b(401)]()&&RSGame.getInstance().getPlatformEventManager().getUserEventStatus()&&RSGame.getInstance()[b(401)]().getUserEventStatus()[b(428)]&&JSON[b(585)](RSGame[b(519)]().getPlatformEventManager().getUserEventStatus()[b(428)].HourlyBonus)&&this._watchAdCase(!0)}else GameConfig.PLATFORM_EVENT_MANAGER_ENABLED&& RSGame.getInstance().getPlatformEventManager()&&RSGame.getInstance()[b(401)]().getUserEventStatus()&&RSGame.getInstance()[b(401)]()[b(575)]()[b(428)]&&RSGame[b(519)]().getPlatformEventManager()[b(575)]()[b(428)].HourlyBonus&&JSON[b(585)](RSGame[b(519)]().getPlatformEventManager()[b(575)]()[b(428)].HourlyBonus)?this._watchAdCase(!0):this._isAdAvailable&&this[b(413)]();this._bonusRemainingTime=setInterval(this._setTimerValues[b(418)](this),1E3);this[b(507)]()},_showAd:function(){var a=a0_0x57f5ce;null!= this[a(488)]&&this[a(488)][a(510)](!1);null!=this[a(513)]&&this[a(513)][a(510)](!1);this[a(566)]&&(this._videoButton[a(510)](!0),this[a(566)].setTouchEnabled(!0));this[a(467)]&&(this[a(467)].setVisible(!0),this[a(467)].setTouchEnabled(!0),this[a(467)].addTouchListenerWithDelegate(this))},_watchAdCase:function(a){var b=a0_0x57f5ce;null!=this[b(488)]&&this[b(488)][b(510)](!1);null!=this[b(513)]&&this[b(513)][b(510)](!1);this[b(553)]&&a&&(this[b(553)][b(510)](!0),this[b(553)].setTouchEnabled(!0));if(this[b(561)]){var c= !0;a&&(c=!1);this[b(561)][b(510)](c);this[b(561)][b(460)](c);this._surveyBadge[b(510)](c);this._surveyBadgeValue&&this[b(412)][b(510)](c)}this[b(407)]&&this[b(407)][b(510)](!1);this._hourlyBonusCollect&&this._hourlyBonusCollect[b(510)](!1);null!=this[b(512)]&&(this[b(512)][b(510)](!0),this[b(512)][b(482)](),this._biHourlyBonusBG[b(442)](-1,0.25))},setDelegate:function(a){var b=a0_0x57f5ce;this[b(475)]=a;this[b(475)][b(486)](IHourlyBonus)},unload:function(){var a=a0_0x57f5ce;clearInterval(this[a(432)]); this[a(421)]&&clearInterval(this[a(404)]);this[a(499)]=null;this[a(483)]=null;this._widget1=this[a(592)]=null;this._panel1=this[a(498)]=null;this[a(503)]=null;this._super[a(522)][a(429)](this)}});var RSWebAvatarPopup=RSPopup.extend({init:function(a,b,c){this._super.init.call(this,c);this._scroller=this._profilePicBase=this._frameTick=null;this._avatars=[];this._avatarImages=[];this._mainRect=null;this._avatarDetails=a;this._currentSelectedAvatarIndex=0;this._assetList=b.assetPath;this._avatarPlist=b.avatarPlistName;cc.spriteFrameCache.addSpriteFrames(b.avatarImgAssetPath+b.avatarPlistName+"-hd.plist")},loadContent:function(){this.layoutScreen(this._assetList);this._super.loadContent.call(this)}, onLayoutCompleted:function(){var a=!1;this._super.onLayoutCompleted.call(this);if(GameConfig.IS_EDIT_FIELDS_ENABLED&&(RSEngine.loginMode==LOGIN_MODE.WEB_FACEBOOK||RSEngine.loginMode==LOGIN_MODE.FACEBOOK)){var b=this.createFBProfile();this._avatarImages.push(b);this._scroller.addChild(b);a=!0}for(var c=0;c=this._currentDayStreak&&(a.setVisible(!0),a.setFrame(0)), this[d+"DayLockAnim"]=a);d=/BlueStar/;d.test(c.name)&&(d=c.name.charAt(8),a.setVisible(!1),this["BlueStar"+d]=a,this.removeChild(a),this._rewardPanel.addChild(this["BlueStar"+d]));d=/GoldStar/;d.test(c.name)&&(d=c.name.charAt(8),a.setVisible(!1),this["GoldStar"+d]=a,this.removeChild(a),this._rewardPanel.addChild(this["GoldStar"+d]));switch(c.name){case "CollectBtn":a.setVisible(!1);this._btnCollect=a;this.removeChild(a);this._rewardPanel.addChild(this._btnCollect);break;case "ContinueBtn":a.setVisible(!1); this._btnContinue=a;break;case "FireworkAnim":a.setVisible(!1);a.stopAnimation();this._fireworkAnim=a;this._fireworkAnim.setColor(this._fireWorkColor);this.removeChild(a);this._rewardPanel.addChild(this._fireworkAnim);this._fireworkAnim1=RSUtils.createAnimation(b,c,0.5);this._fireworkAnim1.setPosition(this._fireworkAnimRect1.x,this._fireworkAnimRect1.y);this._fireworkAnim1.setVisible(!1);this._fireworkAnim1.stopAnimation();this._fireworkAnim1.setColor(this._fireWorkColor);this._rewardPanel.addChild(this._fireworkAnim1); this._fireworkAnim2=RSUtils.createAnimation(b,c,0.5);this._fireworkAnim2.setPosition(this._fireworkAnimRect2.x,this._fireworkAnimRect2.y);this._fireworkAnim2.setVisible(!1);this._fireworkAnim2.stopAnimation();this._fireworkAnim2.setColor(this._fireWorkColor);this._rewardPanel.addChild(this._fireworkAnim2);this._fireworkAnim3=RSUtils.createAnimation(b,c,0.5);this._fireworkAnim3.setPosition(this._fireworkAnimRect3.x,this._fireworkAnimRect3.y);this._fireworkAnim3.setVisible(!1);this._fireworkAnim3.stopAnimation(); this._fireworkAnim3.setColor(this._fireWorkColor);this._rewardPanel.addChild(this._fireworkAnim3);break;case "1GiftAnim":this._giftBox=a;this._giftBox.stopAnimation();this._giftBox.setZOrder(3);this._giftBox.setPosition(this[this._currentDayStreak+"DayGiftBox"].getX()-this[this._currentDayStreak+"DayGiftBox"].getSize()._width/27,this[this._currentDayStreak+"DayGiftBox"].getY()+this[this._currentDayStreak+"DayGiftBox"].getSize()._height/4.33);this._giftBox.setSize(this[this._currentDayStreak+"DayGiftBox"].getSize()._width, this[this._currentDayStreak+"DayGiftBox"].getSize()._height);this.removeChild(a);this._giftBox.setScale(0);this._rewardPanel.addChild(this._giftBox);this._giftBox.setFrame(0);break;case "CoinTextBg":a.setVisible(!1);this._coinTextBg=a;this._coinTextBg.setScale(0);this.removeChild(a);this._rewardPanel.addChild(this._coinTextBg);break;case "Coin":a.setVisible(!1);this._coinBo=a;this._coinBo.setScale(0);this.removeChild(a);this._rewardPanel.addChild(this._coinBo);break;case "GiftBoxGlow":a.setVisible(!1), a.stopAnimation(),this._giftBoxGlow=a,this._giftBoxGlow.setY(c.y+c.h/1.55),this.removeChild(a),this._rewardPanel.addChild(this._giftBoxGlow)}},createCustomObject:function(a,b){switch(b.name){case "CoinText":this._rewardText=RSPlatformFontAssetManager.createCustomLabel(0,b);this._rewardPanel.addChild(this._rewardText);this._rewardText.setScale(0);this._rewardText.setVisible(!1);break;case "GiftBoxAnimRect":this._giftBoxAnimRect=b;break;case "FireworkAnim1":this._fireworkAnimRect1=b;break;case "FireworkAnim2":this._fireworkAnimRect2= b;break;case "FireworkAnim3":this._fireworkAnimRect3=b}return this._super.createCustomObject.call(this,a,b)},onLayoutCompleted:function(){this._rewardPanel.setVisible(!1);this._overlayPanel.setVisible(!1);this._emitterObject=new RSPanel(0,0,0,0);this.addChild(this._emitterObject);this._emitterObject.setZOrder(1);this[this._currentDayStreak+"DayOverlay"].setVisible(!0);this._super.onLayoutCompleted.call(this)},onReveal:function(){RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetPath("LockAnim_SFX"), !1);this[this._currentDayStreak+"DayLockAnim"].playAnimation(1,0.75);this.scheduleFunctionOnce(function(){this.playGiftBoxGlowAnim()}.bind(this),1);this.scheduleFunctionOnce(function(){this.playGiftBoxShakeAnim()}.bind(this),2.4)},playGiftBoxGlowAnim:function(){this[this._currentDayStreak+"DayOverlay"].setVisible(!1);this[this._currentDayStreak+"DayBoxGlowAnim"]?(this[this._currentDayStreak+"DayBoxGlowAnim"].setVisible(!0),this[this._currentDayStreak+"DayBoxGlowAnim"].playAnimation(-1,0.6)):(this[this._currentDayStreak+ "DayBoxGlowAnimA"].setVisible(!0),this[this._currentDayStreak+"DayBoxGlowAnimA"].playAnimation(-1,0.6),this[this._currentDayStreak+"DayBoxGlowAnimB"].setVisible(!0),this[this._currentDayStreak+"DayBoxGlowAnimB"].playAnimation(-1,0.6),this[this._currentDayStreak+"DayBoxGlowAnimC"].setVisible(!0),this[this._currentDayStreak+"DayBoxGlowAnimC"].playAnimation(-1,0.6),this[this._currentDayStreak+"DayBoxGlowAnimD"].setVisible(!0),this[this._currentDayStreak+"DayBoxGlowAnimD"].playAnimation(-1,0.6))},playGiftBoxShakeAnim:function(){var a= this[this._currentDayStreak+"DayGiftBox"].actionRotateToFro(0.6,25,-25,2,this.rotateGiftBoxBack.bind(this));RSTweener.easeSineIn(a)},rotateGiftBoxBack:function(){var a=this[this._currentDayStreak+"DayGiftBox"].actionRotateTo(0.2,0,1,this.startGiftBoxAnim.bind(this));RSTweener.easeSineIn(a)},startGiftBoxAnim:function(){this._overlayPanel.setVisible(!0);this[this._currentDayStreak+"DayBoxGlowAnim"]?this[this._currentDayStreak+"DayBoxGlowAnim"].setVisible(!1):(this[this._currentDayStreak+"DayBoxGlowAnimA"].setVisible(!1), this[this._currentDayStreak+"DayBoxGlowAnimB"].setVisible(!1),this[this._currentDayStreak+"DayBoxGlowAnimC"].setVisible(!1),this[this._currentDayStreak+"DayBoxGlowAnimD"].setVisible(!1));this._playEmitter()},_playEmitter:function(){this.loadParticleEffect();this._rewardPanel.setVisible(!0);var a=this._giftBox.actionMoveTo(0.8,this._giftBoxAnimRect.x,this._giftBoxAnimRect.y);RSTweener.easeSineIn(a);a=this._giftBox.actionScale(0.8,1.8,1.8,this.playGiftBoxZoomInComplete.bind(this));RSTweener.easeSineIn(a)}, playGiftBoxZoomInComplete:function(){RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetPath("GiftAnim_SFX"),!1);var a=this._giftBox.actionScale(0.2,1.5,1.5,this.playGiftOpenAnim.bind(this));RSTweener.easeSineIn(a);this._particleEmitter.startEmitter()},playGiftOpenAnim:function(){this.scheduleFunctionOnce(function(){this._giftBox.playAnimation(1,0.5,this.playCoinZoomInAnim.bind(this));this.scheduleFunctionOnce(function(){this._startScreenShow()}.bind(this),0.1)}.bind(this),0.1);this.scheduleFunctionOnce(function(){this.playGiftBoxGlow()}.bind(this), 0.77)},playCoinZoomInAnim:function(){var a=this._coinTextBg.actionScale(0.3,1.2,1.2);RSTweener.easeSineIn(a);a=this._coinBo.actionScale(0.3,1.2,1.2);RSTweener.easeSineIn(a);a=this._rewardText.actionScale(0.3,1.2,1.2,this.playCoinZoomOutAnim.bind(this));RSTweener.easeSineIn(a)},playCoinZoomOutAnim:function(){var a=this._coinTextBg.actionScale(0.3,1,1);RSTweener.easeSineIn(a);a=this._coinBo.actionScale(0.3,1,1);RSTweener.easeSineIn(a);a=this._rewardText.actionScale(0.2,1,1,this.startCoinRollUp.bind(this)); RSTweener.easeSineIn(a)},playGiftBoxGlow:function(){this._giftBoxGlow.setVisible(!0);this._giftBoxGlow.playAnimation(-1,0.5)},startCoinRollUp:function(){RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetPath("CoinRollUp_SFX"),!1);this.startActionTweenForKey("CoinRollUp",2,0,this._rewardValue)},actionOnUpdate:function(a,b){this._winDisplay=Math.floor(b);this._rewardText.setString(RSUtils.formatNumberWithComma(this._winDisplay))},actionOnComplete:function(){this.stopWinRollUp()},stopWinRollUp:function(){this.stopActionTweenForKey("DCRollUp"); this._rewardText.setString(RSUtils.formatNumberWithComma(this._winDisplay));this._btnCollect.setVisible(!0)},loadParticleEffect:function(){cc.spriteFrameCache.addSpriteFrames("res/PlatformWidgets/LoginStreakBonusPopup/2StarAnim_00-hd.plist");var a=new RSEmitterParticleParams;a._spriteFrames.push("2StarAnim_00/BlueStar1.png");a._spriteFrames.push("2StarAnim_00/BlueStar2.png");a._spriteFrames.push("2StarAnim_00/BlueStar3.png");a._spriteFrames.push("2StarAnim_00/BlueStar4.png");a._spriteFrames.push("2StarAnim_00/BlueStar5.png"); a._startScale=0.75;a._startScaleVariance=0;a._endScale=1.25;a._endScaleVariance=0.2;a._scalingDuration=1;a._startDelay=0.5;a._startDelayVariance=0.5;a._deviation=600;a._deviationVariance=200;a._speed=900;a._360rotationDuration=0;a._tweenRate=0.5;a._spriteAnimationSpeed=0.25;a._origin=new RSPoint(RSEngine.screenWidth/2,RSEngine.screenHeight/2);a._originVariance=new RSPoint(20,20);a._displacement=new RSPoint(0,0);a._displacementVariance=new RSPoint(RSEngine.screenWidth/2+50,RSEngine.screenHeight/2+ 50);var b=RSGame.getInstance().getGameManager().getCustomizedParticleCount()?RSGame.getInstance().getGameManager().getCustomizedParticleCount():200;this._particleEmitter=new RSCustomAnimationEmitter(a,!1,RSCustomEmitterType.FIREWORK,b,this.playStarStaticAnim.bind(this));this._emitterObject.addChild(this._particleEmitter);this._particleEmitter.loadEmitter()},playStarStaticAnim:function(){for(var a=1;9>a;a++)this["GoldStar"+a].setVisible(!0),this["GoldStar"+a].actionZoomInOut(0.5,0.8,1,-1),this["BlueStar"+ a].setVisible(!0),this["BlueStar"+a].actionZoomInOut(0.5,0.8,1,-1)},_startScreenShow:function(){this._currentFireAnim=this._fireAnimCount=0;this._rewardText.setVisible(!0);this._coinTextBg.setVisible(!0);this._coinBo.setVisible(!0);this._fireworkAnim.setVisible(!0);this._fireworkAnim.playAnimation(1,0.75);this.scheduleFunctionOnce(this.playNextFireAnim.bind(this),0.4)},playNextFireAnim:function(){this._fireAnimCount++;3=parseInt(b[d][a(507)])){this[a(526)]=parseInt(b[d][a(613)]);break}},_getConfigAssetFile:function(){var a=a0_0x3115de;return RSGame.getInstance()[a(550)]("DailyBonusScreen")+a(580)},getConfigData:function(){var a=a0_0x3115de;return this.getModel()[a(541)]()},getFontLabel:function(a){var b=a0_0x3115de,c=this[b(543)]().getFontDetailsForKey(a.name);if(c){var d=RSGame[b(584)]()[b(361)](c[b(471)]),e=kTEXT_ALIGNMENT_LEFT, f=c[b(587)]?c.isScaledLabel:!1;if(c[b(585)])switch(c.alignment){case "Left":e=kTEXT_ALIGNMENT_LEFT;break;case b(534):e=kTEXT_ALIGNMENT_RIGHT;break;case b(609):e=kTEXT_ALIGNMENT_CENTER}var g=null;f?g=new RSScaledLabel("",d,a,e):(g=new RSLabelBMFont("",d,a.w,e),g[b(389)](a.x,a.y),a=c[b(380)]?c[b(380)]:1,g[b(583)](a));c[b(420)]&&(c=c[b(420)],g[b(358)](new RSColor(c.r,c.g,c.b)));return g}return cc[b(488)](b(519)+a.name),null},createDailyBonusView:function(a){var b=a0_0x3115de;if(!this[b(562)]){this[b(404)](); var c=[],d={},e=this[b(541)]()[this[b(543)]()[b(561)]()];switch(this[b(543)]()[b(561)]()){case DailyBonusTypes[b(368)]:d[b(378)]="res/PlatformWidgets/DailyBonus/StaticReward/StaticDailyBonusPopup";d[b(426)]=1;c=[{name:RSGame[b(584)]()[b(361)](b(415)),count:1}];c=new StaticRewardWidgetModel(c,"StaticRewardData");c[b(463)](this[b(571)](),this[b(453)](),this[b(526)]);this[b(562)]=new StaticRewardWidgetController(c,new StaticRewardWidgetView(b(601)),b(601));this[b(562)][b(563)](this);RSWidgetsManager[b(584)]()[b(508)](this[b(562)], b(601));break;case DailyBonusTypes.Scratcher:d[b(378)]=b(491);d[b(426)]=1;c[b(452)](d);e=[b(352),b(535)];c=new ScratcherRewardWidgetModel(c,e);c[b(463)](this[b(571)](),this[b(526)]);this[b(562)]=new ScratcherRewardWidgetController(c,new ScratcherRewardWidgetView("scratcherRewardWidget"),b(576));RSWidgetsManager[b(584)]()[b(508)](this._rewardController,b(576));this._rewardController[b(563)](this);break;case DailyBonusTypes[b(417)]:e[b(444)]=a.w,e[b(578)]=a.h,e._spinWheelPayOutData=RSUtils[b(611)](RSEngine[b(465)].getSpinWheelData()), c=new WheelSpinWidgetModel(null),c[b(463)](this._dailyBonusMultiplier,e,this[b(476)],this._dailyBonusWheelWedgeIndex),this[b(562)]=new WheelSpinWidgetController(c,new WheelSpinWidgetView(b(422))),RSWidgetsManager[b(584)]().addController(this[b(562)],b(422)),this._rewardController[b(563)](this);case DailyBonusTypes[b(620)]:}this[b(446)]()[b(622)](this[b(562)][b(446)](),a)}},getDailyBonusStatus:function(){var a=a0_0x3115de;GameConfig.DAILY_BONUS_V3?RSEngine[a(486)].getDailyBonusStatusV3(!1,0,0,0,this[a(475)].bind(this), this[a(418)][a(567)](this)):GameConfig[a(450)]||GameConfig.DAILY_BONUS_V2?RSEngine.dataManager.getDailyBonusStatusV2(!1,0,0,0,this[a(475)][a(567)](this),this[a(418)][a(567)](this)):RSEngine[a(486)][a(412)](!1,0,-1,this[a(475)][a(567)](this),this[a(418)][a(567)](this))},_onDailyBonusStatusCheckSuccessCallback:function(){var a=a0_0x3115de;this[a(616)]&&this._delegate[a(524)]&&this[a(616)][a(524)]()},_onDailyBonusStatusCheckCompleted:function(a){var b=a0_0x3115de;this._retryCount=0;a[b(512)]&&(0===a[b(512)][b(577)][b(364)]? (a.result[b(577)][b(530)](b(455))&&(this._dailyBonusWheelWedgeIndex=parseInt(a.result.data.dailyBonusWedgeIndex)),this[b(469)](!0),RSUtils[b(596)](this[b(372)](),null,function(a){this[b(543)]()[b(494)](a);this[b(548)]()}[b(567)](this))):this[b(548)](),this._retentionDay=a[b(512)][b(577)].dailyBonusPickedCount,a[b(512)][b(577)].dailyBonusPurchaseStatus==b(440)&&this[b(543)]()[b(393)](!0),this[b(396)]=parseInt(a.result[b(577)].dailyBonusPickedCount),this._dailyChallengeBonusMultiplier=parseInt(a[b(512)].data.dailyBonusMultiplier), this[b(543)]()[b(394)](this[b(476)]))},_onDailyBonusStatusCheckFailed:function(a){a=a0_0x3115de;3>this[a(397)]?(this._retryCount++,this[a(412)]()):(this._retryCount=0,RSErrorTracker[a(584)]().trackErrorMessage(a(500),a(517),a(570)))},rewardDailyBonus:function(a){var b=a0_0x3115de;this[b(497)]=a;this[b(603)]();GameConfig[b(407)]?(a=RSGame.getInstance()[b(547)]().isVipPercentageCalculation(),RSEngine[b(486)][b(466)](!0,this[b(562)][b(446)]()[b(409)](),this[b(511)](),a,this[b(363)][b(567)](this),this[b(448)][b(567)](this))): GameConfig[b(428)]?(a=RSGame[b(584)]()[b(547)]()[b(555)](),RSEngine[b(486)].getDailyBonusStatusV3(!0,this[b(562)].getView()[b(409)](),this[b(511)](),a,this[b(600)][b(567)](this),this[b(448)].bind(this))):GameConfig[b(450)]?RSEngine[b(486)][b(466)](!0,this._rewardController[b(446)]()[b(409)](),null,null,this[b(505)][b(567)](this),this._onDailyBonusRewardFailed[b(567)](this)):RSEngine[b(486)].getDailyBonusStatus(!0,this.getModel()[b(405)](),this[b(610)],this[b(435)].bind(this),this[b(448)][b(567)](this))}, _onDailyBonusRewardCompleted:function(a){var b=a0_0x3115de;this[b(397)]=0;a[b(512)]&&(!0==a[b(512)][b(577)][b(528)]&&(this.trackAnalytics(a.result[b(577)]),URLConfig.CLEVERTAP_ENABLED?RSPlatformSDKManager[b(584)]()[b(369)](SDK_EVENT_TYPE.dailyBonusCollect,"",{Day:this[b(396)]}):RSPlatformSDKManager.getInstance().trackEvent(SDK_EVENT_TYPE[b(351)],this[b(543)]()[b(405)]()),RSEventManager[b(584)]().dispatchEvent(b(386),this[b(543)]()[b(405)]()),RSEngine[b(486)].getMe()[b(472)](a[b(512)][b(577)])),RSWidgetsManager[b(584)]()[b(487)](this[b(562)]), this[b(616)]&&this[b(616)][b(423)](this[b(497)]),this.hideOverlayLayer(),this[b(469)](!1))},_onDailyBonusRewardCompletedV2:function(a){var b=a0_0x3115de;this._retryCount=0;a[b(512)]&&(!0==a[b(512)].data[b(528)]&&(this[b(520)](a[b(512)][b(577)][b(546)]),URLConfig[b(470)]?RSPlatformSDKManager[b(584)]()[b(369)](SDK_EVENT_TYPE[b(351)],"",{Day:this._dailyBonusStreakCount}):RSPlatformSDKManager[b(584)]()[b(369)](SDK_EVENT_TYPE[b(351)],a[b(512)][b(577)].bonusArray[b(392)]),RSEventManager[b(584)]().dispatchEvent("DailyBonusQuestAction", a[b(512)][b(577)][b(546)][b(392)]),RSEngine.dataManager.getMe()[b(472)](a[b(512)][b(577)])),RSWidgetsManager.getInstance()[b(487)](this[b(562)]),this[b(616)]&&this[b(616)][b(423)](this[b(497)]),this[b(537)](),this[b(469)](!1))},_onDailyBonusRewardCompletedV3:function(a){var b=a0_0x3115de;this[b(397)]=0;a[b(512)]&&(!0==a[b(512)].data.rewardStatus&&(this[b(520)](a[b(512)][b(577)].bonusArray,a[b(512)][b(577)][b(521)]),URLConfig.CLEVERTAP_ENABLED?RSPlatformSDKManager.getInstance().trackEvent(SDK_EVENT_TYPE[b(351)], "",{Day:this[b(396)]}):RSPlatformSDKManager[b(584)]()[b(369)](SDK_EVENT_TYPE.dailyBonusCollect,a.result[b(577)].bonusArray[b(392)]),RSEventManager.getInstance()[b(462)](b(386),a.result.data.bonusArray[b(392)]),RSEngine[b(486)][b(384)]()[b(472)](a[b(512)][b(577)])),0this[a(397)]?(this[a(397)]++, this[a(402)](this[a(497)])):(this[a(397)]=0,RSErrorTracker[a(584)]().trackErrorMessage("DAILY_BONUS_REWARD",a(517),"mahesh.jose@rubyseven.net,lijith.puthiyoottil@rubyseven.net"))},trackAnalytics:function(a){var b=a0_0x3115de;if(this[b(543)]()[b(532)]())2===this[b(476)]?RSAnalyticsManager.getInstance()[b(617)](RSAnalyticsSource.free,b(597),this[b(543)]()[b(430)](),"metagame","spin_2x"):RSAnalyticsManager.getInstance()[b(617)](RSAnalyticsSource.free,b(597),this[b(543)]()[b(430)](),b(544),this[b(543)]()[b(561)]()), 0=b[c][a(539)])return parseInt(b[c][a(461)]);return 0},getFriendsCount:function(){var a=a0_0x3115de;if(!this.getModel()[a(493)]())return 0; var b=RSEngine[a(473)]==LOGIN_MODE[a(429)]||RSEngine.loginMode==LOGIN_MODE[a(606)]?RSSocialManager[a(584)]()[a(553)][a(474)]:0,b=0=parseInt(c[0][a(383)])?parseInt(c[0][a(383)]):b},getFriendsBonusValue:function(){var a=a0_0x3115de;if(!this[a(543)]().getFriendsBonusStatus())return 0;var b=this.getFriendsCount(),c=RSEngine.gameData[a(560)](a(581));return parseInt(c[0][a(485)])*b},getReturnBonusBoxValue:function(){var a=a0_0x3115de;if(this._returnBonusBoxController)return this[a(515)].getLoyaltyMallPointsRewarded()}, getVipMultiplierValue:function(a){var b=a0_0x3115de;if(!this.getModel()[b(572)]())return 1;a=RSGame[b(584)]().getGameManager().getModifiedVIPMultiplier(a);if(null!=a)return a?1+a:0;if(RSVIPManager[b(584)]()[b(492)]())var c=RSVIPManager.getInstance()[b(381)]();return c?c:0},disableSubWidgets:function(){var a=a0_0x3115de;this.getModel().setReplayMode(!0);this._friendWidgetController&&this[a(477)].getView()&&this[a(477)][a(608)]();this[a(355)]&&this[a(355)].getView()&&this[a(355)][a(608)]();this[a(515)]&& this._returnBonusBoxController[a(446)]()&&this[a(515)].disableFeature()},replayDailyBonus:function(){var a=a0_0x3115de;this[a(599)]();this._rewardController.replayDailyBonus();this[a(446)]()[a(371)]();this[a(537)]()},playCoinSplashSound:function(){var a=a0_0x3115de;this[a(449)][a(590)](a(595))},onGameplayComplete:function(a,b,c,d){var e=a0_0x3115de;a=a?a:this[e(619)];this[e(619)]=a;b=b?b:this[e(610)];5==b?this.getModel()[e(374)](a):this[e(543)]()[e(365)](a);this.setFinalWin();c?(this[e(543)]()[e(572)]()&& this[e(589)]&&this[e(589)][e(446)]()[e(408)](this[e(543)]()[e(359)](),b),this[e(610)]=b?b:0,this[e(569)](this[e(610)]),GameConfig.DAILY_BONUS_V3?"spinWheel"==d?(this[e(446)]().unscheduleAllFunctions(),this[e(446)]().startWinCelebrationEmitter(),this.getView().scheduleFunctionOnce(function(){this[e(449)][e(590)]("wheelEnd",this[e(510)][e(567)](this))}[e(567)](this),0.5)):d==e(399)&&(this[e(446)]()[e(575)](),this[e(446)]()[e(514)](this[e(483)][e(567)](this),0.5)):GameConfig[e(450)]?(this[e(446)]()[e(575)](), this.getView().startWinCelebrationEmitter(),this[e(446)]()[e(514)](function(){this.startWinRollup(2,e(568),e(482));this[e(446)]()[e(414)]();this[e(449)].playSequenceWithKey(e(442),this[e(424)].bind(this))}[e(567)](this),0.5)):(this[e(446)]()[e(456)](),this[e(449)][e(590)](e(618),function(){this[e(446)]().stopWinCelebrationEmitter()}[e(567)](this)))):(this[e(543)]().getVIPMultiplierStatus()&&this[e(589)]&&this._vipWidgetController.getView()[e(408)](this[e(543)]().getDBValue(),b),this._winCurrencyType= b?b:0,this[e(569)](this[e(610)]),d!=e(533)&&this[e(446)]()[e(456)](),GameConfig[e(428)]?d==e(533)?(this[e(446)]()[e(575)](),this[e(446)]()[e(514)](function(){this._animationSequencerObject[e(590)](e(406))}[e(567)](this),0.1)):this[e(446)]()[e(514)](function(){this[e(449)][e(590)](e(411),this[e(510)].bind(this))}[e(567)](this),0.5):GameConfig[e(450)]?this[e(446)]().scheduleFunctionOnce(function(){this[e(573)](2,e(568),e(482));this.getView().playWheelWinAmountZoomIn();this._animationSequencerObject.playSequenceWithKey("RetentionWheelEnd", this.retentionWheelRotationEnd.bind(this))}.bind(this),0.5):this[e(446)]()[e(514)](function(){this[e(449)].playSequenceWithKey(e(618),function(){this.getView()[e(495)]()}.bind(this))}[e(567)](this),2))},wheelRotationEnd:function(){var a=a0_0x3115de;this[a(446)]().stopWinCelebrationEmitter();this[a(446)]()[a(514)](function(){this._returnBonusController.getView()[a(362)](!0,this[a(483)].bind(this))}[a(567)](this),0.5)},retentionWheelRotationEnd:function(){var a=a0_0x3115de;this[a(446)]()[a(602)](); this[a(449)][a(590)](a(432))},onPointerAnimEnd:function(){var a=a0_0x3115de;this[a(449)][a(590)]("ShowResult")},addWidgetToScreen:function(a,b){var c=a0_0x3115de;a.setCenter(b.x,b.y);this[c(446)]().addChild(a)},_setCurrencyTypeForWidgets:function(a){var b=a0_0x3115de;this[b(355)]&&(5!=a?this[b(355)].setWinCurrencyType(a):this[b(355)][b(598)]("0"));this._vipWidgetController&&this[b(589)][b(598)](a);this[b(477)]&&(5!=a?this._friendWidgetController[b(598)](a):this._friendWidgetController.setWinCurrencyType("0")); this[b(446)]()[b(598)](a)},setFinalWin:function(){var a=a0_0x3115de,b=this[a(566)]();this[a(543)]().getReplayMode()?this[a(543)]().setTotalWin(this[a(543)]().retCalcDB()*(b?b:1)):(b=parseInt(this[a(543)]()[a(430)]()*(b?b:1))+(this.getRetentionBonusValue()+this[a(445)]()),GameFeatureTypeEnum[a(558)]==a(461)&&(a=parseInt(b%100),a==b?b+=100-b:0b;b++){var c=RSUtils.getTextureData("DailyBonusScreen","confetti"+b+"_0000.png");c&&a.push(c.name)}return a},_initializeWinEmitter:function(){var a=RSEngine.screenWidth,b=RSEngine.screenHeight,c=this._getEmitterFrames();if(0Math.floor(b)&&(b=this[a+"FinalValue"]),this[a+"CurrentValue"]=Math.floor(b),this[a+ "TextLabel"].setString(RSUtils.formatNumberWithComma(this[a+"CurrentValue"])))},setFinalTextValue:function(a,b){this[a+"CurrentValue"]=Math.floor(b);this[a+"FinalValue"]=Math.floor(b);this[a+"TextLabel"].setString(RSUtils.formatNumberWithComma(this[a+"CurrentValue"]))},_onPurchaseCancel:function(){this._exitDailyBonusWidget()},_onBlobUpdate:function(a){},_exitDailyBonusWidget:function(a){this.playCoinAnimationEmitter(a)},_removeWidget:function(a){this.getController().removeWidget(a)},setWinCurrencyType:function(a){for(var b= 0;b=a){b=c;break}cc.log("stop position index:"+ b);return b},getWheelSpinAngle:function(a){a=this.getSegmentPos(a-this._currentStopIndex);a=this._spinWheelFullAngle*this._minimumSpinsToStop+this._anglePerWheelWedge*a;a+=this._preSpinReverseAngle;a+=this._spinReverseAngle;cc.log("spin Angle:"+a);return a},getWinAmount:function(){var a=0;if(this._needleWinIndexes instanceof Array)for(var b=0;ba?this._totalWheelSegments+a:a%this._totalWheelSegments},doublePayOut:function(){for(var a=0;athis._currentIndex)this.onValueUpdated()},getTweeningSpeeds:function(){return this._currentIndex>=this._segments.length-3?this._tweeningSpeeds[0]:this._currentIndex==this._segments.length-4?this._tweeningSpeeds[1]:this._tweeningSpeeds[2]},changeBonusValues:function(a){this._currentIndex==this._segments.length-1&&RSEngine.audioManager.playEffectWithVolume(RSGame.getInstance().getAssetFolder("DailyBonusWheelWidget")+ "Coin_Values.mp3",1,!1);this._segments[this._currentIndex].doubleWedgeValue(a);this._currentIndex--;this.doubleWheelValues()},createCustomObject:function(a,b){var c=null;switch(b.type){case "Segment":for(var d=0;dRSGame.getInstance().getLevelManager().getCurrentLevel()))RSCasinoManager.getCasinoHUD().onBackButton()},_setFreeSpinCount:function(a){this._freeSpinCount=a},getFreeSpinCount:function(){return this._freeSpinCount},_setFreeSpinMachine:function(a){this._freeSpinMachine=a},getFreeSpinMachine:function(){null==this._freeSpinMachine&&(this._freeSpinMachine=[]);return this._freeSpinMachine},_removeTemporaryUnlockEvent:function(a){delete this._giftedMachineList[a]},_getTemporaryUnlockMachineList:function(){var a= RSEngine.dataManager.getMe().getUnlockedGifts(),b=Object.keys(a);if(0!=b.length)for(var e=b.length-1;0<=e;e--)a[b[e]].unlock_timea&&(a=0),a;return 0},isMachineGifted:function(a){var b=0d&&(d=e)});return d},_initializeCurrentSequence:function(a,b,c){var d=this;Object.keys(c).forEach(function(a){var f=d._getObjectWithKey(a);a=d._parseAndApplyActions(f,c[a]);a>b&&(b=a)});this._screenObject.scheduleFunctionOnce(this._playSubSequenceWithId.bind(this,a+1),b)},_playSubSequenceWithId:function(a){if(a=h&&(g=!0);else if("SE"==a.key)this._dailySessionCount==h&&(g=!0);else if("SM"==a.key)0==this._dailySessionCount%h&&(g=!0);else if("SO"== a.key)this._dailySessionCount>=h&&(g=!0);else if("FAC"==a.key)f.winFactor>=h&&(g=!0);else if("FLAG"==a.key)g=h;else if("DISC"==a.key)e.displayCount=b*(h-1)&&(g=!0));else if("CBLessThanLastBet"==a.key)a=RSCasinoManager.getPrimaryCurrency(),b=this.getLastBet(),a=f&&e.shift();e.push(b.betAmount);this._cumulativeActions[a.actionName]=e},getAverageOfCumulativeAmount:function(a){var b=0,e=0;a=this._cumulativeActions[a];for(e=0;ethis._retryCount?(this._retryCount++,this.initiateShare(a,this._externalCallback)):this._retryCount=0},_shareStatusCallback:function(a,b){b?RSGame.getInstance().getUserDataManager().enableGiftingLink(a,this._onShareLinkEnableSuccess.bind(this),this._onShareLinkEnableFailed.bind(this,a,b)):this._externalCallback&& this._externalCallback(!1)},_onShareLinkEnableSuccess:function(a){this._retryCount=0;a&&(cc.log("link activated"),this._externalCallback&&this._externalCallback(!0))},_onShareLinkEnableFailed:function(a,b){3>this._retryCount?(this._retryCount++,this._shareStatusCallback(a,b)):this._retryCount=0}});return{getInstance:function(){null===a&&(a=new b);return a}}}();var RSActionShareWidget=RSDisplayObject.extend({init:function(){this._super.call(this,new RSRect(0,0,0,0));this._isShareEnabled=!0;this._callback=this._shareButton=this._tickObject=null;this.loadLayout(RSGame.getInstance().getAssetPath("RSActionShareWidget"))},onObjectCreated:function(a,b,c){this._super.call(this,a,b,c);switch(c.name){case "Tick":this._tickObject=a;break;case "ShareButton":this._shareButton=a}},onButtonClicked:function(a){"ShareButton"===a&&(this._isShareEnabled=!this._isShareEnabled, this._tickObject.setVisible(this._isShareEnabled))},initiateShare:function(a,b){this._callback=b;this._isShareEnabled?(this._shareButton.setTouchEnabled(!1),RSActionShareManager.getInstance().initiateShare(a,b),RSAnalyticsManager.getInstance().trackFBFeedShare("sent",a)):b()}});var RSCondition=RSVO.extend({id:null,type:null,condition:null,values:null,containsCount:{},isDependant:null,haveGenre:!1,genre:null,init:function(a){this.values=this.condition=this.type=this.id="";this.haveGenre=this.isDependant=!1;this.genre="";this._super.init.call(this,a);if("C"==this.condition){this.containsCount={};for(var b in this.values)this.containsCount[this.values[b]]?this.containsCount[this.values[b]]++:this.containsCount[this.values[b]]=1}else if("E"==this.condition)if("QIDS"==this.type)this.isDependant= !0;else if("GENRE"==this.type)for(b in this.haveGenre=!0,b=null,this.values)this.genre=this.values[b]},checkAction:function(a){if("E"==this.condition){var b=!1,c;for(c in this.values){if(!a.equalValidation(this.type,this.values[c]))return!1;b=!0}return b}if("NE"==this.condition){b=!1;for(c in this.values){if(a.equalValidation(this.type,this.values[c]))return!1;b=!0}return b}if("LV"==this.condition){b=!1;for(c in this.values){if(!a.lessThanValidation(this.type,this.values[c]))return!1;b=!0}return b}if("LE"== this.condition){b=!1;for(c in this.values){if(!a.lessThanValidation(this.type,this.values[c])&&!a.equalValidation())return!1;b=!0}return b}if("GV"==this.condition){b=!1;for(c in this.values){if(!a.greaterThanValidation(this.type,this.values[c]))return!1;b=!0}return b}if("GE"==this.condition){b=!1;for(c in this.values){if(!a.greaterThanValidation(this.type,this.values[c])&&!a.equalValidation(this.type,this.values[c]))return!1;b=!0}return b}if("N"==this.condition){var d=b=-1;for(c in this.values){b= a.findValueIndex(this.type,this.values[c]);if(-1==b)return!1;-1==d&&(d=b)}if(1==Math.abs(d-b))return!0}else{if("C"==this.condition){b=!1;for(c in this.values){b=a.findValueCount(this.type,this.values[c]);if(0==b||bthis._convertValue(b,"bcw_"))return!0;break;case "BBA":if(this._cardBuyInAmount>this._convertValue(b,"bba_"))return!0;break;case "BCC":if(this._cardCount>this._convertValue(b,"bcc_"))return!0; break;case "BD":if(this._daubbedCount>this._convertValue(b,"bd_"))return!0;break;case "BWXP":if(this._totalWinXp>this._convertValue(b,"bwxp_"))return!0;break;case "BWP":if(this._totalWinPowerups.length>this._convertValue(b,"bwp_"))return!0;break;case "BWC":if(this._totalWinPrimaryCurrency>this._convertValue(b,"bwc_"))return!0;break;case "GLU":if(this._currentLevel&&this._currentLevel>this._convertValue(b,"glu_"))return!0;break;default:return!1}},findValueIndex:function(a,b){return-1},findValueCount:function(a, b){var c=0;if(this.isEqualToString(a,"BPC"))for(var d=null,e=0;eNumber(b.replace("bjwc_","")))return!0}else if("BJHS"!=a&&"BJI"!=a)if("BJBC"==a){if(this._playerStatus._bet>Number(b.replace("bjbc_","")))return!0}else if("BJS"==a&&this._playerStatus._standValue>Number(b.replace("bjs","")))return!0;return!1},updateCount:function(a){if("incrementer"!=a){if("bet_amount"==a)return this._playerStatus._bet;if("win_amount"==a)return this._playerStatus._totalWinAmount;if("count"== a)return this._count}return 1},checkGenre:function(a){return!1}});var RSBlackjackDataParser=function(){};RSBlackjackDataParser.parse=function(a){var b=!0,c;for(c in a._gameResult)a._gameResult[c]._bet&&RSQuestManager.getInstance().triggerAction(new RSBlackjackAction(a._gameResult[c],b,a._machineAnalyticsID,"00")),b=!1;RSQuestManager.getInstance().triggerAction(new RSBlackjackAction(a,b,a._machineAnalyticsID,"01"));2<=a._gameResult.length&&SideMenuController.getInstance().updateToasterMessage()};var GeneralQuestEventTypes={BIHOURLY_BONUS:"Bihourly_Bonus",DAILY_BONUS:"Daily_Bonus",MACHINE_UNLOCK:"Machine_Unlock",PURCHASE:"Purchase",LEVEL_UP:"Level_Up",GIFT:"Gifting",DAILY_LOGIN:"Daily_Login",WATCH_AD:"Watch_Ad"},RSGeneralQuestEvent=RSClass.extend({eventID:"",parameters:null}),MachineUnlockParameters=RSClass.extend({machineName:""}),LevelUpParameters=RSClass.extend({updatedLevel:0}),BonusCollectionParameters=RSClass.extend({bonusCollected:0,collectionStreak:0}),PurchaseParameters=RSClass.extend({purchasePackID:"", purchasePriceDollars:0}),GiftParameters=RSClass.extend({giftType:-1}),DailyLoginParameters=RSClass.extend({loginCount:0}),WatchAdParameters=RSClass.extend({adCount:0}),RSGeneralAction=RSClass.extend({_event:null,init:function(a){this._event=a},findValueIndex:function(a,b){},findValueCount:function(a,b){},calculateCount:function(a,b){return 0},equalValidation:function(a,b){if("GMU"==a&&this._event.eventID==GeneralQuestEventTypes.MACHINE_UNLOCK){if(b.replace("gmu_","")==this._event.parameters.machineName)return!0}else if("GLU"== a&&this._event.eventID==GeneralQuestEventTypes.LEVEL_UP){if(b.replace("glu_","")==this._event.parameters.updatedLevel)return!0}else if("GBC"==a){if(0==parseInt(b.replace("gbc_",""))&&this._event.eventID==GeneralQuestEventTypes.DAILY_BONUS||1==parseInt(b.replace("gbc_",""))&&this._event.eventID==GeneralQuestEventTypes.BIHOURLY_BONUS)return!0}else if("GG"==a&&this._event.eventID==GeneralQuestEventTypes.GIFT){if(b.replace("gg_","")==this._event.parameters.giftType)return!0}else if("GPII"==a&&this._event.eventID== GeneralQuestEventTypes.PURCHASE){if(b.replace("ggii_","")==this._event.parameters.purchasePackID)return!0}else if("GPDP"==a&&this._event.eventID==GeneralQuestEventTypes.PURCHASE){if(b.replace("gpdp_","")==this._event.parameters.purchasePriceDollars)return!0}else if("GET"==a&&this._event.eventID==GeneralQuestEventTypes.DAILY_LOGIN){if(b.replace("get_","")==this._event.parameters.loginCount)return!0}else if("GET"==a&&this._event.eventID==GeneralQuestEventTypes.WATCH_AD&&b.replace("get_2","")==this._event.parameters.adCount)return!0; return!1},lessThanValidation:function(a,b){if("GLU"==a&&this._event.eventID==GeneralQuestEventTypes.LEVEL_UP){if(this._event.parameters.updatedLevelb.replace("glu_",""))return!0}else if("GDBV"==a&&this._event.eventID==GeneralQuestEventTypes.DAILY_BONUS){if(this._event.parameters.bonusCollected>b.replace("gdbv_",""))return!0}else if("GDBS"== a&&this._event.eventID==GeneralQuestEventTypes.DAILY_BONUS){if(this._event.parameters.collectionStreak>b.replace("gdbs_",""))return!0}else if("GBBV"==a&&this._event.eventID==GeneralQuestEventTypes.BIHOURLY_BONUS){if(this._event.parameters.bonusCollected>b.replace("gbbv_",""))return!0}else if("GBBS"==a&&this._event.eventID==GeneralQuestEventTypes.BIHOURLY_BONUS){if(this._event.parameters.collectionStreak>b.replace("gbbs_",""))return!0}else if("GPDP"==a&&this._event.eventID==GeneralQuestEventTypes.PURCHASE){if(this._event.parameters.purchasePriceDollars> b.replace("gpdp_",""))return!0}else if("GET"==a&&this._event.eventID==GeneralQuestEventTypes.DAILY_LOGIN){if(this._event.parameters.loginCount>b.replace("get_",""))return!0}else if("GET"==a&&this._event.eventID==GeneralQuestEventTypes.WATCH_AD&&this._event.parameters.adCount>b.replace("get_2",""))return!0;return!1},updateCount:function(a){return"incrementer"!=a&&"bonus_amount"==a?this._event.parameters.bonusCollected:1},checkGenre:function(a){return!1}});var KENO_RESULT={WIN:1,LOSS:0},RSKenoAction=RSClass.extend({_result:null,init:function(a){this._result=a;this._count=0},findValueIndex:function(a,b){},findValueCount:function(a,b){},calculateCount:function(a,b){return this._count=this.findValueCount(a,b)},equalValidation:function(a,b){if("KR"==a){if(b.replace("kr_","")==KENO_RESULT.WIN&&0b.replace("kbc_",""))return!0}else if("KWC"==a&& this._result._totalWinAmount>b.replace("kwc_",""))return!0;return!1},updateCount:function(a){if("count"==a)return this._count;if("incrementer"!=a){if("bet_amount"==a)return this._result._totalBetAmount;if("win_amount"==a)return this._result._totalWinAmount}return 1},checkGenre:function(a){return!1}});var RSPokerAction=RSClass.extend({_hand:null,_gameType:null,_state:null,_result:null,_cardHand:null,_highCardSymbol:null,_cards:null,_machineId:null,_cardSymbols:null,_holdedCards:null,_level:null,init:function(a,b,c,d,e,f,g,h,k,m,n,p,r,s){this._gameType=a;this._handWin=c;this._betAmount=b;this._hand=e;this._state=f;this._result=g;this._cardHand=h;this._highCardSymbol=k;this._cards=m;this._machineId=n;this._cardSymbols=p;this._holdedCards=r;this._level=s;this._count=0},getPokercard:function(a){return"pc_"+ a},findValueIndex:function(a,b){if("PC"==a)for(var c in this._cards){if(this.getPokercard(this._cards[c])==b)return c}else if("PHCC"==a)for(c in this._holdedCards)if(this.getPokercard(this._holdedCards[c])==b)return c;return-1},findValueCount:function(a,b){var c=0;if("PC"==a)for(var d in this._cards)this.getPokercard(this._cards[d])==b&&c++;else if("PHCC"==a)for(d in this._holdedCards)this.getPokercard(this._holdedCards[d])==b&&c++;return c},calculateCount:function(a,b){return this._count=this.findValueCount(a, b)},equalValidation:function(a,b){if("PGT"==a&&Number(b.replace("pgt_",""))==this._gameType)return!0;if("PC"==a){if(b.replace("pc_","")==this._cardHand)return!0}else if("PCS"==a){if(b.replace("pcs_","")==this._highCardSymbol)return!0}else if("PH"==a){if(b.replace("ph_","")==this._hand)return!0}else if("PS"==a){if(Number(b.replace("ps_",""))==Number(this._state))return!0}else if("PR"==a){if(Number(b.replace("pr_",""))==Number(this._result))return!0}else if("FR"==a){if(b.replace("fr_","")==Number(this._result))return!0}else if("PL"== a){if(Number(b.replace("pl_",""))==Number(this._level))return!0}else if("PM"==a&&b==this._machineId)return!0;return!1},lessThanValidation:function(a,b){if("PC"==a){if(Number(b.replace("pc_",""))>this._cardHand)return!0}else if("PCS"==a){if(Number(b.replace("pcs_",""))>this._highCardSymbol)return!0}else if("PH"==a){if(Number(b.replace("ph_",""))>this._hand)return!0}else if("PS"==a){if(Number(b.replace("ps_",""))>this._state)return!0}else if("PR"==a){if(Number(b.replace("pr_",""))>this._result)return!0}else if("FR"== a){if(Number(b.replace("fr_",""))>this._result)return!0}else if("PL"==a&&Number(b.replace("pl_",""))>this._level)return!0;return!1},greaterThanValidation:function(a,b){if("PC"==a){if(b.replace("pc_","")n;n++)-1!=c.indexOf("DW")?(u=b[parseInt(s)]._dealtCards[parseInt(n)],t[n]=0==u||13==u||26==u||39==u?CARD_VALUES.WILD: b[parseInt(s)]._dealtCards[n]%13):-1!=c.indexOf("JW")?(u=b[parseInt(s)]._dealtCards[parseInt(n)],t[n]=52==u?CARD_VALUES.JOKER:b[parseInt(s)]._dealtCards[n]%13):t[n]=b[parseInt(s)]._dealtCards[n]%13,v[n]=b[parseInt(s)]._dealtCards[n],w[n]=b[parseInt(s)]._holdStatus[n],x[n]=RSPokerDataParser._getSymbolForCard(b[parseInt(s)]._dealtCards[n],c);n=RSPokerDataParser._getHighCard(C,v);t=new RSPokerAction(d,h,p,m,e,POKER_STATE.DEAL,r,A,RSPokerDataParser._getSymbolForCard(n,c),t,c,x,w,g);RSQuestManager.getInstance().triggerAction(t); if(t=b[parseInt(s)]._hand._cardCount){for(v=0;va?CARD_VALUES.CLUBS:13<=a&&26>a?CARD_VALUES.DIAMONDS:26<=a&&39>a?CARD_VALUES.HEARTS:39<=a&&52>a?CARD_VALUES.SPADES:CARD_VALUES.WILD:CARD_VALUES.WILD}; RSPokerDataParser._getHighCard=function(a,b){for(var c=0,d=0,e=0;5>e;e++)for(var d=a+13*e,f=0;5>f;f++)b[f]==d?c=d:c;return c};var BetTypes={MIN_BET:0,MAX_BET:1,VAR_BET:2},WinTypes={NO_WIN:0,SMALL_WIN:1,BIG_WIN:2,FREESPIN_WIN:3,BONUS_WIN:4},RSSlotMachineAction=RSClass.extend({_result:null,init:function(a){this._result=a;this._count=0},_generateSlotSymbolKey:function(a){return this._result._machineAnalyticsID+"_"+a},findValueIndex:function(a,b){if(void 0==this._result._gameResult&&void 0==this._result._machineAnalyticsID)return-1;if("SS"==a)for(var c in this._result._gameResult._spinGenerated)if(this._generateSlotSymbolKey(this._result._gameResult._spinGenerated[c])== b)return c;return-1},findValueCount:function(a,b){if(void 0==this._result._gameResult&&void 0==this._result._machineAnalyticsID)return 0;var c=0;if("SS"==a)for(var d in this._result._gameResult._spinGenerated)this._generateSlotSymbolKey(this._result._gameResult._spinGenerated[d])==b&&c++;return c},calculateCount:function(a,b){return this._count=this.findValueCount(a,b)},equalValidation:function(a,b){if(void 0==this._result._gameResult&&void 0==this._result._machineAnalyticsID)return"SR"==a&&Number(b.replace("sr_", ""))===WinTypes.BIG_WIN&&this._result._isBigWin?!0:!1;if(void 0==this._result._gameResult){if("SWC"==a){if(this._result._totalWinAmount==Number(b.replace("swc_","")))return!0}else if("SBC"==a&&this._result._totalBetAmount==Number(b.replace("sbc_","")))return!0;return!1}if("SR"!=a)if("SWC"===a){if(this._result._totalWinAmount==Number(b.replace("swc_","")))return!0}else if("SBT"==a){var c=Number(b.replace("sbt_",""));if(c===BetTypes.MIN_BET){if(this._result._totalBetAmount==this._result._betStructure[0])return!0}else if(c=== BetTypes.MAX_BET&&this._result._totalBetAmount==this._result._betStructure[this._result._betStructure.length-1])return!0}else if("SBC"==a){if(this._result._totalBetAmount==Number(b.replace("sbc_","")))return!0}else if("SGT"==a)if(c=Number(b.replace("sgt_","")),0==c){if(0Number(b.replace("swc_","")))return!0}else if("SBC"==a&&this._result._totalBetAmount>Number(b.replace("sbc_", "")))return!0;return!1}if("SR"!=a)if("SWC"===a){if(this._result._totalWinAmount>Number(b.replace("swc_","")))return!0}else if("SBT"!=a)if("SBC"==a){if(this._result._totalBetAmount>Number(b.replace("sbc_","")))return!0}else if("SGT"!=a&&"SM"!=a&&"SWT"==a){var c=Number(b.replace("swt_",""))+2,d;for(d in this._result._lineWinDetails)if(this._result._gameResult._lineWinDetails[d]._numSymbolRecurrence>c)return!0}return!1},updateCount:function(a){if("incrementer"!=a){if("count"==a)return this._count;if("bet_amount"== a)return this._result._totalBetAmount;if("win_amount"==a)return this._result._totalWinAmount}return 1},checkGenre:function(a){return"SLOTS"==a?!0:!1}});var RSMegaChallengeManager=function(){var a,b=RSClass.extend({_megaChallengePoints:null,_megaChallengeReward:null,_megaChallengeMaxPoints:null,_megaChallengeEndTime:null,_megaChallengeStatus:null,_megaChallengeData:null,_dailyQuestDay:null,_megaChallegeRewardShown:null,init:function(){},initializeWithDataForMegaChallenges:function(a){this._megaChallengeData=a;this._megaChallengeStatus=a.status;this._megaChallengePoints=a.currentPoints;this._megaChallengeReward=a.rewardType;this._megaChallengeMaxPoints= a.points;this._megaChallengeEndTime=a.endTime},addMegaChallengePoints:function(a){a=parseInt(this._megaChallengePoints)+parseInt(a);this._megaChallengePoints=a>this._megaChallengeMaxPoints?this._megaChallengeMaxPoints:a;this._megaChallengePoints>=this._megaChallengeMaxPoints&&0==this._megaChallengeStatus&&(this._megaChallengeStatus=1);URLConfig.CLEVERTAP_ENABLED&&RSPlatformSDKManager.getInstance().setUserAttributeDailyQuestPoints(parseInt(this._megaChallengePoints));this.writeToUserBlob()},getMegaChallengeStatus:function(){return this._megaChallengeStatus}, setMegaChallengeStatus:function(a){this._megaChallengeStatus=a;this.writeToUserBlob()},writeToUserBlob:function(){this._megaChallengeData.status=this._megaChallengeStatus;this._megaChallengeData.currentPoints=this._megaChallengePoints},getProgressPercentage:function(){return this._megaChallengePoints/this._megaChallengeMaxPoints},getTimeRemaining:function(){var a=this._megaChallengeEndTime-TimeManager.getInstance().getCurrentServerTime();return 86400>a?RSUtils.formattedTime(a):~~(a/86400)+1+" Days Left"}, getQuestDay:function(){return 86400a&&(c=0);this._barEdgeAnim&&(0this._questTotalCount?new RSScaledLabel(RSUtils.formatNumberWithComma(1* this._questTotalCount)+"/"+RSUtils.formatNumberWithComma(1*this._questTotalCount),RSGame.getInstance().getGameManager().getDefaultFontForDailyQuestProgressText(),b,kTEXT_ALIGNMENT_CENTER):new RSScaledLabel(RSUtils.formatNumberWithComma(1*this._progressCount)+"/"+RSUtils.formatNumberWithComma(1*this._questTotalCount),RSGame.getInstance().getGameManager().getDefaultFontForDailyQuestProgressText(),b,kTEXT_ALIGNMENT_CENTER);this.addChild(this._challengeProgressLabel);break;case "ChallengeText":var c= this._questObject.description;2<=c.split("\\").length&&(c=c.replace("\\u2122","\u2122"));var d=kTEXT_ALIGNMENT_CENTER,e=RSGame.getInstance().getGameManager().getDefaultFontForDailyQuestRewardText();null!=e.ChallengeTextAlignment&&(d=e.ChallengeTextAlignment);this._challengeLabel=new RSScaledLabel(c,this._font,b,d);this.addChild(this._challengeLabel);this._challengeLabel.setZOrder(2);break;case "DC_MeterBG":this.addChild(RSUtils.createBasicObject(a,b));break;case "DC_Target":this._target=RSUtils.createBasicObject(a, b);this._target.setVisible(!1);break;case "DC_MeterFill":this._progressBarAnimation=new RSUtils.createAnimation(a,b,0.3);break;case "DC_MeterFillBG":this._progressBarData=b;this._progressBarScreenName=a;break;case "CompletedTick":this._questCompleteCheckMark=RSUtils.createAnimation(a,b,0.3),this._questCompleteCheckMark.setVisible(!1),this.addChild(this._questCompleteCheckMark)}},onButtonClicked:function(a){switch(a){case "ChallengeAction":this._actionButton.setTouchEnabled(!1);0==this._questStatus? this.loadNextScreen():1==this._questStatus&&(this._actionButton.setTouchEnabled(!1),this._actionButtonText.setOpacity(~~(this._actionButtonText.getOpacity()/2)),this._parentInstance.switchActiveWidget(QUEST_POPUP_WIDGETS.QUEST_REWARD,this._questObject),this._parentInstance._lastRewardedQuest=this._questIndex,RSAnalyticsManager.getInstance().trackGUIEvent("daily_challenge","quest_popup","collect",this._questObject.objectiveList[0].objective[0].id,"day"+RSMegaChallengeManager.getInstance().getQuestDay()), RSAnalyticsManager.getInstance().trackGUIEvent("daily_challenge","quest_collect_popup","trigger",this._questObject.objectiveList[0].objective[0].id,"day"+RSMegaChallengeManager.getInstance().getQuestDay()),URLConfig.CLEVERTAP_ENABLED&&(0==RSQuestManager.getInstance().getNumCompletedAndNotCollectedQuests()&&RSPlatformSDKManager.getInstance().setUserAttributeDQRewardPending(!1),RSPlatformSDKManager.getInstance().trackEvent(SDK_EVENT_TYPE.dailyQuestEngaged)));break;case "SwapBtn":this._parentInstance._isRefreshingData= !0,RSAnalyticsManager.getInstance().trackInHouseEvent("gui","daily_challenge","swap_button","click","",""),RSEngine.popupManager.addPopup(new RSSkipChallengeConfirmationPopup(RSGame.getInstance().getAssetPath(this._parentInstance._skipConfirmationText),this.swapChallenge.bind(this)),!0)}},swapChallenge:function(a){a&&this._parentInstance.skipDailyQuests(this._questObject.id)},loadNextScreen:function(){var a=null;RSAnalyticsManager.getInstance().trackGUIEvent("daily_challenge","quest_popup","play", this._objectiveID,"day"+RSMegaChallengeManager.getInstance().getQuestDay());switch(this._questObject.questActionType){case "1":if(RSGameScreenManager.getInstance().getCurrentScreen()==this._questObject.questAction.toLowerCase())break;a="lobby_navigation";RSGame.getInstance().getGameManager().removeScreensForNavigation();RSGameScreenManager.getInstance().loadScreen(this._questObject.questAction.toLowerCase());break;case "3":var b=RSQuestManager.getInstance().getGameTypeFromValue(this._questObject.questAction), c=!0;if(RSAnalyticsManager.getInstance().getCurrentMachineAnalyticsName()==this._machineAssociatedWithQuest&&"gameplay_screen"==RSGameScreenManager.getInstance().getCurrentScreen())break;var d=RSGame.getInstance().getGameData().getMachineDetailsByName(b,this._machineAssociatedWithQuest);if(d&&d.isEnabled&&!parseInt(d.isEnabled))break;RSGame.getInstance().getGameManager().triggerMemoryPopupStatus(b,d.machine_identifier)||(RSGame.getInstance().getGameManager().removeScreensForNavigation(),c=!1);a="load_machine"; RSCasinoManager.getCasinoInterface().loadMachine(b,this._machineAssociatedWithQuest,"RSDailyQuestPopup",!0,null,c);break;case "4":"WATCH_AD"==this._questObject.questAction&&(a="watchAd",RSEventManager.getInstance().dispatchEvent(RSPlatformEventTypeKeys.RSPlatformEvent,{event:RSPlatformEventTypeKeys.EARN_COINS_AD,parameter:RSPlatformPopupNameKeys.QUEST}))}this._parentInstance.closePopup(a)},update:function(){this._questStatus!=DailyChallengeObjectiveStatus.InProgress&&1<=this._progressBar.getDisplayedPercentage()&& !this._target.isVisible()&&(this._target.setScale(1.2),this._target.actionZoom(0.5,1,this.onBarFillComplete.bind(this)),this._target.setVisible(!0),RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("DailyChallengePopup")+"DartHit.mp3",!1))},onBarFillComplete:function(){this._actionButton.setTouchEnabled(!0)}}),AllQuestCompletedDisplay=RSDisplayObject.extend({init:function(a,b,c){this._font=b;this._offset=null;this._parentInstance=c;this._timer=null;this._displayArea=new RSRect(a.x, a.y,a.w,a.h);this._super.init.call(this,this._displayArea);this.loadLayout(RSGame.getInstance().getAssetPath("DailyChallengeCompleteWidget"));this.setPosition(this.getPosition()._x-this._offset._x,this.getPosition()._y-this._offset._y)},createCustomObject:function(a,b){switch(b.name){case "Time":var c=this._font,d=RSGame.getInstance().getGameManager().getDefaultFontForDailyQuestTimerText();d&&(c=d);this._timer=new RSScaledLabel("23:59:59",c,b,kTEXT_ALIGNMENT_CENTER);this._timer.setCenter(b.x,b.y); d||this._timer.setFontColor(244,229,66,255);this.addChild(this._timer)}},onObjectCreated:function(a,b,c){switch(c.name){case "CompleteText":this._offset=new RSPoint(c.x,c.y)}},update:function(a){this._timer&&this._timer.setString(RSUtils.formattedTime(a))}}),QuestRewardScreen=RSDisplayObject.extend({init:function(a,b,c){this._parentInstance=c;this._coinAmount=8E3;this._objID=null;this._megachallengePoints=this._coinAmountCounter=0;this._font=b;this._offset=this._sparkleAnimation=this._confettiAnimation= this._giftAnimation=this._coinAmountLabel=this._megachallengePointsLabel=null;this._displayArea=new RSRect(a.x,a.y,a.w,a.h);this._super.init.call(this,this._displayArea);this.loadLayout(RSGame.getInstance().getAssetPath("DailyChallengePrizeWidget"));this.setPosition(this.getPosition()._x-a.w/2,this.getPosition()._y-a.h/2);this.resetWidget(null)},playConfettiAnimation:function(){this._giftAnimation.playAnimation(1,0.4);this._confettiAnimation.playAnimation(1,0.4);this.scheduleFunctionOnce(this.playParticleAnimations.bind(this), 0.5)},resetWidget:function(a){this._giftAnimation.setFrame(0);this._confettiAnimation.setFrame(0);this._giftAnimation.stopAnimation();this._confettiAnimation.stopAnimation();if(void 0!=a){this.scheduleFunctionOnce(this.dismissWidget.bind(this),5);this.scheduleFunctionOnce(this.playConfettiAnimation.bind(this),1);RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("DailyChallengePopup")+"YouJustWon_GiftBox.mp3",!1);var b=a.rewardId,b=RSQuestManager.getInstance().getRewardForID(b); this._coinAmount=b.coins;this._megachallengePoints=b.points;RSMegaChallengeManager.getInstance().addMegaChallengePoints(this._megachallengePoints);this._coinAmountCounter=0;this._objID=RSQuestManager.getInstance().getObjectiveList(a.objectiveLists[0]).objective[0].id;RSQuestManager.getInstance().setUserObjectiveCompletionStatus(this._objID,DailyChallengeObjectiveStatus.CompletedAndCollected);RSMegaChallengeManager.getInstance().getMegaChallengeStatus()==DailyChallengeObjectiveStatus.Completed&&RSMegaChallengeManager.getInstance().setMegaChallengeStatus(DailyChallengeObjectiveStatus.Completed); RSEngine.dataManager.saveUserData("");this._coinAmountLabel.setString(this._coinAmount+"!");this.startActionTweenForKey("DCRollUp",0.5,0,this._coinAmount);this._megachallengePointsLabel.setString("+ "+this._megachallengePoints+" Mega Quest Points!");RSAnalyticsManager.getInstance().trackGUIEvent("daily_challenge","mega_quest_reward",this._megachallengePoints,this._objID,"day"+RSMegaChallengeManager.getInstance().getQuestDay());RSAnalyticsManager.getInstance().trackPrimarySource(RSAnalyticsSource.free, "daily_challenge_reward",this._coinAmount,this._objID,"day"+RSMegaChallengeManager.getInstance().getQuestDay());RSCasinoManager.addPrimaryCurrency(parseInt(this._coinAmount),!0);RSEventManager.getInstance().dispatchEvent(UPDATE_SIDEMENU_NOTIFICATION_COUNTER)}},actionOnUpdate:function(a,b){this._winDisplay=Math.floor(b);this._coinAmountLabel.setString(RSUtils.formatNumberWithComma(this._winDisplay))},actionOnComplete:function(){this.stopWinRollUp()},stopWinRollUp:function(){this.stopActionTweenForKey("DCRollUp"); this._coinAmountLabel.setString(RSUtils.formatNumberWithComma(this._winDisplay))},playParticleAnimations:function(){var a=new RSPoint(this._giftAnimation.getPosition().getX()+70,this._giftAnimation.getPosition().getY()+80);RSCasinoManager.getCasinoHUD().playCoinReceivedAnimation(a,this._giftAnimation,null);this._sparkleAnimation.playAnimation(1,0.4,this.updateMCMeter.bind(this))},updateMCMeter:function(){this._parentInstance.updateMeter()},dismissWidget:function(){RSAnalyticsManager.getInstance().trackGUIEvent("daily_challenge", "quest_collect_popup","close",this._objID,"day"+RSMegaChallengeManager.getInstance().getQuestDay());switch(RSMegaChallengeManager.getInstance().getMegaChallengeStatus()){case DailyChallengeObjectiveStatus.Completed:RSMegaChallengeManager.getInstance().getRewardScreenShownStatus()&&RSQuestManager.getInstance().getNumCompletedAndCollectedQuests()!=RSQuestManager.getInstance().getActiveQuestList().length?this._parentInstance.switchActiveWidget(QUEST_POPUP_WIDGETS.QUEST_LIST):(this._parentInstance.switchActiveWidget(QUEST_POPUP_WIDGETS.QUEST_MEGA_REWARD), RSAnalyticsManager.getInstance().trackPlayerAction("daily_challenge","mega_quest","eligible","","day"+RSMegaChallengeManager.getInstance().getQuestDay()));break;case DailyChallengeObjectiveStatus.InProgress:this._parentInstance.switchActiveWidget(QUEST_POPUP_WIDGETS.QUEST_LIST);break;case DailyChallengeObjectiveStatus.CompletedAndCollected:case DailyChallengeObjectiveStatus.RewardCollected:this._parentInstance.switchActiveWidget(QUEST_POPUP_WIDGETS.QUEST_LIST)}},createCustomObject:function(a,b){switch(b.type){case "Label":"DC_RewardCoins"== b.name?(this.coinFontForDC=RSGame.getInstance().getGameManager().getDefaultFontForDailyQuestRewardText(),this._coinAmountLabel=new RSScaledLabel("8000!",this.coinFontForDC.COIN_FONT?this.coinFontForDC.COIN_FONT:this._font,b,this.coinFontForDC.QuestRewardAlignment?this.coinFontForDC.QuestRewardAlignment:kTEXT_ALIGNMENT_LEFT),this.addChild(this._coinAmountLabel)):"DC_RewardPoints"==b.name&&(this._megachallengePointsLabel=new RSScaledLabel("+ 500 Mega Quest Points!",this._font,b,kTEXT_ALIGNMENT_CENTER), this.addChild(this._megachallengePointsLabel))}},onObjectCreated:function(a,b,c){switch(c.type){case "Animation":a.stopAnimation(),a.playAnimation(1,0.4),"GiftBoxAnim"==c.name?this._giftAnimation=a:"ConfettiAnim"==c.name?this._confettiAnimation=a:"ParticleAnim"==c.name&&(this._sparkleAnimation=a,a.stopAnimation())}},handleCountUp:function(){this._coinAmountCounter+=1/120*this._coinAmount;this._coinAmountCounter=this._coinAmountCounter>this._coinAmount?this._coinAmount:~~this._coinAmountCounter;this._coinAmountLabel.setString(RSUtils.formatNumberWithComma(this._coinAmountCounter))}, update:function(){}}),MegaQuestReward=RSDisplayObject.extend({init:function(a,b,c){this._parentInstance=c;this._font=b;this._displayArea=new RSRect(a.x,a.y,a.w,a.h);this._super.init.call(this,this._displayArea);this._offset=null;this.loadLayout(RSGame.getInstance().getAssetPath("MegaChallengeCompletedWidget"));this.setPosition(this.getPosition()._x-a.w/2,this.getPosition()._y-a.h/2)},createCustomObject:function(a,b){switch(b.type){case "MC_Reward":this.addChild(RSUtils.createBasicObject(a,b));break; case "MC_Reward_Text":this._MCrewardText=RSUtils.createBasicObject(a,b),this.addChild(this._MCrewardText)}},onObjectCreated:function(a,b,c){"Animation"==c.type&&"Sparkle"==c.name&&(a.stopAnimation(),a.playAnimation(-1,0.3),a.setScale(2))},dismissMegaRewardWidget:function(){},update:function(){}}),RSDailyQuestPopup=RSPopup.extend({init:function(a,b,c,d,e){this._screenLayout=a;this._font=b.DESCRIPTON_FONT?b.DESCRIPTON_FONT:b;this._popupData=this._widgetData=this._weeklyBonusMeterBarEdgeAnimation=this._weeklyBonusMeterBarBodyAnimation= this._meterBarData=this._weeklyBonusMeter=this._onMegaQuestComebackText=this._onMegaQuestCompleteText=this._rewards=this._dailyChallengeTimer=this._weeklyChallengeTimer=this._timeLeftText=null;this._isRefreshingData=!1;this._callBack=c;this._super.init.call(this,c);RSAnalyticsManager.getInstance().trackGUIEvent("daily_challenge","quest_popup","open","","day"+RSMegaChallengeManager.getInstance().getQuestDay());this._megaChallengeReward=this._dailyQuestReward=this._allQuestsCompletedDisplay=this._questListDisplay= null;this._lastRewardedQuest=-1;this._infoBubble=null;this._triggerRewardScreen=d?d:!1;this._customQuestObject=e;this._tempDailyQuestEndTime=RSGame.getInstance().getUserDataManager().getMe().getDailyChallengeData().activeQuests[0].endTime;this._tempWeeklyQuestEndTime=RSGame.getInstance().getUserDataManager().getMe().getDailyChallengeData().megaChallenge.endTime;RSUtils.loadJsonAsyc("res/PlatformWidgets/DailyChallengesPopup/DailyQuestConfig.json",null,this.onDataLoaded.bind(this));this._activeWidget= null;this._infoPopupTriggered=!1;this._popupCloseFrom=null;this._skip=!1;RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("DailyChallengePopup")+"DailyQuest_PopUpMenu.mp3",!1)},onDataLoaded:function(a){this._buttonTxtScalex=a.init.ScaleforButtonText.xScale;this._buttonTxtScaley=a.init.ScaleforButtonText.yScale;a.init.PositionforButtonText&&(this._buttonPosx=a.init.PositionforButtonText.xPos,this._buttonPosy=a.init.PositionforButtonText.yPos);this._skipConfirmationText=a.init.SkipConfirmationFont; this._swapDescriptionText=a.init.SwapDescriptionFont;a.init.TimerText&&(this._timerText=a.init.TimerText)},onObjectCreated:function(a,b,c){switch(c.name){case "TimerBg":this._timerBg=a;break;case "CloseButton":this._closeBtn=a}},refreshQuests:function(){RSEngine.screenManager.addOverlay();RSEngine.gameData.readLTEMGameDataEvents(this.onDataRefresh.bind(this),this.onDataRefresh.bind(this),"dailyChallengeRefresh")},skipDailyQuests:function(a){var b;b=RSQuestManager.getInstance().getCurrentQuestSetId(); RSEngine.screenManager.addOverlay();RSEngine.gameData.gameDataskipDailyChallengeEvents(this.onSkipQuest.bind(this),this.onSkipQuest.bind(this),a,b)},onDataRefresh:function(a){RSGame.getInstance().getUserDataManager().getMe().setDailyChallengeData(a.result.events[0].dailyChallengeData);RSGame.getInstance().getGameManager().refreshQuestData();RSEngine.dataManager.getCurrentCoinBalance(this.onCallBackOnCoinSuccess.bind(this))},onSkipQuest:function(a){RSGame.getInstance().getUserDataManager().getMe().setDailyChallengeData(a.result.dailyChallengeData); RSGame.getInstance().getGameManager().refreshQuestData();RSEngine.dataManager.getCurrentCoinBalance(this.onCallBackOnCoinSuccess.bind(this))},onCallBackOnCoinSuccess:function(){this.updatePopupElements();this.updateMeter();this._isRefreshingData=!1;RSEngine.screenManager.removeOverlay()},updatePopupElements:function(){this.removeChild(this._dailyChallengeTimer,!0);this.removeChild(this._questListDisplay,!0);this.removeChild(this._dailyQuestReward,!0);this.removeChild(this._megaChallengeReward,!0); this.removeChild(this._allQuestsCompletedDisplay,!0);var a=this._font,b=RSGame.getInstance().getGameManager().getDefaultFontForDailyQuestTimerText();b&&(a=b);this._dailyChallengeTimer=new RSScaledLabel("23:59:59",a,this._popupData,kTEXT_ALIGNMENT_CENTER);this._dailyChallengeTimer.setCenter(this._popupData.x,this._popupData.y);null==b&&this._dailyChallengeTimer.setFontColor(244,229,66,255);this.addChild(this._dailyChallengeTimer);this.addChild(this._timeLeftText);this._activeWidget=this._questListDisplay= new QuestListDisplay(this._widgetData,this._font,this);this._dailyQuestReward=new QuestRewardScreen(this._widgetData,this._font,this);this._megaChallengeReward=new MegaQuestReward(this._widgetData,this._font,this);this._tempDailyQuestEndTime=RSGame.getInstance().getUserDataManager().getMe().getDailyChallengeData().activeQuests[0].endTime;this.addChild(this._activeWidget)},loadContent:function(){this._super.loadContent.call(this);this.layoutScreen(this._screenLayout);var a=new RSClippingNode(RSUtils.createBasicObject(this._loaderScreenName, this._meterBarData));a.setAlphaThreshold(127);this._weeklyBonusMeter=new RSDailyQuestProgressMeter(this._meterBarData,"DailyChallengePopup",this._weeklyBonusMeterBarBodyAnimation,this._weeklyBonusMeterBarEdgeAnimation,a);this.addChild(this._weeklyBonusMeter);this._meterOverLay&&this.addChild(this._meterOverLay);this._weeklyBonusMeter.setBarInitialPos(0);this.addChild(a);this.addChild(this._rewards);this.updateMeter();1==parseInt(RSGame.getInstance().getGameData().getDefaultValues().isDQNewFlowEnabled)&& this._triggerRewardScreen?this.switchActiveWidget(QUEST_POPUP_WIDGETS.QUEST_REWARD,this._customQuestObject):RSQuestManager.getInstance().getNumCompletedAndCollectedQuests()!=RSQuestManager.getInstance().getActiveQuestList().length?cc.log("All quests are completed"):RSMegaChallengeManager.getInstance().getMegaChallengeStatus()==DailyChallengeObjectiveStatus.CompletedAndCollected||RSMegaChallengeManager.getInstance().getMegaChallengeStatus()==DailyChallengeObjectiveStatus.Completed?this.switchActiveWidget(QUEST_POPUP_WIDGETS.QUEST_MEGA_REWARD): RSMegaChallengeManager.getInstance().getMegaChallengeStatus()==DailyChallengeObjectiveStatus.RewardCollected&&this.switchActiveWidget(QUEST_POPUP_WIDGETS.QUEST_COMPLETED)},getLocalStoreKeyForDisplayedProgress:function(a){return"DisplayedMeterValueForQuest"+a},updateMeter:function(){var a=this.getLocalStoreKeyForDisplayedProgress(this._questID),b=RSUtils.getLocalStorageItem(a,0);this._weeklyBonusMeter.setBarInitialPos(b);this._weeklyBonusMeter.moveBarTo(RSMegaChallengeManager.getInstance().getProgressPercentage()); RSUtils.setLocalStorageItem(a,RSMegaChallengeManager.getInstance().getProgressPercentage());this._onMegaQuestCompleteText&&1<=RSMegaChallengeManager.getInstance().getProgressPercentage()&&RSMegaChallengeManager.getInstance().getMegaChallengeStatus()!=DailyChallengeObjectiveStatus.RewardCollected?(this._weeklyChallengeTimer&&this._weeklyChallengeTimer.setVisible(!1),this._onMegaQuestComebackText&&this._onMegaQuestComebackText.setVisible(!1),this._onMegaQuestCompleteText.setVisible(!0)):this._onMegaQuestComebackText&& 1<=RSMegaChallengeManager.getInstance().getProgressPercentage()&&RSMegaChallengeManager.getInstance().getMegaChallengeStatus()==DailyChallengeObjectiveStatus.RewardCollected&&(this._weeklyChallengeTimer&&this._weeklyChallengeTimer.setVisible(!1),this._onMegaQuestCompleteText&&this._onMegaQuestCompleteText.setVisible(!1),this._onMegaQuestComebackText.setVisible(!0))},createCustomObject:function(a,b){switch(b.name){case "MC_DaysLeft":var c=this._font,d=RSGame.getInstance().getGameManager().getDefaultFontForDailyQuestTimerText(); d&&(c=d);this._weeklyChallengeTimer=new RSScaledLabel("N days left",c,b,kTEXT_ALIGNMENT_CENTER);this._weeklyChallengeTimer.setCenter(b.x,b.y);this.addChild(this._weeklyChallengeTimer);break;case "MC_MeterBg":this.addChild(RSUtils.createBasicObject(a,b));break;case "MC_MeterFillBg":this._loaderScreenName=a;this._meterBarData=b;break;case "LoadingGlow":this._weeklyBonusMeterBarEdgeAnimation=RSUtils.createAnimation(a,b,1);this._weeklyBonusMeterBarEdgeAnimation.stopAnimation();this._weeklyBonusMeterBarEdgeAnimation.playAnimation(-1, 0.3);0>=RSMegaChallengeManager.getInstance().getProgressPercentage()&&this._weeklyBonusMeterBarEdgeAnimation.setVisible(!1);break;case "MC_MeterFill":this._weeklyBonusMeterBarBodyAnimation=RSUtils.createAnimation(a,b,1);this._weeklyBonusMeterBarBodyAnimation.stopAnimation();this._weeklyBonusMeterBarBodyAnimation.playAnimation(-1,0.3);break;case "SpinWheel":this._rewards=RSUtils.createBasicObject(a,b);break;case "ComeBack":this._onMegaQuestCompleteText=RSUtils.createBasicObject(a,b);this.addChild(this._onMegaQuestCompleteText); this._onMegaQuestCompleteText.setVisible(!1);break;case "BonusCollected":this._onMegaQuestComebackText=RSUtils.createBasicObject(a,b);this.addChild(this._onMegaQuestComebackText);this._onMegaQuestComebackText.setVisible(!1);break;case "DC_Timer":c=this._font;(d=RSGame.getInstance().getGameManager().getDefaultFontForDailyQuestTimerText())&&(c=d);this._dailyChallengeTimer=new RSScaledLabel("23:59:59",c,b,kTEXT_ALIGNMENT_CENTER);this._dailyChallengeTimer.setCenter(b.x,b.y);null==d&&this._dailyChallengeTimer.setFontColor(244, 229,66,255);this.addChild(this._dailyChallengeTimer);this._popupData=b;break;case "DC_Timeleft":c=this._font;(d=RSGame.getInstance().getGameManager().getDefaultFontForDailyQuestTimerText())&&(c=d);this._timerText&&(c=RSGame.getInstance().getAssetPath(this._timerText));this._timeLeftText=new RSScaledLabel("Time Left:",c,b,kTEXT_ALIGNMENT_CENTER);this._timeLeftText.setCenter(b.x,b.y);this.addChild(this._timeLeftText);break;case "DC_WidgetHolder":this._widgetData=b;this._activeWidget=this._questListDisplay= new QuestListDisplay(b,this._font,this);this._allQuestsCompletedDisplay=new AllQuestCompletedDisplay(b,this._font,this);this._questListDisplay.getIsQuestInProgress()||this.setUpAllQuestCompletedDisplay();this._dailyQuestReward=new QuestRewardScreen(b,this._font,this);this._megaChallengeReward=new MegaQuestReward(b,this._font,this);this.addChild(this._activeWidget);break;case "InfoPopup":this._infoBubble=RSUtils.createBasicObject(a,b),this._infoBubble.setVisible(!1),this.addChild(this._infoBubble)}this._super.createCustomObject.call(this, a,b)},setUpAllQuestCompletedDisplay:function(){this.removeChild(this._dailyChallengeTimer);this.removeChild(this._timeLeftText);this._dailyChallengeTimer.setScale(1.2);this._activeWidget=this._allQuestsCompletedDisplay},onButtonClicked:function(a){switch(a){case "CloseButton":RSAnalyticsManager.getInstance().trackGUIEvent("daily_challenge","quest_popup","close","","day"+RSMegaChallengeManager.getInstance().getQuestDay());this.closePopup();break;case "InfoButton":if(this._infoPopupTriggered)break; a=new RSQuestWelcomePopup(RSGame.getInstance().getAssetPath("DailyChallengeWelcomePopup"),!0,this._callBack);this._infoPopupTriggered=!0;a.loadDailyQuestPopupOnExit();this._skip=!0;RSEngine.popupManager.addPopup(a);RSAnalyticsManager.getInstance().trackGUIEvent("daily_challenge","info_button","click","");this.closePopup()}},switchActiveWidget:function(a,b){var c=null;this._closeBtn.setTouchEnabled(!0);switch(a){case QUEST_POPUP_WIDGETS.QUEST_LIST:c=this._questListDisplay;RSQuestManager.getInstance().getNumCompletedAndCollectedQuests()!= RSQuestManager.getInstance().getActiveQuestList().length?(this._questListDisplay.reinitializeList(),1==parseInt(RSEngine.gameData.getDefaultValues().IsDCPrizeWidgetTimerDisabled)&&(this._timeLeftText.setVisible(!0),this._dailyChallengeTimer.setVisible(!0))):(c=this._allQuestsCompletedDisplay,this.removeChild(this._timeLeftText),this.removeChild(this._dailyChallengeTimer));break;case QUEST_POPUP_WIDGETS.QUEST_REWARD:this._closeBtn.setTouchEnabled(!1);c=this._dailyQuestReward;this._dailyQuestReward.resetWidget(b); 1==parseInt(RSEngine.gameData.getDefaultValues().IsDCPrizeWidgetTimerDisabled)&&(this._timeLeftText.setVisible(!1),this._dailyChallengeTimer.setVisible(!1));break;case QUEST_POPUP_WIDGETS.QUEST_MEGA_REWARD:RSQuestManager.getInstance().getNumCompletedAndCollectedQuests()!=RSQuestManager.getInstance().getActiveQuestList().length&&this._closeBtn.setTouchEnabled(!1);RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("DailyChallengePopup")+"Congratulations.mp3",!1);c=this._megaChallengeReward; this._timeLeftText.setVisible(!1);this._dailyChallengeTimer.setVisible(!1);this._weeklyChallengeTimer.setVisible(!1);this._timerBg&&this._timerBg.setVisible(!1);RSMegaChallengeManager.getInstance().setRewardScreenShownStatus();RSQuestManager.getInstance().getNumCompletedAndCollectedQuests()!=RSQuestManager.getInstance().getActiveQuestList().length&&this.scheduleFunctionOnce(this.switchActiveWidget.bind(this,QUEST_POPUP_WIDGETS.QUEST_LIST),4);break;case QUEST_POPUP_WIDGETS.QUEST_COMPLETED:c=this._allQuestsCompletedDisplay; this.removeChild(this._dailyChallengeTimer);this.removeChild(this._timeLeftText);this._dailyChallengeTimer.setScale(1.2);break;default:return}this.removeChild(this._activeWidget);this._activeWidget=c;this.addChild(this._activeWidget)},update:function(){if(!this._isRefreshingData){var a=this.updateDailyChallengeTimer();this.updateWeeklyChallengeTimer();this._activeWidget.update(a)}},updateWeeklyChallengeTimer:function(){this._weeklyChallengeTimer.setString(RSMegaChallengeManager.getInstance().getTimeRemaining())}, updateDailyChallengeTimer:function(){var a=this._tempDailyQuestEndTime-TimeManager.getInstance().getCurrentServerTime();this._dailyChallengeTimer.setString(RSUtils.formattedTime(a));0>=a&&!this._isRefreshingData&&(this._isRefreshingData=!0,this.refreshQuests());return a},showSwapDescription:function(a,b){var c=new RSSwapDescription("Arrow_Top_Right",RSGame.getInstance().getAssetPath(b._swapDescriptionText));c.setPosition(a.getX(),a.getY());this._messageBubble=c;this._messageBubble.setZOrder(10);this.addChild(this._messageBubble); this.scheduleFunctionOnce(function(){this._messageBubble&&(this._messageBubble.setVisible(!1),this.removeChild(this._messageBubble),this._messageBubble=null)}.bind(this),5)},handleTouchEndAt:function(a,b,c){},unload:function(){this._messageBubble&&(this.removeChild(this._messageBubble),this._messageBubble=null);this._super.unload.call(this)},closePopup:function(a){this._popupCloseFrom=a;"watchAd"!=a&&QUEST_POPUP_WIDGETS.WATCHAD_LISTENER&&(RSEventManager.getInstance().removeListenersForEvent("videoNotAvailable"), RSEventManager.getInstance().removeListenersForEvent("WatchAdCompleted"));RSEventManager.getInstance().dispatchEvent("refreshQuestCountText");this._super.closePopup.call(this)},unloadContent:function(){if(null!=this._callback||void 0!=this._callback)this._skip||this._callback(this._popupCloseFrom),this._callback=null;this._super._super.unloadContent.call(this)}});var RSQuestWelcomePopup=RSPopup.extend({init:function(a,b,c){this._screenLayout=a;this._shouldLoadDailyQuestPopupOnExit=!1;this._triggeredFromQuestPopup=b;this._callBack=c;this._super.init.call(this);this._triggeredFromQuestPopup||RSAnalyticsManager.getInstance().trackGUIEvent("daily_challenge","quest_welcome_popup",b?"click":"trigger","")},loadContent:function(){this._super.loadContent.call(this);this.layoutScreen(this._screenLayout)},loadDailyQuestPopupOnExit:function(){this._shouldLoadDailyQuestPopupOnExit= !0},onObjectCreated:function(a,b,c){this._super.onObjectCreated.call(this,a,b,c);switch(c.name){case "CloseButton":this._closeButton=a;break;case "LetsGo":this._letsGoBtn=a;break;case "CoinGlow":a.stopAnimation(),a.playAnimation(-1,0.3)}},onButtonClicked:function(a){switch(a){case "LetsGo":this._letsGoBtn.setTouchEnabled(!1);RSEngine.popupManager.addPopup(new RSDailyQuestPopup(RSGame.getInstance().getAssetPath("DailyChallengePopup"),RSGame.getInstance().getGameManager().getDefaultFontForDailyQuestRewardText(), this._callBack));this.closePopup();break;case "CloseButton":this._closeButton.setTouchEnabled(!1),this._shouldLoadDailyQuestPopupOnExit&&RSEngine.popupManager.addPopup(new RSDailyQuestPopup(RSGame.getInstance().getAssetPath("DailyChallengePopup"),RSGame.getInstance().getGameManager().getDefaultFontForDailyQuestRewardText(),this._callBack)),this._triggeredFromQuestPopup?RSAnalyticsManager.getInstance().trackGUIEvent("daily_challenge","info_button","close",""):RSAnalyticsManager.getInstance().trackGUIEvent("daily_challenge", "quest_welcome_popup","close",""),this.closePopup()}}});var RSGeneralQuestEventKeys={GIFTING_QUEST_ACTION:"GiftingQuestAction",BIHOURLY_BONUS_COLLECTION_ACTION:"BihourlyBonusQuestAction",DAILY_BONUS_COLLECTION_ACTION:"DailyBonusQuestAction",LEVEL_UP_ACTION:"LevelUpAction",MACHINE_UNLOCK_ACTIONL:"MachineUnlockQuestAction",PURCHASE_ACTION:"PurchaseQuestAction",DAILY_LOGIN_ACTION:"DailyLoginAction",WATCH_AD_ACTION:"WatchAdAction"},RSQuestActionFormatter=function(){var a,b=RSClass.extend({addListeners:function(){RSEventManager.getInstance().addEventListener(RSGeneralQuestEventKeys.GIFTING_QUEST_ACTION, this,this.triggerGiftingAction.bind(this));RSEventManager.getInstance().addEventListener(RSGeneralQuestEventKeys.BIHOURLY_BONUS_COLLECTION_ACTION,this,this.triggerBihourlyBonuscollection.bind(this));RSEventManager.getInstance().addEventListener(RSGeneralQuestEventKeys.DAILY_BONUS_COLLECTION_ACTION,this,this.triggerDailyBonuscollection.bind(this));RSEventManager.getInstance().addEventListener(RSGeneralQuestEventKeys.LEVEL_UP_ACTION,this,this.triggerLevelUpAction.bind(this));RSEventManager.getInstance().addEventListener(RSGeneralQuestEventKeys.MACHINE_UNLOCK_ACTIONL, this,this.triggerMachineUnlockAction.bind(this));RSEventManager.getInstance().addEventListener(RSGeneralQuestEventKeys.PURCHASE_ACTION,this,this.triggerPurchaseAction.bind(this));RSEventManager.getInstance().addEventListener(RSGeneralQuestEventKeys.DAILY_LOGIN_ACTION,this,this.triggerDailyLoginAction.bind(this));RSEventManager.getInstance().addEventListener(RSGeneralQuestEventKeys.WATCH_AD_ACTION,this,this.triggerWatchAdAction.bind(this))},getName:function(){return"RSQuestActionFormatter"},triggerSlotBigWin:function(){RSQuestManager.getInstance().triggerAction(new RSSlotMachineAction({_isBigWin:!0}))}, triggerBihourlyBonuscollection:function(a){var b=new RSGeneralQuestEvent;b.eventID=GeneralQuestEventTypes.DAILY_BONUS;b.parameters=new BonusCollectionParameters;b.parameters.bonusCollected=a._userData;RSQuestManager.getInstance().triggerAction(new RSGeneralAction(b))},triggerDailyBonuscollection:function(a){var b=new RSGeneralQuestEvent;b.eventID=GeneralQuestEventTypes.BIHOURLY_BONUS;b.parameters=new BonusCollectionParameters;b.parameters.bonusCollected=a._userData;RSQuestManager.getInstance().triggerAction(new RSGeneralAction(b))}, triggerGiftingAction:function(a){var b=new RSGeneralQuestEvent;b.eventID=GeneralQuestEventTypes.GIFT;b.parameters=new GiftParameters;b.parameters.giftType=a;RSQuestManager.getInstance().triggerAction(new RSGeneralAction(b))},triggerLevelUpAction:function(a){var b=new RSGeneralQuestEvent;b.eventID=GeneralQuestEventTypes.LEVEL_UP;b.parameters=new LevelUpParameters;b.parameters.updatedLevel=a._userData;RSQuestManager.getInstance().triggerAction(new RSGeneralAction(b))},triggerMachineUnlockAction:function(a){var b= new RSGeneralQuestEvent;b.eventID=GeneralQuestEventTypes.MACHINE_UNLOCK;b.parameters=new MachineUnlockParameters;b.parameters.machineName=a;RSQuestManager.getInstance().triggerAction(new RSGeneralAction(b))},triggerPurchaseAction:function(a,b){var e=new RSGeneralQuestEvent;e.eventID=GeneralQuestEventTypes.PURCHASE;e.parameters=new PurchaseParameters;e.parameters.purchasePackID=a;e.parameters.purchasePriceDollars=b;RSQuestManager.getInstance().triggerAction(new RSGeneralAction(e))},triggerDailyLoginAction:function(a){var b= new RSGeneralQuestEvent;b.eventID=GeneralQuestEventTypes.DAILY_LOGIN;b.parameters=new DailyLoginParameters;b.parameters.loginCount=a._userData;RSQuestManager.getInstance().triggerAction(new RSGeneralAction(b))},triggerWatchAdAction:function(a){var b=new RSGeneralQuestEvent;b.eventID=GeneralQuestEventTypes.WATCH_AD;b.parameters=new WatchAdParameters;b.parameters.loginCount=a._userData;RSQuestManager.getInstance().triggerAction(new RSGeneralAction(b));"undefined"!==typeof SideMenuController&&SideMenuController.getInstance().updateToasterMessage()}, parseGameplayAction:function(a,b){if(RSQuestManager.getInstance().getIsQuestManagerActive())switch(b){case RSGameTypes.Poker:RSPokerDataParser.parse(a);break;case RSGameTypes.Slots:RSQuestManager.getInstance().triggerAction(new RSSlotMachineAction(a));break;case RSGameTypes.Blackjack:RSBlackjackDataParser.parse(a);break;case RSGameTypes.Keno:RSQuestManager.getInstance().triggerAction(new RSKenoAction(a));break;case RSGameTypes.Bingo:RSQuestManager.getInstance().triggerAction(new RSBingoAction(a))}}}); return{getInstance:function(){a||(a=new b);return a}}}();var RSQuestSetCompleted="QuestSetCOmpleted",RSObjectiveCountUpdated="ObjectiveCountUpdated",RSQuestCompleted="QuestCompleted",RSObjectiveCompleted="ObjectiveCompleted",RSQuestManager=function(){var a,b=RSClass.extend({_conditions:[],_objectives:[],_objectiveLists:[],_quests:[],_questSets:[],_questRewards:[],_activeQuestIds:[],_currentQuestSet:null,_activeQuestSets:[],_objectiveDetails:{},_isQuestManagerActive:!1,questConfig:null,_questActive:!1,_listenerAdded:!1,_weeklyChallengeEnabled:!1,init:function(){}, setIsQuestManagerActive:function(a){this._isQuestManagerActive=a},getIsQuestManagerActive:function(){return this._isQuestManagerActive},initializeWithDataForQuest:function(a,b){if(a.conditions){var e=RSEngine.gameData.getSheetData(a.conditions);if(e)for(var f=0;fm&&1>h/k&&(API.sendSideMenuMessage("update_SideMenu",{event:"QuestProgress",questDescription:g,questProgress:RSUtils.formatNumber(h)+"/"+RSUtils.formatNumber(k),progressPercentage:h/k}),RSUtils.setLocalStorageItem(e,n),RSAnalyticsManager.getInstance().trackGUIEvent("daily_challenge", "quest_progress","trigger",a,n));b&&1==h/k&&(this._currentQuestObject=c,API.sendSideMenuMessage("update_SideMenu",{event:"QuestProgress",questDescription:g,questProgress:RSUtils.formatNumber(h)+"/"+RSUtils.formatNumber(k),progressPercentage:h/k,showCollectBtn:!0}))},updateToasterMessage:function(){if(f){var a=RSQuestManager.getInstance().getUserObjectiveCount(f.id),b=f.count;API.sendSideMenuMessage("update_SideMenu",{event:"UpdateToasterMessage",questProgress:RSUtils.formatNumber(a)+"/"+RSUtils.formatNumber(b), progressPercentage:a/b})}},updateLockButton:function(){API.sendSideMenuMessage("update_SideMenu",{event:"HandleLockButtonVIsibility",flag:RSQuestManager.getInstance().questLevelEnabled(),level:RSQuestManager.getInstance().questConfig[0].unlockAt})},handlePositionAndOffset:function(){this.setPixiContainerScale();this.setMenuDivDimensions()},setMenuDivDimensions:function(){var a=document.getElementById("SideMenuIFrame");if(null!=a){var d=document.getElementById("Cocos2dGameContainer"),e=d.style.height, e=parseInt(e.substring(0,e.length-2))/640;this._sideMenuData=RSGame.getInstance().getGameManager().getSideMenuStyleData();a.style.top=this._sideMenuData.topPosition*e+"px";a.style.right="0px";a.style.width=this._sideMenuData.width*e*b+"px";a.style.height=350*e*c+"px";a.style.paddingRight=null!=RSEngine.externalGameManager?RSEngine.externalGameManager.isSpinGameActive()?0:d.style.paddingRight:d.style.paddingRight}},setPixiContainerScale:function(){var a=document.getElementById("Cocos2dGameContainer").style.height, a=parseInt(a.substring(0,a.length-2))/640;API.sendSideMenuMessage("update_SideMenu",{event:"OnResize",scale:a})},getName:function(){return"SideMenuController"},playTrayMoveSound:function(){if(this._isSideMenuVisible){var a=RSGame.getInstance().getAssetFolder("DailyChallengePopup")+"DailyQuest_SideBar.mp3";RSEngine.audioManager.playEffect(a,!1)}},playDartBoardSound:function(){this._isSideMenuVisible&&RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("DailyChallengePopup")+"OnQuestComplete.mp3", !1)},setClosedStateDivDimensions:function(){b=0.4;c=0.6;this.setMenuDivDimensions()},setOpenStateDivDimensions:function(){c=b=1;this.setMenuDivDimensions()},setToasterDivDimensions:function(){b=1.5;c=1;this.setMenuDivDimensions()},setToolTipDivDimensions:function(){b=1.68;c=1;this.setMenuDivDimensions()},onDailyBonusButtonClicked:function(a){if(RSEngine.dataManager.getMe().getDCinfoPopupShownStatus())if(RSEngine.loginMode==LOGIN_MODE.GUEST)RSGame.getInstance().getGameManager().showLoginPopup("feature", "DailyQuestButton");else if(RSQuestManager.getInstance().getWeeklyChallengeStatus())!0==LTEM_QUEST_DATA.AVAILABLE&&(this._quest=RSQuestManager.getInstance().getCurrentQuestSetId(),QuestPopupManager.getInstance().showQuestObjective(null,this._quest,!0));else if(RSQuestManager.getInstance().questLevelEnabled()){var b=RSGame.getInstance().getUserDataManager().getMe().getDailyChallengeData().activeQuests;if(b&&b.length){var c=0,d=!0;for(c in b)RSQuestManager.getInstance().getQuestSetForId(b[c].id)||(d= !1);d?a&&this._currentQuestObject?(RSAnalyticsManager.getInstance().trackGUIEvent("daily_challenge","quest_toaster","collect",this._currentQuestObject.objectiveList[0].objectives[0]),RSEngine.popupManager.addPopup(new RSDailyQuestPopup(RSGame.getInstance().getAssetPath("DailyChallengePopup"),RSGame.getInstance().getGameManager().getDefaultFontForDailyQuestRewardText(),null,!0,this._currentQuestObject)),this._currentQuestObject=null):(RSAnalyticsManager.getInstance().trackGUIEvent("slider","daily_challenge", "click"),RSEngine.popupManager.addPopup(new RSDailyQuestPopup(RSGame.getInstance().getAssetPath("DailyChallengePopup"),RSGame.getInstance().getGameManager().getDefaultFontForDailyQuestRewardText()))):API.sendSideMenuMessage("update_SideMenu",{event:"ShowToasterMessage",description:RSQuestManager.getInstance().questConfig[0].questUnavailableText})}else API.sendSideMenuMessage("update_SideMenu",{event:"ShowToasterMessage",description:RSQuestManager.getInstance().questConfig[0].questUnavailableText})}else API.sendSideMenuMessage("update_SideMenu", {event:"ShowToasterMessage",description:RSQuestManager.getInstance().questConfig[0].questLockedText})},playQuestCompletedReminderAnim:function(){c=b=1;this.setMenuDivDimensions()},playOnQuestCompleteAnimation:function(a){var b=a._userData.objectiveId;b&&RSAnalyticsManager.getInstance().trackPlayerAction("daily_challenge","quest_complete","complete",b,"day"+RSMegaChallengeManager.getInstance().getQuestDay());this.updateNotificationCounter();var c="",d;for(d in RSQuestManager.getInstance().getActiveQuestList()){var e= RSQuestManager.getInstance().getActiveQuestList()[d],f=RSQuestManager.getInstance().getQuest(e).objectiveList[0],g;for(g in f.objectives)if(b==f.objectives[g]){c=e;break}}1==parseInt(RSGame.getInstance().getGameData().getDefaultValues().isDQNewFlowEnabled)&&this._isSideMenuVisible&&c!=RSGame.getInstance().getGameData().getDefaultValues().loginDailyQuestId?this.showQuestProgressMessage(a,!0):API.sendSideMenuMessage("update_SideMenu",{event:"PlayOnQuestCompleteAnimation"})},enableAllButtons:function(){this.updateNotificationCounter(); API.sendSideMenuMessage("update_SideMenu",{event:"EnableAllButtons"})},disableAllButtons:function(){API.sendSideMenuMessage("update_SideMenu",{event:"DisableAllButtons"})},updateNotificationCounter:function(){this._dailyChallengeNotificationCount=RSQuestManager.getInstance().getNumCompletedQuests();RSEventManager.getInstance().dispatchEvent("refreshQuestCountText");API.sendSideMenuMessage("update_SideMenu",{event:"UpdateNotificationCount",notificationCount:this._dailyChallengeNotificationCount})}, updateMetaGameNofificationCounter:function(a){var b=!1;a&&a._userData&&a._userData.showAnimation&&(b=!0);API.sendSideMenuMessage("update_SideMenu",{event:"UpdateNotificationCountOfMetaGame",metaGameProgressData:RSGame.getInstance().getGameManager().getMetaGameProgressData(),showAnimation:b})},setSideMenuVisibility:function(a){this._isSideMenuVisible=!0;GameConfig.LOADING_MODULE_ENABLED&&RSEngine.loginMode==LOGIN_MODE.GUEST||RSEngine.dataManager.getMe()&&!RSEngine.dataManager.getMe().getDCinfoPopupShownStatus()&& (!GameConfig.TOURNAMENT_ENABLED||RSEngine.gameData&&!parseInt(RSEngine.gameData.getDefaultValues().isTournamentEnabled))?this._isSideMenuVisible=!1:(a?e="unset":(this._isSideMenuVisible=!1,e="none"),a=document.getElementById("SideMenuIFrame"),null!=a&&(a.style.display=e,RSEngine.dataManager.getMe().getDCinfoPopupShownStatus()&&this.updateNotificationCounter()))},initiationComplete:function(){this.handlePositionAndOffset()},getSideMenuItemsList:function(){API.sendSideMenuMessage("update_SideMenu", {event:"listOfSideMenuItems",sideMenuItemsList:RSGame.getInstance().getGameManager().getSideMenuItemsList()});RSEventManager.getInstance().dispatchEvent(SIDEMENU_ART_ASSETS_LOADED,null);RSAnalyticsManager.getInstance().trackInHouseEvent("playerevent","sidemenu","loaded",JSON.stringify(RSGame.getInstance().getGameManager().getSideMenuItemsList()),"","")},resolveMessages:function(a){switch(a.sideMenuEvent){case "OnDailyChallengeButtonPressed":this.onDailyBonusButtonClicked();break;case "OnSideMenuButtonPressed":RSGame.getInstance().getGameManager().onSideMenuButtonCliked(a.from); break;case "OnDartBoardAnimationInit":this.playDartBoardSound();break;case "onTrayCloseComplete":this.playTrayMoveSound();this.setClosedStateDivDimensions();break;case "OnTrayOpenInitiated":this.playTrayMoveSound();this.setOpenStateDivDimensions();RSGame.getInstance().getGameManager().sideMenuBtnClicked();break;case "OnToasterOpenInitiated":m=!0;this.setToasterDivDimensions();break;case "OnToasterClosed":m=!1;this.setClosedStateDivDimensions();break;case "InitializationComplete":this.initiationComplete(); break;case "getSideMenuItemsList":this.getSideMenuItemsList();break;case "log_error":RSErrorTracker.getInstance().trackErrorMessage("sidemenu_error",a.error_msg,"mahesh.jose@rubyseven.net,lijith.puthiyoottil@rubyseven.net");console.log("Error logged");break;case "OnCollectButtonPressed":this.onDailyBonusButtonClicked(!0);break;case "onQuestCompletedReminderAnim":this.playQuestCompletedReminderAnim(!0)}},isToasterActive:function(){return m},playTournamentAnimation:function(a){API.sendSideMenuMessage("update_SideMenu", {event:"PlayTournamentAnimation",eventData:a});"GO!"==a&&(g=setTimeout(this.dismissMessageBubble.bind(this),1E3),h=setTimeout(this.closeSideMenuTray.bind(this),1E4));this.setToolTipDivDimensions()},dismissMessageBubble:function(){clearTimeout(g);API.sendSideMenuMessage("update_SideMenu",{event:"PlayTournamentAnimation",eventData:"hideBubble"})},closeSideMenuTray:function(){clearTimeout(h);API.sendSideMenuMessage("update_SideMenu",{event:"PlayTournamentAnimation",eventData:"close"})},playSurfacingAnimation:function(a){"surfacing"== a?API.sendSideMenuMessage("update_SideMenu",{event:"PlayTournamentSurfacingAnimation",eventData:a}):"TournamentEntryinfo"==a?(g=setTimeout(this.dismissMessageBubble.bind(this),7E3),h=setTimeout(this.closeSideMenuTray.bind(this),7E3),API.sendSideMenuMessage("update_SideMenu",{event:"PlayTournamentSurfacingAnimation",eventData:"surfacing"}),a="Join the live \ntournaments today \nstarting at "+RSTournamentManager.getTournamentTimingData().titleKey3,k=setTimeout(this._showTournamentAccesInfo.bind(this, a),500)):"IntermediateBubbleInfo"==a?(g=setTimeout(this.dismissMessageBubble.bind(this),7E3),h=setTimeout(this.closeSideMenuTray.bind(this),7E3),API.sendSideMenuMessage("update_SideMenu",{event:"PlayTournamentSurfacingAnimation",eventData:"surfacing"}),a="Join the next tournament\n at "+RSTournamentManager.getTournamentTimingData().titleKey3,k=setTimeout(this._showTournamentAccesInfo.bind(this,a),500)):"TournamentWaitingOpen"==a?(g=setTimeout(this.dismissMessageBubble.bind(this),7E3),h=setTimeout(this.closeSideMenuTray.bind(this), 7E3),API.sendSideMenuMessage("update_SideMenu",{event:"PlayTournamentSurfacingAnimation",eventData:"surfacing"}),a="Tap here to join the\n Live Slots Tournament!","MSP"==GameConfig.GAME_ID&&(a="Tap here to join the\nLive Poker Tournament!"),k=setTimeout(this._showTournamentAccesInfo.bind(this,a),500)):(a="Join the live \ntournaments today \nstarting at "+RSTournamentManager.getTournamentTimingData().titleKey3,API.sendSideMenuMessage("update_SideMenu",{event:"PlayTournamentSurfacingAnimation",eventData:a}), h=setTimeout(this.closeSideMenuTray.bind(this),1E4));this.setToolTipDivDimensions()},_showTournamentAccesInfo:function(a){clearTimeout(k);API.sendSideMenuMessage("update_SideMenu",{event:"PlayTournamentSurfacingAnimation",eventData:a});this.setToolTipDivDimensions()}});return{getInstance:function(){a||(a=new n);return a}}}();var RSCurtainRaiserScreen=RSGameScreen.extend({init:function(a,b){this._super.init.call(this);this._typeOfSurfacing=void 0!=b||null!=b?b:"";this._curtainPanel=new RSPanel(RSEngine.screenWidth/2,RSEngine.screenHeight/2,RSEngine.screenWidth,RSEngine.screenHeight);this._commonBgForSurfacing=this._customBGforSurfacing=null;this.layoutScreen(a)},onAssetLoaded:function(a){this._super.onAssetLoaded.call(this,a)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);this._customBGforSurfacing? this._customBGforSurfacing.setVisible(!0):this._commonBgForSurfacing&&this._commonBgForSurfacing.setVisible(!0);this.addChild(this._curtainPanel);RSUtils.callFunctionWithDelay(1,this,this.initiateCurtainRaising.bind(this));RSUtils.callFunctionWithDelay(2,this,this.moveSideAndTopCurtain.bind(this))},onObjectCreated:function(a,b,c){switch(c.name){case "Bg":this._commonBgForSurfacing=a,this._commonBgForSurfacing.setVisible(!1)}this._super.onObjectCreated.call(this,a,b,c)},createCustomObject:function(a, b){var c=null;switch(b.name){case "CurtainRaiserBgLeft":this._curtainBgLeft=RSUtils.createBasicObject(a,b);this.addChild(this._curtainBgLeft);break;case "CurtainRaiserBgRightFlip":this._curtainBgRight=RSUtils.createBasicObject(a,b);this._curtainBgRight.setScaleX(-1);this.addChild(this._curtainBgRight);break;case "CurtainRaiserTopLeft":c=RSUtils.createBasicObject(a,b);this.addToPreIntroLayer(c);break;case "CurtainRaiserTopRightFlip":c=RSUtils.createBasicObject(a,b);c.setScaleX(-1);this.addToPreIntroLayer(c); break;case "CurtainRaiserPartLeft":c=RSUtils.createBasicObject(a,b);this.addToPreIntroLayer(c);break;case "CurtainRaiserPartRightFlip":c=RSUtils.createBasicObject(a,b);c.setScaleX(-1);this.addToPreIntroLayer(c);break;case "CustomBgFor"+this._typeOfSurfacing:this._customBGforSurfacing=RSUtils.createBasicObject(a,b),this.addChild(this._customBGforSurfacing),this._customBGforSurfacing.setVisible(!1)}},addToPreIntroLayer:function(a){var b=this._curtainPanel.convertToNodeSpace(a.getX(),a.getY());a.setCenter(b.getX(), b.getY());this._curtainPanel.addChild(a)},initiateCurtainRaising:function(){this._curtainBgLeft.actionMoveBy(1.8,-(2.8*this._curtainBgLeft.getPosition()._x),0,this.onComplete.bind(this));this._curtainBgRight.actionMoveBy(1.8,2.8*this._curtainBgLeft.getPosition()._x,0,null);switch(this._typeOfSurfacing){case "Tournament":RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("TournamaniaSurfacing")+"CurtainSFX.mp3",!1);break;case "FoxPlayIntroScreen":RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("LogoRevealingScreen")+ "Curtain_to_Full_Animation.mp3",!1);break;default:RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("CurtainRaiser")+"DC_CurtainSFX.mp3",!1)}},onComplete:function(){},moveSideAndTopCurtain:function(){this.firstSectionComplete();this._curtainPanel.actionZoom(1.5,1.5,this._borderMovementComplete.bind(this))},_borderMovementComplete:function(){cc.log("border movement");this.onCurtainRaised()},firstSectionComplete:function(){},onCurtainRaised:function(){},unloadContent:function(){this._super.unloadContent.call(this)}});var RSDailyQuestIntroScreen=RSCurtainRaiserScreen.extend({init:function(a){this._super.init.call(this,RSGame.getInstance().getAssetPath("CurtainRaiser"));this.callBack=a},loadContent:function(){this._super.loadContent.call(this)},createCustomObject:function(a,b){this._super.createCustomObject.call(this,a,b)},onObjectCreated:function(a,b,c){this._super.onObjectCreated.call(this,a,b,c)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this)},firstSectionComplete:function(){},onCurtainRaised:function(){this._unlockScreen= new RSDailyChallengeUnlockScreen(this.onDCUnlockAnimComplete.bind(this));this.addChild(this._unlockScreen)},onDCUnlockAnimComplete:function(a){this.callBack&&this.callBack.call(this,a)},unloadContent:function(){this._super.unloadContent.call(this)}});var RSDailyChallengeUnlockScreen=RSGameScreen.extend({init:function(a){this._super.init.call(this);this.callBack=a;this._questUnlockPanel=new RSPanel(RSEngine.screenWidth/2,RSEngine.screenHeight/2,RSEngine.screenWidth,RSEngine.screenHeight);this.addChild(this._questUnlockPanel);this._questUnlockPanel.setVisible(!1);this._questInfoPanel=new RSPanel(RSEngine.screenWidth/2,RSEngine.screenHeight/2,RSEngine.screenWidth,RSEngine.screenHeight);this.addChild(this._questInfoPanel);this._questInfoPanel.setVisible(!1); this._dartPanel=new RSPanel(RSEngine.screenWidth/2,RSEngine.screenHeight/2,RSEngine.screenWidth,RSEngine.screenHeight);this.addChild(this._dartPanel);this._dartPanel.setVisible(!1);this._emitterObject=new RSPanel(0,0,0,0);this._particleEmitter=null;this._textInfo=[];this._infoDart=[];this.layoutScreen(RSGame.getInstance().getAssetPath("DailyChallengeIntroPopup"),2);RSAnalyticsManager.getInstance().trackGUIEvent("daily_challenge","quest_welcome_popup","trigger","")},loadContent:function(){this._super.loadContent.call(this)}, createCustomObject:function(a,b){switch(b.name){case "DailyQuestUnlockBase":this._dailyQuestUnlockBase=RSUtils.createBasicObject(a,b);this.addIntoPreIntroPanel(this._dailyQuestUnlockBase,1);break;case "IconBase":this._dart=RSUtils.createBasicObject(a,b);this._dartPanel.addChild(this._dart);break;case "Arrow":this._arrow=RSUtils.createBasicObject(a,b);this._dartPanel.addChild(this._arrow);break;case "Bg":this._popupBg=RSUtils.createBasicObject(a,b);this.addIntoPreIntroPanel(this._popupBg);break;case "2xWheel":this._2xWheel= RSUtils.createBasicObject(a,b);this.addIntoPreIntroPanel(this._2xWheel);this._2xWheel.setVisible(!1);break;case "Lock":this._lockAnimation=RSUtils.createAnimation(a,b,0.3);this._lockAnimation.stopAnimation();this.addIntoPreIntroPanel(this._lockAnimation,1);break;case "LetsGo":this._letsGoBtn=RSUtils.createButton(a,b);this.addTouchListenerToButton(this._letsGoBtn);this.addIntoPreIntroPanel(this._letsGoBtn);this._letsGoBtn.setVisible(!1);break;case "CloseButton":this._closeBtn=RSUtils.createButton(a, b);this.addIntoPreIntroPanel(this._closeBtn);break;case "Target":this._dartAnimation=RSUtils.createAnimation(a,b,0.3);this._dartAnimation.stopAnimation();this.addIntoPreIntroPanel(this._dartAnimation);break;case "CoinGlow":this._coinGlowAnimation=RSUtils.createAnimation(a,b,0.3),this._coinGlowAnimation.stopAnimation(),this.addIntoPreIntroPanel(this._coinGlowAnimation),this._coinGlowAnimation.setVisible(!1)}var c=null;switch(b.type){case "Text":c=RSUtils.createBasicObject(a,b);this.addIntoPreIntroPanel(c); c.actionZoom(0,1.05,null);c.setVisible(!1);this._textInfo.push(c);break;case "Rect":b.name="Icon1",c=RSUtils.createBasicObject(a,b),this.addIntoPreIntroPanel(c),c.setVisible(!1),this._infoDart.push(c)}this._super.createCustomObject.call(this,a,b)},onObjectCreated:function(a,b,c){this._super.onObjectCreated.call(this,a,b,c)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);this._dartPanel.actionZoom(0,0,null);this._questUnlockPanel.actionZoom(0,0,this.onQuestUnlockPanelScaledDownCOmplete.bind(this)); this.addChild(this._emitterObject);this._emitterObject.setZOrder(-1)},onButtonClicked:function(a){switch(a){case "LetsGo":RSAnalyticsManager.getInstance().trackGUIEvent("daily_challenge","quest_welcome_popup","click","");this.callBack.call(this,1);break;case "CloseButton":this.callBack.call(this,0),RSAnalyticsManager.getInstance().trackGUIEvent("daily_challenge","quest_welcome_popup","close","")}},addIntoPreIntroPanel:function(a,b){b?this._questUnlockPanel.addChild(a):this._questInfoPanel.addChild(a)}, onQuestUnlockPanelScaledDownCOmplete:function(){this._questUnlockPanel.setVisible(!0);this._dartPanel.setVisible(!0);this._questUnlockPanel.actionZoomInOut(0.3,0.8,0.9,2,this.onQuestUnlockPanelScaleUpCOmplete.bind(this));this._dartPanel.actionZoomInOut(0.3,0.4,0.5,2,null);RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("DailyChallengeIntroPopup")+"DQ_AnimePop.mp3",!1);this.loadParticleEffect();RSUtils.callFunctionWithDelay(1,this,this._changeZOrder.bind(this))},onQuestUnlockPanelScaleUpCOmplete:function(){this._lockAnimation.playAnimation(1, 0.3,this._onLockAnimationCompleted.bind(this));RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("DailyChallengeIntroPopup")+"Lock.mp3",!1)},loadParticleEffect:function(){cc.spriteFrameCache.addSpriteFrames("res/PlatformWidgets/DailyChallengesPopup/ParticleEmitter_00-hd.plist");var a=new RSEmitterParticleParams;a._spriteFrames.push("ParticleEmitter_00/ParticleEmitter0.png");a._spriteFrames.push("ParticleEmitter_00/ParticleEmitter1.png");a._spriteFrames.push("ParticleEmitter_00/ParticleEmitter2.png"); a._spriteFrames.push("ParticleEmitter_00/ParticleEmitter3.png");a._spriteFrames.push("ParticleEmitter_00/ParticleEmitter4.png");a._spriteFrames.push("ParticleEmitter_00/ParticleEmitter5.png");a._spriteFrames.push("ParticleEmitter_00/ParticleEmitter6.png");a._spriteFrames.push("ParticleEmitter_00/ParticleEmitter7.png");a._spriteFrames.push("ParticleEmitter_00/ParticleEmitter8.png");a._startDelay=0.2;a._startDelayVariance=0.5;a._deviation=800;a._deviationVariance=150;a._speed=1E3;a._360rotationDuration= 0.5;a._tweenRate=0.5;a._spriteAnimationSpeed=0.4;a._origin=new RSPoint(RSEngine.screenWidth/2,RSEngine.screenHeight/2);a._originVariance=new RSPoint(0,0);a._displacement=new RSPoint(0,0);a._displacementVariance=new RSPoint(RSEngine.screenWidth-500,RSEngine.screenHeight-100);var b=RSGame.getInstance().getGameManager().getCustomizedParticleCount()?RSGame.getInstance().getGameManager().getCustomizedParticleCount():200;this._particleEmitter=new RSCustomAnimationEmitter(a,!1,RSCustomEmitterType.FOUNTAIN, b,this._onParticleEmitterCompleted.bind(this));this._emitterObject.addChild(this._particleEmitter);this._particleEmitter.loadEmitter();this._particleEmitter.startEmitter()},_onParticleEmitterCompleted:function(){this._playDartAnimation()},_changeZOrder:function(){this._emitterObject.setZOrder(2)},_onLockAnimationCompleted:function(){},_playDartAnimation:function(){this._dartPanel.removeChild(this._arrow);this._dartPanel.actionZoom(0.4,4,this._onDartZoomOutComplete.bind(this));RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("DailyChallengeIntroPopup")+ "TargetZoom.mp3",!1)},_onDartZoomOutComplete:function(){this.removeChild(this._questUnlockPanel);this._questInfoPanel.setVisible(!0);var a=this._dartAnimation.getY()-this._dart.getY(),b=this._dartAnimation.getX()-this._dart.getX();this._dartPanel.actionMoveBy(0.5,b/2,a,this._onDartAnimationComplete.bind(this));this._dartPanel.actionZoom(0.5,0.18)},_onDartAnimationComplete:function(){this.removeChild(this._dartPanel);this._playInfoAnimations()},_playInfoAnimations:function(){this._dartAnimation.playAnimation(1, 0.3,this._onInfoTopDartAnimationCompleted.bind(this));RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("DailyChallengeIntroPopup")+"DartHitIntro.mp3",!1)},_onInfoTopDartAnimationCompleted:function(){this._infoDart.length?this._playInfoDartAnimation():this._play2xWheelAnimation()},_playInfoDartAnimation:function(){this._infoDart[0].setVisible(!0);this._infoDart[0].actionZoomInOut(0.3,0.8,1,1,this._playInfoTextAnimation.bind(this));RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("DailyChallengeIntroPopup")+ "DartPopx4.mp3",!1)},_playInfoTextAnimation:function(){this._infoDart.splice(0,1);this._textInfo[0].setVisible(!0);this._textInfo[0].actionZoom(0.25,1,this._onInfoTextAnimationCompleted.bind(this));RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("DailyChallengeIntroPopup")+"TextPopx4.mp3",!1)},_onInfoTextAnimationCompleted:function(){this._textInfo.splice(0,1);RSUtils.callFunctionWithDelay(0.35,this,this._onInfoTopDartAnimationCompleted.bind(this))},_play2xWheelAnimation:function(){this._2xWheel.setVisible(!0); this._coinGlowAnimation.setVisible(!0);this._coinGlowAnimation.playAnimation(-1,0.3,null);RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("DailyChallengeIntroPopup")+"2xAnime.mp3",!1);this._2xWheel.actionZoomInOut(0.3,0.8,1,1,this._playLetsGoBtnAnimation.bind(this));this._coinGlowAnimation.actionZoomInOut(0.3,0.8,1,1,null)},_playLetsGoBtnAnimation:function(){RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("DailyChallengeIntroPopup")+"LetsGo.mp3",!1);this._letsGoBtn.setVisible(!0); this._letsGoBtn.actionZoomInOut(0.3,0.8,1,1,this._onLetsGoBtnAnimationCOmpleted.bind(this))},_onLetsGoBtnAnimationCOmpleted:function(){this.addTouchListenerToButton(this._closeBtn)},unloadContent:function(){this._super.unloadContent.call(this)}});var RSQuestToolTipPopup=RSPopup.extend({_assetFolder:null,_assetList:null,_toolTipCloseTimer:null,_toolTipTimer:null,init:function(a){this._super.init.call(this,a);this._assetList=[{name:RSGame.getInstance().getAssetPath("SideMenuBubblePopup"),count:1}]},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);this._toolTipCloseTimer=RSUtils.callFunctionWithDelay(10,this,this.closePopup.bind(this));this._toolTipTimer=RSUtils.callFunctionWithDelay(0.5,this,this.startToolTipAnim.bind(this))}, loadContent:function(){this.layoutScreen(this._assetList);this._super.loadContent.call(this);SideMenuController.getInstance().setSideMenuVisibility(!0)},onObjectCreated:function(a,b,c){switch(c.name){case "CloseBtn":this._closeButton=a;break;case "Bubble":this._bubbleText=a,this._bubbleText.setScaleY(0),this._bubbleText.setScaleX(0)}},startToolTipAnim:function(){this._toolTipTimer=null;this._bubbleText.actionScale(0.3,1,1)},handleTouchEndAt:function(a,b,c){this.closePopup()},closePopup:function(){this._toolTipTimer= this._toolTipCloseTimer=null;this._super.closePopup.call(this)}});var CustomFontVO=RSVO.extend({id:null,fontName:null,isLocal:null,fontSize:null,fontAlign:null,rotation:null,fontColor:null,textLength:null,placeHolderFontName:null,placeHolderFontColor:null,init:function(a){this.fontName=this.id=0;this.isLocal="";this.placeHolderFontColor=this.placeHolderFontName=this.textLength=this.width=this.fontColor=this.rotation=this.fontAlign=this.fontSize=0;this._super.init.call(this,a)}}),RSPlatformFontAssetManager={createCustomLabel:function(a,b,c){var d=this.getCustomFontVOFromConfig(this.getFontNameForLabelName(b.name)), e=-1;d.width&&(e=b.w*d.width);var f=kTEXT_ALIGNMENT_CENTER;d.fontAlign&&(f=0c&&(c=d),cc.log("Current sequence completed"+g)):console.log("Object not found:::"+g)});cc.log("All sequesnce completed");f&&RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("RSCartPopup")+ e,!1);this._screenObject.scheduleFunctionOnce(this.startAnimationsForNextSequenceGroup.bind(this,this._currentSequenceCounter+1),c/60)},startAnimationsForNextSequenceGroup:function(a){var b=null;ab&&a.setVisible(!1);break;case "hsfo":cc.log("duration::"+d);b=a.getScaleX();a.actionScale(d,b+c,a.getScaleY(),null);break;case "fade":f=a.actionFadeTo.bind(a,d,c.fadeValue,null);break;case "doBlinkAction":f=a.doBlinkAction.bind(a,d,void 0!==c.blinkPerCycle? c.blinkPerCycle:1,void 0!==c.blinkLoopCount?c.blinkLoopCount:1,null);break;case "move":f=a.actionMoveBy.bind(a,d,(void 0!==c.xOffset?c.xOffset:0)*RSEngine.resolutionFactor,(void 0!==c.yOffset?c.yOffset:0)*RSEngine.resolutionFactor,null);break;case "rotate":f=c.count||1;f=a.actionRotateBy.bind(a,d,c.angle||0,f,null);break;case "anchorPoint":f=a.setAnchorPoint.bind(a,c.xAnchor||0.5,c.yAnchor||0.5);break;case "playAnimation":f=a.playAnimation.bind(a,c.loopCount,c.speed,null);break;case "stopAnimation":f= a.stopAnimation.bind(a,null);break;case "an":c?a.playAnimation(1):a.stopAnimation();break;case "visibility":case "v":f=function(){a.setVisible(c)}.bind(this);break;case "a":a.actionFadeTo(0,0,null);break;case "fl":c&&a.flipHorizontally(!0);break;case "playEffect":var g=c.soundFileName,h=c.volume?c.volume:1,k=c.shouldLoop?c.shouldLoop:!1,f=function(){RSEngine.audioManager.playEffectWithVolume(this._resourcePath+g,h,k)}.bind(this);break;case "RollUp":this._delegate.startWinRollup(d,c.rollUpLabelKey, c.rollUpAmountKey);break;case "moveToFro":b=c.minX||0;var m=c.maxX||0,n=c.minY||0,p=c.maxY||0,f=c.count||0,f=a.actionMoveToFro.bind(a,d,b,m,n,p,f,null);break;case "rotateToFro":b=c.maxAngle||0;m=c.minAngle||0;f=c.count||0;f=a.actionRotateToFro.bind(a,d,b,m,f,null);break;case "zoomInOut":b=c.minScale||1;m=c.maxScale||1;f=c.count||0;f=a.actionZoomInOut.bind(a,d,b,m,f,null);break;case "touchState":a.setTouchEnabled(c.state);break;case "x":a.actionMoveBy(d,2*c,0,null);break;case "y":a.actionMoveBy(d, 0,2*c,null)}0e&&(e=b)});return e},_parseAndApplyActionsInit:function(a,b,c){var d=this,e=this._actionDictionary[b],f=0,g=c;Object.keys(e).forEach(function(b){g/=60;b=d.applyActionOnObject(a,b,e[b],g);b>f&&(f=b)})},_parseAndApplyActionsForSequenceObject:function(a,b,c){b=this._actionDictionary[b];var d=c/60,e=null,f=null;b.t&&(e=AnimationSequencerTweener[b.t]); b.v&&a.setVisible(b.v);b.s&&(cc.log("duration::"+c),f=a.getScale(),f+=b.s,e?(f=a.actionScale(d,f,f,null),e(f,d)):a.actionScale(d,f,f,null));b.an&&(f=-1,0==b.aniLoop&&(f=1),a.stopAnimation(),a.playAnimation(f,d,null));b.y&&(a.getY(),e?(f=a.actionMoveBy(d,0,2*b.y,null),e(f,d)):a.actionMoveBy(d,0,2*b.y,null));b.x&&(a.getX(),e?(f=a.actionMoveBy(d,2*b.x,0,null),e(f,d)):a.actionMoveBy(d,2*b.x,0,null));-1==b.a&&a.setOpacity(0);1==b.a&&(a.setOpacity(1),e?(f=a.actionFadeTo(d,255,null),e(f,d)):a.actionFadeTo(d, 255,null));b.hsfo&&(cc.log("duration::"+c),f=a.getScaleX(),f+=b.hsfo,e?(f=a.actionScaleTo(d,f,a.getScaleY(),null),e(f,d)):a.actionScale(d,f,a.getScaleY(),null));b.as&&a.activateAnimation(b.as);b.RollUp&&this._delegate.startWinRollup(c,b.RollUp.rollUpLabelKey,b.RollUp.rollUpAmountKey)},_parseAndApplyActionsForSequence:function(a,b){var c=this,d=0;Object.keys(b).forEach(function(e){d=b[e];c._parseAndApplyActionsForSequenceObject(a,e,d)});return d},_initializeCurrentSequence:function(a,b,c){var d=this; Object.keys(c).forEach(function(a){var f=d._getObjectWithKey(a);a=d._parseAndApplyActions(f,c[a]);a>b&&(b=a)});this._screenObject.scheduleFunctionOnce(this._playSubSequenceWithId.bind(this,a+1),b)},_playSubSequenceWithId:function(a){if(aa&&(a=0);a>this._coinShineArray.length-1&&(a=this._coinShineArray.length-1);this._coinShineArray[a].playAnimation(1,0.5)},_playBackGroundCurrencyAnimation:function(){0!==this._getPrimaryEmitterFrames().length&&this._playCurrencyEmitter(this._getPrimaryEmitterFrames());0!==this._getSecondaryEmitterFrames().length&&this._playCurrencyEmitter(this._getSecondaryEmitterFrames()); 0!==this._getPowerUpEmitterFrames().length&&this._playCurrencyEmitter(this._getPowerUpEmitterFrames());this.scheduleFunctionOnce(this._onBackGroundCoinAnimationStarted.bind(this),1)},_playCurrencyEmitter:function(a){var b=new RSEmitterParticleParams;b._spriteFrames=a;b._spriteAnimationSpeed=0.25;b._spriteAnimationSpeedVariance=0.15;b._origin=new RSPoint(RSEngine.screenWidth/2,RSEngine.screenHeight/2);b._originVariance=new RSPoint(10,10);b._startDelay=1;b._startDelayVariance=0.75;b._displacement=new RSPoint(0, 0);b._displacementVariance=new RSPoint(RSEngine.screenWidth,RSEngine.screenHeight);b._speed=600;b._endScaleVariance=0;b._tweenRate=0.75;b._startScale=0.4;b._scalingDuration=0.3;b._endScale=1;b._360rotationDuration=2;var c=new RSCustomAnimationEmitter(b,!0,RSCustomEmitterType.CLUSTER_MOVEMENT,EMITTER_PARTICLE.BACKGROUND/EMITTER_PARTICLE.PARTICLE_TYPE_COUNT);this.addChild(c);c.loadEmitter();c.setZOrder(-1);c.startEmitter();this.scheduleFunctionOnce(function(){c.stopEmitter()},2)},_getPrimaryEmitterFrames:function(){for(var a= [],b=0;10>b;b++){var c=RSUtils.getTextureData(this._screenName,"PRCAnim/PRCAnim_000"+b+".png");if(c)a.push(c.name);else break}return a},_getSecondaryEmitterFrames:function(){for(var a=[],b=0;10>b;b++){var c=RSUtils.getTextureData(this._screenName,"SCAnim/SCAnim_000"+b+".png");if(c)a.push(c.name);else break}return a},_getPowerUpEmitterFrames:function(){for(var a=[],b=0;10>b;b++){var c=RSUtils.getTextureData(this._screenName,"PowerUpAnim/PowerUpAnim_000"+b+".png");if(c)a.push(c.name);else break}return a}, _playBonusSfx:function(){RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("WelcomeBonusSFX")+"Bonus.mp3",!1)},_playCoinRaiseSfx:function(){RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("WelcomeBonusSFX")+"CoinsRaiseFinal.mp3",!1)},_playCoinRollUpSfx:function(){RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("WelcomeBonusSFX")+"CoinsRollup.mp3",!1)},_playCoinSplashSfx:function(){RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("WelcomeBonusSFX")+ "CoinsSplash.mp3",!1)},_playBackgroundSfx:function(){RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("WelcomeBonusSFX")+"WB_BGM.mp3",!1)},_playWelcomeTextSfx:function(){RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("WelcomeBonusSFX")+"Welcome.mp3",!1)},closeWelcomeScreen:function(){this.closePopup()},unload:function(){this._welcomeTextArray.length=0;this._coinShineArray.length=0;this._super.unload.call(this)}});var MachineOpenPopup=RSPopup.extend({init:function(a,b,c,d,e,f){this._super.init.call(this);RSGame.getInstance().getGameManager().setMachineOpenPopupStatus(!0);RSCasinoManager.getCasinoHUD().disableAllButtons();this._gameType=RSGame.getInstance().getGameManager().getGameType();this._iconType=RSGame.getInstance().getGameManager().getIconType();this._iconType=null==this._iconType?"":this._iconType;this._x=b;this._y=c;this._iconPath=a;this._emitterObject=new RSPanel(0,0,0,0);this._emitterSprites=[]; this._icon=new RSPanel(RSEngine.screenWidth/2,RSEngine.screenHeight/2,RSEngine.screenWidth,RSEngine.screenHeight);RSEventManager.getInstance().addEventListener("on_content_loaded",this,this._onContentLoaded.bind(this));this._contentLoadedCompleted=!1;this._waitForContentResponse=d||!1;this._frameAnimationSpeed=e||0.1;for(var g in f)this[g]=f[g];this._iconLoaded=!1},loadContent:function(){this._super.loadContent.call(this);this.layoutScreen(RSGame.getInstance().getAssetPath("RSMachineOpenPopup"))}, onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);RSGame.getInstance().getGameManager().showOverlayLayer();this._iconLoadTimer=setInterval(this.isImageLoaded.bind(this),500)},flipToPosition:function(){RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("RSMachineOpenPopup")+"DoubleWhip.mp3",!1);this._icon.actionMoveTo(0.6,GameConfig.SCREEN_WIDTH/2,GameConfig.SCREEN_HEIGHT/2);var a=this;this._icon.actionScale(0.25,-0.5,0.5,function(){a._icon.actionScale(0.25,1, 1,function(){a.flowFadeIn()})});this._emitterObject.setZOrder(-1);this.addChild(this._emitterObject)},flowFadeIn:function(){RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("RSMachineOpenPopup")+"BGShineFX.mp3",!1);this._ray.actionFadeIn(0.5);this._ray1.actionFadeIn(0.5,this.startParticleAnimation.bind(this))},startParticleAnimation:function(){this._gameType==RSGameTypes.TableGames?this.closePopup():(this._frameLight&&this._frameLight.playAnimation(-1,this._frameAnimationSpeed), this._ray1.actionRotateTo(2,60,0),this._ray.actionRotateTo(2,-60,0),this.starFireworkEmitter())},onReveal:function(){this._super.onReveal.call(this)},onObjectCreated:function(a,b,c){switch(c.name){case "RayAntiClockwise":this._ray1=a;this._ray1.setOpacity(0);break;case "RayClockwise":this._ray=a;this._ray.setOpacity(0);break;case (c.name.match(/IconFrame/)||{}).input:this.removeChild(a);c.name==="IconFrame"+this._iconType&&(this._iconFrame=a);break;case (c.name.match(/FrameLightAnim/)||{}).input:this.removeChild(a), c.name==="FrameLightAnim"+this._iconType&&(this._frameLight=a,this._frameLight.stopAnimation())}this._super.onObjectCreated.call(this,a,b,c)},createCustomObject:function(a,b){switch(b.name){case "ImageHolder"+this._iconType:this._imageHolder=new RSImageObject;this._imageHolder.setDelegate(this);this._imageHolder.setImageFromUrl(this._iconPath,b.x,b.y,b.w,b.h);break;case "IconHolder"+this._iconType:this._icon=new RSPanel(b.x,b.y,b.w,b.h)}},onImageLoaded:function(){null!=this._iconType&&"0"===this._iconType&& (this._imageHolder.setScaleX(1),this._imageHolder.setScaleY(1));this._iconLoaded=!0},isImageLoaded:function(){this._iconLoaded&&(clearInterval(this._iconLoadTimer),this._iconLoaded=!1,RSGame.getInstance().getGameManager().hideOverlayLayer(),this.addToIconLayer(this._iconFrame),this.addToIconLayer(this._imageHolder),this._frameLight&&this.addToIconLayer(this._frameLight),this._icon.setPosition(this._x,this._y),this._icon.setVisible(!0),this._icon.setScale(0.2),this.addChild(this._icon),this.flipToPosition())}, starFireworkEmitter:function(){var a=RSGame.getInstance().getAssetPath("MachineOpenPopupParticle");cc.spriteFrameCache.addSpriteFrames(a);a=new RSEmitterParticleParams;if(0this._timerCheckCount&&RSLeaderboard.getLeaderBoardEndTime()=parseInt(this._leaderboardBucket.weekly)?this._currentLevelBucket:this._leaderboardBucket.weekly: this._currentLevelBucket},getLeaderboardBucket:function(){return this._leaderboardBucket},_setTop3Rewards:function(){this._top3Rewards={};this._top3Rewards[RSLeaderboardTimeRange.WEEKLY]=[this._weeklyLeaderboardRewards[0]["levelBucket"+this._leaderboardBucket[RSLeaderboardTimeRange.WEEKLY]],this._weeklyLeaderboardRewards[1]["levelBucket"+this._leaderboardBucket[RSLeaderboardTimeRange.WEEKLY]],this._weeklyLeaderboardRewards[2]["levelBucket"+this._leaderboardBucket[RSLeaderboardTimeRange.WEEKLY]],this._weeklyLeaderboardRewards[3]["levelBucket"+ this._leaderboardBucket[RSLeaderboardTimeRange.WEEKLY]]]},getTopRewards:function(){return this._top3Rewards},_checkAndUpdateLevelBucket:function(a){RSLeaderboard.getLevelBucketUpdateStatus()&&(this._setCurrentLevelBucket(),this._leaderboardBucket.weekly=this._currentLevelBucket,RSLeaderboard.resetLevelBucketUpdateStatus(),this._setTop3Rewards());a&&a.weekly&&0==parseInt(a.weekly.coins)&&(this._leaderboardBucket.weekly=this._currentLevelBucket,this._setTop3Rewards());cc.log("here")},getLevelBucketUpdatedStatus:function(){return this._levelBucketUpdated}, unSetLevelBucketUpdatedStatus:function(){this._levelBucketUpdated=!1},showRankUpdationAnimations:function(){cc.log("Show position update animations here....");this.showLeaderboardScreen(!0)},showLeaderboardRewardScreen:function(a,b){RSEngine.externalGameManager&&RSEngine.externalGameManager.hideExternalGame();RSGame.getInstance().getGameManager().setSideMenuVisibility(!1);var c=[{name:RSGame.getInstance().getAssetPath("LeaderboardBg"),count:1},{name:RSGame.getInstance().getAssetPath("RSLeaderboardBadgeAnim"), count:1},{name:RSGame.getInstance().getAssetPath("RSLeaderboardFireworksAnim"),count:1},{name:RSGame.getInstance().getAssetPath("RSLeaderboardRewardScreenFireworks"),count:1},{name:RSGame.getInstance().getAssetPath("RSLeaderboardRewardScreen"),count:2}];this._leaderboardRewardScreen=new RSLeaderboardRewardScreen(c,a,b,this._removeLeaderboardRewardScreen.bind(this));RSEngine.screenManager.addScreen(this._leaderboardRewardScreen)},_removeLeaderboardRewardScreen:function(){cc.log("Removing leaderboard reward screen"); RSEngine.screenManager.removeScreen(this._leaderboardRewardScreen);RSEngine.externalGameManager.showExternalGame();RSGame.getInstance().getGameManager().setSideMenuVisibility(!0);RSRewardManager.onRewardPopupClosed("Leaderboard");this.getLeaderboardTriggerStatus()&&this.showLeaderboardScreen()},onPlacementEvent:function(a){cc.log("ON Platform Event"+a._userData.event+" :FROM: "+a._userData.parameter);if(RSEngine.loginMode!=LOGIN_MODE.GUEST)switch(a._userData.parameter){case RSPlatformEventTypeKeys.ON_BACK_BUTTON_CLICK:this._checkAndUpdateUserLeaderboard(a._userData.value)}}, getName:function(){return"RSLeaderboardManager"},getBackButtonStatus:function(){return this._onBackButtonClicked},_checkAndUpdateUserLeaderboard:function(a){RSLeaderboard.getLeaderboardResetStatus()?this.updateLeaderboardData():RSLeaderboard.getRankUpTriggerStatus()&&"gameplay_screen"==a&&(this._onBackButtonClicked=!0,this.showRankUpScreen())},showRankUpScreen:function(a){a=a?a:!1;RSLeaderboard.resetRankUpTriggerStatus();if(this._rankUpAnimationtriggered)this.showLeaderboardScreen(!0,a);else{this._rankUpAnimationtriggered= !0;RSEngine.externalGameManager&&RSEngine.externalGameManager.hideExternalGame();RSGame.getInstance().getGameManager().setSideMenuVisibility(!1);var b=[{name:RSGame.getInstance().getAssetPath("LeaderboardBg"),count:1},{name:RSGame.getInstance().getAssetPath("RSLeaderboardFireworksAnim"),count:1},{name:RSGame.getInstance().getAssetPath("RSLeaderboardRankUpScreen"),count:1}];this._rankUpScreen=new RSLeaderboardRankUpScreen(b,this._removeRankUpScreen.bind(this,a));RSEngine.screenManager.addScreen(this._rankUpScreen)}}, _removeRankUpScreen:function(a){RSEngine.screenManager.removeScreen(this._rankUpScreen);this.showLeaderboardScreen(!0,a)},getLeaderboardRewardStatus:function(a){3!=this._timerCheckCount&&(this.showPopup=a,this._leaderboardScreen&&this.removeLeaderboardScreen(),this.showPopup&&RSEngine.screenManager.addOverlay(),RSGame.getInstance().getUserDataManager().getLeaderBoardRewardStatus(this._onLeaderboardRewardStatusResponse.bind(this),this.getLeaderboardRewardStatus.bind(this,a)))},_onLeaderboardRewardStatusResponse:function(a){this.showPopup&& RSEngine.screenManager.removeOverlay();if(parseInt(a.result.rank)<=this._rewardLimitsOfLeaderboard[RSLeaderboardTimeRange.WEEKLY]&&0!=parseInt(a.result.rank)){if(this.showPopup)for(property in a.result.newReward)a.result.newReward[property].placement="forceShow";RSRewardManager.updateLeaderboardReward(a.result.newReward,this._onLeaderboardRewardResponseSucces.bind(this))}else if(this.getExpiryPopupTriggerStatus()){var b={},c=this._currentUserRank;a.result.status&&(c=a.result.rank);b.title=RSGame.getInstance().getGameManager().getDefaultCasinoFont("largePink", "bold")?RSGame.getInstance().getGameManager().getDefaultCasinoFont("largePink","bold"):RSGame.getInstance().getGameManager().getDefaultCasinoFont("large","bold");b.text=RSGame.getInstance().getGameManager().getDefaultCasinoFont("largePurple","normal")?RSGame.getInstance().getGameManager().getDefaultCasinoFont("largePurple","normal"):RSGame.getInstance().getGameManager().getDefaultCasinoFont("large","normal");b.amount=RSGame.getInstance().getGameManager().getDefaultCasinoFont("largepurpleStroke","bold")? RSGame.getInstance().getGameManager().getDefaultCasinoFont("largepurpleStroke","bold"):RSGame.getInstance().getGameManager().getDefaultCasinoFont("large","normal");RSEngine.popupManager.addPopup(new RSLeaderboardNofificationPopup(c,10,b,this._onLeaderBoardWinNotificationPopupClosed.bind(this)))}else this.getLeaderboardTriggerStatus()&&this.showLeaderboardScreen();RSEventManager.getInstance().dispatchEvent(RSLeaderboardEvents.LEADERBOARD_REWARD_UPDATED)},_onLeaderboardRewardResponseSucces:function(a){this.showPopup&& RSEventManager.getInstance().dispatchEvent(RSPlatformEventTypeKeys.RSPlatformEvent,{event:RSPlatformEventTypeKeys.ENTER_SCREEN,parameter:"forceShow"})},_onLeaderBoardWinNotificationPopupClosed:function(){this.resetExpiryPopupTriggerStatus();this.showLeaderboardScreen()},updateLeaderboardData:function(a,b){this._leaderboardResetting=!0;RSLeaderboard.setLevelBucketUpdateStatus();this._checkAndUpdateLevelBucket();this._setTop3Rewards();RSLeaderboardManager.getUserLeaderboardData();RSLeaderboard.resetRankUpTriggerStatus(); this.getLeaderboardRewardStatus(a);this._triggerLeaderboardPopup=a;this._showExpiryPopup=b},getLeaderboardResettingStatus:function(){return this._leaderboardResetting},resetLeaderboardResettingStatus:function(){this._leaderboardResetting=!1;this._updateCoinsToLeaderboard()},_updateCoinsToLeaderboard:function(){var a=RSLeaderboard.getDataToBeUpdated();a&&RSLeaderboard.setUserLeaderBoardData(a,!0)},getLeaderboardTriggerStatus:function(){return this._triggerLeaderboardPopup},getExpiryPopupTriggerStatus:function(){return this._showExpiryPopup}, resetExpiryPopupTriggerStatus:function(){this._showExpiryPopup=!1},setFireworkColorCode:function(a){this._colourSet=null==a||void 0==a?{rankupColorCode:[new RSColor(255,0,255,255)],rewardScreenColorCodes:[new RSColor(155,57,238),new RSColor(234,12,230),new RSColor(14,221,221),new RSColor(14,84,234)]}:a},getFireworkColorCode:function(){return this._colourSet},showLeaderboardResponseFailPopup:function(){RSEngine.popupManager.addPopup(new RSLeaderboardResponseFailPopup)}};var RSLeaderboardBgScreen=RSGameScreen.extend({init:function(a,b){this._super.init.call(this);this.callBack=b;this.layoutScreen(a)},onAssetLoaded:function(a){this._super.onAssetLoaded.call(this,a)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this)},onObjectCreated:function(a,b,c){return this._super.onObjectCreated.call(this,a,b,c)},createCustomObject:function(a,b){return this._super.createCustomObject.call(this,a,b)},unloadContent:function(){this._super.unloadContent.call(this)}});var RSLeaderboardScrollBar=RSBarScroller.extend({_jumpToPosition:function(a,b,c){this._super._jumpToPosition.call(this,a,b,!0)}}),RSLeaderboardScreen=RSLeaderboardBgScreen.extend({init:function(a,b,c,d,e){this._super.init.call(this,a);this.callBack=c;this._scrollerPercentToBeMoved=this._eventsCompleted=0;this._showRankUpAnimations=b;this._tournamentEndTime=RSLeaderboard.getLeaderBoardEndTime();this._selectedLeaderboard=RSLeaderboardTimeRange.DAILY;this._rank=RSLeaderboard.getUserRank();this._timerExpired= !1;this._isOpenedOnClick=d?d:!1;this._lobbyName=RSAnalyticsManager.getInstance().getCurrentMachineName();this._playerIndex=0;this._refreshStatus=this._playerAnimPlayed=!1;this._openInfoPopup=e;this._showRankUpAnimations||RSAnalyticsManager.getInstance().trackPlayerAction("leaderboard","click","open_from_"+this._lobbyName,RSLeaderboard.getUserRank(),"");RSEventManager.getInstance().addEventListener(RSLeaderboardEvents.ALL_LEADEBOARD_LOADED,this,this.loadComplete.bind(this));RSEventManager.getInstance().addEventListener(RSLeaderboardEvents.USER_LEADERBOARD_LOADED, this,this.loadComplete.bind(this))},loadContent:function(){this._super.loadContent.call(this)},createCustomObject:function(a,b){var c=0;switch(b.name){case "LeaderboardHolder":this._leaderboardHolder=b;break;case "PlayerItemHolder":this._leaderboarPlayerHolder=b;break;case "LeaderboardScrollArea":this._leaderboardScrollArea=b;break;case "Player1":this._newFontForTopPlayers=RSGame.getInstance().getGameManager().getNewLeaderboardFonts().topPlayers?RSGame.getInstance().getGameManager().getNewLeaderboardFonts().topPlayers: RSGame.getInstance().getGameManager().getDefaultCasinoFont("Semi","Bold");this._nameOfPlayerWithRank1=new RSScaledLabel("",this._newFontForTopPlayers,b,kTEXT_ALIGNMENT_CENTER);this._nameOfPlayerWithRank1.setZOrder(3);this.addChild(this._nameOfPlayerWithRank1);break;case "Player2":this._newFontForTopPlayers=RSGame.getInstance().getGameManager().getNewLeaderboardFonts().topPlayers?RSGame.getInstance().getGameManager().getNewLeaderboardFonts().topPlayers:RSGame.getInstance().getGameManager().getDefaultCasinoFont("Semi", "Bold");this._nameOfPlayerWithRank2=new RSScaledLabel("",this._newFontForTopPlayers,b,kTEXT_ALIGNMENT_CENTER);this._nameOfPlayerWithRank2.setZOrder(3);this.addChild(this._nameOfPlayerWithRank2);break;case "Player3":this._newFontForTopPlayers=RSGame.getInstance().getGameManager().getNewLeaderboardFonts().topPlayers?RSGame.getInstance().getGameManager().getNewLeaderboardFonts().topPlayers:RSGame.getInstance().getGameManager().getDefaultCasinoFont("Semi","Bold");this._nameOfPlayerWithRank3=new RSScaledLabel("", this._newFontForTopPlayers,b,kTEXT_ALIGNMENT_CENTER);this._nameOfPlayerWithRank3.setZOrder(3);this.addChild(this._nameOfPlayerWithRank3);break;case "RewardAmount1":this._rewardOfRank1=new RSScaledLabel("",RSGame.getInstance().getGameManager().getNewLeaderboardFonts().top3RewardFont?RSGame.getInstance().getGameManager().getNewLeaderboardFonts().top3RewardFont:RSGame.getInstance().getGameManager().getDefaultCasinoFont("Semi","Bold"),b,kTEXT_ALIGNMENT_CENTER);this.addChild(this._rewardOfRank1);break; case "RewardAmount2":this._rewardOfRank2=new RSScaledLabel("",RSGame.getInstance().getGameManager().getNewLeaderboardFonts().top3RewardFont?RSGame.getInstance().getGameManager().getNewLeaderboardFonts().top3RewardFont:RSGame.getInstance().getGameManager().getDefaultCasinoFont("Semi","Bold"),b,kTEXT_ALIGNMENT_CENTER);this.addChild(this._rewardOfRank2);break;case "RewardAmount3":this._rewardOfRank3=new RSScaledLabel("",RSGame.getInstance().getGameManager().getNewLeaderboardFonts().top3RewardFont?RSGame.getInstance().getGameManager().getNewLeaderboardFonts().top3RewardFont: RSGame.getInstance().getGameManager().getDefaultCasinoFont("Semi","Bold"),b,kTEXT_ALIGNMENT_CENTER);this.addChild(this._rewardOfRank3);break;case "TournamentEnds":this._timerFont=RSGame.getInstance().getGameManager().getNewLeaderboardFonts().timerFont?RSGame.getInstance().getGameManager().getNewLeaderboardFonts().timerFont:RSGame.getInstance().getGameManager().getHUDCasinoFont("large","bold");this._newtimerAlignment=void 0!=RSGame.getInstance().getGameManager().getNewLeaderboardFonts().timerAlignment|| null!=RSGame.getInstance().getGameManager().getNewLeaderboardFonts().timerAlignment?RSGame.getInstance().getGameManager().getNewLeaderboardFonts().timerAlignment:kTEXT_ALIGNMENT_CENTER;this._tournamentEndsText=new RSScaledLabel("",this._timerFont,b,this._newtimerAlignment);this.addChild(this._tournamentEndsText);break;case "RankAnim1Left":c=b.h/this._badgeAnimData.h;b.name="BadgeAnimLeft";this._rankAnim1Left=RSUtils.createAnimation("LeaderboardBadgeAnim",b,0.3);this._rankAnim1Left.setScale(c);this._rankAnim1Left.setZOrder(1); this.addChild(this._rankAnim1Left);this._rankAnim1Left.stopAnimation();break;case "RankAnim1Right":c=b.h/this._badgeAnimData.h;b.name="BadgeAnimRight";this._rankAnim1Right=RSUtils.createAnimation("LeaderboardBadgeAnim",b,0.3);this._rankAnim1Right.setZOrder(1);this.addChild(this._rankAnim1Right);this._rankAnim1Right.setScaleX(-c);this._rankAnim1Right.setScaleY(c);this._rankAnim1Right.stopAnimation();break;case "RankAnim2Left":c=b.h/this._badgeAnimData.h;b.name="BadgeAnimLeft";this._rankAnim2Left=RSUtils.createAnimation("LeaderboardBadgeAnim", b,0.3);this._rankAnim2Left.setScale(c);this._rankAnim2Left.setZOrder(1);this.addChild(this._rankAnim2Left);this._rankAnim2Left.setScaleX(c);this._rankAnim2Left.stopAnimation();break;case "RankAnim2Right":c=b.h/this._badgeAnimData.h;b.name="BadgeAnimRight";this._rankAnim2Right=RSUtils.createAnimation("LeaderboardBadgeAnim",b,0.3);this._rankAnim2Right.setZOrder(1);this.addChild(this._rankAnim2Right);this._rankAnim2Right.setScaleX(-c);this._rankAnim2Right.setScaleY(c);this._rankAnim2Right.stopAnimation(); break;case "RankAnim3Left":c=b.h/this._badgeAnimData.h;b.name="BadgeAnimLeft";this._rankAnim3Left=RSUtils.createAnimation("LeaderboardBadgeAnim",b,0.3);this._rankAnim3Left.setZOrder(1);this._rankAnim3Left.setScale(c);this.addChild(this._rankAnim3Left);this._rankAnim3Left.stopAnimation();break;case "RankAnim3Right":c=b.h/this._badgeAnimData.h;b.name="BadgeAnimRight";this._rankAnim3Right=RSUtils.createAnimation("LeaderboardBadgeAnim",b,0.3);this._rankAnim3Right.setZOrder(1);this.addChild(this._rankAnim3Right); this._rankAnim3Right.setScaleX(-c);this._rankAnim3Right.setScaleY(c);this._rankAnim3Right.stopAnimation();break;case "RankUpAnimHolder1":this._rankUpAnimHolder1=new RSPoint(b.x,b.y);this._rankUpAnimHolder1Panel=new RSPanel(b.x,b.y,b.w,b.h);this.addChild(this._rankUpAnimHolder1Panel);break;case "RankUpAnimHolder2":this._rankUpAnimHolder2=new RSPoint(b.x,b.y);break;case "RankUpAnimHolder3":this._rankUpAnimHolder3=new RSPoint(b.x,b.y);break;case "ScrollBarArea":this._scrollArea=b;break;case "PostitionPrizes":this._screenBase= new RSPanel(b.x,b.y,b.w,b.h);this.addChild(this._screenBase);this._screenBase.addChild(new RSLeaderboardPayTable(b));break;case "PostitionPrizesV2":this._screenBase=new RSPanel(b.x,b.y,b.w,b.h);this.addChild(this._screenBase);this._screenBase.addChild(new RSLeaderboardPayTableV2(b));break;case "PlayerItemBottomRect":this._playerBottomRect=b}},onObjectCreated:function(a,b,c){switch(c.name){case "RankMask1":this._profilePicMaskAreaOfRank1=c;this._rankMask1=a;this._screenName=b;this._imageHolder1=new RSImageObject; this.addChild(this._imageHolder1);break;case "RankMask2":this._profilePicMaskAreaOfRank2=c;this._rankMask2=a;this._imageHolder2=new RSImageObject;this.addChild(this._imageHolder2);break;case "RankMask3":this._profilePicMaskAreaOfRank3=c;this._rankMask3=a;this._imageHolder3=new RSImageObject;this.addChild(this._imageHolder3);break;case "UpArrow":this._scrollerUpBtn=a;this._scrollerUpBtn.setVisible(!1);break;case "DownArrow":this._scrollerDownBtn=a;this._scrollerDownBtn.setVisible(!1);break;case "MiddleButton":this._scrollerBtn= a;this._scrollerBtn.setVisible(!1);break;case "ScrollBase":this._scrollBase=c;break;case "Daily":this._dailyLeaderboardBtn=a;break;case "Weekly":this._weeklyLeaderboardBtn=a;break;case "Season":this._seasonalLeaderboardBtn=a;break;case "PlayerItemGlowAnimLeft":this._playerItemGlowAnimLeft=a;this._playerItemGlowAnimLeft.stopAnimation();this._playerItemGlowAnimLeft.setVisible(!1);this._playerItemGlowAnimLeft.setZOrder(4);break;case "PlayerItemGlowAnimRight":this._playerItemGlowAnimRight=a;this._playerItemGlowAnimRight.stopAnimation(); this._playerItemGlowAnimRight.setVisible(!1);this._playerItemGlowAnimRight.setScaleX(-1);this._playerItemGlowAnimRight.setZOrder(4);break;case "BadgeAnimLeft":case "BadgeAnimRight":a.stopAnimation();a.setVisible(!1);this._badgeAnimData=c;break;case "RankPosition1":this._rankPosition1=a;this._rankPosition1.setZOrder(1);break;case "RankPosition2":this._rankPosition2=a;this._rankPosition2.setZOrder(1);break;case "RankPosition3":this._rankPosition3=a;this._rankPosition3.setZOrder(1);break;case "RankBase1":this._rankBase1= a;this._rankBase1.setZOrder(2);break;case "RankBase2":this._rankBase2=a;this._rankBase2.setZOrder(2);break;case "RankBase3":this._rankBase3=a;this._rankBase3.setZOrder(2);break;case "Shade":a.setZOrder(3);break;case "BottomRectShade":this._bottomRectShade=a;this._bottomRectShade.setVisible(!1);this._bottomRectShade.setZOrder(3);break;case "Bg":this._bg=a;this._bg.setZOrder(4);break;case "LeaderboardBg":this._leaderboardBg=a;this._leaderboardBg.setZOrder(5);break;case "BottomShade":a.setZOrder(2); break;case "RefreshBtn":a.setZOrder(5);break;case "CloseBtn":a.setZOrder(5);break;case "InfoBtn":a.setZOrder(5);break;case "TopShade":this._topShade=a,this._topShadeData=c,this._topShade.setZOrder(3)}},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);RSEngine.screenManager.addOverlay();RSLeaderboardManager.getAllLeaderBoardData();RSLeaderboardManager.getUserLeaderboardData()},loadComplete:function(){this._eventsCompleted++;2==this._eventsCompleted&&(RSEngine.screenManager.removeOverlay(), this._changeZOrderOfBg(),this._initializeScroller(),RSLeaderboard.getUserRank()&&3>=RSLeaderboard.getUserRank()&&this._showBadgeAnimations(),this._showRankUpAnimations&&(RSLeaderboard.getUserRank(),RSLeaderboard.resetRankUpdateStatus()),this._checkAndCreatePlayerLeaderboardItem(),this._openInfoPopup&&RSEngine.popupManager.addPopup(new RSLeaderboardInfoPopup(RSGame.getInstance().getGameData().getSheetData("leaderboardInfoText"))),RSAnalyticsManager.getInstance().trackPlayerAction("leaderboard","open", "open_from_"+this._lobbyName,RSLeaderboard.getUserRank(),""))},_changeZOrderOfBg:function(){this._bg.setZOrder(-1);this._leaderboardBg.setZOrder(-1)},onButtonClicked:function(a){switch(a){case "CloseBtn":this.callBack&&(RSAnalyticsManager.getInstance().trackPlayerAction("leaderboard","close","open_from_"+this._lobbyName,RSLeaderboard.getUserRank(),""),this.callBack());break;case "Daily":this._updateScroller(RSLeaderboardTimeRange.DAILY);break;case "Weekly":this._updateScroller(RSLeaderboardTimeRange.WEEKLY); break;case "Season":this._updateScroller(RSLeaderboardTimeRange.SEASONAL);break;case "InfoBtn":RSEngine.popupManager.addPopup(new RSLeaderboardInfoPopup(RSGame.getInstance().getGameData().getSheetData("leaderboardInfoText")));RSAnalyticsManager.getInstance().trackPlayerAction("leaderboard_info","click","open_from_leaderboard",this._rank,"");break;case "RefreshBtn":this._refreshStatus=!0,this.callBack&&this.callBack("refresh")}},_showLeaderBoardScreen:function(){},_initializeScroller:function(){this._scroller= new RSLeaderboardScrollBar(new RSRect(this._leaderboardHolder.x,this._leaderboardHolder.y,this._leaderboardHolder.w,this._leaderboardHolder.h),new RSSize(this._leaderboarPlayerHolder.w,this._leaderboarPlayerHolder.h),0,RSScrollerDirection.RSSCROLLER_VERTICAL,1);this.addChild(this._scroller);this._scroller.setButtonScroll(this._scrollerBtn);this._scroller.setScrollBase(this._scrollArea);this._updateScroller(RSLeaderboardTimeRange.WEEKLY);var a=new RSDisplayObject(new RSRect(this._leaderboardHolder.x, this._leaderboardHolder.y,this._leaderboardHolder.w,this._leaderboardHolder.h));this.addChild(a);a.setAnchorPoint(0.5,0.5);this._scroller.setMouseWheelScrollBase(a)},_updateScroller:function(a){this._selectedLeaderboard=a;var b=RSLeaderboardManager.getRewardLimitOf(a);this._setTop3PlayersOfSelectedLeaderboard();a||(a=1);this._scroller&&this._scroller.removeAllChildren();for(var c=0,d=RSLeaderboard.getLeaderboardDataOf(a),e=RSLeaderboard.getUserRank(),f=d.length,g="levelBucket"+RSLeaderboardManager.getLeaderboardBucket().weekly, c=0;c=this._leaderboarPlayerHolder.y?this._currentPlayerItem.setCenter(this._leaderboarPlayerHolder.x,this._leaderboarPlayerHolder.y):this._currentPlayerItem.setVisible(!1), this._bottomRectShade.setVisible(!1)))}else this._currentPlayerItem&&(this._currentPlayerItem.setVisible(!0),this._bottomRectShade.setVisible(!0));this._scroller&&(b=this._scroller.getDisplayObject().getItem(0).getWorldPosition(),b.ya&&!this._timerExpired&&2<=this._eventsCompleted&& (this._timerExpired=!0,RSLeaderboardManager.updateLeaderboardData(!0,!0));return 86400>a?RSUtils.formattedTime(a):~~(a/86400)+1+" Days"},_initializeRankUpAnimations:function(){this._createLeaderboardPlayersDataForScrolling();GlobalVars.musicStatus&&RSEngine.audioManager.muteMusic();RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("RSLeaderboardScreen")+"Scroll.mp3",!1)},_createPlayerLeaderboardBar:function(){var a={},a=RSLeaderboard.getUserCurrentData();null==a&&(a={},a.avatar_id= RSEngine.dataManager.getMe().getAvatar(),a.user_id=RSEngine.dataManager.getMe().getId(),a.first_name=RSEngine.dataManager.getMe().getUserFirstName(),a.coins=RSLeaderboard.getUserWinCoin(),a.rank=parseInt(RSLeaderboard.getUserRank()),a.reward=0);a.fb_id=null;if(RSEngine.loginMode==LOGIN_MODE.WEB_FACEBOOK||RSEngine.loginMode==LOGIN_MODE.FACEBOOK)a.fb_id=RSGame.getInstance().getUserDataManager().getMe().getFBId();this._currentPlayerItem=new RSLeaderboardItem(this._leaderboarPlayerHolder,a);this.addChild(this._currentPlayerItem); this._currentPlayerItem.setZOrder(3);this._currentPlayerItem.setCenter(this._playerBottomRect.x,this._playerBottomRect.y)},_createLeaderboardPlayersDataForScrolling:function(){var a=0,b=null;this._rankUpScroller=new RSBarScroller(new RSRect(this._leaderboardHolder.x,this._leaderboardHolder.y,this._leaderboardHolder.w,6*this._leaderboardHolder.h),new RSSize(this._leaderboarPlayerHolder.w,this._leaderboarPlayerHolder.h),0,RSScrollerDirection.RSSCROLLER_VERTICAL,1);for(a=0;50>a;a++)b=new RSLeaderboardItem(this._leaderboarPlayerHolder, null,!0),this._rankUpScroller.addChild(b);this._rankUpPanel=new RSPanel(this._leaderboardHolder.x,this._leaderboardHolder.y,this._leaderboardHolder.w,this._leaderboardHolder.h);this._rankUpScrollPanel=new RSPanel(this._leaderboardHolder.x-172,this._leaderboardHolder.y+2.3*this._leaderboardHolder.h,this._leaderboardHolder.w,this._leaderboardHolder.h);this._rankUpScrollPanel.addChild(this._rankUpScroller);this.addChild(this._rankUpPanel);this._rankUpPanel.setZOrder(2);this._rankUpPanel.addChild(this._rankUpScrollPanel); this._rankUpPanel.setClippingEnabled(!0)},_startLeaderboardRankUpdateAnimation:function(){this._playerItemGlowAnimRight.setY(this._leaderboarPlayerHolder.y-33);this._playerItemGlowAnimLeft.setY(this._leaderboarPlayerHolder.y-33);this._playerItemGlowAnimLeft.setVisible(!0);this._playerItemGlowAnimRight.setVisible(!0);this._playerItemGlowAnimLeft.playAnimation(1,0.3,this._onGlowAnimCompleted.bind(this));this._playerItemGlowAnimRight.playAnimation(1,0.3);this._playAnticipationAnim()},_playAnticipationAnim:function(){this._scroller.setVisible(!1); this._rankUpScrollPanel.actionMoveBy(2,0,this._rankUpScrollPanel.getY()-7*this._leaderboardHolder.h,this._onAnticipationAnimCompleted.bind(this));this.scheduleFunctionOnce(this._scrollPlayerDataToSecondPosition.bind(this),1)},_onAnticipationAnimCompleted:function(){this._rankUpScroller.removeAllChildren();this._rankUpPanel.setVisible(!1);GlobalVars.musicStatus&&RSEngine.audioManager.unMuteMusic()},_onGlowAnimCompleted:function(){this._scroller.setVisible(!0);this._playerItemGlowAnimLeft.setVisible(!1); this._playerItemGlowAnimRight.setVisible(!1)},_scrollPlayerDataToSecondPosition:function(){},_startPlayingPlayerRollUpAnimations:function(){this._currentPlayerItem.rollUpPlayerData(RSLeaderboard.getUserCurrentData())},_showBadgeAnimations:function(){RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("RSLeaderboardScreen")+"Top.mp3",!1);switch(RSLeaderboard.getUserRank()){case 1:this._rankAnim1Right.playAnimation(1,0.3,this._onBadgeAnimationCompleted.bind(this));this._rankAnim1Left.playAnimation(1, 0.3);break;case 2:this._rankAnim2Left.playAnimation(1,0.3,this._onBadgeAnimationCompleted.bind(this));this._rankAnim2Right.playAnimation(1,0.3);break;case 3:this._rankAnim3Left.playAnimation(1,0.3,this._onBadgeAnimationCompleted.bind(this)),this._rankAnim3Right.playAnimation(1,0.3)}},_onBadgeAnimationCompleted:function(){this._rankAnim1Right.setVisible(!1);this._rankAnim1Left.setVisible(!1);this._rankAnim2Left.setVisible(!1);this._rankAnim2Right.setVisible(!1);this._rankAnim3Left.setVisible(!1);this._rankAnim3Right.setVisible(!1)}, _startPlayingRankUpParticleAnimation:function(){var a=null;switch(RSLeaderboard.getUserRank()){case 1:a=this._rankUpAnimHolder1;break;case 2:a=this._rankUpAnimHolder2;break;case 3:a=this._rankUpAnimHolder3}var b=RSGame.getInstance().getAssetPath("MachineOpenPopupParticle");cc.spriteFrameCache.addSpriteFrames(b);b=new RSEmitterParticleParams;b._spriteFrames.push("StarEmitter_00/StarEmitter_0000.png");b._startDelay=0.2;b._startDelayVariance=0.5;b._deviation=60;b._deviationVariance=50;b._speed=50;b._360rotationDuration= 0.5;b._tweenRate=0.5;b._spriteAnimationSpeed=0.4;b._origin=a;b._originVariance=new RSPoint(100,100);b._displacement=new RSPoint(0,0);b._displacementVariance=new RSPoint(50,50);b._fadeOutDuration=0.1;b._fadeOutDurationVariance=0.8;b._fadeInDuration=0.8;b._startScale=0.8;b._startScaleVariance=0.2;b._endScale=0;b._endScaleVariance=0.2;this._particleEmitter=new RSCustomAnimationEmitter(b,!0,RSCustomEmitterType.CLUSTER_MOVEMENT,20,null);this._rankUpAnimHolder1Panel.addChild(this._particleEmitter);this._particleEmitter.loadEmitter(); this._particleEmitter.startEmitter();this._particleEmitter.setZOrder(1)},unloadContent:function(){this._scroller&&this._scroller.removeAllChildren();RSEventManager.getInstance().removeEventListenersIn(this);this._isOpenedOnClick||!RSLeaderboardManager.getBackButtonStatus()||this._refreshStatus||RSEventManager.getInstance().dispatchEvent("onUserRankUp");this._super.unloadContent.call(this);GlobalVars.musicStatus&&RSEngine.audioManager.unMuteMusic()}});var RSLeaderboardItem=RSDisplayObject.extend({_rank:0,_imageUrl:"",_name:"",_value:0,_gameType:"",_cellType:"",_enableBlurBg:!1,_winAmountValue:0,_rewardAmountValue:0,_rank:0,_disableVisibility:!1,init:function(a,b,c,d){a=new RSRect(0,0,a.w,a.h);this._playerData=b;c&&(this._enableBlurBg=c);d&&(this._disableVisibility=d);this._super.init.call(this,a);this._newLeaderboardCustomisedFont=RSGame.getInstance().getGameManager().getNewLeaderboardFonts();this._newFontForPlayerName=this._newLeaderboardCustomisedFont.playerNameFont? this._newLeaderboardCustomisedFont.playerNameFont:RSGame.getInstance().getGameManager().getDefaultCasinoFont("large","normal");this.loadContent()},loadContent:function(){this.loadLayout(RSGame.getInstance().getAssetPath("LeaderboardItem"))},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);this._enableBlurBg||this._setProfileImage();this._playerData.user_id==RSEngine.dataManager.getMe().getId()||this._playerData.id==RSEngine.dataManager.getMe().getId()?this._playerItemGlowAnim.playAnimation(2, 0.5,this._onGlowAnimationCompleted.bind(this)):this._disableVisibility&&this.setVisible(!1)},createCustomObject:function(a,b){switch(b.name){case "Rank":var c="--";!this._enableBlurBg&&this._playerData&&this._playerData.rank&&(c=this._playerData.rank,-1==c&&(c="--"));this._playerRank=new RSScaledLabel(c,this._newLeaderboardCustomisedFont.playerCellRankFont?this._newLeaderboardCustomisedFont.playerCellRankFont:RSGame.getInstance().getGameManager().getDefaultCasinoFont("Semi","Bold"),b,kTEXT_ALIGNMENT_CENTER); this.addChild(this._playerRank);break;case "PlayerName":c="";!this._enableBlurBg&&this._playerData&&this._playerData.first_name?c=this._getFormattedName(this._playerData.first_name):!this._enableBlurBg&&this._playerData&&this._playerData.user_id&&(c=RSGame.getInstance().getGameManager().getUpdatedUserForDisplay(this._playerData.user_id));!this._enableBlurBg&&this._playerData&&this._playerData.name?c=this._getFormattedName(this._playerData.name):!this._enableBlurBg&&this._playerData&&this._playerData.id&& (c=RSGame.getInstance().getGameManager().getUpdatedUserForDisplay(this._playerData.id));9=this._playerData.rank&&-1!=this._playerData.rank?this._trophyAnim.setFrame(this._playerData.rank-1):this._trophyAnim.setVisible(!1);break;case "Tag":this._tagAnim=a,this._tagAnim.stopAnimation(),-1==this._playerData.rank?this._tagAnim.setVisible(!1):this._playerData&&this._playerData.rank&&3>=this._playerData.rank? this._tagAnim.setFrame(this._playerData.rank-1):this._playerData&&this._playerData.rank&&10>=this._playerData.rank?this._tagAnim.setFrame(3):this._tagAnim.setVisible(!1)}},_setProfileImage:function(){if(this._playerData.isTournament&&1==this._playerData.isTournament){var a=new RSImageObject;if(this._playerData.user_id==RSEngine.dataManager.getMe().getId()||this._playerData.id==RSEngine.dataManager.getMe().getId())b=RSGame.getInstance().getUserDataManager().getMe().getImageUrl(),b.includes("guestplayer.png")? this._profileImageBase.setVisible(!0):(this._profileImageBase.setVisible(!1),a.setImageFromUrl(b,this._profilePicMask.x,this._profilePicMask.y,this._profilePicMask.w,this._profilePicMask.h));else if(!GameConfig.IS_EDIT_FIELDS_ENABLED||0==RSEngine.dataManager.getMe().getAvatar()||this._playerData.imageURL.includes("graph.facebook.com")||""==this._playerData.imageURL||"1180"==this._playerData.imageURL||1E3this._localCoins[RSLeaderboardTimeRange.WEEKLY]&&(this._localCoins[RSLeaderboardTimeRange.WEEKLY]=a,b=RSLeaderboardTimeRange.WEEKLY);"CUMMULATIVE_WIN"==GameConfig.WIN_TYPE&&(b=RSLeaderboardTimeRange.WEEKLY);return b},setUserLeaderBoardData:function(a,b){if(RSEngine.loginMode!=LOGIN_MODE.GUEST&&0!=a)if(b&&(this._coinsToBeUpdated=0),this.getLeaderboardResetStatus()&&!b)this._coinsToBeUpdated=a,RSLeaderboardManager.updateLeaderboardData(); else{var c=this.checkLeaderBoard(a);if(null!=c){this._updateUserData=!0;var d=RSLeaderboardManager.getLeaderboardBucket()[c];RSGame.getInstance().getUserDataManager().setLeaderBoard(a,c,d,this._onLeaderboardSetResponse.bind(this))}}},_onLeaderboardSetResponse:function(a,b){if(b)RSPlatformSDKManager.getInstance().setUserAttributeLeaderboardRank(parseInt(a));else{(this._updatedRank=parseInt(a))&&RSPlatformSDKManager.getInstance().setUserAttributeLeaderboardRank(this._updatedRank);if(this._updatedRank< this.getUserRank()||0==this.getUserRank())this._showRankUpScreen=!0;RSEventManager.getInstance().dispatchEvent(RSLeaderboardEvents.LEADERBOARD_UPDATED,null)}},_setTopOfLeaderboardPlayers:function(){this._topOfLeaderboardPlayers={daily:[],weekly:[],seasonal:[]};this._weekly.length&&this._addTop3PlayersOf("weekly",this._weekly)},_addTop3PlayersOf:function(a,b){for(var c=0,c=0;3>c;c++)b[c]?this._topOfLeaderboardPlayers[a].push(b[c]):""},getDailyLeaderboardData:function(){return this._daily},getWeeklyLeaderboardData:function(){return this._weekly}, getSeasonalLeaderboardData:function(){return this._seasonal},getUserDailyLeaderboardData:function(){},getUserWeeklyLeaderboardData:function(){},getUserSeasonalLeaderboardData:function(){},getLeaderboardDataOf:function(a){var b=null;switch(a){case RSLeaderboardTimeRange.WEEKLY:b=this._weekly}return b},getTop3PlayersOfLeaderboard:function(a){return this._topOfLeaderboardPlayers[a]},_checkUserRankUpdationStatus:function(){if(Object.keys(this._userDataOld).length){if((this._userDataOld.weekly.userRank> this._localCoins[RSLeaderboardTimeRange.WEEKLY+"_Rank"]||0==this._userDataOld.weekly.userRank&&0=a?RSLeaderboardManager.getRewardForLeaderboard(RSLeaderboardTimeRange.WEEKLY,b,a+1):0;return c}return null},getOldWeeklyData:function(){return this._oldWeeklyData}, _getUserRank:function(){return this._userDataOld&&this._userDataOld.weekly?this._userDataOld.weekly.userRank:"0"},getLeaderboardResetStatus:function(){var a=TimeManager.getInstance().getCurrentServerTime()+7;return this._leaderboardResetTimethis._fireWorkArray.length?(this._fireworksAnimLeft.setVisible(!0),this._fireworksAnimLeft.playAnimation(-1,0.8),this._fireworksAnimRight.setVisible(!0),this._fireworksAnimRight.playAnimation(-1,0.8)):this._showFireworkAnim();this.scheduleFunctionOnce(this._playRewardAmountTweening.bind(this),0.5)},_showFireworkAnim:function(){0!=this._fireWorkArray.length&&0!=this._colourSet.rewardScreenColorCodes.length&&4>this._count&&(this._fireworksAnimRight.setPosition(this._fireWorkArray[this._count].x,this._fireWorkArray[this._count].y), this._fireworksAnimRight.setColor(this._colourSet.rewardScreenColorCodes[this._count]),this._fireworksAnimRight.setVisible(!0),this._count+=1,this._fireworksAnimRight.playAnimation(1,0.8,this._onFireWorkAnimCompleted.bind(this)))},_onFireWorkAnimCompleted:function(){this._showFireworkAnim()},_moveCoinStackFromBottom:function(){this._coinStackPanel.actionMoveTo(0.5,RSEngine.screenWidth/2,RSEngine.screenHeight/2)},_onTitleScaleUpComplete:function(){},_playParticleAnimation:function(){var a=new RSEmitterParticleParams; a._spriteFrames.push("LeaderboardRewardScreen_00/Particle1.png");a._startDelay=0.2;a._startDelayVariance=0.5;a._deviation=500;a._deviationVariance=150;a._speed=50;a._360rotationDuration=0.5;a._tweenRate=0.5;a._spriteAnimationSpeed=0.4;a._origin=new RSPoint(RSEngine.screenWidth/2,RSEngine.screenHeight/2);a._originVariance=new RSPoint(200,200);a._displacement=new RSPoint(0,0);a._displacementVariance=new RSPoint(100,100);a._fadeOutDuration=0.1;a._fadeOutDurationVariance=0.8;a._fadeInDuration=0.8;a._startScale= 0.8;a._startScaleVariance=0.2;a._endScale=0;a._endScaleVariance=0.2;this._particleEmitter=new RSCustomAnimationEmitter(a,!0,RSCustomEmitterType.CLUSTER_MOVEMENT,100,null);this.addChild(this._particleEmitter);this._particleEmitter.loadEmitter();this._particleEmitter.startEmitter();this._particleEmitter.setZOrder(-1)},_playRewardAmountTweening:function(){this._coinIcon.setVisible(!0);this._nameBase.setVisible(!0);this._rewardAmount.setVisible(!0);this._playerName.setVisible(!0);this.startActionTweenForKey("HUDRollUp", 2,0,this._reward)},actionOnUpdate:function(a,b){this._winDisplay=Math.floor(b);this._rewardAmount.setString(RSUtils.formatNumberWithComma(this._winDisplay))},actionOnComplete:function(){this.stopWinRollUp()},stopWinRollUp:function(){this.stopActionTweenForKey("HUDRollUp");this._rewardAmount.setString(RSUtils.formatNumberWithComma(this._winDisplay))},_onRewardAnimationsCompleted:function(){this._counter++;2==this._counter&&this._callBack&&this._callBack()},_claimLeaderboardReward:function(){RSGame.getInstance().getUserDataManager().claimRewardFromRewardManager(this._rewardId, this._onRewardClaimed.bind(this))},_onRewardClaimed:function(a){if("Tournamania"!=this._rewardType){var b=parseInt((TimeManager.getInstance().getCurrentServerTime()-this._rewardData.startTime)/86400)+1;RSAnalyticsManager.getInstance().trackGUIEvent("leaderboard","win","collect",this._rewardData.rank,"day"+b);a.result&&a.result.status&&200==a.result.status&&(RSCasinoManager.addPrimaryCurrencyForDisplay("Leaderboard_Reward",parseInt(this._reward)),RSAnalyticsManager.getInstance().trackPrimarySource(RSAnalyticsSource.free, "leaderboard_win",this._reward,this._rewardData.rank,"day"+b))}else"Tournamania"==this._rewardType&&a.result&&a.result.status&&200==a.result.status&&(RSCasinoManager.addPrimaryCurrencyForDisplay("Tournament_Reward",parseInt(this._reward)),RSAnalyticsManager.getInstance().trackPrimarySource(RSAnalyticsSource.free,"tournamania_win_rank"+this._rewardData.rank,this._reward,this._rewardData.machineId,this._rewardData.tournamentid));this._onRewardAnimationsCompleted()},unloadContent:function(){this._particleEmitter= null;this._super.unloadContent.call(this);GlobalVars.musicStatus&&RSEngine.audioManager.unMuteMusic()}});var RSLeaderboardRankUpScreen=RSLeaderboardBgScreen.extend({init:function(a,b){this._callBack=b;this._rankUpPanel=new RSPanel(RSEngine.screenWidth/2,-RSEngine.screenHeight/2,RSEngine.screenWidth,RSEngine.screenHeight);this._colourSet=RSLeaderboardManager.getFireworkColorCode();this._super.init.call(this,a);this._particleEmitter=null},loadContent:function(){this._super.loadContent.call(this)},createCustomObject:function(a,b){var c=null;switch(b.name){case "RankUpAnim":this._rankUpAnim=RSUtils.createAnimation(a, b,0.3);this._rankUpAnim.stopAnimation();this._rankUpPanel.addChild(this._rankUpAnim);break;case "Badge":c=RSUtils.createBasicObject(a,b);this._rankUpPanel.addChild(c);break;case "RankUp":this._rankUp=RSUtils.createBasicObject(a,b);this._rankUpPanel.addChild(this._rankUp);break;case "Arrow":this._arrowLeftBottom=RSUtils.createBasicObject(a,b);this._rankUpPanel.addChild(this._arrowLeftBottom);break;case "ArrowLeftMiddle":b.name="Arrow";this._arrowLeftMiddle=RSUtils.createBasicObject(a,b);this._rankUpPanel.addChild(this._arrowLeftMiddle); break;case "ArrowLeftTop":b.name="Arrow";this._arrowLeftTop=RSUtils.createBasicObject(a,b);this._rankUpPanel.addChild(this._arrowLeftTop);break;case "ArrowRightBottom":b.name="Arrow";this._arrowRightBottom=RSUtils.createBasicObject(a,b);this._rankUpPanel.addChild(this._arrowRightBottom);break;case "ArrowRightMiddle":b.name="Arrow";this._arrowRightMiddle=RSUtils.createBasicObject(a,b);this._rankUpPanel.addChild(this._arrowRightMiddle);break;case "ArrowRightTop":b.name="Arrow";this._arrowRightTop=RSUtils.createBasicObject(a, b);this._rankUpPanel.addChild(this._arrowRightTop);break;case "RankUpStar":this._rankUpStar=RSUtils.createBasicObject(a,b),this.addChild(this._rankUpStar),this._rankUpStar.setVisible(!1),this._rankUpStar.setZOrder(2),this._rankUpStar.setScale(1.5)}},onObjectCreated:function(a,b,c){switch(c.name){case "Bg":a.setZOrder(-1);break;case "FireworksAnimLeft":this._fireWorkAnim=a,this._fireWorkAnim.setScale(2),this._fireWorkAnim.setColor(this._colourSet.rankupColorCode[0]),this._fireWorkAnim.stopAnimation(), this._fireWorkAnim.setVisible(!1)}},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);RSAnalyticsManager.getInstance().trackGUIEvent("leaderboard","rankup_popup","open_from_"+RSAnalyticsManager.getInstance().getCurrentMachineName(),RSLeaderboard.getUpdatedRank().toString(),RSLeaderboard._getUserRank().toString());this.addChild(this._rankUpPanel);this.scheduleFunctionOnce(this._tweenUpRankUpPanel.bind(this),0.5);this.scheduleFunctionOnce(this._onAllAnimCompletion.bind(this),5); this._startArrowAnimations()},onButtonClicked:function(a){switch(a){case "CloseBtn":this._callBack&&this._callBack()}},_tweenUpRankUpPanel:function(){var a=this._rankUpPanel.actionMoveTo(0.5,RSEngine.screenWidth/2,RSEngine.screenHeight/2,this._onRankUpPanelTweenCompleted.bind(this));RSTweener.easeBounceOut(a);GlobalVars.musicStatus&&RSEngine.audioManager.muteMusic();RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("RSLeaderboardRankUpScreen")+"RankUp.mp3",!1)},_onRankUpPanelTweenCompleted:function(){this._rankUpAnim.playAnimation(1, 0.5,this._onRankUpAnimationCompleted.bind(this));this._rankUp.actionZoomInOut(0.4,0.9,1,4);this._rankUpAnim.actionZoomInOut(0.4,0.9,1,4);this._fireWorkAnim.setVisible(!0);this._fireWorkAnim.playAnimation(1,0.6)},_onRankUpAnimationCompleted:function(){this._rankUpStar.setVisible(!0);this._rankUpStar.actionZoom(0.6,0.8,this._onRankUpStarAnimationCompleted.bind(this));var a=this._rankUpStar.actionRotateBy(0.6,180,1);RSTweener.easeCircleActionOut(a);this._playBottomParticleAnimation();this._playMiddleParticleAnimation(); this._playTopParticleAnimation()},_onRankUpStarAnimationCompleted:function(){this._rankUpStar.setVisible(!1);var a=this._rankUpPanel.actionMoveTo(0.5,RSEngine.screenWidth/2,1.5*RSEngine.screenHeight,this._rankUpPanelRemoved.bind(this));RSTweener.easeBackIn(a);this.scheduleFunctionOnce(this._moveParticleAnimationsUpwards.bind(this),0.25)},_rankUpPanelRemoved:function(){},_playBottomParticleAnimation:function(){var a=new RSEmitterParticleParams;a._spriteFrames.push("LeaderboardRankUpScreen_00/ParticleGlow2.png"); a._startDelay=0.2;a._startDelayVariance=0.5;a._deviation=70;a._deviationVariance=50;a._speed=100;a._360rotationDuration=0.5;a._tweenRate=0.5;a._spriteAnimationSpeed=0.4;a._origin=new RSPoint(RSEngine.screenWidth/2,RSEngine.screenHeight/3-100);a._originVariance=new RSPoint(30,100);a._displacement=new RSPoint(0,0);a._displacementVariance=new RSPoint(40,50);a._fadeOutDuration=0.1;a._fadeOutDurationVariance=0.8;a._fadeInDuration=0.8;a._startScale=0.5;a._startScaleVariance=0.2;a._endScale=0;a._endScaleVariance= 0.2;this._particleEmitter=new RSCustomAnimationEmitter(a,!1,RSCustomEmitterType.FOUNTAIN,150,null);this.addChild(this._particleEmitter);this._particleEmitter.loadEmitter();this._particleEmitter.startEmitter();this._particleEmitter.setZOrder(-1)},_playMiddleParticleAnimation:function(){var a=new RSEmitterParticleParams;a._spriteFrames.push("LeaderboardRankUpScreen_00/ParticleGlow1.png");a._startDelay=0.2;a._startDelayVariance=0.5;a._deviation=30;a._deviationVariance=30;a._speed=100;a._360rotationDuration= 0.5;a._tweenRate=0.5;a._spriteAnimationSpeed=0.4;a._origin=new RSPoint(RSEngine.screenWidth/2,RSEngine.screenHeight/2-100);a._originVariance=new RSPoint(20,100);a._displacement=new RSPoint(0,0);a._displacementVariance=new RSPoint(20,30);a._fadeOutDuration=0.1;a._fadeOutDurationVariance=0.8;a._fadeInDuration=0.8;a._startScale=0.5;a._startScaleVariance=0.2;a._endScale=0;a._endScaleVariance=0.2;this._particleEmitter2=new RSCustomAnimationEmitter(a,!1,RSCustomEmitterType.FOUNTAIN,100,null);this.addChild(this._particleEmitter2); this._particleEmitter2.loadEmitter();this._particleEmitter2.startEmitter();this._particleEmitter2.setZOrder(-1)},_playTopParticleAnimation:function(){var a=new RSEmitterParticleParams;a._spriteFrames.push("LeaderboardRankUpScreen_00/ParticleStar.png");a._spriteFrames.push("LeaderboardRankUpScreen_00/ParticleGlow1.png");a._startDelay=0.2;a._startDelayVariance=0.5;a._deviation=200;a._deviationVariance=30;a._speed=300;a._360rotationDuration=0.1;a._tweenRate=0.5;a._spriteAnimationSpeed=0.4;a._origin= new RSPoint(RSEngine.screenWidth/2,RSEngine.screenHeight/3-100);a._originVariance=new RSPoint(15,150);a._displacement=new RSPoint(0,50);a._displacementVariance=new RSPoint(20,50);a._fadeOutDuration=0.1;a._fadeOutDurationVariance=0.8;a._fadeInDuration=0.8;a._startScale=0.4;a._startScaleVariance=0.1;a._endScale=0;a._endScaleVariance=0.2;this._particleEmitter3=new RSCustomAnimationEmitter(a,!1,RSCustomEmitterType.FOUNTAIN,50,null);this.addChild(this._particleEmitter3);this._particleEmitter3.loadEmitter(); this._particleEmitter3.startEmitter();this._particleEmitter3.setZOrder(-1)},_moveParticleAnimationsUpwards:function(){this._particleEmitter2.actionMoveTo(1,this._particleEmitter2.getX(),RSEngine.screenHeight/2-200,null);this._particleEmitter3.actionMoveTo(0.8,this._particleEmitter3.getX(),RSEngine.screenHeight/2+250,null)},_startArrowAnimations:function(){this._arrowLeftBottom.actionFadeIn(0.3);this._arrowRightBottom.actionFadeIn(0.3,this._onTopArrowFadeInCompleted.bind(this))},_onTopArrowFadeInCompleted:function(){this._arrowLeftBottom.actionFadeOut(0.3, this._onBorromArrowFadeOutCompleted.bind(this));this._arrowRightBottom.actionFadeOut(0.3);this._arrowLeftMiddle.actionFadeIn(0.3);this._arrowRightMiddle.actionFadeIn(0.3,this._onMiddleArrowFadeInComplete.bind(this))},_onBorromArrowFadeOutCompleted:function(){},_onMiddleArrowFadeInComplete:function(){this._arrowLeftMiddle.actionFadeOut(0.3);this._arrowRightMiddle.actionFadeOut(0.3,this._onTOpArrowFadeInCompleted.bind(this));this._arrowLeftTop.actionFadeIn(0.3);this._arrowRightTop.actionFadeIn(0.3)}, _onTOpArrowFadeInCompleted:function(){this._arrowLeftTop.actionFadeOut(0.3);this._arrowRightTop.actionFadeOut(0.3,this._startArrowAnimations.bind(this))},_onAllAnimCompletion:function(){this._particleEmitter&&this._particleEmitter.stopEmitter();this._particleEmitter2&&this._particleEmitter2.stopEmitter();this._particleEmitter3&&this._particleEmitter3.stopEmitter();this._callBack&&this._callBack()},unloadContent:function(){this._particleEmitter=null;this._super.unloadContent.call(this);GlobalVars.musicStatus&& RSEngine.audioManager.unMuteMusic()}});var RSLeaderboardNofificationPopup=RSGenericPopup.extend({init:function(a,b,c,d){this._assetList=[{name:RSGame.getInstance().getAssetPath("RSLeaderboardNotifyPopup"),count:1}];var e=new RSRect(0,0,0,0);this._diplayPanel=new RSDisplayObject(e);this._userRank=parseInt(a);this._rankLimit=b;a=RSGame.getInstance().getGameManager().getNewLeaderboardFonts();this._isEmptyObj(a)?this._fontList=c:this._fontList=a;this._super.init.call(this,d);RSAnalyticsManager.getInstance().trackGUIEvent("leaderboard","tournament_end_popup", "open_from_"+RSAnalyticsManager.getInstance().getCurrentMachineName(),this._userRank.toString())},loadContent:function(){this.layoutScreen(this._assetList);this._super.loadContent.call(this)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);this.addChild(this._diplayPanel)},onObjectCreated:function(a,b,c){this._super.onObjectCreated.call(this,a,b,c);switch(c.name){case "CloseBtn":this._closeButton=a}switch(c.type){case "CP_Button_T1":this._awesomeBtn=a}},createCustomObject:function(a, b){switch(b.name){case "LeaderboardNotifyPopupTitle1":var c=RSGame.getInstance().getGameData().getPopupTextWithKey(b.name),c=new RSLabelBMFont(c,this._fontList.title,2*b.w,kTEXT_ALIGNMENT_CENTER);"MS"==GameConfig.GAME_ID&&c.setScale(0.8);this.addChild(c);c.setCenter(b.x,b.y);(this._userRank>this._rankLimit||0==this._userRank)&&c.setVisible(!1);break;case "LeaderboardNotifyPopupTitle2":c=RSGame.getInstance().getGameData().getPopupTextWithKey(b.name);c=new RSLabelBMFont(c,this._fontList.title,2*b.w, kTEXT_ALIGNMENT_CENTER);c.setScale(0.8);"MS"==GameConfig.GAME_ID?c.setScale(0.85):"MSP"==GameConfig.GAME_ID&&c.setScale(0.6);this.addChild(c);c.setCenter(b.x,b.y);this._userRank<=this._rankLimit&&0!=this._userRank&&c.setVisible(!1);break;case "LeaderboardNotifyPopupSubTitle1":c=RSGame.getInstance().getGameData().getPopupTextWithKey(b.name);switch(this._userRank){case 1:c=c.replace("{value}",this._userRank.toString()+"st");break;case 2:c=c.replace("{value}",this._userRank.toString()+"nd");break;case 3:c= c.replace("{value}",this._userRank.toString()+"rd");break;default:c=c.replace("{value}",this._userRank.toString()+"th")}var d=new RSLabelBMFont("",this._fontList.text,2*b.w,kTEXT_ALIGNMENT_CENTER);"UP"==GameConfig.GAME_ID||"MS"==GameConfig.GAME_ID||"BBVP"==GameConfig.GAME_ID||"MPVP"==GameConfig.GAME_ID||"MSP"==GameConfig.GAME_ID?d.setScale(0.7):d.setScale(0.5);d.setString(c);this.addChild(d);d.setCenter(b.x,b.y);(this._userRank>this._rankLimit||0==this._userRank)&&d.setVisible(!1);break;case "LeaderboardNotifyPopupSubTitle2":c= RSGame.getInstance().getGameData().getPopupTextWithKey(b.name);c=c.replace(/\\n/g,"\n");c=c.replace(/\\'/g,"'");d=new RSLabelBMFont("",this._fontList.text,2*b.w,kTEXT_ALIGNMENT_CENTER);"BBC"==GameConfig.GAME_ID||"MS"==GameConfig.GAME_ID?d.setScale(0.64):d.setScale(0.7);d.setString(c);this.addChild(d);d.setCenter(b.x,b.y);this._userRank<=this._rankLimit&&0!=this._userRank&&d.setVisible(!1);break;case "LeaderboardRewardValue":c=RSGame.getInstance().getGameData().getPopupTextWithKey(b.name),d=new RSLabelBMFont("", this._fontList.amount,2*b.w,kTEXT_ALIGNMENT_CENTER),d.setScale(1),d.setString(c),this.addChild(d),d.setCenter(b.x,b.y)}return this._super.createCustomObject.call(this,a,b)},onButtonClicked:function(a){switch(a){case "CloseBtn":this._closeButton.setTouchEnabled(!1);this.closePopup("close");break;case "CP_Button_T1":this.closePopup()}},closePopup:function(a){this._super.closePopup.call(this)},_isEmptyObj:function(a){for(var b in a)if(a.hasOwnProperty(b))return!1;return!0}});var RSLeaderboardResponseFailPopup=RSGenericPopup.extend({init:function(a){this._super.init.call(this,a);this._assetList=[{name:RSGame.getInstance().getAssetPath("LeaderboardResponseFailPopup"),count:1}];RSPlatformFontAssetManager.loadFontConfigFile(RSGame.getInstance().getAssetFolder("LeaderboardResponseFailPopupFontConfig"),"LeaderboardResponseFailPopupFontConfig.json")},loadContent:function(){this.layoutScreen(this._assetList);this._super.loadContent.call(this)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this)}, createCustomObject:function(a,b){switch(b.name){case "LeaderboardResponseFailMessage":var c=RSGame.getInstance().getGameData().getPopupTextWithKey(b.name),c=c.replace(/\\n/g,"\n"),c=RSPlatformFontAssetManager.createCustomLabel(c+"\n",b);this.addChild(c);c.setCenter(b.x,b.y)}return this._super.createCustomObject.call(this,a,b)},onButtonClicked:function(a){switch(a){case "CloseBtn":this.closePopup()}}});var RSRewardManager={rewardDataList:{},_currentPlacementData:"",_currentPlacementName:"",_currentRewardId:"",initializeRewardManager:function(){this.getUserRewardData();this._parseUserRewardData();RSEventManager.getInstance().removeEventListenersIn(this);RSEventManager.getInstance().addEventListener(RSPlatformEventTypeKeys.RSPlatformEvent,this,this.onPlacementEvent.bind(this))},getName:function(){return"RSRewardManager"},getUserRewardData:function(){this._userRewards=RSGame.getInstance().getUserDataManager().getMe().getRewards()}, _parseUserRewardData:function(){var a,b={},c=TimeManager.getInstance().getCurrentServerTime();this.rewardDataList={};for(a in this._userRewards)b=new RSRewardVO(this._userRewards[a],a),parseInt(b.expiryTime)>=c||0==parseInt(b.expiryTime)?(this.rewardDataList.hasOwnProperty(b.placement)||(this.rewardDataList[b.placement]=[]),this.rewardDataList[b.placement].push(b)):this.deleteExpiredReward(a)},onPlacementEvent:function(a){cc.log("ON Platform Event"+a._userData.event+" :FROM: "+a._userData.parameter); RSEngine.loginMode!=LOGIN_MODE.GUEST&&(this._currentPlacementName=a._userData.parameter,this._checkForRewards())},updateEmailReward:function(a,b,c){var d={};this._callBack=b;this._callBackFail=c;d.type="EmailConnect";d.blobData={};d.blobData.email=a[0];d.blobData.lastName=a[1];d.blobData.firstName=a[2];RSGame.getInstance().getUserDataManager().updateReward(d,this.onEmailRewardSuccess.bind(this,d),this.onEmailRewardFail.bind(this))},onEmailRewardSuccess:function(a,b){this.onUpdateRewardSuccess(a,b.result.data.rewardData.newReward)}, updateLeaderboardReward:function(a,b){this._callBack=b;this.onUpdateRewardSuccess("leaderboard_reward",a)},onUpdateRewardSuccess:function(a,b){var c,d=b;for(c in d)if(d=new RSRewardVO(d[c],c),this.rewardDataList.hasOwnProperty(d.placement))this.rewardDataList[d.placement].push(d);else{var e=!1;if(this.rewardDataList.hasOwnProperty("MainLobby_Launch")){var f=0,g=this.rewardDataList.MainLobby_Launch;for(f in g)g[f].id==d.id&&(e=!0)}e||(this.rewardDataList[d.placement]=[],this.rewardDataList[d.placement].push(d))}this._callBack(a)}, onEmailRewardFail:function(){this._callBackFail()},claimReward:function(){},_checkForRewards:function(){if(this.rewardDataList.hasOwnProperty(this._currentPlacementName)){var a=this.rewardDataList[this._currentPlacementName];if(a.length)switch(this._currentRewardId=a[0].id,a[0].type){case "Popup":RSGame.getInstance().getGameManager().loadPopupWithData(a[0])}}},isRewardActive:function(a){return this.rewardDataList.hasOwnProperty(a)&&this.rewardDataList[a].length?!0:!1},onRewardPopupClosed:function(a){var b= 0,c=0;if(this.rewardDataList.hasOwnProperty(this._currentPlacementName))for(c=this.rewardDataList[this._currentPlacementName].length,b=0;bf?RSSocialManager.getInstance().deleteRequest(b.data[m].id,this._onDeleteRequestCompleted.bind(this)):k?this._collectArray.push(b.data[m]):RSSocialManager.getInstance().deleteRequest(b.data[m].id,this._onDeleteRequestCompleted.bind(this))}}this._onMyAppRequestReceived=!0;this._callGiftingRequestsCompleted()}},_onSendRequestCompleted:function(a,b,e){if(!b){b=RSEngine.dataManager.getMe().getRequestUserList();for(e=0;ef&&a.splice(f,a.length-f);0!=a.length&&(this._multicurrency&&this._giftBoxRandomRewarding(),b=new RSGiftingAppRequest,b.TITLE=this._giftingData[0].sTitle,f=RSSocialManager.getInstance().getFBFirstName()?RSSocialManager.getInstance().getFBFirstName():RSEngine.dataManager.getMe().getUserFirstName(),b.MESSAGE=this._giftingData[this._currencyType].cMessage.replace("{name}",f),b.TARGETS=a,b.GIFT_TYPE.value= this._giftingData[this._currencyType].value,b.GIFT_TYPE.name=this._giftingData[this._currencyType].name,b.GIFT_TYPE.extra=this._giftingData[this._currencyType].extra,b.GIFT_TYPE.type=this._giftingData[this._currencyType].type,this._sendGiftCallback=e,RSSocialManager.getInstance().sendFbGift(b.TITLE,b.MESSAGE,b.TARGETS,b.GIFT_TYPE,this._onSendGiftCompleted.bind(this,b.TARGETS,b.GIFT_TYPE.type,b.GIFT_TYPE.value)),1==a.length&&RSAnalyticsManager.getInstance().trackPlayerAction("giftcenter","send_"+this._giftingData[this._currencyType].type, "send",this._giftingData[this._currencyType].value,1))},_giftBoxRandomRewarding:function(){for(var a=Math.floor(100*Math.random()+2),b=0,e=this._giftingData.length-1;0<=e;e--)if(b+=parseInt(this._giftingData[e].probability),b>=a){this._currencyType=e;break}},_onSendGiftCompleted:function(a,b,e,f,g){this._pushNotificationSendFailCount=0;if(f)void 0!=this._sendGiftCallback&&null!=this._sendGiftCallback&&(this._sendGiftCallback(!1),this._sendGiftCallback=null);else{g=this._giftSendList[b]?this._giftSendList[b]: {users:{}};var h=null,k=a.length;if(g)for(var m=0;m=this._pushNotificationSendFailCount&&(this._pushNotificationSendFailCount++,RSGame.getInstance().getUserDataManager().sendGiftCenterPushNotification("giftingNotifierLp",a,this._onGiftCenterPushNotificationSendingSucces.bind(this),this._onGiftCenterPushNotificationSendingFail.bind(this,a)))},getPrefixAddedUserId:function(a,b){for(var e=0,f=a.length,e=0;e=this.getGiftingGameData().giftSendLimit&&(this.sendGiftStatus=!1);RSEngine.dataManager.getMe().getRequestUserList().length>=this.getGiftingGameData().giftRequestLimit&&(this.requestStatus=!1);this._totalInviteCount>=this.getGiftingGameData().giftInviteLimit&&(this.inviteStatus=!1);for(var b=0;bRSEngine.dataManager.getMe().getRequestUserList().length?RSEngine.dataManager.getMe().getSentUserList():RSEngine.dataManager.getMe().getRequestUserList();this._giftableUsers=RSUtils.cloneJSON(RSSocialManager.getInstance().myPlayingFriends);this._requestableUsers=RSUtils.cloneJSON(RSSocialManager.getInstance().myPlayingFriends); 0==this._invitableUsers.length&&(this._invitableUsers=RSUtils.cloneJSON(RSSocialManager.getInstance().myNonPlayingFriends));for(var a=this._giftSendList[this._giftingData[0].type],b=null,e=null,f=RSSocialManager.getInstance().myPlayingFriends.length-1;0<=f;f--)if(a)for(e in b=a.users,b){var g=b[e];this._giftableUsers[f]&&this._giftableUsers[f].id==e&&(parseInt(g),parseInt(this._giftingData[0].sCoolDownTime),TimeManager.getInstance().getCurrentServerTime())}},collectBotGift:function(a,b){this._botCollectCompleteCallback= a;RSEngine.dataManager.collectBotGift(this._onBotCollectCompleted.bind(this),this._onBotCollectFailed.bind(this,a,b))},collectGift:function(a,b){this._collectCompleteCallback=b;for(var e=0,f=null,g={},h=0;hthis._retryCount?(this._retryCount++,null==b?this.collectGift(a,this._collectCompleteCallback):this.collectAllGift(a,this._collectCompleteCallback,b)):this._retryCount=0},_onRewardLIstGIftClaimed:function(){RSEventManager.getInstance().dispatchEvent(RSGiftingEvents.GIFTCLAIMED)},deleteData:function(a, b){switch(b){case GiftType.invite:for(var e=0;ek){for(var m=e=h=0;m=this.getCurrentDayStartTime()&&(a=parseInt(a)-parseInt(this._giftClaimList[b].count),0>a)?0:a},getRemainigGiftSendCountOfDay:function(){for(var a=this.getGiftingGameData()[0].sLimit,b=0;b=this.getCurrentDayStartTime()&&(a=parseInt(a)-parseInt(this._giftSendList[e].count),0>a))return 0}return a},getGiftClaimList:function(){var a=null;this._claimList=[];this.claimAll=[];this._playerIdList=[];this._rewardListGifts=[];var b=RSGiftingManager.getInstance().getGiftData("EmailConnect"),e=RSGiftingManager.getInstance().getGiftData("EmailVerify"),f=RSGiftingManager.getInstance().getGiftData("MClubConnect");this.emailVerificationEnabledStatus=RSGiftingManager.getInstance().isEmailRewardClaimed(); this.emailClaim=RSGiftingManager.getInstance().isEmailRewardClaimed();this.mclubClaim=RSGame.getInstance().getGameManager().getClubMUpdateStatus();var g={},h=RSGiftingManager.getInstance().getGiftcenterDataToBeListed(),k=h.length,m={};RSEngine.loginMode==LOGIN_MODE.EMAIL&&(a=RSGiftingManager.getInstance().getGiftData("FBConnect"));if(GameConfig.POLLFISH_ENABLED){var g=RSPollFishManager.getSurveyEnabledStatus(),n=RSGame.getInstance().getPlatformEventManager().getEventDataForParameter(RSPlatformEventTypeKeys.EARN_COINS_SURVEY, RSPLATFORM_SURVEY_PLACEMENTS.GIFT_WATCH);if(g&&n){var p=(g==RSGame.getInstance().getPlatformEventManager().getRewardedSurveyCapCount()?RSGiftingManager.getInstance().getGiftData("SurveyReward"):RSGiftingManager.getInstance().getGiftData("RecursiveSurveyReward")).message,g={};g.message=p;g.coins=n["0"].triggerAction.rewards.coin;this._multicurrency&&(g.energy=b.energy);g.id=n["0"].triggerAction.action;g.analyticsId=n["0"].triggerAction.analyticsName;g.giftType=n["0"].triggerAction.action;g.claim=this.emailClaim; g.enableButton=!0;g.redirect=!1;this._claimList.push(g)}}null!=e&&GameConfig.SSO_ENABLED&&RSSSOManager.getEmailVerificationStatusInGifting()&&(g={},n=e.message,n=n.replace(/\\n/g,"\n"),g.message=n,g.coins=e.coins,this._multicurrency&&(g.energy=e.energy),g.id=e.id,g.analyticsId=e.analyticsId,g.giftType=e.placement,g.claim=!1,g.enableButton=!0,g.redirect=!0,this._claimList.push(g));a&&(g={},n=a.message,n=n.replace(/\\n/g,"\n"),g.message=n,g.coins=a.coins,this._multicurrency&&(g.energy=a.energy),g.id= a.id,g.analyticsId=a.analyticsId,g.giftType=a.placement,g.claim=!1,g.enableButton=!0,g.redirect=!0,this._claimList.push(g));for(a=0;a/g,"\n"),g.coins=h[a].custom.coins,this._multicurrency&&(g.energy=h[a].custom.energy),g.id=h[a].id,g.giftType=h[a].placement,g.analyticsId=h[a].custom.analyticsId,g.enableButton=!0,g.redirect=!1,"email_gift_reward"==h[a].custom.analyticsId&&(g.claim=!0),"email_verification_gift_reward"== h[a].custom.analyticsId&&(g.claim=!0),this._claimList.push(g),"host_gift_reward"==g.analyticsId&&this._rewardListGifts.push(g);!1==this.emailClaim&&null!=b&&(g={},n=b.message,n=n.replace(/\\n/g,"\n"),g.message=n,g.coins=b.coins,this._multicurrency&&(g.energy=b.energy),g.id=b.id,g.analyticsId=b.analyticsId,g.giftType=b.placement,g.claim=this.emailClaim,g.enableButton=!0,g.redirect=!0,this._claimList.push(g));f&&!this.mclubClaim&&GameConfig.IS_PLAYER_CONNECT_AVAILABLE&&(g={},g.message=f.message,g.coins= f.coins,g.id=f.id,g.giftType=f.placement,g.analyticsId=f.analyticsId,g.claim=this.mclubClaim,g.enableButton=!0,g.redirect=!0,this._claimList.push(g));b=RSGiftingManager.getInstance()._collectArray;for(f=0;f=this.getCurrentDayStartTime()?!1:!0},updateGiftShareCount:function(){this._giftSendList.share&&this._giftSendList.share.time?(this._giftSendList.share.time=TimeManager.getInstance().getCurrentServerTime(), this._giftSendList.share.count=1):this._giftSendList.share={time:TimeManager.getInstance().getCurrentServerTime(),count:1}},getGiftClaimCount:function(){this._claimList=RSGiftingManager.getInstance().getGiftClaimList().claimList;for(var a=this._claimList.length,b=!1,e=0;ethis._data.coins&&(this._reward=new RSScaledLabel(RSUtils.formatNumberWithComma(parseInt(this._data.energy)), c,b,kTEXT_ALIGNMENT_LEFT));this.addChild(this._reward);this._reward.setVisible(this._rewardValueVisibility);break;case "RewardIcon":this._imageHolder=new RSImageObject;this._imageHolder.setImageFromUrl(this._imagePath,b.x,b.y,b.w,b.h);this.addChild(this._imageHolder);break;case "HostIcon":this._hostIcon=RSUtils.createBasicObject(a,b);this.addChild(this._hostIcon);this._hostIcon.setVisible(!1);break;case "FBConnect":this._fbConnect=RSUtils.createBasicObject(a,b);this.addChild(this._fbConnect);this._fbConnect.setVisible(!1); break;case "DefaultProfile":this._profileobj=b;this._screenName=a;this._profile=RSUtils.createBasicObject(a,b);this.addChild(this._profile);this._profile.setVisible(!1);break;case "EmailConnect":this._emailConnect=RSUtils.createBasicObject(a,b);this.addChild(this._emailConnect);this._emailConnect.setVisible(!1);break;case "InviteFriend":this._inviteFriend=RSUtils.createBasicObject(a,b);this.addChild(this._inviteFriend);this._inviteFriend.setVisible(!1);break;case "ProfileBoader":this._borderHolder= RSUtils.createBasicObject(a,b);this.addChild(this._borderHolder);this._borderHolder.setZOrder(1);this._borderHolder.setVisible(!0);break;case "WatchAd":this._watchAd=RSUtils.createBasicObject(a,b);this.addChild(this._watchAd);this._watchAd.setVisible(!1);break;case "SentTag":this._sendTag=RSUtils.createBasicObject(a,b);this.addChild(this._sendTag);this._sendTag.setVisible(!1);break;case "ClaimedTag":this._claimTag=RSUtils.createBasicObject(a,b);this.addChild(this._claimTag);this._claimTag.setVisible(!1); break;case "MClub":this._mClub=RSUtils.createBasicObject(a,b);this.addChild(this._mClub);this._mClub.setVisible(!1);this._mClub.setZOrder(1);break;case "TakeSurvey":this._surveyIcon=RSUtils.createBasicObject(a,b),this.addChild(this._surveyIcon),this._surveyIcon.setVisible(!1)}return this._super.createCustomObject.call(this,a,b)},onButtonClicked:function(a){switch(a){case "ClaimBtn":this._claimbtn.setTouchEnabled(!1);"fbGift"==this._data.giftType?("powerup"!=JSON.parse(this._data.type).type&&RSAnalyticsManager.getInstance().trackPlayerAction("giftcenter", "collect_"+JSON.parse(this._data.type).type,"collect",this._data.coins,"1"),RSGiftingManager.getInstance().collectGift(this._data.id,this._onGiftCollected.bind(this))):("G2PReward"==this._data.id?RSGiftingManager.getInstance().getMultiCurrencySupport()?this._data.energy>this._data.coins?RSAnalyticsManager.getInstance().trackPlayerAction("giftcenter","collect_energy","collect",this._data.energy,"1"):RSAnalyticsManager.getInstance().trackPlayerAction("giftcenter","collect_coins","collect",this._data.coins, "1"):RSAnalyticsManager.getInstance().trackPlayerAction("giftcenter","collect_coins","collect",this._data.coins,"1"):"email_gift_reward"==this._data.analyticsId?RSAnalyticsManager.getInstance().trackPlayerAction("email_connect","collect","open_from_giftcenter","",""):"survey"==this._data.id&&RSEventManager.getInstance().dispatchEvent(RSPlatformEventTypeKeys.RSPlatformEvent,{event:RSPlatformEventTypeKeys.EARN_COINS_SURVEY,parameter:RSPLATFORM_SURVEY_PLACEMENTS.GIFT_WATCH}),"survey"!=this._data.id&& RSGiftingManager.getInstance().collectRewardFromRewardManager(this._data.id,this._data.giftType,this._onGiftCollected.bind(this)));break;case "SendBtn":if("InviteShare"==this._data.id){RSEngine.screenManager.addOverlay();RSActionShareManager.getInstance().initiateShare({ogType:"gift_center"},this.onSharingToFBSuccess.bind(this));break}RSGiftingManager.getInstance().sendFbGift([this._data.id],this._data.type,this._onGiftSendCompleted.bind(this));break;case "EnterBtn":this._enterbtn.setTouchEnabled(!1); "MClubConnect"==this._data.id?RSGiftingManager.getInstance().connectToClubM(this._data.coins):"EmailVerify"==this._data.id?RSGiftingManager.getInstance().verifyEmailAndCollectReward():(RSAnalyticsManager.getInstance().trackPlayerAction("email_connect","click","open_from_giftcenter","",""),RSGiftingManager.getInstance().connectToEmailReward(this._onEmailConnectCompleted.bind(this)));break;case "VerifyBtn":"EmailVerify"==this._data.id&&RSGiftingManager.getInstance().verifyEmailAndCollectReward();break; case "ConnectBtn":RSGiftingManager.getInstance().connectToFb()}},_onGiftCollected:function(a){if(this._data.coins||this._data.energy){RSGiftingManager.getInstance().getMultiCurrencySupport()||RSCasinoManager.addPrimaryCurrencyForDisplay("gift_reward",parseInt(this._data.coins));this._claimbtn.setTouchEnabled(!1);if("email_gift_reward"==this._data.analyticsId)RSGiftingManager.getInstance().getMultiCurrencySupport()?(RSCasinoManager.addPrimaryCurrencyForDisplay("gift_reward",parseInt(this._data.energy)), RSAnalyticsManager.getInstance().trackPrimarySource(RSAnalyticsSource.free,this._data.analyticsId,this._data.energy,"")):RSAnalyticsManager.getInstance().trackPrimarySource(RSAnalyticsSource.free,this._data.analyticsId,this._data.coins,"");else if(RSGiftingManager.getInstance().getMultiCurrencySupport()){var b="";void 0==this._data.type?this._data.energy>this._data.coins?(b="energy",this._data.coins=this._data.energy):b="coins":b=JSON.parse(this._data.type).type;switch(b){case "coins":RSCasinoManager.addSecondaryCurrencyForDisplay("gift_reward", parseInt(this._data.coins));RSAnalyticsManager.getInstance().trackInHouseEvent(RSEventCategory.ECONOMY,"free_source_coins","gift_collect_reward",this._data.coins,"","");break;case "energy":RSCasinoManager.addPrimaryCurrencyForDisplay("gift_reward",parseInt(this._data.coins));RSAnalyticsManager.getInstance().trackPrimarySource(RSAnalyticsSource.free,"gift_collect_reward",this._data.coins,"");break;case "powerup":if(a.result.UserBlob&&a.result.UserBlob.powerUps_&&a.result.userOffset&&a.result.userOffset.powerUpsOffset)for(var c in a.result.userOffset.powerUpsOffset){RSEngine.dataManager.getMe().setPowerUps(a.result.UserBlob.powerUps_); RSCasinoManager._HUD.updatePowerUps(RSEngine.dataManager.getMe().getTotalPowerUpCount());a=RSGiftingManager.getInstance().getPowerupAnalytics(a.result.userOffset.powerUpsOffset);RSAnalyticsManager.getInstance().trackPlayerAction("giftcenter","collect_powerups","collect",a,"1");RSAnalyticsManager.getInstance().trackInHouseEvent(RSEventCategory.ECONOMY,"free_source_powerups","gift_collect_reward",a,"","");break}}}else RSAnalyticsManager.getInstance().trackPrimarySource(RSAnalyticsSource.free,"gift_collect_reward", this._data.coins,"");RSEventManager.getInstance().dispatchEvent(RSGiftingEvents.GIFTCLAIMED);this.onClaimClicked(b)}},onClaimClicked:function(a){var b=new RSRect(0,0,0,0);this._diplayPanel=new RSDisplayObject(b);this.addChild(this._diplayPanel);b=this.convertToWorldSpace(this._claimbtn.getX(),this._claimbtn.getY());RSGiftingUtils.coinLayer.setZOrder(2);RSCasinoManager.getCasinoHUD().playCoinReceivedAnimation(b,RSGiftingUtils.coinLayer,this._onClaimBonusCollectCompleted.bind(this),a)},onClaimAllClicked:function(){this._claimbtn.setTouchEnabled(!1)}, _onClaimBonusCollectCompleted:function(){this._claimbtn.setVisible(!1);this._claimTag.setTouchEnabled(!1);this._claimTag.setVisible(!0)},_onEmailConnectCompleted:function(){},_onGiftSendCompleted:function(a,b){a&&(this._sendbtn.setVisible(!1),this._sendTag.setTouchEnabled(!1),this._sendTag.setVisible(!0))},setImage:function(){if(void 0!=this._data.imageUrl){var a=new RSImageObject;this._profile.setVisible(!0);a.setImageFromUrl(this._data.imageUrl,this._profileobj.x,this._profileobj.y,this._profileobj.w, this._profileobj.h);a&&(this._mask=RSUtils.createBasicObject(this._screenName,this._profileobj),this._mask.setZOrder(-1),this.mask=new RSClippingNode(this._mask),this.mask.setAlphaThreshold(250),this.mask.addChild(a),this.addChild(this.mask))}else"email_gift_reward"==this._data.analyticsId?this._emailConnect&&this._emailConnect.setVisible(!0):"mclub_gift_reward"==this._data.analyticsId?this._mClub&&this._mClub.setVisible(!0):"survey"==this._data.id?this._surveyIcon&&(this._surveyIcon.setVisible(!0), this._surveyIcon.setZOrder(1)):"EmailVerify"==this._data.id||"email_verification_gift_reward"==this._data.analyticsId?this._emailConnect&&this._emailConnect.setVisible(!0):"FBConnect"==this._data.id?(this._fbConnect&&this._fbConnect.setVisible(!0),this._rewardBorder&&(this._rewardBorder.setVisible(!1),this._reward.setVisible(!1),this._imageHolder.setVisible(!1))):this._hostIcon.setVisible(!0)},onSharingToFBSuccess:function(a){RSEngine.screenManager.removeOverlay();a&&(this._onGiftSendCompleted(!0), RSGiftingManager.getInstance().updateGiftShareCount(),RSEventManager.getInstance().dispatchEvent(RSGiftingEvents.GIFTSEND))}});var RSGiftCenter=RSGenericPopup.extend({init:function(a){this._rectpanel=null;this._count=0;this._layout=[{name:RSGame.getInstance().getAssetPath("RSGiftingCenterPopup"),count:1}];this._super.init.call(this,a)},loadContent:function(){this.layoutScreen(this._layout);this._super.loadContent.call(this)},onObjectCreated:function(a,b,c){switch(c.type){case "bo":this._mainBg=a;break;case "Button":this._closebtn=a}this._super.onObjectCreated.call(this,a,b,c)},createCustomObject:function(a,b){switch(b.type){case "Rect":this._customrect= b;break;case "Loading":var c=RSUtils.createAnimation(a,b,1);this._loading=c;this.addChild(c);this._loading.setVisible(!1);break;case "CustomWidget":this._rectpanel=new RSPanel(b.x,b.y,b.w,b.h);this.addChild(this._rectpanel);break;case "STypeA":this._tile=b;break;case "ScrollBar":switch(b.name){case "ScrollBarArea":this._scrollarea=b}}return this._super.createCustomObject.call(this,a,b)},onButtonClicked:function(a){switch(a){case "CloseBtn":RSAnalyticsManager.getInstance().trackPlayerAction("giftcenter", "close","","",""),this.closePopup()}},onReveal:function(){},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);this._loading&&(this._loading.setVisible(!0),this._loading.actionRotateBy(0,2,-1));RSEngine.loginMode==LOGIN_MODE.FACEBOOK||RSEngine.loginMode==LOGIN_MODE.WEB_FACEBOOK?RSGame.getInstance().getGameManager().giftingFbPermissionPromptPopupEnabledStatus()?RSGiftingManager.getInstance().getAppRequests(this._onGiftDataLoaded.bind(this)):RSSocialManager.getInstance().hasPermission("user_friends")? RSGiftingManager.getInstance().getAppRequests(this._onGiftDataLoaded.bind(this)):RSGiftingManager.getInstance().getFbPermissionTriggerStatus()?this._addGiftClaimScreen(!0):RSSocialManager.getInstance().showPermissionDialog("user_friends",this._onRequestComplete.bind(this)):this._addGiftClaimScreen(!0);RSGiftingUtils.coinLayer=new RSDisplayObject(new RSRect(0,0,0,0));this.addChild(RSGiftingUtils.coinLayer)},_onRequestComplete:function(a,b,c){RSGiftingManager.getInstance().setFbPermissionTriggerStatus(); if(b)this._onGiftDataLoaded(!0);else for(b=b=0;b=b&&this._scrollDisable.setVisible(!0):(this._scrollDisable.setVisible(!1), this._scrollBase.setVisible(!1),this._invite.setVisible(!0),this._claimAllBtn.setTouchEnabled(!1));for(a=0;athis._claimList[a].coins?this.giftData[1].iconAsset:this.giftData[0].iconAsset; else switch(JSON.parse(this._claimList[a].type).type){case "coins":this._imagePath=this.giftData[0].iconAsset;break;case "energy":this._imagePath=this.giftData[1].iconAsset;break;case "powerup":this._imagePath=this.giftData[2].iconAsset}},_onGiftCollected:function(a,b,c,d,e){this._playerIdList=RSGiftingManager.getInstance().getGiftClaimList().playerIdList;var f=new RSRect(0,0,0,0);this._diplayPanel=new RSDisplayObject(f);this.addChild(this._diplayPanel);f=this.convertToWorldSpace(this._claimAllBtn.getX(), this._claimAllBtn.getY());RSGiftingUtils.coinLayer.setZOrder(2);RSCasinoManager.getCasinoHUD().playCoinReceivedAnimation(f,RSGiftingUtils.coinLayer,this._onCoinFlyAnimCompleted.bind(this,e));if(RSGiftingManager.getInstance().getMultiCurrencySupport())for(g in b)switch(g){case "coins":if(b.extraCoins||b.coins)RSCasinoManager.addSecondaryCurrencyForDisplay("gift_reward",parseInt(b.extraCoins+b.coins)),RSAnalyticsManager.getInstance().trackPlayerAction("giftcenter","collect_coins","collect_all",parseInt(b.extraCoins+ b.coins),b.coinCount),RSAnalyticsManager.getInstance().trackInHouseEvent(RSEventCategory.ECONOMY,"free_source_coins","gift_collect_all_reward",parseInt(b.extraCoins+b.coins),"",""),RSCasinoManager.getCasinoHUD().playCoinReceivedAnimation(f,RSGiftingUtils.coinLayer,this._onCoinFlyAnimCompleted.bind(this),"coins");break;case "energy":if(b.extraEnergy||b.energy)RSCasinoManager.addPrimaryCurrencyForDisplay("gift_reward",parseInt(b.extraEnergy+parseInt(b.energy))),RSAnalyticsManager.getInstance().trackPlayerAction("giftcenter", "collect_energy","collect_all",parseInt(b.extraEnergy+b.energy),b.energyCount),RSAnalyticsManager.getInstance().trackPrimarySource(RSAnalyticsSource.free,"gift_collect_all_reward",parseInt(b.extraEnergy+b.energy),""),RSCasinoManager.getCasinoHUD().playCoinReceivedAnimation(f,RSGiftingUtils.coinLayer,this._onCoinFlyAnimCompleted.bind(this),"energy");break;case "powerup":if(RSCasinoManager.getCasinoHUD().playCoinReceivedAnimation(f,RSGiftingUtils.coinLayer,this._onCoinFlyAnimCompleted.bind(this),"powerup"), a.result.UserBlob&&a.result.UserBlob.powerUps_&&a.result.userOffset&&a.result.userOffset.powerUpsOffset)for(var g in a.result.userOffset.powerUpsOffset){RSEngine.dataManager.getMe().setPowerUps(a.result.UserBlob.powerUps_);RSCasinoManager._HUD.updatePowerUps(RSEngine.dataManager.getMe().getTotalPowerUpCount());c=RSGiftingManager.getInstance().getPowerupAnalytics(a.result.userOffset.powerUpsOffset);RSAnalyticsManager.getInstance().trackPlayerAction("giftcenter","collect_powerups","collect_all",c,b.powerupCount); RSAnalyticsManager.getInstance().trackInHouseEvent(RSEventCategory.ECONOMY,"free_source_powerups","gift_collect_all_reward",c,"","");break}}else RSCasinoManager.addPrimaryCurrencyForDisplay("gift_reward",parseInt(b)),RSAnalyticsManager.getInstance().trackPlayerAction("giftcenter","collect_coins","collect_all",b,c),RSAnalyticsManager.getInstance().trackPrimarySource(RSAnalyticsSource.free,"gift_collect_all_reward",b,""),d&&(this._scroller&&this._scroller.removeAllChildren(),this.displayCells(),this.handleClaimAllBtnVisibility())}, _onCoinFlyAnimCompleted:function(a){if(a)for(var b=0;b=a?this._claimAllBtn.setTouchEnabled(!1):c==b?this._claimAllBtn.setTouchEnabled(!1):0==c&&this._claimAllBtn.setTouchEnabled(!1)},_onRewardLIstGIftClaimed:function(a){RSAnalyticsManager.getInstance().trackPlayerAction("giftcenter","collect","collect_all",a.coins,1);"coins"==GameFeatureTypeEnum.PRIMARY_CURRENCY?a.coins&&(RSCasinoManager.addPrimaryCurrencyForDisplay("gift_reward",parseInt(a.coins)),RSAnalyticsManager.getInstance().trackPrimarySource(RSAnalyticsSource.free, "gift_collect_all_reward",a.coins,"")):"energy"==GameFeatureTypeEnum.PRIMARY_CURRENCY&&(a.coins&&(RSCasinoManager.addSecondaryCurrencyForDisplay("gift_reward",parseInt(a.coins)),RSAnalyticsManager.getInstance().trackInHouseEvent(RSEventCategory.ECONOMY,"free_source_coins","gift_collect_all_reward",a.coins,"","")),a.energy&&(RSCasinoManager.addPrimaryCurrencyForDisplay("gift_reward",parseInt(a.energy)),RSAnalyticsManager.getInstance().trackPrimarySource(RSAnalyticsSource.free,"gift_collect_all_reward", a.energy,"")));var b=new RSRect(0,0,0,0);this._diplayPanel=new RSDisplayObject(b);this.addChild(this._diplayPanel);b=this.convertToWorldSpace(this._claimAllBtn.getX(),this._claimAllBtn.getY());RSGiftingUtils.coinLayer.setZOrder(2);var c="";a.coins&&(c="coins");a.energy&&(c="energy");RSCasinoManager.getCasinoHUD().playCoinReceivedAnimation(b,RSGiftingUtils.coinLayer,this._onCoinFlyAnimCompleted.bind(this),c)},refreshClaimTab:function(a){if(a._userData)console.log("refresh claim tab"),this.claimAll= [],this._scroller&&this._scroller.removeAllChildren(),this.giftData=RSGiftingManager.getInstance().getGiftingGameData(),this.claimtext=this.giftData["0"].rTitle,a=RSGiftingManager.getInstance().getGiftClaimList(),this._claimList=a.claimList,this._playerIdList=a.playerIdList,this.claimCount=RSGiftingManager.getInstance().getRemainingGiftClaimCountForToDay(),this.totalClaimCount(),this.displayCells(),this.calculateClaimCountCheck(),this.handleClaimAllBtnVisibility(),this.totalClaimCount(),this.calculateClaimCountCheck(), this.claimtext=this.GiftCenterClaimText.replace(/{value}/,this.claimCount),this.giftingCenterClaimText.setString(this.claimtext),this.handleClaimAllBtnVisibility();else{a=0;var b=null;for(a in this.claimAll)b=this.claimAll[a],"survey"==b._data.id&&this.claimAll[a]._onClaimBonusCollectCompleted()}},unload:function(){RSEventManager.getInstance().removeEventListenersIn(this);this._super.unload.call(this)}});var RSGiftSend=RSDisplayObject.extend({init:function(a,b){var c=new RSRect(0,0,0,0);this._super.init.call(this,c);this.callBack=b;this._layout=[{name:RSGame.getInstance().getAssetPath("RSGiftSendTabWidget"),count:1}];this._tile=a;this._sendList=[];this._giftableUsersIdList=[];this._giftType=null;this._giftData=RSGiftingManager.getInstance().getGiftingGameData();this.sendtext=this._giftData["0"].sTitle;this._claimList=RSGiftingManager.getInstance().getGiftClaimList().claimList;this.sendCount=RSGiftingManager.getInstance().getRemainigGiftSendCountOfDay(); this._setPlayerDataForSendList();this.totalSendCount();RSGiftingManager.getInstance().getGIftCellFonts()?this._textFont=RSGiftingManager.getInstance().getGIftCellFonts().subTitleFont:this._textFont=RSGame.getInstance().getGameManager().getDefaultCasinoFont("small","bold");this.loadContent();RSEventManager.getInstance().addEventListener(RSGiftingEvents.GIFTSEND,this,this._onGiftSend.bind(this))},loadContent:function(){this.loadLayout(RSGame.getInstance().getAssetPath("RSGiftSendTabWidget"))},onObjectCreated:function(a, b,c){switch(c.name){case "SendBtnBo":this._sendBtn=a;this._sendBtn.setTouchEnabled(!1);break;case "ScrollBar":this._scrollBar=a;this._scrollBar.setVisible(!1);break;case "ScrollBg":this._scrollBase=a;break;case "SendAllBtn":this._sendAllBtn=a;break;case "ScrollBarDisable":this._scrollDisable=a,this._scrollDisable.setVisible(!1)}this._super.onObjectCreated.call(this,a,b,c)},createCustomObject:function(a,b){switch(b.type){case "VScroller":this._tileArea=b;this._scroller=new RSBarScroller(new RSRect(b.x, b.y,b.w,b.h),new RSSize(this._tile.w,this._tile.h),0,RSScrollerDirection.RSSCROLLER_VERTICAL,1);this.addChild(this._scroller);break;case "Badge":this._claimNotificationBase=RSUtils.createBasicObject(a,b);this.addChild(this._claimNotificationBase);this._claimNotificationBase.setVisible(!0);break;case "Label":switch(b.name){case "GiftingCenterSendText":this.giftCenterSendtext=RSGame.getInstance().getGameData().getPopupTextWithKey(b.name);this.sendtext=this.giftCenterSendtext.replace(/{value}/,this.sendCount); this.giftingCenterSendText=new RSScaledLabel(this.sendtext,this._textFont,b,kTEXT_ALIGNMENT_CENTER);this.addChild(this.giftingCenterSendText);break;case "GiftingCenterNoMoreToSendText":this.sendtext=RSGame.getInstance().getGameData().getPopupTextWithKey(b.name);this.noMoreToSendText=new RSScaledLabel(this.sendtext,this._textFont,b,kTEXT_ALIGNMENT_CENTER);this.addChild(this.noMoreToSendText);break;case "ClaimCountValue":this._claimNotificationCount=new RSScaledLabel("",RSGame.getInstance().getGameManager().getHUDCasinoFont("largeBlue", "bold"),b,kTEXT_ALIGNMENT_CENTER);this.addChild(this._claimNotificationCount);break;case "EmptyText":this.EmptySendListText=new RSScaledLabel("Please check back in some time to send more gifts!",this._textFont,b,kTEXT_ALIGNMENT_CENTER);this.addChild(this.EmptySendListText);this._sendList.length&&this.EmptySendListText.setVisible(!1);break}case "ScrollBar":switch(b.name){case "GitfScrollbarWidget":this._scrollArea=b}}return this._super.createCustomObject.call(this,a,b)},onButtonClicked:function(a){switch(a){case "ClaimBtn":this.callBack&& this.callBack();break;case "InviteBtn":RSAnalyticsManager.getInstance().trackPlayerAction("giftcenter","invite","click","","");RSGiftingManager.getInstance().sendInvitation([]);break;case "SendAllBtn":this._sendAllBtn.setTouchEnabled(!1),this._sendGiftToAll()}},_setPlayerDataForSendList:function(){this._scroller&&this._scroller.removeAllChildren();this._sendList=[];this._giftableUsersIdList=[];var a={},b=RSGiftingManager.getInstance().getRemainigGiftSendCountOfDay();if(RSGiftingManager.getInstance().getShareEnableStatus()){var c= RSGiftingManager.getInstance().getGiftData("InviteShare");c&&(a={},a.message=c.message,a.coins=c.coins,a.id=c.id,a.giftType=c.placement,a.enableButton=!0,this._sendList.push(a))}for(var c=RSGiftingManager.getInstance().getData().giftableUsers,d=0;d=d&&this._scrollDisable.setVisible(!0):(this._scrollDisable.setVisible(!1),this._scrollBase.setVisible(!1))},_sendGiftToAll:function(){RSGiftingManager.getInstance().sendFbGift(this._giftableUsersIdList,this._giftType,this._onGiftSendCompleted.bind(this))}, totalSendCount:function(){this.sendCount=RSGiftingManager.getInstance().getRemainigGiftSendCountOfDay();RSGiftingManager.getInstance().getShareEnableStatus()&&(this.sendCount=parseInt(this.sendCount)+1)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);this._scroller.setButtonScroll(this._scrollBar);this._scroller.setScrollBase(this._scrollArea);var a=new RSDisplayObject(new RSRect(this._tileArea.x,this._tileArea.y,this._tileArea.w+50,this._tileArea.h));this.addChild(a);a.setAnchorPoint(0.5, 0.5);this._scroller.setMouseWheelScrollBase(a);this.notificationSendCount=RSGiftingManager.getInstance().getGiftClaimCount();this._claimNotificationCount.setString(this.notificationSendCount);0>=this.notificationSendCount&&(this._claimNotificationBase.setVisible(!1),this._claimNotificationCount.setVisible(!1));this.displayCells();this.calculateSendCountCheck();this.handleSendAllBtnVisibility()},_onGiftSend:function(){this.totalSendCount();this.calculateSendCountCheck();this.sendtext=this.giftCenterSendtext.replace(/{value}/, this.sendCount);this.giftingCenterSendText.setString(this.sendtext);1==this.sendCount&&(this._scroller&&this._scroller.removeAllChildren(),this.displayCells(!0),this.handleSendAllBtnVisibility())},calculateSendCountCheck:function(){0==this.sendCount?(this.noMoreToSendText.setVisible(!0),this.giftingCenterSendText.setVisible(!1)):(this.giftingCenterSendText.setVisible(!0),this.noMoreToSendText.setVisible(!1))},_onGiftSendCompleted:function(a,b,c,d){c*=b;a?(RSAnalyticsManager.getInstance().trackPlayerAction("giftcenter", "send_"+d,"send_all",c,b),this._scroller&&this._scroller.removeAllChildren(),this.displayCells(!0),this.handleSendAllBtnVisibility()):this._sendAllBtn.setTouchEnabled(!0)},handleSendAllBtnVisibility:function(){var a=RSGiftingManager.getInstance().getRemainigGiftSendCountOfDay(),b=this._sendList.length;if(0>=a)this._sendAllBtn.setTouchEnabled(!1);else if(1==b)for(a=0;athis._retryCount?(this._retryCount++,this.checkDetail()):(this._retryCount=0,RSEngine.screenManager.removeOverlay(),RSErrorTracker.getInstance().trackErrorMessage("ERROR_EMAIL_CONNECT","Error connecting email ","mahesh.jose@rubyseven.net"),this.closePopup())}});var VIPTierWidget=RSDisplayObject.extend({init:function(a,b,c,d){this._animCallback=c;this._baseRect=a;this._widgetPanel=new RSPanel(0,0,0,0);this._super.init.call(this,this._baseRect);this._VipStatus=this._VipStage=null;this._initialAnim=!0;this._bg=null;this._currentVipStatus=RSVIPManager.getInstance().getVIPUserTier();this._disableScaling=d;null==b?this.loadLayout(RSGame.getInstance().getAssetPath("VIPStatusTier")):this.loadLayout(b)},createCustomObject:function(a,b){switch(b.name){case "Bg":this._bg= RSUtils.createBasicObject(a,b);this._widgetPanel.addChild(this._bg);break;case "YourStatus":var c=RSUtils.createBasicObject(a,b);this._widgetPanel.addChild(c);0==this._currentVipStatus&&c.setVisible(!1);break;case "ExtraCoin":c=RSGame.getInstance().getGameManager().getPurchaseCartVipExtraCoinFont()?RSGame.getInstance().getGameManager().getPurchaseCartVipExtraCoinFont():RSGame.getInstance().getGameManager().getDefaultCasinoFontForHeading("normal");c=new RSScaledLabel("0",c,b,kTEXT_ALIGNMENT_RIGHT); if(0!=this._currentVipStatus){var d=RSEngine.gameData.getCurrentVIPStatus(this._currentVipStatus),d=String(100*d.additionalCoinsOnPurchase);c.setString("0"==d?"-":d+"%");this._widgetPanel.addChild(c)}break;case "BenefitsBtn":this._benefitsBtn=RSUtils.createButton(a,b);this.addTouchListenerToButton(this._benefitsBtn);this._widgetPanel.addChild(this._benefitsBtn);break;case "VipStage":this._VipStage=RSUtils.createAnimation(a,b,1);this._VipStage.stopAnimation();0==this._currentVipStatus?this._VipStage.setFrame(0): this._VipStage.setFrame(1);this._widgetPanel.addChild(this._VipStage);break;case "VipStatus":this._VipStatus=RSUtils.createAnimation(a,b,1);this._VipStatus.stopAnimation();0==this._currentVipStatus?this._VipStatus.setVisible(!1):this._VipStatus.setFrame(this._currentVipStatus-1);this._widgetPanel.addChild(this._VipStatus);break;case "BlueStar":1==this._currentVipStatus&&(c=null,c=RSUtils.createAnimation(a,b,1),c.setVisible(!1),c.stopAnimation(),this.StarAnim=c,this._widgetPanel.addChild(c));break; case "BlueStarLoop":1==this._currentVipStatus&&(c=RSUtils.createAnimation(a,b,1),c.setVisible(!1),c.stopAnimation(),this.StarLoop=c,this._widgetPanel.addChild(c));break;case "BronzeStar":2==this._currentVipStatus&&(c=RSUtils.createAnimation(a,b,1),c.setVisible(!1),c.stopAnimation(),this.StarAnim=c,this._widgetPanel.addChild(c));break;case "BronzeStarLoop":2==this._currentVipStatus&&(c=RSUtils.createAnimation(a,b,1),c.setVisible(!1),c.stopAnimation(),this.StarLoop=c,this._widgetPanel.addChild(c)); break;case "SilverStar":3==this._currentVipStatus&&(c=RSUtils.createAnimation(a,b,1),c.setVisible(!1),c.stopAnimation(),this.StarAnim=c,this.addChild(c));break;case "SilverStarLoop":3==this._currentVipStatus&&(c=RSUtils.createAnimation(a,b,1),c.setVisible(!1),c.stopAnimation(),this.StarLoop=c,this._widgetPanel.addChild(c));break;case "GoldenStar":4==this._currentVipStatus&&(c=RSUtils.createAnimation(a,b,1),c.setVisible(!1),c.stopAnimation(),this.StarAnim=c,this._widgetPanel.addChild(c));break;case "GoldenStarLoop":4== this._currentVipStatus&&(c=RSUtils.createAnimation(a,b,1),c.setVisible(!1),c.stopAnimation(),this.StarLoop=c,this._widgetPanel.addChild(c));break;case "BlackStar":5==this._currentVipStatus&&(c=RSUtils.createAnimation(a,b,1),c.setVisible(!1),c.stopAnimation(),this.StarAnim=c,this._widgetPanel.addChild(c));break;case "BlackStarLoop":5==this._currentVipStatus&&(c=RSUtils.createAnimation(a,b,1),c.setVisible(!1),c.stopAnimation(),this.StarLoop=c,this._widgetPanel.addChild(c));break;default:switch(b.type){case "Custombo":c= RSUtils.createBasicObject(a,b),this._widgetPanel.addChild(c)}}},onLayoutCompleted:function(){this.addChild(this._widgetPanel);0RSGame.getInstance()[b(198)]().getMe()[b(520)]()&&(this[b(257)]+=c[f][b(439)],this[b(429)](c[f][b(265)]));GlobalVars.isjackpotLoaded&&(e=!0);d.level> RSGame[b(545)]()[b(198)]()[b(382)]().getRewardedLevel()&&RSGame.getInstance()[b(198)]().getMe()[b(604)](d[b(265)]);var f=RSVIPManager[b(545)]()[b(527)](),g=RSVIPManager[b(545)]()[b(592)](d.level,this[b(257)],c[b(203)]),c=RSVIPManager[b(545)]()[b(527)]();this[b(257)]=100*Math.ceil(g[b(275)]/100);if(0e[b(265)]&&!RSGame[b(545)]()[b(198)]()[b(382)]()[b(315)]("event3")&&(RSAppsFlyerManager[b(545)]().trackEvent(b(596)),RSGame[b(545)]()[b(198)]()[b(382)]()[b(407)]("event3"));if(GameConfig[b(476)]&&RSEngine[b(571)]!=LOGIN_MODE[b(595)])if(10<=e[b(265)]&&15>e[b(265)])RSAdjustManager[b(545)]()[b(278)](RSAdjustEventToken[b(583)]);else 20<=e.level&&25>e[b(265)]&&RSAdjustManager[b(545)]()[b(278)](RSAdjustEventToken[b(288)]);RSEngine.popupManager.addPopup(new RSLevelUpToaster(g, e,this[b(381)][b(374)](this,e[b(316)])),!1)}RSGame[b(545)]()[b(198)]()[b(382)]().setGuestUserDataForKey(b(265),d[b(265)])}a&&c>f&&(0==f&&GameConfig.LM_AND_VIP_SURFACING?this[b(532)](!0,!1):RSEngine[b(524)].addPopup(new VIPWelcomePopup(c,!1,!0)))},onLevelupClose:function(a){},updateLevelUpReward:function(a){var b=a0_0x3bde5b;RSEngine[b(571)]!=b(252)&&(RSCasinoManager[b(507)](b(284),a[GameFeatureTypeEnum[b(226)]]),typeof a[GameFeatureTypeEnum[b(611)]]!==b(425)&&RSCasinoManager[b(258)](a[GameFeatureTypeEnum[b(611)]]))}, saveLevelUpReward:function(a,b){var c=a0_0x3bde5b;this[c(224)]=a;this[c(303)]=void 0!=b?b:!1;RSEngine[c(571)]!=c(252)?RSGame[c(545)]().getUserDataManager().saveLevelBonusDetails(this[c(224)],this[c(463)][c(374)](this),this[c(581)].bind(this)):RSCasinoManager[c(432)](this._rewardDetails[GameFeatureTypeEnum[c(226)]]+this[c(224)][c(416)])},levelBonusUpdated:function(a){var b=a0_0x3bde5b;if(a.result[b(518)]==b(354)){RSAnalyticsManager.getInstance()[b(266)](RSAnalyticsSource[b(514)],"level_up",a.result[b(328)].coins, "",a.result.rewards[b(450)]);var c=0;this[b(303)]?c=RSGame.getInstance().getUserDataManager()[b(382)]().getCoins()+a[b(449)][b(328)][b(416)]:c=RSGame[b(545)]()[b(198)]()[b(382)]()[b(544)]()+a[b(449)][b(328)][b(299)]+a.result[b(328)][b(416)];RSEngine[b(314)].updateCoin(c);RSAnalyticsManager[b(545)]()[b(266)](RSAnalyticsSource[b(514)],b(605),a.result[b(328)][b(416)],"",a.result.rewards.Level)}},levelBonusUpdateFailed:function(a){this.saveLevelUpReward(this[a0_0x3bde5b(224)])},dispatchEventForQuestOnLevelup:function(a){var b= a0_0x3bde5b;RSEventManager[b(545)]()[b(393)](RSGeneralQuestEventKeys.LEVEL_UP_ACTION,a)},showLoginPopup:function(a,b){var c=a0_0x3bde5b;null!=b&&RSGame.getInstance()[c(198)]()[c(382)]()[c(262)](c(215),b);var d=parseInt(RSEngine.gameData.getDefaultValues().emailReward);RSEngine[c(524)].addPopup(new RSSingleSignOnPopup(d),!0)},showPurchaseCart:function(){var a=a0_0x3bde5b;GlobalVars[a(196)]?(RSEngine[a(314)].postMessageToJackpot(a(380),{type:a(189)}),RSEngine[a(524)][a(193)](new PurchaseCartPopup(a(305), this[a(443)][a(374)](this)),!1)):VideoManager[a(545)]().showVideoPopup(a(322),!1,a(264),this[a(443)].bind(this))},onPurchaseCartClosed:function(){var a=a0_0x3bde5b;RSEventManager[a(545)]()[a(393)](a(443),{})},showSalesPopup:function(){var a=a0_0x3bde5b;if(GlobalVars.isPurchaseEnabled)RSSaleManager.getInstance()[a(493)]()&&RSSaleManager[a(545)]()[a(298)](!1);else VideoManager[a(545)]()[a(207)](a(322),!1,a(264))},getApprovalForNavigation:function(){var a=a0_0x3bde5b;RSGame[a(545)]().getGameManager()[a(603)]()== RSGameTypes[a(370)]&&RSEngine[a(314)][a(398)]()?(GlobalVars.isLeanplumNavigation=!0,RSEngine[a(314)][a(521)]()):this.platformSDKScreenNavigation(this[a(601)])},callScreenNavigation:function(){var a=a0_0x3bde5b;this._navigateToLobby&&this[a(239)](this[a(601)])},platformSDKScreenNavigation:function(a){var b=a0_0x3bde5b,c="",d="",e=!1;switch(a){case b(442):if(RSEngine.dataManager[b(382)]()[b(300)]())c=RSGameScreens[b(362)],e=!0;else return;break;case b(386):c=RSGameScreens[b(244)];d=RSGameTypes[b(247)]; break;case "BINGO_LOBBY":case b(286):case b(473):c=RSGameScreens[b(218)];d=RSGameTypes[b(370)];break;case b(598):c=RSGameScreens[b(454)];d=RSGameTypes[b(445)];break;case "POKER_LOBBY":c=RSGameScreens[b(249)];d=RSGameTypes[b(318)];break;case b(496):c=RSGameScreens[b(327)];break;case "BIHOURLY_BONUS":c=RSGameScreens[b(327)];break;case b(343):c=RSGameScreens.ScratcherLobby;d=RSGameTypes[b(259)];break;case b(201):c=RSGameScreens.TableGamesLobby,d=RSGameTypes[b(445)]}if(e){if(RSGameScreenManager[b(545)]().getCurrentScreen()!= c||RSAnalyticsManager[b(545)]()[b(563)]()!=b(442))this[b(395)]=RSGame[b(545)]()[b(302)]().getMachineDetails(RSGameTypes.Scorebox),GlobalVars[b(404)]=!0,RSGame[b(545)]()[b(591)]()[b(250)](this[b(395)][0][b(221)],this[b(395)][0][b(495)],this[b(395)][0][b(187)],!1,null,"play",null)}else RSGameScreenManager[b(545)]()[b(219)]()!=c&&(RSGameScreenManager.getInstance().setCurrentLobbyName(RSGameScreenManager[b(545)]().getCurrentScreen()),""!=c&&(this.removeScreensForNavigation(),RSGameScreenManager[b(545)]()[b(345)](c)), ""!=d&&RSGame[b(545)]().getGameManager()[b(283)](d))},removeScreensForNavigation:function(){var a=a0_0x3bde5b;GlobalVars.isjackpotLoaded&&(GlobalVars[a(406)]=!1,RSEngine[a(314)][a(480)]("jackpotCustomInterfaceCalls",{type:"disconnectJackpot"}));RSCasinoManager.getCasinoHUD().checkSessionStopEvent();for(RSEngine[a(314)][a(337)]();1TimeManager[a(545)]()[a(538)]()&&0=RSQuestManager.getInstance()[a(466)][0][a(397)]||0=GameConfig[a(479)]&& !RSGame[a(545)]().getUserDataManager()[a(382)]()[a(440)]()&&RSGame[a(545)]()[a(198)]()[a(382)]()[a(566)](!0)},onJLAvailablePopupClosed:function(){this[a0_0x3bde5b(543)]=null},getHourlyBonusValue:function(){for(var a=a0_0x3bde5b,b=RSGame[a(545)]().getGameData()[a(384)](),c=RSGame[a(545)]()[a(619)]().getCurrentLevel(),d=0;dd[c(332)]-d[c(402)]?!0:!1},setSkipForJL:function(a){this[a0_0x3bde5b(204)]=a},getVipTierWidgetAssetPath:function(){var a=a0_0x3bde5b;return RSGame[a(545)]()[a(390)](a(379))},getSkipForJL:function(){return this[a0_0x3bde5b(204)]},getUpdatedUserForDisplay:function(a){var b=a0_0x3bde5b;return a[b(621)](b(531))?(a=a[b(561)](b(531)), "1"==RSEngine.gameData.getDefaultValues()[b(233)]?"#"+a[1]:a[1]):a},callWebStorePurchaseSuccessPopup:function(a){var b=a0_0x3bde5b;RSEngine[b(524)][b(193)](new RSWebStorePurchaseSuccessPopup(a),!0)}});var RSTopHudProgressBar=RSPanel.extend({init:function(a,b,c,d,e,f){this._super.init.call(this,a.x,a.y,a.w,a.h);this._barAnimation=d;this._xpBlastAnim=f;this._barEdgeAnim=e;this.setClippingEnabled(!0);this._barPercent=0;this._barWidth=a.w;this._bar=RSUtils.createBasicObject(b,a);b=this.convertToNodeSpace(a.x,a.y);this._bar.setPosition(b.getX(),b.getY());this.addChild(this._bar);this._initialPos=this._bar.getX()-this._barWidth;this._bar.moveX(-this._barWidth);a=this._bar.convertToNodeSpace(a.x,a.y); this._barAnimation&&(a=this._bar.convertToNodeSpace(this._barAnimation.getX(),this._barAnimation.getY()),this._barAnimation.setPosition(a.getX(),a.getY()),this._bar.addChild(this._barAnimation));this._xpBlastAnim&&(a=this._bar.convertToNodeSpace(this._xpBlastAnim.getX(),this._xpBlastAnim.getY()),this._bar.addChild(this._xpBlastAnim),this._xpBlastAnim.setPosition(a.getX(),a.getY()));this._barEdgeAnim&&(this._edgeColor=this._barEdgeAnim.getColor(),a=this._bar.convertToNodeSpace(this._barEdgeAnim.getX(), this._barEdgeAnim.getY()),this._barEdgeAnim.setPosition(a.getX(),a.getY()),this._barEdgeAnim.stopAnimation(),this._bar.addChild(this._barEdgeAnim))},playBarProgressAnim:function(){this._barAnimation.stopAnimation();this._barAnimation.setFrame(0);this._barAnimation.playAnimation(1,0.5,this.onProgressFillAnimationComplete.bind(this))},onProgressFillAnimationComplete:function(){this._barAnimation.setFrame(0);this._barAnimation.stopAnimation()},playXPBlastAnim:function(){this._xpBlastAnim&&(this._xpBlastAnim.stopAnimation(), this._xpBlastAnim.setVisible(!0),this._xpBlastAnim.playAnimation(-1,0.3));this._barEdgeAnim&&this._barEdgeAnim.setColor(new RSColor(0,214,221,255))},stopXPBlastAnim:function(){this._xpBlastAnim&&(this._xpBlastAnim.setVisible(!1),this._xpBlastAnim.setFrame(1),this._xpBlastAnim.stopAnimation());this._barEdgeAnim&&this._barEdgeAnim.setColor(this._edgeColor)},setBarInitialPos:function(a){this._barPosition=this._initialPos+this._barWidth*a%this._barWidth;this._bar.setX(this._barPosition);this._barPercent= a},moveBarTo:function(a,b){var c=this._barPercent;c>a&&(a+=1);1<=a&&void 0!=b&&b();this.stopActionTweenForKey("progressBarMove");this.startActionTweenForKey("progressBarMove",1,c,a)},actionOnUpdate:function(a,b){var c=b*this._barWidth%this._barWidth;this._bar.setX(this._initialPos+c);this._barPosition=this._initialPos+c;this._barPercent=b%1},actionOnComplete:function(a){this.stopActionTweenForKey("progressBarMove")}});var TopHUD=RSCasinoHUD.extend({mask:null,finalScale:null,levelId:null,_progressBar:null,_progressBarStartingX:0,_progressBarEndingX:0,_progressObj:null,_alreadyMoving:!1,_moveActionProgressBar:null,_piggyAnims:[],_piggyWinAnimActive:!1,_animInProgress:!1,isLocOocShown:!1,init:function(a){this._super.init.call(this,a);this._gameManager=RSGame.getInstance().getGameManager();this._userDataManager=RSGame.getInstance().getUserDataManager();this.coinField=null;this._levelDataManager=RSGame.getInstance().getLevelManager(); this._guestBtn=this._toaster=this._backButton=this._msgButton=this._profileStats=this._vipButton=this._settingsButton=null;this._fadeTimer=1;this._newsFeedCount="";this._objectData=this._profileImage=this._leaderboard=this._newsFeedBg=null;this._winDisplay=this._userDataManager.getMe().getCoins();this._iconPathArrayForPlayerStats={};this._iconNameArrayForPlayerStats={};this._interuptTriggered=!1;this._purchaseWidget=null;this._tournamentWidgetHided=!0;this._tournamentTimer=null;this._showIntermediateBubble= !1},loadContent:function(){cc.spriteFrameCache.addSpriteFrames(RSGame.getInstance().getAssetFolder("AvatarPopup")+"AvatarImages_00-hd.plist");this.layoutScreen(this._layout,2);this._super._super.loadContent.call(this);this._iconPathArrayForPlayerStats[RSGameTypes.Poker]="res/PokerResources/CasinoSubLobby/MainLobbyPreviewIcons/";this._iconPathArrayForPlayerStats[RSGameTypes.Bingo]="res/BingoResources/res/featuredIcons/";this._iconPathArrayForPlayerStats[RSGameTypes.Blackjack]="res/TableResources/SubLobby/Icons/"; this._iconPathArrayForPlayerStats[RSGameTypes.Slots]="res/SlotResources/CasinoSubLobby/icons/";this._iconPathArrayForPlayerStats[RSGameTypes.Keno]="res/KenoResources/SubLobby/featuredIcons/";this._iconPathArrayForPlayerStats[RSGameTypes.Roulette]="res/TableResources/SubLobby/Icons/";this._iconPathArrayForPlayerStats[RSGameTypes.Scratcher]="res/ScratcherResources/SubLobby/Icons/";this._iconPathArrayForPlayerStats[RSGameTypes.TableGames]="res/TableResources/SubLobby/Icons/";this._iconNameArrayForPlayerStats[RSGameTypes.Poker]= "machine_largeIcon";this._iconNameArrayForPlayerStats[RSGameTypes.Bingo]="machine_largeIcon";this._iconNameArrayForPlayerStats[RSGameTypes.Blackjack]="machine_largeIcon";this._iconNameArrayForPlayerStats[RSGameTypes.Slots]="imageName";this._iconNameArrayForPlayerStats[RSGameTypes.Keno]="machine_largeIcon";this._iconNameArrayForPlayerStats[RSGameTypes.Roulette]="machine_largeIcon";this._iconNameArrayForPlayerStats[RSGameTypes.Scratcher]="machine_identifier";this._iconNameArrayForPlayerStats[RSGameTypes.TableGames]= "machine_identifier"},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);if(RSEngine.loginMode!=LOGIN_MODE.GUEST&&GameConfig.TOURNAMENT_ENABLED&&parseInt(RSEngine.gameData.getDefaultValues().isTournamentEnabled)&&86400>RSTournamentManager.tournamentStartsIn()){clearInterval(this._tournamentTimer);var a=RSTournamentManager.tournamentStartsIn(),b=RSTournamentManager.tournamentEndsIn();a=a?(clearInterval(this._bonusTimer),this.levelLabel&&this.levelLabel.setString("LEVEL"),this._xpBoostAnim&&(this._progressBar.stopXPBlastAnim(),this._xpBoost.setVisible(!1),this._xpTimer.setVisible(!1))): (b=1==parseInt(a/86400)?parseInt(a/86400)+" Day":1=UrlNotificationManager.getInstance().xp_multiplier&& this._xpBoost.setVisible(!1);break;case "XpBlastAnim":this._xpBoostAnim=a;this._xpBoostAnim.stopAnimation();this.removeChild(this._xpBoostAnim);break;case "ProgressFillAnim":this._progressFillAnim=a;this._progressFillAnim.stopAnimation();this.removeChild(this._progressFillAnim);break;case "ProgressFillEdgeAnim":this._progressFillEdgeAnim=a;this._progressFillEdgeAnim.stopAnimation();this.removeChild(this._progressFillEdgeAnim);break;case "LevelFrame":this._levelframe=a;break;case "LevelupAnim":this._levelupAnimation= a;this._levelupAnimation.setVisible(!1);this._levelupAnimation.stopAnimation();break;case "PiggyWinAnim":this._piggyWinAnim=a;this._piggyWinAnim.stopAnimation();this._piggyWinAnim.setVisible(!1);break;case "PiggyCollectedAnim":this._piggyCollectedAnim=a;this._piggyCollectedAnim.stopAnimation();this._piggyCollectedAnim.setVisible(!1);break;case "PiggySmallBetsAnim":this._piggySmallBetAnim=a;this._piggySmallBetAnim.stopAnimation();this._piggySmallBetAnim.setVisible(!1);break;case "PiggyMaxBetAnim":this._piggyMaxBetAnim= a;this._piggyMaxBetAnim.stopAnimation();this._piggyMaxBetAnim.setVisible(!1);break;case "Piggy":this._piggy=a;break;case "LogOutBtn":this._logOutBtn=a;RSEngine.loginMode!==LOGIN_MODE.FACEBOOK&&RSEngine.loginMode!==LOGIN_MODE.GUEST||this._logOutBtn.setVisible(!1);break;case "FullScreenBtnFalse":this._fullScreenFalse=a;RSEngine.loginMode==LOGIN_MODE.FACEBOOK&&this._fullScreenFalse.setX(this._fullScreenFalse.getX()+16);GlobalVars.fullscreenStatus?(this._fullScreenFalse.setVisible(!1),this._fullScreenFalse.setTouchEnabled(!1)): (this._fullScreenFalse.setVisible(!0),this._fullScreenFalse.setTouchEnabled(!0));break;case "FullScreenBtnTrue":this._fullScreenTrue=a;RSEngine.loginMode==LOGIN_MODE.FACEBOOK&&this._fullScreenTrue.setX(this._fullScreenTrue.getX()+16);GlobalVars.fullscreenStatus?(this._fullScreenTrue.setVisible(!0),this._fullScreenTrue.setTouchEnabled(!0)):(this._fullScreenTrue.setVisible(!1),this._fullScreenTrue.setTouchEnabled(!1));break;case "FlipAnimRight":this._flipAnimRight=a;this._flipAnimRight.stopAnimation(); this._flipAnimRight.setVisible(!1);break;case "FlipAnimLeft":this._flipAnimLeft=a;this._flipAnimLeft.stopAnimation();this._flipAnimLeft.setVisible(!1);break;case "VipStatus":this._vipStatus=a;this._vipStatus.stopAnimation();break;case "VipStatusBg":this._vipStatusBg=a,this._vipStatusBg.addTouchListenerWithDelegate(this)}this._super.onObjectCreated.call(this,a,b,c)},getVipStatusObject:function(){return this._vipStatus?this._vipStatus:null},disablePurchaseButton:function(){null!=this._purchaseWidget&& this._purchaseWidget.disablePurchaseButton()},enablePurchaseButton:function(){null==this._purchaseWidget||GlobalVars.isTournamentLoaded||this._purchaseWidget.enablePurchaseButton()},setXpBar:function(a){this._progressBar&&this._progressBar.moveBarTo(a,this.playLevelupAnimation.bind(this));a=this._levelDataManager.getCurrentLevel();this.levelId&&!RSGame.getInstance().getLevelManager().isLevelUpTriggered()?this.levelId.setString("LVL "+a):!this.levelId||0!==a%5&&2!==a||this.levelId.setString("LVL "+ a);UrlNotificationManager.getInstance().getXpRewardStatus()||this.playXpAnim()},playXpAnim:function(){this._progressBar&&this._progressBar.playBarProgressAnim()},reInitButtonHoverCursor:function(){this.checkSaleStatusAndStartBuyButtonAnimation();this.playXPBlastAnimation();UrlNotificationManager.getInstance().getXpRewardStatus()&&this._xpVal&&(this._xpVal.stopAllActions(),this._xpTimer.stopAllActions(),this.xpTimerAnimation());this._super.reInitButtonHoverCursor.call(this)},playXPBlastAnimation:function(){this._xpBoost&& this._xpBoost.setVisible(!0);UrlNotificationManager.getInstance().getXpRewardStatus()?(this._xpBoostAnim&&(this._progressBar.playXPBlastAnim(),this._xpBoostAnim.setVisible(!0),clearInterval(this._bonusTimer),this._bonusTimer=setInterval(this._setTimerValues.bind(this),1E3)),this._progressFillAnim&&this._progressFillAnim.setVisible(!1)):(this._xpBoost&&this._xpBoost.setVisible(!1),this._xpBoostAnim&&(this._progressBar.stopXPBlastAnim(),this._xpBoostAnim.setVisible(!1)),this._progressFillAnim&&this._progressFillAnim.setVisible(!0), this._xpTimer&&this._xpTimer.setVisible(!1),this._xpVal&&this._xpVal.setVisible(!1))},xpTimerAnimation:function(){UrlNotificationManager.getInstance().getXpRewardStatus()?this._xpTimer&&(this._xpTimer.setVisible(!0),this._xpVal.setVisible(!1),this._xpTimer.actionFadeOut(1,this._timerfadeOutComplete.bind(this))):this._xpTimer&&(this._xpTimer.stopAllActions(),this._xpVal.stopAllActions())},_timerfadeOutComplete:function(){this._xpTimer.setVisible(!1);this._xpVal.setVisible(!0);this._xpVal.setString(UrlNotificationManager.getInstance().getXpBlastVO().xp_multiplier+ "x XP");this._xpVal.actionFadeIn(1,this._xpfadeInComplete.bind(this))},_xpfadeInComplete:function(){RSUtils.callFunctionWithDelay(1,this.getDisplayObject(),this._xpfadeoutStart.bind(this))},_xpfadeoutStart:function(){this._xpVal.actionFadeOut(1,this._xpfadeOutComplete.bind(this))},_xpfadeOutComplete:function(){this._xpTimer.setVisible(!0);this._xpVal.setVisible(!1);this._setTimerValues();this._xpTimer.actionFadeIn(1,this._timerfadeInComplete.bind(this))},_timerfadeInComplete:function(){RSUtils.callFunctionWithDelay(1, this.getDisplayObject(),this.xpTimerAnimation.bind(this))},onBackButton:function(a){GlobalVars.isLeanplumNavigation&&(GlobalVars.isLeanplumNavigation=!1);if(RSEngine.externalGameManager.isInGameBackButtonActive()&&null==a)RSEngine.externalGameManager.triggerEventOnBackButtonClick();else{GlobalVars.isInsideMachine=!1;this.checkSessionStopEvent();GameConfig.TOURNAMENT_ENABLED&&parseInt(RSEngine.gameData.getDefaultValues().isTournamentEnabled)&&0RSTournamentManager.getHudTimerFreezesIn()&&this.startTournamentTimerToggleAnimation();GlobalVars.isInsideTournament=!1;GlobalVars.isTournamentLoaded=!1;GlobalVars.isFirstSpinOnMachine=!1;this.disableAllButtons();SideMenuController.getInstance().isToasterActive()||SideMenuController.getInstance().setClosedStateDivDimensions();var b=RSUtils.cloneJSON(RSGameScreenManager.getInstance().getCurrentScreen()); GlobalVars.isjackpotLoaded||RSEngine.externalGameManager.unLoadExternalGame();RSEngine.audioManager.stopMusic();RSEngine.audioManager.stopAllEffects();GlobalVars.isInsideExternalGame=!1;if(a)if(GlobalVars.isjackpotLoaded)RSCasinoManager._HUD=null,GlobalVars.isjackpotLoaded=!1,RSGameScreenManager.getInstance().setPreviousScreen(RSGameScreens.MainLobby),"Jackpot_Mainlobby"==RSGameScreenManager.getInstance().getPreviousScreen()&&RSGameScreenManager.getInstance().setCurrentLobbyName(RSGameScreens.JackpotMainLobby), RSGameScreenManager.getInstance().loadScreen(RSGameScreens.MainLobby),RSGameScreenManager.getInstance().removeAllScreensExceptMainLobby(),RSEngine.externalGameManager.unLoadExternalGame();else{if(RSGame.getInstance().getGameManager().getMinimumBetRewardValue()){this.isLocOocShown=!0;RSGame.getInstance().getGameManager().rewardPlayerWithMinimumBetValue(this.onCurtainRaiserCompleted.bind(this));return}if(this._gameManager.getCurtainRaiserScreen()&&RSGameScreenManager.getInstance().getPreviousScreen()!= RSGameScreens.MainLobby)if(!GlobalVars.isSurfacingActive&&!RSLeaderboard.getRankUpTriggerStatus())this._gameManager.playIntroScreen(this.onCurtainRaiserCompleted.bind(this));else{if(!RSLeaderboard.getRankUpTriggerStatus()||RSLeaderboard.getLeaderboardResetStatus()||b!=RSGameScreens.Machine)this._gameManager.loadPreviousScreen(),this.showDailyChallengeTooltip()}else if(!RSLeaderboard.getRankUpTriggerStatus()||RSLeaderboard.getLeaderboardResetStatus()||b!=RSGameScreens.Machine)this._gameManager.loadPreviousScreen(), this.showDailyChallengeTooltip()}else if(GlobalVars.isjackpotLoaded)RSCasinoManager.getCasinoInterface()._popupList=[],RSAnalyticsManager.getInstance().popCurrentScreen(),RSEngine.externalGameManager.postMessageToJackpot({type:"loadPreviousScreen"});else{if(RSGame.getInstance().getGameManager().getMinimumBetRewardValue()){this.isLocOocShown=!0;RSGame.getInstance().getGameManager().rewardPlayerWithMinimumBetValue(this.onCurtainRaiserCompleted.bind(this));return}if(this._gameManager.getCurtainRaiserScreen()&& RSGameScreenManager.getInstance().getPreviousScreen()!==RSGameScreens.MainLobby)if(!GlobalVars.isSurfacingActive&&!RSLeaderboard.getRankUpTriggerStatus())this._gameManager.playIntroScreen(this.onCurtainRaiserCompleted.bind(this));else{if(!RSLeaderboard.getRankUpTriggerStatus()||RSLeaderboard.getLeaderboardResetStatus()||b!=RSGameScreens.Machine)this._gameManager.loadPreviousScreen(),this.showDailyChallengeTooltip()}else if(!RSLeaderboard.getRankUpTriggerStatus()||RSLeaderboard.getLeaderboardResetStatus()|| b!=RSGameScreens.Machine)this._gameManager.loadPreviousScreen(),this.showDailyChallengeTooltip()}this._gameManager.getCurtainRaiserScreen()||RSGame.getInstance().getGameManager().setSideMenuVisibility(!0);RSAnalyticsManager.getInstance().getCurrentScreen()==RSGameScreens.MainLobby&&this.isDailyBonusActive()||RSAnalyticsManager.getInstance().getCurrentScreen()==RSGameScreens.JackpotMainLobby||RSEventManager.getInstance().dispatchEvent(RSPlatformEventTypeKeys.RSPlatformEvent,{event:RSPlatformEventTypeKeys.RSPlatformEvent, parameter:RSPlatformEventTypeKeys.ON_BACK_BUTTON_CLICK,value:b})}},initiateSurfacing:function(){!GlobalVars.isSurfacingActive&&GameConfig.LM_AND_VIP_SURFACING&&RSGame.getInstance().getGameManager().getCurtainRaiserScreen()?this._gameManager.playIntroScreen(this.onCurtainRaiserCompleted.bind(this)):!GlobalVars.isSurfacingActive&&GameConfig.JL_SURFACING&&RSEngine.dataManager.getMe().getJLTriggerStatus()&&!RSEngine.dataManager.getMe().getJLSurfacingShown()?GameConfig.JACKPOT_LOUNGE_ENABLE&&RSGame.getInstance().getLevelManager().getCurrentLevel()>= GameConfig.JACKPOT_LOUNGE_LEVEL&&RSAnalyticsManager.getInstance().getCurrentScreen()==RSGameScreens.SlotsLobby?RSGame.getInstance().getGameManager().showIntroScreenForJL(this.onCurtainRaiserCompleted.bind(this)):GlobalVars.isjackpotLoaded||this._gameManager.loadPreviousScreen():GlobalVars.isjackpotLoaded||(this._gameManager.loadPreviousScreen(),this.showDailyChallengeTooltip());RSEventManager.getInstance().removeListenersForEvent("onUserRankUp")},showDailyChallengeTooltip:function(){GlobalVars.isDCTooltipActive&& this._gameManager.getMachinePlayed()&&(this._timeSet=null,RSGame.getInstance().getGameManager().showDCToolTipPopup(),this._timeSet=setTimeout(this.showTooltipAfterTimeOut.bind(this),1E3))},showTooltipAfterTimeOut:function(){RSEngine.popupManager.addPopup(RSGame.getInstance().getGameManager()._toolTipPopup,null,null,!1);RSGame.getInstance().getGameManager().setSideMenuVisibility(!0);clearTimeout(this._timeSet)},isDailyBonusActive:function(){return RSEngine.loginMode!=LOGIN_MODE.GUEST&&RSWidgetsManager.getInstance().getController("DailyBonusScreen").getDailyBonusActive()&& (0==RSGame.getInstance().getUserDataManager().getMe().getCurrentDay()&&RSGame.getInstance().getGameManager().getMachinePlayed()||0RSTournamentManager.tournamentStartsIn()&&(c={},c.firstCountDownFont=RSGame.getInstance().getGameManager().getDefaultCasinoFont("extralarge", "bold"),c.lastCountDownFont=RSGame.getInstance().getGameManager().getHUDCasinoFont("largeRedNum","bold"),c.inGameCountDownFont=RSGame.getInstance().getGameManager().getHUDCasinoFont("large","bold"),c.inGameTextFont=RSGame.getInstance().getGameManager().getDefaultCasinoFont("largePurple","Semibold"),this._tournamentTimerWidget=new RSTournamentHudTimerWidget(b,c,this.tournamentTimerCallback.bind(this)),this._tournamentTimerWidget.addTouchListenerWithDelegate(this),this.addChild(this._tournamentTimerWidget), this._tournamentTimerWidget.setCenter(b.x,b.y),this._tournamentTimerWidget.setVisible(!1),this._tournamentTimerWidgetPosition=b);break;case "MessageBubble":RSEngine.loginMode!=LOGIN_MODE.GUEST&&parseInt(RSEngine.gameData.getDefaultValues().isTournamentEnabled)&&86400>RSTournamentManager.tournamentStartsIn()&&(c={},c.notificationFont=RSGame.getInstance().getGameManager().getDefaultCasinoFont("SemiBold","40-hd"),c.countDownFont=RSGame.getInstance().getGameManager().getDefaultCasinoFont("largeRedNum", "bold"),this._tournamentBubbleWidget=new RSTournamentMessageBubbleWidget(b,c,this._onTournamentBubbleButtonClicked.bind(this)),this.addChild(this._tournamentBubbleWidget),this._tournamentBubbleWidget.setCenter(b.x,b.y),this._tournamentBubbleWidget.setVisible(!1));break;case "HudPurchaseWidgetRect":this._purchaseWidget=new RSHudPurchaseWidget(b,null,!1),this.addChild(this._purchaseWidget),this._purchaseWidget.setCenter(b.x,b.y),this._purchaseWidget.setDelegate(this),this._purchaseWidgetPosition=b}}, setNewsFeedCount:function(a){0this._winDisplay?(this.stopWinRollUp(),this.startActionTweenForKey("HUDRollUp",3,this._winDisplay,a)):(this.stopWinRollUp(),this.coinField.setString(RSUtils.formatNumberWithComma(a)), this._winDisplay=Math.floor(a));GlobalVars.isjackpotLoaded&&RSEngine.externalGameManager.postMessageToJackpot({type:"updateCoinBalance",level:this._userDataManager.getMe().getUserLevel(),coinBalance:this._userDataManager.getMe().getCoins()})},actionOnUpdate:function(a,b){this._winDisplay=Math.floor(b);this.coinField.setString(RSUtils.formatNumberWithComma(this._winDisplay))},actionOnComplete:function(){this.stopWinRollUp()},stopWinRollUp:function(){this.stopActionTweenForKey("HUDRollUp");this.coinField.setString(RSUtils.formatNumberWithComma(this._winDisplay))}, onButtonClicked:function(a){if(!GlobalVars.isMachineLoadingInProgress)switch(RSEngine.externalGameManager.hideToaster(),a){case "SettingsButton":this.onSettingsClicked();break;case "Leaderboard":this.onLeaderboardClicked();break;case "ProfileStats":this.onProfileStatsClicked();break;case "MsgButton":this._msgButton.setTouchEnabled(!1);this.onMessageInboxClicked();break;case "BackButton":this.onBackButton();break;case "GuestBtn":RSEngine.loginMode==LOGIN_MODE.GUEST&&this._gameManager.showLoginPopup("feature", "FbConnectPopup");break;case "Gift":RSSocialManager.getInstance().showInviteWindow("Invite friends to Mystic Slots","Come play Mystic Slots!",null,null,null);break;case "LogOutBtn":GameConfig.SSO_ENABLED&&(RSSSOManager.getBlobIdData().blob_id?RSEngine.popupManager.addPopup(new RSAccountManagementPopup("logout"),!0):RSEngine.popupManager.addPopup(new RSSingleSignOnPopup(parseInt(RSEngine.gameData.getDefaultValues().emailReward)),!0));break;case "FullScreenBtnFalse":case "FullScreenBtnTrue":this.onFullScreenClicked()}}, onLeaderboardClicked:function(){var a=!1;RSLeaderboard.getRankUpTriggerStatus()&&(a=!0);RSLeaderboardManager.showLeaderboardScreen(a,!0)},setXP:function(a){this._super.setXP.call(this,a);this.setXpBar(RSGame.getInstance().getLevelManager().getLevelBarProgress())},playCoinReceivedAnimation:function(a,b,c){null==a&&(a=new RSPoint(0,0));var d=b.convertToNodeSpace(this._coinPos.getX()-a.getX(),this._coinPos.getY()-a.getY());cc.spriteFrameCache.addSpriteFrames("res/Popups/CoinFallAnimationSmall_00-hd.plist"); var e=new RSEmitterParticleParams;e._spriteFrames.push("CoinFallAnimationSmall_00/CoinFallAnimationSmall_0000.png");e._spriteAnimationSpeed=0.5;e._origin=a;e._startDelay=0.3;e._startDelayVariance=0.3;e._deviation=60;e._deviationVariance=20;e._displacement=d;e._speed=800;e._360rotationDuration=0.5;this._coinEmitter=new RSCustomAnimationEmitter(e,!1,RSCustomEmitterType.VERTICAL_SNAKE,30,c);this._coinEmitter.loadEmitter();b.addChild(this._coinEmitter);this._coinEmitter.setZOrder(1);this._coinEmitter.startEmitter(); RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetPath("coinFly_SFX"),!1)},checkSessionStopEvent:function(){var a="";if(RSGameScreenManager.getInstance().getCurrentScreen()==RSGameScreens.Machine){this._gameManager.getGameType()!=RSGameTypes.Bingo?this._userDataManager.saveUserBlobParams():a=RSGame.getInstance().getGameManager().getCardCount();var b=RSAnalyticsManager.getInstance().getCurrentMachineAnalyticsName();RSAnalyticsManager.getInstance().trackGameStop(b,a);""!=b&&null!=b&&(b= "open_from_"+b);RSGameScreenManager.getInstance().getPreviousScreen()!==RSGameScreens.Machine&&RSAnalyticsManager.getInstance().trackLobbyEntry(RSGameScreenManager.getInstance().getPreviousScreen(),"",b)}},enableAllButtons:function(){SideMenuController.getInstance().enableAllButtons();GlobalVars.isTournamentLoaded||(null!=this._settingsButton&&this._settingsButton.setTouchEnabled(!0),null!=this._leaderboard&&GameConfig.LEADERBOARD_ENABLED&&this._leaderboard.setTouchEnabled(!0),null!=this._vipButton&& this._vipButton.setTouchEnabled(!0),null!=this._profileStats&&this._profileStats.setTouchEnabled(!0),null!=this._msgButton&&1==parseInt(RSGame.getInstance().getGameData().getDefaultValues().ClevertapInAppMsgStatus)&&this._msgButton.setTouchEnabled(!0),null!=this._guestBtn&&this._guestBtn.setTouchEnabled(!0),null!=this._fullScreenFalse&&this._fullScreenFalse.setTouchEnabled(!0),null!=this._fullScreenTrue&&this._fullScreenTrue.setTouchEnabled(!0),null!=this._logOutBtn&&this._logOutBtn.setTouchEnabled(!0), null!=this._purchaseWidget&&(this._purchaseWidget.enablePurchaseButton(),this.checkSaleStatusAndStartBuyButtonAnimation()),null!=this._tournamentTimerWidget&&this._tournamentTimerWidget.setTouchEnabled(!0),null!=this._vipStatusBg&&this._vipStatusBg.setTouchEnabled(!0));null!=this._backButton&&RSGameScreenManager.getInstance().getCurrentScreen()!=RSGameScreens.MainLobby&&this._backButton.setTouchEnabled(!0)},enableBackButtonForDirectLoading:function(){null!=this._backButton&&this._backButton.setTouchEnabled(!0)}, disableAllButtons:function(){SideMenuController.getInstance().disableAllButtons();null!=this._settingsButton&&this._settingsButton.setTouchEnabled(!1);null!=this._leaderboard&&this._leaderboard.setTouchEnabled(!1);null!=this._vipButton&&this._vipButton.setTouchEnabled(!1);null!=this._profileStats&&this._profileStats.setTouchEnabled(!1);null!=this._msgButton&&this._msgButton.setTouchEnabled(!1);null!=this._backButton&&this._backButton.setTouchEnabled(!1);null!=this._guestBtn&&this._guestBtn.setTouchEnabled(!1); null!=this._fullScreenFalse&&this._fullScreenFalse.setTouchEnabled(!1);null!=this._fullScreenTrue&&this._fullScreenTrue.setTouchEnabled(!1);null!=this._logOutBtn&&this._logOutBtn.setTouchEnabled(!1);null!=this._purchaseWidget&&this._purchaseWidget.disablePurchaseButton();null!=this._tournamentTimerWidget&&this._tournamentTimerWidget.setTouchEnabled(!1);null!=this._vipStatusBg&&this._vipStatusBg.setTouchEnabled(!1)},refreshAvatar:function(){this.setProfilePic("","")},setProfilePic:function(a,b){b&& (this._screenName=b);var c=new RSImageObject,d=RSEngine.dataManager.getMe().getAvatar();GameConfig.IS_EDIT_FIELDS_ENABLED&&d?(d=GameConfig.BASE_URL+"/res/AvatarImages/"+d+".png",c.setImageFromUrl(d,this._objectData.x,this._objectData.y,this._objectData.w,this._objectData.h)):RSEngine.loginMode==LOGIN_MODE.EMAIL&&d?(d=GameConfig.BASE_URL+"/res/AvatarImages/"+d+".png",c.setImageFromUrl(d,this._objectData.x,this._objectData.y,this._objectData.w,this._objectData.h)):c.setImageFromUrl(this._userDataManager.getMe().getImageUrl(), this._objectData.x,this._objectData.y,this._objectData.w,this._objectData.h);this._profileImage=c;this.createProfilePicObject()},createProfilePicObject:function(){null!=this.mask&&(this.removeChild(this.mask),this.mask.unload(),this.mask=null);this._profileImage&&this._objectData&&!this.mask&&(this.mask=new RSClippingNode(RSUtils.createBasicObject(this._screenName,this._objectData)),this.mask.setAlphaThreshold(80),this.mask.addChild(this._profileImage),this.addChild(this.mask))},notifyToHud:function(a){var b= this._userDataManager.getMe().getCoins()+a[GameFeatureTypeEnum.PRIMARY_CURRENCY];this.setCurrencyValue(b);this._userDataManager.getMe().syncBlobVars(a)},addToaster:function(a){this._toaster=a;this.addChild(this._toaster)},removeToaster:function(){null!=this._toaster&&this.removeChild(this._toaster,!0);this._toaster=null},setDelegate:function(a){this._delegate=a},unSetDelegate:function(){this._delegate=null},playLevelupAnimation:function(){var a=this._levelDataManager.getCurrentLevel();if(GlobalVars.isjackpotLoaded|| 0!==a%5&&2!==a)this._levelupAnimation.setFrame(0),this._levelupAnimation.setVisible(!0),!0===this._interuptTriggered?(this.levelId.setVisible(!1),a=new RSPoint(this._levelupAnimation.getX(),this._levelupAnimation.getY()),self=this,this._levelupAnimation.playAnimation(1,1,this.playCoinReceivedAnimation(a,this,function(){self._levelupAnimation.setVisible(!1);self.levelId.setVisible(!0);self.levelId.setString("LVL "+self._levelDataManager.getCurrentLevel());self._piggyWinAnimActive?(RSGame.getInstance().getGameManager().getIsMachineUnlockActive()&& (this._speedUpAnimations=!0),self.showPiggyBankAnim("PiggyWin")):(self._interuptTriggered=!1,RSGame.getInstance().getGameManager().hideOverlayLayer())})),clearInterval(this._levelUpCheck)):(null!=this._levelUpCheck&&clearInterval(this._levelUpCheck),this._levelUpCheck=setInterval(this.playLevelupAnimation.bind(this),1E3))},animatePiggyBank:function(a){var b=this._levelDataManager.getCurrentLevel();if(a&&!this._piggyWinAnimActive){if("PiggyWin"===a)if(GlobalVars.isjackpotLoaded||0!==b%5&&2!==b)if(this._piggyWinAnimActive= !0,!0===this._interuptTriggered)this._piggyAnims=[];else return;else{this._piggyAnims=[];return}this._piggyAnims.push(a)}else this._animInProgress=!1;!this._animInProgress&&!this._piggyWinAnimActive&&0=a)this._tournamentBubbleWidget.setVisible(!0),this._tournamentBubbleWidget.updateCountDownText(a);else if(b)this._tournamentBubbleWidget.setVisible(!0),this._tournamentBubbleWidget.showTournamentEntryInfoText();else if(!RSTournamentManager.isTournamentFirst()&&RSTournamentManager.getIntermediateBubbleStatus())this._triggerIntermediateMessageBubble();else if(this._showIntermediateBubble&&TimeManager.getInstance().getCurrentServerTime()>RSTournamentManager.getTournamentLBEndTime()+RSTournamentManager.getIntermediateMessageTime()){var c= TimeManager.getInstance().getCurrentServerTime()-RSGame.getInstance().getGameManager().getMainLobbyLoadedTime();30<=c&&37>=c?this._triggerIntermediateMessageBubble(c):this._tournamentBubbleWidget.setVisible(!1)}else a<=RSTournamentManager.getMachineRedirectionTime()&&a>RSTournamentManager.getMachineRedirectionTime()-5?(this._tournamentBubbleWidget.showTournamentEntryInfoText(),this._tournamentBubbleWidget.showWaitingRoomOpenBubble(),this._tournamentBubbleWidget.setVisible(!0),a!=RSTournamentManager.getMachineRedirectionTime()|| "gameplay_screen"!=RSGameScreenManager.getInstance().getCurrentScreen()&&!GlobalVars.isjackpotLoaded||SideMenuController.getInstance().playSurfacingAnimation("TournamentWaitingOpen")):(this._tournamentBubbleWidget.setVisible(!1),this._tournamentBubbleWidget.dismissTournamentEntryInfoText())},_triggerIntermediateMessageBubble:function(a){!GlobalVars.isTournamentLoaded&&RSLoginManager.getInstance().getCookie(GameConfig.COOKIE_PREFIX+"-bubbleShown")RSTournamentManager.getHudTimerStartsIn()+6&&(this._tournamentTimerWidget&&this._tournamentTimerWidget.setVisible(!1), this._purchaseWidget&&(this._purchaseWidget.setScaleY(1),this._purchaseWidget.setVisible(!0)),this._tournamentWidgetHided=!0),0!=a%5||0!=b%5||a<=RSTournamentManager.getHudTimerStartsIn()&&a>RSTournamentManager.getHudTimerStartsIn()-5||(a?a>RSTournamentManager.getHudTimerFreezesIn()?GlobalVars.isTournamentLoaded?(this._tournamentTimerWidget&&this._tournamentTimerWidget.setVisible(!1),this._purchaseWidget&&(this._purchaseWidget.setScaleY(1),this._purchaseWidget.setVisible(!0)),this._tournamentWidgetHided= !0):0a?(RSGame[c(275)]().getUserDataManager().addPaidCoins(a),RSGame[c(275)]().getUserDataManager()[c(378)](a,b)):RSGame[c(275)]()[c(267)]()[c(378)](a, b);RSGame[c(275)]()[c(377)]()[c(146)](a);var d=parseInt(RSGame[c(275)]()[c(267)]()[c(397)]()[c(207)](c(272))),d=d+parseInt(a);RSGame[c(275)]().getUserDataManager()[c(397)]().setGuestUserDataForKey(c(272),d);RSEngine.externalGameManager&&RSGame[c(275)]()[c(481)]()[c(370)]()!=RSGameTypes[c(231)]&&RSEngine.externalGameManager[c(221)](RSGame[c(275)]()[c(267)]()[c(397)]()[c(148)]())},addPrimaryCurrencyForDisplay:function(a,b,c){var d=a0_0x26779a;a==d(312)&&Math.abs(b);a=parseInt(RSGame[d(275)]()[d(267)]()[d(397)]()._dataHolder.coins); a+=b;RSGame[d(275)]()[d(267)]()[d(397)]()[d(155)].coins=a;0>b&&!c&&RSGame[d(275)]()[d(267)]().addPaidCoins(b);RSGame[d(275)]().getGameManager()[d(370)]()!=RSGameTypes[d(231)]&&RSGame[d(275)]()[d(377)]()[d(146)](b)},addXP:function(a){var b=a0_0x26779a;a=RSGame[b(275)]().getLevelManager()[b(139)](a);RSGame.getInstance().getUserDataManager().addXP(a);if(RSEngine[b(147)]===LOGIN_MODE[b(249)]){var c=parseInt(RSGame[b(275)]().getUserDataManager()[b(397)]().getGuestUserDataForKey("xp")),c=c+parseInt(a); RSGame[b(275)]()[b(267)]().getMe()[b(381)]("xp",c)}},getXP:function(){var a=a0_0x26779a;return RSGame[a(275)]()[a(267)]()[a(397)]()[a(123)]()},triggerButtonClickEvent:function(a,b){var c=a0_0x26779a;switch(b){case RS_CASINO_BUTTON[c(263)]:break;case RS_CASINO_BUTTON[c(189)]:break;case RS_CASINO_BUTTON[c(354)]:break;case RS_CASINO_BUTTON[c(420)]:break;case RS_CASINO_BUTTON[c(422)]:break;case RS_CASINO_BUTTON[c(423)]:break;case RS_CASINO_BUTTON[c(299)]:GlobalVars.isDealInProgress=!0;case RS_CASINO_BUTTON[c(287)]:case RS_CASINO_BUTTON[c(425)]:case RS_CASINO_BUTTON[c(444)]:}}, notifyBetAmountChangeToCasino:function(a){var b=a0_0x26779a;this._betAmount=a;RSPlacementManager[b(275)]()[b(413)](a);GlobalVars[b(121)]&&RSEngine[b(270)][b(129)]({type:b(320),amount:a})},triggerInterrupts:function(){var a=a0_0x26779a;1!=RSEngine[a(452)].getMe().getMonetizationCount()||!GameConfig[a(388)]||GlobalVars[a(443)]||RSEngine[a(452)][a(397)]()[a(324)]()&&RSEngine[a(452)][a(397)]()[a(226)]()||RSGame[a(275)]().getGameManager()[a(513)]()},notifyResultToCasino:function(a){var b=a0_0x26779a;GlobalVars[b(246)]= !1;var c=RSGame[b(275)]().getGameManager()[b(370)](),d=RSAnalyticsManager.getInstance().getCurrentMachineAnalyticsName();this._lastEventUpdatedTime=TimeManager[b(275)]()[b(333)]();switch(c){case RSGameTypes[b(322)]:URLConfig.CLEVERTAP_ENABLED&&GlobalVars.isFirstSpinOnMachine&&(GlobalVars.isjackpotLoaded?RSPlatformSDKManager[b(275)]().trackEvent(SDK_EVENT_TYPE.jackpotLoungeEngaged):GlobalVars[b(293)]?(RSPlatformSDKManager[b(275)]()[b(255)](SDK_EVENT_TYPE[b(350)]),RSPlatformSDKManager[b(275)]()[b(484)](!0)): RSPlatformSDKManager.getInstance()[b(255)](SDK_EVENT_TYPE.pokerPlayed),GlobalVars[b(358)]=!1);RSGame.getInstance()[b(267)]()[b(397)]()[b(323)](d);RSGame[b(275)]()[b(267)]().getMe()[b(545)](RSGameTypes[b(322)]);RSGame.getInstance()[b(267)]()[b(397)]().pokerStatsSetHighestWin(RSGameTypes[b(322)],a._totalWinAmount);var e=0;if(Array[b(250)](a._gameResult)&&0e&&(e=k[b(137)])}else for(f=0;fe&&(e=a[b(386)][f][b(137)]);this[b(460)](a);break;case RSGameTypes[b(231)]:RSGame[b(275)]().getUserDataManager().getMe().setFirstPlayed(RSGameTypes[b(231)]);GameConfig.LEADERBOARD_ENABLED&&a[b(386)].primaryCurrencyOffset&&RSLeaderboard[b(234)](a[b(386)].primaryCurrencyOffset);break;case RSGameTypes.Blackjack:g=e=0;if(a._gameResult instanceof Array)for(f=0;f TimeManager[g(275)]()[g(333)]()?!1:!0;this[g(542)]||GlobalVars[g(526)]||RSGame[g(275)]()[g(481)]()[g(340)]()||!c||RSGame[g(275)]()[g(481)]()[g(488)]()||(c=g(424),RSAnalyticsManager[g(275)]()[g(133)](),RSNetworkManager[g(275)]()[g(225)](c),RSGame[g(275)]()[g(267)]().stopAllServiceCalls());break;case g(401):b==g(276)&&RSCasinoManager.getCasinoHUD()[g(259)]();break;case g(518):RSAnalyticsManager[g(275)]()[g(190)](b);RSCasinoManager[g(468)]()[g(252)]();break;case "RS_KENO_BONUS_GAME_INITIATED":RSAnalyticsManager[g(275)]()[g(190)](b); RSCasinoManager[g(468)]()[g(252)]();break;case g(193):this[g(210)]=c;break;case g(191):RSAnalyticsManager[g(275)]().trackDONLose(RSAnalyticsManager[g(275)]()[g(428)](),b);break;case g(393):break;case g(167):!RSGame[g(275)]()[g(267)]().getMe()[g(149)]()&&RSGame[g(275)]()[g(267)]()[g(397)]()[g(291)](!0);RSGame[g(275)]()[g(267)]().getMe().setMachineFUEBonusTriggered(b);RSAnalyticsManager.getInstance().trackCommonSysOpsEvent(g(140),"","",b,"");break;case g(493):!RSGame[g(275)]().getUserDataManager()[g(397)]().getFUEBonusStatus()&& RSGame[g(275)]()[g(267)]()[g(397)]()[g(291)](!0);RSGame.getInstance().getUserDataManager()[g(397)]()[g(156)](c);RSAnalyticsManager.getInstance().trackCommonSysOpsEvent(g(240),b?"forced":g(476),"",c,"");break;case g(174):RSAnalyticsManager[g(275)]()[g(131)](g(376),b,c,e,d);break;case g(519):RSErrorTracker[g(275)]()[g(408)](b,c,g(248));break;case "currentScreenName":if(b==g(273)){RSGameScreenManager[g(275)]().setPreviousScreen(b);RSEngine[g(359)].removeOverlay();d=document[g(457)](g(522));c=0.102*parseInt(d[g(528)][g(432)].substring(0, d.style[g(432)][g(217)]-2))+"px";var h=parseInt(d.style[g(171)][g(440)](0,d[g(528)][g(171)][g(217)]-2))+parseInt(d[g(528)][g(351)].substring(0,d[g(528)].paddingLeft.length-2))+"px";d=d[g(528)][g(432)];RSEngine[g(270)][g(126)](g(394),c,h,d);d=null}else GlobalVars[g(121)]&&RSEngine[g(270)][g(129)]({type:"updateCoinBalance",level:RSGame[g(275)]()[g(267)]()[g(397)]()[g(426)](),coinBalance:RSGame.getInstance()[g(267)]()[g(397)]()[g(148)]()}),RSGameScreenManager.getInstance()[g(201)](b),RSEngine[g(270)]._machineParams._ignoreResizeForHud= !0,RSEngine.externalGameManager[g(265)](),RSEngine[g(270)][g(126)](0);break;case "player_action_lobby_entry":RSAnalyticsManager[g(275)]()[g(482)](c);RSAnalyticsManager[g(275)]()[g(314)](c);break;case g(186):RSAnalyticsManager.getInstance()[g(380)]("",b,c,"");break;case "player_action_session_stop":RSAnalyticsManager[g(275)]()[g(169)](c,"");break;case g(473):RSAnalyticsManager[g(275)]()[g(342)](b,"");break;case g(119):GlobalVars.isjackpotLoaded&&(""!=b?RSEngine.externalGameManager._machineParams[g(317)]= b:RSEngine[g(270)][g(173)][g(317)]=RSGame.getInstance()[g(481)]()[g(391)]()[g(310)]);break;case g(339):RSAnalyticsManager.getInstance()[g(455)]("jackpot_lounge",b,c,d,e);if(b==g(161)){var k=RSCasinoManager[g(468)]();k&&(c==g(232)&&(k[g(229)]=!1),c==g(451)&&(k[g(229)]=!0),"click"==c&&d==g(363)&&RSGame[g(275)]().getGameManager()[g(182)]())}if(b==g(539))SideMenuController[g(275)]()[g(170)]();else b==g(461)&&SideMenuController[g(275)]()[g(252)]();break;case "player_action_jackpot_lounge":b[1]==g(530)&& RSEngine.dataManager[g(219)]();RSAnalyticsManager[g(275)]().trackPlayerAction[g(218)](RSAnalyticsManager[g(275)](),b);break;case g(295):RSAnalyticsManager[g(275)]().trackGUIEvent(g(368),g(295),b,c,d);break;case "enableBackButtonInTutorial":(k=RSCasinoManager[g(468)]())&&(k.disableHudForJackpotTutorial=!1,k.disableAllButtons(),k[g(259)]());break;case "getCurrentServerTime":RSEngine[g(270)][g(129)]({type:g(298),value:TimeManager[g(275)]()[g(333)]()});break;case g(435):RSEngine[g(270)][g(129)]({type:g(435), accessToken:RSEngine.loginMode==LOGIN_MODE[g(427)]||RSEngine[g(147)]==LOGIN_MODE.WEB_FACEBOOK?RSGame[g(275)]()[g(481)]()[g(162)]():"",facebookID:RSEngine[g(147)]==LOGIN_MODE[g(427)]||RSEngine[g(147)]==LOGIN_MODE[g(286)]?RSFBManager[g(275)]()[g(134)]():"",newUser:!RSEngine[g(452)][g(397)]()[g(555)](),vipLoungeShown:RSEngine[g(452)][g(397)]()[g(330)](),jackpotProbabilityBoosted:RSEngine[g(452)][g(397)]().getJackpotProbabilityBoosted()});break;case g(382):RSEngine[g(270)][g(129)]({type:g(349),vipTier:parseInt(RSVIPManager[g(275)]()[g(215)]()), vipUnlockShown:RSEngine[g(452)].getMe()[g(220)]()});break;case g(296):c={};for(d=0;d=h?0c;c++){var d=RSUtils.createBasicObject(a,b);d.setVisible(!1);d.setPosition(this._loadingStripPostition[c].x,this._loadingStripPostition[c].y+ d.getRect().getHeight()/2);this._loadingStrip.push(d)}break;case "BorderMask":c=RSUtils.createBasicObject(a,b);this.mask=new RSClippingNode(c);this.mask.setAlphaThreshold(10);for(c=0;3>c;c++)d=this.mask.convertToNodeSpace(this._loadingStripBlur[c].getRect().getX(),this._loadingStripBlur[c].getRect().getY()),this._loadingStripBlur[c].setPosition(d.getX(),d.getY()),this._loadingStrip[c].setPosition(d.getX(),d.getY()),this.mask.addChild(this._loadingStripBlur[c]),this.mask.addChild(this._loadingStrip[c]); this.addChild(this.mask);break;case "StripBlur":for(c=0;3>c;c++)d=RSUtils.createBasicObject(a,b),d.setPosition(this._loadingStripPostition[c].x,this._loadingStripPostition[c].y+d.getRect().getHeight()/2),this._loadingStripBlur.push(d);break;case "StreakAnim":this._streakAnim=RSUtils.createAnimation(a,b,0.4);this._streakAnim.setX(this._progressBar.getX()-this._streakAnim.getSize().getWidth());this.addChild(this._streakAnim);break;default:this._super.createCustomObject.call(this,a,b)}switch(b.type){case "LoadingStrip":this._loadingStripPostition.push(b)}}, onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);this._animationSequencerObject=new RSAnimationSequencer("res/LoadingScreen/LoadingAnimationConfig/","LoadingAnimationConfig.json",this,this);this._animationSequencerObject.loadAnimData()},onReveal:function(){document.getElementsByClassName("gameCanvas")[0].style.visibility="visible";var a=document.getElementById("loader");null!=a&&(a.innerHTML="");this.startPreload();this.bypassSplashScreen()},onHourlyBonusTimeUpdated:function(a){this._hourlyBonusUpdated= !0;this.loadingComplete()},onHourlyBonusTimeFetchFailed:function(){RSErrorTracker.getInstance().trackErrorMessage("SERVER_RESPONSE","Failed to fetch hourly bonus time","mahesh.jose@rubyseven.net,lijith.puthiyoottil@rubyseven.net");RSEngine.dataManager.updateHourlyBonusTime(this.onHourlyBonusTimeUpdated.bind(this),this.onHourlyBonusTimeFetchFailed.bind(this))},_initializeDailyBonusWidget:function(){var a=[{name:RSGame.getInstance().getAssetPath("DailyBonusScreen"),count:1},{name:RSGame.getInstance().getAssetPath("DailyBonusBaseWidget"), count:1}],a=new DailyBonusWidgetModel(a,"dailyBonusConfig"),b=new DailyBonusWidgetView("DailyBonusScreen");this._dailyBonusWidgetController=new DailyBonusWidgetController(a,b,"DailyBonusScreen");RSWidgetsManager.getInstance().addController(this._dailyBonusWidgetController,"DailyBonusScreen");this._dailyBonusWidgetController.setDelegate(this)},onDataFetchingSuccess:function(a){this._dataFetchingSuccess=!0;this.loadingComplete()},onDefaultDataLoadCompleted:function(){RSEngine.initializeExternalGameManager(); RSGame.getInstance().getPlatformEventManager().initializePlatformEventsManager();RSGame.getInstance().getGameManager().getApiTokenValues();var a={};a.assetPath=[{name:RSGame.getInstance().getAssetPath("LosingStreakPopup"),count:2}];a.fonts={CREDITS_FONT:RSGame.getInstance().getGameManager().getDefaultCasinoFont("largePurple","normal"),INFO_FONT:RSGame.getInstance().getGameManager().getDefaultCasinoFont("largePurple","bold")};RSGame.getInstance().getLosingStreakManager().initializeLosingStreakManager(a); if(RSEngine.loginMode==LOGIN_MODE.GUEST)this.onDailyBonusStatusCheckSuccess();else PurchaseFlowManager.getInstance().getActiveSubscriptionSale(),this._initializeDailyBonusWidget(),this.initializeGifting();VideoManager.getInstance().initialiseManager();VideoManager.getInstance().disableAdsManager();RSEngine.loginMode!=LOGIN_MODE.GUEST?HourlyBonusManager.getInstance().updateHourlyBonusStatus(this.onHourlyBonusTimeUpdated.bind(this),this.onHourlyBonusTimeFetchFailed.bind(this)):(HourlyBonusManager.getInstance().setDefaultValuesForFullGuestUsers(), this.onHourlyBonusTimeUpdated(null));RSEventManager.getInstance().addEventListener(RSVIPSyncEvent,this,this._vipInitialized.bind(this));RSVIPManager.getInstance().initializeVIPManager(RSEngine.gameData.getVIPGameData(),RSEngine.gameData.getVIPPurchaseData());GlobalVars.isPurchaseEnabled=RSGame.getInstance().getGameVariable().isPurchaseEnabled();GameConfig.LEADERBOARD_ENABLED&&(RSLeaderboardManager.initializeLeaderboard(),RSRewardManager.initializeRewardManager());RSGame.getInstance().getGameManager().initializeQuest(); RSGame.getInstance().getGameVariable().getSweepstakeEnabledStatus()&&(a={NORMAL_TEXT:RSGame.getInstance().getGameManager().getDefaultCasinoFont("largePurple","normal"),WIN_TEXT:RSGame.getInstance().getGameManager().getDefaultCasinoFont("largePink","normal"),REWARD_TEXT:RSGame.getInstance().getGameManager().getDefaultCasinoFont("largePink","bold"),NORMAL_TIMER:RSGame.getInstance().getGameManager().getHUDCasinoFont("large","bold"),BIG_TIMER:RSGame.getInstance().getGameManager().getDefaultCasinoFont("largePurple", "bold"),INPUTBOX_TEXT:"Source Sans Pro",HISTORY_FONT:RSGame.getInstance().getGameManager().getDefaultCasinoFont("medium","normal")},RSSweepstakesManager.initializeCataboomManager(a,RSEngine.gameData.getDefaultValues().sweepstakesRulesUrl));GameConfig.SUBSCRIPTION_ENABLED&&(RSSubscrptionSaleManager.initializeSubscriptionData(this.onDataFetchingSuccess.bind(this)),RSSaleManager.getInstance().setSaleFont(RSGame.getInstance().getAssetPath("SourceSans_largePurple_normal"),SaleFontType.SUBSCRIPTION));RSTournamentManager.initializeTournamentManager()}, initializeGifting:function(){if(GameConfig.GIFTING_ENABLED&&RSEngine.loginMode!=LOGIN_MODE.GUEST){var a={};a.textFont=RSGame.getInstance().getAssetPath("SourceSans_SemiBold_40");a.rewardFont=RSGame.getInstance().getAssetPath("SourceSansBlue_Bold_60");a.subTitleFont=RSGame.getInstance().getAssetPath("SourceSans_largePurple_bold");a.emailConnectFont="Source Sans Pro";a.scaleFactor=0.62;a.rewardFontAlignment=kTEXT_ALIGNMENT_LEFT;RSGiftingManager.getInstance().initializeGiftingManager(a)}},onPreloadProgress:function(){if(!1!= this._isSplashShown){if(null!=this._progressBar){try{var a=this._progressBar.getSize()}catch(b){RSErrorTracker.getInstance().trackErrorMessage("LOADING_ERROR","on fetching progress bar getSize call "+b,"mahesh.jose@rubyseven.net,lijith.puthiyoottil@rubyseven.net")}var c=this._progressBarUpdateFactor*(0.5*this._artProgress+this._dataProgress);0LATEST_BLOB_VERSION?this[a(415)]():LATEST_BLOB_VERSION},addGuestItems:function(){var a=a0_0x213c41,b=this[a(393)]();b&&(b[a(357)]=0,b.xp=0,b[a(334)]={},b[a(369)]=!1,b.quests={},b[a(377)]="")},setBlobForGuest:function(){var a=a0_0x213c41;this[a(390)][a(372)].call(this);RSEngine.loginMode==LOGIN_MODE[a(401)]?(this[a(300)][a(319)]=this[a(462)](a(319)),this._dataHolder[a(369)]=this[a(462)]("isCommonWelcomeBonusAwarded"),this[a(300)].piggyBankCoin=this.getGuestUserDataForKey(a(335)), this[a(300)][a(465)]=this[a(462)](a(465)),this[a(300)][a(285)]=this[a(462)]("levelXPOffset")):this[a(462)](a(350))&&this[a(360)]&&(this[a(300)].quests=this.getGuestUserDataForKey(a(319)),this._dataHolder.isCommonWelcomeBonusAwarded=this[a(462)](a(369)),this._dataHolder[a(335)]=this[a(462)](a(335))?this[a(462)](a(335)):0,this[a(300)].level=this.getGuestUserDataForKey("level")?this[a(462)](a(465)):1,this[a(300)][a(285)]=this[a(462)](a(285))?this.getGuestUserDataForKey(a(285)):0,this[a(321)]=this[a(462)](a(377)), this[a(418)]=this.getGuestUserDataForKey("LobbyName"),this[a(304)]=this[a(462)](a(296)),this[a(339)]=this[a(462)](a(303)),this[a(300)].xp=0>this[a(300)].xp?0:this[a(300)].xp)},getRewardedLevel:function(){var a=a0_0x213c41;return null==this[a(300)][a(361)]&&(this._dataHolder[a(361)]=1),parseInt(this[a(300)][a(361)])},setRewardedLevel:function(a){var b=a0_0x213c41;a&&(this[b(300)][b(361)]=parseInt(a))},setUserLevel:function(a){this[a0_0x213c41(300)].level=parseInt(a)},getCountryCode:function(){var a= a0_0x213c41;return 1==parseInt(RSGame[a(292)]()[a(308)]()[a(340)]().IsCountryCodeCheatEnabled)?"US":this[a(300)][a(293)]?this[a(300)][a(293)]:(cc.warn(a(348)),"")},getGuestMachineAnalyticsName:function(){return this[a0_0x213c41(304)]},getGuestSyncPopupName:function(){var a=a0_0x213c41;return this[a(339)]?this[a(339)]:""},getGuestGameType:function(){return this[a0_0x213c41(392)]},getGuestLastLobbyName:function(){return this[a0_0x213c41(418)]},getVIPTierUnlockPopupShown:function(){var a=a0_0x213c41; return null==this._dataHolder[a(451)]&&(this._dataHolder[a(451)]=0),parseInt(this[a(300)][a(451)])},setVIPTierUnlockPopupShown:function(a){var b=a0_0x213c41;this[b(300)][b(451)]=parseInt(a)},getCurrentDay:function(){var a=a0_0x213c41;return null==this._dataHolder[a(328)]&&(this[a(300)][a(328)]={day:0,session:0}),parseInt(this[a(300)][a(328)][a(373)])},setCurrentDay:function(a){var b=a0_0x213c41;null==this._dataHolder[b(328)]&&(this[b(300)][b(328)]={day:0,session:0});this[b(300)][b(328)].day=parseInt(a)}, getCurrentSession:function(){var a=a0_0x213c41;return null==this._dataHolder[a(328)]&&(this[a(300)].sessionDetail={day:0,session:0}),parseInt(this._dataHolder[a(328)].session)},setCurrentSession:function(a){var b=a0_0x213c41;null==this[b(300)].sessionDetail&&(this._dataHolder[b(328)]={day:0,session:0});this[b(300)][b(328)][b(402)]=parseInt(a)},isUserBanned:function(){var a=a0_0x213c41,b=!1;return this[a(300)][a(371)]&&parseInt(this[a(300)][a(371)])&&(b=!0),b},getMachineUnlockList:function(a){return this._dataHolder[a0_0x213c41(291)+ parseInt(a+1).toString()]},setMachineUnlockList:function(a,b){var c=a0_0x213c41;isNaN(b)||(this[c(300)]["machineUnlocks"+parseInt(a+1)[c(368)]()]=b)},setPlatformAndVersion:function(a){var b=a0_0x213c41,c=this[b(300)][b(353)],d,e=this[b(300)][b(425)];null==c&&(this[b(300)][b(353)]=[],c=this[b(300)][b(353)]);null==this[b(300)][b(425)]&&(this[b(300)].platformVersions={},e=this._dataHolder[b(425)]);RSEngine[b(435)]==LOGIN_MODE.FACEBOOK?d=b(315):d=b(359);GlobalVars[b(289)]&&(d=b(336));RSEngine[b(435)]!= LOGIN_MODE.EMAIL&&RSEngine[b(435)]!=LOGIN_MODE[b(401)]||(GlobalVars[b(422)]=!1);-1==c[b(370)](d)&&c[b(332)](d);e[d]=a;this._dataHolder[b(425)]=e;this[b(300)][b(299)]=d},lastTapBlastClaimedTime:function(){var a=a0_0x213c41;return null==this._dataHolder[a(426)]&&(this[a(300)][a(426)]=0),this[a(300)][a(426)]},tapBlastCollectedCount:function(){var a=a0_0x213c41;return null==this._dataHolder[a(405)]&&(this[a(300)][a(405)]=0),this._dataHolder[a(405)]},getRetentionCount:function(){var a=a0_0x213c41;return null== this[a(300)][a(444)]&&(this[a(300)][a(444)]=0),this._dataHolder[a(444)]},getSavedPaidCoins:function(){var a=a0_0x213c41;return null==this[a(300)][a(438)]&&(this[a(300)][a(438)]=0),this[a(300)].paidCoins},addPowerUps:function(a,b){var c=a0_0x213c41;null==this[c(300)].powerUps&&(this[c(300)][c(334)]={});var d=this._dataHolder[c(334)];null==d[a]&&(d[a]=0);d[a]+=b;this[c(300)][c(334)]=d;0>=this[c(300)][c(334)][a]&&(this[c(300)].powerUps[a]=0)},setMachinesPlayed:function(a){var b=a0_0x213c41;a=RSEngine.gameData[b(437)](a); -1==this._dataHolder.pokerStats[b(461)][b(370)](a)&&this._dataHolder.pokerStats[b(461)][b(332)](a)},getMachinesPlayed:function(){var a=a0_0x213c41;return 0==this._dataHolder[a(411)].machines_played[a(456)]?0:this[a(300)][a(411)].machines_played[a(456)]},pokerStatsSetHighestWin:function(a,b){var c=a0_0x213c41;this[c(300)][c(411)].highest_wine&&(e=b[f],d=f);return c=RSEngine[a(463)][a(365)](d),null!=c?c[a(302)]:"NA"}return"NA"},getUserLevel:function(){var a=a0_0x213c41;return RSGame[a(292)]()[a(429)]()&&RSGame[a(292)]()[a(429)]().getCurrentLevelVO()&&!RSGame.getInstance()[a(333)]()[a(399)]()?RSGame[a(292)]().getLevelManager()[a(382)](): this[a(300)]&&this[a(300)][a(465)]?this[a(300)][a(465)]:this[a(390)][a(323)](this)},setSlotWin:function(a){var b=a0_0x213c41;null!=this[b(300)].slotsStats[b(458)]&&void 0!=this[b(300)][b(386)][b(458)]||(this[b(300)][b(386)][b(458)]=0);a>this._dataHolder[b(386)][b(458)]&&!GlobalVars[b(397)]&&(this[b(300)][b(386)][b(458)]=a)},getSpins:function(){var a=a0_0x213c41;return(null==this[a(300)][a(386)][a(343)]||void 0==this._dataHolder[a(386)][a(343)])&&(this[a(300)][a(386)][a(343)]={}),this[a(300)].slotsStats[a(343)]}, getTournamentsWon:function(){var a=a0_0x213c41;return(null==this._dataHolder.slotsStats[a(381)]||void 0==this[a(300)][a(386)][a(381)])&&(this[a(300)][a(386)].tournaments_won=0),this[a(300)].slotsStats[a(381)]},setSpins:function(a){var b=a0_0x213c41;null!=this._dataHolder.slotsStats[b(343)]&&void 0!=this._dataHolder[b(386)][b(343)]||(this[b(300)][b(386)][b(343)]={});(this[b(396)](a)||this[b(316)](a))&&!GlobalVars.isTournamentLoaded&&((null==this[b(300)].slotsStats.slotmachine_spins[a]||void 0==this[b(300)][b(386)][b(343)][a])&& (this[b(300)][b(386)][b(343)][a]=0),this[b(300)][b(386)][b(343)][a]+=1,this[b(288)](a))},setDailyBonusPickedTime:function(a){var b=a0_0x213c41;this[b(300)].dailyBonusPickedTime=Math[b(442)](a)},setHourlyBonusPickedTime:function(a){var b=a0_0x213c41;this[b(300)][b(387)]=Math.round(a)},getLastPurchasedPack:function(){var a=a0_0x213c41;return void 0==this[a(300)][a(449)]&&(this[a(300)][a(449)]=a(408)),this._dataHolder[a(449)]},setLastPurchasePack:function(a){this[a0_0x213c41(300)].lastPurchasedPack= a},getPuchaseCartExitCount:function(){var a=a0_0x213c41;return(void 0==this[a(300)].exitCount||isNaN(this[a(300)][a(464)]))&&(this[a(300)][a(464)]=0),this[a(300)].exitCount},setPuchaseCartExitCount:function(a){var b=a0_0x213c41;this[b(300)][b(464)]=a},getVipMachineUnlocked:function(){var a=a0_0x213c41;return null==this._dataHolder[a(341)]&&(this._dataHolder[a(341)]=1),this[a(300)][a(341)]},getSalePurchaseData:function(){var a=a0_0x213c41;return null==this[a(300)][a(443)]&&(this[a(300)].saleData={}), this[a(300)].saleData},setSalePurchaseData:function(a){this._dataHolder.saleData=a},getDaubAlertTime:function(){var a=a0_0x213c41;return this[a(300)][a(460)]},setDaubAlertTime:function(a){var b=a0_0x213c41;this[b(300)][b(460)]=a},getLevelXPOffset:function(){return this[a0_0x213c41(300)].levelXPOffset||0},setLevelXPOffset:function(a){var b=a0_0x213c41;RSEngine[b(435)]===LOGIN_MODE[b(401)]&&RSGame[b(292)]()[b(287)]()[b(349)]()[b(406)](b(285),a);this[b(300)][b(285)]=a},setLevelFactor:function(a){this._dataHolder.levelFactor= a},getLevelFactor:function(){var a=a0_0x213c41;return this[a(300)][a(345)]||0},setClubMUpdateStatus:function(a){this[a0_0x213c41(300)].clubMUpdateStatus=a},getPlayerConnectUpdateStatus:function(a){a=a0_0x213c41;return this._dataHolder[a(318)]?this._dataHolder[a(318)]:!1},setClubMNumber:function(a){this._dataHolder[a0_0x213c41(301)]=a},setClubMLastName:function(a){var b=a0_0x213c41;this[b(300)][b(428)]=a},getSlotsLastPlayedMachines:function(){var a=a0_0x213c41;return(null==this._dataHolder[a(386)][a(310)]|| void 0==this[a(300)].slotsStats[a(310)])&&(this[a(300)][a(386)][a(310)]=[]),this[a(300)].slotsStats[a(310)]},setSlotsLastPlayedMachines:function(a){var b=a0_0x213c41;null!=this._dataHolder.slotsStats[b(310)]&&void 0!=this[b(300)][b(386)][b(310)]||(this[b(300)][b(386)][b(310)]=[]);var c=this[b(300)].slotsStats[b(310)];0==c.length?c[b(332)](a):c[c.length-1]!=a&&(2==c[b(456)]?(c.push(a),c[b(450)](0,1)):c.push(a));this._dataHolder[b(386)][b(310)]=c},syncBlobVars:function(a){var b=a0_0x213c41;this[b(390)].syncBlobVars.call(this, a);RSEngine[b(305)][b(423)]({type:"updateCoinBalance",level:RSEngine[b(414)].getMe().getUserLevel(),coinBalance:RSEngine[b(414)][b(349)]()[b(380)]()})},setPiggyBankValue:function(a){var b=a0_0x213c41;this[b(300)][b(335)]=a;RSEngine[b(435)]==LOGIN_MODE[b(401)]&&this[b(406)](b(335),a)},setAvatar:function(a){this._dataHolder[a0_0x213c41(413)]=a},getAvatar:function(){var a=a0_0x213c41;return this._dataHolder.avatar&&(1!=this[a(300)][a(413)]||RSEngine[a(435)]!=LOGIN_MODE[a(384)]&&RSEngine.loginMode!=LOGIN_MODE[a(344)])? this._dataHolder[a(413)]:0},getProfileStatusValue:function(a){var b=a0_0x213c41;switch(a){case b(352):return this[b(352)]();case "getSpins":return this.getSpins();case b(433):return RSGame.getInstance().getGameManager()[b(433)](RSGameTypes[b(391)]);case b(367):return this[b(367)]();case b(445):return this[b(445)]();case b(412):return this[b(412)]();case b(356):return this[b(356)]();case b(297):return this[b(297)]();case b(325):return this[b(325)]();case b(314):return this[b(314)]();case b(454):return this[b(454)](); case b(439):return this[b(439)]();case b(374):return RSGame[b(292)]()[b(398)]()[b(374)](RSGameTypes[b(419)]);default:return 0}},setPreviousTierData:function(a){this._dataHolder[a0_0x213c41(421)]=a},getPreviousTierData:function(){return this._dataHolder[a0_0x213c41(421)]},getRemoteAddress:function(){return this._dataHolder[a0_0x213c41(324)]},setVIPTooltipShownTime:function(a){var b=a0_0x213c41;this[b(300)][b(403)]=a},getVIPTooltipShownTime:function(){return this._dataHolder[a0_0x213c41(403)]}}); function a0_0x4d76(){var a="monetization_factor;activity_count;pokerStats;getBingoCardsWon;avatar;dataManager;getBlobVersion;scoreboxResultsDisplayed;33190HfLOxU;_guestLastLobbyName;Scratcher;machineUnlocks7;previousTier;enableShare;postMessageToJackpot;unlockedGifts;platformVersions;lastTapBlastClaimedTime;_initialXP;clubMLastName;getLevelManager;isVikingLoungePopupShown;bingoStats;getCurrentServerTime;getMachinesPlayed;previousPurchaseDate;loginMode;machinesPlayedDetails;getPokerMachineTypeByName;paidCoins;ScratcherStatsGetHighestWin;2701732zzANPX;bingoroom_cards_count;round;saleData;retentionCount;getPokerDealCount;isVipSurfacingShown;joiningDate;dailyBonusPickedTime;lastPurchasedPack;splice;vipTierUnlockedShown;kenoroom_draws;virality_count;getBlackjackDealCount;7046305yPEGBK;length;blackjackTutorialsShown;highest_win;extend;daubAlertTime;machines_played;getGuestUserDataForKey;gameData;exitCount;level;levelXPOffset;lastPlayedTournamentID;getUserDataManager;setSlotsLastPlayedMachines;isWindowsPWA;isLoyaltyEligiblePopupShown;machineUnlocks;getInstance;countryCode;machineUnlocks2;levelUnlocks;AnalyticsMachineName;kenoStatsGetHighestWin;3UwDgsE;currentPlatform;_dataHolder;clubMNumber;machineDisplayName;PopupName;_guestMachineAnalyticsName;externalGameManager;triggerLmSurfacing;8445080NPkXIr;getGameData;activity_factor;last_played;isLMAnnouncementShown;cumulativeSpinsForFUE;lastPlayedMachineDetails;getBlackajackWonStats;canvas;isMachineFeatured;_initialCoins;clubMUpdateStatus;quests;isSubscriptionToolTipShown;_guestMachineType;isSubscriptionAfterFirstPurchaseShown;getUserLevel;remoteAddress;getKenoDealCount;tournamaniaSurfacingShown;isFBLoginBonusAwarded;sessionDetail;machineUnlocks5;blackjackStats;pokerroom_deals;push;getLoadingManger;powerUps;piggyBankCoin;ms_store;customLoungePopupShown;lastPurchaseTime;_guestSyncPopupName;getDefaultValues;vipMachineUnlocked;9hNglQk;slotmachine_spins;FACEBOOK;levelFactor;1102824GPsUzK;708SzmSBG;Country Code not Set!;getMe;firstLogin;call;getSlotWin;applicationPlatforms;isSSOLoginBonusAwarded;kenoStats;getBingoRoomCardCount;coins;1581812dZcRLT;web;_firstSignIn;rewardedLevel;blackjackroom_deals;rouletteStats;_isFreshUser;getBingoMachineDetailsbyName;machineUnlocks1;pokerStatsGetHighestWin;toString;isCommonWelcomeBonusAwarded;indexOf;userBanned;setBlobForGuest;day;getScratcherRounds;455686gHscjt;_monetisation_count;gameType;_xpOffset;init;getCoins;tournaments_won;getCurrentLevel;_paidCoins;WEB_FACEBOOK;_monetisation_factor;slotsStats;hourlyBonusPickedTime;virality_factor;localSessionData;_super;Poker;_guestGameType;getGuestUserData;completedFUEBonus;lastLogin;isMachineUnlocked;isTournamentLoaded;getGameManager;getGameReLoadingScreenStatus;number_of_blackjacks;GUEST;session;upgradeVIPTooltipShownTime;total_bingos_won;tapBlastCollectedCount;setGuestUserDataForKey;machineUnlocks3;null".split(";"); a0_0x4d76=function(){return a};return a0_0x4d76()};function a0_0x3172(a,b){var c=a0_0x1f5f();return a0_0x3172=function(a,b){return c[a-192]},a0_0x3172(a,b)}var a0_0x11dda5=a0_0x3172;(function(a,b){for(var c=a0_0x3172,d=a();;)try{if(parseInt(c(198))/1*(-parseInt(c(205))/2)+-parseInt(c(206))/3*(-parseInt(c(208))/4)+parseInt(c(210))/5*(-parseInt(c(197))/6)+parseInt(c(209))/7+parseInt(c(192))/8+parseInt(c(201))/9+-parseInt(c(213))/10===b)break;else d.push(d.shift())}catch(e){d.push(d.shift())}})(a0_0x1f5f,203872); var CasinoUserDataManager=RSUserDataManagerV2[a0_0x11dda5(193)]({init:function(a,b){this._super.init[a0_0x11dda5(202)](this,a,b)},createUser:function(a,b){return new CasinoUser(a,b)},webSignUp:function(a,b,c,d){var e=a0_0x11dda5,f=[];f[0]=a;f[1]=b;GameConfig[e(203)]?(a=RSLoginManager[e(196)]()[e(194)](GameConfig[e(200)]+"-blobId"),f[2]=d?d:"",f[3]=a?a:"",f[4]="",f[5]=RSEngine[e(215)]==PLATFORM.MOBILE?e(207):e(214),f[6]=GameConfig[e(199)]):(f[2]=RSEngine[e(215)]==PLATFORM[e(204)]?e(207):"html5",f[3]= GameConfig[e(199)]);d=[];d[0]=f[0];d[1]=f[1];d[2]=f[2];d[3]=f[3];d[4]=f[5];d=RSUtils[e(211)](d);f[7]=d;RSEngine.networkManager[e(212)](e(195),f,c)}}); function a0_0x1f5f(){var a="sendJSONRPCRequestSync 2574550nQCUxu html5 platform 1413248ftZODO extend getCookie Web.signup getInstance 762QGuUEx 5833JmJomW VERSION COOKIE_PREFIX 2920725RpHqae call SSO_ENABLED MOBILE 74nKrOiY 231HPXHZx mobile 10396GptutE 637231hWSpJB 4535YPQoEN getHashValue".split(" ");a0_0x1f5f=function(){return a};return a0_0x1f5f()};var GameDataUtil={SlotMachineDetails:null,BonusFactor:null,CollectibleDetails:null,CollectibleRoomDetails:null,SpinWheelDetails:null,RewardDetails:null,DefaultValues:null,LevelSheetData:null,VIPPurchaseData:null,VIPData:null},CasinoGameData=RSGameData.extend({_coinPack:null,_powerupPack:null,getPokerMachineDetailsByCategory:function(a){for(var b=this.getSheetData("pokermachines"),c=[],d=0;db);e++)d=parseInt(c[e][a]);return d},getKenoBetStructureByName:function(a,b){var c=this.getSheetData("machineBets"),d=[];if(GlobalVars.isjackpotLoaded)d.push(parseInt(c[c.length-1][a]));else for(var e in c)b>=c[e].levels&&d.push(parseInt(c[e][a]));return d},getSpinBetStructureByName:function(a,b){GlobalVars.isjackpotLoaded&&(b=9999999);return this._super.getSpinBetStructureByName.call(this, a,b)},getMinimumBetByGameTypeAndName:function(a,b){var c=0;switch(a){case RSGameTypes.Slots:2==b.gameType?(c=this.getAristocratMachineMinBetRow(b.machineData_identifier),c=this.getSlotBetStructureByName(b.machine_identifier)[c]*b.payLines):c=this.getSlotBetStructureByName(b.machine_identifier)[0]*b.payLines;break;case RSGameTypes.Bingo:return this.getBingoMinimumBetRoomValue();case RSGameTypes.Blackjack:return this.getMinChipValueForBlackJack(b.machine_identifier);case RSGameTypes.Keno:c=this.getSheetData("machineBets")[0][b.machine_identifier]; break;case RSGameTypes.Poker:switch(b.gameCategory){case "RSP":c=this.getSheetData(b.betStructure)[0].value;break;case "MSP":c=4*this.getSheetData(b.betStructure)[0].value;RSUtils.isStringContains(b.machine_identifier,"MSPT_")&&(c*=3);break;case "MPP":c=5*this.getSheetData(b.betStructure)[0].value;break;case "DOD":c=this.getSheetData(b.betStructure)[0].value}break;case RSGameTypes.Scratcher:c=RSGame.getInstance().getGameData().getDefaultBetForCasino("scratcherBetValues",b.machine_identifier);break; case RSGameTypes.Roulette:return RSGame.getInstance().getGameData().getRouletteBetStructureByName(b.machine_identifier,RSGame.getInstance().getLevelManager().getCurrentLevel())}return parseInt(c)}});var PowerupPacksVO=RSVO.extend({init:function(a){this.type=this.name=this.id="";this.value=0;this.symbol="";this.quantity=0;this.analyticsID=this.inAppID=this.newPowerups=this.powerups=this.feedImageURL="";this.isCredit=0;this._super.init.call(this,a)}});var counter=0,MAINLOBBY_STATE={USER_BAN:counter++,WELCOME_BONUS:counter++,WEBSTORE_PURCHASE:counter++,URL_NOTIFICATION:counter++,DAILY_BONUS:counter++,GENERAL_MAINLOBBY_INITIALIZATION:counter++,ANIMATE_MAINLOBBY:counter++,LOGIN_STREAK_BONUS:counter++,EMAIL_VERIFICATION_SUCCESS_PROMPT_SOCIAL_LOGIN_SUCCESS:counter++,LOC_OOC_REWARD:counter++,SWEEPSTAKES_SURFACING:counter++,TOURNAMANIA_CURTAINRAISER:counter++,CURTAIN_RAISER:counter++,VIP_LM_SURFACING:counter++,JL_SURFACING:counter++,SCOREBOX_POPUP:counter++, LEADERBOARD_REWARD:counter++,TOURNAMENT_REWARD:counter++,SWEEPSTAKES_ANNOUNCEMENT_POPUP:counter++,AVATAR_POPUP:counter++,LOGIN_SUCCESS:counter++,SOCIAL_LOGIN_REWARD_FOR_FB_LOGIN:counter++,SHOW_MAINLOBBY:counter++,SHOW_DQ_POPUP:counter++,SUBSCRIPTION_SALE_POPUP:counter++,SALE_POPUP:counter++,SUBSCRIPTION_SALE_POPUP_AFTER_NPS:counter++,VIP_POPUP:counter++,REWARD_REMINDER:counter++,SUBSCRIPTION_INTERRUPT_POPUP:counter++,VIP_TOOLTIP:counter++,TOURNAMENT_ANNOUNCEMENT:counter++,LOADING_COMPLETE:counter++}, MainLobby=RSCasinoScreen.extend({init:function(){this._topHud=this.bottomHud=this.tableGamesButton=this._scratchersNewTag=this._tableGamesNewTag=this._kenobingoNewTag=this._kenoButtonAnimation=this._kenoButton=this._pokerNewTag=this._scratcherButtonAnimation=this._tableGamesButtonAnimation=this._pokerButtonAnimation=this._scratcherButton=this._pokerButton=this._slotNewTag=this._slotButtonAnimation=this._slotButton=null;this._isSSOReInitSession=this.isEmailVerifiedCheckForSkippingTransition=GlobalVars.mainLobbyInitialized= !1;this._initialLoading=!0;this._currentState=0;RSGame.getInstance().getLoadingManger()&&(50==RSGame.getInstance().getLoadingManger().getProgressPercentage()&&(this._initialLoading=!1),RSGame.getInstance().getLoadingManger().getGameReLoadingScreenStatus()&&(this._initialLoading=this._isSSOReInitSession=!0));this._dailyBonusWidgetController=null;this._didCollectDailyBonus=!1;this._mainBg=null;this._buttonAnimArray=[];this._allObjectsArray=[];this._leaderboardRewardActive=this._isBottomHudLoadingComplete= this._dailyBonusTriggered=this._curtainRaiserTriggered=!1;this._lobbyButtonArray=[];this._gameManager=RSGame.getInstance().getGameManager();this._isAnyURLPopupActive=0;this._super.init.call(this)},loadContent:function(){RSEngine.loginMode===LOGIN_MODE.FACEBOOK&&(RSGame.getInstance().getGameData().getDefaultValues().isLoyaltyMallEnabled=0);RSGame.getInstance().getGameManager().getSSOMainLobbyReloadStatus()&&RSGame.getInstance().getGameManager().reinitializeVIPStarRotationStatus();RSCasinoManager.setCasinoHUD(this.getCasinoHUD()); null==RSCasinoManager.getCasinoInterface()&&RSCasinoManager.setCasinoInterface(this.getCasinoInterface());RSCasinoManager.getCasinoHUD().setPrimaryCurrency(RSCasinoManager.getPrimaryCurrency());if(this._initialLoading&&(this._gameManager.initializePlatformSDKManager({},GameConfig.GAME_ID),GameConfig.MACHINE_OPEN_POPUP)){var a={};a[RSGameTypes.Poker]="res/PokerResources/CasinoSubLobby/Icons/";a[RSGameTypes.Bingo]="res/BingoResources/res/icons/";a[RSGameTypes.Blackjack]="res/TableResources/SubLobby/LargeIcons/"; a[RSGameTypes.Slots]="res/SlotResources/CasinoSubLobby/LargeIcons/";a[RSGameTypes.Keno]="res/KenoResources/SubLobby/icons/";a[RSGameTypes.Roulette]="res/TableResources/SubLobby/LargeIcons/";a[RSGameTypes.Scratcher]="res/ScratcherResources/SubLobby/LargeIcons/";a[RSGameTypes.TableGames]="res/TableResources/SubLobby/LargeIcons/";RSGame.getInstance().getGameManager().initializeMachineOpenPopup(a)}RSEventManager.getInstance().addEventListener("onHourlyBonusCollected",this,this._onHourlyBonusCollect.bind(this)); RSEventManager.getInstance().addEventListener("onHourlyBonusWidgetActive",this,this._onHourlyBonuswidgetActive.bind(this));this.bottomHud=new LobbyBottomHUD(this.onBottomHudLoadComplete.bind(this));this.bottomHud.setVisible(!1);this._super.loadContent.call(this);this._assetCount=3;GlobalVars.customLobbyStatus&&(this._assetCount=RSGame.getInstance().getAssetCount("MainLobby"));this._assetList=[{name:RSGame.getInstance().getAssetPath("MainLobby"),count:this._assetCount}];this.layoutScreen(this._assetList)}, getCasinoHUD:function(){this._topHud=new TopHUD(RSGame.getInstance().getAssetPath("TopHud"));this._initialLoading&&this._topHud.setVisible(!1);return this._topHud},onObjectCreated:function(a,b,c){switch(c.type){case "Animation":switch(c.name){case "Slots":this._slotButtonAnimation=a;this.addAnimationToArray(a,1);this.removeChild(a);break;case "Poker":this._pokerButtonAnimation=a;this.addAnimationToArray(a,1);this.removeChild(a);break;case "TableGames":this._tableGamesButtonAnimation=a;this.addAnimationToArray(a, 1);this.removeChild(a);break;case "Scratchers":this._scratcherButtonAnimation=a;this.addAnimationToArray(a,1);this.removeChild(a);break;case "Keno":this._kenoButtonAnimation=a;this.addAnimationToArray(a,1);this.removeChild(a);break;case "PumpkinAnim":case "Spider":case "Spider1":case "BatEye2":case "BatEye3":case "BatEye4":case "BatEye5":case "BatEye6":case "BatAnim":case "BatAnim2":case "Snow1":case "Snow2":case "Snow3":case "Snow4":case "Snow5":case "Snow6":case "Snow7":case "Snow8":case "Snow9":case "Snow10":case "Snow11":a.stopAnimation(); a.playAnimation(-1,0.3);this.setDefaultProperites(a);break;case "SlotsTag":this._slotNewTag=a;this._slotNewTag.setVisible(!1);break;case "VideoPokerTag":this._pokerNewTag=a;this._pokerNewTag.setVisible(!1);break;case "KenoBingoTag":this._kenobingoNewTag=a;this._kenobingoNewTag.setVisible(!1);break;case "TableGamesTag":this._tableGamesNewTag=a;this._tableGamesNewTag.setVisible(!1);break;case "ScratchersTag":this._scratchersNewTag=a;this._scratchersNewTag.setVisible(!1);break;default:this.setDefaultProperites(a)}break; case "AnimButton":switch(c.name){case "SlotsButton":this._slotButton=a;this._lobbyButtonArray.push(a);this.setDefaultProperites(a);break;case "VideoPokerButton":this._pokerButton=a;this._lobbyButtonArray.push(a);this.setDefaultProperites(a);break;case "ScratchersButton":this._scratcherButton=a;this._lobbyButtonArray.push(a);this.setDefaultProperites(a);break;case "KenoButton":this._kenoButton=a;this._lobbyButtonArray.push(a);this.setDefaultProperites(a);break;case "TableGamesButton":this.tableGamesButton= a,this._lobbyButtonArray.push(a),this.setDefaultProperites(a)}break;case "bo":switch(c.name){case "AllUnlocked":this._allUnlockedTag=a;this._allUnlockedTag.setVisible(!1);break;case "Bg":this._mainBg=a;this.setDefaultProperites(a);break;default:this.setDefaultProperites(a)}}this._super.onObjectCreated.call(this,a,b,c)},createCustomObject:function(a,b){switch(b.name){case "MuteButtonWidget":this._muteBtnWidget=new RSPanel(b.x,b.y,b.w,b.h);RSMuteButtonManager.showMuteButton(this,RSGame.getInstance().getAssetPath("MuteButtonWidget"), this._muteBtnWidget);break;case "RouletteComingSoon":this._rouletteComingSoon=RSUtils.createBasicObject(a,b);this.addChild(this._rouletteComingSoon);this._rouletteComingSoon.setVisible(!1);break;case "JackpotLoungeButton":this._btnJackpot=new JackpotLoungeButtons(this._gameManager.getHUDCasinoFont("largeBlue","bold"),this.onJackpotButtonClicked.bind(this)),this.addChild(this._btnJackpot),this.setDefaultProperites(this._btnJackpot)}switch(b.type){case "Bat":var c=RSUtils.createBasicObject(a,b);this.addChild(c); this.setDefaultProperites(c);break;case "SpiderWeb":case "SpiderWeb1":c=RSUtils.createBasicObject(a,b),this.addChild(c),this.setDefaultProperites(c)}},onAssetLoaded:function(a){this._super.onAssetLoaded.call(this,a)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);GlobalVars.scoreboxRedirection=!1;GlobalVars.slotsLobbySelectedTab=TabType.ALLSLOTS;this.setName(RSGameScreens.MainLobby);RSGame.getInstance().getGameManager().setGameType("");RSGame.getInstance().getGameManager().setFeaturedAndPreviewMachinesInSlots(); RSEventManager.getInstance().addEventListener("onRankUpRewarded",this,this.onRewardScreenComplete.bind(this))},onJackpotButtonClicked:function(){GlobalVars.isMachineLoadingInProgress||(this._btnJackpot.setTouchEnabled(!1),GameConfig.JL_SURFACING&&!RSEngine.dataManager.getMe().getJLSurfacingShown()?RSGame.getInstance().getGameManager().showIntroScreenForJL(this.openJackpotLounge.bind(this)):this.openJackpotLounge())},openJackpotLounge:function(){this._gameManager.loadJackpotLounge(null,null,null,null, null,"lounge",null)},onReveal:function(){document.getElementById("helpshift_dummy")&&document.getElementById("helpshift_dummy").remove();this._super.onReveal.call(this);this.startTransition()},startTransition:function(a){a&&this._currentState++;switch(this._currentState){case MAINLOBBY_STATE.USER_BAN:RSGame.getInstance().getGameManager().setMainLobbyLoadedStatus(!1);if(RSGame.getInstance().getUserDataManager().getMe().isUserBanned()){RSEngine.popupManager.addPopup(new UserBanPopup,!1);break}this.startTransition(!0); break;case MAINLOBBY_STATE.WELCOME_BONUS:if(!RSGame.getInstance().getUserDataManager().getMe().getWelcomeBonusAwarded()){a=RSGame.getInstance().getGameManager().getDefaultCasinoFont("extralarge","bold");RSEngine.popupManager.addPopup(new RSWelcomeScreen(a,this.startTransition.bind(this,!0)),!1,!1,!1,!1);break}this.startTransition(!0);break;case MAINLOBBY_STATE.WEBSTORE_PURCHASE:GameConfig.isWebStoreEnabled&&null!=RSGame.getInstance().getGameManager().getWebStorePurchaseDetails()&&void 0!==RSGame.getInstance().getGameManager().getWebStorePurchaseDetails()? RSGame.getInstance().getGameManager().callWebStorePurchaseSuccessPopup(this.onWebStorePurchasePopupCloseCallback.bind(this)):this.startTransition(!0);break;case MAINLOBBY_STATE.URL_NOTIFICATION:if(this._skipFurtherPopups){this.startTransition(!0);break}this.checkAndShowURLNotificationPopups();break;case MAINLOBBY_STATE.DAILY_BONUS:this._dailyBonusWidgetController=RSWidgetsManager.getInstance().getController("DailyBonusScreen");RSGame.getInstance().getUserDataManager().getMe().getWelcomeBonusAwarded()&& RSEngine.loginMode!=LOGIN_MODE.GUEST&&this._dailyBonusWidgetController.getDailyBonusActive()&&(0=GameConfig.JACKPOT_LOUNGE_LEVEL&&this._gameManager.showIntroScreenForJL(this._onJLCurtainRaiserComplete.bind(this),!0):RSEngine.loginMode!=LOGIN_MODE.GUEST&&this._initialLoading&&RSEngine.dataManager.getMe().getJLSurfacingShown()&&GameConfig.JACKPOT_LOUNGE_ENABLE&&GameConfig.VIKING_LOUNGE_ENABLED&&GameConfig.JL_SURFACING&&RSGame.getInstance().getLevelManager().getCurrentLevel()>= GameConfig.JACKPOT_LOUNGE_LEVEL?(a=RSGame.getInstance().getGameData().getDefaultValues().customLoungeName,!a||RSGame.getInstance().getUserDataManager().getMe().getCustomLoungePopupShownStatus(a)||RSGame.getInstance().getUserDataManager().getMe().getVikingLoungePopupShownStatus()?this.startTransition(!0):(this._vikingsLoungeScreen=new VikingsUnlockScreen(this.onVikingLoungeScreenAnimComplete.bind(this),!0))?(RSGame.getInstance().getGameManager().setSideMenuVisibility(!1),RSEngine.screenManager.addScreen(this._vikingsLoungeScreen), RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetPath("SurfacingScreenEntry_SFX"),!1)):this.startTransition(!0)):this.startTransition(!0);break;case MAINLOBBY_STATE.SCOREBOX_POPUP:if(this._skipFurtherPopups){this.startTransition(!0);break}a=null;null!=SCOREBOX_DATA&&decodeURIComponent(atob(SCOREBOX_DATA))&&(a=JSON.parse(decodeURIComponent(atob(SCOREBOX_DATA))));null!=a&&"popup"==a.type&&"SCOREBOX"==a.trackingId&&RSEngine.dataManager.getMe().getJLSurfacingShown()&&this._initialLoading? RSEngine.popupManager.addPopup(new ScoreboxRedirectPopup(this.scoreboxRedirectCallback.bind(this),this.startTransition.bind(this,!0))):this.startTransition(!0);break;case MAINLOBBY_STATE.LEADERBOARD_REWARD:if(this._skipFurtherPopups){this.startTransition(!0);break}(this._leaderboardRewardActive=RSRewardManager.isRewardActive("MainLobby_Launch"))?RSEventManager.getInstance().dispatchEvent(RSPlatformEventTypeKeys.RSPlatformEvent,{event:RSPlatformEventTypeKeys.ENTER_SCREEN,parameter:"MainLobby_Launch"}): this.startTransition(!0);break;case MAINLOBBY_STATE.TOURNAMENT_REWARD:if(this._skipFurtherPopups){this.startTransition(!0);break}RSRewardManager.isRewardActive(RSPlatformEventTypeKeys.TOURNAMENT_REWARD)?RSEventManager.getInstance().dispatchEvent(RSPlatformEventTypeKeys.RSPlatformEvent,{event:RSPlatformEventTypeKeys.ENTER_SCREEN,parameter:RSPlatformEventTypeKeys.TOURNAMENT_REWARD}):this.startTransition(!0);break;case MAINLOBBY_STATE.SWEEPSTAKES_ANNOUNCEMENT_POPUP:if(this._skipFurtherPopups){this.startTransition(!0); break}GameConfig.SWEEPSTAKES_ENABLED&&RSEngine.loginMode!=LOGIN_MODE.GUEST&&RSSweepstakesManager.getSweepstakesRewardAnnouncementPopupTriggerStatus()&&RSGame.getInstance().getUserDataManager().getMe().getSweepstakesSurfaceShownStatus()?RSSweepstakesManager.showSweepstakesRewardAnnouncementPopup(this.startTransition.bind(this,!0),!0):this.startTransition(!0);break;case MAINLOBBY_STATE.AVATAR_POPUP:if(this._skipFurtherPopups){this.startTransition(!0);break}if(RSEngine.loginMode===LOGIN_MODE.EMAIL&& 0===RSGame.getInstance().getUserDataManager().getMe().getAvatar()){a={};var b={};b.assetPath=[{name:RSGame.getInstance().getAssetPath("WebAvatarPopup"),count:1}];b.avatarImgAssetPath=RSGame.getInstance().getAssetFolder("AvatarPopup");b.avatarPlistName="AvatarImages_00";a.avatarImgCount=77;a.avatarsPerRow=5;a.rowPadding=8;RSEngine.popupManager.addPopup(new RSWebAvatarPopup(a,b,this.startTransition.bind(this,!0)),!0)}else this.startTransition(!0);break;case MAINLOBBY_STATE.LOGIN_SUCCESS:if(this._skipFurtherPopups){this.startTransition(!0); break}this.checkAndShowLoginSuccessPopup();break;case MAINLOBBY_STATE.SOCIAL_LOGIN_REWARD_FOR_FB_LOGIN:this.startTransition(!0);break;case MAINLOBBY_STATE.SHOW_MAINLOBBY:if(this._skipFurtherPopups){this.startTransition(!0);break}RSLeaderboard.getRankUpTriggerStatus()&&RSEventManager.getInstance().dispatchEvent(RSPlatformEventTypeKeys.RSPlatformEvent,{event:RSPlatformEventTypeKeys.RSPlatformEvent,parameter:RSPlatformEventTypeKeys.ON_BACK_BUTTON_CLICK});this.startTransition(!0);break;case MAINLOBBY_STATE.SHOW_DQ_POPUP:if(this._skipFurtherPopups){this.startTransition(!0); break}RSEngine.loginMode!=LOGIN_MODE.GUEST&&!this._curtainRaiserTriggered&&RSGame.getInstance().getGameManager().forceTriggerDailyQuestPopup&&this._initialLoading&&RSEngine.dataManager.getMe().getDCinfoPopupShownStatus()?RSEngine.popupManager.addPopup(new RSDailyQuestPopup(RSGame.getInstance().getAssetPath("DailyChallengePopup"),RSGame.getInstance().getGameManager().getDefaultCasinoFont("medium","bold"),this.onForcedDQPopupClosed.bind(this))):this.startTransition(!0);break;case MAINLOBBY_STATE.SUBSCRIPTION_SALE_POPUP:if(this._skipFurtherPopups){this.startTransition(!0); break}GameConfig.SUBSCRIPTION_ENABLED&&"sale"==RSSaleManager.getInstance().getSaleTagActiveForPlayer()?this.checkAndShowSubscriptionSalePopup(RSPLATFORM_SUBSCRIPTION_PLACEMENTS.SUBSCRIPTION_BEFORE_NPS,"Sub_BSale"):this.startTransition(!0);break;case MAINLOBBY_STATE.SALE_POPUP:if(this._skipFurtherPopups){this.startTransition(!0);break}this.checkAndShowSalesPopup();break;case MAINLOBBY_STATE.SUBSCRIPTION_SALE_POPUP_AFTER_NPS:if(this._skipFurtherPopups){this.startTransition(!0);break}GameConfig.SUBSCRIPTION_ENABLED&& "nps"==RSSaleManager.getInstance().getSaleTagActiveForPlayer()?this.checkAndShowSubscriptionSalePopup(RSPLATFORM_SUBSCRIPTION_PLACEMENTS.SUBSCRIPTION_AFTER_NPS,"Sub_ANPS"):this.startTransition(!0);break;case MAINLOBBY_STATE.VIP_POPUP:if(this._skipFurtherPopups){this.startTransition(!0);break}this.checkAndShowVIPWelcomePopup();break;case MAINLOBBY_STATE.REWARD_REMINDER:if(this._skipFurtherPopups){this.startTransition(!0);break}this.checkAndShowRewardReminderPopup();break;case MAINLOBBY_STATE.SUBSCRIPTION_INTERRUPT_POPUP:if(this._skipFurtherPopups){this.startTransition(!0); break}RSSubscrptionSaleManager.checkAndSetSubscriptionInteruptedShownStatus(this.startTransition.bind(this,!0));break;case MAINLOBBY_STATE.VIP_TOOLTIP:a=TimeManager.getInstance().getCurrentServerTime();RSEngine.loginMode!==LOGIN_MODE.GUEST&&!this._skipFurtherPopups&&0=RSVIPManager.getInstance().getVIPUserTier()&&172800<=a-RSGame.getInstance().getUserDataManager().getMe().getVIPTooltipShownTime()?(this._anyTooltipShown=!0,RSGame.getInstance().getUserDataManager().getMe().setVIPTooltipShownTime(TimeManager.getInstance().getCurrentServerTime()), RSCasinoManager.getCasinoHUD().showUpgradeVIPTooltip(this.startTransition.bind(this,!0))):RSEngine.loginMode!==LOGIN_MODE.GUEST&&!this._skipFurtherPopups&&0==RSVIPManager.getInstance().getVIPUserTier()&&86400<=a-RSGame.getInstance().getUserDataManager().getMe().getVIPTooltipShownTime()?(this._anyTooltipShown=!0,RSGame.getInstance().getUserDataManager().getMe().setVIPTooltipShownTime(TimeManager.getInstance().getCurrentServerTime()),RSCasinoManager.getCasinoHUD().showNoStarTooltip(this.startTransition.bind(this, !0))):this.startTransition(!0);break;case MAINLOBBY_STATE.TOURNAMENT_ANNOUNCEMENT:if(this._skipFurtherPopups){this.startTransition(!0);break}(this._announcementStatus=RSTournamentManager.checkForAnnouncementPopupTriggerStatus(RSTournamentManager.getTournamentSurfacingEnabledStatus()))&&this._initialLoading&&RSEngine.loginMode!=LOGIN_MODE.GUEST&&!this._curtainRaiserTriggered&&(0this[a(428)]?(this._retryCount++,this[a(453)](this[a(435)],this[a(459)],b)):(this[a(428)]=0,RSErrorTracker[a(462)]()[a(394)](a(403), "Error collecting subscription sale","mahesh.jose@rubyseven.net,lijith.puthiyoottil@rubyseven.net"))},onSubscriptionStatusCallback:function(b){this[a(428)]=0;b[a(409)].subscriptionArray?(this[a(400)]=SUB_SALE_CONFIG[a(417)],this[a(412)]=b[a(409)][a(396)],b.result[a(396)][a(395)]===a(438)?this[a(400)]=SUB_SALE_CONFIG[a(418)]:this._subSaleStatus=SUB_SALE_CONFIG[a(417)]):this[a(400)]=SUB_SALE_CONFIG[a(385)]},onSubscriptionStatusCallFailed:function(b){3>this[a(428)]?(this._retryCount++,this[a(389)]()): (this[a(428)]=0,RSErrorTracker.getInstance()[a(394)](a(456),a(445),a(398)))},getName:function(){return a(447)},_setNewPlayerSaleValues:function(){if(0=c&&(c=parseInt(g[h]));this[a(434)]=86400*c;this[a(420)]-this[a(437)]<=this[a(434)]&&(this[a(442)]= !0,this._npsTimeRemaining=this[a(434)]-(this[a(420)]-this._joiningTime),RSCasinoManager[a(426)]()[a(433)](),0=b;d--)a[d+c]=a[d];return a},loadContent:function(){this.layoutScreen(this._assetList);this._super.loadContent.call(this)},onAssetLoaded:function(a){null==this._buttonArray&&(cc.log("Button Array is NULL"),this._buttonArray=[]);for(var b=RSUtils.cloneJSON(a.objects),c= a.screenName,d=0;d=this._coinAwarded)return;this._titleText=new RSLabelBMFont("",RSGame.getInstance().getGameManager().getDefaultCasinoFont("largePurple","bold"),b.w,kTEXT_ALIGNMENT_CENTER);this._titleText.setScale(1.3);this._titleText.setPosition(b.x,b.y);this._titleText.setTextAlignment(kTEXT_ALIGNMENT_CENTER);this.addChild(this._titleText);this._titleText.setString(RSUtils.formatNumber(Number(this._coinAwarded),3));break;case "Value1":if(isNaN(this._energyAwared)|| 0>=this._energyAwared)return;this._titleTextEnergy=new RSScaledLabel("",RSGame.getInstance().getGameManager().getDefaultCasinoFont("largePurple","bold"),b,kTEXT_ALIGNMENT_CENTER);this.addChild(this._titleTextEnergy);this._titleTextEnergy.setString(RSUtils.formatNumber(Number(this._energyAwared)));break;case "Heading":this._heading=new RSScaledLabel("",RSGame.getInstance().getGameManager().getDefaultCasinoFont("largePink","black"),b,kTEXT_ALIGNMENT_CENTER);this.addChild(this._heading);this._heading.setString(this._messages.messageTitleAvailable); break;case "SubHeading":this._subHeading=new RSScaledLabel("",RSGame.getInstance().getGameManager().getDefaultCasinoFont("largePurple","normal"),b,kTEXT_ALIGNMENT_CENTER),this.addChild(this._subHeading),this._subHeading.setString(this._messages.messageBodyAvailable)}return this._super.createCustomObject.call(this,a,b)},onButtonClicked:function(a){switch(a){case "CloseBtn":case "CP_Button_T1":this._continueButton&&this._continueButton.setTouchEnabled(!1),this._closeButton&&this._closeButton.setTouchEnabled(!1), RSEngine.screenManager.addOverlay(),0this._subScriptionData.subscriptionPeriod?this._disableSale():(RSSaleManager.getInstance().callSaleDetails(null,null,GlobalVars.isPurchaseEnabled),c=new RSRect(0,0,0,0),this._diplayPanel=new RSDisplayObject(c),this.addChild(this._diplayPanel),this._diplayPanel.setZOrder(1),c= this._diplayPanel.convertToNodeSpace(this._collectButton.getX(),this._collectButton.getY()),RSCasinoManager.getCasinoHUD().playCoinReceivedAnimation(c,this._diplayPanel,this.closePopup.bind(this)))},_setValues:function(){TimeManager.getInstance().getCurrentServerTime();if("available"===this._subScriptionData.status)this._collectButton.setVisible(!0);else{if("claimed"===this._subScriptionData.status){this._disableSale();return}this._collectButton.setVisible(!1);this._isCollectable=!1;this._availText= RSUtils.createBasicObject("DailyMillionaireInfoPopup",this._availableTxt);this.addChild(this._availText);clearInterval(this._bonusTimer);this._bonusTimer=setInterval(this._setTimerValues.bind(this),1E3);this._setTimerValues()}var a=parseInt(this._subScriptionData.nextDay)-2,b=parseInt(this._subScriptionData.nextDay)-1;if(this.collectSuccess){var c=RSUtils.createBasicObject("DailyMillionaireInfoPopup",this._shadeRight);c.setPosition(this._shadeRight.x+a*this._shadeRight.w,this._shadeRight.y);c=RSUtils.createBasicObject("DailyMillionaireInfoPopup", this._tickLeft);c.setPosition(this._tickLeft.x+a*this._tickLeft.w,this._tickLeft.y);this.addChild(c)}else if(0this._subScriptionData.subscriptionPeriod?this._disableSale():(this.collectSuccess=!1,this._setValues())},_setTimerValues:function(){var a=this._subScriptionData.nextAvailableTime-TimeManager.getInstance().getCurrentServerTime();0>=a?(this._isCollectable=!0,clearInterval(this._bonusTimer),PurchaseFlowManager.getInstance().getActiveSubscriptionSale(),this._collectButton.setVisible(!0),this.removeChild(this._availText),this._timerTxt.setVisible(!1)):(this._timerTxt.setVisible(!0), a=RSUtils.formattedTime(a),this._timerTxt.setString(a))},createCustomObject:function(a,b){switch(b.name){case "Panel":this._panel=RSUtils.createBasicObject(a,b);this.addChild(this._panel);break;case "ShadeRight":this._shadeRight=b;break;case "ShadeLeft":this._shadeLeft=b;break;case "TickLeft":this._tickLeft=b;break;case "UnTickLeft":this._unTickLeft=b;break;case "TimerTxt":this._timerTxt=new RSScaledLabel("",RSGame.getInstance().getGameManager().getDefaultCasinoFont("large","bold"),b,kTEXT_ALIGNMENT_LEFT); this.addChild(this._timerTxt);this._timerTxt.setVisible(!1);break;case "AvailableTxt":this._availableTxt=b}},loadContent:function(){this.layoutScreen(this._assetList);this._super.loadContent.call(this);RSEventManager.getInstance().addEventListener("collectSubscriptionSaleSuccess",this,this.onCollectSuccess.bind(this))},unload:function(){clearInterval(this._bonusTimer);this._subScriptionData.length=0;RSEventManager.getInstance().removeEventListenersIn(this);this._subScriptionData=null;this._super.unload.call(this)}});var AristocratHUD=TopHUD.extend({init:function(a){this._super._super.init.call(this,a)},loadContent:function(){this._super.loadContent.call(this)},onLayoutCompleted:function(){this._super._super.onLayoutCompleted.call(this);this.coinField&&this.coinField.setVisible(!1)},onButtonClicked:function(a){this._super.onButtonClicked.call(this,a);switch(a){case "BackButton":AristocratManager.getInstance()._callUserUpdates(),AristocratManager.getInstance().stopCallUserUpdates(),AristocratManager.getInstance().currentMachineName= ""}},setCurrencyValue:function(a){},setXpBar:function(a){},disablePurchaseButton:function(){null!=this._purchaseWidget&&this._purchaseWidget.disablePurchaseButton()},unload:function(){this._super.unload.call(this)}});var XPBlastRewardPopup=RSGenericPopup.extend({init:function(a){this._callBack=a;this._assetList=[{name:RSGame.getInstance().getAssetPath("XPGiftingPopup"),count:1}];var b={font:RSGame.getInstance().getGameManager().getDefaultCasinoFont("large","bold")};this._super.init.call(this,a,b)},onObjectCreated:function(a,b,c){this._super.onObjectCreated.call(this,a,b,c);switch(c.name){case "XpAnimation":a.stopAnimation(),a.setFrame(UrlNotificationManager.getInstance().getXpBlastVO().xp_multiplier-2)}},onButtonClicked:function(a){switch(a){case "CP_Button_T1":this.closePopup()}}, onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);this._bonusTimer=setInterval(this._setTimerValues.bind(this),1E3);RSCasinoManager.getCasinoHUD().playXpBlastAnimations&&RSCasinoManager.getCasinoHUD().playXpBlastAnimations();this._setTimerValues()},_setTimerValues:function(){var a=RSGame.getInstance().getUserDataManager().getMe().getXpBlastEndTime()-TimeManager.getInstance().getCurrentServerTime();0>=a?(clearInterval(this._bonusTimer),this.removeChild(this._availText),this._timerTxt.setVisible(!1)): (RemainingTimeFormatted=1==parseInt(a/86400)?parseInt(a/86400)+" Day":1this._unlockedMachineList.length&&0=a.length?RSUtils.formatNumberWithComma(a):14>=a.length?RSUtils.formatNumberWithComma(a.substr(0,a.length-6))+"M":RSUtils.formatNumberWithComma(a.substr(0,a.length- 9))+"B"},checkForBadWordAndSaveName:function(){RSEngine.screenManager.addOverlay();RSEngine.dataManager.checkNameIsValideOrNot(this._nameEntered,this._successCallBack.bind(this),this._failedCallBack.bind(this))},_successCallBack:function(a){200==a.result.status&&(a.result.data?(cc.log("bad word"),this._nameLabel.setString(this.getFormattedName(this._originalName)),this._editableNameLabel.setString(this.getFormattedName(this._originalName)),this._nameErrorTxt&&this._nameErrorTxt.setVisible(!0)):(this._nameErrorTxt&& this._nameErrorTxt.setVisible(!1),this._originalName=this._nameEntered,RSGame.getInstance().getUserDataManager().getMe().setUserFirstName(this._nameEntered),RSGame.getInstance().getUserDataManager().saveUserData("setUserFirstName"),RSAnalyticsManager.getInstance().trackGUIEvent("player_stats","edit_name","open_from_"+RSAnalyticsManager.getInstance().getCurrentMachineName(),this._nameEntered)));RSEngine.screenManager.removeOverlay()},_failedCallBack:function(){RSEngine.screenManager.removeOverlay(); cc.log("failed")},closePopup:function(){RSGame.getInstance().getGameManager().setGameType(this._defaultGameType);this._super.closePopup.call(this)}});var RSSweepstakesManager={_fonts:null,_sweepstakesData:{},_getStatusSuccesCallBack:null,_getStatusFailCallBack:null,_currentPopup:null,_curtainraiserCallBack:null,_rewardAnnouncementCallBack:null,_rewardHistory:null,initializeCataboomManager:function(a,b){this._fonts=a;this._sweepstakesRewardValue=RSGame.getInstance().getGameData().getDefaultValues().sweepStakesRewadValue;this._termsAndConditionsUrl=b;this.getJackpotSweepstakesStatus(!1);this.getRewardHistoryFromServer();RSEventManager.getInstance().addEventListener("onSweepstakesPopupClose", this,this._onSweepstakesPopupClose.bind(this));cc.log("Cataboom initialized")},getName:function(){return"RSSweepstakesManager"},getJackpotSweepstakesStatus:function(a,b,c,d,e){c={};a&&(c=b,this._getStatusSuccesCallBack=d,this._getStatusFailCallBack=e);RSGame.getInstance().getUserDataManager().getSweeptakesStatus(c,a,this.onGetSweepstakesSuccess.bind(this),this.onGetSweepstakesFailed.bind(this))},onGetSweepstakesSuccess:function(a){a.result.data&&(this._sweepstakesData=a.result.data,cc.log("Sweepstakes data:"+ JSON.stringify(a.result.data)));if(null!=this._getStatusSuccesCallBack){var b=!0;"duplicateId"==a.result.message&&(b=!1);this._getStatusSuccesCallBack(b);this._getStatusSuccesCallBack=this._getStatusFailCallBack=null}if(this._currentPopup)switch(RSEngine.screenManager.removeOverlay(),this._currentPopup){case "CurtainRaiser":this.showJackpotSweepstakesEntryPopup(!0);break;case "winnerAnnouncement":this.getSweepstakesRewardAnnouncementPopupTriggerStatus()&&this.showSweepstakesRewardAnnouncementPopup(); break;default:this.triggerPopupAfterRefreshingData()}this._currentPopup=null},getRewardHistoryFromServer:function(){RSGame.getInstance().getUserDataManager().getSweeptakesRewardHistory(this.onGetSweepstakesRewardHistory.bind(this),this.onGetSweepstakesRewardHistoryFailed.bind(this))},onGetSweepstakesFailed:function(){},onGetSweepstakesRewardHistory:function(a){this._rewardHistory=a.result.data;a.result.data[0]&&(this._sweepstakesRewardPreviousValue=a.result.data[0].win)},getRewardHistory:function(){return this._rewardHistory}, onGetSweepstakesRewardHistoryFailed:function(){},getSweepstakesData:function(){return this._sweepstakesData},getSweepstakesRewardValue:function(){return this._sweepstakesRewardValue},getSweepstakesPreviousRewardValue:function(){return this._sweepstakesRewardPreviousValue},getSweepstakesRewardAnnouncementPopupTriggerStatus:function(){return this._sweepstakesData&&"true"==this._sweepstakesData.isPopupShown?!0:!1},getCoolDownTimeEnableStatus:function(){return this._sweepstakesData&&"true"==this._sweepstakesData.cooldownTimeEnabled? !0:!1},getNextWeeksSweepstakesEnabledStatus:function(){return this._sweepstakesData&&this._sweepstakesData.isSweepstakesNextWeekEnabled?!0:!1},showSweepstakesRewardAnnouncementPopup:function(a,b){a&&(this._rewardAnnouncementCallBack=a);"true"==this._sweepstakesData.isWinner?this.showJackpotSweepstakesWinnerPopup(b):"true"==this._sweepstakesData.isPopupShown&&this.showJackpotSweepstakesBetterLuckPopup(b);this._sweepstakesData.isWinner="false";this._sweepstakesData.isPopupShown="false";this.deleteSweepstakesInfo()}, showJackpotSweepstakesEntryPopup:function(a,b,c,d){b&&(this._curtainraiserCallBack=b);this.checkForRemainingTimeValidity()?a?(SideMenuController.getInstance().setSideMenuVisibility(!1),this.curtainScreen=new RSJackpotSweepstakesCurtainRaiserScreen(this.onCurtainAnimComplete.bind(this)),RSEngine.screenManager.addScreen(this.curtainScreen)):this.getCoolDownTimeEnableStatus()?this.showJackpotSweepstakesCooldownPopup():("mainLobbyAutoTrigger"==d&&(RSGame.getInstance().getUserDataManager().getMe().setPlatformEventCounter(RSPlatformEventTypeKeys.MAINLOBBY_LAUNCH+ "_"+RSPlatformPopupNameKeys.SWEEPSTAKES_ENTRY_POPUP),d=null),a=[{name:RSGame.getInstance().getAssetPath("JackpotSweepstakesEntryPopup"),count:1}],b=RSGame.getInstance().getGameManager().getSweepstakesEntryFontColor()?RSGame.getInstance().getGameManager().getSweepstakesEntryFontColor():new RSColor(255,255,255,200),RSEngine.popupManager.addPopup(new RSJackpotSweepstakesEntryPopup(a,this._fonts,this.getSweepstakesData().remainingTime,b,this._termsAndConditionsUrl,c,this.getSweepstakesData().isRewardHistoryEnabled, d),!0,!0,!0)):a?this.fetchSweepstakesStatus("CurtainRaiser"):this.fetchSweepstakesStatus("EntryPopup")},showJackpotSweepstakesEntrySuccesPopup:function(a,b){if(this.checkForRemainingTimeValidity())if(this.getCoolDownTimeEnableStatus(!1,b))this.showJackpotSweepstakesCooldownPopup();else{var c=[{name:RSGame.getInstance().getAssetPath("JackpotSweepstakesentrySuccesPopup"),count:1}];RSEngine.popupManager.addPopup(new RSJackpotSweepstakesEntrySuccesPopup(c,this._fonts,this.getSweepstakesData().remainingTime, this.getSweepstakesData().rewardTime,this._termsAndConditionsUrl,a,b))}else this.fetchSweepstakesStatus()},showJackpotSweepstakesCooldownPopup:function(a,b){var c=!1;this._SSCooldownPopupcallback=b;if(this.checkForRemainingTimeValidity()){a&&(c=a);var d=[{name:RSGame.getInstance().getAssetPath("JackpotSweepstakesentrySuccesPopup"),count:1}];RSEngine.popupManager.addPopup(new RSJackpotSweepstakesCooldownPopup(d,this._fonts,this.getSweepstakesData().rewardTime,c,this._termsAndConditionsUrl,this.sweepstakesCooldownPopupCallback.bind(this), this.getSweepstakesData().isRewardHistoryEnabled))}else this.fetchSweepstakesStatus()},sweepstakesCooldownPopupCallback:function(){this._SSCooldownPopupcallback&&(this._SSCooldownPopupcallback(),this._SSCooldownPopupcallback=null)},showJackpotSweepstakesWinnerPopup:function(a){var b=[{name:RSGame.getInstance().getAssetPath("JackpotSweepstakesWinnerPopup"),count:1}];RSEngine.popupManager.addPopup(new RSJackpotSweepstakesWinnerPopup(b,this._fonts,a))},showJackpotSweepstakesBetterLuckPopup:function(a){var b= [{name:RSGame.getInstance().getAssetPath("JackpotSweepstakesBetterLuckPopup"),count:1}];RSEngine.popupManager.addPopup(new RSJackpotSweepstakesBetterLuckPopup(b,this._fonts,this.getSweepstakesData().remainingTime,this.getSweepstakesData().winnerInfo,this._termsAndConditionsUrl,a))},showJackpotSweepstakesWinnersList:function(a){this._SSWinnerScreenPopupCallback=a;a=[{name:RSGame.getInstance().getAssetPath("JLSweepstakesBgScreen"),count:1},{name:RSGame.getInstance().getAssetPath("JLSweepstakesBadgeAnim"), count:1},{name:RSGame.getInstance().getAssetPath("JackpotSweepstakesWinnersScreen"),count:1}];this._sweepstakesWinnerScreen=new RSJackpotSweepstakesPreviousWinnersScreen(a,this.removeLeaderboardScreen.bind(this),this._fonts.HISTORY_FONT,this._termsAndConditionsUrl);RSEngine.screenManager.addScreen(this._sweepstakesWinnerScreen)},removeLeaderboardScreen:function(){this._sweepstakesWinnerScreen&&(RSEngine.screenManager.removeScreen(this._sweepstakesWinnerScreen),this._leaderboardScreen=null,RSEngine.externalGameManager&& RSEngine.externalGameManager.showExternalGame(),RSGame.getInstance().getGameManager().setSideMenuVisibility(!0));RSSweepstakesManager.getNextWeeksSweepstakesEnabledStatus()?this._SSWinnerScreenPopupCallback?this.showJackpotSweepstakesEntryPopup(!0,this._SSWinnerScreenPopupCallback):this.showJackpotSweepstakesEntryPopup():(RSEventManager.getInstance().dispatchEvent("onSweepstakesPopupClose"),this._SSWinnerScreenPopupCallback&&this._SSWinnerScreenPopupCallback())},onCurtainAnimComplete:function(){this.curtainScreen&& RSEngine.screenManager.removeScreen(this.curtainScreen)},deleteSweepstakesInfo:function(){RSGame.getInstance().getUserDataManager().deleteSweepstakesData(this.onSweepStakesInfoDataDeletion.bind(this),this.deleteSweepstakesInfo.bind(this))},onSweepStakesInfoDataDeletion:function(){cc.log("data deleted")},checkForRemainingTimeValidity:function(){return this._sweepstakesData.remainingTime>TimeManager.getInstance().getCurrentServerTime()?!0:!1},fetchSweepstakesStatus:function(a,b,c){b&&(this._rewardAnnouncementCallBack= b);this._currentPopup=a?a:"trigger";c?this._currentPopup=null:RSEngine.screenManager.addOverlay();this.getJackpotSweepstakesStatus(!1)},triggerPopupAfterRefreshingData:function(){this.getSweepstakesRewardAnnouncementPopupTriggerStatus()?this.showSweepstakesRewardAnnouncementPopup("",!0):this.getCoolDownTimeEnableStatus()?this.showJackpotSweepstakesCooldownPopup(!0):RSSweepstakesManager.getNextWeeksSweepstakesEnabledStatus()&&this.showJackpotSweepstakesEntryPopup("","",!0)},getSweepstakesEntryPopupTriggerStatusForEvent:function(a){return!GlobalVars.isSurfacingActive&& GameConfig.SWEEPSTAKES_ENABLED&&RSGame.getInstance().getUserDataManager().getMe().getSweepstakesSurfaceShownStatus()&&RSGame.getInstance().getGameVariable().getSweepstakeEnabledStatus()&&!RSSweepstakesManager.getCoolDownTimeEnableStatus()&&GameConfig.PLATFORM_EVENT_MANAGER_ENABLED&&RSGame.getInstance().getPlatformEventManager()&&RSGame.getInstance().getPlatformEventManager().getPlatformEventDispatchAndStatus(RSPlatformEventTypeKeys.MAINLOBBY_LAUNCH,a,RSPlatformEventTypeKeys.MAINLOBBY_LAUNCH,RSPlatformPopupNameKeys.SWEEPSTAKES_ENTRY_POPUP)? !0:!1},_onSweepstakesPopupClose:function(){this._curtainraiserCallBack?(this._curtainraiserCallBack(),this._curtainraiserCallBack=null):this._rewardAnnouncementCallBack&&(this._rewardAnnouncementCallBack(),this._rewardAnnouncementCallBack=null)}};var RSJackpotSweepstakesCurtainRaiserScreen=RSCurtainRaiserScreen.extend({init:function(a){this._super.init.call(this,RSGame.getInstance().getAssetPath("CurtainRaiser"));this.callBack=a},loadContent:function(){this._super.loadContent.call(this)},createCustomObject:function(a,b){this._super.createCustomObject.call(this,a,b)},onObjectCreated:function(a,b,c){this._super.onObjectCreated.call(this,a,b,c)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);this._emitterObject=new RSPanel(0, 0,0,0);this.addChild(this._emitterObject);this._emitterObject.setZOrder(1);RSUtils.callFunctionWithDelay(1.4,this,this._playEmitter.bind(this))},_playEmitter:function(){this.loadParticleEffect();this._particleEmitter.startEmitter();RSUtils.callFunctionWithDelay(0.3,this,this._startScreenShow.bind(this))},_startScreenShow:function(){this._emitterObject.setZOrder(0)},onJLUnlockAnimComplete:function(){},firstSectionComplete:function(){RSSweepstakesManager.showJackpotSweepstakesEntryPopup(null,null,!0)}, onCurtainRaised:function(){this.callBack&&this.callBack()},onDCUnlockAnimComplete:function(a){},loadParticleEffect:function(){cc.spriteFrameCache.addSpriteFrames("res/PlatformWidgets/CurtainRaiser/SweepstakesParticle_00-hd.plist");var a=new RSEmitterParticleParams;a._spriteFrames.push("SweepstakesParticle_00/PurpleStar1.png");a._spriteFrames.push("SweepstakesParticle_00/PurpleStar2.png");a._spriteFrames.push("SweepstakesParticle_00/PinkStar2.png");a._spriteFrames.push("SweepstakesParticle_00/PinkStar2.png"); a._spriteFrames.push("SweepstakesParticle_00/Money1.png");a._spriteFrames.push("SweepstakesParticle_00/Money1.png");a._startScale=0.6;a._startScaleVariance=0;a._endScale=4;a._endScaleVariance=0.2;a._scalingDuration=1;a._startDelay=0.5;a._startDelayVariance=1.5;a._deviation=600;a._deviationVariance=100;a._speed=900;a._360rotationDuration=0.5;a._tweenRate=0.5;a._spriteAnimationSpeed=0.25;a._origin=new RSPoint(RSEngine.screenWidth/2,RSEngine.screenHeight/2);a._originVariance=new RSPoint(20,20);a._displacement= new RSPoint(0,0);a._displacementVariance=new RSPoint(RSEngine.screenWidth/2,RSEngine.screenHeight/2);var b=RSGame.getInstance().getGameManager().getCustomizedParticleCount()?RSGame.getInstance().getGameManager().getCustomizedParticleCount():170;this._particleEmitter=new RSCustomAnimationEmitter(a,!1,RSCustomEmitterType.FIREWORK,b,this._onEmittingCompleted.bind(this));this._emitterObject.addChild(this._particleEmitter);this._particleEmitter.loadEmitter()},_onEmittingCompleted:function(){},unloadContent:function(){this._super.unloadContent.call(this)}});var RSJackpotSweepstakesPopup=RSPopup.extend({init:function(a){this._assetFolder=a;a=new RSRect(0,0,0,0);this._displayPanel=new RSDisplayObject(a);this._super.init.call(this)},loadContent:function(){this.layoutScreen(this._assetFolder);this._super.loadContent.call(this)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);this.addChild(this._displayPanel)},createCustomObject:function(a,b){return this._super.createCustomObject.call(this,a,b)},onButtonClicked:function(a){switch(a){case "CloseBtn":this.closePopup(); break;case "SupportBtn":this.onPlayerSupportClicked()}},onPlayerSupportClicked:function(){document.getElementById("Helpshift").style.display="block";document.getElementById("helpshiftoverlay").style.display="block";this._playerSupportactive=!0},unloadContent:function(){this._super.unloadContent.call(this)}});var RSJackpotSweepstakesEntryPopup=RSGenericPopup.extend({init:function(a,b,c,d,e,f,g,h){this._assetFolder=a;this._fonts=b;this._tickStatus=!1;this._remainingTime=c;this._radioButtonStatus={RadioButton1:0,RadioButton2:0};this._fontColor=d;this._retryCount=0;this._lastNameText=this._firstNameText="";this._timeExpired=!1;this._termsAndConditionsUrl=e;this._cheatTime=RSSweepstakesManager._sweepstakesData.rewardTime;this._popupTriggered=f;this._rewardHistoryEnabledStatus=g;this._checkMail2=!1;this._openFrom= h?h:RSAnalyticsManager.getInstance().getCurrentMachineName();this._super.init.call(this);f?RSAnalyticsManager.getInstance().trackGUIEvent("sweepstakes","sweepstakes_popup","trigger",""):RSAnalyticsManager.getInstance().trackPlayerAction("sweepstakes","click","open_from_"+this._openFrom,"","")},loadContent:function(){this.layoutScreen(this._assetFolder);this._super.loadContent.call(this)},onLayoutCompleted:function(){this.playWinAnimation();this._super.onLayoutCompleted.call(this);this.checkAndUpdateSubmitButton()}, onObjectCreated:function(a,b,c){this._super.onObjectCreated.call(this,a,b,c);switch(c.name){case "Sweepstakes":a.stopAnimation();break;case "RadioButton1":this._termsAndConditionTickButton=a;this._termsAndConditionTickButton.stopAnimation();this._termsAndConditionTickButton.addTouchListenerWithDelegate(this);break;case "RadioButton2":this._confirmAgeTickButton=a;this._confirmAgeTickButton.stopAnimation();this._confirmAgeTickButton.addTouchListenerWithDelegate(this);break;case "InvalidEmail":this._icon1= a;this._icon1.setVisible(!1);break;case "InvalidEmail1":this._icon2=a;this._icon2.setVisible(!1);break;case "Required":this._mandatoryIcon=a;this._mandatoryIcon.setVisible(!1);break;case "StarAnimationSmallRight":this._starAnimationSmallRight=a;this._starAnimationSmallRight.flipHorizontally(!0);this._starAnimationSmallRight.stopAnimation();break;case "StarAnimationRight":this._starAnimationRight=a;this._starAnimationRight.flipHorizontally(!0);this._starAnimationRight.stopAnimation();break;case "StarAnimationSmallLeft":this._starAnimationSmallLeft= a;this._starAnimationSmallLeft.stopAnimation();break;case "StarAnimationLeft":this._starAnimationLeft=a;this._starAnimationLeft.stopAnimation();break;case "WinBigAnimationRight":this._winBigAnimationRight=a;this._winBigAnimationRight.stopAnimation();break;case "WinBigAnimationLeft":this._winBigAnimationLeft=a;this._winBigAnimationLeft.stopAnimation();break;case "AlreadyRegistered":this._alreadyRegisteredIcon=a;this._alreadyRegisteredIcon.setVisible(!1);break;case "PreviousWinnersBtn":"0"==this._rewardHistoryEnabledStatus&& a.setVisible(!1),this._previousWinnersBtn=a}},createCustomObject:function(a,b){switch(b.name){case "WinBarText":var c="WIN $"+RSSweepstakesManager.getSweepstakesRewardValue()+"!",c=new RSLabelBMFont(c,this._fonts.REWARD_TEXT,2*b.w,kTEXT_ALIGNMENT_CENTER);c.setCenter(b.x,b.y);this.addChild(c);this._fonts.ENTRY_REWARD_TEXT_SCALE&&c.setScale(this._fonts.ENTRY_REWARD_TEXT_SCALE);break;case "FirstNameTextBar":this._firstName=new RSInputBox(b.w,b.h);this._firstName.setPosition(b.x,b.y-b.h/5);this._firstName.setFont(this._fonts.INPUTBOX_TEXT, b.h/1.5);this._firstName.setFontColor(255,255,255,25);this._firstName.setName("FirstName");this._firstName.setString("");this._firstName.setInputMode(6);this._firstName.setInputFlag(1);this._firstName.setPlaceholderFont(this._fonts.INPUTBOX_TEXT,b.h/1.5);this._firstName.setPlaceholderFontColor(this._fontColor.getR(),this._fontColor.getG(),this._fontColor.getB(),this._fontColor.getA());this._firstName.setPlaceholderText("First Name *");this._firstName.setDelegate(this);this.addChild(this._firstName); break;case "LastNameTextBar":this._lastName=new RSInputBox(b.w,b.h);this._lastName.setPosition(b.x,b.y-b.h/5);this._lastName.setFont(this._fonts.INPUTBOX_TEXT,b.h/1.5);this._lastName.setFontColor(255,255,255,0);this._lastName.setName("LastName");this._lastName.setString("");this._lastName.setInputMode(6);this._lastName.setInputFlag(1);this._lastName.setPlaceholderFont(this._fonts.INPUTBOX_TEXT,b.h/1.5);this._lastName.setPlaceholderFontColor(this._fontColor.getR(),this._fontColor.getG(),this._fontColor.getB(), this._fontColor.getA());this._lastName.setPlaceholderText("Last Name");this._lastName.setDelegate(this);this.addChild(this._lastName);break;case "EmailTextBar":this._emailInputBox=new RSInputBox(b.w,b.h);this._emailInputBox.setPosition(b.x,b.y-b.h/5);this._emailInputBox.setFont(this._fonts.INPUTBOX_TEXT,b.h/1.5);this._emailInputBox.setFontColor(255,255,255,0);this._emailInputBox.setName("Email");this._emailInputBox.setInputMode(1);this._emailInputBox.setInputFlag(1);this._emailInputBox.setPlaceholderFont(this._fonts.INPUTBOX_TEXT, b.h/1.5);this._emailInputBox.setPlaceholderFontColor(this._fontColor.getR(),this._fontColor.getG(),this._fontColor.getB(),this._fontColor.getA());this._emailInputBox.setPlaceholderText("Email Address *");this._emailInputBox.setDelegate(this);this.addChild(this._emailInputBox);break;case "EmailConfirmTextBar":this._emailConfirmInputBox=new RSInputBox(b.w,b.h);this._emailConfirmInputBox.setPosition(b.x,b.y-b.h/5);this._emailConfirmInputBox.setFont(this._fonts.INPUTBOX_TEXT,b.h/1.5);this._emailConfirmInputBox.setFontColor(255, 255,255,0);this._emailConfirmInputBox.setName("MailConfirm");this._emailConfirmInputBox.setInputMode(1);this._emailConfirmInputBox.setInputFlag(1);this._emailConfirmInputBox.setPlaceholderFont(this._fonts.INPUTBOX_TEXT,b.h/1.5);this._emailConfirmInputBox.setPlaceholderFontColor(this._fontColor.getR(),this._fontColor.getG(),this._fontColor.getB(),this._fontColor.getA());this._emailConfirmInputBox.setPlaceholderText("Confirm Email Address *");this._emailConfirmInputBox.setDelegate(this);this.addChild(this._emailConfirmInputBox); break;case "TimerLbl":this._timeRemainingText=new RSLabelBMFont(c,this._fonts.SMALL_TIMER?this._fonts.SMALL_TIMER:this._fonts.BIG_TIMER,2*b.w,kTEXT_ALIGNMENT_CENTER);this._timeRemainingText.setCenter(b.x,b.y);this.addChild(this._timeRemainingText);this._timeRemainingText.setScale(this._fonts.BIG_TIMER_WITHOUT_CLOCK_SCALE?this._fonts.BIG_TIMER_WITHOUT_CLOCK_SCALE:".4");break;case "CheatLbl":this._cheatTimerText=new RSLabelBMFont(c,this._fonts.NORMAL_TIMER,2*b.w,kTEXT_ALIGNMENT_CENTER);this._cheatTimerText.setCenter(b.x, b.y);this.addChild(this._cheatTimerText);this._cheatTimerText.setScale(0.4);break;case "ProfilePicMask":this._profilePicMaskArea=b;break;case "EnterText":c=RSGame.getInstance().getStringDictionary("JackpotSweepstakesPopup").H6;c=c.replace("{value}",RSSweepstakesManager.getSweepstakesRewardValue());c=new RSLabelBMFont(c,this._fonts.ENTRY_TEXT?this._fonts.ENTRY_TEXT:this._fonts.WIN_TEXT,2*b.w,kTEXT_ALIGNMENT_CENTER);c.setCenter(b.x,b.y);this.addChild(c);c.setScale(this._fonts.WIN_TEXT_SCALE?this._fonts.WIN_TEXT_SCALE: ".45");break;case "Yesbtn":this._submitButton=RSUtils.createButton(a,b),this.addTouchListenerToButton(this._submitButton),this.addChild(this._submitButton),this._submitButton.setTouchEnabled(!1)}return this._super.createCustomObject.call(this,a,b)},onButtonClicked:function(a){switch(a){case "Yesbtn":this.checkDetail();break;case "Terms\x26Conditions":RSAnalyticsManager.getInstance().trackPlayerAction("sweepstakes_ official_rules","click","open_from_signup_popup","","");window.open(this._termsAndConditionsUrl, "_blank");break;case "LeagelAgeBtn":RSAnalyticsManager.getInstance().trackPlayerAction("sweepstakes_legal_age_info","click","","","");window.open(RSEngine.gameData.getDefaultValues().sweepStakesAgePolicyLink,"_blank");break;case "SupportBtn":this.onPlayerSupportClicked();break;case "CloseBtn":this._popupTriggered?RSAnalyticsManager.getInstance().trackGUIEvent("sweepstakes","sweepstakes_popup","close",""):RSAnalyticsManager.getInstance().trackPlayerAction("sweepstakes","close","open_from_"+this._openFrom, "","");RSEventManager.getInstance().dispatchEvent("onSweepstakesPopupClose");this.closePopup();break;case "PreviousWinnersBtn":this._previousWinnersBtn.setTouchEnabled(!1),this.closePopup(),RSSweepstakesManager.showJackpotSweepstakesWinnersList()}return this._super.onButtonClicked.call(this,a)},handleObjectTouchAt:function(a,b,c){a=a._ccObject._name;if(this._radioButtonStatus[a]){switch(a){case "RadioButton1":this._termsAndConditionTickButton.setFrame(0);break;case "RadioButton2":this._confirmAgeTickButton.setFrame(0)}this._radioButtonStatus[a]= 0}else{switch(a){case "RadioButton1":this._termsAndConditionTickButton.setFrame(1);break;case "RadioButton2":this._confirmAgeTickButton.setFrame(1)}this._radioButtonStatus[a]=1}this.checkAndUpdateSubmitButton()},handleObjectTouchMoveAt:function(a,b,c){},handleObjectTouchEndAt:function(a,b,c){},_getTimeRemaining:function(){var a=this._remainingTime-TimeManager.getInstance().getCurrentServerTime();0==a&&this._timeRemainingText&&!this._timeExpired&&(this._timeExpired=!0,cc.log("Time reached"),RSSweepstakesManager.showJackpotSweepstakesEntryPopup(), RSEventManager.getInstance().dispatchEvent("onSweepstakesPopupClose"),this.closePopup());return 86400>a?RSUtils.formattedTime(a):~~(a/86400)+1+" Days"},_getCheatTime:function(){var a=this._cheatTime-TimeManager.getInstance().getCurrentServerTime();return 0==a&&this._timeRemainingText?0:86400>a?RSUtils.formattedTime(a):~~(a/86400)+1+" Days"},_checkRadioButtonTickStatus:function(){return this._radioButtonStatus.RadioButton1&&this._radioButtonStatus.RadioButton2?!0:!1},editBoxEditingDidBegan:function(a){switch(a.getName()){case "Email":this._alreadyRegisteredIcon.setVisible(!1), this._icon2.setVisible(!1)}},editBoxEditingDidEnded:function(a){switch(a.getName()){case "Email":this._email=a._ccObject._text;this._res=this._email.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/);null==this._res?(this._icon1.setVisible(!0),this._checkMail1=!1):(this._icon1.setVisible(!1),this._checkMail1=!0);this._emailConfirm&&this._res&&(null==this._emailConfirm.match(this._email)?(this._icon2.setVisible(!0),this._checkMail2=!1):null==this._email.match(this._emailConfirm)?(this._icon2.setVisible(!0),this._checkMail2= !1):this._checkMail2=!0);break;case "MailConfirm":(this._emailConfirm=a._ccObject._text)&&this._res?null==this._emailConfirm.match(this._email)?(this._icon2.setVisible(!0),this._checkMail2=!1):null==this._email.match(this._emailConfirm)?(this._icon2.setVisible(!0),this._checkMail2=!1):(this._icon2.setVisible(!1),this._checkMail2=!0):(this._icon2.setVisible(!0),this._checkMail2=!1);break;case "FirstName":(this._firstNameText=a._ccObject._text)?(this._mandatoryIcon.setVisible(!1),this._checkName=!0): (this._mandatoryIcon.setVisible(!0),this._checkName=!1)}this.checkAndUpdateSubmitButton()},editBoxTextChanged:function(a,b){switch(a.getName()){case "Email":this._emailText=b;break;case "MailConfirm":this._emailConfirmText=b;break;case "LastName":var c=this.checkForSpecialCharacters(b);if(""!=b&&!c){this._lastName.setString(this._lastNameText);this._lastName.startTouch();break}this._lastNameText=b;break;case "FirstName":c=this.checkForSpecialCharacters(b);if(""!=b&&!c){this._firstName.setString(this._firstNameText); this._firstName.startTouch();break}this._firstNameText=b}},editBoxEditingReturn:function(a){},checkAndUpdateSubmitButton:function(){this._checkRadioButtonTickStatus()&&this._checkMail1&&this._checkMail2&&this._checkName?this._submitButton.setTouchEnabled(!0):this._submitButton.setTouchEnabled(!1)},checkForSpecialCharacters:function(a){return/^[a-z]+$/i.test(a)},checkDetail:function(){if(this._checkMail1&&this._checkMail2&&this._checkName)if(null==this._email.match(this._emailConfirm))this._icon2.setVisible(!0), this._checkMail2=!1,this._submitButton.setTouchEnabled(!1);else{RSEngine.screenManager.addOverlay();this._submitButton.setTouchEnabled(!1);this._previousWinnersBtn.setTouchEnabled(!1);var a={};a.email=this._emailText;a.lastName=this._lastNameText;a.firstName=this._firstNameText;a.fb_id="";if(RSEngine.loginMode==LOGIN_MODE.WEB_FACEBOOK||RSEngine.loginMode==LOGIN_MODE.FACEBOOK)a.fb_id=RSGame.getInstance().getUserDataManager().getMe().getFBId();RSSweepstakesManager.getJackpotSweepstakesStatus(!0,a,!1, this.onUpdateSuccess.bind(this),this.onUpdateFail.bind(this))}},onUpdateSuccess:function(a){a?(RSEventManager.getInstance().dispatchEvent("SWEEPSTAKES_DATA_UPDATED",!1),RSPlatformSDKManager.getInstance().trackEvent(SDK_EVENT_TYPE.sweepstakesEnrolled),RSAnalyticsManager.getInstance().trackPlayerAction("sweepstakes","enter","open_from_"+this._openFrom,"",""),RSSweepstakesManager.getCoolDownTimeEnableStatus()?RSSweepstakesManager.showJackpotSweepstakesCooldownPopup(!0):(RSAnalyticsManager.getInstance().trackGUIEvent("sweepstakes", "enrolled","",""),RSSweepstakesManager.showJackpotSweepstakesEntrySuccesPopup(!0)),this.closePopup()):(this._alreadyRegisteredIcon.setVisible(!0),this._previousWinnersBtn.setTouchEnabled(!0));RSEngine.screenManager.removeOverlay()},onUpdateFail:function(){3>this._retryCount?(this._retryCount++,this.checkDetail()):(this._retryCount=0,RSEngine.screenManager.removeOverlay(),RSErrorTracker.getInstance().trackErrorMessage("ERROR_EMAIL_CONNECT","Error connecting email ","mahesh.jose@rubyseven.net"),RSEventManager.getInstance().dispatchEvent("onSweepstakesPopupClose"), this.closePopup())},onPlayerSupportClicked:function(){document.getElementById("Helpshift").style.display="block";document.getElementById("helpshiftoverlay").style.display="block";RSAnalyticsManager.getInstance().trackGUIEvent("support","open","open_from_sweepstakes","","");this._playerSupportactive=!0},playWinAnimation:function(){this._starAnimationSmallRight.stopAnimation();this._starAnimationLeft.stopAnimation();this._starAnimationSmallLeft.stopAnimation();this._starAnimationRight.stopAnimation(); this._winBigAnimationRight.setVisible(!0);this._winBigAnimationLeft.setVisible(!0);this._winBigAnimationLeft.playAnimation(1,0.3);this._winBigAnimationRight.playAnimation(1,0.3,this.playStarAnimation.bind(this))},playStarAnimation:function(){this._winBigAnimationLeft.stopAnimation();this._winBigAnimationRight.stopAnimation();this._winBigAnimationRight.setVisible(!1);this._winBigAnimationLeft.setVisible(!1);this._starAnimationSmallRight.playAnimation(1,1);this._starAnimationLeft.playAnimation(1,1); this._starAnimationSmallLeft.playAnimation(1,1);this._starAnimationRight.playAnimation(1,1,this.playWinAnimation.bind(this))},update:function(){var a=this._getTimeRemaining();a&&this._timeRemainingText&&this._timeRemainingText.setString(a);(a=this._getCheatTime())&&this._cheatTimerText&&this._cheatTimerText.setString("Cheat complete in:"+a)},unloadContent:function(){this._super.unloadContent.call(this)}});var RSJackpotSweepstakesEntrySuccesPopup=RSGenericPopup.extend({init:function(a,b,c,d,e,f,g,h){this._assetFolder=a;this._fonts=b;this._remainingTime=c;this._rewardTime=new Date(d);this._timeExpired=!1;this._termsAndConditionsUrl=e;this._popupTriggered=f;this._callback=g;this._openFrom=h?h:RSAnalyticsManager.getInstance().getCurrentMachineName();this._super.init.call(this);f?RSAnalyticsManager.getInstance().trackGUIEvent("sweepstakes","sweepstakes_popup","trigger",""):RSAnalyticsManager.getInstance().trackPlayerAction("sweepstakes", "click","open_from_"+this._openFrom,"","")},loadContent:function(){this.layoutScreen(this._assetFolder);this._super.loadContent.call(this)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this)},onObjectCreated:function(a,b,c){this._super.onObjectCreated.call(this,a,b,c);switch(c.name){case "Sweepstakes":a.stopAnimation();break;case "FireworksLeft":this._fireWorkLeft=c}},createCustomObject:function(a,b){switch(b.name){case "SuccessText":var c=RSGame.getInstance().getStringDictionary("JackpotSweepstakesPopup").H2, c=c.replace("{day}",RSUtils.getDateInStringFormat(this._rewardTime,!0)),c=new RSLabelBMFont(c,this._fonts.NORMAL_TEXT,2*b.w,kTEXT_ALIGNMENT_CENTER);c.setCenter(b.x,b.y);c.setScale(this._fonts.DOLLAR_VALUE_TEXT_SCALE?this._fonts.DOLLAR_VALUE_TEXT_SCALE:".55");this.addChild(c);break;case "TimerLbl":this._remainingTimeText=new RSLabelBMFont("".toString(),this._fonts.BIG_TIMER,2*b.w,kTEXT_ALIGNMENT_CENTER);this._remainingTimeText.setCenter(b.x,b.y);this.addChild(this._remainingTimeText);this._remainingTimeText.setScale(this._fonts.BIG_TIMER_WITH_CLOCK_SCALE? this._fonts.BIG_TIMER_WITH_CLOCK_SCALE:".65");break;case "FireworksRight":b.name=this._fireWorkLeft.name;this._fireWorkRight=RSUtils.createBasicObject(a,b);this._fireWorkRight.setScaleX(-1);this.addChild(this._fireWorkRight);break;case "WinBarText":c="WIN $"+RSSweepstakesManager.getSweepstakesRewardValue()+"!",c=new RSLabelBMFont(c,this._fonts.REWARD_TEXT,2*b.w,kTEXT_ALIGNMENT_CENTER),c.setCenter(b.x,b.y),this.addChild(c),this._fonts.ENTRY_REWARD_TEXT_SCALE&&c.setScale(this._fonts.ENTRY_REWARD_TEXT_SCALE)}return this._super.createCustomObject.call(this, a,b)},onButtonClicked:function(a){switch(a){case "InfoBtn":RSAnalyticsManager.getInstance().trackPlayerAction("sweepstakes_ official_rules","click","open_from_enrolled_popup","","");window.open(this._termsAndConditionsUrl,"_blank");break;case "SupportBtn":this.onPlayerSupportClicked();break;case "CloseBtn":this._popupTriggered?RSAnalyticsManager.getInstance().trackGUIEvent("sweepstakes","sweepstakes_popup","close",""):RSAnalyticsManager.getInstance().trackPlayerAction("sweepstakes","close","open_from_"+ this._openFrom,"",""),RSEventManager.getInstance().dispatchEvent("onSweepstakesPopupClose"),this.closePopup()}return this._super.onButtonClicked.call(this,a)},_getTimeRemaining:function(){var a=this._remainingTime-TimeManager.getInstance().getCurrentServerTime();0==a&&this._remainingTimeText&&!this._timeExpired&&(this._timeExpired=!0,cc.log("Time reached"),RSSweepstakesManager.showJackpotSweepstakesEntryPopup(),this.closePopup());return 86400>a?RSUtils.formattedTime(a):~~(a/86400)+1+" Days"},update:function(){var a= this._getTimeRemaining();a&&this._remainingTimeText&&this._remainingTimeText.setString(a)},onPlayerSupportClicked:function(){document.getElementById("Helpshift").style.display="block";document.getElementById("helpshiftoverlay").style.display="block";RSAnalyticsManager.getInstance().trackGUIEvent("support","open","open_from_sweepstakes","","");this._playerSupportactive=!0},closePopup:function(){this._callback&&this._callback();this._super.closePopup.call(this)},unloadContent:function(){this._super.unloadContent.call(this)}});var RSJackpotSweepstakesWinnerPopup=RSGenericPopup.extend({init:function(a,b,c,d){this._assetFolder=a;this._fonts=b;this._super.init.call(this);this._popupTriggered=c;this._openFrom=d?d:RSAnalyticsManager.getInstance().getCurrentMachineName();c?RSAnalyticsManager.getInstance().trackGUIEvent("sweepstakes","sweepstakes_popup","trigger",""):RSAnalyticsManager.getInstance().trackPlayerAction("sweepstakes","click","open_from_"+this._openFrom,"","")},loadContent:function(){this.layoutScreen(this._assetFolder); this._super.loadContent.call(this)},onLayoutCompleted:function(){this.playWinAnimation();this._super.onLayoutCompleted.call(this);RSAnalyticsManager.getInstance().trackPlayerAction("sweepstakes_results","winner",RSSweepstakesManager.getSweepstakesData().winnerInfo.Name,"","")},onObjectCreated:function(a,b,c){this._super.onObjectCreated.call(this,a,b,c);switch(c.name){case "Sweepstakes":a.stopAnimation();break;case "FireworksLeft":this._fireWorkLeft=c;break;case "StarAnimationSmallRight":this._starAnimationSmallRight= a;this._starAnimationSmallRight.flipHorizontally(!0);this._starAnimationSmallRight.stopAnimation();break;case "StarAnimationRight":this._starAnimationRight=a;this._starAnimationRight.flipHorizontally(!0);this._starAnimationRight.stopAnimation();break;case "StarAnimationSmallLeft":this._starAnimationSmallLeft=a;this._starAnimationSmallLeft.stopAnimation();break;case "StarAnimationLeft":this._starAnimationLeft=a;this._starAnimationLeft.stopAnimation();break;case "WinBigAnimationRight":this._winBigAnimationRight= a;this._winBigAnimationRight.stopAnimation();break;case "WinBigAnimationLeft":this._winBigAnimationLeft=a,this._winBigAnimationLeft.stopAnimation()}},createCustomObject:function(a,b){switch(b.name){case "Dollorvalue":var c=RSGame.getInstance().getStringDictionary("JackpotSweepstakesPopup").H1,c=c.replace("{value}",RSSweepstakesManager.getSweepstakesRewardValue()),c=new RSLabelBMFont(c,this._fonts.WINNER_TEXT?this._fonts.WINNER_TEXT:this._fonts.REWARD_TEXT,2*b.w,kTEXT_ALIGNMENT_CENTER);c.setCenter(b.x, b.y);this.addChild(c);(this._fonts.WINNER_TEXT_SCALE||this._fonts.ENTRY_REWARD_TEXT_SCALE)&&c.setScale(this._fonts.WINNER_TEXT_SCALE?this._fonts.WINNER_TEXT_SCALE:this._fonts.ENTRY_REWARD_TEXT_SCALE);break;case "FireworksRight":b.name=this._fireWorkLeft.name;this._fireWorkRight=RSUtils.createBasicObject(a,b);this._fireWorkRight.setScaleX(-1);this.addChild(this._fireWorkRight);break;case "WinBarText":c="WIN $"+RSSweepstakesManager.getSweepstakesRewardValue()+"!",c=new RSLabelBMFont(c,this._fonts.REWARD_TEXT, 2*b.w,kTEXT_ALIGNMENT_CENTER),c.setCenter(b.x,b.y),this.addChild(c),this._fonts.ENTRY_REWARD_TEXT_SCALE&&c.setScale(this._fonts.ENTRY_REWARD_TEXT_SCALE)}return this._super.createCustomObject.call(this,a,b)},onButtonClicked:function(a){switch(a){case "CloseBtn":this.closePopup();this._popupTriggered?RSAnalyticsManager.getInstance().trackGUIEvent("sweepstakes","sweepstakes_popup","close",""):RSAnalyticsManager.getInstance().trackPlayerAction("sweepstakes","close","open_from_"+this._openFrom,"",""); RSSweepstakesManager.getNextWeeksSweepstakesEnabledStatus()?RSSweepstakesManager.showJackpotSweepstakesEntryPopup(null,null,!0):RSEventManager.getInstance().dispatchEvent("onSweepstakesPopupClose");break;case "SupportBtn":this.onPlayerSupportClicked()}},onPlayerSupportClicked:function(){document.getElementById("Helpshift").style.display="block";document.getElementById("helpshiftoverlay").style.display="block";RSAnalyticsManager.getInstance().trackGUIEvent("support","open","open_from_sweepstakes", "","")},playWinAnimation:function(){this._starAnimationSmallRight.stopAnimation();this._starAnimationLeft.stopAnimation();this._starAnimationSmallLeft.stopAnimation();this._starAnimationRight.stopAnimation();this._winBigAnimationRight.setVisible(!0);this._winBigAnimationLeft.setVisible(!0);this._winBigAnimationLeft.playAnimation(1,0.3);this._winBigAnimationRight.playAnimation(1,0.3,this.playStarAnimation.bind(this))},playStarAnimation:function(){this._winBigAnimationLeft.stopAnimation();this._winBigAnimationRight.stopAnimation(); this._winBigAnimationRight.setVisible(!1);this._winBigAnimationLeft.setVisible(!1);this._starAnimationSmallRight.playAnimation(1,1);this._starAnimationLeft.playAnimation(1,1);this._starAnimationSmallLeft.playAnimation(1,1);this._starAnimationRight.playAnimation(1,1,this.playWinAnimation.bind(this))},unloadContent:function(){this._super.unloadContent.call(this)}});var RSJackpotSweepstakesBetterLuckPopup=RSGenericPopup.extend({init:function(a,b,c,d,e,f,g){this._assetFolder=a;this._fonts=b;this._tickStatus=!1;this._remainingTime=c;this._winnerInfo=d;this._super.init.call(this);this._popupTriggered=f;this._termsAndConditionsUrl=e;this._openFrom=g?g:RSAnalyticsManager.getInstance().getCurrentMachineName();f?RSAnalyticsManager.getInstance().trackGUIEvent("sweepstakes","sweepstakes_popup","trigger",""):RSAnalyticsManager.getInstance().trackPlayerAction("sweepstakes", "click","open_from_"+this._openFrom,"","")},loadContent:function(){this.layoutScreen(this._assetFolder);this._super.loadContent.call(this)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);this._setProfileImage();RSAnalyticsManager.getInstance().trackPlayerAction("sweepstakes_results","better_luck_next_time","","","")},onObjectCreated:function(a,b,c){this._super.onObjectCreated.call(this,a,b,c);switch(c.name){case "Sweepstakes":a.stopAnimation();a.setFrame(1);break;case "RadioButton1":this._termsAndConditionTickButton= a;this._termsAndConditionTickButton.stopAnimation();this._termsAndConditionTickButton.addTouchListenerWithDelegate(this);break;case "EnterAgainbtn":this._enterAgainButton=a;RSSweepstakesManager.getNextWeeksSweepstakesEnabledStatus()||this._enterAgainButton.setVisible(!1);break;case "ProfileBorder":this._profilePicMask=a;this._popUpScreenName=b;break;case "TimeRemaining":RSSweepstakesManager.getNextWeeksSweepstakesEnabledStatus()||a.setVisible(!1)}},createCustomObject:function(a,b){switch(b.name){case "Dollorvalue":var c= RSSweepstakesManager.getNextWeeksSweepstakesEnabledStatus()?RSGame.getInstance().getStringDictionary("JackpotSweepstakesPopup").H3:RSGame.getInstance().getStringDictionary("JackpotSweepstakesPopup").H7;RSSweepstakesManager.getNextWeeksSweepstakesEnabledStatus()&&(c=c.replace("{value}",RSSweepstakesManager.getSweepstakesRewardValue()));c=new RSLabelBMFont(c,this._fonts.NORMAL_TEXT,2*b.w,kTEXT_ALIGNMENT_CENTER);c.setCenter(b.x,b.y);this.addChild(c);this._fonts.DOLLAR_VALUE_TEXT_SCALE?c.setScale(this._fonts.DOLLAR_VALUE_TEXT_SCALE): this._fonts.DOLLAR_TEXT_SCALE?c.setScale(this._fonts.DOLLAR_TEXT_SCALE):c.setScale(0.65);break;case "PrifileText":c=this._winnerInfo.Name;11a?RSUtils.formattedTime(a):~~(a/86400)+1+" Days"},_setProfileImage:function(){var a=new RSImageObject,b=null;!this._winnerInfo.fb_id||RSEngine.loginMode!=LOGIN_MODE.WEB_FACEBOOK&&RSEngine.loginMode!=LOGIN_MODE.FACEBOOK||(b=this.getImageURL());b&&(a.setImageFromUrl(b,this._profilePicMaskArea.x,this._profilePicMaskArea.y,this._profilePicMaskArea.w,this._profilePicMaskArea.h),this.mask=new RSClippingNode(RSUtils.createBasicObject(this._popUpScreenName,this._profilePicMaskArea)), this.mask.setAlphaThreshold(80),this.mask.addChild(a),this.addChild(this.mask),this._profilePicMask.setZOrder(2))},getImageURL:function(){return"https://graph.facebook.com/"+this._winnerInfo.fb_id+"/picture?type\x3dsquare\x26access_token\x3d"+RSGame.getInstance().getGameManager().getFBAccessToken()},update:function(){var a=this._getTimeRemaining();a&&this._remainingTimeText&&this._remainingTimeText.setString(a)},onPlayerSupportClicked:function(){document.getElementById("Helpshift").style.display= "block";document.getElementById("helpshiftoverlay").style.display="block";RSAnalyticsManager.getInstance().trackGUIEvent("support","open","open_from_sweepstakes","","");this._playerSupportactive=!0},unloadContent:function(){this._super.unloadContent.call(this)}});var RSJackpotSweepstakesCooldownPopup=RSGenericPopup.extend({init:function(a,b,c,d,e,f,g,h){this._assetFolder=a;this._fonts=b;this._rewardTime=c;this._super.init.call(this,f);this._popupTriggered=d;this._termsAndConditionsUrl=e;this._rewardHistoryEnabledStatus=g;this._openFrom=h?h:RSAnalyticsManager.getInstance().getCurrentMachineName();d?RSAnalyticsManager.getInstance().trackGUIEvent("sweepstakes","sweepstakes_popup","trigger",""):RSAnalyticsManager.getInstance().trackPlayerAction("sweepstakes", "click","open_from_"+this._openFrom,"","")},loadContent:function(){this.layoutScreen(this._assetFolder);this._super.loadContent.call(this)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);this._popupTriggered||RSAnalyticsManager.getInstance().trackPlayerAction("sweepstakes_cooldown","click","","","")},onObjectCreated:function(a,b,c){this._super.onObjectCreated.call(this,a,b,c);switch(c.name){case "Sweepstakes":a.stopAnimation();break;case "FireworksLeft":this._fireWorkLeft=c; break;case "PreviousWinnersBtn":"0"==this._rewardHistoryEnabledStatus&&a.setVisible(!1),this._previousWinnersBtn=a}},createCustomObject:function(a,b){switch(b.name){case "SuccessText":var c=RSGame.getInstance().getGameData().getPopupTextWithKey("SweepstakesCoolDownSuccessText")?RSGame.getInstance().getGameData().getPopupTextWithKey("SweepstakesCoolDownSuccessText"):RSGame.getInstance().getStringDictionary("JackpotSweepstakesPopup").H5,c=c.replace(/\\n/g,"\n"),c=new RSLabelBMFont(c,this._fonts.NORMAL_TEXT, 2*b.w,kTEXT_ALIGNMENT_CENTER);c.setCenter(b.x,b.y);c.setScale(this._fonts.DOLLAR_VALUE_TEXT_SCALE?this._fonts.DOLLAR_VALUE_TEXT_SCALE:".55");this.addChild(c);break;case "TimerLbl":this._remainingTimeText=new RSLabelBMFont("".toString(),this._fonts.BIG_TIMER,2*b.w,kTEXT_ALIGNMENT_CENTER);this._remainingTimeText.setCenter(b.x,b.y);this.addChild(this._remainingTimeText);this._remainingTimeText.setScale(this._fonts.BIG_TIMER_WITH_CLOCK_SCALE?this._fonts.BIG_TIMER_WITH_CLOCK_SCALE:".65");break;case "FireworksRight":b.name= this._fireWorkLeft.name;this._fireWorkRight=RSUtils.createBasicObject(a,b);this._fireWorkRight.setScaleX(-1);this.addChild(this._fireWorkRight);break;case "WinBarText":c="WIN $"+RSSweepstakesManager.getSweepstakesRewardValue()+"!",c=new RSLabelBMFont(c,this._fonts.REWARD_TEXT,2*b.w,kTEXT_ALIGNMENT_CENTER),c.setCenter(b.x,b.y),this.addChild(c),this._fonts.ENTRY_REWARD_TEXT_SCALE&&c.setScale(this._fonts.ENTRY_REWARD_TEXT_SCALE)}return this._super.createCustomObject.call(this,a,b)},onButtonClicked:function(a){switch(a){case "InfoBtn":RSAnalyticsManager.getInstance().trackPlayerAction("sweepstakes_ official_rules", "click","open_from_cooldown_popup","","");window.open(this._termsAndConditionsUrl,"_blank");break;case "SupportBtn":this.onPlayerSupportClicked();break;case "CloseBtn":RSEventManager.getInstance().dispatchEvent("onSweepstakesPopupClose");this._popupTriggered?RSAnalyticsManager.getInstance().trackGUIEvent("sweepstakes","sweepstakes_popup","close",""):(RSAnalyticsManager.getInstance().trackPlayerAction("sweepstakes_cooldown","close","","",""),RSAnalyticsManager.getInstance().trackPlayerAction("sweepstakes", "close","open_from_"+this._openFrom,"",""));this.closePopup();break;case "PreviousWinnersBtn":this._previousWinnersBtn.setTouchEnabled(!1),this.closePopup(),RSSweepstakesManager.showJackpotSweepstakesWinnersList()}return this._super.onButtonClicked.call(this,a)},_getTimeRemaining:function(){var a=this._rewardTime-TimeManager.getInstance().getCurrentServerTime();0==a&&this._remainingTimeText&&(cc.log("Time reached"),RSSweepstakesManager.fetchSweepstakesStatus(),this.closePopup());return 86400>a?RSUtils.formattedTime(a): ~~(a/86400)+1+" Days"},update:function(){var a=this._getTimeRemaining();a&&this._remainingTimeText&&this._remainingTimeText.setString(a)},onPlayerSupportClicked:function(){document.getElementById("Helpshift").style.display="block";document.getElementById("helpshiftoverlay").style.display="block";RSAnalyticsManager.getInstance().trackGUIEvent("support","open","open_from_sweepstakes","","");this._playerSupportactive=!0},unloadContent:function(){this._super.unloadContent.call(this)}});var RSJackpotSweepstakesPreviousWinnersScreen=RSGameScreen.extend({init:function(a,b,c,d){this._super.init.call(this);this.callBack=b;this._font=c;this._rayVisibilityFlag=!1;this._termsAndConditionsUrl=d;this.layoutScreen(a)},loadContent:function(){this._super.loadContent.call(this)},createCustomObject:function(a,b){var c=0;switch(b.name){case "PreviousWinnersHolder":this._previousWinnerHolder=b;break;case "WinnerItem":this._winnerItemHolder=b;break;case "LeaderboardScrollArea":this._leaderboardScrollArea= b;break;case "Player":this._nameOfLatestWinner=new RSScaledLabel("",this._font?this._font:RSGame.getInstance().getGameManager().getDefaultCasinoFont("Semi","Bold"),b,kTEXT_ALIGNMENT_CENTER);this.addChild(this._nameOfLatestWinner);this._nameOfLatestWinner.setZOrder(2);break;case "RewardAmount1":this._rewardOfRank1=new RSScaledLabel("",RSGame.getInstance().getGameManager().getDefaultCasinoFont("Semi","Bold"),b,kTEXT_ALIGNMENT_CENTER);this.addChild(this._rewardOfRank1);break;case "BadgeAnimLeft":c=b.h/ this._badgeAnimData.h;this._rankAnim1Left=RSUtils.createAnimation("LeaderboardBadgeAnim",b,0.3);this._rankAnim1Left.setScale(c);this._rankAnim1Left.setZOrder(1);this.addChild(this._rankAnim1Left);this._rankAnim1Left.stopAnimation();break;case "BadgeAnimRight":c=b.h/this._badgeAnimData.h;this._rankAnim1Right=RSUtils.createAnimation("LeaderboardBadgeAnim",b,0.3);this._rankAnim1Right.setZOrder(1);this.addChild(this._rankAnim1Right);this._rankAnim1Right.setScaleX(-c);this._rankAnim1Right.setScaleY(c); this._rankAnim1Right.stopAnimation();break;case "RankUpAnimHolder1":this._rankUpAnimHolder1=new RSPoint(b.x,b.y);this._rankUpAnimHolder1Panel=new RSPanel(b.x,b.y,b.w,b.h);this.addChild(this._rankUpAnimHolder1Panel);break;case "ScrollBarArea":this._scrollArea=b;break;case "PlayerItemBottomRect":this._playerBottomRect=b}},onObjectCreated:function(a,b,c){switch(c.name){case "RankMask":this._profilePicMaskArea=c;this._profileMask=a;this._screenName=b;this._imageHolder=new RSImageObject;this.addChild(this._imageHolder); break;case "UpArrow":this._scrollerUpBtn=a;this._scrollerUpBtn.setVisible(!1);break;case "DownArrow":this._scrollerDownBtn=a;this._scrollerDownBtn.setVisible(!1);break;case "MiddleButton":this._scrollerBtn=a;this._scrollerBtn.setVisible(!1);break;case "ScrollBase":this._scrollBase=a;break;case "PlayerItemGlowAnimLeft":this._playerItemGlowAnimLeft=a;this._playerItemGlowAnimLeft.stopAnimation();this._playerItemGlowAnimLeft.setVisible(!1);break;case "PlayerItemGlowAnimRight":this._playerItemGlowAnimRight= a;this._playerItemGlowAnimRight.stopAnimation();this._playerItemGlowAnimRight.setVisible(!1);this._playerItemGlowAnimRight.setScaleX(-1);break;case "BadgeAnimLeft":case "BadgeAnimRight":a.stopAnimation();a.setVisible(!1);this._badgeAnimData=c;break;case "RankPosition":this._rankPosition1=a;this._rankPosition1.setZOrder(1);break;case "RankBase":this._rankBase=a;this._rankBase.setZOrder(1);break;case "BottomRectShade":this._bottomRectShade=a;this._bottomRectShade.setVisible(!1);break;case "TopShade":this._topShade= a;this._topShadeData=c;break;case "RaysGlow":this._raysGlow=a,this._raysGlow.actionRotateBy(-1,365,-1,null)}},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);RSGame.getInstance().getGameManager().setSideMenuVisibility(!1);this.populateHistoryData();this._showBadgeAnimations();RSAnalyticsManager.getInstance().trackPlayerAction("sweepstakes_previous_winners","click","","","")},populateHistoryData:function(){this._rewardHistory=RSSweepstakesManager.getRewardHistory();this._initializeScroller(); this._setLatestWinner()},loadComplete:function(){},_changeZOrderOfBg:function(){this._bg.setZOrder(-1);this._leaderboardBg.setZOrder(-1)},onButtonClicked:function(a){switch(a){case "CloseBtn":RSAnalyticsManager.getInstance().trackPlayerAction("sweepstakes_previous_winners","close","","","");this.callBack&&this.callBack();break;case "InfoBtn":RSAnalyticsManager.getInstance().trackPlayerAction("sweepstakes_ official_rules","click","open_from_previous_winners_popup","",""),window.open(this._termsAndConditionsUrl, "_blank")}},_showLeaderBoardScreen:function(){},_initializeScroller:function(){this._scroller=new RSBarScroller(new RSRect(this._previousWinnerHolder.x,this._previousWinnerHolder.y,this._previousWinnerHolder.w,this._previousWinnerHolder.h),new RSSize(this._winnerItemHolder.w,this._winnerItemHolder.h),0,RSScrollerDirection.RSSCROLLER_VERTICAL,1);this.addChild(this._scroller);this._scroller.setButtonScroll(this._scrollerBtn);this._scroller.setScrollBase(this._scrollArea);this._updateScroller();var a= new RSDisplayObject(new RSRect(this._previousWinnerHolder.x,this._previousWinnerHolder.y,this._previousWinnerHolder.w,this._previousWinnerHolder.h));this.addChild(a);a.setAnchorPoint(0.5,0.5);this._scroller.setMouseWheelScrollBase(a)},_updateScroller:function(){var a=this._rewardHistory.length;for(index=0;index=a&&this._scrollBase.setVisible(!1)},_setLatestWinner:function(){this._nameOfLatestWinner.setString(this._getFormattedName(this._rewardHistory[0].name)); this.setprofileImage()},_getFormattedName:function(a){var b=a.substr(0,1).toUpperCase();return a=a.substr(0,0)+b+a.substr(1,a.length)},getImageURL:function(){return"https://graph.facebook.com/"+this._rewardHistory[0].fb_id+"/picture?typelarge\x26height\x3d300\x26width\x3d300\x26access_token\x3d"+RSGame.getInstance().getGameManager().getFBAccessToken()},setprofileImage:function(){var a=new RSImageObject,b=this._rewardHistory[0].userId,c=this._rewardHistory[0].fb_id;if(RSEngine.loginMode!=LOGIN_MODE.WEB_FACEBOOK&& RSEngine.loginMode!=LOGIN_MODE.FACEBOOK||!c)if(b.includes("RS")||b.includes("blob")){if("0"==this._rewardHistory[0].avatarId)return;a.loadFrameWithName("AvatarImages_00/"+this._rewardHistory[0].avatarId+".png");a.setCenter(this._profilePicMaskArea.x,this._profilePicMaskArea.y);this._profileMask.setVisible(!1)}else a.setImageFromUrl(this.getImageURL(),this._profilePicMaskArea.x,this._profilePicMaskArea.y,this._profilePicMaskArea.h,this._profilePicMaskArea.h);else a.setImageFromUrl(this.getImageURL(), this._profilePicMaskArea.x,this._profilePicMaskArea.y,this._profilePicMaskArea.h,this._profilePicMaskArea.h);this._mask=RSUtils.createBasicObject(this._screenName,this._profilePicMaskArea);this._mask.setZOrder(-1);this.mask=new RSClippingNode(this._mask);this.mask.setAlphaThreshold(100);this.mask.addChild(a);this.addChild(this.mask)},update:function(){RSGame.getInstance().getGameManager().setSideMenuVisibility(!1)},_showBadgeAnimations:function(){RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetFolder("RSLeaderboardScreen")+ "Top.mp3",!1);this._rankAnim1Right.playAnimation(1,0.3,this._onBadgeAnimationCompleted.bind(this));this._rankAnim1Left.playAnimation(1,0.3)},_onBadgeAnimationCompleted:function(){this._rankAnim1Right.setVisible(!1);this._rankAnim1Left.setVisible(!1)},unloadContent:function(){this._scroller&&this._scroller.removeAllChildren();RSEventManager.getInstance().removeEventListenersIn(this);this._super.unloadContent.call(this);GlobalVars.musicStatus&&RSEngine.audioManager.unMuteMusic()}});var RSJackpotSweepstakesWinnerItem=RSDisplayObject.extend({_rank:0,_imageUrl:"",_name:"",_value:0,_gameType:"",_cellType:"",_enableBlurBg:!1,_winAmountValue:0,_rewardAmountValue:0,_rank:0,_disableVisibility:!1,_rewardClaimed:!1,init:function(a,b,c){a=new RSRect(0,0,a.w,a.h);this._playerData=b;this._super.init.call(this,a);this._font=c;this.loadContent()},loadContent:function(){this.loadLayout(RSGame.getInstance().getAssetPath("JackpotSweepstakesWinnerItem"))},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this); this._rewardClaimed&&this._pendingImage.setVisible(!1)},createCustomObject:function(a,b){switch(b.name){case "ClaimedDate":this._playerData.claimed.includes("/")&&(this._playerRank=new RSScaledLabel(this._playerData.claimed,this._font,b,kTEXT_ALIGNMENT_LEFT),this.addChild(this._playerRank),this._rewardClaimed=!0);break;case "Name":var c="",c=this._getFormattedName(this._playerData.name);this._playerName=new RSScaledLabel(c,this._font,b,kTEXT_ALIGNMENT_LEFT);this.addChild(this._playerName);break;case "WinAmout":this._rewardAmount= new RSScaledLabel("$"+this._playerData.win,this._font,b,kTEXT_ALIGNMENT_LEFT);this.addChild(this._rewardAmount);break;case "DrawDate":this._winAmount=new RSScaledLabel(this._playerData.draw,this._font,b,kTEXT_ALIGNMENT_LEFT),this.addChild(this._winAmount)}},onObjectCreated:function(a,b,c){switch(c.name){case "Pending":this._pendingImage=a;break;case "LeaderboardItemBg":this._leaderboardBgAnimation=a,this._leaderboardBgAnimation.stopAnimation(),this._enableBlurBg?(this._leaderboardBgAnimation.setFrame(2), this._leaderboardBgAnimation.setZOrder(2)):this._playerData.user_id==RSEngine.dataManager.getMe().getId()&&this._leaderboardBgAnimation.setFrame(1)}},_getFormattedName:function(a){var b=a.substr(0,1).toUpperCase();return a=a.substr(0,0)+b+a.substr(1,a.length)}});var RSRelaunchPopup=RSGenericPopup.extend({init:function(a){GlobalVars.relaunchPopupActive=!0;var b={layout:RSGame.getInstance().getAssetPath("RSRelaunchPopup"),assetPath:RSGame.getInstance().getAssetPath("RSRelaunchPopup"),font:RSGame.getInstance().getGameManager().getDefaultCasinoFont("medium","bold","stroke")?RSGame.getInstance().getGameManager().getDefaultCasinoFont("medium","bold","stroke"):RSGame.getInstance().getGameManager().getDefaultCasinoFont("large","bold"),wordList:RSGame.getInstance().getStringDictionary("RSRelaunchPopup")}; this._assetList=[{name:RSGame.getInstance().getAssetPath("RSRelaunchPopup"),count:1}];this._super.init.call(this,a,b);this._callback=a},loadContent:function(){this.layoutScreen(this._assetList);this._super.loadContent.call(this)},onObjectCreated:function(a,b,c){this._super.onObjectCreated.call(this,a,b,c);switch(c.name){case "LargeBtn":this._connectBtn=a}},createCustomObject:function(a,b){switch(b.name){case "TextLabel":this.text=new RSScaledLabel(RSGame.getInstance().getStringDictionary("RSRelaunchPopup").text1, RSGame.getInstance().getGameManager().getConnectionLostPopupTextFont()?RSGame.getInstance().getGameManager().getConnectionLostPopupTextFont():RSGame.getInstance().getGameManager().getDefaultCasinoFont("large","bold"),b,kTEXT_ALIGNMENT_CENTER);this.addChild(this.text);break;case "Heading":this.text=new RSScaledLabel(RSGame.getInstance().getStringDictionary("RSRelaunchPopup").H1,RSGame.getInstance().getGameManager().getDefaultCasinoFontForHeading("bold")?RSGame.getInstance().getGameManager().getDefaultCasinoFontForHeading("bold"): RSGame.getInstance().getGameManager().getDefaultCasinoFont("large","bold"),b,kTEXT_ALIGNMENT_CENTER),this.addChild(this.text)}return this._super.createCustomObject.call(this,a,b)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this)},onButtonClicked:function(a){switch(a){case "CP_Button_T1":case "ReconnectBtn":case "CloseBtn":RSEngine.reloadPage()}}});var RSPlayerConnectManager={handleMachineEvents:function(a,b,c,d,e,f){switch(a){case "redeemCoins":this._redeemItem(b,c,d,e);break;case "connectClubM":a=null;b&&(a=b);RSGame.getInstance().getGameManager().connectPlayerIdWithCasino(null,this.mClubConnectUpdate.bind(this),a,"loyalty_mall");break;case "loyaltymall_player_action":"loyalty_mall_contact_us"==b&&("banned"==e?window.open(RSEngine.gameData.getDefaultValues().playerConnectContactLink,"_blank"):showHelpShift(),RSAnalyticsManager.getInstance().trackPlayerAction(b, c,d,e,"",""));"loyalty_mall_privacy_policy"==b&&(RSAnalyticsManager.getInstance().trackPlayerAction(b,c,"","","",""),window.open(RSGame.getInstance().getGameData().getDefaultValues().playerConnectPrivacyPolicy,"_blank"));"loyalty_mall_terms"==b&&(RSAnalyticsManager.getInstance().trackPlayerAction(b,c,"","","",""),window.open(RSGame.getInstance().getGameData().getDefaultValues().playerConnectTos,"_blank"));"loyalty_mall_social"==b&&(RSAnalyticsManager.getInstance().trackPlayerAction(b,c,"","","",""), "click_fb"==c&&window.open(RSGame.getInstance().getGameData().getDefaultValues().playerConnectFbUrl,"_blank"),"click_ig"==c&&window.open(RSGame.getInstance().getGameData().getDefaultValues().playerConnectInstagramUrl,"_blank"),"click_twt"==c&&window.open(RSGame.getInstance().getGameData().getDefaultValues().playerConnectTwitterUrl,"_blank"));"loyalty_mall_item_desc"==b&&RSAnalyticsManager.getInstance().trackPlayerAction(b,c,"",e,"","");"loyalty_mall_confirmpopup"==b&&RSAnalyticsManager.getInstance().trackPlayerAction(b, c,d,e,"","");"show_disclaimer"==b&&window.open(c);"loyalty_mall_info_popup"==b&&RSAnalyticsManager.getInstance().trackPlayerAction(b,c,"","","","");break;case "loyaltymall_game_action":"loyalty_mall_orders"==b[0]&&RSAnalyticsManager.getInstance().trackInHouseEvent("gui",b[0],b[1],"","","");"loyalty_mall_user_info"==b[0]&&RSAnalyticsManager.getInstance().trackInHouseEvent("gui",b[0],b[1],b[2],b[3],"");"loyalty_mall_success"==b[0]&&RSAnalyticsManager.getInstance().trackInHouseEvent("gui",b[0],b[1], b[2],b[3],b[4]);"support"==b[0]&&"open"==b[1]&&(document.getElementById("helpshift").src=GameConfig.HELPSHIFT_URL+"?contact\x3d1",showHelpShift(b[2]));"loyalty_mall_maxlimit"!=b[0]&&"loyalty_mall_banned"!=b[0]&&"loyalty_mall_block"!=b[0]||RSAnalyticsManager.getInstance().trackInHouseEvent("gui",b[0],b[1],b[2],b[3],b[4]);break;case "loyaltymall_economy_event":RSAnalyticsManager.getInstance().trackInHouseEvent("economy",b,c,d,e,f);break;case "loyaltymall_analytics":RSAnalyticsManager.getInstance().trackInHouseEvent(b[0], b[1],b[2],b[3],b[4],b[5])}},sendLMJSONRPCRequest:function(a,b,c,d,e,f){RSEngine.networkManager.sendJSONRPCRequest(b+"."+c,d,this.onLmRequestResponse.bind(this,c),this.onLmRequestResponse.bind(this,c))},onLmRequestResponse:function(a,b){var c={type:"genericResponse",method:a,response:btoa(encodeURIComponent(JSON.stringify(b)))};RSEngine.externalGameManager.updateLoyaltyMallData(c)},_redeemItem:function(a,b,c,d){RSEngine.externalGameManager&&RSEngine.externalGameManager.hideExternalGame();RSEngine.screenManager.addOverlay(); var e=TimeManager.getInstance().getCurrentServerTime(),f={userId:RSEngine.dataManager.getMe().getId(),productId:a,price:b,sessionId:GlobalVars.sessionId};d&&(f.categoryId=d);d=[];d[0]=JSON.stringify(f);d[1]=e;c=calcMD5(d.join("|")+"|"+c);RSEngine.dataManager.redeemItem(f,e,c,this._onRedeemItemSucces.bind(this,b),this._onRedeemItemFailed.bind(this,a))},_onRedeemItemSucces:function(a,b){RSEngine.screenManager.removeOverlay();cc.log("on succes");200==b.result.status&&(RSEngine.externalGameManager.updateLoyaltyMallData({status:!0, rewardpoints:b.result.data.rewardPoints,type:"redeem"}),RSAnalyticsManager.getInstance().trackInHouseEvent("economy","free_source_coins","loyalty_mall_coin_redemption",b.result.data.coinRewarded,b.result.data.name,b.result.data.OrderId),b.result.data.free_claimed_points&&0h.conditionSatisfiedCount)this._currentActionEvent=d[e],f=h.conditionSatisfiedCount}else this._currentActionEvent= d[e];g=!0}return g}return this._checkForEventInTriggeredEventList()},getEventDataFromEventList:function(a,b){if(a&&b&&this._eventListFromServer.hasOwnProperty(a)){var c=0,d={},d=[],e=0,f=0,g=null,h=null;for(c in this._eventListFromServer)if(c==a&&(d=this._eventListFromServer[c],d.hasOwnProperty(b)))for(e in d=d[b],d)if(e=parseInt(e),d[e].triggerEvent==b)if(h=d[e].triggerCondition){if(h.conditionSatisfiedCount=h.conditionSatisfiedCount?h.conditionSatisfiedCount:0,0==e||f>h.conditionSatisfiedCount)g= d[e],f=h.conditionSatisfiedCount}else g=d[e];return g}return null},_checkForEventInTriggeredEventList:function(){var a=0;if(this._triggeredEventList.length)for(a in this._triggeredEventList)if(this._triggeredEventList[a].event==this._currentActionObject.event&&this._triggeredEventList[a].parameter==this._currentActionObject.parameter)return!0;return!1},performAction:function(a){if("quest_ad"==a.triggerAction.action)cc.log("skipping limit checking in the case of quest ad");else if("survey"==a.triggerAction.action)this._rewardedSurveyCapCount> this._rewardedSurveyForTheDay||cc.log("Limit reached for survey..");else if("House Ad"==a.triggerAction.action){var b=!1;if(this._rewardedAdCapCount<=this._rewardedAdsForTheDay||this._coolDownTimeEndAt>TimeManager.getInstance().currentServerTime){RSEventManager.getInstance().dispatchEvent("onEventDayCapReached",{placementName:a.triggerAction.analyticsName});cc.log("Day cap reached or in cool down time");return}b=this._checkForTriggerCondition(a.triggerCondition)?this._checkForActionValidity(a):!1; if(!b)return;cc.log("Perform action")}switch(a.triggerAction.perform){case "show":cc.log("SHOWING AD OF :"+a.triggerEvent);this._eventPlacementName=a.triggerEvent;this._performShowActions(a.triggerAction);break;case "SALE":cc.log("SHOWING Carousal OF :"+a.triggerEvent);this._performShowActions(a.triggerAction);break;default:cc.log("Untracked action")}},getEventActionName:function(){return this._currentActionEvent.triggerAction.action},_performShowActions:function(a){switch(a.action){case "reward video ad":parseInt(a.pre_info_status)? RSEngine.popupManager.addPopup(new RSAdPopup("prompt",a.rewards,a.analyticsName,this._responseFromAdPromptPopup.bind(this),RSAdsPopupConfig,a.actionLifeTime),!1):this._checkAndTriggerAdPopup("rewarded",a.analyticsName,a.rewards.coin);break;case "interstitial ad":this._checkAndTriggerAdPopup("interstitial",a.analyticsName);break;case "quest_ad":this._checkAndTriggerAdPopup("interstitial",a.analyticsName,0,!0);break;case "survey":RSAnalyticsManager.getInstance().trackVideoBonusEvent("survey","rewarded", "click",a.analyticsName,"pollfish");RSPollFishManager.showPollFishSurvey(a);break;case "House Ad":parseInt(a.pre_info_status)?RSEngine.popupManager.addPopup(new RSAdPopup("prompt",a.rewards,a.analyticsName,this._responseFromAdPromptPopup.bind(this),RSAdsPopupConfig,a.actionLifeTime,"house_ads_youtube"),!1):RSEngine.popupManager.addPopup(new RSInHouseVideoPopup(a.analyticsName),!0);break;case "ooc_carousel":case "sale":PurchaseFlowManager.getInstance().setShowPurchaseCart(!1),RSSaleManager.getInstance().showSalePopupWithTag("ooc_carousel", !0)}},_checkAndTriggerAdPopup:function(a,b,c,d){VideoManager.getInstance().getAdBlockerStatus()?(d&&RSEventManager.getInstance().dispatchEvent("videoNotAvailable"),showCrossLinkBlockerMessage()):(this._currentAdType=a,VideoManager.getInstance().showAd(a,b,c,d))},_checkForActionValidity:function(a){cc.log("Checking action validity");var b=!0,c=parseInt(a.triggerAction.repeatCountPerDay),d=parseInt(a.triggerAction.repeatCountPerSession);if(0parseInt(a.count)&&(b=!0,cc.log("Condition satisfied: Resetting to default value"), a.updatedCount=0)}else cc.log("Condition satisfied"),b=!0;return b},clearEvent:function(){RSUtils.removeLocalStorageItem(this._currentActionObject.event+"_"+this._currentActionObject.parameter)},resetMachinesTriggerConditionCount:function(){},_setRewardedDayCapForTheDay:function(){var a=RSGame.getInstance().getUserDataManager().getMe().getVideoWatchCount("HouseAd");this._rewardedAdsForTheDay=parseInt(a.split("_")[1]);var b=new Date(1E3*parseInt(a.split("_")[0])),c=new Date,d=b.getDay(),a=c.getDay(), b=(c.getTime()-b.getTime())/1E3;if(d!=a||172800a&&this._widgetRenewal&&(this._widgetRenewal=!1,RSEngine.screenManager.addOverlay(),RSSubscrptionSaleManager.getCollectedDates("",this.onDataFetchingSuccess.bind(this)))},onDataFetchingSuccess:function(a){RSSubscrptionSaleManager.getNextSubscriptionBonusCollectTime()?(RSEngine.screenManager.removeOverlay(),this._callBack()):this.scheduleFunctionOnce(function(){this._scroller.removeAllChildren(); this.setupCalendarObjects()}.bind(this),1)}}),RSSubscriptionSaleCalendarObjects=RSDisplayObject.extend({init:function(a,b,c){this._super.init.call(this,new RSRect(0,0,b.w,b.h));this._dayStatus=RSSubscrptionSaleManager.getCalendarArray(a);this._currentDay=c;this.loadLayout(RSGame.getInstance().getAssetPath("SubscriptionSaleCalendarTileWidget"))},onObjectCreated:function(a,b,c){this._super.onObjectCreated.call(this,a,b,c);switch(c.name){case "NeonBg":this._neonBg=a;break;case "TickAnim":this._tickAnim= a,this._tickAnim.setVisible(!1),this._tickAnim.stopAnimation()}},createCustomObject:function(a,b){switch(b.name){case "OneMillion":this._oneMillion=RSUtils.createBasicObject(a,b);this.addChild(this._oneMillion);this._oneMillion.setVisible(!1);break;case "Overlay":this._overlay=RSUtils.createBasicObject(a,b);this._overlay.setVisible(!1);this.addChild(this._overlay);break;case "FilledTick":this._filledTick=RSUtils.createBasicObject(a,b);this._filledTick.setVisible(!1);this.addChild(this._filledTick); break;case "Tick":this._Tick=RSUtils.createBasicObject(a,b);this._Tick.setVisible(!1);this.addChild(this._Tick);break;case "Days":this._days=RSPlatformFontAssetManager.createCustomLabel(this._dayStatus.day,b);this.addChild(this._days);break;case "Amount":var c=RSUtils.formatNumber(this._dayStatus.amount);this._amount=RSPlatformFontAssetManager.createCustomLabel(c,b);this.addChild(this._amount);this._amount.setVisible(!0)}},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);this._dayStatus.collected? (this._amount.setVisible(!1),this._filledTick.setVisible(!0)):this._dayStatus.dayRSSubscrptionSaleManager.getTrialDays()&&this._overlay.setVisible(!0)},playAnimation:function(a,b){this._dayStatus.collected||(this._tickAnim.playAnimation(1,0.8,this.setAnimation.bind(this,a,b)),this._tickAnim.setVisible(!0),this._amount.setVisible(!1))},setAnimation:function(a,b){this._tickAnim.stopAnimation(); this._tickAnim.setVisible(!1);this._Tick.setVisible(!1);this._filledTick.setVisible(!0);RSSubscrptionSaleManager.getCollectedDates(RSSubscrptionSaleManager.getCurrentDate("date"),"");var c=a.getDisplayObject()._calculateItemPositionWithAnchor(a.getDisplayObject().getItem(this._currentDay-1),{x:1,y:1}),d=this._currentDay%8;0==d&&(d=8);var e=this._neonBg.getSize()._width,f=this._neonBg.getSize()._height;c.x+=d*e;1!=d&&(f*=2);c.y+=f;d=new RSPanel(this._neonBg.getX(),this._neonBg.getY(),70,70);d.setPosition(c.x, c.y);d.setZOrder(10);b.addChild(d);c=new RSPoint(this._neonBg.getX(),this._neonBg.getY());RSCasinoManager.getCasinoHUD().playCoinReceivedAnimation(c,d);RSEngine.externalGameManager&&RSEngine.externalGameManager.isSpinGameActive()&&RSEngine.externalGameManager.updateCoin(RSGame.getInstance().getUserDataManager().getMe().getCoins());RSSubscrptionSaleManager.getisTrial()?RSAnalyticsManager.getInstance().trackInHouseEvent(RSEventCategory.ECONOMY,"free_source_coins","purchase_bonus_day"+this._currentDay, RSSubscrptionSaleManager.getItemValue(),RSSubscrptionSaleManager.getPackName(),""):(c=parseInt(RSSubscrptionSaleManager.getItemValue()),c=RSGame.getInstance().getUserDataManager().getMe().getPaidCoins()+c,0=a&&(this.setCalendar(),this.setNextBonusWidget(!1),this._timerRunning= !1,this.onCollectButtonActive(!0))},setCalendar:function(){0>=RSSubscrptionSaleManager.getNextSubscriptionBonusCollectTime()-TimeManager.getInstance().getCurrentServerTime()&&this._widgetRenewal&&(this._widgetRenewal=!1,RSEngine.screenManager.addOverlay(),RSSubscrptionSaleManager.getCollectedDates("",this.onDataFetchingSuccess.bind(this)))},onDataFetchingSuccess:function(){this._widgetRenewal||RSEngine.screenManager.removeOverlay();this._widgetRenewal=!0},onWidgetTouch:function(){if(""!=this._currentWidgetState)this.onButtonClicked(this._currentWidgetState)}, onButtonClicked:function(a){switch(a){case "SubscribeButton":case "SubscriptionButton":RSSubscrptionSaleManager.showSubscriptionSalePopup(this._source,this.subscriptionPopupCallback.bind(this));break;case "CollectButton":case "SubscriptionCollectBtn":this._collectButton.setTouchEnabled(!1);RSAnalyticsManager.getInstance().trackGUIEvent(this._source,"subscription_collect","click",RSSubscrptionSaleManager.getPackName());RSEngine.popupManager.addPopup(new RSSubscriptionSaleCalendarPopup(this._source, this.subscriptionPopupCallback.bind(this,!0)),!0);break;case "SaleTimerButton":this._saleTimerButton.setTouchEnabled(!1);RSAnalyticsManager.getInstance().trackGUIEvent(this._source,"subscription_timer","click",RSSubscrptionSaleManager.getPackName());RSEngine.popupManager.addPopup(new RSSubscriptionSaleCalendarPopup(this._source,this.saleTimerButtonEnable.bind(this,!0)),!0);break;case "Buy":RSGame.getInstance().getGameManager().onBuyCoinsBtnClicked()}},saleTimerButtonEnable:function(a){this._saleTimerButton.setTouchEnabled(a)}, subscriptionPopupCallback:function(a){this._collectButton&&this._collectButton.setTouchEnabled(a);RSEventManager.getInstance().dispatchEvent("resumeWidgetAnimation",null);this._ccObject&&this.updateTimer()},onSubscriptionCompletes:function(){if(RSSubscrptionSaleManager.getCalendarData())if(this.setsubscriptionWidget(!1),RSSubscrptionSaleManager.getCurrentDayClaimedStatus()){if(30==RSSubscrptionSaleManager.getCurrentDayNo()&&"true"==RSSubscrptionSaleManager.getIsCancelled()){this.onCollectButtonActive(!1); RSSaleManager.getInstance().getSubscriptionSaleStatus()&&"US"==RSGame.getInstance().getUserDataManager().getMe().getCountryCode()?this.setsubscriptionWidget(!0):this.setBuyCoinsWidget(!0);return}this.updateTimer()}else this.onCollectButtonActive(!0);if(GameConfig.SUBSCRIPTION_ENABLED&&RSGame.getInstance().getUserDataManager().getMe().getIsSubscriptionInteruptedShownStatus()&&(RSEngine.loginMode==LOGIN_MODE.FACEBOOK||RSEngine.loginMode==LOGIN_MODE.WEB_FACEBOOK)){if(RSSubscrptionSaleManager.getCalendarData())this.onCollectButtonActive(!1); this.setWidget()}console.log("On subscription success#"+this._source)},startTextToggling:function(){RSGame.getInstance().getUserDataManager().getMe().getIsSubscriptionInteruptedShownStatus()&&(this._toggleAnimEnabled=!1);if(this._toggleAnimEnabled){this._subscriptionText2.setVisible(!1);this._subscriptionText1.setVisible(!0);this._subscriptionText1.setScaleY(0.48);var a=this._subscriptionText1.actionScale(0.25,0.48,0.26,this._onScaleDownCompletedForText1.bind(this));RSTweener.easeSineIn(a)}else this._subscriptionText2.setVisible(!0), this._subscriptionText1.setVisible(!1)},_onScaleDownCompletedForText1:function(){if(this._toggleAnimEnabled){this._subscriptionText1.setVisible(!1);this._subscriptionText2.setScaleY(0.26);this._subscriptionText2.setVisible(!0);var a=this._subscriptionText2.actionScale(0.25,0.48,0.48,this.onScaleUpCompletedText2.bind(this));RSTweener.easeSineIn(a)}},onScaleUpCompletedText2:function(){RSUtils.callFunctionWithDelay(2,this,this.startTogglingSection2.bind(this))},startTogglingSection2:function(){if(this._toggleAnimEnabled){var a= this._subscriptionText2.actionScale(0.25,0.48,0.26,this.onScaleDownCompletedText2.bind(this));RSTweener.easeSineIn(a)}},onScaleDownCompletedText2:function(){if(this._toggleAnimEnabled){this._subscriptionText2.setVisible(!1);this._subscriptionText1.setVisible(!0);this._subscriptionText1.setScaleY(0.26);var a=this._subscriptionText1.actionScale(0.25,0.48,0.48,this.onScaleUpCompletedText1.bind(this));RSTweener.easeSineIn(a)}},onScaleUpCompletedText1:function(){RSUtils.callFunctionWithDelay(2,this,this.startTextToggling.bind(this))}, stopTextToggling:function(){},unload:function(){RSEventManager.getInstance().removeEventListenersIn(this);clearInterval(this._subscriptionRemainingTime);this._super.unload.call(this)}});var RSCartItem=RSDisplayObject.extend({_callBack:null,_assetList:null,_saleDetails:null,_currentPowerPackData:null,_layoutLoadedCount:null,_selectedType:null,_currentPackData:null,_bannerBar:null,_usBannerBar:null,_purchasedTag:[],_purchaseReward:[],_purchasePrice:[],_purchaseRewardData:[],_purchasePriceData:[],_packSelected:0,_popupTimerObject:null,_popupTimerText:null,_timeRemaining:0,_onSaleTriggered:!1,_buttonList:[],_pricePosition:{},_amountTxts:[],_rewardTxts:[],_rewardEnergyTxts:[],_rewardPowerupTxts:[], _rewardInstantBingoTxts:[],_priceTxts:[],_strikeOutPriceTxts:[],_multiplierTxts:[],_isPurchaseCart:!1,_animationType:null,_strikeOutAnimationEnabled:!1,_coinRollupSaleAnimationEnabled:!1,_currencyType:null,_salePackIndex:0,_firstPurchase:!1,_finalValue:0,_rewardpointsOnPurchasePerDollar:0,_purchaseCartAndLabelsInitialized:!1,init:function(a,b,c,d){a=new RSRect(0,0,a.w,a.h);this._layoutLoadedCount=0;this._isPurchaseCart=b;this._currencyType=c;this._salePackIndex=d;this._isPurchaseCart?RSPlatformFontAssetManager.loadFontConfigFile(RSGame.getInstance().getAssetPath("SaleFontConfigJson"), "SaleCartWidgetFontConfig.json"):RSSaleManager.getInstance().getSaleResourceByName("SaleWidgetFontConfig",!0)?(b=RSSaleManager.getInstance().getSaleResourceByName("SaleWidgetFontConfig",!0),c=RSSaleManager.getInstance().getSaleVO().saleName,RSPlatformFontAssetManager.loadFontConfigFile(b,c+"_SaleWidgetFontConfig.json")):RSPlatformFontAssetManager.loadFontConfigFile(RSGame.getInstance().getAssetPath("SaleFontConfigJson"),"SaleWidgetFontConfig.json");this._rewardTxts=[];this._rewardEnergyTxts=[];this._rewardPowerupTxts= [];this._rewardInstantBingoTxts=[];this._priceTxts=[];this._strikeOutPriceTxts=[];this._multiplierTxts=[];this._purchasedTag=[];this._buttonList=[];this._currentVipStatus=parseInt(RSVIPManager.getInstance().getVIPUserTier());this._rewardpointsOnPurchasePerDollar=parseInt(RSEngine.gameData.getDefaultValues().rewardpointsOnPurchasePerDollar)?parseInt(RSEngine.gameData.getDefaultValues().rewardpointsOnPurchasePerDollar):0;this._super.init.call(this,a);this.loadContent();this._buttonList=[];this._purchaseReward= [];this._purchasePrice=[];this._purchaseRewardData=[];this._purchasePriceData=[];this._callBack=null;this._amountTxts=[];this._selectedType="";this._isCloseButtonClicked=this._onSaleTriggered=!1;RSSalePopupGlobal=this;this._isPurchaseCart||RSEventManager.getInstance().addEventListener("onTimerTick",this,this._setTimerValues.bind(this));RSEventManager.getInstance().addEventListener("onPurchaseSuccessClosed",this,this.closePopup.bind(this))},getName:function(){return"RSSalePopup"},_setTimerValues:function(a){this._timeRemaining= a._userData.timeRemaining;0=this._saleDetails.userPurchasableCount)for(a=0;a=this._saleDetails.userPurchasableCount)for(var g=0;g=this._saleDetails.userPurchasableCount)for(a=0;a=this._saleDetails.userPurchasableCount)for(var g= 0;g=this._toggleButtonArray.length||this._setOptOutButtonStatus()}, _setOptOutButtonStatus:function(){this._toggleButtonStatus[this._toggleButtonStatus.length-1]=0;this._toggleButtonArray[this._toggleButtonArray.length-1].setFrame(0)},onButtonClicked:function(a){RSUtils.getLocalStorageItem("sfxStatus",!0)&&RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetPath("ButtonClick_SFX"),!1,!0);switch(a){case "TOSBtn":window.open(this._data.TOSUrl,"_blank");break;case "PrivacyBtn":window.open(this._data.privacyPolicyUrl,"_blank");break;case "AcceptBtn":this._acceptBtn.setTouchEnabled(!1), RSEngine.screenManager.addOverlay(),this._setCCPA()}},handleObjectTouchAt:function(a,b,c){RSUtils.getLocalStorageItem("sfxStatus",!0)&&RSEngine.audioManager.playEffect(RSGame.getInstance().getAssetPath("ButtonClick_SFX"),!1,!0);a=a._ccObject._name.split("RadioButton")[1]-1;this._toggleButtonStatus[a]=0=this._toggleButtonStatus.length||a!=this._toggleButtonStatus.length-1)&&1==this._toggleButtonStatus[a]&&(b=!0);b?this._acceptBtn.setTouchEnabled(!1):this._acceptBtn.setTouchEnabled(!0)},_setCCPA:function(){var a=null;1=this._toggleButtonStatus.length||a!=this._toggleButtonStatus.length-1)&&1==this._toggleButtonStatus[a]&&(b=!0);b?this._acceptBtn.setTouchEnabled(!1): this._acceptBtn.setTouchEnabled(!0)},_setCCPA:function(){var a=null;1a;a++)7==a&&RSEngine.dataManager.getMe().getId(),RSEngine.dataManager.getMe().getUserFirstName();return this._tournamentLBData},getUserCurrentData:function(){var a={};a.imageURL=RSEngine.dataManager.getMe().getImageUrl(); a.id=RSEngine.dataManager.getMe().getId();a.name=RSEngine.dataManager.getMe().getUserFirstName();a.win=0;a.rank=0;a.reward=700;return this._playerLBData?this._playerLBData:this._playerLBData=a},getUserRank:function(){return this._playerRank},getTop3PlayersData:function(){for(var a=[],b=0;3>b;b++){var c={};c.avatar_id=10+b;c.user_id=0==b?RSEngine.dataManager.getMe().getId():"RS_100";c.first_name=RSEngine.dataManager.getMe().getUserFirstName()+b;c.coins=100*b+100;c.rank=b+1;c.reward=1E5*(3-b);c.fbid= 0==b?RSEngine.dataManager.getMe().getFBId():null;a.push(c)}return this._top3PlayersData},sendInvitation:function(a){RSEngine.screenManager.addOverlay();var b=new RSGiftingAppRequest;b.TITLE="Add your friends";b.MESSAGE="Come join me in "+RSGame.getInstance().getGameManager().getGameName();b.TARGETS=a;b.FILTER=["app_non_users"];RSSocialManager.getInstance().showInviteWindow(b.TITLE,b.MESSAGE,b.TARGETS,null,this._onInviteCompleted.bind(this))},_onInviteCompleted:function(){cc.log("on invite completd"); RSEngine.screenManager.removeOverlay()},setTournamentTimerData:function(a){cc.log("Remaing sec :"+a);this._tournamentTimingdata.tournamentEndTime=TimeManager.getInstance().getCurrentServerTime()+a;this._tournamentTimingdata.tournamentStartTime=TimeManager.getInstance().getCurrentServerTime()-10},getUpdatedTournamentTimerData:function(){return this._tournamentTimingdata},startHudTimerToggleAnimation:function(){RSCasinoManager.getCasinoHUD().startTournamentTimerToggleAnimation()},tournamentStartsIn:function(){var a= this._tournamentTimingdata.tournamentStartTime-TimeManager.getInstance().getCurrentServerTime();return 0=d&& this._tournamentTimingdata.tournamentEndTime>TimeManager.getInstance().getCurrentServerTime()?RSTournamentManager.getTournamentSurfacingEnabledStatus()==TOURNAMENT_SURFACING_TYPES.TOURNAMENT_IN_PROGRESS?RSTournamentManager.showTournamentSurfacing(null):(c||(this._fromSlider=!0,RSAnalyticsManager.getInstance().trackInHouseEvent(RSEventCategory.GUI,"slider","tournamania","click","","")),RSGame.getInstance().getGameManager().loadTournament()):b?(RSGame.getInstance().getGameManager().showOverlayLayer(), this.getTournamentLBData(!1,this.onLBDataUpdated.bind(this,a))):RSTournamentManager.getTournamentSurfacingEnabledStatus()==TOURNAMENT_SURFACING_TYPES.TOURNAMENT_OVER||RSTournamentManager.getTournamentSurfacingEnabledStatus()==TOURNAMENT_SURFACING_TYPES.FEATURE_ANNOUNCEMENT?RSEngine.popupManager.addPopup(new RSTournamentInfoPopup(this.onTournamentSurfacingCompleted.bind(this,null,!1),RSTournamentManager.getTournamentSurfacingEnabledStatus(),!0),!0,!0,!0,!1):RSTournamentManager.getTournamentSurfacingEnabledStatus()!= TOURNAMENT_SURFACING_TYPES.BEFORE_FEATURE_LAUNCH&&RSTournamentManager.getTournamentSurfacingEnabledStatus()!=TOURNAMENT_SURFACING_TYPES.TOURNAMENT_IN_PROGRESS||RSTournamentManager.showTournamentSurfacing(null)}},showTournamentLeaderboardOnButtonClick:function(){RSGame.getInstance().getGameManager().showOverlayLayer();this.getTournamentLBData(!1,this.onLBDataUpdated.bind(this,!0))},onLBDataUpdated:function(a){RSGame.getInstance().getGameManager().hideOverlayLayer();this.showTournamentLeaderboardScreen(a)}, getTournamentLBEndTime:function(){return this._tournamentEndTime},getCurrentPSTTime:function(){return this._currentPSTTime},getTournamentTimingData:function(){return this._tournamentTimingInfo},showTournamentSurfacing:function(a){switch(RSTournamentManager.getTournamentSurfacingEnabledStatus()){case TOURNAMENT_SURFACING_TYPES.TOURNAMENT_OVER:a();break;case TOURNAMENT_SURFACING_TYPES.FEATURE_ANNOUNCEMENT:this._tournamentAnnouncementPopupCallBack=a;this.setTournamentFeatureAnnouncementData();RSEngine.popupManager.addPopup(new RSTournamentInfoPopup(this.onTournamentSurfacingCompleted.bind(this, a,!1),RSTournamentManager.getTournamentSurfacingEnabledStatus(),!0,!0),!0,!0,!0,!1);break;case TOURNAMENT_SURFACING_TYPES.TOURNAMENT_IN_PROGRESS:case TOURNAMENT_SURFACING_TYPES.BEFORE_FEATURE_LAUNCH:this._tournamentAnnouncementPopupCallBack=a,this.setTournamentFeatureAnnouncementData(),RSEngine.externalGameManager&&RSEngine.externalGameManager.hideExternalGame(),RSGame.getInstance().getGameManager().setSideMenuVisibility(!1),RSEngine.audioManager.setMusicVolume(0.2),GlobalVars.isSurfacingActive=!0, this.tournamentSurfacingScreen=new RSTournamentSurfacingScreen(this.onTournamentSurfacingCompleted.bind(this,a,!0)),RSEngine.screenManager.addScreen(this.tournamentSurfacingScreen),RSGame.getInstance().getUserDataManager().getMe().setTournamaniaSurfacingShownStatus()}},onTournamentSurfacingCompleted:function(a,b,c,d){RSEngine.screenManager.removeScreen(this.tournamentSurfacingScreen);RSEngine.audioManager.setMusicVolume(1);switch(c){case TOURNAMENT_SURFACING_TYPES.TOURNAMENT_IN_PROGRESS:"CloseBtn"== d?(SideMenuController.getInstance().playSurfacingAnimation("surfacing"),this._tournamentSurfacingAnimationTimer=setTimeout(this.playSurfacingAnimation.bind(this),1E3)):"Lets'GoBtn"==d&&(this._fromAnnouncementPopup=!0,RSGame.getInstance().getGameManager().loadTournament("tournamania_announcement"),a&&(a(!0),a=null));break;case TOURNAMENT_SURFACING_TYPES.BEFORE_FEATURE_LAUNCH:"Lets'GoBtn"==d?(this._fromAnnouncementPopup=!0,RSGame.getInstance().getGameManager().loadTournament("tournamania_announcement"), a&&(a(!0),a=null)):"PreviousWinnersBtn"==d?(this._fromAnnouncementPopup=!0,RSTournamentManager.onTournamentBtnClicked(!0,!0)):(SideMenuController.getInstance().playSurfacingAnimation("surfacing"),this._tournamentSurfacingAnimationTimer=setTimeout(this.playSurfacingAnimation.bind(this),1E3));break;case TOURNAMENT_SURFACING_TYPES.TOURNAMENT_OVER:"PreviousWinnersBtn"==d&&(this._fromAnnouncementPopup=!0,RSTournamentManager.onTournamentBtnClicked(!0,!0));"Lets'GoBtn"==d&&(this._fromAnnouncementPopup=!0, RSGame.getInstance().getGameManager().loadTournament("tournamania_announcement"),a&&(a(!0),a=null));b&&"CloseBtn"==d&&(SideMenuController.getInstance().playSurfacingAnimation("surfacing"),this._tournamentSurfacingAnimationTimer=setTimeout(this.playSurfacingAnimation.bind(this),1E3));break;case TOURNAMENT_SURFACING_TYPES.FEATURE_ANNOUNCEMENT:"Lets'GoBtn"==d&&(this._fromAnnouncementPopup=!0,RSGame.getInstance().getGameManager().loadTournament("tournamania_announcement"),a&&(a(!0),a=null)),"PreviousWinnersBtn"== d&&(this._fromAnnouncementPopup=!0,RSTournamentManager.onTournamentBtnClicked(!0,!0)),!b||"CloseBtn"!=d&&"OKBtn"!=d||(SideMenuController.getInstance().playSurfacingAnimation("surfacing"),this._tournamentSurfacingAnimationTimer=setTimeout(this.playSurfacingAnimation.bind(this),1E3))}this._tournamentAnnouncementPopupCallBack&&"PreviousWinnersBtn"==d?cc.log("W8ting for LB response"):a&&a()},playSurfacingAnimation:function(){SideMenuController.getInstance().playSurfacingAnimation()},triggerAnalyticsEvents:function(a, b,c,d){switch(a){case "TournamentRoomState":this._fromAnnouncementPopup?RSAnalyticsManager.getInstance().trackLobbyEntry(b,"","open_from_tournamania_announcement",""):this._fromSlider?RSAnalyticsManager.getInstance().trackLobbyEntry(b,"","open_from_slider",""):RSAnalyticsManager.getInstance().trackLobbyEntry(b,"","open_from_"+RSGameScreenManager.getInstance().getPreviousScreen(),"");break;case "analytics_tournament_sink":RSAnalyticsManager.getInstance().trackInHouseEvent("tournamania_game_action", "tournamania_sink",d?d:"",b.value,b.param,c);break;case "tournamania_game_action":RSAnalyticsManager.getInstance().trackInHouseEvent(a,b[0],"",b[1].toString(),b[2],b[3]);this._lastPlayedTournamentID=b[3];break;case "analytics_tournament_source":RSAnalyticsManager.getInstance().trackInHouseEvent("tournamania_game_action","tournamania_source",d?d:"",b.value,b.param,c);break;case "tournamania_player_action":"tournamania_info"==b&&RSAnalyticsManager.getInstance().trackPlayerAction(b,c,"open_from_tournamania_lobby", "",""),"tournamania_rules"==b&&(RSAnalyticsManager.getInstance().trackPlayerAction(b,c,"tournamania_lobby","",""),RSGame.getInstance().getGameManager().showRulesPopup()),"tournamania_quitpopup"==b&&("click"==c&&RSCasinoManager.getCasinoHUD().disableAllButtons(),"close"==c&&RSCasinoManager.getCasinoHUD().enableAllButtons())}this._fromSlider=this._fromAnnouncementPopup=!1},getTournamentMachineId:function(){return this._touramentMachineId},getTournamentId:function(){return this._tournamentId},showTournamentRewardScreen:function(a, b){RSEngine.externalGameManager&&RSEngine.externalGameManager.hideExternalGame();RSGame.getInstance().getGameManager().setSideMenuVisibility(!1);var c=[{name:RSGame.getInstance().getAssetPath("LeaderboardBg"),count:1},{name:RSGame.getInstance().getAssetPath("RSLeaderboardBadgeAnim"),count:1},{name:RSGame.getInstance().getAssetPath("RSLeaderboardFireworksAnim"),count:1},{name:RSGame.getInstance().getAssetPath("RSLeaderboardRewardScreenFireworks"),count:1},{name:RSGame.getInstance().getAssetPath("RSLeaderboardRewardScreen"), count:2}];this._tournamentRewardScreen=new RSLeaderboardRewardScreen(c,a,b,this._removeTournamentRewardScreen.bind(this),"Tournamania");RSEngine.screenManager.addScreen(this._tournamentRewardScreen)},_removeTournamentRewardScreen:function(){cc.log("Removing Tournament reward screen");RSEngine.screenManager.removeScreen(this._tournamentRewardScreen);RSEngine.externalGameManager.showExternalGame();RSGame.getInstance().getGameManager().setSideMenuVisibility(!0);RSRewardManager.onRewardPopupClosed("Leaderboard")}, claimTournamentReward:function(a,b,c,d){RSGame.getInstance().getUserDataManager().claimRewardFromRewardManager(a,this._onRewardClaimed.bind(this,a,b,c,d))},_onRewardClaimed:function(a,b,c,d,e){e.result&&e.result.status&&200==e.result.status&&(RSCasinoManager.addPrimaryCurrencyForDisplay("Tournament_Reward",parseInt(b)),RSAnalyticsManager.getInstance().trackPrimarySource(RSAnalyticsSource.free,"tournamania_win_rank"+c,b,d,a))},getTournamentInfoPopupTexts:function(){var a={};a.text1=RSGame.getInstance().getGameData().getPopupTextWithKey("TournamaniaInfo1").replace(/\\n/g, "\n");a.text2=RSGame.getInstance().getGameData().getPopupTextWithKey("TournamaniaInfo2").replace(/\\n/g,"\n");a.text3=RSGame.getInstance().getGameData().getPopupTextWithKey("TournamaniaInfo3").replace(/\\n/g,"\n");a.text4=RSGame.getInstance().getGameData().getPopupTextWithKey("TournamaniaInfo4").replace(/\\n/g,"\n");return a},getTournamentOverText:function(){return this._tournamentOverText},getTournamentLBStatusMsg:function(){return this._tournamentStatusMsg},getTournamentReward:function(){cc.log("Started Fetching pending tournament rewards........ "); clearTimeout(this._tournamentRewardFetchingTimeOut);RSGame.getInstance().getUserDataManager().getUserDataObjets(this.onTournamentRewarddataFetched.bind(this),this.getTournamentReward.bind(this))},onTournamentRewarddataFetched:function(a){cc.log("Fetching pending tournament rewards completed");var b=DynamoDBParser.decode(a.result.data);a=b.rewardList;b=b.lastPlayedTournamentID;if(a&&b&&a.hasOwnProperty(b)&&this._lastClaimedTournamentRewardId!=b){cc.log("pending rewards available.......");var c={}; c[b]=a[b];c[b].placement=RSPlatformEventTypeKeys.TOURNAMENT_REWARD;RSRewardManager.updateLeaderboardReward(c,this._onTournamentRewardUpdated.bind(this))}else cc.log("No pending rewards.......")},_onTournamentRewardUpdated:function(){cc.log("On tournament reward updated.......")},getTournamentSurfacingEnabledStatus:function(){if(GameConfig.TOURNAMENT_ENABLED&&parseInt(RSEngine.gameData.getDefaultValues().isTournamentEnabled)){if(!RSGame.getInstance().getUserDataManager().getMe().getTournamaniaSurfacingShownStatus()&& (this._tournamentDayTime||0=a)return!0}return!1},setTournamentFeatureAnnouncementData:function(){var a=GameConfig.TOURNAMENT_DAY,b=RSGame.getInstance().getUserDataManager().getMe().getLocalSessionData("TMAnnouncement"),b={date:Math.floor(Math.floor((new Date).getTime()/1E3)/a)*a,sessionCount:0};RSGame.getInstance().getUserDataManager().getMe().setLocalSessionData("TMAnnouncement",b)},isTournamentFirst:function(){return this._isTodaysFirst},getIntermediateMessageTime:function(){return this._intermediateMessageTime}, getIntermediateBubbleStatus:function(){var a=TimeManager.getInstance().getCurrentServerTime(),b=this._tournamentEndTime+this._intermediateMessageTime;GlobalVars.isTournamentLoaded||a!=b||"gameplay_screen"!=RSGameScreenManager.getInstance().getCurrentScreen()&&!GlobalVars.isjackpotLoaded||SideMenuController.getInstance().playSurfacingAnimation("IntermediateBubbleInfo");return a>=b&&a<=b+10}};var RSTournamentCrownWidget=RSDisplayObject.extend({init:function(a,b){var c=new RSRect(0,0,a.w,a.h);this._super.init.call(this,c);RSPlatformFontAssetManager.loadFontConfigFile(RSGame.getInstance().getAssetFolder("TournamentWinnerScreen"),"TournamentWinnerScreenFontConfig.json");this._top3PlayersData=RSTournamentManager.getTop3PlayersData();this._playerNameLimit=9;this._crownAnimationEnabled=b;this.loadContent()},loadContent:function(){var a=RSGame.getInstance().getAssetPath("LeaderboardCrownWidget"); this.loadLayout(a)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);this.setProfileImages();this._crownAnimationEnabled&&this._showBadgeAnimations();this.scheduleFunctionOnce(this._showPlayerCrownAnimation.bind(this),1)},createCustomObject:function(a,b){switch(b.name){case "RankReward1":var c=RSUtils.formatNumberWithComma(this._top3PlayersData[0].reward),c=RSPlatformFontAssetManager.createCustomLabel(c,b);this.addChild(c);break;case "RankReward2":c=RSUtils.formatNumberWithComma(this._top3PlayersData[1].reward); c=RSPlatformFontAssetManager.createCustomLabel(c,b);this.addChild(c);break;case "RankReward3":c=RSUtils.formatNumberWithComma(this._top3PlayersData[2].reward);c=RSPlatformFontAssetManager.createCustomLabel(c,b);this.addChild(c);break;case "PlayerName1":c=this.getUpdatedName(RSGame.getInstance().getGameManager().getUpdatedUserForDisplay(this._top3PlayersData[0].name));RSEngine.dataManager.getMe().getId()==this._top3PlayersData[0].id&&(c="You");c&&(c=c.charAt(0).toUpperCase()+c.slice(1));c=RSPlatformFontAssetManager.createCustomLabel(c, b);this.addChild(c);c.setZOrder(3);break;case "PlayerName2":c=this.getUpdatedName(RSGame.getInstance().getGameManager().getUpdatedUserForDisplay(this._top3PlayersData[1].name));RSEngine.dataManager.getMe().getId()==this._top3PlayersData[1].id&&(c="You");c&&(c=c.charAt(0).toUpperCase()+c.slice(1));c=RSPlatformFontAssetManager.createCustomLabel(c,b);this.addChild(c);c.setZOrder(3);break;case "PlayerName3":c=this.getUpdatedName(RSGame.getInstance().getGameManager().getUpdatedUserForDisplay(this._top3PlayersData[2].name)); RSEngine.dataManager.getMe().getId()==this._top3PlayersData[2].id&&(c="You");c&&(c=c.charAt(0).toUpperCase()+c.slice(1));c=RSPlatformFontAssetManager.createCustomLabel(c,b);this.addChild(c);c.setZOrder(3);break;case "BadgeAnimLeft":case "BadgeAnimRight":this._badgeAnimData=b;break;case "RankAnim1Left":this._badgeAnimData=b;scaleRatio=b.h/this._badgeAnimData.h;b.name="BadgeAnimLeft";this._rankAnim1Left=RSUtils.createAnimation("LeaderboardBadgeAnim",b,0.3);this._rankAnim1Left.setScale(scaleRatio);this._rankAnim1Left.setZOrder(1); this.addChild(this._rankAnim1Left);this._rankAnim1Left.stopAnimation();break;case "RankAnim1Right":scaleRatio=b.h/this._badgeAnimData.h;b.name="BadgeAnimRight";this._rankAnim1Right=RSUtils.createAnimation("LeaderboardBadgeAnim",b,0.3);this._rankAnim1Right.setZOrder(1);this.addChild(this._rankAnim1Right);this._rankAnim1Right.setScaleX(-scaleRatio);this._rankAnim1Right.setScaleY(scaleRatio);this._rankAnim1Right.stopAnimation();break;case "RankAnim2Left":scaleRatio=b.h/this._badgeAnimData.h;b.name="BadgeAnimLeft"; this._rankAnim2Left=RSUtils.createAnimation("LeaderboardBadgeAnim",b,0.3);this._rankAnim2Left.setScale(scaleRatio);this._rankAnim2Left.setZOrder(1);this.addChild(this._rankAnim2Left);this._rankAnim2Left.setScaleX(scaleRatio);this._rankAnim2Left.stopAnimation();break;case "RankAnim2Right":scaleRatio=b.h/this._badgeAnimData.h;b.name="BadgeAnimRight";this._rankAnim2Right=RSUtils.createAnimation("LeaderboardBadgeAnim",b,0.3);this._rankAnim2Right.setZOrder(1);this.addChild(this._rankAnim2Right);this._rankAnim2Right.setScaleX(-scaleRatio); this._rankAnim2Right.setScaleY(scaleRatio);this._rankAnim2Right.stopAnimation();break;case "RankAnim3Left":scaleRatio=b.h/this._badgeAnimData.h;b.name="BadgeAnimLeft";this._rankAnim3Left=RSUtils.createAnimation("LeaderboardBadgeAnim",b,0.3);this._rankAnim3Left.setZOrder(1);this._rankAnim3Left.setScale(scaleRatio);this.addChild(this._rankAnim3Left);this._rankAnim3Left.stopAnimation();break;case "RankAnim3Right":scaleRatio=b.h/this._badgeAnimData.h,b.name="BadgeAnimRight",this._rankAnim3Right=RSUtils.createAnimation("LeaderboardBadgeAnim", b,0.3),this._rankAnim3Right.setZOrder(1),this.addChild(this._rankAnim3Right),this._rankAnim3Right.setScaleX(-scaleRatio),this._rankAnim3Right.setScaleY(scaleRatio),this._rankAnim3Right.stopAnimation()}this._super.createCustomObject.call(this,a,b)},onObjectCreated:function(a,b,c){switch(c.name){case "RankMask1":this._profilePicMaskAreaOfRank1=c;this._rankMask1=a;this._screenName=b;this._imageHolder1=new RSImageObject;this.addChild(this._imageHolder1);break;case "RankMask2":this._profilePicMaskAreaOfRank2= c;this._rankMask2=a;this._imageHolder2=new RSImageObject;this.addChild(this._imageHolder2);break;case "RankMask3":this._profilePicMaskAreaOfRank3=c;this._rankMask3=a;this._imageHolder3=new RSImageObject;this.addChild(this._imageHolder3);break;case "RankBase1":case "RankBase2":case "RankBase3":a.setZOrder(2)}this._super.onObjectCreated.call(this,a,b,c)},getUpdatedName:function(a){a.length>=this._playerNameLimit&&(a=a.substring(0,this._playerNameLimit)+"..");return a},setProfileImages:function(){for(var a= 0,b=this._top3PlayersData.length,a=0;aa&&(b+="00:00:00",this._remainingTimerText.setVisible(!0)); 86400>a?(b+=RSUtils.formattedTime(a),this._remainingTimerText.setVisible(!0)):a?(b=~~(a/86400)+1+" Days",this._remainingTimerText.setString(b),this._remainingTimerText.setVisible(!0)):this._remainingTimerText.setVisible(!1);this._remainingTimerText.setString(b)},onButtonClicked:function(a){switch(a){case "InviteFriendsBtn":RSTournamentManager.sendInvitation([]);break;case "FBConnectBtn":RSAnalyticsManager.getInstance().trackPlayerAction("fb_connect","click","open_from_tournamania","",""),RSAnalyticsManager.getInstance().trackPlayerAction("tournamania", "link_fb","initiate","",""),RSLoginManager.getInstance().loginWithFacebook("tournamania")}},unload:function(){clearInterval(this._remainingTimer);this._super.unload.call(this)}});var RSTournamentHudTimerWidget=RSDisplayObject.extend({_bubbleTriggeredTime:null,_timerLost:!1,init:function(a,b,c){a=new RSRect(0,0,a.w,a.h);this._super.init.call(this,a);this._fonts=b;this._tournamentTimer=null;this._callBack=c;this.loadContent();this.updateTimerDataFromSmartFox();this.setName("HudTimerWidget")},loadContent:function(){var a=RSGame.getInstance().getAssetPath("TournamentHudTimer");this.loadLayout(a)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);this._tournamentTimerData|| this.updateTimerDataFromSmartFox();this._updateTournamentTexts();this._tournamentTimer=setInterval(this._updateTournamentTexts.bind(this),1E3)},createCustomObject:function(a,b){switch(b.name){case "Timer":this._tournamentTimerText=new RSScaledLabel("",this._fonts.inGameCountDownFont,b,kTEXT_ALIGNMENT_CENTER);this.addChild(this._tournamentTimerText);this._tournamentLastCountDownText=new RSScaledLabel("00:00:00",this._fonts.inGameCountDownFont,b,kTEXT_ALIGNMENT_CENTER);this.addChild(this._tournamentLastCountDownText); this._tournamentLastCountDownText.setVisible(!1);break;case "TorunamentTimer":this._tournamentInGameCountDownText=new RSScaledLabel("00:00:00",this._fonts.inGameCountDownFont,b,kTEXT_ALIGNMENT_CENTER),this.addChild(this._tournamentInGameCountDownText),this._tournamentInGameCountDownText.setVisible(!1)}this._super.createCustomObject.call(this,a,b)},onObjectCreated:function(a,b,c){switch(c.name){case "FlagRight":case "FlagLeft":a.stopAnimation();a.playAnimation(-1,0.3);break;case "Title":this._title= a;break;case "LiveSlotsTournamentText":this._liveSlotsTournamentText=a;this._liveSlotsTournamentText.setVisible(!1);break;case "InProgressText":this._inProgressText=a;this._inProgressText.setVisible(!1);break;case "StartsInText":this._startsInText=a;this._startsInText.setVisible(!1);break;case "TimerBlueGlow":this._timerBlueGlow=a;break;case "TimerRedGlow":this._timerRedGlow=a;break;case "TorunamentTimerBlueGlow":this._tournamentBlueGlow=a;break;case "TorunamentTimerRedGlow":this._tournamentRedGlow= a}this._super.onObjectCreated.call(this,a,b,c)},updateTimerDataFromSmartFox:function(){this._tournamentTimerData=RSTournamentManager.getUpdatedTournamentTimerData()},_updateTournamentTexts:function(){var a=this._tournamentTimerData.tournamentStartTime-TimeManager.getInstance().getCurrentServerTime();RSTournamentManager.isTournamentFirst()&&null==this._bubbleTriggeredTime&&a<=RSTournamentManager.getHudTimerStartsIn()&&RSLoginManager.getInstance().getCookie(GameConfig.COOKIE_PREFIX+"-bubbleShown")< this._tournamentTimerData.tournamentStartTime&&(this._bubbleTriggeredTime=a-5);this._playingState=null;if(!GlobalVars.isTournamentLoaded&&null!=this._bubbleTriggeredTime&&a>=this._bubbleTriggeredTime&&a<=RSTournamentManager.getHudTimerStartsIn()&&RSLoginManager.getInstance().getCookie(GameConfig.COOKIE_PREFIX+"-bubbleShown")<=this._tournamentTimerData.tournamentStartTime){var b={};b[GameConfig.COOKIE_PREFIX+"-bubbleShown"]=this._tournamentTimerData.tournamentStartTime;RSLoginManager.getInstance().setCookie(GameConfig.SSO_COOKIE_DOMAIN, null,b);this._playingState="";this._title.setVisible(!0);this._tournamentTimerText.setVisible(!1);this._liveSlotsTournamentText.setVisible(!0);this._inProgressText.setVisible(!1);this._tournamentLastCountDownText.setVisible(!1);this._tournamentInGameCountDownText.setVisible(!1);this._startsInText.setVisible(!1);this._timerBlueGlow.setVisible(!1);this._timerRedGlow.setVisible(!1);this._tournamentBlueGlow.setVisible(!1);this._tournamentRedGlow.setVisible(!1);this._callBack&&0<=a&&this._callBack(a,!0)}else 0< a&&10=a&&!GlobalVars.isTournamentLoaded?(this._inProgressText.setVisible(!1),this._liveSlotsTournamentText.setVisible(!1),this._tournamentTimerText.setVisible(!1),this._tournamentInGameCountDownText.setVisible(!1),this._tournamentLastCountDownText.setVisible(!0),this._tournamentLastCountDownText.setString(this._getTimeRemaining()),this._startsInText.setVisible(!0),this._timerBlueGlow.setVisible(!1),this._timerRedGlow.setVisible(!0), this._tournamentBlueGlow.setVisible(!1),this._tournamentRedGlow.setVisible(!1),5!=a||GlobalVars.isTournamentLoaded||"gameplay_screen"!=RSGameScreenManager.getInstance().getCurrentScreen()&&!GlobalVars.isjackpotLoaded||(SideMenuController.getInstance().playTournamentAnimation(a),this.scheduleFunctionOnce(function(){SideMenuController.getInstance().playTournamentAnimation(4)},0.5))):GlobalVars.isTournamentLoaded?(this._inProgressText.setVisible(!1),this._liveSlotsTournamentText.setVisible(!1),this._tournamentTimerText.setVisible(!1), this._title.setVisible(!1),this._tournamentLastCountDownText.setVisible(!1),this._tournamentInGameCountDownText.setVisible(!0),a=this._tournamentTimerData.tournamentEndTime-TimeManager.getInstance().getCurrentServerTime(),this._tournamentInGameCountDownText.setString(this._getTimeRemaining()),this._startsInText.setVisible(!1),this._timerBlueGlow.setVisible(!1),this._timerRedGlow.setVisible(!1),10a&&this._callBack&&this._callBack(a):a=this._tournamentTimerData.tournamentEndTime-TimeManager.getInstance().getCurrentServerTime(); if(0>a)return"00:00:00";if(86400>a)return RSUtils.formattedTime(a)},unload:function(){clearInterval(this._tournamentTimer);this._super.unload.call(this)}});var RSTournamentMessageBubbleWidget=RSDisplayObject.extend({init:function(a,b,c){a=new RSRect(0,0,a.w,a.h);this._super.init.call(this,a);this._fonts=b;this._tournamentTimer=null;this._callBack=c;RSPlatformFontAssetManager.loadFontConfigFile(RSGame.getInstance().getAssetFolder("HudMessageBubble"),"MessageBubbleFontConfig.json");this._assetFolder=RSGame.getInstance().getAssetFolder("HudMessageBubble");this.loadContent()},loadContent:function(){var a=RSGame.getInstance().getAssetPath("HudMessageBubble"); this.loadLayout(a)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this)},createCustomObject:function(a,b){switch(b.name){case "TournamentNotificationText":var c="Live Slots Tournament\nis about to start!";"MSP"==GameConfig.GAME_ID&&(c="Live Poker Tournament\nis about to start!");this._tournamentNotificationText=RSPlatformFontAssetManager.createCustomLabel(c,b);this.addChild(this._tournamentNotificationText);this._tournamentNotificationText.setCenter(b.x,b.y);c="Join the live \ntournaments today \nstarting at "+ (RSTournamentManager.getTournamentTimingData()?RSTournamentManager.getTournamentTimingData().titleKey3:"");this._tournamentEntryText=RSPlatformFontAssetManager.createCustomLabel(c,b);this.addChild(this._tournamentEntryText);this._tournamentEntryText.setCenter(b.x,b.y);this._tournamentEntryText.setVisible(!1);break;case "CountDownText":this._tournamentLastCountDownText=RSPlatformFontAssetManager.createCustomLabel("3",b),this.addChild(this._tournamentLastCountDownText),this._tournamentLastCountDownText.setVisible(!1)}this._super.createCustomObject.call(this, a,b)},onObjectCreated:function(a,b,c){switch(c.name){case "GoButton":this._goBtn=a;this._goBtn.setVisible(!1);break;case "GoButtonAnim":this._goBtnAnim=a;this._goBtnAnim.stopAnimation();this._goBtnAnim.setVisible(!1);break;case "MessageBubble":this._messageBubbleBg=a}this._super.onObjectCreated.call(this,a,b,c)},reset:function(){this._goBtn.setVisible(!1);this._goBtnAnim.setVisible(!1);this._goBtnAnim.stopAnimation()},updateCountDownText:function(a){0=a?("gameplay_screen"==RSGameScreenManager.getInstance().getCurrentScreen()|| GlobalVars.isjackpotLoaded?(cc.log("skip hud tooltips"),this._tournamentNotificationText.setVisible(!1),this._messageBubbleBg.setVisible(!1)):(this._tournamentLastCountDownText.setVisible(!0),this._tournamentLastCountDownText.setString(a),this._tournamentNotificationText.setVisible(!1),this._messageBubbleBg.setVisible(!0)),RSEngine.audioManager.playEffect(this._assetFolder+"Countdown.mp3",!1),GlobalVars.isTournamentLoaded||"gameplay_screen"!=RSGameScreenManager.getInstance().getCurrentScreen()&&!GlobalVars.isjackpotLoaded|| SideMenuController.getInstance().playTournamentAnimation(a)):0>=a?("gameplay_screen"==RSGameScreenManager.getInstance().getCurrentScreen()||GlobalVars.isjackpotLoaded?(cc.log("skip hud tooltips"),this._tournamentNotificationText.setVisible(!1),this._messageBubbleBg.setVisible(!1)):(this._tournamentLastCountDownText.setVisible(!1),this._tournamentNotificationText.setVisible(!1),this._messageBubbleBg.setVisible(!0),this._goBtn.setVisible(!0),this._goBtnAnim.setVisible(!0),this._goBtnAnim.playAnimation(-1, 0.3)),0==a&&RSEngine.audioManager.playEffect(this._assetFolder+"Go.mp3",!1),GlobalVars.isTournamentLoaded||0!=a||"gameplay_screen"!=RSGameScreenManager.getInstance().getCurrentScreen()&&!GlobalVars.isjackpotLoaded||SideMenuController.getInstance().playTournamentAnimation("GO!"),this.scheduleFunctionOnce(this.dismissWidget.bind(this),3)):0=this._leaderboarPlayerHolder.y?this._currentPlayerItem.setCenter(this._leaderboarPlayerHolder.x,this._leaderboarPlayerHolder.y):this._currentPlayerItem.setVisible(!1),this._bottomRectShade.setVisible(!1))}else this._currentPlayerItem&& (this._currentPlayerItem.setVisible(!0),this._bottomRectShade.setVisible(!0));this._scroller&&(a=this._scroller.getDisplayObject().getItem(0).getWorldPosition(),a.y=RSTournamentManager.tournamentStartsIn()?(this._letsGoBtn.setVisible(!0), this._letsGoBtn.actionZoomInOut(0.2,0.8,1,1,this._onBtnAnimationCompleted.bind(this))):GameConfig.TOURNAMENT_LIVE_DAYa?(this._animationsPlayed&&this.Timer.setVisible(!0),this.Timer.setString(RSUtils.formattedTime(a))):(this.Timer.setString(~~(a/86400)+1+" Days"),this._animationsPlayed&&this.Timer.setVisible(!0)),this.TimerText.setString("JOIN THE FUN AT TOURN-A-MANIA!"),this._animationsPlayed&&(this._startsIn.setVisible(!0),this._liveSignalAnimation.setVisible(!1), this._live.setVisible(!1),this._timerBase.setVisible(!0),10>=a?(this._timerBgPurpleRed.setVisible(!0),this._timerBgPurple.setVisible(!1)):(this._timerBgPurpleRed.setVisible(!1),this._timerBgPurple.setVisible(!0)),RSTournamentManager.getMachineRedirectionTime()>=a?(this._previousWinnersBtn.setVisible(!1),this._okBtn.setVisible(!1),this._letsGoBtn.setVisible(!0)):GameConfig.TOURNAMENT_LIVE_DAYb&&(this._animationsPlayed&&this.Timer.setVisible(!0),this.Timer.setString(RSUtils.formattedTime(b)),this.TimerText.setString("JOIN TOURN-A-MANIA NOW!")),this._animationsPlayed&&(this._startsIn.setVisible(!1),this._liveSignalAnimation.setVisible(!0),this._live.setVisible(!0),this._letsGoBtn.setVisible(!0),this._okBtn.setVisible(!1),this._timerBase.setVisible(!0), this._previousWinnersBtn.setVisible(!1),10>=b?(this._timerBgPurpleRed.setVisible(!0),this._timerBgPurple.setVisible(!1)):(this._timerBgPurpleRed.setVisible(!1),this._timerBgPurple.setVisible(!0)))):this._animationsPlayed&&(this._startsIn.setVisible(!1),this._timerBgPurple.setVisible(!1),this._timerBgPurpleRed.setVisible(!1),this._liveSignalAnimation.setVisible(!1),this._live.setVisible(!1),this._letsGoBtn.setVisible(!1),this._okBtn.setVisible(!1),this._timerBase.setVisible(!1),this._previousWinnersBtn.setVisible(!0), this.TimerText.setString("JOIN THE FUN AT TOURN-A-MANIA!"),this.Timer.setVisible(!1))}});var RSTournamentLeaderboardInfoPopup=RSGenericPopup.extend({init:function(a){this._assetList=[{name:RSGame.getInstance().getAssetPath("TournamaniaInfoPopup"),count:1}];RSPlatformFontAssetManager.loadFontConfigFile(RSGame.getInstance().getAssetFolder("TournamaniaInfoPopup"),"TournamentLeaderboardInfoPopupFontConfig.json");this._super.init.call(this);this._src=a},loadContent:function(){this.layoutScreen(this._assetList);this._super.loadContent.call(this)},onLayoutCompleted:function(){RSAnalyticsManager.getInstance().trackPlayerAction("tournamania_info", "click","open_from_"+this._src,"","");this._super.onLayoutCompleted.call(this)},onObjectCreated:function(a,b,c){this._super.onObjectCreated.call(this,a,b,c)},createCustomObject:function(a,b){switch(b.name){case "TournamaniaInfo1":var c=RSGame.getInstance().getGameData().getPopupTextWithKey("TournamaniaInfo1"),c=c.replace(/\\n/g,"\n"),c=RSPlatformFontAssetManager.createCustomLabel(c+"\n",b);this.addChild(c);break;case "TournamaniaInfo2":c=RSGame.getInstance().getGameData().getPopupTextWithKey("TournamaniaInfo2"); c=c.replace(/\\n/g,"\n");c=RSPlatformFontAssetManager.createCustomLabel(c+"\n",b);this.addChild(c);break;case "TournamaniaInfo3":c=RSGame.getInstance().getGameData().getPopupTextWithKey("TournamaniaInfo3");c=c.replace(/\\n/g,"\n");c=RSPlatformFontAssetManager.createCustomLabel(c+"\n",b);this.addChild(c);break;case "TournamaniaInfo4":c=RSGame.getInstance().getGameData().getPopupTextWithKey("TournamaniaInfo4"),c=c.replace(/\\n/g,"\n"),c=RSPlatformFontAssetManager.createCustomLabel(c+"\n",b),this.addChild(c)}return this._super.createCustomObject.call(this, a,b)},onButtonClicked:function(a){switch(a){case "CloseBtn":case "CP_Button_T1":RSAnalyticsManager.getInstance().trackPlayerAction("tournamania_info","close","open_from_"+this._src,"",""),this.closePopup()}}});var RSFBPermissionPromptPopup=RSGenericPopup.extend({_screenLayout:null,_okBtn:null,_msg:"",init:function(a){this._super.init.call(this);RSPlatformFontAssetManager.loadFontConfigFile(RSGame.getInstance().getAssetFolder("FBPermissionPromptPopup"),"FBPermissionPromptPopupFontConfig.json");this._assetList=[{name:RSGame.getInstance().getAssetPath("FBPermissionPromptPopup"),count:1}];this._promptPopupCallBack=a},loadContent:function(){this.layoutScreen(this._assetList);this._super.loadContent.call(this)}, onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this)},onObjectCreated:function(a,b,c){switch(c.name){case "Ok":this._okBtn=a}this._super.onObjectCreated.call(this,a,b,c)},createCustomObject:function(a,b){switch(b.name){case "PermissionText":var c=RSGame.getInstance().getGameData().getPopupTextWithKey("PermissionText");this._msg=RSPlatformFontAssetManager.createCustomLabel(c,b);this.addChild(this._msg)}return this._super.createCustomObject.call(this,a,b)},onButtonClicked:function(a){switch(a){case "CloseBtn":this._promptPopupCallBack(!1); this.closePopup();break;case "CP_Button_T1":this._promptPopupCallBack(!0),this.closePopup()}},unloadContent:function(){this._super.unloadContent.call(this);this._screenLayout=null}});var RSFirstOOCtRewardPopup=RSGenericPopup.extend({init:function(a){this._super.init.call(this,a);this._rewardValue=parseInt(RSGame.getInstance().getGameData().getDefaultValues().FirstOOCReward);RSAnalyticsManager.getInstance().trackPlayerActionLOC("ooc",RSAnalyticsManager.getInstance().getCurrentMachineName(),GameFeatureTypeEnum.PRIMARY_CURRENCY,"");RSAnalyticsManager.getInstance().trackGUIEvent("first_ooc","trigger","open_from_"+RSAnalyticsManager.getInstance().getCurrentMachineAnalyticsName(),""); RSPlatformFontAssetManager.loadFontConfigFile(RSGame.getInstance().getAssetFolder("FirstOOCRewardPopup"),"FirstOOCRewardPopupFontConfig.json")},loadContent:function(){this.layoutScreen(RSGame.getInstance().getAssetPath("FirstOOCRewardPopup"));this._super.loadContent.call(this)},onObjectCreated:function(a,b,c){this._super.onObjectCreated.call(this,a,b,c);switch(c.name){case "CollectBtn":this._btnCollect=a}},createCustomObject:function(a,b){switch(b.name){case "TextLabel":var c=RSGame.getInstance().getGameData().getPopupTextWithKey("FirstOOCRewardText"), c=RSPlatformFontAssetManager.createCustomLabel(c+"\n",b);this.addChild(c);break;case "CoinText":c=RSUtils.formatNumberWithComma(this._rewardValue),c=RSPlatformFontAssetManager.createCustomLabel(c,b),this.addChild(c)}return this._super.createCustomObject.call(this,a,b)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this)},onButtonClicked:function(a){switch(a){case "CollectBtn":this._btnCollect.setTouchEnabled(!1),this.collectReward()}},collectReward:function(){RSCasinoManager.addPrimaryCurrency(this._rewardValue, !0);RSGame.getInstance().getUserDataManager().getMe().setOOCFreeCoinsAwardedState(!0);RSEngine.dataManager.saveUserBlobParams();RSAnalyticsManager.getInstance().trackGUIEvent("first_ooc","collect","open_from_"+RSAnalyticsManager.getInstance().getCurrentMachineAnalyticsName(),"");RSAnalyticsManager.getInstance().trackInHouseEvent(RSEventCategory.ECONOMY,"free_source_coins","first_ooc",this._rewardValue,RSAnalyticsManager.getInstance().getCurrentMachineAnalyticsName(),"");var a=new RSRect(0,0,0,0); this._diplayPanel=new RSDisplayObject(a);this.addChild(this._diplayPanel);this._diplayPanel.setZOrder(1);a=this._diplayPanel.convertToNodeSpace(this._btnCollect.getX(),this._btnCollect.getY());RSCasinoManager.getCasinoHUD().playCoinReceivedAnimation(a,this._diplayPanel,this.onCoinAnimComplete.bind(this))},onCoinAnimComplete:function(){RSGame.getInstance().getGameManager().getGameType()===RSGameTypes.Bingo&&RSEngine.externalGameManager._updateMachineData({event:"post_message",name:"PURCHASE_SUCESS_DATA", message:"",timeStamp:TimeManager.getInstance().getCurrentServerTime()});RSEngine.externalGameManager&&RSEngine.externalGameManager.isSpinGameActive()&&RSEngine.externalGameManager.reloadExternalGame();this.closePopup()}});var RSMinBetRewardPopup=RSGenericPopup.extend({init:function(a,b){this._super.init.call(this,b);this._minBetValue=parseInt(a);RSPlatformFontAssetManager.loadFontConfigFile(RSGame.getInstance().getAssetFolder("MinBetRewardPopup"),"MinBetRewardPopupFontConfig.json")},loadContent:function(){this.layoutScreen(RSGame.getInstance().getAssetPath("MinBetRewardPopup"));this._super.loadContent.call(this)},onObjectCreated:function(a,b,c){this._super.onObjectCreated.call(this,a,b,c);switch(c.name){case "ThanksBtn":this._thanksBtn= a;break;case "CloseBtn":this._closeBtn=a;break;case "CoinBg":this._coinIcon=a}},createCustomObject:function(a,b){switch(b.name){case "MinBetTitleText":var c=RSPlatformFontAssetManager.createCustomLabel(RSGame.getInstance().getGameData().getPopupTextWithKey(b.name),b);this.addChild(c);break;case "MinBetBonusText":c=RSGame.getInstance().getGameData().getPopupTextWithKey(b.name);c=RSPlatformFontAssetManager.createCustomLabel(c+"\n",b);this.addChild(c);break;case "MinBetRewardText":c=RSUtils.formatNumberWithComma(this._minBetValue), c=RSPlatformFontAssetManager.createCustomLabel(c,b),this.addChild(c)}return this._super.createCustomObject.call(this,a,b)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);RSAnalyticsManager.getInstance().trackGUIEvent("ooc_topup_bonus","trigger","open_from_"+RSAnalyticsManager.getInstance().getCurrentMachineAnalyticsName(),"")},onButtonClicked:function(a){switch(a){case "ThanksBtn":case "CP_Button_T1":case "CloseBtn":this._thanksBtn.setTouchEnabled(!1),this._closeBtn.setTouchEnabled(!1), this.collectReward()}},collectReward:function(){RSCasinoManager.addPrimaryCurrency(this._minBetValue,!0);RSAnalyticsManager.getInstance().trackGUIEvent("ooc_topup_bonus","collect","open_from_"+RSAnalyticsManager.getInstance().getCurrentMachineAnalyticsName(),"");RSAnalyticsManager.getInstance().trackInHouseEvent(RSEventCategory.ECONOMY,"free_source_coins","ooc_topup",this._minBetValue,RSAnalyticsManager.getInstance().getCurrentMachineAnalyticsName(),"");var a=new RSRect(0,0,0,0);this._diplayPanel= new RSDisplayObject(a);this.addChild(this._diplayPanel);this._diplayPanel.setZOrder(1);a=this._diplayPanel.convertToNodeSpace(this._coinIcon.getX(),this._coinIcon.getY());RSCasinoManager.getCasinoHUD().playCoinReceivedAnimation(a,this._diplayPanel,this.closePopup.bind(this))}});var RSLOCOOCNotificationPopup=RSGenericPopup.extend({init:function(a){this._super.init.call(this,a);RSPlatformFontAssetManager.loadFontConfigFile(RSGame.getInstance().getAssetFolder("LOCOOCNotificationPopup"),"LOCOOCNotificationPopupFontConfig.json")},loadContent:function(){this.layoutScreen(RSGame.getInstance().getAssetPath("LOCOOCNotificationPopup"));this._super.loadContent.call(this)},onObjectCreated:function(a,b,c){this._super.onObjectCreated.call(this,a,b,c)},createCustomObject:function(a,b){switch(b.name){case "OOCTitleText":var c= RSPlatformFontAssetManager.createCustomLabel(RSGame.getInstance().getGameData().getPopupTextWithKey(b.name),b);this.addChild(c);break;case "OOCText":c=RSGame.getInstance().getGameData().getPopupTextWithKey(b.name);c=RSPlatformFontAssetManager.createCustomLabel(c+"\n",b);this.addChild(c);break;case "OOCText1":c=RSGame.getInstance().getGameData().getPopupTextWithKey(b.name),c=RSPlatformFontAssetManager.createCustomLabel(c+"\n",b),this.addChild(c)}return this._super.createCustomObject.call(this,a,b)}, onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this);RSAnalyticsManager.getInstance().trackPlayerActionLOC("ooc",RSAnalyticsManager.getInstance().getCurrentMachineName(),GameFeatureTypeEnum.PRIMARY_CURRENCY,"");RSAnalyticsManager.getInstance().trackGUIEvent("ooc_popup","trigger","open_from_"+RSAnalyticsManager.getInstance().getCurrentMachineAnalyticsName(),"")},onButtonClicked:function(a){RSPlacementManager.getInstance().getInterface().clearCurrentPopupTriggered();switch(a){case "LobbyBtn":RSAnalyticsManager.getInstance().trackGUIEvent("ooc_popup", "lobby","open_from_"+RSAnalyticsManager.getInstance().getCurrentMachineAnalyticsName(),"");RSGame.getInstance().getGameManager().setMinimumBetOfLastPlayedMachine();RSCasinoManager.getCasinoHUD().onBackButton(!0);this.closePopup();break;case "ShopBtn":GlobalVars.isPurchaseEnabled?(RSAnalyticsManager.getInstance().trackGUIEvent("ooc_popup","shop","open_from_"+RSAnalyticsManager.getInstance().getCurrentMachineAnalyticsName(),""),GameConfig.SUBSCRIPTION_ENABLED&&!GlobalVars.isSubSaleOnOOCShown?(RSPlacementManager.getInstance().getInterface().checkForSubscriptionSale("ooc", !0),GlobalVars.isSubSaleOnOOCShown=!0):RSPlacementManager.getInstance().getInterface().showSalePopup("ooc",!0),this.closePopup()):(this.closePopup(),VideoManager.getInstance().showVideoPopup("ReplacePurchase",!1,"ooc_popup"));break;case "CP_Button_T1":RSAnalyticsManager.getInstance().trackGUIEvent("ooc_popup","close","open_from_"+RSAnalyticsManager.getInstance().getCurrentMachineAnalyticsName(),""),this.closePopup()}return this._super.onButtonClicked.call(this,a)}});var RSCarousalEmailConnectWidget=RSDisplayObject.extend({init:function(a,b){a=new RSRect(a.x,a.y,a.w,a.h);RSPlatformFontAssetManager.loadFontConfigFile(RSGame.getInstance().getAssetPath("CarousalWidgetFontConfig"),"CarousalWidgetFontConfig.json");this._super.init.call(this,a);this._callBack=b;this.loadContent()},loadContent:function(){this.loadLayout(RSGame.getInstance().getAssetPath("CarousalEmailConnectWidget"))},onObjectCreated:function(a,b,c){switch(c.name){case "ClaimedTick":this._claimedEmail= a;this._claimedEmail.setZOrder(1);this._claimedEmail.setVisible(!1);break;case "EmailConnectBtn":this._emailConncetBtn=a;break;case "SocialLoginConnectButtonShine":this._btnShineAnim=a;break;case "SocialLoginConnectGlowAnim":this.btnGlowAnim=a}switch(c.type){case "Animation":a.stopAnimation(),a.playAnimation(-1,0.5)}this._super.onObjectCreated.call(this,a,b,c)},createCustomObject:function(a,b){switch(b.name){case "RewardAmount":var c=RSPlatformFontAssetManager.createCustomLabel(RSUtils.formatNumberWithComma(RSEngine.gameData.getDefaultValues().emailReward), b);this.addChild(c);break;case "EmailRewardTxt":c=RSGame.getInstance().getGameData().getPopupTextWithKey(b.name),c=c.replace(/\\n/g,"\n"),c=RSPlatformFontAssetManager.createCustomLabel(c,b),this.addChild(c)}},onLayoutCompleted:function(){this.setClaimStatusForEmail(!0);this._super.onLayoutCompleted.call(this)},setClaimStatusForEmail:function(a){RSEngine.loginMode==LOGIN_MODE.FACEBOOK||RSGame.getInstance().getUserDataManager().getMe().getLoginRewardStatus()?(this.btnGlowAnim.setVisible(!1),this._btnShineAnim&& this._btnShineAnim.setVisible(!1),this._claimedEmail.setVisible(!0),this._emailConncetBtn.setTouchEnabled(!1),a||RSAnalyticsManager.getInstance().trackGUIEvent("ooc_carousel","manage_account","open_from_"+RSAnalyticsManager.getInstance().getCurrentMachineName(),"completed","")):this._emailConncetBtn.setTouchEnabled(!0)},onButtonClicked:function(a){switch(a){case "EmailConnectBtn":this._emailConncetBtn.setTouchEnabled(!1),RSAnalyticsManager.getInstance().trackGUIEvent("ooc_carousel","manage_account", "open_from_"+RSAnalyticsManager.getInstance().getCurrentMachineName(),"click",""),RSEngine.popupManager.addPopup(new RSAccountManagementPopup("carousal",this.setClaimStatusForEmail.bind(this)),!0)}},unload:function(){this._super.unload.call(this)}});var RSCarousalPlayerConnectWidget=RSDisplayObject.extend({init:function(a,b){a=new RSRect(a.x,a.y,a.w,a.h);this._super.init.call(this,a);RSPlatformFontAssetManager.loadFontConfigFile(RSGame.getInstance().getAssetPath("CarousalWidgetFontConfig"),"CarousalWidgetFontConfig.json");this._callBack=b;this.loadContent()},loadContent:function(){this.loadLayout(RSGame.getInstance().getAssetPath("CarousalPlayerConnectWidget"))},onObjectCreated:function(a,b,c){switch(c.name){case "ClaimedTick":this._claimedPlayerConnect= a;this._claimedPlayerConnect.setZOrder(1);this._claimedPlayerConnect.setVisible(!1);break;case "PlayerConnectBtn":this._playerConnectBtn=a;break;case "PlayerConnectButtonShine":this._btnShineAnim=a}switch(c.type){case "Animation":a.stopAnimation(),a.playAnimation(-1,0.5)}this._super.onObjectCreated.call(this,a,b,c)},createCustomObject:function(a,b){switch(b.name){case "RewardAmount":var c=RSPlatformFontAssetManager.createCustomLabel(RSUtils.formatNumberWithComma(RSEngine.gameData.getDefaultValues().clubMReward), b);this.addChild(c);break;case "PlayerConnectRewardTxt":c=RSGame.getInstance().getGameData().getPopupTextWithKey(b.name),c=c.replace(/\\n/g,"\n"),c=RSPlatformFontAssetManager.createCustomLabel(c,b),this.addChild(c)}},onLayoutCompleted:function(){RSGame.getInstance().getUserDataManager().getMe().getPlayerConnectUpdateStatus()&&(this._btnShineAnim&&this._btnShineAnim.setVisible(!1),this._claimedPlayerConnect.setVisible(!0),this._playerConnectBtn.setTouchEnabled(!1));this._super.onLayoutCompleted.call(this)}, onButtonClicked:function(a){switch(a){case "PlayerConnectBtn":this._playerConnectBtn.setTouchEnabled(!1),RSAnalyticsManager.getInstance().trackGUIEvent("ooc_carousel","property_linking","open_from_"+RSAnalyticsManager.getInstance().getCurrentMachineName(),"click",""),RSGame.getInstance().getGameManager().connectPlayerIdWithCasino(null,this._onPlayerConnectPopupClose.bind(this),null,"carousal")}},_onPlayerConnectPopupClose:function(){RSGame.getInstance().getUserDataManager().getMe().getPlayerConnectUpdateStatus()? (RSAnalyticsManager.getInstance().trackGUIEvent("ooc_carousel","property_linking","open_from_"+RSAnalyticsManager.getInstance().getCurrentMachineName(),"completed",""),this._claimedPlayerConnect.setVisible(!0),this._playerConnectBtn.setTouchEnabled(!1)):this._playerConnectBtn.setTouchEnabled(!0)},unload:function(){this._super.unload.call(this)}});var RSCarousalFBConnectWidget=RSDisplayObject.extend({init:function(a,b){a=new RSRect(a.x,a.y,a.w,a.h);this._super.init.call(this,a);RSPlatformFontAssetManager.loadFontConfigFile(RSGame.getInstance().getAssetPath("CarousalWidgetFontConfig"),".json");this._callBack=b;this.loadContent()},loadContent:function(){this.loadLayout(RSGame.getInstance().getAssetPath("CarousalFBConnectWidget"))},onObjectCreated:function(a,b,c){switch(c.name){case "ClaimedTick":this._claimedFB=a;this._claimedFB.setZOrder(1); this._claimedFB.setVisible(!1);break;case "FBConnectBtn":this._FBConnectBtn=a}this._super.onObjectCreated.call(this,a,b,c)},createCustomObject:function(a,b){switch(b.name){case "RewardAmount":var c=RSPlatformFontAssetManager.createCustomLabel(RSUtils.formatNumberWithComma(RSEngine.gameData.getDefaultValues().emailReward),b);this.addChild(c);break;case "FBRewardTxt":c=RSGame.getInstance().getGameData().getPopupTextWithKey(b.name),c=RSPlatformFontAssetManager.createCustomLabel(c,b),this.addChild(c)}}, onLayoutCompleted:function(){this.setClaimedStatusForFB(!1);this._super.onLayoutCompleted.call(this)},setClaimedStatusForFB:function(a){if(RSEngine.loginMode==LOGIN_MODE.FACEBOOK||RSGame.getInstance().getUserDataManager().getMe().getLoginRewardStatus())this._claimedFB.setVisible(!0),this._FBConnectBtn.setTouchEnabled(!1),RSEventManager.getInstance().dispatchEvent("setClaimStatusForEmail",{});a&&this._callBack&&this._callBack()},onButtonClicked:function(a){switch(a){case "FBConnectBtn":RSAnalyticsManager.getInstance().trackPlayerAction("ooc_carousel", "link_fb","initiate","",""),RSSSOManager.saveCurrentServerTimeForGettingLinkingTime(),RSLoginManager.getInstance().loginWithFacebook("carousal",this.setClaimedStatusForFB.bind(this))}},unload:function(){this._super.unload.call(this)}});var RSCarousalWatchAdsWidget=RSDisplayObject.extend({init:function(a,b){a=new RSRect(a.x,a.y,a.w,a.h);this._super.init.call(this,a);RSPlatformFontAssetManager.loadFontConfigFile(RSGame.getInstance().getAssetPath("CarousalWidgetFontConfig"),"CarousalWidgetFontConfig.json");this._callBack=b;this.loadContent()},loadContent:function(){this.loadLayout(RSGame.getInstance().getAssetPath("CarousalWatchAdsWidget"))},onObjectCreated:function(a,b,c){switch(c.type){case "Animation":a.stopAnimation(),a.playAnimation(-1, 0.5)}switch(c.name){case "WatchAdsBtn":this._watchAdsBtn=a}this._super.onObjectCreated.call(this,a,b,c)},createCustomObject:function(a,b){switch(b.name){case "RewardAmount":var c=RSGame.getInstance().getPlatformEventManager().getEventDataFromEventList(RSPlatformEventTypeKeys.EARN_COINS_AD,RSPlatformPopupNameKeys.OOC_CAROUSEL),c=null!=c&&c.triggerAction?RSUtils.formatNumberWithComma(c.triggerAction.rewards.coin):"",c=RSPlatformFontAssetManager.createCustomLabel(c,b);this.addChild(c);break;case "WatchAdsRewardTxt":c= RSGame.getInstance().getGameData().getPopupTextWithKey(b.name),c=RSPlatformFontAssetManager.createCustomLabel(c,b),this.addChild(c)}},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this)},onButtonClicked:function(a){switch(a){case "WatchAdsBtn":GameConfig.PLATFORM_EVENT_MANAGER_ENABLED&&RSGame.getInstance().getPlatformEventManager()?RSGame.getInstance().getPlatformEventManager().getUserEventStatus()&&RSGame.getInstance().getPlatformEventManager().getUserEventStatus().ClickToWatchAd&& JSON.parse(RSGame.getInstance().getPlatformEventManager().getUserEventStatus().ClickToWatchAd.ooc_carousel)&&(this._watchAdsBtn.setTouchEnabled(!1),this.scheduleFunctionOnce(function(){this._watchAdsBtn.setTouchEnabled(!0)}.bind(this),1),RSAnalyticsManager.getInstance().trackGUIEvent("ooc_carousel","watch_ad","open_from_"+RSAnalyticsManager.getInstance().getCurrentMachineName(),"click",""),RSEventManager.getInstance().dispatchEvent(RSPlatformEventTypeKeys.RSPlatformEvent,{event:RSPlatformEventTypeKeys.EARN_COINS_AD, parameter:RSPlatformPopupNameKeys.OOC_CAROUSEL})):"undefined"!==typeof RSPlatformEventManager&&RSPlatformEventManager.getInstance().getUserEventStatus()[RSPlatformEventTypeKeys.EARN_COINS_AD]&&JSON.parse(RSPlatformEventManager.getInstance().getUserEventStatus()[RSPlatformEventTypeKeys.EARN_COINS_AD][RSPlatformPopupNameKeys.OOC_CAROUSEL])&&(this._watchAdsBtn.setTouchEnabled(!1),this.scheduleFunctionOnce(function(){this._watchAdsBtn.setTouchEnabled(!0)}.bind(this),1),RSAnalyticsManager.getInstance().trackGUIEvent("ooc_carousel", "watch_ad","open_from_"+RSAnalyticsManager.getInstance().getCurrentMachineName(),"click",""),RSEventManager.getInstance().dispatchEvent(RSPlatformEventTypeKeys.RSPlatformEvent,{event:RSPlatformEventTypeKeys.EARN_COINS_AD,parameter:RSPlatformPopupNameKeys.OOC_CAROUSEL}))}},unload:function(){this._super.unload.call(this)}});var RSGenericInfoPopup=RSGenericPopup.extend({init:function(a){this._assetList=a.assetList;RSPlatformFontAssetManager.loadFontConfigFile(RSGame.getInstance().getAssetFolder("GameUnavailable"),"GameUnavailablesFontConfig.json");this._super.init.call(this);this._gameManager=RSGame.getInstance().getGameManager();this._popupData=a},loadContent:function(){this.layoutScreen(this._assetList);this._super.loadContent.call(this)},onObjectCreated:function(a,b,c){this._super.onObjectCreated.call(this,a,b,c)}, createCustomObject:function(a,b){switch(b.name){case "SubTitle":this.addChild(RSPlatformFontAssetManager.createCustomLabel(this._popupData.SubTitleMsg,b));break;case "Title":this.addChild(RSPlatformFontAssetManager.createCustomLabel(this._popupData.TitleMsg,b))}return this._super.createCustomObject.call(this,a,b)},onLayoutCompleted:function(){this._super.onLayoutCompleted.call(this)},onButtonClicked:function(a){switch(a){case "ContinueBtn":this.closePopup();break;case "CP_Button_T1":this.closePopup()}}, unload:function(){this._super.unload.call(this)}});var RSMachineUnlockPopup=RSPopup.extend({init:function(a,b,c){this._assetList=[{name:RSGame.getInstance().getAssetPath("MachineUnlockPopup"),count:1}];RSPlatformFontAssetManager.loadFontConfigFile(RSGame.getInstance().getAssetFolder("MachineUnlockPopup"),"MachineUnlockPopupFontConfig.json");this._unlockedMachineList=[];this._nextToUnlockMachines=[];for(var d=0;3>this._unlockedMachineList.length&&0