@lovrabet/cli 1.2.5-beta.1 → 1.2.5-beta.3

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 (81) hide show
  1. package/lib/add-page/input-page-router.js +1 -1
  2. package/lib/add-page/main.js +1 -1
  3. package/lib/add-page/select-page-template.js +1 -1
  4. package/lib/ai-setup/AISetupUI.js +1 -0
  5. package/lib/ai-setup/config.js +1 -0
  6. package/lib/api/api-doc-ui.js +1 -1
  7. package/lib/api/api-doc.js +1 -1
  8. package/lib/api/api-pull-ui.js +1 -1
  9. package/lib/api/fetch-model-list.js +1 -1
  10. package/lib/api/generate-api-file.js +1 -1
  11. package/lib/api/main.js +1 -1
  12. package/lib/api/pull-silent.js +1 -1
  13. package/lib/app-menu/app-menu-sync-ui.js +1 -1
  14. package/lib/app-menu/create-menu.js +1 -1
  15. package/lib/app-menu/get-local-pages.js +1 -1
  16. package/lib/app-menu/get-online-menu-list.js +1 -1
  17. package/lib/app-menu/use-get-online-menu-list.js +1 -1
  18. package/lib/app-menu/utils.js +1 -1
  19. package/lib/app-menu/valid-url.js +1 -1
  20. package/lib/app-menu-update-cdn/current-content.js +1 -1
  21. package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
  22. package/lib/app-menu-update-cdn/main.js +1 -1
  23. package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
  24. package/lib/auth/auth-server-ui.js +1 -1
  25. package/lib/auth/auth-server.js +1 -1
  26. package/lib/auth/constant.js +1 -1
  27. package/lib/auth/get-cookie.js +1 -1
  28. package/lib/auth/is-session-valid.js +1 -1
  29. package/lib/auth/logout.js +1 -1
  30. package/lib/cli.js +1 -1
  31. package/lib/cmd/build-watch.js +1 -1
  32. package/lib/cmd/build.js +1 -1
  33. package/lib/cmd/logs.js +1 -1
  34. package/lib/cmd/preview.js +1 -1
  35. package/lib/cmd/start.js +1 -1
  36. package/lib/config/config-help.js +1 -1
  37. package/lib/config/main.js +1 -1
  38. package/lib/constant/domain.js +1 -1
  39. package/lib/constant/env.js +1 -1
  40. package/lib/create-app/enhanced-guided-create.js +1 -1
  41. package/lib/create-app/format-elapsed.js +1 -1
  42. package/lib/create-app/main.js +1 -1
  43. package/lib/create-app/task-finished.js +1 -1
  44. package/lib/create-app/task-loading.js +1 -1
  45. package/lib/create-app/task-running.js +1 -1
  46. package/lib/create-app/task-time.js +1 -1
  47. package/lib/create-app/use-copy-project-template.js +1 -1
  48. package/lib/create-app/use-format-code.js +1 -1
  49. package/lib/create-app/use-install-dependencies.js +1 -1
  50. package/lib/help.js +1 -1
  51. package/lib/init/main.js +1 -1
  52. package/lib/mcp/McpInstallUI.js +1 -0
  53. package/lib/mcp/claude.js +1 -1
  54. package/lib/mcp/cursor.js +1 -1
  55. package/lib/mcp/main.js +1 -1
  56. package/lib/skills/SkillInstallUI.js +1 -0
  57. package/lib/skills/main.js +1 -1
  58. package/lib/utils/check-sdk-version.js +1 -1
  59. package/lib/utils/config.js +1 -1
  60. package/lib/utils/copy-directory.js +1 -1
  61. package/lib/utils/http-client.js +1 -1
  62. package/lib/utils/logger.js +1 -1
  63. package/lib/utils/router-updater.js +1 -1
  64. package/lib/utils/sleep.js +1 -1
  65. package/lib/utils/template-replacer.js +1 -1
  66. package/package.json +1 -1
  67. package/templates/pages/blank/index.tsx.tpl +1 -2
  68. package/templates/pages/sdk-fetch/index.tsx.tpl +1 -2
  69. package/templates/rules/lovrabet_rules.mdc.tpl +109 -0
  70. package/templates/skills/.agent/skills/lovrabet/SKILL.md +258 -0
  71. package/templates/skills/.claude/skills/lovrabet/SKILL.md +1 -0
  72. package/templates/skills/.codebuddy/skills/lovrabet/SKILL.md +258 -0
  73. package/templates/skills/.codex/skills/lovrabet/SKILL.md +258 -0
  74. package/templates/skills/.cursor/commands/lovrabet.md +1 -0
  75. package/templates/skills/.opencode/skills/lovrabet/SKILL.md +258 -0
  76. package/templates/skills/.qoder/rules/lovrabet.md +258 -0
  77. package/templates/skills/.qoder/skills/lovrabet.md +258 -0
  78. package/templates/skills/.shared/guides/03-antd-style/guide.md +42 -0
  79. package/templates/skills/.shared/guides/07-backend-function/guide.md +679 -0
  80. package/templates/skills/.trae/skills/lovrabet/SKILL.md +258 -0
  81. package/templates/skills/.windsurf/workflows/lovrabet.md +1 -0
