"use strict";var _constant=require("../../utils/constant"),_singleLogin=require("../../utils/singleLogin"),NORMAL_ICON="../../assets/banTips.png",ERROR_ICON="../../assets/banTipsRed.png";Component({properties:{sdkInstance:{type:Object,value:null}},data:{isBanned:!1,banType:_constant.BAN_TYPE.NONE,banTips:"",isSoftBan:!1,canContinue:!1,displayTips:"",normalIcon:NORMAL_ICON,errorIcon:ERROR_ICON},observers:{sdkInstance:function(n){if(n){var s=n.store,t=this;console.log("[BanPage] sdkInstance initialized"),"function"==typeof this._unsubscribe&&this._unsubscribe(),this._unsubscribe=null,this._unsubscribe=s.get({banStatus:function(n){if(console.log("[BanPage] banStatus changed:",n),n){var s=n.isBanned,e=void 0!==s&&s,i=n.banType,a=void 0===i?_constant.BAN_TYPE.NONE:i,o=n.banTips,c=void 0===o?"":o,u=n.isSoftBan,r=void 0!==u&&u,l=a===_constant.BAN_TYPE.CHECK_IN||r,b=c||(0,_singleLogin.getBanTipsText)(a);t.setData({isBanned:e,banType:a,banTips:c,isSoftBan:r,canContinue:l,displayTips:b})}}})}else console.log("[BanPage] sdkInstance is null")}},lifetimes:{detached:function(){"function"==typeof this._unsubscribe&&this._unsubscribe(),this._unsubscribe=null}},methods:{onContinueWatch:function(){var n=this.properties.sdkInstance,s={banType:this.data.banType,isSoftBan:this.data.isSoftBan};n&&n.store?(console.log("[BanPage] User clicked continue watch"),(0,_singleLogin.updateBanStatus)(n.store,{isBanned:!1,banType:_constant.BAN_TYPE.NONE,banTips:"",isSoftBan:!1}),this.triggerEvent("continue",s)):console.warn("[BanPage] sdkInstance or store is null")}}});