package com.ss.android.ugc.aweme.im.sdk.chat.data.model;

import X.9EH;
import X.P94;
import android.content.Context;
import android.text.TextUtils;
import com.bytedance.covode.number.Covode;
import com.google.gson.a.c;
import com.ss.android.ugc.aweme.base.model.UrlModel;
import com.ss.android.ugc.aweme.im.sdk.share.data.model.PureDataSharePackage;
import com.ss.android.ugc.aweme.sharer.ui.SharePackage;
import java.util.List;

public class ShareChallengeContent extends BaseContent {
    @c(LIZ = "challenge_id")
    public String challengeId;
    @c(LIZ = "cover_url")
    public List<UrlModel> coverUrl;
    @c(LIZ = "is_commerce")
    public boolean isCommerce;
    @c(LIZ = "push_detail")
    public String pushDetail;
    @c(LIZ = "title")
    public String title;
    @c(LIZ = "user_count")
    public long userCount;

    static {
        Covode.recordClassIndex(84121);
    }

    public String getChallengeId() {
        return this.challengeId;
    }

    public List<UrlModel> getCoverUrl() {
        return this.coverUrl;
    }

    public String getPushDetail() {
        return this.pushDetail;
    }

    public String getTitle() {
        return this.title;
    }

    public long getUserCount() {
        return this.userCount;
    }

    public boolean isCommerce() {
        return this.isCommerce;
    }

    public SharePackage generateSharePackage() {
        return PureDataSharePackage.LIZ.LIZ("challenge");
    }

    public List<UrlModel> fetchPreload() {
        List<UrlModel> list = this.coverUrl;
        if (list == null || list.isEmpty()) {
            return null;
        }
        return this.coverUrl.subList(0, Math.min(3, this.coverUrl.size()));
    }

    public String getMsgHint() {
        return 9EH.LJJIFFI.LIZ().getResources().getString(2131825811, new Object[]{this.pushDetail});
    }

    public void setChallengeId(String str) {
        this.challengeId = str;
    }

    public void setCommerce(boolean z) {
        this.isCommerce = z;
    }

    public void setCoverUrl(List<UrlModel> list) {
        this.coverUrl = list;
    }

    public void setPushDetail(String str) {
        this.pushDetail = str;
    }

    public void setTitle(String str) {
        this.title = str;
    }

    public void setUserCount(int i) {
        this.userCount = (long) i;
    }

    public String getQuoteHint(Context context) {
        return context.getResources().getString(2131825935, new Object[]{this.title});
    }

    public static ShareChallengeContent fromSharePackage(SharePackage sharePackage) {
        String string = sharePackage.LJIILJJIL.getString("challenge_id");
        String string2 = sharePackage.LJIILJJIL.getString("challenge_name");
        Boolean valueOf = Boolean.valueOf(sharePackage.LJIILJJIL.getBoolean("is_commerce"));
        long j = sharePackage.LJIILJJIL.getLong("view_count");
        String string3 = sharePackage.LJIILJJIL.getString("cover_thumb");
        ShareChallengeContent shareChallengeContent = new ShareChallengeContent();
        shareChallengeContent.challengeId = string;
        shareChallengeContent.title = string2;
        shareChallengeContent.isCommerce = valueOf.booleanValue();
        shareChallengeContent.userCount = j;
        shareChallengeContent.pushDetail = "#" + shareChallengeContent.title;
        if (!TextUtils.isEmpty(string3)) {
            shareChallengeContent.coverUrl = (List) P94.LIZ(string3, List.class);
        }
        return shareChallengeContent;
    }

    public String wrapMsgHint(boolean z, boolean z2, String str) {
        Context LIZ = 9EH.LJJIFFI.LIZ();
        if (z || z2) {
            return LIZ.getString(2131822397, new Object[]{this.pushDetail});
        }
        return LIZ.getString(2131832093, new Object[]{this.pushDetail});
    }
}