@@ -1 +1 @@
1
- function a10_0xd31a(){const _0x237e0b=['\x20←\x20','blue','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','请至少选择一个菜单','delete','[✓]','[\x20]','创建菜单失败','*\x20请选择要同步的菜单:','done','max','菜单名称','808532YvCaKU','white','value','input-js','1358024KUoNze','includes','map','36SaZXXh','filter','repeat','lovrabet\x20auth','input-css','path','388966RnkvHL','*\x20JS\x20链接:\x20','3PVMEaB','gray','CSS\x20链接无法访问','creating','test','2332115qBvqDT','local','CSS\x20链接','return','green','JS\x20链接','has','11817930sTpHSw','backspace','326426KEtuGw','6HTCUxr','trim','downArrow','size','!\x20未找到本地页面,请先创建页面','slice','247401xMquPq','JS\x20链接无法访问','selecting','*\x20同步菜单到\x20Lovrabet\x20平台','red','fill','cyan','已选择菜单','yellow','online','length','\x20输入项目的\x20JS\x20资源链接(https://...)','add','column','join','*\x20CSS\x20链接:\x20','\x20输入项目的\x20CSS\x20资源链接(https://...)','label','Lovrabet平台'];a10_0xd31a=function(){return _0x237e0b;};return a10_0xd31a();}function a10_0x29c0(_0x4b076b,_0x5cb343){_0x4b076b=_0x4b076b-0x1a6;const _0xd31a65=a10_0xd31a();let _0x29c0c8=_0xd31a65[_0x4b076b];return _0x29c0c8;}(function(_0x1b5996,_0x1cad29){const _0x163773=a10_0x29c0,_0x375aa9=_0x1b5996();while(!![]){try{const _0x465a1a=parseInt(_0x163773(0x1ca))/0x1+parseInt(_0x163773(0x1ba))/0x2+-parseInt(_0x163773(0x1bc))/0x3*(parseInt(_0x163773(0x1ad))/0x4)+parseInt(_0x163773(0x1c1))/0x5*(-parseInt(_0x163773(0x1cb))/0x6)+parseInt(_0x163773(0x1d1))/0x7+parseInt(_0x163773(0x1b1))/0x8*(-parseInt(_0x163773(0x1b4))/0x9)+parseInt(_0x163773(0x1c8))/0xa;if(_0x465a1a===_0x1cad29)break;else _0x375aa9['push'](_0x375aa9['shift']());}catch(_0x397ee5){_0x375aa9['push'](_0x375aa9['shift']());}}}(a10_0xd31a,0x5f54d));import{jsx as a10_0x3028ac,jsxs as a10_0x501adf,Fragment as a10_0x347a28}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a10_0x1f7fa1 from'ink-spinner';import{useGetOnlineMenuList}from'./use-get-online-menu-list.js';import{getLocalPages}from'./get-local-pages.js';import{createMenus}from'./create-menu.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import.meta.main&&render(a10_0x3028ac(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x52d215=a10_0x29c0,{exit:_0x3e2b50}=useApp(),{loading:_0x1374dd,menuList:_0x2ef46b,error:_0x1e1cf5}=useGetOnlineMenuList(),_0x1eed78=getLocalPages(),_0x437e19=_0x2ef46b[_0x52d215(0x1b3)](_0x4c196d=>_0x4c196d['path']),_0xcd7cfd=['菜单名称',..._0x1eed78[_0x52d215(0x1b3)](_0x3b7645=>_0x3b7645[_0x52d215(0x1e2)])],_0x1ce53e=getStringWidth(getMaxWidth(_0xcd7cfd,0x4)),_0x584a4b=getStringWidth(getMaxWidth([_0x52d215(0x1ac)])),[_0x32a5bb,_0x2b41e8]=useState(_0x52d215(0x1d3)),[_0x2d5823,_0x825753]=useState(new Set()),[_0x27943e,_0x5c9295]=useState(0x0),[_0x23db5b,_0x58abc7]=useState(''),[_0x4c6562,_0x1500b7]=useState(''),[_0x3dff4f,_0x32b7ee]=useState(''),[_0x2765a1,_0x6e7cae]=useState(''),[_0x578a81,_0x5de673]=useState([]),_0x68a881=_0x1eed78[_0x52d215(0x1b3)](_0x137d36=>({'label':_0x137d36[_0x52d215(0x1e2)],'path':_0x137d36[_0x52d215(0x1b9)],'local':!![],'online':_0x437e19[_0x52d215(0x1b2)](_0x137d36[_0x52d215(0x1b9)])})),_0x40709d=_0x1eed78['filter'](_0x12ecf5=>{const _0x354a35=_0x52d215;return!_0x437e19[_0x354a35(0x1b2)](_0x12ecf5['path']);});useEffect(()=>{const _0x4806e7=_0x52d215;if(!_0x1374dd&&_0x1eed78[_0x4806e7(0x1db)]>0x0&&_0x2d5823['size']===0x0){const _0x33f5b6=new Set(_0x1eed78[_0x4806e7(0x1b3)]((_0x56e3ea,_0x47f268)=>({'page':_0x56e3ea,'index':_0x47f268}))[_0x4806e7(0x1b5)](({page:_0xf58e6a})=>!_0x437e19['includes'](_0xf58e6a[_0x4806e7(0x1b9)]))[_0x4806e7(0x1b3)](({index:_0x490b05})=>_0x490b05));_0x825753(_0x33f5b6);}},[_0x1374dd,_0x1eed78[_0x52d215(0x1db)],_0x437e19[_0x52d215(0x1db)]]),useInput(async(_0x4f3c0d,_0x4e27dc)=>{const _0x1bef6b=_0x52d215;if(_0x32a5bb===_0x1bef6b(0x1d3)){if(_0x4e27dc['upArrow']){_0x5c9295(_0x29db52=>_0x29db52>0x0?_0x29db52-0x1:_0x1eed78[_0x1bef6b(0x1db)]-0x1);return;}if(_0x4e27dc[_0x1bef6b(0x1cd)]){_0x5c9295(_0x28be65=>_0x28be65<_0x1eed78[_0x1bef6b(0x1db)]-0x1?_0x28be65+0x1:0x0);return;}if(_0x4f3c0d==='\x20'){_0x825753(_0x353b48=>{const _0x45f4e3=_0x1bef6b,_0x32f082=new Set(_0x353b48);return _0x32f082[_0x45f4e3(0x1c7)](_0x27943e)?_0x32f082[_0x45f4e3(0x1e8)](_0x27943e):_0x32f082[_0x45f4e3(0x1dd)](_0x27943e),_0x32f082;});return;}if(_0x4f3c0d==='a'||_0x4f3c0d==='A'){const _0x481901=new Set(_0x1eed78[_0x1bef6b(0x1b3)]((_0x2bef41,_0x18bb64)=>_0x18bb64));_0x825753(_0x481901);return;}if(_0x4f3c0d==='i'||_0x4f3c0d==='I'||_0x4f3c0d==='r'||_0x4f3c0d==='R'){_0x825753(_0xf18ccb=>{const _0x13e659=_0x1bef6b,_0x939b7f=new Set();for(let _0x4722e8=0x0;_0x4722e8<_0x1eed78['length'];_0x4722e8++){!_0xf18ccb[_0x13e659(0x1c7)](_0x4722e8)&&_0x939b7f[_0x13e659(0x1dd)](_0x4722e8);}return _0x939b7f;});return;}if(_0x4f3c0d==='q'||_0x4f3c0d==='Q'){_0x3e2b50();return;}if(_0x4e27dc['return']){if(_0x2d5823[_0x1bef6b(0x1ce)]===0x0){_0x6e7cae(_0x1bef6b(0x1e7));return;}const _0x45cb24=_0x1eed78['filter']((_0x298c0f,_0xa03d1e)=>_0x2d5823[_0x1bef6b(0x1c7)](_0xa03d1e)),_0xfdabc9=_0x45cb24['map'](_0x2186b4=>_0x2186b4[_0x1bef6b(0x1e2)])[_0x1bef6b(0x1df)](',\x20');_0x5de673([{'label':_0x1bef6b(0x1d8),'value':_0x2d5823[_0x1bef6b(0x1ce)]+'\x20个'}]),_0x6e7cae(''),_0x2b41e8(_0x1bef6b(0x1b0));return;}return;}if(_0x32a5bb===_0x1bef6b(0x1b0)){if(_0x4e27dc[_0x1bef6b(0x1c4)]){const _0x38d95a=_0x3dff4f[_0x1bef6b(0x1cc)]();if(_0x38d95a==='')return;if(!isValidJsHttpsUrl(_0x38d95a)){_0x6e7cae('请输入有效的\x20JS\x20https\x20链接');return;}if(!await isUrlReachable(_0x38d95a)){_0x6e7cae(_0x1bef6b(0x1d2));return;}_0x58abc7(_0x38d95a),_0x5de673(_0x4dd869=>[..._0x4dd869,{'label':_0x1bef6b(0x1c6),'value':_0x38d95a}]),_0x32b7ee(''),_0x6e7cae(''),_0x2b41e8(_0x1bef6b(0x1b8));return;}if(_0x4e27dc[_0x1bef6b(0x1c9)]||_0x4e27dc['delete']){_0x32b7ee(_0x5d9fa0=>_0x5d9fa0[_0x1bef6b(0x1d0)](0x0,-0x1)),_0x6e7cae('');return;}_0x32b7ee(_0x1113fa=>_0x1113fa+_0x4f3c0d);return;}if(_0x32a5bb===_0x1bef6b(0x1b8)){if(_0x4e27dc[_0x1bef6b(0x1c4)]){const _0x2971e0=_0x3dff4f['trim']();if(_0x2971e0==='')return;if(!isValidCssHttpsUrl(_0x2971e0)){_0x6e7cae('请输入有效的\x20CSS\x20https\x20链接');return;}if(!await isUrlReachable(_0x2971e0)){_0x6e7cae(_0x1bef6b(0x1be));return;}_0x1500b7(_0x2971e0),_0x5de673(_0x3fbc4c=>[..._0x3fbc4c,{'label':_0x1bef6b(0x1c3),'value':_0x2971e0}]),_0x32b7ee(''),_0x6e7cae(''),_0x2b41e8(_0x1bef6b(0x1bf));const _0x4f3546=_0x1eed78[_0x1bef6b(0x1b5)]((_0x898c29,_0x3c6244)=>_0x2d5823[_0x1bef6b(0x1c7)](_0x3c6244));createMenus(_0x4f3546,[_0x23db5b,_0x2971e0])['then'](()=>{const _0x45f92d=_0x1bef6b;_0x2b41e8(_0x45f92d(0x1aa)),setTimeout(()=>{_0x3e2b50();},0x3e8);})['catch'](_0x52d539=>{const _0xb49071=_0x1bef6b;_0x6e7cae(_0x52d539['message']||_0xb49071(0x1a8)),_0x2b41e8(_0xb49071(0x1d3));});return;}if(_0x4e27dc[_0x1bef6b(0x1c9)]||_0x4e27dc[_0x1bef6b(0x1e8)]){_0x32b7ee(_0x51f3aa=>_0x51f3aa['slice'](0x0,-0x1)),_0x6e7cae('');return;}_0x32b7ee(_0x21f9ae=>_0x21f9ae+_0x4f3c0d);return;}});if(_0x1374dd)return a10_0x501adf(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x3028ac(Text,{'children':'\x20\x20'}),a10_0x3028ac(a10_0x1f7fa1,{'type':'dots'}),a10_0x3028ac(Text,{'children':'\x20正在获取线上菜单列表...'})]});if(_0x1e1cf5)return a10_0x501adf(Box,{'flexDirection':_0x52d215(0x1de),'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x501adf(Text,{'color':'red','children':['✗\x20',_0x1e1cf5]}),a10_0x501adf(Box,{'marginTop':0x1,'children':[a10_0x3028ac(Text,{'color':_0x52d215(0x1bd),'children':'提示:使用\x20'}),a10_0x3028ac(Text,{'color':_0x52d215(0x1d7),'children':_0x52d215(0x1b7)}),a10_0x3028ac(Text,{'color':_0x52d215(0x1bd),'children':'\x20命令重新登录'})]})]});if(_0x1eed78['length']===0x0)return a10_0x3028ac(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0x3028ac(Text,{'color':_0x52d215(0x1d9),'children':_0x52d215(0x1cf)})});return a10_0x501adf(Box,{'flexDirection':_0x52d215(0x1de),'marginTop':0x1,'marginBottom':0x1,'children':[_0x32a5bb===_0x52d215(0x1d3)&&a10_0x501adf(a10_0x347a28,{'children':[a10_0x501adf(Box,{'children':[a10_0x501adf(Text,{'bold':!![],'children':['\x20\x20',_0x52d215(0x1ac),getRemainingSpaces(_0x1ce53e,_0x52d215(0x1ac))]}),a10_0x501adf(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x584a4b,_0x52d215(0x1ac))]}),a10_0x501adf(Text,{'bold':!![],'children':[_0x52d215(0x1e3),getRemainingSpaces(_0x584a4b,_0x52d215(0x1ac))]})]}),_0x68a881[_0x52d215(0x1b3)](_0x2b2f2b=>a10_0x501adf(Box,{'children':[a10_0x501adf(Text,{'children':['\x20\x20',_0x2b2f2b['label'],getRemainingSpaces(_0x1ce53e,_0x2b2f2b[_0x52d215(0x1e2)])]}),a10_0x501adf(Text,{'color':'green','children':[_0x2b2f2b[_0x52d215(0x1c2)]?'✓':'✗',getRemainingSpaces(_0x584a4b,'✓')]}),a10_0x501adf(Text,{'color':_0x2b2f2b[_0x52d215(0x1da)]?_0x52d215(0x1c5):_0x52d215(0x1d5),'children':[_0x2b2f2b['online']?'✓':'✗',getRemainingSpaces(_0x584a4b,'✓')]})]},_0x2b2f2b['path']))]}),_0x32a5bb===_0x52d215(0x1d3)&&_0x578a81['length']===0x0&&a10_0x3028ac(Box,{'marginTop':0x1,'children':a10_0x3028ac(Text,{'color':_0x52d215(0x1d7),'children':_0x52d215(0x1d4)})}),_0x578a81[_0x52d215(0x1b3)]((_0x36ca0d,_0x246513)=>a10_0x501adf(Box,{'children':[a10_0x501adf(Text,{'color':_0x52d215(0x1c5),'children':['√\x20',_0x36ca0d[_0x52d215(0x1e2)],':\x20']}),a10_0x3028ac(Text,{'color':'cyan','children':_0x36ca0d[_0x52d215(0x1af)]})]},_0x246513)),_0x2765a1&&_0x32a5bb===_0x52d215(0x1d3)&&a10_0x3028ac(Box,{'marginTop':0x1,'children':a10_0x501adf(Text,{'color':_0x52d215(0x1d5),'children':['✗\x20',_0x2765a1]})}),_0x32a5bb===_0x52d215(0x1d3)&&a10_0x3028ac(a10_0x347a28,{'children':a10_0x501adf(Box,{'marginTop':_0x578a81[_0x52d215(0x1db)]>0x0||_0x2765a1?0x1:0x0,'flexDirection':_0x52d215(0x1de),'children':[a10_0x3028ac(Text,{'bold':!![],'children':_0x52d215(0x1a9)}),_0x1eed78['map']((_0x66314c,_0x431af9)=>{const _0x6b5c18=_0x52d215,_0x25acb5=_0x27943e===_0x431af9,_0x4cceac=_0x2d5823[_0x6b5c18(0x1c7)](_0x431af9),_0x44bd2d=_0x437e19['includes'](_0x66314c[_0x6b5c18(0x1b9)]),_0x24f42d=_0x44bd2d?'更新':'新建';return a10_0x3028ac(Box,{'children':a10_0x501adf(Text,{'backgroundColor':_0x25acb5?_0x6b5c18(0x1e5):undefined,'color':_0x25acb5?_0x6b5c18(0x1ae):undefined,'children':['\x20\x20',_0x4cceac?_0x6b5c18(0x1a6):_0x6b5c18(0x1a7),'\x20',_0x66314c['label']]})},_0x66314c['path']);}),a10_0x3028ac(Box,{'marginTop':0x1,'children':a10_0x501adf(Text,{'color':_0x52d215(0x1bd),'children':['\x20',_0x52d215(0x1e6)]})})]})}),_0x32a5bb==='input-js'&&a10_0x501adf(a10_0x347a28,{'children':[a10_0x501adf(Box,{'children':[a10_0x3028ac(Text,{'children':_0x52d215(0x1bb)}),a10_0x3028ac(Text,{'color':'green','children':_0x3dff4f}),_0x2765a1&&a10_0x501adf(Text,{'color':_0x52d215(0x1d5),'children':[_0x52d215(0x1e4),_0x2765a1]})]}),!_0x2765a1&&a10_0x3028ac(Box,{'children':a10_0x3028ac(Text,{'color':_0x52d215(0x1bd),'children':_0x52d215(0x1dc)})})]}),_0x32a5bb===_0x52d215(0x1b8)&&a10_0x501adf(a10_0x347a28,{'children':[a10_0x501adf(Box,{'children':[a10_0x3028ac(Text,{'children':_0x52d215(0x1e0)}),a10_0x3028ac(Text,{'color':'green','children':_0x3dff4f}),_0x2765a1&&a10_0x501adf(Text,{'color':_0x52d215(0x1d5),'children':[_0x52d215(0x1e4),_0x2765a1]})]}),!_0x2765a1&&a10_0x3028ac(Box,{'children':a10_0x3028ac(Text,{'color':_0x52d215(0x1bd),'children':_0x52d215(0x1e1)})})]}),_0x32a5bb===_0x52d215(0x1bf)&&a10_0x3028ac(Box,{'children':a10_0x3028ac(Text,{'children':'*\x20正在创建菜单...'})}),_0x32a5bb===_0x52d215(0x1aa)&&a10_0x3028ac(Box,{'children':a10_0x3028ac(Text,{'color':_0x52d215(0x1c5),'children':'√\x20菜单创建完成'})})]});}function getStringWidth(_0x1c3d77){const _0x77f93a=a10_0x29c0;let _0x2e8a64=0x0;for(const _0x4fc3e1 of _0x1c3d77){/[\u4e00-\u9fa5]/[_0x77f93a(0x1c0)](_0x4fc3e1)?_0x2e8a64+=0x2:_0x2e8a64+=0x1;}return _0x2e8a64;}function getRemainingSpaces(_0x8901cb,_0x4d84ac){const _0x42a534=a10_0x29c0,_0x1029bc=getStringWidth(_0x4d84ac);return Array(Math[_0x42a534(0x1ab)](0x0,_0x8901cb-_0x1029bc))[_0x42a534(0x1d6)]('\x20')[_0x42a534(0x1df)]('');}function getMaxWidth(_0x17359c,_0x2d1cc2=0x2){const _0x5aa19c=a10_0x29c0;let _0x37df91='',_0x4978d3=0x0;for(const _0x347e9f of _0x17359c){const _0xc7ae23=getStringWidth(_0x347e9f);_0xc7ae23>_0x4978d3&&(_0x4978d3=_0xc7ae23,_0x37df91=_0x347e9f);}return _0x37df91+'\x20'[_0x5aa19c(0x1b6)](_0x2d1cc2);}
1
+ function a12_0x2e64(){const _0x26d99e=['add','creating','test','!\x20未找到本地页面,请先创建页面','then','upArrow','backspace','[✓]','path','label','[\x20]','lovrabet\x20auth','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','local','134601CVCLKg','has','filter','2666532NPRwJJ','blue','green','gray','请至少选择一个菜单','join','online','length','提示:使用\x20','创建菜单失败','5DjAVqz','downArrow','1929636baCoNO','JS\x20链接无法访问','white','map','3774400oYqtRH','dots','已选择菜单','*\x20同步菜单到\x20Lovrabet\x20平台','column','selecting','catch','7602039UcQBsc','slice','\x20←\x20','11116lgxbDS','cyan','fill','\x20输入项目的\x20JS\x20资源链接(https://...)','菜单名称','*\x20正在创建菜单...','input-css','132vwVZMb','delete','max','red','CSS\x20链接无法访问','return','请输入有效的\x20CSS\x20https\x20链接','3943192vcKTOY','input-js','includes','message','size','done','\x20正在获取线上菜单列表...','√\x20菜单创建完成','trim','请输入有效的\x20JS\x20https\x20链接'];a12_0x2e64=function(){return _0x26d99e;};return a12_0x2e64();}(function(_0x167b79,_0x40e10e){const _0x2d2560=a12_0x5986,_0x28c8f3=_0x167b79();while(!![]){try{const _0x481a01=parseInt(_0x2d2560(0x12f))/0x1+-parseInt(_0x2d2560(0x109))/0x2*(parseInt(_0x2d2560(0x110))/0x3)+parseInt(_0x2d2560(0x132))/0x4*(-parseInt(_0x2d2560(0x13c))/0x5)+parseInt(_0x2d2560(0x13e))/0x6+parseInt(_0x2d2560(0xff))/0x7+-parseInt(_0x2d2560(0x117))/0x8+parseInt(_0x2d2560(0x106))/0x9;if(_0x481a01===_0x40e10e)break;else _0x28c8f3['push'](_0x28c8f3['shift']());}catch(_0x4d6256){_0x28c8f3['push'](_0x28c8f3['shift']());}}}(a12_0x2e64,0x6a71a));import{jsx as a12_0x56e86a,jsxs as a12_0x6b84ed,Fragment as a12_0x20e1c4}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a12_0x29aca0 from'ink-spinner';import{useGetOnlineMenuList}from'./use-get-online-menu-list.js';import{getLocalPages}from'./get-local-pages.js';import{createMenus}from'./create-menu.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';function a12_0x5986(_0x3d0c83,_0x551ae9){_0x3d0c83=_0x3d0c83-0xff;const _0x2e6466=a12_0x2e64();let _0x59861e=_0x2e6466[_0x3d0c83];return _0x59861e;}import.meta.main&&render(a12_0x56e86a(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x30df88=a12_0x5986,{exit:_0x56b365}=useApp(),{loading:_0x20db93,menuList:_0x40aeae,error:_0x55ba5f}=useGetOnlineMenuList(),_0xca285d=getLocalPages(),_0x3fb5c0=_0x40aeae[_0x30df88(0x141)](_0x360736=>_0x360736[_0x30df88(0x129)]),_0xb4af8c=[_0x30df88(0x10d),..._0xca285d[_0x30df88(0x141)](_0x405109=>_0x405109['label'])],_0x2e8800=getStringWidth(getMaxWidth(_0xb4af8c,0x4)),_0x5716d1=getStringWidth(getMaxWidth(['菜单名称'])),[_0x26adb8,_0x28a573]=useState(_0x30df88(0x104)),[_0x433ba0,_0x1b1c9b]=useState(new Set()),[_0xac0b8e,_0x37c76e]=useState(0x0),[_0x2357b4,_0x6ba149]=useState(''),[_0x43d195,_0x151282]=useState(''),[_0x557ea4,_0x992b50]=useState(''),[_0x7d5a29,_0x5df2d0]=useState(''),[_0x10c1e7,_0x174934]=useState([]),_0x334809=_0xca285d[_0x30df88(0x141)](_0x1da65b=>({'label':_0x1da65b[_0x30df88(0x12a)],'path':_0x1da65b['path'],'local':!![],'online':_0x3fb5c0['includes'](_0x1da65b[_0x30df88(0x129)])})),_0x8c7a67=_0xca285d[_0x30df88(0x131)](_0x342f7c=>{const _0xdd929c=_0x30df88;return!_0x3fb5c0[_0xdd929c(0x119)](_0x342f7c[_0xdd929c(0x129)]);});useEffect(()=>{const _0x56dd3c=_0x30df88;if(!_0x20db93&&_0xca285d[_0x56dd3c(0x139)]>0x0&&_0x433ba0['size']===0x0){const _0x464706=new Set(_0xca285d[_0x56dd3c(0x141)]((_0x18461d,_0x8b9d7)=>({'page':_0x18461d,'index':_0x8b9d7}))[_0x56dd3c(0x131)](({page:_0x4a8a50})=>!_0x3fb5c0[_0x56dd3c(0x119)](_0x4a8a50[_0x56dd3c(0x129)]))[_0x56dd3c(0x141)](({index:_0x379ed0})=>_0x379ed0));_0x1b1c9b(_0x464706);}},[_0x20db93,_0xca285d['length'],_0x3fb5c0[_0x30df88(0x139)]]),useInput(async(_0x40203d,_0x4de596)=>{const _0x15f13f=_0x30df88;if(_0x26adb8===_0x15f13f(0x104)){if(_0x4de596[_0x15f13f(0x126)]){_0x37c76e(_0x257dd0=>_0x257dd0>0x0?_0x257dd0-0x1:_0xca285d[_0x15f13f(0x139)]-0x1);return;}if(_0x4de596[_0x15f13f(0x13d)]){_0x37c76e(_0x503312=>_0x503312<_0xca285d[_0x15f13f(0x139)]-0x1?_0x503312+0x1:0x0);return;}if(_0x40203d==='\x20'){_0x1b1c9b(_0x56fb09=>{const _0x230972=_0x15f13f,_0x3b846a=new Set(_0x56fb09);return _0x3b846a[_0x230972(0x130)](_0xac0b8e)?_0x3b846a['delete'](_0xac0b8e):_0x3b846a[_0x230972(0x121)](_0xac0b8e),_0x3b846a;});return;}if(_0x40203d==='a'||_0x40203d==='A'){const _0x2d7aa5=new Set(_0xca285d[_0x15f13f(0x141)]((_0x4ec3ee,_0x2b9e11)=>_0x2b9e11));_0x1b1c9b(_0x2d7aa5);return;}if(_0x40203d==='i'||_0x40203d==='I'||_0x40203d==='r'||_0x40203d==='R'){_0x1b1c9b(_0x417a51=>{const _0x179aed=_0x15f13f,_0x282fb5=new Set();for(let _0x498bba=0x0;_0x498bba<_0xca285d[_0x179aed(0x139)];_0x498bba++){!_0x417a51[_0x179aed(0x130)](_0x498bba)&&_0x282fb5[_0x179aed(0x121)](_0x498bba);}return _0x282fb5;});return;}if(_0x40203d==='q'||_0x40203d==='Q'){_0x56b365();return;}if(_0x4de596[_0x15f13f(0x115)]){if(_0x433ba0[_0x15f13f(0x11b)]===0x0){_0x5df2d0(_0x15f13f(0x136));return;}const _0x58f8ec=_0xca285d[_0x15f13f(0x131)]((_0x1f9ca4,_0xf78611)=>_0x433ba0[_0x15f13f(0x130)](_0xf78611)),_0x11b8a0=_0x58f8ec['map'](_0x486658=>_0x486658[_0x15f13f(0x12a)])[_0x15f13f(0x137)](',\x20');_0x174934([{'label':_0x15f13f(0x101),'value':_0x433ba0[_0x15f13f(0x11b)]+'\x20个'}]),_0x5df2d0(''),_0x28a573(_0x15f13f(0x118));return;}return;}if(_0x26adb8===_0x15f13f(0x118)){if(_0x4de596['return']){const _0x32dd3d=_0x557ea4[_0x15f13f(0x11f)]();if(_0x32dd3d==='')return;if(!isValidJsHttpsUrl(_0x32dd3d)){_0x5df2d0(_0x15f13f(0x120));return;}if(!await isUrlReachable(_0x32dd3d)){_0x5df2d0(_0x15f13f(0x13f));return;}_0x6ba149(_0x32dd3d),_0x174934(_0x45d5d0=>[..._0x45d5d0,{'label':'JS\x20链接','value':_0x32dd3d}]),_0x992b50(''),_0x5df2d0(''),_0x28a573(_0x15f13f(0x10f));return;}if(_0x4de596[_0x15f13f(0x127)]||_0x4de596[_0x15f13f(0x111)]){_0x992b50(_0x3b65ff=>_0x3b65ff[_0x15f13f(0x107)](0x0,-0x1)),_0x5df2d0('');return;}_0x992b50(_0x5d614a=>_0x5d614a+_0x40203d);return;}if(_0x26adb8===_0x15f13f(0x10f)){if(_0x4de596[_0x15f13f(0x115)]){const _0x4a34a3=_0x557ea4[_0x15f13f(0x11f)]();if(_0x4a34a3==='')return;if(!isValidCssHttpsUrl(_0x4a34a3)){_0x5df2d0(_0x15f13f(0x116));return;}if(!await isUrlReachable(_0x4a34a3)){_0x5df2d0(_0x15f13f(0x114));return;}_0x151282(_0x4a34a3),_0x174934(_0x4a7963=>[..._0x4a7963,{'label':'CSS\x20链接','value':_0x4a34a3}]),_0x992b50(''),_0x5df2d0(''),_0x28a573('creating');const _0x27a501=_0xca285d[_0x15f13f(0x131)]((_0x328330,_0x55369d)=>_0x433ba0[_0x15f13f(0x130)](_0x55369d));createMenus(_0x27a501,[_0x2357b4,_0x4a34a3])[_0x15f13f(0x125)](()=>{const _0x5c3c69=_0x15f13f;_0x28a573(_0x5c3c69(0x11c)),setTimeout(()=>{_0x56b365();},0x3e8);})[_0x15f13f(0x105)](_0x5b21bd=>{const _0x599059=_0x15f13f;_0x5df2d0(_0x5b21bd[_0x599059(0x11a)]||_0x599059(0x13b)),_0x28a573('selecting');});return;}if(_0x4de596[_0x15f13f(0x127)]||_0x4de596[_0x15f13f(0x111)]){_0x992b50(_0x278f48=>_0x278f48[_0x15f13f(0x107)](0x0,-0x1)),_0x5df2d0('');return;}_0x992b50(_0x251b3a=>_0x251b3a+_0x40203d);return;}});if(_0x20db93)return a12_0x6b84ed(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a12_0x56e86a(Text,{'children':'\x20\x20'}),a12_0x56e86a(a12_0x29aca0,{'type':_0x30df88(0x100)}),a12_0x56e86a(Text,{'children':_0x30df88(0x11d)})]});if(_0x55ba5f)return a12_0x6b84ed(Box,{'flexDirection':_0x30df88(0x103),'marginTop':0x1,'marginBottom':0x1,'children':[a12_0x6b84ed(Text,{'color':_0x30df88(0x113),'children':['✗\x20',_0x55ba5f]}),a12_0x6b84ed(Box,{'marginTop':0x1,'children':[a12_0x56e86a(Text,{'color':_0x30df88(0x135),'children':_0x30df88(0x13a)}),a12_0x56e86a(Text,{'color':'cyan','children':_0x30df88(0x12c)}),a12_0x56e86a(Text,{'color':_0x30df88(0x135),'children':'\x20命令重新登录'})]})]});if(_0xca285d['length']===0x0)return a12_0x56e86a(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a12_0x56e86a(Text,{'color':'yellow','children':_0x30df88(0x124)})});return a12_0x6b84ed(Box,{'flexDirection':_0x30df88(0x103),'marginTop':0x1,'marginBottom':0x1,'children':[_0x26adb8==='selecting'&&a12_0x6b84ed(a12_0x20e1c4,{'children':[a12_0x6b84ed(Box,{'children':[a12_0x6b84ed(Text,{'bold':!![],'children':['\x20\x20',_0x30df88(0x10d),getRemainingSpaces(_0x2e8800,_0x30df88(0x10d))]}),a12_0x6b84ed(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x5716d1,_0x30df88(0x10d))]}),a12_0x6b84ed(Text,{'bold':!![],'children':['Lovrabet平台',getRemainingSpaces(_0x5716d1,_0x30df88(0x10d))]})]}),_0x334809['map'](_0x453b44=>a12_0x6b84ed(Box,{'children':[a12_0x6b84ed(Text,{'children':['\x20\x20',_0x453b44[_0x30df88(0x12a)],getRemainingSpaces(_0x2e8800,_0x453b44['label'])]}),a12_0x6b84ed(Text,{'color':_0x30df88(0x134),'children':[_0x453b44[_0x30df88(0x12e)]?'✓':'✗',getRemainingSpaces(_0x5716d1,'✓')]}),a12_0x6b84ed(Text,{'color':_0x453b44['online']?_0x30df88(0x134):_0x30df88(0x113),'children':[_0x453b44[_0x30df88(0x138)]?'✓':'✗',getRemainingSpaces(_0x5716d1,'✓')]})]},_0x453b44[_0x30df88(0x129)]))]}),_0x26adb8===_0x30df88(0x104)&&_0x10c1e7[_0x30df88(0x139)]===0x0&&a12_0x56e86a(Box,{'marginTop':0x1,'children':a12_0x56e86a(Text,{'color':'cyan','children':_0x30df88(0x102)})}),_0x10c1e7['map']((_0x3030bb,_0x36b485)=>a12_0x6b84ed(Box,{'children':[a12_0x6b84ed(Text,{'color':_0x30df88(0x134),'children':['√\x20',_0x3030bb[_0x30df88(0x12a)],':\x20']}),a12_0x56e86a(Text,{'color':_0x30df88(0x10a),'children':_0x3030bb['value']})]},_0x36b485)),_0x7d5a29&&_0x26adb8==='selecting'&&a12_0x56e86a(Box,{'marginTop':0x1,'children':a12_0x6b84ed(Text,{'color':_0x30df88(0x113),'children':['✗\x20',_0x7d5a29]})}),_0x26adb8===_0x30df88(0x104)&&a12_0x56e86a(a12_0x20e1c4,{'children':a12_0x6b84ed(Box,{'marginTop':_0x10c1e7['length']>0x0||_0x7d5a29?0x1:0x0,'flexDirection':_0x30df88(0x103),'children':[a12_0x56e86a(Text,{'bold':!![],'children':'*\x20请选择要同步的菜单:'}),_0xca285d[_0x30df88(0x141)]((_0x4c7b18,_0x3329fb)=>{const _0x4d72ad=_0x30df88,_0x9d4be1=_0xac0b8e===_0x3329fb,_0x42971f=_0x433ba0['has'](_0x3329fb),_0xf15141=_0x3fb5c0[_0x4d72ad(0x119)](_0x4c7b18[_0x4d72ad(0x129)]),_0x280740=_0xf15141?'更新':'新建';return a12_0x56e86a(Box,{'children':a12_0x6b84ed(Text,{'backgroundColor':_0x9d4be1?_0x4d72ad(0x133):undefined,'color':_0x9d4be1?_0x4d72ad(0x140):undefined,'children':['\x20\x20',_0x42971f?_0x4d72ad(0x128):_0x4d72ad(0x12b),'\x20',_0x4c7b18[_0x4d72ad(0x12a)]]})},_0x4c7b18[_0x4d72ad(0x129)]);}),a12_0x56e86a(Box,{'marginTop':0x1,'children':a12_0x6b84ed(Text,{'color':_0x30df88(0x135),'children':['\x20',_0x30df88(0x12d)]})})]})}),_0x26adb8===_0x30df88(0x118)&&a12_0x6b84ed(a12_0x20e1c4,{'children':[a12_0x6b84ed(Box,{'children':[a12_0x56e86a(Text,{'children':'*\x20JS\x20链接:\x20'}),a12_0x56e86a(Text,{'color':_0x30df88(0x134),'children':_0x557ea4}),_0x7d5a29&&a12_0x6b84ed(Text,{'color':_0x30df88(0x113),'children':[_0x30df88(0x108),_0x7d5a29]})]}),!_0x7d5a29&&a12_0x56e86a(Box,{'children':a12_0x56e86a(Text,{'color':_0x30df88(0x135),'children':_0x30df88(0x10c)})})]}),_0x26adb8===_0x30df88(0x10f)&&a12_0x6b84ed(a12_0x20e1c4,{'children':[a12_0x6b84ed(Box,{'children':[a12_0x56e86a(Text,{'children':'*\x20CSS\x20链接:\x20'}),a12_0x56e86a(Text,{'color':_0x30df88(0x134),'children':_0x557ea4}),_0x7d5a29&&a12_0x6b84ed(Text,{'color':_0x30df88(0x113),'children':[_0x30df88(0x108),_0x7d5a29]})]}),!_0x7d5a29&&a12_0x56e86a(Box,{'children':a12_0x56e86a(Text,{'color':_0x30df88(0x135),'children':'\x20输入项目的\x20CSS\x20资源链接(https://...)'})})]}),_0x26adb8===_0x30df88(0x122)&&a12_0x56e86a(Box,{'children':a12_0x56e86a(Text,{'children':_0x30df88(0x10e)})}),_0x26adb8===_0x30df88(0x11c)&&a12_0x56e86a(Box,{'children':a12_0x56e86a(Text,{'color':_0x30df88(0x134),'children':_0x30df88(0x11e)})})]});}function getStringWidth(_0x806b67){const _0x21142a=a12_0x5986;let _0x1eaed9=0x0;for(const _0x3b83c2 of _0x806b67){/[\u4e00-\u9fa5]/[_0x21142a(0x123)](_0x3b83c2)?_0x1eaed9+=0x2:_0x1eaed9+=0x1;}return _0x1eaed9;}function getRemainingSpaces(_0x3c5d8d,_0x8e3d9a){const _0x2f96ab=a12_0x5986,_0x527c9a=getStringWidth(_0x8e3d9a);return Array(Math[_0x2f96ab(0x112)](0x0,_0x3c5d8d-_0x527c9a))[_0x2f96ab(0x10b)]('\x20')[_0x2f96ab(0x137)]('');}function getMaxWidth(_0x5af3b9,_0x162be6=0x2){let _0x78b71a='',_0x3b31a1=0x0;for(const _0x2ad441 of _0x5af3b9){const _0xe679c1=getStringWidth(_0x2ad441);_0xe679c1>_0x3b31a1&&(_0x3b31a1=_0xe679c1,_0x78b71a=_0x2ad441);}return _0x78b71a+'\x20'['repeat'](_0x162be6);}
@@ -1 +1 @@
1
- function a11_0x70cb(){const _0x54b459=['appcode','!\x20请使用以下方式之一:','7173neUCEU','errorCode','procode','正在创建菜单:\x20','创建菜单成功:','创建菜单失败:\x20','5170116WFtDtG','开始批量创建菜单,共\x20','6WXKCsA','status','stringify','批量创建菜单完成,共\x20','12fuZSrl','log','2UPhVMo','create-menus','length','未知错误','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','success','2480735cBTzkl','import','0011','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','error','info','resources','path','14440RtAeoP','json','菜单创建成功:\x20','创建菜单失败,HTTP状态码:\x20','登录态校验失败,请使用\x20lovrabet\x20auth\x20重新登录','errorMsg','4860900yhSEwL','1305332sxsWMa','302828ezRhnR','create-menu','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','application/json','data','label','/smartapi/menu/create','POST','33757262WVYyDO','未提供应用AppCode,且配置中也没有默认值'];a11_0x70cb=function(){return _0x54b459;};return a11_0x70cb();}function a11_0x5505(_0x49849b,_0x4a5895){_0x49849b=_0x49849b-0x1bc;const _0x70cb89=a11_0x70cb();let _0x550541=_0x70cb89[_0x49849b];return _0x550541;}(function(_0xece498,_0x51855b){const _0x628ce=a11_0x5505,_0x2ea5a1=_0xece498();while(!![]){try{const _0x382266=-parseInt(_0x628ce(0x1cd))/0x1*(parseInt(_0x628ce(0x1e3))/0x2)+parseInt(_0x628ce(0x1cb))/0x3*(-parseInt(_0x628ce(0x1e2))/0x4)+-parseInt(_0x628ce(0x1d3))/0x5*(parseInt(_0x628ce(0x1c7))/0x6)+parseInt(_0x628ce(0x1c5))/0x7+-parseInt(_0x628ce(0x1db))/0x8*(parseInt(_0x628ce(0x1bf))/0x9)+parseInt(_0x628ce(0x1e1))/0xa+parseInt(_0x628ce(0x1eb))/0xb;if(_0x382266===_0x51855b)break;else _0x2ea5a1['push'](_0x2ea5a1['shift']());}catch(_0x5ce93d){_0x2ea5a1['push'](_0x2ea5a1['shift']());}}}(a11_0x70cb,0xb7424));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';const config=readConfig();export async function createMenu(_0x133deb){const _0x31afc4=a11_0x5505,_0x5a46c3=config?.['appcode'];if(!_0x5a46c3){const _0x159bf2='未提供应用AppCode,且配置中也没有默认值';logger['error'](_0x31afc4(0x1e4),_0x159bf2),console[_0x31afc4(0x1d7)]('×\x20'+_0x159bf2),console['log']('!\x20请使用以下方式之一:'),console[_0x31afc4(0x1cc)](_0x31afc4(0x1d6)),console[_0x31afc4(0x1cc)](_0x31afc4(0x1e5));return;}logger[_0x31afc4(0x1d8)](_0x31afc4(0x1e4),_0x31afc4(0x1c2)+_0x133deb[_0x31afc4(0x1e8)]+'\x20('+_0x133deb[_0x31afc4(0x1da)]+')');const _0x442c01={'appCode':_0x5a46c3,'type':_0x31afc4(0x1c1),'sort':0x0,'extend':{'loadScriptMode':_0x31afc4(0x1d4),'resources':_0x133deb[_0x31afc4(0x1d9)]?JSON['stringify'](_0x133deb['resources']):undefined},..._0x133deb},_0x385847=await fetch(getApiDomain()+'/smartapi/menu/create',{'method':_0x31afc4(0x1ea),'body':JSON[_0x31afc4(0x1c9)](_0x442c01),'headers':{'Content-Type':'application/json','Cookie':getCookie()}});if(!_0x385847['ok']){if(_0x385847['status']===0x191){const _0x1364c7=_0x31afc4(0x1d1);logger['error']('create-menu',_0x1364c7,{'status':_0x385847[_0x31afc4(0x1c8)],'menu':_0x133deb['label']});throw new Error(_0x1364c7);}const _0xffc077=_0x31afc4(0x1de)+_0x385847[_0x31afc4(0x1c8)];logger[_0x31afc4(0x1d7)](_0x31afc4(0x1e4),_0xffc077,{'menu':_0x133deb['label']});throw new Error(_0xffc077);}const _0x16767f=await _0x385847['json']();if(!_0x16767f[_0x31afc4(0x1d2)]){const _0x2a3ac4='创建菜单失败:\x20'+(_0x16767f['errorMsg']||_0x31afc4(0x1d0));logger[_0x31afc4(0x1d7)](_0x31afc4(0x1e4),_0x2a3ac4,{'errorCode':_0x16767f[_0x31afc4(0x1c0)],'errorMsg':_0x16767f[_0x31afc4(0x1e0)],'menu':_0x133deb[_0x31afc4(0x1e8)]});throw new Error(_0x2a3ac4);}logger[_0x31afc4(0x1d8)]('create-menu',_0x31afc4(0x1dd)+_0x133deb[_0x31afc4(0x1e8)],_0x16767f[_0x31afc4(0x1e7)]),console[_0x31afc4(0x1cc)](_0x31afc4(0x1c3),_0x16767f[_0x31afc4(0x1e7)]);}async function _createMenu(_0xfef91e,_0x464459){const _0x55fa7a=a11_0x5505,_0x1e2685=config?.[_0x55fa7a(0x1bd)];if(!_0x1e2685){const _0x294888=_0x55fa7a(0x1bc);logger[_0x55fa7a(0x1d7)](_0x55fa7a(0x1e4),_0x294888),console[_0x55fa7a(0x1d7)]('×\x20'+_0x294888),console[_0x55fa7a(0x1cc)](_0x55fa7a(0x1be)),console[_0x55fa7a(0x1cc)](_0x55fa7a(0x1d6)),console['log'](_0x55fa7a(0x1e5));return;}const _0x3781df={'appCode':_0x1e2685,'type':'procode','sort':0x0,'extend':{'loadScriptMode':_0x55fa7a(0x1d4),'resources':_0x464459?JSON['stringify'](_0x464459):undefined},'label':_0xfef91e['label'],'path':_0xfef91e[_0x55fa7a(0x1da)]},_0x14a2d8=await fetch(getApiDomain()+_0x55fa7a(0x1e9),{'method':_0x55fa7a(0x1ea),'body':JSON[_0x55fa7a(0x1c9)](_0x3781df),'headers':{'Content-Type':_0x55fa7a(0x1e6),'Cookie':getCookie()}});if(!_0x14a2d8['ok']){if(_0x14a2d8['status']===0x191){const _0x4e1bf1=_0x55fa7a(0x1d1);logger[_0x55fa7a(0x1d7)](_0x55fa7a(0x1e4),_0x4e1bf1,{'status':_0x14a2d8[_0x55fa7a(0x1c8)],'menu':_0xfef91e['label']});throw new Error(_0x4e1bf1);}const _0x4c5c86='创建菜单失败,HTTP状态码:\x20'+_0x14a2d8[_0x55fa7a(0x1c8)];logger[_0x55fa7a(0x1d7)](_0x55fa7a(0x1e4),_0x4c5c86,{'menu':_0xfef91e['label']});throw new Error(_0x4c5c86);}const _0x3ed65a=await _0x14a2d8[_0x55fa7a(0x1dc)]();if(!_0x3ed65a['success']){if(_0x3ed65a[_0x55fa7a(0x1c0)]===_0x55fa7a(0x1d5)||_0x3ed65a[_0x55fa7a(0x1e0)]?.['includes']('登录')){const _0x37a9ee=_0x55fa7a(0x1df);logger['error'](_0x55fa7a(0x1e4),_0x37a9ee,{'errorCode':_0x3ed65a[_0x55fa7a(0x1c0)],'errorMsg':_0x3ed65a['errorMsg'],'menu':_0xfef91e['label']});throw new Error(_0x37a9ee);}const _0x39800e=_0x55fa7a(0x1c4)+(_0x3ed65a[_0x55fa7a(0x1e0)]||_0x55fa7a(0x1d0));logger[_0x55fa7a(0x1d7)](_0x55fa7a(0x1e4),_0x39800e,{'errorCode':_0x3ed65a['errorCode'],'errorMsg':_0x3ed65a['errorMsg'],'menu':_0xfef91e[_0x55fa7a(0x1e8)]});throw new Error(_0x39800e);}logger[_0x55fa7a(0x1d8)](_0x55fa7a(0x1e4),_0x55fa7a(0x1dd)+_0xfef91e[_0x55fa7a(0x1e8)]);}export async function createMenus(_0x5e2833,_0x16506a){const _0x32a5bf=a11_0x5505;logger[_0x32a5bf(0x1d8)](_0x32a5bf(0x1ce),_0x32a5bf(0x1c6)+_0x5e2833[_0x32a5bf(0x1cf)]+'\x20个'),await Promise['all'](_0x5e2833['map'](async _0x5960d2=>{await _createMenu(_0x5960d2,_0x16506a);})),logger['info'](_0x32a5bf(0x1ce),_0x32a5bf(0x1ca)+_0x5e2833[_0x32a5bf(0x1cf)]+'\x20个');}
1
+ (function(_0x2866b4,_0x54bfc1){const _0x59145d=a13_0x4fdd,_0x28e0c2=_0x2866b4();while(!![]){try{const _0xe775e5=parseInt(_0x59145d(0x1d6))/0x1*(-parseInt(_0x59145d(0x1d0))/0x2)+parseInt(_0x59145d(0x1de))/0x3*(-parseInt(_0x59145d(0x1cd))/0x4)+parseInt(_0x59145d(0x1da))/0x5*(parseInt(_0x59145d(0x1fa))/0x6)+-parseInt(_0x59145d(0x1cf))/0x7+-parseInt(_0x59145d(0x1d1))/0x8+-parseInt(_0x59145d(0x1e4))/0x9*(-parseInt(_0x59145d(0x1e7))/0xa)+parseInt(_0x59145d(0x1ef))/0xb*(parseInt(_0x59145d(0x1ec))/0xc);if(_0xe775e5===_0x54bfc1)break;else _0x28e0c2['push'](_0x28e0c2['shift']());}catch(_0x4bf335){_0x28e0c2['push'](_0x28e0c2['shift']());}}}(a13_0x4a8a,0xa16f0));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{readConfig}from'../utils/config.js';function a13_0x4a8a(){const _0x7e057e=['1229olIvYq','resources','POST','0011','2831095wsVzHV','label','创建菜单失败:\x20','未提供应用AppCode,且配置中也没有默认值','206265FCYofS','appcode','path','正在创建菜单:\x20','create-menus','开始批量创建菜单,共\x20','9zZvgSD','stringify','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','3847750BygqEq','errorCode','/smartapi/menu/create','批量创建菜单完成,共\x20','application/json','9437484hvgobR','菜单创建成功:\x20','json','22xIKpOc','length','errorMsg','info','创建菜单成功:','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','status','data','includes','未知错误','procode','6kdRJgM','创建菜单失败,HTTP状态码:\x20','登录态校验失败,请使用\x20lovrabet\x20auth\x20重新登录','create-menu','60BIapxp','error','1576253Widkfu','964BHTDHS','110352XIDMyE','import','success','log','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录'];a13_0x4a8a=function(){return _0x7e057e;};return a13_0x4a8a();}import{logger}from'../utils/logger.js';const config=readConfig();export async function createMenu(_0x296b70){const _0x303a36=a13_0x4fdd,_0x493a14=config?.[_0x303a36(0x1df)];if(!_0x493a14){const _0x5aaecb=_0x303a36(0x1dd);logger[_0x303a36(0x1ce)]('create-menu',_0x5aaecb),console['error']('×\x20'+_0x5aaecb),console['log']('!\x20请使用以下方式之一:'),console[_0x303a36(0x1d4)](_0x303a36(0x1f4)),console[_0x303a36(0x1d4)](_0x303a36(0x1e6));return;}logger['info'](_0x303a36(0x1fd),_0x303a36(0x1e1)+_0x296b70['label']+'\x20('+_0x296b70['path']+')');const _0x15ed1a={'appCode':_0x493a14,'type':_0x303a36(0x1f9),'sort':0x0,'extend':{'loadScriptMode':_0x303a36(0x1d2),'resources':_0x296b70[_0x303a36(0x1d7)]?JSON[_0x303a36(0x1e5)](_0x296b70['resources']):undefined},..._0x296b70},_0x1c0657=await fetch(getApiDomain()+_0x303a36(0x1e9),{'method':_0x303a36(0x1d8),'body':JSON[_0x303a36(0x1e5)](_0x15ed1a),'headers':{'Content-Type':_0x303a36(0x1eb),'Cookie':getCookie()}});if(!_0x1c0657['ok']){if(_0x1c0657[_0x303a36(0x1f5)]===0x191){const _0x261928=_0x303a36(0x1d5);logger['error'](_0x303a36(0x1fd),_0x261928,{'status':_0x1c0657[_0x303a36(0x1f5)],'menu':_0x296b70['label']});throw new Error(_0x261928);}const _0x3fa627=_0x303a36(0x1fb)+_0x1c0657[_0x303a36(0x1f5)];logger[_0x303a36(0x1ce)](_0x303a36(0x1fd),_0x3fa627,{'menu':_0x296b70['label']});throw new Error(_0x3fa627);}const _0x3eaa06=await _0x1c0657[_0x303a36(0x1ee)]();if(!_0x3eaa06[_0x303a36(0x1d3)]){const _0x565386=_0x303a36(0x1dc)+(_0x3eaa06[_0x303a36(0x1f1)]||_0x303a36(0x1f8));logger['error'](_0x303a36(0x1fd),_0x565386,{'errorCode':_0x3eaa06[_0x303a36(0x1e8)],'errorMsg':_0x3eaa06[_0x303a36(0x1f1)],'menu':_0x296b70[_0x303a36(0x1db)]});throw new Error(_0x565386);}logger['info'](_0x303a36(0x1fd),_0x303a36(0x1ed)+_0x296b70[_0x303a36(0x1db)],_0x3eaa06[_0x303a36(0x1f6)]),console[_0x303a36(0x1d4)](_0x303a36(0x1f3),_0x3eaa06[_0x303a36(0x1f6)]);}function a13_0x4fdd(_0xceb194,_0x3b6322){_0xceb194=_0xceb194-0x1cd;const _0x4a8a9f=a13_0x4a8a();let _0x4fdd8f=_0x4a8a9f[_0xceb194];return _0x4fdd8f;}async function _createMenu(_0x476d71,_0xf9d959){const _0x2f8004=a13_0x4fdd,_0x5a118f=config?.[_0x2f8004(0x1df)];if(!_0x5a118f){const _0x5515be='未提供应用AppCode,且配置中也没有默认值';logger[_0x2f8004(0x1ce)](_0x2f8004(0x1fd),_0x5515be),console[_0x2f8004(0x1ce)]('×\x20'+_0x5515be),console[_0x2f8004(0x1d4)]('!\x20请使用以下方式之一:'),console[_0x2f8004(0x1d4)](_0x2f8004(0x1f4)),console[_0x2f8004(0x1d4)](_0x2f8004(0x1e6));return;}const _0x56c3c1={'appCode':_0x5a118f,'type':_0x2f8004(0x1f9),'sort':0x0,'extend':{'loadScriptMode':_0x2f8004(0x1d2),'resources':_0xf9d959?JSON['stringify'](_0xf9d959):undefined},'label':_0x476d71[_0x2f8004(0x1db)],'path':_0x476d71[_0x2f8004(0x1e0)]},_0x1ff262=await fetch(getApiDomain()+_0x2f8004(0x1e9),{'method':_0x2f8004(0x1d8),'body':JSON[_0x2f8004(0x1e5)](_0x56c3c1),'headers':{'Content-Type':'application/json','Cookie':getCookie()}});if(!_0x1ff262['ok']){if(_0x1ff262[_0x2f8004(0x1f5)]===0x191){const _0x4da04c=_0x2f8004(0x1d5);logger[_0x2f8004(0x1ce)](_0x2f8004(0x1fd),_0x4da04c,{'status':_0x1ff262['status'],'menu':_0x476d71[_0x2f8004(0x1db)]});throw new Error(_0x4da04c);}const _0x39f1fc=_0x2f8004(0x1fb)+_0x1ff262[_0x2f8004(0x1f5)];logger['error'](_0x2f8004(0x1fd),_0x39f1fc,{'menu':_0x476d71[_0x2f8004(0x1db)]});throw new Error(_0x39f1fc);}const _0x4ba60c=await _0x1ff262['json']();if(!_0x4ba60c[_0x2f8004(0x1d3)]){if(_0x4ba60c[_0x2f8004(0x1e8)]===_0x2f8004(0x1d9)||_0x4ba60c[_0x2f8004(0x1f1)]?.[_0x2f8004(0x1f7)]('登录')){const _0x36256a=_0x2f8004(0x1fc);logger[_0x2f8004(0x1ce)](_0x2f8004(0x1fd),_0x36256a,{'errorCode':_0x4ba60c[_0x2f8004(0x1e8)],'errorMsg':_0x4ba60c[_0x2f8004(0x1f1)],'menu':_0x476d71['label']});throw new Error(_0x36256a);}const _0x5de143='创建菜单失败:\x20'+(_0x4ba60c['errorMsg']||'未知错误');logger[_0x2f8004(0x1ce)](_0x2f8004(0x1fd),_0x5de143,{'errorCode':_0x4ba60c[_0x2f8004(0x1e8)],'errorMsg':_0x4ba60c['errorMsg'],'menu':_0x476d71[_0x2f8004(0x1db)]});throw new Error(_0x5de143);}logger[_0x2f8004(0x1f2)](_0x2f8004(0x1fd),_0x2f8004(0x1ed)+_0x476d71[_0x2f8004(0x1db)]);}export async function createMenus(_0x154462,_0x9547c8){const _0xfe9281=a13_0x4fdd;logger[_0xfe9281(0x1f2)](_0xfe9281(0x1e2),_0xfe9281(0x1e3)+_0x154462[_0xfe9281(0x1f0)]+'\x20个'),await Promise['all'](_0x154462['map'](async _0x2e30f1=>{await _createMenu(_0x2e30f1,_0x9547c8);})),logger['info'](_0xfe9281(0x1e2),_0xfe9281(0x1ea)+_0x154462['length']+'\x20个');}
@@ -1 +1 @@
1
- const a12_0x1d40f8=a12_0x2569;(function(_0x45774b,_0x24b03d){const _0x1fe63e=a12_0x2569,_0x4141f9=_0x45774b();while(!![]){try{const _0x2e9ef5=parseInt(_0x1fe63e(0x17c))/0x1*(-parseInt(_0x1fe63e(0x18e))/0x2)+parseInt(_0x1fe63e(0x191))/0x3*(-parseInt(_0x1fe63e(0x185))/0x4)+parseInt(_0x1fe63e(0x182))/0x5*(-parseInt(_0x1fe63e(0x18a))/0x6)+-parseInt(_0x1fe63e(0x18c))/0x7+parseInt(_0x1fe63e(0x194))/0x8+-parseInt(_0x1fe63e(0x189))/0x9*(parseInt(_0x1fe63e(0x190))/0xa)+parseInt(_0x1fe63e(0x192))/0xb*(parseInt(_0x1fe63e(0x180))/0xc);if(_0x2e9ef5===_0x24b03d)break;else _0x4141f9['push'](_0x4141f9['shift']());}catch(_0x54b151){_0x4141f9['push'](_0x4141f9['shift']());}}}(a12_0x5b11,0xf31c4));import{readdirSync,statSync,readFileSync}from'fs';function a12_0x2569(_0x2155ff,_0x12aa5d){_0x2155ff=_0x2155ff-0x17c;const _0x5b113b=a12_0x5b11();let _0x256941=_0x5b113b[_0x2155ff];return _0x256941;}import{join,relative,resolve}from'path';const pagesDir=resolve(process[a12_0x1d40f8(0x184)](),'src/pages');export function extractTitleFromComment(_0x4e0716){const _0x198fe3=a12_0x1d40f8;try{const _0x2c80ff=readFileSync(_0x4e0716,'utf-8'),_0x4c1fbb=_0x2c80ff['match'](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x4c1fbb&&_0x4c1fbb[0x1]){const _0x35a10e=_0x4c1fbb[0x1],_0x37951d=_0x35a10e[_0x198fe3(0x183)](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x37951d&&_0x37951d[0x1])return _0x37951d[0x1][_0x198fe3(0x18d)]();}let _0x287da1=null;const _0x512fda=_0x2c80ff[_0x198fe3(0x183)](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x512fda&&_0x512fda[0x1]&&(_0x287da1=_0x512fda[0x1]);if(!_0x287da1){const _0x4532b5=_0x2c80ff[_0x198fe3(0x183)](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x4532b5&&_0x4532b5[0x1]&&(_0x287da1=_0x4532b5[0x1]);}if(_0x287da1){const _0xe7aca=new RegExp('\x5cb'+_0x287da1+_0x198fe3(0x17f)),_0x19a587=_0x2c80ff[_0x198fe3(0x183)](_0xe7aca);if(_0x19a587&&_0x19a587[0x1])return _0x19a587[0x1];return _0x287da1;}return null;}catch(_0x16e7b5){return null;}}export function getLocalPages(_0x42739=pagesDir,_0x2be8c9=pagesDir){const _0x1065c5=a12_0x1d40f8;let _0x93c774=[];const _0x55a65e=readdirSync(_0x42739);return _0x55a65e[_0x1065c5(0x17d)](_0x362072=>{const _0x5d6fdd=_0x1065c5,_0x18ff6e=join(_0x42739,_0x362072),_0x590f79=statSync(_0x18ff6e);if(_0x590f79&&_0x590f79[_0x5d6fdd(0x193)]())_0x93c774=_0x93c774['concat'](getLocalPages(_0x18ff6e,_0x2be8c9));else{if(_0x362072['endsWith']('.tsx')){let _0x1e210a=relative(_0x2be8c9,_0x18ff6e);_0x1e210a[_0x5d6fdd(0x17e)](_0x5d6fdd(0x18b))?_0x1e210a=_0x1e210a[_0x5d6fdd(0x181)](/index\.tsx$/,''):_0x1e210a=_0x1e210a[_0x5d6fdd(0x181)](/\.tsx$/,'');_0x1e210a[_0x5d6fdd(0x17e)]('/')&&(_0x1e210a=_0x1e210a[_0x5d6fdd(0x188)](0x0,-0x1));const _0x2747d9=extractTitleFromComment(_0x18ff6e),_0x4c305f=_0x2747d9||_0x1e210a;_0x93c774['push']({'path':_0x1e210a[_0x5d6fdd(0x187)]('$',':'),'label':_0x4c305f});}}}),_0x93c774[_0x1065c5(0x186)](_0xed548f=>_0xed548f[_0x1065c5(0x18f)]!=='');}function a12_0x5b11(){const _0x595549=['6tPGAMb','index.tsx','8569484ulPkHK','trim','3351934fIYrta','path','28820wtEPZQ','70386shwzXm','91603754vePbAe','isDirectory','5124912rMQvlS','1KFLEiP','forEach','endsWith','\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]','12jauEtP','replace','8857805NpZgOK','match','cwd','292DRmhfZ','filter','replaceAll','slice','4959FOzMYi'];a12_0x5b11=function(){return _0x595549;};return a12_0x5b11();}
1
+ const a14_0x2734b2=a14_0x251e;function a14_0x3e97(){const _0x281a71=['slice','forEach','index.tsx','148STQieK','replaceAll','19488704WkRAgj','concat','1033460qUXwyz','4145029ADfHyH','39710BgANYO','303714mKGTgu','trim','42049GGkTJm','path','3595182tBqLCV','replace','utf-8','src/pages','endsWith','push','\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]','isDirectory','match'];a14_0x3e97=function(){return _0x281a71;};return a14_0x3e97();}(function(_0xb092bc,_0x2afc0a){const _0x133d29=a14_0x251e,_0x4ca322=_0xb092bc();while(!![]){try{const _0x53c64e=parseInt(_0x133d29(0x191))/0x1+-parseInt(_0x133d29(0x1a3))/0x2+-parseInt(_0x133d29(0x18f))/0x3+parseInt(_0x133d29(0x19f))/0x4*(-parseInt(_0x133d29(0x1a5))/0x5)+-parseInt(_0x133d29(0x193))/0x6+-parseInt(_0x133d29(0x1a4))/0x7+parseInt(_0x133d29(0x1a1))/0x8;if(_0x53c64e===_0x2afc0a)break;else _0x4ca322['push'](_0x4ca322['shift']());}catch(_0x529b26){_0x4ca322['push'](_0x4ca322['shift']());}}}(a14_0x3e97,0x5b8bb));import{readdirSync,statSync,readFileSync}from'fs';import{join,relative,resolve}from'path';function a14_0x251e(_0x203428,_0x35ff98){_0x203428=_0x203428-0x18f;const _0x3e978d=a14_0x3e97();let _0x251e08=_0x3e978d[_0x203428];return _0x251e08;}const pagesDir=resolve(process['cwd'](),a14_0x2734b2(0x196));export function extractTitleFromComment(_0x26d338){const _0x118b79=a14_0x2734b2;try{const _0x41c405=readFileSync(_0x26d338,_0x118b79(0x195)),_0x23bb41=_0x41c405['match'](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x23bb41&&_0x23bb41[0x1]){const _0x1679a3=_0x23bb41[0x1],_0xd766a5=_0x1679a3['match'](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0xd766a5&&_0xd766a5[0x1])return _0xd766a5[0x1][_0x118b79(0x190)]();}let _0x29d7e1=null;const _0x175d73=_0x41c405[_0x118b79(0x19b)](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x175d73&&_0x175d73[0x1]&&(_0x29d7e1=_0x175d73[0x1]);if(!_0x29d7e1){const _0x1ba86b=_0x41c405['match'](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x1ba86b&&_0x1ba86b[0x1]&&(_0x29d7e1=_0x1ba86b[0x1]);}if(_0x29d7e1){const _0x56b0d1=new RegExp('\x5cb'+_0x29d7e1+_0x118b79(0x199)),_0x47ee47=_0x41c405[_0x118b79(0x19b)](_0x56b0d1);if(_0x47ee47&&_0x47ee47[0x1])return _0x47ee47[0x1];return _0x29d7e1;}return null;}catch(_0x6635be){return null;}}export function getLocalPages(_0x55b977=pagesDir,_0x57843c=pagesDir){const _0x2a25fc=a14_0x2734b2;let _0x1890dc=[];const _0xa8c9d0=readdirSync(_0x55b977);return _0xa8c9d0[_0x2a25fc(0x19d)](_0x14b0ae=>{const _0x31aef2=_0x2a25fc,_0x2b940e=join(_0x55b977,_0x14b0ae),_0x258934=statSync(_0x2b940e);if(_0x258934&&_0x258934[_0x31aef2(0x19a)]())_0x1890dc=_0x1890dc[_0x31aef2(0x1a2)](getLocalPages(_0x2b940e,_0x57843c));else{if(_0x14b0ae[_0x31aef2(0x197)]('.tsx')){let _0x1d8817=relative(_0x57843c,_0x2b940e);_0x1d8817[_0x31aef2(0x197)](_0x31aef2(0x19e))?_0x1d8817=_0x1d8817[_0x31aef2(0x194)](/index\.tsx$/,''):_0x1d8817=_0x1d8817[_0x31aef2(0x194)](/\.tsx$/,'');_0x1d8817[_0x31aef2(0x197)]('/')&&(_0x1d8817=_0x1d8817[_0x31aef2(0x19c)](0x0,-0x1));const _0x54678f=extractTitleFromComment(_0x2b940e),_0x29bfdb=_0x54678f||_0x1d8817;_0x1890dc[_0x31aef2(0x198)]({'path':_0x1d8817[_0x31aef2(0x1a0)]('$',':'),'label':_0x29bfdb});}}}),_0x1890dc['filter'](_0x4d5647=>_0x4d5647[_0x2a25fc(0x192)]!=='');}
@@ -1 +1 @@
1
- (function(_0x4968da,_0x15e0ed){const _0x4f4ef4=a13_0x177b,_0x5de2cb=_0x4968da();while(!![]){try{const _0x1b540e=-parseInt(_0x4f4ef4(0xd1))/0x1+parseInt(_0x4f4ef4(0xcc))/0x2*(-parseInt(_0x4f4ef4(0xd6))/0x3)+parseInt(_0x4f4ef4(0xd9))/0x4*(parseInt(_0x4f4ef4(0xdf))/0x5)+parseInt(_0x4f4ef4(0xce))/0x6+-parseInt(_0x4f4ef4(0xd3))/0x7+-parseInt(_0x4f4ef4(0xe1))/0x8*(parseInt(_0x4f4ef4(0xe8))/0x9)+-parseInt(_0x4f4ef4(0xe5))/0xa*(-parseInt(_0x4f4ef4(0xd5))/0xb);if(_0x1b540e===_0x15e0ed)break;else _0x5de2cb['push'](_0x5de2cb['shift']());}catch(_0x4947f5){_0x5de2cb['push'](_0x5de2cb['shift']());}}}(a13_0x522a,0xdd43e));function a13_0x522a(){const _0x824344=['正在获取线上菜单列表...\x20(appCode:\x20','resources','parse','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','path','map','length','children','获取菜单列表失败,HTTP状态码:\x20','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','label','extend','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','76skCBwJ','status','2625492UnkHJm','push','GET','803069hhKtfu','flat','5296655ISHQNt','服务端返回空菜单列表','8558erZqjb','20469ZNMzjj','/smartapi/menu/find?appCode=','data','5272252RObDtT','get-online-menu-list','errorMsg','errorCode','success','log','5hfYdBa','json','82568dpGDHL','application/json','info','error','32230YpOtPo','未提供应用AppCode,且配置中也没有默认值','获取菜单列表失败:\x20','1341lTrdcu'];a13_0x522a=function(){return _0x824344;};return a13_0x522a();}import{getCookie}from'../auth/get-cookie.js';function a13_0x177b(_0xdcbcef,_0x381252){_0xdcbcef=_0xdcbcef-0xcc;const _0x522a4d=a13_0x522a();let _0x177bcb=_0x522a4d[_0xdcbcef];return _0x177bcb;}import{getApiDomain}from'../constant/domain.js';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';const config=readConfig();export async function getOnlineMenuList(){const _0x5a93ec=a13_0x177b,_0x10ad43=config?.['appcode'];if(!_0x10ad43){const _0x2aff30=_0x5a93ec(0xe6);return logger['error'](_0x5a93ec(0xda),_0x2aff30),console[_0x5a93ec(0xe4)]('×\x20'+_0x2aff30),console[_0x5a93ec(0xde)]('!\x20请使用以下方式之一:'),console['log'](_0x5a93ec(0xec)),console[_0x5a93ec(0xde)](_0x5a93ec(0xf2)),[];}logger[_0x5a93ec(0xe3)]('get-online-menu-list',_0x5a93ec(0xe9)+_0x10ad43+')');const _0x188f37=await fetch(getApiDomain()+_0x5a93ec(0xd7)+_0x10ad43,{'method':_0x5a93ec(0xd0),'headers':{'Content-Type':_0x5a93ec(0xe2),'Cookie':getCookie()}});if(!_0x188f37['ok']){if(_0x188f37[_0x5a93ec(0xcd)]===0x191){const _0xa47b28=_0x5a93ec(0xf5);logger[_0x5a93ec(0xe4)]('get-online-menu-list',_0xa47b28,{'status':_0x188f37[_0x5a93ec(0xcd)]});throw new Error(_0xa47b28);}const _0xc4472b=_0x5a93ec(0xf1)+_0x188f37[_0x5a93ec(0xcd)];logger[_0x5a93ec(0xe4)](_0x5a93ec(0xda),_0xc4472b);throw new Error(_0xc4472b);}const _0x480e59=await _0x188f37[_0x5a93ec(0xe0)]();if(!_0x480e59[_0x5a93ec(0xdd)]){const _0x4aeb05=_0x5a93ec(0xe7)+(_0x480e59['errorMsg']||'未知错误');logger[_0x5a93ec(0xe4)](_0x5a93ec(0xda),_0x4aeb05,{'errorCode':_0x480e59[_0x5a93ec(0xdc)],'errorMsg':_0x480e59[_0x5a93ec(0xdb)]});throw new Error(_0x4aeb05);}if(!_0x480e59[_0x5a93ec(0xd8)])return logger['info'](_0x5a93ec(0xda),_0x5a93ec(0xd4)),[];return logger['info'](_0x5a93ec(0xda),'成功获取\x20'+_0x480e59[_0x5a93ec(0xd8)][_0x5a93ec(0xef)]+'\x20个线上菜单'),_0x480e59[_0x5a93ec(0xd8)][_0x5a93ec(0xee)](formatMenuList)[_0x5a93ec(0xd2)]();}function formatMenuList(_0x4ab85f){const _0xa34ed=a13_0x177b;let _0x36712d=[];try{if(_0x4ab85f['extend']?.[_0xa34ed(0xea)]){const _0x3f5216=JSON[_0xa34ed(0xeb)](_0x4ab85f[_0xa34ed(0xf4)]['resources']);Array['isArray'](_0x3f5216)&&(_0x36712d=_0x3f5216);}}catch(_0x2f562e){}const _0x2b465e=[{'id':_0x4ab85f['id'],'path':_0x4ab85f[_0xa34ed(0xed)],'label':_0x4ab85f[_0xa34ed(0xf3)],'resources':_0x36712d}];if(_0x4ab85f[_0xa34ed(0xf0)]&&_0x4ab85f[_0xa34ed(0xf0)]['length']>0x0)for(const _0x42d22d of _0x4ab85f['children']){_0x2b465e[_0xa34ed(0xcf)](...formatMenuList(_0x42d22d));}return _0x2b465e;}
1
+ (function(_0x30ac50,_0x201dda){const _0xe4d88e=a15_0x1305,_0x33685a=_0x30ac50();while(!![]){try{const _0x151fe0=parseInt(_0xe4d88e(0x1bd))/0x1+-parseInt(_0xe4d88e(0x1d0))/0x2*(-parseInt(_0xe4d88e(0x1c2))/0x3)+-parseInt(_0xe4d88e(0x1c7))/0x4*(-parseInt(_0xe4d88e(0x1b5))/0x5)+-parseInt(_0xe4d88e(0x1b1))/0x6*(-parseInt(_0xe4d88e(0x1d8))/0x7)+-parseInt(_0xe4d88e(0x1c4))/0x8*(parseInt(_0xe4d88e(0x1d4))/0x9)+parseInt(_0xe4d88e(0x1b8))/0xa*(parseInt(_0xe4d88e(0x1b7))/0xb)+-parseInt(_0xe4d88e(0x1da))/0xc*(parseInt(_0xe4d88e(0x1be))/0xd);if(_0x151fe0===_0x201dda)break;else _0x33685a['push'](_0x33685a['shift']());}catch(_0xdaf0a5){_0x33685a['push'](_0x33685a['shift']());}}}(a15_0x5718,0xe7225));function a15_0x1305(_0x33faba,_0x1b84c8){_0x33faba=_0x33faba-0x1b0;const _0x5718aa=a15_0x5718();let _0x13056a=_0x5718aa[_0x33faba];return _0x13056a;}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a15_0x5718(){const _0xcb0a0e=['15576zKRVAd','10410rdxvZG','isArray','!\x20请使用以下方式之一:','errorCode','children','1052350BlPZBp','26NDHQRq','resources','get-online-menu-list','error','443019kpEArf','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','8znQYyr','/smartapi/menu/find?appCode=','log','40aJxwBU','获取菜单列表失败,HTTP状态码:\x20','info','path','GET','success','status','服务端返回空菜单列表','正在获取线上菜单列表...\x20(appCode:\x20','22YOcsCL','length','push','extend','783657jjhRrG','errorMsg','application/json','label','9377011oNDOjA','未知错误','36264324LxoOST','flat','map','json','parse','6inyHXO','data','appcode','成功获取\x20','793735ahNRZJ','\x20个线上菜单'];a15_0x5718=function(){return _0xcb0a0e;};return a15_0x5718();}import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';const config=readConfig();export async function getOnlineMenuList(){const _0x588ff2=a15_0x1305,_0x5dc7d4=config?.[_0x588ff2(0x1b3)];if(!_0x5dc7d4){const _0x2548be='未提供应用AppCode,且配置中也没有默认值';return logger[_0x588ff2(0x1c1)](_0x588ff2(0x1c0),_0x2548be),console[_0x588ff2(0x1c1)]('×\x20'+_0x2548be),console[_0x588ff2(0x1c6)](_0x588ff2(0x1ba)),console[_0x588ff2(0x1c6)](_0x588ff2(0x1c3)),console['log']('\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>'),[];}logger[_0x588ff2(0x1c9)](_0x588ff2(0x1c0),_0x588ff2(0x1cf)+_0x5dc7d4+')');const _0x1ab383=await fetch(getApiDomain()+_0x588ff2(0x1c5)+_0x5dc7d4,{'method':_0x588ff2(0x1cb),'headers':{'Content-Type':_0x588ff2(0x1d6),'Cookie':getCookie()}});if(!_0x1ab383['ok']){if(_0x1ab383[_0x588ff2(0x1cd)]===0x191){const _0x45017b='登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录';logger[_0x588ff2(0x1c1)](_0x588ff2(0x1c0),_0x45017b,{'status':_0x1ab383[_0x588ff2(0x1cd)]});throw new Error(_0x45017b);}const _0x10f947=_0x588ff2(0x1c8)+_0x1ab383['status'];logger['error']('get-online-menu-list',_0x10f947);throw new Error(_0x10f947);}const _0x2fe228=await _0x1ab383[_0x588ff2(0x1dd)]();if(!_0x2fe228[_0x588ff2(0x1cc)]){const _0xb69556='获取菜单列表失败:\x20'+(_0x2fe228['errorMsg']||_0x588ff2(0x1d9));logger[_0x588ff2(0x1c1)](_0x588ff2(0x1c0),_0xb69556,{'errorCode':_0x2fe228[_0x588ff2(0x1bb)],'errorMsg':_0x2fe228[_0x588ff2(0x1d5)]});throw new Error(_0xb69556);}if(!_0x2fe228[_0x588ff2(0x1b2)])return logger[_0x588ff2(0x1c9)]('get-online-menu-list',_0x588ff2(0x1ce)),[];return logger['info'](_0x588ff2(0x1c0),_0x588ff2(0x1b4)+_0x2fe228[_0x588ff2(0x1b2)][_0x588ff2(0x1d1)]+_0x588ff2(0x1b6)),_0x2fe228['data'][_0x588ff2(0x1dc)](formatMenuList)[_0x588ff2(0x1db)]();}function formatMenuList(_0x160354){const _0x25ac12=a15_0x1305;let _0x3088c9=[];try{if(_0x160354[_0x25ac12(0x1d3)]?.[_0x25ac12(0x1bf)]){const _0x128bc7=JSON[_0x25ac12(0x1b0)](_0x160354[_0x25ac12(0x1d3)][_0x25ac12(0x1bf)]);Array[_0x25ac12(0x1b9)](_0x128bc7)&&(_0x3088c9=_0x128bc7);}}catch(_0x9f10b5){}const _0x23703=[{'id':_0x160354['id'],'path':_0x160354[_0x25ac12(0x1ca)],'label':_0x160354[_0x25ac12(0x1d7)],'resources':_0x3088c9}];if(_0x160354[_0x25ac12(0x1bc)]&&_0x160354[_0x25ac12(0x1bc)]['length']>0x0)for(const _0xf2e9c5 of _0x160354[_0x25ac12(0x1bc)]){_0x23703[_0x25ac12(0x1d2)](...formatMenuList(_0xf2e9c5));}return _0x23703;}
@@ -1 +1 @@
1
- (function(_0x27191a,_0x1801f3){const _0x402a44=a15_0x401f,_0x4fcc76=_0x27191a();while(!![]){try{const _0x7cc450=parseInt(_0x402a44(0x1e7))/0x1*(-parseInt(_0x402a44(0x1f0))/0x2)+-parseInt(_0x402a44(0x1eb))/0x3+-parseInt(_0x402a44(0x1ef))/0x4*(-parseInt(_0x402a44(0x1ee))/0x5)+-parseInt(_0x402a44(0x1f3))/0x6*(-parseInt(_0x402a44(0x1f2))/0x7)+-parseInt(_0x402a44(0x1e9))/0x8+parseInt(_0x402a44(0x1ea))/0x9+parseInt(_0x402a44(0x1e8))/0xa;if(_0x7cc450===_0x1801f3)break;else _0x4fcc76['push'](_0x4fcc76['shift']());}catch(_0x1d8e3c){_0x4fcc76['push'](_0x4fcc76['shift']());}}}(a15_0x59fc,0x4de2e));function a15_0x401f(_0x1d9fbf,_0x25d13c){_0x1d9fbf=_0x1d9fbf-0x1e6;const _0x59fcfd=a15_0x59fc();let _0x401fbd=_0x59fcfd[_0x1d9fbf];return _0x401fbd;}import{useEffect,useState}from'react';function a15_0x59fc(){const _0x3cb125=['13740YsAVMF','finally','328405AXwKid','54kIHjwK','message','76yNwQjm','3767480QgWXMH','213832eVsTdK','2286036CciEuU','1251366oqHySQ','catch','获取菜单列表失败','1160030GwwYGC','4NPaNBG'];a15_0x59fc=function(){return _0x3cb125;};return a15_0x59fc();}import{getOnlineMenuList}from'./get-online-menu-list.js';export function useGetOnlineMenuList(){const [_0x57adde,_0x1ac3b7]=useState([]),[_0x39e36d,_0x3e454d]=useState(!![]),[_0x4c61f2,_0x1a4f09]=useState('');return useEffect(()=>{const _0x26a118=a15_0x401f;_0x3e454d(!![]),_0x1a4f09(''),getOnlineMenuList()['then'](_0x1ac3b7)[_0x26a118(0x1ec)](_0x283706=>{const _0x1dcb85=_0x26a118;_0x1a4f09(_0x283706[_0x1dcb85(0x1e6)]||_0x1dcb85(0x1ed));})[_0x26a118(0x1f1)](()=>_0x3e454d(![]));},[]),{'menuList':_0x57adde,'loading':_0x39e36d,'error':_0x4c61f2};}
1
+ (function(_0x4d3d88,_0x527a0d){const _0x4bb0dd=a17_0x38de,_0x1a789b=_0x4d3d88();while(!![]){try{const _0x503fe8=-parseInt(_0x4bb0dd(0x14a))/0x1+-parseInt(_0x4bb0dd(0x14f))/0x2+parseInt(_0x4bb0dd(0x14d))/0x3*(parseInt(_0x4bb0dd(0x145))/0x4)+parseInt(_0x4bb0dd(0x14c))/0x5+-parseInt(_0x4bb0dd(0x142))/0x6+-parseInt(_0x4bb0dd(0x14b))/0x7*(-parseInt(_0x4bb0dd(0x147))/0x8)+-parseInt(_0x4bb0dd(0x144))/0x9;if(_0x503fe8===_0x527a0d)break;else _0x1a789b['push'](_0x1a789b['shift']());}catch(_0x5a3a5a){_0x1a789b['push'](_0x1a789b['shift']());}}}(a17_0x2a58,0x29160));import{useEffect,useState}from'react';import{getOnlineMenuList}from'./get-online-menu-list.js';function a17_0x38de(_0x2d72d9,_0xde4dc8){_0x2d72d9=_0x2d72d9-0x142;const _0x2a5805=a17_0x2a58();let _0x38de28=_0x2a5805[_0x2d72d9];return _0x38de28;}function a17_0x2a58(){const _0x45339c=['7743jvCMQV','7vzJtVj','216580pQmULg','967317UkYZQG','then','145858VoySqM','944484FseZHT','message','1774368bqwteL','4EGVKTk','获取菜单列表失败','1902168yOcZYu','finally','catch'];a17_0x2a58=function(){return _0x45339c;};return a17_0x2a58();}export function useGetOnlineMenuList(){const [_0x2a54d4,_0x543e49]=useState([]),[_0x215188,_0x2d78f8]=useState(!![]),[_0x4f0895,_0x336753]=useState('');return useEffect(()=>{const _0x2252b9=a17_0x38de;_0x2d78f8(!![]),_0x336753(''),getOnlineMenuList()[_0x2252b9(0x14e)](_0x543e49)[_0x2252b9(0x149)](_0x2acc22=>{const _0x3ca270=_0x2252b9;_0x336753(_0x2acc22[_0x3ca270(0x143)]||_0x3ca270(0x146));})[_0x2252b9(0x148)](()=>_0x2d78f8(![]));},[]),{'menuList':_0x2a54d4,'loading':_0x215188,'error':_0x4f0895};}
@@ -1 +1 @@
1
- function a16_0x1816(){const _0x30c933=['190827weKSoC','1598820lBqqKq','join','fill','max','158jctLvm','12ILFbIT','116644hQIayh','10124gJeyTE','80cOfjyT','repeat','96XjjbcY','679DOkEse','640415oStHaJ','test','120904lQmjFt','984TsjkFi'];a16_0x1816=function(){return _0x30c933;};return a16_0x1816();}(function(_0x5c789f,_0x53801d){const _0x37e38e=a16_0x35da,_0x1db064=_0x5c789f();while(!![]){try{const _0x2cfcf8=parseInt(_0x37e38e(0x14a))/0x1*(parseInt(_0x37e38e(0x143))/0x2)+-parseInt(_0x37e38e(0x144))/0x3*(-parseInt(_0x37e38e(0x146))/0x4)+-parseInt(_0x37e38e(0x14b))/0x5+-parseInt(_0x37e38e(0x13f))/0x6+parseInt(_0x37e38e(0x13c))/0x7*(-parseInt(_0x37e38e(0x149))/0x8)+-parseInt(_0x37e38e(0x13e))/0x9*(parseInt(_0x37e38e(0x147))/0xa)+parseInt(_0x37e38e(0x145))/0xb*(parseInt(_0x37e38e(0x13d))/0xc);if(_0x2cfcf8===_0x53801d)break;else _0x1db064['push'](_0x1db064['shift']());}catch(_0x2f62e4){_0x1db064['push'](_0x1db064['shift']());}}}(a16_0x1816,0x2783c));function a16_0x35da(_0x26eb5e,_0x17694d){_0x26eb5e=_0x26eb5e-0x13b;const _0x1816cc=a16_0x1816();let _0x35daf0=_0x1816cc[_0x26eb5e];return _0x35daf0;}export function getRemainingSpaces(_0x2c2b87,_0x17e248){const _0x5cb724=a16_0x35da,_0x41a56a=getStringWidth(_0x17e248);return Array(Math[_0x5cb724(0x142)](0x0,_0x2c2b87-_0x41a56a))[_0x5cb724(0x141)]('\x20')[_0x5cb724(0x140)]('');}export function getMaxWidth(_0x415438,_0x31fec2=0x2){const _0x2aaa0c=a16_0x35da;let _0x34a13e='',_0xe160c2=0x0;for(const _0x4585b1 of _0x415438){const _0x590ca6=getStringWidth(_0x4585b1);_0x590ca6>_0xe160c2&&(_0xe160c2=_0x590ca6,_0x34a13e=_0x4585b1);}return _0x34a13e+'\x20'[_0x2aaa0c(0x148)](_0x31fec2);}export function getStringWidth(_0x335019){const _0x198a08=a16_0x35da;let _0x42bbcd=0x0;for(const _0x410d8a of _0x335019){/[\u4e00-\u9fa5]/[_0x198a08(0x13b)](_0x410d8a)?_0x42bbcd+=0x2:_0x42bbcd+=0x1;}return _0x42bbcd;}
1
+ (function(_0x31ecd4,_0x20ddae){const _0x1b8b7b=a18_0x11a3,_0xf168a3=_0x31ecd4();while(!![]){try{const _0x46ecb2=parseInt(_0x1b8b7b(0x161))/0x1*(parseInt(_0x1b8b7b(0x15b))/0x2)+-parseInt(_0x1b8b7b(0x158))/0x3+-parseInt(_0x1b8b7b(0x160))/0x4+-parseInt(_0x1b8b7b(0x15a))/0x5*(parseInt(_0x1b8b7b(0x162))/0x6)+-parseInt(_0x1b8b7b(0x15e))/0x7+-parseInt(_0x1b8b7b(0x159))/0x8*(parseInt(_0x1b8b7b(0x164))/0x9)+parseInt(_0x1b8b7b(0x15c))/0xa;if(_0x46ecb2===_0x20ddae)break;else _0xf168a3['push'](_0xf168a3['shift']());}catch(_0x160a90){_0xf168a3['push'](_0xf168a3['shift']());}}}(a18_0x4d5b,0xddab7));function a18_0x11a3(_0x2dbc4b,_0x41695f){_0x2dbc4b=_0x2dbc4b-0x158;const _0x4d5b0a=a18_0x4d5b();let _0x11a3dc=_0x4d5b0a[_0x2dbc4b];return _0x11a3dc;}export function getRemainingSpaces(_0x1baabc,_0x26b050){const _0x42b42b=a18_0x11a3,_0x17256c=getStringWidth(_0x26b050);return Array(Math['max'](0x0,_0x1baabc-_0x17256c))['fill']('\x20')[_0x42b42b(0x163)]('');}function a18_0x4d5b(){const _0x5c7edc=['280TxOupj','105MZidyP','1232018BzmIEV','60151350sFltRL','repeat','7489951oHAzHx','test','6161500jVqrHS','1HKkxhO','411096cVvcuo','join','323424mzeWCj','1248663LdmAxp'];a18_0x4d5b=function(){return _0x5c7edc;};return a18_0x4d5b();}export function getMaxWidth(_0x4f8e8a,_0x59e626=0x2){const _0x3262e2=a18_0x11a3;let _0x99bd42='',_0x5c0909=0x0;for(const _0x3035d3 of _0x4f8e8a){const _0x51666e=getStringWidth(_0x3035d3);_0x51666e>_0x5c0909&&(_0x5c0909=_0x51666e,_0x99bd42=_0x3035d3);}return _0x99bd42+'\x20'[_0x3262e2(0x15d)](_0x59e626);}export function getStringWidth(_0x4cad8b){const _0x16f865=a18_0x11a3;let _0x24ddd2=0x0;for(const _0x54ea61 of _0x4cad8b){/[\u4e00-\u9fa5]/[_0x16f865(0x15f)](_0x54ea61)?_0x24ddd2+=0x2:_0x24ddd2+=0x1;}return _0x24ddd2;}
@@ -1 +1 @@
1
- (function(_0x4bbefe,_0x5a9e19){const _0x2de7e4=a17_0x1082,_0x34e94b=_0x4bbefe();while(!![]){try{const _0xe5b99=parseInt(_0x2de7e4(0x125))/0x1+parseInt(_0x2de7e4(0x126))/0x2+parseInt(_0x2de7e4(0x11f))/0x3+parseInt(_0x2de7e4(0x121))/0x4+-parseInt(_0x2de7e4(0x11e))/0x5+parseInt(_0x2de7e4(0x11d))/0x6*(parseInt(_0x2de7e4(0x11c))/0x7)+parseInt(_0x2de7e4(0x122))/0x8*(-parseInt(_0x2de7e4(0x127))/0x9);if(_0xe5b99===_0x5a9e19)break;else _0x34e94b['push'](_0x34e94b['shift']());}catch(_0x4e40d9){_0x34e94b['push'](_0x34e94b['shift']());}}}(a17_0x8886,0x1da80));function a17_0x8886(){const _0x23d454=['414216Wcnqbt','HEAD','941140xKSogp','184IoZqwe','trim','test','86459OQVgWy','13404jisFwd','167274TnrTgz','833322ncxGra','12tMidwb','778300AsSTEP'];a17_0x8886=function(){return _0x23d454;};return a17_0x8886();}export function isValidJsHttpsUrl(_0xa1824c){const _0x7b6c6f=a17_0x1082;return/^https:\/\/.+\.js(\?.*)?$/[_0x7b6c6f(0x124)](_0xa1824c[_0x7b6c6f(0x123)]());}export function isValidCssHttpsUrl(_0x2e8604){const _0x31030c=a17_0x1082;return/^https:\/\/.+\.css(\?.*)?$/['test'](_0x2e8604[_0x31030c(0x123)]());}function a17_0x1082(_0x2a2516,_0x3c2580){_0x2a2516=_0x2a2516-0x11c;const _0x8886cd=a17_0x8886();let _0x1082bf=_0x8886cd[_0x2a2516];return _0x1082bf;}export async function isUrlReachable(_0x4b2b9b){const _0x1c69de=a17_0x1082;try{const _0x6f5d74=await fetch(_0x4b2b9b,{'method':_0x1c69de(0x120)});return _0x6f5d74['ok'];}catch{return![];}}
1
+ function a19_0x5618(_0x22c9e6,_0xda401f){_0x22c9e6=_0x22c9e6-0x96;const _0x370330=a19_0x3703();let _0x561880=_0x370330[_0x22c9e6];return _0x561880;}(function(_0x42db2c,_0x164f92){const _0x402803=a19_0x5618,_0x275b12=_0x42db2c();while(!![]){try{const _0xcf481e=-parseInt(_0x402803(0x96))/0x1*(-parseInt(_0x402803(0x97))/0x2)+-parseInt(_0x402803(0x9c))/0x3*(parseInt(_0x402803(0xa3))/0x4)+-parseInt(_0x402803(0xa2))/0x5*(-parseInt(_0x402803(0x9a))/0x6)+parseInt(_0x402803(0x9b))/0x7+-parseInt(_0x402803(0x98))/0x8*(parseInt(_0x402803(0x9d))/0x9)+-parseInt(_0x402803(0x9e))/0xa*(parseInt(_0x402803(0xa0))/0xb)+-parseInt(_0x402803(0x99))/0xc;if(_0xcf481e===_0x164f92)break;else _0x275b12['push'](_0x275b12['shift']());}catch(_0x3ed615){_0x275b12['push'](_0x275b12['shift']());}}}(a19_0x3703,0x703c9));export function isValidJsHttpsUrl(_0x2e521c){return/^https:\/\/.+\.js(\?.*)?$/['test'](_0x2e521c['trim']());}export function isValidCssHttpsUrl(_0x22d0fb){const _0x2507af=a19_0x5618;return/^https:\/\/.+\.css(\?.*)?$/['test'](_0x22d0fb[_0x2507af(0xa1)]());}function a19_0x3703(){const _0x59f8a9=['6980OGMxSO','952ZXGKAV','11vdFFNA','142112lzakzn','13592AhLIAJ','15897036gEAHPz','3444yGdbjZ','5591404wshldF','834aHFYol','2259cliqCM','50LegYuR','HEAD','230131wYfHLe','trim'];a19_0x3703=function(){return _0x59f8a9;};return a19_0x3703();}export async function isUrlReachable(_0x14cdfd){const _0x5a749f=a19_0x5618;try{const _0x4bc51d=await fetch(_0x14cdfd,{'method':_0x5a749f(0x9f)});return _0x4bc51d['ok'];}catch{return![];}}
@@ -1 +1 @@
1
- function a18_0x5b05(){const _0x57769e=['flat','4372083iCKmBL','label','133KKyaoU','2531015qtrvjJ','1125574McbDjK','join','16598870OzaELh','2197512JqENgx','map','resources','48DBTtsc','from','cyan','*\x20待更新的菜单&资源链接','filter','60656djuiJR','column','230104MSuSLN','1AHMfNV'];a18_0x5b05=function(){return _0x57769e;};return a18_0x5b05();}(function(_0x18b521,_0x404317){const _0x2ad9ee=a18_0x1441,_0x1c5d5a=_0x18b521();while(!![]){try{const _0x5b301f=parseInt(_0x2ad9ee(0x1eb))/0x1*(parseInt(_0x2ad9ee(0x1dd))/0x2)+parseInt(_0x2ad9ee(0x1e3))/0x3*(parseInt(_0x2ad9ee(0x1e8))/0x4)+-parseInt(_0x2ad9ee(0x1dc))/0x5+-parseInt(_0x2ad9ee(0x1e0))/0x6+-parseInt(_0x2ad9ee(0x1db))/0x7*(parseInt(_0x2ad9ee(0x1ea))/0x8)+-parseInt(_0x2ad9ee(0x1ed))/0x9+parseInt(_0x2ad9ee(0x1df))/0xa;if(_0x5b301f===_0x404317)break;else _0x1c5d5a['push'](_0x1c5d5a['shift']());}catch(_0x1bdbdb){_0x1c5d5a['push'](_0x1c5d5a['shift']());}}}(a18_0x5b05,0x88daf));import{jsx as a18_0x4a084c,jsxs as a18_0x1e9059}from'react/jsx-runtime';import{Text,Box}from'ink';function a18_0x1441(_0x1d19e4,_0x178e7c){_0x1d19e4=_0x1d19e4-0x1db;const _0x5b057b=a18_0x5b05();let _0x1441f8=_0x5b057b[_0x1d19e4];return _0x1441f8;}export function CurrentMenuCdnContent(_0x86429c){const _0x11feac=a18_0x1441,{menuList:_0xbb5c01}=_0x86429c,_0x49aecc=_0xbb5c01[_0x11feac(0x1e7)](_0xf8023c=>_0xf8023c[_0x11feac(0x1e2)]['length']),_0x3f161e=Array[_0x11feac(0x1e4)](new Set(_0xbb5c01[_0x11feac(0x1e1)](_0x1e823d=>_0x1e823d[_0x11feac(0x1e2)])[_0x11feac(0x1ec)]()));return a18_0x1e9059(Box,{'flexDirection':'column','children':[a18_0x4a084c(Text,{'color':_0x11feac(0x1e5),'children':_0x11feac(0x1e6)}),a18_0x1e9059(Box,{'marginTop':0x1,'flexDirection':_0x11feac(0x1e9),'children':[a18_0x1e9059(Text,{'bold':!![],'children':['\x20\x20','待更新的菜单列表:']}),a18_0x1e9059(Text,{'children':['\x20\x20',_0x49aecc[_0x11feac(0x1e1)](_0x48658f=>_0x48658f[_0x11feac(0x1ee)])[_0x11feac(0x1de)](',\x20')]})]}),a18_0x4a084c(Box,{'marginTop':0x1,'children':a18_0x1e9059(Text,{'bold':!![],'children':['\x20\x20','待更新的资源链接:']})}),_0x3f161e[_0x11feac(0x1e1)](_0x2f4c29=>a18_0x4a084c(Box,{'children':a18_0x1e9059(Text,{'children':['\x20\x20',_0x2f4c29]})},_0x2f4c29))]});}
1
+ function a20_0x51f5(_0x197c7a,_0x4a68f6){_0x197c7a=_0x197c7a-0xad;const _0x4d4f4c=a20_0x4d4f();let _0x51f5ab=_0x4d4f4c[_0x197c7a];return _0x51f5ab;}(function(_0x521b79,_0x1cd5f6){const _0x291d5b=a20_0x51f5,_0x13422f=_0x521b79();while(!![]){try{const _0x1d36e9=parseInt(_0x291d5b(0xb7))/0x1+-parseInt(_0x291d5b(0xb3))/0x2*(-parseInt(_0x291d5b(0xb1))/0x3)+parseInt(_0x291d5b(0xb4))/0x4+parseInt(_0x291d5b(0xb6))/0x5*(parseInt(_0x291d5b(0xb0))/0x6)+-parseInt(_0x291d5b(0xad))/0x7+parseInt(_0x291d5b(0xb2))/0x8+-parseInt(_0x291d5b(0xbc))/0x9;if(_0x1d36e9===_0x1cd5f6)break;else _0x13422f['push'](_0x13422f['shift']());}catch(_0x43bd23){_0x13422f['push'](_0x13422f['shift']());}}}(a20_0x4d4f,0xeb55f));import{jsx as a20_0x4b4e2a,jsxs as a20_0x2e915e}from'react/jsx-runtime';import{Text,Box}from'ink';function a20_0x4d4f(){const _0x3973c3=['12668616HtWbwD','23976IYXQoE','6010652pRQkXQ','resources','6666985unyRvH','916373InkKrA','label','filter','待更新的菜单列表:','length','46599516gRkniE','flat','待更新的资源链接:','join','cyan','1157653GotuSB','map','column','6KTPXdd','243ZwSZcq'];a20_0x4d4f=function(){return _0x3973c3;};return a20_0x4d4f();}export function CurrentMenuCdnContent(_0x56e1d1){const _0x760b32=a20_0x51f5,{menuList:_0x5767e3}=_0x56e1d1,_0x295350=_0x5767e3[_0x760b32(0xb9)](_0x490a2a=>_0x490a2a[_0x760b32(0xb5)][_0x760b32(0xbb)]),_0x360a62=Array['from'](new Set(_0x5767e3['map'](_0x2ab1c5=>_0x2ab1c5[_0x760b32(0xb5)])[_0x760b32(0xbd)]()));return a20_0x2e915e(Box,{'flexDirection':'column','children':[a20_0x4b4e2a(Text,{'color':_0x760b32(0xc0),'children':'*\x20待更新的菜单&资源链接'}),a20_0x2e915e(Box,{'marginTop':0x1,'flexDirection':_0x760b32(0xaf),'children':[a20_0x2e915e(Text,{'bold':!![],'children':['\x20\x20',_0x760b32(0xba)]}),a20_0x2e915e(Text,{'children':['\x20\x20',_0x295350[_0x760b32(0xae)](_0x5287d1=>_0x5287d1[_0x760b32(0xb8)])[_0x760b32(0xbf)](',\x20')]})]}),a20_0x4b4e2a(Box,{'marginTop':0x1,'children':a20_0x2e915e(Text,{'bold':!![],'children':['\x20\x20',_0x760b32(0xbe)]})}),_0x360a62[_0x760b32(0xae)](_0x320728=>a20_0x4b4e2a(Box,{'children':a20_0x2e915e(Text,{'children':['\x20\x20',_0x320728]})},_0x320728))]});}
@@ -1 +1 @@
1
- (function(_0x21d3dd,_0x28148b){const _0x22040b=a19_0x324a,_0x399efd=_0x21d3dd();while(!![]){try{const _0x3c22c6=parseInt(_0x22040b(0x1e3))/0x1+-parseInt(_0x22040b(0x1dc))/0x2*(parseInt(_0x22040b(0x1da))/0x3)+parseInt(_0x22040b(0x1db))/0x4+-parseInt(_0x22040b(0x1e6))/0x5*(-parseInt(_0x22040b(0x1dd))/0x6)+-parseInt(_0x22040b(0x1e0))/0x7*(parseInt(_0x22040b(0x1e5))/0x8)+-parseInt(_0x22040b(0x1e7))/0x9+parseInt(_0x22040b(0x1e4))/0xa;if(_0x3c22c6===_0x28148b)break;else _0x399efd['push'](_0x399efd['shift']());}catch(_0x56afb6){_0x399efd['push'](_0x399efd['shift']());}}}(a19_0x2a37,0x772a2));import{jsx as a19_0x4a84f6,jsxs as a19_0x57af65}from'react/jsx-runtime';import{Text,Box}from'ink';function a19_0x324a(_0x2a7f99,_0xd8f549){_0x2a7f99=_0x2a7f99-0x1d9;const _0x2a37c2=a19_0x2a37();let _0x324aa2=_0x2a37c2[_0x2a7f99];return _0x324aa2;}function a19_0x2a37(){const _0x27b6ed=['46aIGONf','1968YaNQVW','column','green','35jgEYjc','JS\x20链接:\x20','CSS\x20链接:\x20','642601SDfzGZ','2923820LAqekr','438856PGwsHK','3555XSRzGP','5641416OFuXTH','cyan','15813pSojcR','1368996ZdDROg'];a19_0x2a37=function(){return _0x27b6ed;};return a19_0x2a37();}export function InputCdnAsset(_0x2c4af1){const _0x17f8b9=a19_0x324a,{jsCdnUrl:_0x2dfc78,cssCdnUrl:_0x2a156a}=_0x2c4af1;return a19_0x57af65(Box,{'flexDirection':_0x17f8b9(0x1de),'marginTop':0x1,'children':[a19_0x4a84f6(Text,{'color':_0x17f8b9(0x1d9),'children':'*\x20已输入的资源资源'}),a19_0x57af65(Box,{'children':[a19_0x57af65(Text,{'children':['\x20\x20',_0x17f8b9(0x1e1)]}),a19_0x4a84f6(Text,{'color':'green','children':_0x2dfc78})]}),a19_0x57af65(Box,{'children':[a19_0x57af65(Text,{'children':['\x20\x20',_0x17f8b9(0x1e2)]}),a19_0x4a84f6(Text,{'color':_0x17f8b9(0x1df),'children':_0x2a156a})]})]});}
1
+ (function(_0x3697df,_0x12a498){const _0x3e9873=a21_0x3e67,_0x16a722=_0x3697df();while(!![]){try{const _0x83b64f=parseInt(_0x3e9873(0xea))/0x1+-parseInt(_0x3e9873(0xf5))/0x2+-parseInt(_0x3e9873(0xf1))/0x3+parseInt(_0x3e9873(0xe8))/0x4*(parseInt(_0x3e9873(0xee))/0x5)+parseInt(_0x3e9873(0xf4))/0x6*(parseInt(_0x3e9873(0xf2))/0x7)+-parseInt(_0x3e9873(0xf0))/0x8*(-parseInt(_0x3e9873(0xed))/0x9)+-parseInt(_0x3e9873(0xec))/0xa;if(_0x83b64f===_0x12a498)break;else _0x16a722['push'](_0x16a722['shift']());}catch(_0x3a39f5){_0x16a722['push'](_0x16a722['shift']());}}}(a21_0x54ae,0x1c4a2));import{jsx as a21_0x49b871,jsxs as a21_0x5b8437}from'react/jsx-runtime';function a21_0x54ae(){const _0x1142d7=['96iZRPpO','205149TlXTSN','364gzOSSc','JS\x20链接:\x20','14052ttqKVj','216646JVosLZ','cyan','CSS\x20链接:\x20','283280kTOims','column','127001edIcKu','green','1103250pZPZqo','9360DyNFpq','10IluyiR','*\x20已输入的资源资源'];a21_0x54ae=function(){return _0x1142d7;};return a21_0x54ae();}import{Text,Box}from'ink';function a21_0x3e67(_0x5dab2e,_0x117b86){_0x5dab2e=_0x5dab2e-0xe6;const _0x54ae81=a21_0x54ae();let _0x3e67a3=_0x54ae81[_0x5dab2e];return _0x3e67a3;}export function InputCdnAsset(_0x3047b6){const _0x229977=a21_0x3e67,{jsCdnUrl:_0x30d7c0,cssCdnUrl:_0x4e76d4}=_0x3047b6;return a21_0x5b8437(Box,{'flexDirection':_0x229977(0xe9),'marginTop':0x1,'children':[a21_0x49b871(Text,{'color':_0x229977(0xe6),'children':_0x229977(0xef)}),a21_0x5b8437(Box,{'children':[a21_0x5b8437(Text,{'children':['\x20\x20',_0x229977(0xf3)]}),a21_0x49b871(Text,{'color':'green','children':_0x30d7c0})]}),a21_0x5b8437(Box,{'children':[a21_0x5b8437(Text,{'children':['\x20\x20',_0x229977(0xe7)]}),a21_0x49b871(Text,{'color':_0x229977(0xeb),'children':_0x4e76d4})]})]});}
@@ -1 +1 @@
1
- (function(_0x325c0b,_0x20cc69){const _0x139884=a20_0x15ed,_0x256f1d=_0x325c0b();while(!![]){try{const _0x118789=-parseInt(_0x139884(0x154))/0x1*(parseInt(_0x139884(0x133))/0x2)+-parseInt(_0x139884(0x131))/0x3*(parseInt(_0x139884(0x153))/0x4)+-parseInt(_0x139884(0x150))/0x5+parseInt(_0x139884(0x148))/0x6+-parseInt(_0x139884(0x12d))/0x7+-parseInt(_0x139884(0x15c))/0x8*(-parseInt(_0x139884(0x14f))/0x9)+-parseInt(_0x139884(0x134))/0xa*(-parseInt(_0x139884(0x141))/0xb);if(_0x118789===_0x20cc69)break;else _0x256f1d['push'](_0x256f1d['shift']());}catch(_0x4dd725){_0x256f1d['push'](_0x256f1d['shift']());}}}(a20_0x478e,0x58e12));import{jsx as a20_0x2fa488,jsxs as a20_0x17c9e2,Fragment as a20_0x34766e}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';function a20_0x478e(){const _0x364015=['resolve','slice','取消更新','CSS\x20链接无法访问','11007kYbjvI','3010365ZCtsbR','backspace','label','4xJsyGc','316QYmIjn','!\x20未找到菜单资源链接','from','path','return','resources','all','map','1528RRbGvH','delete','need-confirm','cyan','\x20正在获取线上菜单资源链接...','gray','输入项目的\x20JS\x20资源链接(https://...)','5009851kYdcnp','lovrabet\x20auth','\x20命令重新登录','column','1995846BQIPYS','green','4462zDjjrX','7430Jcehtz','*\x20请输入新的资源链接','dots','length','请输入有效的\x20JS\x20https\x20链接','CSS\x20链接:\x20','downArrow','yellow','\x20资源正在同步中...','input-css','trim','creating','red','39787uxfRGk','cancel','JS\x20链接:\x20','rightArrow','input-js','继续更新','JS\x20链接无法访问','786420ahcCfZ','updated','请输入有效的\x20CSS\x20https\x20链接'];a20_0x478e=function(){return _0x364015;};return a20_0x478e();}import{useEffect,useState}from'react';import a20_0xb9cda1 from'ink-spinner';import{useGetOnlineMenuList}from'../app-menu/use-get-online-menu-list.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../app-menu/valid-url.js';import{CurrentMenuCdnContent}from'./current-content.js';import{InputCdnAsset}from'./input-cdn-asset.js';function a20_0x15ed(_0xa90e45,_0x1e2728){_0xa90e45=_0xa90e45-0x12b;const _0x478e5f=a20_0x478e();let _0x15edcb=_0x478e5f[_0xa90e45];return _0x15edcb;}import{updateMenuCdnUrl}from'./update-menu-cdn-url.js';import.meta.main&&render(a20_0x2fa488(AppMenuUpdateCdn,{}));export function AppMenuUpdateCdn(){const _0x31ca52=a20_0x15ed,{exit:_0x44fecb}=useApp(),{loading:_0x13da5b,menuList:_0x524d04,error:_0x24ae75}=useGetOnlineMenuList(),[_0xed545,_0x2687ae]=useState('ok'),[_0xf6a1d7,_0x45528c]=useState('input-js'),[_0x27610a,_0x2fc960]=useState(''),[_0x224446,_0x3b5c88]=useState(''),[_0x3c3208,_0x341770]=useState(''),[_0x488c54,_0x97b872]=useState(''),_0x5973a4=Array[_0x31ca52(0x156)](new Set(_0x524d04[_0x31ca52(0x15b)](_0x185266=>_0x185266[_0x31ca52(0x159)])['flat']()));useEffect(()=>{_0xf6a1d7==='updated'&&setTimeout(_0x44fecb,0x32);},[_0xf6a1d7]),useInput(async(_0x3db708,_0x5427b5)=>{const _0x3e7f09=_0x31ca52;if(_0xf6a1d7===_0x3e7f09(0x145)){if(_0x5427b5[_0x3e7f09(0x158)]){const _0x5bd3ea=_0x3c3208[_0x3e7f09(0x13e)]();if(_0x5bd3ea==='')return;if(!isValidJsHttpsUrl(_0x5bd3ea)){_0x97b872(_0x3e7f09(0x138));return;}if(!await isUrlReachable(_0x5bd3ea)){_0x97b872(_0x3e7f09(0x147));return;}_0x2fc960(_0x5bd3ea),_0x341770(''),_0x97b872(''),_0x45528c(_0x3e7f09(0x13d));return;}if(_0x5427b5[_0x3e7f09(0x151)]||_0x5427b5[_0x3e7f09(0x15d)]){_0x341770(_0x47c8d9=>_0x47c8d9[_0x3e7f09(0x14c)](0x0,-0x1)),_0x97b872('');return;}_0x341770(_0x3fd11d=>_0x3fd11d+_0x3db708);return;}if(_0xf6a1d7==='input-css'){if(_0x5427b5[_0x3e7f09(0x158)]){const _0x1c3b94=_0x3c3208[_0x3e7f09(0x13e)]();if(_0x1c3b94==='')return;if(!isValidCssHttpsUrl(_0x1c3b94)){_0x97b872(_0x3e7f09(0x14a));return;}if(!await isUrlReachable(_0x1c3b94)){_0x97b872(_0x3e7f09(0x14e));return;}_0x3b5c88(_0x1c3b94),_0x341770(''),_0x97b872(''),_0x45528c(_0x3e7f09(0x15e));return;}if(_0x5427b5[_0x3e7f09(0x151)]||_0x5427b5[_0x3e7f09(0x15d)]){_0x341770(_0x4d6728=>_0x4d6728[_0x3e7f09(0x14c)](0x0,-0x1)),_0x97b872('');return;}_0x341770(_0x437f26=>_0x437f26+_0x3db708);return;}if(_0xf6a1d7==='need-confirm'){(_0x5427b5['upArrow']||_0x5427b5[_0x3e7f09(0x13a)]||_0x5427b5['leftArrow']||_0x5427b5[_0x3e7f09(0x144)])&&_0x2687ae(_0x1c3dee=>_0x1c3dee==='ok'?'cancel':'ok');if(_0x5427b5[_0x3e7f09(0x158)]){_0x45528c('creating');if(_0xed545==='ok')await Promise[_0x3e7f09(0x15a)](_0x524d04[_0x3e7f09(0x15b)](_0x1bdd8a=>{const _0x26e79c=_0x3e7f09,_0x3f42f7={'id':_0x1bdd8a['id'],'label':_0x1bdd8a[_0x26e79c(0x152)],'path':_0x1bdd8a[_0x26e79c(0x157)],'resources':[_0x27610a,_0x224446]};if(_0x1bdd8a[_0x26e79c(0x159)]['length']===0x0)return Promise[_0x26e79c(0x14b)]();return updateMenuCdnUrl(_0x3f42f7);})),await new Promise(_0x572921=>setTimeout(_0x572921,0x3e8)),_0x45528c(_0x3e7f09(0x149));else _0xed545===_0x3e7f09(0x142)&&_0x44fecb();}}});if(_0x13da5b)return a20_0x17c9e2(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a20_0x2fa488(Text,{}),a20_0x2fa488(a20_0xb9cda1,{'type':_0x31ca52(0x136)}),a20_0x2fa488(Text,{'children':_0x31ca52(0x160)})]});if(_0x24ae75)return a20_0x17c9e2(Box,{'flexDirection':_0x31ca52(0x130),'marginTop':0x1,'marginBottom':0x1,'children':[a20_0x17c9e2(Text,{'color':_0x31ca52(0x140),'children':['✗\x20',_0x24ae75]}),a20_0x17c9e2(Box,{'marginTop':0x1,'children':[a20_0x2fa488(Text,{'color':_0x31ca52(0x12b),'children':'提示:使用\x20'}),a20_0x2fa488(Text,{'color':_0x31ca52(0x15f),'children':_0x31ca52(0x12e)}),a20_0x2fa488(Text,{'color':_0x31ca52(0x12b),'children':_0x31ca52(0x12f)})]})]});if(_0x5973a4[_0x31ca52(0x137)]===0x0)return a20_0x2fa488(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a20_0x2fa488(Text,{'color':_0x31ca52(0x13b),'children':_0x31ca52(0x155)})});if(_0xf6a1d7==='need-confirm')return a20_0x17c9e2(Box,{'flexDirection':_0x31ca52(0x130),'marginTop':0x1,'marginBottom':0x1,'children':[a20_0x2fa488(CurrentMenuCdnContent,{'menuList':_0x524d04}),a20_0x2fa488(InputCdnAsset,{'jsCdnUrl':_0x27610a,'cssCdnUrl':_0x224446}),a20_0x2fa488(Box,{'marginTop':0x1,'flexDirection':'column','children':[{'label':_0x31ca52(0x146),'value':'ok'},{'label':_0x31ca52(0x14d),'value':_0x31ca52(0x142)}][_0x31ca52(0x15b)](_0x116975=>a20_0x17c9e2(Text,{'color':_0xed545===_0x116975['value']?'yellow':undefined,'children':[_0xed545===_0x116975['value']?'>\x20':'\x20\x20',_0x116975[_0x31ca52(0x152)]]},_0x116975['value']))})]});if(_0xf6a1d7===_0x31ca52(0x13f))return a20_0x17c9e2(Box,{'flexDirection':_0x31ca52(0x130),'marginTop':0x1,'marginBottom':0x1,'children':[a20_0x2fa488(CurrentMenuCdnContent,{'menuList':_0x524d04}),a20_0x2fa488(InputCdnAsset,{'jsCdnUrl':_0x27610a,'cssCdnUrl':_0x224446}),a20_0x17c9e2(Box,{'marginTop':0x1,'children':[a20_0x2fa488(a20_0xb9cda1,{'type':'dots'}),a20_0x2fa488(Text,{'children':_0x31ca52(0x13c)})]})]});if(_0xf6a1d7===_0x31ca52(0x149))return a20_0x17c9e2(Box,{'flexDirection':_0x31ca52(0x130),'marginTop':0x1,'marginBottom':0x1,'children':[a20_0x2fa488(CurrentMenuCdnContent,{'menuList':_0x524d04}),a20_0x2fa488(InputCdnAsset,{'jsCdnUrl':_0x27610a,'cssCdnUrl':_0x224446}),a20_0x2fa488(Box,{'marginTop':0x1,'children':a20_0x2fa488(Text,{'color':_0x31ca52(0x132),'children':'√\x20更新成功'})})]});return a20_0x17c9e2(Box,{'flexDirection':_0x31ca52(0x130),'marginTop':0x1,'marginBottom':0x1,'children':[a20_0x2fa488(CurrentMenuCdnContent,{'menuList':_0x524d04}),a20_0x17c9e2(Box,{'marginTop':0x1,'flexDirection':_0x31ca52(0x130),'children':[a20_0x2fa488(Text,{'color':'cyan','children':_0x31ca52(0x135)}),_0x27610a?a20_0x17c9e2(Box,{'children':[a20_0x17c9e2(Text,{'color':_0x31ca52(0x12b),'children':['\x20\x20',_0x31ca52(0x143)]}),a20_0x2fa488(Text,{'color':_0x31ca52(0x132),'children':_0x27610a})]}):_0xf6a1d7===_0x31ca52(0x145)&&a20_0x17c9e2(a20_0x34766e,{'children':[a20_0x17c9e2(Box,{'children':[a20_0x17c9e2(Text,{'children':['\x20\x20',_0x31ca52(0x143)]}),a20_0x2fa488(Text,{'color':_0x31ca52(0x132),'children':_0x3c3208}),_0x488c54&&a20_0x17c9e2(Text,{'color':'red','children':['\x20←\x20',_0x488c54]})]}),!_0x488c54&&a20_0x2fa488(Box,{'children':a20_0x17c9e2(Text,{'color':_0x31ca52(0x12b),'children':['\x20\x20',_0x31ca52(0x12c)]})})]}),_0x224446?a20_0x17c9e2(Box,{'children':[a20_0x17c9e2(Text,{'children':['\x20\x20',_0x31ca52(0x139)]}),a20_0x2fa488(Text,{'color':_0x31ca52(0x132),'children':_0x224446})]}):_0xf6a1d7===_0x31ca52(0x13d)&&a20_0x17c9e2(a20_0x34766e,{'children':[a20_0x17c9e2(Box,{'children':[a20_0x17c9e2(Text,{'children':['\x20\x20',_0x31ca52(0x139)]}),a20_0x2fa488(Text,{'color':_0x31ca52(0x132),'children':_0x3c3208}),_0x488c54&&a20_0x17c9e2(Text,{'color':'red','children':['\x20←\x20',_0x488c54]})]}),!_0x488c54&&a20_0x2fa488(Box,{'children':a20_0x17c9e2(Text,{'color':_0x31ca52(0x12b),'children':['\x20\x20','输入项目的\x20CSS\x20资源链接(https://...)']})})]})]})]});}
1
+ (function(_0xa63425,_0x2e4667){const _0x5221ac=a22_0x3a9d,_0x1ba35a=_0xa63425();while(!![]){try{const _0x1fc3a9=parseInt(_0x5221ac(0xa5))/0x1*(-parseInt(_0x5221ac(0xa1))/0x2)+-parseInt(_0x5221ac(0xb7))/0x3*(parseInt(_0x5221ac(0xa4))/0x4)+-parseInt(_0x5221ac(0x96))/0x5*(parseInt(_0x5221ac(0x99))/0x6)+-parseInt(_0x5221ac(0xc4))/0x7*(parseInt(_0x5221ac(0xb4))/0x8)+parseInt(_0x5221ac(0xa6))/0x9*(parseInt(_0x5221ac(0xbf))/0xa)+-parseInt(_0x5221ac(0xc0))/0xb+parseInt(_0x5221ac(0xb2))/0xc;if(_0x1fc3a9===_0x2e4667)break;else _0x1ba35a['push'](_0x1ba35a['shift']());}catch(_0x534b69){_0x1ba35a['push'](_0x1ba35a['shift']());}}}(a22_0x548f,0x7aacc));import{jsx as a22_0x9bb527,jsxs as a22_0x584756,Fragment as a22_0x14122f}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a22_0x5071d2 from'ink-spinner';import{useGetOnlineMenuList}from'../app-menu/use-get-online-menu-list.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../app-menu/valid-url.js';import{CurrentMenuCdnContent}from'./current-content.js';import{InputCdnAsset}from'./input-cdn-asset.js';import{updateMenuCdnUrl}from'./update-menu-cdn-url.js';function a22_0x3a9d(_0x6b588d,_0x143a67){_0x6b588d=_0x6b588d-0x92;const _0x548fbc=a22_0x548f();let _0x3a9d7d=_0x548fbc[_0x6b588d];return _0x3a9d7d;}import.meta.main&&render(a22_0x9bb527(AppMenuUpdateCdn,{}));export function AppMenuUpdateCdn(){const _0x539717=a22_0x3a9d,{exit:_0x4dff05}=useApp(),{loading:_0x5554b4,menuList:_0x4ff589,error:_0x176749}=useGetOnlineMenuList(),[_0x7262c0,_0x43e18d]=useState('ok'),[_0x5dd38d,_0x44ac34]=useState(_0x539717(0xc8)),[_0x3d90da,_0x528f6a]=useState(''),[_0x860e09,_0x3af78a]=useState(''),[_0x531325,_0x3d147f]=useState(''),[_0x4e8866,_0x2d77b9]=useState(''),_0x478205=Array[_0x539717(0x98)](new Set(_0x4ff589[_0x539717(0xab)](_0x4c34b3=>_0x4c34b3[_0x539717(0xc3)])['flat']()));useEffect(()=>{_0x5dd38d==='updated'&&setTimeout(_0x4dff05,0x32);},[_0x5dd38d]),useInput(async(_0x181607,_0x19475d)=>{const _0x46880f=_0x539717;if(_0x5dd38d===_0x46880f(0xc8)){if(_0x19475d['return']){const _0x23ef12=_0x531325['trim']();if(_0x23ef12==='')return;if(!isValidJsHttpsUrl(_0x23ef12)){_0x2d77b9(_0x46880f(0xa7));return;}if(!await isUrlReachable(_0x23ef12)){_0x2d77b9(_0x46880f(0xbb));return;}_0x528f6a(_0x23ef12),_0x3d147f(''),_0x2d77b9(''),_0x44ac34(_0x46880f(0xa9));return;}if(_0x19475d[_0x46880f(0xbd)]||_0x19475d[_0x46880f(0xc1)]){_0x3d147f(_0x372b71=>_0x372b71[_0x46880f(0xb0)](0x0,-0x1)),_0x2d77b9('');return;}_0x3d147f(_0x4d1fc7=>_0x4d1fc7+_0x181607);return;}if(_0x5dd38d===_0x46880f(0xa9)){if(_0x19475d['return']){const _0x53d5ad=_0x531325[_0x46880f(0xa8)]();if(_0x53d5ad==='')return;if(!isValidCssHttpsUrl(_0x53d5ad)){_0x2d77b9(_0x46880f(0xa3));return;}if(!await isUrlReachable(_0x53d5ad)){_0x2d77b9(_0x46880f(0xaa));return;}_0x3af78a(_0x53d5ad),_0x3d147f(''),_0x2d77b9(''),_0x44ac34(_0x46880f(0xba));return;}if(_0x19475d['backspace']||_0x19475d['delete']){_0x3d147f(_0x45d69d=>_0x45d69d[_0x46880f(0xb0)](0x0,-0x1)),_0x2d77b9('');return;}_0x3d147f(_0x357b39=>_0x357b39+_0x181607);return;}if(_0x5dd38d===_0x46880f(0xba)){(_0x19475d[_0x46880f(0xbc)]||_0x19475d[_0x46880f(0xc7)]||_0x19475d['leftArrow']||_0x19475d['rightArrow'])&&_0x43e18d(_0x45540a=>_0x45540a==='ok'?_0x46880f(0xad):'ok');if(_0x19475d[_0x46880f(0xb1)]){_0x44ac34(_0x46880f(0xb5));if(_0x7262c0==='ok')await Promise[_0x46880f(0x9b)](_0x4ff589[_0x46880f(0xab)](_0x52f879=>{const _0x1ee5d0=_0x46880f,_0x38079f={'id':_0x52f879['id'],'label':_0x52f879['label'],'path':_0x52f879[_0x1ee5d0(0xa2)],'resources':[_0x3d90da,_0x860e09]};if(_0x52f879[_0x1ee5d0(0xc3)][_0x1ee5d0(0xb3)]===0x0)return Promise[_0x1ee5d0(0x95)]();return updateMenuCdnUrl(_0x38079f);})),await new Promise(_0x9dab26=>setTimeout(_0x9dab26,0x3e8)),_0x44ac34('updated');else _0x7262c0===_0x46880f(0xad)&&_0x4dff05();}}});if(_0x5554b4)return a22_0x584756(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a22_0x9bb527(Text,{}),a22_0x9bb527(a22_0x5071d2,{'type':_0x539717(0xb8)}),a22_0x9bb527(Text,{'children':_0x539717(0x9e)})]});if(_0x176749)return a22_0x584756(Box,{'flexDirection':_0x539717(0xac),'marginTop':0x1,'marginBottom':0x1,'children':[a22_0x584756(Text,{'color':_0x539717(0x94),'children':['✗\x20',_0x176749]}),a22_0x584756(Box,{'marginTop':0x1,'children':[a22_0x9bb527(Text,{'color':_0x539717(0x9d),'children':_0x539717(0x9a)}),a22_0x9bb527(Text,{'color':_0x539717(0x9f),'children':'lovrabet\x20auth'}),a22_0x9bb527(Text,{'color':_0x539717(0x9d),'children':_0x539717(0xc2)})]})]});if(_0x478205[_0x539717(0xb3)]===0x0)return a22_0x9bb527(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a22_0x9bb527(Text,{'color':_0x539717(0xb6),'children':_0x539717(0xaf)})});if(_0x5dd38d===_0x539717(0xba))return a22_0x584756(Box,{'flexDirection':_0x539717(0xac),'marginTop':0x1,'marginBottom':0x1,'children':[a22_0x9bb527(CurrentMenuCdnContent,{'menuList':_0x4ff589}),a22_0x9bb527(InputCdnAsset,{'jsCdnUrl':_0x3d90da,'cssCdnUrl':_0x860e09}),a22_0x9bb527(Box,{'marginTop':0x1,'flexDirection':_0x539717(0xac),'children':[{'label':_0x539717(0xb9),'value':'ok'},{'label':_0x539717(0xae),'value':_0x539717(0xad)}][_0x539717(0xab)](_0x35cfc9=>a22_0x584756(Text,{'color':_0x7262c0===_0x35cfc9[_0x539717(0x97)]?'yellow':undefined,'children':[_0x7262c0===_0x35cfc9[_0x539717(0x97)]?'>\x20':'\x20\x20',_0x35cfc9['label']]},_0x35cfc9[_0x539717(0x97)]))})]});if(_0x5dd38d==='creating')return a22_0x584756(Box,{'flexDirection':_0x539717(0xac),'marginTop':0x1,'marginBottom':0x1,'children':[a22_0x9bb527(CurrentMenuCdnContent,{'menuList':_0x4ff589}),a22_0x9bb527(InputCdnAsset,{'jsCdnUrl':_0x3d90da,'cssCdnUrl':_0x860e09}),a22_0x584756(Box,{'marginTop':0x1,'children':[a22_0x9bb527(a22_0x5071d2,{'type':_0x539717(0xb8)}),a22_0x9bb527(Text,{'children':_0x539717(0x93)})]})]});if(_0x5dd38d==='updated')return a22_0x584756(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a22_0x9bb527(CurrentMenuCdnContent,{'menuList':_0x4ff589}),a22_0x9bb527(InputCdnAsset,{'jsCdnUrl':_0x3d90da,'cssCdnUrl':_0x860e09}),a22_0x9bb527(Box,{'marginTop':0x1,'children':a22_0x9bb527(Text,{'color':_0x539717(0x92),'children':_0x539717(0xa0)})})]});return a22_0x584756(Box,{'flexDirection':_0x539717(0xac),'marginTop':0x1,'marginBottom':0x1,'children':[a22_0x9bb527(CurrentMenuCdnContent,{'menuList':_0x4ff589}),a22_0x584756(Box,{'marginTop':0x1,'flexDirection':_0x539717(0xac),'children':[a22_0x9bb527(Text,{'color':_0x539717(0x9f),'children':'*\x20请输入新的资源链接'}),_0x3d90da?a22_0x584756(Box,{'children':[a22_0x584756(Text,{'color':_0x539717(0x9d),'children':['\x20\x20',_0x539717(0xc5)]}),a22_0x9bb527(Text,{'color':_0x539717(0x92),'children':_0x3d90da})]}):_0x5dd38d===_0x539717(0xc8)&&a22_0x584756(a22_0x14122f,{'children':[a22_0x584756(Box,{'children':[a22_0x584756(Text,{'children':['\x20\x20',_0x539717(0xc5)]}),a22_0x9bb527(Text,{'color':_0x539717(0x92),'children':_0x531325}),_0x4e8866&&a22_0x584756(Text,{'color':'red','children':[_0x539717(0x9c),_0x4e8866]})]}),!_0x4e8866&&a22_0x9bb527(Box,{'children':a22_0x584756(Text,{'color':_0x539717(0x9d),'children':['\x20\x20',_0x539717(0xc6)]})})]}),_0x860e09?a22_0x584756(Box,{'children':[a22_0x584756(Text,{'children':['\x20\x20','CSS\x20链接:\x20']}),a22_0x9bb527(Text,{'color':_0x539717(0x92),'children':_0x860e09})]}):_0x5dd38d==='input-css'&&a22_0x584756(a22_0x14122f,{'children':[a22_0x584756(Box,{'children':[a22_0x584756(Text,{'children':['\x20\x20','CSS\x20链接:\x20']}),a22_0x9bb527(Text,{'color':_0x539717(0x92),'children':_0x531325}),_0x4e8866&&a22_0x584756(Text,{'color':_0x539717(0x94),'children':[_0x539717(0x9c),_0x4e8866]})]}),!_0x4e8866&&a22_0x9bb527(Box,{'children':a22_0x584756(Text,{'color':'gray','children':['\x20\x20',_0x539717(0xbe)]})})]})]})]});}function a22_0x548f(){const _0x23d66f=['cyan','√\x20更新成功','6aZBCQV','path','请输入有效的\x20CSS\x20https\x20链接','3941744wksrUF','138862fQCTdy','14463Ybuemq','请输入有效的\x20JS\x20https\x20链接','trim','input-css','CSS\x20链接无法访问','map','column','cancel','取消更新','!\x20未找到菜单资源链接','slice','return','38137332vyQWbl','length','1323664feNPSZ','creating','yellow','3kYcqHA','dots','继续更新','need-confirm','JS\x20链接无法访问','upArrow','backspace','输入项目的\x20CSS\x20资源链接(https://...)','5710hzITOh','8928513MQnKnW','delete','\x20命令重新登录','resources','21CYnYmM','JS\x20链接:\x20','输入项目的\x20JS\x20资源链接(https://...)','downArrow','input-js','green','\x20资源正在同步中...','red','resolve','4415765FjGoKy','value','from','6pBnFEf','提示:使用\x20','all','\x20←\x20','gray','\x20正在获取线上菜单资源链接...'];a22_0x548f=function(){return _0x23d66f;};return a22_0x548f();}
@@ -1 +1 @@
1
- const a22_0x714be3=a22_0x276e;(function(_0x6e3147,_0x33d620){const _0x498d85=a22_0x276e,_0x4c72af=_0x6e3147();while(!![]){try{const _0x28d6cc=-parseInt(_0x498d85(0xe4))/0x1+parseInt(_0x498d85(0xf0))/0x2*(-parseInt(_0x498d85(0xea))/0x3)+-parseInt(_0x498d85(0xee))/0x4*(parseInt(_0x498d85(0xf2))/0x5)+-parseInt(_0x498d85(0xe3))/0x6*(parseInt(_0x498d85(0xd9))/0x7)+-parseInt(_0x498d85(0xd5))/0x8*(parseInt(_0x498d85(0xd6))/0x9)+parseInt(_0x498d85(0xcb))/0xa*(-parseInt(_0x498d85(0xd2))/0xb)+parseInt(_0x498d85(0xeb))/0xc;if(_0x28d6cc===_0x33d620)break;else _0x4c72af['push'](_0x4c72af['shift']());}catch(_0x4e7bec){_0x4c72af['push'](_0x4c72af['shift']());}}}(a22_0x341c,0x384b9));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a22_0x276e(_0x31f422,_0x5b352c){_0x31f422=_0x31f422-0xca;const _0x341c7f=a22_0x341c();let _0x276e1b=_0x341c7f[_0x31f422];return _0x276e1b;}import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';const config=readConfig(),logLabel=a22_0x714be3(0xcf);import.meta.main&&updateMenuCdnUrl({'id':0xf41e,'label':a22_0x714be3(0xe7),'path':a22_0x714be3(0xd1),'resources':[a22_0x714be3(0xda),'https://g.yuntooai.com/dist/yt-test-app/1.0.1/assets/main.css']});function a22_0x341c(){const _0x55e54e=['path','data','resources','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','更新菜单资源失败:\x20','851226wiVeFH','307576mTxaAi','label','log','SdkDemo1','success','stringify','307482iPvDLe','27056472XSyyXY','POST','status','289412HFZURx','菜单资源同步成功:\x20','6VdvlwC','application/json','10BykGoV','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','10rOTamh','import','errorMsg','info','update-menu-cdn-url','!\x20请使用以下方式之一:','sdk-demo','4830859HwWHwC','json','errorCode','58120ipwann','495SlAund','未知错误','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','21bFdWov','https://g.yuntooai.com/dist/yt-test-app/1.0.1/assets/main.js','未提供应用AppCode,且配置中也没有默认值','error','/smartapi/menu/update'];a22_0x341c=function(){return _0x55e54e;};return a22_0x341c();}export async function updateMenuCdnUrl(_0x282dd7){const _0x31af40=a22_0x714be3,_0x2c4fb2=config?.['appcode'];if(!_0x2c4fb2){const _0x5d73f6=_0x31af40(0xdb);logger[_0x31af40(0xdc)](logLabel,_0x5d73f6),console[_0x31af40(0xdc)]('×\x20'+_0x5d73f6),console[_0x31af40(0xe6)](_0x31af40(0xd0)),console[_0x31af40(0xe6)](_0x31af40(0xd8)),console['log'](_0x31af40(0xe1));return;}logger[_0x31af40(0xce)](logLabel,'正在更新菜单资源链接:\x20'+_0x282dd7[_0x31af40(0xe5)]+'\x20('+_0x282dd7[_0x31af40(0xde)]+')');const _0x5a7a5f={'id':_0x282dd7['id'],'appCode':_0x2c4fb2,'extend':{'loadScriptMode':_0x31af40(0xcc),'resources':_0x282dd7[_0x31af40(0xe0)]?JSON[_0x31af40(0xe9)](_0x282dd7[_0x31af40(0xe0)]):undefined}},_0x14cfca=await fetch(getApiDomain()+_0x31af40(0xdd),{'method':_0x31af40(0xec),'body':JSON[_0x31af40(0xe9)](_0x5a7a5f),'headers':{'Content-Type':_0x31af40(0xf1),'Cookie':getCookie()}});if(!_0x14cfca['ok']){if(_0x14cfca['status']===0x191){const _0x5cfa0d=_0x31af40(0xca);logger[_0x31af40(0xdc)](logLabel,_0x5cfa0d,{'status':_0x14cfca[_0x31af40(0xed)],'menu':_0x282dd7[_0x31af40(0xe5)]});throw new Error(_0x5cfa0d);}const _0x5d676e='创建菜单失败,HTTP状态码:\x20'+_0x14cfca['status'];logger['error'](logLabel,_0x5d676e,{'menu':_0x282dd7[_0x31af40(0xe5)]});throw new Error(_0x5d676e);}const _0x4df991=await _0x14cfca[_0x31af40(0xd3)]();if(!_0x4df991[_0x31af40(0xe8)]){const _0x4adb94=_0x31af40(0xe2)+(_0x4df991['errorMsg']||_0x31af40(0xd7));logger['error'](logLabel,_0x4adb94,{'errorCode':_0x4df991[_0x31af40(0xd4)],'errorMsg':_0x4df991[_0x31af40(0xcd)],'menu':_0x282dd7['label']});throw new Error(_0x4adb94);}logger[_0x31af40(0xce)](logLabel,_0x31af40(0xef)+_0x282dd7[_0x31af40(0xe5)],_0x4df991[_0x31af40(0xdf)]);}
1
+ const a24_0x38a6e0=a24_0x588b;(function(_0xa1fd1e,_0x37b4b2){const _0x5c58ce=a24_0x588b,_0x4fb875=_0xa1fd1e();while(!![]){try{const _0x17906e=parseInt(_0x5c58ce(0x133))/0x1*(parseInt(_0x5c58ce(0x13d))/0x2)+parseInt(_0x5c58ce(0x123))/0x3*(parseInt(_0x5c58ce(0x124))/0x4)+-parseInt(_0x5c58ce(0x138))/0x5+-parseInt(_0x5c58ce(0x12c))/0x6*(-parseInt(_0x5c58ce(0x135))/0x7)+-parseInt(_0x5c58ce(0x127))/0x8*(-parseInt(_0x5c58ce(0x126))/0x9)+-parseInt(_0x5c58ce(0x140))/0xa+parseInt(_0x5c58ce(0x136))/0xb*(parseInt(_0x5c58ce(0x12e))/0xc);if(_0x17906e===_0x37b4b2)break;else _0x4fb875['push'](_0x4fb875['shift']());}catch(_0x4ff981){_0x4fb875['push'](_0x4fb875['shift']());}}}(a24_0x1ccd,0x801b8));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a24_0x588b(_0x15cef1,_0x32f5af){_0x15cef1=_0x15cef1-0x123;const _0x1ccd4d=a24_0x1ccd();let _0x588b09=_0x1ccd4d[_0x15cef1];return _0x588b09;}function a24_0x1ccd(){const _0x575f63=['errorMsg','error','!\x20请使用以下方式之一:','info','errorCode','774057cFxnUF','4fRkkBX','stringify','1791rCUFEU','23272yhiDQg','success','更新菜单资源失败:\x20','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','update-menu-cdn-url','18mLDBYn','resources','291708jWmTWa','未提供应用AppCode,且配置中也没有默认值','label','创建菜单失败,HTTP状态码:\x20','未知错误','103SLQmTa','data','1129303dJLByx','44fezboG','https://g.yuntooai.com/dist/yt-test-app/1.0.1/assets/main.css','430580ceWGtZ','application/json','菜单资源同步成功:\x20','正在更新菜单资源链接:\x20','status','3558qiOfWo','sdk-demo','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','9905260NJTEjf','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','log','SdkDemo1','/smartapi/menu/update','import','POST'];a24_0x1ccd=function(){return _0x575f63;};return a24_0x1ccd();}import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';const config=readConfig(),logLabel=a24_0x38a6e0(0x12b);import.meta.main&&updateMenuCdnUrl({'id':0xf41e,'label':a24_0x38a6e0(0x143),'path':a24_0x38a6e0(0x13e),'resources':['https://g.yuntooai.com/dist/yt-test-app/1.0.1/assets/main.js',a24_0x38a6e0(0x137)]});export async function updateMenuCdnUrl(_0x36cfbc){const _0x1ac989=a24_0x38a6e0,_0x2c5cff=config?.['appcode'];if(!_0x2c5cff){const _0xaeac1b=_0x1ac989(0x12f);logger[_0x1ac989(0x148)](logLabel,_0xaeac1b),console[_0x1ac989(0x148)]('×\x20'+_0xaeac1b),console[_0x1ac989(0x142)](_0x1ac989(0x149)),console['log'](_0x1ac989(0x12a)),console[_0x1ac989(0x142)](_0x1ac989(0x141));return;}logger[_0x1ac989(0x14a)](logLabel,_0x1ac989(0x13b)+_0x36cfbc[_0x1ac989(0x130)]+'\x20('+_0x36cfbc['path']+')');const _0x3ca98c={'id':_0x36cfbc['id'],'appCode':_0x2c5cff,'extend':{'loadScriptMode':_0x1ac989(0x145),'resources':_0x36cfbc['resources']?JSON[_0x1ac989(0x125)](_0x36cfbc[_0x1ac989(0x12d)]):undefined}},_0x3d7d43=await fetch(getApiDomain()+_0x1ac989(0x144),{'method':_0x1ac989(0x146),'body':JSON['stringify'](_0x3ca98c),'headers':{'Content-Type':_0x1ac989(0x139),'Cookie':getCookie()}});if(!_0x3d7d43['ok']){if(_0x3d7d43[_0x1ac989(0x13c)]===0x191){const _0x2916d0=_0x1ac989(0x13f);logger[_0x1ac989(0x148)](logLabel,_0x2916d0,{'status':_0x3d7d43[_0x1ac989(0x13c)],'menu':_0x36cfbc['label']});throw new Error(_0x2916d0);}const _0xbcdba9=_0x1ac989(0x131)+_0x3d7d43['status'];logger['error'](logLabel,_0xbcdba9,{'menu':_0x36cfbc['label']});throw new Error(_0xbcdba9);}const _0x5b1d80=await _0x3d7d43['json']();if(!_0x5b1d80[_0x1ac989(0x128)]){const _0x56825a=_0x1ac989(0x129)+(_0x5b1d80[_0x1ac989(0x147)]||_0x1ac989(0x132));logger[_0x1ac989(0x148)](logLabel,_0x56825a,{'errorCode':_0x5b1d80[_0x1ac989(0x14b)],'errorMsg':_0x5b1d80[_0x1ac989(0x147)],'menu':_0x36cfbc[_0x1ac989(0x130)]});throw new Error(_0x56825a);}logger[_0x1ac989(0x14a)](logLabel,_0x1ac989(0x13a)+_0x36cfbc[_0x1ac989(0x130)],_0x5b1d80[_0x1ac989(0x134)]);}
@@ -1 +1 @@
1
- function a23_0x3380(){const _0x1a9621=['810614mPwhEB','finally','then','gray','按\x20“q”\x20退出。','请前往浏览器完成登录。','log','return','945093uJyuXU','column','green','√\x20当前为有效会话,无需重新登录。','362zDQBTI','*\x20登录成功!','正在登录...\x20','dots','*\x20按回车开始登录。','1489636eMEgIn','601cKLkiA','1727934EmxcDP','4204744ahAURe','1886810WUkNtG'];a23_0x3380=function(){return _0x1a9621;};return a23_0x3380();}(function(_0x12b60d,_0x116200){const _0x4456c5=a23_0x10c8,_0x1aa37e=_0x12b60d();while(!![]){try{const _0x537002=-parseInt(_0x4456c5(0x11e))/0x1*(parseInt(_0x4456c5(0x118))/0x2)+-parseInt(_0x4456c5(0x12a))/0x3+parseInt(_0x4456c5(0x11d))/0x4+parseInt(_0x4456c5(0x121))/0x5+parseInt(_0x4456c5(0x11f))/0x6+parseInt(_0x4456c5(0x122))/0x7+-parseInt(_0x4456c5(0x120))/0x8;if(_0x537002===_0x116200)break;else _0x1aa37e['push'](_0x1aa37e['shift']());}catch(_0x15472d){_0x1aa37e['push'](_0x1aa37e['shift']());}}}(a23_0x3380,0x31d7d));import{jsx as a23_0x39dcfd,jsxs as a23_0x2f9856}from'react/jsx-runtime';function a23_0x10c8(_0x478da6,_0x9f728c){_0x478da6=_0x478da6-0x117;const _0x3380db=a23_0x3380();let _0x10c818=_0x3380db[_0x478da6];return _0x10c818;}import{Text,Box,useInput,useApp}from'ink';import{useEffect,useState}from'react';import{getIsSessionValid}from'./is-session-valid.js';import{authServer}from'./auth-server.js';import a23_0x1ee4ff from'ink-spinner';export function AuthServer(){const _0x338a24=a23_0x10c8,{exit:_0xc69dba}=useApp(),[_0x545e5c,_0x507a64]=useState(![]),[_0x1d7e21,_0x7aff27]=useState(!![]),[_0x5d977b,_0x1a5f9e]=useState(![]),[_0x47cbf4,_0x736d51]=useState(![]);useEffect(()=>{const _0x1429df=a23_0x10c8;getIsSessionValid()[_0x1429df(0x124)](_0x507a64)[_0x1429df(0x123)](()=>_0x7aff27(![]));},[]),useEffect(()=>{const _0x3396f0=a23_0x10c8;!_0x1d7e21&&_0x545e5c&&(console[_0x3396f0(0x128)](_0x3396f0(0x117)),_0xc69dba());},[_0x1d7e21,_0x545e5c,_0xc69dba]),useEffect(()=>{const _0x4cf341=a23_0x10c8;_0x47cbf4&&(console['log'](_0x4cf341(0x119)),_0xc69dba());},[_0x47cbf4,_0xc69dba]),useInput((_0x454d1a,_0x403c1e)=>{const _0x53a509=a23_0x10c8;_0x403c1e[_0x53a509(0x129)]&&(_0x1a5f9e(!![]),authServer({'silent':!![]})['then'](_0x37d334=>{_0x736d51(_0x37d334);})),_0x454d1a==='q'&&_0xc69dba();});if(_0x1d7e21)return null;if(_0x545e5c||_0x47cbf4)return null;return a23_0x39dcfd(Box,{'flexDirection':_0x338a24(0x12b),'marginTop':0x1,'marginBottom':0x1,'children':_0x5d977b?a23_0x2f9856(Box,{'children':[a23_0x39dcfd(Box,{'width':'1'}),a23_0x2f9856(Text,{'color':_0x338a24(0x12c),'children':[a23_0x39dcfd(a23_0x1ee4ff,{'type':_0x338a24(0x11b)}),'\x20\x20']}),a23_0x39dcfd(Text,{'children':_0x338a24(0x11a)}),a23_0x39dcfd(Text,{'color':_0x338a24(0x125),'children':_0x338a24(0x127)})]}):a23_0x2f9856(Box,{'children':[a23_0x39dcfd(Box,{'width':'1'}),a23_0x39dcfd(Text,{'children':_0x338a24(0x11c)}),a23_0x39dcfd(Text,{'color':'gray','children':_0x338a24(0x126)})]})});}
1
+ (function(_0x5355c9,_0x2f0814){const _0x5bd8e0=a25_0x33c6,_0x65063b=_0x5355c9();while(!![]){try{const _0x7b917a=parseInt(_0x5bd8e0(0x17c))/0x1*(-parseInt(_0x5bd8e0(0x184))/0x2)+-parseInt(_0x5bd8e0(0x175))/0x3*(-parseInt(_0x5bd8e0(0x176))/0x4)+parseInt(_0x5bd8e0(0x180))/0x5+parseInt(_0x5bd8e0(0x187))/0x6+parseInt(_0x5bd8e0(0x183))/0x7*(-parseInt(_0x5bd8e0(0x17f))/0x8)+-parseInt(_0x5bd8e0(0x17d))/0x9*(parseInt(_0x5bd8e0(0x181))/0xa)+-parseInt(_0x5bd8e0(0x17e))/0xb;if(_0x7b917a===_0x2f0814)break;else _0x65063b['push'](_0x65063b['shift']());}catch(_0x5dedd5){_0x65063b['push'](_0x65063b['shift']());}}}(a25_0x5c5e,0x1e276));function a25_0x33c6(_0x285f07,_0x13b455){_0x285f07=_0x285f07-0x175;const _0x5c5e16=a25_0x5c5e();let _0x33c62d=_0x5c5e16[_0x285f07];return _0x33c62d;}import{jsx as a25_0x191724,jsxs as a25_0x425373}from'react/jsx-runtime';import{Text,Box,useInput,useApp}from'ink';import{useEffect,useState}from'react';import{getIsSessionValid}from'./is-session-valid.js';import{authServer}from'./auth-server.js';function a25_0x5c5e(){const _0x44939b=['按\x20“q”\x20退出。','14SDHdYG','72oHJKdn','*\x20按回车开始登录。','column','904824weSjwJ','请前往浏览器完成登录。','log','39GTaCKd','41084aIFAnj','dots','正在登录...\x20','green','gray','then','4541NzRGeD','1179DuvMsd','650705cklaXT','19432zfVRHs','801685ltUPUj','7150IFrfGy'];a25_0x5c5e=function(){return _0x44939b;};return a25_0x5c5e();}import a25_0x52d6bb from'ink-spinner';export function AuthServer(){const _0x3ff66a=a25_0x33c6,{exit:_0x5a739b}=useApp(),[_0x10324d,_0x1f7125]=useState(![]),[_0x4d6a18,_0x3f6d1f]=useState(!![]),[_0x4f73c3,_0xd8766c]=useState(![]),[_0x1080a9,_0xfeda28]=useState(![]);useEffect(()=>{const _0xc75f4a=a25_0x33c6;getIsSessionValid()[_0xc75f4a(0x17b)](_0x1f7125)['finally'](()=>_0x3f6d1f(![]));},[]),useEffect(()=>{!_0x4d6a18&&_0x10324d&&(console['log']('√\x20当前为有效会话,无需重新登录。'),_0x5a739b());},[_0x4d6a18,_0x10324d,_0x5a739b]),useEffect(()=>{const _0x22eda7=a25_0x33c6;_0x1080a9&&(console[_0x22eda7(0x189)]('*\x20登录成功!'),_0x5a739b());},[_0x1080a9,_0x5a739b]),useInput((_0x1fb270,_0x5242c5)=>{const _0x1a5698=a25_0x33c6;_0x5242c5['return']&&(_0xd8766c(!![]),authServer({'silent':!![]})[_0x1a5698(0x17b)](_0x59f135=>{_0xfeda28(_0x59f135);})),_0x1fb270==='q'&&_0x5a739b();});if(_0x4d6a18)return null;if(_0x10324d||_0x1080a9)return null;return a25_0x191724(Box,{'flexDirection':_0x3ff66a(0x186),'marginTop':0x1,'marginBottom':0x1,'children':_0x4f73c3?a25_0x425373(Box,{'children':[a25_0x191724(Box,{'width':'1'}),a25_0x425373(Text,{'color':_0x3ff66a(0x179),'children':[a25_0x191724(a25_0x52d6bb,{'type':_0x3ff66a(0x177)}),'\x20\x20']}),a25_0x191724(Text,{'children':_0x3ff66a(0x178)}),a25_0x191724(Text,{'color':_0x3ff66a(0x17a),'children':_0x3ff66a(0x188)})]}):a25_0x425373(Box,{'children':[a25_0x191724(Box,{'width':'1'}),a25_0x191724(Text,{'children':_0x3ff66a(0x185)}),a25_0x191724(Text,{'color':_0x3ff66a(0x17a),'children':_0x3ff66a(0x182)})]})});}
@@ -1 +1 @@
1
- const a24_0x146fe1=a24_0x5964;function a24_0x2232(){const _0x1d4f2d=['680828MDDUNG','5556260XbOUCM','21nmnQKq','11465775IKSPDf','session','Auth\x20server\x20error:','/sign-in?redirect=','win32','cookie','end','silent','177948AovnYa','⚠️\x20\x20无法自动打开浏览器','catch','6vNLvPD','writeHead','close','port','error','text/html;\x20charset=utf-8','https://dev.lovrabet.com:','log','5277340llGDay','/api/auth/get-session','🔐\x20正在启动登录服务...','createServer','open\x20\x22','1779753LdHEnL','json','address','isAuth','listen','127.0.0.1','xdg-open\x20\x22','object','1075936FwlONr','then','start\x20\x22\x22\x20\x22','💡\x20如果浏览器没有自动打开,请手动复制上面的登录地址到浏览器中打开'];a24_0x2232=function(){return _0x1d4f2d;};return a24_0x2232();}function a24_0x5964(_0x4af463,_0x55550a){_0x4af463=_0x4af463-0xd3;const _0x223223=a24_0x2232();let _0x5964ff=_0x223223[_0x4af463];return _0x5964ff;}(function(_0x880775,_0x4d5400){const _0x59c61b=a24_0x5964,_0x5483b2=_0x880775();while(!![]){try{const _0x39e96c=parseInt(_0x59c61b(0xe1))/0x1+parseInt(_0x59c61b(0xec))/0x2+-parseInt(_0x59c61b(0xd5))/0x3+parseInt(_0x59c61b(0xf7))/0x4+-parseInt(_0x59c61b(0xe2))/0x5*(-parseInt(_0x59c61b(0xef))/0x6)+-parseInt(_0x59c61b(0xe3))/0x7*(parseInt(_0x59c61b(0xdd))/0x8)+-parseInt(_0x59c61b(0xe4))/0x9;if(_0x39e96c===_0x4d5400)break;else _0x5483b2['push'](_0x5483b2['shift']());}catch(_0x24f024){_0x5483b2['push'](_0x5483b2['shift']());}}}(a24_0x2232,0xe2f97));import{writeFileSync}from'node:fs';import a24_0x613ad6 from'node:https';import{getUserDomain}from'../constant/domain.js';import{exec}from'node:child_process';import{getIsSessionValid}from'./is-session-valid.js';import{cookieFile}from'./constant.js';export async function authServer(_0x129583){const _0x30791f=a24_0x5964,_0x4ef43c=_0x129583?.[_0x30791f(0xeb)]||![];if(await getIsSessionValid())return!![];const _0x27ed8f=await(await fetch('https://g.yuntooai.com/cert/lovrabet-dev.json'))['json']();return new Promise(async(_0x207631,_0x54ef88)=>{const _0x24f4e9=_0x30791f;let _0x4eee2a=0x0;const _0x14f4c6=a24_0x613ad6[_0x24f4e9(0xd3)](_0x27ed8f,async(_0xd021a7,_0x580b8f)=>{const _0x49c118=_0x24f4e9,_0x17b5b3=getUserDomain(),_0x2480c9=_0xd021a7['headers'][_0x49c118(0xe9)]||'',_0x2769c7=await fetch(_0x17b5b3+_0x49c118(0xf8),{'headers':{'cookie':_0x2480c9}})[_0x49c118(0xde)](_0x9f7818=>_0x9f7818[_0x49c118(0xd6)]()),_0x72acd0=_0x2769c7&&_0x2769c7[_0x49c118(0xe5)]&&_0x2769c7['user'];if(_0x72acd0){writeFileSync(cookieFile,_0x2480c9,'utf-8'),_0x207631(!![]);const _0x3fea7c='<!doctype\x20html>\x0a<html>\x0a<head><meta\x20charset=\x22utf-8\x22><title>登录成功</title></head>\x0a<body>\x0a\x20\x20<div>登录成功,请返回命令行继续操作。当前窗口将在\x20<span\x20id=\x22t\x22>5</span>\x20秒内关闭。</div>\x0a\x20\x20<div\x20id=\x22manualMsg\x22\x20style=\x22display:none;margin-top:10px;color:#d00;\x22>无法自动关闭窗口,请手动关闭此标签页或窗口。</div>\x0a\x20\x20<script>\x0a\x20\x20(function(){\x0a\x20\x20\x20\x20var\x20t\x20=\x205;\x0a\x20\x20\x20\x20var\x20el\x20=\x20document.getElementById(\x27t\x27);\x0a\x20\x20\x20\x20var\x20manual\x20=\x20document.getElementById(\x27manualMsg\x27);\x0a\x20\x20\x20\x20var\x20id\x20=\x20setInterval(function(){\x0a\x20\x20\x20\x20\x20\x20t--;\x0a\x20\x20\x20\x20\x20\x20if\x20(t\x20<=\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20clearInterval(id);\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20\x270\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x20window.close();\x20}\x20catch(e)\x20{}\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20如果自动关闭无效,显示文本提示让用户手动关闭\x0a\x20\x20\x20\x20\x20\x20\x20\x20setTimeout(function(){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(!window.closed)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20manual.style.display\x20=\x20\x27block\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20},\x20300);\x0a\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20String(t);\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20},\x201000);\x0a\x20\x20})();\x0a\x20\x20</script>\x0a</body>\x0a</html>';_0x580b8f[_0x49c118(0xf0)](0xc8,{'Content-Type':_0x49c118(0xf4)}),_0x580b8f[_0x49c118(0xea)](_0x3fea7c),_0x14f4c6[_0x49c118(0xf1)]();}else{const _0x401a8b=''+encodeURIComponent(_0x49c118(0xf5)+_0x4eee2a);_0x580b8f[_0x49c118(0xf0)](0x12e,{'location':_0x17b5b3+_0x49c118(0xe7)+_0x401a8b}),_0x580b8f['end']();return;}});_0x14f4c6[_0x24f4e9(0xd9)](0x0,_0x24f4e9(0xda),()=>{const _0x337ca8=_0x24f4e9,_0x457ad0=_0x14f4c6[_0x337ca8(0xd7)]();_0x4eee2a=typeof _0x457ad0===_0x337ca8(0xdc)&&_0x457ad0?_0x457ad0[_0x337ca8(0xf2)]:Number(_0x457ad0);const _0x1e6c04='https://dev.lovrabet.com:'+_0x4eee2a;!_0x4ef43c&&(console[_0x337ca8(0xf6)](_0x337ca8(0xf9)),console[_0x337ca8(0xf6)]('📍\x20登录地址:',_0x1e6c04),console[_0x337ca8(0xf6)]('🌐\x20正在尝试自动打开浏览器...'),console[_0x337ca8(0xf6)](''),console[_0x337ca8(0xf6)](_0x337ca8(0xe0)),console[_0x337ca8(0xf6)]('')),openInBrowser(_0x1e6c04)[_0x337ca8(0xde)](_0xb552=>{const _0x5bcd07=_0x337ca8;!_0x4ef43c&&(_0xb552?console[_0x5bcd07(0xf6)]('✅\x20浏览器已自动打开,请在浏览器中完成登录'):(console['log'](_0x5bcd07(0xed)),console['log']('🔗\x20请手动复制登录地址到浏览器:',_0x1e6c04)),console[_0x5bcd07(0xf6)](''));})[_0x337ca8(0xee)](()=>{const _0x5cdbea=_0x337ca8;!_0x4ef43c&&(console['log'](_0x5cdbea(0xed)),console[_0x5cdbea(0xf6)]('🔗\x20请手动复制登录地址到浏览器:',_0x1e6c04),console['log'](''));});}),_0x14f4c6['on']('error',_0x1f95ee=>{const _0x39fc13=_0x24f4e9;!_0x4ef43c&&console[_0x39fc13(0xf3)](_0x39fc13(0xe6),_0x1f95ee),_0x54ef88(_0x1f95ee);});});}function openInBrowser(_0x1021b0){return new Promise(_0x1a9969=>{const _0x44bad9=a24_0x5964,_0x5e5ada=process['platform'];let _0x35a987;if(_0x5e5ada===_0x44bad9(0xe8))_0x35a987=_0x44bad9(0xdf)+_0x1021b0+'\x22';else _0x5e5ada==='darwin'?_0x35a987=_0x44bad9(0xd4)+_0x1021b0+'\x22':_0x35a987=_0x44bad9(0xdb)+_0x1021b0+'\x22';exec(_0x35a987,_0x17e6ad=>{_0x17e6ad?_0x1a9969(![]):_0x1a9969(!![]);});});}if(import.meta.main){const isAuth=await authServer();console['log'](a24_0x146fe1(0xd8),isAuth);}
1
+ (function(_0x1ba51f,_0x4d6d4d){const _0x34ab19=a26_0x1e65,_0x2a3859=_0x1ba51f();while(!![]){try{const _0x36aa6f=-parseInt(_0x34ab19(0xff))/0x1+parseInt(_0x34ab19(0xea))/0x2*(parseInt(_0x34ab19(0xe7))/0x3)+-parseInt(_0x34ab19(0xec))/0x4+parseInt(_0x34ab19(0xed))/0x5+-parseInt(_0x34ab19(0xdc))/0x6*(parseInt(_0x34ab19(0xf3))/0x7)+parseInt(_0x34ab19(0xfa))/0x8+-parseInt(_0x34ab19(0xdd))/0x9;if(_0x36aa6f===_0x4d6d4d)break;else _0x2a3859['push'](_0x2a3859['shift']());}catch(_0x32ae97){_0x2a3859['push'](_0x2a3859['shift']());}}}(a26_0x47ae,0x46506));import{writeFileSync}from'node:fs';function a26_0x1e65(_0x3d383a,_0x33889c){_0x3d383a=_0x3d383a-0xdc;const _0x47ae2b=a26_0x47ae();let _0x1e6540=_0x47ae2b[_0x3d383a];return _0x1e6540;}import a26_0x3a94a3 from'node:https';import{getUserDomain}from'../constant/domain.js';import{exec}from'node:child_process';import{getIsSessionValid}from'./is-session-valid.js';function a26_0x47ae(){const _0x27b70c=['125740pacbxK','12NCmAXZ','1860210VVRpvs','/sign-in?redirect=','🔐\x20正在启动登录服务...','127.0.0.1','close','end','darwin','🌐\x20正在尝试自动打开浏览器...','✅\x20浏览器已自动打开,请在浏览器中完成登录','address','1132410VYmpBQ','📍\x20登录地址:','🔗\x20请手动复制登录地址到浏览器:','2YPksDR','https://dev.lovrabet.com:','117292NWILPc','1333315ZUtNjY','cookie','then','listen','object','createServer','1084762oFYDBC','catch','log','start\x20\x22\x22\x20\x22','headers','platform','/api/auth/get-session','2524464eSHFoA','error','writeHead','https://g.yuntooai.com/cert/lovrabet-dev.json','port'];a26_0x47ae=function(){return _0x27b70c;};return a26_0x47ae();}import{cookieFile}from'./constant.js';export async function authServer(_0x255cc2){const _0x542cd0=a26_0x1e65,_0xad5ed=_0x255cc2?.['silent']||![];if(await getIsSessionValid())return!![];const _0x33d048=await(await fetch(_0x542cd0(0xfd)))['json']();return new Promise(async(_0x1bc67b,_0x5c20f0)=>{const _0x335910=_0x542cd0;let _0x245938=0x0;const _0x292e09=a26_0x3a94a3[_0x335910(0xf2)](_0x33d048,async(_0x1ff1d0,_0x4d28d5)=>{const _0x1b34ed=_0x335910,_0x4beb33=getUserDomain(),_0x12e968=_0x1ff1d0[_0x1b34ed(0xf7)][_0x1b34ed(0xee)]||'',_0x404551=await fetch(_0x4beb33+_0x1b34ed(0xf9),{'headers':{'cookie':_0x12e968}})[_0x1b34ed(0xef)](_0x9d3757=>_0x9d3757['json']()),_0x14cb71=_0x404551&&_0x404551['session']&&_0x404551['user'];if(_0x14cb71){writeFileSync(cookieFile,_0x12e968,'utf-8'),_0x1bc67b(!![]);const _0x486630='<!doctype\x20html>\x0a<html>\x0a<head><meta\x20charset=\x22utf-8\x22><title>登录成功</title></head>\x0a<body>\x0a\x20\x20<div>登录成功,请返回命令行继续操作。当前窗口将在\x20<span\x20id=\x22t\x22>5</span>\x20秒内关闭。</div>\x0a\x20\x20<div\x20id=\x22manualMsg\x22\x20style=\x22display:none;margin-top:10px;color:#d00;\x22>无法自动关闭窗口,请手动关闭此标签页或窗口。</div>\x0a\x20\x20<script>\x0a\x20\x20(function(){\x0a\x20\x20\x20\x20var\x20t\x20=\x205;\x0a\x20\x20\x20\x20var\x20el\x20=\x20document.getElementById(\x27t\x27);\x0a\x20\x20\x20\x20var\x20manual\x20=\x20document.getElementById(\x27manualMsg\x27);\x0a\x20\x20\x20\x20var\x20id\x20=\x20setInterval(function(){\x0a\x20\x20\x20\x20\x20\x20t--;\x0a\x20\x20\x20\x20\x20\x20if\x20(t\x20<=\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20clearInterval(id);\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20\x270\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x20window.close();\x20}\x20catch(e)\x20{}\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20如果自动关闭无效,显示文本提示让用户手动关闭\x0a\x20\x20\x20\x20\x20\x20\x20\x20setTimeout(function(){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(!window.closed)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20manual.style.display\x20=\x20\x27block\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20},\x20300);\x0a\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20String(t);\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20},\x201000);\x0a\x20\x20})();\x0a\x20\x20</script>\x0a</body>\x0a</html>';_0x4d28d5[_0x1b34ed(0xfc)](0xc8,{'Content-Type':'text/html;\x20charset=utf-8'}),_0x4d28d5[_0x1b34ed(0xe2)](_0x486630),_0x292e09[_0x1b34ed(0xe1)]();}else{const _0x143d98=''+encodeURIComponent(_0x1b34ed(0xeb)+_0x245938);_0x4d28d5[_0x1b34ed(0xfc)](0x12e,{'location':_0x4beb33+_0x1b34ed(0xde)+_0x143d98}),_0x4d28d5[_0x1b34ed(0xe2)]();return;}});_0x292e09[_0x335910(0xf0)](0x0,_0x335910(0xe0),()=>{const _0xdcd71d=_0x335910,_0x5b420c=_0x292e09[_0xdcd71d(0xe6)]();_0x245938=typeof _0x5b420c===_0xdcd71d(0xf1)&&_0x5b420c?_0x5b420c[_0xdcd71d(0xfe)]:Number(_0x5b420c);const _0x258e32=_0xdcd71d(0xeb)+_0x245938;!_0xad5ed&&(console['log'](_0xdcd71d(0xdf)),console['log'](_0xdcd71d(0xe8),_0x258e32),console[_0xdcd71d(0xf5)](_0xdcd71d(0xe4)),console['log'](''),console[_0xdcd71d(0xf5)]('💡\x20如果浏览器没有自动打开,请手动复制上面的登录地址到浏览器中打开'),console['log']('')),openInBrowser(_0x258e32)[_0xdcd71d(0xef)](_0x1be301=>{const _0x2e1949=_0xdcd71d;!_0xad5ed&&(_0x1be301?console['log'](_0x2e1949(0xe5)):(console[_0x2e1949(0xf5)]('⚠️\x20\x20无法自动打开浏览器'),console['log'](_0x2e1949(0xe9),_0x258e32)),console['log'](''));})[_0xdcd71d(0xf4)](()=>{const _0x242d40=_0xdcd71d;!_0xad5ed&&(console[_0x242d40(0xf5)]('⚠️\x20\x20无法自动打开浏览器'),console[_0x242d40(0xf5)](_0x242d40(0xe9),_0x258e32),console['log'](''));});}),_0x292e09['on'](_0x335910(0xfb),_0x41999b=>{!_0xad5ed&&console['error']('Auth\x20server\x20error:',_0x41999b),_0x5c20f0(_0x41999b);});});}function openInBrowser(_0x168508){return new Promise(_0x53f289=>{const _0x269a12=a26_0x1e65,_0x3b4bbd=process[_0x269a12(0xf8)];let _0x32c53e;if(_0x3b4bbd==='win32')_0x32c53e=_0x269a12(0xf6)+_0x168508+'\x22';else _0x3b4bbd===_0x269a12(0xe3)?_0x32c53e='open\x20\x22'+_0x168508+'\x22':_0x32c53e='xdg-open\x20\x22'+_0x168508+'\x22';exec(_0x32c53e,_0x5812ef=>{_0x5812ef?_0x53f289(![]):_0x53f289(!![]);});});}if(import.meta.main){const isAuth=await authServer();console['log']('isAuth',isAuth);}
@@ -1 +1 @@
1
- const a25_0x1e8eff=a25_0x3f74;(function(_0x18c59f,_0x7492c2){const _0x3ad5c6=a25_0x3f74,_0x16a177=_0x18c59f();while(!![]){try{const _0x284504=parseInt(_0x3ad5c6(0xb1))/0x1+parseInt(_0x3ad5c6(0xb5))/0x2*(-parseInt(_0x3ad5c6(0xb0))/0x3)+parseInt(_0x3ad5c6(0xb6))/0x4*(parseInt(_0x3ad5c6(0xae))/0x5)+parseInt(_0x3ad5c6(0xb3))/0x6+-parseInt(_0x3ad5c6(0xb2))/0x7*(parseInt(_0x3ad5c6(0xaf))/0x8)+-parseInt(_0x3ad5c6(0xb7))/0x9+parseInt(_0x3ad5c6(0xad))/0xa*(-parseInt(_0x3ad5c6(0xb4))/0xb);if(_0x284504===_0x7492c2)break;else _0x16a177['push'](_0x16a177['shift']());}catch(_0x3fcac0){_0x16a177['push'](_0x16a177['shift']());}}}(a25_0x4015,0x5fb94));import{mkdirSync}from'node:fs';function a25_0x3f74(_0x341928,_0xa68fa8){_0x341928=_0x341928-0xad;const _0x40158c=a25_0x4015();let _0x3f7417=_0x40158c[_0x341928];return _0x3f7417;}import{homedir}from'node:os';function a25_0x4015(){const _0x3d37f6=['2390976mNOhTz','/.lovrabet','10OYdKxD','3828115cFggzK','9448cUChhQ','3UcIXwt','372746XKieGE','42vDUcpq','552456lftTBf','3272764HJCyMh','536174XnoJGi','4goTxim'];a25_0x4015=function(){return _0x3d37f6;};return a25_0x4015();}export const configDir=homedir()+a25_0x1e8eff(0xb8);export const cookieFile=configDir+'/cookie';mkdirSync(configDir,{'recursive':!![]});
1
+ const a27_0x2ff629=a27_0x3f3b;(function(_0x4ff2ea,_0x2e63ae){const _0x4aad53=a27_0x3f3b,_0x591327=_0x4ff2ea();while(!![]){try{const _0x5ae728=parseInt(_0x4aad53(0x18d))/0x1+parseInt(_0x4aad53(0x18b))/0x2+-parseInt(_0x4aad53(0x18a))/0x3+-parseInt(_0x4aad53(0x189))/0x4+-parseInt(_0x4aad53(0x191))/0x5+-parseInt(_0x4aad53(0x18f))/0x6+-parseInt(_0x4aad53(0x18e))/0x7*(-parseInt(_0x4aad53(0x190))/0x8);if(_0x5ae728===_0x2e63ae)break;else _0x591327['push'](_0x591327['shift']());}catch(_0x3f0e94){_0x591327['push'](_0x591327['shift']());}}}(a27_0x11a1,0xd8afa));import{mkdirSync}from'node:fs';import{homedir}from'node:os';export const configDir=homedir()+a27_0x2ff629(0x18c);export const cookieFile=configDir+a27_0x2ff629(0x188);mkdirSync(configDir,{'recursive':!![]});function a27_0x3f3b(_0x5be8f2,_0x371968){_0x5be8f2=_0x5be8f2-0x188;const _0x11a101=a27_0x11a1();let _0x3f3b54=_0x11a101[_0x5be8f2];return _0x3f3b54;}function a27_0x11a1(){const _0x16cb5b=['6513385oFzNhA','/cookie','734668PyWnva','4592349AQvBTC','581320caYSxi','/.lovrabet','1260838KIryfl','6482TFxFDd','9071694INZhDC','33392iALsti'];a27_0x11a1=function(){return _0x16cb5b;};return a27_0x11a1();}
@@ -1 +1 @@
1
- function a26_0x3631(){var _0x5dadcf=['735535agWvaL','2015805cXecrS','603060SVcvcd','36WUisrQ','843IwkNRr','332264fiMZzx','2443SIcQiL','8cQjQfD','124dYNbJP','utf-8','67495xwHKRO','3696gFIOME'];a26_0x3631=function(){return _0x5dadcf;};return a26_0x3631();}function a26_0x4fd4(_0x58d82e,_0x7cca95){_0x58d82e=_0x58d82e-0x86;var _0x363130=a26_0x3631();var _0x4fd44d=_0x363130[_0x58d82e];return _0x4fd44d;}(function(_0x1c3c44,_0x27fa77){var _0xd0b56a=a26_0x4fd4,_0x2f994c=_0x1c3c44();while(!![]){try{var _0x5ddc60=parseInt(_0xd0b56a(0x87))/0x1+parseInt(_0xd0b56a(0x91))/0x2*(-parseInt(_0xd0b56a(0x8d))/0x3)+-parseInt(_0xd0b56a(0x90))/0x4*(-parseInt(_0xd0b56a(0x89))/0x5)+parseInt(_0xd0b56a(0x88))/0x6*(parseInt(_0xd0b56a(0x8f))/0x7)+parseInt(_0xd0b56a(0x8e))/0x8*(-parseInt(_0xd0b56a(0x8c))/0x9)+-parseInt(_0xd0b56a(0x8b))/0xa+-parseInt(_0xd0b56a(0x8a))/0xb;if(_0x5ddc60===_0x27fa77)break;else _0x2f994c['push'](_0x2f994c['shift']());}catch(_0x9ee1ab){_0x2f994c['push'](_0x2f994c['shift']());}}}(a26_0x3631,0x2484a));import{readFileSync}from'node:fs';import{cookieFile}from'./constant.js';export function getCookie(){var _0x5a7f1e=a26_0x4fd4;try{return readFileSync(cookieFile,_0x5a7f1e(0x86));}catch{}return'';}
1
+ function a28_0x372b(_0x501512,_0x19bcdd){_0x501512=_0x501512-0x7e;var _0x378ba4=a28_0x378b();var _0x372b36=_0x378ba4[_0x501512];return _0x372b36;}function a28_0x378b(){var _0x44e778=['727450nCVABb','699419AhHPEp','9092214ztRoKk','478901USxxqm','8364bfgYjn','596YcxAEn','1848325jvnFkX','4393744jinONw','6kDVhbV'];a28_0x378b=function(){return _0x44e778;};return a28_0x378b();}(function(_0x3a10ce,_0xca9127){var _0x4f0e87=a28_0x372b,_0x47488d=_0x3a10ce();while(!![]){try{var _0x2a20f3=-parseInt(_0x4f0e87(0x7f))/0x1+parseInt(_0x4f0e87(0x85))/0x2+parseInt(_0x4f0e87(0x80))/0x3*(parseInt(_0x4f0e87(0x81))/0x4)+-parseInt(_0x4f0e87(0x82))/0x5+-parseInt(_0x4f0e87(0x84))/0x6*(parseInt(_0x4f0e87(0x86))/0x7)+-parseInt(_0x4f0e87(0x83))/0x8+parseInt(_0x4f0e87(0x7e))/0x9;if(_0x2a20f3===_0xca9127)break;else _0x47488d['push'](_0x47488d['shift']());}catch(_0x52781d){_0x47488d['push'](_0x47488d['shift']());}}}(a28_0x378b,0x47362));import{readFileSync}from'node:fs';import{cookieFile}from'./constant.js';export function getCookie(){try{return readFileSync(cookieFile,'utf-8');}catch{}return'';}
@@ -1 +1 @@
1
- function a27_0x1594(){const _0x301aec=['40974bhEcFo','then','2906570rjcAHS','4oFiUjT','6nuykax','session','user','403722DxHkBx','16wqEGrj','213631RlAPuK','252EgfMus','/api/auth/get-session','6642580svMXuh','4169837vCnbho','8vvabnr','json','1791864gGXsOC'];a27_0x1594=function(){return _0x301aec;};return a27_0x1594();}(function(_0x2ece99,_0xd12b2f){const _0x3a480b=a27_0x4bd7,_0x5a5d6a=_0x2ece99();while(!![]){try{const _0x23cabb=parseInt(_0x3a480b(0x8c))/0x1*(-parseInt(_0x3a480b(0x8f))/0x2)+-parseInt(_0x3a480b(0x8e))/0x3+-parseInt(_0x3a480b(0x92))/0x4*(parseInt(_0x3a480b(0x91))/0x5)+-parseInt(_0x3a480b(0x93))/0x6*(-parseInt(_0x3a480b(0x8b))/0x7)+parseInt(_0x3a480b(0x97))/0x8*(parseInt(_0x3a480b(0x96))/0x9)+parseInt(_0x3a480b(0x8a))/0xa+parseInt(_0x3a480b(0x98))/0xb*(parseInt(_0x3a480b(0x99))/0xc);if(_0x23cabb===_0xd12b2f)break;else _0x5a5d6a['push'](_0x5a5d6a['shift']());}catch(_0x287c4c){_0x5a5d6a['push'](_0x5a5d6a['shift']());}}}(a27_0x1594,0x65520));import{existsSync,readFileSync}from'node:fs';import{getUserDomain}from'../constant/domain.js';import{cookieFile}from'./constant.js';function a27_0x4bd7(_0x2b3652,_0x3accb6){_0x2b3652=_0x2b3652-0x89;const _0x159496=a27_0x1594();let _0x4bd768=_0x159496[_0x2b3652];return _0x4bd768;}export async function getIsSessionValid(){const _0x55ce52=a27_0x4bd7;try{if(!existsSync(cookieFile))return![];const _0x4c1e1b=readFileSync(cookieFile,'utf-8'),_0x4c2696=await fetch(getUserDomain()+_0x55ce52(0x89),{'headers':{'cookie':_0x4c1e1b}})[_0x55ce52(0x90)](_0x30dc9f=>_0x30dc9f[_0x55ce52(0x8d)]());return _0x4c2696&&_0x4c2696[_0x55ce52(0x94)]&&_0x4c2696[_0x55ce52(0x95)];}catch{}return![];}
1
+ (function(_0x2da2ef,_0x40f415){const _0x2f45f9=a29_0x3ec8,_0x22c920=_0x2da2ef();while(!![]){try{const _0x4c3446=-parseInt(_0x2f45f9(0x176))/0x1*(-parseInt(_0x2f45f9(0x168))/0x2)+-parseInt(_0x2f45f9(0x178))/0x3*(parseInt(_0x2f45f9(0x174))/0x4)+parseInt(_0x2f45f9(0x16f))/0x5+parseInt(_0x2f45f9(0x170))/0x6*(-parseInt(_0x2f45f9(0x169))/0x7)+parseInt(_0x2f45f9(0x16e))/0x8+parseInt(_0x2f45f9(0x171))/0x9*(parseInt(_0x2f45f9(0x177))/0xa)+parseInt(_0x2f45f9(0x172))/0xb*(-parseInt(_0x2f45f9(0x16a))/0xc);if(_0x4c3446===_0x40f415)break;else _0x22c920['push'](_0x22c920['shift']());}catch(_0x13aaf9){_0x22c920['push'](_0x22c920['shift']());}}}(a29_0x3cf4,0xb300a));import{existsSync,readFileSync}from'node:fs';import{getUserDomain}from'../constant/domain.js';import{cookieFile}from'./constant.js';export async function getIsSessionValid(){const _0x130677=a29_0x3ec8;try{if(!existsSync(cookieFile))return![];const _0x121db0=readFileSync(cookieFile,_0x130677(0x16b)),_0x29357b=await fetch(getUserDomain()+_0x130677(0x16c),{'headers':{'cookie':_0x121db0}})['then'](_0x3164cd=>_0x3164cd[_0x130677(0x173)]());return _0x29357b&&_0x29357b[_0x130677(0x175)]&&_0x29357b[_0x130677(0x16d)];}catch{}return![];}function a29_0x3ec8(_0x3f391c,_0x8a4418){_0x3f391c=_0x3f391c-0x168;const _0x3cf4ea=a29_0x3cf4();let _0x3ec876=_0x3cf4ea[_0x3f391c];return _0x3ec876;}function a29_0x3cf4(){const _0x3c0e67=['user','4677144ppkomt','1446065aXWsYH','42lsIONA','6823530eumxKX','46574Paqgiu','json','1358684qIBTCu','session','1DLQvZq','10VesiWx','12xuQbln','1723932UXzUHl','101500DPKTtq','852tjOZHc','utf-8','/api/auth/get-session'];a29_0x3cf4=function(){return _0x3c0e67;};return a29_0x3cf4();}
@@ -1 +1 @@
1
- function a28_0x3c11(_0x4c0649,_0x5efa0a){_0x4c0649=_0x4c0649-0x117;var _0x47eb33=a28_0x47eb();var _0x3c1138=_0x47eb33[_0x4c0649];return _0x3c1138;}(function(_0x8364c,_0x450481){var _0x5d82db=a28_0x3c11,_0x3eb70b=_0x8364c();while(!![]){try{var _0x3fa614=parseInt(_0x5d82db(0x11b))/0x1+parseInt(_0x5d82db(0x11c))/0x2*(parseInt(_0x5d82db(0x118))/0x3)+-parseInt(_0x5d82db(0x11a))/0x4+parseInt(_0x5d82db(0x122))/0x5+-parseInt(_0x5d82db(0x123))/0x6+-parseInt(_0x5d82db(0x121))/0x7*(-parseInt(_0x5d82db(0x11e))/0x8)+parseInt(_0x5d82db(0x11d))/0x9*(-parseInt(_0x5d82db(0x120))/0xa);if(_0x3fa614===_0x450481)break;else _0x3eb70b['push'](_0x3eb70b['shift']());}catch(_0x9cfd1a){_0x3eb70b['push'](_0x3eb70b['shift']());}}}(a28_0x47eb,0x5e16e));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'./constant.js';function a28_0x47eb(){var _0x305106=['207506KQdUbJ','5750289WHlhvt','4656mhXUtN','log','10XXRDbo','609BgOMhj','2306535bGrPFi','955008PHMFNb','!\x20当前未登录','21owgvpH','✓\x20已退出登录','749076KWJVzW','132536UUflaK'];a28_0x47eb=function(){return _0x305106;};return a28_0x47eb();}export function logout(){var _0x1d3bea=a28_0x3c11;existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x1d3bea(0x11f)](_0x1d3bea(0x119))):console[_0x1d3bea(0x11f)](_0x1d3bea(0x117));}
1
+ (function(_0x32bb71,_0x3646c1){var _0x290e2d=a30_0x2566,_0x394c35=_0x32bb71();while(!![]){try{var _0x1c9881=parseInt(_0x290e2d(0x70))/0x1+parseInt(_0x290e2d(0x69))/0x2*(parseInt(_0x290e2d(0x68))/0x3)+-parseInt(_0x290e2d(0x6e))/0x4*(parseInt(_0x290e2d(0x6b))/0x5)+parseInt(_0x290e2d(0x6d))/0x6*(-parseInt(_0x290e2d(0x75))/0x7)+parseInt(_0x290e2d(0x6c))/0x8*(-parseInt(_0x290e2d(0x6f))/0x9)+parseInt(_0x290e2d(0x77))/0xa*(parseInt(_0x290e2d(0x71))/0xb)+-parseInt(_0x290e2d(0x74))/0xc*(-parseInt(_0x290e2d(0x72))/0xd);if(_0x1c9881===_0x3646c1)break;else _0x394c35['push'](_0x394c35['shift']());}catch(_0x181dfe){_0x394c35['push'](_0x394c35['shift']());}}}(a30_0x196f,0x77cb5));import{unlinkSync,existsSync}from'node:fs';function a30_0x2566(_0x3f918e,_0x42cbc0){_0x3f918e=_0x3f918e-0x68;var _0x196fc2=a30_0x196f();var _0x25665a=_0x196fc2[_0x3f918e];return _0x25665a;}import{cookieFile}from'./constant.js';export function logout(){var _0x26af11=a30_0x2566;existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x26af11(0x73)](_0x26af11(0x76))):console['log'](_0x26af11(0x6a));}function a30_0x196f(){var _0x508136=['22803VsxTNz','73099sUMBvn','log','2544zyhMrq','14UhqFxR','✓\x20已退出登录','1670XPqiUi','1095RJfIxC','692AmKlxG','!\x20当前未登录','341995wahrXj','1778232drlgVd','2543094qzBaiI','20JyHPfL','9YnXlgG','238092JCyTNW'];a30_0x196f=function(){return _0x508136;};return a30_0x196f();}