@lovrabet/rabetbase-cli 2.5.10-beta.2 → 2.5.10-beta.4

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 (384) hide show
  1. package/README.md +10 -0
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/api-group.js +1 -1
  4. package/lib/api/fetch-model-list.js +1 -1
  5. package/lib/api/generate-api-file.js +1 -1
  6. package/lib/api/generate-sdk-config-file.js +1 -1
  7. package/lib/api/legacy-api-file.js +1 -1
  8. package/lib/api/model-registry-file.js +1 -1
  9. package/lib/api/model-registry-scaffold.js +1 -1
  10. package/lib/api/model-source.js +1 -1
  11. package/lib/auth/auth-server-ui.js +1 -1
  12. package/lib/auth/auth-server.js +1 -1
  13. package/lib/auth/constant.js +1 -1
  14. package/lib/auth/get-cookie.js +1 -1
  15. package/lib/auth/get-session-user.d.ts +2 -2
  16. package/lib/auth/get-session-user.js +1 -1
  17. package/lib/auth/is-session-valid.js +1 -1
  18. package/lib/auth/login-success-html.js +1 -1
  19. package/lib/auth/logout.js +1 -1
  20. package/lib/cli-flags.js +1 -1
  21. package/lib/cli.js +1 -1
  22. package/lib/commands/api/generate.js +1 -1
  23. package/lib/commands/api/index.js +1 -1
  24. package/lib/commands/api/list.js +1 -1
  25. package/lib/commands/api/pull.js +1 -1
  26. package/lib/commands/api/shared.js +1 -1
  27. package/lib/commands/app/detail.js +1 -1
  28. package/lib/commands/app/index.js +1 -1
  29. package/lib/commands/app/list.js +1 -1
  30. package/lib/commands/app/members-list.js +1 -1
  31. package/lib/commands/app/remote-directory.js +1 -1
  32. package/lib/commands/app/shared.js +1 -1
  33. package/lib/commands/app-config/delete.js +1 -1
  34. package/lib/commands/app-config/get.js +1 -1
  35. package/lib/commands/app-config/index.js +1 -1
  36. package/lib/commands/app-config/list.js +1 -1
  37. package/lib/commands/app-config/set.js +1 -1
  38. package/lib/commands/app-config/shared.js +1 -1
  39. package/lib/commands/auth/index.js +1 -1
  40. package/lib/commands/bff/create.js +1 -1
  41. package/lib/commands/bff/delete.js +1 -1
  42. package/lib/commands/bff/detail.js +1 -1
  43. package/lib/commands/bff/index.js +1 -1
  44. package/lib/commands/bff/list.js +1 -1
  45. package/lib/commands/bff/logs.js +1 -1
  46. package/lib/commands/bff/pull.js +1 -1
  47. package/lib/commands/bff/push.js +1 -1
  48. package/lib/commands/bff/status.js +1 -1
  49. package/lib/commands/cli-skill/index.js +1 -1
  50. package/lib/commands/cli-update.js +1 -1
  51. package/lib/commands/codegen/index.js +1 -1
  52. package/lib/commands/codegen/sdk.js +1 -1
  53. package/lib/commands/codegen/sql.js +1 -1
  54. package/lib/commands/common/app-registry.js +1 -1
  55. package/lib/commands/common/app-selector.js +1 -1
  56. package/lib/commands/common/async-task.js +1 -1
  57. package/lib/commands/common/dry-run.js +1 -1
  58. package/lib/commands/common/flags.js +1 -1
  59. package/lib/commands/common/local-file.js +1 -1
  60. package/lib/commands/common/validate.js +1 -1
  61. package/lib/commands/config/delete.js +1 -1
  62. package/lib/commands/config/get.js +1 -1
  63. package/lib/commands/config/index.js +1 -1
  64. package/lib/commands/config/init.js +1 -1
  65. package/lib/commands/config/list.js +1 -1
  66. package/lib/commands/config/set.js +1 -1
  67. package/lib/commands/config/shared.js +1 -1
  68. package/lib/commands/dataset/batch-design.js +1 -1
  69. package/lib/commands/dataset/business-group-update.js +1 -1
  70. package/lib/commands/dataset/business-groups.js +1 -1
  71. package/lib/commands/dataset/capability.js +1 -1
  72. package/lib/commands/dataset/cross-relation-create.js +1 -1
  73. package/lib/commands/dataset/cross-relation-delete.js +1 -1
  74. package/lib/commands/dataset/cross-relation-list.js +1 -1
  75. package/lib/commands/dataset/cross-relation-shared.js +1 -1
  76. package/lib/commands/dataset/cross-relation-update.js +1 -1
  77. package/lib/commands/dataset/delete.js +1 -1
  78. package/lib/commands/dataset/design-context.js +1 -1
  79. package/lib/commands/dataset/design-start.js +1 -1
  80. package/lib/commands/dataset/design-status.js +1 -1
  81. package/lib/commands/dataset/design-sync-retry.js +1 -1
  82. package/lib/commands/dataset/design-sync-status.js +1 -1
  83. package/lib/commands/dataset/design-validate.js +1 -1
  84. package/lib/commands/dataset/detail.js +1 -1
  85. package/lib/commands/dataset/extend-update.js +1 -1
  86. package/lib/commands/dataset/field-restore.js +1 -1
  87. package/lib/commands/dataset/field-update.js +1 -1
  88. package/lib/commands/dataset/generate.js +1 -1
  89. package/lib/commands/dataset/index.js +1 -1
  90. package/lib/commands/dataset/list.js +1 -1
  91. package/lib/commands/dataset/operations.js +1 -1
  92. package/lib/commands/dataset/relation-audit.js +1 -1
  93. package/lib/commands/dataset/relation-create.js +1 -1
  94. package/lib/commands/dataset/relation-delete.js +1 -1
  95. package/lib/commands/dataset/relation-shared.js +1 -1
  96. package/lib/commands/dataset/relation-update.js +1 -1
  97. package/lib/commands/dataset/relations.js +1 -1
  98. package/lib/commands/dataset/rename.js +1 -1
  99. package/lib/commands/dataset/restore.js +1 -1
  100. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  101. package/lib/commands/db/analysis-batching.js +1 -1
  102. package/lib/commands/db/analyze-batch-plan.js +1 -1
  103. package/lib/commands/db/analyze-cancel.js +1 -1
  104. package/lib/commands/db/analyze-start.js +1 -1
  105. package/lib/commands/db/analyze-status.js +1 -1
  106. package/lib/commands/db/create.js +1 -1
  107. package/lib/commands/db/cross-db-analysis-shared.js +1 -1
  108. package/lib/commands/db/cross-db-analyze-latest.js +1 -1
  109. package/lib/commands/db/cross-db-analyze-start.js +1 -1
  110. package/lib/commands/db/cross-db-analyze-status.js +1 -1
  111. package/lib/commands/db/delete.js +1 -1
  112. package/lib/commands/db/detail.js +1 -1
  113. package/lib/commands/db/diff-refresh-start.js +1 -1
  114. package/lib/commands/db/diff-refresh-status.js +1 -1
  115. package/lib/commands/db/diff.js +1 -1
  116. package/lib/commands/db/index.js +1 -1
  117. package/lib/commands/db/list.js +1 -1
  118. package/lib/commands/db/shared.js +1 -1
  119. package/lib/commands/db/table-diff-shared.js +1 -1
  120. package/lib/commands/db/tables.js +1 -1
  121. package/lib/commands/db/test.js +1 -1
  122. package/lib/commands/db/update.js +1 -1
  123. package/lib/commands/deployment/index.js +1 -1
  124. package/lib/commands/deployment/sync-all.js +1 -1
  125. package/lib/commands/deployment/sync-jobs.js +1 -1
  126. package/lib/commands/deployment/sync-status.js +1 -1
  127. package/lib/commands/doctor.js +1 -1
  128. package/lib/commands/file/index.js +1 -1
  129. package/lib/commands/flow/create.js +1 -1
  130. package/lib/commands/flow/detail.js +1 -1
  131. package/lib/commands/flow/index.js +1 -1
  132. package/lib/commands/flow/list.js +1 -1
  133. package/lib/commands/flow/page-list.js +1 -1
  134. package/lib/commands/flow/publish.js +1 -1
  135. package/lib/commands/flow/runtime-resources-shared.js +1 -1
  136. package/lib/commands/flow/runtime-role-list.js +1 -1
  137. package/lib/commands/flow/runtime-role-user-list.js +1 -1
  138. package/lib/commands/flow/runtime-user-search.js +1 -1
  139. package/lib/commands/flow/shared.js +1 -1
  140. package/lib/commands/flow/update.js +1 -1
  141. package/lib/commands/flow/validate.js +1 -1
  142. package/lib/commands/instant-api-policy/current.js +1 -1
  143. package/lib/commands/instant-api-policy/index.js +1 -1
  144. package/lib/commands/instant-api-policy/init.js +1 -1
  145. package/lib/commands/instant-api-policy/publish.js +1 -1
  146. package/lib/commands/instant-api-policy/pull.js +1 -1
  147. package/lib/commands/instant-api-policy/revision.js +1 -1
  148. package/lib/commands/instant-api-policy/revisions.js +1 -1
  149. package/lib/commands/instant-api-policy/rollback.js +1 -1
  150. package/lib/commands/instant-api-policy/shared.js +1 -1
  151. package/lib/commands/instant-api-policy/validate.js +1 -1
  152. package/lib/commands/issue/context.d.ts +3 -0
  153. package/lib/commands/issue/context.js +1 -0
  154. package/lib/commands/issue/index.js +1 -1
  155. package/lib/commands/issue/nudge.js +1 -1
  156. package/lib/commands/issue/report.js +1 -1
  157. package/lib/commands/kb/create.js +1 -1
  158. package/lib/commands/kb/delete.js +1 -1
  159. package/lib/commands/kb/detail.js +1 -1
  160. package/lib/commands/kb/index.js +1 -1
  161. package/lib/commands/kb/list.js +1 -1
  162. package/lib/commands/kb/search.js +1 -1
  163. package/lib/commands/kb/shared.js +1 -1
  164. package/lib/commands/kb/update.js +1 -1
  165. package/lib/commands/logs/index.js +1 -1
  166. package/lib/commands/menu/asset-update.js +1 -1
  167. package/lib/commands/menu/delete.js +1 -1
  168. package/lib/commands/menu/external-link-create.js +1 -1
  169. package/lib/commands/menu/external-link-update.js +1 -1
  170. package/lib/commands/menu/group-create.js +1 -1
  171. package/lib/commands/menu/group-update.js +1 -1
  172. package/lib/commands/menu/index.js +1 -1
  173. package/lib/commands/menu/list.js +1 -1
  174. package/lib/commands/menu/move.js +1 -1
  175. package/lib/commands/menu/regroup-start.js +1 -1
  176. package/lib/commands/menu/rename.js +1 -1
  177. package/lib/commands/menu/shared/compare-table.js +1 -1
  178. package/lib/commands/menu/shared/delete-plan.js +1 -1
  179. package/lib/commands/menu/shared/facts.js +1 -1
  180. package/lib/commands/menu/shared/index.js +1 -1
  181. package/lib/commands/menu/shared/inquirer.js +1 -1
  182. package/lib/commands/menu/shared/local-pages.js +1 -1
  183. package/lib/commands/menu/shared/logic.js +1 -1
  184. package/lib/commands/menu/shared/mutations.js +1 -1
  185. package/lib/commands/menu/shared/path.js +1 -1
  186. package/lib/commands/menu/shared/service.js +1 -1
  187. package/lib/commands/menu/shared/subapp-assets.js +1 -1
  188. package/lib/commands/menu/shared/sync-core.js +1 -1
  189. package/lib/commands/menu/shared/update-core.js +1 -1
  190. package/lib/commands/menu/shared/valid-url.js +1 -1
  191. package/lib/commands/menu/subapp-assets-status.js +1 -1
  192. package/lib/commands/menu/subapp-assets-update.js +1 -1
  193. package/lib/commands/menu/sync.js +1 -1
  194. package/lib/commands/menu/visibility-update.js +1 -1
  195. package/lib/commands/notification/config-create.js +1 -1
  196. package/lib/commands/notification/config-delete.js +1 -1
  197. package/lib/commands/notification/config-list.js +1 -1
  198. package/lib/commands/notification/config-update.js +1 -1
  199. package/lib/commands/notification/index.js +1 -1
  200. package/lib/commands/notification/shared.js +1 -1
  201. package/lib/commands/ocr/index.js +1 -1
  202. package/lib/commands/page/create.js +1 -1
  203. package/lib/commands/page/custom/detail.js +1 -1
  204. package/lib/commands/page/custom/list.js +1 -1
  205. package/lib/commands/page/custom/publish.js +1 -1
  206. package/lib/commands/page/custom/shared.js +1 -1
  207. package/lib/commands/page/custom/syntax.js +1 -1
  208. package/lib/commands/page/custom/update.js +1 -1
  209. package/lib/commands/page/data-list-status.js +1 -1
  210. package/lib/commands/page/generate-start.js +1 -1
  211. package/lib/commands/page/generate-status.js +1 -1
  212. package/lib/commands/page/index.js +1 -1
  213. package/lib/commands/page/pull.js +1 -1
  214. package/lib/commands/page/push.js +1 -1
  215. package/lib/commands/page/relation-audit.js +1 -1
  216. package/lib/commands/page/restore.js +1 -1
  217. package/lib/commands/page/shared.js +1 -1
  218. package/lib/commands/page/sync.js +1 -1
  219. package/lib/commands/project/api-architecture-upgrade.js +1 -1
  220. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  221. package/lib/commands/project/create/format-elapsed.js +1 -1
  222. package/lib/commands/project/create/main.js +1 -1
  223. package/lib/commands/project/create/materialize-project-template.js +1 -1
  224. package/lib/commands/project/create/project-name.js +1 -1
  225. package/lib/commands/project/create/project-template-archive.js +1 -1
  226. package/lib/commands/project/create/project-template-path.js +1 -1
  227. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  228. package/lib/commands/project/create/use-format-code.js +1 -1
  229. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  230. package/lib/commands/project/domain-routing-sync.js +1 -1
  231. package/lib/commands/project/index.js +1 -1
  232. package/lib/commands/project/upgrade.js +1 -1
  233. package/lib/commands/registry.js +1 -1
  234. package/lib/commands/role/delete.js +1 -1
  235. package/lib/commands/role/detail.js +1 -1
  236. package/lib/commands/role/index.js +1 -1
  237. package/lib/commands/role/list.js +1 -1
  238. package/lib/commands/role/shared.js +1 -1
  239. package/lib/commands/role/update.js +1 -1
  240. package/lib/commands/role/user-add.js +1 -1
  241. package/lib/commands/role/user-remove.js +1 -1
  242. package/lib/commands/role/user-resolve.js +1 -1
  243. package/lib/commands/rule/get.js +1 -1
  244. package/lib/commands/rule/index.js +1 -1
  245. package/lib/commands/rule/list.js +1 -1
  246. package/lib/commands/rule/set.js +1 -1
  247. package/lib/commands/rule/shared.js +1 -1
  248. package/lib/commands/run/index.js +1 -1
  249. package/lib/commands/schema.js +1 -1
  250. package/lib/commands/sql/create.js +1 -1
  251. package/lib/commands/sql/delete.js +1 -1
  252. package/lib/commands/sql/detail.js +1 -1
  253. package/lib/commands/sql/exec.js +1 -1
  254. package/lib/commands/sql/index.js +1 -1
  255. package/lib/commands/sql/list.js +1 -1
  256. package/lib/commands/sql/pull.js +1 -1
  257. package/lib/commands/sql/push.js +1 -1
  258. package/lib/commands/sql/shared.js +1 -1
  259. package/lib/commands/sql/status.js +1 -1
  260. package/lib/commands/sql/validate.js +1 -1
  261. package/lib/commands/task/index.js +1 -1
  262. package/lib/commands/task/status.js +1 -1
  263. package/lib/commands/tenant/index.js +1 -1
  264. package/lib/commands/tenant/members-list.js +1 -1
  265. package/lib/commands/tenant/shared.js +1 -1
  266. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  267. package/lib/commands/user-account/feishu-bind.js +1 -1
  268. package/lib/commands/user-account/index.js +1 -1
  269. package/lib/commands/workspace/add.js +1 -1
  270. package/lib/commands/workspace/index.js +1 -1
  271. package/lib/commands/workspace/remove.js +1 -1
  272. package/lib/config/domain-config.js +1 -1
  273. package/lib/config/project-domain-routing.js +1 -1
  274. package/lib/config/region-config.js +1 -1
  275. package/lib/config/schema.js +1 -1
  276. package/lib/constant/cdn.js +1 -1
  277. package/lib/constant/cli.js +1 -1
  278. package/lib/constant/defaults.js +1 -1
  279. package/lib/constant/domain.js +1 -1
  280. package/lib/constant/env.js +1 -1
  281. package/lib/constant/output.js +1 -1
  282. package/lib/constant/paths.js +1 -1
  283. package/lib/constant/region.js +1 -1
  284. package/lib/constant/risk.js +1 -1
  285. package/lib/constant/routing-profile.js +1 -1
  286. package/lib/context/app-resolver.js +1 -1
  287. package/lib/context/auth-resolver.js +1 -1
  288. package/lib/context/config-loader.js +1 -1
  289. package/lib/context.js +1 -1
  290. package/lib/core/alias-resolver.js +1 -1
  291. package/lib/core/api-client.js +1 -1
  292. package/lib/core/bff/config.js +1 -1
  293. package/lib/core/bff/file-system.js +1 -1
  294. package/lib/core/bff/hash.js +1 -1
  295. package/lib/core/bff/hook-directory.js +1 -1
  296. package/lib/core/bff/lock.js +1 -1
  297. package/lib/core/bff/utils.js +1 -1
  298. package/lib/core/cross-db-analysis.js +1 -1
  299. package/lib/core/cross-db-relation.js +1 -1
  300. package/lib/core/db-resolver.js +1 -1
  301. package/lib/core/flow-config.js +1 -1
  302. package/lib/core/instant-api-policy/config.js +1 -1
  303. package/lib/core/instant-api-policy/endpoints.js +1 -1
  304. package/lib/core/kb-management-client.js +1 -1
  305. package/lib/core/kb-search-client.js +1 -1
  306. package/lib/core/page/file-system.js +1 -1
  307. package/lib/core/page/hash.js +1 -1
  308. package/lib/core/page/lock.js +1 -1
  309. package/lib/core/page/lr-smart-jsx.js +1 -1
  310. package/lib/core/sql-index-auditor.js +1 -1
  311. package/lib/core/sql-sync/config.js +1 -1
  312. package/lib/core/sql-sync/file-system.js +1 -1
  313. package/lib/core/sql-sync/hash.js +1 -1
  314. package/lib/core/sql-sync/lock.js +1 -1
  315. package/lib/core/sql-sync/utils.js +1 -1
  316. package/lib/core/sql-validator.js +1 -1
  317. package/lib/errors.js +1 -1
  318. package/lib/framework/build-all-flags.js +1 -1
  319. package/lib/framework/error-output.js +1 -1
  320. package/lib/framework/explicit-yes.js +1 -1
  321. package/lib/framework/flags.js +1 -1
  322. package/lib/framework/help.js +1 -1
  323. package/lib/framework/index.js +1 -1
  324. package/lib/framework/output.js +1 -1
  325. package/lib/framework/response.js +1 -1
  326. package/lib/framework/runner-alias.js +1 -1
  327. package/lib/framework/runner.js +1 -1
  328. package/lib/framework/schema-export.js +1 -1
  329. package/lib/framework/supported-flags.js +1 -1
  330. package/lib/framework/types.js +1 -1
  331. package/lib/generated/build-info.d.ts +4 -4
  332. package/lib/generated/build-info.js +1 -1
  333. package/lib/generated/official-routing.js +1 -1
  334. package/lib/generated/routing-contract.js +1 -1
  335. package/lib/help.js +1 -1
  336. package/lib/postinstall.js +1 -1
  337. package/lib/runtime/confirmation.js +1 -1
  338. package/lib/runtime/event.js +1 -1
  339. package/lib/runtime/index.js +1 -1
  340. package/lib/runtime/queue.js +1 -1
  341. package/lib/runtime/resolve.js +1 -1
  342. package/lib/services/dataset-design/checkpoint.js +1 -1
  343. package/lib/services/dataset-design/commands.js +1 -1
  344. package/lib/services/dataset-design/contract.js +1 -1
  345. package/lib/skills/builtin-skill.js +1 -1
  346. package/lib/skills/main.js +1 -1
  347. package/lib/skills/npx-skills-add.js +1 -1
  348. package/lib/skills/skill-presence.js +1 -1
  349. package/lib/telemetry/cli-command-trace.js +1 -1
  350. package/lib/telemetry/cli-help-trace.js +1 -1
  351. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  352. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  353. package/lib/telemetry/send-cli-trace-log.js +1 -1
  354. package/lib/utils/ai_config.js +1 -1
  355. package/lib/utils/apply-jq-filter.js +1 -1
  356. package/lib/utils/cdn-config.js +1 -1
  357. package/lib/utils/check-sdk-version.js +1 -1
  358. package/lib/utils/cli-version-check.js +1 -1
  359. package/lib/utils/cli-version-policy.js +1 -1
  360. package/lib/utils/config.js +1 -1
  361. package/lib/utils/entity-with-id.js +1 -1
  362. package/lib/utils/file-utils.js +1 -1
  363. package/lib/utils/guides-cdn.js +1 -1
  364. package/lib/utils/http-client.js +1 -1
  365. package/lib/utils/is-non-interactive.js +1 -1
  366. package/lib/utils/logger.js +1 -1
  367. package/lib/utils/params.js +1 -1
  368. package/lib/utils/platform.js +1 -1
  369. package/lib/utils/sleep.js +1 -1
  370. package/lib/utils/template-replacer.js +1 -1
  371. package/lib/utils/update-notice.js +1 -1
  372. package/lib/utils/version.js +1 -1
  373. package/lib/utils/with-active-cookie.js +1 -1
  374. package/lib/utils/write-cli-side-channel.js +1 -1
  375. package/package.json +2 -2
  376. package/skills/rabetbase/SKILL.md +2 -2
  377. package/skills/rabetbase/references/rabetbase-issue-report.md +4 -1
  378. package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
  379. package/skills/rabetbase-page-generation/SKILL.md +1 -1
  380. package/skills/rabetbase.manifest.json +3 -3
  381. package/lib/commands/issue/shared.d.ts +0 -32
  382. package/lib/commands/issue/shared.js +0 -1
  383. package/lib/telemetry/send-platform-issue-collect-log.d.ts +0 -26
  384. package/lib/telemetry/send-platform-issue-collect-log.js +0 -1
