@lovrabet/rabetbase-cli 2.5.3-beta.3 → 2.5.3-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (361) 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/index.js +1 -1
  26. package/lib/commands/app/list.js +1 -1
  27. package/lib/commands/app/members-list.js +1 -1
  28. package/lib/commands/app/remote-directory.js +1 -1
  29. package/lib/commands/app/shared.js +1 -1
  30. package/lib/commands/app-config/delete.js +1 -1
  31. package/lib/commands/app-config/get.js +1 -1
  32. package/lib/commands/app-config/index.js +1 -1
  33. package/lib/commands/app-config/list.js +1 -1
  34. package/lib/commands/app-config/set.js +1 -1
  35. package/lib/commands/app-config/shared.js +1 -1
  36. package/lib/commands/auth/index.js +1 -1
  37. package/lib/commands/bff/create.js +1 -1
  38. package/lib/commands/bff/delete.js +1 -1
  39. package/lib/commands/bff/detail.js +1 -1
  40. package/lib/commands/bff/index.js +1 -1
  41. package/lib/commands/bff/list.js +1 -1
  42. package/lib/commands/bff/logs.js +1 -1
  43. package/lib/commands/bff/pull.js +1 -1
  44. package/lib/commands/bff/push.js +1 -1
  45. package/lib/commands/bff/status.js +1 -1
  46. package/lib/commands/cli-skill/index.js +1 -1
  47. package/lib/commands/cli-update.js +1 -1
  48. package/lib/commands/codegen/index.js +1 -1
  49. package/lib/commands/codegen/sdk.js +1 -1
  50. package/lib/commands/codegen/sql.js +1 -1
  51. package/lib/commands/common/app-registry.js +1 -1
  52. package/lib/commands/common/app-selector.js +1 -1
  53. package/lib/commands/common/async-task.js +1 -1
  54. package/lib/commands/common/dry-run.js +1 -1
  55. package/lib/commands/common/flags.js +1 -1
  56. package/lib/commands/common/local-file.js +1 -1
  57. package/lib/commands/common/validate.js +1 -1
  58. package/lib/commands/config/delete.js +1 -1
  59. package/lib/commands/config/get.js +1 -1
  60. package/lib/commands/config/index.js +1 -1
  61. package/lib/commands/config/init.js +1 -1
  62. package/lib/commands/config/list.js +1 -1
  63. package/lib/commands/config/set.js +1 -1
  64. package/lib/commands/config/shared.js +1 -1
  65. package/lib/commands/dataset/batch-design.js +1 -1
  66. package/lib/commands/dataset/business-group-update.js +1 -1
  67. package/lib/commands/dataset/business-groups.js +1 -1
  68. package/lib/commands/dataset/capability.js +1 -1
  69. package/lib/commands/dataset/cross-relation-create.js +1 -1
  70. package/lib/commands/dataset/cross-relation-delete.js +1 -1
  71. package/lib/commands/dataset/cross-relation-list.js +1 -1
  72. package/lib/commands/dataset/cross-relation-shared.js +1 -1
  73. package/lib/commands/dataset/cross-relation-update.js +1 -1
  74. package/lib/commands/dataset/delete.js +1 -1
  75. package/lib/commands/dataset/detail.js +1 -1
  76. package/lib/commands/dataset/extend-update.js +1 -1
  77. package/lib/commands/dataset/field-restore.js +1 -1
  78. package/lib/commands/dataset/field-update.js +1 -1
  79. package/lib/commands/dataset/generate.js +1 -1
  80. package/lib/commands/dataset/index.js +1 -1
  81. package/lib/commands/dataset/list.js +1 -1
  82. package/lib/commands/dataset/operations.js +1 -1
  83. package/lib/commands/dataset/relation-audit.js +1 -1
  84. package/lib/commands/dataset/relation-create.js +1 -1
  85. package/lib/commands/dataset/relation-delete.js +1 -1
  86. package/lib/commands/dataset/relation-shared.js +1 -1
  87. package/lib/commands/dataset/relation-update.js +1 -1
  88. package/lib/commands/dataset/relations.js +1 -1
  89. package/lib/commands/dataset/rename.js +1 -1
  90. package/lib/commands/dataset/restore.js +1 -1
  91. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  92. package/lib/commands/db/analysis-batching.js +1 -1
  93. package/lib/commands/db/analyze-batch-plan.js +1 -1
  94. package/lib/commands/db/analyze-cancel.js +1 -1
  95. package/lib/commands/db/analyze-start.js +1 -1
  96. package/lib/commands/db/analyze-status.js +1 -1
  97. package/lib/commands/db/create.js +1 -1
  98. package/lib/commands/db/delete.js +1 -1
  99. package/lib/commands/db/detail.js +1 -1
  100. package/lib/commands/db/diff-refresh-start.js +1 -1
  101. package/lib/commands/db/diff-refresh-status.js +1 -1
  102. package/lib/commands/db/diff.js +1 -1
  103. package/lib/commands/db/index.js +1 -1
  104. package/lib/commands/db/list.js +1 -1
  105. package/lib/commands/db/shared.js +1 -1
  106. package/lib/commands/db/table-diff-shared.js +1 -1
  107. package/lib/commands/db/tables.js +1 -1
  108. package/lib/commands/db/test.js +1 -1
  109. package/lib/commands/db/update.js +1 -1
  110. package/lib/commands/deployment/index.js +1 -1
  111. package/lib/commands/deployment/sync-all.js +1 -1
  112. package/lib/commands/deployment/sync-jobs.js +1 -1
  113. package/lib/commands/deployment/sync-status.js +1 -1
  114. package/lib/commands/doctor.js +1 -1
  115. package/lib/commands/file/index.js +1 -1
  116. package/lib/commands/flow/create.js +1 -1
  117. package/lib/commands/flow/detail.js +1 -1
  118. package/lib/commands/flow/index.js +1 -1
  119. package/lib/commands/flow/list.js +1 -1
  120. package/lib/commands/flow/publish.js +1 -1
  121. package/lib/commands/flow/runtime-resources-shared.js +1 -1
  122. package/lib/commands/flow/runtime-role-list.js +1 -1
  123. package/lib/commands/flow/runtime-role-user-list.js +1 -1
  124. package/lib/commands/flow/runtime-user-search.js +1 -1
  125. package/lib/commands/flow/shared.js +1 -1
  126. package/lib/commands/flow/update.js +1 -1
  127. package/lib/commands/flow/validate.js +1 -1
  128. package/lib/commands/instant-api-policy/current.js +1 -1
  129. package/lib/commands/instant-api-policy/index.js +1 -1
  130. package/lib/commands/instant-api-policy/init.js +1 -1
  131. package/lib/commands/instant-api-policy/publish.js +1 -1
  132. package/lib/commands/instant-api-policy/pull.js +1 -1
  133. package/lib/commands/instant-api-policy/revision.js +1 -1
  134. package/lib/commands/instant-api-policy/revisions.js +1 -1
  135. package/lib/commands/instant-api-policy/rollback.js +1 -1
  136. package/lib/commands/instant-api-policy/shared.js +1 -1
  137. package/lib/commands/instant-api-policy/validate.js +1 -1
  138. package/lib/commands/issue/index.js +1 -1
  139. package/lib/commands/issue/nudge.js +1 -1
  140. package/lib/commands/issue/report.js +1 -1
  141. package/lib/commands/issue/shared.js +1 -1
  142. package/lib/commands/kb/create.js +1 -1
  143. package/lib/commands/kb/delete.js +1 -1
  144. package/lib/commands/kb/detail.js +1 -1
  145. package/lib/commands/kb/index.js +1 -1
  146. package/lib/commands/kb/list.js +1 -1
  147. package/lib/commands/kb/search.js +1 -1
  148. package/lib/commands/kb/shared.js +1 -1
  149. package/lib/commands/kb/update.js +1 -1
  150. package/lib/commands/logs/index.js +1 -1
  151. package/lib/commands/menu/asset-update.js +1 -1
  152. package/lib/commands/menu/delete.js +1 -1
  153. package/lib/commands/menu/external-link-create.js +1 -1
  154. package/lib/commands/menu/external-link-update.js +1 -1
  155. package/lib/commands/menu/group-create.js +1 -1
  156. package/lib/commands/menu/group-update.js +1 -1
  157. package/lib/commands/menu/index.js +1 -1
  158. package/lib/commands/menu/list.js +1 -1
  159. package/lib/commands/menu/move.js +1 -1
  160. package/lib/commands/menu/regroup-start.js +1 -1
  161. package/lib/commands/menu/rename.js +1 -1
  162. package/lib/commands/menu/shared/compare-table.js +1 -1
  163. package/lib/commands/menu/shared/delete-plan.js +1 -1
  164. package/lib/commands/menu/shared/facts.js +1 -1
  165. package/lib/commands/menu/shared/index.js +1 -1
  166. package/lib/commands/menu/shared/inquirer.js +1 -1
  167. package/lib/commands/menu/shared/local-pages.js +1 -1
  168. package/lib/commands/menu/shared/logic.js +1 -1
  169. package/lib/commands/menu/shared/mutations.js +1 -1
  170. package/lib/commands/menu/shared/service.js +1 -1
  171. package/lib/commands/menu/shared/sync-core.js +1 -1
  172. package/lib/commands/menu/shared/update-core.js +1 -1
  173. package/lib/commands/menu/shared/valid-url.js +1 -1
  174. package/lib/commands/menu/sync.js +1 -1
  175. package/lib/commands/menu/visibility-update.js +1 -1
  176. package/lib/commands/notification/config-create.js +1 -1
  177. package/lib/commands/notification/config-delete.js +1 -1
  178. package/lib/commands/notification/config-list.js +1 -1
  179. package/lib/commands/notification/config-update.js +1 -1
  180. package/lib/commands/notification/index.js +1 -1
  181. package/lib/commands/notification/shared.js +1 -1
  182. package/lib/commands/ocr/index.js +1 -1
  183. package/lib/commands/page/create.js +1 -1
  184. package/lib/commands/page/custom/detail.js +1 -1
  185. package/lib/commands/page/custom/list.js +1 -1
  186. package/lib/commands/page/custom/publish.js +1 -1
  187. package/lib/commands/page/custom/shared.js +1 -1
  188. package/lib/commands/page/custom/syntax.js +1 -1
  189. package/lib/commands/page/custom/update.js +1 -1
  190. package/lib/commands/page/data-list-status.js +1 -1
  191. package/lib/commands/page/generate-start.js +1 -1
  192. package/lib/commands/page/generate-status.js +1 -1
  193. package/lib/commands/page/index.js +1 -1
  194. package/lib/commands/page/pull.js +1 -1
  195. package/lib/commands/page/push.js +1 -1
  196. package/lib/commands/page/relation-audit.js +1 -1
  197. package/lib/commands/page/restore.js +1 -1
  198. package/lib/commands/page/shared.js +1 -1
  199. package/lib/commands/page/sync.js +1 -1
  200. package/lib/commands/project/api-architecture-upgrade.js +1 -1
  201. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  202. package/lib/commands/project/create/format-elapsed.js +1 -1
  203. package/lib/commands/project/create/main.js +1 -1
  204. package/lib/commands/project/create/materialize-project-template.js +1 -1
  205. package/lib/commands/project/create/project-name.js +1 -1
  206. package/lib/commands/project/create/project-template-archive.js +1 -1
  207. package/lib/commands/project/create/project-template-path.js +1 -1
  208. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  209. package/lib/commands/project/create/use-format-code.js +1 -1
  210. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  211. package/lib/commands/project/domain-routing-sync.js +1 -1
  212. package/lib/commands/project/index.js +1 -1
  213. package/lib/commands/project/upgrade.js +1 -1
  214. package/lib/commands/registry.js +1 -1
  215. package/lib/commands/role/delete.js +1 -1
  216. package/lib/commands/role/detail.js +1 -1
  217. package/lib/commands/role/index.js +1 -1
  218. package/lib/commands/role/list.js +1 -1
  219. package/lib/commands/role/shared.js +1 -1
  220. package/lib/commands/role/update.js +1 -1
  221. package/lib/commands/role/user-add.js +1 -1
  222. package/lib/commands/role/user-remove.js +1 -1
  223. package/lib/commands/role/user-resolve.js +1 -1
  224. package/lib/commands/rule/get.js +1 -1
  225. package/lib/commands/rule/index.js +1 -1
  226. package/lib/commands/rule/list.js +1 -1
  227. package/lib/commands/rule/set.js +1 -1
  228. package/lib/commands/rule/shared.js +1 -1
  229. package/lib/commands/run/index.js +1 -1
  230. package/lib/commands/schema.js +1 -1
  231. package/lib/commands/sql/create.js +1 -1
  232. package/lib/commands/sql/delete.js +1 -1
  233. package/lib/commands/sql/detail.js +1 -1
  234. package/lib/commands/sql/exec.js +1 -1
  235. package/lib/commands/sql/index.js +1 -1
  236. package/lib/commands/sql/list.js +1 -1
  237. package/lib/commands/sql/pull.js +1 -1
  238. package/lib/commands/sql/push.js +1 -1
  239. package/lib/commands/sql/shared.js +1 -1
  240. package/lib/commands/sql/status.js +1 -1
  241. package/lib/commands/sql/validate.js +1 -1
  242. package/lib/commands/task/index.js +1 -1
  243. package/lib/commands/task/status.js +1 -1
  244. package/lib/commands/tenant/index.js +1 -1
  245. package/lib/commands/tenant/members-list.js +1 -1
  246. package/lib/commands/tenant/shared.js +1 -1
  247. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  248. package/lib/commands/user-account/index.js +1 -1
  249. package/lib/commands/workspace/add.js +1 -1
  250. package/lib/commands/workspace/index.js +1 -1
  251. package/lib/commands/workspace/remove.js +1 -1
  252. package/lib/config/domain-config.js +1 -1
  253. package/lib/config/project-domain-routing.js +1 -1
  254. package/lib/config/region-config.js +1 -1
  255. package/lib/config/schema.js +1 -1
  256. package/lib/constant/cdn.d.ts +5 -3
  257. package/lib/constant/cdn.js +1 -1
  258. package/lib/constant/cli.js +1 -1
  259. package/lib/constant/defaults.js +1 -1
  260. package/lib/constant/domain.js +1 -1
  261. package/lib/constant/env.js +1 -1
  262. package/lib/constant/output.js +1 -1
  263. package/lib/constant/paths.js +1 -1
  264. package/lib/constant/region.js +1 -1
  265. package/lib/constant/risk.js +1 -1
  266. package/lib/constant/routing-profile.js +1 -1
  267. package/lib/context/app-resolver.js +1 -1
  268. package/lib/context/auth-resolver.js +1 -1
  269. package/lib/context/config-loader.js +1 -1
  270. package/lib/context.js +1 -1
  271. package/lib/core/alias-resolver.js +1 -1
  272. package/lib/core/api-client.js +1 -1
  273. package/lib/core/bff/config.js +1 -1
  274. package/lib/core/bff/file-system.js +1 -1
  275. package/lib/core/bff/hash.js +1 -1
  276. package/lib/core/bff/hook-directory.js +1 -1
  277. package/lib/core/bff/lock.js +1 -1
  278. package/lib/core/bff/utils.js +1 -1
  279. package/lib/core/cross-db-relation.js +1 -1
  280. package/lib/core/db-resolver.js +1 -1
  281. package/lib/core/flow-config.js +1 -1
  282. package/lib/core/instant-api-policy/config.js +1 -1
  283. package/lib/core/kb-search-client.js +1 -1
  284. package/lib/core/page/file-system.js +1 -1
  285. package/lib/core/page/hash.js +1 -1
  286. package/lib/core/page/lock.js +1 -1
  287. package/lib/core/page/lr-smart-jsx.js +1 -1
  288. package/lib/core/sql-index-auditor.js +1 -1
  289. package/lib/core/sql-sync/config.js +1 -1
  290. package/lib/core/sql-sync/file-system.js +1 -1
  291. package/lib/core/sql-sync/hash.js +1 -1
  292. package/lib/core/sql-sync/lock.js +1 -1
  293. package/lib/core/sql-sync/utils.js +1 -1
  294. package/lib/core/sql-validator.js +1 -1
  295. package/lib/errors.js +1 -1
  296. package/lib/framework/build-all-flags.js +1 -1
  297. package/lib/framework/error-output.js +1 -1
  298. package/lib/framework/explicit-yes.js +1 -1
  299. package/lib/framework/flags.js +1 -1
  300. package/lib/framework/help.js +1 -1
  301. package/lib/framework/index.js +1 -1
  302. package/lib/framework/output.js +1 -1
  303. package/lib/framework/response.js +1 -1
  304. package/lib/framework/runner-alias.js +1 -1
  305. package/lib/framework/runner.js +1 -1
  306. package/lib/framework/schema-export.js +1 -1
  307. package/lib/framework/supported-flags.js +1 -1
  308. package/lib/framework/types.js +1 -1
  309. package/lib/generated/build-info.d.ts +4 -4
  310. package/lib/generated/build-info.js +1 -1
  311. package/lib/generated/official-routing.js +1 -1
  312. package/lib/generated/routing-contract.js +1 -1
  313. package/lib/help.js +1 -1
  314. package/lib/postinstall.js +1 -1
  315. package/lib/runtime/confirmation.js +1 -1
  316. package/lib/runtime/event.js +1 -1
  317. package/lib/runtime/index.js +1 -1
  318. package/lib/runtime/queue.js +1 -1
  319. package/lib/runtime/resolve.js +1 -1
  320. package/lib/skills/builtin-skill.js +1 -1
  321. package/lib/skills/main.js +1 -1
  322. package/lib/skills/npx-skills-add.js +1 -1
  323. package/lib/skills/skill-presence.js +1 -1
  324. package/lib/telemetry/cli-command-trace.js +1 -1
  325. package/lib/telemetry/cli-help-trace.js +1 -1
  326. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  327. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  328. package/lib/telemetry/send-cli-trace-log.js +1 -1
  329. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  330. package/lib/utils/ai_config.js +1 -1
  331. package/lib/utils/apply-jq-filter.js +1 -1
  332. package/lib/utils/cdn-config.js +1 -1
  333. package/lib/utils/check-sdk-version.js +1 -1
  334. package/lib/utils/cli-version-check.js +1 -1
  335. package/lib/utils/cli-version-policy.d.ts +7 -0
  336. package/lib/utils/cli-version-policy.js +1 -1
  337. package/lib/utils/config.js +1 -1
  338. package/lib/utils/entity-with-id.js +1 -1
  339. package/lib/utils/file-utils.js +1 -1
  340. package/lib/utils/guides-cdn.js +1 -1
  341. package/lib/utils/http-client.js +1 -1
  342. package/lib/utils/is-non-interactive.js +1 -1
  343. package/lib/utils/logger.js +1 -1
  344. package/lib/utils/params.js +1 -1
  345. package/lib/utils/platform.js +1 -1
  346. package/lib/utils/sleep.js +1 -1
  347. package/lib/utils/template-replacer.js +1 -1
  348. package/lib/utils/update-notice.js +1 -1
  349. package/lib/utils/version.js +1 -1
  350. package/lib/utils/with-active-cookie.js +1 -1
  351. package/lib/utils/write-cli-side-channel.js +1 -1
  352. package/package.json +3 -1
  353. package/skills/rabetbase/SKILL.md +7 -5
  354. package/skills/rabetbase/guides/backend-function.md +5 -1
  355. package/skills/rabetbase/guides/bff-creation-workflow.md +3 -1
  356. package/skills/rabetbase/guides/cross-database-bff.md +70 -0
  357. package/skills/rabetbase/guides/data-api-guidelines.md +35 -33
  358. package/skills/rabetbase/guides/sql-creation-workflow.md +2 -0
  359. package/skills/rabetbase/references/rabetbase-dataset-cross-relations.md +5 -1
  360. package/skills/rabetbase.manifest.json +4 -3
  361. package/templates/README.md +41 -13
