@ranger-testing/ranger-cli 3.0.1-alpha.aab0a1c-26 → 3.0.1-alpha.ffffb5b-28
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/deleteProfile.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/legacyWarning.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/novaActCli.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/commands/verifyFeatureNovaCli.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x497ea4=_0x2db1;(function(_0x2f9389,_0x24f5ae){const _0x14d2ee=_0x2db1,_0x109009=_0x2f9389();while(!![]){try{const _0x207970=parseInt(_0x14d2ee(0x1d8))/0x1*(parseInt(_0x14d2ee(0x1eb))/0x2)+-parseInt(_0x14d2ee(0x1e4))/0x3+parseInt(_0x14d2ee(0x1f5))/0x4*(-parseInt(_0x14d2ee(0x1a1))/0x5)+-parseInt(_0x14d2ee(0x218))/0x6+parseInt(_0x14d2ee(0x203))/0x7*(parseInt(_0x14d2ee(0x1a6))/0x8)+-parseInt(_0x14d2ee(0x1d0))/0x9*(parseInt(_0x14d2ee(0x1e8))/0xa)+parseInt(_0x14d2ee(0x1a4))/0xb;if(_0x207970===_0x24f5ae)break;else _0x109009['push'](_0x109009['shift']());}catch(_0x17cae6){_0x109009['push'](_0x109009['shift']());}}}(_0x4030,0x875a5));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';function _0x4030(){const _0x736175=['CUEzC','\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','HmEdd','Cloud\x20profile\x20\x22','name','24164LiOPql','code','clientIp','string','RANGER_TEST_PASSWORD','/api/v1/profiles/','\x22,\x20cached\x20locally','/login','\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20','SQjuM','\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','env','\x22,\x20attempting\x20login...','JFJAD','eLsDC','close','Browser\x20login\x20timed\x20out\x20before\x20completion.','session_state','qRxHS','No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22','5770254KOZikQ','application/json','save','CEQlx','not_configured','5OaigRL','environment_key','userAgent','26320393JxEsbt','username','688eLoCxO','browserOptions','/api/v1/profiles','password','\x22\x20not\x20found.','shfFK','about:blank','ALuNh','HmohA','HovPY','error','RANGER_TEST_USERNAME','POST','settings','fdKTw','iDLJL','\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.','\x20\x20Cached\x20session\x20for\x20\x22','PUT','Create\x20the\x20profile\x20explicitly\x20with\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20<your-app-url>`\x20so\x20Ranger\x20can\x20pick\x20the\x20right\x20one.','/session','ptehg','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','):\x20','json','setupHeaders','confirm','isArray','\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22','DELETE','environmentKey','ATuXS','message','launch','defaultEnvironmentKey','stringify','success','join','wpnRU','jNWbj','bDXHh','sessionState','81gMEXeF','xpMvi','prompt','\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22','YrWQT','Browser\x20login\x20timed\x20out\x20after\x20','test_output','status','13PJyLuC','toISOString','rDnXG','auth_config','or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.','length','\x22.\x0a','push','domains','/api/v1/profiles/auth-config','\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.','gJSZv','3115473VOcfao','organizationId','LqKYR','WFYOg','105080wWwTnN','\x20\x20No\x20live\x20session\x20for\x20\x22','profiles','152952HVUrNv','\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20','Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20(','cookies','zBsHV','log','sXFAp','catch','GXliM','snHdV','4138584TncdCB','xPsyI','\x20\x20Cloud\x20session\x20for\x20\x22','gOjfK','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','ruaaS','storageStatePath','etIoV','QgvbA'];_0x4030=function(){return _0x736175;};return _0x4030();}import _0x15ca36 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 _0x2323c5=_0x2db1,_0x56774d=await getToken();if(!_0x56774d)throw new Error(_0x2323c5(0x1f9));return _0x56774d;}async function apiRequest(_0xe683,_0x22add2={}){const _0xd64ff=_0x2db1,_0x253061={'XCPpd':function(_0x1a9d6f,_0x2093fd,_0x5074cb){return _0x1a9d6f(_0x2093fd,_0x5074cb);},'xpMvi':_0xd64ff(0x19d),'jJAxR':function(_0x39f573,_0x4f2882){return _0x39f573===_0x4f2882;},'bDXHh':_0xd64ff(0x206),'etIoV':function(_0x5c4d87,_0x416036){return _0x5c4d87===_0x416036;}},_0x4b3562=await requireToken(),_0x1797c9=getApiBaseUrl(),_0x17060c=await _0x253061['XCPpd'](fetch,''+_0x1797c9+_0xe683,{..._0x22add2,'headers':{'Authorization':'Bearer\x20'+_0x4b3562,'Content-Type':_0x253061[_0xd64ff(0x1d1)],..._0x22add2['headers']??{}}});if(!_0x17060c['ok']){let _0x22dfd3='',_0x4789c2;try{const _0x4e3564=await _0x17060c[_0xd64ff(0x1be)]();_0x22dfd3=(_0x253061['jJAxR'](typeof _0x4e3564[_0xd64ff(0x1b0)],_0x253061[_0xd64ff(0x1ce)])?_0x4e3564[_0xd64ff(0x1b0)]:undefined)??JSON['stringify'](_0x4e3564);if(typeof _0x4e3564['code']===_0xd64ff(0x206))_0x4789c2=_0x4e3564[_0xd64ff(0x204)];}catch{_0x22dfd3=_0x17060c['statusText'];}throw new ApiError('API\x20request\x20'+_0xe683+'\x20failed\x20('+_0x17060c[_0xd64ff(0x1d7)]+_0xd64ff(0x1bd)+_0x22dfd3,_0x17060c[_0xd64ff(0x1d7)],_0x22dfd3,_0x4789c2);}if(_0x253061[_0xd64ff(0x1fc)](_0x17060c['status'],0xcc))return undefined;return _0x17060c[_0xd64ff(0x1be)]();}export class ApiError extends Error{[_0x497ea4(0x1d7)];['detail'];[_0x497ea4(0x204)];constructor(_0x26eb56,_0x5811a6,_0x261a1e,_0x5e765a){const _0x5629e6=_0x497ea4,_0x1a68ec={'gOjfK':'ApiError'};super(_0x26eb56),this[_0x5629e6(0x1d7)]=_0x5811a6,this['detail']=_0x261a1e,this['code']=_0x5e765a,this[_0x5629e6(0x202)]=_0x1a68ec[_0x5629e6(0x1f8)];}}export async function fetchCloudProfile(_0xed9172){const _0x52ff52=_0x497ea4,_0x5a709f={'xPsyI':function(_0x3d6991,_0x5220f9){return _0x3d6991 instanceof _0x5220f9;},'ptehg':function(_0x4ff37c,_0x21978a){return _0x4ff37c===_0x21978a;}};try{return await apiRequest(_0x52ff52(0x208)+encodeURIComponent(_0xed9172));}catch(_0x27c123){if(_0x5a709f[_0x52ff52(0x1f6)](_0x27c123,ApiError)&&_0x5a709f[_0x52ff52(0x1bb)](_0x27c123['status'],0x194))return null;throw _0x27c123;}}export async function listCloudProfiles(){const _0x2ecf57=_0x497ea4,_0x3691e5={'CUEzC':'/api/v1/profiles'},_0x137665=await apiRequest(_0x3691e5[_0x2ecf57(0x1fe)]);return _0x137665[_0x2ecf57(0x1ea)];}export async function deleteCloudProfile(_0x38c159){const _0x4ceed0=_0x497ea4,_0x4e5345={'ZdMvU':function(_0x5a4419,_0x5bd2d4,_0x39d1ee){return _0x5a4419(_0x5bd2d4,_0x39d1ee);},'qRxHS':function(_0x5bd22d,_0x1d3440){return _0x5bd22d===_0x1d3440;}};try{await _0x4e5345['ZdMvU'](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x38c159),{'method':_0x4ceed0(0x1c3)});}catch(_0x122993){if(_0x122993 instanceof ApiError&&_0x4e5345[_0x4ceed0(0x216)](_0x122993[_0x4ceed0(0x1d7)],0x194))throw new Error(_0x4ceed0(0x201)+_0x38c159+_0x4ceed0(0x1aa));throw _0x122993;}}export async function createCloudProfile(_0x2a10ac,_0x739060,_0x2e3c94={}){const _0x14dd80=_0x497ea4,_0x2de2b3={'QQIdy':function(_0x183c7f,_0x8f8f35,_0x28e2ed){return _0x183c7f(_0x8f8f35,_0x28e2ed);}},_0x1d09c8={'name':_0x2a10ac};if(_0x739060)_0x1d09c8[_0x14dd80(0x1a2)]=_0x739060;_0x2e3c94['settings']&&Object['keys'](_0x2e3c94['settings'])['length']>0x0&&(_0x1d09c8['settings']=_0x2e3c94[_0x14dd80(0x1b3)]);if(_0x2e3c94['username'])_0x1d09c8['username']=_0x2e3c94['username'];if(_0x2e3c94[_0x14dd80(0x1a9)])_0x1d09c8[_0x14dd80(0x1a9)]=_0x2e3c94[_0x14dd80(0x1a9)];return await _0x2de2b3['QQIdy'](apiRequest,_0x14dd80(0x1a8),{'method':'POST','body':JSON['stringify'](_0x1d09c8)});}export async function uploadCloudProfileSession(_0x22e63d,_0x221f7d){const _0x1dca20=_0x497ea4;return await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x22e63d)+_0x1dca20(0x1ba),{'method':'POST','body':JSON['stringify']({'session_state':_0x221f7d})});}function _0x2db1(_0x127f5d,_0x5ee485){_0x127f5d=_0x127f5d-0x19d;const _0x40301b=_0x4030();let _0x2db118=_0x40301b[_0x127f5d];return _0x2db118;}export async function saveCloudProfileCredentials(_0x3de776,_0x5c26a0,_0x2b52bd){const _0x5b9f4e=_0x497ea4,_0x19de56={'wpnRU':function(_0x396a96,_0x576027){return _0x396a96(_0x576027);},'uqsOp':'PUT'};await apiRequest('/api/v1/profiles/'+_0x19de56[_0x5b9f4e(0x1cc)](encodeURIComponent,_0x3de776),{'method':_0x19de56['uqsOp'],'body':JSON['stringify']({'username':_0x5c26a0,'password':_0x2b52bd})});}export async function fetchAuthConfig(){const _0x53a7f2=_0x497ea4;try{const _0xe79fec=await apiRequest(_0x53a7f2(0x1e1));return _0xe79fec[_0x53a7f2(0x1db)];}catch(_0x79cbf7){return _0x79cbf7 instanceof ApiError&&_0x79cbf7[_0x53a7f2(0x1d7)]!==0x194&&console[_0x53a7f2(0x1b0)]('\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20'+_0x79cbf7['message']),null;}}export function pickAdHocEnvKey(_0x4cf0d9){const _0x35f290=_0x497ea4,_0x366bc0={'jNWbj':function(_0x277946,_0x182040){return _0x277946===_0x182040;}};if(!_0x4cf0d9)return null;if(_0x4cf0d9['defaultEnvironmentKey'])return _0x4cf0d9[_0x35f290(0x1c8)];const _0xe3ce32=Object['keys'](_0x4cf0d9['environments']??{});if(_0x366bc0[_0x35f290(0x1cd)](_0xe3ce32['length'],0x1))return _0xe3ce32[0x0];if(_0x366bc0['jNWbj'](_0xe3ce32[_0x35f290(0x1dd)],0x0))return null;throw new Error(_0x35f290(0x1ed)+_0xe3ce32[_0x35f290(0x1cb)](',\x20')+').\x20'+_0x35f290(0x1b9));}export async function resolveAdHocProfile(_0x30c18c=process[_0x497ea4(0x20f)]){const _0xa3411=_0x497ea4,_0x27afc2={'CEQlx':function(_0x565d11){return _0x565d11();}},_0x1868dc=_0x30c18c[_0xa3411(0x1b1)];if(!_0x1868dc)return null;const _0x4a62ad=await fetchCloudProfile(_0x1868dc);if(_0x4a62ad)return{'name':_0x4a62ad[_0xa3411(0x202)],'profile':_0x4a62ad};const _0x30c03d=await _0x27afc2[_0xa3411(0x19f)](fetchAuthConfig),_0x323ec6=pickAdHocEnvKey(_0x30c03d),_0x5d4a60=_0x30c18c[_0xa3411(0x207)],_0x436ba8=await createCloudProfile(_0x1868dc,_0x323ec6??undefined,{'username':_0x1868dc,'password':_0x5d4a60});return console['log']('\x20\x20Created\x20cloud\x20profile\x20\x22'+_0x436ba8['name']+'\x22\x20for\x20'+_0x1868dc),{'name':_0x436ba8['name'],'profile':_0x436ba8};}export async function writeSessionToLocalCache(_0x1868c0,_0xd6b627,_0x59e2c3,_0x35445e,_0x41df1f,_0x4ec363,_0xd22db9){const _0x22001f=_0x497ea4,_0x4ebaa6={'ATuXS':function(_0x574317,_0x31c991,_0x38a58c){return _0x574317(_0x31c991,_0x38a58c);},'zBsHV':function(_0x3c9359){return _0x3c9359();},'rNxEm':'auth','udJpM':function(_0x52656c,_0x4b361f,_0x2e48df){return _0x52656c(_0x4b361f,_0x2e48df);},'HmEdd':function(_0xcc7404,_0x369cf5){return _0xcc7404>_0x369cf5;},'bisgh':function(_0x3b973a,_0x536144,_0x27a17f){return _0x3b973a(_0x536144,_0x27a17f);},'eLsDC':function(_0x5898f3,_0x2ab9c5){return _0x5898f3(_0x2ab9c5);}},_0x26400e=sessionCacheHash({'orgId':_0xd6b627,'profileName':_0x1868c0,'effectiveBaseUrl':_0x59e2c3,'setupHeaders':_0x35445e,'invalidateOn':_0xd22db9?.['invalidateOn'],'userAgent':_0xd22db9?.['userAgent'],'clientIp':_0xd22db9?.['clientIp']}),_0x3c4f66=_0x4ebaa6[_0x22001f(0x1c5)](getSessionCachePath,_0x26400e,_0x1868c0),_0x5d154c=_0x4ebaa6['ATuXS'](join,_0x4ebaa6[_0x22001f(0x1ef)](getRangerHomeDir),_0x4ebaa6['rNxEm']);!existsSync(_0x5d154c)&&await _0x4ebaa6['udJpM'](mkdir,_0x5d154c,{'recursive':!![]});const _0xb9f13f={..._0x41df1f};_0x4ec363&&_0x4ebaa6[_0x22001f(0x200)](_0x4ec363[_0x22001f(0x1dd)],0x0)&&Array[_0x22001f(0x1c1)](_0xb9f13f[_0x22001f(0x1ee)])&&(_0xb9f13f[_0x22001f(0x1ee)]=_0x4ebaa6['bisgh'](duplicateCookiesForDomains,_0xb9f13f[_0x22001f(0x1ee)],_0x4ec363));const _0x4db359={'cached_at':new Date()[_0x22001f(0x1d9)](),'session_state':_0xb9f13f};await _0x4ebaa6['ATuXS'](writeFile,_0x3c4f66,JSON['stringify'](_0x4db359,null,0x2));const _0x550ed8=_0x4ebaa6[_0x22001f(0x212)](getStorageStatePath,_0x3c4f66);return await _0x4ebaa6['udJpM'](writeFile,_0x550ed8,JSON[_0x22001f(0x1c9)](_0xb9f13f,null,0x2)),_0x550ed8;}export async function checkLocalCache(_0x5e934a,_0x1bd1d4,_0x57f2e8,_0xc9198f,_0x5f540c){const _0x47719c=_0x497ea4,_0x2bcd02={'HmohA':function(_0x3333f2,_0x46ff16){return _0x3333f2(_0x46ff16);},'TkyNn':function(_0x4cd1b7,_0x5cc3cb){return _0x4cd1b7(_0x5cc3cb);},'CSaAh':function(_0x465ea6,_0x57e9c8){return _0x465ea6(_0x57e9c8);}},_0x353807=_0x2bcd02[_0x47719c(0x1ae)](sessionCacheHash,{'orgId':_0x1bd1d4,'profileName':_0x5e934a,'effectiveBaseUrl':_0x57f2e8,'setupHeaders':_0xc9198f,'invalidateOn':_0x5f540c?.['invalidateOn'],'userAgent':_0x5f540c?.[_0x47719c(0x1a3)],'clientIp':_0x5f540c?.[_0x47719c(0x205)]}),_0x814f30=getSessionCachePath(_0x353807,_0x5e934a),_0x16b350=_0x2bcd02['TkyNn'](getStorageStatePath,_0x814f30);if(!existsSync(_0x814f30)||!_0x2bcd02['CSaAh'](existsSync,_0x16b350))return null;try{const _0x4c5ffb=await readFile(_0x814f30,'utf-8');return JSON['parse'](_0x4c5ffb),{'storageStatePath':_0x16b350};}catch{return null;}}function launchRealBrowser(){const _0x3b7d85=_0x497ea4;return chromium[_0x3b7d85(0x1c7)]({'headless':!![]});}function emitSessionValidationHint(_0x4e125d,_0x11150a){const _0x52e9b2=_0x497ea4,_0x4c7b4e={'SQjuM':function(_0x4995c2,_0x342002){return _0x4995c2===_0x342002;},'xBrfL':function(_0x6200d2,_0x1be783){return _0x6200d2+_0x1be783;}};if(!_0x11150a||!_0x11150a[_0x52e9b2(0x1e0)]?.[_0x52e9b2(0x1dd)])return;let _0x1d115b;try{_0x1d115b=new URL(_0x4e125d);}catch{return;}const _0x3da4f0=[];for(const _0x1dec39 of _0x11150a[_0x52e9b2(0x1e0)]){try{_0x3da4f0[_0x52e9b2(0x1df)]({'raw':_0x1dec39,'url':new URL(_0x1dec39)});}catch{}}if(_0x4c7b4e[_0x52e9b2(0x20c)](_0x3da4f0['length'],0x0))return;if(_0x3da4f0['some'](_0x57470c=>_0x57470c['url']['origin']===_0x1d115b['origin']))return;const _0x15919b=_0x3da4f0['map'](_0x363cec=>'\x22'+_0x363cec['raw']+'\x22')[_0x52e9b2(0x1cb)](',\x20');console['log'](_0x4c7b4e['xBrfL'](_0x52e9b2(0x20b)+_0x15919b+';\x20','you\x27re\x20now\x20at\x20\x22'+_0x4e125d+_0x52e9b2(0x1ec))+'If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.');}export async function serverSideLogin(_0x2faf37,_0x2501ab){const _0xccb569=_0x497ea4,_0x1783d3={'WRDrz':function(_0x4c9139,_0x422daf,_0x37595a){return _0x4c9139(_0x422daf,_0x37595a);},'ruaaS':function(_0x4c12f8,_0x18d372){return _0x4c12f8===_0x18d372;},'WFYOg':_0xccb569(0x1a0)},_0x48bb9e=process[_0xccb569(0x20f)]['RANGER_TEST_USERNAME'],_0x46673b=process[_0xccb569(0x20f)][_0xccb569(0x207)],_0x5bb4ef={};if(_0x48bb9e)_0x5bb4ef['username']=_0x48bb9e;if(_0x46673b)_0x5bb4ef[_0xccb569(0x1a9)]=_0x46673b;if(_0x2501ab?.['force'])_0x5bb4ef['force']=!![];try{return await _0x1783d3['WRDrz'](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x2faf37)+_0xccb569(0x20a),{'method':'POST','body':JSON[_0xccb569(0x1c9)](_0x5bb4ef)});}catch(_0xf5ee12){if(_0xf5ee12 instanceof ApiError&&_0x1783d3[_0xccb569(0x1fa)](_0xf5ee12['status'],0x190)&&_0x1783d3[_0xccb569(0x1fa)](_0xf5ee12[_0xccb569(0x204)],_0x1783d3[_0xccb569(0x1e7)]))return{'status':_0xccb569(0x1a0),'error':_0xf5ee12['detail']};throw _0xf5ee12;}}export async function manualBrowserLogin(_0xe14c39,_0x3bf0a4){const _0x12e951=_0x497ea4,_0x189cbe={'eUorV':function(_0x30c5b6,_0x332553){return _0x30c5b6/_0x332553;},'snHdV':function(_0x2b7cc0){return _0x2b7cc0();},'MFTMp':function(_0x396910,_0x7deb97){return _0x396910(_0x7deb97);},'YrWQT':function(_0x24a2a2,_0x426f8e,_0x25dbc3){return _0x24a2a2(_0x426f8e,_0x25dbc3);},'WOYby':_0x12e951(0x213),'LqKYR':function(_0x4d6911){return _0x4d6911();},'ALuNh':function(_0x16dd89,_0x11f1ae){return _0x16dd89+_0x11f1ae;},'iAjaV':function(_0x436cdb,_0x58e2ac){return _0x436cdb+_0x58e2ac;},'bCDel':_0x12e951(0x1ac),'vTRXt':_0x12e951(0x1e2),'HovPY':_0x12e951(0x1ff),'wTVzX':function(_0x461944,_0x55976f){return _0x461944&&_0x55976f;},'rDnXG':'Browser\x20closed\x20before\x20authentication\x20was\x20saved.','iDLJL':_0x12e951(0x1b2),'sXFAp':'cli:manual-login'};if(!_0x189cbe[_0x12e951(0x1e6)](isInteractive))throw new Error(_0x189cbe[_0x12e951(0x1ad)](_0x189cbe['iAjaV'](_0x12e951(0x217)+_0xe14c39[_0x12e951(0x202)]+_0x12e951(0x1de),'\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20'),_0x12e951(0x1dc)));const _0x32f32d=_0x3bf0a4&&_0x3bf0a4['domains'][_0x12e951(0x1dd)]>0x0?_0x3bf0a4['domains'][0x0]:_0x189cbe['bCDel'];console[_0x12e951(0x1f0)](_0x189cbe['vTRXt']),console['log'](_0x189cbe[_0x12e951(0x1af)]),await new Promise(_0x541fac=>setTimeout(_0x541fac,0x7d0));const _0x4103e6=await chromium[_0x12e951(0x1c7)]({'headless':![]});let _0x28b7dc=null;try{const _0x223ac4={'ignoreHTTPSErrors':!![]};_0x3bf0a4?.[_0x12e951(0x1bf)]&&(_0x223ac4['extraHTTPHeaders']=_0x3bf0a4['setupHeaders']);const _0x21838a=await _0x4103e6['newContext'](_0x223ac4);await addProfileSetupBanner(_0x21838a);const _0x3630b3=await _0x21838a['newPage']();await _0x3630b3['goto'](_0x32f32d);let _0x3abeb8=![];await new Promise(_0x38e090=>{const _0x545455=_0x12e951,_0xb5206b={'xfoRR':function(_0x4cb40e,_0x141ffb){return _0x189cbe['MFTMp'](_0x4cb40e,_0x141ffb);}},_0x1caddc=_0x189cbe[_0x545455(0x1d4)](setTimeout,()=>{const _0x30157f=_0x545455;_0x3abeb8=!![],console['error'](_0x30157f(0x1d5)+_0x189cbe['eUorV'](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+'\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.'),_0x189cbe[_0x30157f(0x1f4)](_0x38e090);},MANUAL_LOGIN_TIMEOUT_MS);_0x3630b3['on'](_0x189cbe['WOYby'],async()=>{_0xb5206b['xfoRR'](clearTimeout,_0x1caddc);try{const _0x57341a=await _0x21838a['storageState']();_0x28b7dc=_0x57341a;}catch{}_0x38e090();});});if(_0x189cbe['wTVzX'](_0x3abeb8,!_0x28b7dc))throw new Error(_0x12e951(0x214));}finally{await _0x4103e6[_0x12e951(0x213)]()[_0x12e951(0x1f2)](()=>{});}if(!_0x28b7dc)throw new Error(_0x189cbe[_0x12e951(0x1da)]);return await _0x189cbe[_0x12e951(0x1d4)](apiRequest,'/api/v1/profiles/'+_0x189cbe['MFTMp'](encodeURIComponent,_0xe14c39['name'])+'/session',{'method':_0x189cbe[_0x12e951(0x1b5)],'body':JSON[_0x12e951(0x1c9)]({'session_state':_0x28b7dc,'updated_by':_0x189cbe[_0x12e951(0x1f1)]})}),{'sessionState':_0x28b7dc};}export async function promptSaveCredentials(_0x468db2){const _0x13a285=_0x497ea4,_0x3fc9f4={'MDYDC':function(_0x5c2a8a,_0x68f22b){return _0x5c2a8a||_0x68f22b;},'tNgJh':function(_0x59de7f){return _0x59de7f();},'JFJAD':_0x13a285(0x20e),'FKjAC':function(_0x29d552,_0x1e33fa,_0x198e84){return _0x29d552(_0x1e33fa,_0x198e84);},'rvCGL':function(_0xbe48b4,_0x5c0208){return _0xbe48b4(_0x5c0208);}},_0x4f0758=process['env']['RANGER_TEST_USERNAME'],_0x572b22=process['env']['RANGER_TEST_PASSWORD'];if(_0x3fc9f4['MDYDC'](!_0x4f0758,!_0x572b22))return;if(!_0x3fc9f4['tNgJh'](isInteractive))return;const {save:_0x21f8d0}=await _0x15ca36[_0x13a285(0x1d2)]([{'type':_0x13a285(0x1c0),'name':_0x13a285(0x19e),'message':_0x3fc9f4[_0x13a285(0x211)],'default':![]}]);if(!_0x21f8d0)return;await _0x3fc9f4['FKjAC'](apiRequest,'/api/v1/profiles/'+_0x3fc9f4['rvCGL'](encodeURIComponent,_0x468db2),{'method':_0x13a285(0x1b8),'body':JSON['stringify']({'username':_0x4f0758,'password':_0x572b22})}),console[_0x13a285(0x1f0)](_0x13a285(0x1b6));}export async function resolveCloudProfileSession(_0x37c830,_0x596ffb={}){const _0x526c8d=_0x497ea4,_0xa6b18e={'jyJhw':function(_0xe0b77b,_0x47e555,_0x36908d,_0x3d5b59,_0x420735,_0x57a508){return _0xe0b77b(_0x47e555,_0x36908d,_0x3d5b59,_0x420735,_0x57a508);},'ZROpC':function(_0x52b937,_0x2f82ce,_0x12f08e){return _0x52b937(_0x2f82ce,_0x12f08e);},'shfFK':function(_0x14e53c,_0x4390ae,_0x334c71,_0x84db87,_0x4949df,_0x45b135,_0x5c3abb,_0x1da124){return _0x14e53c(_0x4390ae,_0x334c71,_0x84db87,_0x4949df,_0x45b135,_0x5c3abb,_0x1da124);},'SsJsq':function(_0x329af5,_0x341a2a,_0x4ad216,_0x2f9621,_0x59cf03){return _0x329af5(_0x341a2a,_0x4ad216,_0x2f9621,_0x59cf03);},'GXliM':function(_0x43cc51,_0x524b4a,_0x2a7753){return _0x43cc51(_0x524b4a,_0x2a7753);},'gJSZv':function(_0x2ca79b,_0x2159b7){return _0x2ca79b(_0x2159b7);},'QLaSy':function(_0x1dc120,_0x9fabb0){return _0x1dc120(_0x9fabb0);},'QgvbA':function(_0x415054,_0x443a74){return _0x415054||_0x443a74;},'JiypU':'not_configured','fdKTw':function(_0x28a273,_0x57a82e){return _0x28a273===_0x57a82e;},'nKQur':_0x526c8d(0x1ca),'sqtsk':'\x20\x20Login\x20successful.\x20Session\x20cached.','aebxx':'\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','JxwtI':_0x526c8d(0x1bc)},_0x5e76fd=_0x37c830['settings']??{},_0x4e5651=await fetchAuthConfig(),_0x5538af=_0x4e5651?resolveAuthEnvironmentLocally(_0x4e5651,_0x37c830[_0x526c8d(0x1c4)]):null,_0x5bbe1f=_0x5538af?.['domains'],_0x13df7f=_0x5e76fd['setupHeaders'],_0x56ea55=_0x13df7f??_0x5538af?.[_0x526c8d(0x1bf)],_0x17c2a2=_0x596ffb['effectiveBaseUrl']??_0x5e76fd['baseUrl']??(_0x5bbe1f&&_0x5bbe1f[_0x526c8d(0x1dd)]>0x0?_0x5bbe1f[0x0]:''),_0x5020e0={'invalidateOn':_0x5538af?.['invalidateOn'],'userAgent':_0x5538af?.[_0x526c8d(0x1a7)]?.[_0x526c8d(0x1a3)]??_0x5e76fd['userAgent']},_0x5d92a9=await _0xa6b18e['jyJhw'](checkLocalCache,_0x37c830['name'],_0x37c830[_0x526c8d(0x1e5)],_0x17c2a2,_0x56ea55,_0x5020e0);if(_0x5d92a9){if(_0x17c2a2){const _0x41ce79=await isCachedSessionLive(_0x5d92a9[_0x526c8d(0x1fb)],_0x17c2a2,{'sessionCheckPath':_0x5538af?.['sessionCheckPath'],'setupHeaders':_0x56ea55},{'launchBrowser':launchRealBrowser});if(_0x41ce79)return console[_0x526c8d(0x1f0)](_0x526c8d(0x1d3)+_0x37c830[_0x526c8d(0x202)]+'\x22'),{'authPath':_0x5d92a9[_0x526c8d(0x1fb)],'settings':_0x5e76fd,'resolvedEnv':_0x5538af};console['log'](_0x526c8d(0x1b7)+_0x37c830['name']+'\x22\x20failed\x20validation\x20—\x20refreshing...'),_0xa6b18e['ZROpC'](emitSessionValidationHint,_0x17c2a2,_0x5538af);}else return{'authPath':_0x5d92a9[_0x526c8d(0x1fb)],'settings':_0x5e76fd,'resolvedEnv':_0x5538af};}if(_0x37c830[_0x526c8d(0x1cf)]){const _0x28d99f=await _0xa6b18e[_0x526c8d(0x1ab)](writeSessionToLocalCache,_0x37c830['name'],_0x37c830[_0x526c8d(0x1e5)],_0x17c2a2,_0x56ea55,_0x37c830['sessionState'],_0x5bbe1f,_0x5020e0);if(_0x17c2a2){const _0x62d852=await _0xa6b18e['SsJsq'](isCachedSessionLive,_0x28d99f,_0x17c2a2,{'sessionCheckPath':_0x5538af?.['sessionCheckPath'],'setupHeaders':_0x56ea55},{'launchBrowser':launchRealBrowser});if(_0x62d852)return console['log'](_0x526c8d(0x1c2)+_0x37c830[_0x526c8d(0x202)]+_0x526c8d(0x209)),{'authPath':_0x28d99f,'settings':_0x5e76fd,'resolvedEnv':_0x5538af};console['log'](_0x526c8d(0x1f7)+_0x37c830['name']+'\x22\x20failed\x20validation\x20—\x20re-login\x20needed...'),_0xa6b18e[_0x526c8d(0x1f3)](emitSessionValidationHint,_0x17c2a2,_0x5538af);}else return{'authPath':_0x28d99f,'settings':_0x5e76fd,'resolvedEnv':_0x5538af};}console['log'](_0x526c8d(0x1e9)+_0x37c830['name']+_0x526c8d(0x210));const _0x18775e=_0xa6b18e['gJSZv'](Boolean,process['env'][_0x526c8d(0x1b1)])&&Boolean(process[_0x526c8d(0x20f)][_0x526c8d(0x207)]),_0x41072c=_0xa6b18e['QLaSy'](Boolean,_0x37c830[_0x526c8d(0x1a5)]);if(_0xa6b18e[_0x526c8d(0x1fd)](_0x18775e,_0x41072c))try{const _0x317c06=await _0xa6b18e[_0x526c8d(0x1e3)](serverSideLogin,_0x37c830['name']);if(_0x317c06[_0x526c8d(0x1d7)]===_0xa6b18e['JiypU'])console[_0x526c8d(0x1f0)](_0x526c8d(0x20d));else{if(_0xa6b18e[_0x526c8d(0x1b4)](_0x317c06[_0x526c8d(0x1d7)],_0xa6b18e['nKQur'])&&_0x317c06[_0x526c8d(0x215)]){console['log'](_0xa6b18e['sqtsk']);const _0x51ac90=await writeSessionToLocalCache(_0x37c830[_0x526c8d(0x202)],_0x37c830[_0x526c8d(0x1e5)],_0x17c2a2,_0x56ea55,_0x317c06[_0x526c8d(0x215)],_0x5bbe1f,_0x5020e0);return _0x18775e&&!_0x41072c&&await promptSaveCredentials(_0x37c830['name']),{'authPath':_0x51ac90,'settings':_0x5e76fd,'resolvedEnv':_0x5538af};}else _0x317c06['test_output']&&(console['log'](_0xa6b18e['aebxx']),console['log'](_0x317c06[_0x526c8d(0x1d6)])),console['log'](_0xa6b18e['JxwtI']);}}catch(_0x48649a){console[_0x526c8d(0x1f0)]('\x20\x20Server-side\x20login\x20error:\x20'+(_0x48649a instanceof Error?_0x48649a[_0x526c8d(0x1c6)]:String(_0x48649a))),console[_0x526c8d(0x1f0)](_0xa6b18e['JxwtI']);}const {sessionState:_0xf5ab54}=await manualBrowserLogin(_0x37c830,_0x5538af),_0x1632ff=await writeSessionToLocalCache(_0x37c830['name'],_0x37c830['organizationId'],_0x17c2a2,_0x56ea55,_0xf5ab54,_0x5bbe1f,_0x5020e0);return{'authPath':_0x1632ff,'settings':_0x5e76fd,'resolvedEnv':_0x5538af};}
|
|
1
|
+
const _0x3f30ba=_0x4b7a;(function(_0x3a8a08,_0x2f6ee3){const _0x343175=_0x4b7a,_0x3ee366=_0x3a8a08();while(!![]){try{const _0x3735ee=-parseInt(_0x343175(0x1fa))/0x1*(-parseInt(_0x343175(0x1e8))/0x2)+-parseInt(_0x343175(0x1d7))/0x3*(-parseInt(_0x343175(0x1a4))/0x4)+parseInt(_0x343175(0x195))/0x5*(-parseInt(_0x343175(0x1bc))/0x6)+parseInt(_0x343175(0x1f8))/0x7+-parseInt(_0x343175(0x1fd))/0x8+parseInt(_0x343175(0x19b))/0x9+-parseInt(_0x343175(0x19e))/0xa;if(_0x3735ee===_0x2f6ee3)break;else _0x3ee366['push'](_0x3ee366['shift']());}catch(_0x4004ee){_0x3ee366['push'](_0x3ee366['shift']());}}}(_0x5358,0xe9a44));import{readFile,writeFile,mkdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x175a33 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 _0x243729=_0x4b7a,_0x498194={'kzewl':function(_0x447093){return _0x447093();}},_0x1cc09d=await _0x498194[_0x243729(0x1cf)](getToken);if(!_0x1cc09d)throw new Error(_0x243729(0x1d9));return _0x1cc09d;}async function apiRequest(_0xfdd7c4,_0x548e53={}){const _0x5b0f3e=_0x4b7a,_0x245c3f={'OAevO':function(_0x5d453c){return _0x5d453c();},'ALwVf':function(_0xf6a140){return _0xf6a140();},'PlLbc':function(_0x33301f,_0x4721d6){return _0x33301f===_0x4721d6;},'uzsIz':function(_0xf3bb27,_0x2472d3){return _0xf3bb27===_0x2472d3;},'hvksU':_0x5b0f3e(0x1e3),'IudKW':function(_0x38a975,_0x34153e){return _0x38a975===_0x34153e;}},_0x441faa=await _0x245c3f['OAevO'](requireToken),_0x447f1a=_0x245c3f['ALwVf'](getApiBaseUrl),_0x5588f7=await fetch(''+_0x447f1a+_0xfdd7c4,{..._0x548e53,'headers':{'Authorization':'Bearer\x20'+_0x441faa,'Content-Type':'application/json',..._0x548e53['headers']??{}}});if(!_0x5588f7['ok']){let _0x2b1363='',_0x2b1d0f;try{const _0x3f025e=await _0x5588f7[_0x5b0f3e(0x199)]();_0x2b1363=(_0x245c3f[_0x5b0f3e(0x1c2)](typeof _0x3f025e['error'],'string')?_0x3f025e['error']:undefined)??JSON[_0x5b0f3e(0x1da)](_0x3f025e);if(_0x245c3f['uzsIz'](typeof _0x3f025e[_0x5b0f3e(0x1c3)],_0x245c3f['hvksU']))_0x2b1d0f=_0x3f025e['code'];}catch{_0x2b1363=_0x5588f7[_0x5b0f3e(0x198)];}throw new ApiError(_0x5b0f3e(0x1c9)+_0xfdd7c4+_0x5b0f3e(0x1b0)+_0x5588f7[_0x5b0f3e(0x19c)]+_0x5b0f3e(0x1f5)+_0x2b1363,_0x5588f7[_0x5b0f3e(0x19c)],_0x2b1363,_0x2b1d0f);}if(_0x245c3f['IudKW'](_0x5588f7['status'],0xcc))return undefined;return _0x5588f7[_0x5b0f3e(0x199)]();}export class ApiError extends Error{[_0x3f30ba(0x19c)];['detail'];[_0x3f30ba(0x1c3)];constructor(_0x3aab56,_0x4e796c,_0xe6f051,_0x1706a9){const _0x181068=_0x3f30ba,_0x17417f={'mWkFg':_0x181068(0x19d)};super(_0x3aab56),this['status']=_0x4e796c,this['detail']=_0xe6f051,this[_0x181068(0x1c3)]=_0x1706a9,this[_0x181068(0x1ff)]=_0x17417f['mWkFg'];}}export async function fetchCloudProfile(_0x2df3bd){const _0x473dac=_0x3f30ba,_0x30db36={'jCpNG':function(_0x557dbe,_0x1093d2){return _0x557dbe===_0x1093d2;}};try{return await apiRequest('/api/v1/profiles/'+encodeURIComponent(_0x2df3bd));}catch(_0x263388){if(_0x263388 instanceof ApiError&&_0x30db36[_0x473dac(0x1be)](_0x263388[_0x473dac(0x19c)],0x194))return null;throw _0x263388;}}export async function listCloudProfiles(){const _0x17f88e=_0x3f30ba,_0x464b47={'LpRTD':function(_0x4492e3,_0x35c7dc){return _0x4492e3(_0x35c7dc);}},_0x39b150=await _0x464b47['LpRTD'](apiRequest,_0x17f88e(0x1db));return _0x39b150[_0x17f88e(0x1dc)];}export async function deleteCloudProfile(_0x13d414){const _0x4e7bab=_0x3f30ba,_0x1d4663={'tNkVd':function(_0xe5c1e8,_0x5de568,_0x527951){return _0xe5c1e8(_0x5de568,_0x527951);},'hHaFb':function(_0x24f6e4,_0x16a0d4){return _0x24f6e4(_0x16a0d4);},'zCXCX':'DELETE','EFrPl':function(_0x14b86a,_0x6ede1d){return _0x14b86a===_0x6ede1d;}};try{await _0x1d4663['tNkVd'](apiRequest,_0x4e7bab(0x1e4)+_0x1d4663['hHaFb'](encodeURIComponent,_0x13d414),{'method':_0x1d4663['zCXCX']});}catch(_0x461d17){if(_0x461d17 instanceof ApiError&&_0x1d4663[_0x4e7bab(0x1f9)](_0x461d17['status'],0x194))throw new Error(_0x4e7bab(0x1f0)+_0x13d414+_0x4e7bab(0x1ea));throw _0x461d17;}}export async function createCloudProfile(_0xfe11ef,_0xf2b09b,_0x3e21d9={}){const _0x117d8e=_0x3f30ba,_0x5d8230={'FWILA':function(_0x4919ba,_0x4d3a50,_0x2834ee){return _0x4919ba(_0x4d3a50,_0x2834ee);}},_0x1c6ce1={'name':_0xfe11ef};if(_0xf2b09b)_0x1c6ce1['environment_key']=_0xf2b09b;_0x3e21d9[_0x117d8e(0x1e9)]&&Object[_0x117d8e(0x1a2)](_0x3e21d9[_0x117d8e(0x1e9)])['length']>0x0&&(_0x1c6ce1['settings']=_0x3e21d9['settings']);if(_0x3e21d9['username'])_0x1c6ce1['username']=_0x3e21d9['username'];if(_0x3e21d9['password'])_0x1c6ce1['password']=_0x3e21d9[_0x117d8e(0x1b6)];return await _0x5d8230['FWILA'](apiRequest,'/api/v1/profiles',{'method':'POST','body':JSON[_0x117d8e(0x1da)](_0x1c6ce1)});}export async function uploadCloudProfileSession(_0x36ede5,_0xae8a2c){const _0x1926d4=_0x3f30ba;return await apiRequest(_0x1926d4(0x1e4)+encodeURIComponent(_0x36ede5)+_0x1926d4(0x1bb),{'method':_0x1926d4(0x1d3),'body':JSON['stringify']({'session_state':_0xae8a2c})});}export async function saveCloudProfileCredentials(_0x4170f5,_0x467d16,_0x584102){const _0xe3aeba=_0x3f30ba,_0x411b79={'qzuBb':function(_0x552eda,_0x1a8050,_0x438793){return _0x552eda(_0x1a8050,_0x438793);},'rivgF':function(_0x593026,_0x429b7b){return _0x593026(_0x429b7b);}};await _0x411b79[_0xe3aeba(0x1f3)](apiRequest,'/api/v1/profiles/'+_0x411b79[_0xe3aeba(0x1aa)](encodeURIComponent,_0x4170f5),{'method':_0xe3aeba(0x1b3),'body':JSON['stringify']({'username':_0x467d16,'password':_0x584102})});}export async function fetchAuthConfig(){const _0x7911fe=_0x3f30ba,_0x56317d={'PEuEh':function(_0xf12b40,_0x13b5b0){return _0xf12b40(_0x13b5b0);},'NzZfr':'/api/v1/profiles/auth-config','QcOUF':function(_0x4b8022,_0x29f4bf){return _0x4b8022 instanceof _0x29f4bf;}};try{const _0x4d5639=await _0x56317d['PEuEh'](apiRequest,_0x56317d['NzZfr']);return _0x4d5639['auth_config'];}catch(_0x39c4aa){return _0x56317d[_0x7911fe(0x1c4)](_0x39c4aa,ApiError)&&_0x39c4aa[_0x7911fe(0x19c)]!==0x194&&console[_0x7911fe(0x196)](_0x7911fe(0x1c8)+_0x39c4aa['message']),null;}}export function pickAdHocEnvKey(_0x3f328b){const _0x16598f=_0x3f30ba,_0x261abb={'rmXMO':function(_0x40e3fc,_0x526057){return _0x40e3fc===_0x526057;},'xlGkQ':function(_0x322ddb,_0x5a5280){return _0x322ddb+_0x5a5280;}};if(!_0x3f328b)return null;if(_0x3f328b['defaultEnvironmentKey'])return _0x3f328b[_0x16598f(0x1c1)];const _0x215dce=Object[_0x16598f(0x1a2)](_0x3f328b['environments']??{});if(_0x261abb['rmXMO'](_0x215dce[_0x16598f(0x1a9)],0x1))return _0x215dce[0x0];if(_0x215dce['length']===0x0)return null;throw new Error(_0x261abb['xlGkQ'](_0x16598f(0x1ee)+_0x215dce['join'](',\x20')+_0x16598f(0x1df),'Create\x20the\x20profile\x20explicitly\x20with\x20`ranger\x20profile\x20add\x20<name>\x20--url\x20<your-app-url>`\x20so\x20Ranger\x20can\x20pick\x20the\x20right\x20one.'));}export async function resolveAdHocProfile(_0x24f117=process[_0x3f30ba(0x1a6)]){const _0x5c14b1=_0x3f30ba,_0xead83e={'IEkjT':function(_0x53b3ed,_0xee2e49){return _0x53b3ed(_0xee2e49);}},_0x335480=_0x24f117[_0x5c14b1(0x1ef)];if(!_0x335480)return null;const _0x3aee73=await _0xead83e['IEkjT'](fetchCloudProfile,_0x335480);if(_0x3aee73)return{'name':_0x3aee73['name'],'profile':_0x3aee73};const _0x57b0e6=await fetchAuthConfig(),_0xc8091e=pickAdHocEnvKey(_0x57b0e6),_0x3bc425=_0x24f117[_0x5c14b1(0x1b1)],_0x486e90=await createCloudProfile(_0x335480,_0xc8091e??undefined,{'username':_0x335480,'password':_0x3bc425});return console['log']('\x20\x20Created\x20cloud\x20profile\x20\x22'+_0x486e90[_0x5c14b1(0x1ff)]+'\x22\x20for\x20'+_0x335480),{'name':_0x486e90[_0x5c14b1(0x1ff)],'profile':_0x486e90};}export async function writeSessionToLocalCache(_0x3bad2c,_0xe61fd,_0x4877d0,_0x41149d,_0x2f7e47,_0x8d042a,_0x40520b){const _0x3f83a7=_0x3f30ba,_0x53c4df={'nVJVG':function(_0x5926e9,_0x326622,_0x4f8594){return _0x5926e9(_0x326622,_0x4f8594);},'oNrsv':function(_0xec005b){return _0xec005b();},'EfLYv':function(_0x44c9f3,_0x176c01,_0x1aba82){return _0x44c9f3(_0x176c01,_0x1aba82);},'EGPNB':function(_0x508864,_0x35d714){return _0x508864>_0x35d714;},'vDEZx':function(_0x5b6ca5,_0x26073b,_0x35eab8){return _0x5b6ca5(_0x26073b,_0x35eab8);}},_0x119c47=sessionCacheHash({'orgId':_0xe61fd,'profileName':_0x3bad2c,'effectiveBaseUrl':_0x4877d0,'setupHeaders':_0x41149d,'invalidateOn':_0x40520b?.[_0x3f83a7(0x1e7)],'userAgent':_0x40520b?.[_0x3f83a7(0x1e5)],'clientIp':_0x40520b?.[_0x3f83a7(0x1ec)]}),_0x3a8bd9=_0x53c4df['nVJVG'](getSessionCachePath,_0x119c47,_0x3bad2c),_0x1936e0=join(_0x53c4df[_0x3f83a7(0x1ac)](getRangerHomeDir),_0x3f83a7(0x1a0));!existsSync(_0x1936e0)&&await _0x53c4df[_0x3f83a7(0x1c6)](mkdir,_0x1936e0,{'recursive':!![]});const _0x4c04f1={..._0x2f7e47};_0x8d042a&&_0x53c4df[_0x3f83a7(0x200)](_0x8d042a['length'],0x0)&&Array['isArray'](_0x4c04f1[_0x3f83a7(0x1ed)])&&(_0x4c04f1['cookies']=duplicateCookiesForDomains(_0x4c04f1[_0x3f83a7(0x1ed)],_0x8d042a));const _0x2695d4={'cached_at':new Date()[_0x3f83a7(0x1bf)](),'session_state':_0x4c04f1};await _0x53c4df['vDEZx'](writeFile,_0x3a8bd9,JSON['stringify'](_0x2695d4,null,0x2));const _0x38bc3f=getStorageStatePath(_0x3a8bd9);return await _0x53c4df['vDEZx'](writeFile,_0x38bc3f,JSON[_0x3f83a7(0x1da)](_0x4c04f1,null,0x2)),_0x38bc3f;}export async function checkLocalCache(_0x19aa1d,_0x351ec7,_0x5746f6,_0x3cf955,_0xd4979d){const _0x4b679a=_0x3f30ba,_0x7d54d7={'YxhWq':function(_0x44fd83,_0x362524,_0x175f70){return _0x44fd83(_0x362524,_0x175f70);},'lKgwX':function(_0x46dd4a,_0x1ccf5c){return _0x46dd4a(_0x1ccf5c);},'IVODL':function(_0x5c8100,_0x1d44ec){return _0x5c8100(_0x1d44ec);}},_0x267681=sessionCacheHash({'orgId':_0x351ec7,'profileName':_0x19aa1d,'effectiveBaseUrl':_0x5746f6,'setupHeaders':_0x3cf955,'invalidateOn':_0xd4979d?.['invalidateOn'],'userAgent':_0xd4979d?.['userAgent'],'clientIp':_0xd4979d?.[_0x4b679a(0x1ec)]}),_0x4773c7=_0x7d54d7[_0x4b679a(0x1ad)](getSessionCachePath,_0x267681,_0x19aa1d),_0x513b44=_0x7d54d7[_0x4b679a(0x197)](getStorageStatePath,_0x4773c7);if(!existsSync(_0x4773c7)||!_0x7d54d7[_0x4b679a(0x1d6)](existsSync,_0x513b44))return null;try{const _0x346198=await readFile(_0x4773c7,_0x4b679a(0x1b7));return JSON['parse'](_0x346198),{'storageStatePath':_0x513b44};}catch{return null;}}function launchRealBrowser(){const _0x5781bd=_0x3f30ba;return chromium[_0x5781bd(0x1f6)]({'headless':!![]});}function _0x4b7a(_0x369d44,_0x4ce63b){_0x369d44=_0x369d44-0x18e;const _0x5358f3=_0x5358();let _0x4b7ab9=_0x5358f3[_0x369d44];return _0x4b7ab9;}function emitSessionValidationHint(_0x5cb8f6,_0x189d4e){const _0x216bcb=_0x3f30ba,_0x5a6653={'TFAhW':function(_0xd60ccf,_0x14f05f){return _0xd60ccf===_0x14f05f;},'LuZNe':function(_0x2c25f6,_0x5b8e83){return _0x2c25f6+_0x5b8e83;}};if(!_0x189d4e||!_0x189d4e[_0x216bcb(0x1cb)]?.[_0x216bcb(0x1a9)])return;let _0x3f48e6;try{_0x3f48e6=new URL(_0x5cb8f6);}catch{return;}const _0xc1bf20=[];for(const _0x3686a7 of _0x189d4e[_0x216bcb(0x1cb)]){try{_0xc1bf20['push']({'raw':_0x3686a7,'url':new URL(_0x3686a7)});}catch{}}if(_0x5a6653[_0x216bcb(0x1b2)](_0xc1bf20[_0x216bcb(0x1a9)],0x0))return;if(_0xc1bf20['some'](_0x18b520=>_0x18b520['url']['origin']===_0x3f48e6[_0x216bcb(0x193)]))return;const _0x2dd77c=_0xc1bf20['map'](_0x3dfd14=>'\x22'+_0x3dfd14[_0x216bcb(0x1f2)]+'\x22')['join'](',\x20');console['log'](_0x5a6653['LuZNe'](_0x5a6653['LuZNe']('\x20\x20(hint)\x20Cached\x20session\x20was\x20captured\x20against\x20one\x20of\x20'+_0x2dd77c+';\x20','you\x27re\x20now\x20at\x20\x22'+_0x5cb8f6+'\x22,\x20which\x20doesn\x27t\x20match\x20any\x20of\x20them.\x20'),'If\x20logins\x20keep\x20failing\x20here,\x20ask\x20your\x20Ranger\x20admin\x20to\x20tighten\x20session\x20reuse\x20for\x20this\x20environment.'));}export async function serverSideLogin(_0x30a982,_0x237dff){const _0xeb0d22=_0x3f30ba,_0x1ba0b9={'cFXJr':function(_0x2d5701,_0x11bbee){return _0x2d5701 instanceof _0x11bbee;},'kSgKO':function(_0x49c076,_0x2a5fad){return _0x49c076===_0x2a5fad;},'rkhxC':'not_configured'},_0x1925c6=process['env']['RANGER_TEST_USERNAME'],_0x284fac=process[_0xeb0d22(0x1a6)]['RANGER_TEST_PASSWORD'],_0x5c3c95={};if(_0x1925c6)_0x5c3c95[_0xeb0d22(0x1fb)]=_0x1925c6;if(_0x284fac)_0x5c3c95[_0xeb0d22(0x1b6)]=_0x284fac;if(_0x237dff?.[_0xeb0d22(0x19a)])_0x5c3c95[_0xeb0d22(0x19a)]=!![];try{return await apiRequest(_0xeb0d22(0x1e4)+encodeURIComponent(_0x30a982)+_0xeb0d22(0x19f),{'method':'POST','body':JSON[_0xeb0d22(0x1da)](_0x5c3c95)});}catch(_0x3d6d7c){if(_0x1ba0b9[_0xeb0d22(0x1de)](_0x3d6d7c,ApiError)&&_0x3d6d7c[_0xeb0d22(0x19c)]===0x190&&_0x1ba0b9['kSgKO'](_0x3d6d7c[_0xeb0d22(0x1c3)],_0x1ba0b9['rkhxC']))return{'status':_0x1ba0b9['rkhxC'],'error':_0x3d6d7c['detail']};throw _0x3d6d7c;}}export async function manualBrowserLogin(_0x598b67,_0x4273b3){const _0x42969e=_0x3f30ba,_0x1f630c={'XdcBu':function(_0x1030a2,_0x6abb6c){return _0x1030a2/_0x6abb6c;},'HGgAn':function(_0x2ae01c){return _0x2ae01c();},'HzgBa':'close','NfwLF':function(_0x5bb040,_0x49346d){return _0x5bb040+_0x49346d;},'tfISX':function(_0x3ef091,_0xdaf476){return _0x3ef091>_0xdaf476;},'PpcpA':function(_0x3079dc,_0x41f274){return _0x3079dc(_0x41f274);},'gigiM':function(_0xc8cb96,_0xdd346d){return _0xc8cb96&&_0xdd346d;},'UPLBz':_0x42969e(0x1cd),'OzyJA':'Browser\x20closed\x20before\x20authentication\x20was\x20saved.','VSYOY':function(_0x1d545a,_0x2a950b,_0x38f2c8){return _0x1d545a(_0x2a950b,_0x38f2c8);},'GhKSS':'POST','cvMPR':'cli:manual-login'};if(!isInteractive())throw new Error(_0x1f630c[_0x42969e(0x1e6)](_0x42969e(0x1d2)+_0x598b67[_0x42969e(0x1ff)]+'\x22.\x0a',_0x42969e(0x1a8))+'or\x20run\x20this\x20command\x20from\x20an\x20interactive\x20terminal\x20so\x20a\x20browser\x20can\x20open.');const _0x43dbbb=_0x4273b3&&_0x1f630c[_0x42969e(0x18f)](_0x4273b3['domains']['length'],0x0)?_0x4273b3['domains'][0x0]:_0x42969e(0x194);console['log']('\x0a\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20manually.'),console['log'](_0x42969e(0x1a1)),await new Promise(_0x13bdf5=>setTimeout(_0x13bdf5,0x7d0));const _0x27d2a5=await chromium[_0x42969e(0x1f6)]({'headless':![]});let _0x2781ea=null;try{const _0x3a9ba8={'ignoreHTTPSErrors':!![]};_0x4273b3?.[_0x42969e(0x1f7)]&&(_0x3a9ba8['extraHTTPHeaders']=_0x4273b3['setupHeaders']);const _0xbc5a01=await _0x27d2a5[_0x42969e(0x1b9)](_0x3a9ba8);await _0x1f630c[_0x42969e(0x1b8)](addProfileSetupBanner,_0xbc5a01);const _0x46128f=await _0xbc5a01['newPage']();await _0x46128f['goto'](_0x43dbbb);let _0x3d735c=![];await new Promise(_0x4ce4d7=>{const _0x51e074={'LcQpo':function(_0x23fe7b,_0x49cd5d){return _0x1f630c['XdcBu'](_0x23fe7b,_0x49cd5d);},'dtubV':function(_0x301ad9){return _0x1f630c['HGgAn'](_0x301ad9);},'JiNrH':function(_0x5e1777,_0x42fb11){return _0x5e1777(_0x42fb11);}},_0x26dd42=setTimeout(()=>{const _0x1ec9d1=_0x4b7a;_0x3d735c=!![],console['error']('Browser\x20login\x20timed\x20out\x20after\x20'+_0x51e074[_0x1ec9d1(0x1ba)](MANUAL_LOGIN_TIMEOUT_MS,0xea60)+_0x1ec9d1(0x1c7)),_0x51e074[_0x1ec9d1(0x1b5)](_0x4ce4d7);},MANUAL_LOGIN_TIMEOUT_MS);_0x46128f['on'](_0x1f630c['HzgBa'],async()=>{const _0x5c5012=_0x4b7a;_0x51e074[_0x5c5012(0x1a5)](clearTimeout,_0x26dd42);try{const _0x1e2830=await _0xbc5a01[_0x5c5012(0x1d0)]();_0x2781ea=_0x1e2830;}catch{}_0x4ce4d7();});});if(_0x1f630c[_0x42969e(0x1e2)](_0x3d735c,!_0x2781ea))throw new Error(_0x1f630c[_0x42969e(0x1e1)]);}finally{await _0x27d2a5['close']()['catch'](()=>{});}if(!_0x2781ea)throw new Error(_0x1f630c[_0x42969e(0x1d4)]);return await _0x1f630c[_0x42969e(0x1d8)](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x598b67['name'])+'/session',{'method':_0x1f630c['GhKSS'],'body':JSON['stringify']({'session_state':_0x2781ea,'updated_by':_0x1f630c[_0x42969e(0x1e0)]})}),{'sessionState':_0x2781ea};}export async function promptSaveCredentials(_0x1761cb){const _0x4407d0=_0x3f30ba,_0x566b65={'ovnIe':function(_0x29360e,_0x50b3c7){return _0x29360e||_0x50b3c7;},'CLLdh':function(_0x1f6207){return _0x1f6207();},'qUAzn':_0x4407d0(0x1a7),'zsNFN':_0x4407d0(0x1b4),'EElsA':'Save\x20credentials\x20to\x20profile\x20for\x20automatic\x20session\x20refresh?','WaUUW':function(_0x57b8e7,_0xe9fb6f,_0x54be8a){return _0x57b8e7(_0xe9fb6f,_0x54be8a);},'RtNmE':_0x4407d0(0x1b3),'GyuOI':_0x4407d0(0x1bd)},_0x1db193=process['env']['RANGER_TEST_USERNAME'],_0x1fb443=process[_0x4407d0(0x1a6)][_0x4407d0(0x1b1)];if(_0x566b65['ovnIe'](!_0x1db193,!_0x1fb443))return;if(!_0x566b65[_0x4407d0(0x1ca)](isInteractive))return;const {save:_0xda8558}=await _0x175a33['prompt']([{'type':_0x566b65['qUAzn'],'name':_0x566b65[_0x4407d0(0x18e)],'message':_0x566b65['EElsA'],'default':![]}]);if(!_0xda8558)return;await _0x566b65[_0x4407d0(0x1fe)](apiRequest,'/api/v1/profiles/'+encodeURIComponent(_0x1761cb),{'method':_0x566b65['RtNmE'],'body':JSON[_0x4407d0(0x1da)]({'username':_0x1db193,'password':_0x1fb443})}),console['log'](_0x566b65['GyuOI']);}export async function resolveCloudProfileSession(_0x33792d,_0x1cea13={}){const _0x292dbd=_0x3f30ba,_0x5408c4={'BKFtC':function(_0x2b69c5,_0x53cf96,_0x296c9a){return _0x2b69c5(_0x53cf96,_0x296c9a);},'torFx':function(_0x59fd9d,_0x104c11,_0x22db4f){return _0x59fd9d(_0x104c11,_0x22db4f);},'rkAdj':function(_0x2f8a25,_0xd3a890,_0x577634,_0x498aa0,_0x266094){return _0x2f8a25(_0xd3a890,_0x577634,_0x498aa0,_0x266094);},'DGDkJ':function(_0xb1601e,_0x2aad3e){return _0xb1601e(_0x2aad3e);},'TfvwS':'\x20\x20Server-side\x20login\x20not\x20configured\x20for\x20this\x20org.\x20Falling\x20back\x20to\x20manual\x20login...','TzTYi':function(_0x5c99f3,_0x4e39df){return _0x5c99f3===_0x4e39df;},'BoZsf':function(_0x22d660,_0x32a080,_0x251907,_0x1071a4,_0x26de75,_0x4e7c66,_0x2dfd7e,_0x2a1b0f){return _0x22d660(_0x32a080,_0x251907,_0x1071a4,_0x26de75,_0x4e7c66,_0x2dfd7e,_0x2a1b0f);},'AQcAk':function(_0x3f5e2c,_0x151731){return _0x3f5e2c(_0x151731);},'VSoZY':_0x292dbd(0x191),'bQTDY':function(_0x3d152e,_0x239429,_0xf39f3a,_0x5d0402,_0x4f279e,_0x35b0a1,_0x2192df,_0x419e75){return _0x3d152e(_0x239429,_0xf39f3a,_0x5d0402,_0x4f279e,_0x35b0a1,_0x2192df,_0x419e75);}},_0x217973=_0x33792d['settings']??{},_0x568ef8=await fetchAuthConfig(),_0x46da20=_0x568ef8?_0x5408c4['BKFtC'](resolveAuthEnvironmentLocally,_0x568ef8,_0x33792d[_0x292dbd(0x1ab)]):null,_0x79e351=_0x46da20?.[_0x292dbd(0x1cb)],_0x27d1ef=_0x217973['setupHeaders'],_0x4de620=_0x27d1ef??_0x46da20?.['setupHeaders'],_0x4fc736=_0x1cea13['effectiveBaseUrl']??_0x217973[_0x292dbd(0x190)]??(_0x79e351&&_0x79e351[_0x292dbd(0x1a9)]>0x0?_0x79e351[0x0]:''),_0x47d357={'invalidateOn':_0x46da20?.['invalidateOn'],'userAgent':_0x46da20?.[_0x292dbd(0x1af)]?.['userAgent']??_0x217973['userAgent']},_0x21bae0=await checkLocalCache(_0x33792d[_0x292dbd(0x1ff)],_0x33792d[_0x292dbd(0x1fc)],_0x4fc736,_0x4de620,_0x47d357);if(_0x21bae0){if(_0x4fc736){const _0x523873=await isCachedSessionLive(_0x21bae0['storageStatePath'],_0x4fc736,{'sessionCheckPath':_0x46da20?.['sessionCheckPath'],'setupHeaders':_0x4de620},{'launchBrowser':launchRealBrowser});if(_0x523873)return console['log']('\x20\x20Using\x20cached\x20session\x20for\x20cloud\x20profile\x20\x22'+_0x33792d[_0x292dbd(0x1ff)]+'\x22'),{'authPath':_0x21bae0['storageStatePath'],'settings':_0x217973,'resolvedEnv':_0x46da20};console[_0x292dbd(0x1c5)](_0x292dbd(0x192)+_0x33792d['name']+'\x22\x20failed\x20validation\x20—\x20refreshing...'),_0x5408c4['torFx'](emitSessionValidationHint,_0x4fc736,_0x46da20);}else return{'authPath':_0x21bae0['storageStatePath'],'settings':_0x217973,'resolvedEnv':_0x46da20};}if(_0x33792d['sessionState']){const _0x207542=await writeSessionToLocalCache(_0x33792d['name'],_0x33792d[_0x292dbd(0x1fc)],_0x4fc736,_0x4de620,_0x33792d['sessionState'],_0x79e351,_0x47d357);if(_0x4fc736){const _0x3f4f2f=await _0x5408c4['rkAdj'](isCachedSessionLive,_0x207542,_0x4fc736,{'sessionCheckPath':_0x46da20?.['sessionCheckPath'],'setupHeaders':_0x4de620},{'launchBrowser':launchRealBrowser});if(_0x3f4f2f)return console['log']('\x20\x20Cloud\x20session\x20is\x20live\x20for\x20\x22'+_0x33792d[_0x292dbd(0x1ff)]+'\x22,\x20cached\x20locally'),{'authPath':_0x207542,'settings':_0x217973,'resolvedEnv':_0x46da20};console['log'](_0x292dbd(0x1cc)+_0x33792d['name']+'\x22\x20failed\x20validation\x20—\x20re-login\x20needed...'),emitSessionValidationHint(_0x4fc736,_0x46da20);}else return{'authPath':_0x207542,'settings':_0x217973,'resolvedEnv':_0x46da20};}console['log'](_0x292dbd(0x1ae)+_0x33792d['name']+'\x22,\x20attempting\x20login...');const _0x2963d4=_0x5408c4[_0x292dbd(0x1ce)](Boolean,process[_0x292dbd(0x1a6)][_0x292dbd(0x1ef)])&&Boolean(process['env'][_0x292dbd(0x1b1)]),_0x3acff7=_0x5408c4[_0x292dbd(0x1ce)](Boolean,_0x33792d[_0x292dbd(0x1fb)]);if(_0x2963d4||_0x3acff7)try{const _0x3e4eb4=await _0x5408c4['DGDkJ'](serverSideLogin,_0x33792d['name']);if(_0x3e4eb4['status']===_0x292dbd(0x1eb))console['log'](_0x5408c4[_0x292dbd(0x1c0)]);else{if(_0x5408c4[_0x292dbd(0x1d1)](_0x3e4eb4[_0x292dbd(0x19c)],'success')&&_0x3e4eb4['session_state']){console['log'](_0x292dbd(0x1dd));const _0x5445ae=await _0x5408c4[_0x292dbd(0x1f4)](writeSessionToLocalCache,_0x33792d[_0x292dbd(0x1ff)],_0x33792d[_0x292dbd(0x1fc)],_0x4fc736,_0x4de620,_0x3e4eb4[_0x292dbd(0x1d5)],_0x79e351,_0x47d357);return _0x2963d4&&!_0x3acff7&&await _0x5408c4['AQcAk'](promptSaveCredentials,_0x33792d[_0x292dbd(0x1ff)]),{'authPath':_0x5445ae,'settings':_0x217973,'resolvedEnv':_0x46da20};}else _0x3e4eb4['test_output']&&(console[_0x292dbd(0x1c5)](_0x5408c4['VSoZY']),console[_0x292dbd(0x1c5)](_0x3e4eb4['test_output'])),console['log']('\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...');}}catch(_0x28bce9){console[_0x292dbd(0x1c5)](_0x292dbd(0x1a3)+(_0x28bce9 instanceof Error?_0x28bce9['message']:String(_0x28bce9))),console[_0x292dbd(0x1c5)](_0x292dbd(0x1f1));}const {sessionState:_0x4c9027}=await manualBrowserLogin(_0x33792d,_0x46da20),_0x18c0da=await _0x5408c4['bQTDY'](writeSessionToLocalCache,_0x33792d[_0x292dbd(0x1ff)],_0x33792d[_0x292dbd(0x1fc)],_0x4fc736,_0x4de620,_0x4c9027,_0x79e351,_0x47d357);return{'authPath':_0x18c0da,'settings':_0x217973,'resolvedEnv':_0x46da20};}function _0x5358(){const _0x3dff4a=['stringify','/api/v1/profiles','profiles','\x20\x20Login\x20successful.\x20Session\x20cached.','cFXJr',').\x20','cvMPR','UPLBz','gigiM','string','/api/v1/profiles/','userAgent','NfwLF','invalidateOn','92VpveOv','settings','\x22\x20not\x20found.','not_configured','clientIp','cookies','Your\x20org\x20has\x20more\x20than\x20one\x20environment\x20configured\x20(','RANGER_TEST_USERNAME','Cloud\x20profile\x20\x22','\x20\x20Falling\x20back\x20to\x20manual\x20browser\x20login...','raw','qzuBb','BoZsf','):\x20','launch','setupHeaders','12478998zUPLuP','EFrPl','32559rkUSfd','username','organizationId','9721896OnZxFJ','WaUUW','name','EGPNB','zsNFN','tfISX','baseUrl','\x0a\x20\x20Server-side\x20login\x20failed.\x20Test\x20output:','\x20\x20Cached\x20session\x20for\x20\x22','origin','about:blank','5qSIfOd','error','lKgwX','statusText','json','force','16255197OSDvLS','status','ApiError','30594220pzSNfB','/login','auth','\x20\x20When\x20done,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.\x0a','keys','\x20\x20Server-side\x20login\x20error:\x20','996gqOtpn','JiNrH','env','confirm','\x20\x20Set\x20RANGER_TEST_USERNAME/RANGER_TEST_PASSWORD\x20so\x20Ranger\x20can\x20log\x20in\x20for\x20you,\x20','length','rivgF','environmentKey','oNrsv','YxhWq','\x20\x20No\x20live\x20session\x20for\x20\x22','browserOptions','\x20failed\x20(','RANGER_TEST_PASSWORD','TFAhW','PUT','save','dtubV','password','utf-8','PpcpA','newContext','LcQpo','/session','7386774fkGsZz','\x20\x20Credentials\x20saved\x20to\x20cloud\x20profile.','jCpNG','toISOString','TfvwS','defaultEnvironmentKey','PlLbc','code','QcOUF','log','EfLYv','\x20minutes\x20—\x20close\x20the\x20browser\x20to\x20retry.','\x0aWarning:\x20could\x20not\x20fetch\x20org\x20auth\x20config:\x20','API\x20request\x20','CLLdh','domains','\x20\x20Cloud\x20session\x20for\x20\x22','Browser\x20login\x20timed\x20out\x20before\x20completion.','DGDkJ','kzewl','storageState','TzTYi','No\x20automatic\x20login\x20available\x20for\x20profile\x20\x22','POST','OzyJA','session_state','IVODL','16581dYszYv','VSYOY','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'];_0x5358=function(){return _0x3dff4a;};return _0x5358();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x4f0da8=_0x5be4;(function(_0x4659b8,_0x7acac){const _0x1e221c=_0x5be4,_0x2615b6=_0x4659b8();while(!![]){try{const _0x3bce52=-parseInt(_0x1e221c(0x143))/0x1*(-parseInt(_0x1e221c(0x138))/0x2)+-parseInt(_0x1e221c(0x146))/0x3+-parseInt(_0x1e221c(0x12e))/0x4*(parseInt(_0x1e221c(0x123))/0x5)+-parseInt(_0x1e221c(0x130))/0x6*(parseInt(_0x1e221c(0x114))/0x7)+-parseInt(_0x1e221c(0x11e))/0x8+-parseInt(_0x1e221c(0x127))/0x9*(parseInt(_0x1e221c(0x12d))/0xa)+parseInt(_0x1e221c(0x117))/0xb;if(_0x3bce52===_0x7acac)break;else _0x2615b6['push'](_0x2615b6['shift']());}catch(_0x367417){_0x2615b6['push'](_0x2615b6['shift']());}}}(_0x1d0c,0x19aad));import{createHash}from'crypto';import{join}from'path';import{getRangerHomeDir}from'./rangerRoot.js';export function isInteractive(_0x151dce=process['env'],_0x4d6fc0={'stdin':process[_0x4f0da8(0x12c)],'stdout':process[_0x4f0da8(0x116)]}){const _0x5822e8=_0x4f0da8,_0x1c83c4={'UrfdM':function(_0x4347da,_0x2c3386){return _0x4347da(_0x2c3386);}};if(_0x151dce['CI'])return![];return _0x1c83c4['UrfdM'](Boolean,_0x4d6fc0['stdin'][_0x5822e8(0x11d)])&&Boolean(_0x4d6fc0[_0x5822e8(0x116)][_0x5822e8(0x11d)]);}export const DEFAULT_INVALIDATE_ON=[];export function sessionCacheHash(_0x59280e){const _0x16b33f=_0x4f0da8,_0x52a123={'AoJDm':_0x16b33f(0x11b),'YvLbw':'userAgent','NFwnY':function(_0x194922,_0x1619b7){return _0x194922!==_0x1619b7;},'yvSBP':'clientIp','PWjOU':'hex'},_0x4d42b1=new Set(_0x59280e[_0x16b33f(0x136)]??DEFAULT_INVALIDATE_ON),_0x1d8297={'orgId':_0x59280e[_0x16b33f(0x142)],'profileName':_0x59280e[_0x16b33f(0x145)]};return _0x4d42b1[_0x16b33f(0x11f)]('baseUrl')&&(_0x1d8297[_0x16b33f(0x113)]=_0x59280e['effectiveBaseUrl']),_0x4d42b1[_0x16b33f(0x11f)](_0x16b33f(0x11c))&&(_0x1d8297['setupHeaders']=_0x59280e['setupHeaders']?sortObjectKeys(_0x59280e[_0x16b33f(0x11c)]):_0x59280e['setupHeaders']),_0x4d42b1[_0x16b33f(0x11f)](_0x52a123['AoJDm'])&&(_0x1d8297[_0x16b33f(0x11b)]=extractPort(_0x59280e[_0x16b33f(0x113)])),_0x4d42b1['has'](_0x52a123[_0x16b33f(0x13b)])&&_0x52a123['NFwnY'](_0x59280e[_0x16b33f(0x13f)],undefined)&&(_0x1d8297['userAgent']=_0x59280e['userAgent']),_0x4d42b1[_0x16b33f(0x11f)](_0x52a123[_0x16b33f(0x126)])&&_0x59280e['clientIp']!==undefined&&(_0x1d8297['clientIp']=_0x59280e[_0x16b33f(0x12a)]),createHash(_0x16b33f(0x131))['update'](JSON[_0x16b33f(0x13e)](_0x1d8297))[_0x16b33f(0x12b)](_0x52a123['PWjOU'])['slice'](0x0,0xc);}function extractPort(_0x471036){const _0x328fdd=_0x4f0da8;try{return new URL(_0x471036)[_0x328fdd(0x11b)];}catch{return'';}}function sortObjectKeys(_0x459be0){const _0x57946e=_0x4f0da8,_0x1b5a89={};for(const _0x42a483 of Object[_0x57946e(0x137)](_0x459be0)['sort']()){_0x1b5a89[_0x42a483]=_0x459be0[_0x42a483];}return _0x1b5a89;}export function getSessionCachePath(_0x469a5a,_0x5367b3){const _0x5a52a4=_0x4f0da8,_0x593992={'NddDT':function(_0x1eca68,_0x394bb2,_0xdeef44,_0xc84462){return _0x1eca68(_0x394bb2,_0xdeef44,_0xc84462);},'ZgGMc':_0x5a52a4(0x132)};return _0x593992['NddDT'](join,getRangerHomeDir(),_0x593992[_0x5a52a4(0x13c)],_0x469a5a+'-'+_0x5367b3+'.json');}export function getStorageStatePath(_0x2567f7){const _0x367c70=_0x4f0da8,_0x3fbf33={'DJwkL':'.storageState.json'};return _0x2567f7[_0x367c70(0x134)](/\.json$/,_0x3fbf33[_0x367c70(0x12f)]);}export function needsTunnel(_0x56edd7){const _0x5472af=_0x4f0da8,_0x509a4a={'qUBKi':function(_0x41bfdc,_0x51966c){return _0x41bfdc===_0x51966c;},'koUwV':_0x5472af(0x119)};let _0x21e3fa;try{_0x21e3fa=new URL(_0x56edd7)[_0x5472af(0x141)];}catch{return![];}if(_0x21e3fa==='localhost'||_0x509a4a['qUBKi'](_0x21e3fa,'127.0.0.1'))return!![];if(_0x21e3fa['endsWith']('.localhost'))return!![];if(_0x21e3fa[_0x5472af(0x129)](_0x509a4a[_0x5472af(0x115)]))return!![];return![];}export function hostnameOf(_0x15aec7){const _0x556a3b=_0x4f0da8;return new URL(_0x15aec7)[_0x556a3b(0x141)];}export function duplicateCookiesForDomains(_0x137ed4,_0x17e2af){const _0x372e1f=_0x4f0da8,_0x3d0932=[..._0x137ed4],_0x35476a=new Set(_0x137ed4['map'](_0x1f0b37=>_0x1f0b37['domain']));for(const _0x35cbe0 of _0x17e2af){let _0x1138e3;try{_0x1138e3=hostnameOf(_0x35cbe0);}catch{continue;}if(!_0x1138e3)continue;const _0x20c313=_0x1138e3['startsWith']('.')?_0x1138e3:'.'+_0x1138e3;if(_0x35476a[_0x372e1f(0x11f)](_0x1138e3)||_0x35476a[_0x372e1f(0x11f)](_0x20c313))continue;for(const _0x31171e of _0x137ed4){_0x3d0932[_0x372e1f(0x125)]({..._0x31171e,'domain':_0x20c313});}_0x35476a[_0x372e1f(0x144)](_0x20c313);}return _0x3d0932;}export function resolveAuthEnvironmentLocally(_0x2b671e,_0x44c765){const _0x4ef99c=_0x4f0da8,_0x3d6e48={'qNlsr':function(_0x51918d,_0x3e7e09){return _0x51918d===_0x3e7e09;}},_0x131952=_0x2b671e['environments'];if(_0x44c765){const _0x270909=_0x131952[_0x44c765];if(!_0x270909)return null;return{'key':_0x44c765,..._0x270909};}if(_0x2b671e[_0x4ef99c(0x13d)]){const _0x33ed2a=_0x131952[_0x2b671e[_0x4ef99c(0x13d)]];if(!_0x33ed2a)return null;return{'key':_0x2b671e[_0x4ef99c(0x13d)],..._0x33ed2a};}const _0x4bda91=Object[_0x4ef99c(0x137)](_0x131952);if(_0x3d6e48[_0x4ef99c(0x122)](_0x4bda91[_0x4ef99c(0x11a)],0x1)){const _0x4a3a47=_0x4bda91[0x0];return{'key':_0x4a3a47,..._0x131952[_0x4a3a47]};}return null;}const LOGIN_URL_PATTERN=/(?:^|\/)(login|signin|sign-in|sso|auth\/login)(?:[/?#]|$)/i;export function buildSessionCheckUrl(_0x1e0b11,_0x2cbf8a){const _0x444b5f=_0x4f0da8;try{if(_0x2cbf8a)return new URL(_0x2cbf8a,_0x1e0b11)['toString']();return new URL(_0x1e0b11)[_0x444b5f(0x118)]();}catch{return null;}}function _0x5be4(_0x1c25c7,_0x3d6b9){_0x1c25c7=_0x1c25c7-0x113;const _0x1d0c63=_0x1d0c();let _0x5be4eb=_0x1d0c63[_0x1c25c7];return _0x5be4eb;}function _0x1d0c(){const _0x16dc90=['userAgent','LVewr','hostname','orgId','2BeOIrf','add','profileName','58113HqlInk','effectiveBaseUrl','722617ZvoYSg','koUwV','stdout','8398181tukvoD','toString','localhost.','length','port','setupHeaders','isTTY','1375232kSZtHW','has','close','pathname','qNlsr','5QLQCql','newPage','push','yvSBP','5499VgIeTm','url','includes','clientIp','digest','stdin','3220zZOlBl','805936QRorpI','DJwkL','6wrGHdt','sha256','auth','catch','replace','launchBrowser','invalidateOn','keys','34394rEkFTr','status','test','YvLbw','ZgGMc','defaultEnvironmentKey','stringify'];_0x1d0c=function(){return _0x16dc90;};return _0x1d0c();}export function looksLikeLoginUrl(_0x3cb22b){const _0x1cc219=_0x4f0da8;try{const _0x16a4a8=new URL(_0x3cb22b);return LOGIN_URL_PATTERN[_0x1cc219(0x13a)](_0x16a4a8[_0x1cc219(0x121)]);}catch{return LOGIN_URL_PATTERN[_0x1cc219(0x13a)](_0x3cb22b);}}export async function isCachedSessionLive(_0x2ad26c,_0x334a65,_0x565072={},_0x41b8e5={}){const _0x361c71=_0x4f0da8,_0x362680={'LVewr':function(_0x5c67d8,_0x1138a3,_0x2b635e){return _0x5c67d8(_0x1138a3,_0x2b635e);},'ZFWKA':function(_0x11f15e,_0xcab1ab){return _0x11f15e===_0xcab1ab;}},_0x17d2c4=_0x362680[_0x361c71(0x140)](buildSessionCheckUrl,_0x334a65,_0x565072['sessionCheckPath']);if(!_0x17d2c4)return!![];if(!_0x41b8e5[_0x361c71(0x135)])return!![];let _0x4cd9cc=null;try{_0x4cd9cc=await _0x41b8e5['launchBrowser']();const _0x167492=await _0x4cd9cc['newContext']({'storageState':_0x2ad26c,'ignoreHTTPSErrors':!![],..._0x565072[_0x361c71(0x11c)]?{'extraHTTPHeaders':_0x565072['setupHeaders']}:{}}),_0xad71c=await _0x167492[_0x361c71(0x124)](),_0x1e051a=await _0xad71c['goto'](_0x17d2c4,{'waitUntil':'domcontentloaded','timeout':0x3a98}),_0x2e0f2f=_0x1e051a?.[_0x361c71(0x139)]();if(_0x362680['ZFWKA'](_0x2e0f2f,0x191)||_0x2e0f2f===0x193)return![];const _0x42f07c=_0xad71c[_0x361c71(0x128)]();if(looksLikeLoginUrl(_0x42f07c))return![];return!![];}catch{return![];}finally{if(_0x4cd9cc)await _0x4cd9cc[_0x361c71(0x120)]()[_0x361c71(0x133)](()=>{});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2c6306,_0x1e1db3){const _0x3da927=_0x19f5,_0x417d6=_0x2c6306();while(!![]){try{const _0x28413d=parseInt(_0x3da927(0xcf))/0x1*(parseInt(_0x3da927(0xd9))/0x2)+-parseInt(_0x3da927(0xc8))/0x3*(-parseInt(_0x3da927(0xc5))/0x4)+parseInt(_0x3da927(0xcc))/0x5*(parseInt(_0x3da927(0xc9))/0x6)+parseInt(_0x3da927(0xd5))/0x7*(-parseInt(_0x3da927(0xd3))/0x8)+parseInt(_0x3da927(0xcb))/0x9+parseInt(_0x3da927(0xd8))/0xa+-parseInt(_0x3da927(0xd7))/0xb;if(_0x28413d===_0x1e1db3)break;else _0x417d6['push'](_0x417d6['shift']());}catch(_0x16247a){_0x417d6['push'](_0x417d6['shift']());}}}(_0x32d1,0xe8fda));import{createCipheriv,createDecipheriv,randomBytes,pbkdf2Sync}from'crypto';const ALGORITHM='aes-256-gcm',SALT='ranger-auth-encryption',KEY_LENGTH=0x20,IV_LENGTH=0x10,TAG_LENGTH=0x10;export function deriveKey(_0x2473ac){const _0x45b998=_0x19f5,_0x1ccb84={'Anvmq':function(_0x13a8f1,_0x29524e,_0x296ac0,_0x36dd9a,_0xf16f9b,_0xff6c78){return _0x13a8f1(_0x29524e,_0x296ac0,_0x36dd9a,_0xf16f9b,_0xff6c78);},'JoyfN':'sha256'};return _0x1ccb84[_0x45b998(0xd0)](pbkdf2Sync,_0x2473ac,SALT,0x186a0,KEY_LENGTH,_0x1ccb84[_0x45b998(0xc6)]);}function _0x19f5(_0x3466b1,_0x3cbc96){_0x3466b1=_0x3466b1-0xc4;const _0x32d170=_0x32d1();let _0x19f539=_0x32d170[_0x3466b1];return _0x19f539;}export function encrypt(_0xd1cb54,_0x27ba89){const _0x5342d3=_0x19f5,_0x1d412b={'faVGm':function(_0xedbdfa,_0x48fca5){return _0xedbdfa(_0x48fca5);}},_0x461e78=deriveKey(_0x27ba89),_0x93f5a8=_0x1d412b[_0x5342d3(0xce)](randomBytes,IV_LENGTH),_0xa07f62=createCipheriv(ALGORITHM,_0x461e78,_0x93f5a8),_0x69d3dd=Buffer['concat']([_0xa07f62['update'](_0xd1cb54,_0x5342d3(0xc7)),_0xa07f62[_0x5342d3(0xd2)]()]),_0x2850f6=_0xa07f62[_0x5342d3(0xca)]();return Buffer['concat']([_0x93f5a8,_0x2850f6,_0x69d3dd]);}function _0x32d1(){const _0x30d7c7=['3932mPJXmu','JoyfN','utf8','4704RflOSC','2082ViHeRt','getAuthTag','6199200IzuGHf','22150wWhDFX','mVLXi','faVGm','1127654eRKnQF','Anvmq','oPOuJ','final','536dGOTjp','setAuthTag','99953mhFGwR','subarray','36123769KqZAEm','2999940OLabTj','2GafzuV','ZfWKJ','zsEnl'];_0x32d1=function(){return _0x30d7c7;};return _0x32d1();}export function decrypt(_0x27687b,_0x451725){const _0x4b869f=_0x19f5,_0x47f3ad={'zsEnl':function(_0x2f2058,_0x3ef902){return _0x2f2058(_0x3ef902);},'mVLXi':function(_0x4fc1ab,_0x356037){return _0x4fc1ab+_0x356037;},'oPOuJ':function(_0x256910,_0x799867,_0x5dbc83,_0xbce26b){return _0x256910(_0x799867,_0x5dbc83,_0xbce26b);},'ShtMp':function(_0x2f2cbc,_0x3718a9){return _0x2f2cbc+_0x3718a9;},'ZfWKJ':'utf8'},_0x2d3a16=_0x47f3ad[_0x4b869f(0xc4)](deriveKey,_0x451725),_0x58769d=_0x27687b[_0x4b869f(0xd6)](0x0,IV_LENGTH),_0x48aa23=_0x27687b['subarray'](IV_LENGTH,_0x47f3ad[_0x4b869f(0xcd)](IV_LENGTH,TAG_LENGTH)),_0x37a67b=_0x27687b['subarray'](IV_LENGTH+TAG_LENGTH),_0x352158=_0x47f3ad[_0x4b869f(0xd1)](createDecipheriv,ALGORITHM,_0x2d3a16,_0x58769d);return _0x352158[_0x4b869f(0xd4)](_0x48aa23),_0x47f3ad['ShtMp'](_0x352158['update'](_0x37a67b),_0x352158['final'](_0x47f3ad[_0x4b869f(0xda)]));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x3e820b=_0x1e83;function _0x3b4d(){const _0x4a654d=['1615369UJqxgG','unknown_command','POST','10872iYcOMR','has_token','push','/api/v1/mcp/desire-path-logs','errorMessage','rawCommand','62QUydSj','[desire-path]\x20Sending\x20log\x20to\x20','1324992PQwsic','Authorization','split','--token','fHfyV','DEBUG','omnik','TPGyV','Missing\x20required\x20argument','[REDACTED]','no_token','--authorization','--cookie','has','woktQ','Unknown\x20argument','--pass','includes','syntax_error','startsWith','slice','27831xmMHLD','catch','25485GrokyX','toLowerCase','96vncCrZ','Bearer\x20','stringify','application/json','Invalid\x20values','mmivw','--auth','--key','425828WMDUjn','Unknown\x20command','ACDZf','error','runtime_error','[desire-path]\x20Payload:\x20','622350lXgcuP','env'];_0x3b4d=function(){return _0x4a654d;};return _0x3b4d();}(function(_0x26086c,_0x17eae7){const _0x12ecc1=_0x1e83,_0xe511a0=_0x26086c();while(!![]){try{const _0x2b7e68=-parseInt(_0x12ecc1(0x8c))/0x1+parseInt(_0x12ecc1(0xa7))/0x2*(-parseInt(_0x12ecc1(0x8a))/0x3)+-parseInt(_0x12ecc1(0x96))/0x4+parseInt(_0x12ecc1(0x9c))/0x5+parseInt(_0x12ecc1(0xa9))/0x6+parseInt(_0x12ecc1(0x9e))/0x7+-parseInt(_0x12ecc1(0x8e))/0x8*(-parseInt(_0x12ecc1(0xa1))/0x9);if(_0x2b7e68===_0x17eae7)break;else _0xe511a0['push'](_0xe511a0['shift']());}catch(_0x56f91d){_0xe511a0['push'](_0xe511a0['shift']());}}}(_0x3b4d,0x29c1c));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';function _0x1e83(_0x2a62d0,_0x21343d){_0x2a62d0=_0x2a62d0-0x80;const _0x3b4d19=_0x3b4d();let _0x1e839d=_0x3b4d19[_0x2a62d0];return _0x1e839d;}import{getCurrentVersion}from'./version.js';const SENSITIVE_FLAGS=new Set([_0x3e820b(0xac),'-t','--secret','--api-key','--apikey',_0x3e820b(0x95),'--password',_0x3e820b(0x85),_0x3e820b(0x94),_0x3e820b(0x80),'--header',_0x3e820b(0x81),'--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(_0x37f573){return TOKEN_PATTERNS['some'](_0x14f3dc=>_0x14f3dc['test'](_0x37f573));}export function sanitizeArgs(_0x3b31b3){const _0x7390af=_0x3e820b,_0x136d0c={'mmivw':_0x7390af(0xb2),'omnik':function(_0x3e309b,_0x416d27){return _0x3e309b(_0x416d27);}},_0x5a2ec7=[];let _0x533213=![];for(let _0x1c86ec=0x0;_0x1c86ec<_0x3b31b3['length'];_0x1c86ec++){const _0x7bbca2=_0x3b31b3[_0x1c86ec];if(_0x533213){_0x5a2ec7['push'](_0x136d0c['mmivw']),_0x533213=![];continue;}if(_0x7bbca2[_0x7390af(0x88)]('--')||_0x7bbca2['startsWith']('-')){const _0x5c341b=_0x7bbca2['indexOf']('=');if(_0x5c341b!==-0x1){const _0xd8ca2f=_0x7bbca2['slice'](0x0,_0x5c341b)[_0x7390af(0x8d)]();if(SENSITIVE_FLAGS[_0x7390af(0x82)](_0xd8ca2f)){_0x5a2ec7[_0x7390af(0xa3)](_0x7bbca2[_0x7390af(0x89)](0x0,_0x5c341b)+'=[REDACTED]');continue;}}else{const _0x3d4f9e=_0x7bbca2['toLowerCase']();SENSITIVE_FLAGS[_0x7390af(0x82)](_0x3d4f9e)&&(_0x533213=!![]);}_0x5a2ec7['push'](_0x7bbca2);}else _0x136d0c[_0x7390af(0xaf)](looksLikeToken,_0x7bbca2)?_0x5a2ec7[_0x7390af(0xa3)](_0x136d0c[_0x7390af(0x93)]):_0x5a2ec7['push'](_0x7bbca2);}return _0x5a2ec7['join']('\x20');}export async function logDesirePath(_0x46bc58){const _0x433618=_0x3e820b,_0x577b34={'GySCd':function(_0x25ffce,_0x32cbc8,_0x5d38bf){return _0x25ffce(_0x32cbc8,_0x5d38bf);}};try{const _0x152cfb=await getToken()[_0x433618(0x8b)](()=>null),_0x4d426f=getApiBaseUrl(),_0x6499fe=getCurrentVersion(),_0x3358af=_0x152cfb?_0x433618(0xa2):_0x433618(0xb3),_0x1b5280={..._0x46bc58['metadata'],'authStatus':_0x3358af,'isTty':process['stdout']['isTTY']??![]},_0x361bbc={'Content-Type':_0x433618(0x91)};_0x152cfb&&(_0x361bbc[_0x433618(0xaa)]=_0x433618(0x8f)+_0x152cfb);const _0x16cce9={'rawCommand':_0x46bc58[_0x433618(0xa6)],'errorMessage':_0x46bc58[_0x433618(0xa5)],'errorType':_0x46bc58['errorType'],'featureId':_0x46bc58['featureId'],'sessionId':_0x46bc58['sessionId'],'metadata':_0x1b5280,'cliVersion':_0x6499fe};process[_0x433618(0x9d)][_0x433618(0xae)]&&(console['error'](_0x433618(0xa8)+_0x4d426f+_0x433618(0xa4)),console[_0x433618(0x99)](_0x433618(0x9b)+JSON['stringify'](_0x16cce9,null,0x2))),await _0x577b34['GySCd'](fetch,_0x4d426f+'/api/v1/mcp/desire-path-logs',{'method':_0x433618(0xa0),'headers':_0x361bbc,'body':JSON[_0x433618(0x90)](_0x16cce9)});}catch(_0x28d1e2){process['env']['DEBUG']&&console[_0x433618(0x99)]('[desire-path]\x20Failed\x20to\x20send:\x20'+_0x28d1e2);}}export function getErrorType(_0x2d4fb9,_0x3ec130){const _0x22079b=_0x3e820b,_0x7ff855={'lXpYV':'1|2|3|5|7|0|4|6','oHeQv':_0x22079b(0x92),'TPGyV':'invalid_option_value','dZqTv':_0x22079b(0xb1),'RHVQD':'missing_option','ACDZf':_0x22079b(0x84),'fHfyV':'unknown_argument','woktQ':_0x22079b(0x87)},_0x22c431=_0x7ff855['lXpYV'][_0x22079b(0xab)]('|');let _0x2edf20=0x0;while(!![]){switch(_0x22c431[_0x2edf20++]){case'0':if(_0x2d4fb9[_0x22079b(0x86)](_0x7ff855['oHeQv']))return _0x7ff855[_0x22079b(0xb0)];continue;case'1':if(_0x3ec130)return _0x22079b(0x9a);continue;case'2':if(!_0x2d4fb9)return'unknown';continue;case'3':if(_0x2d4fb9['includes'](_0x22079b(0x97)))return _0x22079b(0x9f);continue;case'4':if(_0x2d4fb9[_0x22079b(0x86)](_0x7ff855['dZqTv']))return _0x7ff855['RHVQD'];continue;case'5':if(_0x2d4fb9[_0x22079b(0x86)](_0x7ff855[_0x22079b(0x98)]))return _0x7ff855[_0x22079b(0xad)];continue;case'6':return _0x7ff855[_0x22079b(0x83)];case'7':if(_0x2d4fb9[_0x22079b(0x86)]('Not\x20enough\x20non-option\x20arguments'))return'missing_required_argument';continue;}break;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x37ffa5=_0x3966;(function(_0x1c629e,_0x57f3b8){const _0x4274ba=_0x3966,_0x2fc414=_0x1c629e();while(!![]){try{const _0x166245=parseInt(_0x4274ba(0x1b0))/0x1*(parseInt(_0x4274ba(0x1bc))/0x2)+parseInt(_0x4274ba(0x1ac))/0x3+-parseInt(_0x4274ba(0x1af))/0x4*(-parseInt(_0x4274ba(0x1ae))/0x5)+-parseInt(_0x4274ba(0x1c6))/0x6*(parseInt(_0x4274ba(0x1a7))/0x7)+-parseInt(_0x4274ba(0x1dd))/0x8+parseInt(_0x4274ba(0x1c4))/0x9*(parseInt(_0x4274ba(0x1d6))/0xa)+parseInt(_0x4274ba(0x1cd))/0xb;if(_0x166245===_0x57f3b8)break;else _0x2fc414['push'](_0x2fc414['shift']());}catch(_0x2e705a){_0x2fc414['push'](_0x2fc414['shift']());}}}(_0x33c4,0x66eb0));import{spawn}from'child_process';import _0x4a770f from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL='https://api.workos.com/user_management/authorize/device',WORKOS_TOKEN_URL=_0x37ffa5(0x1bf);export async function requestDeviceCode(_0x47f5e){const _0x5c182b=_0x37ffa5,_0x911c85={'hNYHH':'POST'},_0x1922c6=await fetch(WORKOS_DEVICE_AUTH_URL,{'method':_0x911c85[_0x5c182b(0x196)],'headers':{'Content-Type':_0x5c182b(0x18f)},'body':new URLSearchParams({'client_id':_0x47f5e})});if(!_0x1922c6['ok']){const _0x2c8b6f=await _0x1922c6['text']();throw new Error('Failed\x20to\x20request\x20device\x20code:\x20'+_0x1922c6['status']+'\x20'+_0x2c8b6f);}return _0x1922c6[_0x5c182b(0x1d4)]();}export async function pollForTokens(_0xf14de1,_0x373f79,_0x5e599e,_0x2c9425){const _0x20d8ca=_0x37ffa5,_0x6e5418={'czpgy':function(_0x1d3a5e,_0x17374a){return _0x1d3a5e<_0x17374a;},'KTyjq':function(_0x16c073,_0x57b670,_0x372d42){return _0x16c073(_0x57b670,_0x372d42);},'rZBJN':'POST','JXWTs':'authorization_pending','CXwDH':function(_0x43170e,_0x3bc7f9){return _0x43170e===_0x3bc7f9;},'cCnLo':_0x20d8ca(0x19b),'mHDPN':'Device\x20authorization\x20timed\x20out'},_0x589f9a=Date[_0x20d8ca(0x19d)]()+_0x2c9425*0x3e8;let _0x1df2a2=_0x5e599e*0x3e8;while(_0x6e5418['czpgy'](Date[_0x20d8ca(0x19d)](),_0x589f9a)){await sleep(_0x1df2a2);const _0xa2db0b=await _0x6e5418[_0x20d8ca(0x1be)](fetch,WORKOS_TOKEN_URL,{'method':_0x6e5418['rZBJN'],'headers':{'Content-Type':_0x20d8ca(0x18f)},'body':new URLSearchParams({'client_id':_0xf14de1,'device_code':_0x373f79,'grant_type':'urn:ietf:params:oauth:grant-type:device_code'})});if(_0xa2db0b['ok'])return _0xa2db0b[_0x20d8ca(0x1d4)]();const _0x1cda44=await _0xa2db0b[_0x20d8ca(0x1d4)]();if(_0x1cda44[_0x20d8ca(0x195)]===_0x6e5418[_0x20d8ca(0x19f)])continue;if(_0x6e5418[_0x20d8ca(0x1a3)](_0x1cda44[_0x20d8ca(0x195)],_0x6e5418['cCnLo'])){_0x1df2a2+=0x3e8;continue;}throw new Error(_0x1cda44['error_description']||_0x1cda44['error']||'Authentication\x20failed');}throw new Error(_0x6e5418[_0x20d8ca(0x1cf)]);}async function fetchUserProfile(_0x1f7b5d){const _0x348109=_0x37ffa5,_0x53e8a7={'qHWMr':'GET'},_0x327ad4=getApiBaseUrl();try{const _0x310d7e=await fetch(_0x327ad4+_0x348109(0x1e3),{'method':_0x53e8a7[_0x348109(0x1e1)],'headers':{'workos-token':_0x1f7b5d}});if(_0x310d7e['ok'])return _0x310d7e[_0x348109(0x1d4)]();}catch{}return null;}function buildKeyName(_0x2f6e31,_0x3c136e){const _0x1d1a0f=_0x37ffa5,_0x41758d={'rUMee':function(_0x25954c,_0x21abb0){return _0x25954c===_0x21abb0;}},_0x3fef5d=_0x3c136e['filter'](_0x440b30=>_0x440b30[_0x1d1a0f(0x1cb)]===_0x2f6e31||_0x440b30[_0x1d1a0f(0x1cb)]['startsWith'](_0x2f6e31+'\x20('));if(_0x41758d[_0x1d1a0f(0x1e6)](_0x3fef5d['length'],0x0))return _0x2f6e31;return _0x2f6e31+'\x20('+(_0x3fef5d['length']+0x1)+')';}export async function provisionApiKey(_0x40bd5f){const _0x3f2a7b=_0x37ffa5,_0x4c0a19={'CvXMM':function(_0xbab9ba){return _0xbab9ba();},'IEUpI':_0x3f2a7b(0x1b8),'enVNZ':function(_0xabc4ab,_0x2c779f){return _0xabc4ab(_0x2c779f);},'ytYps':function(_0x1f6690,_0x1efa98,_0x22ebd8){return _0x1f6690(_0x1efa98,_0x22ebd8);},'uBpMh':_0x3f2a7b(0x1c9)},_0x18d6b7=_0x4c0a19['CvXMM'](getApiBaseUrl),_0x1a711b={'Content-Type':_0x4c0a19['IEUpI'],'workos-token':_0x40bd5f},_0x520711=await _0x4c0a19[_0x3f2a7b(0x1ca)](fetchUserProfile,_0x40bd5f),_0x4ca189=_0x520711?.[_0x3f2a7b(0x1cc)]||_0x520711?.[_0x3f2a7b(0x190)]?.['split']('@')[0x0],_0x4fdf29=_0x4ca189?_0x4ca189+_0x3f2a7b(0x1ad):'CLI\x20Key';let _0x3ca531=[];try{const _0x4d07ac=await _0x4c0a19[_0x3f2a7b(0x1b6)](fetch,_0x18d6b7+'/api-keys',{'method':'GET','headers':_0x1a711b});if(_0x4d07ac['ok']){const _0x35afcd=await _0x4d07ac['json']();_0x3ca531=_0x35afcd[_0x3f2a7b(0x1ce)];}}catch{}const _0x509d88=buildKeyName(_0x4fdf29,_0x3ca531),_0x55380d=await _0x4c0a19[_0x3f2a7b(0x1b6)](fetch,_0x18d6b7+'/api-keys',{'method':_0x4c0a19[_0x3f2a7b(0x1a0)],'headers':_0x1a711b,'body':JSON['stringify']({'name':_0x509d88,'scope':_0x3f2a7b(0x1c5)})});if(!_0x55380d['ok']){const _0x366443=await _0x55380d['text']();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0x55380d['status']+'\x20'+_0x366443);}const _0x155bbe=await _0x55380d['json']();return _0x155bbe[_0x3f2a7b(0x1e8)]['token'];}export function openBrowser(_0x2ec5cc){const _0xc5a93b=_0x37ffa5,_0x54ed7d={'bKZmq':_0xc5a93b(0x1a4),'RMGWL':_0xc5a93b(0x1e7),'sldgn':'open'};try{if(process[_0xc5a93b(0x1a2)]==='win32'){const _0x394f1f=spawn(_0xc5a93b(0x194),['/c',_0x54ed7d[_0xc5a93b(0x1d1)],'',_0x2ec5cc],{'detached':!![],'stdio':_0xc5a93b(0x198),'windowsHide':!![]});_0x394f1f[_0xc5a93b(0x1d5)]();return;}const _0x3d6667=process[_0xc5a93b(0x1a2)]===_0x54ed7d[_0xc5a93b(0x1a5)]?_0x54ed7d[_0xc5a93b(0x1d2)]:'xdg-open',_0x2d89d1=spawn(_0x3d6667,[_0x2ec5cc],{'detached':!![],'stdio':'ignore'});_0x2d89d1[_0xc5a93b(0x1d5)]();}catch{}}function _0x33c4(){const _0x22197c=['list','cmd','error','hNYHH','xsGwo','ignore','Digzj','Using\x20organization:\x20','slow_down','/cli-auth/token','now','/organization/self-serve-signup','JXWTs','uBpMh','pLFPd','platform','CXwDH','start','RMGWL','zXwgb','7tpbzqa','\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','WKCmR','org_id','\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...','1295172OVUQbC','\x27s\x20CLI\x20Key','607345VYgXJc','4Qukfvr','17233QwpoKE','XYxRU','length','isTTY','bWZBs','Failed\x20to\x20create\x20organization:\x20','ytYps','user_code','application/json','EQmXS','organizationId','fLAxg','42MreXre','Invalid\x20JWT\x20format','KTyjq','https://api.workos.com/user_management/authenticate','Select\x20an\x20organization:','write','Code:\x20','/organization/my-memberships','82269iulxzn','mcp:write','4077180anzNtC','stdout','Failed\x20to\x20provision\x20CLI\x20token:\x20','POST','enVNZ','name','firstName','2278430CdJIKf','apiKeys','mHDPN','split','bKZmq','sldgn','MPmpg','json','unref','490xckXqp','Setting\x20up\x20your\x20organization...','Failed\x20to\x20refresh\x20token\x20with\x20org:\x20','toString','device_code','Waiting\x20for\x20authentication...','wdTlp','3752344MKNQzx','map','log','access_token','qHWMr','ufVge','/organization/me','base64url','text','rUMee','darwin','apiKey','application/x-www-form-urlencoded','email','status','token'];_0x33c4=function(){return _0x22197c;};return _0x33c4();}function decodeJwtPayload(_0x48c130){const _0xdfefd2=_0x37ffa5,_0x3396fe={'TRJzQ':_0xdfefd2(0x1bd),'xsGwo':_0xdfefd2(0x1e4),'cqQBv':'utf-8'},_0x559f11=_0x48c130[_0xdfefd2(0x1d0)]('.');if(_0x559f11[_0xdfefd2(0x1b2)]!==0x3)throw new Error(_0x3396fe['TRJzQ']);const _0x1e3420=Buffer['from'](_0x559f11[0x1],_0x3396fe[_0xdfefd2(0x197)])[_0xdfefd2(0x1d9)](_0x3396fe['cqQBv']);return JSON['parse'](_0x1e3420);}function _0x3966(_0x26be31,_0x54253e){_0x26be31=_0x26be31-0x18f;const _0x33c4e5=_0x33c4();let _0x396611=_0x33c4e5[_0x26be31];return _0x396611;}async function selfServeSignup(_0x249204){const _0x2ce64b=_0x37ffa5,_0x26dadc={'fLAxg':'POST'},_0x34da7e=getApiBaseUrl(),_0x1cf316=await fetch(_0x34da7e+_0x2ce64b(0x19e),{'method':_0x26dadc[_0x2ce64b(0x1bb)],'headers':{'Content-Type':_0x2ce64b(0x1b8),'workos-token':_0x249204}});if(!_0x1cf316['ok']){const _0x1a4bac=await _0x1cf316[_0x2ce64b(0x1e5)]();throw new Error(_0x2ce64b(0x1b5)+_0x1cf316['status']+'\x20'+_0x1a4bac);}return _0x1cf316[_0x2ce64b(0x1d4)]();}async function fetchMyMemberships(_0x2efb6a){const _0x110eee=_0x37ffa5,_0x4f9b1a={'MDWdA':function(_0x586317,_0x2ce2d3,_0x1f2da2){return _0x586317(_0x2ce2d3,_0x1f2da2);},'wdTlp':'GET'},_0x2dbd10=getApiBaseUrl(),_0x4b1645=await _0x4f9b1a['MDWdA'](fetch,_0x2dbd10+_0x110eee(0x1c3),{'method':_0x4f9b1a[_0x110eee(0x1dc)],'headers':{'workos-token':_0x2efb6a}});if(!_0x4b1645['ok']){const _0x41621c=await _0x4b1645['text']();throw new Error('Failed\x20to\x20fetch\x20memberships:\x20'+_0x4b1645[_0x110eee(0x191)]+'\x20'+_0x41621c);}const _0x242778=await _0x4b1645['json']();return _0x242778['memberships'];}async function refreshTokenWithOrg(_0x2511f3,_0x477826,_0x272c7f){const _0x35e7bb=_0x37ffa5,_0x30296b={'TCvWL':function(_0x146c95,_0xdb4a83,_0x8ebfdd){return _0x146c95(_0xdb4a83,_0x8ebfdd);},'zXwgb':_0x35e7bb(0x1c9)},_0xf7286a=await _0x30296b['TCvWL'](fetch,WORKOS_TOKEN_URL,{'method':_0x30296b[_0x35e7bb(0x1a6)],'headers':{'Content-Type':_0x35e7bb(0x18f)},'body':new URLSearchParams({'client_id':_0x2511f3,'grant_type':'refresh_token','refresh_token':_0x477826,'organization_id':_0x272c7f})});if(!_0xf7286a['ok']){const _0x432b7b=await _0xf7286a['text']();throw new Error(_0x35e7bb(0x1d8)+_0xf7286a[_0x35e7bb(0x191)]+'\x20'+_0x432b7b);}return _0xf7286a['json']();}async function provisionCliToken(_0x37d435){const _0xd74130=_0x37ffa5,_0x1243ef={'bWZBs':function(_0x1bed05,_0x2d4e3d,_0x6389ac){return _0x1bed05(_0x2d4e3d,_0x6389ac);},'pLFPd':_0xd74130(0x1c9)},_0x637fa9=getApiBaseUrl(),_0x1ae829=await _0x1243ef[_0xd74130(0x1b4)](fetch,_0x637fa9+_0xd74130(0x19c),{'method':_0x1243ef[_0xd74130(0x1a1)],'headers':{'Content-Type':_0xd74130(0x1b8),'workos-token':_0x37d435}});if(!_0x1ae829['ok']){const _0x19b4bc=await _0x1ae829['text']();throw new Error(_0xd74130(0x1c8)+_0x1ae829[_0xd74130(0x191)]+'\x20'+_0x19b4bc);}return _0x1ae829['json']();}export async function runDeviceAuthFlow(){const _0x452587=_0x37ffa5,_0x35de7c={'XYxRU':function(_0x4fdf44,_0x751ad5){return _0x4fdf44(_0x751ad5);},'EQmXS':_0x452587(0x1ab),'Digzj':_0x452587(0x1a8),'MPmpg':function(_0x2851d9,_0x76689d){return _0x2851d9===_0x76689d;},'ufVge':_0x452587(0x1d7),'GsSJg':'Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','STROv':_0x452587(0x193),'WKCmR':'Provisioning\x20CLI\x20token...'},_0x4bf7ab=getCurrentEnvironment(),_0x565060=ENVIRONMENT_CONFIGS[_0x4bf7ab]['workosClientId'],_0x4f7277=await _0x35de7c[_0x452587(0x1b1)](requestDeviceCode,_0x565060);console['log'](_0x35de7c[_0x452587(0x1b9)]),console['log'](_0x35de7c[_0x452587(0x199)]),openBrowser(_0x4f7277['verification_uri_complete']),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x4f7277['verification_uri_complete']),console['log'](_0x452587(0x1c2)+_0x4f7277[_0x452587(0x1b7)]+'\x0a'),process[_0x452587(0x1c7)]['write'](_0x452587(0x1db));let _0x1d0e21=await pollForTokens(_0x565060,_0x4f7277[_0x452587(0x1da)],_0x4f7277['interval'],_0x4f7277['expires_in']);console['log']('\x20✓');const _0x40ae23=_0x35de7c[_0x452587(0x1b1)](decodeJwtPayload,_0x1d0e21[_0x452587(0x1e0)]);if(!_0x40ae23[_0x452587(0x1aa)]){const _0x3e159d=await fetchMyMemberships(_0x1d0e21['access_token']);let _0x50f4ef;if(_0x35de7c[_0x452587(0x1d3)](_0x3e159d['length'],0x0)){process[_0x452587(0x1c7)][_0x452587(0x1c1)](_0x35de7c[_0x452587(0x1e2)]);const _0x2a3919=await _0x35de7c[_0x452587(0x1b1)](selfServeSignup,_0x1d0e21['access_token']);_0x50f4ef=_0x2a3919['organizationId'],console[_0x452587(0x1df)]('\x20✓');}else{if(_0x3e159d[_0x452587(0x1b2)]===0x1)_0x50f4ef=_0x3e159d[0x0][_0x452587(0x1ba)],console[_0x452587(0x1df)](_0x452587(0x19a)+_0x3e159d[0x0]['name']);else{const _0xa0440d=process['stdin'][_0x452587(0x1b3)]&&process['stdout']['isTTY'];if(!_0xa0440d)throw new Error('Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a'+_0x35de7c['GsSJg']);const {selected:_0x43c907}=await _0x4a770f['prompt']([{'type':_0x35de7c['STROv'],'name':'selected','message':_0x452587(0x1c0),'choices':_0x3e159d[_0x452587(0x1de)](_0x4b11a3=>({'name':_0x4b11a3[_0x452587(0x1cb)],'value':_0x4b11a3['organizationId']}))}]);_0x50f4ef=_0x43c907;}}_0x1d0e21=await refreshTokenWithOrg(_0x565060,_0x1d0e21['refresh_token'],_0x50f4ef);}process[_0x452587(0x1c7)][_0x452587(0x1c1)](_0x35de7c[_0x452587(0x1a9)]);const _0x18832=await provisionCliToken(_0x1d0e21[_0x452587(0x1e0)]);return console['log']('\x20✓'),await _0x35de7c['XYxRU'](storeToken,_0x18832[_0x452587(0x192)]),_0x1d0e21['refresh_token']&&await storeRefreshToken(_0x1d0e21['refresh_token']),_0x18832[_0x452587(0x192)];}function sleep(_0xcb4b86){return new Promise(_0x4a516c=>setTimeout(_0x4a516c,_0xcb4b86));}
|
|
1
|
+
(function(_0x25dae4,_0x13b159){const _0x4ec695=_0x5e0a,_0x4a5933=_0x25dae4();while(!![]){try{const _0x168fe5=parseInt(_0x4ec695(0x1f9))/0x1+-parseInt(_0x4ec695(0x1ef))/0x2*(parseInt(_0x4ec695(0x1f7))/0x3)+-parseInt(_0x4ec695(0x1de))/0x4+-parseInt(_0x4ec695(0x1e2))/0x5+parseInt(_0x4ec695(0x1ce))/0x6+-parseInt(_0x4ec695(0x1e6))/0x7+parseInt(_0x4ec695(0x1d8))/0x8;if(_0x168fe5===_0x13b159)break;else _0x4a5933['push'](_0x4a5933['shift']());}catch(_0x51c53f){_0x4a5933['push'](_0x4a5933['shift']());}}}(_0x493e,0x2a9e0));import{spawn}from'child_process';import _0x7b549e from'inquirer';import{getCurrentEnvironment,ENVIRONMENT_CONFIGS,getApiBaseUrl}from'./environment.js';import{storeToken,storeRefreshToken}from'./keychain.js';const WORKOS_DEVICE_AUTH_URL='https://api.workos.com/user_management/authorize/device',WORKOS_TOKEN_URL='https://api.workos.com/user_management/authenticate';export async function requestDeviceCode(_0x6daf20){const _0x1582fd=_0x5e0a,_0x5f079b={'wvThe':function(_0x2d4daa,_0x3a212c,_0xb5fd01){return _0x2d4daa(_0x3a212c,_0xb5fd01);},'nAgMI':_0x1582fd(0x1b9)},_0x1e4c19=await _0x5f079b[_0x1582fd(0x1bc)](fetch,WORKOS_DEVICE_AUTH_URL,{'method':_0x5f079b['nAgMI'],'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':new URLSearchParams({'client_id':_0x6daf20})});if(!_0x1e4c19['ok']){const _0x345a4f=await _0x1e4c19[_0x1582fd(0x1d5)]();throw new Error(_0x1582fd(0x1ea)+_0x1e4c19['status']+'\x20'+_0x345a4f);}return _0x1e4c19[_0x1582fd(0x1dc)]();}export async function pollForTokens(_0x252493,_0x4e8398,_0x132dbd,_0x166a29){const _0x497387=_0x5e0a,_0x4e92e2={'vmzSi':function(_0x569cd2,_0x1e5a34){return _0x569cd2+_0x1e5a34;},'RKSpg':function(_0x21a0a6,_0x2fa36a){return _0x21a0a6(_0x2fa36a);},'mpiOZ':function(_0x54d170,_0x517b6d,_0x245e71){return _0x54d170(_0x517b6d,_0x245e71);},'shpqG':'application/x-www-form-urlencoded','zcwRy':'authorization_pending','hHxqj':'slow_down','Oytky':'Device\x20authorization\x20timed\x20out'},_0x2447bb=_0x4e92e2['vmzSi'](Date[_0x497387(0x1d0)](),_0x166a29*0x3e8);let _0x28e1df=_0x132dbd*0x3e8;while(Date[_0x497387(0x1d0)]()<_0x2447bb){await _0x4e92e2['RKSpg'](sleep,_0x28e1df);const _0x14dbab=await _0x4e92e2[_0x497387(0x1f2)](fetch,WORKOS_TOKEN_URL,{'method':_0x497387(0x1b9),'headers':{'Content-Type':_0x4e92e2[_0x497387(0x1ff)]},'body':new URLSearchParams({'client_id':_0x252493,'device_code':_0x4e8398,'grant_type':'urn:ietf:params:oauth:grant-type:device_code'})});if(_0x14dbab['ok'])return _0x14dbab['json']();const _0x577f01=await _0x14dbab['json']();if(_0x577f01[_0x497387(0x1d6)]===_0x4e92e2[_0x497387(0x1d4)])continue;if(_0x577f01['error']===_0x4e92e2['hHxqj']){_0x28e1df+=0x3e8;continue;}throw new Error(_0x577f01['error_description']||_0x577f01[_0x497387(0x1d6)]||_0x497387(0x1d3));}throw new Error(_0x4e92e2['Oytky']);}async function fetchUserProfile(_0x318e3c){const _0x1d41b2=_0x5e0a,_0x2930f8={'qlZxu':function(_0x51a20c,_0x1e3fde,_0x402a8a){return _0x51a20c(_0x1e3fde,_0x402a8a);},'UxHwE':'GET'},_0x38fd45=getApiBaseUrl();try{const _0x26f500=await _0x2930f8['qlZxu'](fetch,_0x38fd45+'/organization/me',{'method':_0x2930f8[_0x1d41b2(0x1ee)],'headers':{'workos-token':_0x318e3c}});if(_0x26f500['ok'])return _0x26f500['json']();}catch{}return null;}function buildKeyName(_0x296cd6,_0x4e2aa0){const _0x2de58b=_0x5e0a,_0x5c6d36={'DjEoR':function(_0x1a56fb,_0x59ec7e){return _0x1a56fb===_0x59ec7e;},'XhXPz':function(_0x392dc2,_0x1466ae){return _0x392dc2+_0x1466ae;}},_0x5d17d5=_0x4e2aa0[_0x2de58b(0x1e0)](_0x2fa4b4=>_0x2fa4b4[_0x2de58b(0x1d1)]===_0x296cd6||_0x2fa4b4['name'][_0x2de58b(0x1bd)](_0x296cd6+'\x20('));if(_0x5c6d36['DjEoR'](_0x5d17d5['length'],0x0))return _0x296cd6;return _0x296cd6+'\x20('+_0x5c6d36[_0x2de58b(0x1f3)](_0x5d17d5['length'],0x1)+')';}function _0x493e(){const _0x118a03=['access_token','POST','GGBwT','Setting\x20up\x20your\x20organization...','wvThe','startsWith','interval','idLmb','\x27s\x20CLI\x20Key','platform','length','XilAv','firstName','LjPnd','parse','SLdvg','unref','wcUie','xdg-open','PwHlJ','split','EXJFE','1734072OAmJye','organizationId','now','name','Failed\x20to\x20provision\x20CLI\x20token:\x20','Authentication\x20failed','zcwRy','text','error','GET','3377992GZznhg','write','token','xYhDF','json','stringify','1053712BorzsK','rEiox','filter','Multiple\x20organizations\x20available\x20but\x20cannot\x20prompt\x20for\x20selection\x20in\x20non-interactive\x20mode.\x0a','345480OWMUpJ','selected','qJfgr','YNiDw','1105279sBiMfM','email','ignore','win32','Failed\x20to\x20request\x20device\x20code:\x20','start','verification_uri_complete','status','UxHwE','2HZQPTk','refresh_token','user_code','mpiOZ','XhXPz','YjepH','kjwdW','TmoPc','1028703ohzNjb','toString','296621AlpwLn','application/x-www-form-urlencoded','org_id','Using\x20organization:\x20','expires_in','utf-8','shpqG','Select\x20an\x20organization:','darwin','stdin','log','stdout','Use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','UiOvy','application/json','Failed\x20to\x20create\x20organization:\x20'];_0x493e=function(){return _0x118a03;};return _0x493e();}export async function provisionApiKey(_0x419b41){const _0x313afb=_0x5e0a,_0x496f06={'PWWBN':function(_0x5a1302){return _0x5a1302();},'UiOvy':function(_0x5a2188,_0x57a581){return _0x5a2188(_0x57a581);},'kjwdW':function(_0x3fcc67,_0x41951e,_0x1a9b94){return _0x3fcc67(_0x41951e,_0x1a9b94);},'XGmWq':_0x313afb(0x1b9)},_0x11a0a1=_0x496f06['PWWBN'](getApiBaseUrl),_0x399813={'Content-Type':_0x313afb(0x207),'workos-token':_0x419b41},_0x281ff0=await _0x496f06[_0x313afb(0x206)](fetchUserProfile,_0x419b41),_0x40d3d7=_0x281ff0?.[_0x313afb(0x1c4)]||_0x281ff0?.[_0x313afb(0x1e7)]?.[_0x313afb(0x1cc)]('@')[0x0],_0x113439=_0x40d3d7?_0x40d3d7+_0x313afb(0x1c0):'CLI\x20Key';let _0x11bd6f=[];try{const _0x30ef42=await fetch(_0x11a0a1+'/api-keys',{'method':_0x313afb(0x1d7),'headers':_0x399813});if(_0x30ef42['ok']){const _0x147c99=await _0x30ef42['json']();_0x11bd6f=_0x147c99['apiKeys'];}}catch{}const _0x1a067d=_0x496f06[_0x313afb(0x1f5)](buildKeyName,_0x113439,_0x11bd6f),_0x407a78=await _0x496f06[_0x313afb(0x1f5)](fetch,_0x11a0a1+'/api-keys',{'method':_0x496f06['XGmWq'],'headers':_0x399813,'body':JSON[_0x313afb(0x1dd)]({'name':_0x1a067d,'scope':'mcp:write'})});if(!_0x407a78['ok']){const _0x572f35=await _0x407a78[_0x313afb(0x1d5)]();throw new Error('Failed\x20to\x20provision\x20API\x20key:\x20'+_0x407a78['status']+'\x20'+_0x572f35);}const _0x250d7f=await _0x407a78[_0x313afb(0x1dc)]();return _0x250d7f['apiKey'][_0x313afb(0x1da)];}export function openBrowser(_0x35f322){const _0x2b6cae=_0x5e0a,_0x5af41a={'PwHlJ':function(_0x36b49f,_0x2d8625){return _0x36b49f===_0x2d8625;},'wkOfH':_0x2b6cae(0x1e9),'RHGme':function(_0x4e7fa4,_0x46c06b,_0x4c98f6,_0x3411dd){return _0x4e7fa4(_0x46c06b,_0x4c98f6,_0x3411dd);},'YNiDw':'cmd','TzhvA':_0x2b6cae(0x1eb),'idLmb':'open','rEiox':function(_0x5c261d,_0x5a193a,_0x11cdde,_0x40fd87){return _0x5c261d(_0x5a193a,_0x11cdde,_0x40fd87);}};try{if(_0x5af41a[_0x2b6cae(0x1cb)](process[_0x2b6cae(0x1c1)],_0x5af41a['wkOfH'])){const _0x5b3f11=_0x5af41a['RHGme'](spawn,_0x5af41a[_0x2b6cae(0x1e5)],['/c',_0x5af41a['TzhvA'],'',_0x35f322],{'detached':!![],'stdio':_0x2b6cae(0x1e8),'windowsHide':!![]});_0x5b3f11[_0x2b6cae(0x1c8)]();return;}const _0x4d1486=process['platform']===_0x2b6cae(0x201)?_0x5af41a[_0x2b6cae(0x1bf)]:_0x2b6cae(0x1ca),_0x46d3c3=_0x5af41a[_0x2b6cae(0x1df)](spawn,_0x4d1486,[_0x35f322],{'detached':!![],'stdio':_0x2b6cae(0x1e8)});_0x46d3c3['unref']();}catch{}}function decodeJwtPayload(_0x586e55){const _0x5a3a5b=_0x5e0a,_0x554566={'AvYht':'base64url'},_0x2b9e14=_0x586e55[_0x5a3a5b(0x1cc)]('.');if(_0x2b9e14[_0x5a3a5b(0x1c2)]!==0x3)throw new Error('Invalid\x20JWT\x20format');const _0x34c69d=Buffer['from'](_0x2b9e14[0x1],_0x554566['AvYht'])[_0x5a3a5b(0x1f8)](_0x5a3a5b(0x1fe));return JSON[_0x5a3a5b(0x1c6)](_0x34c69d);}async function selfServeSignup(_0x40b672){const _0x243e14=_0x5e0a,_0x512247={'TmoPc':function(_0x1a45e4,_0x40c530,_0x170548){return _0x1a45e4(_0x40c530,_0x170548);}},_0x1edafc=getApiBaseUrl(),_0x4fae78=await _0x512247[_0x243e14(0x1f6)](fetch,_0x1edafc+'/organization/self-serve-signup',{'method':'POST','headers':{'Content-Type':_0x243e14(0x207),'workos-token':_0x40b672}});if(!_0x4fae78['ok']){const _0x323a2b=await _0x4fae78[_0x243e14(0x1d5)]();throw new Error(_0x243e14(0x1b7)+_0x4fae78[_0x243e14(0x1ed)]+'\x20'+_0x323a2b);}return _0x4fae78[_0x243e14(0x1dc)]();}async function fetchMyMemberships(_0x198f8a){const _0x467531=_0x5e0a,_0x41d5e0={'tlFNG':function(_0x1acc37){return _0x1acc37();},'BNGAi':function(_0x2a3787,_0x21f8f5,_0x4b347f){return _0x2a3787(_0x21f8f5,_0x4b347f);},'vQhyr':_0x467531(0x1d7)},_0x2b37f2=_0x41d5e0['tlFNG'](getApiBaseUrl),_0xbc868a=await _0x41d5e0['BNGAi'](fetch,_0x2b37f2+'/organization/my-memberships',{'method':_0x41d5e0['vQhyr'],'headers':{'workos-token':_0x198f8a}});if(!_0xbc868a['ok']){const _0x413ded=await _0xbc868a['text']();throw new Error('Failed\x20to\x20fetch\x20memberships:\x20'+_0xbc868a['status']+'\x20'+_0x413ded);}const _0x153619=await _0xbc868a[_0x467531(0x1dc)]();return _0x153619['memberships'];}function _0x5e0a(_0x5e347e,_0x5c7646){_0x5e347e=_0x5e347e-0x1b7;const _0x493ec0=_0x493e();let _0x5e0ac6=_0x493ec0[_0x5e347e];return _0x5e0ac6;}async function refreshTokenWithOrg(_0x30b3fa,_0x1bd092,_0x37a0e6){const _0x2ec6e7=_0x5e0a,_0x598337={'YLxez':function(_0x184091,_0x9aabcf,_0x53dea5){return _0x184091(_0x9aabcf,_0x53dea5);}},_0x53efbc=await _0x598337['YLxez'](fetch,WORKOS_TOKEN_URL,{'method':_0x2ec6e7(0x1b9),'headers':{'Content-Type':_0x2ec6e7(0x1fa)},'body':new URLSearchParams({'client_id':_0x30b3fa,'grant_type':'refresh_token','refresh_token':_0x1bd092,'organization_id':_0x37a0e6})});if(!_0x53efbc['ok']){const _0xe101eb=await _0x53efbc['text']();throw new Error('Failed\x20to\x20refresh\x20token\x20with\x20org:\x20'+_0x53efbc['status']+'\x20'+_0xe101eb);}return _0x53efbc[_0x2ec6e7(0x1dc)]();}async function provisionCliToken(_0xa732e2){const _0x3c7276=_0x5e0a,_0x48a7ba=getApiBaseUrl(),_0x302693=await fetch(_0x48a7ba+'/cli-auth/token',{'method':'POST','headers':{'Content-Type':'application/json','workos-token':_0xa732e2}});if(!_0x302693['ok']){const _0x425127=await _0x302693['text']();throw new Error(_0x3c7276(0x1d2)+_0x302693[_0x3c7276(0x1ed)]+'\x20'+_0x425127);}return _0x302693[_0x3c7276(0x1dc)]();}export async function runDeviceAuthFlow(){const _0x563772=_0x5e0a,_0x1d8331={'EXJFE':function(_0x50941d){return _0x50941d();},'LjPnd':function(_0x325b85,_0x318ee5){return _0x325b85(_0x318ee5);},'qJfgr':'\x20\x20\x20A\x20human\x20needs\x20to\x20complete\x20authentication\x20in\x20the\x20browser.\x0a','ENJYC':function(_0x595fad,_0x98b2f2,_0x22c172,_0x1c4c6e,_0x2a1be5){return _0x595fad(_0x98b2f2,_0x22c172,_0x1c4c6e,_0x2a1be5);},'CbpDf':_0x563772(0x1bb),'wohDg':function(_0x9cb27d,_0x263cf3){return _0x9cb27d(_0x263cf3);},'CMcvn':function(_0x11d7ad,_0x3e8eaf){return _0x11d7ad===_0x3e8eaf;},'GGBwT':function(_0x55c0e6,_0x324b75){return _0x55c0e6+_0x324b75;},'wcUie':_0x563772(0x1e1),'YjepH':_0x563772(0x205),'SLdvg':function(_0x122f74,_0x444002,_0x1b83e2,_0x59076f){return _0x122f74(_0x444002,_0x1b83e2,_0x59076f);},'xYhDF':'Provisioning\x20CLI\x20token...','vinzQ':function(_0x276030,_0x49f1db){return _0x276030(_0x49f1db);},'XilAv':function(_0x430390,_0x56d2b3){return _0x430390(_0x56d2b3);}},_0x46d785=_0x1d8331[_0x563772(0x1cd)](getCurrentEnvironment),_0x55b948=ENVIRONMENT_CONFIGS[_0x46d785]['workosClientId'],_0x23cf06=await _0x1d8331[_0x563772(0x1c5)](requestDeviceCode,_0x55b948);console[_0x563772(0x203)]('\x0a🔐\x20Opening\x20browser\x20to\x20log\x20in...'),console[_0x563772(0x203)](_0x1d8331[_0x563772(0x1e4)]),openBrowser(_0x23cf06['verification_uri_complete']),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x20'+_0x23cf06[_0x563772(0x1ec)]),console[_0x563772(0x203)]('Code:\x20'+_0x23cf06[_0x563772(0x1f1)]+'\x0a'),process['stdout'][_0x563772(0x1d9)]('Waiting\x20for\x20authentication...');let _0x46a50d=await _0x1d8331['ENJYC'](pollForTokens,_0x55b948,_0x23cf06['device_code'],_0x23cf06[_0x563772(0x1be)],_0x23cf06[_0x563772(0x1fd)]);console['log']('\x20✓');const _0xba42a2=decodeJwtPayload(_0x46a50d[_0x563772(0x1b8)]);if(!_0xba42a2[_0x563772(0x1fb)]){const _0x450d40=await fetchMyMemberships(_0x46a50d[_0x563772(0x1b8)]);let _0x133809;if(_0x450d40[_0x563772(0x1c2)]===0x0){process[_0x563772(0x204)]['write'](_0x1d8331['CbpDf']);const _0x484dbf=await _0x1d8331['wohDg'](selfServeSignup,_0x46a50d[_0x563772(0x1b8)]);_0x133809=_0x484dbf['organizationId'],console['log']('\x20✓');}else{if(_0x1d8331['CMcvn'](_0x450d40[_0x563772(0x1c2)],0x1))_0x133809=_0x450d40[0x0]['organizationId'],console[_0x563772(0x203)](_0x563772(0x1fc)+_0x450d40[0x0][_0x563772(0x1d1)]);else{const _0x1fce13=process[_0x563772(0x202)]['isTTY']&&process[_0x563772(0x204)]['isTTY'];if(!_0x1fce13)throw new Error(_0x1d8331[_0x563772(0x1ba)](_0x1d8331[_0x563772(0x1c9)],_0x1d8331[_0x563772(0x1f4)]));const {selected:_0x584286}=await _0x7b549e['prompt']([{'type':'list','name':_0x563772(0x1e3),'message':_0x563772(0x200),'choices':_0x450d40['map'](_0x836424=>({'name':_0x836424[_0x563772(0x1d1)],'value':_0x836424[_0x563772(0x1cf)]}))}]);_0x133809=_0x584286;}}_0x46a50d=await _0x1d8331[_0x563772(0x1c7)](refreshTokenWithOrg,_0x55b948,_0x46a50d[_0x563772(0x1f0)],_0x133809);}process['stdout']['write'](_0x1d8331[_0x563772(0x1db)]);const _0x4ce0ed=await _0x1d8331['vinzQ'](provisionCliToken,_0x46a50d[_0x563772(0x1b8)]);return console[_0x563772(0x203)]('\x20✓'),await _0x1d8331[_0x563772(0x1c3)](storeToken,_0x4ce0ed[_0x563772(0x1da)]),_0x46a50d['refresh_token']&&await _0x1d8331[_0x563772(0x1c5)](storeRefreshToken,_0x46a50d[_0x563772(0x1f0)]),_0x4ce0ed[_0x563772(0x1da)];}function sleep(_0x4fa4cb){return new Promise(_0x53d570=>setTimeout(_0x53d570,_0x4fa4cb));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x43e2b0=_0x3089;(function(_0x3ddbb7,_0x3f2ab3){const _0x5696d6=_0x3089,_0xc6c2ad=_0x3ddbb7();while(!![]){try{const _0x1f27e1=-parseInt(_0x5696d6(0x122))/0x1*(parseInt(_0x5696d6(0xff))/0x2)+parseInt(_0x5696d6(0x108))/0x3+parseInt(_0x5696d6(0x115))/0x4*(parseInt(_0x5696d6(0x10a))/0x5)+-parseInt(_0x5696d6(0x118))/0x6*(-parseInt(_0x5696d6(0x10c))/0x7)+parseInt(_0x5696d6(0x112))/0x8+parseInt(_0x5696d6(0x103))/0x9+parseInt(_0x5696d6(0x114))/0xa*(-parseInt(_0x5696d6(0x109))/0xb);if(_0x1f27e1===_0x3f2ab3)break;else _0xc6c2ad['push'](_0xc6c2ad['shift']());}catch(_0x423353){_0xc6c2ad['push'](_0xc6c2ad['shift']());}}}(_0x1247,0x47aa9));export const ENVIRONMENT_CONFIGS={'prod':{'apiBaseUrl':'https://api.ranger.net','workosClientId':_0x43e2b0(0x120),'aiProxyUrl':_0x43e2b0(0x11f),'mcpAuthUrl':_0x43e2b0(0x102)},'staging':{'apiBaseUrl':_0x43e2b0(0x11d),'workosClientId':_0x43e2b0(0x11c),'aiProxyUrl':_0x43e2b0(0x11a),'mcpAuthUrl':_0x43e2b0(0x110)},'local':{'apiBaseUrl':'http://localhost:8080','workosClientId':'client_01J9CBYM2DKWV9HM17D95Z540K','aiProxyUrl':_0x43e2b0(0x11b),'mcpAuthUrl':'http://localhost:8080/mcp'}};export const DEFAULT_ENVIRONMENT='prod';function _0x1247(){const _0x497fbf=['http://localhost:8090','client_01J9CBYM2DKWV9HM17D95Z540K','https://api.staging.ranger.net','LSFQi','https://ai-proxy-716115358910.us-central1.run.app','client_01J9CBYM7M5ZETCF7G6614DXR2','find','133660ImibaE','YatjD','playwright-cli','4yWVJCa','ekcGU','LNAoN','https://mcp-auth.ranger.net/mcp','1064997lJJcLt','trim','RANGER_MCP_AUTH_URL','mcp','env','1266807WskNca','2331890FsLFMP','5caQDhy','Wudtw','189021IyAGuT','RANGER_CLI_ENV','RANGER_USE_NOVA_ACT','\x22.\x20Expected\x20one\x20of:\x20mcp,\x20playwright-cli,\x20nova-act-cli.','https://mcp-auth.staging.ranger.net/mcp','Invalid\x20RANGER_TRANSPORT=\x22','3333744KyvSXu','uZmOr','50vvGPcD','2005908xCpHyU','aiProxyUrl','staging','36HNyjgX','prod','https://ai-proxy-301751771437.us-central1.run.app'];_0x1247=function(){return _0x497fbf;};return _0x1247();}export function isValidEnvironment(_0x586e4d){const _0x35a470=_0x43e2b0,_0x40d0cd={'Wudtw':function(_0x15c392,_0x4abeca){return _0x15c392===_0x4abeca;},'LNAoN':function(_0x41af71,_0x51816e){return _0x41af71===_0x51816e;},'YatjD':function(_0x3d3d39,_0x4a294d){return _0x3d3d39===_0x4a294d;},'FwqCA':'local'};return _0x40d0cd[_0x35a470(0x10b)](_0x586e4d,_0x35a470(0x119))||_0x40d0cd[_0x35a470(0x101)](_0x586e4d,_0x35a470(0x117))||_0x40d0cd[_0x35a470(0x123)](_0x586e4d,_0x40d0cd['FwqCA']);}export function getCurrentEnvironment(){const _0x2877ed=_0x43e2b0,_0x5b7c35=process[_0x2877ed(0x107)][_0x2877ed(0x10d)];if(_0x5b7c35&&isValidEnvironment(_0x5b7c35))return _0x5b7c35;return DEFAULT_ENVIRONMENT;}export function getApiBaseUrl(){const _0x223a3a={'mnArs':function(_0x4816c1){return _0x4816c1();}};return ENVIRONMENT_CONFIGS[_0x223a3a['mnArs'](getCurrentEnvironment)]['apiBaseUrl'];}export function getAiProxyUrl(){const _0x403572=_0x43e2b0;return ENVIRONMENT_CONFIGS[getCurrentEnvironment()][_0x403572(0x116)];}export function getMcpAuthUrl(){const _0x104440=_0x43e2b0;return process[_0x104440(0x107)][_0x104440(0x105)]??ENVIRONMENT_CONFIGS[getCurrentEnvironment()]['mcpAuthUrl'];}function _0x3089(_0xadee0a,_0x2936a9){_0xadee0a=_0xadee0a-0xff;const _0x124761=_0x1247();let _0x308982=_0x124761[_0xadee0a];return _0x308982;}export function isByokEnabled(){const _0x117314=_0x43e2b0,_0x5774fe={'sinRB':function(_0x429cf2,_0x3f84aa){return _0x429cf2===_0x3f84aa;},'LSFQi':'true'};return _0x5774fe['sinRB'](process['env']['RANGER_BYOK'],_0x5774fe[_0x117314(0x11e)]);}function isVerificationTransport(_0x51b672){const _0x5ef548=_0x43e2b0,_0x2ecc26={'ekcGU':function(_0x5df18f,_0xaf516b){return _0x5df18f===_0xaf516b;},'uZmOr':_0x5ef548(0x124)};return _0x2ecc26[_0x5ef548(0x100)](_0x51b672,'mcp')||_0x2ecc26['ekcGU'](_0x51b672,_0x2ecc26[_0x5ef548(0x113)])||_0x51b672==='nova-act-cli';}const LEGACY_TRANSPORT_ENV_VARS=[_0x43e2b0(0x10e),'RANGER_DISABLE_MCP'];export function getVerificationTransport(){const _0x10eca4=_0x43e2b0,_0x154d0e={'qZbzF':function(_0x33577e,_0x5f263c){return _0x33577e(_0x5f263c);}},_0x56675b=process['env']['RANGER_TRANSPORT']?.[_0x10eca4(0x104)]();if(_0x56675b){if(_0x154d0e['qZbzF'](isVerificationTransport,_0x56675b))return _0x56675b;throw new Error(_0x10eca4(0x111)+_0x56675b+_0x10eca4(0x10f));}const _0x405fe2=LEGACY_TRANSPORT_ENV_VARS[_0x10eca4(0x121)](_0xa7825b=>process[_0x10eca4(0x107)][_0xa7825b]);if(_0x405fe2)throw new Error(_0x405fe2+'\x20is\x20no\x20longer\x20supported.\x20Use\x20RANGER_TRANSPORT=mcp,\x20RANGER_TRANSPORT=playwright-cli,\x20or\x20RANGER_TRANSPORT=nova-act-cli.');return _0x10eca4(0x106);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x3a19c3,_0x4e291){const _0x1ecb33=_0x5437,_0x3df7d7=_0x3a19c3();while(!![]){try{const _0x2de7b6=parseInt(_0x1ecb33(0xc1))/0x1+parseInt(_0x1ecb33(0xbc))/0x2+-parseInt(_0x1ecb33(0xa7))/0x3+parseInt(_0x1ecb33(0x9a))/0x4*(parseInt(_0x1ecb33(0xa3))/0x5)+parseInt(_0x1ecb33(0x94))/0x6+parseInt(_0x1ecb33(0x8c))/0x7+-parseInt(_0x1ecb33(0xac))/0x8;if(_0x2de7b6===_0x4e291)break;else _0x3df7d7['push'](_0x3df7d7['shift']());}catch(_0x2de0f3){_0x3df7d7['push'](_0x3df7d7['shift']());}}}(_0x2b3a,0xe204f));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x2af939){const _0xe85363=_0x5437,_0x5f2444={'vcQTw':function(_0xc28d8b){return _0xc28d8b();},'zRRkv':function(_0x4f4f79,_0x3248ad,_0xe87588){return _0x4f4f79(_0x3248ad,_0xe87588);},'DmLGp':function(_0x896efb,_0x298024){return _0x896efb===_0x298024;}},_0x2c7f57=await _0x5f2444['vcQTw'](getToken);if(!_0x2c7f57)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x21a202=getApiBaseUrl(),_0x16b8e5=await _0x5f2444['zRRkv'](fetch,_0x21a202+_0xe85363(0xb3),{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x2c7f57,'Content-Type':'application/json'},'body':JSON['stringify'](_0x2af939)});if(!_0x16b8e5['ok']){if(_0x5f2444['DmLGp'](_0x16b8e5['status'],0x192)){const _0x8e6b4f=await _0x16b8e5['json'](),_0x4f31af=_0x8e6b4f['billingUrl']||_0xe85363(0xcb);throw new Error((_0x8e6b4f[_0xe85363(0x89)]||_0xe85363(0xa4))+_0xe85363(0xc7)+_0x4f31af);}const _0x430236=await _0x16b8e5[_0xe85363(0xae)]();throw new Error('Failed\x20to\x20create\x20feature\x20review:\x20'+_0x430236);}return _0x16b8e5['json']();}export async function listFeatures(_0x447bb6){const _0x4dda27=_0x5437,_0xc0b4b4={'EfkXK':function(_0x204b0a){return _0x204b0a();},'JGPly':'gitRepoUrl','iuJwm':'gitBranch','bzEfM':'limit','KURvp':_0x4dda27(0xaf),'JtyJU':function(_0x5b7f76,_0x84a1b9,_0x289027){return _0x5b7f76(_0x84a1b9,_0x289027);},'HfJou':'GET'},_0x274aa7=await _0xc0b4b4[_0x4dda27(0xba)](getToken);if(!_0x274aa7)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x1432f4=getApiBaseUrl(),_0x5fde0f=new URLSearchParams();if(_0x447bb6?.['gitRepoUrl'])_0x5fde0f[_0x4dda27(0xc2)](_0xc0b4b4['JGPly'],_0x447bb6[_0x4dda27(0xbd)]);if(_0x447bb6?.['gitBranch'])_0x5fde0f[_0x4dda27(0xc2)](_0xc0b4b4[_0x4dda27(0x9b)],_0x447bb6['gitBranch']);if(_0x447bb6?.['limit'])_0x5fde0f['set'](_0xc0b4b4['bzEfM'],_0x447bb6[_0x4dda27(0xb1)][_0x4dda27(0xa6)]());if(_0x447bb6?.[_0x4dda27(0xaf)])_0x5fde0f[_0x4dda27(0xc2)](_0xc0b4b4[_0x4dda27(0xbe)],_0x447bb6[_0x4dda27(0xaf)][_0x4dda27(0xa6)]());if(_0x447bb6?.[_0x4dda27(0xc5)])_0x5fde0f['set']('includeDeleted',_0x4dda27(0x86));const _0x1efa35=_0x1432f4+_0x4dda27(0xb3)+(_0x5fde0f[_0x4dda27(0xa6)]()?'?'+_0x5fde0f['toString']():''),_0x1aee3f=await _0xc0b4b4[_0x4dda27(0xc0)](fetch,_0x1efa35,{'method':_0xc0b4b4[_0x4dda27(0x92)],'headers':{'Authorization':'Bearer\x20'+_0x274aa7}});if(!_0x1aee3f['ok']){const _0xe259e7=await _0x1aee3f['text']();throw new Error('Failed\x20to\x20list\x20feature\x20reviews:\x20'+_0xe259e7);}return _0x1aee3f[_0x4dda27(0x96)]();}export async function getFeature(_0x12be5e){const _0x300f3d=_0x5437,_0x1d6b3e={'PwJQK':function(_0xdc861){return _0xdc861();},'NrSBc':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]'},_0xd0e764=await _0x1d6b3e['PwJQK'](getToken);if(!_0xd0e764)throw new Error(_0x1d6b3e[_0x300f3d(0xc8)]);const _0x42e6bf=getApiBaseUrl(),_0x4bd27f=await fetch(_0x42e6bf+'/api/v1/mcp/features/'+_0x12be5e,{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0xd0e764}});if(!_0x4bd27f['ok']){const _0x3073a5=await _0x4bd27f['text']();throw new Error(_0x300f3d(0x8f)+_0x3073a5);}return _0x4bd27f['json']();}export async function updateFeature(_0x110622,_0x5c060e){const _0x8a2bc0=_0x5437,_0x24e11a={'nFudW':function(_0x56742b){return _0x56742b();},'bqsUv':_0x8a2bc0(0xb8)},_0x584edc=await getToken();if(!_0x584edc)throw new Error(_0x8a2bc0(0x91));const _0x4eb1d4=_0x24e11a['nFudW'](getApiBaseUrl),_0x1b1b17=await fetch(_0x4eb1d4+_0x8a2bc0(0x99)+_0x110622,{'method':'PATCH','headers':{'Authorization':_0x8a2bc0(0x9f)+_0x584edc,'Content-Type':_0x24e11a[_0x8a2bc0(0x97)]},'body':JSON['stringify'](_0x5c060e)});if(!_0x1b1b17['ok']){const _0x4bd557=await _0x1b1b17[_0x8a2bc0(0xae)]();throw new Error('Failed\x20to\x20update\x20feature\x20review:\x20'+_0x4bd557);}return _0x1b1b17[_0x8a2bc0(0x96)]();}function _0x5437(_0x1e353f,_0x46ce71){_0x1e353f=_0x1e353f-0x84;const _0x2b3a6e=_0x2b3a();let _0x543741=_0x2b3a6e[_0x1e353f];return _0x543741;}function _0x2b3a(){const _0x5351a8=['/checklist/','JtyJU','1580498GCEdYY','set','Failed\x20to\x20restore\x20feature\x20review:\x20','CWUGE','includeDeleted','POST','\x0a\x0aUpgrade\x20your\x20plan:\x20','NrSBc','pqICm','/sessions/','https://dashboard.ranger.net/billing','FOhiF','Failed\x20to\x20get\x20action\x20items:\x20','true','stringify','/checklist-items/','message','IurzL','SrLVp','11094741btwocY','length','Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20','Failed\x20to\x20get\x20feature\x20review:\x20','xpYOA','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','HfJou','/restore','6000834ArTMFw','/start','json','bqsUv','Failed\x20to\x20create\x20scenario:\x20','/api/v1/mcp/features/','164OqwMcM','iuJwm','Failed\x20to\x20update\x20scenario:\x20','LvADy','Failed\x20to\x20delete\x20feature\x20review:\x20','Bearer\x20','RFTUv','esyDL','style','42945fKnXph','Feature\x20limit\x20exceeded','Failed\x20to\x20conclude\x20session:\x20','toString','2693802LGTCft','mUXfp','sessionId','Xxdrs','Failed\x20to\x20start\x20session:\x20','30190336beYdOU','lTqnV','text','offset','GET','limit','ihqon','/api/v1/mcp/features','itemIds','psoMB','/comments/address','/action-items','application/json','/feedback','EfkXK','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','2159504fILjPS','gitRepoUrl','KURvp'];_0x2b3a=function(){return _0x5351a8;};return _0x2b3a();}export async function createChecklistItem(_0x13ea32,_0x10d5cf,_0x4e0537){const _0x2fecdf=_0x5437,_0x20eafb={'ihqon':function(_0x42dbc8){return _0x42dbc8();},'syzCA':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','psoMB':function(_0x19943a){return _0x19943a();},'MHEcM':_0x2fecdf(0xb8)},_0x36c906=await _0x20eafb[_0x2fecdf(0xb2)](getToken);if(!_0x36c906)throw new Error(_0x20eafb['syzCA']);const _0x3de04b=_0x20eafb[_0x2fecdf(0xb5)](getApiBaseUrl),_0x3dcd83=await fetch(_0x3de04b+_0x2fecdf(0x99)+_0x13ea32+'/checklist',{'method':_0x2fecdf(0xc6),'headers':{'Authorization':_0x2fecdf(0x9f)+_0x36c906,'Content-Type':_0x20eafb['MHEcM']},'body':JSON['stringify']({'description':_0x10d5cf,'position':_0x4e0537})});if(!_0x3dcd83['ok']){const _0x58addb=await _0x3dcd83[_0x2fecdf(0xae)]();throw new Error(_0x2fecdf(0x98)+_0x58addb);}return _0x3dcd83['json']();}export async function updateChecklistItem(_0x5f1b1c,_0x5762ba,_0x5d7bb3){const _0x30a22b={'kxNrO':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','LZXqA':function(_0x44504a,_0x56af50,_0x1fb313){return _0x44504a(_0x56af50,_0x1fb313);},'TbSvR':function(_0xbec893,_0x55ffd5,_0x165e37){return _0xbec893(_0x55ffd5,_0x165e37);},'Rykik':'updateChecklistItem'};return _0x30a22b['TbSvR'](withRetry,async()=>{const _0x1ca29c=_0x5437,_0x5150eb=await getToken();if(!_0x5150eb)throw new Error(_0x30a22b['kxNrO']);const _0x2b7ce4=getApiBaseUrl(),_0xf98f72=await _0x30a22b['LZXqA'](fetch,_0x2b7ce4+'/api/v1/mcp/features/'+_0x5f1b1c+_0x1ca29c(0xbf)+_0x5762ba,{'method':'PATCH','headers':{'Authorization':'Bearer\x20'+_0x5150eb,'Content-Type':_0x1ca29c(0xb8)},'body':JSON[_0x1ca29c(0x87)](_0x5d7bb3)});if(!_0xf98f72['ok']){const _0x54eb34=await _0xf98f72[_0x1ca29c(0xae)]();throw new Error(_0x1ca29c(0x9c)+_0x54eb34);}return _0xf98f72[_0x1ca29c(0x96)]();},{'label':_0x30a22b['Rykik']});}export async function getFeatureReport(_0x5bdb7b){const _0x44a634=_0x5437,_0x18cd6d={'lTqnV':function(_0x4f223c){return _0x4f223c();}},_0x4cc893=await _0x18cd6d[_0x44a634(0xad)](getToken);if(!_0x4cc893)throw new Error(_0x44a634(0x91));const _0x19e796=getApiBaseUrl(),_0x29081e=await fetch(_0x19e796+_0x44a634(0x99)+_0x5bdb7b+'/report',{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x4cc893}});if(!_0x29081e['ok']){const _0x1510bb=await _0x29081e[_0x44a634(0xae)]();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report:\x20'+_0x1510bb);}return _0x29081e[_0x44a634(0x96)]();}export async function getFeatureReportMarkdown(_0x4f7a02,_0x1ec50a){const _0x23854a=_0x5437,_0xfe53ba={'FOhiF':function(_0x31be7a,_0x52914e){return _0x31be7a>_0x52914e;},'mUXfp':function(_0x5dd21f,_0x39cc6e){return _0x5dd21f(_0x39cc6e);},'GwSxi':_0x23854a(0xb4),'YwanA':_0x23854a(0xa9),'DekrN':'GET'},_0x549727=await getToken();if(!_0x549727)throw new Error(_0x23854a(0x91));const _0x16ce5c=getApiBaseUrl(),_0x481911=new URLSearchParams(),_0x49610=_0xfe53ba[_0x23854a(0x84)](_0x1ec50a?.[_0x23854a(0xb4)]?.[_0x23854a(0x8d)]??0x0,0x0),_0x47e82f=_0xfe53ba[_0x23854a(0xa8)](Boolean,_0x1ec50a?.['sessionId']);_0x49610&&_0x1ec50a?.[_0x23854a(0xb4)]&&_0x481911[_0x23854a(0xc2)](_0xfe53ba['GwSxi'],_0x1ec50a['itemIds']['join'](','));_0x47e82f&&_0x1ec50a?.['sessionId']&&_0x481911['set'](_0xfe53ba['YwanA'],_0x1ec50a['sessionId']);!_0x49610&&!_0x47e82f&&_0x1ec50a?.[_0x23854a(0xa2)]&&_0x481911['set']('style',_0x1ec50a['style']);const _0x2c7a17=_0x16ce5c+_0x23854a(0x99)+_0x4f7a02+'/report/markdown',_0xe93dae=''+_0x2c7a17+(_0x481911['toString']()?'?'+_0x481911['toString']():''),_0x4b763d=await fetch(_0xe93dae,{'method':_0xfe53ba['DekrN'],'headers':{'Authorization':'Bearer\x20'+_0x549727}});if(!_0x4b763d['ok']){const _0x16b06f=await _0x4b763d[_0x23854a(0xae)]();throw new Error(_0x23854a(0xbb)+_0x16b06f);}return _0x4b763d['text']();}export async function listFeatureSessions(_0x5561de){const _0x5159cd=_0x5437,_0x12c692={'IurzL':function(_0x490133){return _0x490133();},'xQrch':function(_0x3c004a,_0x30017c,_0x3d21ba){return _0x3c004a(_0x30017c,_0x3d21ba);},'lcLSa':'GET'},_0x1e626a=await _0x12c692[_0x5159cd(0x8a)](getToken);if(!_0x1e626a)throw new Error(_0x5159cd(0x91));const _0x5cf8a0=getApiBaseUrl(),_0x183d15=await _0x12c692['xQrch'](fetch,_0x5cf8a0+_0x5159cd(0x99)+_0x5561de+'/sessions',{'method':_0x12c692['lcLSa'],'headers':{'Authorization':'Bearer\x20'+_0x1e626a}});if(!_0x183d15['ok']){const _0x2a31c6=await _0x183d15['text']();throw new Error('Failed\x20to\x20list\x20sessions:\x20'+_0x2a31c6);}return _0x183d15[_0x5159cd(0x96)]();}export async function startSession(_0x71936c,_0x275ae2){const _0x1e0d85=_0x5437,_0x53742f={'kHwHA':function(_0x5c0579){return _0x5c0579();},'SrLVp':function(_0x38f5f4,_0x1eaadb,_0x48b5b9){return _0x38f5f4(_0x1eaadb,_0x48b5b9);}},_0x459f6b=await getToken();if(!_0x459f6b)throw new Error(_0x1e0d85(0x91));const _0x37f202=_0x53742f['kHwHA'](getApiBaseUrl),_0x4a6a1f=await _0x53742f[_0x1e0d85(0x8b)](fetch,_0x37f202+_0x1e0d85(0x99)+_0x71936c+'/sessions/'+_0x275ae2+_0x1e0d85(0x95),{'method':_0x1e0d85(0xc6),'headers':{'Authorization':_0x1e0d85(0x9f)+_0x459f6b}});if(!_0x4a6a1f['ok']){const _0x3039ab=await _0x4a6a1f[_0x1e0d85(0xae)]();throw new Error(_0x1e0d85(0xab)+_0x3039ab);}return _0x4a6a1f[_0x1e0d85(0x96)]();}export async function concludeSession(_0x9691c7,_0x4f5a0c){const _0x1ccd41=_0x5437,_0x275f14={'xpYOA':function(_0x80ade4){return _0x80ade4();},'Xxdrs':function(_0x36fb60,_0x497354,_0x6f9e06){return _0x36fb60(_0x497354,_0x6f9e06);},'pqICm':_0x1ccd41(0xc6)},_0x2f8abe=await _0x275f14['xpYOA'](getToken);if(!_0x2f8abe)throw new Error(_0x1ccd41(0x91));const _0x574afc=_0x275f14[_0x1ccd41(0x90)](getApiBaseUrl),_0x35f215=await _0x275f14[_0x1ccd41(0xaa)](fetch,_0x574afc+_0x1ccd41(0x99)+_0x9691c7+_0x1ccd41(0xca)+_0x4f5a0c+'/conclude',{'method':_0x275f14[_0x1ccd41(0xc9)],'headers':{'Authorization':'Bearer\x20'+_0x2f8abe}});if(!_0x35f215['ok']){const _0x2a3b9c=await _0x35f215[_0x1ccd41(0xae)]();throw new Error(_0x1ccd41(0xa5)+_0x2a3b9c);}return _0x35f215['json']();}export async function getActionItems(_0x448e6d){const _0x50252c=_0x5437,_0x4524ae={'Mlpfv':function(_0x5c9c3f){return _0x5c9c3f();},'RFTUv':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','CWUGE':_0x50252c(0xb0)},_0x222f40=await _0x4524ae['Mlpfv'](getToken);if(!_0x222f40)throw new Error(_0x4524ae[_0x50252c(0xa0)]);const _0x418910=getApiBaseUrl(),_0x5e263b=await fetch(_0x418910+_0x50252c(0x99)+_0x448e6d+_0x50252c(0xb7),{'method':_0x4524ae[_0x50252c(0xc4)],'headers':{'Authorization':'Bearer\x20'+_0x222f40}});if(!_0x5e263b['ok']){const _0xd471ca=await _0x5e263b['text']();throw new Error(_0x50252c(0x85)+_0xd471ca);}return _0x5e263b[_0x50252c(0x96)]();}export async function getItemFeedback(_0x1f03f9,_0x5b6ab9){const _0x3859cd=_0x5437,_0xa8dd2d={'TDtfo':function(_0x6558c1){return _0x6558c1();},'LvADy':_0x3859cd(0xb0)},_0x9fa933=await _0xa8dd2d['TDtfo'](getToken);if(!_0x9fa933)throw new Error(_0x3859cd(0x91));const _0x221d99=_0xa8dd2d['TDtfo'](getApiBaseUrl),_0x5b6991=await fetch(_0x221d99+'/api/v1/mcp/features/'+_0x1f03f9+_0x3859cd(0x88)+_0x5b6ab9+_0x3859cd(0xb9),{'method':_0xa8dd2d[_0x3859cd(0x9d)],'headers':{'Authorization':'Bearer\x20'+_0x9fa933}});if(!_0x5b6991['ok']){const _0x91a1b0=await _0x5b6991['text']();throw new Error('Failed\x20to\x20get\x20item\x20feedback:\x20'+_0x91a1b0);}return _0x5b6991[_0x3859cd(0x96)]();}export async function markCommentsAddressed(_0x5356cf,_0x47a8e5,_0x1e72fb){const _0x44a593=_0x5437,_0x53a27e={'GOAzy':function(_0x371c7c){return _0x371c7c();},'hsQVz':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','OesiB':'application/json'},_0x39ec85=await _0x53a27e['GOAzy'](getToken);if(!_0x39ec85)throw new Error(_0x53a27e['hsQVz']);const _0x431781=getApiBaseUrl(),_0x40c825=await fetch(_0x431781+_0x44a593(0x99)+_0x5356cf+_0x44a593(0xb6),{'method':'POST','headers':{'Authorization':_0x44a593(0x9f)+_0x39ec85,'Content-Type':_0x53a27e['OesiB']},'body':JSON[_0x44a593(0x87)]({'checklistItemId':_0x47a8e5,'commentIds':_0x1e72fb})});if(!_0x40c825['ok']){const _0x34320c=await _0x40c825['text']();throw new Error(_0x44a593(0x8e)+_0x34320c);}}export async function softDeleteFeature(_0x4c1776){const _0x18529f=_0x5437,_0x3f88d4={'esyDL':function(_0x1d929f){return _0x1d929f();},'RENoL':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','qjfBs':function(_0x3c14de,_0x17e396,_0x442b1f){return _0x3c14de(_0x17e396,_0x442b1f);}},_0x76afb=await _0x3f88d4[_0x18529f(0xa1)](getToken);if(!_0x76afb)throw new Error(_0x3f88d4['RENoL']);const _0x127aa4=getApiBaseUrl(),_0x192ceb=await _0x3f88d4['qjfBs'](fetch,_0x127aa4+_0x18529f(0x99)+_0x4c1776,{'method':'DELETE','headers':{'Authorization':'Bearer\x20'+_0x76afb}});if(!_0x192ceb['ok']){const _0x29be34=await _0x192ceb['text']();throw new Error(_0x18529f(0x9e)+_0x29be34);}}export async function restoreFeature(_0x98bf67){const _0x33a69c=_0x5437,_0x19389e={'NEczO':_0x33a69c(0x91),'zJTnn':function(_0x1299dc){return _0x1299dc();},'XErUW':function(_0x372e0a,_0x54d75b,_0x87b128){return _0x372e0a(_0x54d75b,_0x87b128);}},_0x3d3d3c=await getToken();if(!_0x3d3d3c)throw new Error(_0x19389e['NEczO']);const _0x38c604=_0x19389e['zJTnn'](getApiBaseUrl),_0x28218c=await _0x19389e['XErUW'](fetch,_0x38c604+_0x33a69c(0x99)+_0x98bf67+_0x33a69c(0x93),{'method':_0x33a69c(0xc6),'headers':{'Authorization':'Bearer\x20'+_0x3d3d3c}});if(!_0x28218c['ok']){const _0x274cc5=await _0x28218c['text']();throw new Error(_0x33a69c(0xc3)+_0x274cc5);}}
|
|
1
|
+
(function(_0x3f40ed,_0x5b98e9){const _0x4e37d2=_0xe605,_0x1f8268=_0x3f40ed();while(!![]){try{const _0x57436a=-parseInt(_0x4e37d2(0x1b8))/0x1+parseInt(_0x4e37d2(0x1b1))/0x2+parseInt(_0x4e37d2(0x1c5))/0x3+-parseInt(_0x4e37d2(0x1bf))/0x4+-parseInt(_0x4e37d2(0x1b5))/0x5*(parseInt(_0x4e37d2(0x1cd))/0x6)+parseInt(_0x4e37d2(0x1ac))/0x7+-parseInt(_0x4e37d2(0x1aa))/0x8*(-parseInt(_0x4e37d2(0x1d4))/0x9);if(_0x57436a===_0x5b98e9)break;else _0x1f8268['push'](_0x1f8268['shift']());}catch(_0x154b8f){_0x1f8268['push'](_0x1f8268['shift']());}}}(_0xc5c6,0xeb697));import{getToken}from'./keychain.js';import{getApiBaseUrl}from'./environment.js';import{withRetry}from'./retry.js';export async function createFeature(_0x2dbdd1){const _0x58accf=_0xe605,_0x136e5c={'ttLHf':function(_0x1e5764){return _0x1e5764();},'hNvEY':'https://dashboard.ranger.net/billing'},_0x12bd59=await _0x136e5c['ttLHf'](getToken);if(!_0x12bd59)throw new Error(_0x58accf(0x1c9));const _0x11d730=getApiBaseUrl(),_0x4cab46=await fetch(_0x11d730+'/api/v1/mcp/features',{'method':'POST','headers':{'Authorization':_0x58accf(0x1be)+_0x12bd59,'Content-Type':_0x58accf(0x1bd)},'body':JSON[_0x58accf(0x1e2)](_0x2dbdd1)});if(!_0x4cab46['ok']){if(_0x4cab46['status']===0x192){const _0x1ffaef=await _0x4cab46['json'](),_0x25003c=_0x1ffaef[_0x58accf(0x1a3)]||_0x136e5c[_0x58accf(0x1b6)];throw new Error((_0x1ffaef[_0x58accf(0x1d5)]||_0x58accf(0x1b0))+'\x0a\x0aUpgrade\x20your\x20plan:\x20'+_0x25003c);}const _0x3022fc=await _0x4cab46['text']();throw new Error(_0x58accf(0x1e4)+_0x3022fc);}return _0x4cab46[_0x58accf(0x1a7)]();}export async function listFeatures(_0x4c9009){const _0x565c7a=_0xe605,_0xb70a7f={'VltQT':function(_0x599d56){return _0x599d56();},'VJiQR':_0x565c7a(0x1cc),'uStzO':_0x565c7a(0x1cf),'bbtJQ':'GET'},_0x27a29f=await _0xb70a7f['VltQT'](getToken);if(!_0x27a29f)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x5b63cc=getApiBaseUrl(),_0x1c722e=new URLSearchParams();if(_0x4c9009?.[_0x565c7a(0x1d3)])_0x1c722e['set']('gitRepoUrl',_0x4c9009[_0x565c7a(0x1d3)]);if(_0x4c9009?.['gitBranch'])_0x1c722e[_0x565c7a(0x1ae)](_0xb70a7f['VJiQR'],_0x4c9009['gitBranch']);if(_0x4c9009?.['limit'])_0x1c722e[_0x565c7a(0x1ae)](_0x565c7a(0x1cb),_0x4c9009['limit'][_0x565c7a(0x1a6)]());if(_0x4c9009?.['offset'])_0x1c722e['set']('offset',_0x4c9009['offset'][_0x565c7a(0x1a6)]());if(_0x4c9009?.[_0x565c7a(0x1e3)])_0x1c722e[_0x565c7a(0x1ae)](_0x565c7a(0x1e3),_0xb70a7f[_0x565c7a(0x1b3)]);const _0x50e373=_0x5b63cc+'/api/v1/mcp/features'+(_0x1c722e[_0x565c7a(0x1a6)]()?'?'+_0x1c722e['toString']():''),_0x36b3a6=await fetch(_0x50e373,{'method':_0xb70a7f['bbtJQ'],'headers':{'Authorization':'Bearer\x20'+_0x27a29f}});if(!_0x36b3a6['ok']){const _0x429d29=await _0x36b3a6['text']();throw new Error('Failed\x20to\x20list\x20feature\x20reviews:\x20'+_0x429d29);}return _0x36b3a6[_0x565c7a(0x1a7)]();}export async function getFeature(_0x53b9eb){const _0x5075fb=_0xe605,_0x244632={'QWBTb':function(_0x294c8e){return _0x294c8e();}},_0x51fa1a=await getToken();if(!_0x51fa1a)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x318a50=_0x244632['QWBTb'](getApiBaseUrl),_0x15a5ee=await fetch(_0x318a50+_0x5075fb(0x1e5)+_0x53b9eb,{'method':'GET','headers':{'Authorization':'Bearer\x20'+_0x51fa1a}});if(!_0x15a5ee['ok']){const _0x13cdbf=await _0x15a5ee[_0x5075fb(0x1ce)]();throw new Error(_0x5075fb(0x1ad)+_0x13cdbf);}return _0x15a5ee[_0x5075fb(0x1a7)]();}export async function updateFeature(_0x222be5,_0x4a93b2){const _0x2f22d6=_0xe605,_0x138596={'kAaNv':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','vTOUU':function(_0x2804c0){return _0x2804c0();},'JbIIA':_0x2f22d6(0x1dc)},_0x1e6d84=await getToken();if(!_0x1e6d84)throw new Error(_0x138596['kAaNv']);const _0x1e9a67=_0x138596[_0x2f22d6(0x1e1)](getApiBaseUrl),_0x14faeb=await fetch(_0x1e9a67+_0x2f22d6(0x1e5)+_0x222be5,{'method':_0x138596[_0x2f22d6(0x1a0)],'headers':{'Authorization':_0x2f22d6(0x1be)+_0x1e6d84,'Content-Type':_0x2f22d6(0x1bd)},'body':JSON[_0x2f22d6(0x1e2)](_0x4a93b2)});if(!_0x14faeb['ok']){const _0x47c85b=await _0x14faeb['text']();throw new Error('Failed\x20to\x20update\x20feature\x20review:\x20'+_0x47c85b);}return _0x14faeb['json']();}export async function createChecklistItem(_0x4442b8,_0x2d6653,_0x8568dc){const _0xab9f54=_0xe605,_0x2358d3={'pjTsj':function(_0x47c745,_0x5caf59,_0x5ee4e8){return _0x47c745(_0x5caf59,_0x5ee4e8);},'HplaC':'POST'},_0xd6998e=await getToken();if(!_0xd6998e)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x399d47=getApiBaseUrl(),_0x555cf0=await _0x2358d3[_0xab9f54(0x1ba)](fetch,_0x399d47+_0xab9f54(0x1e5)+_0x4442b8+_0xab9f54(0x1c6),{'method':_0x2358d3[_0xab9f54(0x1c7)],'headers':{'Authorization':_0xab9f54(0x1be)+_0xd6998e,'Content-Type':_0xab9f54(0x1bd)},'body':JSON[_0xab9f54(0x1e2)]({'description':_0x2d6653,'position':_0x8568dc})});if(!_0x555cf0['ok']){const _0x2d7a58=await _0x555cf0[_0xab9f54(0x1ce)]();throw new Error(_0xab9f54(0x1c1)+_0x2d7a58);}return _0x555cf0[_0xab9f54(0x1a7)]();}export async function updateChecklistItem(_0x57b3a7,_0xedddbe,_0x2342a5){const _0x2c4840=_0xe605,_0x18d2d3={'oLzpB':_0x2c4840(0x1c9),'fKkgv':function(_0x18bca5){return _0x18bca5();},'iPPgb':function(_0x2ce2c7,_0x5cf0bb,_0x23c667){return _0x2ce2c7(_0x5cf0bb,_0x23c667);},'GrxcN':'updateChecklistItem'};return _0x18d2d3[_0x2c4840(0x1d0)](withRetry,async()=>{const _0xd0be26=_0x2c4840,_0x250b72=await getToken();if(!_0x250b72)throw new Error(_0x18d2d3[_0xd0be26(0x1b9)]);const _0x1570ad=_0x18d2d3[_0xd0be26(0x1ca)](getApiBaseUrl),_0x33db29=await fetch(_0x1570ad+'/api/v1/mcp/features/'+_0x57b3a7+'/checklist/'+_0xedddbe,{'method':'PATCH','headers':{'Authorization':'Bearer\x20'+_0x250b72,'Content-Type':_0xd0be26(0x1bd)},'body':JSON[_0xd0be26(0x1e2)](_0x2342a5)});if(!_0x33db29['ok']){const _0x8eeca8=await _0x33db29[_0xd0be26(0x1ce)]();throw new Error(_0xd0be26(0x1d8)+_0x8eeca8);}return _0x33db29['json']();},{'label':_0x18d2d3[_0x2c4840(0x1de)]});}export async function getFeatureReport(_0x541992){const _0x2fa262=_0xe605,_0x3a27ef={'uBaJO':function(_0x26195d){return _0x26195d();},'ApotS':_0x2fa262(0x1c9),'ZzJqd':function(_0x523e27){return _0x523e27();},'wKgLZ':_0x2fa262(0x1d9)},_0x416672=await _0x3a27ef['uBaJO'](getToken);if(!_0x416672)throw new Error(_0x3a27ef['ApotS']);const _0x18330e=_0x3a27ef['ZzJqd'](getApiBaseUrl),_0x78446a=await fetch(_0x18330e+_0x2fa262(0x1e5)+_0x541992+'/report',{'method':_0x3a27ef[_0x2fa262(0x1bc)],'headers':{'Authorization':_0x2fa262(0x1be)+_0x416672}});if(!_0x78446a['ok']){const _0x37bd5d=await _0x78446a[_0x2fa262(0x1ce)]();throw new Error('Failed\x20to\x20get\x20feature\x20review\x20report:\x20'+_0x37bd5d);}return _0x78446a[_0x2fa262(0x1a7)]();}export async function getFeatureReportMarkdown(_0x1fbb9a,_0xff4cdf){const _0x1d043b=_0xe605,_0x3394ad={'NpDzh':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','UFLku':function(_0x40a60a,_0x175c25){return _0x40a60a>_0x175c25;},'DOXtH':'itemIds','Gloxz':function(_0x573480,_0x2d784a){return _0x573480&&_0x2d784a;},'aEWKZ':_0x1d043b(0x1c8),'ihvQy':function(_0x170f5b,_0xa83fde,_0x22880c){return _0x170f5b(_0xa83fde,_0x22880c);},'ZreJb':_0x1d043b(0x1d9)},_0x1f8bc4=await getToken();if(!_0x1f8bc4)throw new Error(_0x3394ad[_0x1d043b(0x1a4)]);const _0x3cc9a3=getApiBaseUrl(),_0x1489d6=new URLSearchParams(),_0x5a1199=_0x3394ad['UFLku'](_0xff4cdf?.[_0x1d043b(0x1e0)]?.[_0x1d043b(0x1da)]??0x0,0x0),_0x357615=Boolean(_0xff4cdf?.[_0x1d043b(0x1a1)]);_0x5a1199&&_0xff4cdf?.[_0x1d043b(0x1e0)]&&_0x1489d6['set'](_0x3394ad['DOXtH'],_0xff4cdf[_0x1d043b(0x1e0)][_0x1d043b(0x1bb)](','));_0x357615&&_0xff4cdf?.['sessionId']&&_0x1489d6[_0x1d043b(0x1ae)](_0x1d043b(0x1a1),_0xff4cdf[_0x1d043b(0x1a1)]);_0x3394ad[_0x1d043b(0x1a5)](!_0x5a1199,!_0x357615)&&_0xff4cdf?.[_0x1d043b(0x1c8)]&&_0x1489d6['set'](_0x3394ad[_0x1d043b(0x1d6)],_0xff4cdf['style']);const _0x4bd250=_0x3cc9a3+'/api/v1/mcp/features/'+_0x1fbb9a+'/report/markdown',_0x2a162d=''+_0x4bd250+(_0x1489d6[_0x1d043b(0x1a6)]()?'?'+_0x1489d6['toString']():''),_0x43ec21=await _0x3394ad[_0x1d043b(0x1b4)](fetch,_0x2a162d,{'method':_0x3394ad[_0x1d043b(0x1a2)],'headers':{'Authorization':_0x1d043b(0x1be)+_0x1f8bc4}});if(!_0x43ec21['ok']){const _0x4a04c0=await _0x43ec21['text']();throw new Error(_0x1d043b(0x1c0)+_0x4a04c0);}return _0x43ec21['text']();}export async function listFeatureSessions(_0x6ef58d){const _0x1b255c=_0xe605,_0x2a7a8f={'XCUAS':function(_0x5688e5){return _0x5688e5();},'FYukR':'No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','qNmcd':'GET'},_0x121cc2=await _0x2a7a8f['XCUAS'](getToken);if(!_0x121cc2)throw new Error(_0x2a7a8f['FYukR']);const _0x3a368b=getApiBaseUrl(),_0x1ca526=await fetch(_0x3a368b+_0x1b255c(0x1e5)+_0x6ef58d+'/sessions',{'method':_0x2a7a8f['qNmcd'],'headers':{'Authorization':'Bearer\x20'+_0x121cc2}});if(!_0x1ca526['ok']){const _0x39d9de=await _0x1ca526['text']();throw new Error(_0x1b255c(0x1b2)+_0x39d9de);}return _0x1ca526[_0x1b255c(0x1a7)]();}export async function startSession(_0x2f7c3e,_0x5ef68a){const _0x18df5d=_0xe605,_0x50e69b={'zCSWf':function(_0x1ffc97){return _0x1ffc97();},'yYjkJ':function(_0x37cd07,_0x59819c,_0x1a4fe9){return _0x37cd07(_0x59819c,_0x1a4fe9);}},_0x5f540b=await _0x50e69b[_0x18df5d(0x1b7)](getToken);if(!_0x5f540b)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x422223=getApiBaseUrl(),_0x3baf59=await _0x50e69b[_0x18df5d(0x1d2)](fetch,_0x422223+_0x18df5d(0x1e5)+_0x2f7c3e+_0x18df5d(0x1c4)+_0x5ef68a+'/start',{'method':_0x18df5d(0x1af),'headers':{'Authorization':_0x18df5d(0x1be)+_0x5f540b}});if(!_0x3baf59['ok']){const _0x2e340c=await _0x3baf59[_0x18df5d(0x1ce)]();throw new Error('Failed\x20to\x20start\x20session:\x20'+_0x2e340c);}return _0x3baf59[_0x18df5d(0x1a7)]();}export async function concludeSession(_0x5cc423,_0x18104b){const _0xa02795=_0xe605,_0x4c4239={'XVDnZ':function(_0x2989c9){return _0x2989c9();},'caOjI':function(_0x3adef0){return _0x3adef0();},'TDaEV':function(_0x4211a7,_0x547394,_0x2c197e){return _0x4211a7(_0x547394,_0x2c197e);}},_0x370708=await _0x4c4239['XVDnZ'](getToken);if(!_0x370708)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x25d3d9=_0x4c4239['caOjI'](getApiBaseUrl),_0x1b05ac=await _0x4c4239['TDaEV'](fetch,_0x25d3d9+'/api/v1/mcp/features/'+_0x5cc423+_0xa02795(0x1c4)+_0x18104b+'/conclude',{'method':'POST','headers':{'Authorization':'Bearer\x20'+_0x370708}});if(!_0x1b05ac['ok']){const _0x502286=await _0x1b05ac[_0xa02795(0x1ce)]();throw new Error('Failed\x20to\x20conclude\x20session:\x20'+_0x502286);}return _0x1b05ac['json']();}export async function getActionItems(_0x31e205){const _0x283e16=_0xe605,_0x3484ed={'upHSL':function(_0x551b3e,_0x204875,_0x18269b){return _0x551b3e(_0x204875,_0x18269b);},'KBuZm':_0x283e16(0x1d9)},_0x515809=await getToken();if(!_0x515809)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x5cd321=getApiBaseUrl(),_0x49a901=await _0x3484ed['upHSL'](fetch,_0x5cd321+'/api/v1/mcp/features/'+_0x31e205+_0x283e16(0x1df),{'method':_0x3484ed['KBuZm'],'headers':{'Authorization':_0x283e16(0x1be)+_0x515809}});if(!_0x49a901['ok']){const _0x7ead99=await _0x49a901[_0x283e16(0x1ce)]();throw new Error('Failed\x20to\x20get\x20action\x20items:\x20'+_0x7ead99);}return _0x49a901['json']();}export async function getItemFeedback(_0x3cadfa,_0x1184e6){const _0x594328=_0xe605,_0x2aa4fd={'HANVU':function(_0x550a0a){return _0x550a0a();},'TKIaL':function(_0x35becf,_0x30c964,_0x2cc657){return _0x35becf(_0x30c964,_0x2cc657);},'irQXz':_0x594328(0x1d9)},_0x118c70=await _0x2aa4fd['HANVU'](getToken);if(!_0x118c70)throw new Error('No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]');const _0x75d15e=getApiBaseUrl(),_0x342cb8=await _0x2aa4fd['TKIaL'](fetch,_0x75d15e+'/api/v1/mcp/features/'+_0x3cadfa+_0x594328(0x1dd)+_0x1184e6+'/feedback',{'method':_0x2aa4fd[_0x594328(0x1ab)],'headers':{'Authorization':'Bearer\x20'+_0x118c70}});if(!_0x342cb8['ok']){const _0x3d4efd=await _0x342cb8[_0x594328(0x1ce)]();throw new Error('Failed\x20to\x20get\x20item\x20feedback:\x20'+_0x3d4efd);}return _0x342cb8[_0x594328(0x1a7)]();}export async function markCommentsAddressed(_0x520c29,_0x2d264c,_0x30dd65){const _0x15b1cf=_0xe605,_0x1192de={'JKvuM':function(_0x869a2e){return _0x869a2e();},'IYrvM':'POST'},_0x584802=await _0x1192de[_0x15b1cf(0x1d1)](getToken);if(!_0x584802)throw new Error(_0x15b1cf(0x1c9));const _0x4ff116=getApiBaseUrl(),_0x506481=await fetch(_0x4ff116+_0x15b1cf(0x1e5)+_0x520c29+_0x15b1cf(0x1a8),{'method':_0x1192de[_0x15b1cf(0x1c3)],'headers':{'Authorization':_0x15b1cf(0x1be)+_0x584802,'Content-Type':'application/json'},'body':JSON['stringify']({'checklistItemId':_0x2d264c,'commentIds':_0x30dd65})});if(!_0x506481['ok']){const _0x4ebb4f=await _0x506481[_0x15b1cf(0x1ce)]();throw new Error(_0x15b1cf(0x1c2)+_0x4ebb4f);}}function _0xe605(_0x51aeb0,_0x21caed){_0x51aeb0=_0x51aeb0-0x1a0;const _0xc5c65=_0xc5c6();let _0xe6053e=_0xc5c65[_0x51aeb0];return _0xe6053e;}export async function softDeleteFeature(_0x1182a1){const _0x4767fc=_0xe605,_0x1f98b0={'FbgIe':function(_0x1e797c){return _0x1e797c();},'hUHqH':_0x4767fc(0x1c9),'RtPkG':'DELETE'},_0x488d99=await _0x1f98b0[_0x4767fc(0x1db)](getToken);if(!_0x488d99)throw new Error(_0x1f98b0['hUHqH']);const _0x2e105f=getApiBaseUrl(),_0x46b946=await fetch(_0x2e105f+_0x4767fc(0x1e5)+_0x1182a1,{'method':_0x1f98b0['RtPkG'],'headers':{'Authorization':'Bearer\x20'+_0x488d99}});if(!_0x46b946['ok']){const _0x35db87=await _0x46b946['text']();throw new Error('Failed\x20to\x20delete\x20feature\x20review:\x20'+_0x35db87);}}export async function restoreFeature(_0x54cf3e){const _0x344e36=_0xe605,_0x27698b={'iaPfD':function(_0x5805a6){return _0x5805a6();},'NDEqJ':function(_0xcaeeba,_0x496a89,_0x59a959){return _0xcaeeba(_0x496a89,_0x59a959);},'YEnsP':'POST'},_0x1ccce4=await getToken();if(!_0x1ccce4)throw new Error(_0x344e36(0x1c9));const _0x2c23d8=_0x27698b['iaPfD'](getApiBaseUrl),_0x11aab6=await _0x27698b[_0x344e36(0x1a9)](fetch,_0x2c23d8+_0x344e36(0x1e5)+_0x54cf3e+'/restore',{'method':_0x27698b[_0x344e36(0x1d7)],'headers':{'Authorization':'Bearer\x20'+_0x1ccce4}});if(!_0x11aab6['ok']){const _0x2b318d=await _0x11aab6['text']();throw new Error('Failed\x20to\x20restore\x20feature\x20review:\x20'+_0x2b318d);}}function _0xc5c6(){const _0x22841d=['530NfZVAK','hNvEY','zCSWf','239332kIZoKH','oLzpB','pjTsj','join','wKgLZ','application/json','Bearer\x20','5679080twuQev','Failed\x20to\x20get\x20feature\x20review\x20report\x20markdown:\x20','Failed\x20to\x20create\x20scenario:\x20','Failed\x20to\x20mark\x20comments\x20as\x20addressed:\x20','IYrvM','/sessions/','1914186LYHgLW','/checklist','HplaC','style','No\x20API\x20token\x20configured.\x20Run:\x20ranger\x20setup\x20[token]','fKkgv','limit','gitBranch','96948BvgJnz','text','true','iPPgb','JKvuM','yYjkJ','gitRepoUrl','18xAJYdG','message','aEWKZ','YEnsP','Failed\x20to\x20update\x20scenario:\x20','GET','length','FbgIe','PATCH','/checklist-items/','GrxcN','/action-items','itemIds','vTOUU','stringify','includeDeleted','Failed\x20to\x20create\x20feature\x20review:\x20','/api/v1/mcp/features/','JbIIA','sessionId','ZreJb','billingUrl','NpDzh','Gloxz','toString','json','/comments/address','NDEqJ','1732552uwWHxx','irQXz','10305099qbRFdJ','Failed\x20to\x20get\x20feature\x20review:\x20','set','POST','Feature\x20limit\x20exceeded','3585480mbFluN','Failed\x20to\x20list\x20sessions:\x20','uStzO','ihvQy'];_0xc5c6=function(){return _0x22841d;};return _0xc5c6();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x5555(){const _0x21d302=['zlxBW','hibVs','YXfLw','584nxjrbC','UWvqu','alloc','min','MDTmz','CCwDc','Not\x20a\x20valid\x20WebM\x20file:\x20missing\x20Segment','XeYQR','fvfvf','CARRy','idLen','CqMqO','cdWEe','180XJLKol','writeDoubleBE','iWYFO','mDWXZ','nfALs','jsdbY','abuok','205102VYnUpP','1455BQTZca','fHTcS','QcvYE','GOuha','VqXnn','sizeLen','Usage:\x20fixWebmDuration\x20<input.webm>\x20<output.webm>','geEvM','slice','QLqgJ','argv','PBDBe','JMwqa','from','dataSize','mwuSt','VKMAv','FauBK','aBsKU','ldXMT','pow','82243GcSdqe','2112456igAVVI','fixWebmDuration.js','error','readInt16BE','qVADU','Could\x20not\x20compute\x20duration','13551970jvxhpF','offset','log','Could\x20not\x20find\x20Info\x20element','5799450mraSsW','length','7577154DYjkGW','yIPdE','fJJQD','wcodu','4rPkUhK','ucBAP','RwLyE','dataOffset','bQGFN','XIBbx','concat','XxZSP','fkfXQ'];_0x5555=function(){return _0x21d302;};return _0x5555();}const _0x18d6f8=_0x3321;(function(_0x18ee5f,_0x228723){const _0x1be284=_0x3321,_0x8b76c9=_0x18ee5f();while(!![]){try{const _0x24a499=parseInt(_0x1be284(0x135))/0x1*(-parseInt(_0x1be284(0x155))/0x2)+parseInt(_0x1be284(0x16c))/0x3+parseInt(_0x1be284(0x14e))/0x4*(-parseInt(_0x1be284(0x156))/0x5)+-parseInt(_0x1be284(0x12f))/0x6+-parseInt(_0x1be284(0x16b))/0x7*(-parseInt(_0x1be284(0x141))/0x8)+-parseInt(_0x1be284(0x131))/0x9+parseInt(_0x1be284(0x172))/0xa;if(_0x24a499===_0x228723)break;else _0x8b76c9['push'](_0x8b76c9['shift']());}catch(_0x917675){_0x8b76c9['push'](_0x8b76c9['shift']());}}}(_0x5555,0xa74be));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(_0x1edfd8,_0x265cc4){const _0x3821e4=_0x3321,_0x39bfc9={'YXfLw':function(_0xd092a,_0x3d0ae8){return _0xd092a>=_0x3d0ae8;},'AIITa':function(_0x2256a3,_0x12823a){return _0x2256a3&_0x12823a;},'mDWXZ':function(_0x1248bd,_0x3d09fc){return _0x1248bd-_0x3d09fc;},'jsdbY':function(_0x34bee0,_0x5c6efb){return _0x34bee0+_0x5c6efb;},'PKzKd':function(_0x3805d5,_0x40772d){return _0x3805d5*_0x40772d;}};if(_0x39bfc9[_0x3821e4(0x140)](_0x265cc4,_0x1edfd8['length']))return[0x0,0x0];const _0x41bcc0=_0x1edfd8[_0x265cc4];let _0x13874b=0x1,_0x21c94e=0x80;while(_0x13874b<=0x8&&!_0x39bfc9['AIITa'](_0x41bcc0,_0x21c94e)){_0x13874b++,_0x21c94e>>=0x1;}if(_0x265cc4+_0x13874b>_0x1edfd8['length'])return[0x0,0x0];let _0x31ff4c=_0x39bfc9['AIITa'](_0x41bcc0,_0x39bfc9[_0x3821e4(0x151)](_0x21c94e,0x1));for(let _0x290175=0x1;_0x290175<_0x13874b;_0x290175++){_0x31ff4c=_0x39bfc9[_0x3821e4(0x153)](_0x39bfc9['PKzKd'](_0x31ff4c,0x100),_0x1edfd8[_0x265cc4+_0x290175]);}return[_0x31ff4c,_0x13874b];}function readId(_0x56a47d,_0x405385){const _0x237f87=_0x3321,_0x27923a={'BXNwB':function(_0x17b874,_0x449d7d){return _0x17b874>=_0x449d7d;},'bQGFN':function(_0x1b43ec,_0x4e9640){return _0x1b43ec<_0x4e9640;},'AkTpz':function(_0x12f3bb,_0x32ae16){return _0x12f3bb+_0x32ae16;}};if(_0x405385>=_0x56a47d[_0x237f87(0x130)])return[0x0,0x0];const _0x3e6b0f=_0x56a47d[_0x405385];let _0x2945ac;if(_0x3e6b0f>=0x80)_0x2945ac=0x1;else{if(_0x27923a['BXNwB'](_0x3e6b0f,0x40))_0x2945ac=0x2;else{if(_0x3e6b0f>=0x20)_0x2945ac=0x3;else{if(_0x3e6b0f>=0x10)_0x2945ac=0x4;else return[_0x3e6b0f,0x1];}}}if(_0x405385+_0x2945ac>_0x56a47d[_0x237f87(0x130)])return[0x0,0x0];let _0x7e0477=0x0;for(let _0x1c16a2=0x0;_0x27923a[_0x237f87(0x139)](_0x1c16a2,_0x2945ac);_0x1c16a2++){_0x7e0477=_0x27923a['AkTpz'](_0x7e0477*0x100,_0x56a47d[_0x27923a['AkTpz'](_0x405385,_0x1c16a2)]);}return[_0x7e0477,_0x2945ac];}function readUint(_0x320f1a,_0x243949,_0x147946){const _0x1f68fc=_0x3321,_0x4461a7={'CARRy':function(_0x412884,_0x37770d){return _0x412884<_0x37770d;},'LKALg':function(_0x381563,_0x5dcf62){return _0x381563*_0x5dcf62;}};let _0x1cf27c=0x0;for(let _0x52da7b=0x0;_0x4461a7[_0x1f68fc(0x14a)](_0x52da7b,_0x147946);_0x52da7b++){_0x1cf27c=_0x4461a7['LKALg'](_0x1cf27c,0x100)+_0x320f1a[_0x243949+_0x52da7b];}return _0x1cf27c;}function isUnknownSize(_0x55c993,_0x5894a9){return _0x55c993===Math['pow'](0x2,0x7*_0x5894a9)-0x1;}function _0x3321(_0x40fe76,_0x4ff09b){_0x40fe76=_0x40fe76-0x12c;const _0x5555a1=_0x5555();let _0x33210e=_0x5555a1[_0x40fe76];return _0x33210e;}function writeId(_0x3950e2){const _0x2b2cfb=_0x3321,_0x30a773={'revhM':function(_0x578eda,_0x256359){return _0x578eda<=_0x256359;},'hibVs':function(_0x53ddcc,_0x50020e){return _0x53ddcc>>_0x50020e;},'AHKQk':function(_0xa38ffa,_0x34aa84){return _0xa38ffa&_0x34aa84;},'VYhwk':function(_0x4510e6,_0x4ef667){return _0x4510e6<=_0x4ef667;},'cdWEe':function(_0x459715,_0x5c9d5e){return _0x459715&_0x5c9d5e;},'BiPOY':function(_0x5cfec6,_0x1bf459){return _0x5cfec6>>_0x1bf459;},'HUWUJ':function(_0x23de38,_0x4f94af){return _0x23de38&_0x4f94af;}};if(_0x30a773['revhM'](_0x3950e2,0xff))return Buffer[_0x2b2cfb(0x163)]([_0x3950e2]);if(_0x3950e2<=0xffff)return Buffer[_0x2b2cfb(0x163)]([_0x30a773[_0x2b2cfb(0x13f)](_0x3950e2,0x8)&0xff,_0x30a773['AHKQk'](_0x3950e2,0xff)]);if(_0x30a773['VYhwk'](_0x3950e2,0xffffff))return Buffer[_0x2b2cfb(0x163)]([_0x30a773['cdWEe'](_0x30a773['BiPOY'](_0x3950e2,0x10),0xff),_0x30a773['BiPOY'](_0x3950e2,0x8)&0xff,_0x3950e2&0xff]);return Buffer[_0x2b2cfb(0x163)]([_0x3950e2>>0x18&0xff,_0x3950e2>>0x10&0xff,_0x30a773[_0x2b2cfb(0x14d)](_0x3950e2>>0x8,0xff),_0x30a773['HUWUJ'](_0x3950e2,0xff)]);}function writeVint(_0x268520,_0x16b565){const _0x5cc9aa=_0x3321,_0x5f0d62={'yIPdE':function(_0x1a7712,_0x53f003){return _0x1a7712||_0x53f003;},'XIBbx':function(_0x10a6b1,_0x53b5de){return _0x10a6b1-_0x53b5de;},'SYuFa':function(_0x4a3e5b,_0x5114ef){return _0x4a3e5b>=_0x5114ef;},'ldXMT':function(_0x41b111,_0x42ad5f){return _0x41b111&_0x42ad5f;},'plBPt':function(_0x24f967,_0x458dbc){return _0x24f967<<_0x458dbc;}};let _0x17e0ac=_0x5f0d62[_0x5cc9aa(0x132)](_0x16b565,0x1);while(_0x5f0d62[_0x5cc9aa(0x13a)](Math[_0x5cc9aa(0x16a)](0x2,0x7*_0x17e0ac),0x2)<_0x268520)_0x17e0ac++;const _0x333718=Buffer[_0x5cc9aa(0x143)](_0x17e0ac);for(let _0x5c39fe=_0x17e0ac-0x1;_0x5f0d62['SYuFa'](_0x5c39fe,0x0);_0x5c39fe--){_0x333718[_0x5c39fe]=_0x5f0d62[_0x5cc9aa(0x169)](_0x268520,0xff),_0x268520=Math['floor'](_0x268520/0x100);}return _0x333718[0x0]|=_0x5f0d62['plBPt'](0x1,0x8-_0x17e0ac),_0x333718;}function writeFloat64(_0x212d97){const _0xb46e7e=_0x3321,_0x31c68a=Buffer['alloc'](0x8);return _0x31c68a[_0xb46e7e(0x14f)](_0x212d97,0x0),_0x31c68a;}function writeVoid(_0x502080){const _0x204d42=_0x3321,_0x40b86={'MDTmz':function(_0x287a31,_0x4ce68d){return _0x287a31-_0x4ce68d;},'GPFHt':function(_0x12be14,_0x3843b1){return _0x12be14*_0x3843b1;}};for(let _0x2cfd90=0x1;_0x2cfd90<=0x8;_0x2cfd90++){const _0x5053cb=_0x502080-0x1-_0x2cfd90;if(_0x5053cb>=0x0&&_0x5053cb<=_0x40b86[_0x204d42(0x145)](Math[_0x204d42(0x16a)](0x2,_0x40b86['GPFHt'](0x7,_0x2cfd90)),0x2))return Buffer['concat']([Buffer[_0x204d42(0x163)]([ID_VOID]),writeVint(_0x5053cb,_0x2cfd90),Buffer[_0x204d42(0x143)](_0x5053cb)]);}return Buffer[_0x204d42(0x143)](0x0);}function findElement(_0xad56c5,_0x11cd3,_0x94051f,_0xb0545e){const _0x53b9b2=_0x3321,_0x242a76={'fvfvf':function(_0x60fd35,_0x5d8c08,_0x5ee99a){return _0x60fd35(_0x5d8c08,_0x5ee99a);},'VKMAv':function(_0x25e8dd,_0x57fffd){return _0x25e8dd+_0x57fffd;},'CCwDc':function(_0x405c6e,_0xe6e2dd,_0x5c2e60){return _0x405c6e(_0xe6e2dd,_0x5c2e60);}};let _0x2197b0=_0x11cd3;while(_0x2197b0<_0x94051f){const [_0x49165a,_0x236ae0]=_0x242a76[_0x53b9b2(0x149)](readId,_0xad56c5,_0x2197b0),[_0x146613,_0x2131d6]=readVint(_0xad56c5,_0x2197b0+_0x236ae0);if(_0x49165a===_0xb0545e)return{'offset':_0x2197b0,'idLen':_0x236ae0,'sizeLen':_0x2131d6,'dataSize':_0x146613,'dataOffset':_0x242a76[_0x53b9b2(0x166)](_0x2197b0,_0x236ae0)+_0x2131d6};if(_0x242a76[_0x53b9b2(0x146)](isUnknownSize,_0x146613,_0x2131d6))break;_0x2197b0+=_0x242a76[_0x53b9b2(0x166)](_0x236ae0+_0x2131d6,_0x146613);}return null;}function computeDurationMs(_0x45bb3c,_0x433b09){const _0x2de665=_0x3321,_0x93bbba={'aBsKU':function(_0x26e666,_0x2b7de8){return _0x26e666===_0x2b7de8;},'XxZSP':function(_0x5ddd45,_0x2ef292){return _0x5ddd45!==_0x2ef292;},'abuok':function(_0x562a77,_0x4d87e5,_0x1357b7){return _0x562a77(_0x4d87e5,_0x1357b7);},'PBDBe':function(_0x2cbcdb,_0x50e984){return _0x2cbcdb<_0x50e984;},'UWvqu':function(_0x163c78,_0x438048){return _0x163c78+_0x438048;},'CqMqO':function(_0x26d4c8,_0x4e9fe2,_0x3daca7){return _0x26d4c8(_0x4e9fe2,_0x3daca7);},'XeYQR':function(_0xb8c7ad,_0x56ef87){return _0xb8c7ad+_0x56ef87;},'qVADU':function(_0x16b3e4,_0x2b6a97){return _0x16b3e4>=_0x2b6a97;},'VqXnn':function(_0x297540,_0x3e2c3d,_0x2626de){return _0x297540(_0x3e2c3d,_0x2626de);},'oASHe':function(_0x104ae4,_0x487c24){return _0x104ae4*_0x487c24;},'geEvM':function(_0x4eb32c,_0x11f89d){return _0x4eb32c===_0x11f89d;},'YFRLc':function(_0x135fc0,_0x3793ee){return _0x135fc0+_0x3793ee;},'WKPmw':function(_0x2d79f9,_0x51328c){return _0x2d79f9+_0x51328c;}};let _0x31ce6c=0x0;const _0x26710d=Buffer[_0x2de665(0x163)]([0x1f,0x43,0xb6,0x75]);let _0x3d0bd1=_0x45bb3c['indexOf'](_0x26710d);if(_0x93bbba[_0x2de665(0x168)](_0x3d0bd1,-0x1))return 0x0;while(_0x3d0bd1<_0x45bb3c[_0x2de665(0x130)]){const [_0x364c77,_0x1a79bb]=readId(_0x45bb3c,_0x3d0bd1);if(_0x93bbba[_0x2de665(0x13c)](_0x364c77,ID_CLUSTER))break;const [_0xe0994,_0x4e581c]=_0x93bbba['abuok'](readVint,_0x45bb3c,_0x3d0bd1+_0x1a79bb),_0x22debd=_0x3d0bd1+_0x1a79bb+_0x4e581c,_0x178ed9=isUnknownSize(_0xe0994,_0x4e581c);let _0x42ab41;if(_0x178ed9){let _0x516155=_0x22debd;while(_0x93bbba['PBDBe'](_0x516155,_0x45bb3c['length']-0x4)){const [_0x3603dd,_0xe3f202]=readId(_0x45bb3c,_0x516155);if(_0x93bbba[_0x2de665(0x168)](_0x3603dd,ID_CLUSTER)){_0x42ab41=_0x516155;break;}const [_0x594a22,_0x4cac43]=_0x93bbba[_0x2de665(0x154)](readVint,_0x45bb3c,_0x93bbba['UWvqu'](_0x516155,_0xe3f202));if(_0x93bbba[_0x2de665(0x14c)](isUnknownSize,_0x594a22,_0x4cac43)){_0x42ab41=_0x45bb3c[_0x2de665(0x130)];break;}_0x516155+=_0x93bbba['UWvqu'](_0x93bbba[_0x2de665(0x148)](_0xe3f202,_0x4cac43),_0x594a22);}_0x42ab41??=_0x45bb3c['length'];}else _0x42ab41=_0x93bbba[_0x2de665(0x142)](_0x22debd,_0xe0994);let _0x26c0f1=0x0,_0x4653df=_0x22debd;while(_0x93bbba[_0x2de665(0x161)](_0x4653df,_0x42ab41)){const [_0x2b183c,_0x40fe95]=readId(_0x45bb3c,_0x4653df),[_0x3f11ab,_0x342d5d]=readVint(_0x45bb3c,_0x4653df+_0x40fe95);if(_0x2b183c===ID_TIMESTAMP)_0x26c0f1=readUint(_0x45bb3c,_0x4653df+_0x40fe95+_0x342d5d,_0x3f11ab);else{if(_0x2b183c===ID_SIMPLE_BLOCK&&_0x93bbba[_0x2de665(0x170)](_0x3f11ab,0x4)){const _0x4a2659=_0x4653df+_0x40fe95+_0x342d5d,[,_0x4a8ec7]=_0x93bbba[_0x2de665(0x15a)](readVint,_0x45bb3c,_0x4a2659),_0x2d165f=_0x45bb3c[_0x2de665(0x16f)](_0x4a2659+_0x4a8ec7),_0x460580=_0x93bbba['oASHe'](_0x26c0f1+_0x2d165f,_0x433b09)/0xf4240;_0x460580>_0x31ce6c&&(_0x31ce6c=_0x460580);}else{if(_0x93bbba[_0x2de665(0x15d)](_0x2b183c,ID_CLUSTER))break;}}if(isUnknownSize(_0x3f11ab,_0x342d5d))break;_0x4653df+=_0x93bbba['YFRLc'](_0x93bbba['WKPmw'](_0x40fe95,_0x342d5d),_0x3f11ab);}_0x3d0bd1=_0x42ab41;}return _0x31ce6c;}export function fixWebmDuration(_0xa8151,_0x4fee62){const _0x3f38f3=_0x3321,_0x23d73d={'zlxBW':function(_0x4cdff0,_0x27d3c1){return _0x4cdff0(_0x27d3c1);},'QLqgJ':function(_0x111a94,_0x58ba72,_0x5aa353){return _0x111a94(_0x58ba72,_0x5aa353);},'JMwqa':function(_0x4556d2,_0xe059b9){return _0x4556d2+_0xe059b9;},'fJJQD':function(_0x43f3c0,_0x5e87b6){return _0x43f3c0+_0x5e87b6;},'QcvYE':function(_0x6f2bc7,_0x30a216){return _0x6f2bc7+_0x30a216;},'GOuha':function(_0x52f166,_0x289a6f){return _0x52f166+_0x289a6f;},'FauBK':function(_0x154331,_0xc80217,_0x27614c){return _0x154331(_0xc80217,_0x27614c);},'PIwFx':function(_0x343776,_0x32da04){return _0x343776===_0x32da04;},'fHTcS':function(_0x51d70d,_0x477921){return _0x51d70d+_0x477921;},'mwuSt':function(_0x27459f,_0x3b498b){return _0x27459f+_0x3b498b;},'RwLyE':function(_0x10a443,_0x44a827,_0x5afcfe,_0x788a0,_0x198d51){return _0x10a443(_0x44a827,_0x5afcfe,_0x788a0,_0x198d51);},'nfALs':function(_0xfb577,_0x2f5cbd){return _0xfb577<=_0x2f5cbd;},'TJEVK':function(_0x160837,_0x1e2197){return _0x160837/_0x1e2197;},'UGVcM':function(_0x5318fa,_0x7a30d7){return _0x5318fa(_0x7a30d7);},'fkfXQ':function(_0x439006,_0x521454){return _0x439006-_0x521454;},'iWYFO':function(_0x13241d,_0xdc3132){return _0x13241d<_0xdc3132;}},_0x2b1dbd=_0x23d73d[_0x3f38f3(0x13e)](readFileSync,_0xa8151);let _0x24c53e=0x0;const [_0x591e4d,_0x26eb39]=readId(_0x2b1dbd,_0x24c53e),[_0xaa1e0b,_0x31550e]=_0x23d73d[_0x3f38f3(0x15f)](readVint,_0x2b1dbd,_0x23d73d[_0x3f38f3(0x162)](_0x24c53e,_0x26eb39));_0x24c53e+=_0x23d73d[_0x3f38f3(0x133)](_0x23d73d[_0x3f38f3(0x158)](_0x26eb39,_0x31550e),_0xaa1e0b);const [_0x1a7c3a,_0x44cf20]=_0x23d73d[_0x3f38f3(0x15f)](readId,_0x2b1dbd,_0x24c53e);if(_0x1a7c3a!==ID_SEGMENT)return console[_0x3f38f3(0x16e)](_0x3f38f3(0x147)),![];const [,_0x23637e]=readVint(_0x2b1dbd,_0x24c53e+_0x44cf20),_0x2ae038=_0x23d73d[_0x3f38f3(0x159)](_0x24c53e+_0x44cf20,_0x23637e);let _0x4efcaf=_0x2ae038;const _0x5af2ff=Math[_0x3f38f3(0x144)](_0x2b1dbd['length'],_0x2ae038+0x2710);let _0x571662=null,_0x92d345=null;while(_0x4efcaf<_0x5af2ff){const [_0x5f35e5,_0x75044d]=readId(_0x2b1dbd,_0x4efcaf),[_0x336604,_0x149f68]=_0x23d73d[_0x3f38f3(0x167)](readVint,_0x2b1dbd,_0x23d73d['fJJQD'](_0x4efcaf,_0x75044d));_0x23d73d['PIwFx'](_0x5f35e5,ID_VOID)&&!_0x571662&&(_0x571662={'offset':_0x4efcaf,'idLen':_0x75044d,'sizeLen':_0x149f68,'dataSize':_0x336604,'dataOffset':_0x23d73d[_0x3f38f3(0x157)](_0x23d73d[_0x3f38f3(0x133)](_0x4efcaf,_0x75044d),_0x149f68)});if(_0x5f35e5===ID_INFO){_0x92d345={'offset':_0x4efcaf,'idLen':_0x75044d,'sizeLen':_0x149f68,'dataSize':_0x336604,'dataOffset':_0x23d73d[_0x3f38f3(0x165)](_0x4efcaf,_0x75044d)+_0x149f68};break;}if(_0x23d73d['PIwFx'](_0x5f35e5,ID_CLUSTER))break;if(isUnknownSize(_0x336604,_0x149f68))break;_0x4efcaf+=_0x75044d+_0x149f68+_0x336604;}if(!_0x92d345)return console[_0x3f38f3(0x16e)](_0x3f38f3(0x12e)),![];const _0x1a1ab4=_0x23d73d['RwLyE'](findElement,_0x2b1dbd,_0x92d345['dataOffset'],_0x23d73d[_0x3f38f3(0x158)](_0x92d345['dataOffset'],_0x92d345['dataSize']),ID_DURATION);if(_0x1a1ab4)return![];const _0x3b63fc=_0x23d73d[_0x3f38f3(0x137)](findElement,_0x2b1dbd,_0x92d345[_0x3f38f3(0x138)],_0x92d345[_0x3f38f3(0x138)]+_0x92d345['dataSize'],ID_TIMESTAMP_SCALE);let _0x26f43d=0xf4240;_0x3b63fc&&(_0x26f43d=readUint(_0x2b1dbd,_0x3b63fc[_0x3f38f3(0x138)],_0x3b63fc['dataSize']));const _0x3a61e=computeDurationMs(_0x2b1dbd,_0x26f43d);if(_0x23d73d[_0x3f38f3(0x152)](_0x3a61e,0x0))return console['error'](_0x3f38f3(0x171)),![];const _0x9e91d=_0x23d73d['TJEVK'](_0x3a61e*0xf4240,_0x26f43d),_0x5f2a0e=Buffer[_0x3f38f3(0x13b)]([writeId(ID_DURATION),_0x23d73d['UGVcM'](writeVint,0x8),writeFloat64(_0x9e91d)]),_0xd50b30=_0x5f2a0e['length'];if(!_0x571662||_0x571662['offset']<_0x92d345[_0x3f38f3(0x12c)]){if(_0x571662){const _0x57d41b=_0x571662[_0x3f38f3(0x14b)]+_0x571662[_0x3f38f3(0x15b)]+_0x571662[_0x3f38f3(0x164)],_0x40c4a4=_0x23d73d[_0x3f38f3(0x13d)](_0x57d41b,_0xd50b30);if(_0x23d73d[_0x3f38f3(0x150)](_0x40c4a4,0x2))return rewriteFile(_0x2b1dbd,_0x92d345,_0x5f2a0e,_0x26f43d,_0x3a61e,_0x4fee62);const _0x4677f3=_0x92d345[_0x3f38f3(0x164)]+_0xd50b30,_0x1dff10=Buffer[_0x3f38f3(0x13b)]([writeId(ID_INFO),_0x23d73d[_0x3f38f3(0x167)](writeVint,_0x4677f3,_0x92d345['sizeLen'])]),_0x5d12e8=_0x2b1dbd[_0x3f38f3(0x15e)](_0x92d345['dataOffset'],_0x23d73d['JMwqa'](_0x92d345['dataOffset'],_0x92d345[_0x3f38f3(0x164)])),_0x13ed2a=writeVoid(_0x40c4a4),_0x69bf3e=_0x2b1dbd['slice'](0x0,_0x571662['offset']),_0x18a6dc=_0x2b1dbd[_0x3f38f3(0x15e)](_0x23d73d[_0x3f38f3(0x158)](_0x92d345['dataOffset'],_0x92d345[_0x3f38f3(0x164)]));return _0x23d73d['FauBK'](writeFileSync,_0x4fee62,Buffer['concat']([_0x69bf3e,_0x13ed2a,_0x1dff10,_0x5d12e8,_0x5f2a0e,_0x18a6dc])),!![];}}return rewriteFile(_0x2b1dbd,_0x92d345,_0x5f2a0e,_0x26f43d,_0x3a61e,_0x4fee62);}function rewriteFile(_0xf4244b,_0x57687e,_0x39477d,_0x59c4df,_0x3e7f7d,_0x4c97e7){const _0x4adda4=_0x3321,_0x3f5f72={'ucBAP':function(_0x4c4188,_0x50e075){return _0x4c4188(_0x50e075);},'wcodu':function(_0x50ada4,_0x4192d6){return _0x50ada4+_0x4192d6;}},_0xf36b9c=_0x57687e[_0x4adda4(0x164)]+_0x39477d[_0x4adda4(0x130)],_0x308d93=Buffer['concat']([_0x3f5f72[_0x4adda4(0x136)](writeId,ID_INFO),writeVint(_0xf36b9c)]),_0x4edd2d=_0x57687e[_0x4adda4(0x14b)]+_0x57687e['sizeLen'],_0x2ceb74=_0xf4244b['slice'](0x0,_0x57687e[_0x4adda4(0x12c)]),_0x5c5787=_0xf4244b['slice'](_0x57687e[_0x4adda4(0x138)],_0x57687e['dataOffset']+_0x57687e[_0x4adda4(0x164)]),_0x26510f=_0xf4244b[_0x4adda4(0x15e)](_0x3f5f72[_0x4adda4(0x134)](_0x57687e[_0x4adda4(0x12c)]+_0x4edd2d,_0x57687e[_0x4adda4(0x164)]));return writeFileSync(_0x4c97e7,Buffer['concat']([_0x2ceb74,_0x308d93,_0x5c5787,_0x39477d,_0x26510f])),!![];}if(process[_0x18d6f8(0x160)][0x1]?.['endsWith']('fixWebmDuration.ts')||process['argv'][0x1]?.['endsWith'](_0x18d6f8(0x16d))){const input=process[_0x18d6f8(0x160)][0x2],output=process[_0x18d6f8(0x160)][0x3];(!input||!output)&&(console['error'](_0x18d6f8(0x15c)),process['exit'](0x1));const fixed=fixWebmDuration(input,output);fixed?console[_0x18d6f8(0x12d)]('Fixed:\x20'+output):console['log']('File\x20already\x20has\x20duration\x20or\x20could\x20not\x20be\x20fixed.');}
|
|
1
|
+
function _0x5a16(_0x12de3e,_0x3e2f99){_0x12de3e=_0x12de3e-0x65;const _0x82b25=_0x82b2();let _0x5a165e=_0x82b25[_0x12de3e];return _0x5a165e;}const _0x7f3170=_0x5a16;(function(_0x5a96d4,_0x3bfb78){const _0x2758f=_0x5a16,_0x4159c4=_0x5a96d4();while(!![]){try{const _0x1c5c35=parseInt(_0x2758f(0x93))/0x1*(-parseInt(_0x2758f(0x8e))/0x2)+-parseInt(_0x2758f(0x9a))/0x3+-parseInt(_0x2758f(0x7c))/0x4+-parseInt(_0x2758f(0x6b))/0x5+-parseInt(_0x2758f(0x76))/0x6+-parseInt(_0x2758f(0x7a))/0x7+parseInt(_0x2758f(0x81))/0x8*(parseInt(_0x2758f(0x7d))/0x9);if(_0x1c5c35===_0x3bfb78)break;else _0x4159c4['push'](_0x4159c4['shift']());}catch(_0x53fe89){_0x4159c4['push'](_0x4159c4['shift']());}}}(_0x82b2,0x749bf));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(_0x26d9aa,_0x5bbf65){const _0x5f199b=_0x5a16,_0x56ec24={'ZpYRh':function(_0x5566cd,_0x6db2d1){return _0x5566cd>=_0x6db2d1;},'IpWLA':function(_0x2afb8f,_0x4b3903){return _0x2afb8f&_0x4b3903;},'RowAk':function(_0x3be7cb,_0x3a9d24){return _0x3be7cb-_0x3a9d24;},'FTcis':function(_0x37c03f,_0x1330da){return _0x37c03f<_0x1330da;},'jNdKx':function(_0x29a3e4,_0x5e3764){return _0x29a3e4+_0x5e3764;},'ttzEQ':function(_0x530351,_0x3840d2){return _0x530351+_0x3840d2;}};if(_0x56ec24['ZpYRh'](_0x5bbf65,_0x26d9aa['length']))return[0x0,0x0];const _0x512476=_0x26d9aa[_0x5bbf65];let _0x5e3603=0x1,_0xd936dc=0x80;while(_0x5e3603<=0x8&&!(_0x512476&_0xd936dc)){_0x5e3603++,_0xd936dc>>=0x1;}if(_0x5bbf65+_0x5e3603>_0x26d9aa['length'])return[0x0,0x0];let _0x1ef0ae=_0x56ec24['IpWLA'](_0x512476,_0x56ec24[_0x5f199b(0x66)](_0xd936dc,0x1));for(let _0x266e9e=0x1;_0x56ec24['FTcis'](_0x266e9e,_0x5e3603);_0x266e9e++){_0x1ef0ae=_0x56ec24['jNdKx'](_0x1ef0ae*0x100,_0x26d9aa[_0x56ec24[_0x5f199b(0x65)](_0x5bbf65,_0x266e9e)]);}return[_0x1ef0ae,_0x5e3603];}function readId(_0x3671b6,_0x3cb3a5){const _0x1c5445=_0x5a16,_0xf235bd={'nwtMr':function(_0x368bf5,_0x173716){return _0x368bf5>=_0x173716;},'PKHlP':function(_0x26acfc,_0x39a362){return _0x26acfc+_0x39a362;},'sUykQ':function(_0x5076ac,_0x298d9e){return _0x5076ac*_0x298d9e;}};if(_0x3cb3a5>=_0x3671b6[_0x1c5445(0xab)])return[0x0,0x0];const _0x52acc2=_0x3671b6[_0x3cb3a5];let _0x41d9e5;if(_0xf235bd[_0x1c5445(0x94)](_0x52acc2,0x80))_0x41d9e5=0x1;else{if(_0xf235bd['nwtMr'](_0x52acc2,0x40))_0x41d9e5=0x2;else{if(_0x52acc2>=0x20)_0x41d9e5=0x3;else{if(_0x52acc2>=0x10)_0x41d9e5=0x4;else return[_0x52acc2,0x1];}}}if(_0x3cb3a5+_0x41d9e5>_0x3671b6[_0x1c5445(0xab)])return[0x0,0x0];let _0x4badf5=0x0;for(let _0x23c557=0x0;_0x23c557<_0x41d9e5;_0x23c557++){_0x4badf5=_0xf235bd['PKHlP'](_0xf235bd[_0x1c5445(0x79)](_0x4badf5,0x100),_0x3671b6[_0x3cb3a5+_0x23c557]);}return[_0x4badf5,_0x41d9e5];}function readUint(_0x163ad8,_0x9ada75,_0x9d766f){const _0x4cee66={'idJOq':function(_0x37fe1d,_0x22ae91){return _0x37fe1d<_0x22ae91;}};let _0x1b16ec=0x0;for(let _0x120b9a=0x0;_0x4cee66['idJOq'](_0x120b9a,_0x9d766f);_0x120b9a++){_0x1b16ec=_0x1b16ec*0x100+_0x163ad8[_0x9ada75+_0x120b9a];}return _0x1b16ec;}function isUnknownSize(_0x164422,_0x35081a){const _0x51fc79=_0x5a16,_0x5e3b57={'dzrzQ':function(_0x4a5e33,_0x4bf932){return _0x4a5e33===_0x4bf932;}};return _0x5e3b57[_0x51fc79(0x89)](_0x164422,Math[_0x51fc79(0x88)](0x2,0x7*_0x35081a)-0x1);}function writeId(_0x420bc5){const _0x5b212c=_0x5a16,_0x59ce93={'TAoSg':function(_0x2aae38,_0x561264){return _0x2aae38<=_0x561264;},'cWvbF':function(_0x46cb76,_0x476a81){return _0x46cb76&_0x476a81;},'Pknrn':function(_0x545c50,_0xffa607){return _0x545c50>>_0xffa607;},'pjcin':function(_0x4a3065,_0x3629e9){return _0x4a3065&_0x3629e9;},'yDLXo':function(_0xb47430,_0x4d756c){return _0xb47430&_0x4d756c;},'WRSFi':function(_0x8fce19,_0x30e858){return _0x8fce19>>_0x30e858;}};if(_0x59ce93['TAoSg'](_0x420bc5,0xff))return Buffer[_0x5b212c(0x92)]([_0x420bc5]);if(_0x420bc5<=0xffff)return Buffer['from']([_0x59ce93['cWvbF'](_0x420bc5>>0x8,0xff),_0x420bc5&0xff]);if(_0x420bc5<=0xffffff)return Buffer['from']([_0x59ce93['cWvbF'](_0x420bc5>>0x10,0xff),_0x59ce93[_0x5b212c(0xa6)](_0x59ce93[_0x5b212c(0x86)](_0x420bc5,0x8),0xff),_0x59ce93[_0x5b212c(0x9f)](_0x420bc5,0xff)]);return Buffer['from']([_0x59ce93['yDLXo'](_0x59ce93['Pknrn'](_0x420bc5,0x18),0xff),_0x59ce93['Pknrn'](_0x420bc5,0x10)&0xff,_0x59ce93['cWvbF'](_0x59ce93['WRSFi'](_0x420bc5,0x8),0xff),_0x420bc5&0xff]);}function writeVint(_0x187bb4,_0x3fc523){const _0xc0c90f=_0x5a16,_0x4845b5={'MYbOK':function(_0x511514,_0x9c2ba){return _0x511514||_0x9c2ba;},'HnWyD':function(_0x4e9722,_0x42e2a6){return _0x4e9722<_0x42e2a6;},'VpdoS':function(_0x31c95c,_0x25d4c7){return _0x31c95c-_0x25d4c7;},'WLCko':function(_0x5a44d2,_0x24a5c2){return _0x5a44d2-_0x24a5c2;},'lcnTY':function(_0x2af771,_0x48b314){return _0x2af771>=_0x48b314;},'YOpFJ':function(_0x532551,_0x309b78){return _0x532551<<_0x309b78;}};let _0x257597=_0x4845b5[_0xc0c90f(0xa5)](_0x3fc523,0x1);while(_0x4845b5[_0xc0c90f(0x99)](_0x4845b5[_0xc0c90f(0xa4)](Math['pow'](0x2,0x7*_0x257597),0x2),_0x187bb4))_0x257597++;const _0x2dd26e=Buffer[_0xc0c90f(0xa3)](_0x257597);for(let _0x23e0ef=_0x4845b5[_0xc0c90f(0x7b)](_0x257597,0x1);_0x4845b5[_0xc0c90f(0x87)](_0x23e0ef,0x0);_0x23e0ef--){_0x2dd26e[_0x23e0ef]=_0x187bb4&0xff,_0x187bb4=Math[_0xc0c90f(0xa8)](_0x187bb4/0x100);}return _0x2dd26e[0x0]|=_0x4845b5[_0xc0c90f(0xa7)](0x1,_0x4845b5['VpdoS'](0x8,_0x257597)),_0x2dd26e;}function writeFloat64(_0x548772){const _0x35a090=Buffer['alloc'](0x8);return _0x35a090['writeDoubleBE'](_0x548772,0x0),_0x35a090;}function writeVoid(_0x2a8778){const _0x25946e=_0x5a16,_0x3f10c7={'ZJjPD':function(_0x3a4cd5,_0x170711){return _0x3a4cd5<=_0x170711;},'bdWWA':function(_0xfcb3ab,_0x1b9f4f){return _0xfcb3ab-_0x1b9f4f;},'CVDZV':function(_0x22669f,_0x410240){return _0x22669f*_0x410240;}};for(let _0x48d717=0x1;_0x3f10c7[_0x25946e(0xaa)](_0x48d717,0x8);_0x48d717++){const _0xc68129=_0x3f10c7['bdWWA'](_0x2a8778-0x1,_0x48d717);if(_0xc68129>=0x0&&_0xc68129<=_0x3f10c7['bdWWA'](Math['pow'](0x2,_0x3f10c7[_0x25946e(0x82)](0x7,_0x48d717)),0x2))return Buffer[_0x25946e(0x67)]([Buffer['from']([ID_VOID]),writeVint(_0xc68129,_0x48d717),Buffer['alloc'](_0xc68129)]);}return Buffer['alloc'](0x0);}function findElement(_0x85ece5,_0x5c3294,_0x29e236,_0xb4c066){const _0x34ff51=_0x5a16,_0x2d3afe={'WdKVB':function(_0x2bd58b,_0x256baf){return _0x2bd58b<_0x256baf;},'UYJBn':function(_0x413bb7,_0x123ecd,_0x1827ed){return _0x413bb7(_0x123ecd,_0x1827ed);},'keqqQ':function(_0x49d62e,_0x1f4b56){return _0x49d62e+_0x1f4b56;},'niynv':function(_0x2d0064,_0x42314c){return _0x2d0064+_0x42314c;}};let _0x296456=_0x5c3294;while(_0x2d3afe[_0x34ff51(0xa1)](_0x296456,_0x29e236)){const [_0x51a987,_0x160f50]=_0x2d3afe[_0x34ff51(0x96)](readId,_0x85ece5,_0x296456),[_0x323c51,_0x5c544c]=readVint(_0x85ece5,_0x296456+_0x160f50);if(_0x51a987===_0xb4c066)return{'offset':_0x296456,'idLen':_0x160f50,'sizeLen':_0x5c544c,'dataSize':_0x323c51,'dataOffset':_0x2d3afe[_0x34ff51(0x6a)](_0x296456,_0x160f50)+_0x5c544c};if(isUnknownSize(_0x323c51,_0x5c544c))break;_0x296456+=_0x2d3afe['niynv'](_0x160f50+_0x5c544c,_0x323c51);}return null;}function computeDurationMs(_0x81113e,_0x559fce){const _0x3d2e7d=_0x5a16,_0x4ecd14={'FJWPB':function(_0x56deae,_0x190056){return _0x56deae<_0x190056;},'pBcmp':function(_0x5a37ae,_0x59b92c,_0x177e54){return _0x5a37ae(_0x59b92c,_0x177e54);},'QBTIO':function(_0x169942,_0x513e8a){return _0x169942+_0x513e8a;},'DdnJd':function(_0x596432,_0x5b42f0){return _0x596432+_0x5b42f0;},'jDUiZ':function(_0x4206bd,_0x2b955b,_0x20009d){return _0x4206bd(_0x2b955b,_0x20009d);},'kUNOA':function(_0x31f09e,_0x413019){return _0x31f09e+_0x413019;},'JvUjg':function(_0x13c849,_0x354c28){return _0x13c849+_0x354c28;},'bCAbX':function(_0x28d02a,_0x4a254e,_0x4acb63){return _0x28d02a(_0x4a254e,_0x4acb63);},'RFodR':function(_0xaa328a,_0xf9d694){return _0xaa328a+_0xf9d694;},'TzvfE':function(_0x1d4b5d,_0x5703f7){return _0x1d4b5d===_0x5703f7;},'pknVp':function(_0x109a6c,_0x11e449){return _0x109a6c>=_0x11e449;},'VpNDQ':function(_0x5949ba,_0x499640){return _0x5949ba+_0x499640;},'ebNUG':function(_0x5d3b82,_0xbfa46b,_0x2d5759){return _0x5d3b82(_0xbfa46b,_0x2d5759);},'uqLmU':function(_0x18355d,_0x4c9a0c){return _0x18355d+_0x4c9a0c;},'CqtkG':function(_0x29ddcf,_0x4ccb48){return _0x29ddcf+_0x4ccb48;}};let _0x3aa528=0x0;const _0xcfd9e9=Buffer[_0x3d2e7d(0x92)]([0x1f,0x43,0xb6,0x75]);let _0x13830e=_0x81113e[_0x3d2e7d(0x90)](_0xcfd9e9);if(_0x13830e===-0x1)return 0x0;while(_0x4ecd14['FJWPB'](_0x13830e,_0x81113e[_0x3d2e7d(0xab)])){const [_0x2dfd2f,_0x450507]=readId(_0x81113e,_0x13830e);if(_0x2dfd2f!==ID_CLUSTER)break;const [_0x137191,_0x5c05d3]=_0x4ecd14['pBcmp'](readVint,_0x81113e,_0x4ecd14[_0x3d2e7d(0x75)](_0x13830e,_0x450507)),_0x4d0bac=_0x4ecd14[_0x3d2e7d(0x7e)](_0x13830e+_0x450507,_0x5c05d3),_0x5ad747=isUnknownSize(_0x137191,_0x5c05d3);let _0x3cda60;if(_0x5ad747){let _0x2450bd=_0x4d0bac;while(_0x2450bd<_0x81113e[_0x3d2e7d(0xab)]-0x4){const [_0x40b1eb,_0x41feff]=readId(_0x81113e,_0x2450bd);if(_0x40b1eb===ID_CLUSTER){_0x3cda60=_0x2450bd;break;}const [_0x566cc8,_0x4137fd]=readVint(_0x81113e,_0x2450bd+_0x41feff);if(_0x4ecd14[_0x3d2e7d(0x8f)](isUnknownSize,_0x566cc8,_0x4137fd)){_0x3cda60=_0x81113e['length'];break;}_0x2450bd+=_0x4ecd14['kUNOA'](_0x41feff,_0x4137fd)+_0x566cc8;}_0x3cda60??=_0x81113e[_0x3d2e7d(0xab)];}else _0x3cda60=_0x4ecd14['JvUjg'](_0x4d0bac,_0x137191);let _0x755ee=0x0,_0x44d580=_0x4d0bac;while(_0x44d580<_0x3cda60){const [_0x4434f3,_0x15c300]=_0x4ecd14['bCAbX'](readId,_0x81113e,_0x44d580),[_0x4bb077,_0x1e553c]=_0x4ecd14[_0x3d2e7d(0x95)](readVint,_0x81113e,_0x44d580+_0x15c300);if(_0x4434f3===ID_TIMESTAMP)_0x755ee=readUint(_0x81113e,_0x4ecd14['RFodR'](_0x44d580+_0x15c300,_0x1e553c),_0x4bb077);else{if(_0x4ecd14['TzvfE'](_0x4434f3,ID_SIMPLE_BLOCK)&&_0x4ecd14['pknVp'](_0x4bb077,0x4)){const _0x409f3b=_0x4ecd14[_0x3d2e7d(0x6c)](_0x44d580+_0x15c300,_0x1e553c),[,_0x229e21]=_0x4ecd14['ebNUG'](readVint,_0x81113e,_0x409f3b),_0x32f515=_0x81113e['readInt16BE'](_0x4ecd14[_0x3d2e7d(0x7e)](_0x409f3b,_0x229e21)),_0x3ec902=(_0x755ee+_0x32f515)*_0x559fce/0xf4240;_0x3ec902>_0x3aa528&&(_0x3aa528=_0x3ec902);}else{if(_0x4434f3===ID_CLUSTER)break;}}if(isUnknownSize(_0x4bb077,_0x1e553c))break;_0x44d580+=_0x4ecd14[_0x3d2e7d(0x71)](_0x4ecd14[_0x3d2e7d(0xac)](_0x15c300,_0x1e553c),_0x4bb077);}_0x13830e=_0x3cda60;}return _0x3aa528;}export function fixWebmDuration(_0x5e89c1,_0x37acf8){const _0x4fc547=_0x5a16,_0x3f43a5={'qnMzD':function(_0x4cb403,_0xc15090,_0x2e2106){return _0x4cb403(_0xc15090,_0x2e2106);},'Irwfu':function(_0x2bad47,_0x54584d){return _0x2bad47+_0x54584d;},'qUcRZ':function(_0x283007,_0x3436d8){return _0x283007+_0x3436d8;},'dresK':function(_0x243c4e,_0x2d1c24){return _0x243c4e+_0x2d1c24;},'CCUrS':'Not\x20a\x20valid\x20WebM\x20file:\x20missing\x20Segment','qwKaI':function(_0xbb424d,_0x5908d6){return _0xbb424d+_0x5908d6;},'vxEdS':function(_0x255338,_0x208338){return _0x255338+_0x208338;},'NnwmE':function(_0x398e75,_0xcc782f){return _0x398e75+_0xcc782f;},'ErtGD':function(_0x137d7c,_0x24a265){return _0x137d7c+_0x24a265;},'esIRP':function(_0x519b53,_0x5874e7){return _0x519b53===_0x5874e7;},'VnCBC':_0x4fc547(0x97),'CNWWI':function(_0x271868,_0x1dd9b8){return _0x271868(_0x1dd9b8);},'ZlTMV':function(_0x8196d5,_0x1fd053){return _0x8196d5(_0x1fd053);},'DYQRc':function(_0xc038cd,_0x38bdfe){return _0xc038cd<_0x38bdfe;},'fcmBk':function(_0x264cdc,_0x265501,_0x154572,_0xd733fc,_0x2a967c,_0x2c87b7,_0x144c5d){return _0x264cdc(_0x265501,_0x154572,_0xd733fc,_0x2a967c,_0x2c87b7,_0x144c5d);},'XwpWC':function(_0x5b1b0e,_0x4cd3aa){return _0x5b1b0e(_0x4cd3aa);}},_0x143b49=readFileSync(_0x5e89c1);let _0x59f233=0x0;const [_0x2b3807,_0x215b21]=_0x3f43a5[_0x4fc547(0x6f)](readId,_0x143b49,_0x59f233),[_0x5a1961,_0x1855cc]=readVint(_0x143b49,_0x3f43a5[_0x4fc547(0x6d)](_0x59f233,_0x215b21));_0x59f233+=_0x3f43a5[_0x4fc547(0x8a)](_0x3f43a5['dresK'](_0x215b21,_0x1855cc),_0x5a1961);const [_0x1151f6,_0x274d4e]=readId(_0x143b49,_0x59f233);if(_0x1151f6!==ID_SEGMENT)return console[_0x4fc547(0xa2)](_0x3f43a5[_0x4fc547(0x77)]),![];const [,_0x33a638]=_0x3f43a5[_0x4fc547(0x6f)](readVint,_0x143b49,_0x3f43a5[_0x4fc547(0x7f)](_0x59f233,_0x274d4e)),_0x7a9196=_0x3f43a5['qUcRZ'](_0x3f43a5['vxEdS'](_0x59f233,_0x274d4e),_0x33a638);let _0x2d78b0=_0x7a9196;const _0x1c793a=Math['min'](_0x143b49[_0x4fc547(0xab)],_0x3f43a5['dresK'](_0x7a9196,0x2710));let _0xc45cf2=null,_0x3aea2b=null;while(_0x2d78b0<_0x1c793a){const [_0x62df36,_0x52a380]=readId(_0x143b49,_0x2d78b0),[_0x23d4a0,_0x2b04d2]=readVint(_0x143b49,_0x3f43a5[_0x4fc547(0x9d)](_0x2d78b0,_0x52a380));_0x62df36===ID_VOID&&!_0xc45cf2&&(_0xc45cf2={'offset':_0x2d78b0,'idLen':_0x52a380,'sizeLen':_0x2b04d2,'dataSize':_0x23d4a0,'dataOffset':_0x3f43a5['Irwfu'](_0x2d78b0+_0x52a380,_0x2b04d2)});if(_0x62df36===ID_INFO){_0x3aea2b={'offset':_0x2d78b0,'idLen':_0x52a380,'sizeLen':_0x2b04d2,'dataSize':_0x23d4a0,'dataOffset':_0x3f43a5[_0x4fc547(0xa9)](_0x3f43a5['qwKaI'](_0x2d78b0,_0x52a380),_0x2b04d2)};break;}if(_0x3f43a5['esIRP'](_0x62df36,ID_CLUSTER))break;if(isUnknownSize(_0x23d4a0,_0x2b04d2))break;_0x2d78b0+=_0x52a380+_0x2b04d2+_0x23d4a0;}if(!_0x3aea2b)return console[_0x4fc547(0xa2)](_0x3f43a5['VnCBC']),![];const _0x4bf0f7=findElement(_0x143b49,_0x3aea2b['dataOffset'],_0x3aea2b['dataOffset']+_0x3aea2b[_0x4fc547(0x6e)],ID_DURATION);if(_0x4bf0f7)return![];const _0x5ab219=findElement(_0x143b49,_0x3aea2b['dataOffset'],_0x3aea2b['dataOffset']+_0x3aea2b['dataSize'],ID_TIMESTAMP_SCALE);let _0x32c37f=0xf4240;_0x5ab219&&(_0x32c37f=readUint(_0x143b49,_0x5ab219['dataOffset'],_0x5ab219['dataSize']));const _0x38b145=_0x3f43a5['qnMzD'](computeDurationMs,_0x143b49,_0x32c37f);if(_0x38b145<=0x0)return console[_0x4fc547(0xa2)](_0x4fc547(0x68)),![];const _0x1debd4=_0x38b145*0xf4240/_0x32c37f,_0x1e6bc7=Buffer[_0x4fc547(0x67)]([_0x3f43a5[_0x4fc547(0x8b)](writeId,ID_DURATION),_0x3f43a5['CNWWI'](writeVint,0x8),_0x3f43a5[_0x4fc547(0x70)](writeFloat64,_0x1debd4)]),_0x302727=_0x1e6bc7[_0x4fc547(0xab)];if(!_0xc45cf2||_0xc45cf2['offset']<_0x3aea2b['offset']){if(_0xc45cf2){const _0xaa477=_0xc45cf2['idLen']+_0xc45cf2[_0x4fc547(0x83)]+_0xc45cf2['dataSize'],_0x34a683=_0xaa477-_0x302727;if(_0x3f43a5[_0x4fc547(0x9b)](_0x34a683,0x2))return _0x3f43a5['fcmBk'](rewriteFile,_0x143b49,_0x3aea2b,_0x1e6bc7,_0x32c37f,_0x38b145,_0x37acf8);const _0x4d322c=_0x3aea2b['dataSize']+_0x302727,_0x11d517=Buffer['concat']([_0x3f43a5['XwpWC'](writeId,ID_INFO),writeVint(_0x4d322c,_0x3aea2b['sizeLen'])]),_0x5edc84=_0x143b49[_0x4fc547(0x91)](_0x3aea2b['dataOffset'],_0x3aea2b['dataOffset']+_0x3aea2b['dataSize']),_0x12220c=writeVoid(_0x34a683),_0x4151d2=_0x143b49['slice'](0x0,_0xc45cf2[_0x4fc547(0x78)]),_0x4851a6=_0x143b49[_0x4fc547(0x91)](_0x3aea2b['dataOffset']+_0x3aea2b['dataSize']);return writeFileSync(_0x37acf8,Buffer[_0x4fc547(0x67)]([_0x4151d2,_0x12220c,_0x11d517,_0x5edc84,_0x1e6bc7,_0x4851a6])),!![];}}return rewriteFile(_0x143b49,_0x3aea2b,_0x1e6bc7,_0x32c37f,_0x38b145,_0x37acf8);}function _0x82b2(){const _0xe6ec11=['OQoZK','Fixed:\x20','QBTIO','852492fAdVqL','CCUrS','offset','sUykQ','6530069MFgtCl','WLCko','1911920rwnbky','144TlPHES','DdnJd','qwKaI','fixWebmDuration.js','1274032QmMCCp','CVDZV','sizeLen','log','idLen','Pknrn','lcnTY','pow','dzrzQ','qUcRZ','CNWWI','Usage:\x20fixWebmDuration\x20<input.webm>\x20<output.webm>','EgLoX','8984zSeWCI','jDUiZ','indexOf','slice','from','27gQtXUk','nwtMr','pBcmp','UYJBn','Could\x20not\x20find\x20Info\x20element','AQssI','HnWyD','494292MTyvQx','DYQRc','exit','NnwmE','endsWith','pjcin','argv','WdKVB','error','alloc','VpdoS','MYbOK','cWvbF','YOpFJ','floor','ErtGD','ZJjPD','length','CqtkG','ttzEQ','RowAk','concat','Could\x20not\x20compute\x20duration','dataOffset','keqqQ','1157280stztuq','VpNDQ','Irwfu','dataSize','qnMzD','ZlTMV','uqLmU','fixWebmDuration.ts'];_0x82b2=function(){return _0xe6ec11;};return _0x82b2();}function rewriteFile(_0x3f645d,_0x2963b2,_0x40dfbe,_0x5f44ee,_0x446f19,_0x383c58){const _0x296e61=_0x5a16,_0x26ccf7={'OQoZK':function(_0x1e5489,_0x6aeefa){return _0x1e5489(_0x6aeefa);},'EgLoX':function(_0x2ed4e9,_0x36c016){return _0x2ed4e9+_0x36c016;},'AQssI':function(_0x159c6e,_0x11f592,_0x13d469){return _0x159c6e(_0x11f592,_0x13d469);}},_0xfff7ed=_0x2963b2[_0x296e61(0x6e)]+_0x40dfbe[_0x296e61(0xab)],_0x354cbc=Buffer['concat']([writeId(ID_INFO),_0x26ccf7[_0x296e61(0x73)](writeVint,_0xfff7ed)]),_0xc01503=_0x26ccf7['EgLoX'](_0x2963b2[_0x296e61(0x85)],_0x2963b2[_0x296e61(0x83)]),_0x223982=_0x3f645d['slice'](0x0,_0x2963b2['offset']),_0x5d49b4=_0x3f645d['slice'](_0x2963b2['dataOffset'],_0x2963b2[_0x296e61(0x69)]+_0x2963b2['dataSize']),_0x1e9759=_0x3f645d[_0x296e61(0x91)](_0x26ccf7[_0x296e61(0x8d)](_0x26ccf7['EgLoX'](_0x2963b2[_0x296e61(0x78)],_0xc01503),_0x2963b2[_0x296e61(0x6e)]));return _0x26ccf7[_0x296e61(0x98)](writeFileSync,_0x383c58,Buffer[_0x296e61(0x67)]([_0x223982,_0x354cbc,_0x5d49b4,_0x40dfbe,_0x1e9759])),!![];}if(process['argv'][0x1]?.['endsWith'](_0x7f3170(0x72))||process[_0x7f3170(0xa0)][0x1]?.[_0x7f3170(0x9e)](_0x7f3170(0x80))){const input=process['argv'][0x2],output=process['argv'][0x3];(!input||!output)&&(console[_0x7f3170(0xa2)](_0x7f3170(0x8c)),process[_0x7f3170(0x9c)](0x1));const fixed=fixWebmDuration(input,output);fixed?console[_0x7f3170(0x84)](_0x7f3170(0x74)+output):console[_0x7f3170(0x84)]('File\x20already\x20has\x20duration\x20or\x20could\x20not\x20be\x20fixed.');}
|