@eryxenx/insta-chat 2.0.1 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +95 -8
  2. package/index.js +105 -1
  3. package/module/login.js +51 -1
  4. package/package.json +9 -2
  5. package/src/api/action/getAppState.js +19 -1
  6. package/src/api/action/getCookies.js +7 -1
  7. package/src/api/action/getCurrentUserID.js +7 -1
  8. package/src/api/action/setOptions.js +8 -1
  9. package/src/api/messaging/editMessage.js +19 -1
  10. package/src/api/messaging/markAsRead.js +7 -1
  11. package/src/api/messaging/resolvePhotoUrl.js +8 -1
  12. package/src/api/messaging/sendMessage.js +45 -1
  13. package/src/api/messaging/sendMessageSync.js +8 -1
  14. package/src/api/messaging/sendTypingIndicator.js +7 -1
  15. package/src/api/messaging/setMessageReaction.js +19 -1
  16. package/src/api/messaging/shareContact.js +19 -1
  17. package/src/api/messaging/unsendMessage.js +16 -1
  18. package/src/api/realtime/getInbox.js +7 -1
  19. package/src/api/realtime/listen.js +7 -1
  20. package/src/api/realtime/stopListening.js +7 -1
  21. package/src/api/threads/getThreadHistory.js +16 -1
  22. package/src/api/threads/getThreadInfo.js +59 -1
  23. package/src/api/threads/getThreadList.js +22 -1
  24. package/src/api/users/getUID.js +12 -1
  25. package/src/api/users/getUserInfo.js +37 -1
  26. package/src/api.js +253 -1
  27. package/src/app/InstaClient.js +352 -1
  28. package/src/app/InstaContext.js +46 -1
  29. package/src/app/createFcaClient.js +59 -1
  30. package/src/app/loadApiMethods.js +30 -1
  31. package/src/constants.js +53 -1
  32. package/src/cookies.js +41 -1
  33. package/src/deviceIdentity.js +31 -1
  34. package/src/events/normalizeEvent.js +142 -1
  35. package/src/http.js +381 -1
  36. package/src/messageContent.js +73 -1
  37. package/src/methods/inbox.js +464 -1
  38. package/src/methods/media.js +218 -1
  39. package/src/methods/message.js +115 -1
  40. package/src/methods/reactions.js +52 -1
  41. package/src/methods/thread.js +96 -1
  42. package/src/methods/typing.js +35 -1
  43. package/src/methods/user.js +33 -1
  44. package/src/session.js +94 -1
  45. package/src/threadDetail.js +36 -1
  46. package/src/utils/antiSuspension.js +269 -0
  47. package/src/utils/dataDir.js +11 -0
  48. package/src/utils/errors.js +106 -0
  49. package/src/utils/format.js +38 -1
  50. package/src/utils/messageStyle.js +57 -1
  51. package/src/utils/sessionGuard.js +93 -0
@@ -4,4 +4,355 @@
4
4
  * Licensed under the Apache License, Version 2.0. See LICENSE and NOTICE.
5
5
  * Original author credit must be retained in all copies and derivatives.
6
6
  */
