var touch,__extends=this&&this.__extends||function(){var t=function(i,e){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])})(i,e)};return function(i,e){function n(){this.constructor=i}if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");t(i,e),i.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}}();!function(t){var i;!function(t){t[t.DIAMOND=0]="DIAMOND",t[t.SKIN=1]="SKIN"}(i=t.NewAwardDialogType||(t.NewAwardDialogType={}));var e=function(e){function n(){var i=e.call(this)||this;return i._closeHandler=null,i.btnClaimNormal.clickHandler=Laya.Handler.create(i,i.onClaimNormal,null,!1),i.btnClaimExtra.clickHandler=Laya.Handler.create(i,i.onClaimExtra,null,!1),i.btnChangeSkin.clickHandler=Laya.Handler.create(i,i.onClaimNormal,null,!1),i.txtTitle.text=t.Lang.getLangText(t.Lang.new_skin),i.useLab.text=t.Lang.getLangText(t.Lang.use),i}return __extends(n,e),n.prototype.onResize=function(){this.adapterScreen()},n.prototype.adapterScreen=function(){var t=GameBaseData.getAdapterRatio();this.scale(t,t)},n.prototype.setCloseHandler=function(t){this._closeHandler=t},n.prototype.setDisplayOption=function(t){if(this.btnClaimNormal.visible=!1,this.btnClaimExtra.visible=!1,this.boxDiamond.visible=!1,this.btnChangeSkin.visible=!1,this.txtTitle.visible=!1,this.imgTitle.visible=!0,t.type==i.DIAMOND)this.imgTitle.skin="v1.1/ui/txt_congratulations.png",this.btnClaimNormal.visible=!0,t.showAdsButton?(this.btnClaimExtra.visible=!0,this.btnClaimExtra.x=272,this.btnClaimNormal.x=524):(this.btnClaimExtra.visible=!1,this.btnClaimNormal.x=375),this.boxDiamond.visible=!0,this.txtDiamond.text="x"+t.value.toString(),this.imgAward.skin="v1.1/ui/image_pile_diamonds.png";else if(t.type==i.SKIN){this.imgTitle.skin="v1.1/ui/txt_newskin.png",this.imgTitle.visible=!1,this.btnChangeSkin.visible=!0,this.txtTitle.visible=!0,this.txtTitle.centerX=0;var e=t.value;this.imgAward.skin="index/skin"+e+".png"}this.imgAward.centerX=0,this.imgAward.centerY=0},n.popup=function(t,i){var e=new n;Laya.stage.addChild(e),e.setCloseHandler(i),e.setDisplayOption(t),e.popup(null,!1)},n.prototype._open=function(t,i,n){this._parent&&(this.width=this._parent.width,this.height=this._parent.height),e.prototype._open.call(this,t,i,n)},n.showDiamondAwards=function(t,e,a){n.popup({type:i.DIAMOND,showAdsButton:e,value:t},a)},n.showSkinAwards=function(t,e){n.popup({type:i.SKIN,value:t},e)},n.prototype.onClaimNormal=function(){this.close("",!1),this._closeHandler&&this._closeHandler(!1)},n.prototype.onClaimExtra=function(){this.close("",!1),this._closeHandler&&this._closeHandler(!0)},n}(ui.NewAwardDialogUI);t.NewAwardDialog=e}(touch||(touch={}));