@lovrabet/rabetbase-cli 2.5.6 → 2.5.7

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 (395) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/api-group.js +1 -1
  3. package/lib/api/fetch-model-list.js +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/api/generate-sdk-config-file.js +1 -1
  6. package/lib/api/legacy-api-file.js +1 -1
  7. package/lib/api/model-registry-file.js +1 -1
  8. package/lib/api/model-registry-scaffold.js +1 -1
  9. package/lib/api/model-source.js +1 -1
  10. package/lib/auth/auth-server-ui.js +1 -1
  11. package/lib/auth/auth-server.js +1 -1
  12. package/lib/auth/constant.js +1 -1
  13. package/lib/auth/get-cookie.js +1 -1
  14. package/lib/auth/get-session-user.js +1 -1
  15. package/lib/auth/is-session-valid.js +1 -1
  16. package/lib/auth/login-success-html.js +1 -1
  17. package/lib/auth/logout.js +1 -1
  18. package/lib/cli-flags.js +1 -1
  19. package/lib/cli.js +1 -1
  20. package/lib/commands/api/generate.js +1 -1
  21. package/lib/commands/api/index.js +1 -1
  22. package/lib/commands/api/list.js +1 -1
  23. package/lib/commands/api/pull.js +1 -1
  24. package/lib/commands/api/shared.js +1 -1
  25. package/lib/commands/app/detail.js +1 -1
  26. package/lib/commands/app/index.js +1 -1
  27. package/lib/commands/app/list.js +1 -1
  28. package/lib/commands/app/members-list.js +1 -1
  29. package/lib/commands/app/remote-directory.js +1 -1
  30. package/lib/commands/app/shared.js +1 -1
  31. package/lib/commands/app-config/delete.js +1 -1
  32. package/lib/commands/app-config/get.js +1 -1
  33. package/lib/commands/app-config/index.js +1 -1
  34. package/lib/commands/app-config/list.js +1 -1
  35. package/lib/commands/app-config/set.js +1 -1
  36. package/lib/commands/app-config/shared.js +1 -1
  37. package/lib/commands/auth/index.js +1 -1
  38. package/lib/commands/bff/create.js +1 -1
  39. package/lib/commands/bff/delete.js +1 -1
  40. package/lib/commands/bff/detail.js +1 -1
  41. package/lib/commands/bff/index.js +1 -1
  42. package/lib/commands/bff/list.js +1 -1
  43. package/lib/commands/bff/logs.js +1 -1
  44. package/lib/commands/bff/pull.js +1 -1
  45. package/lib/commands/bff/push.js +1 -1
  46. package/lib/commands/bff/status.js +1 -1
  47. package/lib/commands/cli-skill/index.js +1 -1
  48. package/lib/commands/cli-update.js +1 -1
  49. package/lib/commands/codegen/index.js +1 -1
  50. package/lib/commands/codegen/sdk.js +1 -1
  51. package/lib/commands/codegen/sql.js +1 -1
  52. package/lib/commands/common/app-registry.js +1 -1
  53. package/lib/commands/common/app-selector.js +1 -1
  54. package/lib/commands/common/async-task.js +1 -1
  55. package/lib/commands/common/dry-run.js +1 -1
  56. package/lib/commands/common/flags.js +1 -1
  57. package/lib/commands/common/local-file.js +1 -1
  58. package/lib/commands/common/validate.js +1 -1
  59. package/lib/commands/config/delete.js +1 -1
  60. package/lib/commands/config/get.js +1 -1
  61. package/lib/commands/config/index.js +1 -1
  62. package/lib/commands/config/init.js +1 -1
  63. package/lib/commands/config/list.js +1 -1
  64. package/lib/commands/config/set.js +1 -1
  65. package/lib/commands/config/shared.js +1 -1
  66. package/lib/commands/dataset/batch-design.js +1 -1
  67. package/lib/commands/dataset/business-group-update.js +1 -1
  68. package/lib/commands/dataset/business-groups.js +1 -1
  69. package/lib/commands/dataset/capability.js +1 -1
  70. package/lib/commands/dataset/cross-relation-create.js +1 -1
  71. package/lib/commands/dataset/cross-relation-delete.js +1 -1
  72. package/lib/commands/dataset/cross-relation-list.js +1 -1
  73. package/lib/commands/dataset/cross-relation-shared.js +1 -1
  74. package/lib/commands/dataset/cross-relation-update.js +1 -1
  75. package/lib/commands/dataset/delete.js +1 -1
  76. package/lib/commands/dataset/design-context.js +1 -1
  77. package/lib/commands/dataset/design-start.js +1 -1
  78. package/lib/commands/dataset/design-status.js +1 -1
  79. package/lib/commands/dataset/design-sync-retry.js +1 -1
  80. package/lib/commands/dataset/design-sync-status.js +1 -1
  81. package/lib/commands/dataset/design-validate.js +1 -1
  82. package/lib/commands/dataset/detail.js +1 -1
  83. package/lib/commands/dataset/extend-update.js +1 -1
  84. package/lib/commands/dataset/field-restore.js +1 -1
  85. package/lib/commands/dataset/field-update.js +1 -1
  86. package/lib/commands/dataset/generate.js +1 -1
  87. package/lib/commands/dataset/index.js +1 -1
  88. package/lib/commands/dataset/list.js +1 -1
  89. package/lib/commands/dataset/operations.js +1 -1
  90. package/lib/commands/dataset/relation-audit.js +1 -1
  91. package/lib/commands/dataset/relation-create.js +1 -1
  92. package/lib/commands/dataset/relation-delete.js +1 -1
  93. package/lib/commands/dataset/relation-shared.js +1 -1
  94. package/lib/commands/dataset/relation-update.js +1 -1
  95. package/lib/commands/dataset/relations.js +1 -1
  96. package/lib/commands/dataset/rename.js +1 -1
  97. package/lib/commands/dataset/restore.js +1 -1
  98. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  99. package/lib/commands/db/analysis-batching.js +1 -1
  100. package/lib/commands/db/analyze-batch-plan.js +1 -1
  101. package/lib/commands/db/analyze-cancel.js +1 -1
  102. package/lib/commands/db/analyze-start.js +1 -1
  103. package/lib/commands/db/analyze-status.js +1 -1
  104. package/lib/commands/db/create.js +1 -1
  105. package/lib/commands/db/cross-db-analysis-shared.js +1 -1
  106. package/lib/commands/db/cross-db-analyze-latest.js +1 -1
  107. package/lib/commands/db/cross-db-analyze-start.js +1 -1
  108. package/lib/commands/db/cross-db-analyze-status.js +1 -1
  109. package/lib/commands/db/delete.js +1 -1
  110. package/lib/commands/db/detail.js +1 -1
  111. package/lib/commands/db/diff-refresh-start.js +1 -1
  112. package/lib/commands/db/diff-refresh-status.js +1 -1
  113. package/lib/commands/db/diff.js +1 -1
  114. package/lib/commands/db/index.js +1 -1
  115. package/lib/commands/db/list.js +1 -1
  116. package/lib/commands/db/shared.js +1 -1
  117. package/lib/commands/db/table-diff-shared.js +1 -1
  118. package/lib/commands/db/tables.js +1 -1
  119. package/lib/commands/db/test.js +1 -1
  120. package/lib/commands/db/update.js +1 -1
  121. package/lib/commands/deployment/index.js +1 -1
  122. package/lib/commands/deployment/sync-all.js +1 -1
  123. package/lib/commands/deployment/sync-jobs.js +1 -1
  124. package/lib/commands/deployment/sync-status.js +1 -1
  125. package/lib/commands/doctor.js +1 -1
  126. package/lib/commands/file/index.js +1 -1
  127. package/lib/commands/flow/create.js +1 -1
  128. package/lib/commands/flow/detail.js +1 -1
  129. package/lib/commands/flow/index.js +1 -1
  130. package/lib/commands/flow/list.js +1 -1
  131. package/lib/commands/flow/page-list.d.ts +2 -0
  132. package/lib/commands/flow/page-list.js +1 -0
  133. package/lib/commands/flow/publish.js +1 -1
  134. package/lib/commands/flow/runtime-resources-shared.d.ts +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.d.ts +6 -2
  140. package/lib/commands/flow/shared.js +1 -1
  141. package/lib/commands/flow/update.js +1 -1
  142. package/lib/commands/flow/validate.js +1 -1
  143. package/lib/commands/instant-api-policy/current.js +1 -1
  144. package/lib/commands/instant-api-policy/index.js +1 -1
  145. package/lib/commands/instant-api-policy/init.js +1 -1
  146. package/lib/commands/instant-api-policy/publish.js +1 -1
  147. package/lib/commands/instant-api-policy/pull.js +1 -1
  148. package/lib/commands/instant-api-policy/revision.js +1 -1
  149. package/lib/commands/instant-api-policy/revisions.js +1 -1
  150. package/lib/commands/instant-api-policy/rollback.js +1 -1
  151. package/lib/commands/instant-api-policy/shared.js +1 -1
  152. package/lib/commands/instant-api-policy/validate.js +1 -1
  153. package/lib/commands/issue/index.js +1 -1
  154. package/lib/commands/issue/nudge.js +1 -1
  155. package/lib/commands/issue/report.js +1 -1
  156. package/lib/commands/issue/shared.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.d.ts +26 -6
  292. package/lib/core/api-client.js +1 -1
  293. package/lib/core/bff/config.js +1 -1
  294. package/lib/core/bff/file-system.js +1 -1
  295. package/lib/core/bff/hash.js +1 -1
  296. package/lib/core/bff/hook-directory.js +1 -1
  297. package/lib/core/bff/lock.js +1 -1
  298. package/lib/core/bff/utils.js +1 -1
  299. package/lib/core/cross-db-analysis.js +1 -1
  300. package/lib/core/cross-db-relation.js +1 -1
  301. package/lib/core/db-resolver.js +1 -1
  302. package/lib/core/flow-config.d.ts +12 -0
  303. package/lib/core/flow-config.js +1 -1
  304. package/lib/core/instant-api-policy/config.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/telemetry/send-platform-issue-collect-log.js +1 -1
  355. package/lib/utils/ai_config.js +1 -1
  356. package/lib/utils/apply-jq-filter.js +1 -1
  357. package/lib/utils/cdn-config.js +1 -1
  358. package/lib/utils/check-sdk-version.js +1 -1
  359. package/lib/utils/cli-version-check.js +1 -1
  360. package/lib/utils/cli-version-policy.js +1 -1
  361. package/lib/utils/config.js +1 -1
  362. package/lib/utils/entity-with-id.js +1 -1
  363. package/lib/utils/file-utils.js +1 -1
  364. package/lib/utils/guides-cdn.js +1 -1
  365. package/lib/utils/http-client.js +1 -1
  366. package/lib/utils/is-non-interactive.js +1 -1
  367. package/lib/utils/logger.js +1 -1
  368. package/lib/utils/params.js +1 -1
  369. package/lib/utils/platform.js +1 -1
  370. package/lib/utils/sleep.js +1 -1
  371. package/lib/utils/template-replacer.js +1 -1
  372. package/lib/utils/update-notice.js +1 -1
  373. package/lib/utils/version.js +1 -1
  374. package/lib/utils/with-active-cookie.js +1 -1
  375. package/lib/utils/write-cli-side-channel.js +1 -1
  376. package/package.json +1 -1
  377. package/skills/rabetbase/SKILL.md +8 -4
  378. package/skills/rabetbase/guides/approval-flow-development-workflow.md +52 -13
  379. package/skills/rabetbase/guides/backend-function.md +26 -4
  380. package/skills/rabetbase/guides/bff-creation-workflow.md +9 -0
  381. package/skills/rabetbase/guides/cross-database-bff.md +1 -0
  382. package/skills/rabetbase/guides/custom-page-flow-sdk.md +2 -0
  383. package/skills/rabetbase/guides/data-api-guidelines.md +2 -0
  384. package/skills/rabetbase/guides/flow-config-examples.md +75 -0
  385. package/skills/rabetbase/guides/form-flow-start.md +61 -0
  386. package/skills/rabetbase/guides/typescript-sdk.md +1 -1
  387. package/skills/rabetbase/knowledge/approval-flow/config-json-schema.md +18 -4
  388. package/skills/rabetbase/references/rabetbase-codegen-sdk.md +5 -4
  389. package/skills/rabetbase/references/rabetbase-flow-commands.md +21 -2
  390. package/skills/rabetbase/references/rabetbase-flow-resources.md +21 -3
  391. package/skills/rabetbase/references/rabetbase-flow-runtime-boundary.md +6 -2
  392. package/skills/rabetbase/references/rabetbase-kb.md +4 -1
  393. package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
  394. package/skills/rabetbase-page-generation/SKILL.md +1 -1
  395. package/skills/rabetbase.manifest.json +5 -3
