@lovrabet/rabetbase-cli 2.0.2-beta.7 → 2.0.2-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/lib/ai-setup/config.js +1 -1
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/fetch-model-list.js +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/auth/auth-server-ui.js +1 -1
  6. package/lib/auth/auth-server.js +1 -1
  7. package/lib/auth/constant.js +1 -1
  8. package/lib/auth/get-cookie.js +1 -1
  9. package/lib/auth/get-session-user.js +1 -1
  10. package/lib/auth/is-session-valid.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/doc.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/app.js +1 -1
  19. package/lib/commands/auth.js +1 -1
  20. package/lib/commands/bff/delete.js +1 -1
  21. package/lib/commands/bff/detail.js +1 -1
  22. package/lib/commands/bff/index.js +1 -1
  23. package/lib/commands/bff/list.js +1 -1
  24. package/lib/commands/bff/new.js +1 -1
  25. package/lib/commands/bff/pull.js +1 -1
  26. package/lib/commands/bff/push.js +1 -1
  27. package/lib/commands/bff/status.js +1 -1
  28. package/lib/commands/build.js +1 -1
  29. package/lib/commands/cli-update.js +1 -1
  30. package/lib/commands/codegen/index.js +1 -1
  31. package/lib/commands/codegen/sdk.js +1 -1
  32. package/lib/commands/codegen/sql.js +1 -1
  33. package/lib/commands/common/flags.js +1 -1
  34. package/lib/commands/config.js +1 -1
  35. package/lib/commands/create.js +1 -1
  36. package/lib/commands/dataset/detail.js +1 -1
  37. package/lib/commands/dataset/index.js +1 -1
  38. package/lib/commands/dataset/links.js +1 -1
  39. package/lib/commands/dataset/list.js +1 -1
  40. package/lib/commands/dataset/operations.js +1 -1
  41. package/lib/commands/doctor.js +1 -1
  42. package/lib/commands/init.js +1 -1
  43. package/lib/commands/logout.js +1 -1
  44. package/lib/commands/logs.js +1 -1
  45. package/lib/commands/mcp.js +1 -1
  46. package/lib/commands/menu/index.js +1 -1
  47. package/lib/commands/menu/shared/compare-table.js +1 -1
  48. package/lib/commands/menu/shared/index.js +1 -1
  49. package/lib/commands/menu/shared/inquirer.js +1 -1
  50. package/lib/commands/menu/shared/local-pages.js +1 -1
  51. package/lib/commands/menu/shared/logic.js +1 -1
  52. package/lib/commands/menu/shared/service.js +1 -1
  53. package/lib/commands/menu/shared/sync-core.js +1 -1
  54. package/lib/commands/menu/shared/update-core.js +1 -1
  55. package/lib/commands/menu/shared/valid-url.js +1 -1
  56. package/lib/commands/menu/sync.js +1 -1
  57. package/lib/commands/menu/update.js +1 -1
  58. package/lib/commands/preview.js +1 -1
  59. package/lib/commands/project-upgrade.js +1 -1
  60. package/lib/commands/registry.js +1 -1
  61. package/lib/commands/run.js +1 -1
  62. package/lib/commands/skill.js +1 -1
  63. package/lib/commands/sql/detail.js +1 -1
  64. package/lib/commands/sql/exec.js +1 -1
  65. package/lib/commands/sql/index.js +1 -1
  66. package/lib/commands/sql/list.js +1 -1
  67. package/lib/commands/sql/save.js +1 -1
  68. package/lib/commands/sql/validate.js +1 -1
  69. package/lib/commands/start.js +1 -1
  70. package/lib/config/config-help.js +1 -1
  71. package/lib/config/main.js +1 -1
  72. package/lib/constant/cli.js +1 -1
  73. package/lib/constant/domain.js +1 -1
  74. package/lib/constant/env.js +1 -1
  75. package/lib/context.js +1 -1
  76. package/lib/core/alias-resolver.js +1 -1
  77. package/lib/core/api-client.js +1 -1
  78. package/lib/core/bff/config.js +1 -1
  79. package/lib/core/bff/file-system.js +1 -1
  80. package/lib/core/bff/hash.js +1 -1
  81. package/lib/core/bff/lock.js +1 -1
  82. package/lib/core/bff/utils.js +1 -1
  83. package/lib/core/db-resolver.js +1 -1
  84. package/lib/core/sql-validator.js +1 -1
  85. package/lib/create-app/enhanced-guided-create.js +1 -1
  86. package/lib/create-app/format-elapsed.js +1 -1
  87. package/lib/create-app/main.js +1 -1
  88. package/lib/create-app/non-interactive.js +1 -1
  89. package/lib/create-app/task-finished.js +1 -1
  90. package/lib/create-app/task-loading.js +1 -1
  91. package/lib/create-app/task-running.js +1 -1
  92. package/lib/create-app/task-time.js +1 -1
  93. package/lib/create-app/use-copy-project-template.js +1 -1
  94. package/lib/create-app/use-format-code.js +1 -1
  95. package/lib/create-app/use-install-dependencies.js +1 -1
  96. package/lib/errors.js +1 -1
  97. package/lib/framework/flags.js +1 -1
  98. package/lib/framework/help.js +1 -1
  99. package/lib/framework/index.js +1 -1
  100. package/lib/framework/output.js +1 -1
  101. package/lib/framework/response.js +1 -1
  102. package/lib/framework/runner.js +1 -1
  103. package/lib/generated/build-info.js +1 -1
  104. package/lib/help.js +1 -1
  105. package/lib/init/main.js +1 -1
  106. package/lib/mcp/McpInstallUI.js +1 -1
  107. package/lib/mcp/claude.js +1 -1
  108. package/lib/mcp/cursor.js +1 -1
  109. package/lib/mcp/main.js +1 -1
  110. package/lib/mcp/mcp-install-non-interactive.js +1 -1
  111. package/lib/mcp/mcp-installer.js +1 -1
  112. package/lib/skills/main.js +1 -1
  113. package/lib/skills/npx-skills-add.js +1 -1
  114. package/lib/telemetry/cli-help-trace.js +1 -1
  115. package/lib/telemetry/otel-logger-version.js +1 -1
  116. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  117. package/lib/ui/IDESelector.js +1 -1
  118. package/lib/ui/useIDESelection.js +1 -1
  119. package/lib/utils/ai_config.js +1 -1
  120. package/lib/utils/cdn-config.js +1 -1
  121. package/lib/utils/check-sdk-version.js +1 -1
  122. package/lib/utils/cli-version-check.js +1 -1
  123. package/lib/utils/config.js +1 -1
  124. package/lib/utils/copy-directory.js +1 -1
  125. package/lib/utils/file-utils.js +1 -1
  126. package/lib/utils/guides-cdn.js +1 -1
  127. package/lib/utils/http-client.js +1 -1
  128. package/lib/utils/logger.js +1 -1
  129. package/lib/utils/rules-cdn.js +1 -1
  130. package/lib/utils/sleep.js +1 -1
  131. package/lib/utils/template-replacer.js +1 -1
  132. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x42fe81,_0xa5bfa3){const _0x5c1789=a50_0x2269,_0x10d3a6=_0x42fe81();while(!![]){try{const _0x37a93c=parseInt(_0x5c1789(0x8f))/0x1*(-parseInt(_0x5c1789(0x82))/0x2)+-parseInt(_0x5c1789(0x80))/0x3+-parseInt(_0x5c1789(0x8a))/0x4+parseInt(_0x5c1789(0x8c))/0x5+parseInt(_0x5c1789(0x7b))/0x6*(-parseInt(_0x5c1789(0x7a))/0x7)+parseInt(_0x5c1789(0x83))/0x8+parseInt(_0x5c1789(0x7f))/0x9;if(_0x37a93c===_0xa5bfa3)break;else _0x10d3a6['push'](_0x10d3a6['shift']());}catch(_0x4be841){_0x10d3a6['push'](_0x10d3a6['shift']());}}}(a50_0x350a,0xba1f3));import{getLocalPages}from'./local-pages.js';import{getOnlineMenuList,createMenus,updateMenuCdnUrl}from'./service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';function a50_0x350a(){const _0x2b3a46=['filter','trim','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','2864492TWutcn','label','4401375JQruCu','map','path','268921uDctps','join','errors','resources','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','find','139972Hvcpda','276XbnoMt','length','has','CSS\x20URL\x20is\x20unreachable','14758380cndbvn','648195DRrvdP','rejected','10vUWxNZ','11510952bXGyIG','JS\x20URL\x20is\x20unreachable','push','No\x20local\x20pages\x20matched\x20labels:\x20'];a50_0x350a=function(){return _0x2b3a46;};return a50_0x350a();}export function validateJsUrl(_0x23679d){const _0x4f3f0a=a50_0x2269,_0x1250fe=[];return!isValidJsHttpsUrl(_0x23679d)&&_0x1250fe[_0x4f3f0a(0x85)](_0x4f3f0a(0x93)),{'ok':_0x1250fe[_0x4f3f0a(0x7c)]===0x0,'errors':_0x1250fe};}export function validateCssUrl(_0x5d8d41){const _0x1e2475=a50_0x2269,_0x3e1603=[];return!isValidCssHttpsUrl(_0x5d8d41)&&_0x3e1603['push'](_0x1e2475(0x89)),{'ok':_0x3e1603[_0x1e2475(0x7c)]===0x0,'errors':_0x3e1603};}export async function validateJsUrlReachable(_0x20059f){const _0x1cc422=a50_0x2269,_0x1d9852=validateJsUrl(_0x20059f);if(!_0x1d9852['ok'])return _0x1d9852;const _0x434988=await isUrlReachable(_0x20059f);if(!_0x434988)_0x1d9852['errors']['push'](_0x1cc422(0x84));return{'ok':_0x1d9852[_0x1cc422(0x91)][_0x1cc422(0x7c)]===0x0,'errors':_0x1d9852[_0x1cc422(0x91)]};}export async function validateCssUrlReachable(_0x154f7d){const _0x7f82dd=a50_0x2269,_0x3e574f=validateCssUrl(_0x154f7d);if(!_0x3e574f['ok'])return _0x3e574f;const _0xa33741=await isUrlReachable(_0x154f7d);if(!_0xa33741)_0x3e574f[_0x7f82dd(0x91)][_0x7f82dd(0x85)](_0x7f82dd(0x7e));return{'ok':_0x3e574f['errors']['length']===0x0,'errors':_0x3e574f[_0x7f82dd(0x91)]};}function a50_0x2269(_0x2bff43,_0x27de23){_0x2bff43=_0x2bff43-0x79;const _0x350ad9=a50_0x350a();let _0x2269ca=_0x350ad9[_0x2bff43];return _0x2269ca;}export function buildCompareRows(_0x3df5b6,_0xc68e94){const _0x41b26a=a50_0x2269;return _0x3df5b6['map'](_0x9b789b=>({'label':_0x9b789b[_0x41b26a(0x8b)],'path':_0x9b789b['path'],'local':!![],'online':_0xc68e94[_0x41b26a(0x7d)](_0x9b789b[_0x41b26a(0x8e)])}));}export function filterNewPages(_0x5e7dfd,_0x3ed3a1,_0xd53e89){const _0x4544f9=a50_0x2269;if(_0xd53e89&&_0xd53e89['length']>0x0){const _0x1fc94b=new Set(_0xd53e89[_0x4544f9(0x8d)](_0x144738=>_0x144738[_0x4544f9(0x88)]())),_0x133bab=_0x5e7dfd[_0x4544f9(0x87)](_0x235a57=>_0x1fc94b[_0x4544f9(0x7d)](_0x235a57[_0x4544f9(0x8b)]));if(_0x133bab[_0x4544f9(0x7c)]===0x0)throw new Error(_0x4544f9(0x86)+[..._0x1fc94b][_0x4544f9(0x90)](',\x20'));return _0x133bab;}return _0x5e7dfd[_0x4544f9(0x87)](_0x5de712=>!_0x3ed3a1[_0x4544f9(0x7d)](_0x5de712[_0x4544f9(0x8e)]));}export function filterPagesByLabels(_0x58de7f,_0x55e104){const _0x7fb80a=a50_0x2269,_0x3edbfb=[],_0x234e50=[];for(const _0x29fbb8 of _0x55e104){const _0x669e2d=_0x29fbb8['trim'](),_0x3cc5d6=_0x58de7f[_0x7fb80a(0x79)](_0x18ee99=>_0x18ee99[_0x7fb80a(0x8b)]===_0x669e2d);if(_0x3cc5d6)_0x3edbfb[_0x7fb80a(0x85)](_0x3cc5d6);else _0x234e50[_0x7fb80a(0x85)](_0x29fbb8);}return{'matched':_0x3edbfb,'unmatched':_0x234e50};}export async function doCreateMenus(_0x52046f,_0x523a1c,_0x3b617d,_0x2a6aec){const _0x10adf4=a50_0x2269;return await createMenus(_0x52046f,_0x523a1c,_0x3b617d,_0x2a6aec),{'created':_0x3b617d[_0x10adf4(0x7c)],'failed':0x0,'labels':_0x3b617d[_0x10adf4(0x8d)](_0x311d75=>_0x311d75['label'])};}export function filterMenusWithResources(_0x27393e){const _0x2cc834=a50_0x2269;return _0x27393e[_0x2cc834(0x87)](_0x31e072=>_0x31e072[_0x2cc834(0x92)][_0x2cc834(0x7c)]>0x0);}export async function doUpdateCdnUrls(_0x6f6b04,_0x264f59,_0x25e942,_0x358698){const _0xd1011b=a50_0x2269,_0x54a17d=_0x25e942['filter'](_0x30d5dc=>_0x30d5dc[_0xd1011b(0x92)][_0xd1011b(0x7c)]>0x0),_0x10bf84=await Promise['allSettled'](_0x54a17d['map'](_0x54ac59=>updateMenuCdnUrl(_0x6f6b04,_0x264f59,{'id':_0x54ac59['id'],'label':_0x54ac59[_0xd1011b(0x8b)],'path':_0x54ac59[_0xd1011b(0x8e)],'resources':_0x358698}))),_0x362770=_0x10bf84[_0xd1011b(0x87)](_0x442ff6=>_0x442ff6['status']===_0xd1011b(0x81))[_0xd1011b(0x7c)];return{'updated':_0x54a17d[_0xd1011b(0x7c)]-_0x362770,'failed':_0x362770};}export async function fetchMenuData(_0x4a2559,_0x5edfb8){const _0x54ad7d=a50_0x2269,_0x382566=getLocalPages(),_0xfca13=await getOnlineMenuList(_0x4a2559,_0x5edfb8),_0x45df81=new Set(_0xfca13['map'](_0x5d352=>_0x5d352[_0x54ad7d(0x8e)]));return{'localPages':_0x382566,'onlineMenuList':_0xfca13,'onlinePaths':_0x45df81};}export async function fetchOnlineMenuList(_0x3590fc,_0x3432a3){return getOnlineMenuList(_0x3590fc,_0x3432a3);}
