import{Df as a,Hf as r,Ud as o}from"./chunk-X3RCWQ3R.js";import{a as n,b as s,i as e}from"./chunk-SR6RTMQI.js";var u=class d extends r{constructor(t){super(t);e(this,"displayName");e(this,"description");e(this,"support");e(this,"nameWithHost");e(this,"nameWithHostForced");e(this,"banners");e(this,"bannerUrl");e(this,"updatedAt");e(this,"ownerAccount");e(this,"ownerBy");e(this,"videosCount");e(this,"viewsPerDay");e(this,"totalViews");this.displayName=t.displayName,this.description=t.description,this.support=t.support,this.banners=t.banners||[],this.isLocal=t.isLocal,this.nameWithHost=r.CREATE_BY_STRING(this.name,this.host),this.nameWithHostForced=r.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(i=>s(n({},i),{date:new Date(i.date)}))),t.totalViews!==null&&t.totalViews!==void 0&&(this.totalViews=t.totalViews),t.ownerAccount&&(this.ownerAccount=t.ownerAccount,this.ownerBy=r.CREATE_BY_STRING(t.ownerAccount.name,t.ownerAccount.host)),this.updateComputedAttributes()}static GET_ACTOR_AVATAR_URL(t,i){return r.GET_ACTOR_AVATAR_URL(t,i)}static GET_ACTOR_BANNER_URL(t){if(!t||t.banners.length===0)return"";let i=o(t.banners,"width");return i?i.url?i.url:a()+i.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`}updateAvatar(t){this.avatars=t,this.updateComputedAttributes()}resetAvatar(){this.updateAvatar([])}updateBanner(t){this.banners=t,this.updateComputedAttributes()}resetBanner(){this.updateBanner([])}updateComputedAttributes(){this.bannerUrl=d.GET_ACTOR_BANNER_URL(this)}};export{u as a};
/**i18n:3d16453f213eb5db982e7e7dd90631843ac5d3f860726a614777c3e9e3f9b57e*/
//# sourceMappingURL=chunk-RKQVCQGG.js.map