@@ -1 +1 @@
1
- (function(_0x50c24b,_0x446a50){const _0x59afd3=a177_0x4cbf,_0x4cc32b=_0x50c24b();while(!![]){try{const _0x291190=parseInt(_0x59afd3(0x1b4))/0x1+parseInt(_0x59afd3(0x1bc))/0x2*(-parseInt(_0x59afd3(0x1d8))/0x3)+-parseInt(_0x59afd3(0x1d5))/0x4+parseInt(_0x59afd3(0x1bd))/0x5*(parseInt(_0x59afd3(0x1bf))/0x6)+-parseInt(_0x59afd3(0x1d4))/0x7*(-parseInt(_0x59afd3(0x1cc))/0x8)+parseInt(_0x59afd3(0x1c3))/0x9*(-parseInt(_0x59afd3(0x1c6))/0xa)+parseInt(_0x59afd3(0x1ba))/0xb*(parseInt(_0x59afd3(0x1b7))/0xc);if(_0x291190===_0x446a50)break;else _0x4cc32b['push'](_0x4cc32b['shift']());}catch(_0xa3f51e){_0x4cc32b['push'](_0x4cc32b['shift']());}}}(a177_0x4019,0xdfdd3));import a177_0x2b8619 from'chalk';import{checkbox,input,confirm}from'@inquirer/prompts';import a177_0x47bce2 from'ora';import{isUrlReachable}from'../../../commands/menu/shared/valid-url.js';import{menuPathKey}from'../../../commands/menu/shared/path.js';import{CliErrors}from'../../../errors.js';function onCancel(_0x5ef294){const _0x2d560b=a177_0x4cbf;return _0x5ef294[_0x2d560b(0x1c9)](_0x17bea7=>{const _0x10c4cf=_0x2d560b;if(_0x17bea7?.[_0x10c4cf(0x1d0)]===_0x10c4cf(0x1c4))throw CliErrors[_0x10c4cf(0x1c1)](_0x10c4cf(0x1d7));throw _0x17bea7;});}export function startSpinner(_0x47cb9e){const _0x4c02cf=a177_0x4cbf;return a177_0x47bce2({'text':_0x47cb9e,'color':'cyan'})[_0x4c02cf(0x1ca)]();}function a177_0x4cbf(_0x17a0b1,_0x57352d){_0x17a0b1=_0x17a0b1-0x1b4;const _0x401938=a177_0x4019();let _0x4cbff8=_0x401938[_0x17a0b1];return _0x4cbff8;}export function stopSpinner(_0xc739d2,_0xc907ca,_0x2819e8){const _0xb7823d=a177_0x4cbf;_0x2819e8?_0xc739d2['succeed'](_0xc907ca):_0xc739d2[_0xb7823d(0x1c0)](_0xc907ca);}export async function askConfirm(_0x21492a){return onCancel(confirm({'message':_0x21492a,'theme':{'prefix':''}}));}function a177_0x4019(){const _0x17becb=['name','map','CSS\x20URL\x20checked','\x20\x20✗\x20JS\x20URL\x20is\x20unreachable','29253wejQeI','1935624Biflue','path','Cancelled.','15vgwbsX','\x20\x20✗\x20JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','[new]','Use\x20--yes\x20to\x20run\x20in\x20non-interactive\x20mode,\x20or\x20pipe\x20data\x20via\x20--params.','length','JS\x20URL\x20check\x20failed','label','\x20\x20JS\x20URL:','\x20\x20Select\x20menus\x20to\x20sync\x20(space\x20to\x20toggle,\x20a=all,\x20i=invert):','117007ctciRp','\x20\x20Checking\x20CSS\x20URL\x20reachability...','\x20\x20✗\x20CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','13749180IWCvPm','filter','error','33lxxJIc','JS\x20URL\x20checked','505534uKNoME','111380bJlYuy','includes','174iUPjVW','fail','cancelled','isTTY','197946lSUwTY','ExitPromptError','CSS\x20URL\x20check\x20failed','740XZbaSe','test','green','catch','start','\x20\x20✗\x20CSS\x20URL\x20is\x20unreachable','176iwrdNo','red','trim','gray'];a177_0x4019=function(){return _0x17becb;};return a177_0x4019();}export async function askJsUrl(_0x5406db){const _0x3f4528=a177_0x4cbf;while(!![]){const _0x3356b7=await onCancel(input({'message':_0x3f4528(0x1df),'default':_0x5406db,'theme':{'prefix':''}}));if(_0x3356b7[_0x3f4528(0x1ce)]()==='')throw CliErrors[_0x3f4528(0x1c1)]('Cancelled.');if(!/^https:\/\/.+\.js(\?.*)?$/[_0x3f4528(0x1c7)](_0x3356b7[_0x3f4528(0x1ce)]())){console[_0x3f4528(0x1b9)](a177_0x2b8619[_0x3f4528(0x1cd)](_0x3f4528(0x1d9)));continue;}const _0x45116f=startSpinner('\x20\x20Checking\x20JS\x20URL\x20reachability...');try{const _0x2dfada=await isUrlReachable(_0x3356b7[_0x3f4528(0x1ce)]());stopSpinner(_0x45116f,_0x3f4528(0x1bb),_0x2dfada);if(!_0x2dfada){console[_0x3f4528(0x1b9)](a177_0x2b8619[_0x3f4528(0x1cd)](_0x3f4528(0x1d3)));continue;}return _0x3356b7[_0x3f4528(0x1ce)]();}catch(_0x1349f0){stopSpinner(_0x45116f,_0x3f4528(0x1dd),![]);throw _0x1349f0;}}}export async function askCssUrl(_0x52b920){const _0x4e499a=a177_0x4cbf;while(!![]){const _0x135ccd=await onCancel(input({'message':'\x20\x20CSS\x20URL:','default':_0x52b920,'theme':{'prefix':''}}));if(_0x135ccd[_0x4e499a(0x1ce)]()==='')throw CliErrors[_0x4e499a(0x1c1)](_0x4e499a(0x1d7));if(!/^https:\/\/.+\.css(\?.*)?$/[_0x4e499a(0x1c7)](_0x135ccd[_0x4e499a(0x1ce)]())){console[_0x4e499a(0x1b9)](a177_0x2b8619['red'](_0x4e499a(0x1b6)));continue;}const _0x376b0f=startSpinner(_0x4e499a(0x1b5));try{const _0x4d74ff=await isUrlReachable(_0x135ccd[_0x4e499a(0x1ce)]());stopSpinner(_0x376b0f,_0x4e499a(0x1d2),_0x4d74ff);if(!_0x4d74ff){console[_0x4e499a(0x1b9)](a177_0x2b8619[_0x4e499a(0x1cd)](_0x4e499a(0x1cb)));continue;}return _0x135ccd[_0x4e499a(0x1ce)]();}catch(_0x57a7a8){stopSpinner(_0x376b0f,_0x4e499a(0x1c5),![]);throw _0x57a7a8;}}}export async function selectPages(_0x5d5636,_0x40df9b){const _0xb9f342=a177_0x4cbf,_0x51d8ef=_0x5d5636[_0xb9f342(0x1d1)](_0x36819f=>{const _0xd23913=_0xb9f342,_0x4c7f6a=_0x40df9b['has'](menuPathKey(_0x36819f[_0xd23913(0x1d6)]));return{'name':_0x36819f[_0xd23913(0x1de)]+'\x20\x20'+a177_0x2b8619[_0xd23913(0x1cf)](_0x36819f[_0xd23913(0x1d6)])+'\x20\x20'+(_0x4c7f6a?a177_0x2b8619[_0xd23913(0x1cf)]('[already\x20on\x20platform]'):a177_0x2b8619[_0xd23913(0x1c8)](_0xd23913(0x1da))),'value':_0x36819f['path'],'checked':!_0x4c7f6a,'disabled':_0x4c7f6a};});if(_0x51d8ef[_0xb9f342(0x1dc)]===0x0)throw new Error('No\x20local\x20pages\x20found.');const _0xea4fab=await onCancel(checkbox({'message':_0xb9f342(0x1e0),'choices':_0x51d8ef,'loop':![],'theme':{'prefix':''}}));if(_0xea4fab[_0xb9f342(0x1dc)]===0x0)throw new Error('No\x20menus\x20selected.');return _0x5d5636[_0xb9f342(0x1b8)](_0x3a220e=>_0xea4fab[_0xb9f342(0x1be)](_0x3a220e[_0xb9f342(0x1d6)]));}export function isInteractive(){const _0x4f5f92=a177_0x4cbf;return process['stdin'][_0x4f5f92(0x1c2)]===!![];}export function requireInteractive(){const _0xcf73d=a177_0x4cbf;if(!isInteractive())throw new Error('This\x20command\x20requires\x20an\x20interactive\x20terminal.\x20'+_0xcf73d(0x1db));}
1
+ function a177_0xc14d(_0x35d39a,_0x27dac8){_0x35d39a=_0x35d39a-0x1ac;const _0x263cf2=a177_0x263c();let _0xc14d78=_0x263cf2[_0x35d39a];return _0xc14d78;}(function(_0x412e95,_0x11cc03){const _0x26e26f=a177_0xc14d,_0x3f09df=_0x412e95();while(!![]){try{const _0x13cea5=-parseInt(_0x26e26f(0x1c2))/0x1+-parseInt(_0x26e26f(0x1d1))/0x2*(parseInt(_0x26e26f(0x1b3))/0x3)+parseInt(_0x26e26f(0x1d4))/0x4+-parseInt(_0x26e26f(0x1d6))/0x5+-parseInt(_0x26e26f(0x1c6))/0x6*(parseInt(_0x26e26f(0x1c1))/0x7)+parseInt(_0x26e26f(0x1b9))/0x8+parseInt(_0x26e26f(0x1ae))/0x9;if(_0x13cea5===_0x11cc03)break;else _0x3f09df['push'](_0x3f09df['shift']());}catch(_0x4a6017){_0x3f09df['push'](_0x3f09df['shift']());}}}(a177_0x263c,0xce0fc));import a177_0x2e473f from'chalk';import{checkbox,input,confirm}from'@inquirer/prompts';import a177_0x331c0c from'ora';import{isUrlReachable}from'../../../commands/menu/shared/valid-url.js';import{menuPathKey}from'../../../commands/menu/shared/path.js';import{CliErrors}from'../../../errors.js';function a177_0x263c(){const _0x3502e7=['red','error','\x20\x20✗\x20CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','CSS\x20URL\x20checked','[already\x20on\x20platform]','7NcyFKL','1504269KARuxv','CSS\x20URL\x20check\x20failed','label','green','8512974boLlDj','cancelled','No\x20local\x20pages\x20found.','start','\x20\x20JS\x20URL:','ExitPromptError','trim','Cancelled.','path','catch','test','656xDXqVk','Use\x20--yes\x20to\x20run\x20in\x20non-interactive\x20mode,\x20or\x20pipe\x20data\x20via\x20--params.','cyan','2802288pNRiHf','succeed','3110370IZemNG','This\x20command\x20requires\x20an\x20interactive\x20terminal.\x20','map','42582267NbeqSW','\x20\x20Checking\x20JS\x20URL\x20reachability...','name','[new]','\x20\x20✗\x20JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','14634zULKsG','No\x20menus\x20selected.','has','gray','length','includes','4457992vBYpjE','\x20\x20Select\x20menus\x20to\x20sync\x20(space\x20to\x20toggle,\x20a=all,\x20i=invert):','filter'];a177_0x263c=function(){return _0x3502e7;};return a177_0x263c();}function onCancel(_0x4d5007){const _0x5ac5ce=a177_0xc14d;return _0x4d5007[_0x5ac5ce(0x1cf)](_0x580244=>{const _0xe151aa=_0x5ac5ce;if(_0x580244?.[_0xe151aa(0x1b0)]===_0xe151aa(0x1cb))throw CliErrors[_0xe151aa(0x1c7)](_0xe151aa(0x1cd));throw _0x580244;});}export function startSpinner(_0x3b00fb){const _0x1885e5=a177_0xc14d;return a177_0x331c0c({'text':_0x3b00fb,'color':_0x1885e5(0x1d3)})[_0x1885e5(0x1c9)]();}export function stopSpinner(_0x335f83,_0x22a6be,_0x302f07){const _0x48351f=a177_0xc14d;_0x302f07?_0x335f83[_0x48351f(0x1d5)](_0x22a6be):_0x335f83['fail'](_0x22a6be);}export async function askConfirm(_0x2f0db9){return onCancel(confirm({'message':_0x2f0db9,'theme':{'prefix':''}}));}export async function askJsUrl(_0x28c577){const _0xc846b7=a177_0xc14d;while(!![]){const _0x515496=await onCancel(input({'message':_0xc846b7(0x1ca),'default':_0x28c577,'theme':{'prefix':''}}));if(_0x515496[_0xc846b7(0x1cc)]()==='')throw CliErrors[_0xc846b7(0x1c7)](_0xc846b7(0x1cd));if(!/^https:\/\/.+\.js(\?.*)?$/[_0xc846b7(0x1d0)](_0x515496['trim']())){console[_0xc846b7(0x1bd)](a177_0x2e473f[_0xc846b7(0x1bc)](_0xc846b7(0x1b2)));continue;}const _0x1c971f=startSpinner(_0xc846b7(0x1af));try{const _0x23e5b6=await isUrlReachable(_0x515496[_0xc846b7(0x1cc)]());stopSpinner(_0x1c971f,'JS\x20URL\x20checked',_0x23e5b6);if(!_0x23e5b6){console[_0xc846b7(0x1bd)](a177_0x2e473f[_0xc846b7(0x1bc)]('\x20\x20✗\x20JS\x20URL\x20is\x20unreachable'));continue;}return _0x515496[_0xc846b7(0x1cc)]();}catch(_0x21af86){stopSpinner(_0x1c971f,'JS\x20URL\x20check\x20failed',![]);throw _0x21af86;}}}export async function askCssUrl(_0x1f3bf5){const _0x385f1a=a177_0xc14d;while(!![]){const _0x5e7f6c=await onCancel(input({'message':'\x20\x20CSS\x20URL:','default':_0x1f3bf5,'theme':{'prefix':''}}));if(_0x5e7f6c['trim']()==='')throw CliErrors[_0x385f1a(0x1c7)](_0x385f1a(0x1cd));if(!/^https:\/\/.+\.css(\?.*)?$/[_0x385f1a(0x1d0)](_0x5e7f6c['trim']())){console['error'](a177_0x2e473f[_0x385f1a(0x1bc)](_0x385f1a(0x1be)));continue;}const _0x47215b=startSpinner('\x20\x20Checking\x20CSS\x20URL\x20reachability...');try{const _0x26067b=await isUrlReachable(_0x5e7f6c[_0x385f1a(0x1cc)]());stopSpinner(_0x47215b,_0x385f1a(0x1bf),_0x26067b);if(!_0x26067b){console[_0x385f1a(0x1bd)](a177_0x2e473f[_0x385f1a(0x1bc)]('\x20\x20✗\x20CSS\x20URL\x20is\x20unreachable'));continue;}return _0x5e7f6c[_0x385f1a(0x1cc)]();}catch(_0x1fe3f0){stopSpinner(_0x47215b,_0x385f1a(0x1c3),![]);throw _0x1fe3f0;}}}export async function selectPages(_0x4e136f,_0x6c6fca){const _0x5bba8a=a177_0xc14d,_0xbcc906=_0x4e136f[_0x5bba8a(0x1ad)](_0x2c36d9=>{const _0x126ce5=_0x5bba8a,_0x57239d=_0x6c6fca[_0x126ce5(0x1b5)](menuPathKey(_0x2c36d9[_0x126ce5(0x1ce)]));return{'name':_0x2c36d9[_0x126ce5(0x1c4)]+'\x20\x20'+a177_0x2e473f['gray'](_0x2c36d9['path'])+'\x20\x20'+(_0x57239d?a177_0x2e473f[_0x126ce5(0x1b6)](_0x126ce5(0x1c0)):a177_0x2e473f[_0x126ce5(0x1c5)](_0x126ce5(0x1b1))),'value':_0x2c36d9[_0x126ce5(0x1ce)],'checked':!_0x57239d,'disabled':_0x57239d};});if(_0xbcc906[_0x5bba8a(0x1b7)]===0x0)throw new Error(_0x5bba8a(0x1c8));const _0x1f69b7=await onCancel(checkbox({'message':_0x5bba8a(0x1ba),'choices':_0xbcc906,'loop':![],'theme':{'prefix':''}}));if(_0x1f69b7[_0x5bba8a(0x1b7)]===0x0)throw new Error(_0x5bba8a(0x1b4));return _0x4e136f[_0x5bba8a(0x1bb)](_0x53d26b=>_0x1f69b7[_0x5bba8a(0x1b8)](_0x53d26b[_0x5bba8a(0x1ce)]));}export function isInteractive(){return process['stdin']['isTTY']===!![];}export function requireInteractive(){const _0x4e8775=a177_0xc14d;if(!isInteractive())throw new Error(_0x4e8775(0x1ac)+_0x4e8775(0x1d2));}
@@ -1 +1 @@
1
- const a178_0x9f0a57=a178_0x2251;(function(_0x65f2a1,_0x3b240e){const _0x4a23b7=a178_0x2251,_0x158bf7=_0x65f2a1();while(!![]){try{const _0x3d71b8=parseInt(_0x4a23b7(0x1e2))/0x1*(parseInt(_0x4a23b7(0x1e8))/0x2)+parseInt(_0x4a23b7(0x1d6))/0x3*(-parseInt(_0x4a23b7(0x1d2))/0x4)+parseInt(_0x4a23b7(0x1da))/0x5+parseInt(_0x4a23b7(0x1c9))/0x6+-parseInt(_0x4a23b7(0x1c4))/0x7+-parseInt(_0x4a23b7(0x1dc))/0x8+parseInt(_0x4a23b7(0x1de))/0x9;if(_0x3d71b8===_0x3b240e)break;else _0x158bf7['push'](_0x158bf7['shift']());}catch(_0x201d8c){_0x158bf7['push'](_0x158bf7['shift']());}}}(a178_0x4c57,0x72755));import{existsSync,readdirSync,statSync,readFileSync}from'fs';import{join,relative,resolve,sep}from'path';function a178_0x4c57(){const _0x3eab1c=[':$1','endsWith','filter','test','forEach','label','has','src/pages','slice','order','isArray','Invalid\x20route\x20manifest\x20','pageFile','\x20disagrees\x20with\x20pageFile\x20','1531131cdOEmn','cwd','visible','length','parse','314514LLuOty','Route\x20','utf-8','utf8','trim','Invalid\x20route\x20group\x20for\x20',':\x20path,\x20label,\x20pageFile\x20and\x20visible\x20are\x20required','isDirectory','join','44uFqnPx','Invalid\x20route\x20order\x20for\x20','index.tsx','replace','206508YgxKsR','isInteger','Invalid\x20route\x20manifest\x20row\x20','path','1426805iRQlsH','group','3344064ePbZvx','match','13283757PksFnY','Duplicate\x20route\x20path\x20in\x20manifest:\x20','Route\x20page\x20file\x20does\x20not\x20exist:\x20','string','135vPUpJw','\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]','Route\x20manifest\x20must\x20contain\x20an\x20array:\x20','map','index','src/pages/','726YTPXwV','replaceAll','boolean'];a178_0x4c57=function(){return _0x3eab1c;};return a178_0x4c57();}const pagesDir=resolve(process[a178_0x9f0a57(0x1c5)](),a178_0x9f0a57(0x1f2));function a178_0x2251(_0x3afc55,_0x137ef4){_0x3afc55=_0x3afc55-0x1be;const _0x4c570c=a178_0x4c57();let _0x22518b=_0x4c570c[_0x3afc55];return _0x22518b;}export function extractTitleFromComment(_0x230129){const _0x530161=a178_0x9f0a57;try{const _0x4bb727=readFileSync(_0x230129,_0x530161(0x1cb)),_0x5bcf79=_0x4bb727[_0x530161(0x1dd)](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x5bcf79&&_0x5bcf79[0x1]){const _0x5512cd=_0x5bcf79[0x1],_0x58ac98=_0x5512cd[_0x530161(0x1dd)](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x58ac98&&_0x58ac98[0x1])return _0x58ac98[0x1][_0x530161(0x1cd)]();}let _0x6277f=null;const _0x379c8d=_0x4bb727['match'](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x379c8d&&_0x379c8d[0x1]&&(_0x6277f=_0x379c8d[0x1]);if(!_0x6277f){const _0x52cc7c=_0x4bb727[_0x530161(0x1dd)](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x52cc7c&&_0x52cc7c[0x1]&&(_0x6277f=_0x52cc7c[0x1]);}if(_0x6277f){const _0x1aa0bb=new RegExp('\x5cb'+_0x6277f+_0x530161(0x1e3)),_0x2b487c=_0x4bb727[_0x530161(0x1dd)](_0x1aa0bb);if(_0x2b487c&&_0x2b487c[0x1])return _0x2b487c[0x1];return _0x6277f;}return null;}catch(_0x476572){return null;}}export function getLocalPages(_0x50eb52=pagesDir,_0x4fff51=pagesDir,_0x329944=process['cwd']()){const _0x4f2d6e=a178_0x9f0a57;if(resolve(_0x50eb52)===resolve(_0x4fff51)){const _0xcb7fcc=join(_0x329944,'src/features/routing/routes.json');if(existsSync(_0xcb7fcc))return getDeclaredPages(_0xcb7fcc,_0x329944);}let _0x426f6a=[];const _0x558683=readdirSync(_0x50eb52);return _0x558683[_0x4f2d6e(0x1ef)](_0x15376a=>{const _0x121ad0=_0x4f2d6e,_0x4421dd=join(_0x50eb52,_0x15376a),_0x5496d9=statSync(_0x4421dd);if(_0x5496d9&&_0x5496d9[_0x121ad0(0x1d0)]())_0x426f6a=_0x426f6a['concat'](getLocalPages(_0x4421dd,_0x4fff51,_0x329944));else{if(_0x15376a[_0x121ad0(0x1ec)]('.tsx')){let _0x27489d=relative(_0x4fff51,_0x4421dd);_0x27489d['endsWith'](_0x121ad0(0x1d4))?_0x27489d=_0x27489d[_0x121ad0(0x1d5)](/index\.tsx$/,''):_0x27489d=_0x27489d['replace'](/\.tsx$/,'');_0x27489d['endsWith'](sep)&&(_0x27489d=_0x27489d[_0x121ad0(0x1be)](0x0,-0x1));const _0x23d58b=_0x27489d['split'](sep)[_0x121ad0(0x1d1)]('/'),_0x465a78=extractTitleFromComment(_0x4421dd),_0x235fca=_0x465a78||_0x23d58b;_0x426f6a['push']({'path':_0x23d58b[_0x121ad0(0x1e9)]('$',':'),'label':_0x235fca});}}}),_0x426f6a[_0x4f2d6e(0x1ed)](_0x3589db=>_0x3589db[_0x4f2d6e(0x1d9)]!=='');}function getDeclaredPages(_0x46d944,_0xe737a8){const _0x57ae30=a178_0x9f0a57;let _0x39efb3;try{_0x39efb3=JSON[_0x57ae30(0x1c8)](readFileSync(_0x46d944,_0x57ae30(0x1cc)));}catch(_0x39f6d6){throw new Error(_0x57ae30(0x1c1)+_0x46d944+':\x20'+String(_0x39f6d6));}if(!Array[_0x57ae30(0x1c0)](_0x39efb3))throw new Error(_0x57ae30(0x1e4)+_0x46d944);const _0x2dd77e=new Set();return _0x39efb3[_0x57ae30(0x1e5)]((_0x35d53f,_0x4b0f5c)=>{const _0x5ed2f3=_0x57ae30;if(!_0x35d53f||typeof _0x35d53f!=='object'||Array['isArray'](_0x35d53f))throw new Error(_0x5ed2f3(0x1d8)+(_0x4b0f5c+0x1));const _0x57296e=_0x35d53f,_0x55d7f3=_0x57296e[_0x5ed2f3(0x1d9)],_0x1f1b2b=_0x57296e[_0x5ed2f3(0x1f0)],_0xf80061=_0x57296e[_0x5ed2f3(0x1c2)];if(typeof _0x55d7f3!==_0x5ed2f3(0x1e1)||!/^\/(?!\/)[^?#]*$/['test'](_0x55d7f3)||typeof _0x1f1b2b!==_0x5ed2f3(0x1e1)||!_0x1f1b2b[_0x5ed2f3(0x1cd)]()||typeof _0xf80061!==_0x5ed2f3(0x1e1)||!/^src\/pages\/(?!.*\.\.)[^/].*\.tsx$/[_0x5ed2f3(0x1ee)](_0xf80061)||typeof _0x57296e[_0x5ed2f3(0x1c6)]!==_0x5ed2f3(0x1ea))throw new Error(_0x5ed2f3(0x1d8)+(_0x4b0f5c+0x1)+_0x5ed2f3(0x1cf));if(_0x2dd77e[_0x5ed2f3(0x1f1)](_0x55d7f3))throw new Error(_0x5ed2f3(0x1df)+_0x55d7f3);_0x2dd77e['add'](_0x55d7f3);if(!existsSync(resolve(_0xe737a8,_0xf80061)))throw new Error(_0x5ed2f3(0x1e0)+_0xf80061);const _0x219036=_0xf80061[_0x5ed2f3(0x1be)](_0x5ed2f3(0x1e7)[_0x5ed2f3(0x1c7)])['replace'](/\/index\.tsx$/,'')[_0x5ed2f3(0x1d5)](/\.tsx$/,'')[_0x5ed2f3(0x1e9)]('$',':')['replace'](/\[([^/\]]+)\]/g,_0x5ed2f3(0x1eb)),_0x173a6d=_0x219036===_0x5ed2f3(0x1e6)?'/':'/'+_0x219036;if(_0x55d7f3!==_0x173a6d)throw new Error(_0x5ed2f3(0x1ca)+_0x55d7f3+_0x5ed2f3(0x1c3)+_0xf80061+';\x20expected\x20'+_0x173a6d);if(_0x57296e[_0x5ed2f3(0x1db)]!==undefined&&(typeof _0x57296e['group']!==_0x5ed2f3(0x1e1)||!_0x57296e[_0x5ed2f3(0x1db)]['trim']()))throw new Error(_0x5ed2f3(0x1ce)+_0x55d7f3);if(_0x57296e[_0x5ed2f3(0x1bf)]!==undefined&&(!Number[_0x5ed2f3(0x1d7)](_0x57296e['order'])||_0x57296e[_0x5ed2f3(0x1bf)]<0x0))throw new Error(_0x5ed2f3(0x1d3)+_0x55d7f3);return{'path':_0x55d7f3,'label':_0x1f1b2b[_0x5ed2f3(0x1cd)](),'visible':_0x57296e['visible'],..._0x57296e['group']===undefined?{}:{'group':_0x57296e['group'][_0x5ed2f3(0x1cd)]()},..._0x57296e[_0x5ed2f3(0x1bf)]===undefined?{}:{'order':_0x57296e[_0x5ed2f3(0x1bf)]}};});}
1
+ const a178_0x65d437=a178_0x4087;(function(_0x29aad6,_0x4706f8){const _0x9c4c86=a178_0x4087,_0x4a1ad3=_0x29aad6();while(!![]){try{const _0x5a9e53=parseInt(_0x9c4c86(0x1b5))/0x1+-parseInt(_0x9c4c86(0x1cd))/0x2*(parseInt(_0x9c4c86(0x1da))/0x3)+-parseInt(_0x9c4c86(0x1cf))/0x4+parseInt(_0x9c4c86(0x1e9))/0x5*(parseInt(_0x9c4c86(0x1e2))/0x6)+parseInt(_0x9c4c86(0x1eb))/0x7+parseInt(_0x9c4c86(0x1e5))/0x8*(-parseInt(_0x9c4c86(0x1e1))/0x9)+parseInt(_0x9c4c86(0x1d9))/0xa;if(_0x5a9e53===_0x4706f8)break;else _0x4a1ad3['push'](_0x4a1ad3['shift']());}catch(_0x56a7b6){_0x4a1ad3['push'](_0x4a1ad3['shift']());}}}(a178_0x3a1a,0x235a8));import{existsSync,readdirSync,statSync,readFileSync}from'fs';import{join,relative,resolve,sep}from'path';const pagesDir=resolve(process[a178_0x65d437(0x1e0)](),a178_0x65d437(0x1e7));export function extractTitleFromComment(_0x49c24f){const _0x20593d=a178_0x65d437;try{const _0x25b9a3=readFileSync(_0x49c24f,_0x20593d(0x1bb)),_0x661889=_0x25b9a3[_0x20593d(0x1dc)](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x661889&&_0x661889[0x1]){const _0x401a37=_0x661889[0x1],_0x384363=_0x401a37[_0x20593d(0x1dc)](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x384363&&_0x384363[0x1])return _0x384363[0x1][_0x20593d(0x1c3)]();}let _0x2a7a84=null;const _0x3e983f=_0x25b9a3[_0x20593d(0x1dc)](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x3e983f&&_0x3e983f[0x1]&&(_0x2a7a84=_0x3e983f[0x1]);if(!_0x2a7a84){const _0xe9bae0=_0x25b9a3[_0x20593d(0x1dc)](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0xe9bae0&&_0xe9bae0[0x1]&&(_0x2a7a84=_0xe9bae0[0x1]);}if(_0x2a7a84){const _0x1ea8c3=new RegExp('\x5cb'+_0x2a7a84+'\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]'),_0x48a9f9=_0x25b9a3[_0x20593d(0x1dc)](_0x1ea8c3);if(_0x48a9f9&&_0x48a9f9[0x1])return _0x48a9f9[0x1];return _0x2a7a84;}return null;}catch(_0x477828){return null;}}function a178_0x3a1a(){const _0x212bb3=['1153828eniWXb','Invalid\x20route\x20manifest\x20','\x20disagrees\x20with\x20pageFile\x20','test','endsWith','.tsx','map','Invalid\x20route\x20manifest\x20row\x20','isDirectory','filter','4940200UZlyfJ','294GOguHy','replaceAll','match','length',';\x20expected\x20','order','cwd','349794vSfMrf','12LJaFAo',':$1','index.tsx','40QYUmAl','Invalid\x20route\x20order\x20for\x20','src/pages','forEach','321885BeloBp','pageFile','118664YTWdGG','group','24227lyoTZV','parse','isArray','label','string','Route\x20manifest\x20must\x20contain\x20an\x20array:\x20','utf-8','visible','boolean','src/features/routing/routes.json','Route\x20','has','replace','push','trim','Duplicate\x20route\x20path\x20in\x20manifest:\x20','Route\x20page\x20file\x20does\x20not\x20exist:\x20','concat','path','index','src/pages/','isInteger','utf8','join','742oBqlXt','slice'];a178_0x3a1a=function(){return _0x212bb3;};return a178_0x3a1a();}function a178_0x4087(_0xb552ff,_0x47ba69){_0xb552ff=_0xb552ff-0x1b4;const _0x3a1a1e=a178_0x3a1a();let _0x40876e=_0x3a1a1e[_0xb552ff];return _0x40876e;}export function getLocalPages(_0x4b4832=pagesDir,_0x4d984d=pagesDir,_0x442538=process[a178_0x65d437(0x1e0)]()){const _0x5762bc=a178_0x65d437;if(resolve(_0x4b4832)===resolve(_0x4d984d)){const _0x7b5bc5=join(_0x442538,_0x5762bc(0x1be));if(existsSync(_0x7b5bc5))return getDeclaredPages(_0x7b5bc5,_0x442538);}let _0x4a85ff=[];const _0x554ac8=readdirSync(_0x4b4832);return _0x554ac8[_0x5762bc(0x1e8)](_0x1101c3=>{const _0x2e4631=_0x5762bc,_0x496ce3=join(_0x4b4832,_0x1101c3),_0x48bfc4=statSync(_0x496ce3);if(_0x48bfc4&&_0x48bfc4[_0x2e4631(0x1d7)]())_0x4a85ff=_0x4a85ff[_0x2e4631(0x1c6)](getLocalPages(_0x496ce3,_0x4d984d,_0x442538));else{if(_0x1101c3['endsWith'](_0x2e4631(0x1d4))){let _0x4ff1ba=relative(_0x4d984d,_0x496ce3);_0x4ff1ba[_0x2e4631(0x1d3)](_0x2e4631(0x1e4))?_0x4ff1ba=_0x4ff1ba[_0x2e4631(0x1c1)](/index\.tsx$/,''):_0x4ff1ba=_0x4ff1ba[_0x2e4631(0x1c1)](/\.tsx$/,'');_0x4ff1ba[_0x2e4631(0x1d3)](sep)&&(_0x4ff1ba=_0x4ff1ba['slice'](0x0,-0x1));const _0x5c62dd=_0x4ff1ba['split'](sep)[_0x2e4631(0x1cc)]('/'),_0x145f8b=extractTitleFromComment(_0x496ce3),_0x520cfe=_0x145f8b||_0x5c62dd;_0x4a85ff[_0x2e4631(0x1c2)]({'path':_0x5c62dd[_0x2e4631(0x1db)]('$',':'),'label':_0x520cfe});}}}),_0x4a85ff[_0x5762bc(0x1d8)](_0x2ca737=>_0x2ca737[_0x5762bc(0x1c7)]!=='');}function getDeclaredPages(_0x656f95,_0x90ba99){const _0x1aecc9=a178_0x65d437;let _0x3258b3;try{_0x3258b3=JSON[_0x1aecc9(0x1b6)](readFileSync(_0x656f95,_0x1aecc9(0x1cb)));}catch(_0x4d21d7){throw new Error(_0x1aecc9(0x1d0)+_0x656f95+':\x20'+String(_0x4d21d7));}if(!Array[_0x1aecc9(0x1b7)](_0x3258b3))throw new Error(_0x1aecc9(0x1ba)+_0x656f95);const _0x42a047=new Set();return _0x3258b3[_0x1aecc9(0x1d5)]((_0x380edb,_0x12f01f)=>{const _0x5018cc=_0x1aecc9;if(!_0x380edb||typeof _0x380edb!=='object'||Array[_0x5018cc(0x1b7)](_0x380edb))throw new Error('Invalid\x20route\x20manifest\x20row\x20'+(_0x12f01f+0x1));const _0x291c9f=_0x380edb,_0x12f667=_0x291c9f['path'],_0x4949ee=_0x291c9f[_0x5018cc(0x1b8)],_0x18b706=_0x291c9f[_0x5018cc(0x1ea)];if(typeof _0x12f667!==_0x5018cc(0x1b9)||!/^\/(?!\/)[^?#]*$/[_0x5018cc(0x1d2)](_0x12f667)||typeof _0x4949ee!==_0x5018cc(0x1b9)||!_0x4949ee[_0x5018cc(0x1c3)]()||typeof _0x18b706!=='string'||!/^src\/pages\/(?!.*\.\.)[^/].*\.tsx$/[_0x5018cc(0x1d2)](_0x18b706)||typeof _0x291c9f[_0x5018cc(0x1bc)]!==_0x5018cc(0x1bd))throw new Error(_0x5018cc(0x1d6)+(_0x12f01f+0x1)+':\x20path,\x20label,\x20pageFile\x20and\x20visible\x20are\x20required');if(_0x42a047[_0x5018cc(0x1c0)](_0x12f667))throw new Error(_0x5018cc(0x1c4)+_0x12f667);_0x42a047['add'](_0x12f667);if(!existsSync(resolve(_0x90ba99,_0x18b706)))throw new Error(_0x5018cc(0x1c5)+_0x18b706);const _0x3700ab=_0x18b706[_0x5018cc(0x1ce)](_0x5018cc(0x1c9)[_0x5018cc(0x1dd)])[_0x5018cc(0x1c1)](/\/index\.tsx$/,'')['replace'](/\.tsx$/,'')[_0x5018cc(0x1db)]('$',':')[_0x5018cc(0x1c1)](/\[([^/\]]+)\]/g,_0x5018cc(0x1e3)),_0x423d7a=_0x3700ab===_0x5018cc(0x1c8)?'/':'/'+_0x3700ab;if(_0x12f667!==_0x423d7a)throw new Error(_0x5018cc(0x1bf)+_0x12f667+_0x5018cc(0x1d1)+_0x18b706+_0x5018cc(0x1de)+_0x423d7a);if(_0x291c9f[_0x5018cc(0x1b4)]!==undefined&&(typeof _0x291c9f[_0x5018cc(0x1b4)]!==_0x5018cc(0x1b9)||!_0x291c9f[_0x5018cc(0x1b4)][_0x5018cc(0x1c3)]()))throw new Error('Invalid\x20route\x20group\x20for\x20'+_0x12f667);if(_0x291c9f['order']!==undefined&&(!Number[_0x5018cc(0x1ca)](_0x291c9f[_0x5018cc(0x1df)])||_0x291c9f[_0x5018cc(0x1df)]<0x0))throw new Error(_0x5018cc(0x1e6)+_0x12f667);return{'path':_0x12f667,'label':_0x4949ee['trim'](),'visible':_0x291c9f['visible'],..._0x291c9f[_0x5018cc(0x1b4)]===undefined?{}:{'group':_0x291c9f[_0x5018cc(0x1b4)][_0x5018cc(0x1c3)]()},..._0x291c9f[_0x5018cc(0x1df)]===undefined?{}:{'order':_0x291c9f[_0x5018cc(0x1df)]}};});}
@@ -1 +1 @@
1
- (function(_0x5566bb,_0x1e1fd0){const _0x3ca6bd=a179_0x178d,_0x23eb82=_0x5566bb();while(!![]){try{const _0x456ae0=-parseInt(_0x3ca6bd(0xa3))/0x1+parseInt(_0x3ca6bd(0xac))/0x2*(parseInt(_0x3ca6bd(0xaa))/0x3)+parseInt(_0x3ca6bd(0xb0))/0x4*(-parseInt(_0x3ca6bd(0xa5))/0x5)+-parseInt(_0x3ca6bd(0xae))/0x6*(-parseInt(_0x3ca6bd(0xa1))/0x7)+-parseInt(_0x3ca6bd(0xad))/0x8*(parseInt(_0x3ca6bd(0xb6))/0x9)+parseInt(_0x3ca6bd(0xa2))/0xa*(-parseInt(_0x3ca6bd(0xa0))/0xb)+parseInt(_0x3ca6bd(0xb4))/0xc;if(_0x456ae0===_0x1e1fd0)break;else _0x23eb82['push'](_0x23eb82['shift']());}catch(_0x5daaaf){_0x23eb82['push'](_0x23eb82['shift']());}}}(a179_0x4385,0x6f8cb));import{menuPathKey}from'../../../commands/menu/shared/path.js';import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';export function validateJsUrl(_0x571a4b){const _0x4b696e=a179_0x178d,_0x154931=[];return!isValidJsHttpsUrl(_0x571a4b)&&_0x154931[_0x4b696e(0xa8)]('JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'),{'ok':_0x154931[_0x4b696e(0xa7)]===0x0,'errors':_0x154931};}function a179_0x4385(){const _0x59c1d4=['1252750qrbDbb','872656pikgNU','JS\x20URL\x20is\x20unreachable','1294045UrYsgh','errors','length','push','has','1674rureah','resources','2072mihkKF','872HELhnk','37740kijoVV','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','12dEjmho','CSS\x20URL\x20is\x20unreachable','path','label','21259848qBwUut','map','69552IMBuXb','22ZDmMUR','945wFYNxO'];a179_0x4385=function(){return _0x59c1d4;};return a179_0x4385();}export function validateCssUrl(_0x1e3e4f){const _0x41dc94=a179_0x178d,_0x160e45=[];return!isValidCssHttpsUrl(_0x1e3e4f)&&_0x160e45['push'](_0x41dc94(0xaf)),{'ok':_0x160e45[_0x41dc94(0xa7)]===0x0,'errors':_0x160e45};}export async function validateJsUrlReachable(_0x249378){const _0x59e121=a179_0x178d,_0x510879=validateJsUrl(_0x249378);if(!_0x510879['ok'])return _0x510879;const _0x195abc=await isUrlReachable(_0x249378);if(!_0x195abc)_0x510879['errors'][_0x59e121(0xa8)](_0x59e121(0xa4));return{'ok':_0x510879[_0x59e121(0xa6)]['length']===0x0,'errors':_0x510879['errors']};}export async function validateCssUrlReachable(_0x2ce3da){const _0x4a9d59=a179_0x178d,_0x371c08=validateCssUrl(_0x2ce3da);if(!_0x371c08['ok'])return _0x371c08;const _0x12015c=await isUrlReachable(_0x2ce3da);if(!_0x12015c)_0x371c08[_0x4a9d59(0xa6)][_0x4a9d59(0xa8)](_0x4a9d59(0xb1));return{'ok':_0x371c08[_0x4a9d59(0xa6)]['length']===0x0,'errors':_0x371c08[_0x4a9d59(0xa6)]};}export function buildCompareRows(_0x29df4f,_0x16748a){const _0x1ccf2e=a179_0x178d;return _0x29df4f[_0x1ccf2e(0xb5)](_0x565c2d=>({'label':_0x565c2d['label'],'path':_0x565c2d[_0x1ccf2e(0xb2)],'local':!![],'online':_0x16748a[_0x1ccf2e(0xa9)](menuPathKey(_0x565c2d[_0x1ccf2e(0xb2)]))}));}export async function doCreateMenus(_0x235126,_0x364216,_0x3127d1,_0x2affc8,_0x279ce7){const _0x44a4ef=a179_0x178d,_0x29d574=_0x279ce7?await createMenus(_0x235126,_0x364216,_0x3127d1,_0x2affc8,_0x279ce7):await createMenus(_0x235126,_0x364216,_0x3127d1,_0x2affc8);return{'created':_0x29d574[_0x44a4ef(0xa7)],'failed':0x0,'labels':_0x3127d1[_0x44a4ef(0xb5)](_0x3e8c24=>_0x3e8c24[_0x44a4ef(0xb3)]),'menus':_0x29d574};}function a179_0x178d(_0x380906,_0x2ee414){_0x380906=_0x380906-0xa0;const _0x43856b=a179_0x4385();let _0x178dd4=_0x43856b[_0x380906];return _0x178dd4;}export function filterMenusWithResources(_0x26e7c5){const _0x56018b=a179_0x178d;return _0x26e7c5['filter'](_0x3fb387=>_0x3fb387[_0x56018b(0xab)][_0x56018b(0xa7)]>0x0);}export async function fetchMenuData(_0x1333a7,_0x3fcf54){const _0x3464c8=a179_0x178d,_0x3bb4ec=getLocalPages(),_0x207652=await getOnlineMenuList(_0x1333a7,_0x3fcf54),_0x3b503e=new Set(_0x207652[_0x3464c8(0xb5)](_0x2f79f0=>menuPathKey(_0x2f79f0[_0x3464c8(0xb2)])));return{'localPages':_0x3bb4ec,'onlineMenuList':_0x207652,'onlinePaths':_0x3b503e};}export async function fetchOnlineMenuList(_0x5835c8,_0x5bf656){return getOnlineMenuList(_0x5835c8,_0x5bf656);}
1
+ (function(_0x338898,_0x4c8559){const _0x21740b=a179_0x1985,_0x5a766e=_0x338898();while(!![]){try{const _0xa0714=parseInt(_0x21740b(0x14f))/0x1*(-parseInt(_0x21740b(0x14d))/0x2)+-parseInt(_0x21740b(0x14c))/0x3+-parseInt(_0x21740b(0x15b))/0x4+-parseInt(_0x21740b(0x156))/0x5*(parseInt(_0x21740b(0x152))/0x6)+parseInt(_0x21740b(0x151))/0x7+parseInt(_0x21740b(0x157))/0x8+parseInt(_0x21740b(0x160))/0x9*(parseInt(_0x21740b(0x150))/0xa);if(_0xa0714===_0x4c8559)break;else _0x5a766e['push'](_0x5a766e['shift']());}catch(_0x4ffaaf){_0x5a766e['push'](_0x5a766e['shift']());}}}(a179_0x1fe4,0xe5af0));import{menuPathKey}from'../../../commands/menu/shared/path.js';import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';function a179_0x1fe4(){const _0x510066=['has','path','label','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','45PPqyrq','4607523JToMIF','4WkVTOf','map','159881SupKsj','4867450zpZBAC','10228988EXuwSA','4696074CCudfN','length','push','JS\x20URL\x20is\x20unreachable','10lQvDYF','9563528SdVzja','filter','errors','resources','2914820wLtYKv'];a179_0x1fe4=function(){return _0x510066;};return a179_0x1fe4();}import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';export function validateJsUrl(_0x32dfeb){const _0x580d5c=a179_0x1985,_0x197adb=[];return!isValidJsHttpsUrl(_0x32dfeb)&&_0x197adb[_0x580d5c(0x154)](_0x580d5c(0x15f)),{'ok':_0x197adb['length']===0x0,'errors':_0x197adb};}export function validateCssUrl(_0x514a1d){const _0xe6a4c5=a179_0x1985,_0x35c932=[];return!isValidCssHttpsUrl(_0x514a1d)&&_0x35c932[_0xe6a4c5(0x154)]('CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'),{'ok':_0x35c932[_0xe6a4c5(0x153)]===0x0,'errors':_0x35c932};}export async function validateJsUrlReachable(_0x431de4){const _0x2c2b63=a179_0x1985,_0x57565f=validateJsUrl(_0x431de4);if(!_0x57565f['ok'])return _0x57565f;const _0x135223=await isUrlReachable(_0x431de4);if(!_0x135223)_0x57565f[_0x2c2b63(0x159)][_0x2c2b63(0x154)](_0x2c2b63(0x155));return{'ok':_0x57565f[_0x2c2b63(0x159)][_0x2c2b63(0x153)]===0x0,'errors':_0x57565f[_0x2c2b63(0x159)]};}export async function validateCssUrlReachable(_0x4fa69c){const _0x7bb6fc=a179_0x1985,_0x1ba989=validateCssUrl(_0x4fa69c);if(!_0x1ba989['ok'])return _0x1ba989;const _0x2af60a=await isUrlReachable(_0x4fa69c);if(!_0x2af60a)_0x1ba989[_0x7bb6fc(0x159)]['push']('CSS\x20URL\x20is\x20unreachable');return{'ok':_0x1ba989['errors'][_0x7bb6fc(0x153)]===0x0,'errors':_0x1ba989[_0x7bb6fc(0x159)]};}export function buildCompareRows(_0x365cbf,_0xcc4c17){const _0x35139d=a179_0x1985;return _0x365cbf[_0x35139d(0x14e)](_0x51af1d=>({'label':_0x51af1d[_0x35139d(0x15e)],'path':_0x51af1d[_0x35139d(0x15d)],'local':!![],'online':_0xcc4c17[_0x35139d(0x15c)](menuPathKey(_0x51af1d[_0x35139d(0x15d)]))}));}export async function doCreateMenus(_0x363caf,_0x59c169,_0x22b861,_0x5264f5,_0x2c796b){const _0x2aeab8=a179_0x1985,_0x5da3e4=_0x2c796b?await createMenus(_0x363caf,_0x59c169,_0x22b861,_0x5264f5,_0x2c796b):await createMenus(_0x363caf,_0x59c169,_0x22b861,_0x5264f5);return{'created':_0x5da3e4[_0x2aeab8(0x153)],'failed':0x0,'labels':_0x22b861[_0x2aeab8(0x14e)](_0x2a7c66=>_0x2a7c66[_0x2aeab8(0x15e)]),'menus':_0x5da3e4};}export function filterMenusWithResources(_0x39e1b4){const _0x4d7a78=a179_0x1985;return _0x39e1b4[_0x4d7a78(0x158)](_0x3f2bf3=>_0x3f2bf3[_0x4d7a78(0x15a)]['length']>0x0);}export async function fetchMenuData(_0x41c896,_0x358b24){const _0x40da4b=a179_0x1985,_0x217e37=getLocalPages(),_0x42c78c=await getOnlineMenuList(_0x41c896,_0x358b24),_0x31b87a=new Set(_0x42c78c[_0x40da4b(0x14e)](_0x52c4a5=>menuPathKey(_0x52c4a5[_0x40da4b(0x15d)])));return{'localPages':_0x217e37,'onlineMenuList':_0x42c78c,'onlinePaths':_0x31b87a};}function a179_0x1985(_0xa4e86e,_0x591de4){_0xa4e86e=_0xa4e86e-0x14c;const _0x1fe4d2=a179_0x1fe4();let _0x19853e=_0x1fe4d2[_0xa4e86e];return _0x19853e;}export async function fetchOnlineMenuList(_0x323499,_0x2731b4){return getOnlineMenuList(_0x323499,_0x2731b4);}
@@ -1 +1 @@
1
- const a180_0x941e73=a180_0xc719;(function(_0x3ac30f,_0x50839f){const _0x20de0f=a180_0xc719,_0x27fa85=_0x3ac30f();while(!![]){try{const _0x877d8d=-parseInt(_0x20de0f(0xd7))/0x1*(parseInt(_0x20de0f(0xd1))/0x2)+-parseInt(_0x20de0f(0xf2))/0x3*(parseInt(_0x20de0f(0xb9))/0x4)+-parseInt(_0x20de0f(0xed))/0x5*(parseInt(_0x20de0f(0xbf))/0x6)+-parseInt(_0x20de0f(0xba))/0x7+parseInt(_0x20de0f(0xb1))/0x8*(-parseInt(_0x20de0f(0xd0))/0x9)+-parseInt(_0x20de0f(0xc3))/0xa*(parseInt(_0x20de0f(0xcb))/0xb)+parseInt(_0x20de0f(0xc8))/0xc;if(_0x877d8d===_0x50839f)break;else _0x27fa85['push'](_0x27fa85['shift']());}catch(_0x5235b9){_0x27fa85['push'](_0x27fa85['shift']());}}}(a180_0x3e60,0x93f5b));import{CliError,CliErrors}from'../../../errors.js';import{fetchMenuSnapshot,getChildren}from'../../../commands/menu/shared/facts.js';export const MAX_MENU_SORT=0x7fffffff;export const MENU_ID_FLAG={'name':'id','type':'number','required':!![],'description':'Exact\x20online\x20menu\x20id'};export const MENU_SORT_FLAG={'name':a180_0x941e73(0x106),'type':'number','description':'Sibling\x20sort\x20value\x20(non-negative\x20integer)'};export const MENU_PARENT_ID_FLAG={'name':a180_0x941e73(0xec),'type':a180_0x941e73(0xdd),'description':'Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node'};function a180_0x3e60(){const _0x16c6f8=['deleteOrder','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.','\x20child\x20count\x20changed:\x20expected\x20','menu_sort_invalid','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','string','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','verification','toLowerCase','succeeded','length','folder','backend','map','Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.','unknown','cascade','dryRun','Menu\x20','parent-id','1632785aYZXZp','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20','\x20path\x20changed:\x20expected\x20','menu_permission_denied','Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.','33CyPnKo','warnings','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches','read\x20online\x20menu\x20facts\x20before\x20','snapshotHash','childrenCount',',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.','num','code','hasOwnProperty','appCode','dry-run','\x22,\x20not\x20folder.','parentId','flagMissing','stringify','filter','plannedActions','expect-path','cookie','sort','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','failed','message','The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.','byId','Reorder\x20sibling\x20menus\x20below\x20','data','prototype','expected-children-count','Failed\x20to\x20','\x20parent\x20changed:\x20expected\x20','type','menu_mutation_failed','Online\x20menu\x20state\x20changed\x20before\x20','menu_sort_overflow','menu_confirmation_required','yes','root','menu_parent_not_folder','targets','27872obLWRW','\x20is\x20type\x20\x22','test','hash','max','validation','menu_state_drift','number','352784aHergE','80647HKHpBa','trim',',\x20current\x20','after','expect-parent-id','6IRXdtF','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','menu_verification_failed','470TpvAUg','rawFlags','pre-write-recheck','bool','hint','59485140edRJsa','Permission\x20denied\x20while\x20attempting\x20to\x20','api_error','176429couDOb','menu_not_found','path','str','planFile','3123dvDUcf','14FBvbcE','Online\x20menu\x20not\x20found:\x20','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','isSafeInteger','Cannot\x20append\x20a\x20','selector','154291eeGWeO'];a180_0x3e60=function(){return _0x16c6f8;};return a180_0x3e60();}export const MENU_EXPECT_PARENT_ID_FLAG={'name':a180_0x941e73(0xbe),'type':a180_0x941e73(0xdd),'description':a180_0x941e73(0xde)};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a180_0x941e73(0x104),'type':'string','description':a180_0x941e73(0xc1)},{'name':a180_0x941e73(0x10f),'type':a180_0x941e73(0xb8),'description':a180_0x941e73(0xf4)}];export function validateExactId(_0x2ccbfd){const _0x486075=a180_0x941e73,_0x214691=_0x2ccbfd[_0x486075(0xf9)]('id');if(!Number[_0x486075(0xd4)](_0x214691)||_0x214691<=0x0)throw CliErrors[_0x486075(0xb6)](_0x486075(0xdf));return _0x214691;}export function validateSort(_0x1fa591,_0xfe5301=a180_0x941e73(0x106)){const _0x9fa676=a180_0x941e73;if(!hasFlag(_0x1fa591,_0xfe5301))return undefined;const _0x478d35=_0x1fa591[_0x9fa676(0xf9)](_0xfe5301);if(!Number['isSafeInteger'](_0x478d35)||_0x478d35<0x0||_0x478d35>MAX_MENU_SORT)throw menuError(_0x9fa676(0xdb),'--'+_0xfe5301+'\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20'+MAX_MENU_SORT+'.',_0x9fa676(0x107));return _0x478d35;}export function nextSiblingSort(_0x10ed09,_0x371369,_0x2cf5fc){const _0x268c36=a180_0x941e73,_0x33e2a7=getChildren(_0x10ed09,_0x371369)[_0x268c36(0xe6)](_0x8186c=>_0x8186c[_0x268c36(0x106)])[_0x268c36(0x102)](_0x1ab787=>typeof _0x1ab787===_0x268c36(0xb8));if(_0x33e2a7[_0x268c36(0xe3)]===0x0)return 0x0;const _0x47d91d=Math[_0x268c36(0xb5)](..._0x33e2a7);if(_0x47d91d>=MAX_MENU_SORT)throw menuError(_0x268c36(0xab),_0x268c36(0xd5)+_0x2cf5fc+_0x268c36(0xee)+_0x47d91d+'.',_0x268c36(0x10c)+MAX_MENU_SORT+_0x268c36(0xf8));return _0x47d91d+0x1;}export function requireExplicitYes(_0x4e9c5b){const _0x353e4e=a180_0x941e73;if(_0x4e9c5b[_0x353e4e(0xc6)](_0x353e4e(0xfd)))return;if(!_0x4e9c5b[_0x353e4e(0xc6)](_0x353e4e(0xad)))throw menuError(_0x353e4e(0xac),'This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.');}export async function fetchMutationSnapshot(_0x1f368e,_0x1eec88,_0x393559){const _0x52132c=a180_0x941e73;try{return await fetchMenuSnapshot(_0x1f368e['appCode'],_0x1f368e[_0x52132c(0x105)]);}catch(_0x8377e7){throw mapMenuApiError(_0x8377e7,_0x52132c(0xf5)+_0x1eec88,_0x393559);}}export async function recheckMutationSnapshot(_0x21b375,_0x3e264c,_0x45540c,_0x1e1e15){const _0xce78b7=a180_0x941e73;let _0x4beaa5;try{_0x4beaa5=await fetchMenuSnapshot(_0x21b375[_0xce78b7(0xfc)],_0x21b375[_0xce78b7(0x105)]);}catch(_0x530279){const _0x93236=mapMenuApiError(_0x530279,'recheck\x20online\x20menu\x20facts\x20before\x20'+_0x45540c,_0x1e1e15);throw menuFailure(_0x93236,_0x3e264c,{'stage':'pre-write-recheck','failed':_0x1e1e15==null?{}:{'id':_0x1e1e15}});}if(_0x4beaa5[_0xce78b7(0xb4)]!==_0x3e264c['snapshotHash']){const _0x188bd2=menuError(_0xce78b7(0xb7),_0xce78b7(0x114)+_0x45540c+';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.',_0xce78b7(0xd9));throw menuFailure(_0x188bd2,_0x3e264c,{'stage':_0xce78b7(0xc5),'failed':{..._0x1e1e15==null?{}:{'id':_0x1e1e15},'expectedSnapshotHash':_0x3e264c[_0xce78b7(0xf6)],'currentSnapshotHash':_0x4beaa5[_0xce78b7(0xb4)]}});}return _0x4beaa5;}export function parseParentId(_0x36caa8,_0x264024,_0x4d17f0={}){const _0xf86f=a180_0x941e73;if(!hasFlag(_0x36caa8,_0x264024)){if(_0x4d17f0['required'])throw CliErrors[_0xf86f(0x100)](_0x264024);return undefined;}const _0x2de1f3=_0x36caa8[_0xf86f(0xce)](_0x264024)[_0xf86f(0xbb)]();if(_0x2de1f3[_0xf86f(0xe1)]()==='root')return null;if(!/^\d+$/['test'](_0x2de1f3))throw CliErrors[_0xf86f(0xb6)]('--'+_0x264024+_0xf86f(0xd3));const _0x211f10=Number(_0x2de1f3);if(!Number[_0xf86f(0xd4)](_0x211f10)||_0x211f10<=0x0)throw CliErrors[_0xf86f(0xb6)]('--'+_0x264024+_0xf86f(0xd3));return _0x211f10;}export function requireMenu(_0xde4f5d,_0x1fa108){const _0x5a330a=a180_0x941e73,_0x2306a5=_0xde4f5d[_0x5a330a(0x10b)]['get'](_0x1fa108);if(!_0x2306a5)throw menuError(_0x5a330a(0xcc),_0x5a330a(0xd2)+_0x1fa108,'Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.');return _0x2306a5;}export function requireFolder(_0x1b3083,_0x67e7a){const _0x9ec5fc=a180_0x941e73,_0x5d6229=requireMenu(_0x1b3083,_0x67e7a);if(_0x5d6229[_0x9ec5fc(0x112)]!==_0x9ec5fc(0xe4))throw menuError(_0x9ec5fc(0xaf),_0x9ec5fc(0xeb)+_0x67e7a+_0x9ec5fc(0xb2)+(_0x5d6229['type']||_0x9ec5fc(0xe8))+_0x9ec5fc(0xfe),_0x9ec5fc(0xc0));return _0x5d6229;}export function assertExpectedState(_0x354338,_0x28553a){const _0x21c441=a180_0x941e73;if(hasFlag(_0x354338,_0x21c441(0xbe))){const _0x781da5=parseParentId(_0x354338,_0x21c441(0xbe),{'required':!![]});if(_0x28553a[_0x21c441(0xff)]!==_0x781da5)throw stateDrift('Menu\x20'+_0x28553a['id']+_0x21c441(0x111)+formatParent(_0x781da5)+_0x21c441(0xbc)+formatParent(_0x28553a[_0x21c441(0xff)])+'.');}if(hasFlag(_0x354338,_0x21c441(0x104))){const _0x22ce1e=_0x354338[_0x21c441(0xce)](_0x21c441(0x104));if(_0x28553a[_0x21c441(0xcd)]!==_0x22ce1e)throw stateDrift(_0x21c441(0xeb)+_0x28553a['id']+_0x21c441(0xef)+JSON[_0x21c441(0x101)](_0x22ce1e)+',\x20current\x20'+JSON['stringify'](_0x28553a[_0x21c441(0xcd)])+'.');}if(hasFlag(_0x354338,'expected-children-count')){const _0x3a34e7=_0x354338['num'](_0x21c441(0x10f));if(!Number[_0x21c441(0xd4)](_0x3a34e7)||_0x3a34e7<0x0)throw CliErrors['validation'](_0x21c441(0xdc));if(_0x28553a[_0x21c441(0xf7)]!==_0x3a34e7)throw stateDrift(_0x21c441(0xeb)+_0x28553a['id']+_0x21c441(0xda)+_0x3a34e7+_0x21c441(0xbc)+_0x28553a['childrenCount']+'.');}}export function assertVerified(_0x297963,_0x28d575,_0x4a5c38='Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.'){const _0x3d4268=a180_0x941e73;if(!_0x297963)throw menuError(_0x3d4268(0xc2),_0x28d575,_0x4a5c38);}export function mutationResult(_0x268f5a){const _0x1bb364=a180_0x941e73;return{'operation':_0x268f5a['operation'],'selector':_0x268f5a[_0x1bb364(0xd6)],'before':_0x268f5a['before'],'after':_0x268f5a[_0x1bb364(0xbd)],'dryRun':_0x268f5a[_0x1bb364(0xea)],'backend':_0x268f5a[_0x1bb364(0xe5)],..._0x268f5a[_0x1bb364(0x103)]?{'plannedActions':_0x268f5a[_0x1bb364(0x103)]}:{},..._0x268f5a[_0x1bb364(0xb0)]?{'targets':_0x268f5a[_0x1bb364(0xb0)]}:{},..._0x268f5a[_0x1bb364(0xd8)]?{'deleteOrder':_0x268f5a[_0x1bb364(0xd8)]}:{},'snapshotHash':_0x268f5a[_0x1bb364(0xf6)],..._0x268f5a[_0x1bb364(0xe9)]?{'cascade':_0x268f5a[_0x1bb364(0xe9)]}:{},..._0x268f5a[_0x1bb364(0xcf)]?{'planFile':_0x268f5a[_0x1bb364(0xcf)]}:{},'succeeded':_0x268f5a[_0x1bb364(0xe2)]??[],'failed':_0x268f5a[_0x1bb364(0x108)]??[],'warnings':_0x268f5a[_0x1bb364(0xf3)]??[],'verification':_0x268f5a[_0x1bb364(0xe0)],'error':_0x268f5a['error']};}export function menuDryRunResult(_0x5d95aa,_0xb39198){return{..._0x5d95aa,..._0xb39198};}export function menuFailure(_0x1975a0,_0x3afbec,_0x82a97d){const _0x331f85=a180_0x941e73,_0x2b3c31=mutationResult({..._0x3afbec,'after':_0x82a97d[_0x331f85(0xbd)]===undefined?_0x3afbec[_0x331f85(0xbd)]:_0x82a97d[_0x331f85(0xbd)],'backend':_0x82a97d['backend']??_0x3afbec[_0x331f85(0xe5)],'dryRun':![],'succeeded':_0x82a97d[_0x331f85(0xe2)]??[],'failed':_0x82a97d['failedRecords']??[{..._0x82a97d[_0x331f85(0x108)]??{},'stage':_0x82a97d['stage'],'code':_0x1975a0[_0x331f85(0xfa)],'message':_0x1975a0[_0x331f85(0x109)]}],'warnings':[..._0x3afbec[_0x331f85(0xf3)],..._0x82a97d[_0x331f85(0xf3)]??[]],'verification':_0x82a97d[_0x331f85(0xe0)],'error':{'code':_0x1975a0[_0x331f85(0xfa)],'message':_0x1975a0['message'],..._0x1975a0[_0x331f85(0xc7)]?{'hint':_0x1975a0[_0x331f85(0xc7)]}:{}}});return Object['defineProperty'](_0x1975a0,_0x331f85(0x10d),{'value':_0x2b3c31,'enumerable':!![],'configurable':!![]}),_0x1975a0;}export function asVerificationError(_0x53b4ac,_0x20d8a9){const _0x62654e=a180_0x941e73;if(_0x53b4ac instanceof CliError&&_0x53b4ac[_0x62654e(0xfa)]===_0x62654e(0xc2))return _0x53b4ac;const _0x1142e1=_0x53b4ac instanceof Error?_0x53b4ac[_0x62654e(0x109)]:String(_0x53b4ac);return menuError(_0x62654e(0xc2),''+_0x20d8a9+(_0x1142e1?':\x20'+_0x1142e1:''),_0x62654e(0x10a));}export function describeMenuErrorCause(_0x15d62d,_0x452a08,_0x3c5a8b){const _0x2c0969=a180_0x941e73,_0xb104aa=mapMenuApiError(_0x15d62d,_0x452a08,_0x3c5a8b);return{'causeCode':_0xb104aa[_0x2c0969(0xfa)],'causeMessage':_0xb104aa[_0x2c0969(0x109)]};}export function hasFlag(_0x4e0330,_0x47bd82){const _0x55e8ae=a180_0x941e73;return Object[_0x55e8ae(0x10e)][_0x55e8ae(0xfb)]['call'](_0x4e0330['rawFlags'],_0x47bd82)&&_0x4e0330[_0x55e8ae(0xc4)][_0x47bd82]!==undefined;}export function toApiParentId(_0x306f7c){return _0x306f7c??0x0;}export function formatParent(_0x252102){const _0x35a700=a180_0x941e73;return _0x252102==null?_0x35a700(0xae):String(_0x252102);}export function menuError(_0x207113,_0x364353,_0x1091c2){return new CliError(_0x207113,0x1,_0x364353,_0x1091c2);}function a180_0xc719(_0x4e6c66,_0x21a812){_0x4e6c66=_0x4e6c66-0xab;const _0x3e60a5=a180_0x3e60();let _0xc71925=_0x3e60a5[_0x4e6c66];return _0xc71925;}export function mapMenuApiError(_0x273768,_0x38a3e8,_0x3e8c28){const _0x4005e2=a180_0x941e73;if(_0x273768 instanceof CliError&&_0x273768['code']!==_0x4005e2(0xca))return _0x273768;const _0x2ed1b4=_0x273768 instanceof Error?_0x273768[_0x4005e2(0x109)]:String(_0x273768);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x4005e2(0xb3)](_0x2ed1b4))return menuError(_0x4005e2(0xf0),_0x4005e2(0xc9)+_0x38a3e8+(_0x3e8c28?'\x20menu\x20'+_0x3e8c28:'')+'.','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.');return menuError(_0x4005e2(0x113),_0x4005e2(0x110)+_0x38a3e8+(_0x3e8c28?'\x20menu\x20'+_0x3e8c28:'')+':\x20'+_0x2ed1b4,_0x4005e2(0xf1));}export function isMenuResponseLoss(_0x1ae4ec){const _0x903880=a180_0x941e73,_0x70e489=_0x1ae4ec instanceof Error?_0x1ae4ec[_0x903880(0x109)]:String(_0x1ae4ec);if(_0x1ae4ec instanceof CliError)return _0x1ae4ec[_0x903880(0xfa)]==='api_error'&&/^Request (?:failed|timeout):/i[_0x903880(0xb3)](_0x70e489);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i['test'](_0x70e489);}function stateDrift(_0x5a36f1){const _0x241a4a=a180_0x941e73;return menuError(_0x241a4a(0xb7),_0x5a36f1,_0x241a4a(0xe7));}
1
+ const a180_0x5b5d4e=a180_0xc48a;(function(_0x1f741c,_0x5b4ad6){const _0x55931c=a180_0xc48a,_0x534c27=_0x1f741c();while(!![]){try{const _0x3d2d11=-parseInt(_0x55931c(0x206))/0x1*(-parseInt(_0x55931c(0x213))/0x2)+-parseInt(_0x55931c(0x217))/0x3*(-parseInt(_0x55931c(0x226))/0x4)+parseInt(_0x55931c(0x253))/0x5+-parseInt(_0x55931c(0x22b))/0x6+parseInt(_0x55931c(0x22d))/0x7+-parseInt(_0x55931c(0x215))/0x8+-parseInt(_0x55931c(0x243))/0x9;if(_0x3d2d11===_0x5b4ad6)break;else _0x534c27['push'](_0x534c27['shift']());}catch(_0xa5b14b){_0x534c27['push'](_0x534c27['shift']());}}}(a180_0x33b5,0x3734c));import{CliError,CliErrors}from'../../../errors.js';import{fetchMenuSnapshot,getChildren}from'../../../commands/menu/shared/facts.js';export const MAX_MENU_SORT=0x7fffffff;export const MENU_ID_FLAG={'name':'id','type':'number','required':!![],'description':a180_0x5b5d4e(0x24c)};export const MENU_SORT_FLAG={'name':a180_0x5b5d4e(0x231),'type':'number','description':a180_0x5b5d4e(0x222)};export const MENU_PARENT_ID_FLAG={'name':'parent-id','type':a180_0x5b5d4e(0x1f7),'description':a180_0x5b5d4e(0x233)};export const MENU_EXPECT_PARENT_ID_FLAG={'name':a180_0x5b5d4e(0x230),'type':a180_0x5b5d4e(0x1f7),'description':'Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level'};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a180_0x5b5d4e(0x22a),'type':a180_0x5b5d4e(0x1f7),'description':a180_0x5b5d4e(0x1ea)},{'name':a180_0x5b5d4e(0x245),'type':a180_0x5b5d4e(0x239),'description':'Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches'}];export function validateExactId(_0x434ad3){const _0x135d9d=a180_0x5b5d4e,_0x45bf4b=_0x434ad3['num']('id');if(!Number['isSafeInteger'](_0x45bf4b)||_0x45bf4b<=0x0)throw CliErrors[_0x135d9d(0x249)]('--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.');return _0x45bf4b;}export function validateSort(_0xd426f8,_0x1e6be1='sort'){const _0x498031=a180_0x5b5d4e;if(!hasFlag(_0xd426f8,_0x1e6be1))return undefined;const _0x4d5c9d=_0xd426f8[_0x498031(0x251)](_0x1e6be1);if(!Number[_0x498031(0x1f5)](_0x4d5c9d)||_0x4d5c9d<0x0||_0x4d5c9d>MAX_MENU_SORT)throw menuError(_0x498031(0x21d),'--'+_0x1e6be1+_0x498031(0x235)+MAX_MENU_SORT+'.',_0x498031(0x21c));return _0x4d5c9d;}export function nextSiblingSort(_0x3e319f,_0x379084,_0x8eb56c){const _0xb411c2=a180_0x5b5d4e,_0xa1cc59=getChildren(_0x3e319f,_0x379084)[_0xb411c2(0x1ed)](_0x4b8b51=>_0x4b8b51['sort'])['filter'](_0x1db4e9=>typeof _0x1db4e9===_0xb411c2(0x239));if(_0xa1cc59[_0xb411c2(0x22e)]===0x0)return 0x0;const _0x4ae62e=Math[_0xb411c2(0x250)](..._0xa1cc59);if(_0x4ae62e>=MAX_MENU_SORT)throw menuError(_0xb411c2(0x201),_0xb411c2(0x24a)+_0x8eb56c+_0xb411c2(0x1f2)+_0x4ae62e+'.',_0xb411c2(0x1f0)+MAX_MENU_SORT+_0xb411c2(0x21b));return _0x4ae62e+0x1;}function a180_0x33b5(){const _0x50765b=[',\x20current\x20','failed','Online\x20menu\x20not\x20found:\x20','folder','unknown','call','stage','childrenCount','path','verification','282AOnOjI','plannedActions','2038504QXcbsW','\x20menu\x20','3dDOnvL','menu_confirmation_required','menu_not_found','dryRun',',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','menu_sort_invalid','deleteOrder','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.','bool','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','Sibling\x20sort\x20value\x20(non-negative\x20integer)',';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','pre-write-recheck','563212Djtcmc','Failed\x20to\x20','rawFlags','\x22,\x20not\x20folder.','expect-path','41184lSwaCG','menu_verification_failed','659267TRQmPk','length','menu_parent_not_folder','expect-parent-id','sort','Menu\x20','Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node','test','\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','\x20is\x20type\x20\x22','appCode','number','The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.','type','selector','Online\x20menu\x20state\x20changed\x20before\x20','read\x20online\x20menu\x20facts\x20before\x20','cookie','defineProperty','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','flagMissing','3264741OGoDsw','message','expected-children-count','Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.','recheck\x20online\x20menu\x20facts\x20before\x20','This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','validation','Cannot\x20append\x20a\x20','api_error','Exact\x20online\x20menu\x20id','menu_permission_denied','data','dry-run','max','num','operation','1554325jhUlmn','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','stringify','hint','map','yes','after','Reorder\x20sibling\x20menus\x20below\x20','snapshotHash','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20','succeeded','backend','isSafeInteger','menu_mutation_failed','string','str','menu_state_drift','\x20child\x20count\x20changed:\x20expected\x20','Permission\x20denied\x20while\x20attempting\x20to\x20','targets','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.','failedRecords','trim','menu_sort_overflow','cascade','code','warnings','get','2161uHDJYn','\x20parent\x20changed:\x20expected\x20','root'];a180_0x33b5=function(){return _0x50765b;};return a180_0x33b5();}export function requireExplicitYes(_0x5eb8b3){const _0x3fbc88=a180_0x5b5d4e;if(_0x5eb8b3['bool'](_0x3fbc88(0x24f)))return;if(!_0x5eb8b3[_0x3fbc88(0x220)](_0x3fbc88(0x1ee)))throw menuError(_0x3fbc88(0x218),_0x3fbc88(0x248),_0x3fbc88(0x224));}export async function fetchMutationSnapshot(_0x1ae542,_0x4f0f64,_0x23efd1){const _0x3b0c46=a180_0x5b5d4e;try{return await fetchMenuSnapshot(_0x1ae542[_0x3b0c46(0x238)],_0x1ae542[_0x3b0c46(0x23f)]);}catch(_0x5171e0){throw mapMenuApiError(_0x5171e0,_0x3b0c46(0x23e)+_0x4f0f64,_0x23efd1);}}export async function recheckMutationSnapshot(_0x2a0e28,_0x2ae07b,_0x17aea7,_0x598b7b){const _0x283390=a180_0x5b5d4e;let _0x47d54d;try{_0x47d54d=await fetchMenuSnapshot(_0x2a0e28[_0x283390(0x238)],_0x2a0e28[_0x283390(0x23f)]);}catch(_0x32279b){const _0x304e89=mapMenuApiError(_0x32279b,_0x283390(0x247)+_0x17aea7,_0x598b7b);throw menuFailure(_0x304e89,_0x2ae07b,{'stage':_0x283390(0x225),'failed':_0x598b7b==null?{}:{'id':_0x598b7b}});}if(_0x47d54d['hash']!==_0x2ae07b[_0x283390(0x1f1)]){const _0x162db0=menuError(_0x283390(0x1f9),_0x283390(0x23d)+_0x17aea7+_0x283390(0x223),_0x283390(0x21f));throw menuFailure(_0x162db0,_0x2ae07b,{'stage':_0x283390(0x225),'failed':{..._0x598b7b==null?{}:{'id':_0x598b7b},'expectedSnapshotHash':_0x2ae07b[_0x283390(0x1f1)],'currentSnapshotHash':_0x47d54d['hash']}});}return _0x47d54d;}export function parseParentId(_0x5b6fac,_0x5e4c9e,_0x4ac3b4={}){const _0x3c6806=a180_0x5b5d4e;if(!hasFlag(_0x5b6fac,_0x5e4c9e)){if(_0x4ac3b4['required'])throw CliErrors[_0x3c6806(0x242)](_0x5e4c9e);return undefined;}const _0x3e8ec5=_0x5b6fac[_0x3c6806(0x1f8)](_0x5e4c9e)[_0x3c6806(0x200)]();if(_0x3e8ec5['toLowerCase']()===_0x3c6806(0x208))return null;if(!/^\d+$/[_0x3c6806(0x234)](_0x3e8ec5))throw CliErrors[_0x3c6806(0x249)]('--'+_0x5e4c9e+_0x3c6806(0x1fd));const _0x4238e0=Number(_0x3e8ec5);if(!Number['isSafeInteger'](_0x4238e0)||_0x4238e0<=0x0)throw CliErrors[_0x3c6806(0x249)]('--'+_0x5e4c9e+'\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.');return _0x4238e0;}export function requireMenu(_0x377e9a,_0x13c384){const _0x2dbafe=a180_0x5b5d4e,_0x51dad6=_0x377e9a['byId'][_0x2dbafe(0x205)](_0x13c384);if(!_0x51dad6)throw menuError(_0x2dbafe(0x219),_0x2dbafe(0x20b)+_0x13c384,_0x2dbafe(0x221));return _0x51dad6;}export function requireFolder(_0x55d986,_0xb9b692){const _0x4c4f43=a180_0x5b5d4e,_0x48b51c=requireMenu(_0x55d986,_0xb9b692);if(_0x48b51c[_0x4c4f43(0x23b)]!==_0x4c4f43(0x20c))throw menuError(_0x4c4f43(0x22f),_0x4c4f43(0x232)+_0xb9b692+_0x4c4f43(0x237)+(_0x48b51c[_0x4c4f43(0x23b)]||_0x4c4f43(0x20d))+_0x4c4f43(0x229),_0x4c4f43(0x241));return _0x48b51c;}export function assertExpectedState(_0xb4b721,_0x47a05f){const _0x305973=a180_0x5b5d4e;if(hasFlag(_0xb4b721,'expect-parent-id')){const _0x2d5d6e=parseParentId(_0xb4b721,_0x305973(0x230),{'required':!![]});if(_0x47a05f['parentId']!==_0x2d5d6e)throw stateDrift(_0x305973(0x232)+_0x47a05f['id']+_0x305973(0x207)+formatParent(_0x2d5d6e)+_0x305973(0x209)+formatParent(_0x47a05f['parentId'])+'.');}if(hasFlag(_0xb4b721,_0x305973(0x22a))){const _0x393e49=_0xb4b721[_0x305973(0x1f8)](_0x305973(0x22a));if(_0x47a05f[_0x305973(0x211)]!==_0x393e49)throw stateDrift('Menu\x20'+_0x47a05f['id']+'\x20path\x20changed:\x20expected\x20'+JSON[_0x305973(0x1eb)](_0x393e49)+_0x305973(0x209)+JSON[_0x305973(0x1eb)](_0x47a05f[_0x305973(0x211)])+'.');}if(hasFlag(_0xb4b721,_0x305973(0x245))){const _0x461fcb=_0xb4b721[_0x305973(0x251)]('expected-children-count');if(!Number['isSafeInteger'](_0x461fcb)||_0x461fcb<0x0)throw CliErrors[_0x305973(0x249)](_0x305973(0x236));if(_0x47a05f[_0x305973(0x210)]!==_0x461fcb)throw stateDrift(_0x305973(0x232)+_0x47a05f['id']+_0x305973(0x1fa)+_0x461fcb+',\x20current\x20'+_0x47a05f[_0x305973(0x210)]+'.');}}export function assertVerified(_0x9465d3,_0x3bc726,_0x587de4='Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.'){if(!_0x9465d3)throw menuError('menu_verification_failed',_0x3bc726,_0x587de4);}export function mutationResult(_0x5206df){const _0x620fbb=a180_0x5b5d4e;return{'operation':_0x5206df[_0x620fbb(0x252)],'selector':_0x5206df[_0x620fbb(0x23c)],'before':_0x5206df['before'],'after':_0x5206df[_0x620fbb(0x1ef)],'dryRun':_0x5206df[_0x620fbb(0x21a)],'backend':_0x5206df[_0x620fbb(0x1f4)],..._0x5206df['plannedActions']?{'plannedActions':_0x5206df[_0x620fbb(0x214)]}:{},..._0x5206df['targets']?{'targets':_0x5206df[_0x620fbb(0x1fc)]}:{},..._0x5206df[_0x620fbb(0x21e)]?{'deleteOrder':_0x5206df[_0x620fbb(0x21e)]}:{},'snapshotHash':_0x5206df[_0x620fbb(0x1f1)],..._0x5206df[_0x620fbb(0x202)]?{'cascade':_0x5206df[_0x620fbb(0x202)]}:{},..._0x5206df['planFile']?{'planFile':_0x5206df['planFile']}:{},'succeeded':_0x5206df['succeeded']??[],'failed':_0x5206df['failed']??[],'warnings':_0x5206df[_0x620fbb(0x204)]??[],'verification':_0x5206df[_0x620fbb(0x212)],'error':_0x5206df['error']};}export function menuDryRunResult(_0x5b5cbb,_0x5b9b13){return{..._0x5b5cbb,..._0x5b9b13};}export function menuFailure(_0x172bd9,_0x1f115d,_0x12682a){const _0x4abf72=a180_0x5b5d4e,_0x56ecf1=mutationResult({..._0x1f115d,'after':_0x12682a['after']===undefined?_0x1f115d[_0x4abf72(0x1ef)]:_0x12682a[_0x4abf72(0x1ef)],'backend':_0x12682a['backend']??_0x1f115d[_0x4abf72(0x1f4)],'dryRun':![],'succeeded':_0x12682a[_0x4abf72(0x1f3)]??[],'failed':_0x12682a[_0x4abf72(0x1ff)]??[{..._0x12682a[_0x4abf72(0x20a)]??{},'stage':_0x12682a[_0x4abf72(0x20f)],'code':_0x172bd9[_0x4abf72(0x203)],'message':_0x172bd9[_0x4abf72(0x244)]}],'warnings':[..._0x1f115d[_0x4abf72(0x204)],..._0x12682a['warnings']??[]],'verification':_0x12682a[_0x4abf72(0x212)],'error':{'code':_0x172bd9[_0x4abf72(0x203)],'message':_0x172bd9[_0x4abf72(0x244)],..._0x172bd9['hint']?{'hint':_0x172bd9[_0x4abf72(0x1ec)]}:{}}});return Object[_0x4abf72(0x240)](_0x172bd9,_0x4abf72(0x24e),{'value':_0x56ecf1,'enumerable':!![],'configurable':!![]}),_0x172bd9;}function a180_0xc48a(_0x3db3dd,_0xd0ad36){_0x3db3dd=_0x3db3dd-0x1ea;const _0x33b572=a180_0x33b5();let _0xc48a3b=_0x33b572[_0x3db3dd];return _0xc48a3b;}export function asVerificationError(_0x58c2b6,_0xcf168d){const _0x3b8a57=a180_0x5b5d4e;if(_0x58c2b6 instanceof CliError&&_0x58c2b6[_0x3b8a57(0x203)]===_0x3b8a57(0x22c))return _0x58c2b6;const _0xf8d763=_0x58c2b6 instanceof Error?_0x58c2b6['message']:String(_0x58c2b6);return menuError(_0x3b8a57(0x22c),''+_0xcf168d+(_0xf8d763?':\x20'+_0xf8d763:''),_0x3b8a57(0x23a));}export function describeMenuErrorCause(_0x5f4d55,_0x1c838a,_0x1b6227){const _0x22b18e=a180_0x5b5d4e,_0x2d780d=mapMenuApiError(_0x5f4d55,_0x1c838a,_0x1b6227);return{'causeCode':_0x2d780d[_0x22b18e(0x203)],'causeMessage':_0x2d780d[_0x22b18e(0x244)]};}export function hasFlag(_0x8b6838,_0x2fddd2){const _0x24e948=a180_0x5b5d4e;return Object['prototype']['hasOwnProperty'][_0x24e948(0x20e)](_0x8b6838[_0x24e948(0x228)],_0x2fddd2)&&_0x8b6838[_0x24e948(0x228)][_0x2fddd2]!==undefined;}export function toApiParentId(_0xbaa6c2){return _0xbaa6c2??0x0;}export function formatParent(_0x4ead3a){return _0x4ead3a==null?'root':String(_0x4ead3a);}export function menuError(_0x479c2b,_0x4ee308,_0x42557e){return new CliError(_0x479c2b,0x1,_0x4ee308,_0x42557e);}export function mapMenuApiError(_0x4ed0ef,_0x3dc85e,_0x2b56d5){const _0x127c7b=a180_0x5b5d4e;if(_0x4ed0ef instanceof CliError&&_0x4ed0ef[_0x127c7b(0x203)]!==_0x127c7b(0x24b))return _0x4ed0ef;const _0x2d6f9f=_0x4ed0ef instanceof Error?_0x4ed0ef[_0x127c7b(0x244)]:String(_0x4ed0ef);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x127c7b(0x234)](_0x2d6f9f))return menuError(_0x127c7b(0x24d),_0x127c7b(0x1fb)+_0x3dc85e+(_0x2b56d5?_0x127c7b(0x216)+_0x2b56d5:'')+'.',_0x127c7b(0x1fe));return menuError(_0x127c7b(0x1f6),_0x127c7b(0x227)+_0x3dc85e+(_0x2b56d5?_0x127c7b(0x216)+_0x2b56d5:'')+':\x20'+_0x2d6f9f,_0x127c7b(0x246));}export function isMenuResponseLoss(_0x5a124c){const _0x9c2561=a180_0x5b5d4e,_0x3c9a71=_0x5a124c instanceof Error?_0x5a124c[_0x9c2561(0x244)]:String(_0x5a124c);if(_0x5a124c instanceof CliError)return _0x5a124c['code']==='api_error'&&/^Request (?:failed|timeout):/i[_0x9c2561(0x234)](_0x3c9a71);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i['test'](_0x3c9a71);}function stateDrift(_0x4d3f55){return menuError('menu_state_drift',_0x4d3f55,'Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.');}
@@ -1 +1 @@
1
- function a181_0xd3a1(_0x1866c5,_0x53751d){_0x1866c5=_0x1866c5-0x108;const _0x1dce1d=a181_0x1dce();let _0xd3a182=_0x1dce1d[_0x1866c5];return _0xd3a182;}function a181_0x1dce(){const _0x3d405c=['2141170MXOknA','5250707ZWDBOG','replace','1084GiscZv','156042fXtHRQ','1602054SiYrNh','6tOZWiB','26618iwwLAR','8mxQFBB','2892euaXGJ','65GwLcWM','13233jaSouA','12215ZsOSTb','trim'];a181_0x1dce=function(){return _0x3d405c;};return a181_0x1dce();}(function(_0x3c69e9,_0x4b2ef2){const _0x39dbaf=a181_0xd3a1,_0x6d2b9=_0x3c69e9();while(!![]){try{const _0x5b428c=-parseInt(_0x39dbaf(0x10b))/0x1*(-parseInt(_0x39dbaf(0x108))/0x2)+parseInt(_0x39dbaf(0x114))/0x3+-parseInt(_0x39dbaf(0x112))/0x4*(-parseInt(_0x39dbaf(0x10d))/0x5)+-parseInt(_0x39dbaf(0x115))/0x6*(parseInt(_0x39dbaf(0x110))/0x7)+-parseInt(_0x39dbaf(0x109))/0x8*(parseInt(_0x39dbaf(0x113))/0x9)+-parseInt(_0x39dbaf(0x10f))/0xa+-parseInt(_0x39dbaf(0x10c))/0xb*(parseInt(_0x39dbaf(0x10a))/0xc);if(_0x5b428c===_0x4b2ef2)break;else _0x6d2b9['push'](_0x6d2b9['shift']());}catch(_0x3cc46e){_0x6d2b9['push'](_0x6d2b9['shift']());}}}(a181_0x1dce,0xc0cad));export function menuPathKey(_0x18b8de){const _0x1608ff=a181_0xd3a1,_0x411e36=_0x18b8de[_0x1608ff(0x10e)]();if(!_0x411e36)return'';return _0x411e36['replace'](/^\/+/,'')[_0x1608ff(0x111)](/\/+$/,'')||'/';}
1
+ (function(_0x3a736c,_0x49dc4a){const _0x2799da=a181_0x3c3e,_0x1f86fe=_0x3a736c();while(!![]){try{const _0x435669=parseInt(_0x2799da(0xd9))/0x1*(-parseInt(_0x2799da(0xd3))/0x2)+-parseInt(_0x2799da(0xd1))/0x3+-parseInt(_0x2799da(0xd8))/0x4+parseInt(_0x2799da(0xd2))/0x5*(parseInt(_0x2799da(0xce))/0x6)+parseInt(_0x2799da(0xcd))/0x7+-parseInt(_0x2799da(0xd5))/0x8*(parseInt(_0x2799da(0xcf))/0x9)+-parseInt(_0x2799da(0xd4))/0xa*(-parseInt(_0x2799da(0xd6))/0xb);if(_0x435669===_0x49dc4a)break;else _0x1f86fe['push'](_0x1f86fe['shift']());}catch(_0x580069){_0x1f86fe['push'](_0x1f86fe['shift']());}}}(a181_0x832c,0xea9e0));function a181_0x3c3e(_0x5b979b,_0x1e9ffa){_0x5b979b=_0x5b979b-0xcd;const _0x832cda=a181_0x832c();let _0x3c3e5e=_0x832cda[_0x5b979b];return _0x3c3e5e;}function a181_0x832c(){const _0xdb8c8f=['2ejarNe','4024188iiSLsq','910494ErSJIV','7416PkSeMc','replace','1169328Mgrxke','15wDYEXQ','750154zDBdDz','230DWvXFf','8776AFlArd','1592987iesrys','trim','5424288HtoBUc'];a181_0x832c=function(){return _0xdb8c8f;};return a181_0x832c();}export function menuPathKey(_0x2eb90e){const _0x3a965=a181_0x3c3e,_0x5eb417=_0x2eb90e[_0x3a965(0xd7)]();if(!_0x5eb417)return'';return _0x5eb417['replace'](/^\/+/,'')[_0x3a965(0xd0)](/\/+$/,'')||'/';}
@@ -1 +1 @@
1
- (function(_0x1c3f03,_0x1e75fa){const _0x413540=a182_0x4b6c,_0x5953b9=_0x1c3f03();while(!![]){try{const _0x4b7012=parseInt(_0x413540(0x1a8))/0x1+-parseInt(_0x413540(0x1a9))/0x2*(parseInt(_0x413540(0x183))/0x3)+parseInt(_0x413540(0x19d))/0x4+parseInt(_0x413540(0x18f))/0x5*(parseInt(_0x413540(0x194))/0x6)+-parseInt(_0x413540(0x198))/0x7*(parseInt(_0x413540(0x18d))/0x8)+parseInt(_0x413540(0x189))/0x9*(parseInt(_0x413540(0x1ad))/0xa)+parseInt(_0x413540(0x1ab))/0xb*(-parseInt(_0x413540(0x1ac))/0xc);if(_0x4b7012===_0x1e75fa)break;else _0x5953b9['push'](_0x5953b9['shift']());}catch(_0x1942e4){_0x5953b9['push'](_0x5953b9['shift']());}}}(a182_0x4466,0x2696f));import{getEnv,isProduction}from'../../../constant/env.js';import{logger}from'../../../utils/logger.js';import{fetchMenuSnapshot,toProcessedMenuItem}from'../../../commands/menu/shared/facts.js';import{batchDeleteMenuRecords,createMenuRecord,startMenuRegroup as a182_0x214450,updateMenuRecord}from'../../../core/api-client.js';export async function getOnlineMenuList(_0x3d0617,_0x4e66d8){const _0x1e7fe5=a182_0x4b6c,_0x204339=getEnv();logger['info']('get-online-menu-list',isProduction(_0x204339)?_0x1e7fe5(0x192)+_0x3d0617+')':_0x1e7fe5(0x18b)+_0x3d0617+')');const _0x3ec37a=await fetchMenuSnapshot(_0x3d0617,_0x4e66d8,{'verbose':!![]});return logger[_0x1e7fe5(0x19b)]('get-online-menu-list',_0x1e7fe5(0x19f)+_0x3ec37a[_0x1e7fe5(0x1a4)]+'\x20online\x20menus\x20successfully'),_0x3ec37a['menus'][_0x1e7fe5(0x182)](toProcessedMenuItem);}export async function createMenu(_0x1b31a8,_0x5e5581,_0x3096c0){const _0x164456=a182_0x4b6c;logger[_0x164456(0x19b)](_0x164456(0x1a0),_0x164456(0x19c)+_0x3096c0[_0x164456(0x18c)]+'\x20('+_0x3096c0[_0x164456(0x19a)]+')');const _0x3c20e6={'appCode':_0x1b31a8,'type':_0x164456(0x1ae),'sort':0x0,'extend':{'loadScriptMode':'import','resources':_0x3096c0[_0x164456(0x185)]?JSON['stringify'](_0x3096c0[_0x164456(0x185)]):undefined},..._0x3096c0},_0x194e1f=await createMenuRecord(_0x3c20e6,_0x5e5581,_0x164456(0x186)+_0x3096c0[_0x164456(0x18c)]+'\x22');return logger[_0x164456(0x19b)](_0x164456(0x1a0),_0x164456(0x191)+_0x3096c0[_0x164456(0x18c)]),_0x194e1f;}async function createSingleMenu(_0x1a46e0,_0x39a682,_0x4cbb89,_0x554bb3,_0x14f91e){const _0x4abced=a182_0x4b6c,_0x24240f={'appCode':_0x1a46e0,'type':_0x4abced(0x1ae),'sort':_0x4abced(0x18a)in _0x4cbb89&&typeof _0x4cbb89[_0x4abced(0x18a)]===_0x4abced(0x1aa)?_0x4cbb89['order']:0x0,..._0x4abced(0x190)in _0x4cbb89&&typeof _0x4cbb89['visible']===_0x4abced(0x184)?{'visible':_0x4cbb89[_0x4abced(0x190)]}:{},..._0x4abced(0x196)in _0x4cbb89&&typeof _0x4cbb89[_0x4abced(0x196)]===_0x4abced(0x1aa)?{'parentId':_0x4cbb89[_0x4abced(0x196)]}:{},'extend':{..._0x14f91e?.[_0x4abced(0x1a7)]?{'appName':_0x14f91e[_0x4abced(0x1a7)]}:{},'loadScriptMode':'import','resources':_0x554bb3?JSON[_0x4abced(0x1a1)](_0x554bb3):undefined},'label':_0x4cbb89[_0x4abced(0x18c)],'path':_0x4cbb89[_0x4abced(0x19a)]},_0x2c5618=await createMenuRecord(_0x24240f,_0x39a682,_0x4abced(0x186)+_0x4cbb89[_0x4abced(0x18c)]+'\x22');return logger[_0x4abced(0x19b)]('create-menu',_0x4abced(0x191)+_0x4cbb89[_0x4abced(0x18c)]),_0x2c5618;}function a182_0x4b6c(_0x384d42,_0x2ed070){_0x384d42=_0x384d42-0x181;const _0x4466ce=a182_0x4466();let _0x4b6cb0=_0x4466ce[_0x384d42];return _0x4b6cb0;}function a182_0x4466(){const _0x458cf7=['Creating\x20menu:\x20','412244rHEjbh','Regroup\x20','Fetched\x20','create-menu','stringify','menuGroups','Start\x20batch\x20menu\x20creation,\x20total\x20','total','Update\x20menu\x20','loadScriptMode','appName','200585olQjtM','171398mUXZdJ','number','11TjmFNz','3094536OfcQLs','10KUHcZr','procode','Menu\x20assets\x20synced:\x20','map','3BpySoU','boolean','resources','Create\x20menu\x20\x22','create-menus','Delete\x20','680337USPzTB','order','Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20','label','8XmDUCc','\x20menu\x20group(s)','201010CdYHNm','visible','Menu\x20created\x20successfully:\x20','Fetching\x20online\x20menu\x20list...\x20(appCode:\x20','Update\x20menu\x20assets\x20\x22','42nbjXdH','update-menu-cdn-url','parentId','\x20menu','1113091nSVCQT','length','path','info'];a182_0x4466=function(){return _0x458cf7;};return a182_0x4466();}export async function createMenus(_0x3f2b80,_0x4c272f,_0x2eaabf,_0x835f25,_0x2c7318){const _0x2a305a=a182_0x4b6c;logger[_0x2a305a(0x19b)](_0x2a305a(0x187),_0x2a305a(0x1a3)+_0x2eaabf[_0x2a305a(0x199)]);const _0x3e8753=await Promise['all'](_0x2eaabf[_0x2a305a(0x182)](_0x3ce9e5=>createSingleMenu(_0x3f2b80,_0x4c272f,_0x3ce9e5,_0x835f25,_0x2c7318)));return logger[_0x2a305a(0x19b)]('create-menus','Batch\x20menu\x20creation\x20completed,\x20total\x20'+_0x2eaabf[_0x2a305a(0x199)]),_0x3e8753;}export async function updateMenuCdnUrl(_0x3ecf87,_0x55d432,_0x5595d1){const _0x235050=a182_0x4b6c;logger[_0x235050(0x19b)](_0x235050(0x195),'Updating\x20menu\x20asset\x20links:\x20'+_0x5595d1['label']+'\x20('+_0x5595d1[_0x235050(0x19a)]+')');const _0x8d4127={'id':_0x5595d1['id'],'appCode':_0x3ecf87,'extend':{..._0x5595d1['extend']??{},..._0x5595d1[_0x235050(0x1a6)]?{'loadScriptMode':_0x5595d1[_0x235050(0x1a6)]}:{},'resources':_0x5595d1[_0x235050(0x185)]?JSON[_0x235050(0x1a1)](_0x5595d1[_0x235050(0x185)]):undefined}},_0x8fac54=await updateMenuRecord(_0x8d4127,_0x55d432,_0x235050(0x193)+_0x5595d1[_0x235050(0x18c)]+'\x22');return logger[_0x235050(0x19b)](_0x235050(0x195),_0x235050(0x181)+_0x5595d1[_0x235050(0x18c)],undefined),_0x8fac54;}export async function createMenuEntity(_0x1ada54,_0x141a29,_0x215073){const _0x32726b=a182_0x4b6c;return createMenuRecord({'appCode':_0x1ada54,..._0x215073},_0x141a29,_0x32726b(0x186)+_0x215073[_0x32726b(0x18c)]+'\x22');}export async function updateMenuEntity(_0x30f6a0,_0x1dc678,_0x32486f){const _0x52bf89=a182_0x4b6c;return updateMenuRecord({'appCode':_0x30f6a0,..._0x32486f},_0x1dc678,_0x52bf89(0x1a5)+_0x32486f['id']);}export async function batchDeleteMenuEntities(_0x273dc7,_0x613a9f){const _0x846aaf=a182_0x4b6c;return batchDeleteMenuRecords(_0x613a9f,_0x273dc7,_0x846aaf(0x188)+_0x613a9f[_0x846aaf(0x199)]+_0x846aaf(0x197)+(_0x613a9f[_0x846aaf(0x199)]===0x1?'':'s'));}export async function startMenuRegroup(_0x5b663c,_0xdff7e2){const _0x4a22ca=a182_0x4b6c;return a182_0x214450(_0xdff7e2,_0x5b663c,_0x4a22ca(0x19e)+_0xdff7e2[_0x4a22ca(0x1a2)][_0x4a22ca(0x199)]+_0x4a22ca(0x18e));}
1
+ (function(_0x1c6a78,_0x4f1051){const _0x40be65=a182_0x4ca2,_0x4dd465=_0x1c6a78();while(!![]){try{const _0x30921b=-parseInt(_0x40be65(0x11c))/0x1+parseInt(_0x40be65(0x127))/0x2*(parseInt(_0x40be65(0x10c))/0x3)+-parseInt(_0x40be65(0x136))/0x4+parseInt(_0x40be65(0x137))/0x5+-parseInt(_0x40be65(0x128))/0x6*(-parseInt(_0x40be65(0x12d))/0x7)+parseInt(_0x40be65(0x113))/0x8+parseInt(_0x40be65(0x126))/0x9*(parseInt(_0x40be65(0x12b))/0xa);if(_0x30921b===_0x4f1051)break;else _0x4dd465['push'](_0x4dd465['shift']());}catch(_0x39ac5f){_0x4dd465['push'](_0x4dd465['shift']());}}}(a182_0x2b70,0x559d9));import{getEnv,isProduction}from'../../../constant/env.js';import{logger}from'../../../utils/logger.js';import{fetchMenuSnapshot,toProcessedMenuItem}from'../../../commands/menu/shared/facts.js';import{batchDeleteMenuRecords,createMenuRecord,startMenuRegroup as a182_0x1ba4dc,updateMenuRecord}from'../../../core/api-client.js';function a182_0x2b70(){const _0x4d4d95=['54pupdiz','stringify','Regroup\x20','1035570NKmavL','import','152271iCEhFE','length','appName','Update\x20menu\x20assets\x20\x22','order','Fetched\x20','Batch\x20menu\x20creation\x20completed,\x20total\x20','\x20online\x20menus\x20successfully','loadScriptMode','895000aGmazq','1323735ehzMAW','\x20menu','path','Menu\x20assets\x20synced:\x20','Updating\x20menu\x20asset\x20links:\x20','info','2145BxXXJF','boolean','Menu\x20created\x20successfully:\x20','Fetching\x20online\x20menu\x20list...\x20(appCode:\x20','map','procode','\x20menu\x20group(s)','2118768bHYySd','resources','parentId','update-menu-cdn-url','menuGroups','extend','menus','label','Delete\x20','494021WjWzxP','create-menu','Create\x20menu\x20\x22','visible','Creating\x20menu:\x20','all','total','Start\x20batch\x20menu\x20creation,\x20total\x20','number','get-online-menu-list','9SxwxkB','670kYdRZb'];a182_0x2b70=function(){return _0x4d4d95;};return a182_0x2b70();}export async function getOnlineMenuList(_0x429169,_0xf6fa56){const _0x35c6b1=a182_0x4ca2,_0x88b7bc=getEnv();logger[_0x35c6b1(0x10b)](_0x35c6b1(0x125),isProduction(_0x88b7bc)?_0x35c6b1(0x10f)+_0x429169+')':'Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20'+_0x429169+')');const _0x3538b3=await fetchMenuSnapshot(_0x429169,_0xf6fa56,{'verbose':!![]});return logger[_0x35c6b1(0x10b)](_0x35c6b1(0x125),_0x35c6b1(0x132)+_0x3538b3[_0x35c6b1(0x122)]+_0x35c6b1(0x134)),_0x3538b3[_0x35c6b1(0x119)][_0x35c6b1(0x110)](toProcessedMenuItem);}export async function createMenu(_0x2c2cd1,_0x1c7e16,_0x35a0d0){const _0x20a468=a182_0x4ca2;logger['info'](_0x20a468(0x11d),_0x20a468(0x120)+_0x35a0d0[_0x20a468(0x11a)]+'\x20('+_0x35a0d0[_0x20a468(0x108)]+')');const _0x238ad8={'appCode':_0x2c2cd1,'type':_0x20a468(0x111),'sort':0x0,'extend':{'loadScriptMode':_0x20a468(0x12c),'resources':_0x35a0d0[_0x20a468(0x114)]?JSON[_0x20a468(0x129)](_0x35a0d0[_0x20a468(0x114)]):undefined},..._0x35a0d0},_0x7a7dbb=await createMenuRecord(_0x238ad8,_0x1c7e16,_0x20a468(0x11e)+_0x35a0d0[_0x20a468(0x11a)]+'\x22');return logger[_0x20a468(0x10b)](_0x20a468(0x11d),_0x20a468(0x10e)+_0x35a0d0[_0x20a468(0x11a)]),_0x7a7dbb;}async function createSingleMenu(_0x22b381,_0x3984ab,_0x26f90f,_0x3a8c4d,_0x4d83a3){const _0x2fa66a=a182_0x4ca2,_0x184a5e={'appCode':_0x22b381,'type':_0x2fa66a(0x111),'sort':'order'in _0x26f90f&&typeof _0x26f90f[_0x2fa66a(0x131)]===_0x2fa66a(0x124)?_0x26f90f['order']:0x0,..._0x2fa66a(0x11f)in _0x26f90f&&typeof _0x26f90f[_0x2fa66a(0x11f)]===_0x2fa66a(0x10d)?{'visible':_0x26f90f['visible']}:{},...'parentId'in _0x26f90f&&typeof _0x26f90f['parentId']===_0x2fa66a(0x124)?{'parentId':_0x26f90f[_0x2fa66a(0x115)]}:{},'extend':{..._0x4d83a3?.[_0x2fa66a(0x12f)]?{'appName':_0x4d83a3['appName']}:{},'loadScriptMode':_0x2fa66a(0x12c),'resources':_0x3a8c4d?JSON[_0x2fa66a(0x129)](_0x3a8c4d):undefined},'label':_0x26f90f[_0x2fa66a(0x11a)],'path':_0x26f90f[_0x2fa66a(0x108)]},_0x30dcc2=await createMenuRecord(_0x184a5e,_0x3984ab,_0x2fa66a(0x11e)+_0x26f90f[_0x2fa66a(0x11a)]+'\x22');return logger[_0x2fa66a(0x10b)](_0x2fa66a(0x11d),_0x2fa66a(0x10e)+_0x26f90f[_0x2fa66a(0x11a)]),_0x30dcc2;}function a182_0x4ca2(_0x46d886,_0x17a6a3){_0x46d886=_0x46d886-0x107;const _0x2b7069=a182_0x2b70();let _0x4ca25d=_0x2b7069[_0x46d886];return _0x4ca25d;}export async function createMenus(_0xd0c629,_0x14729d,_0x3153d4,_0x6c5261,_0x4c5654){const _0x455087=a182_0x4ca2;logger[_0x455087(0x10b)]('create-menus',_0x455087(0x123)+_0x3153d4[_0x455087(0x12e)]);const _0x883172=await Promise[_0x455087(0x121)](_0x3153d4[_0x455087(0x110)](_0x4fd962=>createSingleMenu(_0xd0c629,_0x14729d,_0x4fd962,_0x6c5261,_0x4c5654)));return logger[_0x455087(0x10b)]('create-menus',_0x455087(0x133)+_0x3153d4[_0x455087(0x12e)]),_0x883172;}export async function updateMenuCdnUrl(_0x32f0e6,_0x15b208,_0x4f30e9){const _0x5861ec=a182_0x4ca2;logger['info']('update-menu-cdn-url',_0x5861ec(0x10a)+_0x4f30e9['label']+'\x20('+_0x4f30e9[_0x5861ec(0x108)]+')');const _0x3c83cf={'id':_0x4f30e9['id'],'appCode':_0x32f0e6,'extend':{..._0x4f30e9[_0x5861ec(0x118)]??{},..._0x4f30e9[_0x5861ec(0x135)]?{'loadScriptMode':_0x4f30e9[_0x5861ec(0x135)]}:{},'resources':_0x4f30e9[_0x5861ec(0x114)]?JSON[_0x5861ec(0x129)](_0x4f30e9['resources']):undefined}},_0x343f54=await updateMenuRecord(_0x3c83cf,_0x15b208,_0x5861ec(0x130)+_0x4f30e9[_0x5861ec(0x11a)]+'\x22');return logger[_0x5861ec(0x10b)](_0x5861ec(0x116),_0x5861ec(0x109)+_0x4f30e9[_0x5861ec(0x11a)],undefined),_0x343f54;}export async function createMenuEntity(_0x929615,_0x4b2cb6,_0x3066c2){const _0x18e8ad=a182_0x4ca2;return createMenuRecord({'appCode':_0x929615,..._0x3066c2},_0x4b2cb6,_0x18e8ad(0x11e)+_0x3066c2[_0x18e8ad(0x11a)]+'\x22');}export async function updateMenuEntity(_0x57ab6f,_0xa8d504,_0x3281c){return updateMenuRecord({'appCode':_0x57ab6f,..._0x3281c},_0xa8d504,'Update\x20menu\x20'+_0x3281c['id']);}export async function batchDeleteMenuEntities(_0x4d8ae7,_0x5d2a3b){const _0x1a0c7f=a182_0x4ca2;return batchDeleteMenuRecords(_0x5d2a3b,_0x4d8ae7,_0x1a0c7f(0x11b)+_0x5d2a3b[_0x1a0c7f(0x12e)]+_0x1a0c7f(0x107)+(_0x5d2a3b['length']===0x1?'':'s'));}export async function startMenuRegroup(_0x2972e9,_0x476aba){const _0x13e390=a182_0x4ca2;return a182_0x1ba4dc(_0x476aba,_0x2972e9,_0x13e390(0x12a)+_0x476aba[_0x13e390(0x117)][_0x13e390(0x12e)]+_0x13e390(0x112));}
@@ -1 +1 @@
1
- const a183_0x740e75=a183_0x3a82;(function(_0x4713eb,_0x32b7fe){const _0x24faa0=a183_0x3a82,_0x2d4940=_0x4713eb();while(!![]){try{const _0x259a3b=-parseInt(_0x24faa0(0x190))/0x1*(-parseInt(_0x24faa0(0x199))/0x2)+parseInt(_0x24faa0(0x19c))/0x3+-parseInt(_0x24faa0(0x1ac))/0x4*(parseInt(_0x24faa0(0x198))/0x5)+parseInt(_0x24faa0(0x1af))/0x6+-parseInt(_0x24faa0(0x192))/0x7+parseInt(_0x24faa0(0x19a))/0x8+-parseInt(_0x24faa0(0x1a1))/0x9*(-parseInt(_0x24faa0(0x1a6))/0xa);if(_0x259a3b===_0x32b7fe)break;else _0x2d4940['push'](_0x2d4940['shift']());}catch(_0x36b169){_0x2d4940['push'](_0x2d4940['shift']());}}}(a183_0x3e79,0x479f1));import{getSmartAppRecord}from'../../../core/api-client.js';import{APPCODE_FLAG}from'../../../commands/common/flags.js';function a183_0x3a82(_0x46f7f6,_0x2472bb){_0x46f7f6=_0x46f7f6-0x185;const _0x3e79e6=a183_0x3e79();let _0x3a826f=_0x3e79e6[_0x46f7f6];return _0x3a826f;}function a183_0x3e79(){const _0x21246d=['No\x20shared\x20resources\x20configured\x20for\x20','3213847KuRBXv','parse','basename','app.extend.assets[','appCode','app-name','83145mpSnzG','2tCvAdl','570736vBwlxj','app.extend.assets','259086rRSKlp','app.extend.assets\x20must\x20be\x20an\x20array.','validation','sharedConfigured','filter','9vcXqAh','path','trim','appName','message','6104090AMWwJh','\x20resources','str','stringify','string','object','24YCfrjQ','app','length','407310NvJGRm','map','extend','menu\x20','app.extend','assets','isArray','\x20must\x20be\x20an\x20array\x20of\x20URLs.','subapp.resources','menu','\x20must\x20be\x20a\x20JSON\x20object.','resources','16258bbbBSo'];a183_0x3e79=function(){return _0x21246d;};return a183_0x3e79();}import{CliErrors}from'../../../errors.js';function objectValue(_0x14ddad,_0x20c812){const _0x170073=a183_0x3a82,_0x12ed9d=typeof _0x14ddad===_0x170073(0x1aa)?parseJson(_0x14ddad,_0x20c812):_0x14ddad;if(!_0x12ed9d||typeof _0x12ed9d!==_0x170073(0x1ab)||Array[_0x170073(0x18a)](_0x12ed9d))throw CliErrors[_0x170073(0x19e)](_0x20c812+_0x170073(0x18e));return _0x12ed9d;}function parseJson(_0x5125cc,_0x92540a){const _0x47153a=a183_0x3a82;try{return JSON[_0x47153a(0x193)](_0x5125cc);}catch{throw CliErrors['validation'](_0x92540a+'\x20contains\x20invalid\x20JSON.');}}function resourceList(_0x2f97f4,_0x29adb2){const _0x424c06=a183_0x3a82;if(typeof _0x2f97f4!==_0x424c06(0x1aa))throw CliErrors['validation'](_0x29adb2+'\x20must\x20be\x20a\x20JSON\x20string\x20of\x20URLs.');const _0x4807b7=parseJson(_0x2f97f4,_0x29adb2);if(!Array['isArray'](_0x4807b7)||_0x4807b7['some'](_0x2b0c65=>typeof _0x2b0c65!==_0x424c06(0x1aa)))throw CliErrors[_0x424c06(0x19e)](_0x29adb2+_0x424c06(0x18b));return _0x4807b7;}export function buildSubappAssetsStatus(_0x279c00,_0x356030,_0x2a60e7){const _0x2dc17a=a183_0x3a82,_0x1e5897=_0x279c00['extend']==null?{}:objectValue(_0x279c00['extend'],_0x2dc17a(0x188)),_0x4b63ec=_0x1e5897['assets']==null?[]:typeof _0x1e5897[_0x2dc17a(0x189)]===_0x2dc17a(0x1aa)?parseJson(_0x1e5897['assets'],_0x2dc17a(0x19b)):_0x1e5897[_0x2dc17a(0x189)];if(!Array[_0x2dc17a(0x18a)](_0x4b63ec))throw CliErrors[_0x2dc17a(0x19e)](_0x2dc17a(0x19d));const _0x1dff1b=_0x4b63ec[_0x2dc17a(0x185)]((_0xbf733f,_0x555339)=>objectValue(_0xbf733f,_0x2dc17a(0x195)+_0x555339+']')),_0x58252d=_0x1dff1b['filter'](_0x1db98d=>_0x1db98d[_0x2dc17a(0x1a4)]===_0x2a60e7);if(_0x58252d[_0x2dc17a(0x1ae)]>0x1)throw CliErrors['validation']('Duplicate\x20subapp\x20records\x20for\x20'+_0x2a60e7+'.');const _0x29de8b=_0x58252d[0x0],_0x4a6b59=_0x29de8b?.['resources']==null?[]:resourceList(_0x29de8b[_0x2dc17a(0x18f)],_0x2dc17a(0x18c)),_0x4eb1b4=_0x356030[_0x2dc17a(0x1a0)](_0x348094=>_0x348094[_0x2dc17a(0x186)]?.[_0x2dc17a(0x1a4)]===_0x2a60e7),_0x3b8f36=_0x4eb1b4[_0x2dc17a(0x185)](_0x292d7f=>{const _0x425acc=_0x2dc17a;let _0x558eab=null,_0x522c89=null;try{_0x558eab=_0x292d7f[_0x425acc(0x186)]?.[_0x425acc(0x18f)]==null?_0x292d7f[_0x425acc(0x18f)]:resourceList(_0x292d7f['extend']['resources'],_0x425acc(0x187)+_0x292d7f['id']+_0x425acc(0x1a7));}catch(_0x433523){_0x522c89=_0x433523 instanceof Error?_0x433523[_0x425acc(0x1a5)]:String(_0x433523);}const _0x478943=_0x4a6b59[_0x425acc(0x1ae)]>0x0?_0x425acc(0x1ad):_0x425acc(0x18d),_0x3f7d91=_0x478943==='app'?_0x4a6b59:_0x558eab;return{'id':_0x292d7f['id'],'path':_0x292d7f[_0x425acc(0x1a2)],'preferredSourceIfSupported':_0x478943,'preferredResourcesIfSupported':_0x3f7d91,'menuFallbackResources':_0x558eab,'menuFallbackError':_0x522c89,'fallbackDiffers':_0x558eab===null?null:_0x478943===_0x425acc(0x1ad)&&_0x558eab[_0x425acc(0x1ae)]>0x0&&JSON[_0x425acc(0x1a9)](_0x558eab)!==JSON['stringify'](_0x3f7d91)};});return{'appName':_0x2a60e7,'hostCapabilityVerified':![],'sharedConfigured':Boolean(_0x29de8b),'sharedResources':_0x4a6b59,'loadScriptMode':_0x29de8b?.['loadScriptMode']??null,'basename':_0x29de8b?.[_0x2dc17a(0x194)]??null,'boundMenus':_0x3b8f36[_0x2dc17a(0x1ae)],'staleMenuFallbacks':_0x3b8f36[_0x2dc17a(0x1a0)](_0x22e171=>_0x22e171['fallbackDiffers'])[_0x2dc17a(0x1ae)],'menus':_0x3b8f36};}export async function assertSharedResourcesConfigured(_0x25f942,_0x30665e,_0x11f172){const _0x3ef424=a183_0x3a82,_0x23f762=await getSmartAppRecord(_0x25f942,_0x30665e),_0x138ac2=buildSubappAssetsStatus(_0x23f762,[],_0x11f172);if(!_0x138ac2[_0x3ef424(0x19f)]||_0x138ac2['sharedResources'][_0x3ef424(0x1ae)]===0x0)throw CliErrors[_0x3ef424(0x19e)](_0x3ef424(0x191)+_0x11f172+'.');}export const SUBAPP_ASSET_SELECTOR_FLAGS=[{...APPCODE_FLAG,'required':![],'description':'Menu\x20host\x20app\x20code;\x20overrides\x20the\x20selected\x20workspace\x20app'},{'name':a183_0x740e75(0x197),'type':a183_0x740e75(0x1aa),'required':!![],'description':'Explicit\x20frontend\x20subapp\x20appName\x20matching\x20host\x20assets\x20and\x20menu\x20bindings;\x20not\x20inferred\x20from\x20package\x20name\x20or\x20app\x20code'}];export function getSubappSelector(_0x217e4f){const _0x1267fc=a183_0x740e75,_0x4fc074=_0x217e4f[_0x1267fc(0x196)],_0x5ecf68=_0x217e4f[_0x1267fc(0x1a8)](_0x1267fc(0x197))[_0x1267fc(0x1a3)]();if(!_0x5ecf68)throw CliErrors[_0x1267fc(0x19e)]('--app-name\x20is\x20required.');return{'appCode':_0x4fc074,'appName':_0x5ecf68};}
1
+ const a183_0x10fc45=a183_0x47d5;(function(_0x11788f,_0x32b862){const _0x2aeff9=a183_0x47d5,_0x29172c=_0x11788f();while(!![]){try{const _0x29767f=parseInt(_0x2aeff9(0xc1))/0x1+-parseInt(_0x2aeff9(0xb2))/0x2*(parseInt(_0x2aeff9(0xbd))/0x3)+-parseInt(_0x2aeff9(0xac))/0x4+parseInt(_0x2aeff9(0xb3))/0x5+parseInt(_0x2aeff9(0xad))/0x6*(parseInt(_0x2aeff9(0xab))/0x7)+parseInt(_0x2aeff9(0xc5))/0x8+parseInt(_0x2aeff9(0xa8))/0x9*(parseInt(_0x2aeff9(0xbf))/0xa);if(_0x29767f===_0x32b862)break;else _0x29172c['push'](_0x29172c['shift']());}catch(_0x560074){_0x29172c['push'](_0x29172c['shift']());}}}(a183_0x2388,0x8d316));import{getSmartAppRecord}from'../../../core/api-client.js';import{APPCODE_FLAG}from'../../../commands/common/flags.js';import{CliErrors}from'../../../errors.js';function objectValue(_0x2d2764,_0x4c8fe0){const _0xb5fa70=a183_0x47d5,_0x2778f1=typeof _0x2d2764===_0xb5fa70(0xa5)?parseJson(_0x2d2764,_0x4c8fe0):_0x2d2764;if(!_0x2778f1||typeof _0x2778f1!==_0xb5fa70(0xc7)||Array[_0xb5fa70(0xc0)](_0x2778f1))throw CliErrors[_0xb5fa70(0xb0)](_0x4c8fe0+'\x20must\x20be\x20a\x20JSON\x20object.');return _0x2778f1;}function parseJson(_0x19fa73,_0xa11048){const _0x588fa1=a183_0x47d5;try{return JSON[_0x588fa1(0xa7)](_0x19fa73);}catch{throw CliErrors[_0x588fa1(0xb0)](_0xa11048+'\x20contains\x20invalid\x20JSON.');}}function resourceList(_0x1c36ea,_0x18e4fa){const _0x5b63c7=a183_0x47d5;if(typeof _0x1c36ea!=='string')throw CliErrors['validation'](_0x18e4fa+_0x5b63c7(0xc8));const _0xb95dcb=parseJson(_0x1c36ea,_0x18e4fa);if(!Array['isArray'](_0xb95dcb)||_0xb95dcb[_0x5b63c7(0xbe)](_0x1f012b=>typeof _0x1f012b!==_0x5b63c7(0xa5)))throw CliErrors[_0x5b63c7(0xb0)](_0x18e4fa+_0x5b63c7(0xc9));return _0xb95dcb;}export function buildSubappAssetsStatus(_0x2f350e,_0x164225,_0x48975a){const _0xf5ad6f=a183_0x47d5,_0x5a1015=_0x2f350e[_0xf5ad6f(0xb9)]==null?{}:objectValue(_0x2f350e[_0xf5ad6f(0xb9)],'app.extend'),_0x2606c2=_0x5a1015[_0xf5ad6f(0xb1)]==null?[]:typeof _0x5a1015['assets']===_0xf5ad6f(0xa5)?parseJson(_0x5a1015[_0xf5ad6f(0xb1)],'app.extend.assets'):_0x5a1015[_0xf5ad6f(0xb1)];if(!Array[_0xf5ad6f(0xc0)](_0x2606c2))throw CliErrors[_0xf5ad6f(0xb0)](_0xf5ad6f(0xba));const _0x40d88d=_0x2606c2['map']((_0x48c837,_0x280518)=>objectValue(_0x48c837,'app.extend.assets['+_0x280518+']')),_0x474c84=_0x40d88d['filter'](_0x23d0c3=>_0x23d0c3['appName']===_0x48975a);if(_0x474c84['length']>0x1)throw CliErrors['validation'](_0xf5ad6f(0xbb)+_0x48975a+'.');const _0x18f14f=_0x474c84[0x0],_0x1ee7bf=_0x18f14f?.[_0xf5ad6f(0xa6)]==null?[]:resourceList(_0x18f14f[_0xf5ad6f(0xa6)],_0xf5ad6f(0xaf)),_0x1feed1=_0x164225[_0xf5ad6f(0xcc)](_0x5acf9c=>_0x5acf9c[_0xf5ad6f(0xb9)]?.[_0xf5ad6f(0xa4)]===_0x48975a),_0x9e7d28=_0x1feed1['map'](_0x2560f1=>{const _0x4ed2af=_0xf5ad6f;let _0x45ace0=null,_0x277c29=null;try{_0x45ace0=_0x2560f1[_0x4ed2af(0xb9)]?.[_0x4ed2af(0xa6)]==null?_0x2560f1[_0x4ed2af(0xa6)]:resourceList(_0x2560f1[_0x4ed2af(0xb9)][_0x4ed2af(0xa6)],_0x4ed2af(0xb4)+_0x2560f1['id']+'\x20resources');}catch(_0x5dc468){_0x277c29=_0x5dc468 instanceof Error?_0x5dc468[_0x4ed2af(0xb6)]:String(_0x5dc468);}const _0x209bd8=_0x1ee7bf[_0x4ed2af(0xa9)]>0x0?_0x4ed2af(0xae):_0x4ed2af(0xa3),_0x3c6cbb=_0x209bd8==='app'?_0x1ee7bf:_0x45ace0;return{'id':_0x2560f1['id'],'path':_0x2560f1[_0x4ed2af(0xa2)],'preferredSourceIfSupported':_0x209bd8,'preferredResourcesIfSupported':_0x3c6cbb,'menuFallbackResources':_0x45ace0,'menuFallbackError':_0x277c29,'fallbackDiffers':_0x45ace0===null?null:_0x209bd8===_0x4ed2af(0xae)&&_0x45ace0['length']>0x0&&JSON[_0x4ed2af(0xc4)](_0x45ace0)!==JSON[_0x4ed2af(0xc4)](_0x3c6cbb)};});return{'appName':_0x48975a,'hostCapabilityVerified':![],'sharedConfigured':Boolean(_0x18f14f),'sharedResources':_0x1ee7bf,'loadScriptMode':_0x18f14f?.[_0xf5ad6f(0xc6)]??null,'basename':_0x18f14f?.[_0xf5ad6f(0xc2)]??null,'boundMenus':_0x9e7d28['length'],'staleMenuFallbacks':_0x9e7d28[_0xf5ad6f(0xcc)](_0x2c2b92=>_0x2c2b92[_0xf5ad6f(0xca)])[_0xf5ad6f(0xa9)],'menus':_0x9e7d28};}function a183_0x47d5(_0xc71412,_0x3786e1){_0xc71412=_0xc71412-0xa1;const _0x238838=a183_0x2388();let _0x47d563=_0x238838[_0xc71412];return _0x47d563;}export async function assertSharedResourcesConfigured(_0x1c20a0,_0x4d592d,_0x2725d0){const _0x1cee57=a183_0x47d5,_0x2a9146=await getSmartAppRecord(_0x1c20a0,_0x4d592d),_0x2d0061=buildSubappAssetsStatus(_0x2a9146,[],_0x2725d0);if(!_0x2d0061[_0x1cee57(0xb7)]||_0x2d0061[_0x1cee57(0xcb)][_0x1cee57(0xa9)]===0x0)throw CliErrors[_0x1cee57(0xb0)]('No\x20shared\x20resources\x20configured\x20for\x20'+_0x2725d0+'.');}export const SUBAPP_ASSET_SELECTOR_FLAGS=[{...APPCODE_FLAG,'required':![],'description':a183_0x10fc45(0xbc)},{'name':a183_0x10fc45(0xaa),'type':'string','required':!![],'description':a183_0x10fc45(0xb5)}];function a183_0x2388(){const _0x9e4280=['Menu\x20host\x20app\x20code;\x20overrides\x20the\x20selected\x20workspace\x20app','175692jKgtBr','some','2190IzMvRl','isArray','91758JmSyEC','basename','str','stringify','4092408VvVqVW','loadScriptMode','object','\x20must\x20be\x20a\x20JSON\x20string\x20of\x20URLs.','\x20must\x20be\x20an\x20array\x20of\x20URLs.','fallbackDiffers','sharedResources','filter','appCode','path','menu','appName','string','resources','parse','27108KoVhdN','length','app-name','49DZyjNn','3066084NjJzGx','494850MhclZc','app','subapp.resources','validation','assets','38sTBSbd','3086505CXlCtV','menu\x20','Explicit\x20frontend\x20subapp\x20appName\x20matching\x20host\x20assets\x20and\x20menu\x20bindings;\x20not\x20inferred\x20from\x20package\x20name\x20or\x20app\x20code','message','sharedConfigured','trim','extend','app.extend.assets\x20must\x20be\x20an\x20array.','Duplicate\x20subapp\x20records\x20for\x20'];a183_0x2388=function(){return _0x9e4280;};return a183_0x2388();}export function getSubappSelector(_0x288b2f){const _0x59d122=a183_0x10fc45,_0x4d823e=_0x288b2f[_0x59d122(0xa1)],_0x2cb383=_0x288b2f[_0x59d122(0xc3)](_0x59d122(0xaa))[_0x59d122(0xb8)]();if(!_0x2cb383)throw CliErrors[_0x59d122(0xb0)]('--app-name\x20is\x20required.');return{'appCode':_0x4d823e,'appName':_0x2cb383};}
@@ -1 +1 @@
1
- const a184_0xbbcf83=a184_0x2dd4;(function(_0x4778a4,_0x63ff49){const _0x361f31=a184_0x2dd4,_0x23e3d5=_0x4778a4();while(!![]){try{const _0xbbe445=parseInt(_0x361f31(0xc8))/0x1*(-parseInt(_0x361f31(0xdb))/0x2)+-parseInt(_0x361f31(0xc7))/0x3*(-parseInt(_0x361f31(0xd9))/0x4)+-parseInt(_0x361f31(0xab))/0x5*(parseInt(_0x361f31(0xd2))/0x6)+parseInt(_0x361f31(0xc6))/0x7+parseInt(_0x361f31(0xc3))/0x8*(-parseInt(_0x361f31(0xa9))/0x9)+parseInt(_0x361f31(0xb3))/0xa+parseInt(_0x361f31(0xd0))/0xb;if(_0xbbe445===_0x63ff49)break;else _0x23e3d5['push'](_0x23e3d5['shift']());}catch(_0x278b72){_0x23e3d5['push'](_0x23e3d5['shift']());}}}(a184_0x5d5c,0x5f7d3));function a184_0x2dd4(_0x467c50,_0x479b41){_0x467c50=_0x467c50-0xa3;const _0x5d5c2b=a184_0x5d5c();let _0x2dd4d2=_0x5d5c2b[_0x467c50];return _0x2dd4d2;}import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';function a184_0x5d5c(){const _0x1621a0=['Invalid\x20--params.parentId:\x20expected\x20a\x20non-negative\x20integer.','Invalid\x20--params.visible:\x20expected\x20a\x20boolean.','path','Invalid\x20--params\x20JSON.','\x20must\x20be\x20an\x20existing\x20folder\x20in\x20the\x20selected\x20menu\x20host.','has','setLogPath','JS\x20URL\x20is\x20unreachable:\x20','hasOwn','jsUrl',':\x20expected\x20a\x20non-empty\x20string.','Invalid\x20--params:\x20','dryRun','length',';\x20found\x20','menu-sync','16011WUxfRW','Expected\x20one\x20folder\x20named\x20\x22','11885DzMyMO','order','info','Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20','Start\x20non-interactive\x20menu\x20sync','isInteger','trim','appName','1178060DdUlyA','\x0a\x20\x20Available\x20local\x20paths:\x20','type','Parent\x20','string','isArray','keys','--params.','object','message','parentId','group','folder','field','--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.','number','3032viOIKV','map','boolean','3890285ugePHW','82362tOJaou','1bCLzPo','filter','push','label','visible','pages','join','import','12174052YYYqtl','procode','1446kkQdWo','cwd','get','cssUrl','Menu\x20sync\x20completed','parse','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','4TmSubB','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','339052odZTcR','No\x20local\x20pages\x20matched\x20paths:\x20'];a184_0x5d5c=function(){return _0x1621a0;};return a184_0x5d5c();}import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{menuPathKey}from'../../../commands/menu/shared/path.js';import{logger}from'../../../utils/logger.js';import{assertSharedResourcesConfigured}from'../../../commands/menu/shared/subapp-assets.js';const MENU_SYNC_PARAM_KEYS=new Set([a184_0xbbcf83(0xe6),a184_0xbbcf83(0xd5),a184_0xbbcf83(0xb2),a184_0xbbcf83(0xcc),a184_0xbbcf83(0xbd)]);export function resolvePage(_0x283401,_0xe1112b,_0x5e67b8){const _0x2eb851=a184_0xbbcf83;let _0x448ecf=_0xe1112b[_0x2eb851(0xbd)]??_0x283401['parentId'];if(_0x448ecf===undefined&&_0x283401[_0x2eb851(0xbe)]){const _0x4579bf=_0x5e67b8[_0x2eb851(0xc9)](_0x1d86bb=>_0x1d86bb[_0x2eb851(0xb5)]===_0x2eb851(0xbf)&&_0x1d86bb[_0x2eb851(0xcb)]===_0x283401[_0x2eb851(0xbe)]);if(_0x4579bf[_0x2eb851(0xa6)]!==0x1)throw new Error(_0x2eb851(0xaa)+_0x283401[_0x2eb851(0xbe)]+'\x22\x20for\x20'+_0x283401[_0x2eb851(0xdf)]+_0x2eb851(0xa7)+_0x4579bf[_0x2eb851(0xa6)]);_0x448ecf=_0x4579bf[0x0]['id'];}if(_0x448ecf!==undefined&&_0x448ecf!==0x0&&_0x5e67b8[_0x2eb851(0xc9)](_0x192204=>_0x192204['id']===_0x448ecf&&_0x192204[_0x2eb851(0xb5)]===_0x2eb851(0xbf))[_0x2eb851(0xa6)]!==0x1)throw new Error(_0x2eb851(0xb6)+_0x448ecf+_0x2eb851(0xe1));return{..._0x283401,..._0x448ecf===undefined?{}:{'parentId':_0x448ecf},..._0xe1112b[_0x2eb851(0xcc)]===undefined?{}:{'visible':_0xe1112b[_0x2eb851(0xcc)]}};}function validateParams(_0x56ab27){const _0x51f3a3=a184_0xbbcf83,_0x1676dc=[];return _0x56ab27[_0x51f3a3(0xe6)]&&!isValidJsHttpsUrl(_0x56ab27['jsUrl'])&&_0x1676dc[_0x51f3a3(0xca)]({'field':_0x51f3a3(0xe6),'message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x56ab27[_0x51f3a3(0xd5)]&&!isValidCssHttpsUrl(_0x56ab27['cssUrl'])&&_0x1676dc[_0x51f3a3(0xca)]({'field':_0x51f3a3(0xd5),'message':_0x51f3a3(0xda)}),_0x1676dc;}export async function runMenuSyncCore(_0x1691ed,_0x122a2c,_0x38addc=[],_0xf8fe12,_0x30f0f9={}){const _0x15c6c3=a184_0xbbcf83,_0xae9ba=parseMenuSyncParams(_0xf8fe12),_0x5ede02=[...new Set(_0x38addc['map'](_0x1809bd=>_0x1809bd[_0x15c6c3(0xb1)]())['filter'](Boolean)[_0x15c6c3(0xc4)](menuPathKey))],_0x18e589=_0xae9ba[_0x15c6c3(0xe6)],_0x52501b=_0xae9ba[_0x15c6c3(0xd5)],_0x4cf94f=[];if(_0x18e589)_0x4cf94f[_0x15c6c3(0xca)](_0x18e589);if(_0x52501b)_0x4cf94f[_0x15c6c3(0xca)](_0x52501b);const _0x21147f=validateParams(_0xae9ba);if(_0x21147f[_0x15c6c3(0xa6)]>0x0){const _0xfefd61=_0x21147f[_0x15c6c3(0xc4)](_0x5b5879=>_0x15c6c3(0xba)+_0x5b5879[_0x15c6c3(0xc0)]+':\x20'+_0x5b5879[_0x15c6c3(0xbc)])[_0x15c6c3(0xce)](';\x20');throw new Error(_0x15c6c3(0xa4)+_0xfefd61);}logger[_0x15c6c3(0xe3)](process[_0x15c6c3(0xd3)]()),logger[_0x15c6c3(0xad)](_0x15c6c3(0xa8),_0x15c6c3(0xaf),{'appCode':_0x1691ed,'selectedCount':_0x5ede02[_0x15c6c3(0xa6)],'jsUrl':_0x18e589,'cssUrl':_0x52501b});if(_0x18e589){const _0x516714=await isUrlReachable(_0x18e589);if(!_0x516714)throw new Error(_0x15c6c3(0xe4)+_0x18e589);}if(_0x52501b){const _0x2489ee=await isUrlReachable(_0x52501b);if(!_0x2489ee)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x52501b);}const _0x264905=getLocalPages();if(_0x264905[_0x15c6c3(0xa6)]===0x0){if(_0x5ede02[_0x15c6c3(0xa6)]>0x0)throw new Error(_0x15c6c3(0xdc)+_0x5ede02[_0x15c6c3(0xce)](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x30f0f9[_0x15c6c3(0xa5)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x506ca2=await getOnlineMenuList(_0x1691ed,_0x122a2c),_0x43d4e9=new Set(_0x506ca2[_0x15c6c3(0xc4)](_0x1401bb=>menuPathKey(_0x1401bb[_0x15c6c3(0xdf)])));let _0x1775f7;if(_0x5ede02['length']>0x0){const _0x3e3843=new Map(_0x264905[_0x15c6c3(0xc4)](_0x5aacd3=>[menuPathKey(_0x5aacd3[_0x15c6c3(0xdf)]),_0x5aacd3])),_0x153783=_0x5ede02[_0x15c6c3(0xc9)](_0x473fa7=>!_0x3e3843['has'](_0x473fa7));if(_0x153783[_0x15c6c3(0xa6)]>0x0){const _0x47d768=_0x264905[_0x15c6c3(0xc4)](_0x1c0197=>_0x1c0197[_0x15c6c3(0xdf)])[_0x15c6c3(0xce)](',\x20');throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0x153783[_0x15c6c3(0xce)](',\x20')+_0x15c6c3(0xb4)+_0x47d768);}const _0x1a7b08=_0x5ede02[_0x15c6c3(0xc9)](_0x432172=>_0x43d4e9['has'](_0x432172));if(_0x1a7b08['length']>0x0)throw new Error(_0x15c6c3(0xae)+_0x1a7b08[_0x15c6c3(0xce)](',\x20'));_0x1775f7=_0x5ede02[_0x15c6c3(0xc4)](_0x56b05e=>_0x3e3843[_0x15c6c3(0xd4)](_0x56b05e));}else _0x1775f7=_0x264905[_0x15c6c3(0xc9)](_0x7f1b67=>!_0x43d4e9[_0x15c6c3(0xe2)](menuPathKey(_0x7f1b67['path'])));if(_0x1775f7['length']===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x30f0f9[_0x15c6c3(0xa5)]===!![],'targetPages':[],'plannedMenus':[]};_0x1775f7=_0x1775f7[_0x15c6c3(0xc4)](_0x4f3ea9=>resolvePage(_0x4f3ea9,_0xae9ba,_0x506ca2));_0xae9ba[_0x15c6c3(0xb2)]&&_0x4cf94f[_0x15c6c3(0xa6)]===0x0&&await assertSharedResourcesConfigured(_0x1691ed,_0x122a2c,_0xae9ba[_0x15c6c3(0xb2)]);const _0x20ce34=_0x1775f7[_0x15c6c3(0xc4)](_0x3e514a=>({'type':_0x15c6c3(0xd1),'path':_0x3e514a[_0x15c6c3(0xdf)],'label':_0x3e514a['label'],'loadScriptMode':_0x15c6c3(0xcf),'resources':[..._0x4cf94f],..._0x3e514a[_0x15c6c3(0xcc)]===undefined?{}:{'visible':_0x3e514a[_0x15c6c3(0xcc)]},..._0x3e514a[_0x15c6c3(0xbd)]===undefined?{}:{'parentId':_0x3e514a[_0x15c6c3(0xbd)]},..._0x3e514a[_0x15c6c3(0xac)]===undefined?{}:{'sort':_0x3e514a[_0x15c6c3(0xac)]},..._0xae9ba[_0x15c6c3(0xb2)]===undefined?{}:{'appName':_0xae9ba[_0x15c6c3(0xb2)]}}));if(_0x30f0f9[_0x15c6c3(0xa5)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x1775f7,'plannedMenus':_0x20ce34};const _0x378129=_0xae9ba[_0x15c6c3(0xb2)]?await createMenus(_0x1691ed,_0x122a2c,_0x1775f7,_0x4cf94f[_0x15c6c3(0xa6)]>0x0?_0x4cf94f:undefined,{'appName':_0xae9ba[_0x15c6c3(0xb2)]}):await createMenus(_0x1691ed,_0x122a2c,_0x1775f7,_0x4cf94f[_0x15c6c3(0xa6)]>0x0?_0x4cf94f:undefined);return logger['info'](_0x15c6c3(0xa8),_0x15c6c3(0xd6),{'count':_0x1775f7['length'],'resources':_0x4cf94f}),{'created':_0x378129[_0x15c6c3(0xa6)],'skipped':![],'dryRun':![],'targetPages':_0x1775f7,'plannedMenus':_0x20ce34,'menus':_0x378129};}export function parseMenuSyncParams(_0x2eb2f6){const _0x3280e0=a184_0xbbcf83;if(!_0x2eb2f6||typeof _0x2eb2f6!==_0x3280e0(0xb7))return{};let _0x3cea87;try{_0x3cea87=JSON[_0x3280e0(0xd7)](_0x2eb2f6);}catch{throw new Error(_0x3280e0(0xe0));}if(typeof _0x3cea87!==_0x3280e0(0xbb)||_0x3cea87===null||Array[_0x3280e0(0xb8)](_0x3cea87))throw new Error(_0x3280e0(0xd8));const _0x4020f5=_0x3cea87;if(Object[_0x3280e0(0xe5)](_0x4020f5,_0x3280e0(0xcd)))throw new Error(_0x3280e0(0xc1));const _0x379661=Object[_0x3280e0(0xb9)](_0x4020f5)[_0x3280e0(0xc9)](_0x45f8c9=>!MENU_SYNC_PARAM_KEYS['has'](_0x45f8c9));if(_0x379661[_0x3280e0(0xa6)]>0x0)throw new Error('Invalid\x20--params\x20fields:\x20'+_0x379661[_0x3280e0(0xce)](',\x20')+'.');for(const _0x29eac8 of[_0x3280e0(0xe6),_0x3280e0(0xd5),'appName']){const _0x17b065=_0x4020f5[_0x29eac8];if(_0x17b065!==undefined&&(typeof _0x17b065!==_0x3280e0(0xb7)||_0x17b065[_0x3280e0(0xb1)]()===''))throw new Error('Invalid\x20--params.'+_0x29eac8+_0x3280e0(0xa3));}if(_0x4020f5['visible']!==undefined&&typeof _0x4020f5[_0x3280e0(0xcc)]!==_0x3280e0(0xc5))throw new Error(_0x3280e0(0xde));if(_0x4020f5[_0x3280e0(0xbd)]!==undefined&&(!Number[_0x3280e0(0xb0)](_0x4020f5[_0x3280e0(0xbd)])||_0x4020f5[_0x3280e0(0xbd)]<0x0))throw new Error(_0x3280e0(0xdd));return{'jsUrl':typeof _0x4020f5[_0x3280e0(0xe6)]==='string'?_0x4020f5[_0x3280e0(0xe6)]['trim']():undefined,'cssUrl':typeof _0x4020f5[_0x3280e0(0xd5)]===_0x3280e0(0xb7)?_0x4020f5[_0x3280e0(0xd5)][_0x3280e0(0xb1)]():undefined,'appName':typeof _0x4020f5[_0x3280e0(0xb2)]===_0x3280e0(0xb7)?_0x4020f5[_0x3280e0(0xb2)]['trim']():undefined,'visible':typeof _0x4020f5[_0x3280e0(0xcc)]===_0x3280e0(0xc5)?_0x4020f5[_0x3280e0(0xcc)]:undefined,'parentId':typeof _0x4020f5[_0x3280e0(0xbd)]===_0x3280e0(0xc2)?_0x4020f5['parentId']:undefined};}
1
+ const a184_0x2c6d50=a184_0x56aa;(function(_0x1648e9,_0x240d70){const _0x4e3792=a184_0x56aa,_0x25a013=_0x1648e9();while(!![]){try{const _0x882bac=parseInt(_0x4e3792(0x1e8))/0x1*(parseInt(_0x4e3792(0x214))/0x2)+-parseInt(_0x4e3792(0x213))/0x3*(parseInt(_0x4e3792(0x1ec))/0x4)+-parseInt(_0x4e3792(0x1eb))/0x5*(-parseInt(_0x4e3792(0x201))/0x6)+-parseInt(_0x4e3792(0x1e3))/0x7*(-parseInt(_0x4e3792(0x1e5))/0x8)+parseInt(_0x4e3792(0x205))/0x9*(parseInt(_0x4e3792(0x1db))/0xa)+parseInt(_0x4e3792(0x1da))/0xb+parseInt(_0x4e3792(0x20a))/0xc*(-parseInt(_0x4e3792(0x1dd))/0xd);if(_0x882bac===_0x240d70)break;else _0x25a013['push'](_0x25a013['shift']());}catch(_0xc75b2a){_0x25a013['push'](_0x25a013['shift']());}}}(a184_0x580d,0x283f5));function a184_0x56aa(_0x28e815,_0xf3a541){_0x28e815=_0x28e815-0x1d9;const _0x580dfb=a184_0x580d();let _0x56aaeb=_0x580dfb[_0x28e815];return _0x56aaeb;}import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{menuPathKey}from'../../../commands/menu/shared/path.js';function a184_0x580d(){const _0x494850=['procode','import','folder','Invalid\x20--params\x20JSON.','4053FPQOJy','map','544EmCEkY','isInteger','Invalid\x20--params.parentId:\x20expected\x20a\x20non-negative\x20integer.','1JMotgY','order','visible','2410hpsAnF','404bzTmqV','jsUrl','has','get','Expected\x20one\x20folder\x20named\x20\x22','label','setLogPath','--params.','object','string','length','filter','group','trim','menu-sync','Start\x20non-interactive\x20menu\x20sync','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','push','\x22\x20for\x20','isArray','dryRun','498vIiepm','info','appName','cssUrl','90837ZeRxyx','No\x20local\x20pages\x20matched\x20paths:\x20',':\x20expected\x20a\x20non-empty\x20string.','cwd','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','1028004eWclia','Parent\x20','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','hasOwn','CSS\x20URL\x20is\x20unreachable:\x20','boolean','parse','type','JS\x20URL\x20is\x20unreachable:\x20','4533jQrzik','223208BSuANC','field','Invalid\x20--params:\x20','\x0a\x20\x20Available\x20local\x20paths:\x20','join','keys','parentId','path','2111593cfdLLc','20ZZDjYD','Invalid\x20--params.','13RfvNdm','number'];a184_0x580d=function(){return _0x494850;};return a184_0x580d();}import{logger}from'../../../utils/logger.js';import{assertSharedResourcesConfigured}from'../../../commands/menu/shared/subapp-assets.js';const MENU_SYNC_PARAM_KEYS=new Set([a184_0x2c6d50(0x1ed),a184_0x2c6d50(0x204),'appName',a184_0x2c6d50(0x1ea),'parentId']);export function resolvePage(_0x1a265f,_0x37577e,_0x31be71){const _0x25e41e=a184_0x2c6d50;let _0x5cbed1=_0x37577e['parentId']??_0x1a265f[_0x25e41e(0x21a)];if(_0x5cbed1===undefined&&_0x1a265f['group']){const _0x3bbb89=_0x31be71[_0x25e41e(0x1f7)](_0x4d9f78=>_0x4d9f78[_0x25e41e(0x211)]===_0x25e41e(0x1e1)&&_0x4d9f78['label']===_0x1a265f[_0x25e41e(0x1f8)]);if(_0x3bbb89[_0x25e41e(0x1f6)]!==0x1)throw new Error(_0x25e41e(0x1f0)+_0x1a265f[_0x25e41e(0x1f8)]+_0x25e41e(0x1fe)+_0x1a265f['path']+';\x20found\x20'+_0x3bbb89[_0x25e41e(0x1f6)]);_0x5cbed1=_0x3bbb89[0x0]['id'];}if(_0x5cbed1!==undefined&&_0x5cbed1!==0x0&&_0x31be71[_0x25e41e(0x1f7)](_0x22e3a5=>_0x22e3a5['id']===_0x5cbed1&&_0x22e3a5[_0x25e41e(0x211)]===_0x25e41e(0x1e1))[_0x25e41e(0x1f6)]!==0x1)throw new Error(_0x25e41e(0x20b)+_0x5cbed1+'\x20must\x20be\x20an\x20existing\x20folder\x20in\x20the\x20selected\x20menu\x20host.');return{..._0x1a265f,..._0x5cbed1===undefined?{}:{'parentId':_0x5cbed1},..._0x37577e[_0x25e41e(0x1ea)]===undefined?{}:{'visible':_0x37577e['visible']}};}function validateParams(_0x15e886){const _0x26aa2f=a184_0x2c6d50,_0x12600a=[];return _0x15e886['jsUrl']&&!isValidJsHttpsUrl(_0x15e886[_0x26aa2f(0x1ed)])&&_0x12600a[_0x26aa2f(0x1fd)]({'field':_0x26aa2f(0x1ed),'message':_0x26aa2f(0x20c)}),_0x15e886[_0x26aa2f(0x204)]&&!isValidCssHttpsUrl(_0x15e886[_0x26aa2f(0x204)])&&_0x12600a[_0x26aa2f(0x1fd)]({'field':'cssUrl','message':_0x26aa2f(0x209)}),_0x12600a;}export async function runMenuSyncCore(_0x4b17a4,_0x3843df,_0x524806=[],_0x1403d7,_0x1e550d={}){const _0x3e05d4=a184_0x2c6d50,_0x109f1e=parseMenuSyncParams(_0x1403d7),_0x4c82d9=[...new Set(_0x524806[_0x3e05d4(0x1e4)](_0x34a4be=>_0x34a4be['trim']())['filter'](Boolean)[_0x3e05d4(0x1e4)](menuPathKey))],_0x357b55=_0x109f1e['jsUrl'],_0x51a64b=_0x109f1e[_0x3e05d4(0x204)],_0xce117f=[];if(_0x357b55)_0xce117f[_0x3e05d4(0x1fd)](_0x357b55);if(_0x51a64b)_0xce117f[_0x3e05d4(0x1fd)](_0x51a64b);const _0x52f34b=validateParams(_0x109f1e);if(_0x52f34b[_0x3e05d4(0x1f6)]>0x0){const _0x460edc=_0x52f34b['map'](_0x50fc1a=>_0x3e05d4(0x1f3)+_0x50fc1a[_0x3e05d4(0x215)]+':\x20'+_0x50fc1a['message'])[_0x3e05d4(0x218)](';\x20');throw new Error(_0x3e05d4(0x216)+_0x460edc);}logger[_0x3e05d4(0x1f2)](process[_0x3e05d4(0x208)]()),logger[_0x3e05d4(0x202)](_0x3e05d4(0x1fa),_0x3e05d4(0x1fb),{'appCode':_0x4b17a4,'selectedCount':_0x4c82d9[_0x3e05d4(0x1f6)],'jsUrl':_0x357b55,'cssUrl':_0x51a64b});if(_0x357b55){const _0x288180=await isUrlReachable(_0x357b55);if(!_0x288180)throw new Error(_0x3e05d4(0x212)+_0x357b55);}if(_0x51a64b){const _0x5b923b=await isUrlReachable(_0x51a64b);if(!_0x5b923b)throw new Error(_0x3e05d4(0x20e)+_0x51a64b);}const _0x373826=getLocalPages();if(_0x373826[_0x3e05d4(0x1f6)]===0x0){if(_0x4c82d9['length']>0x0)throw new Error(_0x3e05d4(0x206)+_0x4c82d9[_0x3e05d4(0x218)](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x1e550d[_0x3e05d4(0x200)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x33f949=await getOnlineMenuList(_0x4b17a4,_0x3843df),_0x236218=new Set(_0x33f949[_0x3e05d4(0x1e4)](_0x14838c=>menuPathKey(_0x14838c[_0x3e05d4(0x1d9)])));let _0xeefe54;if(_0x4c82d9[_0x3e05d4(0x1f6)]>0x0){const _0x1b4d0d=new Map(_0x373826[_0x3e05d4(0x1e4)](_0x2afcd3=>[menuPathKey(_0x2afcd3['path']),_0x2afcd3])),_0x1cc7e4=_0x4c82d9[_0x3e05d4(0x1f7)](_0x43d795=>!_0x1b4d0d['has'](_0x43d795));if(_0x1cc7e4[_0x3e05d4(0x1f6)]>0x0){const _0x5684b7=_0x373826[_0x3e05d4(0x1e4)](_0x56e6c5=>_0x56e6c5[_0x3e05d4(0x1d9)])[_0x3e05d4(0x218)](',\x20');throw new Error(_0x3e05d4(0x206)+_0x1cc7e4[_0x3e05d4(0x218)](',\x20')+_0x3e05d4(0x217)+_0x5684b7);}const _0x358f1f=_0x4c82d9[_0x3e05d4(0x1f7)](_0x285ef8=>_0x236218['has'](_0x285ef8));if(_0x358f1f['length']>0x0)throw new Error('Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20'+_0x358f1f[_0x3e05d4(0x218)](',\x20'));_0xeefe54=_0x4c82d9[_0x3e05d4(0x1e4)](_0x544f56=>_0x1b4d0d[_0x3e05d4(0x1ef)](_0x544f56));}else _0xeefe54=_0x373826[_0x3e05d4(0x1f7)](_0xed18c4=>!_0x236218[_0x3e05d4(0x1ee)](menuPathKey(_0xed18c4[_0x3e05d4(0x1d9)])));if(_0xeefe54[_0x3e05d4(0x1f6)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x1e550d[_0x3e05d4(0x200)]===!![],'targetPages':[],'plannedMenus':[]};_0xeefe54=_0xeefe54[_0x3e05d4(0x1e4)](_0x30fbed=>resolvePage(_0x30fbed,_0x109f1e,_0x33f949));_0x109f1e['appName']&&_0xce117f[_0x3e05d4(0x1f6)]===0x0&&await assertSharedResourcesConfigured(_0x4b17a4,_0x3843df,_0x109f1e['appName']);const _0x291f46=_0xeefe54['map'](_0x7b1ec1=>({'type':_0x3e05d4(0x1df),'path':_0x7b1ec1['path'],'label':_0x7b1ec1[_0x3e05d4(0x1f1)],'loadScriptMode':_0x3e05d4(0x1e0),'resources':[..._0xce117f],..._0x7b1ec1[_0x3e05d4(0x1ea)]===undefined?{}:{'visible':_0x7b1ec1[_0x3e05d4(0x1ea)]},..._0x7b1ec1[_0x3e05d4(0x21a)]===undefined?{}:{'parentId':_0x7b1ec1[_0x3e05d4(0x21a)]},..._0x7b1ec1[_0x3e05d4(0x1e9)]===undefined?{}:{'sort':_0x7b1ec1[_0x3e05d4(0x1e9)]},..._0x109f1e[_0x3e05d4(0x203)]===undefined?{}:{'appName':_0x109f1e['appName']}}));if(_0x1e550d['dryRun'])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0xeefe54,'plannedMenus':_0x291f46};const _0x46145f=_0x109f1e[_0x3e05d4(0x203)]?await createMenus(_0x4b17a4,_0x3843df,_0xeefe54,_0xce117f[_0x3e05d4(0x1f6)]>0x0?_0xce117f:undefined,{'appName':_0x109f1e[_0x3e05d4(0x203)]}):await createMenus(_0x4b17a4,_0x3843df,_0xeefe54,_0xce117f['length']>0x0?_0xce117f:undefined);return logger[_0x3e05d4(0x202)](_0x3e05d4(0x1fa),'Menu\x20sync\x20completed',{'count':_0xeefe54[_0x3e05d4(0x1f6)],'resources':_0xce117f}),{'created':_0x46145f['length'],'skipped':![],'dryRun':![],'targetPages':_0xeefe54,'plannedMenus':_0x291f46,'menus':_0x46145f};}export function parseMenuSyncParams(_0x4a2f43){const _0x4b82ee=a184_0x2c6d50;if(!_0x4a2f43||typeof _0x4a2f43!==_0x4b82ee(0x1f5))return{};let _0x2c648d;try{_0x2c648d=JSON[_0x4b82ee(0x210)](_0x4a2f43);}catch{throw new Error(_0x4b82ee(0x1e2));}if(typeof _0x2c648d!==_0x4b82ee(0x1f4)||_0x2c648d===null||Array[_0x4b82ee(0x1ff)](_0x2c648d))throw new Error(_0x4b82ee(0x1fc));const _0xddb85c=_0x2c648d;if(Object[_0x4b82ee(0x20d)](_0xddb85c,'pages'))throw new Error('--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.');const _0x51dc2c=Object[_0x4b82ee(0x219)](_0xddb85c)['filter'](_0x242640=>!MENU_SYNC_PARAM_KEYS[_0x4b82ee(0x1ee)](_0x242640));if(_0x51dc2c['length']>0x0)throw new Error('Invalid\x20--params\x20fields:\x20'+_0x51dc2c[_0x4b82ee(0x218)](',\x20')+'.');for(const _0x349eb4 of[_0x4b82ee(0x1ed),'cssUrl',_0x4b82ee(0x203)]){const _0x5b0a03=_0xddb85c[_0x349eb4];if(_0x5b0a03!==undefined&&(typeof _0x5b0a03!==_0x4b82ee(0x1f5)||_0x5b0a03[_0x4b82ee(0x1f9)]()===''))throw new Error(_0x4b82ee(0x1dc)+_0x349eb4+_0x4b82ee(0x207));}if(_0xddb85c['visible']!==undefined&&typeof _0xddb85c['visible']!=='boolean')throw new Error('Invalid\x20--params.visible:\x20expected\x20a\x20boolean.');if(_0xddb85c[_0x4b82ee(0x21a)]!==undefined&&(!Number[_0x4b82ee(0x1e6)](_0xddb85c['parentId'])||_0xddb85c['parentId']<0x0))throw new Error(_0x4b82ee(0x1e7));return{'jsUrl':typeof _0xddb85c[_0x4b82ee(0x1ed)]===_0x4b82ee(0x1f5)?_0xddb85c[_0x4b82ee(0x1ed)][_0x4b82ee(0x1f9)]():undefined,'cssUrl':typeof _0xddb85c[_0x4b82ee(0x204)]==='string'?_0xddb85c[_0x4b82ee(0x204)][_0x4b82ee(0x1f9)]():undefined,'appName':typeof _0xddb85c['appName']===_0x4b82ee(0x1f5)?_0xddb85c[_0x4b82ee(0x203)][_0x4b82ee(0x1f9)]():undefined,'visible':typeof _0xddb85c['visible']===_0x4b82ee(0x20f)?_0xddb85c['visible']:undefined,'parentId':typeof _0xddb85c[_0x4b82ee(0x21a)]===_0x4b82ee(0x1de)?_0xddb85c[_0x4b82ee(0x21a)]:undefined};}
@@ -1 +1 @@
1
- function a186_0x3ce7(_0x4d5297,_0x4140eb){_0x4d5297=_0x4d5297-0xfe;const _0x21706e=a186_0x2170();let _0x3ce7c6=_0x21706e[_0x4d5297];return _0x3ce7c6;}(function(_0x59998e,_0x3203dc){const _0x20f5b1=a186_0x3ce7,_0x3062f6=_0x59998e();while(!![]){try{const _0x16874a=-parseInt(_0x20f5b1(0x111))/0x1*(parseInt(_0x20f5b1(0x140))/0x2)+-parseInt(_0x20f5b1(0x141))/0x3+-parseInt(_0x20f5b1(0x126))/0x4+parseInt(_0x20f5b1(0x13c))/0x5+parseInt(_0x20f5b1(0x10a))/0x6*(-parseInt(_0x20f5b1(0x142))/0x7)+parseInt(_0x20f5b1(0x12a))/0x8+parseInt(_0x20f5b1(0x11c))/0x9;if(_0x16874a===_0x3203dc)break;else _0x3062f6['push'](_0x3062f6['shift']());}catch(_0x193f1a){_0x3062f6['push'](_0x3062f6['shift']());}}}(a186_0x2170,0x1eb82));import{updateMenuCdnUrl,getOnlineMenuList}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';function a186_0x2170(){const _0x5f5c4d=['1TMflnW','label','message','object','resources','loadScriptMode','rejected','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','\x20existing\x20JS\x20resources\x20for\x20\x22','Invalid\x20--mode:\x20','allSettled','5017608dxWAFo','Invalid\x20--params:\x20','JS\x20URL\x20is\x20unreachable:\x20','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','dryRun','all','paths','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','cwd','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','776832TQaRlM','has','menu\x20asset-update\x20cannot\x20patch\x20','Menu\x20asset\x20update\x20completed','383512auNUKH','jsUrl',').\x20','replace','\x20existing\x20CSS\x20resources\x20for\x20\x22','menu-asset-update','.js','extend','value','unshift','length','.\x20Allowed\x20values:\x20replace,\x20patch','map','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','filter','setLogPath','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','menuIds','122660LfLRJe','cssUrl','patch','push','301394fvilmE','378165JGfWpc','2611SGkDPn','isArray','toLowerCase','after','force','some','.css','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','status','endsWith','info','split','\x22\x20(','534SGSEPA','path','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','join','string','mode','fulfilled'];a186_0x2170=function(){return _0x5f5c4d;};return a186_0x2170();}function validateParams(_0x2c3881){const _0x1bdac0=a186_0x3ce7,_0x200715=[];return _0x2c3881[_0x1bdac0(0x12b)]&&!isValidJsHttpsUrl(_0x2c3881[_0x1bdac0(0x12b)])&&_0x200715[_0x1bdac0(0x13f)]({'field':_0x1bdac0(0x12b),'message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x2c3881[_0x1bdac0(0x13d)]&&!isValidCssHttpsUrl(_0x2c3881['cssUrl'])&&_0x200715[_0x1bdac0(0x13f)]({'field':_0x1bdac0(0x13d),'message':_0x1bdac0(0x104)}),_0x200715;}export async function runMenuUpdateCore(_0x2373ed,_0x3b30bf,_0x29152d,_0x1adf05={}){const _0x58111d=a186_0x3ce7,_0x1fdc2c=parseUpdateParamsFlag(_0x29152d),_0x112295=normalizeMode(_0x1adf05[_0x58111d(0x10f)]);validateSelection(_0x1adf05['selection']);const _0x112322=[];if(_0x1fdc2c[_0x58111d(0x12b)])_0x112322[_0x58111d(0x13f)](_0x1fdc2c[_0x58111d(0x12b)]);if(_0x1fdc2c[_0x58111d(0x13d)])_0x112322[_0x58111d(0x13f)](_0x1fdc2c[_0x58111d(0x13d)]);const _0x3f1524=validateParams(_0x1fdc2c);if(_0x3f1524[_0x58111d(0x134)]>0x0){const _0x5d0574=_0x3f1524[_0x58111d(0x136)](_0x3897e0=>'--params.'+_0x3897e0['field']+':\x20'+_0x3897e0[_0x58111d(0x113)])[_0x58111d(0x10d)](';\x20');throw new Error(_0x58111d(0x11d)+_0x5d0574);}if(_0x112322[_0x58111d(0x134)]===0x0)throw new Error('Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20'+_0x58111d(0x13a));logger[_0x58111d(0x139)](process[_0x58111d(0x124)]()),logger[_0x58111d(0x107)](_0x58111d(0x12f),'Start\x20non-interactive\x20menu\x20asset\x20update',{'appCode':_0x2373ed,'jsUrl':_0x1fdc2c[_0x58111d(0x12b)],'cssUrl':_0x1fdc2c['cssUrl'],'mode':_0x112295,'dryRun':_0x1adf05[_0x58111d(0x120)]===!![]});if(_0x1fdc2c['jsUrl']){const _0x214891=await isUrlReachable(_0x1fdc2c[_0x58111d(0x12b)]);if(!_0x214891)throw new Error(_0x58111d(0x11e)+_0x1fdc2c[_0x58111d(0x12b)]);}if(_0x1fdc2c[_0x58111d(0x13d)]){const _0x4ce3b6=await isUrlReachable(_0x1fdc2c[_0x58111d(0x13d)]);if(!_0x4ce3b6)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x1fdc2c[_0x58111d(0x13d)]);}const _0x66ec99=await getOnlineMenuList(_0x2373ed,_0x3b30bf),_0x375563=_0x66ec99[_0x58111d(0x138)](_0x34f6ff=>_0x34f6ff['resources'][_0x58111d(0x134)]>0x0),_0x6c4d22=selectMenusForUpdate(_0x375563,_0x1adf05['selection']);if(_0x6c4d22[_0x58111d(0x134)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x1adf05[_0x58111d(0x120)]===!![]};const _0x14fa6b=_0x6c4d22[_0x58111d(0x136)](_0x1ed109=>buildMenuUpdateDiff(_0x1ed109,_0x1fdc2c,_0x112295,_0x1adf05[_0x58111d(0x101)]===!![],_0x1adf05[_0x58111d(0x116)]));if(_0x1adf05[_0x58111d(0x120)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x14fa6b};const _0x5f5b0b=await Promise[_0x58111d(0x11b)](_0x6c4d22[_0x58111d(0x136)]((_0x3aa355,_0x4648c9)=>updateMenuCdnUrl(_0x2373ed,_0x3b30bf,{'id':_0x3aa355['id'],'label':_0x3aa355[_0x58111d(0x112)],'path':_0x3aa355[_0x58111d(0x10b)],'resources':_0x14fa6b[_0x4648c9][_0x58111d(0x100)][_0x58111d(0x115)],'extend':_0x3aa355['extend']??null,'loadScriptMode':_0x1adf05[_0x58111d(0x116)]}))),_0x385094=_0x5f5b0b[_0x58111d(0x138)](_0x224cd7=>_0x224cd7[_0x58111d(0x105)]===_0x58111d(0x110))[_0x58111d(0x136)](_0x344730=>_0x344730[_0x58111d(0x132)]),_0x42f35d=_0x5f5b0b[_0x58111d(0x138)](_0x57b9a7=>_0x57b9a7['status']===_0x58111d(0x117))[_0x58111d(0x134)];return logger[_0x58111d(0x107)](_0x58111d(0x12f),_0x58111d(0x129),{'count':_0x6c4d22[_0x58111d(0x134)],'resources':_0x112322}),{'updated':_0x385094['length'],'failed':_0x42f35d,'skipped':![],'menus':_0x385094};}function validateSelection(_0x470352){const _0x2f346f=a186_0x3ce7;if(!_0x470352)throw new Error(_0x2f346f(0x118));if(_0x470352[_0x2f346f(0x121)]&&(_0x470352['menuIds']['length']>0x0||_0x470352[_0x2f346f(0x122)]['length']>0x0))throw new Error(_0x2f346f(0x123));if(!_0x470352[_0x2f346f(0x121)]&&_0x470352['menuIds'][_0x2f346f(0x134)]===0x0&&_0x470352[_0x2f346f(0x122)][_0x2f346f(0x134)]===0x0)throw new Error('menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');}export function selectMenusForUpdate(_0xac7744,_0xd69a12){const _0x3cb9ca=a186_0x3ce7;validateSelection(_0xd69a12);if(_0xd69a12[_0x3cb9ca(0x121)])return _0xac7744;const _0x518310=new Set(_0xac7744[_0x3cb9ca(0x136)](_0x56ede5=>_0x56ede5['id'])),_0x424033=new Set(_0xac7744[_0x3cb9ca(0x136)](_0x31f101=>_0x31f101[_0x3cb9ca(0x10b)])),_0x28fc5a=_0xd69a12[_0x3cb9ca(0x13b)][_0x3cb9ca(0x138)](_0x1f50bd=>!_0x518310[_0x3cb9ca(0x127)](_0x1f50bd)),_0x3de860=_0xd69a12[_0x3cb9ca(0x122)][_0x3cb9ca(0x138)](_0x11b9bf=>!_0x424033['has'](_0x11b9bf));if(_0x28fc5a['length']>0x0||_0x3de860['length']>0x0){const _0x249811=[..._0x28fc5a['map'](_0x504a41=>String(_0x504a41)),..._0x3de860]['join'](',\x20');throw new Error(_0x3cb9ca(0x10c)+_0x249811);}const _0x4b6abd=new Set(_0xd69a12[_0x3cb9ca(0x13b)]),_0x1179e5=new Set(_0xd69a12[_0x3cb9ca(0x122)]);return _0xac7744[_0x3cb9ca(0x138)](_0x3120b2=>_0x4b6abd[_0x3cb9ca(0x127)](_0x3120b2['id'])||_0x1179e5[_0x3cb9ca(0x127)](_0x3120b2[_0x3cb9ca(0x10b)]));}function normalizeMode(_0x362439){const _0xa2c75a=a186_0x3ce7;if(!_0x362439)return'patch';if(_0x362439===_0xa2c75a(0x12d)||_0x362439==='patch')return _0x362439;throw new Error(_0xa2c75a(0x11a)+_0x362439+_0xa2c75a(0x135));}function buildMenuUpdateDiff(_0x5f466d,_0x359e26,_0x8a4708,_0x253ab1,_0x3c4c38){const _0x11c8c8=a186_0x3ce7,_0x322fa2=[..._0x5f466d['resources']];_0x8a4708===_0x11c8c8(0x13e)&&assertUnambiguousPatchResources(_0x5f466d,_0x322fa2,_0x359e26);const _0x3acd96=_0x8a4708===_0x11c8c8(0x13e)?patchResources(_0x322fa2,_0x359e26):replaceResources(_0x359e26),_0x1fa329=[],_0xe2df3f=_0x322fa2[_0x11c8c8(0x102)](isJsResource),_0x4eca53=_0x3acd96['some'](isJsResource);if(_0xe2df3f&&!_0x4eca53){const _0x27be43='menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22'+_0x5f466d['label']+_0x11c8c8(0x109)+_0x5f466d[_0x11c8c8(0x10b)]+_0x11c8c8(0x12c)+'Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.';if(!_0x253ab1)throw new Error(_0x27be43);_0x1fa329['push'](_0x27be43);}const _0x512e7a=_0x322fa2[_0x11c8c8(0x102)](isCssResource),_0x9b4492=_0x3acd96[_0x11c8c8(0x102)](isCssResource);_0x512e7a&&!_0x9b4492&&_0x1fa329[_0x11c8c8(0x13f)](_0x11c8c8(0x125)+_0x5f466d[_0x11c8c8(0x112)]+_0x11c8c8(0x109)+_0x5f466d[_0x11c8c8(0x10b)]+').');const _0xabcc6a=typeof _0x5f466d[_0x11c8c8(0x131)]?.[_0x11c8c8(0x116)]===_0x11c8c8(0x10e)?_0x5f466d['extend'][_0x11c8c8(0x116)]:null,_0x2807c5=_0x3c4c38?{'loadScriptMode':_0xabcc6a}:{},_0x1bb5e9=_0x3c4c38?{'loadScriptMode':_0x3c4c38}:{};return{'id':_0x5f466d['id'],'label':_0x5f466d[_0x11c8c8(0x112)],'path':_0x5f466d[_0x11c8c8(0x10b)],'mode':_0x8a4708,'before':{'resources':_0x322fa2,..._0x2807c5},'after':{'resources':_0x3acd96,..._0x1bb5e9},'warnings':_0x1fa329};}function replaceResources(_0x50dde9){const _0x2c66dc=a186_0x3ce7;return[_0x50dde9[_0x2c66dc(0x12b)],_0x50dde9[_0x2c66dc(0x13d)]][_0x2c66dc(0x138)](_0xa37405=>!!_0xa37405);}function assertUnambiguousPatchResources(_0x5add04,_0x588621,_0x292444){const _0x2db011=a186_0x3ce7,_0x538f57=_0x588621[_0x2db011(0x138)](isJsResource)[_0x2db011(0x134)];if(_0x292444['jsUrl']&&_0x538f57>0x1)throw new Error(_0x2db011(0x128)+_0x538f57+_0x2db011(0x119)+_0x5add04[_0x2db011(0x112)]+_0x2db011(0x109)+_0x5add04[_0x2db011(0x10b)]+')\x20'+_0x2db011(0x11f));const _0x4c2666=_0x588621[_0x2db011(0x138)](isCssResource)[_0x2db011(0x134)];if(_0x292444[_0x2db011(0x13d)]&&_0x4c2666>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x4c2666+_0x2db011(0x12e)+_0x5add04[_0x2db011(0x112)]+_0x2db011(0x109)+_0x5add04[_0x2db011(0x10b)]+')\x20'+_0x2db011(0x137));}function patchResources(_0x471a81,_0x2527c6){const _0xec27d0=a186_0x3ce7;let _0x5b0426=![],_0x17cc20=![];const _0x3adc05=[];for(const _0x1d2399 of _0x471a81){if(isJsResource(_0x1d2399)){if(_0x2527c6[_0xec27d0(0x12b)]&&!_0x5b0426)_0x3adc05[_0xec27d0(0x13f)](_0x2527c6[_0xec27d0(0x12b)]),_0x5b0426=!![];else!_0x2527c6[_0xec27d0(0x12b)]&&_0x3adc05['push'](_0x1d2399);continue;}if(isCssResource(_0x1d2399)){if(_0x2527c6['cssUrl']&&!_0x17cc20)_0x3adc05[_0xec27d0(0x13f)](_0x2527c6[_0xec27d0(0x13d)]),_0x17cc20=!![];else!_0x2527c6[_0xec27d0(0x13d)]&&_0x3adc05['push'](_0x1d2399);continue;}_0x3adc05['push'](_0x1d2399);}return _0x2527c6[_0xec27d0(0x12b)]&&!_0x5b0426&&_0x3adc05[_0xec27d0(0x133)](_0x2527c6[_0xec27d0(0x12b)]),_0x2527c6[_0xec27d0(0x13d)]&&!_0x17cc20&&_0x3adc05[_0xec27d0(0x13f)](_0x2527c6[_0xec27d0(0x13d)]),_0x3adc05;}function isJsResource(_0x2e0bf5){const _0x165651=a186_0x3ce7;return stripQuery(_0x2e0bf5)[_0x165651(0xff)]()[_0x165651(0x106)](_0x165651(0x130));}function isCssResource(_0x41dbd9){const _0x109f1b=a186_0x3ce7;return stripQuery(_0x41dbd9)[_0x109f1b(0xff)]()[_0x109f1b(0x106)](_0x109f1b(0x103));}function stripQuery(_0x275099){const _0x575202=a186_0x3ce7;return _0x275099[_0x575202(0x108)]('?')[0x0]??_0x275099;}function parseUpdateParamsFlag(_0xc76040){const _0x40caa8=a186_0x3ce7;if(!_0xc76040||typeof _0xc76040!=='string')return{};try{const _0x5ab361=JSON['parse'](_0xc76040);if(typeof _0x5ab361!==_0x40caa8(0x114)||_0x5ab361===null||Array[_0x40caa8(0xfe)](_0x5ab361))return{};return{'jsUrl':typeof _0x5ab361[_0x40caa8(0x12b)]==='string'?_0x5ab361['jsUrl']['trim']():undefined,'cssUrl':typeof _0x5ab361[_0x40caa8(0x13d)]===_0x40caa8(0x10e)?_0x5ab361[_0x40caa8(0x13d)]['trim']():undefined};}catch{return{};}}
1
+ (function(_0x4e7b33,_0xd5ee7d){const _0x4a4bce=a186_0x3c1b,_0x1d4cf2=_0x4e7b33();while(!![]){try{const _0x5ee28b=-parseInt(_0x4a4bce(0xbd))/0x1+-parseInt(_0x4a4bce(0xbf))/0x2+-parseInt(_0x4a4bce(0x9b))/0x3+-parseInt(_0x4a4bce(0xd0))/0x4*(-parseInt(_0x4a4bce(0xa0))/0x5)+-parseInt(_0x4a4bce(0xce))/0x6+-parseInt(_0x4a4bce(0xc0))/0x7+parseInt(_0x4a4bce(0xd8))/0x8*(parseInt(_0x4a4bce(0xd6))/0x9);if(_0x5ee28b===_0xd5ee7d)break;else _0x1d4cf2['push'](_0x1d4cf2['shift']());}catch(_0xecbf76){_0x1d4cf2['push'](_0x1d4cf2['shift']());}}}(a186_0x402e,0x675a9));import{updateMenuCdnUrl,getOnlineMenuList}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';function validateParams(_0x5285fe){const _0x125346=a186_0x3c1b,_0x112e1c=[];return _0x5285fe[_0x125346(0xc7)]&&!isValidJsHttpsUrl(_0x5285fe[_0x125346(0xc7)])&&_0x112e1c[_0x125346(0xab)]({'field':_0x125346(0xc7),'message':_0x125346(0xaf)}),_0x5285fe[_0x125346(0xc2)]&&!isValidCssHttpsUrl(_0x5285fe[_0x125346(0xc2)])&&_0x112e1c[_0x125346(0xab)]({'field':'cssUrl','message':_0x125346(0xaa)}),_0x112e1c;}export async function runMenuUpdateCore(_0x5108ac,_0xc5e2da,_0x551e69,_0x182bf8={}){const _0x23dae1=a186_0x3c1b,_0x5880ec=parseUpdateParamsFlag(_0x551e69),_0x30ce60=normalizeMode(_0x182bf8[_0x23dae1(0xd2)]);validateSelection(_0x182bf8[_0x23dae1(0xd5)]);const _0x176401=[];if(_0x5880ec[_0x23dae1(0xc7)])_0x176401[_0x23dae1(0xab)](_0x5880ec[_0x23dae1(0xc7)]);if(_0x5880ec[_0x23dae1(0xc2)])_0x176401['push'](_0x5880ec[_0x23dae1(0xc2)]);const _0x409d84=validateParams(_0x5880ec);if(_0x409d84[_0x23dae1(0xc1)]>0x0){const _0x43f65f=_0x409d84[_0x23dae1(0xa9)](_0x3009ac=>'--params.'+_0x3009ac[_0x23dae1(0xa6)]+':\x20'+_0x3009ac[_0x23dae1(0xa3)])['join'](';\x20');throw new Error(_0x23dae1(0xae)+_0x43f65f);}if(_0x176401[_0x23dae1(0xc1)]===0x0)throw new Error(_0x23dae1(0xac)+_0x23dae1(0xa1));logger[_0x23dae1(0xa4)](process[_0x23dae1(0xb6)]()),logger[_0x23dae1(0xa7)](_0x23dae1(0xbe),_0x23dae1(0xa8),{'appCode':_0x5108ac,'jsUrl':_0x5880ec[_0x23dae1(0xc7)],'cssUrl':_0x5880ec[_0x23dae1(0xc2)],'mode':_0x30ce60,'dryRun':_0x182bf8[_0x23dae1(0xca)]===!![]});if(_0x5880ec[_0x23dae1(0xc7)]){const _0xd5b81=await isUrlReachable(_0x5880ec['jsUrl']);if(!_0xd5b81)throw new Error(_0x23dae1(0xd1)+_0x5880ec[_0x23dae1(0xc7)]);}if(_0x5880ec[_0x23dae1(0xc2)]){const _0x530b12=await isUrlReachable(_0x5880ec[_0x23dae1(0xc2)]);if(!_0x530b12)throw new Error(_0x23dae1(0xc9)+_0x5880ec[_0x23dae1(0xc2)]);}const _0x2a44ee=await getOnlineMenuList(_0x5108ac,_0xc5e2da),_0x4cc22a=_0x2a44ee[_0x23dae1(0xb4)](_0x18b9b8=>_0x18b9b8[_0x23dae1(0xc8)]['length']>0x0),_0x37c051=selectMenusForUpdate(_0x4cc22a,_0x182bf8[_0x23dae1(0xd5)]);if(_0x37c051['length']===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x182bf8[_0x23dae1(0xca)]===!![]};const _0x48c674=_0x37c051[_0x23dae1(0xa9)](_0x5b461a=>buildMenuUpdateDiff(_0x5b461a,_0x5880ec,_0x30ce60,_0x182bf8[_0x23dae1(0xb3)]===!![],_0x182bf8[_0x23dae1(0xc6)]));if(_0x182bf8[_0x23dae1(0xca)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x48c674};const _0x44cf25=await Promise['allSettled'](_0x37c051['map']((_0x3be0b6,_0x11b010)=>updateMenuCdnUrl(_0x5108ac,_0xc5e2da,{'id':_0x3be0b6['id'],'label':_0x3be0b6[_0x23dae1(0xdd)],'path':_0x3be0b6[_0x23dae1(0xc3)],'resources':_0x48c674[_0x11b010]['after'][_0x23dae1(0xc8)],'extend':_0x3be0b6['extend']??null,'loadScriptMode':_0x182bf8[_0x23dae1(0xc6)]}))),_0x3a08d1=_0x44cf25[_0x23dae1(0xb4)](_0x26b158=>_0x26b158[_0x23dae1(0xdb)]===_0x23dae1(0xb2))[_0x23dae1(0xa9)](_0x4343f9=>_0x4343f9[_0x23dae1(0xc5)]),_0x8707a9=_0x44cf25[_0x23dae1(0xb4)](_0x31938a=>_0x31938a['status']===_0x23dae1(0xcb))[_0x23dae1(0xc1)];return logger['info'](_0x23dae1(0xbe),_0x23dae1(0x9f),{'count':_0x37c051['length'],'resources':_0x176401}),{'updated':_0x3a08d1[_0x23dae1(0xc1)],'failed':_0x8707a9,'skipped':![],'menus':_0x3a08d1};}function validateSelection(_0x408403){const _0x18b66e=a186_0x3c1b;if(!_0x408403)throw new Error('menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');if(_0x408403[_0x18b66e(0xd9)]&&(_0x408403[_0x18b66e(0xad)][_0x18b66e(0xc1)]>0x0||_0x408403[_0x18b66e(0xbc)][_0x18b66e(0xc1)]>0x0))throw new Error(_0x18b66e(0xb7));if(!_0x408403[_0x18b66e(0xd9)]&&_0x408403[_0x18b66e(0xad)]['length']===0x0&&_0x408403[_0x18b66e(0xbc)][_0x18b66e(0xc1)]===0x0)throw new Error('menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');}function a186_0x3c1b(_0x1be1f4,_0x48a263){_0x1be1f4=_0x1be1f4-0x98;const _0x402e46=a186_0x402e();let _0x3c1baf=_0x402e46[_0x1be1f4];return _0x3c1baf;}function a186_0x402e(){const _0x3ff5e6=['menuIds','Invalid\x20--params:\x20','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','unshift','toLowerCase','fulfilled','force','filter','.css','cwd','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','has','object','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','paths','14971DpuHeh','menu-asset-update','339938wEZhFu','2838556ioGnZR','length','cssUrl','path','endsWith','value','loadScriptMode','jsUrl','resources','CSS\x20URL\x20is\x20unreachable:\x20','dryRun','rejected','\x20existing\x20CSS\x20resources\x20for\x20\x22','parse','3124830HjMfoW','extend','4fSTWki','JS\x20URL\x20is\x20unreachable:\x20','mode','\x22\x20(','menu\x20asset-update\x20cannot\x20patch\x20','selection','6825132VsuuDf','join','16nZzBUA','all','trim','status','some','label','.\x20Allowed\x20values:\x20replace,\x20patch','string','.js','303387mMixxZ','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','isArray','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','Menu\x20asset\x20update\x20completed','595115RPprYp','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','message','setLogPath','patch','field','info','Start\x20non-interactive\x20menu\x20asset\x20update','map','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','push','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20'];a186_0x402e=function(){return _0x3ff5e6;};return a186_0x402e();}export function selectMenusForUpdate(_0xeae821,_0x5372ce){const _0x3ff283=a186_0x3c1b;validateSelection(_0x5372ce);if(_0x5372ce[_0x3ff283(0xd9)])return _0xeae821;const _0x1e99fe=new Set(_0xeae821[_0x3ff283(0xa9)](_0xf86450=>_0xf86450['id'])),_0x97e6ed=new Set(_0xeae821['map'](_0x3e373e=>_0x3e373e['path'])),_0x98c70e=_0x5372ce['menuIds'][_0x3ff283(0xb4)](_0x15390e=>!_0x1e99fe[_0x3ff283(0xb8)](_0x15390e)),_0x48f112=_0x5372ce[_0x3ff283(0xbc)][_0x3ff283(0xb4)](_0x3bff3c=>!_0x97e6ed[_0x3ff283(0xb8)](_0x3bff3c));if(_0x98c70e['length']>0x0||_0x48f112['length']>0x0){const _0x47d99d=[..._0x98c70e[_0x3ff283(0xa9)](_0x48e1f7=>String(_0x48e1f7)),..._0x48f112][_0x3ff283(0xd7)](',\x20');throw new Error(_0x3ff283(0x9c)+_0x47d99d);}const _0x2dedd0=new Set(_0x5372ce[_0x3ff283(0xad)]),_0x364ae7=new Set(_0x5372ce['paths']);return _0xeae821[_0x3ff283(0xb4)](_0x46f159=>_0x2dedd0[_0x3ff283(0xb8)](_0x46f159['id'])||_0x364ae7[_0x3ff283(0xb8)](_0x46f159[_0x3ff283(0xc3)]));}function normalizeMode(_0x1b491d){const _0x277fbe=a186_0x3c1b;if(!_0x1b491d)return _0x277fbe(0xa5);if(_0x1b491d==='replace'||_0x1b491d===_0x277fbe(0xa5))return _0x1b491d;throw new Error('Invalid\x20--mode:\x20'+_0x1b491d+_0x277fbe(0x98));}function buildMenuUpdateDiff(_0x33e62c,_0x104e2c,_0x45ab67,_0x5d3a91,_0x5307ae){const _0x3abe92=a186_0x3c1b,_0x3394d2=[..._0x33e62c['resources']];_0x45ab67===_0x3abe92(0xa5)&&assertUnambiguousPatchResources(_0x33e62c,_0x3394d2,_0x104e2c);const _0x24b68d=_0x45ab67===_0x3abe92(0xa5)?patchResources(_0x3394d2,_0x104e2c):replaceResources(_0x104e2c),_0x5c9f38=[],_0x359740=_0x3394d2[_0x3abe92(0xdc)](isJsResource),_0x2fe649=_0x24b68d[_0x3abe92(0xdc)](isJsResource);if(_0x359740&&!_0x2fe649){const _0x230d45='menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22'+_0x33e62c[_0x3abe92(0xdd)]+_0x3abe92(0xd3)+_0x33e62c[_0x3abe92(0xc3)]+').\x20'+_0x3abe92(0xba);if(!_0x5d3a91)throw new Error(_0x230d45);_0x5c9f38[_0x3abe92(0xab)](_0x230d45);}const _0x2ac048=_0x3394d2[_0x3abe92(0xdc)](isCssResource),_0x1cb8a6=_0x24b68d[_0x3abe92(0xdc)](isCssResource);_0x2ac048&&!_0x1cb8a6&&_0x5c9f38[_0x3abe92(0xab)](_0x3abe92(0xa2)+_0x33e62c[_0x3abe92(0xdd)]+_0x3abe92(0xd3)+_0x33e62c['path']+').');const _0x375604=typeof _0x33e62c[_0x3abe92(0xcf)]?.[_0x3abe92(0xc6)]===_0x3abe92(0x99)?_0x33e62c[_0x3abe92(0xcf)]['loadScriptMode']:null,_0x35c128=_0x5307ae?{'loadScriptMode':_0x375604}:{},_0x352021=_0x5307ae?{'loadScriptMode':_0x5307ae}:{};return{'id':_0x33e62c['id'],'label':_0x33e62c['label'],'path':_0x33e62c[_0x3abe92(0xc3)],'mode':_0x45ab67,'before':{'resources':_0x3394d2,..._0x35c128},'after':{'resources':_0x24b68d,..._0x352021},'warnings':_0x5c9f38};}function replaceResources(_0x18656f){const _0x320df9=a186_0x3c1b;return[_0x18656f[_0x320df9(0xc7)],_0x18656f[_0x320df9(0xc2)]][_0x320df9(0xb4)](_0xef63ea=>!!_0xef63ea);}function assertUnambiguousPatchResources(_0x19f380,_0x220ebc,_0x238372){const _0x4adde3=a186_0x3c1b,_0x4ec73=_0x220ebc[_0x4adde3(0xb4)](isJsResource)[_0x4adde3(0xc1)];if(_0x238372[_0x4adde3(0xc7)]&&_0x4ec73>0x1)throw new Error(_0x4adde3(0xd4)+_0x4ec73+'\x20existing\x20JS\x20resources\x20for\x20\x22'+_0x19f380[_0x4adde3(0xdd)]+'\x22\x20('+_0x19f380[_0x4adde3(0xc3)]+')\x20'+_0x4adde3(0x9e));const _0x1e8b30=_0x220ebc[_0x4adde3(0xb4)](isCssResource)[_0x4adde3(0xc1)];if(_0x238372['cssUrl']&&_0x1e8b30>0x1)throw new Error(_0x4adde3(0xd4)+_0x1e8b30+_0x4adde3(0xcc)+_0x19f380[_0x4adde3(0xdd)]+'\x22\x20('+_0x19f380[_0x4adde3(0xc3)]+')\x20'+_0x4adde3(0xbb));}function patchResources(_0x5260ff,_0x42b022){const _0x2c7998=a186_0x3c1b;let _0x45cfdf=![],_0x4ada16=![];const _0x55be6c=[];for(const _0x299555 of _0x5260ff){if(isJsResource(_0x299555)){if(_0x42b022[_0x2c7998(0xc7)]&&!_0x45cfdf)_0x55be6c[_0x2c7998(0xab)](_0x42b022[_0x2c7998(0xc7)]),_0x45cfdf=!![];else!_0x42b022['jsUrl']&&_0x55be6c['push'](_0x299555);continue;}if(isCssResource(_0x299555)){if(_0x42b022[_0x2c7998(0xc2)]&&!_0x4ada16)_0x55be6c[_0x2c7998(0xab)](_0x42b022[_0x2c7998(0xc2)]),_0x4ada16=!![];else!_0x42b022[_0x2c7998(0xc2)]&&_0x55be6c[_0x2c7998(0xab)](_0x299555);continue;}_0x55be6c[_0x2c7998(0xab)](_0x299555);}return _0x42b022[_0x2c7998(0xc7)]&&!_0x45cfdf&&_0x55be6c[_0x2c7998(0xb0)](_0x42b022[_0x2c7998(0xc7)]),_0x42b022['cssUrl']&&!_0x4ada16&&_0x55be6c[_0x2c7998(0xab)](_0x42b022[_0x2c7998(0xc2)]),_0x55be6c;}function isJsResource(_0x6ec1fb){const _0x462f7d=a186_0x3c1b;return stripQuery(_0x6ec1fb)[_0x462f7d(0xb1)]()[_0x462f7d(0xc4)](_0x462f7d(0x9a));}function isCssResource(_0x289f9f){const _0x5576d4=a186_0x3c1b;return stripQuery(_0x289f9f)[_0x5576d4(0xb1)]()[_0x5576d4(0xc4)](_0x5576d4(0xb5));}function stripQuery(_0x4fc666){return _0x4fc666['split']('?')[0x0]??_0x4fc666;}function parseUpdateParamsFlag(_0x383a53){const _0x559746=a186_0x3c1b;if(!_0x383a53||typeof _0x383a53!==_0x559746(0x99))return{};try{const _0x176f1d=JSON[_0x559746(0xcd)](_0x383a53);if(typeof _0x176f1d!==_0x559746(0xb9)||_0x176f1d===null||Array[_0x559746(0x9d)](_0x176f1d))return{};return{'jsUrl':typeof _0x176f1d[_0x559746(0xc7)]==='string'?_0x176f1d['jsUrl'][_0x559746(0xda)]():undefined,'cssUrl':typeof _0x176f1d[_0x559746(0xc2)]===_0x559746(0x99)?_0x176f1d['cssUrl'][_0x559746(0xda)]():undefined};}catch{return{};}}
@@ -1 +1 @@
1
- function a187_0x20bf(_0x2373c4,_0x134e6d){_0x2373c4=_0x2373c4-0x10b;const _0x1a116a=a187_0x1a11();let _0x20bfd0=_0x1a116a[_0x2373c4];return _0x20bfd0;}function a187_0x1a11(){const _0x4a9877=['2073510vhjsFt','GET','406940EPvzOM','6JcqWax','1YTyImH','3509231SdHeOe','cancel','1094578QsoNvD','133648uIcMLp','170HbmTNf','8BZTrLb','4618523jLJidS','test','7016391DwZRmm','body','HEAD'];a187_0x1a11=function(){return _0x4a9877;};return a187_0x1a11();}(function(_0x563ce4,_0x27f9a3){const _0x1dbb0b=a187_0x20bf,_0x3672d9=_0x563ce4();while(!![]){try{const _0x518581=-parseInt(_0x1dbb0b(0x113))/0x1*(-parseInt(_0x1dbb0b(0x116))/0x2)+parseInt(_0x1dbb0b(0x10f))/0x3+parseInt(_0x1dbb0b(0x117))/0x4*(-parseInt(_0x1dbb0b(0x118))/0x5)+parseInt(_0x1dbb0b(0x112))/0x6*(-parseInt(_0x1dbb0b(0x11a))/0x7)+-parseInt(_0x1dbb0b(0x119))/0x8*(-parseInt(_0x1dbb0b(0x10c))/0x9)+parseInt(_0x1dbb0b(0x111))/0xa+parseInt(_0x1dbb0b(0x114))/0xb;if(_0x518581===_0x27f9a3)break;else _0x3672d9['push'](_0x3672d9['shift']());}catch(_0x87a286){_0x3672d9['push'](_0x3672d9['shift']());}}}(a187_0x1a11,0x8e158));export function isValidJsHttpsUrl(_0xb9de1){const _0x4fed6d=a187_0x20bf;return/^https:\/\/.+\.js(\?.*)?$/[_0x4fed6d(0x10b)](_0xb9de1['trim']());}export function isValidCssHttpsUrl(_0x195903){const _0x216ece=a187_0x20bf;return/^https:\/\/.+\.css(\?.*)?$/[_0x216ece(0x10b)](_0x195903['trim']());}export async function isUrlReachable(_0x13f71b){const _0x91be79=a187_0x20bf;try{const _0x49c501=await fetch(_0x13f71b,{'method':_0x91be79(0x10e)});if(_0x49c501['ok'])return!![];}catch{}try{const _0x152705=await fetch(_0x13f71b,{'method':_0x91be79(0x110),'headers':{'Range':'bytes=0-0'}}),_0x1904a7=_0x152705['ok'];try{await _0x152705[_0x91be79(0x10d)]?.[_0x91be79(0x115)]();}catch{}return _0x1904a7;}catch{return![];}}
1
+ function a187_0x59c4(_0x226046,_0xfe15d){_0x226046=_0x226046-0x1bd;const _0x359add=a187_0x359a();let _0x59c4ce=_0x359add[_0x226046];return _0x59c4ce;}(function(_0x186161,_0x10add2){const _0x2efb06=a187_0x59c4,_0x500d55=_0x186161();while(!![]){try{const _0x46a4fa=parseInt(_0x2efb06(0x1c4))/0x1+-parseInt(_0x2efb06(0x1c3))/0x2*(parseInt(_0x2efb06(0x1bf))/0x3)+-parseInt(_0x2efb06(0x1cb))/0x4*(-parseInt(_0x2efb06(0x1c1))/0x5)+parseInt(_0x2efb06(0x1c8))/0x6+parseInt(_0x2efb06(0x1bd))/0x7*(-parseInt(_0x2efb06(0x1c0))/0x8)+-parseInt(_0x2efb06(0x1c7))/0x9+parseInt(_0x2efb06(0x1be))/0xa;if(_0x46a4fa===_0x10add2)break;else _0x500d55['push'](_0x500d55['shift']());}catch(_0x54535b){_0x500d55['push'](_0x500d55['shift']());}}}(a187_0x359a,0xf2bd7));export function isValidJsHttpsUrl(_0x3e4f7){const _0x3395=a187_0x59c4;return/^https:\/\/.+\.js(\?.*)?$/[_0x3395(0x1ca)](_0x3e4f7[_0x3395(0x1c6)]());}function a187_0x359a(){const _0x529992=['1194393KpKROq','60544qwVASn','1225ACwKKW','bytes=0-0','4vnXpqO','537795LtkLKj','GET','trim','6321105ecpTQD','10519500VgCMMy','HEAD','test','15588hcaNVS','1764TNUdHo','11541960vBJWoH'];a187_0x359a=function(){return _0x529992;};return a187_0x359a();}export function isValidCssHttpsUrl(_0x207e61){const _0x2c1983=a187_0x59c4;return/^https:\/\/.+\.css(\?.*)?$/['test'](_0x207e61[_0x2c1983(0x1c6)]());}export async function isUrlReachable(_0x4eb51e){const _0x308365=a187_0x59c4;try{const _0x124670=await fetch(_0x4eb51e,{'method':_0x308365(0x1c9)});if(_0x124670['ok'])return!![];}catch{}try{const _0xad5f75=await fetch(_0x4eb51e,{'method':_0x308365(0x1c5),'headers':{'Range':_0x308365(0x1c2)}}),_0x181c9a=_0xad5f75['ok'];try{await _0xad5f75['body']?.['cancel']();}catch{}return _0x181c9a;}catch{return![];}}
@@ -1 +1 @@
1
- function a188_0x3b92(_0x29d4c2,_0x3f6fc7){_0x29d4c2=_0x29d4c2-0x1c6;const _0x41fcf4=a188_0x41fc();let _0x3b92c4=_0x41fcf4[_0x29d4c2];return _0x3b92c4;}const a188_0x48cdaf=a188_0x3b92;(function(_0x902492,_0x5720ae){const _0x520678=a188_0x3b92,_0x449d32=_0x902492();while(!![]){try{const _0x5bedb9=-parseInt(_0x520678(0x1cd))/0x1+-parseInt(_0x520678(0x1d1))/0x2*(-parseInt(_0x520678(0x1d2))/0x3)+parseInt(_0x520678(0x1cf))/0x4*(-parseInt(_0x520678(0x1c8))/0x5)+parseInt(_0x520678(0x1cc))/0x6*(-parseInt(_0x520678(0x1cb))/0x7)+-parseInt(_0x520678(0x1d6))/0x8*(parseInt(_0x520678(0x1ce))/0x9)+parseInt(_0x520678(0x1d4))/0xa+parseInt(_0x520678(0x1c7))/0xb;if(_0x5bedb9===_0x5720ae)break;else _0x449d32['push'](_0x449d32['shift']());}catch(_0x24c77e){_0x449d32['push'](_0x449d32['shift']());}}}(a188_0x41fc,0xcb143));function a188_0x41fc(){const _0x13bca1=['18008CtUPtV','\x20menu(s)\x20for\x20','10ybQueK','281811NPCowK','cookie','4479580gDaJTJ','read','561992vihRlW','\x20in\x20menu\x20host\x20','39650886dHJJWd','300fCMhSh','all','boundMenus','14rWWmDQ','1164624BLSmEq','1416403pchlFy','207ZAaRFd'];a188_0x41fc=function(){return _0x13bca1;};return a188_0x41fc();}import{getSmartAppRecord}from'../../core/api-client.js';import{getOnlineMenuList}from'../../commands/menu/shared/service.js';import{buildSubappAssetsStatus,getSubappSelector,SUBAPP_ASSET_SELECTOR_FLAGS}from'../../commands/menu/shared/subapp-assets.js';export const menuSubappAssetsStatus={'service':'menu','command':'subapp-assets-status','description':'Inspect\x20shared\x20frontend\x20subapp\x20resources\x20and\x20menu\x20fallbacks\x20in\x20the\x20selected\x20menu\x20host','risk':a188_0x48cdaf(0x1d5),'strictFlags':!![],'flags':SUBAPP_ASSET_SELECTOR_FLAGS,async 'validate'(_0x260ce0){getSubappSelector(_0x260ce0);},async 'execute'(_0x41b471){const _0x474090=a188_0x48cdaf,{appCode:_0x1bc450,appName:_0x3a57fa}=getSubappSelector(_0x41b471),[_0x34750f,_0x35f2e1]=await Promise[_0x474090(0x1c9)]([getSmartAppRecord(_0x1bc450,_0x41b471[_0x474090(0x1d3)]),getOnlineMenuList(_0x1bc450,_0x41b471['cookie'])]),_0x2a20bf={'appCode':_0x1bc450,...buildSubappAssetsStatus(_0x34750f,_0x35f2e1,_0x3a57fa)};return{'ok':!![],'data':_0x2a20bf,'message':'Inspected\x20'+_0x2a20bf[_0x474090(0x1ca)]+_0x474090(0x1d0)+_0x3a57fa+_0x474090(0x1c6)+_0x1bc450+'.'};}};
1
+ const a188_0x55f78b=a188_0x1ac3;(function(_0x400781,_0x8ea382){const _0x1a5522=a188_0x1ac3,_0x1a3169=_0x400781();while(!![]){try{const _0x57b4f6=-parseInt(_0x1a5522(0x151))/0x1+-parseInt(_0x1a5522(0x14d))/0x2+parseInt(_0x1a5522(0x14f))/0x3*(-parseInt(_0x1a5522(0x152))/0x4)+-parseInt(_0x1a5522(0x150))/0x5*(-parseInt(_0x1a5522(0x14e))/0x6)+-parseInt(_0x1a5522(0x15a))/0x7+-parseInt(_0x1a5522(0x15b))/0x8+parseInt(_0x1a5522(0x158))/0x9;if(_0x57b4f6===_0x8ea382)break;else _0x1a3169['push'](_0x1a3169['shift']());}catch(_0x5565ed){_0x1a3169['push'](_0x1a3169['shift']());}}}(a188_0x3008,0x4879c));function a188_0x3008(){const _0x409457=['280dVPQeH','\x20menu(s)\x20for\x20','cookie','all','\x20in\x20menu\x20host\x20','Inspect\x20shared\x20frontend\x20subapp\x20resources\x20and\x20menu\x20fallbacks\x20in\x20the\x20selected\x20menu\x20host','13086684HFKvEl','read','134120dfsnVB','4688536mkpDjX','263624Ddviyy','405858PoCREv','2358GiWdOR','5vYCZoS','432800pySAdX'];a188_0x3008=function(){return _0x409457;};return a188_0x3008();}function a188_0x1ac3(_0x3f5ad0,_0x46db95){_0x3f5ad0=_0x3f5ad0-0x14d;const _0x3008ae=a188_0x3008();let _0x1ac311=_0x3008ae[_0x3f5ad0];return _0x1ac311;}import{getSmartAppRecord}from'../../core/api-client.js';import{getOnlineMenuList}from'../../commands/menu/shared/service.js';import{buildSubappAssetsStatus,getSubappSelector,SUBAPP_ASSET_SELECTOR_FLAGS}from'../../commands/menu/shared/subapp-assets.js';export const menuSubappAssetsStatus={'service':'menu','command':'subapp-assets-status','description':a188_0x55f78b(0x157),'risk':a188_0x55f78b(0x159),'strictFlags':!![],'flags':SUBAPP_ASSET_SELECTOR_FLAGS,async 'validate'(_0x41961b){getSubappSelector(_0x41961b);},async 'execute'(_0x56c0a3){const _0x2823cd=a188_0x55f78b,{appCode:_0x2f2100,appName:_0x2bfbcf}=getSubappSelector(_0x56c0a3),[_0x57f12a,_0x2b5f14]=await Promise[_0x2823cd(0x155)]([getSmartAppRecord(_0x2f2100,_0x56c0a3[_0x2823cd(0x154)]),getOnlineMenuList(_0x2f2100,_0x56c0a3[_0x2823cd(0x154)])]),_0x1e6f0e={'appCode':_0x2f2100,...buildSubappAssetsStatus(_0x57f12a,_0x2b5f14,_0x2bfbcf)};return{'ok':!![],'data':_0x1e6f0e,'message':'Inspected\x20'+_0x1e6f0e['boundMenus']+_0x2823cd(0x153)+_0x2bfbcf+_0x2823cd(0x156)+_0x2f2100+'.'};}};
@@ -1 +1 @@
1
- const a189_0x5993aa=a189_0x2e7d;(function(_0x12e37d,_0x20fbfb){const _0x22c894=a189_0x2e7d,_0x35080c=_0x12e37d();while(!![]){try{const _0x99c034=-parseInt(_0x22c894(0x148))/0x1+parseInt(_0x22c894(0x15b))/0x2*(-parseInt(_0x22c894(0x12b))/0x3)+parseInt(_0x22c894(0x13d))/0x4+parseInt(_0x22c894(0x12c))/0x5*(parseInt(_0x22c894(0x12d))/0x6)+parseInt(_0x22c894(0x164))/0x7*(parseInt(_0x22c894(0x169))/0x8)+parseInt(_0x22c894(0x141))/0x9*(-parseInt(_0x22c894(0x161))/0xa)+-parseInt(_0x22c894(0x13e))/0xb*(-parseInt(_0x22c894(0x146))/0xc);if(_0x99c034===_0x20fbfb)break;else _0x35080c['push'](_0x35080c['shift']());}catch(_0x426e2d){_0x35080c['push'](_0x35080c['shift']());}}}(a189_0x2995,0x510ea));import{createHash}from'node:crypto';import{isDeepStrictEqual}from'node:util';import{getSmartAppRecord,updateSmartAppRecord}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{getSubappSelector,SUBAPP_ASSET_SELECTOR_FLAGS}from'../../commands/menu/shared/subapp-assets.js';const KNOWN_EXTEND_KEYS=new Set([a189_0x5993aa(0x167),'enableOpenApi',a189_0x5993aa(0x165),'assets','tenantColumn',a189_0x5993aa(0x170),a189_0x5993aa(0x13a),a189_0x5993aa(0x130),'directDbId',a189_0x5993aa(0x131)]);function parseObject(_0x3b3c8c,_0x453639){const _0x1a354a=a189_0x5993aa;let _0x4411fe=_0x3b3c8c;if(typeof _0x3b3c8c===_0x1a354a(0x168))try{_0x4411fe=JSON[_0x1a354a(0x156)](_0x3b3c8c);}catch{throw CliErrors[_0x1a354a(0x135)](_0x453639+_0x1a354a(0x172));}if(!_0x4411fe||typeof _0x4411fe!==_0x1a354a(0x138)||Array[_0x1a354a(0x16c)](_0x4411fe))throw CliErrors['validation'](_0x453639+_0x1a354a(0x14a));return _0x4411fe;}function parseArray(_0x5576a8,_0xb14f0f){const _0x1b923f=a189_0x5993aa;let _0x2bdce2;try{_0x2bdce2=JSON[_0x1b923f(0x156)](_0x5576a8);}catch{throw CliErrors[_0x1b923f(0x135)](_0xb14f0f+_0x1b923f(0x172));}if(!Array['isArray'](_0x2bdce2))throw CliErrors[_0x1b923f(0x135)](_0xb14f0f+_0x1b923f(0x14f));return _0x2bdce2[_0x1b923f(0x16f)]((_0xf21589,_0x1c130b)=>parseObject(_0xf21589,_0xb14f0f+'['+_0x1c130b+']'));}function validateResources(_0x59e78f){const _0x295b58=a189_0x5993aa;if(_0x59e78f[_0x295b58(0x143)]===0x0)throw CliErrors[_0x295b58(0x135)](_0x295b58(0x140));for(const [_0x26dfd1,_0x32f32b]of _0x59e78f[_0x295b58(0x14d)]()){if(typeof _0x32f32b!=='string')throw CliErrors[_0x295b58(0x135)](_0x295b58(0x144)+_0x26dfd1+_0x295b58(0x14b));try{if(new URL(_0x32f32b)[_0x295b58(0x12f)]!==_0x295b58(0x162))throw new Error('not\x20HTTPS');}catch{throw CliErrors['validation'](_0x295b58(0x144)+_0x26dfd1+_0x295b58(0x137));}}if(new Set(_0x59e78f)[_0x295b58(0x171)]!==_0x59e78f[_0x295b58(0x143)]||!_0x59e78f[_0x295b58(0x16a)](_0x404fdd=>/\.m?js(?:[?#]|$)/i[_0x295b58(0x163)](_0x404fdd)))throw CliErrors['validation'](_0x295b58(0x126));return _0x59e78f;}function a189_0x2995(){const _0x5ecc7b=['write','App\x20ID\x20or\x20publish\x20status\x20is\x20missing;\x20refusing\x20a\x20generic\x20app\x20update.','assets','Existing\x20subapp.resources\x20contains\x20invalid\x20JSON.','JSON\x20array\x20of\x20HTTPS\x20resource\x20URLs','Resources\x20need\x20one\x20JS\x20entry\x20and\x20no\x20duplicate\x20URLs.','App\x20asset\x20update\x20verification\x20failed;\x20inspect\x20the\x20app\x20before\x20retrying.','Existing\x20subapp.resources\x20must\x20be\x20a\x20JSON\x20string.','apiError','filter','1799109rojKbs','688030JplwRM','12abxsoM','resources','protocol','enableAutoSync','directDbEnabled','join','App\x20assets\x20or\x20update\x20target\x20changed\x20since\x20preview;\x20the\x20fingerprint\x20does\x20not\x20match.\x20Run\x20a\x20new\x20dry-run.','nextExtend','validation','isSafeInteger',']\x20must\x20be\x20an\x20absolute\x20HTTPS\x20URL.','object','before','vipDeploy','\x20in\x20menu\x20host\x20','Management\x20app\x20assets\x20already\x20match;\x20independent\x20deployment\x20not\x20verified.','235532HsALlS','1199704QoQmdl','unchanged','At\x20least\x20one\x20resource\x20URL\x20is\x20required.','9XCPPyR','has','length','resources[','app.extend.assets','96ZgrvfX','digest','428715PCXOGQ','subapp-assets-update','\x20must\x20be\x20a\x20JSON\x20object.',']\x20must\x20be\x20a\x20URL\x20string.','expectedHash','entries','cookie','\x20must\x20be\x20a\x20JSON\x20array.','appName','hex','appCode','trim','Existing\x20subapp.resources\x20must\x20be\x20an\x20array\x20of\x20URLs.','.\x20Refusing\x20update.','parse','app.extend','update','--resources\x20is\x20required.','app.extend.assets\x20must\x20be\x20a\x20JSON\x20string;\x20refusing\x20update.','2xUGKSx','Would\x20update\x20shared\x20assets\x20for\x20','--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.','expected-hash','stringify','sha256','2340790zUdEHh','https:','test','175FvubSs','accessKey','appPublishStatus','skinColor','string','124128bYEeOx','some','Expected\x20exactly\x20one\x20existing\x20subapp\x20entry\x20for\x20','isArray','Shared\x20assets\x20already\x20match\x20the\x20requested\x20URLs.','extend','map','enableSample','size','\x20contains\x20invalid\x20JSON.'];a189_0x2995=function(){return _0x5ecc7b;};return a189_0x2995();}function a189_0x2e7d(_0x47cae6,_0x318f93){_0x47cae6=_0x47cae6-0x124;const _0x2995a1=a189_0x2995();let _0x2e7d06=_0x2995a1[_0x47cae6];return _0x2e7d06;}function prepare(_0x428708,_0x25f859,_0x2372f9){const _0x249f15=a189_0x5993aa;if(!Number[_0x249f15(0x136)](_0x428708['id'])||(_0x428708['id']??0x0)<=0x0||typeof _0x428708[_0x249f15(0x166)]!==_0x249f15(0x168)||!_0x428708[_0x249f15(0x166)])throw CliErrors[_0x249f15(0x135)](_0x249f15(0x174));const _0x15df47=parseObject(_0x428708['extend'],_0x249f15(0x157)),_0x5b054f=Object['keys'](_0x15df47)[_0x249f15(0x12a)](_0x4f9626=>!KNOWN_EXTEND_KEYS[_0x249f15(0x142)](_0x4f9626));if(_0x5b054f['length'])throw CliErrors['validation']('Unknown\x20app.extend\x20fields:\x20'+_0x5b054f[_0x249f15(0x132)](',\x20')+_0x249f15(0x155));if(typeof _0x15df47[_0x249f15(0x175)]!==_0x249f15(0x168))throw CliErrors[_0x249f15(0x135)](_0x249f15(0x15a));const _0x1c81df=parseArray(_0x15df47[_0x249f15(0x175)],_0x249f15(0x145)),_0x14c2c3=_0x1c81df[_0x249f15(0x12a)](_0x428007=>_0x428007[_0x249f15(0x150)]===_0x25f859);if(_0x14c2c3[_0x249f15(0x143)]!==0x1)throw CliErrors['validation'](_0x249f15(0x16b)+_0x25f859+';\x20found\x20'+_0x14c2c3['length']+'.');const _0x13c4d6=_0x14c2c3[0x0];if(typeof _0x13c4d6[_0x249f15(0x12e)]!==_0x249f15(0x168))throw CliErrors[_0x249f15(0x135)](_0x249f15(0x128));let _0x426d94;try{_0x426d94=JSON['parse'](_0x13c4d6['resources']);}catch{throw CliErrors['validation'](_0x249f15(0x124));}if(!Array[_0x249f15(0x16c)](_0x426d94)||_0x426d94[_0x249f15(0x16a)](_0x3d2eaa=>typeof _0x3d2eaa!==_0x249f15(0x168)))throw CliErrors[_0x249f15(0x135)](_0x249f15(0x154));const _0x248efc=_0x1c81df[_0x249f15(0x16f)](_0x2db5f9=>_0x2db5f9===_0x13c4d6?{..._0x2db5f9,'resources':JSON[_0x249f15(0x15f)](_0x2372f9)}:_0x2db5f9),_0x587641={..._0x15df47,'assets':JSON[_0x249f15(0x15f)](_0x248efc)},_0x252701=createHash(_0x249f15(0x160))[_0x249f15(0x158)](JSON[_0x249f15(0x15f)]({'appCode':_0x428708[_0x249f15(0x152)],'id':_0x428708['id'],'appPublishStatus':_0x428708[_0x249f15(0x166)],'extend':_0x15df47,'appName':_0x25f859,'resources':_0x2372f9}))[_0x249f15(0x147)](_0x249f15(0x151));return{'before':_0x426d94,'nextExtend':_0x587641,'expectedHash':_0x252701,'unchanged':isDeepStrictEqual(_0x426d94,_0x2372f9)};}function flags(_0x2d1e74){const _0x462451=a189_0x5993aa,{appCode:_0xbe64c,appName:_0x48f354}=getSubappSelector(_0x2d1e74),_0x2d7447=_0x2d1e74['str'](_0x462451(0x12e))[_0x462451(0x153)]();if(!_0x2d7447)throw CliErrors[_0x462451(0x135)](_0x462451(0x159));let _0x4a210e;try{_0x4a210e=JSON[_0x462451(0x156)](_0x2d7447);}catch{throw CliErrors[_0x462451(0x135)](_0x462451(0x15d));}if(!Array[_0x462451(0x16c)](_0x4a210e))throw CliErrors[_0x462451(0x135)]('--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.');return{'appCode':_0xbe64c,'appName':_0x48f354,'resources':validateResources(_0x4a210e)};}export const menuSubappAssetsUpdate={'service':'menu','command':a189_0x5993aa(0x149),'description':'Update\x20one\x20frontend\x20subapp\x20resource\x20URL\x20set\x20in\x20the\x20selected\x20menu\x20host','risk':a189_0x5993aa(0x173),'strictFlags':!![],'flags':[...SUBAPP_ASSET_SELECTOR_FLAGS,{'name':a189_0x5993aa(0x12e),'type':a189_0x5993aa(0x168),'required':!![],'description':a189_0x5993aa(0x125)},{'name':a189_0x5993aa(0x15e),'type':'string','description':'Preview\x20fingerprint\x20binding\x20the\x20host,\x20subapp,\x20resource\x20URLs\x20and\x20current\x20config;\x20required\x20for\x20writes'}],async 'validate'(_0x15adc4){flags(_0x15adc4);},async 'dryRun'(_0x93404){const _0x41ae2c=a189_0x5993aa,{appCode:_0x352e0f,appName:_0x52f378,resources:_0x270854}=flags(_0x93404),_0x3262ab=await getSmartAppRecord(_0x352e0f,_0x93404['cookie']),_0x26c00d=prepare(_0x3262ab,_0x52f378,_0x270854);return{'method':'POST','url':'/smartapi/app/update','body':{'preview':{'appCode':_0x352e0f,'appName':_0x52f378,'before':_0x26c00d[_0x41ae2c(0x139)],'after':_0x270854,'expectedHash':_0x26c00d[_0x41ae2c(0x14c)],'unchanged':_0x26c00d[_0x41ae2c(0x13f)],'remoteContentVerified':![],'independentDeploymentVerified':![]}},'description':_0x26c00d[_0x41ae2c(0x13f)]?_0x41ae2c(0x16d):_0x41ae2c(0x15c)+_0x52f378+'.'};},async 'execute'(_0x2a2d61){const _0x153e99=a189_0x5993aa,{appCode:_0x261419,appName:_0x1595d1,resources:_0x1c5f1a}=flags(_0x2a2d61),_0x577e15=_0x2a2d61['str'](_0x153e99(0x15e))[_0x153e99(0x153)]();if(!/^[a-f0-9]{64}$/i[_0x153e99(0x163)](_0x577e15))throw CliErrors[_0x153e99(0x135)]('--expected-hash\x20from\x20a\x20dry-run\x20is\x20required.');const _0xe47b2b=await getSmartAppRecord(_0x261419,_0x2a2d61[_0x153e99(0x14e)]),_0x3f7bab=prepare(_0xe47b2b,_0x1595d1,_0x1c5f1a);if(_0x577e15!==_0x3f7bab['expectedHash'])throw CliErrors[_0x153e99(0x135)](_0x153e99(0x133));if(_0x3f7bab[_0x153e99(0x13f)])return{'ok':!![],'data':{'appCode':_0x261419,'appName':_0x1595d1,'updated':![],'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0x153e99(0x13c)};await updateSmartAppRecord({'id':_0xe47b2b['id'],'appCode':_0x261419,'appPublishStatus':_0xe47b2b[_0x153e99(0x166)],'extend':_0x3f7bab[_0x153e99(0x134)]},_0x2a2d61['cookie']);const _0x145f78=await getSmartAppRecord(_0x261419,_0x2a2d61['cookie']),_0x990e45=parseObject(_0x145f78[_0x153e99(0x16e)],'verified\x20app.extend');if(_0x145f78['id']!==_0xe47b2b['id']||_0x145f78[_0x153e99(0x166)]!==_0xe47b2b[_0x153e99(0x166)]||!isDeepStrictEqual(_0x990e45,_0x3f7bab[_0x153e99(0x134)]))throw CliErrors[_0x153e99(0x129)](_0x153e99(0x127));return{'ok':!![],'data':{'appCode':_0x261419,'appName':_0x1595d1,'updated':!![],'resources':_0x1c5f1a,'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':'Updated\x20shared\x20resources\x20for\x20'+_0x1595d1+_0x153e99(0x13b)+_0x261419+';\x20independent\x20deployment\x20not\x20verified.'};}};
1
+ const a189_0x39bcaa=a189_0xfaae;(function(_0x3ef7ba,_0x278b4a){const _0x2c3878=a189_0xfaae,_0x2c6426=_0x3ef7ba();while(!![]){try{const _0x2113ae=-parseInt(_0x2c3878(0x14d))/0x1*(parseInt(_0x2c3878(0x131))/0x2)+-parseInt(_0x2c3878(0x158))/0x3*(parseInt(_0x2c3878(0x147))/0x4)+parseInt(_0x2c3878(0x14f))/0x5+parseInt(_0x2c3878(0x159))/0x6+-parseInt(_0x2c3878(0x14e))/0x7*(-parseInt(_0x2c3878(0x161))/0x8)+-parseInt(_0x2c3878(0x133))/0x9+parseInt(_0x2c3878(0x163))/0xa*(parseInt(_0x2c3878(0x14c))/0xb);if(_0x2113ae===_0x278b4a)break;else _0x2c6426['push'](_0x2c6426['shift']());}catch(_0x11da38){_0x2c6426['push'](_0x2c6426['shift']());}}}(a189_0x5769,0x2c4b1));import{createHash}from'node:crypto';import{isDeepStrictEqual}from'node:util';import{getSmartAppRecord,updateSmartAppRecord}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{getSubappSelector,SUBAPP_ASSET_SELECTOR_FLAGS}from'../../commands/menu/shared/subapp-assets.js';function a189_0x5769(){const _0x139f65=['protocol','length',';\x20found\x20','Updated\x20shared\x20resources\x20for\x20','404kQIYVf','POST','some','App\x20asset\x20update\x20verification\x20failed;\x20inspect\x20the\x20app\x20before\x20retrying.','skinColor','11NaDpDz','247354DQjQNi','14jVhlqm','374340sTqExX','subapp-assets-update','appCode',';\x20independent\x20deployment\x20not\x20verified.','hex','\x20contains\x20invalid\x20JSON.','Preview\x20fingerprint\x20binding\x20the\x20host,\x20subapp,\x20resource\x20URLs\x20and\x20current\x20config;\x20required\x20for\x20writes','Existing\x20subapp.resources\x20contains\x20invalid\x20JSON.','directDbEnabled','3354TNJmEc','988272YeSBSk','--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.','string','Update\x20one\x20frontend\x20subapp\x20resource\x20URL\x20set\x20in\x20the\x20selected\x20menu\x20host','not\x20HTTPS','assets','isArray','object','361672fWbgsz','Unknown\x20app.extend\x20fields:\x20','5471740DGtsyc','appPublishStatus','tenantColumn','Management\x20app\x20assets\x20already\x20match;\x20independent\x20deployment\x20not\x20verified.','--resources\x20is\x20required.','nextExtend','stringify','before','verified\x20app.extend','Resources\x20need\x20one\x20JS\x20entry\x20and\x20no\x20duplicate\x20URLs.','/smartapi/app/update','update','expectedHash','accessKey','Would\x20update\x20shared\x20assets\x20for\x20','extend','https:','Existing\x20subapp.resources\x20must\x20be\x20a\x20JSON\x20string.','apiError','validation','directDbId','join','filter','enableOpenApi','App\x20assets\x20or\x20update\x20target\x20changed\x20since\x20preview;\x20the\x20fingerprint\x20does\x20not\x20match.\x20Run\x20a\x20new\x20dry-run.','JSON\x20array\x20of\x20HTTPS\x20resource\x20URLs','has','At\x20least\x20one\x20resource\x20URL\x20is\x20required.','\x20must\x20be\x20a\x20JSON\x20array.','keys','unchanged','write','expected-hash','map','trim','Existing\x20subapp.resources\x20must\x20be\x20an\x20array\x20of\x20URLs.','2KOtZrH','size','3019275WdoReS','Shared\x20assets\x20already\x20match\x20the\x20requested\x20URLs.','cookie','sha256','parse','resources[','\x20must\x20be\x20a\x20JSON\x20object.','test','\x20in\x20menu\x20host\x20','vipDeploy','str','resources','app.extend.assets','app.extend.assets\x20must\x20be\x20a\x20JSON\x20string;\x20refusing\x20update.','--expected-hash\x20from\x20a\x20dry-run\x20is\x20required.','.\x20Refusing\x20update.'];a189_0x5769=function(){return _0x139f65;};return a189_0x5769();}const KNOWN_EXTEND_KEYS=new Set([a189_0x39bcaa(0x14b),a189_0x39bcaa(0x124),a189_0x39bcaa(0x11a),a189_0x39bcaa(0x15e),a189_0x39bcaa(0x165),'enableSample',a189_0x39bcaa(0x13c),'enableAutoSync',a189_0x39bcaa(0x121),a189_0x39bcaa(0x157)]);function parseObject(_0x5cb268,_0x7acb48){const _0x4d9870=a189_0x39bcaa;let _0x5870fb=_0x5cb268;if(typeof _0x5cb268===_0x4d9870(0x15b))try{_0x5870fb=JSON[_0x4d9870(0x137)](_0x5cb268);}catch{throw CliErrors[_0x4d9870(0x120)](_0x7acb48+_0x4d9870(0x154));}if(!_0x5870fb||typeof _0x5870fb!==_0x4d9870(0x160)||Array['isArray'](_0x5870fb))throw CliErrors[_0x4d9870(0x120)](_0x7acb48+_0x4d9870(0x139));return _0x5870fb;}function parseArray(_0x3da666,_0x307530){const _0x24328e=a189_0x39bcaa;let _0x1030d0;try{_0x1030d0=JSON[_0x24328e(0x137)](_0x3da666);}catch{throw CliErrors['validation'](_0x307530+_0x24328e(0x154));}if(!Array[_0x24328e(0x15f)](_0x1030d0))throw CliErrors['validation'](_0x307530+_0x24328e(0x129));return _0x1030d0['map']((_0x49f182,_0x208683)=>parseObject(_0x49f182,_0x307530+'['+_0x208683+']'));}function validateResources(_0x48410b){const _0x20c8b6=a189_0x39bcaa;if(_0x48410b['length']===0x0)throw CliErrors[_0x20c8b6(0x120)](_0x20c8b6(0x128));for(const [_0x32f1d6,_0x1ab59a]of _0x48410b['entries']()){if(typeof _0x1ab59a!==_0x20c8b6(0x15b))throw CliErrors[_0x20c8b6(0x120)](_0x20c8b6(0x138)+_0x32f1d6+']\x20must\x20be\x20a\x20URL\x20string.');try{if(new URL(_0x1ab59a)[_0x20c8b6(0x143)]!==_0x20c8b6(0x11d))throw new Error(_0x20c8b6(0x15d));}catch{throw CliErrors['validation'](_0x20c8b6(0x138)+_0x32f1d6+']\x20must\x20be\x20an\x20absolute\x20HTTPS\x20URL.');}}if(new Set(_0x48410b)[_0x20c8b6(0x132)]!==_0x48410b[_0x20c8b6(0x144)]||!_0x48410b['some'](_0x25759d=>/\.m?js(?:[?#]|$)/i[_0x20c8b6(0x13a)](_0x25759d)))throw CliErrors[_0x20c8b6(0x120)](_0x20c8b6(0x116));return _0x48410b;}function prepare(_0x1d299e,_0x5b0771,_0x1e0a59){const _0x710b5b=a189_0x39bcaa;if(!Number['isSafeInteger'](_0x1d299e['id'])||(_0x1d299e['id']??0x0)<=0x0||typeof _0x1d299e[_0x710b5b(0x164)]!=='string'||!_0x1d299e[_0x710b5b(0x164)])throw CliErrors[_0x710b5b(0x120)]('App\x20ID\x20or\x20publish\x20status\x20is\x20missing;\x20refusing\x20a\x20generic\x20app\x20update.');const _0x4d6566=parseObject(_0x1d299e['extend'],'app.extend'),_0x4497e8=Object[_0x710b5b(0x12a)](_0x4d6566)[_0x710b5b(0x123)](_0xee78c6=>!KNOWN_EXTEND_KEYS[_0x710b5b(0x127)](_0xee78c6));if(_0x4497e8[_0x710b5b(0x144)])throw CliErrors[_0x710b5b(0x120)](_0x710b5b(0x162)+_0x4497e8[_0x710b5b(0x122)](',\x20')+_0x710b5b(0x142));if(typeof _0x4d6566['assets']!=='string')throw CliErrors[_0x710b5b(0x120)](_0x710b5b(0x140));const _0x4041bb=parseArray(_0x4d6566[_0x710b5b(0x15e)],_0x710b5b(0x13f)),_0x59f931=_0x4041bb['filter'](_0x45118a=>_0x45118a['appName']===_0x5b0771);if(_0x59f931[_0x710b5b(0x144)]!==0x1)throw CliErrors['validation']('Expected\x20exactly\x20one\x20existing\x20subapp\x20entry\x20for\x20'+_0x5b0771+_0x710b5b(0x145)+_0x59f931[_0x710b5b(0x144)]+'.');const _0x45df14=_0x59f931[0x0];if(typeof _0x45df14['resources']!==_0x710b5b(0x15b))throw CliErrors[_0x710b5b(0x120)](_0x710b5b(0x11e));let _0x148092;try{_0x148092=JSON['parse'](_0x45df14['resources']);}catch{throw CliErrors[_0x710b5b(0x120)](_0x710b5b(0x156));}if(!Array[_0x710b5b(0x15f)](_0x148092)||_0x148092[_0x710b5b(0x149)](_0xee2125=>typeof _0xee2125!==_0x710b5b(0x15b)))throw CliErrors[_0x710b5b(0x120)](_0x710b5b(0x130));const _0x3eb7c2=_0x4041bb[_0x710b5b(0x12e)](_0x28268c=>_0x28268c===_0x45df14?{..._0x28268c,'resources':JSON['stringify'](_0x1e0a59)}:_0x28268c),_0x3291a0={..._0x4d6566,'assets':JSON[_0x710b5b(0x169)](_0x3eb7c2)},_0x49cc64=createHash(_0x710b5b(0x136))[_0x710b5b(0x118)](JSON[_0x710b5b(0x169)]({'appCode':_0x1d299e[_0x710b5b(0x151)],'id':_0x1d299e['id'],'appPublishStatus':_0x1d299e[_0x710b5b(0x164)],'extend':_0x4d6566,'appName':_0x5b0771,'resources':_0x1e0a59}))['digest'](_0x710b5b(0x153));return{'before':_0x148092,'nextExtend':_0x3291a0,'expectedHash':_0x49cc64,'unchanged':isDeepStrictEqual(_0x148092,_0x1e0a59)};}function flags(_0x1cb046){const _0x1cdb42=a189_0x39bcaa,{appCode:_0x1c47bd,appName:_0x3d6f67}=getSubappSelector(_0x1cb046),_0x4c1d69=_0x1cb046[_0x1cdb42(0x13d)]('resources')[_0x1cdb42(0x12f)]();if(!_0x4c1d69)throw CliErrors['validation'](_0x1cdb42(0x167));let _0x3d661f;try{_0x3d661f=JSON['parse'](_0x4c1d69);}catch{throw CliErrors[_0x1cdb42(0x120)](_0x1cdb42(0x15a));}if(!Array['isArray'](_0x3d661f))throw CliErrors[_0x1cdb42(0x120)]('--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.');return{'appCode':_0x1c47bd,'appName':_0x3d6f67,'resources':validateResources(_0x3d661f)};}function a189_0xfaae(_0x9ff9,_0x570f12){_0x9ff9=_0x9ff9-0x114;const _0x57694e=a189_0x5769();let _0xfaaecd=_0x57694e[_0x9ff9];return _0xfaaecd;}export const menuSubappAssetsUpdate={'service':'menu','command':a189_0x39bcaa(0x150),'description':a189_0x39bcaa(0x15c),'risk':a189_0x39bcaa(0x12c),'strictFlags':!![],'flags':[...SUBAPP_ASSET_SELECTOR_FLAGS,{'name':a189_0x39bcaa(0x13e),'type':a189_0x39bcaa(0x15b),'required':!![],'description':a189_0x39bcaa(0x126)},{'name':a189_0x39bcaa(0x12d),'type':a189_0x39bcaa(0x15b),'description':a189_0x39bcaa(0x155)}],async 'validate'(_0x276f91){flags(_0x276f91);},async 'dryRun'(_0x511513){const _0x37b15d=a189_0x39bcaa,{appCode:_0x41c4bc,appName:_0xfc5c93,resources:_0x3a1c4a}=flags(_0x511513),_0x48104c=await getSmartAppRecord(_0x41c4bc,_0x511513['cookie']),_0x307eee=prepare(_0x48104c,_0xfc5c93,_0x3a1c4a);return{'method':_0x37b15d(0x148),'url':_0x37b15d(0x117),'body':{'preview':{'appCode':_0x41c4bc,'appName':_0xfc5c93,'before':_0x307eee[_0x37b15d(0x114)],'after':_0x3a1c4a,'expectedHash':_0x307eee[_0x37b15d(0x119)],'unchanged':_0x307eee['unchanged'],'remoteContentVerified':![],'independentDeploymentVerified':![]}},'description':_0x307eee[_0x37b15d(0x12b)]?_0x37b15d(0x134):_0x37b15d(0x11b)+_0xfc5c93+'.'};},async 'execute'(_0x263570){const _0x5d5b4a=a189_0x39bcaa,{appCode:_0x488914,appName:_0x43cea6,resources:_0x289b2a}=flags(_0x263570),_0x3d1007=_0x263570[_0x5d5b4a(0x13d)](_0x5d5b4a(0x12d))[_0x5d5b4a(0x12f)]();if(!/^[a-f0-9]{64}$/i['test'](_0x3d1007))throw CliErrors[_0x5d5b4a(0x120)](_0x5d5b4a(0x141));const _0x4d9749=await getSmartAppRecord(_0x488914,_0x263570[_0x5d5b4a(0x135)]),_0x205f34=prepare(_0x4d9749,_0x43cea6,_0x289b2a);if(_0x3d1007!==_0x205f34[_0x5d5b4a(0x119)])throw CliErrors[_0x5d5b4a(0x120)](_0x5d5b4a(0x125));if(_0x205f34['unchanged'])return{'ok':!![],'data':{'appCode':_0x488914,'appName':_0x43cea6,'updated':![],'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0x5d5b4a(0x166)};await updateSmartAppRecord({'id':_0x4d9749['id'],'appCode':_0x488914,'appPublishStatus':_0x4d9749[_0x5d5b4a(0x164)],'extend':_0x205f34[_0x5d5b4a(0x168)]},_0x263570[_0x5d5b4a(0x135)]);const _0x56f9d1=await getSmartAppRecord(_0x488914,_0x263570[_0x5d5b4a(0x135)]),_0xf3c552=parseObject(_0x56f9d1[_0x5d5b4a(0x11c)],_0x5d5b4a(0x115));if(_0x56f9d1['id']!==_0x4d9749['id']||_0x56f9d1[_0x5d5b4a(0x164)]!==_0x4d9749[_0x5d5b4a(0x164)]||!isDeepStrictEqual(_0xf3c552,_0x205f34['nextExtend']))throw CliErrors[_0x5d5b4a(0x11f)](_0x5d5b4a(0x14a));return{'ok':!![],'data':{'appCode':_0x488914,'appName':_0x43cea6,'updated':!![],'resources':_0x289b2a,'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0x5d5b4a(0x146)+_0x43cea6+_0x5d5b4a(0x13b)+_0x488914+_0x5d5b4a(0x152)};}};