1
+ (function(_0x32b702,_0x2a0742){const _0x39d67b=a50_0x4cb1,_0x283abd=_0x32b702();while(!![]){try{const _0x5713d5=parseInt(_0x39d67b(0x17b))/0x1*(-parseInt(_0x39d67b(0x169))/0x2)+-parseInt(_0x39d67b(0x178))/0x3*(parseInt(_0x39d67b(0x165))/0x4)+parseInt(_0x39d67b(0x16c))/0x5+parseInt(_0x39d67b(0x174))/0x6*(parseInt(_0x39d67b(0x17f))/0x7)+parseInt(_0x39d67b(0x170))/0x8*(parseInt(_0x39d67b(0x176))/0x9)+parseInt(_0x39d67b(0x172))/0xa*(parseInt(_0x39d67b(0x17a))/0xb)+-parseInt(_0x39d67b(0x166))/0xc*(parseInt(_0x39d67b(0x16b))/0xd);if(_0x5713d5===_0x2a0742)break;else _0x283abd['push'](_0x283abd['shift']());}catch(_0x54a346){_0x283abd['push'](_0x283abd['shift']());}}}(a50_0x497d,0x91175));import{getLocalPages}from'./local-pages.js';import{getOnlineMenuList,createMenus,updateMenuCdnUrl}from'./service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';export function validateJsUrl(_0x36aeec){const _0x183e27=a50_0x4cb1,_0xead30b=[];return!isValidJsHttpsUrl(_0x36aeec)&&_0xead30b['push'](_0x183e27(0x171)),{'ok':_0xead30b[_0x183e27(0x17d)]===0x0,'errors':_0xead30b};}export function validateCssUrl(_0x735605){const _0x2d105e=a50_0x4cb1,_0x54924a=[];return!isValidCssHttpsUrl(_0x735605)&&_0x54924a[_0x2d105e(0x180)](_0x2d105e(0x16d)),{'ok':_0x54924a['length']===0x0,'errors':_0x54924a};}export async function validateJsUrlReachable(_0x52c2d8){const _0x183106=a50_0x4cb1,_0x39f383=validateJsUrl(_0x52c2d8);if(!_0x39f383['ok'])return _0x39f383;const _0x4509ac=await isUrlReachable(_0x52c2d8);if(!_0x4509ac)_0x39f383['errors']['push']('JS\x20URL\x20is\x20unreachable');return{'ok':_0x39f383['errors'][_0x183106(0x17d)]===0x0,'errors':_0x39f383['errors']};}export async function validateCssUrlReachable(_0x3c1cd5){const _0x3e7864=a50_0x4cb1,_0x3fef80=validateCssUrl(_0x3c1cd5);if(!_0x3fef80['ok'])return _0x3fef80;const _0x53e93b=await isUrlReachable(_0x3c1cd5);if(!_0x53e93b)_0x3fef80[_0x3e7864(0x181)][_0x3e7864(0x180)]('CSS\x20URL\x20is\x20unreachable');return{'ok':_0x3fef80[_0x3e7864(0x181)][_0x3e7864(0x17d)]===0x0,'errors':_0x3fef80[_0x3e7864(0x181)]};}export function buildCompareRows(_0x3316eb,_0x11c275){const _0xbd79ac=a50_0x4cb1;return _0x3316eb[_0xbd79ac(0x175)](_0xec715f=>({'label':_0xec715f[_0xbd79ac(0x17c)],'path':_0xec715f[_0xbd79ac(0x177)],'local':!![],'online':_0x11c275[_0xbd79ac(0x16f)](_0xec715f[_0xbd79ac(0x177)])}));}function a50_0x497d(){const _0x19d6c5=['resources','1934IdDVgE','No\x20local\x20pages\x20matched\x20labels:\x20','1299649miTXCx','4944840btVFTv','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','filter','has','163544voLOdy','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','2224560gCmpFD','allSettled','162FdIYek','map','189rGhASp','path','7071ASSRwj','find','44TtPwgj','1019oZUgzh','label','length','status','279475DfXGRV','push','errors','trim','860RUelxP','156SxSiId','rejected'];a50_0x497d=function(){return _0x19d6c5;};return a50_0x497d();}export function filterNewPages(_0x510bed,_0x605b63,_0x56b1a1){const _0xd10431=a50_0x4cb1;if(_0x56b1a1&&_0x56b1a1['length']>0x0){const _0x40eac5=new Set(_0x56b1a1[_0xd10431(0x175)](_0x160108=>_0x160108[_0xd10431(0x182)]())),_0x5eb965=_0x510bed[_0xd10431(0x16e)](_0x436765=>_0x40eac5['has'](_0x436765[_0xd10431(0x17c)]));if(_0x5eb965[_0xd10431(0x17d)]===0x0)throw new Error(_0xd10431(0x16a)+[..._0x40eac5]['join'](',\x20'));return _0x5eb965;}return _0x510bed[_0xd10431(0x16e)](_0xe3b680=>!_0x605b63[_0xd10431(0x16f)](_0xe3b680[_0xd10431(0x177)]));}export function filterPagesByLabels(_0x504975,_0x24add1){const _0x5ffeff=a50_0x4cb1,_0x57c3e5=[],_0x16069f=[];for(const _0x3bf9ce of _0x24add1){const _0x1f8375=_0x3bf9ce['trim'](),_0x50c15b=_0x504975[_0x5ffeff(0x179)](_0x1058a2=>_0x1058a2[_0x5ffeff(0x17c)]===_0x1f8375);if(_0x50c15b)_0x57c3e5['push'](_0x50c15b);else _0x16069f[_0x5ffeff(0x180)](_0x3bf9ce);}return{'matched':_0x57c3e5,'unmatched':_0x16069f};}function a50_0x4cb1(_0x2ce52a,_0x5c0ecc){_0x2ce52a=_0x2ce52a-0x165;const _0x497d1e=a50_0x497d();let _0x4cb1fd=_0x497d1e[_0x2ce52a];return _0x4cb1fd;}export async function doCreateMenus(_0x57700f,_0x438973,_0x498ec0,_0x59435d){const _0x3293de=a50_0x4cb1;return await createMenus(_0x57700f,_0x438973,_0x498ec0,_0x59435d),{'created':_0x498ec0[_0x3293de(0x17d)],'failed':0x0,'labels':_0x498ec0[_0x3293de(0x175)](_0x5b4663=>_0x5b4663[_0x3293de(0x17c)])};}export function filterMenusWithResources(_0x53b84b){const _0x3679c1=a50_0x4cb1;return _0x53b84b[_0x3679c1(0x16e)](_0x2a8b82=>_0x2a8b82['resources'][_0x3679c1(0x17d)]>0x0);}export async function doUpdateCdnUrls(_0x114d4b,_0x4afbce,_0x1446b3,_0x3f172c){const _0x5280ae=a50_0x4cb1,_0x1c68cd=_0x1446b3[_0x5280ae(0x16e)](_0x53b211=>_0x53b211[_0x5280ae(0x168)]['length']>0x0),_0x49008d=await Promise[_0x5280ae(0x173)](_0x1c68cd[_0x5280ae(0x175)](_0x25ca84=>updateMenuCdnUrl(_0x114d4b,_0x4afbce,{'id':_0x25ca84['id'],'label':_0x25ca84[_0x5280ae(0x17c)],'path':_0x25ca84[_0x5280ae(0x177)],'resources':_0x3f172c}))),_0x46dc28=_0x49008d['filter'](_0x55c847=>_0x55c847[_0x5280ae(0x17e)]===_0x5280ae(0x167))['length'];return{'updated':_0x1c68cd[_0x5280ae(0x17d)]-_0x46dc28,'failed':_0x46dc28};}export async function fetchMenuData(_0x5a533f,_0x1c0278){const _0x449286=a50_0x4cb1,_0x44d4ab=getLocalPages(),_0x42de52=await getOnlineMenuList(_0x5a533f,_0x1c0278),_0x222c23=new Set(_0x42de52[_0x449286(0x175)](_0x1c32f3=>_0x1c32f3[_0x449286(0x177)]));return{'localPages':_0x44d4ab,'onlineMenuList':_0x42de52,'onlinePaths':_0x222c23};}export async function fetchOnlineMenuList(_0x581c74,_0x43eace){return getOnlineMenuList(_0x581c74,_0x43eace);}
@@ -1 +1 @@
1
- (function(_0x247687,_0x393927){const _0x2b8e31=a51_0x2b85,_0x2d11f7=_0x247687();while(!![]){try{const _0x2ea45c=parseInt(_0x2b8e31(0x1dd))/0x1*(-parseInt(_0x2b8e31(0x1e0))/0x2)+-parseInt(_0x2b8e31(0x1c7))/0x3*(-parseInt(_0x2b8e31(0x1df))/0x4)+-parseInt(_0x2b8e31(0x1f6))/0x5*(parseInt(_0x2b8e31(0x1cb))/0x6)+-parseInt(_0x2b8e31(0x1fd))/0x7+parseInt(_0x2b8e31(0x1f8))/0x8*(-parseInt(_0x2b8e31(0x1e4))/0x9)+-parseInt(_0x2b8e31(0x1c9))/0xa*(parseInt(_0x2b8e31(0x1f9))/0xb)+-parseInt(_0x2b8e31(0x1e1))/0xc*(-parseInt(_0x2b8e31(0x203))/0xd);if(_0x2ea45c===_0x393927)break;else _0x2d11f7['push'](_0x2d11f7['shift']());}catch(_0xfd9cc4){_0x2d11f7['push'](_0x2d11f7['shift']());}}}(a51_0x1f15,0xe0380));import{getApiDomain}from'../../../constant/domain.js';import{getEnv}from'../../../constant/env.js';import{logger}from'../../../utils/logger.js';export async function getOnlineMenuList(_0x458919,_0x3d26e7){const _0x5922c5=a51_0x2b85,_0x52ba39=getEnv();logger[_0x5922c5(0x1f3)](_0x5922c5(0x1ed),_0x52ba39==='online'?_0x5922c5(0x1cf)+_0x458919+')':_0x5922c5(0x1e3)+_0x458919+')');const _0x46e380=await fetch(getApiDomain()+_0x5922c5(0x1ea)+_0x458919,{'method':_0x5922c5(0x1d0),'headers':{'Content-Type':'application/json','Cookie':_0x3d26e7}});if(!_0x46e380['ok']){if(_0x46e380[_0x5922c5(0x1ee)]===0x191){const _0x2a1f66=_0x5922c5(0x1d9);logger['error']('get-online-menu-list',_0x2a1f66,{'status':_0x46e380[_0x5922c5(0x1ee)]});throw new Error(_0x2a1f66);}const _0x89e2be='Failed\x20to\x20fetch\x20menu\x20list,\x20HTTP\x20status:\x20'+_0x46e380['status'];logger[_0x5922c5(0x1cd)](_0x5922c5(0x1ed),_0x89e2be);throw new Error(_0x89e2be);}const _0x26b518=await _0x46e380['json']();if(!_0x26b518[_0x5922c5(0x1d2)]){const _0x496875=_0x5922c5(0x1e8)+(_0x26b518[_0x5922c5(0x1f0)]||_0x5922c5(0x1c6));logger[_0x5922c5(0x1cd)](_0x5922c5(0x1ed),_0x496875,{'errorCode':_0x26b518[_0x5922c5(0x1d1)],'errorMsg':_0x26b518['errorMsg']});throw new Error(_0x496875);}if(!_0x26b518[_0x5922c5(0x1d8)])return logger[_0x5922c5(0x1f3)]('get-online-menu-list',_0x5922c5(0x1ec)),[];return logger[_0x5922c5(0x1f3)](_0x5922c5(0x1ed),_0x5922c5(0x204)+_0x26b518['data'][_0x5922c5(0x200)]+_0x5922c5(0x1fc)),_0x26b518[_0x5922c5(0x1d8)]['map'](flattenMenuItem)[_0x5922c5(0x1cc)]();}function a51_0x2b85(_0x31b841,_0x43b9a1){_0x31b841=_0x31b841-0x1c5;const _0x1f1590=a51_0x1f15();let _0x2b85e5=_0x1f1590[_0x31b841];return _0x2b85e5;}function flattenMenuItem(_0x28247d){const _0x45211d=a51_0x2b85;let _0x837477=[];try{if(_0x28247d['extend']?.[_0x45211d(0x1d7)]){const _0x5bbb79=JSON[_0x45211d(0x1dc)](_0x28247d[_0x45211d(0x1e7)][_0x45211d(0x1d7)]);Array[_0x45211d(0x1e9)](_0x5bbb79)&&(_0x837477=_0x5bbb79);}}catch(_0x59cf79){}const _0x2a5e10=[{'id':_0x28247d['id'],'path':_0x28247d[_0x45211d(0x1de)],'label':_0x28247d[_0x45211d(0x1d6)],'resources':_0x837477}];if(_0x28247d[_0x45211d(0x1d5)]&&_0x28247d[_0x45211d(0x1d5)][_0x45211d(0x200)]>0x0)for(const _0x2ef591 of _0x28247d[_0x45211d(0x1d5)]){_0x2a5e10[_0x45211d(0x1d3)](...flattenMenuItem(_0x2ef591));}return _0x2a5e10;}export async function createMenu(_0x2e4828,_0x97541,_0x1f4249){const _0x441cd1=a51_0x2b85;logger[_0x441cd1(0x1f3)](_0x441cd1(0x1e2),_0x441cd1(0x1e6)+_0x1f4249[_0x441cd1(0x1d6)]+'\x20('+_0x1f4249['path']+')');const _0x18cc37={'appCode':_0x2e4828,'type':_0x441cd1(0x1ef),'sort':0x0,'extend':{'loadScriptMode':_0x441cd1(0x1e5),'resources':_0x1f4249[_0x441cd1(0x1d7)]?JSON[_0x441cd1(0x202)](_0x1f4249[_0x441cd1(0x1d7)]):undefined},..._0x1f4249},_0x55e9e1=await fetch(getApiDomain()+_0x441cd1(0x1fe),{'method':_0x441cd1(0x1f7),'body':JSON[_0x441cd1(0x202)](_0x18cc37),'headers':{'Content-Type':_0x441cd1(0x1ce),'Cookie':_0x97541}});if(!_0x55e9e1['ok']){if(_0x55e9e1[_0x441cd1(0x1ee)]===0x191){const _0x4f7633=_0x441cd1(0x1d9);logger[_0x441cd1(0x1cd)](_0x441cd1(0x1e2),_0x4f7633,{'status':_0x55e9e1['status'],'menu':_0x1f4249[_0x441cd1(0x1d6)]});throw new Error(_0x4f7633);}const _0xc2bcfe=_0x441cd1(0x1ff)+_0x55e9e1[_0x441cd1(0x1ee)];logger[_0x441cd1(0x1cd)](_0x441cd1(0x1e2),_0xc2bcfe,{'menu':_0x1f4249[_0x441cd1(0x1d6)]});throw new Error(_0xc2bcfe);}const _0x340eee=await _0x55e9e1[_0x441cd1(0x1db)]();if(!_0x340eee[_0x441cd1(0x1d2)]){const _0x45e63f=_0x441cd1(0x1eb)+(_0x340eee[_0x441cd1(0x1f0)]||_0x441cd1(0x1c6));logger['error'](_0x441cd1(0x1e2),_0x45e63f,{'errorCode':_0x340eee[_0x441cd1(0x1d1)],'errorMsg':_0x340eee[_0x441cd1(0x1f0)],'menu':_0x1f4249[_0x441cd1(0x1d6)]});throw new Error(_0x45e63f);}logger[_0x441cd1(0x1f3)](_0x441cd1(0x1e2),_0x441cd1(0x1c5)+_0x1f4249[_0x441cd1(0x1d6)],_0x340eee[_0x441cd1(0x1d8)]);}async function createSingleMenu(_0x2e611,_0x32b37a,_0x2c3e13,_0xbb392d){const _0x29eab1=a51_0x2b85,_0x472df1={'appCode':_0x2e611,'type':_0x29eab1(0x1ef),'sort':0x0,'extend':{'loadScriptMode':_0x29eab1(0x1e5),'resources':_0xbb392d?JSON[_0x29eab1(0x202)](_0xbb392d):undefined},'label':_0x2c3e13[_0x29eab1(0x1d6)],'path':_0x2c3e13[_0x29eab1(0x1de)]},_0x49e375=await fetch(getApiDomain()+_0x29eab1(0x1fe),{'method':'POST','body':JSON[_0x29eab1(0x202)](_0x472df1),'headers':{'Content-Type':_0x29eab1(0x1ce),'Cookie':_0x32b37a}});if(!_0x49e375['ok']){if(_0x49e375[_0x29eab1(0x1ee)]===0x191){const _0x49f3ff=_0x29eab1(0x1d9);logger['error'](_0x29eab1(0x1e2),_0x49f3ff,{'status':_0x49e375['status'],'menu':_0x2c3e13[_0x29eab1(0x1d6)]});throw new Error(_0x49f3ff);}const _0x331dcb=_0x29eab1(0x1ff)+_0x49e375[_0x29eab1(0x1ee)];logger[_0x29eab1(0x1cd)]('create-menu',_0x331dcb,{'menu':_0x2c3e13[_0x29eab1(0x1d6)]});throw new Error(_0x331dcb);}const _0x197f54=await _0x49e375['json']();if(!_0x197f54[_0x29eab1(0x1d2)]){if(_0x197f54[_0x29eab1(0x1d1)]===_0x29eab1(0x1fa)||_0x197f54['errorMsg']?.['includes']('登录')){const _0x4c7252=_0x29eab1(0x1ca);logger[_0x29eab1(0x1cd)](_0x29eab1(0x1e2),_0x4c7252,{'errorCode':_0x197f54[_0x29eab1(0x1d1)],'errorMsg':_0x197f54[_0x29eab1(0x1f0)],'menu':_0x2c3e13[_0x29eab1(0x1d6)]});throw new Error(_0x4c7252);}const _0x544ffa=_0x29eab1(0x1eb)+(_0x197f54[_0x29eab1(0x1f0)]||_0x29eab1(0x1c6));logger['error'](_0x29eab1(0x1e2),_0x544ffa,{'errorCode':_0x197f54[_0x29eab1(0x1d1)],'errorMsg':_0x197f54[_0x29eab1(0x1f0)],'menu':_0x2c3e13['label']});throw new Error(_0x544ffa);}logger[_0x29eab1(0x1f3)](_0x29eab1(0x1e2),'Menu\x20created\x20successfully:\x20'+_0x2c3e13[_0x29eab1(0x1d6)]);}function a51_0x1f15(){const _0x2c4e9d=['Failed\x20to\x20create\x20menu,\x20HTTP\x20status:\x20','length','/smartapi/menu/update','stringify','71594861CrxssU','Fetched\x20','Menu\x20created\x20successfully:\x20','Error','39CPQMjI','create-menus','50710QdjpMW','Auth\x20validation\x20failed.\x20Please\x20use\x20rabetbase\x20auth\x20to\x20login\x20again','3138vjdKtt','flat','error','application/json','Fetching\x20online\x20menu\x20list...\x20(appCode:\x20','GET','errorCode','success','push','map','children','label','resources','data','Authentication\x20failed,\x20session\x20expired.\x20Please\x20use\x20rabetbase\x20auth\x20to\x20login\x20again','Failed\x20to\x20update\x20menu\x20assets:\x20','json','parse','1367OKSBUl','path','302228ZTclnH','2452FwgYgV','12qyHQeu','create-menu','Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20','5481954LplpfR','import','Creating\x20menu:\x20','extend','Failed\x20to\x20fetch\x20menu\x20list:\x20','isArray','/smartapi/menu/find?appCode=','Failed\x20to\x20create\x20menu:\x20','Server\x20returned\x20empty\x20menu\x20list','get-online-menu-list','status','procode','errorMsg','update-menu-cdn-url','Menu\x20assets\x20synced:\x20','info','all','Batch\x20menu\x20creation\x20completed,\x20total\x20','12115qTwODO','POST','24DOoLEj','649BgTstc','0011','Updating\x20menu\x20asset\x20links:\x20','\x20online\x20menus\x20successfully','3510220NNbCQK','/smartapi/menu/create'];a51_0x1f15=function(){return _0x2c4e9d;};return a51_0x1f15();}export async function createMenus(_0x1b0ed9,_0x3f46bb,_0x2e66b5,_0x460fce){const _0x34f0db=a51_0x2b85;logger[_0x34f0db(0x1f3)](_0x34f0db(0x1c8),'Start\x20batch\x20menu\x20creation,\x20total\x20'+_0x2e66b5['length']),await Promise[_0x34f0db(0x1f4)](_0x2e66b5[_0x34f0db(0x1d4)](async _0x3d8c4e=>{await createSingleMenu(_0x1b0ed9,_0x3f46bb,_0x3d8c4e,_0x460fce);})),logger[_0x34f0db(0x1f3)]('create-menus',_0x34f0db(0x1f5)+_0x2e66b5['length']);}export async function updateMenuCdnUrl(_0x12a167,_0x4857cc,_0x52dbd7){const _0x2fabf8=a51_0x2b85;logger[_0x2fabf8(0x1f3)](_0x2fabf8(0x1f1),_0x2fabf8(0x1fb)+_0x52dbd7['label']+'\x20('+_0x52dbd7[_0x2fabf8(0x1de)]+')');const _0xf25f65={'id':_0x52dbd7['id'],'appCode':_0x12a167,'extend':{'loadScriptMode':_0x2fabf8(0x1e5),'resources':_0x52dbd7[_0x2fabf8(0x1d7)]?JSON[_0x2fabf8(0x202)](_0x52dbd7[_0x2fabf8(0x1d7)]):undefined}},_0x36ef5b=await fetch(getApiDomain()+_0x2fabf8(0x201),{'method':_0x2fabf8(0x1f7),'body':JSON['stringify'](_0xf25f65),'headers':{'Content-Type':_0x2fabf8(0x1ce),'Cookie':_0x4857cc}});if(!_0x36ef5b['ok']){if(_0x36ef5b[_0x2fabf8(0x1ee)]===0x191){const _0x332241=_0x2fabf8(0x1d9);logger['error'](_0x2fabf8(0x1f1),_0x332241,{'status':_0x36ef5b['status'],'menu':_0x52dbd7[_0x2fabf8(0x1d6)]});throw new Error(_0x332241);}const _0x32c14f=_0x2fabf8(0x1da)+_0x36ef5b[_0x2fabf8(0x1ee)];logger['error'](_0x2fabf8(0x1f1),_0x32c14f,{'menu':_0x52dbd7[_0x2fabf8(0x1d6)]});throw new Error(_0x32c14f);}const _0x3c085d=await _0x36ef5b['json']();if(!_0x3c085d[_0x2fabf8(0x1d2)]){const _0xdcadcd=_0x2fabf8(0x1da)+(_0x3c085d[_0x2fabf8(0x1f0)]||'Error');logger[_0x2fabf8(0x1cd)](_0x2fabf8(0x1f1),_0xdcadcd,{'errorCode':_0x3c085d['errorCode'],'errorMsg':_0x3c085d[_0x2fabf8(0x1f0)],'menu':_0x52dbd7[_0x2fabf8(0x1d6)]});throw new Error(_0xdcadcd);}logger[_0x2fabf8(0x1f3)](_0x2fabf8(0x1f1),_0x2fabf8(0x1f2)+_0x52dbd7['label'],_0x3c085d['data']);}
1
+ (function(_0xbfd956,_0x10a42e){const _0x4eec72=a51_0x632c,_0x459203=_0xbfd956();while(!![]){try{const _0x1acd4d=parseInt(_0x4eec72(0x20a))/0x1*(-parseInt(_0x4eec72(0x209))/0x2)+-parseInt(_0x4eec72(0x210))/0x3*(-parseInt(_0x4eec72(0x1f6))/0x4)+-parseInt(_0x4eec72(0x20b))/0x5*(-parseInt(_0x4eec72(0x206))/0x6)+parseInt(_0x4eec72(0x1fc))/0x7*(-parseInt(_0x4eec72(0x20f))/0x8)+-parseInt(_0x4eec72(0x200))/0x9*(-parseInt(_0x4eec72(0x21f))/0xa)+-parseInt(_0x4eec72(0x20d))/0xb+parseInt(_0x4eec72(0x204))/0xc*(parseInt(_0x4eec72(0x1eb))/0xd);if(_0x1acd4d===_0x10a42e)break;else _0x459203['push'](_0x459203['shift']());}catch(_0x13e16e){_0x459203['push'](_0x459203['shift']());}}}(a51_0x46bc,0xc0cda));import{getApiDomain}from'../../../constant/domain.js';import{getEnv}from'../../../constant/env.js';import{logger}from'../../../utils/logger.js';export async function getOnlineMenuList(_0x519d0a,_0x3b0bde){const _0x45bc48=a51_0x632c,_0x57c85b=getEnv();logger[_0x45bc48(0x215)](_0x45bc48(0x1fe),_0x57c85b===_0x45bc48(0x224)?'Fetching\x20online\x20menu\x20list...\x20(appCode:\x20'+_0x519d0a+')':_0x45bc48(0x208)+_0x519d0a+')');const _0x4822ee=await fetch(getApiDomain()+_0x45bc48(0x20c)+_0x519d0a,{'method':'GET','headers':{'Content-Type':'application/json','Cookie':_0x3b0bde}});if(!_0x4822ee['ok']){if(_0x4822ee['status']===0x191){const _0x537d78=_0x45bc48(0x217);logger[_0x45bc48(0x221)]('get-online-menu-list',_0x537d78,{'status':_0x4822ee[_0x45bc48(0x1f0)]});throw new Error(_0x537d78);}const _0x42b13b=_0x45bc48(0x1f7)+_0x4822ee[_0x45bc48(0x1f0)];logger['error'](_0x45bc48(0x1fe),_0x42b13b);throw new Error(_0x42b13b);}const _0x431508=await _0x4822ee['json']();if(!_0x431508[_0x45bc48(0x202)]){const _0x3e0e31=_0x45bc48(0x1ff)+(_0x431508['errorMsg']||'Error');logger[_0x45bc48(0x221)](_0x45bc48(0x1fe),_0x3e0e31,{'errorCode':_0x431508[_0x45bc48(0x1ec)],'errorMsg':_0x431508[_0x45bc48(0x1ef)]});throw new Error(_0x3e0e31);}if(!_0x431508[_0x45bc48(0x1fb)])return logger[_0x45bc48(0x215)]('get-online-menu-list','Server\x20returned\x20empty\x20menu\x20list'),[];return logger[_0x45bc48(0x215)](_0x45bc48(0x1fe),_0x45bc48(0x21c)+_0x431508[_0x45bc48(0x1fb)][_0x45bc48(0x203)]+_0x45bc48(0x21b)),_0x431508['data'][_0x45bc48(0x1f3)](flattenMenuItem)[_0x45bc48(0x205)]();}function flattenMenuItem(_0x3baee0){const _0x3758ac=a51_0x632c;let _0x302ebf=[];try{if(_0x3baee0['extend']?.['resources']){const _0x5a5a55=JSON[_0x3758ac(0x225)](_0x3baee0['extend'][_0x3758ac(0x219)]);Array['isArray'](_0x5a5a55)&&(_0x302ebf=_0x5a5a55);}}catch(_0x44b014){}const _0x5edc85=[{'id':_0x3baee0['id'],'path':_0x3baee0[_0x3758ac(0x223)],'label':_0x3baee0[_0x3758ac(0x1fd)],'resources':_0x302ebf}];if(_0x3baee0[_0x3758ac(0x20e)]&&_0x3baee0[_0x3758ac(0x20e)][_0x3758ac(0x203)]>0x0)for(const _0x2bf112 of _0x3baee0[_0x3758ac(0x20e)]){_0x5edc85[_0x3758ac(0x1ee)](...flattenMenuItem(_0x2bf112));}return _0x5edc85;}export async function createMenu(_0x31f729,_0x216bf9,_0x4ce557){const _0x181f39=a51_0x632c;logger[_0x181f39(0x215)](_0x181f39(0x1f2),_0x181f39(0x213)+_0x4ce557['label']+'\x20('+_0x4ce557[_0x181f39(0x223)]+')');const _0x479d43={'appCode':_0x31f729,'type':_0x181f39(0x21d),'sort':0x0,'extend':{'loadScriptMode':_0x181f39(0x1ed),'resources':_0x4ce557['resources']?JSON[_0x181f39(0x21e)](_0x4ce557[_0x181f39(0x219)]):undefined},..._0x4ce557},_0x515122=await fetch(getApiDomain()+_0x181f39(0x226),{'method':_0x181f39(0x1f9),'body':JSON[_0x181f39(0x21e)](_0x479d43),'headers':{'Content-Type':_0x181f39(0x214),'Cookie':_0x216bf9}});if(!_0x515122['ok']){if(_0x515122[_0x181f39(0x1f0)]===0x191){const _0xce165c=_0x181f39(0x217);logger['error'](_0x181f39(0x1f2),_0xce165c,{'status':_0x515122['status'],'menu':_0x4ce557[_0x181f39(0x1fd)]});throw new Error(_0xce165c);}const _0x30e410=_0x181f39(0x1f8)+_0x515122[_0x181f39(0x1f0)];logger[_0x181f39(0x221)](_0x181f39(0x1f2),_0x30e410,{'menu':_0x4ce557[_0x181f39(0x1fd)]});throw new Error(_0x30e410);}const _0x1076de=await _0x515122[_0x181f39(0x1f1)]();if(!_0x1076de['success']){const _0x45e4de=_0x181f39(0x207)+(_0x1076de[_0x181f39(0x1ef)]||_0x181f39(0x218));logger[_0x181f39(0x221)]('create-menu',_0x45e4de,{'errorCode':_0x1076de['errorCode'],'errorMsg':_0x1076de[_0x181f39(0x1ef)],'menu':_0x4ce557[_0x181f39(0x1fd)]});throw new Error(_0x45e4de);}logger['info'](_0x181f39(0x1f2),_0x181f39(0x1fa)+_0x4ce557[_0x181f39(0x1fd)],_0x1076de[_0x181f39(0x1fb)]);}async function createSingleMenu(_0x86ac32,_0x5be213,_0x287c0c,_0x4aeea8){const _0x2ae819=a51_0x632c,_0x2b8bf7={'appCode':_0x86ac32,'type':_0x2ae819(0x21d),'sort':0x0,'extend':{'loadScriptMode':'import','resources':_0x4aeea8?JSON[_0x2ae819(0x21e)](_0x4aeea8):undefined},'label':_0x287c0c[_0x2ae819(0x1fd)],'path':_0x287c0c[_0x2ae819(0x223)]},_0x10e5ef=await fetch(getApiDomain()+_0x2ae819(0x226),{'method':_0x2ae819(0x1f9),'body':JSON[_0x2ae819(0x21e)](_0x2b8bf7),'headers':{'Content-Type':_0x2ae819(0x214),'Cookie':_0x5be213}});if(!_0x10e5ef['ok']){if(_0x10e5ef[_0x2ae819(0x1f0)]===0x191){const _0x5b05d6='Authentication\x20failed,\x20session\x20expired.\x20Please\x20use\x20rabetbase\x20auth\x20to\x20login\x20again';logger[_0x2ae819(0x221)]('create-menu',_0x5b05d6,{'status':_0x10e5ef[_0x2ae819(0x1f0)],'menu':_0x287c0c[_0x2ae819(0x1fd)]});throw new Error(_0x5b05d6);}const _0x1e4d9f=_0x2ae819(0x1f8)+_0x10e5ef['status'];logger[_0x2ae819(0x221)](_0x2ae819(0x1f2),_0x1e4d9f,{'menu':_0x287c0c[_0x2ae819(0x1fd)]});throw new Error(_0x1e4d9f);}const _0x3364ac=await _0x10e5ef['json']();if(!_0x3364ac[_0x2ae819(0x202)]){if(_0x3364ac[_0x2ae819(0x1ec)]==='0011'||_0x3364ac[_0x2ae819(0x1ef)]?.[_0x2ae819(0x1f5)]('登录')){const _0x2c43b4=_0x2ae819(0x21a);logger[_0x2ae819(0x221)](_0x2ae819(0x1f2),_0x2c43b4,{'errorCode':_0x3364ac[_0x2ae819(0x1ec)],'errorMsg':_0x3364ac[_0x2ae819(0x1ef)],'menu':_0x287c0c[_0x2ae819(0x1fd)]});throw new Error(_0x2c43b4);}const _0x183086=_0x2ae819(0x207)+(_0x3364ac[_0x2ae819(0x1ef)]||'Error');logger[_0x2ae819(0x221)](_0x2ae819(0x1f2),_0x183086,{'errorCode':_0x3364ac[_0x2ae819(0x1ec)],'errorMsg':_0x3364ac['errorMsg'],'menu':_0x287c0c[_0x2ae819(0x1fd)]});throw new Error(_0x183086);}logger[_0x2ae819(0x215)]('create-menu',_0x2ae819(0x1fa)+_0x287c0c[_0x2ae819(0x1fd)]);}function a51_0x46bc(){const _0x4fd2da=['Authentication\x20failed,\x20session\x20expired.\x20Please\x20use\x20rabetbase\x20auth\x20to\x20login\x20again','Error','resources','Auth\x20validation\x20failed.\x20Please\x20use\x20rabetbase\x20auth\x20to\x20login\x20again','\x20online\x20menus\x20successfully','Fetched\x20','procode','stringify','9168190gJnpMA','update-menu-cdn-url','error','Batch\x20menu\x20creation\x20completed,\x20total\x20','path','online','parse','/smartapi/menu/create','117ZyGlYh','errorCode','import','push','errorMsg','status','json','create-menu','map','Failed\x20to\x20update\x20menu\x20assets:\x20','includes','12EjuDEI','Failed\x20to\x20fetch\x20menu\x20list,\x20HTTP\x20status:\x20','Failed\x20to\x20create\x20menu,\x20HTTP\x20status:\x20','POST','Menu\x20created\x20successfully:\x20','data','99414dgiHOk','label','get-online-menu-list','Failed\x20to\x20fetch\x20menu\x20list:\x20','9dCSRhl','Menu\x20assets\x20synced:\x20','success','length','532524sLJArh','flat','1050114uLjOYa','Failed\x20to\x20create\x20menu:\x20','Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20','172TGfvbE','13375cDCZoS','5FuNobH','/smartapi/menu/find?appCode=','7095451IGnWBm','children','80mvtaVa','1235802greryJ','all','/smartapi/menu/update','Creating\x20menu:\x20','application/json','info','create-menus'];a51_0x46bc=function(){return _0x4fd2da;};return a51_0x46bc();}function a51_0x632c(_0x383e7a,_0x92cd22){_0x383e7a=_0x383e7a-0x1eb;const _0x46bcc3=a51_0x46bc();let _0x632ceb=_0x46bcc3[_0x383e7a];return _0x632ceb;}export async function createMenus(_0x1a80ae,_0x2f4da1,_0x359ac8,_0x3941b7){const _0x5536b4=a51_0x632c;logger[_0x5536b4(0x215)](_0x5536b4(0x216),'Start\x20batch\x20menu\x20creation,\x20total\x20'+_0x359ac8[_0x5536b4(0x203)]),await Promise[_0x5536b4(0x211)](_0x359ac8[_0x5536b4(0x1f3)](async _0x45c6b1=>{await createSingleMenu(_0x1a80ae,_0x2f4da1,_0x45c6b1,_0x3941b7);})),logger[_0x5536b4(0x215)]('create-menus',_0x5536b4(0x222)+_0x359ac8[_0x5536b4(0x203)]);}export async function updateMenuCdnUrl(_0x1f3630,_0x1ddd77,_0x40bb33){const _0x200596=a51_0x632c;logger[_0x200596(0x215)](_0x200596(0x220),'Updating\x20menu\x20asset\x20links:\x20'+_0x40bb33[_0x200596(0x1fd)]+'\x20('+_0x40bb33[_0x200596(0x223)]+')');const _0xc07e86={'id':_0x40bb33['id'],'appCode':_0x1f3630,'extend':{'loadScriptMode':_0x200596(0x1ed),'resources':_0x40bb33[_0x200596(0x219)]?JSON[_0x200596(0x21e)](_0x40bb33[_0x200596(0x219)]):undefined}},_0x23db16=await fetch(getApiDomain()+_0x200596(0x212),{'method':_0x200596(0x1f9),'body':JSON[_0x200596(0x21e)](_0xc07e86),'headers':{'Content-Type':_0x200596(0x214),'Cookie':_0x1ddd77}});if(!_0x23db16['ok']){if(_0x23db16[_0x200596(0x1f0)]===0x191){const _0x75342c=_0x200596(0x217);logger['error']('update-menu-cdn-url',_0x75342c,{'status':_0x23db16[_0x200596(0x1f0)],'menu':_0x40bb33[_0x200596(0x1fd)]});throw new Error(_0x75342c);}const _0xbe26ff=_0x200596(0x1f4)+_0x23db16[_0x200596(0x1f0)];logger[_0x200596(0x221)](_0x200596(0x220),_0xbe26ff,{'menu':_0x40bb33[_0x200596(0x1fd)]});throw new Error(_0xbe26ff);}const _0x385099=await _0x23db16[_0x200596(0x1f1)]();if(!_0x385099[_0x200596(0x202)]){const _0x1b463c=_0x200596(0x1f4)+(_0x385099[_0x200596(0x1ef)]||_0x200596(0x218));logger['error'](_0x200596(0x220),_0x1b463c,{'errorCode':_0x385099[_0x200596(0x1ec)],'errorMsg':_0x385099[_0x200596(0x1ef)],'menu':_0x40bb33[_0x200596(0x1fd)]});throw new Error(_0x1b463c);}logger[_0x200596(0x215)](_0x200596(0x220),_0x200596(0x201)+_0x40bb33['label'],_0x385099[_0x200596(0x1fb)]);}
@@ -1 +1 @@
1
- (function(_0x41fdf5,_0x20beae){const _0x527ac1=a52_0x1157,_0x1759d1=_0x41fdf5();while(!![]){try{const _0x6e36d8=-parseInt(_0x527ac1(0x1fa))/0x1*(-parseInt(_0x527ac1(0x1e9))/0x2)+-parseInt(_0x527ac1(0x205))/0x3+parseInt(_0x527ac1(0x1fc))/0x4*(parseInt(_0x527ac1(0x1eb))/0x5)+-parseInt(_0x527ac1(0x1f7))/0x6*(parseInt(_0x527ac1(0x1e8))/0x7)+parseInt(_0x527ac1(0x20b))/0x8*(-parseInt(_0x527ac1(0x1e1))/0x9)+parseInt(_0x527ac1(0x207))/0xa+-parseInt(_0x527ac1(0x1dd))/0xb*(-parseInt(_0x527ac1(0x1f2))/0xc);if(_0x6e36d8===_0x20beae)break;else _0x1759d1['push'](_0x1759d1['shift']());}catch(_0x446ce){_0x1759d1['push'](_0x1759d1['shift']());}}}(a52_0x9782,0x9488f));import{getLocalPages}from'./local-pages.js';import{getOnlineMenuList,createMenus}from'./service.js';function a52_0x9782(){const _0x52c8d4=['80778VJhhUK','cwd','4765PmfRnv','cssUrl','join','object','\x0a\x20\x20Available\x20local\x20pages:\x20','isArray','toString','4899996cPTCqa','label','parse','No\x20local\x20pages\x20matched\x20labels:\x20','pages','6BYCJau','Invalid\x20--params:\x20','length','21uLUvva','filter','4060hZEOsR','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','trim','concat','message','Menu\x20sync\x20completed','JS\x20URL\x20is\x20unreachable:\x20','string','stdin','3255198GKzoUo','jsUrl','9814660UeSmaR','startsWith','isTTY','push','4696WMZfzL','split','11awtDsy','selectedLabels','end','utf8','10269nYMlJr','map','path','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','has','Start\x20non-interactive\x20menu\x20sync','info','5894217LExzBH'];a52_0x9782=function(){return _0x52c8d4;};return a52_0x9782();}import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';function a52_0x1157(_0x155e91,_0x115c01){_0x155e91=_0x155e91-0x1dc;const _0x9782e9=a52_0x9782();let _0x1157b7=_0x9782e9[_0x155e91];return _0x1157b7;}import{logger}from'../../../utils/logger.js';function validateParams(_0x51971e){const _0x442ae1=a52_0x1157,_0x22e869=[];return _0x51971e[_0x442ae1(0x206)]&&!isValidJsHttpsUrl(_0x51971e[_0x442ae1(0x206)])&&_0x22e869[_0x442ae1(0x20a)]({'field':'jsUrl','message':_0x442ae1(0x1fd)}),_0x51971e[_0x442ae1(0x1ec)]&&!isValidCssHttpsUrl(_0x51971e[_0x442ae1(0x1ec)])&&_0x22e869[_0x442ae1(0x20a)]({'field':_0x442ae1(0x1ec),'message':_0x442ae1(0x1e4)}),_0x22e869;}export async function runMenuSyncCore(_0x3672c6,_0x39dedc,_0x16ff06=[],_0xc2ad27){const _0x323ba0=a52_0x1157,_0x51081d=parseParamsFlag(_0xc2ad27),_0x2e6dd1=_0x16ff06[_0x323ba0(0x1f9)]>0x0?_0x16ff06:_0x51081d[_0x323ba0(0x1de)],_0x1014ca=_0x51081d[_0x323ba0(0x206)],_0x51734a=_0x51081d['cssUrl'],_0x39c059=[];if(_0x1014ca)_0x39c059[_0x323ba0(0x20a)](_0x1014ca);if(_0x51734a)_0x39c059['push'](_0x51734a);const _0x57b0d2=validateParams(_0x51081d);if(_0x57b0d2[_0x323ba0(0x1f9)]>0x0){const _0x3ef0e9=_0x57b0d2[_0x323ba0(0x1e2)](_0x3ceddf=>'--params.'+_0x3ceddf['field']+':\x20'+_0x3ceddf[_0x323ba0(0x200)])[_0x323ba0(0x1ed)](';\x20');throw new Error(_0x323ba0(0x1f8)+_0x3ef0e9);}logger['setLogPath'](process[_0x323ba0(0x1ea)]()),logger[_0x323ba0(0x1e7)]('menu-sync',_0x323ba0(0x1e6),{'appCode':_0x3672c6,'selectedCount':_0x2e6dd1?.[_0x323ba0(0x1f9)],'jsUrl':_0x1014ca,'cssUrl':_0x51734a});if(_0x1014ca){const _0x3d512f=await isUrlReachable(_0x1014ca);if(!_0x3d512f)throw new Error(_0x323ba0(0x202)+_0x1014ca);}if(_0x51734a){const _0x537560=await isUrlReachable(_0x51734a);if(!_0x537560)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x51734a);}const _0x14f0ee=getLocalPages();if(_0x14f0ee[_0x323ba0(0x1f9)]===0x0)return{'created':0x0,'skipped':!![],'targetPages':[]};const _0x538077=await getOnlineMenuList(_0x3672c6,_0x39dedc),_0x5ed427=new Set(_0x538077[_0x323ba0(0x1e2)](_0x7d1e43=>_0x7d1e43[_0x323ba0(0x1e3)]));let _0x3d7e57;if(_0x2e6dd1&&_0x2e6dd1['length']>0x0){const _0x2e297d=new Set(_0x2e6dd1[_0x323ba0(0x1e2)](_0x58b274=>_0x58b274[_0x323ba0(0x1fe)]()));_0x3d7e57=_0x14f0ee[_0x323ba0(0x1fb)](_0x439591=>_0x2e297d[_0x323ba0(0x1e5)](_0x439591[_0x323ba0(0x1f3)]));if(_0x3d7e57[_0x323ba0(0x1f9)]===0x0){const _0x52685c=_0x14f0ee[_0x323ba0(0x1e2)](_0x2786d7=>_0x2786d7[_0x323ba0(0x1f3)])[_0x323ba0(0x1ed)](',\x20');throw new Error(_0x323ba0(0x1f5)+[..._0x2e297d]['join'](',\x20')+_0x323ba0(0x1ef)+_0x52685c);}}else _0x3d7e57=_0x14f0ee[_0x323ba0(0x1fb)](_0x1f887e=>!_0x5ed427['has'](_0x1f887e[_0x323ba0(0x1e3)]));if(_0x3d7e57[_0x323ba0(0x1f9)]===0x0)return{'created':0x0,'skipped':!![],'targetPages':[]};return await createMenus(_0x3672c6,_0x39dedc,_0x3d7e57,_0x39c059[_0x323ba0(0x1f9)]>0x0?_0x39c059:undefined),logger[_0x323ba0(0x1e7)]('menu-sync',_0x323ba0(0x201),{'count':_0x3d7e57['length'],'resources':_0x39c059}),{'created':_0x3d7e57[_0x323ba0(0x1f9)],'skipped':![],'targetPages':_0x3d7e57};}export async function readPageLabelsFromStdin(){const _0x2ae47a=a52_0x1157;if(!process[_0x2ae47a(0x204)][_0x2ae47a(0x209)]&&!process[_0x2ae47a(0x204)]['readableEnded'])return new Promise(_0x5161be=>{const _0x3931e=_0x2ae47a,_0x151fcf=[];process['stdin']['on']('data',_0x2f445a=>_0x151fcf[_0x3931e(0x20a)](_0x2f445a)),process['stdin']['on'](_0x3931e(0x1df),()=>{const _0x45d9e8=_0x3931e,_0x124993=Buffer[_0x45d9e8(0x1ff)](_0x151fcf)[_0x45d9e8(0x1f1)](_0x45d9e8(0x1e0)),_0x4176d1=_0x124993[_0x45d9e8(0x1dc)]('\x0a')[_0x45d9e8(0x1e2)](_0x2f0eb9=>_0x2f0eb9[_0x45d9e8(0x1fe)]())[_0x45d9e8(0x1fb)](_0x158f03=>_0x158f03[_0x45d9e8(0x1f9)]>0x0&&!_0x158f03[_0x45d9e8(0x208)]('#'));_0x5161be(_0x4176d1);}),setTimeout(()=>_0x5161be([]),0x1f4);});return[];}function parseParamsFlag(_0x56f71b){const _0x2b2a01=a52_0x1157;if(!_0x56f71b||typeof _0x56f71b!=='string')return{};try{const _0x2edb9c=JSON[_0x2b2a01(0x1f4)](_0x56f71b);if(typeof _0x2edb9c!==_0x2b2a01(0x1ee)||_0x2edb9c===null||Array['isArray'](_0x2edb9c))return{};return{'selectedLabels':Array[_0x2b2a01(0x1f0)](_0x2edb9c[_0x2b2a01(0x1f6)])?_0x2edb9c[_0x2b2a01(0x1f6)][_0x2b2a01(0x1e2)](String):undefined,'jsUrl':typeof _0x2edb9c[_0x2b2a01(0x206)]===_0x2b2a01(0x203)?_0x2edb9c['jsUrl'][_0x2b2a01(0x1fe)]():undefined,'cssUrl':typeof _0x2edb9c['cssUrl']===_0x2b2a01(0x203)?_0x2edb9c['cssUrl'][_0x2b2a01(0x1fe)]():undefined};}catch{return{};}}
1
+ (function(_0x4fdf63,_0x40ff0c){const _0x196ecc=a52_0x3d5f,_0x5776ca=_0x4fdf63();while(!![]){try{const _0x2f53f9=parseInt(_0x196ecc(0x1c4))/0x1*(-parseInt(_0x196ecc(0x1bf))/0x2)+-parseInt(_0x196ecc(0x1cf))/0x3+parseInt(_0x196ecc(0x1d6))/0x4+-parseInt(_0x196ecc(0x1c7))/0x5*(parseInt(_0x196ecc(0x1d9))/0x6)+parseInt(_0x196ecc(0x1c1))/0x7+-parseInt(_0x196ecc(0x1c0))/0x8+-parseInt(_0x196ecc(0x1d2))/0x9*(-parseInt(_0x196ecc(0x1cc))/0xa);if(_0x2f53f9===_0x40ff0c)break;else _0x5776ca['push'](_0x5776ca['shift']());}catch(_0x297cc4){_0x5776ca['push'](_0x5776ca['shift']());}}}(a52_0x796d,0x386f6));import{getLocalPages}from'./local-pages.js';import{getOnlineMenuList,createMenus}from'./service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';function a52_0x3d5f(_0x14cb7c,_0x253802){_0x14cb7c=_0x14cb7c-0x1b8;const _0x796d57=a52_0x796d();let _0x3d5fcc=_0x796d57[_0x14cb7c];return _0x3d5fcc;}import{logger}from'../../../utils/logger.js';function validateParams(_0x2d8e90){const _0x404686=a52_0x3d5f,_0x4fad86=[];return _0x2d8e90['jsUrl']&&!isValidJsHttpsUrl(_0x2d8e90[_0x404686(0x1ca)])&&_0x4fad86[_0x404686(0x1de)]({'field':_0x404686(0x1ca),'message':_0x404686(0x1d0)}),_0x2d8e90['cssUrl']&&!isValidCssHttpsUrl(_0x2d8e90[_0x404686(0x1c8)])&&_0x4fad86['push']({'field':'cssUrl','message':_0x404686(0x1c3)}),_0x4fad86;}export async function runMenuSyncCore(_0x53bb9f,_0x5bb224,_0x3bd813=[],_0x3d707e){const _0xb8d931=a52_0x3d5f,_0x24b063=parseParamsFlag(_0x3d707e),_0x1f3b4d=_0x3bd813[_0xb8d931(0x1be)]>0x0?_0x3bd813:_0x24b063[_0xb8d931(0x1d8)],_0x1e404e=_0x24b063[_0xb8d931(0x1ca)],_0x12a6f2=_0x24b063[_0xb8d931(0x1c8)],_0xb2ae34=[];if(_0x1e404e)_0xb2ae34['push'](_0x1e404e);if(_0x12a6f2)_0xb2ae34[_0xb8d931(0x1de)](_0x12a6f2);const _0x221840=validateParams(_0x24b063);if(_0x221840['length']>0x0){const _0x3e7ee5=_0x221840['map'](_0x2b1a7c=>'--params.'+_0x2b1a7c[_0xb8d931(0x1d1)]+':\x20'+_0x2b1a7c['message'])[_0xb8d931(0x1d4)](';\x20');throw new Error('Invalid\x20--params:\x20'+_0x3e7ee5);}logger['setLogPath'](process['cwd']()),logger['info'](_0xb8d931(0x1c9),'Start\x20non-interactive\x20menu\x20sync',{'appCode':_0x53bb9f,'selectedCount':_0x1f3b4d?.[_0xb8d931(0x1be)],'jsUrl':_0x1e404e,'cssUrl':_0x12a6f2});if(_0x1e404e){const _0x37094e=await isUrlReachable(_0x1e404e);if(!_0x37094e)throw new Error(_0xb8d931(0x1b8)+_0x1e404e);}if(_0x12a6f2){const _0xbf6ca0=await isUrlReachable(_0x12a6f2);if(!_0xbf6ca0)throw new Error(_0xb8d931(0x1ce)+_0x12a6f2);}const _0x36192c=getLocalPages();if(_0x36192c['length']===0x0)return{'created':0x0,'skipped':!![],'targetPages':[]};const _0x3e7e7c=await getOnlineMenuList(_0x53bb9f,_0x5bb224),_0x257c96=new Set(_0x3e7e7c[_0xb8d931(0x1c2)](_0x358f51=>_0x358f51[_0xb8d931(0x1d5)]));let _0x51768d;if(_0x1f3b4d&&_0x1f3b4d[_0xb8d931(0x1be)]>0x0){const _0x1934dd=new Set(_0x1f3b4d[_0xb8d931(0x1c2)](_0x2a83a7=>_0x2a83a7[_0xb8d931(0x1b9)]()));_0x51768d=_0x36192c[_0xb8d931(0x1c5)](_0x28ca5f=>_0x1934dd[_0xb8d931(0x1da)](_0x28ca5f[_0xb8d931(0x1bd)]));if(_0x51768d['length']===0x0){const _0x1a4ff0=_0x36192c['map'](_0x33be79=>_0x33be79[_0xb8d931(0x1bd)])[_0xb8d931(0x1d4)](',\x20');throw new Error(_0xb8d931(0x1cd)+[..._0x1934dd]['join'](',\x20')+'\x0a\x20\x20Available\x20local\x20pages:\x20'+_0x1a4ff0);}}else _0x51768d=_0x36192c[_0xb8d931(0x1c5)](_0x235244=>!_0x257c96['has'](_0x235244[_0xb8d931(0x1d5)]));if(_0x51768d[_0xb8d931(0x1be)]===0x0)return{'created':0x0,'skipped':!![],'targetPages':[]};return await createMenus(_0x53bb9f,_0x5bb224,_0x51768d,_0xb2ae34[_0xb8d931(0x1be)]>0x0?_0xb2ae34:undefined),logger[_0xb8d931(0x1bc)](_0xb8d931(0x1c9),_0xb8d931(0x1db),{'count':_0x51768d[_0xb8d931(0x1be)],'resources':_0xb2ae34}),{'created':_0x51768d[_0xb8d931(0x1be)],'skipped':![],'targetPages':_0x51768d};}export async function readPageLabelsFromStdin(){const _0x22d122=a52_0x3d5f;if(!process[_0x22d122(0x1cb)][_0x22d122(0x1dd)]&&!process['stdin']['readableEnded'])return new Promise(_0x24c9c9=>{const _0x116ed7=_0x22d122,_0x4d1ba9=[];process[_0x116ed7(0x1cb)]['on']('data',_0x484f8e=>_0x4d1ba9['push'](_0x484f8e)),process[_0x116ed7(0x1cb)]['on'](_0x116ed7(0x1bb),()=>{const _0x2f0863=_0x116ed7,_0x13cd80=Buffer['concat'](_0x4d1ba9)[_0x2f0863(0x1df)](_0x2f0863(0x1dc)),_0x2c46b8=_0x13cd80[_0x2f0863(0x1ba)]('\x0a')[_0x2f0863(0x1c2)](_0x1c9101=>_0x1c9101[_0x2f0863(0x1b9)]())[_0x2f0863(0x1c5)](_0x3e0731=>_0x3e0731[_0x2f0863(0x1be)]>0x0&&!_0x3e0731['startsWith']('#'));_0x24c9c9(_0x2c46b8);}),setTimeout(()=>_0x24c9c9([]),0x1f4);});return[];}function a52_0x796d(){const _0xcc54bd=['jsUrl','stdin','80IYdjsR','No\x20local\x20pages\x20matched\x20labels:\x20','CSS\x20URL\x20is\x20unreachable:\x20','1120857CpXoba','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','field','1458954ZEeDTN','pages','join','path','889692ykyXLe','isArray','selectedLabels','3450sseHFn','has','Menu\x20sync\x20completed','utf8','isTTY','push','toString','JS\x20URL\x20is\x20unreachable:\x20','trim','split','end','info','label','length','278026YVwmFL','3167056YwbSKO','510482qfXqAM','map','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','1UQLLJF','filter','string','3935wAxDHf','cssUrl','menu-sync'];a52_0x796d=function(){return _0xcc54bd;};return a52_0x796d();}function parseParamsFlag(_0x11a06d){const _0x22a813=a52_0x3d5f;if(!_0x11a06d||typeof _0x11a06d!==_0x22a813(0x1c6))return{};try{const _0x3b0a8f=JSON['parse'](_0x11a06d);if(typeof _0x3b0a8f!=='object'||_0x3b0a8f===null||Array[_0x22a813(0x1d7)](_0x3b0a8f))return{};return{'selectedLabels':Array[_0x22a813(0x1d7)](_0x3b0a8f[_0x22a813(0x1d3)])?_0x3b0a8f['pages']['map'](String):undefined,'jsUrl':typeof _0x3b0a8f[_0x22a813(0x1ca)]===_0x22a813(0x1c6)?_0x3b0a8f[_0x22a813(0x1ca)][_0x22a813(0x1b9)]():undefined,'cssUrl':typeof _0x3b0a8f[_0x22a813(0x1c8)]===_0x22a813(0x1c6)?_0x3b0a8f[_0x22a813(0x1c8)][_0x22a813(0x1b9)]():undefined};}catch{return{};}}
@@ -1 +1 @@
1
- (function(_0x4145fc,_0x11b603){const _0x45975f=a54_0x37f5,_0x3ab0c1=_0x4145fc();while(!![]){try{const _0x4b07c3=parseInt(_0x45975f(0x190))/0x1*(-parseInt(_0x45975f(0x16b))/0x2)+parseInt(_0x45975f(0x174))/0x3+parseInt(_0x45975f(0x16e))/0x4*(parseInt(_0x45975f(0x18e))/0x5)+parseInt(_0x45975f(0x175))/0x6+parseInt(_0x45975f(0x16c))/0x7+-parseInt(_0x45975f(0x183))/0x8*(-parseInt(_0x45975f(0x18b))/0x9)+parseInt(_0x45975f(0x171))/0xa*(-parseInt(_0x45975f(0x170))/0xb);if(_0x4b07c3===_0x11b603)break;else _0x3ab0c1['push'](_0x3ab0c1['shift']());}catch(_0x3f2954){_0x3ab0c1['push'](_0x3ab0c1['shift']());}}}(a54_0x234d,0x1a264));function a54_0x37f5(_0x354e4b,_0x45540f){_0x354e4b=_0x354e4b-0x16b;const _0x234d7b=a54_0x234d();let _0x37f5c0=_0x234d7b[_0x354e4b];return _0x37f5c0;}import{updateMenuCdnUrl,getOnlineMenuList}from'./service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import{logger}from'../../../utils/logger.js';function validateParams(_0x3e0f74){const _0x556eb3=a54_0x37f5,_0x3c9ad4=[];return _0x3e0f74['jsUrl']&&!isValidJsHttpsUrl(_0x3e0f74['jsUrl'])&&_0x3c9ad4[_0x556eb3(0x17a)]({'field':'jsUrl','message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x3e0f74[_0x556eb3(0x17d)]&&!isValidCssHttpsUrl(_0x3e0f74[_0x556eb3(0x17d)])&&_0x3c9ad4[_0x556eb3(0x17a)]({'field':_0x556eb3(0x17d),'message':_0x556eb3(0x17c)}),_0x3c9ad4;}export async function runMenuUpdateCore(_0x44c30f,_0x3709df,_0x470831){const _0x5136df=a54_0x37f5,_0x53d64d=parseUpdateParamsFlag(_0x470831),_0x2cac01=[];if(_0x53d64d[_0x5136df(0x185)])_0x2cac01[_0x5136df(0x17a)](_0x53d64d[_0x5136df(0x185)]);if(_0x53d64d['cssUrl'])_0x2cac01[_0x5136df(0x17a)](_0x53d64d['cssUrl']);const _0x1c54e0=validateParams(_0x53d64d);if(_0x1c54e0['length']>0x0){const _0x3165fc=_0x1c54e0[_0x5136df(0x17e)](_0x4a59ec=>_0x5136df(0x17b)+_0x4a59ec[_0x5136df(0x192)]+':\x20'+_0x4a59ec[_0x5136df(0x172)])[_0x5136df(0x173)](';\x20');throw new Error(_0x5136df(0x187)+_0x3165fc);}logger[_0x5136df(0x188)](process[_0x5136df(0x17f)]()),logger[_0x5136df(0x186)](_0x5136df(0x191),'Start\x20non-interactive\x20menu\x20update',{'appCode':_0x44c30f,'jsUrl':_0x53d64d[_0x5136df(0x185)],'cssUrl':_0x53d64d['cssUrl']});if(_0x53d64d[_0x5136df(0x185)]){const _0x2efcf0=await isUrlReachable(_0x53d64d[_0x5136df(0x185)]);if(!_0x2efcf0)throw new Error(_0x5136df(0x189)+_0x53d64d['jsUrl']);}if(_0x53d64d[_0x5136df(0x17d)]){const _0x5e5656=await isUrlReachable(_0x53d64d[_0x5136df(0x17d)]);if(!_0x5e5656)throw new Error(_0x5136df(0x181)+_0x53d64d[_0x5136df(0x17d)]);}const _0x1fb718=await getOnlineMenuList(_0x44c30f,_0x3709df),_0x14de41=_0x1fb718[_0x5136df(0x16f)](_0x178c7c=>_0x178c7c['resources'][_0x5136df(0x18a)]>0x0);if(_0x14de41['length']===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![]};const _0x568eb2=await Promise[_0x5136df(0x16d)](_0x14de41[_0x5136df(0x17e)](_0x976be5=>updateMenuCdnUrl(_0x44c30f,_0x3709df,{'id':_0x976be5['id'],'label':_0x976be5[_0x5136df(0x179)],'path':_0x976be5[_0x5136df(0x182)],'resources':_0x2cac01}))),_0x54c3cc=_0x568eb2[_0x5136df(0x16f)](_0x71941d=>_0x71941d[_0x5136df(0x18f)]===_0x5136df(0x180))[_0x5136df(0x18a)];return logger['info'](_0x5136df(0x191),_0x5136df(0x176),{'count':_0x14de41[_0x5136df(0x18a)],'resources':_0x2cac01}),{'updated':_0x14de41[_0x5136df(0x18a)]-_0x54c3cc,'failed':_0x54c3cc,'skipped':![]};}function a54_0x234d(){const _0x236e1b=['Invalid\x20--params:\x20','setLogPath','JS\x20URL\x20is\x20unreachable:\x20','length','28971jwdvid','parse','object','3030AyoefT','status','97ccMqQI','menu-update','field','2308ZAQTDQ','782159Jealeg','allSettled','724ImFCsz','filter','11ektpDd','2650080oRfJdg','message','join','395751IWpJkG','378690aYNFCd','Menu\x20update\x20completed','isArray','string','label','push','--params.','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','cssUrl','map','cwd','rejected','CSS\x20URL\x20is\x20unreachable:\x20','path','168HxSiHE','trim','jsUrl','info'];a54_0x234d=function(){return _0x236e1b;};return a54_0x234d();}function parseUpdateParamsFlag(_0x1a0b1a){const _0x2a31ef=a54_0x37f5;if(!_0x1a0b1a||typeof _0x1a0b1a!=='string')return{};try{const _0x4006b8=JSON[_0x2a31ef(0x18c)](_0x1a0b1a);if(typeof _0x4006b8!==_0x2a31ef(0x18d)||_0x4006b8===null||Array[_0x2a31ef(0x177)](_0x4006b8))return{};return{'jsUrl':typeof _0x4006b8['jsUrl']===_0x2a31ef(0x178)?_0x4006b8[_0x2a31ef(0x185)][_0x2a31ef(0x184)]():undefined,'cssUrl':typeof _0x4006b8[_0x2a31ef(0x17d)]==='string'?_0x4006b8['cssUrl'][_0x2a31ef(0x184)]():undefined};}catch{return{};}}
1
+ (function(_0x23ee85,_0x3353fe){const _0x329300=a54_0x4ddc,_0x1b13d1=_0x23ee85();while(!![]){try{const _0x7d3267=parseInt(_0x329300(0x90))/0x1+-parseInt(_0x329300(0x87))/0x2+parseInt(_0x329300(0x92))/0x3+parseInt(_0x329300(0x85))/0x4+parseInt(_0x329300(0x8b))/0x5+-parseInt(_0x329300(0x91))/0x6*(parseInt(_0x329300(0x77))/0x7)+-parseInt(_0x329300(0x89))/0x8;if(_0x7d3267===_0x3353fe)break;else _0x1b13d1['push'](_0x1b13d1['shift']());}catch(_0x51f9b6){_0x1b13d1['push'](_0x1b13d1['shift']());}}}(a54_0x5b39,0x26410));import{updateMenuCdnUrl,getOnlineMenuList}from'./service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import{logger}from'../../../utils/logger.js';function validateParams(_0x3c0e07){const _0xe8ab87=a54_0x4ddc,_0xa1480c=[];return _0x3c0e07[_0xe8ab87(0x8c)]&&!isValidJsHttpsUrl(_0x3c0e07['jsUrl'])&&_0xa1480c[_0xe8ab87(0x7e)]({'field':_0xe8ab87(0x8c),'message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x3c0e07[_0xe8ab87(0x79)]&&!isValidCssHttpsUrl(_0x3c0e07[_0xe8ab87(0x79)])&&_0xa1480c[_0xe8ab87(0x7e)]({'field':_0xe8ab87(0x79),'message':'CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'}),_0xa1480c;}export async function runMenuUpdateCore(_0x4dcc60,_0x484f7d,_0x12a443){const _0x2a0cfe=a54_0x4ddc,_0x533832=parseUpdateParamsFlag(_0x12a443),_0x33eddb=[];if(_0x533832[_0x2a0cfe(0x8c)])_0x33eddb[_0x2a0cfe(0x7e)](_0x533832[_0x2a0cfe(0x8c)]);if(_0x533832[_0x2a0cfe(0x79)])_0x33eddb[_0x2a0cfe(0x7e)](_0x533832['cssUrl']);const _0x47aefa=validateParams(_0x533832);if(_0x47aefa[_0x2a0cfe(0x7b)]>0x0){const _0x1fc7ac=_0x47aefa[_0x2a0cfe(0x7a)](_0x49d6dc=>_0x2a0cfe(0x82)+_0x49d6dc[_0x2a0cfe(0x76)]+':\x20'+_0x49d6dc[_0x2a0cfe(0x74)])[_0x2a0cfe(0x8d)](';\x20');throw new Error(_0x2a0cfe(0x8f)+_0x1fc7ac);}logger[_0x2a0cfe(0x78)](process['cwd']()),logger[_0x2a0cfe(0x81)](_0x2a0cfe(0x86),_0x2a0cfe(0x7f),{'appCode':_0x4dcc60,'jsUrl':_0x533832[_0x2a0cfe(0x8c)],'cssUrl':_0x533832[_0x2a0cfe(0x79)]});if(_0x533832[_0x2a0cfe(0x8c)]){const _0x1260f9=await isUrlReachable(_0x533832[_0x2a0cfe(0x8c)]);if(!_0x1260f9)throw new Error('JS\x20URL\x20is\x20unreachable:\x20'+_0x533832['jsUrl']);}if(_0x533832['cssUrl']){const _0x3da492=await isUrlReachable(_0x533832[_0x2a0cfe(0x79)]);if(!_0x3da492)throw new Error(_0x2a0cfe(0x7d)+_0x533832[_0x2a0cfe(0x79)]);}const _0x5e9489=await getOnlineMenuList(_0x4dcc60,_0x484f7d),_0x20b78a=_0x5e9489[_0x2a0cfe(0x84)](_0x40c483=>_0x40c483['resources']['length']>0x0);if(_0x20b78a[_0x2a0cfe(0x7b)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![]};const _0x4eff49=await Promise[_0x2a0cfe(0x75)](_0x20b78a[_0x2a0cfe(0x7a)](_0x7446e=>updateMenuCdnUrl(_0x4dcc60,_0x484f7d,{'id':_0x7446e['id'],'label':_0x7446e[_0x2a0cfe(0x7c)],'path':_0x7446e[_0x2a0cfe(0x8e)],'resources':_0x33eddb}))),_0x382092=_0x4eff49[_0x2a0cfe(0x84)](_0xe97533=>_0xe97533[_0x2a0cfe(0x8a)]==='rejected')[_0x2a0cfe(0x7b)];return logger[_0x2a0cfe(0x81)](_0x2a0cfe(0x86),_0x2a0cfe(0x83),{'count':_0x20b78a[_0x2a0cfe(0x7b)],'resources':_0x33eddb}),{'updated':_0x20b78a['length']-_0x382092,'failed':_0x382092,'skipped':![]};}function a54_0x4ddc(_0x15f6b9,_0x3b33e6){_0x15f6b9=_0x15f6b9-0x74;const _0x5b3935=a54_0x5b39();let _0x4ddca1=_0x5b3935[_0x15f6b9];return _0x4ddca1;}function parseUpdateParamsFlag(_0x4d2c62){const _0x472d3f=a54_0x4ddc;if(!_0x4d2c62||typeof _0x4d2c62!==_0x472d3f(0x80))return{};try{const _0x7dadd3=JSON['parse'](_0x4d2c62);if(typeof _0x7dadd3!=='object'||_0x7dadd3===null||Array[_0x472d3f(0x88)](_0x7dadd3))return{};return{'jsUrl':typeof _0x7dadd3[_0x472d3f(0x8c)]===_0x472d3f(0x80)?_0x7dadd3[_0x472d3f(0x8c)][_0x472d3f(0x93)]():undefined,'cssUrl':typeof _0x7dadd3[_0x472d3f(0x79)]===_0x472d3f(0x80)?_0x7dadd3[_0x472d3f(0x79)][_0x472d3f(0x93)]():undefined};}catch{return{};}}function a54_0x5b39(){const _0x1ad9f7=['613652qJTvKp','menu-update','373358ARuHsj','isArray','1144112qqMbpA','status','1416415ZqkMUg','jsUrl','join','path','Invalid\x20--params:\x20','164668vzkdtc','960726jhvEqf','135414dKUVIt','trim','message','allSettled','field','7Qtvlzl','setLogPath','cssUrl','map','length','label','CSS\x20URL\x20is\x20unreachable:\x20','push','Start\x20non-interactive\x20menu\x20update','string','info','--params.','Menu\x20update\x20completed','filter'];a54_0x5b39=function(){return _0x1ad9f7;};return a54_0x5b39();}
@@ -1 +1 @@
1
- function a55_0x43c9(){const _0x5e5528=['293295zSsciq','2yOWNxp','trim','1552794GgLBiy','43976pNGQEt','25031502ZKuQbY','5858108plppmv','1564645fmyEae','2009736LoWXUX','test','1757yQyJNP'];a55_0x43c9=function(){return _0x5e5528;};return a55_0x43c9();}function a55_0x33cc(_0xea97a0,_0x5ea8d3){_0xea97a0=_0xea97a0-0xb2;const _0x43c9e5=a55_0x43c9();let _0x33cc3a=_0x43c9e5[_0xea97a0];return _0x33cc3a;}(function(_0x42775f,_0x24802d){const _0x3abf58=a55_0x33cc,_0x35b356=_0x42775f();while(!![]){try{const _0x116299=parseInt(_0x3abf58(0xb2))/0x1*(parseInt(_0x3abf58(0xb3))/0x2)+parseInt(_0x3abf58(0xba))/0x3+-parseInt(_0x3abf58(0xb8))/0x4+-parseInt(_0x3abf58(0xb9))/0x5+parseInt(_0x3abf58(0xb5))/0x6+-parseInt(_0x3abf58(0xbc))/0x7*(parseInt(_0x3abf58(0xb6))/0x8)+parseInt(_0x3abf58(0xb7))/0x9;if(_0x116299===_0x24802d)break;else _0x35b356['push'](_0x35b356['shift']());}catch(_0x36a7e4){_0x35b356['push'](_0x35b356['shift']());}}}(a55_0x43c9,0xce901));export function isValidJsHttpsUrl(_0x18e376){const _0xb36faf=a55_0x33cc;return/^https:\/\/.+\.js(\?.*)?$/[_0xb36faf(0xbb)](_0x18e376[_0xb36faf(0xb4)]());}export function isValidCssHttpsUrl(_0x2a1881){const _0x2b592d=a55_0x33cc;return/^https:\/\/.+\.css(\?.*)?$/[_0x2b592d(0xbb)](_0x2a1881[_0x2b592d(0xb4)]());}export async function isUrlReachable(_0x569637){try{const _0x33707a=await fetch(_0x569637,{'method':'HEAD'});return _0x33707a['ok'];}catch{return![];}}
1
+ (function(_0x43e980,_0x4ee54f){const _0x3f015f=a55_0xd707,_0x11ca14=_0x43e980();while(!![]){try{const _0x1e6d9e=parseInt(_0x3f015f(0x7f))/0x1*(-parseInt(_0x3f015f(0x84))/0x2)+parseInt(_0x3f015f(0x7d))/0x3*(-parseInt(_0x3f015f(0x80))/0x4)+parseInt(_0x3f015f(0x83))/0x5+-parseInt(_0x3f015f(0x81))/0x6+parseInt(_0x3f015f(0x7c))/0x7+-parseInt(_0x3f015f(0x7e))/0x8+parseInt(_0x3f015f(0x85))/0x9;if(_0x1e6d9e===_0x4ee54f)break;else _0x11ca14['push'](_0x11ca14['shift']());}catch(_0x501991){_0x11ca14['push'](_0x11ca14['shift']());}}}(a55_0x57c5,0x4f7c6));export function isValidJsHttpsUrl(_0x3f86c1){const _0x396dbc=a55_0xd707;return/^https:\/\/.+\.js(\?.*)?$/[_0x396dbc(0x86)](_0x3f86c1[_0x396dbc(0x82)]());}export function isValidCssHttpsUrl(_0x22994d){const _0x23f39b=a55_0xd707;return/^https:\/\/.+\.css(\?.*)?$/[_0x23f39b(0x86)](_0x22994d['trim']());}function a55_0xd707(_0x2ce2a4,_0x104f0c){_0x2ce2a4=_0x2ce2a4-0x7c;const _0x57c5ea=a55_0x57c5();let _0xd7076a=_0x57c5ea[_0x2ce2a4];return _0xd7076a;}function a55_0x57c5(){const _0xa4b8a0=['2224124IXvKZk','2351580aaEFtk','trim','1060095BtdjtK','57686fCeLFm','15313581DTYFCJ','test','396144kguvZZ','3NqneIS','4188216Tyeaue','6xDRdJx'];a55_0x57c5=function(){return _0xa4b8a0;};return a55_0x57c5();}export async function isUrlReachable(_0x1a6e74){try{const _0x54b291=await fetch(_0x1a6e74,{'method':'HEAD'});return _0x54b291['ok'];}catch{return![];}}
@@ -1 +1 @@
1
- const a56_0xdb1631=a56_0x79b3;function a56_0x33e2(){const _0x11dfe8=['size','\x20failed.','Sync\x20local\x20pages\x20as\x20platform\x20menus','onlineMenuList','pages','parse','params','\x20\x20✓\x20Selected:\x20','\x20page(s)','Menu\x20sync\x20completed:\x20','\x20menu(s)','311794vOiDjW','CANCEL','\x20menu(s)\x20created','onlinePaths','142sGfiIz','4943504vDIFLZ','isArray','144GYWIGI','trim','32514ZqCBQj','gray','\x20\x20Continue\x20with\x20creation?','yes','3609Hhsmil','message','cssUrl','created','593374mkZhzh','\x20and\x20CSS:\x20','Pre-fill\x20JS/CSS\x20URLs\x20and/or\x20select\x20specific\x20pages.\x20','\x20\x20Cancelled.','appCode','failed','6965916aaqxZE','Menu\x20creation\x20failed','object','\x20created,\x20','jsUrl','validation','!\x20No\x20local\x20pages\x20found\x20in\x20src/pages','Creating\x20','7490GkwzOA','✓\x20Menu\x20sync\x20completed:\x20','\x20menu(s)\x20with\x20JS:\x20','✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform','cookie','Online\x20menu\x20list\x20fetched','Failed\x20to\x20fetch\x20online\x20menu\x20list','string','Created\x20','write','log','5896595jkHyCC','\x20menu(s)...','length'];a56_0x33e2=function(){return _0x11dfe8;};return a56_0x33e2();}(function(_0x3d9ba9,_0x3511b4){const _0x8cf760=a56_0x79b3,_0x2bfcf0=_0x3d9ba9();while(!![]){try{const _0x2fd621=-parseInt(_0x8cf760(0x180))/0x1+-parseInt(_0x8cf760(0x1ab))/0x2*(-parseInt(_0x8cf760(0x178))/0x3)+parseInt(_0x8cf760(0x1ac))/0x4+-parseInt(_0x8cf760(0x199))/0x5+parseInt(_0x8cf760(0x186))/0x6+-parseInt(_0x8cf760(0x1a7))/0x7*(parseInt(_0x8cf760(0x1ae))/0x8)+parseInt(_0x8cf760(0x17c))/0x9*(parseInt(_0x8cf760(0x18e))/0xa);if(_0x2fd621===_0x3511b4)break;else _0x2bfcf0['push'](_0x2bfcf0['shift']());}catch(_0x529267){_0x2bfcf0['push'](_0x2bfcf0['shift']());}}}(a56_0x33e2,0xd9d64));import a56_0x10b93b from'chalk';import{buildCompareRows,doCreateMenus,fetchMenuData}from'./shared/logic.js';import{renderCompareTable,renderSyncSummary}from'./shared/compare-table.js';import{selectPages,askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'./shared/inquirer.js';import{CliErrors}from'../../errors.js';import{runMenuSyncCore,readPageLabelsFromStdin}from'./shared/sync-core.js';import{getLocalPages}from'./shared/local-pages.js';export const menuSync={'service':'menu','command':'sync','description':a56_0xdb1631(0x19e),'risk':a56_0xdb1631(0x197),'flags':[{'name':a56_0xdb1631(0x1a2),'type':a56_0xdb1631(0x195),'description':a56_0xdb1631(0x182)+'JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22,\x22pages\x22:[\x22Page1\x22]}'},{'name':a56_0xdb1631(0x17b),'type':'boolean','description':'Non-interactive:\x20auto-create\x20all\x20local\x20pages\x20not\x20yet\x20on\x20platform'}],async 'execute'(_0x2eccf9){const _0x3734cd=a56_0xdb1631,_0x12cd2e=_0x2eccf9['flag']('yes'),_0x1f7e0b=_0x2eccf9['str']('params'),_0x16e4fc=parseParams(_0x1f7e0b),_0x2904eb=!!(_0x16e4fc[_0x3734cd(0x18a)]||_0x16e4fc[_0x3734cd(0x17e)]||_0x16e4fc[_0x3734cd(0x1a0)]&&_0x16e4fc[_0x3734cd(0x1a0)][_0x3734cd(0x19b)]>0x0);if(_0x12cd2e||_0x2904eb){let _0x2a6a57=[];!isInteractive()&&!_0x16e4fc[_0x3734cd(0x1a0)]?.[_0x3734cd(0x19b)]&&(_0x2a6a57=await readPageLabelsFromStdin());const _0x27f227=await runMenuSyncCore(_0x2eccf9[_0x3734cd(0x184)],_0x2eccf9[_0x3734cd(0x192)],_0x2a6a57[_0x3734cd(0x19b)]>0x0?_0x2a6a57:_0x16e4fc['pages']??[],_0x1f7e0b);if(_0x27f227['skipped']){const _0x12b9cf=getLocalPages();_0x12b9cf[_0x3734cd(0x19b)]===0x0?console[_0x3734cd(0x198)](_0x3734cd(0x18c)):console[_0x3734cd(0x198)](_0x3734cd(0x191));}else console['log'](_0x3734cd(0x18f)+_0x27f227[_0x3734cd(0x17f)]+_0x3734cd(0x1a9));return{'ok':!![]};}requireInteractive();const _0x508923=startSpinner('Fetching\x20online\x20menu\x20list...');let _0x3ed0b5,_0x340e60,_0x4afaf3;try{const _0x381c32=await fetchMenuData(_0x2eccf9['appCode'],_0x2eccf9['cookie']);_0x3ed0b5=_0x381c32['localPages'],_0x340e60=_0x381c32[_0x3734cd(0x1aa)],_0x4afaf3=_0x381c32[_0x3734cd(0x19f)],stopSpinner(_0x508923,_0x3734cd(0x193),!![]);}catch(_0x2db5af){stopSpinner(_0x508923,_0x3734cd(0x194),![]);throw CliErrors[_0x3734cd(0x18b)](_0x2db5af instanceof Error?_0x2db5af[_0x3734cd(0x17d)]:_0x3734cd(0x194));}if(_0x3ed0b5[_0x3734cd(0x19b)]===0x0)return console[_0x3734cd(0x198)](a56_0x10b93b['yellow']('\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first')),{'ok':!![]};const _0x7ec7dc=buildCompareRows(_0x3ed0b5,_0x340e60);console[_0x3734cd(0x198)](renderCompareTable(_0x7ec7dc)),console['log']();const _0x2272a9=_0x16e4fc[_0x3734cd(0x1a0)],_0x356fe8=await selectPages(_0x3ed0b5,_0x340e60,_0x2272a9);console['log'](),console[_0x3734cd(0x198)](a56_0x10b93b['cyan'](_0x3734cd(0x1a3)+_0x356fe8['length']+_0x3734cd(0x1a4)));const _0x4d84b0=_0x16e4fc['jsUrl']&&_0x16e4fc[_0x3734cd(0x17e)];if(!_0x4d84b0){console['log'](renderSyncSummary(_0x356fe8,_0x340e60[_0x3734cd(0x19c)]>0x0));const _0x4d9feb=await askConfirm(_0x3734cd(0x17a));if(!_0x4d9feb)return console[_0x3734cd(0x198)](a56_0x10b93b[_0x3734cd(0x179)](_0x3734cd(0x183))),{'ok':!![]};}let _0x16d839=_0x16e4fc[_0x3734cd(0x18a)],_0x30f8e5=_0x16e4fc[_0x3734cd(0x17e)];if(!_0x16d839)try{_0x16d839=await askJsUrl();}catch(_0x4adf65){if(_0x4adf65[_0x3734cd(0x17d)]==='CANCEL')return console[_0x3734cd(0x198)](a56_0x10b93b[_0x3734cd(0x179)](_0x3734cd(0x183))),{'ok':!![]};throw _0x4adf65;}if(!_0x30f8e5)try{_0x30f8e5=await askCssUrl();}catch(_0x37c424){if(_0x37c424[_0x3734cd(0x17d)]===_0x3734cd(0x1a8))return console['log'](a56_0x10b93b[_0x3734cd(0x179)](_0x3734cd(0x183))),{'ok':!![]};throw _0x37c424;}const _0x3f644f=await askConfirm('\x20\x20Create\x20'+_0x356fe8['length']+_0x3734cd(0x190)+_0x16d839+_0x3734cd(0x181)+_0x30f8e5+'?');if(!_0x3f644f)return console[_0x3734cd(0x198)](a56_0x10b93b[_0x3734cd(0x179)]('\x20\x20Cancelled.')),{'ok':!![]};const _0x131b90=[_0x16d839,_0x30f8e5],_0x3e4480=startSpinner(_0x3734cd(0x18d)+_0x356fe8['length']+_0x3734cd(0x19a));try{const _0x4010a4=await doCreateMenus(_0x2eccf9[_0x3734cd(0x184)],_0x2eccf9[_0x3734cd(0x192)],_0x356fe8,_0x131b90);return stopSpinner(_0x3e4480,_0x3734cd(0x196)+_0x4010a4[_0x3734cd(0x17f)]+_0x3734cd(0x1a6),!![]),{'ok':!![],'data':_0x4010a4,'message':_0x3734cd(0x1a5)+_0x4010a4[_0x3734cd(0x17f)]+_0x3734cd(0x189)+_0x4010a4[_0x3734cd(0x185)]+_0x3734cd(0x19d)};}catch(_0x52bf79){stopSpinner(_0x3e4480,_0x3734cd(0x187),![]);throw CliErrors['validation'](_0x52bf79 instanceof Error?_0x52bf79['message']:_0x3734cd(0x187));}}};function a56_0x79b3(_0x2b9067,_0x1c453c){_0x2b9067=_0x2b9067-0x177;const _0x33e262=a56_0x33e2();let _0x79b3b2=_0x33e262[_0x2b9067];return _0x79b3b2;}function parseParams(_0x52f331){const _0x2d38e8=a56_0xdb1631;if(!_0x52f331)return{};try{const _0x37d18b=JSON[_0x2d38e8(0x1a1)](_0x52f331);if(typeof _0x37d18b!==_0x2d38e8(0x188)||_0x37d18b===null||Array['isArray'](_0x37d18b))return{};return{'jsUrl':typeof _0x37d18b[_0x2d38e8(0x18a)]===_0x2d38e8(0x195)?_0x37d18b[_0x2d38e8(0x18a)][_0x2d38e8(0x177)]():undefined,'cssUrl':typeof _0x37d18b[_0x2d38e8(0x17e)]===_0x2d38e8(0x195)?_0x37d18b['cssUrl'][_0x2d38e8(0x177)]():undefined,'pages':Array[_0x2d38e8(0x1ad)](_0x37d18b[_0x2d38e8(0x1a0)])?_0x37d18b[_0x2d38e8(0x1a0)]['map'](String):undefined};}catch{return{};}}
1
+ const a56_0x29ff5f=a56_0x2dfa;(function(_0x17a470,_0x590f06){const _0x3d84a5=a56_0x2dfa,_0x3d5b0a=_0x17a470();while(!![]){try{const _0x282be3=parseInt(_0x3d84a5(0x1e6))/0x1+parseInt(_0x3d84a5(0x1ee))/0x2*(parseInt(_0x3d84a5(0x1cc))/0x3)+parseInt(_0x3d84a5(0x1c8))/0x4*(parseInt(_0x3d84a5(0x1ed))/0x5)+parseInt(_0x3d84a5(0x1bf))/0x6+parseInt(_0x3d84a5(0x1bb))/0x7*(-parseInt(_0x3d84a5(0x1d9))/0x8)+parseInt(_0x3d84a5(0x1c5))/0x9*(parseInt(_0x3d84a5(0x1dd))/0xa)+-parseInt(_0x3d84a5(0x1b8))/0xb*(parseInt(_0x3d84a5(0x1ea))/0xc);if(_0x282be3===_0x590f06)break;else _0x3d5b0a['push'](_0x3d5b0a['shift']());}catch(_0x482e71){_0x3d5b0a['push'](_0x3d5b0a['shift']());}}}(a56_0x529f,0x543bf));import a56_0x17a83b from'chalk';import{buildCompareRows,doCreateMenus,fetchMenuData}from'./shared/logic.js';import{renderCompareTable,renderSyncSummary}from'./shared/compare-table.js';function a56_0x2dfa(_0x54e430,_0x4d6095){_0x54e430=_0x54e430-0x1b5;const _0x529fc3=a56_0x529f();let _0x2dfa8c=_0x529fc3[_0x54e430];return _0x2dfa8c;}function a56_0x529f(){const _0x5df53f=['boolean','27478vvgZap','string','Failed\x20to\x20fetch\x20online\x20menu\x20list','161teebei','validation','Menu\x20sync\x20completed:\x20','trim','2568294FSzDjs','sync','Created\x20','Non-interactive:\x20auto-create\x20all\x20local\x20pages\x20not\x20yet\x20on\x20platform','\x20failed.','cssUrl','266913zNhEvm','onlineMenuList','log','20xJkaTa','Menu\x20creation\x20failed','!\x20No\x20local\x20pages\x20found\x20in\x20src/pages','message','6Qfbcyn','\x20menu(s)','created','\x20and\x20CSS:\x20','gray','length','object','JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22,\x22pages\x22:[\x22Page1\x22]}','CANCEL','\x20page(s)','\x20menu(s)\x20with\x20JS:\x20','\x20\x20Cancelled.','pages','26040KGjaJh','appCode','size','write','150PnacCm','localPages','Pre-fill\x20JS/CSS\x20URLs\x20and/or\x20select\x20specific\x20pages.\x20','skipped','failed','jsUrl','\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first','params','isArray','604624gzbOxz','\x20\x20Create\x20','yes','Creating\x20','10644VZUYrj','cookie','\x20\x20✓\x20Selected:\x20','630550gpaepy','527536JhQYue','Online\x20menu\x20list\x20fetched','✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform','\x20menu(s)\x20created','onlinePaths','menu'];a56_0x529f=function(){return _0x5df53f;};return a56_0x529f();}import{selectPages,askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'./shared/inquirer.js';import{CliErrors}from'../../errors.js';import{runMenuSyncCore,readPageLabelsFromStdin}from'./shared/sync-core.js';import{getLocalPages}from'./shared/local-pages.js';export const menuSync={'service':a56_0x29ff5f(0x1b6),'command':a56_0x29ff5f(0x1c0),'description':'Sync\x20local\x20pages\x20as\x20platform\x20menus','risk':a56_0x29ff5f(0x1dc),'flags':[{'name':a56_0x29ff5f(0x1e4),'type':'string','description':a56_0x29ff5f(0x1df)+a56_0x29ff5f(0x1d3)},{'name':a56_0x29ff5f(0x1e8),'type':a56_0x29ff5f(0x1b7),'description':a56_0x29ff5f(0x1c2)}],async 'execute'(_0x47120e){const _0x1d95d2=a56_0x29ff5f,_0xc4b0fb=_0x47120e['flag']('yes'),_0x4228f0=_0x47120e['str'](_0x1d95d2(0x1e4)),_0x4fe108=parseParams(_0x4228f0),_0x36f761=!!(_0x4fe108[_0x1d95d2(0x1e2)]||_0x4fe108[_0x1d95d2(0x1c4)]||_0x4fe108[_0x1d95d2(0x1d8)]&&_0x4fe108[_0x1d95d2(0x1d8)]['length']>0x0);if(_0xc4b0fb||_0x36f761){let _0x44f542=[];!isInteractive()&&!_0x4fe108['pages']?.[_0x1d95d2(0x1d1)]&&(_0x44f542=await readPageLabelsFromStdin());const _0x27da6d=await runMenuSyncCore(_0x47120e[_0x1d95d2(0x1da)],_0x47120e[_0x1d95d2(0x1eb)],_0x44f542[_0x1d95d2(0x1d1)]>0x0?_0x44f542:_0x4fe108[_0x1d95d2(0x1d8)]??[],_0x4228f0);if(_0x27da6d[_0x1d95d2(0x1e0)]){const _0x21738e=getLocalPages();_0x21738e[_0x1d95d2(0x1d1)]===0x0?console[_0x1d95d2(0x1c7)](_0x1d95d2(0x1ca)):console['log'](_0x1d95d2(0x1f0));}else console[_0x1d95d2(0x1c7)]('✓\x20Menu\x20sync\x20completed:\x20'+_0x27da6d[_0x1d95d2(0x1ce)]+_0x1d95d2(0x1f1));return{'ok':!![]};}requireInteractive();const _0x584118=startSpinner('Fetching\x20online\x20menu\x20list...');let _0x371e37,_0x12a54d,_0x1c4639;try{const _0x1a340b=await fetchMenuData(_0x47120e[_0x1d95d2(0x1da)],_0x47120e[_0x1d95d2(0x1eb)]);_0x371e37=_0x1a340b[_0x1d95d2(0x1de)],_0x12a54d=_0x1a340b[_0x1d95d2(0x1b5)],_0x1c4639=_0x1a340b[_0x1d95d2(0x1c6)],stopSpinner(_0x584118,_0x1d95d2(0x1ef),!![]);}catch(_0xf1540d){stopSpinner(_0x584118,_0x1d95d2(0x1ba),![]);throw CliErrors[_0x1d95d2(0x1bc)](_0xf1540d instanceof Error?_0xf1540d[_0x1d95d2(0x1cb)]:_0x1d95d2(0x1ba));}if(_0x371e37[_0x1d95d2(0x1d1)]===0x0)return console[_0x1d95d2(0x1c7)](a56_0x17a83b['yellow'](_0x1d95d2(0x1e3))),{'ok':!![]};const _0x182e59=buildCompareRows(_0x371e37,_0x12a54d);console[_0x1d95d2(0x1c7)](renderCompareTable(_0x182e59)),console['log']();const _0x57c840=_0x4fe108[_0x1d95d2(0x1d8)],_0x10038d=await selectPages(_0x371e37,_0x12a54d,_0x57c840);console['log'](),console[_0x1d95d2(0x1c7)](a56_0x17a83b['cyan'](_0x1d95d2(0x1ec)+_0x10038d['length']+_0x1d95d2(0x1d5)));const _0x63fbb7=_0x4fe108[_0x1d95d2(0x1e2)]&&_0x4fe108['cssUrl'];if(!_0x63fbb7){console[_0x1d95d2(0x1c7)](renderSyncSummary(_0x10038d,_0x12a54d[_0x1d95d2(0x1db)]>0x0));const _0x387778=await askConfirm('\x20\x20Continue\x20with\x20creation?');if(!_0x387778)return console['log'](a56_0x17a83b[_0x1d95d2(0x1d0)](_0x1d95d2(0x1d7))),{'ok':!![]};}let _0x49b76c=_0x4fe108[_0x1d95d2(0x1e2)],_0x1088a8=_0x4fe108[_0x1d95d2(0x1c4)];if(!_0x49b76c)try{_0x49b76c=await askJsUrl();}catch(_0xc5ce29){if(_0xc5ce29['message']==='CANCEL')return console[_0x1d95d2(0x1c7)](a56_0x17a83b[_0x1d95d2(0x1d0)](_0x1d95d2(0x1d7))),{'ok':!![]};throw _0xc5ce29;}if(!_0x1088a8)try{_0x1088a8=await askCssUrl();}catch(_0x127054){if(_0x127054['message']===_0x1d95d2(0x1d4))return console['log'](a56_0x17a83b['gray'](_0x1d95d2(0x1d7))),{'ok':!![]};throw _0x127054;}const _0x5bc6e6=await askConfirm(_0x1d95d2(0x1e7)+_0x10038d[_0x1d95d2(0x1d1)]+_0x1d95d2(0x1d6)+_0x49b76c+_0x1d95d2(0x1cf)+_0x1088a8+'?');if(!_0x5bc6e6)return console['log'](a56_0x17a83b[_0x1d95d2(0x1d0)](_0x1d95d2(0x1d7))),{'ok':!![]};const _0x4dbf12=[_0x49b76c,_0x1088a8],_0xe098ba=startSpinner(_0x1d95d2(0x1e9)+_0x10038d[_0x1d95d2(0x1d1)]+'\x20menu(s)...');try{const _0x30b3b3=await doCreateMenus(_0x47120e[_0x1d95d2(0x1da)],_0x47120e['cookie'],_0x10038d,_0x4dbf12);return stopSpinner(_0xe098ba,_0x1d95d2(0x1c1)+_0x30b3b3[_0x1d95d2(0x1ce)]+_0x1d95d2(0x1cd),!![]),{'ok':!![],'data':_0x30b3b3,'message':_0x1d95d2(0x1bd)+_0x30b3b3[_0x1d95d2(0x1ce)]+'\x20created,\x20'+_0x30b3b3[_0x1d95d2(0x1e1)]+_0x1d95d2(0x1c3)};}catch(_0x160e48){stopSpinner(_0xe098ba,_0x1d95d2(0x1c9),![]);throw CliErrors['validation'](_0x160e48 instanceof Error?_0x160e48[_0x1d95d2(0x1cb)]:_0x1d95d2(0x1c9));}}};function parseParams(_0x47ce38){const _0x5be256=a56_0x29ff5f;if(!_0x47ce38)return{};try{const _0x51ef16=JSON['parse'](_0x47ce38);if(typeof _0x51ef16!==_0x5be256(0x1d2)||_0x51ef16===null||Array[_0x5be256(0x1e5)](_0x51ef16))return{};return{'jsUrl':typeof _0x51ef16['jsUrl']==='string'?_0x51ef16[_0x5be256(0x1e2)]['trim']():undefined,'cssUrl':typeof _0x51ef16[_0x5be256(0x1c4)]===_0x5be256(0x1b9)?_0x51ef16['cssUrl'][_0x5be256(0x1be)]():undefined,'pages':Array[_0x5be256(0x1e5)](_0x51ef16[_0x5be256(0x1d8)])?_0x51ef16[_0x5be256(0x1d8)]['map'](String):undefined};}catch{return{};}}
@@ -1 +1 @@
1
- const a57_0x3118e6=a57_0x446c;function a57_0x446c(_0x5d2a25,_0x11c463){_0x5d2a25=_0x5d2a25-0xa4;const _0x191921=a57_0x1919();let _0x446c21=_0x191921[_0x5d2a25];return _0x446c21;}(function(_0xad1f6,_0x1357e6){const _0x5929b4=a57_0x446c,_0x1ef82a=_0xad1f6();while(!![]){try{const _0x515fc6=parseInt(_0x5929b4(0xba))/0x1*(-parseInt(_0x5929b4(0xd0))/0x2)+parseInt(_0x5929b4(0xc8))/0x3*(parseInt(_0x5929b4(0xc2))/0x4)+parseInt(_0x5929b4(0xb4))/0x5*(parseInt(_0x5929b4(0xd5))/0x6)+parseInt(_0x5929b4(0xaf))/0x7*(parseInt(_0x5929b4(0xac))/0x8)+parseInt(_0x5929b4(0xbb))/0x9+parseInt(_0x5929b4(0xd1))/0xa*(-parseInt(_0x5929b4(0xd3))/0xb)+-parseInt(_0x5929b4(0xc7))/0xc;if(_0x515fc6===_0x1357e6)break;else _0x1ef82a['push'](_0x1ef82a['shift']());}catch(_0x469da3){_0x1ef82a['push'](_0x1ef82a['shift']());}}}(a57_0x1919,0x4cb08));import a57_0x25fac9 from'chalk';import{filterMenusWithResources,doUpdateCdnUrls,fetchOnlineMenuList}from'./shared/logic.js';import{renderUpdateSummary}from'./shared/compare-table.js';import{askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'./shared/inquirer.js';import{CliErrors}from'../../errors.js';function a57_0x1919(){const _0x510b6a=['isArray','cookie','2002UEDNsD','log','params','Fetching\x20online\x20menu\x20list...','flag','251135qlTjdH','CANCEL','length','boolean','map','Failed\x20to\x20fetch\x20online\x20menu\x20list','3643sQRARr','4111749xshOGx','\x20updated.','\x20\x20!\x20No\x20menus\x20with\x20existing\x20resources\x20found','appCode','yes','update','label','68fOomtk','!\x20No\x20menus\x20with\x20existing\x20resources\x20found','jsUrl','string','\x20\x20Cancelled.','9693468aNtkES','82437YYPLiK','Updated\x20','error','Pre-fill\x20JS/CSS\x20URLs\x20to\x20update.\x20','cyan','\x20menu(s)\x20updated','\x20menu(s)...','str','2xWISQr','430oakGwg','\x20\x20Update\x20','98296khcENA','Updating\x20','12fBoiIW','\x20failed.','\x20and\x20CSS:\x20','✓\x20Menu\x20update\x20completed:\x20','failed','Menu\x20update\x20failed','\x20menu(s)\x20with\x20JS:\x20','Menu\x20update\x20completed:\x20','updated','gray','Non-interactive:\x20update\x20all\x20menus\x20without\x20confirmation','message','validation','Update\x20CDN\x20asset\x20URLs\x20for\x20all\x20online\x20menus\x20with\x20existing\x20resources','JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}','cssUrl','trim','13576Oafxbm'];a57_0x1919=function(){return _0x510b6a;};return a57_0x1919();}import{runMenuUpdateCore}from'./shared/update-core.js';export const menuUpdate={'service':'menu','command':a57_0x3118e6(0xc0),'description':a57_0x3118e6(0xa8),'risk':'write','flags':[{'name':a57_0x3118e6(0xb1),'type':a57_0x3118e6(0xc5),'description':a57_0x3118e6(0xcb)+a57_0x3118e6(0xa9)},{'name':a57_0x3118e6(0xbf),'type':a57_0x3118e6(0xb7),'description':a57_0x3118e6(0xa5)}],async 'execute'(_0x3c04a2){const _0x2bf6d0=a57_0x3118e6,_0x3e5212=_0x3c04a2[_0x2bf6d0(0xb3)](_0x2bf6d0(0xbf)),_0x38a941=_0x3c04a2[_0x2bf6d0(0xcf)](_0x2bf6d0(0xb1)),_0x5c79b1=parseParams(_0x38a941),_0x1897d=!!(_0x5c79b1[_0x2bf6d0(0xc4)]||_0x5c79b1['cssUrl']);if(_0x3e5212||_0x1897d&&!isInteractive()){const _0x317595=await runMenuUpdateCore(_0x3c04a2[_0x2bf6d0(0xbe)],_0x3c04a2[_0x2bf6d0(0xae)],_0x38a941);return _0x317595['skipped']?console[_0x2bf6d0(0xb0)](_0x2bf6d0(0xc3)):(console[_0x2bf6d0(0xb0)](_0x2bf6d0(0xd8)+_0x317595['updated']+_0x2bf6d0(0xcd)),_0x317595[_0x2bf6d0(0xd9)]>0x0&&console[_0x2bf6d0(0xca)]('!\x20'+_0x317595[_0x2bf6d0(0xd9)]+'\x20menu(s)\x20failed')),{'ok':_0x317595[_0x2bf6d0(0xd9)]===0x0};}requireInteractive();const _0x1c5261=startSpinner(_0x2bf6d0(0xb2));let _0x5b2f28;try{_0x5b2f28=await fetchOnlineMenuList(_0x3c04a2[_0x2bf6d0(0xbe)],_0x3c04a2[_0x2bf6d0(0xae)]),stopSpinner(_0x1c5261,'Online\x20menu\x20list\x20fetched',!![]);}catch(_0x106d27){stopSpinner(_0x1c5261,_0x2bf6d0(0xb9),![]);throw CliErrors[_0x2bf6d0(0xa7)](_0x106d27 instanceof Error?_0x106d27[_0x2bf6d0(0xa6)]:_0x2bf6d0(0xb9));}const _0x52a0d9=filterMenusWithResources(_0x5b2f28);if(_0x52a0d9[_0x2bf6d0(0xb6)]===0x0)return console['log'](a57_0x25fac9['yellow'](_0x2bf6d0(0xbd))),{'ok':!![]};console[_0x2bf6d0(0xb0)](),console[_0x2bf6d0(0xb0)](a57_0x25fac9[_0x2bf6d0(0xcc)]('\x20\x20Found\x20'+_0x52a0d9[_0x2bf6d0(0xb6)]+'\x20menu(s)\x20with\x20existing\x20resources')),console[_0x2bf6d0(0xb0)](renderUpdateSummary(_0x52a0d9[_0x2bf6d0(0xb8)](_0x5a5ec9=>_0x5a5ec9[_0x2bf6d0(0xc1)]),[_0x5c79b1[_0x2bf6d0(0xc4)],_0x5c79b1[_0x2bf6d0(0xaa)]])),console[_0x2bf6d0(0xb0)]();let _0x502420=_0x5c79b1[_0x2bf6d0(0xc4)],_0x48ac5f=_0x5c79b1[_0x2bf6d0(0xaa)];if(!_0x502420)try{_0x502420=await askJsUrl();}catch(_0x2a25c4){if(_0x2a25c4[_0x2bf6d0(0xa6)]===_0x2bf6d0(0xb5))return console[_0x2bf6d0(0xb0)](a57_0x25fac9[_0x2bf6d0(0xa4)](_0x2bf6d0(0xc6))),{'ok':!![]};throw _0x2a25c4;}if(!_0x48ac5f)try{_0x48ac5f=await askCssUrl();}catch(_0xbaca9e){if(_0xbaca9e[_0x2bf6d0(0xa6)]===_0x2bf6d0(0xb5))return console[_0x2bf6d0(0xb0)](a57_0x25fac9['gray']('\x20\x20Cancelled.')),{'ok':!![]};throw _0xbaca9e;}const _0x5f490b=await askConfirm(_0x2bf6d0(0xd2)+_0x52a0d9['length']+_0x2bf6d0(0xdb)+_0x502420+_0x2bf6d0(0xd7)+_0x48ac5f+'?');if(!_0x5f490b)return console['log'](a57_0x25fac9['gray'](_0x2bf6d0(0xc6))),{'ok':!![]};const _0x36892b=[_0x502420,_0x48ac5f],_0x3a935f=startSpinner(_0x2bf6d0(0xd4)+_0x52a0d9[_0x2bf6d0(0xb6)]+_0x2bf6d0(0xce));try{const _0x51fe63=await doUpdateCdnUrls(_0x3c04a2[_0x2bf6d0(0xbe)],_0x3c04a2[_0x2bf6d0(0xae)],_0x52a0d9,_0x36892b);return stopSpinner(_0x3a935f,_0x2bf6d0(0xc9)+_0x51fe63[_0x2bf6d0(0xdd)]+'\x20menu(s)',_0x51fe63[_0x2bf6d0(0xd9)]===0x0),{'ok':_0x51fe63[_0x2bf6d0(0xd9)]===0x0,'data':_0x51fe63,'message':_0x51fe63[_0x2bf6d0(0xd9)]>0x0?'Menu\x20update\x20completed:\x20'+_0x51fe63[_0x2bf6d0(0xdd)]+'\x20updated,\x20'+_0x51fe63[_0x2bf6d0(0xd9)]+_0x2bf6d0(0xd6):_0x2bf6d0(0xdc)+_0x51fe63['updated']+_0x2bf6d0(0xbc)};}catch(_0xc6b2a8){stopSpinner(_0x3a935f,'Menu\x20update\x20failed',![]);throw CliErrors[_0x2bf6d0(0xa7)](_0xc6b2a8 instanceof Error?_0xc6b2a8[_0x2bf6d0(0xa6)]:_0x2bf6d0(0xda));}}};function parseParams(_0x30a644){const _0x21ed1c=a57_0x3118e6;if(!_0x30a644)return{};try{const _0x59e262=JSON['parse'](_0x30a644);if(typeof _0x59e262!=='object'||_0x59e262===null||Array[_0x21ed1c(0xad)](_0x59e262))return{};return{'jsUrl':typeof _0x59e262[_0x21ed1c(0xc4)]===_0x21ed1c(0xc5)?_0x59e262[_0x21ed1c(0xc4)][_0x21ed1c(0xab)]():undefined,'cssUrl':typeof _0x59e262[_0x21ed1c(0xaa)]===_0x21ed1c(0xc5)?_0x59e262[_0x21ed1c(0xaa)][_0x21ed1c(0xab)]():undefined};}catch{return{};}}
1
+ function a57_0x3635(){const _0x5b5fd2=['validation','boolean','log','label','Updating\x20','JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}','params','jsUrl','map','Online\x20menu\x20list\x20fetched','\x20menu(s)...','\x20\x20Update\x20','gray','2016654oIqrWr','Updated\x20','trim','280TtVKNz','flag','yes','\x20menu(s)\x20updated','cyan','1242152VlNYyY','41616dRamom','parse','string','Pre-fill\x20JS/CSS\x20URLs\x20to\x20update.\x20','Failed\x20to\x20fetch\x20online\x20menu\x20list','error','\x20menu(s)\x20failed','\x20\x20Found\x20','str','length','\x20menu(s)\x20with\x20JS:\x20','7612mqfqdX','✓\x20Menu\x20update\x20completed:\x20','\x20and\x20CSS:\x20','\x20\x20Cancelled.','message','failed','write','Menu\x20update\x20completed:\x20','cssUrl','30388LPVxIi','179808vpGGbN','isArray','123gPcYDK','\x20updated,\x20','7NmRihc','updated','\x20failed.','Non-interactive:\x20update\x20all\x20menus\x20without\x20confirmation','CANCEL','cookie','skipped','1803160NghTNr','\x20menu(s)\x20with\x20existing\x20resources','appCode','Update\x20CDN\x20asset\x20URLs\x20for\x20all\x20online\x20menus\x20with\x20existing\x20resources','Menu\x20update\x20failed'];a57_0x3635=function(){return _0x5b5fd2;};return a57_0x3635();}const a57_0x50943f=a57_0x1ddc;(function(_0x271f69,_0x55d3f6){const _0x54de17=a57_0x1ddc,_0x17f4c5=_0x271f69();while(!![]){try{const _0x1ad56f=parseInt(_0x54de17(0x203))/0x1+-parseInt(_0x54de17(0x202))/0x2+parseInt(_0x54de17(0x205))/0x3*(parseInt(_0x54de17(0x1f9))/0x4)+-parseInt(_0x54de17(0x20e))/0x5+-parseInt(_0x54de17(0x1e5))/0x6*(-parseInt(_0x54de17(0x207))/0x7)+-parseInt(_0x54de17(0x1ed))/0x8+parseInt(_0x54de17(0x1ee))/0x9*(parseInt(_0x54de17(0x1e8))/0xa);if(_0x1ad56f===_0x55d3f6)break;else _0x17f4c5['push'](_0x17f4c5['shift']());}catch(_0x1c8e83){_0x17f4c5['push'](_0x17f4c5['shift']());}}}(a57_0x3635,0x2ef3d));import a57_0x14e504 from'chalk';import{filterMenusWithResources,doUpdateCdnUrls,fetchOnlineMenuList}from'./shared/logic.js';import{renderUpdateSummary}from'./shared/compare-table.js';import{askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'./shared/inquirer.js';function a57_0x1ddc(_0xd89d59,_0x83dc85){_0xd89d59=_0xd89d59-0x1dd;const _0x36357c=a57_0x3635();let _0x1ddc03=_0x36357c[_0xd89d59];return _0x1ddc03;}import{CliErrors}from'../../errors.js';import{runMenuUpdateCore}from'./shared/update-core.js';export const menuUpdate={'service':'menu','command':'update','description':a57_0x50943f(0x211),'risk':a57_0x50943f(0x1ff),'flags':[{'name':a57_0x50943f(0x1de),'type':a57_0x50943f(0x1f0),'description':a57_0x50943f(0x1f1)+a57_0x50943f(0x1dd)},{'name':a57_0x50943f(0x1ea),'type':a57_0x50943f(0x214),'description':a57_0x50943f(0x20a)}],async 'execute'(_0x515cf8){const _0x5c1389=a57_0x50943f,_0x57e9fa=_0x515cf8[_0x5c1389(0x1e9)](_0x5c1389(0x1ea)),_0x23a69d=_0x515cf8[_0x5c1389(0x1f6)]('params'),_0x1f8ecd=parseParams(_0x23a69d),_0x48c244=!!(_0x1f8ecd[_0x5c1389(0x1df)]||_0x1f8ecd[_0x5c1389(0x201)]);if(_0x57e9fa||_0x48c244&&!isInteractive()){const _0x416aaf=await runMenuUpdateCore(_0x515cf8['appCode'],_0x515cf8['cookie'],_0x23a69d);return _0x416aaf[_0x5c1389(0x20d)]?console[_0x5c1389(0x215)]('!\x20No\x20menus\x20with\x20existing\x20resources\x20found'):(console['log'](_0x5c1389(0x1fa)+_0x416aaf[_0x5c1389(0x208)]+_0x5c1389(0x1eb)),_0x416aaf['failed']>0x0&&console[_0x5c1389(0x1f3)]('!\x20'+_0x416aaf[_0x5c1389(0x1fe)]+_0x5c1389(0x1f4))),{'ok':_0x416aaf['failed']===0x0};}requireInteractive();const _0x4d3040=startSpinner('Fetching\x20online\x20menu\x20list...');let _0x230709;try{_0x230709=await fetchOnlineMenuList(_0x515cf8['appCode'],_0x515cf8[_0x5c1389(0x20c)]),stopSpinner(_0x4d3040,_0x5c1389(0x1e1),!![]);}catch(_0x57a5c6){stopSpinner(_0x4d3040,_0x5c1389(0x1f2),![]);throw CliErrors[_0x5c1389(0x213)](_0x57a5c6 instanceof Error?_0x57a5c6['message']:'Failed\x20to\x20fetch\x20online\x20menu\x20list');}const _0x2bfadb=filterMenusWithResources(_0x230709);if(_0x2bfadb['length']===0x0)return console[_0x5c1389(0x215)](a57_0x14e504['yellow']('\x20\x20!\x20No\x20menus\x20with\x20existing\x20resources\x20found')),{'ok':!![]};console['log'](),console[_0x5c1389(0x215)](a57_0x14e504[_0x5c1389(0x1ec)](_0x5c1389(0x1f5)+_0x2bfadb['length']+_0x5c1389(0x20f))),console[_0x5c1389(0x215)](renderUpdateSummary(_0x2bfadb[_0x5c1389(0x1e0)](_0x271103=>_0x271103[_0x5c1389(0x216)]),[_0x1f8ecd['jsUrl'],_0x1f8ecd['cssUrl']])),console[_0x5c1389(0x215)]();let _0x45b5ad=_0x1f8ecd[_0x5c1389(0x1df)],_0x3202bc=_0x1f8ecd['cssUrl'];if(!_0x45b5ad)try{_0x45b5ad=await askJsUrl();}catch(_0x4e7f5e){if(_0x4e7f5e['message']===_0x5c1389(0x20b))return console['log'](a57_0x14e504[_0x5c1389(0x1e4)](_0x5c1389(0x1fc))),{'ok':!![]};throw _0x4e7f5e;}if(!_0x3202bc)try{_0x3202bc=await askCssUrl();}catch(_0x388257){if(_0x388257['message']===_0x5c1389(0x20b))return console[_0x5c1389(0x215)](a57_0x14e504[_0x5c1389(0x1e4)](_0x5c1389(0x1fc))),{'ok':!![]};throw _0x388257;}const _0x8ee9b1=await askConfirm(_0x5c1389(0x1e3)+_0x2bfadb[_0x5c1389(0x1f7)]+_0x5c1389(0x1f8)+_0x45b5ad+_0x5c1389(0x1fb)+_0x3202bc+'?');if(!_0x8ee9b1)return console[_0x5c1389(0x215)](a57_0x14e504[_0x5c1389(0x1e4)](_0x5c1389(0x1fc))),{'ok':!![]};const _0x21a36b=[_0x45b5ad,_0x3202bc],_0x5cd2a5=startSpinner(_0x5c1389(0x217)+_0x2bfadb[_0x5c1389(0x1f7)]+_0x5c1389(0x1e2));try{const _0x4af7cb=await doUpdateCdnUrls(_0x515cf8[_0x5c1389(0x210)],_0x515cf8[_0x5c1389(0x20c)],_0x2bfadb,_0x21a36b);return stopSpinner(_0x5cd2a5,_0x5c1389(0x1e6)+_0x4af7cb[_0x5c1389(0x208)]+'\x20menu(s)',_0x4af7cb[_0x5c1389(0x1fe)]===0x0),{'ok':_0x4af7cb['failed']===0x0,'data':_0x4af7cb,'message':_0x4af7cb['failed']>0x0?_0x5c1389(0x200)+_0x4af7cb[_0x5c1389(0x208)]+_0x5c1389(0x206)+_0x4af7cb[_0x5c1389(0x1fe)]+_0x5c1389(0x209):_0x5c1389(0x200)+_0x4af7cb[_0x5c1389(0x208)]+'\x20updated.'};}catch(_0x2a825f){stopSpinner(_0x5cd2a5,_0x5c1389(0x212),![]);throw CliErrors[_0x5c1389(0x213)](_0x2a825f instanceof Error?_0x2a825f[_0x5c1389(0x1fd)]:'Menu\x20update\x20failed');}}};function parseParams(_0x172150){const _0x13d480=a57_0x50943f;if(!_0x172150)return{};try{const _0x569851=JSON[_0x13d480(0x1ef)](_0x172150);if(typeof _0x569851!=='object'||_0x569851===null||Array[_0x13d480(0x204)](_0x569851))return{};return{'jsUrl':typeof _0x569851[_0x13d480(0x1df)]===_0x13d480(0x1f0)?_0x569851[_0x13d480(0x1df)][_0x13d480(0x1e7)]():undefined,'cssUrl':typeof _0x569851['cssUrl']===_0x13d480(0x1f0)?_0x569851['cssUrl'][_0x13d480(0x1e7)]():undefined};}catch{return{};}}
@@ -1 +1 @@
1
- const a58_0x560f18=a58_0x3461;function a58_0x3461(_0x531b16,_0x2cae13){_0x531b16=_0x531b16-0x164;const _0x38ff20=a58_0x38ff();let _0x346180=_0x38ff20[_0x531b16];return _0x346180;}(function(_0x217962,_0x1f6ed1){const _0x27511a=a58_0x3461,_0x4463be=_0x217962();while(!![]){try{const _0x378786=-parseInt(_0x27511a(0x16e))/0x1+parseInt(_0x27511a(0x186))/0x2*(parseInt(_0x27511a(0x171))/0x3)+-parseInt(_0x27511a(0x17e))/0x4+-parseInt(_0x27511a(0x187))/0x5+-parseInt(_0x27511a(0x17f))/0x6*(-parseInt(_0x27511a(0x16a))/0x7)+-parseInt(_0x27511a(0x172))/0x8*(-parseInt(_0x27511a(0x168))/0x9)+parseInt(_0x27511a(0x17a))/0xa;if(_0x378786===_0x1f6ed1)break;else _0x4463be['push'](_0x4463be['shift']());}catch(_0x4ae4c6){_0x4463be['push'](_0x4463be['shift']());}}}(a58_0x38ff,0x44756));import{delimiter,join}from'node:path';import{spawn}from'node:child_process';function runPreview(_0x5f2ce6){return new Promise((_0x430bdc,_0x8a792)=>{const _0x496ac2=a58_0x3461,_0x3cc5cf=Date[_0x496ac2(0x175)]();_0x5f2ce6['logger']['info']('preview',_0x496ac2(0x16c),{'command':'vite\x20preview'});let _0x3d66ea='';const _0x4b1fb5=spawn(_0x496ac2(0x166),[_0x496ac2(0x183)],{'stdio':[_0x496ac2(0x184),'inherit','pipe'],'shell':!![],'env':{...process['env'],'PATH':''+join(process[_0x496ac2(0x167)](),'node_modules',_0x496ac2(0x181))+delimiter+process[_0x496ac2(0x16f)][_0x496ac2(0x165)]}});_0x4b1fb5[_0x496ac2(0x185)]?.['on']('data',_0x4fff26=>{_0x3d66ea+=_0x4fff26['toString']();}),_0x4b1fb5['on'](_0x496ac2(0x16d),_0x5677cb=>{const _0x2d785d=_0x496ac2,_0x1e08a1=Date[_0x2d785d(0x175)]()-_0x3cc5cf;if(_0x5677cb===0x0||_0x5677cb===null)_0x5f2ce6[_0x2d785d(0x176)]['success'](_0x2d785d(0x183),'预览服务器启动成功',_0x1e08a1),_0x430bdc();else{const _0x19588f={'exitCode':_0x5677cb,'duration':_0x1e08a1,'command':_0x2d785d(0x177),'cwd':process[_0x2d785d(0x167)]()};_0x3d66ea[_0x2d785d(0x17b)]()&&(_0x19588f[_0x2d785d(0x185)]=_0x3d66ea[_0x2d785d(0x17b)]()),_0x5f2ce6['logger']['error'](_0x2d785d(0x183),_0x2d785d(0x173),_0x19588f),_0x8a792(new Error(_0x2d785d(0x182)+_0x5677cb));}}),_0x4b1fb5['on'](_0x496ac2(0x16b),_0x3f93dd=>{const _0x2b1da4=_0x496ac2,_0x54ed49=Date[_0x2b1da4(0x175)]()-_0x3cc5cf;_0x5f2ce6[_0x2b1da4(0x176)]['error']('preview',_0x2b1da4(0x17c),{'error':_0x3f93dd[_0x2b1da4(0x179)],'duration':_0x54ed49,'stderr':_0x3d66ea[_0x2b1da4(0x17b)]()||undefined}),_0x8a792(_0x3f93dd);});});}function runBuildWatch(){return new Promise((_0x22f7d6,_0x1889df)=>{const _0x5e389e=a58_0x3461,_0x1aa495=spawn(_0x5e389e(0x166),['build',_0x5e389e(0x164)],{'stdio':_0x5e389e(0x184),'shell':!![],'env':{...process[_0x5e389e(0x16f)],'PATH':''+join(process[_0x5e389e(0x167)](),_0x5e389e(0x17d),_0x5e389e(0x181))+delimiter+process['env'][_0x5e389e(0x165)]}});_0x1aa495['on'](_0x5e389e(0x16d),_0x146d47=>{const _0x32d48c=_0x5e389e;if(_0x146d47===0x0||_0x146d47===null)_0x22f7d6();else _0x1889df(new Error(_0x32d48c(0x169)+_0x146d47));}),_0x1aa495['on']('error',_0x1889df);});}export const previewCommand={'name':a58_0x560f18(0x183),'description':'Preview\x20project',async 'run'(_0x42740d,_0x4544b8,_0x48c170){const _0xf9a41=a58_0x560f18,_0x45d8c1=_0x48c170[_0xf9a41(0x180)];_0x42740d[_0xf9a41(0x176)]['info'](_0xf9a41(0x183),_0xf9a41(0x170)+(_0x45d8c1?_0xf9a41(0x178):'')),_0x45d8c1?await Promise[_0xf9a41(0x174)]([runBuildWatch(),runPreview(_0x42740d)]):await runPreview(_0x42740d);}};function a58_0x38ff(){const _0x15465f=['now','logger','vite\x20preview','\x20(监听模式)','message','543360SfErQf','trim','预览服务器启动出错','node_modules','685540FrHTlv','402FdRlZZ','watch','.bin','vite\x20preview\x20exited\x20with\x20code\x20','preview','inherit','stderr','1064170GZSYls','643980UCIfsD','--watch','PATH','vite','cwd','519381ZRLWeZ','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','13489tqOreU','error','启动预览服务器','close','365779HSrKdo','env','执行预览命令','3yMIysl','32sgjokD','预览服务器启动失败','all'];a58_0x38ff=function(){return _0x15465f;};return a58_0x38ff();}
1
+ const a58_0x129a07=a58_0x4a37;(function(_0x32badd,_0x3e2de8){const _0x54a2ad=a58_0x4a37,_0xd451a9=_0x32badd();while(!![]){try{const _0xf227c6=parseInt(_0x54a2ad(0x204))/0x1+-parseInt(_0x54a2ad(0x1fb))/0x2+parseInt(_0x54a2ad(0x210))/0x3+-parseInt(_0x54a2ad(0x218))/0x4*(parseInt(_0x54a2ad(0x20e))/0x5)+-parseInt(_0x54a2ad(0x1ff))/0x6+-parseInt(_0x54a2ad(0x1f8))/0x7*(parseInt(_0x54a2ad(0x1fc))/0x8)+parseInt(_0x54a2ad(0x1f3))/0x9;if(_0xf227c6===_0x3e2de8)break;else _0xd451a9['push'](_0xd451a9['shift']());}catch(_0x3119f9){_0xd451a9['push'](_0xd451a9['shift']());}}}(a58_0x2520,0xbccb8));function a58_0x2520(){const _0x5a1a56=['\x20(监听模式)','pipe','close','执行预览命令','--watch','45LkHryZ','trim','3312726jnarwz','toString','data','预览服务器启动成功','error','message','.bin','logger','397636bDeIzQ','10453293dEZKPO','vite','preview','inherit','Preview\x20project','204764sLHIBJ','info','all','577092kwFpma','88Rbefvc','node_modules','PATH','389124OKhnIi','cwd','success','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','watch','77438ASwAfH','stderr','env','vite\x20preview','预览服务器启动失败'];a58_0x2520=function(){return _0x5a1a56;};return a58_0x2520();}import{delimiter,join}from'node:path';import{spawn}from'node:child_process';function a58_0x4a37(_0x55b750,_0x4a1e06){_0x55b750=_0x55b750-0x1f3;const _0x2520f3=a58_0x2520();let _0x4a3794=_0x2520f3[_0x55b750];return _0x4a3794;}function runPreview(_0x4ae8fc){return new Promise((_0x2af4f,_0x3265c2)=>{const _0x3909b1=a58_0x4a37,_0x3d133a=Date['now']();_0x4ae8fc[_0x3909b1(0x217)][_0x3909b1(0x1f9)](_0x3909b1(0x1f5),'启动预览服务器',{'command':_0x3909b1(0x207)});let _0x134898='';const _0x414b36=spawn(_0x3909b1(0x1f4),[_0x3909b1(0x1f5)],{'stdio':[_0x3909b1(0x1f6),_0x3909b1(0x1f6),_0x3909b1(0x20a)],'shell':!![],'env':{...process[_0x3909b1(0x206)],'PATH':''+join(process[_0x3909b1(0x200)](),_0x3909b1(0x1fd),_0x3909b1(0x216))+delimiter+process['env'][_0x3909b1(0x1fe)]}});_0x414b36[_0x3909b1(0x205)]?.['on'](_0x3909b1(0x212),_0x133ae0=>{const _0x31c671=_0x3909b1;_0x134898+=_0x133ae0[_0x31c671(0x211)]();}),_0x414b36['on']('close',_0x31b3d8=>{const _0x3c0f5d=_0x3909b1,_0x25b34a=Date['now']()-_0x3d133a;if(_0x31b3d8===0x0||_0x31b3d8===null)_0x4ae8fc[_0x3c0f5d(0x217)][_0x3c0f5d(0x201)]('preview',_0x3c0f5d(0x213),_0x25b34a),_0x2af4f();else{const _0x2a84eb={'exitCode':_0x31b3d8,'duration':_0x25b34a,'command':'vite\x20preview','cwd':process['cwd']()};_0x134898[_0x3c0f5d(0x20f)]()&&(_0x2a84eb[_0x3c0f5d(0x205)]=_0x134898['trim']()),_0x4ae8fc[_0x3c0f5d(0x217)]['error'](_0x3c0f5d(0x1f5),_0x3c0f5d(0x208),_0x2a84eb),_0x3265c2(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x31b3d8));}}),_0x414b36['on']('error',_0x27b8e2=>{const _0x4686fe=_0x3909b1,_0x193f46=Date['now']()-_0x3d133a;_0x4ae8fc[_0x4686fe(0x217)][_0x4686fe(0x214)](_0x4686fe(0x1f5),'预览服务器启动出错',{'error':_0x27b8e2[_0x4686fe(0x215)],'duration':_0x193f46,'stderr':_0x134898[_0x4686fe(0x20f)]()||undefined}),_0x3265c2(_0x27b8e2);});});}function runBuildWatch(){return new Promise((_0x809ef5,_0x2d5ff4)=>{const _0x388bb7=a58_0x4a37,_0x2aa9f3=spawn(_0x388bb7(0x1f4),['build',_0x388bb7(0x20d)],{'stdio':_0x388bb7(0x1f6),'shell':!![],'env':{...process[_0x388bb7(0x206)],'PATH':''+join(process[_0x388bb7(0x200)](),_0x388bb7(0x1fd),'.bin')+delimiter+process[_0x388bb7(0x206)]['PATH']}});_0x2aa9f3['on'](_0x388bb7(0x20b),_0x3aced6=>{const _0xf2b650=_0x388bb7;if(_0x3aced6===0x0||_0x3aced6===null)_0x809ef5();else _0x2d5ff4(new Error(_0xf2b650(0x202)+_0x3aced6));}),_0x2aa9f3['on']('error',_0x2d5ff4);});}export const previewCommand={'name':a58_0x129a07(0x1f5),'description':a58_0x129a07(0x1f7),async 'run'(_0x159aec,_0x422e5d,_0x29a069){const _0x4ff651=a58_0x129a07,_0x3af365=_0x29a069[_0x4ff651(0x203)];_0x159aec[_0x4ff651(0x217)][_0x4ff651(0x1f9)](_0x4ff651(0x1f5),_0x4ff651(0x20c)+(_0x3af365?_0x4ff651(0x209):'')),_0x3af365?await Promise[_0x4ff651(0x1fa)]([runBuildWatch(),runPreview(_0x159aec)]):await runPreview(_0x159aec);}};
@@ -1 +1 @@
1
- const a59_0x4bf7bc=a59_0x41ae;function a59_0x41ae(_0x524b69,_0x42ab29){_0x524b69=_0x524b69-0x1c9;const _0x46403b=a59_0x4640();let _0x41ae94=_0x46403b[_0x524b69];return _0x41ae94;}(function(_0x570e33,_0x3b8e9d){const _0x452dd8=a59_0x41ae,_0x111eb3=_0x570e33();while(!![]){try{const _0x23bd92=-parseInt(_0x452dd8(0x209))/0x1*(parseInt(_0x452dd8(0x224))/0x2)+parseInt(_0x452dd8(0x211))/0x3+parseInt(_0x452dd8(0x225))/0x4+-parseInt(_0x452dd8(0x1d7))/0x5+-parseInt(_0x452dd8(0x1d4))/0x6*(parseInt(_0x452dd8(0x23a))/0x7)+-parseInt(_0x452dd8(0x1f1))/0x8*(-parseInt(_0x452dd8(0x208))/0x9)+-parseInt(_0x452dd8(0x213))/0xa*(-parseInt(_0x452dd8(0x1d2))/0xb);if(_0x23bd92===_0x3b8e9d)break;else _0x111eb3['push'](_0x111eb3['shift']());}catch(_0x1d4f18){_0x111eb3['push'](_0x111eb3['shift']());}}}(a59_0x4640,0x37c70));import a59_0x4ac0ca from'chalk';import a59_0x2e73e7 from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';import{resolve}from'node:path';import{CONFIG_NAMES,NEW_CONFIG_NAME,readConfigFile,writeConfigFile}from'../context.js';function a59_0x4640(){const _0x131584=['lovrabet/lovrabet-skill\x20removed','succeed','.cursor/rules/lovrabet_rules.mdc','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','Step\x201/6:\x20Migrating\x20config...','282636nPwEnn','detail','30vqtYoH','label','red','Remove\x20.lovrabet/','string','no\x20matching\x20entry\x20found','Config\x20migration','stringify','no\x20legacy\x20entry','Legacy\x20artifacts:','info','Step\x202/6:\x20.lovrabet/\x20directory\x20removed','log','\x20\x20Action:\x20delete','oldPath','Step\x203/6:\x20Legacy\x20artifacts\x20—\x20','filter','124420skWCsM','333948HICbes','isArray','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','fields','CANCEL','lovrabet/rabetbase','done','oldArtifacts','cwd','length','failed','@lovrabet/dataset-mcp-server','Step\x204/6:\x20MCP\x20config\x20—\x20','nonInteractive','MCP\x20config:','entries','\x20from\x20','values','object','hasNewConfig','mcpServers','190358Uhchzt','keys','needed','skipped','Step\x204/6:\x20Cleaning\x20MCP\x20config...','step','Upgrade\x20cancelled.','configMigration','undefined','oldMcpConfig','status','\x20\x20New\x20config\x20(.rabetbase.json):\x20','FOUND','\x20\x20\x20\x20\x20\x20\x20','yes','.lovrabet','1177847qLaRUm','Step\x201/6:\x20Config\x20migration\x20—\x20','18pOFkfZ','===\x20Upgrade\x20Analysis\x20===','parse','452755hbpawW','.cursor/mcp.json','files','Step\x202/6:\x20Removing\x20.lovrabet/\x20directory...','removed\x20','green','\x20(backup:\x20','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','not\x20found\x20(will\x20create)','Step\x202/6:\x20.lovrabet/\x20not\x20found,\x20skipped','fail','Config\x20file:','needsSkillSwap','FAIL','not\x20needed','includes','args','path','utf8','cyan','Skill\x20swap:','gray','start','Step\x206/6:\x20Installing\x20new\x20skill...','.bak','exit\x20','2248GXnDWc','Install\x20new\x20skill','error','Step\x203/6:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','\x20→\x20keys:\x20','Upgrade\x20completed\x20successfully!','no\x20legacy\x20config\x20found','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20lovrabet/rabetbase\x20--global','Proceed\x20with\x20upgrade?','\x20\x20Fields\x20to\x20migrate:\x20','yellow','lovrabet/rabetbase\x20installed\x20globally','Step\x206/6:\x20Install\x20new\x20skill\x20—\x20','none\x20found','Step\x205/6:\x20Remove\x20old\x20skill\x20—\x20','\x20→\x20','\x20\x20Step\x20','message','inherit','push','Clean\x20MCP\x20config','Step\x205/6:\x20Removing\x20old\x20skill...','\x20removed','6813fPqSrE','5SIhVTr','join','some'];a59_0x4640=function(){return _0x131584;};return a59_0x4640();}import{CORE_IDE_CONFIGS}from'../utils/ai_config.js';import{runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../skills/npx-skills-add.js';import{askConfirm}from'./menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a59_0x4bf7bc(0x223)](_0x3eeed8=>_0x3eeed8!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x717b36){const _0x1ba626=a59_0x4bf7bc,_0xb1e13=[];for(const _0x1ddd97 of Object[_0x1ba626(0x236)](CORE_IDE_CONFIGS)){if(_0x1ddd97[_0x1ba626(0x1d9)])for(const _0x262790 of _0x1ddd97['files']){_0xb1e13[_0x1ba626(0x204)](resolve(_0x717b36,_0x262790[_0x1ba626(0x1e8)]));}}return _0xb1e13;}function analyse(_0x3bd82b){const _0x14d582=a59_0x4bf7bc;let _0x553020=null;const _0x8b8c19=resolve(_0x3bd82b,NEW_CONFIG_NAME),_0x2d522e=existsSync(_0x8b8c19);for(const _0x5e23b4 of LEGACY_CONFIG_NAMES){const _0x13e973=resolve(_0x3bd82b,_0x5e23b4);if(existsSync(_0x13e973)){const _0x46c5cb=readConfigFile(_0x13e973),_0x3d4155=Object['keys'](_0x46c5cb)[_0x14d582(0x223)](_0x4b61e2=>typeof _0x46c5cb[_0x4b61e2]!==_0x14d582(0x1ca));_0x553020={'oldPath':_0x13e973,'hasNewConfig':_0x2d522e,'fields':_0x3d4155};break;}}const _0x3c556f=[],_0xb54c0e=resolve(_0x3bd82b,'.lovrabet');if(existsSync(_0xb54c0e))_0x3c556f[_0x14d582(0x204)](_0xb54c0e);const _0x395b2f=resolve(_0x3bd82b,_0x14d582(0x20e));if(existsSync(_0x395b2f))_0x3c556f[_0x14d582(0x204)](_0x395b2f);const _0x5c543c=resolve(_0x3bd82b,'.claude/skills/lovrabet');if(existsSync(_0x5c543c))_0x3c556f['push'](_0x5c543c);for(const _0x167bbc of collectIdeSkillFiles(_0x3bd82b)){if(existsSync(_0x167bbc))_0x3c556f[_0x14d582(0x204)](_0x167bbc);}let _0x42726e=null;const _0x5b989f=resolve(_0x3bd82b,_0x14d582(0x1d8));if(existsSync(_0x5b989f))try{const _0x4c2541=JSON[_0x14d582(0x1d6)](readFileSync(_0x5b989f,_0x14d582(0x1e9)));if(_0x4c2541?.[_0x14d582(0x239)]&&typeof _0x4c2541[_0x14d582(0x239)]==='object'){const _0x26edf7=[];for(const [_0x10e174,_0x54281b]of Object[_0x14d582(0x234)](_0x4c2541[_0x14d582(0x239)])){const _0x58eaac=_0x54281b;_0x58eaac?.['args']&&Array[_0x14d582(0x226)](_0x58eaac[_0x14d582(0x1e7)])&&_0x58eaac[_0x14d582(0x1e7)]['some'](_0x157a87=>typeof _0x157a87==='string'&&_0x157a87[_0x14d582(0x1e6)]('@lovrabet/dataset-mcp-server'))&&_0x26edf7[_0x14d582(0x204)](_0x10e174);}_0x26edf7[_0x14d582(0x22e)]>0x0&&(_0x42726e={'path':_0x5b989f,'keys':_0x26edf7});}}catch{}const _0x474007=_0x3c556f[_0x14d582(0x22e)]>0x0||_0x553020!==null;return{'configMigration':_0x553020,'oldArtifacts':_0x3c556f,'oldMcpConfig':_0x42726e,'needsSkillSwap':_0x474007};}function printReport(_0x46c211){const _0x3a00fb=a59_0x4bf7bc,{configMigration:_0x575b5e,oldArtifacts:_0x255265,oldMcpConfig:_0x287391,needsSkillSwap:_0x6d8210}=_0x46c211;console[_0x3a00fb(0x21f)](''),console[_0x3a00fb(0x21f)](a59_0x4ac0ca['bold'](_0x3a00fb(0x1d5))),console['log']('');_0x575b5e?(console[_0x3a00fb(0x21f)](a59_0x4ac0ca['cyan'](_0x3a00fb(0x1e2))+('\x20\x20'+a59_0x4ac0ca[_0x3a00fb(0x1fb)](_0x575b5e['oldPath']))),console['log'](_0x3a00fb(0x1cd)+(_0x575b5e[_0x3a00fb(0x238)]?a59_0x4ac0ca[_0x3a00fb(0x1dc)]('already\x20exists\x20(will\x20merge)'):a59_0x4ac0ca[_0x3a00fb(0x1ec)](_0x3a00fb(0x1df)))),console[_0x3a00fb(0x21f)](_0x3a00fb(0x1fa)+_0x575b5e[_0x3a00fb(0x228)][_0x3a00fb(0x20a)](',\x20')),console[_0x3a00fb(0x21f)](_0x3a00fb(0x20f))):console['log'](a59_0x4ac0ca[_0x3a00fb(0x1ea)](_0x3a00fb(0x1e2))+'\x20\x20'+a59_0x4ac0ca[_0x3a00fb(0x1ec)](_0x3a00fb(0x1f7)));console[_0x3a00fb(0x21f)]('');if(_0x255265[_0x3a00fb(0x22e)]>0x0){console[_0x3a00fb(0x21f)](a59_0x4ac0ca['cyan'](_0x3a00fb(0x21c)));for(const _0xcc182a of _0x255265){console[_0x3a00fb(0x21f)]('\x20\x20'+a59_0x4ac0ca[_0x3a00fb(0x215)](_0x3a00fb(0x1ce))+'\x20\x20'+_0xcc182a);}console[_0x3a00fb(0x21f)](_0x3a00fb(0x220));}else console[_0x3a00fb(0x21f)](a59_0x4ac0ca[_0x3a00fb(0x1ea)]('Legacy\x20artifacts:')+'\x20\x20'+a59_0x4ac0ca[_0x3a00fb(0x1ec)](_0x3a00fb(0x1fe)));console[_0x3a00fb(0x21f)](''),_0x287391?(console['log'](a59_0x4ac0ca[_0x3a00fb(0x1ea)](_0x3a00fb(0x233))+('\x20\x20'+a59_0x4ac0ca[_0x3a00fb(0x1fb)](_0x287391['path'])+_0x3a00fb(0x1f5)+_0x287391[_0x3a00fb(0x23b)][_0x3a00fb(0x20a)](',\x20'))),console[_0x3a00fb(0x21f)](_0x3a00fb(0x1de))):console['log'](a59_0x4ac0ca[_0x3a00fb(0x1ea)]('MCP\x20config:')+'\x20\x20'+a59_0x4ac0ca[_0x3a00fb(0x1ec)](_0x3a00fb(0x21b))),console['log'](''),console[_0x3a00fb(0x21f)](a59_0x4ac0ca[_0x3a00fb(0x1ea)](_0x3a00fb(0x1eb))+('\x20\x20'+(_0x6d8210?a59_0x4ac0ca[_0x3a00fb(0x1fb)](_0x3a00fb(0x23c)):a59_0x4ac0ca['green'](_0x3a00fb(0x1e5))))),_0x6d8210&&console['log'](_0x3a00fb(0x1f8)),console[_0x3a00fb(0x21f)]('');}function execConfigMigration(_0x15bfc7,_0x2d40fe){const _0x56e3d1=a59_0x4bf7bc,{configMigration:_0x3bd9e6}=_0x15bfc7;if(!_0x3bd9e6?.['oldPath'])return{'step':0x1,'label':_0x56e3d1(0x219),'ok':!![],'detail':'skipped\x20(no\x20legacy\x20config)'};const _0x5bdd93=readConfigFile(_0x3bd9e6[_0x56e3d1(0x221)]),_0x2b91f9=resolve(_0x2d40fe,NEW_CONFIG_NAME),_0x5b5187=_0x3bd9e6['hasNewConfig']?readConfigFile(_0x2b91f9):{};for(const [_0xf3f286,_0x391233]of Object[_0x56e3d1(0x234)](_0x5bdd93)){!(_0xf3f286 in _0x5b5187)&&(_0x5b5187[_0xf3f286]=_0x391233);}writeConfigFile(_0x2b91f9,_0x5b5187);const _0x55d89c=_0x3bd9e6[_0x56e3d1(0x221)]+_0x56e3d1(0x1ef);return renameSync(_0x3bd9e6[_0x56e3d1(0x221)],_0x55d89c),{'step':0x1,'label':_0x56e3d1(0x219),'ok':!![],'detail':_0x3bd9e6[_0x56e3d1(0x221)]+_0x56e3d1(0x200)+_0x2b91f9+_0x56e3d1(0x1dd)+_0x55d89c+')'};}function execRemoveOldArtifacts(_0x11a78f){const _0x2238a2=a59_0x4bf7bc,_0x1c3fa2=[];for(const _0xc3d8b5 of _0x11a78f){try{if(!existsSync(_0xc3d8b5))continue;const _0x3b2f41=tryStat(_0xc3d8b5);_0x3b2f41?.['isDirectory']()?rmSync(_0xc3d8b5,{'recursive':!![],'force':!![]}):unlinkSync(_0xc3d8b5);}catch(_0x3ccb72){_0x1c3fa2[_0x2238a2(0x204)](_0xc3d8b5+':\x20'+_0x3ccb72[_0x2238a2(0x202)]);}}return{'step':0x3,'label':'Remove\x20legacy\x20artifacts','ok':_0x1c3fa2[_0x2238a2(0x22e)]===0x0,'detail':_0x1c3fa2[_0x2238a2(0x22e)]>0x0?_0x11a78f['length']-_0x1c3fa2[_0x2238a2(0x22e)]+'/'+_0x11a78f['length']+'\x20removed\x20('+_0x1c3fa2[_0x2238a2(0x20a)](';\x20')+')':_0x11a78f[_0x2238a2(0x22e)]+_0x2238a2(0x207)};}function execCleanMcp(_0x45e11c){const _0x433626=a59_0x4bf7bc;if(!_0x45e11c[_0x433626(0x1cb)])return{'step':0x4,'label':_0x433626(0x205),'ok':!![],'detail':_0x433626(0x23d)};try{const _0xa3650f=readFileSync(_0x45e11c[_0x433626(0x1cb)][_0x433626(0x1e8)],_0x433626(0x1e9)),_0x459b8d=JSON[_0x433626(0x1d6)](_0xa3650f);if(_0x459b8d?.['mcpServers']&&typeof _0x459b8d[_0x433626(0x239)]===_0x433626(0x237)){const _0x14a810=[];for(const [_0x5a109b,_0x1074cc]of Object[_0x433626(0x234)](_0x459b8d[_0x433626(0x239)])){_0x1074cc?.[_0x433626(0x1e7)]&&Array[_0x433626(0x226)](_0x1074cc[_0x433626(0x1e7)])&&_0x1074cc[_0x433626(0x1e7)][_0x433626(0x20b)](_0x48318e=>typeof _0x48318e===_0x433626(0x217)&&_0x48318e[_0x433626(0x1e6)](_0x433626(0x230)))&&_0x14a810[_0x433626(0x204)](_0x5a109b);}for(const _0x1a1aad of _0x14a810){delete _0x459b8d[_0x433626(0x239)][_0x1a1aad];}return _0x14a810[_0x433626(0x22e)]>0x0&&writeFileSync(_0x45e11c[_0x433626(0x1cb)][_0x433626(0x1e8)],JSON[_0x433626(0x21a)](_0x459b8d,null,0x2)+'\x0a',_0x433626(0x1e9)),{'step':0x4,'label':_0x433626(0x205),'ok':!![],'detail':_0x433626(0x1db)+_0x14a810['join'](',\x20')+_0x433626(0x235)+_0x45e11c[_0x433626(0x1cb)][_0x433626(0x1e8)]};}return{'step':0x4,'label':_0x433626(0x205),'ok':!![],'detail':_0x433626(0x218)};}catch(_0x1b38ec){return{'step':0x4,'label':_0x433626(0x205),'ok':![],'detail':_0x1b38ec[_0x433626(0x202)]};}}function execSkillsRemove(_0x23c167){const _0x1da9a9=a59_0x4bf7bc,_0x1504c8=runNpxSkillsRemove(_0x23c167,{'stdio':_0x1da9a9(0x203)});return{'step':0x5,'label':'Remove\x20old\x20skill','ok':_0x1504c8['ok'],'detail':_0x1504c8['ok']?_0x1da9a9(0x20c):_0x1504c8[_0x1da9a9(0x1f3)]??_0x1da9a9(0x1f0)+_0x1504c8[_0x1da9a9(0x1cc)]};}function execSkillsAdd(_0x3a0805){const _0xb57039=a59_0x4bf7bc,_0x558d0d=runNpxSkillsAddGlobal(_0x3a0805,_0xb57039(0x22a),{'stdio':'inherit'});return{'step':0x6,'label':_0xb57039(0x1f2),'ok':_0x558d0d['ok'],'detail':_0x558d0d['ok']?_0xb57039(0x1fc):_0x558d0d[_0xb57039(0x1f3)]??'exit\x20'+_0x558d0d[_0xb57039(0x1cc)]};}function tryStat(_0x196b99){try{return statSync(_0x196b99);}catch{return undefined;}}function printSummary(_0x3cc605){const _0x51cc8c=a59_0x4bf7bc;console[_0x51cc8c(0x21f)](''),console['log'](a59_0x4ac0ca['bold']('===\x20Upgrade\x20Summary\x20===')),console['log']('');for(const _0x21a6bd of _0x3cc605){const _0x5d2fdf=_0x21a6bd['ok']?a59_0x4ac0ca['green']('OK'):a59_0x4ac0ca[_0x51cc8c(0x215)](_0x51cc8c(0x1e4));console[_0x51cc8c(0x21f)]('\x20\x20'+_0x5d2fdf+_0x51cc8c(0x201)+_0x21a6bd[_0x51cc8c(0x23f)]+':\x20'+_0x21a6bd[_0x51cc8c(0x214)]);if(_0x21a6bd[_0x51cc8c(0x212)])console['log'](_0x51cc8c(0x1cf)+a59_0x4ac0ca['gray'](_0x21a6bd[_0x51cc8c(0x212)]));}console[_0x51cc8c(0x21f)]('');}export async function upgradeApp(_0x43523c,_0x4e1d21){const _0x3649b9=a59_0x4bf7bc,_0x57ab2a=process[_0x3649b9(0x22d)](),_0x2d26ab=analyse(_0x57ab2a),_0x4a4c31=!_0x2d26ab[_0x3649b9(0x1c9)]&&_0x2d26ab[_0x3649b9(0x22c)][_0x3649b9(0x22e)]===0x0&&!_0x2d26ab[_0x3649b9(0x1cb)]&&!_0x2d26ab[_0x3649b9(0x1e3)];if(_0x4a4c31){console[_0x3649b9(0x21f)](a59_0x4ac0ca[_0x3649b9(0x1dc)](_0x3649b9(0x227)));return;}printReport(_0x2d26ab);const _0x477e48=_0x4e1d21[_0x3649b9(0x1d0)]||_0x4e1d21['Y']||_0x43523c[_0x3649b9(0x232)];if(!_0x477e48)try{const _0x3ebe6d=await askConfirm(_0x3649b9(0x1f9));if(!_0x3ebe6d){console[_0x3649b9(0x21f)](a59_0x4ac0ca[_0x3649b9(0x1ec)](_0x3649b9(0x240)));return;}}catch(_0x113086){if(_0x113086?.[_0x3649b9(0x202)]===_0x3649b9(0x229)){console[_0x3649b9(0x21f)](a59_0x4ac0ca[_0x3649b9(0x1ec)](_0x3649b9(0x240)));return;}throw _0x113086;}const _0x450542=[],_0xa33523=a59_0x2e73e7({'text':_0x3649b9(0x210),'color':_0x3649b9(0x1ea)})[_0x3649b9(0x1ed)](),_0x26b8f8=execConfigMigration(_0x2d26ab,_0x57ab2a);_0x450542[_0x3649b9(0x204)](_0x26b8f8),_0xa33523[_0x26b8f8['ok']?_0x3649b9(0x20d):_0x3649b9(0x1e1)](_0x3649b9(0x1d3)+(_0x26b8f8[_0x3649b9(0x212)]??(_0x26b8f8['ok']?_0x3649b9(0x22b):_0x3649b9(0x22f))));const _0x5ac375=resolve(_0x57ab2a,_0x3649b9(0x1d1)),_0x5809c4=a59_0x2e73e7({'text':_0x3649b9(0x1da),'color':_0x3649b9(0x1ea)})[_0x3649b9(0x1ed)]();if(existsSync(_0x5ac375))try{rmSync(_0x5ac375,{'recursive':!![],'force':!![]}),_0x5809c4[_0x3649b9(0x20d)](_0x3649b9(0x21e)),_0x450542['push']({'step':0x2,'label':_0x3649b9(0x216),'ok':!![]});}catch(_0x562eab){_0x5809c4[_0x3649b9(0x1e1)]('Step\x202/6:\x20.lovrabet/\x20removal\x20failed\x20—\x20'+_0x562eab['message']),_0x450542['push']({'step':0x2,'label':_0x3649b9(0x216),'ok':![],'detail':_0x562eab[_0x3649b9(0x202)]});}else _0x5809c4[_0x3649b9(0x21d)](_0x3649b9(0x1e0)),_0x450542[_0x3649b9(0x204)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![],'detail':_0x3649b9(0x23d)});const _0x16c27a=a59_0x2e73e7({'text':_0x3649b9(0x1f4),'color':'cyan'})[_0x3649b9(0x1ed)](),_0x4653b2=execRemoveOldArtifacts(_0x2d26ab[_0x3649b9(0x22c)]);_0x450542[_0x3649b9(0x204)](_0x4653b2),_0x16c27a[_0x4653b2['ok']?_0x3649b9(0x20d):_0x3649b9(0x1e1)](_0x3649b9(0x222)+(_0x4653b2['detail']??(_0x4653b2['ok']?_0x3649b9(0x22b):_0x3649b9(0x22f))));const _0x16dd6e=a59_0x2e73e7({'text':_0x3649b9(0x23e),'color':_0x3649b9(0x1ea)})['start'](),_0x2e80d2=execCleanMcp(_0x2d26ab);_0x450542['push'](_0x2e80d2),_0x16dd6e[_0x2e80d2['ok']?'succeed':'fail'](_0x3649b9(0x231)+(_0x2e80d2[_0x3649b9(0x212)]??(_0x2e80d2['ok']?_0x3649b9(0x22b):'failed')));const _0x2c240e=a59_0x2e73e7({'text':_0x3649b9(0x206),'color':'cyan'})[_0x3649b9(0x1ed)](),_0x93ca95=execSkillsRemove(_0x57ab2a);_0x450542[_0x3649b9(0x204)](_0x93ca95),_0x2c240e[_0x93ca95['ok']?_0x3649b9(0x20d):'fail'](_0x3649b9(0x1ff)+(_0x93ca95[_0x3649b9(0x212)]??(_0x93ca95['ok']?_0x3649b9(0x22b):'failed')));const _0x53b76b=a59_0x2e73e7({'text':_0x3649b9(0x1ee),'color':_0x3649b9(0x1ea)})[_0x3649b9(0x1ed)](),_0xed0d3b=execSkillsAdd(_0x57ab2a);_0x450542['push'](_0xed0d3b),_0x53b76b[_0xed0d3b['ok']?_0x3649b9(0x20d):_0x3649b9(0x1e1)](_0x3649b9(0x1fd)+(_0xed0d3b[_0x3649b9(0x212)]??(_0xed0d3b['ok']?_0x3649b9(0x22b):_0x3649b9(0x22f)))),printSummary(_0x450542);const _0xcf0c3f=_0x450542[_0x3649b9(0x20b)](_0x3d120a=>!_0x3d120a['ok']);_0xcf0c3f?console[_0x3649b9(0x21f)](a59_0x4ac0ca[_0x3649b9(0x1fb)]('Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.')):console['log'](a59_0x4ac0ca['green'](_0x3649b9(0x1f6)));}export const upgradeCommand={'name':'upgrade','description':'Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli',async 'run'(_0x356179,_0x4529d2,_0x5ec829){await upgradeApp(_0x356179,_0x5ec829);}};
1
+ const a59_0x81ba70=a59_0x2f2b;(function(_0x16870e,_0x6ba2db){const _0xf11705=a59_0x2f2b,_0x5c1074=_0x16870e();while(!![]){try{const _0x29947f=parseInt(_0xf11705(0xae))/0x1*(parseInt(_0xf11705(0xd2))/0x2)+parseInt(_0xf11705(0xc9))/0x3+-parseInt(_0xf11705(0x9e))/0x4*(parseInt(_0xf11705(0xb7))/0x5)+parseInt(_0xf11705(0x93))/0x6*(-parseInt(_0xf11705(0xe0))/0x7)+parseInt(_0xf11705(0xf5))/0x8+-parseInt(_0xf11705(0xb6))/0x9*(-parseInt(_0xf11705(0xd6))/0xa)+-parseInt(_0xf11705(0xd3))/0xb;if(_0x29947f===_0x6ba2db)break;else _0x5c1074['push'](_0x5c1074['shift']());}catch(_0x2d9986){_0x5c1074['push'](_0x5c1074['shift']());}}}(a59_0x7f6c,0x8b852));import a59_0x2a5b79 from'chalk';import a59_0x19a77d from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';import{resolve}from'node:path';import{CONFIG_NAMES,NEW_CONFIG_NAME,readConfigFile,writeConfigFile}from'../context.js';import{CORE_IDE_CONFIGS}from'../utils/ai_config.js';import{runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../skills/npx-skills-add.js';import{askConfirm}from'./menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a59_0x81ba70(0xeb)](_0x3d6c4e=>_0x3d6c4e!==NEW_CONFIG_NAME);function a59_0x2f2b(_0x40cff9,_0x46579a){_0x40cff9=_0x40cff9-0x86;const _0x7f6cad=a59_0x7f6c();let _0x2f2b26=_0x7f6cad[_0x40cff9];return _0x2f2b26;}function collectIdeSkillFiles(_0xb49e5b){const _0x2db33b=a59_0x81ba70,_0x397212=[];for(const _0x6739ac of Object[_0x2db33b(0xc5)](CORE_IDE_CONFIGS)){if(_0x6739ac['files'])for(const _0x3690e3 of _0x6739ac[_0x2db33b(0xe7)]){_0x397212[_0x2db33b(0x97)](resolve(_0xb49e5b,_0x3690e3[_0x2db33b(0xda)]));}}return _0x397212;}function analyse(_0x551891){const _0x55a894=a59_0x81ba70;let _0x4af43a=null;const _0x10264c=resolve(_0x551891,NEW_CONFIG_NAME),_0x3bc1f2=existsSync(_0x10264c);for(const _0x3da1e3 of LEGACY_CONFIG_NAMES){const _0x342a12=resolve(_0x551891,_0x3da1e3);if(existsSync(_0x342a12)){const _0x278612=readConfigFile(_0x342a12),_0x99d23a=Object[_0x55a894(0xf9)](_0x278612)[_0x55a894(0xeb)](_0x4bbf13=>typeof _0x278612[_0x4bbf13]!==_0x55a894(0xb1));_0x4af43a={'oldPath':_0x342a12,'hasNewConfig':_0x3bc1f2,'fields':_0x99d23a};break;}}const _0x18e18c=[],_0x1d39f6=resolve(_0x551891,_0x55a894(0x87));if(existsSync(_0x1d39f6))_0x18e18c[_0x55a894(0x97)](_0x1d39f6);const _0xbcae25=resolve(_0x551891,_0x55a894(0xf7));if(existsSync(_0xbcae25))_0x18e18c[_0x55a894(0x97)](_0xbcae25);const _0x541656=resolve(_0x551891,'.claude/skills/lovrabet');if(existsSync(_0x541656))_0x18e18c[_0x55a894(0x97)](_0x541656);for(const _0x4193ac of collectIdeSkillFiles(_0x551891)){if(existsSync(_0x4193ac))_0x18e18c[_0x55a894(0x97)](_0x4193ac);}let _0x3b133a=null;const _0x16205a=resolve(_0x551891,_0x55a894(0xe8));if(existsSync(_0x16205a))try{const _0xd08977=JSON[_0x55a894(0xa5)](readFileSync(_0x16205a,_0x55a894(0x9c)));if(_0xd08977?.[_0x55a894(0xdc)]&&typeof _0xd08977[_0x55a894(0xdc)]===_0x55a894(0x8d)){const _0x222c62=[];for(const [_0x49800b,_0x49bde1]of Object[_0x55a894(0xb2)](_0xd08977[_0x55a894(0xdc)])){const _0x5bdce7=_0x49bde1;_0x5bdce7?.[_0x55a894(0xd0)]&&Array[_0x55a894(0x96)](_0x5bdce7['args'])&&_0x5bdce7[_0x55a894(0xd0)]['some'](_0x2da472=>typeof _0x2da472===_0x55a894(0xc1)&&_0x2da472['includes'](_0x55a894(0xd1)))&&_0x222c62[_0x55a894(0x97)](_0x49800b);}_0x222c62[_0x55a894(0xc6)]>0x0&&(_0x3b133a={'path':_0x16205a,'keys':_0x222c62});}}catch{}const _0x33db27=_0x18e18c[_0x55a894(0xc6)]>0x0||_0x4af43a!==null;return{'configMigration':_0x4af43a,'oldArtifacts':_0x18e18c,'oldMcpConfig':_0x3b133a,'needsSkillSwap':_0x33db27};}function printReport(_0x3feefb){const _0x3a2359=a59_0x81ba70,{configMigration:_0x4c35d8,oldArtifacts:_0x21e847,oldMcpConfig:_0x15f1fe,needsSkillSwap:_0x2a4f00}=_0x3feefb;console[_0x3a2359(0xd8)](''),console[_0x3a2359(0xd8)](a59_0x2a5b79[_0x3a2359(0xa8)](_0x3a2359(0xf4))),console[_0x3a2359(0xd8)]('');_0x4c35d8?(console[_0x3a2359(0xd8)](a59_0x2a5b79[_0x3a2359(0xb3)]('Config\x20file:')+('\x20\x20'+a59_0x2a5b79['yellow'](_0x4c35d8[_0x3a2359(0xc0)]))),console[_0x3a2359(0xd8)](_0x3a2359(0xe6)+(_0x4c35d8[_0x3a2359(0xd7)]?a59_0x2a5b79[_0x3a2359(0xa2)](_0x3a2359(0xe1)):a59_0x2a5b79[_0x3a2359(0x8c)]('not\x20found\x20(will\x20create)'))),console[_0x3a2359(0xd8)]('\x20\x20Fields\x20to\x20migrate:\x20'+_0x4c35d8['fields']['join'](',\x20')),console[_0x3a2359(0xd8)](_0x3a2359(0x95))):console[_0x3a2359(0xd8)](a59_0x2a5b79['cyan'](_0x3a2359(0xfa))+'\x20\x20'+a59_0x2a5b79[_0x3a2359(0x8c)](_0x3a2359(0x9d)));console['log']('');if(_0x21e847[_0x3a2359(0xc6)]>0x0){console[_0x3a2359(0xd8)](a59_0x2a5b79[_0x3a2359(0xb3)]('Legacy\x20artifacts:'));for(const _0x50f276 of _0x21e847){console[_0x3a2359(0xd8)]('\x20\x20'+a59_0x2a5b79[_0x3a2359(0xe3)]('FOUND')+'\x20\x20'+_0x50f276);}console[_0x3a2359(0xd8)](_0x3a2359(0xa6));}else console[_0x3a2359(0xd8)](a59_0x2a5b79[_0x3a2359(0xb3)](_0x3a2359(0xe9))+'\x20\x20'+a59_0x2a5b79[_0x3a2359(0x8c)](_0x3a2359(0xcd)));console[_0x3a2359(0xd8)](''),_0x15f1fe?(console[_0x3a2359(0xd8)](a59_0x2a5b79['cyan'](_0x3a2359(0xa1))+('\x20\x20'+a59_0x2a5b79[_0x3a2359(0xee)](_0x15f1fe['path'])+_0x3a2359(0x8f)+_0x15f1fe['keys']['join'](',\x20'))),console[_0x3a2359(0xd8)](_0x3a2359(0xa9))):console[_0x3a2359(0xd8)](a59_0x2a5b79[_0x3a2359(0xb3)](_0x3a2359(0xa1))+'\x20\x20'+a59_0x2a5b79[_0x3a2359(0x8c)](_0x3a2359(0x86))),console[_0x3a2359(0xd8)](''),console[_0x3a2359(0xd8)](a59_0x2a5b79[_0x3a2359(0xb3)]('Skill\x20swap:')+('\x20\x20'+(_0x2a4f00?a59_0x2a5b79['yellow'](_0x3a2359(0x90)):a59_0x2a5b79[_0x3a2359(0xa2)](_0x3a2359(0xc8))))),_0x2a4f00&&console[_0x3a2359(0xd8)](_0x3a2359(0xa7)),console['log']('');}function execConfigMigration(_0x3f0466,_0xa1d0ed){const _0x4bb52a=a59_0x81ba70,{configMigration:_0x4ecfa5}=_0x3f0466;if(!_0x4ecfa5?.[_0x4bb52a(0xc0)])return{'step':0x1,'label':_0x4bb52a(0xcf),'ok':!![],'detail':_0x4bb52a(0xad)};const _0x35db1b=readConfigFile(_0x4ecfa5[_0x4bb52a(0xc0)]),_0x3d9642=resolve(_0xa1d0ed,NEW_CONFIG_NAME),_0x14a47d=_0x4ecfa5[_0x4bb52a(0xd7)]?readConfigFile(_0x3d9642):{};for(const [_0x59f0e9,_0x3b1c5a]of Object[_0x4bb52a(0xb2)](_0x35db1b)){!(_0x59f0e9 in _0x14a47d)&&(_0x14a47d[_0x59f0e9]=_0x3b1c5a);}writeConfigFile(_0x3d9642,_0x14a47d);const _0x1e905e=_0x4ecfa5[_0x4bb52a(0xc0)]+_0x4bb52a(0xc7);return renameSync(_0x4ecfa5['oldPath'],_0x1e905e),{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':_0x4ecfa5[_0x4bb52a(0xc0)]+_0x4bb52a(0xdb)+_0x3d9642+_0x4bb52a(0x8b)+_0x1e905e+')'};}function execRemoveOldArtifacts(_0x24d3ea){const _0x5dc7fb=a59_0x81ba70,_0x52e43d=[];for(const _0x14bbc2 of _0x24d3ea){try{if(!existsSync(_0x14bbc2))continue;const _0x430b59=tryStat(_0x14bbc2);_0x430b59?.[_0x5dc7fb(0xca)]()?rmSync(_0x14bbc2,{'recursive':!![],'force':!![]}):unlinkSync(_0x14bbc2);}catch(_0x29d587){_0x52e43d[_0x5dc7fb(0x97)](_0x14bbc2+':\x20'+_0x29d587[_0x5dc7fb(0xf8)]);}}return{'step':0x3,'label':_0x5dc7fb(0x9b),'ok':_0x52e43d[_0x5dc7fb(0xc6)]===0x0,'detail':_0x52e43d[_0x5dc7fb(0xc6)]>0x0?_0x24d3ea[_0x5dc7fb(0xc6)]-_0x52e43d[_0x5dc7fb(0xc6)]+'/'+_0x24d3ea[_0x5dc7fb(0xc6)]+'\x20removed\x20('+_0x52e43d['join'](';\x20')+')':_0x24d3ea[_0x5dc7fb(0xc6)]+_0x5dc7fb(0x91)};}function execCleanMcp(_0x503f4c){const _0x5f44e4=a59_0x81ba70;if(!_0x503f4c[_0x5f44e4(0xa3)])return{'step':0x4,'label':_0x5f44e4(0xd5),'ok':!![],'detail':_0x5f44e4(0xed)};try{const _0x18b19d=readFileSync(_0x503f4c[_0x5f44e4(0xa3)][_0x5f44e4(0xda)],_0x5f44e4(0x9c)),_0x1e052e=JSON['parse'](_0x18b19d);if(_0x1e052e?.['mcpServers']&&typeof _0x1e052e[_0x5f44e4(0xdc)]===_0x5f44e4(0x8d)){const _0x56b99b=[];for(const [_0x104cb5,_0x566ce3]of Object[_0x5f44e4(0xb2)](_0x1e052e[_0x5f44e4(0xdc)])){_0x566ce3?.['args']&&Array[_0x5f44e4(0x96)](_0x566ce3[_0x5f44e4(0xd0)])&&_0x566ce3[_0x5f44e4(0xd0)]['some'](_0x111ecb=>typeof _0x111ecb===_0x5f44e4(0xc1)&&_0x111ecb['includes'](_0x5f44e4(0xd1)))&&_0x56b99b[_0x5f44e4(0x97)](_0x104cb5);}for(const _0x361955 of _0x56b99b){delete _0x1e052e['mcpServers'][_0x361955];}return _0x56b99b[_0x5f44e4(0xc6)]>0x0&&writeFileSync(_0x503f4c[_0x5f44e4(0xa3)][_0x5f44e4(0xda)],JSON['stringify'](_0x1e052e,null,0x2)+'\x0a','utf8'),{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x5f44e4(0x98)+_0x56b99b[_0x5f44e4(0xf0)](',\x20')+_0x5f44e4(0xd9)+_0x503f4c[_0x5f44e4(0xa3)][_0x5f44e4(0xda)]};}return{'step':0x4,'label':_0x5f44e4(0xd5),'ok':!![],'detail':_0x5f44e4(0xbb)};}catch(_0x448e8e){return{'step':0x4,'label':_0x5f44e4(0xd5),'ok':![],'detail':_0x448e8e['message']};}}function a59_0x7f6c(){const _0x41105e=['no\x20legacy\x20entry','.lovrabet','Remove\x20old\x20skill','upgrade','Step\x201/6:\x20Migrating\x20config...','\x20(backup:\x20','gray','object','Install\x20new\x20skill','\x20→\x20keys:\x20','needed','\x20removed','cwd','210GSvaGc','Step\x201/6:\x20Config\x20migration\x20—\x20','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','isArray','push','removed\x20','Step\x202/6:\x20.lovrabet/\x20directory\x20removed','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','Remove\x20legacy\x20artifacts','utf8','no\x20legacy\x20config\x20found','4bFGdNt','exit\x20','Step\x205/6:\x20Remove\x20old\x20skill\x20—\x20','MCP\x20config:','green','oldMcpConfig','FAIL','parse','\x20\x20Action:\x20delete','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20lovrabet/rabetbase\x20--global','bold','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','lovrabet/rabetbase','succeed','configMigration','skipped\x20(no\x20legacy\x20config)','1cHTwXE','\x20\x20Step\x20','yes','undefined','entries','cyan','oldArtifacts','Step\x206/6:\x20Installing\x20new\x20skill...','1867158nbUKHJ','5015625QUqFgM','status','error','Step\x202/6:\x20.lovrabet/\x20removal\x20failed\x20—\x20','no\x20matching\x20entry\x20found','needsSkillSwap','Upgrade\x20cancelled.','some','Step\x204/6:\x20Cleaning\x20MCP\x20config...','oldPath','string','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','lovrabet/rabetbase\x20installed\x20globally','Upgrade\x20completed\x20successfully!','values','length','.bak','not\x20needed','1784943AGtFdQ','isDirectory','failed','step','none\x20found','start','Config\x20migration','args','@lovrabet/dataset-mcp-server','1331322eJcDYK','5258902PGtLjy','detail','Clean\x20MCP\x20config','10myjDec','hasNewConfig','log','\x20from\x20','path','\x20→\x20','mcpServers','Step\x202/6:\x20Removing\x20.lovrabet/\x20directory...','info','Remove\x20.lovrabet/','43918tJODOk','already\x20exists\x20(will\x20merge)','fail','red','===\x20Upgrade\x20Summary\x20===','Step\x206/6:\x20Install\x20new\x20skill\x20—\x20','\x20\x20New\x20config\x20(.rabetbase.json):\x20','files','.cursor/mcp.json','Legacy\x20artifacts:','Step\x205/6:\x20Removing\x20old\x20skill...','filter','Step\x202/6:\x20.lovrabet/\x20not\x20found,\x20skipped','skipped','yellow','inherit','join','lovrabet/lovrabet-skill\x20removed','nonInteractive','label','===\x20Upgrade\x20Analysis\x20===','6433336BkTjEt','done','.cursor/rules/lovrabet_rules.mdc','message','keys','Config\x20file:'];a59_0x7f6c=function(){return _0x41105e;};return a59_0x7f6c();}function execSkillsRemove(_0x3b360e){const _0xfad509=a59_0x81ba70,_0x54c8a4=runNpxSkillsRemove(_0x3b360e,{'stdio':_0xfad509(0xef)});return{'step':0x5,'label':_0xfad509(0x88),'ok':_0x54c8a4['ok'],'detail':_0x54c8a4['ok']?_0xfad509(0xf1):_0x54c8a4[_0xfad509(0xb9)]??_0xfad509(0x9f)+_0x54c8a4['status']};}function execSkillsAdd(_0x752faf){const _0x147d45=a59_0x81ba70,_0x12168e=runNpxSkillsAddGlobal(_0x752faf,_0x147d45(0xaa),{'stdio':_0x147d45(0xef)});return{'step':0x6,'label':_0x147d45(0x8e),'ok':_0x12168e['ok'],'detail':_0x12168e['ok']?_0x147d45(0xc3):_0x12168e[_0x147d45(0xb9)]??_0x147d45(0x9f)+_0x12168e[_0x147d45(0xb8)]};}function tryStat(_0x1c5360){try{return statSync(_0x1c5360);}catch{return undefined;}}function printSummary(_0x3837ab){const _0x380b22=a59_0x81ba70;console['log'](''),console[_0x380b22(0xd8)](a59_0x2a5b79[_0x380b22(0xa8)](_0x380b22(0xe4))),console[_0x380b22(0xd8)]('');for(const _0x4271c4 of _0x3837ab){const _0x12753a=_0x4271c4['ok']?a59_0x2a5b79[_0x380b22(0xa2)]('OK'):a59_0x2a5b79[_0x380b22(0xe3)](_0x380b22(0xa4));console[_0x380b22(0xd8)]('\x20\x20'+_0x12753a+_0x380b22(0xaf)+_0x4271c4[_0x380b22(0xcc)]+':\x20'+_0x4271c4[_0x380b22(0xf3)]);if(_0x4271c4['detail'])console[_0x380b22(0xd8)]('\x20\x20\x20\x20\x20\x20\x20'+a59_0x2a5b79[_0x380b22(0x8c)](_0x4271c4[_0x380b22(0xd4)]));}console[_0x380b22(0xd8)]('');}export async function upgradeApp(_0x1eadde,_0x5604ef){const _0xed46da=a59_0x81ba70,_0x31b8c7=process[_0xed46da(0x92)](),_0xfd3114=analyse(_0x31b8c7),_0x567032=!_0xfd3114[_0xed46da(0xac)]&&_0xfd3114[_0xed46da(0xb4)]['length']===0x0&&!_0xfd3114[_0xed46da(0xa3)]&&!_0xfd3114[_0xed46da(0xbc)];if(_0x567032){console[_0xed46da(0xd8)](a59_0x2a5b79[_0xed46da(0xa2)](_0xed46da(0xc2)));return;}printReport(_0xfd3114);const _0x362dd6=_0x5604ef[_0xed46da(0xb0)]||_0x5604ef['Y']||_0x1eadde[_0xed46da(0xf2)];if(!_0x362dd6)try{const _0x5b99db=await askConfirm('Proceed\x20with\x20upgrade?');if(!_0x5b99db){console[_0xed46da(0xd8)](a59_0x2a5b79['gray'](_0xed46da(0xbd)));return;}}catch(_0x498b0c){if(_0x498b0c?.[_0xed46da(0xf8)]==='CANCEL'){console[_0xed46da(0xd8)](a59_0x2a5b79[_0xed46da(0x8c)](_0xed46da(0xbd)));return;}throw _0x498b0c;}const _0x3207c1=[],_0x206f1d=a59_0x19a77d({'text':_0xed46da(0x8a),'color':_0xed46da(0xb3)})[_0xed46da(0xce)](),_0x289451=execConfigMigration(_0xfd3114,_0x31b8c7);_0x3207c1['push'](_0x289451),_0x206f1d[_0x289451['ok']?'succeed':'fail'](_0xed46da(0x94)+(_0x289451[_0xed46da(0xd4)]??(_0x289451['ok']?_0xed46da(0xf6):_0xed46da(0xcb))));const _0x36bf9a=resolve(_0x31b8c7,_0xed46da(0x87)),_0x53462a=a59_0x19a77d({'text':_0xed46da(0xdd),'color':_0xed46da(0xb3)})[_0xed46da(0xce)]();if(existsSync(_0x36bf9a))try{rmSync(_0x36bf9a,{'recursive':!![],'force':!![]}),_0x53462a[_0xed46da(0xab)](_0xed46da(0x99)),_0x3207c1[_0xed46da(0x97)]({'step':0x2,'label':_0xed46da(0xdf),'ok':!![]});}catch(_0x49dfa5){_0x53462a[_0xed46da(0xe2)](_0xed46da(0xba)+_0x49dfa5[_0xed46da(0xf8)]),_0x3207c1[_0xed46da(0x97)]({'step':0x2,'label':_0xed46da(0xdf),'ok':![],'detail':_0x49dfa5[_0xed46da(0xf8)]});}else _0x53462a[_0xed46da(0xde)](_0xed46da(0xec)),_0x3207c1[_0xed46da(0x97)]({'step':0x2,'label':_0xed46da(0xdf),'ok':!![],'detail':_0xed46da(0xed)});const _0x2d8cb2=a59_0x19a77d({'text':'Step\x203/6:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','color':_0xed46da(0xb3)})[_0xed46da(0xce)](),_0x1bdfee=execRemoveOldArtifacts(_0xfd3114[_0xed46da(0xb4)]);_0x3207c1[_0xed46da(0x97)](_0x1bdfee),_0x2d8cb2[_0x1bdfee['ok']?_0xed46da(0xab):_0xed46da(0xe2)]('Step\x203/6:\x20Legacy\x20artifacts\x20—\x20'+(_0x1bdfee[_0xed46da(0xd4)]??(_0x1bdfee['ok']?_0xed46da(0xf6):_0xed46da(0xcb))));const _0xd77755=a59_0x19a77d({'text':_0xed46da(0xbf),'color':_0xed46da(0xb3)})['start'](),_0x3a9b84=execCleanMcp(_0xfd3114);_0x3207c1[_0xed46da(0x97)](_0x3a9b84),_0xd77755[_0x3a9b84['ok']?_0xed46da(0xab):_0xed46da(0xe2)]('Step\x204/6:\x20MCP\x20config\x20—\x20'+(_0x3a9b84[_0xed46da(0xd4)]??(_0x3a9b84['ok']?'done':_0xed46da(0xcb))));const _0x473f71=a59_0x19a77d({'text':_0xed46da(0xea),'color':_0xed46da(0xb3)})[_0xed46da(0xce)](),_0x4ef442=execSkillsRemove(_0x31b8c7);_0x3207c1[_0xed46da(0x97)](_0x4ef442),_0x473f71[_0x4ef442['ok']?_0xed46da(0xab):_0xed46da(0xe2)](_0xed46da(0xa0)+(_0x4ef442[_0xed46da(0xd4)]??(_0x4ef442['ok']?_0xed46da(0xf6):'failed')));const _0x26f4af=a59_0x19a77d({'text':_0xed46da(0xb5),'color':_0xed46da(0xb3)})[_0xed46da(0xce)](),_0x50f722=execSkillsAdd(_0x31b8c7);_0x3207c1[_0xed46da(0x97)](_0x50f722),_0x26f4af[_0x50f722['ok']?_0xed46da(0xab):_0xed46da(0xe2)](_0xed46da(0xe5)+(_0x50f722[_0xed46da(0xd4)]??(_0x50f722['ok']?_0xed46da(0xf6):_0xed46da(0xcb)))),printSummary(_0x3207c1);const _0xdc0c38=_0x3207c1[_0xed46da(0xbe)](_0x1d7134=>!_0x1d7134['ok']);_0xdc0c38?console['log'](a59_0x2a5b79[_0xed46da(0xee)]('Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.')):console[_0xed46da(0xd8)](a59_0x2a5b79['green'](_0xed46da(0xc4)));}export const upgradeCommand={'name':a59_0x81ba70(0x89),'description':a59_0x81ba70(0x9a),async 'run'(_0x2d09be,_0xcc23cd,_0x58739c){await upgradeApp(_0x2d09be,_0x58739c);}};
@@ -1 +1 @@
1
- function a60_0x582b(_0x20f12a,_0x24faf6){_0x20f12a=_0x20f12a-0x12d;const _0x4ba729=a60_0x4ba7();let _0x582b03=_0x4ba729[_0x20f12a];return _0x582b03;}const a60_0xf1026c=a60_0x582b;(function(_0x414fa1,_0x3cfce1){const _0x4996b7=a60_0x582b,_0x352684=_0x414fa1();while(!![]){try{const _0x4a63c2=-parseInt(_0x4996b7(0x139))/0x1+-parseInt(_0x4996b7(0x159))/0x2*(-parseInt(_0x4996b7(0x152))/0x3)+parseInt(_0x4996b7(0x138))/0x4+parseInt(_0x4996b7(0x14d))/0x5*(parseInt(_0x4996b7(0x13c))/0x6)+-parseInt(_0x4996b7(0x160))/0x7*(-parseInt(_0x4996b7(0x170))/0x8)+-parseInt(_0x4996b7(0x133))/0x9+parseInt(_0x4996b7(0x144))/0xa*(parseInt(_0x4996b7(0x134))/0xb);if(_0x4a63c2===_0x3cfce1)break;else _0x352684['push'](_0x352684['shift']());}catch(_0x58f0ae){_0x352684['push'](_0x352684['shift']());}}}(a60_0x4ba7,0x2db47));import{initCommand}from'./init.js';import{createCommand}from'./create.js';import{upgradeCommand}from'./project-upgrade.js';import{runCommand}from'./run.js';import{authCommand}from'./auth.js';import{logoutCommand}from'./logout.js';import{configCommand}from'./config.js';function a60_0x4ba7(){const _0x1f123b=['push','use','project','preview','update','Login\x20via\x20browser','Run\x20any\x20package.json\x20script','107040KenSNW','View\x20command\x20history\x20logs','write','check','auth','Initialize\x20.rabetbase.json\x20config','read','show','skill','1580YCgumG','command','mcp','clear','run','33UMTDrp','SQL\x20Queries','Set\x20config\x20value\x20(key\x20value)','API','add','MCP\x20(AI\x20Tools)','map','1800mzusof','start','service','from','Self\x20Update','Menu','\x20\x20[high-risk-write]','74949XtKlfc','Install\x20developer\x20skill\x20package','Dataset\x20&\x20Operations','Code\x20Generation','risk','remove','logout','app','list','Remove\x20an\x20app\x20from\x20config','values','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','Authentication','doctor','install','Logs','128QkfXgt','Run\x20Scripts','description','BFF\x20Scripts','create','passCommandAsArg','login','config','Configure\x20MCP\x20server\x20for\x20AI\x20tools','wildcardModule','List\x20all\x20configured\x20apps','get','set','defaultCommand','Switch\x20the\x20default\x20app','has','2010177NHtUtC','55PftLSL','Diagnostics','Clear\x20command\x20history\x20logs','init','791800paJtVc','372882VNZISY','Skills','App\x20Management','6660vyMaAQ'];a60_0x4ba7=function(){return _0x1f123b;};return a60_0x4ba7();}import{mcpCommand}from'./mcp.js';import{skillCommand}from'./skill.js';import{logsCommand}from'./logs.js';import{appCommand}from'./app.js';import{updateCommand}from'./cli-update.js';import{doctorCommand}from'./doctor.js';import{apiDefinitions}from'./api/index.js';import{bffDefinitions}from'./bff/index.js';import{sqlDefinitions}from'./sql/index.js';import{datasetDefinitions}from'./dataset/index.js';import{codegenDefinitions}from'./codegen/index.js';import{menuDefinitions}from'./menu/index.js';export const serviceRegistry=[];const serviceByName=new Map(),legacyHandlers=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x35c14a){const _0x31ee1c=a60_0x582b;for(const _0x23f790 of _0x35c14a){definitions[_0x31ee1c(0x12f)](_0x23f790['service']+':'+_0x23f790['command'],_0x23f790);let _0x45ca7e=serviceGroups[_0x31ee1c(0x12e)](_0x23f790['service']);!_0x45ca7e&&(_0x45ca7e=[],serviceGroups['set'](_0x23f790[_0x31ee1c(0x15b)],_0x45ca7e)),_0x45ca7e[_0x31ee1c(0x13d)](_0x23f790);}}function registerDeclarativeService(_0x2cb09d,_0x421ba8){const _0x107419=a60_0x582b;registerDefinitions(_0x421ba8);const _0x10b394=_0xf65a33=>_0xf65a33===_0x107419(0x14a)?'':_0xf65a33===_0x107419(0x146)?'\x20\x20[write]':_0x107419(0x15f),_0x170e88={'service':_0x421ba8[0x0][_0x107419(0x15b)],'label':_0x2cb09d,'commands':_0x421ba8[_0x107419(0x158)](_0x179f7e=>({'command':_0x179f7e[_0x107419(0x14e)],'description':_0x179f7e[_0x107419(0x172)],'tag':_0x10b394(_0x179f7e[_0x107419(0x164)])})),'declarative':!![]};serviceRegistry[_0x107419(0x13d)](_0x170e88),serviceByName[_0x107419(0x12f)](_0x170e88['service'],_0x170e88);}function registerLegacyService(_0x155189,_0x2ed682,_0x12739f,_0x1f393e){const _0x426ba0=a60_0x582b,_0x5d920b={'service':_0x155189,'label':_0x2ed682,'commands':_0x12739f[_0x426ba0(0x158)](_0x37db6c=>({'command':_0x37db6c['command'],'description':_0x37db6c[_0x426ba0(0x172)],'tag':''})),'declarative':![],'defaultCommand':_0x1f393e?.[_0x426ba0(0x130)],'wildcardModule':_0x1f393e?.[_0x426ba0(0x179)]};serviceRegistry[_0x426ba0(0x13d)](_0x5d920b),serviceByName[_0x426ba0(0x12f)](_0x155189,_0x5d920b);for(const _0x3e6562 of _0x12739f){legacyHandlers[_0x426ba0(0x12f)](_0x155189+':'+_0x3e6562[_0x426ba0(0x14e)],{'module':_0x3e6562['module'],'passCommandAsArg':_0x3e6562[_0x426ba0(0x175)]});}}registerLegacyService(a60_0xf1026c(0x13f),'Project',[{'command':a60_0xf1026c(0x137),'description':a60_0xf1026c(0x149),'module':initCommand},{'command':'create','description':'Create\x20a\x20new\x20project','module':createCommand},{'command':'upgrade','description':'Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','module':upgradeCommand}]),registerLegacyService(a60_0xf1026c(0x167),a60_0xf1026c(0x13b),[{'command':a60_0xf1026c(0x168),'description':a60_0xf1026c(0x12d),'module':appCommand,'passCommandAsArg':!![]},{'command':a60_0xf1026c(0x13e),'description':a60_0xf1026c(0x131),'module':appCommand,'passCommandAsArg':!![]},{'command':a60_0xf1026c(0x156),'description':'Add\x20an\x20app\x20to\x20config','module':appCommand,'passCommandAsArg':!![]},{'command':a60_0xf1026c(0x165),'description':a60_0xf1026c(0x169),'module':appCommand,'passCommandAsArg':!![]}],{'defaultCommand':a60_0xf1026c(0x168)}),registerLegacyService(a60_0xf1026c(0x151),a60_0xf1026c(0x171),[{'command':'<script>','description':a60_0xf1026c(0x143),'module':runCommand}],{'wildcardModule':runCommand}),registerLegacyService(a60_0xf1026c(0x148),a60_0xf1026c(0x16c),[{'command':a60_0xf1026c(0x176),'description':a60_0xf1026c(0x142),'module':authCommand},{'command':a60_0xf1026c(0x166),'description':'Clear\x20login\x20session','module':logoutCommand}],{'defaultCommand':a60_0xf1026c(0x176)}),registerLegacyService(a60_0xf1026c(0x141),a60_0xf1026c(0x15d),[{'command':'run','description':a60_0xf1026c(0x16b),'module':updateCommand}],{'defaultCommand':a60_0xf1026c(0x151)}),registerLegacyService(a60_0xf1026c(0x16d),a60_0xf1026c(0x135),[{'command':a60_0xf1026c(0x147),'description':'Diagnose\x20CLI\x20configuration\x20and\x20connectivity','module':doctorCommand}],{'defaultCommand':a60_0xf1026c(0x147)}),registerLegacyService(a60_0xf1026c(0x177),'Configuration',[{'command':a60_0xf1026c(0x12f),'description':a60_0xf1026c(0x154),'module':configCommand,'passCommandAsArg':!![]},{'command':a60_0xf1026c(0x12e),'description':'Get\x20config\x20value\x20(key)','module':configCommand,'passCommandAsArg':!![]},{'command':a60_0xf1026c(0x168),'description':'List\x20all\x20config\x20values','module':configCommand,'passCommandAsArg':!![]}]),registerDeclarativeService(a60_0xf1026c(0x155),apiDefinitions),registerDeclarativeService(a60_0xf1026c(0x15e),menuDefinitions),registerDeclarativeService(a60_0xf1026c(0x162),datasetDefinitions),registerDeclarativeService(a60_0xf1026c(0x173),bffDefinitions),registerDeclarativeService(a60_0xf1026c(0x153),sqlDefinitions),registerDeclarativeService(a60_0xf1026c(0x163),codegenDefinitions),registerLegacyService(a60_0xf1026c(0x14f),a60_0xf1026c(0x157),[{'command':a60_0xf1026c(0x16e),'description':a60_0xf1026c(0x178),'module':mcpCommand,'passCommandAsArg':!![]}]),registerLegacyService('skill',a60_0xf1026c(0x13a),[{'command':a60_0xf1026c(0x16e),'description':a60_0xf1026c(0x161),'module':skillCommand,'passCommandAsArg':!![]}]),registerLegacyService('logs',a60_0xf1026c(0x16f),[{'command':'show','description':a60_0xf1026c(0x145),'module':logsCommand},{'command':a60_0xf1026c(0x150),'description':a60_0xf1026c(0x136),'module':logsCommand,'passCommandAsArg':!![]}],{'defaultCommand':a60_0xf1026c(0x14b)});export const deprecatedAliases={'init':{'service':'project','command':a60_0xf1026c(0x137)},'create':{'service':'project','command':a60_0xf1026c(0x174)},'start':{'service':a60_0xf1026c(0x151),'command':a60_0xf1026c(0x15a)},'build':{'service':a60_0xf1026c(0x151),'command':'build'},'preview':{'service':a60_0xf1026c(0x151),'command':a60_0xf1026c(0x140)},'logout':{'service':'auth','command':'logout'},'skills':{'service':a60_0xf1026c(0x14c),'command':a60_0xf1026c(0x16e)}};export function findDefinition(_0x260566,_0xed281f){return definitions['get'](_0x260566+':'+_0xed281f);}export function isKnownService(_0x422391){return serviceByName['has'](_0x422391);}export function isDeclarativeService(_0x165d8f){const _0x3b979a=a60_0xf1026c;return serviceGroups[_0x3b979a(0x132)](_0x165d8f);}export function getServiceEntry(_0x5ef5d7){const _0x2914ed=a60_0xf1026c;return serviceByName[_0x2914ed(0x12e)](_0x5ef5d7);}export function getLegacyHandler(_0xf8625e,_0x3b7aab){const _0xda71af=a60_0xf1026c;return legacyHandlers[_0xda71af(0x12e)](_0xf8625e+':'+_0x3b7aab);}export function getAllDefinitions(){const _0x3bc8e2=a60_0xf1026c;return Array[_0x3bc8e2(0x15c)](definitions[_0x3bc8e2(0x16a)]());}
1
+ const a60_0x13f788=a60_0x1db0;(function(_0xd71a1,_0x34b098){const _0x5e8e34=a60_0x1db0,_0x2569db=_0xd71a1();while(!![]){try{const _0x4e53da=parseInt(_0x5e8e34(0xd0))/0x1+-parseInt(_0x5e8e34(0xd5))/0x2*(parseInt(_0x5e8e34(0xa9))/0x3)+parseInt(_0x5e8e34(0xe8))/0x4*(parseInt(_0x5e8e34(0xd3))/0x5)+parseInt(_0x5e8e34(0xdf))/0x6*(-parseInt(_0x5e8e34(0xc8))/0x7)+parseInt(_0x5e8e34(0xe7))/0x8*(-parseInt(_0x5e8e34(0xa2))/0x9)+parseInt(_0x5e8e34(0xcb))/0xa+-parseInt(_0x5e8e34(0xd6))/0xb;if(_0x4e53da===_0x34b098)break;else _0x2569db['push'](_0x2569db['shift']());}catch(_0x46dd84){_0x2569db['push'](_0x2569db['shift']());}}}(a60_0x5751,0xd5e7a));import{initCommand}from'./init.js';import{createCommand}from'./create.js';import{upgradeCommand}from'./project-upgrade.js';import{runCommand}from'./run.js';import{authCommand}from'./auth.js';import{logoutCommand}from'./logout.js';import{configCommand}from'./config.js';function a60_0x1db0(_0x34b6ed,_0x103d74){_0x34b6ed=_0x34b6ed-0xa2;const _0x575152=a60_0x5751();let _0x1db0e3=_0x575152[_0x34b6ed];return _0x1db0e3;}import{mcpCommand}from'./mcp.js';import{skillCommand}from'./skill.js';import{logsCommand}from'./logs.js';import{appCommand}from'./app.js';import{updateCommand}from'./cli-update.js';import{doctorCommand}from'./doctor.js';import{apiDefinitions}from'./api/index.js';import{bffDefinitions}from'./bff/index.js';import{sqlDefinitions}from'./sql/index.js';import{datasetDefinitions}from'./dataset/index.js';import{codegenDefinitions}from'./codegen/index.js';import{menuDefinitions}from'./menu/index.js';export const serviceRegistry=[];const serviceByName=new Map(),legacyHandlers=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x2ccd80){const _0x539f8c=a60_0x1db0;for(const _0x3b5033 of _0x2ccd80){definitions[_0x539f8c(0xa8)](_0x3b5033[_0x539f8c(0xbc)]+':'+_0x3b5033[_0x539f8c(0xa7)],_0x3b5033);let _0x23ff5b=serviceGroups['get'](_0x3b5033[_0x539f8c(0xbc)]);!_0x23ff5b&&(_0x23ff5b=[],serviceGroups[_0x539f8c(0xa8)](_0x3b5033[_0x539f8c(0xbc)],_0x23ff5b)),_0x23ff5b[_0x539f8c(0xa6)](_0x3b5033);}}function registerDeclarativeService(_0x5dbddf,_0x3facee){const _0x3133f2=a60_0x1db0;registerDefinitions(_0x3facee);const _0x1bca19=_0x15d4f0=>_0x15d4f0===_0x3133f2(0xb1)?'':_0x15d4f0===_0x3133f2(0xd9)?_0x3133f2(0xe9):_0x3133f2(0xe5),_0x3f883b={'service':_0x3facee[0x0]['service'],'label':_0x5dbddf,'commands':_0x3facee[_0x3133f2(0xc1)](_0x2355e2=>({'command':_0x2355e2[_0x3133f2(0xa7)],'description':_0x2355e2['description'],'tag':_0x1bca19(_0x2355e2[_0x3133f2(0xe0)])})),'declarative':!![]};serviceRegistry[_0x3133f2(0xa6)](_0x3f883b),serviceByName['set'](_0x3f883b['service'],_0x3f883b);}function registerLegacyService(_0x1b40f9,_0x3053a7,_0xc91a18,_0x19e4c0){const _0x4c3f38=a60_0x1db0,_0x37acf5={'service':_0x1b40f9,'label':_0x3053a7,'commands':_0xc91a18[_0x4c3f38(0xc1)](_0x23d576=>({'command':_0x23d576[_0x4c3f38(0xa7)],'description':_0x23d576[_0x4c3f38(0xa3)],'tag':''})),'declarative':![],'defaultCommand':_0x19e4c0?.[_0x4c3f38(0xc4)],'wildcardModule':_0x19e4c0?.[_0x4c3f38(0xa5)]};serviceRegistry[_0x4c3f38(0xa6)](_0x37acf5),serviceByName[_0x4c3f38(0xa8)](_0x1b40f9,_0x37acf5);for(const _0x15cd2c of _0xc91a18){legacyHandlers[_0x4c3f38(0xa8)](_0x1b40f9+':'+_0x15cd2c['command'],{'module':_0x15cd2c[_0x4c3f38(0xe2)],'passCommandAsArg':_0x15cd2c[_0x4c3f38(0xa4)]});}}registerLegacyService(a60_0x13f788(0xb2),a60_0x13f788(0xb5),[{'command':a60_0x13f788(0xaf),'description':'Initialize\x20.rabetbase.json\x20config','module':initCommand},{'command':'create','description':a60_0x13f788(0xbf),'module':createCommand},{'command':a60_0x13f788(0xbe),'description':'Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','module':upgradeCommand}]),registerLegacyService(a60_0x13f788(0xbd),'App\x20Management',[{'command':a60_0x13f788(0xb7),'description':'List\x20all\x20configured\x20apps','module':appCommand,'passCommandAsArg':!![]},{'command':a60_0x13f788(0xe6),'description':a60_0x13f788(0xdc),'module':appCommand,'passCommandAsArg':!![]},{'command':'add','description':a60_0x13f788(0xb9),'module':appCommand,'passCommandAsArg':!![]},{'command':a60_0x13f788(0xae),'description':a60_0x13f788(0xc7),'module':appCommand,'passCommandAsArg':!![]}],{'defaultCommand':a60_0x13f788(0xb7)}),registerLegacyService(a60_0x13f788(0xe3),'Run\x20Scripts',[{'command':a60_0x13f788(0xce),'description':a60_0x13f788(0xc3),'module':runCommand}],{'wildcardModule':runCommand}),registerLegacyService(a60_0x13f788(0xb4),'Authentication',[{'command':a60_0x13f788(0xcd),'description':a60_0x13f788(0xc2),'module':authCommand},{'command':a60_0x13f788(0xd7),'description':'Clear\x20login\x20session','module':logoutCommand}],{'defaultCommand':a60_0x13f788(0xcd)}),registerLegacyService('update',a60_0x13f788(0xc0),[{'command':a60_0x13f788(0xe3),'description':'Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','module':updateCommand}],{'defaultCommand':a60_0x13f788(0xe3)}),registerLegacyService(a60_0x13f788(0xd1),'Diagnostics',[{'command':a60_0x13f788(0xc5),'description':'Diagnose\x20CLI\x20configuration\x20and\x20connectivity','module':doctorCommand}],{'defaultCommand':'check'}),registerLegacyService(a60_0x13f788(0xba),'Configuration',[{'command':a60_0x13f788(0xa8),'description':a60_0x13f788(0xb8),'module':configCommand,'passCommandAsArg':!![]},{'command':a60_0x13f788(0xad),'description':a60_0x13f788(0xea),'module':configCommand,'passCommandAsArg':!![]},{'command':'list','description':a60_0x13f788(0xb6),'module':configCommand,'passCommandAsArg':!![]}]),registerDeclarativeService(a60_0x13f788(0xec),apiDefinitions),registerDeclarativeService(a60_0x13f788(0xdb),menuDefinitions),registerDeclarativeService(a60_0x13f788(0xd4),datasetDefinitions),registerDeclarativeService(a60_0x13f788(0xda),bffDefinitions),registerDeclarativeService(a60_0x13f788(0xd2),sqlDefinitions),registerDeclarativeService(a60_0x13f788(0xca),codegenDefinitions),registerLegacyService('mcp','MCP\x20(AI\x20Tools)',[{'command':a60_0x13f788(0xcf),'description':a60_0x13f788(0xd8),'module':mcpCommand,'passCommandAsArg':!![]}]),registerLegacyService(a60_0x13f788(0xdd),a60_0x13f788(0xc9),[{'command':'install','description':a60_0x13f788(0xb0),'module':skillCommand,'passCommandAsArg':!![]}]),registerLegacyService(a60_0x13f788(0xbb),a60_0x13f788(0xaa),[{'command':a60_0x13f788(0xeb),'description':'View\x20command\x20history\x20logs','module':logsCommand},{'command':a60_0x13f788(0xc6),'description':a60_0x13f788(0xb3),'module':logsCommand,'passCommandAsArg':!![]}],{'defaultCommand':a60_0x13f788(0xeb)});export const deprecatedAliases={'init':{'service':a60_0x13f788(0xb2),'command':a60_0x13f788(0xaf)},'create':{'service':a60_0x13f788(0xb2),'command':a60_0x13f788(0xab)},'start':{'service':a60_0x13f788(0xe3),'command':a60_0x13f788(0xe1)},'build':{'service':a60_0x13f788(0xe3),'command':a60_0x13f788(0xe4)},'preview':{'service':a60_0x13f788(0xe3),'command':'preview'},'logout':{'service':a60_0x13f788(0xb4),'command':a60_0x13f788(0xd7)},'skills':{'service':a60_0x13f788(0xdd),'command':'install'}};export function findDefinition(_0x56db08,_0x2c43b8){const _0x36c927=a60_0x13f788;return definitions[_0x36c927(0xad)](_0x56db08+':'+_0x2c43b8);}export function isKnownService(_0x4f8994){return serviceByName['has'](_0x4f8994);}export function isDeclarativeService(_0x4e4611){const _0x838bff=a60_0x13f788;return serviceGroups[_0x838bff(0xac)](_0x4e4611);}function a60_0x5751(){const _0x302dcb=['1264708tsYWlK','doctor','SQL\x20Queries','10415deTBuo','Dataset\x20&\x20Operations','66cdqRuq','790416HYTXVE','logout','Configure\x20MCP\x20server\x20for\x20AI\x20tools','write','BFF\x20Scripts','Menu','Switch\x20the\x20default\x20app','skill','from','2172UJEfzg','risk','start','module','run','build','\x20\x20[high-risk-write]','use','304FXCJlV','3204JyrApy','\x20\x20[write]','Get\x20config\x20value\x20(key)','show','API','381141fDTWzn','description','passCommandAsArg','wildcardModule','push','command','set','109113ExcqgF','Logs','create','has','get','remove','init','Install\x20developer\x20skill\x20package','read','project','Clear\x20command\x20history\x20logs','auth','Project','List\x20all\x20config\x20values','list','Set\x20config\x20value\x20(key\x20value)','Add\x20an\x20app\x20to\x20config','config','logs','service','app','upgrade','Create\x20a\x20new\x20project','Self\x20Update','map','Login\x20via\x20browser','Run\x20any\x20package.json\x20script','defaultCommand','check','clear','Remove\x20an\x20app\x20from\x20config','12075PBAHgO','Skills','Code\x20Generation','14487740eAgbYV','values','login','<script>','install'];a60_0x5751=function(){return _0x302dcb;};return a60_0x5751();}export function getServiceEntry(_0x1445f0){const _0x17dd29=a60_0x13f788;return serviceByName[_0x17dd29(0xad)](_0x1445f0);}export function getLegacyHandler(_0xe39c3a,_0x183a3d){const _0xc28c64=a60_0x13f788;return legacyHandlers[_0xc28c64(0xad)](_0xe39c3a+':'+_0x183a3d);}export function getAllDefinitions(){const _0x3542e5=a60_0x13f788;return Array[_0x3542e5(0xde)](definitions[_0x3542e5(0xcc)]());}