@lovrabet/rabetbase-cli 2.5.5-beta.3 → 2.5.5

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 (359) 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/detail.js +1 -1
  77. package/lib/commands/dataset/extend-update.js +1 -1
  78. package/lib/commands/dataset/field-restore.js +1 -1
  79. package/lib/commands/dataset/field-update.js +1 -1
  80. package/lib/commands/dataset/generate.js +1 -1
  81. package/lib/commands/dataset/index.js +1 -1
  82. package/lib/commands/dataset/list.js +1 -1
  83. package/lib/commands/dataset/operations.js +1 -1
  84. package/lib/commands/dataset/relation-audit.js +1 -1
  85. package/lib/commands/dataset/relation-create.js +1 -1
  86. package/lib/commands/dataset/relation-delete.js +1 -1
  87. package/lib/commands/dataset/relation-shared.js +1 -1
  88. package/lib/commands/dataset/relation-update.js +1 -1
  89. package/lib/commands/dataset/relations.js +1 -1
  90. package/lib/commands/dataset/rename.js +1 -1
  91. package/lib/commands/dataset/restore.js +1 -1
  92. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  93. package/lib/commands/db/analysis-batching.js +1 -1
  94. package/lib/commands/db/analyze-batch-plan.js +1 -1
  95. package/lib/commands/db/analyze-cancel.js +1 -1
  96. package/lib/commands/db/analyze-start.js +1 -1
  97. package/lib/commands/db/analyze-status.js +1 -1
  98. package/lib/commands/db/create.js +1 -1
  99. package/lib/commands/db/delete.js +1 -1
  100. package/lib/commands/db/detail.js +1 -1
  101. package/lib/commands/db/diff-refresh-start.js +1 -1
  102. package/lib/commands/db/diff-refresh-status.js +1 -1
  103. package/lib/commands/db/diff.js +1 -1
  104. package/lib/commands/db/index.js +1 -1
  105. package/lib/commands/db/list.js +1 -1
  106. package/lib/commands/db/shared.js +1 -1
  107. package/lib/commands/db/table-diff-shared.js +1 -1
  108. package/lib/commands/db/tables.js +1 -1
  109. package/lib/commands/db/test.js +1 -1
  110. package/lib/commands/db/update.js +1 -1
  111. package/lib/commands/deployment/index.js +1 -1
  112. package/lib/commands/deployment/sync-all.js +1 -1
  113. package/lib/commands/deployment/sync-jobs.js +1 -1
  114. package/lib/commands/deployment/sync-status.js +1 -1
  115. package/lib/commands/doctor.js +1 -1
  116. package/lib/commands/file/index.js +1 -1
  117. package/lib/commands/flow/create.js +1 -1
  118. package/lib/commands/flow/detail.js +1 -1
  119. package/lib/commands/flow/index.js +1 -1
  120. package/lib/commands/flow/list.js +1 -1
  121. package/lib/commands/flow/publish.js +1 -1
  122. package/lib/commands/flow/runtime-resources-shared.js +1 -1
  123. package/lib/commands/flow/runtime-role-list.js +1 -1
  124. package/lib/commands/flow/runtime-role-user-list.js +1 -1
  125. package/lib/commands/flow/runtime-user-search.js +1 -1
  126. package/lib/commands/flow/shared.js +1 -1
  127. package/lib/commands/flow/update.js +1 -1
  128. package/lib/commands/flow/validate.js +1 -1
  129. package/lib/commands/instant-api-policy/current.js +1 -1
  130. package/lib/commands/instant-api-policy/index.js +1 -1
  131. package/lib/commands/instant-api-policy/init.js +1 -1
  132. package/lib/commands/instant-api-policy/publish.js +1 -1
  133. package/lib/commands/instant-api-policy/pull.js +1 -1
  134. package/lib/commands/instant-api-policy/revision.js +1 -1
  135. package/lib/commands/instant-api-policy/revisions.js +1 -1
  136. package/lib/commands/instant-api-policy/rollback.js +1 -1
  137. package/lib/commands/instant-api-policy/shared.js +1 -1
  138. package/lib/commands/instant-api-policy/validate.js +1 -1
  139. package/lib/commands/issue/index.js +1 -1
  140. package/lib/commands/issue/nudge.js +1 -1
  141. package/lib/commands/issue/report.js +1 -1
  142. package/lib/commands/issue/shared.js +1 -1
  143. package/lib/commands/kb/create.js +1 -1
  144. package/lib/commands/kb/delete.js +1 -1
  145. package/lib/commands/kb/detail.js +1 -1
  146. package/lib/commands/kb/index.js +1 -1
  147. package/lib/commands/kb/list.js +1 -1
  148. package/lib/commands/kb/search.js +1 -1
  149. package/lib/commands/kb/shared.js +1 -1
  150. package/lib/commands/kb/update.js +1 -1
  151. package/lib/commands/logs/index.js +1 -1
  152. package/lib/commands/menu/asset-update.js +1 -1
  153. package/lib/commands/menu/delete.js +1 -1
  154. package/lib/commands/menu/external-link-create.js +1 -1
  155. package/lib/commands/menu/external-link-update.js +1 -1
  156. package/lib/commands/menu/group-create.js +1 -1
  157. package/lib/commands/menu/group-update.js +1 -1
  158. package/lib/commands/menu/index.js +1 -1
  159. package/lib/commands/menu/list.js +1 -1
  160. package/lib/commands/menu/move.js +1 -1
  161. package/lib/commands/menu/regroup-start.js +1 -1
  162. package/lib/commands/menu/rename.js +1 -1
  163. package/lib/commands/menu/shared/compare-table.js +1 -1
  164. package/lib/commands/menu/shared/delete-plan.js +1 -1
  165. package/lib/commands/menu/shared/facts.js +1 -1
  166. package/lib/commands/menu/shared/index.js +1 -1
  167. package/lib/commands/menu/shared/inquirer.js +1 -1
  168. package/lib/commands/menu/shared/local-pages.js +1 -1
  169. package/lib/commands/menu/shared/logic.js +1 -1
  170. package/lib/commands/menu/shared/mutations.js +1 -1
  171. package/lib/commands/menu/shared/path.js +1 -1
  172. package/lib/commands/menu/shared/service.js +1 -1
  173. package/lib/commands/menu/shared/subapp-assets.js +1 -1
  174. package/lib/commands/menu/shared/sync-core.js +1 -1
  175. package/lib/commands/menu/shared/update-core.js +1 -1
  176. package/lib/commands/menu/shared/valid-url.js +1 -1
  177. package/lib/commands/menu/subapp-assets-status.js +1 -1
  178. package/lib/commands/menu/subapp-assets-update.js +1 -1
  179. package/lib/commands/menu/sync.js +1 -1
  180. package/lib/commands/menu/visibility-update.js +1 -1
  181. package/lib/commands/notification/config-create.js +1 -1
  182. package/lib/commands/notification/config-delete.js +1 -1
  183. package/lib/commands/notification/config-list.js +1 -1
  184. package/lib/commands/notification/config-update.js +1 -1
  185. package/lib/commands/notification/index.js +1 -1
  186. package/lib/commands/notification/shared.js +1 -1
  187. package/lib/commands/ocr/index.js +1 -1
  188. package/lib/commands/page/create.js +1 -1
  189. package/lib/commands/page/custom/detail.js +1 -1
  190. package/lib/commands/page/custom/list.js +1 -1
  191. package/lib/commands/page/custom/publish.js +1 -1
  192. package/lib/commands/page/custom/shared.js +1 -1
  193. package/lib/commands/page/custom/syntax.js +1 -1
  194. package/lib/commands/page/custom/update.js +1 -1
  195. package/lib/commands/page/data-list-status.js +1 -1
  196. package/lib/commands/page/generate-start.js +1 -1
  197. package/lib/commands/page/generate-status.js +1 -1
  198. package/lib/commands/page/index.js +1 -1
  199. package/lib/commands/page/pull.js +1 -1
  200. package/lib/commands/page/push.js +1 -1
  201. package/lib/commands/page/relation-audit.js +1 -1
  202. package/lib/commands/page/restore.js +1 -1
  203. package/lib/commands/page/shared.js +1 -1
  204. package/lib/commands/page/sync.js +1 -1
  205. package/lib/commands/project/api-architecture-upgrade.js +1 -1
  206. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  207. package/lib/commands/project/create/format-elapsed.js +1 -1
  208. package/lib/commands/project/create/main.js +1 -1
  209. package/lib/commands/project/create/materialize-project-template.js +1 -1
  210. package/lib/commands/project/create/project-name.js +1 -1
  211. package/lib/commands/project/create/project-template-archive.js +1 -1
  212. package/lib/commands/project/create/project-template-path.js +1 -1
  213. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  214. package/lib/commands/project/create/use-format-code.js +1 -1
  215. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  216. package/lib/commands/project/domain-routing-sync.js +1 -1
  217. package/lib/commands/project/index.js +1 -1
  218. package/lib/commands/project/upgrade.js +1 -1
  219. package/lib/commands/registry.js +1 -1
  220. package/lib/commands/role/delete.js +1 -1
  221. package/lib/commands/role/detail.js +1 -1
  222. package/lib/commands/role/index.js +1 -1
  223. package/lib/commands/role/list.js +1 -1
  224. package/lib/commands/role/shared.js +1 -1
  225. package/lib/commands/role/update.js +1 -1
  226. package/lib/commands/role/user-add.js +1 -1
  227. package/lib/commands/role/user-remove.js +1 -1
  228. package/lib/commands/role/user-resolve.js +1 -1
  229. package/lib/commands/rule/get.js +1 -1
  230. package/lib/commands/rule/index.js +1 -1
  231. package/lib/commands/rule/list.js +1 -1
  232. package/lib/commands/rule/set.js +1 -1
  233. package/lib/commands/rule/shared.js +1 -1
  234. package/lib/commands/run/index.js +1 -1
  235. package/lib/commands/schema.js +1 -1
  236. package/lib/commands/sql/create.js +1 -1
  237. package/lib/commands/sql/delete.js +1 -1
  238. package/lib/commands/sql/detail.js +1 -1
  239. package/lib/commands/sql/exec.js +1 -1
  240. package/lib/commands/sql/index.js +1 -1
  241. package/lib/commands/sql/list.js +1 -1
  242. package/lib/commands/sql/pull.js +1 -1
  243. package/lib/commands/sql/push.js +1 -1
  244. package/lib/commands/sql/shared.js +1 -1
  245. package/lib/commands/sql/status.js +1 -1
  246. package/lib/commands/sql/validate.js +1 -1
  247. package/lib/commands/task/index.js +1 -1
  248. package/lib/commands/task/status.js +1 -1
  249. package/lib/commands/tenant/index.js +1 -1
  250. package/lib/commands/tenant/members-list.js +1 -1
  251. package/lib/commands/tenant/shared.js +1 -1
  252. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  253. package/lib/commands/user-account/feishu-bind.js +1 -1
  254. package/lib/commands/user-account/index.js +1 -1
  255. package/lib/commands/workspace/add.js +1 -1
  256. package/lib/commands/workspace/index.js +1 -1
  257. package/lib/commands/workspace/remove.js +1 -1
  258. package/lib/config/domain-config.js +1 -1
  259. package/lib/config/project-domain-routing.js +1 -1
  260. package/lib/config/region-config.js +1 -1
  261. package/lib/config/schema.js +1 -1
  262. package/lib/constant/cdn.js +1 -1
  263. package/lib/constant/cli.js +1 -1
  264. package/lib/constant/defaults.js +1 -1
  265. package/lib/constant/domain.js +1 -1
  266. package/lib/constant/env.js +1 -1
  267. package/lib/constant/output.js +1 -1
  268. package/lib/constant/paths.js +1 -1
  269. package/lib/constant/region.js +1 -1
  270. package/lib/constant/risk.js +1 -1
  271. package/lib/constant/routing-profile.js +1 -1
  272. package/lib/context/app-resolver.js +1 -1
  273. package/lib/context/auth-resolver.js +1 -1
  274. package/lib/context/config-loader.js +1 -1
  275. package/lib/context.js +1 -1
  276. package/lib/core/alias-resolver.js +1 -1
  277. package/lib/core/api-client.js +1 -1
  278. package/lib/core/bff/config.js +1 -1
  279. package/lib/core/bff/file-system.js +1 -1
  280. package/lib/core/bff/hash.js +1 -1
  281. package/lib/core/bff/hook-directory.js +1 -1
  282. package/lib/core/bff/lock.js +1 -1
  283. package/lib/core/bff/utils.js +1 -1
  284. package/lib/core/cross-db-relation.js +1 -1
  285. package/lib/core/db-resolver.js +1 -1
  286. package/lib/core/flow-config.js +1 -1
  287. package/lib/core/instant-api-policy/config.js +1 -1
  288. package/lib/core/kb-search-client.js +1 -1
  289. package/lib/core/page/file-system.js +1 -1
  290. package/lib/core/page/hash.js +1 -1
  291. package/lib/core/page/lock.js +1 -1
  292. package/lib/core/page/lr-smart-jsx.js +1 -1
  293. package/lib/core/sql-index-auditor.js +1 -1
  294. package/lib/core/sql-sync/config.js +1 -1
  295. package/lib/core/sql-sync/file-system.js +1 -1
  296. package/lib/core/sql-sync/hash.js +1 -1
  297. package/lib/core/sql-sync/lock.js +1 -1
  298. package/lib/core/sql-sync/utils.js +1 -1
  299. package/lib/core/sql-validator.js +1 -1
  300. package/lib/errors.js +1 -1
  301. package/lib/framework/build-all-flags.js +1 -1
  302. package/lib/framework/error-output.js +1 -1
  303. package/lib/framework/explicit-yes.js +1 -1
  304. package/lib/framework/flags.js +1 -1
  305. package/lib/framework/help.js +1 -1
  306. package/lib/framework/index.js +1 -1
  307. package/lib/framework/output.js +1 -1
  308. package/lib/framework/response.js +1 -1
  309. package/lib/framework/runner-alias.js +1 -1
  310. package/lib/framework/runner.js +1 -1
  311. package/lib/framework/schema-export.js +1 -1
  312. package/lib/framework/supported-flags.js +1 -1
  313. package/lib/framework/types.js +1 -1
  314. package/lib/generated/build-info.d.ts +4 -4
  315. package/lib/generated/build-info.js +1 -1
  316. package/lib/generated/official-routing.js +1 -1
  317. package/lib/generated/routing-contract.js +1 -1
  318. package/lib/help.js +1 -1
  319. package/lib/postinstall.js +1 -1
  320. package/lib/runtime/confirmation.js +1 -1
  321. package/lib/runtime/event.js +1 -1
  322. package/lib/runtime/index.js +1 -1
  323. package/lib/runtime/queue.js +1 -1
  324. package/lib/runtime/resolve.js +1 -1
  325. package/lib/skills/builtin-skill.js +1 -1
  326. package/lib/skills/main.js +1 -1
  327. package/lib/skills/npx-skills-add.js +1 -1
  328. package/lib/skills/skill-presence.js +1 -1
  329. package/lib/telemetry/cli-command-trace.js +1 -1
  330. package/lib/telemetry/cli-help-trace.js +1 -1
  331. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  332. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  333. package/lib/telemetry/send-cli-trace-log.js +1 -1
  334. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  335. package/lib/utils/ai_config.js +1 -1
  336. package/lib/utils/apply-jq-filter.js +1 -1
  337. package/lib/utils/cdn-config.js +1 -1
  338. package/lib/utils/check-sdk-version.js +1 -1
  339. package/lib/utils/cli-version-check.js +1 -1
  340. package/lib/utils/cli-version-policy.js +1 -1
  341. package/lib/utils/config.js +1 -1
  342. package/lib/utils/entity-with-id.js +1 -1
  343. package/lib/utils/file-utils.js +1 -1
  344. package/lib/utils/guides-cdn.js +1 -1
  345. package/lib/utils/http-client.js +1 -1
  346. package/lib/utils/is-non-interactive.js +1 -1
  347. package/lib/utils/logger.js +1 -1
  348. package/lib/utils/params.js +1 -1
  349. package/lib/utils/platform.js +1 -1
  350. package/lib/utils/sleep.js +1 -1
  351. package/lib/utils/template-replacer.js +1 -1
  352. package/lib/utils/update-notice.js +1 -1
  353. package/lib/utils/version.js +1 -1
  354. package/lib/utils/with-active-cookie.js +1 -1
  355. package/lib/utils/write-cli-side-channel.js +1 -1
  356. package/package.json +1 -1
  357. package/skills/rabetbase/SKILL.md +1 -1
  358. package/skills/rabetbase-page-generation/SKILL.md +1 -1
  359. package/skills/rabetbase.manifest.json +3 -3
