OverviewFilesCommitsIssuesDocsReleasesPeers

holepunchto-deps / @holepunchto / keet-store / store / platform / platform.saga.js

1 lines · javascript ref:
function _0x5f56(_0x5f5622,_0x153a50){const _0x1d4a0e=_0x1aa6();return _0x5f56=function(_0x51a9cc,_0x28c2d2){_0x51a9cc=_0x51a9cc-(0x66e*0x1+0x10a5+-0x1538);let _0x37726b=_0x1d4a0e[_0x51a9cc];return _0x37726b;},_0x5f56(_0x5f5622,_0x153a50);}(function(_0xa60c6e,_0x2fa996){const _0x39f5b1={_0x19b9c6:0x4f8,_0x480397:0x4fb,_0x86d05c:0x507,_0x1c6e3e:0x504,_0x3fdc81:0x1ca,_0x3d363b:0x1b9,_0x51a5a4:0x516,_0x589fb8:0x50e,_0x68115e:0x505,_0x142804:0x4f9,_0x2198cf:0x4ff,_0x28c61d:0x4f3,_0x16c9e9:0x4f1,_0x57f2ad:0x505,_0x56ac7:0x512,_0x3f503c:0x4f6,_0x259e49:0x514,_0xe2caee:0x1ce,_0x25ebd3:0x1c1,_0x5f2766:0x1b4,_0x5e4859:0x1c8,_0x81154:0x1b8,_0x1502ef:0x1d9,_0x2cd258:0x1d6,_0x2769b1:0x1cd,_0x1edadd:0x1b4,_0x1f100a:0x1d0,_0x9ca8ee:0x1bf,_0x288bf4:0x503,_0x31d5d1:0x503,_0x2cced8:0x517,_0x401256:0x51f,_0x376f38:0x520},_0x2b7fe9={_0x3a033d:0x31c};function _0x4c036a(_0x162a8a,_0x2820b3,_0x46eca1,_0x20f840){return _0x5f56(_0x162a8a-_0x2b7fe9._0x3a033d,_0x2820b3);}const _0x4eb683=_0xa60c6e();function _0x20fe84(_0x28c3c7,_0x47c9e0,_0x270bd8,_0x490f13){return _0x5f56(_0x490f13- -0x3ad,_0x28c3c7);}while(!![]){try{const _0x388685=-parseInt(_0x4c036a(_0x39f5b1._0x19b9c6,_0x39f5b1._0x480397,_0x39f5b1._0x86d05c,_0x39f5b1._0x1c6e3e))/(0x64a+0x2*-0x482+0x2bb)*(-parseInt(_0x20fe84(-_0x39f5b1._0x3fdc81,-0x1ad,-_0x39f5b1._0x3d363b,-0x1b9))/(-0x1*-0x6f1+-0x2170+0x1a81))+-parseInt(_0x4c036a(0x50d,_0x39f5b1._0x51a5a4,_0x39f5b1._0x589fb8,_0x39f5b1._0x68115e))/(-0x266d+-0x784+0x2df4)+-parseInt(_0x4c036a(_0x39f5b1._0x142804,_0x39f5b1._0x2198cf,_0x39f5b1._0x28c61d,_0x39f5b1._0x16c9e9))/(-0x59*0x59+0x1e50+0xa5)+parseInt(_0x4c036a(_0x39f5b1._0x57f2ad,_0x39f5b1._0x56ac7,_0x39f5b1._0x3f503c,_0x39f5b1._0x259e49))/(0x9b*0x1f+-0x718+-0xba8)*(parseInt(_0x20fe84(-0x1c3,-_0x39f5b1._0xe2caee,-0x1cb,-_0x39f5b1._0x25ebd3))/(0x49*0x33+-0xcbc+-0x1c9))+parseInt(_0x20fe84(-0x1b9,-_0x39f5b1._0x5f2766,-_0x39f5b1._0x5e4859,-_0x39f5b1._0x81154))/(0xa35+0x342+-0x1ae*0x8)*(-parseInt(_0x20fe84(-_0x39f5b1._0x1502ef,-_0x39f5b1._0x2cd258,-0x1cd,-_0x39f5b1._0x2769b1))/(-0x19a7+-0x207f+0x1d17*0x2))+-parseInt(_0x20fe84(-_0x39f5b1._0x1edadd,-_0x39f5b1._0x1f100a,-0x1c7,-_0x39f5b1._0x9ca8ee))/(-0x1da6+-0x1583+0x3332)+parseInt(_0x4c036a(_0x39f5b1._0x86d05c,0x513,_0x39f5b1._0x288bf4,_0x39f5b1._0x31d5d1))/(0x2527+-0x1af2*0x1+-0xa2b)*(parseInt(_0x4c036a(0x514,_0x39f5b1._0x2cced8,_0x39f5b1._0x401256,_0x39f5b1._0x376f38))/(-0x1*-0x1e63+-0x25d7+0x77f));if(_0x388685===_0x2fa996)break;else _0x4eb683['push'](_0x4eb683['shift']());}catch(_0x3b752e){_0x4eb683['push'](_0x4eb683['shift']());}}}(_0x1aa6,0xc2cf2+-0x5cfc*-0x22+0x5fbd*-0x2e));const _0x1b0983=(function(){let _0x88913e=!![];return function(_0x13d5f3,_0x71d827){const _0x475660=_0x88913e?function(){if(_0x71d827){const _0x5569f6=_0x71d827['apply'](_0x13d5f3,arguments);return _0x71d827=null,_0x5569f6;}}:function(){};return _0x88913e=![],_0x475660;};}()),_0x53de68=_0x1b0983(this,function(){const _0x400bf1={_0x35276e:0x3a5,_0x515117:0x4bc,_0x2813c0:0x4b0,_0x355cf7:0x4ac,_0x5c859d:0x39d,_0x4018e9:0x3a5,_0x39c5bd:0x395,_0x4fa7dc:0x4a3,_0x1d0820:0x4b0,_0x34aeb7:0x4b5},_0x8e8423={_0x2abc0b:0x1bd};function _0x4211b4(_0x5e4264,_0x23c02e,_0x1930db,_0x1f8ec2){return _0x5f56(_0x23c02e-0x2b6,_0x5e4264);}function _0x144f37(_0x383b50,_0x54cfcc,_0x37b969,_0xda7728){return _0x5f56(_0x54cfcc-_0x8e8423._0x2abc0b,_0x383b50);}return _0x53de68[_0x144f37(0x3b1,_0x400bf1._0x35276e,0x3a7,0x3a8)]()['search'](_0x4211b4(_0x400bf1._0x515117,_0x400bf1._0x2813c0,0x4a6,_0x400bf1._0x355cf7)+'+$')[_0x144f37(_0x400bf1._0x5c859d,_0x400bf1._0x35276e,_0x400bf1._0x4018e9,_0x400bf1._0x39c5bd)]()['constructo'+'r'](_0x53de68)['search'](_0x4211b4(_0x400bf1._0x4fa7dc,_0x400bf1._0x1d0820,0x4bb,_0x400bf1._0x34aeb7)+'+$');});_0x53de68();import{call,fork,take,put,getContext,spawn,delay}from'redux-saga/effects';import{channelFromMessages}from'../lib';import{taskErrorSaga}from'../error';import{roomInvitationHandler}from'../room';import{PLATFORM_CONTEXT_KEY}from'../constants';import{WAKEUP_MESSAGE,UPDATE_MESSAGE,UPDATING_MESSAGE,CLICK_AVATAR_MESSAGE,PLATFORM_UPDATE_STATUS}from'./platform.constants';import{UI_PANEL,toggleUIPanel}from'../ui-desktop';import{APP_UPDATE_REASONS,APP_DELAY_BEFORE_UPDATE,appRoomInvitationLinkServed,setUpdateRequired,setUpdateStatus}from'../app';import{userInfoNotification}from'../notification';export function*platformFocusHandler(){const _0x293d6b={_0x4d1d15:0xcf,_0x15a3be:0xc9,_0x5eb272:0xce,_0x172da5:0xce,_0x4f5085:0xef,_0x1e6b45:0xec,_0xe3bdd2:0xde,_0x464238:0xd3},_0x41eda1={_0x44db79:0xfa},{windowFocus:_0x4468bd}=yield getContext(PLATFORM_CONTEXT_KEY);function _0x4da50a(_0x327e3f,_0x51f986,_0x449a5c,_0xcafc48){return _0x5f56(_0x449a5c- -0x2c0,_0x51f986);}function _0x47e456(_0x47024e,_0x42cfec,_0xed7665,_0x1faf51){return _0x5f56(_0x42cfec-_0x41eda1._0x44db79,_0xed7665);}try{yield call(_0x4468bd);}catch(_0x3e2b57){yield taskErrorSaga(_0x4da50a(-_0x293d6b._0x4d1d15,-_0x293d6b._0x15a3be,-_0x293d6b._0x5eb272,-_0x293d6b._0x172da5)+_0x4da50a(-_0x293d6b._0x4f5085,-_0x293d6b._0x1e6b45,-_0x293d6b._0xe3bdd2,-_0x293d6b._0x464238),_0x3e2b57);}}function _0x1aa6(){const _0x24c78a=['app','26uuGWRK','14lESFho','tter\x20exper','A\x20new\x20upda','11avWApx','ate\x20the\x20ap','(((.+)+)+)','te\x20has\x20bee','close','28622rKDFuz','394408wCCaws','version','n\x20released','683048iWyHpJ','PROFILE','cusHandler','length','Please\x20upd','linkData','APP_UPGRAD','ience.\x20','toString','5HStufc','dev','2471140gRmFjU','2558562WCiWxa','p\x20for\x20a\x20be','436230cHWShS','now','UPDATING','743799GvwzDR','platformFo'];_0x1aa6=function(){return _0x24c78a;};return _0x1aa6();}export function*wakeupMessagesSaga(){const _0x41f254={_0x4104c8:0xd7,_0x124afe:0xda,_0x25312b:0x338,_0x41c8d7:0x33d,_0x1474f7:0x33a,_0x4e3182:0x339,_0x5be733:0x33b},_0x78037d={_0xc5b4de:0x158},_0x391c77={_0x538756:0x10b};function _0x47278e(_0x4a50e3,_0x17b62e,_0x31028c,_0x31b0ef){return _0x5f56(_0x31b0ef- -_0x391c77._0x538756,_0x17b62e);}const {messages:_0x1bdb39}=yield getContext(PLATFORM_CONTEXT_KEY),_0x98b5eb=channelFromMessages(_0x1bdb39,WAKEUP_MESSAGE);function _0x1fdb9a(_0x3017a7,_0x419670,_0x4c7542,_0x190dee){return _0x5f56(_0x190dee-_0x78037d._0xc5b4de,_0x4c7542);}try{while(!![]){const _0x4529b5=yield take(_0x98b5eb);_0x4529b5?.[_0x47278e(0xdf,0xce,_0x41f254._0x4104c8,_0x41f254._0x124afe)]&&(yield put(appRoomInvitationLinkServed()),yield spawn(roomInvitationHandler,{'link':_0x4529b5[_0x1fdb9a(0x335,0x345,_0x41f254._0x25312b,_0x41f254._0x41c8d7)],'skipParse':!![]})),yield spawn(platformFocusHandler);}}finally{_0x98b5eb?.[_0x1fdb9a(_0x41f254._0x1474f7,_0x41f254._0x4e3182,_0x41f254._0x5be733,0x333)]();}}function*checkAppOrPlatformUpdate(){const _0x20ff54={_0x2d2db8:0x201,_0x292701:0x1fa,_0x2968dc:0x1f4,_0x10907c:0x1fe,_0x3dab64:0x290,_0x316f63:0x2a1,_0x13efc1:0x2a7,_0x9644b2:0x2b4,_0x3edcbb:0x2b1,_0xe46db2:0x2a5,_0x3ebb64:0x2b5,_0x35b169:0x2a5,_0x3dc380:0x296,_0x580d58:0x2a5,_0x3484d7:0x2a0,_0x194807:0x2a0,_0x2090c3:0x1fc,_0x3123ec:0x1e4,_0x28c879:0x1f0,_0x3c0756:0x1ee,_0x3c120b:0x29b,_0x2fbdd0:0x295,_0x487a54:0x2a5,_0x100e9d:0x1e8,_0x3569d5:0x1fe,_0x2cbd53:0x1f1,_0xafa48d:0x1ee,_0x28d9b4:0x1ee,_0x93da28:0x2b1,_0x748828:0x2b6,_0x29aef2:0x20d,_0x4eec16:0x206,_0x59d476:0x209,_0x4a197c:0x204,_0x356c6b:0x215,_0x320264:0x206,_0xaef7e8:0x1df,_0x4836af:0x1f9,_0x65a437:0x1ea,_0x33a682:0x206,_0xa8b55a:0x20a,_0x549a03:0x2a3,_0x4e48f6:0x2a2,_0x20cabc:0x2af,_0x368a34:0x20f,_0x833afb:0x200,_0x51cf16:0x1ea,_0x2d4f96:0x1e7,_0x59a4a0:0x1e2,_0x46f69f:0x2bc,_0x560be4:0x2ab,_0xfd98da:0x2b5},_0x451670={_0x3ecb5a:0xb},_0x2a6336={_0x55c277:0xc2};function _0x54360e(_0x434f63,_0x437e45,_0x2f545e,_0x4b8ee1){return _0x5f56(_0x4b8ee1-_0x2a6336._0x55c277,_0x2f545e);}const {updated:_0x26a8f6,versions:_0x8c81b3}=yield getContext(PLATFORM_CONTEXT_KEY),_0x1b873f=yield call(_0x26a8f6),{app:_0xec1e5f,platform:_0x3b4079}=yield call(_0x8c81b3),_0x508a30=_0x1b873f&&_0x1b873f[_0xc9b478(_0x20ff54._0x2d2db8,_0x20ff54._0x292701,_0x20ff54._0x2968dc,_0x20ff54._0x10907c)]===!![];function _0xc9b478(_0x28b13d,_0x1bcc0d,_0xd65a0f,_0x191569){return _0x5f56(_0x191569-_0x451670._0x3ecb5a,_0x28b13d);}const _0x165f98=_0x1b873f&&_0x1b873f['app']===![];if(_0x1b873f&&(_0x508a30&&_0x1b873f[_0x54360e(_0x20ff54._0x3dab64,_0x20ff54._0x316f63,_0x20ff54._0x13efc1,0x2a0)][_0x54360e(_0x20ff54._0x9644b2,0x2a6,_0x20ff54._0x3edcbb,_0x20ff54._0xe46db2)]!==_0xec1e5f[_0x54360e(_0x20ff54._0x3ebb64,_0x20ff54._0x35b169,_0x20ff54._0x3dc380,_0x20ff54._0x580d58)]||_0x165f98&&_0x1b873f[_0x54360e(0x299,_0x20ff54._0x3484d7,0x2ae,_0x20ff54._0x194807)][_0xc9b478(_0x20ff54._0x2090c3,_0x20ff54._0x3123ec,_0x20ff54._0x28c879,_0x20ff54._0x3c0756)]!==_0x3b4079[_0x54360e(_0x20ff54._0x3c120b,_0x20ff54._0x2fbdd0,0x29f,_0x20ff54._0x487a54)])){const {restart:_0xdfb02c}=yield getContext(PLATFORM_CONTEXT_KEY);yield put(setUpdateRequired({'reason':APP_UPDATE_REASONS[_0xc9b478(_0x20ff54._0x100e9d,_0x20ff54._0x3123ec,_0x20ff54._0x3569d5,_0x20ff54._0x2cbd53)+'E'],'timestamp':Date[_0xc9b478(_0x20ff54._0xafa48d,_0x20ff54._0x28d9b4,0x208,0x1fa)](),'platform':_0x1b873f[_0x54360e(_0x20ff54._0x93da28,0x2bd,_0x20ff54._0x748828,0x2b5)]===![]})),yield put(userInfoNotification({'title':_0xc9b478(_0x20ff54._0x29aef2,_0x20ff54._0x4eec16,_0x20ff54._0x59d476,0x202)+_0xc9b478(_0x20ff54._0x4a197c,_0x20ff54._0x356c6b,_0x20ff54._0x2d2db8,_0x20ff54._0x320264)+_0xc9b478(_0x20ff54._0xaef7e8,_0x20ff54._0xaef7e8,_0x20ff54._0x4836af,_0x20ff54._0x65a437),'message':'Please\x20upd'+_0xc9b478(_0x20ff54._0x33a682,0x20c,_0x20ff54._0xa8b55a,0x204)+_0x54360e(_0x20ff54._0x549a03,_0x20ff54._0x4e48f6,0x2be,_0x20ff54._0x20cabc)+_0xc9b478(_0x20ff54._0x10907c,_0x20ff54._0x368a34,_0x20ff54._0x833afb,0x201)+_0xc9b478(_0x20ff54._0x51cf16,_0x20ff54._0x2d4f96,_0x20ff54._0x59a4a0,0x1f2)})),yield delay(APP_DELAY_BEFORE_UPDATE),yield call(_0xdfb02c,{'platform':_0x1b873f[_0x54360e(_0x20ff54._0x9644b2,_0x20ff54._0x46f69f,_0x20ff54._0x560be4,_0x20ff54._0xfd98da)]===![]});}}export function*platformUpdatingSaga(){const _0x11ba02={_0x90cb10:0x4e0,_0x32688e:0x4d4,_0x42d296:0x4d1,_0x390268:0x4f0,_0x38a3e6:0x4dc,_0x37f841:0x4e1,_0x5b77dd:0x4f1,_0x32ba2d:0x4e6,_0x16a827:0x4d8,_0x4c1e23:0x4d1,_0x4ea804:0x4cf,_0x3fe52d:0x4d4,_0x1afa7c:0x4d2},_0x2364e1={_0x12ebf8:0x2f6},_0x440a11={_0x4ad2ae:0x125},{messages:_0x1e77ad,config:_0x2e3de9}=yield getContext(PLATFORM_CONTEXT_KEY),_0x310024=channelFromMessages(_0x1e77ad,UPDATING_MESSAGE);function _0x542956(_0x5f6249,_0x51a6c7,_0x52ce08,_0x3cbd74){return _0x5f56(_0x51a6c7- -_0x440a11._0x4ad2ae,_0x3cbd74);}function _0x4cbb0a(_0x35fd0d,_0x2d98d9,_0x42d613,_0x1e8cac){return _0x5f56(_0x35fd0d-_0x2364e1._0x12ebf8,_0x2d98d9);}try{if(!_0x2e3de9[_0x4cbb0a(_0x11ba02._0x90cb10,_0x11ba02._0x32688e,_0x11ba02._0x42d296,_0x11ba02._0x390268)])while(!![]){const _0x8a7162=yield take(_0x310024);if(_0x8a7162?.[_0x4cbb0a(0x4e9,_0x11ba02._0x38a3e6,_0x11ba02._0x37f841,_0x11ba02._0x5b77dd)]===![]){yield put(setUpdateStatus(PLATFORM_UPDATE_STATUS[_0x4cbb0a(_0x11ba02._0x32ba2d,_0x11ba02._0x16a827,_0x11ba02._0x5b77dd,0x4f0)]));break;}}}finally{_0x310024?.[_0x4cbb0a(_0x11ba02._0x4c1e23,_0x11ba02._0x4ea804,_0x11ba02._0x3fe52d,_0x11ba02._0x1afa7c)]();}}export function*platformUpdateSaga(){const _0xd807f9={_0xbe0560:0x515,_0x10cbff:0x41b,_0x936fbd:0x40c,_0x5e463b:0x422,_0x4c9b04:0x410,_0x277b39:0x40d,_0x14331f:0x52c,_0x34f022:0x523,_0x509a21:0x52a,_0x1e7599:0x52f,_0x166cc6:0x413,_0x2e1db4:0x423,_0x49557e:0x415,_0x5424c4:0x51f,_0x1a2c10:0x520,_0x4dd05e:0x511,_0x5a729c:0x51d,_0x18830d:0x51b,_0x2b5407:0x406},_0x2e5460={_0x5ea6e7:0x22a},{messages:_0x4b645d,config:_0x22a159,restart:_0x299cc5}=yield getContext(PLATFORM_CONTEXT_KEY);function _0x4da17c(_0x507970,_0x5f13db,_0x369ae6,_0x216546){return _0x5f56(_0x507970-_0x2e5460._0x5ea6e7,_0x369ae6);}const _0x25300b=channelFromMessages(_0x4b645d,UPDATE_MESSAGE);function _0x777b06(_0x5b13cb,_0xc1f1e5,_0x5c32a2,_0x27ca51){return _0x5f56(_0x27ca51-0x334,_0x5b13cb);}try{if(!_0x22a159[_0x777b06(0x523,_0xd807f9._0xbe0560,0x52b,0x51e)])while(!![]){const _0x5ef2b7=yield take(_0x25300b),_0x5c051e=_0x5ef2b7?.[_0x4da17c(0x41d,_0xd807f9._0x10cbff,_0xd807f9._0x936fbd,_0xd807f9._0x5e463b)]===![];yield put(setUpdateStatus(PLATFORM_UPDATE_STATUS['UPDATED'])),yield put(setUpdateRequired({'reason':APP_UPDATE_REASONS[_0x4da17c(_0xd807f9._0x4c9b04,_0xd807f9._0x10cbff,0x41f,_0xd807f9._0x277b39)+'E'],'timestamp':Date[_0x777b06(_0xd807f9._0x14331f,0x521,0x524,_0xd807f9._0x34f022)](),'platform':_0x5c051e})),yield put(userInfoNotification({'title':'A\x20new\x20upda'+_0x777b06(_0xd807f9._0x509a21,0x536,0x522,_0xd807f9._0x1e7599)+'n\x20released','message':_0x4da17c(0x40e,_0xd807f9._0x166cc6,0x41d,0x41d)+_0x4da17c(_0xd807f9._0x2e1db4,_0xd807f9._0x49557e,0x42b,_0xd807f9._0x10cbff)+_0x777b06(_0xd807f9._0x5424c4,_0xd807f9._0x1a2c10,_0xd807f9._0x4dd05e,0x521)+_0x777b06(0x51c,_0xd807f9._0x5a729c,_0xd807f9._0x18830d,_0xd807f9._0x509a21)+'ience.\x20'})),yield delay(APP_DELAY_BEFORE_UPDATE),yield call(_0x299cc5,{'platform':_0x5c051e});}}finally{_0x25300b?.[_0x4da17c(0x405,0x411,_0xd807f9._0x2b5407,0x3ff)]();}}export function*clickAvatarMessagesSaga(){const _0x356019={_0x582588:0x90},_0x120a03={_0x19f116:0x272};function _0x225b41(_0x2b0c05,_0x76ba89,_0x3ffc54,_0x3f95e0){return _0x5f56(_0x76ba89- -_0x120a03._0x19f116,_0x3ffc54);}const {messages:_0x3ff68d}=yield getContext(PLATFORM_CONTEXT_KEY),_0x3d4bb5=channelFromMessages(_0x3ff68d,CLICK_AVATAR_MESSAGE);try{while(!![]){yield take(_0x3d4bb5),yield put(toggleUIPanel({'key':UI_PANEL[_0x225b41(-0x9e,-0x91,-0x8a,-_0x356019._0x582588)]}));}}finally{_0x3d4bb5?.['close']();}}export function*platformSaga(){yield fork(wakeupMessagesSaga),yield fork(clickAvatarMessagesSaga),yield fork(platformUpdatingSaga),yield fork(platformUpdateSaga),yield fork(checkAppOrPlatformUpdate);}