@@ -1 +1 @@
1
- (function(_0x5a2286,_0x2565f5){const _0x10142=a178_0x52f1,_0x42ae51=_0x5a2286();while(!![]){try{const _0x2cdc43=parseInt(_0x10142(0x105))/0x1+-parseInt(_0x10142(0x107))/0x2+-parseInt(_0x10142(0xfd))/0x3*(parseInt(_0x10142(0x108))/0x4)+parseInt(_0x10142(0x103))/0x5+parseInt(_0x10142(0xfe))/0x6+parseInt(_0x10142(0x100))/0x7+-parseInt(_0x10142(0x106))/0x8*(-parseInt(_0x10142(0x110))/0x9);if(_0x2cdc43===_0x2565f5)break;else _0x42ae51['push'](_0x42ae51['shift']());}catch(_0x3819f1){_0x42ae51['push'](_0x42ae51['shift']());}}}(a178_0x392a,0xf0d5c));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(_0x1796bb){const _0x2433fa=a178_0x52f1,_0x1884a3=[];return!isValidJsHttpsUrl(_0x1796bb)&&_0x1884a3[_0x2433fa(0x10a)](_0x2433fa(0x109)),{'ok':_0x1884a3['length']===0x0,'errors':_0x1884a3};}export function validateCssUrl(_0x4f4aa7){const _0x257bb3=a178_0x52f1,_0x38fbd6=[];return!isValidCssHttpsUrl(_0x4f4aa7)&&_0x38fbd6[_0x257bb3(0x10a)](_0x257bb3(0x102)),{'ok':_0x38fbd6[_0x257bb3(0x10c)]===0x0,'errors':_0x38fbd6};}export async function validateJsUrlReachable(_0x39d7cd){const _0x313354=a178_0x52f1,_0x226deb=validateJsUrl(_0x39d7cd);if(!_0x226deb['ok'])return _0x226deb;const _0x4426ab=await isUrlReachable(_0x39d7cd);if(!_0x4426ab)_0x226deb[_0x313354(0x104)]['push'](_0x313354(0x101));return{'ok':_0x226deb[_0x313354(0x104)][_0x313354(0x10c)]===0x0,'errors':_0x226deb[_0x313354(0x104)]};}export async function validateCssUrlReachable(_0x28083c){const _0x2ac09b=a178_0x52f1,_0x35557a=validateCssUrl(_0x28083c);if(!_0x35557a['ok'])return _0x35557a;const _0x8f2f29=await isUrlReachable(_0x28083c);if(!_0x8f2f29)_0x35557a['errors']['push'](_0x2ac09b(0x10e));return{'ok':_0x35557a[_0x2ac09b(0x104)][_0x2ac09b(0x10c)]===0x0,'errors':_0x35557a[_0x2ac09b(0x104)]};}export function buildCompareRows(_0x2d370f,_0x1d336e){const _0x2e9526=a178_0x52f1;return _0x2d370f[_0x2e9526(0x10f)](_0x3f7036=>({'label':_0x3f7036['label'],'path':_0x3f7036[_0x2e9526(0x10d)],'local':!![],'online':_0x1d336e[_0x2e9526(0xff)](menuPathKey(_0x3f7036[_0x2e9526(0x10d)]))}));}function a178_0x392a(){const _0x204855=['3rlQDcC','8832384PPTuvg','has','1429743LPlDfU','JS\x20URL\x20is\x20unreachable','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','276580AtPzDk','errors','1098512vJsnTt','19480XEMGef','3011934aBFUSa','1925516KJOmPY','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','push','label','length','path','CSS\x20URL\x20is\x20unreachable','map','531REPfXm'];a178_0x392a=function(){return _0x204855;};return a178_0x392a();}export async function doCreateMenus(_0x21680e,_0xf1dccd,_0x4638a8,_0x43294,_0x492857){const _0x35dbd9=a178_0x52f1,_0x3ee351=_0x492857?await createMenus(_0x21680e,_0xf1dccd,_0x4638a8,_0x43294,_0x492857):await createMenus(_0x21680e,_0xf1dccd,_0x4638a8,_0x43294);return{'created':_0x3ee351[_0x35dbd9(0x10c)],'failed':0x0,'labels':_0x4638a8[_0x35dbd9(0x10f)](_0x3458e9=>_0x3458e9[_0x35dbd9(0x10b)]),'menus':_0x3ee351};}export function filterMenusWithResources(_0x2c58c6){const _0x1f9403=a178_0x52f1;return _0x2c58c6['filter'](_0x131974=>_0x131974['resources'][_0x1f9403(0x10c)]>0x0);}function a178_0x52f1(_0x322692,_0x4521b2){_0x322692=_0x322692-0xfd;const _0x392afb=a178_0x392a();let _0x52f1a6=_0x392afb[_0x322692];return _0x52f1a6;}export async function fetchMenuData(_0x2ef892,_0x5dd0be){const _0x3fe93f=getLocalPages(),_0x3bc57f=await getOnlineMenuList(_0x2ef892,_0x5dd0be),_0xc1edd8=new Set(_0x3bc57f['map'](_0x3b0c62=>menuPathKey(_0x3b0c62['path'])));return{'localPages':_0x3fe93f,'onlineMenuList':_0x3bc57f,'onlinePaths':_0xc1edd8};}export async function fetchOnlineMenuList(_0x2dfef9,_0x77646f){return getOnlineMenuList(_0x2dfef9,_0x77646f);}
1
+ (function(_0x551ff7,_0x3a482e){const _0x114b50=a179_0x51ab,_0x5171b2=_0x551ff7();while(!![]){try{const _0x275d9a=parseInt(_0x114b50(0x8a))/0x1*(-parseInt(_0x114b50(0x90))/0x2)+-parseInt(_0x114b50(0x8f))/0x3+parseInt(_0x114b50(0x8b))/0x4*(-parseInt(_0x114b50(0x96))/0x5)+parseInt(_0x114b50(0x93))/0x6*(parseInt(_0x114b50(0x97))/0x7)+parseInt(_0x114b50(0x8c))/0x8+parseInt(_0x114b50(0x85))/0x9+parseInt(_0x114b50(0x91))/0xa*(parseInt(_0x114b50(0x83))/0xb);if(_0x275d9a===_0x3a482e)break;else _0x5171b2['push'](_0x5171b2['shift']());}catch(_0x3f193e){_0x5171b2['push'](_0x5171b2['shift']());}}}(a179_0x1718,0x7fae0));import{menuPathKey}from'../../../commands/menu/shared/path.js';function a179_0x1718(){const _0x5c055d=['2654622NhsmPd','map','resources','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','errors','1mKnUqp','4GdjlXQ','5757840fcjJzk','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','length','2932359oMmCmu','858148IcYDsH','10QkXoWW','CSS\x20URL\x20is\x20unreachable','6fwEltq','path','push','3653705LizcRP','1881831XijzSv','15143953ghfnLy','has'];a179_0x1718=function(){return _0x5c055d;};return a179_0x1718();}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(_0x4d6447){const _0x122e31=a179_0x51ab,_0x43c89c=[];return!isValidJsHttpsUrl(_0x4d6447)&&_0x43c89c[_0x122e31(0x95)](_0x122e31(0x8d)),{'ok':_0x43c89c['length']===0x0,'errors':_0x43c89c};}export function validateCssUrl(_0x8e588a){const _0x54f3da=a179_0x51ab,_0x46c1b0=[];return!isValidCssHttpsUrl(_0x8e588a)&&_0x46c1b0[_0x54f3da(0x95)](_0x54f3da(0x88)),{'ok':_0x46c1b0['length']===0x0,'errors':_0x46c1b0};}export async function validateJsUrlReachable(_0xc47b29){const _0xa7ce40=a179_0x51ab,_0x2d7d40=validateJsUrl(_0xc47b29);if(!_0x2d7d40['ok'])return _0x2d7d40;const _0x36c248=await isUrlReachable(_0xc47b29);if(!_0x36c248)_0x2d7d40[_0xa7ce40(0x89)][_0xa7ce40(0x95)]('JS\x20URL\x20is\x20unreachable');return{'ok':_0x2d7d40[_0xa7ce40(0x89)][_0xa7ce40(0x8e)]===0x0,'errors':_0x2d7d40[_0xa7ce40(0x89)]};}function a179_0x51ab(_0x36ac42,_0x1effb4){_0x36ac42=_0x36ac42-0x83;const _0x171828=a179_0x1718();let _0x51ab99=_0x171828[_0x36ac42];return _0x51ab99;}export async function validateCssUrlReachable(_0xa86879){const _0xd90870=a179_0x51ab,_0x1a33d5=validateCssUrl(_0xa86879);if(!_0x1a33d5['ok'])return _0x1a33d5;const _0x16999e=await isUrlReachable(_0xa86879);if(!_0x16999e)_0x1a33d5['errors'][_0xd90870(0x95)](_0xd90870(0x92));return{'ok':_0x1a33d5[_0xd90870(0x89)]['length']===0x0,'errors':_0x1a33d5[_0xd90870(0x89)]};}export function buildCompareRows(_0x1f4dfb,_0xe1c84c){const _0xba1945=a179_0x51ab;return _0x1f4dfb[_0xba1945(0x86)](_0x1480ac=>({'label':_0x1480ac['label'],'path':_0x1480ac[_0xba1945(0x94)],'local':!![],'online':_0xe1c84c[_0xba1945(0x84)](menuPathKey(_0x1480ac[_0xba1945(0x94)]))}));}export async function doCreateMenus(_0x367a6b,_0x3f31e2,_0x4fe950,_0x2badff,_0x316f7c){const _0x1ed7ee=a179_0x51ab,_0x10bb2a=_0x316f7c?await createMenus(_0x367a6b,_0x3f31e2,_0x4fe950,_0x2badff,_0x316f7c):await createMenus(_0x367a6b,_0x3f31e2,_0x4fe950,_0x2badff);return{'created':_0x10bb2a['length'],'failed':0x0,'labels':_0x4fe950[_0x1ed7ee(0x86)](_0xdb5558=>_0xdb5558['label']),'menus':_0x10bb2a};}export function filterMenusWithResources(_0xf407ec){const _0x4a21ea=a179_0x51ab;return _0xf407ec['filter'](_0x3259d0=>_0x3259d0[_0x4a21ea(0x87)][_0x4a21ea(0x8e)]>0x0);}export async function fetchMenuData(_0x379772,_0x45feaa){const _0x780e34=a179_0x51ab,_0x2c2968=getLocalPages(),_0x3becf2=await getOnlineMenuList(_0x379772,_0x45feaa),_0x521500=new Set(_0x3becf2[_0x780e34(0x86)](_0x35c544=>menuPathKey(_0x35c544[_0x780e34(0x94)])));return{'localPages':_0x2c2968,'onlineMenuList':_0x3becf2,'onlinePaths':_0x521500};}export async function fetchOnlineMenuList(_0x37df1,_0x2040fc){return getOnlineMenuList(_0x37df1,_0x2040fc);}
@@ -1 +1 @@
1
- const a179_0x4e7584=a179_0x12ed;(function(_0x19beec,_0x4b78a2){const _0x5d1b1a=a179_0x12ed,_0xa70834=_0x19beec();while(!![]){try{const _0x3e8ab8=parseInt(_0x5d1b1a(0x19c))/0x1+-parseInt(_0x5d1b1a(0x19d))/0x2+-parseInt(_0x5d1b1a(0x14b))/0x3*(parseInt(_0x5d1b1a(0x13e))/0x4)+-parseInt(_0x5d1b1a(0x172))/0x5+-parseInt(_0x5d1b1a(0x17f))/0x6+-parseInt(_0x5d1b1a(0x151))/0x7+-parseInt(_0x5d1b1a(0x143))/0x8*(-parseInt(_0x5d1b1a(0x179))/0x9);if(_0x3e8ab8===_0x4b78a2)break;else _0xa70834['push'](_0xa70834['shift']());}catch(_0x531521){_0xa70834['push'](_0xa70834['shift']());}}}(a179_0x181f,0x4a8e6));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':a179_0x4e7584(0x191),'required':!![],'description':a179_0x4e7584(0x170)};export const MENU_SORT_FLAG={'name':'sort','type':a179_0x4e7584(0x191),'description':a179_0x4e7584(0x19f)};export const MENU_PARENT_ID_FLAG={'name':a179_0x4e7584(0x18b),'type':a179_0x4e7584(0x147),'description':a179_0x4e7584(0x14f)};export const MENU_EXPECT_PARENT_ID_FLAG={'name':a179_0x4e7584(0x168),'type':a179_0x4e7584(0x147),'description':a179_0x4e7584(0x160)};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a179_0x4e7584(0x167),'type':'string','description':a179_0x4e7584(0x13f)},{'name':a179_0x4e7584(0x149),'type':a179_0x4e7584(0x191),'description':a179_0x4e7584(0x16a)}];export function validateExactId(_0x59e922){const _0x171506=a179_0x4e7584,_0x1f7085=_0x59e922[_0x171506(0x146)]('id');if(!Number[_0x171506(0x16f)](_0x1f7085)||_0x1f7085<=0x0)throw CliErrors[_0x171506(0x1a9)](_0x171506(0x19e));return _0x1f7085;}export function validateSort(_0x1d95f3,_0x5e93e7=a179_0x4e7584(0x175)){const _0x2d8c55=a179_0x4e7584;if(!hasFlag(_0x1d95f3,_0x5e93e7))return undefined;const _0x57afd9=_0x1d95f3[_0x2d8c55(0x146)](_0x5e93e7);if(!Number[_0x2d8c55(0x16f)](_0x57afd9)||_0x57afd9<0x0||_0x57afd9>MAX_MENU_SORT)throw menuError('menu_sort_invalid','--'+_0x5e93e7+_0x2d8c55(0x186)+MAX_MENU_SORT+'.',_0x2d8c55(0x194));return _0x57afd9;}export function nextSiblingSort(_0x4a3687,_0x52f81a,_0x17106b){const _0x247247=a179_0x4e7584,_0x332c6a=getChildren(_0x4a3687,_0x52f81a)['map'](_0x432bd9=>_0x432bd9['sort'])[_0x247247(0x16b)](_0x28b233=>typeof _0x28b233==='number');if(_0x332c6a['length']===0x0)return 0x0;const _0x4c9d9b=Math[_0x247247(0x142)](..._0x332c6a);if(_0x4c9d9b>=MAX_MENU_SORT)throw menuError(_0x247247(0x150),_0x247247(0x14e)+_0x17106b+_0x247247(0x183)+_0x4c9d9b+'.',_0x247247(0x14c)+MAX_MENU_SORT+_0x247247(0x164));return _0x4c9d9b+0x1;}export function requireExplicitYes(_0x26c7fd){const _0x331be4=a179_0x4e7584;if(_0x26c7fd[_0x331be4(0x13d)]('dry-run'))return;if(!_0x26c7fd[_0x331be4(0x13d)](_0x331be4(0x158)))throw menuError(_0x331be4(0x198),_0x331be4(0x1a7),'Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.');}export async function fetchMutationSnapshot(_0xab1565,_0x30c3dc,_0x42b12e){const _0x213c7b=a179_0x4e7584;try{return await fetchMenuSnapshot(_0xab1565['appCode'],_0xab1565[_0x213c7b(0x13c)]);}catch(_0x2dae02){throw mapMenuApiError(_0x2dae02,'read\x20online\x20menu\x20facts\x20before\x20'+_0x30c3dc,_0x42b12e);}}export async function recheckMutationSnapshot(_0x51006b,_0x35a979,_0x40677d,_0x3e6a59){const _0x330464=a179_0x4e7584;let _0x2a2193;try{_0x2a2193=await fetchMenuSnapshot(_0x51006b['appCode'],_0x51006b[_0x330464(0x13c)]);}catch(_0x2ce0ff){const _0x38057c=mapMenuApiError(_0x2ce0ff,_0x330464(0x196)+_0x40677d,_0x3e6a59);throw menuFailure(_0x38057c,_0x35a979,{'stage':'pre-write-recheck','failed':_0x3e6a59==null?{}:{'id':_0x3e6a59}});}if(_0x2a2193[_0x330464(0x166)]!==_0x35a979[_0x330464(0x17e)]){const _0x484742=menuError('menu_state_drift','Online\x20menu\x20state\x20changed\x20before\x20'+_0x40677d+_0x330464(0x18c),_0x330464(0x173));throw menuFailure(_0x484742,_0x35a979,{'stage':_0x330464(0x197),'failed':{..._0x3e6a59==null?{}:{'id':_0x3e6a59},'expectedSnapshotHash':_0x35a979[_0x330464(0x17e)],'currentSnapshotHash':_0x2a2193['hash']}});}return _0x2a2193;}export function parseParentId(_0x5cf587,_0x423192,_0x38f82d={}){const _0x920133=a179_0x4e7584;if(!hasFlag(_0x5cf587,_0x423192)){if(_0x38f82d[_0x920133(0x195)])throw CliErrors['flagMissing'](_0x423192);return undefined;}const _0x548622=_0x5cf587[_0x920133(0x182)](_0x423192)[_0x920133(0x15c)]();if(_0x548622[_0x920133(0x145)]()==='root')return null;if(!/^\d+$/[_0x920133(0x178)](_0x548622))throw CliErrors['validation']('--'+_0x423192+_0x920133(0x17b));const _0x3867b7=Number(_0x548622);if(!Number[_0x920133(0x16f)](_0x3867b7)||_0x3867b7<=0x0)throw CliErrors[_0x920133(0x1a9)]('--'+_0x423192+_0x920133(0x17b));return _0x3867b7;}export function requireMenu(_0x3f26f4,_0x40fa67){const _0xa6a448=a179_0x4e7584,_0x52195d=_0x3f26f4[_0xa6a448(0x157)]['get'](_0x40fa67);if(!_0x52195d)throw menuError(_0xa6a448(0x180),_0xa6a448(0x144)+_0x40fa67,_0xa6a448(0x155));return _0x52195d;}function a179_0x12ed(_0x39a063,_0x20666f){_0x39a063=_0x39a063-0x13c;const _0x181f43=a179_0x181f();let _0x12ed40=_0x181f43[_0x39a063];return _0x12ed40;}export function requireFolder(_0x2913ad,_0x29fb2a){const _0x54d779=a179_0x4e7584,_0x29e5ee=requireMenu(_0x2913ad,_0x29fb2a);if(_0x29e5ee[_0x54d779(0x1a4)]!==_0x54d779(0x19b))throw menuError(_0x54d779(0x14a),_0x54d779(0x19a)+_0x29fb2a+'\x20is\x20type\x20\x22'+(_0x29e5ee[_0x54d779(0x1a4)]||_0x54d779(0x187))+_0x54d779(0x141),_0x54d779(0x165));return _0x29e5ee;}export function assertExpectedState(_0x59b8b7,_0x17f3a9){const _0x506eb5=a179_0x4e7584;if(hasFlag(_0x59b8b7,_0x506eb5(0x168))){const _0x4eeeea=parseParentId(_0x59b8b7,'expect-parent-id',{'required':!![]});if(_0x17f3a9[_0x506eb5(0x1a1)]!==_0x4eeeea)throw stateDrift(_0x506eb5(0x19a)+_0x17f3a9['id']+_0x506eb5(0x16e)+formatParent(_0x4eeeea)+_0x506eb5(0x18f)+formatParent(_0x17f3a9['parentId'])+'.');}if(hasFlag(_0x59b8b7,'expect-path')){const _0x48126d=_0x59b8b7['str'](_0x506eb5(0x167));if(_0x17f3a9[_0x506eb5(0x17d)]!==_0x48126d)throw stateDrift(_0x506eb5(0x19a)+_0x17f3a9['id']+'\x20path\x20changed:\x20expected\x20'+JSON['stringify'](_0x48126d)+_0x506eb5(0x18f)+JSON[_0x506eb5(0x148)](_0x17f3a9['path'])+'.');}if(hasFlag(_0x59b8b7,_0x506eb5(0x149))){const _0xf71b2b=_0x59b8b7[_0x506eb5(0x146)](_0x506eb5(0x149));if(!Number[_0x506eb5(0x16f)](_0xf71b2b)||_0xf71b2b<0x0)throw CliErrors[_0x506eb5(0x1a9)](_0x506eb5(0x18d));if(_0x17f3a9[_0x506eb5(0x153)]!==_0xf71b2b)throw stateDrift('Menu\x20'+_0x17f3a9['id']+_0x506eb5(0x154)+_0xf71b2b+',\x20current\x20'+_0x17f3a9[_0x506eb5(0x153)]+'.');}}export function assertVerified(_0x41a255,_0x39d838,_0x5e9e95=a179_0x4e7584(0x16d)){if(!_0x41a255)throw menuError('menu_verification_failed',_0x39d838,_0x5e9e95);}export function mutationResult(_0x526941){const _0x5cf34c=a179_0x4e7584;return{'operation':_0x526941[_0x5cf34c(0x17a)],'selector':_0x526941[_0x5cf34c(0x1a2)],'before':_0x526941[_0x5cf34c(0x190)],'after':_0x526941[_0x5cf34c(0x14d)],'dryRun':_0x526941[_0x5cf34c(0x163)],'backend':_0x526941['backend'],..._0x526941[_0x5cf34c(0x185)]?{'plannedActions':_0x526941[_0x5cf34c(0x185)]}:{},..._0x526941[_0x5cf34c(0x192)]?{'targets':_0x526941['targets']}:{},..._0x526941[_0x5cf34c(0x1a6)]?{'deleteOrder':_0x526941[_0x5cf34c(0x1a6)]}:{},'snapshotHash':_0x526941[_0x5cf34c(0x17e)],..._0x526941[_0x5cf34c(0x1a0)]?{'cascade':_0x526941[_0x5cf34c(0x1a0)]}:{},..._0x526941[_0x5cf34c(0x161)]?{'planFile':_0x526941[_0x5cf34c(0x161)]}:{},'succeeded':_0x526941['succeeded']??[],'failed':_0x526941[_0x5cf34c(0x159)]??[],'warnings':_0x526941['warnings']??[],'verification':_0x526941[_0x5cf34c(0x15a)],'error':_0x526941[_0x5cf34c(0x177)]};}export function menuDryRunResult(_0x1c67f4,_0xd722eb){return{..._0x1c67f4,..._0xd722eb};}export function menuFailure(_0x4bb23b,_0x594b3e,_0x340477){const _0x5b378c=a179_0x4e7584,_0x44ded8=mutationResult({..._0x594b3e,'after':_0x340477[_0x5b378c(0x14d)]===undefined?_0x594b3e[_0x5b378c(0x14d)]:_0x340477[_0x5b378c(0x14d)],'backend':_0x340477[_0x5b378c(0x176)]??_0x594b3e[_0x5b378c(0x176)],'dryRun':![],'succeeded':_0x340477[_0x5b378c(0x17c)]??[],'failed':_0x340477[_0x5b378c(0x16c)]??[{..._0x340477[_0x5b378c(0x159)]??{},'stage':_0x340477[_0x5b378c(0x156)],'code':_0x4bb23b[_0x5b378c(0x18e)],'message':_0x4bb23b[_0x5b378c(0x1a5)]}],'warnings':[..._0x594b3e[_0x5b378c(0x193)],..._0x340477[_0x5b378c(0x193)]??[]],'verification':_0x340477[_0x5b378c(0x15a)],'error':{'code':_0x4bb23b[_0x5b378c(0x18e)],'message':_0x4bb23b['message'],..._0x4bb23b[_0x5b378c(0x189)]?{'hint':_0x4bb23b[_0x5b378c(0x189)]}:{}}});return Object['defineProperty'](_0x4bb23b,_0x5b378c(0x15b),{'value':_0x44ded8,'enumerable':!![],'configurable':!![]}),_0x4bb23b;}export function asVerificationError(_0x27150c,_0x5035fa){const _0x503c3f=a179_0x4e7584;if(_0x27150c instanceof CliError&&_0x27150c[_0x503c3f(0x18e)]==='menu_verification_failed')return _0x27150c;const _0x25150f=_0x27150c instanceof Error?_0x27150c[_0x503c3f(0x1a5)]:String(_0x27150c);return menuError(_0x503c3f(0x152),''+_0x5035fa+(_0x25150f?':\x20'+_0x25150f:''),_0x503c3f(0x15d));}export function describeMenuErrorCause(_0x4384ee,_0x171d1b,_0x398a5b){const _0x4fa61e=a179_0x4e7584,_0x2935fc=mapMenuApiError(_0x4384ee,_0x171d1b,_0x398a5b);return{'causeCode':_0x2935fc[_0x4fa61e(0x18e)],'causeMessage':_0x2935fc[_0x4fa61e(0x1a5)]};}export function hasFlag(_0x43ee4e,_0x3ef8ad){const _0x37789d=a179_0x4e7584;return Object[_0x37789d(0x162)][_0x37789d(0x1a8)][_0x37789d(0x184)](_0x43ee4e[_0x37789d(0x174)],_0x3ef8ad)&&_0x43ee4e[_0x37789d(0x174)][_0x3ef8ad]!==undefined;}export function toApiParentId(_0x136bc3){return _0x136bc3??0x0;}export function formatParent(_0x295f05){const _0x57cd83=a179_0x4e7584;return _0x295f05==null?_0x57cd83(0x1a3):String(_0x295f05);}export function menuError(_0x37949e,_0x430091,_0x50fa8e){return new CliError(_0x37949e,0x1,_0x430091,_0x50fa8e);}export function mapMenuApiError(_0x2af8e7,_0x43601a,_0x545659){const _0x1f5db7=a179_0x4e7584;if(_0x2af8e7 instanceof CliError&&_0x2af8e7[_0x1f5db7(0x18e)]!==_0x1f5db7(0x188))return _0x2af8e7;const _0x1666d9=_0x2af8e7 instanceof Error?_0x2af8e7[_0x1f5db7(0x1a5)]:String(_0x2af8e7);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x1f5db7(0x178)](_0x1666d9))return menuError('menu_permission_denied',_0x1f5db7(0x171)+_0x43601a+(_0x545659?_0x1f5db7(0x199)+_0x545659:'')+'.',_0x1f5db7(0x140));return menuError(_0x1f5db7(0x181),_0x1f5db7(0x169)+_0x43601a+(_0x545659?_0x1f5db7(0x199)+_0x545659:'')+':\x20'+_0x1666d9,_0x1f5db7(0x15e));}export function isMenuResponseLoss(_0x5d4d9f){const _0xeab5db=a179_0x4e7584,_0x2fe1b4=_0x5d4d9f instanceof Error?_0x5d4d9f['message']:String(_0x5d4d9f);if(_0x5d4d9f instanceof CliError)return _0x5d4d9f['code']===_0xeab5db(0x188)&&/^Request (?:failed|timeout):/i['test'](_0x2fe1b4);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'](_0x2fe1b4);}function stateDrift(_0x13f0d2){const _0x5496da=a179_0x4e7584;return menuError(_0x5496da(0x18a),_0x13f0d2,_0x5496da(0x15f));}function a179_0x181f(){const _0x2d70b5=['menu_confirmation_required','\x20menu\x20','Menu\x20','folder','519064vGvaBg','1203550jPfaaJ','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','Sibling\x20sort\x20value\x20(non-negative\x20integer)','cascade','parentId','selector','root','type','message','deleteOrder','This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','hasOwnProperty','validation','cookie','bool','4EhytyM','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.','\x22,\x20not\x20folder.','max','968noDxcE','Online\x20menu\x20not\x20found:\x20','toLowerCase','num','string','stringify','expected-children-count','menu_parent_not_folder','442563LQrJnN','Reorder\x20sibling\x20menus\x20below\x20','after','Cannot\x20append\x20a\x20','Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node','menu_sort_overflow','2399866Hyivdi','menu_verification_failed','childrenCount','\x20child\x20count\x20changed:\x20expected\x20','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','stage','byId','yes','failed','verification','data','trim','The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.','Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.','Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','planFile','prototype','dryRun',',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','hash','expect-path','expect-parent-id','Failed\x20to\x20','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches','filter','failedRecords','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.','\x20parent\x20changed:\x20expected\x20','isSafeInteger','Exact\x20online\x20menu\x20id','Permission\x20denied\x20while\x20attempting\x20to\x20','1291765SyhXNy','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.','rawFlags','sort','backend','error','test','127350CZJjnZ','operation','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','succeeded','path','snapshotHash','3452070BhBRsz','menu_not_found','menu_mutation_failed','str','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20','call','plannedActions','\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20','unknown','api_error','hint','menu_state_drift','parent-id',';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','code',',\x20current\x20','before','number','targets','warnings','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','required','recheck\x20online\x20menu\x20facts\x20before\x20','pre-write-recheck'];a179_0x181f=function(){return _0x2d70b5;};return a179_0x181f();}
1
+ const a180_0x40328b=a180_0x3a9f;function a180_0x3a9f(_0x3472cb,_0x1b11fe){_0x3472cb=_0x3472cb-0x77;const _0x360a2e=a180_0x360a();let _0x3a9fef=_0x360a2e[_0x3472cb];return _0x3a9fef;}(function(_0x17049a,_0x484f6f){const _0x3b1b16=a180_0x3a9f,_0x1fbb10=_0x17049a();while(!![]){try{const _0x19bbb8=-parseInt(_0x3b1b16(0xd5))/0x1*(parseInt(_0x3b1b16(0x8f))/0x2)+parseInt(_0x3b1b16(0xd2))/0x3+-parseInt(_0x3b1b16(0xc3))/0x4+parseInt(_0x3b1b16(0xc4))/0x5+-parseInt(_0x3b1b16(0xbe))/0x6*(parseInt(_0x3b1b16(0x96))/0x7)+-parseInt(_0x3b1b16(0x7a))/0x8+parseInt(_0x3b1b16(0x95))/0x9*(parseInt(_0x3b1b16(0xb5))/0xa);if(_0x19bbb8===_0x484f6f)break;else _0x1fbb10['push'](_0x1fbb10['shift']());}catch(_0x5760fb){_0x1fbb10['push'](_0x1fbb10['shift']());}}}(a180_0x360a,0xf2465));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_0x40328b(0xa1)};export const MENU_SORT_FLAG={'name':a180_0x40328b(0xd0),'type':a180_0x40328b(0xb1),'description':'Sibling\x20sort\x20value\x20(non-negative\x20integer)'};export const MENU_PARENT_ID_FLAG={'name':a180_0x40328b(0x90),'type':a180_0x40328b(0x91),'description':a180_0x40328b(0x81)};export const MENU_EXPECT_PARENT_ID_FLAG={'name':a180_0x40328b(0xda),'type':a180_0x40328b(0x91),'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_0x40328b(0x89),'type':a180_0x40328b(0x91),'description':a180_0x40328b(0x9e)},{'name':a180_0x40328b(0xcb),'type':'number','description':a180_0x40328b(0x8c)}];export function validateExactId(_0x1993f6){const _0x26a794=a180_0x40328b,_0x2a20bc=_0x1993f6[_0x26a794(0x77)]('id');if(!Number[_0x26a794(0xa5)](_0x2a20bc)||_0x2a20bc<=0x0)throw CliErrors[_0x26a794(0x9b)](_0x26a794(0xd8));return _0x2a20bc;}export function validateSort(_0x4ea2d4,_0x1da288=a180_0x40328b(0xd0)){const _0x231bdc=a180_0x40328b;if(!hasFlag(_0x4ea2d4,_0x1da288))return undefined;const _0x418453=_0x4ea2d4[_0x231bdc(0x77)](_0x1da288);if(!Number['isSafeInteger'](_0x418453)||_0x418453<0x0||_0x418453>MAX_MENU_SORT)throw menuError(_0x231bdc(0x9a),'--'+_0x1da288+_0x231bdc(0xca)+MAX_MENU_SORT+'.',_0x231bdc(0xdf));return _0x418453;}export function nextSiblingSort(_0x47e77a,_0x169e9c,_0x35bd6c){const _0x9ca823=a180_0x40328b,_0x2f26e1=getChildren(_0x47e77a,_0x169e9c)[_0x9ca823(0xb6)](_0x336cd2=>_0x336cd2[_0x9ca823(0xd0)])['filter'](_0x1bf428=>typeof _0x1bf428===_0x9ca823(0xb1));if(_0x2f26e1['length']===0x0)return 0x0;const _0x301ad1=Math[_0x9ca823(0x7c)](..._0x2f26e1);if(_0x301ad1>=MAX_MENU_SORT)throw menuError(_0x9ca823(0xbc),_0x9ca823(0x7b)+_0x35bd6c+_0x9ca823(0x97)+_0x301ad1+'.','Reorder\x20sibling\x20menus\x20below\x20'+MAX_MENU_SORT+_0x9ca823(0xb2));return _0x301ad1+0x1;}export function requireExplicitYes(_0x261f37){const _0x54ef81=a180_0x40328b;if(_0x261f37[_0x54ef81(0xa6)](_0x54ef81(0x9f)))return;if(!_0x261f37[_0x54ef81(0xa6)](_0x54ef81(0xae)))throw menuError(_0x54ef81(0xde),_0x54ef81(0x94),_0x54ef81(0xaf));}export async function fetchMutationSnapshot(_0x297e8a,_0x2cf0c6,_0x1119f7){const _0x46844b=a180_0x40328b;try{return await fetchMenuSnapshot(_0x297e8a[_0x46844b(0xd3)],_0x297e8a[_0x46844b(0xc9)]);}catch(_0x2229a4){throw mapMenuApiError(_0x2229a4,_0x46844b(0x83)+_0x2cf0c6,_0x1119f7);}}export async function recheckMutationSnapshot(_0x20f073,_0x435030,_0x1e0232,_0x2f18ab){const _0x173d0a=a180_0x40328b;let _0x13f911;try{_0x13f911=await fetchMenuSnapshot(_0x20f073[_0x173d0a(0xd3)],_0x20f073[_0x173d0a(0xc9)]);}catch(_0x436196){const _0x5693d2=mapMenuApiError(_0x436196,_0x173d0a(0xd9)+_0x1e0232,_0x2f18ab);throw menuFailure(_0x5693d2,_0x435030,{'stage':'pre-write-recheck','failed':_0x2f18ab==null?{}:{'id':_0x2f18ab}});}if(_0x13f911[_0x173d0a(0xdd)]!==_0x435030[_0x173d0a(0x79)]){const _0x594e37=menuError(_0x173d0a(0x92),'Online\x20menu\x20state\x20changed\x20before\x20'+_0x1e0232+_0x173d0a(0xd6),_0x173d0a(0x7e));throw menuFailure(_0x594e37,_0x435030,{'stage':_0x173d0a(0x9d),'failed':{..._0x2f18ab==null?{}:{'id':_0x2f18ab},'expectedSnapshotHash':_0x435030[_0x173d0a(0x79)],'currentSnapshotHash':_0x13f911['hash']}});}return _0x13f911;}export function parseParentId(_0x1ecab8,_0x19afe1,_0x38c105={}){const _0x40a113=a180_0x40328b;if(!hasFlag(_0x1ecab8,_0x19afe1)){if(_0x38c105[_0x40a113(0xa7)])throw CliErrors[_0x40a113(0xb7)](_0x19afe1);return undefined;}const _0x5cec68=_0x1ecab8[_0x40a113(0xd4)](_0x19afe1)['trim']();if(_0x5cec68[_0x40a113(0x8b)]()===_0x40a113(0xc0))return null;if(!/^\d+$/[_0x40a113(0xac)](_0x5cec68))throw CliErrors[_0x40a113(0x9b)]('--'+_0x19afe1+_0x40a113(0x78));const _0x2afc58=Number(_0x5cec68);if(!Number[_0x40a113(0xa5)](_0x2afc58)||_0x2afc58<=0x0)throw CliErrors['validation']('--'+_0x19afe1+'\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.');return _0x2afc58;}export function requireMenu(_0x48abc8,_0x462807){const _0x2833dc=a180_0x40328b,_0x2cbb4c=_0x48abc8['byId'][_0x2833dc(0xcf)](_0x462807);if(!_0x2cbb4c)throw menuError(_0x2833dc(0xe2),_0x2833dc(0x7d)+_0x462807,_0x2833dc(0xa4));return _0x2cbb4c;}export function requireFolder(_0x94c4ea,_0x534957){const _0x1edf78=a180_0x40328b,_0x33ac1b=requireMenu(_0x94c4ea,_0x534957);if(_0x33ac1b[_0x1edf78(0xd7)]!==_0x1edf78(0xc1))throw menuError(_0x1edf78(0xbd),_0x1edf78(0x8d)+_0x534957+_0x1edf78(0xb8)+(_0x33ac1b[_0x1edf78(0xd7)]||_0x1edf78(0x98))+_0x1edf78(0xb9),_0x1edf78(0xa2));return _0x33ac1b;}export function assertExpectedState(_0x509138,_0x4386c5){const _0x460aac=a180_0x40328b;if(hasFlag(_0x509138,_0x460aac(0xda))){const _0x3ed8e8=parseParentId(_0x509138,_0x460aac(0xda),{'required':!![]});if(_0x4386c5[_0x460aac(0x85)]!==_0x3ed8e8)throw stateDrift(_0x460aac(0x8d)+_0x4386c5['id']+_0x460aac(0xba)+formatParent(_0x3ed8e8)+_0x460aac(0xa8)+formatParent(_0x4386c5['parentId'])+'.');}if(hasFlag(_0x509138,_0x460aac(0x89))){const _0x287f12=_0x509138['str'](_0x460aac(0x89));if(_0x4386c5[_0x460aac(0xdb)]!==_0x287f12)throw stateDrift(_0x460aac(0x8d)+_0x4386c5['id']+_0x460aac(0xb0)+JSON[_0x460aac(0xe4)](_0x287f12)+_0x460aac(0xa8)+JSON[_0x460aac(0xe4)](_0x4386c5[_0x460aac(0xdb)])+'.');}if(hasFlag(_0x509138,_0x460aac(0xcb))){const _0x2ef496=_0x509138['num'](_0x460aac(0xcb));if(!Number[_0x460aac(0xa5)](_0x2ef496)||_0x2ef496<0x0)throw CliErrors[_0x460aac(0x9b)]('--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.');if(_0x4386c5[_0x460aac(0x87)]!==_0x2ef496)throw stateDrift(_0x460aac(0x8d)+_0x4386c5['id']+_0x460aac(0xe5)+_0x2ef496+_0x460aac(0xa8)+_0x4386c5[_0x460aac(0x87)]+'.');}}export function assertVerified(_0x2bb3a1,_0x17ab81,_0x4ced74='Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.'){const _0x33d562=a180_0x40328b;if(!_0x2bb3a1)throw menuError(_0x33d562(0xc2),_0x17ab81,_0x4ced74);}export function mutationResult(_0x2ace59){const _0x157695=a180_0x40328b;return{'operation':_0x2ace59[_0x157695(0xe3)],'selector':_0x2ace59[_0x157695(0xcc)],'before':_0x2ace59[_0x157695(0x86)],'after':_0x2ace59['after'],'dryRun':_0x2ace59[_0x157695(0xab)],'backend':_0x2ace59[_0x157695(0xb3)],..._0x2ace59[_0x157695(0xdc)]?{'plannedActions':_0x2ace59[_0x157695(0xdc)]}:{},..._0x2ace59[_0x157695(0x88)]?{'targets':_0x2ace59[_0x157695(0x88)]}:{},..._0x2ace59[_0x157695(0xcd)]?{'deleteOrder':_0x2ace59[_0x157695(0xcd)]}:{},'snapshotHash':_0x2ace59[_0x157695(0x79)],..._0x2ace59[_0x157695(0xc8)]?{'cascade':_0x2ace59['cascade']}:{},..._0x2ace59[_0x157695(0xa0)]?{'planFile':_0x2ace59['planFile']}:{},'succeeded':_0x2ace59['succeeded']??[],'failed':_0x2ace59[_0x157695(0xc6)]??[],'warnings':_0x2ace59['warnings']??[],'verification':_0x2ace59[_0x157695(0xa3)],'error':_0x2ace59[_0x157695(0x8e)]};}export function menuDryRunResult(_0x135781,_0xc70841){return{..._0x135781,..._0xc70841};}export function menuFailure(_0x36272b,_0xc041e2,_0x2bc0e4){const _0x7f15cd=a180_0x40328b,_0x44c265=mutationResult({..._0xc041e2,'after':_0x2bc0e4['after']===undefined?_0xc041e2[_0x7f15cd(0xe1)]:_0x2bc0e4[_0x7f15cd(0xe1)],'backend':_0x2bc0e4[_0x7f15cd(0xb3)]??_0xc041e2[_0x7f15cd(0xb3)],'dryRun':![],'succeeded':_0x2bc0e4[_0x7f15cd(0x84)]??[],'failed':_0x2bc0e4['failedRecords']??[{..._0x2bc0e4[_0x7f15cd(0xc6)]??{},'stage':_0x2bc0e4[_0x7f15cd(0xc7)],'code':_0x36272b[_0x7f15cd(0xa9)],'message':_0x36272b[_0x7f15cd(0xaa)]}],'warnings':[..._0xc041e2[_0x7f15cd(0x82)],..._0x2bc0e4[_0x7f15cd(0x82)]??[]],'verification':_0x2bc0e4[_0x7f15cd(0xa3)],'error':{'code':_0x36272b[_0x7f15cd(0xa9)],'message':_0x36272b[_0x7f15cd(0xaa)],..._0x36272b['hint']?{'hint':_0x36272b[_0x7f15cd(0x9c)]}:{}}});return Object[_0x7f15cd(0xbf)](_0x36272b,_0x7f15cd(0xad),{'value':_0x44c265,'enumerable':!![],'configurable':!![]}),_0x36272b;}export function asVerificationError(_0x267694,_0xd233ea){const _0xa5bdbf=a180_0x40328b;if(_0x267694 instanceof CliError&&_0x267694[_0xa5bdbf(0xa9)]===_0xa5bdbf(0xc2))return _0x267694;const _0x520fe1=_0x267694 instanceof Error?_0x267694[_0xa5bdbf(0xaa)]:String(_0x267694);return menuError(_0xa5bdbf(0xc2),''+_0xd233ea+(_0x520fe1?':\x20'+_0x520fe1:''),_0xa5bdbf(0x99));}export function describeMenuErrorCause(_0x2e62e8,_0x21167f,_0x2226d5){const _0x25c4e7=a180_0x40328b,_0xe6a8a8=mapMenuApiError(_0x2e62e8,_0x21167f,_0x2226d5);return{'causeCode':_0xe6a8a8[_0x25c4e7(0xa9)],'causeMessage':_0xe6a8a8['message']};}export function hasFlag(_0x2a5fa9,_0x5522a3){const _0x24783e=a180_0x40328b;return Object[_0x24783e(0xce)][_0x24783e(0x80)]['call'](_0x2a5fa9[_0x24783e(0xb4)],_0x5522a3)&&_0x2a5fa9[_0x24783e(0xb4)][_0x5522a3]!==undefined;}function a180_0x360a(){const _0x1cb102=['recheck\x20online\x20menu\x20facts\x20before\x20','expect-parent-id','path','plannedActions','hash','menu_confirmation_required','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','menu_permission_denied','after','menu_not_found','operation','stringify','\x20child\x20count\x20changed:\x20expected\x20','num','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','snapshotHash','1812720bkThgw','Cannot\x20append\x20a\x20','max','Online\x20menu\x20not\x20found:\x20','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.','hasOwnProperty','Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node','warnings','read\x20online\x20menu\x20facts\x20before\x20','succeeded','parentId','before','childrenCount','targets','expect-path','api_error','toLowerCase','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches','Menu\x20','error','112842FTBGhX','parent-id','string','menu_state_drift','Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.','This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','25254189zkfFSU','1985165wrZNTu','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20','unknown','The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.','menu_sort_invalid','validation','hint','pre-write-recheck','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','dry-run','planFile','Exact\x20online\x20menu\x20id','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','verification','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','isSafeInteger','bool','required',',\x20current\x20','code','message','dryRun','test','data','yes','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','\x20path\x20changed:\x20expected\x20','number',',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.','backend','rawFlags','10dDgNKX','map','flagMissing','\x20is\x20type\x20\x22','\x22,\x20not\x20folder.','\x20parent\x20changed:\x20expected\x20','\x20menu\x20','menu_sort_overflow','menu_parent_not_folder','30AsWCnk','defineProperty','root','folder','menu_verification_failed','4379632QjDAAF','3763480KpLDYM','menu_mutation_failed','failed','stage','cascade','cookie','\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20','expected-children-count','selector','deleteOrder','prototype','get','sort','Failed\x20to\x20','1196391OAmDNS','appCode','str','4mBWroD',';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','type','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.'];a180_0x360a=function(){return _0x1cb102;};return a180_0x360a();}export function toApiParentId(_0x1a0db8){return _0x1a0db8??0x0;}export function formatParent(_0x35559d){const _0x4766f0=a180_0x40328b;return _0x35559d==null?_0x4766f0(0xc0):String(_0x35559d);}export function menuError(_0x316c9f,_0x4712de,_0x11d622){return new CliError(_0x316c9f,0x1,_0x4712de,_0x11d622);}export function mapMenuApiError(_0x2134a1,_0x2bcfb9,_0x2f8be6){const _0x565186=a180_0x40328b;if(_0x2134a1 instanceof CliError&&_0x2134a1[_0x565186(0xa9)]!==_0x565186(0x8a))return _0x2134a1;const _0x4af14a=_0x2134a1 instanceof Error?_0x2134a1['message']:String(_0x2134a1);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x565186(0xac)](_0x4af14a))return menuError(_0x565186(0xe0),'Permission\x20denied\x20while\x20attempting\x20to\x20'+_0x2bcfb9+(_0x2f8be6?'\x20menu\x20'+_0x2f8be6:'')+'.',_0x565186(0x7f));return menuError(_0x565186(0xc5),_0x565186(0xd1)+_0x2bcfb9+(_0x2f8be6?_0x565186(0xbb)+_0x2f8be6:'')+':\x20'+_0x4af14a,_0x565186(0x93));}export function isMenuResponseLoss(_0x2b3d1d){const _0x259c90=a180_0x40328b,_0xa58b89=_0x2b3d1d instanceof Error?_0x2b3d1d['message']:String(_0x2b3d1d);if(_0x2b3d1d instanceof CliError)return _0x2b3d1d['code']===_0x259c90(0x8a)&&/^Request (?:failed|timeout):/i['test'](_0xa58b89);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i[_0x259c90(0xac)](_0xa58b89);}function stateDrift(_0x23edd5){const _0x54cfce=a180_0x40328b;return menuError(_0x54cfce(0x92),_0x23edd5,'Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.');}
@@ -1 +1 @@
1
- function a180_0x22f3(_0x17c4df,_0x3f0f05){_0x17c4df=_0x17c4df-0x97;const _0x65c39e=a180_0x65c3();let _0x22f3e9=_0x65c39e[_0x17c4df];return _0x22f3e9;}(function(_0x3844ce,_0x15dafa){const _0x3244e9=a180_0x22f3,_0x5397a6=_0x3844ce();while(!![]){try{const _0x333fe0=parseInt(_0x3244e9(0x9f))/0x1+parseInt(_0x3244e9(0x9a))/0x2+parseInt(_0x3244e9(0x9e))/0x3*(-parseInt(_0x3244e9(0x97))/0x4)+-parseInt(_0x3244e9(0x9c))/0x5+-parseInt(_0x3244e9(0x98))/0x6*(-parseInt(_0x3244e9(0x9b))/0x7)+parseInt(_0x3244e9(0x99))/0x8+parseInt(_0x3244e9(0xa1))/0x9*(-parseInt(_0x3244e9(0xa2))/0xa);if(_0x333fe0===_0x15dafa)break;else _0x5397a6['push'](_0x5397a6['shift']());}catch(_0x1ccae5){_0x5397a6['push'](_0x5397a6['shift']());}}}(a180_0x65c3,0xe7482));function a180_0x65c3(){const _0x396cb4=['12LXDfjV','1122300ixNcOQ','replace','27GRJlDN','3570570oEbLPJ','465364KocXDY','4306764aLEkhw','2961120rJfSki','3486344Idguwd','7VSoGpN','7347705zPgXxM','trim'];a180_0x65c3=function(){return _0x396cb4;};return a180_0x65c3();}export function menuPathKey(_0x583b9f){const _0x40a07b=a180_0x22f3,_0x29622d=_0x583b9f[_0x40a07b(0x9d)]();if(!_0x29622d)return'';return _0x29622d[_0x40a07b(0xa0)](/^\/+/,'')[_0x40a07b(0xa0)](/\/+$/,'')||'/';}
1
+ function a181_0x53d9(){const _0x135a63=['3999556DUcQsx','5QbNmHL','627341bIymEN','replace','1844226zGnrwb','2841230qkjEsC','5532954BEoeYi','3256500ULkPZt','trim','25108648xkqThZ'];a181_0x53d9=function(){return _0x135a63;};return a181_0x53d9();}function a181_0x1307(_0x3078d6,_0x28221d){_0x3078d6=_0x3078d6-0x98;const _0x53d98c=a181_0x53d9();let _0x13075c=_0x53d98c[_0x3078d6];return _0x13075c;}(function(_0x3d04d4,_0x2188e1){const _0x4deb7d=a181_0x1307,_0x428507=_0x3d04d4();while(!![]){try{const _0x4ebce1=-parseInt(_0x4deb7d(0x9e))/0x1+parseInt(_0x4deb7d(0xa0))/0x2+parseInt(_0x4deb7d(0x99))/0x3+parseInt(_0x4deb7d(0x9c))/0x4+-parseInt(_0x4deb7d(0x9d))/0x5*(-parseInt(_0x4deb7d(0x98))/0x6)+parseInt(_0x4deb7d(0xa1))/0x7+-parseInt(_0x4deb7d(0x9b))/0x8;if(_0x4ebce1===_0x2188e1)break;else _0x428507['push'](_0x428507['shift']());}catch(_0x547386){_0x428507['push'](_0x428507['shift']());}}}(a181_0x53d9,0x8b11d));export function menuPathKey(_0x399033){const _0x309802=a181_0x1307,_0x478167=_0x399033[_0x309802(0x9a)]();if(!_0x478167)return'';return _0x478167[_0x309802(0x9f)](/^\/+/,'')[_0x309802(0x9f)](/\/+$/,'')||'/';}
@@ -1 +1 @@
1
- (function(_0x36bc41,_0x36a48a){const _0x5d057d=a181_0x3afb,_0x124341=_0x36bc41();while(!![]){try{const _0x8bcdb9=parseInt(_0x5d057d(0xc7))/0x1*(parseInt(_0x5d057d(0xb0))/0x2)+parseInt(_0x5d057d(0xcb))/0x3*(parseInt(_0x5d057d(0xd1))/0x4)+-parseInt(_0x5d057d(0xd8))/0x5*(parseInt(_0x5d057d(0xda))/0x6)+parseInt(_0x5d057d(0xc6))/0x7+-parseInt(_0x5d057d(0xb9))/0x8+parseInt(_0x5d057d(0xb4))/0x9+-parseInt(_0x5d057d(0xc4))/0xa;if(_0x8bcdb9===_0x36a48a)break;else _0x124341['push'](_0x124341['shift']());}catch(_0x55746f){_0x124341['push'](_0x124341['shift']());}}}(a181_0x4d94,0x3ab3a));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 a181_0x1624a0,updateMenuRecord}from'../../../core/api-client.js';export async function getOnlineMenuList(_0x2416f1,_0x1a7c8b){const _0x597076=a181_0x3afb,_0x154ff3=getEnv();logger[_0x597076(0xbc)](_0x597076(0xd0),isProduction(_0x154ff3)?'Fetching\x20online\x20menu\x20list...\x20(appCode:\x20'+_0x2416f1+')':_0x597076(0xd6)+_0x2416f1+')');const _0x43cad8=await fetchMenuSnapshot(_0x2416f1,_0x1a7c8b,{'verbose':!![]});return logger[_0x597076(0xbc)]('get-online-menu-list',_0x597076(0xad)+_0x43cad8[_0x597076(0xc9)]+_0x597076(0xce)),_0x43cad8[_0x597076(0xca)][_0x597076(0xcc)](toProcessedMenuItem);}export async function createMenu(_0x1827ac,_0x79aefc,_0x1469c3){const _0x35e54c=a181_0x3afb;logger['info'](_0x35e54c(0xd9),_0x35e54c(0xd2)+_0x1469c3[_0x35e54c(0xdc)]+'\x20('+_0x1469c3[_0x35e54c(0xb3)]+')');const _0x39fbdc={'appCode':_0x1827ac,'type':_0x35e54c(0xc3),'sort':0x0,'extend':{'loadScriptMode':_0x35e54c(0xd5),'resources':_0x1469c3['resources']?JSON[_0x35e54c(0xdb)](_0x1469c3[_0x35e54c(0xd3)]):undefined},..._0x1469c3},_0x49fc5d=await createMenuRecord(_0x39fbdc,_0x79aefc,_0x35e54c(0xbe)+_0x1469c3['label']+'\x22');return logger[_0x35e54c(0xbc)]('create-menu','Menu\x20created\x20successfully:\x20'+_0x1469c3['label']),_0x49fc5d;}async function createSingleMenu(_0x2b04f6,_0x3c08b0,_0x3e5acf,_0x47cffd,_0x43868a){const _0x2b04dd=a181_0x3afb,_0x32d1b5={'appCode':_0x2b04f6,'type':_0x2b04dd(0xc3),'sort':_0x2b04dd(0xb5)in _0x3e5acf&&typeof _0x3e5acf['order']===_0x2b04dd(0xbb)?_0x3e5acf['order']:0x0,..._0x2b04dd(0xbd)in _0x3e5acf&&typeof _0x3e5acf[_0x2b04dd(0xbd)]===_0x2b04dd(0xc5)?{'visible':_0x3e5acf[_0x2b04dd(0xbd)]}:{},..._0x2b04dd(0xb2)in _0x3e5acf&&typeof _0x3e5acf[_0x2b04dd(0xb2)]===_0x2b04dd(0xbb)?{'parentId':_0x3e5acf[_0x2b04dd(0xb2)]}:{},'extend':{..._0x43868a?.[_0x2b04dd(0xac)]?{'appName':_0x43868a['appName']}:{},'loadScriptMode':'import','resources':_0x47cffd?JSON[_0x2b04dd(0xdb)](_0x47cffd):undefined},'label':_0x3e5acf['label'],'path':_0x3e5acf[_0x2b04dd(0xb3)]},_0x5c6f67=await createMenuRecord(_0x32d1b5,_0x3c08b0,_0x2b04dd(0xbe)+_0x3e5acf[_0x2b04dd(0xdc)]+'\x22');return logger[_0x2b04dd(0xbc)](_0x2b04dd(0xd9),_0x2b04dd(0xba)+_0x3e5acf[_0x2b04dd(0xdc)]),_0x5c6f67;}export async function createMenus(_0x6e2474,_0x1a4b7c,_0x599c9c,_0x1625bd,_0x56c480){const _0x5a15bf=a181_0x3afb;logger[_0x5a15bf(0xbc)](_0x5a15bf(0xb7),_0x5a15bf(0xaf)+_0x599c9c[_0x5a15bf(0xbf)]);const _0x3fed14=await Promise[_0x5a15bf(0xb6)](_0x599c9c[_0x5a15bf(0xcc)](_0x386ffc=>createSingleMenu(_0x6e2474,_0x1a4b7c,_0x386ffc,_0x1625bd,_0x56c480)));return logger[_0x5a15bf(0xbc)](_0x5a15bf(0xb7),'Batch\x20menu\x20creation\x20completed,\x20total\x20'+_0x599c9c[_0x5a15bf(0xbf)]),_0x3fed14;}function a181_0x3afb(_0x34a2d4,_0x74af84){_0x34a2d4=_0x34a2d4-0xac;const _0x4d94c3=a181_0x4d94();let _0x3afb3d=_0x4d94c3[_0x34a2d4];return _0x3afb3d;}export async function updateMenuCdnUrl(_0x5b6cf3,_0x3189db,_0x57c117){const _0x3ae80a=a181_0x3afb;logger['info'](_0x3ae80a(0xae),_0x3ae80a(0xc1)+_0x57c117[_0x3ae80a(0xdc)]+'\x20('+_0x57c117['path']+')');const _0x3ee76a={'id':_0x57c117['id'],'appCode':_0x5b6cf3,'extend':{..._0x57c117[_0x3ae80a(0xb8)]??{},..._0x57c117[_0x3ae80a(0xc8)]?{'loadScriptMode':_0x57c117['loadScriptMode']}:{},'resources':_0x57c117[_0x3ae80a(0xd3)]?JSON[_0x3ae80a(0xdb)](_0x57c117[_0x3ae80a(0xd3)]):undefined}},_0x116944=await updateMenuRecord(_0x3ee76a,_0x3189db,_0x3ae80a(0xcd)+_0x57c117[_0x3ae80a(0xdc)]+'\x22');return logger['info'](_0x3ae80a(0xae),_0x3ae80a(0xc2)+_0x57c117['label'],undefined),_0x116944;}function a181_0x4d94(){const _0x254a9c=['9657100ydqjKv','boolean','2270037HJIIdv','441583iHcxlb','loadScriptMode','total','menus','15fofbrI','map','Update\x20menu\x20assets\x20\x22','\x20online\x20menus\x20successfully','\x20menu','get-online-menu-list','373244JKheJG','Creating\x20menu:\x20','resources','Delete\x20','import','Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20','menuGroups','95SDIgvv','create-menu','33306qIxUaT','stringify','label','appName','Fetched\x20','update-menu-cdn-url','Start\x20batch\x20menu\x20creation,\x20total\x20','2kbwcQa','Regroup\x20','parentId','path','3081663eIwGIs','order','all','create-menus','extend','2105720aXEHBG','Menu\x20created\x20successfully:\x20','number','info','visible','Create\x20menu\x20\x22','length','\x20menu\x20group(s)','Updating\x20menu\x20asset\x20links:\x20','Menu\x20assets\x20synced:\x20','procode'];a181_0x4d94=function(){return _0x254a9c;};return a181_0x4d94();}export async function createMenuEntity(_0x1e1dd8,_0x28eb99,_0x4c20d6){const _0x57942a=a181_0x3afb;return createMenuRecord({'appCode':_0x1e1dd8,..._0x4c20d6},_0x28eb99,'Create\x20menu\x20\x22'+_0x4c20d6[_0x57942a(0xdc)]+'\x22');}export async function updateMenuEntity(_0x3d3c03,_0x5da688,_0x32c97e){return updateMenuRecord({'appCode':_0x3d3c03,..._0x32c97e},_0x5da688,'Update\x20menu\x20'+_0x32c97e['id']);}export async function batchDeleteMenuEntities(_0x5db82e,_0x1175ea){const _0x14278c=a181_0x3afb;return batchDeleteMenuRecords(_0x1175ea,_0x5db82e,_0x14278c(0xd4)+_0x1175ea['length']+_0x14278c(0xcf)+(_0x1175ea[_0x14278c(0xbf)]===0x1?'':'s'));}export async function startMenuRegroup(_0x773bd7,_0x1fe521){const _0x20c3ac=a181_0x3afb;return a181_0x1624a0(_0x1fe521,_0x773bd7,_0x20c3ac(0xb1)+_0x1fe521[_0x20c3ac(0xd7)][_0x20c3ac(0xbf)]+_0x20c3ac(0xc0));}
1
+ (function(_0x16b64d,_0x1a5842){const _0x2f5b3b=a182_0x1e42,_0x11aef1=_0x16b64d();while(!![]){try{const _0x65cc94=parseInt(_0x2f5b3b(0x1b9))/0x1*(parseInt(_0x2f5b3b(0x1e2))/0x2)+parseInt(_0x2f5b3b(0x1b8))/0x3+parseInt(_0x2f5b3b(0x1c1))/0x4*(-parseInt(_0x2f5b3b(0x1ba))/0x5)+parseInt(_0x2f5b3b(0x1cd))/0x6+parseInt(_0x2f5b3b(0x1cf))/0x7+-parseInt(_0x2f5b3b(0x1c9))/0x8*(parseInt(_0x2f5b3b(0x1bb))/0x9)+-parseInt(_0x2f5b3b(0x1db))/0xa;if(_0x65cc94===_0x1a5842)break;else _0x11aef1['push'](_0x11aef1['shift']());}catch(_0x36f639){_0x11aef1['push'](_0x11aef1['shift']());}}}(a182_0x6c7e,0x7faa8));function a182_0x6c7e(){const _0x432f07=['number','menus','Fetched\x20','update-menu-cdn-url','visible','Menu\x20assets\x20synced:\x20','Update\x20menu\x20assets\x20\x22','18004310LXyxlE','resources','length','Regroup\x20','Fetching\x20online\x20menu\x20list...\x20(appCode:\x20','create-menus','all','1024vkcQaz','order','path','stringify','Start\x20batch\x20menu\x20creation,\x20total\x20','2785776CEVYXA','1934dKzoHH','143740MJTFzw','234aVgqJt','Batch\x20menu\x20creation\x20completed,\x20total\x20','create-menu','Update\x20menu\x20','Delete\x20','total','16tfcaud','get-online-menu-list','loadScriptMode','Menu\x20created\x20successfully:\x20','info','parentId','appName','extend','127352dPNJwx','boolean','menuGroups','label','1752222LagGXY','\x20menu','4489800EQzpkC','\x20online\x20menus\x20successfully','Updating\x20menu\x20asset\x20links:\x20','Create\x20menu\x20\x22','procode'];a182_0x6c7e=function(){return _0x432f07;};return a182_0x6c7e();}import{getEnv,isProduction}from'../../../constant/env.js';import{logger}from'../../../utils/logger.js';function a182_0x1e42(_0x59e364,_0x3be5ad){_0x59e364=_0x59e364-0x1b7;const _0x6c7e6e=a182_0x6c7e();let _0x1e423f=_0x6c7e6e[_0x59e364];return _0x1e423f;}import{fetchMenuSnapshot,toProcessedMenuItem}from'../../../commands/menu/shared/facts.js';import{batchDeleteMenuRecords,createMenuRecord,startMenuRegroup as a182_0x37f743,updateMenuRecord}from'../../../core/api-client.js';export async function getOnlineMenuList(_0x4c3250,_0x454297){const _0x543e7c=a182_0x1e42,_0x5651d9=getEnv();logger['info'](_0x543e7c(0x1c2),isProduction(_0x5651d9)?_0x543e7c(0x1df)+_0x4c3250+')':'Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20'+_0x4c3250+')');const _0x2a547c=await fetchMenuSnapshot(_0x4c3250,_0x454297,{'verbose':!![]});return logger[_0x543e7c(0x1c5)](_0x543e7c(0x1c2),_0x543e7c(0x1d6)+_0x2a547c[_0x543e7c(0x1c0)]+_0x543e7c(0x1d0)),_0x2a547c[_0x543e7c(0x1d5)]['map'](toProcessedMenuItem);}export async function createMenu(_0x35feda,_0x3c4194,_0x264ee7){const _0x721f4f=a182_0x1e42;logger[_0x721f4f(0x1c5)](_0x721f4f(0x1bd),'Creating\x20menu:\x20'+_0x264ee7[_0x721f4f(0x1cc)]+'\x20('+_0x264ee7[_0x721f4f(0x1e4)]+')');const _0x1aff53={'appCode':_0x35feda,'type':_0x721f4f(0x1d3),'sort':0x0,'extend':{'loadScriptMode':'import','resources':_0x264ee7[_0x721f4f(0x1dc)]?JSON[_0x721f4f(0x1e5)](_0x264ee7['resources']):undefined},..._0x264ee7},_0x18e5e7=await createMenuRecord(_0x1aff53,_0x3c4194,'Create\x20menu\x20\x22'+_0x264ee7['label']+'\x22');return logger['info'](_0x721f4f(0x1bd),_0x721f4f(0x1c4)+_0x264ee7[_0x721f4f(0x1cc)]),_0x18e5e7;}async function createSingleMenu(_0x3f335c,_0x48c7b1,_0x37e035,_0x56b15c,_0x5b6206){const _0x433517=a182_0x1e42,_0x4981ed={'appCode':_0x3f335c,'type':_0x433517(0x1d3),'sort':_0x433517(0x1e3)in _0x37e035&&typeof _0x37e035[_0x433517(0x1e3)]==='number'?_0x37e035[_0x433517(0x1e3)]:0x0,..._0x433517(0x1d8)in _0x37e035&&typeof _0x37e035['visible']===_0x433517(0x1ca)?{'visible':_0x37e035['visible']}:{},...'parentId'in _0x37e035&&typeof _0x37e035[_0x433517(0x1c6)]===_0x433517(0x1d4)?{'parentId':_0x37e035[_0x433517(0x1c6)]}:{},'extend':{..._0x5b6206?.[_0x433517(0x1c7)]?{'appName':_0x5b6206[_0x433517(0x1c7)]}:{},'loadScriptMode':'import','resources':_0x56b15c?JSON[_0x433517(0x1e5)](_0x56b15c):undefined},'label':_0x37e035['label'],'path':_0x37e035[_0x433517(0x1e4)]},_0x471932=await createMenuRecord(_0x4981ed,_0x48c7b1,_0x433517(0x1d2)+_0x37e035[_0x433517(0x1cc)]+'\x22');return logger[_0x433517(0x1c5)](_0x433517(0x1bd),_0x433517(0x1c4)+_0x37e035[_0x433517(0x1cc)]),_0x471932;}export async function createMenus(_0x6623c4,_0x2613b0,_0x33480e,_0x59fa04,_0x491e1b){const _0x44f6d0=a182_0x1e42;logger['info'](_0x44f6d0(0x1e0),_0x44f6d0(0x1b7)+_0x33480e['length']);const _0x4fa50f=await Promise[_0x44f6d0(0x1e1)](_0x33480e['map'](_0x393a91=>createSingleMenu(_0x6623c4,_0x2613b0,_0x393a91,_0x59fa04,_0x491e1b)));return logger[_0x44f6d0(0x1c5)]('create-menus',_0x44f6d0(0x1bc)+_0x33480e['length']),_0x4fa50f;}export async function updateMenuCdnUrl(_0x118190,_0x4023d4,_0x4ae5e5){const _0x100d23=a182_0x1e42;logger[_0x100d23(0x1c5)](_0x100d23(0x1d7),_0x100d23(0x1d1)+_0x4ae5e5[_0x100d23(0x1cc)]+'\x20('+_0x4ae5e5[_0x100d23(0x1e4)]+')');const _0x427e25={'id':_0x4ae5e5['id'],'appCode':_0x118190,'extend':{..._0x4ae5e5[_0x100d23(0x1c8)]??{},..._0x4ae5e5[_0x100d23(0x1c3)]?{'loadScriptMode':_0x4ae5e5['loadScriptMode']}:{},'resources':_0x4ae5e5[_0x100d23(0x1dc)]?JSON['stringify'](_0x4ae5e5[_0x100d23(0x1dc)]):undefined}},_0x542fe0=await updateMenuRecord(_0x427e25,_0x4023d4,_0x100d23(0x1da)+_0x4ae5e5[_0x100d23(0x1cc)]+'\x22');return logger[_0x100d23(0x1c5)](_0x100d23(0x1d7),_0x100d23(0x1d9)+_0x4ae5e5[_0x100d23(0x1cc)],undefined),_0x542fe0;}export async function createMenuEntity(_0x383a57,_0x55988f,_0x1b6a69){const _0xcea98b=a182_0x1e42;return createMenuRecord({'appCode':_0x383a57,..._0x1b6a69},_0x55988f,_0xcea98b(0x1d2)+_0x1b6a69[_0xcea98b(0x1cc)]+'\x22');}export async function updateMenuEntity(_0x33fc67,_0x7f530,_0x5ab73f){const _0x449935=a182_0x1e42;return updateMenuRecord({'appCode':_0x33fc67,..._0x5ab73f},_0x7f530,_0x449935(0x1be)+_0x5ab73f['id']);}export async function batchDeleteMenuEntities(_0x4647b7,_0x4bbd32){const _0x2ba089=a182_0x1e42;return batchDeleteMenuRecords(_0x4bbd32,_0x4647b7,_0x2ba089(0x1bf)+_0x4bbd32['length']+_0x2ba089(0x1ce)+(_0x4bbd32[_0x2ba089(0x1dd)]===0x1?'':'s'));}export async function startMenuRegroup(_0x2aa323,_0x37c08e){const _0x49959a=a182_0x1e42;return a182_0x37f743(_0x37c08e,_0x2aa323,_0x49959a(0x1de)+_0x37c08e[_0x49959a(0x1cb)]['length']+'\x20menu\x20group(s)');}
@@ -1 +1 @@
1
- function a182_0x2db4(_0x41190c,_0x299ec4){_0x41190c=_0x41190c-0xf5;const _0x2fe8e4=a182_0x2fe8();let _0x2db410=_0x2fe8e4[_0x41190c];return _0x2db410;}const a182_0x3e8904=a182_0x2db4;function a182_0x2fe8(){const _0x2c9b3e=['8cZKxFl','1351674JnXdUX','1333550XdkYXc','isArray','menu\x20','message','app','app.extend.assets[','appCode','length','map','filter','path','appName','app.extend.assets\x20must\x20be\x20an\x20array.','5541XBTaXK','app.extend','menu','1656952LaMSab','object','resources','Explicit\x20frontend\x20subapp\x20appName\x20matching\x20host\x20assets\x20and\x20menu\x20bindings;\x20not\x20inferred\x20from\x20package\x20name\x20or\x20app\x20code','580NJPFxk','No\x20shared\x20resources\x20configured\x20for\x20','app-name','537971VmMOLW','str','4LCrfOT','\x20must\x20be\x20an\x20array\x20of\x20URLs.','\x20resources','some','sharedConfigured','10QyXPFx','loadScriptMode','extend','stringify','basename','app.extend.assets','162786HawmdY','96838NwllqW','subapp.resources','validation','assets','string','parse','\x20contains\x20invalid\x20JSON.'];a182_0x2fe8=function(){return _0x2c9b3e;};return a182_0x2fe8();}(function(_0x114da4,_0x239cad){const _0x5b3445=a182_0x2db4,_0x3cfa45=_0x114da4();while(!![]){try{const _0x177ab2=parseInt(_0x5b3445(0x121))/0x1*(parseInt(_0x5b3445(0x115))/0x2)+-parseInt(_0x5b3445(0x109))/0x3*(-parseInt(_0x5b3445(0x110))/0x4)+parseInt(_0x5b3445(0x11a))/0x5*(-parseInt(_0x5b3445(0x120))/0x6)+-parseInt(_0x5b3445(0x113))/0x7*(parseInt(_0x5b3445(0xfa))/0x8)+-parseInt(_0x5b3445(0xfb))/0x9+parseInt(_0x5b3445(0xfc))/0xa+-parseInt(_0x5b3445(0x10c))/0xb;if(_0x177ab2===_0x239cad)break;else _0x3cfa45['push'](_0x3cfa45['shift']());}catch(_0x8f223f){_0x3cfa45['push'](_0x3cfa45['shift']());}}}(a182_0x2fe8,0x27c61));import{getSmartAppRecord}from'../../../core/api-client.js';import{APPCODE_FLAG}from'../../../commands/common/flags.js';import{CliErrors}from'../../../errors.js';function objectValue(_0x2aabdb,_0x4613d8){const _0x41fc9e=a182_0x2db4,_0xa4c933=typeof _0x2aabdb==='string'?parseJson(_0x2aabdb,_0x4613d8):_0x2aabdb;if(!_0xa4c933||typeof _0xa4c933!==_0x41fc9e(0x10d)||Array[_0x41fc9e(0xfd)](_0xa4c933))throw CliErrors[_0x41fc9e(0xf5)](_0x4613d8+'\x20must\x20be\x20a\x20JSON\x20object.');return _0xa4c933;}function parseJson(_0x291f17,_0x28d2f6){const _0x13d415=a182_0x2db4;try{return JSON[_0x13d415(0xf8)](_0x291f17);}catch{throw CliErrors[_0x13d415(0xf5)](_0x28d2f6+_0x13d415(0xf9));}}function resourceList(_0x15c617,_0x5271d7){const _0x1e12ec=a182_0x2db4;if(typeof _0x15c617!==_0x1e12ec(0xf7))throw CliErrors[_0x1e12ec(0xf5)](_0x5271d7+'\x20must\x20be\x20a\x20JSON\x20string\x20of\x20URLs.');const _0x59989a=parseJson(_0x15c617,_0x5271d7);if(!Array[_0x1e12ec(0xfd)](_0x59989a)||_0x59989a[_0x1e12ec(0x118)](_0x150011=>typeof _0x150011!==_0x1e12ec(0xf7)))throw CliErrors[_0x1e12ec(0xf5)](_0x5271d7+_0x1e12ec(0x116));return _0x59989a;}export function buildSubappAssetsStatus(_0x314d58,_0x20de9b,_0x424779){const _0x35aa2c=a182_0x2db4,_0x56aae4=_0x314d58['extend']==null?{}:objectValue(_0x314d58[_0x35aa2c(0x11c)],_0x35aa2c(0x10a)),_0x7c833=_0x56aae4['assets']==null?[]:typeof _0x56aae4[_0x35aa2c(0xf6)]==='string'?parseJson(_0x56aae4[_0x35aa2c(0xf6)],_0x35aa2c(0x11f)):_0x56aae4[_0x35aa2c(0xf6)];if(!Array['isArray'](_0x7c833))throw CliErrors[_0x35aa2c(0xf5)](_0x35aa2c(0x108));const _0x1a7f10=_0x7c833[_0x35aa2c(0x104)]((_0x4abd8a,_0x2f5388)=>objectValue(_0x4abd8a,_0x35aa2c(0x101)+_0x2f5388+']')),_0x3ac187=_0x1a7f10[_0x35aa2c(0x105)](_0x4905bc=>_0x4905bc[_0x35aa2c(0x107)]===_0x424779);if(_0x3ac187[_0x35aa2c(0x103)]>0x1)throw CliErrors['validation']('Duplicate\x20subapp\x20records\x20for\x20'+_0x424779+'.');const _0x514ac7=_0x3ac187[0x0],_0x5c2a3f=_0x514ac7?.[_0x35aa2c(0x10e)]==null?[]:resourceList(_0x514ac7[_0x35aa2c(0x10e)],_0x35aa2c(0x122)),_0x25c1fa=_0x20de9b['filter'](_0x2d4d47=>_0x2d4d47[_0x35aa2c(0x11c)]?.['appName']===_0x424779),_0x4bf6e3=_0x25c1fa['map'](_0x4a08c3=>{const _0x36b2e7=_0x35aa2c;let _0x53a970=null,_0x2baebb=null;try{_0x53a970=_0x4a08c3['extend']?.[_0x36b2e7(0x10e)]==null?_0x4a08c3[_0x36b2e7(0x10e)]:resourceList(_0x4a08c3[_0x36b2e7(0x11c)][_0x36b2e7(0x10e)],_0x36b2e7(0xfe)+_0x4a08c3['id']+_0x36b2e7(0x117));}catch(_0x45af97){_0x2baebb=_0x45af97 instanceof Error?_0x45af97[_0x36b2e7(0xff)]:String(_0x45af97);}const _0x56a522=_0x5c2a3f[_0x36b2e7(0x103)]>0x0?_0x36b2e7(0x100):_0x36b2e7(0x10b),_0x25e3c=_0x56a522==='app'?_0x5c2a3f:_0x53a970;return{'id':_0x4a08c3['id'],'path':_0x4a08c3[_0x36b2e7(0x106)],'preferredSourceIfSupported':_0x56a522,'preferredResourcesIfSupported':_0x25e3c,'menuFallbackResources':_0x53a970,'menuFallbackError':_0x2baebb,'fallbackDiffers':_0x53a970===null?null:_0x56a522===_0x36b2e7(0x100)&&_0x53a970['length']>0x0&&JSON[_0x36b2e7(0x11d)](_0x53a970)!==JSON[_0x36b2e7(0x11d)](_0x25e3c)};});return{'appName':_0x424779,'hostCapabilityVerified':![],'sharedConfigured':Boolean(_0x514ac7),'sharedResources':_0x5c2a3f,'loadScriptMode':_0x514ac7?.[_0x35aa2c(0x11b)]??null,'basename':_0x514ac7?.[_0x35aa2c(0x11e)]??null,'boundMenus':_0x4bf6e3[_0x35aa2c(0x103)],'staleMenuFallbacks':_0x4bf6e3[_0x35aa2c(0x105)](_0x8b196b=>_0x8b196b['fallbackDiffers'])['length'],'menus':_0x4bf6e3};}export async function assertSharedResourcesConfigured(_0x599dc1,_0x146030,_0x4a5f6a){const _0x2752a=a182_0x2db4,_0x5b5de9=await getSmartAppRecord(_0x599dc1,_0x146030),_0x42f9c9=buildSubappAssetsStatus(_0x5b5de9,[],_0x4a5f6a);if(!_0x42f9c9[_0x2752a(0x119)]||_0x42f9c9['sharedResources'][_0x2752a(0x103)]===0x0)throw CliErrors[_0x2752a(0xf5)](_0x2752a(0x111)+_0x4a5f6a+'.');}export const SUBAPP_ASSET_SELECTOR_FLAGS=[{...APPCODE_FLAG,'required':![],'description':'Menu\x20host\x20app\x20code;\x20overrides\x20the\x20selected\x20workspace\x20app'},{'name':a182_0x3e8904(0x112),'type':a182_0x3e8904(0xf7),'required':!![],'description':a182_0x3e8904(0x10f)}];export function getSubappSelector(_0x38564c){const _0xd31673=a182_0x3e8904,_0x280d83=_0x38564c[_0xd31673(0x102)],_0x546476=_0x38564c[_0xd31673(0x114)]('app-name')['trim']();if(!_0x546476)throw CliErrors['validation']('--app-name\x20is\x20required.');return{'appCode':_0x280d83,'appName':_0x546476};}
1
+ const a183_0x5d6698=a183_0x1d6c;(function(_0x24b036,_0x2c4877){const _0x275b69=a183_0x1d6c,_0x32df89=_0x24b036();while(!![]){try{const _0x32061e=-parseInt(_0x275b69(0xb3))/0x1+-parseInt(_0x275b69(0xa5))/0x2+parseInt(_0x275b69(0xb7))/0x3+-parseInt(_0x275b69(0xb0))/0x4+parseInt(_0x275b69(0xa4))/0x5*(parseInt(_0x275b69(0xaf))/0x6)+-parseInt(_0x275b69(0x97))/0x7+parseInt(_0x275b69(0xb6))/0x8;if(_0x32061e===_0x2c4877)break;else _0x32df89['push'](_0x32df89['shift']());}catch(_0x238d59){_0x32df89['push'](_0x32df89['shift']());}}}(a183_0x93d5,0x7d730));import{getSmartAppRecord}from'../../../core/api-client.js';import{APPCODE_FLAG}from'../../../commands/common/flags.js';import{CliErrors}from'../../../errors.js';function objectValue(_0x2b3688,_0x4a1160){const _0x709110=a183_0x1d6c,_0x23ad90=typeof _0x2b3688===_0x709110(0xa0)?parseJson(_0x2b3688,_0x4a1160):_0x2b3688;if(!_0x23ad90||typeof _0x23ad90!==_0x709110(0xbe)||Array[_0x709110(0xb2)](_0x23ad90))throw CliErrors[_0x709110(0xbd)](_0x4a1160+_0x709110(0x9e));return _0x23ad90;}function a183_0x93d5(){const _0xd86b9f=['\x20must\x20be\x20a\x20JSON\x20object.','subapp.resources','string','basename','app-name','sharedResources','766820JNnoGv','1403108lAIoXj','message','Menu\x20host\x20app\x20code;\x20overrides\x20the\x20selected\x20workspace\x20app','filter','map','trim','length','str','app.extend.assets','sharedConfigured','24KnRRjz','3474896JtNOYz','--app-name\x20is\x20required.','isArray','702021ZSOXzX','\x20must\x20be\x20a\x20JSON\x20string\x20of\x20URLs.','appName','15911248uIGKuR','2410698dsuRUo','assets','resources','app','loadScriptMode','appCode','validation','object','app.extend','menu','path','4338523VCPSQz','Duplicate\x20subapp\x20records\x20for\x20','stringify','extend','Explicit\x20frontend\x20subapp\x20appName\x20matching\x20host\x20assets\x20and\x20menu\x20bindings;\x20not\x20inferred\x20from\x20package\x20name\x20or\x20app\x20code','app.extend.assets[','fallbackDiffers'];a183_0x93d5=function(){return _0xd86b9f;};return a183_0x93d5();}function a183_0x1d6c(_0x7a2361,_0x52bff9){_0x7a2361=_0x7a2361-0x94;const _0x93d59f=a183_0x93d5();let _0x1d6c5c=_0x93d59f[_0x7a2361];return _0x1d6c5c;}function parseJson(_0x20d6ed,_0x3e35cb){const _0x327caa=a183_0x1d6c;try{return JSON['parse'](_0x20d6ed);}catch{throw CliErrors[_0x327caa(0xbd)](_0x3e35cb+'\x20contains\x20invalid\x20JSON.');}}function resourceList(_0x5e6435,_0x3b35f1){const _0x133ac3=a183_0x1d6c;if(typeof _0x5e6435!==_0x133ac3(0xa0))throw CliErrors[_0x133ac3(0xbd)](_0x3b35f1+_0x133ac3(0xb4));const _0x6b19e3=parseJson(_0x5e6435,_0x3b35f1);if(!Array[_0x133ac3(0xb2)](_0x6b19e3)||_0x6b19e3['some'](_0x4a5705=>typeof _0x4a5705!==_0x133ac3(0xa0)))throw CliErrors['validation'](_0x3b35f1+'\x20must\x20be\x20an\x20array\x20of\x20URLs.');return _0x6b19e3;}export function buildSubappAssetsStatus(_0x10aed2,_0x32785f,_0x3d60a1){const _0x18b8fa=a183_0x1d6c,_0x370fc1=_0x10aed2[_0x18b8fa(0x9a)]==null?{}:objectValue(_0x10aed2[_0x18b8fa(0x9a)],_0x18b8fa(0x94)),_0xf1d0df=_0x370fc1[_0x18b8fa(0xb8)]==null?[]:typeof _0x370fc1['assets']===_0x18b8fa(0xa0)?parseJson(_0x370fc1[_0x18b8fa(0xb8)],_0x18b8fa(0xad)):_0x370fc1[_0x18b8fa(0xb8)];if(!Array[_0x18b8fa(0xb2)](_0xf1d0df))throw CliErrors[_0x18b8fa(0xbd)]('app.extend.assets\x20must\x20be\x20an\x20array.');const _0x5868eb=_0xf1d0df['map']((_0x182701,_0x13dadc)=>objectValue(_0x182701,_0x18b8fa(0x9c)+_0x13dadc+']')),_0x2a8436=_0x5868eb['filter'](_0x57bd0e=>_0x57bd0e[_0x18b8fa(0xb5)]===_0x3d60a1);if(_0x2a8436['length']>0x1)throw CliErrors[_0x18b8fa(0xbd)](_0x18b8fa(0x98)+_0x3d60a1+'.');const _0x1d5dcd=_0x2a8436[0x0],_0x58aafd=_0x1d5dcd?.[_0x18b8fa(0xb9)]==null?[]:resourceList(_0x1d5dcd[_0x18b8fa(0xb9)],_0x18b8fa(0x9f)),_0x5f1d68=_0x32785f[_0x18b8fa(0xa8)](_0x39035d=>_0x39035d[_0x18b8fa(0x9a)]?.[_0x18b8fa(0xb5)]===_0x3d60a1),_0x4fea4b=_0x5f1d68[_0x18b8fa(0xa9)](_0x2e6873=>{const _0x456077=_0x18b8fa;let _0x533c07=null,_0x340252=null;try{_0x533c07=_0x2e6873[_0x456077(0x9a)]?.[_0x456077(0xb9)]==null?_0x2e6873[_0x456077(0xb9)]:resourceList(_0x2e6873[_0x456077(0x9a)]['resources'],'menu\x20'+_0x2e6873['id']+'\x20resources');}catch(_0x3dffbc){_0x340252=_0x3dffbc instanceof Error?_0x3dffbc[_0x456077(0xa6)]:String(_0x3dffbc);}const _0xdc9fdf=_0x58aafd['length']>0x0?_0x456077(0xba):_0x456077(0x95),_0x21cc49=_0xdc9fdf==='app'?_0x58aafd:_0x533c07;return{'id':_0x2e6873['id'],'path':_0x2e6873[_0x456077(0x96)],'preferredSourceIfSupported':_0xdc9fdf,'preferredResourcesIfSupported':_0x21cc49,'menuFallbackResources':_0x533c07,'menuFallbackError':_0x340252,'fallbackDiffers':_0x533c07===null?null:_0xdc9fdf==='app'&&_0x533c07[_0x456077(0xab)]>0x0&&JSON[_0x456077(0x99)](_0x533c07)!==JSON[_0x456077(0x99)](_0x21cc49)};});return{'appName':_0x3d60a1,'hostCapabilityVerified':![],'sharedConfigured':Boolean(_0x1d5dcd),'sharedResources':_0x58aafd,'loadScriptMode':_0x1d5dcd?.[_0x18b8fa(0xbb)]??null,'basename':_0x1d5dcd?.[_0x18b8fa(0xa1)]??null,'boundMenus':_0x4fea4b[_0x18b8fa(0xab)],'staleMenuFallbacks':_0x4fea4b[_0x18b8fa(0xa8)](_0x5f46f8=>_0x5f46f8[_0x18b8fa(0x9d)])[_0x18b8fa(0xab)],'menus':_0x4fea4b};}export async function assertSharedResourcesConfigured(_0x438ae6,_0x287a5f,_0x2d49ed){const _0x189c9e=a183_0x1d6c,_0x4b0573=await getSmartAppRecord(_0x438ae6,_0x287a5f),_0x380513=buildSubappAssetsStatus(_0x4b0573,[],_0x2d49ed);if(!_0x380513[_0x189c9e(0xae)]||_0x380513[_0x189c9e(0xa3)][_0x189c9e(0xab)]===0x0)throw CliErrors[_0x189c9e(0xbd)]('No\x20shared\x20resources\x20configured\x20for\x20'+_0x2d49ed+'.');}export const SUBAPP_ASSET_SELECTOR_FLAGS=[{...APPCODE_FLAG,'required':![],'description':a183_0x5d6698(0xa7)},{'name':a183_0x5d6698(0xa2),'type':a183_0x5d6698(0xa0),'required':!![],'description':a183_0x5d6698(0x9b)}];export function getSubappSelector(_0x1e5845){const _0x339614=a183_0x5d6698,_0x29350d=_0x1e5845[_0x339614(0xbc)],_0x5c8751=_0x1e5845[_0x339614(0xac)]('app-name')[_0x339614(0xaa)]();if(!_0x5c8751)throw CliErrors[_0x339614(0xbd)](_0x339614(0xb1));return{'appCode':_0x29350d,'appName':_0x5c8751};}
@@ -1 +1 @@
1
- const a183_0x142de5=a183_0x216b;(function(_0x5e1516,_0x3852a5){const _0x572e67=a183_0x216b,_0x40dc2f=_0x5e1516();while(!![]){try{const _0x3f3108=parseInt(_0x572e67(0x96))/0x1*(-parseInt(_0x572e67(0xb4))/0x2)+parseInt(_0x572e67(0x95))/0x3*(-parseInt(_0x572e67(0xaa))/0x4)+parseInt(_0x572e67(0x97))/0x5+parseInt(_0x572e67(0x92))/0x6+parseInt(_0x572e67(0xb2))/0x7*(parseInt(_0x572e67(0xa1))/0x8)+parseInt(_0x572e67(0x98))/0x9+-parseInt(_0x572e67(0x94))/0xa*(parseInt(_0x572e67(0x91))/0xb);if(_0x3f3108===_0x3852a5)break;else _0x40dc2f['push'](_0x40dc2f['shift']());}catch(_0x3b13e0){_0x40dc2f['push'](_0x40dc2f['shift']());}}}(a183_0x1131,0xbcaf3));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';import{logger}from'../../../utils/logger.js';import{assertSharedResourcesConfigured}from'../../../commands/menu/shared/subapp-assets.js';function a183_0x1131(){const _0x396bc4=['Invalid\x20--params.','label','info','--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.','Invalid\x20--params.visible:\x20expected\x20a\x20boolean.','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','4TKpVnV','number','Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20','message','Menu\x20sync\x20completed','setLogPath','join','cssUrl','21zqGTtq','jsUrl','2cGTcdU','Invalid\x20--params:\x20','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','map','keys',';\x20found\x20','No\x20local\x20pages\x20matched\x20paths:\x20','string','Invalid\x20--params\x20JSON.','path','group','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','filter','\x22\x20for\x20','folder','\x0a\x20\x20Available\x20local\x20paths:\x20','has','get','Parent\x20','Invalid\x20--params.parentId:\x20expected\x20a\x20non-negative\x20integer.','type','procode','visible','Expected\x20one\x20folder\x20named\x20\x22',':\x20expected\x20a\x20non-empty\x20string.','11qCqVZC','5116038tjpCqW','dryRun','11754740dOTfFk','32667tYDWMD','243228NQJyFf','3508535ydwxxq','5503509hUHKZS','length','trim','--params.','boolean','isInteger','parentId','appName','menu-sync','97496RhqQBb','CSS\x20URL\x20is\x20unreachable:\x20','push'];a183_0x1131=function(){return _0x396bc4;};return a183_0x1131();}const MENU_SYNC_PARAM_KEYS=new Set([a183_0x142de5(0xb3),a183_0x142de5(0xb1),a183_0x142de5(0x9f),'visible',a183_0x142de5(0x9e)]);export function resolvePage(_0x50d581,_0x4f8bd5,_0x94b8a5){const _0x2f8c51=a183_0x142de5;let _0x482fae=_0x4f8bd5[_0x2f8c51(0x9e)]??_0x50d581[_0x2f8c51(0x9e)];if(_0x482fae===undefined&&_0x50d581['group']){const _0x2dc5ba=_0x94b8a5[_0x2f8c51(0x84)](_0x219acd=>_0x219acd[_0x2f8c51(0x8c)]==='folder'&&_0x219acd[_0x2f8c51(0xa5)]===_0x50d581[_0x2f8c51(0xbe)]);if(_0x2dc5ba[_0x2f8c51(0x99)]!==0x1)throw new Error(_0x2f8c51(0x8f)+_0x50d581[_0x2f8c51(0xbe)]+_0x2f8c51(0x85)+_0x50d581[_0x2f8c51(0xbd)]+_0x2f8c51(0xb9)+_0x2dc5ba[_0x2f8c51(0x99)]);_0x482fae=_0x2dc5ba[0x0]['id'];}if(_0x482fae!==undefined&&_0x482fae!==0x0&&_0x94b8a5[_0x2f8c51(0x84)](_0x3fd111=>_0x3fd111['id']===_0x482fae&&_0x3fd111[_0x2f8c51(0x8c)]===_0x2f8c51(0x86))[_0x2f8c51(0x99)]!==0x1)throw new Error(_0x2f8c51(0x8a)+_0x482fae+'\x20must\x20be\x20an\x20existing\x20folder\x20in\x20the\x20selected\x20menu\x20host.');return{..._0x50d581,..._0x482fae===undefined?{}:{'parentId':_0x482fae},..._0x4f8bd5[_0x2f8c51(0x8e)]===undefined?{}:{'visible':_0x4f8bd5[_0x2f8c51(0x8e)]}};}function a183_0x216b(_0x36a0ad,_0x5d230e){_0x36a0ad=_0x36a0ad-0x84;const _0x113184=a183_0x1131();let _0x216b9a=_0x113184[_0x36a0ad];return _0x216b9a;}function validateParams(_0x48449d){const _0x2818e8=a183_0x142de5,_0x290234=[];return _0x48449d['jsUrl']&&!isValidJsHttpsUrl(_0x48449d[_0x2818e8(0xb3)])&&_0x290234[_0x2818e8(0xa3)]({'field':'jsUrl','message':_0x2818e8(0xa9)}),_0x48449d[_0x2818e8(0xb1)]&&!isValidCssHttpsUrl(_0x48449d[_0x2818e8(0xb1)])&&_0x290234[_0x2818e8(0xa3)]({'field':_0x2818e8(0xb1),'message':_0x2818e8(0xbf)}),_0x290234;}export async function runMenuSyncCore(_0x48d77,_0x1195f0,_0x45ddd2=[],_0x117be9,_0x5da19c={}){const _0x16f7dc=a183_0x142de5,_0x155a51=parseMenuSyncParams(_0x117be9),_0x3f673d=[...new Set(_0x45ddd2['map'](_0x2f6216=>_0x2f6216[_0x16f7dc(0x9a)]())[_0x16f7dc(0x84)](Boolean)['map'](menuPathKey))],_0x2c64c1=_0x155a51['jsUrl'],_0x345a00=_0x155a51[_0x16f7dc(0xb1)],_0x9dbb7e=[];if(_0x2c64c1)_0x9dbb7e[_0x16f7dc(0xa3)](_0x2c64c1);if(_0x345a00)_0x9dbb7e[_0x16f7dc(0xa3)](_0x345a00);const _0x511a20=validateParams(_0x155a51);if(_0x511a20[_0x16f7dc(0x99)]>0x0){const _0x24219a=_0x511a20[_0x16f7dc(0xb7)](_0x28c0b3=>_0x16f7dc(0x9b)+_0x28c0b3['field']+':\x20'+_0x28c0b3[_0x16f7dc(0xad)])[_0x16f7dc(0xb0)](';\x20');throw new Error(_0x16f7dc(0xb5)+_0x24219a);}logger[_0x16f7dc(0xaf)](process['cwd']()),logger[_0x16f7dc(0xa6)]('menu-sync','Start\x20non-interactive\x20menu\x20sync',{'appCode':_0x48d77,'selectedCount':_0x3f673d['length'],'jsUrl':_0x2c64c1,'cssUrl':_0x345a00});if(_0x2c64c1){const _0x539329=await isUrlReachable(_0x2c64c1);if(!_0x539329)throw new Error('JS\x20URL\x20is\x20unreachable:\x20'+_0x2c64c1);}if(_0x345a00){const _0x5c5601=await isUrlReachable(_0x345a00);if(!_0x5c5601)throw new Error(_0x16f7dc(0xa2)+_0x345a00);}const _0x1f8157=getLocalPages();if(_0x1f8157[_0x16f7dc(0x99)]===0x0){if(_0x3f673d['length']>0x0)throw new Error(_0x16f7dc(0xba)+_0x3f673d[_0x16f7dc(0xb0)](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x5da19c[_0x16f7dc(0x93)]===!![],'targetPages':[],'plannedMenus':[]};}const _0xca3941=await getOnlineMenuList(_0x48d77,_0x1195f0),_0x19ed8b=new Set(_0xca3941[_0x16f7dc(0xb7)](_0x1c81a8=>menuPathKey(_0x1c81a8[_0x16f7dc(0xbd)])));let _0x2e9a0a;if(_0x3f673d[_0x16f7dc(0x99)]>0x0){const _0x441610=new Map(_0x1f8157[_0x16f7dc(0xb7)](_0x3f8972=>[menuPathKey(_0x3f8972['path']),_0x3f8972])),_0x150f4c=_0x3f673d[_0x16f7dc(0x84)](_0x18a39c=>!_0x441610['has'](_0x18a39c));if(_0x150f4c[_0x16f7dc(0x99)]>0x0){const _0x3d8372=_0x1f8157[_0x16f7dc(0xb7)](_0x23eb36=>_0x23eb36[_0x16f7dc(0xbd)])['join'](',\x20');throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0x150f4c[_0x16f7dc(0xb0)](',\x20')+_0x16f7dc(0x87)+_0x3d8372);}const _0x3e923d=_0x3f673d[_0x16f7dc(0x84)](_0xe7693e=>_0x19ed8b[_0x16f7dc(0x88)](_0xe7693e));if(_0x3e923d[_0x16f7dc(0x99)]>0x0)throw new Error(_0x16f7dc(0xac)+_0x3e923d[_0x16f7dc(0xb0)](',\x20'));_0x2e9a0a=_0x3f673d['map'](_0x55751b=>_0x441610[_0x16f7dc(0x89)](_0x55751b));}else _0x2e9a0a=_0x1f8157['filter'](_0x30a364=>!_0x19ed8b[_0x16f7dc(0x88)](menuPathKey(_0x30a364[_0x16f7dc(0xbd)])));if(_0x2e9a0a[_0x16f7dc(0x99)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x5da19c['dryRun']===!![],'targetPages':[],'plannedMenus':[]};_0x2e9a0a=_0x2e9a0a[_0x16f7dc(0xb7)](_0x470ef9=>resolvePage(_0x470ef9,_0x155a51,_0xca3941));_0x155a51[_0x16f7dc(0x9f)]&&_0x9dbb7e['length']===0x0&&await assertSharedResourcesConfigured(_0x48d77,_0x1195f0,_0x155a51[_0x16f7dc(0x9f)]);const _0x2f6f65=_0x2e9a0a['map'](_0x4e8d19=>({'type':_0x16f7dc(0x8d),'path':_0x4e8d19[_0x16f7dc(0xbd)],'label':_0x4e8d19[_0x16f7dc(0xa5)],'loadScriptMode':'import','resources':[..._0x9dbb7e],..._0x4e8d19[_0x16f7dc(0x8e)]===undefined?{}:{'visible':_0x4e8d19['visible']},..._0x4e8d19[_0x16f7dc(0x9e)]===undefined?{}:{'parentId':_0x4e8d19[_0x16f7dc(0x9e)]},..._0x4e8d19['order']===undefined?{}:{'sort':_0x4e8d19['order']},..._0x155a51[_0x16f7dc(0x9f)]===undefined?{}:{'appName':_0x155a51[_0x16f7dc(0x9f)]}}));if(_0x5da19c[_0x16f7dc(0x93)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x2e9a0a,'plannedMenus':_0x2f6f65};const _0x5dd7ee=_0x155a51[_0x16f7dc(0x9f)]?await createMenus(_0x48d77,_0x1195f0,_0x2e9a0a,_0x9dbb7e[_0x16f7dc(0x99)]>0x0?_0x9dbb7e:undefined,{'appName':_0x155a51['appName']}):await createMenus(_0x48d77,_0x1195f0,_0x2e9a0a,_0x9dbb7e[_0x16f7dc(0x99)]>0x0?_0x9dbb7e:undefined);return logger[_0x16f7dc(0xa6)](_0x16f7dc(0xa0),_0x16f7dc(0xae),{'count':_0x2e9a0a[_0x16f7dc(0x99)],'resources':_0x9dbb7e}),{'created':_0x5dd7ee[_0x16f7dc(0x99)],'skipped':![],'dryRun':![],'targetPages':_0x2e9a0a,'plannedMenus':_0x2f6f65,'menus':_0x5dd7ee};}export function parseMenuSyncParams(_0x17a8be){const _0xfeb06f=a183_0x142de5;if(!_0x17a8be||typeof _0x17a8be!==_0xfeb06f(0xbb))return{};let _0x598cf6;try{_0x598cf6=JSON['parse'](_0x17a8be);}catch{throw new Error(_0xfeb06f(0xbc));}if(typeof _0x598cf6!=='object'||_0x598cf6===null||Array['isArray'](_0x598cf6))throw new Error(_0xfeb06f(0xb6));const _0x562d70=_0x598cf6;if(Object['hasOwn'](_0x562d70,'pages'))throw new Error(_0xfeb06f(0xa7));const _0x5e41f9=Object[_0xfeb06f(0xb8)](_0x562d70)[_0xfeb06f(0x84)](_0x17e2bd=>!MENU_SYNC_PARAM_KEYS['has'](_0x17e2bd));if(_0x5e41f9[_0xfeb06f(0x99)]>0x0)throw new Error('Invalid\x20--params\x20fields:\x20'+_0x5e41f9[_0xfeb06f(0xb0)](',\x20')+'.');for(const _0x238d1b of[_0xfeb06f(0xb3),_0xfeb06f(0xb1),_0xfeb06f(0x9f)]){const _0x2cf5a3=_0x562d70[_0x238d1b];if(_0x2cf5a3!==undefined&&(typeof _0x2cf5a3!==_0xfeb06f(0xbb)||_0x2cf5a3[_0xfeb06f(0x9a)]()===''))throw new Error(_0xfeb06f(0xa4)+_0x238d1b+_0xfeb06f(0x90));}if(_0x562d70[_0xfeb06f(0x8e)]!==undefined&&typeof _0x562d70['visible']!==_0xfeb06f(0x9c))throw new Error(_0xfeb06f(0xa8));if(_0x562d70[_0xfeb06f(0x9e)]!==undefined&&(!Number[_0xfeb06f(0x9d)](_0x562d70['parentId'])||_0x562d70[_0xfeb06f(0x9e)]<0x0))throw new Error(_0xfeb06f(0x8b));return{'jsUrl':typeof _0x562d70[_0xfeb06f(0xb3)]===_0xfeb06f(0xbb)?_0x562d70[_0xfeb06f(0xb3)][_0xfeb06f(0x9a)]():undefined,'cssUrl':typeof _0x562d70['cssUrl']===_0xfeb06f(0xbb)?_0x562d70['cssUrl'][_0xfeb06f(0x9a)]():undefined,'appName':typeof _0x562d70[_0xfeb06f(0x9f)]===_0xfeb06f(0xbb)?_0x562d70['appName'][_0xfeb06f(0x9a)]():undefined,'visible':typeof _0x562d70[_0xfeb06f(0x8e)]===_0xfeb06f(0x9c)?_0x562d70['visible']:undefined,'parentId':typeof _0x562d70[_0xfeb06f(0x9e)]===_0xfeb06f(0xab)?_0x562d70[_0xfeb06f(0x9e)]:undefined};}
1
+ const a184_0x2e3137=a184_0xf634;(function(_0x99ca13,_0x5b41f0){const _0x1c66c7=a184_0xf634,_0x31ffe7=_0x99ca13();while(!![]){try{const _0x39b42e=-parseInt(_0x1c66c7(0x189))/0x1*(-parseInt(_0x1c66c7(0x15a))/0x2)+parseInt(_0x1c66c7(0x167))/0x3+-parseInt(_0x1c66c7(0x194))/0x4*(parseInt(_0x1c66c7(0x179))/0x5)+parseInt(_0x1c66c7(0x163))/0x6*(parseInt(_0x1c66c7(0x185))/0x7)+parseInt(_0x1c66c7(0x159))/0x8+parseInt(_0x1c66c7(0x193))/0x9*(-parseInt(_0x1c66c7(0x17d))/0xa)+-parseInt(_0x1c66c7(0x17a))/0xb;if(_0x39b42e===_0x5b41f0)break;else _0x31ffe7['push'](_0x31ffe7['shift']());}catch(_0x415c03){_0x31ffe7['push'](_0x31ffe7['shift']());}}}(a184_0x2c18,0x537b4));function a184_0x2c18(){const _0x2ebf42=[';\x20found\x20','cssUrl','4829672PWlzby','105762EZHMyL','parse','trim','Invalid\x20--params.','string','Invalid\x20--params.visible:\x20expected\x20a\x20boolean.','Invalid\x20--params\x20JSON.','has','dryRun','222nKcjBD','group','boolean','Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20','2008323kKZXEP','setLogPath','--params.','menu-sync','Parent\x20','info','filter','\x20must\x20be\x20an\x20existing\x20folder\x20in\x20the\x20selected\x20menu\x20host.','number','Menu\x20sync\x20completed','Invalid\x20--params:\x20','hasOwn','--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.','map','object','Invalid\x20--params.parentId:\x20expected\x20a\x20non-negative\x20integer.','No\x20local\x20pages\x20matched\x20paths:\x20','keys','15gQtzUw','3859515AkMNOY','path','label','107110ZwpGqu','message','import','parentId','field','procode','isArray','length','32893XQKkoJ','get','folder','Expected\x20one\x20folder\x20named\x20\x22','8wzzmvm','jsUrl','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','Invalid\x20--params\x20fields:\x20',':\x20expected\x20a\x20non-empty\x20string.','pages','Start\x20non-interactive\x20menu\x20sync','visible','isInteger','push','477ChZMeI','812764Bssbxd','cwd','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','\x22\x20for\x20','join','appName','order'];a184_0x2c18=function(){return _0x2ebf42;};return a184_0x2c18();}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_0xf634(_0x516fdd,_0x181204){_0x516fdd=_0x516fdd-0x156;const _0x2c184b=a184_0x2c18();let _0xf634bd=_0x2c184b[_0x516fdd];return _0xf634bd;}import{logger}from'../../../utils/logger.js';import{assertSharedResourcesConfigured}from'../../../commands/menu/shared/subapp-assets.js';const MENU_SYNC_PARAM_KEYS=new Set([a184_0x2e3137(0x18a),a184_0x2e3137(0x158),a184_0x2e3137(0x199),a184_0x2e3137(0x190),'parentId']);export function resolvePage(_0x1c455c,_0x4d7416,_0x5decdf){const _0x323476=a184_0x2e3137;let _0x3fdc0d=_0x4d7416['parentId']??_0x1c455c[_0x323476(0x180)];if(_0x3fdc0d===undefined&&_0x1c455c[_0x323476(0x164)]){const _0x481733=_0x5decdf[_0x323476(0x16d)](_0xed8d03=>_0xed8d03['type']===_0x323476(0x187)&&_0xed8d03[_0x323476(0x17c)]===_0x1c455c[_0x323476(0x164)]);if(_0x481733['length']!==0x1)throw new Error(_0x323476(0x188)+_0x1c455c[_0x323476(0x164)]+_0x323476(0x197)+_0x1c455c[_0x323476(0x17b)]+_0x323476(0x157)+_0x481733[_0x323476(0x184)]);_0x3fdc0d=_0x481733[0x0]['id'];}if(_0x3fdc0d!==undefined&&_0x3fdc0d!==0x0&&_0x5decdf[_0x323476(0x16d)](_0x1b716a=>_0x1b716a['id']===_0x3fdc0d&&_0x1b716a['type']===_0x323476(0x187))['length']!==0x1)throw new Error(_0x323476(0x16b)+_0x3fdc0d+_0x323476(0x16e));return{..._0x1c455c,..._0x3fdc0d===undefined?{}:{'parentId':_0x3fdc0d},..._0x4d7416[_0x323476(0x190)]===undefined?{}:{'visible':_0x4d7416[_0x323476(0x190)]}};}function validateParams(_0x3cb004){const _0x225858=a184_0x2e3137,_0x321858=[];return _0x3cb004[_0x225858(0x18a)]&&!isValidJsHttpsUrl(_0x3cb004[_0x225858(0x18a)])&&_0x321858[_0x225858(0x192)]({'field':_0x225858(0x18a),'message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x3cb004[_0x225858(0x158)]&&!isValidCssHttpsUrl(_0x3cb004['cssUrl'])&&_0x321858[_0x225858(0x192)]({'field':_0x225858(0x158),'message':_0x225858(0x18b)}),_0x321858;}export async function runMenuSyncCore(_0x1c3a46,_0xbe422c,_0x5bc41f=[],_0x2dee51,_0x498559={}){const _0x3ebebc=a184_0x2e3137,_0x38649c=parseMenuSyncParams(_0x2dee51),_0x3f5925=[...new Set(_0x5bc41f[_0x3ebebc(0x174)](_0x45dd9e=>_0x45dd9e['trim']())[_0x3ebebc(0x16d)](Boolean)[_0x3ebebc(0x174)](menuPathKey))],_0x42a695=_0x38649c['jsUrl'],_0x3df3c3=_0x38649c[_0x3ebebc(0x158)],_0x283a2d=[];if(_0x42a695)_0x283a2d[_0x3ebebc(0x192)](_0x42a695);if(_0x3df3c3)_0x283a2d[_0x3ebebc(0x192)](_0x3df3c3);const _0x35e824=validateParams(_0x38649c);if(_0x35e824['length']>0x0){const _0x15fbe4=_0x35e824[_0x3ebebc(0x174)](_0x139684=>_0x3ebebc(0x169)+_0x139684[_0x3ebebc(0x181)]+':\x20'+_0x139684[_0x3ebebc(0x17e)])[_0x3ebebc(0x198)](';\x20');throw new Error(_0x3ebebc(0x171)+_0x15fbe4);}logger[_0x3ebebc(0x168)](process[_0x3ebebc(0x195)]()),logger['info'](_0x3ebebc(0x16a),_0x3ebebc(0x18f),{'appCode':_0x1c3a46,'selectedCount':_0x3f5925[_0x3ebebc(0x184)],'jsUrl':_0x42a695,'cssUrl':_0x3df3c3});if(_0x42a695){const _0x448b69=await isUrlReachable(_0x42a695);if(!_0x448b69)throw new Error('JS\x20URL\x20is\x20unreachable:\x20'+_0x42a695);}if(_0x3df3c3){const _0x236b0b=await isUrlReachable(_0x3df3c3);if(!_0x236b0b)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x3df3c3);}const _0x1f42c7=getLocalPages();if(_0x1f42c7[_0x3ebebc(0x184)]===0x0){if(_0x3f5925[_0x3ebebc(0x184)]>0x0)throw new Error(_0x3ebebc(0x177)+_0x3f5925['join'](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x498559[_0x3ebebc(0x162)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x347f8e=await getOnlineMenuList(_0x1c3a46,_0xbe422c),_0x1f99b8=new Set(_0x347f8e[_0x3ebebc(0x174)](_0x5bc47f=>menuPathKey(_0x5bc47f[_0x3ebebc(0x17b)])));let _0x4e971e;if(_0x3f5925['length']>0x0){const _0x29452a=new Map(_0x1f42c7[_0x3ebebc(0x174)](_0x4898da=>[menuPathKey(_0x4898da['path']),_0x4898da])),_0x474401=_0x3f5925[_0x3ebebc(0x16d)](_0x1585bd=>!_0x29452a[_0x3ebebc(0x161)](_0x1585bd));if(_0x474401[_0x3ebebc(0x184)]>0x0){const _0x4ba69a=_0x1f42c7['map'](_0x54683d=>_0x54683d[_0x3ebebc(0x17b)])[_0x3ebebc(0x198)](',\x20');throw new Error(_0x3ebebc(0x177)+_0x474401[_0x3ebebc(0x198)](',\x20')+'\x0a\x20\x20Available\x20local\x20paths:\x20'+_0x4ba69a);}const _0x136702=_0x3f5925[_0x3ebebc(0x16d)](_0x373d04=>_0x1f99b8[_0x3ebebc(0x161)](_0x373d04));if(_0x136702[_0x3ebebc(0x184)]>0x0)throw new Error(_0x3ebebc(0x166)+_0x136702['join'](',\x20'));_0x4e971e=_0x3f5925[_0x3ebebc(0x174)](_0x30fefe=>_0x29452a[_0x3ebebc(0x186)](_0x30fefe));}else _0x4e971e=_0x1f42c7[_0x3ebebc(0x16d)](_0x8d377a=>!_0x1f99b8[_0x3ebebc(0x161)](menuPathKey(_0x8d377a[_0x3ebebc(0x17b)])));if(_0x4e971e[_0x3ebebc(0x184)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x498559[_0x3ebebc(0x162)]===!![],'targetPages':[],'plannedMenus':[]};_0x4e971e=_0x4e971e[_0x3ebebc(0x174)](_0x16985a=>resolvePage(_0x16985a,_0x38649c,_0x347f8e));_0x38649c['appName']&&_0x283a2d[_0x3ebebc(0x184)]===0x0&&await assertSharedResourcesConfigured(_0x1c3a46,_0xbe422c,_0x38649c['appName']);const _0x3445b1=_0x4e971e['map'](_0x5787b3=>({'type':_0x3ebebc(0x182),'path':_0x5787b3[_0x3ebebc(0x17b)],'label':_0x5787b3[_0x3ebebc(0x17c)],'loadScriptMode':_0x3ebebc(0x17f),'resources':[..._0x283a2d],..._0x5787b3['visible']===undefined?{}:{'visible':_0x5787b3[_0x3ebebc(0x190)]},..._0x5787b3[_0x3ebebc(0x180)]===undefined?{}:{'parentId':_0x5787b3[_0x3ebebc(0x180)]},..._0x5787b3[_0x3ebebc(0x156)]===undefined?{}:{'sort':_0x5787b3[_0x3ebebc(0x156)]},..._0x38649c[_0x3ebebc(0x199)]===undefined?{}:{'appName':_0x38649c[_0x3ebebc(0x199)]}}));if(_0x498559[_0x3ebebc(0x162)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x4e971e,'plannedMenus':_0x3445b1};const _0x1606df=_0x38649c[_0x3ebebc(0x199)]?await createMenus(_0x1c3a46,_0xbe422c,_0x4e971e,_0x283a2d['length']>0x0?_0x283a2d:undefined,{'appName':_0x38649c[_0x3ebebc(0x199)]}):await createMenus(_0x1c3a46,_0xbe422c,_0x4e971e,_0x283a2d[_0x3ebebc(0x184)]>0x0?_0x283a2d:undefined);return logger[_0x3ebebc(0x16c)](_0x3ebebc(0x16a),_0x3ebebc(0x170),{'count':_0x4e971e['length'],'resources':_0x283a2d}),{'created':_0x1606df['length'],'skipped':![],'dryRun':![],'targetPages':_0x4e971e,'plannedMenus':_0x3445b1,'menus':_0x1606df};}export function parseMenuSyncParams(_0x5bf8a2){const _0x4f2523=a184_0x2e3137;if(!_0x5bf8a2||typeof _0x5bf8a2!==_0x4f2523(0x15e))return{};let _0x3824e2;try{_0x3824e2=JSON[_0x4f2523(0x15b)](_0x5bf8a2);}catch{throw new Error(_0x4f2523(0x160));}if(typeof _0x3824e2!==_0x4f2523(0x175)||_0x3824e2===null||Array[_0x4f2523(0x183)](_0x3824e2))throw new Error(_0x4f2523(0x196));const _0xdf1019=_0x3824e2;if(Object[_0x4f2523(0x172)](_0xdf1019,_0x4f2523(0x18e)))throw new Error(_0x4f2523(0x173));const _0x49509b=Object[_0x4f2523(0x178)](_0xdf1019)['filter'](_0x5d29b5=>!MENU_SYNC_PARAM_KEYS[_0x4f2523(0x161)](_0x5d29b5));if(_0x49509b[_0x4f2523(0x184)]>0x0)throw new Error(_0x4f2523(0x18c)+_0x49509b[_0x4f2523(0x198)](',\x20')+'.');for(const _0xcb2f6d of[_0x4f2523(0x18a),_0x4f2523(0x158),_0x4f2523(0x199)]){const _0x43a7bc=_0xdf1019[_0xcb2f6d];if(_0x43a7bc!==undefined&&(typeof _0x43a7bc!==_0x4f2523(0x15e)||_0x43a7bc[_0x4f2523(0x15c)]()===''))throw new Error(_0x4f2523(0x15d)+_0xcb2f6d+_0x4f2523(0x18d));}if(_0xdf1019[_0x4f2523(0x190)]!==undefined&&typeof _0xdf1019['visible']!=='boolean')throw new Error(_0x4f2523(0x15f));if(_0xdf1019[_0x4f2523(0x180)]!==undefined&&(!Number[_0x4f2523(0x191)](_0xdf1019['parentId'])||_0xdf1019[_0x4f2523(0x180)]<0x0))throw new Error(_0x4f2523(0x176));return{'jsUrl':typeof _0xdf1019[_0x4f2523(0x18a)]==='string'?_0xdf1019['jsUrl'][_0x4f2523(0x15c)]():undefined,'cssUrl':typeof _0xdf1019[_0x4f2523(0x158)]===_0x4f2523(0x15e)?_0xdf1019[_0x4f2523(0x158)][_0x4f2523(0x15c)]():undefined,'appName':typeof _0xdf1019['appName']===_0x4f2523(0x15e)?_0xdf1019['appName']['trim']():undefined,'visible':typeof _0xdf1019[_0x4f2523(0x190)]===_0x4f2523(0x165)?_0xdf1019[_0x4f2523(0x190)]:undefined,'parentId':typeof _0xdf1019[_0x4f2523(0x180)]===_0x4f2523(0x16f)?_0xdf1019[_0x4f2523(0x180)]:undefined};}
@@ -1 +1 @@
1
- (function(_0x32c25e,_0x182be4){const _0x32a136=a185_0x2fc1,_0x3d765f=_0x32c25e();while(!![]){try{const _0x1166c0=parseInt(_0x32a136(0x190))/0x1*(-parseInt(_0x32a136(0x175))/0x2)+-parseInt(_0x32a136(0x193))/0x3+-parseInt(_0x32a136(0x163))/0x4*(parseInt(_0x32a136(0x18e))/0x5)+-parseInt(_0x32a136(0x18a))/0x6*(-parseInt(_0x32a136(0x16c))/0x7)+-parseInt(_0x32a136(0x18d))/0x8+parseInt(_0x32a136(0x157))/0x9*(parseInt(_0x32a136(0x181))/0xa)+parseInt(_0x32a136(0x154))/0xb;if(_0x1166c0===_0x182be4)break;else _0x3d765f['push'](_0x3d765f['shift']());}catch(_0x1e1050){_0x3d765f['push'](_0x3d765f['shift']());}}}(a185_0x12a1,0x1e07c));import{updateMenuCdnUrl,getOnlineMenuList}from'../../../commands/menu/shared/service.js';function a185_0x12a1(){const _0x29d12f=['patch','filter','parse','push','value','length','menuIds','390840xqNmMB','\x20existing\x20JS\x20resources\x20for\x20\x22','rejected','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','endsWith','selection','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','Invalid\x20--mode:\x20','7dFHsQP','loadScriptMode','force','toLowerCase','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','.css','paths','extend','JS\x20URL\x20is\x20unreachable:\x20','21418HcUcKO','string','all','isArray','resources','jsUrl','Start\x20non-interactive\x20menu\x20asset\x20update','path','menu-asset-update','CSS\x20URL\x20is\x20unreachable:\x20','dryRun','setLogPath','10jKTJzF','message','label','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','trim','after','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','unshift','has','1036632uaRouT','some','info','20976gdDSIv','5ecKzmb','.js','1aQeisw','map','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','30216zpWJJi','--params.','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','606936ZHQjiH','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','split','145521DXOZVd','join','Menu\x20asset\x20update\x20completed','cssUrl','\x22\x20('];a185_0x12a1=function(){return _0x29d12f;};return a185_0x12a1();}import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';function validateParams(_0x3edbe5){const _0x1884f5=a185_0x2fc1,_0x3bb1b6=[];return _0x3edbe5['jsUrl']&&!isValidJsHttpsUrl(_0x3edbe5[_0x1884f5(0x17a)])&&_0x3bb1b6[_0x1884f5(0x15f)]({'field':_0x1884f5(0x17a),'message':_0x1884f5(0x155)}),_0x3edbe5['cssUrl']&&!isValidCssHttpsUrl(_0x3edbe5['cssUrl'])&&_0x3bb1b6['push']({'field':_0x1884f5(0x15a),'message':'CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'}),_0x3bb1b6;}export async function runMenuUpdateCore(_0x167b22,_0x3deeb4,_0x533b59,_0x34eed7={}){const _0x4233a8=a185_0x2fc1,_0x27cf73=parseUpdateParamsFlag(_0x533b59),_0x5ad0ff=normalizeMode(_0x34eed7['mode']);validateSelection(_0x34eed7[_0x4233a8(0x169)]);const _0x5eaffd=[];if(_0x27cf73[_0x4233a8(0x17a)])_0x5eaffd[_0x4233a8(0x15f)](_0x27cf73[_0x4233a8(0x17a)]);if(_0x27cf73[_0x4233a8(0x15a)])_0x5eaffd[_0x4233a8(0x15f)](_0x27cf73[_0x4233a8(0x15a)]);const _0x36a84d=validateParams(_0x27cf73);if(_0x36a84d[_0x4233a8(0x161)]>0x0){const _0x46ee8a=_0x36a84d[_0x4233a8(0x191)](_0x150b31=>_0x4233a8(0x194)+_0x150b31['field']+':\x20'+_0x150b31[_0x4233a8(0x182)])[_0x4233a8(0x158)](';\x20');throw new Error('Invalid\x20--params:\x20'+_0x46ee8a);}if(_0x5eaffd[_0x4233a8(0x161)]===0x0)throw new Error(_0x4233a8(0x166)+'Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.');logger[_0x4233a8(0x180)](process['cwd']()),logger[_0x4233a8(0x18c)](_0x4233a8(0x17d),_0x4233a8(0x17b),{'appCode':_0x167b22,'jsUrl':_0x27cf73['jsUrl'],'cssUrl':_0x27cf73['cssUrl'],'mode':_0x5ad0ff,'dryRun':_0x34eed7[_0x4233a8(0x17f)]===!![]});if(_0x27cf73[_0x4233a8(0x17a)]){const _0x42ba8b=await isUrlReachable(_0x27cf73[_0x4233a8(0x17a)]);if(!_0x42ba8b)throw new Error(_0x4233a8(0x174)+_0x27cf73[_0x4233a8(0x17a)]);}if(_0x27cf73[_0x4233a8(0x15a)]){const _0x435860=await isUrlReachable(_0x27cf73[_0x4233a8(0x15a)]);if(!_0x435860)throw new Error(_0x4233a8(0x17e)+_0x27cf73[_0x4233a8(0x15a)]);}const _0x16d135=await getOnlineMenuList(_0x167b22,_0x3deeb4),_0xc6bd83=_0x16d135[_0x4233a8(0x15d)](_0x502513=>_0x502513[_0x4233a8(0x179)][_0x4233a8(0x161)]>0x0),_0x36cd3d=selectMenusForUpdate(_0xc6bd83,_0x34eed7['selection']);if(_0x36cd3d[_0x4233a8(0x161)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x34eed7['dryRun']===!![]};const _0x564369=_0x36cd3d[_0x4233a8(0x191)](_0x53a192=>buildMenuUpdateDiff(_0x53a192,_0x27cf73,_0x5ad0ff,_0x34eed7[_0x4233a8(0x16e)]===!![],_0x34eed7[_0x4233a8(0x16d)]));if(_0x34eed7[_0x4233a8(0x17f)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x564369};const _0x472a72=await Promise['allSettled'](_0x36cd3d[_0x4233a8(0x191)]((_0x2097ef,_0x2741e8)=>updateMenuCdnUrl(_0x167b22,_0x3deeb4,{'id':_0x2097ef['id'],'label':_0x2097ef[_0x4233a8(0x183)],'path':_0x2097ef[_0x4233a8(0x17c)],'resources':_0x564369[_0x2741e8][_0x4233a8(0x186)][_0x4233a8(0x179)],'extend':_0x2097ef[_0x4233a8(0x173)]??null,'loadScriptMode':_0x34eed7['loadScriptMode']}))),_0x4704b3=_0x472a72[_0x4233a8(0x15d)](_0x4a79c2=>_0x4a79c2['status']==='fulfilled')[_0x4233a8(0x191)](_0x2a01d8=>_0x2a01d8[_0x4233a8(0x160)]),_0x1f46c4=_0x472a72[_0x4233a8(0x15d)](_0x3b39ad=>_0x3b39ad['status']===_0x4233a8(0x165))['length'];return logger[_0x4233a8(0x18c)](_0x4233a8(0x17d),_0x4233a8(0x159),{'count':_0x36cd3d['length'],'resources':_0x5eaffd}),{'updated':_0x4704b3[_0x4233a8(0x161)],'failed':_0x1f46c4,'skipped':![],'menus':_0x4704b3};}function validateSelection(_0x2a2652){const _0x60c7c7=a185_0x2fc1;if(!_0x2a2652)throw new Error(_0x60c7c7(0x170));if(_0x2a2652['all']&&(_0x2a2652['menuIds'][_0x60c7c7(0x161)]>0x0||_0x2a2652[_0x60c7c7(0x172)]['length']>0x0))throw new Error(_0x60c7c7(0x16a));if(!_0x2a2652['all']&&_0x2a2652[_0x60c7c7(0x162)][_0x60c7c7(0x161)]===0x0&&_0x2a2652[_0x60c7c7(0x172)][_0x60c7c7(0x161)]===0x0)throw new Error('menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');}export function selectMenusForUpdate(_0x5c2dd3,_0x2085af){const _0x5dd5d4=a185_0x2fc1;validateSelection(_0x2085af);if(_0x2085af[_0x5dd5d4(0x177)])return _0x5c2dd3;const _0x4e1417=new Set(_0x5c2dd3[_0x5dd5d4(0x191)](_0x5bf112=>_0x5bf112['id'])),_0x297ce8=new Set(_0x5c2dd3[_0x5dd5d4(0x191)](_0x5d0aca=>_0x5d0aca[_0x5dd5d4(0x17c)])),_0x5ca99c=_0x2085af['menuIds'][_0x5dd5d4(0x15d)](_0x54d8dd=>!_0x4e1417[_0x5dd5d4(0x189)](_0x54d8dd)),_0x4a0b58=_0x2085af[_0x5dd5d4(0x172)][_0x5dd5d4(0x15d)](_0x2ec15f=>!_0x297ce8['has'](_0x2ec15f));if(_0x5ca99c[_0x5dd5d4(0x161)]>0x0||_0x4a0b58[_0x5dd5d4(0x161)]>0x0){const _0x3af985=[..._0x5ca99c['map'](_0x3b002e=>String(_0x3b002e)),..._0x4a0b58][_0x5dd5d4(0x158)](',\x20');throw new Error(_0x5dd5d4(0x167)+_0x3af985);}const _0x2a7d66=new Set(_0x2085af['menuIds']),_0x251bb5=new Set(_0x2085af[_0x5dd5d4(0x172)]);return _0x5c2dd3['filter'](_0xc4e099=>_0x2a7d66[_0x5dd5d4(0x189)](_0xc4e099['id'])||_0x251bb5['has'](_0xc4e099['path']));}function normalizeMode(_0x36b919){const _0x47bb21=a185_0x2fc1;if(!_0x36b919)return _0x47bb21(0x15c);if(_0x36b919==='replace'||_0x36b919===_0x47bb21(0x15c))return _0x36b919;throw new Error(_0x47bb21(0x16b)+_0x36b919+'.\x20Allowed\x20values:\x20replace,\x20patch');}function buildMenuUpdateDiff(_0x2d0575,_0x163b1e,_0x1b2398,_0x47ed59,_0x3fe7ed){const _0xdd312e=a185_0x2fc1,_0x1a77ff=[..._0x2d0575[_0xdd312e(0x179)]];_0x1b2398==='patch'&&assertUnambiguousPatchResources(_0x2d0575,_0x1a77ff,_0x163b1e);const _0x7c5bf1=_0x1b2398===_0xdd312e(0x15c)?patchResources(_0x1a77ff,_0x163b1e):replaceResources(_0x163b1e),_0x1d7062=[],_0xc66a9f=_0x1a77ff[_0xdd312e(0x18b)](isJsResource),_0x34ed13=_0x7c5bf1[_0xdd312e(0x18b)](isJsResource);if(_0xc66a9f&&!_0x34ed13){const _0xde73d=_0xdd312e(0x184)+_0x2d0575['label']+_0xdd312e(0x15b)+_0x2d0575[_0xdd312e(0x17c)]+').\x20'+_0xdd312e(0x196);if(!_0x47ed59)throw new Error(_0xde73d);_0x1d7062[_0xdd312e(0x15f)](_0xde73d);}const _0x1d20ba=_0x1a77ff[_0xdd312e(0x18b)](isCssResource),_0x426cb7=_0x7c5bf1['some'](isCssResource);_0x1d20ba&&!_0x426cb7&&_0x1d7062['push'](_0xdd312e(0x195)+_0x2d0575['label']+_0xdd312e(0x15b)+_0x2d0575['path']+').');const _0x493a87=typeof _0x2d0575[_0xdd312e(0x173)]?.[_0xdd312e(0x16d)]===_0xdd312e(0x176)?_0x2d0575['extend'][_0xdd312e(0x16d)]:null,_0x956b2d=_0x3fe7ed?{'loadScriptMode':_0x493a87}:{},_0x5e4812=_0x3fe7ed?{'loadScriptMode':_0x3fe7ed}:{};return{'id':_0x2d0575['id'],'label':_0x2d0575[_0xdd312e(0x183)],'path':_0x2d0575[_0xdd312e(0x17c)],'mode':_0x1b2398,'before':{'resources':_0x1a77ff,..._0x956b2d},'after':{'resources':_0x7c5bf1,..._0x5e4812},'warnings':_0x1d7062};}function a185_0x2fc1(_0x541d06,_0x515cda){_0x541d06=_0x541d06-0x154;const _0x12a1d8=a185_0x12a1();let _0x2fc183=_0x12a1d8[_0x541d06];return _0x2fc183;}function replaceResources(_0x59ad73){const _0x469d50=a185_0x2fc1;return[_0x59ad73[_0x469d50(0x17a)],_0x59ad73[_0x469d50(0x15a)]][_0x469d50(0x15d)](_0x558651=>!!_0x558651);}function assertUnambiguousPatchResources(_0x27ca9b,_0x2574b3,_0x3ddd9e){const _0x162329=a185_0x2fc1,_0x4cbbd6=_0x2574b3[_0x162329(0x15d)](isJsResource)['length'];if(_0x3ddd9e['jsUrl']&&_0x4cbbd6>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x4cbbd6+_0x162329(0x164)+_0x27ca9b[_0x162329(0x183)]+_0x162329(0x15b)+_0x27ca9b[_0x162329(0x17c)]+')\x20'+_0x162329(0x192));const _0xd961ea=_0x2574b3[_0x162329(0x15d)](isCssResource)[_0x162329(0x161)];if(_0x3ddd9e[_0x162329(0x15a)]&&_0xd961ea>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0xd961ea+'\x20existing\x20CSS\x20resources\x20for\x20\x22'+_0x27ca9b[_0x162329(0x183)]+_0x162329(0x15b)+_0x27ca9b[_0x162329(0x17c)]+')\x20'+_0x162329(0x187));}function patchResources(_0x11d474,_0xb9e357){const _0x25ed64=a185_0x2fc1;let _0x1559fc=![],_0x3f07d6=![];const _0x9b323f=[];for(const _0x17ef4d of _0x11d474){if(isJsResource(_0x17ef4d)){if(_0xb9e357['jsUrl']&&!_0x1559fc)_0x9b323f['push'](_0xb9e357[_0x25ed64(0x17a)]),_0x1559fc=!![];else!_0xb9e357[_0x25ed64(0x17a)]&&_0x9b323f[_0x25ed64(0x15f)](_0x17ef4d);continue;}if(isCssResource(_0x17ef4d)){if(_0xb9e357[_0x25ed64(0x15a)]&&!_0x3f07d6)_0x9b323f[_0x25ed64(0x15f)](_0xb9e357[_0x25ed64(0x15a)]),_0x3f07d6=!![];else!_0xb9e357[_0x25ed64(0x15a)]&&_0x9b323f['push'](_0x17ef4d);continue;}_0x9b323f['push'](_0x17ef4d);}return _0xb9e357[_0x25ed64(0x17a)]&&!_0x1559fc&&_0x9b323f[_0x25ed64(0x188)](_0xb9e357[_0x25ed64(0x17a)]),_0xb9e357['cssUrl']&&!_0x3f07d6&&_0x9b323f[_0x25ed64(0x15f)](_0xb9e357[_0x25ed64(0x15a)]),_0x9b323f;}function isJsResource(_0x1d8293){const _0x13006e=a185_0x2fc1;return stripQuery(_0x1d8293)['toLowerCase']()[_0x13006e(0x168)](_0x13006e(0x18f));}function isCssResource(_0x150314){const _0x3c04f5=a185_0x2fc1;return stripQuery(_0x150314)[_0x3c04f5(0x16f)]()['endsWith'](_0x3c04f5(0x171));}function stripQuery(_0x5185f6){const _0x27ae58=a185_0x2fc1;return _0x5185f6[_0x27ae58(0x156)]('?')[0x0]??_0x5185f6;}function parseUpdateParamsFlag(_0x757bf1){const _0x21e725=a185_0x2fc1;if(!_0x757bf1||typeof _0x757bf1!==_0x21e725(0x176))return{};try{const _0x4c0986=JSON[_0x21e725(0x15e)](_0x757bf1);if(typeof _0x4c0986!=='object'||_0x4c0986===null||Array[_0x21e725(0x178)](_0x4c0986))return{};return{'jsUrl':typeof _0x4c0986['jsUrl']===_0x21e725(0x176)?_0x4c0986[_0x21e725(0x17a)][_0x21e725(0x185)]():undefined,'cssUrl':typeof _0x4c0986[_0x21e725(0x15a)]===_0x21e725(0x176)?_0x4c0986[_0x21e725(0x15a)][_0x21e725(0x185)]():undefined};}catch{return{};}}
1
+ (function(_0xe767b1,_0x4d86b0){const _0x1d8df5=a186_0x1c6d,_0x5a1f1e=_0xe767b1();while(!![]){try{const _0x476858=parseInt(_0x1d8df5(0x1b6))/0x1+-parseInt(_0x1d8df5(0x194))/0x2*(-parseInt(_0x1d8df5(0x1b4))/0x3)+-parseInt(_0x1d8df5(0x1b0))/0x4*(-parseInt(_0x1d8df5(0x1a9))/0x5)+-parseInt(_0x1d8df5(0x1ba))/0x6*(-parseInt(_0x1d8df5(0x1c3))/0x7)+parseInt(_0x1d8df5(0x1d7))/0x8*(-parseInt(_0x1d8df5(0x1ae))/0x9)+parseInt(_0x1d8df5(0x197))/0xa+parseInt(_0x1d8df5(0x1c6))/0xb*(-parseInt(_0x1d8df5(0x1d3))/0xc);if(_0x476858===_0x4d86b0)break;else _0x5a1f1e['push'](_0x5a1f1e['shift']());}catch(_0x27bac7){_0x5a1f1e['push'](_0x5a1f1e['shift']());}}}(a186_0x2366,0x9e993));import{updateMenuCdnUrl,getOnlineMenuList}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';function a186_0x2366(){const _0x52dff7=['343CnXRlZ','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','fulfilled','55blWenA','after','resources','message','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','object','Start\x20non-interactive\x20menu\x20asset\x20update','menu-asset-update','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','has','dryRun','join','3607248rWvUhI','jsUrl','info','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','24xQCned','rejected','field','\x22\x20(','isArray','loadScriptMode','push','38MFIYJb','.css','patch','3285500KxBFIc','value','cssUrl','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','mode','replace','trim','status','--params.','string','length','JS\x20URL\x20is\x20unreachable:\x20','Invalid\x20--params:\x20','endsWith','\x20existing\x20JS\x20resources\x20for\x20\x22','map','filter','paths','5wsoDZl','allSettled','path','some','menuIds','2680146ErphxP','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','4825468latyFx','unshift','split','setLogPath','15756nhjEdD','menu\x20asset-update\x20cannot\x20patch\x20','666565tewFyO','\x20existing\x20CSS\x20resources\x20for\x20\x22','extend','label','91194cLZMZQ','cwd','selection','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.','toLowerCase','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','Invalid\x20--mode:\x20','all'];a186_0x2366=function(){return _0x52dff7;};return a186_0x2366();}import{logger}from'../../../utils/logger.js';function validateParams(_0x1a8182){const _0x5241a4=a186_0x1c6d,_0x5d22d5=[];return _0x1a8182[_0x5241a4(0x1d4)]&&!isValidJsHttpsUrl(_0x1a8182['jsUrl'])&&_0x5d22d5[_0x5241a4(0x193)]({'field':_0x5241a4(0x1d4),'message':_0x5241a4(0x1cb)}),_0x1a8182[_0x5241a4(0x199)]&&!isValidCssHttpsUrl(_0x1a8182[_0x5241a4(0x199)])&&_0x5d22d5['push']({'field':'cssUrl','message':'CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'}),_0x5d22d5;}export async function runMenuUpdateCore(_0x1947f6,_0xad0e8b,_0x32084d,_0x42b06d={}){const _0x62d309=a186_0x1c6d,_0x19c75c=parseUpdateParamsFlag(_0x32084d),_0x10f60a=normalizeMode(_0x42b06d[_0x62d309(0x19b)]);validateSelection(_0x42b06d[_0x62d309(0x1bc)]);const _0x45c37b=[];if(_0x19c75c[_0x62d309(0x1d4)])_0x45c37b[_0x62d309(0x193)](_0x19c75c[_0x62d309(0x1d4)]);if(_0x19c75c['cssUrl'])_0x45c37b[_0x62d309(0x193)](_0x19c75c[_0x62d309(0x199)]);const _0x78926a=validateParams(_0x19c75c);if(_0x78926a['length']>0x0){const _0x14a365=_0x78926a['map'](_0x2d73b5=>_0x62d309(0x19f)+_0x2d73b5[_0x62d309(0x18f)]+':\x20'+_0x2d73b5[_0x62d309(0x1c9)])['join'](';\x20');throw new Error(_0x62d309(0x1a3)+_0x14a365);}if(_0x45c37b['length']===0x0)throw new Error(_0x62d309(0x1c4)+_0x62d309(0x1c0));logger[_0x62d309(0x1b3)](process[_0x62d309(0x1bb)]()),logger[_0x62d309(0x1d5)]('menu-asset-update',_0x62d309(0x1cd),{'appCode':_0x1947f6,'jsUrl':_0x19c75c[_0x62d309(0x1d4)],'cssUrl':_0x19c75c['cssUrl'],'mode':_0x10f60a,'dryRun':_0x42b06d[_0x62d309(0x1d1)]===!![]});if(_0x19c75c[_0x62d309(0x1d4)]){const _0x5f15bb=await isUrlReachable(_0x19c75c[_0x62d309(0x1d4)]);if(!_0x5f15bb)throw new Error(_0x62d309(0x1a2)+_0x19c75c[_0x62d309(0x1d4)]);}if(_0x19c75c['cssUrl']){const _0x306136=await isUrlReachable(_0x19c75c['cssUrl']);if(!_0x306136)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x19c75c[_0x62d309(0x199)]);}const _0x3d544d=await getOnlineMenuList(_0x1947f6,_0xad0e8b),_0x149370=_0x3d544d[_0x62d309(0x1a7)](_0x58569a=>_0x58569a['resources'][_0x62d309(0x1a1)]>0x0),_0x4a67df=selectMenusForUpdate(_0x149370,_0x42b06d[_0x62d309(0x1bc)]);if(_0x4a67df[_0x62d309(0x1a1)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x42b06d['dryRun']===!![]};const _0x2779f1=_0x4a67df['map'](_0x189ed3=>buildMenuUpdateDiff(_0x189ed3,_0x19c75c,_0x10f60a,_0x42b06d['force']===!![],_0x42b06d[_0x62d309(0x192)]));if(_0x42b06d[_0x62d309(0x1d1)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x2779f1};const _0x4a09e4=await Promise[_0x62d309(0x1aa)](_0x4a67df['map']((_0x36205c,_0x1a9cb5)=>updateMenuCdnUrl(_0x1947f6,_0xad0e8b,{'id':_0x36205c['id'],'label':_0x36205c['label'],'path':_0x36205c[_0x62d309(0x1ab)],'resources':_0x2779f1[_0x1a9cb5][_0x62d309(0x1c7)][_0x62d309(0x1c8)],'extend':_0x36205c[_0x62d309(0x1b8)]??null,'loadScriptMode':_0x42b06d[_0x62d309(0x192)]}))),_0x111225=_0x4a09e4[_0x62d309(0x1a7)](_0x1ed6dc=>_0x1ed6dc[_0x62d309(0x19e)]===_0x62d309(0x1c5))[_0x62d309(0x1a6)](_0x4f460e=>_0x4f460e[_0x62d309(0x198)]),_0x5320ff=_0x4a09e4[_0x62d309(0x1a7)](_0x12761c=>_0x12761c[_0x62d309(0x19e)]===_0x62d309(0x1d8))[_0x62d309(0x1a1)];return logger[_0x62d309(0x1d5)](_0x62d309(0x1ce),'Menu\x20asset\x20update\x20completed',{'count':_0x4a67df[_0x62d309(0x1a1)],'resources':_0x45c37b}),{'updated':_0x111225[_0x62d309(0x1a1)],'failed':_0x5320ff,'skipped':![],'menus':_0x111225};}function validateSelection(_0x751622){const _0x40701b=a186_0x1c6d;if(!_0x751622)throw new Error(_0x40701b(0x1af));if(_0x751622[_0x40701b(0x1c2)]&&(_0x751622[_0x40701b(0x1ad)][_0x40701b(0x1a1)]>0x0||_0x751622['paths'][_0x40701b(0x1a1)]>0x0))throw new Error(_0x40701b(0x1d6));if(!_0x751622[_0x40701b(0x1c2)]&&_0x751622[_0x40701b(0x1ad)]['length']===0x0&&_0x751622[_0x40701b(0x1a8)][_0x40701b(0x1a1)]===0x0)throw new Error(_0x40701b(0x1af));}export function selectMenusForUpdate(_0x2d102a,_0x80814d){const _0x4fe534=a186_0x1c6d;validateSelection(_0x80814d);if(_0x80814d['all'])return _0x2d102a;const _0x1159c0=new Set(_0x2d102a[_0x4fe534(0x1a6)](_0x59dfde=>_0x59dfde['id'])),_0x7a4330=new Set(_0x2d102a[_0x4fe534(0x1a6)](_0x418f69=>_0x418f69[_0x4fe534(0x1ab)])),_0x57d5af=_0x80814d[_0x4fe534(0x1ad)][_0x4fe534(0x1a7)](_0x4103a8=>!_0x1159c0[_0x4fe534(0x1d0)](_0x4103a8)),_0x4fccd1=_0x80814d[_0x4fe534(0x1a8)][_0x4fe534(0x1a7)](_0x486d63=>!_0x7a4330[_0x4fe534(0x1d0)](_0x486d63));if(_0x57d5af[_0x4fe534(0x1a1)]>0x0||_0x4fccd1[_0x4fe534(0x1a1)]>0x0){const _0x6e2908=[..._0x57d5af[_0x4fe534(0x1a6)](_0x5716ad=>String(_0x5716ad)),..._0x4fccd1][_0x4fe534(0x1d2)](',\x20');throw new Error('menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20'+_0x6e2908);}const _0xb7edc3=new Set(_0x80814d[_0x4fe534(0x1ad)]),_0x1b6028=new Set(_0x80814d[_0x4fe534(0x1a8)]);return _0x2d102a[_0x4fe534(0x1a7)](_0x65ffbc=>_0xb7edc3[_0x4fe534(0x1d0)](_0x65ffbc['id'])||_0x1b6028[_0x4fe534(0x1d0)](_0x65ffbc[_0x4fe534(0x1ab)]));}function normalizeMode(_0x4f20ae){const _0x537446=a186_0x1c6d;if(!_0x4f20ae)return _0x537446(0x196);if(_0x4f20ae===_0x537446(0x19c)||_0x4f20ae===_0x537446(0x196))return _0x4f20ae;throw new Error(_0x537446(0x1c1)+_0x4f20ae+'.\x20Allowed\x20values:\x20replace,\x20patch');}function buildMenuUpdateDiff(_0xf3ded8,_0x2e9ae4,_0x385d50,_0x3fde2b,_0x139108){const _0x2be76c=a186_0x1c6d,_0x304897=[..._0xf3ded8[_0x2be76c(0x1c8)]];_0x385d50==='patch'&&assertUnambiguousPatchResources(_0xf3ded8,_0x304897,_0x2e9ae4);const _0x366a33=_0x385d50===_0x2be76c(0x196)?patchResources(_0x304897,_0x2e9ae4):replaceResources(_0x2e9ae4),_0x3e0245=[],_0x2fb37f=_0x304897['some'](isJsResource),_0x35e27e=_0x366a33[_0x2be76c(0x1ac)](isJsResource);if(_0x2fb37f&&!_0x35e27e){const _0x3dfd64=_0x2be76c(0x1cf)+_0xf3ded8[_0x2be76c(0x1b9)]+_0x2be76c(0x190)+_0xf3ded8[_0x2be76c(0x1ab)]+').\x20'+_0x2be76c(0x1bd);if(!_0x3fde2b)throw new Error(_0x3dfd64);_0x3e0245['push'](_0x3dfd64);}const _0xd978a8=_0x304897[_0x2be76c(0x1ac)](isCssResource),_0x4a04d8=_0x366a33['some'](isCssResource);_0xd978a8&&!_0x4a04d8&&_0x3e0245[_0x2be76c(0x193)](_0x2be76c(0x19a)+_0xf3ded8[_0x2be76c(0x1b9)]+_0x2be76c(0x190)+_0xf3ded8['path']+').');const _0x153c25=typeof _0xf3ded8[_0x2be76c(0x1b8)]?.[_0x2be76c(0x192)]===_0x2be76c(0x1a0)?_0xf3ded8[_0x2be76c(0x1b8)]['loadScriptMode']:null,_0x123a95=_0x139108?{'loadScriptMode':_0x153c25}:{},_0x211f43=_0x139108?{'loadScriptMode':_0x139108}:{};return{'id':_0xf3ded8['id'],'label':_0xf3ded8['label'],'path':_0xf3ded8[_0x2be76c(0x1ab)],'mode':_0x385d50,'before':{'resources':_0x304897,..._0x123a95},'after':{'resources':_0x366a33,..._0x211f43},'warnings':_0x3e0245};}function replaceResources(_0x48729f){const _0xb5986c=a186_0x1c6d;return[_0x48729f[_0xb5986c(0x1d4)],_0x48729f[_0xb5986c(0x199)]][_0xb5986c(0x1a7)](_0x18f177=>!!_0x18f177);}function assertUnambiguousPatchResources(_0x5120b9,_0x30ff39,_0x513500){const _0x2171ec=a186_0x1c6d,_0x54d132=_0x30ff39[_0x2171ec(0x1a7)](isJsResource)[_0x2171ec(0x1a1)];if(_0x513500[_0x2171ec(0x1d4)]&&_0x54d132>0x1)throw new Error(_0x2171ec(0x1b5)+_0x54d132+_0x2171ec(0x1a5)+_0x5120b9[_0x2171ec(0x1b9)]+_0x2171ec(0x190)+_0x5120b9[_0x2171ec(0x1ab)]+')\x20'+_0x2171ec(0x1ca));const _0xb481a9=_0x30ff39[_0x2171ec(0x1a7)](isCssResource)[_0x2171ec(0x1a1)];if(_0x513500[_0x2171ec(0x199)]&&_0xb481a9>0x1)throw new Error(_0x2171ec(0x1b5)+_0xb481a9+_0x2171ec(0x1b7)+_0x5120b9[_0x2171ec(0x1b9)]+_0x2171ec(0x190)+_0x5120b9[_0x2171ec(0x1ab)]+')\x20'+_0x2171ec(0x1be));}function patchResources(_0x1c9be5,_0x41f9d4){const _0xa92581=a186_0x1c6d;let _0x3913fe=![],_0x45bd54=![];const _0x4915c8=[];for(const _0x40ddea of _0x1c9be5){if(isJsResource(_0x40ddea)){if(_0x41f9d4[_0xa92581(0x1d4)]&&!_0x3913fe)_0x4915c8[_0xa92581(0x193)](_0x41f9d4[_0xa92581(0x1d4)]),_0x3913fe=!![];else!_0x41f9d4['jsUrl']&&_0x4915c8['push'](_0x40ddea);continue;}if(isCssResource(_0x40ddea)){if(_0x41f9d4[_0xa92581(0x199)]&&!_0x45bd54)_0x4915c8['push'](_0x41f9d4['cssUrl']),_0x45bd54=!![];else!_0x41f9d4['cssUrl']&&_0x4915c8[_0xa92581(0x193)](_0x40ddea);continue;}_0x4915c8[_0xa92581(0x193)](_0x40ddea);}return _0x41f9d4['jsUrl']&&!_0x3913fe&&_0x4915c8[_0xa92581(0x1b1)](_0x41f9d4[_0xa92581(0x1d4)]),_0x41f9d4['cssUrl']&&!_0x45bd54&&_0x4915c8['push'](_0x41f9d4[_0xa92581(0x199)]),_0x4915c8;}function isJsResource(_0x20626f){const _0x2efee7=a186_0x1c6d;return stripQuery(_0x20626f)[_0x2efee7(0x1bf)]()[_0x2efee7(0x1a4)]('.js');}function a186_0x1c6d(_0xe0d9cd,_0x2e7117){_0xe0d9cd=_0xe0d9cd-0x18f;const _0x23669b=a186_0x2366();let _0x1c6d1a=_0x23669b[_0xe0d9cd];return _0x1c6d1a;}function isCssResource(_0x302082){const _0x568ba5=a186_0x1c6d;return stripQuery(_0x302082)[_0x568ba5(0x1bf)]()[_0x568ba5(0x1a4)](_0x568ba5(0x195));}function stripQuery(_0x439438){const _0x20e35a=a186_0x1c6d;return _0x439438[_0x20e35a(0x1b2)]('?')[0x0]??_0x439438;}function parseUpdateParamsFlag(_0x174dd9){const _0xc70072=a186_0x1c6d;if(!_0x174dd9||typeof _0x174dd9!==_0xc70072(0x1a0))return{};try{const _0x515bcb=JSON['parse'](_0x174dd9);if(typeof _0x515bcb!==_0xc70072(0x1cc)||_0x515bcb===null||Array[_0xc70072(0x191)](_0x515bcb))return{};return{'jsUrl':typeof _0x515bcb[_0xc70072(0x1d4)]===_0xc70072(0x1a0)?_0x515bcb[_0xc70072(0x1d4)][_0xc70072(0x19d)]():undefined,'cssUrl':typeof _0x515bcb['cssUrl']===_0xc70072(0x1a0)?_0x515bcb['cssUrl'][_0xc70072(0x19d)]():undefined};}catch{return{};}}
@@ -1 +1 @@
1
- (function(_0xbbe8ee,_0x3c7f37){const _0x54d557=a186_0x21ff,_0x3fc79a=_0xbbe8ee();while(!![]){try{const _0x520298=parseInt(_0x54d557(0x1c3))/0x1*(-parseInt(_0x54d557(0x1cb))/0x2)+-parseInt(_0x54d557(0x1c8))/0x3*(parseInt(_0x54d557(0x1c0))/0x4)+-parseInt(_0x54d557(0x1c7))/0x5+parseInt(_0x54d557(0x1c5))/0x6+-parseInt(_0x54d557(0x1bd))/0x7+parseInt(_0x54d557(0x1bc))/0x8+parseInt(_0x54d557(0x1c9))/0x9*(parseInt(_0x54d557(0x1be))/0xa);if(_0x520298===_0x3c7f37)break;else _0x3fc79a['push'](_0x3fc79a['shift']());}catch(_0x2d0673){_0x3fc79a['push'](_0x3fc79a['shift']());}}}(a186_0xa704,0x36ad5));export function isValidJsHttpsUrl(_0x29744b){const _0xbff1b6=a186_0x21ff;return/^https:\/\/.+\.js(\?.*)?$/[_0xbff1b6(0x1ca)](_0x29744b[_0xbff1b6(0x1c6)]());}function a186_0x21ff(_0x187d45,_0x574251){_0x187d45=_0x187d45-0x1bc;const _0xa70420=a186_0xa704();let _0x21ff65=_0xa70420[_0x187d45];return _0x21ff65;}export function isValidCssHttpsUrl(_0x149b6c){const _0x3a0fd0=a186_0x21ff;return/^https:\/\/.+\.css(\?.*)?$/[_0x3a0fd0(0x1ca)](_0x149b6c[_0x3a0fd0(0x1c6)]());}function a186_0xa704(){const _0x1847b6=['1qeEvyT','GET','2376480tPvJRc','trim','1553295tZKLxX','172845gWVICp','9792abqYsr','test','448754SSSHtJ','1872944VuZghN','2579633ijzNVp','5630ttwmTn','body','8kBLlpY','bytes=0-0','HEAD'];a186_0xa704=function(){return _0x1847b6;};return a186_0xa704();}export async function isUrlReachable(_0x566c30){const _0xeec7d7=a186_0x21ff;try{const _0x2e4603=await fetch(_0x566c30,{'method':_0xeec7d7(0x1c2)});if(_0x2e4603['ok'])return!![];}catch{}try{const _0x3bcaa9=await fetch(_0x566c30,{'method':_0xeec7d7(0x1c4),'headers':{'Range':_0xeec7d7(0x1c1)}}),_0x449be6=_0x3bcaa9['ok'];try{await _0x3bcaa9[_0xeec7d7(0x1bf)]?.['cancel']();}catch{}return _0x449be6;}catch{return![];}}
1
+ function a187_0x9205(){const _0x2cb8ad=['bytes=0-0','1317661OBElPi','test','237976yWTenV','HEAD','6crxglP','504nNifui','27126RqfyhV','cancel','GET','693080IZPlTa','2150355GmwnUY','823623QSPBDG','1007718MLmwIi','70IPrPTJ','4nIlLUW','11184KjnECG','trim'];a187_0x9205=function(){return _0x2cb8ad;};return a187_0x9205();}(function(_0x4b2ff9,_0x59fc20){const _0x17d25c=a187_0x3ccb,_0x50293f=_0x4b2ff9();while(!![]){try{const _0x28070c=-parseInt(_0x17d25c(0x148))/0x1+parseInt(_0x17d25c(0x14c))/0x2*(parseInt(_0x17d25c(0x141))/0x3)+parseInt(_0x17d25c(0x144))/0x4*(parseInt(_0x17d25c(0x140))/0x5)+-parseInt(_0x17d25c(0x142))/0x6*(-parseInt(_0x17d25c(0x143))/0x7)+-parseInt(_0x17d25c(0x14a))/0x8*(-parseInt(_0x17d25c(0x14d))/0x9)+-parseInt(_0x17d25c(0x151))/0xa+-parseInt(_0x17d25c(0x14e))/0xb*(parseInt(_0x17d25c(0x145))/0xc);if(_0x28070c===_0x59fc20)break;else _0x50293f['push'](_0x50293f['shift']());}catch(_0xcd562d){_0x50293f['push'](_0x50293f['shift']());}}}(a187_0x9205,0xdf16f));function a187_0x3ccb(_0x445a05,_0x57807f){_0x445a05=_0x445a05-0x140;const _0x920580=a187_0x9205();let _0x3ccb1b=_0x920580[_0x445a05];return _0x3ccb1b;}export function isValidJsHttpsUrl(_0x13f455){const _0x86c0a1=a187_0x3ccb;return/^https:\/\/.+\.js(\?.*)?$/['test'](_0x13f455[_0x86c0a1(0x146)]());}export function isValidCssHttpsUrl(_0x41e4fb){const _0x2a0cea=a187_0x3ccb;return/^https:\/\/.+\.css(\?.*)?$/[_0x2a0cea(0x149)](_0x41e4fb['trim']());}export async function isUrlReachable(_0x268d97){const _0x2d650e=a187_0x3ccb;try{const _0x449535=await fetch(_0x268d97,{'method':_0x2d650e(0x14b)});if(_0x449535['ok'])return!![];}catch{}try{const _0x3541ef=await fetch(_0x268d97,{'method':_0x2d650e(0x150),'headers':{'Range':_0x2d650e(0x147)}}),_0x52cd1f=_0x3541ef['ok'];try{await _0x3541ef['body']?.[_0x2d650e(0x14f)]();}catch{}return _0x52cd1f;}catch{return![];}}
@@ -1 +1 @@
1
- const a187_0x5e8f7c=a187_0x2720;(function(_0xc48e9a,_0x360050){const _0x319124=a187_0x2720,_0x239d0f=_0xc48e9a();while(!![]){try{const _0x40a018=-parseInt(_0x319124(0x1b0))/0x1*(parseInt(_0x319124(0x1af))/0x2)+-parseInt(_0x319124(0x1b8))/0x3+parseInt(_0x319124(0x1b2))/0x4*(-parseInt(_0x319124(0x1ad))/0x5)+-parseInt(_0x319124(0x1b1))/0x6*(parseInt(_0x319124(0x1ac))/0x7)+parseInt(_0x319124(0x1bb))/0x8+-parseInt(_0x319124(0x1ae))/0x9*(parseInt(_0x319124(0x1b5))/0xa)+parseInt(_0x319124(0x1b7))/0xb*(parseInt(_0x319124(0x1ab))/0xc);if(_0x40a018===_0x360050)break;else _0x239d0f['push'](_0x239d0f['shift']());}catch(_0x51d8c8){_0x239d0f['push'](_0x239d0f['shift']());}}}(a187_0x2efd,0x824e5));function a187_0x2efd(){const _0x3edc8f=['866499rGTljs','Inspect\x20shared\x20frontend\x20subapp\x20resources\x20and\x20menu\x20fallbacks\x20in\x20the\x20selected\x20menu\x20host','Inspected\x20','1227952mDGDfE','\x20in\x20menu\x20host\x20','boundMenus','13164cHXTpw','147XBHeRq','25mERChE','1341KuTcAG','34SLjVjE','34225VNnwiM','282708OMGuKw','766092PGjxgS','subapp-assets-status','cookie','20010oPXJlP','all','35057OeEGhh'];a187_0x2efd=function(){return _0x3edc8f;};return a187_0x2efd();}function a187_0x2720(_0x1197b0,_0x4fd26e){_0x1197b0=_0x1197b0-0x1ab;const _0x2efd5a=a187_0x2efd();let _0x27209c=_0x2efd5a[_0x1197b0];return _0x27209c;}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':a187_0x5e8f7c(0x1b3),'description':a187_0x5e8f7c(0x1b9),'risk':'read','strictFlags':!![],'flags':SUBAPP_ASSET_SELECTOR_FLAGS,async 'validate'(_0xf09f1e){getSubappSelector(_0xf09f1e);},async 'execute'(_0x16e7a4){const _0x384c43=a187_0x5e8f7c,{appCode:_0x4e4915,appName:_0x41618b}=getSubappSelector(_0x16e7a4),[_0x382884,_0x50b344]=await Promise[_0x384c43(0x1b6)]([getSmartAppRecord(_0x4e4915,_0x16e7a4[_0x384c43(0x1b4)]),getOnlineMenuList(_0x4e4915,_0x16e7a4[_0x384c43(0x1b4)])]),_0x1b18a6={'appCode':_0x4e4915,...buildSubappAssetsStatus(_0x382884,_0x50b344,_0x41618b)};return{'ok':!![],'data':_0x1b18a6,'message':_0x384c43(0x1ba)+_0x1b18a6[_0x384c43(0x1bd)]+'\x20menu(s)\x20for\x20'+_0x41618b+_0x384c43(0x1bc)+_0x4e4915+'.'};}};
1
+ const a188_0x4e1a04=a188_0x3e51;function a188_0x5731(){const _0x5222f6=['79486ZgvouC','6OepGla','read','10uawlDa','1625876QwXkZL','2iutdgz','2025135OVPzaG','1171970UdvkhO','\x20menu(s)\x20for\x20','26288VVELag','68GraFoY','172517xifZpC','all','cookie','9231fvzrJi','Inspect\x20shared\x20frontend\x20subapp\x20resources\x20and\x20menu\x20fallbacks\x20in\x20the\x20selected\x20menu\x20host','menu','boundMenus'];a188_0x5731=function(){return _0x5222f6;};return a188_0x5731();}(function(_0x3a347f,_0x474ab7){const _0x458635=a188_0x3e51,_0x502c23=_0x3a347f();while(!![]){try{const _0x43f2a7=parseInt(_0x458635(0x1a6))/0x1*(-parseInt(_0x458635(0x1a0))/0x2)+parseInt(_0x458635(0x1a9))/0x3*(parseInt(_0x458635(0x1a5))/0x4)+parseInt(_0x458635(0x1a2))/0x5+-parseInt(_0x458635(0x19c))/0x6*(-parseInt(_0x458635(0x19f))/0x7)+parseInt(_0x458635(0x1a4))/0x8+-parseInt(_0x458635(0x1a1))/0x9+parseInt(_0x458635(0x19e))/0xa*(parseInt(_0x458635(0x19b))/0xb);if(_0x43f2a7===_0x474ab7)break;else _0x502c23['push'](_0x502c23['shift']());}catch(_0x37f328){_0x502c23['push'](_0x502c23['shift']());}}}(a188_0x5731,0x2036f));function a188_0x3e51(_0x7b73c4,_0x1f367c){_0x7b73c4=_0x7b73c4-0x19b;const _0x57315e=a188_0x5731();let _0x3e511c=_0x57315e[_0x7b73c4];return _0x3e511c;}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':a188_0x4e1a04(0x1ab),'command':'subapp-assets-status','description':a188_0x4e1a04(0x1aa),'risk':a188_0x4e1a04(0x19d),'strictFlags':!![],'flags':SUBAPP_ASSET_SELECTOR_FLAGS,async 'validate'(_0x1458b9){getSubappSelector(_0x1458b9);},async 'execute'(_0x1720e7){const _0x2521fc=a188_0x4e1a04,{appCode:_0x231e19,appName:_0x28a022}=getSubappSelector(_0x1720e7),[_0x2777c8,_0x4897e9]=await Promise[_0x2521fc(0x1a7)]([getSmartAppRecord(_0x231e19,_0x1720e7[_0x2521fc(0x1a8)]),getOnlineMenuList(_0x231e19,_0x1720e7[_0x2521fc(0x1a8)])]),_0x14b319={'appCode':_0x231e19,...buildSubappAssetsStatus(_0x2777c8,_0x4897e9,_0x28a022)};return{'ok':!![],'data':_0x14b319,'message':'Inspected\x20'+_0x14b319[_0x2521fc(0x1ac)]+_0x2521fc(0x1a3)+_0x28a022+'\x20in\x20menu\x20host\x20'+_0x231e19+'.'};}};
@@ -1 +1 @@
1
- function a188_0x36c5(_0x1eeef0,_0x42a529){_0x1eeef0=_0x1eeef0-0x9c;const _0x179f20=a188_0x179f();let _0x36c5a1=_0x179f20[_0x1eeef0];return _0x36c5a1;}const a188_0x28fd08=a188_0x36c5;(function(_0x2689c5,_0x285a02){const _0x4c2c2f=a188_0x36c5,_0x3f7af2=_0x2689c5();while(!![]){try{const _0x5b4735=-parseInt(_0x4c2c2f(0xad))/0x1+parseInt(_0x4c2c2f(0xbe))/0x2+parseInt(_0x4c2c2f(0xa7))/0x3+parseInt(_0x4c2c2f(0xa5))/0x4+parseInt(_0x4c2c2f(0xba))/0x5*(-parseInt(_0x4c2c2f(0xda))/0x6)+parseInt(_0x4c2c2f(0xb4))/0x7+parseInt(_0x4c2c2f(0xe7))/0x8;if(_0x5b4735===_0x285a02)break;else _0x3f7af2['push'](_0x3f7af2['shift']());}catch(_0x455646){_0x3f7af2['push'](_0x3f7af2['shift']());}}}(a188_0x179f,0x53d0a));import{createHash}from'node:crypto';import{isDeepStrictEqual}from'node:util';import{getSmartAppRecord,updateSmartAppRecord}from'../../core/api-client.js';function a188_0x179f(){const _0x515753=['verified\x20app.extend','apiError','Unknown\x20app.extend\x20fields:\x20','str','expectedHash','Updated\x20shared\x20resources\x20for\x20','Expected\x20exactly\x20one\x20existing\x20subapp\x20entry\x20for\x20','app.extend.assets\x20must\x20be\x20a\x20JSON\x20string;\x20refusing\x20update.','filter','test','1825260Ralqyb','some','1190733OeZZiH','stringify','extend','enableAutoSync','\x20must\x20be\x20a\x20JSON\x20array.','protocol','598214NERAjO','validation','map','Update\x20one\x20frontend\x20subapp\x20resource\x20URL\x20set\x20in\x20the\x20selected\x20menu\x20host','sha256','Shared\x20assets\x20already\x20match\x20the\x20requested\x20URLs.','update','2096087cUswuJ',']\x20must\x20be\x20an\x20absolute\x20HTTPS\x20URL.','app.extend','resources','Existing\x20subapp.resources\x20must\x20be\x20a\x20JSON\x20string.','subapp-assets-update','955615KcUqkW','join','size','enableSample','715288gkahiO','POST','appName','Preview\x20fingerprint\x20binding\x20the\x20host,\x20subapp,\x20resource\x20URLs\x20and\x20current\x20config;\x20required\x20for\x20writes','directDbEnabled','has','before','isArray','unchanged','App\x20ID\x20or\x20publish\x20status\x20is\x20missing;\x20refusing\x20a\x20generic\x20app\x20update.','tenantColumn','parse','--expected-hash\x20from\x20a\x20dry-run\x20is\x20required.','App\x20assets\x20or\x20update\x20target\x20changed\x20since\x20preview;\x20the\x20fingerprint\x20does\x20not\x20match.\x20Run\x20a\x20new\x20dry-run.','https:','--resources\x20is\x20required.',';\x20independent\x20deployment\x20not\x20verified.','Existing\x20subapp.resources\x20contains\x20invalid\x20JSON.','app.extend.assets','accessKey','expected-hash','not\x20HTTPS','write','skinColor','length','directDbId','cookie','\x20contains\x20invalid\x20JSON.','18JHkrNQ','isSafeInteger','entries','appPublishStatus',']\x20must\x20be\x20a\x20URL\x20string.','string','Management\x20app\x20assets\x20already\x20match;\x20independent\x20deployment\x20not\x20verified.','digest','At\x20least\x20one\x20resource\x20URL\x20is\x20required.','--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.','trim','appCode','assets','36624mueoiv','Resources\x20need\x20one\x20JS\x20entry\x20and\x20no\x20duplicate\x20URLs.','resources['];a188_0x179f=function(){return _0x515753;};return a188_0x179f();}import{CliErrors}from'../../errors.js';import{getSubappSelector,SUBAPP_ASSET_SELECTOR_FLAGS}from'../../commands/menu/shared/subapp-assets.js';const KNOWN_EXTEND_KEYS=new Set([a188_0x28fd08(0xd5),'enableOpenApi',a188_0x28fd08(0xd1),a188_0x28fd08(0xe6),a188_0x28fd08(0xc8),a188_0x28fd08(0xbd),'vipDeploy',a188_0x28fd08(0xaa),a188_0x28fd08(0xd7),a188_0x28fd08(0xc2)]);function parseObject(_0x3fcb47,_0x191a40){const _0x15881d=a188_0x28fd08;let _0x2c1776=_0x3fcb47;if(typeof _0x3fcb47==='string')try{_0x2c1776=JSON['parse'](_0x3fcb47);}catch{throw CliErrors['validation'](_0x191a40+_0x15881d(0xd9));}if(!_0x2c1776||typeof _0x2c1776!=='object'||Array[_0x15881d(0xc5)](_0x2c1776))throw CliErrors[_0x15881d(0xae)](_0x191a40+'\x20must\x20be\x20a\x20JSON\x20object.');return _0x2c1776;}function parseArray(_0x40fa52,_0x47601d){const _0x383b93=a188_0x28fd08;let _0x37dd82;try{_0x37dd82=JSON[_0x383b93(0xc9)](_0x40fa52);}catch{throw CliErrors[_0x383b93(0xae)](_0x47601d+_0x383b93(0xd9));}if(!Array[_0x383b93(0xc5)](_0x37dd82))throw CliErrors[_0x383b93(0xae)](_0x47601d+_0x383b93(0xab));return _0x37dd82[_0x383b93(0xaf)]((_0x99791f,_0xbd61c0)=>parseObject(_0x99791f,_0x47601d+'['+_0xbd61c0+']'));}function validateResources(_0x1aa170){const _0x27cec4=a188_0x28fd08;if(_0x1aa170[_0x27cec4(0xd6)]===0x0)throw CliErrors[_0x27cec4(0xae)](_0x27cec4(0xe2));for(const [_0x21e0da,_0x4130d9]of _0x1aa170[_0x27cec4(0xdc)]()){if(typeof _0x4130d9!==_0x27cec4(0xdf))throw CliErrors[_0x27cec4(0xae)](_0x27cec4(0xe9)+_0x21e0da+_0x27cec4(0xde));try{if(new URL(_0x4130d9)[_0x27cec4(0xac)]!==_0x27cec4(0xcc))throw new Error(_0x27cec4(0xd3));}catch{throw CliErrors[_0x27cec4(0xae)](_0x27cec4(0xe9)+_0x21e0da+_0x27cec4(0xb5));}}if(new Set(_0x1aa170)[_0x27cec4(0xbc)]!==_0x1aa170['length']||!_0x1aa170[_0x27cec4(0xa6)](_0x52ebcf=>/\.m?js(?:[?#]|$)/i['test'](_0x52ebcf)))throw CliErrors[_0x27cec4(0xae)](_0x27cec4(0xe8));return _0x1aa170;}function prepare(_0x18321c,_0x3b7bb8,_0x2dc28c){const _0x2cf90d=a188_0x28fd08;if(!Number[_0x2cf90d(0xdb)](_0x18321c['id'])||(_0x18321c['id']??0x0)<=0x0||typeof _0x18321c[_0x2cf90d(0xdd)]!=='string'||!_0x18321c[_0x2cf90d(0xdd)])throw CliErrors['validation'](_0x2cf90d(0xc7));const _0x5bc04f=parseObject(_0x18321c[_0x2cf90d(0xa9)],_0x2cf90d(0xb6)),_0x5042da=Object['keys'](_0x5bc04f)[_0x2cf90d(0xa3)](_0x1b49a4=>!KNOWN_EXTEND_KEYS[_0x2cf90d(0xc3)](_0x1b49a4));if(_0x5042da['length'])throw CliErrors[_0x2cf90d(0xae)](_0x2cf90d(0x9d)+_0x5042da[_0x2cf90d(0xbb)](',\x20')+'.\x20Refusing\x20update.');if(typeof _0x5bc04f[_0x2cf90d(0xe6)]!=='string')throw CliErrors[_0x2cf90d(0xae)](_0x2cf90d(0xa2));const _0x2007e4=parseArray(_0x5bc04f[_0x2cf90d(0xe6)],_0x2cf90d(0xd0)),_0x260aad=_0x2007e4[_0x2cf90d(0xa3)](_0x5367c0=>_0x5367c0[_0x2cf90d(0xc0)]===_0x3b7bb8);if(_0x260aad['length']!==0x1)throw CliErrors[_0x2cf90d(0xae)](_0x2cf90d(0xa1)+_0x3b7bb8+';\x20found\x20'+_0x260aad[_0x2cf90d(0xd6)]+'.');const _0x3b7123=_0x260aad[0x0];if(typeof _0x3b7123[_0x2cf90d(0xb7)]!==_0x2cf90d(0xdf))throw CliErrors[_0x2cf90d(0xae)](_0x2cf90d(0xb8));let _0x1bad4d;try{_0x1bad4d=JSON[_0x2cf90d(0xc9)](_0x3b7123['resources']);}catch{throw CliErrors[_0x2cf90d(0xae)](_0x2cf90d(0xcf));}if(!Array[_0x2cf90d(0xc5)](_0x1bad4d)||_0x1bad4d['some'](_0xba45ee=>typeof _0xba45ee!==_0x2cf90d(0xdf)))throw CliErrors[_0x2cf90d(0xae)]('Existing\x20subapp.resources\x20must\x20be\x20an\x20array\x20of\x20URLs.');const _0x26cc85=_0x2007e4['map'](_0x52b86f=>_0x52b86f===_0x3b7123?{..._0x52b86f,'resources':JSON[_0x2cf90d(0xa8)](_0x2dc28c)}:_0x52b86f),_0x14ebb7={..._0x5bc04f,'assets':JSON['stringify'](_0x26cc85)},_0x56a966=createHash(_0x2cf90d(0xb1))[_0x2cf90d(0xb3)](JSON[_0x2cf90d(0xa8)]({'appCode':_0x18321c[_0x2cf90d(0xe5)],'id':_0x18321c['id'],'appPublishStatus':_0x18321c[_0x2cf90d(0xdd)],'extend':_0x5bc04f,'appName':_0x3b7bb8,'resources':_0x2dc28c}))[_0x2cf90d(0xe1)]('hex');return{'before':_0x1bad4d,'nextExtend':_0x14ebb7,'expectedHash':_0x56a966,'unchanged':isDeepStrictEqual(_0x1bad4d,_0x2dc28c)};}function flags(_0x3f843f){const _0x19c2a7=a188_0x28fd08,{appCode:_0x433618,appName:_0x590254}=getSubappSelector(_0x3f843f),_0xd612a2=_0x3f843f[_0x19c2a7(0x9e)]('resources')[_0x19c2a7(0xe4)]();if(!_0xd612a2)throw CliErrors[_0x19c2a7(0xae)](_0x19c2a7(0xcd));let _0x531602;try{_0x531602=JSON[_0x19c2a7(0xc9)](_0xd612a2);}catch{throw CliErrors[_0x19c2a7(0xae)](_0x19c2a7(0xe3));}if(!Array['isArray'](_0x531602))throw CliErrors[_0x19c2a7(0xae)](_0x19c2a7(0xe3));return{'appCode':_0x433618,'appName':_0x590254,'resources':validateResources(_0x531602)};}export const menuSubappAssetsUpdate={'service':'menu','command':a188_0x28fd08(0xb9),'description':a188_0x28fd08(0xb0),'risk':a188_0x28fd08(0xd4),'strictFlags':!![],'flags':[...SUBAPP_ASSET_SELECTOR_FLAGS,{'name':'resources','type':'string','required':!![],'description':'JSON\x20array\x20of\x20HTTPS\x20resource\x20URLs'},{'name':a188_0x28fd08(0xd2),'type':'string','description':a188_0x28fd08(0xc1)}],async 'validate'(_0x16749e){flags(_0x16749e);},async 'dryRun'(_0x6dc7f3){const _0x13d6a5=a188_0x28fd08,{appCode:_0x4f0e2e,appName:_0x9a432,resources:_0x8ec3e1}=flags(_0x6dc7f3),_0x2bbdba=await getSmartAppRecord(_0x4f0e2e,_0x6dc7f3[_0x13d6a5(0xd8)]),_0x55a165=prepare(_0x2bbdba,_0x9a432,_0x8ec3e1);return{'method':_0x13d6a5(0xbf),'url':'/smartapi/app/update','body':{'preview':{'appCode':_0x4f0e2e,'appName':_0x9a432,'before':_0x55a165[_0x13d6a5(0xc4)],'after':_0x8ec3e1,'expectedHash':_0x55a165[_0x13d6a5(0x9f)],'unchanged':_0x55a165[_0x13d6a5(0xc6)],'remoteContentVerified':![],'independentDeploymentVerified':![]}},'description':_0x55a165['unchanged']?_0x13d6a5(0xb2):'Would\x20update\x20shared\x20assets\x20for\x20'+_0x9a432+'.'};},async 'execute'(_0x24913f){const _0x797f53=a188_0x28fd08,{appCode:_0x2945f9,appName:_0x24f486,resources:_0x578d70}=flags(_0x24913f),_0xe4b2d4=_0x24913f[_0x797f53(0x9e)](_0x797f53(0xd2))['trim']();if(!/^[a-f0-9]{64}$/i[_0x797f53(0xa4)](_0xe4b2d4))throw CliErrors['validation'](_0x797f53(0xca));const _0x12ca64=await getSmartAppRecord(_0x2945f9,_0x24913f[_0x797f53(0xd8)]),_0x1cb9e5=prepare(_0x12ca64,_0x24f486,_0x578d70);if(_0xe4b2d4!==_0x1cb9e5[_0x797f53(0x9f)])throw CliErrors['validation'](_0x797f53(0xcb));if(_0x1cb9e5[_0x797f53(0xc6)])return{'ok':!![],'data':{'appCode':_0x2945f9,'appName':_0x24f486,'updated':![],'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0x797f53(0xe0)};await updateSmartAppRecord({'id':_0x12ca64['id'],'appCode':_0x2945f9,'appPublishStatus':_0x12ca64[_0x797f53(0xdd)],'extend':_0x1cb9e5['nextExtend']},_0x24913f[_0x797f53(0xd8)]);const _0x42b259=await getSmartAppRecord(_0x2945f9,_0x24913f[_0x797f53(0xd8)]),_0x5c0032=parseObject(_0x42b259['extend'],_0x797f53(0xea));if(_0x42b259['id']!==_0x12ca64['id']||_0x42b259[_0x797f53(0xdd)]!==_0x12ca64[_0x797f53(0xdd)]||!isDeepStrictEqual(_0x5c0032,_0x1cb9e5['nextExtend']))throw CliErrors[_0x797f53(0x9c)]('App\x20asset\x20update\x20verification\x20failed;\x20inspect\x20the\x20app\x20before\x20retrying.');return{'ok':!![],'data':{'appCode':_0x2945f9,'appName':_0x24f486,'updated':!![],'resources':_0x578d70,'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0x797f53(0xa0)+_0x24f486+'\x20in\x20menu\x20host\x20'+_0x2945f9+_0x797f53(0xce)};}};
1
+ const a189_0x56793d=a189_0x4646;function a189_0x4646(_0x17750f,_0xa41640){_0x17750f=_0x17750f-0x80;const _0x5f4238=a189_0x5f42();let _0x464611=_0x5f4238[_0x17750f];return _0x464611;}(function(_0x56a256,_0x25d687){const _0x320b78=a189_0x4646,_0x3aaeba=_0x56a256();while(!![]){try{const _0x2053c7=-parseInt(_0x320b78(0x80))/0x1+parseInt(_0x320b78(0x81))/0x2*(-parseInt(_0x320b78(0xb6))/0x3)+-parseInt(_0x320b78(0xc6))/0x4*(parseInt(_0x320b78(0xc2))/0x5)+parseInt(_0x320b78(0x9d))/0x6+parseInt(_0x320b78(0xb3))/0x7*(parseInt(_0x320b78(0xbb))/0x8)+parseInt(_0x320b78(0xbe))/0x9*(parseInt(_0x320b78(0xa2))/0xa)+parseInt(_0x320b78(0x85))/0xb;if(_0x2053c7===_0x25d687)break;else _0x3aaeba['push'](_0x3aaeba['shift']());}catch(_0x1aeb2d){_0x3aaeba['push'](_0x3aaeba['shift']());}}}(a189_0x5f42,0xcc890));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(['skinColor',a189_0x56793d(0xba),'accessKey',a189_0x56793d(0x9a),a189_0x56793d(0xaa),a189_0x56793d(0xa1),a189_0x56793d(0xb8),'enableAutoSync',a189_0x56793d(0xb7),a189_0x56793d(0x98)]);function a189_0x5f42(){const _0x58f1bc=['App\x20assets\x20or\x20update\x20target\x20changed\x20since\x20preview;\x20the\x20fingerprint\x20does\x20not\x20match.\x20Run\x20a\x20new\x20dry-run.','1396609jpQcfx','1038kflJFw','object','apiError','Updated\x20shared\x20resources\x20for\x20','9306066aatSGv','Unknown\x20app.extend\x20fields:\x20','before','length','entries','app.extend.assets\x20must\x20be\x20a\x20JSON\x20string;\x20refusing\x20update.','digest','resources','subapp-assets-update','unchanged',';\x20found\x20','appPublishStatus','.\x20Refusing\x20update.','Existing\x20subapp.resources\x20must\x20be\x20an\x20array\x20of\x20URLs.','test','expected-hash','map','isArray','string','directDbEnabled','parse','assets','Update\x20one\x20frontend\x20subapp\x20resource\x20URL\x20set\x20in\x20the\x20selected\x20menu\x20host','POST','1982094VDVzuK','filter','isSafeInteger','--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.','enableSample','2819150bLbxnS','trim','Would\x20update\x20shared\x20assets\x20for\x20','\x20must\x20be\x20a\x20JSON\x20array.','cookie','stringify','has','some','tenantColumn','write','resources[','Existing\x20subapp.resources\x20contains\x20invalid\x20JSON.','sha256','not\x20HTTPS','https:','\x20must\x20be\x20a\x20JSON\x20object.','menu','147HJsWcK','--resources\x20is\x20required.','At\x20least\x20one\x20resource\x20URL\x20is\x20required.','3273SrqQuv','directDbId','vipDeploy','Preview\x20fingerprint\x20binding\x20the\x20host,\x20subapp,\x20resource\x20URLs\x20and\x20current\x20config;\x20required\x20for\x20writes','enableOpenApi','580664UiwYQd','nextExtend','\x20contains\x20invalid\x20JSON.','9WKkzHK','Shared\x20assets\x20already\x20match\x20the\x20requested\x20URLs.','verified\x20app.extend','extend','909495wYHovP','update','validation','Resources\x20need\x20one\x20JS\x20entry\x20and\x20no\x20duplicate\x20URLs.','4nAqgFw','/smartapi/app/update','Expected\x20exactly\x20one\x20existing\x20subapp\x20entry\x20for\x20','str','Existing\x20subapp.resources\x20must\x20be\x20a\x20JSON\x20string.','protocol','App\x20ID\x20or\x20publish\x20status\x20is\x20missing;\x20refusing\x20a\x20generic\x20app\x20update.'];a189_0x5f42=function(){return _0x58f1bc;};return a189_0x5f42();}function parseObject(_0x28e052,_0x207321){const _0x3dceda=a189_0x56793d;let _0x56231f=_0x28e052;if(typeof _0x28e052===_0x3dceda(0x97))try{_0x56231f=JSON[_0x3dceda(0x99)](_0x28e052);}catch{throw CliErrors['validation'](_0x207321+_0x3dceda(0xbd));}if(!_0x56231f||typeof _0x56231f!==_0x3dceda(0x82)||Array[_0x3dceda(0x96)](_0x56231f))throw CliErrors['validation'](_0x207321+_0x3dceda(0xb1));return _0x56231f;}function parseArray(_0x5eba91,_0x21bf06){const _0x2d2d8e=a189_0x56793d;let _0x24b0c8;try{_0x24b0c8=JSON[_0x2d2d8e(0x99)](_0x5eba91);}catch{throw CliErrors[_0x2d2d8e(0xc4)](_0x21bf06+_0x2d2d8e(0xbd));}if(!Array[_0x2d2d8e(0x96)](_0x24b0c8))throw CliErrors[_0x2d2d8e(0xc4)](_0x21bf06+_0x2d2d8e(0xa5));return _0x24b0c8[_0x2d2d8e(0x95)]((_0x2a54aa,_0x370024)=>parseObject(_0x2a54aa,_0x21bf06+'['+_0x370024+']'));}function validateResources(_0x3e88bf){const _0x5819f1=a189_0x56793d;if(_0x3e88bf['length']===0x0)throw CliErrors[_0x5819f1(0xc4)](_0x5819f1(0xb5));for(const [_0x326245,_0x592f90]of _0x3e88bf[_0x5819f1(0x89)]()){if(typeof _0x592f90!==_0x5819f1(0x97))throw CliErrors['validation'](_0x5819f1(0xac)+_0x326245+']\x20must\x20be\x20a\x20URL\x20string.');try{if(new URL(_0x592f90)[_0x5819f1(0xcb)]!==_0x5819f1(0xb0))throw new Error(_0x5819f1(0xaf));}catch{throw CliErrors[_0x5819f1(0xc4)](_0x5819f1(0xac)+_0x326245+']\x20must\x20be\x20an\x20absolute\x20HTTPS\x20URL.');}}if(new Set(_0x3e88bf)['size']!==_0x3e88bf[_0x5819f1(0x88)]||!_0x3e88bf[_0x5819f1(0xa9)](_0x3d742f=>/\.m?js(?:[?#]|$)/i[_0x5819f1(0x93)](_0x3d742f)))throw CliErrors[_0x5819f1(0xc4)](_0x5819f1(0xc5));return _0x3e88bf;}function prepare(_0x37f1ed,_0x3c8d07,_0xe69cf5){const _0xba18f1=a189_0x56793d;if(!Number[_0xba18f1(0x9f)](_0x37f1ed['id'])||(_0x37f1ed['id']??0x0)<=0x0||typeof _0x37f1ed[_0xba18f1(0x90)]!=='string'||!_0x37f1ed[_0xba18f1(0x90)])throw CliErrors[_0xba18f1(0xc4)](_0xba18f1(0xcc));const _0x46fb1a=parseObject(_0x37f1ed[_0xba18f1(0xc1)],'app.extend'),_0x4526df=Object['keys'](_0x46fb1a)[_0xba18f1(0x9e)](_0x186b3f=>!KNOWN_EXTEND_KEYS[_0xba18f1(0xa8)](_0x186b3f));if(_0x4526df[_0xba18f1(0x88)])throw CliErrors['validation'](_0xba18f1(0x86)+_0x4526df['join'](',\x20')+_0xba18f1(0x91));if(typeof _0x46fb1a[_0xba18f1(0x9a)]!==_0xba18f1(0x97))throw CliErrors[_0xba18f1(0xc4)](_0xba18f1(0x8a));const _0x2f32fd=parseArray(_0x46fb1a[_0xba18f1(0x9a)],'app.extend.assets'),_0x279658=_0x2f32fd[_0xba18f1(0x9e)](_0x12fda9=>_0x12fda9['appName']===_0x3c8d07);if(_0x279658[_0xba18f1(0x88)]!==0x1)throw CliErrors[_0xba18f1(0xc4)](_0xba18f1(0xc8)+_0x3c8d07+_0xba18f1(0x8f)+_0x279658[_0xba18f1(0x88)]+'.');const _0x26e81b=_0x279658[0x0];if(typeof _0x26e81b[_0xba18f1(0x8c)]!==_0xba18f1(0x97))throw CliErrors[_0xba18f1(0xc4)](_0xba18f1(0xca));let _0x5b0005;try{_0x5b0005=JSON['parse'](_0x26e81b['resources']);}catch{throw CliErrors['validation'](_0xba18f1(0xad));}if(!Array[_0xba18f1(0x96)](_0x5b0005)||_0x5b0005['some'](_0x3a87be=>typeof _0x3a87be!==_0xba18f1(0x97)))throw CliErrors[_0xba18f1(0xc4)](_0xba18f1(0x92));const _0x4912d2=_0x2f32fd[_0xba18f1(0x95)](_0x463255=>_0x463255===_0x26e81b?{..._0x463255,'resources':JSON[_0xba18f1(0xa7)](_0xe69cf5)}:_0x463255),_0x57089f={..._0x46fb1a,'assets':JSON[_0xba18f1(0xa7)](_0x4912d2)},_0x11f403=createHash(_0xba18f1(0xae))[_0xba18f1(0xc3)](JSON['stringify']({'appCode':_0x37f1ed['appCode'],'id':_0x37f1ed['id'],'appPublishStatus':_0x37f1ed[_0xba18f1(0x90)],'extend':_0x46fb1a,'appName':_0x3c8d07,'resources':_0xe69cf5}))[_0xba18f1(0x8b)]('hex');return{'before':_0x5b0005,'nextExtend':_0x57089f,'expectedHash':_0x11f403,'unchanged':isDeepStrictEqual(_0x5b0005,_0xe69cf5)};}function flags(_0x5dd20b){const _0x5e5ae1=a189_0x56793d,{appCode:_0xc1ad14,appName:_0x40f230}=getSubappSelector(_0x5dd20b),_0x117cf6=_0x5dd20b[_0x5e5ae1(0xc9)](_0x5e5ae1(0x8c))[_0x5e5ae1(0xa3)]();if(!_0x117cf6)throw CliErrors[_0x5e5ae1(0xc4)](_0x5e5ae1(0xb4));let _0x5b2178;try{_0x5b2178=JSON[_0x5e5ae1(0x99)](_0x117cf6);}catch{throw CliErrors['validation'](_0x5e5ae1(0xa0));}if(!Array[_0x5e5ae1(0x96)](_0x5b2178))throw CliErrors['validation'](_0x5e5ae1(0xa0));return{'appCode':_0xc1ad14,'appName':_0x40f230,'resources':validateResources(_0x5b2178)};}export const menuSubappAssetsUpdate={'service':a189_0x56793d(0xb2),'command':a189_0x56793d(0x8d),'description':a189_0x56793d(0x9b),'risk':a189_0x56793d(0xab),'strictFlags':!![],'flags':[...SUBAPP_ASSET_SELECTOR_FLAGS,{'name':a189_0x56793d(0x8c),'type':'string','required':!![],'description':'JSON\x20array\x20of\x20HTTPS\x20resource\x20URLs'},{'name':a189_0x56793d(0x94),'type':a189_0x56793d(0x97),'description':a189_0x56793d(0xb9)}],async 'validate'(_0x3f7e54){flags(_0x3f7e54);},async 'dryRun'(_0x2d7d35){const _0x5f51fa=a189_0x56793d,{appCode:_0x2f89c6,appName:_0x5b9d8c,resources:_0xf0766e}=flags(_0x2d7d35),_0x4a5801=await getSmartAppRecord(_0x2f89c6,_0x2d7d35['cookie']),_0x24a1ce=prepare(_0x4a5801,_0x5b9d8c,_0xf0766e);return{'method':_0x5f51fa(0x9c),'url':_0x5f51fa(0xc7),'body':{'preview':{'appCode':_0x2f89c6,'appName':_0x5b9d8c,'before':_0x24a1ce[_0x5f51fa(0x87)],'after':_0xf0766e,'expectedHash':_0x24a1ce['expectedHash'],'unchanged':_0x24a1ce[_0x5f51fa(0x8e)],'remoteContentVerified':![],'independentDeploymentVerified':![]}},'description':_0x24a1ce['unchanged']?_0x5f51fa(0xbf):_0x5f51fa(0xa4)+_0x5b9d8c+'.'};},async 'execute'(_0x181360){const _0x10ca66=a189_0x56793d,{appCode:_0x552de8,appName:_0x1303d2,resources:_0x22e08a}=flags(_0x181360),_0x4c611f=_0x181360['str'](_0x10ca66(0x94))['trim']();if(!/^[a-f0-9]{64}$/i[_0x10ca66(0x93)](_0x4c611f))throw CliErrors[_0x10ca66(0xc4)]('--expected-hash\x20from\x20a\x20dry-run\x20is\x20required.');const _0x190084=await getSmartAppRecord(_0x552de8,_0x181360[_0x10ca66(0xa6)]),_0x560024=prepare(_0x190084,_0x1303d2,_0x22e08a);if(_0x4c611f!==_0x560024['expectedHash'])throw CliErrors['validation'](_0x10ca66(0xcd));if(_0x560024['unchanged'])return{'ok':!![],'data':{'appCode':_0x552de8,'appName':_0x1303d2,'updated':![],'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':'Management\x20app\x20assets\x20already\x20match;\x20independent\x20deployment\x20not\x20verified.'};await updateSmartAppRecord({'id':_0x190084['id'],'appCode':_0x552de8,'appPublishStatus':_0x190084[_0x10ca66(0x90)],'extend':_0x560024[_0x10ca66(0xbc)]},_0x181360[_0x10ca66(0xa6)]);const _0x1efa3c=await getSmartAppRecord(_0x552de8,_0x181360['cookie']),_0x5ae52c=parseObject(_0x1efa3c[_0x10ca66(0xc1)],_0x10ca66(0xc0));if(_0x1efa3c['id']!==_0x190084['id']||_0x1efa3c[_0x10ca66(0x90)]!==_0x190084[_0x10ca66(0x90)]||!isDeepStrictEqual(_0x5ae52c,_0x560024[_0x10ca66(0xbc)]))throw CliErrors[_0x10ca66(0x83)]('App\x20asset\x20update\x20verification\x20failed;\x20inspect\x20the\x20app\x20before\x20retrying.');return{'ok':!![],'data':{'appCode':_0x552de8,'appName':_0x1303d2,'updated':!![],'resources':_0x22e08a,'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0x10ca66(0x84)+_0x1303d2+'\x20in\x20menu\x20host\x20'+_0x552de8+';\x20independent\x20deployment\x20not\x20verified.'};}};
@@ -1 +1 @@
1
- const a189_0x226c12=a189_0x5c97;(function(_0x322170,_0x4e1b73){const _0x47f237=a189_0x5c97,_0x562993=_0x322170();while(!![]){try{const _0x2c8948=parseInt(_0x47f237(0x156))/0x1*(-parseInt(_0x47f237(0x13e))/0x2)+-parseInt(_0x47f237(0x13f))/0x3+-parseInt(_0x47f237(0x144))/0x4*(parseInt(_0x47f237(0x123))/0x5)+-parseInt(_0x47f237(0x159))/0x6+parseInt(_0x47f237(0x149))/0x7+parseInt(_0x47f237(0x131))/0x8*(-parseInt(_0x47f237(0x138))/0x9)+parseInt(_0x47f237(0x125))/0xa;if(_0x2c8948===_0x4e1b73)break;else _0x562993['push'](_0x562993['shift']());}catch(_0x26cd77){_0x562993['push'](_0x562993['shift']());}}}(a189_0x4cbc,0xce0ba));import a189_0xd781c3 from'chalk';import{buildCompareRows,doCreateMenus,fetchMenuData}from'../../commands/menu/shared/logic.js';import{renderCompareTable,renderSyncSummary}from'../../commands/menu/shared/compare-table.js';import{selectPages,askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'../../commands/menu/shared/inquirer.js';function a189_0x5c97(_0x2e57a7,_0x25b816){_0x2e57a7=_0x2e57a7-0x120;const _0x4cbc69=a189_0x4cbc();let _0x5c9755=_0x4cbc69[_0x2e57a7];return _0x5c9755;}import{CliErrors}from'../../errors.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{parseMenuSyncParams,resolvePage,runMenuSyncCore}from'../../commands/menu/shared/sync-core.js';import{getLocalPages}from'../../commands/menu/shared/local-pages.js';import{isInProject}from'../../context.js';import{assertSharedResourcesConfigured}from'../../commands/menu/shared/subapp-assets.js';export const menuSync={'service':a189_0x226c12(0x14a),'command':a189_0x226c12(0x124),'description':a189_0x226c12(0x132),'risk':'write','flags':[{'name':a189_0x226c12(0x153),'type':'string','description':a189_0x226c12(0x14b)+a189_0x226c12(0x13a)},{'name':a189_0x226c12(0x147),'type':'string','description':'Exact\x20comma-separated\x20local\x20page\x20paths\x20to\x20sync'},{'name':a189_0x226c12(0x15e),'type':a189_0x226c12(0x145),'description':'Confirm\x20non-interactive\x20sync;\x20without\x20--paths,\x20create\x20all\x20missing\x20local\x20pages'}],async 'dryRun'(_0x384c7c){const _0x39650e=a189_0x226c12;ensureRunnableContext(_0x384c7c[_0x39650e(0x13d)],_0x384c7c[_0x39650e(0x122)]);const _0x2fe52c=await runMenuSyncCore(_0x384c7c[_0x39650e(0x14c)],_0x384c7c[_0x39650e(0x151)],parsePaths(_0x384c7c['str'](_0x39650e(0x147))),_0x384c7c[_0x39650e(0x121)](_0x39650e(0x153)),{'dryRun':!![]});return{'method':'POST','url':_0x39650e(0x148),'body':_0x2fe52c,'description':_0x2fe52c['skipped']?_0x39650e(0x133):'Would\x20create\x20'+_0x2fe52c[_0x39650e(0x137)][_0x39650e(0x120)]+'\x20local\x20microfrontend\x20menu(s).'};},async 'execute'(_0x1bc21f){const _0x1e57cf=a189_0x226c12;ensureRunnableContext(_0x1bc21f[_0x1e57cf(0x13d)],_0x1bc21f[_0x1e57cf(0x122)]);const _0x3c24fc=_0x1bc21f[_0x1e57cf(0x12a)](_0x1e57cf(0x15e)),_0x1ca73d=_0x1bc21f['str'](_0x1e57cf(0x153)),_0x5d53aa=parsePaths(_0x1bc21f[_0x1e57cf(0x121)](_0x1e57cf(0x147))),_0x5f5017=parseMenuSyncParams(_0x1ca73d);if(_0x3c24fc){const _0x45b61f=await runMenuSyncCore(_0x1bc21f[_0x1e57cf(0x14c)],_0x1bc21f[_0x1e57cf(0x151)],_0x5d53aa,_0x1ca73d);if(_0x45b61f[_0x1e57cf(0x12b)]){const _0x2936d1=getLocalPages();_0x2936d1[_0x1e57cf(0x120)]===0x0?writeCliSideChannelLine(_0x1e57cf(0x14f)):writeCliSideChannelLine(_0x1e57cf(0x142));}else writeCliSideChannelLine(_0x1e57cf(0x140)+_0x45b61f[_0x1e57cf(0x12f)]+_0x1e57cf(0x150));return{'ok':!![],'data':_0x45b61f,'message':_0x45b61f[_0x1e57cf(0x12b)]?_0x1e57cf(0x164):'Menu\x20sync\x20completed:\x20'+_0x45b61f[_0x1e57cf(0x12f)]+_0x1e57cf(0x136)};}if(_0x5d53aa['length']>0x0)throw CliErrors[_0x1e57cf(0x12e)]('menu\x20sync\x20--paths\x20requires\x20--yes\x20for\x20execution.','Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.');if(!isInteractive()&&_0x1ca73d)throw CliErrors[_0x1e57cf(0x12e)]('Non-interactive\x20menu\x20sync\x20requires\x20--yes.',_0x1e57cf(0x130));requireInteractive(),writeCliSideChannelLine(_0x1e57cf(0x13c));const _0x30acf8=startSpinner('Fetching\x20online\x20menu\x20list...');let _0x5ca599,_0x3de096,_0x475c61;try{const _0x4c1348=await fetchMenuData(_0x1bc21f[_0x1e57cf(0x14c)],_0x1bc21f[_0x1e57cf(0x151)]);_0x5ca599=_0x4c1348[_0x1e57cf(0x139)],_0x3de096=_0x4c1348[_0x1e57cf(0x15f)],_0x475c61=_0x4c1348[_0x1e57cf(0x12c)],stopSpinner(_0x30acf8,_0x1e57cf(0x163),!![]);}catch(_0x3c3b4e){stopSpinner(_0x30acf8,'Failed\x20to\x20fetch\x20online\x20menu\x20list',![]);throw CliErrors['validation'](_0x3c3b4e instanceof Error?_0x3c3b4e[_0x1e57cf(0x15a)]:_0x1e57cf(0x160));}if(_0x5ca599[_0x1e57cf(0x120)]===0x0)return writeCliSideChannelLine(a189_0xd781c3['yellow']('\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first')),{'ok':!![]};const _0xe4e631=buildCompareRows(_0x5ca599,_0x3de096);writeCliSideChannelLine(renderCompareTable(_0xe4e631)),writeCliSideChannelLine('');const _0x3c3446=await selectPages(_0x5ca599,_0x3de096);writeCliSideChannelLine(''),writeCliSideChannelLine(a189_0xd781c3[_0x1e57cf(0x162)](_0x1e57cf(0x12d)+_0x3c3446[_0x1e57cf(0x120)]+_0x1e57cf(0x161)));const _0x5b1fe5=_0x5f5017['jsUrl']&&_0x5f5017['cssUrl'];if(!_0x5b1fe5){writeCliSideChannelLine(renderSyncSummary(_0x3c3446,_0x3de096['size']>0x0));const _0x7f42f7=await askConfirm(_0x1e57cf(0x15d));if(!_0x7f42f7)return writeCliSideChannelLine(a189_0xd781c3[_0x1e57cf(0x154)]('\x20\x20Cancelled.')),{'ok':!![]};}let _0x38c148=_0x5f5017[_0x1e57cf(0x141)],_0x20eea5=_0x5f5017[_0x1e57cf(0x13b)];!_0x38c148&&!_0x5f5017[_0x1e57cf(0x158)]&&(_0x38c148=await askJsUrl());!_0x20eea5&&!_0x5f5017['appName']&&(_0x20eea5=await askCssUrl());const _0x172d09=await askConfirm(_0x5f5017['appName']?'\x20\x20Create\x20'+_0x3c3446[_0x1e57cf(0x120)]+_0x1e57cf(0x126)+_0x5f5017['appName']+'?':'\x20\x20Create\x20'+_0x3c3446[_0x1e57cf(0x120)]+_0x1e57cf(0x128)+_0x38c148+'\x20and\x20CSS:\x20'+_0x20eea5+'?');if(!_0x172d09)return writeCliSideChannelLine(a189_0xd781c3['gray']('\x20\x20Cancelled.')),{'ok':!![]};const _0x1ff7ad=[_0x38c148,_0x20eea5][_0x1e57cf(0x15b)](_0x45bf99=>Boolean(_0x45bf99));_0x5f5017[_0x1e57cf(0x158)]&&_0x1ff7ad['length']===0x0&&await assertSharedResourcesConfigured(_0x1bc21f['appCode'],_0x1bc21f[_0x1e57cf(0x151)],_0x5f5017['appName']);const _0x33050e=startSpinner(_0x1e57cf(0x134)+_0x3c3446[_0x1e57cf(0x120)]+_0x1e57cf(0x146));try{const _0x26e207=_0x3c3446[_0x1e57cf(0x127)](_0x210359=>resolvePage(_0x210359,_0x5f5017,_0x475c61)),_0x96e3b6=await doCreateMenus(_0x1bc21f[_0x1e57cf(0x14c)],_0x1bc21f[_0x1e57cf(0x151)],_0x26e207,_0x1ff7ad,_0x5f5017['appName']?{'appName':_0x5f5017[_0x1e57cf(0x158)]}:undefined);return stopSpinner(_0x33050e,_0x1e57cf(0x157)+_0x96e3b6[_0x1e57cf(0x12f)]+_0x1e57cf(0x152),!![]),{'ok':!![],'data':_0x96e3b6,'message':'Menu\x20sync\x20completed:\x20'+_0x96e3b6['created']+_0x1e57cf(0x143)+_0x96e3b6[_0x1e57cf(0x14d)]+_0x1e57cf(0x14e)};}catch(_0x145fc2){stopSpinner(_0x33050e,_0x1e57cf(0x15c),![]);throw CliErrors['validation'](_0x145fc2 instanceof Error?_0x145fc2[_0x1e57cf(0x15a)]:_0x1e57cf(0x15c));}}};function ensureRunnableContext(_0x1bac4b,_0x2998a3){const _0x39f8da=a189_0x226c12,_0x4eb94b=_0x1bac4b[_0x39f8da(0x135)]?String(_0x1bac4b[_0x39f8da(0x135)])[_0x39f8da(0x155)]():'';if(!isInProject()&&!_0x2998a3&&!_0x4eb94b)throw CliErrors[_0x39f8da(0x12e)]('menu\x20sync\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20'+'Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.');}function a189_0x4cbc(){const _0x2cb9d3=['rawFlags','40KNSYcT','3783408EjgKPj','✓\x20Menu\x20sync\x20completed:\x20','jsUrl','✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform','\x20created,\x20','343564FKMwBi','boolean','\x20menu(s)...','paths','/smartapi/menu/create','1035615cMhfJU','menu','Prefer\x20appName\x20for\x20shared\x20subapp\x20resources\x20and\x20parentId\x20for\x20planned\x20groups.\x20','appCode','failed','\x20failed.','!\x20No\x20local\x20pages\x20found\x20in\x20src/pages','\x20menu(s)\x20created','cookie','\x20menu(s)','params','gray','trim','57111ZTlpUg','Created\x20','appName','5394486bqMorm','message','filter','Menu\x20creation\x20failed','\x20\x20Continue\x20with\x20creation?','yes','onlinePaths','Failed\x20to\x20fetch\x20online\x20menu\x20list','\x20page(s)','cyan','Online\x20menu\x20list\x20fetched','Menu\x20sync\x20skipped','length','str','selectedAppName','10oAsJeP','sync','49813500nAcgvW','\x20menu(s)\x20bound\x20to\x20','map','\x20menu(s)\x20with\x20JS:\x20','split','flag','skipped','onlineMenuList','\x20\x20✓\x20Selected:\x20','validation','created','Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.','87688DlguCB','Register\x20local\x20pages\x20as\x20platform\x20menus','No\x20local\x20microfrontend\x20menus\x20would\x20be\x20created.','Creating\x20','appcode','\x20created.','targetPages','666AJVXnN','localPages','JSON:\x20{\x22appName\x22:\x22store-app\x22,\x22parentId\x22:42,\x22visible\x22:false};\x20jsUrl\x20and\x20cssUrl\x20remain\x20available\x20for\x20individual\x20menu\x20resources.','cssUrl','Tip:\x20For\x20frontend\x20subapps,\x20prefer\x20Agent-planned\x20menu\x20groups\x20and\x20shared\x20resources.\x20This\x20manual\x20sync\x20workflow\x20remains\x20available\x20as\x20a\x20fallback.'];a189_0x4cbc=function(){return _0x2cb9d3;};return a189_0x4cbc();}function parsePaths(_0x43bdb4){const _0x8015aa=a189_0x226c12;return[...new Set(_0x43bdb4[_0x8015aa(0x129)](',')['map'](_0x5b448a=>_0x5b448a['trim']())['filter'](Boolean))];}
1
+ const a190_0x453a79=a190_0x3838;(function(_0x44fe08,_0x6186f8){const _0x1e4e41=a190_0x3838,_0x24cde9=_0x44fe08();while(!![]){try{const _0x1070c0=-parseInt(_0x1e4e41(0x11b))/0x1+-parseInt(_0x1e4e41(0x109))/0x2*(parseInt(_0x1e4e41(0x11e))/0x3)+-parseInt(_0x1e4e41(0x151))/0x4+-parseInt(_0x1e4e41(0x116))/0x5*(parseInt(_0x1e4e41(0x122))/0x6)+-parseInt(_0x1e4e41(0x138))/0x7+-parseInt(_0x1e4e41(0x14b))/0x8*(parseInt(_0x1e4e41(0x127))/0x9)+parseInt(_0x1e4e41(0x129))/0xa;if(_0x1070c0===_0x6186f8)break;else _0x24cde9['push'](_0x24cde9['shift']());}catch(_0xab2f6d){_0x24cde9['push'](_0x24cde9['shift']());}}}(a190_0x4767,0x3c3d4));import a190_0x25fa30 from'chalk';import{buildCompareRows,doCreateMenus,fetchMenuData}from'../../commands/menu/shared/logic.js';function a190_0x3838(_0xda2ea3,_0x6a559){_0xda2ea3=_0xda2ea3-0x109;const _0x476758=a190_0x4767();let _0x38380d=_0x476758[_0xda2ea3];return _0x38380d;}import{renderCompareTable,renderSyncSummary}from'../../commands/menu/shared/compare-table.js';import{selectPages,askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'../../commands/menu/shared/inquirer.js';import{CliErrors}from'../../errors.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{parseMenuSyncParams,resolvePage,runMenuSyncCore}from'../../commands/menu/shared/sync-core.js';import{getLocalPages}from'../../commands/menu/shared/local-pages.js';import{isInProject}from'../../context.js';import{assertSharedResourcesConfigured}from'../../commands/menu/shared/subapp-assets.js';export const menuSync={'service':'menu','command':a190_0x453a79(0x13a),'description':a190_0x453a79(0x11c),'risk':a190_0x453a79(0x120),'flags':[{'name':a190_0x453a79(0x141),'type':a190_0x453a79(0x12e),'description':'Prefer\x20appName\x20for\x20shared\x20subapp\x20resources\x20and\x20parentId\x20for\x20planned\x20groups.\x20'+a190_0x453a79(0x146)},{'name':'paths','type':a190_0x453a79(0x12e),'description':a190_0x453a79(0x140)},{'name':a190_0x453a79(0x11a),'type':a190_0x453a79(0x126),'description':'Confirm\x20non-interactive\x20sync;\x20without\x20--paths,\x20create\x20all\x20missing\x20local\x20pages'}],async 'dryRun'(_0x599f3b){const _0x56cf3e=a190_0x453a79;ensureRunnableContext(_0x599f3b[_0x56cf3e(0x112)],_0x599f3b['selectedAppName']);const _0x37e7ba=await runMenuSyncCore(_0x599f3b[_0x56cf3e(0x121)],_0x599f3b[_0x56cf3e(0x143)],parsePaths(_0x599f3b[_0x56cf3e(0x13e)](_0x56cf3e(0x134))),_0x599f3b[_0x56cf3e(0x13e)](_0x56cf3e(0x141)),{'dryRun':!![]});return{'method':_0x56cf3e(0x13c),'url':_0x56cf3e(0x125),'body':_0x37e7ba,'description':_0x37e7ba[_0x56cf3e(0x128)]?_0x56cf3e(0x117):'Would\x20create\x20'+_0x37e7ba[_0x56cf3e(0x14a)]['length']+'\x20local\x20microfrontend\x20menu(s).'};},async 'execute'(_0x2cd1c0){const _0x10b6f7=a190_0x453a79;ensureRunnableContext(_0x2cd1c0['rawFlags'],_0x2cd1c0[_0x10b6f7(0x13b)]);const _0x41102c=_0x2cd1c0[_0x10b6f7(0x14d)](_0x10b6f7(0x11a)),_0x352e5b=_0x2cd1c0[_0x10b6f7(0x13e)](_0x10b6f7(0x141)),_0x37d948=parsePaths(_0x2cd1c0[_0x10b6f7(0x13e)](_0x10b6f7(0x134))),_0x5a8dc6=parseMenuSyncParams(_0x352e5b);if(_0x41102c){const _0x716991=await runMenuSyncCore(_0x2cd1c0['appCode'],_0x2cd1c0[_0x10b6f7(0x143)],_0x37d948,_0x352e5b);if(_0x716991[_0x10b6f7(0x128)]){const _0x22cf32=getLocalPages();_0x22cf32[_0x10b6f7(0x115)]===0x0?writeCliSideChannelLine(_0x10b6f7(0x12c)):writeCliSideChannelLine('✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform');}else writeCliSideChannelLine(_0x10b6f7(0x111)+_0x716991[_0x10b6f7(0x13f)]+_0x10b6f7(0x145));return{'ok':!![],'data':_0x716991,'message':_0x716991[_0x10b6f7(0x128)]?'Menu\x20sync\x20skipped':_0x10b6f7(0x10e)+_0x716991[_0x10b6f7(0x13f)]+_0x10b6f7(0x130)};}if(_0x37d948['length']>0x0)throw CliErrors['validation']('menu\x20sync\x20--paths\x20requires\x20--yes\x20for\x20execution.','Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.');if(!isInteractive()&&_0x352e5b)throw CliErrors['validation']('Non-interactive\x20menu\x20sync\x20requires\x20--yes.',_0x10b6f7(0x135));requireInteractive(),writeCliSideChannelLine(_0x10b6f7(0x12a));const _0x4361fb=startSpinner(_0x10b6f7(0x14c));let _0x3956ed,_0x5e3450,_0x23070d;try{const _0x1e6d25=await fetchMenuData(_0x2cd1c0['appCode'],_0x2cd1c0['cookie']);_0x3956ed=_0x1e6d25[_0x10b6f7(0x150)],_0x5e3450=_0x1e6d25[_0x10b6f7(0x152)],_0x23070d=_0x1e6d25[_0x10b6f7(0x10c)],stopSpinner(_0x4361fb,_0x10b6f7(0x113),!![]);}catch(_0x4653eb){stopSpinner(_0x4361fb,_0x10b6f7(0x11d),![]);throw CliErrors[_0x10b6f7(0x12d)](_0x4653eb instanceof Error?_0x4653eb[_0x10b6f7(0x11f)]:_0x10b6f7(0x11d));}if(_0x3956ed[_0x10b6f7(0x115)]===0x0)return writeCliSideChannelLine(a190_0x25fa30[_0x10b6f7(0x10b)](_0x10b6f7(0x119))),{'ok':!![]};const _0x85d07=buildCompareRows(_0x3956ed,_0x5e3450);writeCliSideChannelLine(renderCompareTable(_0x85d07)),writeCliSideChannelLine('');const _0x2573e4=await selectPages(_0x3956ed,_0x5e3450);writeCliSideChannelLine(''),writeCliSideChannelLine(a190_0x25fa30[_0x10b6f7(0x124)](_0x10b6f7(0x133)+_0x2573e4[_0x10b6f7(0x115)]+_0x10b6f7(0x12f)));const _0x3796dc=_0x5a8dc6[_0x10b6f7(0x14f)]&&_0x5a8dc6[_0x10b6f7(0x136)];if(!_0x3796dc){writeCliSideChannelLine(renderSyncSummary(_0x2573e4,_0x5e3450['size']>0x0));const _0x2135f0=await askConfirm(_0x10b6f7(0x144));if(!_0x2135f0)return writeCliSideChannelLine(a190_0x25fa30[_0x10b6f7(0x142)](_0x10b6f7(0x13d))),{'ok':!![]};}let _0x22b6b5=_0x5a8dc6[_0x10b6f7(0x14f)],_0x5d3f0e=_0x5a8dc6['cssUrl'];!_0x22b6b5&&!_0x5a8dc6[_0x10b6f7(0x118)]&&(_0x22b6b5=await askJsUrl());!_0x5d3f0e&&!_0x5a8dc6[_0x10b6f7(0x118)]&&(_0x5d3f0e=await askCssUrl());const _0x114dfb=await askConfirm(_0x5a8dc6[_0x10b6f7(0x118)]?_0x10b6f7(0x131)+_0x2573e4[_0x10b6f7(0x115)]+_0x10b6f7(0x12b)+_0x5a8dc6[_0x10b6f7(0x118)]+'?':_0x10b6f7(0x131)+_0x2573e4[_0x10b6f7(0x115)]+_0x10b6f7(0x139)+_0x22b6b5+_0x10b6f7(0x10a)+_0x5d3f0e+'?');if(!_0x114dfb)return writeCliSideChannelLine(a190_0x25fa30[_0x10b6f7(0x142)](_0x10b6f7(0x13d))),{'ok':!![]};const _0x416d9e=[_0x22b6b5,_0x5d3f0e][_0x10b6f7(0x114)](_0xa5ad69=>Boolean(_0xa5ad69));_0x5a8dc6['appName']&&_0x416d9e['length']===0x0&&await assertSharedResourcesConfigured(_0x2cd1c0[_0x10b6f7(0x121)],_0x2cd1c0[_0x10b6f7(0x143)],_0x5a8dc6['appName']);const _0x45a5f6=startSpinner(_0x10b6f7(0x123)+_0x2573e4['length']+'\x20menu(s)...');try{const _0x5a25f6=_0x2573e4['map'](_0x14c616=>resolvePage(_0x14c616,_0x5a8dc6,_0x23070d)),_0x284090=await doCreateMenus(_0x2cd1c0[_0x10b6f7(0x121)],_0x2cd1c0[_0x10b6f7(0x143)],_0x5a25f6,_0x416d9e,_0x5a8dc6[_0x10b6f7(0x118)]?{'appName':_0x5a8dc6[_0x10b6f7(0x118)]}:undefined);return stopSpinner(_0x45a5f6,'Created\x20'+_0x284090[_0x10b6f7(0x13f)]+_0x10b6f7(0x10d),!![]),{'ok':!![],'data':_0x284090,'message':'Menu\x20sync\x20completed:\x20'+_0x284090[_0x10b6f7(0x13f)]+_0x10b6f7(0x148)+_0x284090[_0x10b6f7(0x147)]+'\x20failed.'};}catch(_0x11f106){stopSpinner(_0x45a5f6,_0x10b6f7(0x137),![]);throw CliErrors[_0x10b6f7(0x12d)](_0x11f106 instanceof Error?_0x11f106[_0x10b6f7(0x11f)]:_0x10b6f7(0x137));}}};function a190_0x4767(){const _0x2cf085=['yes','461262NTNQGy','Register\x20local\x20pages\x20as\x20platform\x20menus','Failed\x20to\x20fetch\x20online\x20menu\x20list','339ujFBeh','message','write','appCode','18dnUFyH','Creating\x20','cyan','/smartapi/menu/create','boolean','9NsjkdI','skipped','18638380gqsrik','Tip:\x20For\x20frontend\x20subapps,\x20prefer\x20Agent-planned\x20menu\x20groups\x20and\x20shared\x20resources.\x20This\x20manual\x20sync\x20workflow\x20remains\x20available\x20as\x20a\x20fallback.','\x20menu(s)\x20bound\x20to\x20','!\x20No\x20local\x20pages\x20found\x20in\x20src/pages','validation','string','\x20page(s)','\x20created.','\x20\x20Create\x20','trim','\x20\x20✓\x20Selected:\x20','paths','Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.','cssUrl','Menu\x20creation\x20failed','277879rXmvkv','\x20menu(s)\x20with\x20JS:\x20','sync','selectedAppName','POST','\x20\x20Cancelled.','str','created','Exact\x20comma-separated\x20local\x20page\x20paths\x20to\x20sync','params','gray','cookie','\x20\x20Continue\x20with\x20creation?','\x20menu(s)\x20created','JSON:\x20{\x22appName\x22:\x22store-app\x22,\x22parentId\x22:42,\x22visible\x22:false};\x20jsUrl\x20and\x20cssUrl\x20remain\x20available\x20for\x20individual\x20menu\x20resources.','failed','\x20created,\x20','map','targetPages','2611256vaNXns','Fetching\x20online\x20menu\x20list...','flag','appcode','jsUrl','localPages','710408aAVygB','onlinePaths','3928BaOcCU','\x20and\x20CSS:\x20','yellow','onlineMenuList','\x20menu(s)','Menu\x20sync\x20completed:\x20','Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.','menu\x20sync\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20','✓\x20Menu\x20sync\x20completed:\x20','rawFlags','Online\x20menu\x20list\x20fetched','filter','length','650330IYcwcb','No\x20local\x20microfrontend\x20menus\x20would\x20be\x20created.','appName','\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first'];a190_0x4767=function(){return _0x2cf085;};return a190_0x4767();}function ensureRunnableContext(_0x499bb2,_0x260894){const _0x40151c=a190_0x453a79,_0x428902=_0x499bb2[_0x40151c(0x14e)]?String(_0x499bb2[_0x40151c(0x14e)])['trim']():'';if(!isInProject()&&!_0x260894&&!_0x428902)throw CliErrors[_0x40151c(0x12d)](_0x40151c(0x110)+_0x40151c(0x10f));}function parsePaths(_0x5e37fe){const _0x5f1932=a190_0x453a79;return[...new Set(_0x5e37fe['split'](',')[_0x5f1932(0x149)](_0x4bb928=>_0x4bb928[_0x5f1932(0x132)]())[_0x5f1932(0x114)](Boolean))];}