@ranger-testing/ranger-cli 3.1.6-alpha.aca5f9c-53 → 3.1.6

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 (86) hide show
  1. package/build/cli.js +1 -1
  2. package/build/commands/addEnv.js +1 -1
  3. package/build/commands/authEncrypt.js +1 -1
  4. package/build/commands/clean.js +1 -1
  5. package/build/commands/config.js +1 -1
  6. package/build/commands/deleteProfile.js +1 -1
  7. package/build/commands/env.js +1 -1
  8. package/build/commands/feature.js +1 -1
  9. package/build/commands/hook.js +1 -1
  10. package/build/commands/hooks/autoPrompt.js +1 -1
  11. package/build/commands/hooks/disable.js +1 -1
  12. package/build/commands/hooks/enable.js +1 -1
  13. package/build/commands/hooks/exitPlanMode.js +1 -1
  14. package/build/commands/hooks/index.js +1 -1
  15. package/build/commands/hooks/output.js +1 -1
  16. package/build/commands/hooks/planReminder.js +1 -1
  17. package/build/commands/hooks/planStart.js +1 -1
  18. package/build/commands/hooks/postEdit.js +1 -1
  19. package/build/commands/hooks/preCompact.js +1 -1
  20. package/build/commands/hooks/sessionEnd.js +1 -1
  21. package/build/commands/hooks/sessionStart.js +1 -1
  22. package/build/commands/hooks/stopHook.js +1 -1
  23. package/build/commands/index.js +1 -1
  24. package/build/commands/login.js +1 -1
  25. package/build/commands/mcpBootstrap.js +1 -1
  26. package/build/commands/migrateProfile.js +1 -1
  27. package/build/commands/setup/claude.js +1 -1
  28. package/build/commands/setup/opencode.js +1 -1
  29. package/build/commands/setupCi.js +1 -1
  30. package/build/commands/skillup.js +1 -1
  31. package/build/commands/start.js +1 -1
  32. package/build/commands/status.js +1 -1
  33. package/build/commands/update.js +1 -1
  34. package/build/commands/updateEnv.js +1 -1
  35. package/build/commands/useEnv.js +1 -1
  36. package/build/commands/utils/activeProfile.js +1 -1
  37. package/build/commands/utils/agentEnv.js +1 -1
  38. package/build/commands/utils/browserSessionsApi.js +1 -1
  39. package/build/commands/utils/claudeConfig.js +1 -1
  40. package/build/commands/utils/claudeOverrideSettings.js +1 -1
  41. package/build/commands/utils/claudePlugin.js +1 -1
  42. package/build/commands/utils/cloudProfile.js +1 -1
  43. package/build/commands/utils/cloudProfileSession.js +1 -1
  44. package/build/commands/utils/crypto.js +1 -1
  45. package/build/commands/utils/desirePathLog.js +1 -1
  46. package/build/commands/utils/deviceAuth.js +1 -1
  47. package/build/commands/utils/environment.js +1 -1
  48. package/build/commands/utils/featureApi.js +1 -1
  49. package/build/commands/utils/fixWebmDuration.js +1 -1
  50. package/build/commands/utils/gitTracked.js +1 -1
  51. package/build/commands/utils/keychain.js +1 -1
  52. package/build/commands/utils/legacyWarning.js +1 -1
  53. package/build/commands/utils/localAgentInstallationsApi.js +1 -1
  54. package/build/commands/utils/matchAuthEnvironment.js +1 -1
  55. package/build/commands/utils/mcpImageBase64.js +1 -1
  56. package/build/commands/utils/model.js +1 -1
  57. package/build/commands/utils/novaActCli.js +1 -1
  58. package/build/commands/utils/opencodeConfig.js +1 -1
  59. package/build/commands/utils/organizationEnvApi.js +1 -1
  60. package/build/commands/utils/playwrightCli.js +1 -1
  61. package/build/commands/utils/profileMessages.js +1 -1
  62. package/build/commands/utils/profileSetupBanner.js +1 -1
  63. package/build/commands/utils/projectsConfig.js +1 -1
  64. package/build/commands/utils/rangerConfig.js +1 -1
  65. package/build/commands/utils/rangerRoot.js +1 -1
  66. package/build/commands/utils/rangerwrightCli.js +1 -1
  67. package/build/commands/utils/resolveProfileContext.js +1 -1
  68. package/build/commands/utils/resolveProfileUrl.js +1 -1
  69. package/build/commands/utils/retry.js +1 -1
  70. package/build/commands/utils/scenarioOriginCheck.js +1 -1
  71. package/build/commands/utils/sessionCache.js +1 -1
  72. package/build/commands/utils/settings.js +1 -1
  73. package/build/commands/utils/skillContent.js +1 -1
  74. package/build/commands/utils/skills.js +1 -1
  75. package/build/commands/utils/stitchWebmFiles.js +1 -1
  76. package/build/commands/utils/telemetry.js +1 -1
  77. package/build/commands/utils/tokenRefresh.js +1 -1
  78. package/build/commands/utils/traceSnapshotMapper.js +1 -1
  79. package/build/commands/utils/tunnelClient.js +1 -1
  80. package/build/commands/utils/userApi.js +1 -1
  81. package/build/commands/utils/version.js +1 -1
  82. package/build/commands/verifyFeature.js +1 -1
  83. package/build/commands/verifyFeatureCli.js +1 -1
  84. package/build/commands/verifyFeatureNovaCli.js +1 -1
  85. package/build/commands/verifyFeatureRangerwrightCli.js +1 -1
  86. package/package.json +1 -1
