import{Df as i,Vd as s,zf as o}from"./chunk-4JM6MIZ5.js";import{a as r,b as n}from"./chunk-QJQRWPYR.js";var a=class u extends i{displayName;description;support;nameWithHost;nameWithHostForced;banners;bannerUrl;updatedAt;ownerAccount;ownerBy;videosCount;viewsPerDay;totalViews;static GET_ACTOR_AVATAR_URL(t,e){return i.GET_ACTOR_AVATAR_URL(t,e)}static GET_ACTOR_BANNER_URL(t){if(!t||t.banners.length===0)return"";let e=s(t.banners,"width");return e?e.url?e.url:o()+e.path:""}static GET_DEFAULT_AVATAR_URL(t){return t<=48?`${window.location.origin}/client/assets/images/default-avatar-video-channel-48x48.png`:`${window.location.origin}/client/assets/images/default-avatar-video-channel.png`}constructor(t){super(t),this.displayName=t.displayName,this.description=t.description,this.support=t.support,this.banners=t.banners||[],this.isLocal=t.isLocal,this.nameWithHost=i.CREATE_BY_STRING(this.name,this.host),this.nameWithHostForced=i.CREATE_BY_STRING(this.name,this.host,!0),this.videosCount=t.videosCount,t.updatedAt&&(this.updatedAt=new Date(t.updatedAt.toString())),t.viewsPerDay&&(this.viewsPerDay=t.viewsPerDay.map(e=>n(r({},e),{date:new Date(e.date)}))),t.totalViews!==null&&t.totalViews!==void 0&&(this.totalViews=t.totalViews),t.ownerAccount&&(this.ownerAccount=t.ownerAccount,this.ownerBy=i.CREATE_BY_STRING(t.ownerAccount.name,t.ownerAccount.host)),this.updateComputedAttributes()}updateAvatar(t){this.avatars=t,this.updateComputedAttributes()}resetAvatar(){this.updateAvatar([])}updateBanner(t){this.banners=t,this.updateComputedAttributes()}resetBanner(){this.updateBanner([])}updateComputedAttributes(){this.bannerUrl=u.GET_ACTOR_BANNER_URL(this)}};export{a};
/**i18n:68865f44f2a527c44cf5136a17c76a0ff8308c2bae5c7c8d50070a5fb9847c44*/
//# sourceMappingURL=chunk-MOA5OONJ.js.map
