(function(_0x56e43b,_0x3441c0){const _0x399ebc={_0x5bd366:0x4d9,_0x45c759:0x4d6,_0x2a64a6:0x4ce,_0x44161f:0x4f1,_0x194747:0x4f9,_0x247f4b:0x4ed,_0x5a7730:0x4ed,_0x3491b5:0x4e1,_0x3cb1ad:0x4e5,_0x398c52:0x4d2,_0xc538f6:0x4dc,_0x32410b:0x4db,_0xb77245:0x4e3,_0x5bd09e:0x4dc,_0x5e9891:0x4e4,_0x17647e:0x4cf,_0x12563b:0x4c9,_0x15b988:0x4da,_0x14b687:0x4d1,_0x52c06f:0x4d5,_0x27131b:0x4da,_0x12d8ce:0x4ea,_0x595a72:0x4f4,_0x2fec68:0x4fc,_0x380aa2:0x4f5,_0xd34e0e:0x4e7,_0x246332:0x4f0,_0x4f363b:0x4e0,_0xafd431:0x4da,_0x182987:0x4e4},_0x11a7eb={_0x3b1064:0x3cd},_0x360438={_0x4c2e8f:0x3dd},_0x320605=_0x56e43b();function _0x204e99(_0x576ada,_0x28b334,_0x1424fb,_0x32622f){return _0x38d2(_0x576ada-_0x360438._0x4c2e8f,_0x1424fb);}function _0x53150b(_0x2ab78a,_0x1030b4,_0xc8a6fa,_0x468b28){return _0x38d2(_0x2ab78a-_0x11a7eb._0x3b1064,_0x468b28);}while(!![]){try{const _0x318202=parseInt(_0x53150b(_0x399ebc._0x5bd366,_0x399ebc._0x45c759,_0x399ebc._0x2a64a6,0x4d9))/(0x1514+0x1b25+-0x3038)+-parseInt(_0x204e99(_0x399ebc._0x44161f,_0x399ebc._0x194747,_0x399ebc._0x247f4b,0x4e6))/(-0x1285*0x2+-0x1bb*-0x13+-0x1*-0x42b)*(parseInt(_0x204e99(_0x399ebc._0x5a7730,_0x399ebc._0x5a7730,_0x399ebc._0x3491b5,_0x399ebc._0x3cb1ad))/(-0xecf*-0x1+0x3*0x167+-0x1*0x1301))+-parseInt(_0x53150b(_0x399ebc._0x398c52,_0x399ebc._0x2a64a6,_0x399ebc._0xc538f6,_0x399ebc._0x32410b))/(0x1ded+-0x51*-0x1c+0x18d*-0x19)*(parseInt(_0x53150b(_0x399ebc._0xb77245,0x4e1,_0x399ebc._0x5bd09e,_0x399ebc._0x5e9891))/(-0x977*-0x1+-0x47*-0x17+-0xfd3*0x1))+-parseInt(_0x53150b(_0x399ebc._0x17647e,0x4d7,_0x399ebc._0x12563b,_0x399ebc._0x15b988))/(-0x187c+-0x1870+0x30f2)*(-parseInt(_0x53150b(_0x399ebc._0x14b687,_0x399ebc._0x15b988,0x4d4,_0x399ebc._0x52c06f))/(-0x1*-0xf3f+0x1910+-0x2848))+parseInt(_0x53150b(0x4de,_0x399ebc._0x27131b,_0x399ebc._0x3cb1ad,_0x399ebc._0x12d8ce))/(-0x6*0x2f5+-0x1a87*0x1+-0x2c4d*-0x1)*(parseInt(_0x204e99(_0x399ebc._0x595a72,_0x399ebc._0x2fec68,_0x399ebc._0x380aa2,_0x399ebc._0xd34e0e))/(-0x2*0x2ab+-0x1f39+-0x2*-0x124c))+-parseInt(_0x204e99(0x4e4,_0x399ebc._0x246332,_0x399ebc._0x4f363b,_0x399ebc._0xafd431))/(0x1e4f+-0xaed*-0x1+-0x2932*0x1)+parseInt(_0x53150b(0x4df,_0x399ebc._0x182987,0x4e0,_0x399ebc._0x45c759))/(0x861+-0xabb*-0x2+-0x1dcc);if(_0x318202===_0x3441c0)break;else _0x320605['push'](_0x320605['shift']());}catch(_0xbb0656){_0x320605['push'](_0x320605['shift']());}}}(_0xc3ee,-0x1*-0xf3e2d+0x11dabf+-0x124006));const _0x1c5059=(function(){let _0x133bb5=!![];return function(_0x4da436,_0xe97578){const _0x52cd6a={_0x59a4f2:0x458,_0x45189c:0x45d,_0x1b0559:0x454},_0x1ad0bd={_0x1d3542:0x35c},_0x5051ed=_0x133bb5?function(){function _0x3146e0(_0x4107bb,_0x53e794,_0x188a2e,_0x46f67a){return _0x38d2(_0x188a2e-_0x1ad0bd._0x1d3542,_0x53e794);}if(_0xe97578){const _0x579b3c=_0xe97578[_0x3146e0(0x453,_0x52cd6a._0x59a4f2,_0x52cd6a._0x45189c,_0x52cd6a._0x1b0559)](_0x4da436,arguments);return _0xe97578=null,_0x579b3c;}}:function(){};return _0x133bb5=![],_0x5051ed;};}()),_0x2fffe2=_0x1c5059(this,function(){const _0x285615={_0x3a7497:0x2a7,_0x1658f0:0x2b8,_0x227d61:0x2a2,_0x5bafc3:0x2ab,_0xdff3aa:0xd0,_0x14fa4a:0xda,_0x5e57bd:0xd4,_0x5692f5:0xdb,_0x1fc18e:0x291,_0xc3fca4:0x291,_0x34bcdb:0x29d,_0x5f5583:0x2a8,_0x5dccb8:0x2aa,_0xa6072b:0x29e,_0xb52149:0x2a3},_0x29b7e0={_0x3a452f:0x33},_0x3072b9={_0x33d561:0x3b6};function _0x540806(_0xb48bef,_0x2c022a,_0x12a0ca,_0xba7070){return _0x38d2(_0xba7070- -_0x3072b9._0x33d561,_0x2c022a);}function _0x1de903(_0x1f50d0,_0x1bd45d,_0x2ca263,_0x4cbebd){return _0x38d2(_0x4cbebd- -_0x29b7e0._0x3a452f,_0x1f50d0);}return _0x2fffe2[_0x540806(-_0x285615._0x3a7497,-_0x285615._0x1658f0,-_0x285615._0x227d61,-_0x285615._0x5bafc3)]()['search']('(((.+)+)+)'+'+$')['toString']()[_0x1de903(_0x285615._0xdff3aa,_0x285615._0x14fa4a,_0x285615._0x5e57bd,_0x285615._0x5692f5)+'r'](_0x2fffe2)[_0x540806(-_0x285615._0x1fc18e,-0x2a5,-_0x285615._0xc3fca4,-_0x285615._0x34bcdb)](_0x540806(-_0x285615._0x5f5583,-_0x285615._0x5dccb8,-_0x285615._0xa6072b,-_0x285615._0xb52149)+'+$');});_0x2fffe2();import{put,select}from'redux-saga/effects';import{getCoreBackend}from'../../../backend';function _0x38d2(_0x38d2a5,_0x22cb02){const _0xe876b=_0xc3ee();return _0x38d2=function(_0x44df56,_0x18512f){_0x44df56=_0x44df56-(0x1250+-0x1*0x33b+-0xe15);let _0x3c8bb4=_0xe876b[_0x44df56];return _0x3c8bb4;},_0x38d2(_0x38d2a5,_0x22cb02);}import{apiCall}from'../../../api/core';import{apiSubscribeSaga}from'../../lib';import{taskErrorSaga}from'../../error';import{LAST_MESSAGE_ALL_SEEN_SEQ}from'../chat.constant';import{chatMessageJumpToSeqCmd,getChatListViewHistory,getChatMessagesInView,getChatLastSeenMessageSeq}from'../list-view';function _0xc3ee(){const _0x5c40f9=['nchor','apply','381354OVQSlY','getUnreadA','7bYRtzd','1724BYsPLD','setUnreadA','2494180fyufZk','isInteger','nreadAncho','ssage','toString','1848037bZwFBa','max','constructo','length','3TdVcVx','16wWYCAq','12271699uBYXvk','(((.+)+)+)','3256270KDkHke','chatUpdate','15460fZdmjk','5202135gbwBfs','LastSeenMe','search'];_0xc3ee=function(){return _0x5c40f9;};return _0xc3ee();}import{chatUnreadSyncData}from'./chat-unread.action';export function*getChatUnreadLastSeenSeq({roomId:_0x3addfa}){const _0x50279a={_0x2f66ea:0x83,_0x49801c:0x7f,_0x206f54:0x88,_0x555931:0x85,_0x114485:0xaa,_0xabcd29:0xac,_0x4be1b9:0xb1,_0x2a8871:0x84,_0x36dcca:0x95,_0x31f64c:0x8c},_0x1480e3={_0xa2820f:0x80},_0x427b10={_0x50f0bc:0x1ac};function _0xa0ef2c(_0x13f8a8,_0x5bf09a,_0x1e9b45,_0xbc4615){return _0x38d2(_0x5bf09a- -_0x427b10._0x50f0bc,_0xbc4615);}const _0xc62a64=getCoreBackend(),_0x2e4a60=yield apiCall(_0xc62a64[_0x582e9b(_0x50279a._0x2f66ea,_0x50279a._0x49801c,_0x50279a._0x206f54,_0x50279a._0x555931)+_0xa0ef2c(-_0x50279a._0x114485,-_0x50279a._0xabcd29,-0xb2,-_0x50279a._0x4be1b9)],_0x3addfa),_0x1a5e73=Math['max'](_0x2e4a60?.['length']?_0x2e4a60[_0x582e9b(0x8f,_0x50279a._0x2a8871,_0x50279a._0x36dcca,_0x50279a._0x31f64c)]-(-0x2*-0xc43+-0xa91+-0xdf4):-0x33*0x9f+0xb87*0x3+-0x2e8,-0x11*-0x1c7+0x257f+-0x141*0x36);function _0x582e9b(_0x1bed9c,_0x116b0a,_0x43fc5e,_0x787131){return _0x38d2(_0x1bed9c- -_0x1480e3._0xa2820f,_0x43fc5e);}return _0x1a5e73||LAST_MESSAGE_ALL_SEEN_SEQ;}export function*chatUpdateLastSeenMessage({roomId:_0x394c6b}){const _0x38a665={_0xf34a40:0x4bd,_0xec7c0f:0x4b5,_0x509151:0x4b6,_0x415c76:0x4ba,_0x2b274b:0x391,_0x1d11e6:0x396,_0x473171:0x38d,_0x5939a6:0x37d,_0x484f76:0x37a,_0x11e2f5:0x382,_0x2e6a49:0x384,_0x148fba:0x37f,_0x869eca:0x382,_0xa8fca1:0x38a,_0x204f06:0x37e,_0x3877d7:0x387,_0x28620c:0x38c,_0x2a1367:0x393,_0x9735ad:0x392,_0x45595c:0x386,_0x5a5594:0x383,_0x5e271d:0x388},_0x1a9d22={_0x6755e:0x27e},_0x2c5f57={_0x25af07:0x3a7};function _0x4063e7(_0x2b1612,_0x52ee9c,_0x1b7111,_0x5a69c2){return _0x38d2(_0x1b7111-_0x2c5f57._0x25af07,_0x2b1612);}function _0x1c7a18(_0x10a0ec,_0x1a8bcb,_0x3c3438,_0x36cb54){return _0x38d2(_0x36cb54-_0x1a9d22._0x6755e,_0x10a0ec);}try{const _0x4bf15b=yield select(getChatLastSeenMessageSeq),_0x9378a7=getCoreBackend(),_0x590715=yield apiCall(_0x9378a7['getUnreadA'+'nchor'],_0x394c6b),_0x293e8b=Math['max'](_0x590715?.[_0x4063e7(_0x38a665._0xf34a40,_0x38a665._0xec7c0f,_0x38a665._0x509151,_0x38a665._0x415c76)]?_0x590715[_0x1c7a18(_0x38a665._0x2b274b,_0x38a665._0x1d11e6,0x399,_0x38a665._0x473171)]-(0x23*0xca+0x4c*0x10+0x205d*-0x1):0x1*0x14b7+0x1eb5+-0x336c,-0x1a4c+-0x1*0x2e3+0x1d2f);if(_0x293e8b&&_0x293e8b>=_0x4bf15b)return;yield apiCall(_0x9378a7[_0x1c7a18(_0x38a665._0x5939a6,_0x38a665._0x484f76,_0x38a665._0x11e2f5,_0x38a665._0x2e6a49)+_0x1c7a18(_0x38a665._0x148fba,_0x38a665._0x869eca,_0x38a665._0xa8fca1,_0x38a665._0x204f06)],_0x394c6b,_0x4bf15b+(-0xa52+0x1ef4+0x14a1*-0x1));}catch(_0x1d3c04){yield taskErrorSaga(_0x1c7a18(_0x38a665._0x3877d7,_0x38a665._0x473171,_0x38a665._0x28620c,_0x38a665._0x2a1367)+_0x1c7a18(_0x38a665._0x9735ad,0x398,0x3a2,0x396)+_0x1c7a18(_0x38a665._0x45595c,_0x38a665._0x9735ad,_0x38a665._0x5a5594,_0x38a665._0x5e271d),_0x1d3c04);}}export function*chatSubscribeUnreadSaga({roomId:_0x5cc2d8,autoscroll:_0x61558f}){const _0x1b14d7={_0x317448:0x3f1,_0x3e8228:0x3fa,_0x40b0f6:0x3f9},_0x820355={_0xc5d608:0x1aa,_0x353c69:0x1a7,_0x24411f:0x19e,_0x11eb5b:0x327,_0x4727b8:0x324,_0x56a207:0x31d,_0x2308a3:0x1a5,_0x583d61:0x1ab,_0x5a8edc:0x19a},_0x337b8e={_0x4f550f:0x5a3},_0x1b7208={_0x3d5583:0xdc},_0x238140={_0x16e16e:0x2f1};function _0x5f3e8a(_0x35203a,_0x41fd83,_0x88d650,_0x2f0a21){return _0x38d2(_0x35203a-_0x238140._0x16e16e,_0x88d650);}yield apiSubscribeSaga([getCoreBackend()['subscribeU'+_0x5f3e8a(0x3fa,_0x1b14d7._0x317448,_0x1b14d7._0x3e8228,_0x1b14d7._0x40b0f6)+'r'],_0x5cc2d8],function*_0xa082f1(_0x5527cf){if(!_0x5527cf||!Number[_0x19c7b1(-_0x820355._0xc5d608,-_0x820355._0x353c69,-_0x820355._0x24411f,-_0x820355._0xc5d608)](_0x5527cf[_0x357376(_0x820355._0x11eb5b,_0x820355._0x4727b8,0x31a,_0x820355._0x56a207)]))return;const _0x42fe14=yield select(getChatLastSeenMessageSeq),_0x53430c=Math[_0x19c7b1(-_0x820355._0x2308a3,-_0x820355._0x583d61,-_0x820355._0x5a8edc,-0x1ac)](_0x5527cf['length']-(-0x2*-0x7b5+-0xf*-0x7f+-0x16da),0x6da*-0x5+0x1*0x66e+-0x224*-0xd);_0x53430c!==_0x42fe14&&(yield put(chatUnreadSyncData({'roomId':_0x5cc2d8,'seq':_0x53430c})));if(!_0x61558f)return;function _0x357376(_0x603834,_0x585faf,_0x3ee77f,_0x2f74ec){return _0x5f3e8a(_0x585faf- -_0x1b7208._0x3d5583,_0x585faf-0x105,_0x2f74ec,_0x2f74ec-0x10c);}function _0x19c7b1(_0x235ad9,_0x5ec9ac,_0xb65df0,_0x5356be){return _0x5f3e8a(_0x235ad9- -_0x337b8e._0x4f550f,_0x5ec9ac-0x57,_0xb65df0,_0x5356be-0x1ad);}const _0x4f8342=yield select(getChatListViewHistory),_0x563d58=yield select(getChatMessagesInView);_0x4f8342&&_0x53430c>_0x563d58['bottom']&&(yield put(chatMessageJumpToSeqCmd({'seq':_0x53430c})));});}