@ranger-testing/ranger-cli 2.5.4-alpha.bc88254-5 → 2.5.4-alpha.f4657dc-23
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.
- package/README.md +36 -14
- package/build/cli.js +1 -1
- package/build/commands/addEnv.js +1 -1
- package/build/commands/authEncrypt.js +1 -1
- package/build/commands/clean.js +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/deleteProfile.js +1 -0
- package/build/commands/env.js +1 -1
- package/build/commands/feature.js +1 -1
- package/build/commands/hook.js +1 -1
- package/build/commands/hooks/autoPrompt.js +1 -1
- package/build/commands/hooks/disable.js +1 -1
- package/build/commands/hooks/enable.js +1 -1
- package/build/commands/hooks/exitPlanMode.js +1 -1
- package/build/commands/hooks/index.js +1 -1
- package/build/commands/hooks/output.js +1 -1
- package/build/commands/hooks/planReminder.js +1 -1
- package/build/commands/hooks/planStart.js +1 -1
- package/build/commands/hooks/postEdit.js +1 -1
- package/build/commands/hooks/preCompact.js +1 -1
- package/build/commands/hooks/sessionEnd.js +1 -1
- package/build/commands/hooks/sessionStart.js +1 -1
- package/build/commands/hooks/stopHook.js +1 -1
- package/build/commands/index.js +1 -1
- package/build/commands/login.js +1 -1
- package/build/commands/mcpBootstrap.js +1 -1
- package/build/commands/migrateProfile.js +1 -1
- package/build/commands/setup/claude.js +1 -1
- package/build/commands/setup/opencode.js +1 -1
- package/build/commands/setupCi.js +1 -1
- package/build/commands/skillup.js +1 -1
- package/build/commands/start.js +1 -1
- package/build/commands/status.js +1 -1
- package/build/commands/update.js +1 -1
- package/build/commands/updateEnv.js +1 -1
- package/build/commands/useEnv.js +1 -1
- package/build/commands/utils/activeProfile.js +1 -1
- package/build/commands/utils/agentEnv.js +1 -1
- package/build/commands/utils/browserSessionsApi.js +1 -1
- package/build/commands/utils/claudeConfig.js +1 -1
- package/build/commands/utils/claudeOverrideSettings.js +1 -1
- package/build/commands/utils/claudePlugin.js +1 -1
- package/build/commands/utils/cloudProfile.js +1 -1
- package/build/commands/utils/cloudProfileSession.js +1 -1
- package/build/commands/utils/crypto.js +1 -1
- package/build/commands/utils/desirePathLog.js +1 -1
- package/build/commands/utils/deviceAuth.js +1 -1
- package/build/commands/utils/environment.js +1 -1
- package/build/commands/utils/featureApi.js +1 -1
- package/build/commands/utils/fixWebmDuration.js +1 -1
- package/build/commands/utils/gitTracked.js +1 -1
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/legacyWarning.js +1 -0
- package/build/commands/utils/localAgentInstallationsApi.js +1 -1
- package/build/commands/utils/matchAuthEnvironment.js +1 -1
- package/build/commands/utils/mcpImageBase64.js +1 -1
- package/build/commands/utils/model.js +1 -1
- package/build/commands/utils/opencodeConfig.js +1 -1
- package/build/commands/utils/playwrightCli.js +1 -1
- package/build/commands/utils/profileMessages.js +1 -1
- package/build/commands/utils/profileSetupBanner.js +1 -1
- package/build/commands/utils/projectsConfig.js +1 -1
- package/build/commands/utils/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.js +1 -1
- package/build/commands/utils/resolveProfileContext.js +1 -1
- package/build/commands/utils/resolveProfileUrl.js +1 -1
- package/build/commands/utils/retry.js +1 -1
- package/build/commands/utils/sessionCache.js +1 -1
- package/build/commands/utils/settings.js +1 -1
- package/build/commands/utils/skillContent.js +1 -1
- package/build/commands/utils/skills.js +1 -1
- package/build/commands/utils/stitchWebmFiles.js +1 -1
- package/build/commands/utils/telemetry.js +1 -1
- package/build/commands/utils/tokenRefresh.js +1 -1
- package/build/commands/utils/traceSnapshotMapper.js +1 -1
- package/build/commands/utils/userApi.js +1 -1
- package/build/commands/utils/version.js +1 -1
- package/build/commands/verifyFeature.js +1 -1
- package/build/commands/verifyFeatureCli.js +1 -1
- package/build/skills/ranger/SKILL.md +35 -6
- package/build/skills/ranger/create.md +19 -0
- package/build/skills/ranger/verify.md +42 -15
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x13fb1e=_0x4ebb;(function(_0x91b3cf,_0x427f96){const _0x3ed7b0=_0x4ebb,_0x164cea=_0x91b3cf();while(!![]){try{const _0x5e7517=-parseInt(_0x3ed7b0(0x1de))/0x1*(-parseInt(_0x3ed7b0(0x1a3))/0x2)+parseInt(_0x3ed7b0(0x1c6))/0x3*(parseInt(_0x3ed7b0(0x19a))/0x4)+-parseInt(_0x3ed7b0(0x1b5))/0x5*(-parseInt(_0x3ed7b0(0x195))/0x6)+parseInt(_0x3ed7b0(0x18e))/0x7+-parseInt(_0x3ed7b0(0x1d6))/0x8+-parseInt(_0x3ed7b0(0x1ba))/0x9*(parseInt(_0x3ed7b0(0x1c9))/0xa)+parseInt(_0x3ed7b0(0x1d1))/0xb*(-parseInt(_0x3ed7b0(0x1bf))/0xc);if(_0x5e7517===_0x427f96)break;else _0x164cea['push'](_0x164cea['shift']());}catch(_0x9f576a){_0x164cea['push'](_0x164cea['shift']());}}}(_0x334e,0x506c5));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';function _0x4ebb(_0x4a498a,_0x48c4d5){_0x4a498a=_0x4a498a-0x176;const _0x334e69=_0x334e();let _0x4ebb7f=_0x334e69[_0x4a498a];return _0x4ebb7f;}import _0x2aa5da 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,isCachedSessionLive,isInteractive,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0x302251={'QYalp':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x5a4151=await getToken();if(!_0x5a4151)throw new Error(_0x302251['QYalp']);return _0x5a4151;}async function apiRequest(_0x5e395c,_0x1ed71b={}){const _0x5e7cf7=_0x4ebb,_0x5e54ef={'kmbjL':function(_0xdfe0c6){return _0xdfe0c6();},'Qknzw':function(_0x4c6eaa,_0x505fc6,_0x1abd1e){return _0x4c6eaa(_0x505fc6,_0x1abd1e);},'VnGyh':_0x5e7cf7(0x1a9),'rMTmq':function(_0x4ff162,_0x51e474){return _0x4ff162===_0x51e474;},'LDYXg':'string'},_0x3167be=await requireToken(),_0x58cac=_0x5e54ef[_0x5e7cf7(0x1a8)](getApiBaseUrl),_0x47e22e=await _0x5e54ef['Qknzw'](fetch,''+_0x58cac+_0x5e395c,{..._0x1ed71b,'headers':{'Authorization':'Bearer\x20'+_0x3167be,'Content-Type':_0x5e54ef[_0x5e7cf7(0x1d8)],..._0x1ed71b['headers']??{}}});if(!_0x47e22e['ok']){let _0x1eeab8='',_0x18b0fc;try{const _0x12f5ce=await _0x47e22e[_0x5e7cf7(0x18f)]();_0x1eeab8=(typeof _0x12f5ce[_0x5e7cf7(0x1b2)]===_0x5e7cf7(0x17e)?_0x12f5ce['error']:undefined)??JSON[_0x5e7cf7(0x1bd)](_0x12f5ce);if(_0x5e54ef[_0x5e7cf7(0x194)](typeof _0x12f5ce[_0x5e7cf7(0x1c3)],_0x5e54ef[_0x5e7cf7(0x179)]))_0x18b0fc=_0x12f5ce['code'];}catch{_0x1eeab8=_0x47e22e['statusText'];}throw new ApiError('API\x20request\x20'+_0x5e395c+'\x20failed\x20('+_0x47e22e[_0x5e7cf7(0x1b9)]+_0x5e7cf7(0x183)+_0x1eeab8,_0x47e22e['status'],_0x1eeab8,_0x18b0fc);}return _0x47e22e['json']();}export class ApiError extends Error{[_0x13fb1e(0x1b9)];['detail'];['code'];constructor(_0xda3e79,_0x2defeb,_0x1fa63f,_0x18d378){const _0x438d0e=_0x13fb1e,_0x3c6e03={'putJU':'ApiError'};super(_0xda3e79),this[_0x438d0e(0x1b9)]=_0x2defeb,this[_0x438d0e(0x1cc)]=_0x1fa63f,this['code']=_0x18d378,this[_0x438d0e(0x1ce)]=_0x3c6e03['putJU'];}}export async function fetchCloudProfile(_0x848284){const _0x5d4311={'uYrRU':function(_0x22c7da,_0x492d3b){return _0x22c7da(_0x492d3b);},'bdqxl':function(_0x2c45e4,_0x2660f2){return _0x2c45e4 instanceof _0x2660f2;}};try{return await _0x5d4311['uYrRU'](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x848284));}catch(_0x4104b7){if(_0x5d4311['bdqxl'](_0x4104b7,ApiError)&&_0x4104b7['status']===0x194)return null;throw _0x4104b7;}}export async function listCloudProfiles(){const _0x942a1e=_0x13fb1e,_0x2310bc={'PpzWI':'/api/v1/profiles'},_0x1c03ac=await apiRequest(_0x2310bc['PpzWI']);return _0x1c03ac[_0x942a1e(0x1b1)];}export async function createCloudProfile(_0x135aca,_0x1a89c3,_0x23b13c={}){const _0x4b5021=_0x13fb1e,_0x32a7be={'MqSnr':_0x4b5021(0x18a),'QSkQK':_0x4b5021(0x1b6)},_0x144dd1={'name':_0x135aca};if(_0x1a89c3)_0x144dd1[_0x4b5021(0x1bb)]=_0x1a89c3;_0x23b13c['settings']&&Object['keys'](_0x23b13c[_0x4b5021(0x1a1)])['length']>0x0&&(_0x144dd1[_0x4b5021(0x1a1)]=_0x23b13c['settings']);if(_0x23b13c[_0x4b5021(0x177)])_0x144dd1[_0x4b5021(0x177)]=_0x23b13c[_0x4b5021(0x177)];if(_0x23b13c['password'])_0x144dd1[_0x4b5021(0x1e1)]=_0x23b13c['password'];return await apiRequest(_0x32a7be['MqSnr'],{'method':_0x32a7be[_0x4b5021(0x1ab)],'body':JSON['stringify'](_0x144dd1)});}export async function uploadCloudProfileSession(_0xc3c1d3,_0x6b5516){const _0x5cbfb4=_0x13fb1e,_0x12b356={'zCUPO':function(_0x3cba37,_0x4a3713,_0x3c2ff0){return _0x3cba37(_0x4a3713,_0x3c2ff0);},'uAupH':function(_0x4bbe62,_0x5da7c1){return _0x4bbe62(_0x5da7c1);},'CHTvU':'POST'};return await _0x12b356[_0x5cbfb4(0x197)](apiRequest,'/api/v1/profiles/'+_0x12b356['uAupH'](encodeURIComponent,_0xc3c1d3)+_0x5cbfb4(0x1e2),{'method':_0x12b356[_0x5cbfb4(0x1cd)],'body':JSON[_0x5cbfb4(0x1bd)]({'session_state':_0x6b5516})});}export async function saveCloudProfileCredentials(_0x197c20,_0x55d8aa,_0x2781b5){const _0x234b12=_0x13fb1e,_0x3f9de4={'zADNE':function(_0x9c4fbc,_0x3308c9){return _0x9c4fbc(_0x3308c9);}};await apiRequest(_0x234b12(0x1a5)+_0x3f9de4[_0x234b12(0x191)](encodeURIComponent,_0x197c20),{'method':_0x234b12(0x1a0),'body':JSON['stringify']({'username':_0x55d8aa,'password':_0x2781b5})});}export async function fetchAuthConfig(){const _0xd677cc=_0x13fb1e,_0x2b081b={'MTCxW':function(_0x575d29,_0x4c0f01){return _0x575d29(_0x4c0f01);},'imnlo':'/api/v1/profiles/auth-config'};try{const _0x32af75=await _0x2b081b['MTCxW'](apiRequest,_0x2b081b[_0xd677cc(0x1a6)]);return _0x32af75[_0xd677cc(0x17d)];}catch{return null;}}export function pickAdHocEnvKey(_0x2593c9){const _0x12a009=_0x13fb1e,_0x2f30d4={'eAptP':function(_0x5d4a7d,_0x59337a){return _0x5d4a7d+_0x59337a;}};if(!_0x2593c9)return null;if(_0x2593c9['defaultEnvironmentKey'])return _0x2593c9[_0x12a009(0x1c1)];const _0x5022d3=Object[_0x12a009(0x1d0)](_0x2593c9[_0x12a009(0x1dc)]??{});if(_0x5022d3[_0x12a009(0x1ae)]===0x1)return _0x5022d3[0x0];if(_0x5022d3[_0x12a009(0x1ae)]===0x0)return null;throw new Error(_0x2f30d4[_0x12a009(0x1a2)]('Multiple\x20envs\x20in\x20this\x20org\x27s\x20auth\x20config\x20('+_0x5022d3[_0x12a009(0x186)](',\x20')+').\x20','Pass\x20--env\x20<key>\x20or\x20set\x20\x27defaultEnvironmentKey\x27\x20on\x20the\x20auth\x20config.'));}export async function resolveAdHocProfile(_0x5d377c=process['env']){const _0x2d0c55=_0x13fb1e,_0x1770e8={'nrDne':function(_0x5cb08c,_0x2fde28){return _0x5cb08c(_0x2fde28);},'hfNSk':function(_0x2bc1b2,_0x4afd45){return _0x2bc1b2(_0x4afd45);}},_0x44f97c=_0x5d377c[_0x2d0c55(0x1c4)];if(!_0x44f97c)return null;const _0x11246a=await _0x1770e8[_0x2d0c55(0x1db)](fetchCloudProfile,_0x44f97c);if(_0x11246a)return{'name':_0x11246a['name'],'profile':_0x11246a};const _0x428f80=await fetchAuthConfig(),_0x50fd4b=_0x1770e8['hfNSk'](pickAdHocEnvKey,_0x428f80),_0x40b0f6=_0x5d377c[_0x2d0c55(0x18b)],_0x3e25ab=await createCloudProfile(_0x44f97c,_0x50fd4b??undefined,{'username':_0x44f97c,'password':_0x40b0f6});return{'name':_0x3e25ab[_0x2d0c55(0x1ce)],'profile':_0x3e25ab};}export async function writeSessionToLocalCache(_0x2aa079,_0x464780,_0x592142,_0x2957bb,_0x4e3b3f,_0x1807c4){const _0x5e6442=_0x13fb1e,_0x5d500a={'zrKsM':function(_0xbdcf24,_0x186761){return _0xbdcf24(_0x186761);},'ARLMt':function(_0x2d7a32,_0x3b7b68,_0x238c16){return _0x2d7a32(_0x3b7b68,_0x238c16);},'wrMDF':function(_0xb1b8a2,_0x504e55,_0x25ef70){return _0xb1b8a2(_0x504e55,_0x25ef70);},'uVzWz':function(_0x1ca789,_0x182e20,_0x489352){return _0x1ca789(_0x182e20,_0x489352);}},_0x10f2e7=_0x5d500a[_0x5e6442(0x1c2)](sessionCacheHash,{'orgId':_0x464780,'profileName':_0x2aa079,'effectiveBaseUrl':_0x592142,'setupHeaders':_0x2957bb}),_0x30800c=_0x5d500a['ARLMt'](getSessionCachePath,_0x10f2e7,_0x2aa079),_0x38a7c6=_0x5d500a[_0x5e6442(0x19b)](join,getRangerHomeDir(),_0x5e6442(0x1d7));!_0x5d500a['zrKsM'](existsSync,_0x38a7c6)&&await _0x5d500a['uVzWz'](mkdir,_0x38a7c6,{'recursive':!![]});const _0x196844={..._0x4e3b3f};_0x1807c4&&_0x1807c4['length']>0x0&&Array['isArray'](_0x196844['cookies'])&&(_0x196844[_0x5e6442(0x1cb)]=_0x5d500a[_0x5e6442(0x19b)](duplicateCookiesForDomains,_0x196844['cookies'],_0x1807c4));const _0x40b4d1={'cached_at':new Date()['toISOString'](),'session_state':_0x196844};await writeFile(_0x30800c,JSON[_0x5e6442(0x1bd)](_0x40b4d1,null,0x2));const _0x1ced71=_0x5d500a['zrKsM'](getStorageStatePath,_0x30800c);return await _0x5d500a['wrMDF'](writeFile,_0x1ced71,JSON[_0x5e6442(0x1bd)](_0x196844,null,0x2)),_0x1ced71;}export async function checkLocalCache(_0x202fe6,_0x4ed611,_0x471d8c,_0xb67892){const _0xfdf3d7=_0x13fb1e,_0x5eadf4={'idKYo':function(_0x4bbc2d,_0xef15fb){return _0x4bbc2d(_0xef15fb);},'scbOo':function(_0x52e098,_0x416760,_0x2044a9){return _0x52e098(_0x416760,_0x2044a9);},'SpIeQ':function(_0x2fad90,_0x340eba,_0x27bf95){return _0x2fad90(_0x340eba,_0x27bf95);}},_0x448f32=_0x5eadf4[_0xfdf3d7(0x1ac)](sessionCacheHash,{'orgId':_0x4ed611,'profileName':_0x202fe6,'effectiveBaseUrl':_0x471d8c,'setupHeaders':_0xb67892}),_0xe3a6da=_0x5eadf4['scbOo'](getSessionCachePath,_0x448f32,_0x202fe6),_0x4b60b7=getStorageStatePath(_0xe3a6da);if(!existsSync(_0xe3a6da)||!_0x5eadf4['idKYo'](existsSync,_0x4b60b7))return null;try{const _0x599434=await _0x5eadf4['SpIeQ'](readFile,_0xe3a6da,'utf-8');return JSON[_0xfdf3d7(0x1c7)](_0x599434),{'storageStatePath':_0x4b60b7};}catch{return null;}}function _0x334e(){const _0x43f242=['168cHRcPL','BsdCb','zCUPO','sessionState','\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.','12uxgpXR','wrMDF','organizationId','storageStatePath','OrzJl','QhJUb','PUT','settings','eAptP','226944vcMNSs','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD,\x20configure\x20','/api/v1/profiles/','imnlo','sessionCheckPath','kmbjL','application/json','session_state','QSkQK','idKYo','\x22.\x0a','length','about:blank','test_output','profiles','error','baseUrl','env','29795npcnIJ','POST','storageState','\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.','status','27YVcyzu','environment_key','irssC','stringify','\x20\x20Login\x20successful.\x20Session\x20cached.','2055120yWbHFb','\x22\x20failed\x20validation\x20—\x20re-login\x20needed...','defaultEnvironmentKey','zrKsM','code','RANGER_TEST_USERNAME','confirm','571386ZYcXfM','parse','JhIYH','1709040JkYmAe','\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22','cookies','detail','CHTvU','name','setupHeaders','keys','11dGPEnp','log','uVAJM','Jlywf','environmentKey','3802016pqePht','auth','VnGyh','\x20\x20Cloud\x20session\x20for\x20\x22','kyBlk','nrDne','environments','newPage','5yoTlJM','bZwwa','prompt','password','/session','RZliW','\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22','newContext','qjuXy','username','ZJfSo','LDYXg','not_configured','slQDf','loginInstructions\x20on\x20the\x20auth\x20environment,\x20or\x20run\x20with\x20a\x20TTY.','auth_config','string','XwGno','\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','gxyqy','wdeos','):\x20','extraHTTPHeaders','domains','join','\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','EInfg','IkuDP','/api/v1/profiles','RANGER_TEST_PASSWORD','launch','message','1281273fcvHHS','json','close','zADNE','\x20\x20Server-side\x20login\x20error:\x20','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','rMTmq'];_0x334e=function(){return _0x43f242;};return _0x334e();}function launchRealBrowser(){return chromium['launch']({'headless':!![]});}export async function serverSideLogin(_0x100e0c,_0x3edcc4){const _0x184c24=_0x13fb1e,_0x562a27={'OrzJl':function(_0x16e8dd,_0x478864,_0x48f78c){return _0x16e8dd(_0x478864,_0x48f78c);},'cutSk':function(_0x61b117,_0x5b1536){return _0x61b117(_0x5b1536);},'GGKbQ':function(_0x665422,_0x811c37){return _0x665422 instanceof _0x811c37;},'kyBlk':function(_0x947255,_0x5992b5){return _0x947255===_0x5992b5;},'yqWmZ':function(_0x51e9dc,_0xe33f71){return _0x51e9dc===_0xe33f71;},'QhJUb':_0x184c24(0x17a)},_0x3b517b=process['env'][_0x184c24(0x1c4)],_0x28d4f6=process['env']['RANGER_TEST_PASSWORD'],_0x465244={};if(_0x3b517b)_0x465244['username']=_0x3b517b;if(_0x28d4f6)_0x465244[_0x184c24(0x1e1)]=_0x28d4f6;if(_0x3edcc4?.['force'])_0x465244['force']=!![];try{return await _0x562a27[_0x184c24(0x19e)](apiRequest,'/api/v1/profiles/'+_0x562a27['cutSk'](encodeURIComponent,_0x100e0c)+'/login',{'method':'POST','body':JSON['stringify'](_0x465244)});}catch(_0x2c0379){if(_0x562a27['GGKbQ'](_0x2c0379,ApiError)&&_0x562a27[_0x184c24(0x1da)](_0x2c0379[_0x184c24(0x1b9)],0x190)&&_0x562a27['yqWmZ'](_0x2c0379[_0x184c24(0x1c3)],'not_configured'))return{'status':_0x562a27[_0x184c24(0x19f)],'error':_0x2c0379['detail']};throw _0x2c0379;}}export async function manualBrowserLogin(_0x5a3ccc,_0x977ddc){const _0x536738=_0x13fb1e,_0x3dd88a={'Jlywf':function(_0x2845c5,_0x154414,_0x5100ef){return _0x2845c5(_0x154414,_0x5100ef);},'uVAJM':_0x536738(0x190),'slQDf':function(_0x401d0a,_0xb6286b){return _0x401d0a+_0xb6286b;},'gxyqy':_0x536738(0x1a4),'EInfg':_0x536738(0x17c),'KfvMc':_0x536738(0x180),'ASfog':'\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','JhIYH':'Browser\x20login\x20timed\x20out\x20before\x20completion.','XwGno':'Browser\x20closed\x20before\x20authentication\x20was\x20saved.','TfpPZ':function(_0x12ba3d,_0x550e9b){return _0x12ba3d(_0x550e9b);}};if(!isInteractive())throw new Error(_0x3dd88a[_0x536738(0x17b)](_0x3dd88a[_0x536738(0x17b)]('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0x5a3ccc['name']+_0x536738(0x1ad),_0x3dd88a[_0x536738(0x181)]),_0x3dd88a[_0x536738(0x188)]));const _0x17ca82=_0x977ddc&&_0x977ddc[_0x536738(0x185)]['length']>0x0?_0x977ddc['domains'][0x0]:_0x536738(0x1af);console[_0x536738(0x1d2)](_0x3dd88a['KfvMc']),console['log'](_0x3dd88a['ASfog']),await new Promise(_0x313fdb=>setTimeout(_0x313fdb,0x7d0));const _0x25066b=await chromium[_0x536738(0x18c)]({'headless':![]});let _0x19a2b1=null;try{const _0x5d2171={'ignoreHTTPSErrors':!![]};_0x977ddc?.['setupHeaders']&&(_0x5d2171[_0x536738(0x184)]=_0x977ddc[_0x536738(0x1cf)]);const _0x416dd3=await _0x25066b[_0x536738(0x1e5)](_0x5d2171);await addProfileSetupBanner(_0x416dd3);const _0x2274cd=await _0x416dd3[_0x536738(0x1dd)]();await _0x2274cd['goto'](_0x17ca82);let _0x4fd6f4=![];await new Promise(_0xacb1b2=>{const _0x2ce8d9=_0x536738,_0x2ccaa3={'qjuXy':function(_0x3026fb,_0x92736c){return _0x3026fb(_0x92736c);},'KfsLk':function(_0x5bc255){return _0x5bc255();}},_0x2fbe42=_0x3dd88a[_0x2ce8d9(0x1d4)](setTimeout,()=>{const _0x2b38f3=_0x2ce8d9;_0x4fd6f4=!![],console[_0x2b38f3(0x1b2)]('Browser\x20login\x20timed\x20out\x20after\x20'+MANUAL_LOGIN_TIMEOUT_MS/0xea60+_0x2b38f3(0x199)),_0xacb1b2();},MANUAL_LOGIN_TIMEOUT_MS);_0x2274cd['on'](_0x3dd88a[_0x2ce8d9(0x1d3)],async()=>{const _0x4bbad8=_0x2ce8d9;_0x2ccaa3[_0x4bbad8(0x176)](clearTimeout,_0x2fbe42);try{const _0x27ca66=await _0x416dd3[_0x4bbad8(0x1b7)]();_0x19a2b1=_0x27ca66;}catch{}_0x2ccaa3['KfsLk'](_0xacb1b2);});});if(_0x4fd6f4&&!_0x19a2b1)throw new Error(_0x3dd88a[_0x536738(0x1c8)]);}finally{await _0x25066b['close']()['catch'](()=>{});}if(!_0x19a2b1)throw new Error(_0x3dd88a[_0x536738(0x17f)]);return await apiRequest('/api/v1/profiles/'+_0x3dd88a['TfpPZ'](encodeURIComponent,_0x5a3ccc['name'])+'/session',{'method':'POST','body':JSON['stringify']({'session_state':_0x19a2b1,'updated_by':'cli:manual-login'})}),{'sessionState':_0x19a2b1};}export async function promptSaveCredentials(_0xd47539){const _0x4f44d9=_0x13fb1e,_0x2266ca={'rmWyg':_0x4f44d9(0x1c5),'BsdCb':'Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','Brtwg':function(_0xa19d8d,_0x43a69a,_0x5d6ffa){return _0xa19d8d(_0x43a69a,_0x5d6ffa);},'irssC':function(_0x30f97e,_0x2f9c5c){return _0x30f97e(_0x2f9c5c);},'IkuDP':'PUT'},_0x572d87=process['env'][_0x4f44d9(0x1c4)],_0x558b75=process[_0x4f44d9(0x1b4)]['RANGER_TEST_PASSWORD'];if(!_0x572d87||!_0x558b75)return;if(!isInteractive())return;const {save:_0xbe5dec}=await _0x2aa5da[_0x4f44d9(0x1e0)]([{'type':_0x2266ca['rmWyg'],'name':'save','message':_0x2266ca[_0x4f44d9(0x196)],'default':![]}]);if(!_0xbe5dec)return;await _0x2266ca['Brtwg'](apiRequest,'/api/v1/profiles/'+_0x2266ca[_0x4f44d9(0x1bc)](encodeURIComponent,_0xd47539),{'method':_0x2266ca[_0x4f44d9(0x189)],'body':JSON[_0x4f44d9(0x1bd)]({'username':_0x572d87,'password':_0x558b75})}),console[_0x4f44d9(0x1d2)](_0x4f44d9(0x1b8));}export async function resolveCloudProfileSession(_0x4b6eaa,_0x51c45e={}){const _0x349342=_0x13fb1e,_0x1784fa={'RZliW':function(_0x290435){return _0x290435();},'khjAj':function(_0x4086e5,_0x50b925){return _0x4086e5>_0x50b925;},'wdeos':function(_0x353073,_0x33ccf4){return _0x353073(_0x33ccf4);},'mqUoM':function(_0x6ae022,_0x4ed57b){return _0x6ae022===_0x4ed57b;},'fCyJB':'success','SUobj':_0x349342(0x1be),'ZJfSo':'\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','ZsKZd':function(_0x72844b,_0x527ae0){return _0x72844b instanceof _0x527ae0;},'bZwwa':'\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...'},_0x4a1709=_0x4b6eaa['settings']??{},_0x2f10f1=await _0x1784fa[_0x349342(0x1e3)](fetchAuthConfig),_0x52f5a9=_0x2f10f1?resolveAuthEnvironmentLocally(_0x2f10f1,_0x4b6eaa[_0x349342(0x1d5)]):null,_0x3d4386=_0x52f5a9?.[_0x349342(0x185)],_0x2c5051=_0x4a1709['setupHeaders'],_0x2ad431=_0x2c5051??_0x52f5a9?.[_0x349342(0x1cf)],_0xb1a52=_0x51c45e['effectiveBaseUrl']??_0x4a1709[_0x349342(0x1b3)]??(_0x3d4386&&_0x1784fa['khjAj'](_0x3d4386['length'],0x0)?_0x3d4386[0x0]:''),_0xfa6efc=await checkLocalCache(_0x4b6eaa['name'],_0x4b6eaa[_0x349342(0x19c)],_0xb1a52,_0x2ad431);if(_0xfa6efc){if(_0xb1a52){const _0x539669=await isCachedSessionLive(_0xfa6efc[_0x349342(0x19d)],_0xb1a52,{'sessionCheckPath':_0x52f5a9?.[_0x349342(0x1a7)],'setupHeaders':_0x2ad431},{'launchBrowser':launchRealBrowser});if(_0x539669)return console[_0x349342(0x1d2)](_0x349342(0x1e4)+_0x4b6eaa['name']+'\x22'),{'authPath':_0xfa6efc[_0x349342(0x19d)],'settings':_0x4a1709,'resolvedEnv':_0x52f5a9};console[_0x349342(0x1d2)]('\x20\x20Cached\x20session\x20for\x20\x22'+_0x4b6eaa['name']+'\x22\x20failed\x20validation\x20—\x20refreshing...');}else return{'authPath':_0xfa6efc[_0x349342(0x19d)],'settings':_0x4a1709,'resolvedEnv':_0x52f5a9};}if(_0x4b6eaa[_0x349342(0x198)]){const _0x57e605=await writeSessionToLocalCache(_0x4b6eaa[_0x349342(0x1ce)],_0x4b6eaa[_0x349342(0x19c)],_0xb1a52,_0x2ad431,_0x4b6eaa['sessionState'],_0x3d4386);if(_0xb1a52){const _0x275f23=await isCachedSessionLive(_0x57e605,_0xb1a52,{'sessionCheckPath':_0x52f5a9?.['sessionCheckPath'],'setupHeaders':_0x2ad431},{'launchBrowser':launchRealBrowser});if(_0x275f23)return console['log'](_0x349342(0x1ca)+_0x4b6eaa[_0x349342(0x1ce)]+'\x22,\x20cached\x20locally'),{'authPath':_0x57e605,'settings':_0x4a1709,'resolvedEnv':_0x52f5a9};console['log'](_0x349342(0x1d9)+_0x4b6eaa[_0x349342(0x1ce)]+_0x349342(0x1c0));}else return{'authPath':_0x57e605,'settings':_0x4a1709,'resolvedEnv':_0x52f5a9};}console[_0x349342(0x1d2)]('\x20\x20No\x20live\x20session\x20for\x20\x22'+_0x4b6eaa['name']+'\x22,\x20attempting\x20login...');const _0x1acbb9=Boolean(process[_0x349342(0x1b4)]['RANGER_TEST_USERNAME'])&&Boolean(process[_0x349342(0x1b4)][_0x349342(0x18b)]),_0x208c64=Boolean(_0x4b6eaa['username']);if(_0x1acbb9||_0x208c64)try{const _0x452a03=await _0x1784fa['wdeos'](serverSideLogin,_0x4b6eaa['name']);if(_0x452a03[_0x349342(0x1b9)]==='not_configured')console[_0x349342(0x1d2)](_0x349342(0x187));else{if(_0x1784fa['mqUoM'](_0x452a03['status'],_0x1784fa['fCyJB'])&&_0x452a03[_0x349342(0x1aa)]){console[_0x349342(0x1d2)](_0x1784fa['SUobj']);const _0x349216=await writeSessionToLocalCache(_0x4b6eaa[_0x349342(0x1ce)],_0x4b6eaa['organizationId'],_0xb1a52,_0x2ad431,_0x452a03['session_state'],_0x3d4386);return _0x1acbb9&&!_0x208c64&&await promptSaveCredentials(_0x4b6eaa['name']),{'authPath':_0x349216,'settings':_0x4a1709,'resolvedEnv':_0x52f5a9};}else _0x452a03[_0x349342(0x1b0)]&&(console[_0x349342(0x1d2)](_0x1784fa[_0x349342(0x178)]),console['log'](_0x452a03[_0x349342(0x1b0)])),console['log'](_0x349342(0x193));}}catch(_0x3af76c){console['log'](_0x349342(0x192)+(_0x1784fa['ZsKZd'](_0x3af76c,Error)?_0x3af76c[_0x349342(0x18d)]:_0x1784fa[_0x349342(0x182)](String,_0x3af76c))),console[_0x349342(0x1d2)](_0x1784fa[_0x349342(0x1df)]);}const {sessionState:_0x5ce91a}=await manualBrowserLogin(_0x4b6eaa,_0x52f5a9),_0x422f93=await writeSessionToLocalCache(_0x4b6eaa[_0x349342(0x1ce)],_0x4b6eaa[_0x349342(0x19c)],_0xb1a52,_0x2ad431,_0x5ce91a,_0x3d4386);return{'authPath':_0x422f93,'settings':_0x4a1709,'resolvedEnv':_0x52f5a9};}
|
|
1
|
+
const _0xf9dd55=_0x4d8d;(function(_0x16d361,_0x2f4464){const _0x1ec314=_0x4d8d,_0x532e7f=_0x16d361();while(!![]){try{const _0x47fa5f=parseInt(_0x1ec314(0xf3))/0x1*(parseInt(_0x1ec314(0xd6))/0x2)+-parseInt(_0x1ec314(0xe4))/0x3*(-parseInt(_0x1ec314(0x11f))/0x4)+parseInt(_0x1ec314(0x114))/0x5+-parseInt(_0x1ec314(0xe6))/0x6*(-parseInt(_0x1ec314(0x10f))/0x7)+parseInt(_0x1ec314(0xd9))/0x8*(parseInt(_0x1ec314(0xba))/0x9)+-parseInt(_0x1ec314(0xc1))/0xa+-parseInt(_0x1ec314(0xbd))/0xb;if(_0x47fa5f===_0x2f4464)break;else _0x532e7f['push'](_0x532e7f['shift']());}catch(_0x4b5a7d){_0x532e7f['push'](_0x532e7f['shift']());}}}(_0x2fb0,0xbc21f));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x2766e3 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,isCachedSessionLive,isInteractive,resolveAuthEnvironmentLocally,sessionCacheHash}from'./cloudProfileSession.js';const MANUAL_LOGIN_TIMEOUT_MS=0xa*0x3c*0x3e8;async function requireToken(){const _0xae6bd8=_0x4d8d,_0x17f7f5=await getToken();if(!_0x17f7f5)throw new Error(_0xae6bd8(0x123));return _0x17f7f5;}async function apiRequest(_0x28f46e,_0x4546b4={}){const _0x30efff=_0x4d8d,_0x2ff93d={'OJmLn':function(_0x5c8ae6){return _0x5c8ae6();},'omVIt':_0x30efff(0xc6),'klXGq':_0x30efff(0xd8),'LZZXH':function(_0x4d1063,_0x4e428c){return _0x4d1063===_0x4e428c;}},_0x3adbc7=await _0x2ff93d[_0x30efff(0x124)](requireToken),_0x549f6d=getApiBaseUrl(),_0x4fd5c3=await fetch(''+_0x549f6d+_0x28f46e,{..._0x4546b4,'headers':{'Authorization':_0x30efff(0x11b)+_0x3adbc7,'Content-Type':_0x2ff93d[_0x30efff(0xdc)],..._0x4546b4[_0x30efff(0xf6)]??{}}});if(!_0x4fd5c3['ok']){let _0x5d973b='',_0x4b432c;try{const _0x5a593c=await _0x4fd5c3['json']();_0x5d973b=(typeof _0x5a593c[_0x30efff(0xf7)]===_0x2ff93d[_0x30efff(0xc9)]?_0x5a593c[_0x30efff(0xf7)]:undefined)??JSON[_0x30efff(0xd4)](_0x5a593c);if(_0x2ff93d[_0x30efff(0x112)](typeof _0x5a593c['code'],_0x2ff93d[_0x30efff(0xc9)]))_0x4b432c=_0x5a593c[_0x30efff(0xec)];}catch{_0x5d973b=_0x4fd5c3['statusText'];}throw new ApiError('API\x20request\x20'+_0x28f46e+_0x30efff(0xcb)+_0x4fd5c3['status']+_0x30efff(0xdf)+_0x5d973b,_0x4fd5c3[_0x30efff(0xce)],_0x5d973b,_0x4b432c);}if(_0x4fd5c3['status']===0xcc)return undefined;return _0x4fd5c3['json']();}export class ApiError extends Error{[_0xf9dd55(0xce)];[_0xf9dd55(0xf5)];['code'];constructor(_0x360447,_0x4b7699,_0x92bb04,_0x17945d){const _0x2a228e=_0xf9dd55,_0x453d9b={'QLWIF':'ApiError'};super(_0x360447),this[_0x2a228e(0xce)]=_0x4b7699,this['detail']=_0x92bb04,this['code']=_0x17945d,this['name']=_0x453d9b['QLWIF'];}}export async function fetchCloudProfile(_0x2cb629){const _0x2a9e3a=_0xf9dd55,_0x2f8300={'CUuTT':function(_0xdc1c19,_0x69cbde){return _0xdc1c19(_0x69cbde);},'EOqRP':function(_0x3143f8,_0x14fd59){return _0x3143f8===_0x14fd59;}};try{return await _0x2f8300[_0x2a9e3a(0xd5)](apiRequest,_0x2a9e3a(0x12e)+encodeURIComponent(_0x2cb629));}catch(_0x468806){if(_0x468806 instanceof ApiError&&_0x2f8300[_0x2a9e3a(0x11c)](_0x468806['status'],0x194))return null;throw _0x468806;}}export async function listCloudProfiles(){const _0x5e84b0=_0xf9dd55,_0x4ade78={'bjHWn':function(_0x41c744,_0x2bcf62){return _0x41c744(_0x2bcf62);},'hktyM':'/api/v1/profiles'},_0x22c499=await _0x4ade78['bjHWn'](apiRequest,_0x4ade78[_0x5e84b0(0xeb)]);return _0x22c499['profiles'];}export async function deleteCloudProfile(_0xc2f6e9){const _0x40c6d5=_0xf9dd55,_0x2073f3={'CVTSx':function(_0x56aca0,_0x2cd6fc,_0x249d5f){return _0x56aca0(_0x2cd6fc,_0x249d5f);},'FAUom':function(_0x12fe95,_0x296702){return _0x12fe95(_0x296702);},'KMhRW':'DELETE','qKWKQ':function(_0x46f4ed,_0x2112ce){return _0x46f4ed instanceof _0x2112ce;},'LbjOC':function(_0x8dcd09,_0x268e14){return _0x8dcd09===_0x268e14;}};try{await _0x2073f3['CVTSx'](apiRequest,'/api/v1/profiles/'+_0x2073f3[_0x40c6d5(0xfa)](encodeURIComponent,_0xc2f6e9),{'method':_0x2073f3['KMhRW']});}catch(_0x4b08e0){if(_0x2073f3[_0x40c6d5(0x11e)](_0x4b08e0,ApiError)&&_0x2073f3['LbjOC'](_0x4b08e0[_0x40c6d5(0xce)],0x194))throw new Error('Cloud\x20profile\x20\x22'+_0xc2f6e9+_0x40c6d5(0x102));throw _0x4b08e0;}}function _0x2fb0(){const _0x43eefa=['sessionCheckPath','1611bwjRSs','rEumd','\x20\x20Created\x20cloud\x20profile\x20\x22','16457023PgfzEi','setupHeaders','rlZxg','IdpiV','5857790nqFPKd',').\x20','organizationId','sessionState','bLxXW','application/json','log','Multiple\x20envs\x20in\x20this\x20org\x27s\x20auth\x20config\x20(','klXGq','RANGER_TEST_PASSWORD','\x20failed\x20(','name','cookies','status','Gurpx','map','env','\x20\x20Cloud\x20session\x20for\x20\x22','environmentKey','stringify','CUuTT','2BuLgSs','username','string','24264CTPLLL','launch','aifJS','omVIt','not_configured','UNhsc','):\x20','JALrR','\x20\x20No\x20live\x20session\x20for\x20\x22','effectiveBaseUrl','sTHah','24924WyLGaa','HQimO','628182cQkYvS','cAHyE','\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20','bTQLe','VyjJS','hktyM','code','success','GbObl','\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','/session','save','browserOptions','507559azZrTq','RcOjw','detail','headers','error','\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.','ibAYK','FAUom','parse','REiNn','hostname','port','bYQKm','invalidateOn','KCZzC','\x22\x20not\x20found.','storageStatePath','password','POST','\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22','Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22','domains','settings','\x20\x20Login\x20successful.\x20Session\x20cached.','defaultEnvironmentKey','PUT','63SzDJHp','VEAbE','loginInstructions\x20on\x20the\x20auth\x20environment,\x20or\x20run\x20with\x20a\x20TTY.','LZZXH','PkPae','1515440XOrbMz','RANGER_TEST_USERNAME','wgkqJ','close','toISOString','length','VNBmN','Bearer\x20','EOqRP','\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22','qKWKQ','268uNhLBv','foSfT','keys','message','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','OJmLn','zXmpu','protocol','prompt','test_output','userAgent','baseUrl','twNSN','sMibB','session_state','/api/v1/profiles/','sXLpP','\x22\x20failed\x20validation\x20—\x20refreshing...','url','MxCyQ','/api/v1/profiles','some'];_0x2fb0=function(){return _0x43eefa;};return _0x2fb0();}export async function createCloudProfile(_0x3a0c7e,_0x27e985,_0x5bc296={}){const _0x3ff835=_0xf9dd55,_0x5e04e7={'sXLpP':function(_0xa26a87,_0x121011,_0x5b54a4){return _0xa26a87(_0x121011,_0x5b54a4);}},_0x3d907c={'name':_0x3a0c7e};if(_0x27e985)_0x3d907c['environment_key']=_0x27e985;_0x5bc296['settings']&&Object[_0x3ff835(0x121)](_0x5bc296['settings'])['length']>0x0&&(_0x3d907c[_0x3ff835(0x10b)]=_0x5bc296['settings']);if(_0x5bc296['username'])_0x3d907c[_0x3ff835(0xd7)]=_0x5bc296[_0x3ff835(0xd7)];if(_0x5bc296[_0x3ff835(0x104)])_0x3d907c['password']=_0x5bc296['password'];return await _0x5e04e7[_0x3ff835(0x12f)](apiRequest,_0x3ff835(0xb7),{'method':_0x3ff835(0x105),'body':JSON[_0x3ff835(0xd4)](_0x3d907c)});}export async function uploadCloudProfileSession(_0x34b1be,_0x32482b){const _0x23aa87=_0xf9dd55,_0x12b36d={'rlZxg':function(_0x336fc3,_0x401649){return _0x336fc3(_0x401649);},'WrOqy':'POST'};return await apiRequest('/api/v1/profiles/'+_0x12b36d[_0x23aa87(0xbf)](encodeURIComponent,_0x34b1be)+_0x23aa87(0xf0),{'method':_0x12b36d['WrOqy'],'body':JSON['stringify']({'session_state':_0x32482b})});}export async function saveCloudProfileCredentials(_0x4620c2,_0x589412,_0x4370cb){const _0x487a36=_0xf9dd55,_0x54319d={'RcOjw':function(_0x143132,_0x2251d3,_0x47808f){return _0x143132(_0x2251d3,_0x47808f);},'Gurpx':_0x487a36(0x10e)};await _0x54319d[_0x487a36(0xf4)](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x4620c2),{'method':_0x54319d[_0x487a36(0xcf)],'body':JSON[_0x487a36(0xd4)]({'username':_0x589412,'password':_0x4370cb})});}export async function fetchAuthConfig(){const _0x2be838=_0xf9dd55,_0x27c64b={'MxCyQ':function(_0x3eb617,_0x434810){return _0x3eb617(_0x434810);}};try{const _0x10ce39=await _0x27c64b[_0x2be838(0xb6)](apiRequest,'/api/v1/profiles/auth-config');return _0x10ce39['auth_config'];}catch{return null;}}export function pickAdHocEnvKey(_0x5785a5){const _0x5ecae7=_0xf9dd55;if(!_0x5785a5)return null;if(_0x5785a5[_0x5ecae7(0x10d)])return _0x5785a5[_0x5ecae7(0x10d)];const _0x5f55f9=Object['keys'](_0x5785a5['environments']??{});if(_0x5f55f9[_0x5ecae7(0x119)]===0x1)return _0x5f55f9[0x0];if(_0x5f55f9[_0x5ecae7(0x119)]===0x0)return null;throw new Error(_0x5ecae7(0xc8)+_0x5f55f9['join'](',\x20')+_0x5ecae7(0xc2)+'Pass\x20--env\x20<key>\x20or\x20set\x20\x27defaultEnvironmentKey\x27\x20on\x20the\x20auth\x20config.');}export async function resolveAdHocProfile(_0x543dc0=process[_0xf9dd55(0xd1)]){const _0x5ecf6b=_0xf9dd55,_0x14a975={'VyjJS':function(_0x5a1b4d,_0x33b228,_0x41c053,_0x5160e0){return _0x5a1b4d(_0x33b228,_0x41c053,_0x5160e0);},'GbObl':function(_0x5eaec9,_0x38679d){return _0x5eaec9??_0x38679d;}},_0x3f84bd=_0x543dc0['RANGER_TEST_USERNAME'];if(!_0x3f84bd)return null;const _0x507537=await fetchCloudProfile(_0x3f84bd);if(_0x507537)return{'name':_0x507537[_0x5ecf6b(0xcc)],'profile':_0x507537};const _0x4bbd30=await fetchAuthConfig(),_0x58b0b5=pickAdHocEnvKey(_0x4bbd30),_0x7a6abb=_0x543dc0[_0x5ecf6b(0xca)],_0x1a8e4b=await _0x14a975[_0x5ecf6b(0xea)](createCloudProfile,_0x3f84bd,_0x14a975[_0x5ecf6b(0xee)](_0x58b0b5,undefined),{'username':_0x3f84bd,'password':_0x7a6abb});return console['log'](_0x5ecf6b(0xbc)+_0x1a8e4b[_0x5ecf6b(0xcc)]+'\x22\x20for\x20'+_0x3f84bd),{'name':_0x1a8e4b['name'],'profile':_0x1a8e4b};}export async function writeSessionToLocalCache(_0x5bb3ea,_0x2674aa,_0x30d3ae,_0x1ce134,_0x34b887,_0x4026e8,_0x48a3c1){const _0x3c0b1e=_0xf9dd55,_0x3406c1={'vwHGc':function(_0x30a1d9,_0x55f648){return _0x30a1d9(_0x55f648);},'IdpiV':function(_0x58ef9f,_0x217fa0,_0x4df84b){return _0x58ef9f(_0x217fa0,_0x4df84b);},'sTHah':'auth'},_0x750ce6=_0x3406c1['vwHGc'](sessionCacheHash,{'orgId':_0x2674aa,'profileName':_0x5bb3ea,'effectiveBaseUrl':_0x30d3ae,'setupHeaders':_0x1ce134,'invalidateOn':_0x48a3c1?.[_0x3c0b1e(0x100)],'userAgent':_0x48a3c1?.['userAgent'],'clientIp':_0x48a3c1?.['clientIp']}),_0x4276ef=_0x3406c1[_0x3c0b1e(0xc0)](getSessionCachePath,_0x750ce6,_0x5bb3ea),_0x438668=_0x3406c1[_0x3c0b1e(0xc0)](join,getRangerHomeDir(),_0x3406c1[_0x3c0b1e(0xe3)]);!existsSync(_0x438668)&&await mkdir(_0x438668,{'recursive':!![]});const _0x1f9cfd={..._0x34b887};_0x4026e8&&_0x4026e8[_0x3c0b1e(0x119)]>0x0&&Array['isArray'](_0x1f9cfd[_0x3c0b1e(0xcd)])&&(_0x1f9cfd['cookies']=duplicateCookiesForDomains(_0x1f9cfd[_0x3c0b1e(0xcd)],_0x4026e8));const _0x340383={'cached_at':new Date()[_0x3c0b1e(0x118)](),'session_state':_0x1f9cfd};await writeFile(_0x4276ef,JSON['stringify'](_0x340383,null,0x2));const _0x18217b=getStorageStatePath(_0x4276ef);return await _0x3406c1['IdpiV'](writeFile,_0x18217b,JSON[_0x3c0b1e(0xd4)](_0x1f9cfd,null,0x2)),_0x18217b;}export async function checkLocalCache(_0x2a67ae,_0xd370cc,_0x3dc054,_0x581aff,_0x5c0933){const _0x51867f=_0xf9dd55,_0x368fc7={'cAHyE':function(_0x125027,_0xfa4ae8){return _0x125027(_0xfa4ae8);},'IpiwQ':function(_0x245d98,_0xdb9cb5,_0x23a7c8){return _0x245d98(_0xdb9cb5,_0x23a7c8);},'OKjUC':'utf-8'},_0x383979=_0x368fc7['cAHyE'](sessionCacheHash,{'orgId':_0xd370cc,'profileName':_0x2a67ae,'effectiveBaseUrl':_0x3dc054,'setupHeaders':_0x581aff,'invalidateOn':_0x5c0933?.['invalidateOn'],'userAgent':_0x5c0933?.[_0x51867f(0x129)],'clientIp':_0x5c0933?.['clientIp']}),_0x4e310a=getSessionCachePath(_0x383979,_0x2a67ae),_0x5dca34=_0x368fc7[_0x51867f(0xe7)](getStorageStatePath,_0x4e310a);if(!existsSync(_0x4e310a)||!_0x368fc7['cAHyE'](existsSync,_0x5dca34))return null;try{const _0x5ca3d5=await _0x368fc7['IpiwQ'](readFile,_0x4e310a,_0x368fc7['OKjUC']);return JSON[_0x51867f(0xfb)](_0x5ca3d5),{'storageStatePath':_0x5dca34};}catch{return null;}}function launchRealBrowser(){return chromium['launch']({'headless':!![]});}function emitSessionValidationHint(_0x4cad34,_0x5a55f0){const _0x31fe82=_0xf9dd55,_0x4d308b={'bYQKm':function(_0x126db9,_0xfa04b){return _0x126db9===_0xfa04b;},'eEgEc':'Your\x20org\x27s\x20auth-config\x20env\x20may\x20need\x20`invalidateOn:\x20[\x27port\x27]`\x20so\x20sessions\x20captured\x20on\x20one\x20port\x20aren\x27t\x20reused\x20on\x20another.','TQWvf':function(_0x468d0c,_0x30aa0f){return _0x468d0c+_0x30aa0f;}};if(!_0x5a55f0||!_0x5a55f0['domains']?.[_0x31fe82(0x119)])return;let _0x39d813;try{_0x39d813=new URL(_0x4cad34);}catch{return;}const _0x3acd2f=[];for(const _0x340448 of _0x5a55f0['domains']){try{_0x3acd2f['push']({'raw':_0x340448,'url':new URL(_0x340448)});}catch{}}if(_0x4d308b[_0x31fe82(0xff)](_0x3acd2f[_0x31fe82(0x119)],0x0))return;if(_0x3acd2f[_0x31fe82(0xb8)](_0x2ceca9=>_0x2ceca9['url']['origin']===_0x39d813['origin']))return;const _0x4ee1f1=_0x3acd2f[_0x31fe82(0xb8)](_0x5879cd=>_0x39d813[_0x31fe82(0xfd)]===_0x5879cd[_0x31fe82(0xb5)]['hostname']&&_0x39d813[_0x31fe82(0x126)]===_0x5879cd['url'][_0x31fe82(0x126)]&&_0x39d813['port']!==_0x5879cd[_0x31fe82(0xb5)][_0x31fe82(0xfe)]),_0x45d4a0=_0x4ee1f1?_0x4d308b['eEgEc']:'If\x20logins\x20keep\x20failing,\x20declare\x20`invalidateOn:\x20[\x27baseUrl\x27]`\x20on\x20your\x20org\x27s\x20auth-config\x20env\x20so\x20port/domain\x20changes\x20force\x20a\x20fresh\x20login.',_0x388077=_0x3acd2f[_0x31fe82(0xd0)](_0x13d6cb=>'\x22'+_0x13d6cb['raw']+'\x22')['join'](',\x20');console['log'](_0x4d308b['TQWvf']('\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20'+_0x388077+';\x20','you\x27re\x20now\x20at\x20\x22'+_0x4cad34+_0x31fe82(0xe8)+_0x45d4a0));}function _0x4d8d(_0xefda85,_0x42b369){_0xefda85=_0xefda85-0xb4;const _0x2fb0e7=_0x2fb0();let _0x4d8d2a=_0x2fb0e7[_0xefda85];return _0x4d8d2a;}export async function serverSideLogin(_0x52067b,_0x211245){const _0x1aa4c5=_0xf9dd55,_0x42e767={'HQimO':'POST','VEAbE':function(_0x4970f7,_0x14dd43){return _0x4970f7 instanceof _0x14dd43;},'doCht':function(_0x59b9aa,_0x335652){return _0x59b9aa===_0x335652;}},_0x435078=process[_0x1aa4c5(0xd1)][_0x1aa4c5(0x115)],_0x3d1f5d=process['env'][_0x1aa4c5(0xca)],_0x9f1576={};if(_0x435078)_0x9f1576['username']=_0x435078;if(_0x3d1f5d)_0x9f1576['password']=_0x3d1f5d;if(_0x211245?.['force'])_0x9f1576['force']=!![];try{return await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x52067b)+'/login',{'method':_0x42e767[_0x1aa4c5(0xe5)],'body':JSON[_0x1aa4c5(0xd4)](_0x9f1576)});}catch(_0x14dde5){if(_0x42e767[_0x1aa4c5(0x110)](_0x14dde5,ApiError)&&_0x14dde5['status']===0x190&&_0x42e767['doCht'](_0x14dde5[_0x1aa4c5(0xec)],_0x1aa4c5(0xdd)))return{'status':_0x1aa4c5(0xdd),'error':_0x14dde5['detail']};throw _0x14dde5;}}export async function manualBrowserLogin(_0x1b9e82,_0x3eb810){const _0x3b6e8c=_0xf9dd55,_0xb600f2={'ZIaJI':function(_0x2d7798){return _0x2d7798();},'UNhsc':'close','bTQLe':function(_0x52395c,_0x86436c){return _0x52395c+_0x86436c;},'MOlMG':'\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD,\x20configure\x20','VHyfY':_0x3b6e8c(0x111),'awBVc':'about:blank','ibAYK':function(_0x518c02,_0x543f01){return _0x518c02(_0x543f01);},'CKVqk':'Browser\x20login\x20timed\x20out\x20before\x20completion.','JDrDT':'Browser\x20closed\x20before\x20authentication\x20was\x20saved.','jSHfJ':'cli:manual-login'};if(!isInteractive())throw new Error(_0xb600f2[_0x3b6e8c(0xe9)](_0x3b6e8c(0x109)+_0x1b9e82['name']+'\x22.\x0a'+_0xb600f2['MOlMG'],_0xb600f2['VHyfY']));const _0x3b317f=_0x3eb810&&_0x3eb810['domains'][_0x3b6e8c(0x119)]>0x0?_0x3eb810['domains'][0x0]:_0xb600f2['awBVc'];console[_0x3b6e8c(0xc7)]('\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.'),console[_0x3b6e8c(0xc7)]('\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a'),await new Promise(_0x5a52ac=>setTimeout(_0x5a52ac,0x7d0));const _0x38d715=await chromium[_0x3b6e8c(0xda)]({'headless':![]});let _0x4c5020=null;try{const _0x3b8802={'ignoreHTTPSErrors':!![]};_0x3eb810?.['setupHeaders']&&(_0x3b8802['extraHTTPHeaders']=_0x3eb810['setupHeaders']);const _0x4f6573=await _0x38d715['newContext'](_0x3b8802);await _0xb600f2['ibAYK'](addProfileSetupBanner,_0x4f6573);const _0x7ca92c=await _0x4f6573['newPage']();await _0x7ca92c['goto'](_0x3b317f);let _0xfcedd7=![];await new Promise(_0x2831d4=>{const _0x49ad73=_0x3b6e8c,_0x3ff3b5={'zxhOY':function(_0x3f291f){return _0xb600f2['ZIaJI'](_0x3f291f);},'AxVoD':function(_0x2f35a5,_0x5719eb){return _0x2f35a5(_0x5719eb);}},_0xe5a2c7=setTimeout(()=>{const _0x3daa0e=_0x4d8d;_0xfcedd7=!![],console[_0x3daa0e(0xf7)]('Browser\x20login\x20timed\x20out\x20after\x20'+MANUAL_LOGIN_TIMEOUT_MS/0xea60+_0x3daa0e(0xf8)),_0x3ff3b5['zxhOY'](_0x2831d4);},MANUAL_LOGIN_TIMEOUT_MS);_0x7ca92c['on'](_0xb600f2[_0x49ad73(0xde)],async()=>{_0x3ff3b5['AxVoD'](clearTimeout,_0xe5a2c7);try{const _0x2370e6=await _0x4f6573['storageState']();_0x4c5020=_0x2370e6;}catch{}_0x3ff3b5['zxhOY'](_0x2831d4);});});if(_0xfcedd7&&!_0x4c5020)throw new Error(_0xb600f2['CKVqk']);}finally{await _0x38d715[_0x3b6e8c(0x117)]()['catch'](()=>{});}if(!_0x4c5020)throw new Error(_0xb600f2['JDrDT']);return await apiRequest('/api/v1/profiles/'+_0xb600f2[_0x3b6e8c(0xf9)](encodeURIComponent,_0x1b9e82['name'])+'/session',{'method':_0x3b6e8c(0x105),'body':JSON['stringify']({'session_state':_0x4c5020,'updated_by':_0xb600f2['jSHfJ']})}),{'sessionState':_0x4c5020};}export async function promptSaveCredentials(_0x4852ac){const _0x24c338=_0xf9dd55,_0x171597={'bLxXW':function(_0x47bf5c){return _0x47bf5c();},'foSfT':function(_0x14cc96,_0xeb7b1f){return _0x14cc96(_0xeb7b1f);},'LJnQG':'\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.'},_0x1ebed=process[_0x24c338(0xd1)][_0x24c338(0x115)],_0x3a2e6c=process[_0x24c338(0xd1)][_0x24c338(0xca)];if(!_0x1ebed||!_0x3a2e6c)return;if(!_0x171597[_0x24c338(0xc5)](isInteractive))return;const {save:_0x5c8b36}=await _0x2766e3[_0x24c338(0x127)]([{'type':'confirm','name':_0x24c338(0xf1),'message':_0x24c338(0x108),'default':![]}]);if(!_0x5c8b36)return;await apiRequest(_0x24c338(0x12e)+_0x171597[_0x24c338(0x120)](encodeURIComponent,_0x4852ac),{'method':_0x24c338(0x10e),'body':JSON[_0x24c338(0xd4)]({'username':_0x1ebed,'password':_0x3a2e6c})}),console[_0x24c338(0xc7)](_0x171597['LJnQG']);}export async function resolveCloudProfileSession(_0x164d75,_0xb67a96={}){const _0x86ccf3=_0xf9dd55,_0x32a23c={'wgkqJ':function(_0x42d3ed,_0x503aed,_0x53c8e6,_0x4e8c18,_0x12f98a){return _0x42d3ed(_0x503aed,_0x53c8e6,_0x4e8c18,_0x12f98a);},'JDlmk':function(_0x568f96,_0x30bd2e,_0x2f26e1){return _0x568f96(_0x30bd2e,_0x2f26e1);},'zXmpu':function(_0x4bd889,_0x4aacf6){return _0x4bd889(_0x4aacf6);},'mnqxl':function(_0x2de542,_0x349a8b){return _0x2de542(_0x349a8b);},'VNBmN':function(_0x3013e1,_0x342c3d){return _0x3013e1||_0x342c3d;},'sMibB':function(_0x309def,_0x5add46){return _0x309def(_0x5add46);},'twNSN':function(_0x238917,_0xbbd328){return _0x238917===_0xbbd328;},'aifJS':_0x86ccf3(0xdd),'JALrR':_0x86ccf3(0xed),'KCZzC':_0x86ccf3(0x10c),'REiNn':function(_0x554605,_0x50ab3e){return _0x554605&&_0x50ab3e;},'rEumd':'\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','JYDDv':function(_0x423188,_0x297c83){return _0x423188 instanceof _0x297c83;},'PkPae':function(_0x125dc9,_0x296c0f,_0x22f74e,_0x3989cc,_0x4104ee,_0x539b44,_0x5ab486,_0x1c1655){return _0x125dc9(_0x296c0f,_0x22f74e,_0x3989cc,_0x4104ee,_0x539b44,_0x5ab486,_0x1c1655);}},_0x1abc7a=_0x164d75['settings']??{},_0x5d61ea=await fetchAuthConfig(),_0x1a0a90=_0x5d61ea?resolveAuthEnvironmentLocally(_0x5d61ea,_0x164d75[_0x86ccf3(0xd3)]):null,_0x9154b8=_0x1a0a90?.[_0x86ccf3(0x10a)],_0x5e981a=_0x1abc7a[_0x86ccf3(0xbe)],_0x43edd6=_0x5e981a??_0x1a0a90?.[_0x86ccf3(0xbe)],_0x785488=_0xb67a96[_0x86ccf3(0xe2)]??_0x1abc7a[_0x86ccf3(0x12a)]??(_0x9154b8&&_0x9154b8['length']>0x0?_0x9154b8[0x0]:''),_0x8935fd={'invalidateOn':_0x1a0a90?.['invalidateOn'],'userAgent':_0x1a0a90?.[_0x86ccf3(0xf2)]?.[_0x86ccf3(0x129)]??_0x1abc7a['userAgent']},_0xa7a68f=await checkLocalCache(_0x164d75[_0x86ccf3(0xcc)],_0x164d75['organizationId'],_0x785488,_0x43edd6,_0x8935fd);if(_0xa7a68f){if(_0x785488){const _0x1ae8fb=await _0x32a23c['wgkqJ'](isCachedSessionLive,_0xa7a68f['storageStatePath'],_0x785488,{'sessionCheckPath':_0x1a0a90?.[_0x86ccf3(0xb9)],'setupHeaders':_0x43edd6},{'launchBrowser':launchRealBrowser});if(_0x1ae8fb)return console['log'](_0x86ccf3(0x107)+_0x164d75['name']+'\x22'),{'authPath':_0xa7a68f[_0x86ccf3(0x103)],'settings':_0x1abc7a,'resolvedEnv':_0x1a0a90};console[_0x86ccf3(0xc7)]('\x20\x20Cached\x20session\x20for\x20\x22'+_0x164d75['name']+_0x86ccf3(0xb4)),_0x32a23c['JDlmk'](emitSessionValidationHint,_0x785488,_0x1a0a90);}else return{'authPath':_0xa7a68f[_0x86ccf3(0x103)],'settings':_0x1abc7a,'resolvedEnv':_0x1a0a90};}if(_0x164d75[_0x86ccf3(0xc4)]){const _0x3efe3d=await writeSessionToLocalCache(_0x164d75[_0x86ccf3(0xcc)],_0x164d75[_0x86ccf3(0xc3)],_0x785488,_0x43edd6,_0x164d75[_0x86ccf3(0xc4)],_0x9154b8,_0x8935fd);if(_0x785488){const _0x4b956c=await _0x32a23c[_0x86ccf3(0x116)](isCachedSessionLive,_0x3efe3d,_0x785488,{'sessionCheckPath':_0x1a0a90?.[_0x86ccf3(0xb9)],'setupHeaders':_0x43edd6},{'launchBrowser':launchRealBrowser});if(_0x4b956c)return console['log'](_0x86ccf3(0x11d)+_0x164d75[_0x86ccf3(0xcc)]+'\x22,\x20cached\x20locally'),{'authPath':_0x3efe3d,'settings':_0x1abc7a,'resolvedEnv':_0x1a0a90};console[_0x86ccf3(0xc7)](_0x86ccf3(0xd2)+_0x164d75[_0x86ccf3(0xcc)]+'\x22\x20failed\x20validation\x20—\x20re-login\x20needed...'),emitSessionValidationHint(_0x785488,_0x1a0a90);}else return{'authPath':_0x3efe3d,'settings':_0x1abc7a,'resolvedEnv':_0x1a0a90};}console[_0x86ccf3(0xc7)](_0x86ccf3(0xe1)+_0x164d75['name']+'\x22,\x20attempting\x20login...');const _0x5783e7=_0x32a23c[_0x86ccf3(0x125)](Boolean,process[_0x86ccf3(0xd1)][_0x86ccf3(0x115)])&&_0x32a23c['mnqxl'](Boolean,process['env'][_0x86ccf3(0xca)]),_0x5da931=_0x32a23c['zXmpu'](Boolean,_0x164d75[_0x86ccf3(0xd7)]);if(_0x32a23c[_0x86ccf3(0x11a)](_0x5783e7,_0x5da931))try{const _0x6aa188=await _0x32a23c[_0x86ccf3(0x12c)](serverSideLogin,_0x164d75[_0x86ccf3(0xcc)]);if(_0x32a23c['twNSN'](_0x6aa188[_0x86ccf3(0xce)],_0x32a23c[_0x86ccf3(0xdb)]))console['log'](_0x86ccf3(0xef));else{if(_0x32a23c[_0x86ccf3(0x12b)](_0x6aa188[_0x86ccf3(0xce)],_0x32a23c[_0x86ccf3(0xe0)])&&_0x6aa188[_0x86ccf3(0x12d)]){console[_0x86ccf3(0xc7)](_0x32a23c[_0x86ccf3(0x101)]);const _0x45ec1c=await writeSessionToLocalCache(_0x164d75[_0x86ccf3(0xcc)],_0x164d75[_0x86ccf3(0xc3)],_0x785488,_0x43edd6,_0x6aa188[_0x86ccf3(0x12d)],_0x9154b8,_0x8935fd);return _0x32a23c[_0x86ccf3(0xfc)](_0x5783e7,!_0x5da931)&&await _0x32a23c[_0x86ccf3(0x125)](promptSaveCredentials,_0x164d75[_0x86ccf3(0xcc)]),{'authPath':_0x45ec1c,'settings':_0x1abc7a,'resolvedEnv':_0x1a0a90};}else _0x6aa188[_0x86ccf3(0x128)]&&(console[_0x86ccf3(0xc7)](_0x86ccf3(0x106)),console['log'](_0x6aa188['test_output'])),console[_0x86ccf3(0xc7)](_0x32a23c[_0x86ccf3(0xbb)]);}}catch(_0x547db7){console['log']('\x20\x20Server-side\x20login\x20error:\x20'+(_0x32a23c['JYDDv'](_0x547db7,Error)?_0x547db7[_0x86ccf3(0x122)]:String(_0x547db7))),console[_0x86ccf3(0xc7)]('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}const {sessionState:_0x27d799}=await manualBrowserLogin(_0x164d75,_0x1a0a90),_0x5e161c=await _0x32a23c[_0x86ccf3(0x113)](writeSessionToLocalCache,_0x164d75[_0x86ccf3(0xcc)],_0x164d75[_0x86ccf3(0xc3)],_0x785488,_0x43edd6,_0x27d799,_0x9154b8,_0x8935fd);return{'authPath':_0x5e161c,'settings':_0x1abc7a,'resolvedEnv':_0x1a0a90};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x129674=_0x4c36;(function(_0x1ac808,_0x77ae33){const _0x3fed7c=_0x4c36,_0xe269f3=_0x1ac808();while(!![]){try{const _0x80f30b=-parseInt(_0x3fed7c(0x95))/0x1*(parseInt(_0x3fed7c(0x96))/0x2)+-parseInt(_0x3fed7c(0x71))/0x3+parseInt(_0x3fed7c(0x86))/0x4*(parseInt(_0x3fed7c(0xa2))/0x5)+parseInt(_0x3fed7c(0x72))/0x6*(-parseInt(_0x3fed7c(0xa6))/0x7)+parseInt(_0x3fed7c(0x9e))/0x8*(-parseInt(_0x3fed7c(0x9a))/0x9)+-parseInt(_0x3fed7c(0x7a))/0xa*(-parseInt(_0x3fed7c(0x75))/0xb)+-parseInt(_0x3fed7c(0x9b))/0xc*(-parseInt(_0x3fed7c(0x8d))/0xd);if(_0x80f30b===_0x77ae33)break;else _0xe269f3['push'](_0xe269f3['shift']());}catch(_0x1e0f64){_0xe269f3['push'](_0xe269f3['shift']());}}}(_0x40b2,0x36951));import{createHash}from'crypto';function _0x40b2(){const _0x1349fa=['pCQkO','295999wjxzdD','auth','NdBLR','sha256','effectiveBaseUrl','70WcYllK','.json','orgId','invalidateOn','setupHeaders','endsWith','env','.localhost','isTTY','close','profileName','127.0.0.1','16712BkzCFk','keys','map','environments','eElNG','baseUrl','.storageState.json','3444194rNAFfp','slice','qtQcS','test','port','userAgent','stdout','mviLS','265lEcJHi','2552fvzcGg','goto','ywupp','domain','474597EibnOe','36mOXfcM','clientIp','defaultEnvironmentKey','24KzYNIC','newContext','localhost','stdin','210zgbyZx','has','url','toString','2709gzgsDX','936588nSwJuG','1962RWKgkh','YyCwE'];_0x40b2=function(){return _0x1349fa;};return _0x40b2();}import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x173438=process[_0x129674(0x80)],_0x88a2d9={'stdin':process['stdin'],'stdout':process['stdout']}){const _0x2b346d=_0x129674,_0x2276b5={'eElNG':function(_0x28ac33,_0x57c9be){return _0x28ac33(_0x57c9be);}};if(_0x173438['CI'])return![];return _0x2276b5[_0x2b346d(0x8a)](Boolean,_0x88a2d9[_0x2b346d(0xa1)]['isTTY'])&&_0x2276b5[_0x2b346d(0x8a)](Boolean,_0x88a2d9[_0x2b346d(0x93)][_0x2b346d(0x82)]);}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x450f79){const _0x3abfd1=_0x129674,_0x3877ab={'ANXJc':_0x3abfd1(0x8b),'WGKXh':_0x3abfd1(0x91),'mviLS':function(_0xea80e1,_0xe8243a){return _0xea80e1(_0xe8243a);},'pCQkO':'userAgent','ywupp':function(_0x1e65cc,_0x4394a2){return _0x1e65cc!==_0x4394a2;},'mZtYx':_0x3abfd1(0x9c)},_0x2041da=new Set(_0x450f79[_0x3abfd1(0x7d)]??DEFAULT_INVALIDATE_ON),_0x49ff88={'orgId':_0x450f79[_0x3abfd1(0x7c)],'profileName':_0x450f79[_0x3abfd1(0x84)]};return _0x2041da['has'](_0x3877ab['ANXJc'])&&(_0x49ff88[_0x3abfd1(0x79)]=_0x450f79['effectiveBaseUrl']),_0x2041da[_0x3abfd1(0xa3)]('setupHeaders')&&(_0x49ff88[_0x3abfd1(0x7e)]=_0x450f79[_0x3abfd1(0x7e)]?sortObjectKeys(_0x450f79['setupHeaders']):_0x450f79['setupHeaders']),_0x2041da[_0x3abfd1(0xa3)](_0x3877ab['WGKXh'])&&(_0x49ff88[_0x3abfd1(0x91)]=_0x3877ab[_0x3abfd1(0x94)](extractPort,_0x450f79['effectiveBaseUrl'])),_0x2041da['has'](_0x3877ab[_0x3abfd1(0x74)])&&_0x3877ab[_0x3abfd1(0x98)](_0x450f79[_0x3abfd1(0x92)],undefined)&&(_0x49ff88['userAgent']=_0x450f79[_0x3abfd1(0x92)]),_0x2041da['has'](_0x3877ab['mZtYx'])&&_0x450f79[_0x3abfd1(0x9c)]!==undefined&&(_0x49ff88[_0x3abfd1(0x9c)]=_0x450f79[_0x3abfd1(0x9c)]),_0x3877ab[_0x3abfd1(0x94)](createHash,_0x3abfd1(0x78))['update'](JSON['stringify'](_0x49ff88))['digest']('hex')[_0x3abfd1(0x8e)](0x0,0xc);}function extractPort(_0xe57887){try{return new URL(_0xe57887)['port'];}catch{return'';}}function sortObjectKeys(_0x3df599){const _0x348ed0=_0x129674,_0x2692ce={};for(const _0x5d815e of Object[_0x348ed0(0x87)](_0x3df599)['sort']()){_0x2692ce[_0x5d815e]=_0x3df599[_0x5d815e];}return _0x2692ce;}export function getSessionCachePath(_0x44965b,_0x14c6ad){const _0x2fcb49=_0x129674,_0x1b5470={'mWDwa':_0x2fcb49(0x76)};return join(getRangerHomeDir(),_0x1b5470['mWDwa'],_0x44965b+'-'+_0x14c6ad+_0x2fcb49(0x7b));}function _0x4c36(_0x3d7ef4,_0x445435){_0x3d7ef4=_0x3d7ef4-0x71;const _0x40b243=_0x40b2();let _0x4c3686=_0x40b243[_0x3d7ef4];return _0x4c3686;}export function getStorageStatePath(_0x5d684b){const _0x3dc900=_0x129674;return _0x5d684b['replace'](/\.json$/,_0x3dc900(0x8c));}export function needsTunnel(_0x43d3a4){const _0x423ecf=_0x129674,_0x4ca0c9={'NdBLR':function(_0x500023,_0x2c165c){return _0x500023===_0x2c165c;},'qtQcS':_0x423ecf(0xa0),'YyCwE':function(_0x31468a,_0x55b290){return _0x31468a===_0x55b290;}};let _0x5f350c;try{_0x5f350c=new URL(_0x43d3a4)['hostname'];}catch{return![];}if(_0x4ca0c9[_0x423ecf(0x77)](_0x5f350c,_0x4ca0c9[_0x423ecf(0x8f)])||_0x4ca0c9[_0x423ecf(0x73)](_0x5f350c,_0x423ecf(0x85)))return!![];if(_0x5f350c[_0x423ecf(0x7f)](_0x423ecf(0x81)))return!![];if(_0x5f350c['includes']('localhost.'))return!![];return![];}export function hostnameOf(_0xbaf07b){return new URL(_0xbaf07b)['hostname'];}export function duplicateCookiesForDomains(_0x1f18db,_0xfe21ff){const _0xef398e=_0x129674,_0x507076=[..._0x1f18db],_0x32d53d=new Set(_0x1f18db[_0xef398e(0x88)](_0x359b7c=>_0x359b7c[_0xef398e(0x99)]));for(const _0x3a2c04 of _0xfe21ff){let _0x1ee8a6;try{_0x1ee8a6=hostnameOf(_0x3a2c04);}catch{continue;}if(!_0x1ee8a6)continue;const _0x208ab5=_0x1ee8a6['startsWith']('.')?_0x1ee8a6:'.'+_0x1ee8a6;if(_0x32d53d[_0xef398e(0xa3)](_0x1ee8a6)||_0x32d53d[_0xef398e(0xa3)](_0x208ab5))continue;for(const _0x338a9a of _0x1f18db){_0x507076['push']({..._0x338a9a,'domain':_0x208ab5});}_0x32d53d['add'](_0x208ab5);}return _0x507076;}export function resolveAuthEnvironmentLocally(_0x3e2db6,_0x3669ed){const _0x5ad00f=_0x129674,_0xc62fb3=_0x3e2db6[_0x5ad00f(0x89)];if(_0x3669ed){const _0x52b0fb=_0xc62fb3[_0x3669ed];if(!_0x52b0fb)return null;return{'key':_0x3669ed,..._0x52b0fb};}if(_0x3e2db6[_0x5ad00f(0x9d)]){const _0x189360=_0xc62fb3[_0x3e2db6['defaultEnvironmentKey']];if(!_0x189360)return null;return{'key':_0x3e2db6[_0x5ad00f(0x9d)],..._0x189360};}const _0x313184=Object['keys'](_0xc62fb3);if(_0x313184['length']===0x1){const _0x4fc840=_0x313184[0x0];return{'key':_0x4fc840,..._0xc62fb3[_0x4fc840]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0xf428e8,_0x530763){const _0x4310dd=_0x129674;try{if(_0x530763)return new URL(_0x530763,_0xf428e8)['toString']();return new URL(_0xf428e8)[_0x4310dd(0xa5)]();}catch{return null;}}export function looksLikeLoginUrl(_0x23d751){const _0x41636c=_0x129674;try{const _0x4dcf68=new URL(_0x23d751);return LOGIN_URL_PATTERN[_0x41636c(0x90)](_0x4dcf68['pathname']);}catch{return LOGIN_URL_PATTERN['test'](_0x23d751);}}export async function isCachedSessionLive(_0x27a385,_0x4ec74f,_0x5e85f2={},_0x8f1e0c={}){const _0x5a7de7=_0x129674,_0xa743b5={'OhIhz':function(_0x49c6c1,_0xa01adf,_0x2780f8){return _0x49c6c1(_0xa01adf,_0x2780f8);},'xufIF':'domcontentloaded','wtqmf':function(_0x52df18,_0x228dfa){return _0x52df18===_0x228dfa;}},_0x211917=_0xa743b5['OhIhz'](buildSessionCheckUrl,_0x4ec74f,_0x5e85f2['sessionCheckPath']);if(!_0x211917)return!![];if(!_0x8f1e0c['launchBrowser'])return!![];let _0x33e65d=null;try{_0x33e65d=await _0x8f1e0c['launchBrowser']();const _0x2ddd60=await _0x33e65d[_0x5a7de7(0x9f)]({'storageState':_0x27a385,'ignoreHTTPSErrors':!![],..._0x5e85f2[_0x5a7de7(0x7e)]?{'extraHTTPHeaders':_0x5e85f2['setupHeaders']}:{}}),_0x105e3b=await _0x2ddd60['newPage'](),_0x4c2a00=await _0x105e3b[_0x5a7de7(0x97)](_0x211917,{'waitUntil':_0xa743b5['xufIF'],'timeout':0x3a98}),_0x56f1ae=_0x4c2a00?.['status']();if(_0xa743b5['wtqmf'](_0x56f1ae,0x191)||_0x56f1ae===0x193)return![];const _0x5a2508=_0x105e3b[_0x5a7de7(0xa4)]();if(looksLikeLoginUrl(_0x5a2508))return![];return!![];}catch{return![];}finally{if(_0x33e65d)await _0x33e65d[_0x5a7de7(0x83)]()['catch'](()=>{});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4e3bbf,_0x2d0e9c){const _0x2b9014=_0x4bf3,_0x5711cd=_0x4e3bbf();while(!![]){try{const _0x12d375=parseInt(_0x2b9014(0x18f))/0x1*(parseInt(_0x2b9014(0x18e))/0x2)+-parseInt(_0x2b9014(0x197))/0x3+-parseInt(_0x2b9014(0x192))/0x4*(parseInt(_0x2b9014(0x18d))/0x5)+parseInt(_0x2b9014(0x196))/0x6*(parseInt(_0x2b9014(0x193))/0x7)+parseInt(_0x2b9014(0x18b))/0x8+-parseInt(_0x2b9014(0x198))/0x9+parseInt(_0x2b9014(0x18c))/0xa;if(_0x12d375===_0x2d0e9c)break;else _0x5711cd['push'](_0x5711cd['shift']());}catch(_0x250206){_0x5711cd['push'](_0x5711cd['shift']());}}}(_0x279e,0x864e7));import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';function _0x279e(){const _0x493d37=['subarray','48VbqeYN','7KKekik','FJLFj','utf8','1745778Nwucqq','3036717dxSmAo','4574394nyJPuS','update','concat','KwbkY','7582280yxXGZZ','1674260bXYyFa','56850uIKxYf','5660XgtdpA','283bKlHoQ','sha256'];_0x279e=function(){return _0x493d37;};return _0x279e();}function _0x4bf3(_0x2c114a,_0x572e28){_0x2c114a=_0x2c114a-0x188;const _0x279e84=_0x279e();let _0x4bf3ea=_0x279e84[_0x2c114a];return _0x4bf3ea;}const ALGORITHM='aes-256-gcm',SALT='ranger-auth-encryption',KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;export function deriveKey(_0x5fd6c1){const _0x1e2d41=_0x4bf3;return pbkdf2Sync(_0x5fd6c1,SALT,0x186a0,KEY_LENGTH,_0x1e2d41(0x190));}export function encrypt(_0x8c759d,_0x2a4fbe){const _0x22eead=_0x4bf3,_0xc11b7={'KLvcI':function(_0x4f06b6,_0xb37cca){return _0x4f06b6(_0xb37cca);}},_0x5b060c=deriveKey(_0x2a4fbe),_0x4753c2=_0xc11b7['KLvcI'](randomBytes,IV_LENGTH),_0x14f857=createCipheriv(ALGORITHM,_0x5b060c,_0x4753c2),_0x2a8e89=Buffer[_0x22eead(0x189)]([_0x14f857[_0x22eead(0x188)](_0x8c759d,_0x22eead(0x195)),_0x14f857['final']()]),_0x2c4579=_0x14f857['getAuthTag']();return Buffer[_0x22eead(0x189)]([_0x4753c2,_0x2c4579,_0x2a8e89]);}export function decrypt(_0x9fa42f,_0x382c62){const _0x2d7a30=_0x4bf3,_0x216a6a={'FJLFj':function(_0x2c571d,_0x56aacd){return _0x2c571d(_0x56aacd);},'beflj':function(_0x3792f2,_0x1fabee){return _0x3792f2+_0x1fabee;},'KwbkY':'utf8'},_0x348fc0=_0x216a6a[_0x2d7a30(0x194)](deriveKey,_0x382c62),_0x2c6347=_0x9fa42f['subarray'](0x0,IV_LENGTH),_0x2ba95b=_0x9fa42f[_0x2d7a30(0x191)](IV_LENGTH,IV_LENGTH+TAG_LENGTH),_0x230d2b=_0x9fa42f['subarray'](_0x216a6a['beflj'](IV_LENGTH,TAG_LENGTH)),_0x2725d9=createDecipheriv(ALGORITHM,_0x348fc0,_0x2c6347);return _0x2725d9['setAuthTag'](_0x2ba95b),_0x2725d9[_0x2d7a30(0x188)](_0x230d2b)+_0x2725d9['final'](_0x216a6a[_0x2d7a30(0x18a)]);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x5169ae=_0x4615;(function(_0x1fb8cd,_0x32fcf8){const _0x5f138c=_0x4615,_0x5b071a=_0x1fb8cd();while(!![]){try{const _0x56e379=-parseInt(_0x5f138c(0x17c))/0x1+-parseInt(_0x5f138c(0x192))/0x2+-parseInt(_0x5f138c(0x17d))/0x3*(parseInt(_0x5f138c(0x181))/0x4)+parseInt(_0x5f138c(0x17f))/0x5+parseInt(_0x5f138c(0x18b))/0x6*(parseInt(_0x5f138c(0x195))/0x7)+parseInt(_0x5f138c(0x188))/0x8+parseInt(_0x5f138c(0x178))/0x9*(parseInt(_0x5f138c(0x18c))/0xa);if(_0x56e379===_0x32fcf8)break;else _0x5b071a['push'](_0x5b071a['shift']());}catch(_0x548eec){_0x5b071a['push'](_0x5b071a['shift']());}}}(_0x27b4,0x9ee76));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set(['--token','-t','--secret','--api-key','--apikey',_0x5169ae(0x171),'--password','--pass',_0x5169ae(0x176),'--authorization','--header',_0x5169ae(0x18d),_0x5169ae(0x185)]),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0x3e7f55){return TOKEN_PATTERNS['some'](_0x4f8fd1=>_0x4f8fd1['test'](_0x3e7f55));}export function sanitizeArgs(_0x130bc3){const _0x493963=_0x5169ae,_0x335e2e={'cYSCR':function(_0x5d676f,_0x44cbed){return _0x5d676f(_0x44cbed);},'GxJoH':_0x493963(0x180)},_0x2a6e38=[];let _0x48d6c1=![];for(let _0xb5ad9b=0x0;_0xb5ad9b<_0x130bc3['length'];_0xb5ad9b++){const _0x4b0b1b=_0x130bc3[_0xb5ad9b];if(_0x48d6c1){_0x2a6e38['push'](_0x493963(0x180)),_0x48d6c1=![];continue;}if(_0x4b0b1b[_0x493963(0x182)]('--')||_0x4b0b1b[_0x493963(0x182)]('-')){const _0x490adb=_0x4b0b1b['indexOf']('=');if(_0x490adb!==-0x1){const _0x21fef0=_0x4b0b1b[_0x493963(0x16d)](0x0,_0x490adb)['toLowerCase']();if(SENSITIVE_FLAGS[_0x493963(0x17b)](_0x21fef0)){_0x2a6e38[_0x493963(0x175)](_0x4b0b1b[_0x493963(0x16d)](0x0,_0x490adb)+_0x493963(0x177));continue;}}else{const _0x5779dc=_0x4b0b1b['toLowerCase']();SENSITIVE_FLAGS['has'](_0x5779dc)&&(_0x48d6c1=!![]);}_0x2a6e38[_0x493963(0x175)](_0x4b0b1b);}else _0x335e2e['cYSCR'](looksLikeToken,_0x4b0b1b)?_0x2a6e38['push'](_0x335e2e['GxJoH']):_0x2a6e38[_0x493963(0x175)](_0x4b0b1b);}return _0x2a6e38['join']('\x20');}export async function logDesirePath(_0x16526e){const _0x12080d=_0x5169ae,_0x5f3e75={'AUpfm':function(_0x57440a){return _0x57440a();},'bkSDD':_0x12080d(0x17a),'ypDmf':function(_0x30221f,_0x5c36ee,_0x372e64){return _0x30221f(_0x5c36ee,_0x372e64);},'Lbwpm':'POST'};try{const _0x56c66a=await _0x5f3e75[_0x12080d(0x191)](getToken)['catch'](()=>null),_0x1100d0=getApiBaseUrl(),_0x4ba222=_0x5f3e75['AUpfm'](getCurrentVersion),_0x3ab984=_0x56c66a?'has_token':'no_token',_0x132a89={..._0x16526e[_0x12080d(0x174)],'authStatus':_0x3ab984,'isTty':process['stdout']['isTTY']??![]},_0x1d2eb8={'Content-Type':_0x12080d(0x187)};_0x56c66a&&(_0x1d2eb8[_0x5f3e75['bkSDD']]='Bearer\x20'+_0x56c66a);const _0xcce420={'rawCommand':_0x16526e['rawCommand'],'errorMessage':_0x16526e['errorMessage'],'errorType':_0x16526e['errorType'],'featureId':_0x16526e[_0x12080d(0x18e)],'sessionId':_0x16526e['sessionId'],'metadata':_0x132a89,'cliVersion':_0x4ba222};process['env'][_0x12080d(0x184)]&&(console[_0x12080d(0x170)](_0x12080d(0x172)+_0x1100d0+'/api/v1/mcp/desire-path-logs'),console['error'](_0x12080d(0x183)+JSON['stringify'](_0xcce420,null,0x2))),await _0x5f3e75['ypDmf'](fetch,_0x1100d0+'/api/v1/mcp/desire-path-logs',{'method':_0x5f3e75['Lbwpm'],'headers':_0x1d2eb8,'body':JSON['stringify'](_0xcce420)});}catch(_0x4f71b4){process[_0x12080d(0x18a)]['DEBUG']&&console[_0x12080d(0x170)]('[desire-path]\x20Failed\x20to\x20send:\x20'+_0x4f71b4);}}function _0x4615(_0x9ae057,_0x4ed6e1){_0x9ae057=_0x9ae057-0x16d;const _0x27b471=_0x27b4();let _0x46151f=_0x27b471[_0x9ae057];return _0x46151f;}export function getErrorType(_0x11221c,_0xc39e1c){const _0x1976bf=_0x5169ae,_0x3b325b={'vnFSZ':_0x1976bf(0x16f),'uIJhU':_0x1976bf(0x186),'rUFZi':'unknown_command','dCdhJ':'Unknown\x20argument','EAqxR':_0x1976bf(0x18f),'lggWw':'Missing\x20required\x20argument','XqDKP':_0x1976bf(0x17e)};if(_0xc39e1c)return _0x3b325b[_0x1976bf(0x190)];if(!_0x11221c)return _0x3b325b['uIJhU'];if(_0x11221c['includes']('Unknown\x20command'))return _0x3b325b['rUFZi'];if(_0x11221c['includes'](_0x3b325b['dCdhJ']))return _0x1976bf(0x189);if(_0x11221c['includes'](_0x3b325b[_0x1976bf(0x194)]))return'missing_required_argument';if(_0x11221c[_0x1976bf(0x16e)](_0x1976bf(0x193)))return'invalid_option_value';if(_0x11221c[_0x1976bf(0x16e)](_0x3b325b[_0x1976bf(0x173)]))return'missing_option';return _0x3b325b[_0x1976bf(0x179)];}function _0x27b4(){const _0x46638d=['--cookie','featureId','Not\x20enough\x20non-option\x20arguments','vnFSZ','AUpfm','2480484mlZYhO','Invalid\x20values','EAqxR','7jHaMnm','slice','includes','runtime_error','error','--key','[desire-path]\x20Sending\x20log\x20to\x20','lggWw','metadata','push','--auth','=[REDACTED]','63ktOEsT','XqDKP','Authorization','has','811225nqtwmZ','28626OeZYpu','syntax_error','2172500QqJfRh','[REDACTED]','496xgIxzh','startsWith','[desire-path]\x20Payload:\x20','DEBUG','--credentials','unknown','application/json','3026504TjvkVB','unknown_argument','env','2273910JECGWR','3848210yEgSLC'];_0x27b4=function(){return _0x46638d;};return _0x27b4();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x1b8aea=_0x1729;(function(_0x5d8bde,_0x2e1005){const _0x1f9361=_0x1729,_0x49bd2f=_0x5d8bde();while(!![]){try{const _0x126523=parseInt(_0x1f9361(0x105))/0x1*(parseInt(_0x1f9361(0x102))/0x2)+parseInt(_0x1f9361(0x10d))/0x3+-parseInt(_0x1f9361(0xe3))/0x4+parseInt(_0x1f9361(0x106))/0x5*(parseInt(_0x1f9361(0xea))/0x6)+-parseInt(_0x1f9361(0x11e))/0x7*(parseInt(_0x1f9361(0x112))/0x8)+-parseInt(_0x1f9361(0xd7))/0x9+-parseInt(_0x1f9361(0x11b))/0xa*(parseInt(_0x1f9361(0x103))/0xb);if(_0x126523===_0x2e1005)break;else _0x49bd2f['push'](_0x49bd2f['shift']());}catch(_0x171d32){_0x49bd2f['push'](_0x49bd2f['shift']());}}}(_0x19df,0x8da42));import{spawn}from'child_process';import _0x1e2782 from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';function _0x19df(){const _0x20bdb5=['prompt','gtOAi','stdout','Failed\x20to\x20refresh\x20token\x20with\x20org:\x20','12SBzomx','text','qYJwA','verification_uri_complete','access_token','split','Code:\x20','Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','mcp:write','workosClientId','ignore','selected','toString','from','filter','CLI\x20Key','application/json','application/x-www-form-urlencoded','isTTY','platform','https://api.workos.com/user_management/authenticate','device_code','HZpVR','cmd','1678YIaSnK','1375SxtXdD','fHhYT','223oepeys','1502405LxQakI','POST','PwHsq','WuSen','now','\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','token','3389985JHwEKT','yktRb','Failed\x20to\x20request\x20device\x20code:\x20','refresh_token','parse','456296XXwcGe','FUZVo','/organization/self-serve-signup','error','qmCtV','\x27s\x20CLI\x20Key','GET','utf-8','wsSYP','44190kggbVa','bBVDX','startsWith','7wJLQzZ','KxHMj','write','sAerw','Provisioning\x20CLI\x20token...','YHBeR','RfLJt','expires_in','6175125MbPAZU','IcyEf','\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','length','BGLfm','json','xdg-open','status','ekvsc','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','log','organizationId','169420WgwLJr','vcQNm','/organization/my-memberships'];_0x19df=function(){return _0x20bdb5;};return _0x19df();}const WORKOS_DEVICE_AUTH_URL='https://api.workos.com/user_management/authorize/device',WORKOS_TOKEN_URL=_0x1b8aea(0xfe);export async function requestDeviceCode(_0x2c5479){const _0x238065=_0x1b8aea,_0x45e13a=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x238065(0x107),'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0x2c5479})});if(!_0x45e13a['ok']){const _0x569da9=await _0x45e13a[_0x238065(0xeb)]();throw new Error(_0x238065(0x10f)+_0x45e13a['status']+'\x20'+_0x569da9);}return _0x45e13a['json']();}export async function pollForTokens(_0x3eb055,_0x139a5e,_0x46cc1d,_0x57b352){const _0x20c2cc=_0x1b8aea,_0x5be910={'zHBWF':function(_0x295a12,_0x2b49bc){return _0x295a12+_0x2b49bc;},'fHhYT':function(_0x41487b,_0x1271e4){return _0x41487b*_0x1271e4;},'KxHMj':function(_0x1fb2e0,_0x51693e,_0x16fb19){return _0x1fb2e0(_0x51693e,_0x16fb19);},'sAerw':'urn:ietf:params:oauth:grant-type:device_code','FUZVo':'authorization_pending','dCYxN':'slow_down','ogMYu':'Authentication\x20failed','yktRb':'Device\x20authorization\x20timed\x20out'},_0x479382=_0x5be910['zHBWF'](Date['now'](),_0x5be910[_0x20c2cc(0x104)](_0x57b352,0x3e8));let _0x9fbec3=_0x46cc1d*0x3e8;while(Date[_0x20c2cc(0x10a)]()<_0x479382){await sleep(_0x9fbec3);const _0x49a04c=await _0x5be910[_0x20c2cc(0x11f)](fetch,WORKOS_TOKEN_URL,{'method':_0x20c2cc(0x107),'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0x3eb055,'device_code':_0x139a5e,'grant_type':_0x5be910[_0x20c2cc(0x121)]})});if(_0x49a04c['ok'])return _0x49a04c['json']();const _0x17e9a0=await _0x49a04c[_0x20c2cc(0xdc)]();if(_0x17e9a0[_0x20c2cc(0x115)]===_0x5be910[_0x20c2cc(0x113)])continue;if(_0x17e9a0['error']===_0x5be910['dCYxN']){_0x9fbec3+=0x3e8;continue;}throw new Error(_0x17e9a0['error_description']||_0x17e9a0[_0x20c2cc(0x115)]||_0x5be910['ogMYu']);}throw new Error(_0x5be910[_0x20c2cc(0x10e)]);}function _0x1729(_0x2a2606,_0x4c0730){_0x2a2606=_0x2a2606-0xd7;const _0x19dfbf=_0x19df();let _0x17294a=_0x19dfbf[_0x2a2606];return _0x17294a;}async function fetchUserProfile(_0x4087c5){const _0x16519c=_0x1b8aea,_0x3199eb=getApiBaseUrl();try{const _0x4fdeef=await fetch(_0x3199eb+'/organization/me',{'method':'GET','headers':{'workos-token':_0x4087c5}});if(_0x4fdeef['ok'])return _0x4fdeef[_0x16519c(0xdc)]();}catch{}return null;}function buildKeyName(_0x4b2bf4,_0x5c7d3e){const _0x44cd12=_0x1b8aea,_0x337da1={'greyI':function(_0x20975,_0x10a229){return _0x20975+_0x10a229;}},_0x2c4273=_0x5c7d3e[_0x44cd12(0xf8)](_0x27b6a1=>_0x27b6a1['name']===_0x4b2bf4||_0x27b6a1['name'][_0x44cd12(0x11d)](_0x4b2bf4+'\x20('));if(_0x2c4273[_0x44cd12(0xda)]===0x0)return _0x4b2bf4;return _0x4b2bf4+'\x20('+_0x337da1['greyI'](_0x2c4273['length'],0x1)+')';}export async function provisionApiKey(_0x2aa59a){const _0x33e866=_0x1b8aea,_0x51db7b={'bEKlo':function(_0x2e5f61){return _0x2e5f61();},'rUIPk':_0x33e866(0xfa),'RfLJt':function(_0x125cd4,_0x188b1b){return _0x125cd4(_0x188b1b);},'ekvsc':function(_0x53abfd,_0x2752f0,_0x2e2fb6){return _0x53abfd(_0x2752f0,_0x2e2fb6);},'qYJwA':_0x33e866(0x118),'sGbQx':'POST','GMOrw':_0x33e866(0xf2)},_0x41fb74=_0x51db7b['bEKlo'](getApiBaseUrl),_0x1f31e0={'Content-Type':_0x51db7b['rUIPk'],'workos-token':_0x2aa59a},_0x2817c5=await _0x51db7b[_0x33e866(0x124)](fetchUserProfile,_0x2aa59a),_0x976f45=_0x2817c5?.['firstName']||_0x2817c5?.['email']?.['split']('@')[0x0],_0x280082=_0x976f45?_0x976f45+_0x33e866(0x117):_0x33e866(0xf9);let _0x3ae426=[];try{const _0x12bf83=await _0x51db7b[_0x33e866(0xdf)](fetch,_0x41fb74+'/api-keys',{'method':_0x51db7b[_0x33e866(0xec)],'headers':_0x1f31e0});if(_0x12bf83['ok']){const _0x4fb6b7=await _0x12bf83[_0x33e866(0xdc)]();_0x3ae426=_0x4fb6b7['apiKeys'];}}catch{}const _0x42a615=buildKeyName(_0x280082,_0x3ae426),_0x55a113=await fetch(_0x41fb74+'/api-keys',{'method':_0x51db7b['sGbQx'],'headers':_0x1f31e0,'body':JSON['stringify']({'name':_0x42a615,'scope':_0x51db7b['GMOrw']})});if(!_0x55a113['ok']){const _0x5c8504=await _0x55a113[_0x33e866(0xeb)]();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0x55a113['status']+'\x20'+_0x5c8504);}const _0x99b6eb=await _0x55a113[_0x33e866(0xdc)]();return _0x99b6eb['apiKey']['token'];}export function openBrowser(_0xf0bb70){const _0x2c87bc=_0x1b8aea,_0x1dde69={'PwHsq':function(_0x15d879,_0xdc275f){return _0x15d879===_0xdc275f;},'EPvDU':function(_0x51535d,_0x2e552e,_0x2867bb,_0x35f9bf){return _0x51535d(_0x2e552e,_0x2867bb,_0x35f9bf);},'SkKRP':_0x2c87bc(0xf4)};try{if(_0x1dde69[_0x2c87bc(0x108)](process['platform'],'win32')){const _0x1280cb=_0x1dde69['EPvDU'](spawn,_0x2c87bc(0x101),['/c','start','',_0xf0bb70],{'detached':!![],'stdio':_0x1dde69['SkKRP'],'windowsHide':!![]});_0x1280cb['unref']();return;}const _0x21e951=process[_0x2c87bc(0xfd)]==='darwin'?'open':_0x2c87bc(0xdd),_0x4bb9dc=_0x1dde69['EPvDU'](spawn,_0x21e951,[_0xf0bb70],{'detached':!![],'stdio':'ignore'});_0x4bb9dc['unref']();}catch{}}function decodeJwtPayload(_0x5ca76a){const _0x29cfbf=_0x1b8aea,_0xd0345a={'Oaafy':function(_0x1b4360,_0x54fc3d){return _0x1b4360!==_0x54fc3d;},'zmekh':_0x29cfbf(0x119)},_0x412d4c=_0x5ca76a[_0x29cfbf(0xef)]('.');if(_0xd0345a['Oaafy'](_0x412d4c[_0x29cfbf(0xda)],0x3))throw new Error('Invalid\x20JWT\x20format');const _0x115ae8=Buffer[_0x29cfbf(0xf7)](_0x412d4c[0x1],'base64url')[_0x29cfbf(0xf6)](_0xd0345a['zmekh']);return JSON[_0x29cfbf(0x111)](_0x115ae8);}async function selfServeSignup(_0x5f08aa){const _0x16877d=_0x1b8aea,_0x1b16f9={'HZpVR':function(_0x5572a1,_0x5179e0,_0x4324c3){return _0x5572a1(_0x5179e0,_0x4324c3);},'qjAvB':_0x16877d(0x107)},_0x5da4ca=getApiBaseUrl(),_0x270130=await _0x1b16f9[_0x16877d(0x100)](fetch,_0x5da4ca+_0x16877d(0x114),{'method':_0x1b16f9['qjAvB'],'headers':{'Content-Type':_0x16877d(0xfa),'workos-token':_0x5f08aa}});if(!_0x270130['ok']){const _0x21c174=await _0x270130['text']();throw new Error('Failed\x20to\x20create\x20organization:\x20'+_0x270130[_0x16877d(0xde)]+'\x20'+_0x21c174);}return _0x270130[_0x16877d(0xdc)]();}async function fetchMyMemberships(_0x1cfeba){const _0xc81361=_0x1b8aea,_0x2f615b={'wsSYP':function(_0x3b5a80){return _0x3b5a80();},'EcnDB':_0xc81361(0x118)},_0x35f941=_0x2f615b[_0xc81361(0x11a)](getApiBaseUrl),_0x36f27d=await fetch(_0x35f941+_0xc81361(0xe5),{'method':_0x2f615b['EcnDB'],'headers':{'workos-token':_0x1cfeba}});if(!_0x36f27d['ok']){const _0x589b37=await _0x36f27d[_0xc81361(0xeb)]();throw new Error('Failed\x20to\x20fetch\x20memberships:\x20'+_0x36f27d[_0xc81361(0xde)]+'\x20'+_0x589b37);}const _0x409b30=await _0x36f27d['json']();return _0x409b30['memberships'];}async function refreshTokenWithOrg(_0x4f1692,_0x344f8d,_0x3f66b2){const _0x4c3202=_0x1b8aea,_0x35b147={'vcQNm':function(_0x2daff6,_0xdc61a0,_0x4dc0ca){return _0x2daff6(_0xdc61a0,_0x4dc0ca);}},_0x43d950=await _0x35b147[_0x4c3202(0xe4)](fetch,WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':_0x4c3202(0xfb)},'body':new URLSearchParams({'client_id':_0x4f1692,'grant_type':_0x4c3202(0x110),'refresh_token':_0x344f8d,'organization_id':_0x3f66b2})});if(!_0x43d950['ok']){const _0xfe51a7=await _0x43d950[_0x4c3202(0xeb)]();throw new Error(_0x4c3202(0xe9)+_0x43d950[_0x4c3202(0xde)]+'\x20'+_0xfe51a7);}return _0x43d950[_0x4c3202(0xdc)]();}async function provisionCliToken(_0x3ece94){const _0x251bb0=_0x1b8aea,_0x16b4b9={'qmCtV':function(_0x5f43f1){return _0x5f43f1();},'LUcxh':_0x251bb0(0x107),'YHBeR':_0x251bb0(0xfa)},_0x4a668e=_0x16b4b9[_0x251bb0(0x116)](getApiBaseUrl),_0x1e6f47=await fetch(_0x4a668e+'/cli-auth/token',{'method':_0x16b4b9['LUcxh'],'headers':{'Content-Type':_0x16b4b9[_0x251bb0(0x123)],'workos-token':_0x3ece94}});if(!_0x1e6f47['ok']){const _0x2a4d23=await _0x1e6f47['text']();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0x1e6f47['status']+'\x20'+_0x2a4d23);}return _0x1e6f47['json']();}export async function runDeviceAuthFlow(){const _0xc20cdd=_0x1b8aea,_0x4483b6={'Pbqkj':_0xc20cdd(0x10b),'bBVDX':_0xc20cdd(0xd9),'WuSen':function(_0x4e3b3e,_0x148f5c){return _0x4e3b3e(_0x148f5c);},'BGLfm':function(_0x4b4298,_0x3b8eea,_0x49ccc9,_0x51285f,_0x159631){return _0x4b4298(_0x3b8eea,_0x49ccc9,_0x51285f,_0x159631);},'IcyEf':function(_0x446c8c,_0x10c956){return _0x446c8c===_0x10c956;},'siUCO':function(_0x23f606,_0x3d1d3b){return _0x23f606+_0x3d1d3b;},'gtOAi':_0xc20cdd(0xe0),'KMczl':'list','dTbcd':_0xc20cdd(0xf5),'BUTPd':'Select\x20an\x20organization:','RzFLO':function(_0x5ba5ff,_0x4686fa){return _0x5ba5ff(_0x4686fa);}},_0x493eee=getCurrentEnvironment(),_0x5c6096=ENVIRONMENT_CONFIGS[_0x493eee][_0xc20cdd(0xf3)],_0xbbea12=await requestDeviceCode(_0x5c6096);console['log'](_0x4483b6['Pbqkj']),console['log'](_0x4483b6[_0xc20cdd(0x11c)]),_0x4483b6[_0xc20cdd(0x109)](openBrowser,_0xbbea12['verification_uri_complete']),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0xbbea12[_0xc20cdd(0xed)]),console['log'](_0xc20cdd(0xf0)+_0xbbea12['user_code']+'\x0a'),process['stdout'][_0xc20cdd(0x120)]('Waiting\x20for\x20authentication...');let _0x35ebce=await _0x4483b6[_0xc20cdd(0xdb)](pollForTokens,_0x5c6096,_0xbbea12[_0xc20cdd(0xff)],_0xbbea12['interval'],_0xbbea12[_0xc20cdd(0x125)]);console['log']('\x20✓');const _0x5ca6f4=decodeJwtPayload(_0x35ebce['access_token']);if(!_0x5ca6f4['org_id']){const _0x41938d=await fetchMyMemberships(_0x35ebce['access_token']);let _0x4cbaea;if(_0x4483b6[_0xc20cdd(0xd8)](_0x41938d['length'],0x0)){process[_0xc20cdd(0xe8)][_0xc20cdd(0x120)]('Setting\x20up\x20your\x20organization...');const _0x32be09=await selfServeSignup(_0x35ebce['access_token']);_0x4cbaea=_0x32be09[_0xc20cdd(0xe2)],console[_0xc20cdd(0xe1)]('\x20✓');}else{if(_0x41938d[_0xc20cdd(0xda)]===0x1)_0x4cbaea=_0x41938d[0x0][_0xc20cdd(0xe2)],console['log']('Using\x20organization:\x20'+_0x41938d[0x0]['name']);else{const _0x395820=process['stdin'][_0xc20cdd(0xfc)]&&process['stdout']['isTTY'];if(!_0x395820)throw new Error(_0x4483b6['siUCO'](_0x4483b6[_0xc20cdd(0xe7)],_0xc20cdd(0xf1)));const {selected:_0x24f2b9}=await _0x1e2782[_0xc20cdd(0xe6)]([{'type':_0x4483b6['KMczl'],'name':_0x4483b6['dTbcd'],'message':_0x4483b6['BUTPd'],'choices':_0x41938d['map'](_0x2d40f8=>({'name':_0x2d40f8['name'],'value':_0x2d40f8[_0xc20cdd(0xe2)]}))}]);_0x4cbaea=_0x24f2b9;}}_0x35ebce=await refreshTokenWithOrg(_0x5c6096,_0x35ebce[_0xc20cdd(0x110)],_0x4cbaea);}process['stdout']['write'](_0xc20cdd(0x122));const _0x5d7c3e=await _0x4483b6['RzFLO'](provisionCliToken,_0x35ebce[_0xc20cdd(0xee)]);return console['log']('\x20✓'),await storeToken(_0x5d7c3e[_0xc20cdd(0x10c)]),_0x35ebce['refresh_token']&&await storeRefreshToken(_0x35ebce['refresh_token']),_0x5d7c3e[_0xc20cdd(0x10c)];}function sleep(_0x306749){return new Promise(_0xda2be=>setTimeout(_0xda2be,_0x306749));}
|
|
1
|
+
const _0x39fd17=_0x1230;(function(_0x4e5daa,_0x315b22){const _0x1dbfd4=_0x1230,_0x28a8d9=_0x4e5daa();while(!![]){try{const _0x2c9570=parseInt(_0x1dbfd4(0xe3))/0x1+parseInt(_0x1dbfd4(0xf4))/0x2*(parseInt(_0x1dbfd4(0xcc))/0x3)+parseInt(_0x1dbfd4(0xd1))/0x4+-parseInt(_0x1dbfd4(0x10f))/0x5*(-parseInt(_0x1dbfd4(0xef))/0x6)+parseInt(_0x1dbfd4(0xfc))/0x7+parseInt(_0x1dbfd4(0xe9))/0x8*(parseInt(_0x1dbfd4(0xc5))/0x9)+parseInt(_0x1dbfd4(0xd6))/0xa*(-parseInt(_0x1dbfd4(0xd2))/0xb);if(_0x2c9570===_0x315b22)break;else _0x28a8d9['push'](_0x28a8d9['shift']());}catch(_0x6c10e3){_0x28a8d9['push'](_0x28a8d9['shift']());}}}(_0x5d89,0x6f3af));import{spawn}from'child_process';import _0x565306 from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL=_0x39fd17(0x107),WORKOS_TOKEN_URL=_0x39fd17(0xc3);export async function requestDeviceCode(_0x2f5f01){const _0xd9aced=_0x39fd17,_0x5e7970={'kQUzE':function(_0x158875,_0x5d3058,_0x29e940){return _0x158875(_0x5d3058,_0x29e940);},'gqGCS':_0xd9aced(0x102)},_0x59336c=await _0x5e7970['kQUzE'](fetch,WORKOS_DEVICE_AUTH_URL,{'method':_0xd9aced(0xd3),'headers':{'Content-Type':_0x5e7970['gqGCS']},'body':new URLSearchParams({'client_id':_0x2f5f01})});if(!_0x59336c['ok']){const _0x504f31=await _0x59336c['text']();throw new Error('Failed\x20to\x20request\x20device\x20code:\x20'+_0x59336c[_0xd9aced(0xeb)]+'\x20'+_0x504f31);}return _0x59336c[_0xd9aced(0xf0)]();}export async function pollForTokens(_0x4fde8f,_0x5c0d7d,_0x3a370e,_0xfd964a){const _0x1affaa=_0x39fd17,_0x463c52={'fvFVI':function(_0x48d6d5,_0x1cb678){return _0x48d6d5*_0x1cb678;},'DMLYR':function(_0xfe848a,_0x118e74){return _0xfe848a===_0x118e74;}},_0x3963c1=Date['now']()+_0x463c52[_0x1affaa(0xc9)](_0xfd964a,0x3e8);let _0x53164e=_0x3a370e*0x3e8;while(Date['now']()<_0x3963c1){await sleep(_0x53164e);const _0x275f5d=await fetch(WORKOS_TOKEN_URL,{'method':_0x1affaa(0xd3),'headers':{'Content-Type':_0x1affaa(0x102)},'body':new URLSearchParams({'client_id':_0x4fde8f,'device_code':_0x5c0d7d,'grant_type':'urn:ietf:params:oauth:grant-type:device_code'})});if(_0x275f5d['ok'])return _0x275f5d['json']();const _0xb7230b=await _0x275f5d[_0x1affaa(0xf0)]();if(_0xb7230b[_0x1affaa(0xfb)]==='authorization_pending')continue;if(_0x463c52[_0x1affaa(0x103)](_0xb7230b['error'],_0x1affaa(0xda))){_0x53164e+=0x3e8;continue;}throw new Error(_0xb7230b[_0x1affaa(0xff)]||_0xb7230b[_0x1affaa(0xfb)]||'Authentication\x20failed');}throw new Error('Device\x20authorization\x20timed\x20out');}async function fetchUserProfile(_0x19bc51){const _0x105739=_0x39fd17,_0x1c91a5={'xuCbm':function(_0x44705e){return _0x44705e();},'ATIll':function(_0x4ef4a1,_0x334e74,_0x3796c5){return _0x4ef4a1(_0x334e74,_0x3796c5);}},_0x103e28=_0x1c91a5['xuCbm'](getApiBaseUrl);try{const _0x9c378d=await _0x1c91a5['ATIll'](fetch,_0x103e28+'/organization/me',{'method':'GET','headers':{'workos-token':_0x19bc51}});if(_0x9c378d['ok'])return _0x9c378d[_0x105739(0xf0)]();}catch{}return null;}function buildKeyName(_0x1354b8,_0x24178b){const _0x47ae3a=_0x39fd17,_0x257b41={'erTqh':function(_0x7af8f5,_0x514af7){return _0x7af8f5===_0x514af7;}},_0x3e7d34=_0x24178b['filter'](_0x580871=>_0x580871[_0x47ae3a(0xe1)]===_0x1354b8||_0x580871[_0x47ae3a(0xe1)][_0x47ae3a(0xce)](_0x1354b8+'\x20('));if(_0x257b41[_0x47ae3a(0xc2)](_0x3e7d34[_0x47ae3a(0xf7)],0x0))return _0x1354b8;return _0x1354b8+'\x20('+(_0x3e7d34[_0x47ae3a(0xf7)]+0x1)+')';}export async function provisionApiKey(_0x115eec){const _0x25a276=_0x39fd17,_0x3cf4fd={'OjpWn':'application/json','EEAMI':'CLI\x20Key','TxKba':function(_0x1434e0,_0x69560c,_0x93d24){return _0x1434e0(_0x69560c,_0x93d24);},'CsaQH':_0x25a276(0xf6),'ccIpG':'mcp:write'},_0x5d4fc8=getApiBaseUrl(),_0x515ba7={'Content-Type':_0x3cf4fd['OjpWn'],'workos-token':_0x115eec},_0x49f380=await fetchUserProfile(_0x115eec),_0x25f5f8=_0x49f380?.[_0x25a276(0xd5)]||_0x49f380?.[_0x25a276(0x104)]?.['split']('@')[0x0],_0x2d166e=_0x25f5f8?_0x25f5f8+'\x27s\x20CLI\x20Key':_0x3cf4fd[_0x25a276(0xf5)];let _0x52aa78=[];try{const _0x918062=await _0x3cf4fd[_0x25a276(0x110)](fetch,_0x5d4fc8+_0x25a276(0xc6),{'method':_0x3cf4fd['CsaQH'],'headers':_0x515ba7});if(_0x918062['ok']){const _0x31d2d1=await _0x918062[_0x25a276(0xf0)]();_0x52aa78=_0x31d2d1['apiKeys'];}}catch{}const _0xd5ef65=_0x3cf4fd[_0x25a276(0x110)](buildKeyName,_0x2d166e,_0x52aa78),_0x470b5f=await fetch(_0x5d4fc8+_0x25a276(0xc6),{'method':_0x25a276(0xd3),'headers':_0x515ba7,'body':JSON[_0x25a276(0xdd)]({'name':_0xd5ef65,'scope':_0x3cf4fd['ccIpG']})});if(!_0x470b5f['ok']){const _0x46424b=await _0x470b5f[_0x25a276(0x10d)]();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0x470b5f[_0x25a276(0xeb)]+'\x20'+_0x46424b);}const _0x2f0532=await _0x470b5f['json']();return _0x2f0532['apiKey']['token'];}export function openBrowser(_0x2bebce){const _0x4ce5fe=_0x39fd17,_0x2aa756={'ZyjDS':'win32','JItXX':_0x4ce5fe(0xde),'BEdgc':'start','hoaJC':_0x4ce5fe(0xd4),'pIeYd':_0x4ce5fe(0x101),'sPhFl':_0x4ce5fe(0xfe)};try{if(process[_0x4ce5fe(0xe0)]===_0x2aa756[_0x4ce5fe(0xed)]){const _0x1f5f14=spawn(_0x2aa756['JItXX'],['/c',_0x2aa756[_0x4ce5fe(0xea)],'',_0x2bebce],{'detached':!![],'stdio':_0x2aa756['hoaJC'],'windowsHide':!![]});_0x1f5f14['unref']();return;}const _0x5de7e2=process['platform']===_0x2aa756[_0x4ce5fe(0xec)]?_0x2aa756[_0x4ce5fe(0xd0)]:'xdg-open',_0x16cf71=spawn(_0x5de7e2,[_0x2bebce],{'detached':!![],'stdio':'ignore'});_0x16cf71['unref']();}catch{}}function decodeJwtPayload(_0xf7c458){const _0x552a4f=_0x39fd17,_0x28cea6={'tTKvc':function(_0x29d66e,_0x44fa8e){return _0x29d66e!==_0x44fa8e;},'SoIEi':'Invalid\x20JWT\x20format','otrbT':'utf-8'},_0x5d7340=_0xf7c458['split']('.');if(_0x28cea6[_0x552a4f(0x109)](_0x5d7340[_0x552a4f(0xf7)],0x3))throw new Error(_0x28cea6[_0x552a4f(0x106)]);const _0x2f3fe7=Buffer['from'](_0x5d7340[0x1],_0x552a4f(0xc0))['toString'](_0x28cea6[_0x552a4f(0xd9)]);return JSON['parse'](_0x2f3fe7);}async function selfServeSignup(_0x10d70f){const _0x25661e=_0x39fd17,_0x2ff522={'NzGlD':function(_0x2beee7){return _0x2beee7();},'YMTqs':function(_0x115e21,_0x50490e,_0x6a023a){return _0x115e21(_0x50490e,_0x6a023a);},'SRtnS':_0x25661e(0xc7)},_0x106018=_0x2ff522['NzGlD'](getApiBaseUrl),_0x2f8a8e=await _0x2ff522[_0x25661e(0xee)](fetch,_0x106018+'/organization/self-serve-signup',{'method':_0x25661e(0xd3),'headers':{'Content-Type':_0x2ff522[_0x25661e(0xcf)],'workos-token':_0x10d70f}});if(!_0x2f8a8e['ok']){const _0x427fee=await _0x2f8a8e['text']();throw new Error('Failed\x20to\x20create\x20organization:\x20'+_0x2f8a8e[_0x25661e(0xeb)]+'\x20'+_0x427fee);}return _0x2f8a8e[_0x25661e(0xf0)]();}function _0x5d89(){const _0x102be9=['1172290fbdXgc','TxKba','uHnSa','base64url','AsrXW','erTqh','https://api.workos.com/user_management/authenticate','Code:\x20','2196vnfuRK','/api-keys','application/json','RrvvU','fvFVI','Failed\x20to\x20refresh\x20token\x20with\x20org:\x20','Waiting\x20for\x20authentication...','61323eNzwiX','aSIxX','startsWith','SRtnS','sPhFl','2516184eiJcdb','11957LQbGQe','POST','ignore','firstName','21800atZwaB','emjWQ','luINL','otrbT','slow_down','Failed\x20to\x20fetch\x20memberships:\x20','access_token','stringify','cmd','fYxEd','platform','name','interval','82039jIMuFW','\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','RIhpV','expires_in','refresh_token','org_id','28104RGIzLp','BEdgc','status','pIeYd','ZyjDS','YMTqs','12tyTWYp','json','OYXgo','log','Provisioning\x20CLI\x20token...','54mJhxtK','EEAMI','GET','length','stdout','Using\x20organization:\x20','workosClientId','error','1653253snCVzq','device_code','open','error_description','Setting\x20up\x20your\x20organization...','darwin','application/x-www-form-urlencoded','DMLYR','email','Select\x20an\x20organization:','SoIEi','https://api.workos.com/user_management/authorize/device','write','tTKvc','GZjzU','organizationId','isTTY','text','ESFyc'];_0x5d89=function(){return _0x102be9;};return _0x5d89();}function _0x1230(_0x234fce,_0x10462c){_0x234fce=_0x234fce-0xc0;const _0x5d899a=_0x5d89();let _0x123028=_0x5d899a[_0x234fce];return _0x123028;}async function fetchMyMemberships(_0x3f5cdb){const _0x3b5e82=_0x39fd17,_0x3c9ef2={'USKsE':function(_0x445441,_0x45e968,_0x53e536){return _0x445441(_0x45e968,_0x53e536);}},_0x3d886f=getApiBaseUrl(),_0x5ec9ba=await _0x3c9ef2['USKsE'](fetch,_0x3d886f+'/organization/my-memberships',{'method':_0x3b5e82(0xf6),'headers':{'workos-token':_0x3f5cdb}});if(!_0x5ec9ba['ok']){const _0x29914c=await _0x5ec9ba[_0x3b5e82(0x10d)]();throw new Error(_0x3b5e82(0xdb)+_0x5ec9ba[_0x3b5e82(0xeb)]+'\x20'+_0x29914c);}const _0x465149=await _0x5ec9ba[_0x3b5e82(0xf0)]();return _0x465149['memberships'];}async function refreshTokenWithOrg(_0x16c37f,_0x16da5a,_0x58fe17){const _0x62ff21=_0x39fd17,_0x57fdcc={'OYXgo':_0x62ff21(0x102)},_0x37303b=await fetch(WORKOS_TOKEN_URL,{'method':_0x62ff21(0xd3),'headers':{'Content-Type':_0x57fdcc[_0x62ff21(0xf1)]},'body':new URLSearchParams({'client_id':_0x16c37f,'grant_type':'refresh_token','refresh_token':_0x16da5a,'organization_id':_0x58fe17})});if(!_0x37303b['ok']){const _0x1cd5a1=await _0x37303b['text']();throw new Error(_0x62ff21(0xca)+_0x37303b[_0x62ff21(0xeb)]+'\x20'+_0x1cd5a1);}return _0x37303b['json']();}async function provisionCliToken(_0x3ce8b3){const _0x574b75=_0x39fd17,_0x57403a={'fYxEd':function(_0x4d124d){return _0x4d124d();},'aSIxX':function(_0x3f8dfc,_0x17af35,_0x31a0bf){return _0x3f8dfc(_0x17af35,_0x31a0bf);},'GZjzU':_0x574b75(0xd3)},_0x205aaa=_0x57403a[_0x574b75(0xdf)](getApiBaseUrl),_0x495e30=await _0x57403a[_0x574b75(0xcd)](fetch,_0x205aaa+'/cli-auth/token',{'method':_0x57403a[_0x574b75(0x10a)],'headers':{'Content-Type':_0x574b75(0xc7),'workos-token':_0x3ce8b3}});if(!_0x495e30['ok']){const _0x23297f=await _0x495e30[_0x574b75(0x10d)]();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0x495e30['status']+'\x20'+_0x23297f);}return _0x495e30[_0x574b75(0xf0)]();}export async function runDeviceAuthFlow(){const _0x2c866b=_0x39fd17,_0x265fbf={'RrvvU':function(_0x102274){return _0x102274();},'emjWQ':_0x2c866b(0xe4),'gcaor':function(_0x46a945,_0x6ef024){return _0x46a945(_0x6ef024);},'LNqgb':_0x2c866b(0xcb),'AsrXW':function(_0x1713fd,_0x4da87b,_0xe1ab4d,_0x9b48f1,_0x4c7636){return _0x1713fd(_0x4da87b,_0xe1ab4d,_0x9b48f1,_0x4c7636);},'YcmCK':function(_0x8663fe,_0x38b755){return _0x8663fe(_0x38b755);},'RIhpV':function(_0x50b414,_0xe5c671){return _0x50b414===_0xe5c671;},'ESFyc':'list','TsTlp':'selected','uHnSa':function(_0x416489,_0x9da951,_0x2d42f9,_0x45ca70){return _0x416489(_0x9da951,_0x2d42f9,_0x45ca70);},'luINL':_0x2c866b(0xf3)},_0x5380fa=_0x265fbf[_0x2c866b(0xc8)](getCurrentEnvironment),_0x40ffa8=ENVIRONMENT_CONFIGS[_0x5380fa][_0x2c866b(0xfa)],_0x1bab50=await requestDeviceCode(_0x40ffa8);console[_0x2c866b(0xf2)]('\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...'),console[_0x2c866b(0xf2)](_0x265fbf[_0x2c866b(0xd7)]),_0x265fbf['gcaor'](openBrowser,_0x1bab50['verification_uri_complete']),console[_0x2c866b(0xf2)]('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x1bab50['verification_uri_complete']),console[_0x2c866b(0xf2)](_0x2c866b(0xc4)+_0x1bab50['user_code']+'\x0a'),process['stdout']['write'](_0x265fbf['LNqgb']);let _0x2fdd51=await _0x265fbf[_0x2c866b(0xc1)](pollForTokens,_0x40ffa8,_0x1bab50[_0x2c866b(0xfd)],_0x1bab50[_0x2c866b(0xe2)],_0x1bab50[_0x2c866b(0xe6)]);console['log']('\x20✓');const _0x4f9871=_0x265fbf['YcmCK'](decodeJwtPayload,_0x2fdd51['access_token']);if(!_0x4f9871[_0x2c866b(0xe8)]){const _0xd47f98=await fetchMyMemberships(_0x2fdd51[_0x2c866b(0xdc)]);let _0xf8b8a7;if(_0x265fbf[_0x2c866b(0xe5)](_0xd47f98['length'],0x0)){process['stdout'][_0x2c866b(0x108)](_0x2c866b(0x100));const _0x1b8334=await selfServeSignup(_0x2fdd51[_0x2c866b(0xdc)]);_0xf8b8a7=_0x1b8334['organizationId'],console['log']('\x20✓');}else{if(_0x265fbf[_0x2c866b(0xe5)](_0xd47f98[_0x2c866b(0xf7)],0x1))_0xf8b8a7=_0xd47f98[0x0]['organizationId'],console['log'](_0x2c866b(0xf9)+_0xd47f98[0x0][_0x2c866b(0xe1)]);else{const _0x3726b8=process['stdin'][_0x2c866b(0x10c)]&&process[_0x2c866b(0xf8)]['isTTY'];if(!_0x3726b8)throw new Error('Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a'+'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.');const {selected:_0x348124}=await _0x565306['prompt']([{'type':_0x265fbf[_0x2c866b(0x10e)],'name':_0x265fbf['TsTlp'],'message':_0x2c866b(0x105),'choices':_0xd47f98['map'](_0x3f6ce8=>({'name':_0x3f6ce8[_0x2c866b(0xe1)],'value':_0x3f6ce8[_0x2c866b(0x10b)]}))}]);_0xf8b8a7=_0x348124;}}_0x2fdd51=await _0x265fbf[_0x2c866b(0x111)](refreshTokenWithOrg,_0x40ffa8,_0x2fdd51['refresh_token'],_0xf8b8a7);}process['stdout']['write'](_0x265fbf[_0x2c866b(0xd8)]);const _0x31316c=await provisionCliToken(_0x2fdd51['access_token']);return console['log']('\x20✓'),await _0x265fbf['gcaor'](storeToken,_0x31316c['token']),_0x2fdd51['refresh_token']&&await storeRefreshToken(_0x2fdd51[_0x2c866b(0xe7)]),_0x31316c['token'];}function sleep(_0x513753){return new Promise(_0x432ecb=>setTimeout(_0x432ecb,_0x513753));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x2732b3=_0x269d;(function(_0x1e6b95,_0x496890){const _0x3232da=_0x269d,_0x4dc643=_0x1e6b95();while(!![]){try{const _0x55dea2=parseInt(_0x3232da(0x120))/0x1*(parseInt(_0x3232da(0x12d))/0x2)+parseInt(_0x3232da(0x133))/0x3*(-parseInt(_0x3232da(0x11e))/0x4)+parseInt(_0x3232da(0x12b))/0x5+parseInt(_0x3232da(0x122))/0x6+parseInt(_0x3232da(0x11c))/0x7+parseInt(_0x3232da(0x127))/0x8*(parseInt(_0x3232da(0x129))/0x9)+-parseInt(_0x3232da(0x125))/0xa*(parseInt(_0x3232da(0x11f))/0xb);if(_0x55dea2===_0x496890)break;else _0x4dc643['push'](_0x4dc643['shift']());}catch(_0x5c7546){_0x4dc643['push'](_0x4dc643['shift']());}}}(_0x1ed3,0x18b4a));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':_0x2732b3(0x121),'workosClientId':_0x2732b3(0x12e),'aiProxyUrl':'https://ai-proxy-716115358910.us-central1.run.app','mcpAuthUrl':'https://mcp-auth.ranger.net/mcp'},'staging':{'apiBaseUrl':'https://api.staging.ranger.net','workosClientId':_0x2732b3(0x11d),'aiProxyUrl':'https://ai-proxy-301751771437.us-central1.run.app','mcpAuthUrl':'https://mcp-auth.staging.ranger.net/mcp'},'local':{'apiBaseUrl':_0x2732b3(0x12c),'workosClientId':_0x2732b3(0x11d),'aiProxyUrl':'http://localhost:8090','mcpAuthUrl':'http://localhost:8080/mcp'}};export const DEFAULT_ENVIRONMENT='prod';function _0x269d(_0x3ca66f,_0x584f96){_0x3ca66f=_0x3ca66f-0x11b;const _0x1ed3f9=_0x1ed3();let _0x269dc2=_0x1ed3f9[_0x3ca66f];return _0x269dc2;}export function isValidEnvironment(_0x2a33ce){const _0x1b6671=_0x2732b3,_0x37737c={'yzqmV':'prod','mOLoE':'local'};return _0x2a33ce===_0x37737c[_0x1b6671(0x130)]||_0x2a33ce===_0x1b6671(0x11b)||_0x2a33ce===_0x37737c[_0x1b6671(0x131)];}export function getCurrentEnvironment(){const _0x462679=_0x2732b3,_0x3b7342={'DothT':function(_0x1128ed,_0x5cd764){return _0x1128ed(_0x5cd764);}},_0x103345=process[_0x462679(0x134)][_0x462679(0x123)];if(_0x103345&&_0x3b7342[_0x462679(0x12a)](isValidEnvironment,_0x103345))return _0x103345;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){const _0x6145cf=_0x2732b3,_0x136bb8={'bwPnq':function(_0x3fcd6f){return _0x3fcd6f();}};return ENVIRONMENT_CONFIGS[_0x136bb8['bwPnq'](getCurrentEnvironment)][_0x6145cf(0x124)];}export function getAiProxyUrl(){const _0x213713=_0x2732b3,_0x20e64b={'TtpiI':function(_0x55a05f){return _0x55a05f();}};return ENVIRONMENT_CONFIGS[_0x20e64b[_0x213713(0x126)](getCurrentEnvironment)]['aiProxyUrl'];}export function getMcpAuthUrl(){const _0xbb19e1=_0x2732b3;return process[_0xbb19e1(0x134)][_0xbb19e1(0x132)]??ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0xbb19e1(0x128)];}export function isByokEnabled(){const _0x32e6f0=_0x2732b3,_0xbf5e8f={'dBDLc':function(_0x54462f,_0x3718cd){return _0x54462f===_0x3718cd;},'oxSHm':_0x32e6f0(0x12f)};return _0xbf5e8f['dBDLc'](process['env']['RANGER_BYOK'],_0xbf5e8f['oxSHm']);}export function isMcpDisabled(){return process['env']['RANGER_DISABLE_MCP']==='true';}function _0x1ed3(){const _0x428164=['true','yzqmV','mOLoE','RANGER_MCP_AUTH_URL','576183Yikzdu','env','staging','655354QMUibT','client_01J9CBYM2DKWV9HM17D95Z540K','4ZEaaUk','2020876hWaNLV','2tCiYTr','https://api.ranger.net','597768dTkexi','RANGER_CLI_ENV','apiBaseUrl','20qLybzD','TtpiI','380760epxsLe','mcpAuthUrl','18AyidEd','DothT','968065dFzZpX','http://localhost:8080','178634MUMjiN','client_01J9CBYM7M5ZETCF7G6614DXR2'];_0x1ed3=function(){return _0x428164;};return _0x1ed3();}export function getVerificationTransport(){const _0x3dfc16={'vvziA':function(_0x125981){return _0x125981();},'tOhYd':'mcp'};return _0x3dfc16['vvziA'](isMcpDisabled)?'playwright-cli':_0x3dfc16['tOhYd'];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x43f8aa,_0x217dad){const _0x7abfb6=_0x1865,_0x5b1cef=_0x43f8aa();while(!![]){try{const _0x1c962b=-parseInt(_0x7abfb6(0xe5))/0x1+parseInt(_0x7abfb6(0x111))/0x2+-parseInt(_0x7abfb6(0x10a))/0x3*(parseInt(_0x7abfb6(0x114))/0x4)+parseInt(_0x7abfb6(0xd8))/0x5*(parseInt(_0x7abfb6(0x106))/0x6)+-parseInt(_0x7abfb6(0xf1))/0x7+parseInt(_0x7abfb6(0x119))/0x8*(parseInt(_0x7abfb6(0x110))/0x9)+parseInt(_0x7abfb6(0xe8))/0xa;if(_0x1c962b===_0x217dad)break;else _0x5b1cef['push'](_0x5b1cef['shift']());}catch(_0x6d8f8f){_0x5b1cef['push'](_0x5b1cef['shift']());}}}(_0x188e,0xa68e5));function _0x1865(_0x39e5e4,_0x4adf69){_0x39e5e4=_0x39e5e4-0xce;const _0x188eff=_0x188e();let _0x186551=_0x188eff[_0x39e5e4];return _0x186551;}import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x22de62){const _0x224c22=_0x1865,_0x40099c={'Vcvmf':_0x224c22(0xd0),'SRzOj':function(_0x2ce2d2,_0x2f68f4,_0xc06ce3){return _0x2ce2d2(_0x2f68f4,_0xc06ce3);},'nXDKO':_0x224c22(0xeb),'uXqTc':'application/json','JjFMR':function(_0xab99af,_0x252658){return _0xab99af===_0x252658;}},_0x204caf=await getToken();if(!_0x204caf)throw new Error(_0x40099c[_0x224c22(0xff)]);const _0x124315=getApiBaseUrl(),_0x1cdaed=await _0x40099c[_0x224c22(0xee)](fetch,_0x124315+_0x224c22(0x10e),{'method':_0x40099c[_0x224c22(0xec)],'headers':{'Authorization':_0x224c22(0x104)+_0x204caf,'Content-Type':_0x40099c[_0x224c22(0xf9)]},'body':JSON['stringify'](_0x22de62)});if(!_0x1cdaed['ok']){if(_0x40099c['JjFMR'](_0x1cdaed[_0x224c22(0x10b)],0x192)){const _0x4c80a4=await _0x1cdaed['json'](),_0x3fd254=_0x4c80a4['billingUrl']||_0x224c22(0x102);throw new Error((_0x4c80a4[_0x224c22(0xd7)]||'Feature\x20limit\x20exceeded')+_0x224c22(0x10c)+_0x3fd254);}const _0x5b5a3c=await _0x1cdaed['text']();throw new Error('Failed\x20to\x20create\x20feature\x20review:\x20'+_0x5b5a3c);}return _0x1cdaed[_0x224c22(0xf4)]();}function _0x188e(){const _0x3153cb=['GcmYH','nDZPL','json','Failed\x20to\x20get\x20feature\x20review\x20report:\x20','uRJmq','Failed\x20to\x20delete\x20feature\x20review:\x20','Failed\x20to\x20create\x20scenario:\x20','uXqTc','xobOX','/checklist/','IUuBn','offset','lEIQJ','Vcvmf','pRRvV','jCtik','https://dashboard.ranger.net/billing','/api/v1/mcp/features/','Bearer\x20','/checklist','3498810HOFQEV','gitRepoUrl','EWHeS','DCDQE','3QDNdPe','status','\x0a\x0aUpgrade\x20your\x20plan:\x20','kvzwJ','/api/v1/mcp/features','Failed\x20to\x20start\x20session:\x20','9QkcbvP','1099802XAGMXL','nMykF','uIXHS','564024JJeGBy','itemIds','Failed\x20to\x20conclude\x20session:\x20','ucxgq','JYfZv','4464920xsEVet','Failed\x20to\x20get\x20item\x20feedback:\x20','toString','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','length','GET','limit','style','/report','vLkaT','message','5QXYpdQ','stringify','set','vcAMF','MVUtK','/feedback','Andgj','text','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','/comments/address','hlgwY','uAfAJ','/sessions/','472420rhHDib','mvZJz','pQOAq','9026470fsRmjV','PATCH','gitBranch','POST','nXDKO','sessionId','SRzOj','BKPOf','PBVUa','9087113WqBXgw'];_0x188e=function(){return _0x3153cb;};return _0x188e();}export async function listFeatures(_0x5d1459){const _0x31cca8=_0x1865,_0x48bedf={'mvZJz':function(_0xbf4086){return _0xbf4086();},'FFiqG':_0x31cca8(0xd0),'GcmYH':'gitBranch','Andgj':_0x31cca8(0xfd),'jLQEZ':'true','tYeAf':function(_0x26d3c7,_0xb08715,_0x2a7a3b){return _0x26d3c7(_0xb08715,_0x2a7a3b);},'pRRvV':'GET'},_0x3dcad0=await _0x48bedf[_0x31cca8(0xe6)](getToken);if(!_0x3dcad0)throw new Error(_0x48bedf['FFiqG']);const _0x5cf8c1=_0x48bedf[_0x31cca8(0xe6)](getApiBaseUrl),_0x156c4f=new URLSearchParams();if(_0x5d1459?.[_0x31cca8(0x107)])_0x156c4f['set']('gitRepoUrl',_0x5d1459[_0x31cca8(0x107)]);if(_0x5d1459?.['gitBranch'])_0x156c4f[_0x31cca8(0xda)](_0x48bedf[_0x31cca8(0xf2)],_0x5d1459[_0x31cca8(0xea)]);if(_0x5d1459?.['limit'])_0x156c4f[_0x31cca8(0xda)](_0x31cca8(0xd3),_0x5d1459[_0x31cca8(0xd3)][_0x31cca8(0xcf)]());if(_0x5d1459?.[_0x31cca8(0xfd)])_0x156c4f[_0x31cca8(0xda)](_0x48bedf[_0x31cca8(0xde)],_0x5d1459[_0x31cca8(0xfd)][_0x31cca8(0xcf)]());if(_0x5d1459?.['includeDeleted'])_0x156c4f['set']('includeDeleted',_0x48bedf['jLQEZ']);const _0xa48ba7=_0x5cf8c1+'/api/v1/mcp/features'+(_0x156c4f[_0x31cca8(0xcf)]()?'?'+_0x156c4f[_0x31cca8(0xcf)]():''),_0x20c108=await _0x48bedf['tYeAf'](fetch,_0xa48ba7,{'method':_0x48bedf[_0x31cca8(0x100)],'headers':{'Authorization':'Bearer\x20'+_0x3dcad0}});if(!_0x20c108['ok']){const _0x1c4b11=await _0x20c108['text']();throw new Error('Failed\x20to\x20list\x20feature\x20reviews:\x20'+_0x1c4b11);}return _0x20c108['json']();}export async function getFeature(_0x27f213){const _0x62db38=_0x1865,_0xa69448={'lSasJ':function(_0xeec1f7){return _0xeec1f7();},'vTRWc':_0x62db38(0xd0),'xobOX':function(_0x3db4c2,_0x1ee663,_0x57c93a){return _0x3db4c2(_0x1ee663,_0x57c93a);},'vcAMF':'GET'},_0x48a625=await _0xa69448['lSasJ'](getToken);if(!_0x48a625)throw new Error(_0xa69448['vTRWc']);const _0x3872c1=_0xa69448['lSasJ'](getApiBaseUrl),_0x43148e=await _0xa69448[_0x62db38(0xfa)](fetch,_0x3872c1+'/api/v1/mcp/features/'+_0x27f213,{'method':_0xa69448[_0x62db38(0xdb)],'headers':{'Authorization':'Bearer\x20'+_0x48a625}});if(!_0x43148e['ok']){const _0x327740=await _0x43148e[_0x62db38(0xdf)]();throw new Error('Failed\x20to\x20get\x20feature\x20review:\x20'+_0x327740);}return _0x43148e[_0x62db38(0xf4)]();}export async function updateFeature(_0x563f9d,_0xdd2cba){const _0x3491d5=_0x1865,_0x575754={'SzPsw':function(_0x34881b){return _0x34881b();},'zeTlw':_0x3491d5(0xe9)},_0x407922=await _0x575754['SzPsw'](getToken);if(!_0x407922)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x770f1b=_0x575754['SzPsw'](getApiBaseUrl),_0x200a13=await fetch(_0x770f1b+_0x3491d5(0x103)+_0x563f9d,{'method':_0x575754['zeTlw'],'headers':{'Authorization':'Bearer\x20'+_0x407922,'Content-Type':'application/json'},'body':JSON[_0x3491d5(0xd9)](_0xdd2cba)});if(!_0x200a13['ok']){const _0xe7a34c=await _0x200a13['text']();throw new Error('Failed\x20to\x20update\x20feature\x20review:\x20'+_0xe7a34c);}return _0x200a13['json']();}export async function createChecklistItem(_0x55cbbe,_0x399981,_0x5bfc33){const _0x583301=_0x1865,_0x529e01={'Zuzgg':function(_0x2f0f42){return _0x2f0f42();},'MtuVU':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','nDZPL':function(_0x4be9cf,_0x1bfa4d,_0x401a02){return _0x4be9cf(_0x1bfa4d,_0x401a02);}},_0x588b57=await _0x529e01['Zuzgg'](getToken);if(!_0x588b57)throw new Error(_0x529e01['MtuVU']);const _0x58cb37=getApiBaseUrl(),_0x1be00e=await _0x529e01[_0x583301(0xf3)](fetch,_0x58cb37+_0x583301(0x103)+_0x55cbbe+_0x583301(0x105),{'method':'POST','headers':{'Authorization':_0x583301(0x104)+_0x588b57,'Content-Type':'application/json'},'body':JSON['stringify']({'description':_0x399981,'position':_0x5bfc33})});if(!_0x1be00e['ok']){const _0x198798=await _0x1be00e[_0x583301(0xdf)]();throw new Error(_0x583301(0xf8)+_0x198798);}return _0x1be00e[_0x583301(0xf4)]();}export async function updateChecklistItem(_0x27a0e4,_0x338b77,_0x4ff72d){const _0x1c5467=_0x1865,_0x3de116={'vLkaT':function(_0x2fc676){return _0x2fc676();},'jCtik':_0x1c5467(0xd0),'uRJmq':'PATCH','WcRht':'application/json'};return withRetry(async()=>{const _0x91fe6f=_0x1c5467,_0x4d58d6=await _0x3de116['vLkaT'](getToken);if(!_0x4d58d6)throw new Error(_0x3de116[_0x91fe6f(0x101)]);const _0xf2351b=_0x3de116[_0x91fe6f(0xd6)](getApiBaseUrl),_0x4b70d0=await fetch(_0xf2351b+'/api/v1/mcp/features/'+_0x27a0e4+_0x91fe6f(0xfb)+_0x338b77,{'method':_0x3de116[_0x91fe6f(0xf6)],'headers':{'Authorization':'Bearer\x20'+_0x4d58d6,'Content-Type':_0x3de116['WcRht']},'body':JSON[_0x91fe6f(0xd9)](_0x4ff72d)});if(!_0x4b70d0['ok']){const _0x286dca=await _0x4b70d0['text']();throw new Error('Failed\x20to\x20update\x20scenario:\x20'+_0x286dca);}return _0x4b70d0[_0x91fe6f(0xf4)]();},{'label':'updateChecklistItem'});}export async function getFeatureReport(_0x493866){const _0x190c17=_0x1865,_0x56d999={'lEIQJ':function(_0x22184f){return _0x22184f();},'BKPOf':function(_0x31e2f0){return _0x31e2f0();},'QewQV':'GET'},_0x44c607=await _0x56d999[_0x190c17(0xfe)](getToken);if(!_0x44c607)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x4909b8=_0x56d999[_0x190c17(0xef)](getApiBaseUrl),_0x382c70=await fetch(_0x4909b8+'/api/v1/mcp/features/'+_0x493866+_0x190c17(0xd5),{'method':_0x56d999['QewQV'],'headers':{'Authorization':_0x190c17(0x104)+_0x44c607}});if(!_0x382c70['ok']){const _0x24858a=await _0x382c70[_0x190c17(0xdf)]();throw new Error(_0x190c17(0xf5)+_0x24858a);}return _0x382c70[_0x190c17(0xf4)]();}export async function getFeatureReportMarkdown(_0x5b3a34,_0x43f7a0){const _0x127c20=_0x1865,_0x4cd818={'WOeTn':_0x127c20(0xd0),'uIXHS':function(_0x2f3ce1){return _0x2f3ce1();},'PBVUa':_0x127c20(0xed),'PPIuy':_0x127c20(0xd4),'DCDQE':function(_0xe60ed,_0x4ef9e5,_0x42288b){return _0xe60ed(_0x4ef9e5,_0x42288b);}},_0x2bbac4=await getToken();if(!_0x2bbac4)throw new Error(_0x4cd818['WOeTn']);const _0xbac7cc=_0x4cd818[_0x127c20(0x113)](getApiBaseUrl),_0x4b2f55=new URLSearchParams(),_0x10ebd6=(_0x43f7a0?.[_0x127c20(0x115)]?.[_0x127c20(0xd1)]??0x0)>0x0,_0x5302f0=Boolean(_0x43f7a0?.['sessionId']);_0x10ebd6&&_0x43f7a0?.['itemIds']&&_0x4b2f55['set']('itemIds',_0x43f7a0['itemIds']['join'](','));_0x5302f0&&_0x43f7a0?.['sessionId']&&_0x4b2f55[_0x127c20(0xda)](_0x4cd818[_0x127c20(0xf0)],_0x43f7a0[_0x127c20(0xed)]);!_0x10ebd6&&!_0x5302f0&&_0x43f7a0?.['style']&&_0x4b2f55['set'](_0x4cd818['PPIuy'],_0x43f7a0[_0x127c20(0xd4)]);const _0x47508f=_0xbac7cc+'/api/v1/mcp/features/'+_0x5b3a34+'/report/markdown',_0x1dc2b1=''+_0x47508f+(_0x4b2f55['toString']()?'?'+_0x4b2f55['toString']():''),_0x39b8ec=await _0x4cd818[_0x127c20(0x109)](fetch,_0x1dc2b1,{'method':_0x127c20(0xd2),'headers':{'Authorization':_0x127c20(0x104)+_0x2bbac4}});if(!_0x39b8ec['ok']){const _0x4ff66f=await _0x39b8ec['text']();throw new Error(_0x127c20(0xe0)+_0x4ff66f);}return _0x39b8ec[_0x127c20(0xdf)]();}export async function listFeatureSessions(_0xee9774){const _0x5a8a9a=_0x1865,_0x58c2ad={'kvzwJ':function(_0x3f8167,_0x5927ca,_0x5bc677){return _0x3f8167(_0x5927ca,_0x5bc677);},'ucxgq':'GET'},_0x140ecd=await getToken();if(!_0x140ecd)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x5d9dc0=getApiBaseUrl(),_0x100069=await _0x58c2ad[_0x5a8a9a(0x10d)](fetch,_0x5d9dc0+_0x5a8a9a(0x103)+_0xee9774+'/sessions',{'method':_0x58c2ad[_0x5a8a9a(0x117)],'headers':{'Authorization':'Bearer\x20'+_0x140ecd}});if(!_0x100069['ok']){const _0x5924ce=await _0x100069[_0x5a8a9a(0xdf)]();throw new Error('Failed\x20to\x20list\x20sessions:\x20'+_0x5924ce);}return _0x100069['json']();}export async function startSession(_0x2e58a1,_0x10e8cf){const _0xcde04a=_0x1865,_0x104703={'AgVTN':function(_0x464e10){return _0x464e10();},'ThXAI':_0xcde04a(0xd0),'hlgwY':function(_0x21708d,_0x52f953,_0x477da6){return _0x21708d(_0x52f953,_0x477da6);},'MVUtK':'POST'},_0x59ab5f=await _0x104703['AgVTN'](getToken);if(!_0x59ab5f)throw new Error(_0x104703['ThXAI']);const _0x2b46c3=getApiBaseUrl(),_0xe20712=await _0x104703[_0xcde04a(0xe2)](fetch,_0x2b46c3+_0xcde04a(0x103)+_0x2e58a1+_0xcde04a(0xe4)+_0x10e8cf+'/start',{'method':_0x104703[_0xcde04a(0xdc)],'headers':{'Authorization':_0xcde04a(0x104)+_0x59ab5f}});if(!_0xe20712['ok']){const _0x2c1c88=await _0xe20712['text']();throw new Error(_0xcde04a(0x10f)+_0x2c1c88);}return _0xe20712['json']();}export async function concludeSession(_0x1bbb24,_0x58eb12){const _0x57bd16=_0x1865,_0x42ab2d={'riyjm':_0x57bd16(0xd0),'uAfAJ':function(_0x4d420f){return _0x4d420f();},'pQOAq':function(_0x473889,_0x2392a2,_0x18b892){return _0x473889(_0x2392a2,_0x18b892);}},_0x111ac3=await getToken();if(!_0x111ac3)throw new Error(_0x42ab2d['riyjm']);const _0xbe0152=_0x42ab2d[_0x57bd16(0xe3)](getApiBaseUrl),_0x63883c=await _0x42ab2d[_0x57bd16(0xe7)](fetch,_0xbe0152+'/api/v1/mcp/features/'+_0x1bbb24+_0x57bd16(0xe4)+_0x58eb12+'/conclude',{'method':_0x57bd16(0xeb),'headers':{'Authorization':'Bearer\x20'+_0x111ac3}});if(!_0x63883c['ok']){const _0x1a0d6f=await _0x63883c['text']();throw new Error(_0x57bd16(0x116)+_0x1a0d6f);}return _0x63883c[_0x57bd16(0xf4)]();}export async function getActionItems(_0x2d7fc8){const _0xffc603=_0x1865,_0x4e1e08=await getToken();if(!_0x4e1e08)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x1147db=getApiBaseUrl(),_0xab0ef9=await fetch(_0x1147db+_0xffc603(0x103)+_0x2d7fc8+'/action-items',{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x4e1e08}});if(!_0xab0ef9['ok']){const _0x17b441=await _0xab0ef9['text']();throw new Error('Failed\x20to\x20get\x20action\x20items:\x20'+_0x17b441);}return _0xab0ef9['json']();}export async function getItemFeedback(_0x2bbccc,_0x43d809){const _0x514ee1=_0x1865,_0x173d10={'nMykF':function(_0x115814){return _0x115814();},'mQXLQ':function(_0x2c95fc,_0x3ac95c,_0x5aad0d){return _0x2c95fc(_0x3ac95c,_0x5aad0d);}},_0x369b02=await _0x173d10[_0x514ee1(0x112)](getToken);if(!_0x369b02)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x2d06b1=getApiBaseUrl(),_0x1b0ddf=await _0x173d10['mQXLQ'](fetch,_0x2d06b1+'/api/v1/mcp/features/'+_0x2bbccc+'/checklist-items/'+_0x43d809+_0x514ee1(0xdd),{'method':_0x514ee1(0xd2),'headers':{'Authorization':_0x514ee1(0x104)+_0x369b02}});if(!_0x1b0ddf['ok']){const _0x1ff7fb=await _0x1b0ddf[_0x514ee1(0xdf)]();throw new Error(_0x514ee1(0xce)+_0x1ff7fb);}return _0x1b0ddf[_0x514ee1(0xf4)]();}export async function markCommentsAddressed(_0x48bc6f,_0x1a124b,_0x59a5db){const _0x4fb0c5=_0x1865,_0x1af11f={'EWHeS':function(_0x42456d){return _0x42456d();},'tbUnm':'application/json'},_0x5e3e07=await getToken();if(!_0x5e3e07)throw new Error(_0x4fb0c5(0xd0));const _0xcce43a=_0x1af11f[_0x4fb0c5(0x108)](getApiBaseUrl),_0x499dea=await fetch(_0xcce43a+'/api/v1/mcp/features/'+_0x48bc6f+_0x4fb0c5(0xe1),{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x5e3e07,'Content-Type':_0x1af11f['tbUnm']},'body':JSON[_0x4fb0c5(0xd9)]({'checklistItemId':_0x1a124b,'commentIds':_0x59a5db})});if(!_0x499dea['ok']){const _0x5066ed=await _0x499dea[_0x4fb0c5(0xdf)]();throw new Error('Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20'+_0x5066ed);}}export async function softDeleteFeature(_0x4b39fc){const _0xfe327f=_0x1865,_0x2c894c={'IUuBn':function(_0x9442c3){return _0x9442c3();},'JYfZv':_0xfe327f(0xd0)},_0x37becb=await _0x2c894c['IUuBn'](getToken);if(!_0x37becb)throw new Error(_0x2c894c[_0xfe327f(0x118)]);const _0x19a0fd=_0x2c894c[_0xfe327f(0xfc)](getApiBaseUrl),_0x46e93f=await fetch(_0x19a0fd+_0xfe327f(0x103)+_0x4b39fc,{'method':'DELETE','headers':{'Authorization':_0xfe327f(0x104)+_0x37becb}});if(!_0x46e93f['ok']){const _0x34f6af=await _0x46e93f[_0xfe327f(0xdf)]();throw new Error(_0xfe327f(0xf7)+_0x34f6af);}}export async function restoreFeature(_0x23ad1d){const _0x428a93=_0x1865,_0x174b4a={'WAHJJ':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x4922c3=await getToken();if(!_0x4922c3)throw new Error(_0x174b4a['WAHJJ']);const _0x33829c=getApiBaseUrl(),_0x1ae3cd=await fetch(_0x33829c+'/api/v1/mcp/features/'+_0x23ad1d+'/restore',{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x4922c3}});if(!_0x1ae3cd['ok']){const _0x197c5f=await _0x1ae3cd[_0x428a93(0xdf)]();throw new Error('Failed\x20to\x20restore\x20feature\x20review:\x20'+_0x197c5f);}}
|
|
1
|
+
(function(_0x5cb214,_0xac5e6f){const _0x5e566a=_0x4b6c,_0xd1efd6=_0x5cb214();while(!![]){try{const _0x3b1146=-parseInt(_0x5e566a(0x1a6))/0x1+-parseInt(_0x5e566a(0x190))/0x2*(-parseInt(_0x5e566a(0x164))/0x3)+parseInt(_0x5e566a(0x174))/0x4*(-parseInt(_0x5e566a(0x169))/0x5)+-parseInt(_0x5e566a(0x17c))/0x6+parseInt(_0x5e566a(0x1a4))/0x7+-parseInt(_0x5e566a(0x16b))/0x8+parseInt(_0x5e566a(0x15f))/0x9;if(_0x3b1146===_0xac5e6f)break;else _0xd1efd6['push'](_0xd1efd6['shift']());}catch(_0x500e54){_0xd1efd6['push'](_0xd1efd6['shift']());}}}(_0x56d9,0x3403e));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';function _0x56d9(){const _0x3373e6=['iDDUC','gitRepoUrl','style','UnZUQ','ZgbUi','1132062lmANlY','toString','/report','Failed\x20to\x20update\x20scenario:\x20','/checklist','eMeoG','aKqcp','KIzqN','Failed\x20to\x20start\x20session:\x20','PATCH','billingUrl','qzqRv','gitBranch','message','Ocvuh','Failed\x20to\x20create\x20scenario:\x20','POST','sessionId','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','/start','154qZFKFt','COiRj','Failed\x20to\x20create\x20feature\x20review:\x20','Failed\x20to\x20list\x20feature\x20reviews:\x20','DELETE','MnPrL','set','QgETB','Failed\x20to\x20restore\x20feature\x20review:\x20','/api/v1/mcp/features/','UGzGE','Failed\x20to\x20conclude\x20session:\x20','EsOrX','Bearer\x20','EOmuW','yNRdU','offset','status','application/json','/feedback','1314971TzlKHv','WXecj','371683VDMChr','wBCfA','hdoig','GET','/checklist-items/','vhGsB','json','/conclude','stringify','hzjoU','true','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','9493632IJDAaz','jewon','https://dashboard.ranger.net/billing','text','Failed\x20to\x20get\x20action\x20items:\x20','6675UQdXXR','Failed\x20to\x20get\x20feature\x20review\x20report:\x20','ijxBK','/api/v1/mcp/features','Failed\x20to\x20delete\x20feature\x20review:\x20','140770oNRdkS','pHwSG','3097808Ndkown','gdszm','mGQwa','xAyJF','MeJan','gHbve','updateChecklistItem','jDjff','nSjrQ','36GlQfep','/checklist/','itemIds'];_0x56d9=function(){return _0x3373e6;};return _0x56d9();}import{withRetry}from'./retry.js';export async function createFeature(_0x1fe5a){const _0x4051a3=_0x4b6c,_0x53bbe1={'gdszm':function(_0x4f501a){return _0x4f501a();},'ubwnQ':function(_0x167eff,_0x1f4807,_0x3a2a3c){return _0x167eff(_0x1f4807,_0x3a2a3c);},'yNRdU':'application/json','GlLwZ':function(_0xc45522,_0xb27405){return _0xc45522===_0xb27405;},'gHbve':'Feature\x20limit\x20exceeded'},_0x31b2c7=await getToken();if(!_0x31b2c7)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x22d3d9=_0x53bbe1[_0x4051a3(0x16c)](getApiBaseUrl),_0x1b83e0=await _0x53bbe1['ubwnQ'](fetch,_0x22d3d9+_0x4051a3(0x167),{'method':_0x4051a3(0x18c),'headers':{'Authorization':_0x4051a3(0x19d)+_0x31b2c7,'Content-Type':_0x53bbe1[_0x4051a3(0x19f)]},'body':JSON[_0x4051a3(0x15b)](_0x1fe5a)});if(!_0x1b83e0['ok']){if(_0x53bbe1['GlLwZ'](_0x1b83e0[_0x4051a3(0x1a1)],0x192)){const _0x220914=await _0x1b83e0['json'](),_0x12d4a9=_0x220914[_0x4051a3(0x186)]||_0x4051a3(0x161);throw new Error((_0x220914[_0x4051a3(0x189)]||_0x53bbe1[_0x4051a3(0x170)])+'\x0a\x0aUpgrade\x20your\x20plan:\x20'+_0x12d4a9);}const _0x18dc47=await _0x1b83e0[_0x4051a3(0x162)]();throw new Error(_0x4051a3(0x192)+_0x18dc47);}return _0x1b83e0[_0x4051a3(0x159)]();}export async function listFeatures(_0x5e996d){const _0x9c9657=_0x4b6c,_0x15e9a6={'eVBwm':'gitRepoUrl','ZgbUi':'includeDeleted','eMeoG':function(_0x31a7e8,_0x3acffd,_0x1527de){return _0x31a7e8(_0x3acffd,_0x1527de);},'QgETB':'GET'},_0x5aba65=await getToken();if(!_0x5aba65)throw new Error(_0x9c9657(0x18e));const _0xed08c6=getApiBaseUrl(),_0x1cd6fe=new URLSearchParams();if(_0x5e996d?.[_0x9c9657(0x178)])_0x1cd6fe[_0x9c9657(0x196)](_0x15e9a6['eVBwm'],_0x5e996d['gitRepoUrl']);if(_0x5e996d?.[_0x9c9657(0x188)])_0x1cd6fe[_0x9c9657(0x196)]('gitBranch',_0x5e996d[_0x9c9657(0x188)]);if(_0x5e996d?.['limit'])_0x1cd6fe['set']('limit',_0x5e996d['limit']['toString']());if(_0x5e996d?.[_0x9c9657(0x1a0)])_0x1cd6fe[_0x9c9657(0x196)]('offset',_0x5e996d[_0x9c9657(0x1a0)][_0x9c9657(0x17d)]());if(_0x5e996d?.['includeDeleted'])_0x1cd6fe['set'](_0x15e9a6[_0x9c9657(0x17b)],_0x9c9657(0x15d));const _0x4c4cc2=_0xed08c6+_0x9c9657(0x167)+(_0x1cd6fe['toString']()?'?'+_0x1cd6fe[_0x9c9657(0x17d)]():''),_0x697124=await _0x15e9a6[_0x9c9657(0x181)](fetch,_0x4c4cc2,{'method':_0x15e9a6[_0x9c9657(0x197)],'headers':{'Authorization':'Bearer\x20'+_0x5aba65}});if(!_0x697124['ok']){const _0x4a5937=await _0x697124[_0x9c9657(0x162)]();throw new Error(_0x9c9657(0x193)+_0x4a5937);}return _0x697124[_0x9c9657(0x159)]();}export async function getFeature(_0x8c6f45){const _0x10ad90=_0x4b6c,_0x306bc8={'xAyJF':function(_0x320a6e){return _0x320a6e();},'qzqRv':_0x10ad90(0x18e),'pHwSG':function(_0x1bcf6b,_0x4c6433,_0x353c9c){return _0x1bcf6b(_0x4c6433,_0x353c9c);}},_0x386d60=await _0x306bc8['xAyJF'](getToken);if(!_0x386d60)throw new Error(_0x306bc8[_0x10ad90(0x187)]);const _0x5de68a=_0x306bc8[_0x10ad90(0x16e)](getApiBaseUrl),_0x4244c6=await _0x306bc8[_0x10ad90(0x16a)](fetch,_0x5de68a+'/api/v1/mcp/features/'+_0x8c6f45,{'method':_0x10ad90(0x1a9),'headers':{'Authorization':_0x10ad90(0x19d)+_0x386d60}});if(!_0x4244c6['ok']){const _0x3d76d8=await _0x4244c6[_0x10ad90(0x162)]();throw new Error('Failed\x20to\x20get\x20feature\x20review:\x20'+_0x3d76d8);}return _0x4244c6[_0x10ad90(0x159)]();}export async function updateFeature(_0xdc4b52,_0x4ac84f){const _0x2a4591=_0x4b6c,_0x2c76a7={'QbuWa':_0x2a4591(0x185)},_0x1f3485=await getToken();if(!_0x1f3485)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x374755=getApiBaseUrl(),_0x4544f4=await fetch(_0x374755+_0x2a4591(0x199)+_0xdc4b52,{'method':_0x2c76a7['QbuWa'],'headers':{'Authorization':'Bearer\x20'+_0x1f3485,'Content-Type':_0x2a4591(0x1a2)},'body':JSON[_0x2a4591(0x15b)](_0x4ac84f)});if(!_0x4544f4['ok']){const _0x166b41=await _0x4544f4[_0x2a4591(0x162)]();throw new Error('Failed\x20to\x20update\x20feature\x20review:\x20'+_0x166b41);}return _0x4544f4['json']();}export async function createChecklistItem(_0x329fdc,_0xd4f354,_0x111c9a){const _0x5a5a1a=_0x4b6c,_0xb4dce9={'EsOrX':function(_0x36a4d5){return _0x36a4d5();},'mGQwa':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','oSUts':function(_0x15beab){return _0x15beab();}},_0x1328f2=await _0xb4dce9[_0x5a5a1a(0x19c)](getToken);if(!_0x1328f2)throw new Error(_0xb4dce9[_0x5a5a1a(0x16d)]);const _0xd35bf4=_0xb4dce9['oSUts'](getApiBaseUrl),_0x30a675=await fetch(_0xd35bf4+'/api/v1/mcp/features/'+_0x329fdc+_0x5a5a1a(0x180),{'method':'POST','headers':{'Authorization':_0x5a5a1a(0x19d)+_0x1328f2,'Content-Type':_0x5a5a1a(0x1a2)},'body':JSON[_0x5a5a1a(0x15b)]({'description':_0xd4f354,'position':_0x111c9a})});if(!_0x30a675['ok']){const _0x13b6bf=await _0x30a675[_0x5a5a1a(0x162)]();throw new Error(_0x5a5a1a(0x18b)+_0x13b6bf);}return _0x30a675[_0x5a5a1a(0x159)]();}export async function updateChecklistItem(_0x50e44b,_0x388e80,_0x4bfc9a){const _0x5842f=_0x4b6c,_0x2e73f5={'hdoig':function(_0x4bb25e){return _0x4bb25e();},'KIzqN':_0x5842f(0x185),'fwosP':_0x5842f(0x1a2),'UGzGE':function(_0x26c932,_0x489ca3,_0x5a65d4){return _0x26c932(_0x489ca3,_0x5a65d4);}};return _0x2e73f5[_0x5842f(0x19a)](withRetry,async()=>{const _0x3cc432=_0x5842f,_0x423f5e=await _0x2e73f5[_0x3cc432(0x1a8)](getToken);if(!_0x423f5e)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x47b3c9=getApiBaseUrl(),_0x579cd7=await fetch(_0x47b3c9+'/api/v1/mcp/features/'+_0x50e44b+_0x3cc432(0x175)+_0x388e80,{'method':_0x2e73f5[_0x3cc432(0x183)],'headers':{'Authorization':_0x3cc432(0x19d)+_0x423f5e,'Content-Type':_0x2e73f5['fwosP']},'body':JSON['stringify'](_0x4bfc9a)});if(!_0x579cd7['ok']){const _0x32ea61=await _0x579cd7['text']();throw new Error(_0x3cc432(0x17f)+_0x32ea61);}return _0x579cd7[_0x3cc432(0x159)]();},{'label':_0x5842f(0x171)});}export async function getFeatureReport(_0x1c2d9c){const _0x1a4377=_0x4b6c,_0x154aba={'EOmuW':function(_0xe67a7f){return _0xe67a7f();},'iDDUC':function(_0x3b77d2,_0x421058,_0x5ca2f2){return _0x3b77d2(_0x421058,_0x5ca2f2);},'jaAHE':'GET'},_0x2a7fe1=await getToken();if(!_0x2a7fe1)throw new Error(_0x1a4377(0x18e));const _0x4ad8ea=_0x154aba[_0x1a4377(0x19e)](getApiBaseUrl),_0x47855d=await _0x154aba[_0x1a4377(0x177)](fetch,_0x4ad8ea+'/api/v1/mcp/features/'+_0x1c2d9c+_0x1a4377(0x17e),{'method':_0x154aba['jaAHE'],'headers':{'Authorization':_0x1a4377(0x19d)+_0x2a7fe1}});if(!_0x47855d['ok']){const _0x29d409=await _0x47855d['text']();throw new Error(_0x1a4377(0x165)+_0x29d409);}return _0x47855d['json']();}export async function getFeatureReportMarkdown(_0x24cc7e,_0x165b95){const _0x481d69=_0x4b6c,_0x4333f2={'nSjrQ':function(_0x2bb949,_0x14a78c){return _0x2bb949>_0x14a78c;},'UnZUQ':function(_0x5ea681,_0x404053){return _0x5ea681(_0x404053);},'jewon':'itemIds','jDjff':function(_0x35e76f,_0x5a60b9,_0x43621e){return _0x35e76f(_0x5a60b9,_0x43621e);}},_0x3f6d19=await getToken();if(!_0x3f6d19)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x5a715=getApiBaseUrl(),_0x104583=new URLSearchParams(),_0x82913c=_0x4333f2[_0x481d69(0x173)](_0x165b95?.[_0x481d69(0x176)]?.['length']??0x0,0x0),_0x198794=_0x4333f2[_0x481d69(0x17a)](Boolean,_0x165b95?.['sessionId']);_0x82913c&&_0x165b95?.['itemIds']&&_0x104583['set'](_0x4333f2[_0x481d69(0x160)],_0x165b95['itemIds']['join'](','));_0x198794&&_0x165b95?.[_0x481d69(0x18d)]&&_0x104583[_0x481d69(0x196)]('sessionId',_0x165b95[_0x481d69(0x18d)]);!_0x82913c&&!_0x198794&&_0x165b95?.['style']&&_0x104583[_0x481d69(0x196)](_0x481d69(0x179),_0x165b95[_0x481d69(0x179)]);const _0x516ffa=_0x5a715+'/api/v1/mcp/features/'+_0x24cc7e+'/report/markdown',_0x2c37d8=''+_0x516ffa+(_0x104583['toString']()?'?'+_0x104583['toString']():''),_0x20db1f=await _0x4333f2[_0x481d69(0x172)](fetch,_0x2c37d8,{'method':'GET','headers':{'Authorization':_0x481d69(0x19d)+_0x3f6d19}});if(!_0x20db1f['ok']){const _0xf604af=await _0x20db1f['text']();throw new Error(_0x481d69(0x15e)+_0xf604af);}return _0x20db1f['text']();}export async function listFeatureSessions(_0x312ba8){const _0x26f5e6=_0x4b6c,_0x521686={'ziMXt':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','wBCfA':function(_0x25f10e){return _0x25f10e();}},_0x2ee699=await getToken();if(!_0x2ee699)throw new Error(_0x521686['ziMXt']);const _0x3f38d9=_0x521686[_0x26f5e6(0x1a7)](getApiBaseUrl),_0xf2bb8c=await fetch(_0x3f38d9+_0x26f5e6(0x199)+_0x312ba8+'/sessions',{'method':'GET','headers':{'Authorization':_0x26f5e6(0x19d)+_0x2ee699}});if(!_0xf2bb8c['ok']){const _0x45170a=await _0xf2bb8c['text']();throw new Error('Failed\x20to\x20list\x20sessions:\x20'+_0x45170a);}return _0xf2bb8c['json']();}export async function startSession(_0x4d2351,_0x1055db){const _0xe6beee=_0x4b6c,_0x31ab43={'BlRtc':_0xe6beee(0x18e),'MnPrL':function(_0xff065a){return _0xff065a();},'nYXbn':function(_0x244266,_0x4b4459,_0xeb8456){return _0x244266(_0x4b4459,_0xeb8456);}},_0x170699=await getToken();if(!_0x170699)throw new Error(_0x31ab43['BlRtc']);const _0x23c1be=_0x31ab43[_0xe6beee(0x195)](getApiBaseUrl),_0xb718ee=await _0x31ab43['nYXbn'](fetch,_0x23c1be+'/api/v1/mcp/features/'+_0x4d2351+'/sessions/'+_0x1055db+_0xe6beee(0x18f),{'method':_0xe6beee(0x18c),'headers':{'Authorization':'Bearer\x20'+_0x170699}});if(!_0xb718ee['ok']){const _0x22b02f=await _0xb718ee['text']();throw new Error(_0xe6beee(0x184)+_0x22b02f);}return _0xb718ee['json']();}function _0x4b6c(_0x3541da,_0x3abd6f){_0x3541da=_0x3541da-0x159;const _0x56d91f=_0x56d9();let _0x4b6cf1=_0x56d91f[_0x3541da];return _0x4b6cf1;}export async function concludeSession(_0x1451e8,_0x4c81af){const _0x129f18=_0x4b6c,_0x4cc71c={'WXecj':function(_0x294afa){return _0x294afa();},'hzjoU':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x886c73=await _0x4cc71c[_0x129f18(0x1a5)](getToken);if(!_0x886c73)throw new Error(_0x4cc71c[_0x129f18(0x15c)]);const _0x35796b=getApiBaseUrl(),_0x4bb355=await fetch(_0x35796b+'/api/v1/mcp/features/'+_0x1451e8+'/sessions/'+_0x4c81af+_0x129f18(0x15a),{'method':_0x129f18(0x18c),'headers':{'Authorization':'Bearer\x20'+_0x886c73}});if(!_0x4bb355['ok']){const _0x56b6d1=await _0x4bb355['text']();throw new Error(_0x129f18(0x19b)+_0x56b6d1);}return _0x4bb355[_0x129f18(0x159)]();}export async function getActionItems(_0x42a856){const _0x51eec1=_0x4b6c,_0x419b24={'ZRWrx':_0x51eec1(0x18e),'vhGsB':_0x51eec1(0x1a9)},_0x127a3a=await getToken();if(!_0x127a3a)throw new Error(_0x419b24['ZRWrx']);const _0x571451=getApiBaseUrl(),_0x54eed7=await fetch(_0x571451+_0x51eec1(0x199)+_0x42a856+'/action-items',{'method':_0x419b24[_0x51eec1(0x1ab)],'headers':{'Authorization':'Bearer\x20'+_0x127a3a}});if(!_0x54eed7['ok']){const _0x597df9=await _0x54eed7['text']();throw new Error(_0x51eec1(0x163)+_0x597df9);}return _0x54eed7[_0x51eec1(0x159)]();}export async function getItemFeedback(_0x54ee5a,_0x1c257b){const _0xa005dc=_0x4b6c,_0x317867={'qLECS':function(_0x210000){return _0x210000();},'OIuRY':function(_0x501f60,_0x5d412b,_0x2b3e6e){return _0x501f60(_0x5d412b,_0x2b3e6e);}},_0x3b76a9=await getToken();if(!_0x3b76a9)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x124e4e=_0x317867['qLECS'](getApiBaseUrl),_0x5a3eaf=await _0x317867['OIuRY'](fetch,_0x124e4e+'/api/v1/mcp/features/'+_0x54ee5a+_0xa005dc(0x1aa)+_0x1c257b+_0xa005dc(0x1a3),{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x3b76a9}});if(!_0x5a3eaf['ok']){const _0x41fccc=await _0x5a3eaf[_0xa005dc(0x162)]();throw new Error('Failed\x20to\x20get\x20item\x20feedback:\x20'+_0x41fccc);}return _0x5a3eaf[_0xa005dc(0x159)]();}export async function markCommentsAddressed(_0x21fb88,_0x248d32,_0x151d63){const _0x300288=_0x4b6c,_0x257092={'MeJan':function(_0x1d6a23){return _0x1d6a23();},'Ocvuh':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','aKqcp':function(_0x17d284){return _0x17d284();},'xTFzW':_0x300288(0x18c)},_0x4a1b76=await _0x257092[_0x300288(0x16f)](getToken);if(!_0x4a1b76)throw new Error(_0x257092[_0x300288(0x18a)]);const _0x4c1c6a=_0x257092[_0x300288(0x182)](getApiBaseUrl),_0x43befb=await fetch(_0x4c1c6a+'/api/v1/mcp/features/'+_0x21fb88+'/comments/address',{'method':_0x257092['xTFzW'],'headers':{'Authorization':'Bearer\x20'+_0x4a1b76,'Content-Type':_0x300288(0x1a2)},'body':JSON['stringify']({'checklistItemId':_0x248d32,'commentIds':_0x151d63})});if(!_0x43befb['ok']){const _0x5291e9=await _0x43befb[_0x300288(0x162)]();throw new Error('Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20'+_0x5291e9);}}export async function softDeleteFeature(_0x5dcb1a){const _0x407449=_0x4b6c,_0x3198b6={'COiRj':_0x407449(0x18e),'RzFcl':function(_0x4091f5){return _0x4091f5();},'ijxBK':_0x407449(0x194)},_0x20793a=await getToken();if(!_0x20793a)throw new Error(_0x3198b6[_0x407449(0x191)]);const _0x61de60=_0x3198b6['RzFcl'](getApiBaseUrl),_0xcfb080=await fetch(_0x61de60+_0x407449(0x199)+_0x5dcb1a,{'method':_0x3198b6[_0x407449(0x166)],'headers':{'Authorization':_0x407449(0x19d)+_0x20793a}});if(!_0xcfb080['ok']){const _0x59f409=await _0xcfb080[_0x407449(0x162)]();throw new Error(_0x407449(0x168)+_0x59f409);}}export async function restoreFeature(_0x2d28ea){const _0x4c9bc7=_0x4b6c,_0x2426b9={'QuSyE':_0x4c9bc7(0x18c)},_0x2fe32b=await getToken();if(!_0x2fe32b)throw new Error(_0x4c9bc7(0x18e));const _0x221394=getApiBaseUrl(),_0x397b2b=await fetch(_0x221394+_0x4c9bc7(0x199)+_0x2d28ea+'/restore',{'method':_0x2426b9['QuSyE'],'headers':{'Authorization':_0x4c9bc7(0x19d)+_0x2fe32b}});if(!_0x397b2b['ok']){const _0x378125=await _0x397b2b['text']();throw new Error(_0x4c9bc7(0x198)+_0x378125);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x442faa=_0x4a14;(function(_0x40394e,_0x5ce236){const _0xaee6f9=_0x4a14,_0x172418=_0x40394e();while(!![]){try{const _0x25fa66=parseInt(_0xaee6f9(0x9e))/0x1*(parseInt(_0xaee6f9(0xa0))/0x2)+parseInt(_0xaee6f9(0xcd))/0x3+-parseInt(_0xaee6f9(0xcf))/0x4*(-parseInt(_0xaee6f9(0xb3))/0x5)+parseInt(_0xaee6f9(0xa9))/0x6*(-parseInt(_0xaee6f9(0x93))/0x7)+-parseInt(_0xaee6f9(0xab))/0x8+parseInt(_0xaee6f9(0x9b))/0x9+-parseInt(_0xaee6f9(0xb9))/0xa;if(_0x25fa66===_0x5ce236)break;else _0x172418['push'](_0x172418['shift']());}catch(_0x5c702f){_0x172418['push'](_0x172418['shift']());}}}(_0x48e7,0xbdf33));import{readFileSync,writeFileSync}from'fs';const ID_SEGMENT=0x18538067,ID_INFO=0x1549a966,ID_TIMESTAMP_SCALE=0x2ad7b1,ID_DURATION=0x4489,ID_VOID=0xec,ID_CLUSTER=0x1f43b675,ID_TIMESTAMP=0xe7,ID_SIMPLE_BLOCK=0xa3;function readVint(_0x13f810,_0x31719a){const _0x43b55=_0x4a14,_0x22be56={'MiRkm':function(_0xb703be,_0x4fd477){return _0xb703be<=_0x4fd477;},'rPbcH':function(_0x3e070c,_0x2ecfa7){return _0x3e070c&_0x2ecfa7;},'bissa':function(_0x40fdba,_0x4816d2){return _0x40fdba>_0x4816d2;},'XqrFT':function(_0x5981a1,_0x50987a){return _0x5981a1+_0x50987a;},'psEFh':function(_0x2bff40,_0x5238ef){return _0x2bff40-_0x5238ef;},'SyHsm':function(_0x4a2d9c,_0x3db3a1){return _0x4a2d9c<_0x3db3a1;},'yOSoy':function(_0x5a7b14,_0x35df9a){return _0x5a7b14*_0x35df9a;}};if(_0x31719a>=_0x13f810['length'])return[0x0,0x0];const _0xa9e707=_0x13f810[_0x31719a];let _0x1a9fbc=0x1,_0x21db51=0x80;while(_0x22be56[_0x43b55(0xbb)](_0x1a9fbc,0x8)&&!_0x22be56[_0x43b55(0xca)](_0xa9e707,_0x21db51)){_0x1a9fbc++,_0x21db51>>=0x1;}if(_0x22be56['bissa'](_0x22be56[_0x43b55(0xce)](_0x31719a,_0x1a9fbc),_0x13f810[_0x43b55(0xc2)]))return[0x0,0x0];let _0x588934=_0xa9e707&_0x22be56['psEFh'](_0x21db51,0x1);for(let _0x45fcc3=0x1;_0x22be56['SyHsm'](_0x45fcc3,_0x1a9fbc);_0x45fcc3++){_0x588934=_0x22be56['yOSoy'](_0x588934,0x100)+_0x13f810[_0x31719a+_0x45fcc3];}return[_0x588934,_0x1a9fbc];}function readId(_0x305d9d,_0x1e035b){const _0x17621a=_0x4a14,_0x23cb9f={'aNOag':function(_0x12419a,_0x3f4c75){return _0x12419a>=_0x3f4c75;},'nqcFi':function(_0x1e6dc3,_0x4a5d3b){return _0x1e6dc3>=_0x4a5d3b;},'DvZoP':function(_0x4f2f77,_0x566876){return _0x4f2f77+_0x566876;},'sSXcw':function(_0x1773b7,_0x37d244){return _0x1773b7*_0x37d244;}};if(_0x1e035b>=_0x305d9d[_0x17621a(0xc2)])return[0x0,0x0];const _0x4f85d9=_0x305d9d[_0x1e035b];let _0x506735;if(_0x23cb9f[_0x17621a(0x9c)](_0x4f85d9,0x80))_0x506735=0x1;else{if(_0x23cb9f[_0x17621a(0xae)](_0x4f85d9,0x40))_0x506735=0x2;else{if(_0x4f85d9>=0x20)_0x506735=0x3;else{if(_0x4f85d9>=0x10)_0x506735=0x4;else return[_0x4f85d9,0x1];}}}if(_0x1e035b+_0x506735>_0x305d9d['length'])return[0x0,0x0];let _0x4adab7=0x0;for(let _0x5df330=0x0;_0x5df330<_0x506735;_0x5df330++){_0x4adab7=_0x23cb9f['DvZoP'](_0x23cb9f['sSXcw'](_0x4adab7,0x100),_0x305d9d[_0x23cb9f['DvZoP'](_0x1e035b,_0x5df330)]);}return[_0x4adab7,_0x506735];}function readUint(_0x3004ac,_0x79daef,_0x4233e7){const _0x2cccbd=_0x4a14,_0x41da60={'EHcGS':function(_0xa0ffb0,_0x27cf89){return _0xa0ffb0*_0x27cf89;},'vtdcI':function(_0x316f9c,_0x299478){return _0x316f9c+_0x299478;}};let _0x51fbb7=0x0;for(let _0x4e3552=0x0;_0x4e3552<_0x4233e7;_0x4e3552++){_0x51fbb7=_0x41da60[_0x2cccbd(0xb8)](_0x51fbb7,0x100)+_0x3004ac[_0x41da60[_0x2cccbd(0xaa)](_0x79daef,_0x4e3552)];}return _0x51fbb7;}function isUnknownSize(_0x438a70,_0x3b3342){const _0x3bc40f=_0x4a14,_0xe6a8be={'wWzRY':function(_0x145f2f,_0x2d029c){return _0x145f2f===_0x2d029c;},'qVQDr':function(_0x17d35e,_0x43f1a0){return _0x17d35e-_0x43f1a0;}};return _0xe6a8be['wWzRY'](_0x438a70,_0xe6a8be['qVQDr'](Math[_0x3bc40f(0xcc)](0x2,0x7*_0x3b3342),0x1));}function writeId(_0xe6bf96){const _0x1bf844=_0x4a14,_0x293f8d={'ybuwt':function(_0x17d5d1,_0x2ad039){return _0x17d5d1<=_0x2ad039;},'gcISx':function(_0x65600,_0x4e5fa6){return _0x65600&_0x4e5fa6;},'tChFZ':function(_0x4741bc,_0x3255a6){return _0x4741bc&_0x3255a6;},'XFIKc':function(_0x22e656,_0x54268c){return _0x22e656>>_0x54268c;},'EvfDF':function(_0x1fafba,_0x47ed47){return _0x1fafba&_0x47ed47;}};if(_0xe6bf96<=0xff)return Buffer[_0x1bf844(0xa1)]([_0xe6bf96]);if(_0x293f8d[_0x1bf844(0xad)](_0xe6bf96,0xffff))return Buffer[_0x1bf844(0xa1)]([_0xe6bf96>>0x8&0xff,_0x293f8d[_0x1bf844(0xb4)](_0xe6bf96,0xff)]);if(_0x293f8d[_0x1bf844(0xad)](_0xe6bf96,0xffffff))return Buffer[_0x1bf844(0xa1)]([_0x293f8d['gcISx'](_0xe6bf96>>0x10,0xff),_0x293f8d['gcISx'](_0xe6bf96>>0x8,0xff),_0x293f8d['tChFZ'](_0xe6bf96,0xff)]);return Buffer[_0x1bf844(0xa1)]([_0x293f8d[_0x1bf844(0xa7)](_0xe6bf96,0x18)&0xff,_0x293f8d[_0x1bf844(0x94)](_0xe6bf96>>0x10,0xff),_0x293f8d['XFIKc'](_0xe6bf96,0x8)&0xff,_0x293f8d['EvfDF'](_0xe6bf96,0xff)]);}function writeVint(_0x4a0111,_0x4935ea){const _0x4c3e72=_0x4a14,_0x452dfe={'fRQEG':function(_0x1a9992,_0x3db9a8){return _0x1a9992||_0x3db9a8;},'PnsSr':function(_0x174b9e,_0x3d2a76){return _0x174b9e<_0x3d2a76;},'YtgJb':function(_0x3acaa2,_0x3ee1b3){return _0x3acaa2*_0x3ee1b3;},'JfcWo':function(_0x1a6826,_0x3fc20c){return _0x1a6826-_0x3fc20c;},'Ategm':function(_0x214d31,_0x5a64c6){return _0x214d31<<_0x5a64c6;}};let _0x1ed4da=_0x452dfe[_0x4c3e72(0xa3)](_0x4935ea,0x1);while(_0x452dfe[_0x4c3e72(0xba)](Math[_0x4c3e72(0xcc)](0x2,_0x452dfe[_0x4c3e72(0xa4)](0x7,_0x1ed4da))-0x2,_0x4a0111))_0x1ed4da++;const _0x2d3a4b=Buffer['alloc'](_0x1ed4da);for(let _0x27198f=_0x452dfe['JfcWo'](_0x1ed4da,0x1);_0x27198f>=0x0;_0x27198f--){_0x2d3a4b[_0x27198f]=_0x4a0111&0xff,_0x4a0111=Math['floor'](_0x4a0111/0x100);}return _0x2d3a4b[0x0]|=_0x452dfe['Ategm'](0x1,0x8-_0x1ed4da),_0x2d3a4b;}function writeFloat64(_0x1af88d){const _0x1af1aa=_0x4a14,_0x17dde5=Buffer['alloc'](0x8);return _0x17dde5[_0x1af1aa(0xc6)](_0x1af88d,0x0),_0x17dde5;}function writeVoid(_0xedf4e8){const _0x1ceb35=_0x4a14,_0x430657={'pujnj':function(_0x17fe6e,_0x457047){return _0x17fe6e<=_0x457047;},'OAocC':function(_0x165552,_0x300fc8){return _0x165552-_0x300fc8;},'RIKaW':function(_0x192f0b,_0x2f814a){return _0x192f0b>=_0x2f814a;},'XBwVD':function(_0x37fc0a,_0x96c892){return _0x37fc0a*_0x96c892;}};for(let _0x2a40d0=0x1;_0x430657[_0x1ceb35(0xd0)](_0x2a40d0,0x8);_0x2a40d0++){const _0x3d50a9=_0x430657['OAocC'](_0xedf4e8-0x1,_0x2a40d0);if(_0x430657[_0x1ceb35(0xaf)](_0x3d50a9,0x0)&&_0x430657['pujnj'](_0x3d50a9,Math['pow'](0x2,_0x430657[_0x1ceb35(0xc1)](0x7,_0x2a40d0))-0x2))return Buffer['concat']([Buffer['from']([ID_VOID]),writeVint(_0x3d50a9,_0x2a40d0),Buffer['alloc'](_0x3d50a9)]);}return Buffer[_0x1ceb35(0xc3)](0x0);}function findElement(_0x54155a,_0x1c81b6,_0x6c120c,_0xed0be7){const _0xa017d0=_0x4a14,_0x2494e7={'WcphD':function(_0x11dba7,_0x3fa8bf){return _0x11dba7<_0x3fa8bf;},'IxFIB':function(_0x5b638e,_0x537d9a,_0xc230f9){return _0x5b638e(_0x537d9a,_0xc230f9);},'EBeUU':function(_0x73e660,_0x33f3dd){return _0x73e660===_0x33f3dd;},'vzAjl':function(_0x2b0c1d,_0x56f639){return _0x2b0c1d+_0x56f639;}};let _0x56bccd=_0x1c81b6;while(_0x2494e7['WcphD'](_0x56bccd,_0x6c120c)){const [_0x9ed14a,_0x61a5fb]=_0x2494e7['IxFIB'](readId,_0x54155a,_0x56bccd),[_0x509e5f,_0x5533b1]=readVint(_0x54155a,_0x56bccd+_0x61a5fb);if(_0x2494e7['EBeUU'](_0x9ed14a,_0xed0be7))return{'offset':_0x56bccd,'idLen':_0x61a5fb,'sizeLen':_0x5533b1,'dataSize':_0x509e5f,'dataOffset':_0x2494e7['vzAjl'](_0x56bccd,_0x61a5fb)+_0x5533b1};if(isUnknownSize(_0x509e5f,_0x5533b1))break;_0x56bccd+=_0x2494e7[_0xa017d0(0xc4)](_0x2494e7[_0xa017d0(0xc4)](_0x61a5fb,_0x5533b1),_0x509e5f);}return null;}function computeDurationMs(_0x264cf0,_0x4d55ea){const _0x490afe=_0x4a14,_0x3eb6d8={'qsbuV':function(_0x791e31,_0x552340,_0x50baff){return _0x791e31(_0x552340,_0x50baff);},'VrOkq':function(_0x3fcba9,_0x4c339d){return _0x3fcba9!==_0x4c339d;},'uCQeU':function(_0x235d7e,_0x3d80a2){return _0x235d7e+_0x3d80a2;},'KvDPY':function(_0x221fc8,_0xe3a89){return _0x221fc8+_0xe3a89;},'YcnFv':function(_0x5e48f1,_0x43933d,_0x56737d){return _0x5e48f1(_0x43933d,_0x56737d);},'SQJzl':function(_0x162b11,_0x5c72b1){return _0x162b11<_0x5c72b1;},'MIhlY':function(_0x3b44a6,_0x36291a,_0x179ae6){return _0x3b44a6(_0x36291a,_0x179ae6);},'ZGVse':function(_0x3a46a3,_0x51dbe7){return _0x3a46a3+_0x51dbe7;},'wqfgq':function(_0x152799,_0x9fe9fe,_0x3e84c4){return _0x152799(_0x9fe9fe,_0x3e84c4);},'PBvyx':function(_0x1ad75e,_0x3e6ba3){return _0x1ad75e+_0x3e6ba3;},'iuPEp':function(_0x3782c1,_0x13aad4){return _0x3782c1===_0x13aad4;},'daWkc':function(_0x408a31,_0x5ad01e){return _0x408a31===_0x5ad01e;},'UrUwf':function(_0x2de88d,_0x340843,_0x21cc4b){return _0x2de88d(_0x340843,_0x21cc4b);},'eIPBo':function(_0x409671,_0x5b90ca){return _0x409671>_0x5b90ca;},'aAKeD':function(_0x3fdb69,_0x44daae){return _0x3fdb69+_0x44daae;}};let _0x33ec46=0x0;const _0xef4fec=Buffer[_0x490afe(0xa1)]([0x1f,0x43,0xb6,0x75]);let _0x43fce5=_0x264cf0['indexOf'](_0xef4fec);if(_0x43fce5===-0x1)return 0x0;while(_0x43fce5<_0x264cf0[_0x490afe(0xc2)]){const [_0x1aa008,_0x1e1504]=_0x3eb6d8['qsbuV'](readId,_0x264cf0,_0x43fce5);if(_0x3eb6d8[_0x490afe(0xb2)](_0x1aa008,ID_CLUSTER))break;const [_0x24f239,_0x235483]=readVint(_0x264cf0,_0x43fce5+_0x1e1504),_0x42a3ae=_0x3eb6d8['uCQeU'](_0x3eb6d8['KvDPY'](_0x43fce5,_0x1e1504),_0x235483),_0x1a74ec=_0x3eb6d8[_0x490afe(0x9a)](isUnknownSize,_0x24f239,_0x235483);let _0x5695e7;if(_0x1a74ec){let _0x53e56b=_0x42a3ae;while(_0x3eb6d8['SQJzl'](_0x53e56b,_0x264cf0['length']-0x4)){const [_0x560a7e,_0x175fec]=readId(_0x264cf0,_0x53e56b);if(_0x560a7e===ID_CLUSTER){_0x5695e7=_0x53e56b;break;}const [_0x409194,_0x5c890b]=_0x3eb6d8[_0x490afe(0x9f)](readVint,_0x264cf0,_0x3eb6d8['ZGVse'](_0x53e56b,_0x175fec));if(_0x3eb6d8['wqfgq'](isUnknownSize,_0x409194,_0x5c890b)){_0x5695e7=_0x264cf0[_0x490afe(0xc2)];break;}_0x53e56b+=_0x3eb6d8['PBvyx'](_0x175fec+_0x5c890b,_0x409194);}_0x5695e7??=_0x264cf0['length'];}else _0x5695e7=_0x42a3ae+_0x24f239;let _0x22c851=0x0,_0x12ef9a=_0x42a3ae;while(_0x3eb6d8['SQJzl'](_0x12ef9a,_0x5695e7)){const [_0x3df537,_0x1995d2]=_0x3eb6d8[_0x490afe(0x98)](readId,_0x264cf0,_0x12ef9a),[_0x5d9761,_0x53b576]=_0x3eb6d8[_0x490afe(0x98)](readVint,_0x264cf0,_0x3eb6d8[_0x490afe(0xc5)](_0x12ef9a,_0x1995d2));if(_0x3eb6d8[_0x490afe(0xbd)](_0x3df537,ID_TIMESTAMP))_0x22c851=readUint(_0x264cf0,_0x12ef9a+_0x1995d2+_0x53b576,_0x5d9761);else{if(_0x3eb6d8['daWkc'](_0x3df537,ID_SIMPLE_BLOCK)&&_0x5d9761>=0x4){const _0x506554=_0x3eb6d8['ZGVse'](_0x12ef9a,_0x1995d2)+_0x53b576,[,_0x1d1db4]=_0x3eb6d8['UrUwf'](readVint,_0x264cf0,_0x506554),_0xa01981=_0x264cf0['readInt16BE'](_0x506554+_0x1d1db4),_0x6d77=(_0x22c851+_0xa01981)*_0x4d55ea/0xf4240;_0x3eb6d8['eIPBo'](_0x6d77,_0x33ec46)&&(_0x33ec46=_0x6d77);}else{if(_0x3df537===ID_CLUSTER)break;}}if(isUnknownSize(_0x5d9761,_0x53b576))break;_0x12ef9a+=_0x3eb6d8[_0x490afe(0x99)](_0x3eb6d8['uCQeU'](_0x1995d2,_0x53b576),_0x5d9761);}_0x43fce5=_0x5695e7;}return _0x33ec46;}export function fixWebmDuration(_0x4f7736,_0x16df59){const _0x1e92e6=_0x4a14,_0x301a8c={'MWXil':function(_0x136e70,_0x5d5321){return _0x136e70(_0x5d5321);},'vcYUE':function(_0x8ee6e8,_0x57a1a5,_0x137e8a){return _0x8ee6e8(_0x57a1a5,_0x137e8a);},'kqllh':function(_0x3057d4,_0x1e0358){return _0x3057d4+_0x1e0358;},'NnYej':function(_0x26d3c8,_0x1c1046){return _0x26d3c8!==_0x1c1046;},'tAFjg':function(_0x54f2d8,_0x39e59c){return _0x54f2d8+_0x39e59c;},'MddgX':function(_0x2ddcbd,_0x1f5dfb,_0x10cc2d){return _0x2ddcbd(_0x1f5dfb,_0x10cc2d);},'BeSzv':function(_0x215147,_0x44b448){return _0x215147===_0x44b448;},'TIoKA':function(_0x811597,_0xa64b5b){return _0x811597+_0xa64b5b;},'HGNyF':function(_0x47d662,_0x475553,_0x25f68,_0x2eab8c,_0x469311){return _0x47d662(_0x475553,_0x25f68,_0x2eab8c,_0x469311);},'OANbB':function(_0x4ffe2f,_0x9148c2,_0x33ac05,_0x3c1cbe){return _0x4ffe2f(_0x9148c2,_0x33ac05,_0x3c1cbe);},'FPxeS':function(_0x13af03,_0x306416){return _0x13af03<=_0x306416;},'OQmJb':'Could\x20not\x20compute\x20duration','gHmyd':function(_0x4cc000,_0x28cace){return _0x4cc000/_0x28cace;},'pcwKK':function(_0x3f705c,_0x528ec4){return _0x3f705c(_0x528ec4);},'zceLF':function(_0x7146a2,_0x2f2be3){return _0x7146a2-_0x2f2be3;},'nVFuV':function(_0x382011,_0x23f494){return _0x382011<_0x23f494;},'LFHiM':function(_0x220039,_0x320f54,_0x469419,_0xcc20a,_0x5cd893,_0x4a43f3,_0x1865be){return _0x220039(_0x320f54,_0x469419,_0xcc20a,_0x5cd893,_0x4a43f3,_0x1865be);},'NSJKf':function(_0x4af0b2,_0x541b16,_0x4c5bdc){return _0x4af0b2(_0x541b16,_0x4c5bdc);},'ZeTHp':function(_0x1289c1,_0x4d474d,_0x4249ac,_0x3c98f7,_0x354c0d,_0xae3b13,_0x53f1b2){return _0x1289c1(_0x4d474d,_0x4249ac,_0x3c98f7,_0x354c0d,_0xae3b13,_0x53f1b2);}},_0x265baa=_0x301a8c[_0x1e92e6(0xc8)](readFileSync,_0x4f7736);let _0x330368=0x0;const [_0x3cea32,_0x55254d]=readId(_0x265baa,_0x330368),[_0x400c69,_0x1b27e5]=_0x301a8c[_0x1e92e6(0x96)](readVint,_0x265baa,_0x330368+_0x55254d);_0x330368+=_0x301a8c['kqllh'](_0x55254d,_0x1b27e5)+_0x400c69;const [_0x440913,_0x385763]=_0x301a8c['vcYUE'](readId,_0x265baa,_0x330368);if(_0x301a8c['NnYej'](_0x440913,ID_SEGMENT))return console[_0x1e92e6(0xb5)](_0x1e92e6(0xa6)),![];const [,_0x33ebd4]=readVint(_0x265baa,_0x330368+_0x385763),_0x595596=_0x301a8c[_0x1e92e6(0x91)](_0x301a8c[_0x1e92e6(0xbf)](_0x330368,_0x385763),_0x33ebd4);let _0x4d86f6=_0x595596;const _0x23fc4b=Math['min'](_0x265baa['length'],_0x301a8c[_0x1e92e6(0xbf)](_0x595596,0x2710));let _0x3d8c68=null,_0x1a4a19=null;while(_0x4d86f6<_0x23fc4b){const [_0x3fee8d,_0x322925]=_0x301a8c[_0x1e92e6(0x96)](readId,_0x265baa,_0x4d86f6),[_0x55030e,_0x597e08]=_0x301a8c['MddgX'](readVint,_0x265baa,_0x301a8c[_0x1e92e6(0x91)](_0x4d86f6,_0x322925));_0x3fee8d===ID_VOID&&!_0x3d8c68&&(_0x3d8c68={'offset':_0x4d86f6,'idLen':_0x322925,'sizeLen':_0x597e08,'dataSize':_0x55030e,'dataOffset':_0x301a8c[_0x1e92e6(0x91)](_0x4d86f6+_0x322925,_0x597e08)});if(_0x301a8c[_0x1e92e6(0x97)](_0x3fee8d,ID_INFO)){_0x1a4a19={'offset':_0x4d86f6,'idLen':_0x322925,'sizeLen':_0x597e08,'dataSize':_0x55030e,'dataOffset':_0x301a8c['tAFjg'](_0x4d86f6,_0x322925)+_0x597e08};break;}if(_0x301a8c[_0x1e92e6(0x97)](_0x3fee8d,ID_CLUSTER))break;if(_0x301a8c[_0x1e92e6(0xcb)](isUnknownSize,_0x55030e,_0x597e08))break;_0x4d86f6+=_0x301a8c['TIoKA'](_0x322925+_0x597e08,_0x55030e);}if(!_0x1a4a19)return console[_0x1e92e6(0xb5)]('Could\x20not\x20find\x20Info\x20element'),![];const _0x384d5e=findElement(_0x265baa,_0x1a4a19[_0x1e92e6(0xac)],_0x1a4a19[_0x1e92e6(0xac)]+_0x1a4a19['dataSize'],ID_DURATION);if(_0x384d5e)return![];const _0x12026b=_0x301a8c[_0x1e92e6(0xa2)](findElement,_0x265baa,_0x1a4a19[_0x1e92e6(0xac)],_0x301a8c['TIoKA'](_0x1a4a19[_0x1e92e6(0xac)],_0x1a4a19['dataSize']),ID_TIMESTAMP_SCALE);let _0x36dcb9=0xf4240;_0x12026b&&(_0x36dcb9=_0x301a8c[_0x1e92e6(0xc9)](readUint,_0x265baa,_0x12026b['dataOffset'],_0x12026b[_0x1e92e6(0xc7)]));const _0x2260a5=_0x301a8c[_0x1e92e6(0x96)](computeDurationMs,_0x265baa,_0x36dcb9);if(_0x301a8c['FPxeS'](_0x2260a5,0x0))return console[_0x1e92e6(0xb5)](_0x301a8c[_0x1e92e6(0xc0)]),![];const _0x4c0358=_0x301a8c['gHmyd'](_0x2260a5*0xf4240,_0x36dcb9),_0x35457c=Buffer[_0x1e92e6(0xb1)]([writeId(ID_DURATION),writeVint(0x8),_0x301a8c[_0x1e92e6(0x90)](writeFloat64,_0x4c0358)]),_0x42b13e=_0x35457c[_0x1e92e6(0xc2)];if(!_0x3d8c68||_0x3d8c68['offset']<_0x1a4a19[_0x1e92e6(0xa5)]){if(_0x3d8c68){const _0x2d866e=_0x301a8c[_0x1e92e6(0x91)](_0x3d8c68[_0x1e92e6(0x92)],_0x3d8c68[_0x1e92e6(0x9d)])+_0x3d8c68['dataSize'],_0x53af51=_0x301a8c['zceLF'](_0x2d866e,_0x42b13e);if(_0x301a8c[_0x1e92e6(0xbe)](_0x53af51,0x2))return _0x301a8c[_0x1e92e6(0xb6)](rewriteFile,_0x265baa,_0x1a4a19,_0x35457c,_0x36dcb9,_0x2260a5,_0x16df59);const _0x9cb54f=_0x1a4a19[_0x1e92e6(0xc7)]+_0x42b13e,_0x4973ca=Buffer[_0x1e92e6(0xb1)]([_0x301a8c['pcwKK'](writeId,ID_INFO),_0x301a8c[_0x1e92e6(0xb7)](writeVint,_0x9cb54f,_0x1a4a19['sizeLen'])]),_0x436c1d=_0x265baa[_0x1e92e6(0xbc)](_0x1a4a19['dataOffset'],_0x1a4a19[_0x1e92e6(0xac)]+_0x1a4a19['dataSize']),_0x4d3d72=_0x301a8c[_0x1e92e6(0x90)](writeVoid,_0x53af51),_0x2345ce=_0x265baa[_0x1e92e6(0xbc)](0x0,_0x3d8c68[_0x1e92e6(0xa5)]),_0x3485ce=_0x265baa[_0x1e92e6(0xbc)](_0x1a4a19['dataOffset']+_0x1a4a19[_0x1e92e6(0xc7)]);return writeFileSync(_0x16df59,Buffer['concat']([_0x2345ce,_0x4d3d72,_0x4973ca,_0x436c1d,_0x35457c,_0x3485ce])),!![];}}return _0x301a8c['ZeTHp'](rewriteFile,_0x265baa,_0x1a4a19,_0x35457c,_0x36dcb9,_0x2260a5,_0x16df59);}function rewriteFile(_0x4614f0,_0x4d19b4,_0x46cdf3,_0x562d99,_0xcee93d,_0xeb118b){const _0x4678aa=_0x4a14,_0x59cab5={'AIbXT':function(_0x5e9039,_0x5c8eb7){return _0x5e9039+_0x5c8eb7;}},_0x459e2e=_0x4d19b4[_0x4678aa(0xc7)]+_0x46cdf3['length'],_0x4cdc5e=Buffer[_0x4678aa(0xb1)]([writeId(ID_INFO),writeVint(_0x459e2e)]),_0x586ebc=_0x4d19b4['idLen']+_0x4d19b4[_0x4678aa(0x9d)],_0x5ee5d4=_0x4614f0['slice'](0x0,_0x4d19b4['offset']),_0x26850c=_0x4614f0[_0x4678aa(0xbc)](_0x4d19b4['dataOffset'],_0x4d19b4[_0x4678aa(0xac)]+_0x4d19b4['dataSize']),_0x1ff4bc=_0x4614f0[_0x4678aa(0xbc)](_0x59cab5['AIbXT'](_0x4d19b4['offset'],_0x586ebc)+_0x4d19b4[_0x4678aa(0xc7)]);return writeFileSync(_0xeb118b,Buffer['concat']([_0x5ee5d4,_0x4cdc5e,_0x26850c,_0x46cdf3,_0x1ff4bc])),!![];}function _0x4a14(_0x1d6d31,_0x52de64){_0x1d6d31=_0x1d6d31-0x8f;const _0x48e7b4=_0x48e7();let _0x4a1435=_0x48e7b4[_0x1d6d31];return _0x4a1435;}function _0x48e7(){const _0x14f678=['File\x20already\x20has\x20duration\x20or\x20could\x20not\x20be\x20fixed.','pcwKK','kqllh','idLen','7fQUYPk','tChFZ','log','vcYUE','BeSzv','wqfgq','aAKeD','YcnFv','13190832tTzoGU','aNOag','sizeLen','153341oohFfD','MIhlY','2EPTBCn','from','HGNyF','fRQEG','YtgJb','offset','Not\x20a\x20valid\x20WebM\x20file:\x20missing\x20Segment','XFIKc','exit','1517268nEPTuU','vtdcI','2859816JNXLEX','dataOffset','ybuwt','nqcFi','RIKaW','argv','concat','VrOkq','1185hVwfMe','gcISx','error','LFHiM','NSJKf','EHcGS','9831950wCxalN','PnsSr','MiRkm','slice','iuPEp','nVFuV','tAFjg','OQmJb','XBwVD','length','alloc','vzAjl','uCQeU','writeDoubleBE','dataSize','MWXil','OANbB','rPbcH','MddgX','pow','966612zwrzOa','XqrFT','7264QhuWVV','pujnj'];_0x48e7=function(){return _0x14f678;};return _0x48e7();}if(process[_0x442faa(0xb0)][0x1]?.['endsWith']('fixWebmDuration.ts')||process[_0x442faa(0xb0)][0x1]?.['endsWith']('fixWebmDuration.js')){const input=process[_0x442faa(0xb0)][0x2],output=process['argv'][0x3];(!input||!output)&&(console['error']('Usage:\x20fixWebmDuration\x20<input.webm>\x20<output.webm>'),process[_0x442faa(0xa8)](0x1));const fixed=fixWebmDuration(input,output);fixed?console[_0x442faa(0x95)]('Fixed:\x20'+output):console['log'](_0x442faa(0x8f));}
|
|
1
|
+
const _0x5df0e3=_0x13a1;(function(_0x359f07,_0x2979fd){const _0x187a12=_0x13a1,_0xc1ae3e=_0x359f07();while(!![]){try{const _0x9e16b8=-parseInt(_0x187a12(0x172))/0x1+parseInt(_0x187a12(0x184))/0x2+parseInt(_0x187a12(0x180))/0x3+parseInt(_0x187a12(0x15a))/0x4*(parseInt(_0x187a12(0x165))/0x5)+-parseInt(_0x187a12(0x158))/0x6+-parseInt(_0x187a12(0x163))/0x7+parseInt(_0x187a12(0x171))/0x8;if(_0x9e16b8===_0x2979fd)break;else _0xc1ae3e['push'](_0xc1ae3e['shift']());}catch(_0x53c387){_0xc1ae3e['push'](_0xc1ae3e['shift']());}}}(_0x5d67,0x84651));import{readFileSync,writeFileSync}from'fs';const ID_SEGMENT=0x18538067,ID_INFO=0x1549a966,ID_TIMESTAMP_SCALE=0x2ad7b1,ID_DURATION=0x4489,ID_VOID=0xec,ID_CLUSTER=0x1f43b675,ID_TIMESTAMP=0xe7,ID_SIMPLE_BLOCK=0xa3;function readVint(_0x38b77d,_0x1ffe77){const _0xb28b7d=_0x13a1,_0x374062={'REXHh':function(_0x3a6f88,_0x4021d8){return _0x3a6f88>=_0x4021d8;},'fWzhW':function(_0xf66f9a,_0x16f20b){return _0xf66f9a>_0x16f20b;},'bNqMo':function(_0x4c2ac4,_0x34db12){return _0x4c2ac4+_0x34db12;},'AdsPs':function(_0xfdbbdf,_0x49a923){return _0xfdbbdf-_0x49a923;},'eCTPx':function(_0x47d8a8,_0x1f5f55){return _0x47d8a8<_0x1f5f55;},'duwOt':function(_0x586bca,_0x302901){return _0x586bca+_0x302901;}};if(_0x374062[_0xb28b7d(0x178)](_0x1ffe77,_0x38b77d[_0xb28b7d(0x16d)]))return[0x0,0x0];const _0x3e6817=_0x38b77d[_0x1ffe77];let _0x29361e=0x1,_0x3c1700=0x80;while(_0x29361e<=0x8&&!(_0x3e6817&_0x3c1700)){_0x29361e++,_0x3c1700>>=0x1;}if(_0x374062['fWzhW'](_0x374062[_0xb28b7d(0x15f)](_0x1ffe77,_0x29361e),_0x38b77d[_0xb28b7d(0x16d)]))return[0x0,0x0];let _0x50bbd3=_0x3e6817&_0x374062['AdsPs'](_0x3c1700,0x1);for(let _0x3d6e96=0x1;_0x374062[_0xb28b7d(0x18b)](_0x3d6e96,_0x29361e);_0x3d6e96++){_0x50bbd3=_0x374062[_0xb28b7d(0x16f)](_0x50bbd3*0x100,_0x38b77d[_0x1ffe77+_0x3d6e96]);}return[_0x50bbd3,_0x29361e];}function readId(_0x42980f,_0x1b4b6e){const _0x310edc=_0x13a1,_0x5234e5={'pyADO':function(_0x239b53,_0x2393be){return _0x239b53>=_0x2393be;},'fDCvY':function(_0xba5477,_0x2005e3){return _0xba5477>=_0x2005e3;},'NtHfh':function(_0x489fdc,_0x2a0e98){return _0x489fdc<_0x2a0e98;},'HQTEI':function(_0x43d73f,_0x4cd4ae){return _0x43d73f+_0x4cd4ae;}};if(_0x1b4b6e>=_0x42980f[_0x310edc(0x16d)])return[0x0,0x0];const _0x176e94=_0x42980f[_0x1b4b6e];let _0x300d37;if(_0x176e94>=0x80)_0x300d37=0x1;else{if(_0x5234e5['pyADO'](_0x176e94,0x40))_0x300d37=0x2;else{if(_0x176e94>=0x20)_0x300d37=0x3;else{if(_0x5234e5[_0x310edc(0x173)](_0x176e94,0x10))_0x300d37=0x4;else return[_0x176e94,0x1];}}}if(_0x1b4b6e+_0x300d37>_0x42980f[_0x310edc(0x16d)])return[0x0,0x0];let _0xf0098=0x0;for(let _0x1cd435=0x0;_0x5234e5['NtHfh'](_0x1cd435,_0x300d37);_0x1cd435++){_0xf0098=_0xf0098*0x100+_0x42980f[_0x5234e5[_0x310edc(0x160)](_0x1b4b6e,_0x1cd435)];}return[_0xf0098,_0x300d37];}function readUint(_0x4f9734,_0x4b065f,_0x5dbb24){const _0x3d5bbc={'EkYat':function(_0x35c6b4,_0x23629b){return _0x35c6b4+_0x23629b;}};let _0x197dcc=0x0;for(let _0x149cea=0x0;_0x149cea<_0x5dbb24;_0x149cea++){_0x197dcc=_0x3d5bbc['EkYat'](_0x197dcc*0x100,_0x4f9734[_0x4b065f+_0x149cea]);}return _0x197dcc;}function isUnknownSize(_0x4a6fb1,_0x3c6679){const _0x597a68={'chLYk':function(_0x2f33ac,_0x156c67){return _0x2f33ac*_0x156c67;}};return _0x4a6fb1===Math['pow'](0x2,_0x597a68['chLYk'](0x7,_0x3c6679))-0x1;}function writeId(_0x5a40bc){const _0x142d73=_0x13a1,_0x229075={'LpdTl':function(_0x1a868f,_0x7a17f1){return _0x1a868f<=_0x7a17f1;},'AQQNy':function(_0x3e3376,_0x514af0){return _0x3e3376&_0x514af0;},'falPg':function(_0x3a3d4,_0x1618df){return _0x3a3d4>>_0x1618df;},'szFzu':function(_0x8bb3e7,_0x4bc0b5){return _0x8bb3e7>>_0x4bc0b5;},'bsbyp':function(_0x36e541,_0x17a335){return _0x36e541&_0x17a335;}};if(_0x229075[_0x142d73(0x155)](_0x5a40bc,0xff))return Buffer['from']([_0x5a40bc]);if(_0x5a40bc<=0xffff)return Buffer['from']([_0x229075['AQQNy'](_0x5a40bc>>0x8,0xff),_0x5a40bc&0xff]);if(_0x5a40bc<=0xffffff)return Buffer['from']([_0x229075['falPg'](_0x5a40bc,0x10)&0xff,_0x229075[_0x142d73(0x182)](_0x5a40bc,0x8)&0xff,_0x229075[_0x142d73(0x16b)](_0x5a40bc,0xff)]);return Buffer['from']([_0x229075['AQQNy'](_0x229075['falPg'](_0x5a40bc,0x18),0xff),_0x5a40bc>>0x10&0xff,_0x229075[_0x142d73(0x18f)](_0x229075[_0x142d73(0x18e)](_0x5a40bc,0x8),0xff),_0x229075['AQQNy'](_0x5a40bc,0xff)]);}function writeVint(_0x565638,_0x5eb8b0){const _0x4611d3=_0x13a1,_0x440ca8={'ajvZb':function(_0x3f9e86,_0xf29bc8){return _0x3f9e86<_0xf29bc8;},'GILro':function(_0x1d0e85,_0x9d77d){return _0x1d0e85*_0x9d77d;},'RrpbA':function(_0x471cec,_0x24dd7c){return _0x471cec-_0x24dd7c;}};let _0x3cb771=_0x5eb8b0||0x1;while(_0x440ca8[_0x4611d3(0x15d)](Math[_0x4611d3(0x18c)](0x2,_0x440ca8[_0x4611d3(0x154)](0x7,_0x3cb771))-0x2,_0x565638))_0x3cb771++;const _0x4dfa6d=Buffer[_0x4611d3(0x16e)](_0x3cb771);for(let _0x2b6720=_0x440ca8[_0x4611d3(0x167)](_0x3cb771,0x1);_0x2b6720>=0x0;_0x2b6720--){_0x4dfa6d[_0x2b6720]=_0x565638&0xff,_0x565638=Math['floor'](_0x565638/0x100);}return _0x4dfa6d[0x0]|=0x1<<0x8-_0x3cb771,_0x4dfa6d;}function _0x5d67(){const _0xab52b8=['dataSize','2256224VPUxmj','CTanl','fixWebmDuration.ts','ajvZb','ontvi','bNqMo','HQTEI','XyiCM','from','4836552dktosR','nWQpb','5IAzrOS','mqWIW','RrpbA','concat','Tnbng','writeDoubleBE','AQQNy','HQwDM','length','alloc','duwOt','exit','10097304WbKUGD','86549clNBKd','fDCvY','uvSaQ','Could\x20not\x20find\x20Info\x20element','offset','NqQaU','REXHh','fixWebmDuration.js','Dvlau','dataOffset','JELwW','lctjc','VGtQy','sizeLen','561120NDaqVD','ngCIB','szFzu','readInt16BE','564612cBelVz','idLen','vYniR','ktMKn','yVAsZ','slice','error','eCTPx','pow','jIISB','falPg','bsbyp','argv','UhkgU','gMSQC','Usage:\x20fixWebmDuration\x20<input.webm>\x20<output.webm>','GILro','LpdTl','dAEip','kdBYH','5854746ulLwwo'];_0x5d67=function(){return _0xab52b8;};return _0x5d67();}function writeFloat64(_0xa83799){const _0x4b9b2b=_0x13a1,_0x3c2f70=Buffer[_0x4b9b2b(0x16e)](0x8);return _0x3c2f70[_0x4b9b2b(0x16a)](_0xa83799,0x0),_0x3c2f70;}function writeVoid(_0x31066c){const _0xd96c68=_0x13a1,_0x22c429={'nWQpb':function(_0x2fe8f7,_0x655fc9){return _0x2fe8f7-_0x655fc9;},'LaYBH':function(_0x407842,_0x465bc2){return _0x407842>=_0x465bc2;},'ontvi':function(_0x4a5aca,_0x3932b3){return _0x4a5aca*_0x3932b3;}};for(let _0x2ab285=0x1;_0x2ab285<=0x8;_0x2ab285++){const _0x578342=_0x22c429[_0xd96c68(0x164)](_0x31066c-0x1,_0x2ab285);if(_0x22c429['LaYBH'](_0x578342,0x0)&&_0x578342<=Math[_0xd96c68(0x18c)](0x2,_0x22c429[_0xd96c68(0x15e)](0x7,_0x2ab285))-0x2)return Buffer['concat']([Buffer[_0xd96c68(0x162)]([ID_VOID]),writeVint(_0x578342,_0x2ab285),Buffer['alloc'](_0x578342)]);}return Buffer['alloc'](0x0);}function findElement(_0x462505,_0x3f4a50,_0x1b739a,_0x44ae50){const _0xf1032=_0x13a1,_0x5ee551={'XyiCM':function(_0x3203b8,_0x38b76b){return _0x3203b8+_0x38b76b;},'yVAsZ':function(_0x2100d5,_0x265400){return _0x2100d5===_0x265400;},'Dvlau':function(_0x471a93,_0x2efd02){return _0x471a93+_0x2efd02;},'XZlDa':function(_0x1ee869,_0x36436b){return _0x1ee869+_0x36436b;}};let _0x42599d=_0x3f4a50;while(_0x42599d<_0x1b739a){const [_0x3e971b,_0x1c09c8]=readId(_0x462505,_0x42599d),[_0x3d1452,_0x3b784c]=readVint(_0x462505,_0x5ee551[_0xf1032(0x161)](_0x42599d,_0x1c09c8));if(_0x5ee551[_0xf1032(0x188)](_0x3e971b,_0x44ae50))return{'offset':_0x42599d,'idLen':_0x1c09c8,'sizeLen':_0x3b784c,'dataSize':_0x3d1452,'dataOffset':_0x5ee551[_0xf1032(0x17a)](_0x5ee551[_0xf1032(0x17a)](_0x42599d,_0x1c09c8),_0x3b784c)};if(isUnknownSize(_0x3d1452,_0x3b784c))break;_0x42599d+=_0x5ee551['XZlDa'](_0x1c09c8+_0x3b784c,_0x3d1452);}return null;}function computeDurationMs(_0x25483a,_0x52b60f){const _0x2c5832=_0x13a1,_0x4bad21={'JELwW':function(_0x3e7a44,_0x2cbe8f){return _0x3e7a44===_0x2cbe8f;},'dYHvB':function(_0x2a4cc4,_0xb80a3a){return _0x2a4cc4<_0xb80a3a;},'uRJZk':function(_0x496ad8,_0x3daffa,_0x529a8a){return _0x496ad8(_0x3daffa,_0x529a8a);},'ktMKn':function(_0x2d0028,_0x580354){return _0x2d0028+_0x580354;},'mqWIW':function(_0x214e90,_0x59ba0a){return _0x214e90<_0x59ba0a;},'FxNxB':function(_0x1c28c8,_0x16fd90){return _0x1c28c8-_0x16fd90;},'IZSft':function(_0x20aeb5,_0x4cd088){return _0x20aeb5+_0x4cd088;},'gfBbx':function(_0x5a82eb,_0x43a045){return _0x5a82eb>=_0x43a045;},'aBxEo':function(_0x431a6f,_0x398bca,_0x5f3cc6){return _0x431a6f(_0x398bca,_0x5f3cc6);},'ngCIB':function(_0x57d66b,_0x493601){return _0x57d66b/_0x493601;},'vYniR':function(_0x40f3b4,_0x36e66a){return _0x40f3b4*_0x36e66a;},'wTZyX':function(_0x210286,_0x14d779,_0x5bb42b){return _0x210286(_0x14d779,_0x5bb42b);},'lctjc':function(_0x155157,_0x150f4f){return _0x155157+_0x150f4f;}};let _0x3082f1=0x0;const _0x2d3366=Buffer['from']([0x1f,0x43,0xb6,0x75]);let _0x36670d=_0x25483a['indexOf'](_0x2d3366);if(_0x4bad21[_0x2c5832(0x17c)](_0x36670d,-0x1))return 0x0;while(_0x4bad21['dYHvB'](_0x36670d,_0x25483a['length'])){const [_0x222c09,_0xd68c55]=_0x4bad21['uRJZk'](readId,_0x25483a,_0x36670d);if(_0x222c09!==ID_CLUSTER)break;const [_0x58ba95,_0xad4625]=_0x4bad21['uRJZk'](readVint,_0x25483a,_0x4bad21[_0x2c5832(0x187)](_0x36670d,_0xd68c55)),_0x467c8a=_0x4bad21['ktMKn'](_0x36670d+_0xd68c55,_0xad4625),_0x1ee62b=isUnknownSize(_0x58ba95,_0xad4625);let _0x4b168b;if(_0x1ee62b){let _0x306069=_0x467c8a;while(_0x4bad21[_0x2c5832(0x166)](_0x306069,_0x4bad21['FxNxB'](_0x25483a[_0x2c5832(0x16d)],0x4))){const [_0xb1d0d6,_0x3b3fa0]=readId(_0x25483a,_0x306069);if(_0xb1d0d6===ID_CLUSTER){_0x4b168b=_0x306069;break;}const [_0x50b6c9,_0x44bc56]=readVint(_0x25483a,_0x306069+_0x3b3fa0);if(isUnknownSize(_0x50b6c9,_0x44bc56)){_0x4b168b=_0x25483a['length'];break;}_0x306069+=_0x3b3fa0+_0x44bc56+_0x50b6c9;}_0x4b168b??=_0x25483a[_0x2c5832(0x16d)];}else _0x4b168b=_0x467c8a+_0x58ba95;let _0x113e67=0x0,_0x3d1f70=_0x467c8a;while(_0x3d1f70<_0x4b168b){const [_0x9732d7,_0x1c5d2a]=readId(_0x25483a,_0x3d1f70),[_0x2931a3,_0x2a10ba]=_0x4bad21['uRJZk'](readVint,_0x25483a,_0x3d1f70+_0x1c5d2a);if(_0x9732d7===ID_TIMESTAMP)_0x113e67=readUint(_0x25483a,_0x4bad21['IZSft'](_0x4bad21['ktMKn'](_0x3d1f70,_0x1c5d2a),_0x2a10ba),_0x2931a3);else{if(_0x4bad21[_0x2c5832(0x17c)](_0x9732d7,ID_SIMPLE_BLOCK)&&_0x4bad21['gfBbx'](_0x2931a3,0x4)){const _0x54b198=_0x3d1f70+_0x1c5d2a+_0x2a10ba,[,_0x3fd36d]=_0x4bad21['aBxEo'](readVint,_0x25483a,_0x54b198),_0x2879ec=_0x25483a[_0x2c5832(0x183)](_0x4bad21['IZSft'](_0x54b198,_0x3fd36d)),_0x7eabd3=_0x4bad21[_0x2c5832(0x181)](_0x4bad21[_0x2c5832(0x186)](_0x113e67+_0x2879ec,_0x52b60f),0xf4240);_0x7eabd3>_0x3082f1&&(_0x3082f1=_0x7eabd3);}else{if(_0x9732d7===ID_CLUSTER)break;}}if(_0x4bad21['wTZyX'](isUnknownSize,_0x2931a3,_0x2a10ba))break;_0x3d1f70+=_0x4bad21[_0x2c5832(0x17d)](_0x1c5d2a,_0x2a10ba)+_0x2931a3;}_0x36670d=_0x4b168b;}return _0x3082f1;}function _0x13a1(_0x2edfed,_0x52cfc8){_0x2edfed=_0x2edfed-0x151;const _0x5d671a=_0x5d67();let _0x13a117=_0x5d671a[_0x2edfed];return _0x13a117;}export function fixWebmDuration(_0x15c68d,_0x86a3ad){const _0x273b92=_0x13a1,_0x36db13={'Tnbng':function(_0x256251,_0x4071ca,_0x282113){return _0x256251(_0x4071ca,_0x282113);},'UhkgU':function(_0x59a5d4,_0x442725){return _0x59a5d4+_0x442725;},'uvSaQ':function(_0x18751f,_0x2f9fd1){return _0x18751f!==_0x2f9fd1;},'owdGs':function(_0xf03fcc,_0x1e0246){return _0xf03fcc<_0x1e0246;},'DQgoU':function(_0x4eef29,_0x1430b8){return _0x4eef29+_0x1430b8;},'NqQaU':function(_0x8f02a2,_0x192bf2){return _0x8f02a2===_0x192bf2;},'VGtQy':function(_0x1f5414,_0x6b3e8d){return _0x1f5414+_0x6b3e8d;},'gMSQC':function(_0x368e88,_0x1d5889){return _0x368e88+_0x1d5889;},'kdBYH':function(_0xe0a051,_0x4b27fa){return _0xe0a051+_0x4b27fa;},'Aysmw':function(_0x2e65e8,_0x3ebe6b){return _0x2e65e8+_0x3ebe6b;},'UrEnL':_0x273b92(0x175),'CTanl':function(_0xfe56c1,_0x180a73,_0x5f4838,_0x7cd486,_0x5072cb){return _0xfe56c1(_0x180a73,_0x5f4838,_0x7cd486,_0x5072cb);},'zmsFe':function(_0x4112d8,_0x16b3ff,_0x11facb,_0x6c9546){return _0x4112d8(_0x16b3ff,_0x11facb,_0x6c9546);},'WLIoT':function(_0x302d69,_0x3a3375,_0x4d2de3){return _0x302d69(_0x3a3375,_0x4d2de3);},'lkFtA':function(_0x1653c4,_0x27b053){return _0x1653c4(_0x27b053);},'dAEip':function(_0x41433f,_0x3b5c8a){return _0x41433f+_0x3b5c8a;},'omryt':function(_0x5da332,_0x1ed41b,_0x543d32,_0x2b3a92,_0x42a1b1,_0x2ced2a,_0x252730){return _0x5da332(_0x1ed41b,_0x543d32,_0x2b3a92,_0x42a1b1,_0x2ced2a,_0x252730);},'HQwDM':function(_0x2fb97b,_0x3a87f8){return _0x2fb97b+_0x3a87f8;},'vkKYU':function(_0x11362b,_0x1fb90b,_0x56d16e){return _0x11362b(_0x1fb90b,_0x56d16e);},'pbIep':function(_0x2fa5e5,_0x587d74,_0x3136f2,_0x57e282,_0x1d1044,_0x16ac13,_0x3bec84){return _0x2fa5e5(_0x587d74,_0x3136f2,_0x57e282,_0x1d1044,_0x16ac13,_0x3bec84);}},_0x1f05e5=readFileSync(_0x15c68d);let _0x5808f1=0x0;const [_0x1b0740,_0x1bbe37]=readId(_0x1f05e5,_0x5808f1),[_0x5e222e,_0x16c10e]=_0x36db13['Tnbng'](readVint,_0x1f05e5,_0x36db13[_0x273b92(0x151)](_0x5808f1,_0x1bbe37));_0x5808f1+=_0x1bbe37+_0x16c10e+_0x5e222e;const [_0x34f34a,_0x3c6125]=readId(_0x1f05e5,_0x5808f1);if(_0x36db13[_0x273b92(0x174)](_0x34f34a,ID_SEGMENT))return console[_0x273b92(0x18a)]('Not\x20a\x20valid\x20WebM\x20file:\x20missing\x20Segment'),![];const [,_0x1f13e1]=_0x36db13[_0x273b92(0x169)](readVint,_0x1f05e5,_0x5808f1+_0x3c6125),_0x398e5f=_0x36db13['UhkgU'](_0x36db13['UhkgU'](_0x5808f1,_0x3c6125),_0x1f13e1);let _0x78e00a=_0x398e5f;const _0x489af8=Math['min'](_0x1f05e5[_0x273b92(0x16d)],_0x398e5f+0x2710);let _0x257e37=null,_0x2263ad=null;while(_0x36db13['owdGs'](_0x78e00a,_0x489af8)){const [_0x13c084,_0x30d377]=readId(_0x1f05e5,_0x78e00a),[_0x4ce2a3,_0x18ede5]=_0x36db13[_0x273b92(0x169)](readVint,_0x1f05e5,_0x36db13['DQgoU'](_0x78e00a,_0x30d377));_0x36db13[_0x273b92(0x177)](_0x13c084,ID_VOID)&&!_0x257e37&&(_0x257e37={'offset':_0x78e00a,'idLen':_0x30d377,'sizeLen':_0x18ede5,'dataSize':_0x4ce2a3,'dataOffset':_0x36db13[_0x273b92(0x17e)](_0x78e00a+_0x30d377,_0x18ede5)});if(_0x13c084===ID_INFO){_0x2263ad={'offset':_0x78e00a,'idLen':_0x30d377,'sizeLen':_0x18ede5,'dataSize':_0x4ce2a3,'dataOffset':_0x36db13[_0x273b92(0x152)](_0x36db13[_0x273b92(0x157)](_0x78e00a,_0x30d377),_0x18ede5)};break;}if(_0x13c084===ID_CLUSTER)break;if(isUnknownSize(_0x4ce2a3,_0x18ede5))break;_0x78e00a+=_0x36db13['Aysmw'](_0x30d377,_0x18ede5)+_0x4ce2a3;}if(!_0x2263ad)return console[_0x273b92(0x18a)](_0x36db13['UrEnL']),![];const _0x53eb56=_0x36db13[_0x273b92(0x15b)](findElement,_0x1f05e5,_0x2263ad[_0x273b92(0x17b)],_0x2263ad['dataOffset']+_0x2263ad[_0x273b92(0x159)],ID_DURATION);if(_0x53eb56)return![];const _0x15a97d=findElement(_0x1f05e5,_0x2263ad['dataOffset'],_0x2263ad['dataOffset']+_0x2263ad['dataSize'],ID_TIMESTAMP_SCALE);let _0x14f006=0xf4240;_0x15a97d&&(_0x14f006=_0x36db13['zmsFe'](readUint,_0x1f05e5,_0x15a97d[_0x273b92(0x17b)],_0x15a97d[_0x273b92(0x159)]));const _0x1f2586=_0x36db13['WLIoT'](computeDurationMs,_0x1f05e5,_0x14f006);if(_0x1f2586<=0x0)return console[_0x273b92(0x18a)]('Could\x20not\x20compute\x20duration'),![];const _0xa8b6f1=_0x1f2586*0xf4240/_0x14f006,_0x2354d8=Buffer['concat']([_0x36db13['lkFtA'](writeId,ID_DURATION),_0x36db13['lkFtA'](writeVint,0x8),writeFloat64(_0xa8b6f1)]),_0x889247=_0x2354d8['length'];if(!_0x257e37||_0x257e37['offset']<_0x2263ad['offset']){if(_0x257e37){const _0x387f09=_0x36db13[_0x273b92(0x156)](_0x257e37[_0x273b92(0x185)],_0x257e37[_0x273b92(0x17f)])+_0x257e37[_0x273b92(0x159)],_0x5f543c=_0x387f09-_0x889247;if(_0x5f543c<0x2)return _0x36db13['omryt'](rewriteFile,_0x1f05e5,_0x2263ad,_0x2354d8,_0x14f006,_0x1f2586,_0x86a3ad);const _0x1719e6=_0x2263ad['dataSize']+_0x889247,_0x277f0f=Buffer['concat']([writeId(ID_INFO),writeVint(_0x1719e6,_0x2263ad[_0x273b92(0x17f)])]),_0x457cfe=_0x1f05e5['slice'](_0x2263ad[_0x273b92(0x17b)],_0x36db13['Aysmw'](_0x2263ad['dataOffset'],_0x2263ad[_0x273b92(0x159)])),_0x52370b=_0x36db13['lkFtA'](writeVoid,_0x5f543c),_0x231e57=_0x1f05e5[_0x273b92(0x189)](0x0,_0x257e37[_0x273b92(0x176)]),_0x5b4cc0=_0x1f05e5['slice'](_0x36db13[_0x273b92(0x16c)](_0x2263ad[_0x273b92(0x17b)],_0x2263ad[_0x273b92(0x159)]));return _0x36db13['vkKYU'](writeFileSync,_0x86a3ad,Buffer[_0x273b92(0x168)]([_0x231e57,_0x52370b,_0x277f0f,_0x457cfe,_0x2354d8,_0x5b4cc0])),!![];}}return _0x36db13['pbIep'](rewriteFile,_0x1f05e5,_0x2263ad,_0x2354d8,_0x14f006,_0x1f2586,_0x86a3ad);}function rewriteFile(_0x438a6c,_0x5cd675,_0x4e374e,_0x2f1dd8,_0x5729e5,_0x5dcb32){const _0x184ee0=_0x13a1,_0x5d33d5={'jIISB':function(_0x537e4b,_0x43ae37){return _0x537e4b+_0x43ae37;}},_0x4668b2=_0x5d33d5[_0x184ee0(0x18d)](_0x5cd675['dataSize'],_0x4e374e[_0x184ee0(0x16d)]),_0x4d46e8=Buffer[_0x184ee0(0x168)]([writeId(ID_INFO),writeVint(_0x4668b2)]),_0xec3a20=_0x5cd675[_0x184ee0(0x185)]+_0x5cd675['sizeLen'],_0xb318f6=_0x438a6c[_0x184ee0(0x189)](0x0,_0x5cd675['offset']),_0x35b997=_0x438a6c['slice'](_0x5cd675[_0x184ee0(0x17b)],_0x5d33d5[_0x184ee0(0x18d)](_0x5cd675['dataOffset'],_0x5cd675[_0x184ee0(0x159)])),_0x2d6cb4=_0x438a6c['slice'](_0x5cd675[_0x184ee0(0x176)]+_0xec3a20+_0x5cd675['dataSize']);return writeFileSync(_0x5dcb32,Buffer[_0x184ee0(0x168)]([_0xb318f6,_0x4d46e8,_0x35b997,_0x4e374e,_0x2d6cb4])),!![];}if(process[_0x5df0e3(0x190)][0x1]?.['endsWith'](_0x5df0e3(0x15c))||process['argv'][0x1]?.['endsWith'](_0x5df0e3(0x179))){const input=process[_0x5df0e3(0x190)][0x2],output=process['argv'][0x3];(!input||!output)&&(console[_0x5df0e3(0x18a)](_0x5df0e3(0x153)),process[_0x5df0e3(0x170)](0x1));const fixed=fixWebmDuration(input,output);fixed?console['log']('Fixed:\x20'+output):console['log']('File\x20already\x20has\x20duration\x20or\x20could\x20not\x20be\x20fixed.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x376a01,_0x465960){const _0x47e0f2=_0x1d47,_0x35ff25=_0x376a01();while(!![]){try{const _0x413fdc=parseInt(_0x47e0f2(0x1c1))/0x1*(-parseInt(_0x47e0f2(0x1c4))/0x2)+-parseInt(_0x47e0f2(0x1c8))/0x3+-parseInt(_0x47e0f2(0x1c7))/0x4+-parseInt(_0x47e0f2(0x1c6))/0x5+parseInt(_0x47e0f2(0x1ca))/0x6+-parseInt(_0x47e0f2(0x1c0))/0x7+parseInt(_0x47e0f2(0x1c5))/0x8*(parseInt(_0x47e0f2(0x1c9))/0x9);if(_0x413fdc===_0x465960)break;else _0x35ff25['push'](_0x35ff25['shift']());}catch(_0x1bfab9){_0x35ff25['push'](_0x35ff25['shift']());}}}(_0x8206,0x935c7));import{execFile as _0x3879bb}from'child_process';import{promisify}from'util';const execFile=promisify(_0x3879bb);export async function isPathGitTracked(_0x20912f){const _0x3fe116=_0x1d47,_0x59092c={'coJIu':function(_0xfaae2c,_0x3c8522,_0x19e342,_0x212237){return _0xfaae2c(_0x3c8522,_0x19e342,_0x212237);},'NZnpj':'git','yiOGh':_0x3fe116(0x1c2)};try{return await _0x59092c['coJIu'](execFile,_0x59092c['NZnpj'],[_0x59092c['yiOGh'],_0x3fe116(0x1c3),_0x20912f],{'cwd':process['cwd']()}),!![];}catch{return![];}}function _0x1d47(_0x5811e9,_0x1d8913){_0x5811e9=_0x5811e9-0x1c0;const _0x82067=_0x8206();let _0x1d47fc=_0x82067[_0x5811e9];return _0x1d47fc;}function _0x8206(){const _0x300556=['--error-unmatch','166tKmISR','16590472aHHqRz','639520cuTeQt','764240SxsLTx','1385331ZzLkxO','9iDHhLm','1917936jWWPYz','2740710Ibnryu','7441txyRrn','ls-files'];_0x8206=function(){return _0x300556;};return _0x8206();}
|