@@ -1 +1 @@
1
- const _0x5559ee=_0xa37e;(function(_0x5d200d,_0x24cc73){const _0x530bca=_0xa37e,_0x3bc326=_0x5d200d();while(!![]){try{const _0x338cf7=parseInt(_0x530bca(0x12c))/0x1*(parseInt(_0x530bca(0x182))/0x2)+-parseInt(_0x530bca(0xf0))/0x3+parseInt(_0x530bca(0x166))/0x4*(-parseInt(_0x530bca(0x10e))/0x5)+-parseInt(_0x530bca(0x184))/0x6+-parseInt(_0x530bca(0x175))/0x7*(-parseInt(_0x530bca(0x16b))/0x8)+-parseInt(_0x530bca(0x130))/0x9*(parseInt(_0x530bca(0x181))/0xa)+parseInt(_0x530bca(0x16d))/0xb;if(_0x338cf7===_0x24cc73)break;else _0x3bc326['push'](_0x3bc326['shift']());}catch(_0x5db4be){_0x3bc326['push'](_0x3bc326['shift']());}}}(_0x58f3,0xaa7ce));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x1bca08 from'inquirer';import{chromium}from'playwright';import{getApiBaseUrl}from'./environment.js';import{getToken}from'./keychain.js';import{getRangerHomeDir}from'./rangerRoot.js';import{addProfileSetupBanner}from'./profileSetupBanner.js';import{duplicateCookiesForDomains,getSessionCachePath,getStorageStatePath,isBareLocalhost,isCachedSessionLive,isInteractive,needsTunnel,orderLoginDomains,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';import{matchAuthEnvironmentByHost,matchAuthEnvironmentExact}from'./matchAuthEnvironment.js';import{createTunnelBridge,launchBrowserServer}from'./tunnelClient.js';function targetHostForTelemetry(_0x1bce2f){const _0x4116ce=_0xa37e,_0x5a303c={'jDgQq':'invalid-url'};try{return new URL(_0x1bce2f)['host'];}catch{return _0x5a303c[_0x4116ce(0x1a2)];}}function errorMessageForTelemetry(_0x6f7619){const _0x4292e7=_0xa37e;return _0x6f7619 instanceof Error?_0x6f7619[_0x4292e7(0x187)]:undefined;}function trackBridgeEvent(_0x3368a6,_0x3e914d){const _0x8c5cb0=_0xa37e,_0xf7db55={'urFBf':function(_0x427679,_0x25c360){return _0x427679===_0x25c360;},'qRFpR':'local_ws_error'};if(!_0x3368a6)return;const _0x45175d={'tunnelSessionId':_0x3e914d['sessionId'],'tunnelEventType':_0x3e914d['type'],'connectionId':_0x3e914d[_0x8c5cb0(0xde)],'code':_0x3e914d['code'],'reason':_0x3e914d['reason'],'error':_0x3e914d[_0x8c5cb0(0x11a)],'elapsedMs':_0x3e914d['elapsedMs'],'activeLocalConnections':_0x3e914d[_0x8c5cb0(0x197)],'pendingLocalConnections':_0x3e914d[_0x8c5cb0(0x167)]};_0x3368a6['trackPhaseEnd']('tunnel_bridge_event',_0x45175d),(_0x3e914d['type']===_0x8c5cb0(0x13c)||_0xf7db55[_0x8c5cb0(0x19c)](_0x3e914d[_0x8c5cb0(0x133)],_0xf7db55[_0x8c5cb0(0x153)]))&&void _0x3368a6['trackPhaseError'](_0x8c5cb0(0x1a1),new Error(_0x3e914d['error']??_0x3e914d[_0x8c5cb0(0x133)]),_0x45175d);}const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0x1a8cfd=_0xa37e,_0x3133c1={'cbVGT':_0x1a8cfd(0xec)},_0x296e77=await getToken();if(!_0x296e77)throw new Error(_0x3133c1['cbVGT']);return _0x296e77;}async function apiRequest(_0x1053e7,_0xb30e8={}){const _0x226df7=_0xa37e,_0x6c0ee2={'opgFC':function(_0x384637){return _0x384637();},'INCAC':function(_0x45a2b8,_0x429042,_0x109b99){return _0x45a2b8(_0x429042,_0x109b99);},'vAIOF':function(_0x4b6a06,_0x1c80e8){return _0x4b6a06===_0x1c80e8;},'xNaiu':_0x226df7(0x198),'qjxyi':function(_0x2acbfa,_0x379af3){return _0x2acbfa===_0x379af3;},'BAVbq':function(_0xc5ca34,_0x3b0127){return _0xc5ca34===_0x3b0127;}},_0x3936b3=await _0x6c0ee2['opgFC'](requireToken),_0x5aa1c5=_0x6c0ee2[_0x226df7(0x100)](getApiBaseUrl),_0x55e1b9=await _0x6c0ee2['INCAC'](fetch,''+_0x5aa1c5+_0x1053e7,{..._0xb30e8,'headers':{'Authorization':'Bearer\x20'+_0x3936b3,'Content-Type':_0x226df7(0xe2),..._0xb30e8[_0x226df7(0x154)]??{}}});if(!_0x55e1b9['ok']){let _0x60e17='',_0xefd817;try{const _0x2c67e5=await _0x55e1b9[_0x226df7(0xfe)](),_0x51548b=(_0x6c0ee2[_0x226df7(0x190)](typeof _0x2c67e5['error'],_0x6c0ee2['xNaiu'])?_0x2c67e5['error']:undefined)??JSON['stringify'](_0x2c67e5);_0x60e17=_0x51548b;_0x6c0ee2[_0x226df7(0x183)](typeof _0x2c67e5[_0x226df7(0xfd)],_0x6c0ee2[_0x226df7(0x146)])&&_0x2c67e5['test_output']&&(_0x60e17=_0x60e17+'\x0a'+_0x2c67e5[_0x226df7(0xfd)]);if(_0x6c0ee2['BAVbq'](typeof _0x2c67e5['code'],_0x226df7(0x198)))_0xefd817=_0x2c67e5['code'];}catch{_0x60e17=_0x55e1b9[_0x226df7(0x15d)];}throw new ApiError(_0x226df7(0xe1)+_0x1053e7+'\x20failed\x20('+_0x55e1b9[_0x226df7(0x189)]+'):\x20'+_0x60e17,_0x55e1b9['status'],_0x60e17,_0xefd817);}if(_0x55e1b9['status']===0xcc)return undefined;return _0x55e1b9['json']();}export class ApiError extends Error{['status'];['detail'];[_0x5559ee(0x134)];constructor(_0x18b078,_0x5a33fd,_0xc9cd97,_0x3fb5fd){const _0x4f5476=_0x5559ee,_0x3791a9={'pRnJJ':'2|0|1|4|3'},_0x31ce1=_0x3791a9['pRnJJ'][_0x4f5476(0x160)]('|');let _0xf92c1=0x0;while(!![]){switch(_0x31ce1[_0xf92c1++]){case'0':this[_0x4f5476(0x189)]=_0x5a33fd;continue;case'1':this[_0x4f5476(0x12b)]=_0xc9cd97;continue;case'2':super(_0x18b078);continue;case'3':this[_0x4f5476(0xf5)]='ApiError';continue;case'4':this['code']=_0x3fb5fd;continue;}break;}}}export async function fetchCloudProfile(_0xfa4160){const _0x170e89=_0x5559ee,_0x4dfdac={'sNAfs':function(_0x552909,_0x111e89){return _0x552909(_0x111e89);},'jKahi':function(_0x42487c,_0x18946e){return _0x42487c(_0x18946e);},'ptboS':function(_0x40d048,_0x59d964){return _0x40d048 instanceof _0x59d964;},'VHCKH':function(_0x6b9b3e,_0x36a713){return _0x6b9b3e===_0x36a713;}};try{return await _0x4dfdac['sNAfs'](apiRequest,_0x170e89(0x18a)+_0x4dfdac['jKahi'](encodeURIComponent,_0xfa4160));}catch(_0x364632){if(_0x4dfdac['ptboS'](_0x364632,ApiError)&&_0x4dfdac['VHCKH'](_0x364632[_0x170e89(0x189)],0x194))return null;throw _0x364632;}}export async function listCloudProfiles(){const _0xf927d9=_0x5559ee,_0x35e0fc={'ZKiMR':function(_0x2d207a,_0x36e031){return _0x2d207a(_0x36e031);}},_0x3d3260=await _0x35e0fc['ZKiMR'](apiRequest,_0xf927d9(0x180));return _0x3d3260['profiles'];}export async function deleteCloudProfile(_0x1fe563){const _0x453d14=_0x5559ee,_0x492844={'CWUKI':function(_0x60f24f,_0x3db467){return _0x60f24f(_0x3db467);},'JOeGo':function(_0x11e94c,_0x3ccd61){return _0x11e94c instanceof _0x3ccd61;}};try{await apiRequest(_0x453d14(0x18a)+_0x492844[_0x453d14(0x172)](encodeURIComponent,_0x1fe563),{'method':_0x453d14(0x104)});}catch(_0x32db0c){if(_0x492844[_0x453d14(0xfa)](_0x32db0c,ApiError)&&_0x32db0c[_0x453d14(0x189)]===0x194)throw new Error(_0x453d14(0x17e)+_0x1fe563+'\x22\x20not\x20found.');throw _0x32db0c;}}export async function createCloudProfile(_0x12c1f7,_0xcfc95a,_0x3403bd={}){const _0x20774f=_0x5559ee,_0x52c57e={'pdXJs':function(_0x293d8a,_0x49ff22,_0x120941){return _0x293d8a(_0x49ff22,_0x120941);},'zcJFi':'POST'},_0x48b381={'name':_0x12c1f7};if(_0xcfc95a)_0x48b381['environment_key']=_0xcfc95a;_0x3403bd['settings']&&Object[_0x20774f(0xee)](_0x3403bd[_0x20774f(0x16a)])[_0x20774f(0x129)]>0x0&&(_0x48b381['settings']=_0x3403bd[_0x20774f(0x16a)]);if(_0x3403bd[_0x20774f(0x137)])_0x48b381['username']=_0x3403bd['username'];if(_0x3403bd[_0x20774f(0x17d)])_0x48b381[_0x20774f(0x17d)]=_0x3403bd['password'];return await _0x52c57e['pdXJs'](apiRequest,_0x20774f(0x180),{'method':_0x52c57e['zcJFi'],'body':JSON['stringify'](_0x48b381)});}export async function uploadCloudProfileSession(_0x22a258,_0x4e9a6e){const _0x330f84=_0x5559ee,_0x10a34f={'fzuUw':_0x330f84(0x152)};return await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x22a258)+_0x330f84(0xf8),{'method':_0x10a34f['fzuUw'],'body':JSON[_0x330f84(0x148)]({'session_state':_0x4e9a6e})});}export async function saveCloudProfileCredentials(_0x44790a,_0x43cf60,_0x4293e5){const _0x4cd9b4=_0x5559ee,_0x4e3181={'HyLoo':function(_0x49ce71,_0x48ba35){return _0x49ce71(_0x48ba35);}};await apiRequest(_0x4cd9b4(0x18a)+_0x4e3181[_0x4cd9b4(0x12f)](encodeURIComponent,_0x44790a),{'method':'PUT','body':JSON['stringify']({'username':_0x43cf60,'password':_0x4293e5})});}export async function fetchAuthConfig(){const _0x364eff=_0x5559ee,_0x4d5193={'ofPME':function(_0x28ae50,_0xf95a0d){return _0x28ae50(_0xf95a0d);},'WEJAS':_0x364eff(0x115),'RWrrs':function(_0x377ca9,_0x1cdb40){return _0x377ca9 instanceof _0x1cdb40;}};try{const _0x4c2bef=await _0x4d5193['ofPME'](apiRequest,_0x4d5193[_0x364eff(0x17f)]);return _0x4c2bef[_0x364eff(0x19f)];}catch(_0xae01b5){return _0x4d5193['RWrrs'](_0xae01b5,ApiError)&&_0xae01b5['status']!==0x194&&console[_0x364eff(0x11a)](_0x364eff(0x19e)+_0xae01b5[_0x364eff(0x187)]),null;}}function _0x58f3(){const _0x3cf68b=[');\x20pass\x20--env\x20<key>\x20to\x20pick\x20one.','detail','1210937dLqxHp','organizationId','trackPhaseEnd','HyLoo','9EOCGCF','setupHeaders','rSMRg','type','code','xdcZL','trackPhaseStart','username','HFVHF','PjxSb','env','newPage','tunnel_error','No\x20auth\x20environment\x20matches\x20the\x20local\x20target\x20\x22','\x20\x20Debug:\x20launching\x20tunneled\x20login\x20browser\x20headed...','ueMiw','pBlqI','Pass\x20--base-url\x20<your-app-url>\x20so\x20Ranger\x20can\x20match\x20the\x20right\x20one,\x20or\x20create\x20the\x20profile\x20explicitly\x20with\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20<your-app-url>`.','ZamGh','prompt','EXeuU','tunnel_login_request','xNaiu','goto','stringify','\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','sQwrT','\x20(If\x20you\x20meant\x20a\x20profile,\x20use\x20--profile.)','loginInstructions','storageStatePath','domains','qHKbE','targetUrl','\x22\x20for\x20','POST','qRFpR','headers','\x22,\x20and\x20cloud\x20sessions\x20don\x27t\x20apply\x20to\x20localhost.\x0a','\x20\x20Cloud\x20profile\x20\x22','RANGER_TEST_USERNAME','close','\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','ZopbW','smewc','environments','statusText','Puukj','\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','split','\x20\x20Login\x20successful.\x20Session\x20cached.','pw_endpoint','XAsxS','force','\x20\x20forceLogin\x20enabled\x20for\x20\x22','1239940DScTKw','pendingLocalConnections','beSYF','\x22\x20is\x20bound\x20to\x20auth\x20env\x20\x22','settings','56lcyFiM','Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20(','17586184pfzrbp','sPLEo','zePGR','clientIp','tunnel','CWUKI','mDmWg','ANbhs','174013oKoWAP','\x20\x20•\x20or\x20pass\x20--env\x20<key>\x20to\x20run\x20an\x20automated\x20login\x20for\x20this\x20target.','RANGER_TUNNEL_LOGIN_HEADED','\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20','KcrvR','defaultEnvironmentKey','WxIaN','sessionId','password','Cloud\x20profile\x20\x22','WEJAS','/api/v1/profiles','3346630qBvKLt','2doNThf','qjxyi','4344678gCOkxJ','utf-8','tunnelUrl','message','environmentKey','status','/api/v1/profiles/','replace','uioKG','\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.','tunnel_login_setup','success','vAIOF','\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22','\x20\x20-\x20pass\x20`--env\x20<key>`\x20to\x20pick\x20the\x20auth\x20environment\x20by\x20name,\x20or\x0a','RANGER_TEST_PASSWORD','LdbgX','\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20','CaGdn','activeLocalConnections','string','not_configured','\x20\x20Cached\x20session\x20for\x20\x22','\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22','urFBf','telemetry','\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20','auth_config','Tunnel\x20bridge\x20closed\x20before\x20login\x20completed\x20for\x20','tunnel_bridge','jDgQq','Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','raw','connectionId','persistSessionState','Gdxcc','API\x20request\x20','application/json','kphaU','tunnel_login_cleanup','cli:manual-login','XSgff','toLowerCase','vkecR','Bqozt','\x22\x20but\x20this\x20run\x20resolved\x20env\x20\x22','\x20\x20Server-side\x20login\x20error:\x20','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','newContext','keys','1|2|4|3|0','1819890XtWbFI','wAJvN','\x20--url\x20','isArray','IehaO','name','\x20\x20Created\x20cloud\x20profile\x20\x22','\x20\x20Cloud\x20session\x20for\x20\x22','/session','or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.','JOeGo','HzCvy','\x22.\x0a','test_output','json','Auth\x20environment\x20\x22','opgFC','\x20\x20No\x20live\x20session\x20for\x20\x22','No\x20saved\x20session\x20for\x20\x22','vFIdR','DELETE','mjBGa','\x22;\x20proceeding\x20with\x20loginInstructions.','vxUCF','Multiple\x20auth\x20environments\x20declare\x20this\x20host\x20(','/api/v1/tunnel/sessions','gRfat','ambiguous','zbuNS','assertedEnv','10afDxNI','session_state','PKAKV','forceLogin','push','sessionCheckPath','TEEgV','/api/v1/profiles/auth-config','\x20(auth\x20env:\x20','join','log','OZJjE','error','some','launch','toISOString','\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.','invalidateOn','PtHqW','userAgent','OHpNp','\x22\x20not\x20found\x20in\x20your\x20org\x27s\x20config.','catch','ulzPT','pwEndpoint','trim','origin','length'];_0x58f3=function(){return _0x3cf68b;};return _0x58f3();}async function createTunnelSession(_0x5d993d){const _0x17adfa=_0x5559ee,_0x11f004={'Teqrz':_0x17adfa(0x109),'uioKG':'agent'};return await apiRequest(_0x11f004['Teqrz'],{'method':_0x17adfa(0x152),'body':JSON['stringify']({'targetUrl':_0x5d993d,'mode':_0x11f004[_0x17adfa(0x18c)]})});}async function deleteTunnelSession(_0x271610){const _0x457044=_0x5559ee;await apiRequest('/api/v1/tunnel/sessions/'+_0x271610,{'method':_0x457044(0x104)});}export function pickAdHocEnvKey(_0x55171d,_0x3e4cda,_0x26d5a4){const _0x22db04=_0x5559ee,_0x46a957={'LdbgX':function(_0x3a2ce4,_0x1440b2){return _0x3a2ce4+_0x1440b2;},'HFVHF':function(_0x19b63f,_0xabbb85,_0x16b673){return _0x19b63f(_0xabbb85,_0x16b673);},'XSgff':function(_0x39dd18,_0x306416,_0x3fdd03){return _0x39dd18(_0x306416,_0x3fdd03);},'ZopbW':function(_0x1d8dc6,_0x56be80){return _0x1d8dc6 in _0x56be80;},'vxUCF':_0x22db04(0x10b),'fVJtS':function(_0x278651,_0x213561){return _0x278651(_0x213561);},'saCgY':function(_0x53a464,_0x277349){return _0x53a464+_0x277349;},'Bqozt':function(_0x5c6df3,_0x884d85){return _0x5c6df3+_0x884d85;},'TEEgV':function(_0x25951e,_0x575913){return _0x25951e===_0x575913;},'ESjkS':function(_0xfeefd0,_0x1741e0){return _0xfeefd0===_0x1741e0;}};if(_0x26d5a4){if(!_0x55171d?.[_0x22db04(0x15c)]?.[_0x26d5a4]){const _0x37911b=Object['keys'](_0x55171d?.[_0x22db04(0x15c)]??{});throw new Error(_0x46a957[_0x22db04(0x194)](_0x22db04(0xff)+_0x26d5a4+_0x22db04(0x123),_0x37911b[_0x22db04(0x129)]?'\x20Available:\x20'+_0x37911b[_0x22db04(0x117)](',\x20')+'.':'\x20Your\x20org\x20has\x20no\x20auth\x20environments\x20configured.')+_0x22db04(0x14b));}return _0x26d5a4;}if(!_0x55171d)return null;if(_0x3e4cda){const _0x5a300f=_0x46a957[_0x22db04(0x138)](matchAuthEnvironmentExact,_0x3e4cda,_0x55171d);if(_0x5a300f)return _0x5a300f;const _0x12dc1e=_0x46a957[_0x22db04(0xe6)](matchAuthEnvironmentByHost,_0x3e4cda,_0x55171d);if(_0x12dc1e&&'key'in _0x12dc1e)return console['log']('\x20\x20Auth\x20env\x20\x22'+_0x12dc1e['key']+'\x22\x20matched\x20by\x20host\x20for\x20'+_0x3e4cda+'\x20(declared\x20port\x20differs;\x20pass\x20--env\x20to\x20override).'),_0x12dc1e['key'];if(_0x12dc1e&&_0x46a957[_0x22db04(0x15a)](_0x46a957[_0x22db04(0x107)],_0x12dc1e))throw new Error(_0x22db04(0x108)+_0x12dc1e[_0x22db04(0x10b)]['join'](',\x20')+_0x22db04(0x12a));if(_0x46a957['fVJtS'](needsTunnel,_0x3e4cda))throw new Error(_0x46a957['LdbgX'](_0x46a957['saCgY'](_0x46a957[_0x22db04(0xe9)](_0x22db04(0x13d)+_0x3e4cda+_0x22db04(0xfc)+'\x20\x20Ranger\x20can\x27t\x20assume\x20your\x20org\x27s\x20default\x20login\x20flow\x20applies\x20to\x20an\x20arbitrary\x20local\x20app.\x0a'+'\x20\x20Options:\x0a',_0x22db04(0x192)),'\x20\x20-\x20ask\x20your\x20Ranger\x20admin\x20to\x20add\x20\x22'+_0x3e4cda[_0x22db04(0x18b)](/\/+$/,'')+'\x22\x20to\x20the\x20matching\x20auth\x20environment\x27s\x20domains,\x20or\x0a'),'\x20\x20-\x20run\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20'+_0x3e4cda+'\x20--skip-auth`\x20for\x20an\x20unauthenticated\x20profile.'));}if(_0x55171d['defaultEnvironmentKey'])return _0x55171d[_0x22db04(0x17a)];const _0x5bb8f8=Object['keys'](_0x55171d[_0x22db04(0x15c)]??{});if(_0x46a957[_0x22db04(0x114)](_0x5bb8f8['length'],0x1))return _0x5bb8f8[0x0];if(_0x46a957['ESjkS'](_0x5bb8f8[_0x22db04(0x129)],0x0))return null;throw new Error(_0x22db04(0x16c)+_0x5bb8f8['join'](',\x20')+').\x20'+_0x22db04(0x141));}export function adHocProfileName(_0xa812b4,_0x15ace7,_0x404505){const _0x3eed7e={'ztQKr':function(_0x58be4b,_0x357e78){return _0x58be4b===_0x357e78;}};if(!_0x15ace7||_0x3eed7e['ztQKr'](_0x15ace7,_0x404505))return _0xa812b4;return _0xa812b4+':'+_0x15ace7;}export async function resolveAdHocProfile(_0x10bbd8={},_0x225132=process[_0x5559ee(0x13a)]){const _0x64d92d=_0x5559ee,_0x323641={'mjBGa':function(_0x5bfa6f,_0x2d5d8e,_0x5354f7,_0x538558){return _0x5bfa6f(_0x2d5d8e,_0x5354f7,_0x538558);},'KWaqL':function(_0x32040f,_0x3d31a5){return _0x32040f&&_0x3d31a5;},'qHKbE':function(_0x579f11,_0x57c30e){return _0x579f11!==_0x57c30e;},'FIRov':'none'},_0x554c52=_0x225132[_0x64d92d(0x157)];if(!_0x554c52)return null;const _0x65daed=await fetchAuthConfig(),_0x5025ce=pickAdHocEnvKey(_0x65daed,_0x10bbd8['targetUrl'],_0x10bbd8['envKey']);let _0x5154bd=_0x323641[_0x64d92d(0x105)](adHocProfileName,_0x554c52,_0x5025ce,_0x65daed?.[_0x64d92d(0x17a)]),_0x5bec82=await fetchCloudProfile(_0x5154bd);_0x323641['KWaqL'](_0x5bec82,_0x5025ce)&&_0x323641[_0x64d92d(0x14f)](_0x5bec82[_0x64d92d(0x188)],_0x5025ce)&&(console[_0x64d92d(0x118)](_0x64d92d(0x156)+_0x5154bd+_0x64d92d(0x169)+(_0x5bec82['environmentKey']??_0x323641['FIRov'])+_0x64d92d(0xea)+_0x5025ce+'\x22;\x20using\x20\x22'+_0x554c52+':'+_0x5025ce+'\x22\x20instead.'),_0x5154bd=_0x554c52+':'+_0x5025ce,_0x5bec82=await fetchCloudProfile(_0x5154bd));if(_0x5bec82)return{'name':_0x5bec82['name'],'profile':_0x5bec82};const _0x35596e=_0x225132[_0x64d92d(0x193)],_0x1d1f14=await createCloudProfile(_0x5154bd,_0x5025ce??undefined,{'username':_0x554c52,'password':_0x35596e});return console['log'](_0x64d92d(0xf6)+_0x1d1f14[_0x64d92d(0xf5)]+_0x64d92d(0x151)+_0x554c52+(_0x5025ce?_0x64d92d(0x116)+_0x5025ce+')':'')),{'name':_0x1d1f14['name'],'profile':_0x1d1f14};}export async function writeSessionToLocalCache(_0x2d7ece,_0x2ff446,_0x2b9a7d,_0x3215e6,_0xc538dd,_0x21ad3a,_0x1406e8){const _0x26073d=_0x5559ee,_0x3a2ec3={'wikWL':function(_0x2c4ed7,_0x17585f,_0x4254d3){return _0x2c4ed7(_0x17585f,_0x4254d3);},'CaGdn':function(_0x4a1be6){return _0x4a1be6();},'smewc':'auth','WxIaN':function(_0x65eded,_0x3a714f){return _0x65eded>_0x3a714f;},'sTkqO':function(_0x271896,_0x1325a1,_0x192e21){return _0x271896(_0x1325a1,_0x192e21);}},_0xd05117=sessionCacheHash({'orgId':_0x2ff446,'profileName':_0x2d7ece,'effectiveBaseUrl':_0x2b9a7d,'setupHeaders':_0x3215e6,'invalidateOn':_0x1406e8?.['invalidateOn'],'userAgent':_0x1406e8?.['userAgent'],'clientIp':_0x1406e8?.['clientIp']}),_0x1e9518=_0x3a2ec3['wikWL'](getSessionCachePath,_0xd05117,_0x2d7ece),_0x95a1b3=join(_0x3a2ec3[_0x26073d(0x196)](getRangerHomeDir),_0x3a2ec3[_0x26073d(0x15b)]);!existsSync(_0x95a1b3)&&await mkdir(_0x95a1b3,{'recursive':!![]});const _0x163561={..._0xc538dd};_0x21ad3a&&_0x3a2ec3[_0x26073d(0x17b)](_0x21ad3a[_0x26073d(0x129)],0x0)&&Array[_0x26073d(0xf3)](_0x163561['cookies'])&&(_0x163561['cookies']=_0x3a2ec3['sTkqO'](duplicateCookiesForDomains,_0x163561['cookies'],_0x21ad3a));const _0x125ba2={'cached_at':new Date()[_0x26073d(0x11d)](),'session_state':_0x163561};await writeFile(_0x1e9518,JSON['stringify'](_0x125ba2,null,0x2));const _0x571599=getStorageStatePath(_0x1e9518);return await writeFile(_0x571599,JSON[_0x26073d(0x148)](_0x163561,null,0x2)),_0x571599;}export async function checkLocalCache(_0x5b8d86,_0x3ebb1d,_0x119e76,_0x23c23c,_0x23666f){const _0x220560=_0x5559ee,_0xd1c576={'KHgGl':function(_0x2f1038,_0x2377e6){return _0x2f1038(_0x2377e6);},'fucXS':function(_0x5c831b,_0x4f741e){return _0x5c831b(_0x4f741e);},'HzCvy':function(_0x55b17b,_0x374fb9,_0xe46aeb){return _0x55b17b(_0x374fb9,_0xe46aeb);}},_0x4d2131=_0xd1c576['KHgGl'](sessionCacheHash,{'orgId':_0x3ebb1d,'profileName':_0x5b8d86,'effectiveBaseUrl':_0x119e76,'setupHeaders':_0x23c23c,'invalidateOn':_0x23666f?.[_0x220560(0x11f)],'userAgent':_0x23666f?.['userAgent'],'clientIp':_0x23666f?.[_0x220560(0x170)]}),_0xef29e8=getSessionCachePath(_0x4d2131,_0x5b8d86),_0x498b42=getStorageStatePath(_0xef29e8);if(!existsSync(_0xef29e8)||!_0xd1c576['fucXS'](existsSync,_0x498b42))return null;try{const _0x3f1f1d=await _0xd1c576[_0x220560(0xfb)](readFile,_0xef29e8,_0x220560(0x185));return JSON['parse'](_0x3f1f1d),{'storageStatePath':_0x498b42};}catch{return null;}}function launchRealBrowser(){const _0x35a1f3=_0x5559ee;return chromium[_0x35a1f3(0x11c)]({'headless':!![]});}function emitSessionValidationHint(_0xef48d,_0x571ba9){const _0x5b5db1=_0x5559ee,_0x33981f={'kphaU':function(_0x2c4376,_0x480de7){return _0x2c4376===_0x480de7;},'zePGR':function(_0x194f0f,_0x5484c2){return _0x194f0f+_0x5484c2;}};if(!_0x571ba9||!_0x571ba9['domains']?.[_0x5b5db1(0x129)])return;let _0x1adc56;try{_0x1adc56=new URL(_0xef48d);}catch{return;}const _0x349f27=[];for(const _0x428eea of _0x571ba9[_0x5b5db1(0x14e)]){try{_0x349f27[_0x5b5db1(0x112)]({'raw':_0x428eea,'url':new URL(_0x428eea)});}catch{}}if(_0x33981f[_0x5b5db1(0xe3)](_0x349f27[_0x5b5db1(0x129)],0x0))return;if(_0x349f27[_0x5b5db1(0x11b)](_0x4dc7cd=>_0x4dc7cd['url'][_0x5b5db1(0x128)]===_0x1adc56[_0x5b5db1(0x128)]))return;const _0x4c37b6=_0x349f27['map'](_0x23b4d5=>'\x22'+_0x23b4d5[_0x5b5db1(0xdd)]+'\x22')[_0x5b5db1(0x117)](',\x20');console[_0x5b5db1(0x118)](_0x33981f[_0x5b5db1(0x16f)](_0x5b5db1(0x195)+_0x4c37b6+';\x20'+('you\x27re\x20now\x20at\x20\x22'+_0xef48d+_0x5b5db1(0x178)),'If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.'));}export async function serverSideLogin(_0x50da25,_0x51878c){const _0x2d50ea=_0x5559ee,_0x8d217a={'RAdyq':function(_0x2116e7,_0x3abdda){return _0x2116e7 instanceof _0x3abdda;},'Vbjce':function(_0x5e1cf6,_0x587b59){return _0x5e1cf6===_0x587b59;}},_0x2c8ed5=process['env'][_0x2d50ea(0x157)],_0x585f34=process[_0x2d50ea(0x13a)]['RANGER_TEST_PASSWORD'],_0xfeff5a={};if(_0x2c8ed5)_0xfeff5a[_0x2d50ea(0x137)]=_0x2c8ed5;if(_0x585f34)_0xfeff5a[_0x2d50ea(0x17d)]=_0x585f34;if(_0x51878c?.['force'])_0xfeff5a[_0x2d50ea(0x164)]=!![];if(_0x51878c?.['targetUrl'])_0xfeff5a['target_url']=_0x51878c[_0x2d50ea(0x150)];if(_0x51878c?.['env'])_0xfeff5a['env']=_0x51878c['env'];_0x51878c?.[_0x2d50ea(0x171)]&&(_0xfeff5a['tunnel_session_id']=_0x51878c[_0x2d50ea(0x171)]['sessionId'],_0xfeff5a[_0x2d50ea(0x162)]=_0x51878c['tunnel']['pwEndpoint']);try{return await apiRequest(_0x2d50ea(0x18a)+encodeURIComponent(_0x50da25)+'/login',{'method':'POST','body':JSON['stringify'](_0xfeff5a)});}catch(_0x4d8341){if(_0x8d217a['RAdyq'](_0x4d8341,ApiError)&&_0x8d217a['Vbjce'](_0x4d8341['status'],0x190)&&_0x4d8341[_0x2d50ea(0x134)]===_0x2d50ea(0x199))return{'status':_0x2d50ea(0x199),'error':_0x4d8341[_0x2d50ea(0x12b)]};throw _0x4d8341;}}async function serverSideLoginWithOptionalTunnel(_0x190e70,_0x1ea45c,_0x50fbe7={}){const _0x25cfa5=_0x5559ee,_0x367bb3={'QauNC':function(_0x2e5462,_0x30e26f){return _0x2e5462(_0x30e26f);},'ueMiw':function(_0xc8466f,_0x468407){return _0xc8466f(_0x468407);},'rSMRg':function(_0x4d1961,_0x52f706){return _0x4d1961(_0x52f706);},'KcrvR':_0x25cfa5(0x13e),'beSYF':'tunnel_login_setup','XAsxS':_0x25cfa5(0x145),'IehaO':function(_0x4cb43b,_0x5ec8b3){return _0x4cb43b??_0x5ec8b3;},'OZJjE':function(_0x48bbd5,_0x30bf7c){return _0x48bbd5||_0x30bf7c;},'mDmWg':_0x25cfa5(0xef),'vFIdR':function(_0x3c50e0,_0x41f15f){return _0x3c50e0(_0x41f15f);}};if(!_0x367bb3[_0x25cfa5(0x13f)](needsTunnel,_0x1ea45c))return await serverSideLogin(_0x190e70,{'force':_0x50fbe7['force'],'env':_0x50fbe7[_0x25cfa5(0x13a)]});let _0x44e7dc=null,_0x5cc2da=null,_0x5e9f00=null,_0x118709=null,_0x5bf4e0=![];const _0x3cfc1a=process['env'][_0x25cfa5(0x177)]?.[_0x25cfa5(0xe7)](),_0x3ac0d2=_0x3cfc1a==='1'||_0x3cfc1a==='true',_0x401a80={'profileName':_0x190e70,'targetUrlHost':targetHostForTelemetry(_0x1ea45c),'tunnelRequired':!![],'forceLogin':_0x367bb3[_0x25cfa5(0x132)](Boolean,_0x50fbe7['force']),'localBrowserServerHeaded':_0x3ac0d2};try{_0x50fbe7['telemetry']?.[_0x25cfa5(0x136)](_0x25cfa5(0x18e),_0x401a80);_0x3ac0d2&&console['log'](_0x367bb3[_0x25cfa5(0x179)]);_0x44e7dc=await launchBrowserServer({'headless':!_0x3ac0d2}),_0x5cc2da=await createTunnelSession(_0x1ea45c);const _0x1cf270=await requireToken();_0x5e9f00=await _0x367bb3['rSMRg'](createTunnelBridge,{'localWsUrl':_0x44e7dc['wsEndpoint'],'tunnelServerUrl':_0x5cc2da[_0x25cfa5(0x186)],'sessionId':_0x5cc2da[_0x25cfa5(0x17c)],'apiKey':_0x1cf270,'onError':_0x21da8b=>{_0x118709=_0x21da8b;},'onClose':()=>{const _0x421ad4=_0x25cfa5;_0x118709??=new Error(_0x421ad4(0x1a0)+_0x190e70);},'onEvent':_0x3ad3fb=>trackBridgeEvent(_0x50fbe7['telemetry'],_0x3ad3fb)}),_0x50fbe7[_0x25cfa5(0x19d)]?.[_0x25cfa5(0x12e)](_0x367bb3[_0x25cfa5(0x168)],{..._0x401a80,'tunnelSessionId':_0x5cc2da[_0x25cfa5(0x17c)],'localBrowserServer':!![],'localBrowserServerHeaded':_0x3ac0d2}),_0x5bf4e0=!![];try{return _0x50fbe7['telemetry']?.[_0x25cfa5(0x136)](_0x367bb3[_0x25cfa5(0x163)],{..._0x401a80,'tunnelSessionId':_0x5cc2da[_0x25cfa5(0x17c)]}),await serverSideLogin(_0x190e70,{'force':_0x50fbe7[_0x25cfa5(0x164)],'targetUrl':_0x1ea45c,'env':_0x50fbe7[_0x25cfa5(0x13a)],'tunnel':{'sessionId':_0x5cc2da[_0x25cfa5(0x17c)],'pwEndpoint':_0x5cc2da[_0x25cfa5(0x126)]}})['then'](_0x514575=>{const _0x524eb5=_0x25cfa5;return _0x50fbe7[_0x524eb5(0x19d)]?.['trackPhaseEnd'](_0x524eb5(0x145),{..._0x401a80,'tunnelSessionId':_0x5cc2da?.[_0x524eb5(0x17c)],'loginStatus':_0x514575['status'],'hasSessionState':Boolean(_0x514575['session_state']),'hasTestOutput':Boolean(_0x514575['test_output']),'bridgeError':_0x367bb3['QauNC'](errorMessageForTelemetry,_0x118709)}),_0x514575;});}catch(_0x53980d){await _0x50fbe7[_0x25cfa5(0x19d)]?.['trackPhaseError'](_0x367bb3[_0x25cfa5(0x163)],_0x367bb3[_0x25cfa5(0xf4)](_0x118709,_0x53980d),{..._0x401a80,'tunnelSessionId':_0x5cc2da['sessionId'],'bridgeError':errorMessageForTelemetry(_0x118709)});throw _0x118709??_0x53980d;}}catch(_0x59227e){!_0x5bf4e0&&await _0x50fbe7[_0x25cfa5(0x19d)]?.['trackPhaseError'](_0x367bb3[_0x25cfa5(0x168)],_0x59227e,{..._0x401a80,'tunnelSessionId':_0x5cc2da?.['sessionId']});throw _0x59227e;}finally{if(_0x367bb3[_0x25cfa5(0x119)](_0x5cc2da,_0x44e7dc)||_0x5e9f00){const _0x27309a=_0x367bb3[_0x25cfa5(0x173)]['split']('|');let _0x303dff=0x0;while(!![]){switch(_0x27309a[_0x303dff++]){case'0':_0x50fbe7['telemetry']?.['trackPhaseEnd'](_0x25cfa5(0xe4),{..._0x401a80,'tunnelSessionId':_0x5cc2da?.[_0x25cfa5(0x17c)]});continue;case'1':_0x50fbe7['telemetry']?.[_0x25cfa5(0x136)]('tunnel_login_cleanup',{..._0x401a80,'tunnelSessionId':_0x5cc2da?.['sessionId']});continue;case'2':_0x5e9f00?.[_0x25cfa5(0x158)]();continue;case'3':_0x5cc2da&&await _0x367bb3[_0x25cfa5(0x103)](deleteTunnelSession,_0x5cc2da['sessionId'])[_0x25cfa5(0x124)](()=>{});continue;case'4':_0x44e7dc&&await _0x44e7dc['close']()[_0x25cfa5(0x124)](()=>{});continue;}break;}}}}function _0xa37e(_0x14b89c,_0x5e5394){_0x14b89c=_0x14b89c-0xdc;const _0x58f312=_0x58f3();let _0xa37e27=_0x58f312[_0x14b89c];return _0xa37e27;}export async function manualBrowserLogin(_0x21fc7a,_0x50dff2,_0x10f291={}){const _0x1f752f=_0x5559ee,_0x5cd8dd={'PKAKV':function(_0x4fd2a8,_0x16610a){return _0x4fd2a8(_0x16610a);},'OHpNp':function(_0x196ffa,_0x539d9b,_0x4be43d){return _0x196ffa(_0x539d9b,_0x4be43d);},'vkecR':function(_0x22e1c7,_0x411113){return _0x22e1c7+_0x411113;},'ltEsv':'about:blank','Gdxcc':'\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','Ugflz':_0x1f752f(0x149),'PjxSb':'Browser\x20login\x20timed\x20out\x20before\x20completion.','GMcta':'POST','PtHqW':_0x1f752f(0xe5)};if(!isInteractive())throw new Error(_0x5cd8dd[_0x1f752f(0xe8)](_0x5cd8dd['vkecR']('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0x21fc7a[_0x1f752f(0xf5)]+_0x1f752f(0xfc),'\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20'),_0x1f752f(0xf9)));const _0xd2fd86=_0x50dff2&&_0x50dff2[_0x1f752f(0x14e)]['length']>0x0?_0x50dff2[_0x1f752f(0x14e)][0x0]:_0x5cd8dd['ltEsv'];console['log'](_0x5cd8dd[_0x1f752f(0xe0)]),console['log'](_0x5cd8dd['Ugflz']),await new Promise(_0x50194a=>setTimeout(_0x50194a,0x7d0));const _0xe6b897=await chromium['launch']({'headless':![]});let _0x48cc24=null;try{const _0xd0f4dc={'ignoreHTTPSErrors':!![]};_0x50dff2?.['setupHeaders']&&(_0xd0f4dc['extraHTTPHeaders']=_0x50dff2['setupHeaders']);const _0x2cdeb1=await _0xe6b897[_0x1f752f(0xed)](_0xd0f4dc);await addProfileSetupBanner(_0x2cdeb1);const _0x319016=await _0x2cdeb1[_0x1f752f(0x13b)]();await _0x319016[_0x1f752f(0x147)](_0xd2fd86);let _0x3084b9=![];await new Promise(_0x4085a9=>{const _0x377ebf={'gRfat':function(_0x491d19,_0x4e2f37){const _0x3f8e2e=_0xa37e;return _0x5cd8dd[_0x3f8e2e(0x110)](_0x491d19,_0x4e2f37);}},_0x3e9e51=_0x5cd8dd['OHpNp'](setTimeout,()=>{const _0xb48c68=_0xa37e;_0x3084b9=!![],console['error']('Browser\x20login\x20timed\x20out\x20after\x20'+MANUAL_LOGIN_TIMEOUT_MS/0xea60+_0xb48c68(0x11e)),_0x4085a9();},MANUAL_LOGIN_TIMEOUT_MS);_0x319016['on']('close',async()=>{const _0x1dc1a9=_0xa37e;_0x377ebf[_0x1dc1a9(0x10a)](clearTimeout,_0x3e9e51);try{const _0x22f904=await _0x2cdeb1['storageState']();_0x48cc24=_0x22f904;}catch{}_0x4085a9();});});if(_0x3084b9&&!_0x48cc24)throw new Error(_0x5cd8dd[_0x1f752f(0x139)]);}finally{await _0xe6b897['close']()[_0x1f752f(0x124)](()=>{});}if(!_0x48cc24)throw new Error('Browser\x20closed\x20before\x20authentication\x20was\x20saved.');return _0x10f291[_0x1f752f(0xdf)]!==![]&&await _0x5cd8dd[_0x1f752f(0x122)](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x21fc7a['name'])+_0x1f752f(0xf8),{'method':_0x5cd8dd['GMcta'],'body':JSON['stringify']({'session_state':_0x48cc24,'updated_by':_0x5cd8dd[_0x1f752f(0x120)]})}),{'sessionState':_0x48cc24};}export async function promptSaveCredentials(_0x408fa9){const _0x47d7e5=_0x5559ee,_0x365c2b={'yaRfW':function(_0x261332,_0x2a4730){return _0x261332||_0x2a4730;},'sQwrT':'confirm','PLQuB':_0x47d7e5(0xdc),'BkHOH':function(_0xae8abe,_0x100e8d,_0xbbde92){return _0xae8abe(_0x100e8d,_0xbbde92);}},_0x42bdd2=process[_0x47d7e5(0x13a)][_0x47d7e5(0x157)],_0xfa5470=process[_0x47d7e5(0x13a)]['RANGER_TEST_PASSWORD'];if(_0x365c2b['yaRfW'](!_0x42bdd2,!_0xfa5470))return;if(!isInteractive())return;const {save:_0x2cf52a}=await _0x1bca08[_0x47d7e5(0x143)]([{'type':_0x365c2b[_0x47d7e5(0x14a)],'name':'save','message':_0x365c2b['PLQuB'],'default':![]}]);if(!_0x2cf52a)return;await _0x365c2b['BkHOH'](apiRequest,_0x47d7e5(0x18a)+encodeURIComponent(_0x408fa9),{'method':'PUT','body':JSON['stringify']({'username':_0x42bdd2,'password':_0xfa5470})}),console['log'](_0x47d7e5(0x18d));}export async function resolveCloudProfileSession(_0x23042f,_0x6e9bb0={}){const _0x505300=_0x5559ee,_0x571b87={'kzoQY':function(_0x44bbcb,_0x1fc708){return _0x44bbcb===_0x1fc708;},'Puukj':'string','ZamGh':function(_0x5785c5,_0x5089d2){return _0x5785c5===_0x5089d2;},'ulzPT':function(_0x12a0fd,_0xc47f3c){return _0x12a0fd(_0xc47f3c);},'xdcZL':function(_0x1eebf9,_0x2b7497,_0x5a2f5d,_0x20156d,_0x192f95,_0x4e0a46){return _0x1eebf9(_0x2b7497,_0x5a2f5d,_0x20156d,_0x192f95,_0x4e0a46);},'LPEnT':function(_0x44df95,_0x3f63aa,_0xf418bf,_0x3b603b,_0x390385){return _0x44df95(_0x3f63aa,_0xf418bf,_0x3b603b,_0x390385);},'WJYfr':function(_0x55cbbc,_0x13b18d,_0x8ee172){return _0x55cbbc(_0x13b18d,_0x8ee172);},'wAJvN':function(_0x1cf751,_0x2275a3,_0x466386,_0x244feb,_0x4d90bc,_0x12849e,_0x18ff78,_0x339b53){return _0x1cf751(_0x2275a3,_0x466386,_0x244feb,_0x4d90bc,_0x12849e,_0x18ff78,_0x339b53);},'weFxq':function(_0x1e8354,_0x6351bc,_0x2f94e2){return _0x1e8354(_0x6351bc,_0x2f94e2);},'pNitv':function(_0x292f1d,_0x5264f3){return _0x292f1d(_0x5264f3);},'pBlqI':function(_0x110e2d,_0x5cece2){return _0x110e2d(_0x5cece2);},'cbZpr':function(_0x4066ec,_0x303d08){return _0x4066ec||_0x303d08;},'CBUXf':function(_0x2731f8,_0x3a2c45){return _0x2731f8||_0x3a2c45;},'zbuNS':function(_0x306770,_0x3a10c9){return _0x306770===_0x3a10c9;},'EXeuU':_0x505300(0x18f),'CHvOA':function(_0x1072dd,_0x36c02b){return _0x1072dd&&_0x36c02b;},'jpilV':_0x505300(0x159),'mOfem':function(_0x2aeefd,_0x522d80){return _0x2aeefd instanceof _0x522d80;},'fHrPt':function(_0x15a12a,_0x3b4b5c){return _0x15a12a(_0x3b4b5c);},'ySnUj':'\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','ANbhs':function(_0x2146b6,_0x4e2d5c){return _0x2146b6+_0x4e2d5c;},'sPLEo':_0x505300(0x176),'Aobuk':function(_0xb03823,_0x11c566,_0x499494){return _0xb03823(_0x11c566,_0x499494);}},_0x50d572=_0x23042f[_0x505300(0x16a)]??{},_0x10a005=await fetchAuthConfig(),_0x554a6d=_0x10a005?resolveAuthEnvironmentLocally(_0x10a005,_0x6e9bb0['assertedEnv']??_0x23042f['environmentKey']):null,_0x524412=_0x571b87['kzoQY'](typeof _0x554a6d?.['loginInstructions'],_0x571b87[_0x505300(0x15e)])&&_0x554a6d[_0x505300(0x14c)][_0x505300(0x127)]()?_0x554a6d['loginInstructions']:undefined,_0x20ec8a=_0x571b87[_0x505300(0x142)](typeof _0x50d572['loginInstructions'],_0x571b87['Puukj'])&&_0x50d572[_0x505300(0x14c)][_0x505300(0x127)]()?_0x50d572['loginInstructions']:undefined,_0x62cbb7=_0x20ec8a||!_0x524412?_0x50d572:{..._0x50d572,'loginInstructions':_0x524412},_0x55e1f9=_0x571b87['ulzPT'](Boolean,_0x62cbb7['loginInstructions']?.['trim']()),_0x45b924=Boolean(_0x50d572[_0x505300(0x111)]||_0x554a6d?.[_0x505300(0x111)]),_0x5e4f26=_0x554a6d?.['domains'],_0x545c3a=_0x50d572['setupHeaders'],_0x3b4d79=_0x545c3a??_0x554a6d?.[_0x505300(0x131)],_0x372252=_0x6e9bb0['effectiveBaseUrl']??_0x50d572['baseUrl']??(_0x5e4f26&&_0x5e4f26['length']>0x0?_0x5e4f26[0x0]:''),_0x1f6d93=_0x372252?needsTunnel(_0x372252):![],_0xd8c048={'invalidateOn':_0x554a6d?.[_0x505300(0x11f)],'userAgent':_0x554a6d?.['browserOptions']?.[_0x505300(0x121)]??_0x50d572[_0x505300(0x121)]};_0x45b924&&console[_0x505300(0x118)](_0x505300(0x165)+_0x23042f[_0x505300(0xf5)]+'\x22,\x20refreshing\x20session...');if(!_0x45b924){const _0x9fb2ed=await _0x571b87[_0x505300(0x135)](checkLocalCache,_0x23042f[_0x505300(0xf5)],_0x23042f['organizationId'],_0x372252,_0x3b4d79,_0xd8c048);if(_0x9fb2ed){if(_0x372252&&!_0x1f6d93){const _0x2f1676=await _0x571b87['LPEnT'](isCachedSessionLive,_0x9fb2ed[_0x505300(0x14d)],_0x372252,{'sessionCheckPath':_0x554a6d?.[_0x505300(0x113)],'setupHeaders':_0x3b4d79},{'launchBrowser':launchRealBrowser});if(_0x2f1676)return console['log'](_0x505300(0x191)+_0x23042f['name']+'\x22'),{'authPath':_0x9fb2ed[_0x505300(0x14d)],'settings':_0x62cbb7,'resolvedEnv':_0x554a6d};console[_0x505300(0x118)](_0x505300(0x19a)+_0x23042f[_0x505300(0xf5)]+'\x22\x20failed\x20validation\x20—\x20refreshing...'),_0x571b87['WJYfr'](emitSessionValidationHint,_0x372252,_0x554a6d);}else return _0x1f6d93&&console[_0x505300(0x118)]('\x20\x20Using\x20cached\x20local\x20session\x20for\x20cloud\x20profile\x20\x22'+_0x23042f['name']+'\x22'),{'authPath':_0x9fb2ed[_0x505300(0x14d)],'settings':_0x62cbb7,'resolvedEnv':_0x554a6d};}}if(!_0x45b924&&_0x23042f['sessionState']){const _0x577927=await _0x571b87['wAJvN'](writeSessionToLocalCache,_0x23042f['name'],_0x23042f['organizationId'],_0x372252,_0x3b4d79,_0x23042f['sessionState'],_0x5e4f26,_0xd8c048);if(_0x372252){const _0x211792=await isCachedSessionLive(_0x577927,_0x372252,{'sessionCheckPath':_0x554a6d?.['sessionCheckPath'],'setupHeaders':_0x3b4d79},{'launchBrowser':launchRealBrowser});if(_0x211792)return console['log'](_0x505300(0x19b)+_0x23042f['name']+'\x22,\x20cached\x20locally'),{'authPath':_0x577927,'settings':_0x62cbb7,'resolvedEnv':_0x554a6d};console['log'](_0x505300(0xf7)+_0x23042f[_0x505300(0xf5)]+'\x22\x20failed\x20validation\x20—\x20re-login\x20needed...'),_0x571b87['weFxq'](emitSessionValidationHint,_0x372252,_0x554a6d);}else return{'authPath':_0x577927,'settings':_0x62cbb7,'resolvedEnv':_0x554a6d};}if(_0x55e1f9)return console['log'](_0x505300(0x101)+_0x23042f[_0x505300(0xf5)]+_0x505300(0x106)),{'authPath':undefined,'settings':_0x62cbb7,'resolvedEnv':_0x554a6d};console['log']('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x23042f['name']+'\x22,\x20attempting\x20login...');const _0x10c63c=_0x571b87['ulzPT'](Boolean,process['env'][_0x505300(0x157)])&&_0x571b87['pNitv'](Boolean,process['env'][_0x505300(0x193)]),_0x262f8a=_0x571b87['pNitv'](Boolean,_0x23042f['username']),_0x4c7d68=_0x571b87[_0x505300(0x140)](Boolean,_0x6e9bb0[_0x505300(0x10d)]),_0x533df7=_0x372252?isBareLocalhost(_0x372252):![],_0x1b8fb7=_0x571b87['cbZpr'](_0x10c63c,_0x262f8a)&&_0x571b87['CBUXf'](!_0x533df7,_0x4c7d68);if(_0x1b8fb7)try{const _0x40435d=_0x372252?await serverSideLoginWithOptionalTunnel(_0x23042f['name'],_0x372252,{'force':_0x45b924,'telemetry':_0x6e9bb0['telemetry'],'env':_0x6e9bb0['assertedEnv']}):await serverSideLogin(_0x23042f[_0x505300(0xf5)],{'force':_0x45b924,'env':_0x6e9bb0['assertedEnv']});if(_0x571b87[_0x505300(0x10c)](_0x40435d['status'],_0x505300(0x199)))console[_0x505300(0x118)](_0x505300(0x15f));else{if(_0x40435d[_0x505300(0x189)]===_0x571b87[_0x505300(0x144)]&&_0x40435d[_0x505300(0x10f)]){console[_0x505300(0x118)](_0x505300(0x161));const _0x3fce47=await writeSessionToLocalCache(_0x23042f['name'],_0x23042f[_0x505300(0x12d)],_0x372252,_0x3b4d79,_0x40435d[_0x505300(0x10f)],_0x5e4f26,_0xd8c048);return _0x571b87['CHvOA'](_0x10c63c,!_0x262f8a)&&await _0x571b87[_0x505300(0x125)](promptSaveCredentials,_0x23042f[_0x505300(0xf5)]),{'authPath':_0x3fce47,'settings':_0x62cbb7,'resolvedEnv':_0x554a6d};}else _0x40435d['test_output']&&(console[_0x505300(0x118)](_0x571b87['jpilV']),console[_0x505300(0x118)](_0x40435d[_0x505300(0xfd)])),console['log']('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}}catch(_0x49a5e7){console['log'](_0x505300(0xeb)+(_0x571b87['mOfem'](_0x49a5e7,Error)?_0x49a5e7['message']:_0x571b87['fHrPt'](String,_0x49a5e7))),console[_0x505300(0x118)](_0x571b87['ySnUj']);}if(_0x571b87['CHvOA'](_0x533df7,!_0x4c7d68)&&!isInteractive())throw new Error(_0x571b87[_0x505300(0x174)](_0x505300(0x102)+_0x372252+'\x22\x20on\x20profile\x20\x22'+_0x23042f['name']+_0x505300(0x155)+('\x20\x20•\x20capture\x20one\x20(a\x20browser\x20opens):\x20ranger\x20profile\x20add\x20'+_0x23042f['name']+_0x505300(0xf2)+_0x372252+'\x0a'),_0x571b87[_0x505300(0x16e)]));const _0x447e11=_0x554a6d?{..._0x554a6d,'domains':_0x571b87['Aobuk'](orderLoginDomains,_0x372252,_0x554a6d[_0x505300(0x14e)]),'setupHeaders':_0x3b4d79}:_0x372252?{'key':_0x23042f[_0x505300(0x188)]??'','domains':[_0x372252],'setupHeaders':_0x3b4d79}:null,{sessionState:_0xa2a6e}=await manualBrowserLogin(_0x23042f,_0x447e11,{'persistSessionState':!_0x1f6d93}),_0x355755=await _0x571b87[_0x505300(0xf1)](writeSessionToLocalCache,_0x23042f['name'],_0x23042f['organizationId'],_0x372252,_0x3b4d79,_0xa2a6e,_0x5e4f26,_0xd8c048);return{'authPath':_0x355755,'settings':_0x62cbb7,'resolvedEnv':_0x554a6d};}
1
+ const _0x2bae3a=_0x1947;(function(_0x500238,_0x4633c1){const _0x3173d9=_0x1947,_0x4551ce=_0x500238();while(!![]){try{const _0x579f02=-parseInt(_0x3173d9(0x1f7))/0x1*(-parseInt(_0x3173d9(0x14e))/0x2)+-parseInt(_0x3173d9(0x200))/0x3+-parseInt(_0x3173d9(0x1bf))/0x4*(-parseInt(_0x3173d9(0x196))/0x5)+-parseInt(_0x3173d9(0x1f0))/0x6*(parseInt(_0x3173d9(0x1d3))/0x7)+-parseInt(_0x3173d9(0x170))/0x8*(parseInt(_0x3173d9(0x172))/0x9)+-parseInt(_0x3173d9(0x1a8))/0xa*(-parseInt(_0x3173d9(0x1a1))/0xb)+parseInt(_0x3173d9(0x146))/0xc;if(_0x579f02===_0x4633c1)break;else _0x4551ce['push'](_0x4551ce['shift']());}catch(_0x169fe2){_0x4551ce['push'](_0x4551ce['shift']());}}}(_0x320f,0x96b2f));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x4e34ea from'inquirer';import{chromium}from'playwright';import{getApiBaseUrl}from'./environment.js';import{getToken}from'./keychain.js';function _0x320f(){const _0x210ddf=['uFWsi','No\x20saved\x20session\x20for\x20\x22','launch','forceLogin','205475fgmXLi','tunnel_login_cleanup','tunnel_login_setup','API\x20request\x20','rpJBl','cli:manual-login','reason','split','\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22','status','yStzg','11WAFUtQ','RIhmL','RhiPT','\x22\x20on\x20profile\x20\x22',');\x20pass\x20--env\x20<key>\x20to\x20pick\x20one.','WRQKB','agent','7193930WVvHHB','sessionId','absWR','xRYjC','password','Tunnel\x20bridge\x20closed\x20before\x20login\x20completed\x20for\x20','setupHeaders','):\x20','about:blank','pw_endpoint','\x22\x20failed\x20validation\x20—\x20refreshing...','\x22\x20for\x20','QVkel','tuCMO','PUT','elapsedMs','FFThf','No\x20auth\x20environment\x20matches\x20the\x20local\x20target\x20\x22','environmentKey','\x22,\x20and\x20cloud\x20sessions\x20don\x27t\x20apply\x20to\x20localhost.\x0a','activeLocalConnections','effectiveBaseUrl','loginInstructions','100ojqEHd','error','NwQXb','userAgent','confirm','kDKSh','settings','tunnel_session_id','username','clientIp','HBHfw','\x22\x20not\x20found\x20in\x20your\x20org\x27s\x20config.','Mknwo','you\x27re\x20now\x20at\x20\x22','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','Auth\x20environment\x20\x22','Tyqts','length','pendingLocalConnections','kSGoH','7yiNfXc','string','Pass\x20--base-url\x20<your-app-url>\x20so\x20Ranger\x20can\x20match\x20the\x20right\x20one,\x20or\x20create\x20the\x20profile\x20explicitly\x20with\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20<your-app-url>`.','aVMzA','oSUmi','some','or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.','cookies','POST','wcyNn','WAios','\x22\x20not\x20found.','assertedEnv','\x22,\x20attempting\x20login...','trackPhaseError','FUejt','invalidateOn','\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','Browser\x20login\x20timed\x20out\x20after\x20','\x20\x20Options:\x0a','catch','pwgux','environments','ugPqO','jngPP','trackPhaseEnd','uFbef','\x22\x20but\x20this\x20run\x20resolved\x20env\x20\x22','RWGGR','3697932GLrRrR','env','/session','wDSbL','ambiguous','\x20failed\x20(','RANGER_TUNNEL_LOGIN_HEADED','5901cvDHLM','\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','CbbZM','/api/v1/profiles','headers','xTwoD','\x20(declared\x20port\x20differs;\x20pass\x20--env\x20to\x20override).','log','code','2816991JLLpPO','\x22\x20matched\x20by\x20host\x20for\x20','ApiError','qIISM','telemetry','wyxWI','domains','\x20\x20No\x20live\x20session\x20for\x20\x22','invalid-url','\x20\x20Ranger\x20can\x27t\x20assume\x20your\x20org\x27s\x20default\x20login\x20flow\x20applies\x20to\x20an\x20arbitrary\x20local\x20app.\x0a','sMqxp','If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.','10740816jXIlqH','not_configured','lzMjM','newPage','defaultEnvironmentKey','DWIAe','\x20\x20Using\x20cached\x20local\x20session\x20for\x20cloud\x20profile\x20\x22','iqena','140UBnubd','stringify','WOVpH','/api/v1/profiles/','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','persistSessionState','message','WymHJ','force','organizationId','No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22','join','\x22\x20failed\x20validation\x20—\x20re-login\x20needed...','browserOptions','DELETE','szyTS','test_output','RANGER_TEST_PASSWORD','TjuLX','trackPhaseStart','akZYr','Bearer\x20','tunnel_login_request','moAIF','sessionState','GcfCL','hqTJi','auth','\x22,\x20refreshing\x20session...','KBWFs','auth_config','\x20--skip-auth`\x20for\x20an\x20unauthenticated\x20profile.','iEHUW','targetUrl','8oLyUZH','whPuH','7940916NDiAiM','key','local_ws_error','close','LhtAg','WPYsC','Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','\x20\x20•\x20or\x20pass\x20--env\x20<key>\x20to\x20run\x20an\x20automated\x20login\x20for\x20this\x20target.','4|1|3|0|2','type','detail','origin','parse','\x20\x20forceLogin\x20enabled\x20for\x20\x22','pGGWg','\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','sessionCheckPath','name','tunnelUrl','GJMaU','storageStatePath','url','tunnel','RANGER_TEST_USERNAME','pwEndpoint','\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.','\x20\x20-\x20pass\x20`--env\x20<key>`\x20to\x20pick\x20the\x20auth\x20environment\x20by\x20name,\x20or\x0a','session_state','\x22.\x0a','HfnJY','keys','lKKms'];_0x320f=function(){return _0x210ddf;};return _0x320f();}import{getRangerHomeDir}from'./rangerRoot.js';import{addProfileSetupBanner}from'./profileSetupBanner.js';import{duplicateCookiesForDomains,getSessionCachePath,getStorageStatePath,isBareLocalhost,isCachedSessionLive,isInteractive,needsTunnel,orderLoginDomains,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';import{matchAuthEnvironmentByHost,matchAuthEnvironmentExact}from'./matchAuthEnvironment.js';function _0x1947(_0x2615ed,_0x407aed){_0x2615ed=_0x2615ed-0x143;const _0x320f8e=_0x320f();let _0x194730=_0x320f8e[_0x2615ed];return _0x194730;}import{createTunnelBridge,launchBrowserServer}from'./tunnelClient.js';function targetHostForTelemetry(_0xc5dd64){const _0x51e106=_0x1947,_0x3dba22={'YFmht':_0x51e106(0x208)};try{return new URL(_0xc5dd64)['host'];}catch{return _0x3dba22['YFmht'];}}function errorMessageForTelemetry(_0x10b199){return _0x10b199 instanceof Error?_0x10b199['message']:undefined;}function trackBridgeEvent(_0x4c0660,_0x473d42){const _0x580155=_0x1947,_0x56ed76={'mRSKI':'tunnel_error','xBLki':_0x580155(0x174)};if(!_0x4c0660)return;const _0x5f22bd={'tunnelSessionId':_0x473d42[_0x580155(0x1a9)],'tunnelEventType':_0x473d42['type'],'connectionId':_0x473d42['connectionId'],'code':_0x473d42['code'],'reason':_0x473d42[_0x580155(0x19c)],'error':_0x473d42['error'],'elapsedMs':_0x473d42[_0x580155(0x1b7)],'activeLocalConnections':_0x473d42[_0x580155(0x1bc)],'pendingLocalConnections':_0x473d42[_0x580155(0x1d1)]};_0x4c0660[_0x580155(0x1ec)]('tunnel_bridge_event',_0x5f22bd),(_0x473d42[_0x580155(0x17b)]===_0x56ed76['mRSKI']||_0x473d42['type']===_0x56ed76['xBLki'])&&void _0x4c0660['trackPhaseError']('tunnel_bridge',new Error(_0x473d42['error']??_0x473d42['type']),_0x5f22bd);}const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0x51a174=_0x1947,_0x5c5d41={'akZYr':function(_0x3fcdc4){return _0x3fcdc4();},'ZVeHa':_0x51a174(0x152)},_0x3ddf57=await _0x5c5d41[_0x51a174(0x162)](getToken);if(!_0x3ddf57)throw new Error(_0x5c5d41['ZVeHa']);return _0x3ddf57;}async function apiRequest(_0x23527b,_0x1fdebb={}){const _0x3dba36=_0x1947,_0x102222={'moAIF':function(_0x1c4ebf){return _0x1c4ebf();},'qWriF':'application/json','xEoHC':function(_0x4aa4ed,_0x2ceebe){return _0x4aa4ed===_0x2ceebe;},'uFbef':'string','wyxWI':function(_0x143984,_0xdb9a79){return _0x143984===_0xdb9a79;}},_0x320800=await requireToken(),_0x1223cd=_0x102222[_0x3dba36(0x165)](getApiBaseUrl),_0xed8ef7=await fetch(''+_0x1223cd+_0x23527b,{..._0x1fdebb,'headers':{'Authorization':_0x3dba36(0x163)+_0x320800,'Content-Type':_0x102222['qWriF'],..._0x1fdebb[_0x3dba36(0x1fb)]??{}}});if(!_0xed8ef7['ok']){let _0x3281e8='',_0x105d9a;try{const _0x59d0de=await _0xed8ef7['json'](),_0x51c140=(_0x102222['xEoHC'](typeof _0x59d0de[_0x3dba36(0x1c0)],_0x102222[_0x3dba36(0x1ed)])?_0x59d0de['error']:undefined)??JSON['stringify'](_0x59d0de);_0x3281e8=_0x51c140;_0x102222['xEoHC'](typeof _0x59d0de['test_output'],'string')&&_0x59d0de[_0x3dba36(0x15e)]&&(_0x3281e8=_0x3281e8+'\x0a'+_0x59d0de[_0x3dba36(0x15e)]);if(typeof _0x59d0de['code']===_0x3dba36(0x1d4))_0x105d9a=_0x59d0de[_0x3dba36(0x1ff)];}catch{_0x3281e8=_0xed8ef7['statusText'];}throw new ApiError(_0x3dba36(0x199)+_0x23527b+_0x3dba36(0x1f5)+_0xed8ef7['status']+_0x3dba36(0x1af)+_0x3281e8,_0xed8ef7[_0x3dba36(0x19f)],_0x3281e8,_0x105d9a);}if(_0x102222[_0x3dba36(0x205)](_0xed8ef7[_0x3dba36(0x19f)],0xcc))return undefined;return _0xed8ef7['json']();}export class ApiError extends Error{[_0x2bae3a(0x19f)];[_0x2bae3a(0x17c)];['code'];constructor(_0x53f737,_0x4c8a62,_0x3b1d76,_0x3683e8){const _0x1df507=_0x2bae3a,_0x49edcd={'RhiPT':_0x1df507(0x17a),'DNoGb':_0x1df507(0x202)},_0x18cb74=_0x49edcd[_0x1df507(0x1a3)][_0x1df507(0x19d)]('|');let _0xd2e4e0=0x0;while(!![]){switch(_0x18cb74[_0xd2e4e0++]){case'0':this['code']=_0x3683e8;continue;case'1':this['status']=_0x4c8a62;continue;case'2':this['name']=_0x49edcd['DNoGb'];continue;case'3':this[_0x1df507(0x17c)]=_0x3b1d76;continue;case'4':super(_0x53f737);continue;}break;}}}export async function fetchCloudProfile(_0x209744){const _0x14d30f=_0x2bae3a,_0x4eeddc={'WRQKB':function(_0x4749d9,_0x35d93b){return _0x4749d9(_0x35d93b);},'gHdeE':function(_0x129d21,_0x34a7b2){return _0x129d21 instanceof _0x34a7b2;}};try{return await _0x4eeddc[_0x14d30f(0x1a6)](apiRequest,_0x14d30f(0x151)+encodeURIComponent(_0x209744));}catch(_0x58f525){if(_0x4eeddc['gHdeE'](_0x58f525,ApiError)&&_0x58f525['status']===0x194)return null;throw _0x58f525;}}export async function listCloudProfiles(){const _0x133813=_0x2bae3a,_0x86e8f5={'WymHJ':function(_0x40c17b,_0x452901){return _0x40c17b(_0x452901);}},_0x5a31d5=await _0x86e8f5[_0x133813(0x155)](apiRequest,'/api/v1/profiles');return _0x5a31d5['profiles'];}export async function deleteCloudProfile(_0x429c7c){const _0x2238ec=_0x2bae3a,_0x8f4971={'GcfCL':_0x2238ec(0x15c),'uGjsA':function(_0x18d42e,_0x1a5b2f){return _0x18d42e instanceof _0x1a5b2f;},'zaDZS':function(_0x3de6f5,_0x27f23c){return _0x3de6f5===_0x27f23c;}};try{await apiRequest(_0x2238ec(0x151)+encodeURIComponent(_0x429c7c),{'method':_0x8f4971[_0x2238ec(0x167)]});}catch(_0x192f48){if(_0x8f4971['uGjsA'](_0x192f48,ApiError)&&_0x8f4971['zaDZS'](_0x192f48['status'],0x194))throw new Error('Cloud\x20profile\x20\x22'+_0x429c7c+_0x2238ec(0x1de));throw _0x192f48;}}export async function createCloudProfile(_0x4c2221,_0x48587d,_0x4048ff={}){const _0x2b061d=_0x2bae3a,_0x1fb732={'cyYec':function(_0x553fdf,_0x49783c){return _0x553fdf>_0x49783c;},'vgYsH':function(_0x2a1529,_0x117d92,_0x279f14){return _0x2a1529(_0x117d92,_0x279f14);}},_0x4906c5={'name':_0x4c2221};if(_0x48587d)_0x4906c5['environment_key']=_0x48587d;_0x4048ff[_0x2b061d(0x1c5)]&&_0x1fb732['cyYec'](Object[_0x2b061d(0x190)](_0x4048ff[_0x2b061d(0x1c5)])[_0x2b061d(0x1d0)],0x0)&&(_0x4906c5['settings']=_0x4048ff['settings']);if(_0x4048ff['username'])_0x4906c5[_0x2b061d(0x1c7)]=_0x4048ff[_0x2b061d(0x1c7)];if(_0x4048ff['password'])_0x4906c5['password']=_0x4048ff['password'];return await _0x1fb732['vgYsH'](apiRequest,_0x2b061d(0x1fa),{'method':'POST','body':JSON['stringify'](_0x4906c5)});}export async function uploadCloudProfileSession(_0x8572b4,_0x1e05d2){const _0x304007=_0x2bae3a,_0x5136bb={'KkZLb':function(_0x461228,_0x45e777,_0x58f7c6){return _0x461228(_0x45e777,_0x58f7c6);},'Jefhg':function(_0x82c697,_0x51988c){return _0x82c697(_0x51988c);}};return await _0x5136bb['KkZLb'](apiRequest,_0x304007(0x151)+_0x5136bb['Jefhg'](encodeURIComponent,_0x8572b4)+_0x304007(0x1f2),{'method':_0x304007(0x1db),'body':JSON['stringify']({'session_state':_0x1e05d2})});}export async function saveCloudProfileCredentials(_0x32eb80,_0x4e7a64,_0x4d1e83){const _0x2e78a1=_0x2bae3a,_0x459b64={'oLWBo':function(_0xe4d3c1,_0x7620b2,_0x3ad755){return _0xe4d3c1(_0x7620b2,_0x3ad755);},'ooFHe':function(_0x2a3349,_0x5c317){return _0x2a3349(_0x5c317);},'QVkel':_0x2e78a1(0x1b6)};await _0x459b64['oLWBo'](apiRequest,_0x2e78a1(0x151)+_0x459b64['ooFHe'](encodeURIComponent,_0x32eb80),{'method':_0x459b64[_0x2e78a1(0x1b4)],'body':JSON[_0x2e78a1(0x14f)]({'username':_0x4e7a64,'password':_0x4d1e83})});}export async function fetchAuthConfig(){const _0x543d4d=_0x2bae3a,_0xa4c5cd={'RIhmL':function(_0x3357fd,_0x4287b3){return _0x3357fd(_0x4287b3);},'SPvSd':function(_0x18caea,_0x22c0dd){return _0x18caea instanceof _0x22c0dd;}};try{const _0x2b4419=await _0xa4c5cd[_0x543d4d(0x1a2)](apiRequest,'/api/v1/profiles/auth-config');return _0x2b4419[_0x543d4d(0x16c)];}catch(_0x1dfbd6){return _0xa4c5cd['SPvSd'](_0x1dfbd6,ApiError)&&_0x1dfbd6[_0x543d4d(0x19f)]!==0x194&&console[_0x543d4d(0x1c0)]('\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20'+_0x1dfbd6['message']),null;}}async function createTunnelSession(_0x26605e){const _0x491c2a=_0x2bae3a,_0x50efa9={'KBWFs':_0x491c2a(0x1a7)};return await apiRequest('/api/v1/tunnel/sessions',{'method':'POST','body':JSON['stringify']({'targetUrl':_0x26605e,'mode':_0x50efa9[_0x491c2a(0x16b)]})});}async function deleteTunnelSession(_0x47a426){const _0x2c9144=_0x2bae3a,_0x5f2155={'CfsXO':function(_0x3bac8b,_0x4d7101,_0x288b53){return _0x3bac8b(_0x4d7101,_0x288b53);}};await _0x5f2155['CfsXO'](apiRequest,'/api/v1/tunnel/sessions/'+_0x47a426,{'method':_0x2c9144(0x15c)});}export function pickAdHocEnvKey(_0x43807b,_0x525c3e,_0x3b16aa){const _0x134816=_0x2bae3a,_0x1c37d={'kDKSh':function(_0x2496c5,_0xe31abc){return _0x2496c5+_0xe31abc;},'IAFuZ':'\x20Your\x20org\x20has\x20no\x20auth\x20environments\x20configured.','pGGWg':function(_0x3f281d,_0x44f542){return _0x3f281d in _0x44f542;},'ixLPN':_0x134816(0x173),'YIRld':'ambiguous','rvpSG':function(_0x463c6f,_0x27be8c){return _0x463c6f(_0x27be8c);},'CbbZM':function(_0xb0a5de,_0x4c7b50){return _0xb0a5de+_0x4c7b50;},'WAios':function(_0x56de11,_0x190637){return _0x56de11===_0x190637;}};if(_0x3b16aa){if(!_0x43807b?.[_0x134816(0x1e9)]?.[_0x3b16aa]){const _0x145928=Object['keys'](_0x43807b?.[_0x134816(0x1e9)]??{});throw new Error(_0x1c37d['kDKSh'](_0x134816(0x1ce)+_0x3b16aa+_0x134816(0x1ca),_0x145928['length']?'\x20Available:\x20'+_0x145928[_0x134816(0x159)](',\x20')+'.':_0x1c37d['IAFuZ'])+'\x20(If\x20you\x20meant\x20a\x20profile,\x20use\x20--profile.)');}return _0x3b16aa;}if(!_0x43807b)return null;if(_0x525c3e){const _0x312599=matchAuthEnvironmentExact(_0x525c3e,_0x43807b);if(_0x312599)return _0x312599;const _0x9695c5=matchAuthEnvironmentByHost(_0x525c3e,_0x43807b);if(_0x9695c5&&_0x1c37d[_0x134816(0x180)](_0x1c37d['ixLPN'],_0x9695c5))return console[_0x134816(0x1fe)]('\x20\x20Auth\x20env\x20\x22'+_0x9695c5['key']+_0x134816(0x201)+_0x525c3e+_0x134816(0x1fd)),_0x9695c5[_0x134816(0x173)];if(_0x9695c5&&_0x1c37d['YIRld']in _0x9695c5)throw new Error('Multiple\x20auth\x20environments\x20declare\x20this\x20host\x20('+_0x9695c5[_0x134816(0x1f4)][_0x134816(0x159)](',\x20')+_0x134816(0x1a5));if(_0x1c37d['rvpSG'](needsTunnel,_0x525c3e))throw new Error(_0x1c37d[_0x134816(0x1c4)](_0x1c37d['kDKSh'](_0x1c37d[_0x134816(0x1f9)](_0x134816(0x1b9)+_0x525c3e+_0x134816(0x18e),_0x134816(0x143)),_0x134816(0x1e6))+_0x134816(0x18c)+('\x20\x20-\x20ask\x20your\x20Ranger\x20admin\x20to\x20add\x20\x22'+_0x525c3e['replace'](/\/+$/,'')+'\x22\x20to\x20the\x20matching\x20auth\x20environment\x27s\x20domains,\x20or\x0a'),'\x20\x20-\x20run\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20'+_0x525c3e+_0x134816(0x16d)));}if(_0x43807b[_0x134816(0x14a)])return _0x43807b[_0x134816(0x14a)];const _0x2b1c5d=Object[_0x134816(0x190)](_0x43807b[_0x134816(0x1e9)]??{});if(_0x1c37d[_0x134816(0x1dd)](_0x2b1c5d[_0x134816(0x1d0)],0x1))return _0x2b1c5d[0x0];if(_0x2b1c5d[_0x134816(0x1d0)]===0x0)return null;throw new Error('Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20('+_0x2b1c5d[_0x134816(0x159)](',\x20')+').\x20'+_0x134816(0x1d5));}export function adHocProfileName(_0x40ee52,_0x212c16,_0xb400f0){const _0x38c8b9=_0x2bae3a,_0x207416={'RWGGR':function(_0x46e8bc,_0x3b6781){return _0x46e8bc===_0x3b6781;}};if(!_0x212c16||_0x207416[_0x38c8b9(0x1ef)](_0x212c16,_0xb400f0))return _0x40ee52;return _0x40ee52+':'+_0x212c16;}export async function resolveAdHocProfile(_0x4dc94c={},_0x25300c=process[_0x2bae3a(0x1f1)]){const _0x2b9bc0=_0x2bae3a,_0x18894f={'DWIAe':function(_0x5b1824){return _0x5b1824();},'fKZzk':function(_0x1d02e3,_0x434bcb){return _0x1d02e3(_0x434bcb);},'LhtAg':function(_0x49c660,_0x46953c){return _0x49c660&&_0x46953c;},'cUUlh':'none','xRYjC':function(_0x3a1c08,_0x24af4b){return _0x3a1c08??_0x24af4b;}},_0x2f0c5c=_0x25300c['RANGER_TEST_USERNAME'];if(!_0x2f0c5c)return null;const _0x35fa27=await _0x18894f[_0x2b9bc0(0x14b)](fetchAuthConfig),_0x23f966=pickAdHocEnvKey(_0x35fa27,_0x4dc94c[_0x2b9bc0(0x16f)],_0x4dc94c['envKey']);let _0x44ce02=adHocProfileName(_0x2f0c5c,_0x23f966,_0x35fa27?.['defaultEnvironmentKey']),_0x35414c=await _0x18894f['fKZzk'](fetchCloudProfile,_0x44ce02);_0x18894f[_0x2b9bc0(0x176)](_0x35414c,_0x23f966)&&_0x35414c['environmentKey']!==_0x23f966&&(console[_0x2b9bc0(0x1fe)]('\x20\x20Cloud\x20profile\x20\x22'+_0x44ce02+'\x22\x20is\x20bound\x20to\x20auth\x20env\x20\x22'+(_0x35414c[_0x2b9bc0(0x1ba)]??_0x18894f['cUUlh'])+_0x2b9bc0(0x1ee)+_0x23f966+'\x22;\x20using\x20\x22'+_0x2f0c5c+':'+_0x23f966+'\x22\x20instead.'),_0x44ce02=_0x2f0c5c+':'+_0x23f966,_0x35414c=await fetchCloudProfile(_0x44ce02));if(_0x35414c)return{'name':_0x35414c[_0x2b9bc0(0x183)],'profile':_0x35414c};const _0x5175f4=_0x25300c[_0x2b9bc0(0x15f)],_0x4b7dcd=await createCloudProfile(_0x44ce02,_0x18894f[_0x2b9bc0(0x1ab)](_0x23f966,undefined),{'username':_0x2f0c5c,'password':_0x5175f4});return console[_0x2b9bc0(0x1fe)]('\x20\x20Created\x20cloud\x20profile\x20\x22'+_0x4b7dcd['name']+_0x2b9bc0(0x1b3)+_0x2f0c5c+(_0x23f966?'\x20(auth\x20env:\x20'+_0x23f966+')':'')),{'name':_0x4b7dcd['name'],'profile':_0x4b7dcd};}export async function writeSessionToLocalCache(_0x1ecba9,_0x18c096,_0x206f03,_0x27fe32,_0x3cc13a,_0x2b513d,_0x2c322a){const _0x3f33ea=_0x2bae3a,_0x3baa73={'SEdvC':function(_0x33893d,_0x22ed40,_0x225989){return _0x33893d(_0x22ed40,_0x225989);},'lKKms':_0x3f33ea(0x169),'qHRrM':function(_0x49eaba,_0x8e1a1b){return _0x49eaba(_0x8e1a1b);},'uFWsi':function(_0x5e5fad,_0x24b49d,_0xbe0053){return _0x5e5fad(_0x24b49d,_0xbe0053);},'qWxAN':function(_0x20ebea,_0x2efbbc,_0x24e622){return _0x20ebea(_0x2efbbc,_0x24e622);},'HSVyu':function(_0x492847,_0x19dfc7){return _0x492847(_0x19dfc7);}},_0x3565b1=sessionCacheHash({'orgId':_0x18c096,'profileName':_0x1ecba9,'effectiveBaseUrl':_0x206f03,'setupHeaders':_0x27fe32,'invalidateOn':_0x2c322a?.[_0x3f33ea(0x1e3)],'userAgent':_0x2c322a?.['userAgent'],'clientIp':_0x2c322a?.[_0x3f33ea(0x1c8)]}),_0x5d2ede=getSessionCachePath(_0x3565b1,_0x1ecba9),_0x11a808=_0x3baa73['SEdvC'](join,getRangerHomeDir(),_0x3baa73[_0x3f33ea(0x191)]);!_0x3baa73['qHRrM'](existsSync,_0x11a808)&&await _0x3baa73[_0x3f33ea(0x192)](mkdir,_0x11a808,{'recursive':!![]});const _0x499c81={..._0x3cc13a};_0x2b513d&&_0x2b513d['length']>0x0&&Array['isArray'](_0x499c81[_0x3f33ea(0x1da)])&&(_0x499c81['cookies']=duplicateCookiesForDomains(_0x499c81['cookies'],_0x2b513d));const _0xd4a5b3={'cached_at':new Date()['toISOString'](),'session_state':_0x499c81};await _0x3baa73['qWxAN'](writeFile,_0x5d2ede,JSON['stringify'](_0xd4a5b3,null,0x2));const _0x41bc72=_0x3baa73['HSVyu'](getStorageStatePath,_0x5d2ede);return await writeFile(_0x41bc72,JSON['stringify'](_0x499c81,null,0x2)),_0x41bc72;}export async function checkLocalCache(_0x30b101,_0x587f30,_0x5c5270,_0x2c0d04,_0x22c79d){const _0x2f7128=_0x2bae3a,_0x49f32e={'lzMjM':function(_0x45d469,_0x305f97){return _0x45d469(_0x305f97);},'uVNNy':function(_0xcb257b,_0x391cd6,_0x69beea){return _0xcb257b(_0x391cd6,_0x69beea);},'aVMzA':function(_0x7bfb6e,_0x41ded9){return _0x7bfb6e(_0x41ded9);},'kSGoH':function(_0x58721f,_0x3851e2){return _0x58721f(_0x3851e2);},'ezupd':function(_0x196ff8,_0x3f1dce,_0x6f71bb){return _0x196ff8(_0x3f1dce,_0x6f71bb);},'iqena':'utf-8'},_0x287385=_0x49f32e[_0x2f7128(0x148)](sessionCacheHash,{'orgId':_0x587f30,'profileName':_0x30b101,'effectiveBaseUrl':_0x5c5270,'setupHeaders':_0x2c0d04,'invalidateOn':_0x22c79d?.['invalidateOn'],'userAgent':_0x22c79d?.[_0x2f7128(0x1c2)],'clientIp':_0x22c79d?.[_0x2f7128(0x1c8)]}),_0x148f7a=_0x49f32e['uVNNy'](getSessionCachePath,_0x287385,_0x30b101),_0x99fcf7=_0x49f32e[_0x2f7128(0x1d6)](getStorageStatePath,_0x148f7a);if(!_0x49f32e[_0x2f7128(0x1d2)](existsSync,_0x148f7a)||!existsSync(_0x99fcf7))return null;try{const _0x331668=await _0x49f32e['ezupd'](readFile,_0x148f7a,_0x49f32e[_0x2f7128(0x14d)]);return JSON[_0x2f7128(0x17e)](_0x331668),{'storageStatePath':_0x99fcf7};}catch{return null;}}function launchRealBrowser(){return chromium['launch']({'headless':!![]});}function emitSessionValidationHint(_0x1ed773,_0x51e2dd){const _0x53a1d2=_0x2bae3a,_0x29ba72={'rpJBl':function(_0xb16418,_0x41d3ee){return _0xb16418+_0x41d3ee;}};if(!_0x51e2dd||!_0x51e2dd['domains']?.['length'])return;let _0x34e31b;try{_0x34e31b=new URL(_0x1ed773);}catch{return;}const _0xc3246e=[];for(const _0x529867 of _0x51e2dd[_0x53a1d2(0x206)]){try{_0xc3246e['push']({'raw':_0x529867,'url':new URL(_0x529867)});}catch{}}if(_0xc3246e['length']===0x0)return;if(_0xc3246e[_0x53a1d2(0x1d8)](_0x52ab83=>_0x52ab83[_0x53a1d2(0x187)][_0x53a1d2(0x17d)]===_0x34e31b[_0x53a1d2(0x17d)]))return;const _0x21664a=_0xc3246e['map'](_0x238aaf=>'\x22'+_0x238aaf['raw']+'\x22')['join'](',\x20');console[_0x53a1d2(0x1fe)](_0x29ba72[_0x53a1d2(0x19a)]('\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20'+_0x21664a+';\x20',_0x53a1d2(0x1cc)+_0x1ed773+'\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20')+_0x53a1d2(0x145));}export async function serverSideLogin(_0x56b84e,_0x3208e3){const _0x4d476a=_0x2bae3a,_0x26622d={'xTwoD':function(_0x42572a,_0x314b6c){return _0x42572a(_0x314b6c);},'stuxo':'POST','DVJae':function(_0x280d8d,_0x563b85){return _0x280d8d instanceof _0x563b85;},'hqTJi':function(_0x105180,_0x42c503){return _0x105180===_0x42c503;},'szyTS':_0x4d476a(0x147)},_0xcb445d=process['env'][_0x4d476a(0x189)],_0x396ef6=process[_0x4d476a(0x1f1)]['RANGER_TEST_PASSWORD'],_0xf32314={};if(_0xcb445d)_0xf32314['username']=_0xcb445d;if(_0x396ef6)_0xf32314[_0x4d476a(0x1ac)]=_0x396ef6;if(_0x3208e3?.['force'])_0xf32314['force']=!![];if(_0x3208e3?.['targetUrl'])_0xf32314['target_url']=_0x3208e3['targetUrl'];if(_0x3208e3?.[_0x4d476a(0x1f1)])_0xf32314['env']=_0x3208e3['env'];_0x3208e3?.['tunnel']&&(_0xf32314[_0x4d476a(0x1c6)]=_0x3208e3[_0x4d476a(0x188)]['sessionId'],_0xf32314[_0x4d476a(0x1b1)]=_0x3208e3['tunnel'][_0x4d476a(0x18a)]);try{return await apiRequest('/api/v1/profiles/'+_0x26622d[_0x4d476a(0x1fc)](encodeURIComponent,_0x56b84e)+'/login',{'method':_0x26622d['stuxo'],'body':JSON[_0x4d476a(0x14f)](_0xf32314)});}catch(_0x2c6800){if(_0x26622d['DVJae'](_0x2c6800,ApiError)&&_0x26622d[_0x4d476a(0x168)](_0x2c6800['status'],0x190)&&_0x2c6800['code']===_0x26622d['szyTS'])return{'status':_0x26622d[_0x4d476a(0x15d)],'error':_0x2c6800[_0x4d476a(0x17c)]};throw _0x2c6800;}}async function serverSideLoginWithOptionalTunnel(_0x2f81fb,_0x5c38f3,_0x43d799={}){const _0x3c88b3=_0x2bae3a,_0x170f9a={'RBzFX':_0x3c88b3(0x164),'XUqvD':function(_0x4fdb79,_0x1250a0){return _0x4fdb79(_0x1250a0);},'HBHfw':function(_0x345d9b,_0x4f05e1){return _0x345d9b(_0x4f05e1);},'RBkch':function(_0x56ff63,_0x3897af){return _0x56ff63(_0x3897af);},'Mknwo':function(_0x51d9d1,_0x449175){return _0x51d9d1===_0x449175;},'FMvjt':function(_0x1c2afa,_0x2c0991){return _0x1c2afa(_0x2c0991);},'UbWYG':function(_0x312744,_0xc7ce12){return _0x312744(_0xc7ce12);},'ugPqO':function(_0x52cf04,_0x198998){return _0x52cf04??_0x198998;},'sMqxp':function(_0x364fe9,_0x26ae5c){return _0x364fe9||_0x26ae5c;}};if(!_0x170f9a['RBkch'](needsTunnel,_0x5c38f3))return await serverSideLogin(_0x2f81fb,{'force':_0x43d799[_0x3c88b3(0x156)],'env':_0x43d799['env']});let _0x4eae84=null,_0x215ee3=null,_0x4b76c5=null,_0xf5a4bf=null,_0x18e125=![];const _0x223b28=process[_0x3c88b3(0x1f1)][_0x3c88b3(0x1f6)]?.['toLowerCase'](),_0x2c6fb2=_0x223b28==='1'||_0x170f9a[_0x3c88b3(0x1cb)](_0x223b28,'true'),_0x3b68c6={'profileName':_0x2f81fb,'targetUrlHost':_0x170f9a['FMvjt'](targetHostForTelemetry,_0x5c38f3),'tunnelRequired':!![],'forceLogin':_0x170f9a['UbWYG'](Boolean,_0x43d799['force']),'localBrowserServerHeaded':_0x2c6fb2};try{_0x43d799['telemetry']?.['trackPhaseStart']('tunnel_login_setup',_0x3b68c6);_0x2c6fb2&&console['log']('\x20\x20Debug:\x20launching\x20tunneled\x20login\x20browser\x20headed...');_0x4eae84=await launchBrowserServer({'headless':!_0x2c6fb2}),_0x215ee3=await _0x170f9a[_0x3c88b3(0x1c9)](createTunnelSession,_0x5c38f3);const _0x4bfb68=await requireToken();_0x4b76c5=await createTunnelBridge({'localWsUrl':_0x4eae84['wsEndpoint'],'tunnelServerUrl':_0x215ee3[_0x3c88b3(0x184)],'sessionId':_0x215ee3[_0x3c88b3(0x1a9)],'apiKey':_0x4bfb68,'onError':_0x35d8e2=>{_0xf5a4bf=_0x35d8e2;},'onClose':()=>{const _0x436c8e=_0x3c88b3;_0xf5a4bf??=new Error(_0x436c8e(0x1ad)+_0x2f81fb);},'onEvent':_0x57a9dc=>trackBridgeEvent(_0x43d799[_0x3c88b3(0x204)],_0x57a9dc)}),_0x43d799['telemetry']?.[_0x3c88b3(0x1ec)]('tunnel_login_setup',{..._0x3b68c6,'tunnelSessionId':_0x215ee3[_0x3c88b3(0x1a9)],'localBrowserServer':!![],'localBrowserServerHeaded':_0x2c6fb2}),_0x18e125=!![];try{return _0x43d799['telemetry']?.['trackPhaseStart'](_0x170f9a['RBzFX'],{..._0x3b68c6,'tunnelSessionId':_0x215ee3[_0x3c88b3(0x1a9)]}),await serverSideLogin(_0x2f81fb,{'force':_0x43d799['force'],'targetUrl':_0x5c38f3,'env':_0x43d799[_0x3c88b3(0x1f1)],'tunnel':{'sessionId':_0x215ee3['sessionId'],'pwEndpoint':_0x215ee3[_0x3c88b3(0x18a)]}})['then'](_0x5ab59b=>{const _0x188f88=_0x3c88b3;return _0x43d799[_0x188f88(0x204)]?.['trackPhaseEnd'](_0x170f9a['RBzFX'],{..._0x3b68c6,'tunnelSessionId':_0x215ee3?.[_0x188f88(0x1a9)],'loginStatus':_0x5ab59b['status'],'hasSessionState':Boolean(_0x5ab59b[_0x188f88(0x18d)]),'hasTestOutput':_0x170f9a['XUqvD'](Boolean,_0x5ab59b[_0x188f88(0x15e)]),'bridgeError':_0x170f9a[_0x188f88(0x1c9)](errorMessageForTelemetry,_0xf5a4bf)}),_0x5ab59b;});}catch(_0xa00ef3){await _0x43d799['telemetry']?.[_0x3c88b3(0x1e1)](_0x3c88b3(0x164),_0xf5a4bf??_0xa00ef3,{..._0x3b68c6,'tunnelSessionId':_0x215ee3[_0x3c88b3(0x1a9)],'bridgeError':errorMessageForTelemetry(_0xf5a4bf)});throw _0x170f9a[_0x3c88b3(0x1ea)](_0xf5a4bf,_0xa00ef3);}}catch(_0x25053d){!_0x18e125&&await _0x43d799[_0x3c88b3(0x204)]?.[_0x3c88b3(0x1e1)](_0x3c88b3(0x198),_0x25053d,{..._0x3b68c6,'tunnelSessionId':_0x215ee3?.[_0x3c88b3(0x1a9)]});throw _0x25053d;}finally{(_0x170f9a[_0x3c88b3(0x144)](_0x215ee3,_0x4eae84)||_0x4b76c5)&&(_0x43d799[_0x3c88b3(0x204)]?.[_0x3c88b3(0x161)](_0x3c88b3(0x197),{..._0x3b68c6,'tunnelSessionId':_0x215ee3?.['sessionId']}),_0x4b76c5?.['close'](),_0x4eae84&&await _0x4eae84[_0x3c88b3(0x175)]()[_0x3c88b3(0x1e7)](()=>{}),_0x215ee3&&await deleteTunnelSession(_0x215ee3['sessionId'])[_0x3c88b3(0x1e7)](()=>{}),_0x43d799['telemetry']?.[_0x3c88b3(0x1ec)](_0x3c88b3(0x197),{..._0x3b68c6,'tunnelSessionId':_0x215ee3?.[_0x3c88b3(0x1a9)]}));}}export async function manualBrowserLogin(_0x5a82ca,_0x4169ef,_0xaa7d84={}){const _0x4df16=_0x2bae3a,_0x1ca7ae={'NwQXb':function(_0x4a1ed7,_0x118c23,_0x41859b){return _0x4a1ed7(_0x118c23,_0x41859b);},'vOjhL':_0x4df16(0x175),'jngPP':function(_0x2bb0f7){return _0x2bb0f7();},'WOVpH':function(_0x3e82cf,_0x265671){return _0x3e82cf+_0x265671;},'BkFaR':function(_0xa681a7,_0x2e7d93){return _0xa681a7+_0x2e7d93;},'cczrt':_0x4df16(0x1b0),'VczwK':_0x4df16(0x1f8),'GeDDs':function(_0x17f636,_0x2460d8){return _0x17f636(_0x2460d8);},'Tyqts':function(_0x3638fe,_0x1eff05){return _0x3638fe&&_0x1eff05;},'hMctJ':'Browser\x20login\x20timed\x20out\x20before\x20completion.','CyzKd':'Browser\x20closed\x20before\x20authentication\x20was\x20saved.','pwgux':function(_0x2f8540,_0x8b81ec){return _0x2f8540!==_0x8b81ec;},'NPJjw':'POST'};if(!_0x1ca7ae[_0x4df16(0x1eb)](isInteractive))throw new Error(_0x1ca7ae[_0x4df16(0x150)](_0x1ca7ae['BkFaR'](_0x4df16(0x158)+_0x5a82ca['name']+'\x22.\x0a','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20'),_0x4df16(0x1d9)));const _0x4fca90=_0x4169ef&&_0x4169ef[_0x4df16(0x206)]['length']>0x0?_0x4169ef[_0x4df16(0x206)][0x0]:_0x1ca7ae['cczrt'];console['log'](_0x1ca7ae['VczwK']),console[_0x4df16(0x1fe)](_0x4df16(0x1e4)),await new Promise(_0x441e18=>setTimeout(_0x441e18,0x7d0));const _0x48bdef=await chromium[_0x4df16(0x194)]({'headless':![]});let _0x15b53f=null;try{const _0x3dc2ac={'ignoreHTTPSErrors':!![]};_0x4169ef?.['setupHeaders']&&(_0x3dc2ac['extraHTTPHeaders']=_0x4169ef[_0x4df16(0x1ae)]);const _0xe8c999=await _0x48bdef['newContext'](_0x3dc2ac);await _0x1ca7ae['GeDDs'](addProfileSetupBanner,_0xe8c999);const _0x424cae=await _0xe8c999[_0x4df16(0x149)]();await _0x424cae['goto'](_0x4fca90);let _0x3f5173=![];await new Promise(_0x33c620=>{const _0x53d505=_0x4df16,_0x5c65cf={'verZF':function(_0x2151c0,_0x2a9185){return _0x2151c0/_0x2a9185;}},_0x271c27=_0x1ca7ae[_0x53d505(0x1c1)](setTimeout,()=>{const _0x1d3395=_0x53d505;_0x3f5173=!![],console['error'](_0x1d3395(0x1e5)+_0x5c65cf['verZF'](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+'\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.'),_0x33c620();},MANUAL_LOGIN_TIMEOUT_MS);_0x424cae['on'](_0x1ca7ae['vOjhL'],async()=>{clearTimeout(_0x271c27);try{const _0x26826f=await _0xe8c999['storageState']();_0x15b53f=_0x26826f;}catch{}_0x33c620();});});if(_0x1ca7ae[_0x4df16(0x1cf)](_0x3f5173,!_0x15b53f))throw new Error(_0x1ca7ae['hMctJ']);}finally{await _0x48bdef[_0x4df16(0x175)]()[_0x4df16(0x1e7)](()=>{});}if(!_0x15b53f)throw new Error(_0x1ca7ae['CyzKd']);return _0x1ca7ae[_0x4df16(0x1e8)](_0xaa7d84[_0x4df16(0x153)],![])&&await _0x1ca7ae['NwQXb'](apiRequest,_0x4df16(0x151)+encodeURIComponent(_0x5a82ca[_0x4df16(0x183)])+'/session',{'method':_0x1ca7ae['NPJjw'],'body':JSON[_0x4df16(0x14f)]({'session_state':_0x15b53f,'updated_by':_0x4df16(0x19b)})}),{'sessionState':_0x15b53f};}export async function promptSaveCredentials(_0x10f4bf){const _0x5a7854=_0x2bae3a,_0x2a5e90={'zFNfI':function(_0x48a923,_0x1442d0){return _0x48a923||_0x1442d0;},'haXfY':_0x5a7854(0x1c3),'vPKuR':_0x5a7854(0x178),'GJMaU':function(_0x538824,_0x2d9158,_0xdf589){return _0x538824(_0x2d9158,_0xdf589);},'Yuovk':_0x5a7854(0x1b6)},_0x212c43=process[_0x5a7854(0x1f1)]['RANGER_TEST_USERNAME'],_0x4443db=process[_0x5a7854(0x1f1)][_0x5a7854(0x15f)];if(_0x2a5e90['zFNfI'](!_0x212c43,!_0x4443db))return;if(!isInteractive())return;const {save:_0x54552b}=await _0x4e34ea['prompt']([{'type':_0x2a5e90['haXfY'],'name':'save','message':_0x2a5e90['vPKuR'],'default':![]}]);if(!_0x54552b)return;await _0x2a5e90[_0x5a7854(0x185)](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x10f4bf),{'method':_0x2a5e90['Yuovk'],'body':JSON['stringify']({'username':_0x212c43,'password':_0x4443db})}),console['log'](_0x5a7854(0x18b));}export async function resolveCloudProfileSession(_0x4b2f89,_0x3b47d4={}){const _0x231d5e=_0x2bae3a,_0x547a37={'SYFlL':function(_0x158f82){return _0x158f82();},'TjuLX':function(_0x1f8bc9,_0x25f7ea,_0xd5506d){return _0x1f8bc9(_0x25f7ea,_0xd5506d);},'HfnJY':_0x231d5e(0x1d4),'wDSbL':function(_0x5dc49e,_0x3a52cf){return _0x5dc49e||_0x3a52cf;},'absWR':function(_0x4b5458,_0x3222ae){return _0x4b5458(_0x3222ae);},'tuCMO':function(_0x264fb8,_0x4fd32f){return _0x264fb8>_0x4fd32f;},'WPYsC':function(_0x215b9d,_0x57e022,_0x302c0b,_0x360f63,_0x2f2235,_0x28d632){return _0x215b9d(_0x57e022,_0x302c0b,_0x360f63,_0x2f2235,_0x28d632);},'wcyNn':function(_0x1b04aa,_0x26290d,_0x30a334,_0x7bc9ad,_0x4535cc){return _0x1b04aa(_0x26290d,_0x30a334,_0x7bc9ad,_0x4535cc);},'pDAjr':function(_0x23e2ef,_0x5b688a,_0x440232){return _0x23e2ef(_0x5b688a,_0x440232);},'RtsRm':function(_0x48279b,_0x1ebdd4){return _0x48279b(_0x1ebdd4);},'yStzg':function(_0x82129b,_0x34f3da){return _0x82129b(_0x34f3da);},'iEHUW':function(_0xa543d8,_0x29c4a0,_0xca9e13){return _0xa543d8(_0x29c4a0,_0xca9e13);},'FUejt':_0x231d5e(0x147),'mBwqj':'success','GSnPA':'\x20\x20Login\x20successful.\x20Session\x20cached.','JGbrf':function(_0x24386f,_0x512046,_0x5944c4,_0x388031,_0x2a45bc,_0x441a0c,_0x58562c,_0x3753f8){return _0x24386f(_0x512046,_0x5944c4,_0x388031,_0x2a45bc,_0x441a0c,_0x58562c,_0x3753f8);},'boZrj':'\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','qIISM':function(_0x253870,_0x4c4b74){return _0x253870 instanceof _0x4c4b74;},'VZGUe':'\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','vRdoP':function(_0x518131,_0x5f0715){return _0x518131&&_0x5f0715;},'nrZKw':function(_0x6f8afc){return _0x6f8afc();},'whPuH':function(_0x173a6f,_0x257979){return _0x173a6f+_0x257979;},'UtPUq':_0x231d5e(0x179),'FFThf':function(_0x4f8613,_0x8317e1,_0x489d0e){return _0x4f8613(_0x8317e1,_0x489d0e);},'oSUmi':function(_0x1449a3,_0x14f504,_0x42e0fc,_0x3dd579,_0x42467d,_0x522a74,_0x1a7774,_0x12f4bf){return _0x1449a3(_0x14f504,_0x42e0fc,_0x3dd579,_0x42467d,_0x522a74,_0x1a7774,_0x12f4bf);}},_0x4adb67=_0x4b2f89[_0x231d5e(0x1c5)]??{},_0xadf20a=await _0x547a37['SYFlL'](fetchAuthConfig),_0x22d822=_0xadf20a?_0x547a37[_0x231d5e(0x160)](resolveAuthEnvironmentLocally,_0xadf20a,_0x3b47d4[_0x231d5e(0x1df)]??_0x4b2f89[_0x231d5e(0x1ba)]):null,_0x3ba38e=typeof _0x22d822?.['loginInstructions']===_0x547a37['HfnJY']&&_0x22d822[_0x231d5e(0x1be)]['trim']()?_0x22d822['loginInstructions']:undefined,_0x1b6358=typeof _0x4adb67[_0x231d5e(0x1be)]===_0x547a37[_0x231d5e(0x18f)]&&_0x4adb67[_0x231d5e(0x1be)]['trim']()?_0x4adb67[_0x231d5e(0x1be)]:undefined,_0x4c8770=_0x547a37[_0x231d5e(0x1f3)](_0x1b6358,!_0x3ba38e)?_0x4adb67:{..._0x4adb67,'loginInstructions':_0x3ba38e},_0xafd180=_0x547a37[_0x231d5e(0x1aa)](Boolean,_0x4c8770['loginInstructions']?.['trim']()),_0x6f3775=Boolean(_0x4adb67[_0x231d5e(0x195)]||_0x22d822?.[_0x231d5e(0x195)]),_0x3c8e1a=_0x22d822?.[_0x231d5e(0x206)],_0x5960fa=_0x4adb67['setupHeaders'],_0x513d15=_0x5960fa??_0x22d822?.[_0x231d5e(0x1ae)],_0x462bc3=_0x3b47d4[_0x231d5e(0x1bd)]??_0x4adb67['baseUrl']??(_0x3c8e1a&&_0x547a37[_0x231d5e(0x1b5)](_0x3c8e1a['length'],0x0)?_0x3c8e1a[0x0]:''),_0x2e4451=_0x462bc3?needsTunnel(_0x462bc3):![],_0x405eec={'invalidateOn':_0x22d822?.['invalidateOn'],'userAgent':_0x22d822?.[_0x231d5e(0x15b)]?.[_0x231d5e(0x1c2)]??_0x4adb67['userAgent']};_0x6f3775&&console['log'](_0x231d5e(0x17f)+_0x4b2f89['name']+_0x231d5e(0x16a));if(!_0x6f3775){const _0x2d21ec=await _0x547a37[_0x231d5e(0x177)](checkLocalCache,_0x4b2f89['name'],_0x4b2f89['organizationId'],_0x462bc3,_0x513d15,_0x405eec);if(_0x2d21ec){if(_0x462bc3&&!_0x2e4451){const _0x114055=await isCachedSessionLive(_0x2d21ec['storageStatePath'],_0x462bc3,{'sessionCheckPath':_0x22d822?.[_0x231d5e(0x182)],'setupHeaders':_0x513d15},{'launchBrowser':launchRealBrowser});if(_0x114055)return console['log'](_0x231d5e(0x19e)+_0x4b2f89['name']+'\x22'),{'authPath':_0x2d21ec[_0x231d5e(0x186)],'settings':_0x4c8770,'resolvedEnv':_0x22d822};console['log']('\x20\x20Cached\x20session\x20for\x20\x22'+_0x4b2f89[_0x231d5e(0x183)]+_0x231d5e(0x1b2)),_0x547a37['TjuLX'](emitSessionValidationHint,_0x462bc3,_0x22d822);}else return _0x2e4451&&console[_0x231d5e(0x1fe)](_0x231d5e(0x14c)+_0x4b2f89[_0x231d5e(0x183)]+'\x22'),{'authPath':_0x2d21ec[_0x231d5e(0x186)],'settings':_0x4c8770,'resolvedEnv':_0x22d822};}}if(!_0x6f3775&&_0x4b2f89[_0x231d5e(0x166)]){const _0x37aad9=await writeSessionToLocalCache(_0x4b2f89['name'],_0x4b2f89[_0x231d5e(0x157)],_0x462bc3,_0x513d15,_0x4b2f89['sessionState'],_0x3c8e1a,_0x405eec);if(_0x462bc3){const _0x34f2d0=await _0x547a37[_0x231d5e(0x1dc)](isCachedSessionLive,_0x37aad9,_0x462bc3,{'sessionCheckPath':_0x22d822?.[_0x231d5e(0x182)],'setupHeaders':_0x513d15},{'launchBrowser':launchRealBrowser});if(_0x34f2d0)return console['log']('\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22'+_0x4b2f89['name']+'\x22,\x20cached\x20locally'),{'authPath':_0x37aad9,'settings':_0x4c8770,'resolvedEnv':_0x22d822};console['log']('\x20\x20Cloud\x20session\x20for\x20\x22'+_0x4b2f89['name']+_0x231d5e(0x15a)),_0x547a37['pDAjr'](emitSessionValidationHint,_0x462bc3,_0x22d822);}else return{'authPath':_0x37aad9,'settings':_0x4c8770,'resolvedEnv':_0x22d822};}if(_0xafd180)return console[_0x231d5e(0x1fe)](_0x231d5e(0x207)+_0x4b2f89['name']+'\x22;\x20proceeding\x20with\x20loginInstructions.'),{'authPath':undefined,'settings':_0x4c8770,'resolvedEnv':_0x22d822};console[_0x231d5e(0x1fe)]('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x4b2f89['name']+_0x231d5e(0x1e0));const _0x2088d5=_0x547a37['RtsRm'](Boolean,process['env']['RANGER_TEST_USERNAME'])&&_0x547a37['yStzg'](Boolean,process[_0x231d5e(0x1f1)][_0x231d5e(0x15f)]),_0x3ecc2d=Boolean(_0x4b2f89['username']),_0x54b0b4=Boolean(_0x3b47d4['assertedEnv']),_0x1a6cad=_0x462bc3?_0x547a37[_0x231d5e(0x1a0)](isBareLocalhost,_0x462bc3):![],_0x491d6b=(_0x2088d5||_0x3ecc2d)&&_0x547a37[_0x231d5e(0x1f3)](!_0x1a6cad,_0x54b0b4);if(_0x491d6b)try{const _0x2b9e5e=_0x462bc3?await serverSideLoginWithOptionalTunnel(_0x4b2f89[_0x231d5e(0x183)],_0x462bc3,{'force':_0x6f3775,'telemetry':_0x3b47d4['telemetry'],'env':_0x3b47d4['assertedEnv']}):await _0x547a37[_0x231d5e(0x16e)](serverSideLogin,_0x4b2f89[_0x231d5e(0x183)],{'force':_0x6f3775,'env':_0x3b47d4[_0x231d5e(0x1df)]});if(_0x2b9e5e['status']===_0x547a37[_0x231d5e(0x1e2)])console[_0x231d5e(0x1fe)](_0x231d5e(0x181));else{if(_0x2b9e5e[_0x231d5e(0x19f)]===_0x547a37['mBwqj']&&_0x2b9e5e[_0x231d5e(0x18d)]){console['log'](_0x547a37['GSnPA']);const _0x3d2da1=await _0x547a37['JGbrf'](writeSessionToLocalCache,_0x4b2f89['name'],_0x4b2f89[_0x231d5e(0x157)],_0x462bc3,_0x513d15,_0x2b9e5e['session_state'],_0x3c8e1a,_0x405eec);return _0x2088d5&&!_0x3ecc2d&&await promptSaveCredentials(_0x4b2f89[_0x231d5e(0x183)]),{'authPath':_0x3d2da1,'settings':_0x4c8770,'resolvedEnv':_0x22d822};}else _0x2b9e5e[_0x231d5e(0x15e)]&&(console[_0x231d5e(0x1fe)](_0x547a37['boZrj']),console[_0x231d5e(0x1fe)](_0x2b9e5e['test_output'])),console['log'](_0x231d5e(0x1cd));}}catch(_0xdacff3){console['log']('\x20\x20Server-side\x20login\x20error:\x20'+(_0x547a37[_0x231d5e(0x203)](_0xdacff3,Error)?_0xdacff3[_0x231d5e(0x154)]:_0x547a37['absWR'](String,_0xdacff3))),console['log'](_0x547a37['VZGUe']);}if(_0x547a37['vRdoP'](_0x1a6cad,!_0x54b0b4)&&!_0x547a37['nrZKw'](isInteractive))throw new Error(_0x547a37[_0x231d5e(0x171)](_0x231d5e(0x193)+_0x462bc3+_0x231d5e(0x1a4)+_0x4b2f89['name']+_0x231d5e(0x1bb)+('\x20\x20•\x20capture\x20one\x20(a\x20browser\x20opens):\x20ranger\x20profile\x20add\x20'+_0x4b2f89[_0x231d5e(0x183)]+'\x20--url\x20'+_0x462bc3+'\x0a'),_0x547a37['UtPUq']));const _0x41a86d=_0x22d822?{..._0x22d822,'domains':_0x547a37[_0x231d5e(0x1b8)](orderLoginDomains,_0x462bc3,_0x22d822['domains']),'setupHeaders':_0x513d15}:_0x462bc3?{'key':_0x4b2f89['environmentKey']??'','domains':[_0x462bc3],'setupHeaders':_0x513d15}:null,{sessionState:_0x38021d}=await manualBrowserLogin(_0x4b2f89,_0x41a86d,{'persistSessionState':!_0x2e4451}),_0x1c7272=await _0x547a37[_0x231d5e(0x1d7)](writeSessionToLocalCache,_0x4b2f89['name'],_0x4b2f89['organizationId'],_0x462bc3,_0x513d15,_0x38021d,_0x3c8e1a,_0x405eec);return{'authPath':_0x1c7272,'settings':_0x4c8770,'resolvedEnv':_0x22d822};}
@@ -1 +1 @@
1
- const _0x519f7c=_0xf188;(function(_0x409dae,_0x4d4604){const _0x48fd0a=_0xf188,_0x2b5874=_0x409dae();while(!![]){try{const _0x22f2b2=parseInt(_0x48fd0a(0x1b5))/0x1*(-parseInt(_0x48fd0a(0x1b1))/0x2)+parseInt(_0x48fd0a(0x1a0))/0x3+parseInt(_0x48fd0a(0x1a1))/0x4+-parseInt(_0x48fd0a(0x1b9))/0x5*(-parseInt(_0x48fd0a(0x193))/0x6)+-parseInt(_0x48fd0a(0x19b))/0x7*(-parseInt(_0x48fd0a(0x1ad))/0x8)+parseInt(_0x48fd0a(0x1b7))/0x9*(-parseInt(_0x48fd0a(0x197))/0xa)+-parseInt(_0x48fd0a(0x1bc))/0xb*(-parseInt(_0x48fd0a(0x1c0))/0xc);if(_0x22f2b2===_0x4d4604)break;else _0x2b5874['push'](_0x2b5874['shift']());}catch(_0x5d45ee){_0x2b5874['push'](_0x2b5874['shift']());}}}(_0x57e3,0x5fd6b));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';function _0x57e3(){const _0x3093=['FLOXp','2796iOmHHo','localhost.','clientIp','VySnd','slice','close','launchBrowser','userAgent','AuPjG','aOAvh','QIYLY','update','domain','hostname','822Bhcoen','OddQp','url','stdout','7351930ogkuQZ','defaultEnvironmentKey','wNNjb','push','385WCJeMd','catch','isTTY','replace','keys','590223BhXlVT','1851980kRyrzr','stdin','has','.localhost','FbMSQ','startsWith','invalidateOn','lZaST','domcontentloaded','port','QNJdf','sort','107736uRHbqe','profileName','localhost','pathname','58456WpwvVG','mBkVD','effectiveBaseUrl','setupHeaders','21yFIotI','test','9eZAhIb','ztCre','9065gCpePa','add','.storageState.json','4378wktlqN','length','status'];_0x57e3=function(){return _0x3093;};return _0x57e3();}export function isInteractive(_0x42ab7e=process['env'],_0x1bb428={'stdin':process['stdin'],'stdout':process[_0x519f7c(0x196)]}){const _0x3f8691=_0x519f7c;if(_0x42ab7e['CI'])return![];return Boolean(_0x1bb428[_0x3f8691(0x1a2)][_0x3f8691(0x19d)])&&Boolean(_0x1bb428[_0x3f8691(0x196)]['isTTY']);}function _0xf188(_0x10c285,_0x217579){_0x10c285=_0x10c285-0x193;const _0x57e32b=_0x57e3();let _0xf1880b=_0x57e32b[_0x10c285];return _0xf1880b;}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x15a4fe){const _0x2c880b=_0x519f7c,_0x356a1f={'ztCre':'baseUrl','QNJdf':_0x2c880b(0x1b4),'YpSxu':function(_0xf7215d,_0x579fbb){return _0xf7215d(_0x579fbb);},'lZaST':_0x2c880b(0x1c7),'wNNjb':function(_0x59f654,_0x17008c){return _0x59f654!==_0x17008c;},'AcbUh':'clientIp'},_0x32a780=new Set(_0x15a4fe[_0x2c880b(0x1a7)]??DEFAULT_INVALIDATE_ON);_0x15a4fe['effectiveBaseUrl']&&needsTunnel(_0x15a4fe['effectiveBaseUrl'])&&_0x32a780[_0x2c880b(0x1ba)](_0x356a1f[_0x2c880b(0x1b8)]);const _0x455c44={'orgId':_0x15a4fe['orgId'],'profileName':_0x15a4fe[_0x2c880b(0x1ae)]};return _0x32a780[_0x2c880b(0x1a3)](_0x356a1f[_0x2c880b(0x1b8)])&&(_0x455c44['effectiveBaseUrl']=_0x15a4fe[_0x2c880b(0x1b3)]),_0x32a780[_0x2c880b(0x1a3)](_0x356a1f[_0x2c880b(0x1ab)])&&(_0x455c44['setupHeaders']=_0x15a4fe[_0x2c880b(0x1b4)]?_0x356a1f['YpSxu'](sortObjectKeys,_0x15a4fe[_0x2c880b(0x1b4)]):_0x15a4fe['setupHeaders']),_0x32a780[_0x2c880b(0x1a3)]('port')&&(_0x455c44[_0x2c880b(0x1aa)]=extractPort(_0x15a4fe['effectiveBaseUrl'])),_0x32a780[_0x2c880b(0x1a3)](_0x356a1f[_0x2c880b(0x1a8)])&&_0x356a1f['wNNjb'](_0x15a4fe['userAgent'],undefined)&&(_0x455c44[_0x2c880b(0x1c7)]=_0x15a4fe[_0x2c880b(0x1c7)]),_0x32a780[_0x2c880b(0x1a3)](_0x356a1f['AcbUh'])&&_0x356a1f[_0x2c880b(0x199)](_0x15a4fe['clientIp'],undefined)&&(_0x455c44['clientIp']=_0x15a4fe[_0x2c880b(0x1c2)]),createHash('sha256')[_0x2c880b(0x1cb)](JSON['stringify'](_0x455c44))['digest']('hex')[_0x2c880b(0x1c4)](0x0,0xc);}function extractPort(_0x4523d1){const _0x1a7010=_0x519f7c;try{return new URL(_0x4523d1)[_0x1a7010(0x1aa)];}catch{return'';}}function sortObjectKeys(_0xebf5eb){const _0x298846=_0x519f7c,_0x3d1109={};for(const _0x21d3ef of Object[_0x298846(0x19f)](_0xebf5eb)[_0x298846(0x1ac)]()){_0x3d1109[_0x21d3ef]=_0xebf5eb[_0x21d3ef];}return _0x3d1109;}export function getSessionCachePath(_0x31fa66,_0x567503){return join(getRangerHomeDir(),'auth',_0x31fa66+'-'+_0x567503+'.json');}export function getStorageStatePath(_0x439e77){const _0x1d74a0=_0x519f7c;return _0x439e77[_0x1d74a0(0x19e)](/\.json$/,_0x1d74a0(0x1bb));}export function needsTunnel(_0x2083a5){const _0x4f9187=_0x519f7c,_0x1b81d2={'cOKLe':'localhost','aOAvh':function(_0x2c5731,_0x365c81){return _0x2c5731===_0x365c81;},'QIYLY':'127.0.0.1'};let _0x1ebc25;try{_0x1ebc25=new URL(_0x2083a5)['hostname'];}catch{return![];}if(_0x1ebc25===_0x1b81d2['cOKLe']||_0x1b81d2[_0x4f9187(0x1c9)](_0x1ebc25,_0x1b81d2[_0x4f9187(0x1ca)]))return!![];if(_0x1ebc25['endsWith'](_0x4f9187(0x1a4)))return!![];if(_0x1ebc25['includes'](_0x4f9187(0x1c1)))return!![];return![];}export function isBareLocalhost(_0x32acb7){const _0x49a58d=_0x519f7c,_0x58c5c1={'OddQp':'127.0.0.1','VySnd':function(_0x822675,_0x5d9c4e){return _0x822675===_0x5d9c4e;},'FLOXp':'[::1]'};let _0x2b9e4d;try{_0x2b9e4d=new URL(_0x32acb7)[_0x49a58d(0x1cd)];}catch{return![];}return _0x2b9e4d===_0x49a58d(0x1af)||_0x2b9e4d===_0x58c5c1[_0x49a58d(0x194)]||_0x2b9e4d==='::1'||_0x58c5c1[_0x49a58d(0x1c3)](_0x2b9e4d,_0x58c5c1[_0x49a58d(0x1bf)]);}export function orderLoginDomains(_0x3f276a,_0xe0782a){const _0xd56cda=_0xe0782a??[];if(!_0x3f276a)return _0xd56cda;return[_0x3f276a,..._0xd56cda['filter'](_0xaf52a0=>_0xaf52a0!==_0x3f276a)];}export function hostnameOf(_0x1b0ad3){const _0x557167=_0x519f7c;return new URL(_0x1b0ad3)[_0x557167(0x1cd)];}export function duplicateCookiesForDomains(_0x12e74f,_0x4fc9a9){const _0x10cd80=_0x519f7c,_0x550875=[..._0x12e74f],_0x52b63c=new Set(_0x12e74f['map'](_0x1884c7=>_0x1884c7[_0x10cd80(0x1cc)]));for(const _0x3faa40 of _0x4fc9a9){let _0x3a5db6;try{_0x3a5db6=hostnameOf(_0x3faa40);}catch{continue;}if(!_0x3a5db6)continue;const _0x2d96e5=_0x3a5db6[_0x10cd80(0x1a6)]('.')?_0x3a5db6:'.'+_0x3a5db6;if(_0x52b63c[_0x10cd80(0x1a3)](_0x3a5db6)||_0x52b63c[_0x10cd80(0x1a3)](_0x2d96e5))continue;for(const _0x47303c of _0x12e74f){_0x550875[_0x10cd80(0x19a)]({..._0x47303c,'domain':_0x2d96e5});}_0x52b63c[_0x10cd80(0x1ba)](_0x2d96e5);}return _0x550875;}export function resolveAuthEnvironmentLocally(_0x39bf3a,_0x55f170){const _0x109b06=_0x519f7c,_0x340b2a=_0x39bf3a['environments'];if(_0x55f170){const _0x26ec6d=_0x340b2a[_0x55f170];if(!_0x26ec6d)return null;return{'key':_0x55f170,..._0x26ec6d};}if(_0x39bf3a[_0x109b06(0x198)]){const _0x4f84da=_0x340b2a[_0x39bf3a['defaultEnvironmentKey']];if(!_0x4f84da)return null;return{'key':_0x39bf3a['defaultEnvironmentKey'],..._0x4f84da};}const _0x2e039c=Object[_0x109b06(0x19f)](_0x340b2a);if(_0x2e039c[_0x109b06(0x1bd)]===0x1){const _0x4616c8=_0x2e039c[0x0];return{'key':_0x4616c8,..._0x340b2a[_0x4616c8]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x7be335,_0x27333f){try{if(_0x27333f)return new URL(_0x27333f,_0x7be335)['toString']();return new URL(_0x7be335)['toString']();}catch{return null;}}export function looksLikeLoginUrl(_0x258061){const _0x3cb6e4=_0x519f7c;try{const _0x520049=new URL(_0x258061);return LOGIN_URL_PATTERN[_0x3cb6e4(0x1b6)](_0x520049[_0x3cb6e4(0x1b0)]);}catch{return LOGIN_URL_PATTERN[_0x3cb6e4(0x1b6)](_0x258061);}}export async function isCachedSessionLive(_0x307e0b,_0x435839,_0x3ff967={},_0x181ae7={}){const _0x30c292=_0x519f7c,_0xcea016={'FbMSQ':function(_0xd82247,_0x380bf2,_0x53ee53){return _0xd82247(_0x380bf2,_0x53ee53);},'AuPjG':_0x30c292(0x1a9),'mBkVD':function(_0x420682,_0x5409da){return _0x420682===_0x5409da;}},_0x238a92=_0xcea016[_0x30c292(0x1a5)](buildSessionCheckUrl,_0x435839,_0x3ff967['sessionCheckPath']);if(!_0x238a92)return!![];if(!_0x181ae7[_0x30c292(0x1c6)])return!![];let _0x405aa5=null;try{_0x405aa5=await _0x181ae7[_0x30c292(0x1c6)]();const _0x5b6d45=await _0x405aa5['newContext']({'storageState':_0x307e0b,'ignoreHTTPSErrors':!![],..._0x3ff967['setupHeaders']?{'extraHTTPHeaders':_0x3ff967['setupHeaders']}:{}}),_0x39cae8=await _0x5b6d45['newPage'](),_0x38eb7c=await _0x39cae8['goto'](_0x238a92,{'waitUntil':_0xcea016[_0x30c292(0x1c8)],'timeout':0x3a98}),_0x9f38b6=_0x38eb7c?.[_0x30c292(0x1be)]();if(_0xcea016[_0x30c292(0x1b2)](_0x9f38b6,0x191)||_0x9f38b6===0x193)return![];const _0x13f1ed=_0x39cae8[_0x30c292(0x195)]();if(looksLikeLoginUrl(_0x13f1ed))return![];return!![];}catch{return![];}finally{if(_0x405aa5)await _0x405aa5[_0x30c292(0x1c5)]()[_0x30c292(0x19c)](()=>{});}}
1
+ const _0x5ce9ca=_0x1d3a;(function(_0x598b85,_0x5743c8){const _0x42f91e=_0x1d3a,_0x192686=_0x598b85();while(!![]){try{const _0x1e2624=parseInt(_0x42f91e(0x1ab))/0x1*(parseInt(_0x42f91e(0x1a1))/0x2)+parseInt(_0x42f91e(0x1b4))/0x3*(-parseInt(_0x42f91e(0x1c9))/0x4)+parseInt(_0x42f91e(0x1d1))/0x5+-parseInt(_0x42f91e(0x1c8))/0x6+-parseInt(_0x42f91e(0x1aa))/0x7*(parseInt(_0x42f91e(0x19c))/0x8)+parseInt(_0x42f91e(0x1b2))/0x9*(parseInt(_0x42f91e(0x1c6))/0xa)+-parseInt(_0x42f91e(0x1b3))/0xb*(-parseInt(_0x42f91e(0x1b5))/0xc);if(_0x1e2624===_0x5743c8)break;else _0x192686['push'](_0x192686['shift']());}catch(_0x3337e3){_0x192686['push'](_0x192686['shift']());}}}(_0x2da4,0x57ad4));import{createHash}from'crypto';import{join}from'path';function _0x2da4(){const _0x142ebf=['hostname','BpCBY','[::1]','has','449474FwYjOp','wxzYR','status','effectiveBaseUrl','zdshA','etdqN','lhyDX','MrvIj','127.0.0.1','35GYIKQN','1SlvIIv','setupHeaders','keys','ktpDh','dLGmL','defaultEnvironmentKey','sort','1323BTaXOa','14887147kHVqIV','85362IzzBek','12lZpZzh','wzPTL','profileName','orgId','goto','digest','stdout','stringify','brzKI','::1','clientIp','userAgent','MMWjI','includes','gcARh','QlxxW','stdin','6650hsYrzg','newPage','4146390LscHYQ','16imCGVL','QbZkR','endsWith','launchBrowser','toString','baseUrl','hex','isTTY','212405GfYAnS','length','newContext','pathname','port','Wvbar','localhost','filter','.storageState.json','.json','886952eBwKQr'];_0x2da4=function(){return _0x142ebf;};return _0x2da4();}import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x38adf1=process['env'],_0x443637={'stdin':process[_0x5ce9ca(0x1c5)],'stdout':process['stdout']}){const _0x54b79d=_0x5ce9ca,_0x40c798={'sDFKd':function(_0x125a3d,_0x59adea){return _0x125a3d(_0x59adea);}};if(_0x38adf1['CI'])return![];return _0x40c798['sDFKd'](Boolean,_0x443637[_0x54b79d(0x1c5)]['isTTY'])&&Boolean(_0x443637[_0x54b79d(0x1bb)][_0x54b79d(0x1d0)]);}export const DEFAULT_INVALIDATE_ON=[];function _0x1d3a(_0x442e3a,_0x4ab97b){_0x442e3a=_0x442e3a-0x198;const _0x2da491=_0x2da4();let _0x1d3a4a=_0x2da491[_0x442e3a];return _0x1d3a4a;}export function sessionCacheHash(_0x422f0c){const _0x3e7d1b=_0x5ce9ca,_0xf3e467={'tmFRZ':_0x3e7d1b(0x1ac),'GxNAe':_0x3e7d1b(0x1d5),'dLGmL':_0x3e7d1b(0x1c0),'brzKI':function(_0x43208f,_0x4ed3fe){return _0x43208f!==_0x4ed3fe;},'gcARh':function(_0x33b956,_0x55ec7a){return _0x33b956!==_0x55ec7a;}},_0x25dc76=new Set(_0x422f0c['invalidateOn']??DEFAULT_INVALIDATE_ON);_0x422f0c[_0x3e7d1b(0x1a4)]&&needsTunnel(_0x422f0c['effectiveBaseUrl'])&&_0x25dc76['add'](_0x3e7d1b(0x1ce));const _0x16891c={'orgId':_0x422f0c[_0x3e7d1b(0x1b8)],'profileName':_0x422f0c[_0x3e7d1b(0x1b7)]};return _0x25dc76[_0x3e7d1b(0x1a0)](_0x3e7d1b(0x1ce))&&(_0x16891c['effectiveBaseUrl']=_0x422f0c['effectiveBaseUrl']),_0x25dc76['has'](_0xf3e467['tmFRZ'])&&(_0x16891c['setupHeaders']=_0x422f0c[_0x3e7d1b(0x1ac)]?sortObjectKeys(_0x422f0c['setupHeaders']):_0x422f0c[_0x3e7d1b(0x1ac)]),_0x25dc76['has'](_0xf3e467['GxNAe'])&&(_0x16891c['port']=extractPort(_0x422f0c[_0x3e7d1b(0x1a4)])),_0x25dc76['has'](_0xf3e467[_0x3e7d1b(0x1af)])&&_0xf3e467[_0x3e7d1b(0x1bd)](_0x422f0c[_0x3e7d1b(0x1c0)],undefined)&&(_0x16891c[_0x3e7d1b(0x1c0)]=_0x422f0c[_0x3e7d1b(0x1c0)]),_0x25dc76[_0x3e7d1b(0x1a0)](_0x3e7d1b(0x1bf))&&_0xf3e467[_0x3e7d1b(0x1c3)](_0x422f0c[_0x3e7d1b(0x1bf)],undefined)&&(_0x16891c['clientIp']=_0x422f0c['clientIp']),createHash('sha256')['update'](JSON[_0x3e7d1b(0x1bc)](_0x16891c))[_0x3e7d1b(0x1ba)](_0x3e7d1b(0x1cf))['slice'](0x0,0xc);}function extractPort(_0x2b59e7){const _0x477b48=_0x5ce9ca;try{return new URL(_0x2b59e7)[_0x477b48(0x1d5)];}catch{return'';}}function sortObjectKeys(_0x24e3fe){const _0x1ca5f9=_0x5ce9ca,_0x2b9357={};for(const _0x12d27d of Object[_0x1ca5f9(0x1ad)](_0x24e3fe)[_0x1ca5f9(0x1b1)]()){_0x2b9357[_0x12d27d]=_0x24e3fe[_0x12d27d];}return _0x2b9357;}export function getSessionCachePath(_0x4717f7,_0x26e799){const _0x2d6f63=_0x5ce9ca,_0x352022={'QlxxW':function(_0x808583,_0x3be6a8,_0x1de023,_0x59b724){return _0x808583(_0x3be6a8,_0x1de023,_0x59b724);},'hAavY':function(_0x2d33e4){return _0x2d33e4();},'SjLnK':'auth'};return _0x352022[_0x2d6f63(0x1c4)](join,_0x352022['hAavY'](getRangerHomeDir),_0x352022['SjLnK'],_0x4717f7+'-'+_0x26e799+_0x2d6f63(0x19b));}export function getStorageStatePath(_0x1e4342){const _0x1d41fc=_0x5ce9ca,_0x1f4661={'wzPTL':_0x1d41fc(0x19a)};return _0x1e4342['replace'](/\.json$/,_0x1f4661[_0x1d41fc(0x1b6)]);}export function needsTunnel(_0x121119){const _0x1e4815=_0x5ce9ca,_0x566783={'lhyDX':function(_0x58d183,_0x5142e7){return _0x58d183===_0x5142e7;},'QCtKy':_0x1e4815(0x1a9),'ktpDh':'.localhost','BpCBY':'localhost.'};let _0x54f625;try{_0x54f625=new URL(_0x121119)['hostname'];}catch{return![];}if(_0x54f625===_0x1e4815(0x198)||_0x566783[_0x1e4815(0x1a7)](_0x54f625,_0x566783['QCtKy']))return!![];if(_0x54f625[_0x1e4815(0x1cb)](_0x566783[_0x1e4815(0x1ae)]))return!![];if(_0x54f625[_0x1e4815(0x1c2)](_0x566783[_0x1e4815(0x19e)]))return!![];return![];}export function isBareLocalhost(_0x393cde){const _0x438d50=_0x5ce9ca,_0x4fe771={'etdqN':function(_0x41a564,_0x4d4adb){return _0x41a564===_0x4d4adb;},'Wvbar':'localhost','zdshA':_0x438d50(0x1a9),'MrvIj':_0x438d50(0x1be),'MMWjI':function(_0x5879fa,_0x3eaaa4){return _0x5879fa===_0x3eaaa4;}};let _0x47fff5;try{_0x47fff5=new URL(_0x393cde)['hostname'];}catch{return![];}return _0x4fe771['etdqN'](_0x47fff5,_0x4fe771[_0x438d50(0x1d6)])||_0x4fe771[_0x438d50(0x1a6)](_0x47fff5,_0x4fe771[_0x438d50(0x1a5)])||_0x4fe771[_0x438d50(0x1a6)](_0x47fff5,_0x4fe771[_0x438d50(0x1a8)])||_0x4fe771[_0x438d50(0x1c1)](_0x47fff5,_0x438d50(0x19f));}export function orderLoginDomains(_0x3e8541,_0x243c1f){const _0x52c4a6=_0x5ce9ca,_0x47fbf9=_0x243c1f??[];if(!_0x3e8541)return _0x47fbf9;return[_0x3e8541,..._0x47fbf9[_0x52c4a6(0x199)](_0x4928bd=>_0x4928bd!==_0x3e8541)];}export function hostnameOf(_0x4a7b27){const _0x468565=_0x5ce9ca;return new URL(_0x4a7b27)[_0x468565(0x19d)];}export function duplicateCookiesForDomains(_0x339c64,_0x2628de){const _0x330840=_0x5ce9ca,_0x1d68eb={'VjelF':function(_0x4b0bff,_0xd33b24){return _0x4b0bff(_0xd33b24);}},_0x3f6bc0=[..._0x339c64],_0x21eff3=new Set(_0x339c64['map'](_0x14eab6=>_0x14eab6['domain']));for(const _0x358b46 of _0x2628de){let _0x2fb6f9;try{_0x2fb6f9=_0x1d68eb['VjelF'](hostnameOf,_0x358b46);}catch{continue;}if(!_0x2fb6f9)continue;const _0x2819ea=_0x2fb6f9['startsWith']('.')?_0x2fb6f9:'.'+_0x2fb6f9;if(_0x21eff3[_0x330840(0x1a0)](_0x2fb6f9)||_0x21eff3['has'](_0x2819ea))continue;for(const _0x30e6ec of _0x339c64){_0x3f6bc0['push']({..._0x30e6ec,'domain':_0x2819ea});}_0x21eff3['add'](_0x2819ea);}return _0x3f6bc0;}export function resolveAuthEnvironmentLocally(_0x196797,_0x92ce9d){const _0x5b9315=_0x5ce9ca,_0x2d620e=_0x196797['environments'];if(_0x92ce9d){const _0x3474c7=_0x2d620e[_0x92ce9d];if(!_0x3474c7)return null;return{'key':_0x92ce9d,..._0x3474c7};}if(_0x196797['defaultEnvironmentKey']){const _0x80226c=_0x2d620e[_0x196797[_0x5b9315(0x1b0)]];if(!_0x80226c)return null;return{'key':_0x196797[_0x5b9315(0x1b0)],..._0x80226c};}const _0x4dbfac=Object[_0x5b9315(0x1ad)](_0x2d620e);if(_0x4dbfac[_0x5b9315(0x1d2)]===0x1){const _0x575641=_0x4dbfac[0x0];return{'key':_0x575641,..._0x2d620e[_0x575641]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x28cbe7,_0x26efa3){const _0x275b6f=_0x5ce9ca;try{if(_0x26efa3)return new URL(_0x26efa3,_0x28cbe7)[_0x275b6f(0x1cd)]();return new URL(_0x28cbe7)[_0x275b6f(0x1cd)]();}catch{return null;}}export function looksLikeLoginUrl(_0xa574bd){const _0x4add3d=_0x5ce9ca;try{const _0x2314c8=new URL(_0xa574bd);return LOGIN_URL_PATTERN['test'](_0x2314c8[_0x4add3d(0x1d4)]);}catch{return LOGIN_URL_PATTERN['test'](_0xa574bd);}}export async function isCachedSessionLive(_0x51dfa5,_0x1d84d7,_0x2c3666={},_0x30d367={}){const _0x1e4bb0=_0x5ce9ca,_0x1696f2={'wxzYR':function(_0x2b1b47,_0x33a7e7,_0x1128cb){return _0x2b1b47(_0x33a7e7,_0x1128cb);},'IyJHM':'domcontentloaded','QbZkR':function(_0xcc7ac,_0x3981cf){return _0xcc7ac===_0x3981cf;},'hVSVO':function(_0x2d4f86,_0x179b17){return _0x2d4f86(_0x179b17);}},_0x590ba6=_0x1696f2[_0x1e4bb0(0x1a2)](buildSessionCheckUrl,_0x1d84d7,_0x2c3666['sessionCheckPath']);if(!_0x590ba6)return!![];if(!_0x30d367['launchBrowser'])return!![];let _0x695441=null;try{_0x695441=await _0x30d367[_0x1e4bb0(0x1cc)]();const _0x3534cb=await _0x695441[_0x1e4bb0(0x1d3)]({'storageState':_0x51dfa5,'ignoreHTTPSErrors':!![],..._0x2c3666[_0x1e4bb0(0x1ac)]?{'extraHTTPHeaders':_0x2c3666['setupHeaders']}:{}}),_0x25eaf2=await _0x3534cb[_0x1e4bb0(0x1c7)](),_0x48bb4e=await _0x25eaf2[_0x1e4bb0(0x1b9)](_0x590ba6,{'waitUntil':_0x1696f2['IyJHM'],'timeout':0x3a98}),_0x36c72d=_0x48bb4e?.[_0x1e4bb0(0x1a3)]();if(_0x36c72d===0x191||_0x1696f2[_0x1e4bb0(0x1ca)](_0x36c72d,0x193))return![];const _0xa8c92d=_0x25eaf2['url']();if(_0x1696f2['hVSVO'](looksLikeLoginUrl,_0xa8c92d))return![];return!![];}catch{return![];}finally{if(_0x695441)await _0x695441['close']()['catch'](()=>{});}}
@@ -1 +1 @@
1
- (function(_0x288574,_0x1efc7b){const _0x12e7d3=_0x1d7b,_0x42f25c=_0x288574();while(!![]){try{const _0x2db742=-parseInt(_0x12e7d3(0x69))/0x1*(-parseInt(_0x12e7d3(0x73))/0x2)+-parseInt(_0x12e7d3(0x6c))/0x3*(-parseInt(_0x12e7d3(0x68))/0x4)+parseInt(_0x12e7d3(0x67))/0x5+parseInt(_0x12e7d3(0x6a))/0x6*(-parseInt(_0x12e7d3(0x6f))/0x7)+parseInt(_0x12e7d3(0x6e))/0x8*(-parseInt(_0x12e7d3(0x74))/0x9)+-parseInt(_0x12e7d3(0x75))/0xa+parseInt(_0x12e7d3(0x78))/0xb;if(_0x2db742===_0x1efc7b)break;else _0x42f25c['push'](_0x42f25c['shift']());}catch(_0x5d272a){_0x42f25c['push'](_0x42f25c['shift']());}}}(_0x5252,0xaeedf));function _0x1d7b(_0x55b6b4,_0x125b19){_0x55b6b4=_0x55b6b4-0x67;const _0x525288=_0x5252();let _0x1d7b51=_0x525288[_0x55b6b4];return _0x1d7b51;}import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';const ALGORITHM='aes-256-gcm',SALT='ranger-auth-encryption',KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;export function deriveKey(_0x529b71){const _0xaa0d60={'qrQco':'sha256'};return pbkdf2Sync(_0x529b71,SALT,0x186a0,KEY_LENGTH,_0xaa0d60['qrQco']);}export function encrypt(_0x3389d9,_0x4da4d9){const _0x21da04=_0x1d7b,_0x576dcd={'OsawA':'utf8'},_0x48b467=deriveKey(_0x4da4d9),_0x265c74=randomBytes(IV_LENGTH),_0x3c4dab=createCipheriv(ALGORITHM,_0x48b467,_0x265c74),_0x5a12a9=Buffer['concat']([_0x3c4dab[_0x21da04(0x6d)](_0x3389d9,_0x576dcd[_0x21da04(0x76)]),_0x3c4dab['final']()]),_0x27f00e=_0x3c4dab[_0x21da04(0x77)]();return Buffer['concat']([_0x265c74,_0x27f00e,_0x5a12a9]);}function _0x5252(){const _0x200197=['1417lzwjAu','459066EqbrhE','final','117lrCLYV','update','904gTfrDC','14RGxIww','mwvGo','utf8','TKjMX','1238BsgHmk','108918ywLZpC','12819690aklovP','OsawA','getAuthTag','8658331sSUNMj','4573055DtFnCa','96428KDTkep'];_0x5252=function(){return _0x200197;};return _0x5252();}export function decrypt(_0x2cacee,_0x478346){const _0x18b6ee=_0x1d7b,_0x496f66={'uCrUc':function(_0x442ff0,_0x2a068d){return _0x442ff0(_0x2a068d);},'TKjMX':function(_0x123944,_0x1b6934){return _0x123944+_0x1b6934;},'qEoSC':function(_0x4900e6,_0x516135,_0x28e7e5,_0x1409a2){return _0x4900e6(_0x516135,_0x28e7e5,_0x1409a2);},'mwvGo':_0x18b6ee(0x71)},_0x22861a=_0x496f66['uCrUc'](deriveKey,_0x478346),_0x35b820=_0x2cacee['subarray'](0x0,IV_LENGTH),_0x107d36=_0x2cacee['subarray'](IV_LENGTH,_0x496f66['TKjMX'](IV_LENGTH,TAG_LENGTH)),_0x30cee6=_0x2cacee['subarray'](_0x496f66['TKjMX'](IV_LENGTH,TAG_LENGTH)),_0x50820f=_0x496f66['qEoSC'](createDecipheriv,ALGORITHM,_0x22861a,_0x35b820);return _0x50820f['setAuthTag'](_0x107d36),_0x496f66[_0x18b6ee(0x72)](_0x50820f[_0x18b6ee(0x6d)](_0x30cee6),_0x50820f[_0x18b6ee(0x6b)](_0x496f66[_0x18b6ee(0x70)]));}
1
+ function _0x388f(_0x39c244,_0x51b572){_0x39c244=_0x39c244-0x18c;const _0x34d883=_0x34d8();let _0x388f95=_0x34d883[_0x39c244];return _0x388f95;}const _0xde2e85=_0x388f;(function(_0x11a38d,_0x598480){const _0x24cda4=_0x388f,_0x34547d=_0x11a38d();while(!![]){try{const _0x541cc1=-parseInt(_0x24cda4(0x194))/0x1*(parseInt(_0x24cda4(0x18d))/0x2)+-parseInt(_0x24cda4(0x198))/0x3+parseInt(_0x24cda4(0x199))/0x4+-parseInt(_0x24cda4(0x190))/0x5+-parseInt(_0x24cda4(0x191))/0x6*(parseInt(_0x24cda4(0x19b))/0x7)+parseInt(_0x24cda4(0x192))/0x8+-parseInt(_0x24cda4(0x197))/0x9;if(_0x541cc1===_0x598480)break;else _0x34547d['push'](_0x34547d['shift']());}catch(_0x427b38){_0x34547d['push'](_0x34547d['shift']());}}}(_0x34d8,0x5e04e));import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';const ALGORITHM='aes-256-gcm',SALT=_0xde2e85(0x18e),KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;export function deriveKey(_0x436237){const _0x4d56f5=_0xde2e85,_0x29a119={'lhaZp':function(_0x4da27d,_0x46b5a7,_0x5d4d3e,_0x4cc404,_0x59d43f,_0x1c1ba4){return _0x4da27d(_0x46b5a7,_0x5d4d3e,_0x4cc404,_0x59d43f,_0x1c1ba4);}};return _0x29a119[_0x4d56f5(0x193)](pbkdf2Sync,_0x436237,SALT,0x186a0,KEY_LENGTH,_0x4d56f5(0x19c));}export function encrypt(_0x4316ba,_0x1887b2){const _0x469302=_0xde2e85,_0x26e83a={'lpUrp':function(_0x635471,_0x3b4919){return _0x635471(_0x3b4919);},'zWher':function(_0x4c33f6,_0x54f560,_0x3b4e66,_0x283ba9){return _0x4c33f6(_0x54f560,_0x3b4e66,_0x283ba9);}},_0xe42d21=_0x26e83a['lpUrp'](deriveKey,_0x1887b2),_0xe542df=randomBytes(IV_LENGTH),_0x11b0fd=_0x26e83a[_0x469302(0x196)](createCipheriv,ALGORITHM,_0xe42d21,_0xe542df),_0x2cfa66=Buffer[_0x469302(0x18f)]([_0x11b0fd['update'](_0x4316ba,'utf8'),_0x11b0fd[_0x469302(0x19d)]()]),_0x4a1dc7=_0x11b0fd['getAuthTag']();return Buffer['concat']([_0xe542df,_0x4a1dc7,_0x2cfa66]);}function _0x34d8(){const _0xf43aff=['ranger-auth-encryption','concat','1033420fTRGFs','51954hxzzkG','3967552aDtEwR','lhaZp','122JBjQLl','update','zWher','2131002WZEQtp','1136091DPWykw','2977968WSbhIu','GtrHT','21inkaFb','sha256','final','utf8','118dnSPzd'];_0x34d8=function(){return _0xf43aff;};return _0x34d8();}export function decrypt(_0x2db0c9,_0x282107){const _0x2c6fb2=_0xde2e85,_0x5eb918={'GtrHT':function(_0x2a9e33,_0x276499){return _0x2a9e33(_0x276499);},'jQMPU':function(_0x48df75,_0x2956c7){return _0x48df75+_0x2956c7;}},_0x540e84=_0x5eb918[_0x2c6fb2(0x19a)](deriveKey,_0x282107),_0x3405fc=_0x2db0c9['subarray'](0x0,IV_LENGTH),_0x4de63f=_0x2db0c9['subarray'](IV_LENGTH,_0x5eb918['jQMPU'](IV_LENGTH,TAG_LENGTH)),_0x201c5f=_0x2db0c9['subarray'](IV_LENGTH+TAG_LENGTH),_0x583405=createDecipheriv(ALGORITHM,_0x540e84,_0x3405fc);return _0x583405['setAuthTag'](_0x4de63f),_0x583405[_0x2c6fb2(0x195)](_0x201c5f)+_0x583405['final'](_0x2c6fb2(0x18c));}
@@ -1 +1 @@
1
- const _0x31b413=_0x438b;function _0x5e96(){const _0x432cf8=['errorType','slice','missing_option','push','join','EUjmZ','invalid_option_value','877572DxIvOg','mRyLp','[REDACTED]','NbEKT','4596835UlWghY','25217395jzwbBO','Unknown\x20command','has','BhrVg','0|3|6|5|2|7|1|4','env','--password','mYSGU','unknown_command','--cookie','stringify','Authorization','featureId','Bearer\x20','includes','sessionId','error','--credentials','application/json','POST','unknown_argument','--apikey','364117PbFrnf','rawCommand','--api-key','6838512jqeylI','2133916ZXgXTW','3846564kgpCPp','--secret','isTTY','=[REDACTED]','Nytyt'];_0x5e96=function(){return _0x432cf8;};return _0x5e96();}(function(_0x4441ca,_0x345a17){const _0x5afa9a=_0x438b,_0x14f353=_0x4441ca();while(!![]){try{const _0x560f70=-parseInt(_0x5afa9a(0x11b))/0x1+parseInt(_0x5afa9a(0x12c))/0x2+-parseInt(_0x5afa9a(0x120))/0x3+parseInt(_0x5afa9a(0x11f))/0x4+-parseInt(_0x5afa9a(0x104))/0x5+-parseInt(_0x5afa9a(0x11e))/0x6+parseInt(_0x5afa9a(0x105))/0x7;if(_0x560f70===_0x345a17)break;else _0x14f353['push'](_0x14f353['shift']());}catch(_0x51282b){_0x14f353['push'](_0x14f353['shift']());}}}(_0x5e96,0xd43ce));function _0x438b(_0x3499a3,_0x2f9889){_0x3499a3=_0x3499a3-0x101;const _0x5e966b=_0x5e96();let _0x438b67=_0x5e966b[_0x3499a3];return _0x438b67;}import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set(['--token','-t',_0x31b413(0x121),_0x31b413(0x11d),_0x31b413(0x11a),'--key',_0x31b413(0x10b),'--pass','--auth','--authorization','--header',_0x31b413(0x10e),_0x31b413(0x116)]),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0x2eccc4){return TOKEN_PATTERNS['some'](_0x378a92=>_0x378a92['test'](_0x2eccc4));}export function sanitizeArgs(_0x523448){const _0x1229e2=_0x31b413,_0x5e0bd8={'NbEKT':function(_0x581c35,_0x32ba0a){return _0x581c35<_0x32ba0a;},'MhAei':function(_0x4794ba,_0x925068){return _0x4794ba!==_0x925068;},'okzZj':function(_0x2ab7b4,_0x1c384a){return _0x2ab7b4(_0x1c384a);}},_0x3ada16=[];let _0x2d2bb0=![];for(let _0x21451b=0x0;_0x5e0bd8[_0x1229e2(0x103)](_0x21451b,_0x523448['length']);_0x21451b++){const _0x48961d=_0x523448[_0x21451b];if(_0x2d2bb0){_0x3ada16[_0x1229e2(0x128)]('[REDACTED]'),_0x2d2bb0=![];continue;}if(_0x48961d['startsWith']('--')||_0x48961d['startsWith']('-')){const _0x1a1690=_0x48961d['indexOf']('=');if(_0x5e0bd8['MhAei'](_0x1a1690,-0x1)){const _0x34bbbb=_0x48961d[_0x1229e2(0x126)](0x0,_0x1a1690)['toLowerCase']();if(SENSITIVE_FLAGS[_0x1229e2(0x107)](_0x34bbbb)){_0x3ada16['push'](_0x48961d['slice'](0x0,_0x1a1690)+_0x1229e2(0x123));continue;}}else{const _0x1f7bb5=_0x48961d['toLowerCase']();SENSITIVE_FLAGS[_0x1229e2(0x107)](_0x1f7bb5)&&(_0x2d2bb0=!![]);}_0x3ada16[_0x1229e2(0x128)](_0x48961d);}else _0x5e0bd8['okzZj'](looksLikeToken,_0x48961d)?_0x3ada16[_0x1229e2(0x128)](_0x1229e2(0x102)):_0x3ada16['push'](_0x48961d);}return _0x3ada16[_0x1229e2(0x129)]('\x20');}export async function logDesirePath(_0x564182){const _0x2d3f96=_0x31b413,_0x1ba70d={'EUjmZ':function(_0x5d3314){return _0x5d3314();},'mYSGU':'has_token','SAnQc':function(_0x470182,_0x4e16d1,_0x110ce8){return _0x470182(_0x4e16d1,_0x110ce8);},'BhrVg':_0x2d3f96(0x118)};try{const _0x597d73=await getToken()['catch'](()=>null),_0xe814c=_0x1ba70d[_0x2d3f96(0x12a)](getApiBaseUrl),_0x58cdbd=getCurrentVersion(),_0x48e408=_0x597d73?_0x1ba70d[_0x2d3f96(0x10c)]:'no_token',_0x2cdc98={..._0x564182['metadata'],'authStatus':_0x48e408,'isTty':process['stdout'][_0x2d3f96(0x122)]??![]},_0xd81792={'Content-Type':_0x2d3f96(0x117)};_0x597d73&&(_0xd81792[_0x2d3f96(0x110)]=_0x2d3f96(0x112)+_0x597d73);const _0x280254={'rawCommand':_0x564182[_0x2d3f96(0x11c)],'errorMessage':_0x564182['errorMessage'],'errorType':_0x564182[_0x2d3f96(0x125)],'featureId':_0x564182[_0x2d3f96(0x111)],'sessionId':_0x564182[_0x2d3f96(0x114)],'metadata':_0x2cdc98,'cliVersion':_0x58cdbd};process[_0x2d3f96(0x10a)]['DEBUG']&&(console[_0x2d3f96(0x115)]('[desire-path]\x20Sending\x20log\x20to\x20'+_0xe814c+'/api/v1/mcp/desire-path-logs'),console['error']('[desire-path]\x20Payload:\x20'+JSON[_0x2d3f96(0x10f)](_0x280254,null,0x2))),await _0x1ba70d['SAnQc'](fetch,_0xe814c+'/api/v1/mcp/desire-path-logs',{'method':_0x1ba70d[_0x2d3f96(0x108)],'headers':_0xd81792,'body':JSON[_0x2d3f96(0x10f)](_0x280254)});}catch(_0x2fcd40){process[_0x2d3f96(0x10a)]['DEBUG']&&console[_0x2d3f96(0x115)]('[desire-path]\x20Failed\x20to\x20send:\x20'+_0x2fcd40);}}export function getErrorType(_0x17f291,_0x173463){const _0x1a108c=_0x31b413,_0x370631={'Nytyt':'runtime_error','mRyLp':'Missing\x20required\x20argument','XqRnM':'Not\x20enough\x20non-option\x20arguments','jTJKt':'unknown','qdKzZ':_0x1a108c(0x119)},_0x320e77=_0x1a108c(0x109)['split']('|');let _0x908f70=0x0;while(!![]){switch(_0x320e77[_0x908f70++]){case'0':if(_0x173463)return _0x370631[_0x1a108c(0x124)];continue;case'1':if(_0x17f291[_0x1a108c(0x113)](_0x370631[_0x1a108c(0x101)]))return _0x1a108c(0x127);continue;case'2':if(_0x17f291[_0x1a108c(0x113)](_0x370631['XqRnM']))return'missing_required_argument';continue;case'3':if(!_0x17f291)return _0x370631['jTJKt'];continue;case'4':return'syntax_error';case'5':if(_0x17f291[_0x1a108c(0x113)]('Unknown\x20argument'))return _0x370631['qdKzZ'];continue;case'6':if(_0x17f291['includes'](_0x1a108c(0x106)))return _0x1a108c(0x10d);continue;case'7':if(_0x17f291[_0x1a108c(0x113)]('Invalid\x20values'))return _0x1a108c(0x12b);continue;}break;}}
1
+ const _0xc810c1=_0x3624;function _0x3624(_0x325327,_0x329dee){_0x325327=_0x325327-0x12a;const _0x594d26=_0x594d();let _0x3624fd=_0x594d26[_0x325327];return _0x3624fd;}(function(_0x539e2b,_0xba4fdb){const _0x2ae90b=_0x3624,_0x51ced0=_0x539e2b();while(!![]){try{const _0x2db7d5=parseInt(_0x2ae90b(0x15f))/0x1*(-parseInt(_0x2ae90b(0x154))/0x2)+-parseInt(_0x2ae90b(0x12e))/0x3*(parseInt(_0x2ae90b(0x143))/0x4)+parseInt(_0x2ae90b(0x149))/0x5*(parseInt(_0x2ae90b(0x12d))/0x6)+parseInt(_0x2ae90b(0x14e))/0x7*(parseInt(_0x2ae90b(0x132))/0x8)+-parseInt(_0x2ae90b(0x14b))/0x9+parseInt(_0x2ae90b(0x13d))/0xa*(parseInt(_0x2ae90b(0x12b))/0xb)+parseInt(_0x2ae90b(0x160))/0xc;if(_0x2db7d5===_0xba4fdb)break;else _0x51ced0['push'](_0x51ced0['shift']());}catch(_0x223149){_0x51ced0['push'](_0x51ced0['shift']());}}}(_0x594d,0x1ea1d));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';function _0x594d(){const _0x2876a5=['/api/v1/mcp/desire-path-logs','Missing\x20required\x20argument','sessionId','[desire-path]\x20Payload:\x20','split','2VmTYEl','application/json','--pass','RMxvY','UxDxb','push','stringify','unknown','has_token','--secret','error','205305KhPAxJ','3445884fXeRhz','--api-key','99tSxTUN','AmFab','18GgCxSr','325848HXtXtS','test','[REDACTED]','[desire-path]\x20Failed\x20to\x20send:\x20','8zMlASB','--header','DEBUG','grvGn','invalid_option_value','--credentials','--authorization','has','catch','--key','slice','209390mHykER','join','toLowerCase','includes','--auth','Unknown\x20argument','4arkhZM','unknown_command','unknown_argument','missing_required_argument','--apikey','--token','28690cyTGvT','Unknown\x20command','714015ChwgCm','[desire-path]\x20Sending\x20log\x20to\x20','rawCommand','181321EMnDid'];_0x594d=function(){return _0x2876a5;};return _0x594d();}const SENSITIVE_FLAGS=new Set([_0xc810c1(0x148),'-t',_0xc810c1(0x15d),_0xc810c1(0x12a),_0xc810c1(0x147),_0xc810c1(0x13b),'--password',_0xc810c1(0x156),_0xc810c1(0x141),_0xc810c1(0x138),_0xc810c1(0x133),'--cookie',_0xc810c1(0x137)]),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0x49826c){const _0x136d40=_0xc810c1;return TOKEN_PATTERNS['some'](_0x255fe0=>_0x255fe0[_0x136d40(0x12f)](_0x49826c));}export function sanitizeArgs(_0x1a6393){const _0x68e73f=_0xc810c1,_0x19b4ba=[];let _0x156838=![];for(let _0x1f8e19=0x0;_0x1f8e19<_0x1a6393['length'];_0x1f8e19++){const _0xa2217d=_0x1a6393[_0x1f8e19];if(_0x156838){_0x19b4ba['push'](_0x68e73f(0x130)),_0x156838=![];continue;}if(_0xa2217d['startsWith']('--')||_0xa2217d['startsWith']('-')){const _0x40c635=_0xa2217d['indexOf']('=');if(_0x40c635!==-0x1){const _0x6a10a9=_0xa2217d[_0x68e73f(0x13c)](0x0,_0x40c635)[_0x68e73f(0x13f)]();if(SENSITIVE_FLAGS['has'](_0x6a10a9)){_0x19b4ba[_0x68e73f(0x159)](_0xa2217d['slice'](0x0,_0x40c635)+'=[REDACTED]');continue;}}else{const _0x5cc298=_0xa2217d['toLowerCase']();SENSITIVE_FLAGS[_0x68e73f(0x139)](_0x5cc298)&&(_0x156838=!![]);}_0x19b4ba[_0x68e73f(0x159)](_0xa2217d);}else looksLikeToken(_0xa2217d)?_0x19b4ba[_0x68e73f(0x159)](_0x68e73f(0x130)):_0x19b4ba['push'](_0xa2217d);}return _0x19b4ba[_0x68e73f(0x13e)]('\x20');}export async function logDesirePath(_0xf0f60f){const _0x109bbb=_0xc810c1,_0x4cce30={'UxDxb':function(_0x30708b){return _0x30708b();},'sdQeD':function(_0x1cde15){return _0x1cde15();},'grvGn':'no_token','OPFMH':_0x109bbb(0x155),'AmFab':function(_0x2132f0,_0x5c525b,_0x5c6418){return _0x2132f0(_0x5c525b,_0x5c6418);}};try{const _0x24e12d=await _0x4cce30[_0x109bbb(0x158)](getToken)[_0x109bbb(0x13a)](()=>null),_0x11db0b=_0x4cce30['sdQeD'](getApiBaseUrl),_0x496784=getCurrentVersion(),_0x505112=_0x24e12d?_0x109bbb(0x15c):_0x4cce30[_0x109bbb(0x135)],_0xb65609={..._0xf0f60f['metadata'],'authStatus':_0x505112,'isTty':process['stdout']['isTTY']??![]},_0x558846={'Content-Type':_0x4cce30['OPFMH']};_0x24e12d&&(_0x558846['Authorization']='Bearer\x20'+_0x24e12d);const _0x37413f={'rawCommand':_0xf0f60f[_0x109bbb(0x14d)],'errorMessage':_0xf0f60f['errorMessage'],'errorType':_0xf0f60f['errorType'],'featureId':_0xf0f60f['featureId'],'sessionId':_0xf0f60f[_0x109bbb(0x151)],'metadata':_0xb65609,'cliVersion':_0x496784};process['env']['DEBUG']&&(console['error'](_0x109bbb(0x14c)+_0x11db0b+_0x109bbb(0x14f)),console[_0x109bbb(0x15e)](_0x109bbb(0x152)+JSON[_0x109bbb(0x15a)](_0x37413f,null,0x2))),await _0x4cce30[_0x109bbb(0x12c)](fetch,_0x11db0b+_0x109bbb(0x14f),{'method':'POST','headers':_0x558846,'body':JSON[_0x109bbb(0x15a)](_0x37413f)});}catch(_0x1d1d13){process['env'][_0x109bbb(0x134)]&&console['error'](_0x109bbb(0x131)+_0x1d1d13);}}export function getErrorType(_0x112225,_0x491e05){const _0x191883=_0xc810c1,_0x1ead0b={'wnsnr':_0x191883(0x136),'RMxvY':'syntax_error','Euqzl':_0x191883(0x15b),'gJxTO':'runtime_error'},_0xa723a9='6|5|7|3|2|1|0|4'[_0x191883(0x153)]('|');let _0x501a11=0x0;while(!![]){switch(_0xa723a9[_0x501a11++]){case'0':if(_0x112225['includes'](_0x191883(0x150)))return'missing_option';continue;case'1':if(_0x112225[_0x191883(0x140)]('Invalid\x20values'))return _0x1ead0b['wnsnr'];continue;case'2':if(_0x112225[_0x191883(0x140)]('Not\x20enough\x20non-option\x20arguments'))return _0x191883(0x146);continue;case'3':if(_0x112225[_0x191883(0x140)](_0x191883(0x142)))return _0x191883(0x145);continue;case'4':return _0x1ead0b[_0x191883(0x157)];case'5':if(!_0x112225)return _0x1ead0b['Euqzl'];continue;case'6':if(_0x491e05)return _0x1ead0b['gJxTO'];continue;case'7':if(_0x112225['includes'](_0x191883(0x14a)))return _0x191883(0x144);continue;}break;}}
@@ -1 +1 @@
1
- (function(_0x20afed,_0x2201f9){const _0x30c8d1=_0x4c88,_0x2f1a25=_0x20afed();while(!![]){try{const _0x118961=-parseInt(_0x30c8d1(0x14f))/0x1+parseInt(_0x30c8d1(0x13c))/0x2+-parseInt(_0x30c8d1(0x13d))/0x3*(-parseInt(_0x30c8d1(0x120))/0x4)+parseInt(_0x30c8d1(0x13f))/0x5*(parseInt(_0x30c8d1(0x12e))/0x6)+parseInt(_0x30c8d1(0x144))/0x7*(parseInt(_0x30c8d1(0x133))/0x8)+-parseInt(_0x30c8d1(0x115))/0x9+-parseInt(_0x30c8d1(0x149))/0xa;if(_0x118961===_0x2201f9)break;else _0x2f1a25['push'](_0x2f1a25['shift']());}catch(_0x4e5431){_0x2f1a25['push'](_0x2f1a25['shift']());}}}(_0x1130,0xbcc3f));import{spawn}from'child_process';import _0x380f8c from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL='https://api.workos.com/user_management/authorize/device',WORKOS_TOKEN_URL='https://api.workos.com/user_management/authenticate';export async function requestDeviceCode(_0x3f60ab){const _0x51e08c=_0x4c88,_0x47cf73={'TelWo':function(_0x14857c,_0x1486e7,_0x3211ed){return _0x14857c(_0x1486e7,_0x3211ed);}},_0xe00d1d=await _0x47cf73['TelWo'](fetch,WORKOS_DEVICE_AUTH_URL,{'method':'POST','headers':{'Content-Type':_0x51e08c(0x111)},'body':new URLSearchParams({'client_id':_0x3f60ab})});if(!_0xe00d1d['ok']){const _0xd6d6c1=await _0xe00d1d[_0x51e08c(0x14d)]();throw new Error(_0x51e08c(0x13b)+_0xe00d1d[_0x51e08c(0x14c)]+'\x20'+_0xd6d6c1);}return _0xe00d1d['json']();}export async function pollForTokens(_0x4ddd8d,_0x4d9eca,_0x55d66f,_0x5a91e6){const _0x1094c7=_0x4c88,_0x355c7d={'mQbNq':function(_0x21aa1d,_0x1cc808){return _0x21aa1d+_0x1cc808;},'cdpZb':function(_0x1c5b0f,_0x1699d){return _0x1c5b0f*_0x1699d;},'arGMt':function(_0xccf4e4,_0x1aa008){return _0xccf4e4(_0x1aa008);},'RDXCe':'application/x-www-form-urlencoded','qvRAR':function(_0x1f42b0,_0x5d9571){return _0x1f42b0===_0x5d9571;},'iximI':function(_0x3be95f,_0x47c8ad){return _0x3be95f===_0x47c8ad;},'uuqud':_0x1094c7(0x107),'bZOKB':_0x1094c7(0x13a)},_0x525589=_0x355c7d['mQbNq'](Date[_0x1094c7(0x12b)](),_0x355c7d[_0x1094c7(0x125)](_0x5a91e6,0x3e8));let _0x3ed9ac=_0x355c7d[_0x1094c7(0x125)](_0x55d66f,0x3e8);while(Date['now']()<_0x525589){await _0x355c7d['arGMt'](sleep,_0x3ed9ac);const _0x376ab0=await fetch(WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':_0x355c7d[_0x1094c7(0x11e)]},'body':new URLSearchParams({'client_id':_0x4ddd8d,'device_code':_0x4d9eca,'grant_type':'urn:ietf:params:oauth:grant-type:device_code'})});if(_0x376ab0['ok'])return _0x376ab0[_0x1094c7(0x122)]();const _0x1a0ab6=await _0x376ab0[_0x1094c7(0x122)]();if(_0x355c7d[_0x1094c7(0x150)](_0x1a0ab6['error'],_0x1094c7(0x118)))continue;if(_0x355c7d[_0x1094c7(0x109)](_0x1a0ab6['error'],_0x355c7d['uuqud'])){_0x3ed9ac+=0x3e8;continue;}throw new Error(_0x1a0ab6['error_description']||_0x1a0ab6[_0x1094c7(0x143)]||_0x1094c7(0x134));}throw new Error(_0x355c7d[_0x1094c7(0x147)]);}function _0x4c88(_0x4eafe7,_0x35ff87){_0x4eafe7=_0x4eafe7-0x105;const _0x1130b9=_0x1130();let _0x4c88e8=_0x1130b9[_0x4eafe7];return _0x4c88e8;}async function fetchUserProfile(_0x4e0124){const _0x10557f=_0x4c88,_0x54c285={'mYxVO':_0x10557f(0x14a)},_0x109de7=getApiBaseUrl();try{const _0x2a0f11=await fetch(_0x109de7+'/organization/me',{'method':_0x54c285[_0x10557f(0x131)],'headers':{'workos-token':_0x4e0124}});if(_0x2a0f11['ok'])return _0x2a0f11['json']();}catch{}return null;}function buildKeyName(_0x5eaae8,_0x6e508b){const _0x35787b=_0x4c88,_0x24c1cd={'Nokvf':function(_0x3c6e50,_0x317809){return _0x3c6e50+_0x317809;}},_0x2519ff=_0x6e508b['filter'](_0x50618d=>_0x50618d[_0x35787b(0x148)]===_0x5eaae8||_0x50618d[_0x35787b(0x148)]['startsWith'](_0x5eaae8+'\x20('));if(_0x2519ff[_0x35787b(0x13e)]===0x0)return _0x5eaae8;return _0x5eaae8+'\x20('+_0x24c1cd[_0x35787b(0x141)](_0x2519ff[_0x35787b(0x13e)],0x1)+')';}function _0x1130(){const _0x3e4793=['POST','Nokvf','ignore','error','1904wMVjfB','WTPUM','refresh_token','bZOKB','name','8034750VzoRec','GET','Failed\x20to\x20provision\x20CLI\x20token:\x20','status','text','MgQEq','1368698uzjPDt','qvRAR','verification_uri_complete','log','FXKGB','slow_down','NemvW','iximI','Invalid\x20JWT\x20format','kmEIt','Provisioning\x20CLI\x20token...','stdout','Failed\x20to\x20create\x20organization:\x20','expires_in','xdg-open','application/x-www-form-urlencoded','list','organizationId','application/json','1007622HVPznu','base64url','token','authorization_pending','toString','split','device_code','stringify','utf-8','RDXCe','iLncK','36FhKCHb','BoVcX','json','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','XkkKs','cdpZb','apiKeys','HbdlF','bGNfS','/organization/my-memberships','bHBNS','now','stdin','VbdrP','18ksVYDN','access_token','/api-keys','mYxVO','tTaMR','39128nISWQJ','Authentication\x20failed','win32','XGyLK','Waiting\x20for\x20authentication...','write','\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','Device\x20authorization\x20timed\x20out','Failed\x20to\x20request\x20device\x20code:\x20','624852mRQhbU','23313MPYKFX','length','2240995ZSUpFk'];_0x1130=function(){return _0x3e4793;};return _0x1130();}export async function provisionApiKey(_0x40f1df){const _0x20667b=_0x4c88,_0x1efd6b={'eCUcN':function(_0x4bb6a9){return _0x4bb6a9();},'iLncK':'application/json','FXKGB':function(_0x562c57,_0x1f3770){return _0x562c57(_0x1f3770);},'HbdlF':function(_0x271857,_0x1b2bc5,_0x1d68c9){return _0x271857(_0x1b2bc5,_0x1d68c9);}},_0x45a58b=_0x1efd6b['eCUcN'](getApiBaseUrl),_0x4c12ed={'Content-Type':_0x1efd6b[_0x20667b(0x11f)],'workos-token':_0x40f1df},_0x183ba1=await _0x1efd6b[_0x20667b(0x106)](fetchUserProfile,_0x40f1df),_0x1f71b9=_0x183ba1?.['firstName']||_0x183ba1?.['email']?.['split']('@')[0x0],_0x3dfb77=_0x1f71b9?_0x1f71b9+'\x27s\x20CLI\x20Key':'CLI\x20Key';let _0x1c335e=[];try{const _0x954cb=await _0x1efd6b['HbdlF'](fetch,_0x45a58b+'/api-keys',{'method':'GET','headers':_0x4c12ed});if(_0x954cb['ok']){const _0x3bbf1e=await _0x954cb[_0x20667b(0x122)]();_0x1c335e=_0x3bbf1e[_0x20667b(0x126)];}}catch{}const _0x1e3523=_0x1efd6b[_0x20667b(0x127)](buildKeyName,_0x3dfb77,_0x1c335e),_0x4b1a8c=await fetch(_0x45a58b+_0x20667b(0x130),{'method':'POST','headers':_0x4c12ed,'body':JSON[_0x20667b(0x11c)]({'name':_0x1e3523,'scope':'mcp:write'})});if(!_0x4b1a8c['ok']){const _0x908b7f=await _0x4b1a8c[_0x20667b(0x14d)]();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0x4b1a8c['status']+'\x20'+_0x908b7f);}const _0x2d44ee=await _0x4b1a8c[_0x20667b(0x122)]();return _0x2d44ee['apiKey']['token'];}export function openBrowser(_0x5b19cd){const _0x18cfaf=_0x4c88,_0x299d65={'cjdfh':_0x18cfaf(0x135),'zfnCn':function(_0xe60c83,_0x85381d,_0x1a8ef4,_0x4365e2){return _0xe60c83(_0x85381d,_0x1a8ef4,_0x4365e2);},'OwJzX':_0x18cfaf(0x142)};try{if(process['platform']===_0x299d65['cjdfh']){const _0x39380e=_0x299d65['zfnCn'](spawn,'cmd',['/c','start','',_0x5b19cd],{'detached':!![],'stdio':_0x299d65['OwJzX'],'windowsHide':!![]});_0x39380e['unref']();return;}const _0x252021=process['platform']==='darwin'?'open':_0x18cfaf(0x110),_0x3cf149=spawn(_0x252021,[_0x5b19cd],{'detached':!![],'stdio':_0x299d65['OwJzX']});_0x3cf149['unref']();}catch{}}function decodeJwtPayload(_0x269a97){const _0x5df136=_0x4c88,_0x23c783={'sHHYx':_0x5df136(0x10a),'kmEIt':_0x5df136(0x116)},_0x1b1be2=_0x269a97[_0x5df136(0x11a)]('.');if(_0x1b1be2[_0x5df136(0x13e)]!==0x3)throw new Error(_0x23c783['sHHYx']);const _0x1b6ed2=Buffer['from'](_0x1b1be2[0x1],_0x23c783[_0x5df136(0x10b)])[_0x5df136(0x119)](_0x5df136(0x11d));return JSON['parse'](_0x1b6ed2);}async function selfServeSignup(_0x24d78b){const _0x3d5a73=_0x4c88,_0x27e52a={'NemvW':function(_0x488bc6){return _0x488bc6();},'PXfGT':function(_0x120c4f,_0x3c8002,_0x342381){return _0x120c4f(_0x3c8002,_0x342381);},'QeFST':_0x3d5a73(0x114)},_0xe47dbd=_0x27e52a[_0x3d5a73(0x108)](getApiBaseUrl),_0xb6001a=await _0x27e52a['PXfGT'](fetch,_0xe47dbd+'/organization/self-serve-signup',{'method':'POST','headers':{'Content-Type':_0x27e52a['QeFST'],'workos-token':_0x24d78b}});if(!_0xb6001a['ok']){const _0x5dfaab=await _0xb6001a[_0x3d5a73(0x14d)]();throw new Error(_0x3d5a73(0x10e)+_0xb6001a[_0x3d5a73(0x14c)]+'\x20'+_0x5dfaab);}return _0xb6001a[_0x3d5a73(0x122)]();}async function fetchMyMemberships(_0x33118d){const _0x178c3e=_0x4c88,_0x19b772={'EdfXd':function(_0x1e3fa0){return _0x1e3fa0();},'gHuCt':function(_0x1c7931,_0x207ba6,_0x29627b){return _0x1c7931(_0x207ba6,_0x29627b);}},_0x145cad=_0x19b772['EdfXd'](getApiBaseUrl),_0x14db75=await _0x19b772['gHuCt'](fetch,_0x145cad+_0x178c3e(0x129),{'method':'GET','headers':{'workos-token':_0x33118d}});if(!_0x14db75['ok']){const _0x2d0666=await _0x14db75['text']();throw new Error('Failed\x20to\x20fetch\x20memberships:\x20'+_0x14db75[_0x178c3e(0x14c)]+'\x20'+_0x2d0666);}const _0x400ee0=await _0x14db75['json']();return _0x400ee0['memberships'];}async function refreshTokenWithOrg(_0x5de801,_0x19e80f,_0x57650b){const _0x1ca0b0=_0x4c88,_0x591857={'WTPUM':_0x1ca0b0(0x140),'XkkKs':_0x1ca0b0(0x146)},_0x1d7b40=await fetch(WORKOS_TOKEN_URL,{'method':_0x591857[_0x1ca0b0(0x145)],'headers':{'Content-Type':_0x1ca0b0(0x111)},'body':new URLSearchParams({'client_id':_0x5de801,'grant_type':_0x591857[_0x1ca0b0(0x124)],'refresh_token':_0x19e80f,'organization_id':_0x57650b})});if(!_0x1d7b40['ok']){const _0x38bc1f=await _0x1d7b40['text']();throw new Error('Failed\x20to\x20refresh\x20token\x20with\x20org:\x20'+_0x1d7b40[_0x1ca0b0(0x14c)]+'\x20'+_0x38bc1f);}return _0x1d7b40['json']();}async function provisionCliToken(_0x470f31){const _0x528d7b=_0x4c88,_0x21ea36={'VbdrP':function(_0x5cca77){return _0x5cca77();},'woUnz':function(_0x139028,_0x2b1882,_0x4732f0){return _0x139028(_0x2b1882,_0x4732f0);},'IdQAp':_0x528d7b(0x140)},_0x229153=_0x21ea36[_0x528d7b(0x12d)](getApiBaseUrl),_0x1c8d22=await _0x21ea36['woUnz'](fetch,_0x229153+'/cli-auth/token',{'method':_0x21ea36['IdQAp'],'headers':{'Content-Type':'application/json','workos-token':_0x470f31}});if(!_0x1c8d22['ok']){const _0x9e452d=await _0x1c8d22['text']();throw new Error(_0x528d7b(0x14b)+_0x1c8d22['status']+'\x20'+_0x9e452d);}return _0x1c8d22['json']();}export async function runDeviceAuthFlow(){const _0x36467d=_0x4c88,_0x2e6cde={'oikJO':function(_0x116ee3){return _0x116ee3();},'xumls':function(_0x2cfc46,_0x16b8f6){return _0x2cfc46(_0x16b8f6);},'lBzhw':_0x36467d(0x139),'bHBNS':'Setting\x20up\x20your\x20organization...','nPlah':function(_0xed6544,_0x10984d){return _0xed6544+_0x10984d;},'MgQEq':'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','BoVcX':_0x36467d(0x112),'tTaMR':function(_0x42881f,_0x3ec80,_0x26c873,_0x33596d){return _0x42881f(_0x3ec80,_0x26c873,_0x33596d);},'bGNfS':_0x36467d(0x10c),'XGyLK':function(_0x24c245,_0xe205c2){return _0x24c245(_0xe205c2);}},_0x2d3a82=_0x2e6cde['oikJO'](getCurrentEnvironment),_0x47542c=ENVIRONMENT_CONFIGS[_0x2d3a82]['workosClientId'],_0x2ec476=await _0x2e6cde['xumls'](requestDeviceCode,_0x47542c);console['log'](_0x2e6cde['lBzhw']),console[_0x36467d(0x105)]('\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a'),openBrowser(_0x2ec476[_0x36467d(0x151)]),console[_0x36467d(0x105)]('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x2ec476[_0x36467d(0x151)]),console[_0x36467d(0x105)]('Code:\x20'+_0x2ec476['user_code']+'\x0a'),process[_0x36467d(0x10d)]['write'](_0x36467d(0x137));let _0x1435ad=await pollForTokens(_0x47542c,_0x2ec476[_0x36467d(0x11b)],_0x2ec476['interval'],_0x2ec476[_0x36467d(0x10f)]);console['log']('\x20✓');const _0x3f1dcf=decodeJwtPayload(_0x1435ad['access_token']);if(!_0x3f1dcf['org_id']){const _0x29166e=await fetchMyMemberships(_0x1435ad['access_token']);let _0x2d7ce1;if(_0x29166e['length']===0x0){process[_0x36467d(0x10d)][_0x36467d(0x138)](_0x2e6cde[_0x36467d(0x12a)]);const _0x2b09ab=await selfServeSignup(_0x1435ad['access_token']);_0x2d7ce1=_0x2b09ab[_0x36467d(0x113)],console['log']('\x20✓');}else{if(_0x29166e[_0x36467d(0x13e)]===0x1)_0x2d7ce1=_0x29166e[0x0]['organizationId'],console['log']('Using\x20organization:\x20'+_0x29166e[0x0][_0x36467d(0x148)]);else{const _0x5cf4e1=process[_0x36467d(0x12c)]['isTTY']&&process['stdout']['isTTY'];if(!_0x5cf4e1)throw new Error(_0x2e6cde['nPlah'](_0x36467d(0x123),_0x2e6cde[_0x36467d(0x14e)]));const {selected:_0x1a2943}=await _0x380f8c['prompt']([{'type':_0x2e6cde[_0x36467d(0x121)],'name':'selected','message':'Select\x20an\x20organization:','choices':_0x29166e['map'](_0x23787b=>({'name':_0x23787b[_0x36467d(0x148)],'value':_0x23787b['organizationId']}))}]);_0x2d7ce1=_0x1a2943;}}_0x1435ad=await _0x2e6cde[_0x36467d(0x132)](refreshTokenWithOrg,_0x47542c,_0x1435ad[_0x36467d(0x146)],_0x2d7ce1);}process[_0x36467d(0x10d)]['write'](_0x2e6cde[_0x36467d(0x128)]);const _0xb0e6c9=await _0x2e6cde['xumls'](provisionCliToken,_0x1435ad[_0x36467d(0x12f)]);return console[_0x36467d(0x105)]('\x20✓'),await storeToken(_0xb0e6c9[_0x36467d(0x117)]),_0x1435ad[_0x36467d(0x146)]&&await _0x2e6cde[_0x36467d(0x136)](storeRefreshToken,_0x1435ad['refresh_token']),_0xb0e6c9['token'];}function sleep(_0x4d68e0){return new Promise(_0x1de97d=>setTimeout(_0x1de97d,_0x4d68e0));}
1
+ const _0x568548=_0x2e9d;(function(_0x13b141,_0x572245){const _0x4f1086=_0x2e9d,_0xaefc99=_0x13b141();while(!![]){try{const _0x352505=parseInt(_0x4f1086(0xe9))/0x1+parseInt(_0x4f1086(0xc7))/0x2*(parseInt(_0x4f1086(0xfa))/0x3)+parseInt(_0x4f1086(0xe6))/0x4+parseInt(_0x4f1086(0xb2))/0x5*(-parseInt(_0x4f1086(0xb0))/0x6)+-parseInt(_0x4f1086(0xec))/0x7*(-parseInt(_0x4f1086(0xe1))/0x8)+-parseInt(_0x4f1086(0xf2))/0x9+-parseInt(_0x4f1086(0xd0))/0xa;if(_0x352505===_0x572245)break;else _0xaefc99['push'](_0xaefc99['shift']());}catch(_0x567701){_0xaefc99['push'](_0xaefc99['shift']());}}}(_0x3a6f,0x3ddf7));import{spawn}from'child_process';import _0x53bce5 from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';function _0x3a6f(){const _0x901f6e=['refresh_token','selected','authorization_pending','write','vKTHV','mcp:write','https://api.workos.com/user_management/authenticate','Failed\x20to\x20request\x20device\x20code:\x20','JTdOL','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20','expires_in','ZXoZN','GET','264386raSIAi','thqZe','kXUaO','AZAOL','RPLej','Failed\x20to\x20create\x20organization:\x20','aJudY','aMUyZ','utf-8','6885770phtEbI','bPkwr','stdin','organizationId','workosClientId','list','Failed\x20to\x20fetch\x20memberships:\x20','\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','SrdLZ','Failed\x20to\x20refresh\x20token\x20with\x20org:\x20','Select\x20an\x20organization:','xdg-open','json','Code:\x20','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','access_token','32JZtkWt','text','verification_uri_complete','POST','Setting\x20up\x20your\x20organization...','1969560LHwmei','/api-keys','/organization/self-serve-signup','238298mmOWLG','unref','lsmQa','576597wtufqW','/cli-auth/token','Hsoaj','ERcAE','stringify','log','2397987ioZtNv','bPYlA','length','base64url','Authentication\x20failed','JyqXW','status','Provisioning\x20CLI\x20token...','6uSqZsM','sfNCD','token','Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','YYOek','application/x-www-form-urlencoded','yLzqY','error_description','BJylm','696642psXolC','name','5fjQrjJ','prompt','QZWKk','platform','memberships','JONFu','Using\x20organization:\x20','\x27s\x20CLI\x20Key'];_0x3a6f=function(){return _0x901f6e;};return _0x3a6f();}import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL='https://api.workos.com/user_management/authorize/device',WORKOS_TOKEN_URL=_0x568548(0xc0);export async function requestDeviceCode(_0x3bab6f){const _0xb02d70=_0x568548,_0x3163fb={'aMUyZ':_0xb02d70(0xe4),'thqZe':_0xb02d70(0xff)},_0x10b79b=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x3163fb[_0xb02d70(0xce)],'headers':{'Content-Type':_0x3163fb[_0xb02d70(0xc8)]},'body':new URLSearchParams({'client_id':_0x3bab6f})});if(!_0x10b79b['ok']){const _0x49f751=await _0x10b79b[_0xb02d70(0xe2)]();throw new Error(_0xb02d70(0xc1)+_0x10b79b['status']+'\x20'+_0x49f751);}return _0x10b79b[_0xb02d70(0xdd)]();}export async function pollForTokens(_0x2d1155,_0x3ce9ae,_0xef25b0,_0x5bec49){const _0x44e8a6=_0x568548,_0x3ad099={'kcQvv':function(_0x23a381,_0x27282e){return _0x23a381*_0x27282e;},'HNvCa':function(_0x443e5f,_0x2bd509){return _0x443e5f*_0x2bd509;},'RPLej':function(_0x28fd4a,_0x2671d3,_0x4bc6cb){return _0x28fd4a(_0x2671d3,_0x4bc6cb);},'AZAOL':_0x44e8a6(0xe4),'bPkwr':'application/x-www-form-urlencoded','jpczy':'urn:ietf:params:oauth:grant-type:device_code','ERcAE':_0x44e8a6(0xbc),'QZWKk':function(_0x10f3d1,_0x18daa8){return _0x10f3d1===_0x18daa8;},'kXUaO':'slow_down','nSPqO':_0x44e8a6(0xf6)},_0x5ca702=Date['now']()+_0x3ad099['kcQvv'](_0x5bec49,0x3e8);let _0x1e9597=_0x3ad099['HNvCa'](_0xef25b0,0x3e8);while(Date['now']()<_0x5ca702){await sleep(_0x1e9597);const _0x357245=await _0x3ad099[_0x44e8a6(0xcb)](fetch,WORKOS_TOKEN_URL,{'method':_0x3ad099[_0x44e8a6(0xca)],'headers':{'Content-Type':_0x3ad099[_0x44e8a6(0xd1)]},'body':new URLSearchParams({'client_id':_0x2d1155,'device_code':_0x3ce9ae,'grant_type':_0x3ad099['jpczy']})});if(_0x357245['ok'])return _0x357245[_0x44e8a6(0xdd)]();const _0x5da898=await _0x357245[_0x44e8a6(0xdd)]();if(_0x5da898['error']===_0x3ad099[_0x44e8a6(0xef)])continue;if(_0x3ad099[_0x44e8a6(0xb4)](_0x5da898['error'],_0x3ad099[_0x44e8a6(0xc9)])){_0x1e9597+=0x3e8;continue;}throw new Error(_0x5da898[_0x44e8a6(0xae)]||_0x5da898['error']||_0x3ad099['nSPqO']);}throw new Error('Device\x20authorization\x20timed\x20out');}async function fetchUserProfile(_0x191860){const _0x5478c8=_0x568548,_0x41e137={'gURrb':'GET'},_0x380236=getApiBaseUrl();try{const _0x5d9064=await fetch(_0x380236+'/organization/me',{'method':_0x41e137['gURrb'],'headers':{'workos-token':_0x191860}});if(_0x5d9064['ok'])return _0x5d9064[_0x5478c8(0xdd)]();}catch{}return null;}function buildKeyName(_0xda7a07,_0x1e6096){const _0x20c470=_0x568548,_0x563880=_0x1e6096['filter'](_0x441467=>_0x441467[_0x20c470(0xb1)]===_0xda7a07||_0x441467[_0x20c470(0xb1)]['startsWith'](_0xda7a07+'\x20('));if(_0x563880['length']===0x0)return _0xda7a07;return _0xda7a07+'\x20('+(_0x563880[_0x20c470(0xf4)]+0x1)+')';}export async function provisionApiKey(_0x472b25){const _0x4d7583=_0x568548,_0x3da8a0={'BJylm':function(_0x39cc58){return _0x39cc58();},'JONFu':'CLI\x20Key','SrdLZ':function(_0x26e73b,_0x34e0c9,_0x3b7076){return _0x26e73b(_0x34e0c9,_0x3b7076);},'Hsoaj':_0x4d7583(0xbf)},_0x48965b=_0x3da8a0[_0x4d7583(0xaf)](getApiBaseUrl),_0x2fdde6={'Content-Type':'application/json','workos-token':_0x472b25},_0xdfabfc=await fetchUserProfile(_0x472b25),_0x5ad52b=_0xdfabfc?.['firstName']||_0xdfabfc?.['email']?.['split']('@')[0x0],_0x30934f=_0x5ad52b?_0x5ad52b+_0x4d7583(0xb9):_0x3da8a0[_0x4d7583(0xb7)];let _0x5ee91e=[];try{const _0x3f4a77=await _0x3da8a0[_0x4d7583(0xd9)](fetch,_0x48965b+'/api-keys',{'method':'GET','headers':_0x2fdde6});if(_0x3f4a77['ok']){const _0x1e8ee8=await _0x3f4a77[_0x4d7583(0xdd)]();_0x5ee91e=_0x1e8ee8['apiKeys'];}}catch{}const _0x19173c=buildKeyName(_0x30934f,_0x5ee91e),_0x1daffc=await fetch(_0x48965b+_0x4d7583(0xe7),{'method':_0x4d7583(0xe4),'headers':_0x2fdde6,'body':JSON[_0x4d7583(0xf0)]({'name':_0x19173c,'scope':_0x3da8a0[_0x4d7583(0xee)]})});if(!_0x1daffc['ok']){const _0x25eaea=await _0x1daffc[_0x4d7583(0xe2)]();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0x1daffc['status']+'\x20'+_0x25eaea);}const _0x51951b=await _0x1daffc['json']();return _0x51951b['apiKey'][_0x4d7583(0xfc)];}export function openBrowser(_0x2bcc45){const _0x14af6c=_0x568548,_0x50031a={'bkPdt':function(_0x57d7a8,_0x315d6b){return _0x57d7a8===_0x315d6b;},'vKTHV':'win32','nLHJj':'cmd','yLzqY':'start','IrwVJ':'ignore','iNYva':function(_0x585d01,_0x4e6dd5){return _0x585d01===_0x4e6dd5;},'fuaVU':'darwin','PvHLN':function(_0x25d39e,_0x23b930,_0x5e2ca8,_0x138222){return _0x25d39e(_0x23b930,_0x5e2ca8,_0x138222);}};try{if(_0x50031a['bkPdt'](process[_0x14af6c(0xb5)],_0x50031a[_0x14af6c(0xbe)])){const _0x5bdb50=spawn(_0x50031a['nLHJj'],['/c',_0x50031a[_0x14af6c(0xad)],'',_0x2bcc45],{'detached':!![],'stdio':_0x50031a['IrwVJ'],'windowsHide':!![]});_0x5bdb50['unref']();return;}const _0x335aa0=_0x50031a['iNYva'](process[_0x14af6c(0xb5)],_0x50031a['fuaVU'])?'open':_0x14af6c(0xdc),_0xc96e93=_0x50031a['PvHLN'](spawn,_0x335aa0,[_0x2bcc45],{'detached':!![],'stdio':_0x50031a['IrwVJ']});_0xc96e93[_0x14af6c(0xea)]();}catch{}}function _0x2e9d(_0x30d13f,_0x303fc6){_0x30d13f=_0x30d13f-0xad;const _0x3a6f00=_0x3a6f();let _0x2e9d97=_0x3a6f00[_0x30d13f];return _0x2e9d97;}function decodeJwtPayload(_0x3ffaad){const _0x2cdf19=_0x568548,_0x1d1649={'sfNCD':'Invalid\x20JWT\x20format'},_0xe63259=_0x3ffaad['split']('.');if(_0xe63259[_0x2cdf19(0xf4)]!==0x3)throw new Error(_0x1d1649[_0x2cdf19(0xfb)]);const _0x43848c=Buffer['from'](_0xe63259[0x1],_0x2cdf19(0xf5))['toString'](_0x2cdf19(0xcf));return JSON['parse'](_0x43848c);}async function selfServeSignup(_0x2e059a){const _0x1cba2e=_0x568548,_0x111d85={'JARca':function(_0x4ef805,_0x1d00c9,_0x5514ef){return _0x4ef805(_0x1d00c9,_0x5514ef);},'JTdOL':'application/json'},_0x27f4e5=getApiBaseUrl(),_0x2efd93=await _0x111d85['JARca'](fetch,_0x27f4e5+_0x1cba2e(0xe8),{'method':_0x1cba2e(0xe4),'headers':{'Content-Type':_0x111d85[_0x1cba2e(0xc2)],'workos-token':_0x2e059a}});if(!_0x2efd93['ok']){const _0x40ef2d=await _0x2efd93['text']();throw new Error(_0x1cba2e(0xcc)+_0x2efd93['status']+'\x20'+_0x40ef2d);}return _0x2efd93['json']();}async function fetchMyMemberships(_0x494a54){const _0x3a51d9=_0x568548,_0x52a144={'bPYlA':function(_0x1ff00c){return _0x1ff00c();},'UiJCC':function(_0x43d24d,_0x5d7246,_0x1f6ee5){return _0x43d24d(_0x5d7246,_0x1f6ee5);}},_0x1b1142=_0x52a144[_0x3a51d9(0xf3)](getApiBaseUrl),_0x5196a7=await _0x52a144['UiJCC'](fetch,_0x1b1142+'/organization/my-memberships',{'method':_0x3a51d9(0xc6),'headers':{'workos-token':_0x494a54}});if(!_0x5196a7['ok']){const _0x1ee5b6=await _0x5196a7['text']();throw new Error(_0x3a51d9(0xd6)+_0x5196a7[_0x3a51d9(0xf8)]+'\x20'+_0x1ee5b6);}const _0x5c484a=await _0x5196a7[_0x3a51d9(0xdd)]();return _0x5c484a[_0x3a51d9(0xb6)];}async function refreshTokenWithOrg(_0x136047,_0x236977,_0x558106){const _0x448842=_0x568548,_0xa01bc5={'bVawm':function(_0x26a063,_0x2532de,_0x4a6f1d){return _0x26a063(_0x2532de,_0x4a6f1d);},'BgUOm':'POST'},_0x539641=await _0xa01bc5['bVawm'](fetch,WORKOS_TOKEN_URL,{'method':_0xa01bc5['BgUOm'],'headers':{'Content-Type':_0x448842(0xff)},'body':new URLSearchParams({'client_id':_0x136047,'grant_type':_0x448842(0xba),'refresh_token':_0x236977,'organization_id':_0x558106})});if(!_0x539641['ok']){const _0x395d1d=await _0x539641[_0x448842(0xe2)]();throw new Error(_0x448842(0xda)+_0x539641['status']+'\x20'+_0x395d1d);}return _0x539641[_0x448842(0xdd)]();}async function provisionCliToken(_0x41e278){const _0x5936b6=_0x568548,_0x484363={'JyqXW':'application/json'},_0x1ec298=getApiBaseUrl(),_0x4b18e1=await fetch(_0x1ec298+_0x5936b6(0xed),{'method':'POST','headers':{'Content-Type':_0x484363[_0x5936b6(0xf7)],'workos-token':_0x41e278}});if(!_0x4b18e1['ok']){const _0x47f293=await _0x4b18e1['text']();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0x4b18e1[_0x5936b6(0xf8)]+'\x20'+_0x47f293);}return _0x4b18e1['json']();}export async function runDeviceAuthFlow(){const _0x47a0d6=_0x568548,_0x1e5204={'ZXoZN':_0x47a0d6(0xd7),'YYOek':function(_0xebc354,_0x587058){return _0xebc354(_0x587058);},'HLyPa':'Waiting\x20for\x20authentication...','wiSWk':function(_0x11d993,_0x231ac0,_0x3253c6,_0x14f1a5,_0x48d73f){return _0x11d993(_0x231ac0,_0x3253c6,_0x14f1a5,_0x48d73f);},'aJudY':function(_0x42119f,_0x518f28){return _0x42119f===_0x518f28;},'bWHRS':_0x47a0d6(0xfd),'LITcY':_0x47a0d6(0xd5),'lsmQa':_0x47a0d6(0xdb),'sgBsv':function(_0x469c86,_0x490027){return _0x469c86(_0x490027);}},_0x172a11=getCurrentEnvironment(),_0x3fa1ec=ENVIRONMENT_CONFIGS[_0x172a11][_0x47a0d6(0xd4)],_0x7584d3=await requestDeviceCode(_0x3fa1ec);console[_0x47a0d6(0xf1)](_0x1e5204[_0x47a0d6(0xc5)]),console['log'](_0x47a0d6(0xd8)),_0x1e5204['YYOek'](openBrowser,_0x7584d3[_0x47a0d6(0xe3)]),console[_0x47a0d6(0xf1)](_0x47a0d6(0xc3)+_0x7584d3[_0x47a0d6(0xe3)]),console['log'](_0x47a0d6(0xde)+_0x7584d3['user_code']+'\x0a'),process['stdout'][_0x47a0d6(0xbd)](_0x1e5204['HLyPa']);let _0x3a48df=await _0x1e5204['wiSWk'](pollForTokens,_0x3fa1ec,_0x7584d3['device_code'],_0x7584d3['interval'],_0x7584d3[_0x47a0d6(0xc4)]);console[_0x47a0d6(0xf1)]('\x20✓');const _0x11e182=_0x1e5204[_0x47a0d6(0xfe)](decodeJwtPayload,_0x3a48df[_0x47a0d6(0xe0)]);if(!_0x11e182['org_id']){const _0x56b12b=await fetchMyMemberships(_0x3a48df['access_token']);let _0x29833a;if(_0x56b12b[_0x47a0d6(0xf4)]===0x0){process['stdout'][_0x47a0d6(0xbd)](_0x47a0d6(0xe5));const _0x25f656=await _0x1e5204['YYOek'](selfServeSignup,_0x3a48df['access_token']);_0x29833a=_0x25f656['organizationId'],console[_0x47a0d6(0xf1)]('\x20✓');}else{if(_0x1e5204[_0x47a0d6(0xcd)](_0x56b12b['length'],0x1))_0x29833a=_0x56b12b[0x0][_0x47a0d6(0xd3)],console[_0x47a0d6(0xf1)](_0x47a0d6(0xb8)+_0x56b12b[0x0]['name']);else{const _0x387c43=process[_0x47a0d6(0xd2)]['isTTY']&&process['stdout']['isTTY'];if(!_0x387c43)throw new Error(_0x47a0d6(0xdf)+_0x1e5204['bWHRS']);const {selected:_0x587e99}=await _0x53bce5[_0x47a0d6(0xb3)]([{'type':_0x1e5204['LITcY'],'name':_0x47a0d6(0xbb),'message':_0x1e5204[_0x47a0d6(0xeb)],'choices':_0x56b12b['map'](_0x215fe2=>({'name':_0x215fe2[_0x47a0d6(0xb1)],'value':_0x215fe2['organizationId']}))}]);_0x29833a=_0x587e99;}}_0x3a48df=await refreshTokenWithOrg(_0x3fa1ec,_0x3a48df[_0x47a0d6(0xba)],_0x29833a);}process['stdout'][_0x47a0d6(0xbd)](_0x47a0d6(0xf9));const _0x3dd610=await _0x1e5204[_0x47a0d6(0xfe)](provisionCliToken,_0x3a48df[_0x47a0d6(0xe0)]);return console['log']('\x20✓'),await storeToken(_0x3dd610['token']),_0x3a48df['refresh_token']&&await _0x1e5204['sgBsv'](storeRefreshToken,_0x3a48df['refresh_token']),_0x3dd610[_0x47a0d6(0xfc)];}function sleep(_0x3561fd){return new Promise(_0x236a08=>setTimeout(_0x236a08,_0x3561fd));}
@@ -1 +1 @@
1
- const _0x3be0b8=_0x3023;(function(_0x2a4691,_0x38d61f){const _0x1e3f75=_0x3023,_0x5af885=_0x2a4691();while(!![]){try{const _0x2504ad=-parseInt(_0x1e3f75(0x154))/0x1*(parseInt(_0x1e3f75(0x15d))/0x2)+-parseInt(_0x1e3f75(0x15c))/0x3+parseInt(_0x1e3f75(0x168))/0x4*(parseInt(_0x1e3f75(0x161))/0x5)+-parseInt(_0x1e3f75(0x16b))/0x6+parseInt(_0x1e3f75(0x16e))/0x7+-parseInt(_0x1e3f75(0x158))/0x8+-parseInt(_0x1e3f75(0x169))/0x9*(-parseInt(_0x1e3f75(0x171))/0xa);if(_0x2504ad===_0x38d61f)break;else _0x5af885['push'](_0x5af885['shift']());}catch(_0x555ac3){_0x5af885['push'](_0x5af885['shift']());}}}(_0x5bc2,0xe6e01));function _0x3023(_0x310d05,_0x5b030f){_0x310d05=_0x310d05-0x150;const _0x5bc2fe=_0x5bc2();let _0x3023c4=_0x5bc2fe[_0x310d05];return _0x3023c4;}export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':'https://api.ranger.net','workosClientId':_0x3be0b8(0x165),'aiProxyUrl':_0x3be0b8(0x159),'mcpAuthUrl':'https://mcp-auth.ranger.net/mcp'},'staging':{'apiBaseUrl':'https://api.staging.ranger.net','workosClientId':_0x3be0b8(0x150),'aiProxyUrl':'https://ai-proxy-301751771437.us-central1.run.app','mcpAuthUrl':'https://mcp-auth.staging.ranger.net/mcp'},'local':{'apiBaseUrl':'http://localhost:8080','workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':'http://localhost:8090','mcpAuthUrl':_0x3be0b8(0x15e)}};export const DEFAULT_ENVIRONMENT=_0x3be0b8(0x162);export function isValidEnvironment(_0x29d91a){const _0x1a7132=_0x3be0b8,_0x3e3c33={'fUxPD':function(_0x34dee7,_0x197886){return _0x34dee7===_0x197886;},'AJSEw':_0x1a7132(0x162),'GRMDW':function(_0x5be28f,_0x3704b8){return _0x5be28f===_0x3704b8;}};return _0x3e3c33['fUxPD'](_0x29d91a,_0x3e3c33['AJSEw'])||_0x3e3c33[_0x1a7132(0x16c)](_0x29d91a,_0x1a7132(0x151))||_0x29d91a==='local';}export function getCurrentEnvironment(){const _0x2fbe00={'rtMrq':function(_0x574d02,_0x2eb522){return _0x574d02(_0x2eb522);}},_0x511dd3=process['env']['RANGER_CLI_ENV'];if(_0x511dd3&&_0x2fbe00['rtMrq'](isValidEnvironment,_0x511dd3))return _0x511dd3;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){return ENVIRONMENT_CONFIGS[getCurrentEnvironment()]['apiBaseUrl'];}export function getAiProxyUrl(){const _0x4dcdfc=_0x3be0b8,_0x25ca33={'ZbSJR':function(_0x17541d){return _0x17541d();}};return ENVIRONMENT_CONFIGS[_0x25ca33[_0x4dcdfc(0x160)](getCurrentEnvironment)][_0x4dcdfc(0x16d)];}export function getMcpAuthUrl(){const _0x5e5342=_0x3be0b8;return process['env'][_0x5e5342(0x164)]??ENVIRONMENT_CONFIGS[getCurrentEnvironment()]['mcpAuthUrl'];}export function isByokEnabled(){const _0x460cc8=_0x3be0b8,_0x1d8681={'iVFhi':function(_0x319ce1,_0x32f26b){return _0x319ce1===_0x32f26b;}};return _0x1d8681['iVFhi'](process[_0x460cc8(0x156)]['RANGER_BYOK'],_0x460cc8(0x16a));}function isVerificationTransport(_0x3f141f){const _0x2f031f=_0x3be0b8,_0x304077={'wIakb':function(_0x3e2269,_0x2d8285){return _0x3e2269===_0x2d8285;},'VStvm':'mcp','FIibv':function(_0x2769ae,_0x4ea114){return _0x2769ae===_0x4ea114;},'ySmrq':'playwright-cli','RENZc':function(_0x2ff732,_0x5ee2be){return _0x2ff732===_0x5ee2be;}};return _0x304077['wIakb'](_0x3f141f,_0x304077[_0x2f031f(0x15b)])||_0x304077[_0x2f031f(0x16f)](_0x3f141f,_0x304077['ySmrq'])||_0x304077[_0x2f031f(0x163)](_0x3f141f,'nova-act-cli')||_0x304077['RENZc'](_0x3f141f,'rangerwright-cli');}const LEGACY_TRANSPORT_ENV_VARS=[_0x3be0b8(0x153),'RANGER_DISABLE_MCP'];export function getVerificationTransport(){const _0x17cacf=_0x3be0b8,_0x166bd6={'lYQdX':function(_0xc0517f,_0x74c3e5){return _0xc0517f(_0x74c3e5);}},_0x1e627a=process[_0x17cacf(0x156)][_0x17cacf(0x152)]?.['trim']();if(_0x1e627a){if(_0x166bd6['lYQdX'](isVerificationTransport,_0x1e627a))return _0x1e627a;throw new Error('Invalid\x20RANGER_TRANSPORT=\x22'+_0x1e627a+_0x17cacf(0x166));}const _0x3846d1=LEGACY_TRANSPORT_ENV_VARS['find'](_0x51358e=>process['env'][_0x51358e]);if(_0x3846d1)throw new Error(_0x3846d1+_0x17cacf(0x157));return'mcp';}export function resolveHookMode(_0x3a4b6f=process[_0x3be0b8(0x156)]){const _0x488dc4=_0x3be0b8,_0x43fbe9={'SxDcc':_0x488dc4(0x155),'aiGkE':function(_0x2ef31c,_0x566ceb){return _0x2ef31c+_0x566ceb;}},_0x33593f=_0x3a4b6f[_0x488dc4(0x167)]?.['trim']()['toLowerCase']();if(!_0x33593f)return _0x488dc4(0x155);if(_0x33593f===_0x488dc4(0x170)||_0x33593f==='on'||_0x33593f===_0x43fbe9[_0x488dc4(0x15a)])return _0x33593f;return console['error'](_0x43fbe9[_0x488dc4(0x172)](_0x488dc4(0x15f)+_0x3a4b6f[_0x488dc4(0x167)]+'\x22.\x20','Expected\x20one\x20of:\x20off,\x20on,\x20auto.\x20Defaulting\x20to\x20auto.')),'auto';}function _0x5bc2(){const _0x663957=['wIakb','RANGER_MCP_AUTH_URL','client_01J9CBYM7M5ZETCF7G6614DXR2','\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli,\x20rangerwright-cli.','RANGER_HOOKS','92CQtgyV','1161KxLtcp','true','9820986gbcvPD','GRMDW','aiProxyUrl','10010553XbpDYp','FIibv','off','349450zEgIqy','aiGkE','client_01J9CBYM2DKWV9HM17D95Z540K','staging','RANGER_TRANSPORT','RANGER_USE_NOVA_ACT','751393VUQdki','auto','env','\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20RANGER_TRANSPORT=nova-act-cli,\x20or\x20RANGER_TRANSPORT=rangerwright-cli.','12382968lHZQgr','https://ai-proxy-716115358910.us-central1.run.app','SxDcc','VStvm','4222491UkfCkH','4lablkj','http://localhost:8080/mcp','[ranger]\x20Ignoring\x20invalid\x20RANGER_HOOKS=\x22','ZbSJR','239710fcURAM','prod'];_0x5bc2=function(){return _0x663957;};return _0x5bc2();}
1
+ const _0x22c7d7=_0x25d5;(function(_0xf18dec,_0x529e1c){const _0x1a488d=_0x25d5,_0x784126=_0xf18dec();while(!![]){try{const _0x11ef7c=-parseInt(_0x1a488d(0x174))/0x1*(-parseInt(_0x1a488d(0x17b))/0x2)+-parseInt(_0x1a488d(0x162))/0x3+parseInt(_0x1a488d(0x167))/0x4*(parseInt(_0x1a488d(0x16f))/0x5)+-parseInt(_0x1a488d(0x16c))/0x6+parseInt(_0x1a488d(0x18f))/0x7+-parseInt(_0x1a488d(0x17d))/0x8+-parseInt(_0x1a488d(0x182))/0x9*(-parseInt(_0x1a488d(0x186))/0xa);if(_0x11ef7c===_0x529e1c)break;else _0x784126['push'](_0x784126['shift']());}catch(_0x59ee08){_0x784126['push'](_0x784126['shift']());}}}(_0x118b,0xd04c7));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':_0x22c7d7(0x16a),'workosClientId':'client_01J9CBYM7M5ZETCF7G6614DXR2','aiProxyUrl':_0x22c7d7(0x16e),'mcpAuthUrl':'https://mcp-auth.ranger.net/mcp'},'staging':{'apiBaseUrl':_0x22c7d7(0x178),'workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':_0x22c7d7(0x189),'mcpAuthUrl':_0x22c7d7(0x168)},'local':{'apiBaseUrl':_0x22c7d7(0x172),'workosClientId':_0x22c7d7(0x170),'aiProxyUrl':_0x22c7d7(0x18e),'mcpAuthUrl':'http://localhost:8080/mcp'}};export const DEFAULT_ENVIRONMENT='prod';export function isValidEnvironment(_0x2cb43c){const _0x367bc3=_0x22c7d7,_0x5ad864={'TcsTi':'prod'};return _0x2cb43c===_0x5ad864[_0x367bc3(0x183)]||_0x2cb43c==='staging'||_0x2cb43c===_0x367bc3(0x181);}export function getCurrentEnvironment(){const _0x3b2949=_0x22c7d7,_0x50df07=process['env'][_0x3b2949(0x177)];if(_0x50df07&&isValidEnvironment(_0x50df07))return _0x50df07;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){const _0x4970ce=_0x22c7d7,_0x2769d2={'uJXXf':function(_0x5df009){return _0x5df009();}};return ENVIRONMENT_CONFIGS[_0x2769d2[_0x4970ce(0x17e)](getCurrentEnvironment)][_0x4970ce(0x165)];}function _0x118b(){const _0x404a56=['https://api.staging.ranger.net','vnHur','find','453718NtLWWA','bTUeJ','612504OCBtKi','uJXXf','fXaCE','trim','local','9LOIMHz','TcsTi','LbVLs','true','1028870rGrvgn','RANGER_DISABLE_MCP','PQpfE','https://ai-proxy-301751771437.us-central1.run.app','toLowerCase','\x22.\x20','env','Invalid\x20RANGER_TRANSPORT=\x22','http://localhost:8090','2830856nNXhot','mcpAuthUrl','RANGER_MCP_AUTH_URL','4588620hWuSmO','YKKYb','nova-act-cli','apiBaseUrl','Expected\x20one\x20of:\x20off,\x20on,\x20auto.\x20Defaulting\x20to\x20auto.','96BpZYxG','https://mcp-auth.staging.ranger.net/mcp','mcp','https://api.ranger.net','RANGER_HOOKS','6714420pdDDvP','off','https://ai-proxy-716115358910.us-central1.run.app','308970LDvnAL','client_01J9CBYM2DKWV9HM17D95Z540K','playwright-cli','http://localhost:8080','TjFzW','7YuExQd','FtvXC','auto','RANGER_CLI_ENV'];_0x118b=function(){return _0x404a56;};return _0x118b();}export function getAiProxyUrl(){const _0x4523a4=_0x22c7d7,_0x5a9868={'FtvXC':function(_0x6bd27){return _0x6bd27();}};return ENVIRONMENT_CONFIGS[_0x5a9868[_0x4523a4(0x175)](getCurrentEnvironment)]['aiProxyUrl'];}export function getMcpAuthUrl(){const _0x1c14df=_0x22c7d7;return process['env'][_0x1c14df(0x161)]??ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x1c14df(0x160)];}export function isByokEnabled(){const _0x57fc96=_0x22c7d7,_0x1c58d9={'vnHur':function(_0x18c076,_0xa8fecf){return _0x18c076===_0xa8fecf;},'KNbLr':_0x57fc96(0x185)};return _0x1c58d9[_0x57fc96(0x179)](process['env']['RANGER_BYOK'],_0x1c58d9['KNbLr']);}function isVerificationTransport(_0x43ff05){const _0x563374=_0x22c7d7,_0xf6c76={'bTUeJ':_0x563374(0x169),'LbVLs':function(_0x3770ae,_0xa90952){return _0x3770ae===_0xa90952;},'TjFzW':function(_0x427a1d,_0x2e95c4){return _0x427a1d===_0x2e95c4;},'fXaCE':'rangerwright-cli'};return _0x43ff05===_0xf6c76[_0x563374(0x17c)]||_0xf6c76[_0x563374(0x184)](_0x43ff05,_0x563374(0x171))||_0xf6c76['TjFzW'](_0x43ff05,_0x563374(0x164))||_0xf6c76[_0x563374(0x173)](_0x43ff05,_0xf6c76[_0x563374(0x17f)]);}const LEGACY_TRANSPORT_ENV_VARS=['RANGER_USE_NOVA_ACT',_0x22c7d7(0x187)];export function getVerificationTransport(){const _0x2945ad=_0x22c7d7,_0x2a798a=process['env']['RANGER_TRANSPORT']?.['trim']();if(_0x2a798a){if(isVerificationTransport(_0x2a798a))return _0x2a798a;throw new Error(_0x2945ad(0x18d)+_0x2a798a+'\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli,\x20rangerwright-cli.');}const _0x49c84e=LEGACY_TRANSPORT_ENV_VARS[_0x2945ad(0x17a)](_0x1ad2fb=>process[_0x2945ad(0x18c)][_0x1ad2fb]);if(_0x49c84e)throw new Error(_0x49c84e+'\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20RANGER_TRANSPORT=nova-act-cli,\x20or\x20RANGER_TRANSPORT=rangerwright-cli.');return _0x2945ad(0x169);}function _0x25d5(_0x1e3c97,_0x177467){_0x1e3c97=_0x1e3c97-0x160;const _0x118bbc=_0x118b();let _0x25d504=_0x118bbc[_0x1e3c97];return _0x25d504;}export function resolveHookMode(_0x7bfe4b=process['env']){const _0x53a027=_0x22c7d7,_0x15107c={'YKKYb':function(_0x4e54eb,_0x1e9b17){return _0x4e54eb===_0x1e9b17;},'TFqXa':_0x53a027(0x176),'PQpfE':function(_0x50ce62,_0x41910a){return _0x50ce62+_0x41910a;}},_0x24fa15=_0x7bfe4b[_0x53a027(0x16b)]?.[_0x53a027(0x180)]()[_0x53a027(0x18a)]();if(!_0x24fa15)return _0x53a027(0x176);if(_0x15107c[_0x53a027(0x163)](_0x24fa15,_0x53a027(0x16d))||_0x15107c['YKKYb'](_0x24fa15,'on')||_0x24fa15===_0x15107c['TFqXa'])return _0x24fa15;return console['error'](_0x15107c[_0x53a027(0x188)]('[ranger]\x20Ignoring\x20invalid\x20RANGER_HOOKS=\x22'+_0x7bfe4b['RANGER_HOOKS']+_0x53a027(0x18b),_0x53a027(0x166))),'auto';}
@@ -1 +1 @@
1
- (function(_0x3b2ba8,_0x3a37f6){const _0x11897b=_0x16b3,_0x434d38=_0x3b2ba8();while(!![]){try{const _0x3204aa=-parseInt(_0x11897b(0x1c2))/0x1*(-parseInt(_0x11897b(0x1de))/0x2)+parseInt(_0x11897b(0x1c8))/0x3+parseInt(_0x11897b(0x1f9))/0x4+-parseInt(_0x11897b(0x1d2))/0x5+-parseInt(_0x11897b(0x1bf))/0x6*(-parseInt(_0x11897b(0x1f2))/0x7)+parseInt(_0x11897b(0x1e0))/0x8*(parseInt(_0x11897b(0x1f7))/0x9)+parseInt(_0x11897b(0x1fc))/0xa*(-parseInt(_0x11897b(0x1c9))/0xb);if(_0x3204aa===_0x3a37f6)break;else _0x434d38['push'](_0x434d38['shift']());}catch(_0x1df9ad){_0x434d38['push'](_0x434d38['shift']());}}}(_0x2790,0xe95d0));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x3b2dfd){const _0x2d1258=_0x16b3,_0x26056a={'UFZXb':function(_0x3fb19f){return _0x3fb19f();},'mdgfD':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','Znhsk':function(_0x20c0a0){return _0x20c0a0();},'OvLpe':'POST','tVgwa':_0x2d1258(0x1d4)},_0x21173b=await _0x26056a['UFZXb'](getToken);if(!_0x21173b)throw new Error(_0x26056a[_0x2d1258(0x1e8)]);const _0x199dcc=_0x26056a['Znhsk'](getApiBaseUrl),_0x142442=await fetch(_0x199dcc+'/api/v1/mcp/features',{'method':_0x26056a[_0x2d1258(0x1e2)],'headers':{'Authorization':'Bearer\x20'+_0x21173b,'Content-Type':_0x2d1258(0x1e6)},'body':JSON['stringify'](_0x3b2dfd)});if(!_0x142442['ok']){if(_0x142442[_0x2d1258(0x1f1)]===0x192){const _0x23930b=await _0x142442['json'](),_0x31e0f9=_0x23930b[_0x2d1258(0x1e5)]||'https://dashboard.ranger.net/billing';throw new Error((_0x23930b[_0x2d1258(0x1ec)]||_0x26056a['tVgwa'])+'\x0a\x0aUpgrade\x20your\x20plan:\x20'+_0x31e0f9);}const _0x17cf9=await _0x142442['text']();throw new Error(_0x2d1258(0x1eb)+_0x17cf9);}return _0x142442[_0x2d1258(0x1ea)]();}function _0x16b3(_0x438e64,_0x18746e){_0x438e64=_0x438e64-0x1be;const _0x2790d3=_0x2790();let _0x16b3a3=_0x2790d3[_0x438e64];return _0x16b3a3;}export async function listFeatures(_0x3bd727){const _0x3d0b56=_0x16b3,_0x41c613={'ZjTjp':function(_0x2c7f34){return _0x2c7f34();},'lWXkt':function(_0x56deb3){return _0x56deb3();},'cMQMN':_0x3d0b56(0x1d3),'WvFOY':'gitBranch','XqmwF':'includeDeleted'},_0x51a6ff=await _0x41c613['ZjTjp'](getToken);if(!_0x51a6ff)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x859ca=_0x41c613[_0x3d0b56(0x1fa)](getApiBaseUrl),_0x425718=new URLSearchParams();if(_0x3bd727?.[_0x3d0b56(0x1d3)])_0x425718[_0x3d0b56(0x1d1)](_0x41c613[_0x3d0b56(0x200)],_0x3bd727['gitRepoUrl']);if(_0x3bd727?.['gitBranch'])_0x425718['set'](_0x41c613[_0x3d0b56(0x1fb)],_0x3bd727['gitBranch']);if(_0x3bd727?.['limit'])_0x425718[_0x3d0b56(0x1d1)]('limit',_0x3bd727['limit']['toString']());if(_0x3bd727?.[_0x3d0b56(0x1cd)])_0x425718['set']('offset',_0x3bd727[_0x3d0b56(0x1cd)][_0x3d0b56(0x1f3)]());if(_0x3bd727?.['includeDeleted'])_0x425718[_0x3d0b56(0x1d1)](_0x41c613[_0x3d0b56(0x1ff)],'true');const _0x96f309=_0x859ca+'/api/v1/mcp/features'+(_0x425718[_0x3d0b56(0x1f3)]()?'?'+_0x425718['toString']():''),_0x2a0fe6=await fetch(_0x96f309,{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x51a6ff}});if(!_0x2a0fe6['ok']){const _0x48de79=await _0x2a0fe6[_0x3d0b56(0x1e9)]();throw new Error(_0x3d0b56(0x1ce)+_0x48de79);}return _0x2a0fe6['json']();}export async function getFeature(_0xb7f8b2){const _0xaa69e3=_0x16b3,_0x499b79={'jDZQQ':_0xaa69e3(0x1f8),'iSXtM':function(_0x287122,_0x5b7e91,_0x118902){return _0x287122(_0x5b7e91,_0x118902);},'xlXIv':_0xaa69e3(0x1cf)},_0x535a0b=await getToken();if(!_0x535a0b)throw new Error(_0x499b79[_0xaa69e3(0x1cb)]);const _0x271c28=getApiBaseUrl(),_0x36b965=await _0x499b79['iSXtM'](fetch,_0x271c28+'/api/v1/mcp/features/'+_0xb7f8b2,{'method':_0x499b79['xlXIv'],'headers':{'Authorization':'Bearer\x20'+_0x535a0b}});if(!_0x36b965['ok']){const _0x62f89d=await _0x36b965['text']();throw new Error(_0xaa69e3(0x201)+_0x62f89d);}return _0x36b965['json']();}export async function updateFeature(_0x5bb4c5,_0x50591d){const _0x4c966c=_0x16b3,_0x264be3={'yBUWj':function(_0x596bca){return _0x596bca();}},_0x35bac0=await _0x264be3['yBUWj'](getToken);if(!_0x35bac0)throw new Error(_0x4c966c(0x1f8));const _0x54c872=getApiBaseUrl(),_0x308d85=await fetch(_0x54c872+_0x4c966c(0x203)+_0x5bb4c5,{'method':_0x4c966c(0x1fe),'headers':{'Authorization':'Bearer\x20'+_0x35bac0,'Content-Type':'application/json'},'body':JSON[_0x4c966c(0x1dd)](_0x50591d)});if(!_0x308d85['ok']){const _0x2213e9=await _0x308d85[_0x4c966c(0x1e9)]();throw new Error(_0x4c966c(0x1c5)+_0x2213e9);}return _0x308d85['json']();}export async function createChecklistItem(_0x581ecf,_0x12862b,_0x5d243f){const _0x465440=_0x16b3,_0x8af448={'aFHDo':function(_0x33388e){return _0x33388e();},'AqijT':'POST'},_0x4b5108=await getToken();if(!_0x4b5108)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x3155a5=_0x8af448[_0x465440(0x1c7)](getApiBaseUrl),_0xa0b614=await fetch(_0x3155a5+_0x465440(0x203)+_0x581ecf+_0x465440(0x1fd),{'method':_0x8af448['AqijT'],'headers':{'Authorization':_0x465440(0x1cc)+_0x4b5108,'Content-Type':_0x465440(0x1e6)},'body':JSON[_0x465440(0x1dd)]({'description':_0x12862b,'position':_0x5d243f})});if(!_0xa0b614['ok']){const _0x32ec24=await _0xa0b614['text']();throw new Error(_0x465440(0x1c0)+_0x32ec24);}return _0xa0b614[_0x465440(0x1ea)]();}export async function updateChecklistItem(_0x1b4908,_0x307407,_0x51af50){const _0x2b10a6=_0x16b3,_0x29f69f={'dVXGp':function(_0x3c7d53,_0x3807ff,_0x4644f3){return _0x3c7d53(_0x3807ff,_0x4644f3);},'GAwWG':_0x2b10a6(0x1e6),'NJYVl':'updateChecklistItem'};return withRetry(async()=>{const _0x4e20e9=_0x2b10a6,_0x2086c4=await getToken();if(!_0x2086c4)throw new Error(_0x4e20e9(0x1f8));const _0x23a4a3=getApiBaseUrl(),_0x962278=await _0x29f69f[_0x4e20e9(0x1e3)](fetch,_0x23a4a3+'/api/v1/mcp/features/'+_0x1b4908+'/checklist/'+_0x307407,{'method':'PATCH','headers':{'Authorization':'Bearer\x20'+_0x2086c4,'Content-Type':_0x29f69f['GAwWG']},'body':JSON['stringify'](_0x51af50)});if(!_0x962278['ok']){const _0x5c3fe2=await _0x962278[_0x4e20e9(0x1e9)]();throw new Error('Failed\x20to\x20update\x20scenario:\x20'+_0x5c3fe2);}return _0x962278[_0x4e20e9(0x1ea)]();},{'label':_0x29f69f[_0x2b10a6(0x1d6)]});}export async function getFeatureReport(_0x1fdbcb){const _0x48fa87=_0x16b3,_0x74c5d5={'SCLzn':_0x48fa87(0x1f8),'aQwZa':function(_0x15a6cd){return _0x15a6cd();},'HjzKU':function(_0x365781,_0x53572b,_0x12d7c4){return _0x365781(_0x53572b,_0x12d7c4);}},_0xf8af11=await getToken();if(!_0xf8af11)throw new Error(_0x74c5d5['SCLzn']);const _0x43d626=_0x74c5d5[_0x48fa87(0x1f6)](getApiBaseUrl),_0x3d1873=await _0x74c5d5['HjzKU'](fetch,_0x43d626+_0x48fa87(0x203)+_0x1fdbcb+_0x48fa87(0x1d5),{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0xf8af11}});if(!_0x3d1873['ok']){const _0xbdae43=await _0x3d1873[_0x48fa87(0x1e9)]();throw new Error(_0x48fa87(0x1d9)+_0xbdae43);}return _0x3d1873['json']();}export async function getFeatureReportMarkdown(_0x2fea23,_0x4a7c6b){const _0x3492f1=_0x16b3,_0x2ec19a={'mIgcm':_0x3492f1(0x1dc),'NbYGn':_0x3492f1(0x1d7),'xlgTO':'style','ndUad':function(_0x4f42a2,_0x26ca83,_0x4582e9){return _0x4f42a2(_0x26ca83,_0x4582e9);},'yknBA':'GET'},_0x154edf=await getToken();if(!_0x154edf)throw new Error(_0x3492f1(0x1f8));const _0x463dad=getApiBaseUrl(),_0x4ccffa=new URLSearchParams(),_0x2b3548=(_0x4a7c6b?.[_0x3492f1(0x1dc)]?.[_0x3492f1(0x1ed)]??0x0)>0x0,_0x11b52f=Boolean(_0x4a7c6b?.[_0x3492f1(0x1d7)]);_0x2b3548&&_0x4a7c6b?.['itemIds']&&_0x4ccffa['set'](_0x2ec19a['mIgcm'],_0x4a7c6b[_0x3492f1(0x1dc)]['join'](','));_0x11b52f&&_0x4a7c6b?.[_0x3492f1(0x1d7)]&&_0x4ccffa['set'](_0x2ec19a['NbYGn'],_0x4a7c6b['sessionId']);!_0x2b3548&&!_0x11b52f&&_0x4a7c6b?.[_0x3492f1(0x1d8)]&&_0x4ccffa['set'](_0x2ec19a['xlgTO'],_0x4a7c6b[_0x3492f1(0x1d8)]);const _0x3c0298=_0x463dad+_0x3492f1(0x203)+_0x2fea23+_0x3492f1(0x1e7),_0x41cb7e=''+_0x3c0298+(_0x4ccffa['toString']()?'?'+_0x4ccffa[_0x3492f1(0x1f3)]():''),_0x2562d2=await _0x2ec19a[_0x3492f1(0x1be)](fetch,_0x41cb7e,{'method':_0x2ec19a['yknBA'],'headers':{'Authorization':_0x3492f1(0x1cc)+_0x154edf}});if(!_0x2562d2['ok']){const _0x5e869b=await _0x2562d2['text']();throw new Error(_0x3492f1(0x1c6)+_0x5e869b);}return _0x2562d2[_0x3492f1(0x1e9)]();}export async function listFeatureSessions(_0x3cbcff){const _0x3fcf0b=_0x16b3,_0x3c7154={'CXbkP':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','wjTwA':function(_0x381540,_0x41c200,_0x383e56){return _0x381540(_0x41c200,_0x383e56);},'qUMby':_0x3fcf0b(0x1cf)},_0x3c5087=await getToken();if(!_0x3c5087)throw new Error(_0x3c7154['CXbkP']);const _0x22ca55=getApiBaseUrl(),_0x2b5b42=await _0x3c7154['wjTwA'](fetch,_0x22ca55+'/api/v1/mcp/features/'+_0x3cbcff+_0x3fcf0b(0x1ca),{'method':_0x3c7154['qUMby'],'headers':{'Authorization':_0x3fcf0b(0x1cc)+_0x3c5087}});if(!_0x2b5b42['ok']){const _0x1895ff=await _0x2b5b42['text']();throw new Error(_0x3fcf0b(0x1c1)+_0x1895ff);}return _0x2b5b42['json']();}export async function startSession(_0x4ca254,_0x2a6734){const _0x54444e=_0x16b3,_0x206def={'TNiHU':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','DqMAd':function(_0x550f18){return _0x550f18();},'BMtPV':function(_0x3d2401,_0x37320b,_0x3f7f88){return _0x3d2401(_0x37320b,_0x3f7f88);}},_0x301e5f=await getToken();if(!_0x301e5f)throw new Error(_0x206def['TNiHU']);const _0x1b9799=_0x206def['DqMAd'](getApiBaseUrl),_0x3ada97=await _0x206def[_0x54444e(0x1db)](fetch,_0x1b9799+'/api/v1/mcp/features/'+_0x4ca254+_0x54444e(0x1d0)+_0x2a6734+_0x54444e(0x1ee),{'method':_0x54444e(0x1c4),'headers':{'Authorization':'Bearer\x20'+_0x301e5f}});if(!_0x3ada97['ok']){const _0xd418fc=await _0x3ada97['text']();throw new Error(_0x54444e(0x1f0)+_0xd418fc);}return _0x3ada97['json']();}export async function concludeSession(_0x47ede5,_0x10402b){const _0x4c1fa9=_0x16b3,_0x5bf624={'KjxFY':function(_0x220334){return _0x220334();},'plbHU':'POST'},_0x3f4e1f=await getToken();if(!_0x3f4e1f)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x574b37=_0x5bf624['KjxFY'](getApiBaseUrl),_0x329f93=await fetch(_0x574b37+_0x4c1fa9(0x203)+_0x47ede5+'/sessions/'+_0x10402b+'/conclude',{'method':_0x5bf624[_0x4c1fa9(0x1df)],'headers':{'Authorization':'Bearer\x20'+_0x3f4e1f}});if(!_0x329f93['ok']){const _0x31f312=await _0x329f93['text']();throw new Error('Failed\x20to\x20conclude\x20session:\x20'+_0x31f312);}return _0x329f93[_0x4c1fa9(0x1ea)]();}export async function getActionItems(_0x1378f0){const _0x4b48a4=_0x16b3,_0x476389={'CKwFb':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','ruKht':function(_0x4c2dc4){return _0x4c2dc4();},'vxMDn':'GET'},_0x212b61=await getToken();if(!_0x212b61)throw new Error(_0x476389['CKwFb']);const _0x428ac8=_0x476389[_0x4b48a4(0x202)](getApiBaseUrl),_0x10afd2=await fetch(_0x428ac8+_0x4b48a4(0x203)+_0x1378f0+'/action-items',{'method':_0x476389['vxMDn'],'headers':{'Authorization':'Bearer\x20'+_0x212b61}});if(!_0x10afd2['ok']){const _0x24f7d0=await _0x10afd2['text']();throw new Error('Failed\x20to\x20get\x20action\x20items:\x20'+_0x24f7d0);}return _0x10afd2[_0x4b48a4(0x1ea)]();}function _0x2790(){const _0x20ff48=['message','length','/start','Failed\x20to\x20delete\x20feature\x20review:\x20','Failed\x20to\x20start\x20session:\x20','status','546119yXPFCx','toString','/restore','msZuB','aQwZa','9MznIVC','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','2643992LnsaII','lWXkt','WvFOY','17065660DrOmLy','/checklist','PATCH','XqmwF','cMQMN','Failed\x20to\x20get\x20feature\x20review:\x20','ruKht','/api/v1/mcp/features/','ndUad','126QsHrYm','Failed\x20to\x20create\x20scenario:\x20','Failed\x20to\x20list\x20sessions:\x20','17477DaPOdo','Failed\x20to\x20restore\x20feature\x20review:\x20','POST','Failed\x20to\x20update\x20feature\x20review:\x20','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','aFHDo','880563QiTmga','22VrtcYg','/sessions','jDZQQ','Bearer\x20','offset','Failed\x20to\x20list\x20feature\x20reviews:\x20','GET','/sessions/','set','4381265nYKicq','gitRepoUrl','Feature\x20limit\x20exceeded','/report','NJYVl','sessionId','style','Failed\x20to\x20get\x20feature\x20review\x20report:\x20','/feedback','BMtPV','itemIds','stringify','154OLOvqm','plbHU','10453088NiXxyc','AUjEM','OvLpe','dVXGp','irOuk','billingUrl','application/json','/report/markdown','mdgfD','text','json','Failed\x20to\x20create\x20feature\x20review:\x20'];_0x2790=function(){return _0x20ff48;};return _0x2790();}export async function getItemFeedback(_0x245983,_0x1ddd47){const _0x8306b4=_0x16b3,_0x5b63e7={'irOuk':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','nAZWc':function(_0x38f937){return _0x38f937();},'dzYPE':function(_0x5a3bfa,_0x11e93d,_0x1cb304){return _0x5a3bfa(_0x11e93d,_0x1cb304);}},_0x4369d0=await getToken();if(!_0x4369d0)throw new Error(_0x5b63e7[_0x8306b4(0x1e4)]);const _0xc921f5=_0x5b63e7['nAZWc'](getApiBaseUrl),_0x7c91e7=await _0x5b63e7['dzYPE'](fetch,_0xc921f5+_0x8306b4(0x203)+_0x245983+'/checklist-items/'+_0x1ddd47+_0x8306b4(0x1da),{'method':_0x8306b4(0x1cf),'headers':{'Authorization':'Bearer\x20'+_0x4369d0}});if(!_0x7c91e7['ok']){const _0x1eff2a=await _0x7c91e7['text']();throw new Error('Failed\x20to\x20get\x20item\x20feedback:\x20'+_0x1eff2a);}return _0x7c91e7['json']();}export async function markCommentsAddressed(_0x3808b1,_0x1c1616,_0x446fd7){const _0xb52f07=_0x16b3,_0x193e86={'uKSQn':function(_0x393de5){return _0x393de5();},'KdEuK':_0xb52f07(0x1f8),'msZuB':function(_0x227efe,_0x3ebac7,_0x351d9f){return _0x227efe(_0x3ebac7,_0x351d9f);}},_0x2e4a69=await _0x193e86['uKSQn'](getToken);if(!_0x2e4a69)throw new Error(_0x193e86['KdEuK']);const _0x37fc18=getApiBaseUrl(),_0x3a5fb9=await _0x193e86[_0xb52f07(0x1f5)](fetch,_0x37fc18+'/api/v1/mcp/features/'+_0x3808b1+'/comments/address',{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x2e4a69,'Content-Type':'application/json'},'body':JSON[_0xb52f07(0x1dd)]({'checklistItemId':_0x1c1616,'commentIds':_0x446fd7})});if(!_0x3a5fb9['ok']){const _0x196487=await _0x3a5fb9[_0xb52f07(0x1e9)]();throw new Error('Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20'+_0x196487);}}export async function softDeleteFeature(_0xce716){const _0x52e54d=_0x16b3,_0x3eceac={'WNwrA':function(_0x30b492){return _0x30b492();},'AUjEM':function(_0x470c17,_0x3dec0a,_0x30c555){return _0x470c17(_0x3dec0a,_0x30c555);},'Qsymn':'DELETE'},_0x592152=await _0x3eceac['WNwrA'](getToken);if(!_0x592152)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x3af8e3=getApiBaseUrl(),_0x355fb2=await _0x3eceac[_0x52e54d(0x1e1)](fetch,_0x3af8e3+'/api/v1/mcp/features/'+_0xce716,{'method':_0x3eceac['Qsymn'],'headers':{'Authorization':_0x52e54d(0x1cc)+_0x592152}});if(!_0x355fb2['ok']){const _0x107945=await _0x355fb2[_0x52e54d(0x1e9)]();throw new Error(_0x52e54d(0x1ef)+_0x107945);}}export async function restoreFeature(_0xbcab53){const _0x385538=_0x16b3,_0x31f49b={'XGwJt':function(_0x45e0a3){return _0x45e0a3();},'JgXnA':function(_0x169e4e,_0x1e4c13,_0x27a38f){return _0x169e4e(_0x1e4c13,_0x27a38f);},'jJmxp':'POST'},_0x9afdb1=await _0x31f49b['XGwJt'](getToken);if(!_0x9afdb1)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x3f449c=getApiBaseUrl(),_0x4b94ac=await _0x31f49b['JgXnA'](fetch,_0x3f449c+'/api/v1/mcp/features/'+_0xbcab53+_0x385538(0x1f4),{'method':_0x31f49b['jJmxp'],'headers':{'Authorization':'Bearer\x20'+_0x9afdb1}});if(!_0x4b94ac['ok']){const _0x12cb7d=await _0x4b94ac['text']();throw new Error(_0x385538(0x1c3)+_0x12cb7d);}}
1
+ (function(_0x402791,_0x33a22f){const _0x537ea4=_0x21e5,_0x218deb=_0x402791();while(!![]){try{const _0x353fa9=-parseInt(_0x537ea4(0x1e0))/0x1*(-parseInt(_0x537ea4(0x1cc))/0x2)+parseInt(_0x537ea4(0x1ad))/0x3*(-parseInt(_0x537ea4(0x1ae))/0x4)+-parseInt(_0x537ea4(0x1bd))/0x5+-parseInt(_0x537ea4(0x1a8))/0x6*(-parseInt(_0x537ea4(0x1e5))/0x7)+parseInt(_0x537ea4(0x1df))/0x8*(-parseInt(_0x537ea4(0x1d3))/0x9)+parseInt(_0x537ea4(0x1ba))/0xa+-parseInt(_0x537ea4(0x1db))/0xb*(-parseInt(_0x537ea4(0x1d8))/0xc);if(_0x353fa9===_0x33a22f)break;else _0x218deb['push'](_0x218deb['shift']());}catch(_0x5d5c07){_0x218deb['push'](_0x218deb['shift']());}}}(_0x1c07,0xbbfa8));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';function _0x1c07(){const _0x37d6d7=['itemIds','510235GoEcMf','/report','/checklist-items/','/comments/address','164928HMlJGL','158VezSwF','Bearer\x20','toString','stringify','Failed\x20to\x20create\x20feature\x20review:\x20','7dJBfeZ','bXKSZ','limit','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','nAIdo','xGMLj','TTjXr','SJrLG','length','application/json','Failed\x20to\x20delete\x20feature\x20review:\x20','/api/v1/mcp/features','billingUrl','updateChecklistItem','Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20','yxTOp','message','5662218QKmaFl','json','\x0a\x0aUpgrade\x20your\x20plan:\x20','POST','set','43389GxnNwH','240UieFVq','offset','airBq','gitBranch','GET','/action-items','https://dashboard.ranger.net/billing','KThxK','/api/v1/mcp/features/','MAweg','TIEnx','true','5531530xRjsTJ','Failed\x20to\x20get\x20item\x20feedback:\x20','style','3116665gPLChE','sQJcT','zRRsG','/checklist','rzlYr','hjppk','Uskoy','ajpPC','uPLuT','Failed\x20to\x20update\x20scenario:\x20','ivgGT','/conclude','dIbfN','COoPP','text','6216hNohDE','Failed\x20to\x20update\x20feature\x20review:\x20','kriKF','tGmNt','/sessions/','/feedback','includeDeleted','63RJEHMX','ZrUAi','BGTPv','xjRWb','sessionId','108TANlGO','PATCH'];_0x1c07=function(){return _0x37d6d7;};return _0x1c07();}import{withRetry}from'./retry.js';export async function createFeature(_0x1a33f4){const _0x155f62=_0x21e5,_0x4b302c={'Uskoy':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','FXquW':_0x155f62(0x1ee),'TIEnx':'Feature\x20limit\x20exceeded'},_0x1c1fb3=await getToken();if(!_0x1c1fb3)throw new Error(_0x4b302c[_0x155f62(0x1c3)]);const _0x28ea26=getApiBaseUrl(),_0x53dd53=await fetch(_0x28ea26+_0x155f62(0x1f0),{'method':'POST','headers':{'Authorization':_0x155f62(0x1e1)+_0x1c1fb3,'Content-Type':_0x4b302c['FXquW']},'body':JSON[_0x155f62(0x1e3)](_0x1a33f4)});if(!_0x53dd53['ok']){if(_0x53dd53['status']===0x192){const _0x539747=await _0x53dd53['json'](),_0x160034=_0x539747[_0x155f62(0x1f1)]||_0x155f62(0x1b4);throw new Error((_0x539747[_0x155f62(0x1a7)]||_0x4b302c[_0x155f62(0x1b8)])+_0x155f62(0x1aa)+_0x160034);}const _0x2c453e=await _0x53dd53[_0x155f62(0x1cb)]();throw new Error(_0x155f62(0x1e4)+_0x2c453e);}return _0x53dd53['json']();}export async function listFeatures(_0x46be68){const _0x5e0ea3=_0x21e5,_0x4a2446={'dIbfN':function(_0x314564){return _0x314564();},'wGfSU':_0x5e0ea3(0x1b2)},_0x22b09c=await getToken();if(!_0x22b09c)throw new Error(_0x5e0ea3(0x1e8));const _0x3e1215=_0x4a2446[_0x5e0ea3(0x1c9)](getApiBaseUrl),_0x1b5c3d=new URLSearchParams();if(_0x46be68?.['gitRepoUrl'])_0x1b5c3d[_0x5e0ea3(0x1ac)]('gitRepoUrl',_0x46be68['gitRepoUrl']);if(_0x46be68?.[_0x5e0ea3(0x1b1)])_0x1b5c3d['set'](_0x5e0ea3(0x1b1),_0x46be68[_0x5e0ea3(0x1b1)]);if(_0x46be68?.[_0x5e0ea3(0x1e7)])_0x1b5c3d['set']('limit',_0x46be68['limit']['toString']());if(_0x46be68?.['offset'])_0x1b5c3d['set'](_0x5e0ea3(0x1af),_0x46be68[_0x5e0ea3(0x1af)][_0x5e0ea3(0x1e2)]());if(_0x46be68?.['includeDeleted'])_0x1b5c3d[_0x5e0ea3(0x1ac)](_0x5e0ea3(0x1d2),_0x5e0ea3(0x1b9));const _0x4647a2=_0x3e1215+'/api/v1/mcp/features'+(_0x1b5c3d['toString']()?'?'+_0x1b5c3d['toString']():''),_0x15f971=await fetch(_0x4647a2,{'method':_0x4a2446['wGfSU'],'headers':{'Authorization':_0x5e0ea3(0x1e1)+_0x22b09c}});if(!_0x15f971['ok']){const _0x319e18=await _0x15f971['text']();throw new Error('Failed\x20to\x20list\x20feature\x20reviews:\x20'+_0x319e18);}return _0x15f971[_0x5e0ea3(0x1a9)]();}export async function getFeature(_0x5e42db){const _0x9189e2=_0x21e5,_0x2a49ec={'xGMLj':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','mfvEu':_0x9189e2(0x1b2)},_0x159af6=await getToken();if(!_0x159af6)throw new Error(_0x2a49ec[_0x9189e2(0x1ea)]);const _0x44c4a0=getApiBaseUrl(),_0x42493f=await fetch(_0x44c4a0+_0x9189e2(0x1b6)+_0x5e42db,{'method':_0x2a49ec['mfvEu'],'headers':{'Authorization':_0x9189e2(0x1e1)+_0x159af6}});if(!_0x42493f['ok']){const _0x4463a0=await _0x42493f['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review:\x20'+_0x4463a0);}return _0x42493f['json']();}export async function updateFeature(_0x526e11,_0x545b69){const _0x2ca925=_0x21e5,_0x482838={'pImdc':function(_0x23b9d4){return _0x23b9d4();},'uPLuT':_0x2ca925(0x1e8),'ZrUAi':'PATCH'},_0x8284b7=await _0x482838['pImdc'](getToken);if(!_0x8284b7)throw new Error(_0x482838[_0x2ca925(0x1c5)]);const _0x58b12e=getApiBaseUrl(),_0x38a7cf=await fetch(_0x58b12e+_0x2ca925(0x1b6)+_0x526e11,{'method':_0x482838[_0x2ca925(0x1d4)],'headers':{'Authorization':_0x2ca925(0x1e1)+_0x8284b7,'Content-Type':_0x2ca925(0x1ee)},'body':JSON['stringify'](_0x545b69)});if(!_0x38a7cf['ok']){const _0x4f7fcc=await _0x38a7cf['text']();throw new Error(_0x2ca925(0x1cd)+_0x4f7fcc);}return _0x38a7cf['json']();}export async function createChecklistItem(_0x5d34e3,_0x134e9f,_0x2810ae){const _0x15ae4c=_0x21e5,_0x595208={'MAweg':_0x15ae4c(0x1e8),'OrVGB':function(_0x1f0acc){return _0x1f0acc();},'oMwYe':function(_0x3e7503,_0x5bcdbf,_0x15d03c){return _0x3e7503(_0x5bcdbf,_0x15d03c);},'yxTOp':_0x15ae4c(0x1ee)},_0xb6c9f5=await getToken();if(!_0xb6c9f5)throw new Error(_0x595208[_0x15ae4c(0x1b7)]);const _0x349d59=_0x595208['OrVGB'](getApiBaseUrl),_0x39c361=await _0x595208['oMwYe'](fetch,_0x349d59+'/api/v1/mcp/features/'+_0x5d34e3+_0x15ae4c(0x1c0),{'method':_0x15ae4c(0x1ab),'headers':{'Authorization':'Bearer\x20'+_0xb6c9f5,'Content-Type':_0x595208[_0x15ae4c(0x1a6)]},'body':JSON['stringify']({'description':_0x134e9f,'position':_0x2810ae})});if(!_0x39c361['ok']){const _0x4eb906=await _0x39c361[_0x15ae4c(0x1cb)]();throw new Error('Failed\x20to\x20create\x20scenario:\x20'+_0x4eb906);}return _0x39c361[_0x15ae4c(0x1a9)]();}export async function updateChecklistItem(_0x56475c,_0x5d1cde,_0x157f64){const _0xc8bc42=_0x21e5,_0x40b190={'oScZI':function(_0x5bb0c5){return _0x5bb0c5();},'ajpPC':_0xc8bc42(0x1d9)};return withRetry(async()=>{const _0x1fec3f=_0xc8bc42,_0x7da169=await _0x40b190['oScZI'](getToken);if(!_0x7da169)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0xa26da4=getApiBaseUrl(),_0x23efb7=await fetch(_0xa26da4+'/api/v1/mcp/features/'+_0x56475c+'/checklist/'+_0x5d1cde,{'method':_0x40b190[_0x1fec3f(0x1c4)],'headers':{'Authorization':_0x1fec3f(0x1e1)+_0x7da169,'Content-Type':'application/json'},'body':JSON[_0x1fec3f(0x1e3)](_0x157f64)});if(!_0x23efb7['ok']){const _0x2af0ec=await _0x23efb7[_0x1fec3f(0x1cb)]();throw new Error(_0x1fec3f(0x1c6)+_0x2af0ec);}return _0x23efb7[_0x1fec3f(0x1a9)]();},{'label':_0xc8bc42(0x1a4)});}export async function getFeatureReport(_0x2b654f){const _0x57081a=_0x21e5,_0x1dc6ff={'VunZc':function(_0x19fe3d){return _0x19fe3d();},'rzlYr':function(_0x5bc6ea,_0x577aee,_0x20f4ad){return _0x5bc6ea(_0x577aee,_0x20f4ad);}},_0x30401e=await _0x1dc6ff['VunZc'](getToken);if(!_0x30401e)throw new Error(_0x57081a(0x1e8));const _0x48bcff=getApiBaseUrl(),_0x2a820e=await _0x1dc6ff[_0x57081a(0x1c1)](fetch,_0x48bcff+_0x57081a(0x1b6)+_0x2b654f+_0x57081a(0x1dc),{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x30401e}});if(!_0x2a820e['ok']){const _0x34347f=await _0x2a820e['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report:\x20'+_0x34347f);}return _0x2a820e[_0x57081a(0x1a9)]();}export async function getFeatureReportMarkdown(_0x35e4fd,_0x254745){const _0x2b782b=_0x21e5,_0x3ba3f6={'EIniC':function(_0x3e7a69){return _0x3e7a69();},'kriKF':function(_0x547ff2,_0x430919){return _0x547ff2>_0x430919;},'KThxK':function(_0x461636,_0x785081){return _0x461636&&_0x785081;},'xjRWb':_0x2b782b(0x1bc),'nXXNC':_0x2b782b(0x1b2)},_0x565714=await getToken();if(!_0x565714)throw new Error(_0x2b782b(0x1e8));const _0x593518=_0x3ba3f6['EIniC'](getApiBaseUrl),_0x48ab32=new URLSearchParams(),_0x2872b8=_0x3ba3f6[_0x2b782b(0x1ce)](_0x254745?.['itemIds']?.[_0x2b782b(0x1ed)]??0x0,0x0),_0x49755c=Boolean(_0x254745?.['sessionId']);_0x2872b8&&_0x254745?.[_0x2b782b(0x1da)]&&_0x48ab32['set']('itemIds',_0x254745['itemIds']['join'](','));_0x49755c&&_0x254745?.[_0x2b782b(0x1d7)]&&_0x48ab32[_0x2b782b(0x1ac)]('sessionId',_0x254745[_0x2b782b(0x1d7)]);_0x3ba3f6[_0x2b782b(0x1b5)](!_0x2872b8,!_0x49755c)&&_0x254745?.[_0x2b782b(0x1bc)]&&_0x48ab32['set'](_0x3ba3f6[_0x2b782b(0x1d6)],_0x254745['style']);const _0x2caa10=_0x593518+'/api/v1/mcp/features/'+_0x35e4fd+'/report/markdown',_0x12c21e=''+_0x2caa10+(_0x48ab32[_0x2b782b(0x1e2)]()?'?'+_0x48ab32['toString']():''),_0xd282f7=await fetch(_0x12c21e,{'method':_0x3ba3f6['nXXNC'],'headers':{'Authorization':'Bearer\x20'+_0x565714}});if(!_0xd282f7['ok']){const _0x4e0cfb=await _0xd282f7['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20'+_0x4e0cfb);}return _0xd282f7[_0x2b782b(0x1cb)]();}export async function listFeatureSessions(_0x51ab2a){const _0x4793ed=_0x21e5,_0x30e5a4={'Yolrq':_0x4793ed(0x1e8),'btLTu':_0x4793ed(0x1b2)},_0x5be41e=await getToken();if(!_0x5be41e)throw new Error(_0x30e5a4['Yolrq']);const _0x2c1ea1=getApiBaseUrl(),_0x1a2f49=await fetch(_0x2c1ea1+'/api/v1/mcp/features/'+_0x51ab2a+'/sessions',{'method':_0x30e5a4['btLTu'],'headers':{'Authorization':_0x4793ed(0x1e1)+_0x5be41e}});if(!_0x1a2f49['ok']){const _0x9fe8f=await _0x1a2f49[_0x4793ed(0x1cb)]();throw new Error('Failed\x20to\x20list\x20sessions:\x20'+_0x9fe8f);}return _0x1a2f49['json']();}function _0x21e5(_0x268a9f,_0xf9c07f){_0x268a9f=_0x268a9f-0x1a4;const _0x1c0777=_0x1c07();let _0x21e5fe=_0x1c0777[_0x268a9f];return _0x21e5fe;}export async function startSession(_0x15433b,_0xd1d2dc){const _0x2caa00=_0x21e5,_0x436a2b={'COoPP':function(_0x563fbe){return _0x563fbe();},'jvqAA':function(_0x38ef48,_0x3ee2e4,_0x354610){return _0x38ef48(_0x3ee2e4,_0x354610);}},_0x4b9638=await getToken();if(!_0x4b9638)throw new Error(_0x2caa00(0x1e8));const _0x4f10c0=_0x436a2b[_0x2caa00(0x1ca)](getApiBaseUrl),_0x1b8ed9=await _0x436a2b['jvqAA'](fetch,_0x4f10c0+_0x2caa00(0x1b6)+_0x15433b+_0x2caa00(0x1d0)+_0xd1d2dc+'/start',{'method':'POST','headers':{'Authorization':_0x2caa00(0x1e1)+_0x4b9638}});if(!_0x1b8ed9['ok']){const _0x498aa0=await _0x1b8ed9[_0x2caa00(0x1cb)]();throw new Error('Failed\x20to\x20start\x20session:\x20'+_0x498aa0);}return _0x1b8ed9['json']();}export async function concludeSession(_0x239401,_0x2aeb00){const _0x5ab0a5=_0x21e5,_0x39d7a2={'Lblqg':function(_0x2dc33c){return _0x2dc33c();},'SSgYq':_0x5ab0a5(0x1e8),'dibzC':_0x5ab0a5(0x1ab)},_0x1bf6dc=await _0x39d7a2['Lblqg'](getToken);if(!_0x1bf6dc)throw new Error(_0x39d7a2['SSgYq']);const _0x37b0a4=getApiBaseUrl(),_0x1989bf=await fetch(_0x37b0a4+'/api/v1/mcp/features/'+_0x239401+'/sessions/'+_0x2aeb00+_0x5ab0a5(0x1c8),{'method':_0x39d7a2['dibzC'],'headers':{'Authorization':'Bearer\x20'+_0x1bf6dc}});if(!_0x1989bf['ok']){const _0x4d16a9=await _0x1989bf[_0x5ab0a5(0x1cb)]();throw new Error('Failed\x20to\x20conclude\x20session:\x20'+_0x4d16a9);}return _0x1989bf[_0x5ab0a5(0x1a9)]();}export async function getActionItems(_0x197fd5){const _0x5c5180=_0x21e5,_0xd94748={'PeUQT':_0x5c5180(0x1e8),'SJrLG':function(_0x33a985,_0x317412,_0xea7800){return _0x33a985(_0x317412,_0xea7800);},'SdHQe':_0x5c5180(0x1b2)},_0x3d0941=await getToken();if(!_0x3d0941)throw new Error(_0xd94748['PeUQT']);const _0x4cec78=getApiBaseUrl(),_0xb4bb3d=await _0xd94748[_0x5c5180(0x1ec)](fetch,_0x4cec78+'/api/v1/mcp/features/'+_0x197fd5+_0x5c5180(0x1b3),{'method':_0xd94748['SdHQe'],'headers':{'Authorization':'Bearer\x20'+_0x3d0941}});if(!_0xb4bb3d['ok']){const _0x2afe8a=await _0xb4bb3d[_0x5c5180(0x1cb)]();throw new Error('Failed\x20to\x20get\x20action\x20items:\x20'+_0x2afe8a);}return _0xb4bb3d['json']();}export async function getItemFeedback(_0x2629cf,_0x4d48fa){const _0x31aab9=_0x21e5,_0x130438={'airBq':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','sQJcT':function(_0x29cd98,_0x3b2e57,_0x4a23b8){return _0x29cd98(_0x3b2e57,_0x4a23b8);},'zAcFI':_0x31aab9(0x1b2)},_0x2e34c0=await getToken();if(!_0x2e34c0)throw new Error(_0x130438[_0x31aab9(0x1b0)]);const _0x4a195c=getApiBaseUrl(),_0x333fd0=await _0x130438[_0x31aab9(0x1be)](fetch,_0x4a195c+_0x31aab9(0x1b6)+_0x2629cf+_0x31aab9(0x1dd)+_0x4d48fa+_0x31aab9(0x1d1),{'method':_0x130438['zAcFI'],'headers':{'Authorization':_0x31aab9(0x1e1)+_0x2e34c0}});if(!_0x333fd0['ok']){const _0x436dfe=await _0x333fd0[_0x31aab9(0x1cb)]();throw new Error(_0x31aab9(0x1bb)+_0x436dfe);}return _0x333fd0['json']();}export async function markCommentsAddressed(_0x30e9a5,_0x20601a,_0x577c70){const _0x7be8e0=_0x21e5,_0x367f2d={'TTjXr':function(_0x3e7145){return _0x3e7145();},'zRRsG':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','wysVa':function(_0x36cf16){return _0x36cf16();},'tGmNt':_0x7be8e0(0x1ab),'bXKSZ':'application/json'},_0x1e2f8d=await _0x367f2d[_0x7be8e0(0x1eb)](getToken);if(!_0x1e2f8d)throw new Error(_0x367f2d[_0x7be8e0(0x1bf)]);const _0x527590=_0x367f2d['wysVa'](getApiBaseUrl),_0x5632a7=await fetch(_0x527590+_0x7be8e0(0x1b6)+_0x30e9a5+_0x7be8e0(0x1de),{'method':_0x367f2d[_0x7be8e0(0x1cf)],'headers':{'Authorization':_0x7be8e0(0x1e1)+_0x1e2f8d,'Content-Type':_0x367f2d[_0x7be8e0(0x1e6)]},'body':JSON['stringify']({'checklistItemId':_0x20601a,'commentIds':_0x577c70})});if(!_0x5632a7['ok']){const _0x269af8=await _0x5632a7[_0x7be8e0(0x1cb)]();throw new Error(_0x7be8e0(0x1a5)+_0x269af8);}}export async function softDeleteFeature(_0x1f27b2){const _0x490f79=_0x21e5,_0x2ec70a={'hjppk':function(_0x29967e){return _0x29967e();},'BGTPv':_0x490f79(0x1e8),'ZDMlg':function(_0x2fc43e,_0x2a70d1,_0x3b016b){return _0x2fc43e(_0x2a70d1,_0x3b016b);}},_0x34c023=await _0x2ec70a['hjppk'](getToken);if(!_0x34c023)throw new Error(_0x2ec70a[_0x490f79(0x1d5)]);const _0x1f913e=_0x2ec70a[_0x490f79(0x1c2)](getApiBaseUrl),_0x806b25=await _0x2ec70a['ZDMlg'](fetch,_0x1f913e+_0x490f79(0x1b6)+_0x1f27b2,{'method':'DELETE','headers':{'Authorization':'Bearer\x20'+_0x34c023}});if(!_0x806b25['ok']){const _0x75b251=await _0x806b25['text']();throw new Error(_0x490f79(0x1ef)+_0x75b251);}}export async function restoreFeature(_0x54988b){const _0x508c52=_0x21e5,_0x4e678e={'nAIdo':function(_0x4d51eb){return _0x4d51eb();},'ivgGT':'POST'},_0x98ab12=await _0x4e678e[_0x508c52(0x1e9)](getToken);if(!_0x98ab12)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x198c80=_0x4e678e['nAIdo'](getApiBaseUrl),_0x134f4a=await fetch(_0x198c80+'/api/v1/mcp/features/'+_0x54988b+'/restore',{'method':_0x4e678e[_0x508c52(0x1c7)],'headers':{'Authorization':'Bearer\x20'+_0x98ab12}});if(!_0x134f4a['ok']){const _0x388d0f=await _0x134f4a[_0x508c52(0x1cb)]();throw new Error('Failed\x20to\x20restore\x20feature\x20review:\x20'+_0x388d0f);}}