import{l as o,k as a,ah as h,ai as u,Q as r}from"./index-CmAiVN5e.js";import{D as _}from"./DonationVoice-fPbifzja.js";class m{constructor(i){this._login="",this._username="",this._avatar="",this._title="",this._branding="",this._successDescription="",this._rules="",this._isWallEnabled=!1,this._minAmountWall="0",this._isTTSEnable=!1,this._voiceLimit=0,this._activities=new Map,this._actions=new Map,this._quizCategories=[],this._buttonText="",this._telegram="",this._youtube="",this._twitch="",this._vk="",this._firstVariant="",this._secondVariant="",this._votePrice="",this._voices=[],this._donationOnAir=null,this._ai=null,this._safe=null,this._wonder=null,this._isTgButton=!1,this._isAddedCreditCard=!1,this._isEmailConfirmation=!1,this._isPhoneConfirmation=!1,this._isAddedPhone=!1,this._isPro=!1,this._isLoading=!0,o(this),this.setFromApi(i)}get isLoading(){return this._isLoading}get avatar(){return this._avatar?a(this._avatar):""}get login(){return this._login}get username(){return this._username}get title(){return this._title}get branding(){return this._branding?h(this._branding,1024):""}get successDescription(){return this._successDescription}get buttonText(){return this._buttonText}get rules(){return this._rules}get isWallEnabled(){return this._isWallEnabled}get minAmountWall(){return this._minAmountWall}get telegram(){return this._telegram}get youtube(){return this._youtube}get twitch(){return this._twitch}get vk(){return this._vk}get isSuperDonate(){return!1}get votePrice(){return this._votePrice}get firstVariant(){return this._firstVariant}get secondVariant(){return this._secondVariant}get donationOnAir(){return this._donationOnAir}get voices(){return this._voices}get isTTSEnable(){return this._isTTSEnable}get isAIEnable(){var i;return((i=this._ai)==null?void 0:i.isEnabled)??!1}get isSafeEnable(){var i;return((i=this._safe)==null?void 0:i.isEnable)??!1}get isWonderEnable(){var i;return((i=this._wonder)==null?void 0:i.isEnable)??!1}get ttsMinAmount(){return this._voiceLimit}get aiMinAmount(){return this._ai?Number(this._ai.minAmount):0}get safeMinAmount(){return this._safe?Number(this._safe.minAmount):0}get wonderMinAmount(){return this._wonder?Number(this._wonder.minAmount):0}get actions(){const i=[];return this._actions.forEach(t=>i.push(t)),i}get activities(){const i=[];return this._activities.forEach(t=>i.push(t)),i}get quizCategories(){return this._quizCategories}get isTgButton(){return this._isTgButton}get ai(){return this._ai}get safe(){return this._safe}get wonder(){return this._wonder}get isAddedCreditCard(){return this._isAddedCreditCard}get isEmailConfirmation(){return this._isEmailConfirmation}get isPhoneConfirmation(){return this._isPhoneConfirmation}get isAddedPhone(){return this._isAddedPhone}get isAvailable(){return this.isAddedCreditCard&&this.isPhoneConfirmation}get isPro(){return this._isPro}setLoading(i){this._isLoading=i}getActivityNameById(i){const t=this._activities.get(i);return t&&t.name?t.name:u[i]}setFromApi(i){var t,e,s,n;i&&(this._login=i.pageSettings.login,this._username=i.username,this._avatar=i.pageSettings.avatar,this._title=i.pageSettings.title,this._branding=i.pageSettings.branding,this._successDescription=i.pageSettings.successDescription,this._buttonText=i.pageSettings.buttonText,this._rules=i.pageSettings.rules,this._isWallEnabled=((t=i.wall)==null?void 0:t.isEnabled)??i.pageSettings.isWallEnabled??!1,this._minAmountWall=((e=i.wall)==null?void 0:e.minAmount)??((s=i.wall)==null?void 0:s.minDonationAmount)??i.pageSettings.minAmountWall??"0",this._telegram=i.pageSettings.socials.telegram||"",this._youtube=i.pageSettings.socials.youtube||"",this._twitch=i.pageSettings.socials.twitch||"",this._vk=i.pageSettings.socials.vk||"",this.setActivities(i),this.setActions(i),this.setSounds(i),this._firstVariant=i.iHaveTo.firstVariant||"",this._secondVariant=i.iHaveTo.secondVariant||"",this._votePrice=i.iHaveTo.votePrice||"",this._isAddedCreditCard=i.isAddedCreditCard||!1,this._isEmailConfirmation=i.isEmailConfirmation||!1,this._isPhoneConfirmation=i.isPhoneConfirmation||!1,this._isAddedPhone=i.isPhone||!1,this._isPro=i.isPro||!1,Array.isArray(i.quizCategories)&&(this._quizCategories=i.quizCategories),i.onAir&&(this._donationOnAir=i.onAir),(n=i.pageSettings.partnerFunctions)!=null&&n.isTgButton&&(this._isTgButton=!0),i.donationSettings.voiceLimit&&(this._voiceLimit=i.donationSettings.voiceLimit),i.AI&&(this._ai=i.AI),i.safe&&(this._safe=i.safe),i.wonder&&(this._wonder=i.wonder))}setActivities(i){this._activities.clear(),i.activitiesList.forEach(t=>{t.typeId===r.QuestionAnswer||t.isActive&&t.typeId>=r.Quiz&&this._activities.set(t.typeId,t)})}setActions(i){this._actions.clear(),i.actionsList.forEach(t=>this._actions.set(t.id,t))}setSounds(i){this._isTTSEnable=i.sounds.isTTSEnable,this._voices=[],i.sounds.voices.forEach(t=>{this._voices.push(new _(t))})}}export{m as D};