@@ -1 +1 @@
1
- const a282_0x58b8a3=a282_0x5e02;(function(_0x594159,_0x24c9af){const _0xde3e9a=a282_0x5e02,_0x331b77=_0x594159();while(!![]){try{const _0x2d7b41=parseInt(_0xde3e9a(0x170))/0x1*(-parseInt(_0xde3e9a(0x156))/0x2)+parseInt(_0xde3e9a(0x182))/0x3+-parseInt(_0xde3e9a(0x18d))/0x4+-parseInt(_0xde3e9a(0x171))/0x5*(parseInt(_0xde3e9a(0x16d))/0x6)+-parseInt(_0xde3e9a(0x16e))/0x7*(-parseInt(_0xde3e9a(0x193))/0x8)+-parseInt(_0xde3e9a(0x163))/0x9*(-parseInt(_0xde3e9a(0x159))/0xa)+parseInt(_0xde3e9a(0x172))/0xb;if(_0x2d7b41===_0x24c9af)break;else _0x331b77['push'](_0x331b77['shift']());}catch(_0x40da08){_0x331b77['push'](_0x331b77['shift']());}}}(a282_0x5827,0xc6fb3));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=a282_0x58b8a3(0x16b);function a282_0x5e02(_0x5664e5,_0x2c1bb6){_0x5664e5=_0x5664e5-0x155;const _0x582753=a282_0x5827();let _0x5e02e0=_0x582753[_0x5664e5];return _0x5e02e0;}export const INSTANT_API_POLICY_FILE_NAME=a282_0x58b8a3(0x179);export const MAX_INSTANT_API_POLICY_BYTES=0x400*0x400;export function instantApiPolicyError(_0xdbaa11,_0x5e9f9c,_0x3ba012){return new CliError(_0xdbaa11,0x1,_0x5e9f9c,_0x3ba012);}export function loadInstantApiPolicyLocalConfig(_0x3b61a6,_0xf24d94){assertSafeAppCode(_0x3b61a6);const _0x2420e8=resolve(_0xf24d94??findProjectRootDirectory()),_0x177fd5=INSTANT_API_POLICY_RELATIVE_ROOT+'/'+_0x3b61a6+'/'+INSTANT_API_POLICY_FILE_NAME,_0xf356b8=resolve(_0x2420e8,INSTANT_API_POLICY_RELATIVE_ROOT,_0x3b61a6),_0x1a5b81=resolve(_0xf356b8,INSTANT_API_POLICY_FILE_NAME);return{'projectRoot':_0x2420e8,'appCode':_0x3b61a6,'policyRoot':_0xf356b8,'policyFilePath':_0x1a5b81,'policyRelativePath':_0x177fd5};}export function createDefaultInstantApiPolicyConfig(_0x35b8d7,_0x63269e=a282_0x58b8a3(0x180)){return assertSafeAppCode(_0x35b8d7),{'version':'2','appCode':_0x35b8d7,'defaults':{'instantApi':_0x63269e},'rules':[]};}export async function readInstantApiPolicyConfigFile(_0x13d0eb){const _0x5e06f4=a282_0x58b8a3;let _0x3c2dea;try{_0x3c2dea=await stat(_0x13d0eb[_0x5e06f4(0x173)]);}catch(_0x29f537){throw instantApiPolicyError(_0x5e06f4(0x15d),_0x5e06f4(0x189)+_0x13d0eb[_0x5e06f4(0x173)],_0x5e06f4(0x16a));}if(!_0x3c2dea['isFile']())throw instantApiPolicyError('instant_api_policy_file_invalid',_0x5e06f4(0x177)+_0x13d0eb[_0x5e06f4(0x173)]);if(_0x3c2dea['size']>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x5e06f4(0x188),_0x5e06f4(0x157));let _0x508b89;try{_0x508b89=await readFile(_0x13d0eb[_0x5e06f4(0x173)]);}catch{throw instantApiPolicyError(_0x5e06f4(0x15f),_0x5e06f4(0x18c)+_0x13d0eb[_0x5e06f4(0x173)]);}if(_0x508b89[_0x5e06f4(0x169)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError('instant_api_policy_file_too_large',_0x5e06f4(0x157));let _0x365c84;try{_0x365c84=new TextDecoder(_0x5e06f4(0x166),{'fatal':!![],'ignoreBOM':!![]})[_0x5e06f4(0x178)](_0x508b89);}catch{throw instantApiPolicyError(_0x5e06f4(0x161),'Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20UTF-8:\x20'+_0x13d0eb[_0x5e06f4(0x173)]);}let _0x4f0b8d;try{_0x4f0b8d=JSON['parse'](_0x365c84);}catch{throw instantApiPolicyError('instant_api_policy_json_invalid','Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20JSON:\x20'+_0x13d0eb[_0x5e06f4(0x173)]);}return assertLocalPolicyContract(_0x4f0b8d,_0x13d0eb[_0x5e06f4(0x167)]);}export async function writeInstantApiPolicyConfigFile(_0xb4c534,_0x26eb75,_0x430f39={}){const _0x1ccf3e=a282_0x58b8a3,_0x3007e1=assertLocalPolicyContract(_0x26eb75,_0xb4c534[_0x1ccf3e(0x167)]),_0x5c7643=JSON[_0x1ccf3e(0x15c)](_0x3007e1,null,0x2)+'\x0a';if(Buffer[_0x1ccf3e(0x169)](_0x5c7643,_0x1ccf3e(0x165))>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x1ccf3e(0x188),_0x1ccf3e(0x157));await mkdir(_0xb4c534[_0x1ccf3e(0x195)],{'recursive':!![]});let _0x517997;try{_0x517997=await readFile(_0xb4c534[_0x1ccf3e(0x173)],'utf8');}catch(_0x171aa6){if(!isMissingFile(_0x171aa6))throw instantApiPolicyError(_0x1ccf3e(0x15f),_0x1ccf3e(0x174)+_0xb4c534[_0x1ccf3e(0x173)]);}if(_0x517997===_0x5c7643)return{'action':_0x1ccf3e(0x17d),'filePath':_0xb4c534[_0x1ccf3e(0x173)]};if(_0x517997!==undefined&&!_0x430f39['force'])throw instantApiPolicyError(_0x1ccf3e(0x17f),_0x1ccf3e(0x18a)+_0xb4c534['policyFilePath'],'Review\x20local\x20changes,\x20then\x20rerun\x20with\x20--force\x20--yes\x20if\x20replacement\x20is\x20intended.');if(_0x517997===undefined)try{return await writeFile(_0xb4c534[_0x1ccf3e(0x173)],_0x5c7643,{'encoding':_0x1ccf3e(0x165),'flag':'wx'}),{'action':_0x1ccf3e(0x15a),'filePath':_0xb4c534[_0x1ccf3e(0x173)]};}catch(_0x197c2b){if(!isAlreadyExists(_0x197c2b))throw instantApiPolicyError(_0x1ccf3e(0x18f),_0x1ccf3e(0x15e)+_0xb4c534['policyFilePath']);if(!_0x430f39[_0x1ccf3e(0x18b)])throw instantApiPolicyError(_0x1ccf3e(0x17f),_0x1ccf3e(0x16f)+_0xb4c534[_0x1ccf3e(0x173)],_0x1ccf3e(0x184));}const _0x474ce6=resolve(dirname(_0xb4c534[_0x1ccf3e(0x173)]),'.'+INSTANT_API_POLICY_FILE_NAME+'.'+process[_0x1ccf3e(0x17a)]+'.'+randomUUID()+_0x1ccf3e(0x168));try{await writeFile(_0x474ce6,_0x5c7643,{'encoding':'utf8','flag':'wx'}),await rename(_0x474ce6,_0xb4c534['policyFilePath']);}catch{await unlink(_0x474ce6)[_0x1ccf3e(0x15b)](()=>undefined);throw instantApiPolicyError('instant_api_policy_file_unwritable',_0x1ccf3e(0x160)+_0xb4c534['policyFilePath']);}return{'action':_0x1ccf3e(0x158),'filePath':_0xb4c534[_0x1ccf3e(0x173)]};}function assertSafeAppCode(_0x2a9a2b){const _0x307080=a282_0x58b8a3,_0x2b49f9=_0x2a9a2b[_0x307080(0x186)]();if(!_0x2b49f9||_0x2b49f9!==_0x2a9a2b||_0x2b49f9['length']>0x64||_0x2b49f9==='.'||_0x2b49f9==='..'||_0x2b49f9[_0x307080(0x175)]('/')||_0x2b49f9[_0x307080(0x175)]('\x5c')||_0x2b49f9[_0x307080(0x175)]('\x00'))throw instantApiPolicyError('instant_api_policy_app_code_invalid',_0x307080(0x17c));}function assertLocalPolicyContract(_0x26be5f,_0x2336ad){const _0x46f0d7=a282_0x58b8a3;if(!isObject(_0x26be5f))throw instantApiPolicyError(_0x46f0d7(0x164),_0x46f0d7(0x16c));if(_0x26be5f[_0x46f0d7(0x183)]!=='1'&&_0x26be5f[_0x46f0d7(0x183)]!=='2')throw instantApiPolicyError(_0x46f0d7(0x176),_0x46f0d7(0x187),_0x46f0d7(0x194));if(_0x26be5f['appCode']!==_0x2336ad)throw instantApiPolicyError(_0x46f0d7(0x17e),'Policy\x20appCode\x20must\x20match\x20the\x20selected\x20application\x20'+_0x2336ad+'.');if(!isObject(_0x26be5f[_0x46f0d7(0x155)])||typeof _0x26be5f[_0x46f0d7(0x155)][_0x46f0d7(0x192)]!==_0x46f0d7(0x181))throw instantApiPolicyError(_0x46f0d7(0x17b),_0x46f0d7(0x162));if(_0x26be5f[_0x46f0d7(0x190)]!==undefined&&_0x26be5f[_0x46f0d7(0x190)]!==null&&!Array['isArray'](_0x26be5f[_0x46f0d7(0x190)]))throw instantApiPolicyError(_0x46f0d7(0x185),'Policy\x20rules\x20must\x20be\x20an\x20array\x20or\x20null.');return _0x26be5f;}function isObject(_0x246734){const _0x14438d=a282_0x58b8a3;return _0x246734!==null&&typeof _0x246734==='object'&&!Array[_0x14438d(0x191)](_0x246734);}function isMissingFile(_0x2ffb5c){const _0x1af9da=a282_0x58b8a3;return Boolean(_0x2ffb5c&&typeof _0x2ffb5c==='object'&&_0x2ffb5c[_0x1af9da(0x18e)]==='ENOENT');}function a282_0x5827(){const _0x210539=['policyRoot','defaults','24xvQpbo','Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.','overwritten','2320gZINgP','created','catch','stringify','instant_api_policy_file_missing','Cannot\x20write\x20Instant\x20API\x20policy\x20file:\x20','instant_api_policy_file_unreadable','Cannot\x20replace\x20Instant\x20API\x20policy\x20file:\x20','instant_api_policy_file_invalid','Policy\x20defaults.instantApi\x20is\x20required.','16236SSVrHZ','instant_api_policy_json_invalid','utf8','utf-8','appCode','.tmp','byteLength','Run\x20`rabetbase\x20instant-api-policy\x20init`\x20or\x20`rabetbase\x20instant-api-policy\x20pull`\x20first.','.rabetbase/instant-api-policy','Instant\x20API\x20policy\x20JSON\x20root\x20must\x20be\x20an\x20object.','5547480eMasCI','4713877WJTmze','Instant\x20API\x20policy\x20file\x20was\x20created\x20concurrently:\x20','23953YofBmJ','5bpcJtE','5306664Chalme','policyFilePath','Cannot\x20inspect\x20Instant\x20API\x20policy\x20file:\x20','includes','instant_api_policy_version_invalid','Instant\x20API\x20policy\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','decode','policy.json','pid','instant_api_policy_defaults_invalid','appCode\x20cannot\x20be\x20used\x20as\x20the\x20fixed\x20Instant\x20API\x20policy\x20directory\x20name.','unchanged','instant_api_policy_app_code_mismatch','instant_api_policy_file_exists','allow','string','2945232hjmWiB','version','Review\x20the\x20file\x20before\x20retrying.','instant_api_policy_rules_invalid','trim','Instant\x20API\x20policy\x20version\x20must\x20be\x20\x221\x22\x20or\x20\x222\x22.','instant_api_policy_file_too_large','Instant\x20API\x20policy\x20file\x20does\x20not\x20exist:\x20','Instant\x20API\x20policy\x20file\x20already\x20exists:\x20','force','Cannot\x20read\x20Instant\x20API\x20policy\x20file:\x20','4809900BpzWiS','code','instant_api_policy_file_unwritable','rules','isArray','instantApi','16nSQpQI','version\x20is\x20the\x20JSON\x20schema\x20version;\x20published\x20history\x20uses\x20the\x20separate\x20revision\x20field.'];a282_0x5827=function(){return _0x210539;};return a282_0x5827();}function isAlreadyExists(_0x18a63e){const _0x3b1642=a282_0x58b8a3;return Boolean(_0x18a63e&&typeof _0x18a63e==='object'&&_0x18a63e[_0x3b1642(0x18e)]==='EEXIST');}
1
+ const a282_0x4b2c68=a282_0x284e;(function(_0x2e6b4c,_0x4be8b8){const _0x49efe7=a282_0x284e,_0x14b536=_0x2e6b4c();while(!![]){try{const _0x2ee9ac=parseInt(_0x49efe7(0x1b2))/0x1*(parseInt(_0x49efe7(0x1ba))/0x2)+-parseInt(_0x49efe7(0x1d4))/0x3*(-parseInt(_0x49efe7(0x1ca))/0x4)+-parseInt(_0x49efe7(0x1d6))/0x5+parseInt(_0x49efe7(0x1e0))/0x6*(parseInt(_0x49efe7(0x1b9))/0x7)+parseInt(_0x49efe7(0x1e8))/0x8+parseInt(_0x49efe7(0x1e1))/0x9+parseInt(_0x49efe7(0x1a9))/0xa*(-parseInt(_0x49efe7(0x1ce))/0xb);if(_0x2ee9ac===_0x4be8b8)break;else _0x14b536['push'](_0x14b536['shift']());}catch(_0x31c1f8){_0x14b536['push'](_0x14b536['shift']());}}}(a282_0x458d,0x461c2));function a282_0x284e(_0x3f305b,_0x4414f8){_0x3f305b=_0x3f305b-0x1a7;const _0x458dcd=a282_0x458d();let _0x284e65=_0x458dcd[_0x3f305b];return _0x284e65;}import{randomUUID}from'node:crypto';import{mkdir,readFile,rename,stat,unlink,writeFile}from'node:fs/promises';function a282_0x458d(){const _0x47a0c4=['Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20JSON:\x20','isArray','ENOENT','rules','allow','Cannot\x20inspect\x20Instant\x20API\x20policy\x20file:\x20','instant_api_policy_file_exists','object','created','string','Policy\x20rules\x20must\x20be\x20an\x20array\x20or\x20null.','parse','3188QTbGJq','policyRoot','appCode','Review\x20the\x20file\x20before\x20retrying.','165341VSTBfd','stringify','decode','instant_api_policy_app_code_mismatch','appCode\x20cannot\x20be\x20used\x20as\x20the\x20fixed\x20Instant\x20API\x20policy\x20directory\x20name.','instant_api_policy_file_too_large','2100GqbxoI','code','1014745Fvvbwe','Run\x20`rabetbase\x20instant-api-policy\x20init`\x20or\x20`rabetbase\x20instant-api-policy\x20pull`\x20first.','Instant\x20API\x20policy\x20file\x20does\x20not\x20exist:\x20','Cannot\x20read\x20Instant\x20API\x20policy\x20file:\x20','utf8','force','instant_api_policy_file_unreadable','byteLength','policyFilePath','Cannot\x20replace\x20Instant\x20API\x20policy\x20file:\x20','908322KHZnxH','1272186aSkoxK','.rabetbase/instant-api-policy','size','instant_api_policy_file_unwritable','defaults','EEXIST','Policy\x20appCode\x20must\x20match\x20the\x20selected\x20application\x20','4379304JLHmLt','instantApi','trim','790RRLoLf','Instant\x20API\x20policy\x20file\x20already\x20exists:\x20','Policy\x20defaults.instantApi\x20is\x20required.','instant_api_policy_file_invalid','Instant\x20API\x20policy\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','catch','unchanged','length','instant_api_policy_json_invalid','3BlmueB','Instant\x20API\x20policy\x20file\x20exceeds\x20the\x201\x20MiB\x20CLI\x20limit.','includes','version','instant_api_policy_file_missing','pid','Instant\x20API\x20policy\x20file\x20was\x20created\x20concurrently:\x20','14hDJlvM','85418yAvZaT','instant_api_policy_app_code_invalid','overwritten','Instant\x20API\x20policy\x20version\x20must\x20be\x20\x221\x22\x20or\x20\x222\x22.'];a282_0x458d=function(){return _0x47a0c4;};return a282_0x458d();}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=a282_0x4b2c68(0x1e2);export const INSTANT_API_POLICY_FILE_NAME='policy.json';export const MAX_INSTANT_API_POLICY_BYTES=0x400*0x400;export function instantApiPolicyError(_0x240912,_0xd8dcfb,_0x3e7df5){return new CliError(_0x240912,0x1,_0xd8dcfb,_0x3e7df5);}export function loadInstantApiPolicyLocalConfig(_0x3b6c51,_0x53e461){assertSafeAppCode(_0x3b6c51);const _0x5ca9a4=resolve(_0x53e461??findProjectRootDirectory()),_0x126b7a=INSTANT_API_POLICY_RELATIVE_ROOT+'/'+_0x3b6c51+'/'+INSTANT_API_POLICY_FILE_NAME,_0x278ef3=resolve(_0x5ca9a4,INSTANT_API_POLICY_RELATIVE_ROOT,_0x3b6c51),_0x1486b2=resolve(_0x278ef3,INSTANT_API_POLICY_FILE_NAME);return{'projectRoot':_0x5ca9a4,'appCode':_0x3b6c51,'policyRoot':_0x278ef3,'policyFilePath':_0x1486b2,'policyRelativePath':_0x126b7a};}export function createDefaultInstantApiPolicyConfig(_0x343bee,_0x882c39=a282_0x4b2c68(0x1c2)){return assertSafeAppCode(_0x343bee),{'version':'2','appCode':_0x343bee,'defaults':{'instantApi':_0x882c39},'rules':[]};}export async function readInstantApiPolicyConfigFile(_0x39c6e8){const _0x25c777=a282_0x4b2c68;let _0x1fca40;try{_0x1fca40=await stat(_0x39c6e8[_0x25c777(0x1de)]);}catch(_0x2429ad){throw instantApiPolicyError(_0x25c777(0x1b6),_0x25c777(0x1d8)+_0x39c6e8[_0x25c777(0x1de)],_0x25c777(0x1d7));}if(!_0x1fca40['isFile']())throw instantApiPolicyError('instant_api_policy_file_invalid',_0x25c777(0x1ad)+_0x39c6e8[_0x25c777(0x1de)]);if(_0x1fca40[_0x25c777(0x1e3)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x25c777(0x1d3),_0x25c777(0x1b3));let _0x483625;try{_0x483625=await readFile(_0x39c6e8['policyFilePath']);}catch{throw instantApiPolicyError(_0x25c777(0x1dc),_0x25c777(0x1d9)+_0x39c6e8[_0x25c777(0x1de)]);}if(_0x483625[_0x25c777(0x1dd)]>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError(_0x25c777(0x1d3),_0x25c777(0x1b3));let _0x242ccc;try{_0x242ccc=new TextDecoder('utf-8',{'fatal':!![],'ignoreBOM':!![]})[_0x25c777(0x1d0)](_0x483625);}catch{throw instantApiPolicyError(_0x25c777(0x1ac),'Instant\x20API\x20policy\x20file\x20is\x20not\x20valid\x20UTF-8:\x20'+_0x39c6e8['policyFilePath']);}let _0x566a71;try{_0x566a71=JSON[_0x25c777(0x1c9)](_0x242ccc);}catch{throw instantApiPolicyError(_0x25c777(0x1b1),_0x25c777(0x1be)+_0x39c6e8[_0x25c777(0x1de)]);}return assertLocalPolicyContract(_0x566a71,_0x39c6e8[_0x25c777(0x1cc)]);}export async function writeInstantApiPolicyConfigFile(_0x4e3fd9,_0x4bad17,_0x13b0d3={}){const _0x2ed7ca=a282_0x4b2c68,_0x68c259=assertLocalPolicyContract(_0x4bad17,_0x4e3fd9[_0x2ed7ca(0x1cc)]),_0x1f267d=JSON[_0x2ed7ca(0x1cf)](_0x68c259,null,0x2)+'\x0a';if(Buffer[_0x2ed7ca(0x1dd)](_0x1f267d,'utf8')>MAX_INSTANT_API_POLICY_BYTES)throw instantApiPolicyError('instant_api_policy_file_too_large',_0x2ed7ca(0x1b3));await mkdir(_0x4e3fd9[_0x2ed7ca(0x1cb)],{'recursive':!![]});let _0x549820;try{_0x549820=await readFile(_0x4e3fd9[_0x2ed7ca(0x1de)],_0x2ed7ca(0x1da));}catch(_0x40c1da){if(!isMissingFile(_0x40c1da))throw instantApiPolicyError(_0x2ed7ca(0x1dc),_0x2ed7ca(0x1c3)+_0x4e3fd9[_0x2ed7ca(0x1de)]);}if(_0x549820===_0x1f267d)return{'action':_0x2ed7ca(0x1af),'filePath':_0x4e3fd9[_0x2ed7ca(0x1de)]};if(_0x549820!==undefined&&!_0x13b0d3['force'])throw instantApiPolicyError(_0x2ed7ca(0x1c4),_0x2ed7ca(0x1aa)+_0x4e3fd9[_0x2ed7ca(0x1de)],'Review\x20local\x20changes,\x20then\x20rerun\x20with\x20--force\x20--yes\x20if\x20replacement\x20is\x20intended.');if(_0x549820===undefined)try{return await writeFile(_0x4e3fd9[_0x2ed7ca(0x1de)],_0x1f267d,{'encoding':_0x2ed7ca(0x1da),'flag':'wx'}),{'action':_0x2ed7ca(0x1c6),'filePath':_0x4e3fd9[_0x2ed7ca(0x1de)]};}catch(_0x34dbac){if(!isAlreadyExists(_0x34dbac))throw instantApiPolicyError(_0x2ed7ca(0x1e4),'Cannot\x20write\x20Instant\x20API\x20policy\x20file:\x20'+_0x4e3fd9['policyFilePath']);if(!_0x13b0d3[_0x2ed7ca(0x1db)])throw instantApiPolicyError(_0x2ed7ca(0x1c4),_0x2ed7ca(0x1b8)+_0x4e3fd9['policyFilePath'],_0x2ed7ca(0x1cd));}const _0x5bfb44=resolve(dirname(_0x4e3fd9[_0x2ed7ca(0x1de)]),'.'+INSTANT_API_POLICY_FILE_NAME+'.'+process[_0x2ed7ca(0x1b7)]+'.'+randomUUID()+'.tmp');try{await writeFile(_0x5bfb44,_0x1f267d,{'encoding':_0x2ed7ca(0x1da),'flag':'wx'}),await rename(_0x5bfb44,_0x4e3fd9[_0x2ed7ca(0x1de)]);}catch{await unlink(_0x5bfb44)[_0x2ed7ca(0x1ae)](()=>undefined);throw instantApiPolicyError('instant_api_policy_file_unwritable',_0x2ed7ca(0x1df)+_0x4e3fd9[_0x2ed7ca(0x1de)]);}return{'action':_0x2ed7ca(0x1bc),'filePath':_0x4e3fd9[_0x2ed7ca(0x1de)]};}function assertSafeAppCode(_0x3ec73a){const _0x5d211c=a282_0x4b2c68,_0x549069=_0x3ec73a[_0x5d211c(0x1a8)]();if(!_0x549069||_0x549069!==_0x3ec73a||_0x549069[_0x5d211c(0x1b0)]>0x64||_0x549069==='.'||_0x549069==='..'||_0x549069[_0x5d211c(0x1b4)]('/')||_0x549069[_0x5d211c(0x1b4)]('\x5c')||_0x549069[_0x5d211c(0x1b4)]('\x00'))throw instantApiPolicyError(_0x5d211c(0x1bb),_0x5d211c(0x1d2));}function assertLocalPolicyContract(_0x4d6c53,_0x48e5d8){const _0x156fd1=a282_0x4b2c68;if(!isObject(_0x4d6c53))throw instantApiPolicyError('instant_api_policy_json_invalid','Instant\x20API\x20policy\x20JSON\x20root\x20must\x20be\x20an\x20object.');if(_0x4d6c53[_0x156fd1(0x1b5)]!=='1'&&_0x4d6c53[_0x156fd1(0x1b5)]!=='2')throw instantApiPolicyError('instant_api_policy_version_invalid',_0x156fd1(0x1bd),'version\x20is\x20the\x20JSON\x20schema\x20version;\x20published\x20history\x20uses\x20the\x20separate\x20revision\x20field.');if(_0x4d6c53[_0x156fd1(0x1cc)]!==_0x48e5d8)throw instantApiPolicyError(_0x156fd1(0x1d1),_0x156fd1(0x1e7)+_0x48e5d8+'.');if(!isObject(_0x4d6c53[_0x156fd1(0x1e5)])||typeof _0x4d6c53['defaults'][_0x156fd1(0x1a7)]!==_0x156fd1(0x1c7))throw instantApiPolicyError('instant_api_policy_defaults_invalid',_0x156fd1(0x1ab));if(_0x4d6c53['rules']!==undefined&&_0x4d6c53[_0x156fd1(0x1c1)]!==null&&!Array[_0x156fd1(0x1bf)](_0x4d6c53[_0x156fd1(0x1c1)]))throw instantApiPolicyError('instant_api_policy_rules_invalid',_0x156fd1(0x1c8));return _0x4d6c53;}function isObject(_0x4c38c8){const _0x2f81dd=a282_0x4b2c68;return _0x4c38c8!==null&&typeof _0x4c38c8==='object'&&!Array[_0x2f81dd(0x1bf)](_0x4c38c8);}function isMissingFile(_0x80db51){const _0x4e50c5=a282_0x4b2c68;return Boolean(_0x80db51&&typeof _0x80db51===_0x4e50c5(0x1c5)&&_0x80db51[_0x4e50c5(0x1d5)]===_0x4e50c5(0x1c0));}function isAlreadyExists(_0x1831f8){const _0x1f6aa8=a282_0x4b2c68;return Boolean(_0x1831f8&&typeof _0x1831f8===_0x1f6aa8(0x1c5)&&_0x1831f8[_0x1f6aa8(0x1d5)]===_0x1f6aa8(0x1e6));}
@@ -1 +1 @@
1
- const a283_0x1ee16c=a283_0x219b;(function(_0x41af40,_0x1873eb){const _0x414f63=a283_0x219b,_0x16d286=_0x41af40();while(!![]){try{const _0x1b299d=parseInt(_0x414f63(0x198))/0x1*(parseInt(_0x414f63(0x194))/0x2)+parseInt(_0x414f63(0x1bc))/0x3*(-parseInt(_0x414f63(0x1b4))/0x4)+-parseInt(_0x414f63(0x1d6))/0x5*(-parseInt(_0x414f63(0x1a9))/0x6)+parseInt(_0x414f63(0x1c4))/0x7+parseInt(_0x414f63(0x19b))/0x8+-parseInt(_0x414f63(0x1bb))/0x9+-parseInt(_0x414f63(0x1a1))/0xa;if(_0x1b299d===_0x1873eb)break;else _0x16d286['push'](_0x16d286['shift']());}catch(_0x3f68db){_0x16d286['push'](_0x16d286['shift']());}}}(a283_0xa71f,0xf2381));function a283_0xa71f(){const _0x55bbda=['authRequired','name','isSafeInteger','scope','rank','134335PfTVTH','scoreKind','data','AbortError','object','Knowledge\x20search\x20query\x20is\x20required.','text','application/json','profile','total','SmartCode\x20knowledge\x20search\x20returned\x20an\x20invalid\x20','apiError','/smartapi/knowledge/company-public/search','public','map','19678syCCQh','get','success','strategyFingerprint','109xbDNVY','documentId','revision','7933296JpXUCd','entries','chunkId','validation','split','Knowledge\x20search\x20topK\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.','6627450wFFkrK','SmartCode\x20knowledge\x20search\x20failed\x20(HTTP\x20','\x20contract.','hits','isArray','signal','finalScore','POST','48FrJPZR','content-type','appCode','stringify','schemaVersion','SmartCode\x20knowledge\x20search\x20returned\x20a\x20non-JSON\x20content\x20type.','topK','SmartCode\x20knowledge\x20search\x20failed.','company','no-store','cookie','3792SxUooo','cache-control','cli:rabetbase','timingsMs','networkError','headers','test','8304570maHgkK','1338bEBxgK','toLowerCase','title','sort','some','isFinite','rawScore','development','5049541HvzJtR','string','length','json','number','SmartCode\x20knowledge\x20search\x20request\x20failed.','tags','hits[','trim','includes','SmartCode\x20knowledge\x20search\x20response\x20is\x20missing\x20Cache-Control:\x20no-store.','response\x20envelope','score'];a283_0xa71f=function(){return _0x55bbda;};return a283_0xa71f();}import{getKbDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';const RESPONSE_KEYS=[a283_0x1ee16c(0x1ad),'profile',a283_0x1ee16c(0x18e),a283_0x1ee16c(0x1a4),'strategyFingerprint',a283_0x1ee16c(0x1b7)],HIT_KEYS=['documentId',a283_0x1ee16c(0x19a),a283_0x1ee16c(0x19d),a283_0x1ee16c(0x1d4),a283_0x1ee16c(0x1be),a283_0x1ee16c(0x18b),a283_0x1ee16c(0x1ca),a283_0x1ee16c(0x1d5),a283_0x1ee16c(0x1c2),a283_0x1ee16c(0x1a7),a283_0x1ee16c(0x186)];export async function searchDevelopmentKnowledge(_0xc6a4a){const _0x37eedc=a283_0x1ee16c,_0x5b6239=_0xc6a4a[_0x37eedc(0x1ab)][_0x37eedc(0x1cc)](),_0x59c373=_0xc6a4a['query']['trim']();if(!_0x5b6239)throw CliErrors['validation']('Knowledge\x20search\x20appCode\x20is\x20required.');if(!_0xc6a4a[_0x37eedc(0x1b3)][_0x37eedc(0x1cc)]())throw CliErrors[_0x37eedc(0x1d1)]();if(!_0x59c373)throw CliErrors['validation'](_0x37eedc(0x18a));validateTopK(_0xc6a4a[_0x37eedc(0x1af)]);const _0x44de8e=getKbDomain()+_0x37eedc(0x191);let _0x3f3c75;try{_0x3f3c75=await fetch(_0x44de8e,{'method':_0x37eedc(0x1a8),'headers':{'Content-Type':_0x37eedc(0x18c),'Cookie':_0xc6a4a['cookie'],'X-Invoke-Source':_0x37eedc(0x1b6)},'body':JSON[_0x37eedc(0x1ac)]({'appCode':_0x5b6239,'query':_0x59c373,..._0xc6a4a[_0x37eedc(0x1af)]!==undefined?{'topK':_0xc6a4a[_0x37eedc(0x1af)]}:{}}),'signal':_0xc6a4a[_0x37eedc(0x1a6)]});}catch(_0x173145){if(_0x173145 instanceof CliError)throw _0x173145;if(_0x173145 instanceof Error&&_0x173145[_0x37eedc(0x1d2)]===_0x37eedc(0x188))throw _0x173145;throw CliErrors[_0x37eedc(0x1b8)](_0x37eedc(0x1c9));}if(!hasNoStore(_0x3f3c75[_0x37eedc(0x1b9)]))throw CliErrors[_0x37eedc(0x190)](_0x37eedc(0x1ce));if(_0x3f3c75['status']===0x191)throw CliErrors['authRequired']();if(!_0x3f3c75['ok'])throw CliErrors[_0x37eedc(0x190)](_0x37eedc(0x1a2)+_0x3f3c75['status']+').');if(!(_0x3f3c75[_0x37eedc(0x1b9)]['get'](_0x37eedc(0x1aa))??'')[_0x37eedc(0x1bd)]()[_0x37eedc(0x1cd)](_0x37eedc(0x18c)))throw CliErrors[_0x37eedc(0x190)](_0x37eedc(0x1ae));let _0xe72405;try{_0xe72405=await _0x3f3c75[_0x37eedc(0x1c7)]();}catch{throw CliErrors[_0x37eedc(0x190)]('SmartCode\x20knowledge\x20search\x20returned\x20invalid\x20JSON.');}return parseDevelopmentSearchResponse(readEnvelopeData(_0xe72405),_0xc6a4a['topK']);}function readEnvelopeData(_0x41a0f1){const _0x221e12=a283_0x1ee16c,_0x36e0da=requireRecord(_0x41a0f1,_0x221e12(0x1cf));if(_0x36e0da[_0x221e12(0x196)]===![])throw CliErrors['apiError'](_0x221e12(0x1b0));if(!(_0x221e12(0x187)in _0x36e0da))throw invalidContract(_0x221e12(0x1cf));return _0x36e0da[_0x221e12(0x187)];}function validateTopK(_0x3b1e97){const _0x38ec2e=a283_0x1ee16c;if(_0x3b1e97!==undefined&&(!Number['isSafeInteger'](_0x3b1e97)||_0x3b1e97<0x1||_0x3b1e97>0x32))throw CliErrors[_0x38ec2e(0x19e)](_0x38ec2e(0x1a0));}function hasNoStore(_0xc9b444){const _0x1e8ffd=a283_0x1ee16c;return(_0xc9b444[_0x1e8ffd(0x195)](_0x1e8ffd(0x1b5))??'')[_0x1e8ffd(0x19f)](',')[_0x1e8ffd(0x1c0)](_0x57bb48=>_0x57bb48[_0x1e8ffd(0x1cc)]()[_0x1e8ffd(0x1bd)]()===_0x1e8ffd(0x1b2));}function parseDevelopmentSearchResponse(_0xe9d42c,_0x12ab03){const _0x39736c=a283_0x1ee16c,_0x304deb=requireExactRecord(_0xe9d42c,RESPONSE_KEYS,'response');if(_0x304deb['schemaVersion']!==0x2||_0x304deb[_0x39736c(0x18d)]!==_0x39736c(0x1c3))throw invalidContract(_0x39736c(0x18d));if(!Array['isArray'](_0x304deb[_0x39736c(0x1a4)])||_0x304deb[_0x39736c(0x1a4)][_0x39736c(0x1c6)]>(_0x12ab03??0x32))throw invalidContract(_0x39736c(0x1a4));if(typeof _0x304deb['strategyFingerprint']!=='string'||!/^sha256:[0-9a-f]{64}$/['test'](_0x304deb[_0x39736c(0x197)]))throw invalidContract(_0x39736c(0x197));const _0xa2bca7=requireRecord(_0x304deb[_0x39736c(0x1b7)],_0x39736c(0x1b7)),_0x39c845={};for(const [_0x536bd7,_0x33c5f5]of Object[_0x39736c(0x19c)](_0xa2bca7)){if(!/^[A-Za-z][A-Za-z0-9]*$/[_0x39736c(0x1ba)](_0x536bd7)||typeof _0x33c5f5!=='number'||!Number[_0x39736c(0x1c1)](_0x33c5f5)||_0x33c5f5<0x0)throw invalidContract(_0x39736c(0x1b7));_0x39c845[_0x536bd7]=_0x33c5f5;}const _0x172b98=_0x304deb[_0x39736c(0x1a4)][_0x39736c(0x193)]((_0x8981f3,_0x1369a0)=>parseHit(_0x8981f3,_0x1369a0));if(!Number['isSafeInteger'](_0x304deb[_0x39736c(0x18e)])||_0x304deb[_0x39736c(0x18e)]!==_0x172b98[_0x39736c(0x1c6)])throw invalidContract(_0x39736c(0x18e));return{'schemaVersion':_0x304deb[_0x39736c(0x1ad)],'profile':_0x304deb['profile'],'total':_0x304deb[_0x39736c(0x18e)],'strategyFingerprint':_0x304deb[_0x39736c(0x197)],'timingsMs':_0x39c845,'hits':_0x172b98};}function a283_0x219b(_0x283963,_0x1aa114){_0x283963=_0x283963-0x186;const _0xa71f44=a283_0xa71f();let _0x219b2c=_0xa71f44[_0x283963];return _0x219b2c;}function parseHit(_0x501e14,_0x250eb2){const _0x100d81=a283_0x1ee16c,_0x21d316=requireExactRecord(_0x501e14,HIT_KEYS,_0x100d81(0x1cb)+_0x250eb2+']'),_0x104a0a=_0x313329=>{const _0x2b9df9=_0x100d81,_0x3ca309=_0x21d316[_0x313329];if(typeof _0x3ca309!==_0x2b9df9(0x1c5)||!_0x3ca309)throw invalidContract(_0x313329);return _0x3ca309;};if(!Number[_0x100d81(0x1d3)](_0x21d316[_0x100d81(0x19a)])||_0x21d316['revision']<0x1)throw invalidContract(_0x100d81(0x19a));if(_0x21d316[_0x100d81(0x1d4)]!==_0x100d81(0x192)&&_0x21d316[_0x100d81(0x1d4)]!==_0x100d81(0x1b1))throw invalidContract(_0x100d81(0x1d4));if(typeof _0x21d316[_0x100d81(0x1be)]!==_0x100d81(0x1c5)||typeof _0x21d316['text']!==_0x100d81(0x1c5))throw invalidContract(_0x100d81(0x18b));if(!Array[_0x100d81(0x1a5)](_0x21d316['tags'])||_0x21d316[_0x100d81(0x1ca)][_0x100d81(0x1c0)](_0x13e8e7=>typeof _0x13e8e7!==_0x100d81(0x1c5)))throw invalidContract(_0x100d81(0x1ca));if(!Number[_0x100d81(0x1d3)](_0x21d316[_0x100d81(0x1d5)])||_0x21d316[_0x100d81(0x1d5)]!==_0x250eb2+0x1)throw invalidContract(_0x100d81(0x1d5));if(!isFiniteNumber(_0x21d316[_0x100d81(0x1c2)])||!isFiniteNumber(_0x21d316['finalScore']))throw invalidContract(_0x100d81(0x1d0));return{'documentId':_0x104a0a(_0x100d81(0x199)),'revision':_0x21d316[_0x100d81(0x19a)],'chunkId':_0x104a0a(_0x100d81(0x19d)),'scope':_0x21d316[_0x100d81(0x1d4)],'title':_0x21d316['title'],'text':_0x21d316['text'],'tags':[..._0x21d316[_0x100d81(0x1ca)]],'rank':_0x21d316[_0x100d81(0x1d5)],'rawScore':_0x21d316['rawScore'],'finalScore':_0x21d316[_0x100d81(0x1a7)],'scoreKind':_0x104a0a(_0x100d81(0x186))};}function requireExactRecord(_0x4e2947,_0x488db1,_0x18ca05){const _0x182f65=a283_0x1ee16c,_0x50708b=requireRecord(_0x4e2947,_0x18ca05),_0x4fe5c2=Object['keys'](_0x50708b)[_0x182f65(0x1bf)](),_0x32c8fa=[..._0x488db1]['sort']();if(_0x4fe5c2[_0x182f65(0x1c6)]!==_0x32c8fa[_0x182f65(0x1c6)]||_0x4fe5c2['some']((_0x10f161,_0x3606d8)=>_0x10f161!==_0x32c8fa[_0x3606d8]))throw invalidContract(_0x18ca05);return _0x50708b;}function requireRecord(_0x522b90,_0x563d20){const _0x40c706=a283_0x1ee16c;if(!_0x522b90||typeof _0x522b90!==_0x40c706(0x189)||Array[_0x40c706(0x1a5)](_0x522b90))throw invalidContract(_0x563d20);return _0x522b90;}function isFiniteNumber(_0x45babe){const _0x5853af=a283_0x1ee16c;return typeof _0x45babe===_0x5853af(0x1c8)&&Number[_0x5853af(0x1c1)](_0x45babe);}function invalidContract(_0x368371){const _0x194f01=a283_0x1ee16c;return CliErrors[_0x194f01(0x190)](_0x194f01(0x18f)+_0x368371+_0x194f01(0x1a3));}
1
+ const a283_0x19c988=a283_0x5d67;(function(_0x241d14,_0x1cd04e){const _0x59b97e=a283_0x5d67,_0x42ee2c=_0x241d14();while(!![]){try{const _0x517415=parseInt(_0x59b97e(0x1d1))/0x1*(parseInt(_0x59b97e(0x1ca))/0x2)+parseInt(_0x59b97e(0x1e4))/0x3*(parseInt(_0x59b97e(0x1ce))/0x4)+-parseInt(_0x59b97e(0x1d3))/0x5+-parseInt(_0x59b97e(0x1c3))/0x6+parseInt(_0x59b97e(0x1d2))/0x7*(-parseInt(_0x59b97e(0x206))/0x8)+parseInt(_0x59b97e(0x1d4))/0x9*(parseInt(_0x59b97e(0x1c0))/0xa)+-parseInt(_0x59b97e(0x1de))/0xb*(parseInt(_0x59b97e(0x1e7))/0xc);if(_0x517415===_0x1cd04e)break;else _0x42ee2c['push'](_0x42ee2c['shift']());}catch(_0xff71){_0x42ee2c['push'](_0x42ee2c['shift']());}}}(a283_0xacac,0x49c99));function a283_0x5d67(_0x591e5e,_0x312891){_0x591e5e=_0x591e5e-0x1b8;const _0xacac7a=a283_0xacac();let _0x5d678b=_0xacac7a[_0x591e5e];return _0x5d678b;}import{getKbDomain}from'../constant/domain.js';import{CliError,CliErrors}from'../errors.js';const RESPONSE_KEYS=[a283_0x19c988(0x1ba),a283_0x19c988(0x1c1),'total','hits',a283_0x19c988(0x1ec),a283_0x19c988(0x1d7)],HIT_KEYS=[a283_0x19c988(0x1be),a283_0x19c988(0x200),a283_0x19c988(0x1c9),a283_0x19c988(0x1f9),'title','text',a283_0x19c988(0x1bb),a283_0x19c988(0x205),a283_0x19c988(0x1da),'finalScore','scoreKind'];export async function searchDevelopmentKnowledge(_0x2583f9){const _0x2dacb0=a283_0x19c988,_0x2bb1df=_0x2583f9[_0x2dacb0(0x1d6)][_0x2dacb0(0x204)](),_0x1f260a=_0x2583f9[_0x2dacb0(0x1e1)][_0x2dacb0(0x204)]();if(!_0x2bb1df)throw CliErrors[_0x2dacb0(0x1bc)](_0x2dacb0(0x1ef));if(!_0x2583f9[_0x2dacb0(0x1c6)][_0x2dacb0(0x204)]())throw CliErrors[_0x2dacb0(0x1d8)]();if(!_0x1f260a)throw CliErrors[_0x2dacb0(0x1bc)](_0x2dacb0(0x202));validateTopK(_0x2583f9[_0x2dacb0(0x1fd)]);const _0x327ee1=getKbDomain()+_0x2dacb0(0x1c5);let _0x6241fe;try{_0x6241fe=await fetch(_0x327ee1,{'method':_0x2dacb0(0x1e2),'headers':{'Content-Type':'application/json','Cookie':_0x2583f9[_0x2dacb0(0x1c6)],'X-Invoke-Source':_0x2dacb0(0x1fa)},'body':JSON[_0x2dacb0(0x201)]({'appCode':_0x2bb1df,'query':_0x1f260a,..._0x2583f9[_0x2dacb0(0x1fd)]!==undefined?{'topK':_0x2583f9['topK']}:{}}),'signal':_0x2583f9[_0x2dacb0(0x1e8)]});}catch(_0x55ad0f){if(_0x55ad0f instanceof CliError)throw _0x55ad0f;if(_0x55ad0f instanceof Error&&_0x55ad0f[_0x2dacb0(0x1c2)]===_0x2dacb0(0x1ea))throw _0x55ad0f;throw CliErrors[_0x2dacb0(0x1f7)](_0x2dacb0(0x1f1));}if(!hasNoStore(_0x6241fe[_0x2dacb0(0x1ed)]))throw CliErrors[_0x2dacb0(0x207)]('SmartCode\x20knowledge\x20search\x20response\x20is\x20missing\x20Cache-Control:\x20no-store.');if(_0x6241fe[_0x2dacb0(0x203)]===0x191)throw CliErrors[_0x2dacb0(0x1d8)]();if(!_0x6241fe['ok'])throw CliErrors[_0x2dacb0(0x207)](_0x2dacb0(0x1c8)+_0x6241fe[_0x2dacb0(0x203)]+').');if(!(_0x6241fe['headers'][_0x2dacb0(0x1c4)](_0x2dacb0(0x1b9))??'')['toLowerCase']()['includes'](_0x2dacb0(0x1fb)))throw CliErrors['apiError']('SmartCode\x20knowledge\x20search\x20returned\x20a\x20non-JSON\x20content\x20type.');let _0x511cc1;try{_0x511cc1=await _0x6241fe['json']();}catch{throw CliErrors['apiError'](_0x2dacb0(0x1e0));}return parseDevelopmentSearchResponse(readEnvelopeData(_0x511cc1),_0x2583f9[_0x2dacb0(0x1fd)]);}function readEnvelopeData(_0x4bae6a){const _0x5f37ab=a283_0x19c988,_0x5a645f=requireRecord(_0x4bae6a,'response\x20envelope');if(_0x5a645f[_0x5f37ab(0x1d9)]===![])throw CliErrors['apiError'](_0x5f37ab(0x1f5));if(!(_0x5f37ab(0x1cd)in _0x5a645f))throw invalidContract(_0x5f37ab(0x1db));return _0x5a645f[_0x5f37ab(0x1cd)];}function validateTopK(_0x1b3c9d){const _0x47630a=a283_0x19c988;if(_0x1b3c9d!==undefined&&(!Number[_0x47630a(0x1f6)](_0x1b3c9d)||_0x1b3c9d<0x1||_0x1b3c9d>0x32))throw CliErrors['validation'](_0x47630a(0x1f2));}function a283_0xacac(){const _0x53222d=['name','455208CFuidR','get','/smartapi/knowledge/company-public/search','cookie','isArray','SmartCode\x20knowledge\x20search\x20failed\x20(HTTP\x20','chunkId','14hLkzRE','development','keys','data','1402756UGLdEW','number','length','81835VJicef','7uUwcQW','438565ElFNxc','30987xdDfWF','string','appCode','timingsMs','authRequired','success','rawScore','response\x20envelope','test','toLowerCase','12166YkLERZ','score','SmartCode\x20knowledge\x20search\x20returned\x20invalid\x20JSON.','query','POST','finalScore','3dMYqAJ','total','hits','5964xaBmcB','signal','public','AbortError','isFinite','strategyFingerprint','headers','scoreKind','Knowledge\x20search\x20appCode\x20is\x20required.','object','SmartCode\x20knowledge\x20search\x20request\x20failed.','Knowledge\x20search\x20topK\x20must\x20be\x20an\x20integer\x20from\x201\x20through\x2050.','title','text','SmartCode\x20knowledge\x20search\x20failed.','isSafeInteger','networkError','cache-control','scope','cli:rabetbase','application/json','response','topK','entries','sort','revision','stringify','Knowledge\x20search\x20query\x20is\x20required.','status','trim','rank','283432ICDlaS','apiError','some','content-type','schemaVersion','tags','validation','\x20contract.','documentId','hits[','370mWrwBj','profile'];a283_0xacac=function(){return _0x53222d;};return a283_0xacac();}function hasNoStore(_0x3e2936){const _0x36cc64=a283_0x19c988;return(_0x3e2936['get'](_0x36cc64(0x1f8))??'')['split'](',')[_0x36cc64(0x1b8)](_0x23caf6=>_0x23caf6[_0x36cc64(0x204)]()[_0x36cc64(0x1dd)]()==='no-store');}function parseDevelopmentSearchResponse(_0x22f4ab,_0x2045d4){const _0x2dbb09=a283_0x19c988,_0x3538a8=requireExactRecord(_0x22f4ab,RESPONSE_KEYS,_0x2dbb09(0x1fc));if(_0x3538a8[_0x2dbb09(0x1ba)]!==0x2||_0x3538a8[_0x2dbb09(0x1c1)]!==_0x2dbb09(0x1cb))throw invalidContract(_0x2dbb09(0x1c1));if(!Array[_0x2dbb09(0x1c7)](_0x3538a8[_0x2dbb09(0x1e6)])||_0x3538a8[_0x2dbb09(0x1e6)][_0x2dbb09(0x1d0)]>(_0x2045d4??0x32))throw invalidContract(_0x2dbb09(0x1e6));if(typeof _0x3538a8[_0x2dbb09(0x1ec)]!==_0x2dbb09(0x1d5)||!/^sha256:[0-9a-f]{64}$/[_0x2dbb09(0x1dc)](_0x3538a8[_0x2dbb09(0x1ec)]))throw invalidContract('strategyFingerprint');const _0x5a8916=requireRecord(_0x3538a8[_0x2dbb09(0x1d7)],_0x2dbb09(0x1d7)),_0x3023a4={};for(const [_0x54ac5f,_0x52075a]of Object[_0x2dbb09(0x1fe)](_0x5a8916)){if(!/^[A-Za-z][A-Za-z0-9]*$/[_0x2dbb09(0x1dc)](_0x54ac5f)||typeof _0x52075a!==_0x2dbb09(0x1cf)||!Number[_0x2dbb09(0x1eb)](_0x52075a)||_0x52075a<0x0)throw invalidContract(_0x2dbb09(0x1d7));_0x3023a4[_0x54ac5f]=_0x52075a;}const _0x3ba5dc=_0x3538a8[_0x2dbb09(0x1e6)]['map']((_0xf93bc,_0x2eb726)=>parseHit(_0xf93bc,_0x2eb726));if(!Number[_0x2dbb09(0x1f6)](_0x3538a8[_0x2dbb09(0x1e5)])||_0x3538a8[_0x2dbb09(0x1e5)]!==_0x3ba5dc[_0x2dbb09(0x1d0)])throw invalidContract(_0x2dbb09(0x1e5));return{'schemaVersion':_0x3538a8[_0x2dbb09(0x1ba)],'profile':_0x3538a8['profile'],'total':_0x3538a8['total'],'strategyFingerprint':_0x3538a8['strategyFingerprint'],'timingsMs':_0x3023a4,'hits':_0x3ba5dc};}function parseHit(_0x5cfb87,_0x59a254){const _0x5c315f=a283_0x19c988,_0x138a3b=requireExactRecord(_0x5cfb87,HIT_KEYS,_0x5c315f(0x1bf)+_0x59a254+']'),_0x241bce=_0x50e4fd=>{const _0x340a76=_0x5c315f,_0x66bb66=_0x138a3b[_0x50e4fd];if(typeof _0x66bb66!==_0x340a76(0x1d5)||!_0x66bb66)throw invalidContract(_0x50e4fd);return _0x66bb66;};if(!Number[_0x5c315f(0x1f6)](_0x138a3b[_0x5c315f(0x200)])||_0x138a3b[_0x5c315f(0x200)]<0x1)throw invalidContract(_0x5c315f(0x200));if(_0x138a3b[_0x5c315f(0x1f9)]!==_0x5c315f(0x1e9)&&_0x138a3b['scope']!=='company')throw invalidContract(_0x5c315f(0x1f9));if(typeof _0x138a3b['title']!=='string'||typeof _0x138a3b[_0x5c315f(0x1f4)]!=='string')throw invalidContract('text');if(!Array['isArray'](_0x138a3b[_0x5c315f(0x1bb)])||_0x138a3b[_0x5c315f(0x1bb)][_0x5c315f(0x1b8)](_0x16e8e2=>typeof _0x16e8e2!=='string'))throw invalidContract('tags');if(!Number[_0x5c315f(0x1f6)](_0x138a3b[_0x5c315f(0x205)])||_0x138a3b['rank']!==_0x59a254+0x1)throw invalidContract(_0x5c315f(0x205));if(!isFiniteNumber(_0x138a3b[_0x5c315f(0x1da)])||!isFiniteNumber(_0x138a3b['finalScore']))throw invalidContract(_0x5c315f(0x1df));return{'documentId':_0x241bce(_0x5c315f(0x1be)),'revision':_0x138a3b[_0x5c315f(0x200)],'chunkId':_0x241bce(_0x5c315f(0x1c9)),'scope':_0x138a3b[_0x5c315f(0x1f9)],'title':_0x138a3b[_0x5c315f(0x1f3)],'text':_0x138a3b[_0x5c315f(0x1f4)],'tags':[..._0x138a3b[_0x5c315f(0x1bb)]],'rank':_0x138a3b['rank'],'rawScore':_0x138a3b[_0x5c315f(0x1da)],'finalScore':_0x138a3b[_0x5c315f(0x1e3)],'scoreKind':_0x241bce(_0x5c315f(0x1ee))};}function requireExactRecord(_0x50d57a,_0xebd378,_0x4ad38c){const _0x420735=a283_0x19c988,_0x288a51=requireRecord(_0x50d57a,_0x4ad38c),_0x53be66=Object[_0x420735(0x1cc)](_0x288a51)['sort'](),_0xd148bc=[..._0xebd378][_0x420735(0x1ff)]();if(_0x53be66[_0x420735(0x1d0)]!==_0xd148bc['length']||_0x53be66['some']((_0x142ad1,_0x1f2fb7)=>_0x142ad1!==_0xd148bc[_0x1f2fb7]))throw invalidContract(_0x4ad38c);return _0x288a51;}function requireRecord(_0xdfdc38,_0x5e3ac0){const _0x4fdb53=a283_0x19c988;if(!_0xdfdc38||typeof _0xdfdc38!==_0x4fdb53(0x1f0)||Array[_0x4fdb53(0x1c7)](_0xdfdc38))throw invalidContract(_0x5e3ac0);return _0xdfdc38;}function isFiniteNumber(_0x4805bc){const _0x4f52a1=a283_0x19c988;return typeof _0x4805bc===_0x4f52a1(0x1cf)&&Number['isFinite'](_0x4805bc);}function invalidContract(_0x52e572){const _0xc04db6=a283_0x19c988;return CliErrors[_0xc04db6(0x207)]('SmartCode\x20knowledge\x20search\x20returned\x20an\x20invalid\x20'+_0x52e572+_0xc04db6(0x1bd));}
@@ -1 +1 @@
1
- const a284_0x22dd40=a284_0x3324;(function(_0x5d1407,_0x2e203c){const _0x5d51c6=a284_0x3324,_0x2ac933=_0x5d1407();while(!![]){try{const _0x44d5b7=-parseInt(_0x5d51c6(0x173))/0x1+-parseInt(_0x5d51c6(0x18b))/0x2*(parseInt(_0x5d51c6(0x17f))/0x3)+parseInt(_0x5d51c6(0x18d))/0x4+parseInt(_0x5d51c6(0x176))/0x5+parseInt(_0x5d51c6(0x16f))/0x6*(parseInt(_0x5d51c6(0x17d))/0x7)+-parseInt(_0x5d51c6(0x17c))/0x8*(-parseInt(_0x5d51c6(0x18c))/0x9)+-parseInt(_0x5d51c6(0x175))/0xa;if(_0x44d5b7===_0x2e203c)break;else _0x2ac933['push'](_0x2ac933['shift']());}catch(_0x21310d){_0x2ac933['push'](_0x2ac933['shift']());}}}(a284_0x1120,0x90bc2));function a284_0x3324(_0x430c1d,_0x168fdd){_0x430c1d=_0x430c1d-0x16f;const _0x112050=a284_0x1120();let _0x33246d=_0x112050[_0x430c1d];return _0x33246d;}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(_0x1f8935,_0x2c129d=process[a284_0x22dd40(0x177)]()){const _0x34051e=a284_0x22dd40,_0x495ccf=resolve(_0x2c129d),_0x53eb96=join(_0x495ccf,_0x34051e(0x189),_0x34051e(0x17b));return{'projectRoot':_0x495ccf,'pagesBaseDir':_0x53eb96,'appPagesDir':join(_0x53eb96,_0x1f8935),'lockFilePath':join(_0x495ccf,_0x34051e(0x189),_0x34051e(0x179))};}export function buildPageFileName(_0x344b54,_0x2b62dd){const _0x193dbc=a284_0x22dd40;return _0x344b54+'-'+_0x2b62dd[_0x193dbc(0x174)]()+_0x193dbc(0x181);}export function resolvePageFilePath(_0x5948cf,_0xb7e1e6,_0x574cde){const _0x4b4a72=a284_0x22dd40;return join(_0x5948cf[_0x4b4a72(0x188)],buildPageFileName(_0xb7e1e6,_0x574cde));}export async function ensureParentDirectory(_0x37d6cd){await mkdir(dirname(_0x37d6cd),{'recursive':!![]});}function a284_0x1120(){const _0x3abc5e=['9OICQTZ','4736756mYHWfY','48VZWloe','isDirectory','sort','localeCompare','25397UbjiKY','toUpperCase','21026240tJetWv','3303080FWAiPH','cwd','validation','page.lock.json','flagMissing','page','1756984rxSvnN','659554EDKMrZ','trim','21fSNwDg','Page\x20directory\x20is\x20not\x20a\x20directory:\x20','.json','name','utf8','Page\x20directory\x20not\x20found:\x20','F_OK','split','Unsupported\x20file\x20in\x20page\x20directory:\x20','appPagesDir','.rabetbase','isFile','27814orwKVY'];a284_0x1120=function(){return _0x3abc5e;};return a284_0x1120();}export async function fileExists(_0x57b2e0){const _0x364284=a284_0x22dd40;try{return await access(_0x57b2e0,constants[_0x364284(0x185)]),!![];}catch{return![];}}export async function readCustomPageDirectory(_0xae5e5a){const _0x129603=a284_0x22dd40,_0x4e41c4=_0xae5e5a[_0x129603(0x17e)]();if(!_0x4e41c4)throw CliErrors[_0x129603(0x17a)]('page-dir');const _0x3bc4e3=resolve(_0x4e41c4);let _0x5bef15;try{_0x5bef15=await lstat(_0x3bc4e3);}catch{throw CliErrors[_0x129603(0x178)](_0x129603(0x184)+_0x4e41c4);}if(!_0x5bef15[_0x129603(0x170)]())throw CliErrors[_0x129603(0x178)](_0x129603(0x180)+_0x4e41c4);const _0x23d3c7={};return await readDirectory(_0x3bc4e3,_0x3bc4e3,_0x23d3c7),_0x23d3c7;}async function readDirectory(_0x6c0d20,_0x28721e,_0x5bd5e5){const _0xa0ec59=a284_0x22dd40,_0x417e0f=await readdir(_0x28721e,{'withFileTypes':!![]});for(const _0x37de45 of _0x417e0f[_0xa0ec59(0x171)]((_0x3bee52,_0x2e8696)=>_0x3bee52[_0xa0ec59(0x182)][_0xa0ec59(0x172)](_0x2e8696[_0xa0ec59(0x182)]))){const _0x4b3998=join(_0x28721e,_0x37de45[_0xa0ec59(0x182)]);if(_0x37de45[_0xa0ec59(0x170)]()){await readDirectory(_0x6c0d20,_0x4b3998,_0x5bd5e5);continue;}if(!_0x37de45[_0xa0ec59(0x18a)]())throw CliErrors[_0xa0ec59(0x178)](_0xa0ec59(0x187)+_0x4b3998);_0x5bd5e5[relative(_0x6c0d20,_0x4b3998)[_0xa0ec59(0x186)](sep)['join']('/')]=await readFile(_0x4b3998,_0xa0ec59(0x183));}}
1
+ const a284_0x34e95e=a284_0x21d3;(function(_0xf9227e,_0x27664b){const _0x57b7fe=a284_0x21d3,_0x329982=_0xf9227e();while(!![]){try{const _0x18392b=-parseInt(_0x57b7fe(0x179))/0x1+-parseInt(_0x57b7fe(0x17b))/0x2*(parseInt(_0x57b7fe(0x170))/0x3)+-parseInt(_0x57b7fe(0x189))/0x4+parseInt(_0x57b7fe(0x174))/0x5*(-parseInt(_0x57b7fe(0x17c))/0x6)+-parseInt(_0x57b7fe(0x183))/0x7*(parseInt(_0x57b7fe(0x17d))/0x8)+parseInt(_0x57b7fe(0x182))/0x9+parseInt(_0x57b7fe(0x187))/0xa*(parseInt(_0x57b7fe(0x17f))/0xb);if(_0x18392b===_0x27664b)break;else _0x329982['push'](_0x329982['shift']());}catch(_0x44d4c0){_0x329982['push'](_0x329982['shift']());}}}(a284_0x5366,0xbfbe1));import{constants}from'node:fs';import{access,lstat,mkdir,readFile,readdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';function a284_0x5366(){const _0x496733=['Page\x20directory\x20is\x20not\x20a\x20directory:\x20','6171995xeqGpv','page','toUpperCase','isDirectory','name','1159008AUaMfw','cwd','1483554PaSItW','6qpQzjl','152XEMfrK','.json','749012jQpQiN','sort','flagMissing','14040423OaIgqa','291095eoxEEp','localeCompare','split','page.lock.json','670SUyrTH','appPagesDir','5646140gzQudF','trim','validation','3AChldV','Page\x20directory\x20not\x20found:\x20','.rabetbase'];a284_0x5366=function(){return _0x496733;};return a284_0x5366();}import{CliErrors}from'../../errors.js';export function loadPageProjectConfig(_0x320400,_0x2f4acf=process[a284_0x34e95e(0x17a)]()){const _0x318f40=a284_0x34e95e,_0x3adb4c=resolve(_0x2f4acf),_0x304dce=join(_0x3adb4c,_0x318f40(0x172),_0x318f40(0x175));return{'projectRoot':_0x3adb4c,'pagesBaseDir':_0x304dce,'appPagesDir':join(_0x304dce,_0x320400),'lockFilePath':join(_0x3adb4c,_0x318f40(0x172),_0x318f40(0x186))};}export function buildPageFileName(_0x5a77af,_0x2aeae8){const _0x393b15=a284_0x34e95e;return _0x5a77af+'-'+_0x2aeae8[_0x393b15(0x176)]()+_0x393b15(0x17e);}export function resolvePageFilePath(_0x376849,_0xd98a3a,_0x574a90){const _0x5e4417=a284_0x34e95e;return join(_0x376849[_0x5e4417(0x188)],buildPageFileName(_0xd98a3a,_0x574a90));}export async function ensureParentDirectory(_0x329f1f){await mkdir(dirname(_0x329f1f),{'recursive':!![]});}export async function fileExists(_0x577b02){try{return await access(_0x577b02,constants['F_OK']),!![];}catch{return![];}}function a284_0x21d3(_0x5da84e,_0x2b718d){_0x5da84e=_0x5da84e-0x170;const _0x5366ba=a284_0x5366();let _0x21d398=_0x5366ba[_0x5da84e];return _0x21d398;}export async function readCustomPageDirectory(_0x3cf845){const _0x57cd06=a284_0x34e95e,_0x64469c=_0x3cf845[_0x57cd06(0x18a)]();if(!_0x64469c)throw CliErrors[_0x57cd06(0x181)]('page-dir');const _0x441b6b=resolve(_0x64469c);let _0x214c66;try{_0x214c66=await lstat(_0x441b6b);}catch{throw CliErrors[_0x57cd06(0x18b)](_0x57cd06(0x171)+_0x64469c);}if(!_0x214c66[_0x57cd06(0x177)]())throw CliErrors[_0x57cd06(0x18b)](_0x57cd06(0x173)+_0x64469c);const _0x4ce919={};return await readDirectory(_0x441b6b,_0x441b6b,_0x4ce919),_0x4ce919;}async function readDirectory(_0x588824,_0x44792c,_0x2c7363){const _0x47687f=a284_0x34e95e,_0x1f1c3c=await readdir(_0x44792c,{'withFileTypes':!![]});for(const _0x16b3e1 of _0x1f1c3c[_0x47687f(0x180)]((_0x4ef45f,_0x1949f8)=>_0x4ef45f[_0x47687f(0x178)][_0x47687f(0x184)](_0x1949f8[_0x47687f(0x178)]))){const _0x53a943=join(_0x44792c,_0x16b3e1['name']);if(_0x16b3e1[_0x47687f(0x177)]()){await readDirectory(_0x588824,_0x53a943,_0x2c7363);continue;}if(!_0x16b3e1['isFile']())throw CliErrors[_0x47687f(0x18b)]('Unsupported\x20file\x20in\x20page\x20directory:\x20'+_0x53a943);_0x2c7363[relative(_0x588824,_0x53a943)[_0x47687f(0x185)](sep)['join']('/')]=await readFile(_0x53a943,'utf8');}}
@@ -1 +1 @@
1
- function a285_0x5e68(_0x1e0984,_0x1d092b){_0x1e0984=_0x1e0984-0x86;const _0x2e2792=a285_0x2e27();let _0x5e686d=_0x2e2792[_0x1e0984];return _0x5e686d;}(function(_0x2c4614,_0x137cba){const _0x37ed7a=a285_0x5e68,_0x1fcc3c=_0x2c4614();while(!![]){try{const _0x554703=parseInt(_0x37ed7a(0x8e))/0x1*(-parseInt(_0x37ed7a(0x8a))/0x2)+parseInt(_0x37ed7a(0x8b))/0x3+-parseInt(_0x37ed7a(0x86))/0x4*(-parseInt(_0x37ed7a(0x8f))/0x5)+-parseInt(_0x37ed7a(0x8c))/0x6+parseInt(_0x37ed7a(0x91))/0x7+parseInt(_0x37ed7a(0x90))/0x8+parseInt(_0x37ed7a(0x88))/0x9;if(_0x554703===_0x137cba)break;else _0x1fcc3c['push'](_0x1fcc3c['shift']());}catch(_0x3085f3){_0x1fcc3c['push'](_0x1fcc3c['shift']());}}}(a285_0x2e27,0x2f060));import a285_0x2581bd from'node:crypto';import{readFile}from'node:fs/promises';function a285_0x2e27(){const _0x3f30be=['2PCTNCn','468159XbsWqw','210030ugeQOI','utf8','342407etqIkD','9995pFDpLT','235352qSYlCv','1143198DsTefs','update','20khsmId','hex','1901151hwYpJh','createHash'];a285_0x2e27=function(){return _0x3f30be;};return a285_0x2e27();}export function serializePageSchemaForFile(_0x5f4059){return JSON['stringify'](JSON['parse'](_0x5f4059),null,0x2)+'\x0a';}export function computePageContentHash(_0x121c81){const _0xf9cc63=a285_0x5e68;return a285_0x2581bd[_0xf9cc63(0x89)]('md5')[_0xf9cc63(0x92)](_0x121c81)['digest'](_0xf9cc63(0x87));}export function computeSerializedSchemaHash(_0xd8c2cf){return computePageContentHash(serializePageSchemaForFile(_0xd8c2cf));}export async function computePageFileHash(_0x473a48){const _0x4e3c88=a285_0x5e68,_0x5f4f0e=await readFile(_0x473a48,_0x4e3c88(0x8d));return computePageContentHash(_0x5f4f0e);}
1
+ function a285_0x78b2(_0x12816b,_0x3ea7c6){_0x12816b=_0x12816b-0x14a;const _0x3760d8=a285_0x3760();let _0x78b2b9=_0x3760d8[_0x12816b];return _0x78b2b9;}(function(_0x5da665,_0x533c1b){const _0x628e05=a285_0x78b2,_0x469f75=_0x5da665();while(!![]){try{const _0x49e339=-parseInt(_0x628e05(0x153))/0x1*(parseInt(_0x628e05(0x157))/0x2)+parseInt(_0x628e05(0x152))/0x3*(-parseInt(_0x628e05(0x14f))/0x4)+parseInt(_0x628e05(0x154))/0x5+parseInt(_0x628e05(0x150))/0x6*(-parseInt(_0x628e05(0x159))/0x7)+parseInt(_0x628e05(0x14d))/0x8+parseInt(_0x628e05(0x14b))/0x9*(-parseInt(_0x628e05(0x14c))/0xa)+-parseInt(_0x628e05(0x155))/0xb*(-parseInt(_0x628e05(0x151))/0xc);if(_0x49e339===_0x533c1b)break;else _0x469f75['push'](_0x469f75['shift']());}catch(_0xabede3){_0x469f75['push'](_0x469f75['shift']());}}}(a285_0x3760,0x60b2c));function a285_0x3760(){const _0x445fac=['206090OfKxpZ','2714424qhKUgL','createHash','12396IiEwFR','168ReNtoD','12lnUylj','411WyAliS','1nyAZId','137225GBNgRF','18535429vMaNQi','md5','1497904yTEnef','update','79331gLuUwY','stringify','72hUxKFS'];a285_0x3760=function(){return _0x445fac;};return a285_0x3760();}import a285_0x577d8f from'node:crypto';import{readFile}from'node:fs/promises';export function serializePageSchemaForFile(_0x526bab){const _0x502d8f=a285_0x78b2;return JSON[_0x502d8f(0x14a)](JSON['parse'](_0x526bab),null,0x2)+'\x0a';}export function computePageContentHash(_0x2c2bd1){const _0x57eb97=a285_0x78b2;return a285_0x577d8f[_0x57eb97(0x14e)](_0x57eb97(0x156))[_0x57eb97(0x158)](_0x2c2bd1)['digest']('hex');}export function computeSerializedSchemaHash(_0x4f2773){return computePageContentHash(serializePageSchemaForFile(_0x4f2773));}export async function computePageFileHash(_0x44502f){const _0x4092a6=await readFile(_0x44502f,'utf8');return computePageContentHash(_0x4092a6);}
@@ -1 +1 @@
1
- function a286_0x35cc(_0x2f1dcf,_0x2f1e7e){_0x2f1dcf=_0x2f1dcf-0x143;const _0x26d615=a286_0x26d6();let _0x35cc4e=_0x26d615[_0x2f1dcf];return _0x35cc4e;}(function(_0x496d33,_0x4fbdb8){const _0x1b67b0=a286_0x35cc,_0x63c1c3=_0x496d33();while(!![]){try{const _0x17ef79=parseInt(_0x1b67b0(0x155))/0x1*(-parseInt(_0x1b67b0(0x149))/0x2)+-parseInt(_0x1b67b0(0x143))/0x3*(parseInt(_0x1b67b0(0x150))/0x4)+parseInt(_0x1b67b0(0x14c))/0x5*(-parseInt(_0x1b67b0(0x152))/0x6)+-parseInt(_0x1b67b0(0x14f))/0x7*(-parseInt(_0x1b67b0(0x14d))/0x8)+parseInt(_0x1b67b0(0x156))/0x9+parseInt(_0x1b67b0(0x14a))/0xa*(parseInt(_0x1b67b0(0x151))/0xb)+parseInt(_0x1b67b0(0x14b))/0xc*(parseInt(_0x1b67b0(0x144))/0xd);if(_0x17ef79===_0x4fbdb8)break;else _0x63c1c3['push'](_0x63c1c3['shift']());}catch(_0x2f960b){_0x63c1c3['push'](_0x63c1c3['shift']());}}}(a286_0x26d6,0x2879c));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x2174c4,_0x473b58){const _0x364c71=a286_0x35cc,_0x4c6ed4={'apps':_0x2174c4['apps']&&typeof _0x2174c4['apps']==='object'?_0x2174c4['apps']:{}};let _0x2f0493=_0x4c6ed4[_0x364c71(0x145)][_0x473b58];if(!_0x2f0493)return _0x2f0493={'lastSync':'','pages':{}},_0x4c6ed4[_0x364c71(0x145)][_0x473b58]=_0x2f0493,{'lockData':_0x4c6ed4,'appLock':_0x2f0493};return!_0x2f0493[_0x364c71(0x154)]&&(_0x2f0493[_0x364c71(0x154)]=''),(!_0x2f0493['pages']||typeof _0x2f0493[_0x364c71(0x153)]!=='object')&&(_0x2f0493[_0x364c71(0x153)]={}),{'lockData':_0x4c6ed4,'appLock':_0x2f0493};}function a286_0x26d6(){const _0x46a082=['7652ziYKAi','20yGKBnO','1116FgsuyV','385100vgLbtx','7712eUgjIK','stringify','490MwhKpB','20ABXHxV','1156067SJXIHk','12hTqjit','pages','lastSync','47qHWCah','1804329IucXoq','utf8','175428YLNOaK','43875umzkPV','apps','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','parse','object'];a286_0x26d6=function(){return _0x46a082;};return a286_0x26d6();}export async function readPageLockFile(_0x51448c){const _0x457a1b=a286_0x35cc;try{const _0x4c4741=await readFile(_0x51448c,_0x457a1b(0x157)),_0x3c85b9=JSON[_0x457a1b(0x147)](_0x4c4741);return{'apps':_0x3c85b9[_0x457a1b(0x145)]&&typeof _0x3c85b9['apps']===_0x457a1b(0x148)?_0x3c85b9[_0x457a1b(0x145)]:{}};}catch(_0x27860a){if(_0x27860a['code']==='ENOENT')return null;throw new Error(_0x457a1b(0x146)+String(_0x27860a));}}export async function writePageLockFile(_0x378c57,_0x33712b){const _0x422456=a286_0x35cc;await mkdir(dirname(_0x378c57),{'recursive':!![]}),await writeFile(_0x378c57,JSON[_0x422456(0x14e)](_0x33712b,null,0x2),_0x422456(0x157));}
1
+ (function(_0xf9ae44,_0x403703){const _0x3bdfd7=a286_0x4a9d,_0x45811c=_0xf9ae44();while(!![]){try{const _0x29651e=-parseInt(_0x3bdfd7(0x125))/0x1*(-parseInt(_0x3bdfd7(0x128))/0x2)+-parseInt(_0x3bdfd7(0x11b))/0x3*(-parseInt(_0x3bdfd7(0x11d))/0x4)+-parseInt(_0x3bdfd7(0x126))/0x5*(-parseInt(_0x3bdfd7(0x12a))/0x6)+parseInt(_0x3bdfd7(0x11f))/0x7+-parseInt(_0x3bdfd7(0x122))/0x8+-parseInt(_0x3bdfd7(0x127))/0x9+-parseInt(_0x3bdfd7(0x11a))/0xa;if(_0x29651e===_0x403703)break;else _0x45811c['push'](_0x45811c['shift']());}catch(_0x56145a){_0x45811c['push'](_0x45811c['shift']());}}}(a286_0x4cc0,0xa54a9));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyPageLock(){return{'apps':{}};}export function ensurePageLockScope(_0x30dfa9,_0x10eab5){const _0x20b1dc=a286_0x4a9d,_0x5105da={'apps':_0x30dfa9[_0x20b1dc(0x121)]&&typeof _0x30dfa9[_0x20b1dc(0x121)]===_0x20b1dc(0x11e)?_0x30dfa9[_0x20b1dc(0x121)]:{}};let _0x1124cc=_0x5105da[_0x20b1dc(0x121)][_0x10eab5];if(!_0x1124cc)return _0x1124cc={'lastSync':'','pages':{}},_0x5105da['apps'][_0x10eab5]=_0x1124cc,{'lockData':_0x5105da,'appLock':_0x1124cc};return!_0x1124cc[_0x20b1dc(0x11c)]&&(_0x1124cc[_0x20b1dc(0x11c)]=''),(!_0x1124cc[_0x20b1dc(0x123)]||typeof _0x1124cc[_0x20b1dc(0x123)]!==_0x20b1dc(0x11e))&&(_0x1124cc[_0x20b1dc(0x123)]={}),{'lockData':_0x5105da,'appLock':_0x1124cc};}export async function readPageLockFile(_0x14cdd4){const _0x7d22e7=a286_0x4a9d;try{const _0xffcb2f=await readFile(_0x14cdd4,_0x7d22e7(0x129)),_0x559de4=JSON['parse'](_0xffcb2f);return{'apps':_0x559de4['apps']&&typeof _0x559de4[_0x7d22e7(0x121)]===_0x7d22e7(0x11e)?_0x559de4[_0x7d22e7(0x121)]:{}};}catch(_0x3ed2f1){if(_0x3ed2f1[_0x7d22e7(0x119)]==='ENOENT')return null;throw new Error(_0x7d22e7(0x124)+String(_0x3ed2f1));}}export async function writePageLockFile(_0x5d82fb,_0x1bb5db){const _0x5aec8a=a286_0x4a9d;await mkdir(dirname(_0x5d82fb),{'recursive':!![]}),await writeFile(_0x5d82fb,JSON[_0x5aec8a(0x120)](_0x1bb5db,null,0x2),_0x5aec8a(0x129));}function a286_0x4a9d(_0x4b899e,_0x2ac428){_0x4b899e=_0x4b899e-0x119;const _0x4cc04d=a286_0x4cc0();let _0x4a9dba=_0x4cc04d[_0x4b899e];return _0x4a9dba;}function a286_0x4cc0(){const _0x36a8d2=['8518736UPqDox','pages','Failed\x20to\x20read\x20page\x20lock\x20file:\x20','2UPnnob','5EZgvMX','4250700OlOUOp','921096mGjVFf','utf8','2094216lBCYhP','code','5204920PTClTs','9RQwySt','lastSync','286468qZqesX','object','8747788DlneqR','stringify','apps'];a286_0x4cc0=function(){return _0x36a8d2;};return a286_0x4cc0();}
@@ -1 +1 @@
1
- (function(_0x1c95de,_0x48324b){const _0x41249c=a287_0x67db,_0x2ceb82=_0x1c95de();while(!![]){try{const _0x19718d=parseInt(_0x41249c(0x1d4))/0x1*(parseInt(_0x41249c(0x1cd))/0x2)+parseInt(_0x41249c(0x1e5))/0x3*(-parseInt(_0x41249c(0x1e1))/0x4)+parseInt(_0x41249c(0x1d0))/0x5*(parseInt(_0x41249c(0x1d6))/0x6)+parseInt(_0x41249c(0x1ea))/0x7+parseInt(_0x41249c(0x1df))/0x8+parseInt(_0x41249c(0x1d5))/0x9*(-parseInt(_0x41249c(0x1ef))/0xa)+parseInt(_0x41249c(0x1d9))/0xb;if(_0x19718d===_0x48324b)break;else _0x2ceb82['push'](_0x2ceb82['shift']());}catch(_0x4f2aff){_0x2ceb82['push'](_0x2ceb82['shift']());}}}(a287_0x58b8,0x850d3));function a287_0x67db(_0x14d4de,_0x5e76a7){_0x14d4de=_0x14d4de-0x1c2;const _0x58b83b=a287_0x58b8();let _0x67db0a=_0x58b83b[_0x14d4de];return _0x67db0a;}import{CliErrors}from'../../errors.js';export async function prepareLrSmartJsxForPush(_0x10c152,_0x4a102a,_0x5465ca){const _0x2ff127=a287_0x67db,_0x5a39f8=parseSchema(_0x10c152,_0x2ff127(0x1cf)),_0x1289ec=parseSchema(_0x4a102a,_0x2ff127(0x1db)),_0x1738b0=collectLrSmartJsx(_0x5a39f8,!![]);if(_0x1738b0[_0x2ff127(0x1e4)]===0x0)return{'content':_0x10c152,'compiledNodes':0x0,'normalizedNodes':0x0};const _0x223114=new Map(collectLrSmartJsx(_0x1289ec)[_0x2ff127(0x1da)](_0xefb92=>[_0xefb92[_0x2ff127(0x1d3)],_0xefb92]));let _0x416e1e=0x0,_0x440d16=0x0;for(const _0x8b7613 of _0x1738b0){const _0x56f87c=readNonEmptyString(_0x8b7613[_0x2ff127(0x1f1)][_0x2ff127(0x1cb)]),_0x191e83=readNonEmptyString(_0x8b7613['render'][_0x2ff127(0x1c2)]),_0x245686=_0x223114[_0x2ff127(0x1e7)](_0x8b7613[_0x2ff127(0x1d3)]),_0x3e50e4=readNonEmptyString(_0x245686?.[_0x2ff127(0x1f1)][_0x2ff127(0x1cb)]),_0x1156db=readNonEmptyString(_0x245686?.[_0x2ff127(0x1f1)]['value']);let _0x19f84c=![];_0x8b7613['render']['type']!==_0x2ff127(0x1e6)&&(_0x8b7613[_0x2ff127(0x1f1)][_0x2ff127(0x1ec)]='JSFunction',_0x19f84c=!![]);!isPageContextExpression(_0x8b7613[_0x2ff127(0x1d7)][_0x2ff127(0x1c8)])&&(_0x8b7613['props'][_0x2ff127(0x1c8)]={'type':'JSExpression','value':_0x2ff127(0x1ee)},_0x19f84c=!![]);if(!_0x56f87c){if(!_0x191e83)throw CliErrors[_0x2ff127(0x1d8)]('LrSmartJsx\x20node\x20\x22'+_0x8b7613['label']+_0x2ff127(0x1cc),_0x2ff127(0x1e2));if(_0x19f84c)_0x440d16+=0x1;continue;}const _0x41f970=!_0x245686||_0x56f87c!==_0x3e50e4,_0x15df52=!_0x191e83;if(!_0x41f970&&_0x191e83&&_0x1156db&&_0x191e83!==_0x1156db)throw CliErrors['validation'](_0x2ff127(0x1eb)+_0x8b7613[_0x2ff127(0x1c5)]+_0x2ff127(0x1dd),_0x2ff127(0x1e0));if(_0x41f970||_0x15df52||!_0x1156db){const _0xf16f74=readNonEmptyString(await _0x5465ca(_0x56f87c));if(!_0xf16f74)throw CliErrors[_0x2ff127(0x1d2)](_0x2ff127(0x1ed)+_0x8b7613['label']+'\x22.');_0x8b7613[_0x2ff127(0x1f1)][_0x2ff127(0x1c2)]=_0xf16f74,_0x416e1e+=0x1,_0x19f84c=!![];}if(_0x19f84c)_0x440d16+=0x1;}if(_0x440d16===0x0)return{'content':_0x10c152,'compiledNodes':_0x416e1e,'normalizedNodes':_0x440d16};return{'content':JSON['stringify'](_0x5a39f8),'compiledNodes':_0x416e1e,'normalizedNodes':_0x440d16};}function parseSchema(_0x4b5edf,_0x7297a6){const _0x1ca37b=a287_0x67db;try{return JSON['parse'](_0x4b5edf);}catch{throw CliErrors[_0x1ca37b(0x1d8)](_0x1ca37b(0x1e3)+_0x7297a6+_0x1ca37b(0x1c9));}}function a287_0x58b8(){const _0x5bd854=['string','2497656vSanwO','Edit\x20render.source\x20instead;\x20render.value\x20is\x20generated\x20during\x20page\x20push.','212fMhMlg','Add\x20JSX\x20source\x20in\x20the\x20page\x20editor\x20or\x20remove\x20the\x20incomplete\x20component.','Invalid\x20JSON\x20in\x20','length','36474ewSddS','JSFunction','get','LrSmartJsx','Set\x20props.render\x20to\x20an\x20object\x20containing\x20render.source\x20or\x20render.value.','2523549mPZlMA','LrSmartJsx\x20node\x20\x22','type','LrSmartJsx\x20compilation\x20returned\x20no\x20code\x20for\x20node\x20\x22','this','681510IezEqG','componentName','render','value','id:','\x22\x20has\x20missing\x20or\x20invalid\x20props.','label','trim','JSExpression','_context','\x20page\x20schema.','entries','source','\x22\x20is\x20missing\x20both\x20render.source\x20and\x20render.value.','1632874nMCvdK','path:','local','55155glYabn','forEach','apiError','key','1ZkCQuA','54HNKIsY','42OqhZal','props','validation','350801kpBIln','map','remote','\x22\x20has\x20missing\x20or\x20invalid\x20props.render.','\x22\x20has\x20a\x20manually\x20changed\x20render.value.'];a287_0x58b8=function(){return _0x5bd854;};return a287_0x58b8();}function collectLrSmartJsx(_0x1f55af,_0x498ac5=![]){const _0x17c95b=[],_0x3432e8=(_0x3a50e0,_0x51158f)=>{const _0x5ab547=a287_0x67db;if(Array['isArray'](_0x3a50e0)){_0x3a50e0[_0x5ab547(0x1d1)]((_0x169450,_0x3550ce)=>_0x3432e8(_0x169450,_0x51158f+'['+_0x3550ce+']'));return;}if(!isObject(_0x3a50e0))return;if(_0x3a50e0['componentName']==='LrSmartJsx'){const _0x51e603=readNonEmptyString(_0x3a50e0['id']),_0x38b569=_0x51e603||_0x51158f,_0x277958=isObject(_0x3a50e0[_0x5ab547(0x1d7)])?_0x3a50e0[_0x5ab547(0x1d7)]:undefined;if(!_0x277958){if(_0x498ac5)throw CliErrors['validation'](_0x5ab547(0x1eb)+_0x38b569+_0x5ab547(0x1c4),'Set\x20props\x20to\x20an\x20object\x20containing\x20a\x20render\x20object.');return;}const _0x409b89=isObject(_0x277958[_0x5ab547(0x1f1)])?_0x277958['render']:undefined;if(!_0x409b89){if(_0x498ac5)throw CliErrors[_0x5ab547(0x1d8)](_0x5ab547(0x1eb)+_0x38b569+_0x5ab547(0x1dc),_0x5ab547(0x1e9));return;}_0x17c95b['push']({'key':_0x51e603?_0x5ab547(0x1c3)+_0x51e603:_0x5ab547(0x1ce)+_0x51158f,'label':_0x38b569,'props':_0x277958,'render':_0x409b89});}for(const [_0x4e0031,_0x51b8fc]of Object[_0x5ab547(0x1ca)](_0x3a50e0)){if(_0x4e0031===_0x5ab547(0x1d7)&&_0x3a50e0[_0x5ab547(0x1f0)]===_0x5ab547(0x1e8))continue;_0x3432e8(_0x51b8fc,_0x51158f+'.'+_0x4e0031);}};return _0x3432e8(_0x1f55af,'$'),_0x17c95b;}function isObject(_0x1bb4e6){return Boolean(_0x1bb4e6)&&typeof _0x1bb4e6==='object'&&!Array['isArray'](_0x1bb4e6);}function readNonEmptyString(_0x441fa9){const _0x4c32cc=a287_0x67db;return typeof _0x441fa9===_0x4c32cc(0x1de)&&_0x441fa9[_0x4c32cc(0x1c6)]()?_0x441fa9:undefined;}function isPageContextExpression(_0x2ed093){const _0x39619d=a287_0x67db;return isObject(_0x2ed093)&&_0x2ed093[_0x39619d(0x1ec)]===_0x39619d(0x1c7)&&_0x2ed093[_0x39619d(0x1c2)]===_0x39619d(0x1ee);}
1
+ (function(_0x1b7fed,_0x519239){const _0x1f9150=a287_0x445a,_0x17f11d=_0x1b7fed();while(!![]){try{const _0x38e766=parseInt(_0x1f9150(0xf7))/0x1+parseInt(_0x1f9150(0x103))/0x2+parseInt(_0x1f9150(0x11b))/0x3*(-parseInt(_0x1f9150(0x111))/0x4)+-parseInt(_0x1f9150(0x10e))/0x5*(-parseInt(_0x1f9150(0x11a))/0x6)+-parseInt(_0x1f9150(0x122))/0x7+parseInt(_0x1f9150(0x10a))/0x8*(-parseInt(_0x1f9150(0x10f))/0x9)+-parseInt(_0x1f9150(0x125))/0xa;if(_0x38e766===_0x519239)break;else _0x17f11d['push'](_0x17f11d['shift']());}catch(_0x15575a){_0x17f11d['push'](_0x17f11d['shift']());}}}(a287_0x314b,0xf22c7));function a287_0x445a(_0x3f11b7,_0x346d0e){_0x3f11b7=_0x3f11b7-0xf7;const _0x314b2a=a287_0x314b();let _0x445a37=_0x314b2a[_0x3f11b7];return _0x445a37;}import{CliErrors}from'../../errors.js';export async function prepareLrSmartJsxForPush(_0x5c972a,_0x50ef04,_0x25ee88){const _0x1109ff=a287_0x445a,_0x37ef47=parseSchema(_0x5c972a,_0x1109ff(0x116)),_0x5738f5=parseSchema(_0x50ef04,_0x1109ff(0x112)),_0x1dc3fd=collectLrSmartJsx(_0x37ef47,!![]);if(_0x1dc3fd[_0x1109ff(0x11e)]===0x0)return{'content':_0x5c972a,'compiledNodes':0x0,'normalizedNodes':0x0};const _0xaece86=new Map(collectLrSmartJsx(_0x5738f5)[_0x1109ff(0x10c)](_0x2e5352=>[_0x2e5352[_0x1109ff(0xfc)],_0x2e5352]));let _0x87b61f=0x0,_0xece3aa=0x0;for(const _0x124d09 of _0x1dc3fd){const _0x24476e=readNonEmptyString(_0x124d09[_0x1109ff(0x11f)][_0x1109ff(0x114)]),_0x275ea3=readNonEmptyString(_0x124d09[_0x1109ff(0x11f)][_0x1109ff(0x121)]),_0x15f624=_0xaece86['get'](_0x124d09[_0x1109ff(0xfc)]),_0xe65db3=readNonEmptyString(_0x15f624?.['render'][_0x1109ff(0x114)]),_0x1f82c9=readNonEmptyString(_0x15f624?.['render'][_0x1109ff(0x121)]);let _0x3a9600=![];_0x124d09[_0x1109ff(0x11f)][_0x1109ff(0xfb)]!==_0x1109ff(0xf8)&&(_0x124d09['render'][_0x1109ff(0xfb)]=_0x1109ff(0xf8),_0x3a9600=!![]);!isPageContextExpression(_0x124d09['props'][_0x1109ff(0x100)])&&(_0x124d09[_0x1109ff(0x101)][_0x1109ff(0x100)]={'type':_0x1109ff(0x11c),'value':_0x1109ff(0xff)},_0x3a9600=!![]);if(!_0x24476e){if(!_0x275ea3)throw CliErrors[_0x1109ff(0x120)](_0x1109ff(0x108)+_0x124d09[_0x1109ff(0x107)]+_0x1109ff(0x118),_0x1109ff(0xfa));if(_0x3a9600)_0xece3aa+=0x1;continue;}const _0x31ee7a=!_0x15f624||_0x24476e!==_0xe65db3,_0x4b1643=!_0x275ea3;if(!_0x31ee7a&&_0x275ea3&&_0x1f82c9&&_0x275ea3!==_0x1f82c9)throw CliErrors['validation'](_0x1109ff(0x108)+_0x124d09[_0x1109ff(0x107)]+_0x1109ff(0x117),'Edit\x20render.source\x20instead;\x20render.value\x20is\x20generated\x20during\x20page\x20push.');if(_0x31ee7a||_0x4b1643||!_0x1f82c9){const _0xd9b7c1=readNonEmptyString(await _0x25ee88(_0x24476e));if(!_0xd9b7c1)throw CliErrors[_0x1109ff(0x124)](_0x1109ff(0x102)+_0x124d09['label']+'\x22.');_0x124d09['render'][_0x1109ff(0x121)]=_0xd9b7c1,_0x87b61f+=0x1,_0x3a9600=!![];}if(_0x3a9600)_0xece3aa+=0x1;}if(_0xece3aa===0x0)return{'content':_0x5c972a,'compiledNodes':_0x87b61f,'normalizedNodes':_0xece3aa};return{'content':JSON[_0x1109ff(0xf9)](_0x37ef47),'compiledNodes':_0x87b61f,'normalizedNodes':_0xece3aa};}function a287_0x314b(){const _0x5c1d6e=['54mBnEmI','78kjGoeG','JSExpression','\x22\x20has\x20missing\x20or\x20invalid\x20props.render.','length','render','validation','value','2315061tAXWTu','\x20page\x20schema.','apiError','9767120MDrBHa','1680910KpJyoe','JSFunction','stringify','Add\x20JSX\x20source\x20in\x20the\x20page\x20editor\x20or\x20remove\x20the\x20incomplete\x20component.','type','key','id:','trim','this','_context','props','LrSmartJsx\x20compilation\x20returned\x20no\x20code\x20for\x20node\x20\x22','3214754FycWuJ','\x22\x20has\x20missing\x20or\x20invalid\x20props.','componentName','entries','label','LrSmartJsx\x20node\x20\x22','isArray','248TMZoJk','parse','map','Set\x20props\x20to\x20an\x20object\x20containing\x20a\x20render\x20object.','871375VYaamf','263574rJyqzX','Set\x20props.render\x20to\x20an\x20object\x20containing\x20render.source\x20or\x20render.value.','253772UjVZyO','remote','LrSmartJsx','source','string','local','\x22\x20has\x20a\x20manually\x20changed\x20render.value.','\x22\x20is\x20missing\x20both\x20render.source\x20and\x20render.value.','object'];a287_0x314b=function(){return _0x5c1d6e;};return a287_0x314b();}function parseSchema(_0x3b19cc,_0x2324ae){const _0x2eeb85=a287_0x445a;try{return JSON[_0x2eeb85(0x10b)](_0x3b19cc);}catch{throw CliErrors[_0x2eeb85(0x120)]('Invalid\x20JSON\x20in\x20'+_0x2324ae+_0x2eeb85(0x123));}}function collectLrSmartJsx(_0x1e264b,_0x2b95af=![]){const _0x3a7d31=[],_0x497cca=(_0x109179,_0x26eb50)=>{const _0x4bb196=a287_0x445a;if(Array[_0x4bb196(0x109)](_0x109179)){_0x109179['forEach']((_0x42d233,_0x4c0f22)=>_0x497cca(_0x42d233,_0x26eb50+'['+_0x4c0f22+']'));return;}if(!isObject(_0x109179))return;if(_0x109179['componentName']===_0x4bb196(0x113)){const _0x2f4de9=readNonEmptyString(_0x109179['id']),_0x2dd3ed=_0x2f4de9||_0x26eb50,_0x3c8e4f=isObject(_0x109179[_0x4bb196(0x101)])?_0x109179['props']:undefined;if(!_0x3c8e4f){if(_0x2b95af)throw CliErrors[_0x4bb196(0x120)](_0x4bb196(0x108)+_0x2dd3ed+_0x4bb196(0x104),_0x4bb196(0x10d));return;}const _0x2a6acf=isObject(_0x3c8e4f['render'])?_0x3c8e4f['render']:undefined;if(!_0x2a6acf){if(_0x2b95af)throw CliErrors[_0x4bb196(0x120)]('LrSmartJsx\x20node\x20\x22'+_0x2dd3ed+_0x4bb196(0x11d),_0x4bb196(0x110));return;}_0x3a7d31['push']({'key':_0x2f4de9?_0x4bb196(0xfd)+_0x2f4de9:'path:'+_0x26eb50,'label':_0x2dd3ed,'props':_0x3c8e4f,'render':_0x2a6acf});}for(const [_0x5303e4,_0x4abbfe]of Object[_0x4bb196(0x106)](_0x109179)){if(_0x5303e4===_0x4bb196(0x101)&&_0x109179[_0x4bb196(0x105)]==='LrSmartJsx')continue;_0x497cca(_0x4abbfe,_0x26eb50+'.'+_0x5303e4);}};return _0x497cca(_0x1e264b,'$'),_0x3a7d31;}function isObject(_0x449cc2){const _0x269f4b=a287_0x445a;return Boolean(_0x449cc2)&&typeof _0x449cc2===_0x269f4b(0x119)&&!Array[_0x269f4b(0x109)](_0x449cc2);}function readNonEmptyString(_0x36ada2){const _0x4376d4=a287_0x445a;return typeof _0x36ada2===_0x4376d4(0x115)&&_0x36ada2[_0x4376d4(0xfe)]()?_0x36ada2:undefined;}function isPageContextExpression(_0x263381){const _0x4c7983=a287_0x445a;return isObject(_0x263381)&&_0x263381[_0x4c7983(0xfb)]==='JSExpression'&&_0x263381[_0x4c7983(0x121)]===_0x4c7983(0xff);}
@@ -1 +1 @@
1
- (function(_0x3742d4,_0x4342b6){const _0x2ef31b=a289_0x3f4f,_0x36b8af=_0x3742d4();while(!![]){try{const _0xb2d56=parseInt(_0x2ef31b(0x12d))/0x1+parseInt(_0x2ef31b(0x156))/0x2*(-parseInt(_0x2ef31b(0x12c))/0x3)+parseInt(_0x2ef31b(0x151))/0x4+parseInt(_0x2ef31b(0x163))/0x5*(-parseInt(_0x2ef31b(0x140))/0x6)+-parseInt(_0x2ef31b(0x127))/0x7*(-parseInt(_0x2ef31b(0x13b))/0x8)+parseInt(_0x2ef31b(0x141))/0x9*(-parseInt(_0x2ef31b(0x14d))/0xa)+parseInt(_0x2ef31b(0x164))/0xb;if(_0xb2d56===_0x4342b6)break;else _0x36b8af['push'](_0x36b8af['shift']());}catch(_0x4c6d57){_0x36b8af['push'](_0x36b8af['shift']());}}}(a289_0x466c,0x41c1f));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x316fbd,_0x52eaa5){const _0x355592=a289_0x3f4f,_0x872873=[],_0x56bf55=normalizeSqlForStaticAnalysis(_0x316fbd),_0x52f39e=(_0x56bf55[_0x355592(0x15a)]?[]:extractJoinFacts(_0x56bf55['sql']))[_0x355592(0x139)](_0x2db1e8=>{const _0x365c0c=_0x355592;if(_0x2db1e8[_0x365c0c(0x123)]||_0x2db1e8[_0x365c0c(0x11c)][_0x365c0c(0x143)]===0x0)return _0x872873['push']({'code':_0x365c0c(0x14a),'table':_0x2db1e8[_0x365c0c(0x148)],'alias':_0x2db1e8[_0x365c0c(0x11f)],'columns':_0x2db1e8[_0x365c0c(0x11c)],'reason':_0x2db1e8[_0x365c0c(0x14c)]??_0x365c0c(0x153)}),{'table':_0x2db1e8[_0x365c0c(0x148)],'alias':_0x2db1e8[_0x365c0c(0x11f)],'columns':_0x2db1e8[_0x365c0c(0x11c)],'status':_0x365c0c(0x157)};const _0x3bf8fe=resolveTableMetadata(_0x52eaa5,_0x2db1e8[_0x365c0c(0x148)]),_0x3af0dd=(_0x3bf8fe?.[_0x365c0c(0x119)]??[])[_0x365c0c(0x139)](_0x350f20=>({'index':_0x350f20,'matchedPrefix':findEqualityPrefix(_0x350f20[_0x365c0c(0x11c)],_0x2db1e8[_0x365c0c(0x11c)])}))[_0x365c0c(0x161)](_0x2dae40=>_0x2dae40['matchedPrefix'][_0x365c0c(0x143)]>0x0),_0x2e3877=_0x3af0dd['reduce']((_0x762cca,_0x3454e3)=>!_0x762cca||_0x3454e3['matchedPrefix'][_0x365c0c(0x143)]>_0x762cca[_0x365c0c(0x150)][_0x365c0c(0x143)]?_0x3454e3:_0x762cca,_0x3af0dd[0x0]);if(_0x2e3877)return{'table':_0x2db1e8[_0x365c0c(0x148)],'alias':_0x2db1e8[_0x365c0c(0x11f)],'columns':_0x2db1e8[_0x365c0c(0x11c)],'status':_0x365c0c(0x15f),'matchedIndex':{..._0x2e3877[_0x365c0c(0x162)],'matchedPrefix':_0x2e3877[_0x365c0c(0x150)]}};const _0x3a8a47=_0x3bf8fe?.[_0x365c0c(0x119)][_0x365c0c(0x161)](_0x583257=>_0x583257[_0x365c0c(0x11c)][_0x365c0c(0x13d)](_0x94a098=>_0x2db1e8[_0x365c0c(0x11c)][_0x365c0c(0x13d)](_0x528a76=>columnNamesMatch(_0x94a098,_0x528a76))))??[];if(_0x3a8a47['length']>0x0)return _0x872873[_0x365c0c(0x15b)]({'code':_0x365c0c(0x130),'table':_0x2db1e8['table'],'alias':_0x2db1e8['alias'],'columns':_0x2db1e8[_0x365c0c(0x11c)],'reason':'Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.'}),{'table':_0x2db1e8[_0x365c0c(0x148)],'alias':_0x2db1e8[_0x365c0c(0x11f)],'columns':_0x2db1e8[_0x365c0c(0x11c)],'status':_0x365c0c(0x134),'candidateIndexes':_0x3a8a47};if(_0x3bf8fe&&_0x3bf8fe[_0x365c0c(0x115)]!==![]&&_0x3bf8fe[_0x365c0c(0x119)][_0x365c0c(0x143)]>0x0&&_0x2db1e8[_0x365c0c(0x11c)][_0x365c0c(0x143)]>0x0)return _0x872873[_0x365c0c(0x15b)]({'code':_0x365c0c(0x138),'table':_0x2db1e8[_0x365c0c(0x148)],'alias':_0x2db1e8[_0x365c0c(0x11f)],'columns':_0x2db1e8[_0x365c0c(0x11c)],'reason':_0x365c0c(0x135)}),{'table':_0x2db1e8[_0x365c0c(0x148)],'alias':_0x2db1e8[_0x365c0c(0x11f)],'columns':_0x2db1e8[_0x365c0c(0x11c)],'status':'warning'};return _0x872873[_0x365c0c(0x15b)]({'code':_0x365c0c(0x14e),'table':_0x2db1e8[_0x365c0c(0x148)],'alias':_0x2db1e8[_0x365c0c(0x11f)],'columns':_0x2db1e8['columns'],'reason':_0x3bf8fe?_0x365c0c(0x11b):'No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.'}),{'table':_0x2db1e8[_0x365c0c(0x148)],'alias':_0x2db1e8[_0x365c0c(0x11f)],'columns':_0x2db1e8[_0x365c0c(0x11c)],'status':_0x365c0c(0x157)};});return{'checked':_0x52f39e[_0x355592(0x143)]>0x0,'joins':_0x52f39e,'warnings':_0x872873};}function extractJoinFacts(_0x1ea684){const _0x3aef84=a289_0x3f4f,_0x5071d0=maskNestedQueries(stripSqlNoise(_0x1ea684)),_0x4a6327=maskQuotedIdentifiers(_0x5071d0),_0x1f06cb=[],_0x5baf47=new Set(),_0x4871fa=/\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 _0x25c131 of _0x5071d0[_0x3aef84(0x125)](_0x4871fa)){const _0x57b169=_0x25c131[_0x3aef84(0x162)]??0x0,_0x18731a=_0x25c131[0x0][_0x3aef84(0x131)](/\bJOIN\b/i),_0x195dc5=_0x57b169+Math[_0x3aef84(0x133)](0x0,_0x18731a);if(!/^JOIN\b/i[_0x3aef84(0x132)](_0x4a6327['slice'](_0x195dc5)))continue;_0x5baf47[_0x3aef84(0x11a)](_0x195dc5);const _0x23dc56=normalizeIdentifier(_0x25c131[0x1]||_0x3aef84(0x12e)),_0x3e5411=normalizeIdentifier(_0x25c131[0x2]??''),_0x23f799=normalizeIdentifier(_0x25c131[0x3]||_0x3e5411[_0x3aef84(0x11d)]('.')['at'](-0x1)||_0x3e5411),_0x76438d=[],_0x301bb9=_0x3e5411==='__sq__';let _0x4089a5=_0x23dc56===_0x3aef84(0x129)||_0x23dc56==='full'||_0x301bb9,_0x3bc67f=_0x4089a5?_0x301bb9?_0x3aef84(0x149):_0x23dc56[_0x3aef84(0x114)]()+_0x3aef84(0x145):undefined;const _0x57facf=stripOuterParentheses(_0x25c131[0x4]??''),_0x35ae14=_0x57facf['includes'](MYBATIS_DYNAMIC_START_MARKER)||_0x57facf[_0x3aef84(0x12a)](MYBATIS_DYNAMIC_END_MARKER),_0x5d439e=_0x57facf[_0x3aef84(0x12a)](MYBATIS_INCLUDE_MARKER);_0x35ae14&&(_0x4089a5=!![],_0x3bc67f??=_0x3aef84(0x122));_0x5d439e&&(_0x4089a5=!![],_0x3bc67f??=_0x3aef84(0x15c));const _0x577917=_0x57facf['replaceAll'](MYBATIS_DYNAMIC_START_MARKER,'\x20')['replaceAll'](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x3aef84(0x136)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x577917,'OR')&&(_0x4089a5=!![],_0x3bc67f??=_0x3aef84(0x154));for(const _0x206129 of splitTopLevelAnd(_0x577917)){const _0x1c175a=stripOuterParentheses(_0x206129);if(hasTopLevelKeyword(_0x1c175a,'OR')){_0x4089a5=!![],_0x3bc67f??=_0x3aef84(0x154);continue;}const _0x4d1fe6=splitEquality(_0x1c175a);if(!_0x4d1fe6){containsColumnReference(_0x206129,_0x23f799)&&(_0x4089a5=!![]);continue;}const _0x52a50f=parseDirectColumnReference(_0x4d1fe6[0x0],_0x23f799),_0x35d265=parseDirectColumnReference(_0x4d1fe6[0x1],_0x23f799),_0x195d9f=containsColumnReference(_0x4d1fe6[0x0],_0x23f799),_0x4b6e54=containsColumnReference(_0x4d1fe6[0x1],_0x23f799),_0x922e68=_0x52a50f&&!_0x4b6e54?_0x52a50f:_0x35d265&&!_0x195d9f?_0x35d265:null;if(_0x922e68&&!_0x76438d[_0x3aef84(0x12a)](_0x922e68))_0x76438d[_0x3aef84(0x15b)](_0x922e68);else!_0x922e68&&containsColumnReference(_0x206129,_0x23f799)&&(_0x4089a5=!![]);}_0x1f06cb[_0x3aef84(0x15b)]({'table':_0x3e5411,'alias':_0x23f799,'columns':_0x76438d,'unsupportedPredicate':_0x4089a5,'unsupportedReason':_0x3bc67f,'containsUnresolvedInclude':_0x5d439e,'position':_0x195dc5});}for(const _0x2d1e62 of _0x4a6327[_0x3aef84(0x125)](/\bJOIN\b/gi)){const _0xeb9bd1=_0x2d1e62[_0x3aef84(0x162)]??0x0;if(_0x5baf47[_0x3aef84(0x15e)](_0xeb9bd1))continue;const _0x2d39d5=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x3aef84(0x11e)](_0x5071d0[_0x3aef84(0x12f)](_0xeb9bd1+_0x2d1e62[0x0]['length'])),_0x1254c3=normalizeIdentifier(_0x2d39d5?.[0x1]||_0x3aef84(0x126)),_0x291583=normalizeIdentifier(_0x2d39d5?.[0x2]||''),_0x476823=isSqlClauseKeyword(_0x291583)?_0x1254c3[_0x3aef84(0x11d)]('.')['at'](-0x1)||_0x1254c3:_0x291583||_0x1254c3[_0x3aef84(0x11d)]('.')['at'](-0x1)||_0x1254c3;_0x1f06cb[_0x3aef84(0x15b)]({'table':_0x1254c3,'alias':_0x476823,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x3aef84(0x147),'position':_0xeb9bd1});}const _0xc48805=_0x4a6327[_0x3aef84(0x14b)](MYBATIS_INCLUDE_MARKER);return _0xc48805>=0x0&&!_0x1f06cb['some'](_0x34252a=>_0x34252a[_0x3aef84(0x144)])&&_0x1f06cb['push']({'table':'unknown','alias':'unknown','columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x3aef84(0x15d),'containsUnresolvedInclude':!![],'position':_0xc48805}),_0x1f06cb[_0x3aef84(0x124)]((_0x2b075a,_0x4afd7b)=>_0x2b075a[_0x3aef84(0x13a)]-_0x4afd7b['position']);}function stripSqlNoise(_0x1ff871){const _0x44885a=a289_0x3f4f,_0x1b2813=Array[_0x44885a(0x121)](_0x1ff871),_0x1cf43e=(_0x36dab7,_0x374376)=>{for(let _0x1b0a2a=_0x36dab7;_0x1b0a2a<_0x374376;_0x1b0a2a+=0x1){_0x1b2813[_0x1b0a2a]!=='\x0a'&&_0x1b2813[_0x1b0a2a]!=='\x0d'&&(_0x1b2813[_0x1b0a2a]='\x20');}};for(let _0x4c7ab1=0x0;_0x4c7ab1<_0x1b2813['length'];_0x4c7ab1+=0x1){const _0x3d75c5=_0x1b2813[_0x4c7ab1],_0x47383c=_0x1b2813[_0x4c7ab1+0x1];if(_0x3d75c5==='\x27'||_0x3d75c5==='\x22'||_0x3d75c5==='`'){const _0x21b39e=_0x3d75c5,_0x2815dc=_0x4c7ab1;_0x4c7ab1+=0x1;while(_0x4c7ab1<_0x1b2813['length']){if(_0x1b2813[_0x4c7ab1]==='\x5c'&&_0x4c7ab1+0x1<_0x1b2813[_0x44885a(0x143)]){_0x4c7ab1+=0x2;continue;}if(_0x1b2813[_0x4c7ab1]!==_0x21b39e){_0x4c7ab1+=0x1;continue;}if(_0x1b2813[_0x4c7ab1+0x1]===_0x21b39e){_0x4c7ab1+=0x2;continue;}break;}if(_0x21b39e==='\x27')_0x1cf43e(_0x2815dc,Math[_0x44885a(0x137)](_0x4c7ab1+0x1,_0x1b2813[_0x44885a(0x143)]));continue;}if(_0x3d75c5==='-'&&_0x47383c==='-'){const _0x32fbeb=_0x4c7ab1;while(_0x4c7ab1<_0x1b2813[_0x44885a(0x143)]&&_0x1b2813[_0x4c7ab1]!=='\x0a')_0x4c7ab1+=0x1;_0x1cf43e(_0x32fbeb,_0x4c7ab1);continue;}if(_0x3d75c5==='/'&&_0x47383c==='*'){const _0x323430=_0x4c7ab1;_0x4c7ab1+=0x2;while(_0x4c7ab1<_0x1b2813['length']&&!(_0x1b2813[_0x4c7ab1]==='*'&&_0x1b2813[_0x4c7ab1+0x1]==='/')){_0x4c7ab1+=0x1;}_0x4c7ab1=Math['min'](_0x4c7ab1+0x1,_0x1b2813[_0x44885a(0x143)]-0x1),_0x1cf43e(_0x323430,_0x4c7ab1+0x1);continue;}if(_0x3d75c5==='#'&&_0x47383c!=='{'){const _0x1be1c5=_0x4c7ab1;while(_0x4c7ab1<_0x1b2813['length']&&_0x1b2813[_0x4c7ab1]!=='\x0a')_0x4c7ab1+=0x1;_0x1cf43e(_0x1be1c5,_0x4c7ab1);continue;}if((_0x3d75c5==='#'||_0x3d75c5==='$')&&_0x47383c==='{'){const _0x46ec8a=_0x4c7ab1;_0x4c7ab1+=0x2;while(_0x4c7ab1<_0x1b2813[_0x44885a(0x143)]&&_0x1b2813[_0x4c7ab1]!=='}')_0x4c7ab1+=0x1;_0x1cf43e(_0x46ec8a,Math[_0x44885a(0x137)](_0x4c7ab1+0x1,_0x1b2813[_0x44885a(0x143)]));}}return _0x1b2813[_0x44885a(0x120)]('');}function maskQuotedIdentifiers(_0x958663){const _0xf1e1b9=a289_0x3f4f,_0x5d9ab7=Array[_0xf1e1b9(0x121)](_0x958663);for(let _0x266ecf=0x0;_0x266ecf<_0x5d9ab7[_0xf1e1b9(0x143)];_0x266ecf+=0x1){const _0x56a621=_0x5d9ab7[_0x266ecf];if(_0x56a621!=='\x22'&&_0x56a621!=='`')continue;_0x266ecf+=0x1;while(_0x266ecf<_0x5d9ab7[_0xf1e1b9(0x143)]){if(_0x5d9ab7[_0x266ecf]===_0x56a621){if(_0x5d9ab7[_0x266ecf+0x1]===_0x56a621){_0x5d9ab7[_0x266ecf]='\x20',_0x5d9ab7[_0x266ecf+0x1]='\x20',_0x266ecf+=0x2;continue;}break;}_0x5d9ab7[_0x266ecf]='\x20',_0x266ecf+=0x1;}}return _0x5d9ab7[_0xf1e1b9(0x120)]('');}function maskNestedQueries(_0x28b34e){const _0xd44a27=a289_0x3f4f,_0x14dbbd=Array[_0xd44a27(0x121)](_0x28b34e);for(let _0x4e36c9=0x0;_0x4e36c9<_0x14dbbd['length'];_0x4e36c9+=0x1){if(_0x14dbbd[_0x4e36c9]!=='(')continue;const _0x4524b9=_0x28b34e[_0xd44a27(0x12f)](_0x4e36c9+0x1);if(!/^\s*(?:SELECT|WITH)\b/i['test'](_0x4524b9))continue;let _0x3bc5be=0x1,_0x46755e=_0x4e36c9+0x1;for(;_0x46755e<_0x14dbbd[_0xd44a27(0x143)]&&_0x3bc5be>0x0;_0x46755e+=0x1){if(_0x14dbbd[_0x46755e]==='(')_0x3bc5be+=0x1;if(_0x14dbbd[_0x46755e]===')')_0x3bc5be-=0x1;}if(_0x3bc5be!==0x0)continue;for(let _0x3b5346=_0x4e36c9;_0x3b5346<_0x46755e;_0x3b5346+=0x1){_0x14dbbd[_0x3b5346]='\x20';}const _0x107c7f=_0xd44a27(0x146);for(let _0x58ccbd=0x0;_0x58ccbd<_0x107c7f[_0xd44a27(0x143)]&&_0x4e36c9+_0x58ccbd<_0x46755e;_0x58ccbd+=0x1){_0x14dbbd[_0x4e36c9+_0x58ccbd]=_0x107c7f[_0x58ccbd];}_0x4e36c9=_0x46755e-0x1;}return _0x14dbbd[_0xd44a27(0x120)]('');}function splitTopLevelAnd(_0x12a14d){const _0x728456=a289_0x3f4f,_0x23e807=[];let _0x4bd1f2=0x0,_0x41f34e=0x0;for(let _0x3e3e78=0x0;_0x3e3e78<_0x12a14d[_0x728456(0x143)];_0x3e3e78+=0x1){const _0x5824f4=_0x12a14d[_0x3e3e78];if(_0x5824f4==='(')_0x4bd1f2+=0x1;if(_0x5824f4===')')_0x4bd1f2=Math[_0x728456(0x133)](0x0,_0x4bd1f2-0x1);_0x4bd1f2===0x0&&_0x12a14d[_0x728456(0x12f)](_0x3e3e78)['match'](/^AND\b/i)&&(_0x3e3e78===0x0||/\s/[_0x728456(0x132)](_0x12a14d[_0x3e3e78-0x1]??''))&&(_0x23e807[_0x728456(0x15b)](_0x12a14d[_0x728456(0x12f)](_0x41f34e,_0x3e3e78)[_0x728456(0x13c)]()),_0x3e3e78+=0x2,_0x41f34e=_0x3e3e78+0x1);}const _0x40832b=_0x12a14d[_0x728456(0x12f)](_0x41f34e)[_0x728456(0x13c)]();if(_0x40832b)_0x23e807[_0x728456(0x15b)](_0x40832b);return _0x23e807;}function hasTopLevelKeyword(_0x3786a7,_0x5e7329){const _0x25fab7=a289_0x3f4f;let _0x19baf7=0x0;for(let _0x1144c7=0x0;_0x1144c7<_0x3786a7[_0x25fab7(0x143)];_0x1144c7+=0x1){const _0x17b67b=_0x3786a7[_0x1144c7];if(_0x17b67b==='(')_0x19baf7+=0x1;if(_0x17b67b===')')_0x19baf7=Math['max'](0x0,_0x19baf7-0x1);if(_0x19baf7!==0x0)continue;const _0x4fde68=_0x3786a7[_0x25fab7(0x12f)](_0x1144c7,_0x1144c7+_0x5e7329[_0x25fab7(0x143)]),_0x195c17=_0x3786a7[_0x1144c7-0x1]??'\x20',_0xfbe358=_0x3786a7[_0x1144c7+_0x5e7329[_0x25fab7(0x143)]]??'\x20';if(_0x4fde68[_0x25fab7(0x114)]()===_0x5e7329[_0x25fab7(0x114)]()&&!/[\w$]/[_0x25fab7(0x132)](_0x195c17)&&!/[\w$]/[_0x25fab7(0x132)](_0xfbe358))return!![];}return![];}function splitEquality(_0x24e57a){const _0x55af1b=a289_0x3f4f,_0x3f830c=stripOuterParentheses(_0x24e57a);let _0xf61ca7=0x0,_0x28a11f;for(let _0x354089=0x0;_0x354089<_0x3f830c[_0x55af1b(0x143)];_0x354089+=0x1){const _0x38be71=_0x3f830c[_0x354089];if(_0x38be71==='(')_0xf61ca7+=0x1;if(_0x38be71===')')_0xf61ca7=Math[_0x55af1b(0x133)](0x0,_0xf61ca7-0x1);const _0x4c27bd=_0x3f830c[_0x354089-0x1]??'',_0x3614b1=_0x3f830c[_0x354089+0x1]??'';if(_0x38be71==='='&&_0xf61ca7===0x0&&!/[!<>=:]/[_0x55af1b(0x132)](_0x4c27bd)&&_0x3614b1!=='='){if(_0x28a11f!==undefined)return null;_0x28a11f=_0x354089;}}return _0x28a11f===undefined?null:[_0x3f830c[_0x55af1b(0x12f)](0x0,_0x28a11f)[_0x55af1b(0x13c)](),_0x3f830c[_0x55af1b(0x12f)](_0x28a11f+0x1)['trim']()];}function parseDirectColumnReference(_0x593e9e,_0x2d1e02){const _0xe789bb=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/['exec'](stripOuterParentheses(_0x593e9e));if(!_0xe789bb)return null;if(normalizeIdentifier(_0xe789bb[0x1]??'')!==normalizeIdentifier(_0x2d1e02))return null;return normalizeIdentifier(_0xe789bb[0x2]??'');}function a289_0x466c(){const _0x404a0c=['unknown','28nTBrmK','where','right','includes','full','159IadPEg','166966DMmGQb','INNER','slice','JOIN_INDEX_NOT_USABLE','search','test','max','warning','No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.','replaceAll','min','JOIN_INDEX_MISSING','map','position','256616wlIKct','trim','some','startsWith','toLowerCase','1632iyuUrh','153JUFBpj','using','length','containsUnresolvedInclude','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','__sq__','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','table','Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.','JOIN_PREDICATE_UNSUPPORTED','indexOf','unsupportedReason','13690SUzwUj','INDEX_METADATA_UNAVAILABLE','tableName','matchedPrefix','416192WvruFY','cross','Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','replace','4556jrVZNd','unavailable','left','natural','error','push','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','has','covered','(?:^|[^\x5cw$])','filter','index','5440EXkXHR','3409604hVOfxz','toUpperCase','metadataAvailable','inner','\x5c$&','\x5cs*\x5c.\x5cs*[\x5cw$]+','indexes','add','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','columns','split','exec','alias','join','from','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','unsupportedPredicate','sort','matchAll'];a289_0x466c=function(){return _0x404a0c;};return a289_0x466c();}function containsColumnReference(_0x9856e1,_0x198948){const _0x3164e4=a289_0x3f4f,_0x3e8405=_0x9856e1[_0x3164e4(0x155)](/[`"]/g,''),_0x732452=_0x198948[_0x3164e4(0x155)](/[.*+?^${}()|[\]\\]/g,_0x3164e4(0x117));return new RegExp(_0x3164e4(0x160)+_0x732452+_0x3164e4(0x118),'i')['test'](_0x3e8405);}function findEqualityPrefix(_0x13704b,_0x1d63a7){const _0x21baae=a289_0x3f4f,_0x2ac68d=new Set(_0x1d63a7[_0x21baae(0x139)](normalizeIdentifier)),_0x3f65a2=[];for(const _0x37b24e of _0x13704b){if(!_0x2ac68d[_0x21baae(0x15e)](normalizeIdentifier(_0x37b24e)))break;_0x3f65a2[_0x21baae(0x15b)](_0x37b24e);}return _0x3f65a2;}function resolveTableMetadata(_0xf74f5e,_0x4c6aef){const _0x42a752=a289_0x3f4f,_0xe4bfb8=normalizeIdentifier(_0x4c6aef),_0x2c0b0a=_0xf74f5e[_0x42a752(0x161)](_0x1b5baa=>normalizeIdentifier(_0x1b5baa[_0x42a752(0x14f)])===_0xe4bfb8);if(_0x2c0b0a[_0x42a752(0x143)]===0x1)return _0x2c0b0a[0x0];const _0x522a91=_0xe4bfb8[_0x42a752(0x12a)]('.'),_0x1b5cce=_0xe4bfb8[_0x42a752(0x11d)]('.')['at'](-0x1),_0x268c08=_0xf74f5e[_0x42a752(0x161)](_0x3c57f2=>{const _0x4af0c4=_0x42a752,_0xf98c1c=normalizeIdentifier(_0x3c57f2[_0x4af0c4(0x14f)]);if(_0x522a91&&_0xf98c1c[_0x4af0c4(0x12a)]('.'))return![];return _0xf98c1c['split']('.')['at'](-0x1)===_0x1b5cce;});return _0x268c08[_0x42a752(0x143)]===0x1?_0x268c08[0x0]:undefined;}function columnNamesMatch(_0x272b89,_0x3a57d9){return normalizeIdentifier(_0x272b89)===normalizeIdentifier(_0x3a57d9);}function normalizeIdentifier(_0x54d130){const _0x41e884=a289_0x3f4f;return _0x54d130[_0x41e884(0x155)](/[`"]/g,'')[_0x41e884(0x13c)]()[_0x41e884(0x13f)]();}function isSqlClauseKeyword(_0x379021){const _0x21e559=a289_0x3f4f;return new Set(['on',_0x21e559(0x142),_0x21e559(0x128),_0x21e559(0x120),_0x21e559(0x116),_0x21e559(0x158),'right',_0x21e559(0x12b),_0x21e559(0x152),_0x21e559(0x159)])[_0x21e559(0x15e)](_0x379021);}function a289_0x3f4f(_0x231681,_0x5264d4){_0x231681=_0x231681-0x114;const _0x466cf8=a289_0x466c();let _0x3f4faf=_0x466cf8[_0x231681];return _0x3f4faf;}function stripOuterParentheses(_0x5b379d){const _0x16f7c4=a289_0x3f4f;let _0x100bd8=_0x5b379d[_0x16f7c4(0x13c)]();while(_0x100bd8[_0x16f7c4(0x13e)]('(')&&_0x100bd8['endsWith'](')')){let _0x1a8378=0x0,_0x54a536=!![];for(let _0x47a840=0x0;_0x47a840<_0x100bd8['length'];_0x47a840+=0x1){if(_0x100bd8[_0x47a840]==='(')_0x1a8378+=0x1;if(_0x100bd8[_0x47a840]===')')_0x1a8378-=0x1;if(_0x1a8378===0x0&&_0x47a840<_0x100bd8[_0x16f7c4(0x143)]-0x1){_0x54a536=![];break;}}if(!_0x54a536||_0x1a8378!==0x0)break;_0x100bd8=_0x100bd8['slice'](0x1,-0x1)[_0x16f7c4(0x13c)]();}return _0x100bd8;}
1
+ (function(_0x3aa4a8,_0x396a63){const _0x40abbd=a289_0x4a96,_0x13facb=_0x3aa4a8();while(!![]){try{const _0xc5a451=-parseInt(_0x40abbd(0x17b))/0x1+parseInt(_0x40abbd(0x17a))/0x2*(-parseInt(_0x40abbd(0x14e))/0x3)+parseInt(_0x40abbd(0x15a))/0x4*(parseInt(_0x40abbd(0x15c))/0x5)+-parseInt(_0x40abbd(0x179))/0x6*(parseInt(_0x40abbd(0x165))/0x7)+-parseInt(_0x40abbd(0x150))/0x8*(-parseInt(_0x40abbd(0x169))/0x9)+-parseInt(_0x40abbd(0x178))/0xa*(parseInt(_0x40abbd(0x156))/0xb)+parseInt(_0x40abbd(0x15e))/0xc;if(_0xc5a451===_0x396a63)break;else _0x13facb['push'](_0x13facb['shift']());}catch(_0x4fcef0){_0x13facb['push'](_0x13facb['shift']());}}}(a289_0x5e06,0x1a218));import{MYBATIS_DYNAMIC_END_MARKER,MYBATIS_DYNAMIC_START_MARKER,MYBATIS_INCLUDE_MARKER,normalizeSqlForStaticAnalysis}from'./sql-validator.js';export function auditSqlJoinIndexes(_0x475740,_0xeb67c1){const _0x46ef55=a289_0x4a96,_0x27f709=[],_0x51f340=normalizeSqlForStaticAnalysis(_0x475740),_0x140f83=(_0x51f340[_0x46ef55(0x14a)]?[]:extractJoinFacts(_0x51f340[_0x46ef55(0x16f)]))[_0x46ef55(0x15f)](_0x4a4e26=>{const _0x175b2b=_0x46ef55;if(_0x4a4e26['unsupportedPredicate']||_0x4a4e26['columns'][_0x175b2b(0x158)]===0x0)return _0x27f709[_0x175b2b(0x17c)]({'code':_0x175b2b(0x15b),'table':_0x4a4e26[_0x175b2b(0x17d)],'alias':_0x4a4e26[_0x175b2b(0x177)],'columns':_0x4a4e26['columns'],'reason':_0x4a4e26[_0x175b2b(0x16c)]??'Not\x20every\x20JOIN\x20target\x20predicate\x20could\x20be\x20audited\x20safely.'}),{'table':_0x4a4e26[_0x175b2b(0x17d)],'alias':_0x4a4e26[_0x175b2b(0x177)],'columns':_0x4a4e26[_0x175b2b(0x147)],'status':_0x175b2b(0x13c)};const _0x17431a=resolveTableMetadata(_0xeb67c1,_0x4a4e26[_0x175b2b(0x17d)]),_0xf8ebc8=(_0x17431a?.[_0x175b2b(0x164)]??[])[_0x175b2b(0x15f)](_0x4ef24e=>({'index':_0x4ef24e,'matchedPrefix':findEqualityPrefix(_0x4ef24e[_0x175b2b(0x147)],_0x4a4e26[_0x175b2b(0x147)])}))[_0x175b2b(0x182)](_0x531b0a=>_0x531b0a[_0x175b2b(0x159)]['length']>0x0),_0x3b6af5=_0xf8ebc8[_0x175b2b(0x17f)]((_0x14c4a6,_0x81b398)=>!_0x14c4a6||_0x81b398['matchedPrefix']['length']>_0x14c4a6['matchedPrefix'][_0x175b2b(0x158)]?_0x81b398:_0x14c4a6,_0xf8ebc8[0x0]);if(_0x3b6af5)return{'table':_0x4a4e26[_0x175b2b(0x17d)],'alias':_0x4a4e26['alias'],'columns':_0x4a4e26[_0x175b2b(0x147)],'status':_0x175b2b(0x167),'matchedIndex':{..._0x3b6af5[_0x175b2b(0x13a)],'matchedPrefix':_0x3b6af5[_0x175b2b(0x159)]}};const _0xb6d72a=_0x17431a?.[_0x175b2b(0x164)]['filter'](_0x5d1f1e=>_0x5d1f1e[_0x175b2b(0x147)][_0x175b2b(0x13b)](_0x7d17fa=>_0x4a4e26[_0x175b2b(0x147)][_0x175b2b(0x13b)](_0x4eaee5=>columnNamesMatch(_0x7d17fa,_0x4eaee5))))??[];if(_0xb6d72a[_0x175b2b(0x158)]>0x0)return _0x27f709[_0x175b2b(0x17c)]({'code':_0x175b2b(0x163),'table':_0x4a4e26[_0x175b2b(0x17d)],'alias':_0x4a4e26['alias'],'columns':_0x4a4e26[_0x175b2b(0x147)],'reason':_0x175b2b(0x16b)}),{'table':_0x4a4e26['table'],'alias':_0x4a4e26[_0x175b2b(0x177)],'columns':_0x4a4e26[_0x175b2b(0x147)],'status':'warning','candidateIndexes':_0xb6d72a};if(_0x17431a&&_0x17431a['metadataAvailable']!==![]&&_0x17431a[_0x175b2b(0x164)][_0x175b2b(0x158)]>0x0&&_0x4a4e26[_0x175b2b(0x147)][_0x175b2b(0x158)]>0x0)return _0x27f709[_0x175b2b(0x17c)]({'code':_0x175b2b(0x17e),'table':_0x4a4e26['table'],'alias':_0x4a4e26[_0x175b2b(0x177)],'columns':_0x4a4e26[_0x175b2b(0x147)],'reason':'No\x20reported\x20index\x20contains\x20the\x20JOIN\x20access\x20columns.'}),{'table':_0x4a4e26['table'],'alias':_0x4a4e26['alias'],'columns':_0x4a4e26['columns'],'status':'warning'};return _0x27f709[_0x175b2b(0x17c)]({'code':_0x175b2b(0x140),'table':_0x4a4e26[_0x175b2b(0x17d)],'alias':_0x4a4e26[_0x175b2b(0x177)],'columns':_0x4a4e26[_0x175b2b(0x147)],'reason':_0x17431a?_0x175b2b(0x180):'No\x20dataset\x20metadata\x20matched\x20the\x20JOIN\x20table.'}),{'table':_0x4a4e26['table'],'alias':_0x4a4e26['alias'],'columns':_0x4a4e26[_0x175b2b(0x147)],'status':_0x175b2b(0x13c)};});return{'checked':_0x140f83[_0x46ef55(0x158)]>0x0,'joins':_0x140f83,'warnings':_0x27f709};}function extractJoinFacts(_0x34411b){const _0x1c4c40=a289_0x4a96,_0xd5df95=maskNestedQueries(stripSqlNoise(_0x34411b)),_0x463718=maskQuotedIdentifiers(_0xd5df95),_0xe4bb18=[],_0x388925=new Set(),_0x5146fd=/\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 _0x5d4a71 of _0xd5df95[_0x1c4c40(0x16d)](_0x5146fd)){const _0x14ae02=_0x5d4a71[_0x1c4c40(0x13a)]??0x0,_0x2957bc=_0x5d4a71[0x0][_0x1c4c40(0x152)](/\bJOIN\b/i),_0x50adf1=_0x14ae02+Math[_0x1c4c40(0x161)](0x0,_0x2957bc);if(!/^JOIN\b/i[_0x1c4c40(0x14b)](_0x463718[_0x1c4c40(0x149)](_0x50adf1)))continue;_0x388925['add'](_0x50adf1);const _0x5531cf=normalizeIdentifier(_0x5d4a71[0x1]||_0x1c4c40(0x154)),_0x227703=normalizeIdentifier(_0x5d4a71[0x2]??''),_0xf680b=normalizeIdentifier(_0x5d4a71[0x3]||_0x227703[_0x1c4c40(0x176)]('.')['at'](-0x1)||_0x227703),_0x3ed991=[],_0x1c24e0=_0x227703==='__sq__';let _0x5b02fd=_0x5531cf===_0x1c4c40(0x16e)||_0x5531cf===_0x1c4c40(0x181)||_0x1c24e0,_0x3ff563=_0x5b02fd?_0x1c24e0?'Derived-table\x20JOIN\x20targets\x20are\x20not\x20supported.':_0x5531cf[_0x1c4c40(0x13d)]()+_0x1c4c40(0x142):undefined;const _0x48198d=stripOuterParentheses(_0x5d4a71[0x4]??''),_0x4f8241=_0x48198d[_0x1c4c40(0x175)](MYBATIS_DYNAMIC_START_MARKER)||_0x48198d['includes'](MYBATIS_DYNAMIC_END_MARKER),_0x3e943b=_0x48198d['includes'](MYBATIS_INCLUDE_MARKER);_0x4f8241&&(_0x5b02fd=!![],_0x3ff563??=_0x1c4c40(0x146));_0x3e943b&&(_0x5b02fd=!![],_0x3ff563??=_0x1c4c40(0x153));const _0x204f38=_0x48198d[_0x1c4c40(0x141)](MYBATIS_DYNAMIC_START_MARKER,'\x20')[_0x1c4c40(0x141)](MYBATIS_DYNAMIC_END_MARKER,'\x20')[_0x1c4c40(0x141)](MYBATIS_INCLUDE_MARKER,'\x20');hasTopLevelKeyword(_0x204f38,'OR')&&(_0x5b02fd=!![],_0x3ff563??=_0x1c4c40(0x14c));for(const _0xcaf9d3 of splitTopLevelAnd(_0x204f38)){const _0x4391c7=stripOuterParentheses(_0xcaf9d3);if(hasTopLevelKeyword(_0x4391c7,'OR')){_0x5b02fd=!![],_0x3ff563??=_0x1c4c40(0x14c);continue;}const _0x5132a6=splitEquality(_0x4391c7);if(!_0x5132a6){containsColumnReference(_0xcaf9d3,_0xf680b)&&(_0x5b02fd=!![]);continue;}const _0x212e73=parseDirectColumnReference(_0x5132a6[0x0],_0xf680b),_0x4b6e0b=parseDirectColumnReference(_0x5132a6[0x1],_0xf680b),_0x5a8021=containsColumnReference(_0x5132a6[0x0],_0xf680b),_0xf32bac=containsColumnReference(_0x5132a6[0x1],_0xf680b),_0x4e2ed1=_0x212e73&&!_0xf32bac?_0x212e73:_0x4b6e0b&&!_0x5a8021?_0x4b6e0b:null;if(_0x4e2ed1&&!_0x3ed991['includes'](_0x4e2ed1))_0x3ed991['push'](_0x4e2ed1);else!_0x4e2ed1&&containsColumnReference(_0xcaf9d3,_0xf680b)&&(_0x5b02fd=!![]);}_0xe4bb18[_0x1c4c40(0x17c)]({'table':_0x227703,'alias':_0xf680b,'columns':_0x3ed991,'unsupportedPredicate':_0x5b02fd,'unsupportedReason':_0x3ff563,'containsUnresolvedInclude':_0x3e943b,'position':_0x50adf1});}for(const _0x3550ed of _0x463718[_0x1c4c40(0x16d)](/\bJOIN\b/gi)){const _0xc5a4c7=_0x3550ed[_0x1c4c40(0x13a)]??0x0;if(_0x388925[_0x1c4c40(0x155)](_0xc5a4c7))continue;const _0x3ceb12=/^\s+([`"\w$.]+)(?:\s+(?:AS\s+)?([`"\w$]+))?/[_0x1c4c40(0x14d)](_0xd5df95[_0x1c4c40(0x149)](_0xc5a4c7+_0x3550ed[0x0][_0x1c4c40(0x158)])),_0x421294=normalizeIdentifier(_0x3ceb12?.[0x1]||_0x1c4c40(0x14f)),_0x4aa13a=normalizeIdentifier(_0x3ceb12?.[0x2]||''),_0x305757=isSqlClauseKeyword(_0x4aa13a)?_0x421294[_0x1c4c40(0x176)]('.')['at'](-0x1)||_0x421294:_0x4aa13a||_0x421294[_0x1c4c40(0x176)]('.')['at'](-0x1)||_0x421294;_0xe4bb18[_0x1c4c40(0x17c)]({'table':_0x421294,'alias':_0x305757,'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x1c4c40(0x148),'position':_0xc5a4c7});}const _0x21dd93=_0x463718[_0x1c4c40(0x162)](MYBATIS_INCLUDE_MARKER);return _0x21dd93>=0x0&&!_0xe4bb18[_0x1c4c40(0x13b)](_0x1d9695=>_0x1d9695['containsUnresolvedInclude'])&&_0xe4bb18['push']({'table':_0x1c4c40(0x14f),'alias':_0x1c4c40(0x14f),'columns':[],'unsupportedPredicate':!![],'unsupportedReason':_0x1c4c40(0x174),'containsUnresolvedInclude':!![],'position':_0x21dd93}),_0xe4bb18[_0x1c4c40(0x144)]((_0x322cd0,_0xf1ea79)=>_0x322cd0['position']-_0xf1ea79[_0x1c4c40(0x143)]);}function stripSqlNoise(_0xb553a2){const _0x505c68=a289_0x4a96,_0xafe797=Array[_0x505c68(0x157)](_0xb553a2),_0x2f0656=(_0x197918,_0x47d2fb)=>{for(let _0x2f83b7=_0x197918;_0x2f83b7<_0x47d2fb;_0x2f83b7+=0x1){_0xafe797[_0x2f83b7]!=='\x0a'&&_0xafe797[_0x2f83b7]!=='\x0d'&&(_0xafe797[_0x2f83b7]='\x20');}};for(let _0x2c1e66=0x0;_0x2c1e66<_0xafe797['length'];_0x2c1e66+=0x1){const _0x267f82=_0xafe797[_0x2c1e66],_0x9f219e=_0xafe797[_0x2c1e66+0x1];if(_0x267f82==='\x27'||_0x267f82==='\x22'||_0x267f82==='`'){const _0xf09dc1=_0x267f82,_0x13503d=_0x2c1e66;_0x2c1e66+=0x1;while(_0x2c1e66<_0xafe797[_0x505c68(0x158)]){if(_0xafe797[_0x2c1e66]==='\x5c'&&_0x2c1e66+0x1<_0xafe797[_0x505c68(0x158)]){_0x2c1e66+=0x2;continue;}if(_0xafe797[_0x2c1e66]!==_0xf09dc1){_0x2c1e66+=0x1;continue;}if(_0xafe797[_0x2c1e66+0x1]===_0xf09dc1){_0x2c1e66+=0x2;continue;}break;}if(_0xf09dc1==='\x27')_0x2f0656(_0x13503d,Math[_0x505c68(0x16a)](_0x2c1e66+0x1,_0xafe797[_0x505c68(0x158)]));continue;}if(_0x267f82==='-'&&_0x9f219e==='-'){const _0x3e72e5=_0x2c1e66;while(_0x2c1e66<_0xafe797[_0x505c68(0x158)]&&_0xafe797[_0x2c1e66]!=='\x0a')_0x2c1e66+=0x1;_0x2f0656(_0x3e72e5,_0x2c1e66);continue;}if(_0x267f82==='/'&&_0x9f219e==='*'){const _0x54a7eb=_0x2c1e66;_0x2c1e66+=0x2;while(_0x2c1e66<_0xafe797[_0x505c68(0x158)]&&!(_0xafe797[_0x2c1e66]==='*'&&_0xafe797[_0x2c1e66+0x1]==='/')){_0x2c1e66+=0x1;}_0x2c1e66=Math[_0x505c68(0x16a)](_0x2c1e66+0x1,_0xafe797[_0x505c68(0x158)]-0x1),_0x2f0656(_0x54a7eb,_0x2c1e66+0x1);continue;}if(_0x267f82==='#'&&_0x9f219e!=='{'){const _0x4d66d2=_0x2c1e66;while(_0x2c1e66<_0xafe797[_0x505c68(0x158)]&&_0xafe797[_0x2c1e66]!=='\x0a')_0x2c1e66+=0x1;_0x2f0656(_0x4d66d2,_0x2c1e66);continue;}if((_0x267f82==='#'||_0x267f82==='$')&&_0x9f219e==='{'){const _0x1520bb=_0x2c1e66;_0x2c1e66+=0x2;while(_0x2c1e66<_0xafe797[_0x505c68(0x158)]&&_0xafe797[_0x2c1e66]!=='}')_0x2c1e66+=0x1;_0x2f0656(_0x1520bb,Math[_0x505c68(0x16a)](_0x2c1e66+0x1,_0xafe797['length']));}}return _0xafe797[_0x505c68(0x139)]('');}function maskQuotedIdentifiers(_0x5ea5de){const _0xde52a7=a289_0x4a96,_0x393ad3=Array[_0xde52a7(0x157)](_0x5ea5de);for(let _0x27f1bf=0x0;_0x27f1bf<_0x393ad3[_0xde52a7(0x158)];_0x27f1bf+=0x1){const _0x32db7a=_0x393ad3[_0x27f1bf];if(_0x32db7a!=='\x22'&&_0x32db7a!=='`')continue;_0x27f1bf+=0x1;while(_0x27f1bf<_0x393ad3['length']){if(_0x393ad3[_0x27f1bf]===_0x32db7a){if(_0x393ad3[_0x27f1bf+0x1]===_0x32db7a){_0x393ad3[_0x27f1bf]='\x20',_0x393ad3[_0x27f1bf+0x1]='\x20',_0x27f1bf+=0x2;continue;}break;}_0x393ad3[_0x27f1bf]='\x20',_0x27f1bf+=0x1;}}return _0x393ad3[_0xde52a7(0x139)]('');}function a289_0x5e06(){const _0x1e1ca5=['unsupportedReason','matchAll','right','sql','startsWith','__sq__','\x5c$&','endsWith','MyBatis\x20<include>\x20fragments\x20cannot\x20be\x20expanded\x20for\x20JOIN\x20auditing.','includes','split','alias','230xIyoqX','44166BWyTdg','98XlxwXK','111113HpEZrO','push','table','JOIN_INDEX_MISSING','reduce','The\x20dataset\x20returned\x20no\x20distinguishable\x20index\x20metadata.','full','filter','toLowerCase','join','index','some','unavailable','toUpperCase','using','trim','INDEX_METADATA_UNAVAILABLE','replaceAll','\x20JOIN\x20direction\x20is\x20not\x20supported\x20by\x20static\x20index\x20auditing.','position','sort','left','MyBatis\x20dynamic\x20JOIN\x20predicates\x20cannot\x20be\x20audited\x20deterministically.','columns','Only\x20explicit\x20table\x20JOIN\x20clauses\x20with\x20an\x20ON\x20predicate\x20are\x20supported.','slice','error','test','OR-connected\x20JOIN\x20predicates\x20are\x20not\x20supported.','exec','93NffxFJ','unknown','8cJjTeq','replace','search','MyBatis\x20<include>\x20JOIN\x20fragments\x20cannot\x20be\x20expanded\x20statically.','INNER','has','49291pAsiPo','from','length','matchedPrefix','1752AWlyFQ','JOIN_PREDICATE_UNSUPPORTED','1135qorCTI','cross','2181636kgGSCr','map','natural','max','indexOf','JOIN_INDEX_NOT_USABLE','indexes','63uzWqNd','match','covered','tableName','969723ocBsCT','min','Relevant\x20columns\x20do\x20not\x20form\x20a\x20complete\x20leftmost\x20index\x20prefix.'];a289_0x5e06=function(){return _0x1e1ca5;};return a289_0x5e06();}function maskNestedQueries(_0x427b45){const _0x330ee0=a289_0x4a96,_0x5992fe=Array['from'](_0x427b45);for(let _0x134798=0x0;_0x134798<_0x5992fe[_0x330ee0(0x158)];_0x134798+=0x1){if(_0x5992fe[_0x134798]!=='(')continue;const _0x1af577=_0x427b45['slice'](_0x134798+0x1);if(!/^\s*(?:SELECT|WITH)\b/i[_0x330ee0(0x14b)](_0x1af577))continue;let _0x44250a=0x1,_0x116260=_0x134798+0x1;for(;_0x116260<_0x5992fe[_0x330ee0(0x158)]&&_0x44250a>0x0;_0x116260+=0x1){if(_0x5992fe[_0x116260]==='(')_0x44250a+=0x1;if(_0x5992fe[_0x116260]===')')_0x44250a-=0x1;}if(_0x44250a!==0x0)continue;for(let _0x2d44cc=_0x134798;_0x2d44cc<_0x116260;_0x2d44cc+=0x1){_0x5992fe[_0x2d44cc]='\x20';}const _0x2ae69f=_0x330ee0(0x171);for(let _0x564939=0x0;_0x564939<_0x2ae69f[_0x330ee0(0x158)]&&_0x134798+_0x564939<_0x116260;_0x564939+=0x1){_0x5992fe[_0x134798+_0x564939]=_0x2ae69f[_0x564939];}_0x134798=_0x116260-0x1;}return _0x5992fe[_0x330ee0(0x139)]('');}function a289_0x4a96(_0x2dd8dc,_0x32d27b){_0x2dd8dc=_0x2dd8dc-0x139;const _0x5e06c4=a289_0x5e06();let _0x4a96d6=_0x5e06c4[_0x2dd8dc];return _0x4a96d6;}function splitTopLevelAnd(_0x392a64){const _0x472eef=a289_0x4a96,_0x4e2996=[];let _0x41285d=0x0,_0x4171d4=0x0;for(let _0x47686f=0x0;_0x47686f<_0x392a64[_0x472eef(0x158)];_0x47686f+=0x1){const _0x41916a=_0x392a64[_0x47686f];if(_0x41916a==='(')_0x41285d+=0x1;if(_0x41916a===')')_0x41285d=Math[_0x472eef(0x161)](0x0,_0x41285d-0x1);_0x41285d===0x0&&_0x392a64[_0x472eef(0x149)](_0x47686f)[_0x472eef(0x166)](/^AND\b/i)&&(_0x47686f===0x0||/\s/['test'](_0x392a64[_0x47686f-0x1]??''))&&(_0x4e2996[_0x472eef(0x17c)](_0x392a64['slice'](_0x4171d4,_0x47686f)[_0x472eef(0x13f)]()),_0x47686f+=0x2,_0x4171d4=_0x47686f+0x1);}const _0x42ce14=_0x392a64[_0x472eef(0x149)](_0x4171d4)[_0x472eef(0x13f)]();if(_0x42ce14)_0x4e2996[_0x472eef(0x17c)](_0x42ce14);return _0x4e2996;}function hasTopLevelKeyword(_0x4fa334,_0x334dd5){const _0x199e66=a289_0x4a96;let _0x3d7592=0x0;for(let _0x24e08c=0x0;_0x24e08c<_0x4fa334[_0x199e66(0x158)];_0x24e08c+=0x1){const _0x2ff999=_0x4fa334[_0x24e08c];if(_0x2ff999==='(')_0x3d7592+=0x1;if(_0x2ff999===')')_0x3d7592=Math[_0x199e66(0x161)](0x0,_0x3d7592-0x1);if(_0x3d7592!==0x0)continue;const _0x5a3f39=_0x4fa334[_0x199e66(0x149)](_0x24e08c,_0x24e08c+_0x334dd5[_0x199e66(0x158)]),_0x437fc1=_0x4fa334[_0x24e08c-0x1]??'\x20',_0x5912b7=_0x4fa334[_0x24e08c+_0x334dd5[_0x199e66(0x158)]]??'\x20';if(_0x5a3f39[_0x199e66(0x13d)]()===_0x334dd5[_0x199e66(0x13d)]()&&!/[\w$]/[_0x199e66(0x14b)](_0x437fc1)&&!/[\w$]/[_0x199e66(0x14b)](_0x5912b7))return!![];}return![];}function splitEquality(_0x5e9b9d){const _0x8ecc7f=a289_0x4a96,_0x755d4e=stripOuterParentheses(_0x5e9b9d);let _0x3f4e32=0x0,_0x3f0193;for(let _0x30c53b=0x0;_0x30c53b<_0x755d4e['length'];_0x30c53b+=0x1){const _0x48e87b=_0x755d4e[_0x30c53b];if(_0x48e87b==='(')_0x3f4e32+=0x1;if(_0x48e87b===')')_0x3f4e32=Math[_0x8ecc7f(0x161)](0x0,_0x3f4e32-0x1);const _0x198151=_0x755d4e[_0x30c53b-0x1]??'',_0x215c93=_0x755d4e[_0x30c53b+0x1]??'';if(_0x48e87b==='='&&_0x3f4e32===0x0&&!/[!<>=:]/[_0x8ecc7f(0x14b)](_0x198151)&&_0x215c93!=='='){if(_0x3f0193!==undefined)return null;_0x3f0193=_0x30c53b;}}return _0x3f0193===undefined?null:[_0x755d4e[_0x8ecc7f(0x149)](0x0,_0x3f0193)['trim'](),_0x755d4e[_0x8ecc7f(0x149)](_0x3f0193+0x1)[_0x8ecc7f(0x13f)]()];}function parseDirectColumnReference(_0x215844,_0x8f9089){const _0x23365d=a289_0x4a96,_0x416f0d=/^([`"]?[\w$]+[`"]?)\s*\.\s*([`"]?[\w$]+[`"]?)$/[_0x23365d(0x14d)](stripOuterParentheses(_0x215844));if(!_0x416f0d)return null;if(normalizeIdentifier(_0x416f0d[0x1]??'')!==normalizeIdentifier(_0x8f9089))return null;return normalizeIdentifier(_0x416f0d[0x2]??'');}function containsColumnReference(_0x2e4cb0,_0x138848){const _0x2930d2=a289_0x4a96,_0x55a7d3=_0x2e4cb0[_0x2930d2(0x151)](/[`"]/g,''),_0x134ebb=_0x138848[_0x2930d2(0x151)](/[.*+?^${}()|[\]\\]/g,_0x2930d2(0x172));return new RegExp('(?:^|[^\x5cw$])'+_0x134ebb+'\x5cs*\x5c.\x5cs*[\x5cw$]+','i')[_0x2930d2(0x14b)](_0x55a7d3);}function findEqualityPrefix(_0x347162,_0x4972a){const _0x3eea19=a289_0x4a96,_0xc67516=new Set(_0x4972a[_0x3eea19(0x15f)](normalizeIdentifier)),_0x5ef9c2=[];for(const _0x524de2 of _0x347162){if(!_0xc67516['has'](normalizeIdentifier(_0x524de2)))break;_0x5ef9c2[_0x3eea19(0x17c)](_0x524de2);}return _0x5ef9c2;}function resolveTableMetadata(_0x358ce3,_0x4fb186){const _0x5f2499=a289_0x4a96,_0x628561=normalizeIdentifier(_0x4fb186),_0x5135e7=_0x358ce3[_0x5f2499(0x182)](_0xac1676=>normalizeIdentifier(_0xac1676['tableName'])===_0x628561);if(_0x5135e7[_0x5f2499(0x158)]===0x1)return _0x5135e7[0x0];const _0x127069=_0x628561[_0x5f2499(0x175)]('.'),_0x3e1ac0=_0x628561['split']('.')['at'](-0x1),_0x4244f8=_0x358ce3[_0x5f2499(0x182)](_0x163267=>{const _0x21dd0b=_0x5f2499,_0x2e164c=normalizeIdentifier(_0x163267[_0x21dd0b(0x168)]);if(_0x127069&&_0x2e164c['includes']('.'))return![];return _0x2e164c[_0x21dd0b(0x176)]('.')['at'](-0x1)===_0x3e1ac0;});return _0x4244f8[_0x5f2499(0x158)]===0x1?_0x4244f8[0x0]:undefined;}function columnNamesMatch(_0x1429fb,_0x5426ba){return normalizeIdentifier(_0x1429fb)===normalizeIdentifier(_0x5426ba);}function normalizeIdentifier(_0x3f89d8){const _0x30325f=a289_0x4a96;return _0x3f89d8['replace'](/[`"]/g,'')[_0x30325f(0x13f)]()[_0x30325f(0x183)]();}function isSqlClauseKeyword(_0x882ec0){const _0x50b0cf=a289_0x4a96;return new Set(['on',_0x50b0cf(0x13e),'where',_0x50b0cf(0x139),'inner',_0x50b0cf(0x145),'right',_0x50b0cf(0x181),_0x50b0cf(0x15d),_0x50b0cf(0x160)])[_0x50b0cf(0x155)](_0x882ec0);}function stripOuterParentheses(_0x3694f2){const _0x1e2b1f=a289_0x4a96;let _0x35b801=_0x3694f2[_0x1e2b1f(0x13f)]();while(_0x35b801[_0x1e2b1f(0x170)]('(')&&_0x35b801[_0x1e2b1f(0x173)](')')){let _0x35929e=0x0,_0x5a540d=!![];for(let _0x16bc33=0x0;_0x16bc33<_0x35b801[_0x1e2b1f(0x158)];_0x16bc33+=0x1){if(_0x35b801[_0x16bc33]==='(')_0x35929e+=0x1;if(_0x35b801[_0x16bc33]===')')_0x35929e-=0x1;if(_0x35929e===0x0&&_0x16bc33<_0x35b801[_0x1e2b1f(0x158)]-0x1){_0x5a540d=![];break;}}if(!_0x5a540d||_0x35929e!==0x0)break;_0x35b801=_0x35b801[_0x1e2b1f(0x149)](0x1,-0x1)[_0x1e2b1f(0x13f)]();}return _0x35b801;}
@@ -1 +1 @@
1
- const a290_0x58bee4=a290_0x56cc;(function(_0x33d69d,_0x8442c4){const _0x1285a9=a290_0x56cc,_0x5321fa=_0x33d69d();while(!![]){try{const _0x4da9e0=-parseInt(_0x1285a9(0x154))/0x1*(-parseInt(_0x1285a9(0x157))/0x2)+-parseInt(_0x1285a9(0x152))/0x3+parseInt(_0x1285a9(0x155))/0x4+-parseInt(_0x1285a9(0x15c))/0x5*(parseInt(_0x1285a9(0x15d))/0x6)+-parseInt(_0x1285a9(0x158))/0x7+parseInt(_0x1285a9(0x153))/0x8+parseInt(_0x1285a9(0x159))/0x9*(parseInt(_0x1285a9(0x15a))/0xa);if(_0x4da9e0===_0x8442c4)break;else _0x5321fa['push'](_0x5321fa['shift']());}catch(_0x44821c){_0x5321fa['push'](_0x5321fa['shift']());}}}(a290_0x5103,0xb4591));function a290_0x56cc(_0x5bbf8d,_0x3b7be9){_0x5bbf8d=_0x5bbf8d-0x152;const _0x5103e6=a290_0x5103();let _0x56ccf7=_0x5103e6[_0x5bbf8d];return _0x56ccf7;}import{resolve}from'node:path';function a290_0x5103(){const _0x22c15f=['9222448YDLLHB','1AzaPou','4408196rVPflq','/sql','2344358EPqsTP','6787543wSnbhg','36396bcsRwa','1910KGPXiR','sql-trash','5gvRNYf','8736738yoOebu','3104883IepWBF'];a290_0x5103=function(){return _0x22c15f;};return a290_0x5103();}import{findProjectRootDirectory}from'../../context.js';const DOT_DIR='.rabetbase',LOCK_FILE_NAME='sql.lock.json',TRASH_DIR_NAME=a290_0x58bee4(0x15b);export function loadSqlProjectConfig(_0x4225e9,_0xbdb3ba){const _0x40e33a=a290_0x58bee4,_0x58da43=resolve(_0xbdb3ba??findProjectRootDirectory()),_0x183dd1=DOT_DIR+_0x40e33a(0x156),_0xb9586=_0x183dd1+'/'+_0x4225e9;return{'projectRoot':_0x58da43,'appCode':_0x4225e9,'sqlWorkspaceRoot':_0x183dd1,'sqlRoot':_0xb9586,'sqlRootDir':resolve(_0x58da43,DOT_DIR,'sql',_0x4225e9),'lockFilePath':resolve(_0x58da43,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x58da43,DOT_DIR,TRASH_DIR_NAME)};}
1
+ const a290_0x2c4ce1=a290_0x43c2;function a290_0x43c2(_0xf03ad4,_0x1bf828){_0xf03ad4=_0xf03ad4-0x1cd;const _0x4f980c=a290_0x4f98();let _0x43c267=_0x4f980c[_0xf03ad4];return _0x43c267;}function a290_0x4f98(){const _0x55674c=['1384112ZmyPIW','/sql','82494ePhyry','10jFeXpq','sql.lock.json','332705XnaDYc','1678901cqVTXt','.rabetbase','2rmEdHd','1090884BLXkOR','sql','390NOkwZq','8iinfEj','475377WaDmEc','55WzilMw','551238MJbVsb'];a290_0x4f98=function(){return _0x55674c;};return a290_0x4f98();}(function(_0x4478cf,_0xe95ffa){const _0x5d5052=a290_0x43c2,_0x58e69e=_0x4478cf();while(!![]){try{const _0xa8b009=parseInt(_0x5d5052(0x1d6))/0x1*(-parseInt(_0x5d5052(0x1d9))/0x2)+-parseInt(_0x5d5052(0x1ce))/0x3+parseInt(_0x5d5052(0x1d1))/0x4+parseInt(_0x5d5052(0x1d4))/0x5*(parseInt(_0x5d5052(0x1d0))/0x6)+parseInt(_0x5d5052(0x1d7))/0x7*(parseInt(_0x5d5052(0x1cd))/0x8)+-parseInt(_0x5d5052(0x1d3))/0x9*(-parseInt(_0x5d5052(0x1dc))/0xa)+parseInt(_0x5d5052(0x1cf))/0xb*(-parseInt(_0x5d5052(0x1da))/0xc);if(_0xa8b009===_0xe95ffa)break;else _0x58e69e['push'](_0x58e69e['shift']());}catch(_0x3aaf28){_0x58e69e['push'](_0x58e69e['shift']());}}}(a290_0x4f98,0x2c490));import{resolve}from'node:path';import{findProjectRootDirectory}from'../../context.js';const DOT_DIR=a290_0x2c4ce1(0x1d8),LOCK_FILE_NAME=a290_0x2c4ce1(0x1d5),TRASH_DIR_NAME='sql-trash';export function loadSqlProjectConfig(_0x24d338,_0x105c79){const _0x58e239=a290_0x2c4ce1,_0x5209ba=resolve(_0x105c79??findProjectRootDirectory()),_0x1750f8=DOT_DIR+_0x58e239(0x1d2),_0x26b8d1=_0x1750f8+'/'+_0x24d338;return{'projectRoot':_0x5209ba,'appCode':_0x24d338,'sqlWorkspaceRoot':_0x1750f8,'sqlRoot':_0x26b8d1,'sqlRootDir':resolve(_0x5209ba,DOT_DIR,_0x58e239(0x1db),_0x24d338),'lockFilePath':resolve(_0x5209ba,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x5209ba,DOT_DIR,TRASH_DIR_NAME)};}
@@ -1 +1 @@
1
- (function(_0x4e76e4,_0x206b98){const _0x25ed4f=a291_0x36b4,_0x1dceff=_0x4e76e4();while(!![]){try{const _0x264cdf=-parseInt(_0x25ed4f(0xaa))/0x1*(parseInt(_0x25ed4f(0x8f))/0x2)+-parseInt(_0x25ed4f(0xa8))/0x3+parseInt(_0x25ed4f(0xa2))/0x4*(parseInt(_0x25ed4f(0x9c))/0x5)+-parseInt(_0x25ed4f(0xa3))/0x6*(-parseInt(_0x25ed4f(0xad))/0x7)+parseInt(_0x25ed4f(0x97))/0x8*(parseInt(_0x25ed4f(0x98))/0x9)+parseInt(_0x25ed4f(0xa5))/0xa*(parseInt(_0x25ed4f(0xae))/0xb)+parseInt(_0x25ed4f(0xab))/0xc*(parseInt(_0x25ed4f(0xb0))/0xd);if(_0x264cdf===_0x206b98)break;else _0x1dceff['push'](_0x1dceff['shift']());}catch(_0x19ba47){_0x1dceff['push'](_0x1dceff['shift']());}}}(a291_0x375f,0x3ccdb));import{readdir,stat}from'node:fs/promises';function a291_0x36b4(_0x2132cb,_0x52e55a){_0x2132cb=_0x2132cb-0x8f;const _0x375f88=a291_0x375f();let _0x36b4c8=_0x375f88[_0x2132cb];return _0x36b4c8;}import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x52e772){const _0x26586d=a291_0x36b4;if(_0x52e772===_0x26586d(0x99))return _0x26586d(0x9f);if(_0x52e772===_0x26586d(0xac))return _0x26586d(0x93);return undefined;}async function scanSqlFilesRecursively(_0x2a9f54,_0x723fb0){const _0x5ec383=a291_0x36b4,_0x9816b=[];try{const _0x2a2d83=await readdir(_0x2a9f54,{'withFileTypes':!![]});for(const _0x3b261c of _0x2a2d83){const _0x521626=join(_0x2a9f54,_0x3b261c[_0x5ec383(0x90)]);if(_0x3b261c['isDirectory']()){_0x9816b['push'](...await scanSqlFilesRecursively(_0x521626,_0x723fb0));continue;}if(!_0x3b261c[_0x5ec383(0xa1)]())continue;const _0x26d1a8=extname(_0x3b261c[_0x5ec383(0x90)])[_0x5ec383(0xaf)](),_0x3d010d=extensionToMode(_0x26d1a8);if(!_0x3d010d)continue;const _0x3bb764=relative(_0x723fb0,_0x521626)[_0x5ec383(0xa9)](/\\/g,'/'),_0x51ec13=_0x3bb764[_0x5ec383(0x9a)]('/')[_0x5ec383(0x92)](Boolean),_0x25cc2f=parseSqlPath(_0x51ec13,_0x3b261c[_0x5ec383(0x90)],_0x26d1a8);if(!_0x25cc2f)continue;_0x9816b[_0x5ec383(0x9b)]({'sqlCode':_0x25cc2f['sqlCode'],'sqlName':_0x25cc2f[_0x5ec383(0xa0)],'dbDirectory':_0x51ec13[0x0],'filePath':_0x521626,'relativePath':_0x3bb764,'lockKey':_0x25cc2f[_0x5ec383(0x9d)],'mode':_0x3d010d});}}catch(_0x5ac3e4){if(_0x5ac3e4[_0x5ec383(0x94)]!=='ENOENT')throw _0x5ac3e4;}return _0x9816b;}export async function scanLocalSqlQueries(_0x245688){const _0x2bd818=a291_0x36b4;return scanSqlFilesRecursively(_0x245688[_0x2bd818(0x91)],_0x245688['sqlRootDir']);}function a291_0x375f(){const _0x3c42a9=['15kSljKY','sqlCode','mode','sql','sqlName','isFile','44772evWXtU','2095278ppzxbL','length','2630qYdmUE','dbName','test','1058946PMAJoa','replace','179206KCwhCD','652332cnEwKV','.xml','7BDlUta','6941OQLzra','toLowerCase','26zGfhGB','4WnmCmX','name','sqlRootDir','filter','mybatisXml','code','slice','dbId','56368ZQxnmn','387qIPDjs','.sql','split','push'];a291_0x375f=function(){return _0x3c42a9;};return a291_0x375f();}export function resolveLocalSqlFilePath(_0x95efd1,_0x25f994,_0x257c15){const _0x5a9e45=a291_0x36b4,_0x13a14d=_0x257c15?.['path']||(_0x257c15?.[_0x5a9e45(0xa0)]||_0x257c15?.[_0x5a9e45(0xa6)]?buildSqlRelativePath(_0x25f994,_0x257c15?.[_0x5a9e45(0xa0)],_0x257c15?.[_0x5a9e45(0xa6)],_0x257c15?.[_0x5a9e45(0x9e)]||_0x5a9e45(0x9f),_0x257c15?.[_0x5a9e45(0x96)]):buildDefaultSqlFileName(_0x25f994,_0x257c15?.['mode']||'sql'));return join(_0x95efd1['sqlRootDir'],_0x13a14d);}export async function directoryExists(_0x3554be){try{const _0x464fe1=await stat(_0x3554be);return _0x464fe1['isDirectory']();}catch{return![];}}function parseSqlPath(_0x451f6b,_0x3603b8,_0x479c09){const _0x79238b=a291_0x36b4,_0x2d9461=_0x3603b8[_0x79238b(0x95)](0x0,-_0x479c09['length']);if(_0x451f6b['length']<0x2)return null;const _0xdedfbe=_0x2d9461['indexOf']('_');if(_0xdedfbe<=0x0||_0xdedfbe>=_0x2d9461[_0x79238b(0xa4)]-0x1)return null;const _0xea2bae=_0x2d9461[_0x79238b(0x95)](0x0,_0xdedfbe);if(!isLikelySqlCode(_0xea2bae))return null;return{'sqlCode':_0xea2bae,'sqlName':_0x2d9461['slice'](_0xdedfbe+0x1)};}function isLikelySqlCode(_0x157e29){const _0x2de480=a291_0x36b4;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x2de480(0xa7)](_0x157e29);}
1
+ function a291_0x2741(){const _0x3391be=['replace','339163MhCPQO','308872lEpdxf','name','sqlCode','mode','sqlName','test','.xml','142808GMCHXK','push','filter','6671380ZRlkXj','slice','4SrlSGz','split','length','3356751pXhdwA','sql','7ldurra','348PliXBV','16KqtyeL','297HaOZpX','indexOf','sqlRootDir','9810546ozTKww','mybatisXml','.sql','4023865bsOnur'];a291_0x2741=function(){return _0x3391be;};return a291_0x2741();}(function(_0x196d04,_0x5d6c44){const _0x4734c0=a291_0x48e1,_0x2731bc=_0x196d04();while(!![]){try{const _0x430bed=-parseInt(_0x4734c0(0x1fc))/0x1*(-parseInt(_0x4734c0(0x1eb))/0x2)+-parseInt(_0x4734c0(0x1e7))/0x3+-parseInt(_0x4734c0(0x1e4))/0x4*(-parseInt(_0x4734c0(0x1f2))/0x5)+-parseInt(_0x4734c0(0x1ef))/0x6*(-parseInt(_0x4734c0(0x1e9))/0x7)+-parseInt(_0x4734c0(0x1f5))/0x8*(parseInt(_0x4734c0(0x1ec))/0x9)+parseInt(_0x4734c0(0x1ff))/0xa+-parseInt(_0x4734c0(0x1f4))/0xb*(parseInt(_0x4734c0(0x1ea))/0xc);if(_0x430bed===_0x5d6c44)break;else _0x2731bc['push'](_0x2731bc['shift']());}catch(_0x33787e){_0x2731bc['push'](_0x2731bc['shift']());}}}(a291_0x2741,0xeaef7));import{readdir,stat}from'node:fs/promises';import{extname,join,relative}from'node:path';import{buildDefaultSqlFileName,buildSqlRelativePath}from'./utils.js';function extensionToMode(_0x394cee){const _0x3d87af=a291_0x48e1;if(_0x394cee===_0x3d87af(0x1f1))return _0x3d87af(0x1e8);if(_0x394cee===_0x3d87af(0x1fb))return _0x3d87af(0x1f0);return undefined;}async function scanSqlFilesRecursively(_0x7005fd,_0x32ff64){const _0x2a47a9=a291_0x48e1,_0x4ac68d=[];try{const _0xc8acc3=await readdir(_0x7005fd,{'withFileTypes':!![]});for(const _0x877bc4 of _0xc8acc3){const _0x4f98c1=join(_0x7005fd,_0x877bc4['name']);if(_0x877bc4['isDirectory']()){_0x4ac68d[_0x2a47a9(0x1fd)](...await scanSqlFilesRecursively(_0x4f98c1,_0x32ff64));continue;}if(!_0x877bc4['isFile']())continue;const _0x4b59ae=extname(_0x877bc4[_0x2a47a9(0x1f6)])['toLowerCase'](),_0x16d365=extensionToMode(_0x4b59ae);if(!_0x16d365)continue;const _0x103eff=relative(_0x32ff64,_0x4f98c1)[_0x2a47a9(0x1f3)](/\\/g,'/'),_0x5a14ea=_0x103eff[_0x2a47a9(0x1e5)]('/')[_0x2a47a9(0x1fe)](Boolean),_0x205d1f=parseSqlPath(_0x5a14ea,_0x877bc4[_0x2a47a9(0x1f6)],_0x4b59ae);if(!_0x205d1f)continue;_0x4ac68d['push']({'sqlCode':_0x205d1f[_0x2a47a9(0x1f7)],'sqlName':_0x205d1f['sqlName'],'dbDirectory':_0x5a14ea[0x0],'filePath':_0x4f98c1,'relativePath':_0x103eff,'lockKey':_0x205d1f[_0x2a47a9(0x1f7)],'mode':_0x16d365});}}catch(_0x3b0697){if(_0x3b0697['code']!=='ENOENT')throw _0x3b0697;}return _0x4ac68d;}export async function scanLocalSqlQueries(_0x20138d){const _0x1e08a6=a291_0x48e1;return scanSqlFilesRecursively(_0x20138d['sqlRootDir'],_0x20138d[_0x1e08a6(0x1ee)]);}function a291_0x48e1(_0x26adae,_0x190833){_0x26adae=_0x26adae-0x1e4;const _0x27413a=a291_0x2741();let _0x48e10e=_0x27413a[_0x26adae];return _0x48e10e;}export function resolveLocalSqlFilePath(_0x40635e,_0x1e16df,_0x95f609){const _0x4d3a8f=a291_0x48e1,_0x2ca46a=_0x95f609?.['path']||(_0x95f609?.[_0x4d3a8f(0x1f9)]||_0x95f609?.['dbName']?buildSqlRelativePath(_0x1e16df,_0x95f609?.[_0x4d3a8f(0x1f9)],_0x95f609?.['dbName'],_0x95f609?.[_0x4d3a8f(0x1f8)]||_0x4d3a8f(0x1e8),_0x95f609?.['dbId']):buildDefaultSqlFileName(_0x1e16df,_0x95f609?.[_0x4d3a8f(0x1f8)]||_0x4d3a8f(0x1e8)));return join(_0x40635e[_0x4d3a8f(0x1ee)],_0x2ca46a);}export async function directoryExists(_0x3dbe89){try{const _0xe14559=await stat(_0x3dbe89);return _0xe14559['isDirectory']();}catch{return![];}}function parseSqlPath(_0x552af3,_0x25109e,_0x419455){const _0x2308ea=a291_0x48e1,_0x2f7f96=_0x25109e['slice'](0x0,-_0x419455[_0x2308ea(0x1e6)]);if(_0x552af3[_0x2308ea(0x1e6)]<0x2)return null;const _0x3979d1=_0x2f7f96[_0x2308ea(0x1ed)]('_');if(_0x3979d1<=0x0||_0x3979d1>=_0x2f7f96[_0x2308ea(0x1e6)]-0x1)return null;const _0x525d4f=_0x2f7f96[_0x2308ea(0x200)](0x0,_0x3979d1);if(!isLikelySqlCode(_0x525d4f))return null;return{'sqlCode':_0x525d4f,'sqlName':_0x2f7f96['slice'](_0x3979d1+0x1)};}function isLikelySqlCode(_0x37df6c){const _0x2e2187=a291_0x48e1;return/^[A-Za-z0-9-]+-[A-Za-z0-9-]+$/[_0x2e2187(0x1fa)](_0x37df6c);}
@@ -1 +1 @@
1
- (function(_0x59cad6,_0xe05ddf){const _0xd19838=a292_0x2b37,_0x21161e=_0x59cad6();while(!![]){try{const _0xa87dc3=-parseInt(_0xd19838(0xbc))/0x1+parseInt(_0xd19838(0xc5))/0x2*(-parseInt(_0xd19838(0xc4))/0x3)+parseInt(_0xd19838(0xc3))/0x4*(parseInt(_0xd19838(0xc1))/0x5)+parseInt(_0xd19838(0xbf))/0x6*(-parseInt(_0xd19838(0xc7))/0x7)+parseInt(_0xd19838(0xc2))/0x8*(parseInt(_0xd19838(0xca))/0x9)+parseInt(_0xd19838(0xbb))/0xa+-parseInt(_0xd19838(0xc6))/0xb*(-parseInt(_0xd19838(0xbe))/0xc);if(_0xa87dc3===_0xe05ddf)break;else _0x21161e['push'](_0x21161e['shift']());}catch(_0x2b3caa){_0x21161e['push'](_0x21161e['shift']());}}}(a292_0x1cf5,0x6c350));function a292_0x1cf5(){const _0x164dfa=['md5','4199139SQRzGS','3171440EdPYmT','534428wyaItC','createHash','7498128YsDEIl','218628giTWFa','update','33795lyOrWx','8VxHHoX','48DzTTMS','7077HEZFjb','346TbdWqb','22mLqpQE','140ZgFGbt','hex'];a292_0x1cf5=function(){return _0x164dfa;};return a292_0x1cf5();}function a292_0x2b37(_0x4b05e1,_0x34e323){_0x4b05e1=_0x4b05e1-0xbb;const _0x1cf59a=a292_0x1cf5();let _0x2b37a8=_0x1cf59a[_0x4b05e1];return _0x2b37a8;}import{readFile}from'node:fs/promises';import a292_0x57d021 from'node:crypto';export function computeSqlContentHash(_0xc316c2){const _0xba0f50=a292_0x2b37;return a292_0x57d021[_0xba0f50(0xbd)](_0xba0f50(0xc9))[_0xba0f50(0xc0)](_0xc316c2)['digest'](_0xba0f50(0xc8));}export async function computeSqlFileHash(_0x155c3d){const _0x58c95b=await readFile(_0x155c3d,'utf8');return computeSqlContentHash(_0x58c95b);}
1
+ (function(_0x4e9619,_0x4f499c){const _0x31d767=a292_0x3acb,_0x1ed55f=_0x4e9619();while(!![]){try{const _0x3c140e=parseInt(_0x31d767(0xcf))/0x1*(-parseInt(_0x31d767(0xcb))/0x2)+-parseInt(_0x31d767(0xd7))/0x3*(-parseInt(_0x31d767(0xca))/0x4)+-parseInt(_0x31d767(0xd3))/0x5+-parseInt(_0x31d767(0xd4))/0x6*(parseInt(_0x31d767(0xd1))/0x7)+parseInt(_0x31d767(0xd2))/0x8*(parseInt(_0x31d767(0xc9))/0x9)+parseInt(_0x31d767(0xd0))/0xa*(parseInt(_0x31d767(0xd6))/0xb)+-parseInt(_0x31d767(0xcc))/0xc*(-parseInt(_0x31d767(0xd5))/0xd);if(_0x3c140e===_0x4f499c)break;else _0x1ed55f['push'](_0x1ed55f['shift']());}catch(_0x29d87e){_0x1ed55f['push'](_0x1ed55f['shift']());}}}(a292_0x2f03,0xd99ab));import{readFile}from'node:fs/promises';import a292_0x297d5f from'node:crypto';function a292_0x3acb(_0x413ce5,_0x528250){_0x413ce5=_0x413ce5-0xc9;const _0x2f03c2=a292_0x2f03();let _0x3acba0=_0x2f03c2[_0x413ce5];return _0x3acba0;}function a292_0x2f03(){const _0x5bb5c8=['update','hex','3WuhVbr','2510PUJtlU','21CldWiH','2337872QDfXuF','5650590kyJGtY','415722otEHoc','5660733cIcfWG','6831qEIxkE','3qEZiyJ','md5','54uRuncF','713068byJLBv','195798FRjLGU','12DHrcif'];a292_0x2f03=function(){return _0x5bb5c8;};return a292_0x2f03();}export function computeSqlContentHash(_0x5529e9){const _0x5f3eb4=a292_0x3acb;return a292_0x297d5f['createHash'](_0x5f3eb4(0xd8))[_0x5f3eb4(0xcd)](_0x5529e9)['digest'](_0x5f3eb4(0xce));}export async function computeSqlFileHash(_0x560d28){const _0x12d9b1=await readFile(_0x560d28,'utf8');return computeSqlContentHash(_0x12d9b1);}
@@ -1 +1 @@
1
- (function(_0x27802d,_0x5ee995){const _0x1d8cfa=a293_0x4419,_0x2d45a9=_0x27802d();while(!![]){try{const _0x14c1fb=parseInt(_0x1d8cfa(0x153))/0x1*(-parseInt(_0x1d8cfa(0x148))/0x2)+parseInt(_0x1d8cfa(0x158))/0x3+-parseInt(_0x1d8cfa(0x150))/0x4+parseInt(_0x1d8cfa(0x14a))/0x5*(-parseInt(_0x1d8cfa(0x145))/0x6)+parseInt(_0x1d8cfa(0x146))/0x7*(parseInt(_0x1d8cfa(0x152))/0x8)+-parseInt(_0x1d8cfa(0x151))/0x9*(-parseInt(_0x1d8cfa(0x144))/0xa)+-parseInt(_0x1d8cfa(0x159))/0xb*(-parseInt(_0x1d8cfa(0x156))/0xc);if(_0x14c1fb===_0x5ee995)break;else _0x2d45a9['push'](_0x2d45a9['shift']());}catch(_0x665b55){_0x2d45a9['push'](_0x2d45a9['shift']());}}}(a293_0x16c6,0x19934));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0xd641d3,_0x58968f,_0x395b8c,_0xc2eff3){const _0x4d0016=a293_0x4419,_0x1c7baf=_0xd641d3??createEmptySqlLock();let _0x179814=_0x1c7baf['apps'][_0x58968f];if(!_0x179814)return _0x179814={'sqlRoot':_0x395b8c,'lastSync':'','sqls':{}},_0x1c7baf[_0x4d0016(0x14b)][_0x58968f]=_0x179814,{'lockData':_0x1c7baf,'appLock':_0x179814};if(!_0x179814['sqlRoot'])_0x179814[_0x4d0016(0x14f)]=_0x395b8c;else{if(_0x179814['sqlRoot']!==_0x395b8c)throw new Error(_0xc2eff3+_0x4d0016(0x147)+_0x395b8c+'\x22\x20vs\x20lock\x20\x22'+_0x179814['sqlRoot']+_0x4d0016(0x14c)+'Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x179814[_0x4d0016(0x143)]&&(_0x179814['sqls']={}),!_0x179814[_0x4d0016(0x14e)]&&(_0x179814[_0x4d0016(0x14e)]=''),{'lockData':_0x1c7baf,'appLock':_0x179814};}export async function readSqlLockFile(_0x35e826){const _0x5e27c6=a293_0x4419;try{const _0x57c285=await readFile(_0x35e826,_0x5e27c6(0x155));return JSON[_0x5e27c6(0x154)](_0x57c285);}catch(_0x22a031){if(_0x22a031['code']===_0x5e27c6(0x149))return null;throw new Error(_0x5e27c6(0x157)+String(_0x22a031));}}function a293_0x16c6(){const _0x4931ed=['618876WqczIe','11jYYBou','sqls','10HGLYnb','42dvXzXq','119LhcurC',':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','2fUUDbO','ENOENT','127450jkhHbm','apps','\x22.\x20','stringify','lastSync','sqlRoot','565716fUVrFv','1127799vHvOHT','43864cHIBUA','158870FFjhHd','parse','utf8','1904052Uwzzpz','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20'];a293_0x16c6=function(){return _0x4931ed;};return a293_0x16c6();}function a293_0x4419(_0x10e56b,_0x4ada2c){_0x10e56b=_0x10e56b-0x143;const _0x16c631=a293_0x16c6();let _0x4419f6=_0x16c631[_0x10e56b];return _0x4419f6;}export async function writeSqlLockFile(_0x5c145e,_0x5771db){const _0x1de471=a293_0x4419;await mkdir(dirname(_0x5c145e),{'recursive':!![]}),await writeFile(_0x5c145e,JSON[_0x1de471(0x14d)](_0x5771db,null,0x2),_0x1de471(0x155));}
1
+ (function(_0xa252b0,_0x34de8a){const _0x38511c=a293_0x33ff,_0x8b8b86=_0xa252b0();while(!![]){try{const _0x5759a9=-parseInt(_0x38511c(0xb0))/0x1+parseInt(_0x38511c(0xa4))/0x2*(-parseInt(_0x38511c(0xa7))/0x3)+parseInt(_0x38511c(0xb9))/0x4*(parseInt(_0x38511c(0xa5))/0x5)+-parseInt(_0x38511c(0xb6))/0x6*(parseInt(_0x38511c(0xb2))/0x7)+parseInt(_0x38511c(0xb8))/0x8*(parseInt(_0x38511c(0xaa))/0x9)+-parseInt(_0x38511c(0xa8))/0xa+parseInt(_0x38511c(0xaf))/0xb;if(_0x5759a9===_0x34de8a)break;else _0x8b8b86['push'](_0x8b8b86['shift']());}catch(_0x5d41c9){_0x8b8b86['push'](_0x8b8b86['shift']());}}}(a293_0x4017,0x24ed5));import{mkdir,readFile,writeFile}from'node:fs/promises';function a293_0x33ff(_0x52a570,_0x1f4226){_0x52a570=_0x52a570-0xa3;const _0x401788=a293_0x4017();let _0x33ff04=_0x401788[_0x52a570];return _0x33ff04;}import{dirname}from'node:path';export function createEmptySqlLock(){return{'apps':{}};}export function ensureSqlLockScope(_0x48d51e,_0x16c0bc,_0x4369a7,_0x10cc42){const _0x38c386=a293_0x33ff,_0x4f7c34=_0x48d51e??createEmptySqlLock();let _0x1fcc33=_0x4f7c34[_0x38c386(0xb5)][_0x16c0bc];if(!_0x1fcc33)return _0x1fcc33={'sqlRoot':_0x4369a7,'lastSync':'','sqls':{}},_0x4f7c34['apps'][_0x16c0bc]=_0x1fcc33,{'lockData':_0x4f7c34,'appLock':_0x1fcc33};if(!_0x1fcc33['sqlRoot'])_0x1fcc33['sqlRoot']=_0x4369a7;else{if(_0x1fcc33[_0x38c386(0xb7)]!==_0x4369a7)throw new Error(_0x10cc42+_0x38c386(0xad)+_0x4369a7+_0x38c386(0xae)+_0x1fcc33['sqlRoot']+'\x22.\x20'+_0x38c386(0xa9));}return!_0x1fcc33['sqls']&&(_0x1fcc33[_0x38c386(0xa6)]={}),!_0x1fcc33[_0x38c386(0xb3)]&&(_0x1fcc33[_0x38c386(0xb3)]=''),{'lockData':_0x4f7c34,'appLock':_0x1fcc33};}export async function readSqlLockFile(_0x5d43b0){const _0x1dda2e=a293_0x33ff;try{const _0x576632=await readFile(_0x5d43b0,_0x1dda2e(0xac));return JSON[_0x1dda2e(0xa3)](_0x576632);}catch(_0x3a4b01){if(_0x3a4b01[_0x1dda2e(0xab)]==='ENOENT')return null;throw new Error(_0x1dda2e(0xb4)+String(_0x3a4b01));}}function a293_0x4017(){const _0x155b5f=[':\x20sqlRoot\x20mismatch\x20—\x20current\x20\x22','\x22\x20vs\x20lock\x20\x22','8046577CNUOnB','21914CiktNz','stringify','2023441BrxpkB','lastSync','Failed\x20to\x20read\x20SQL\x20lock\x20file:\x20','apps','6rhaJDN','sqlRoot','5192hxtifk','727700EIsvEm','parse','286ovNCCO','5KxybjR','sqls','5361ZBpRsV','2664020aRsbQH','Check\x20.rabetbase/sql.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','981RfNhZY','code','utf8'];a293_0x4017=function(){return _0x155b5f;};return a293_0x4017();}export async function writeSqlLockFile(_0xc480e9,_0x4eba5b){const _0x1cf5f5=a293_0x33ff;await mkdir(dirname(_0xc480e9),{'recursive':!![]}),await writeFile(_0xc480e9,JSON[_0x1cf5f5(0xb1)](_0x4eba5b,null,0x2),_0x1cf5f5(0xac));}
@@ -1 +1 @@
1
- (function(_0x44c65a,_0x6afc9d){const _0x4b4516=a295_0x1689,_0xfaaeda=_0x44c65a();while(!![]){try{const _0x3a26c1=parseInt(_0x4b4516(0xcd))/0x1+parseInt(_0x4b4516(0xc9))/0x2+parseInt(_0x4b4516(0xce))/0x3*(-parseInt(_0x4b4516(0xcf))/0x4)+parseInt(_0x4b4516(0xd3))/0x5*(parseInt(_0x4b4516(0xd4))/0x6)+-parseInt(_0x4b4516(0xca))/0x7+parseInt(_0x4b4516(0xd2))/0x8*(parseInt(_0x4b4516(0xc6))/0x9)+-parseInt(_0x4b4516(0xd5))/0xa;if(_0x3a26c1===_0x6afc9d)break;else _0xfaaeda['push'](_0xfaaeda['shift']());}catch(_0x442e4c){_0xfaaeda['push'](_0xfaaeda['shift']());}}}(a295_0x5d66,0xd594f));export function detectSqlMode(_0x43e949){const _0x4fbae0=a295_0x1689,_0x133670=_0x43e949[_0x4fbae0(0xcb)]();if(/^<(select|insert|update|delete)\b/i[_0x4fbae0(0xd7)](_0x133670))return _0x4fbae0(0xcc);return _0x4fbae0(0xc7);}export function getSqlFileExtension(_0x46dcc8){const _0x293bcc=a295_0x1689;return _0x46dcc8==='mybatisXml'?_0x293bcc(0xd1):'.sql';}function a295_0x5d66(){const _0x3969e9=['trimStart','mybatisXml','515436ocMXQN','432885tgOqoA','28LjonrJ','unknown-db','.xml','8QyfUtF','3854140pmPJRv','12NDQPjO','17496880PZXymd','db-','test','3670011bzdOcK','sql','replace','3144128qwJXXK','2816457QRlRqr'];a295_0x5d66=function(){return _0x3969e9;};return a295_0x5d66();}function a295_0x1689(_0x208414,_0x143f5f){_0x208414=_0x208414-0xc6;const _0x5d66b5=a295_0x5d66();let _0x1689f0=_0x5d66b5[_0x208414];return _0x1689f0;}export function buildDefaultSqlFileName(_0x48e35c,_0x50e59b){return''+_0x48e35c+getSqlFileExtension(_0x50e59b);}export function sanitizeSqlPathSegment(_0x287e4d,_0x565c15){const _0x4fdd0f=a295_0x1689,_0x3ced88=String(_0x287e4d??'')['trim'](),_0x51d24f=_0x3ced88[_0x4fdd0f(0xc8)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x4fdd0f(0xc8)](/\s+/g,'-')[_0x4fdd0f(0xc8)](/-+/g,'-')[_0x4fdd0f(0xc8)](/^\.+/,'')[_0x4fdd0f(0xc8)](/\.+$/,'')['replace'](/^-+/,'')[_0x4fdd0f(0xc8)](/-+$/,'');return _0x51d24f||_0x565c15;}export function buildDbDirectoryName(_0x207cc5,_0x6669ed){const _0x26fab1=a295_0x1689;return sanitizeSqlPathSegment(_0x207cc5,_0x6669ed!=null?_0x26fab1(0xd6)+_0x6669ed:_0x26fab1(0xd0));}export function buildSqlRelativePath(_0x2361a2,_0x1c10c2,_0x2963d4,_0x557c17,_0x460a0e){const _0x8424a6=buildDbDirectoryName(_0x2963d4,_0x460a0e),_0x28948e=sanitizeSqlPathSegment(_0x2361a2,'unknown-sql'),_0x1a109b=sanitizeSqlPathSegment(_0x1c10c2,_0x28948e);return _0x8424a6+'/'+_0x28948e+'_'+_0x1a109b+getSqlFileExtension(_0x557c17);}
1
+ function a295_0x1ef0(_0x4efb85,_0x4a2aca){_0x4efb85=_0x4efb85-0x11f;const _0x4bcfb0=a295_0x4bcf();let _0x1ef0d6=_0x4bcfb0[_0x4efb85];return _0x1ef0d6;}(function(_0x514249,_0x1f3b66){const _0x481c33=a295_0x1ef0,_0x4f215d=_0x514249();while(!![]){try{const _0x3f78e1=parseInt(_0x481c33(0x121))/0x1+-parseInt(_0x481c33(0x124))/0x2*(-parseInt(_0x481c33(0x131))/0x3)+parseInt(_0x481c33(0x12f))/0x4*(-parseInt(_0x481c33(0x128))/0x5)+-parseInt(_0x481c33(0x125))/0x6+parseInt(_0x481c33(0x12b))/0x7*(-parseInt(_0x481c33(0x122))/0x8)+-parseInt(_0x481c33(0x12a))/0x9*(parseInt(_0x481c33(0x129))/0xa)+parseInt(_0x481c33(0x12e))/0xb*(parseInt(_0x481c33(0x130))/0xc);if(_0x3f78e1===_0x1f3b66)break;else _0x4f215d['push'](_0x4f215d['shift']());}catch(_0x315896){_0x4f215d['push'](_0x4f215d['shift']());}}}(a295_0x4bcf,0xcc725));function a295_0x4bcf(){const _0x483628=['3GuwrGE','test','replace','mybatisXml','58664wqmWXn','333208oSFPho','.sql','2503874DbnJop','1318290hSlnTQ','trim','trimStart','2351735GKEywz','10ulZyrD','4437468qPBIyd','224BCyTkq','.xml','sql','473XsLJvf','4uSqech','570072qmAAAV'];a295_0x4bcf=function(){return _0x483628;};return a295_0x4bcf();}export function detectSqlMode(_0xf32be2){const _0x1d1a3f=a295_0x1ef0,_0x693d9c=_0xf32be2[_0x1d1a3f(0x127)]();if(/^<(select|insert|update|delete)\b/i[_0x1d1a3f(0x132)](_0x693d9c))return _0x1d1a3f(0x120);return _0x1d1a3f(0x12d);}export function getSqlFileExtension(_0x4c3411){const _0x575334=a295_0x1ef0;return _0x4c3411===_0x575334(0x120)?_0x575334(0x12c):_0x575334(0x123);}export function buildDefaultSqlFileName(_0x817611,_0x2870c4){return''+_0x817611+getSqlFileExtension(_0x2870c4);}export function sanitizeSqlPathSegment(_0x3a629f,_0x26a0c6){const _0x2a2f7b=a295_0x1ef0,_0x4efdf5=String(_0x3a629f??'')[_0x2a2f7b(0x126)](),_0x43218a=_0x4efdf5[_0x2a2f7b(0x11f)](/[<>:"/\\|?*\u0000-\u001F]/g,'-')[_0x2a2f7b(0x11f)](/\s+/g,'-')[_0x2a2f7b(0x11f)](/-+/g,'-')['replace'](/^\.+/,'')[_0x2a2f7b(0x11f)](/\.+$/,'')[_0x2a2f7b(0x11f)](/^-+/,'')[_0x2a2f7b(0x11f)](/-+$/,'');return _0x43218a||_0x26a0c6;}export function buildDbDirectoryName(_0x51d838,_0x460b2e){return sanitizeSqlPathSegment(_0x51d838,_0x460b2e!=null?'db-'+_0x460b2e:'unknown-db');}export function buildSqlRelativePath(_0xf66907,_0x30d777,_0x1a9c93,_0xf4665f,_0x45ab8d){const _0xbe029a=buildDbDirectoryName(_0x1a9c93,_0x45ab8d),_0x5141a5=sanitizeSqlPathSegment(_0xf66907,'unknown-sql'),_0x267518=sanitizeSqlPathSegment(_0x30d777,_0x5141a5);return _0xbe029a+'/'+_0x5141a5+'_'+_0x267518+getSqlFileExtension(_0xf4665f);}