@ranger-testing/ranger-cli 2.5.4-alpha.a70fc60-4 → 2.5.4-alpha.bc88254-5
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/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/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/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 +4 -3
- package/build/skills/ranger/verify.md +15 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x2e4b1c=_0x484d;(function(_0x1fe1ae,_0xae4569){const _0x1d4276=_0x484d,_0x44837f=_0x1fe1ae();while(!![]){try{const _0x410082=parseInt(_0x1d4276(0x1b7))/0x1+parseInt(_0x1d4276(0x175))/0x2+-parseInt(_0x1d4276(0x176))/0x3+-parseInt(_0x1d4276(0x198))/0x4+parseInt(_0x1d4276(0x17b))/0x5+parseInt(_0x1d4276(0x1b0))/0x6+parseInt(_0x1d4276(0x1a2))/0x7*(-parseInt(_0x1d4276(0x193))/0x8);if(_0x410082===_0xae4569)break;else _0x44837f['push'](_0x44837f['shift']());}catch(_0x309df3){_0x44837f['push'](_0x44837f['shift']());}}}(_0x3248,0x26fbb));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x2befbc from'inquirer';import{chromium}from'playwright';import{getApiBaseUrl}from'./environment.js';import{getToken}from'./keychain.js';import{getRangerHomeDir}from'./rangerRoot.js';function _0x3248(){const _0x377b67=['250192MOfBmo','845409krKBob','force','wuTcq','sessionCheckPath','\x20failed\x20(','1485770GnlWwc','prompt','status','keys','launch','stringify','EsoyB','confirm','GGGre','\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','YaFVK','Bearer\x20','cookies','DAxRv','DCTjG','/api/v1/profiles/','parse','TTioG','txyqA','setupHeaders','organizationId','/login','Browser\x20login\x20timed\x20out\x20after\x20','265736NVjTTS','xqgiH','environment_key','length','message','463792mwLDYN','baseUrl','\x20\x20No\x20live\x20session\x20for\x20\x22','POST','WZEva','):\x20','newPage','wDwoV','ZnjsE','\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22','28QNoVlu','settings','profiles','\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22','/api/v1/profiles','gIoAs','not_configured','gCIgc','code','detail','NuRex','error','Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','name','98688vOGotw','yhQBa','asAGo','aokLg','toISOString','IjGAv','SBAGh','251596tMJcrk','env','iEuLR','/api/v1/profiles/auth-config','\x22,\x20cached\x20locally','\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','JEatJ','LvWqH','OZbKm','gVPEd','\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','sessionState','AXiJQ','ywcgM','\x20\x20Cached\x20session\x20for\x20\x22','Browser\x20login\x20timed\x20out\x20before\x20completion.','log','catch','\x22\x20failed\x20validation\x20—\x20re-login\x20needed...'];_0x3248=function(){return _0x377b67;};return _0x3248();}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 _0x1f850f=_0x484d,_0x5bf2c9={'LieDu':function(_0x26a4b3){return _0x26a4b3();},'ZnjsE':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x2c67fe=await _0x5bf2c9['LieDu'](getToken);if(!_0x2c67fe)throw new Error(_0x5bf2c9[_0x1f850f(0x1a0)]);return _0x2c67fe;}async function apiRequest(_0x33e494,_0x180b9d={}){const _0xdc3fbb=_0x484d,_0x2eabd8={'Dntcl':function(_0x31575b){return _0x31575b();},'asAGo':'application/json','yhQBa':'string'},_0x27bf33=await _0x2eabd8['Dntcl'](requireToken),_0x25c4a9=getApiBaseUrl(),_0x14a0db=await fetch(''+_0x25c4a9+_0x33e494,{..._0x180b9d,'headers':{'Authorization':_0xdc3fbb(0x187)+_0x27bf33,'Content-Type':_0x2eabd8[_0xdc3fbb(0x1b2)],..._0x180b9d['headers']??{}}});if(!_0x14a0db['ok']){let _0x5aa68c='',_0x3089db;try{const _0xb553fd=await _0x14a0db['json']();_0x5aa68c=(typeof _0xb553fd['error']==='string'?_0xb553fd[_0xdc3fbb(0x1ad)]:undefined)??JSON['stringify'](_0xb553fd);if(typeof _0xb553fd['code']===_0x2eabd8[_0xdc3fbb(0x1b1)])_0x3089db=_0xb553fd['code'];}catch{_0x5aa68c=_0x14a0db['statusText'];}throw new ApiError('API\x20request\x20'+_0x33e494+_0xdc3fbb(0x17a)+_0x14a0db['status']+_0xdc3fbb(0x19d)+_0x5aa68c,_0x14a0db['status'],_0x5aa68c,_0x3089db);}return _0x14a0db['json']();}export class ApiError extends Error{[_0x2e4b1c(0x17d)];['detail'];[_0x2e4b1c(0x1aa)];constructor(_0x57f826,_0x14e563,_0x396336,_0x129e3c){const _0x2f9a2f=_0x2e4b1c,_0x5c25b6={'OZbKm':'ApiError'};super(_0x57f826),this['status']=_0x14e563,this[_0x2f9a2f(0x1ab)]=_0x396336,this[_0x2f9a2f(0x1aa)]=_0x129e3c,this['name']=_0x5c25b6[_0x2f9a2f(0x16a)];}}export async function fetchCloudProfile(_0x390aa9){const _0x522794=_0x2e4b1c,_0x1477e1={'XqRmp':function(_0x129c90,_0x1d5aad){return _0x129c90(_0x1d5aad);},'WZEva':function(_0x310b8f,_0x9a83a){return _0x310b8f instanceof _0x9a83a;},'TTioG':function(_0x582435,_0x5cac8b){return _0x582435===_0x5cac8b;}};try{return await apiRequest(_0x522794(0x18b)+_0x1477e1['XqRmp'](encodeURIComponent,_0x390aa9));}catch(_0x9fc754){if(_0x1477e1[_0x522794(0x19c)](_0x9fc754,ApiError)&&_0x1477e1[_0x522794(0x18d)](_0x9fc754[_0x522794(0x17d)],0x194))return null;throw _0x9fc754;}}export async function listCloudProfiles(){const _0x57290c=_0x2e4b1c,_0x186ba2=await apiRequest(_0x57290c(0x1a6));return _0x186ba2[_0x57290c(0x1a4)];}export async function createCloudProfile(_0x2b5b6a,_0xd1d365,_0x24e7bf){const _0x51d54f=_0x2e4b1c,_0x47738a={'HuRFE':function(_0xffe666,_0x5ad5a8){return _0xffe666>_0x5ad5a8;},'gCIgc':_0x51d54f(0x19b)},_0x49f43d={'name':_0x2b5b6a};if(_0xd1d365)_0x49f43d[_0x51d54f(0x195)]=_0xd1d365;if(_0x24e7bf&&_0x47738a['HuRFE'](Object[_0x51d54f(0x17e)](_0x24e7bf)[_0x51d54f(0x196)],0x0))_0x49f43d[_0x51d54f(0x1a3)]=_0x24e7bf;return await apiRequest(_0x51d54f(0x1a6),{'method':_0x47738a[_0x51d54f(0x1a9)],'body':JSON[_0x51d54f(0x180)](_0x49f43d)});}export async function uploadCloudProfileSession(_0x5b5950,_0x3f6ded){const _0x2d04d2=_0x2e4b1c;return await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x5b5950)+'/session',{'method':'POST','body':JSON[_0x2d04d2(0x180)]({'session_state':_0x3f6ded})});}function _0x484d(_0x2063ee,_0x15a05d){_0x2063ee=_0x2063ee-0x164;const _0x32489f=_0x3248();let _0x484dbe=_0x32489f[_0x2063ee];return _0x484dbe;}export async function saveCloudProfileCredentials(_0x241d5e,_0x17c814,_0x13cd96){const _0xf32534=_0x2e4b1c,_0x8138e={'YaFVK':function(_0x2f162a,_0xdba975,_0x279eb6){return _0x2f162a(_0xdba975,_0x279eb6);}};await _0x8138e[_0xf32534(0x186)](apiRequest,_0xf32534(0x18b)+encodeURIComponent(_0x241d5e),{'method':'PUT','body':JSON['stringify']({'username':_0x17c814,'password':_0x13cd96})});}export async function fetchAuthConfig(){const _0xbfcfe6=_0x2e4b1c,_0x3136fa={'AXiJQ':_0xbfcfe6(0x165)};try{const _0xa0d1dd=await apiRequest(_0x3136fa[_0xbfcfe6(0x16e)]);return _0xa0d1dd['auth_config'];}catch{return null;}}export async function writeSessionToLocalCache(_0x2045df,_0x3328ea,_0x213188,_0x3a87c5,_0x498999,_0x1fa9f8){const _0x2fe7a3=_0x2e4b1c,_0x3f794d={'EsoyB':function(_0x15fad8,_0x2f8832){return _0x15fad8(_0x2f8832);},'eYXGd':function(_0x125380,_0x56f796,_0x562442){return _0x125380(_0x56f796,_0x562442);},'DAxRv':'auth','NuRex':function(_0x5985fd,_0x1c3b89,_0x2839e0){return _0x5985fd(_0x1c3b89,_0x2839e0);}},_0x4d6b18=_0x3f794d[_0x2fe7a3(0x181)](sessionCacheHash,{'orgId':_0x3328ea,'profileName':_0x2045df,'effectiveBaseUrl':_0x213188,'setupHeaders':_0x3a87c5}),_0x2a63c5=getSessionCachePath(_0x4d6b18,_0x2045df),_0x94a35f=_0x3f794d['eYXGd'](join,getRangerHomeDir(),_0x3f794d[_0x2fe7a3(0x189)]);!existsSync(_0x94a35f)&&await mkdir(_0x94a35f,{'recursive':!![]});const _0x2121c3={..._0x498999};_0x1fa9f8&&_0x1fa9f8['length']>0x0&&Array['isArray'](_0x2121c3[_0x2fe7a3(0x188)])&&(_0x2121c3[_0x2fe7a3(0x188)]=duplicateCookiesForDomains(_0x2121c3['cookies'],_0x1fa9f8));const _0x4d55c7={'cached_at':new Date()[_0x2fe7a3(0x1b4)](),'session_state':_0x2121c3};await _0x3f794d[_0x2fe7a3(0x1ac)](writeFile,_0x2a63c5,JSON['stringify'](_0x4d55c7,null,0x2));const _0x366e50=getStorageStatePath(_0x2a63c5);return await _0x3f794d['NuRex'](writeFile,_0x366e50,JSON['stringify'](_0x2121c3,null,0x2)),_0x366e50;}export async function checkLocalCache(_0x5a4340,_0x3d5be9,_0x59d86f,_0x41ebf7){const _0x342071=_0x2e4b1c,_0x2a15f4={'jeHzi':function(_0x14d288,_0x24e144){return _0x14d288(_0x24e144);},'JIwQB':function(_0x3552d4,_0x49789d,_0x41b63f){return _0x3552d4(_0x49789d,_0x41b63f);},'SEfIU':'utf-8'},_0x555bf9=_0x2a15f4['jeHzi'](sessionCacheHash,{'orgId':_0x3d5be9,'profileName':_0x5a4340,'effectiveBaseUrl':_0x59d86f,'setupHeaders':_0x41ebf7}),_0x2db954=_0x2a15f4['JIwQB'](getSessionCachePath,_0x555bf9,_0x5a4340),_0x3ea18b=_0x2a15f4['jeHzi'](getStorageStatePath,_0x2db954);if(!existsSync(_0x2db954)||!existsSync(_0x3ea18b))return null;try{const _0x3f813b=await readFile(_0x2db954,_0x2a15f4['SEfIU']);return JSON[_0x342071(0x18c)](_0x3f813b),{'storageStatePath':_0x3ea18b};}catch{return null;}}function launchRealBrowser(){const _0x486aeb=_0x2e4b1c;return chromium[_0x486aeb(0x17f)]({'headless':!![]});}export async function serverSideLogin(_0x568ae7,_0x2b75cf){const _0x5561b8=_0x2e4b1c,_0x513e75={'JEatJ':_0x5561b8(0x19b),'IjGAv':_0x5561b8(0x1a8)},_0x5f363a=process['env']['RANGER_TEST_USERNAME'],_0x3ed651=process[_0x5561b8(0x1b8)]['RANGER_TEST_PASSWORD'],_0x5dc0bf={};if(_0x5f363a)_0x5dc0bf['username']=_0x5f363a;if(_0x3ed651)_0x5dc0bf['password']=_0x3ed651;if(_0x2b75cf?.[_0x5561b8(0x177)])_0x5dc0bf['force']=!![];try{return await apiRequest(_0x5561b8(0x18b)+encodeURIComponent(_0x568ae7)+_0x5561b8(0x191),{'method':_0x513e75[_0x5561b8(0x168)],'body':JSON['stringify'](_0x5dc0bf)});}catch(_0x27daab){if(_0x27daab instanceof ApiError&&_0x27daab['status']===0x190&&_0x27daab[_0x5561b8(0x1aa)]===_0x5561b8(0x1a8))return{'status':_0x513e75[_0x5561b8(0x1b5)],'error':_0x27daab['detail']};throw _0x27daab;}}export async function manualBrowserLogin(_0x50df6a,_0x362ffe){const _0x3f541b=_0x2e4b1c,_0x29a6cf={'DCTjG':function(_0x572824,_0x49c20f){return _0x572824+_0x49c20f;},'vdbmo':'\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD,\x20configure\x20','gWBCN':'loginInstructions\x20on\x20the\x20auth\x20environment,\x20or\x20run\x20with\x20a\x20TTY.','wYIxb':function(_0x9931f1,_0x477978){return _0x9931f1>_0x477978;},'LvWqH':function(_0x466a8d,_0x176be5){return _0x466a8d(_0x176be5);},'dbjfJ':function(_0x2b5052,_0x372395){return _0x2b5052&&_0x372395;},'aokLg':'Browser\x20closed\x20before\x20authentication\x20was\x20saved.','xqgiH':function(_0x179a1d,_0x52bb3b,_0x16ea89){return _0x179a1d(_0x52bb3b,_0x16ea89);},'iEuLR':'cli:manual-login'};if(!isInteractive())throw new Error(_0x29a6cf[_0x3f541b(0x18a)]('No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22'+_0x50df6a[_0x3f541b(0x1af)]+'\x22.\x0a',_0x29a6cf['vdbmo'])+_0x29a6cf['gWBCN']);const _0xae36c1=_0x362ffe&&_0x29a6cf['wYIxb'](_0x362ffe['domains'][_0x3f541b(0x196)],0x0)?_0x362ffe['domains'][0x0]:'about:blank';console['log']('\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.'),console[_0x3f541b(0x172)](_0x3f541b(0x16c)),await new Promise(_0x9f9a2d=>setTimeout(_0x9f9a2d,0x7d0));const _0x1c860d=await chromium['launch']({'headless':![]});let _0x4a0000=null;try{const _0x5758a5={'ignoreHTTPSErrors':!![]};_0x362ffe?.['setupHeaders']&&(_0x5758a5['extraHTTPHeaders']=_0x362ffe[_0x3f541b(0x18f)]);const _0x483732=await _0x1c860d['newContext'](_0x5758a5);await _0x29a6cf[_0x3f541b(0x169)](addProfileSetupBanner,_0x483732);const _0xd41794=await _0x483732[_0x3f541b(0x19e)]();await _0xd41794['goto'](_0xae36c1);let _0x5d2989=![];await new Promise(_0x4e72b7=>{const _0x2adc5f=setTimeout(()=>{const _0x2a7209=_0x484d;_0x5d2989=!![],console['error'](_0x2a7209(0x192)+MANUAL_LOGIN_TIMEOUT_MS/0xea60+_0x2a7209(0x184)),_0x4e72b7();},MANUAL_LOGIN_TIMEOUT_MS);_0xd41794['on']('close',async()=>{clearTimeout(_0x2adc5f);try{const _0x2cf90f=await _0x483732['storageState']();_0x4a0000=_0x2cf90f;}catch{}_0x4e72b7();});});if(_0x29a6cf['dbjfJ'](_0x5d2989,!_0x4a0000))throw new Error(_0x3f541b(0x171));}finally{await _0x1c860d['close']()[_0x3f541b(0x173)](()=>{});}if(!_0x4a0000)throw new Error(_0x29a6cf[_0x3f541b(0x1b3)]);return await _0x29a6cf[_0x3f541b(0x194)](apiRequest,_0x3f541b(0x18b)+encodeURIComponent(_0x50df6a['name'])+'/session',{'method':_0x3f541b(0x19b),'body':JSON['stringify']({'session_state':_0x4a0000,'updated_by':_0x29a6cf[_0x3f541b(0x164)]})}),{'sessionState':_0x4a0000};}export async function promptSaveCredentials(_0x5503df){const _0x44e01b=_0x2e4b1c,_0x5985dc={'KvSjQ':function(_0x46e212){return _0x46e212();},'wqktx':_0x44e01b(0x182),'KsPOT':'save','mHNFP':'PUT','txyqA':'\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.'},_0x19c01a=process['env']['RANGER_TEST_USERNAME'],_0x5b4942=process[_0x44e01b(0x1b8)]['RANGER_TEST_PASSWORD'];if(!_0x19c01a||!_0x5b4942)return;if(!_0x5985dc['KvSjQ'](isInteractive))return;const {save:_0x31fe38}=await _0x2befbc[_0x44e01b(0x17c)]([{'type':_0x5985dc['wqktx'],'name':_0x5985dc['KsPOT'],'message':_0x44e01b(0x1ae),'default':![]}]);if(!_0x31fe38)return;await apiRequest(_0x44e01b(0x18b)+encodeURIComponent(_0x5503df),{'method':_0x5985dc['mHNFP'],'body':JSON[_0x44e01b(0x180)]({'username':_0x19c01a,'password':_0x5b4942})}),console[_0x44e01b(0x172)](_0x5985dc[_0x44e01b(0x18e)]);}export async function resolveCloudProfileSession(_0xd557b1,_0xf1f83={}){const _0x2c8eb8=_0x2e4b1c,_0x3a4077={'RCiQY':function(_0x3e15ae){return _0x3e15ae();},'gVPEd':function(_0x15fa0a,_0x40a8c6,_0x1f94b1,_0xfc1abe,_0x99c2c9){return _0x15fa0a(_0x40a8c6,_0x1f94b1,_0xfc1abe,_0x99c2c9);},'wDwoV':function(_0x1e7855,_0x116772,_0x22faa3,_0x2b52ec,_0x32a744,_0x3930bf,_0x1013fc){return _0x1e7855(_0x116772,_0x22faa3,_0x2b52ec,_0x32a744,_0x3930bf,_0x1013fc);},'ywcgM':function(_0xd53af6,_0x5d955d){return _0xd53af6(_0x5d955d);},'gIoAs':'not_configured','OCnIC':_0x2c8eb8(0x167),'GGGre':'success','xafzR':function(_0x34cd97,_0x3ec70f){return _0x34cd97&&_0x3ec70f;},'FaFBQ':'\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','SBAGh':_0x2c8eb8(0x185),'uwljk':function(_0xcd4d66,_0x2e0402){return _0xcd4d66 instanceof _0x2e0402;},'wuTcq':function(_0x51eed9,_0x470c24,_0x344ff5){return _0x51eed9(_0x470c24,_0x344ff5);}},_0x39bd55=_0xd557b1[_0x2c8eb8(0x1a3)]??{},_0x469c71=await _0x3a4077['RCiQY'](fetchAuthConfig),_0x5bcf73=_0x469c71?resolveAuthEnvironmentLocally(_0x469c71,_0xd557b1['environmentKey']):null,_0x51d390=_0x5bcf73?.['domains'],_0xc95616=_0x39bd55['setupHeaders'],_0x2ab059=_0xc95616??_0x5bcf73?.[_0x2c8eb8(0x18f)],_0x119863=_0xf1f83['effectiveBaseUrl']??_0x39bd55[_0x2c8eb8(0x199)]??(_0x51d390&&_0x51d390['length']>0x0?_0x51d390[0x0]:''),_0x1fd49e=await _0x3a4077[_0x2c8eb8(0x16b)](checkLocalCache,_0xd557b1[_0x2c8eb8(0x1af)],_0xd557b1['organizationId'],_0x119863,_0x2ab059);if(_0x1fd49e){if(_0x119863){const _0x145efb=await isCachedSessionLive(_0x1fd49e['storageStatePath'],_0x119863,{'sessionCheckPath':_0x5bcf73?.[_0x2c8eb8(0x179)],'setupHeaders':_0x2ab059},{'launchBrowser':launchRealBrowser});if(_0x145efb)return console['log'](_0x2c8eb8(0x1a5)+_0xd557b1['name']+'\x22'),{'authPath':_0x1fd49e['storageStatePath'],'settings':_0x39bd55,'resolvedEnv':_0x5bcf73};console['log'](_0x2c8eb8(0x170)+_0xd557b1[_0x2c8eb8(0x1af)]+'\x22\x20failed\x20validation\x20—\x20refreshing...');}else return{'authPath':_0x1fd49e['storageStatePath'],'settings':_0x39bd55,'resolvedEnv':_0x5bcf73};}if(_0xd557b1['sessionState']){const _0x1e64de=await _0x3a4077[_0x2c8eb8(0x19f)](writeSessionToLocalCache,_0xd557b1['name'],_0xd557b1[_0x2c8eb8(0x190)],_0x119863,_0x2ab059,_0xd557b1[_0x2c8eb8(0x16d)],_0x51d390);if(_0x119863){const _0x15c897=await isCachedSessionLive(_0x1e64de,_0x119863,{'sessionCheckPath':_0x5bcf73?.[_0x2c8eb8(0x179)],'setupHeaders':_0x2ab059},{'launchBrowser':launchRealBrowser});if(_0x15c897)return console['log'](_0x2c8eb8(0x1a1)+_0xd557b1[_0x2c8eb8(0x1af)]+_0x2c8eb8(0x166)),{'authPath':_0x1e64de,'settings':_0x39bd55,'resolvedEnv':_0x5bcf73};console[_0x2c8eb8(0x172)]('\x20\x20Cloud\x20session\x20for\x20\x22'+_0xd557b1[_0x2c8eb8(0x1af)]+_0x2c8eb8(0x174));}else return{'authPath':_0x1e64de,'settings':_0x39bd55,'resolvedEnv':_0x5bcf73};}console[_0x2c8eb8(0x172)](_0x2c8eb8(0x19a)+_0xd557b1['name']+'\x22,\x20attempting\x20login...');const _0x3d5fb4=Boolean(process['env']['RANGER_TEST_USERNAME'])&&Boolean(process['env']['RANGER_TEST_PASSWORD']),_0x583a69=_0x3a4077['ywcgM'](Boolean,_0xd557b1['username']);if(_0x3d5fb4||_0x583a69)try{const _0x191001=await _0x3a4077[_0x2c8eb8(0x16f)](serverSideLogin,_0xd557b1['name']);if(_0x191001['status']===_0x3a4077[_0x2c8eb8(0x1a7)])console[_0x2c8eb8(0x172)](_0x3a4077['OCnIC']);else{if(_0x191001['status']===_0x3a4077[_0x2c8eb8(0x183)]&&_0x191001['session_state']){console[_0x2c8eb8(0x172)]('\x20\x20Login\x20successful.\x20Session\x20cached.');const _0x14717d=await writeSessionToLocalCache(_0xd557b1[_0x2c8eb8(0x1af)],_0xd557b1['organizationId'],_0x119863,_0x2ab059,_0x191001['session_state'],_0x51d390);return _0x3a4077['xafzR'](_0x3d5fb4,!_0x583a69)&&await _0x3a4077[_0x2c8eb8(0x16f)](promptSaveCredentials,_0xd557b1['name']),{'authPath':_0x14717d,'settings':_0x39bd55,'resolvedEnv':_0x5bcf73};}else _0x191001['test_output']&&(console['log'](_0x3a4077['FaFBQ']),console[_0x2c8eb8(0x172)](_0x191001['test_output'])),console[_0x2c8eb8(0x172)](_0x3a4077[_0x2c8eb8(0x1b6)]);}}catch(_0x1b7da2){console[_0x2c8eb8(0x172)]('\x20\x20Server-side\x20login\x20error:\x20'+(_0x3a4077['uwljk'](_0x1b7da2,Error)?_0x1b7da2[_0x2c8eb8(0x197)]:String(_0x1b7da2))),console['log']('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}const {sessionState:_0x3f11bf}=await _0x3a4077[_0x2c8eb8(0x178)](manualBrowserLogin,_0xd557b1,_0x5bcf73),_0x40427f=await _0x3a4077['wDwoV'](writeSessionToLocalCache,_0xd557b1['name'],_0xd557b1[_0x2c8eb8(0x190)],_0x119863,_0x2ab059,_0x3f11bf,_0x51d390);return{'authPath':_0x40427f,'settings':_0x39bd55,'resolvedEnv':_0x5bcf73};}
|
|
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 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x3879c2=_0x4e2a;(function(_0x1ca840,_0x74a755){const _0x24b04c=_0x4e2a,_0x53ea50=_0x1ca840();while(!![]){try{const _0x157545=parseInt(_0x24b04c(0x1b6))/0x1*(-parseInt(_0x24b04c(0x1b4))/0x2)+-parseInt(_0x24b04c(0x196))/0x3*(parseInt(_0x24b04c(0x199))/0x4)+-parseInt(_0x24b04c(0x1ba))/0x5+-parseInt(_0x24b04c(0x1ae))/0x6*(-parseInt(_0x24b04c(0x1a8))/0x7)+parseInt(_0x24b04c(0x19f))/0x8+parseInt(_0x24b04c(0x1b1))/0x9+-parseInt(_0x24b04c(0x1a7))/0xa;if(_0x157545===_0x74a755)break;else _0x53ea50['push'](_0x53ea50['shift']());}catch(_0xceb102){_0x53ea50['push'](_0x53ea50['shift']());}}}(_0x4b1f,0xcb1e4));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x2cf2ac=process[_0x3879c2(0x1bd)],_0x11f3ea={'stdin':process['stdin'],'stdout':process['stdout']}){const _0x9144d1=_0x3879c2,_0x301d74={'egdxh':function(_0x58a0ec,_0x24f81b){return _0x58a0ec(_0x24f81b);}};if(_0x2cf2ac['CI'])return![];return Boolean(_0x11f3ea[_0x9144d1(0x1ab)]['isTTY'])&&_0x301d74['egdxh'](Boolean,_0x11f3ea['stdout'][_0x9144d1(0x1a6)]);}export const DEFAULT_SESSION_DEPS=[_0x3879c2(0x198),'setupHeaders'];export function sessionCacheHash(_0x20f76c){const _0x466678=_0x3879c2,_0x117284={'VtCMw':function(_0x47c7a3,_0x53576c){return _0x47c7a3(_0x53576c);},'FtOAZ':_0x466678(0x1aa),'kwngc':'userAgent','xBxnG':'clientIp','MdfNN':'hex'},_0x2c1941=_0x20f76c['sessionDeps']??DEFAULT_SESSION_DEPS,_0xd3959b=new Set(_0x2c1941),_0x5e0bdb={'orgId':_0x20f76c['orgId'],'profileName':_0x20f76c['profileName']};return(_0xd3959b[_0x466678(0x194)](_0x466678(0x198))||!_0x20f76c['sessionDeps'])&&(_0x5e0bdb['effectiveBaseUrl']=_0x20f76c['effectiveBaseUrl']),(_0xd3959b[_0x466678(0x194)]('setupHeaders')||!_0x20f76c[_0x466678(0x193)])&&(_0x5e0bdb[_0x466678(0x1ac)]=_0x20f76c[_0x466678(0x1ac)]?_0x117284[_0x466678(0x1af)](sortObjectKeys,_0x20f76c['setupHeaders']):_0x20f76c[_0x466678(0x1ac)]),_0xd3959b['has'](_0x117284[_0x466678(0x19b)])&&(_0x5e0bdb['port']=extractPort(_0x20f76c['effectiveBaseUrl'])),_0xd3959b['has'](_0x117284[_0x466678(0x19e)])&&_0x20f76c['userAgent']!==undefined&&(_0x5e0bdb['userAgent']=_0x20f76c['userAgent']),_0xd3959b[_0x466678(0x194)](_0x117284[_0x466678(0x1c1)])&&_0x20f76c[_0x466678(0x1b2)]!==undefined&&(_0x5e0bdb[_0x466678(0x1b2)]=_0x20f76c['clientIp']),createHash('sha256')[_0x466678(0x19c)](JSON['stringify'](_0x5e0bdb))['digest'](_0x117284[_0x466678(0x1a9)])['slice'](0x0,0xc);}function extractPort(_0xa3ec5){try{return new URL(_0xa3ec5)['port'];}catch{return'';}}function _0x4b1f(){const _0x19fe73=['isTTY','680220bFXwDl','9233mLZMWI','MdfNN','port','stdin','setupHeaders','includes','5784iAfoVZ','VtCMw','catch','7392708lhZmjW','clientIp','localhost.','62KVdUoq','ppdDp','37168FuAUFX','launchBrowser','toString','startsWith','655005UtWRIM','.storageState.json','defaultEnvironmentKey','env','close','YepwD','sessionCheckPath','xBxnG','OTYTU','sessionDeps','has','push','1583409FFAhPM','pathname','baseUrl','4RRsIGb','127.0.0.1','FtOAZ','update','keys','kwngc','4944624qAahVc','goto','length','add','status','hostname','RYirI'];_0x4b1f=function(){return _0x19fe73;};return _0x4b1f();}function sortObjectKeys(_0x218b2d){const _0x34f398=_0x3879c2,_0x4be466={};for(const _0x56740b of Object[_0x34f398(0x19d)](_0x218b2d)['sort']()){_0x4be466[_0x56740b]=_0x218b2d[_0x56740b];}return _0x4be466;}export function getSessionCachePath(_0x142aa4,_0x331e8b){const _0x56332d={'SIQVQ':function(_0x5eaf8b){return _0x5eaf8b();}};return join(_0x56332d['SIQVQ'](getRangerHomeDir),'auth',_0x142aa4+'-'+_0x331e8b+'.json');}export function getStorageStatePath(_0x5eeff1){const _0x4c05e0=_0x3879c2;return _0x5eeff1['replace'](/\.json$/,_0x4c05e0(0x1bb));}export function needsTunnel(_0x593e3b){const _0x15914a=_0x3879c2,_0x1b4686={'YepwD':function(_0x3d8bd6,_0x132ae1){return _0x3d8bd6===_0x132ae1;},'RYirI':'localhost','nwfAw':'.localhost'};let _0x3f0b9a;try{_0x3f0b9a=new URL(_0x593e3b)[_0x15914a(0x1a4)];}catch{return![];}if(_0x1b4686[_0x15914a(0x1bf)](_0x3f0b9a,_0x1b4686[_0x15914a(0x1a5)])||_0x3f0b9a===_0x15914a(0x19a))return!![];if(_0x3f0b9a['endsWith'](_0x1b4686['nwfAw']))return!![];if(_0x3f0b9a[_0x15914a(0x1ad)](_0x15914a(0x1b3)))return!![];return![];}export function hostnameOf(_0x911ffe){return new URL(_0x911ffe)['hostname'];}export function duplicateCookiesForDomains(_0x34e5be,_0x148af4){const _0xc9fb4f=_0x3879c2,_0x1a5af6=[..._0x34e5be],_0x5bf319=new Set(_0x34e5be['map'](_0x2d54e0=>_0x2d54e0['domain']));for(const _0x38d48a of _0x148af4){let _0x11384e;try{_0x11384e=hostnameOf(_0x38d48a);}catch{continue;}if(!_0x11384e)continue;const _0x554f7d=_0x11384e[_0xc9fb4f(0x1b9)]('.')?_0x11384e:'.'+_0x11384e;if(_0x5bf319['has'](_0x11384e)||_0x5bf319[_0xc9fb4f(0x194)](_0x554f7d))continue;for(const _0x23c184 of _0x34e5be){_0x1a5af6[_0xc9fb4f(0x195)]({..._0x23c184,'domain':_0x554f7d});}_0x5bf319[_0xc9fb4f(0x1a2)](_0x554f7d);}return _0x1a5af6;}export function resolveAuthEnvironmentLocally(_0x18fc27,_0x39271e){const _0x1b69fe=_0x3879c2,_0x4c0c86=_0x18fc27['environments'];if(_0x39271e){const _0x2be88e=_0x4c0c86[_0x39271e];if(!_0x2be88e)return null;return{'key':_0x39271e,..._0x2be88e};}if(_0x18fc27[_0x1b69fe(0x1bc)]){const _0x1d7037=_0x4c0c86[_0x18fc27[_0x1b69fe(0x1bc)]];if(!_0x1d7037)return null;return{'key':_0x18fc27[_0x1b69fe(0x1bc)],..._0x1d7037};}const _0x2cdd78=Object['keys'](_0x4c0c86);if(_0x2cdd78[_0x1b69fe(0x1a1)]===0x1){const _0x1242de=_0x2cdd78[0x0];return{'key':_0x1242de,..._0x4c0c86[_0x1242de]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;function _0x4e2a(_0x20d289,_0x53ba47){_0x20d289=_0x20d289-0x193;const _0x4b1f5a=_0x4b1f();let _0x4e2a7b=_0x4b1f5a[_0x20d289];return _0x4e2a7b;}export function buildSessionCheckUrl(_0x546cac,_0x232663){const _0x45098e=_0x3879c2;try{if(_0x232663)return new URL(_0x232663,_0x546cac)[_0x45098e(0x1b8)]();return new URL(_0x546cac)[_0x45098e(0x1b8)]();}catch{return null;}}export function looksLikeLoginUrl(_0x5983ab){const _0x54c2ac=_0x3879c2;try{const _0x3a607c=new URL(_0x5983ab);return LOGIN_URL_PATTERN['test'](_0x3a607c[_0x54c2ac(0x197)]);}catch{return LOGIN_URL_PATTERN['test'](_0x5983ab);}}export async function isCachedSessionLive(_0x59f97d,_0x1d6ed1,_0xc21b5={},_0x52bc1e={}){const _0x29f852=_0x3879c2,_0x500bd1={'ppdDp':function(_0x23c61b,_0x48780c,_0xf78958){return _0x23c61b(_0x48780c,_0xf78958);},'QXodB':'domcontentloaded','OTYTU':function(_0x209cce,_0x36339e){return _0x209cce===_0x36339e;}},_0x7d436f=_0x500bd1[_0x29f852(0x1b5)](buildSessionCheckUrl,_0x1d6ed1,_0xc21b5[_0x29f852(0x1c0)]);if(!_0x7d436f)return!![];if(!_0x52bc1e['launchBrowser'])return!![];let _0x233693=null;try{_0x233693=await _0x52bc1e[_0x29f852(0x1b7)]();const _0x4d6a6a=await _0x233693['newContext']({'storageState':_0x59f97d,'ignoreHTTPSErrors':!![],..._0xc21b5[_0x29f852(0x1ac)]?{'extraHTTPHeaders':_0xc21b5[_0x29f852(0x1ac)]}:{}}),_0x309bea=await _0x4d6a6a['newPage'](),_0x59a671=await _0x309bea[_0x29f852(0x1a0)](_0x7d436f,{'waitUntil':_0x500bd1['QXodB'],'timeout':0x3a98}),_0x2d1565=_0x59a671?.[_0x29f852(0x1a3)]();if(_0x2d1565===0x191||_0x500bd1[_0x29f852(0x1c2)](_0x2d1565,0x193))return![];const _0x2eef1a=_0x309bea['url']();if(looksLikeLoginUrl(_0x2eef1a))return![];return!![];}catch{return![];}finally{if(_0x233693)await _0x233693[_0x29f852(0x1be)]()[_0x29f852(0x1b0)](()=>{});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const _0x17466a=_0x3b19;(function(_0x34552b,_0x3efd43){const _0x55314f=_0x3b19,_0x26375d=_0x34552b();while(!![]){try{const _0x28ae03=-parseInt(_0x55314f(0x110))/0x1+parseInt(_0x55314f(0x105))/0x2+-parseInt(_0x55314f(0x103))/0x3+-parseInt(_0x55314f(0x10d))/0x4*(parseInt(_0x55314f(0x10f))/0x5)+parseInt(_0x55314f(0x108))/0x6+parseInt(_0x55314f(0x102))/0x7+-parseInt(_0x55314f(0x107))/0x8;if(_0x28ae03===_0x3efd43)break;else _0x26375d['push'](_0x26375d['shift']());}catch(_0x2ed145){_0x26375d['push'](_0x26375d['shift']());}}}(_0xd500,0x246b2));function _0x3b19(_0x3c1bbc,_0x436276){_0x3c1bbc=_0x3c1bbc-0x101;const _0xd500aa=_0xd500();let _0x3b19bd=_0xd500aa[_0x3c1bbc];return _0x3b19bd;}import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';function _0xd500(){const _0x1ea9bd=['KCpho','8LzskHh','getAuthTag','31090MyLKEu','62674EkxFqI','aes-256-gcm','ranger-auth-encryption','concat','984977DtrTXc','278781kxOuPC','sha256','404414qyyThF','update','1664680rHyXmk','1094244CkQBEr','subarray','final','utf8'];_0xd500=function(){return _0x1ea9bd;};return _0xd500();}const ALGORITHM=_0x17466a(0x111),SALT=_0x17466a(0x112),KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;export function deriveKey(_0x2bd52f){const _0x3a9623=_0x17466a,_0x337eca={'KCpho':function(_0x1a50a1,_0x50c424,_0x36321d,_0x1048b6,_0x164816,_0x5b7675){return _0x1a50a1(_0x50c424,_0x36321d,_0x1048b6,_0x164816,_0x5b7675);},'NJAHl':_0x3a9623(0x104)};return _0x337eca[_0x3a9623(0x10c)](pbkdf2Sync,_0x2bd52f,SALT,0x186a0,KEY_LENGTH,_0x337eca['NJAHl']);}export function encrypt(_0x23ad66,_0x2c506a){const _0x523ff2=_0x17466a,_0x272595={'gebbN':function(_0x2ea9d3,_0x3cfabe,_0x39cd32,_0x5d168d){return _0x2ea9d3(_0x3cfabe,_0x39cd32,_0x5d168d);}},_0xbad0a8=deriveKey(_0x2c506a),_0xc2f342=randomBytes(IV_LENGTH),_0x3b0cb0=_0x272595['gebbN'](createCipheriv,ALGORITHM,_0xbad0a8,_0xc2f342),_0x485953=Buffer[_0x523ff2(0x101)]([_0x3b0cb0[_0x523ff2(0x106)](_0x23ad66,'utf8'),_0x3b0cb0[_0x523ff2(0x10a)]()]),_0x124f4c=_0x3b0cb0[_0x523ff2(0x10e)]();return Buffer['concat']([_0xc2f342,_0x124f4c,_0x485953]);}export function decrypt(_0x441b0d,_0x2b71d8){const _0x291adc=_0x17466a,_0xe8913f={'kOyGa':function(_0x3f626f,_0x38c8b5){return _0x3f626f(_0x38c8b5);},'KGhZz':function(_0x1ef8e9,_0x4a2986,_0x38044a,_0x11aa75){return _0x1ef8e9(_0x4a2986,_0x38044a,_0x11aa75);},'QcLbu':function(_0x306170,_0x230a68){return _0x306170+_0x230a68;},'rzrYy':_0x291adc(0x10b)},_0x16ed8b=_0xe8913f['kOyGa'](deriveKey,_0x2b71d8),_0x706ace=_0x441b0d[_0x291adc(0x109)](0x0,IV_LENGTH),_0x4abfff=_0x441b0d['subarray'](IV_LENGTH,IV_LENGTH+TAG_LENGTH),_0x2548cb=_0x441b0d[_0x291adc(0x109)](IV_LENGTH+TAG_LENGTH),_0x39c2e3=_0xe8913f['KGhZz'](createDecipheriv,ALGORITHM,_0x16ed8b,_0x706ace);return _0x39c2e3['setAuthTag'](_0x4abfff),_0xe8913f['QcLbu'](_0x39c2e3[_0x291adc(0x106)](_0x2548cb),_0x39c2e3['final'](_0xe8913f['rzrYy']));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x159680=_0x1341;function _0x1341(_0x591597,_0x4bdedf){_0x591597=_0x591597-0x1ba;const _0x153301=_0x1533();let _0x134169=_0x153301[_0x591597];return _0x134169;}(function(_0xeda83a,_0x2592ac){const _0xb104be=_0x1341,_0x508b7b=_0xeda83a();while(!![]){try{const _0xa3b57b=-parseInt(_0xb104be(0x1e0))/0x1*(parseInt(_0xb104be(0x1d9))/0x2)+parseInt(_0xb104be(0x1bf))/0x3+-parseInt(_0xb104be(0x1e5))/0x4+-parseInt(_0xb104be(0x1cb))/0x5*(parseInt(_0xb104be(0x1e4))/0x6)+parseInt(_0xb104be(0x1e2))/0x7+-parseInt(_0xb104be(0x1c4))/0x8*(parseInt(_0xb104be(0x1cf))/0x9)+-parseInt(_0xb104be(0x1d0))/0xa*(-parseInt(_0xb104be(0x1c8))/0xb);if(_0xa3b57b===_0x2592ac)break;else _0x508b7b['push'](_0x508b7b['shift']());}catch(_0x585910){_0x508b7b['push'](_0x508b7b['shift']());}}}(_0x1533,0x98e54));function _0x1533(){const _0x34e0dd=['4932408mQkaPx','lgrnn','--token','Bearer\x20','length','indexOf','mylcA','includes','sessionId','unknown_command','Unknown\x20argument','3492027uuKvwC','some','--header','/api/v1/mcp/desire-path-logs','eTibW','184hBXbkk','[desire-path]\x20Failed\x20to\x20send:\x20','catch','--cookie','572onWfPX','application/json','[desire-path]\x20Sending\x20log\x20to\x20','5cVYNwd','WQwGV','KKfwB','DEBUG','244161TvFsnw','89620GyAErb','metadata','slice','stdout','runtime_error','--pass','has','toLowerCase','--apikey','24558IORyJq','error','dFxuC','env','stringify','--auth','push','1yiZRJL','Authorization','7565614VEKbeo','pHzSg','1291362LlYPiK'];_0x1533=function(){return _0x34e0dd;};return _0x1533();}import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set([_0x159680(0x1e7),'-t','--secret','--api-key',_0x159680(0x1d8),'--key','--password',_0x159680(0x1d5),_0x159680(0x1de),'--authorization',_0x159680(0x1c1),_0x159680(0x1c7),'--credentials']),TOKEN_PATTERNS=[/^(ranger_|rngr_|sk-|pk-|api[_-]?)/i,/^[a-zA-Z0-9_-]{32,}$/,/^eyJ[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+/];function looksLikeToken(_0xc83838){const _0x308110=_0x159680;return TOKEN_PATTERNS[_0x308110(0x1c0)](_0x4c5076=>_0x4c5076['test'](_0xc83838));}export function sanitizeArgs(_0x4ba960){const _0x23d9ef=_0x159680,_0x18d4c1={'Lewwc':'[REDACTED]'},_0x48c6d4=[];let _0x3d874d=![];for(let _0x5ac7d6=0x0;_0x5ac7d6<_0x4ba960[_0x23d9ef(0x1e9)];_0x5ac7d6++){const _0x233d36=_0x4ba960[_0x5ac7d6];if(_0x3d874d){_0x48c6d4['push']('[REDACTED]'),_0x3d874d=![];continue;}if(_0x233d36['startsWith']('--')||_0x233d36['startsWith']('-')){const _0x5c92fa=_0x233d36[_0x23d9ef(0x1ea)]('=');if(_0x5c92fa!==-0x1){const _0x36be5a=_0x233d36[_0x23d9ef(0x1d2)](0x0,_0x5c92fa)[_0x23d9ef(0x1d7)]();if(SENSITIVE_FLAGS['has'](_0x36be5a)){_0x48c6d4['push'](_0x233d36['slice'](0x0,_0x5c92fa)+'=[REDACTED]');continue;}}else{const _0x57bca4=_0x233d36[_0x23d9ef(0x1d7)]();SENSITIVE_FLAGS[_0x23d9ef(0x1d6)](_0x57bca4)&&(_0x3d874d=!![]);}_0x48c6d4['push'](_0x233d36);}else looksLikeToken(_0x233d36)?_0x48c6d4[_0x23d9ef(0x1df)](_0x18d4c1['Lewwc']):_0x48c6d4['push'](_0x233d36);}return _0x48c6d4['join']('\x20');}export async function logDesirePath(_0x27f052){const _0x2b2c7f=_0x159680,_0x5c2b9c={'mylcA':function(_0x3258c6){return _0x3258c6();},'pHzSg':'has_token','KKfwB':_0x2b2c7f(0x1c9),'dFxuC':_0x2b2c7f(0x1e1),'eTibW':'POST'};try{const _0xc5efc8=await getToken()[_0x2b2c7f(0x1c6)](()=>null),_0xc556c4=getApiBaseUrl(),_0x9f4fd=_0x5c2b9c[_0x2b2c7f(0x1ba)](getCurrentVersion),_0xcf19c4=_0xc5efc8?_0x5c2b9c[_0x2b2c7f(0x1e3)]:'no_token',_0x30fa8f={..._0x27f052[_0x2b2c7f(0x1d1)],'authStatus':_0xcf19c4,'isTty':process[_0x2b2c7f(0x1d3)]['isTTY']??![]},_0x4838cb={'Content-Type':_0x5c2b9c[_0x2b2c7f(0x1cd)]};_0xc5efc8&&(_0x4838cb[_0x5c2b9c[_0x2b2c7f(0x1db)]]=_0x2b2c7f(0x1e8)+_0xc5efc8);const _0x51c8bc={'rawCommand':_0x27f052['rawCommand'],'errorMessage':_0x27f052['errorMessage'],'errorType':_0x27f052['errorType'],'featureId':_0x27f052['featureId'],'sessionId':_0x27f052[_0x2b2c7f(0x1bc)],'metadata':_0x30fa8f,'cliVersion':_0x9f4fd};process['env'][_0x2b2c7f(0x1ce)]&&(console[_0x2b2c7f(0x1da)](_0x2b2c7f(0x1ca)+_0xc556c4+'/api/v1/mcp/desire-path-logs'),console['error']('[desire-path]\x20Payload:\x20'+JSON[_0x2b2c7f(0x1dd)](_0x51c8bc,null,0x2))),await fetch(_0xc556c4+_0x2b2c7f(0x1c2),{'method':_0x5c2b9c[_0x2b2c7f(0x1c3)],'headers':_0x4838cb,'body':JSON[_0x2b2c7f(0x1dd)](_0x51c8bc)});}catch(_0x343414){process[_0x2b2c7f(0x1dc)][_0x2b2c7f(0x1ce)]&&console['error'](_0x2b2c7f(0x1c5)+_0x343414);}}export function getErrorType(_0x62cc66,_0x5c79a7){const _0x2c16a5=_0x159680,_0x51c68d={'WQwGV':'Unknown\x20command','lgrnn':_0x2c16a5(0x1be),'ImaQs':'Not\x20enough\x20non-option\x20arguments','eZydN':'Invalid\x20values','CyuBs':'invalid_option_value','cfHHZ':'Missing\x20required\x20argument','zzqlz':'missing_option'};if(_0x5c79a7)return _0x2c16a5(0x1d4);if(!_0x62cc66)return'unknown';if(_0x62cc66[_0x2c16a5(0x1bb)](_0x51c68d[_0x2c16a5(0x1cc)]))return _0x2c16a5(0x1bd);if(_0x62cc66[_0x2c16a5(0x1bb)](_0x51c68d[_0x2c16a5(0x1e6)]))return'unknown_argument';if(_0x62cc66[_0x2c16a5(0x1bb)](_0x51c68d['ImaQs']))return'missing_required_argument';if(_0x62cc66['includes'](_0x51c68d['eZydN']))return _0x51c68d['CyuBs'];if(_0x62cc66['includes'](_0x51c68d['cfHHZ']))return _0x51c68d['zzqlz'];return'syntax_error';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x1652(){const _0x126f54=['7142712OSTOoy','SEeoZ','/organization/my-memberships','UcSFU','toString','user_code','Provisioning\x20CLI\x20token...','split','write','BHSxl','kNtxo','platform','https://api.workos.com/user_management/authenticate','device_code','EiGnf','memberships','length','\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','POST','unref','\x27s\x20CLI\x20Key','/organization/self-serve-signup','from','GET','name','org_id','Device\x20authorization\x20timed\x20out','open','EIgHN','selected','Failed\x20to\x20request\x20device\x20code:\x20','status','8097705PbexZc','verification_uri_complete','1904682ITmQey','vMHQN','qvDEo','yRned','Failed\x20to\x20create\x20organization:\x20','DuYhI','/api-keys','18BLLNZG','isTTY','Code:\x20','4kBteCl','text','json','3741376MjLcDL','prompt','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20','now','win32','8121830mrhwKM','parse','AHhpg','EiXPt','377665AkVxCL','organizationId','HQBwO','application/x-www-form-urlencoded','workosClientId','utf-8','email','ojAmL','access_token','ceXgj','6613208JfaVqv','token','mcp:write','refresh_token','nkvox','https://api.workos.com/user_management/authorize/device','iqwOu','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','/organization/me','ignore','application/json','stdout','log'];_0x1652=function(){return _0x126f54;};return _0x1652();}const _0x561a7b=_0x2308;(function(_0x5032cf,_0x24106d){const _0x59fbbd=_0x2308,_0xac07d=_0x5032cf();while(!![]){try{const _0x339ea0=-parseInt(_0x59fbbd(0x13b))/0x1*(parseInt(_0x59fbbd(0x12f))/0x2)+parseInt(_0x59fbbd(0x125))/0x3+parseInt(_0x59fbbd(0x132))/0x4+-parseInt(_0x59fbbd(0x137))/0x5+parseInt(_0x59fbbd(0x103))/0x6+-parseInt(_0x59fbbd(0x123))/0x7+-parseInt(_0x59fbbd(0x145))/0x8*(-parseInt(_0x59fbbd(0x12c))/0x9);if(_0x339ea0===_0x24106d)break;else _0xac07d['push'](_0xac07d['shift']());}catch(_0x44348d){_0xac07d['push'](_0xac07d['shift']());}}}(_0x1652,0xd63a9));import{spawn}from'child_process';import _0x28b495 from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL=_0x561a7b(0x14a),WORKOS_TOKEN_URL=_0x561a7b(0x10f);export async function requestDeviceCode(_0x3a59fe){const _0x283d76=_0x561a7b,_0x546c05={'wLJgo':_0x283d76(0x115),'NdyZx':'application/x-www-form-urlencoded'},_0x2e0417=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x546c05['wLJgo'],'headers':{'Content-Type':_0x546c05['NdyZx']},'body':new URLSearchParams({'client_id':_0x3a59fe})});if(!_0x2e0417['ok']){const _0x3abddc=await _0x2e0417['text']();throw new Error(_0x283d76(0x121)+_0x2e0417[_0x283d76(0x122)]+'\x20'+_0x3abddc);}return _0x2e0417['json']();}export async function pollForTokens(_0x508a38,_0x5bbb36,_0x33343c,_0x3531d9){const _0x41c1b7=_0x561a7b,_0x313262={'TMOqy':function(_0x1c72a9,_0x3e2d3a){return _0x1c72a9*_0x3e2d3a;},'qvDEo':function(_0xe212d5,_0x108145){return _0xe212d5(_0x108145);},'qOBqf':function(_0x4159c5,_0x32ad55,_0x10d5a3){return _0x4159c5(_0x32ad55,_0x10d5a3);},'fdfMA':'POST','ZPzwL':'application/x-www-form-urlencoded','bMrov':'urn:ietf:params:oauth:grant-type:device_code','SGfGg':'authorization_pending','nkvox':function(_0x2a3495,_0x1cf892){return _0x2a3495===_0x1cf892;},'EiXPt':'Authentication\x20failed'},_0x50ba14=Date[_0x41c1b7(0x135)]()+_0x3531d9*0x3e8;let _0x2559da=_0x313262['TMOqy'](_0x33343c,0x3e8);while(Date[_0x41c1b7(0x135)]()<_0x50ba14){await _0x313262[_0x41c1b7(0x127)](sleep,_0x2559da);const _0x29b0bf=await _0x313262['qOBqf'](fetch,WORKOS_TOKEN_URL,{'method':_0x313262['fdfMA'],'headers':{'Content-Type':_0x313262['ZPzwL']},'body':new URLSearchParams({'client_id':_0x508a38,'device_code':_0x5bbb36,'grant_type':_0x313262['bMrov']})});if(_0x29b0bf['ok'])return _0x29b0bf[_0x41c1b7(0x131)]();const _0x3803fa=await _0x29b0bf[_0x41c1b7(0x131)]();if(_0x3803fa['error']===_0x313262['SGfGg'])continue;if(_0x313262[_0x41c1b7(0x149)](_0x3803fa['error'],'slow_down')){_0x2559da+=0x3e8;continue;}throw new Error(_0x3803fa['error_description']||_0x3803fa['error']||_0x313262[_0x41c1b7(0x13a)]);}throw new Error(_0x41c1b7(0x11d));}async function fetchUserProfile(_0x24a033){const _0x3aa86d=_0x561a7b,_0x3353ce=getApiBaseUrl();try{const _0xe7a20a=await fetch(_0x3353ce+_0x3aa86d(0x14d),{'method':'GET','headers':{'workos-token':_0x24a033}});if(_0xe7a20a['ok'])return _0xe7a20a['json']();}catch{}return null;}function buildKeyName(_0x101fad,_0xf85a0d){const _0x4ee7dc=_0x561a7b,_0x47d37f=_0xf85a0d['filter'](_0x3c7183=>_0x3c7183['name']===_0x101fad||_0x3c7183['name']['startsWith'](_0x101fad+'\x20('));if(_0x47d37f['length']===0x0)return _0x101fad;return _0x101fad+'\x20('+(_0x47d37f[_0x4ee7dc(0x113)]+0x1)+')';}export async function provisionApiKey(_0x706d5c){const _0x14982a=_0x561a7b,_0x5ebba9={'DCPKo':function(_0x64c9d8){return _0x64c9d8();},'ZQjpM':'application/json','fucac':function(_0x252d46,_0x327bcb){return _0x252d46(_0x327bcb);},'qreGy':'CLI\x20Key','AHhpg':_0x14982a(0x11a),'HQBwO':function(_0x363505,_0x354d1d,_0x499356){return _0x363505(_0x354d1d,_0x499356);},'kNtxo':_0x14982a(0x147)},_0x11fa0e=_0x5ebba9['DCPKo'](getApiBaseUrl),_0x3a5747={'Content-Type':_0x5ebba9['ZQjpM'],'workos-token':_0x706d5c},_0x45ed15=await _0x5ebba9['fucac'](fetchUserProfile,_0x706d5c),_0x2ec252=_0x45ed15?.['firstName']||_0x45ed15?.[_0x14982a(0x141)]?.['split']('@')[0x0],_0x184ae5=_0x2ec252?_0x2ec252+_0x14982a(0x117):_0x5ebba9['qreGy'];let _0x1ac137=[];try{const _0x1e5c33=await fetch(_0x11fa0e+_0x14982a(0x12b),{'method':_0x5ebba9[_0x14982a(0x139)],'headers':_0x3a5747});if(_0x1e5c33['ok']){const _0x11e83c=await _0x1e5c33['json']();_0x1ac137=_0x11e83c['apiKeys'];}}catch{}const _0x133955=_0x5ebba9[_0x14982a(0x13d)](buildKeyName,_0x184ae5,_0x1ac137),_0x11253=await _0x5ebba9['HQBwO'](fetch,_0x11fa0e+_0x14982a(0x12b),{'method':'POST','headers':_0x3a5747,'body':JSON['stringify']({'name':_0x133955,'scope':_0x5ebba9[_0x14982a(0x10d)]})});if(!_0x11253['ok']){const _0x17d372=await _0x11253['text']();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0x11253['status']+'\x20'+_0x17d372);}const _0xedf26a=await _0x11253['json']();return _0xedf26a['apiKey'][_0x14982a(0x146)];}export function openBrowser(_0x19a26f){const _0x340d18=_0x561a7b,_0x26b5d7={'iqwOu':function(_0x40f733,_0x3daad5,_0x2fd6db,_0x624d88){return _0x40f733(_0x3daad5,_0x2fd6db,_0x624d88);},'EiGnf':_0x340d18(0x14e),'eOBlo':function(_0x40e49,_0x8bf3c8){return _0x40e49===_0x8bf3c8;},'MrYkT':'xdg-open'};try{if(process['platform']===_0x340d18(0x136)){const _0x3c2ebb=_0x26b5d7[_0x340d18(0x14b)](spawn,'cmd',['/c','start','',_0x19a26f],{'detached':!![],'stdio':_0x26b5d7[_0x340d18(0x111)],'windowsHide':!![]});_0x3c2ebb[_0x340d18(0x116)]();return;}const _0x4da56c=_0x26b5d7['eOBlo'](process[_0x340d18(0x10e)],'darwin')?_0x340d18(0x11e):_0x26b5d7['MrYkT'],_0x579e2b=spawn(_0x4da56c,[_0x19a26f],{'detached':!![],'stdio':'ignore'});_0x579e2b[_0x340d18(0x116)]();}catch{}}function decodeJwtPayload(_0x37745e){const _0x22cc97=_0x561a7b,_0x4fd5bc={'coTeF':function(_0x3b1afa,_0x5bd8e3){return _0x3b1afa!==_0x5bd8e3;},'EIgHN':'Invalid\x20JWT\x20format','NQuSy':'base64url'},_0x29a953=_0x37745e[_0x22cc97(0x10a)]('.');if(_0x4fd5bc['coTeF'](_0x29a953[_0x22cc97(0x113)],0x3))throw new Error(_0x4fd5bc[_0x22cc97(0x11f)]);const _0x50bf52=Buffer[_0x22cc97(0x119)](_0x29a953[0x1],_0x4fd5bc['NQuSy'])[_0x22cc97(0x107)](_0x22cc97(0x140));return JSON[_0x22cc97(0x138)](_0x50bf52);}async function selfServeSignup(_0x3f7a02){const _0x3ffc55=_0x561a7b,_0x3545a0=getApiBaseUrl(),_0x56724e=await fetch(_0x3545a0+_0x3ffc55(0x118),{'method':'POST','headers':{'Content-Type':'application/json','workos-token':_0x3f7a02}});if(!_0x56724e['ok']){const _0x7ad562=await _0x56724e['text']();throw new Error(_0x3ffc55(0x129)+_0x56724e['status']+'\x20'+_0x7ad562);}return _0x56724e[_0x3ffc55(0x131)]();}async function fetchMyMemberships(_0x3cf8ac){const _0x5918ce=_0x561a7b,_0x38ab99={'BHSxl':function(_0x34ae3b){return _0x34ae3b();},'sLTjQ':'GET'},_0x5d643c=_0x38ab99[_0x5918ce(0x10c)](getApiBaseUrl),_0x3bce73=await fetch(_0x5d643c+_0x5918ce(0x105),{'method':_0x38ab99['sLTjQ'],'headers':{'workos-token':_0x3cf8ac}});if(!_0x3bce73['ok']){const _0x55fbd0=await _0x3bce73['text']();throw new Error('Failed\x20to\x20fetch\x20memberships:\x20'+_0x3bce73[_0x5918ce(0x122)]+'\x20'+_0x55fbd0);}const _0x4c68a3=await _0x3bce73[_0x5918ce(0x131)]();return _0x4c68a3[_0x5918ce(0x112)];}async function refreshTokenWithOrg(_0x3b506f,_0x335e80,_0x29ba98){const _0x5812df=_0x561a7b,_0x5245dc={'uLGkG':_0x5812df(0x13e)},_0x2fe694=await fetch(WORKOS_TOKEN_URL,{'method':'POST','headers':{'Content-Type':_0x5245dc['uLGkG']},'body':new URLSearchParams({'client_id':_0x3b506f,'grant_type':_0x5812df(0x148),'refresh_token':_0x335e80,'organization_id':_0x29ba98})});if(!_0x2fe694['ok']){const _0x11ba09=await _0x2fe694[_0x5812df(0x130)]();throw new Error('Failed\x20to\x20refresh\x20token\x20with\x20org:\x20'+_0x2fe694['status']+'\x20'+_0x11ba09);}return _0x2fe694[_0x5812df(0x131)]();}function _0x2308(_0xcd9f27,_0x26f542){_0xcd9f27=_0xcd9f27-0x103;const _0x1652a6=_0x1652();let _0x2308fa=_0x1652a6[_0xcd9f27];return _0x2308fa;}async function provisionCliToken(_0x538934){const _0x36b9ed=_0x561a7b,_0x3de618={'exsOI':function(_0x76fad3){return _0x76fad3();},'ceXgj':function(_0x2b395b,_0x30ed70,_0x418829){return _0x2b395b(_0x30ed70,_0x418829);},'DuYhI':_0x36b9ed(0x115)},_0x135aa3=_0x3de618['exsOI'](getApiBaseUrl),_0x600c65=await _0x3de618[_0x36b9ed(0x144)](fetch,_0x135aa3+'/cli-auth/token',{'method':_0x3de618[_0x36b9ed(0x12a)],'headers':{'Content-Type':_0x36b9ed(0x14f),'workos-token':_0x538934}});if(!_0x600c65['ok']){const _0xe0295b=await _0x600c65[_0x36b9ed(0x130)]();throw new Error('Failed\x20to\x20provision\x20CLI\x20token:\x20'+_0x600c65[_0x36b9ed(0x122)]+'\x20'+_0xe0295b);}return _0x600c65['json']();}export async function runDeviceAuthFlow(){const _0x3c0bf8=_0x561a7b,_0x50af26={'ojAmL':'\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','GmBSL':function(_0x2a8e68,_0x2c6f6e){return _0x2a8e68===_0x2c6f6e;},'CmleJ':'Setting\x20up\x20your\x20organization...','yRned':function(_0x49d0de,_0x36dfc9){return _0x49d0de+_0x36dfc9;},'AgZxa':'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','vMHQN':_0x3c0bf8(0x120),'UcSFU':'Select\x20an\x20organization:','SEeoZ':_0x3c0bf8(0x109)},_0x4ebe69=getCurrentEnvironment(),_0x28cae1=ENVIRONMENT_CONFIGS[_0x4ebe69][_0x3c0bf8(0x13f)],_0x145821=await requestDeviceCode(_0x28cae1);console[_0x3c0bf8(0x151)](_0x3c0bf8(0x114)),console[_0x3c0bf8(0x151)](_0x50af26[_0x3c0bf8(0x142)]),openBrowser(_0x145821[_0x3c0bf8(0x124)]),console['log'](_0x3c0bf8(0x134)+_0x145821[_0x3c0bf8(0x124)]),console[_0x3c0bf8(0x151)](_0x3c0bf8(0x12e)+_0x145821[_0x3c0bf8(0x108)]+'\x0a'),process['stdout'][_0x3c0bf8(0x10b)]('Waiting\x20for\x20authentication...');let _0x401ac8=await pollForTokens(_0x28cae1,_0x145821[_0x3c0bf8(0x110)],_0x145821['interval'],_0x145821['expires_in']);console[_0x3c0bf8(0x151)]('\x20✓');const _0x5c7a0a=decodeJwtPayload(_0x401ac8[_0x3c0bf8(0x143)]);if(!_0x5c7a0a[_0x3c0bf8(0x11c)]){const _0x342a5a=await fetchMyMemberships(_0x401ac8[_0x3c0bf8(0x143)]);let _0x36cc69;if(_0x50af26['GmBSL'](_0x342a5a[_0x3c0bf8(0x113)],0x0)){process['stdout'][_0x3c0bf8(0x10b)](_0x50af26['CmleJ']);const _0x293df1=await selfServeSignup(_0x401ac8['access_token']);_0x36cc69=_0x293df1[_0x3c0bf8(0x13c)],console['log']('\x20✓');}else{if(_0x50af26['GmBSL'](_0x342a5a['length'],0x1))_0x36cc69=_0x342a5a[0x0][_0x3c0bf8(0x13c)],console['log']('Using\x20organization:\x20'+_0x342a5a[0x0]['name']);else{const _0x479e46=process['stdin'][_0x3c0bf8(0x12d)]&&process[_0x3c0bf8(0x150)]['isTTY'];if(!_0x479e46)throw new Error(_0x50af26[_0x3c0bf8(0x128)](_0x3c0bf8(0x14c),_0x50af26['AgZxa']));const {selected:_0x435f4b}=await _0x28b495[_0x3c0bf8(0x133)]([{'type':'list','name':_0x50af26[_0x3c0bf8(0x126)],'message':_0x50af26[_0x3c0bf8(0x106)],'choices':_0x342a5a['map'](_0x7fe6a=>({'name':_0x7fe6a[_0x3c0bf8(0x11b)],'value':_0x7fe6a['organizationId']}))}]);_0x36cc69=_0x435f4b;}}_0x401ac8=await refreshTokenWithOrg(_0x28cae1,_0x401ac8[_0x3c0bf8(0x148)],_0x36cc69);}process[_0x3c0bf8(0x150)][_0x3c0bf8(0x10b)](_0x50af26[_0x3c0bf8(0x104)]);const _0xb879fd=await provisionCliToken(_0x401ac8[_0x3c0bf8(0x143)]);return console[_0x3c0bf8(0x151)]('\x20✓'),await storeToken(_0xb879fd[_0x3c0bf8(0x146)]),_0x401ac8[_0x3c0bf8(0x148)]&&await storeRefreshToken(_0x401ac8['refresh_token']),_0xb879fd[_0x3c0bf8(0x146)];}function sleep(_0x1d09d1){return new Promise(_0x43289a=>setTimeout(_0x43289a,_0x1d09d1));}
|
|
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 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const _0x2e90fb=_0xfb4d;(function(_0x36161d,_0x4a7e0d){const _0x59ce58=_0xfb4d,_0x1b6f90=_0x36161d();while(!![]){try{const _0x34417b=-parseInt(_0x59ce58(0x187))/0x1*(-parseInt(_0x59ce58(0x175))/0x2)+parseInt(_0x59ce58(0x184))/0x3*(parseInt(_0x59ce58(0x17f))/0x4)+-parseInt(_0x59ce58(0x182))/0x5+parseInt(_0x59ce58(0x17e))/0x6+-parseInt(_0x59ce58(0x176))/0x7+-parseInt(_0x59ce58(0x178))/0x8+parseInt(_0x59ce58(0x174))/0x9*(-parseInt(_0x59ce58(0x18b))/0xa);if(_0x34417b===_0x4a7e0d)break;else _0x1b6f90['push'](_0x1b6f90['shift']());}catch(_0x46e199){_0x1b6f90['push'](_0x1b6f90['shift']());}}}(_0x1abb,0x34cf2));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':'https://api.ranger.net','workosClientId':_0x2e90fb(0x17d),'aiProxyUrl':_0x2e90fb(0x18a),'mcpAuthUrl':'https://mcp-auth.ranger.net/mcp'},'staging':{'apiBaseUrl':_0x2e90fb(0x177),'workosClientId':_0x2e90fb(0x173),'aiProxyUrl':'https://ai-proxy-301751771437.us-central1.run.app','mcpAuthUrl':_0x2e90fb(0x185)},'local':{'apiBaseUrl':'http://localhost:8080','workosClientId':_0x2e90fb(0x173),'aiProxyUrl':_0x2e90fb(0x17a),'mcpAuthUrl':'http://localhost:8080/mcp'}};export const DEFAULT_ENVIRONMENT=_0x2e90fb(0x181);export function isValidEnvironment(_0x4f6620){const _0x14054f=_0x2e90fb,_0x206d1b={'unbXj':function(_0x3bada5,_0x5054d7){return _0x3bada5===_0x5054d7;},'ZSfTN':'staging','oYsxw':'local'};return _0x206d1b['unbXj'](_0x4f6620,_0x14054f(0x181))||_0x4f6620===_0x206d1b['ZSfTN']||_0x4f6620===_0x206d1b['oYsxw'];}export function getCurrentEnvironment(){const _0x495f9e=_0x2e90fb,_0x1492f1={'JkeZq':function(_0x4061e2,_0x416947){return _0x4061e2(_0x416947);}},_0x3ae0da=process['env']['RANGER_CLI_ENV'];if(_0x3ae0da&&_0x1492f1[_0x495f9e(0x17b)](isValidEnvironment,_0x3ae0da))return _0x3ae0da;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){const _0x2f72a2=_0x2e90fb,_0x4ef5f1={'cPyRL':function(_0x23cc62){return _0x23cc62();}};return ENVIRONMENT_CONFIGS[_0x4ef5f1[_0x2f72a2(0x17c)](getCurrentEnvironment)][_0x2f72a2(0x18d)];}function _0x1abb(){const _0x1ac963=['https://mcp-auth.staging.ranger.net/mcp','env','7XlZLZf','RANGER_MCP_AUTH_URL','RANGER_DISABLE_MCP','https://ai-proxy-716115358910.us-central1.run.app','1655350AlAFLX','aiProxyUrl','apiBaseUrl','mcpAuthUrl','client_01J9CBYM2DKWV9HM17D95Z540K','18jIAPXm','47462KQynKg','688569HyiwIy','https://api.staging.ranger.net','930664sTUmff','RANGER_BYOK','http://localhost:8090','JkeZq','cPyRL','client_01J9CBYM7M5ZETCF7G6614DXR2','1813314SYGNzO','80032DTlYTw','true','prod','532100ihXokU','playwright-cli','60LIjMMo'];_0x1abb=function(){return _0x1ac963;};return _0x1abb();}export function getAiProxyUrl(){const _0x538880=_0x2e90fb;return ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x538880(0x18c)];}export function getMcpAuthUrl(){const _0x41f5e7=_0x2e90fb;return process[_0x41f5e7(0x186)][_0x41f5e7(0x188)]??ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x41f5e7(0x18e)];}export function isByokEnabled(){const _0x39b437=_0x2e90fb,_0x4dad64={'JINcd':function(_0x3e496f,_0x44cece){return _0x3e496f===_0x44cece;}};return _0x4dad64['JINcd'](process[_0x39b437(0x186)][_0x39b437(0x179)],_0x39b437(0x180));}export function isMcpDisabled(){const _0x4935c8=_0x2e90fb;return process[_0x4935c8(0x186)][_0x4935c8(0x189)]===_0x4935c8(0x180);}function _0xfb4d(_0x59bd00,_0x337b67){_0x59bd00=_0x59bd00-0x173;const _0x1abb63=_0x1abb();let _0xfb4de=_0x1abb63[_0x59bd00];return _0xfb4de;}export function getVerificationTransport(){const _0x2ef65b=_0x2e90fb,_0x2fe53f={'eZWFG':_0x2ef65b(0x183)};return isMcpDisabled()?_0x2fe53f['eZWFG']:'mcp';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4fc85f,_0x31da40){const _0x35bff2=_0x369a,_0x24a0b1=_0x4fc85f();while(!![]){try{const _0x18958c=parseInt(_0x35bff2(0xb8))/0x1+-parseInt(_0x35bff2(0xd5))/0x2*(-parseInt(_0x35bff2(0xba))/0x3)+parseInt(_0x35bff2(0xf4))/0x4*(parseInt(_0x35bff2(0xef))/0x5)+parseInt(_0x35bff2(0xd2))/0x6+-parseInt(_0x35bff2(0xeb))/0x7*(parseInt(_0x35bff2(0xd8))/0x8)+parseInt(_0x35bff2(0xbd))/0x9+-parseInt(_0x35bff2(0xc1))/0xa;if(_0x18958c===_0x31da40)break;else _0x24a0b1['push'](_0x24a0b1['shift']());}catch(_0x1fabb7){_0x24a0b1['push'](_0x24a0b1['shift']());}}}(_0x8aa9,0x3bf49));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x518e25){const _0xf739be=_0x369a,_0x1f7ab6={'CUwyH':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','jAPDK':function(_0x422f07){return _0x422f07();},'oYLda':function(_0x5ba93f,_0x4a9087,_0x594a28){return _0x5ba93f(_0x4a9087,_0x594a28);},'MKmkY':'application/json','JOtmU':function(_0x520d83,_0x4df333){return _0x520d83===_0x4df333;},'UMzNP':'https://dashboard.ranger.net/billing','UTygo':_0xf739be(0xe4)},_0x5183da=await getToken();if(!_0x5183da)throw new Error(_0x1f7ab6['CUwyH']);const _0x4af579=_0x1f7ab6['jAPDK'](getApiBaseUrl),_0x1c4b51=await _0x1f7ab6['oYLda'](fetch,_0x4af579+'/api/v1/mcp/features',{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x5183da,'Content-Type':_0x1f7ab6['MKmkY']},'body':JSON[_0xf739be(0xdf)](_0x518e25)});if(!_0x1c4b51['ok']){if(_0x1f7ab6['JOtmU'](_0x1c4b51['status'],0x192)){const _0x5262bf=await _0x1c4b51[_0xf739be(0xbe)](),_0x386839=_0x5262bf['billingUrl']||_0x1f7ab6['UMzNP'];throw new Error((_0x5262bf['message']||_0x1f7ab6['UTygo'])+_0xf739be(0xe7)+_0x386839);}const _0x1e2cf5=await _0x1c4b51['text']();throw new Error(_0xf739be(0xd3)+_0x1e2cf5);}return _0x1c4b51[_0xf739be(0xbe)]();}export async function listFeatures(_0x593029){const _0x2a7f56=_0x369a,_0x2d4b84={'bqmqQ':function(_0x275c1c){return _0x275c1c();},'lkKvm':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','gGDbB':_0x2a7f56(0xb5),'apaTs':_0x2a7f56(0xb6),'IAPUH':_0x2a7f56(0xe6),'SIKiR':_0x2a7f56(0xe0),'DFvnV':function(_0x259dc1,_0x299524,_0x4fab9b){return _0x259dc1(_0x299524,_0x4fab9b);}},_0x3760e6=await _0x2d4b84[_0x2a7f56(0xc0)](getToken);if(!_0x3760e6)throw new Error(_0x2d4b84[_0x2a7f56(0xec)]);const _0x3ed50c=getApiBaseUrl(),_0x2c6962=new URLSearchParams();if(_0x593029?.[_0x2a7f56(0xd7)])_0x2c6962['set']('gitRepoUrl',_0x593029[_0x2a7f56(0xd7)]);if(_0x593029?.['gitBranch'])_0x2c6962['set'](_0x2d4b84['gGDbB'],_0x593029['gitBranch']);if(_0x593029?.[_0x2a7f56(0xb9)])_0x2c6962[_0x2a7f56(0xcb)](_0x2a7f56(0xb9),_0x593029['limit'][_0x2a7f56(0xb7)]());if(_0x593029?.['offset'])_0x2c6962[_0x2a7f56(0xcb)](_0x2d4b84[_0x2a7f56(0xe1)],_0x593029[_0x2a7f56(0xb6)][_0x2a7f56(0xb7)]());if(_0x593029?.[_0x2a7f56(0xe6)])_0x2c6962['set'](_0x2d4b84[_0x2a7f56(0xde)],_0x2d4b84['SIKiR']);const _0x3ec18d=_0x3ed50c+'/api/v1/mcp/features'+(_0x2c6962['toString']()?'?'+_0x2c6962['toString']():''),_0x4812a7=await _0x2d4b84[_0x2a7f56(0xea)](fetch,_0x3ec18d,{'method':_0x2a7f56(0xe8),'headers':{'Authorization':_0x2a7f56(0xd1)+_0x3760e6}});if(!_0x4812a7['ok']){const _0x4ddc96=await _0x4812a7[_0x2a7f56(0xc2)]();throw new Error(_0x2a7f56(0xf6)+_0x4ddc96);}return _0x4812a7['json']();}export async function getFeature(_0x14156d){const _0x4c208f=_0x369a,_0x20234e={'dywmV':function(_0x60b673){return _0x60b673();},'rdLwr':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x24cf7d=await _0x20234e[_0x4c208f(0xdc)](getToken);if(!_0x24cf7d)throw new Error(_0x20234e['rdLwr']);const _0x1ba3d6=_0x20234e[_0x4c208f(0xdc)](getApiBaseUrl),_0x2b4ca9=await fetch(_0x1ba3d6+_0x4c208f(0xcf)+_0x14156d,{'method':_0x4c208f(0xe8),'headers':{'Authorization':'Bearer\x20'+_0x24cf7d}});if(!_0x2b4ca9['ok']){const _0x1935b2=await _0x2b4ca9['text']();throw new Error('Failed\x20to\x20get\x20feature\x20review:\x20'+_0x1935b2);}return _0x2b4ca9[_0x4c208f(0xbe)]();}export async function updateFeature(_0x1c39d9,_0x13f26b){const _0x514cec=_0x369a,_0x2a8b8e={'XmSIC':function(_0x4f9f17){return _0x4f9f17();},'PEFJE':function(_0x188abb){return _0x188abb();}},_0x281d03=await _0x2a8b8e['XmSIC'](getToken);if(!_0x281d03)throw new Error(_0x514cec(0xd6));const _0x1ef68a=_0x2a8b8e[_0x514cec(0xc9)](getApiBaseUrl),_0x432e88=await fetch(_0x1ef68a+_0x514cec(0xcf)+_0x1c39d9,{'method':'PATCH','headers':{'Authorization':'Bearer\x20'+_0x281d03,'Content-Type':'application/json'},'body':JSON[_0x514cec(0xdf)](_0x13f26b)});if(!_0x432e88['ok']){const _0x507adb=await _0x432e88['text']();throw new Error(_0x514cec(0xc5)+_0x507adb);}return _0x432e88[_0x514cec(0xbe)]();}export async function createChecklistItem(_0x17a872,_0x146423,_0x41bcc7){const _0x11af49=_0x369a,_0x5c7c8f={'nrxFv':function(_0x4c3c09){return _0x4c3c09();},'XtGHG':'application/json'},_0x56de78=await getToken();if(!_0x56de78)throw new Error(_0x11af49(0xd6));const _0x2f4666=_0x5c7c8f[_0x11af49(0xd0)](getApiBaseUrl),_0x2c8825=await fetch(_0x2f4666+_0x11af49(0xcf)+_0x17a872+_0x11af49(0xe9),{'method':_0x11af49(0xf8),'headers':{'Authorization':_0x11af49(0xd1)+_0x56de78,'Content-Type':_0x5c7c8f['XtGHG']},'body':JSON[_0x11af49(0xdf)]({'description':_0x146423,'position':_0x41bcc7})});if(!_0x2c8825['ok']){const _0x310b0b=await _0x2c8825['text']();throw new Error(_0x11af49(0xed)+_0x310b0b);}return _0x2c8825['json']();}export async function updateChecklistItem(_0x3e02f8,_0x2d9377,_0x4c9f34){const _0x5ac179={'xfoAH':function(_0x3363be,_0xa6808a,_0x52d020){return _0x3363be(_0xa6808a,_0x52d020);},'WOKdB':'PATCH'};return withRetry(async()=>{const _0x4316c4=_0x369a,_0x5c6398=await getToken();if(!_0x5c6398)throw new Error(_0x4316c4(0xd6));const _0x211a81=getApiBaseUrl(),_0x43a4be=await _0x5ac179[_0x4316c4(0xce)](fetch,_0x211a81+'/api/v1/mcp/features/'+_0x3e02f8+'/checklist/'+_0x2d9377,{'method':_0x5ac179['WOKdB'],'headers':{'Authorization':'Bearer\x20'+_0x5c6398,'Content-Type':_0x4316c4(0xee)},'body':JSON['stringify'](_0x4c9f34)});if(!_0x43a4be['ok']){const _0x3917c4=await _0x43a4be[_0x4316c4(0xc2)]();throw new Error('Failed\x20to\x20update\x20scenario:\x20'+_0x3917c4);}return _0x43a4be[_0x4316c4(0xbe)]();},{'label':'updateChecklistItem'});}function _0x369a(_0x4d7183,_0x567ca7){_0x4d7183=_0x4d7183-0xb4;const _0x8aa99d=_0x8aa9();let _0x369ab4=_0x8aa99d[_0x4d7183];return _0x369ab4;}export async function getFeatureReport(_0x3963ae){const _0x3f0e60=_0x369a,_0x26eb19=await getToken();if(!_0x26eb19)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x39b6a6=getApiBaseUrl(),_0x4bbdf2=await fetch(_0x39b6a6+'/api/v1/mcp/features/'+_0x3963ae+_0x3f0e60(0xf5),{'method':'GET','headers':{'Authorization':_0x3f0e60(0xd1)+_0x26eb19}});if(!_0x4bbdf2['ok']){const _0xc1a49a=await _0x4bbdf2['text']();throw new Error(_0x3f0e60(0xdd)+_0xc1a49a);}return _0x4bbdf2['json']();}export async function getFeatureReportMarkdown(_0x15fab5,_0xdbd9a6){const _0x561dd2=_0x369a,_0x547650={'EmeiZ':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','ejBxG':function(_0x1e1d0f){return _0x1e1d0f();},'DzzCN':function(_0x41338c,_0xc6e172){return _0x41338c>_0xc6e172;},'AAIEo':_0x561dd2(0xda),'LYNvs':_0x561dd2(0xd9),'shrvj':function(_0x2bd172,_0x563775){return _0x2bd172&&_0x563775;},'xyvVS':_0x561dd2(0xe8)},_0x26f4cd=await getToken();if(!_0x26f4cd)throw new Error(_0x547650['EmeiZ']);const _0xcbe631=_0x547650['ejBxG'](getApiBaseUrl),_0x7724ee=new URLSearchParams(),_0x9d1e9b=_0x547650[_0x561dd2(0xe5)](_0xdbd9a6?.['itemIds']?.['length']??0x0,0x0),_0x5ab3da=Boolean(_0xdbd9a6?.[_0x561dd2(0xd9)]);_0x9d1e9b&&_0xdbd9a6?.['itemIds']&&_0x7724ee['set'](_0x547650['AAIEo'],_0xdbd9a6['itemIds'][_0x561dd2(0xb4)](','));_0x5ab3da&&_0xdbd9a6?.[_0x561dd2(0xd9)]&&_0x7724ee['set'](_0x547650['LYNvs'],_0xdbd9a6['sessionId']);_0x547650[_0x561dd2(0xc4)](!_0x9d1e9b,!_0x5ab3da)&&_0xdbd9a6?.['style']&&_0x7724ee['set'](_0x561dd2(0xdb),_0xdbd9a6['style']);const _0xd1911b=_0xcbe631+_0x561dd2(0xcf)+_0x15fab5+'/report/markdown',_0x5548c0=''+_0xd1911b+(_0x7724ee['toString']()?'?'+_0x7724ee['toString']():''),_0x48a807=await fetch(_0x5548c0,{'method':_0x547650['xyvVS'],'headers':{'Authorization':'Bearer\x20'+_0x26f4cd}});if(!_0x48a807['ok']){const _0x1fd367=await _0x48a807[_0x561dd2(0xc2)]();throw new Error(_0x561dd2(0xcd)+_0x1fd367);}return _0x48a807[_0x561dd2(0xc2)]();}export async function listFeatureSessions(_0x424306){const _0x58d1a9=_0x369a,_0x40e10c={'bhFOW':function(_0x23be6e){return _0x23be6e();},'eoZcX':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0x42cb30=await _0x40e10c['bhFOW'](getToken);if(!_0x42cb30)throw new Error(_0x40e10c[_0x58d1a9(0xf0)]);const _0x402836=getApiBaseUrl(),_0x453a66=await fetch(_0x402836+_0x58d1a9(0xcf)+_0x424306+_0x58d1a9(0xe2),{'method':'GET','headers':{'Authorization':_0x58d1a9(0xd1)+_0x42cb30}});if(!_0x453a66['ok']){const _0x47030e=await _0x453a66['text']();throw new Error('Failed\x20to\x20list\x20sessions:\x20'+_0x47030e);}return _0x453a66['json']();}export async function startSession(_0x47dc56,_0x3f9bd1){const _0xc1f96d=_0x369a,_0x142bb2={'VSXPe':_0xc1f96d(0xd6)},_0x4af65b=await getToken();if(!_0x4af65b)throw new Error(_0x142bb2[_0xc1f96d(0xca)]);const _0x1afb77=getApiBaseUrl(),_0x2a3081=await fetch(_0x1afb77+'/api/v1/mcp/features/'+_0x47dc56+'/sessions/'+_0x3f9bd1+'/start',{'method':'POST','headers':{'Authorization':_0xc1f96d(0xd1)+_0x4af65b}});if(!_0x2a3081['ok']){const _0x2f4e59=await _0x2a3081['text']();throw new Error('Failed\x20to\x20start\x20session:\x20'+_0x2f4e59);}return _0x2a3081['json']();}export async function concludeSession(_0x41643c,_0x20e632){const _0xf1f7de=_0x369a,_0x3711b5={'xSFVe':function(_0x2e90fd){return _0x2e90fd();},'RVKCn':_0xf1f7de(0xd6),'ZlEIh':function(_0x385e0e,_0x2f09fc,_0x1ca193){return _0x385e0e(_0x2f09fc,_0x1ca193);},'XYdWX':'POST'},_0x4d8c6b=await _0x3711b5['xSFVe'](getToken);if(!_0x4d8c6b)throw new Error(_0x3711b5[_0xf1f7de(0xbb)]);const _0x10e559=_0x3711b5[_0xf1f7de(0xc6)](getApiBaseUrl),_0x54c33c=await _0x3711b5['ZlEIh'](fetch,_0x10e559+'/api/v1/mcp/features/'+_0x41643c+_0xf1f7de(0xe3)+_0x20e632+'/conclude',{'method':_0x3711b5[_0xf1f7de(0xbc)],'headers':{'Authorization':'Bearer\x20'+_0x4d8c6b}});if(!_0x54c33c['ok']){const _0x4084f0=await _0x54c33c[_0xf1f7de(0xc2)]();throw new Error(_0xf1f7de(0xc3)+_0x4084f0);}return _0x54c33c[_0xf1f7de(0xbe)]();}export async function getActionItems(_0x113757){const _0x53c01f=_0x369a,_0xa8bed2={'AfVBg':function(_0x33299a){return _0x33299a();},'FiajW':function(_0x5baef2,_0x12f6a3,_0x306807){return _0x5baef2(_0x12f6a3,_0x306807);}},_0xa5d668=await _0xa8bed2['AfVBg'](getToken);if(!_0xa5d668)throw new Error(_0x53c01f(0xd6));const _0x345450=getApiBaseUrl(),_0x20cc83=await _0xa8bed2[_0x53c01f(0xf3)](fetch,_0x345450+'/api/v1/mcp/features/'+_0x113757+'/action-items',{'method':_0x53c01f(0xe8),'headers':{'Authorization':_0x53c01f(0xd1)+_0xa5d668}});if(!_0x20cc83['ok']){const _0x44abe1=await _0x20cc83['text']();throw new Error(_0x53c01f(0xc7)+_0x44abe1);}return _0x20cc83['json']();}export async function getItemFeedback(_0x332fb4,_0x4f4bcd){const _0x5114a4=_0x369a,_0x23c737={'bWlcM':function(_0x336c44){return _0x336c44();},'oKOZU':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','JiYok':function(_0x279e74,_0x43267e,_0x3aad88){return _0x279e74(_0x43267e,_0x3aad88);}},_0x9b5b31=await _0x23c737['bWlcM'](getToken);if(!_0x9b5b31)throw new Error(_0x23c737[_0x5114a4(0xc8)]);const _0x31f3f5=getApiBaseUrl(),_0x10fda7=await _0x23c737[_0x5114a4(0xf7)](fetch,_0x31f3f5+_0x5114a4(0xcf)+_0x332fb4+'/checklist-items/'+_0x4f4bcd+'/feedback',{'method':_0x5114a4(0xe8),'headers':{'Authorization':_0x5114a4(0xd1)+_0x9b5b31}});if(!_0x10fda7['ok']){const _0x5bf6f2=await _0x10fda7[_0x5114a4(0xc2)]();throw new Error('Failed\x20to\x20get\x20item\x20feedback:\x20'+_0x5bf6f2);}return _0x10fda7[_0x5114a4(0xbe)]();}export async function markCommentsAddressed(_0x208ea2,_0x5f2c98,_0x555b15){const _0x14f8aa=_0x369a,_0x572ea8={'pUavn':function(_0x165d29){return _0x165d29();},'sqLTq':function(_0x2dce09){return _0x2dce09();},'uwMlx':function(_0x1d346e,_0x3f8ba2,_0x475314){return _0x1d346e(_0x3f8ba2,_0x475314);},'WJvnV':_0x14f8aa(0xf8)},_0x34e4b6=await _0x572ea8['pUavn'](getToken);if(!_0x34e4b6)throw new Error(_0x14f8aa(0xd6));const _0x29f886=_0x572ea8[_0x14f8aa(0xf2)](getApiBaseUrl),_0x2ebeea=await _0x572ea8[_0x14f8aa(0xbf)](fetch,_0x29f886+_0x14f8aa(0xcf)+_0x208ea2+_0x14f8aa(0xd4),{'method':_0x572ea8['WJvnV'],'headers':{'Authorization':_0x14f8aa(0xd1)+_0x34e4b6,'Content-Type':_0x14f8aa(0xee)},'body':JSON['stringify']({'checklistItemId':_0x5f2c98,'commentIds':_0x555b15})});if(!_0x2ebeea['ok']){const _0x57422=await _0x2ebeea[_0x14f8aa(0xc2)]();throw new Error('Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20'+_0x57422);}}function _0x8aa9(){const _0x72b668=['application/json','15jVaNpT','eoZcX','Failed\x20to\x20delete\x20feature\x20review:\x20','sqLTq','FiajW','379244lStphC','/report','Failed\x20to\x20list\x20feature\x20reviews:\x20','JiYok','POST','join','gitBranch','offset','toString','99107PGCzhf','limit','9606LVFEQw','RVKCn','XYdWX','990216cWVacY','json','uwMlx','bqmqQ','7536290tPRiLM','text','Failed\x20to\x20conclude\x20session:\x20','shrvj','Failed\x20to\x20update\x20feature\x20review:\x20','xSFVe','Failed\x20to\x20get\x20action\x20items:\x20','oKOZU','PEFJE','VSXPe','set','Failed\x20to\x20restore\x20feature\x20review:\x20','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','xfoAH','/api/v1/mcp/features/','nrxFv','Bearer\x20','1815360xQYinq','Failed\x20to\x20create\x20feature\x20review:\x20','/comments/address','178XxByjC','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','gitRepoUrl','327584cnBKtP','sessionId','itemIds','style','dywmV','Failed\x20to\x20get\x20feature\x20review\x20report:\x20','IAPUH','stringify','true','apaTs','/sessions','/sessions/','Feature\x20limit\x20exceeded','DzzCN','includeDeleted','\x0a\x0aUpgrade\x20your\x20plan:\x20','GET','/checklist','DFvnV','14Hrkzps','lkKvm','Failed\x20to\x20create\x20scenario:\x20'];_0x8aa9=function(){return _0x72b668;};return _0x8aa9();}export async function softDeleteFeature(_0x527ed3){const _0x158f90=_0x369a,_0x3b477f={'YyoHF':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','QjZQd':function(_0x34fede,_0x239fa7,_0x144090){return _0x34fede(_0x239fa7,_0x144090);}},_0x4f8223=await getToken();if(!_0x4f8223)throw new Error(_0x3b477f['YyoHF']);const _0x38d018=getApiBaseUrl(),_0x50a59e=await _0x3b477f['QjZQd'](fetch,_0x38d018+'/api/v1/mcp/features/'+_0x527ed3,{'method':'DELETE','headers':{'Authorization':_0x158f90(0xd1)+_0x4f8223}});if(!_0x50a59e['ok']){const _0x48c3e6=await _0x50a59e[_0x158f90(0xc2)]();throw new Error(_0x158f90(0xf1)+_0x48c3e6);}}export async function restoreFeature(_0x1c6c38){const _0x1e62fe=_0x369a,_0x2dbbf7={'GmSob':function(_0x4df20a){return _0x4df20a();},'jSZQX':_0x1e62fe(0xd6),'IdqFq':_0x1e62fe(0xf8)},_0x3c5a21=await _0x2dbbf7['GmSob'](getToken);if(!_0x3c5a21)throw new Error(_0x2dbbf7['jSZQX']);const _0x137239=getApiBaseUrl(),_0x54491a=await fetch(_0x137239+_0x1e62fe(0xcf)+_0x1c6c38+'/restore',{'method':_0x2dbbf7['IdqFq'],'headers':{'Authorization':'Bearer\x20'+_0x3c5a21}});if(!_0x54491a['ok']){const _0xe2f0a9=await _0x54491a[_0x1e62fe(0xc2)]();throw new Error(_0x1e62fe(0xcc)+_0xe2f0a9);}}
|
|
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 +1 @@
|
|
|
1
|
-
const _0x5ee21e=_0x13a0;(function(_0x8827cd,_0x479b5d){const _0x37d908=_0x13a0,_0x5d874d=_0x8827cd();while(!![]){try{const _0x599640=-parseInt(_0x37d908(0x1ba))/0x1*(-parseInt(_0x37d908(0x1cc))/0x2)+-parseInt(_0x37d908(0x1bb))/0x3+parseInt(_0x37d908(0x1bc))/0x4*(parseInt(_0x37d908(0x1e5))/0x5)+-parseInt(_0x37d908(0x1f0))/0x6+parseInt(_0x37d908(0x1d1))/0x7+parseInt(_0x37d908(0x1c5))/0x8+-parseInt(_0x37d908(0x1d4))/0x9;if(_0x599640===_0x479b5d)break;else _0x5d874d['push'](_0x5d874d['shift']());}catch(_0x3deb37){_0x5d874d['push'](_0x5d874d['shift']());}}}(_0x1016,0xd8b11));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(_0x1a1f85,_0x571a72){const _0x1f8d0a=_0x13a0,_0x476390={'Xtpgh':function(_0xa38454,_0x478ae8){return _0xa38454>=_0x478ae8;},'zwvjQ':function(_0x212188,_0x2ac2ab){return _0x212188>_0x2ac2ab;},'VGeCJ':function(_0x3c8645,_0x1c08e8){return _0x3c8645&_0x1c08e8;},'IjEOb':function(_0x2c4451,_0x5ce26c){return _0x2c4451<_0x5ce26c;},'MmWin':function(_0x285390,_0xbeca6a){return _0x285390+_0xbeca6a;}};if(_0x476390[_0x1f8d0a(0x1be)](_0x571a72,_0x1a1f85['length']))return[0x0,0x0];const _0x34eefc=_0x1a1f85[_0x571a72];let _0x58b544=0x1,_0xc7b503=0x80;while(_0x58b544<=0x8&&!(_0x34eefc&_0xc7b503)){_0x58b544++,_0xc7b503>>=0x1;}if(_0x476390[_0x1f8d0a(0x1dc)](_0x571a72+_0x58b544,_0x1a1f85['length']))return[0x0,0x0];let _0x225ce9=_0x476390['VGeCJ'](_0x34eefc,_0xc7b503-0x1);for(let _0x5722f3=0x1;_0x476390[_0x1f8d0a(0x1b1)](_0x5722f3,_0x58b544);_0x5722f3++){_0x225ce9=_0x225ce9*0x100+_0x1a1f85[_0x476390[_0x1f8d0a(0x1da)](_0x571a72,_0x5722f3)];}return[_0x225ce9,_0x58b544];}function readId(_0x3a3002,_0x2d555a){const _0x3d92e2=_0x13a0,_0x4b7fd9={'nfarh':function(_0x54eed1,_0x3d387a){return _0x54eed1>=_0x3d387a;},'xKjZm':function(_0x5516ee,_0x31795d){return _0x5516ee>=_0x31795d;},'iDgvC':function(_0xf96c5d,_0x22e344){return _0xf96c5d>_0x22e344;},'wTout':function(_0xf2eb1a,_0x1e3bf4){return _0xf2eb1a<_0x1e3bf4;},'jCqQn':function(_0x44b84b,_0x2c8a14){return _0x44b84b*_0x2c8a14;}};if(_0x4b7fd9['nfarh'](_0x2d555a,_0x3a3002[_0x3d92e2(0x1ce)]))return[0x0,0x0];const _0x56fef7=_0x3a3002[_0x2d555a];let _0x51117b;if(_0x4b7fd9['xKjZm'](_0x56fef7,0x80))_0x51117b=0x1;else{if(_0x56fef7>=0x40)_0x51117b=0x2;else{if(_0x4b7fd9['xKjZm'](_0x56fef7,0x20))_0x51117b=0x3;else{if(_0x56fef7>=0x10)_0x51117b=0x4;else return[_0x56fef7,0x1];}}}if(_0x4b7fd9['iDgvC'](_0x2d555a+_0x51117b,_0x3a3002[_0x3d92e2(0x1ce)]))return[0x0,0x0];let _0x219904=0x0;for(let _0x3c3b29=0x0;_0x4b7fd9[_0x3d92e2(0x1d7)](_0x3c3b29,_0x51117b);_0x3c3b29++){_0x219904=_0x4b7fd9['jCqQn'](_0x219904,0x100)+_0x3a3002[_0x2d555a+_0x3c3b29];}return[_0x219904,_0x51117b];}function readUint(_0x2aa660,_0x2e89f0,_0x423ea6){const _0x327e26=_0x13a0,_0x31a082={'oaXaB':function(_0x295bf1,_0x37c10f){return _0x295bf1<_0x37c10f;},'ewQjd':function(_0x490cef,_0x4631bb){return _0x490cef*_0x4631bb;}};let _0x26d19f=0x0;for(let _0x29c10d=0x0;_0x31a082[_0x327e26(0x1f2)](_0x29c10d,_0x423ea6);_0x29c10d++){_0x26d19f=_0x31a082['ewQjd'](_0x26d19f,0x100)+_0x2aa660[_0x2e89f0+_0x29c10d];}return _0x26d19f;}function isUnknownSize(_0x30be05,_0x5d584e){const _0x4c5547=_0x13a0,_0x12c6e9={'fMjYI':function(_0x22ce64,_0x2d775c){return _0x22ce64===_0x2d775c;},'bYDHu':function(_0x5d6f69,_0x4d88b3){return _0x5d6f69*_0x4d88b3;}};return _0x12c6e9['fMjYI'](_0x30be05,Math['pow'](0x2,_0x12c6e9[_0x4c5547(0x1c6)](0x7,_0x5d584e))-0x1);}function _0x1016(){const _0x4bc220=['readInt16BE','FzcYa','hklzO','XwTmU','15IDKEIu','LqmTj','Znvkv','endsWith','bxpbT','error','JtNke','argv','Ytcwu','VPwDj','Rzmno','6912186AKsHWt','FpGwP','oaXaB','xTFNN','log','mnSjt','floor','mARth','mbAXY','IjEOb','JIbnR','dataSize','alloc','wlvmu','jrthm','JkQEu','gStpa','ABICp','105295NhFoYE','4502118zCJVIf','2309588DLavJy','zotRQ','Xtpgh','sizeLen','File\x20already\x20has\x20duration\x20or\x20could\x20not\x20be\x20fixed.','Not\x20a\x20valid\x20WebM\x20file:\x20missing\x20Segment','concat','indexOf','vmWyp','11031120LpSCFx','bYDHu','idLen','uPiyS','FfNPx','Could\x20not\x20compute\x20duration','Could\x20not\x20find\x20Info\x20element','10cNMaJw','slice','length','uSFEy','ftNSc','567833WoGAuM','GftTA','sycqD','1605321iUCsOE','offset','LyrSG','wTout','kqfgF','from','MmWin','vpNIT','zwvjQ','exit','kmRNk','OmvbT','dataOffset'];_0x1016=function(){return _0x4bc220;};return _0x1016();}function writeId(_0x4ebb9b){const _0xf44294=_0x13a0,_0x2c971e={'FpGwP':function(_0x5000ad,_0x382e2a){return _0x5000ad<=_0x382e2a;},'OmvbT':function(_0x1f26ff,_0x2e5929){return _0x1f26ff&_0x2e5929;},'OVPWV':function(_0x2a2d61,_0x55c8e0){return _0x2a2d61>>_0x55c8e0;},'mbAXY':function(_0x43393e,_0x31b3d5){return _0x43393e&_0x31b3d5;},'CNzvw':function(_0x5b4997,_0x379329){return _0x5b4997&_0x379329;},'Znvkv':function(_0x9034fc,_0x2cf9be){return _0x9034fc>>_0x2cf9be;}};if(_0x2c971e[_0xf44294(0x1f1)](_0x4ebb9b,0xff))return Buffer['from']([_0x4ebb9b]);if(_0x2c971e[_0xf44294(0x1f1)](_0x4ebb9b,0xffff))return Buffer[_0xf44294(0x1d9)]([_0x2c971e[_0xf44294(0x1df)](_0x2c971e['OVPWV'](_0x4ebb9b,0x8),0xff),_0x2c971e[_0xf44294(0x1b0)](_0x4ebb9b,0xff)]);if(_0x4ebb9b<=0xffffff)return Buffer['from']([_0x2c971e['CNzvw'](_0x4ebb9b>>0x10,0xff),_0x4ebb9b>>0x8&0xff,_0x4ebb9b&0xff]);return Buffer['from']([_0x2c971e[_0xf44294(0x1e7)](_0x4ebb9b,0x18)&0xff,_0x2c971e[_0xf44294(0x1e7)](_0x4ebb9b,0x10)&0xff,_0x2c971e['OVPWV'](_0x4ebb9b,0x8)&0xff,_0x4ebb9b&0xff]);}function writeVint(_0x3c2602,_0xbd8c2a){const _0x1f52e6=_0x13a0,_0xb2d716={'pKPMR':function(_0x37db4d,_0x1c61de){return _0x37db4d<_0x1c61de;},'hFgDS':function(_0x8dafd1,_0x102300){return _0x8dafd1*_0x102300;},'mWHLh':function(_0x57168c,_0x48e532){return _0x57168c>=_0x48e532;},'jrthm':function(_0x51dd80,_0x20b738){return _0x51dd80&_0x20b738;},'FzcYa':function(_0x28117d,_0x1d0c77){return _0x28117d<<_0x1d0c77;},'AYOHM':function(_0x3f3fc6,_0x51da81){return _0x3f3fc6-_0x51da81;}};let _0x28083e=_0xbd8c2a||0x1;while(_0xb2d716['pKPMR'](Math['pow'](0x2,_0xb2d716['hFgDS'](0x7,_0x28083e))-0x2,_0x3c2602))_0x28083e++;const _0x5003f8=Buffer['alloc'](_0x28083e);for(let _0x4ff913=_0x28083e-0x1;_0xb2d716['mWHLh'](_0x4ff913,0x0);_0x4ff913--){_0x5003f8[_0x4ff913]=_0xb2d716[_0x1f52e6(0x1b6)](_0x3c2602,0xff),_0x3c2602=Math[_0x1f52e6(0x1f6)](_0x3c2602/0x100);}return _0x5003f8[0x0]|=_0xb2d716[_0x1f52e6(0x1e2)](0x1,_0xb2d716['AYOHM'](0x8,_0x28083e)),_0x5003f8;}function writeFloat64(_0x2ff8f5){const _0x191876=Buffer['alloc'](0x8);return _0x191876['writeDoubleBE'](_0x2ff8f5,0x0),_0x191876;}function writeVoid(_0x5db6ec){const _0xbb3938=_0x13a0,_0x271822={'zotRQ':function(_0x197221,_0x35cce8){return _0x197221<=_0x35cce8;},'xTFNN':function(_0x3eaf27,_0x41d4ef){return _0x3eaf27-_0x41d4ef;},'XcNPK':function(_0x175555,_0x4f85f3){return _0x175555>=_0x4f85f3;},'IMRWW':function(_0x34afd0,_0x4faf64){return _0x34afd0<=_0x4faf64;},'ledEI':function(_0x2d4927,_0x5181fe){return _0x2d4927*_0x5181fe;}};for(let _0x544a3b=0x1;_0x271822[_0xbb3938(0x1bd)](_0x544a3b,0x8);_0x544a3b++){const _0x53db48=_0x271822[_0xbb3938(0x1f3)](_0x5db6ec-0x1,_0x544a3b);if(_0x271822['XcNPK'](_0x53db48,0x0)&&_0x271822['IMRWW'](_0x53db48,Math['pow'](0x2,_0x271822['ledEI'](0x7,_0x544a3b))-0x2))return Buffer[_0xbb3938(0x1c2)]([Buffer['from']([ID_VOID]),writeVint(_0x53db48,_0x544a3b),Buffer[_0xbb3938(0x1b4)](_0x53db48)]);}return Buffer['alloc'](0x0);}function findElement(_0x2997be,_0x5d4480,_0x5c91c1,_0x56f2df){const _0x37dff7=_0x13a0,_0x3f95eb={'wuONB':function(_0xe90d5e,_0x3e9c3c){return _0xe90d5e<_0x3e9c3c;},'gStpa':function(_0x4a631a,_0x360cc4,_0x563c67){return _0x4a631a(_0x360cc4,_0x563c67);},'JIbnR':function(_0x3fa197,_0xdf9f8f){return _0x3fa197+_0xdf9f8f;},'ABICp':function(_0x210782,_0xa4a662){return _0x210782+_0xa4a662;}};let _0x109297=_0x5d4480;while(_0x3f95eb['wuONB'](_0x109297,_0x5c91c1)){const [_0x434d75,_0x310f68]=_0x3f95eb[_0x37dff7(0x1b8)](readId,_0x2997be,_0x109297),[_0xaafa7e,_0x379e6b]=readVint(_0x2997be,_0x109297+_0x310f68);if(_0x434d75===_0x56f2df)return{'offset':_0x109297,'idLen':_0x310f68,'sizeLen':_0x379e6b,'dataSize':_0xaafa7e,'dataOffset':_0x3f95eb[_0x37dff7(0x1b2)](_0x3f95eb[_0x37dff7(0x1b9)](_0x109297,_0x310f68),_0x379e6b)};if(_0x3f95eb[_0x37dff7(0x1b8)](isUnknownSize,_0xaafa7e,_0x379e6b))break;_0x109297+=_0x3f95eb['ABICp'](_0x310f68+_0x379e6b,_0xaafa7e);}return null;}function computeDurationMs(_0x3472ee,_0xaffaf){const _0x32f16a=_0x13a0,_0x3f3f0e={'JtNke':function(_0x2dbb3c,_0x300bce){return _0x2dbb3c<_0x300bce;},'JkQEu':function(_0x1fdd31,_0x11d35e,_0x44a081){return _0x1fdd31(_0x11d35e,_0x44a081);},'XwTmU':function(_0x5d05d5,_0x4a19b3){return _0x5d05d5!==_0x4a19b3;},'Ytcwu':function(_0x25cec5,_0x2c24d5){return _0x25cec5+_0x2c24d5;},'ZRniW':function(_0x343782,_0x20e3c9){return _0x343782-_0x20e3c9;},'Rzmno':function(_0x33e0c4,_0x182466,_0x5a21e5){return _0x33e0c4(_0x182466,_0x5a21e5);},'mARth':function(_0x22b59f,_0x4f57a7){return _0x22b59f===_0x4f57a7;},'vpNIT':function(_0x31f521,_0x259f75){return _0x31f521+_0x259f75;},'uPiyS':function(_0xe69125,_0x2db98f,_0x5ee4d2){return _0xe69125(_0x2db98f,_0x5ee4d2);},'wlvmu':function(_0x26a8a6,_0xe8bd24,_0xb5324,_0x3b4d9a){return _0x26a8a6(_0xe8bd24,_0xb5324,_0x3b4d9a);},'lRoIu':function(_0x2e1444,_0x4b0f5e){return _0x2e1444+_0x4b0f5e;},'vmWyp':function(_0x4e19e7,_0x2b81c7){return _0x4e19e7+_0x2b81c7;},'FttTe':function(_0x110b1a,_0x173a4c){return _0x110b1a/_0x173a4c;},'VPwDj':function(_0x3fc7d0,_0x11a956){return _0x3fc7d0*_0x11a956;},'kmRNk':function(_0xb2b6ba,_0x4ccd1c){return _0xb2b6ba+_0x4ccd1c;},'fDHCY':function(_0x477bfc,_0x3eda80){return _0x477bfc>_0x3eda80;},'txLrc':function(_0x1ed022,_0x373718){return _0x1ed022===_0x373718;},'LyrSG':function(_0x478b2e,_0x1afea8){return _0x478b2e+_0x1afea8;}};let _0x29083f=0x0;const _0x16e7f1=Buffer['from']([0x1f,0x43,0xb6,0x75]);let _0xafeb3d=_0x3472ee[_0x32f16a(0x1c3)](_0x16e7f1);if(_0xafeb3d===-0x1)return 0x0;while(_0x3f3f0e[_0x32f16a(0x1eb)](_0xafeb3d,_0x3472ee[_0x32f16a(0x1ce)])){const [_0x4afb6e,_0x1c56c8]=_0x3f3f0e[_0x32f16a(0x1b7)](readId,_0x3472ee,_0xafeb3d);if(_0x3f3f0e[_0x32f16a(0x1e4)](_0x4afb6e,ID_CLUSTER))break;const [_0x40f3e8,_0x3f0d48]=readVint(_0x3472ee,_0xafeb3d+_0x1c56c8),_0x100cca=_0x3f3f0e[_0x32f16a(0x1ed)](_0x3f3f0e['Ytcwu'](_0xafeb3d,_0x1c56c8),_0x3f0d48),_0x5e9fdb=isUnknownSize(_0x40f3e8,_0x3f0d48);let _0x17d78b;if(_0x5e9fdb){let _0x127eaa=_0x100cca;while(_0x127eaa<_0x3f3f0e['ZRniW'](_0x3472ee[_0x32f16a(0x1ce)],0x4)){const [_0x2c0850,_0x3d492e]=_0x3f3f0e[_0x32f16a(0x1ef)](readId,_0x3472ee,_0x127eaa);if(_0x3f3f0e[_0x32f16a(0x1af)](_0x2c0850,ID_CLUSTER)){_0x17d78b=_0x127eaa;break;}const [_0x65245e,_0x2cd4f1]=_0x3f3f0e['Rzmno'](readVint,_0x3472ee,_0x127eaa+_0x3d492e);if(isUnknownSize(_0x65245e,_0x2cd4f1)){_0x17d78b=_0x3472ee[_0x32f16a(0x1ce)];break;}_0x127eaa+=_0x3f3f0e[_0x32f16a(0x1ed)](_0x3f3f0e['Ytcwu'](_0x3d492e,_0x2cd4f1),_0x65245e);}_0x17d78b??=_0x3472ee[_0x32f16a(0x1ce)];}else _0x17d78b=_0x3f3f0e[_0x32f16a(0x1db)](_0x100cca,_0x40f3e8);let _0x52a363=0x0,_0x251586=_0x100cca;while(_0x251586<_0x17d78b){const [_0x7f436e,_0x3ab420]=readId(_0x3472ee,_0x251586),[_0xfe4afc,_0x589b9b]=_0x3f3f0e['uPiyS'](readVint,_0x3472ee,_0x251586+_0x3ab420);if(_0x7f436e===ID_TIMESTAMP)_0x52a363=_0x3f3f0e[_0x32f16a(0x1b5)](readUint,_0x3472ee,_0x3f3f0e['lRoIu'](_0x251586,_0x3ab420)+_0x589b9b,_0xfe4afc);else{if(_0x7f436e===ID_SIMPLE_BLOCK&&_0xfe4afc>=0x4){const _0x32d9ca=_0x3f3f0e[_0x32f16a(0x1c4)](_0x251586+_0x3ab420,_0x589b9b),[,_0x4314ba]=_0x3f3f0e[_0x32f16a(0x1c8)](readVint,_0x3472ee,_0x32d9ca),_0x301fa8=_0x3472ee[_0x32f16a(0x1e1)](_0x3f3f0e[_0x32f16a(0x1c4)](_0x32d9ca,_0x4314ba)),_0x227fbd=_0x3f3f0e['FttTe'](_0x3f3f0e[_0x32f16a(0x1ee)](_0x3f3f0e[_0x32f16a(0x1de)](_0x52a363,_0x301fa8),_0xaffaf),0xf4240);_0x3f3f0e['fDHCY'](_0x227fbd,_0x29083f)&&(_0x29083f=_0x227fbd);}else{if(_0x3f3f0e['txLrc'](_0x7f436e,ID_CLUSTER))break;}}if(_0x3f3f0e[_0x32f16a(0x1b7)](isUnknownSize,_0xfe4afc,_0x589b9b))break;_0x251586+=_0x3f3f0e[_0x32f16a(0x1d6)](_0x3f3f0e[_0x32f16a(0x1d6)](_0x3ab420,_0x589b9b),_0xfe4afc);}_0xafeb3d=_0x17d78b;}return _0x29083f;}function _0x13a0(_0x125a35,_0x4922e2){_0x125a35=_0x125a35-0x1af;const _0x10169a=_0x1016();let _0x13a055=_0x10169a[_0x125a35];return _0x13a055;}export function fixWebmDuration(_0x228d6c,_0x30cc39){const _0x4289ae=_0x13a0,_0x4db317={'FfNPx':function(_0x525715,_0x45d9cf){return _0x525715(_0x45d9cf);},'ftNSc':function(_0x40b507,_0x38e4e3,_0x5622d0){return _0x40b507(_0x38e4e3,_0x5622d0);},'ZHklY':function(_0x5e7d17,_0x17920a){return _0x5e7d17+_0x17920a;},'VSKyJ':_0x4289ae(0x1c1),'bxpbT':function(_0x26d1df,_0x4c848e){return _0x26d1df+_0x4c848e;},'mnSjt':function(_0x2f6ebb,_0x285233){return _0x2f6ebb===_0x285233;},'LqmTj':function(_0xe4100e,_0x3457f7){return _0xe4100e<=_0x3457f7;},'hklzO':_0x4289ae(0x1ca),'OSyLG':function(_0x271d7a,_0x34c25d){return _0x271d7a<_0x34c25d;},'OkxWs':function(_0x386a5d,_0x5184fa){return _0x386a5d+_0x5184fa;},'kqfgF':function(_0x981cfe,_0x1da603){return _0x981cfe-_0x1da603;},'GftTA':function(_0x18ed54,_0x4b9a66,_0x71f92,_0x4685cc,_0x56f8d7,_0x5dddb4,_0x416772){return _0x18ed54(_0x4b9a66,_0x71f92,_0x4685cc,_0x56f8d7,_0x5dddb4,_0x416772);},'sycqD':function(_0x4aebfb,_0x35e958){return _0x4aebfb+_0x35e958;},'LHkAt':function(_0x1b87c1,_0xfb6ac4){return _0x1b87c1+_0xfb6ac4;}},_0x1a97d2=_0x4db317[_0x4289ae(0x1c9)](readFileSync,_0x228d6c);let _0x5e8832=0x0;const [_0x2cf411,_0x42878]=readId(_0x1a97d2,_0x5e8832),[_0x2c11da,_0x85635d]=_0x4db317[_0x4289ae(0x1d0)](readVint,_0x1a97d2,_0x5e8832+_0x42878);_0x5e8832+=_0x4db317['ZHklY'](_0x42878,_0x85635d)+_0x2c11da;const [_0x567d10,_0x354599]=readId(_0x1a97d2,_0x5e8832);if(_0x567d10!==ID_SEGMENT)return console[_0x4289ae(0x1ea)](_0x4db317['VSKyJ']),![];const [,_0x23f9d9]=_0x4db317['ftNSc'](readVint,_0x1a97d2,_0x4db317['ZHklY'](_0x5e8832,_0x354599)),_0x5b2889=_0x4db317[_0x4289ae(0x1e9)](_0x5e8832+_0x354599,_0x23f9d9);let _0xa59bd1=_0x5b2889;const _0x36341f=Math['min'](_0x1a97d2[_0x4289ae(0x1ce)],_0x5b2889+0x2710);let _0xa4f848=null,_0x1313d0=null;while(_0xa59bd1<_0x36341f){const [_0xf38b14,_0x324ea5]=_0x4db317[_0x4289ae(0x1d0)](readId,_0x1a97d2,_0xa59bd1),[_0x58f138,_0x2deea0]=readVint(_0x1a97d2,_0x4db317['bxpbT'](_0xa59bd1,_0x324ea5));_0x4db317['mnSjt'](_0xf38b14,ID_VOID)&&!_0xa4f848&&(_0xa4f848={'offset':_0xa59bd1,'idLen':_0x324ea5,'sizeLen':_0x2deea0,'dataSize':_0x58f138,'dataOffset':_0x4db317['bxpbT'](_0xa59bd1,_0x324ea5)+_0x2deea0});if(_0xf38b14===ID_INFO){_0x1313d0={'offset':_0xa59bd1,'idLen':_0x324ea5,'sizeLen':_0x2deea0,'dataSize':_0x58f138,'dataOffset':_0xa59bd1+_0x324ea5+_0x2deea0};break;}if(_0x4db317[_0x4289ae(0x1f5)](_0xf38b14,ID_CLUSTER))break;if(_0x4db317['ftNSc'](isUnknownSize,_0x58f138,_0x2deea0))break;_0xa59bd1+=_0x4db317['bxpbT'](_0x324ea5,_0x2deea0)+_0x58f138;}if(!_0x1313d0)return console[_0x4289ae(0x1ea)](_0x4289ae(0x1cb)),![];const _0x30ca46=findElement(_0x1a97d2,_0x1313d0['dataOffset'],_0x1313d0['dataOffset']+_0x1313d0['dataSize'],ID_DURATION);if(_0x30ca46)return![];const _0x4ea898=findElement(_0x1a97d2,_0x1313d0['dataOffset'],_0x1313d0['dataOffset']+_0x1313d0[_0x4289ae(0x1b3)],ID_TIMESTAMP_SCALE);let _0x1f5704=0xf4240;_0x4ea898&&(_0x1f5704=readUint(_0x1a97d2,_0x4ea898[_0x4289ae(0x1e0)],_0x4ea898[_0x4289ae(0x1b3)]));const _0x48acbd=_0x4db317[_0x4289ae(0x1d0)](computeDurationMs,_0x1a97d2,_0x1f5704);if(_0x4db317[_0x4289ae(0x1e6)](_0x48acbd,0x0))return console[_0x4289ae(0x1ea)](_0x4db317[_0x4289ae(0x1e3)]),![];const _0x5b6180=_0x48acbd*0xf4240/_0x1f5704,_0x2f1191=Buffer[_0x4289ae(0x1c2)]([_0x4db317[_0x4289ae(0x1c9)](writeId,ID_DURATION),_0x4db317[_0x4289ae(0x1c9)](writeVint,0x8),_0x4db317['FfNPx'](writeFloat64,_0x5b6180)]),_0x4c6b10=_0x2f1191[_0x4289ae(0x1ce)];if(!_0xa4f848||_0x4db317['OSyLG'](_0xa4f848['offset'],_0x1313d0[_0x4289ae(0x1d5)])){if(_0xa4f848){const _0xb438c=_0x4db317['OkxWs'](_0xa4f848[_0x4289ae(0x1c7)],_0xa4f848[_0x4289ae(0x1bf)])+_0xa4f848['dataSize'],_0x127424=_0x4db317[_0x4289ae(0x1d8)](_0xb438c,_0x4c6b10);if(_0x127424<0x2)return _0x4db317[_0x4289ae(0x1d2)](rewriteFile,_0x1a97d2,_0x1313d0,_0x2f1191,_0x1f5704,_0x48acbd,_0x30cc39);const _0x4dd48d=_0x4db317[_0x4289ae(0x1d3)](_0x1313d0['dataSize'],_0x4c6b10),_0x550d88=Buffer[_0x4289ae(0x1c2)]([writeId(ID_INFO),writeVint(_0x4dd48d,_0x1313d0[_0x4289ae(0x1bf)])]),_0x5258d0=_0x1a97d2['slice'](_0x1313d0[_0x4289ae(0x1e0)],_0x4db317['LHkAt'](_0x1313d0[_0x4289ae(0x1e0)],_0x1313d0['dataSize'])),_0x2980c0=writeVoid(_0x127424),_0x4777ba=_0x1a97d2[_0x4289ae(0x1cd)](0x0,_0xa4f848[_0x4289ae(0x1d5)]),_0x394fb7=_0x1a97d2['slice'](_0x1313d0['dataOffset']+_0x1313d0[_0x4289ae(0x1b3)]);return _0x4db317[_0x4289ae(0x1d0)](writeFileSync,_0x30cc39,Buffer['concat']([_0x4777ba,_0x2980c0,_0x550d88,_0x5258d0,_0x2f1191,_0x394fb7])),!![];}}return rewriteFile(_0x1a97d2,_0x1313d0,_0x2f1191,_0x1f5704,_0x48acbd,_0x30cc39);}function rewriteFile(_0x1e9310,_0x18fea5,_0x38a0bb,_0x320ee4,_0x283abd,_0x4d8705){const _0x558308=_0x13a0,_0x2b512f={'osQHo':function(_0x18f0db,_0x1bb976){return _0x18f0db+_0x1bb976;},'LasPk':function(_0x57b050,_0x32e1ef){return _0x57b050(_0x32e1ef);},'uSFEy':function(_0x36dd3c,_0x15f520){return _0x36dd3c+_0x15f520;}},_0x32cdec=_0x2b512f['osQHo'](_0x18fea5['dataSize'],_0x38a0bb[_0x558308(0x1ce)]),_0x4f8d1f=Buffer['concat']([writeId(ID_INFO),_0x2b512f['LasPk'](writeVint,_0x32cdec)]),_0x3acbac=_0x18fea5[_0x558308(0x1c7)]+_0x18fea5[_0x558308(0x1bf)],_0x64e35b=_0x1e9310['slice'](0x0,_0x18fea5['offset']),_0x2c7767=_0x1e9310[_0x558308(0x1cd)](_0x18fea5['dataOffset'],_0x2b512f[_0x558308(0x1cf)](_0x18fea5[_0x558308(0x1e0)],_0x18fea5['dataSize'])),_0x5653d5=_0x1e9310['slice'](_0x2b512f['uSFEy'](_0x18fea5[_0x558308(0x1d5)],_0x3acbac)+_0x18fea5['dataSize']);return writeFileSync(_0x4d8705,Buffer[_0x558308(0x1c2)]([_0x64e35b,_0x4f8d1f,_0x2c7767,_0x38a0bb,_0x5653d5])),!![];}if(process[_0x5ee21e(0x1ec)][0x1]?.['endsWith']('fixWebmDuration.ts')||process[_0x5ee21e(0x1ec)][0x1]?.[_0x5ee21e(0x1e8)]('fixWebmDuration.js')){const input=process[_0x5ee21e(0x1ec)][0x2],output=process[_0x5ee21e(0x1ec)][0x3];(!input||!output)&&(console['error']('Usage:\x20fixWebmDuration\x20<input.webm>\x20<output.webm>'),process[_0x5ee21e(0x1dd)](0x1));const fixed=fixWebmDuration(input,output);fixed?console['log']('Fixed:\x20'+output):console[_0x5ee21e(0x1f4)](_0x5ee21e(0x1c0));}
|
|
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 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x5dab(){const _0x14b133=['529895wPnMpn','299836JOKVky','SKHgM','16OqIbKQ','git','2080480GlTzqP','437311eJSSUD','1043119NZMCVQ','1479582EpcMvJ','--error-unmatch','57382WHqRlr','cwd','30wSKQcu','40qfrfgH','30tjhZnn'];_0x5dab=function(){return _0x14b133;};return _0x5dab();}(function(_0x5b39b6,_0x338a46){const _0xca1616=_0x4ce6,_0x106f51=_0x5b39b6();while(!![]){try{const _0x5a2fc8=parseInt(_0xca1616(0xfe))/0x1+parseInt(_0xca1616(0xf8))/0x2*(parseInt(_0xca1616(0xfa))/0x3)+parseInt(_0xca1616(0xf1))/0x4*(parseInt(_0xca1616(0xfd))/0x5)+parseInt(_0xca1616(0xfc))/0x6*(-parseInt(_0xca1616(0xf4))/0x7)+-parseInt(_0xca1616(0xf3))/0x8+parseInt(_0xca1616(0xf6))/0x9+parseInt(_0xca1616(0xfb))/0xa*(-parseInt(_0xca1616(0xf5))/0xb);if(_0x5a2fc8===_0x338a46)break;else _0x106f51['push'](_0x106f51['shift']());}catch(_0x31d56a){_0x106f51['push'](_0x106f51['shift']());}}}(_0x5dab,0x36857));import{execFile as _0x21f675}from'child_process';import{promisify}from'util';const execFile=promisify(_0x21f675);function _0x4ce6(_0x54a71d,_0x35ec53){_0x54a71d=_0x54a71d-0xf0;const _0x5dab31=_0x5dab();let _0x4ce60e=_0x5dab31[_0x54a71d];return _0x4ce60e;}export async function isPathGitTracked(_0x757f51){const _0x54b17e=_0x4ce6,_0x7504d={'kxMFr':_0x54b17e(0xf2),'SKHgM':'ls-files'};try{return await execFile(_0x7504d['kxMFr'],[_0x7504d[_0x54b17e(0xf0)],_0x54b17e(0xf7),_0x757f51],{'cwd':process[_0x54b17e(0xf9)]()}),!![];}catch{return![];}}
|