@flosum/cli 0.0.1 → 0.0.2
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/dist/cli.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const a0_0x2cdf9a=a0_0x21da;(function(_0x32ebb2,_0x53aae9){const _0x4317dd=a0_0x21da,_0x4405c8=_0x32ebb2();while(!![]){try{const _0x123dda=parseInt(_0x4317dd(0xc8))/0x1*(-parseInt(_0x4317dd(0x197))/0x2)+-parseInt(_0x4317dd(0x19f))/0x3*(-parseInt(_0x4317dd(0x159))/0x4)+parseInt(_0x4317dd(0x1ed))/0x5*(-parseInt(_0x4317dd(0x157))/0x6)+parseInt(_0x4317dd(0xd3))/0x7*(parseInt(_0x4317dd(0x220))/0x8)+parseInt(_0x4317dd(0x1a3))/0x9+parseInt(_0x4317dd(0xd2))/0xa*(parseInt(_0x4317dd(0xe1))/0xb)+parseInt(_0x4317dd(0x133))/0xc*(-parseInt(_0x4317dd(0x200))/0xd);if(_0x123dda===_0x53aae9)break;else _0x4405c8['push'](_0x4405c8['shift']());}catch(_0x3548d6){_0x4405c8['push'](_0x4405c8['shift']());}}}(a0_0x173a,0x3b9c2));const a0_0x433cef=(function(){let _0x2dec95=!![];return function(_0x5a91d7,_0x219766){const _0x560a4e=_0x2dec95?function(){const _0x344cf1=a0_0x21da;if(_0x219766){const _0xa18fff=_0x219766[_0x344cf1(0x1ec)](_0x5a91d7,arguments);return _0x219766=null,_0xa18fff;}}:function(){};return _0x2dec95=![],_0x560a4e;};}()),a0_0x269aa1=a0_0x433cef(this,function(){const _0x5a2344=a0_0x21da;return a0_0x269aa1['toString']()['search']('(((.+)+)+)+$')[_0x5a2344(0x20a)]()['constructor'](a0_0x269aa1)[_0x5a2344(0x132)]('(((.+)+)+)+$');});a0_0x269aa1();'use strict';var node_path=require(a0_0x2cdf9a(0x1d5)),commander=require('commander'),promises=require(a0_0x2cdf9a(0xec)),node_os=require('node:os'),axios=require('axios'),salesforce=require('@flosum/salesforce'),node_crypto=require(a0_0x2cdf9a(0x1ca)),readline=require(a0_0x2cdf9a(0x1c1)),debug=require(a0_0x2cdf9a(0x170)),table=require('table'),path=require(a0_0x2cdf9a(0x16e)),version='0.0.1',config={'version':version};const ROOT_NAME=a0_0x2cdf9a(0x175),DEFAULT_ALIAS_NAME=a0_0x2cdf9a(0xc2);class FileUtils{static async[a0_0x2cdf9a(0x19d)](_0x3d90e4){const _0x75b490=a0_0x2cdf9a,_0x455c22=await promises[_0x75b490(0xd9)](_0x3d90e4,{'withFileTypes':!![]}),_0x39d1c0=[];for(const _0x8893a of _0x455c22){const _0x557104=node_path[_0x75b490(0x11b)](_0x3d90e4,_0x8893a[_0x75b490(0x127)]);if(_0x8893a['isDirectory']()){const _0x208f0d=await FileUtils[_0x75b490(0x19d)](_0x557104);_0x39d1c0[_0x75b490(0x10e)](_0x208f0d);continue;}_0x39d1c0[_0x75b490(0x10e)](_0x557104);}return _0x39d1c0[_0x75b490(0xc5)]();}static async['cleanUpEmptyFolders'](_0x5f2832,_0x265fef=!![]){const _0x39d642=a0_0x2cdf9a,_0x233169=await promises[_0x39d642(0xd9)](_0x5f2832,{'withFileTypes':!![]});let _0x48747e=!![];for(const _0x496b92 of _0x233169){const _0x303e43=node_path[_0x39d642(0x11b)](_0x5f2832,_0x496b92[_0x39d642(0x127)]);if(_0x496b92[_0x39d642(0x135)]()){const _0x1565b0=await FileUtils[_0x39d642(0xfe)](_0x303e43);!_0x1565b0&&(_0x48747e=![]);}else _0x48747e=![];}return _0x265fef&&_0x48747e&&await promises[_0x39d642(0x1c8)](_0x5f2832),_0x48747e;}static async[a0_0x2cdf9a(0x178)](_0x2f7d9e){const _0x49afd4=a0_0x2cdf9a;return promises[_0x49afd4(0x137)](_0x2f7d9e)[_0x49afd4(0x103)](async _0x2df1c4=>{const _0x5bd653=_0x49afd4;return await promises[_0x5bd653(0x15d)](_0x2f7d9e,promises['constants']['R_OK']|promises[_0x5bd653(0x210)][_0x5bd653(0x16b)]),_0x2df1c4[_0x5bd653(0x135)]();})[_0x49afd4(0x12d)](()=>![]);}static async[a0_0x2cdf9a(0x1c0)](_0x483450){const _0x218768=a0_0x2cdf9a;return promises[_0x218768(0x137)](_0x483450)[_0x218768(0x103)](async _0x3c1859=>{const _0x2e2fc2=_0x218768;return await promises[_0x2e2fc2(0x15d)](_0x483450,promises['constants'][_0x2e2fc2(0x184)]|promises[_0x2e2fc2(0x210)][_0x2e2fc2(0x16b)]),_0x3c1859[_0x2e2fc2(0x223)]();})[_0x218768(0x12d)](()=>![]);}}const SYSTEM_FOLDER$1='.'+ROOT_NAME,CREDENTIALS_FILE_NAME=a0_0x2cdf9a(0x107);class CredentialsManager{static async['save'](_0x471ce9){const _0xcff1ad=a0_0x2cdf9a,_0x6ed0ae=node_path[_0xcff1ad(0x11b)](node_os[_0xcff1ad(0x151)](),SYSTEM_FOLDER$1);await promises[_0xcff1ad(0x17d)](_0x6ed0ae,{'recursive':!![]});const _0x59cbe5=node_path[_0xcff1ad(0x11b)](_0x6ed0ae,CREDENTIALS_FILE_NAME),_0x3c8d49=await CredentialsManager[_0xcff1ad(0x11d)](_0x59cbe5),_0x5f5705=_0x3c8d49['find'](({alias:_0x1f85b5})=>_0x1f85b5===_0x471ce9[_0xcff1ad(0x196)]);!_0x5f5705?_0x3c8d49[_0xcff1ad(0x10e)](_0x471ce9):(_0x5f5705[_0xcff1ad(0xbd)]=_0x471ce9['accessToken'],_0x5f5705['globalSettingsUrl']=_0x471ce9[_0xcff1ad(0x153)],_0x5f5705[_0xcff1ad(0x143)]=_0x471ce9[_0xcff1ad(0x143)]),await promises[_0xcff1ad(0x181)](_0x59cbe5,Buffer[_0xcff1ad(0x213)](JSON['stringify'](_0x3c8d49)));}static async[a0_0x2cdf9a(0x231)]({alias:_0x2c1623}){const _0x568db2=a0_0x2cdf9a,_0x74e8cc=node_path[_0x568db2(0x11b)](node_os[_0x568db2(0x151)](),SYSTEM_FOLDER$1,CREDENTIALS_FILE_NAME),_0x381708=await CredentialsManager[_0x568db2(0x11d)](_0x74e8cc),_0x4406eb=_0x381708[_0x568db2(0x117)](_0x1ba570=>_0x1ba570[_0x568db2(0x196)]===_0x2c1623);if(!_0x4406eb)throw new Error(_0x568db2(0x149)+_0x2c1623+_0x568db2(0x172));return _0x4406eb;}static async[a0_0x2cdf9a(0x201)](){const _0x36d2f1=a0_0x2cdf9a,_0x5ae0e0=node_path[_0x36d2f1(0x11b)](node_os[_0x36d2f1(0x151)](),SYSTEM_FOLDER$1,CREDENTIALS_FILE_NAME),_0x3eef43=await CredentialsManager[_0x36d2f1(0x11d)](_0x5ae0e0);return _0x3eef43;}static async['getAllCredentials'](_0x2d7248){const _0x3d8130=a0_0x2cdf9a,_0x58fe2f=await FileUtils[_0x3d8130(0x1c0)](_0x2d7248);if(_0x58fe2f){const _0x186fca=await promises[_0x3d8130(0x13b)](_0x2d7248);return JSON[_0x3d8130(0x14f)](_0x186fca[_0x3d8130(0x20a)]());}return[];}static async['delete']({alias:_0x15ea9a}){const _0x404cb8=a0_0x2cdf9a,_0x1a6c4c=node_path[_0x404cb8(0x11b)](node_os[_0x404cb8(0x151)](),SYSTEM_FOLDER$1,CREDENTIALS_FILE_NAME),_0x2cda3f=await CredentialsManager[_0x404cb8(0x11d)](_0x1a6c4c),_0x1bb732=_0x2cda3f[_0x404cb8(0xef)](_0x106b77=>_0x106b77[_0x404cb8(0x196)]===_0x15ea9a);if(_0x1bb732<0x0)throw new Error('Credentials\x20with\x20alias\x20\x22'+_0x15ea9a+_0x404cb8(0x172));_0x2cda3f[_0x404cb8(0x1d7)](_0x1bb732,0x1),await promises[_0x404cb8(0x181)](_0x1a6c4c,Buffer[_0x404cb8(0x213)](JSON[_0x404cb8(0x192)](_0x2cda3f)));}}class CommitAction{['accessToken'];['devopsUrl'];[a0_0x2cdf9a(0x1b7)];[a0_0x2cdf9a(0x1fb)];[a0_0x2cdf9a(0xe2)];[a0_0x2cdf9a(0x1fe)];['commitDate']=new Date();constructor(_0x2d2490){const _0x2c543c=a0_0x2cdf9a;this[_0x2c543c(0xbd)]=_0x2d2490['accessToken'],this['devopsUrl']=_0x2d2490['devopsUrl'],this[_0x2c543c(0x1b7)]=_0x2d2490['message'],this[_0x2c543c(0x1fb)]=_0x2d2490['branchId'],this[_0x2c543c(0xe2)]=_0x2d2490[_0x2c543c(0xe2)],this[_0x2c543c(0x1fe)]=_0x2d2490[_0x2c543c(0x1fe)];}async[a0_0x2cdf9a(0x20c)](){const _0x4a3db6=a0_0x2cdf9a;try{const _0x18e085=await Promise[_0x4a3db6(0xe5)](this[_0x4a3db6(0xe2)][_0x4a3db6(0xf3)](async _0x4b11ed=>await this['convertToCommit'](_0x4b11ed))),{data:_0x5c3b9b}=await axios[_0x4a3db6(0x1a5)](_0x4a3db6(0x18c)+this[_0x4a3db6(0x1fb)]+_0x4a3db6(0xe7),{'message':this[_0x4a3db6(0x1b7)],'components':_0x18e085},{'headers':{'authorization':_0x4a3db6(0x11a)+this[_0x4a3db6(0xbd)]},'baseURL':this['devopsUrl']});return _0x5c3b9b;}catch(_0x4a5f50){if(axios['isAxiosError'](_0x4a5f50))throw Error(_0x4a5f50[_0x4a3db6(0x11c)]?.['data'][_0x4a3db6(0x1b7)]||_0x4a5f50[_0x4a3db6(0x11c)]?.[_0x4a3db6(0x11f)]||_0x4a5f50[_0x4a3db6(0x1b7)],{'cause':_0x4a5f50});throw _0x4a5f50;}}async['convertToCommit'](_0x3ab385){const _0xc294c5=a0_0x2cdf9a,_0xe672ab=[];for(const {path:_0x4f219c,localPath:_0x1e8c77}of _0x3ab385[_0xc294c5(0xe6)]){_0xe672ab[_0xc294c5(0x10e)](promises[_0xc294c5(0x13b)](_0x1e8c77)['then'](_0x295622=>({'path':_0x4f219c,'content':_0x295622[_0xc294c5(0x20a)](_0xc294c5(0x173))})));}const _0x442b27=await Promise[_0xc294c5(0xe5)](_0xe672ab);return{'name':_0x3ab385[_0xc294c5(0x127)],'type':_0x3ab385[_0xc294c5(0xd5)],'sourceName':_0xc294c5(0xc3),'sourceType':_0xc294c5(0xc3),'externalUpdatedAt':this[_0xc294c5(0x16f)],'externalUpdatedBy':this['userName'],'files':_0x442b27};}}class CreateBranchAction{[a0_0x2cdf9a(0xbd)];[a0_0x2cdf9a(0x143)];constructor(_0x1b8929){const _0x2a2b76=a0_0x2cdf9a;this['accessToken']=_0x1b8929['accessToken'],this[_0x2a2b76(0x143)]=_0x1b8929[_0x2a2b76(0x143)];}async[a0_0x2cdf9a(0x20c)](_0x276050){const _0xd1ec41=a0_0x2cdf9a;try{const {data:_0x2b0299}=await axios['post'](_0xd1ec41(0x1a8),{..._0x276050},{'headers':{'authorization':_0xd1ec41(0x11a)+this['accessToken']},'baseURL':this[_0xd1ec41(0x143)]});return _0x2b0299;}catch(_0xcd6536){if(axios['isAxiosError'](_0xcd6536))throw Error(_0xcd6536['response']?.[_0xd1ec41(0x164)][_0xd1ec41(0x1b7)]||_0xcd6536[_0xd1ec41(0x11c)]?.['statusText']||_0xcd6536[_0xd1ec41(0x1b7)],{'cause':_0xcd6536});throw _0xcd6536;}}}class GetBranchAction{[a0_0x2cdf9a(0xbd)];[a0_0x2cdf9a(0x143)];constructor(_0x5306da){const _0x4d8176=a0_0x2cdf9a;this[_0x4d8176(0xbd)]=_0x5306da[_0x4d8176(0xbd)],this['devopsUrl']=_0x5306da[_0x4d8176(0x143)];}async[a0_0x2cdf9a(0x20c)](_0xe58707){const _0x4711b5=a0_0x2cdf9a;try{const {data:_0x3bf262}=await axios[_0x4711b5(0x231)](_0x4711b5(0x18c)+_0xe58707[_0x4711b5(0x1fb)],{'headers':{'authorization':_0x4711b5(0x11a)+this[_0x4711b5(0xbd)]},'baseURL':this[_0x4711b5(0x143)]});return _0x3bf262;}catch(_0x239500){if(axios[_0x4711b5(0x23b)](_0x239500))throw Error(_0x239500[_0x4711b5(0x11c)]?.[_0x4711b5(0x164)][_0x4711b5(0x1b7)]||_0x239500['response']?.[_0x4711b5(0x11f)]||_0x239500['message'],{'cause':_0x239500});throw _0x239500;}}}class GetDefaultBranchAction{['devopsUrl'];[a0_0x2cdf9a(0xbd)];constructor(_0x367a70){const _0x7b9109=a0_0x2cdf9a;this[_0x7b9109(0x143)]=_0x367a70['devopsUrl'],this['accessToken']=_0x367a70['accessToken'];}async[a0_0x2cdf9a(0x20c)](){const _0x4f35d2=a0_0x2cdf9a;try{const {data:_0x173168}=await axios[_0x4f35d2(0x231)]('fit/branches/default',{'headers':{'authorization':_0x4f35d2(0x11a)+this[_0x4f35d2(0xbd)]},'baseURL':this[_0x4f35d2(0x143)]});return _0x173168;}catch(_0x1ea612){if(axios['isAxiosError'](_0x1ea612))throw Error(_0x1ea612[_0x4f35d2(0x11c)]?.[_0x4f35d2(0x164)][_0x4f35d2(0x1b7)]||_0x1ea612[_0x4f35d2(0x11c)]?.['statusText']||_0x1ea612['message'],{'cause':_0x1ea612});throw _0x1ea612;}}}class GetMeAction{['accessToken'];[a0_0x2cdf9a(0x143)];constructor(_0x4ffffc){const _0x3d1c54=a0_0x2cdf9a;this[_0x3d1c54(0xbd)]=_0x4ffffc[_0x3d1c54(0xbd)],this[_0x3d1c54(0x143)]=_0x4ffffc[_0x3d1c54(0x143)];}async[a0_0x2cdf9a(0x20c)](){const _0x3ce660=a0_0x2cdf9a;try{const {data:_0x2c187e}=await axios[_0x3ce660(0x231)](_0x3ce660(0x1f1),{'headers':{'authorization':_0x3ce660(0x11a)+this[_0x3ce660(0xbd)]},'baseURL':this[_0x3ce660(0x143)]});return _0x2c187e;}catch(_0x5dc8c7){if(axios[_0x3ce660(0x23b)](_0x5dc8c7))throw Error(_0x5dc8c7['response']?.[_0x3ce660(0x164)][_0x3ce660(0x1b7)]||_0x5dc8c7[_0x3ce660(0x11c)]?.['statusText']||_0x5dc8c7[_0x3ce660(0x1b7)],{'cause':_0x5dc8c7});throw _0x5dc8c7;}}}class ListBranchesAction{[a0_0x2cdf9a(0x143)];[a0_0x2cdf9a(0xbd)];[a0_0x2cdf9a(0x132)];constructor(_0x5755dc){const _0x43fcb4=a0_0x2cdf9a;this[_0x43fcb4(0x143)]=_0x5755dc[_0x43fcb4(0x143)],this[_0x43fcb4(0xbd)]=_0x5755dc[_0x43fcb4(0xbd)],this[_0x43fcb4(0x132)]=_0x5755dc[_0x43fcb4(0x132)];}async[a0_0x2cdf9a(0x20c)](){const _0x23680f=a0_0x2cdf9a;try{const _0x43f059=[];let _0x247763=0x0,_0x12fb69=0x0;do{const {data:_0x5313ed}=await axios[_0x23680f(0x231)](_0x23680f(0x1a8),{'headers':{'authorization':_0x23680f(0x11a)+this[_0x23680f(0xbd)]},'params':{'search':this['search'],'offset':_0x247763,'limit':0x64},'baseURL':this[_0x23680f(0x143)]});_0x43f059[_0x23680f(0x10e)](..._0x5313ed[_0x23680f(0x1cc)]),_0x247763+=_0x5313ed[_0x23680f(0x1cc)][_0x23680f(0xc7)],_0x12fb69=_0x5313ed[_0x23680f(0x1aa)];}while(_0x247763<_0x12fb69);return _0x43f059;}catch(_0x4bd313){if(axios[_0x23680f(0x23b)](_0x4bd313))throw Error(_0x4bd313[_0x23680f(0x11c)]?.[_0x23680f(0x164)][_0x23680f(0x1b7)]||_0x4bd313[_0x23680f(0x11c)]?.[_0x23680f(0x11f)]||_0x4bd313[_0x23680f(0x1b7)],{'cause':_0x4bd313});throw _0x4bd313;}}}class ListComponentsAction{['devopsUrl'];[a0_0x2cdf9a(0xbd)];['branchId'];[a0_0x2cdf9a(0x1e0)];[a0_0x2cdf9a(0xd4)];constructor(_0x14a9f3){const _0x4a25a1=a0_0x2cdf9a;this[_0x4a25a1(0x143)]=_0x14a9f3[_0x4a25a1(0x143)],this[_0x4a25a1(0xbd)]=_0x14a9f3['accessToken'],this[_0x4a25a1(0x1fb)]=_0x14a9f3[_0x4a25a1(0x1fb)],this[_0x4a25a1(0x1e0)]=_0x14a9f3[_0x4a25a1(0x1e0)],_0x14a9f3['components']&&(this['indexes']=new Set(_0x14a9f3[_0x4a25a1(0xe2)]['map'](({name:_0x43bdda,type:_0x710d87})=>_0x710d87+'_'+_0x43bdda)));}async*[a0_0x2cdf9a(0x20c)](){const _0x2eb55c=a0_0x2cdf9a;try{let _0x890982=0x0,_0x2e89dc=0x0;do{const {data:_0x27fd6b}=await axios[_0x2eb55c(0x231)](_0x2eb55c(0x18c)+this[_0x2eb55c(0x1fb)]+'/commits/'+this[_0x2eb55c(0x1e0)]+'/components',{'headers':{'authorization':_0x2eb55c(0x11a)+this[_0x2eb55c(0xbd)]},'params':{'offset':_0x890982,'limit':0x64},'baseURL':this[_0x2eb55c(0x143)]});_0x890982+=_0x27fd6b[_0x2eb55c(0x1cc)][_0x2eb55c(0xc7)],_0x2e89dc=_0x27fd6b[_0x2eb55c(0x10f)];let _0x6d85b5=_0x27fd6b[_0x2eb55c(0x1cc)];this['indexes']&&(_0x6d85b5=_0x27fd6b['rows'][_0x2eb55c(0x180)](({name:_0x534380,type:_0x3900c6})=>this[_0x2eb55c(0xd4)]?.[_0x2eb55c(0x1c9)](_0x3900c6+'_'+_0x534380))),yield*_0x6d85b5;}while(_0x890982<_0x2e89dc);}catch(_0x510b57){if(axios['isAxiosError'](_0x510b57))throw Error(_0x510b57[_0x2eb55c(0x11c)]?.[_0x2eb55c(0x164)][_0x2eb55c(0x1b7)]||_0x510b57[_0x2eb55c(0x11c)]?.['statusText']||_0x510b57[_0x2eb55c(0x1b7)],{'cause':_0x510b57});throw _0x510b57;}}}class RetrieveComponentAction{[a0_0x2cdf9a(0x143)];[a0_0x2cdf9a(0xbd)];constructor(_0x563b1a){const _0x4045fc=a0_0x2cdf9a;this[_0x4045fc(0x143)]=_0x563b1a[_0x4045fc(0x143)],this['accessToken']=_0x563b1a['accessToken'];}async[a0_0x2cdf9a(0x20c)](_0xf5037e){const _0x2e1969=a0_0x2cdf9a;try{const {data:{id:_0x2fc4fb,name:_0x2c6e13,type:_0x3da6a9,fHash:_0x259989,files:_0x28736f}}=await axios['get'](_0x2e1969(0x1b8)+_0xf5037e,{'headers':{'authorization':'Token\x20'+this[_0x2e1969(0xbd)]},'baseURL':this[_0x2e1969(0x143)]}),_0x2c6550=_0x28736f['map'](_0x19651b=>({'path':_0x19651b['path'],'content':Buffer[_0x2e1969(0x213)](_0x19651b[_0x2e1969(0x21d)],_0x2e1969(0x173))[_0x2e1969(0x20a)](_0x2e1969(0x179))}));return{'id':_0x2fc4fb,'name':_0x2c6e13,'type':_0x3da6a9,'fHash':_0x259989,'files':_0x2c6550};}catch(_0x40e4fa){if(axios['isAxiosError'](_0x40e4fa))throw Error(_0x40e4fa[_0x2e1969(0x11c)]?.['data'][_0x2e1969(0x1b7)]||_0x40e4fa['response']?.[_0x2e1969(0x11f)]||_0x40e4fa[_0x2e1969(0x1b7)],{'cause':_0x40e4fa});throw _0x40e4fa;}}}const RETRIEVE_COMPONENT_CHUNK_SIZE=0xa;class ApiService{static async[a0_0x2cdf9a(0x1fa)](_0x1a3abd){const _0x273300=a0_0x2cdf9a,_0x2a7825=new ListBranchesAction(_0x1a3abd);return _0x2a7825[_0x273300(0x20c)]();}static async[a0_0x2cdf9a(0x1d9)](_0x46f8b5){const _0x574e26=a0_0x2cdf9a,_0x430b09=new GetDefaultBranchAction(_0x46f8b5);return _0x430b09[_0x574e26(0x20c)]();}static async[a0_0x2cdf9a(0x1b6)](_0x447c92){const _0xcbcf29=a0_0x2cdf9a,_0x553fe1=await ApiService[_0xcbcf29(0x1fa)]({'devopsUrl':_0x447c92[_0xcbcf29(0x143)],'accessToken':_0x447c92[_0xcbcf29(0xbd)],'search':_0x447c92[_0xcbcf29(0x163)]});return _0x553fe1[_0xcbcf29(0x117)](({name:_0x201227})=>_0x201227===_0x447c92['branchName'])||null;}static async['getBranchById'](_0x4b6edc){const _0x1ee177=a0_0x2cdf9a,_0x4aa9f9=new GetBranchAction({'accessToken':_0x4b6edc['accessToken'],'devopsUrl':_0x4b6edc[_0x1ee177(0x143)]});return _0x4aa9f9[_0x1ee177(0x20c)]({'branchId':_0x4b6edc['branchId']});}static[a0_0x2cdf9a(0x100)](_0x302cda){const _0x284aaa=new ListComponentsAction(_0x302cda);return _0x284aaa['execute']();}static async[a0_0x2cdf9a(0x15c)](_0x30ced8){const _0x3ba0d2=a0_0x2cdf9a,_0x28608d=[];for await(const _0x1ed251 of ApiService[_0x3ba0d2(0x100)](_0x30ced8)){_0x28608d[_0x3ba0d2(0x10e)](_0x1ed251);}return _0x28608d;}static async*[a0_0x2cdf9a(0x1d2)](_0x1cff65){const _0x3e0f3e=a0_0x2cdf9a,_0x5c977f=new RetrieveComponentAction({'devopsUrl':_0x1cff65[_0x3e0f3e(0x143)],'accessToken':_0x1cff65[_0x3e0f3e(0xbd)]});let _0x3c5cfe=[];for await(const _0x7968d1 of ApiService[_0x3e0f3e(0x100)]({'devopsUrl':_0x1cff65['devopsUrl'],'accessToken':_0x1cff65[_0x3e0f3e(0xbd)],'branchId':_0x1cff65[_0x3e0f3e(0x1fb)],'commitId':_0x1cff65['commitId'],'components':_0x1cff65[_0x3e0f3e(0xe2)]})){_0x3c5cfe[_0x3e0f3e(0x10e)](_0x5c977f[_0x3e0f3e(0x20c)](_0x7968d1['id'])),_0x3c5cfe[_0x3e0f3e(0xc7)]>=RETRIEVE_COMPONENT_CHUNK_SIZE&&(yield*await Promise['all'](_0x3c5cfe),_0x3c5cfe=[]);}_0x3c5cfe['length']&&(yield*await Promise[_0x3e0f3e(0xe5)](_0x3c5cfe));}static async[a0_0x2cdf9a(0x1c7)]({devopsUrl:_0x55abc0,accessToken:_0x3b9f07,componentId:_0x2fa247}){const _0x45d3dd=a0_0x2cdf9a,_0xec12f4=new RetrieveComponentAction({'devopsUrl':_0x55abc0,'accessToken':_0x3b9f07});return _0xec12f4[_0x45d3dd(0x20c)](_0x2fa247);}static async['getCredentials'](_0x6cc89d){const _0x516843=a0_0x2cdf9a,{accessToken:_0x49efb2,devopsUrl:_0x4e9e05}=await CredentialsManager[_0x516843(0x231)]({'alias':_0x6cc89d});if(!_0x4e9e05)throw new Error(_0x516843(0x15f));return{'accessToken':_0x49efb2,'devopsUrl':_0x4e9e05};}static async[a0_0x2cdf9a(0x203)](_0x990e30){const _0x51043c=a0_0x2cdf9a,_0x196bf2=new GetMeAction(_0x990e30);return _0x196bf2[_0x51043c(0x20c)]();}static async['commit'](_0x5a0103){const _0xd7837a=new CommitAction(_0x5a0103);await _0xd7837a['execute']();}static async[a0_0x2cdf9a(0xed)](_0x4b6754){const _0x39f785=a0_0x2cdf9a,_0xded4e0=new CreateBranchAction({'accessToken':_0x4b6754[_0x39f785(0xbd)],'devopsUrl':_0x4b6754[_0x39f785(0x143)]});return _0xded4e0[_0x39f785(0x20c)]({'name':_0x4b6754['name'],'parentId':_0x4b6754[_0x39f785(0x1e3)]});}}var ConfigName=(_0xe31d14=>{return _0xe31d14['CREDENTIALS_ALIAS']='credentialsAlias',_0xe31d14;})(ConfigName||{}),ChangeType=(_0x245e62=>{const _0x3e37f1=a0_0x2cdf9a;return _0x245e62[_0x3e37f1(0x239)]=_0x3e37f1(0xbe),_0x245e62[_0x3e37f1(0x199)]=_0x3e37f1(0x125),_0x245e62[_0x3e37f1(0x1df)]=_0x3e37f1(0x1ac),_0x245e62;})(ChangeType||{});class CompareWithRemoteBranchAction{[a0_0x2cdf9a(0x143)];['accessToken'];['targetBranchId'];[a0_0x2cdf9a(0x115)];[a0_0x2cdf9a(0xb8)];constructor(_0x477fa9){const _0x2ef00e=a0_0x2cdf9a;this[_0x2ef00e(0x143)]=_0x477fa9[_0x2ef00e(0x143)],this[_0x2ef00e(0xbd)]=_0x477fa9[_0x2ef00e(0xbd)],this[_0x2ef00e(0x21b)]=_0x477fa9['targetBranchId'],this['targetCommitId']=_0x477fa9[_0x2ef00e(0x115)],this[_0x2ef00e(0xb8)]=_0x477fa9[_0x2ef00e(0xb8)];}async[a0_0x2cdf9a(0x20c)](){const _0x4fb4ee=a0_0x2cdf9a,_0x22073e=await ApiService[_0x4fb4ee(0x15c)]({'devopsUrl':this[_0x4fb4ee(0x143)],'accessToken':this[_0x4fb4ee(0xbd)],'branchId':this[_0x4fb4ee(0x21b)],'commitId':this[_0x4fb4ee(0x115)]}),_0x2bf99c=new Map(_0x22073e[_0x4fb4ee(0xf3)](_0x18830c=>[_0x18830c[_0x4fb4ee(0xd5)]+'_'+_0x18830c[_0x4fb4ee(0x127)],_0x18830c])),_0x5ee032=[];for(const _0xa7acb of this['findDeletedAndUpdated'](_0x2bf99c)){_0x5ee032[_0x4fb4ee(0x10e)](_0xa7acb),_0x2bf99c[_0x4fb4ee(0x1e4)](_0xa7acb['type']+'_'+_0xa7acb['name']);}for(const [_0xa663a5,_0x3379e0]of _0x2bf99c[_0x4fb4ee(0x155)]()){const _0xfcb721=this[_0x4fb4ee(0xb8)][_0x4fb4ee(0x12b)][_0x4fb4ee(0x231)](_0xa663a5);!_0xfcb721&&_0x5ee032['push']({'id':_0x3379e0['id'],'name':_0x3379e0['name'],'type':_0x3379e0[_0x4fb4ee(0xd5)],'fHash':_0x3379e0[_0x4fb4ee(0x1c3)],'changeType':ChangeType[_0x4fb4ee(0x239)]});}return _0x5ee032;}*[a0_0x2cdf9a(0xf7)](_0x3ab3cd){const _0x59ceaf=a0_0x2cdf9a;for(const [_0x2cb0c3,_0x5149e2]of this[_0x59ceaf(0xb8)]['componentsState'][_0x59ceaf(0x155)]()){const _0x4874e6=_0x3ab3cd[_0x59ceaf(0x231)](_0x2cb0c3);!_0x4874e6&&(yield{'name':_0x5149e2[_0x59ceaf(0x127)],'type':_0x5149e2['type'],'changeType':ChangeType[_0x59ceaf(0x1df)]}),_0x4874e6&&_0x4874e6[_0x59ceaf(0x1c3)]!==_0x5149e2[_0x59ceaf(0x1c3)]&&(yield{'id':_0x4874e6['id'],'name':_0x4874e6[_0x59ceaf(0x127)],'type':_0x4874e6[_0x59ceaf(0xd5)],'fHash':_0x4874e6[_0x59ceaf(0x1c3)],'changeType':ChangeType['UPDATE']});}}}class ConfigSetAction{['stage'];constructor({stage:_0xfcb729}){this['stage']=_0xfcb729;}async['execute']({name:_0x448626,value:_0x1262d7}){const _0x240d01=a0_0x2cdf9a;switch(_0x448626){case ConfigName[_0x240d01(0x189)]:await CredentialsManager[_0x240d01(0x231)]({'alias':_0x1262d7}),this[_0x240d01(0xb8)]['setConfig'](_0x448626,_0x1262d7);break;default:throw new Error(_0x240d01(0x148)+_0x448626);}}}class FindChangesAction{[a0_0x2cdf9a(0xb8)];constructor(_0x3d87e0){const _0x37e0ac=a0_0x2cdf9a;this[_0x37e0ac(0xb8)]=_0x3d87e0[_0x37e0ac(0xb8)];}async['execute'](){const _0xcbb4b=a0_0x2cdf9a,_0x5f43ce=new Map(this[_0xcbb4b(0xb8)]['componentsState']),_0x5a26ed=[];for await(const {componentName:_0x41b382,componentType:_0xddc9d8,filePaths:_0x5d3b62}of salesforce[_0xcbb4b(0x22b)][_0xcbb4b(0x22a)](this['stage'][_0xcbb4b(0x1d3)])){const _0x2ba22f=_0xddc9d8+'_'+_0x41b382,_0x20d2a2=_0x5f43ce[_0xcbb4b(0x231)](_0x2ba22f),_0x4862ef=_0x5d3b62['map'](_0x2f7ee8=>_0x2f7ee8[_0xcbb4b(0x1ce)](this[_0xcbb4b(0xb8)][_0xcbb4b(0x1d3)]+'/',''));if(!_0x20d2a2){_0x5a26ed[_0xcbb4b(0x10e)]({'type':_0xddc9d8,'name':_0x41b382,'changes':_0x4862ef[_0xcbb4b(0xf3)](_0x54c69f=>({'path':_0x54c69f,'changeType':ChangeType[_0xcbb4b(0x239)]}))});continue;}_0x5f43ce['delete'](_0x2ba22f);const _0x23f3c1=await this[_0xcbb4b(0x235)](_0x4862ef,_0x20d2a2['paths']);_0x23f3c1[_0xcbb4b(0xc7)]&&_0x5a26ed[_0xcbb4b(0x10e)]({'type':_0xddc9d8,'name':_0x41b382,'changes':_0x23f3c1});}for(const [,_0x441843]of _0x5f43ce[_0xcbb4b(0x155)]()){_0x5a26ed[_0xcbb4b(0x10e)]({'type':_0x441843[_0xcbb4b(0xd5)],'name':_0x441843[_0xcbb4b(0x127)],'changes':_0x441843[_0xcbb4b(0x123)][_0xcbb4b(0xf3)](_0x3f4347=>({'path':_0x3f4347,'changeType':ChangeType[_0xcbb4b(0x1df)]}))});}return _0x5a26ed;}async['getUpdatedComponentChanges'](_0x3de7e,_0x402c52){const _0x413495=a0_0x2cdf9a,{lastStageTimestamp:_0x26481c}=this[_0x413495(0xb8)][_0x413495(0x10d)],_0x28d5d4=[];for(const _0x4c2613 of _0x3de7e){const _0x16d7a0=_0x402c52[_0x413495(0x126)](_0x4c2613);if(!_0x16d7a0){_0x28d5d4['push']({'path':_0x4c2613,'changeType':ChangeType['CREATE']});continue;}const {ctimeMs:_0x396dc2,mtimeMs:_0x141006}=await promises[_0x413495(0x137)](_0x4c2613);(!_0x26481c||Math[_0x413495(0x1f4)](_0x141006)>_0x26481c||Math[_0x413495(0x1f4)](_0x396dc2)>_0x26481c)&&_0x28d5d4['push']({'path':_0x4c2613,'changeType':ChangeType[_0x413495(0x199)]});}for(const _0x23d541 of _0x402c52){const _0x5a42a7=!_0x3de7e['includes'](_0x23d541);_0x5a42a7&&_0x28d5d4[_0x413495(0x10e)]({'path':_0x23d541,'changeType':ChangeType[_0x413495(0x1df)]});}return _0x28d5d4;}}const STAGE_FOLDER_NAME=a0_0x2cdf9a(0x1ab),SYSTEM_FOLDER='.'+ROOT_NAME,CONFIG_FILE_NAME='config.json',BRANCH_STATE_FILE_NAME=a0_0x2cdf9a(0x18e),COMPONENTS_STATE_FILE_NAME=a0_0x2cdf9a(0x22e),COMPONENT_PROJECT_PATH=node_path['join'](a0_0x2cdf9a(0x1f5),'main',a0_0x2cdf9a(0xc2)),SFDX_PROJECT_FILE_NAME=a0_0x2cdf9a(0x18a),INITIAL_BRANCH_STATE={'id':null,'name':null,'headCommitId':null,'lastStageTimestamp':null},INITIAL_CONFIG={'credentialsAlias':null};class InitProjectAction{[a0_0x2cdf9a(0xb8)];[a0_0x2cdf9a(0xbb)];constructor({stage:_0x31f077,config:_0x4bafe0}){const _0x375e75=a0_0x2cdf9a;this[_0x375e75(0xb8)]=_0x31f077,this[_0x375e75(0xbb)]=_0x4bafe0;}async['execute'](){const _0x6db568=a0_0x2cdf9a,_0xb24358=new salesforce['CreateProjectSfCommand']({'cwd':node_path[_0x6db568(0xda)](this[_0x6db568(0xb8)][_0x6db568(0x1bb)]),'projectName':node_path[_0x6db568(0x224)](this[_0x6db568(0xb8)]['stagePath'])});await _0xb24358['run']();const _0x144124=await FileUtils[_0x6db568(0x19d)](this['stage'][_0x6db568(0x1bb)]);for(const _0x184eba of _0x144124){const _0x341a43=_0x184eba['split'](STAGE_FOLDER_NAME)[0x1];this[_0x6db568(0xb8)]['registerFileChange']({'path':_0x341a43,'changeType':ChangeType['CREATE']});}if(this[_0x6db568(0xbb)])for(const _0xa18ce4 of Object[_0x6db568(0x214)](ConfigName)){this[_0x6db568(0xb8)][_0x6db568(0x154)](_0xa18ce4,this['config'][_0xa18ce4]);}}}class SaveComponentAction{[a0_0x2cdf9a(0xb8)];constructor(_0x6a25ee){const _0x2116ae=a0_0x2cdf9a;this[_0x2116ae(0xb8)]=_0x6a25ee[_0x2116ae(0xb8)];}async[a0_0x2cdf9a(0x20c)](_0xcda0eb){const _0x218415=a0_0x2cdf9a;switch(_0xcda0eb[_0x218415(0x1a0)]){case ChangeType['CREATE']:{if(!_0xcda0eb[_0x218415(0xc9)])throw new Error('Create:\x20Component\x20not\x20found');await this[_0x218415(0xb8)]['createComponent'](_0xcda0eb['component']);break;}case ChangeType['UPDATE']:if(!_0xcda0eb[_0x218415(0xc9)])throw new Error('Update:\x20Component\x20not\x20found');await this[_0x218415(0xb8)]['updateComponent'](_0xcda0eb[_0x218415(0xc9)]);break;case ChangeType[_0x218415(0x1df)]:await this[_0x218415(0xb8)]['deleteComponent']({'name':_0xcda0eb[_0x218415(0x127)],'type':_0xcda0eb[_0x218415(0xd5)]});break;}}}class UpdateComponentStateAction{[a0_0x2cdf9a(0xb8)];[a0_0x2cdf9a(0x127)];[a0_0x2cdf9a(0xd5)];['changes'];constructor(_0x1383b6){const _0x322c3e=a0_0x2cdf9a;this['stage']=_0x1383b6['stage'],this[_0x322c3e(0x127)]=_0x1383b6[_0x322c3e(0x127)],this['type']=_0x1383b6[_0x322c3e(0xd5)],this[_0x322c3e(0xfa)]=_0x1383b6[_0x322c3e(0xfa)];}async['execute'](){const _0x9793e3=a0_0x2cdf9a,_0x15f259=this[_0x9793e3(0xd5)]+'_'+this[_0x9793e3(0x127)];let _0x2a45e8=this[_0x9793e3(0xb8)]['componentsState']['get'](_0x15f259);!_0x2a45e8&&(_0x2a45e8={'name':this[_0x9793e3(0x127)],'type':this['type'],'fHash':'','paths':[]},this['stage'][_0x9793e3(0x12b)]['set'](_0x15f259,_0x2a45e8));let _0x584ea5;for(const _0x2996b5 of this[_0x9793e3(0xfa)]){this[_0x9793e3(0x230)](_0x2a45e8,_0x2996b5),_0x2996b5[_0x9793e3(0x1a0)]===ChangeType[_0x9793e3(0x239)]&&(_0x584ea5=ChangeType[_0x9793e3(0x239)]);}if(!_0x2a45e8[_0x9793e3(0x123)][_0x9793e3(0xc7)])return this[_0x9793e3(0xb8)][_0x9793e3(0x12b)][_0x9793e3(0x1e4)](_0x15f259),{'name':this[_0x9793e3(0x127)],'type':this[_0x9793e3(0xd5)],'changeType':ChangeType[_0x9793e3(0x1df)]};return!_0x584ea5&&(_0x584ea5=ChangeType[_0x9793e3(0x199)]),_0x2a45e8[_0x9793e3(0x1c3)]=await this[_0x9793e3(0xc4)](_0x2a45e8[_0x9793e3(0x123)]),{..._0x2a45e8,'changeType':_0x584ea5};}['handleFileChange'](_0x400fbe,{path:_0x4e6997,changeType:_0x3a6310}){const _0x2f3a5a=a0_0x2cdf9a;if(_0x3a6310===ChangeType['CREATE']){if(_0x400fbe[_0x2f3a5a(0x123)][_0x2f3a5a(0x126)](_0x4e6997))throw new Error(_0x2f3a5a(0xbc)+_0x4e6997+_0x2f3a5a(0x1de));_0x400fbe['paths'][_0x2f3a5a(0x10e)](_0x4e6997);}if(_0x3a6310===ChangeType[_0x2f3a5a(0x1df)]){const _0xec5d0f=_0x400fbe[_0x2f3a5a(0x123)][_0x2f3a5a(0xf5)](_0x4e6997);if(_0xec5d0f<0x0)throw new Error('File\x20\x22'+_0x4e6997+_0x2f3a5a(0x172));_0x400fbe[_0x2f3a5a(0x123)][_0x2f3a5a(0x1d7)](_0xec5d0f,0x1);}}async[a0_0x2cdf9a(0xc4)](_0xd4f8a4){const _0x442d30=a0_0x2cdf9a,_0x286b2d=node_crypto[_0x442d30(0x1eb)]('sha1');for(const _0x38f98d of _0xd4f8a4){const _0x187839=await promises['readFile'](node_path[_0x442d30(0x11b)](this[_0x442d30(0xb8)][_0x442d30(0x1d3)],_0x38f98d),{'encoding':_0x442d30(0x179)}),_0x2d68de=_0x38f98d[_0x442d30(0x15e)](node_path[_0x442d30(0xcc)])[_0x442d30(0x246)](0x3)[_0x442d30(0x11b)]('/');_0x286b2d['update'](_0x2d68de),_0x286b2d[_0x442d30(0x118)](_0x187839);}const _0x232be9=_0x286b2d[_0x442d30(0x1e2)]('hex');return _0x232be9;}}class Stage{[a0_0x2cdf9a(0x22c)];['_stagePath'];['config'];[a0_0x2cdf9a(0x111)];['_componentsState'];[a0_0x2cdf9a(0x1ef)]=[];['_isUpdateStageTimestamp']=!![];set[a0_0x2cdf9a(0xd6)](_0x4d607b){const _0x141c93=a0_0x2cdf9a;this[_0x141c93(0x22d)]=_0x4d607b;}get[a0_0x2cdf9a(0x1d3)](){const _0x41c574=a0_0x2cdf9a;return this[_0x41c574(0x22c)];}get[a0_0x2cdf9a(0x1bb)](){return this['_stagePath'];}get['branchState'](){const _0xf4248d=a0_0x2cdf9a;return this[_0xf4248d(0x111)];}get[a0_0x2cdf9a(0x12b)](){return this['_componentsState'];}constructor(_0x1f47bb){const _0x24ab21=a0_0x2cdf9a;this['_projectPath']=_0x1f47bb[_0x24ab21(0x1d3)],this[_0x24ab21(0x1a6)]=_0x1f47bb['stagePath'],this[_0x24ab21(0xbb)]=_0x1f47bb[_0x24ab21(0xbb)],this['_branchState']=_0x1f47bb[_0x24ab21(0x10d)],this[_0x24ab21(0x1f3)]=_0x1f47bb[_0x24ab21(0x12b)]?new Map(_0x1f47bb[_0x24ab21(0x12b)][_0x24ab21(0xf3)](_0x567e77=>[_0x567e77[_0x24ab21(0xd5)]+'_'+_0x567e77['name'],_0x567e77])):new Map();}[a0_0x2cdf9a(0x154)](_0x5aa412,_0x285440){const _0x5cf28a=a0_0x2cdf9a;this[_0x5cf28a(0xbb)][_0x5aa412]=_0x285440;}[a0_0x2cdf9a(0x142)](_0x2743ad){const _0x4759eb=a0_0x2cdf9a;this[_0x4759eb(0xbb)][_0x2743ad]=null;}[a0_0x2cdf9a(0x165)](_0x4d9138){const _0x440164=a0_0x2cdf9a;this[_0x440164(0x10d)]['id']=_0x4d9138['id'],this[_0x440164(0x10d)][_0x440164(0x127)]=_0x4d9138[_0x440164(0x127)],this[_0x440164(0x10d)][_0x440164(0x134)]=_0x4d9138[_0x440164(0x134)];}async[a0_0x2cdf9a(0x1c6)](_0x4c7c80){const _0x1308d0=a0_0x2cdf9a,_0x567ef1={'name':_0x4c7c80[_0x1308d0(0x127)],'type':_0x4c7c80[_0x1308d0(0xd5)],'fHash':_0x4c7c80[_0x1308d0(0x1c3)],'paths':_0x4c7c80[_0x1308d0(0xe6)][_0x1308d0(0xf3)](({path:_0x5c2975})=>node_path[_0x1308d0(0x11b)](COMPONENT_PROJECT_PATH,_0x5c2975))};this[_0x1308d0(0x1f3)][_0x1308d0(0x191)](_0x4c7c80['type']+'_'+_0x4c7c80[_0x1308d0(0x127)],_0x567ef1);for(const {path:_0x7856db,content:_0x4452c8}of _0x4c7c80[_0x1308d0(0xe6)]){await this['addFileChange']({'path':node_path[_0x1308d0(0x11b)](COMPONENT_PROJECT_PATH,_0x7856db),'content':_0x4452c8,'changeType':ChangeType[_0x1308d0(0x239)]});}}async[a0_0x2cdf9a(0x152)](_0x153756){const _0x2da338=a0_0x2cdf9a,_0x4a6335=this['_componentsState'][_0x2da338(0x231)](_0x153756[_0x2da338(0xd5)]+'_'+_0x153756[_0x2da338(0x127)]),_0xe018ac=[];if(!_0x4a6335)throw new Error(_0x2da338(0x19b)+_0x153756[_0x2da338(0x127)]+_0x2da338(0x20b)+_0x153756['type']+'\x20not\x20found');for(const _0x9571e4 of _0x4a6335[_0x2da338(0x123)]){await this['addFileChange']({'path':_0x9571e4,'changeType':ChangeType[_0x2da338(0x1df)]});}for(const {path:_0x3054b1,content:_0x274320}of _0x153756[_0x2da338(0xe6)]){const _0x5bcc18=node_path[_0x2da338(0x11b)](COMPONENT_PROJECT_PATH,_0x3054b1);await this[_0x2da338(0x1f9)]({'path':_0x5bcc18,'content':_0x274320,'changeType':ChangeType[_0x2da338(0x239)]}),_0xe018ac[_0x2da338(0x10e)](_0x5bcc18);}_0x4a6335['fHash']=_0x153756[_0x2da338(0x1c3)],_0x4a6335[_0x2da338(0x123)]=_0xe018ac;}async[a0_0x2cdf9a(0xe9)](_0x36921){const _0x1e07cc=a0_0x2cdf9a,_0x29415e=_0x36921[_0x1e07cc(0xd5)]+'_'+_0x36921[_0x1e07cc(0x127)],_0x52f8e0=this['_componentsState']['get'](_0x29415e);if(!_0x52f8e0)throw new Error(_0x1e07cc(0x17a)+_0x36921['name']+_0x1e07cc(0x20b)+_0x36921['type']+'\x20not\x20found');for(const _0x56be5a of _0x52f8e0[_0x1e07cc(0x123)]){await this['addFileChange']({'path':_0x56be5a,'changeType':ChangeType['DELETE']});}this['_componentsState'][_0x1e07cc(0x1e4)](_0x29415e);}async[a0_0x2cdf9a(0x1f9)]({path:_0x3d615b,content:_0x458504,changeType:_0x289c2c}){const _0x1d9cbc=a0_0x2cdf9a;if(_0x289c2c!==ChangeType[_0x1d9cbc(0x1df)]){if(!_0x458504)throw new Error(_0x1d9cbc(0x1e1));const _0x5e86ce=node_path['join'](this['stagePath'],_0x3d615b);await promises[_0x1d9cbc(0x17d)](node_path[_0x1d9cbc(0xda)](_0x5e86ce),{'recursive':!![]}),await promises[_0x1d9cbc(0x181)](_0x5e86ce,_0x458504);}this[_0x1d9cbc(0x1ef)][_0x1d9cbc(0x10e)]({'path':_0x3d615b,'changeType':_0x289c2c});}async[a0_0x2cdf9a(0x18b)](_0x423e06){const _0x242153=a0_0x2cdf9a,_0x2eee40=new UpdateComponentStateAction({'stage':this,..._0x423e06});return _0x2eee40[_0x242153(0x20c)]();}async[a0_0x2cdf9a(0x106)](){}[a0_0x2cdf9a(0x1d0)]({path:_0x45fbbd,changeType:_0x186596}){const _0x44704f=a0_0x2cdf9a;this[_0x44704f(0x1ef)][_0x44704f(0x10e)]({'path':_0x45fbbd,'changeType':_0x186596});}async['apply'](){const _0x59345a=a0_0x2cdf9a,_0x33def8=await FileUtils[_0x59345a(0x178)](this[_0x59345a(0x1bb)]);if(!_0x33def8)throw Error(_0x59345a(0x241));await this[_0x59345a(0x216)](),await this[_0x59345a(0xd7)](),await promises['rm'](this[_0x59345a(0x1bb)],{'recursive':!![]});const _0x48690e=node_path[_0x59345a(0x11b)](this[_0x59345a(0x22c)],COMPONENT_PROJECT_PATH),_0x3993ff=await FileUtils['isDirectoryExists'](_0x48690e);_0x3993ff?await FileUtils[_0x59345a(0xfe)](_0x48690e,![]):await promises[_0x59345a(0x17d)](_0x48690e,{'recursive':!![]});}async[a0_0x2cdf9a(0xb9)](){const _0x57b895=a0_0x2cdf9a;await promises['rm'](this[_0x57b895(0x1bb)],{'recursive':!![],'force':!![]});}async[a0_0x2cdf9a(0x216)](){const _0x5202c7=a0_0x2cdf9a;for(const {path:_0x38027e,changeType:_0x1dcd8a}of this['fileChanges']){switch(_0x1dcd8a){case ChangeType[_0x5202c7(0x239)]:case ChangeType[_0x5202c7(0x199)]:await this[_0x5202c7(0xeb)](_0x38027e);break;case ChangeType[_0x5202c7(0x1df)]:await this[_0x5202c7(0x234)](_0x38027e);break;}}}async[a0_0x2cdf9a(0xeb)](_0x3ed3cf){const _0xfe9cc1=a0_0x2cdf9a,_0x5e722c=node_path[_0xfe9cc1(0x11b)](this['_stagePath'],_0x3ed3cf),_0x2b6df5=node_path[_0xfe9cc1(0x11b)](this[_0xfe9cc1(0x22c)],_0x3ed3cf);await promises[_0xfe9cc1(0x17d)](node_path['dirname'](_0x2b6df5),{'recursive':!![]}),await promises[_0xfe9cc1(0x1a2)](_0x5e722c,_0x2b6df5);}async[a0_0x2cdf9a(0x234)](_0xe9a519){const _0x4dbee7=a0_0x2cdf9a;await promises['rm'](node_path[_0x4dbee7(0x11b)](this[_0x4dbee7(0x22c)],_0xe9a519),{'recursive':!![]});}async['updateSystemFiles'](){const _0x235055=a0_0x2cdf9a;await promises[_0x235055(0x181)](node_path[_0x235055(0x11b)](this[_0x235055(0x1d3)],SYSTEM_FOLDER,CONFIG_FILE_NAME),JSON[_0x235055(0x192)](this[_0x235055(0xbb)])),this[_0x235055(0x22d)]&&(this['branchState'][_0x235055(0xce)]=Date['now']()),await promises[_0x235055(0x181)](node_path[_0x235055(0x11b)](this[_0x235055(0x1d3)],SYSTEM_FOLDER,BRANCH_STATE_FILE_NAME),JSON[_0x235055(0x192)](this[_0x235055(0x10d)])),await promises[_0x235055(0x181)](node_path[_0x235055(0x11b)](this[_0x235055(0x1d3)],SYSTEM_FOLDER,COMPONENTS_STATE_FILE_NAME),JSON['stringify'](Array[_0x235055(0x213)](this['_componentsState'][_0x235055(0x214)]())));}}class ProjectManager{static [a0_0x2cdf9a(0x124)];['_stage'];get[a0_0x2cdf9a(0xb8)](){const _0x25c00a=a0_0x2cdf9a;if(!this[_0x25c00a(0x219)])throw new Error('Stage\x20not\x20found');return this['_stage'];}constructor(){}static['getInstance'](){const _0x69d954=a0_0x2cdf9a;return!ProjectManager[_0x69d954(0x124)]&&(ProjectManager[_0x69d954(0x124)]=new ProjectManager()),ProjectManager[_0x69d954(0x124)];}async[a0_0x2cdf9a(0x198)](_0x1c3926){const _0x1a671b=a0_0x2cdf9a,_0x3a559d=node_path['join'](_0x1c3926,SYSTEM_FOLDER,STAGE_FOLDER_NAME);await promises['rm'](_0x3a559d,{'recursive':!![],'force':!![]}),await promises['mkdir'](_0x3a559d,{'recursive':!![]});const _0x1726e8=await this[_0x1a671b(0x146)](_0x1c3926),_0x22032a=await this[_0x1a671b(0x12a)](_0x1c3926),_0x58cbdd=await this[_0x1a671b(0x15a)](_0x1c3926);this[_0x1a671b(0x219)]=new Stage({'projectPath':_0x1c3926,'stagePath':_0x3a559d,'config':_0x1726e8,'branchState':_0x22032a,'componentsState':_0x58cbdd});}async[a0_0x2cdf9a(0xba)](){await this['stage']['apply']();}async[a0_0x2cdf9a(0x156)](){const _0x514ae8=a0_0x2cdf9a;await this[_0x514ae8(0xb8)][_0x514ae8(0xb9)]();}async[a0_0x2cdf9a(0x105)]({config:_0x221fb8}){const _0x581bb4=a0_0x2cdf9a,_0x4ab3cf=new InitProjectAction({'stage':this[_0x581bb4(0xb8)],'config':_0x221fb8});await _0x4ab3cf['execute']();}[a0_0x2cdf9a(0x243)](_0x756be1){const _0x4b910f=a0_0x2cdf9a;this[_0x4b910f(0xb8)][_0x4b910f(0x165)](_0x756be1);}async[a0_0x2cdf9a(0x147)](_0x51ae8f){const _0x2e0ee3=a0_0x2cdf9a,_0x259504=new SaveComponentAction({'stage':this[_0x2e0ee3(0xb8)]});await _0x259504[_0x2e0ee3(0x20c)](_0x51ae8f);}async['findChanges'](){const _0x1766d9=a0_0x2cdf9a,_0x5c3275=new FindChangesAction({'stage':this[_0x1766d9(0xb8)]});return _0x5c3275[_0x1766d9(0x20c)]();}async[a0_0x2cdf9a(0x13c)](_0x1e8e10){const _0x12daa0=a0_0x2cdf9a,_0x231508=new CompareWithRemoteBranchAction({..._0x1e8e10,'stage':this[_0x12daa0(0xb8)]});return _0x231508[_0x12daa0(0x20c)]();}async[a0_0x2cdf9a(0x146)](_0x5c5479){const _0x3be1a4=a0_0x2cdf9a,_0x49560a=node_path['join'](_0x5c5479,SYSTEM_FOLDER,CONFIG_FILE_NAME),_0x1ac47=await FileUtils[_0x3be1a4(0x1c0)](_0x49560a);if(!_0x1ac47)return INITIAL_CONFIG;const _0x4c3535=await promises['readFile'](_0x49560a);return JSON[_0x3be1a4(0x14f)](_0x4c3535[_0x3be1a4(0x20a)]());}async[a0_0x2cdf9a(0x12a)](_0x1f96d2){const _0x53d55d=a0_0x2cdf9a,_0x519ae5=node_path[_0x53d55d(0x11b)](_0x1f96d2,SYSTEM_FOLDER,BRANCH_STATE_FILE_NAME),_0x46aa2a=await FileUtils[_0x53d55d(0x1c0)](_0x519ae5);if(!_0x46aa2a)return INITIAL_BRANCH_STATE;const _0x2111f1=await promises[_0x53d55d(0x13b)](_0x519ae5);return JSON[_0x53d55d(0x14f)](_0x2111f1[_0x53d55d(0x20a)]());}async[a0_0x2cdf9a(0x15a)](_0x47e4d7){const _0x5478f0=a0_0x2cdf9a,_0x29054a=node_path[_0x5478f0(0x11b)](_0x47e4d7,SYSTEM_FOLDER,COMPONENTS_STATE_FILE_NAME),_0xda8053=await FileUtils['isFileExists'](_0x29054a);if(!_0xda8053)return[];const _0x2be539=await promises[_0x5478f0(0x13b)](_0x29054a);return JSON[_0x5478f0(0x14f)](_0x2be539[_0x5478f0(0x20a)]());}async[a0_0x2cdf9a(0x249)](_0x3a2083){const _0x1d449d=a0_0x2cdf9a,_0x286fa8=[node_path[_0x1d449d(0x11b)](_0x3a2083,SYSTEM_FOLDER,CONFIG_FILE_NAME),node_path['join'](_0x3a2083,SYSTEM_FOLDER,BRANCH_STATE_FILE_NAME),node_path['join'](_0x3a2083,SYSTEM_FOLDER,COMPONENTS_STATE_FILE_NAME),node_path['join'](_0x3a2083,SFDX_PROJECT_FILE_NAME)];for(const _0x5b6ff9 of _0x286fa8){const _0x261eeb=await FileUtils[_0x1d449d(0x1c0)](_0x5b6ff9);if(!_0x261eeb)return![];}return!![];}async[a0_0x2cdf9a(0x154)](_0x55d01f,_0x45ff93){const _0x2bab74=a0_0x2cdf9a,_0x45f17c=new ConfigSetAction({'stage':this[_0x2bab74(0xb8)]});await _0x45f17c[_0x2bab74(0x20c)]({'name':_0x55d01f,'value':_0x45ff93});}async[a0_0x2cdf9a(0x142)](_0x1395fc){const _0x3d53d5=a0_0x2cdf9a;this[_0x3d53d5(0xb8)][_0x3d53d5(0x142)](_0x1395fc);}['updateComponentState'](_0x40879a){const _0x396d7d=a0_0x2cdf9a;return this[_0x396d7d(0xb8)][_0x396d7d(0x18b)](_0x40879a);}async[a0_0x2cdf9a(0x1f9)](_0x2cd9e3){const _0x12b318=a0_0x2cdf9a;await this[_0x12b318(0xb8)][_0x12b318(0x1f9)](_0x2cd9e3);}[a0_0x2cdf9a(0x14a)](_0x511edd){const _0x5f5d57=a0_0x2cdf9a;this[_0x5f5d57(0xb8)][_0x5f5d57(0xd6)]=_0x511edd;}}class ReadlineUtils{static async['askString'](_0x3d9090){const _0xec8f33=a0_0x2cdf9a,_0x2d7642=readline[_0xec8f33(0x110)]({'input':process[_0xec8f33(0x1ea)],'output':process['stdout']}),_0x22af8d=await _0x2d7642[_0xec8f33(0x19a)](_0x3d9090);return _0x2d7642[_0xec8f33(0x204)](),_0x22af8d;}}const INFO_COLOR_INDEX='4',WARN_COLOR_INDEX='3',ERROR_COLOR_INDEX='1';class Logger{[a0_0x2cdf9a(0xf1)];[a0_0x2cdf9a(0xc0)];[a0_0x2cdf9a(0x1ba)];[a0_0x2cdf9a(0x195)];constructor({isJson:_0x2b0fd9}){const _0x3b562f=a0_0x2cdf9a;this[_0x3b562f(0xf1)]=_0x2b0fd9,debug[_0x3b562f(0xdd)]=console[_0x3b562f(0xdd)][_0x3b562f(0x171)](console),debug[_0x3b562f(0x24a)](ROOT_NAME+':*'),this['infoDebug']=debug(ROOT_NAME+':INFO'),this[_0x3b562f(0xc0)][_0x3b562f(0x227)]=INFO_COLOR_INDEX,this[_0x3b562f(0x1ba)]=debug(ROOT_NAME+_0x3b562f(0x1cf)),this[_0x3b562f(0x1ba)][_0x3b562f(0x227)]=WARN_COLOR_INDEX,this[_0x3b562f(0x195)]=debug(ROOT_NAME+':ERROR'),this['errorDebug'][_0x3b562f(0x227)]=ERROR_COLOR_INDEX;}[a0_0x2cdf9a(0x217)](_0xbfa9d6){!this['isJson']&&this['infoDebug'](_0xbfa9d6);}[a0_0x2cdf9a(0x19e)](_0x47de9f){const _0x215135=a0_0x2cdf9a;!this[_0x215135(0xf1)]&&this['warnDebug'](_0x47de9f);}[a0_0x2cdf9a(0x1ae)](_0x55b0da){const _0xf68ec0=a0_0x2cdf9a;!this[_0xf68ec0(0xf1)]&&this[_0xf68ec0(0x195)](_0x55b0da);}}class BaseCommand{[a0_0x2cdf9a(0x207)];get[a0_0x2cdf9a(0x183)](){const _0x3541cd=a0_0x2cdf9a;if(!this[_0x3541cd(0x207)])throw new Error('Logger\x20not\x20found');return this[_0x3541cd(0x207)];}[a0_0x2cdf9a(0x1f6)](_0x4288c0){const _0x2ff8d8=a0_0x2cdf9a,_0x45bdcf=new commander[(_0x2ff8d8(0x20f))]()['name'](this[_0x2ff8d8(0x23f)])[_0x2ff8d8(0x17e)](this['description']);for(const {name:_0x4f7ca2,description:_0x45a976,defaultValue:_0x348020}of this[_0x2ff8d8(0xdf)]){_0x45bdcf[_0x2ff8d8(0x1dd)](_0x4f7ca2,_0x45a976,_0x348020);}for(const {flags:_0x5daabd,description:_0x590ea2,defaultValue:_0x29c758}of this[_0x2ff8d8(0x1b1)]){_0x45bdcf[_0x2ff8d8(0x112)](_0x5daabd,_0x590ea2,_0x29c758);}_0x45bdcf['action'](async(..._0x2676bb)=>{const _0x99fde9=_0x2ff8d8,_0x5f615d=this['isJson'](_0x2676bb);this['_logger']=new Logger({'isJson':_0x5f615d});try{const _0x13057a=await this[_0x99fde9(0x20c)](_0x2676bb);_0x13057a['report'](_0x5f615d);}catch(_0x509202){_0x509202 instanceof Error&&this[_0x99fde9(0x183)][_0x99fde9(0x1ae)](_0x509202['message']);throw _0x509202;}}),_0x4288c0['addCommand'](_0x45bdcf);}}class BaseReporter{[a0_0x2cdf9a(0x18f)];get['success'](){return this['_success'];}constructor(_0x57fc68){const _0x32a3c9=a0_0x2cdf9a;this[_0x32a3c9(0x18f)]=_0x57fc68[_0x32a3c9(0x1ad)];}[a0_0x2cdf9a(0x1fc)](_0x3f704d){const _0x102255=a0_0x2cdf9a,_0x1112c0=this['buildReport']();_0x3f704d?this[_0x102255(0x14b)](_0x1112c0):this['print'](_0x1112c0);}[a0_0x2cdf9a(0x14b)](_0x1ee6c3){const _0x278fc3=a0_0x2cdf9a,_0x22e38e=JSON[_0x278fc3(0x192)](_0x1ee6c3,null,0x2);console['log'](_0x22e38e);}}class FailReporter extends BaseReporter{[a0_0x2cdf9a(0x1be)];constructor({failMessage:_0x34b891}){const _0x3596e9=a0_0x2cdf9a;super({'success':![]}),this[_0x3596e9(0x1be)]=_0x34b891;}['buildReport'](){const _0x202be4=a0_0x2cdf9a;return{'success':this[_0x202be4(0x1ad)],'failMessage':this[_0x202be4(0x1be)]};}[a0_0x2cdf9a(0x150)](_0xb7f9fd){const _0x492d46=a0_0x2cdf9a,_0x21ce17=[[_0x492d46(0x14e)],[_0xb7f9fd['failMessage']]];console[_0x492d46(0xdd)](table[_0x492d46(0x221)](_0x21ce17,{'columns':[{'width':0x64}]}));}}class CheckoutReporter extends BaseReporter{[a0_0x2cdf9a(0x16d)];['changes'];constructor({currentBranch:_0x503703,changes:_0x337fc7}){const _0x1a4a33=a0_0x2cdf9a;super({'success':!![]}),this[_0x1a4a33(0x16d)]=_0x503703,this[_0x1a4a33(0xfa)]=_0x337fc7;}['buildReport'](){const _0x6759d9=a0_0x2cdf9a;return{'success':this[_0x6759d9(0x1ad)],'targetBranch':this[_0x6759d9(0x16d)],'changes':this[_0x6759d9(0xfa)]};}[a0_0x2cdf9a(0x150)](_0x5eee0f){const _0x5538e7=a0_0x2cdf9a;console[_0x5538e7(0xdd)](_0x5538e7(0xfd)+this[_0x5538e7(0x16d)][_0x5538e7(0x127)]+'\x0a'),console[_0x5538e7(0xdd)](_0x5538e7(0x245));const _0x4942b4=[[_0x5538e7(0xfc),_0x5538e7(0x1b3),_0x5538e7(0x20e),_0x5538e7(0x16c)]];for(const {changeType:_0x28b5dc,name:_0x5a30ce,type:_0x4d5257,paths:_0x19dff5}of _0x5eee0f['changes']){_0x4942b4[_0x5538e7(0x10e)]([_0x28b5dc,_0x5a30ce,_0x4d5257,_0x19dff5?.[_0x5538e7(0x11b)]('\x0a')||'']);}console['log'](table['table'](_0x4942b4,{'columns':[{},{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class BaseHandler{}class TargetBranchExistHandler extends BaseHandler{[a0_0x2cdf9a(0xbf)];[a0_0x2cdf9a(0x1b5)];[a0_0x2cdf9a(0x215)];[a0_0x2cdf9a(0x183)];[a0_0x2cdf9a(0x205)]=[];constructor(_0x5e42ee){const _0x49a0a9=a0_0x2cdf9a;super(),this[_0x49a0a9(0xbf)]=_0x5e42ee[_0x49a0a9(0xbf)],this[_0x49a0a9(0x1b5)]=_0x5e42ee[_0x49a0a9(0x1b5)],this[_0x49a0a9(0x215)]=_0x5e42ee[_0x49a0a9(0x215)],this[_0x49a0a9(0x183)]=_0x5e42ee['logger'];}async[a0_0x2cdf9a(0x10a)](){const _0x38ead1=a0_0x2cdf9a,_0x310701=await this[_0x38ead1(0x138)]();if(_0x310701)return new FailReporter({'failMessage':_0x38ead1(0x1b4)});return this['logger']['info'](_0x38ead1(0x1ff)),this['logger'][_0x38ead1(0x217)](_0x38ead1(0x114)),await this['retrieveDifference'](),this[_0x38ead1(0x183)][_0x38ead1(0x217)](_0x38ead1(0x1a4)),new CheckoutReporter({'currentBranch':{'id':this[_0x38ead1(0x215)]['id'],'name':this[_0x38ead1(0x215)][_0x38ead1(0x127)],'headCommitId':this[_0x38ead1(0x215)][_0x38ead1(0x134)]},'changes':this[_0x38ead1(0x205)]});}async['areChanges'](){const _0x40556d=a0_0x2cdf9a,_0x3f242d=await this[_0x40556d(0xbf)][_0x40556d(0xde)]();return!!_0x3f242d[_0x40556d(0xc7)];}async[a0_0x2cdf9a(0x13a)](){const _0x512f09=a0_0x2cdf9a,{devopsUrl:_0x34d5f9,accessToken:_0x49e3a2}=this[_0x512f09(0x1b5)],_0x25df72=await this['manager']['compareWithRemoteBranch']({'devopsUrl':_0x34d5f9,'accessToken':_0x49e3a2,'targetBranchId':this['targetBranch']['id'],'targetCommitId':this['targetBranch']['headCommitId']});for(const {id:_0x545b96,name:_0x5bddd7,type:_0x213aae,changeType:_0x2f90fc}of _0x25df72){if(!_0x545b96){if(_0x2f90fc!==ChangeType['DELETE'])throw new Error(_0x512f09(0xcb));await this[_0x512f09(0xbf)][_0x512f09(0x147)]({'name':_0x5bddd7,'type':_0x213aae,'changeType':_0x2f90fc}),this['componentChanges'][_0x512f09(0x10e)]({'changeType':_0x2f90fc,'name':_0x5bddd7,'type':_0x213aae});continue;}const _0x5510f5=await ApiService['retrieveComponentById']({'devopsUrl':_0x34d5f9,'accessToken':_0x49e3a2,'componentId':_0x545b96});if(!_0x5510f5[_0x512f09(0x1c3)])throw new Error(_0x512f09(0x1db)+_0x5510f5['name']+_0x512f09(0xe8)+_0x5510f5[_0x512f09(0xd5)]+_0x512f09(0x172));await this[_0x512f09(0xbf)][_0x512f09(0x147)]({'name':_0x5bddd7,'type':_0x213aae,'changeType':_0x2f90fc,'component':{..._0x5510f5,'fHash':_0x5510f5[_0x512f09(0x1c3)]}}),this[_0x512f09(0x205)][_0x512f09(0x10e)]({'changeType':_0x2f90fc,'name':_0x5bddd7,'type':_0x213aae,'paths':_0x5510f5[_0x512f09(0xe6)][_0x512f09(0xf3)](_0x3d70c6=>_0x3d70c6['path'])});}this[_0x512f09(0xbf)][_0x512f09(0x243)](this[_0x512f09(0x215)]);}}class TargetBranchNotFoundHandler extends BaseHandler{[a0_0x2cdf9a(0x1d3)];[a0_0x2cdf9a(0xbf)];[a0_0x2cdf9a(0x1b5)];[a0_0x2cdf9a(0x17c)];[a0_0x2cdf9a(0x183)];constructor(_0x91401a){const _0x31a7d1=a0_0x2cdf9a;super(),this['projectPath']=_0x91401a[_0x31a7d1(0x1d3)],this['manager']=_0x91401a[_0x31a7d1(0xbf)],this[_0x31a7d1(0x1b5)]=_0x91401a[_0x31a7d1(0x1b5)],this[_0x31a7d1(0x17c)]=_0x91401a['targetBranchName'],this[_0x31a7d1(0x183)]=_0x91401a[_0x31a7d1(0x183)];}async['handle'](){const _0x4c3b28=a0_0x2cdf9a;this['logger']['info']('Creation\x20new\x20branch\x20started');const {id:_0x54df37}=await this[_0x4c3b28(0xbf)][_0x4c3b28(0x12a)](this[_0x4c3b28(0x1d3)]);if(!_0x54df37)return new FailReporter({'failMessage':'To\x20create\x20a\x20new\x20branch\x20a\x20branch\x20should\x20be\x20selected.\x20Checkout\x20on\x20any\x20existing\x20branch'});const _0x2b535d=await ApiService[_0x4c3b28(0xed)]({'accessToken':this['credentials'][_0x4c3b28(0xbd)],'devopsUrl':this['credentials'][_0x4c3b28(0x143)],'name':this[_0x4c3b28(0x17c)],'parentId':_0x54df37});return this['manager']['saveBranchState'](_0x2b535d),this['manager'][_0x4c3b28(0x14a)](![]),this[_0x4c3b28(0x183)][_0x4c3b28(0x217)]('Creation\x20new\x20branch\x20completed'),new CheckoutReporter({'currentBranch':_0x2b535d,'changes':[]});}}function a0_0x21da(_0x6a94f3,_0x2261f9){const _0x9c5978=a0_0x173a();return a0_0x21da=function(_0x269aa1,_0x433cef){_0x269aa1=_0x269aa1-0xb6;let _0x173a8e=_0x9c5978[_0x269aa1];return _0x173a8e;},a0_0x21da(_0x6a94f3,_0x2261f9);}class HandlerFactory{static['create'](_0x482c3b){const _0x389d17=a0_0x2cdf9a;if(_0x482c3b[_0x389d17(0x215)])return new TargetBranchExistHandler({..._0x482c3b,'targetBranch':_0x482c3b[_0x389d17(0x215)]});if(!_0x482c3b[_0x389d17(0x215)])return new TargetBranchNotFoundHandler(_0x482c3b);throw new Error(_0x389d17(0x128));}}class CheckoutCommand extends BaseCommand{[a0_0x2cdf9a(0x23f)]=a0_0x2cdf9a(0x1c5);['description']=a0_0x2cdf9a(0x102);[a0_0x2cdf9a(0xdf)]=[];['options']=[{'flags':'-b,\x20--branch\x20<string>','description':a0_0x2cdf9a(0xd0)},{'flags':a0_0x2cdf9a(0x190),'description':a0_0x2cdf9a(0x186),'defaultValue':![]}];[a0_0x2cdf9a(0x1d3)]=process[a0_0x2cdf9a(0x1dc)]();['manager']=ProjectManager[a0_0x2cdf9a(0x1f2)]();async[a0_0x2cdf9a(0x20c)]([{branch:_0x33ae20}]){const _0x469665=a0_0x2cdf9a,_0x308da1=await this['getBranchName'](_0x33ae20);this[_0x469665(0x183)][_0x469665(0x217)](_0x469665(0x1a9)+_0x308da1+_0x469665(0x120));const _0x37e98f=await this[_0x469665(0xbf)]['isInitialized'](this[_0x469665(0x1d3)]);if(!_0x37e98f)return this[_0x469665(0x183)][_0x469665(0x19e)](_0x469665(0x211)),new FailReporter({'failMessage':'Project\x20is\x20not\x20initialized'});const _0x37f3cc=await this[_0x469665(0x109)](),_0xa59a91=await ApiService[_0x469665(0x202)](_0x37f3cc);await this[_0x469665(0xbf)]['initStage'](this[_0x469665(0x1d3)]);try{const _0xd45523=await ApiService[_0x469665(0x1b6)]({'devopsUrl':_0xa59a91[_0x469665(0x143)],'accessToken':_0xa59a91['accessToken'],'branchName':_0x308da1}),_0x3f3f3c=HandlerFactory['create']({'projectPath':this[_0x469665(0x1d3)],'manager':this['manager'],'credentials':_0xa59a91,'targetBranch':_0xd45523,'targetBranchName':_0x308da1,'logger':this['logger']}),_0x1a2126=await _0x3f3f3c['handle']();return _0x1a2126[_0x469665(0x1ad)]?(await this['manager'][_0x469665(0xba)](),this[_0x469665(0x183)]['info'](_0x469665(0x1a9)+_0x308da1+_0x469665(0xe3))):await this[_0x469665(0xbf)]['abortStage'](),_0x1a2126;}catch(_0x21fbe0){await this[_0x469665(0xbf)][_0x469665(0x156)]();throw _0x21fbe0;}}[a0_0x2cdf9a(0xf1)]([{json:_0x38e44b}]){return _0x38e44b;}async[a0_0x2cdf9a(0x229)](_0x12e6a2){const _0x285bc4=a0_0x2cdf9a;if(_0x12e6a2)return _0x12e6a2;return ReadlineUtils[_0x285bc4(0x226)]('Enter\x20a\x20branch\x20name:\x20');}async[a0_0x2cdf9a(0x109)](){const _0x1e9177=a0_0x2cdf9a,{credentialsAlias:_0x2bf60e}=await this[_0x1e9177(0xbf)]['readConfig'](this[_0x1e9177(0x1d3)]);if(!_0x2bf60e)throw new Error(_0x1e9177(0xc6));if(typeof _0x2bf60e!==_0x1e9177(0x10c))throw new Error(_0x1e9177(0x1a1));return _0x2bf60e;}}class CloneReporter extends BaseReporter{[a0_0x2cdf9a(0x1d3)];[a0_0x2cdf9a(0xe2)];constructor({projectPath:_0x3c099c,components:_0x381f29}){const _0x436255=a0_0x2cdf9a;super({'success':!![]}),this[_0x436255(0x1d3)]=_0x3c099c,this[_0x436255(0xe2)]=_0x381f29;}[a0_0x2cdf9a(0xca)](){const _0x1e56bd=a0_0x2cdf9a;return{'success':this[_0x1e56bd(0x1ad)],'projectPath':this['projectPath'],'components':this[_0x1e56bd(0xe2)]};}[a0_0x2cdf9a(0x150)](_0x305780){const _0x2af171=a0_0x2cdf9a;console['log'](_0x2af171(0xd1));const _0x545e51=[['Project\x20Path'],[_0x305780[_0x2af171(0x1d3)]]];console['log'](table[_0x2af171(0x221)](_0x545e51,{'columns':[{'width':0x28}]})),console[_0x2af171(0xdd)](_0x2af171(0x194));const _0x102eb2=[['Name',_0x2af171(0x20e),_0x2af171(0x16c)]];for(const {name:_0x14f8cf,type:_0x1e2dc7,paths:_0x58ce19}of _0x305780[_0x2af171(0xe2)]){_0x102eb2[_0x2af171(0x10e)]([_0x14f8cf,_0x1e2dc7,_0x58ce19[_0x2af171(0x11b)]('\x0a')]);}console[_0x2af171(0xdd)](table[_0x2af171(0x221)](_0x102eb2,{'columns':[{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class CloneCommand extends BaseCommand{[a0_0x2cdf9a(0x23f)]=a0_0x2cdf9a(0x122);[a0_0x2cdf9a(0x17e)]=a0_0x2cdf9a(0x1e8);['arguments']=[];[a0_0x2cdf9a(0x1b1)]=[{'flags':'-n,\x20--name\x20<string>','description':a0_0x2cdf9a(0x247)},{'flags':a0_0x2cdf9a(0xc1),'description':'Alias\x20of\x20credentials\x20which\x20will\x20be\x20used\x20to\x20retrieve\x20your\x20components\x20from\x20devops.','defaultValue':DEFAULT_ALIAS_NAME},{'flags':a0_0x2cdf9a(0x190),'description':a0_0x2cdf9a(0x186),'defaultValue':![]}];[a0_0x2cdf9a(0xbf)]=ProjectManager[a0_0x2cdf9a(0x1f2)]();[a0_0x2cdf9a(0x166)]=[];['_credentials'];get['credentials'](){const _0x1fed3d=a0_0x2cdf9a;if(!this[_0x1fed3d(0xb7)])throw new Error(_0x1fed3d(0xb6));return this[_0x1fed3d(0xb7)];}async[a0_0x2cdf9a(0x20c)]([_0x30eba6]){const _0x49405e=a0_0x2cdf9a;this['logger'][_0x49405e(0x217)](_0x49405e(0x218)),this[_0x49405e(0xb7)]=await ApiService['getCredentials'](_0x30eba6['alias']);const _0x356605=await this['buildProjectPath'](_0x30eba6['name']);this[_0x49405e(0x183)]['info'](_0x49405e(0x23c));const _0x458406=await this[_0x49405e(0xbf)][_0x49405e(0x249)](_0x356605);if(_0x458406)return this['logger'][_0x49405e(0x19e)](_0x49405e(0x193)),new FailReporter({'failMessage':_0x49405e(0x193)});await this[_0x49405e(0xbf)]['initStage'](_0x356605);try{return await this[_0x49405e(0xbf)][_0x49405e(0x105)]({'config':{'credentialsAlias':_0x30eba6[_0x49405e(0x196)]}}),this[_0x49405e(0x183)][_0x49405e(0x217)]('Project\x20initialization\x20completed'),await this['retrieve'](),await this[_0x49405e(0xbf)][_0x49405e(0xba)](),this['logger'][_0x49405e(0x217)](_0x49405e(0xd8)),new CloneReporter({'projectPath':_0x356605,'components':this[_0x49405e(0x166)]});}catch(_0x2195d6){await this[_0x49405e(0xbf)][_0x49405e(0x156)]();throw _0x2195d6;}}[a0_0x2cdf9a(0xf1)]([{json:_0x484fdf}]){return _0x484fdf;}async['retrieve'](){const _0x272b41=a0_0x2cdf9a;this[_0x272b41(0x183)]['info'](_0x272b41(0x114));const {accessToken:_0x11c84f,devopsUrl:_0x29805c}=this[_0x272b41(0x1b5)],_0xffb496=await ApiService['getDefaultBranch']({'devopsUrl':_0x29805c,'accessToken':_0x11c84f});this[_0x272b41(0xbf)][_0x272b41(0x243)](_0xffb496);for await(const _0x119374 of ApiService[_0x272b41(0x1d2)]({'devopsUrl':_0x29805c,'accessToken':_0x11c84f,'branchId':_0xffb496['id'],'commitId':_0xffb496[_0x272b41(0x134)]})){if(!_0x119374[_0x272b41(0x1c3)])throw new Error(_0x119374[_0x272b41(0x127)]+_0x272b41(0x20b)+_0x119374[_0x272b41(0xd5)]+_0x272b41(0xf2));await this[_0x272b41(0xbf)][_0x272b41(0x147)]({'name':_0x119374['name'],'type':_0x119374['type'],'changeType':ChangeType['CREATE'],'component':{..._0x119374,'fHash':_0x119374[_0x272b41(0x1c3)]}}),this[_0x272b41(0x166)]['push']({'name':_0x119374[_0x272b41(0x127)],'type':_0x119374[_0x272b41(0xd5)],'paths':_0x119374[_0x272b41(0xe6)][_0x272b41(0xf3)](_0x1dcf3b=>_0x1dcf3b['path'])});}this[_0x272b41(0x183)][_0x272b41(0x217)]('Retrieve\x20components\x20completed');}async[a0_0x2cdf9a(0xdb)](_0x57c6b8){const _0x1b133e=a0_0x2cdf9a;if(_0x57c6b8)return node_path['join'](process[_0x1b133e(0x1dc)](),_0x57c6b8);const _0x2f0251=await ReadlineUtils[_0x1b133e(0x226)](_0x1b133e(0x1af));return node_path[_0x1b133e(0x11b)](process[_0x1b133e(0x1dc)](),_0x2f0251);}}class CommitReporter extends BaseReporter{[a0_0x2cdf9a(0xfa)];constructor({changes:_0x5e8182}){super({'success':!![]}),this['changes']=_0x5e8182;}[a0_0x2cdf9a(0xca)](){const _0x4ceede=a0_0x2cdf9a;return{'success':this[_0x4ceede(0x1ad)],'changes':this['changes']};}[a0_0x2cdf9a(0x150)](_0x363f9f){const _0x2cde79=a0_0x2cdf9a;console[_0x2cde79(0xdd)](_0x2cde79(0xcf));const _0x34b7c1=[[_0x2cde79(0xfc),_0x2cde79(0x1b3),_0x2cde79(0x20e),_0x2cde79(0x16c)]];for(const {changeType:_0x577cc6,name:_0x4044fd,type:_0x59f72f,paths:_0x2b97c7}of _0x363f9f['changes']){_0x34b7c1['push']([_0x577cc6,_0x4044fd,_0x59f72f,_0x2b97c7?.[_0x2cde79(0x11b)]('\x0a')||'']);}console[_0x2cde79(0xdd)](table[_0x2cde79(0x221)](_0x34b7c1,{'columns':[{},{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class CommitCommand extends BaseCommand{['commandName']=a0_0x2cdf9a(0x228);[a0_0x2cdf9a(0x17e)]=a0_0x2cdf9a(0xcd);['arguments']=[];['options']=[{'flags':'-m,\x20--message\x20<string>','description':a0_0x2cdf9a(0x1a7)},{'flags':a0_0x2cdf9a(0x190),'description':a0_0x2cdf9a(0x186),'defaultValue':![]}];[a0_0x2cdf9a(0x1d3)]=process['cwd']();[a0_0x2cdf9a(0xbf)]=ProjectManager['getInstance']();[a0_0x2cdf9a(0x205)]=[];[a0_0x2cdf9a(0xb7)];[a0_0x2cdf9a(0x145)];['_localHeadCommit'];[a0_0x2cdf9a(0x240)];get[a0_0x2cdf9a(0x1b5)](){const _0x35fd70=a0_0x2cdf9a;if(!this[_0x35fd70(0xb7)])throw new Error(_0x35fd70(0xb6));return this[_0x35fd70(0xb7)];}get[a0_0x2cdf9a(0x1fb)](){const _0x3f0ab1=a0_0x2cdf9a;if(!this['_branchId'])throw new Error(_0x3f0ab1(0x13e));return this['_branchId'];}get[a0_0x2cdf9a(0x108)](){if(!this['_localHeadCommit'])throw new Error('Local\x20head\x20commit\x20id\x20not\x20found');return this['_localHeadCommit'];}get[a0_0x2cdf9a(0xfa)](){const _0x424046=a0_0x2cdf9a;if(!this[_0x424046(0x240)])throw new Error(_0x424046(0x14d));return this[_0x424046(0x240)];}async[a0_0x2cdf9a(0x20c)]([_0x1cd5b3]){const _0x5d4b54=a0_0x2cdf9a;this[_0x5d4b54(0x183)][_0x5d4b54(0x217)]('Commit\x20started');const _0x35f42b=await this[_0x5d4b54(0xbf)][_0x5d4b54(0x249)](this[_0x5d4b54(0x1d3)]);if(!_0x35f42b)return this['logger'][_0x5d4b54(0x19e)](_0x5d4b54(0x211)),new FailReporter({'failMessage':_0x5d4b54(0x211)});const _0x18b9c4=await this[_0x5d4b54(0x1e7)](_0x1cd5b3['message']);await this[_0x5d4b54(0x23a)](),await this[_0x5d4b54(0x202)]();const _0x1852cb=await this['areRemoteChanges']();if(_0x1852cb)return this[_0x5d4b54(0x183)][_0x5d4b54(0x19e)](_0x5d4b54(0x169)),new FailReporter({'failMessage':_0x5d4b54(0x169)});await this[_0x5d4b54(0xbf)][_0x5d4b54(0x198)](this[_0x5d4b54(0x1d3)]);try{this[_0x5d4b54(0x240)]=await this[_0x5d4b54(0xbf)][_0x5d4b54(0xde)]();if(!this[_0x5d4b54(0xfa)][_0x5d4b54(0xc7)])return this[_0x5d4b54(0x183)]['warn'](_0x5d4b54(0x208)),new FailReporter({'failMessage':_0x5d4b54(0x208)});return await this['findAndCommitChanges'](_0x18b9c4),await this[_0x5d4b54(0xbf)][_0x5d4b54(0xba)](),this['logger'][_0x5d4b54(0x217)](_0x5d4b54(0x113)),new CommitReporter({'changes':this[_0x5d4b54(0x205)]});}catch(_0x1b53f7){await this[_0x5d4b54(0xbf)]['abortStage']();throw _0x1b53f7;}}[a0_0x2cdf9a(0xf1)]([{json:_0x2fde4c}]){return _0x2fde4c;}async['getMessage'](_0x31d35d){const _0x4ed549=a0_0x2cdf9a;if(_0x31d35d)return _0x31d35d;const _0x12e2ac=await ReadlineUtils['askString'](_0x4ed549(0x21a));return _0x12e2ac;}async[a0_0x2cdf9a(0x202)](){const _0x405612=a0_0x2cdf9a,{credentialsAlias:_0x3c4bcc}=await this['manager']['readConfig'](this['projectPath']);if(!_0x3c4bcc)throw new Error('Credentials\x20alias\x20is\x20not\x20configured');if(typeof _0x3c4bcc!==_0x405612(0x10c))throw new Error(_0x405612(0x1a1));this[_0x405612(0xb7)]=await ApiService[_0x405612(0x202)](_0x3c4bcc);}async['getBranchState'](){const _0x1fe3e7=a0_0x2cdf9a,{id:_0x120a36,headCommitId:_0x33ba08}=await this[_0x1fe3e7(0xbf)][_0x1fe3e7(0x12a)](this[_0x1fe3e7(0x1d3)]);this['_branchId']=_0x120a36||void 0x0,this[_0x1fe3e7(0x21f)]=_0x33ba08||void 0x0;}async[a0_0x2cdf9a(0x11e)](){const _0x5329cb=a0_0x2cdf9a,{headCommitId:_0x20f41c}=await ApiService['getBranchById']({'accessToken':this['credentials'][_0x5329cb(0xbd)],'devopsUrl':this[_0x5329cb(0x1b5)]['devopsUrl'],'branchId':this[_0x5329cb(0x1fb)]});return this[_0x5329cb(0x108)]!==_0x20f41c;}async[a0_0x2cdf9a(0x162)](_0x42b595){const _0x194d8f=a0_0x2cdf9a;this[_0x194d8f(0x183)][_0x194d8f(0x217)]('Detecting\x20changes\x20started');const _0x52efa8=await ApiService[_0x194d8f(0x203)]({'accessToken':this['credentials'][_0x194d8f(0xbd)],'devopsUrl':this['credentials'][_0x194d8f(0x143)]}),_0x241950={'accessToken':this[_0x194d8f(0x1b5)][_0x194d8f(0xbd)],'devopsUrl':this[_0x194d8f(0x1b5)][_0x194d8f(0x143)],'message':_0x42b595,'branchId':this[_0x194d8f(0x1fb)],'components':[],'userName':_0x52efa8[_0x194d8f(0x144)]+'\x20'+_0x52efa8['lastName']};for(const _0x4dd40c of this[_0x194d8f(0xfa)]){const _0x57aa46=await this[_0x194d8f(0xbf)]['updateComponentState'](_0x4dd40c),_0x433ea8=this['convertToLocalComponent'](_0x57aa46[_0x194d8f(0x127)],_0x57aa46[_0x194d8f(0xd5)],_0x57aa46?.[_0x194d8f(0x123)]||[]);_0x241950[_0x194d8f(0xe2)]['push'](_0x433ea8),this[_0x194d8f(0x205)][_0x194d8f(0x10e)](_0x57aa46);}this[_0x194d8f(0x183)]['info'](_0x194d8f(0xf4)+this['changes'][_0x194d8f(0xc7)]+_0x194d8f(0x209)),await ApiService[_0x194d8f(0x228)](_0x241950);const _0x26cee2=await ApiService[_0x194d8f(0x12f)]({'accessToken':this[_0x194d8f(0x1b5)]['accessToken'],'devopsUrl':this[_0x194d8f(0x1b5)][_0x194d8f(0x143)],'branchId':this[_0x194d8f(0x1fb)]});this[_0x194d8f(0xbf)][_0x194d8f(0x243)](_0x26cee2);}[a0_0x2cdf9a(0x160)](_0x229d7a,_0x33dd97,_0x37d4e2){const _0x5ff3b4=a0_0x2cdf9a,_0x538957={'name':_0x229d7a,'type':_0x33dd97,'files':[]};for(const _0x9f8d1d of _0x37d4e2){const _0x4141be=_0x9f8d1d[_0x5ff3b4(0x15e)](path['sep'])[_0x5ff3b4(0x246)](0x3)[_0x5ff3b4(0x11b)]('/'),_0x3e18fd=path[_0x5ff3b4(0x11b)](this[_0x5ff3b4(0x1d3)],_0x9f8d1d);_0x538957['files'][_0x5ff3b4(0x10e)]({'path':_0x4141be,'localPath':_0x3e18fd});}return _0x538957;}}class ConfigSetReporter extends BaseReporter{[a0_0x2cdf9a(0x248)];['value'];constructor({configName:_0x1abc77,value:_0x2ae062}){const _0x1fa724=a0_0x2cdf9a;super({'success':!![]}),this['configName']=_0x1abc77,this[_0x1fa724(0x131)]=_0x2ae062;}['buildReport'](){const _0x3f538f=a0_0x2cdf9a;return{'success':this[_0x3f538f(0x1ad)],'configName':this[_0x3f538f(0x248)],'value':this[_0x3f538f(0x131)]};}[a0_0x2cdf9a(0x150)](_0x448135){const _0xa61bd4=a0_0x2cdf9a,_0x246880=[[_0xa61bd4(0x140),_0xa61bd4(0x232)],[_0x448135[_0xa61bd4(0x248)],_0x448135[_0xa61bd4(0x131)]]];console[_0xa61bd4(0xdd)](table['table'](_0x246880));}}const ALLOWED_VALUES=[ConfigName[a0_0x2cdf9a(0x189)]+'(string)'];class ConfigSetCommand extends BaseCommand{[a0_0x2cdf9a(0x23f)]=a0_0x2cdf9a(0xf9);['description']=a0_0x2cdf9a(0x233);['arguments']=[{'name':'<config-name>','description':a0_0x2cdf9a(0x242)+ALLOWED_VALUES[a0_0x2cdf9a(0x11b)](',\x20')+'.'},{'name':a0_0x2cdf9a(0x158),'description':'Config\x20value'}];['options']=[{'flags':a0_0x2cdf9a(0x190),'description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];[a0_0x2cdf9a(0xbf)]=ProjectManager[a0_0x2cdf9a(0x1f2)]();async['execute']([_0x516d36,_0x2cb48d]){const _0x282fe6=a0_0x2cdf9a;this[_0x282fe6(0x183)][_0x282fe6(0x217)]('Config\x20set\x20started');const _0x522301=process[_0x282fe6(0x1dc)](),_0x5815ce=await this[_0x282fe6(0xbf)][_0x282fe6(0x249)](_0x522301);if(!_0x5815ce)return this[_0x282fe6(0x183)][_0x282fe6(0x19e)](_0x282fe6(0x211)),new FailReporter({'failMessage':'Project\x20is\x20not\x20initialized'});await this['manager'][_0x282fe6(0x198)](_0x522301);try{return await this[_0x282fe6(0xbf)]['setConfig'](_0x516d36,_0x2cb48d),await this[_0x282fe6(0xbf)]['applyStage'](),this['logger'][_0x282fe6(0x217)]('Config\x20set\x20completed'),new ConfigSetReporter({'configName':_0x516d36,'value':_0x2cb48d});}catch(_0x3b59d0){await this['manager'][_0x282fe6(0x156)]();throw _0x3b59d0;}}[a0_0x2cdf9a(0xf1)]([,,{json:_0x53ab9e}]){return _0x53ab9e;}}class ConfigUnsetReporter extends BaseReporter{['configName'];constructor(_0x3ebf0f){const _0x59c338=a0_0x2cdf9a;super({'success':!![]}),this[_0x59c338(0x248)]=_0x3ebf0f[_0x59c338(0x248)];}['buildReport'](){const _0x25f748=a0_0x2cdf9a;return{'success':!![],'configName':this[_0x25f748(0x248)],'value':null};}[a0_0x2cdf9a(0x150)](_0x2a488f){const _0x2597f9=a0_0x2cdf9a,_0x5117b2=[[_0x2597f9(0x140),_0x2597f9(0x232)],[_0x2a488f['configName'],_0x2a488f[_0x2597f9(0x131)]||'NULL']];console[_0x2597f9(0xdd)](table['table'](_0x5117b2));}}class ConfigUnset extends BaseCommand{[a0_0x2cdf9a(0x23f)]=a0_0x2cdf9a(0x20d);[a0_0x2cdf9a(0x17e)]=a0_0x2cdf9a(0x187);[a0_0x2cdf9a(0xdf)]=[{'name':a0_0x2cdf9a(0x1e5),'description':'Config\x20name.\x20Allowed\x20values:\x20'+Object[a0_0x2cdf9a(0x214)](ConfigName)[a0_0x2cdf9a(0x11b)](',\x20')+'.'}];['options']=[{'flags':'--json','description':a0_0x2cdf9a(0x186),'defaultValue':![]}];[a0_0x2cdf9a(0x1d3)]=process[a0_0x2cdf9a(0x1dc)]();['manager']=ProjectManager['getInstance']();async['execute']([_0x30b290]){const _0x544aac=a0_0x2cdf9a;this['logger'][_0x544aac(0x217)](_0x544aac(0x1cd));const _0x4e6180=await this[_0x544aac(0xbf)][_0x544aac(0x249)](this[_0x544aac(0x1d3)]);if(!_0x4e6180)return this[_0x544aac(0x183)][_0x544aac(0x19e)]('Project\x20is\x20not\x20initialized'),new FailReporter({'failMessage':_0x544aac(0x211)});await this[_0x544aac(0xbf)][_0x544aac(0x198)](this['projectPath']);try{return await this[_0x544aac(0xbf)][_0x544aac(0x142)](_0x30b290),await this[_0x544aac(0xbf)][_0x544aac(0xba)](),this['logger']['info']('Config\x20set\x20completed'),new ConfigUnsetReporter({'configName':_0x30b290});}catch(_0x5e33a4){await this[_0x544aac(0xbf)]['abortStage']();throw _0x5e33a4;}}[a0_0x2cdf9a(0xf1)]([,{json:_0x119270}]){return _0x119270;}}class InitReporter extends BaseReporter{[a0_0x2cdf9a(0x1d3)];constructor({projectPath:_0x2dfd61}){const _0x4e6565=a0_0x2cdf9a;super({'success':!![]}),this[_0x4e6565(0x1d3)]=_0x2dfd61;}['buildReport'](){const _0xcdc2ef=a0_0x2cdf9a;return{'success':this[_0xcdc2ef(0x1ad)],'projectPath':this['projectPath']};}['print'](_0x4896ed){const _0x3e3b64=a0_0x2cdf9a,_0x4900bf=[['Project\x20Path'],[_0x4896ed[_0x3e3b64(0x1d3)]]];console[_0x3e3b64(0xdd)](table[_0x3e3b64(0x221)](_0x4900bf,{'columns':[{'width':0x28}]}));}}class InitCommand extends BaseCommand{['commandName']=a0_0x2cdf9a(0x212);['description']=a0_0x2cdf9a(0x238);[a0_0x2cdf9a(0xdf)]=[];[a0_0x2cdf9a(0x1b1)]=[{'flags':'-n,\x20--name\x20<string>','description':a0_0x2cdf9a(0x247)},{'flags':a0_0x2cdf9a(0x190),'description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];[a0_0x2cdf9a(0xbf)]=ProjectManager[a0_0x2cdf9a(0x1f2)]();async['execute']([_0x3898d6]){const _0x46d5ae=a0_0x2cdf9a;this['logger'][_0x46d5ae(0x217)](_0x46d5ae(0x23c));const _0x35676c=await this[_0x46d5ae(0xdb)](_0x3898d6[_0x46d5ae(0x127)]),_0x5e291=await this[_0x46d5ae(0xbf)][_0x46d5ae(0x249)](_0x35676c);if(_0x5e291)return this[_0x46d5ae(0x183)][_0x46d5ae(0x19e)](_0x46d5ae(0x193)),new FailReporter({'failMessage':_0x46d5ae(0x193)});await this[_0x46d5ae(0xbf)][_0x46d5ae(0x198)](_0x35676c);try{return await this['manager'][_0x46d5ae(0x105)]({}),await this[_0x46d5ae(0xbf)][_0x46d5ae(0xba)](),this[_0x46d5ae(0x183)][_0x46d5ae(0x217)]('Project\x20initialization\x20completed'),new InitReporter({'projectPath':_0x35676c});}catch(_0x101783){await this[_0x46d5ae(0xbf)][_0x46d5ae(0x156)]();throw _0x101783;}}['isJson']([{json:_0x298a70}]){return _0x298a70;}async['buildProjectPath'](_0x4503bf){const _0x51ab2f=a0_0x2cdf9a;if(_0x4503bf)return node_path[_0x51ab2f(0x11b)](process['cwd'](),_0x4503bf);const _0x2ab5f6=await ReadlineUtils[_0x51ab2f(0x226)](_0x51ab2f(0x1af));return node_path[_0x51ab2f(0x11b)](process[_0x51ab2f(0x1dc)](),_0x2ab5f6);}}class ListBranchesReporter extends BaseReporter{[a0_0x2cdf9a(0x167)];constructor(_0x3bcfb3){const _0x59ee6a=a0_0x2cdf9a;super({'success':!![]}),this[_0x59ee6a(0x167)]=_0x3bcfb3['branches'];}['buildReport'](){const _0x469d6c=a0_0x2cdf9a;return{'success':this[_0x469d6c(0x1ad)],'branches':this['branches']};}[a0_0x2cdf9a(0x150)](_0x4ceea0){const _0x1e2cee=a0_0x2cdf9a,_0x24f3c0=[[_0x1e2cee(0x174)]];for(const _0x2e7605 of _0x4ceea0['branches']){_0x24f3c0[_0x1e2cee(0x10e)]([_0x2e7605]);}console[_0x1e2cee(0xdd)](table[_0x1e2cee(0x221)](_0x24f3c0,{'columns':[{'width':0x1e}]}));}}class ListBranchesCommand extends BaseCommand{[a0_0x2cdf9a(0x23f)]=a0_0x2cdf9a(0x1f8);[a0_0x2cdf9a(0x17e)]=a0_0x2cdf9a(0x1f7);['arguments']=[];[a0_0x2cdf9a(0x1b1)]=[{'flags':a0_0x2cdf9a(0x190),'description':a0_0x2cdf9a(0x186),'defaultValue':![]}];[a0_0x2cdf9a(0x1d3)]=process['cwd']();[a0_0x2cdf9a(0xbf)]=ProjectManager[a0_0x2cdf9a(0x1f2)]();async['execute'](){const _0x1c9659=a0_0x2cdf9a;this[_0x1c9659(0x183)][_0x1c9659(0x217)](_0x1c9659(0x23d));const _0x3fdc6e=await this[_0x1c9659(0xbf)][_0x1c9659(0x249)](this[_0x1c9659(0x1d3)]);if(!_0x3fdc6e)return this['logger'][_0x1c9659(0x19e)](_0x1c9659(0x211)),new FailReporter({'failMessage':_0x1c9659(0x211)});const _0x53bcd6=await this[_0x1c9659(0x109)](),{accessToken:_0x349bdf,devopsUrl:_0x1465a4}=await ApiService[_0x1c9659(0x202)](_0x53bcd6),_0x45b138=await ApiService[_0x1c9659(0x1fa)]({'accessToken':_0x349bdf,'devopsUrl':_0x1465a4});return this['logger'][_0x1c9659(0x217)](_0x1c9659(0xea)),new ListBranchesReporter({'branches':_0x45b138[_0x1c9659(0xf3)](_0x132463=>_0x132463[_0x1c9659(0x127)])});}[a0_0x2cdf9a(0xf1)]([{json:_0x457db0}]){return _0x457db0;}async[a0_0x2cdf9a(0x109)](){const _0x35a7e7=a0_0x2cdf9a,{credentialsAlias:_0x25d4e5}=await this[_0x35a7e7(0xbf)][_0x35a7e7(0x146)](this['projectPath']);if(!_0x25d4e5)throw new Error(_0x35a7e7(0xc6));if(typeof _0x25d4e5!=='string')throw new Error('Invalid\x20credentials\x20type');return _0x25d4e5;}}class ListCredentialsReporter extends BaseReporter{[a0_0x2cdf9a(0x1b5)];constructor(_0x2b3bf2){const _0x2a8e66=a0_0x2cdf9a;super({'success':!![]}),this['credentials']=_0x2b3bf2[_0x2a8e66(0x1b5)];}[a0_0x2cdf9a(0xca)](){const _0x243939=a0_0x2cdf9a;return{'success':this[_0x243939(0x1ad)],'credentials':this[_0x243939(0x1b5)]};}[a0_0x2cdf9a(0x150)](_0xb8834f){const _0x1ca6ed=a0_0x2cdf9a,_0x4f27f=[[_0x1ca6ed(0x244),'Global\x20Settings\x20Url',_0x1ca6ed(0x16a)]];for(const {alias:_0x2865f4,globalSettingsUrl:_0x55cf6c,devopsUrl:_0x1f8b2e}of _0xb8834f[_0x1ca6ed(0x1b5)]){_0x4f27f[_0x1ca6ed(0x10e)]([_0x2865f4,_0x55cf6c,_0x1f8b2e||_0x1ca6ed(0xf8)]);}console['log'](table[_0x1ca6ed(0x221)](_0x4f27f));}}class ListCredentialsCommand extends BaseCommand{['commandName']=a0_0x2cdf9a(0x22f);['description']='Display\x20all\x20authorized\x20credentials.';[a0_0x2cdf9a(0xdf)]=[];[a0_0x2cdf9a(0x1b1)]=[{'flags':'--json','description':a0_0x2cdf9a(0x186),'defaultValue':![]}];async[a0_0x2cdf9a(0x20c)](){const _0x38442e=a0_0x2cdf9a;this[_0x38442e(0x183)]['info'](_0x38442e(0x1bd));const _0x250952=await CredentialsManager[_0x38442e(0x201)]();return this['logger']['info'](_0x38442e(0x12c)),new ListCredentialsReporter({'credentials':_0x250952[_0x38442e(0xf3)](({alias:_0x1826c8,globalSettingsUrl:_0x354c8f,devopsUrl:_0x315819})=>({'alias':_0x1826c8,'globalSettingsUrl':_0x354c8f,'devopsUrl':_0x315819}))});}[a0_0x2cdf9a(0xf1)]([{json:_0x34a539}]){return _0x34a539;}}class LoginAction{constructor(_0x121781){this['accessToken']=_0x121781;}async[a0_0x2cdf9a(0x20c)](){const _0x59c2f9=a0_0x2cdf9a;try{const _0x5f08e1=JSON[_0x59c2f9(0x14f)](Buffer[_0x59c2f9(0x213)](this[_0x59c2f9(0xbd)],_0x59c2f9(0x173))['toString'](_0x59c2f9(0x179))),_0x571005=await axios[_0x59c2f9(0x231)]('/api/v1/links',{'headers':{'authorization':_0x59c2f9(0x11a)+this[_0x59c2f9(0xbd)]},'baseURL':_0x5f08e1['applicationUrl']})['then'](({data:_0x547a5c})=>new Map(_0x547a5c['map'](_0xb323e6=>[_0xb323e6[_0x59c2f9(0x127)],_0xb323e6[_0x59c2f9(0x12e)]]))),_0x14c680={'globalSettingsUrl':_0x5f08e1['applicationUrl']};for(const [_0x453234,_0x54b38d]of _0x571005['entries']()){_0x453234===_0x59c2f9(0x23e)&&(_0x14c680[_0x59c2f9(0x143)]=_0x54b38d);}return _0x14c680;}catch(_0x371698){if(axios[_0x59c2f9(0x23b)](_0x371698))throw Error(_0x371698[_0x59c2f9(0x11c)]?.[_0x59c2f9(0x164)][_0x59c2f9(0x1b7)]||_0x371698[_0x59c2f9(0x11c)]?.[_0x59c2f9(0x11f)]||_0x371698[_0x59c2f9(0x1b7)],{'cause':_0x371698});throw _0x371698;}}}class GlobalSettingsService{static async[a0_0x2cdf9a(0x121)]({accessToken:_0x243b18}){const _0x163b4e=a0_0x2cdf9a,_0x36e52d=new LoginAction(_0x243b18);return _0x36e52d[_0x163b4e(0x20c)]();}}class LoginReporter extends BaseReporter{['alias'];[a0_0x2cdf9a(0x153)];[a0_0x2cdf9a(0x143)];constructor({alias:_0x3a2b41,globalSettingsUrl:_0x4f965e,devopsUrl:_0x2983f9}){const _0x563276=a0_0x2cdf9a;super({'success':!![]}),this[_0x563276(0x196)]=_0x3a2b41,this[_0x563276(0x153)]=_0x4f965e,this[_0x563276(0x143)]=_0x2983f9;}[a0_0x2cdf9a(0xca)](){const _0x56af28=a0_0x2cdf9a;return{'success':this[_0x56af28(0x1ad)],'alias':this['alias'],'globalSettingsUrl':this[_0x56af28(0x153)],'devopsUrl':this[_0x56af28(0x143)]};}[a0_0x2cdf9a(0x150)](_0x4f7008){const _0x43ee3e=a0_0x2cdf9a,_0x52c738=[['Alias',_0x43ee3e(0x236),_0x43ee3e(0x16a)],[_0x4f7008[_0x43ee3e(0x196)],_0x4f7008['globalSettingsUrl'],_0x4f7008['devopsUrl']||_0x43ee3e(0xf8)]];console[_0x43ee3e(0xdd)](table[_0x43ee3e(0x221)](_0x52c738));}}class LoginCommand extends BaseCommand{[a0_0x2cdf9a(0x23f)]=a0_0x2cdf9a(0x121);[a0_0x2cdf9a(0x17e)]=a0_0x2cdf9a(0x225);['arguments']=[];[a0_0x2cdf9a(0x1b1)]=[{'flags':a0_0x2cdf9a(0xc1),'description':'Alias\x20which\x20saved\x20credentials\x20will\x20be\x20accessed\x20with.','defaultValue':DEFAULT_ALIAS_NAME},{'flags':a0_0x2cdf9a(0x139),'description':a0_0x2cdf9a(0x1e9)+ROOT_NAME+a0_0x2cdf9a(0x206)},{'flags':a0_0x2cdf9a(0x190),'description':a0_0x2cdf9a(0x186),'defaultValue':![]}];async['execute']([_0x5a68eb]){const _0x5396a5=a0_0x2cdf9a;this['logger'][_0x5396a5(0x217)]('Login\x20started');const _0x3a425b=await this[_0x5396a5(0x101)](_0x5a68eb[_0x5396a5(0xf6)]),_0x5b9ea3=await GlobalSettingsService[_0x5396a5(0x121)]({'accessToken':_0x3a425b});return await CredentialsManager[_0x5396a5(0x1b0)]({'alias':_0x5a68eb[_0x5396a5(0x196)],'accessToken':_0x3a425b,'globalSettingsUrl':_0x5b9ea3[_0x5396a5(0x153)],'devopsUrl':_0x5b9ea3[_0x5396a5(0x143)]}),this['logger'][_0x5396a5(0x217)](_0x5396a5(0x1c2)+_0x5a68eb[_0x5396a5(0x196)]+'\x22'),new LoginReporter({'alias':_0x5a68eb[_0x5396a5(0x196)],'globalSettingsUrl':_0x5b9ea3['globalSettingsUrl'],'devopsUrl':_0x5b9ea3[_0x5396a5(0x143)]});}[a0_0x2cdf9a(0xf1)]([{json:_0x3b873f}]){return _0x3b873f;}async[a0_0x2cdf9a(0x101)](_0x328869){const _0x2efed1=a0_0x2cdf9a;if(_0x328869)return _0x328869;const _0x2e4e51=await ReadlineUtils[_0x2efed1(0x226)]('Enter\x20api\x20token:\x20');return _0x2e4e51;}}const DELETED_STATUS=a0_0x2cdf9a(0x1d6);class LogoutReporter extends BaseReporter{[a0_0x2cdf9a(0x196)];constructor({alias:_0x255de3}){super({'success':!![]}),this['alias']=_0x255de3;}['buildReport'](){const _0x14c6ca=a0_0x2cdf9a;return{'success':this[_0x14c6ca(0x1ad)],'alias':this[_0x14c6ca(0x196)],'status':DELETED_STATUS};}[a0_0x2cdf9a(0x150)](_0x4ab271){const _0x34f335=a0_0x2cdf9a,_0x23e901=[['Alias',_0x34f335(0xff)],[_0x4ab271[_0x34f335(0x196)],_0x4ab271[_0x34f335(0xee)]]];console[_0x34f335(0xdd)](table[_0x34f335(0x221)](_0x23e901));}}class LogoutCommand extends BaseCommand{[a0_0x2cdf9a(0x23f)]=a0_0x2cdf9a(0x104);['description']='Delete\x20saved\x20credentials.';[a0_0x2cdf9a(0xdf)]=[];['options']=[{'flags':'-a,\x20--alias\x20<string>','description':'Saved\x20credentials\x20alias.','defaultValue':DEFAULT_ALIAS_NAME},{'flags':a0_0x2cdf9a(0x190),'description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];async[a0_0x2cdf9a(0x20c)]([_0x4e4d6]){const _0xc43a34=a0_0x2cdf9a;return this[_0xc43a34(0x183)][_0xc43a34(0x217)](_0xc43a34(0x237)),await CredentialsManager[_0xc43a34(0x1e4)]({'alias':_0x4e4d6['alias']}),this[_0xc43a34(0x183)][_0xc43a34(0x217)](_0xc43a34(0x182)),new LogoutReporter({'alias':_0x4e4d6[_0xc43a34(0x196)]});}[a0_0x2cdf9a(0xf1)]([{json:_0x419cc0}]){return _0x419cc0;}}class PullReporter extends BaseReporter{[a0_0x2cdf9a(0xfa)];constructor({changes:_0x1b5dac}){const _0x3b788b=a0_0x2cdf9a;super({'success':!![]}),this[_0x3b788b(0xfa)]=_0x1b5dac;}[a0_0x2cdf9a(0xca)](){const _0x54a133=a0_0x2cdf9a;return{'success':this['success'],'changes':this[_0x54a133(0xfa)]};}[a0_0x2cdf9a(0x150)](_0x20d002){const _0x26c1f5=a0_0x2cdf9a;console['log'](_0x26c1f5(0x1d8));const _0x416a5f=[[_0x26c1f5(0xfc),_0x26c1f5(0x1b3),_0x26c1f5(0x20e),_0x26c1f5(0x16c)]];for(const {changeType:_0x3a5c7c,name:_0x506282,type:_0xb36f0e,paths:_0x4a0fa5}of _0x20d002[_0x26c1f5(0xfa)]){_0x416a5f[_0x26c1f5(0x10e)]([_0x3a5c7c,_0x506282,_0xb36f0e,_0x4a0fa5?.[_0x26c1f5(0x11b)]('\x0a')||'']);}console[_0x26c1f5(0xdd)](table[_0x26c1f5(0x221)](_0x416a5f,{'columns':[{},{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class PullCommand extends BaseCommand{['commandName']='pull';[a0_0x2cdf9a(0x17e)]=a0_0x2cdf9a(0x14c);[a0_0x2cdf9a(0xdf)]=[];[a0_0x2cdf9a(0x1b1)]=[{'flags':a0_0x2cdf9a(0x190),'description':a0_0x2cdf9a(0x186),'defaultValue':![]}];['projectPath']=process[a0_0x2cdf9a(0x1dc)]();[a0_0x2cdf9a(0xbf)]=ProjectManager[a0_0x2cdf9a(0x1f2)]();[a0_0x2cdf9a(0x205)]=[];['_credentials'];get['credentials'](){const _0x29a62f=a0_0x2cdf9a;if(!this['_credentials'])throw new Error(_0x29a62f(0xb6));return this[_0x29a62f(0xb7)];}async[a0_0x2cdf9a(0x20c)](){const _0xb968bb=a0_0x2cdf9a;this[_0xb968bb(0x183)][_0xb968bb(0x217)]('Pulling\x20latest\x20updates\x20started');const _0x3eb1fe=await this[_0xb968bb(0xbf)]['isInitialized'](this[_0xb968bb(0x1d3)]);if(!_0x3eb1fe)return this[_0xb968bb(0x183)]['warn']('Project\x20is\x20not\x20initialized'),new FailReporter({'failMessage':'Project\x20is\x20not\x20initialized'});const _0x277485=await this[_0xb968bb(0x109)]();this['_credentials']=await ApiService[_0xb968bb(0x202)](_0x277485);const {id:_0x23e233,headCommitId:_0x17e953}=await this[_0xb968bb(0xbf)][_0xb968bb(0x12a)](this[_0xb968bb(0x1d3)]);if(!_0x23e233)return this[_0xb968bb(0x183)][_0xb968bb(0x19e)](_0xb968bb(0x1ee)),new FailReporter({'failMessage':_0xb968bb(0x1ee)});const _0x5e2d0e=await ApiService['getBranchById']({'accessToken':this['credentials']['accessToken'],'devopsUrl':this[_0xb968bb(0x1b5)][_0xb968bb(0x143)],'branchId':_0x23e233});if(_0x17e953===_0x5e2d0e[_0xb968bb(0x134)])return new PullReporter({'changes':this[_0xb968bb(0x205)]});await this['manager']['initStage'](this[_0xb968bb(0x1d3)]);try{this['logger']['info'](_0xb968bb(0x177));const _0xd38a12=await this[_0xb968bb(0x138)]();if(_0xd38a12)return this[_0xb968bb(0x183)][_0xb968bb(0x19e)](_0xb968bb(0x1b4)),await this[_0xb968bb(0xbf)][_0xb968bb(0x156)](),new FailReporter({'failMessage':_0xb968bb(0x1b4)});return this['logger']['info'](_0xb968bb(0x1ff)),this['logger'][_0xb968bb(0x217)](_0xb968bb(0x114)),await this['retrieveDifference'](_0x5e2d0e),this[_0xb968bb(0x183)][_0xb968bb(0x217)](_0xb968bb(0x1a4)),await this[_0xb968bb(0xbf)]['applyStage'](),this['logger'][_0xb968bb(0x217)](_0xb968bb(0xfb)),new PullReporter({'changes':this[_0xb968bb(0x205)]});}catch(_0x37cef6){await this[_0xb968bb(0xbf)][_0xb968bb(0x156)]();throw _0x37cef6;}}[a0_0x2cdf9a(0xf1)]([{json:_0x160840}]){return _0x160840;}async['getCredentialsAlias'](){const _0x495000=a0_0x2cdf9a,{credentialsAlias:_0xd4eba7}=await this['manager'][_0x495000(0x146)](this[_0x495000(0x1d3)]);if(!_0xd4eba7)throw new Error(_0x495000(0xc6));if(typeof _0xd4eba7!==_0x495000(0x10c))throw new Error(_0x495000(0x1a1));return _0xd4eba7;}async[a0_0x2cdf9a(0x138)](){const _0x439c4e=a0_0x2cdf9a,_0x5d6ecc=await this[_0x439c4e(0xbf)][_0x439c4e(0xde)]();return!!_0x5d6ecc[_0x439c4e(0xc7)];}async[a0_0x2cdf9a(0x13a)](_0x4616eb){const _0x5cb18f=a0_0x2cdf9a,{devopsUrl:_0x489249,accessToken:_0x2b5534}=this[_0x5cb18f(0x1b5)],_0x158e12=await this[_0x5cb18f(0xbf)][_0x5cb18f(0x13c)]({'devopsUrl':_0x489249,'accessToken':_0x2b5534,'targetBranchId':_0x4616eb['id'],'targetCommitId':_0x4616eb['headCommitId']});for(const {id:_0x3097b8,name:_0x5f537a,type:_0x14cacd,changeType:_0x4e88cc}of _0x158e12){if(!_0x3097b8){if(_0x4e88cc!==ChangeType[_0x5cb18f(0x1df)])throw new Error(_0x5cb18f(0xcb));await this[_0x5cb18f(0xbf)][_0x5cb18f(0x147)]({'name':_0x5f537a,'type':_0x14cacd,'changeType':_0x4e88cc}),this[_0x5cb18f(0x205)][_0x5cb18f(0x10e)]({'changeType':_0x4e88cc,'name':_0x5f537a,'type':_0x14cacd});continue;}const _0x161ad4=await ApiService[_0x5cb18f(0x1c7)]({'devopsUrl':_0x489249,'accessToken':_0x2b5534,'componentId':_0x3097b8});if(!_0x161ad4[_0x5cb18f(0x1c3)])throw new Error(_0x5cb18f(0x1db)+_0x161ad4[_0x5cb18f(0x127)]+_0x5cb18f(0xe8)+_0x161ad4[_0x5cb18f(0xd5)]+'\x22\x20not\x20found');await this['manager'][_0x5cb18f(0x147)]({'name':_0x5f537a,'type':_0x14cacd,'changeType':_0x4e88cc,'component':{..._0x161ad4,'fHash':_0x161ad4[_0x5cb18f(0x1c3)]}}),this['componentChanges'][_0x5cb18f(0x10e)]({'changeType':_0x4e88cc,'name':_0x5f537a,'type':_0x14cacd,'paths':_0x161ad4[_0x5cb18f(0xe6)][_0x5cb18f(0xf3)](_0x375e52=>_0x375e52[_0x5cb18f(0x16e)])});}await this[_0x5cb18f(0xbf)]['saveBranchState'](_0x4616eb);}}class RollbackReporter extends BaseReporter{[a0_0x2cdf9a(0x1ef)];constructor({fileChanges:_0x4c2d73}){const _0x28342a=a0_0x2cdf9a;super({'success':!![]}),this[_0x28342a(0x1ef)]=_0x4c2d73;}['buildReport'](){const _0x453e47=a0_0x2cdf9a;return{'success':this['success'],'fileChanges':this[_0x453e47(0x1ef)]};}[a0_0x2cdf9a(0x150)](_0x68072f){const _0x42abd0=a0_0x2cdf9a;console['log'](_0x42abd0(0x116));const _0x308e95=[[_0x42abd0(0xfc),_0x42abd0(0x1bf)]];for(const {changeType:_0x2c4c7e,path:_0x3d8cea}of _0x68072f[_0x42abd0(0x1ef)]){_0x308e95[_0x42abd0(0x10e)]([_0x2c4c7e,_0x3d8cea]);}console[_0x42abd0(0xdd)](table[_0x42abd0(0x221)](_0x308e95,{'columns':[{},{'width':0x28}]}));}}class RollbackCommand extends BaseCommand{['commandName']=a0_0x2cdf9a(0x176);[a0_0x2cdf9a(0x17e)]='Roll\x20back\x20your\x20branch\x20state\x20to\x20last\x20committed\x20one.';[a0_0x2cdf9a(0xdf)]=[];['options']=[{'flags':'--json','description':a0_0x2cdf9a(0x186),'defaultValue':![]}];['projectPath']=process[a0_0x2cdf9a(0x1dc)]();[a0_0x2cdf9a(0xbf)]=ProjectManager[a0_0x2cdf9a(0x1f2)]();['rollbackTypes']=new Map();[a0_0x2cdf9a(0x19c)]=[];[a0_0x2cdf9a(0x185)]=[];[a0_0x2cdf9a(0xb7)];[a0_0x2cdf9a(0x145)];['_headCommitId'];get[a0_0x2cdf9a(0x1b5)](){const _0x4096ed=a0_0x2cdf9a;if(!this[_0x4096ed(0xb7)])throw new Error(_0x4096ed(0xb6));return this[_0x4096ed(0xb7)];}get[a0_0x2cdf9a(0x1fb)](){const _0x2d8ad4=a0_0x2cdf9a;if(!this[_0x2d8ad4(0x145)])throw new Error(_0x2d8ad4(0x13e));return this[_0x2d8ad4(0x145)];}get[a0_0x2cdf9a(0x134)](){const _0x20c624=a0_0x2cdf9a;if(!this[_0x20c624(0x1b9)])throw new Error(_0x20c624(0x1bc));return this[_0x20c624(0x1b9)];}async['execute'](){const _0x46129c=a0_0x2cdf9a;this[_0x46129c(0x183)]['info'](_0x46129c(0xe4));const _0x49291a=await this[_0x46129c(0xbf)]['isInitialized'](this[_0x46129c(0x1d3)]);if(!_0x49291a)return this[_0x46129c(0x183)][_0x46129c(0x19e)](_0x46129c(0x211)),new FailReporter({'failMessage':_0x46129c(0x211)});const _0x1eb860=await this['getCredentialsAlias']();this[_0x46129c(0xb7)]=await ApiService[_0x46129c(0x202)](_0x1eb860),await this[_0x46129c(0x23a)](),await this[_0x46129c(0xbf)][_0x46129c(0x198)](this[_0x46129c(0x1d3)]);try{this['logger']['info'](_0x46129c(0x13d)),await this['defineRollbackTypes']();if(!this[_0x46129c(0x1cb)][_0x46129c(0x1da)])return this[_0x46129c(0x183)][_0x46129c(0x217)](_0x46129c(0x1f0)),new RollbackReporter({'fileChanges':this[_0x46129c(0x185)]});return this[_0x46129c(0x183)][_0x46129c(0x217)](_0x46129c(0x10b)+this[_0x46129c(0x1cb)][_0x46129c(0x1da)]+_0x46129c(0x1b2)),this[_0x46129c(0x183)][_0x46129c(0x217)](_0x46129c(0x15b)),await this[_0x46129c(0x176)](),this[_0x46129c(0x183)]['info'](_0x46129c(0x1d4)),await this[_0x46129c(0xbf)][_0x46129c(0xba)](),this[_0x46129c(0x183)][_0x46129c(0x217)](_0x46129c(0x1fd)),new RollbackReporter({'fileChanges':this['filesChanges']});}catch(_0x249c6b){await this[_0x46129c(0xbf)][_0x46129c(0x156)]();throw _0x249c6b;}}['isJson']([{json:_0x2cfb97}]){return _0x2cfb97;}async[a0_0x2cdf9a(0x109)](){const _0x55215f=a0_0x2cdf9a,{credentialsAlias:_0x3491b5}=await this[_0x55215f(0xbf)]['readConfig'](this[_0x55215f(0x1d3)]);if(!_0x3491b5)throw new Error(_0x55215f(0xc6));if(typeof _0x3491b5!==_0x55215f(0x10c))throw new Error(_0x55215f(0x1a1));return _0x3491b5;}async[a0_0x2cdf9a(0x23a)](){const _0x4ebb08=a0_0x2cdf9a,{id:_0x47d734,headCommitId:_0x1d2b65}=await this['manager'][_0x4ebb08(0x12a)](this['projectPath']);if(!_0x47d734||!_0x1d2b65)throw new Error('A\x20branch\x20is\x20not\x20selected.\x20Use\x20\x22flosum\x20devops\x20checkout\x22\x20at\x20first');this[_0x4ebb08(0x145)]=_0x47d734||void 0x0,this[_0x4ebb08(0x1b9)]=_0x1d2b65||void 0x0;}async[a0_0x2cdf9a(0x176)](){const _0x3c7080=a0_0x2cdf9a;if(this[_0x3c7080(0x19c)]['length'])for await(const {files:_0x41d55a}of ApiService[_0x3c7080(0x1d2)]({'devopsUrl':this['credentials'][_0x3c7080(0x143)],'accessToken':this[_0x3c7080(0x1b5)]['accessToken'],'branchId':this[_0x3c7080(0x1fb)],'commitId':this[_0x3c7080(0x134)],'components':this['componentsForRetrieve']})){await this['handleRestore'](_0x41d55a);}for(const [_0x4ab790,_0x387412]of this[_0x3c7080(0x1cb)][_0x3c7080(0x155)]()){if(_0x387412!==ChangeType['DELETE'])throw new Error(_0x3c7080(0xbc)+_0x4ab790+_0x3c7080(0x168));await this[_0x3c7080(0xbf)][_0x3c7080(0x1f9)]({'path':_0x4ab790,'changeType':_0x387412});}return{'success':!![]};}async[a0_0x2cdf9a(0x222)](){const _0x3a1f8f=a0_0x2cdf9a,_0x339c0c=await this[_0x3a1f8f(0xbf)][_0x3a1f8f(0xde)]();for(const {name:_0x34d815,type:_0x32fe3b,changes:_0x238023}of _0x339c0c){let _0x532a66=![];for(const {path:_0x4021b7,changeType:_0xbbb303}of _0x238023){let _0xed78fd;_0xbbb303===ChangeType[_0x3a1f8f(0x239)]?_0xed78fd=ChangeType[_0x3a1f8f(0x1df)]:(_0xed78fd=_0xbbb303===ChangeType[_0x3a1f8f(0x1df)]?ChangeType[_0x3a1f8f(0x239)]:ChangeType[_0x3a1f8f(0x199)],_0x532a66=!![]),this[_0x3a1f8f(0x1cb)][_0x3a1f8f(0x191)](_0x4021b7,_0xed78fd),this[_0x3a1f8f(0x185)]['push']({'changeType':_0xed78fd,'path':_0x4021b7});}_0x532a66&&this[_0x3a1f8f(0x19c)][_0x3a1f8f(0x10e)]({'name':_0x34d815,'type':_0x32fe3b});}}async[a0_0x2cdf9a(0x188)](_0x2b4f68){const _0xb30c4b=a0_0x2cdf9a;for(const {path:_0x5430ee,content:_0x76ff24}of _0x2b4f68){const _0x119dfe=path[_0xb30c4b(0x11b)](COMPONENT_PROJECT_PATH,_0x5430ee),_0x57745c=this[_0xb30c4b(0x1cb)][_0xb30c4b(0x231)](_0x119dfe);if(!_0x57745c)continue;await this['manager'][_0xb30c4b(0x1f9)]({'path':_0x119dfe,'content':_0x76ff24,'changeType':_0x57745c}),this['rollbackTypes']['delete'](_0x119dfe);}}}class StatusReporter extends BaseReporter{[a0_0x2cdf9a(0x130)];constructor({pendingChanges:_0x3ce7ed}){const _0x11e3d7=a0_0x2cdf9a;super({'success':!![]}),this[_0x11e3d7(0x130)]=_0x3ce7ed;}['buildReport'](){const _0x326f6c=a0_0x2cdf9a;return{'success':this[_0x326f6c(0x1ad)],'pendingChanges':this[_0x326f6c(0x130)]};}[a0_0x2cdf9a(0x150)](_0x5e6b16){const _0x15f2ac=a0_0x2cdf9a;console[_0x15f2ac(0xdd)](_0x15f2ac(0x17f));const _0x400d0e=[[_0x15f2ac(0xfc),'File']];for(const {changeType:_0x4827a9,path:_0x7c3206}of _0x5e6b16[_0x15f2ac(0x130)]){_0x400d0e[_0x15f2ac(0x10e)]([_0x4827a9,_0x7c3206]);}console[_0x15f2ac(0xdd)](table[_0x15f2ac(0x221)](_0x400d0e,{'columns':[{},{'width':0x28}]}));}}class StatusCommand extends BaseCommand{[a0_0x2cdf9a(0x23f)]=a0_0x2cdf9a(0xee);['description']=a0_0x2cdf9a(0x1e6);[a0_0x2cdf9a(0xdf)]=[];[a0_0x2cdf9a(0x1b1)]=[{'flags':a0_0x2cdf9a(0x190),'description':a0_0x2cdf9a(0x186),'defaultValue':![]}];['projectPath']=process[a0_0x2cdf9a(0x1dc)]();[a0_0x2cdf9a(0xbf)]=ProjectManager[a0_0x2cdf9a(0x1f2)]();[a0_0x2cdf9a(0x130)]=[];async[a0_0x2cdf9a(0x20c)](){const _0x43419e=a0_0x2cdf9a;this[_0x43419e(0x183)]['info'](_0x43419e(0x13f));const _0x59e623=await this[_0x43419e(0xbf)][_0x43419e(0x249)](this[_0x43419e(0x1d3)]);if(!_0x59e623)return this[_0x43419e(0x183)][_0x43419e(0x19e)](_0x43419e(0x211)),new FailReporter({'failMessage':_0x43419e(0x211)});await this['manager'][_0x43419e(0x198)](this[_0x43419e(0x1d3)]);const _0x34895c=await this[_0x43419e(0xbf)][_0x43419e(0xde)]();for(const {changes:_0x109558}of _0x34895c){for(const {changeType:_0x26aa0f,path:_0x5c8b5b}of _0x109558){this[_0x43419e(0x130)][_0x43419e(0x10e)]({'changeType':_0x26aa0f,'path':_0x5c8b5b});}}return await this['manager'][_0x43419e(0x156)](),this[_0x43419e(0x183)][_0x43419e(0x217)](_0x43419e(0x129)),new StatusReporter({'pendingChanges':this[_0x43419e(0x130)]});}[a0_0x2cdf9a(0xf1)]([{json:_0x18e9a4}]){return _0x18e9a4;}}configurePathEnv();const ROOT_COMMANDS=[LoginCommand,LogoutCommand,ListCredentialsCommand],DEVOPS_COMMANDS=[InitCommand,CloneCommand,CheckoutCommand,ConfigSetCommand,ConfigUnset,PullCommand,CommitCommand,RollbackCommand,StatusCommand,ListBranchesCommand],root=new commander[(a0_0x2cdf9a(0x20f))]()[a0_0x2cdf9a(0x127)](ROOT_NAME)['description'](a0_0x2cdf9a(0x161)+ROOT_NAME+a0_0x2cdf9a(0x18d))[a0_0x2cdf9a(0xf0)](config[a0_0x2cdf9a(0xf0)]);for(const command of ROOT_COMMANDS){new command()[a0_0x2cdf9a(0x1f6)](root);}const devops=new commander[(a0_0x2cdf9a(0x20f))]()[a0_0x2cdf9a(0x127)](a0_0x2cdf9a(0xdc))[a0_0x2cdf9a(0x17e)](a0_0x2cdf9a(0x21c));for(const command of DEVOPS_COMMANDS){new command()[a0_0x2cdf9a(0x1f6)](devops);}root[a0_0x2cdf9a(0x141)](devops),root[a0_0x2cdf9a(0x14f)]();function configurePathEnv(){const _0x51154e=a0_0x2cdf9a,_0x3d0054=process['env'][_0x51154e(0x1c4)]?.[_0x51154e(0x15e)](node_path['delimiter']);if(!_0x3d0054)throw new Error(_0x51154e(0xe0));const _0x224807=node_path[_0x51154e(0x11b)](node_path[_0x51154e(0xda)](__dirname),_0x51154e(0x1d1),_0x51154e(0x119));_0x3d0054[_0x51154e(0x10e)](_0x224807),process[_0x51154e(0x136)][_0x51154e(0x1c4)]=_0x3d0054[_0x51154e(0x11b)](node_path[_0x51154e(0x21e)]);}function a0_0x173a(){const _0x4201c0=['Component\x20id\x20not\x20found\x20after\x20comparison','sep','Commit\x20local\x20changes\x20to\x20a\x20remote\x20branch\x20on\x20devops.','lastStageTimestamp','Committed\x20Components:','A\x20branch\x20name\x20which\x20you\x20checkout\x20on.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.','Init\x20Result:','15970MmcsiQ','7QVlRgU','indexes','type','isUpdateStageTimestamp','updateSystemFiles','Cloning\x20completed','readdir','dirname','buildProjectPath','devops','log','findChanges','arguments','PATH\x20env\x20not\x20found','1265mDCERX','components','\x22\x20completed','Rolling\x20back\x20to\x20last\x20committed\x20state\x20started','all','files','/commits','\x22\x20of\x20type\x20\x22','deleteComponent','Listing\x20remote\x20branches\x20completed','applyCreateUpdate','node:fs/promises','createBranch','status','findIndex','version','isJson','\x20was\x20deleted','map','Detecting\x20changes\x20completed.\x20','indexOf','token','findDeletedAndUpdated','Not\x20Found','config-set','changes','Pulling\x20latest\x20updates\x20completed','Change\x20Type','Current\x20Branch:\x20','cleanUpEmptyFolders','Status','listComponentsGenerator','getAccessToken','Checkout\x20on\x20another\x20branch.\x20Checkout\x20command\x20retrieves\x20components\x20missing\x20locally.','then','logout','initProject','changeFile','credentials.json','localHeadCommit','getCredentialsAlias','handle','Looking\x20for\x20changes\x20completed.\x20','string','branchState','push','count','createInterface','_branchState','option','Commit\x20completed','Retrieve\x20components\x20started','targetCommitId','Rolled\x20Back\x20Changes:','find','update','.bin','Token\x20','join','response','getAllCredentials','areRemoteChanges','statusText','\x22\x20started','login','clone','paths','instance','Update','includes','name','Checkout\x20handler\x20not\x20found','Status\x20calculation\x20completed','readBranchState','componentsState','List\x20credentials\x20completed','catch','api','getBranchById','pendingChanges','value','search','5920212wnsmeX','headCommitId','isDirectory','env','stat','areChanges','-t,\x20--token\x20<string>','retrieveDifference','readFile','compareWithRemoteBranch','Looking\x20for\x20changes\x20started','Branch\x20id\x20not\x20found','Status\x20calculation\x20started','Config\x20Name','addCommand','unsetConfig','devopsUrl','firstName','_branchId','readConfig','saveComponent','Unknown\x20config\x20name:\x20','Credentials\x20with\x20alias\x20\x22','setIsUpdateStageTimestamp','printJson','Pull\x20latest\x20branch\x20commit\x20from\x20devops.','Changes\x20not\x20found','Fail\x20Message','parse','print','homedir','updateComponent','globalSettingsUrl','setConfig','entries','abortStage','3582FCqlpm','<value>','1180xwALSV','readComponentsState','Rollback\x20started','listComponents','access','split','Devops\x20url\x20not\x20found','convertToLocalComponent','CLI\x20for\x20work\x20with\x20','findAndCommitChanges','branchName','data','updateBranchState','retrievedComponents','branches','\x22\x20wasn\x27t\x20restored','Local\x20and\x20remote\x20head\x20commits\x20don\x27t\x20match.\x20Use\x20\x22flosum\x20devops\x20pull\x22\x20to\x20retrieve\x20latest\x20updates\x20from\x20devops','Devops\x20Url','W_OK','Files','currentBranch','path','commitDate','debug','bind','\x22\x20not\x20found','base64','Branch\x20Name','flosum','rollback','Checking\x20manual\x20changes\x20started','isDirectoryExists','utf-8','Component\x20','ROOT_COMMANDS','targetBranchName','mkdir','description','Pending\x20Changes:','filter','writeFile','Logout\x20completed','logger','R_OK','filesChanges','Applies\x20json\x20formatted\x20result.','Clear\x20project\x20config\x20property.','handleRestore','CREDENTIALS_ALIAS','sfdx-project.json','updateComponentState','fit/branches/','\x20services','branch-state.json','_success','--json','set','stringify','Project\x20has\x20already\x20been\x20initialized.\x20Duplicate\x20initialization\x20is\x20not\x20allowed.','Retrieve\x20Result:','errorDebug','alias','14UqRiDC','initStage','UPDATE','question','Update:\x20Component\x20','componentsForRetrieve','getFolderFilePaths','warn','3450pJvVXw','changeType','Invalid\x20credentials\x20type','copyFile','3969972VDMHAc','Retrieve\x20components\x20completed','post','_stagePath','Commit\x20message.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.','fit/branches','Checkout\x20on\x20\x22','total','.stage','Delete','success','error','Enter\x20project\x20name:\x20','save','options','\x20files\x20will\x20be\x20rolled\x20back','Name','Uncommitted\x20changes\x20found.\x20Commit\x20or\x20rollback\x20them\x20to\x20proceed','credentials','getBranch','message','fit/file-versions/','_headCommitId','warnDebug','stagePath','Head\x20commit\x20id\x20not\x20found','List\x20credentials\x20started','failMessage','File','isFileExists','node:readline/promises','Login\x20successfully\x20completed.\x20You\x20credentials\x20are\x20saved\x20with\x20alias\x20\x22','fHash','PATH','checkout','createComponent','retrieveComponentById','rmdir','has','node:crypto','rollbackTypes','rows','Config\x20set\x20started','replace',':WARN','registerFileChange','node_modules','retrieveComponents','projectPath','Rollback\x20completed','node:path','Deleted','splice','Component\x20Updates:','getDefaultBranch','size','fHash\x20for\x20component\x20\x22','cwd','argument','\x22\x20already\x20exists','DELETE','commitId','Missing\x20content\x20for\x20not\x20Delete\x20change\x20type','digest','parentId','delete','<config-name>','Return\x20all\x20local\x20not\x20committed\x20changes.','getMessage','Initialize\x20salesforce\x20project\x20and\x20retrieve\x20\x22main\x22\x20branch\x20from\x20registered\x20devops\x20tenant.','Token\x20for\x20getting\x20access\x20to\x20','stdin','createHash','apply','1175rdUBjb','A\x20branch\x20is\x20not\x20selected.\x20Use\x20\x22flosum\x20devops\x20checkout\x22\x20at\x20first','fileChanges','No\x20changes\x20for\x20rollback','auth/me','getInstance','_componentsState','trunc','force-app','register','List\x20all\x20remote\x20branches.','list-branches','addFileChange','listBranches','branchId','report','Rolling\x20back\x20to\x20last\x20committed\x20state\x20completed','userName','Checking\x20manual\x20changes\x20completed','26ztcvAo','list','getCredentials','getMe','close','componentChanges','\x20services.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.','_logger','No\x20Local\x20Changes','\x20components\x20will\x20be\x20committed','toString','\x20of\x20type\x20','execute','config-unset','Type','Command','constants','Project\x20is\x20not\x20initialized','init','from','values','targetBranch','applyFileChanges','info','Cloning\x20started','_stage','Enter\x20commit\x20message:\x20','targetBranchId','Devops\x20commands','content','delimiter','_localHeadCommit','3381936QGTkNg','table','defineRollbackTypes','isFile','basename','Login\x20into\x20global\x20settings\x20and\x20retrieve\x20data\x20about\x20related\x20services.','askString','color','commit','getBranchName','scan','SfProjectScanner','_projectPath','_isUpdateStageTimestamp','components-state.json','list-credentials','handleFileChange','get','Value','Set\x20project\x20config.','applyDelete','getUpdatedComponentChanges','Global\x20Settings\x20Url','Logout\x20started','Create\x20salesforce\x20project\x20and\x20cli\x20system\x20files.','CREATE','getBranchState','isAxiosError','Project\x20initialization\x20started','Listing\x20remote\x20branches\x20started','DevOps','commandName','_changes','Stage\x20folder\x20not\x20found','Config\x20name.\x20Allowed\x20values:\x20','saveBranchState','Alias','Project\x20Updates:','slice','A\x20name\x20of\x20a\x20folder\x20where\x20a\x20project\x20will\x20be\x20stored.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.','configName','isInitialized','enable','Credentials\x20not\x20found','_credentials','stage','abort','applyStage','config','File\x20\x22','accessToken','Create','manager','infoDebug','-a,\x20--alias\x20<string>','default','CLI','calculateComponentHash','flat','Credentials\x20alias\x20is\x20not\x20configured','length','2228oTNqUO','component','buildReport'];a0_0x173a=function(){return _0x4201c0;};return a0_0x173a();}exports['DEVOPS_COMMANDS']=DEVOPS_COMMANDS,exports[a0_0x2cdf9a(0x17b)]=ROOT_COMMANDS;
|
|
2
|
+
const a0_0x216d83=a0_0x3826;(function(_0x524d71,_0x458f6c){const _0x2d72c6=a0_0x3826,_0x539e1f=_0x524d71();while(!![]){try{const _0x37dd41=-parseInt(_0x2d72c6(0x317))/0x1*(-parseInt(_0x2d72c6(0x2fb))/0x2)+-parseInt(_0x2d72c6(0x2c0))/0x3+parseInt(_0x2d72c6(0x2fc))/0x4+parseInt(_0x2d72c6(0x285))/0x5+-parseInt(_0x2d72c6(0x31b))/0x6*(-parseInt(_0x2d72c6(0x20e))/0x7)+-parseInt(_0x2d72c6(0x1ef))/0x8*(parseInt(_0x2d72c6(0x27b))/0x9)+parseInt(_0x2d72c6(0x2a5))/0xa;if(_0x37dd41===_0x458f6c)break;else _0x539e1f['push'](_0x539e1f['shift']());}catch(_0x121916){_0x539e1f['push'](_0x539e1f['shift']());}}}(a0_0x5404,0x7fc16));const a0_0x3c45d3=(function(){let _0x4bb14c=!![];return function(_0x97cfa9,_0x3a62e7){const _0x473194=_0x4bb14c?function(){const _0x522076=a0_0x3826;if(_0x3a62e7){const _0x282f3d=_0x3a62e7[_0x522076(0x336)](_0x97cfa9,arguments);return _0x3a62e7=null,_0x282f3d;}}:function(){};return _0x4bb14c=![],_0x473194;};}()),a0_0x25e96e=a0_0x3c45d3(this,function(){const _0x35bd58=a0_0x3826;return a0_0x25e96e['toString']()[_0x35bd58(0x270)](_0x35bd58(0x1da))[_0x35bd58(0x249)]()[_0x35bd58(0x28a)](a0_0x25e96e)[_0x35bd58(0x270)](_0x35bd58(0x1da));});a0_0x25e96e();'use strict';var node_path=require(a0_0x216d83(0x2cb)),commander=require(a0_0x216d83(0x288)),promises=require('node:fs/promises'),node_os=require(a0_0x216d83(0x29e)),axios=require('axios'),salesforce=require('@flosum/salesforce'),node_crypto=require('node:crypto'),readline=require(a0_0x216d83(0x207)),debug=require(a0_0x216d83(0x292)),table=require(a0_0x216d83(0x242)),path=require(a0_0x216d83(0x1f6)),version=a0_0x216d83(0x320),config={'version':version};const ROOT_NAME=a0_0x216d83(0x23f),DEFAULT_ALIAS_NAME='default';class FileUtils{static async[a0_0x216d83(0x20f)](_0x230ca7){const _0x4e1f2d=a0_0x216d83,_0x49324f=await promises[_0x4e1f2d(0x334)](_0x230ca7,{'withFileTypes':!![]}),_0x4d0651=[];for(const _0x3a27da of _0x49324f){const _0x47f267=node_path['join'](_0x230ca7,_0x3a27da['name']);if(_0x3a27da[_0x4e1f2d(0x2be)]()){const _0x40d98e=await FileUtils[_0x4e1f2d(0x20f)](_0x47f267);_0x4d0651['push'](_0x40d98e);continue;}_0x4d0651[_0x4e1f2d(0x212)](_0x47f267);}return _0x4d0651[_0x4e1f2d(0x220)]();}static async[a0_0x216d83(0x2d1)](_0x50dfc0,_0x50cdb5=!![]){const _0x4a286d=a0_0x216d83,_0x34350c=await promises[_0x4a286d(0x334)](_0x50dfc0,{'withFileTypes':!![]});let _0xb76d28=!![];for(const _0x1d1576 of _0x34350c){const _0x2efdb4=node_path[_0x4a286d(0x1e5)](_0x50dfc0,_0x1d1576[_0x4a286d(0x24f)]);if(_0x1d1576[_0x4a286d(0x2be)]()){const _0x33d52d=await FileUtils[_0x4a286d(0x2d1)](_0x2efdb4);!_0x33d52d&&(_0xb76d28=![]);}else _0xb76d28=![];}return _0x50cdb5&&_0xb76d28&&await promises[_0x4a286d(0x302)](_0x50dfc0),_0xb76d28;}static async[a0_0x216d83(0x24c)](_0x3bdc99){const _0x220188=a0_0x216d83;return promises['stat'](_0x3bdc99)[_0x220188(0x311)](async _0x413fd3=>{const _0x5b8339=_0x220188;return await promises[_0x5b8339(0x25a)](_0x3bdc99,promises['constants']['R_OK']|promises['constants'][_0x5b8339(0x2f6)]),_0x413fd3[_0x5b8339(0x2be)]();})[_0x220188(0x2ac)](()=>![]);}static async[a0_0x216d83(0x266)](_0xcc45ba){const _0x5ef9e9=a0_0x216d83;return promises[_0x5ef9e9(0x21e)](_0xcc45ba)['then'](async _0x4abde0=>{const _0x3fafdf=_0x5ef9e9;return await promises[_0x3fafdf(0x25a)](_0xcc45ba,promises['constants']['R_OK']|promises[_0x3fafdf(0x280)][_0x3fafdf(0x2f6)]),_0x4abde0['isFile']();})['catch'](()=>![]);}}const SYSTEM_FOLDER$1='.'+ROOT_NAME,CREDENTIALS_FILE_NAME=a0_0x216d83(0x1d6);class CredentialsManager{static async[a0_0x216d83(0x29c)](_0x207449){const _0x31efc4=a0_0x216d83,_0xf6f3bd=node_path[_0x31efc4(0x1e5)](node_os[_0x31efc4(0x1e1)](),SYSTEM_FOLDER$1);await promises[_0x31efc4(0x33b)](_0xf6f3bd,{'recursive':!![]});const _0x15bce7=node_path['join'](_0xf6f3bd,CREDENTIALS_FILE_NAME),_0x2b7dd7=await CredentialsManager[_0x31efc4(0x2ca)](_0x15bce7),_0xba5c7a=_0x2b7dd7[_0x31efc4(0x1d1)](({alias:_0x431be5})=>_0x431be5===_0x207449[_0x31efc4(0x27e)]);!_0xba5c7a?_0x2b7dd7[_0x31efc4(0x212)](_0x207449):(_0xba5c7a[_0x31efc4(0x1db)]=_0x207449['accessToken'],_0xba5c7a[_0x31efc4(0x294)]=_0x207449[_0x31efc4(0x294)],_0xba5c7a[_0x31efc4(0x1f0)]=_0x207449[_0x31efc4(0x1f0)]),await promises[_0x31efc4(0x313)](_0x15bce7,Buffer[_0x31efc4(0x267)](JSON[_0x31efc4(0x21f)](_0x2b7dd7)));}static async['get']({alias:_0x96ff83}){const _0x4afc10=a0_0x216d83,_0x13f7e6=node_path[_0x4afc10(0x1e5)](node_os[_0x4afc10(0x1e1)](),SYSTEM_FOLDER$1,CREDENTIALS_FILE_NAME),_0xa2134f=await CredentialsManager[_0x4afc10(0x2ca)](_0x13f7e6),_0x18a4d6=_0xa2134f['find'](_0x232e1a=>_0x232e1a['alias']===_0x96ff83);if(!_0x18a4d6)throw new Error(_0x4afc10(0x22b)+_0x96ff83+'\x22\x20not\x20found');return _0x18a4d6;}static async['list'](){const _0x21cb33=a0_0x216d83,_0x1a9057=node_path[_0x21cb33(0x1e5)](node_os[_0x21cb33(0x1e1)](),SYSTEM_FOLDER$1,CREDENTIALS_FILE_NAME),_0x16cd47=await CredentialsManager[_0x21cb33(0x2ca)](_0x1a9057);return _0x16cd47;}static async['getAllCredentials'](_0x53e634){const _0x5f404c=a0_0x216d83,_0x57028c=await FileUtils['isFileExists'](_0x53e634);if(_0x57028c){const _0x5b3a57=await promises[_0x5f404c(0x297)](_0x53e634);return JSON[_0x5f404c(0x304)](_0x5b3a57[_0x5f404c(0x249)]());}return[];}static async[a0_0x216d83(0x1cf)]({alias:_0x4ca4f4}){const _0x2ed15b=a0_0x216d83,_0x2f6605=node_path[_0x2ed15b(0x1e5)](node_os[_0x2ed15b(0x1e1)](),SYSTEM_FOLDER$1,CREDENTIALS_FILE_NAME),_0x27bb69=await CredentialsManager[_0x2ed15b(0x2ca)](_0x2f6605),_0x4e4bed=_0x27bb69[_0x2ed15b(0x2df)](_0x42ca94=>_0x42ca94[_0x2ed15b(0x27e)]===_0x4ca4f4);if(_0x4e4bed<0x0)throw new Error(_0x2ed15b(0x22b)+_0x4ca4f4+_0x2ed15b(0x2f2));_0x27bb69['splice'](_0x4e4bed,0x1),await promises[_0x2ed15b(0x313)](_0x2f6605,Buffer[_0x2ed15b(0x267)](JSON[_0x2ed15b(0x21f)](_0x27bb69)));}}var ManagementType=(_0x3e0a74=>{const _0x30f2e5=a0_0x216d83;return _0x3e0a74[_0x30f2e5(0x27c)]='Salesforce',_0x3e0a74[_0x30f2e5(0x319)]='Vlocity',_0x3e0a74;})(ManagementType||{});class CommitAction{[a0_0x216d83(0x1db)];[a0_0x216d83(0x1f0)];['message'];[a0_0x216d83(0x343)];[a0_0x216d83(0x2b4)];[a0_0x216d83(0x2f5)];[a0_0x216d83(0x283)]=new Date();constructor(_0x4bdfb5){const _0x4b9288=a0_0x216d83;this[_0x4b9288(0x1db)]=_0x4bdfb5[_0x4b9288(0x1db)],this[_0x4b9288(0x1f0)]=_0x4bdfb5[_0x4b9288(0x1f0)],this[_0x4b9288(0x300)]=_0x4bdfb5['message'],this[_0x4b9288(0x343)]=_0x4bdfb5[_0x4b9288(0x343)],this[_0x4b9288(0x2b4)]=_0x4bdfb5[_0x4b9288(0x2b4)],this[_0x4b9288(0x2f5)]=_0x4bdfb5[_0x4b9288(0x2f5)];}async['execute'](){const _0x24e55d=a0_0x216d83;try{const _0x171715=await Promise[_0x24e55d(0x2c4)](this[_0x24e55d(0x2b4)][_0x24e55d(0x1d8)](async _0x1996b5=>await this[_0x24e55d(0x281)](_0x1996b5))),{data:_0x28a0ec}=await axios['post'](_0x24e55d(0x228)+this[_0x24e55d(0x343)]+_0x24e55d(0x2e9),{'message':this[_0x24e55d(0x300)],'components':_0x171715},{'headers':{'authorization':''+this[_0x24e55d(0x1db)]},'baseURL':this[_0x24e55d(0x1f0)]});return _0x28a0ec;}catch(_0x5a5652){if(axios[_0x24e55d(0x2d2)](_0x5a5652))throw Error(_0x5a5652[_0x24e55d(0x227)]?.[_0x24e55d(0x307)][_0x24e55d(0x300)]||_0x5a5652['response']?.[_0x24e55d(0x28c)]||_0x5a5652[_0x24e55d(0x300)],{'cause':_0x5a5652});throw _0x5a5652;}}async[a0_0x216d83(0x281)](_0x4501c5){const _0x318124=a0_0x216d83,_0x29afe6=[];for(const {path:_0x45a269,localPath:_0xb9fcd0}of _0x4501c5[_0x318124(0x1c1)]){_0x29afe6[_0x318124(0x212)](promises[_0x318124(0x297)](_0xb9fcd0)[_0x318124(0x311)](_0x3a19b2=>({'path':_0x45a269,'content':_0x3a19b2[_0x318124(0x249)]('base64')})));}const _0x76bc10=await Promise[_0x318124(0x2c4)](_0x29afe6);return{'name':_0x4501c5['name'],'label':_0x4501c5[_0x318124(0x2ed)],'type':_0x4501c5[_0x318124(0x30f)],'sourceName':'CLI','sourceType':_0x318124(0x1ec),'externalUpdatedAt':this[_0x318124(0x283)],'externalUpdatedBy':this[_0x318124(0x2f5)],'files':_0x76bc10,'managementType':ManagementType[_0x318124(0x27c)]};}}class CreateBranchAction{[a0_0x216d83(0x1db)];['devopsUrl'];constructor(_0x2020e0){const _0x542ef8=a0_0x216d83;this[_0x542ef8(0x1db)]=_0x2020e0[_0x542ef8(0x1db)],this[_0x542ef8(0x1f0)]=_0x2020e0[_0x542ef8(0x1f0)];}async[a0_0x216d83(0x31a)](_0xe7982c){const _0x128f96=a0_0x216d83;try{const {data:_0x40e1e2}=await axios[_0x128f96(0x209)](_0x128f96(0x330),{..._0xe7982c},{'headers':{'authorization':''+this[_0x128f96(0x1db)]},'baseURL':this['devopsUrl']});return _0x40e1e2;}catch(_0x343b21){if(axios['isAxiosError'](_0x343b21))throw Error(_0x343b21[_0x128f96(0x227)]?.[_0x128f96(0x307)][_0x128f96(0x300)]||_0x343b21['response']?.['statusText']||_0x343b21['message'],{'cause':_0x343b21});throw _0x343b21;}}}class GetBranchAction{[a0_0x216d83(0x1db)];['devopsUrl'];constructor(_0xea5c18){const _0x4cf4a9=a0_0x216d83;this[_0x4cf4a9(0x1db)]=_0xea5c18[_0x4cf4a9(0x1db)],this['devopsUrl']=_0xea5c18[_0x4cf4a9(0x1f0)];}async[a0_0x216d83(0x31a)](_0x3fa371){const _0x262080=a0_0x216d83;try{const {data:_0x5ef3aa}=await axios[_0x262080(0x2e5)](_0x262080(0x228)+_0x3fa371[_0x262080(0x343)],{'headers':{'authorization':''+this[_0x262080(0x1db)]},'baseURL':this[_0x262080(0x1f0)]});return _0x5ef3aa;}catch(_0x28b8ba){if(axios[_0x262080(0x2d2)](_0x28b8ba))throw Error(_0x28b8ba[_0x262080(0x227)]?.['data'][_0x262080(0x300)]||_0x28b8ba[_0x262080(0x227)]?.[_0x262080(0x28c)]||_0x28b8ba['message'],{'cause':_0x28b8ba});throw _0x28b8ba;}}}class GetDefaultBranchAction{[a0_0x216d83(0x1f0)];[a0_0x216d83(0x1db)];constructor(_0x529c22){const _0x5aadf9=a0_0x216d83;this[_0x5aadf9(0x1f0)]=_0x529c22[_0x5aadf9(0x1f0)],this['accessToken']=_0x529c22['accessToken'];}async[a0_0x216d83(0x31a)](){const _0x319b29=a0_0x216d83;try{const {data:_0x303b67}=await axios[_0x319b29(0x2e5)]('fit/branches/default',{'headers':{'authorization':''+this['accessToken']},'baseURL':this[_0x319b29(0x1f0)]});return _0x303b67;}catch(_0x284c80){if(axios[_0x319b29(0x2d2)](_0x284c80))throw Error(_0x284c80[_0x319b29(0x227)]?.[_0x319b29(0x307)][_0x319b29(0x300)]||_0x284c80[_0x319b29(0x227)]?.[_0x319b29(0x28c)]||_0x284c80[_0x319b29(0x300)],{'cause':_0x284c80});throw _0x284c80;}}}class GetMeAction{[a0_0x216d83(0x1db)];[a0_0x216d83(0x1f0)];constructor(_0x38f881){const _0xe2868a=a0_0x216d83;this['accessToken']=_0x38f881[_0xe2868a(0x1db)],this[_0xe2868a(0x1f0)]=_0x38f881[_0xe2868a(0x1f0)];}async[a0_0x216d83(0x31a)](){const _0x30ffac=a0_0x216d83;try{const {data:_0x412ce6}=await axios[_0x30ffac(0x2e5)](_0x30ffac(0x284),{'headers':{'authorization':''+this[_0x30ffac(0x1db)]},'baseURL':this[_0x30ffac(0x1f0)]});return _0x412ce6;}catch(_0x536fe5){if(axios[_0x30ffac(0x2d2)](_0x536fe5))throw Error(_0x536fe5[_0x30ffac(0x227)]?.[_0x30ffac(0x307)]['message']||_0x536fe5[_0x30ffac(0x227)]?.[_0x30ffac(0x28c)]||_0x536fe5[_0x30ffac(0x300)],{'cause':_0x536fe5});throw _0x536fe5;}}}class ListBranchesAction{[a0_0x216d83(0x1f0)];['accessToken'];[a0_0x216d83(0x270)];constructor(_0x4254b7){const _0x3ad4ff=a0_0x216d83;this[_0x3ad4ff(0x1f0)]=_0x4254b7['devopsUrl'],this[_0x3ad4ff(0x1db)]=_0x4254b7[_0x3ad4ff(0x1db)],this[_0x3ad4ff(0x270)]=_0x4254b7[_0x3ad4ff(0x270)];}async[a0_0x216d83(0x31a)](){const _0x1a2ad0=a0_0x216d83;try{const _0x219b0c=[];let _0x59041d=0x0,_0x4fcd61=0x0;do{const {data:_0x1b60d2}=await axios[_0x1a2ad0(0x2e5)](_0x1a2ad0(0x330),{'headers':{'authorization':''+this[_0x1a2ad0(0x1db)]},'params':{'search':this['search'],'offset':_0x59041d,'limit':0x64},'baseURL':this[_0x1a2ad0(0x1f0)]});_0x219b0c[_0x1a2ad0(0x212)](..._0x1b60d2[_0x1a2ad0(0x1d7)]),_0x59041d+=_0x1b60d2[_0x1a2ad0(0x1d7)]['length'],_0x4fcd61=_0x1b60d2[_0x1a2ad0(0x206)];}while(_0x59041d<_0x4fcd61);return _0x219b0c;}catch(_0x45f13d){if(axios['isAxiosError'](_0x45f13d))throw Error(_0x45f13d[_0x1a2ad0(0x227)]?.[_0x1a2ad0(0x307)][_0x1a2ad0(0x300)]||_0x45f13d[_0x1a2ad0(0x227)]?.[_0x1a2ad0(0x28c)]||_0x45f13d[_0x1a2ad0(0x300)],{'cause':_0x45f13d});throw _0x45f13d;}}}class ListComponentsAction{['devopsUrl'];[a0_0x216d83(0x1db)];['branchId'];['commitId'];[a0_0x216d83(0x2e7)];constructor(_0x14ea87){const _0x10406e=a0_0x216d83;this[_0x10406e(0x1f0)]=_0x14ea87[_0x10406e(0x1f0)],this[_0x10406e(0x1db)]=_0x14ea87[_0x10406e(0x1db)],this['branchId']=_0x14ea87[_0x10406e(0x343)],this['commitId']=_0x14ea87['commitId'],_0x14ea87[_0x10406e(0x2b4)]&&(this[_0x10406e(0x2e7)]=new Set(_0x14ea87[_0x10406e(0x2b4)]['map'](({name:_0x1fcc97,type:_0x26146a})=>_0x26146a+'_'+_0x1fcc97)));}async*[a0_0x216d83(0x31a)](){const _0x1aa1c3=a0_0x216d83;try{let _0x492b56=0x0,_0x5f1ad0=0x0;do{const {data:_0x3e15f0}=await axios[_0x1aa1c3(0x2e5)](_0x1aa1c3(0x228)+this['branchId']+'/commits/'+this[_0x1aa1c3(0x219)]+'/components',{'headers':{'authorization':''+this[_0x1aa1c3(0x1db)]},'params':{'offset':_0x492b56,'limit':0x64,'managementType':ManagementType[_0x1aa1c3(0x27c)]},'baseURL':this[_0x1aa1c3(0x1f0)]});_0x492b56+=_0x3e15f0[_0x1aa1c3(0x1d7)][_0x1aa1c3(0x200)],_0x5f1ad0=_0x3e15f0[_0x1aa1c3(0x232)];let _0x5dfbcb=_0x3e15f0[_0x1aa1c3(0x1d7)];this[_0x1aa1c3(0x2e7)]&&(_0x5dfbcb=_0x3e15f0[_0x1aa1c3(0x1d7)]['filter'](({name:_0x25da66,type:_0x86d777})=>this['indexes']?.[_0x1aa1c3(0x210)](_0x86d777+'_'+_0x25da66))),yield*_0x5dfbcb;}while(_0x492b56<_0x5f1ad0);}catch(_0x5073e4){if(axios['isAxiosError'](_0x5073e4))throw Error(_0x5073e4[_0x1aa1c3(0x227)]?.[_0x1aa1c3(0x307)][_0x1aa1c3(0x300)]||_0x5073e4[_0x1aa1c3(0x227)]?.[_0x1aa1c3(0x28c)]||_0x5073e4[_0x1aa1c3(0x300)],{'cause':_0x5073e4});throw _0x5073e4;}}}class RetrieveComponentAction{['devopsUrl'];[a0_0x216d83(0x1db)];constructor(_0x4a391e){const _0x129cdf=a0_0x216d83;this[_0x129cdf(0x1f0)]=_0x4a391e[_0x129cdf(0x1f0)],this['accessToken']=_0x4a391e[_0x129cdf(0x1db)];}async[a0_0x216d83(0x31a)](_0x3370c3){const _0x242880=a0_0x216d83;try{const {data:{id:_0x279b10,name:_0x5c9754,type:_0x571ec6,fHash:_0x37b7ed,files:_0x105206}}=await axios[_0x242880(0x2e5)](_0x242880(0x1df)+_0x3370c3,{'headers':{'authorization':''+this[_0x242880(0x1db)]},'baseURL':this['devopsUrl']}),_0x4ecb5b=_0x105206[_0x242880(0x1d8)](_0x5126db=>({'path':_0x5126db[_0x242880(0x1f6)],'content':Buffer[_0x242880(0x267)](_0x5126db['content'],'base64')['toString'](_0x242880(0x2a4))}));return{'id':_0x279b10,'name':_0x5c9754,'type':_0x571ec6,'fHash':_0x37b7ed,'files':_0x4ecb5b};}catch(_0x2e0b15){if(axios[_0x242880(0x2d2)](_0x2e0b15))throw Error(_0x2e0b15[_0x242880(0x227)]?.[_0x242880(0x307)]['message']||_0x2e0b15['response']?.[_0x242880(0x28c)]||_0x2e0b15['message'],{'cause':_0x2e0b15});throw _0x2e0b15;}}}const RETRIEVE_COMPONENT_CHUNK_SIZE=0xa;class ApiService{static async[a0_0x216d83(0x1d4)](_0x5a5646){const _0x87be4d=a0_0x216d83,_0x1782fc=new ListBranchesAction(_0x5a5646);return _0x1782fc[_0x87be4d(0x31a)]();}static async[a0_0x216d83(0x1be)](_0x187e90){const _0x1e8643=a0_0x216d83,_0x42b9c8=new GetDefaultBranchAction(_0x187e90);return _0x42b9c8[_0x1e8643(0x31a)]();}static async['getBranch'](_0xc09520){const _0x5a9e90=a0_0x216d83,_0x37cc7f=await ApiService[_0x5a9e90(0x1d4)]({'devopsUrl':_0xc09520[_0x5a9e90(0x1f0)],'accessToken':_0xc09520[_0x5a9e90(0x1db)],'search':_0xc09520[_0x5a9e90(0x2c6)]});return _0x37cc7f['find'](({name:_0x21a69e})=>_0x21a69e===_0xc09520['branchName'])||null;}static async['getBranchById'](_0x5cf6ce){const _0x5ea484=a0_0x216d83,_0x1de5c2=new GetBranchAction({'accessToken':_0x5cf6ce['accessToken'],'devopsUrl':_0x5cf6ce['devopsUrl']});return _0x1de5c2['execute']({'branchId':_0x5cf6ce[_0x5ea484(0x343)]});}static[a0_0x216d83(0x262)](_0x3cb2ec){const _0x2e7739=a0_0x216d83,_0x1061fb=new ListComponentsAction(_0x3cb2ec);return _0x1061fb[_0x2e7739(0x31a)]();}static async[a0_0x216d83(0x22d)](_0x4dde18){const _0x6460e=a0_0x216d83,_0x1917e0=[];for await(const _0xf20753 of ApiService['listComponentsGenerator'](_0x4dde18)){_0x1917e0[_0x6460e(0x212)](_0xf20753);}return _0x1917e0;}static async*[a0_0x216d83(0x2f9)](_0x93296f){const _0x2e9520=a0_0x216d83,_0x21fab9=new RetrieveComponentAction({'devopsUrl':_0x93296f[_0x2e9520(0x1f0)],'accessToken':_0x93296f[_0x2e9520(0x1db)]});let _0x543c25=[];for await(const _0x3a031c of ApiService[_0x2e9520(0x262)]({'devopsUrl':_0x93296f[_0x2e9520(0x1f0)],'accessToken':_0x93296f[_0x2e9520(0x1db)],'branchId':_0x93296f['branchId'],'commitId':_0x93296f[_0x2e9520(0x219)],'components':_0x93296f['components']})){_0x543c25[_0x2e9520(0x212)](_0x21fab9['execute'](_0x3a031c['id'])),_0x543c25['length']>=RETRIEVE_COMPONENT_CHUNK_SIZE&&(yield*await Promise[_0x2e9520(0x2c4)](_0x543c25),_0x543c25=[]);}_0x543c25['length']&&(yield*await Promise[_0x2e9520(0x2c4)](_0x543c25));}static async[a0_0x216d83(0x274)]({devopsUrl:_0x52596f,accessToken:_0x2fe68b,componentId:_0x542545}){const _0x2d6111=a0_0x216d83,_0x3819f9=new RetrieveComponentAction({'devopsUrl':_0x52596f,'accessToken':_0x2fe68b});return _0x3819f9[_0x2d6111(0x31a)](_0x542545);}static async[a0_0x216d83(0x2cc)](_0x1a5ec8){const _0xb0d20=a0_0x216d83,{accessToken:_0x3b96e6,devopsUrl:_0x6f3187}=await CredentialsManager[_0xb0d20(0x2e5)]({'alias':_0x1a5ec8});if(!_0x6f3187)throw new Error(_0xb0d20(0x2a1));return{'accessToken':_0x3b96e6,'devopsUrl':_0x6f3187};}static async[a0_0x216d83(0x1f5)](_0x5659f7){const _0x353312=a0_0x216d83,_0x5e4801=new GetMeAction(_0x5659f7);return _0x5e4801[_0x353312(0x31a)]();}static async['commit'](_0x5c405d){const _0x1a644c=a0_0x216d83,_0x4b083e=new CommitAction(_0x5c405d);await _0x4b083e[_0x1a644c(0x31a)]();}static async[a0_0x216d83(0x216)](_0x1922fb){const _0x9be88=a0_0x216d83,_0x2bd512=new CreateBranchAction({'accessToken':_0x1922fb['accessToken'],'devopsUrl':_0x1922fb['devopsUrl']});return _0x2bd512[_0x9be88(0x31a)]({'name':_0x1922fb[_0x9be88(0x24f)],'parentId':_0x1922fb[_0x9be88(0x1e3)]});}}var ConfigName=(_0x292205=>{const _0x159c10=a0_0x216d83;return _0x292205[_0x159c10(0x2a6)]=_0x159c10(0x268),_0x292205;})(ConfigName||{}),ChangeType=(_0x1f25c2=>{const _0x1ddfa3=a0_0x216d83;return _0x1f25c2[_0x1ddfa3(0x1bf)]='Create',_0x1f25c2[_0x1ddfa3(0x28d)]=_0x1ddfa3(0x211),_0x1f25c2[_0x1ddfa3(0x2f8)]=_0x1ddfa3(0x2ff),_0x1f25c2;})(ChangeType||{});class CompareWithRemoteBranchAction{[a0_0x216d83(0x1f0)];[a0_0x216d83(0x1db)];[a0_0x216d83(0x252)];[a0_0x216d83(0x338)];[a0_0x216d83(0x2db)];constructor(_0xdf2592){const _0x1dd9ed=a0_0x216d83;this[_0x1dd9ed(0x1f0)]=_0xdf2592[_0x1dd9ed(0x1f0)],this['accessToken']=_0xdf2592[_0x1dd9ed(0x1db)],this[_0x1dd9ed(0x252)]=_0xdf2592['targetBranchId'],this[_0x1dd9ed(0x338)]=_0xdf2592[_0x1dd9ed(0x338)],this[_0x1dd9ed(0x2db)]=_0xdf2592['stage'];}async['execute'](){const _0x4c088a=a0_0x216d83,_0xa6e946=await ApiService[_0x4c088a(0x22d)]({'devopsUrl':this['devopsUrl'],'accessToken':this[_0x4c088a(0x1db)],'branchId':this['targetBranchId'],'commitId':this[_0x4c088a(0x338)]}),_0x22b5da=new Map(_0xa6e946['map'](_0x5e1789=>[_0x5e1789[_0x4c088a(0x30f)]+'_'+_0x5e1789[_0x4c088a(0x24f)],_0x5e1789])),_0x25facb=[];for(const _0x4e371e of this['findDeletedAndUpdated'](_0x22b5da)){_0x25facb[_0x4c088a(0x212)](_0x4e371e),_0x22b5da[_0x4c088a(0x1cf)](_0x4e371e[_0x4c088a(0x30f)]+'_'+_0x4e371e[_0x4c088a(0x24f)]);}for(const [_0x534d58,_0x550816]of _0x22b5da[_0x4c088a(0x2aa)]()){const _0x355871=this[_0x4c088a(0x2db)][_0x4c088a(0x31c)]['get'](_0x534d58);!_0x355871&&_0x25facb['push']({'id':_0x550816['id'],'name':_0x550816[_0x4c088a(0x24f)],'type':_0x550816[_0x4c088a(0x30f)],'fHash':_0x550816[_0x4c088a(0x257)],'changeType':ChangeType[_0x4c088a(0x1bf)]});}return _0x25facb;}*[a0_0x216d83(0x269)](_0x29cae2){const _0x21e752=a0_0x216d83;for(const [_0x19867c,_0x2e819b]of this[_0x21e752(0x2db)][_0x21e752(0x31c)][_0x21e752(0x2aa)]()){const _0x14f9f2=_0x29cae2[_0x21e752(0x2e5)](_0x19867c);!_0x14f9f2&&(yield{'name':_0x2e819b['name'],'type':_0x2e819b[_0x21e752(0x30f)],'changeType':ChangeType['DELETE']}),_0x14f9f2&&_0x14f9f2[_0x21e752(0x257)]!==_0x2e819b[_0x21e752(0x257)]&&(yield{'id':_0x14f9f2['id'],'name':_0x14f9f2[_0x21e752(0x24f)],'type':_0x14f9f2[_0x21e752(0x30f)],'fHash':_0x14f9f2[_0x21e752(0x257)],'changeType':ChangeType[_0x21e752(0x28d)]});}}}class ConfigSetAction{[a0_0x216d83(0x2db)];constructor({stage:_0x5985ba}){const _0x49b00d=a0_0x216d83;this[_0x49b00d(0x2db)]=_0x5985ba;}async[a0_0x216d83(0x31a)]({name:_0x1c4cf6,value:_0x5d7600}){const _0x236057=a0_0x216d83;switch(_0x1c4cf6){case ConfigName[_0x236057(0x2a6)]:await CredentialsManager[_0x236057(0x2e5)]({'alias':_0x5d7600}),this[_0x236057(0x2db)][_0x236057(0x2da)](_0x1c4cf6,_0x5d7600);break;default:throw new Error(_0x236057(0x2dc)+_0x1c4cf6);}}}class FindChangesAction{['stage'];constructor(_0x443312){const _0x227b11=a0_0x216d83;this[_0x227b11(0x2db)]=_0x443312[_0x227b11(0x2db)];}async[a0_0x216d83(0x31a)](){const _0x594c29=a0_0x216d83,_0x37ebf1=new Map(this[_0x594c29(0x2db)]['componentsState']),_0x218470=[];for await(const {componentName:_0x2b6a9c,componentType:_0x302387,filePaths:_0x528430}of salesforce[_0x594c29(0x2a3)][_0x594c29(0x32d)](this[_0x594c29(0x2db)]['projectPath'])){const _0x464b52=_0x302387+'_'+_0x2b6a9c,_0x302479=_0x37ebf1[_0x594c29(0x2e5)](_0x464b52),_0x1022c1=_0x528430[_0x594c29(0x1d8)](_0x218aea=>_0x218aea['replace'](this[_0x594c29(0x2db)][_0x594c29(0x2bf)]+'/',''));if(!_0x302479){_0x218470[_0x594c29(0x212)]({'type':_0x302387,'name':_0x2b6a9c,'changes':_0x1022c1[_0x594c29(0x1d8)](_0x3cf0c6=>({'path':_0x3cf0c6,'changeType':ChangeType[_0x594c29(0x1bf)]}))});continue;}_0x37ebf1[_0x594c29(0x1cf)](_0x464b52);const _0x433a54=await this['getUpdatedComponentChanges'](_0x1022c1,_0x302479['paths']);_0x433a54[_0x594c29(0x200)]&&_0x218470[_0x594c29(0x212)]({'type':_0x302387,'name':_0x2b6a9c,'changes':_0x433a54});}for(const [,_0x11d75e]of _0x37ebf1[_0x594c29(0x2aa)]()){_0x218470[_0x594c29(0x212)]({'type':_0x11d75e[_0x594c29(0x30f)],'name':_0x11d75e[_0x594c29(0x24f)],'changes':_0x11d75e['paths'][_0x594c29(0x1d8)](_0x5bbb84=>({'path':_0x5bbb84,'changeType':ChangeType[_0x594c29(0x2f8)]}))});}return _0x218470;}async[a0_0x216d83(0x2e8)](_0x579937,_0x4b662d){const _0x12e093=a0_0x216d83,{lastStageTimestamp:_0xa61c5}=this[_0x12e093(0x2db)][_0x12e093(0x22f)],_0x501f72=[];for(const _0x4db854 of _0x579937){const _0x105d94=_0x4b662d[_0x12e093(0x289)](_0x4db854);if(!_0x105d94){_0x501f72[_0x12e093(0x212)]({'path':_0x4db854,'changeType':ChangeType['CREATE']});continue;}const {ctimeMs:_0x30ba2f,mtimeMs:_0x44084b}=await promises[_0x12e093(0x21e)](_0x4db854);(!_0xa61c5||Math[_0x12e093(0x1f8)](_0x44084b)>_0xa61c5||Math['trunc'](_0x30ba2f)>_0xa61c5)&&_0x501f72[_0x12e093(0x212)]({'path':_0x4db854,'changeType':ChangeType[_0x12e093(0x28d)]});}for(const _0x3777c1 of _0x4b662d){const _0x394094=!_0x579937['includes'](_0x3777c1);_0x394094&&_0x501f72['push']({'path':_0x3777c1,'changeType':ChangeType[_0x12e093(0x2f8)]});}return _0x501f72;}}const STAGE_FOLDER_NAME=a0_0x216d83(0x1e6),SYSTEM_FOLDER='.'+ROOT_NAME,CONFIG_FILE_NAME=a0_0x216d83(0x32c),BRANCH_STATE_FILE_NAME=a0_0x216d83(0x2b1),COMPONENTS_STATE_FILE_NAME='components-state.json',COMPONENT_PROJECT_PATH=node_path['join']('force-app','main',a0_0x216d83(0x24d)),SFDX_PROJECT_FILE_NAME=a0_0x216d83(0x1c7),INITIAL_BRANCH_STATE={'id':null,'name':null,'headCommitId':null,'lastStageTimestamp':null},INITIAL_CONFIG={'credentialsAlias':null};function a0_0x5404(){const _0x115836=['getFolderFilePaths','has','Update','push','_branchId','split','Config\x20name.\x20Allowed\x20values:\x20','createBranch','Login\x20started','init','commitId','Delete\x20saved\x20credentials.','Display\x20all\x20authorized\x20credentials.','<config-name>','Commit\x20started','stat','stringify','flat','readComponentsState','Stage\x20not\x20found','update','_branchState','\x22\x20wasn\x27t\x20restored','handleRestore','response','fit/branches/','calculateComponentHash','updateBranchState','Credentials\x20with\x20alias\x20\x22','Detecting\x20changes\x20started','listComponents','list-credentials','branchState','updateComponent','isJson','count','env','Retrieve\x20components\x20started','pull','checkout','instance','List\x20credentials\x20completed','Listing\x20remote\x20branches\x20started','createComponent','set','Fail\x20Message','-n,\x20--name\x20<string>','No\x20changes\x20for\x20rollback','flosum','warnDebug','slice','table','indexOf','Alias\x20of\x20credentials\x20which\x20will\x20be\x20used\x20to\x20retrieve\x20your\x20components\x20from\x20devops.','failMessage','createInterface','Status\x20calculation\x20started','Uncommitted\x20changes\x20found.\x20Commit\x20or\x20rollback\x20them\x20to\x20proceed','toString','Checkout\x20on\x20another\x20branch.\x20Checkout\x20command\x20retrieves\x20components\x20missing\x20locally.','Value','isDirectoryExists','default','rollback','name','infoDebug','Enter\x20commit\x20message:\x20','targetBranchId','credentials','List\x20credentials\x20started','Committed\x20Components:','manager','fHash','description',':ERROR','access','Logout\x20started','A\x20branch\x20name\x20which\x20you\x20checkout\x20on.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.','configName','\x20services','cwd','Project\x20initialization\x20completed','Checking\x20manual\x20changes\x20started','listComponentsGenerator','create','File\x20\x22','areChanges','isFileExists','from','credentialsAlias','findDeletedAndUpdated','Clear\x20project\x20config\x20property.','login','Update:\x20Component\x20not\x20found','errorDebug','addCommand','Return\x20all\x20local\x20not\x20committed\x20changes.','search','Commit\x20message.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.','config','value','retrieveComponentById','componentChanges','Not\x20Found','Checking\x20manual\x20changes\x20completed','headCommitId','findChanges','Saved\x20credentials\x20alias.','1503ufMMrI','SALESFORCE','logout','alias','string','constants','convertToCommit','/api/v1/links','commitDate','auth/me','928495qfpHJP','firstName','color','commander','includes','constructor','Config\x20set\x20completed','statusText','UPDATE','register','convertToLocalComponent','rollbackTypes','splice','debug','Rolling\x20back\x20to\x20last\x20committed\x20state\x20completed','globalSettingsUrl','lastStageTimestamp','-a,\x20--alias\x20<string>','readFile','paths','askString','Logger\x20not\x20found','Token\x20for\x20getting\x20access\x20to\x20','save','Project\x20has\x20already\x20been\x20initialized.\x20Duplicate\x20initialization\x20is\x20not\x20allowed.','node:os','DEVOPS_COMMANDS','applyDelete','Devops\x20url\x20not\x20found','getBranchName','SfProjectScanner','utf-8','5087050fCvHXs','CREDENTIALS_ALIAS','Applies\x20json\x20formatted\x20result.','log','Creation\x20new\x20branch\x20started','entries','commit','catch','enable','.bin','Project\x20initialization\x20started','Name','branch-state.json','Rolled\x20Back\x20Changes:','Global\x20Settings\x20Url','components','error','Config\x20set\x20started','PATH\x20env\x20not\x20found','saveComponent','fHash\x20for\x20component\x20\x22','pendingChanges','stdout','_stagePath','warn','isDirectory','projectPath','2256150KSVOlp','_isUpdateStageTimestamp','Config\x20Name','defineRollbackTypes','all','filesChanges','branchName','Create:\x20Component\x20not\x20found','Changes\x20not\x20found','config-set','getAllCredentials','node:path','getCredentials','api','Local\x20head\x20commit\x20id\x20not\x20found','Set\x20project\x20config.','-t,\x20--token\x20<string>','cleanUpEmptyFolders','isAxiosError','dirname','getBranchById','saveBranchState','buildProjectPath','bind','_componentsState','fileChanges','setConfig','stage','Unknown\x20config\x20name:\x20','Looking\x20for\x20changes\x20started','componentsForRetrieve','findIndex','run','lastName','\x20was\x20deleted','_changes','currentBranch','get','Branch\x20Name','indexes','getUpdatedComponentChanges','/commits','version',':INFO','Invalid\x20credentials\x20type','label','applicationUrl','readBranchState','deleteComponent','A\x20branch\x20is\x20not\x20selected.\x20Use\x20\x22flosum\x20devops\x20checkout\x22\x20at\x20first','\x22\x20not\x20found','now','\x22\x20completed','userName','W_OK','hex','DELETE','retrieveComponents','readConfig','878uMZEuU','653460HETAut','registerFileChange','_logger','Delete','message','argument','rmdir','logger','parse','buildReport','retrieve','data','targetBranchName','Stage\x20folder\x20not\x20found','abort','_localHeadCommit','Login\x20successfully\x20completed.\x20You\x20credentials\x20are\x20saved\x20with\x20alias\x20\x22','addFileChange','--json','type','Enter\x20api\x20token:\x20','then','branches','writeFile','Change\x20Type','Local\x20and\x20remote\x20head\x20commits\x20don\x27t\x20match.\x20Use\x20\x22flosum\x20devops\x20pull\x22\x20to\x20retrieve\x20latest\x20updates\x20from\x20devops','<value>','1112Thnkee','Missing\x20content\x20for\x20not\x20Delete\x20change\x20type','VLOCITY','execute','2397906faGKqi','componentsState','print','Credentials\x20alias\x20is\x20not\x20configured','localHeadCommit','0.0.2','status','node_modules','Credentials\x20not\x20found','Cloning\x20completed','Rollback\x20started','initProject','Alias','Project\x20is\x20not\x20initialized','getBranchState','abortStage','initStage','config.json','scan','handle','isInitialized','fit/branches','CreateProjectSfCommand','findAndCommitChanges','Component\x20id\x20not\x20found\x20after\x20comparison','readdir','Retrieve\x20components\x20completed','apply','NULL','targetCommitId','No\x20Local\x20Changes','report','mkdir','Status','Creation\x20new\x20branch\x20completed','Deleted','devops','Checkout\x20handler\x20not\x20found','Files','_success','branchId','unsetConfig','\x20of\x20type\x20','component','_credentials','applyCreateUpdate','stagePath','_stage','printJson','arguments','updateComponentState','success','Status\x20calculation\x20completed','Type','compareWithRemoteBranch','getDefaultBranch','CREATE','Roll\x20back\x20your\x20branch\x20state\x20to\x20last\x20committed\x20one.','files','updateSystemFiles','Project\x20Path','Pending\x20Changes:','info','Command','sfdx-project.json','Create\x20salesforce\x20project\x20and\x20cli\x20system\x20files.','Login\x20into\x20global\x20settings\x20and\x20retrieve\x20data\x20about\x20related\x20services.','Devops\x20Url','option','getMessage','targetBranch','getAccessToken','delete','DevOps','find','changeType','Enter\x20project\x20name:\x20','listBranches','sep','credentials.json','rows','map','clone','(((.+)+)+)+$','accessToken','Component\x20','applyFileChanges','Cloning\x20started','fit/file-versions/','File','homedir','digest','parentId','\x22\x20started','join','.stage','ROOT_COMMANDS','\x20components\x20will\x20be\x20committed','Project\x20Updates:','retrievedComponents','Rollback\x20completed','CLI','options','commandName','41672nMVStm','devopsUrl','Branch\x20id\x20not\x20found','changes','size','Retrieve\x20Result:','getMe','path','applyStage','trunc','base64','getCredentialsAlias','Alias\x20which\x20saved\x20credentials\x20will\x20be\x20accessed\x20with.','\x22\x20already\x20exists','\x20files\x20will\x20be\x20rolled\x20back','question','Logout\x20completed','length','Commit\x20local\x20changes\x20to\x20a\x20remote\x20branch\x20on\x20devops.','PATH','values','setIsUpdateStageTimestamp','_projectPath','total','node:readline/promises','retrieveDifference','post','_headCommitId','Checkout\x20on\x20\x22','getInstance','basename','14pxcoLG'];a0_0x5404=function(){return _0x115836;};return a0_0x5404();}class InitProjectAction{[a0_0x216d83(0x2db)];[a0_0x216d83(0x272)];constructor({stage:_0x3772ff,config:_0x45c00f}){const _0x498b95=a0_0x216d83;this[_0x498b95(0x2db)]=_0x3772ff,this['config']=_0x45c00f;}async['execute'](){const _0x30c701=a0_0x216d83,_0x3efee7=new salesforce[(_0x30c701(0x331))]({'cwd':node_path[_0x30c701(0x2d3)](this[_0x30c701(0x2db)][_0x30c701(0x1b5)]),'projectName':node_path[_0x30c701(0x20d)](this[_0x30c701(0x2db)][_0x30c701(0x1b5)])});await _0x3efee7[_0x30c701(0x2e0)]();const _0x48d632=await FileUtils['getFolderFilePaths'](this[_0x30c701(0x2db)][_0x30c701(0x1b5)]);for(const _0x1ce283 of _0x48d632){const _0x46609e=_0x1ce283[_0x30c701(0x214)](STAGE_FOLDER_NAME)[0x1];this[_0x30c701(0x2db)][_0x30c701(0x2fd)]({'path':_0x46609e,'changeType':ChangeType[_0x30c701(0x1bf)]});}if(this[_0x30c701(0x272)])for(const _0x51e911 of Object['values'](ConfigName)){this[_0x30c701(0x2db)]['setConfig'](_0x51e911,this['config'][_0x51e911]);}}}class SaveComponentAction{[a0_0x216d83(0x2db)];constructor(_0x4553f3){const _0x5c90ef=a0_0x216d83;this['stage']=_0x4553f3[_0x5c90ef(0x2db)];}async[a0_0x216d83(0x31a)](_0x39cb99){const _0x2f4a22=a0_0x216d83;switch(_0x39cb99[_0x2f4a22(0x1d2)]){case ChangeType[_0x2f4a22(0x1bf)]:{if(!_0x39cb99['component'])throw new Error(_0x2f4a22(0x2c7));await this['stage'][_0x2f4a22(0x23a)](_0x39cb99[_0x2f4a22(0x1b2)]);break;}case ChangeType[_0x2f4a22(0x28d)]:if(!_0x39cb99['component'])throw new Error(_0x2f4a22(0x26c));await this['stage'][_0x2f4a22(0x230)](_0x39cb99['component']);break;case ChangeType['DELETE']:await this[_0x2f4a22(0x2db)]['deleteComponent']({'name':_0x39cb99[_0x2f4a22(0x24f)],'type':_0x39cb99[_0x2f4a22(0x30f)]});break;}}}class UpdateComponentStateAction{['stage'];[a0_0x216d83(0x24f)];['type'];[a0_0x216d83(0x1f2)];constructor(_0x172a6f){const _0x524047=a0_0x216d83;this[_0x524047(0x2db)]=_0x172a6f[_0x524047(0x2db)],this[_0x524047(0x24f)]=_0x172a6f[_0x524047(0x24f)],this['type']=_0x172a6f[_0x524047(0x30f)],this['changes']=_0x172a6f['changes'];}async[a0_0x216d83(0x31a)](){const _0x314245=a0_0x216d83,_0x274911=this[_0x314245(0x30f)]+'_'+this['name'];let _0x340fc2=this[_0x314245(0x2db)][_0x314245(0x31c)]['get'](_0x274911),_0x5acef8=ChangeType[_0x314245(0x28d)];!_0x340fc2&&(_0x340fc2={'name':this['name'],'type':this['type'],'fHash':'','paths':[]},this[_0x314245(0x2db)]['componentsState'][_0x314245(0x23b)](_0x274911,_0x340fc2),_0x5acef8=ChangeType['CREATE']);for(const _0x3aba62 of this['changes']){this['handleFileChange'](_0x340fc2,_0x3aba62);}if(!_0x340fc2['paths'][_0x314245(0x200)])return this[_0x314245(0x2db)]['componentsState'][_0x314245(0x1cf)](_0x274911),{'name':_0x340fc2[_0x314245(0x24f)],'type':_0x340fc2[_0x314245(0x30f)],'changeType':ChangeType[_0x314245(0x2f8)]};return _0x340fc2[_0x314245(0x257)]=await this[_0x314245(0x229)](_0x340fc2[_0x314245(0x298)]),{..._0x340fc2,'changeType':_0x5acef8};}['handleFileChange'](_0x445dac,{path:_0x424ca2,changeType:_0x20509c}){const _0x58eae9=a0_0x216d83;if(_0x20509c===ChangeType[_0x58eae9(0x1bf)]){if(_0x445dac['paths'][_0x58eae9(0x289)](_0x424ca2))throw new Error(_0x58eae9(0x264)+_0x424ca2+_0x58eae9(0x1fc));_0x445dac['paths'][_0x58eae9(0x212)](_0x424ca2);}if(_0x20509c===ChangeType['DELETE']){const _0x56eac2=_0x445dac['paths'][_0x58eae9(0x243)](_0x424ca2);if(_0x56eac2<0x0)throw new Error('File\x20\x22'+_0x424ca2+_0x58eae9(0x2f2));_0x445dac[_0x58eae9(0x298)][_0x58eae9(0x291)](_0x56eac2,0x1);}}async['calculateComponentHash'](_0x45086a){const _0x3407d4=a0_0x216d83,_0x206639=node_crypto['createHash']('sha1');for(const _0x3752f4 of _0x45086a){const _0x21a5b9=await promises[_0x3407d4(0x297)](node_path[_0x3407d4(0x1e5)](this[_0x3407d4(0x2db)][_0x3407d4(0x2bf)],_0x3752f4),{'encoding':_0x3407d4(0x2a4)}),_0x26c3cf=_0x3752f4[_0x3407d4(0x214)](node_path[_0x3407d4(0x1d5)])[_0x3407d4(0x241)](0x3)['join']('/');_0x206639[_0x3407d4(0x223)](_0x26c3cf),_0x206639[_0x3407d4(0x223)](_0x21a5b9);}const _0x29c21d=_0x206639[_0x3407d4(0x1e2)](_0x3407d4(0x2f7));return _0x29c21d;}}class Stage{[a0_0x216d83(0x205)];[a0_0x216d83(0x2bc)];[a0_0x216d83(0x272)];[a0_0x216d83(0x224)];[a0_0x216d83(0x2d8)];[a0_0x216d83(0x2d9)]=[];[a0_0x216d83(0x2c1)]=!![];set['isUpdateStageTimestamp'](_0x4a1e25){this['_isUpdateStageTimestamp']=_0x4a1e25;}get['projectPath'](){return this['_projectPath'];}get['stagePath'](){const _0x32e4db=a0_0x216d83;return this[_0x32e4db(0x2bc)];}get['branchState'](){return this['_branchState'];}get[a0_0x216d83(0x31c)](){return this['_componentsState'];}constructor(_0x320be0){const _0x38780b=a0_0x216d83;this[_0x38780b(0x205)]=_0x320be0[_0x38780b(0x2bf)],this['_stagePath']=_0x320be0['stagePath'],this['config']=_0x320be0[_0x38780b(0x272)],this['_branchState']=_0x320be0[_0x38780b(0x22f)],this[_0x38780b(0x2d8)]=_0x320be0[_0x38780b(0x31c)]?new Map(_0x320be0[_0x38780b(0x31c)]['map'](_0x36fe4f=>[_0x36fe4f[_0x38780b(0x30f)]+'_'+_0x36fe4f['name'],_0x36fe4f])):new Map();}[a0_0x216d83(0x2da)](_0x47de24,_0x13de21){const _0x3fd0fc=a0_0x216d83;this[_0x3fd0fc(0x272)][_0x47de24]=_0x13de21;}[a0_0x216d83(0x344)](_0x512f08){const _0x3b2c87=a0_0x216d83;this[_0x3b2c87(0x272)][_0x512f08]=null;}[a0_0x216d83(0x22a)](_0x216c74){const _0x2d6e69=a0_0x216d83;this[_0x2d6e69(0x22f)]['id']=_0x216c74['id'],this[_0x2d6e69(0x22f)][_0x2d6e69(0x24f)]=_0x216c74[_0x2d6e69(0x24f)],this[_0x2d6e69(0x22f)][_0x2d6e69(0x278)]=_0x216c74[_0x2d6e69(0x278)];}async['createComponent'](_0x4e09c6){const _0x1f37b8=a0_0x216d83,_0x20502b={'name':_0x4e09c6[_0x1f37b8(0x24f)],'type':_0x4e09c6[_0x1f37b8(0x30f)],'fHash':_0x4e09c6[_0x1f37b8(0x257)],'paths':_0x4e09c6[_0x1f37b8(0x1c1)][_0x1f37b8(0x1d8)](({path:_0x1f516a})=>node_path['join'](COMPONENT_PROJECT_PATH,_0x1f516a))};this[_0x1f37b8(0x2d8)]['set'](_0x4e09c6['type']+'_'+_0x4e09c6['name'],_0x20502b);for(const {path:_0x105302,content:_0x4a0ae4}of _0x4e09c6[_0x1f37b8(0x1c1)]){await this['addFileChange']({'path':node_path[_0x1f37b8(0x1e5)](COMPONENT_PROJECT_PATH,_0x105302),'content':_0x4a0ae4,'changeType':ChangeType[_0x1f37b8(0x1bf)]});}}async[a0_0x216d83(0x230)](_0x1a42d6){const _0x149b99=a0_0x216d83,_0x168633=this[_0x149b99(0x2d8)]['get'](_0x1a42d6[_0x149b99(0x30f)]+'_'+_0x1a42d6['name']),_0x5d5775=[];if(!_0x168633)throw new Error('Update:\x20Component\x20'+_0x1a42d6['name']+_0x149b99(0x1b1)+_0x1a42d6[_0x149b99(0x30f)]+'\x20not\x20found');for(const _0x6b7b6a of _0x168633[_0x149b99(0x298)]){await this[_0x149b99(0x30d)]({'path':_0x6b7b6a,'changeType':ChangeType[_0x149b99(0x2f8)]});}for(const {path:_0x1e3ac7,content:_0x16b6ba}of _0x1a42d6[_0x149b99(0x1c1)]){const _0x403575=node_path['join'](COMPONENT_PROJECT_PATH,_0x1e3ac7);await this[_0x149b99(0x30d)]({'path':_0x403575,'content':_0x16b6ba,'changeType':ChangeType[_0x149b99(0x1bf)]}),_0x5d5775['push'](_0x403575);}_0x168633[_0x149b99(0x257)]=_0x1a42d6['fHash'],_0x168633[_0x149b99(0x298)]=_0x5d5775;}async[a0_0x216d83(0x2f0)](_0x3a5d19){const _0x4a29f2=a0_0x216d83,_0x2f6ef1=_0x3a5d19['type']+'_'+_0x3a5d19[_0x4a29f2(0x24f)],_0x12be14=this['_componentsState'][_0x4a29f2(0x2e5)](_0x2f6ef1);if(!_0x12be14)throw new Error(_0x4a29f2(0x1dc)+_0x3a5d19['name']+'\x20of\x20type\x20'+_0x3a5d19[_0x4a29f2(0x30f)]+'\x20not\x20found');for(const _0x2088c4 of _0x12be14[_0x4a29f2(0x298)]){await this[_0x4a29f2(0x30d)]({'path':_0x2088c4,'changeType':ChangeType['DELETE']});}this[_0x4a29f2(0x2d8)][_0x4a29f2(0x1cf)](_0x2f6ef1);}async[a0_0x216d83(0x30d)]({path:_0x8e15ee,content:_0x5eb6b8,changeType:_0x5c14e5}){const _0x1bb3f=a0_0x216d83;if(_0x5c14e5!==ChangeType[_0x1bb3f(0x2f8)]){if(!_0x5eb6b8)throw new Error(_0x1bb3f(0x318));const _0x40f1a6=node_path[_0x1bb3f(0x1e5)](this[_0x1bb3f(0x1b5)],_0x8e15ee);await promises[_0x1bb3f(0x33b)](node_path[_0x1bb3f(0x2d3)](_0x40f1a6),{'recursive':!![]}),await promises['writeFile'](_0x40f1a6,_0x5eb6b8);}this['fileChanges'][_0x1bb3f(0x212)]({'path':_0x8e15ee,'changeType':_0x5c14e5});}async[a0_0x216d83(0x1b9)](_0x5988c0){const _0x5540e7=new UpdateComponentStateAction({'stage':this,..._0x5988c0});return _0x5540e7['execute']();}async['changeFile'](){}[a0_0x216d83(0x2fd)]({path:_0xfb1a86,changeType:_0x4f48b7}){const _0x500c5f=a0_0x216d83;this['fileChanges'][_0x500c5f(0x212)]({'path':_0xfb1a86,'changeType':_0x4f48b7});}async[a0_0x216d83(0x336)](){const _0x43a8a4=a0_0x216d83,_0x58717a=await FileUtils[_0x43a8a4(0x24c)](this[_0x43a8a4(0x1b5)]);if(!_0x58717a)throw Error(_0x43a8a4(0x309));await this[_0x43a8a4(0x1dd)](),await this[_0x43a8a4(0x1c2)](),await promises['rm'](this[_0x43a8a4(0x1b5)],{'recursive':!![]});const _0x2cd07e=node_path[_0x43a8a4(0x1e5)](this[_0x43a8a4(0x205)],COMPONENT_PROJECT_PATH),_0x1b4fb9=await FileUtils[_0x43a8a4(0x24c)](_0x2cd07e);_0x1b4fb9?await FileUtils[_0x43a8a4(0x2d1)](_0x2cd07e,![]):await promises[_0x43a8a4(0x33b)](_0x2cd07e,{'recursive':!![]});}async[a0_0x216d83(0x30a)](){const _0x1803d2=a0_0x216d83;await promises['rm'](this[_0x1803d2(0x1b5)],{'recursive':!![],'force':!![]});}async[a0_0x216d83(0x1dd)](){const _0x263888=a0_0x216d83;for(const {path:_0x382151,changeType:_0xd8e9a3}of this['fileChanges']){switch(_0xd8e9a3){case ChangeType['CREATE']:case ChangeType[_0x263888(0x28d)]:await this[_0x263888(0x1b4)](_0x382151);break;case ChangeType['DELETE']:await this[_0x263888(0x2a0)](_0x382151);break;}}}async[a0_0x216d83(0x1b4)](_0x53999f){const _0x23bd33=a0_0x216d83,_0x42a6cc=node_path[_0x23bd33(0x1e5)](this[_0x23bd33(0x2bc)],_0x53999f),_0x51bc33=node_path[_0x23bd33(0x1e5)](this[_0x23bd33(0x205)],_0x53999f);await promises['mkdir'](node_path[_0x23bd33(0x2d3)](_0x51bc33),{'recursive':!![]}),await promises['copyFile'](_0x42a6cc,_0x51bc33);}async[a0_0x216d83(0x2a0)](_0x2139c6){const _0x4f5e19=a0_0x216d83;await promises['rm'](node_path[_0x4f5e19(0x1e5)](this[_0x4f5e19(0x205)],_0x2139c6),{'recursive':!![]});}async['updateSystemFiles'](){const _0x2a3d08=a0_0x216d83;await promises[_0x2a3d08(0x313)](node_path['join'](this[_0x2a3d08(0x2bf)],SYSTEM_FOLDER,CONFIG_FILE_NAME),JSON[_0x2a3d08(0x21f)](this['config'])),this[_0x2a3d08(0x2c1)]&&(this['branchState'][_0x2a3d08(0x295)]=Date[_0x2a3d08(0x2f3)]()),await promises[_0x2a3d08(0x313)](node_path[_0x2a3d08(0x1e5)](this[_0x2a3d08(0x2bf)],SYSTEM_FOLDER,BRANCH_STATE_FILE_NAME),JSON[_0x2a3d08(0x21f)](this['branchState'])),await promises[_0x2a3d08(0x313)](node_path[_0x2a3d08(0x1e5)](this[_0x2a3d08(0x2bf)],SYSTEM_FOLDER,COMPONENTS_STATE_FILE_NAME),JSON[_0x2a3d08(0x21f)](Array[_0x2a3d08(0x267)](this['_componentsState'][_0x2a3d08(0x203)]())));}}class ProjectManager{static [a0_0x216d83(0x237)];['_stage'];get['stage'](){const _0x5aeeef=a0_0x216d83;if(!this[_0x5aeeef(0x1b6)])throw new Error(_0x5aeeef(0x222));return this[_0x5aeeef(0x1b6)];}constructor(){}static[a0_0x216d83(0x20c)](){const _0x2fe35d=a0_0x216d83;return!ProjectManager['instance']&&(ProjectManager['instance']=new ProjectManager()),ProjectManager[_0x2fe35d(0x237)];}async[a0_0x216d83(0x32b)](_0x107f8d){const _0x3c9420=a0_0x216d83,_0x5816ec=node_path[_0x3c9420(0x1e5)](_0x107f8d,SYSTEM_FOLDER,STAGE_FOLDER_NAME);await promises['rm'](_0x5816ec,{'recursive':!![],'force':!![]}),await promises[_0x3c9420(0x33b)](_0x5816ec,{'recursive':!![]});const _0x1c6ced=await this[_0x3c9420(0x2fa)](_0x107f8d),_0x2ef134=await this[_0x3c9420(0x2ef)](_0x107f8d),_0x286339=await this['readComponentsState'](_0x107f8d);this[_0x3c9420(0x1b6)]=new Stage({'projectPath':_0x107f8d,'stagePath':_0x5816ec,'config':_0x1c6ced,'branchState':_0x2ef134,'componentsState':_0x286339});}async[a0_0x216d83(0x1f7)](){const _0x522ff9=a0_0x216d83;await this[_0x522ff9(0x2db)]['apply']();}async[a0_0x216d83(0x32a)](){const _0x469e6a=a0_0x216d83;await this[_0x469e6a(0x2db)][_0x469e6a(0x30a)]();}async['initProject']({config:_0x5d1ac9}){const _0x8ddf08=a0_0x216d83,_0x180708=new InitProjectAction({'stage':this[_0x8ddf08(0x2db)],'config':_0x5d1ac9});await _0x180708['execute']();}['saveBranchState'](_0x5ee405){const _0x226d2c=a0_0x216d83;this['stage'][_0x226d2c(0x22a)](_0x5ee405);}async[a0_0x216d83(0x2b8)](_0x54752f){const _0x817235=a0_0x216d83,_0x17e2bb=new SaveComponentAction({'stage':this[_0x817235(0x2db)]});await _0x17e2bb['execute'](_0x54752f);}async[a0_0x216d83(0x279)](){const _0xd0b1d1=new FindChangesAction({'stage':this['stage']});return _0xd0b1d1['execute']();}async[a0_0x216d83(0x1bd)](_0x168049){const _0x2c69f0=a0_0x216d83,_0x40ec78=new CompareWithRemoteBranchAction({..._0x168049,'stage':this[_0x2c69f0(0x2db)]});return _0x40ec78['execute']();}async[a0_0x216d83(0x2fa)](_0x447d82){const _0x3a203d=a0_0x216d83,_0x57c361=node_path[_0x3a203d(0x1e5)](_0x447d82,SYSTEM_FOLDER,CONFIG_FILE_NAME),_0x15f9f4=await FileUtils[_0x3a203d(0x266)](_0x57c361);if(!_0x15f9f4)return INITIAL_CONFIG;const _0x188cee=await promises[_0x3a203d(0x297)](_0x57c361);return JSON[_0x3a203d(0x304)](_0x188cee[_0x3a203d(0x249)]());}async[a0_0x216d83(0x2ef)](_0x26db23){const _0x4d44b1=a0_0x216d83,_0x542919=node_path[_0x4d44b1(0x1e5)](_0x26db23,SYSTEM_FOLDER,BRANCH_STATE_FILE_NAME),_0x16edf8=await FileUtils[_0x4d44b1(0x266)](_0x542919);if(!_0x16edf8)return INITIAL_BRANCH_STATE;const _0x3b3e75=await promises['readFile'](_0x542919);return JSON['parse'](_0x3b3e75[_0x4d44b1(0x249)]());}async[a0_0x216d83(0x221)](_0x130216){const _0x4dbd9c=a0_0x216d83,_0x11e7a0=node_path[_0x4dbd9c(0x1e5)](_0x130216,SYSTEM_FOLDER,COMPONENTS_STATE_FILE_NAME),_0x3de487=await FileUtils[_0x4dbd9c(0x266)](_0x11e7a0);if(!_0x3de487)return[];const _0x5ca20a=await promises['readFile'](_0x11e7a0);return JSON[_0x4dbd9c(0x304)](_0x5ca20a[_0x4dbd9c(0x249)]());}async[a0_0x216d83(0x32f)](_0x40164f){const _0x5d98ac=a0_0x216d83,_0x4677b7=[node_path['join'](_0x40164f,SYSTEM_FOLDER,CONFIG_FILE_NAME),node_path['join'](_0x40164f,SYSTEM_FOLDER,BRANCH_STATE_FILE_NAME),node_path[_0x5d98ac(0x1e5)](_0x40164f,SYSTEM_FOLDER,COMPONENTS_STATE_FILE_NAME),node_path['join'](_0x40164f,SFDX_PROJECT_FILE_NAME)];for(const _0x1c87d0 of _0x4677b7){const _0xcc0000=await FileUtils[_0x5d98ac(0x266)](_0x1c87d0);if(!_0xcc0000)return![];}return!![];}async[a0_0x216d83(0x2da)](_0x1f51fd,_0x38900d){const _0x412a2d=a0_0x216d83,_0xc2fdd9=new ConfigSetAction({'stage':this[_0x412a2d(0x2db)]});await _0xc2fdd9['execute']({'name':_0x1f51fd,'value':_0x38900d});}async[a0_0x216d83(0x344)](_0x5db4ec){const _0x33193d=a0_0x216d83;this['stage'][_0x33193d(0x344)](_0x5db4ec);}[a0_0x216d83(0x1b9)](_0x180d8b){const _0x3fedf3=a0_0x216d83;return this[_0x3fedf3(0x2db)]['updateComponentState'](_0x180d8b);}async[a0_0x216d83(0x30d)](_0x219ef0){const _0x262123=a0_0x216d83;await this[_0x262123(0x2db)]['addFileChange'](_0x219ef0);}[a0_0x216d83(0x204)](_0x11044d){const _0x43bbbf=a0_0x216d83;this[_0x43bbbf(0x2db)]['isUpdateStageTimestamp']=_0x11044d;}}class ReadlineUtils{static async['askString'](_0x23b1ef){const _0xe73aa5=a0_0x216d83,_0x4ed7c2=readline[_0xe73aa5(0x246)]({'input':process['stdin'],'output':process[_0xe73aa5(0x2bb)]}),_0x26c252=await _0x4ed7c2[_0xe73aa5(0x1fe)](_0x23b1ef);return _0x4ed7c2['close'](),_0x26c252;}}const INFO_COLOR_INDEX='4',WARN_COLOR_INDEX='3',ERROR_COLOR_INDEX='1';class Logger{[a0_0x216d83(0x231)];[a0_0x216d83(0x250)];[a0_0x216d83(0x240)];[a0_0x216d83(0x26d)];constructor({isJson:_0x300283}){const _0x5b28d3=a0_0x216d83;this[_0x5b28d3(0x231)]=_0x300283,debug[_0x5b28d3(0x2a8)]=console['log'][_0x5b28d3(0x2d7)](console),debug[_0x5b28d3(0x2ad)](ROOT_NAME+':*'),this[_0x5b28d3(0x250)]=debug(ROOT_NAME+_0x5b28d3(0x2eb)),this[_0x5b28d3(0x250)][_0x5b28d3(0x287)]=INFO_COLOR_INDEX,this[_0x5b28d3(0x240)]=debug(ROOT_NAME+':WARN'),this['warnDebug'][_0x5b28d3(0x287)]=WARN_COLOR_INDEX,this[_0x5b28d3(0x26d)]=debug(ROOT_NAME+_0x5b28d3(0x259)),this['errorDebug'][_0x5b28d3(0x287)]=ERROR_COLOR_INDEX;}['info'](_0x4de0bf){const _0x40f890=a0_0x216d83;!this[_0x40f890(0x231)]&&this[_0x40f890(0x250)](_0x4de0bf);}['warn'](_0x23e1f7){const _0x2c1e44=a0_0x216d83;!this['isJson']&&this[_0x2c1e44(0x240)](_0x23e1f7);}[a0_0x216d83(0x2b5)](_0x55e3f3){const _0x536a7b=a0_0x216d83;!this[_0x536a7b(0x231)]&&this[_0x536a7b(0x26d)](_0x55e3f3);}}class BaseCommand{[a0_0x216d83(0x2fe)];get['logger'](){const _0xe9e3bf=a0_0x216d83;if(!this[_0xe9e3bf(0x2fe)])throw new Error(_0xe9e3bf(0x29a));return this[_0xe9e3bf(0x2fe)];}[a0_0x216d83(0x28e)](_0x5cdacb){const _0xfb352=a0_0x216d83,_0x70499b=new commander[(_0xfb352(0x1c6))]()[_0xfb352(0x24f)](this['commandName'])['description'](this['description']);for(const {name:_0x4e8e8f,description:_0x4a9b62,defaultValue:_0x3fa5a0}of this['arguments']){_0x70499b[_0xfb352(0x301)](_0x4e8e8f,_0x4a9b62,_0x3fa5a0);}for(const {flags:_0x22e306,description:_0x545b0f,defaultValue:_0x3e5f76}of this[_0xfb352(0x1ed)]){_0x70499b[_0xfb352(0x1cb)](_0x22e306,_0x545b0f,_0x3e5f76);}_0x70499b['action'](async(..._0x522032)=>{const _0x4f7e23=_0xfb352,_0x1b1df5=this[_0x4f7e23(0x231)](_0x522032);this[_0x4f7e23(0x2fe)]=new Logger({'isJson':_0x1b1df5});try{const _0x4be382=await this[_0x4f7e23(0x31a)](_0x522032);_0x4be382[_0x4f7e23(0x33a)](_0x1b1df5);}catch(_0x4d02bc){_0x4d02bc instanceof Error&&this[_0x4f7e23(0x303)][_0x4f7e23(0x2b5)](_0x4d02bc[_0x4f7e23(0x300)]);throw _0x4d02bc;}}),_0x5cdacb[_0xfb352(0x26e)](_0x70499b);}}class BaseReporter{[a0_0x216d83(0x342)];get[a0_0x216d83(0x1ba)](){const _0x3f8e93=a0_0x216d83;return this[_0x3f8e93(0x342)];}constructor(_0x2d5532){const _0x3ca4a0=a0_0x216d83;this[_0x3ca4a0(0x342)]=_0x2d5532[_0x3ca4a0(0x1ba)];}[a0_0x216d83(0x33a)](_0x114f27){const _0x16a86a=a0_0x216d83,_0x3f263d=this[_0x16a86a(0x305)]();_0x114f27?this[_0x16a86a(0x1b7)](_0x3f263d):this[_0x16a86a(0x31d)](_0x3f263d);}[a0_0x216d83(0x1b7)](_0x285a7e){const _0x120b76=a0_0x216d83,_0x13584c=JSON['stringify'](_0x285a7e,null,0x2);console[_0x120b76(0x2a8)](_0x13584c);}}class FailReporter extends BaseReporter{[a0_0x216d83(0x245)];constructor({failMessage:_0x48c7b1}){super({'success':![]}),this['failMessage']=_0x48c7b1;}[a0_0x216d83(0x305)](){const _0x18f54b=a0_0x216d83;return{'success':this[_0x18f54b(0x1ba)],'failMessage':this[_0x18f54b(0x245)]};}[a0_0x216d83(0x31d)](_0x4502e2){const _0x149332=a0_0x216d83,_0x11e6f4=[[_0x149332(0x23c)],[_0x4502e2[_0x149332(0x245)]]];console[_0x149332(0x2a8)](table['table'](_0x11e6f4,{'columns':[{'width':0x64}]}));}}class CheckoutReporter extends BaseReporter{[a0_0x216d83(0x2e4)];[a0_0x216d83(0x1f2)];constructor({currentBranch:_0xb9b43e,changes:_0x4949db}){const _0x25d4ee=a0_0x216d83;super({'success':!![]}),this[_0x25d4ee(0x2e4)]=_0xb9b43e,this[_0x25d4ee(0x1f2)]=_0x4949db;}[a0_0x216d83(0x305)](){const _0x22e016=a0_0x216d83;return{'success':this[_0x22e016(0x1ba)],'targetBranch':this[_0x22e016(0x2e4)],'changes':this['changes']};}[a0_0x216d83(0x31d)](_0x292e04){const _0x1891f4=a0_0x216d83;console[_0x1891f4(0x2a8)]('Current\x20Branch:\x20'+this[_0x1891f4(0x2e4)][_0x1891f4(0x24f)]+'\x0a'),console[_0x1891f4(0x2a8)](_0x1891f4(0x1e9));const _0x2144dd=[[_0x1891f4(0x314),_0x1891f4(0x2b0),_0x1891f4(0x1bc),_0x1891f4(0x341)]];for(const {changeType:_0x2ae43a,name:_0x58363c,type:_0x4b4d66,paths:_0x2d7839}of _0x292e04['changes']){_0x2144dd['push']([_0x2ae43a,_0x58363c,_0x4b4d66,_0x2d7839?.['join']('\x0a')||'']);}console[_0x1891f4(0x2a8)](table['table'](_0x2144dd,{'columns':[{},{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class BaseHandler{}class TargetBranchExistHandler extends BaseHandler{[a0_0x216d83(0x256)];[a0_0x216d83(0x253)];[a0_0x216d83(0x1cd)];[a0_0x216d83(0x303)];[a0_0x216d83(0x275)]=[];constructor(_0x335d8b){const _0x307bd1=a0_0x216d83;super(),this['manager']=_0x335d8b[_0x307bd1(0x256)],this[_0x307bd1(0x253)]=_0x335d8b[_0x307bd1(0x253)],this[_0x307bd1(0x1cd)]=_0x335d8b['targetBranch'],this[_0x307bd1(0x303)]=_0x335d8b[_0x307bd1(0x303)];}async[a0_0x216d83(0x32e)](){const _0x439e3e=a0_0x216d83,_0x2c7ea2=await this[_0x439e3e(0x265)]();if(_0x2c7ea2)return new FailReporter({'failMessage':'Uncommitted\x20changes\x20found.\x20Commit\x20or\x20rollback\x20them\x20to\x20proceed'});return this[_0x439e3e(0x303)][_0x439e3e(0x1c5)]('Checking\x20manual\x20changes\x20completed'),this['logger'][_0x439e3e(0x1c5)](_0x439e3e(0x234)),await this[_0x439e3e(0x208)](),this[_0x439e3e(0x303)][_0x439e3e(0x1c5)](_0x439e3e(0x335)),new CheckoutReporter({'currentBranch':{'id':this[_0x439e3e(0x1cd)]['id'],'name':this['targetBranch'][_0x439e3e(0x24f)],'headCommitId':this[_0x439e3e(0x1cd)][_0x439e3e(0x278)]},'changes':this[_0x439e3e(0x275)]});}async[a0_0x216d83(0x265)](){const _0x2f7e59=a0_0x216d83,_0x4597d5=await this[_0x2f7e59(0x256)][_0x2f7e59(0x279)]();return!!_0x4597d5[_0x2f7e59(0x200)];}async['retrieveDifference'](){const _0x2004ab=a0_0x216d83,{devopsUrl:_0x5a8440,accessToken:_0x805465}=this[_0x2004ab(0x253)],_0x526d6d=await this[_0x2004ab(0x256)][_0x2004ab(0x1bd)]({'devopsUrl':_0x5a8440,'accessToken':_0x805465,'targetBranchId':this[_0x2004ab(0x1cd)]['id'],'targetCommitId':this['targetBranch'][_0x2004ab(0x278)]});for(const {id:_0x5c6b67,name:_0x48e8f9,type:_0x31a8c6,changeType:_0x592b81}of _0x526d6d){if(!_0x5c6b67){if(_0x592b81!==ChangeType[_0x2004ab(0x2f8)])throw new Error('Component\x20id\x20not\x20found\x20after\x20comparison');await this[_0x2004ab(0x256)]['saveComponent']({'name':_0x48e8f9,'type':_0x31a8c6,'changeType':_0x592b81}),this[_0x2004ab(0x275)][_0x2004ab(0x212)]({'changeType':_0x592b81,'name':_0x48e8f9,'type':_0x31a8c6});continue;}const _0x55d2c8=await ApiService['retrieveComponentById']({'devopsUrl':_0x5a8440,'accessToken':_0x805465,'componentId':_0x5c6b67});if(!_0x55d2c8['fHash'])throw new Error(_0x2004ab(0x2b9)+_0x55d2c8['name']+'\x22\x20of\x20type\x20\x22'+_0x55d2c8[_0x2004ab(0x30f)]+'\x22\x20not\x20found');await this[_0x2004ab(0x256)][_0x2004ab(0x2b8)]({'name':_0x48e8f9,'type':_0x31a8c6,'changeType':_0x592b81,'component':{..._0x55d2c8,'fHash':_0x55d2c8[_0x2004ab(0x257)]}}),this[_0x2004ab(0x275)]['push']({'changeType':_0x592b81,'name':_0x48e8f9,'type':_0x31a8c6,'paths':_0x55d2c8[_0x2004ab(0x1c1)][_0x2004ab(0x1d8)](_0x57d072=>_0x57d072[_0x2004ab(0x1f6)])});}this[_0x2004ab(0x256)]['saveBranchState'](this[_0x2004ab(0x1cd)]);}}class TargetBranchNotFoundHandler extends BaseHandler{[a0_0x216d83(0x2bf)];[a0_0x216d83(0x256)];[a0_0x216d83(0x253)];[a0_0x216d83(0x308)];['logger'];constructor(_0x21477d){const _0x663cee=a0_0x216d83;super(),this[_0x663cee(0x2bf)]=_0x21477d[_0x663cee(0x2bf)],this[_0x663cee(0x256)]=_0x21477d[_0x663cee(0x256)],this[_0x663cee(0x253)]=_0x21477d[_0x663cee(0x253)],this[_0x663cee(0x308)]=_0x21477d[_0x663cee(0x308)],this[_0x663cee(0x303)]=_0x21477d[_0x663cee(0x303)];}async[a0_0x216d83(0x32e)](){const _0x59e832=a0_0x216d83;this[_0x59e832(0x303)][_0x59e832(0x1c5)](_0x59e832(0x2a9));const {id:_0x2ad6b6}=await this[_0x59e832(0x256)][_0x59e832(0x2ef)](this[_0x59e832(0x2bf)]);if(!_0x2ad6b6)return new FailReporter({'failMessage':'To\x20create\x20a\x20new\x20branch\x20a\x20branch\x20should\x20be\x20selected.\x20Checkout\x20on\x20any\x20existing\x20branch'});const _0x60c267=await ApiService[_0x59e832(0x216)]({'accessToken':this[_0x59e832(0x253)]['accessToken'],'devopsUrl':this['credentials']['devopsUrl'],'name':this[_0x59e832(0x308)],'parentId':_0x2ad6b6});return this['manager'][_0x59e832(0x2d5)](_0x60c267),this[_0x59e832(0x256)][_0x59e832(0x204)](![]),this[_0x59e832(0x303)][_0x59e832(0x1c5)](_0x59e832(0x33d)),new CheckoutReporter({'currentBranch':_0x60c267,'changes':[]});}}class HandlerFactory{static[a0_0x216d83(0x263)](_0x4235ac){const _0x440e7a=a0_0x216d83;if(_0x4235ac[_0x440e7a(0x1cd)])return new TargetBranchExistHandler({..._0x4235ac,'targetBranch':_0x4235ac[_0x440e7a(0x1cd)]});if(!_0x4235ac[_0x440e7a(0x1cd)])return new TargetBranchNotFoundHandler(_0x4235ac);throw new Error(_0x440e7a(0x340));}}class CheckoutCommand extends BaseCommand{['commandName']=a0_0x216d83(0x236);['description']=a0_0x216d83(0x24a);[a0_0x216d83(0x1b8)]=[];[a0_0x216d83(0x1ed)]=[{'flags':'-b,\x20--branch\x20<string>','description':a0_0x216d83(0x25c)},{'flags':a0_0x216d83(0x30e),'description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];['projectPath']=process['cwd']();[a0_0x216d83(0x256)]=ProjectManager[a0_0x216d83(0x20c)]();async[a0_0x216d83(0x31a)]([{branch:_0x309286}]){const _0x459ddc=a0_0x216d83,_0x4ad3ce=await this[_0x459ddc(0x2a2)](_0x309286);this[_0x459ddc(0x303)]['info'](_0x459ddc(0x20b)+_0x4ad3ce+_0x459ddc(0x1e4));const _0x5c460f=await this[_0x459ddc(0x256)][_0x459ddc(0x32f)](this['projectPath']);if(!_0x5c460f)return this[_0x459ddc(0x303)]['warn']('Project\x20is\x20not\x20initialized'),new FailReporter({'failMessage':_0x459ddc(0x328)});const _0x4993d0=await this['getCredentialsAlias'](),_0x5b65d4=await ApiService[_0x459ddc(0x2cc)](_0x4993d0);await this['manager'][_0x459ddc(0x32b)](this[_0x459ddc(0x2bf)]);try{const _0x2ca0ee=await ApiService['getBranch']({'devopsUrl':_0x5b65d4[_0x459ddc(0x1f0)],'accessToken':_0x5b65d4['accessToken'],'branchName':_0x4ad3ce}),_0x4cf20a=HandlerFactory['create']({'projectPath':this[_0x459ddc(0x2bf)],'manager':this[_0x459ddc(0x256)],'credentials':_0x5b65d4,'targetBranch':_0x2ca0ee,'targetBranchName':_0x4ad3ce,'logger':this[_0x459ddc(0x303)]}),_0x3eefc9=await _0x4cf20a[_0x459ddc(0x32e)]();return _0x3eefc9[_0x459ddc(0x1ba)]?(await this[_0x459ddc(0x256)][_0x459ddc(0x1f7)](),this[_0x459ddc(0x303)]['info'](_0x459ddc(0x20b)+_0x4ad3ce+_0x459ddc(0x2f4))):await this[_0x459ddc(0x256)][_0x459ddc(0x32a)](),_0x3eefc9;}catch(_0x53a10f){await this[_0x459ddc(0x256)][_0x459ddc(0x32a)]();throw _0x53a10f;}}[a0_0x216d83(0x231)]([{json:_0x1a68f2}]){return _0x1a68f2;}async[a0_0x216d83(0x2a2)](_0x5e6c66){if(_0x5e6c66)return _0x5e6c66;return ReadlineUtils['askString']('Enter\x20a\x20branch\x20name:\x20');}async[a0_0x216d83(0x1fa)](){const _0x4a9a62=a0_0x216d83,{credentialsAlias:_0x680a7f}=await this[_0x4a9a62(0x256)][_0x4a9a62(0x2fa)](this[_0x4a9a62(0x2bf)]);if(!_0x680a7f)throw new Error('Credentials\x20alias\x20is\x20not\x20configured');if(typeof _0x680a7f!==_0x4a9a62(0x27f))throw new Error('Invalid\x20credentials\x20type');return _0x680a7f;}}class CloneReporter extends BaseReporter{[a0_0x216d83(0x2bf)];[a0_0x216d83(0x2b4)];constructor({projectPath:_0x38f597,components:_0x60112b}){const _0x54eaa1=a0_0x216d83;super({'success':!![]}),this[_0x54eaa1(0x2bf)]=_0x38f597,this['components']=_0x60112b;}[a0_0x216d83(0x305)](){const _0x4dc84f=a0_0x216d83;return{'success':this[_0x4dc84f(0x1ba)],'projectPath':this['projectPath'],'components':this[_0x4dc84f(0x2b4)]};}[a0_0x216d83(0x31d)](_0x53861b){const _0x4b728b=a0_0x216d83;console[_0x4b728b(0x2a8)]('Init\x20Result:');const _0x41a4a8=[[_0x4b728b(0x1c3)],[_0x53861b[_0x4b728b(0x2bf)]]];console[_0x4b728b(0x2a8)](table['table'](_0x41a4a8,{'columns':[{'width':0x28}]})),console[_0x4b728b(0x2a8)](_0x4b728b(0x1f4));const _0x51932f=[[_0x4b728b(0x2b0),_0x4b728b(0x1bc),_0x4b728b(0x341)]];for(const {name:_0x481ed5,type:_0xf0f33e,paths:_0xad4ab9}of _0x53861b[_0x4b728b(0x2b4)]){_0x51932f[_0x4b728b(0x212)]([_0x481ed5,_0xf0f33e,_0xad4ab9[_0x4b728b(0x1e5)]('\x0a')]);}console[_0x4b728b(0x2a8)](table[_0x4b728b(0x242)](_0x51932f,{'columns':[{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class CloneCommand extends BaseCommand{[a0_0x216d83(0x1ee)]=a0_0x216d83(0x1d9);[a0_0x216d83(0x258)]='Initialize\x20salesforce\x20project\x20and\x20retrieve\x20\x22main\x22\x20branch\x20from\x20registered\x20devops\x20tenant.';[a0_0x216d83(0x1b8)]=[];[a0_0x216d83(0x1ed)]=[{'flags':a0_0x216d83(0x23d),'description':'A\x20name\x20of\x20a\x20folder\x20where\x20a\x20project\x20will\x20be\x20stored.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.'},{'flags':a0_0x216d83(0x296),'description':a0_0x216d83(0x244),'defaultValue':DEFAULT_ALIAS_NAME},{'flags':'--json','description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];['manager']=ProjectManager['getInstance']();['retrievedComponents']=[];['_credentials'];get['credentials'](){const _0x8398c0=a0_0x216d83;if(!this[_0x8398c0(0x1b3)])throw new Error(_0x8398c0(0x323));return this[_0x8398c0(0x1b3)];}async['execute']([_0x347d46]){const _0x38566d=a0_0x216d83;this[_0x38566d(0x303)]['info'](_0x38566d(0x1de)),this['_credentials']=await ApiService[_0x38566d(0x2cc)](_0x347d46['alias']);const _0x34525b=await this[_0x38566d(0x2d6)](_0x347d46[_0x38566d(0x24f)]);this[_0x38566d(0x303)][_0x38566d(0x1c5)](_0x38566d(0x2af));const _0x11962c=await this[_0x38566d(0x256)][_0x38566d(0x32f)](_0x34525b);if(_0x11962c)return this['logger'][_0x38566d(0x2bd)](_0x38566d(0x29d)),new FailReporter({'failMessage':'Project\x20has\x20already\x20been\x20initialized.\x20Duplicate\x20initialization\x20is\x20not\x20allowed.'});await this['manager'][_0x38566d(0x32b)](_0x34525b);try{return await this[_0x38566d(0x256)][_0x38566d(0x326)]({'config':{'credentialsAlias':_0x347d46['alias']}}),this[_0x38566d(0x303)]['info'](_0x38566d(0x260)),await this[_0x38566d(0x306)](),await this[_0x38566d(0x256)][_0x38566d(0x1f7)](),this['logger'][_0x38566d(0x1c5)](_0x38566d(0x324)),new CloneReporter({'projectPath':_0x34525b,'components':this[_0x38566d(0x1ea)]});}catch(_0x45cd61){await this[_0x38566d(0x256)]['abortStage']();throw _0x45cd61;}}[a0_0x216d83(0x231)]([{json:_0x50e4c1}]){return _0x50e4c1;}async['retrieve'](){const _0x385d45=a0_0x216d83;this[_0x385d45(0x303)][_0x385d45(0x1c5)](_0x385d45(0x234));const {accessToken:_0x550201,devopsUrl:_0x82d75}=this[_0x385d45(0x253)],_0x2de2dd=await ApiService[_0x385d45(0x1be)]({'devopsUrl':_0x82d75,'accessToken':_0x550201});this[_0x385d45(0x256)]['saveBranchState'](_0x2de2dd);for await(const _0x7ea521 of ApiService[_0x385d45(0x2f9)]({'devopsUrl':_0x82d75,'accessToken':_0x550201,'branchId':_0x2de2dd['id'],'commitId':_0x2de2dd[_0x385d45(0x278)]})){if(!_0x7ea521[_0x385d45(0x257)])throw new Error(_0x7ea521[_0x385d45(0x24f)]+_0x385d45(0x1b1)+_0x7ea521[_0x385d45(0x30f)]+_0x385d45(0x2e2));await this['manager'][_0x385d45(0x2b8)]({'name':_0x7ea521['name'],'type':_0x7ea521[_0x385d45(0x30f)],'changeType':ChangeType[_0x385d45(0x1bf)],'component':{..._0x7ea521,'fHash':_0x7ea521[_0x385d45(0x257)]}}),this[_0x385d45(0x1ea)]['push']({'name':_0x7ea521[_0x385d45(0x24f)],'type':_0x7ea521[_0x385d45(0x30f)],'paths':_0x7ea521['files']['map'](_0x9bb436=>_0x9bb436['path'])});}this[_0x385d45(0x303)][_0x385d45(0x1c5)](_0x385d45(0x335));}async['buildProjectPath'](_0x542b7f){const _0x8e8c8f=a0_0x216d83;if(_0x542b7f)return node_path[_0x8e8c8f(0x1e5)](process['cwd'](),_0x542b7f);const _0x6e6a3a=await ReadlineUtils[_0x8e8c8f(0x299)](_0x8e8c8f(0x1d3));return node_path[_0x8e8c8f(0x1e5)](process[_0x8e8c8f(0x25f)](),_0x6e6a3a);}}class CommitReporter extends BaseReporter{[a0_0x216d83(0x1f2)];constructor({changes:_0x3ae09a}){const _0x5981cd=a0_0x216d83;super({'success':!![]}),this[_0x5981cd(0x1f2)]=_0x3ae09a;}[a0_0x216d83(0x305)](){const _0x4dc18e=a0_0x216d83;return{'success':this[_0x4dc18e(0x1ba)],'changes':this[_0x4dc18e(0x1f2)]};}[a0_0x216d83(0x31d)](_0x47c14c){const _0x4f3aac=a0_0x216d83;console['log'](_0x4f3aac(0x255));const _0xdc8fcb=[[_0x4f3aac(0x314),_0x4f3aac(0x2b0),_0x4f3aac(0x1bc),'Files']];for(const {changeType:_0x10f9e9,name:_0x479139,type:_0x4d7607,paths:_0xfa473c}of _0x47c14c['changes']){_0xdc8fcb['push']([_0x10f9e9,_0x479139,_0x4d7607,_0xfa473c?.[_0x4f3aac(0x1e5)]('\x0a')||'']);}console[_0x4f3aac(0x2a8)](table['table'](_0xdc8fcb,{'columns':[{},{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class CommitCommand extends BaseCommand{[a0_0x216d83(0x1ee)]=a0_0x216d83(0x2ab);['description']=a0_0x216d83(0x201);['arguments']=[];[a0_0x216d83(0x1ed)]=[{'flags':'-m,\x20--message\x20<string>','description':a0_0x216d83(0x271)},{'flags':a0_0x216d83(0x30e),'description':a0_0x216d83(0x2a7),'defaultValue':![]}];[a0_0x216d83(0x2bf)]=process[a0_0x216d83(0x25f)]();[a0_0x216d83(0x256)]=ProjectManager[a0_0x216d83(0x20c)]();[a0_0x216d83(0x275)]=[];['_credentials'];[a0_0x216d83(0x213)];[a0_0x216d83(0x30b)];[a0_0x216d83(0x2e3)];get[a0_0x216d83(0x253)](){const _0x788553=a0_0x216d83;if(!this[_0x788553(0x1b3)])throw new Error(_0x788553(0x323));return this[_0x788553(0x1b3)];}get[a0_0x216d83(0x343)](){const _0x3034d9=a0_0x216d83;if(!this['_branchId'])throw new Error(_0x3034d9(0x1f1));return this[_0x3034d9(0x213)];}get[a0_0x216d83(0x31f)](){const _0x5daa20=a0_0x216d83;if(!this[_0x5daa20(0x30b)])throw new Error(_0x5daa20(0x2ce));return this[_0x5daa20(0x30b)];}get[a0_0x216d83(0x1f2)](){const _0xd2e8b3=a0_0x216d83;if(!this[_0xd2e8b3(0x2e3)])throw new Error(_0xd2e8b3(0x2c8));return this['_changes'];}async[a0_0x216d83(0x31a)]([_0x23ed6a]){const _0x412f8b=a0_0x216d83;this['logger'][_0x412f8b(0x1c5)](_0x412f8b(0x21d));const _0x32dc23=await this[_0x412f8b(0x256)][_0x412f8b(0x32f)](this[_0x412f8b(0x2bf)]);if(!_0x32dc23)return this['logger'][_0x412f8b(0x2bd)](_0x412f8b(0x328)),new FailReporter({'failMessage':_0x412f8b(0x328)});const _0x13e8b0=await this[_0x412f8b(0x1cc)](_0x23ed6a[_0x412f8b(0x300)]);await this[_0x412f8b(0x329)](),await this[_0x412f8b(0x2cc)]();const _0x18eb1a=await this['areRemoteChanges']();if(_0x18eb1a)return this[_0x412f8b(0x303)]['warn'](_0x412f8b(0x315)),new FailReporter({'failMessage':_0x412f8b(0x315)});await this[_0x412f8b(0x256)]['initStage'](this['projectPath']);try{this[_0x412f8b(0x2e3)]=await this[_0x412f8b(0x256)][_0x412f8b(0x279)]();if(!this[_0x412f8b(0x1f2)][_0x412f8b(0x200)])return this[_0x412f8b(0x303)][_0x412f8b(0x2bd)](_0x412f8b(0x339)),new FailReporter({'failMessage':_0x412f8b(0x339)});return await this[_0x412f8b(0x332)](_0x13e8b0),await this[_0x412f8b(0x256)]['applyStage'](),this[_0x412f8b(0x303)][_0x412f8b(0x1c5)]('Commit\x20completed'),new CommitReporter({'changes':this[_0x412f8b(0x275)]});}catch(_0x3198ac){await this[_0x412f8b(0x256)][_0x412f8b(0x32a)]();throw _0x3198ac;}}[a0_0x216d83(0x231)]([{json:_0x29fa52}]){return _0x29fa52;}async['getMessage'](_0x5a1e41){const _0x208b6f=a0_0x216d83;if(_0x5a1e41)return _0x5a1e41;const _0x4a2027=await ReadlineUtils[_0x208b6f(0x299)](_0x208b6f(0x251));return _0x4a2027;}async[a0_0x216d83(0x2cc)](){const _0x502851=a0_0x216d83,{credentialsAlias:_0x4361b3}=await this['manager']['readConfig'](this[_0x502851(0x2bf)]);if(!_0x4361b3)throw new Error('Credentials\x20alias\x20is\x20not\x20configured');if(typeof _0x4361b3!=='string')throw new Error('Invalid\x20credentials\x20type');this['_credentials']=await ApiService['getCredentials'](_0x4361b3);}async[a0_0x216d83(0x329)](){const _0x4fb6bc=a0_0x216d83,{id:_0x1c66b1,headCommitId:_0x363440}=await this[_0x4fb6bc(0x256)]['readBranchState'](this['projectPath']);this[_0x4fb6bc(0x213)]=_0x1c66b1||void 0x0,this[_0x4fb6bc(0x30b)]=_0x363440||void 0x0;}async['areRemoteChanges'](){const _0xa0edef=a0_0x216d83,{headCommitId:_0x11d5f7}=await ApiService['getBranchById']({'accessToken':this['credentials'][_0xa0edef(0x1db)],'devopsUrl':this[_0xa0edef(0x253)][_0xa0edef(0x1f0)],'branchId':this[_0xa0edef(0x343)]});return this['localHeadCommit']!==_0x11d5f7;}async['findAndCommitChanges'](_0xcec274){const _0x4bef49=a0_0x216d83;this['logger']['info'](_0x4bef49(0x22c));const _0x3ccf3b=await ApiService[_0x4bef49(0x1f5)]({'accessToken':this['credentials'][_0x4bef49(0x1db)],'devopsUrl':this['credentials']['devopsUrl']}),_0x48a254={'accessToken':this[_0x4bef49(0x253)][_0x4bef49(0x1db)],'devopsUrl':this['credentials']['devopsUrl'],'message':_0xcec274,'branchId':this[_0x4bef49(0x343)],'components':[],'userName':_0x3ccf3b[_0x4bef49(0x286)]+'\x20'+_0x3ccf3b[_0x4bef49(0x2e1)]};for(const _0x160d30 of this[_0x4bef49(0x1f2)]){const _0x2743a3=await this[_0x4bef49(0x256)][_0x4bef49(0x1b9)](_0x160d30),_0x1556ea=_0x2743a3['changeType']===ChangeType['CREATE']?_0x2743a3[_0x4bef49(0x24f)]:void 0x0,_0x29ee48=this['convertToLocalComponent'](_0x2743a3[_0x4bef49(0x24f)],_0x1556ea,_0x2743a3['type'],_0x2743a3?.[_0x4bef49(0x298)]||[]);_0x48a254[_0x4bef49(0x2b4)]['push'](_0x29ee48),this[_0x4bef49(0x275)][_0x4bef49(0x212)](_0x2743a3);}this[_0x4bef49(0x303)]['info']('Detecting\x20changes\x20completed.\x20'+this['changes'][_0x4bef49(0x200)]+_0x4bef49(0x1e8)),await ApiService['commit'](_0x48a254);const _0x3057d9=await ApiService[_0x4bef49(0x2d4)]({'accessToken':this[_0x4bef49(0x253)][_0x4bef49(0x1db)],'devopsUrl':this[_0x4bef49(0x253)][_0x4bef49(0x1f0)],'branchId':this['branchId']});this[_0x4bef49(0x256)][_0x4bef49(0x2d5)](_0x3057d9);}[a0_0x216d83(0x28f)](_0x15d30f,_0x126998,_0x41a0f9,_0x306b1c){const _0x31e2e4=a0_0x216d83,_0x53c231={'name':_0x15d30f,'label':_0x126998,'type':_0x41a0f9,'files':[]};for(const _0x1e20d6 of _0x306b1c){const _0x3745cd=_0x1e20d6[_0x31e2e4(0x214)](path[_0x31e2e4(0x1d5)])[_0x31e2e4(0x241)](0x3)[_0x31e2e4(0x1e5)]('/'),_0x11f2c6=path[_0x31e2e4(0x1e5)](this[_0x31e2e4(0x2bf)],_0x1e20d6);_0x53c231[_0x31e2e4(0x1c1)][_0x31e2e4(0x212)]({'path':_0x3745cd,'localPath':_0x11f2c6});}return _0x53c231;}}class ConfigSetReporter extends BaseReporter{[a0_0x216d83(0x25d)];[a0_0x216d83(0x273)];constructor({configName:_0x50409d,value:_0x48240a}){const _0xf91692=a0_0x216d83;super({'success':!![]}),this[_0xf91692(0x25d)]=_0x50409d,this[_0xf91692(0x273)]=_0x48240a;}[a0_0x216d83(0x305)](){const _0x489ca5=a0_0x216d83;return{'success':this[_0x489ca5(0x1ba)],'configName':this[_0x489ca5(0x25d)],'value':this[_0x489ca5(0x273)]};}[a0_0x216d83(0x31d)](_0x510797){const _0x170e29=a0_0x216d83,_0xe3bf0e=[['Config\x20Name','Value'],[_0x510797['configName'],_0x510797[_0x170e29(0x273)]]];console[_0x170e29(0x2a8)](table['table'](_0xe3bf0e));}}const ALLOWED_VALUES=[ConfigName[a0_0x216d83(0x2a6)]+'(string)'];class ConfigSetCommand extends BaseCommand{[a0_0x216d83(0x1ee)]=a0_0x216d83(0x2c9);[a0_0x216d83(0x258)]=a0_0x216d83(0x2cf);['arguments']=[{'name':a0_0x216d83(0x21c),'description':a0_0x216d83(0x215)+ALLOWED_VALUES['join'](',\x20')+'.'},{'name':a0_0x216d83(0x316),'description':'Config\x20value'}];['options']=[{'flags':a0_0x216d83(0x30e),'description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];[a0_0x216d83(0x256)]=ProjectManager[a0_0x216d83(0x20c)]();async['execute']([_0xd35398,_0x13a265]){const _0x1f762c=a0_0x216d83;this[_0x1f762c(0x303)][_0x1f762c(0x1c5)](_0x1f762c(0x2b6));const _0x2e4ff4=process['cwd'](),_0x20ca9a=await this['manager'][_0x1f762c(0x32f)](_0x2e4ff4);if(!_0x20ca9a)return this['logger'][_0x1f762c(0x2bd)]('Project\x20is\x20not\x20initialized'),new FailReporter({'failMessage':'Project\x20is\x20not\x20initialized'});await this['manager'][_0x1f762c(0x32b)](_0x2e4ff4);try{return await this['manager'][_0x1f762c(0x2da)](_0xd35398,_0x13a265),await this[_0x1f762c(0x256)][_0x1f762c(0x1f7)](),this[_0x1f762c(0x303)][_0x1f762c(0x1c5)](_0x1f762c(0x28b)),new ConfigSetReporter({'configName':_0xd35398,'value':_0x13a265});}catch(_0xcd82b6){await this[_0x1f762c(0x256)][_0x1f762c(0x32a)]();throw _0xcd82b6;}}[a0_0x216d83(0x231)]([,,{json:_0x2baca}]){return _0x2baca;}}class ConfigUnsetReporter extends BaseReporter{[a0_0x216d83(0x25d)];constructor(_0x2ade3e){const _0x3e9890=a0_0x216d83;super({'success':!![]}),this[_0x3e9890(0x25d)]=_0x2ade3e[_0x3e9890(0x25d)];}[a0_0x216d83(0x305)](){const _0x41c82e=a0_0x216d83;return{'success':!![],'configName':this[_0x41c82e(0x25d)],'value':null};}[a0_0x216d83(0x31d)](_0x27449f){const _0x8ed8a5=a0_0x216d83,_0xf59e9d=[[_0x8ed8a5(0x2c2),_0x8ed8a5(0x24b)],[_0x27449f[_0x8ed8a5(0x25d)],_0x27449f[_0x8ed8a5(0x273)]||_0x8ed8a5(0x337)]];console[_0x8ed8a5(0x2a8)](table['table'](_0xf59e9d));}}function a0_0x3826(_0x956c4,_0x52e9f4){const _0x34b2dd=a0_0x5404();return a0_0x3826=function(_0x25e96e,_0x3c45d3){_0x25e96e=_0x25e96e-0x1b1;let _0x5404a5=_0x34b2dd[_0x25e96e];return _0x5404a5;},a0_0x3826(_0x956c4,_0x52e9f4);}class ConfigUnset extends BaseCommand{[a0_0x216d83(0x1ee)]='config-unset';['description']=a0_0x216d83(0x26a);[a0_0x216d83(0x1b8)]=[{'name':a0_0x216d83(0x21c),'description':a0_0x216d83(0x215)+Object[a0_0x216d83(0x203)](ConfigName)[a0_0x216d83(0x1e5)](',\x20')+'.'}];[a0_0x216d83(0x1ed)]=[{'flags':'--json','description':a0_0x216d83(0x2a7),'defaultValue':![]}];[a0_0x216d83(0x2bf)]=process[a0_0x216d83(0x25f)]();[a0_0x216d83(0x256)]=ProjectManager[a0_0x216d83(0x20c)]();async['execute']([_0x13a9f8]){const _0xc37e96=a0_0x216d83;this['logger'][_0xc37e96(0x1c5)](_0xc37e96(0x2b6));const _0x1f774a=await this[_0xc37e96(0x256)][_0xc37e96(0x32f)](this['projectPath']);if(!_0x1f774a)return this[_0xc37e96(0x303)]['warn'](_0xc37e96(0x328)),new FailReporter({'failMessage':'Project\x20is\x20not\x20initialized'});await this[_0xc37e96(0x256)][_0xc37e96(0x32b)](this[_0xc37e96(0x2bf)]);try{return await this[_0xc37e96(0x256)][_0xc37e96(0x344)](_0x13a9f8),await this[_0xc37e96(0x256)][_0xc37e96(0x1f7)](),this[_0xc37e96(0x303)][_0xc37e96(0x1c5)](_0xc37e96(0x28b)),new ConfigUnsetReporter({'configName':_0x13a9f8});}catch(_0x4e9cb6){await this[_0xc37e96(0x256)][_0xc37e96(0x32a)]();throw _0x4e9cb6;}}['isJson']([,{json:_0x274fef}]){return _0x274fef;}}class InitReporter extends BaseReporter{[a0_0x216d83(0x2bf)];constructor({projectPath:_0x3d8fec}){const _0x15e1dc=a0_0x216d83;super({'success':!![]}),this[_0x15e1dc(0x2bf)]=_0x3d8fec;}['buildReport'](){const _0x1a9640=a0_0x216d83;return{'success':this[_0x1a9640(0x1ba)],'projectPath':this[_0x1a9640(0x2bf)]};}[a0_0x216d83(0x31d)](_0x1146b0){const _0x109581=a0_0x216d83,_0x2ea836=[[_0x109581(0x1c3)],[_0x1146b0['projectPath']]];console[_0x109581(0x2a8)](table[_0x109581(0x242)](_0x2ea836,{'columns':[{'width':0x28}]}));}}class InitCommand extends BaseCommand{[a0_0x216d83(0x1ee)]=a0_0x216d83(0x218);[a0_0x216d83(0x258)]=a0_0x216d83(0x1c8);[a0_0x216d83(0x1b8)]=[];['options']=[{'flags':'-n,\x20--name\x20<string>','description':'A\x20name\x20of\x20a\x20folder\x20where\x20a\x20project\x20will\x20be\x20stored.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.'},{'flags':a0_0x216d83(0x30e),'description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];[a0_0x216d83(0x256)]=ProjectManager[a0_0x216d83(0x20c)]();async[a0_0x216d83(0x31a)]([_0x137ba8]){const _0x4c9d6b=a0_0x216d83;this['logger'][_0x4c9d6b(0x1c5)](_0x4c9d6b(0x2af));const _0x3d3f7c=await this['buildProjectPath'](_0x137ba8[_0x4c9d6b(0x24f)]),_0x19cee1=await this[_0x4c9d6b(0x256)][_0x4c9d6b(0x32f)](_0x3d3f7c);if(_0x19cee1)return this['logger'][_0x4c9d6b(0x2bd)](_0x4c9d6b(0x29d)),new FailReporter({'failMessage':'Project\x20has\x20already\x20been\x20initialized.\x20Duplicate\x20initialization\x20is\x20not\x20allowed.'});await this[_0x4c9d6b(0x256)][_0x4c9d6b(0x32b)](_0x3d3f7c);try{return await this[_0x4c9d6b(0x256)]['initProject']({}),await this['manager'][_0x4c9d6b(0x1f7)](),this['logger'][_0x4c9d6b(0x1c5)](_0x4c9d6b(0x260)),new InitReporter({'projectPath':_0x3d3f7c});}catch(_0x25b51c){await this['manager'][_0x4c9d6b(0x32a)]();throw _0x25b51c;}}['isJson']([{json:_0x374578}]){return _0x374578;}async['buildProjectPath'](_0x5e19f1){const _0x1a5011=a0_0x216d83;if(_0x5e19f1)return node_path[_0x1a5011(0x1e5)](process[_0x1a5011(0x25f)](),_0x5e19f1);const _0x316dad=await ReadlineUtils[_0x1a5011(0x299)]('Enter\x20project\x20name:\x20');return node_path[_0x1a5011(0x1e5)](process[_0x1a5011(0x25f)](),_0x316dad);}}class ListBranchesReporter extends BaseReporter{[a0_0x216d83(0x312)];constructor(_0x11c243){const _0x3f9f25=a0_0x216d83;super({'success':!![]}),this[_0x3f9f25(0x312)]=_0x11c243[_0x3f9f25(0x312)];}[a0_0x216d83(0x305)](){const _0x2bf476=a0_0x216d83;return{'success':this[_0x2bf476(0x1ba)],'branches':this['branches']};}['print'](_0x5d8590){const _0x3c53f3=a0_0x216d83,_0x209bd9=[[_0x3c53f3(0x2e6)]];for(const _0x440310 of _0x5d8590[_0x3c53f3(0x312)]){_0x209bd9['push']([_0x440310]);}console[_0x3c53f3(0x2a8)](table[_0x3c53f3(0x242)](_0x209bd9,{'columns':[{'width':0x1e}]}));}}class ListBranchesCommand extends BaseCommand{[a0_0x216d83(0x1ee)]='list-branches';[a0_0x216d83(0x258)]='List\x20all\x20remote\x20branches.';[a0_0x216d83(0x1b8)]=[];[a0_0x216d83(0x1ed)]=[{'flags':a0_0x216d83(0x30e),'description':a0_0x216d83(0x2a7),'defaultValue':![]}];[a0_0x216d83(0x2bf)]=process[a0_0x216d83(0x25f)]();[a0_0x216d83(0x256)]=ProjectManager['getInstance']();async[a0_0x216d83(0x31a)](){const _0x4f308e=a0_0x216d83;this[_0x4f308e(0x303)][_0x4f308e(0x1c5)](_0x4f308e(0x239));const _0x4c0665=await this[_0x4f308e(0x256)][_0x4f308e(0x32f)](this['projectPath']);if(!_0x4c0665)return this[_0x4f308e(0x303)]['warn'](_0x4f308e(0x328)),new FailReporter({'failMessage':'Project\x20is\x20not\x20initialized'});const _0xdedb2d=await this[_0x4f308e(0x1fa)](),{accessToken:_0x51c5e4,devopsUrl:_0x40bab4}=await ApiService[_0x4f308e(0x2cc)](_0xdedb2d),_0x496aff=await ApiService[_0x4f308e(0x1d4)]({'accessToken':_0x51c5e4,'devopsUrl':_0x40bab4});return this['logger'][_0x4f308e(0x1c5)]('Listing\x20remote\x20branches\x20completed'),new ListBranchesReporter({'branches':_0x496aff[_0x4f308e(0x1d8)](_0x1de642=>_0x1de642[_0x4f308e(0x24f)])});}[a0_0x216d83(0x231)]([{json:_0x268be9}]){return _0x268be9;}async['getCredentialsAlias'](){const _0x33bc9c=a0_0x216d83,{credentialsAlias:_0x322014}=await this[_0x33bc9c(0x256)][_0x33bc9c(0x2fa)](this[_0x33bc9c(0x2bf)]);if(!_0x322014)throw new Error(_0x33bc9c(0x31e));if(typeof _0x322014!==_0x33bc9c(0x27f))throw new Error(_0x33bc9c(0x2ec));return _0x322014;}}class ListCredentialsReporter extends BaseReporter{[a0_0x216d83(0x253)];constructor(_0x40450d){const _0xd7300f=a0_0x216d83;super({'success':!![]}),this[_0xd7300f(0x253)]=_0x40450d[_0xd7300f(0x253)];}['buildReport'](){const _0xae387a=a0_0x216d83;return{'success':this[_0xae387a(0x1ba)],'credentials':this[_0xae387a(0x253)]};}['print'](_0x1759ea){const _0x2a9707=a0_0x216d83,_0x349348=[[_0x2a9707(0x327),'Global\x20Settings\x20Url',_0x2a9707(0x1ca)]];for(const {alias:_0x1b1e56,globalSettingsUrl:_0x33380c,devopsUrl:_0x44a342}of _0x1759ea['credentials']){_0x349348['push']([_0x1b1e56,_0x33380c,_0x44a342||_0x2a9707(0x276)]);}console[_0x2a9707(0x2a8)](table[_0x2a9707(0x242)](_0x349348));}}class ListCredentialsCommand extends BaseCommand{[a0_0x216d83(0x1ee)]=a0_0x216d83(0x22e);[a0_0x216d83(0x258)]=a0_0x216d83(0x21b);[a0_0x216d83(0x1b8)]=[];['options']=[{'flags':a0_0x216d83(0x30e),'description':a0_0x216d83(0x2a7),'defaultValue':![]}];async[a0_0x216d83(0x31a)](){const _0x5814cc=a0_0x216d83;this['logger'][_0x5814cc(0x1c5)](_0x5814cc(0x254));const _0xc50d2b=await CredentialsManager['list']();return this[_0x5814cc(0x303)][_0x5814cc(0x1c5)](_0x5814cc(0x238)),new ListCredentialsReporter({'credentials':_0xc50d2b[_0x5814cc(0x1d8)](({alias:_0x374abb,globalSettingsUrl:_0x5af898,devopsUrl:_0x245add})=>({'alias':_0x374abb,'globalSettingsUrl':_0x5af898,'devopsUrl':_0x245add}))});}[a0_0x216d83(0x231)]([{json:_0x715d29}]){return _0x715d29;}}const TOKEN_PREFIX='fk_';class LoginAction{constructor(_0x2ab2f2){this['accessToken']=_0x2ab2f2;}async[a0_0x216d83(0x31a)](){const _0x175241=a0_0x216d83;try{const _0x3035a7=this['accessToken']['split'](TOKEN_PREFIX)[0x1],_0x3f1643=JSON[_0x175241(0x304)](Buffer[_0x175241(0x267)](_0x3035a7,_0x175241(0x1f9))[_0x175241(0x249)](_0x175241(0x2a4))),_0x12b80a=await axios[_0x175241(0x2e5)](_0x175241(0x282),{'headers':{'authorization':''+this[_0x175241(0x1db)]},'baseURL':_0x3f1643[_0x175241(0x2ee)]})[_0x175241(0x311)](({data:_0xb2aef3})=>new Map(_0xb2aef3[_0x175241(0x1d8)](_0x156139=>[_0x156139[_0x175241(0x24f)],_0x156139[_0x175241(0x2cd)]]))),_0x5dbd9e={'globalSettingsUrl':_0x3f1643[_0x175241(0x2ee)]};for(const [_0x2906bb,_0x303d9e]of _0x12b80a[_0x175241(0x2aa)]()){_0x2906bb===_0x175241(0x1d0)&&(_0x5dbd9e['devopsUrl']=_0x303d9e);}return _0x5dbd9e;}catch(_0x49fc33){if(axios['isAxiosError'](_0x49fc33))throw Error(_0x49fc33[_0x175241(0x227)]?.[_0x175241(0x307)][_0x175241(0x300)]||_0x49fc33[_0x175241(0x227)]?.[_0x175241(0x28c)]||_0x49fc33[_0x175241(0x300)],{'cause':_0x49fc33});throw _0x49fc33;}}}class GlobalSettingsService{static async['login']({accessToken:_0x4a415d}){const _0x4462b9=a0_0x216d83,_0xe83d63=new LoginAction(_0x4a415d);return _0xe83d63[_0x4462b9(0x31a)]();}}class LoginReporter extends BaseReporter{[a0_0x216d83(0x27e)];[a0_0x216d83(0x294)];[a0_0x216d83(0x1f0)];constructor({alias:_0x5c5dd9,globalSettingsUrl:_0x5aa501,devopsUrl:_0x4ca812}){const _0x97783a=a0_0x216d83;super({'success':!![]}),this[_0x97783a(0x27e)]=_0x5c5dd9,this[_0x97783a(0x294)]=_0x5aa501,this['devopsUrl']=_0x4ca812;}[a0_0x216d83(0x305)](){const _0x488aa1=a0_0x216d83;return{'success':this['success'],'alias':this[_0x488aa1(0x27e)],'globalSettingsUrl':this['globalSettingsUrl'],'devopsUrl':this['devopsUrl']};}[a0_0x216d83(0x31d)](_0x40362c){const _0xb558b4=a0_0x216d83,_0x3bcf53=[['Alias',_0xb558b4(0x2b3),_0xb558b4(0x1ca)],[_0x40362c[_0xb558b4(0x27e)],_0x40362c[_0xb558b4(0x294)],_0x40362c[_0xb558b4(0x1f0)]||_0xb558b4(0x276)]];console[_0xb558b4(0x2a8)](table[_0xb558b4(0x242)](_0x3bcf53));}}class LoginCommand extends BaseCommand{['commandName']=a0_0x216d83(0x26b);[a0_0x216d83(0x258)]=a0_0x216d83(0x1c9);[a0_0x216d83(0x1b8)]=[];[a0_0x216d83(0x1ed)]=[{'flags':'-a,\x20--alias\x20<string>','description':a0_0x216d83(0x1fb),'defaultValue':DEFAULT_ALIAS_NAME},{'flags':a0_0x216d83(0x2d0),'description':a0_0x216d83(0x29b)+ROOT_NAME+'\x20services.\x20If\x20not\x20specified\x20it\x20will\x20be\x20requested\x20during\x20command\x20execution.'},{'flags':a0_0x216d83(0x30e),'description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];async['execute']([_0x51ba89]){const _0x7581bc=a0_0x216d83;this[_0x7581bc(0x303)][_0x7581bc(0x1c5)](_0x7581bc(0x217));const _0xb99166=await this[_0x7581bc(0x1ce)](_0x51ba89['token']),_0x11dce6=await GlobalSettingsService[_0x7581bc(0x26b)]({'accessToken':_0xb99166});return await CredentialsManager[_0x7581bc(0x29c)]({'alias':_0x51ba89['alias'],'accessToken':_0xb99166,'globalSettingsUrl':_0x11dce6[_0x7581bc(0x294)],'devopsUrl':_0x11dce6[_0x7581bc(0x1f0)]}),this['logger'][_0x7581bc(0x1c5)](_0x7581bc(0x30c)+_0x51ba89[_0x7581bc(0x27e)]+'\x22'),new LoginReporter({'alias':_0x51ba89[_0x7581bc(0x27e)],'globalSettingsUrl':_0x11dce6['globalSettingsUrl'],'devopsUrl':_0x11dce6['devopsUrl']});}[a0_0x216d83(0x231)]([{json:_0x27fc7e}]){return _0x27fc7e;}async[a0_0x216d83(0x1ce)](_0x3495d8){const _0x197adc=a0_0x216d83;if(_0x3495d8)return _0x3495d8;const _0x1760d4=await ReadlineUtils['askString'](_0x197adc(0x310));return _0x1760d4;}}const DELETED_STATUS=a0_0x216d83(0x33e);class LogoutReporter extends BaseReporter{[a0_0x216d83(0x27e)];constructor({alias:_0x1ce063}){super({'success':!![]}),this['alias']=_0x1ce063;}[a0_0x216d83(0x305)](){return{'success':this['success'],'alias':this['alias'],'status':DELETED_STATUS};}[a0_0x216d83(0x31d)](_0x20d1a2){const _0x5058eb=a0_0x216d83,_0xbb4ed4=[[_0x5058eb(0x327),_0x5058eb(0x33c)],[_0x20d1a2[_0x5058eb(0x27e)],_0x20d1a2[_0x5058eb(0x321)]]];console[_0x5058eb(0x2a8)](table['table'](_0xbb4ed4));}}class LogoutCommand extends BaseCommand{[a0_0x216d83(0x1ee)]=a0_0x216d83(0x27d);[a0_0x216d83(0x258)]=a0_0x216d83(0x21a);[a0_0x216d83(0x1b8)]=[];[a0_0x216d83(0x1ed)]=[{'flags':'-a,\x20--alias\x20<string>','description':a0_0x216d83(0x27a),'defaultValue':DEFAULT_ALIAS_NAME},{'flags':a0_0x216d83(0x30e),'description':a0_0x216d83(0x2a7),'defaultValue':![]}];async['execute']([_0x18afc5]){const _0x3524a4=a0_0x216d83;return this['logger'][_0x3524a4(0x1c5)](_0x3524a4(0x25b)),await CredentialsManager[_0x3524a4(0x1cf)]({'alias':_0x18afc5[_0x3524a4(0x27e)]}),this[_0x3524a4(0x303)][_0x3524a4(0x1c5)](_0x3524a4(0x1ff)),new LogoutReporter({'alias':_0x18afc5[_0x3524a4(0x27e)]});}[a0_0x216d83(0x231)]([{json:_0x1d6376}]){return _0x1d6376;}}class PullReporter extends BaseReporter{[a0_0x216d83(0x1f2)];constructor({changes:_0x14a127}){const _0x35d540=a0_0x216d83;super({'success':!![]}),this[_0x35d540(0x1f2)]=_0x14a127;}['buildReport'](){const _0x5bb244=a0_0x216d83;return{'success':this[_0x5bb244(0x1ba)],'changes':this['changes']};}['print'](_0x511f53){const _0x31bff8=a0_0x216d83;console[_0x31bff8(0x2a8)]('Component\x20Updates:');const _0x3caf79=[[_0x31bff8(0x314),_0x31bff8(0x2b0),'Type',_0x31bff8(0x341)]];for(const {changeType:_0x1fbfda,name:_0x563cdf,type:_0x2cd3b0,paths:_0xf96c06}of _0x511f53[_0x31bff8(0x1f2)]){_0x3caf79[_0x31bff8(0x212)]([_0x1fbfda,_0x563cdf,_0x2cd3b0,_0xf96c06?.['join']('\x0a')||'']);}console[_0x31bff8(0x2a8)](table[_0x31bff8(0x242)](_0x3caf79,{'columns':[{},{'width':0x28},{'width':0x1e},{'width':0x28}]}));}}class PullCommand extends BaseCommand{[a0_0x216d83(0x1ee)]=a0_0x216d83(0x235);[a0_0x216d83(0x258)]='Pull\x20latest\x20branch\x20commit\x20from\x20devops.';[a0_0x216d83(0x1b8)]=[];[a0_0x216d83(0x1ed)]=[{'flags':a0_0x216d83(0x30e),'description':a0_0x216d83(0x2a7),'defaultValue':![]}];['projectPath']=process['cwd']();[a0_0x216d83(0x256)]=ProjectManager[a0_0x216d83(0x20c)]();[a0_0x216d83(0x275)]=[];[a0_0x216d83(0x1b3)];get[a0_0x216d83(0x253)](){const _0x47f153=a0_0x216d83;if(!this['_credentials'])throw new Error('Credentials\x20not\x20found');return this[_0x47f153(0x1b3)];}async[a0_0x216d83(0x31a)](){const _0x46a2b9=a0_0x216d83;this['logger']['info']('Pulling\x20latest\x20updates\x20started');const _0x59d7f6=await this[_0x46a2b9(0x256)]['isInitialized'](this[_0x46a2b9(0x2bf)]);if(!_0x59d7f6)return this[_0x46a2b9(0x303)][_0x46a2b9(0x2bd)](_0x46a2b9(0x328)),new FailReporter({'failMessage':_0x46a2b9(0x328)});const _0x1286d0=await this['getCredentialsAlias']();this[_0x46a2b9(0x1b3)]=await ApiService[_0x46a2b9(0x2cc)](_0x1286d0);const {id:_0x4777bd,headCommitId:_0x3cd6cf}=await this[_0x46a2b9(0x256)][_0x46a2b9(0x2ef)](this[_0x46a2b9(0x2bf)]);if(!_0x4777bd)return this[_0x46a2b9(0x303)][_0x46a2b9(0x2bd)](_0x46a2b9(0x2f1)),new FailReporter({'failMessage':_0x46a2b9(0x2f1)});const _0x15aa60=await ApiService['getBranchById']({'accessToken':this[_0x46a2b9(0x253)][_0x46a2b9(0x1db)],'devopsUrl':this[_0x46a2b9(0x253)][_0x46a2b9(0x1f0)],'branchId':_0x4777bd});if(_0x3cd6cf===_0x15aa60[_0x46a2b9(0x278)])return new PullReporter({'changes':this[_0x46a2b9(0x275)]});await this[_0x46a2b9(0x256)][_0x46a2b9(0x32b)](this[_0x46a2b9(0x2bf)]);try{this[_0x46a2b9(0x303)][_0x46a2b9(0x1c5)](_0x46a2b9(0x261));const _0x44edb8=await this[_0x46a2b9(0x265)]();if(_0x44edb8)return this[_0x46a2b9(0x303)][_0x46a2b9(0x2bd)](_0x46a2b9(0x248)),await this[_0x46a2b9(0x256)][_0x46a2b9(0x32a)](),new FailReporter({'failMessage':_0x46a2b9(0x248)});return this['logger']['info'](_0x46a2b9(0x277)),this[_0x46a2b9(0x303)][_0x46a2b9(0x1c5)](_0x46a2b9(0x234)),await this['retrieveDifference'](_0x15aa60),this[_0x46a2b9(0x303)][_0x46a2b9(0x1c5)](_0x46a2b9(0x335)),await this[_0x46a2b9(0x256)]['applyStage'](),this[_0x46a2b9(0x303)][_0x46a2b9(0x1c5)]('Pulling\x20latest\x20updates\x20completed'),new PullReporter({'changes':this[_0x46a2b9(0x275)]});}catch(_0x2069f3){await this[_0x46a2b9(0x256)]['abortStage']();throw _0x2069f3;}}[a0_0x216d83(0x231)]([{json:_0x4a76e0}]){return _0x4a76e0;}async[a0_0x216d83(0x1fa)](){const _0x26df41=a0_0x216d83,{credentialsAlias:_0x119059}=await this[_0x26df41(0x256)][_0x26df41(0x2fa)](this[_0x26df41(0x2bf)]);if(!_0x119059)throw new Error(_0x26df41(0x31e));if(typeof _0x119059!==_0x26df41(0x27f))throw new Error(_0x26df41(0x2ec));return _0x119059;}async[a0_0x216d83(0x265)](){const _0x42175c=a0_0x216d83,_0x267b77=await this[_0x42175c(0x256)][_0x42175c(0x279)]();return!!_0x267b77[_0x42175c(0x200)];}async[a0_0x216d83(0x208)](_0x4f2fad){const _0x3e3c55=a0_0x216d83,{devopsUrl:_0x8bbdb2,accessToken:_0x285ae7}=this[_0x3e3c55(0x253)],_0x136be1=await this['manager'][_0x3e3c55(0x1bd)]({'devopsUrl':_0x8bbdb2,'accessToken':_0x285ae7,'targetBranchId':_0x4f2fad['id'],'targetCommitId':_0x4f2fad[_0x3e3c55(0x278)]});for(const {id:_0x2f2c52,name:_0x3728c6,type:_0x17b79f,changeType:_0x5d9595}of _0x136be1){if(!_0x2f2c52){if(_0x5d9595!==ChangeType[_0x3e3c55(0x2f8)])throw new Error(_0x3e3c55(0x333));await this[_0x3e3c55(0x256)][_0x3e3c55(0x2b8)]({'name':_0x3728c6,'type':_0x17b79f,'changeType':_0x5d9595}),this['componentChanges'][_0x3e3c55(0x212)]({'changeType':_0x5d9595,'name':_0x3728c6,'type':_0x17b79f});continue;}const _0x37468d=await ApiService[_0x3e3c55(0x274)]({'devopsUrl':_0x8bbdb2,'accessToken':_0x285ae7,'componentId':_0x2f2c52});if(!_0x37468d[_0x3e3c55(0x257)])throw new Error(_0x3e3c55(0x2b9)+_0x37468d[_0x3e3c55(0x24f)]+'\x22\x20of\x20type\x20\x22'+_0x37468d[_0x3e3c55(0x30f)]+_0x3e3c55(0x2f2));await this[_0x3e3c55(0x256)]['saveComponent']({'name':_0x3728c6,'type':_0x17b79f,'changeType':_0x5d9595,'component':{..._0x37468d,'fHash':_0x37468d[_0x3e3c55(0x257)]}}),this[_0x3e3c55(0x275)][_0x3e3c55(0x212)]({'changeType':_0x5d9595,'name':_0x3728c6,'type':_0x17b79f,'paths':_0x37468d[_0x3e3c55(0x1c1)][_0x3e3c55(0x1d8)](_0x32d1eb=>_0x32d1eb['path'])});}await this[_0x3e3c55(0x256)]['saveBranchState'](_0x4f2fad);}}class RollbackReporter extends BaseReporter{[a0_0x216d83(0x2d9)];constructor({fileChanges:_0x2335b9}){const _0x4ae3b5=a0_0x216d83;super({'success':!![]}),this[_0x4ae3b5(0x2d9)]=_0x2335b9;}[a0_0x216d83(0x305)](){const _0x1c630d=a0_0x216d83;return{'success':this['success'],'fileChanges':this[_0x1c630d(0x2d9)]};}['print'](_0x3f5298){const _0x5f1de0=a0_0x216d83;console[_0x5f1de0(0x2a8)](_0x5f1de0(0x2b2));const _0x24524f=[[_0x5f1de0(0x314),_0x5f1de0(0x1e0)]];for(const {changeType:_0x207aee,path:_0x1909eb}of _0x3f5298[_0x5f1de0(0x2d9)]){_0x24524f[_0x5f1de0(0x212)]([_0x207aee,_0x1909eb]);}console[_0x5f1de0(0x2a8)](table[_0x5f1de0(0x242)](_0x24524f,{'columns':[{},{'width':0x28}]}));}}class RollbackCommand extends BaseCommand{[a0_0x216d83(0x1ee)]='rollback';[a0_0x216d83(0x258)]=a0_0x216d83(0x1c0);[a0_0x216d83(0x1b8)]=[];[a0_0x216d83(0x1ed)]=[{'flags':a0_0x216d83(0x30e),'description':'Applies\x20json\x20formatted\x20result.','defaultValue':![]}];[a0_0x216d83(0x2bf)]=process[a0_0x216d83(0x25f)]();[a0_0x216d83(0x256)]=ProjectManager['getInstance']();['rollbackTypes']=new Map();[a0_0x216d83(0x2de)]=[];[a0_0x216d83(0x2c5)]=[];[a0_0x216d83(0x1b3)];[a0_0x216d83(0x213)];[a0_0x216d83(0x20a)];get[a0_0x216d83(0x253)](){const _0x49dc3a=a0_0x216d83;if(!this[_0x49dc3a(0x1b3)])throw new Error(_0x49dc3a(0x323));return this[_0x49dc3a(0x1b3)];}get['branchId'](){const _0x15e277=a0_0x216d83;if(!this['_branchId'])throw new Error(_0x15e277(0x1f1));return this[_0x15e277(0x213)];}get['headCommitId'](){const _0x413e44=a0_0x216d83;if(!this[_0x413e44(0x20a)])throw new Error('Head\x20commit\x20id\x20not\x20found');return this[_0x413e44(0x20a)];}async[a0_0x216d83(0x31a)](){const _0x35e666=a0_0x216d83;this[_0x35e666(0x303)][_0x35e666(0x1c5)]('Rolling\x20back\x20to\x20last\x20committed\x20state\x20started');const _0x570a81=await this[_0x35e666(0x256)][_0x35e666(0x32f)](this[_0x35e666(0x2bf)]);if(!_0x570a81)return this[_0x35e666(0x303)][_0x35e666(0x2bd)](_0x35e666(0x328)),new FailReporter({'failMessage':'Project\x20is\x20not\x20initialized'});const _0x50fd49=await this['getCredentialsAlias']();this[_0x35e666(0x1b3)]=await ApiService[_0x35e666(0x2cc)](_0x50fd49),await this[_0x35e666(0x329)](),await this[_0x35e666(0x256)][_0x35e666(0x32b)](this[_0x35e666(0x2bf)]);try{this['logger'][_0x35e666(0x1c5)](_0x35e666(0x2dd)),await this[_0x35e666(0x2c3)]();if(!this[_0x35e666(0x290)]['size'])return this[_0x35e666(0x303)][_0x35e666(0x1c5)](_0x35e666(0x23e)),new RollbackReporter({'fileChanges':this[_0x35e666(0x2c5)]});return this['logger'][_0x35e666(0x1c5)]('Looking\x20for\x20changes\x20completed.\x20'+this['rollbackTypes'][_0x35e666(0x1f3)]+_0x35e666(0x1fd)),this[_0x35e666(0x303)]['info'](_0x35e666(0x325)),await this[_0x35e666(0x24e)](),this[_0x35e666(0x303)][_0x35e666(0x1c5)](_0x35e666(0x1eb)),await this[_0x35e666(0x256)][_0x35e666(0x1f7)](),this[_0x35e666(0x303)][_0x35e666(0x1c5)](_0x35e666(0x293)),new RollbackReporter({'fileChanges':this[_0x35e666(0x2c5)]});}catch(_0x1ec3e4){await this[_0x35e666(0x256)][_0x35e666(0x32a)]();throw _0x1ec3e4;}}[a0_0x216d83(0x231)]([{json:_0x4483d9}]){return _0x4483d9;}async[a0_0x216d83(0x1fa)](){const _0x108a9e=a0_0x216d83,{credentialsAlias:_0xae21f8}=await this[_0x108a9e(0x256)][_0x108a9e(0x2fa)](this[_0x108a9e(0x2bf)]);if(!_0xae21f8)throw new Error(_0x108a9e(0x31e));if(typeof _0xae21f8!==_0x108a9e(0x27f))throw new Error(_0x108a9e(0x2ec));return _0xae21f8;}async[a0_0x216d83(0x329)](){const _0x212cfe=a0_0x216d83,{id:_0x2a7b7e,headCommitId:_0x50c4a2}=await this[_0x212cfe(0x256)][_0x212cfe(0x2ef)](this[_0x212cfe(0x2bf)]);if(!_0x2a7b7e||!_0x50c4a2)throw new Error('A\x20branch\x20is\x20not\x20selected.\x20Use\x20\x22flosum\x20devops\x20checkout\x22\x20at\x20first');this[_0x212cfe(0x213)]=_0x2a7b7e||void 0x0,this[_0x212cfe(0x20a)]=_0x50c4a2||void 0x0;}async[a0_0x216d83(0x24e)](){const _0x4d6e20=a0_0x216d83;if(this['componentsForRetrieve']['length'])for await(const {files:_0x965fb}of ApiService[_0x4d6e20(0x2f9)]({'devopsUrl':this[_0x4d6e20(0x253)][_0x4d6e20(0x1f0)],'accessToken':this['credentials'][_0x4d6e20(0x1db)],'branchId':this[_0x4d6e20(0x343)],'commitId':this[_0x4d6e20(0x278)],'components':this[_0x4d6e20(0x2de)]})){await this[_0x4d6e20(0x226)](_0x965fb);}for(const [_0x17a8a7,_0x36d6a0]of this[_0x4d6e20(0x290)][_0x4d6e20(0x2aa)]()){if(_0x36d6a0!==ChangeType['DELETE'])throw new Error('File\x20\x22'+_0x17a8a7+_0x4d6e20(0x225));await this[_0x4d6e20(0x256)]['addFileChange']({'path':_0x17a8a7,'changeType':_0x36d6a0});}return{'success':!![]};}async[a0_0x216d83(0x2c3)](){const _0x273056=a0_0x216d83,_0x31bdfe=await this['manager'][_0x273056(0x279)]();for(const {name:_0x365f4f,type:_0x391e1b,changes:_0x1e45f8}of _0x31bdfe){let _0x15f607=![];for(const {path:_0x4df9cc,changeType:_0x41ae10}of _0x1e45f8){let _0x2a2b50;_0x41ae10===ChangeType[_0x273056(0x1bf)]?_0x2a2b50=ChangeType[_0x273056(0x2f8)]:(_0x2a2b50=_0x41ae10===ChangeType[_0x273056(0x2f8)]?ChangeType['CREATE']:ChangeType[_0x273056(0x28d)],_0x15f607=!![]),this[_0x273056(0x290)][_0x273056(0x23b)](_0x4df9cc,_0x2a2b50),this[_0x273056(0x2c5)][_0x273056(0x212)]({'changeType':_0x2a2b50,'path':_0x4df9cc});}_0x15f607&&this[_0x273056(0x2de)]['push']({'name':_0x365f4f,'type':_0x391e1b});}}async[a0_0x216d83(0x226)](_0x3c21fe){const _0x29ffe7=a0_0x216d83;for(const {path:_0x41d37b,content:_0x354f70}of _0x3c21fe){const _0x24515f=path['join'](COMPONENT_PROJECT_PATH,_0x41d37b),_0x1c9622=this[_0x29ffe7(0x290)][_0x29ffe7(0x2e5)](_0x24515f);if(!_0x1c9622)continue;await this[_0x29ffe7(0x256)][_0x29ffe7(0x30d)]({'path':_0x24515f,'content':_0x354f70,'changeType':_0x1c9622}),this[_0x29ffe7(0x290)][_0x29ffe7(0x1cf)](_0x24515f);}}}class StatusReporter extends BaseReporter{[a0_0x216d83(0x2ba)];constructor({pendingChanges:_0x5a7833}){super({'success':!![]}),this['pendingChanges']=_0x5a7833;}['buildReport'](){const _0x1b794e=a0_0x216d83;return{'success':this[_0x1b794e(0x1ba)],'pendingChanges':this[_0x1b794e(0x2ba)]};}[a0_0x216d83(0x31d)](_0x475bd9){const _0x5d603b=a0_0x216d83;console[_0x5d603b(0x2a8)](_0x5d603b(0x1c4));const _0x3d2a71=[[_0x5d603b(0x314),_0x5d603b(0x1e0)]];for(const {changeType:_0x40bba9,path:_0x47263e}of _0x475bd9[_0x5d603b(0x2ba)]){_0x3d2a71[_0x5d603b(0x212)]([_0x40bba9,_0x47263e]);}console[_0x5d603b(0x2a8)](table[_0x5d603b(0x242)](_0x3d2a71,{'columns':[{},{'width':0x28}]}));}}class StatusCommand extends BaseCommand{[a0_0x216d83(0x1ee)]=a0_0x216d83(0x321);[a0_0x216d83(0x258)]=a0_0x216d83(0x26f);[a0_0x216d83(0x1b8)]=[];[a0_0x216d83(0x1ed)]=[{'flags':a0_0x216d83(0x30e),'description':a0_0x216d83(0x2a7),'defaultValue':![]}];[a0_0x216d83(0x2bf)]=process[a0_0x216d83(0x25f)]();[a0_0x216d83(0x256)]=ProjectManager[a0_0x216d83(0x20c)]();[a0_0x216d83(0x2ba)]=[];async['execute'](){const _0x59aa21=a0_0x216d83;this['logger'][_0x59aa21(0x1c5)](_0x59aa21(0x247));const _0xd86cd4=await this['manager'][_0x59aa21(0x32f)](this['projectPath']);if(!_0xd86cd4)return this['logger'][_0x59aa21(0x2bd)](_0x59aa21(0x328)),new FailReporter({'failMessage':_0x59aa21(0x328)});await this[_0x59aa21(0x256)][_0x59aa21(0x32b)](this[_0x59aa21(0x2bf)]);const _0x311e7c=await this[_0x59aa21(0x256)][_0x59aa21(0x279)]();for(const {changes:_0x1cf4c5}of _0x311e7c){for(const {changeType:_0x3f3dfa,path:_0x11f468}of _0x1cf4c5){this[_0x59aa21(0x2ba)][_0x59aa21(0x212)]({'changeType':_0x3f3dfa,'path':_0x11f468});}}return await this['manager'][_0x59aa21(0x32a)](),this[_0x59aa21(0x303)][_0x59aa21(0x1c5)](_0x59aa21(0x1bb)),new StatusReporter({'pendingChanges':this[_0x59aa21(0x2ba)]});}['isJson']([{json:_0x1b4f8f}]){return _0x1b4f8f;}}configurePathEnv();const ROOT_COMMANDS=[LoginCommand,LogoutCommand,ListCredentialsCommand],DEVOPS_COMMANDS=[InitCommand,CloneCommand,CheckoutCommand,ConfigSetCommand,ConfigUnset,PullCommand,CommitCommand,RollbackCommand,StatusCommand,ListBranchesCommand],root=new commander['Command']()['name'](ROOT_NAME)['description']('CLI\x20for\x20work\x20with\x20'+ROOT_NAME+a0_0x216d83(0x25e))['version'](config[a0_0x216d83(0x2ea)]);for(const command of ROOT_COMMANDS){new command()[a0_0x216d83(0x28e)](root);}const devops=new commander[(a0_0x216d83(0x1c6))]()[a0_0x216d83(0x24f)](a0_0x216d83(0x33f))[a0_0x216d83(0x258)]('Devops\x20commands');for(const command of DEVOPS_COMMANDS){new command()[a0_0x216d83(0x28e)](devops);}root[a0_0x216d83(0x26e)](devops),root['parse']();function configurePathEnv(){const _0x56e6e4=a0_0x216d83,_0x4783c2=process['env'][_0x56e6e4(0x202)]?.['split'](node_path['delimiter']);if(!_0x4783c2)throw new Error(_0x56e6e4(0x2b7));const _0x530346=node_path['join'](node_path[_0x56e6e4(0x2d3)](__dirname),_0x56e6e4(0x322),_0x56e6e4(0x2ae));_0x4783c2[_0x56e6e4(0x212)](_0x530346),process[_0x56e6e4(0x233)][_0x56e6e4(0x202)]=_0x4783c2[_0x56e6e4(0x1e5)](node_path['delimiter']);}exports[a0_0x216d83(0x29f)]=DEVOPS_COMMANDS,exports[a0_0x216d83(0x1e7)]=ROOT_COMMANDS;
|