7
- const _0x483d7a=_0x2275,_0x4b31db=_0x2275;function _0x2275(_0x161dfd,_0x5272cb){_0x161dfd=_0x161dfd-0x71;const _0x27014a=_0x2701();let _0x227517=_0x27014a[_0x161dfd];if(_0x2275['wIpGMA']===undefined){var _0x4e8c0c=function(_0x26b4ad){const _0x1bdd6d='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2988d8='',_0x8efe27='';for(let _0x50f35a=0x0,_0x59e9d6,_0x3b9f9e,_0x4b6233=0x0;_0x3b9f9e=_0x26b4ad['charAt'](_0x4b6233++);~_0x3b9f9e&&(_0x59e9d6=_0x50f35a%0x4?_0x59e9d6*0x40+_0x3b9f9e:_0x3b9f9e,_0x50f35a++%0x4)?_0x2988d8+=String['fromCharCode'](0xff&_0x59e9d6>>(-0x2*_0x50f35a&0x6)):0x0){_0x3b9f9e=_0x1bdd6d['indexOf'](_0x3b9f9e);}for(let _0x2e2514=0x0,_0x1df1b9=_0x2988d8['length'];_0x2e2514<_0x1df1b9;_0x2e2514++){_0x8efe27+='%'+('00'+_0x2988d8['charCodeAt'](_0x2e2514)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x8efe27);};const _0x2c3447=function(_0x48c733,_0x3315d0){let _0xeec831=[],_0x3a1c19=0x0,_0xd0d55b,_0x296406='';_0x48c733=_0x4e8c0c(_0x48c733);let _0x26fd11;for(_0x26fd11=0x0;_0x26fd11<0x100;_0x26fd11++){_0xeec831[_0x26fd11]=_0x26fd11;}for(_0x26fd11=0x0;_0x26fd11<0x100;_0x26fd11++){_0x3a1c19=(_0x3a1c19+_0xeec831[_0x26fd11]+_0x3315d0['charCodeAt'](_0x26fd11%_0x3315d0['length']))%0x100,_0xd0d55b=_0xeec831[_0x26fd11],_0xeec831[_0x26fd11]=_0xeec831[_0x3a1c19],_0xeec831[_0x3a1c19]=_0xd0d55b;}_0x26fd11=0x0,_0x3a1c19=0x0;for(let _0x14eb31=0x0;_0x14eb31<_0x48c733['length'];_0x14eb31++){_0x26fd11=(_0x26fd11+0x1)%0x100,_0x3a1c19=(_0x3a1c19+_0xeec831[_0x26fd11])%0x100,_0xd0d55b=_0xeec831[_0x26fd11],_0xeec831[_0x26fd11]=_0xeec831[_0x3a1c19],_0xeec831[_0x3a1c19]=_0xd0d55b,_0x296406+=String['fromCharCode'](_0x48c733['charCodeAt'](_0x14eb31)^_0xeec831[(_0xeec831[_0x26fd11]+_0xeec831[_0x3a1c19])%0x100]);}return _0x296406;};_0x2275['FbuKYq']=_0x2c3447,_0x2275['DIQzQQ']={},_0x2275['wIpGMA']=!![];}const _0x51489f=_0x27014a[0x0],_0x1e672a=_0x161dfd+_0x51489f,_0x468497=_0x2275['DIQzQQ'][_0x1e672a];return!_0x468497?(_0x2275['WjYhcF']===undefined&&(_0x2275['WjYhcF']=!![]),_0x227517=_0x2275['FbuKYq'](_0x227517,_0x5272cb),_0x2275['DIQzQQ'][_0x1e672a]=_0x227517):_0x227517=_0x468497,_0x227517;}(function(_0x1c0689,_0x32292d){const _0x39147c=_0x2275,_0x5de4b9=_0x2275,_0x541a09=_0x1c0689();while(!![]){try{const _0x2c5fca=parseInt(_0x39147c(0x9d,'U4J2'))/0x1*(parseInt(_0x5de4b9(0xc4,'ViE4'))/0x2)+parseInt(_0x39147c(0xe5,'Hp^K'))/0x3+parseInt(_0x5de4b9(0x133,'iAI4'))/0x4*(-parseInt(_0x39147c(0xa2,'Yguh'))/0x5)+-parseInt(_0x5de4b9(0x207,'g1um'))/0x6+parseInt(_0x5de4b9(0x11f,'%^Lo'))/0x7*(-parseInt(_0x5de4b9(0x235,'Hlv3'))/0x8)+-parseInt(_0x5de4b9(0x255,'Yguh'))/0x9+parseInt(_0x39147c(0x1fc,'](YC'))/0xa;if(_0x2c5fca===_0x32292d)break;else _0x541a09['push'](_0x541a09['shift']());}catch(_0xc1a4d0){_0x541a09['push'](_0x541a09['shift']());}}}(_0x2701,0xc338c));function _0x2701(){const _0x41636a=['W7NcNsaSjx0','W7JcQmk7WPu/','W5lcVI8+WPWS','W67cNqi3n3y','W4BcOL4Ef0y','W4BdRGZcKWpcTG','W6NcG8ok','DcZcVG3cUCog','d8kOW643WQbR','W5xcTv49','ySokqG','W5xcLLldMGK','jSkBxhu7','C3FcHYFdLG','W7mjCCkbW7C','zhlcRbq','B8oHWQpdMmo6W60','ggtdLa','j8oGumoHB8kD','W7lcLSoQW45IW5S','WQdcUqTJWO0','W71yWPxdUCoJW6G','iaz1CSoq','xmocB8oMBJW','WQ3dGSoYfmofjq','W7NcVJO','Cmooww83xa','WRzmhCoNW7Hx','W5xcJCkWWPiIWPq','D0nJr8knWOq','W5GuccBdHCkX','nmkntq','xJ3dISkj','v8oeWQRcGxWw','D8oosMuXvG','pCkQW40','W6FcGmkHWPa4','W6ZcKmoehd3cIq','W6tcSgZdHG','l8k/W4RcILOi','W7ZcTdy','W5RdM07dGXi','WRbjWOyT','W5jcjCoEWPi2','e8oDFSoWEx0','WR7dO8kfWO3cQYG','d2pdVCk9Fmor','zCoiE2ap','W7RcI8oaadtcJq','W5xcK8kWWOa/WPy','mSkCtwyRhG','W7/dPsFcVYG','FmoiWR7cOa','wmo5WRldIq','W4pcONKDeuy','W5D5WRNdI8ow','pHHSxCoFta','W6NcJSk7WOaKWOG','Aw3cScy','WPFcImoHqmoWEa','WOzAW5tcQYKG','W6/cVSkLWPOZWQu','W7zmWPi5','W4KElCkMW4WO','W4/cM34/W4FcQG','W6SPyCkpW6JdUa','ngxcJSo1oSoZ','W5RdU8kGrLzV','FvvHtCkkWOm','WQ8wW4BcUmov','W77cMXhdGdxdQG','W5LSWONdVCon','WQK0W5O','WRRcVaO','WOxcImoeqmo4','W6JcIvOvW6y','W5NcTCobW6NdTa','s0rNrG','W5/dILJdUrDW','W7ezmmkbW4ye','WOJcVmo9ebS1W4dcPYZcMLxcO8kBW4i','n8kra1pcVmoq','WRxcRGWZ','W4RdPCkDvKC','WP/cM8oLFMu','pSkiW6CCWQ4','WPNcICoquLVcMa','W5xcJmkWWPC5WPS','WQW1W5pcL8o5','WQSXW5O','W4/dILRdGav2','yxtcSrSMxG','WRpcUbC7WQtdNW','yYBdGCkamvS','WRrtgG','DsZcVrZcVSoi','W5JdVGBcR8o3CG','W7fVW5e','WRJcNSolFgFcHa','W5BcRNSCf0y','W7elmmkmW6eR','WQD6aColW4C','ffn1kMub','W6TFWPtdVmo+W60','W7ZcISkgWOa1','d8okFG','zchcPXRcTq','WRNcSmk/W5ux','omk4B2aQ','W6hcGmoIW4VdNHa','W4pdJKxdSeW','WQbqfSoJW5rH','W67cQseQWPSL','jSoQvSof','ffn1nNGg','W5JdNutdIH53','ymossMG+xG','a8kXBvq+','a8kOW4hcNwml','vdxdLW','WQW5W40','z8oAcJjXrs3cMc3cMCk9W7bkua','WRVdH1H7AI3cK0RdRv3cR8kwja','DCoFF24RxG','ywpcSq','W5X3W4NdT8oz','W4ldGM/dPXLM','W5lcLmkxWPSc','W4pcOMm','WRFcHCoMsuS','hmk0W5qzWRPG','WPlcQmkcW7y/','W7FdNmoOWObRWP9qnSkJW5/cPZBdVW','W5BcSNKAm0y','sd3cPXRcK8oi','W5NcHmk7WPC','WPuPW4ZcL8oufG','FCooWP3cMK0','A8ofWQG','ffn1ih4r','WRBcN8o6','WOBdVYrpCrRdGSo/k1FcHmkG','z3BcRcuOyG','aCkPEc7cNuG','W4/cGComW4ZdNdG','bKvKewuc','W6BdPrpcNSoNCW','rZ/cOqNcTCoB','W5/cQLalkfO','WO7cISoNtSo6DW','W6RdJmkLsue','W43cI8otcZlcJa','WRddNXpcKSoNvwG','w1tcPYVdNIy','WQNcPtmpWRO','smofWPldUmoy','sdhdL8kz','bL3cJ8o+','lSkyW53cU38c','nCkDv2q8hW','jhNdGSk3ECo9','nCo3smo3ACkB','W5xcJmkMWPqeWPi','W6TjWR7dUmo8','W6NcSfj7WOJcHW','nhJcLmoXlCo6','mmkqgvhcQ8or','kmkYW5BcI20d','W7CJDmksW73dRW','WQngpSo0W7nr','WQNcJWi4WPe','WRlcJ8kV','WObBW4tcTZqN','W5JcUG0xjq','gwpdIq','AvBcHJZdIq','W5SDp8kkW5a','WQ7cNSk0W7aNW4e','WRv5nmotWRxcV0JdGSo9WQldHmowW7S','W6NcJSk7WOu1WOG','W57dN0tdVai','kmo3W5dcL3Wc','W7FcJmow','W7ldPq0','bwFcIG','mSohxCo9CSkA','uG/cVH/cGa','CCo5sNu8','WPZcG8oaAa','j15ZbMOh','cmkHW4W/WRK','pCoFy8oyEcK','D2JcOq/dOW','j8kKzd/cQv8','ef5GdwWg','W5JdVG/cNCoXAq','W40tpa','W6W2dCkSW6a','W6rVW43cRWD8','W4lcONOCkK0','avnGbW','W7zUW4FcNIjW','W7LUW4BcSW','DKnMwG','W7C5CSkoW5JdUa','iSkbgq','WOZcICojFLJcJW','W7ZcG0qaW5i','ystcQW7cTCoB','WQ/dLmkAWQFcHG','W6pdU1rZW4pcG8oqW4XtWQKTW43cMW','i8oCB8o7ErW','W4NdIKFdLWn1','x37cQXivAq','W6pcHCoTabq','WRvhWPy9W7q','pmkCvG','WQtcQdLP','WQq9W5lcL8kC','DSozx2KR','eSolB8oT','WRhdNL3dNc4','yYtdJCkof1C','WQSSW5y','gg3cK8o2pSoZ','ec7dRmkhW47dGbfrW77dGbWN','W4ddJLZdTH4','W6tcVNVdMHtdMW','W4tdNHRcObNcVW','W5y/zCkzW4VdUa','zspcRXtcTq','W5JdNe3dPXHY','e8oCFmo9WOfH','W6xdVqdcKcy','WQ/cLJTkWRK','yZJdGCkmjLG','W5NcRw3dJbxdLG','WRG5W57cLG','WPrveSoLW7Xx','jComFmorWPbg','W7LiWONdJ8oKW6q','W7tcHSopgIa','CmowqMu8','W4SPlsldTW','iCo1tq','WQpdKfddKrhdQW','W4hcTISOWPSO','WQBcG8kEW5aJ','W4yCsmkXW4W','W4VcQI4/W4NcLa','WRFcJ8oGtSonFW','W5pcQhKAjLS','WOVdVmkfWOhcQW','imkYBZNcO0O','kb9Twmocsq','qSopWR/dRmo7W6y','WRLsWOSOW7NcHq','W77cLWiNaNa','W5CKCSkoW6ZdRG','W7lcSJqPWRqM','x3hcSrSLtW','W57cO3ib','pa/dTxlcM3T+vurnDCkqWRi','W7RcNCocW5tdIq','W4JdSfJdVbvm','W64EcJxdHmk7','h8oWv8onC8k2','eN/dS8kNBCos','W6NcLmokW5FdIY4','WOtcVGyMWPhdNq','W7JdGvVdOazJ','oCkKzcZcIeq','ngtcMmoZhmo1','w8oiWQpcSa','WQtdGeZdKaFdRa','WRVdOSkpWPNcRcu','mmokA8oNCZG','W6v3W4VdSmoPvq','bMFcJ8oInW','bhJcICo7aCo1','WQpdLfNdKbldTW','smoxySo3BJnw','EbFcGtVcHq','zmoFx1yRva','xmopwgmRCG','pSokEmo3','W63dTfb9W4lcHCkaW7zyWRyNW40','WPVdNu7dVXG','W4lcL8oPW7VdUG','hSkJW7q+WR9R','WPZcHCokDq','WQ3cJ8kiW4S8W4q','WR1xb8oH','imkZzG','rcJcOb0','WP7cMSkYW5erW4y','e8oFCmoWWQzb','W6hcNmonW4RdOXC','eCokzmoHptq','A8ozWRJcPMOM','WRlcJSo7x8oCqW','W7FdTHxcLW','WQu/WPddUwqNW5dcNL45FHS','WP7cG8k8W6i7W4q','W7pcRg3dJsxdNa','u37cVmou','vLhcSXKI','WQPVWOW4W7pcIG','y1RcR8oxWQy','kbHSvG','W5L2W4tdVmoHsa','omkkgvxcUSow','W5W+zCkyW6ldPG','WQ8YW4S','W7PDWPi','W7jaWPRdVCoYWQ4','W67cUJOK','W6BcUcy6WRu','h8oOqComAmkE','W5BcKuNdPHW','dMhcL8oFyqrDW7JcQJrquG','W6ZcVIa4WQC6','W7H+W4ZcJsn6','omkGFG','W77cRNqsku4','W7tcTW/cKmoQmq','W7VcHSotoYdcJq','W4ZdN0e','W7JcTCk6WRqIWPu','WRZdHHhdMctdSa','jmoBBCoJWQjf','W4L7W5e','qwFcRbqIAq','W50ugHldHW','WRrxgSoNW7HO','WQ5pWOCPW7NcUG','W5/cJ8k+WP0/WO0','W7hcMtSQWPqS','W4ZdMmk/vNy','WOZcUCoxDfW','rN7dVCky','kCkPW4hcNh8','rx7cSSo2WO7cMG','W6ZcGGu','W7ldPatcJCoWCa','DhBcQWe','W6NdVCkRv2r0','WQ/cUreUWRldNW','avrhbf8','DCoIWPFdVSoS','W5RcRx4Z','W6FcTd8nWR0','W6NcSfS3W4ldJa','aCk4W7FcJSk6WRBdRmkDW6RdL8kgBW','W7fJW4/cRG4','W5NcSM3dMXpdMW','zSooq2K9sa','W6tdHMRdJrm','mSkmgweNba','vHZcNr/cVG','WRGvW5lcI8oZ','dMldGSk6ySos','W7/cKSkWWOe+WPS','W4lcQxyuiG','W6FcR2e','yYhdL8kijN8','jmkWW5qIWQXT','W6VdGqBcOstcUW','dN/dLmkGzCov','h8k1W4JcGx4','e8k8W4u4WRLA','W7tdPW3cLSoQ','W7JcHIajiW','W6VcHWiGjNe','bWnby8ot','W5GrcHldHmk6','W6tdVWdcKCo5Da','WO5pW5tcIYGS','W4hdNHK','W7ZcVJWzWOeS','W4a+ocldNq','W5jQW5hdOG','WOxcKSo8smoyCG','nZ9WxSoetG','WPRcJCoqCa','jCkOwr/cSq','ymoAx0eKg0RdSG','p8kTsqhcTW','W5VdQ8k6','W6/dTHi','gSkHW4K','WQ/cQdHRWQ9P','e8onymoWFIK','WQpcHCkJ','W6pcGhJdLHNdPq','W6dcIvyGiq','W7ePBSkFW5JdUq','rgNcLmo0','CCo8wwK0CG','W4NdVCkRv0XN','pCkUW43cMgKQ','Cf3cSt4','B8oiWRNcGxWw','W53dVSkN','fmoAw8o7WRC','oH9XxSoWtW','WR/cUtK','W7/cKSkWWOeJ','lSogFq','W4dcV8kYef4W','BxZcQGuy','fLpcR8oDWOxcSsO','W5NcISoiW5RdLq','W7PkWPldTmoWW54','vCo/WO/dVq','WO7cLSoRtmolEa','W6VcHSopgGBcMW','WO7cS8ojDf3cMq','W6GjnSkcW6SK','W4RcQmoWnZO','W6RcLXG','WRtcS8ok','WQNcMraUWOy','W5ddGSklzfRcGW','dmooFSo9','vxhcLYud','WOZcQSowFKpcOW','W43cRZ4BWR4','W7tcNGK','qSooWQFdISoT','WRBcMreN','W43dNSocv0lcH0VcGG','nmkntu4Mfa','k391m00','WOtdQ2i5W4xcKq','wZhdKa','uedcQtiv','WQhcUt5QWQTB','WQVcKW4UWOFdGW','fmocB8o7AqK','jSkguMKNaq','WPjAW5tcTI42','W6tcJ07dUrG','W5hdSWxcRXpcJa','qSozWQNdVSo6W6W','wqVdLmken2K','iCkgwgOT','hxJdVCk4ta','WO7cMmoNq8oDwa','jCkliv/cV8oC','W4JcRwO','WPVcMmomFKRcMq','a8k3W4hcIMug','z3BcRdy0CW','q8o5WRtdKmoMW6q','WRjgbW','mmoWv8oa','W6TeWQJdJSoA','WODuWOCZW7NcPq','W6aTDmkiW6u','W7XiWO8','pmoaASoN','W57cSNOBiL0','z8oBx2C','xHhdOmkyhW','o8k/W5dcU38c','WP3cHmob','W6ldPsJcUW','gGjXxSoxra','y3VcVq','c8koW40ZWR59','W6NcKCoocdRcHa','i8oTqq','xs/cOCkaWOddHa','oCkpW5BcGG','qSoOWQFdNCooW6O','W5NdTSk+sLbY','W7LeWP8','EIJcVqRcSCoo','lHC6emoxW4GYlmk/WRWcjGW','W4tcS3yAl0i','W6tdVWq','jghdGSk1x8oC','W7hcQ8oeW5hdVa','W55CW5ddUSoo','v8oeWQRcHgyq','pSo6ASo2WPC','W7bVWOm','hrz1c3Kg','W7ePBCkeW7VdRW','afPOag4','jhZdMmkXsmov','WQhcUsnT','W4ddIKBdOq','W6eiarddGSk9','dg3cICohhCo+','WRToWOC','WQfgc8oL','W4H7W4tdTG','W4RdILZdGav2','cSkXyYJcV00','amknv2m','WOBdHmkMWOJcKa','W50pk8kgW4WT','W5RdGapcJXy','zSouxW','BSoiWR8','z0ZcTZJdIr0','WR3cPq8UWQtdMq','W6RcLXGkphO','W7BcMNNdLqa'];_0x2701=function(){return _0x41636a;};return _0x2701();}const fs=require('fs'),path=require(_0x483d7a(0xc0,'rXmn')),axios=require('axios'),{AUDIO_EXT,VIDEO_EXT,extOf}=require(_0x4b31db(0x1c9,'vGV9')+'ls/for'+_0x483d7a(0xc7,'[6sy')),{convert}=require(_0x483d7a(0x12b,'iAI4')+_0x483d7a(0xcd,'vGV9')+_0x483d7a(0x9c,'vGV9')+_0x4b31db(0x130,'hWKA')),loadApiMethods=require(_0x4b31db(0x136,'6GBF')+_0x4b31db(0x242,'U4J2')+_0x4b31db(0x1ad,'x!9h'));class InstaClient{constructor(_0x458b9c,_0x28ffd8={}){const _0x2eb16b=_0x483d7a,_0xf96509=_0x4b31db,_0x1ba1c1={'PYTSv':_0x2eb16b(0x227,'Yguh')+_0xf96509(0x19b,'zYxW')+_0x2eb16b(0x11d,'ReLL')+_0xf96509(0x15d,'%^Lo')+'1','jlCJK':function(_0x3b1e3d,_0x21de4b){return _0x3b1e3d(_0x21de4b);}},_0x3dc369=_0x1ba1c1[_0x2eb16b(0x1f8,'](YC')][_0xf96509(0x237,'^C!F')]('|');let _0x63d62b=0x0;while(!![]){switch(_0x3dc369[_0x63d62b++]){case'0':_0x1ba1c1[_0x2eb16b(0x107,'[6sy')](loadApiMethods,this);continue;case'1':this[_0x2eb16b(0x225,'X8hM')+_0xf96509(0x24b,'2Blb')]=new Map();continue;case'2':this[_0x2eb16b(0x18d,'[qOQ')]=_0x458b9c;continue;case'3':this[_0x2eb16b(0x236,'X8hM')+'t']=convert;continue;case'4':this[_0x2eb16b(0xfb,'X0z^')+_0xf96509(0x1be,'zYxW')+_0x2eb16b(0x1ab,'rXmn')]();continue;case'5':this[_0x2eb16b(0xac,'ok#&')+_0xf96509(0x15c,'izFb')]=new Map();continue;case'6':this[_0xf96509(0x8e,'izFb')+'ndex']=new Map();continue;case'7':this[_0xf96509(0x1f2,'z%DR')]=_0x458b9c[_0xf96509(0x149,'Pe*k')+_0xf96509(0x244,'[6sy')+_0x2eb16b(0x111,'%^Lo')]?_0x458b9c['getCur'+_0x2eb16b(0xc5,'rXmn')+_0xf96509(0x122,'Hp^K')]():null;continue;case'8':this[_0xf96509(0x26a,'^C!F')+'me']=_0x458b9c[_0x2eb16b(0x214,'2Blb')+'me']||null;continue;case'9':this[_0xf96509(0xa8,'z%DR')]=_0x458b9c[_0xf96509(0x1b8,'Hp^K')];continue;case'10':this[_0x2eb16b(0x9b,'eRq1')+'s']=_0x28ffd8;continue;case'11':this[_0x2eb16b(0x1d2,'kNm&')+_0x2eb16b(0x114,'IOC!')+_0xf96509(0xe8,'[qOQ')]();continue;}break;}}[_0x4b31db(0x88,'Pe*k')+_0x4b31db(0x84,'x!9h')+_0x4b31db(0x147,'iAI4')](){const _0x243e45=_0x483d7a,_0x3123bb=_0x4b31db,_0x2407db={'KIRyX':function(_0x101cff,_0x2d6097){return _0x101cff===_0x2d6097;},'EYGJc':_0x243e45(0x1bc,'X8hM')+_0x243e45(0x25e,'[qOQ'),'awAoK':function(_0x23b881,_0x103bbb){return _0x23b881 in _0x103bbb;},'riPDN':function(_0x5875e5,_0x1698cf){return _0x5875e5===_0x1698cf;},'UbOPB':_0x3123bb(0x222,'](YC')+'on'},_0x525a1f=Object[_0x3123bb(0x9f,'[qOQ')+_0x3123bb(0x22b,'Hlv3')+'Of'](this[_0x243e45(0x117,'ReLL')])||{};for(const _0x5e1b25 of Object[_0x243e45(0x205,'PSQq')+_0x243e45(0x216,'0SJh')+_0x3123bb(0x18b,'PSQq')+'s'](_0x525a1f)){if(_0x2407db[_0x243e45(0x1b6,'xCE7')](_0x5e1b25,_0x2407db[_0x243e45(0x1d8,'PSQq')])||_0x2407db[_0x3123bb(0x1d7,'iAI4')](_0x5e1b25,this))continue;const _0x3c032d=this[_0x243e45(0x117,'ReLL')][_0x5e1b25];if(_0x2407db[_0x243e45(0x21d,'Yguh')](typeof _0x3c032d,_0x2407db[_0x3123bb(0x12d,'Pe*k')]))this[_0x5e1b25]=_0x3c032d[_0x3123bb(0xa6,'iAI4')](this[_0x243e45(0xcb,'^C!F')]);}}[_0x4b31db(0x193,'Hp^K')+_0x4b31db(0x1e5,'iAI4')+_0x4b31db(0x10d,'g1um')](){const _0x3e5c10=_0x4b31db,_0x5bcfe6=_0x483d7a,_0x1c1cef={'bUEYI':function(_0x3f3b50,..._0x46fa7d){return _0x3f3b50(..._0x46fa7d);},'sPcEO':_0x3e5c10(0x1d4,'^V#y')+'on'};if(typeof this[_0x5bcfe6(0x78,'izFb')][_0x3e5c10(0x1e9,'2Blb')+'ox']!==_0x1c1cef[_0x3e5c10(0x243,'1r*u')])return;const _0x493342=this[_0x5bcfe6(0x10a,'PSQq')]['getInb'+'ox'][_0x5bcfe6(0x1a3,'ViE4')](this[_0x3e5c10(0x1e1,'z%DR')]);this[_0x5bcfe6(0xdb,'hWKA')][_0x5bcfe6(0x195,'izFb')+'ox']=async(..._0x2a4a0f)=>{const _0x4d4afb=_0x5bcfe6,_0x1bdd59=_0x3e5c10,_0x1d36eb=await _0x1c1cef['bUEYI'](_0x493342,..._0x2a4a0f);return this[_0x4d4afb(0x19f,'X8hM')+_0x4d4afb(0x102,'zYxW')+'s'](_0x1d36eb),_0x1d36eb;};}async[_0x4b31db(0x1b4,'X8hM')+_0x483d7a(0x187,'!xc6')+_0x483d7a(0x17f,'1r*u')+'rl'](_0x5583ca){const _0x2409de=_0x4b31db,_0x33e6de=_0x483d7a,_0x5eac38={'PNAYf':function(_0x26c155,_0x362c5c){return _0x26c155(_0x362c5c);},'TrJmA':_0x2409de(0x97,'vl*l')+'me'},_0x447e73=String(_0x5583ca)[_0x33e6de(0x25a,'x!9h')](/graph\.facebook\.com\/(\d+)\/picture/i)||_0x5eac38[_0x33e6de(0x10f,'!xc6')](String,_0x5583ca)[_0x33e6de(0x265,'^C!F')](/graph\.facebook\.com\/(\d+)/i);if(!_0x447e73)return null;const _0x51b98e=_0x447e73[0x1],_0x373cad=/instagram\.com/i[_0x33e6de(0x21f,'ViE4')](_0x5eac38[_0x33e6de(0xc3,'MDj)')](String,_0x5583ca));return this[_0x2409de(0x169,'08fL')+_0x2409de(0xdf,'Yguh')+_0x33e6de(0x12a,'Yguh')](_0x51b98e,_0x373cad?_0x5eac38[_0x2409de(0x1cd,'zYxW')]:'id');}async[_0x483d7a(0x1e3,'xOUC')+_0x483d7a(0x119,'QPc]')+_0x4b31db(0x16a,'ok#&')](_0x2d0b28,_0x39adcf='id'){const _0x28e5ad=_0x483d7a,_0x5bb44b=_0x4b31db,_0x48d89d={'LTBQA':function(_0x534fd5,_0x493ccf){return _0x534fd5(_0x493ccf);},'wtfVd':function(_0x10f808,_0x19e8ff){return _0x10f808(_0x19e8ff);},'pVqsT':function(_0x5d0eca,_0xcaabb5){return _0x5d0eca===_0xcaabb5;},'zfLnG':_0x28e5ad(0x113,'ReLL')+'me','akcio':function(_0x526b68,_0x1e16e1){return _0x526b68!==_0x1e16e1;},'pEqjz':_0x28e5ad(0x20c,'08fL')},_0x5e6b6d=_0x48d89d[_0x28e5ad(0x1ac,'^C!F')](String,_0x2d0b28),_0x42aa73=this[_0x28e5ad(0x16f,'w#yd')+_0x28e5ad(0x1cb,'8#6#')][_0x28e5ad(0x19c,'rXmn')](_0x5e6b6d);if(_0x42aa73)return _0x42aa73;const _0x500f5e=this[_0x28e5ad(0x261,'ViE4')+_0x5bb44b(0x194,'w#yd')][_0x5bb44b(0x14b,'z%DR')](_0x28e5ad(0x25d,'8#6#')+_0x5e6b6d);if(_0x500f5e&&this['_picCa'+_0x5bb44b(0x174,'x!9h')][_0x28e5ad(0x150,'Q*Bo')](_0x500f5e))return this[_0x5bb44b(0x209,'0SJh')+'che'][_0x5bb44b(0x108,'ReLL')](_0x500f5e);const _0x490c0b=this[_0x28e5ad(0xf1,'ViE4')+'ndex'][_0x5bb44b(0x128,'hWKA')](_0x5e6b6d[_0x5bb44b(0x1b1,'w#yd')+_0x28e5ad(0x131,'Hp^K')]());if(_0x490c0b){const _0x1080f2=_0x490c0b[_0x28e5ad(0x1ea,'Q*Bo')+_0x28e5ad(0x10e,'MDj)')+'url_hd']||_0x490c0b['profil'+_0x5bb44b(0x1c0,'X8hM')+_0x28e5ad(0xa9,'[6sy')];if(_0x1080f2)return this['_remem'+_0x5bb44b(0x1dd,'^C!F')+'r'](_0x490c0b),_0x1080f2;}try{let _0x3c78b6=null;_0x3c78b6=await this[_0x28e5ad(0x1a1,'X0z^')+_0x28e5ad(0x112,'[qOQ')+_0x28e5ad(0x1d5,'Yguh')](_0x2d0b28,_0x39adcf);if(!_0x3c78b6){if(_0x48d89d[_0x5bb44b(0xd6,'ReLL')](_0x39adcf,_0x48d89d[_0x28e5ad(0x259,'JxwR')]))_0x3c78b6=await this[_0x28e5ad(0x1a6,'IOC!')][_0x28e5ad(0x177,'^C!F')+_0x5bb44b(0xb7,'x!9h')+_0x5bb44b(0x103,'QPc]')+_0x28e5ad(0x1dc,'8#6#')](_0x2d0b28);else _0x3c78b6=await this[_0x28e5ad(0x1e1,'z%DR')][_0x28e5ad(0x155,'IOC!')+_0x28e5ad(0x184,'X8hM')](String(_0x2d0b28));}const _0x41d587=_0x3c78b6?.[_0x28e5ad(0x267,'xCE7')+_0x28e5ad(0x141,'ViE4')+_0x28e5ad(0x1f6,'^C!F')]||_0x3c78b6?.[_0x28e5ad(0x1f3,'rXmn')+_0x28e5ad(0x1c3,'6GBF')+_0x5bb44b(0xfe,'xCE7')]||_0x3c78b6?.[_0x28e5ad(0x1b0,'vl*l')+_0x5bb44b(0x15e,'IOC!')]||null;if(_0x41d587){for(const _0x18b752 of[_0x3c78b6?.['id'],_0x3c78b6?.['pk'],_0x3c78b6?.[_0x5bb44b(0xbb,'^V#y')+_0x28e5ad(0x15a,'PSQq')+_0x5bb44b(0x1de,'Pe*k')+_0x5bb44b(0x81,'[6sy')+_0x5bb44b(0x11c,'ok#&')],_0x2d0b28]){if(_0x48d89d[_0x5bb44b(0x260,'vGV9')](_0x48d89d[_0x28e5ad(0x191,'Hlv3')],_0x48d89d[_0x5bb44b(0x182,'MDj)')])){if(_0x4ebb99)this[_0x28e5ad(0x178,'[6sy')+_0x28e5ad(0x165,'xOUC')][_0x28e5ad(0xcf,'0ims')](_0x48d89d[_0x5bb44b(0x1ba,'Q*Bo')](_0x19c021,_0x1ba41a),_0x53e6b8);}else{if(_0x18b752)this[_0x5bb44b(0x228,'eRq1')+_0x5bb44b(0x194,'w#yd')]['set'](_0x48d89d[_0x5bb44b(0x77,'X0z^')](String,_0x18b752),_0x41d587);}}if(_0x3c78b6?.[_0x28e5ad(0xee,'X8hM')+'me'])this[_0x28e5ad(0xab,'g1um')+_0x28e5ad(0x20d,'08fL')][_0x5bb44b(0x1ec,'U4J2')](_0x3c78b6['userna'+'me'],_0x41d587);}return _0x41d587;}catch(_0x2a3ad1){return null;}}async[_0x4b31db(0x1a4,'08fL')+_0x4b31db(0x12e,'iAI4')+_0x483d7a(0x24e,'I3s@')](_0x52184b,_0x18e21c){const _0x37df8e=_0x483d7a,_0x44e30a=_0x4b31db,_0x3516c={'Ziuaq':function(_0x24f1d5,_0x546aa4){return _0x24f1d5!==_0x546aa4;},'QQuVV':'functi'+'on'},_0x3662fa=this[_0x37df8e(0x1f5,'2Blb')+_0x37df8e(0x221,'IOC!')+_0x37df8e(0x269,'0SJh')](_0x52184b);if(_0x3662fa)return _0x3662fa;if(_0x3516c[_0x37df8e(0xd1,'X0z^')](typeof this[_0x44e30a(0x1cc,'Yguh')][_0x44e30a(0x1c2,'kNm&')+'ox'],_0x3516c[_0x37df8e(0x26c,'xCE7')]))return null;const _0x230c09=await this[_0x37df8e(0x262,'8#6#')][_0x37df8e(0x181,'hWKA')+'ox']()[_0x37df8e(0x14f,'Hlv3')](()=>null);return this[_0x44e30a(0x123,'zYxW')+_0x37df8e(0x212,'[6sy')+'s'](_0x230c09),this[_0x37df8e(0x173,'eRq1')+_0x44e30a(0x188,'xCE7')+_0x37df8e(0x142,'](YC')](_0x52184b)||null;}[_0x4b31db(0x94,'eRq1')+_0x483d7a(0x86,'Hlv3')+'s'](_0x25dc41){const _0x4c7674=_0x483d7a,_0x4b03e4=_0x4b31db,_0x20a40b=_0x25dc41?.[_0x4c7674(0x22a,'IOC!')+'s']||_0x25dc41,_0x503568=Array[_0x4b03e4(0x1f0,'Zd#4')+'y'](_0x20a40b)?_0x20a40b:_0x20a40b?.[_0x4c7674(0x18f,'](YC')]?[_0x20a40b]:[];for(const _0x5e0922 of _0x503568){const _0x22e41d=(_0x5e0922[_0x4c7674(0xd9,'IOC!')]||[])[_0x4b03e4(0x16e,'2Blb')]();if(_0x5e0922['viewer'])_0x22e41d[_0x4b03e4(0xed,'w#yd')+'t'](_0x5e0922[_0x4b03e4(0xd3,'x!9h')]);for(const _0x5b57e9 of _0x22e41d)this[_0x4b03e4(0x14e,'x!9h')+_0x4c7674(0xca,'JxwR')+'r'](_0x5b57e9);}}[_0x483d7a(0x1e0,'ViE4')+_0x4b31db(0xff,'rXmn')+'r'](_0x54f6b7){const _0x24cfb4=_0x483d7a,_0x5c2fc7=_0x4b31db,_0x3d90e3={'ftLjG':_0x24cfb4(0x10c,'U4J2'),'VBklc':function(_0x518cda,_0x312891){return _0x518cda(_0x312891);},'XuBhR':function(_0x1870f1,_0x549b39){return _0x1870f1&&_0x549b39;},'rYrZZ':function(_0x1c3d63,_0x53f13f){return _0x1c3d63&&_0x53f13f;}};if(!_0x54f6b7||typeof _0x54f6b7!==_0x3d90e3[_0x24cfb4(0x143,'w#yd')])return;const _0x17dc5f=_0x54f6b7[_0x24cfb4(0x15b,'JxwR')+_0x5c2fc7(0x13f,'xCE7')+_0x24cfb4(0x224,'izFb')]||_0x54f6b7[_0x5c2fc7(0x1bb,'QPc]')+_0x24cfb4(0x8c,'^C!F')+_0x5c2fc7(0x23a,'xOUC')]||null,_0x13e929=_0x54f6b7['id']||_0x54f6b7['pk']||null,_0x2b0cea=_0x54f6b7[_0x24cfb4(0x1a8,'JxwR')+'me']||null;for(const _0x3ef93c of[_0x13e929,_0x54f6b7['pk'],_0x54f6b7['intero'+_0x5c2fc7(0x13a,'Yguh')+_0x5c2fc7(0x90,'Zd#4')+_0x24cfb4(0xb4,'MDj)')+_0x24cfb4(0x161,'Q*Bo')],_0x2b0cea]){if(_0x3ef93c)this[_0x5c2fc7(0x223,'w#yd')+_0x5c2fc7(0x25f,'U4J2')][_0x5c2fc7(0x11a,'1$Pc')](_0x3d90e3[_0x24cfb4(0x219,'ReLL')](String,_0x3ef93c)[_0x24cfb4(0x145,'^V#y')+_0x24cfb4(0x22d,'Yguh')](),_0x54f6b7);}for(const _0x54f261 of[_0x13e929,_0x54f6b7['pk'],_0x54f6b7[_0x5c2fc7(0xbb,'^V#y')+_0x5c2fc7(0x125,'iAI4')+_0x24cfb4(0x121,'Q*Bo')+'user_f'+_0x24cfb4(0x146,'6GBF')]]){if(_0x3d90e3[_0x24cfb4(0x118,'ok#&')](_0x54f261,_0x2b0cea))this[_0x5c2fc7(0x209,'0SJh')+_0x24cfb4(0x156,'iAI4')]['set'](_0x5c2fc7(0x1f1,'^C!F')+_0x54f261,_0x2b0cea);if(_0x3d90e3[_0x5c2fc7(0x202,'X8hM')](_0x54f261,_0x17dc5f))this['_picCa'+_0x24cfb4(0x247,'kNm&')][_0x5c2fc7(0x203,'!xc6')](_0x3d90e3[_0x24cfb4(0xb6,'Pe*k')](String,_0x54f261),_0x17dc5f);}if(_0x3d90e3[_0x5c2fc7(0x1e8,'z%DR')](_0x2b0cea,_0x17dc5f))this[_0x5c2fc7(0x1e7,'kNm&')+'che']['set'](_0x2b0cea,_0x17dc5f);}['getUse'+_0x483d7a(0x23c,'izFb')+_0x483d7a(0x8b,'Zd#4')](_0x251355){const _0x5ed551=_0x4b31db,_0x1ffd21=_0x483d7a;if(_0x251355==null)return null;return this[_0x5ed551(0x20b,'8#6#')+_0x5ed551(0x89,'!xc6')][_0x1ffd21(0x137,'ViE4')](String(_0x251355)[_0x1ffd21(0x1d1,'^C!F')+'e'](/^@/,'')[_0x1ffd21(0x183,'hWKA')+_0x1ffd21(0x23e,'[qOQ')]())||null;}async[_0x483d7a(0x26f,'MDj)')+_0x483d7a(0x22c,'z%DR')+_0x4b31db(0xad,'Zd#4')+'fline'](_0x437258){const _0x48948c=_0x4b31db,_0x15b1fc=_0x4b31db,_0x103a3b={'BArgZ':function(_0x53fc56,_0x4f6b00){return _0x53fc56(_0x4f6b00);},'BMTCB':function(_0x2e16e6,_0x1329e7){return _0x2e16e6===_0x1329e7;},'rImyU':_0x48948c(0x198,'Q*Bo')+'on','HULcR':_0x48948c(0x127,'JxwR')},_0x3b8ad4={},_0x264525=[...new Set((_0x103a3b[_0x48948c(0x1ca,'Q*Bo')](String,_0x437258)[_0x48948c(0x1a7,'X8hM')](/@([A-Za-z0-9._]{1,30})/g)||[])['map'](_0x58b72e=>_0x58b72e[_0x48948c(0x1ed,'0SJh')](0x1)))];if(!_0x264525[_0x15b1fc(0x93,'[6sy')])return _0x3b8ad4;if(!this[_0x48948c(0x99,'0ims')+_0x48948c(0x185,'rXmn')+'d']&&_0x103a3b[_0x48948c(0x1ce,'6GBF')](typeof this['api'][_0x48948c(0x134,'](YC')+'ox'],_0x103a3b[_0x48948c(0xec,'8#6#')])){this[_0x15b1fc(0x246,'xOUC')+_0x15b1fc(0x98,'U4J2')+'d']=!![];try{if(_0x103a3b[_0x15b1fc(0x248,'kNm&')](_0x103a3b[_0x15b1fc(0x17a,'vl*l')],_0x48948c(0x167,'Zd#4'))){const _0x32f0a9=(_0x32454f[_0x15b1fc(0x11b,'X8hM')]||[])[_0x15b1fc(0x76,'[qOQ')]();if(_0x285fa4[_0x15b1fc(0x253,'0SJh')])_0x32f0a9['unshif'+'t'](_0x3c3ab7['viewer']);for(const _0xedd388 of _0x32f0a9)this[_0x48948c(0x91,'Yguh')+_0x15b1fc(0x74,'Q*Bo')+'r'](_0xedd388);}else this[_0x48948c(0x26e,'ViE4')+_0x48948c(0x158,'QPc]')+'s'](await this['api'][_0x15b1fc(0x1bf,'jF)d')+'ox']());}catch(_0x41fae6){}}for(const _0x207624 of _0x264525){const _0x29305d=this[_0x15b1fc(0x116,'08fL')+_0x15b1fc(0x83,'Hp^K')+_0x15b1fc(0xef,'!xc6')](_0x207624);if(_0x29305d)_0x3b8ad4[_0x103a3b[_0x48948c(0xb8,'%^Lo')](String,_0x29305d['id']||_0x29305d['pk'])]=_0x29305d['userna'+'me']||_0x207624;}return _0x3b8ad4;}['_norma'+_0x4b31db(0x87,'rXmn')+'rm'](_0x19a0e6){const _0x3e0895=_0x483d7a,_0x555b39=_0x483d7a,_0x1a280a={'oZOBU':function(_0x1f71d0,_0x3718b4){return _0x1f71d0===_0x3718b4;},'cJvSs':_0x3e0895(0x14a,'Hp^K'),'kPVgb':_0x555b39(0x1a0,'I3s@'),'StpWL':function(_0x1b4102,_0x162f05){return _0x1b4102(_0x162f05);}};if(_0x1a280a[_0x555b39(0x9e,'0SJh')](typeof _0x19a0e6,_0x1a280a[_0x3e0895(0x26d,'1$Pc')]))return{'body':_0x19a0e6};if(!_0x19a0e6||typeof _0x19a0e6!==_0x1a280a[_0x555b39(0x1ef,'](YC')])return{'body':_0x1a280a[_0x555b39(0x12f,'rXmn')](String,_0x19a0e6)};return{'body':_0x19a0e6[_0x555b39(0x1a9,'MDj)')]||_0x19a0e6['messag'+'e']||'','attachment':_0x19a0e6['attach'+_0x3e0895(0x170,'1$Pc')],'attachments':_0x19a0e6[_0x3e0895(0x229,'^V#y')+_0x3e0895(0x75,'JxwR')],'url':_0x19a0e6[_0x3e0895(0x23a,'xOUC')]};}async[_0x483d7a(0xf2,'PSQq')+_0x4b31db(0x13b,'U4J2')+_0x4b31db(0xd5,'rXmn')+'r'](_0x45eb96){const _0x1c2580=_0x483d7a,_0x4f0dc4=_0x4b31db,_0x4b2963={'QFbPX':'7|11|5'+_0x1c2580(0x1ae,'kNm&')+_0x4f0dc4(0xe4,'Yguh')+_0x4f0dc4(0x196,'g1um')+'4','IbgYH':function(_0x4a4a7b,_0xd003d5){return _0x4a4a7b(_0xd003d5);},'piSTM':function(_0x171d93,_0x48c638){return _0x171d93===_0x48c638;},'UHaTw':_0x1c2580(0x19d,'[qOQ'),'wOEmz':function(_0xb969fc,_0x3922e1){return _0xb969fc!==_0x3922e1;},'xchvG':_0x1c2580(0xe3,'rXmn'),'SIZes':_0x1c2580(0x21e,'Hp^K'),'Qykcy':function(_0x2a5b70,_0x3e8179){return _0x2a5b70===_0x3e8179;},'ImOGB':_0x4f0dc4(0x232,'1r*u'),'morpY':function(_0x180b27,_0x2eec26){return _0x180b27||_0x2eec26;},'bPFFb':_0x1c2580(0x186,'hWKA')+_0x1c2580(0x238,'IOC!'),'aEpLD':_0x1c2580(0xbf,'Q*Bo'),'EBpfP':_0x1c2580(0x7e,'zYxW')+'on','PSqGT':_0x1c2580(0x199,'QPc]')};if(Buffer[_0x1c2580(0x8f,'w#yd')+'er'](_0x45eb96))return{'buffer':_0x45eb96,'filename':_0x4f0dc4(0x200,'0ims')+Date['now']()};if(_0x4b2963[_0x4f0dc4(0x14d,'Q*Bo')](typeof _0x45eb96,_0x4b2963[_0x4f0dc4(0x230,'hWKA')])){if(_0x4b2963[_0x4f0dc4(0x190,'1r*u')](_0x4b2963[_0x1c2580(0xc1,'rXmn')],_0x4b2963[_0x1c2580(0x18e,'MDj)')])){if(/^https?:\/\//i[_0x4f0dc4(0xdd,'Pe*k')](_0x45eb96)){if(_0x4b2963[_0x4f0dc4(0x120,'Zd#4')](_0x4b2963['ImOGB'],_0x4f0dc4(0x197,'1$Pc'))){if(_0x4a99e7)_0x31bf9c(_0x37373d,null);throw _0x1c8355;}else{const _0x797e01=await this[_0x1c2580(0x1f9,'IOC!')+'veIgPi'+_0x1c2580(0xb0,'zYxW')+'rl'](_0x45eb96),_0x2f5a28=_0x4b2963[_0x1c2580(0x9a,'eRq1')](_0x797e01,_0x45eb96),_0x49b718=await axios[_0x1c2580(0x1a2,'](YC')](_0x2f5a28,{'responseType':_0x4f0dc4(0x215,'xOUC')+_0x4f0dc4(0x233,'kNm&'),'timeout':0xea60});if(/graph\.facebook\.com\/.*picture/i[_0x4f0dc4(0x115,'1r*u')](_0x45eb96)){const _0x481ffa=String(_0x49b718[_0x1c2580(0x1c4,'Hlv3')+'s']?.[_0x4b2963[_0x4f0dc4(0x13e,'MDj)')]]||'');if(!_0x481ffa['starts'+'With'](_0x4b2963[_0x4f0dc4(0x254,'vl*l')]))throw new Error(_0x4f0dc4(0xd0,'Pe*k')+_0x1c2580(0xae,'U4J2')+_0x1c2580(0xc9,'xOUC')+_0x4f0dc4(0x7d,'6GBF')+_0x4f0dc4(0xd8,'%^Lo')+_0x4b2963[_0x1c2580(0x11e,'Pe*k')](_0x481ffa,_0x1c2580(0x13c,'](YC')+'n')+')');}return{'buffer':Buffer[_0x4f0dc4(0xb9,'QPc]')](_0x49b718[_0x1c2580(0x104,'iAI4')]),'filename':path[_0x4f0dc4(0x266,'MDj)')+'me'](_0x2f5a28[_0x1c2580(0xf7,'xOUC')]('?')[0x0])||_0x4f0dc4(0xe6,'L4A)')+Date[_0x4f0dc4(0x239,'JxwR')]()+_0x4f0dc4(0x1c1,'x!9h')};}}return{'buffer':fs[_0x4f0dc4(0x15f,'Hp^K')+_0x1c2580(0xa7,'g1um')](_0x45eb96),'filename':path[_0x4f0dc4(0x1e2,'0SJh')+'me'](_0x45eb96)};}else{const _0x1ae53d=_0x4b2963[_0x4f0dc4(0x1cf,'Zd#4')][_0x1c2580(0x241,'PSQq')]('|');let _0x578a1d=0x0;while(!![]){switch(_0x1ae53d[_0x578a1d++]){case'0':_0x4b2963['IbgYH'](_0x4453a5,this);continue;case'1':this[_0x4f0dc4(0x21c,'1r*u')+_0x1c2580(0x126,'kNm&')+_0x4f0dc4(0x231,'w#yd')]();continue;case'2':this[_0x1c2580(0x19e,'z%DR')+'t']=_0x1ff5dd;continue;case'3':this[_0x1c2580(0xa0,'[qOQ')+_0x1c2580(0x24d,'L4A)')]=new _0x42b1b5();continue;case'4':this[_0x1c2580(0x144,'zYxW')+_0x4f0dc4(0xd2,'z%DR')+_0x1c2580(0x1c7,'I3s@')]();continue;case'5':this['userID']=_0xd0d55b[_0x4f0dc4(0x1d9,'iAI4')+_0x4f0dc4(0x110,'Hlv3')+_0x1c2580(0x157,'xOUC')]?_0x296406[_0x4f0dc4(0x20e,'2Blb')+_0x4f0dc4(0x124,'JxwR')+_0x4f0dc4(0x18c,'!xc6')]():null;continue;case'6':this[_0x1c2580(0x218,'zYxW')+_0x1c2580(0x159,'Pe*k')]=new _0x49babb();continue;case'7':this[_0x1c2580(0x1ff,'Pe*k')]=_0xeec831;continue;case'8':this[_0x1c2580(0xf3,'xCE7')+_0x4f0dc4(0x176,'0ims')]=new _0x16f540();continue;case'9':this[_0x4f0dc4(0xdc,'xOUC')+'me']=_0x26fd11[_0x4f0dc4(0xf4,'w#yd')+'me']||null;continue;case'10':this[_0x1c2580(0x101,'0ims')]=_0x14eb31[_0x4f0dc4(0x25c,'1$Pc')];continue;case'11':this[_0x4f0dc4(0xfd,'jF)d')+'s']=_0x3a1c19;continue;}break;}}}if(_0x45eb96&&typeof _0x45eb96[_0x1c2580(0xe2,'6GBF')]===_0x4b2963[_0x4f0dc4(0x23d,'0SJh')]){if(_0x4b2963[_0x4f0dc4(0x105,'[6sy')](_0x4b2963[_0x1c2580(0x138,'Pe*k')],_0x1c2580(0x17c,'xCE7'))){const _0x4faeb8=[];for await(const _0x575e9f of _0x45eb96)_0x4faeb8[_0x4f0dc4(0x14c,'izFb')](_0x575e9f);const _0x5c995d=_0x45eb96[_0x4f0dc4(0x12c,'U4J2')]?path['basena'+'me'](_0x45eb96[_0x1c2580(0xb1,'xOUC')]):_0x1c2580(0x1db,'8#6#')+Date[_0x1c2580(0x23b,'eRq1')]();return{'buffer':Buffer[_0x1c2580(0x7f,'!xc6')](_0x4faeb8),'filename':_0x5c995d};}else return![];}return null;}async[_0x483d7a(0x26b,'ok#&')+_0x4b31db(0x164,'!xc6')+_0x483d7a(0xbd,'8#6#')](_0x550a4f,_0x45b88f,_0x5dfd13){const _0x466281=_0x483d7a,_0x2d67f3=_0x483d7a,_0x4b46e0={'eJyJs':_0x466281(0x92,'^C!F')+_0x2d67f3(0x1af,'U4J2')+_0x466281(0x1b5,'](YC')+_0x466281(0x171,'^C!F'),'vkSse':function(_0x52ce2c,_0x4f88e0){return _0x52ce2c(_0x4f88e0);}},_0x184886=await this['_attac'+_0x466281(0xf6,'PSQq')+'oBuffe'+'r'](_0x45b88f);if(!_0x184886)throw new Error(_0x4b46e0[_0x2d67f3(0x1c8,'8#6#')]);const {buffer:_0x5ded3b,filename:_0x2e1304}=_0x184886,_0x49f36c=_0x4b46e0[_0x2d67f3(0x1eb,'X8hM')](extOf,_0x2e1304),_0x4131b6=_0x5dfd13?{'text':_0x4b46e0[_0x2d67f3(0x1d6,'ReLL')](convert,_0x5dfd13),'filename':_0x2e1304}:{'filename':_0x2e1304};if(AUDIO_EXT[_0x466281(0x109,'xOUC')](_0x49f36c))return this[_0x466281(0x189,'Zd#4')]['sendVo'+_0x466281(0x73,'ok#&')+_0x2d67f3(0x1e4,'L4A)')](_0x550a4f,_0x5ded3b,_0x4131b6);if(VIDEO_EXT[_0x466281(0x1fa,'ViE4')](_0x49f36c))return this['api'][_0x466281(0x249,'L4A)')+_0x2d67f3(0x257,'^C!F')+_0x2d67f3(0x1fb,'8#6#')](_0x550a4f,_0x5ded3b,_0x4131b6);return this[_0x2d67f3(0xbe,'Q*Bo')][_0x466281(0x79,'vGV9')+_0x466281(0x234,'g1um')+_0x466281(0x17e,'08fL')](_0x550a4f,_0x5ded3b,_0x4131b6);}async[_0x483d7a(0xe7,'MDj)')+_0x4b31db(0x1d0,'I3s@')](_0x2aece9,_0x51a0b0,_0x1b8d70,_0x183891){const _0x27f1e0=_0x4b31db,_0x39493e=_0x4b31db,_0x50812c={'bEDuK':function(_0x109ea9,_0x3554c3){return _0x109ea9===_0x3554c3;},'xZdgE':_0x27f1e0(0x172,'X0z^')+'on','IiBXe':function(_0x4de838,_0x2f7159){return _0x4de838(_0x2f7159);},'pdEbk':function(_0x317423,_0x28b8d7,_0x57c006){return _0x317423(_0x28b8d7,_0x57c006);}},_0x51ee06=_0x50812c[_0x27f1e0(0x154,'ViE4')](typeof _0x183891,_0x50812c[_0x39493e(0x1ee,'g1um')])?_0x183891:null;try{const _0xd9cf9=await this[_0x39493e(0x256,'U4J2')+_0x39493e(0x1a5,'[qOQ')+_0x27f1e0(0x17d,'[qOQ')](_0x50812c[_0x27f1e0(0xfa,'QPc]')](String,_0x2aece9),_0x51a0b0,_0x1b8d70&&(_0x1b8d70[_0x39493e(0x175,'z%DR')]||_0x1b8d70[_0x39493e(0x18a,'0SJh')+'n']));if(_0xd9cf9&&_0xd9cf9[_0x27f1e0(0x139,'1$Pc')+'eID'])this[_0x39493e(0x258,'Pe*k')+_0x39493e(0xb5,'%^Lo')][_0x27f1e0(0x22e,'g1um')](_0xd9cf9[_0x27f1e0(0x162,'0SJh')+'eID'],_0x50812c[_0x27f1e0(0x204,'iAI4')](String,_0x2aece9));const _0xef2272={'messageID':_0xd9cf9&&_0xd9cf9['messag'+_0x27f1e0(0x129,'zYxW')],'threadID':_0x50812c[_0x27f1e0(0xe9,'^C!F')](String,_0x2aece9),'timestamp':Date['now']()};if(_0x51ee06)_0x51ee06(null,_0xef2272);return _0xef2272;}catch(_0x20b8d7){if(_0x51ee06)_0x50812c[_0x27f1e0(0x226,'Q*Bo')](_0x51ee06,_0x20b8d7,null);throw _0x20b8d7;}}[_0x483d7a(0x85,'hWKA')+_0x483d7a(0x25b,'](YC')](_0x344b99,_0x19b72c,_0x14ced7,_0x230ba6){const _0x408e8e=_0x4b31db,_0x387951=_0x4b31db,_0x1a418c={'dBuhH':function(_0x2bb046,_0x28e079){return _0x2bb046===_0x28e079;}};return _0x1a418c[_0x408e8e(0x168,'0ims')](typeof _0x14ced7,_0x387951(0x1c6,'ReLL')+'on')&&(_0x230ba6=_0x14ced7,_0x14ced7={}),this[_0x387951(0xc2,'izFb')+_0x387951(0x20a,'X8hM')](_0x344b99,_0x19b72c,_0x14ced7,_0x230ba6);}[_0x4b31db(0x263,'eRq1')+_0x483d7a(0xc6,'L4A)')+_0x4b31db(0x1bd,'1r*u')](_0x473c6f,_0x45ec5f,_0x36d29a,_0xb21dee){const _0x307818=_0x4b31db,_0x10e8d1=_0x4b31db,_0x8613d={'EoQGd':function(_0x558bd9,_0x308253){return _0x558bd9===_0x308253;},'AQSfn':_0x307818(0xf9,'hWKA')+'on'};return _0x8613d[_0x307818(0xe1,'Hp^K')](typeof _0x36d29a,_0x8613d[_0x10e8d1(0xeb,'0SJh')])&&(_0xb21dee=_0x36d29a,_0x36d29a={}),this[_0x307818(0x148,'IOC!')+_0x307818(0x179,'](YC')](_0x473c6f,_0x45ec5f,_0x36d29a,_0xb21dee);}[_0x4b31db(0x1b9,'!xc6')+_0x4b31db(0xda,'%^Lo')+_0x483d7a(0x220,'eRq1')](_0x2575a7,_0x2e29f0,_0xdabffd,_0x28b403){const _0x4a7327=_0x4b31db,_0x19db32=_0x4b31db,_0x179a49={'dDloB':function(_0x5c4914,_0x1ab6b7){return _0x5c4914===_0x1ab6b7;}};return _0x179a49['dDloB'](typeof _0xdabffd,_0x4a7327(0x82,'QPc]')+'on')&&(_0x28b403=_0xdabffd,_0xdabffd={}),this[_0x4a7327(0x1da,'X8hM')+_0x4a7327(0x95,'08fL')](_0x2575a7,_0x2e29f0,_0xdabffd,_0x28b403);}[_0x4b31db(0x1aa,'IOC!')+_0x4b31db(0x8d,'X0z^')+_0x483d7a(0x132,'Yguh')](_0x47d4e3,_0x2d2789,_0x3aefd5,_0x45b5ee){const _0x4ddbc6=_0x483d7a,_0x5506df=_0x483d7a,_0x4cf273={'rbFgT':function(_0x569761,_0xb6cd05){return _0x569761===_0xb6cd05;},'SBYDm':_0x4ddbc6(0x208,'!xc6')+'on'};return _0x4cf273[_0x5506df(0xe0,'2Blb')](typeof _0x3aefd5,_0x4cf273[_0x4ddbc6(0x206,'g1um')])&&(_0x45b5ee=_0x3aefd5,_0x3aefd5={}),this[_0x4ddbc6(0x7a,'rXmn')+_0x4ddbc6(0xaa,'0SJh')](_0x47d4e3,_0x2d2789,_0x3aefd5,_0x45b5ee);}async['getPro'+_0x4b31db(0x180,'Yguh')+_0x4b31db(0xaf,'08fL')+'rl'](_0x35bbaa){const _0x2bb6a9=_0x4b31db,_0x52e218=_0x4b31db,_0x4f0499={'foCMF':function(_0x369ff4,_0x3876a1){return _0x369ff4(_0x3876a1);},'KhpJY':'userna'+'me'},_0x1dd82a=_0x4f0499['foCMF'](String,_0x35bbaa);return this[_0x2bb6a9(0xb3,'g1um')+_0x52e218(0x96,'vGV9')+_0x2bb6a9(0xd7,'iAI4')](_0x1dd82a,/^\d+$/[_0x52e218(0x1b7,'08fL')](_0x1dd82a)?'id':_0x4f0499[_0x2bb6a9(0xa3,'vGV9')]);}[_0x483d7a(0x211,'Pe*k')+_0x483d7a(0x24f,'Hlv3')+'l'](_0x5330f2){const _0x8a2c44=_0x4b31db,_0x26d78b=_0x483d7a;return this['getPro'+_0x8a2c44(0x1e6,'!xc6')+_0x26d78b(0x10b,'1$Pc')+'rl'](_0x5330f2);}[_0x4b31db(0x24a,'!xc6')+_0x483d7a(0xa5,'PSQq')+'ad'](_0x5677d8,_0x43975d){const _0x3e6322=_0x483d7a,_0x1e12b2=_0x483d7a,_0x1823fd={'EPHZA':function(_0x5cfd0d,_0x57b813){return _0x5cfd0d&&_0x57b813;},'GCWQk':function(_0x44fd91,_0x5bcc70){return _0x44fd91(_0x5bcc70);}};if(_0x1823fd[_0x3e6322(0x7c,'Hlv3')](_0x5677d8,_0x43975d))this[_0x3e6322(0x1c5,'eRq1')+_0x3e6322(0xa1,'ok#&')][_0x3e6322(0x250,'^V#y')](_0x1823fd[_0x1e12b2(0x100,'X0z^')](String,_0x5677d8),String(_0x43975d));}[_0x483d7a(0xbc,'Hlv3')+_0x4b31db(0x1fe,'[qOQ')+'ad'](_0x51bc57,_0x44eac9){const _0x320e38=_0x4b31db,_0x41dda7=_0x483d7a,_0x541395={'frPfV':function(_0xa011d,_0x2158ab){return _0xa011d===_0x2158ab;},'giEbq':_0x320e38(0x17b,'kNm&'),'utLJq':function(_0x1e4082,_0x13103){return _0x1e4082===_0x13103;},'JdJBV':_0x41dda7(0x152,'!xc6'),'XItPF':function(_0x1cdb48,_0x36b50f){return _0x1cdb48(_0x36b50f);},'VGJVv':_0x320e38(0xd4,'X8hM')+_0x320e38(0x16c,'2Blb')+_0x320e38(0xea,'](YC')+_0x320e38(0x19a,'U4J2')+_0x41dda7(0x16b,'L4A)')},_0x38f19d=_0x541395[_0x41dda7(0x1b2,'[qOQ')](typeof _0x44eac9,_0x541395[_0x41dda7(0x7b,'g1um')])||_0x541395[_0x41dda7(0xf8,'hWKA')](typeof _0x44eac9,_0x541395[_0x41dda7(0xa4,'Zd#4')])?_0x44eac9:null,_0x570a07=_0x38f19d||this[_0x320e38(0x166,'w#yd')+_0x320e38(0x71,'8#6#')][_0x320e38(0x108,'ReLL')](_0x541395[_0x41dda7(0x135,'2Blb')](String,_0x51bc57));if(!_0x570a07)throw new Error(_0x541395[_0x41dda7(0x252,'6GBF')]+_0x51bc57);return _0x570a07;}async[_0x483d7a(0x1df,'Yguh')+'st'](_0x4637fd,_0x1bf2ca){const _0x1d3054=_0x483d7a,_0x348a27=_0x483d7a,_0x3cc866=await axios[_0x1d3054(0x151,'ok#&')](_0x4637fd,_0x1bf2ca?.[_0x1d3054(0x1f4,'izFb')]||_0x1bf2ca?.[_0x348a27(0x23f,'iAI4')],_0x1bf2ca);return _0x3cc866[_0x1d3054(0x153,'[qOQ')];}async[_0x4b31db(0xce,'ok#&')+'t'](_0x51a2ab,_0x3e1c32){const _0xc6b156=_0x4b31db,_0x4c41d1=_0x4b31db,_0x880bc=await axios[_0xc6b156(0x20f,'zYxW')](_0x51a2ab,_0x3e1c32);return _0x880bc[_0xc6b156(0x192,'Pe*k')];}async[_0x4b31db(0x245,'2Blb')+_0x483d7a(0xc8,'!xc6')+'me'](){return![];}async[_0x4b31db(0x13d,'jF)d')+'le'](){return![];}async[_0x483d7a(0xfc,'xOUC')+_0x483d7a(0x21a,'JxwR')+_0x483d7a(0xf5,'IOC!')](){return![];}async[_0x483d7a(0xba,'0ims')+_0x4b31db(0x240,'2Blb')+_0x483d7a(0x80,'vl*l')](){return![];}async[_0x483d7a(0x1f7,'[qOQ')+_0x4b31db(0x213,'Zd#4')+'mage'](){return![];}async[_0x483d7a(0x1b3,'JxwR')+_0x4b31db(0x72,'z%DR')](){return![];}async[_0x483d7a(0x24c,'L4A)')+_0x4b31db(0x140,'Hp^K')+'up'](_0x4f6671,_0x78ce69){const _0x1b0788=_0x4b31db,_0x211a53=_0x483d7a;return this['api'][_0x1b0788(0x22f,'jF)d')+_0x1b0788(0xcc,'X8hM')+'up'](_0x78ce69,_0x4f6671);}async[_0x483d7a(0x16d,'Hlv3')+_0x483d7a(0x268,'Hlv3')+_0x4b31db(0x201,'^C!F')+'p'](_0x3702fd,_0x4cd852){const _0x439f4e=_0x4b31db,_0x14ca4a=_0x483d7a;return this[_0x439f4e(0xf0,'MDj)')][_0x14ca4a(0x251,'iAI4')+_0x439f4e(0xde,'ReLL')+_0x439f4e(0x217,'!xc6')+'p'](_0x4cd852,_0x3702fd);}}module[_0x483d7a(0x160,'ReLL')+'s']=InstaClient;
7
+
8
+ // The FCA-shaped client. It wraps the native InstaAPI (src/api.js) and exposes
9
+ // the Facebook Chat API surface (sendMessage, setMessageReaction, getThreadInfo,
10
+ // ...) so GoatBot-Pro / FCA commands run unchanged. The individual methods live
11
+ // as one file each under src/api/<group>/<method>.js and are attached by
12
+ // loadApiMethods(); this class holds the shared plumbing they build on.
13
+
14
+ const fs = require("fs");
15
+ const path = require("path");
16
+ const axios = require("axios");
17
+
18
+ const { AUDIO_EXT, VIDEO_EXT, extOf } = require("../utils/format");
19
+ const { convert } = require("../utils/messageStyle");
20
+ const loadApiMethods = require("./loadApiMethods");
21
+
22
+ class InstaClient {
23
+ constructor(instaApi, options = {}) {
24
+ // The native client is kept as `api`, exactly like FCA keeps `ctx` separate
25
+ // from the public surface.
26
+ this.api = instaApi;
27
+ this.options = options;
28
+ this.userID = instaApi.getCurrentUserID ? instaApi.getCurrentUserID() : null;
29
+ this.username = instaApi.username || null;
30
+ this.http = instaApi.http;
31
+ this.convert = convert;
32
+
33
+ // messageID -> threadID, so unsendMessage(messageID) can find its thread.
34
+ this._msgThread = new Map();
35
+ // pk / username -> avatar CDN URL, learned from thread introspection.
36
+ this._picCache = new Map();
37
+ // any id / interop fbid / lowercase username -> full user record, learned
38
+ // from inbox and thread introspection. Instagram rate-limits username
39
+ // lookups (usernameinfo / web_profile_info) for web sessions, so resolving a
40
+ // mentioned @handle must come from data the session already has.
41
+ this._userIndex = new Map();
42
+
43
+ this._learnFromInbox();
44
+ loadApiMethods(this);
45
+ this._bindNativeMethods();
46
+
47
+ // Snapshot the session guard onto the client unless explicitly disabled.
48
+ if (!options || options.sessionGuard !== false) {
49
+ require("../utils/sessionGuard").install(this, options && options.sessionGuardFile);
50
+ }
51
+ }
52
+
53
+ // Expose the native client's own methods (sendPhotoBuffer, sendVoiceBuffer,
54
+ // markThreadSeen, getUserInfoByUsername, ...) on the FCA surface too, so a
55
+ // command may use either the fca-style or the native call. FCA-shaped methods
56
+ // defined on this class (or attached by loadApiMethods) win.
57
+ _bindNativeMethods() {
58
+ const proto = Object.getPrototypeOf(this.api) || {};
59
+ for (const key of Object.getOwnPropertyNames(proto)) {
60
+ if (key === "constructor" || key in this) continue;
61
+ const fn = this.api[key];
62
+ if (typeof fn === "function") this[key] = fn.bind(this.api);
63
+ }
64
+ }
65
+
66
+ // Every thread-introspection payload (inbox, thread info) discovered during
67
+ // normal operation carries each participant's profile_pic_url. Learn the
68
+ // pk/fbid/username -> URL mapping up front, so the graph bridge and
69
+ // getUserInfo can answer without a rate-limited REST call.
70
+ _learnFromInbox() {
71
+ if (typeof this.api.getInbox !== "function") return;
72
+ const originalInbox = this.api.getInbox.bind(this.api);
73
+ this.api.getInbox = async (...args) => {
74
+ const result = await originalInbox(...args);
75
+ this._learnThreads(result);
76
+ return result;
77
+ };
78
+ }
79
+
80
+ // Rewrites Facebook Graph picture URLs to the real Instagram CDN avatar.
81
+ async _resolveIgPictureUrl(src) {
82
+ const m = String(src).match(/graph\.facebook\.com\/(\d+)\/picture/i) ||
83
+ String(src).match(/graph\.facebook\.com\/(\d+)/i);
84
+ if (!m) return null;
85
+ const id = m[1];
86
+ const igHost = /instagram\.com/i.test(String(src));
87
+ return this._igPictureForUser(id, igHost ? "username" : "id");
88
+ }
89
+
90
+ async _igPictureForUser(key, kind = "id") {
91
+ const k = String(key);
92
+ const cached = this._picCache.get(k);
93
+ if (cached) return cached;
94
+ const named = this._picCache.get(`name:${k}`);
95
+ if (named && this._picCache.get(named)) return this._picCache.get(named);
96
+ // Learned from inbox/thread introspection: answers an @handle without a
97
+ // rate-limited REST call.
98
+ const known = this._userIndex.get(k.toLowerCase());
99
+ if (known) {
100
+ const url = known.profile_pic_url_hd || known.profile_pic_url;
101
+ if (url) {
102
+ this._rememberUser(known);
103
+ return url;
104
+ }
105
+ }
106
+ try {
107
+ let u = null;
108
+ // Prefer the inbox introspection path (users[].profile_pic_url): it stays
109
+ // inside the DM GraphQL surface and returns real avatars, whereas
110
+ // /api/v1/users/<id>/info/ rate-limits (429) for this session.
111
+ u = await this._igUserFromInbox(key, kind);
112
+ if (!u) {
113
+ if (kind === "username") u = await this.api.getUserInfoByUsername(key);
114
+ else u = await this.api.getUserInfo(String(key));
115
+ }
116
+ const url = u?.profile_pic_url_hd || u?.profile_pic_url || u?.profileUrl || null;
117
+ if (url) {
118
+ for (const id of [u?.id, u?.pk, u?.interop_messaging_user_fbid, key]) {
119
+ if (id) this._picCache.set(String(id), url);
120
+ }
121
+ if (u?.username) this._picCache.set(u.username, url);
122
+ }
123
+ return url;
124
+ } catch (_) {
125
+ return null;
126
+ }
127
+ }
128
+
129
+ async _igUserFromInbox(key, kind) {
130
+ const known = this.getUserByUsername(key);
131
+ if (known) return known;
132
+ if (typeof this.api.getInbox !== "function") return null;
133
+ const inbox = await this.api.getInbox().catch(() => null);
134
+ this._learnThreads(inbox);
135
+ return this.getUserByUsername(key) || null;
136
+ }
137
+
138
+ // Records avatars for every participant seen in an inbox / thread payload, keyed
139
+ // by pk, fbid and username, so later getUserInfo / graph-bridge lookups are a
140
+ // cache hit instead of a REST call Instagram rate-limits (429). Also fills the
141
+ // user index used to resolve @mentions to a pk offline.
142
+ _learnThreads(payload) {
143
+ const raw = payload?.threads || payload;
144
+ const threads = Array.isArray(raw) ? raw : raw?.users ? [raw] : [];
145
+ for (const t of threads) {
146
+ const users = (t.users || []).slice();
147
+ if (t.viewer) users.unshift(t.viewer);
148
+ for (const u of users) this._rememberUser(u);
149
+ }
150
+ }
151
+
152
+ // Indexes one Instagram user record (inbox/thread shape: id, username,
153
+ // full_name, interop_messaging_user_fbid, profile_pic_url) under every key a
154
+ // command may look it up by.
155
+ _rememberUser(u) {
156
+ if (!u || typeof u !== "object") return;
157
+ const url = u.profile_pic_url_hd || u.profile_pic_url || null;
158
+ const id = u.id || u.pk || null;
159
+ const username = u.username || null;
160
+ for (const key of [id, u.pk, u.interop_messaging_user_fbid, username]) {
161
+ if (key) this._userIndex.set(String(key).toLowerCase(), u);
162
+ }
163
+ for (const k of [id, u.pk, u.interop_messaging_user_fbid]) {
164
+ if (k && username) this._picCache.set(`name:${k}`, username);
165
+ if (k && url) this._picCache.set(String(k), url);
166
+ }
167
+ if (username && url) this._picCache.set(username, url);
168
+ }
169
+
170
+ // Returns the user record for an @handle (or numeric id / interop fbid) from
171
+ // data already learned from the inbox and thread views. This is deliberately
172
+ // offline: usernameinfo and web_profile_info both rate-limit a web session.
173
+ getUserByUsername(username) {
174
+ if (username == null) return null;
175
+ return this._userIndex.get(String(username).replace(/^@/, "").toLowerCase()) || null;
176
+ }
177
+
178
+ async _resolveMentionsOffline(body) {
179
+ const mentions = {};
180
+ const names = [...new Set((String(body).match(/@([A-Za-z0-9._]{1,30})/g) || []).map((m) => m.slice(1)))];
181
+ if (!names.length) return mentions;
182
+ // The inbox is the richest source; learn it once, then answer from the index.
183
+ if (!this._inboxLearned && typeof this.api.getInbox === "function") {
184
+ this._inboxLearned = true;
185
+ try { this._learnThreads(await this.api.getInbox()); } catch (_) {}
186
+ }
187
+ for (const username of names) {
188
+ let u = this.getUserByUsername(username);
189
+ // Index miss (e.g. a handle never seen in the inbox): fall back to a live
190
+ // lookup and remember it, so the next mention resolves offline.
191
+ if (!u && typeof this.api.getUserInfoByUsername === "function") {
192
+ try {
193
+ u = await this.api.getUserInfoByUsername(username);
194
+ if (u) this._rememberUser(u);
195
+ } catch (_) {}
196
+ }
197
+ if (u) mentions[String(u.id || u.pk)] = u.username || username;
198
+ }
199
+ return mentions;
200
+ }
201
+
202
+
203
+ // ---------------------------------------------------------------- sending
204
+ _normalizeForm(form) {
205
+ if (typeof form === "string") return { body: form };
206
+ if (!form || typeof form !== "object") return { body: String(form) };
207
+ return {
208
+ body: form.body || form.message || "",
209
+ attachment: form.attachment,
210
+ attachments: form.attachments,
211
+ url: form.url
212
+ };
213
+ }
214
+
215
+ async _attachmentToBuffer(src) {
216
+ if (Buffer.isBuffer(src)) return { buffer: src, filename: `file_${Date.now()}` };
217
+ if (typeof src === "string") {
218
+ if (/^https?:\/\//i.test(src)) {
219
+ // Frozen Facebook commands fetch avatars straight from the Graph API
220
+ // (e.g. pp.js's graph.facebook.com/<uid>/picture). On Instagram that
221
+ // endpoint is meaningless, so rewrite such URLs to the user's real
222
+ // Instagram CDN picture before downloading — commands stay untouched.
223
+ const bridge = await this._resolveIgPictureUrl(src);
224
+ const url = bridge || src;
225
+ const res = await axios.get(url, { responseType: "arraybuffer", timeout: 60000 });
226
+ // A graph .../picture URL that failed to bridge returns JSON, not an
227
+ // image; fail loudly there. Other media URLs keep the lenient path.
228
+ if (/graph\.facebook\.com\/.*picture/i.test(src)) {
229
+ const ct = String(res.headers?.["content-type"] || "");
230
+ if (!ct.startsWith("image/")) throw new Error(`Attachment is not an image (${ct || "unknown"})`);
231
+ }
232
+ return { buffer: Buffer.from(res.data), filename: path.basename(url.split("?")[0]) || `file_${Date.now()}.jpg` };
233
+ }
234
+ return { buffer: fs.readFileSync(src), filename: path.basename(src) };
235
+ }
236
+ if (src && typeof src.pipe === "function") {
237
+ // a readable stream (fs.createReadStream) — drain it
238
+ const chunks = [];
239
+ for await (const chunk of src) chunks.push(chunk);
240
+ const filename = src.path ? path.basename(src.path) : `file_${Date.now()}`;
241
+ return { buffer: Buffer.concat(chunks), filename };
242
+ }
243
+ return null;
244
+ }
245
+
246
+ async _sendAttachment(threadID, src, caption) {
247
+ const resolved = await this._attachmentToBuffer(src);
248
+ if (!resolved) throw new Error("Unsupported attachment");
249
+ const { buffer, filename } = resolved;
250
+ const ext = extOf(filename);
251
+ const opts = caption ? { text: convert(caption), filename } : { filename };
252
+
253
+ if (AUDIO_EXT.has(ext)) return this.api.sendVoiceBuffer(threadID, buffer, opts);
254
+ if (VIDEO_EXT.has(ext)) return this.api.sendVideoBuffer(threadID, buffer, opts);
255
+ return this.api.sendPhotoBuffer(threadID, buffer, opts);
256
+ }
257
+
258
+ // Media helpers the ported commands call directly. All resolve the source
259
+ // (URL / path / buffer / stream) and route to the matching IG send.
260
+ async _mediaSend(threadID, src, opts, callback) {
261
+ const cb = typeof callback === "function" ? callback : null;
262
+ try {
263
+ const info = await this._sendAttachment(String(threadID), src, opts && (opts.text || opts.caption));
264
+ if (info && info.messageID) this._msgThread.set(info.messageID, String(threadID));
265
+ const out = { messageID: info && info.messageID, threadID: String(threadID), timestamp: Date.now() };
266
+ if (cb) cb(null, out);
267
+ return out;
268
+ } catch (error) {
269
+ if (cb) cb(error, null);
270
+ throw error;
271
+ }
272
+ }
273
+
274
+ sendPhoto(threadID, src, opts, callback) {
275
+ if (typeof opts === "function") { callback = opts; opts = {}; }
276
+ return this._mediaSend(threadID, src, opts, callback);
277
+ }
278
+
279
+ sendPhotoFromUrl(threadID, url, opts, callback) {
280
+ if (typeof opts === "function") { callback = opts; opts = {}; }
281
+ return this._mediaSend(threadID, url, opts, callback);
282
+ }
283
+
284
+ sendVideoFromUrl(threadID, url, opts, callback) {
285
+ if (typeof opts === "function") { callback = opts; opts = {}; }
286
+ return this._mediaSend(threadID, url, opts, callback);
287
+ }
288
+
289
+ sendVoiceFromUrl(threadID, url, opts, callback) {
290
+ if (typeof opts === "function") { callback = opts; opts = {}; }
291
+ return this._mediaSend(threadID, url, opts, callback);
292
+ }
293
+
294
+ // Resolves an Instagram profile-picture CDN URL for the graph bridge that
295
+ // keeps frozen Facebook commands (pp.js) working. Accepts a numeric pk or a
296
+ // username.
297
+ async getProfilePictureUrl(idOrUsername) {
298
+ const key = String(idOrUsername);
299
+ return this._igPictureForUser(key, /^\d+$/.test(key) ? "id" : "username");
300
+ }
301
+
302
+ // Frozen commands (pp.js) call the fca name `getPictureUrl(id, type)` and
303
+ // guard with `typeof api.getPictureUrl === "function"`; without it the call
304
+ // is skipped and the avatar is blank. `type` mirrors fca's optional
305
+ // "normal"/"large" hint and is ignored — Instagram serves one CDN URL.
306
+ getPictureUrl(idOrUsername) {
307
+ return this.getProfilePictureUrl(idOrUsername);
308
+ }
309
+
310
+ // ------------------------------------------------------------- reactions
311
+ rememberThread(messageID, threadID) {
312
+ if (messageID && threadID) this._msgThread.set(String(messageID), String(threadID));
313
+ }
314
+
315
+ _resolveThread(messageID, threadID) {
316
+ // fca's signature is setMessageReaction(emoji, messageID, callback, force);
317
+ // commands pass `true` there, so anything that is not a real id is ignored
318
+ // and we fall back to the thread the message was seen in.
319
+ const explicit = typeof threadID === "string" || typeof threadID === "number" ? threadID : null;
320
+ const tid = explicit || this._msgThread.get(String(messageID));
321
+ if (!tid) throw new Error("Unknown thread for message " + messageID);
322
+ return tid;
323
+ }
324
+
325
+ // -------------------------------------------------------------- low level
326
+ async httpPost(url, options) {
327
+ const res = await axios.post(url, options?.form || options?.body, options);
328
+ return res.data;
329
+ }
330
+
331
+ async httpGet(url, options) {
332
+ const res = await axios.get(url, options);
333
+ return res.data;
334
+ }
335
+
336
+ // Group-management features do not exist for Instagram personal DMs.
337
+ async changeNickname() { return false; }
338
+ async setTitle() { return false; }
339
+ async changeThreadColor() { return false; }
340
+ async changeThreadEmoji() { return false; }
341
+ async changeGroupImage() { return false; }
342
+ async changeAvatar() { return false; }
343
+
344
+ // Instagram group DMs support adding/removing participants. FCA passes
345
+ // (userID, threadID); the API takes the reverse. Older native clients may not
346
+ // expose the pair, so degrade to a stub instead of throwing.
347
+ async addUserToGroup(userID, threadID) {
348
+ if (typeof this.api.addUserToGroup !== "function") return false;
349
+ return this.api.addUserToGroup(threadID, userID);
350
+ }
351
+
352
+ async removeUserFromGroup(userID, threadID) {
353
+ if (typeof this.api.removeUserFromGroup !== "function") return false;
354
+ return this.api.removeUserFromGroup(threadID, userID);
355
+ }
356
+ }
357
+
358
+ module.exports = InstaClient;
@@ -4,4 +4,49 @@
4
4
  * Licensed under the Apache License, Version 2.0. See LICENSE and NOTICE.
5
5
  * Original author credit must be retained in all copies and derivatives.
6
6
  */
7
- var _0x16d499=_0xeda1,_0x19a240=_0xeda1;function _0xeda1(_0x371546,_0x294e18){_0x371546=_0x371546-0x1a9;var _0x57a9a3=_0x57a9();var _0xeda1de=_0x57a9a3[_0x371546];if(_0xeda1['tVYcWp']===undefined){var _0x38f097=function(_0x48ce1b){var _0x3c9bdc='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x25c57e='',_0x354d8e='';for(var _0x218746=0x0,_0x4ee7b8,_0x13ec62,_0x3c0456=0x0;_0x13ec62=_0x48ce1b['charAt'](_0x3c0456++);~_0x13ec62&&(_0x4ee7b8=_0x218746%0x4?_0x4ee7b8*0x40+_0x13ec62:_0x13ec62,_0x218746++%0x4)?_0x25c57e+=String['fromCharCode'](0xff&_0x4ee7b8>>(-0x2*_0x218746&0x6)):0x0){_0x13ec62=_0x3c9bdc['indexOf'](_0x13ec62);}for(var _0x116a67=0x0,_0x1be15c=_0x25c57e['length'];_0x116a67<_0x1be15c;_0x116a67++){_0x354d8e+='%'+('00'+_0x25c57e['charCodeAt'](_0x116a67)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x354d8e);};var _0x3f4465=function(_0x15f52c,_0x1ad3e3){var _0x3b7470=[],_0x186d86=0x0,_0xeebe7e,_0x562ea7='';_0x15f52c=_0x38f097(_0x15f52c);var _0x26c2f1;for(_0x26c2f1=0x0;_0x26c2f1<0x100;_0x26c2f1++){_0x3b7470[_0x26c2f1]=_0x26c2f1;}for(_0x26c2f1=0x0;_0x26c2f1<0x100;_0x26c2f1++){_0x186d86=(_0x186d86+_0x3b7470[_0x26c2f1]+_0x1ad3e3['charCodeAt'](_0x26c2f1%_0x1ad3e3['length']))%0x100,_0xeebe7e=_0x3b7470[_0x26c2f1],_0x3b7470[_0x26c2f1]=_0x3b7470[_0x186d86],_0x3b7470[_0x186d86]=_0xeebe7e;}_0x26c2f1=0x0,_0x186d86=0x0;for(var _0x2b17c3=0x0;_0x2b17c3<_0x15f52c['length'];_0x2b17c3++){_0x26c2f1=(_0x26c2f1+0x1)%0x100,_0x186d86=(_0x186d86+_0x3b7470[_0x26c2f1])%0x100,_0xeebe7e=_0x3b7470[_0x26c2f1],_0x3b7470[_0x26c2f1]=_0x3b7470[_0x186d86],_0x3b7470[_0x186d86]=_0xeebe7e,_0x562ea7+=String['fromCharCode'](_0x15f52c['charCodeAt'](_0x2b17c3)^_0x3b7470[(_0x3b7470[_0x26c2f1]+_0x3b7470[_0x186d86])%0x100]);}return _0x562ea7;};_0xeda1['CWwnrJ']=_0x3f4465,_0xeda1['xilodC']={},_0xeda1['tVYcWp']=!![];}var _0x3b4e2a=_0x57a9a3[0x0],_0x35b57f=_0x371546+_0x3b4e2a,_0x4f12e6=_0xeda1['xilodC'][_0x35b57f];return!_0x4f12e6?(_0xeda1['QNrIkh']===undefined&&(_0xeda1['QNrIkh']=!![]),_0xeda1de=_0xeda1['CWwnrJ'](_0xeda1de,_0x294e18),_0xeda1['xilodC'][_0x35b57f]=_0xeda1de):_0xeda1de=_0x4f12e6,_0xeda1de;}(function(_0x140ccb,_0x1b79c9){var _0x51b48b=_0xeda1,_0x52e412=_0xeda1,_0x20fc86=_0x140ccb();while(!![]){try{var _0x2782c7=parseInt(_0x51b48b(0x1bf,'t*S$'))/0x1*(parseInt(_0x52e412(0x1e0,'rXMx'))/0x2)+parseInt(_0x51b48b(0x1d7,'nMNi'))/0x3*(-parseInt(_0x52e412(0x1c1,'mmZ1'))/0x4)+-parseInt(_0x52e412(0x1b8,'y]2k'))/0x5+parseInt(_0x51b48b(0x1c4,'JdG1'))/0x6+parseInt(_0x52e412(0x1d2,'D%g4'))/0x7*(parseInt(_0x51b48b(0x1d9,'k%xy'))/0x8)+-parseInt(_0x51b48b(0x1c0,'0MRQ'))/0x9*(parseInt(_0x52e412(0x1d0,'$qmF'))/0xa)+-parseInt(_0x51b48b(0x1b9,'9X]2'))/0xb;if(_0x2782c7===_0x1b79c9)break;else _0x20fc86['push'](_0x20fc86['shift']());}catch(_0x821f5d){_0x20fc86['push'](_0x20fc86['shift']());}}}(_0x57a9,0xee913));class InstaContext{constructor(_0x303121,_0x57dbd0){var _0x394755=_0xeda1,_0xef8343=_0xeda1,_0x5a9f32={'msbjv':function(_0x47e25b,_0x50b35d){return _0x47e25b(_0x50b35d);}};this[_0x394755(0x1da,'hC4O')]=_0x303121,this[_0xef8343(0x1ae,'aDiX')]=_0x303121['api'],this[_0xef8343(0x1c5,'s^L8')+'ID']=_0x57dbd0!=null?_0x5a9f32['msbjv'](String,_0x57dbd0):null,this[_0x394755(0x1de,'5#&H')]=_0x303121[_0x394755(0x1a9,'lFiU')];}[_0x16d499(0x1e3,'Fe&E')](_0x266a2b,_0x46b74e,_0x1051ca){var _0x22312e=_0x16d499,_0x3688ab=_0x16d499;return this[_0x22312e(0x1e7,'zZKe')]['sendMe'+_0x3688ab(0x1bc,'XbbE')](_0x266a2b,this[_0x22312e(0x1d1,'@CcM')+'ID'],_0x46b74e,_0x1051ca);}[_0x16d499(0x1e2,'k%xy')](_0x14d6bf,_0x4b32dd,_0x29fe41){var _0x178034=_0x16d499,_0x5a36b6=_0x19a240;return this['client'][_0x178034(0x1e6,'RlDt')+_0x5a36b6(0x1dd,'y]2k')](_0x14d6bf,this[_0x5a36b6(0x1ba,'0MRQ')+'ID'],_0x4b32dd,_0x29fe41);}['react'](_0x4e794f,_0x2768fd,_0x4ac49d){var _0x31f70a=_0x19a240,_0x3973f6=_0x16d499;return this[_0x31f70a(0x1b1,'RlDt')][_0x31f70a(0x1b3,'zOLR')+_0x3973f6(0x1d6,'PHz)')+_0x31f70a(0x1dc,'7Cq2')](_0x4e794f,_0x2768fd,_0x4ac49d,this[_0x3973f6(0x1d5,'93^4')+'ID']);}[_0x16d499(0x1ac,']Hhl')](_0x16aa77,_0x5b501d){var _0x11d5e0=_0x16d499,_0x482651=_0x19a240;return this[_0x11d5e0(0x1c2,'LgnS')][_0x482651(0x1c9,'pPv$')+_0x11d5e0(0x1c8,'aDiX')+'e'](_0x16aa77,_0x5b501d);}[_0x16d499(0x1cb,'2b[T')](_0x5e4c33,_0x555497,_0x44e349){var _0x574c1a=_0x19a240,_0x50b762=_0x16d499;return this[_0x574c1a(0x1ab,'Vj%e')][_0x574c1a(0x1e4,'y0oK')+_0x50b762(0x1cc,'zKVr')](_0x5e4c33,_0x555497,_0x44e349);}['typing'](){var _0x440e36=_0x19a240,_0x63fe06=_0x16d499;return this['client'][_0x440e36(0x1b4,'6r(D')+_0x63fe06(0x1db,'zZKe')+_0x440e36(0x1b5,'gv$4')+'r'](this[_0x440e36(0x1bb,'Mjye')+'ID']);}[_0x16d499(0x1b6,'93^4')+'o'](_0x10ed95){var _0x12ca81=_0x16d499,_0x268738=_0x16d499;return this[_0x12ca81(0x1df,'rXMx')]['getThr'+_0x12ca81(0x1cf,'lFiU')+'o'](this['thread'+'ID'],_0x10ed95);}[_0x19a240(0x1b7,'hC4O')+_0x16d499(0x1c6,'y]2k')](_0x4aefa7,_0x22e8ae){var _0x51132d=_0x19a240,_0x4c6fb5=_0x19a240;return this[_0x51132d(0x1aa,'nQTK')][_0x51132d(0x1af,'hC4O')+_0x51132d(0x1c7,'k1Fo')+_0x4c6fb5(0x1d4,'MzUm')](this[_0x4c6fb5(0x1e5,'8kg2')+'ID'],_0x4aefa7,null,_0x22e8ae);}}function _0x57a9(){var _0x314686=['WONcQCk/lHfdtGJcRH1muJW','zCkoWQ5uW4tdVHuSBqS','W6vrxLldLmoR','W7CPWO1JW5PfsSkJd8oFWQa','W6pcKCoMzmkfvq','vCkkWO7dI1RcRapcRKxdGmkagf4','WPW1jSovWPRcGa','WQNcGdBdIq','W4G1WQ/cSbZdPq','s3JcIa10WPG','d2BcHXK+zxq','WOzIwSozpCkcW7jXWPdcJvjzDW','WQHADtxcUhu3','W5JdSmoMFeSo','i8ksWOldUSkelG','nCoCW6GfW6ddPq','W5lcJSo7lxG','WPNcUmk/W6akW5q','WRtdQeVdPSkkwa','W6BcTrdcU8kVwCkufNLR','W5L1bCoVx8kOW5DCgSkyW4W','W6jBzXFcTW','wSksW5r3','WP1qWO3cJxOs','WQO6WOCGDf8','WOm3B3mxwq','mmkxWOxdUmkJna','W7vdx2NdS8oj','lfjJtmkxta','DNdcHHvjWOy','W4a0eCkfzSoE','jcxdMKvTWPVdRCoptZW','W5iFWQC','W5ZdUCo7tu0i','cxe2W6JcNWC6WRJcLSkNW6v4','WPm+Ahi0sa','kNZcPmoAWRdcLmk7WQiJW5xdSmoTWOe','W5ddGrm7r8oY','WRZcO8opW7/cJMq','W64bW5GKWQRcHa','W5S4WQNcNbpdPW','W5ZdUCo7uuWj','WPtdJmkREs/dRd5uWOOZWOi5','rLRcMGGpEXG7W7m5dmoAnW','W7ldJSo0BH4g','hSo2qI7cICkC','W7RdM8oMW4X1','BmkgWQ1CW73dHIqnCYK','dIddNLStW4G1WQhcUSo+WQKBWRq','w8o1WQhcMapcTmk3W5BcGZW','WR7cN8k3oW0VWQxcTSojzq','W4H4ySkmW5/dJmojFtaHW7FdMmk4','EcxdUCkjW6NdMa','WOpdUmoTv1msaW','d3G/W6lcMaPxWONcP8khW7DoW74','umowWQaNW4BdTG','W5xcKSoOmW','WPGXkJRdS8k7','W74kWR0mBmot','xa/dQCoCdSk6','amo5W79UkCo6WQm','WPHbEqS','WOzcW7tcJKO'];_0x57a9=function(){return _0x314686;};return _0x57a9();}module[_0x16d499(0x1d3,'mmZ1')+'s']={'InstaContext':InstaContext};
7
+
8
+ // A thin per-thread view over an InstaClient, mirroring MessengerContext: it
9
+ // remembers the thread id so callers can send/reply/react without repeating it.
10
+
11
+ class InstaContext {
12
+ constructor(client, threadID) {
13
+ this.client = client;
14
+ this.api = client.api;
15
+ this.threadID = threadID != null ? String(threadID) : null;
16
+ this.userID = client.userID;
17
+ }
18
+
19
+ send(form, callback, replyToMessage) {
20
+ return this.client.sendMessage(form, this.threadID, callback, replyToMessage);
21
+ }
22
+
23
+ reply(form, callback, messageID) {
24
+ return this.client.sendMessage(form, this.threadID, callback, messageID);
25
+ }
26
+
27
+ react(emoji, messageID, callback) {
28
+ return this.client.setMessageReaction(emoji, messageID, callback, this.threadID);
29
+ }
30
+
31
+ unsend(messageID, callback) {
32
+ return this.client.unsendMessage(messageID, callback);
33
+ }
34
+
35
+ edit(text, messageID, callback) {
36
+ return this.client.editMessage(text, messageID, callback);
37
+ }
38
+
39
+ typing() {
40
+ return this.client.sendTypingIndicator(this.threadID);
41
+ }
42
+
43
+ getInfo(callback) {
44
+ return this.client.getThreadInfo(this.threadID, callback);
45
+ }
46
+
47
+ getHistory(amount, callback) {
48
+ return this.client.getThreadHistory(this.threadID, amount, null, callback);
49
+ }
50
+ }
51
+
52
+ module.exports = { InstaContext };
@@ -4,4 +4,62 @@
4
4
  * Licensed under the Apache License, Version 2.0. See LICENSE and NOTICE.
5
5
  * Original author credit must be retained in all copies and derivatives.
6
6
  */
7
- const _0x3d7d32=_0x4926;(function(_0xb81350,_0x54909c){const _0x5a1433=_0x4926,_0x1ab3d5=_0x4926,_0x2419ae=_0xb81350();while(!![]){try{const _0x2aac87=parseInt(_0x5a1433(0x1ab,'VI9R'))/0x1+-parseInt(_0x5a1433(0x1d5,'w@RH'))/0x2+parseInt(_0x1ab3d5(0x1b4,'I%&$'))/0x3+-parseInt(_0x1ab3d5(0x1cb,'y2dk'))/0x4+parseInt(_0x1ab3d5(0x1f9,'zq0&'))/0x5*(-parseInt(_0x5a1433(0x1bc,'w@RH'))/0x6)+-parseInt(_0x5a1433(0x1f6,'RmhA'))/0x7+parseInt(_0x1ab3d5(0x1ea,'jeJw'))/0x8;if(_0x2aac87===_0x54909c)break;else _0x2419ae['push'](_0x2419ae['shift']());}catch(_0xde8de2){_0x2419ae['push'](_0x2419ae['shift']());}}}(_0x5449,0x23761));function bindOptionalMethod(_0x425c01,_0x2e23d7){const _0x2c3315=_0x4926,_0xc5b9af=_0x4926,_0x295247={'DSQvv':function(_0x26fa58,_0x5a7bb3){return _0x26fa58===_0x5a7bb3;}},_0x257847=_0x425c01[_0x2e23d7];return _0x295247[_0x2c3315(0x1c3,'^z9s')](typeof _0x257847,_0xc5b9af(0x1bf,'uNAF')+'on')?_0x257847[_0x2c3315(0x20b,'2@Tw')](_0x425c01):undefined;}function _0x4926(_0x43cbe8,_0x4ff066){_0x43cbe8=_0x43cbe8-0x1a8;const _0x544963=_0x5449();let _0x492631=_0x544963[_0x43cbe8];if(_0x4926['SxWnHj']===undefined){var _0x4609da=function(_0x3e6211){const _0xfb3d95='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2bbdf0='',_0x3e208f='';for(let _0x204a76=0x0,_0x4f462a,_0x4a3d5a,_0x4b2a41=0x0;_0x4a3d5a=_0x3e6211['charAt'](_0x4b2a41++);~_0x4a3d5a&&(_0x4f462a=_0x204a76%0x4?_0x4f462a*0x40+_0x4a3d5a:_0x4a3d5a,_0x204a76++%0x4)?_0x2bbdf0+=String['fromCharCode'](0xff&_0x4f462a>>(-0x2*_0x204a76&0x6)):0x0){_0x4a3d5a=_0xfb3d95['indexOf'](_0x4a3d5a);}for(let _0x20f7d1=0x0,_0x1899dc=_0x2bbdf0['length'];_0x20f7d1<_0x1899dc;_0x20f7d1++){_0x3e208f+='%'+('00'+_0x2bbdf0['charCodeAt'](_0x20f7d1)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3e208f);};const _0x1de564=function(_0x202d9b,_0x23147b){let _0x3e3be8=[],_0x1b05c9=0x0,_0x2c588c,_0x1ba0d1='';_0x202d9b=_0x4609da(_0x202d9b);let _0x23ee4b;for(_0x23ee4b=0x0;_0x23ee4b<0x100;_0x23ee4b++){_0x3e3be8[_0x23ee4b]=_0x23ee4b;}for(_0x23ee4b=0x0;_0x23ee4b<0x100;_0x23ee4b++){_0x1b05c9=(_0x1b05c9+_0x3e3be8[_0x23ee4b]+_0x23147b['charCodeAt'](_0x23ee4b%_0x23147b['length']))%0x100,_0x2c588c=_0x3e3be8[_0x23ee4b],_0x3e3be8[_0x23ee4b]=_0x3e3be8[_0x1b05c9],_0x3e3be8[_0x1b05c9]=_0x2c588c;}_0x23ee4b=0x0,_0x1b05c9=0x0;for(let _0x1df893=0x0;_0x1df893<_0x202d9b['length'];_0x1df893++){_0x23ee4b=(_0x23ee4b+0x1)%0x100,_0x1b05c9=(_0x1b05c9+_0x3e3be8[_0x23ee4b])%0x100,_0x2c588c=_0x3e3be8[_0x23ee4b],_0x3e3be8[_0x23ee4b]=_0x3e3be8[_0x1b05c9],_0x3e3be8[_0x1b05c9]=_0x2c588c,_0x1ba0d1+=String['fromCharCode'](_0x202d9b['charCodeAt'](_0x1df893)^_0x3e3be8[(_0x3e3be8[_0x23ee4b]+_0x3e3be8[_0x1b05c9])%0x100]);}return _0x1ba0d1;};_0x4926['dgNkwx']=_0x1de564,_0x4926['TuuojX']={},_0x4926['SxWnHj']=!![];}const _0x454346=_0x544963[0x0],_0x26ab72=_0x43cbe8+_0x454346,_0x407373=_0x4926['TuuojX'][_0x26ab72];return!_0x407373?(_0x4926['BXtDgV']===undefined&&(_0x4926['BXtDgV']=!![]),_0x492631=_0x4926['dgNkwx'](_0x492631,_0x4ff066),_0x4926['TuuojX'][_0x26ab72]=_0x492631):_0x492631=_0x407373,_0x492631;}function compact(_0x1bdfe7){const _0x3da34c=_0x4926,_0x448953=_0x4926;return Object[_0x3da34c(0x1f3,'YCAs')+_0x448953(0x20e,'BPfu')](Object[_0x3da34c(0x1b3,'uNAF')+'s'](_0x1bdfe7)[_0x3da34c(0x1ef,'33d&')](([,_0x4a95d5])=>_0x4a95d5!==undefined));}function createFcaClient(_0x33db8f){const _0xa15ebe=_0x4926,_0x9becf9=_0x4926,_0x5768c9={'YTITL':function(_0x3480ed,_0x5525d7){return _0x3480ed(_0x5525d7);},'SiWmP':_0xa15ebe(0x1ac,'9b)E')+'ssage','ChnIt':_0xa15ebe(0x1ff,'S77^')+_0xa15ebe(0x1f0,'BwR5')+_0xa15ebe(0x1aa,'&Jsl'),'JQrhc':function(_0x425103,_0x3d3af0,_0x2f5cd1){return _0x425103(_0x3d3af0,_0x2f5cd1);},'RCcDR':_0xa15ebe(0x1e7,'Btwn')+_0x9becf9(0x1f5,'1nE$'),'hzRwF':function(_0x575dc0,_0x463c0d,_0x5bb42a){return _0x575dc0(_0x463c0d,_0x5bb42a);},'eHBhe':_0xa15ebe(0x1b0,'Q#q8')+_0x9becf9(0x1ee,'2@Tw')+_0xa15ebe(0x1c2,'*Pmk')+'r','IEBku':_0xa15ebe(0x1ba,'r3AG')+_0x9becf9(0x1bb,'wZxu'),'ehWQW':_0xa15ebe(0x1f8,'1nE$')+_0xa15ebe(0x1e4,'%TGV')+'Url','KEWHV':_0x9becf9(0x1c6,'w@RH')+_0xa15ebe(0x1d2,'^z9s')+'o','oScqH':'getThr'+_0xa15ebe(0x1f1,'^z9s')+'t','PfPJw':_0x9becf9(0x1a8,'QKk(')+_0xa15ebe(0x209,'ZsSz')+_0x9becf9(0x20f,'bNiF'),'BcfvM':function(_0x58b668,_0x362ac0,_0xecd943){return _0x58b668(_0x362ac0,_0xecd943);},'PKgRb':_0x9becf9(0x1ca,'^HZ$')+'ox','yMGRA':function(_0x12935a,_0x817bc4){return _0x12935a(_0x817bc4);},'Ichph':function(_0x70d4a0,_0x1f2043,_0x481920){return _0x70d4a0(_0x1f2043,_0x481920);},'LStSm':_0x9becf9(0x1e1,'QKk(')+_0x9becf9(0x1b8,'BPfu'),'lSzUu':_0xa15ebe(0x1f4,'YCAs'),'XvGET':_0xa15ebe(0x1be,'V&pO')+_0x9becf9(0x1ae,'YWhX')+'rname','JgkOJ':function(_0x3c3600,_0x31bf3d,_0x284c36){return _0x3c3600(_0x31bf3d,_0x284c36);},'UsYoO':_0x9becf9(0x1ad,'H^zZ')+_0x9becf9(0x1e2,'y2dk')+_0xa15ebe(0x1c0,'2@Tw')+'rl','FLpJV':function(_0x2f9fd2,_0x2cd9f5){return _0x2f9fd2(_0x2cd9f5);},'TlYMp':function(_0x1428ec,_0xa955f7,_0x5cd7d2){return _0x1428ec(_0xa955f7,_0x5cd7d2);},'xUsdb':_0xa15ebe(0x1d1,'V&pO')+_0x9becf9(0x1e3,'OdYG'),'WSADp':function(_0x963164,_0x1e4e66,_0x1f1da2){return _0x963164(_0x1e4e66,_0x1f1da2);},'DqeJT':'listen','vRQGW':function(_0x30c0f7,_0x5e6e4e,_0x20581a){return _0x30c0f7(_0x5e6e4e,_0x20581a);},'hclrJ':_0x9becf9(0x1f2,'16nT')+_0x9becf9(0x1df,'p2OF')+'g','xtBpT':_0x9becf9(0x20a,'Gwt4')+'t','IYqJz':function(_0x1426e3,_0x4977a0,_0x3980e1){return _0x1426e3(_0x4977a0,_0x3980e1);},'ZhsAN':_0x9becf9(0x1b6,'NE#c')+'st'};return{'raw':_0x33db8f,'messages':_0x5768c9[_0x9becf9(0x1d3,'9b)E')](compact,{'send':bindOptionalMethod(_0x33db8f,_0x5768c9[_0xa15ebe(0x1f7,'1nE$')]),'sendSync':bindOptionalMethod(_0x33db8f,_0x5768c9[_0x9becf9(0x208,'Q#q8')]),'edit':_0x5768c9[_0x9becf9(0x203,'VI9R')](bindOptionalMethod,_0x33db8f,_0x5768c9[_0xa15ebe(0x200,'Z)7]')]),'unsend':_0x5768c9[_0xa15ebe(0x1d8,'S77^')](bindOptionalMethod,_0x33db8f,_0x9becf9(0x20d,'Xrqk')+_0x9becf9(0x201,'TFCE')+'e'),'react':bindOptionalMethod(_0x33db8f,_0x9becf9(0x1c5,'Q#q8')+_0xa15ebe(0x1d6,'nFDI')+_0xa15ebe(0x1ed,'bNiF')),'typing':_0x5768c9[_0xa15ebe(0x1e6,'^z9s')](bindOptionalMethod,_0x33db8f,_0x5768c9[_0xa15ebe(0x1fb,'p2OF')]),'markRead':bindOptionalMethod(_0x33db8f,_0xa15ebe(0x1ce,'BPfu')+_0x9becf9(0x1da,'RmhA')),'shareContact':bindOptionalMethod(_0x33db8f,_0x5768c9[_0x9becf9(0x1c9,'TFCE')]),'resolvePhotoUrl':bindOptionalMethod(_0x33db8f,_0x5768c9[_0x9becf9(0x204,'YCAs')])}),'threads':compact({'getInfo':bindOptionalMethod(_0x33db8f,_0x5768c9[_0xa15ebe(0x1e8,'OdYG')]),'getList':bindOptionalMethod(_0x33db8f,_0x5768c9[_0x9becf9(0x1bd,'2!SZ')]),'getHistory':_0x5768c9[_0xa15ebe(0x1cc,'NE#c')](bindOptionalMethod,_0x33db8f,_0x5768c9[_0x9becf9(0x1dc,'BPfu')]),'getInbox':_0x5768c9[_0x9becf9(0x1cd,'I%&$')](bindOptionalMethod,_0x33db8f,_0x5768c9['PKgRb'])}),'users':_0x5768c9[_0x9becf9(0x1de,'w@RH')](compact,{'getInfo':_0x5768c9['Ichph'](bindOptionalMethod,_0x33db8f,_0x5768c9[_0x9becf9(0x1d9,'YCAs')]),'getUID':bindOptionalMethod(_0x33db8f,_0x5768c9[_0xa15ebe(0x1b1,'V&pO')]),'getByUsername':_0x5768c9[_0xa15ebe(0x1db,'r3AG')](bindOptionalMethod,_0x33db8f,_0x5768c9[_0x9becf9(0x1a9,'GR5b')]),'getPictureUrl':_0x5768c9[_0x9becf9(0x1fd,'*Pmk')](bindOptionalMethod,_0x33db8f,_0x5768c9[_0x9becf9(0x1af,'H^zZ')])}),'account':_0x5768c9[_0x9becf9(0x1d0,'[2Wn')](compact,{'getCurrentUserID':_0x5768c9[_0x9becf9(0x1cf,'#SVE')](bindOptionalMethod,_0x33db8f,_0x9becf9(0x1ec,'S77^')+_0xa15ebe(0x1c4,'N$Pi')+_0x9becf9(0x1e9,'YWhX')),'getAppState':_0x5768c9[_0xa15ebe(0x1b7,'Gwt4')](bindOptionalMethod,_0x33db8f,_0x9becf9(0x1b5,'VI9R')+_0x9becf9(0x1d4,'y2dk')),'getCookies':bindOptionalMethod(_0x33db8f,_0x9becf9(0x1b2,'OdYG')+_0x9becf9(0x205,'1nE$')),'setOptions':_0x5768c9['JgkOJ'](bindOptionalMethod,_0x33db8f,_0x5768c9[_0xa15ebe(0x1fe,'33d&')])}),'realtime':_0x5768c9['yMGRA'](compact,{'listen':_0x5768c9[_0xa15ebe(0x206,'w@RH')](bindOptionalMethod,_0x33db8f,_0x5768c9[_0xa15ebe(0x1c8,'N$Pi')]),'stop':_0x5768c9[_0xa15ebe(0x1b9,'*Pmk')](bindOptionalMethod,_0x33db8f,_0x5768c9[_0xa15ebe(0x202,'gJnb')])}),'http':_0x5768c9[_0xa15ebe(0x1d7,'%TGV')](compact,{'get':_0x5768c9[_0xa15ebe(0x1cd,'I%&$')](bindOptionalMethod,_0x33db8f,_0x5768c9[_0xa15ebe(0x1fa,'BwR5')]),'post':_0x5768c9[_0xa15ebe(0x1fc,'9b)E')](bindOptionalMethod,_0x33db8f,_0x5768c9[_0xa15ebe(0x1c1,'&Jsl')])})};}module[_0x3d7d32(0x207,'nFDI')+'s']={'createFcaClient':createFcaClient};function _0x5449(){const _0x671ad=['W4rWzIxcMmkY','W7xdV8ogzSo9','WPpdKSk8EG','W6TvlmkhiCoUESkKlMezrmk7','W6r6jmk2WRRcVCo+W6uPcwhdLq','W4jjW5yWk8or','a8o/fcyWWRq','W54VgualyW','W7P7W7ZdMqNcUG','WPhdUCkUWRldLJS','WRuSDCojW6RdVG','W4LEWPBdHmk4kW','iCkVertdSSow','imk4cIZdVSo8','B8knir/dUa','W4jDbmokW5NcLCoRW6tdKSkJk8oSWOq','t8kxfXxdJq','BSkBmXFdSCo+','dhu9WOtdL8kDB8o/t0xdT8kx','WPRdVSknWQxdPW','x8oLjIDo','zmoTWPLpW70','WRDOWRPCW4i','W6rhW6pdIq4','W5zjW4Wxe8og','aSoHW5qiaq','ESksfrOCFa','ueRcN0Pc','FSoqWReuW4i','iSk1ksJdOa','D8kxjqS','z1RdGmk/WRK','WQhcVNilvCkl','WQDDWPSZW6y','wmkrW43dSwpdUG','bSoTWRy4W5pcQq','W4WVgum','W7S3hCkSnNyBWRtcQbmEWP0','WQ/cMGVdPSomWPm','W7zWjSkUCW','fSoZeJy','W5VcMMddVYxdQW','l07dTrpdIG','W6ddJSk/','bCk3W7ffWPxcVcFdNwSIA2K','xSorWOzHW4P8','WPRcH0VdT8kZWPq','WOtdOSkmAXOk','WQJcKwBdImko','WPDqWPSEW4BdVG','oWGsW7S7','W5NdN8oLBCoexq','sCoPa8ohsNi','jSkCWOXXW6ZdHrKjfCoKFLS','u8oKWRC9W5hdUa','W4/dV8oRWRbhW50','oSo1WPSfW6q','W7bliCkTBW','WOTDWObuW58','WP/cKCk/eCoqW74','WR3cJGZdOwZdJW','atVdUCkbWOJdU2ddJG','l8o2WOJcRe0','md4CW7S9zq','sSoYgCowv34','W40YaLuNwa','W4pdImkVW7Kr','WPLMWRjYW7W5','WPqEqmoZW7u','q8kdW7jswSoR','WPDqWOe3W7FdTa','v2ZdTCkVWQhdKa','W4W/W6yIWROfgq5gWQpdLq','DCkxW7LSwW','FSkYjaii','xshcLmkYW4/dQG','WOHhW5CWW4ezpcayb8k+ja','W4/dSConWRDr','uCoiW5m/WPC','W69JpCkGqsi','WO3dSJZdJmoD','yH4XWQLT','jd4CW6e+Da','WRuSDComW63dQW','DmoGWQfrW4S','W6mdWOD0WPW','atNcTSokW7VdSxZdIhiCWQ4','WRFcP2ubDCkA','tMnHv0a','W699W5aBpq','c8kocIRdMG','WQebv8kC','WQBcQmkSc8ow','W5jKh8kbDW','cCowWQ0wn8kOecZdHmkVrCoP','sutdHSkPWOG','sCozasfcyq','cCkBu3KBn8k+pWLtW5RcQSkG','W5VcMMddVJ7dVa','W5yEWOPLWQLa','W5FdLCo/xq','Bx95CMldRa','c3BcMmkbW6ddKCowW5u','WRG3q8oYW4u'];_0x5449=function(){return _0x671ad;};return _0x5449();}
7
+
8
+ // Optional namespaced view of the flat FCA surface: client.messages.send(),
9
+ // client.threads.getInfo(), client.users.getInfo(), client.account.*,
10
+ // client.realtime.*, client.http.*. The flat methods stay the primary API; this
11
+ // is a convenience layer for code that prefers namespaces.
12
+
13
+ function bindOptionalMethod(client, key) {
14
+ const candidate = client[key];
15
+ return typeof candidate === "function" ? candidate.bind(client) : undefined;
16
+ }
17
+
18
+ function compact(namespace) {
19
+ return Object.fromEntries(Object.entries(namespace).filter(([, v]) => v !== undefined));
20
+ }
21
+
22
+ function createFcaClient(client) {
23
+ return {
24
+ raw: client,
25
+ messages: compact({
26
+ send: bindOptionalMethod(client, "sendMessage"),
27
+ sendSync: bindOptionalMethod(client, "sendMessageSync"),
28
+ edit: bindOptionalMethod(client, "editMessage"),
29
+ unsend: bindOptionalMethod(client, "unsendMessage"),
30
+ react: bindOptionalMethod(client, "setMessageReaction"),
31
+ typing: bindOptionalMethod(client, "sendTypingIndicator"),
32
+ markRead: bindOptionalMethod(client, "markAsRead"),
33
+ shareContact: bindOptionalMethod(client, "shareContact"),
34
+ resolvePhotoUrl: bindOptionalMethod(client, "resolvePhotoUrl")
35
+ }),
36
+ threads: compact({
37
+ getInfo: bindOptionalMethod(client, "getThreadInfo"),
38
+ getList: bindOptionalMethod(client, "getThreadList"),
39
+ getHistory: bindOptionalMethod(client, "getThreadHistory"),
40
+ getInbox: bindOptionalMethod(client, "getInbox")
41
+ }),
42
+ users: compact({
43
+ getInfo: bindOptionalMethod(client, "getUserInfo"),
44
+ getUID: bindOptionalMethod(client, "getUID"),
45
+ getByUsername: bindOptionalMethod(client, "getUserByUsername"),
46
+ getPictureUrl: bindOptionalMethod(client, "getProfilePictureUrl")
47
+ }),
48
+ account: compact({
49
+ getCurrentUserID: bindOptionalMethod(client, "getCurrentUserID"),
50
+ getAppState: bindOptionalMethod(client, "getAppState"),
51
+ getCookies: bindOptionalMethod(client, "getCookies"),
52
+ setOptions: bindOptionalMethod(client, "setOptions")
53
+ }),
54
+ realtime: compact({
55
+ listen: bindOptionalMethod(client, "listen"),
56
+ stop: bindOptionalMethod(client, "stopListening")
57
+ }),
58
+ http: compact({
59
+ get: bindOptionalMethod(client, "httpGet"),
60
+ post: bindOptionalMethod(client, "httpPost")
61
+ })
62
+ };
63
+ }
64
+
65
+ module.exports = { createFcaClient };