"use strict";const e=require("../../../../common/vendor.js"),n=require("../emoji-config/index.js"),t=require("./info.js"),i=require("./const.js"),s=class s{constructor(){this.name="OfflinePushInfoManager",this.offlinePushInfo={},this.offlinePushInfo={[i.PUSH_SCENE.CHAT]:t.chatOfflinePushInfo,[i.PUSH_SCENE.CALL]:t.callOfflinePushInfo}}static getInstance(){return s.instance||(s.instance=new s),s.instance}getOfflinePushInfo(e){return Object.values(i.PUSH_SCENE).includes(e)?this.offlinePushInfo[e]:(console.error(`${this.name} getOfflinePushInfo scene: ${e} is invalid`),null)}genTitle(n,t){let i=null==n?void 0:n.getShowName();return n.type===e.qt.TYPES.CONV_C2C&&(i=(null==t?void 0:t.nick)||(null==t?void 0:t.userID)),i}genDesc(t,s){let o="";return t===e.qt.TYPES.MSG_TEXT&&(o=n.transformTextWithKeysToEmojiNames(s.text)),t===e.qt.TYPES.MSG_CUSTOM&&(o=s.description),o||e.Wt.t(`TUIChat.${i.DEFAULT_DESC[t]}`)}create(n){var t;const{conversation:s,messageType:o="",payload:r={}}=n||{},l=e.Jt.getData(e.o.USER,"userProfile"),f={sender:s.type===e.qt.TYPES.CONV_GROUP?null==(t=s.groupProfile)?void 0:t.groupID:null==l?void 0:l.userID,nickName:null==l?void 0:l.nick,chatType:s.type===e.qt.TYPES.CONV_GROUP?2:1,version:1,action:1};return{title:this.genTitle(s,l),description:this.genDesc(o,r),extension:JSON.stringify({entity:f}),...this.offlinePushInfo[i.PUSH_SCENE.CHAT]}}};s.instance=null;let o=s;exports.OfflinePushInfoManager=o;