@@ -1 +1 @@
1
- const a288_0x543aa7=a288_0x3984;(function(_0x5cb20a,_0x28237c){const _0x554177=a288_0x3984,_0x2ee434=_0x5cb20a();while(!![]){try{const _0x1a3161=-parseInt(_0x554177(0x185))/0x1*(-parseInt(_0x554177(0x176))/0x2)+-parseInt(_0x554177(0x18c))/0x3+-parseInt(_0x554177(0x175))/0x4*(parseInt(_0x554177(0x192))/0x5)+parseInt(_0x554177(0x1a6))/0x6*(parseInt(_0x554177(0x195))/0x7)+parseInt(_0x554177(0x174))/0x8+-parseInt(_0x554177(0x173))/0x9+parseInt(_0x554177(0x177))/0xa;if(_0x1a3161===_0x28237c)break;else _0x2ee434['push'](_0x2ee434['shift']());}catch(_0x42ac45){_0x2ee434['push'](_0x2ee434['shift']());}}}(a288_0x1268,0xb3fd3));import{randomUUID}from'node:crypto';import{mkdir,readFile,rename,stat,unlink,writeFile}from'node:fs/promises';import{dirname,resolve}from'node:path';function a288_0x3984(_0x5c606e,_0x513486){_0x5c606e=_0x5c606e-0x171;const _0x12686c=a288_0x1268();let _0x3984d5=_0x12686c[_0x5c606e];return _0x3984d5;}import{TextDecoder}from'node:util';import{findProjectRootDirectory}from'../../context.js';import{CliError}from'../../errors.js';export const INSTANT_API_POLICY_RELATIVE_ROOT=a288_0x543aa7(0x1a2);export const INSTANT_API_POLICY_FILE_NAME=a288_0x543aa7(0x182);export const MAX_INSTANT_API_POLICY_BYTES=0x400*0x400;export function instantApiPolicyError(_0x42ed75,_0x53b88b,_0x1f2aaa){return new CliError(_0x42ed75,0x1,_0x53b88b,_0x1f2aaa);}export function loadInstantApiPolicyLocalConfig(_0x57323d,_0x13ac93){assertSafeAppCode(_0x57323d);const _0xbe227e=resolve(_0x13ac93??findProjectRootDirectory()),_0x3a13a0=INSTANT_API_POLICY_RELATIVE_ROOT+'/'+_0x57323d+'/'+INSTANT_API_POLICY_FILE_NAME,_0x5e67e9=resolve(_0xbe227e,INSTANT_API_POLICY_RELATIVE_ROOT,_0x57323d),_0xa5de7a=resolve(_0x5e67e9,INSTANT_API_POLICY_FILE_NAME);return{'projectRoot':_0xbe227e,'appCode':_0x57323d,'policyRoot':_0x5e67e9,'policyFilePath':_0xa5de7a,'policyRelativePath':_0x3a13a0};}export function createDefaultInstantApiPolicyConfig(_0x2d0dba,_0x55e0c5=a288_0x543aa7(0x172)){return assertSafeAppCode(_0x2d0dba),{'version':'2','appCode':_0x2d0dba,'defaults':{'instantApi':_0x55e0c5},'rules':[]};}export async function readInstantApiPolicyConfigFile(_0x974e69){const _0xd81090=a288_0x543aa7;let _0x589b26;try{_0x589b26=await stat(_0x974e69[_0xd81090(0x1a5)]);}catch(_0x3bd556){throw instantApiPolicyError(_0xd81090(0x194),_0xd81090(0x17a)+_0x974e69[_0xd81090(0x1a5)],'Run\x20`rabetbase\x20instant-api-policy\x20init`\x20or\x20`rabetbase\x20instant-api-policy\x20pull`\x20first.');}if(!_0x589b26[_0xd81090(0x19f)]())throw instantApiPolicyError(_0xd81090(0x180),_0xd81090(0x19d)+_0x974e69[_0xd81090(0x1a5)]);if(_0x589b26[_0xd81090(0x1a3)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError('instant_api_policy_file_too_large',_0xd81090(0x17f));let _0x403dd1;try{_0x403dd1=await readFile(_0x974e69[_0xd81090(0x1a5)]);}catch{throw instantApiPolicyError(_0xd81090(0x19c),_0xd81090(0x17b)+_0x974e69[_0xd81090(0x1a5)]);}if(_0x403dd1[_0xd81090(0x184)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0xd81090(0x1a7),'Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.');let _0xac2811;try{_0xac2811=new TextDecoder('utf-8',{'fatal':!![],'ignoreBOM':!![]})[_0xd81090(0x199)](_0x403dd1);}catch{throw instantApiPolicyError(_0xd81090(0x180),'Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20UTF-8:\x20'+_0x974e69[_0xd81090(0x1a5)]);}let _0x425731;try{_0x425731=JSON[_0xd81090(0x19a)](_0xac2811);}catch{throw instantApiPolicyError('instant_api_policy_json_invalid','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20JSON:\x20'+_0x974e69[_0xd81090(0x1a5)]);}return assertLocalPolicyContract(_0x425731,_0x974e69[_0xd81090(0x18a)]);}export async function writeInstantApiPolicyConfigFile(_0x17f035,_0x344d58,_0x1ec3cd={}){const _0x4aaf7b=a288_0x543aa7,_0x3a3aae=assertLocalPolicyContract(_0x344d58,_0x17f035[_0x4aaf7b(0x18a)]),_0x2b2a2d=JSON[_0x4aaf7b(0x1a1)](_0x3a3aae,null,0x2)+'\x0a';if(Buffer[_0x4aaf7b(0x184)](_0x2b2a2d,_0x4aaf7b(0x17c))>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x4aaf7b(0x1a7),_0x4aaf7b(0x17f));await mkdir(_0x17f035['policyRoot'],{'recursive':!![]});let _0x34b16d;try{_0x34b16d=await readFile(_0x17f035[_0x4aaf7b(0x1a5)],_0x4aaf7b(0x17c));}catch(_0x35cd09){if(!isMissingFile(_0x35cd09))throw instantApiPolicyError('instant_api_policy_file_unreadable',_0x4aaf7b(0x179)+_0x17f035[_0x4aaf7b(0x1a5)]);}if(_0x34b16d===_0x2b2a2d)return{'action':'unchanged','filePath':_0x17f035[_0x4aaf7b(0x1a5)]};if(_0x34b16d!==undefined&&!_0x1ec3cd[_0x4aaf7b(0x181)])throw instantApiPolicyError('instant_api_policy_file_exists','Instant\x20API\x20policy\x20file\x20already\x20exists:\x20'+_0x17f035[_0x4aaf7b(0x1a5)],'Review\x20local\x20changes,\x20then\x20rerun\x20with\x20--force\x20--yes\x20if\x20replacement\x20is\x20intended.');if(_0x34b16d===undefined)try{return await writeFile(_0x17f035[_0x4aaf7b(0x1a5)],_0x2b2a2d,{'encoding':_0x4aaf7b(0x17c),'flag':'wx'}),{'action':_0x4aaf7b(0x17e),'filePath':_0x17f035[_0x4aaf7b(0x1a5)]};}catch(_0x362ddf){if(!isAlreadyExists(_0x362ddf))throw instantApiPolicyError(_0x4aaf7b(0x18d),_0x4aaf7b(0x17d)+_0x17f035[_0x4aaf7b(0x1a5)]);if(!_0x1ec3cd['force'])throw instantApiPolicyError(_0x4aaf7b(0x1a8),_0x4aaf7b(0x1a0)+_0x17f035[_0x4aaf7b(0x1a5)],'Review\x20the\x20file\x20before\x20retrying.');}const _0xb0bfa7=resolve(dirname(_0x17f035[_0x4aaf7b(0x1a5)]),'.'+INSTANT_API_POLICY_FILE_NAME+'.'+process['pid']+'.'+randomUUID()+_0x4aaf7b(0x191));try{await writeFile(_0xb0bfa7,_0x2b2a2d,{'encoding':_0x4aaf7b(0x17c),'flag':'wx'}),await rename(_0xb0bfa7,_0x17f035['policyFilePath']);}catch{await unlink(_0xb0bfa7)[_0x4aaf7b(0x187)](()=>undefined);throw instantApiPolicyError(_0x4aaf7b(0x18d),_0x4aaf7b(0x197)+_0x17f035['policyFilePath']);}return{'action':_0x4aaf7b(0x19b),'filePath':_0x17f035[_0x4aaf7b(0x1a5)]};}function assertSafeAppCode(_0x1e6552){const _0x58e801=_0x1e6552['trim']();if(!_0x58e801||_0x58e801!==_0x1e6552||_0x58e801['length']>0x64||_0x58e801==='.'||_0x58e801==='..'||_0x58e801['includes']('/')||_0x58e801['includes']('\x5c')||_0x58e801['includes']('\x00'))throw instantApiPolicyError('instant_api_policy_app_code_invalid','appCode\x20cannot\x20be\x20used\x20as\x20the\x20fixed\x20Instant\x20API\x20policy\x20directory\x20name.');}function a288_0x1268(){const _0x224ea1=['62nGtOfS','rules','catch','instant_api_policy_defaults_invalid','instant_api_policy_json_invalid','appCode','version','336807vpcxrN','instant_api_policy_file_unwritable','EEXIST','version\x20is\x20the\x20JSON\x20schema\x20version;\x20published\x20history\x20uses\x20the\x20separate\x20revision\x20field.','instant_api_policy_version_invalid','.tmp','263990eYDZfr','ENOENT','instant_api_policy_file_missing','7QFbMJF','instantApi','Cannot\x20replace\x20Instant\x20API\x20policy\x20file:\x20','isArray','decode','parse','overwritten','instant_api_policy_file_unreadable','Instant\x20API\x20policy\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','Policy\x20appCode\x20must\x20match\x20the\x20selected\x20application\x20','isFile','Instant\x20API\x20policy\x20file\x20was\x20created\x20concurrently:\x20','stringify','.rabetbase/instant-api-policy','size','code','policyFilePath','7984554jgOeRe','instant_api_policy_file_too_large','instant_api_policy_file_exists','Instant\x20API\x20policy\x20version\x20must\x20be\x20\x221\x22\x20or\x20\x222\x22.','object','instant_api_policy_rules_invalid','allow','12972123VxwZBp','5127776zINWKm','68Licqzn','7926JGWtXT','9709800hWDRcS','Instant\x20API\x20policy\x20JSON\x20root\x20must\x20be\x20an\x20object.','Cannot\x20inspect\x20Instant\x20API\x20policy\x20file:\x20','Instant\x20API\x20policy\x20file\x20does\x20not\x20exist:\x20','Cannot\x20read\x20Instant\x20API\x20policy\x20file:\x20','utf8','Cannot\x20write\x20Instant\x20API\x20policy\x20file:\x20','created','Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.','instant_api_policy_file_invalid','force','policy.json','defaults','byteLength'];a288_0x1268=function(){return _0x224ea1;};return a288_0x1268();}function assertLocalPolicyContract(_0x4de99f,_0x4f81af){const _0x456091=a288_0x543aa7;if(!isObject(_0x4de99f))throw instantApiPolicyError(_0x456091(0x189),_0x456091(0x178));if(_0x4de99f[_0x456091(0x18b)]!=='1'&&_0x4de99f[_0x456091(0x18b)]!=='2')throw instantApiPolicyError(_0x456091(0x190),_0x456091(0x1a9),_0x456091(0x18f));if(_0x4de99f[_0x456091(0x18a)]!==_0x4f81af)throw instantApiPolicyError('instant_api_policy_app_code_mismatch',_0x456091(0x19e)+_0x4f81af+'.');if(!isObject(_0x4de99f[_0x456091(0x183)])||typeof _0x4de99f[_0x456091(0x183)][_0x456091(0x196)]!=='string')throw instantApiPolicyError(_0x456091(0x188),'Policy\x20defaults.instantApi\x20is\x20required.');if(_0x4de99f[_0x456091(0x186)]!==undefined&&_0x4de99f[_0x456091(0x186)]!==null&&!Array['isArray'](_0x4de99f[_0x456091(0x186)]))throw instantApiPolicyError(_0x456091(0x171),'Policy\x20rules\x20must\x20be\x20an\x20array\x20or\x20null.');return _0x4de99f;}function isObject(_0x15ef10){const _0x3acf26=a288_0x543aa7;return _0x15ef10!==null&&typeof _0x15ef10===_0x3acf26(0x1aa)&&!Array[_0x3acf26(0x198)](_0x15ef10);}function isMissingFile(_0x15771e){const _0x4d444c=a288_0x543aa7;return Boolean(_0x15771e&&typeof _0x15771e==='object'&&_0x15771e[_0x4d444c(0x1a4)]===_0x4d444c(0x193));}function isAlreadyExists(_0x364b01){const _0x3bb5c6=a288_0x543aa7;return Boolean(_0x364b01&&typeof _0x364b01===_0x3bb5c6(0x1aa)&&_0x364b01[_0x3bb5c6(0x1a4)]===_0x3bb5c6(0x18e));}
1
+ const a288_0x109450=a288_0x448c;(function(_0x18db23,_0x188a22){const _0x158e1f=a288_0x448c,_0x3ed5f6=_0x18db23();while(!![]){try{const _0x13c3cf=parseInt(_0x158e1f(0x200))/0x1+-parseInt(_0x158e1f(0x1d5))/0x2*(-parseInt(_0x158e1f(0x212))/0x3)+-parseInt(_0x158e1f(0x20f))/0x4*(parseInt(_0x158e1f(0x1ea))/0x5)+parseInt(_0x158e1f(0x1f2))/0x6*(-parseInt(_0x158e1f(0x1df))/0x7)+-parseInt(_0x158e1f(0x1d7))/0x8*(parseInt(_0x158e1f(0x1dc))/0x9)+parseInt(_0x158e1f(0x1e6))/0xa+parseInt(_0x158e1f(0x1e0))/0xb;if(_0x13c3cf===_0x188a22)break;else _0x3ed5f6['push'](_0x3ed5f6['shift']());}catch(_0xb31275){_0x3ed5f6['push'](_0x3ed5f6['shift']());}}}(a288_0x3ee4,0x2b433));import{randomUUID}from'node:crypto';import{mkdir,readFile,rename,stat,unlink,writeFile}from'node:fs/promises';import{dirname,resolve}from'node:path';import{TextDecoder}from'node:util';import{findProjectRootDirectory}from'../../context.js';import{CliError}from'../../errors.js';export const INSTANT_API_POLICY_RELATIVE_ROOT=a288_0x109450(0x204);export const INSTANT_API_POLICY_FILE_NAME=a288_0x109450(0x20c);export const MAX_INSTANT_API_POLICY_BYTES=0x400*0x400;export function instantApiPolicyError(_0x10301b,_0xdbbaab,_0x3ec255){return new CliError(_0x10301b,0x1,_0xdbbaab,_0x3ec255);}export function loadInstantApiPolicyLocalConfig(_0x241cc0,_0x271053){assertSafeAppCode(_0x241cc0);const _0x6267e0=resolve(_0x271053??findProjectRootDirectory()),_0x15c6aa=INSTANT_API_POLICY_RELATIVE_ROOT+'/'+_0x241cc0+'/'+INSTANT_API_POLICY_FILE_NAME,_0xb7a23b=resolve(_0x6267e0,INSTANT_API_POLICY_RELATIVE_ROOT,_0x241cc0),_0x161c11=resolve(_0xb7a23b,INSTANT_API_POLICY_FILE_NAME);return{'projectRoot':_0x6267e0,'appCode':_0x241cc0,'policyRoot':_0xb7a23b,'policyFilePath':_0x161c11,'policyRelativePath':_0x15c6aa};}export function createDefaultInstantApiPolicyConfig(_0x6b1d3a,_0x464c01='allow'){return assertSafeAppCode(_0x6b1d3a),{'version':'2','appCode':_0x6b1d3a,'defaults':{'instantApi':_0x464c01},'rules':[]};}export async function readInstantApiPolicyConfigFile(_0x439315){const _0x34fd61=a288_0x109450;let _0x3531f8;try{_0x3531f8=await stat(_0x439315[_0x34fd61(0x20d)]);}catch(_0x568523){throw instantApiPolicyError(_0x34fd61(0x1e5),'Instant\x20API\x20policy\x20file\x20does\x20not\x20exist:\x20'+_0x439315[_0x34fd61(0x20d)],_0x34fd61(0x1d6));}if(!_0x3531f8[_0x34fd61(0x1fd)]())throw instantApiPolicyError('instant_api_policy_file_invalid',_0x34fd61(0x1e3)+_0x439315[_0x34fd61(0x20d)]);if(_0x3531f8[_0x34fd61(0x213)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x34fd61(0x1da),_0x34fd61(0x1d2));let _0x310f04;try{_0x310f04=await readFile(_0x439315[_0x34fd61(0x20d)]);}catch{throw instantApiPolicyError(_0x34fd61(0x1e2),_0x34fd61(0x1ec)+_0x439315[_0x34fd61(0x20d)]);}if(_0x310f04[_0x34fd61(0x211)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x34fd61(0x1da),_0x34fd61(0x1d2));let _0x566759;try{_0x566759=new TextDecoder('utf-8',{'fatal':!![],'ignoreBOM':!![]})[_0x34fd61(0x1ed)](_0x310f04);}catch{throw instantApiPolicyError('instant_api_policy_file_invalid',_0x34fd61(0x1e9)+_0x439315['policyFilePath']);}let _0x16a46f;try{_0x16a46f=JSON[_0x34fd61(0x1de)](_0x566759);}catch{throw instantApiPolicyError(_0x34fd61(0x1eb),_0x34fd61(0x1f9)+_0x439315[_0x34fd61(0x20d)]);}return assertLocalPolicyContract(_0x16a46f,_0x439315['appCode']);}function a288_0x448c(_0x4be3d4,_0x220a94){_0x4be3d4=_0x4be3d4-0x1d2;const _0x3ee489=a288_0x3ee4();let _0x448c67=_0x3ee489[_0x4be3d4];return _0x448c67;}export async function writeInstantApiPolicyConfigFile(_0x7141da,_0x20a23b,_0x420f76={}){const _0x50b662=a288_0x109450,_0x3d7d49=assertLocalPolicyContract(_0x20a23b,_0x7141da[_0x50b662(0x1f4)]),_0x3e09f2=JSON[_0x50b662(0x1fc)](_0x3d7d49,null,0x2)+'\x0a';if(Buffer[_0x50b662(0x211)](_0x3e09f2,_0x50b662(0x1fe))>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x50b662(0x1da),_0x50b662(0x1d2));await mkdir(_0x7141da[_0x50b662(0x1e1)],{'recursive':!![]});let _0x556412;try{_0x556412=await readFile(_0x7141da[_0x50b662(0x20d)],'utf8');}catch(_0x571d34){if(!isMissingFile(_0x571d34))throw instantApiPolicyError(_0x50b662(0x1e2),'Cannot\x20inspect\x20Instant\x20API\x20policy\x20file:\x20'+_0x7141da[_0x50b662(0x20d)]);}if(_0x556412===_0x3e09f2)return{'action':_0x50b662(0x1dd),'filePath':_0x7141da[_0x50b662(0x20d)]};if(_0x556412!==undefined&&!_0x420f76[_0x50b662(0x1f8)])throw instantApiPolicyError(_0x50b662(0x1f6),_0x50b662(0x209)+_0x7141da[_0x50b662(0x20d)],_0x50b662(0x1d9));if(_0x556412===undefined)try{return await writeFile(_0x7141da[_0x50b662(0x20d)],_0x3e09f2,{'encoding':_0x50b662(0x1fe),'flag':'wx'}),{'action':_0x50b662(0x1db),'filePath':_0x7141da[_0x50b662(0x20d)]};}catch(_0xddbdef){if(!isAlreadyExists(_0xddbdef))throw instantApiPolicyError(_0x50b662(0x1d8),'Cannot\x20write\x20Instant\x20API\x20policy\x20file:\x20'+_0x7141da[_0x50b662(0x20d)]);if(!_0x420f76[_0x50b662(0x1f8)])throw instantApiPolicyError(_0x50b662(0x1f6),'Instant\x20API\x20policy\x20file\x20was\x20created\x20concurrently:\x20'+_0x7141da[_0x50b662(0x20d)],_0x50b662(0x1f1));}const _0x554b59=resolve(dirname(_0x7141da[_0x50b662(0x20d)]),'.'+INSTANT_API_POLICY_FILE_NAME+'.'+process[_0x50b662(0x20b)]+'.'+randomUUID()+_0x50b662(0x1ff));try{await writeFile(_0x554b59,_0x3e09f2,{'encoding':_0x50b662(0x1fe),'flag':'wx'}),await rename(_0x554b59,_0x7141da[_0x50b662(0x20d)]);}catch{await unlink(_0x554b59)[_0x50b662(0x202)](()=>undefined);throw instantApiPolicyError(_0x50b662(0x1d8),_0x50b662(0x1ef)+_0x7141da['policyFilePath']);}return{'action':_0x50b662(0x1d4),'filePath':_0x7141da['policyFilePath']};}function assertSafeAppCode(_0x38c64f){const _0x6a4125=a288_0x109450,_0x5b1673=_0x38c64f[_0x6a4125(0x1f3)]();if(!_0x5b1673||_0x5b1673!==_0x38c64f||_0x5b1673[_0x6a4125(0x203)]>0x64||_0x5b1673==='.'||_0x5b1673==='..'||_0x5b1673[_0x6a4125(0x1fb)]('/')||_0x5b1673[_0x6a4125(0x1fb)]('\x5c')||_0x5b1673[_0x6a4125(0x1fb)]('\x00'))throw instantApiPolicyError(_0x6a4125(0x201),_0x6a4125(0x210));}function assertLocalPolicyContract(_0x274451,_0x4e58c7){const _0x22cac1=a288_0x109450;if(!isObject(_0x274451))throw instantApiPolicyError(_0x22cac1(0x1eb),_0x22cac1(0x1f5));if(_0x274451[_0x22cac1(0x20a)]!=='1'&&_0x274451[_0x22cac1(0x20a)]!=='2')throw instantApiPolicyError(_0x22cac1(0x1e4),_0x22cac1(0x1fa),'version\x20is\x20the\x20JSON\x20schema\x20version;\x20published\x20history\x20uses\x20the\x20separate\x20revision\x20field.');if(_0x274451['appCode']!==_0x4e58c7)throw instantApiPolicyError(_0x22cac1(0x1d3),'Policy\x20appCode\x20must\x20match\x20the\x20selected\x20application\x20'+_0x4e58c7+'.');if(!isObject(_0x274451[_0x22cac1(0x1f0)])||typeof _0x274451[_0x22cac1(0x1f0)][_0x22cac1(0x205)]!==_0x22cac1(0x1e7))throw instantApiPolicyError(_0x22cac1(0x214),_0x22cac1(0x1e8));if(_0x274451[_0x22cac1(0x206)]!==undefined&&_0x274451[_0x22cac1(0x206)]!==null&&!Array[_0x22cac1(0x208)](_0x274451[_0x22cac1(0x206)]))throw instantApiPolicyError(_0x22cac1(0x207),'Policy\x20rules\x20must\x20be\x20an\x20array\x20or\x20null.');return _0x274451;}function isObject(_0x35269c){const _0x52e329=a288_0x109450;return _0x35269c!==null&&typeof _0x35269c==='object'&&!Array[_0x52e329(0x208)](_0x35269c);}function isMissingFile(_0x5780ca){const _0x2ec47d=a288_0x109450;return Boolean(_0x5780ca&&typeof _0x5780ca===_0x2ec47d(0x1f7)&&_0x5780ca[_0x2ec47d(0x1ee)]===_0x2ec47d(0x20e));}function isAlreadyExists(_0x3b0eb6){const _0x1d6c88=a288_0x109450;return Boolean(_0x3b0eb6&&typeof _0x3b0eb6===_0x1d6c88(0x1f7)&&_0x3b0eb6[_0x1d6c88(0x1ee)]==='EEXIST');}function a288_0x3ee4(){const _0x3fc1ef=['appCode\x20cannot\x20be\x20used\x20as\x20the\x20fixed\x20Instant\x20API\x20policy\x20directory\x20name.','byteLength','10407VxfkuV','size','instant_api_policy_defaults_invalid','Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.','instant_api_policy_app_code_mismatch','overwritten','12YbLWNq','Run\x20`rabetbase\x20instant-api-policy\x20init`\x20or\x20`rabetbase\x20instant-api-policy\x20pull`\x20first.','2617456oJCvbK','instant_api_policy_file_unwritable','Review\x20local\x20changes,\x20then\x20rerun\x20with\x20--force\x20--yes\x20if\x20replacement\x20is\x20intended.','instant_api_policy_file_too_large','created','9WMtSuf','unchanged','parse','7ZLImCo','6662788YfzugF','policyRoot','instant_api_policy_file_unreadable','Instant\x20API\x20policy\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','instant_api_policy_version_invalid','instant_api_policy_file_missing','2308230OGRoAt','string','Policy\x20defaults.instantApi\x20is\x20required.','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20UTF-8:\x20','12470EwUxVp','instant_api_policy_json_invalid','Cannot\x20read\x20Instant\x20API\x20policy\x20file:\x20','decode','code','Cannot\x20replace\x20Instant\x20API\x20policy\x20file:\x20','defaults','Review\x20the\x20file\x20before\x20retrying.','1550370PKYaje','trim','appCode','Instant\x20API\x20policy\x20JSON\x20root\x20must\x20be\x20an\x20object.','instant_api_policy_file_exists','object','force','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20JSON:\x20','Instant\x20API\x20policy\x20version\x20must\x20be\x20\x221\x22\x20or\x20\x222\x22.','includes','stringify','isFile','utf8','.tmp','207OYSUPF','instant_api_policy_app_code_invalid','catch','length','.rabetbase/instant-api-policy','instantApi','rules','instant_api_policy_rules_invalid','isArray','Instant\x20API\x20policy\x20file\x20already\x20exists:\x20','version','pid','policy.json','policyFilePath','ENOENT','152gRqdPP'];a288_0x3ee4=function(){return _0x3fc1ef;};return a288_0x3ee4();}
@@ -1 +1 @@
1
- function a289_0xbf06(_0x1cfe20,_0x28316f){_0x1cfe20=_0x1cfe20-0x160;const _0x559a38=a289_0x559a();let _0xbf0608=_0x559a38[_0x1cfe20];return _0xbf0608;}const a289_0x2288cb=a289_0xbf06;function a289_0x559a(){const _0x5d67c6=['total','toLowerCase','status','name','pathname','networkError','apiError','KB\x20Service\x20knowledge\x20search\x20response\x20is\x20missing\x20Cache-Control:\x20no-store.','get','keys','rank','headers','stringify','cli:rabetbase','finalScore','KB\x20Service\x20knowledge\x20search\x20returned\x20invalid\x20JSON.','some','any','105hllaPR','split','KB\x20Service\x20knowledge\x20search\x20failed\x20(HTTP\x20','/knowledge/search','documentId','Invalid\x20--kb-service-url:\x20expected\x20an\x20HTTPS\x20origin\x20without\x20credentials,\x20path,\x20query,\x20or\x20fragment.','Knowledge\x20search\x20appCode\x20is\x20required.','error','aborted','sort','hits','authRequired','4985376Tryxsu','no-store','entries','password','signal','number','4pGeVDT','scope','2240mMwMbw','isArray','topK','text','includes','isSafeInteger','TimeoutError','cache-control','KB\x20Service\x20knowledge\x20search\x20request\x20failed.','profile','5212592pllShw','string','Knowledge\x20search\x20cancelled.','AbortError','timingsMs','public','map','timeout','KB\x20Service\x20knowledge\x20search\x20returned\x20a\x20non-JSON\x20content\x20type.','strategyFingerprint','KB\x20Service\x20knowledge\x20search\x20request\x20timed\x20out.','username','score','https:','json','SmartCode\x20knowledge\x20search\x20returned\x20an\x20invalid\x20','16578pbrFpt','POST','scoreKind','Knowledge\x20search\x20topK\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.','hostname','response','serviceUrl','KB\x20Service\x20knowledge\x20search\x20returned\x20an\x20invalid\x20response\x20contract.','appCode','KB\x20Service\x20knowledge\x20search\x20was\x20rate\x20limited\x20(HTTP\x20429).','tags','trim','hits[','2899400GHmdZE','365983pgkUzD','chunkId','hash','cookie','length','revision','protocol','287244toGvmN','title','validation','isFinite','418047hHdZEA','development','schemaVersion','origin','test'];a289_0x559a=function(){return _0x5d67c6;};return a289_0x559a();}(function(_0x294fde,_0x253fb2){const _0x250f72=a289_0xbf06,_0x5072d8=_0x294fde();while(!![]){try{const _0x2b2801=parseInt(_0x250f72(0x168))/0x1*(-parseInt(_0x250f72(0x19c))/0x2)+parseInt(_0x250f72(0x173))/0x3+-parseInt(_0x250f72(0x16f))/0x4*(-parseInt(_0x250f72(0x18a))/0x5)+-parseInt(_0x250f72(0x196))/0x6+parseInt(_0x250f72(0x1a8))/0x7+parseInt(_0x250f72(0x167))/0x8+parseInt(_0x250f72(0x1b8))/0x9*(-parseInt(_0x250f72(0x19e))/0xa);if(_0x2b2801===_0x253fb2)break;else _0x5072d8['push'](_0x5072d8['shift']());}catch(_0x29858f){_0x5072d8['push'](_0x5072d8['shift']());}}}(a289_0x559a,0xbe2ef));import{CliError,CliErrors}from'../errors.js';const RESPONSE_KEYS=['schemaVersion',a289_0x2288cb(0x1a7),a289_0x2288cb(0x178),a289_0x2288cb(0x194),'strategyFingerprint',a289_0x2288cb(0x1ac)],HIT_KEYS=['documentId','revision',a289_0x2288cb(0x169),a289_0x2288cb(0x19d),a289_0x2288cb(0x170),'text',a289_0x2288cb(0x164),'rank','rawScore',a289_0x2288cb(0x186),a289_0x2288cb(0x1ba)];export function normalizeKbServiceOrigin(_0x41e7e3){const _0x30697c=a289_0x2288cb,_0x303782=()=>CliErrors['validation'](_0x30697c(0x18f)),_0x2df655=_0x41e7e3?.[_0x30697c(0x165)]();if(!_0x2df655||/[\u0000-\u0020\u007f]/['test'](_0x2df655)||!/^https:\/\/[^/?#@\\]+\/?$/i[_0x30697c(0x177)](_0x2df655))throw _0x303782();let _0x2de09a;try{_0x2de09a=new URL(_0x2df655);}catch{throw _0x303782();}if(_0x2de09a[_0x30697c(0x16e)]!==_0x30697c(0x1b5)||!_0x2de09a[_0x30697c(0x1bc)]||_0x2de09a[_0x30697c(0x1b3)]||_0x2de09a[_0x30697c(0x199)]||_0x2de09a[_0x30697c(0x17c)]!=='/'||_0x2de09a['search']||_0x2de09a[_0x30697c(0x16a)])throw _0x303782();return _0x2de09a[_0x30697c(0x176)];}export async function searchDirectKnowledge(_0x5c7357){const _0x4a9d70=a289_0x2288cb,_0x461006=_0x5c7357[_0x4a9d70(0x162)][_0x4a9d70(0x165)](),_0x4da22a=_0x5c7357['query'][_0x4a9d70(0x165)]();if(!_0x461006)throw CliErrors['validation'](_0x4a9d70(0x190));if(!_0x5c7357[_0x4a9d70(0x16b)][_0x4a9d70(0x165)]())throw CliErrors[_0x4a9d70(0x195)]();if(!_0x4da22a)throw CliErrors[_0x4a9d70(0x171)]('Knowledge\x20search\x20query\x20is\x20required.');validateTopK(_0x5c7357[_0x4a9d70(0x1a0)]);const _0x59e2b6=normalizeKbServiceOrigin(_0x5c7357[_0x4a9d70(0x160)]),_0xa8a941=AbortSignal[_0x4a9d70(0x1af)](0xea60),_0x5070af=_0x5c7357['signal']?AbortSignal[_0x4a9d70(0x189)]([_0x5c7357[_0x4a9d70(0x19a)],_0xa8a941]):_0xa8a941;let _0x5b4581;try{_0x5b4581=await fetch(_0x59e2b6+'/v2/development/apps/'+encodeURIComponent(_0x461006)+_0x4a9d70(0x18d),{'method':_0x4a9d70(0x1b9),'redirect':_0x4a9d70(0x191),'headers':{'Content-Type':'application/json','Cookie':_0x5c7357['cookie'],'X-Invoke-Source':_0x4a9d70(0x185)},'body':JSON[_0x4a9d70(0x184)]({'query':_0x4da22a,..._0x5c7357[_0x4a9d70(0x1a0)]!==undefined?{'topK':_0x5c7357[_0x4a9d70(0x1a0)]}:{}}),'signal':_0x5070af});}catch(_0x4e93fb){if(_0x5c7357['signal']?.[_0x4a9d70(0x192)])throw new DOMException(_0x4a9d70(0x1aa),_0x4a9d70(0x1ab));if(_0x4e93fb instanceof Error&&_0x4e93fb['name']===_0x4a9d70(0x1a4))throw CliErrors['networkError']('KB\x20Service\x20knowledge\x20search\x20request\x20timed\x20out.');throw CliErrors[_0x4a9d70(0x17d)](_0x4a9d70(0x1a6));}if(_0x5b4581[_0x4a9d70(0x17a)]===0x191)throw CliErrors['authRequired']();if(_0x5b4581[_0x4a9d70(0x17a)]===0x1ad)throw CliErrors[_0x4a9d70(0x17e)](_0x4a9d70(0x163));if(!_0x5b4581['ok'])throw CliErrors[_0x4a9d70(0x17e)](_0x4a9d70(0x18c)+_0x5b4581[_0x4a9d70(0x17a)]+').');if(!hasNoStore(_0x5b4581[_0x4a9d70(0x183)]))throw CliErrors[_0x4a9d70(0x17e)](_0x4a9d70(0x17f));if(!(_0x5b4581[_0x4a9d70(0x183)][_0x4a9d70(0x180)]('content-type')??'')[_0x4a9d70(0x179)]()[_0x4a9d70(0x1a2)]('application/json'))throw CliErrors[_0x4a9d70(0x17e)](_0x4a9d70(0x1b0));let _0x5834bd;try{_0x5834bd=await _0x5b4581[_0x4a9d70(0x1b6)]();}catch(_0x49f820){if(_0x5c7357[_0x4a9d70(0x19a)]?.['aborted'])throw new DOMException(_0x4a9d70(0x1aa),_0x4a9d70(0x1ab));if(_0xa8a941[_0x4a9d70(0x192)]||_0x49f820 instanceof Error&&_0x49f820[_0x4a9d70(0x17b)]===_0x4a9d70(0x1a4))throw CliErrors['networkError'](_0x4a9d70(0x1b2));throw CliErrors['apiError'](_0x4a9d70(0x187));}try{const _0x58c928=requireExactRecord(_0x5834bd,[_0x4a9d70(0x194),_0x4a9d70(0x1b1),_0x4a9d70(0x1ac)],_0x4a9d70(0x1bd));if(!Array['isArray'](_0x58c928[_0x4a9d70(0x194)]))throw invalidContract(_0x4a9d70(0x194));return parseDevelopmentSearchResponse({'schemaVersion':0x2,'profile':_0x4a9d70(0x174),'total':_0x58c928[_0x4a9d70(0x194)][_0x4a9d70(0x16c)],'hits':_0x58c928['hits'],'strategyFingerprint':_0x58c928[_0x4a9d70(0x1b1)],'timingsMs':_0x58c928[_0x4a9d70(0x1ac)]},_0x5c7357[_0x4a9d70(0x1a0)]??0xa);}catch(_0x1200c5){if(_0x1200c5 instanceof CliError)throw CliErrors[_0x4a9d70(0x17e)](_0x4a9d70(0x161));throw _0x1200c5;}}function validateTopK(_0x18b362){const _0x8918d5=a289_0x2288cb;if(_0x18b362!==undefined&&(!Number[_0x8918d5(0x1a3)](_0x18b362)||_0x18b362<0x1||_0x18b362>0x32))throw CliErrors['validation'](_0x8918d5(0x1bb));}function hasNoStore(_0x1900ed){const _0x1083dd=a289_0x2288cb;return(_0x1900ed[_0x1083dd(0x180)](_0x1083dd(0x1a5))??'')[_0x1083dd(0x18b)](',')[_0x1083dd(0x188)](_0x29e081=>_0x29e081[_0x1083dd(0x165)]()['toLowerCase']()===_0x1083dd(0x197));}function parseDevelopmentSearchResponse(_0x7e8618,_0xbde6e4){const _0x1ec029=a289_0x2288cb,_0x26a8bd=requireExactRecord(_0x7e8618,RESPONSE_KEYS,_0x1ec029(0x1bd));if(_0x26a8bd[_0x1ec029(0x175)]!==0x2||_0x26a8bd[_0x1ec029(0x1a7)]!==_0x1ec029(0x174))throw invalidContract(_0x1ec029(0x1a7));if(!Array[_0x1ec029(0x19f)](_0x26a8bd[_0x1ec029(0x194)])||_0x26a8bd['hits'][_0x1ec029(0x16c)]>(_0xbde6e4??0x32))throw invalidContract(_0x1ec029(0x194));if(typeof _0x26a8bd[_0x1ec029(0x1b1)]!=='string'||!/^sha256:[0-9a-f]{64}$/['test'](_0x26a8bd['strategyFingerprint']))throw invalidContract(_0x1ec029(0x1b1));const _0x59f3b9=requireRecord(_0x26a8bd[_0x1ec029(0x1ac)],'timingsMs'),_0x553045={};for(const [_0x83d38d,_0x527555]of Object[_0x1ec029(0x198)](_0x59f3b9)){if(!/^[A-Za-z][A-Za-z0-9]*$/[_0x1ec029(0x177)](_0x83d38d)||typeof _0x527555!==_0x1ec029(0x19b)||!Number[_0x1ec029(0x172)](_0x527555)||_0x527555<0x0)throw invalidContract(_0x1ec029(0x1ac));_0x553045[_0x83d38d]=_0x527555;}const _0x383492=_0x26a8bd[_0x1ec029(0x194)][_0x1ec029(0x1ae)]((_0x1a5bfe,_0x4ebd6c)=>parseHit(_0x1a5bfe,_0x4ebd6c));if(!Number['isSafeInteger'](_0x26a8bd['total'])||_0x26a8bd[_0x1ec029(0x178)]!==_0x383492[_0x1ec029(0x16c)])throw invalidContract('total');return{'schemaVersion':_0x26a8bd[_0x1ec029(0x175)],'profile':_0x26a8bd[_0x1ec029(0x1a7)],'total':_0x26a8bd[_0x1ec029(0x178)],'strategyFingerprint':_0x26a8bd[_0x1ec029(0x1b1)],'timingsMs':_0x553045,'hits':_0x383492};}function parseHit(_0x5b1bc1,_0xd6028d){const _0x4b66c9=a289_0x2288cb,_0x41b871=requireExactRecord(_0x5b1bc1,HIT_KEYS,_0x4b66c9(0x166)+_0xd6028d+']'),_0x3543fb=_0x45d025=>{const _0x16736a=_0x4b66c9,_0x308976=_0x41b871[_0x45d025];if(typeof _0x308976!==_0x16736a(0x1a9)||!_0x308976)throw invalidContract(_0x45d025);return _0x308976;};if(!Number[_0x4b66c9(0x1a3)](_0x41b871[_0x4b66c9(0x16d)])||_0x41b871[_0x4b66c9(0x16d)]<0x1)throw invalidContract('revision');if(_0x41b871[_0x4b66c9(0x19d)]!==_0x4b66c9(0x1ad)&&_0x41b871[_0x4b66c9(0x19d)]!=='company')throw invalidContract('scope');if(typeof _0x41b871[_0x4b66c9(0x170)]!==_0x4b66c9(0x1a9)||typeof _0x41b871[_0x4b66c9(0x1a1)]!==_0x4b66c9(0x1a9))throw invalidContract(_0x4b66c9(0x1a1));if(!Array['isArray'](_0x41b871['tags'])||_0x41b871[_0x4b66c9(0x164)][_0x4b66c9(0x188)](_0x230742=>typeof _0x230742!==_0x4b66c9(0x1a9)))throw invalidContract(_0x4b66c9(0x164));if(!Number['isSafeInteger'](_0x41b871['rank'])||_0x41b871[_0x4b66c9(0x182)]!==_0xd6028d+0x1)throw invalidContract(_0x4b66c9(0x182));if(!isFiniteNumber(_0x41b871['rawScore'])||!isFiniteNumber(_0x41b871['finalScore']))throw invalidContract(_0x4b66c9(0x1b4));return{'documentId':_0x3543fb(_0x4b66c9(0x18e)),'revision':_0x41b871[_0x4b66c9(0x16d)],'chunkId':_0x3543fb(_0x4b66c9(0x169)),'scope':_0x41b871[_0x4b66c9(0x19d)],'title':_0x41b871[_0x4b66c9(0x170)],'text':_0x41b871[_0x4b66c9(0x1a1)],'tags':[..._0x41b871['tags']],'rank':_0x41b871[_0x4b66c9(0x182)],'rawScore':_0x41b871['rawScore'],'finalScore':_0x41b871[_0x4b66c9(0x186)],'scoreKind':_0x3543fb(_0x4b66c9(0x1ba))};}function requireExactRecord(_0x5f4856,_0x1dccb9,_0xbb005){const _0x2dfd2d=a289_0x2288cb,_0xc1699b=requireRecord(_0x5f4856,_0xbb005),_0x436229=Object[_0x2dfd2d(0x181)](_0xc1699b)[_0x2dfd2d(0x193)](),_0x1cde76=[..._0x1dccb9][_0x2dfd2d(0x193)]();if(_0x436229['length']!==_0x1cde76[_0x2dfd2d(0x16c)]||_0x436229['some']((_0x1f96a0,_0xee474f)=>_0x1f96a0!==_0x1cde76[_0xee474f]))throw invalidContract(_0xbb005);return _0xc1699b;}function requireRecord(_0xcdbda8,_0x5ceaae){const _0xdaa76b=a289_0x2288cb;if(!_0xcdbda8||typeof _0xcdbda8!=='object'||Array[_0xdaa76b(0x19f)](_0xcdbda8))throw invalidContract(_0x5ceaae);return _0xcdbda8;}function isFiniteNumber(_0x36ec3d){const _0x56b0cb=a289_0x2288cb;return typeof _0x36ec3d===_0x56b0cb(0x19b)&&Number[_0x56b0cb(0x172)](_0x36ec3d);}function invalidContract(_0x5ee77e){const _0x5c0945=a289_0x2288cb;return CliErrors[_0x5c0945(0x17e)](_0x5c0945(0x1b7)+_0x5ee77e+'\x20contract.');}
1
+ const a289_0x5e6e62=a289_0x5be1;(function(_0x5e39a2,_0x4a945c){const _0x28e534=a289_0x5be1,_0xad8357=_0x5e39a2();while(!![]){try{const _0x44c0ff=parseInt(_0x28e534(0x1ee))/0x1+-parseInt(_0x28e534(0x1af))/0x2+parseInt(_0x28e534(0x1f2))/0x3+-parseInt(_0x28e534(0x1cc))/0x4*(parseInt(_0x28e534(0x1ba))/0x5)+parseInt(_0x28e534(0x1f4))/0x6+-parseInt(_0x28e534(0x1d0))/0x7*(-parseInt(_0x28e534(0x1ea))/0x8)+-parseInt(_0x28e534(0x1fd))/0x9;if(_0x44c0ff===_0x4a945c)break;else _0xad8357['push'](_0xad8357['shift']());}catch(_0x201e8d){_0xad8357['push'](_0xad8357['shift']());}}}(a289_0x44b0,0xb5c68));import{CliError,CliErrors}from'../errors.js';function a289_0x5be1(_0x1d67af,_0x2a18d4){_0x1d67af=_0x1d67af-0x1a7;const _0x44b080=a289_0x44b0();let _0x5be18e=_0x44b080[_0x1d67af];return _0x5be18e;}function a289_0x44b0(){const _0x162c79=['documentId','49236zWaXaO','stringify','sort','POST','7NuTyby','length','some','finalScore','json','isSafeInteger','KB\x20Service\x20knowledge\x20search\x20request\x20timed\x20out.','public','signal','score','total','scope','authRequired','get','timingsMs','strategyFingerprint','name','revision','rank','origin','Knowledge\x20search\x20cancelled.','appCode','aborted','AbortError','entries','status','2901056xlHzco','KB\x20Service\x20knowledge\x20search\x20returned\x20invalid\x20JSON.','search','response','1296252DybqSu','timeout','apiError','Knowledge\x20search\x20appCode\x20is\x20required.','4042506FvWJpl','any','2253120ncjmqT','SmartCode\x20knowledge\x20search\x20returned\x20an\x20invalid\x20','title','Invalid\x20--kb-service-url:\x20expected\x20an\x20HTTPS\x20origin\x20without\x20credentials,\x20path,\x20query,\x20or\x20fragment.','profile','cli:rabetbase','toLowerCase','hits[','rawScore','13024800IMgjcp','Knowledge\x20search\x20query\x20is\x20required.','hits','query','test','TimeoutError','string','application/json','keys','927846qREhrz','schemaVersion','validation','trim','hostname','KB\x20Service\x20knowledge\x20search\x20returned\x20an\x20invalid\x20response\x20contract.','networkError','hash','cookie','development','KB\x20Service\x20knowledge\x20search\x20response\x20is\x20missing\x20Cache-Control:\x20no-store.','295DTPGfR','company','isFinite','tags','text','scoreKind','serviceUrl','\x20contract.','KB\x20Service\x20knowledge\x20search\x20request\x20failed.','topK','split','headers','isArray','/v2/development/apps/','map','Knowledge\x20search\x20topK\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.','KB\x20Service\x20knowledge\x20search\x20failed\x20(HTTP\x20'];a289_0x44b0=function(){return _0x162c79;};return a289_0x44b0();}const RESPONSE_KEYS=['schemaVersion',a289_0x5e6e62(0x1f8),a289_0x5e6e62(0x1da),a289_0x5e6e62(0x1a8),'strategyFingerprint',a289_0x5e6e62(0x1de)],HIT_KEYS=[a289_0x5e6e62(0x1cb),a289_0x5e6e62(0x1e1),'chunkId',a289_0x5e6e62(0x1db),a289_0x5e6e62(0x1f6),a289_0x5e6e62(0x1be),'tags',a289_0x5e6e62(0x1e2),a289_0x5e6e62(0x1fc),a289_0x5e6e62(0x1d3),a289_0x5e6e62(0x1bf)];export function normalizeKbServiceOrigin(_0x432eb5){const _0x3033ce=a289_0x5e6e62,_0x4ec0fc=()=>CliErrors[_0x3033ce(0x1b1)](_0x3033ce(0x1f7)),_0x29d940=_0x432eb5?.[_0x3033ce(0x1b2)]();if(!_0x29d940||/[\u0000-\u0020\u007f]/[_0x3033ce(0x1aa)](_0x29d940)||!/^https:\/\/[^/?#@\\]+\/?$/i[_0x3033ce(0x1aa)](_0x29d940))throw _0x4ec0fc();let _0x52e8ec;try{_0x52e8ec=new URL(_0x29d940);}catch{throw _0x4ec0fc();}if(_0x52e8ec['protocol']!=='https:'||!_0x52e8ec[_0x3033ce(0x1b3)]||_0x52e8ec['username']||_0x52e8ec['password']||_0x52e8ec['pathname']!=='/'||_0x52e8ec[_0x3033ce(0x1ec)]||_0x52e8ec[_0x3033ce(0x1b6)])throw _0x4ec0fc();return _0x52e8ec[_0x3033ce(0x1e3)];}export async function searchDirectKnowledge(_0x2c028f){const _0x119e30=a289_0x5e6e62,_0x304ee2=_0x2c028f[_0x119e30(0x1e5)][_0x119e30(0x1b2)](),_0x26178e=_0x2c028f[_0x119e30(0x1a9)][_0x119e30(0x1b2)]();if(!_0x304ee2)throw CliErrors[_0x119e30(0x1b1)](_0x119e30(0x1f1));if(!_0x2c028f['cookie'][_0x119e30(0x1b2)]())throw CliErrors['authRequired']();if(!_0x26178e)throw CliErrors[_0x119e30(0x1b1)](_0x119e30(0x1a7));validateTopK(_0x2c028f[_0x119e30(0x1c3)]);const _0x19977b=normalizeKbServiceOrigin(_0x2c028f[_0x119e30(0x1c0)]),_0x14109c=AbortSignal[_0x119e30(0x1ef)](0xea60),_0x51d458=_0x2c028f[_0x119e30(0x1d8)]?AbortSignal[_0x119e30(0x1f3)]([_0x2c028f[_0x119e30(0x1d8)],_0x14109c]):_0x14109c;let _0x57981b;try{_0x57981b=await fetch(_0x19977b+_0x119e30(0x1c7)+encodeURIComponent(_0x304ee2)+'/knowledge/search',{'method':_0x119e30(0x1cf),'redirect':'error','headers':{'Content-Type':'application/json','Cookie':_0x2c028f[_0x119e30(0x1b7)],'X-Invoke-Source':_0x119e30(0x1f9)},'body':JSON[_0x119e30(0x1cd)]({'query':_0x26178e,..._0x2c028f[_0x119e30(0x1c3)]!==undefined?{'topK':_0x2c028f[_0x119e30(0x1c3)]}:{}}),'signal':_0x51d458});}catch(_0x494c25){if(_0x2c028f[_0x119e30(0x1d8)]?.[_0x119e30(0x1e6)])throw new DOMException(_0x119e30(0x1e4),_0x119e30(0x1e7));if(_0x494c25 instanceof Error&&_0x494c25[_0x119e30(0x1e0)]===_0x119e30(0x1ab))throw CliErrors[_0x119e30(0x1b5)](_0x119e30(0x1d6));throw CliErrors['networkError'](_0x119e30(0x1c2));}if(_0x57981b[_0x119e30(0x1e9)]===0x191)throw CliErrors[_0x119e30(0x1dc)]();if(_0x57981b[_0x119e30(0x1e9)]===0x1ad)throw CliErrors[_0x119e30(0x1f0)]('KB\x20Service\x20knowledge\x20search\x20was\x20rate\x20limited\x20(HTTP\x20429).');if(!_0x57981b['ok'])throw CliErrors[_0x119e30(0x1f0)](_0x119e30(0x1ca)+_0x57981b[_0x119e30(0x1e9)]+').');if(!hasNoStore(_0x57981b['headers']))throw CliErrors[_0x119e30(0x1f0)](_0x119e30(0x1b9));if(!(_0x57981b[_0x119e30(0x1c5)][_0x119e30(0x1dd)]('content-type')??'')[_0x119e30(0x1fa)]()['includes'](_0x119e30(0x1ad)))throw CliErrors[_0x119e30(0x1f0)]('KB\x20Service\x20knowledge\x20search\x20returned\x20a\x20non-JSON\x20content\x20type.');let _0x5843f6;try{_0x5843f6=await _0x57981b[_0x119e30(0x1d4)]();}catch(_0x25dbad){if(_0x2c028f[_0x119e30(0x1d8)]?.[_0x119e30(0x1e6)])throw new DOMException('Knowledge\x20search\x20cancelled.',_0x119e30(0x1e7));if(_0x14109c[_0x119e30(0x1e6)]||_0x25dbad instanceof Error&&_0x25dbad['name']===_0x119e30(0x1ab))throw CliErrors[_0x119e30(0x1b5)]('KB\x20Service\x20knowledge\x20search\x20request\x20timed\x20out.');throw CliErrors[_0x119e30(0x1f0)](_0x119e30(0x1eb));}try{const _0x2743c0=requireExactRecord(_0x5843f6,[_0x119e30(0x1a8),_0x119e30(0x1df),'timingsMs'],_0x119e30(0x1ed));if(!Array[_0x119e30(0x1c6)](_0x2743c0[_0x119e30(0x1a8)]))throw invalidContract('hits');return parseDevelopmentSearchResponse({'schemaVersion':0x2,'profile':_0x119e30(0x1b8),'total':_0x2743c0[_0x119e30(0x1a8)][_0x119e30(0x1d1)],'hits':_0x2743c0['hits'],'strategyFingerprint':_0x2743c0[_0x119e30(0x1df)],'timingsMs':_0x2743c0[_0x119e30(0x1de)]},_0x2c028f[_0x119e30(0x1c3)]??0xa);}catch(_0x1e57b9){if(_0x1e57b9 instanceof CliError)throw CliErrors['apiError'](_0x119e30(0x1b4));throw _0x1e57b9;}}function validateTopK(_0x211a6){const _0x364bd6=a289_0x5e6e62;if(_0x211a6!==undefined&&(!Number[_0x364bd6(0x1d5)](_0x211a6)||_0x211a6<0x1||_0x211a6>0x32))throw CliErrors['validation'](_0x364bd6(0x1c9));}function hasNoStore(_0x26dc60){const _0x4f9f51=a289_0x5e6e62;return(_0x26dc60['get']('cache-control')??'')[_0x4f9f51(0x1c4)](',')[_0x4f9f51(0x1d2)](_0x5664e8=>_0x5664e8[_0x4f9f51(0x1b2)]()[_0x4f9f51(0x1fa)]()==='no-store');}function parseDevelopmentSearchResponse(_0x499647,_0x2c5e78){const _0x2a1a92=a289_0x5e6e62,_0x1a8c57=requireExactRecord(_0x499647,RESPONSE_KEYS,_0x2a1a92(0x1ed));if(_0x1a8c57[_0x2a1a92(0x1b0)]!==0x2||_0x1a8c57[_0x2a1a92(0x1f8)]!==_0x2a1a92(0x1b8))throw invalidContract(_0x2a1a92(0x1f8));if(!Array[_0x2a1a92(0x1c6)](_0x1a8c57[_0x2a1a92(0x1a8)])||_0x1a8c57[_0x2a1a92(0x1a8)][_0x2a1a92(0x1d1)]>(_0x2c5e78??0x32))throw invalidContract(_0x2a1a92(0x1a8));if(typeof _0x1a8c57[_0x2a1a92(0x1df)]!=='string'||!/^sha256:[0-9a-f]{64}$/[_0x2a1a92(0x1aa)](_0x1a8c57[_0x2a1a92(0x1df)]))throw invalidContract(_0x2a1a92(0x1df));const _0x506986=requireRecord(_0x1a8c57[_0x2a1a92(0x1de)],_0x2a1a92(0x1de)),_0xce60ea={};for(const [_0x337041,_0x2586cc]of Object[_0x2a1a92(0x1e8)](_0x506986)){if(!/^[A-Za-z][A-Za-z0-9]*$/[_0x2a1a92(0x1aa)](_0x337041)||typeof _0x2586cc!=='number'||!Number[_0x2a1a92(0x1bc)](_0x2586cc)||_0x2586cc<0x0)throw invalidContract(_0x2a1a92(0x1de));_0xce60ea[_0x337041]=_0x2586cc;}const _0x53a121=_0x1a8c57[_0x2a1a92(0x1a8)][_0x2a1a92(0x1c8)]((_0x45544b,_0x528567)=>parseHit(_0x45544b,_0x528567));if(!Number['isSafeInteger'](_0x1a8c57[_0x2a1a92(0x1da)])||_0x1a8c57['total']!==_0x53a121[_0x2a1a92(0x1d1)])throw invalidContract(_0x2a1a92(0x1da));return{'schemaVersion':_0x1a8c57[_0x2a1a92(0x1b0)],'profile':_0x1a8c57['profile'],'total':_0x1a8c57[_0x2a1a92(0x1da)],'strategyFingerprint':_0x1a8c57[_0x2a1a92(0x1df)],'timingsMs':_0xce60ea,'hits':_0x53a121};}function parseHit(_0x40011a,_0x41bb49){const _0x486a71=a289_0x5e6e62,_0x80d6f5=requireExactRecord(_0x40011a,HIT_KEYS,_0x486a71(0x1fb)+_0x41bb49+']'),_0x2d03a8=_0x2a0037=>{const _0x3dfcce=_0x486a71,_0x5f595e=_0x80d6f5[_0x2a0037];if(typeof _0x5f595e!==_0x3dfcce(0x1ac)||!_0x5f595e)throw invalidContract(_0x2a0037);return _0x5f595e;};if(!Number['isSafeInteger'](_0x80d6f5[_0x486a71(0x1e1)])||_0x80d6f5[_0x486a71(0x1e1)]<0x1)throw invalidContract('revision');if(_0x80d6f5[_0x486a71(0x1db)]!==_0x486a71(0x1d7)&&_0x80d6f5[_0x486a71(0x1db)]!==_0x486a71(0x1bb))throw invalidContract(_0x486a71(0x1db));if(typeof _0x80d6f5[_0x486a71(0x1f6)]!==_0x486a71(0x1ac)||typeof _0x80d6f5[_0x486a71(0x1be)]!==_0x486a71(0x1ac))throw invalidContract(_0x486a71(0x1be));if(!Array[_0x486a71(0x1c6)](_0x80d6f5['tags'])||_0x80d6f5[_0x486a71(0x1bd)][_0x486a71(0x1d2)](_0x1499b8=>typeof _0x1499b8!==_0x486a71(0x1ac)))throw invalidContract('tags');if(!Number['isSafeInteger'](_0x80d6f5[_0x486a71(0x1e2)])||_0x80d6f5[_0x486a71(0x1e2)]!==_0x41bb49+0x1)throw invalidContract(_0x486a71(0x1e2));if(!isFiniteNumber(_0x80d6f5[_0x486a71(0x1fc)])||!isFiniteNumber(_0x80d6f5[_0x486a71(0x1d3)]))throw invalidContract(_0x486a71(0x1d9));return{'documentId':_0x2d03a8('documentId'),'revision':_0x80d6f5[_0x486a71(0x1e1)],'chunkId':_0x2d03a8('chunkId'),'scope':_0x80d6f5['scope'],'title':_0x80d6f5['title'],'text':_0x80d6f5[_0x486a71(0x1be)],'tags':[..._0x80d6f5[_0x486a71(0x1bd)]],'rank':_0x80d6f5[_0x486a71(0x1e2)],'rawScore':_0x80d6f5[_0x486a71(0x1fc)],'finalScore':_0x80d6f5['finalScore'],'scoreKind':_0x2d03a8(_0x486a71(0x1bf))};}function requireExactRecord(_0xb5d29f,_0x29182e,_0xf77aed){const _0x23a1bf=a289_0x5e6e62,_0x4181a6=requireRecord(_0xb5d29f,_0xf77aed),_0x3bd792=Object[_0x23a1bf(0x1ae)](_0x4181a6)[_0x23a1bf(0x1ce)](),_0x347932=[..._0x29182e][_0x23a1bf(0x1ce)]();if(_0x3bd792[_0x23a1bf(0x1d1)]!==_0x347932['length']||_0x3bd792[_0x23a1bf(0x1d2)]((_0x487fa5,_0x5947f2)=>_0x487fa5!==_0x347932[_0x5947f2]))throw invalidContract(_0xf77aed);return _0x4181a6;}function requireRecord(_0x5d0e16,_0x3ef359){const _0x3ae17c=a289_0x5e6e62;if(!_0x5d0e16||typeof _0x5d0e16!=='object'||Array[_0x3ae17c(0x1c6)](_0x5d0e16))throw invalidContract(_0x3ef359);return _0x5d0e16;}function isFiniteNumber(_0x399fc7){const _0x4494e2=a289_0x5e6e62;return typeof _0x399fc7==='number'&&Number[_0x4494e2(0x1bc)](_0x399fc7);}function invalidContract(_0x3816d2){const _0x343fea=a289_0x5e6e62;return CliErrors['apiError'](_0x343fea(0x1f5)+_0x3816d2+_0x343fea(0x1c1));}
@@ -1 +1 @@
1
- const a290_0x597056=a290_0x88cc;function a290_0x2cc4(){const _0xf10d04=['toUpperCase','2065512LAiXnp','7209990eLHwLi','appPagesDir','.json','validation','Unsupported\x20file\x20in\x20page\x20directory:\x20','Page\x20directory\x20not\x20found:\x20','412334XWQUJd','4osmgpo','isDirectory','localeCompare','24498180GxhZZJ','cwd','utf8','1531461DmnNyz','split','F_OK','.rabetbase','flagMissing','Page\x20directory\x20is\x20not\x20a\x20directory:\x20','459925Qjdijt','1144801DEHXwz','name','4Jhkipu','isFile','page','36ruJvZb'];a290_0x2cc4=function(){return _0xf10d04;};return a290_0x2cc4();}(function(_0x5e668e,_0x63bc54){const _0x5063bd=a290_0x88cc,_0x19b17c=_0x5e668e();while(!![]){try{const _0x28029d=-parseInt(_0x5063bd(0x1fa))/0x1*(parseInt(_0x5063bd(0x1f9))/0x2)+-parseInt(_0x5063bd(0x1e4))/0x3*(-parseInt(_0x5063bd(0x1ed))/0x4)+-parseInt(_0x5063bd(0x1ea))/0x5+parseInt(_0x5063bd(0x1f0))/0x6*(-parseInt(_0x5063bd(0x1eb))/0x7)+parseInt(_0x5063bd(0x1f2))/0x8+-parseInt(_0x5063bd(0x1f3))/0x9+parseInt(_0x5063bd(0x1e1))/0xa;if(_0x28029d===_0x63bc54)break;else _0x19b17c['push'](_0x19b17c['shift']());}catch(_0x11b83d){_0x19b17c['push'](_0x19b17c['shift']());}}}(a290_0x2cc4,0x7ed31));import{constants}from'node:fs';import{access,lstat,mkdir,readFile,readdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{CliErrors}from'../../errors.js';export function loadPageProjectConfig(_0x4a6c41,_0x216c78=process[a290_0x597056(0x1e2)]()){const _0x16d37f=a290_0x597056,_0x358434=resolve(_0x216c78),_0x34870d=join(_0x358434,_0x16d37f(0x1e7),_0x16d37f(0x1ef));return{'projectRoot':_0x358434,'pagesBaseDir':_0x34870d,'appPagesDir':join(_0x34870d,_0x4a6c41),'lockFilePath':join(_0x358434,'.rabetbase','page.lock.json')};}export function buildPageFileName(_0xbd3ca3,_0x58a4aa){const _0x351cce=a290_0x597056;return _0xbd3ca3+'-'+_0x58a4aa[_0x351cce(0x1f1)]()+_0x351cce(0x1f5);}export function resolvePageFilePath(_0x4a7d60,_0x58f9bf,_0x436cf4){const _0x2a927e=a290_0x597056;return join(_0x4a7d60[_0x2a927e(0x1f4)],buildPageFileName(_0x58f9bf,_0x436cf4));}function a290_0x88cc(_0x29f45c,_0x4f5c8e){_0x29f45c=_0x29f45c-0x1df;const _0x2cc4eb=a290_0x2cc4();let _0x88cc0c=_0x2cc4eb[_0x29f45c];return _0x88cc0c;}export async function ensureParentDirectory(_0x55c763){await mkdir(dirname(_0x55c763),{'recursive':!![]});}export async function fileExists(_0x4893ff){const _0x4a0001=a290_0x597056;try{return await access(_0x4893ff,constants[_0x4a0001(0x1e6)]),!![];}catch{return![];}}export async function readCustomPageDirectory(_0x13766f){const _0x599c98=a290_0x597056,_0x121a43=_0x13766f['trim']();if(!_0x121a43)throw CliErrors[_0x599c98(0x1e8)]('page-dir');const _0x413447=resolve(_0x121a43);let _0x4c65f5;try{_0x4c65f5=await lstat(_0x413447);}catch{throw CliErrors['validation'](_0x599c98(0x1f8)+_0x121a43);}if(!_0x4c65f5[_0x599c98(0x1df)]())throw CliErrors[_0x599c98(0x1f6)](_0x599c98(0x1e9)+_0x121a43);const _0x4a904c={};return await readDirectory(_0x413447,_0x413447,_0x4a904c),_0x4a904c;}async function readDirectory(_0x30f442,_0x4a2ef6,_0x3829c3){const _0x270e0a=a290_0x597056,_0x2b00cf=await readdir(_0x4a2ef6,{'withFileTypes':!![]});for(const _0x43d7e8 of _0x2b00cf['sort']((_0x23aa3a,_0x24bc3f)=>_0x23aa3a[_0x270e0a(0x1ec)][_0x270e0a(0x1e0)](_0x24bc3f[_0x270e0a(0x1ec)]))){const _0x2e62b5=join(_0x4a2ef6,_0x43d7e8[_0x270e0a(0x1ec)]);if(_0x43d7e8[_0x270e0a(0x1df)]()){await readDirectory(_0x30f442,_0x2e62b5,_0x3829c3);continue;}if(!_0x43d7e8[_0x270e0a(0x1ee)]())throw CliErrors['validation'](_0x270e0a(0x1f7)+_0x2e62b5);_0x3829c3[relative(_0x30f442,_0x2e62b5)[_0x270e0a(0x1e5)](sep)['join']('/')]=await readFile(_0x2e62b5,_0x270e0a(0x1e3));}}
1
+ const a290_0x51be12=a290_0x440f;(function(_0x365767,_0x109c07){const _0x294dc9=a290_0x440f,_0x444508=_0x365767();while(!![]){try{const _0x477d9e=-parseInt(_0x294dc9(0x184))/0x1+-parseInt(_0x294dc9(0x19b))/0x2*(parseInt(_0x294dc9(0x19d))/0x3)+parseInt(_0x294dc9(0x19c))/0x4+parseInt(_0x294dc9(0x18d))/0x5+parseInt(_0x294dc9(0x194))/0x6*(parseInt(_0x294dc9(0x198))/0x7)+-parseInt(_0x294dc9(0x190))/0x8+parseInt(_0x294dc9(0x19a))/0x9;if(_0x477d9e===_0x109c07)break;else _0x444508['push'](_0x444508['shift']());}catch(_0x65c0cf){_0x444508['push'](_0x444508['shift']());}}}(a290_0x598c,0xb1948));import{constants}from'node:fs';function a290_0x598c(){const _0x412773=['560366vKebeU','1329952hgOwdV','15YplYtN','isDirectory','F_OK','925805ubMCNb','split','name','appPagesDir','join','Page\x20directory\x20is\x20not\x20a\x20directory:\x20','flagMissing','.rabetbase','page-dir','4006670lgyIfh','localeCompare','Unsupported\x20file\x20in\x20page\x20directory:\x20','10762952OySGst','page.lock.json','Page\x20directory\x20not\x20found:\x20','isFile','8397390avMCuE','toUpperCase','validation','cwd','7VsDNAX','.json','16794630HeVsFc'];a290_0x598c=function(){return _0x412773;};return a290_0x598c();}import{access,lstat,mkdir,readFile,readdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';function a290_0x440f(_0x15288f,_0x35deaa){_0x15288f=_0x15288f-0x184;const _0x598cfb=a290_0x598c();let _0x440f68=_0x598cfb[_0x15288f];return _0x440f68;}import{CliErrors}from'../../errors.js';export function loadPageProjectConfig(_0x2816bc,_0x57f425=process[a290_0x51be12(0x197)]()){const _0x44228a=a290_0x51be12,_0x24f9e5=resolve(_0x57f425),_0x449f01=join(_0x24f9e5,_0x44228a(0x18b),'page');return{'projectRoot':_0x24f9e5,'pagesBaseDir':_0x449f01,'appPagesDir':join(_0x449f01,_0x2816bc),'lockFilePath':join(_0x24f9e5,'.rabetbase',_0x44228a(0x191))};}export function buildPageFileName(_0x23dbbd,_0xe5353b){const _0x5591cc=a290_0x51be12;return _0x23dbbd+'-'+_0xe5353b[_0x5591cc(0x195)]()+_0x5591cc(0x199);}export function resolvePageFilePath(_0x4b5ed8,_0x8732b0,_0x31fbe1){const _0x187f52=a290_0x51be12;return join(_0x4b5ed8[_0x187f52(0x187)],buildPageFileName(_0x8732b0,_0x31fbe1));}export async function ensureParentDirectory(_0x41c7ec){await mkdir(dirname(_0x41c7ec),{'recursive':!![]});}export async function fileExists(_0x24e664){const _0x347340=a290_0x51be12;try{return await access(_0x24e664,constants[_0x347340(0x19f)]),!![];}catch{return![];}}export async function readCustomPageDirectory(_0x5035ee){const _0x8d64b3=a290_0x51be12,_0x289a65=_0x5035ee['trim']();if(!_0x289a65)throw CliErrors[_0x8d64b3(0x18a)](_0x8d64b3(0x18c));const _0xd6629b=resolve(_0x289a65);let _0x7dd681;try{_0x7dd681=await lstat(_0xd6629b);}catch{throw CliErrors[_0x8d64b3(0x196)](_0x8d64b3(0x192)+_0x289a65);}if(!_0x7dd681[_0x8d64b3(0x19e)]())throw CliErrors[_0x8d64b3(0x196)](_0x8d64b3(0x189)+_0x289a65);const _0x3e67bd={};return await readDirectory(_0xd6629b,_0xd6629b,_0x3e67bd),_0x3e67bd;}async function readDirectory(_0x2d4201,_0x4b510f,_0x545a7c){const _0x22d4d8=a290_0x51be12,_0x4182f8=await readdir(_0x4b510f,{'withFileTypes':!![]});for(const _0x5c6bce of _0x4182f8['sort']((_0x3d2f1a,_0x4fc1cd)=>_0x3d2f1a['name'][_0x22d4d8(0x18e)](_0x4fc1cd['name']))){const _0x220997=join(_0x4b510f,_0x5c6bce[_0x22d4d8(0x186)]);if(_0x5c6bce[_0x22d4d8(0x19e)]()){await readDirectory(_0x2d4201,_0x220997,_0x545a7c);continue;}if(!_0x5c6bce[_0x22d4d8(0x193)]())throw CliErrors['validation'](_0x22d4d8(0x18f)+_0x220997);_0x545a7c[relative(_0x2d4201,_0x220997)[_0x22d4d8(0x185)](sep)[_0x22d4d8(0x188)]('/')]=await readFile(_0x220997,'utf8');}}
@@ -1 +1 @@
1
- (function(_0xd3353d,_0x134a62){const _0x2b6d5a=a291_0x67c0,_0x368013=_0xd3353d();while(!![]){try{const _0x14493e=parseInt(_0x2b6d5a(0x132))/0x1+parseInt(_0x2b6d5a(0x136))/0x2*(-parseInt(_0x2b6d5a(0x131))/0x3)+parseInt(_0x2b6d5a(0x135))/0x4+-parseInt(_0x2b6d5a(0x139))/0x5+parseInt(_0x2b6d5a(0x137))/0x6*(parseInt(_0x2b6d5a(0x13b))/0x7)+-parseInt(_0x2b6d5a(0x133))/0x8+parseInt(_0x2b6d5a(0x130))/0x9;if(_0x14493e===_0x134a62)break;else _0x368013['push'](_0x368013['shift']());}catch(_0x207938){_0x368013['push'](_0x368013['shift']());}}}(a291_0x2a58,0xd39b7));import a291_0x4ba37c from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x53d228){const _0x59f1d9=a291_0x67c0;return JSON[_0x59f1d9(0x12e)](JSON[_0x59f1d9(0x134)](_0x53d228),null,0x2)+'\x0a';}function a291_0x67c0(_0x290d79,_0x269c9d){_0x290d79=_0x290d79-0x12d;const _0x2a58c9=a291_0x2a58();let _0x67c039=_0x2a58c9[_0x290d79];return _0x67c039;}export function computePageContentHash(_0x59f742){const _0x151e7f=a291_0x67c0;return a291_0x4ba37c[_0x151e7f(0x13a)]('md5')[_0x151e7f(0x12f)](_0x59f742)[_0x151e7f(0x138)](_0x151e7f(0x12d));}function a291_0x2a58(){const _0x42809d=['4865336bNROvE','parse','1377320YnIjxJ','699306JxzeCt','9422922OSaTay','digest','7499280wshFHF','createHash','7hbQVlr','utf8','hex','stringify','update','1450998ZmHfnz','3KKFhMW','1248380ItHtcV'];a291_0x2a58=function(){return _0x42809d;};return a291_0x2a58();}export function computeSerializedSchemaHash(_0x5814a0){return computePageContentHash(serializePageSchemaForFile(_0x5814a0));}export async function computePageFileHash(_0x7aa59a){const _0x2b2d78=a291_0x67c0,_0x41658e=await readFile(_0x7aa59a,_0x2b2d78(0x13c));return computePageContentHash(_0x41658e);}
1
+ (function(_0x3d5011,_0x4ad5dd){const _0x14c285=a291_0x243c,_0x5a4f31=_0x3d5011();while(!![]){try{const _0x126f59=-parseInt(_0x14c285(0x18b))/0x1+-parseInt(_0x14c285(0x187))/0x2*(-parseInt(_0x14c285(0x186))/0x3)+-parseInt(_0x14c285(0x17c))/0x4+parseInt(_0x14c285(0x185))/0x5*(parseInt(_0x14c285(0x18d))/0x6)+parseInt(_0x14c285(0x189))/0x7*(-parseInt(_0x14c285(0x18e))/0x8)+-parseInt(_0x14c285(0x183))/0x9+-parseInt(_0x14c285(0x18a))/0xa*(-parseInt(_0x14c285(0x17f))/0xb);if(_0x126f59===_0x4ad5dd)break;else _0x5a4f31['push'](_0x5a4f31['shift']());}catch(_0xed4ca){_0x5a4f31['push'](_0x5a4f31['shift']());}}}(a291_0x5689,0x89a93));import a291_0x1ee8ea from'node:crypto';import{readFile}from'node:fs/promises';function a291_0x5689(){const _0x1120a6=['106290KiKKFz','380574pGqTHW','hex','4364082bMBLeD','264dnbCyw','1989860rLYlFT','stringify','createHash','1452WgwcKv','utf8','parse','digest','3203676erQKNt','md5','5hoUror','24711IfLnIz','16TdKdjR','update','84511xoNofx'];a291_0x5689=function(){return _0x1120a6;};return a291_0x5689();}export function serializePageSchemaForFile(_0x169ba6){const _0x4d1e67=a291_0x243c;return JSON[_0x4d1e67(0x17d)](JSON[_0x4d1e67(0x181)](_0x169ba6),null,0x2)+'\x0a';}export function computePageContentHash(_0x69e531){const _0x592836=a291_0x243c;return a291_0x1ee8ea[_0x592836(0x17e)](_0x592836(0x184))[_0x592836(0x188)](_0x69e531)[_0x592836(0x182)](_0x592836(0x18c));}function a291_0x243c(_0x2a6e1f,_0xce0939){_0x2a6e1f=_0x2a6e1f-0x17c;const _0x5689e2=a291_0x5689();let _0x243caf=_0x5689e2[_0x2a6e1f];return _0x243caf;}export function computeSerializedSchemaHash(_0x44e610){return computePageContentHash(serializePageSchemaForFile(_0x44e610));}export async function computePageFileHash(_0x5db7a1){const _0x9f6c29=a291_0x243c,_0x324a8e=await readFile(_0x5db7a1,_0x9f6c29(0x180));return computePageContentHash(_0x324a8e);}
@@ -1 +1 @@
1
- function a292_0x5d61(_0x14024d,_0xed4004){_0x14024d=_0x14024d-0x87;const _0x23a5c7=a292_0x23a5();let _0x5d6135=_0x23a5c7[_0x14024d];return _0x5d6135;}(function(_0x158313,_0x416121){const _0x4d818=a292_0x5d61,_0x174133=_0x158313();while(!![]){try{const _0x8d6791=-parseInt(_0x4d818(0x88))/0x1+-parseInt(_0x4d818(0x92))/0x2*(parseInt(_0x4d818(0x8f))/0x3)+parseInt(_0x4d818(0x8b))/0x4*(parseInt(_0x4d818(0x95))/0x5)+-parseInt(_0x4d818(0x93))/0x6+-parseInt(_0x4d818(0x90))/0x7*(-parseInt(_0x4d818(0x94))/0x8)+-parseInt(_0x4d818(0x8e))/0x9+parseInt(_0x4d818(0x8c))/0xa;if(_0x8d6791===_0x416121)break;else _0x174133['push'](_0x174133['shift']());}catch(_0x344c68){_0x174133['push'](_0x174133['shift']());}}}(a292_0x23a5,0xbf3fd));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a292_0x23a5(){const _0x460256=['6937965QRZkJW','1651062DsAedt','14yvGlbI','code','4srDuwC','5696790FVpNdX','3753616phetxg','470385BvYZfT','utf8','stringify','parse','pages','769039kNZvuW','lastSync','apps','4SZZQep','33409730qwpOGw','object'];a292_0x23a5=function(){return _0x460256;};return a292_0x23a5();}export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x4a0dc7,_0x5868ee){const _0x3c796a=a292_0x5d61,_0x474da8={'apps':_0x4a0dc7[_0x3c796a(0x8a)]&&typeof _0x4a0dc7[_0x3c796a(0x8a)]===_0x3c796a(0x8d)?_0x4a0dc7[_0x3c796a(0x8a)]:{}};let _0x3f71cd=_0x474da8['apps'][_0x5868ee];if(!_0x3f71cd)return _0x3f71cd={'lastSync':'','pages':{}},_0x474da8[_0x3c796a(0x8a)][_0x5868ee]=_0x3f71cd,{'lockData':_0x474da8,'appLock':_0x3f71cd};return!_0x3f71cd['lastSync']&&(_0x3f71cd[_0x3c796a(0x89)]=''),(!_0x3f71cd[_0x3c796a(0x87)]||typeof _0x3f71cd[_0x3c796a(0x87)]!==_0x3c796a(0x8d))&&(_0x3f71cd['pages']={}),{'lockData':_0x474da8,'appLock':_0x3f71cd};}export async function readPageLockFile(_0x1b3ad8){const _0x324faa=a292_0x5d61;try{const _0x1cfd33=await readFile(_0x1b3ad8,_0x324faa(0x96)),_0x281162=JSON[_0x324faa(0x98)](_0x1cfd33);return{'apps':_0x281162[_0x324faa(0x8a)]&&typeof _0x281162[_0x324faa(0x8a)]==='object'?_0x281162[_0x324faa(0x8a)]:{}};}catch(_0x4c64de){if(_0x4c64de[_0x324faa(0x91)]==='ENOENT')return null;throw new Error('Failed\x20to\x20read\x20page\x20lock\x20file:\x20'+String(_0x4c64de));}}export async function writePageLockFile(_0x2d96d3,_0x17a2be){const _0x124627=a292_0x5d61;await mkdir(dirname(_0x2d96d3),{'recursive':!![]}),await writeFile(_0x2d96d3,JSON[_0x124627(0x97)](_0x17a2be,null,0x2),_0x124627(0x96));}
1
+ (function(_0x530ebb,_0x298c6e){const _0x5f4601=a292_0x2b75,_0x2e6883=_0x530ebb();while(!![]){try{const _0x221c11=-parseInt(_0x5f4601(0xc2))/0x1+parseInt(_0x5f4601(0xba))/0x2+-parseInt(_0x5f4601(0xc4))/0x3+parseInt(_0x5f4601(0xb6))/0x4*(parseInt(_0x5f4601(0xc6))/0x5)+-parseInt(_0x5f4601(0xbd))/0x6*(parseInt(_0x5f4601(0xb8))/0x7)+parseInt(_0x5f4601(0xb5))/0x8+parseInt(_0x5f4601(0xc0))/0x9;if(_0x221c11===_0x298c6e)break;else _0x2e6883['push'](_0x2e6883['shift']());}catch(_0x5e0701){_0x2e6883['push'](_0x2e6883['shift']());}}}(a292_0x1a67,0xf35f0));function a292_0x1a67(){const _0xf54c11=['lastSync','368545lxqyZk','6421168FZnsPV','68SGAjhl','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','7huYeCW','ENOENT','281140wsFYeo','utf8','parse','10954674GrxfZu','pages','stringify','14516577gCreeu','apps','498715fnDIaw','object','1463640rHbiUd'];a292_0x1a67=function(){return _0xf54c11;};return a292_0x1a67();}import{mkdir,readFile,writeFile}from'node:fs/promises';function a292_0x2b75(_0x42b8d5,_0x32ba57){_0x42b8d5=_0x42b8d5-0xb5;const _0x1a67c5=a292_0x1a67();let _0x2b7595=_0x1a67c5[_0x42b8d5];return _0x2b7595;}import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x19e404,_0x17a1fd){const _0x5dc2cb=a292_0x2b75,_0x11f95f={'apps':_0x19e404[_0x5dc2cb(0xc1)]&&typeof _0x19e404['apps']===_0x5dc2cb(0xc3)?_0x19e404[_0x5dc2cb(0xc1)]:{}};let _0x49a42f=_0x11f95f[_0x5dc2cb(0xc1)][_0x17a1fd];if(!_0x49a42f)return _0x49a42f={'lastSync':'','pages':{}},_0x11f95f[_0x5dc2cb(0xc1)][_0x17a1fd]=_0x49a42f,{'lockData':_0x11f95f,'appLock':_0x49a42f};return!_0x49a42f['lastSync']&&(_0x49a42f[_0x5dc2cb(0xc5)]=''),(!_0x49a42f['pages']||typeof _0x49a42f[_0x5dc2cb(0xbe)]!==_0x5dc2cb(0xc3))&&(_0x49a42f['pages']={}),{'lockData':_0x11f95f,'appLock':_0x49a42f};}export async function readPageLockFile(_0x5b5e2d){const _0x5a7527=a292_0x2b75;try{const _0x416b1d=await readFile(_0x5b5e2d,_0x5a7527(0xbb)),_0x1ae961=JSON[_0x5a7527(0xbc)](_0x416b1d);return{'apps':_0x1ae961[_0x5a7527(0xc1)]&&typeof _0x1ae961['apps']==='object'?_0x1ae961[_0x5a7527(0xc1)]:{}};}catch(_0xf8e0e){if(_0xf8e0e['code']===_0x5a7527(0xb9))return null;throw new Error(_0x5a7527(0xb7)+String(_0xf8e0e));}}export async function writePageLockFile(_0x334f8f,_0x403dd8){const _0x77dcb2=a292_0x2b75;await mkdir(dirname(_0x334f8f),{'recursive':!![]}),await writeFile(_0x334f8f,JSON[_0x77dcb2(0xbf)](_0x403dd8,null,0x2),_0x77dcb2(0xbb));}
@@ -1 +1 @@
1
- (function(_0xc71438,_0x50927d){const _0x5415fc=a293_0x18dc,_0x4c9138=_0xc71438();while(!![]){try{const _0x477b70=-parseInt(_0x5415fc(0xec))/0x1*(-parseInt(_0x5415fc(0xf5))/0x2)+-parseInt(_0x5415fc(0x103))/0x3+parseInt(_0x5415fc(0xfc))/0x4*(-parseInt(_0x5415fc(0xf6))/0x5)+parseInt(_0x5415fc(0x105))/0x6*(-parseInt(_0x5415fc(0xe5))/0x7)+-parseInt(_0x5415fc(0xea))/0x8*(parseInt(_0x5415fc(0xe4))/0x9)+parseInt(_0x5415fc(0xe2))/0xa*(-parseInt(_0x5415fc(0xfe))/0xb)+parseInt(_0x5415fc(0xfd))/0xc;if(_0x477b70===_0x50927d)break;else _0x4c9138['push'](_0x4c9138['shift']());}catch(_0xfe6744){_0x4c9138['push'](_0x4c9138['shift']());}}}(a293_0x166d,0x6ec4a));function a293_0x18dc(_0x47bf5e,_0x507f8c){_0x47bf5e=_0x47bf5e-0xde;const _0x166da1=a293_0x166d();let _0x18dc38=_0x166da1[_0x47bf5e];return _0x18dc38;}import{CliErrors}from'../../errors.js';export async function prepareLrSmartJsxForPush(_0xfbcde3,_0x52357a,_0x26a691){const _0x614f2f=a293_0x18dc,_0x1992ba=parseSchema(_0xfbcde3,_0x614f2f(0xef)),_0xf5dd05=parseSchema(_0x52357a,'remote'),_0x2959e3=collectLrSmartJsx(_0x1992ba,!![]);if(_0x2959e3['length']===0x0)return{'content':_0xfbcde3,'compiledNodes':0x0,'normalizedNodes':0x0};const _0x2cc364=new Map(collectLrSmartJsx(_0xf5dd05)[_0x614f2f(0x109)](_0x33f89c=>[_0x33f89c[_0x614f2f(0xe0)],_0x33f89c]));let _0xb43913=0x0,_0x339227=0x0;for(const _0x2ec093 of _0x2959e3){const _0x5db538=readNonEmptyString(_0x2ec093['render'][_0x614f2f(0xf9)]),_0x1e02c9=readNonEmptyString(_0x2ec093['render'][_0x614f2f(0xde)]),_0x15a80e=_0x2cc364['get'](_0x2ec093['key']),_0x173624=readNonEmptyString(_0x15a80e?.['render'][_0x614f2f(0xf9)]),_0x236cbd=readNonEmptyString(_0x15a80e?.['render'][_0x614f2f(0xde)]);let _0x27dbfb=![];_0x2ec093['render']['type']!=='JSFunction'&&(_0x2ec093['render'][_0x614f2f(0xe7)]='JSFunction',_0x27dbfb=!![]);!isPageContextExpression(_0x2ec093[_0x614f2f(0xf1)][_0x614f2f(0x100)])&&(_0x2ec093['props']['_context']={'type':_0x614f2f(0xf0),'value':_0x614f2f(0x106)},_0x27dbfb=!![]);if(!_0x5db538){if(!_0x1e02c9)throw CliErrors[_0x614f2f(0x101)](_0x614f2f(0xf8)+_0x2ec093[_0x614f2f(0xe6)]+_0x614f2f(0xf2),'Add\x20JSX\x20source\x20in\x20the\x20page\x20editor\x20or\x20remove\x20the\x20incomplete\x20component.');if(_0x27dbfb)_0x339227+=0x1;continue;}const _0x5cdc50=!_0x15a80e||_0x5db538!==_0x173624,_0x320f04=!_0x1e02c9;if(!_0x5cdc50&&_0x1e02c9&&_0x236cbd&&_0x1e02c9!==_0x236cbd)throw CliErrors[_0x614f2f(0x101)](_0x614f2f(0xf8)+_0x2ec093['label']+_0x614f2f(0xe8),_0x614f2f(0x102));if(_0x5cdc50||_0x320f04||!_0x236cbd){const _0x227708=readNonEmptyString(await _0x26a691(_0x5db538));if(!_0x227708)throw CliErrors['apiError']('LrSmartJsx\x20compilation\x20returned\x20no\x20code\x20for\x20node\x20\x22'+_0x2ec093['label']+'\x22.');_0x2ec093[_0x614f2f(0xed)]['value']=_0x227708,_0xb43913+=0x1,_0x27dbfb=!![];}if(_0x27dbfb)_0x339227+=0x1;}if(_0x339227===0x0)return{'content':_0xfbcde3,'compiledNodes':_0xb43913,'normalizedNodes':_0x339227};return{'content':JSON[_0x614f2f(0xee)](_0x1992ba),'compiledNodes':_0xb43913,'normalizedNodes':_0x339227};}function a293_0x166d(){const _0x2a1745=['\x22\x20has\x20missing\x20or\x20invalid\x20props.render.','152183uXyDRK','render','stringify','local','JSExpression','props','\x22\x20is\x20missing\x20both\x20render.source\x20and\x20render.value.','Set\x20props.render\x20to\x20an\x20object\x20containing\x20render.source\x20or\x20render.value.','object','8DpPZMG','5XqWgwh','LrSmartJsx','LrSmartJsx\x20node\x20\x22','source','entries','string','2343108xcesEv','12259488QaFsGV','209gfBbQi','Invalid\x20JSON\x20in\x20','_context','validation','Edit\x20render.source\x20instead;\x20render.value\x20is\x20generated\x20during\x20page\x20push.','915969VRybeB','path:','17958kDkjYT','this','\x20page\x20schema.','\x22\x20has\x20missing\x20or\x20invalid\x20props.','map','value','forEach','key','componentName','63490FFLvnW','isArray','9BlWVtT','56SDNsyU','label','type','\x22\x20has\x20a\x20manually\x20changed\x20render.value.','trim','1127800jYnyZl'];a293_0x166d=function(){return _0x2a1745;};return a293_0x166d();}function parseSchema(_0x53d6cb,_0x3e69f9){const _0x189b03=a293_0x18dc;try{return JSON['parse'](_0x53d6cb);}catch{throw CliErrors[_0x189b03(0x101)](_0x189b03(0xff)+_0x3e69f9+_0x189b03(0x107));}}function collectLrSmartJsx(_0x4586d3,_0x6b41e8=![]){const _0x3b7fa2=[],_0x1d131d=(_0x28d5e8,_0x3da570)=>{const _0x3cf65c=a293_0x18dc;if(Array[_0x3cf65c(0xe3)](_0x28d5e8)){_0x28d5e8[_0x3cf65c(0xdf)]((_0x5d536b,_0x3e87cd)=>_0x1d131d(_0x5d536b,_0x3da570+'['+_0x3e87cd+']'));return;}if(!isObject(_0x28d5e8))return;if(_0x28d5e8['componentName']===_0x3cf65c(0xf7)){const _0x148d7b=readNonEmptyString(_0x28d5e8['id']),_0x4157f4=_0x148d7b||_0x3da570,_0x37fadc=isObject(_0x28d5e8[_0x3cf65c(0xf1)])?_0x28d5e8[_0x3cf65c(0xf1)]:undefined;if(!_0x37fadc){if(_0x6b41e8)throw CliErrors[_0x3cf65c(0x101)](_0x3cf65c(0xf8)+_0x4157f4+_0x3cf65c(0x108),'Set\x20props\x20to\x20an\x20object\x20containing\x20a\x20render\x20object.');return;}const _0x2eee0c=isObject(_0x37fadc[_0x3cf65c(0xed)])?_0x37fadc['render']:undefined;if(!_0x2eee0c){if(_0x6b41e8)throw CliErrors[_0x3cf65c(0x101)](_0x3cf65c(0xf8)+_0x4157f4+_0x3cf65c(0xeb),_0x3cf65c(0xf3));return;}_0x3b7fa2['push']({'key':_0x148d7b?'id:'+_0x148d7b:_0x3cf65c(0x104)+_0x3da570,'label':_0x4157f4,'props':_0x37fadc,'render':_0x2eee0c});}for(const [_0x130623,_0x3d06a8]of Object[_0x3cf65c(0xfa)](_0x28d5e8)){if(_0x130623===_0x3cf65c(0xf1)&&_0x28d5e8[_0x3cf65c(0xe1)]===_0x3cf65c(0xf7))continue;_0x1d131d(_0x3d06a8,_0x3da570+'.'+_0x130623);}};return _0x1d131d(_0x4586d3,'$'),_0x3b7fa2;}function isObject(_0x240088){const _0x27c015=a293_0x18dc;return Boolean(_0x240088)&&typeof _0x240088===_0x27c015(0xf4)&&!Array[_0x27c015(0xe3)](_0x240088);}function readNonEmptyString(_0x3bc8ce){const _0x47a959=a293_0x18dc;return typeof _0x3bc8ce===_0x47a959(0xfb)&&_0x3bc8ce[_0x47a959(0xe9)]()?_0x3bc8ce:undefined;}function isPageContextExpression(_0xbcee38){const _0x37d777=a293_0x18dc;return isObject(_0xbcee38)&&_0xbcee38[_0x37d777(0xe7)]===_0x37d777(0xf0)&&_0xbcee38['value']==='this';}
1
+ (function(_0x297fa2,_0x5b6f48){const _0x1db742=a293_0x1f51,_0x8bb4a=_0x297fa2();while(!![]){try{const _0x3cf145=parseInt(_0x1db742(0x87))/0x1+-parseInt(_0x1db742(0x72))/0x2*(-parseInt(_0x1db742(0x88))/0x3)+-parseInt(_0x1db742(0x90))/0x4+-parseInt(_0x1db742(0x68))/0x5+parseInt(_0x1db742(0x8b))/0x6*(parseInt(_0x1db742(0x75))/0x7)+parseInt(_0x1db742(0x82))/0x8*(-parseInt(_0x1db742(0x73))/0x9)+-parseInt(_0x1db742(0x6a))/0xa;if(_0x3cf145===_0x5b6f48)break;else _0x8bb4a['push'](_0x8bb4a['shift']());}catch(_0x4bb70d){_0x8bb4a['push'](_0x8bb4a['shift']());}}}(a293_0xd9a3,0x70955));import{CliErrors}from'../../errors.js';export async function prepareLrSmartJsxForPush(_0x365e68,_0x4bcf63,_0x30b9fe){const _0x4bd516=a293_0x1f51,_0x4d8ace=parseSchema(_0x365e68,'local'),_0x4b80d7=parseSchema(_0x4bcf63,_0x4bd516(0x8c)),_0xd38b3=collectLrSmartJsx(_0x4d8ace,!![]);if(_0xd38b3[_0x4bd516(0x86)]===0x0)return{'content':_0x365e68,'compiledNodes':0x0,'normalizedNodes':0x0};const _0x42bc4a=new Map(collectLrSmartJsx(_0x4b80d7)['map'](_0x572883=>[_0x572883[_0x4bd516(0x7d)],_0x572883]));let _0x477358=0x0,_0x571e64=0x0;for(const _0x4673b4 of _0xd38b3){const _0x8ad7=readNonEmptyString(_0x4673b4[_0x4bd516(0x70)][_0x4bd516(0x83)]),_0x47a201=readNonEmptyString(_0x4673b4[_0x4bd516(0x70)]['value']),_0x42a67b=_0x42bc4a[_0x4bd516(0x80)](_0x4673b4[_0x4bd516(0x7d)]),_0x5530e0=readNonEmptyString(_0x42a67b?.[_0x4bd516(0x70)][_0x4bd516(0x83)]),_0x561dd5=readNonEmptyString(_0x42a67b?.[_0x4bd516(0x70)][_0x4bd516(0x71)]);let _0x4f301f=![];_0x4673b4['render'][_0x4bd516(0x65)]!==_0x4bd516(0x8e)&&(_0x4673b4[_0x4bd516(0x70)][_0x4bd516(0x65)]='JSFunction',_0x4f301f=!![]);!isPageContextExpression(_0x4673b4[_0x4bd516(0x76)][_0x4bd516(0x77)])&&(_0x4673b4[_0x4bd516(0x76)][_0x4bd516(0x77)]={'type':_0x4bd516(0x81),'value':_0x4bd516(0x7c)},_0x4f301f=!![]);if(!_0x8ad7){if(!_0x47a201)throw CliErrors[_0x4bd516(0x79)]('LrSmartJsx\x20node\x20\x22'+_0x4673b4[_0x4bd516(0x8f)]+_0x4bd516(0x7b),_0x4bd516(0x85));if(_0x4f301f)_0x571e64+=0x1;continue;}const _0x3d0afc=!_0x42a67b||_0x8ad7!==_0x5530e0,_0xd6e2d2=!_0x47a201;if(!_0x3d0afc&&_0x47a201&&_0x561dd5&&_0x47a201!==_0x561dd5)throw CliErrors['validation']('LrSmartJsx\x20node\x20\x22'+_0x4673b4[_0x4bd516(0x8f)]+'\x22\x20has\x20a\x20manually\x20changed\x20render.value.','Edit\x20render.source\x20instead;\x20render.value\x20is\x20generated\x20during\x20page\x20push.');if(_0x3d0afc||_0xd6e2d2||!_0x561dd5){const _0x47382f=readNonEmptyString(await _0x30b9fe(_0x8ad7));if(!_0x47382f)throw CliErrors['apiError'](_0x4bd516(0x6f)+_0x4673b4[_0x4bd516(0x8f)]+'\x22.');_0x4673b4['render'][_0x4bd516(0x71)]=_0x47382f,_0x477358+=0x1,_0x4f301f=!![];}if(_0x4f301f)_0x571e64+=0x1;}if(_0x571e64===0x0)return{'content':_0x365e68,'compiledNodes':_0x477358,'normalizedNodes':_0x571e64};return{'content':JSON[_0x4bd516(0x78)](_0x4d8ace),'compiledNodes':_0x477358,'normalizedNodes':_0x571e64};}function parseSchema(_0x31c955,_0x3e05eb){const _0x670ab=a293_0x1f51;try{return JSON['parse'](_0x31c955);}catch{throw CliErrors[_0x670ab(0x79)](_0x670ab(0x6d)+_0x3e05eb+_0x670ab(0x66));}}function collectLrSmartJsx(_0x2a3caa,_0x524e02=![]){const _0x1fc897=[],_0xcad770=(_0x272029,_0x485d5b)=>{const _0x11be45=a293_0x1f51;if(Array[_0x11be45(0x8a)](_0x272029)){_0x272029[_0x11be45(0x84)]((_0xf8968f,_0x30759e)=>_0xcad770(_0xf8968f,_0x485d5b+'['+_0x30759e+']'));return;}if(!isObject(_0x272029))return;if(_0x272029[_0x11be45(0x7a)]===_0x11be45(0x7e)){const _0x5a8eb1=readNonEmptyString(_0x272029['id']),_0x3f6334=_0x5a8eb1||_0x485d5b,_0x4c4506=isObject(_0x272029[_0x11be45(0x76)])?_0x272029['props']:undefined;if(!_0x4c4506){if(_0x524e02)throw CliErrors['validation'](_0x11be45(0x67)+_0x3f6334+_0x11be45(0x89),'Set\x20props\x20to\x20an\x20object\x20containing\x20a\x20render\x20object.');return;}const _0x4e9e73=isObject(_0x4c4506['render'])?_0x4c4506[_0x11be45(0x70)]:undefined;if(!_0x4e9e73){if(_0x524e02)throw CliErrors[_0x11be45(0x79)](_0x11be45(0x67)+_0x3f6334+'\x22\x20has\x20missing\x20or\x20invalid\x20props.render.',_0x11be45(0x7f));return;}_0x1fc897[_0x11be45(0x6c)]({'key':_0x5a8eb1?_0x11be45(0x91)+_0x5a8eb1:_0x11be45(0x69)+_0x485d5b,'label':_0x3f6334,'props':_0x4c4506,'render':_0x4e9e73});}for(const [_0x3707aa,_0x52cd4e]of Object[_0x11be45(0x74)](_0x272029)){if(_0x3707aa===_0x11be45(0x76)&&_0x272029['componentName']==='LrSmartJsx')continue;_0xcad770(_0x52cd4e,_0x485d5b+'.'+_0x3707aa);}};return _0xcad770(_0x2a3caa,'$'),_0x1fc897;}function isObject(_0x3ba105){const _0x461146=a293_0x1f51;return Boolean(_0x3ba105)&&typeof _0x3ba105===_0x461146(0x6e)&&!Array[_0x461146(0x8a)](_0x3ba105);}function a293_0xd9a3(){const _0x5a1018=['validation','componentName','\x22\x20is\x20missing\x20both\x20render.source\x20and\x20render.value.','this','key','LrSmartJsx','Set\x20props.render\x20to\x20an\x20object\x20containing\x20render.source\x20or\x20render.value.','get','JSExpression','8jLXVLD','source','forEach','Add\x20JSX\x20source\x20in\x20the\x20page\x20editor\x20or\x20remove\x20the\x20incomplete\x20component.','length','405999pFbUwi','639VDZQWk','\x22\x20has\x20missing\x20or\x20invalid\x20props.','isArray','2433162CiZdBA','remote','string','JSFunction','label','2225056sCqOhj','id:','type','\x20page\x20schema.','LrSmartJsx\x20node\x20\x22','402830GkZuzz','path:','5869540WCoRxW','trim','push','Invalid\x20JSON\x20in\x20','object','LrSmartJsx\x20compilation\x20returned\x20no\x20code\x20for\x20node\x20\x22','render','value','6446AtkwMt','1967643uyIqBY','entries','14AoixDd','props','_context','stringify'];a293_0xd9a3=function(){return _0x5a1018;};return a293_0xd9a3();}function readNonEmptyString(_0x336a4c){const _0x382d3f=a293_0x1f51;return typeof _0x336a4c===_0x382d3f(0x8d)&&_0x336a4c[_0x382d3f(0x6b)]()?_0x336a4c:undefined;}function a293_0x1f51(_0x1247df,_0x1f978c){_0x1247df=_0x1247df-0x65;const _0xd9a3d0=a293_0xd9a3();let _0x1f51f5=_0xd9a3d0[_0x1247df];return _0x1f51f5;}function isPageContextExpression(_0x251c84){const _0x256b20=a293_0x1f51;return isObject(_0x251c84)&&_0x251c84['type']===_0x256b20(0x81)&&_0x251c84[_0x256b20(0x71)]===_0x256b20(0x7c);}
@@ -1 +1 @@
1
- (function(_0x537cbb,_0x3c23fd){const _0x16bdb1=a295_0x348c,_0x36f4b2=_0x537cbb();while(!![]){try{const _0x3ad0df=parseInt(_0x16bdb1(0xdb))/0x1+-parseInt(_0x16bdb1(0x109))/0x2+-parseInt(_0x16bdb1(0x105))/0x3+parseInt(_0x16bdb1(0x106))/0x4*(parseInt(_0x16bdb1(0xfa))/0x5)+parseInt(_0x16bdb1(0xe5))/0x6+parseInt(_0x16bdb1(0x102))/0x7+-parseInt(_0x16bdb1(0xca))/0x8;if(_0x3ad0df===_0x3c23fd)break;else _0x36f4b2['push'](_0x36f4b2['shift']());}catch(_0x5e9cef){_0x36f4b2['push'](_0x36f4b2['shift']());}}}(a295_0x5753,0x9504e));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x5662c0,_0x3d6858){const _0x5edda2=a295_0x348c,_0x363329=[],_0x3a6abe=normalizeSqlForStaticAnalysis(_0x5662c0),_0x566e7b=(_0x3a6abe[_0x5edda2(0x104)]?[]:extractJoinFacts(_0x3a6abe[_0x5edda2(0x103)]))['map'](_0x1e3145=>{const _0x17eed1=_0x5edda2;if(_0x1e3145[_0x17eed1(0xde)]||_0x1e3145['columns'][_0x17eed1(0xe0)]===0x0)return _0x363329[_0x17eed1(0x10e)]({'code':_0x17eed1(0xe3),'table':_0x1e3145['table'],'alias':_0x1e3145[_0x17eed1(0x100)],'columns':_0x1e3145[_0x17eed1(0xd9)],'reason':_0x1e3145[_0x17eed1(0x108)]??'Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.'}),{'table':_0x1e3145['table'],'alias':_0x1e3145[_0x17eed1(0x100)],'columns':_0x1e3145[_0x17eed1(0xd9)],'status':_0x17eed1(0xe4)};const _0x9fc04=resolveTableMetadata(_0x3d6858,_0x1e3145[_0x17eed1(0xf1)]),_0x416275=(_0x9fc04?.[_0x17eed1(0xcc)]??[])[_0x17eed1(0xcb)](_0x34d1b1=>({'index':_0x34d1b1,'matchedPrefix':findEqualityPrefix(_0x34d1b1[_0x17eed1(0xd9)],_0x1e3145['columns'])}))[_0x17eed1(0xdc)](_0x3e6014=>_0x3e6014[_0x17eed1(0xf9)][_0x17eed1(0xe0)]>0x0),_0x58ce06=_0x416275[_0x17eed1(0xce)]((_0x54c1d3,_0x5f5cbd)=>!_0x54c1d3||_0x5f5cbd['matchedPrefix'][_0x17eed1(0xe0)]>_0x54c1d3[_0x17eed1(0xf9)][_0x17eed1(0xe0)]?_0x5f5cbd:_0x54c1d3,_0x416275[0x0]);if(_0x58ce06)return{'table':_0x1e3145['table'],'alias':_0x1e3145[_0x17eed1(0x100)],'columns':_0x1e3145[_0x17eed1(0xd9)],'status':_0x17eed1(0xd4),'matchedIndex':{..._0x58ce06['index'],'matchedPrefix':_0x58ce06['matchedPrefix']}};const _0xec2b50=_0x9fc04?.[_0x17eed1(0xcc)][_0x17eed1(0xdc)](_0x4f15a7=>_0x4f15a7[_0x17eed1(0xd9)]['some'](_0x4f3add=>_0x1e3145[_0x17eed1(0xd9)]['some'](_0x17006b=>columnNamesMatch(_0x4f3add,_0x17006b))))??[];if(_0xec2b50[_0x17eed1(0xe0)]>0x0)return _0x363329[_0x17eed1(0x10e)]({'code':_0x17eed1(0xd2),'table':_0x1e3145[_0x17eed1(0xf1)],'alias':_0x1e3145[_0x17eed1(0x100)],'columns':_0x1e3145[_0x17eed1(0xd9)],'reason':_0x17eed1(0xfd)}),{'table':_0x1e3145['table'],'alias':_0x1e3145[_0x17eed1(0x100)],'columns':_0x1e3145[_0x17eed1(0xd9)],'status':_0x17eed1(0xd3),'candidateIndexes':_0xec2b50};if(_0x9fc04&&_0x9fc04[_0x17eed1(0xf3)]!==![]&&_0x9fc04[_0x17eed1(0xcc)]['length']>0x0&&_0x1e3145['columns'][_0x17eed1(0xe0)]>0x0)return _0x363329[_0x17eed1(0x10e)]({'code':_0x17eed1(0x101),'table':_0x1e3145[_0x17eed1(0xf1)],'alias':_0x1e3145[_0x17eed1(0x100)],'columns':_0x1e3145[_0x17eed1(0xd9)],'reason':'No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.'}),{'table':_0x1e3145[_0x17eed1(0xf1)],'alias':_0x1e3145[_0x17eed1(0x100)],'columns':_0x1e3145[_0x17eed1(0xd9)],'status':'warning'};return _0x363329[_0x17eed1(0x10e)]({'code':'INDEX_METADATA_UNAVAILABLE','table':_0x1e3145[_0x17eed1(0xf1)],'alias':_0x1e3145[_0x17eed1(0x100)],'columns':_0x1e3145[_0x17eed1(0xd9)],'reason':_0x9fc04?_0x17eed1(0xf4):'No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.'}),{'table':_0x1e3145[_0x17eed1(0xf1)],'alias':_0x1e3145[_0x17eed1(0x100)],'columns':_0x1e3145[_0x17eed1(0xd9)],'status':_0x17eed1(0xe4)};});return{'checked':_0x566e7b['length']>0x0,'joins':_0x566e7b,'warnings':_0x363329};}function extractJoinFacts(_0x7bae15){const _0x44813a=a295_0x348c,_0x45e34d=maskNestedQueries(stripSqlNoise(_0x7bae15)),_0x44688e=maskQuotedIdentifiers(_0x45e34d),_0x41fda7=[],_0x410a09=new Set(),_0x10d2b5=/\b(?:(INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?\s+ON\s+([\s\S]*?)(?=\s+(?:(?:(?:INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\b|(?:WHERE|GROUP\s+BY|ORDER\s+BY|HAVING|LIMIT|UNION)\b)|;|$)/gi;for(const _0x70dd10 of _0x45e34d[_0x44813a(0x10d)](_0x10d2b5)){const _0x41e29c=_0x70dd10[_0x44813a(0xf7)]??0x0,_0x1fe550=_0x70dd10[0x0][_0x44813a(0xfe)](/\bJOIN\b/i),_0x1abf7c=_0x41e29c+Math['max'](0x0,_0x1fe550);if(!/^JOIN\b/i[_0x44813a(0xf2)](_0x44688e[_0x44813a(0xe6)](_0x1abf7c)))continue;_0x410a09[_0x44813a(0xd7)](_0x1abf7c);const _0x11453e=normalizeIdentifier(_0x70dd10[0x1]||_0x44813a(0xf6)),_0x45db72=normalizeIdentifier(_0x70dd10[0x2]??''),_0x456767=normalizeIdentifier(_0x70dd10[0x3]||_0x45db72[_0x44813a(0xee)]('.')['at'](-0x1)||_0x45db72),_0x1e7ab0=[],_0x41838c=_0x45db72===_0x44813a(0x10f);let _0x2a3cd3=_0x11453e===_0x44813a(0xd5)||_0x11453e===_0x44813a(0xda)||_0x41838c,_0x5c9d1f=_0x2a3cd3?_0x41838c?_0x44813a(0xff):_0x11453e[_0x44813a(0xe7)]()+_0x44813a(0xd8):undefined;const _0x2c0022=stripOuterParentheses(_0x70dd10[0x4]??''),_0x253cbe=_0x2c0022['includes'](MYBATIS_DYNAMIC_START_MARKER)||_0x2c0022[_0x44813a(0x10c)](MYBATIS_DYNAMIC_END_MARKER),_0x1531c1=_0x2c0022['includes'](MYBATIS_INCLUDE_MARKER);_0x253cbe&&(_0x2a3cd3=!![],_0x5c9d1f??=_0x44813a(0x110));_0x1531c1&&(_0x2a3cd3=!![],_0x5c9d1f??=_0x44813a(0xc8));const _0x2228ad=_0x2c0022['replaceAll'](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x44813a(0xd6)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x44813a(0xd6)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x2228ad,'OR')&&(_0x2a3cd3=!![],_0x5c9d1f??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.');for(const _0x4f7574 of splitTopLevelAnd(_0x2228ad)){const _0x1ed77c=stripOuterParentheses(_0x4f7574);if(hasTopLevelKeyword(_0x1ed77c,'OR')){_0x2a3cd3=!![],_0x5c9d1f??=_0x44813a(0xcd);continue;}const _0x3f2ee2=splitEquality(_0x1ed77c);if(!_0x3f2ee2){containsColumnReference(_0x4f7574,_0x456767)&&(_0x2a3cd3=!![]);continue;}const _0x2778a8=parseDirectColumnReference(_0x3f2ee2[0x0],_0x456767),_0x4e0f6a=parseDirectColumnReference(_0x3f2ee2[0x1],_0x456767),_0x35fce8=containsColumnReference(_0x3f2ee2[0x0],_0x456767),_0x3be2d8=containsColumnReference(_0x3f2ee2[0x1],_0x456767),_0x150552=_0x2778a8&&!_0x3be2d8?_0x2778a8:_0x4e0f6a&&!_0x35fce8?_0x4e0f6a:null;if(_0x150552&&!_0x1e7ab0[_0x44813a(0x10c)](_0x150552))_0x1e7ab0['push'](_0x150552);else!_0x150552&&containsColumnReference(_0x4f7574,_0x456767)&&(_0x2a3cd3=!![]);}_0x41fda7[_0x44813a(0x10e)]({'table':_0x45db72,'alias':_0x456767,'columns':_0x1e7ab0,'unsupportedPredicate':_0x2a3cd3,'unsupportedReason':_0x5c9d1f,'containsUnresolvedInclude':_0x1531c1,'position':_0x1abf7c});}for(const _0x1b4390 of _0x44688e[_0x44813a(0x10d)](/\bJOIN\b/gi)){const _0x1932c1=_0x1b4390[_0x44813a(0xf7)]??0x0;if(_0x410a09[_0x44813a(0xcf)](_0x1932c1))continue;const _0x13404c=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x44813a(0xd0)](_0x45e34d[_0x44813a(0xe6)](_0x1932c1+_0x1b4390[0x0][_0x44813a(0xe0)])),_0x3514bd=normalizeIdentifier(_0x13404c?.[0x1]||_0x44813a(0xec)),_0x32ad77=normalizeIdentifier(_0x13404c?.[0x2]||''),_0x4c0e9c=isSqlClauseKeyword(_0x32ad77)?_0x3514bd[_0x44813a(0xee)]('.')['at'](-0x1)||_0x3514bd:_0x32ad77||_0x3514bd[_0x44813a(0xee)]('.')['at'](-0x1)||_0x3514bd;_0x41fda7['push']({'table':_0x3514bd,'alias':_0x4c0e9c,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','position':_0x1932c1});}const _0x364425=_0x44688e[_0x44813a(0xdf)](MYBATIS_INCLUDE_MARKER);return _0x364425>=0x0&&!_0x41fda7[_0x44813a(0xea)](_0x2f8a43=>_0x2f8a43[_0x44813a(0xf5)])&&_0x41fda7[_0x44813a(0x10e)]({'table':'unknown','alias':_0x44813a(0xec),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':'MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','containsUnresolvedInclude':!![],'position':_0x364425}),_0x41fda7['sort']((_0x2c6dd9,_0x203d8d)=>_0x2c6dd9['position']-_0x203d8d[_0x44813a(0xd1)]);}function stripSqlNoise(_0x5dabc8){const _0x57d3f7=a295_0x348c,_0xe6f91f=Array[_0x57d3f7(0x107)](_0x5dabc8),_0x3dbb40=(_0x4c10e8,_0x2137be)=>{for(let _0x50c7f0=_0x4c10e8;_0x50c7f0<_0x2137be;_0x50c7f0+=0x1){_0xe6f91f[_0x50c7f0]!=='\x0a'&&_0xe6f91f[_0x50c7f0]!=='\x0d'&&(_0xe6f91f[_0x50c7f0]='\x20');}};for(let _0x4b31d3=0x0;_0x4b31d3<_0xe6f91f[_0x57d3f7(0xe0)];_0x4b31d3+=0x1){const _0x189e1b=_0xe6f91f[_0x4b31d3],_0x375aaa=_0xe6f91f[_0x4b31d3+0x1];if(_0x189e1b==='\x27'||_0x189e1b==='\x22'||_0x189e1b==='`'){const _0x308737=_0x189e1b,_0x13b59f=_0x4b31d3;_0x4b31d3+=0x1;while(_0x4b31d3<_0xe6f91f[_0x57d3f7(0xe0)]){if(_0xe6f91f[_0x4b31d3]==='\x5c'&&_0x4b31d3+0x1<_0xe6f91f[_0x57d3f7(0xe0)]){_0x4b31d3+=0x2;continue;}if(_0xe6f91f[_0x4b31d3]!==_0x308737){_0x4b31d3+=0x1;continue;}if(_0xe6f91f[_0x4b31d3+0x1]===_0x308737){_0x4b31d3+=0x2;continue;}break;}if(_0x308737==='\x27')_0x3dbb40(_0x13b59f,Math[_0x57d3f7(0xeb)](_0x4b31d3+0x1,_0xe6f91f[_0x57d3f7(0xe0)]));continue;}if(_0x189e1b==='-'&&_0x375aaa==='-'){const _0x89ed2c=_0x4b31d3;while(_0x4b31d3<_0xe6f91f[_0x57d3f7(0xe0)]&&_0xe6f91f[_0x4b31d3]!=='\x0a')_0x4b31d3+=0x1;_0x3dbb40(_0x89ed2c,_0x4b31d3);continue;}if(_0x189e1b==='/'&&_0x375aaa==='*'){const _0xe3c474=_0x4b31d3;_0x4b31d3+=0x2;while(_0x4b31d3<_0xe6f91f['length']&&!(_0xe6f91f[_0x4b31d3]==='*'&&_0xe6f91f[_0x4b31d3+0x1]==='/')){_0x4b31d3+=0x1;}_0x4b31d3=Math[_0x57d3f7(0xeb)](_0x4b31d3+0x1,_0xe6f91f[_0x57d3f7(0xe0)]-0x1),_0x3dbb40(_0xe3c474,_0x4b31d3+0x1);continue;}if(_0x189e1b==='#'&&_0x375aaa!=='{'){const _0x118717=_0x4b31d3;while(_0x4b31d3<_0xe6f91f[_0x57d3f7(0xe0)]&&_0xe6f91f[_0x4b31d3]!=='\x0a')_0x4b31d3+=0x1;_0x3dbb40(_0x118717,_0x4b31d3);continue;}if((_0x189e1b==='#'||_0x189e1b==='$')&&_0x375aaa==='{'){const _0x3e965f=_0x4b31d3;_0x4b31d3+=0x2;while(_0x4b31d3<_0xe6f91f[_0x57d3f7(0xe0)]&&_0xe6f91f[_0x4b31d3]!=='}')_0x4b31d3+=0x1;_0x3dbb40(_0x3e965f,Math[_0x57d3f7(0xeb)](_0x4b31d3+0x1,_0xe6f91f[_0x57d3f7(0xe0)]));}}return _0xe6f91f[_0x57d3f7(0xdd)]('');}function maskQuotedIdentifiers(_0x54ed90){const _0x59d2af=a295_0x348c,_0x2bfb8c=Array[_0x59d2af(0x107)](_0x54ed90);for(let _0x1c3dae=0x0;_0x1c3dae<_0x2bfb8c[_0x59d2af(0xe0)];_0x1c3dae+=0x1){const _0x333774=_0x2bfb8c[_0x1c3dae];if(_0x333774!=='\x22'&&_0x333774!=='`')continue;_0x1c3dae+=0x1;while(_0x1c3dae<_0x2bfb8c['length']){if(_0x2bfb8c[_0x1c3dae]===_0x333774){if(_0x2bfb8c[_0x1c3dae+0x1]===_0x333774){_0x2bfb8c[_0x1c3dae]='\x20',_0x2bfb8c[_0x1c3dae+0x1]='\x20',_0x1c3dae+=0x2;continue;}break;}_0x2bfb8c[_0x1c3dae]='\x20',_0x1c3dae+=0x1;}}return _0x2bfb8c[_0x59d2af(0xdd)]('');}function maskNestedQueries(_0x3a6289){const _0x483646=a295_0x348c,_0x4f75b8=Array[_0x483646(0x107)](_0x3a6289);for(let _0x36a3be=0x0;_0x36a3be<_0x4f75b8[_0x483646(0xe0)];_0x36a3be+=0x1){if(_0x4f75b8[_0x36a3be]!=='(')continue;const _0x461ab4=_0x3a6289['slice'](_0x36a3be+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x483646(0xf2)](_0x461ab4))continue;let _0x51be92=0x1,_0xb41cfc=_0x36a3be+0x1;for(;_0xb41cfc<_0x4f75b8['length']&&_0x51be92>0x0;_0xb41cfc+=0x1){if(_0x4f75b8[_0xb41cfc]==='(')_0x51be92+=0x1;if(_0x4f75b8[_0xb41cfc]===')')_0x51be92-=0x1;}if(_0x51be92!==0x0)continue;for(let _0x35d734=_0x36a3be;_0x35d734<_0xb41cfc;_0x35d734+=0x1){_0x4f75b8[_0x35d734]='\x20';}const _0x3d8ca8=_0x483646(0x10f);for(let _0x394c4b=0x0;_0x394c4b<_0x3d8ca8['length']&&_0x36a3be+_0x394c4b<_0xb41cfc;_0x394c4b+=0x1){_0x4f75b8[_0x36a3be+_0x394c4b]=_0x3d8ca8[_0x394c4b];}_0x36a3be=_0xb41cfc-0x1;}return _0x4f75b8[_0x483646(0xdd)]('');}function splitTopLevelAnd(_0xeca8c2){const _0x5b9615=a295_0x348c,_0x45f64a=[];let _0x461d32=0x0,_0x1c57aa=0x0;for(let _0x3d3e54=0x0;_0x3d3e54<_0xeca8c2[_0x5b9615(0xe0)];_0x3d3e54+=0x1){const _0x360263=_0xeca8c2[_0x3d3e54];if(_0x360263==='(')_0x461d32+=0x1;if(_0x360263===')')_0x461d32=Math['max'](0x0,_0x461d32-0x1);_0x461d32===0x0&&_0xeca8c2[_0x5b9615(0xe6)](_0x3d3e54)['match'](/^AND\b/i)&&(_0x3d3e54===0x0||/\s/['test'](_0xeca8c2[_0x3d3e54-0x1]??''))&&(_0x45f64a[_0x5b9615(0x10e)](_0xeca8c2[_0x5b9615(0xe6)](_0x1c57aa,_0x3d3e54)[_0x5b9615(0xe2)]()),_0x3d3e54+=0x2,_0x1c57aa=_0x3d3e54+0x1);}const _0x11d51e=_0xeca8c2['slice'](_0x1c57aa)[_0x5b9615(0xe2)]();if(_0x11d51e)_0x45f64a['push'](_0x11d51e);return _0x45f64a;}function hasTopLevelKeyword(_0x50ec5b,_0xfb457a){const _0x7884c3=a295_0x348c;let _0x4c0daf=0x0;for(let _0x5b303e=0x0;_0x5b303e<_0x50ec5b[_0x7884c3(0xe0)];_0x5b303e+=0x1){const _0x3bf717=_0x50ec5b[_0x5b303e];if(_0x3bf717==='(')_0x4c0daf+=0x1;if(_0x3bf717===')')_0x4c0daf=Math['max'](0x0,_0x4c0daf-0x1);if(_0x4c0daf!==0x0)continue;const _0x2ef32f=_0x50ec5b[_0x7884c3(0xe6)](_0x5b303e,_0x5b303e+_0xfb457a[_0x7884c3(0xe0)]),_0x956a39=_0x50ec5b[_0x5b303e-0x1]??'\x20',_0xa3860d=_0x50ec5b[_0x5b303e+_0xfb457a[_0x7884c3(0xe0)]]??'\x20';if(_0x2ef32f[_0x7884c3(0xe7)]()===_0xfb457a['toUpperCase']()&&!/[\w$]/['test'](_0x956a39)&&!/[\w$]/[_0x7884c3(0xf2)](_0xa3860d))return!![];}return![];}function splitEquality(_0x24ff52){const _0x14e79e=a295_0x348c,_0x1c6e6b=stripOuterParentheses(_0x24ff52);let _0xbaed31=0x0,_0xc197ea;for(let _0x3057a9=0x0;_0x3057a9<_0x1c6e6b[_0x14e79e(0xe0)];_0x3057a9+=0x1){const _0x32c1d7=_0x1c6e6b[_0x3057a9];if(_0x32c1d7==='(')_0xbaed31+=0x1;if(_0x32c1d7===')')_0xbaed31=Math[_0x14e79e(0xed)](0x0,_0xbaed31-0x1);const _0x50c11d=_0x1c6e6b[_0x3057a9-0x1]??'',_0x38bdda=_0x1c6e6b[_0x3057a9+0x1]??'';if(_0x32c1d7==='='&&_0xbaed31===0x0&&!/[!<>=:]/[_0x14e79e(0xf2)](_0x50c11d)&&_0x38bdda!=='='){if(_0xc197ea!==undefined)return null;_0xc197ea=_0x3057a9;}}return _0xc197ea===undefined?null:[_0x1c6e6b[_0x14e79e(0xe6)](0x0,_0xc197ea)[_0x14e79e(0xe2)](),_0x1c6e6b[_0x14e79e(0xe6)](_0xc197ea+0x1)['trim']()];}function parseDirectColumnReference(_0x48fe5d,_0x30b29c){const _0x17d745=a295_0x348c,_0x119935=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x17d745(0xd0)](stripOuterParentheses(_0x48fe5d));if(!_0x119935)return null;if(normalizeIdentifier(_0x119935[0x1]??'')!==normalizeIdentifier(_0x30b29c))return null;return normalizeIdentifier(_0x119935[0x2]??'');}function containsColumnReference(_0x3ff5b7,_0x35e562){const _0x34c294=a295_0x348c,_0x60d34d=_0x3ff5b7[_0x34c294(0xef)](/[`"]/g,''),_0x464d4b=_0x35e562[_0x34c294(0xef)](/[.*+?^${}()|[\]\\]/g,_0x34c294(0xc9));return new RegExp(_0x34c294(0xe1)+_0x464d4b+'\x5cs*\x5c.\x5cs*[\x5cw$]+','i')[_0x34c294(0xf2)](_0x60d34d);}function a295_0x348c(_0x744a47,_0x40a1e0){_0x744a47=_0x744a47-0xc8;const _0x5753a4=a295_0x5753();let _0x348cb6=_0x5753a4[_0x744a47];return _0x348cb6;}function findEqualityPrefix(_0x18e367,_0x5e19b3){const _0x4fe8ea=a295_0x348c,_0x1f7d30=new Set(_0x5e19b3[_0x4fe8ea(0xcb)](normalizeIdentifier)),_0x44e697=[];for(const _0x1eb101 of _0x18e367){if(!_0x1f7d30[_0x4fe8ea(0xcf)](normalizeIdentifier(_0x1eb101)))break;_0x44e697[_0x4fe8ea(0x10e)](_0x1eb101);}return _0x44e697;}function resolveTableMetadata(_0x5c86c3,_0x3d08f2){const _0x3eee05=a295_0x348c,_0x1e11b4=normalizeIdentifier(_0x3d08f2),_0x4c4270=_0x5c86c3[_0x3eee05(0xdc)](_0x1625cc=>normalizeIdentifier(_0x1625cc[_0x3eee05(0xe9)])===_0x1e11b4);if(_0x4c4270[_0x3eee05(0xe0)]===0x1)return _0x4c4270[0x0];const _0x3be6b7=_0x1e11b4[_0x3eee05(0x10c)]('.'),_0x12f20e=_0x1e11b4['split']('.')['at'](-0x1),_0x368e58=_0x5c86c3['filter'](_0x2f24e8=>{const _0x3bfcef=_0x3eee05,_0x1bd649=normalizeIdentifier(_0x2f24e8['tableName']);if(_0x3be6b7&&_0x1bd649['includes']('.'))return![];return _0x1bd649[_0x3bfcef(0xee)]('.')['at'](-0x1)===_0x12f20e;});return _0x368e58[_0x3eee05(0xe0)]===0x1?_0x368e58[0x0]:undefined;}function columnNamesMatch(_0x4a6cc8,_0x4ae774){return normalizeIdentifier(_0x4a6cc8)===normalizeIdentifier(_0x4ae774);}function normalizeIdentifier(_0xb9319c){const _0x25ec24=a295_0x348c;return _0xb9319c[_0x25ec24(0xef)](/[`"]/g,'')[_0x25ec24(0xe2)]()[_0x25ec24(0xe8)]();}function a295_0x5753(){const _0x37579a=['sql','error','1103574Txqbnf','1456628QADBsb','from','unsupportedReason','447084jynwnE','left','natural','includes','matchAll','push','__sq__','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','\x5c$&','12175960VTVGss','map','indexes','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','reduce','has','exec','position','JOIN_INDEX_NOT_USABLE','warning','covered','right','replaceAll','add','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','columns','full','1097446tdaazb','filter','join','unsupportedPredicate','indexOf','length','(?:^|[^\x5cw$])','trim','JOIN_PREDICATE_UNSUPPORTED','unavailable','7055340hwPRes','slice','toUpperCase','toLowerCase','tableName','some','min','unknown','max','split','replace','cross','table','test','metadataAvailable','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','containsUnresolvedInclude','INNER','index','using','matchedPrefix','5pqdrrE','endsWith','inner','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.','search','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','alias','JOIN_INDEX_MISSING','603988vCbEbh'];a295_0x5753=function(){return _0x37579a;};return a295_0x5753();}function isSqlClauseKeyword(_0x1be93c){const _0x2638cd=a295_0x348c;return new Set(['on',_0x2638cd(0xf8),'where',_0x2638cd(0xdd),_0x2638cd(0xfc),_0x2638cd(0x10a),_0x2638cd(0xd5),_0x2638cd(0xda),_0x2638cd(0xf0),_0x2638cd(0x10b)])[_0x2638cd(0xcf)](_0x1be93c);}function stripOuterParentheses(_0x437e1e){const _0x64947b=a295_0x348c;let _0x9fc295=_0x437e1e[_0x64947b(0xe2)]();while(_0x9fc295['startsWith']('(')&&_0x9fc295[_0x64947b(0xfb)](')')){let _0x42b473=0x0,_0x56532c=!![];for(let _0x5f2e2c=0x0;_0x5f2e2c<_0x9fc295['length'];_0x5f2e2c+=0x1){if(_0x9fc295[_0x5f2e2c]==='(')_0x42b473+=0x1;if(_0x9fc295[_0x5f2e2c]===')')_0x42b473-=0x1;if(_0x42b473===0x0&&_0x5f2e2c<_0x9fc295[_0x64947b(0xe0)]-0x1){_0x56532c=![];break;}}if(!_0x56532c||_0x42b473!==0x0)break;_0x9fc295=_0x9fc295[_0x64947b(0xe6)](0x1,-0x1)[_0x64947b(0xe2)]();}return _0x9fc295;}
1
+ (function(_0x24ba25,_0x353df4){const _0x403af9=a295_0x515a,_0x1db17d=_0x24ba25();while(!![]){try{const _0x24e394=parseInt(_0x403af9(0x1e7))/0x1*(-parseInt(_0x403af9(0x202))/0x2)+-parseInt(_0x403af9(0x21c))/0x3+-parseInt(_0x403af9(0x1e5))/0x4+-parseInt(_0x403af9(0x220))/0x5+parseInt(_0x403af9(0x1f0))/0x6+parseInt(_0x403af9(0x222))/0x7*(parseInt(_0x403af9(0x229))/0x8)+parseInt(_0x403af9(0x21b))/0x9*(parseInt(_0x403af9(0x218))/0xa);if(_0x24e394===_0x353df4)break;else _0x1db17d['push'](_0x1db17d['shift']());}catch(_0x10781e){_0x1db17d['push'](_0x1db17d['shift']());}}}(a295_0x15b0,0x382ea));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x1d22f7,_0x2dd330){const _0x40e352=a295_0x515a,_0x57c8e2=[],_0x23179a=normalizeSqlForStaticAnalysis(_0x1d22f7),_0x19d6ca=(_0x23179a['error']?[]:extractJoinFacts(_0x23179a['sql']))[_0x40e352(0x217)](_0x93f9a3=>{const _0x24e9fa=_0x40e352;if(_0x93f9a3[_0x24e9fa(0x22f)]||_0x93f9a3[_0x24e9fa(0x20a)]['length']===0x0)return _0x57c8e2[_0x24e9fa(0x216)]({'code':'JOIN_PREDICATE_UNSUPPORTED','table':_0x93f9a3[_0x24e9fa(0x205)],'alias':_0x93f9a3[_0x24e9fa(0x1fc)],'columns':_0x93f9a3[_0x24e9fa(0x20a)],'reason':_0x93f9a3[_0x24e9fa(0x210)]??_0x24e9fa(0x1ee)}),{'table':_0x93f9a3[_0x24e9fa(0x205)],'alias':_0x93f9a3[_0x24e9fa(0x1fc)],'columns':_0x93f9a3['columns'],'status':_0x24e9fa(0x209)};const _0x2a002b=resolveTableMetadata(_0x2dd330,_0x93f9a3[_0x24e9fa(0x205)]),_0x2b1f31=(_0x2a002b?.[_0x24e9fa(0x212)]??[])[_0x24e9fa(0x217)](_0x2b5ed4=>({'index':_0x2b5ed4,'matchedPrefix':findEqualityPrefix(_0x2b5ed4[_0x24e9fa(0x20a)],_0x93f9a3[_0x24e9fa(0x20a)])}))[_0x24e9fa(0x1ed)](_0x593258=>_0x593258['matchedPrefix'][_0x24e9fa(0x22d)]>0x0),_0x1c36fc=_0x2b1f31[_0x24e9fa(0x1f9)]((_0x3d2168,_0x2aa58c)=>!_0x3d2168||_0x2aa58c[_0x24e9fa(0x206)]['length']>_0x3d2168['matchedPrefix'][_0x24e9fa(0x22d)]?_0x2aa58c:_0x3d2168,_0x2b1f31[0x0]);if(_0x1c36fc)return{'table':_0x93f9a3['table'],'alias':_0x93f9a3[_0x24e9fa(0x1fc)],'columns':_0x93f9a3[_0x24e9fa(0x20a)],'status':_0x24e9fa(0x1fd),'matchedIndex':{..._0x1c36fc['index'],'matchedPrefix':_0x1c36fc[_0x24e9fa(0x206)]}};const _0x2532f9=_0x2a002b?.[_0x24e9fa(0x212)]['filter'](_0x3c1ea4=>_0x3c1ea4[_0x24e9fa(0x20a)][_0x24e9fa(0x1f6)](_0x4a546b=>_0x93f9a3[_0x24e9fa(0x20a)][_0x24e9fa(0x1f6)](_0x40fa88=>columnNamesMatch(_0x4a546b,_0x40fa88))))??[];if(_0x2532f9[_0x24e9fa(0x22d)]>0x0)return _0x57c8e2['push']({'code':_0x24e9fa(0x226),'table':_0x93f9a3[_0x24e9fa(0x205)],'alias':_0x93f9a3[_0x24e9fa(0x1fc)],'columns':_0x93f9a3[_0x24e9fa(0x20a)],'reason':'Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.'}),{'table':_0x93f9a3[_0x24e9fa(0x205)],'alias':_0x93f9a3[_0x24e9fa(0x1fc)],'columns':_0x93f9a3[_0x24e9fa(0x20a)],'status':_0x24e9fa(0x201),'candidateIndexes':_0x2532f9};if(_0x2a002b&&_0x2a002b['metadataAvailable']!==![]&&_0x2a002b[_0x24e9fa(0x212)][_0x24e9fa(0x22d)]>0x0&&_0x93f9a3[_0x24e9fa(0x20a)][_0x24e9fa(0x22d)]>0x0)return _0x57c8e2[_0x24e9fa(0x216)]({'code':_0x24e9fa(0x22a),'table':_0x93f9a3[_0x24e9fa(0x205)],'alias':_0x93f9a3[_0x24e9fa(0x1fc)],'columns':_0x93f9a3[_0x24e9fa(0x20a)],'reason':'No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.'}),{'table':_0x93f9a3[_0x24e9fa(0x205)],'alias':_0x93f9a3[_0x24e9fa(0x1fc)],'columns':_0x93f9a3[_0x24e9fa(0x20a)],'status':_0x24e9fa(0x201)};return _0x57c8e2[_0x24e9fa(0x216)]({'code':'INDEX_METADATA_UNAVAILABLE','table':_0x93f9a3[_0x24e9fa(0x205)],'alias':_0x93f9a3[_0x24e9fa(0x1fc)],'columns':_0x93f9a3[_0x24e9fa(0x20a)],'reason':_0x2a002b?_0x24e9fa(0x1e9):'No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.'}),{'table':_0x93f9a3['table'],'alias':_0x93f9a3[_0x24e9fa(0x1fc)],'columns':_0x93f9a3['columns'],'status':_0x24e9fa(0x209)};});return{'checked':_0x19d6ca['length']>0x0,'joins':_0x19d6ca,'warnings':_0x57c8e2};}function extractJoinFacts(_0x61a013){const _0x270436=a295_0x515a,_0x51cef4=maskNestedQueries(stripSqlNoise(_0x61a013)),_0x1e09ed=maskQuotedIdentifiers(_0x51cef4),_0x549e49=[],_0x202280=new Set(),_0x1edae7=/\b(?:(INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?\s+ON\s+([\s\S]*?)(?=\s+(?:(?:(?:INNER|LEFT|RIGHT|FULL)(?:\s+OUTER)?\s+)?JOIN\b|(?:WHERE|GROUP\s+BY|ORDER\s+BY|HAVING|LIMIT|UNION)\b)|;|$)/gi;for(const _0x4444ea of _0x51cef4[_0x270436(0x224)](_0x1edae7)){const _0x1425ee=_0x4444ea[_0x270436(0x214)]??0x0,_0x3b96ce=_0x4444ea[0x0][_0x270436(0x21f)](/\bJOIN\b/i),_0x51b3dd=_0x1425ee+Math[_0x270436(0x1f2)](0x0,_0x3b96ce);if(!/^JOIN\b/i[_0x270436(0x1f8)](_0x1e09ed['slice'](_0x51b3dd)))continue;_0x202280[_0x270436(0x1fa)](_0x51b3dd);const _0x13fa66=normalizeIdentifier(_0x4444ea[0x1]||_0x270436(0x225)),_0x454d9b=normalizeIdentifier(_0x4444ea[0x2]??''),_0x592d34=normalizeIdentifier(_0x4444ea[0x3]||_0x454d9b[_0x270436(0x22e)]('.')['at'](-0x1)||_0x454d9b),_0x4ad2f3=[],_0x4afe3b=_0x454d9b===_0x270436(0x1ef);let _0x3e48cf=_0x13fa66===_0x270436(0x1e8)||_0x13fa66===_0x270436(0x204)||_0x4afe3b,_0xdcb82a=_0x3e48cf?_0x4afe3b?_0x270436(0x22c):_0x13fa66[_0x270436(0x1f5)]()+_0x270436(0x208):undefined;const _0x570d2e=stripOuterParentheses(_0x4444ea[0x4]??''),_0x1c2b26=_0x570d2e[_0x270436(0x1f7)](MYBATIS_DYNAMIC_START_MARKER)||_0x570d2e['includes'](MYBATIS_DYNAMIC_END_MARKER),_0xf6772a=_0x570d2e['includes'](MYBATIS_INCLUDE_MARKER);_0x1c2b26&&(_0x3e48cf=!![],_0xdcb82a??=_0x270436(0x1fe));_0xf6772a&&(_0x3e48cf=!![],_0xdcb82a??=_0x270436(0x20e));const _0xe54fe5=_0x570d2e[_0x270436(0x227)](MYBATIS_DYNAMIC_START_MARKER,'\x20')['replaceAll'](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x270436(0x227)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0xe54fe5,'OR')&&(_0x3e48cf=!![],_0xdcb82a??='OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.');for(const _0x5d823f of splitTopLevelAnd(_0xe54fe5)){const _0xd44f6a=stripOuterParentheses(_0x5d823f);if(hasTopLevelKeyword(_0xd44f6a,'OR')){_0x3e48cf=!![],_0xdcb82a??=_0x270436(0x1ec);continue;}const _0x490015=splitEquality(_0xd44f6a);if(!_0x490015){containsColumnReference(_0x5d823f,_0x592d34)&&(_0x3e48cf=!![]);continue;}const _0x1ef697=parseDirectColumnReference(_0x490015[0x0],_0x592d34),_0x277e3d=parseDirectColumnReference(_0x490015[0x1],_0x592d34),_0x360e45=containsColumnReference(_0x490015[0x0],_0x592d34),_0xfc0ae3=containsColumnReference(_0x490015[0x1],_0x592d34),_0x508720=_0x1ef697&&!_0xfc0ae3?_0x1ef697:_0x277e3d&&!_0x360e45?_0x277e3d:null;if(_0x508720&&!_0x4ad2f3[_0x270436(0x1f7)](_0x508720))_0x4ad2f3['push'](_0x508720);else!_0x508720&&containsColumnReference(_0x5d823f,_0x592d34)&&(_0x3e48cf=!![]);}_0x549e49['push']({'table':_0x454d9b,'alias':_0x592d34,'columns':_0x4ad2f3,'unsupportedPredicate':_0x3e48cf,'unsupportedReason':_0xdcb82a,'containsUnresolvedInclude':_0xf6772a,'position':_0x51b3dd});}for(const _0x2f49fc of _0x1e09ed[_0x270436(0x224)](/\bJOIN\b/gi)){const _0x3ee1e9=_0x2f49fc['index']??0x0;if(_0x202280['has'](_0x3ee1e9))continue;const _0x229991=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x270436(0x21a)](_0x51cef4['slice'](_0x3ee1e9+_0x2f49fc[0x0][_0x270436(0x22d)])),_0x5080b4=normalizeIdentifier(_0x229991?.[0x1]||_0x270436(0x215)),_0x32571f=normalizeIdentifier(_0x229991?.[0x2]||''),_0x2233e8=isSqlClauseKeyword(_0x32571f)?_0x5080b4[_0x270436(0x22e)]('.')['at'](-0x1)||_0x5080b4:_0x32571f||_0x5080b4['split']('.')['at'](-0x1)||_0x5080b4;_0x549e49['push']({'table':_0x5080b4,'alias':_0x2233e8,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x270436(0x20b),'position':_0x3ee1e9});}const _0x2ea90b=_0x1e09ed[_0x270436(0x1f3)](MYBATIS_INCLUDE_MARKER);return _0x2ea90b>=0x0&&!_0x549e49[_0x270436(0x1f6)](_0x2c2ba2=>_0x2c2ba2[_0x270436(0x20f)])&&_0x549e49['push']({'table':_0x270436(0x215),'alias':'unknown','columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x270436(0x21d),'containsUnresolvedInclude':!![],'position':_0x2ea90b}),_0x549e49['sort']((_0x4caf08,_0x17dd82)=>_0x4caf08[_0x270436(0x21e)]-_0x17dd82['position']);}function stripSqlNoise(_0x4fae9a){const _0x16c722=a295_0x515a,_0x178dc0=Array[_0x16c722(0x1f4)](_0x4fae9a),_0x3aaaf3=(_0x54b7c9,_0x18da17)=>{for(let _0x4c6108=_0x54b7c9;_0x4c6108<_0x18da17;_0x4c6108+=0x1){_0x178dc0[_0x4c6108]!=='\x0a'&&_0x178dc0[_0x4c6108]!=='\x0d'&&(_0x178dc0[_0x4c6108]='\x20');}};for(let _0xd1ed45=0x0;_0xd1ed45<_0x178dc0[_0x16c722(0x22d)];_0xd1ed45+=0x1){const _0x4397de=_0x178dc0[_0xd1ed45],_0x4757a7=_0x178dc0[_0xd1ed45+0x1];if(_0x4397de==='\x27'||_0x4397de==='\x22'||_0x4397de==='`'){const _0x451b72=_0x4397de,_0x4eb4fc=_0xd1ed45;_0xd1ed45+=0x1;while(_0xd1ed45<_0x178dc0[_0x16c722(0x22d)]){if(_0x178dc0[_0xd1ed45]==='\x5c'&&_0xd1ed45+0x1<_0x178dc0['length']){_0xd1ed45+=0x2;continue;}if(_0x178dc0[_0xd1ed45]!==_0x451b72){_0xd1ed45+=0x1;continue;}if(_0x178dc0[_0xd1ed45+0x1]===_0x451b72){_0xd1ed45+=0x2;continue;}break;}if(_0x451b72==='\x27')_0x3aaaf3(_0x4eb4fc,Math[_0x16c722(0x20c)](_0xd1ed45+0x1,_0x178dc0['length']));continue;}if(_0x4397de==='-'&&_0x4757a7==='-'){const _0x4705d2=_0xd1ed45;while(_0xd1ed45<_0x178dc0[_0x16c722(0x22d)]&&_0x178dc0[_0xd1ed45]!=='\x0a')_0xd1ed45+=0x1;_0x3aaaf3(_0x4705d2,_0xd1ed45);continue;}if(_0x4397de==='/'&&_0x4757a7==='*'){const _0x23eae6=_0xd1ed45;_0xd1ed45+=0x2;while(_0xd1ed45<_0x178dc0[_0x16c722(0x22d)]&&!(_0x178dc0[_0xd1ed45]==='*'&&_0x178dc0[_0xd1ed45+0x1]==='/')){_0xd1ed45+=0x1;}_0xd1ed45=Math[_0x16c722(0x20c)](_0xd1ed45+0x1,_0x178dc0[_0x16c722(0x22d)]-0x1),_0x3aaaf3(_0x23eae6,_0xd1ed45+0x1);continue;}if(_0x4397de==='#'&&_0x4757a7!=='{'){const _0x539818=_0xd1ed45;while(_0xd1ed45<_0x178dc0[_0x16c722(0x22d)]&&_0x178dc0[_0xd1ed45]!=='\x0a')_0xd1ed45+=0x1;_0x3aaaf3(_0x539818,_0xd1ed45);continue;}if((_0x4397de==='#'||_0x4397de==='$')&&_0x4757a7==='{'){const _0x2830f7=_0xd1ed45;_0xd1ed45+=0x2;while(_0xd1ed45<_0x178dc0['length']&&_0x178dc0[_0xd1ed45]!=='}')_0xd1ed45+=0x1;_0x3aaaf3(_0x2830f7,Math[_0x16c722(0x20c)](_0xd1ed45+0x1,_0x178dc0[_0x16c722(0x22d)]));}}return _0x178dc0[_0x16c722(0x1eb)]('');}function maskQuotedIdentifiers(_0x707068){const _0x31cddc=a295_0x515a,_0x2bc811=Array['from'](_0x707068);for(let _0x4c9762=0x0;_0x4c9762<_0x2bc811[_0x31cddc(0x22d)];_0x4c9762+=0x1){const _0x370fa6=_0x2bc811[_0x4c9762];if(_0x370fa6!=='\x22'&&_0x370fa6!=='`')continue;_0x4c9762+=0x1;while(_0x4c9762<_0x2bc811[_0x31cddc(0x22d)]){if(_0x2bc811[_0x4c9762]===_0x370fa6){if(_0x2bc811[_0x4c9762+0x1]===_0x370fa6){_0x2bc811[_0x4c9762]='\x20',_0x2bc811[_0x4c9762+0x1]='\x20',_0x4c9762+=0x2;continue;}break;}_0x2bc811[_0x4c9762]='\x20',_0x4c9762+=0x1;}}return _0x2bc811['join']('');}function maskNestedQueries(_0x180abf){const _0xf5f17e=a295_0x515a,_0x2fc068=Array[_0xf5f17e(0x1f4)](_0x180abf);for(let _0x4a8872=0x0;_0x4a8872<_0x2fc068[_0xf5f17e(0x22d)];_0x4a8872+=0x1){if(_0x2fc068[_0x4a8872]!=='(')continue;const _0x213542=_0x180abf[_0xf5f17e(0x219)](_0x4a8872+0x1);if(!/^\s*(?:SELECT|WITH)\b/i['test'](_0x213542))continue;let _0x194193=0x1,_0x1b8ceb=_0x4a8872+0x1;for(;_0x1b8ceb<_0x2fc068['length']&&_0x194193>0x0;_0x1b8ceb+=0x1){if(_0x2fc068[_0x1b8ceb]==='(')_0x194193+=0x1;if(_0x2fc068[_0x1b8ceb]===')')_0x194193-=0x1;}if(_0x194193!==0x0)continue;for(let _0x85bb1e=_0x4a8872;_0x85bb1e<_0x1b8ceb;_0x85bb1e+=0x1){_0x2fc068[_0x85bb1e]='\x20';}const _0x23b811=_0xf5f17e(0x1ef);for(let _0x18573c=0x0;_0x18573c<_0x23b811[_0xf5f17e(0x22d)]&&_0x4a8872+_0x18573c<_0x1b8ceb;_0x18573c+=0x1){_0x2fc068[_0x4a8872+_0x18573c]=_0x23b811[_0x18573c];}_0x4a8872=_0x1b8ceb-0x1;}return _0x2fc068['join']('');}function splitTopLevelAnd(_0x2d349a){const _0xcb55ef=a295_0x515a,_0x7a18b1=[];let _0x2483ff=0x0,_0x4d9346=0x0;for(let _0x538c21=0x0;_0x538c21<_0x2d349a['length'];_0x538c21+=0x1){const _0x1fe354=_0x2d349a[_0x538c21];if(_0x1fe354==='(')_0x2483ff+=0x1;if(_0x1fe354===')')_0x2483ff=Math['max'](0x0,_0x2483ff-0x1);_0x2483ff===0x0&&_0x2d349a['slice'](_0x538c21)[_0xcb55ef(0x20d)](/^AND\b/i)&&(_0x538c21===0x0||/\s/[_0xcb55ef(0x1f8)](_0x2d349a[_0x538c21-0x1]??''))&&(_0x7a18b1['push'](_0x2d349a['slice'](_0x4d9346,_0x538c21)[_0xcb55ef(0x1ea)]()),_0x538c21+=0x2,_0x4d9346=_0x538c21+0x1);}const _0x3f4960=_0x2d349a[_0xcb55ef(0x219)](_0x4d9346)[_0xcb55ef(0x1ea)]();if(_0x3f4960)_0x7a18b1[_0xcb55ef(0x216)](_0x3f4960);return _0x7a18b1;}function hasTopLevelKeyword(_0x4bbfbe,_0x2800a3){const _0x52030f=a295_0x515a;let _0x253a2e=0x0;for(let _0x1bc7fa=0x0;_0x1bc7fa<_0x4bbfbe[_0x52030f(0x22d)];_0x1bc7fa+=0x1){const _0x2677e6=_0x4bbfbe[_0x1bc7fa];if(_0x2677e6==='(')_0x253a2e+=0x1;if(_0x2677e6===')')_0x253a2e=Math[_0x52030f(0x1f2)](0x0,_0x253a2e-0x1);if(_0x253a2e!==0x0)continue;const _0x42df47=_0x4bbfbe['slice'](_0x1bc7fa,_0x1bc7fa+_0x2800a3['length']),_0x4bd65a=_0x4bbfbe[_0x1bc7fa-0x1]??'\x20',_0x36ba19=_0x4bbfbe[_0x1bc7fa+_0x2800a3[_0x52030f(0x22d)]]??'\x20';if(_0x42df47[_0x52030f(0x1f5)]()===_0x2800a3[_0x52030f(0x1f5)]()&&!/[\w$]/['test'](_0x4bd65a)&&!/[\w$]/[_0x52030f(0x1f8)](_0x36ba19))return!![];}return![];}function splitEquality(_0x589b5b){const _0x4d9fd2=a295_0x515a,_0xc34982=stripOuterParentheses(_0x589b5b);let _0x85ac7=0x0,_0x3cecb2;for(let _0x3b66ea=0x0;_0x3b66ea<_0xc34982[_0x4d9fd2(0x22d)];_0x3b66ea+=0x1){const _0x11b9f6=_0xc34982[_0x3b66ea];if(_0x11b9f6==='(')_0x85ac7+=0x1;if(_0x11b9f6===')')_0x85ac7=Math[_0x4d9fd2(0x1f2)](0x0,_0x85ac7-0x1);const _0x5789d6=_0xc34982[_0x3b66ea-0x1]??'',_0x139499=_0xc34982[_0x3b66ea+0x1]??'';if(_0x11b9f6==='='&&_0x85ac7===0x0&&!/[!<>=:]/[_0x4d9fd2(0x1f8)](_0x5789d6)&&_0x139499!=='='){if(_0x3cecb2!==undefined)return null;_0x3cecb2=_0x3b66ea;}}return _0x3cecb2===undefined?null:[_0xc34982['slice'](0x0,_0x3cecb2)[_0x4d9fd2(0x1ea)](),_0xc34982['slice'](_0x3cecb2+0x1)[_0x4d9fd2(0x1ea)]()];}function parseDirectColumnReference(_0x23a736,_0x20a982){const _0x1c35e8=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/['exec'](stripOuterParentheses(_0x23a736));if(!_0x1c35e8)return null;if(normalizeIdentifier(_0x1c35e8[0x1]??'')!==normalizeIdentifier(_0x20a982))return null;return normalizeIdentifier(_0x1c35e8[0x2]??'');}function containsColumnReference(_0x2b9c27,_0x1c56bd){const _0x137d71=a295_0x515a,_0xcfa019=_0x2b9c27[_0x137d71(0x211)](/[`"]/g,''),_0x211099=_0x1c56bd['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&');return new RegExp(_0x137d71(0x1ff)+_0x211099+_0x137d71(0x213),'i')['test'](_0xcfa019);}function a295_0x15b0(){const _0x2bc60a=['has','full','table','matchedPrefix','using','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','unavailable','columns','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','min','match','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','containsUnresolvedInclude','unsupportedReason','replace','indexes','\x5cs*\x5c.\x5cs*[\x5cw$]+','index','unknown','push','map','5905630EQhuvW','slice','exec','9cbNOTL','1369431RzUcvb','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','position','search','603425xMCmtv','toLowerCase','26159IhIbFC','tableName','matchAll','INNER','JOIN_INDEX_NOT_USABLE','replaceAll','startsWith','144TQqBoD','JOIN_INDEX_MISSING','cross','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','length','split','unsupportedPredicate','558996uOxgae','inner','1yNxPHI','right','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','trim','join','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','filter','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','__sq__','2475342MEiBZj','left','max','indexOf','from','toUpperCase','some','includes','test','reduce','add','where','alias','covered','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','(?:^|[^\x5cw$])','natural','warning','246706MBTjlM'];a295_0x15b0=function(){return _0x2bc60a;};return a295_0x15b0();}function findEqualityPrefix(_0x33763c,_0x5173a2){const _0x171b54=a295_0x515a,_0x523fd7=new Set(_0x5173a2['map'](normalizeIdentifier)),_0x5614a0=[];for(const _0x452f76 of _0x33763c){if(!_0x523fd7[_0x171b54(0x203)](normalizeIdentifier(_0x452f76)))break;_0x5614a0['push'](_0x452f76);}return _0x5614a0;}function resolveTableMetadata(_0x456e4f,_0xf85526){const _0x1617ad=a295_0x515a,_0x2741a3=normalizeIdentifier(_0xf85526),_0x4c80cf=_0x456e4f[_0x1617ad(0x1ed)](_0x40888c=>normalizeIdentifier(_0x40888c[_0x1617ad(0x223)])===_0x2741a3);if(_0x4c80cf[_0x1617ad(0x22d)]===0x1)return _0x4c80cf[0x0];const _0x15c7e7=_0x2741a3[_0x1617ad(0x1f7)]('.'),_0x28946e=_0x2741a3['split']('.')['at'](-0x1),_0x268191=_0x456e4f[_0x1617ad(0x1ed)](_0x1e690b=>{const _0x10eb1d=_0x1617ad,_0x2cd4c0=normalizeIdentifier(_0x1e690b[_0x10eb1d(0x223)]);if(_0x15c7e7&&_0x2cd4c0['includes']('.'))return![];return _0x2cd4c0[_0x10eb1d(0x22e)]('.')['at'](-0x1)===_0x28946e;});return _0x268191[_0x1617ad(0x22d)]===0x1?_0x268191[0x0]:undefined;}function columnNamesMatch(_0x53336a,_0x3101b2){return normalizeIdentifier(_0x53336a)===normalizeIdentifier(_0x3101b2);}function normalizeIdentifier(_0x474c7d){const _0x5de2d9=a295_0x515a;return _0x474c7d[_0x5de2d9(0x211)](/[`"]/g,'')[_0x5de2d9(0x1ea)]()[_0x5de2d9(0x221)]();}function a295_0x515a(_0x43f3c1,_0xcd01c2){_0x43f3c1=_0x43f3c1-0x1e5;const _0x15b07f=a295_0x15b0();let _0x515ab3=_0x15b07f[_0x43f3c1];return _0x515ab3;}function isSqlClauseKeyword(_0x213135){const _0x360c3c=a295_0x515a;return new Set(['on',_0x360c3c(0x207),_0x360c3c(0x1fb),_0x360c3c(0x1eb),_0x360c3c(0x1e6),_0x360c3c(0x1f1),'right',_0x360c3c(0x204),_0x360c3c(0x22b),_0x360c3c(0x200)])[_0x360c3c(0x203)](_0x213135);}function stripOuterParentheses(_0x2698de){const _0x144abe=a295_0x515a;let _0x5ce766=_0x2698de[_0x144abe(0x1ea)]();while(_0x5ce766[_0x144abe(0x228)]('(')&&_0x5ce766['endsWith'](')')){let _0xb011f9=0x0,_0x4d579b=!![];for(let _0x1ff789=0x0;_0x1ff789<_0x5ce766[_0x144abe(0x22d)];_0x1ff789+=0x1){if(_0x5ce766[_0x1ff789]==='(')_0xb011f9+=0x1;if(_0x5ce766[_0x1ff789]===')')_0xb011f9-=0x1;if(_0xb011f9===0x0&&_0x1ff789<_0x5ce766[_0x144abe(0x22d)]-0x1){_0x4d579b=![];break;}}if(!_0x4d579b||_0xb011f9!==0x0)break;_0x5ce766=_0x5ce766['slice'](0x1,-0x1)['trim']();}return _0x5ce766;}
@@ -1 +1 @@
1
- const a296_0x10f063=a296_0x5f48;function a296_0x5f48(_0x4d7aa0,_0x140da6){_0x4d7aa0=_0x4d7aa0-0x1d8;const _0x5dcba4=a296_0x5dcb();let _0x5f4802=_0x5dcba4[_0x4d7aa0];return _0x5f4802;}(function(_0x36a226,_0x45212d){const _0x45301b=a296_0x5f48,_0x49fae6=_0x36a226();while(!![]){try{const _0x39b9cc=-parseInt(_0x45301b(0x1df))/0x1*(parseInt(_0x45301b(0x1e4))/0x2)+-parseInt(_0x45301b(0x1e5))/0x3*(parseInt(_0x45301b(0x1d9))/0x4)+-parseInt(_0x45301b(0x1dc))/0x5*(parseInt(_0x45301b(0x1e1))/0x6)+-parseInt(_0x45301b(0x1e0))/0x7*(parseInt(_0x45301b(0x1de))/0x8)+parseInt(_0x45301b(0x1e3))/0x9+-parseInt(_0x45301b(0x1dd))/0xa+-parseInt(_0x45301b(0x1e2))/0xb*(-parseInt(_0x45301b(0x1da))/0xc);if(_0x39b9cc===_0x45212d)break;else _0x49fae6['push'](_0x49fae6['shift']());}catch(_0x456731){_0x49fae6['push'](_0x49fae6['shift']());}}}(a296_0x5dcb,0x46332));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a296_0x10f063(0x1e6),LOCK_FILE_NAME=a296_0x10f063(0x1d8),TRASH_DIR_NAME='sql-trash';function a296_0x5dcb(){const _0x2baf3e=['14pTmivx','1770lRQpyG','.rabetbase','sql.lock.json','2952TikbYD','1764ekWhBP','sql','2352290zkdEVO','3251610PFCoPG','968firtar','82018SNpgNg','28819HPgCNZ','6SZGPnN','162745aplnss','3743955OuRPXM'];a296_0x5dcb=function(){return _0x2baf3e;};return a296_0x5dcb();}export function loadSqlProjectConfig(_0x3a9553,_0x15c321){const _0x28388e=a296_0x10f063,_0x2f4c5b=resolve(_0x15c321??findProjectRootDirectory()),_0x2bbfa1=DOT_DIR+'/sql',_0x3505b5=_0x2bbfa1+'/'+_0x3a9553;return{'projectRoot':_0x2f4c5b,'appCode':_0x3a9553,'sqlWorkspaceRoot':_0x2bbfa1,'sqlRoot':_0x3505b5,'sqlRootDir':resolve(_0x2f4c5b,DOT_DIR,_0x28388e(0x1db),_0x3a9553),'lockFilePath':resolve(_0x2f4c5b,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x2f4c5b,DOT_DIR,TRASH_DIR_NAME)};}
1
+ const a296_0x2b9e9c=a296_0x57a6;(function(_0x46c799,_0x1be3e0){const _0x1d5352=a296_0x57a6,_0x10bcbb=_0x46c799();while(!![]){try{const _0x558db8=-parseInt(_0x1d5352(0x16b))/0x1+-parseInt(_0x1d5352(0x169))/0x2+parseInt(_0x1d5352(0x165))/0x3+parseInt(_0x1d5352(0x166))/0x4+parseInt(_0x1d5352(0x168))/0x5+-parseInt(_0x1d5352(0x162))/0x6+parseInt(_0x1d5352(0x167))/0x7;if(_0x558db8===_0x1be3e0)break;else _0x10bcbb['push'](_0x10bcbb['shift']());}catch(_0x3743ec){_0x10bcbb['push'](_0x10bcbb['shift']());}}}(a296_0x48bb,0x77b9e));import{resolve}from'node:path';function a296_0x57a6(_0x47bb50,_0x2e020f){_0x47bb50=_0x47bb50-0x162;const _0x48bbad=a296_0x48bb();let _0x57a6fb=_0x48bbad[_0x47bb50];return _0x57a6fb;}import{findProjectRootDirectory}from'../../context.js';const DOT_DIR='.rabetbase',LOCK_FILE_NAME=a296_0x2b9e9c(0x16c),TRASH_DIR_NAME=a296_0x2b9e9c(0x16a);function a296_0x48bb(){const _0x3a764d=['/sql','sql','1853517ORzrrG','3409300ylXKoM','3936009uCTvvL','2953775KABbMy','1725966WNdYzx','sql-trash','934990wxyERs','sql.lock.json','2009010HcGyZz'];a296_0x48bb=function(){return _0x3a764d;};return a296_0x48bb();}export function loadSqlProjectConfig(_0x267870,_0x51a931){const _0x41360c=a296_0x2b9e9c,_0x671b1e=resolve(_0x51a931??findProjectRootDirectory()),_0x1c38b8=DOT_DIR+_0x41360c(0x163),_0x4821ab=_0x1c38b8+'/'+_0x267870;return{'projectRoot':_0x671b1e,'appCode':_0x267870,'sqlWorkspaceRoot':_0x1c38b8,'sqlRoot':_0x4821ab,'sqlRootDir':resolve(_0x671b1e,DOT_DIR,_0x41360c(0x164),_0x267870),'lockFilePath':resolve(_0x671b1e,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x671b1e,DOT_DIR,TRASH_DIR_NAME)};}
@@ -1 +1 @@
1
- (function(_0x21e18a,_0x3bda8b){const _0x3373a4=a297_0x358e,_0x16df5e=_0x21e18a();while(!![]){try{const _0x442f0a=parseInt(_0x3373a4(0x157))/0x1*(parseInt(_0x3373a4(0x15c))/0x2)+parseInt(_0x3373a4(0x15b))/0x3+parseInt(_0x3373a4(0x158))/0x4+-parseInt(_0x3373a4(0x154))/0x5+-parseInt(_0x3373a4(0x15e))/0x6+parseInt(_0x3373a4(0x161))/0x7+-parseInt(_0x3373a4(0x14b))/0x8;if(_0x442f0a===_0x3bda8b)break;else _0x16df5e['push'](_0x16df5e['shift']());}catch(_0x293222){_0x16df5e['push'](_0x16df5e['shift']());}}}(a297_0x2350,0x230c4));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x4e70a5){const _0x5e7676=a297_0x358e;if(_0x4e70a5===_0x5e7676(0x159))return _0x5e7676(0x155);if(_0x4e70a5===_0x5e7676(0x162))return _0x5e7676(0x14a);return undefined;}async function scanSqlFilesRecursively(_0x22afe5,_0x2e8fbe){const _0xe8be02=a297_0x358e,_0x410440=[];try{const _0x3cc9d9=await readdir(_0x22afe5,{'withFileTypes':!![]});for(const _0x1ba23a of _0x3cc9d9){const _0x402959=join(_0x22afe5,_0x1ba23a[_0xe8be02(0x160)]);if(_0x1ba23a[_0xe8be02(0x14f)]()){_0x410440[_0xe8be02(0x150)](...await scanSqlFilesRecursively(_0x402959,_0x2e8fbe));continue;}if(!_0x1ba23a[_0xe8be02(0x14c)]())continue;const _0x49e8c6=extname(_0x1ba23a['name'])['toLowerCase'](),_0xaf66f6=extensionToMode(_0x49e8c6);if(!_0xaf66f6)continue;const _0x3f1aa=relative(_0x2e8fbe,_0x402959)[_0xe8be02(0x149)](/\\/g,'/'),_0x1f2252=_0x3f1aa[_0xe8be02(0x156)]('/')[_0xe8be02(0x152)](Boolean),_0x287a1b=parseSqlPath(_0x1f2252,_0x1ba23a[_0xe8be02(0x160)],_0x49e8c6);if(!_0x287a1b)continue;_0x410440[_0xe8be02(0x150)]({'sqlCode':_0x287a1b[_0xe8be02(0x15d)],'sqlName':_0x287a1b[_0xe8be02(0x145)],'dbDirectory':_0x1f2252[0x0],'filePath':_0x402959,'relativePath':_0x3f1aa,'lockKey':_0x287a1b[_0xe8be02(0x15d)],'mode':_0xaf66f6});}}catch(_0x34d9da){if(_0x34d9da['code']!==_0xe8be02(0x15a))throw _0x34d9da;}return _0x410440;}function a297_0x2350(){const _0x2c6a2d=['640752EjXVdW','dbId','name','1319402rUywal','.xml','test','sqlName','sqlRootDir','dbName','slice','replace','mybatisXml','1748200QdMvhK','isFile','indexOf','path','isDirectory','push','length','filter','mode','963280vQHrsR','sql','split','22JYPbKj','507024BqEyPd','.sql','ENOENT','635931ELkmbN','12210bWDzJL','sqlCode'];a297_0x2350=function(){return _0x2c6a2d;};return a297_0x2350();}export async function scanLocalSqlQueries(_0x584d03){const _0x21f33b=a297_0x358e;return scanSqlFilesRecursively(_0x584d03[_0x21f33b(0x146)],_0x584d03[_0x21f33b(0x146)]);}function a297_0x358e(_0x589fb5,_0x27764e){_0x589fb5=_0x589fb5-0x145;const _0x235075=a297_0x2350();let _0x358ece=_0x235075[_0x589fb5];return _0x358ece;}export function resolveLocalSqlFilePath(_0x30f6ab,_0xeb52bb,_0x5e84e7){const _0x10690e=a297_0x358e,_0x4e9e21=_0x5e84e7?.[_0x10690e(0x14e)]||(_0x5e84e7?.[_0x10690e(0x145)]||_0x5e84e7?.[_0x10690e(0x147)]?buildSqlRelativePath(_0xeb52bb,_0x5e84e7?.['sqlName'],_0x5e84e7?.['dbName'],_0x5e84e7?.[_0x10690e(0x153)]||'sql',_0x5e84e7?.[_0x10690e(0x15f)]):buildDefaultSqlFileName(_0xeb52bb,_0x5e84e7?.[_0x10690e(0x153)]||'sql'));return join(_0x30f6ab[_0x10690e(0x146)],_0x4e9e21);}export async function directoryExists(_0x3dd6b4){const _0xf5b5d8=a297_0x358e;try{const _0x46b2a1=await stat(_0x3dd6b4);return _0x46b2a1[_0xf5b5d8(0x14f)]();}catch{return![];}}function parseSqlPath(_0x488d60,_0x2e12d7,_0x2bc40a){const _0x860e32=a297_0x358e,_0x123e21=_0x2e12d7['slice'](0x0,-_0x2bc40a['length']);if(_0x488d60['length']<0x2)return null;const _0x27f120=_0x123e21[_0x860e32(0x14d)]('_');if(_0x27f120<=0x0||_0x27f120>=_0x123e21[_0x860e32(0x151)]-0x1)return null;const _0x52b506=_0x123e21[_0x860e32(0x148)](0x0,_0x27f120);if(!isLikelySqlCode(_0x52b506))return null;return{'sqlCode':_0x52b506,'sqlName':_0x123e21['slice'](_0x27f120+0x1)};}function isLikelySqlCode(_0x49a8c5){const _0x41368b=a297_0x358e;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x41368b(0x163)](_0x49a8c5);}
1
+ function a297_0x3861(){const _0x38c5f3=['isFile','split','2804740ADMDiN','21EeQLbR','length','.sql','test','74ycFOWO','2060648tuwnPw','path','ENOENT','sql','replace','dbName','1102350DRrJIo','mode','60kNJdOB','.xml','sqlCode','name','filter','push','slice','9JEcYJX','sqlName','toLowerCase','22WvMyuE','63zdqPFG','isDirectory','mybatisXml','21311712uShrFq','235237torqEF','76260TRAlOS','sqlRootDir','indexOf'];a297_0x3861=function(){return _0x38c5f3;};return a297_0x3861();}(function(_0x258e5d,_0x26a498){const _0x4d86e9=a297_0x5e47,_0x1896e2=_0x258e5d();while(!![]){try{const _0x12cf29=-parseInt(_0x4d86e9(0x109))/0x1+-parseInt(_0x4d86e9(0xf1))/0x2*(parseInt(_0x4d86e9(0x105))/0x3)+parseInt(_0x4d86e9(0x10a))/0x4*(parseInt(_0x4d86e9(0xfa))/0x5)+parseInt(_0x4d86e9(0xf8))/0x6*(-parseInt(_0x4d86e9(0xed))/0x7)+-parseInt(_0x4d86e9(0xf2))/0x8*(parseInt(_0x4d86e9(0x101))/0x9)+-parseInt(_0x4d86e9(0xec))/0xa*(parseInt(_0x4d86e9(0x104))/0xb)+parseInt(_0x4d86e9(0x108))/0xc;if(_0x12cf29===_0x26a498)break;else _0x1896e2['push'](_0x1896e2['shift']());}catch(_0x2d9e95){_0x1896e2['push'](_0x1896e2['shift']());}}}(a297_0x3861,0x616be));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x5602a0){const _0x12adaa=a297_0x5e47;if(_0x5602a0===_0x12adaa(0xef))return _0x12adaa(0xf5);if(_0x5602a0===_0x12adaa(0xfb))return _0x12adaa(0x107);return undefined;}async function scanSqlFilesRecursively(_0xa3654d,_0x5264c8){const _0x53e1db=a297_0x5e47,_0x94dcc5=[];try{const _0x190acf=await readdir(_0xa3654d,{'withFileTypes':!![]});for(const _0x450ced of _0x190acf){const _0x2aadfa=join(_0xa3654d,_0x450ced[_0x53e1db(0xfd)]);if(_0x450ced[_0x53e1db(0x106)]()){_0x94dcc5['push'](...await scanSqlFilesRecursively(_0x2aadfa,_0x5264c8));continue;}if(!_0x450ced[_0x53e1db(0xea)]())continue;const _0x30a9ff=extname(_0x450ced[_0x53e1db(0xfd)])[_0x53e1db(0x103)](),_0x3865c0=extensionToMode(_0x30a9ff);if(!_0x3865c0)continue;const _0x144895=relative(_0x5264c8,_0x2aadfa)[_0x53e1db(0xf6)](/\\/g,'/'),_0xbe7887=_0x144895[_0x53e1db(0xeb)]('/')[_0x53e1db(0xfe)](Boolean),_0x4c79fe=parseSqlPath(_0xbe7887,_0x450ced[_0x53e1db(0xfd)],_0x30a9ff);if(!_0x4c79fe)continue;_0x94dcc5[_0x53e1db(0xff)]({'sqlCode':_0x4c79fe[_0x53e1db(0xfc)],'sqlName':_0x4c79fe[_0x53e1db(0x102)],'dbDirectory':_0xbe7887[0x0],'filePath':_0x2aadfa,'relativePath':_0x144895,'lockKey':_0x4c79fe[_0x53e1db(0xfc)],'mode':_0x3865c0});}}catch(_0x16df66){if(_0x16df66['code']!==_0x53e1db(0xf4))throw _0x16df66;}return _0x94dcc5;}export async function scanLocalSqlQueries(_0x147546){const _0x1c7432=a297_0x5e47;return scanSqlFilesRecursively(_0x147546[_0x1c7432(0x10b)],_0x147546['sqlRootDir']);}export function resolveLocalSqlFilePath(_0x29fef4,_0x9d3bb4,_0x4c21c9){const _0x17b025=a297_0x5e47,_0x3e9c16=_0x4c21c9?.[_0x17b025(0xf3)]||(_0x4c21c9?.[_0x17b025(0x102)]||_0x4c21c9?.[_0x17b025(0xf7)]?buildSqlRelativePath(_0x9d3bb4,_0x4c21c9?.[_0x17b025(0x102)],_0x4c21c9?.[_0x17b025(0xf7)],_0x4c21c9?.[_0x17b025(0xf9)]||_0x17b025(0xf5),_0x4c21c9?.['dbId']):buildDefaultSqlFileName(_0x9d3bb4,_0x4c21c9?.[_0x17b025(0xf9)]||_0x17b025(0xf5)));return join(_0x29fef4[_0x17b025(0x10b)],_0x3e9c16);}function a297_0x5e47(_0x59978b,_0x4d8e7d){_0x59978b=_0x59978b-0xe9;const _0x3861c1=a297_0x3861();let _0x5e4789=_0x3861c1[_0x59978b];return _0x5e4789;}export async function directoryExists(_0x40a8c9){const _0x5c16ff=a297_0x5e47;try{const _0x1e1baf=await stat(_0x40a8c9);return _0x1e1baf[_0x5c16ff(0x106)]();}catch{return![];}}function parseSqlPath(_0xeb9140,_0x498558,_0x2152f0){const _0x45ed52=a297_0x5e47,_0x15e109=_0x498558['slice'](0x0,-_0x2152f0[_0x45ed52(0xee)]);if(_0xeb9140[_0x45ed52(0xee)]<0x2)return null;const _0x17488d=_0x15e109[_0x45ed52(0xe9)]('_');if(_0x17488d<=0x0||_0x17488d>=_0x15e109[_0x45ed52(0xee)]-0x1)return null;const _0x5334bd=_0x15e109['slice'](0x0,_0x17488d);if(!isLikelySqlCode(_0x5334bd))return null;return{'sqlCode':_0x5334bd,'sqlName':_0x15e109[_0x45ed52(0x100)](_0x17488d+0x1)};}function isLikelySqlCode(_0x1ae360){const _0x6dee79=a297_0x5e47;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x6dee79(0xf0)](_0x1ae360);}
@@ -1 +1 @@
1
- (function(_0x1baf76,_0x2cb2c9){const _0x5141e=a298_0x3734,_0x3531c8=_0x1baf76();while(!![]){try{const _0x5bf35b=-parseInt(_0x5141e(0x7c))/0x1+-parseInt(_0x5141e(0x7d))/0x2+parseInt(_0x5141e(0x7a))/0x3*(-parseInt(_0x5141e(0x7b))/0x4)+-parseInt(_0x5141e(0x75))/0x5*(-parseInt(_0x5141e(0x81))/0x6)+parseInt(_0x5141e(0x7f))/0x7+-parseInt(_0x5141e(0x80))/0x8+parseInt(_0x5141e(0x77))/0x9;if(_0x5bf35b===_0x2cb2c9)break;else _0x3531c8['push'](_0x3531c8['shift']());}catch(_0x4e1506){_0x3531c8['push'](_0x3531c8['shift']());}}}(a298_0x2243,0x21d11));import{readFile}from'node:fs/promises';import a298_0x253f94 from'node:crypto';function a298_0x2243(){const _0x2c842d=['update','150NAJtNA','11944GijmXn','161313JrUYBR','542660Eyrajj','utf8','277851QkYBHO','1432120frxJpc','10242vYunZw','10yNHfcu','createHash','7707276wmtnUB','hex'];a298_0x2243=function(){return _0x2c842d;};return a298_0x2243();}export function computeSqlContentHash(_0x47b9d9){const _0x426cd0=a298_0x3734;return a298_0x253f94[_0x426cd0(0x76)]('md5')[_0x426cd0(0x79)](_0x47b9d9)['digest'](_0x426cd0(0x78));}function a298_0x3734(_0x35631a,_0x4a7ebf){_0x35631a=_0x35631a-0x75;const _0x224386=a298_0x2243();let _0x373491=_0x224386[_0x35631a];return _0x373491;}export async function computeSqlFileHash(_0x4b16f2){const _0x4e7834=a298_0x3734,_0x1ce6df=await readFile(_0x4b16f2,_0x4e7834(0x7e));return computeSqlContentHash(_0x1ce6df);}
1
+ (function(_0x3922f7,_0x1af708){const _0x463e5f=a298_0x4e0b,_0x8cbc99=_0x3922f7();while(!![]){try{const _0x1d6af1=parseInt(_0x463e5f(0xe8))/0x1*(-parseInt(_0x463e5f(0xe7))/0x2)+parseInt(_0x463e5f(0xe9))/0x3*(-parseInt(_0x463e5f(0xea))/0x4)+parseInt(_0x463e5f(0xeb))/0x5+parseInt(_0x463e5f(0xe1))/0x6*(-parseInt(_0x463e5f(0xe6))/0x7)+-parseInt(_0x463e5f(0xe5))/0x8+parseInt(_0x463e5f(0xe4))/0x9+parseInt(_0x463e5f(0xec))/0xa;if(_0x1d6af1===_0x1af708)break;else _0x8cbc99['push'](_0x8cbc99['shift']());}catch(_0x1ab54c){_0x8cbc99['push'](_0x8cbc99['shift']());}}}(a298_0x1736,0x2bc83));function a298_0x1736(){const _0x1bcb1c=['2689016mIxDey','121765lThWHB','6SNiFFC','59260uDQoiL','3hQkiOr','881364uVispT','12465TatArS','10427790VHCxlG','96gOTrOF','update','digest','1319643izLEId'];a298_0x1736=function(){return _0x1bcb1c;};return a298_0x1736();}import{readFile}from'node:fs/promises';import a298_0x12b53d from'node:crypto';export function computeSqlContentHash(_0x57a8eb){const _0x1c275e=a298_0x4e0b;return a298_0x12b53d['createHash']('md5')[_0x1c275e(0xe2)](_0x57a8eb)[_0x1c275e(0xe3)]('hex');}function a298_0x4e0b(_0x37859f,_0x43e819){_0x37859f=_0x37859f-0xe1;const _0x1736c5=a298_0x1736();let _0x4e0bd6=_0x1736c5[_0x37859f];return _0x4e0bd6;}export async function computeSqlFileHash(_0x361564){const _0x50adb5=await readFile(_0x361564,'utf8');return computeSqlContentHash(_0x50adb5);}
@@ -1 +1 @@
1
- function a299_0x1f84(_0x5ad801,_0x5e9e41){_0x5ad801=_0x5ad801-0x16c;const _0x47bfb9=a299_0x47bf();let _0x1f8487=_0x47bfb9[_0x5ad801];return _0x1f8487;}(function(_0x8101dc,_0x33be45){const _0x17be5c=a299_0x1f84,_0x31d815=_0x8101dc();while(!![]){try{const _0x41027e=parseInt(_0x17be5c(0x17f))/0x1+parseInt(_0x17be5c(0x171))/0x2*(-parseInt(_0x17be5c(0x176))/0x3)+-parseInt(_0x17be5c(0x17a))/0x4+parseInt(_0x17be5c(0x16f))/0x5*(parseInt(_0x17be5c(0x16d))/0x6)+parseInt(_0x17be5c(0x181))/0x7*(parseInt(_0x17be5c(0x175))/0x8)+-parseInt(_0x17be5c(0x177))/0x9+-parseInt(_0x17be5c(0x173))/0xa*(-parseInt(_0x17be5c(0x174))/0xb);if(_0x41027e===_0x33be45)break;else _0x31d815['push'](_0x31d815['shift']());}catch(_0x28a4f5){_0x31d815['push'](_0x31d815['shift']());}}}(a299_0x47bf,0x9ec50));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x11a957,_0x3ae406,_0x41469f,_0x5f5991){const _0x51a78a=a299_0x1f84,_0x1a142d=_0x11a957??createEmptySqlLock();let _0x2e18ea=_0x1a142d[_0x51a78a(0x17c)][_0x3ae406];if(!_0x2e18ea)return _0x2e18ea={'sqlRoot':_0x41469f,'lastSync':'','sqls':{}},_0x1a142d['apps'][_0x3ae406]=_0x2e18ea,{'lockData':_0x1a142d,'appLock':_0x2e18ea};if(!_0x2e18ea[_0x51a78a(0x178)])_0x2e18ea[_0x51a78a(0x178)]=_0x41469f;else{if(_0x2e18ea[_0x51a78a(0x178)]!==_0x41469f)throw new Error(_0x5f5991+_0x51a78a(0x16c)+_0x41469f+_0x51a78a(0x17d)+_0x2e18ea[_0x51a78a(0x178)]+'\x22.\x20'+_0x51a78a(0x172));}return!_0x2e18ea[_0x51a78a(0x16e)]&&(_0x2e18ea[_0x51a78a(0x16e)]={}),!_0x2e18ea[_0x51a78a(0x179)]&&(_0x2e18ea['lastSync']=''),{'lockData':_0x1a142d,'appLock':_0x2e18ea};}export async function readSqlLockFile(_0x2f4f43){const _0xbdb6ab=a299_0x1f84;try{const _0x5303e8=await readFile(_0x2f4f43,_0xbdb6ab(0x17b));return JSON[_0xbdb6ab(0x17e)](_0x5303e8);}catch(_0x76c580){if(_0x76c580[_0xbdb6ab(0x182)]===_0xbdb6ab(0x170))return null;throw new Error(_0xbdb6ab(0x180)+String(_0x76c580));}}export async function writeSqlLockFile(_0x4e7b71,_0x320733){const _0x53be07=a299_0x1f84;await mkdir(dirname(_0x4e7b71),{'recursive':!![]}),await writeFile(_0x4e7b71,JSON['stringify'](_0x320733,null,0x2),_0x53be07(0x17b));}function a299_0x47bf(){const _0x306883=['804EovTvg','sqls','9895wVQque','ENOENT','2519304RWzppj','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','56590lvfvMJ','6611rRctDf','17192lGezGI','3fDKDLQ','8636688FGaoUR','sqlRoot','lastSync','4164196gJOhcJ','utf8','apps','\x22\x20vs\x20lock\x20\x22','parse','102574PGYxxx','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','462uktasF','code',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22'];a299_0x47bf=function(){return _0x306883;};return a299_0x47bf();}
1
+ function a299_0x1471(){const _0x177356=['code',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','91oWtPGy','3BNkZNY','4696628uMalBX','54xkoXRz','utf8','\x22.\x20','11365744WNgYdr','ENOENT','5496615kkFmxN','\x22\x20vs\x20lock\x20\x22','1659670UrHonP','276abpjJr','47514NHyEXk','2VHbFxn','sqlRoot','apps','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','168380UFsjGj','1616494JDRXgZ','lastSync'];a299_0x1471=function(){return _0x177356;};return a299_0x1471();}(function(_0x51db10,_0x273371){const _0x370c25=a299_0x40c8,_0x37e48f=_0x51db10();while(!![]){try{const _0x5cefb2=parseInt(_0x370c25(0x169))/0x1*(-parseInt(_0x370c25(0x16d))/0x2)+-parseInt(_0x370c25(0x173))/0x3*(parseInt(_0x370c25(0x174))/0x4)+parseInt(_0x370c25(0x17a))/0x5+parseInt(_0x370c25(0x168))/0x6*(parseInt(_0x370c25(0x172))/0x7)+-parseInt(_0x370c25(0x178))/0x8+-parseInt(_0x370c25(0x175))/0x9*(parseInt(_0x370c25(0x166))/0xa)+parseInt(_0x370c25(0x16e))/0xb*(parseInt(_0x370c25(0x167))/0xc);if(_0x5cefb2===_0x273371)break;else _0x37e48f['push'](_0x37e48f['shift']());}catch(_0x5efc1b){_0x37e48f['push'](_0x37e48f['shift']());}}}(a299_0x1471,0xc8f73));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';function a299_0x40c8(_0x527469,_0x12d316){_0x527469=_0x527469-0x165;const _0x1471b3=a299_0x1471();let _0x40c8a0=_0x1471b3[_0x527469];return _0x40c8a0;}export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x4f6ace,_0x1f1e3f,_0x283ad7,_0x544e3c){const _0x22eb89=a299_0x40c8,_0x5219b2=_0x4f6ace??createEmptySqlLock();let _0x4f104c=_0x5219b2['apps'][_0x1f1e3f];if(!_0x4f104c)return _0x4f104c={'sqlRoot':_0x283ad7,'lastSync':'','sqls':{}},_0x5219b2[_0x22eb89(0x16b)][_0x1f1e3f]=_0x4f104c,{'lockData':_0x5219b2,'appLock':_0x4f104c};if(!_0x4f104c[_0x22eb89(0x16a)])_0x4f104c['sqlRoot']=_0x283ad7;else{if(_0x4f104c[_0x22eb89(0x16a)]!==_0x283ad7)throw new Error(_0x544e3c+_0x22eb89(0x171)+_0x283ad7+_0x22eb89(0x165)+_0x4f104c['sqlRoot']+_0x22eb89(0x177)+'Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x4f104c['sqls']&&(_0x4f104c['sqls']={}),!_0x4f104c[_0x22eb89(0x16f)]&&(_0x4f104c[_0x22eb89(0x16f)]=''),{'lockData':_0x5219b2,'appLock':_0x4f104c};}export async function readSqlLockFile(_0x16e7c4){const _0x454f37=a299_0x40c8;try{const _0x3f5cba=await readFile(_0x16e7c4,_0x454f37(0x176));return JSON['parse'](_0x3f5cba);}catch(_0xee48d7){if(_0xee48d7[_0x454f37(0x170)]===_0x454f37(0x179))return null;throw new Error(_0x454f37(0x16c)+String(_0xee48d7));}}export async function writeSqlLockFile(_0x2eff99,_0x23da21){const _0x1c59d1=a299_0x40c8;await mkdir(dirname(_0x2eff99),{'recursive':!![]}),await writeFile(_0x2eff99,JSON['stringify'](_0x23da21,null,0x2),_0x1c59d1(0x176));}
@@ -1 +1 @@
1
- (function(_0x4b1591,_0x1d479e){const _0x3a4e18=a301_0x490b,_0x31f58f=_0x4b1591();while(!![]){try{const _0x1d9e6d=parseInt(_0x3a4e18(0xd4))/0x1+-parseInt(_0x3a4e18(0xcd))/0x2*(parseInt(_0x3a4e18(0xd1))/0x3)+-parseInt(_0x3a4e18(0xcb))/0x4*(-parseInt(_0x3a4e18(0xca))/0x5)+-parseInt(_0x3a4e18(0xcf))/0x6*(-parseInt(_0x3a4e18(0xd0))/0x7)+parseInt(_0x3a4e18(0xcc))/0x8+-parseInt(_0x3a4e18(0xd7))/0x9+-parseInt(_0x3a4e18(0xce))/0xa*(parseInt(_0x3a4e18(0xd5))/0xb);if(_0x1d9e6d===_0x1d479e)break;else _0x31f58f['push'](_0x31f58f['shift']());}catch(_0x4bf766){_0x31f58f['push'](_0x31f58f['shift']());}}}(a301_0x2e26,0x98a5b));import{detectSqlSourceMode}from'../../core/sql-validator.js';export function detectSqlMode(_0x5b303e){return detectSqlSourceMode(_0x5b303e);}export function getSqlFileExtension(_0x37d52e){const _0x25213b=a301_0x490b;return _0x37d52e==='mybatisXml'?'.xml':_0x25213b(0xd8);}function a301_0x490b(_0x4c9971,_0x5e9d65){_0x4c9971=_0x4c9971-0xca;const _0x2e2654=a301_0x2e26();let _0x490b51=_0x2e2654[_0x4c9971];return _0x490b51;}export function buildDefaultSqlFileName(_0x3a331a,_0x466747){return''+_0x3a331a+getSqlFileExtension(_0x466747);}export function sanitizeSqlPathSegment(_0x2abadd,_0x480dae){const _0x53fbc9=a301_0x490b,_0x2c05d4=String(_0x2abadd??'')[_0x53fbc9(0xd3)](),_0x149d97=_0x2c05d4[_0x53fbc9(0xd6)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x53fbc9(0xd6)](/\s+/g,'-')[_0x53fbc9(0xd6)](/-+/g,'-')['replace'](/^\.+/,'')[_0x53fbc9(0xd6)](/\.+$/,'')[_0x53fbc9(0xd6)](/^-+/,'')[_0x53fbc9(0xd6)](/-+$/,'');return _0x149d97||_0x480dae;}function a301_0x2e26(){const _0x178715=['2484444xlSCqI','8702304KpszGU','4gUrtzX','186740jfDSoh','6018XZzmNa','623sLhFZG','1470441ecdcGs','unknown-sql','trim','554276RejxoP','693wpXfMo','replace','1723986jGxOUk','.sql','10QVWTyt'];a301_0x2e26=function(){return _0x178715;};return a301_0x2e26();}export function buildDbDirectoryName(_0x51997a,_0x583090){return sanitizeSqlPathSegment(_0x51997a,_0x583090!=null?'db-'+_0x583090:'unknown-db');}export function buildSqlRelativePath(_0xfaac06,_0x588e3f,_0xb9c180,_0x5b6370,_0x355afa){const _0x5addcb=a301_0x490b,_0x1d9aeb=buildDbDirectoryName(_0xb9c180,_0x355afa),_0x213480=sanitizeSqlPathSegment(_0xfaac06,_0x5addcb(0xd2)),_0x26431e=sanitizeSqlPathSegment(_0x588e3f,_0x213480);return _0x1d9aeb+'/'+_0x213480+'_'+_0x26431e+getSqlFileExtension(_0x5b6370);}
1
+ (function(_0x3a5f4c,_0x2356b6){const _0x41dfac=a301_0x485d,_0x5df968=_0x3a5f4c();while(!![]){try{const _0x4cdd98=parseInt(_0x41dfac(0x158))/0x1+-parseInt(_0x41dfac(0x156))/0x2+-parseInt(_0x41dfac(0x157))/0x3*(parseInt(_0x41dfac(0x151))/0x4)+parseInt(_0x41dfac(0x159))/0x5*(-parseInt(_0x41dfac(0x15e))/0x6)+parseInt(_0x41dfac(0x15c))/0x7+-parseInt(_0x41dfac(0x150))/0x8*(parseInt(_0x41dfac(0x154))/0x9)+parseInt(_0x41dfac(0x152))/0xa;if(_0x4cdd98===_0x2356b6)break;else _0x5df968['push'](_0x5df968['shift']());}catch(_0x2f8fc4){_0x5df968['push'](_0x5df968['shift']());}}}(a301_0x14f0,0x30156));function a301_0x14f0(){const _0x1b718e=['trim','replace','2944136Fjgrhs','28JgMwsZ','5717780BmPEXc','mybatisXml','9XQhlHq','.xml','352616jzXXYb','52431QXRTFT','343352wipsyh','80EshJhm','.sql','db-','981708nCIYGH','unknown-sql','71910aHcPjc'];a301_0x14f0=function(){return _0x1b718e;};return a301_0x14f0();}import{detectSqlSourceMode}from'../../core/sql-validator.js';export function detectSqlMode(_0x55ffd4){return detectSqlSourceMode(_0x55ffd4);}export function getSqlFileExtension(_0x251bcd){const _0x5928ee=a301_0x485d;return _0x251bcd===_0x5928ee(0x153)?_0x5928ee(0x155):_0x5928ee(0x15a);}function a301_0x485d(_0x4bbb82,_0x4cc84e){_0x4bbb82=_0x4bbb82-0x14f;const _0x14f01e=a301_0x14f0();let _0x485dbe=_0x14f01e[_0x4bbb82];return _0x485dbe;}export function buildDefaultSqlFileName(_0x46c3ff,_0x228c63){return''+_0x46c3ff+getSqlFileExtension(_0x228c63);}export function sanitizeSqlPathSegment(_0x1ef595,_0x3d38f1){const _0x167ce8=a301_0x485d,_0x58e4e4=String(_0x1ef595??'')[_0x167ce8(0x15f)](),_0x9e3d33=_0x58e4e4[_0x167ce8(0x14f)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')['replace'](/\s+/g,'-')[_0x167ce8(0x14f)](/-+/g,'-')[_0x167ce8(0x14f)](/^\.+/,'')['replace'](/\.+$/,'')[_0x167ce8(0x14f)](/^-+/,'')['replace'](/-+$/,'');return _0x9e3d33||_0x3d38f1;}export function buildDbDirectoryName(_0x4e0443,_0x219c23){const _0x279047=a301_0x485d;return sanitizeSqlPathSegment(_0x4e0443,_0x219c23!=null?_0x279047(0x15b)+_0x219c23:'unknown-db');}export function buildSqlRelativePath(_0x254438,_0x412b66,_0x17cf7d,_0x1bfd74,_0x3d3432){const _0x151a77=a301_0x485d,_0x3a1810=buildDbDirectoryName(_0x17cf7d,_0x3d3432),_0x3c696a=sanitizeSqlPathSegment(_0x254438,_0x151a77(0x15d)),_0x2c13d6=sanitizeSqlPathSegment(_0x412b66,_0x3c696a);return _0x3a1810+'/'+_0x3c696a+'_'+_0x2c13d6+getSqlFileExtension(_0x1bfd74);}