@routinecrew/routinecode 2.31.77 → 2.31.86

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 (244) hide show
  1. package/README.md +2 -2
  2. package/bin/cli.sh +23 -0
  3. package/bin/prompt-vault.dat +1 -0
  4. package/bin/prompt-vault.js +51 -1
  5. package/bin/rc-board.js +58 -0
  6. package/bin/rc-config.js +756 -1
  7. package/bin/rc-credit-turn.js +2 -1
  8. package/bin/rc-grant.js +2 -1
  9. package/bin/rc-login.js +2 -0
  10. package/bin/rc-map.js +132 -0
  11. package/bin/rc-privacy.js +200 -0
  12. package/bin/rc-skills.js +31 -0
  13. package/bin/rc-team.js +2 -1
  14. package/bin/setup.js +4 -0
  15. package/hooks/cc-compat-watch.js +2 -1
  16. package/hooks/claim-questions.json +40 -0
  17. package/hooks/hooks-config.json +108 -1
  18. package/hooks/lib/agent_budget.py +122 -0
  19. package/hooks/lib/agent_telemetry.py +143 -0
  20. package/hooks/lib/attest_reader.py +15 -6
  21. package/hooks/lib/attribution_judge.py +109 -0
  22. package/hooks/lib/board-golden.json +268 -0
  23. package/hooks/lib/board.py +503 -0
  24. package/hooks/lib/board_sync.py +535 -0
  25. package/hooks/lib/cc-surface.json +1 -1
  26. package/hooks/lib/claim_structure.py +412 -0
  27. package/hooks/lib/completion_log.py +12 -5
  28. package/hooks/lib/config_bash_track.py +114 -28
  29. package/hooks/lib/config_guard.py +137 -5
  30. package/hooks/lib/edit_tracker.py +182 -0
  31. package/hooks/lib/error_line.py +94 -0
  32. package/hooks/lib/escalation_restore.py +66 -0
  33. package/hooks/lib/i18n.py +37 -15
  34. package/hooks/lib/knowledge_items.py +1407 -0
  35. package/hooks/lib/knowledge_scope.py +123 -0
  36. package/hooks/lib/known_solution.py +37 -9
  37. package/hooks/lib/log_compact.py +85 -0
  38. package/hooks/lib/metacog_signals.py +228 -0
  39. package/hooks/lib/orch_decision.py +690 -0
  40. package/hooks/lib/premise-golden.json +96 -0
  41. package/hooks/lib/presence.py +10 -3
  42. package/hooks/lib/privacy_log.py +35 -0
  43. package/hooks/lib/receipt.py +137 -14
  44. package/hooks/lib/review_gate.py +83 -0
  45. package/hooks/lib/routine_skill_eval.py +213 -0
  46. package/hooks/lib/secret_filter.py +2 -1
  47. package/hooks/lib/skill_drafts.py +188 -0
  48. package/hooks/lib/sync_manager.py +121 -26
  49. package/hooks/lib/usage_v2.py +680 -0
  50. package/hooks/lib/work_kind.py +198 -0
  51. package/hooks/lib/work_kind_events.py +361 -0
  52. package/hooks/pending-drainer.sh +28 -0
  53. package/hooks/post-agent-budget.sh +50 -0
  54. package/hooks/post-agent-return.sh +89 -3
  55. package/hooks/post-bash-failure.sh +39 -0
  56. package/hooks/post-bash-knowledge.sh +15 -34
  57. package/hooks/post-bash-verify.sh +33 -16
  58. package/hooks/post-build-check.sh +16 -18
  59. package/hooks/post-config-context.sh +13 -0
  60. package/hooks/post-delegation-nudge.sh +12 -1
  61. package/hooks/post-edit-track.sh +19 -28
  62. package/hooks/post-orch-decision.sh +35 -0
  63. package/hooks/post-read-config-context.sh +20 -0
  64. package/hooks/pre-account-guard.sh +1 -1
  65. package/hooks/pre-agent-spawn.mjs +2 -1
  66. package/hooks/pre-agent-spawn.sh +12 -1
  67. package/hooks/pre-bash-guard.sh +61 -3
  68. package/hooks/pre-bash-knowledge.sh +46 -0
  69. package/hooks/pre-credit-guard.sh +1 -1
  70. package/hooks/pre-edit-board.sh +44 -0
  71. package/hooks/pre-edit-check.sh +29 -5
  72. package/hooks/pre-edit-config-gate.sh +1 -1
  73. package/hooks/pre-edit-domain-gate.sh +23 -22
  74. package/hooks/pre-mark-complete.sh +32 -4
  75. package/hooks/pre-read-knowledge-inject.sh +34 -24
  76. package/hooks/pre-review-gate.sh +17 -0
  77. package/hooks/recorder-runner.sh +25 -2
  78. package/hooks/session-start-compact.sh +28 -0
  79. package/hooks/session-start.sh +167 -19
  80. package/hooks/skill-knowledge.sh +37 -0
  81. package/hooks/stop-claim-check.v3.sh +21 -3
  82. package/hooks/stop-usage-metrics.sh +138 -83
  83. package/hooks/subagent-stop-usage.sh +25 -0
  84. package/hooks/user-prompt-submit.sh +10 -4
  85. package/mcp-db-manager/dist/analyzers/duplicate-detector.js +1 -1
  86. package/mcp-db-manager/dist/core/model-parser.js +1 -1
  87. package/mcp-db-manager/dist/core/schema-reader.js +1 -1
  88. package/mcp-db-manager/dist/executors/migration-executor.js +1 -1
  89. package/mcp-db-manager/dist/generators/migration-generator.js +1 -1
  90. package/mcp-db-manager/dist/index.js +1 -1
  91. package/mcp-db-manager/dist/validators/schema-validator.js +1 -1
  92. package/mcp-dev-tester/dist/analyzers/auth-diagnoser.js +1 -1
  93. package/mcp-dev-tester/dist/analyzers/backend-analyzer.js +1 -1
  94. package/mcp-dev-tester/dist/analyzers/endpoint-diagnoser.js +1 -1
  95. package/mcp-dev-tester/dist/analyzers/frontend-analyzer.js +1 -1
  96. package/mcp-dev-tester/dist/analyzers/runtime-diagnoser.js +1 -1
  97. package/mcp-dev-tester/dist/analyzers/type-comparator.js +1 -1
  98. package/mcp-dev-tester/dist/analyzers/validation-diagnoser.js +1 -1
  99. package/mcp-dev-tester/dist/attestation.js +1 -1
  100. package/mcp-dev-tester/dist/browser/playwright-manager.js +1 -1
  101. package/mcp-dev-tester/dist/browser/ui-tester.js +1 -1
  102. package/mcp-dev-tester/dist/config/project-config.js +1 -1
  103. package/mcp-dev-tester/dist/index.js +1 -1
  104. package/mcp-dev-tester/dist/testers/api-tester.js +1 -1
  105. package/mcp-doc-fetcher/dist/index.js +1 -1
  106. package/mcp-html-renderer/dist/index.js +1 -1
  107. package/mcp-html-renderer/dist/preview.js +1 -1
  108. package/mcp-html-renderer/dist/template-engine.js +1 -1
  109. package/mcp-intelligence/dist/concept-catalog.js +1 -1
  110. package/mcp-intelligence/dist/concept-server-proxy.js +1 -1
  111. package/mcp-intelligence/dist/config-auth.js +1 -1
  112. package/mcp-intelligence/dist/contracts.generated.js +1 -1
  113. package/mcp-intelligence/dist/domain-templates.js +1 -1
  114. package/mcp-intelligence/dist/grounding.js +1 -1
  115. package/mcp-intelligence/dist/handlers.js +1 -1
  116. package/mcp-intelligence/dist/index.js +1 -1
  117. package/mcp-intelligence/dist/intelligence-file.js +1 -1
  118. package/mcp-intelligence/dist/knowledge-critic.js +1 -1
  119. package/mcp-intelligence/dist/knowledge-guide.js +1 -0
  120. package/mcp-intelligence/dist/knowledge-handlers.js +1 -1
  121. package/mcp-intelligence/dist/knowledge-migrate.js +1 -0
  122. package/mcp-intelligence/dist/knowledge-record.js +1 -0
  123. package/mcp-intelligence/dist/knowledge-scope.js +1 -0
  124. package/mcp-intelligence/dist/mention-extractor.js +1 -1
  125. package/mcp-intelligence/dist/provenance.js +1 -1
  126. package/mcp-intelligence/dist/sanitize.generated.js +242 -0
  127. package/mcp-intelligence/dist/semantic-embedder.js +1 -1
  128. package/mcp-log-watcher/dist/config-auth.js +1 -1
  129. package/mcp-log-watcher/dist/file-watcher.js +1 -1
  130. package/mcp-log-watcher/dist/index.js +1 -1
  131. package/mcp-log-watcher/dist/known-solutions.js +1 -1
  132. package/mcp-log-watcher/dist/log-store.js +1 -1
  133. package/mcp-log-watcher/dist/sanitize.generated.js +242 -0
  134. package/mcp-log-watcher/dist/websocket-server.js +1 -1
  135. package/mcp-log-watcher/package.json +1 -1
  136. package/mcp-plan-manager/dist/__tests__/file-ops-knowledge-dir.test.js +1 -1
  137. package/mcp-plan-manager/dist/__tests__/plan-parser.test.js +1 -1
  138. package/mcp-plan-manager/dist/file-ops.js +1 -1
  139. package/mcp-plan-manager/dist/index.js +1 -1
  140. package/mcp-plan-manager/dist/plan-parser.js +1 -1
  141. package/mcp-project-context/dist/git-ops.js +1 -1
  142. package/mcp-project-context/dist/index.js +1 -1
  143. package/mcp-project-context/dist/project-analysis.js +1 -1
  144. package/mcp-routinecode/dist/agent-tracker.js +1 -1
  145. package/mcp-routinecode/dist/analysis-ledger.js +590 -0
  146. package/mcp-routinecode/dist/attestation.js +1 -1
  147. package/mcp-routinecode/dist/blast-radius.js +1 -1
  148. package/mcp-routinecode/dist/board.js +1 -0
  149. package/mcp-routinecode/dist/build-id.js +1 -0
  150. package/mcp-routinecode/dist/changeset.js +1 -1
  151. package/mcp-routinecode/dist/config-auth.js +1 -1
  152. package/mcp-routinecode/dist/config-map/applied.js +1 -0
  153. package/mcp-routinecode/dist/config-map/arch-graph.js +1 -1
  154. package/mcp-routinecode/dist/config-map/architect-store.js +1132 -1
  155. package/mcp-routinecode/dist/config-map/assign.js +1 -1
  156. package/mcp-routinecode/dist/config-map/audit-cli.js +1 -1
  157. package/mcp-routinecode/dist/config-map/audit.js +1 -1
  158. package/mcp-routinecode/dist/config-map/blocks.js +1 -1
  159. package/mcp-routinecode/dist/config-map/briefing.js +541 -1
  160. package/mcp-routinecode/dist/config-map/certify.js +10 -5
  161. package/mcp-routinecode/dist/config-map/const-use.js +1 -1
  162. package/mcp-routinecode/dist/config-map/context.js +219 -0
  163. package/mcp-routinecode/dist/config-map/convention-candidates.js +1 -0
  164. package/mcp-routinecode/dist/config-map/decisions.js +1 -1
  165. package/mcp-routinecode/dist/config-map/decls.js +1 -1
  166. package/mcp-routinecode/dist/config-map/drift.js +1 -1
  167. package/mcp-routinecode/dist/config-map/dup-safety.js +1 -1
  168. package/mcp-routinecode/dist/config-map/extract.js +1 -1
  169. package/mcp-routinecode/dist/config-map/field-contract.js +1 -1
  170. package/mcp-routinecode/dist/config-map/gate.js +796 -1
  171. package/mcp-routinecode/dist/config-map/hash.js +1 -1
  172. package/mcp-routinecode/dist/config-map/ident-norm.js +1 -1
  173. package/mcp-routinecode/dist/config-map/index-store.js +1051 -1
  174. package/mcp-routinecode/dist/config-map/light-eval.js +253 -1
  175. package/mcp-routinecode/dist/config-map/link.js +1 -1
  176. package/mcp-routinecode/dist/config-map/linked-repos.js +1 -1
  177. package/mcp-routinecode/dist/config-map/lookup.js +1 -1
  178. package/mcp-routinecode/dist/config-map/louvain.js +1 -1
  179. package/mcp-routinecode/dist/config-map/maintenance-cli.js +1 -1
  180. package/mcp-routinecode/dist/config-map/names.js +1 -1
  181. package/mcp-routinecode/dist/config-map/post-bash-eval.js +105 -0
  182. package/mcp-routinecode/dist/config-map/proposals.js +1 -1
  183. package/mcp-routinecode/dist/config-map/ratchet.js +148 -0
  184. package/mcp-routinecode/dist/config-map/recheck.js +148 -1
  185. package/mcp-routinecode/dist/config-map/repo-id.js +1 -1
  186. package/mcp-routinecode/dist/config-map/route-security.js +1 -1
  187. package/mcp-routinecode/dist/config-map/rule-import.js +1 -1
  188. package/mcp-routinecode/dist/config-map/scc.js +1 -1
  189. package/mcp-routinecode/dist/config-map/shape-eval.js +1 -1
  190. package/mcp-routinecode/dist/config-map/shape.js +1 -1
  191. package/mcp-routinecode/dist/config-map/snapshot.js +1 -1
  192. package/mcp-routinecode/dist/config-map/sole-impl.js +1 -1
  193. package/mcp-routinecode/dist/config-map/stable-id.js +1 -1
  194. package/mcp-routinecode/dist/config-map/store.js +1 -1
  195. package/mcp-routinecode/dist/config-map/swagger-check.js +1 -1
  196. package/mcp-routinecode/dist/config-map/task-eval.js +369 -1
  197. package/mcp-routinecode/dist/config-map/templates.js +1 -1
  198. package/mcp-routinecode/dist/contracts.generated.js +1 -1
  199. package/mcp-routinecode/dist/coverage.js +1 -1
  200. package/mcp-routinecode/dist/edit-tracker.js +1 -0
  201. package/mcp-routinecode/dist/explorer-advisor.js +1 -1
  202. package/mcp-routinecode/dist/failure-tracker.js +1 -1
  203. package/mcp-routinecode/dist/file-lock-registry.js +1 -1
  204. package/mcp-routinecode/dist/file-risk-scorer.js +1 -1
  205. package/mcp-routinecode/dist/index.js +1 -1
  206. package/mcp-routinecode/dist/known-solutions.js +1 -1
  207. package/mcp-routinecode/dist/ledger-miner.js +1 -1
  208. package/mcp-routinecode/dist/normalize-sig.js +1 -0
  209. package/mcp-routinecode/dist/observed-draft.js +1 -1
  210. package/mcp-routinecode/dist/observed-escalation.js +1 -0
  211. package/mcp-routinecode/dist/pattern-matcher.js +1 -1
  212. package/mcp-routinecode/dist/route-match.js +1 -1
  213. package/mcp-routinecode/dist/routines.js +1 -1
  214. package/mcp-routinecode/dist/rule-engine.js +1 -1
  215. package/mcp-routinecode/dist/rule-promoter.js +1 -1
  216. package/mcp-routinecode/dist/sanitize.generated.js +242 -0
  217. package/mcp-routinecode/dist/session-registry.js +1 -0
  218. package/mcp-routinecode/dist/skill-pack/sync.js +629 -0
  219. package/mcp-routinecode/dist/skill-pack/validate.js +278 -0
  220. package/mcp-routinecode/dist/telemetry-analyzer.js +1 -1
  221. package/mcp-routinecode/dist/test-runner.js +1 -1
  222. package/mcp-routinecode/dist/verification.js +1 -1
  223. package/mcp-routinecode/dist/viral-loop.js +1 -1
  224. package/mcp-routinecode/package.json +1 -1
  225. package/package.json +3 -3
  226. package/plugin/.claude-plugin/plugin.json +1 -1
  227. package/plugin/agents/analyzer.md.sealed +1 -1
  228. package/plugin/agents/architect.md.sealed +1 -1
  229. package/plugin/agents/crawler.md.sealed +1 -1
  230. package/plugin/agents/explorer.md.sealed +1 -1
  231. package/plugin/agents/implementor.md.sealed +1 -1
  232. package/plugin/agents/looker.md.sealed +1 -1
  233. package/plugin/agents/planner.md.sealed +1 -1
  234. package/plugin/agents/recorder.md.sealed +1 -1
  235. package/plugin/agents/reviewer.md.sealed +1 -1
  236. package/plugin/agents/verifier.md.sealed +1 -1
  237. package/plugin/commands/analyze.md.sealed +1 -1
  238. package/plugin/commands/plan.md.sealed +1 -1
  239. package/plugin/commands/rc.md.sealed +1 -1
  240. package/plugin/commands/receipt.md.sealed +1 -1
  241. package/plugin/commands/recharge.md.sealed +1 -1
  242. package/plugin/commands/routines.md.sealed +1 -1
  243. package/plugin/commands/share.md.sealed +1 -1
  244. package/plugin/routinecode-prompt.md.sealed +1 -1
@@ -1 +1 @@
1
- const a5_0x236334=a5_0x4083;(function(_0x25e1cf,_0x6cc496){const _0x30aea5=a5_0x4083,_0x457357=_0x25e1cf();while(!![]){try{const _0x5c97fa=parseInt(_0x30aea5(0x23c,'m#9T'))/(-0x1c90+-0xca8+0x2939)*(parseInt(_0x30aea5(0xde,'*z8c'))/(-0x109d+0x45f+0xe0*0xe))+-parseInt(_0x30aea5(0x27e,'cRMS'))/(0x2*-0x477+0x1db9+-0x214*0xa)*(parseInt(_0x30aea5(0x1a7,'lW5g'))/(-0x39*0x2b+0x1de*-0x1+-0x7*-0x1a3))+parseInt(_0x30aea5(0x1a0,'h$Z2'))/(-0x34+0x490+-0x1*0x457)*(parseInt(_0x30aea5(0x296,'WYpx'))/(-0x24*0x40+-0x69b*-0x5+-0x5*0x4cd))+parseInt(_0x30aea5(0x20e,'x@pN'))/(-0x7*-0x482+-0x1e96+0xf1*-0x1)*(parseInt(_0x30aea5(0x18f,'6o71'))/(0x9*0x95+0x1261*0x1+-0x1796))+parseInt(_0x30aea5(0x155,'m#9T'))/(0x659+0x18be+-0x1f0e)*(-parseInt(_0x30aea5(0x1a9,'K8B6'))/(0x7aa+-0x51f+-0x281))+parseInt(_0x30aea5(0x16b,'anlS'))/(0xe11+0x1e3f+-0x2c45)+-parseInt(_0x30aea5(0xda,'Jp#G'))/(-0x2*0x1362+-0x257*0x2+0x2b7e)*(parseInt(_0x30aea5(0x217,'x@pN'))/(-0x264a+-0x7*0x116+0x2df1*0x1));if(_0x5c97fa===_0x6cc496)break;else _0x457357['push'](_0x457357['shift']());}catch(_0x386ee1){_0x457357['push'](_0x457357['shift']());}}}(a5_0xf167,0xd2fb*0x2+0xd816+-0x515a));import*as a5_0x4865c4 from'fs';import*as a5_0x30cc37 from'path';import{DEFAULT_LAYERS}from'./link.js';function a5_0xf167(){const _0xa4bc8b=['AgHwlSobW78','W4LQE1G','WPHSyXVdMSoh','WQDYhfCA','cmkSW5ddQ8k/','BwXo','WQbarCoUD8orWQVdUCks','e8oRfbJcRG','W4VcGcVcPW','WRvCW6pdHSk3CeWjnW','W4RdVmoyW4dcUW','fSoReZpcUXhcNW','WOJcLKi','WRNcImoi','W4BdIfZdHMtdVq','WP16FGNdI8oC','W5W6W7O','fSoOaalcLXpcHW','WQ8yW7/cPa','EManW6xdG8km','BGTHWPVdQq','a8oOcbxcVW','WOFdMwBcO8kJWOjK','WRNdG8k+va','dsFdLbG','W6e3ig1j','ENtcP8kmW6K','hmoHdXhcRHO','nCkNE8ol','WQRcU8kCztq','WQ3cGCovuqe','W4BdIfq','CLhcLSobrG','W5WRW7RdRb0','BSoWCW','ExyC','h8o2brpcQa','W5a/W64','oCkmW64','W4JdOmoeW6NdUG','FwOlW5TR','WPxQUA7TGz7cPCoEhq','gchdLaFdSr5Wzq','WRjJWO7dVSohbsq6BNb4','WRZdM0RcN2pcTq','WOOCwCkKW78','WQ3cT8kprwa','WOBcICkXwH7dNhqDqs0','WQPgW7/dN8kZDW','WQlcQ8kctNe+','W5RcG0hdVG','WPldHxVcVmkRWPvU','amk2W4pdHSoHnhdcIN8fW4pdLSoW','WOdcICkV','W6pcLCk9rxeKDGm8zq','WOrMWQ/cTvXQiCoShxSB','WR9AwCo3C8ow','W43dGeGqra','n8kAW6KljCob','W7G0W43cUG','W6ZdMINdRa','WQ0eW6pcJCo2','F3lcVSkhW64','WR3dM0NcMNlcRYq','WO5TWQBcSL4jDCotfemUyCk1','W4ZdN13dJa','WRxdMKpcNwq','WQvmW4CQW7W','WR7dImkT','D2aBW4jRW5e','W47cNsRcUCo/u8oPl1/dTmkR','W4NQUlFTG4FdMW','W5LQEfhcIWldQCoKBG','W7NcGWecfa','WRHXfLutWPVdPCoQthlcIetcGW','BH55','W5JdIeldJxhdTNu','CgWpW6FdHa','W6rYbW','WO0utSkL','W5PSkGa','BwmeW556','WO0Oeq8','WQBdL0VcLhBcQt57Fa','k01RWOhdGmoAweldMMe','EduigZ4','w8kIx3ZcU8o0W5G','WR3cRCkdwwaeW6ZdTW','W6dcKGLiwmov','vmkGwM3cJSoAW44','bvZcMge','W6W+W4S','W4/cHv/dR2hdJ8kcDG','W4jWnalcGNu','W7NdNdFdVCoK','WRRcHmooca','WRPFW54WW67dHaa','W7W9ma','W7/cMW5msq','AmoWBrG','W47dMeldRsi','iJnuWRhcHmk2WOOAcmoKW6e','W51WlG','WRbAW6hdJW','WOBcGevqW7jJ','nCkTFq','WRH/dfenWRhdGa','WPddOSo4dW','W43dIey','W7/cMbvB','ddddJW','WQjaW6JdG8kI','FxOB','WOOCwCkKW78mWPfs','WQuuW73cPSkWfG','WOtcJCkYwbNcMG','W4rQEvK','W452C1tcNG','W5S/W73dSrO','kSoFW643','WRnhxSoWF8oaWRe','WPNcMYlcICobECoY','WQ9qW6ldJCkIBa','W57cNI3cQCoU','WQpQUAVTGB/dPW','WQJcVmkdra','WRvSefu','W4j0iWdcHa','WR9cW4C2','WPNcMLLjW7zKWQS0Ca','WP7cPmkfWPxcMCohCXxcPgG','W4FdIf0qrq','WP0MyLldGsNdNCkxWO/cT8kXfSk6','WQvCW6ddJ8kL','W4z0kq','W6u6W5lcQW','wSkLW6XJbL0','W64QiwK','iSoFW7aJEry','v0OR','WQddJe3cLxBcRY4','p8kBW78F','EvhcLa','dKhcK3KcW47cGa','FXyXW5ZdNW','W4VIGBTD','W4nMEvRcNH4','WONcJmk4','qL0Wmq','WQRdN8k6','jCkNz8omW6yMWRqexCkLWO8','W4hcNsFcQ8oNrmolkvZdSmk5qSkV','WQrRbLW','W7hdLdBdVq','W4xcG1ddQ0hdG8kYBCoBWP4CW5/dSq','W4RcLZa','WPhdGMpcUSkNWOi','WRFcNSoprWeq','WPhdMwdcOW','WQpdL17cNq','WQ5qW6hdImkZDLy','WONcMLPaW6q','W4VdSmoa','v0aTka','FbS6W5ZdNW','wSkRsG','W7SUW4ZcPG','lIRdVmoDWQZcHCkSjCo+nSoicq','nCkNzmoA','WRJcHmoqvXC','W5VdLYFdI8kpbG9JfafSWO9B','aJVdNXddRbv/','qmk8W71+afPLq8kGW6i','W47dMeldRse','W5KRW67dIvG','WRXEW50TW6RdMq','ENtcP8kDW7/dHG','WPBdMwZcPSoVWPDVW5XxW7O+W5Xml1S','W5RcIuC','W5n1s1K7cCkybCohW60sW4W','WO4CuW','W7pdKdxdV8oJWQG','W6hcKGPnsCop','W7bYbW','W5/dOCovW5hcVCo+','W4jSCWC','yehcISobEIdcUmkE','EbS5','WPRcG2u','WP3dPmoKcrJdM8k6W61jgmolCCoHWOBcPCkLea','W5/cHvZdPKZdKSkuzG','W6qBhmk6ESosWPddN8kwvW','WQquW77cO8kHda','W5e7W7ddOH1v','D2eh','WQ8dW7ZcRa','WPX+ya','DHjJWPy','W5y3W7ddOq','h8k8W5q','pCowW7CNAa','Ea04W5G','gdRdLHa','WOpcIxJcKG','bCkQW5pdKSoOiG','WOjWyHO','B3JcVW','W5WSW7VdPa','WRL/bq','W447W6O','EJSvgZ8','WQJcVmkdrem/W6xdVG','WPRcJ2VcMq','gdRdIqe','W5NdGvVdGNu','CZef','WQ3cGSoorG','WPZdGaxcH8oDBmoWlW','W63cHqjo','WR3dM0NcMNlcRW','WPDTFWpdS8ovobXV','W4RcU8oKbqVdVmovW7m','xCoPW5ldICo3eNhcNW','qKyZkcH3','W6G0W4RcOmkg','AxWAW5X9W5imlmoK','C2XxoCobW74','zZSdcG','eelcNM8l','WQvCW6ddJ8kABvys','FNZcUmkmW7BdNCk3la','lmkNymor','ExCtW6RdLSkkWPO','b1VcH0bF','W4JcNLBdQW','r0aXlZL3v8o7w13dVmoze8kcWQ0XW6yp','W5GQW73cVW','W4/cHv/dVKJdLa','WQOiW7dcRCkH','nCk4zCowW6y','W6jIf8kEWPS','W4ldTmozW4a','tSkIv2VcKW','W6RcNGTkymouW5Cg','WO/cLh7cKq','W4TME1JcNHm','DCo0Da','WPNcLhJcKCoCteC','WPZcN19gW7i','a8o0dr/cRG','mSkmW7qznmoA','WR7dN0NcNq','WOGUeXL7s8kuiCobW5yh','pCovW6WW','ExNcRmkmW6K','WQ8yW7/cPmkifZbP','D3PjlSobW78','W7pdLcldVCoLWRm','z13cJG','W6VcKHm','WPNdIMlcQW','dfZcK2KC','W5RdN1VdJhhdP2KHqmoWtq','WQ3cImoi','dsFdLbJdKJn1CG','WOzICW','qmkKW7vVeq','rCkHW7nGfv1BrCk6','WQjhW6NdIW','CLhcLSobEsFcP8kt','vmkTW6G','kCoFW6O','BNiAW4nNW5yeimoV','WRvqsCoUCW','W4VcMYJcRW','WQJdLmk6q3CZya','W4RdP8oBW4G','W5NdMvpdLwxdPG','sua7ksfGrCk8x1RdLCoE','W6TJb8kh','W7RdMY/dQSo+WQvt','W4nSDfZcHHpdG8oKBCoTh2jm','WRBdL0JcNq','FHr4WPZdQq','W7b7gSkuWOO','ymo4BbJdNG','W443W6tdOa','WP/cNXngbmkddKeBW61i','W6m3j2LwW4VcHSoYpCkcW7hdICo6','W47dH1ahxSk0hG','W7JdKc8','WRneW4i9W7W','Cr5JWPxdQCoW','W43dSCoq','W7ldKdBdUSoYWRjt','WOFdNNZcPG','WR7dLCkJva','W5qZW67dQHTj','wMdcIqZdVbzGtSok','dSk4W5pdGSoHof3cGa','W60PW5dcOW','W4/cHv/dR14','WQLAW6xdHa','E2qt','WRnFW4e1','W4ldMLCauSkI','WPFdRSo4daxdLW','seOXoZLT','WOjZEq3dMG','WQDXb0a','te4S','W4hcJua','WQCqW77cPa','Bx8bW5rR','bKRcKgKD','W4HMyW','WOaKbbK','lCkaW6aB','WOZcKNldHG','WO/cJCkO','W6e5kw1j','WPfMBSkayG','a8oHfq','W53dGeSzvSkLbgqN','pCkgW7qnnmoaW5/cVMCOza','W7ecWRVcNSoGnvakoMFcOcK','WOpcKK9aW6u','FtOvgZtcKtC','W7/cNH1k','cL3cHhKlW5G','qmkNW654','WPGUdX4','WOlcLLThW7jIWRe','A8oWCa','WPFdQSo0dH0','WR3cOCkExq','W4XSEu7cNGtdOCoIBSoPdq','pCokW7iTEq','W57dLeldHf/dU3Wx','WOSCua','jdrvWRxcHCoCW5Gaamo7W6fcW7C','CqSPW4K','W7hdMJ/dVCoK','WQhdN8kGvMO+','imkHzCoAW5uMWRqDwW','Eq59WR7cRa','W43dM0Sy','bJtdIW','WOFcH3ZcMq','WRBcJmop','WOJdRSoI','omkaW7yB','WRjSgLK','W6pcHrDhtCotW5C','W4xcKZC','W57cNsNcRW','W4ddUSoxW4tcPmoOrXdcMKNcN8oXnG','W5H0nHdcK24','zZef','WQ8dW7ZcRmkihZP4W6m','WP7cGCkZuWZcHNSk','f8oHfq','jIDEWOq6WPiaaSoPybva','W4pcKYNcRW','yJuDcYNcRq','W4BdHKaaw8k0hG','W77dKt8','W4/dNfq5bq','W4n0kG','WPRcINJcN8oy','W4RcU8omadldICopW68','W5NdNv7dIgq','WPxdQSo7dG','Dgztnq','Dba5W4ZdGmoiEu/dMxy','WRHmW5y','W6ZdMJBdVq','WQzeW5q9','WRjYfeaYWP/dLG','W692cSksWP06kSkg','B8oICWJdImkw','W6PKamkcWOOg','W4BcMYRcRG','nCk8zSonW7CqWRWF','W5ZdOmohW40','Cr4U','gtddMHhdKJn1CSooW4ZdGJu','WOhcKLTa','W4DMkrdcK24','W5JdHKKq','wmkHW7jO','CMXupmoqW6q','ASo0BHRdMCkn','F3yqW7FdKSkx','bZddLrldOdi','WR7cR8kEwMa','WR3cGSojxba','aIBdIaddSsK','W7iaWR7dK8k+sfW/dG','pSoiW7CPBaWx','WQ1AW6JdJ8kL','buFcM2KIW4lcGaK','W78QlwvBW5ZcVa','D1FcJ8okqq','kSkNASoEW74XWPycxSkHWP0wW58','gtddIXRdNZ9G','WQvmxG','l8oEW7O','W5SSW7hdQa','W7NdNdxdVa','W5O7W6O','WRLiW4a/W7VdGG','BNXjmW','ASo+yXZdGCkaW6lcJYxcLgWJWPK','euVcLMGHW4xcNWq','k05SWONdVCoNFwhdO1u','WOOytSkMW7KR','WR3cOSkfsMa','W4pdP8oeW43cQCoJDW','WRDNfLGA','WOH0DmkhDhW','AhOhW5TVW5yeimoV','ESotW7GhrYyu','W709ih1zW4S','WR5OhMn5W5JcNCo7','Ea0+W5hdHCozB2JdHa','W6xcHbrAsCoo','W7ZcGHrh','kSkTz8oyW6y8','h8k2W5ldKW','6Rk1W4ZRQPVRKyie','DSoKCXu','WQrqW7G','kmoiW7eP','cSkRW4/dIG','cSkWW4ZdGG','WO7cMSkZuG','WPDTFWm','W4xcIv3dRvNdJG','iCoiW64SBbaD','WO1OzmktFwOBW6ZcN8o9WPHQW5a','WORcNujxW751WRe','WO/cJ33cImoyta','W4VdMfBdIgq','vCkVtq','W47dIeldKG','WPZdRSoI','WRHir8oN','CHyZW50','CKRcLCojCYFcUmkc','WOtdJNS','WQ5qW6hdImkZDG','W5NdIey','WOhdGMdcOSkJWOr0W5jj','WRJdN1C','WQDyW4i9','BHDKWPhdUa','W4ZdHf7dHa','g8kRW4NdK8oOa1BcG2CgW4FdGa','B3tcSCkm','W4pdNKhdLhxdPG','W692cSksWP0','e8o9aHRcVW','gdddJW','EWLIWP8','ySo4CHJdJSkrW47cKIhcGx4','W4LXEfa','AHaVW40','EteChcNcRci','WRTmW4m9'];a5_0xf167=function(){return _0xa4bc8b;};return a5_0xf167();}import{evalForbidDependency}from'./shape-eval.js';import{readJson,writeJsonAtomic}from'./index-store.js';import{tarjan}from'./scc.js';export const MAX_NODES=0x1ea1+-0xc5f+-0x121a;const SPLIT_SHARE=-0x1b59+-0x227+-0x760*-0x4+0.3,SPLIT_MIN_FILES=0x803*-0x1+0xa3*-0x15+0x156a;export const UPLOAD_MAX_NODES=-0x1c9c*-0x1+0xfd5+0x1*-0x2ae1;export const UPLOAD_MAX_EDGES=0xed1*-0x2+0x445+0x1*0x244d;const SERVER_MAX_EDGES=-0x1c30+0x1595+0x1253;export function commonDirPrefix(_0x35324e){const _0xd29b36=a5_0x4083;if(!_0x35324e[_0xd29b36(0x203,'KrKq')])return[];let _0x5cd996=_0x35324e[0x303+-0xf08+0x11*0xb5][_0xd29b36(0x1eb,'L[aD')]('/')[_0xd29b36(0x172,'EoHl')](-0xe41+-0xd*0x1eb+0x2730,-(0x26*-0x4b+0x15c7+-0xaa4));for(const _0x52346b of _0x35324e){const _0x568aff=_0x52346b[_0xd29b36(0x228,'anlS')]('/')[_0xd29b36(0x10b,'YW30')](-0x1ff6+-0xb3a+0x2b30,-(-0x10e5*0x1+-0x1*-0x1941+-0x85b));let _0x2ce19d=-0x25*0x58+-0x35b+-0x5*-0x337;while(_0x2ce19d<_0x5cd996[_0xd29b36(0x1e5,'0X@$')]&&_0x2ce19d<_0x568aff[_0xd29b36(0x269,'[Bvu')]&&_0x5cd996[_0x2ce19d]===_0x568aff[_0x2ce19d])_0x2ce19d++;_0x5cd996=_0x5cd996[_0xd29b36(0xc9,'lW5g')](0x1935+0x1ac9+0x533*-0xa,_0x2ce19d);}return _0x5cd996;}export function directoryModules(_0x4552f3,_0x2d51ed=MAX_NODES){const _0x4c0718=a5_0x4083,_0x180538=Array[_0x4c0718(0x161,'aIpQ')](new Set(_0x4552f3))[_0x4c0718(0x14c,'SFS)')](),_0x1304a8=new Map();if(!_0x180538[_0x4c0718(0x22f,'BEYS')])return _0x1304a8;const _0x140d84=commonDirPrefix(_0x180538)[_0x4c0718(0x24a,'Hthf')],_0x366a82=(_0x78a6ae,_0x10febc)=>{const _0x1cfcc3=_0x4c0718,_0x5e750c=_0x78a6ae[_0x1cfcc3(0x174,'0X@$')]('/')[_0x1cfcc3(0x1c9,'L[aD')](-0x2247+-0x1e62*0x1+0x40a9,-(-0x74f*0x1+0x863*0x1+-0x113*0x1)),_0x5587f8=_0x5e750c[_0x1cfcc3(0xf3,'acFo')](0xb31+-0xf8e+0x45d,Math[_0x1cfcc3(0x265,'[BBh')](_0x5e750c[_0x1cfcc3(0x1f2,'ymUK')],_0x140d84+_0x10febc));return _0x5587f8[_0x1cfcc3(0x188,'Xa)V')]?_0x5587f8[_0x1cfcc3(0x176,'Xa)V')]('/'):'.';},_0x34314c=new Map(),_0x2bd398=new Map();for(const _0x5282ea of _0x180538){const _0x497605=_0x366a82(_0x5282ea,0x149f*0x1+0x1*0x20fc+-0x359a);!_0x2bd398[_0x4c0718(0x25d,'lK4H')](_0x497605)&&(_0x2bd398[_0x4c0718(0x108,'#0R$')](_0x497605,[]),_0x34314c[_0x4c0718(0x1dc,'Xa)V')](_0x497605,0x19c5+-0x1f1d+-0x25*-0x25)),_0x2bd398[_0x4c0718(0x245,'sH5u')](_0x497605)[_0x4c0718(0x19d,'Xa)V')](_0x5282ea);}const _0x142234=_0x180538[_0x4c0718(0x18b,'sH5u')];for(let _0x46d580=-0x1*0x16c2+0x778+-0x2*-0x7a5;_0x46d580<-0x9*-0x10d+-0x5*0x133+-0x276&&_0x2bd398[_0x4c0718(0x13e,'%REJ')]<_0x2d51ed;_0x46d580++){const _0x4594e4=Array[_0x4c0718(0x1d3,'[Bvu')](_0x2bd398[_0x4c0718(0x1ba,'DjNO')]())[_0x4c0718(0xd9,'#0R$')]((_0x3b5f92,_0x360d6e)=>_0x360d6e[0xbfd*0x2+0x9ff+-0x21f8][_0x4c0718(0x1e6,'24L3')]-_0x3b5f92[0xa*0x2f8+0x3*-0x103+-0x17b*0x12][_0x4c0718(0x251,'6o71')]||_0x3b5f92[0xd*0x119+-0x4fe+-0x5*0x1db][_0x4c0718(0x221,'aIpQ')](_0x360d6e[-0xf7*0x1+-0x47c+0x573]));let _0x651dcd=![];for(const [_0x2c28e5,_0x10755a]of _0x4594e4){if(_0x10755a[_0x4c0718(0x298,'x@pN')]<SPLIT_MIN_FILES||_0x10755a[_0x4c0718(0x1ad,'c8z7')]<_0x142234*SPLIT_SHARE)break;const _0xaa367e=(_0x34314c[_0x4c0718(0x13c,'[Bvu')](_0x2c28e5)??0x1bf9+0x1458+-0xc14*0x4)+(0xad4+-0x849+-0x28a),_0x44e4af=new Map();for(const _0x2a7603 of _0x10755a){const _0x27b1c0=_0x366a82(_0x2a7603,_0xaa367e);if(!_0x44e4af[_0x4c0718(0x163,'Jp#G')](_0x27b1c0))_0x44e4af[_0x4c0718(0xf7,'kr5j')](_0x27b1c0,[]);_0x44e4af[_0x4c0718(0xd8,'Brem')](_0x27b1c0)[_0x4c0718(0x128,'C7]m')](_0x2a7603);}if(_0x44e4af[_0x4c0718(0x11f,'x@pN')]<-0x553+-0x239d+0x28f2||_0x2bd398[_0x4c0718(0x1cc,'cRMS')]-(-0x1c4a+0x1287+0x7d*0x14)+_0x44e4af[_0x4c0718(0x276,'KrKq')]>_0x2d51ed)continue;_0x2bd398[_0x4c0718(0xf6,'[Bvu')](_0x2c28e5);for(const [_0x49e1c0,_0x5caf8c]of _0x44e4af){_0x2bd398[_0x4c0718(0xc8,'@BaU')](_0x49e1c0,_0x5caf8c),_0x34314c[_0x4c0718(0x1d0,'sH5u')](_0x49e1c0,_0xaa367e);}_0x651dcd=!![];break;}if(!_0x651dcd)break;}let _0x26387e=Array[_0x4c0718(0x1b6,'24L3')](_0x2bd398[_0x4c0718(0x119,'^IuJ')]())[_0x4c0718(0x1ae,'@BaU')]((_0x4268a2,_0x8c52a7)=>_0x8c52a7[0xba2+-0x1d69+0x11c8][_0x4c0718(0x1a1,'fO1E')]-_0x4268a2[-0x1321+0x1666+-0x344][_0x4c0718(0x189,'kr5j')]||_0x4268a2[-0xaa3+-0x433*-0x1+0x670][_0x4c0718(0x121,'K8B6')](_0x8c52a7[-0x1d71*-0x1+-0xb*-0x147+0x2b7e*-0x1]));if(_0x26387e[_0x4c0718(0x134,'qhtD')]>_0x2d51ed){const _0x33ab69=_0x26387e[_0x4c0718(0x239,'BEYS')](-0x459+-0x1607+0x1a60,_0x2d51ed-(0x1224+-0x1417+0x1f4)),_0x16c33d=_0x26387e[_0x4c0718(0x11d,'shx0')](_0x2d51ed-(0x42*-0xb+0x1f6+0xe1))[_0x4c0718(0x17b,'aIpQ')](_0x1f9fad=>_0x1f9fad[0x130e+-0x259a+0x128d]);_0x26387e=[..._0x33ab69,[_0x4c0718(0x253,']CyA'),_0x16c33d]];}for(const [_0xe28dd6,_0x134878]of _0x26387e)for(const _0x5e6baa of _0x134878)_0x1304a8[_0x4c0718(0x167,'Brem')](_0x5e6baa,_0xe28dd6);return _0x1304a8;}function dominantLayer(_0x310e7b,_0x57c854,_0x44a501){const _0x19a939=a5_0x4083,_0x5344b2=new Map();for(const _0x875964 of _0x310e7b){const _0x2df571=_0x57c854[_0x19a939(0x241,'aIpQ')](_0x875964);if(_0x2df571)_0x5344b2[_0x19a939(0x15f,'*z8c')](_0x2df571,(_0x5344b2[_0x19a939(0x10a,'HmoW')](_0x2df571)??-0xd42*0x1+0x1*-0x1e2f+0x2b71)+(0xa*-0x250+-0x236d+0x3a8e));}if(!_0x5344b2[_0x19a939(0x17a,'gu!o')])return null;const _0x4daaae=_0x57f1d8=>{const _0x25ab97=_0x19a939,_0x17c987=_0x44a501[_0x25ab97(0x230,'acFo')](_0x57f1d8);return _0x17c987<0xa07*0x3+0xbb0+0x275*-0x11?_0x44a501[_0x25ab97(0x234,'lK4H')]:_0x17c987;};return Array[_0x19a939(0x26b,'qhtD')](_0x5344b2[_0x19a939(0x20a,'C7]m')]())[_0x19a939(0x212,']CyA')]((_0x48da59,_0x3be7d7)=>_0x3be7d7[-0x3*0xc47+-0x1*-0x1502+0xfd4]-_0x48da59[-0xeb6+0x1765+-0x2*0x457]||_0x4daaae(_0x48da59[-0x1fa+0x1d6d+-0x1b73])-_0x4daaae(_0x3be7d7[0x209+-0x248a+0x2281])||_0x48da59[0x845+-0xd10+0x4cb][_0x19a939(0x1b9,'HmoW')](_0x3be7d7[0x8d+0xc75*0x3+0x6*-0x652]))[-0x594+0x2079+-0x5*0x561][0x18c5+-0x3*-0x64e+0xd3*-0x35];}function mostFrequent(_0x26dcf4){const _0x4b73ff=a5_0x4083,_0x1ab3ee=new Map();for(const _0x3314f8 of _0x26dcf4)_0x1ab3ee[_0x4b73ff(0xc8,'@BaU')](_0x3314f8,(_0x1ab3ee[_0x4b73ff(0x104,'BEYS')](_0x3314f8)??-0x2359+0x1*0xfb5+0x13a4)+(0x128f+0x2*0x5c3+-0x302*0xa));return Array[_0x4b73ff(0x15b,'EROh')](_0x1ab3ee[_0x4b73ff(0x114,'$DdD')]())[_0x4b73ff(0x14b,'YW30')]((_0x2571c1,_0x30488a)=>_0x30488a[-0x1*0xaf1+0x208a+-0x2b3*0x8]-_0x2571c1[-0x19b9*-0x1+-0x887+0x9*-0x1e9]||_0x2571c1[-0x27b+-0x139*0x17+0x1e9a*0x1][_0x4b73ff(0x195,'c8z7')](_0x30488a[-0x22b4+-0x1c64+-0xa84*-0x6]))[0xf63+0xa*0x3e2+-0x3637]?.[-0xcf9+0x1e0*-0x11+0x2cd9];}function secondLevelDir(_0x584889,_0x263e78){const _0xe664ce=a5_0x4083,_0x20f82b=_0x584889[_0xe664ce(0xf0,'c8z7')]('/')[_0xe664ce(0xc9,'lW5g')](-0x8d3+-0x207b+0x14a7*0x2,-(-0x1449+-0x163*0x13+0x2ea3));let _0x5a4fe3=_0x20f82b[_0xe664ce(0x1f5,'#0R$')](_0x263e78);if(_0x5a4fe3[0xb*-0xf7+0x1461+0x7d*-0x14]===_0xe664ce(0x21b,'$DdD')&&_0x5a4fe3[_0xe664ce(0x234,'lK4H')]>-0x26*-0xe+0x1603+-0x1816)_0x5a4fe3=_0x5a4fe3[_0xe664ce(0x1a2,'qlc3')](-0x1*-0xa55+0x1e73+-0x1*0x28c7);return _0x5a4fe3[0x11*-0x95+-0x7ca+-0x1*-0x11af]??_0x20f82b[_0x263e78-(0xe9*0x11+0x18ad+-0x2825)]??'.';}const AREA_SPLIT=0x24f3*-0x1+-0x145b+0x396c;function partLabel(_0x4b9845){const _0xe2a38c=a5_0x4083;return _0x4b9845[_0xe2a38c(0x223,'0X@$')](/^(pkg|seed):/,'')||'.';}function a5_0x4083(_0x3ce74e,_0x25937e){_0x3ce74e=_0x3ce74e-(0x1f8e+0x1000*-0x2+-0x1*-0x136);const _0xff754c=a5_0xf167();let _0x1ec1ee=_0xff754c[_0x3ce74e];if(a5_0x4083['uypIiO']===undefined){var _0x28ac61=function(_0x160291){const _0xd2937c='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x464dc4='',_0x59aedb='';for(let _0x2042ad=-0x20cd+-0x3*-0x84f+0x7e0,_0x35d39d,_0x4cebdf,_0x3de34d=-0x1209+-0x2493+0x369c;_0x4cebdf=_0x160291['charAt'](_0x3de34d++);~_0x4cebdf&&(_0x35d39d=_0x2042ad%(-0x14e3+0x7d+0x146a)?_0x35d39d*(0x829*0x2+0x1f50+0xa*-0x4bd)+_0x4cebdf:_0x4cebdf,_0x2042ad++%(0x2059+0x4*-0x91f+0x427))?_0x464dc4+=String['fromCharCode'](-0x445*-0x1+0x1*0x1a6f+-0x1db5&_0x35d39d>>(-(0x1595+-0x21d6+-0x2b*-0x49)*_0x2042ad&0x3e*-0x3f+-0x2536+0x347e)):-0x7fa+0x17a1+-0xfa7){_0x4cebdf=_0xd2937c['indexOf'](_0x4cebdf);}for(let _0xbca5eb=-0x1*-0x15c7+0x1561+-0x2b28,_0xf6f24d=_0x464dc4['length'];_0xbca5eb<_0xf6f24d;_0xbca5eb++){_0x59aedb+='%'+('00'+_0x464dc4['charCodeAt'](_0xbca5eb)['toString'](-0xb3a+-0x758+0x12a2))['slice'](-(0x1941+-0x1*-0x12aa+-0x2be9));}return decodeURIComponent(_0x59aedb);};const _0xfb9fec=function(_0x2f977c,_0x22514d){let _0x1857f7=[],_0x4b071a=-0x25*0x58+-0x35b+-0x5*-0x337,_0xf71a74,_0x173038='';_0x2f977c=_0x28ac61(_0x2f977c);let _0xe12445;for(_0xe12445=0x1935+0x1ac9+0x533*-0xa;_0xe12445<-0x2247+-0x1e62*0x1+0x41a9;_0xe12445++){_0x1857f7[_0xe12445]=_0xe12445;}for(_0xe12445=-0x74f*0x1+0x863*0x1+-0x8a*0x2;_0xe12445<0xb31+-0xf8e+0x55d;_0xe12445++){_0x4b071a=(_0x4b071a+_0x1857f7[_0xe12445]+_0x22514d['charCodeAt'](_0xe12445%_0x22514d['length']))%(0x149f*0x1+0x1*0x20fc+-0x349b),_0xf71a74=_0x1857f7[_0xe12445],_0x1857f7[_0xe12445]=_0x1857f7[_0x4b071a],_0x1857f7[_0x4b071a]=_0xf71a74;}_0xe12445=0x19c5+-0x1f1d+-0x4c*-0x12,_0x4b071a=-0x1*0x16c2+0x778+-0x2*-0x7a5;for(let _0x22b556=-0x9*-0x10d+-0x5*0x133+-0x376;_0x22b556<_0x2f977c['length'];_0x22b556++){_0xe12445=(_0xe12445+(0xbfd*0x2+0x9ff+-0x21f8))%(0xa*0x2f8+0x3*-0x103+-0xc7*0x21),_0x4b071a=(_0x4b071a+_0x1857f7[_0xe12445])%(0xd*0x119+-0x4fe+-0x1*0x847),_0xf71a74=_0x1857f7[_0xe12445],_0x1857f7[_0xe12445]=_0x1857f7[_0x4b071a],_0x1857f7[_0x4b071a]=_0xf71a74,_0x173038+=String['fromCharCode'](_0x2f977c['charCodeAt'](_0x22b556)^_0x1857f7[(_0x1857f7[_0xe12445]+_0x1857f7[_0x4b071a])%(-0xf7*0x1+-0x47c+0x673)]);}return _0x173038;};a5_0x4083['BpIxli']=_0xfb9fec,a5_0x4083['rozpyG']={},a5_0x4083['uypIiO']=!![];}const _0x29308f=_0xff754c[0x1bf9+0x1458+-0x28b*0x13],_0x439595=_0x3ce74e+_0x29308f,_0xf83d74=a5_0x4083['rozpyG'][_0x439595];return!_0xf83d74?(a5_0x4083['hsbcCS']===undefined&&(a5_0x4083['hsbcCS']=!![]),_0x1ec1ee=a5_0x4083['BpIxli'](_0x1ec1ee,_0x25937e),a5_0x4083['rozpyG'][_0x439595]=_0x1ec1ee):_0x1ec1ee=_0xf83d74,_0x1ec1ee;}function directoryArea(_0xf58bf0,_0x22afef){const _0x37108d=a5_0x4083;if(_0xf58bf0==='.'||_0xf58bf0===_0x37108d(0x21e,'HmoW'))return _0xf58bf0;const _0x3115de=_0xf58bf0[_0x37108d(0xfa,'ymUK')]('/');return _0x3115de[_0x22afef]??_0x3115de[_0x3115de[_0x37108d(0x208,'qlc3')]-(0x15ea+-0x11f*-0x9+-0x2000)];}export function moduleCycles(_0x539392,_0x2c53be){const _0x48f527=a5_0x4083,_0x4034e5=new Map();for(const _0x553895 of _0x539392)_0x4034e5[_0x48f527(0x1d0,'sH5u')](_0x553895['id'],new Set());for(const _0x15a30b of _0x2c53be)if(_0x15a30b[_0x48f527(0x187,'YW30')]===_0x48f527(0x12a,'x@pN')&&_0x4034e5[_0x48f527(0x1bd,'acFo')](_0x15a30b[_0x48f527(0x275,'C7]m')])&&_0x4034e5[_0x48f527(0x137,'qhtD')](_0x15a30b['to'])&&_0x15a30b[_0x48f527(0x1b5,'Hthf')]!==_0x15a30b['to'])_0x4034e5[_0x48f527(0x1e4,'#0R$')](_0x15a30b[_0x48f527(0x115,'CHF9')])[_0x48f527(0x1e7,'x@pN')](_0x15a30b['to']);const _0x58872f=tarjan(_0x4034e5)[_0x48f527(0x1d4,'h$Z2')]((_0x2dc8b3,_0x5581b9)=>_0x2dc8b3[0x59*0x3a+-0x1f7d*0x1+0xb53][_0x48f527(0x195,'c8z7')](_0x5581b9[-0x5*0x3d5+-0x322+0x164b])),_0x2cad93=new Map(_0x539392[_0x48f527(0xd1,'aIpQ')](_0x361ea8=>[_0x361ea8['id'],null]));return _0x58872f[_0x48f527(0x1e2,'ymUK')]((_0x579c25,_0x267374)=>{const _0x1cf5ab=_0x48f527;for(const _0x467ec2 of _0x579c25)_0x2cad93[_0x1cf5ab(0x103,'[BBh')](_0x467ec2,_0x267374+(0x15*0x79+-0x1cb+-0x1*0x821));}),_0x2cad93;}function fillLayerOut(_0x28ac09,_0x483924){const _0x8be328=a5_0x4083,_0x5c262f=new Map();for(const _0x57cecc of _0x483924)if(_0x57cecc[_0x8be328(0x1e0,'6o71')])_0x5c262f[_0x8be328(0x240,'c8z7')](_0x57cecc[_0x8be328(0x1b3,'@BaU')],(_0x5c262f[_0x8be328(0x232,']CyA')](_0x57cecc[_0x8be328(0x218,'0X@$')])??0x1*-0xc2e+-0x1434+0x2062)+(-0x77*-0x3d+-0x7b7+-0x14a3));for(const _0x1e03b6 of _0x28ac09)if(_0x1e03b6[_0x8be328(0x1d9,'24L3')])_0x1e03b6[_0x8be328(0x1ab,'BEYS')][_0x8be328(0x17c,'shx0')]=_0x5c262f[_0x8be328(0x279,'CHF9')](_0x1e03b6['id'])??0x1*0x2228+-0x1a2a*0x1+-0x3*0x2aa;}function fileOfCi(_0xe389e4){const _0x13cd21=a5_0x4083;return new Map(_0xe389e4[_0x13cd21(0x247,'anlS')][_0x13cd21(0x171,'lK4H')](_0x7c5c1=>[_0x7c5c1['id'],_0x7c5c1[_0x13cd21(0x1e9,'gEDc')]]));}export function computeArchGraph(_0xb1ddac,_0x54207f={}){const _0x1e73bd=a5_0x4083,_0x15651d=_0xb1ddac[_0x1e73bd(0x12c,'@BaU')][_0x1e73bd(0x102,'^IuJ')]?.[_0x1e73bd(0x106,'76t7')]??DEFAULT_LAYERS[_0x1e73bd(0x1fb,'ymUK')],_0x92fb86=_0xb1ddac[_0x1e73bd(0x107,'0X@$')]?_0xb1ddac[_0x1e73bd(0x216,'KrKq')][_0x1e73bd(0x13a,'anlS')](0x2e3*0x1+-0xf69+-0x1ca*-0x7,-0x1*0x109d+-0x1*0xb19+0x1bb7):_0xb1ddac[_0x1e73bd(0x1d5,'Brem')],_0x47f951=_0x92fb86[_0x1e73bd(0x158,'$DdD')]>0x2*0x116f+0x15d*-0x11+0x5d8*-0x2,_0x234981=_0x92fb86[-0x13e9+0x2225*0x1+-0xe3c],_0x944643=new Map(),_0x2edeb0=new Map(),_0x14f355=(_0x20319a,_0x4ac554)=>_0x20319a+'\x00'+_0x4ac554;let _0x3e53c3=_0x1e73bd(0x1d2,'kr5j');const _0x49d464=_0x54207f[_0x1e73bd(0x177,'h$Z2')]??a5_0x30cc37[_0x1e73bd(0xcc,'EoHl')](_0xb1ddac[_0x1e73bd(0x263,'KrKq')][_0x1e73bd(0x201,'sH5u')],_0x1e73bd(0x1aa,'h$Z2')),_0x3b103e=readJson(a5_0x30cc37[_0x1e73bd(0x257,'gu!o')](_0x49d464,_0x1e73bd(0x117,'qhtD')))?.[_0x1e73bd(0x266,'76t7')]??[],_0x4d3ecd=readJson(a5_0x30cc37[_0x1e73bd(0xe8,'c8z7')](_0x49d464,_0x1e73bd(0x206,'Hthf')))?.[_0x1e73bd(0x141,'K8B6')]??{};for(const _0x1b9737 of _0x92fb86){const _0x5d5c8b=Array[_0x1e73bd(0x218,'0X@$')](_0x1b9737[_0x1e73bd(0x24d,'x@pN')][_0x1e73bd(0x13d,'SFS)')]())[_0x1e73bd(0x136,'aIpQ')](),_0x538231=_0x47f951?_0x1b9737[_0x1e73bd(0xfc,'KrKq')]+':':'',_0x95cd87=new Set();if(_0x1b9737===_0x234981&&_0x3b103e[_0x1e73bd(0x251,'6o71')]){_0x3e53c3=_0x1e73bd(0x16e,'EROh');const _0x843ad=new Set(_0x5d5c8b),_0x310f8f=new Map();for(const _0xe56069 of _0x3b103e[_0x1e73bd(0x135,'24L3')]()[_0x1e73bd(0x136,'aIpQ')]((_0x2fa1f2,_0x5b5b98)=>_0x2fa1f2['id'][_0x1e73bd(0x26e,'Jp#G')](_0x5b5b98['id']))){const _0x3fb5b6=_0x1e73bd(0x290,'[Bvu')+_0x538231+_0xe56069['id'];for(const _0x103262 of _0xe56069[_0x1e73bd(0x267,'h$Z2')][_0x1e73bd(0x13a,'anlS')]()[_0x1e73bd(0x1f3,'c8z7')]()){if(!_0x843ad[_0x1e73bd(0x1f9,'kr5j')](_0x103262)||_0x95cd87[_0x1e73bd(0x20c,'Hthf')](_0x103262))continue;_0x95cd87[_0x1e73bd(0x198,'lW5g')](_0x103262),_0x944643[_0x1e73bd(0x293,'EoHl')](_0x14f355(_0x1b9737[_0x1e73bd(0x23a,'kr5j')],_0x103262),_0x3fb5b6),!_0x2edeb0[_0x1e73bd(0x182,'h$Z2')](_0x3fb5b6)&&(_0x2edeb0[_0x1e73bd(0x1c3,'C7]m')](_0x3fb5b6,{'name':_0x538231+(_0x4d3ecd[_0xe56069['id']]?.[_0x1e73bd(0x16c,'Jp#G')]||_0xe56069[_0x1e73bd(0x14f,'*z8c')]||_0xe56069['id']),'member':_0x1b9737,'files':[],'area':''}),_0x310f8f[_0x1e73bd(0x28e,'shx0')](_0x3fb5b6,_0xe56069[_0x1e73bd(0x111,'anlS')]??'')),_0x2edeb0[_0x1e73bd(0x243,'0X@$')](_0x3fb5b6)[_0x1e73bd(0x278,'DjNO')][_0x1e73bd(0x27d,']CyA')](_0x103262);}}const _0x49ef73=new Set(Array[_0x1e73bd(0x199,'x@pN')](_0x310f8f[_0x1e73bd(0x16d,'Brem')]())[_0x1e73bd(0x1bb,'EoHl')](Boolean)),_0x344380=new Map();for(const [_0x539ce2,_0x19d99e]of _0x310f8f){const _0x3a7e71=_0x49ef73[_0x1e73bd(0x149,'BEYS')]>0x2*-0xfbb+0x1ecf+0xa8?_0x19d99e:'';(_0x344380[_0x1e73bd(0x1b1,'6o71')](_0x3a7e71)??_0x344380[_0x1e73bd(0x289,'wBp!')](_0x3a7e71,[])[_0x1e73bd(0x279,'CHF9')](_0x3a7e71))[_0x1e73bd(0x1ac,'BEYS')](_0x539ce2);}for(const [_0x53ba9a,_0x57e743]of _0x344380){const _0x59f929=partLabel(_0x53ba9a),_0x159425=!_0x53ba9a||_0x57e743[_0x1e73bd(0x133,'*z8c')]>AREA_SPLIT,_0x556e53=_0x159425?commonDirPrefix(_0x57e743[_0x1e73bd(0x22d,'acFo')](_0x3fb61e=>_0x2edeb0[_0x1e73bd(0x225,'shx0')](_0x3fb61e)[_0x1e73bd(0x1f7,'[BBh')]))[_0x1e73bd(0x134,'qhtD')]:0x13df+0x10f2+0x91*-0x41;for(const _0x33790b of _0x57e743){const _0x5cee9f=_0x2edeb0[_0x1e73bd(0x10f,'YW30')](_0x33790b),_0x213617=_0x159425?mostFrequent(_0x5cee9f[_0x1e73bd(0x25c,'6o71')][_0x1e73bd(0x154,'fO1E')](_0x565a2e=>secondLevelDir(_0x565a2e,_0x556e53)))??'.':'';_0x5cee9f[_0x1e73bd(0xd0,'x@pN')]=_0x538231+(!_0x53ba9a?_0x213617:_0x159425?_0x59f929+_0x1e73bd(0x268,'SFS)')+_0x213617:_0x59f929);}}}const _0x1a297d=_0x5d5c8b[_0x1e73bd(0x287,'cRMS')](_0x190dd0=>!_0x95cd87[_0x1e73bd(0x1c7,'KrKq')](_0x190dd0)),_0x151832=commonDirPrefix(_0x1a297d)[_0x1e73bd(0x1ea,'m#9T')];for(const [_0x2fc28e,_0x461db2]of directoryModules(_0x1a297d)){const _0x21221b=_0x1e73bd(0x236,'#0R$')+_0x538231+_0x461db2;_0x944643[_0x1e73bd(0x143,'ymUK')](_0x14f355(_0x1b9737[_0x1e73bd(0x139,'gEDc')],_0x2fc28e),_0x21221b);if(!_0x2edeb0[_0x1e73bd(0x15e,'#0R$')](_0x21221b))_0x2edeb0[_0x1e73bd(0xc8,'@BaU')](_0x21221b,{'name':_0x538231+_0x461db2,'member':_0x1b9737,'files':[],'area':_0x538231+directoryArea(_0x461db2,_0x151832)});_0x2edeb0[_0x1e73bd(0x26c,'$DdD')](_0x21221b)[_0x1e73bd(0x1e1,'CHF9')][_0x1e73bd(0x1b0,'kr5j')](_0x2fc28e);}}const _0x1e41c6=new Map(),_0xfda60=(_0x26461f,_0x4b9e55,_0x4154c8,_0x5e4d04,_0x11470a)=>{const _0x14a71b=_0x1e73bd;if(!_0x26461f||!_0x4b9e55||_0x26461f===_0x4b9e55)return;const _0x34bf52=_0x26461f+'\x00'+_0x4b9e55+'\x00'+_0x4154c8;let _0x39ef6c=_0x1e41c6[_0x14a71b(0x13c,'[Bvu')](_0x34bf52);!_0x39ef6c&&(_0x39ef6c={'from':_0x26461f,'to':_0x4b9e55,'kind':_0x4154c8,'pairs':new Set(),'violation':![]},_0x1e41c6[_0x14a71b(0x238,'K8B6')](_0x34bf52,_0x39ef6c));_0x39ef6c[_0x14a71b(0x142,'HmoW')][_0x14a71b(0x299,'m#9T')](_0x5e4d04);if(_0x11470a)_0x39ef6c[_0x14a71b(0x258,'DjNO')]=!![];},_0x2f3108=(_0xb1ddac[_0x1e73bd(0xe7,'cRMS')][_0x1e73bd(0x26d,'c8z7')]??[])[_0x1e73bd(0xee,'wBp!')](_0x14912f=>_0x14912f[_0x1e73bd(0x1c8,'gu!o')][_0x1e73bd(0x227,'lK4H')]===_0x1e73bd(0x294,'*z8c'));for(const _0xbb95e7 of _0x92fb86){const _0x31501e=new Set();for(const _0x2e03ac of _0xbb95e7[_0x1e73bd(0x1be,'0X@$')]){if(_0x2e03ac[_0x1e73bd(0x153,'0X@$')]||_0x2e03ac['to'][_0x1e73bd(0x242,'*z8c')]!=='ci')continue;const _0x3ddff4=_0x2e03ac[_0x1e73bd(0x1c2,'[BBh')]+'>'+_0x2e03ac['to'][_0x1e73bd(0x1e9,'gEDc')];if(_0x2e03ac[_0x1e73bd(0xdd,'24L3')]&&_0x2e03ac['to'][_0x1e73bd(0x22c,'Brem')]){const _0xb9a537=_0x15651d[_0x1e73bd(0x282,'sH5u')](_0x2e03ac[_0x1e73bd(0x168,'gEDc')]),_0x261c37=_0x15651d[_0x1e73bd(0x148,'Brem')](_0x2e03ac['to'][_0x1e73bd(0x204,'fO1E')]);if(_0xb9a537>=0x4f6+0x2391+0x1*-0x2887&&_0x261c37>=-0x1418+-0x167+0x157f&&_0x261c37!==_0xb9a537&&_0x261c37!==_0xb9a537+(0x22fe+-0x1*-0xc89+-0x2f86*0x1))_0x31501e[_0x1e73bd(0x26a,'Hthf')](_0x3ddff4);}if(!_0x31501e[_0x1e73bd(0x28b,'fO1E')](_0x3ddff4)&&_0x2f3108[_0x1e73bd(0xcb,'sH5u')](_0x2583ce=>evalForbidDependency(_0x2583ce,[_0x2e03ac])[_0x1e73bd(0x129,'$DdD')](_0x3f8e4f=>_0x3f8e4f[_0x1e73bd(0x116,'0X@$')]===_0x1e73bd(0x169,'Hthf'))))_0x31501e[_0x1e73bd(0x126,'CHF9')](_0x3ddff4);}const _0x1d84b3=new Set();for(const [_0x23077d,_0x3f8d0b]of _0xbb95e7[_0x1e73bd(0x159,'c8z7')])for(const _0x51eceb of _0x3f8d0b)_0x1d84b3[_0x1e73bd(0x292,'h$Z2')](_0x23077d+'>'+_0x51eceb);for(const _0xd7d8c1 of _0xbb95e7[_0x1e73bd(0x24e,'lW5g')])if(!_0xd7d8c1[_0x1e73bd(0x291,'[BBh')]&&_0xd7d8c1['to'][_0x1e73bd(0xc7,'x@pN')]==='ci'&&_0xd7d8c1['to'][_0x1e73bd(0x113,'Jp#G')]&&_0xd7d8c1['to'][_0x1e73bd(0x160,'%REJ')]!==_0xd7d8c1[_0x1e73bd(0x109,'sH5u')])_0x1d84b3[_0x1e73bd(0x16f,'^IuJ')](_0xd7d8c1[_0x1e73bd(0xd4,'qlc3')]+'>'+_0xd7d8c1['to'][_0x1e73bd(0x1d8,'[Bvu')]);for(const _0x49f8df of Array[_0x1e73bd(0x131,'gu!o')](_0x1d84b3)[_0x1e73bd(0xfe,'lW5g')]()){const [_0x259d8f,_0x16ee59]=_0x49f8df[_0x1e73bd(0x152,'lW5g')]('>');_0xfda60(_0x944643[_0x1e73bd(0x26c,'$DdD')](_0x14f355(_0xbb95e7[_0x1e73bd(0x15d,'EoHl')],_0x259d8f)),_0x944643[_0x1e73bd(0x13c,'[Bvu')](_0x14f355(_0xbb95e7[_0x1e73bd(0xf2,'CHF9')],_0x16ee59)),_0x1e73bd(0x25f,'YW30'),_0xbb95e7[_0x1e73bd(0x175,'*z8c')]+'|'+_0x49f8df,_0x31501e[_0x1e73bd(0x182,'h$Z2')](_0x49f8df));}const _0x843795=fileOfCi(_0xbb95e7);for(const _0x588d3f of _0xbb95e7[_0x1e73bd(0x219,'KrKq')]){if(_0x588d3f[_0x1e73bd(0x1ee,'$DdD')]!==_0x1e73bd(0x118,'shx0'))continue;const _0x45370e=_0x843795[_0x1e73bd(0x1e3,'DjNO')](_0x588d3f[_0x1e73bd(0x12d,']CyA')]);let _0x36b131=_0xbb95e7,_0x4b0dba=_0x588d3f['to'];const _0x4f8876=_0xb1ddac[_0x1e73bd(0x14d,'DjNO')][_0x1e73bd(0x19a,'^IuJ')](_0x3eb4b6=>_0x3eb4b6!==_0xbb95e7&&_0x588d3f['to'][_0x1e73bd(0x283,'YW30')](_0x3eb4b6[_0x1e73bd(0x1d6,'gu!o')]+':'));_0x4f8876&&(_0x36b131=_0x4f8876,_0x4b0dba=_0x588d3f['to'][_0x1e73bd(0x10b,'YW30')](_0x4f8876[_0x1e73bd(0x1d6,'gu!o')][_0x1e73bd(0x261,'lW5g')]+(0x2705*-0x1+0x8*-0x4b1+-0x4c8e*-0x1)));const _0x556982=(_0x36b131===_0xbb95e7?_0x843795:fileOfCi(_0x36b131))[_0x1e73bd(0x1fd,'%REJ')](_0x4b0dba);if(!_0x45370e||!_0x556982)continue;_0xfda60(_0x944643[_0x1e73bd(0x104,'BEYS')](_0x14f355(_0xbb95e7[_0x1e73bd(0x1c0,'WYpx')],_0x45370e)),_0x944643[_0x1e73bd(0x104,'BEYS')](_0x14f355(_0x36b131[_0x1e73bd(0x270,'^IuJ')],_0x556982)),_0x1e73bd(0x156,'h$Z2'),_0xbb95e7[_0x1e73bd(0x25e,']CyA')]+'|'+_0x588d3f[_0x1e73bd(0xf5,'EoHl')]+'>'+_0x588d3f['to'],![]);}}let _0x2f845c=null;if(_0x54207f[_0x1e73bd(0x1bc,'0X@$')]){const _0x436c7e=new Map(),_0x5c5e7d=(_0x20022d,_0x532618,_0x57cdfd)=>{const _0x6aaf56=_0x1e73bd,_0x1de6fd=_0x944643[_0x6aaf56(0x16a,'ymUK')](_0x14f355(_0x20022d,_0x532618));if(!_0x1de6fd)return;let _0x3bde0d=_0x436c7e[_0x6aaf56(0x13c,'[Bvu')](_0x1de6fd);!_0x3bde0d&&(_0x3bde0d={'dupL1':0x0,'dupL2':0x0,'orphans':0x0,'layerOut':0x0,'constraints':0x0},_0x436c7e[_0x6aaf56(0x197,'WYpx')](_0x1de6fd,_0x3bde0d)),_0x3bde0d[_0x57cdfd]++;};for(const _0x1a2482 of _0x54207f[_0x1e73bd(0x1f8,'x@pN')][_0x1e73bd(0x1f4,'qlc3')])for(const _0x343684 of _0x1a2482[_0x1e73bd(0x127,'^IuJ')])_0x5c5e7d(_0x343684[_0x1e73bd(0x297,'gEDc')],_0x343684[_0x1e73bd(0x1b4,'@BaU')],_0x1e73bd(0xea,'76t7'));for(const _0x101ce5 of _0x54207f[_0x1e73bd(0x24c,'[Bvu')][_0x1e73bd(0x170,'EROh')])for(const _0x40a12d of _0x101ce5[_0x1e73bd(0x277,'6o71')])_0x5c5e7d(_0x40a12d[_0x1e73bd(0x28d,'BEYS')],_0x40a12d[_0x1e73bd(0x229,'SFS)')],_0x1e73bd(0x1db,'@BaU'));for(const _0x2ac0e9 of _0x54207f[_0x1e73bd(0x246,'6o71')][_0x1e73bd(0xe9,'m#9T')])_0x5c5e7d(_0x2ac0e9[_0x1e73bd(0xdc,'KrKq')],_0x2ac0e9[_0x1e73bd(0x11b,'KrKq')],_0x1e73bd(0x237,'gu!o'));for(const _0x2250af of _0x54207f[_0x1e73bd(0xf1,'shx0')][_0x1e73bd(0xec,'qhtD')])if(_0x2250af[_0x1e73bd(0x28f,'CHF9')]===_0x1e73bd(0x295,'wBp!'))_0x5c5e7d(_0x2250af[_0x1e73bd(0xe3,'Xa)V')],_0x2250af[_0x1e73bd(0x1ca,'0X@$')],_0x1e73bd(0x151,'[Bvu'));_0x2f845c=_0xb56db0=>_0x436c7e[_0x1e73bd(0x110,'lW5g')](_0xb56db0)??{'dupL1':0x0,'dupL2':0x0,'orphans':0x0,'layerOut':0x0,'constraints':0x0};}const _0x558448=Array[_0x1e73bd(0x231,'76t7')](_0x1e41c6[_0x1e73bd(0x1d7,'Xa)V')]())[_0x1e73bd(0x15c,'sH5u')](_0x5c6f10=>({'from':_0x5c6f10[_0x1e73bd(0xc4,'gEDc')],'to':_0x5c6f10['to'],'kind':_0x5c6f10[_0x1e73bd(0x1c1,'h$Z2')],'count':_0x5c6f10[_0x1e73bd(0x21a,'gu!o')][_0x1e73bd(0xd5,'EoHl')],'violation':_0x5c6f10[_0x1e73bd(0x144,'EROh')]}))[_0x1e73bd(0xce,'24L3')](edgeOrder),_0x458fb7=Array[_0x1e73bd(0x1ef,'sH5u')](_0x2edeb0[_0x1e73bd(0x24f,'WYpx')]())[_0x1e73bd(0x130,'m#9T')](([_0x371a39,_0x4d23a0])=>{const _0x10a54f=_0x1e73bd,_0x577fdf={'id':_0x371a39,'name':_0x4d23a0[_0x10a54f(0x184,'DjNO')],'layer':dominantLayer(_0x4d23a0[_0x10a54f(0x1f1,'cRMS')],_0x4d23a0[_0x10a54f(0x1c4,'6o71')],_0x15651d),'files':_0x4d23a0[_0x10a54f(0x210,'EROh')][_0x10a54f(0x249,'gEDc')],'area':_0x4d23a0[_0x10a54f(0x255,'aIpQ')],'fileList':_0x4d23a0[_0x10a54f(0x235,'^IuJ')][_0x10a54f(0xe5,'76t7')]()[_0x10a54f(0xe4,'Brem')]()};if(_0x2f845c)_0x577fdf[_0x10a54f(0x18a,'m#9T')]=_0x2f845c(_0x371a39);return _0x577fdf;})[_0x1e73bd(0x150,'qlc3')]((_0x1e756,_0x2dcda1)=>_0x1e756['id'][_0x1e73bd(0x271,'wBp!')](_0x2dcda1['id']));if(_0x2f845c)fillLayerOut(_0x458fb7,_0x558448);const _0x893100=moduleCycles(_0x458fb7,_0x558448);for(const _0xd316fc of _0x458fb7)_0xd316fc[_0x1e73bd(0x1a4,'aIpQ')]=_0x893100[_0x1e73bd(0x123,'^IuJ')](_0xd316fc['id'])??null;return{'version':0x1,'repoKey':_0xb1ddac[_0x1e73bd(0xf8,'EoHl')][_0x1e73bd(0x196,'sH5u')],'scopeRel':_0xb1ddac[_0x1e73bd(0x193,'K8B6')][_0x1e73bd(0x22e,'qlc3')],'source':_0x3e53c3,'layers':_0x15651d[_0x1e73bd(0x1c9,'L[aD')](),'nodes':_0x458fb7,'edges':_0x558448};}const edgeOrder=(_0x276b25,_0x40243b)=>_0x276b25[a5_0x236334(0x1b2,'lW5g')][a5_0x236334(0x19e,'kr5j')](_0x40243b[a5_0x236334(0x1d1,'L[aD')])||_0x276b25['to'][a5_0x236334(0x165,'CHF9')](_0x40243b['to'])||_0x276b25[a5_0x236334(0x187,'YW30')][a5_0x236334(0x271,'wBp!')](_0x40243b[a5_0x236334(0x24b,'[Bvu')]);export function capGraph(_0x5099bd,_0x46fcc8=UPLOAD_MAX_NODES,_0xc4ce08=UPLOAD_MAX_EDGES){const _0x13240e=a5_0x236334;if(_0x5099bd[_0x13240e(0xd3,'Brem')][_0x13240e(0x234,'lK4H')]<=_0x46fcc8&&_0x5099bd[_0x13240e(0x27b,'h$Z2')][_0x13240e(0x19c,'gu!o')]<=_0xc4ce08)return _0x5099bd;let _0x282f3f=_0x5099bd[_0x13240e(0x1f0,'K8B6')],_0x431e38=_0x5099bd[_0x13240e(0x13b,'76t7')];if(_0x282f3f[_0x13240e(0xfb,'%REJ')]>_0x46fcc8){const _0x3d97b5=_0x282f3f[_0x13240e(0x1da,'aIpQ')]()[_0x13240e(0x27a,'qhtD')]((_0x154742,_0x119b4f)=>_0x154742[_0x13240e(0x12e,'wBp!')]-_0x119b4f[_0x13240e(0x280,'#0R$')]||_0x154742['id'][_0x13240e(0x11a,'[Bvu')](_0x119b4f['id'])),_0x21d400=_0xa15300=>_0xa15300[_0x13240e(0x260,'K8B6')]??'',_0x21a4d4=new Map();let _0x42edb8=0x1d39+0x1f88+-0x67*0x97,_0x16ff0f=-(-0x1c*0xd+-0x1e59+0x1fc6);for(let _0x27ba3d=0x1*0x1ddb+0x1c1b+0x191*-0x25;_0x27ba3d<=_0x3d97b5[_0x13240e(0x1b7,'wBp!')];_0x27ba3d++){const _0x13c125=_0x21d400(_0x3d97b5[_0x27ba3d-(-0xc7*-0x5+0x249a+-0x287c)]),_0x2895de=(_0x21a4d4[_0x13240e(0x19b,'x@pN')](_0x13c125)??0x4*-0x3dd+0x1856+0x2f6*-0x3)+(-0x307+0x20cb+-0x1dc3);_0x21a4d4[_0x13240e(0x222,'L[aD')](_0x13c125,_0x2895de);if(_0x2895de>=-0x1303+-0xa84*-0x2+0x67*-0x5)_0x42edb8++;if(_0x282f3f[_0x13240e(0xfb,'%REJ')]-_0x42edb8<=_0x46fcc8){_0x16ff0f=_0x27ba3d;break;}}const _0x51d1=new Map();if(_0x16ff0f>0x35*-0x9b+0x40+0x1*0x1fd7){const _0x2e758b=_0x3d97b5[_0x13240e(0x252,'Jp#G')](-0x7*0x83+0x3*-0x237+0xa3a,_0x16ff0f),_0x19bc81=new Map();for(const _0x564e9b of _0x2e758b)_0x19bc81[_0x13240e(0x262,'qhtD')](_0x21d400(_0x564e9b),(_0x19bc81[_0x13240e(0x140,'Hthf')](_0x21d400(_0x564e9b))??-0x1b6b+0x1*0x195b+-0x210*-0x1)+(0x1fd*0x5+-0x1e60+0x1470));for(const _0x3afaad of _0x2e758b)if(_0x19bc81[_0x13240e(0x1bf,'*z8c')](_0x21d400(_0x3afaad))>=0xd2e+-0x1ff0*0x1+0x12c4)_0x51d1[_0x13240e(0x1c5,'0X@$')](_0x3afaad['id'],_0x21d400(_0x3afaad));}else{for(const _0x5901fd of _0x3d97b5[_0x13240e(0xd7,'0X@$')](0x77e+0x124b+-0x19c9,_0x3d97b5[_0x13240e(0x1e5,'0X@$')]-(_0x46fcc8-(0x2*-0x977+0x182+0x116d))))_0x51d1[_0x13240e(0xcf,'cRMS')](_0x5901fd['id'],'\x00');}const _0x5dffa9=new Map();for(const _0x279e0d of _0x3d97b5){const _0x136e55=_0x51d1[_0x13240e(0x1fa,'anlS')](_0x279e0d['id']);if(_0x136e55!==undefined){if(!_0x5dffa9[_0x13240e(0x1bd,'acFo')](_0x136e55))_0x5dffa9[_0x13240e(0x23d,'lK4H')](_0x136e55,[]);_0x5dffa9[_0x13240e(0x19b,'x@pN')](_0x136e55)[_0x13240e(0x181,'CHF9')](_0x279e0d);}}const _0x344ddf=_0x1923a9=>_0x1923a9==='\x00'?_0x13240e(0xed,'x@pN'):_0x13240e(0x13f,'EoHl')+_0x1923a9,_0x10dc05=_0x282f3f[_0x13240e(0xe0,'qhtD')](_0x408c8e=>!_0x51d1[_0x13240e(0x138,'wBp!')](_0x408c8e['id']))[_0x13240e(0x14e,'kr5j')](_0x5c500c=>({..._0x5c500c,..._0x5c500c[_0x13240e(0x101,'Xa)V')]?{'issues':{..._0x5c500c[_0x13240e(0x286,'gu!o')]}}:{}}));for(const [_0x5592b3,_0x51c83a]of _0x5dffa9){const _0x11f3c1=new Map();for(const _0xd1c7fd of _0x51c83a)if(_0xd1c7fd[_0x13240e(0x256,'lK4H')])_0x11f3c1[_0x13240e(0x143,'ymUK')](_0xd1c7fd[_0x13240e(0x147,'DjNO')],(_0x11f3c1[_0x13240e(0x13c,'[Bvu')](_0xd1c7fd[_0x13240e(0x1ce,'shx0')])??0x1*-0x2df+-0x210e+0x23ed)+_0xd1c7fd[_0x13240e(0x124,'gu!o')]);const _0xd24536=Array[_0x13240e(0xf5,'EoHl')](_0x11f3c1[_0x13240e(0x122,'EROh')]())[_0x13240e(0xd6,'sH5u')]((_0x54b2fe,_0x3f877e)=>_0x3f877e[-0x3*0x887+0x2288+-0xe5*0xa]-_0x54b2fe[0x5*0x557+-0xd*-0x5e+-0x1f78]||_0x54b2fe[0x3e*0x15+-0x6*-0x2c2+-0x15a2][_0x13240e(0x1b9,'HmoW')](_0x3f877e[-0x13f0+0x365*0x1+-0x181*-0xb]))[-0x1ff0+-0x24be+0x44ae]?.[-0x555+0x22*-0x11+0x797]??null,_0xa7d5ac={'id':_0x344ddf(_0x5592b3),'name':_0x13240e(0x200,'x@pN')+_0x51c83a[_0x13240e(0x134,'qhtD')]+_0x13240e(0x1af,'wBp!'),'layer':_0xd24536,'files':_0x51c83a[_0x13240e(0x1a8,'K8B6')]((_0x57fbca,_0x53383c)=>_0x57fbca+_0x53383c[_0x13240e(0x224,'m#9T')],-0x1ec9+0x409+-0x1*-0x1ac0)};if(_0x5592b3!=='\x00'&&_0x51c83a[_0x13240e(0x164,'Jp#G')](_0x1831a6=>_0x1831a6[_0x13240e(0xdb,'BEYS')]!==undefined))_0xa7d5ac[_0x13240e(0xca,'h$Z2')]=_0x5592b3;if(_0x51c83a[_0x13240e(0x179,'^IuJ')](_0x4d06b3=>_0x4d06b3[_0x13240e(0x192,'76t7')]))_0xa7d5ac[_0x13240e(0x233,'wBp!')]=_0x51c83a[_0x13240e(0x1e8,'ymUK')](_0x2dde5=>_0x2dde5[_0x13240e(0xe6,'6o71')]??[])[_0x13240e(0x212,']CyA')]();if(_0x51c83a[_0x13240e(0x27f,'c8z7')](_0x38b2b4=>_0x38b2b4[_0x13240e(0x101,'Xa)V')])){_0xa7d5ac[_0x13240e(0x20f,'WYpx')]={'dupL1':0x0,'dupL2':0x0,'orphans':0x0,'layerOut':0x0,'constraints':0x0};for(const _0x196938 of _0x51c83a)_0x196938[_0x13240e(0x1cd,'0X@$')]&&(_0xa7d5ac[_0x13240e(0x23f,'DjNO')][_0x13240e(0x15a,'L[aD')]+=_0x196938[_0x13240e(0xcd,'@BaU')][_0x13240e(0x284,'0X@$')],_0xa7d5ac[_0x13240e(0x185,'lK4H')][_0x13240e(0x23b,'0X@$')]+=_0x196938[_0x13240e(0x132,'EROh')][_0x13240e(0x214,'gEDc')],_0xa7d5ac[_0x13240e(0x21c,'anlS')][_0x13240e(0x1b8,'lW5g')]+=_0x196938[_0x13240e(0x17d,'kr5j')][_0x13240e(0x162,'BEYS')],_0xa7d5ac[_0x13240e(0x14a,'76t7')][_0x13240e(0x145,'%REJ')]+=_0x196938[_0x13240e(0x207,'6o71')][_0x13240e(0x21d,'Jp#G')]);}_0x10dc05[_0x13240e(0x26f,'aIpQ')](_0xa7d5ac);}_0x282f3f=_0x10dc05[_0x13240e(0xfe,'lW5g')]((_0x335047,_0x5da657)=>_0x335047['id'][_0x13240e(0x20b,'@BaU')](_0x5da657['id']));const _0x1a3ece=_0x590d3b=>{const _0x2f8fa6=_0x13240e,_0x37a973=_0x51d1[_0x2f8fa6(0x13c,'[Bvu')](_0x590d3b);return _0x37a973===undefined?_0x590d3b:_0x344ddf(_0x37a973);},_0x15626e=new Map();for(const _0x493eca of _0x431e38){const _0x1e47ab=_0x1a3ece(_0x493eca[_0x13240e(0x254,'qlc3')]),_0x2ceecc=_0x1a3ece(_0x493eca['to']);if(_0x1e47ab===_0x2ceecc)continue;const _0x307a98=_0x1e47ab+'\x00'+_0x2ceecc+'\x00'+_0x493eca[_0x13240e(0xc6,'L[aD')],_0x3cf088=_0x15626e[_0x13240e(0x27c,'acFo')](_0x307a98);if(_0x3cf088)_0x3cf088[_0x13240e(0x194,'[BBh')]+=_0x493eca[_0x13240e(0x1de,'ymUK')],_0x3cf088[_0x13240e(0x1dd,'WYpx')]=_0x3cf088[_0x13240e(0x22a,'KrKq')]||_0x493eca[_0x13240e(0x1a6,'anlS')];else _0x15626e[_0x13240e(0xd2,'x@pN')](_0x307a98,{'from':_0x1e47ab,'to':_0x2ceecc,'kind':_0x493eca[_0x13240e(0x17f,'Jp#G')],'count':_0x493eca[_0x13240e(0x11c,'L[aD')],'violation':_0x493eca[_0x13240e(0x10c,'YW30')]});}_0x431e38=Array[_0x13240e(0x1df,'Jp#G')](_0x15626e[_0x13240e(0x166,'lK4H')]())[_0x13240e(0x244,'BEYS')](edgeOrder);}if(_0x431e38[_0x13240e(0x125,'L[aD')]>_0xc4ce08){const _0x56adbc=(_0x26b555,_0xcd2725)=>_0xcd2725[_0x13240e(0x215,'cRMS')]-_0x26b555[_0x13240e(0xe1,']CyA')]||edgeOrder(_0x26b555,_0xcd2725);let _0x114e21=_0x431e38[_0x13240e(0x1bb,'EoHl')](_0x4592cf=>_0x4592cf[_0x13240e(0x21f,'[Bvu')]);if(_0x114e21[_0x13240e(0x18b,'sH5u')]>SERVER_MAX_EDGES)_0x114e21=_0x114e21[_0x13240e(0x1ec,'ymUK')]()[_0x13240e(0x27a,'qhtD')](_0x56adbc)[_0x13240e(0x239,'BEYS')](-0x16e5*-0x1+-0x5d5*-0x5+-0x340e*0x1,SERVER_MAX_EDGES);const _0x3935b2=_0x431e38[_0x13240e(0x273,'C7]m')](_0x1bbd13=>!_0x1bbd13[_0x13240e(0x10c,'YW30')])[_0x13240e(0x209,'wBp!')](_0x56adbc)[_0x13240e(0xf9,'DjNO')](-0x1b83*-0x1+-0x1ed8+0x355,Math[_0x13240e(0x178,'gu!o')](-0x22b0+0x1e99+0x417,_0xc4ce08-_0x114e21[_0x13240e(0x28c,'^IuJ')]));_0x431e38=[..._0x114e21,..._0x3935b2][_0x13240e(0x213,'^IuJ')](edgeOrder);}if(_0x282f3f===_0x5099bd[_0x13240e(0x157,'^IuJ')])_0x282f3f=_0x282f3f[_0x13240e(0xc5,'24L3')](_0x15450c=>({..._0x15450c,..._0x15450c[_0x13240e(0x17e,'shx0')]?{'issues':{..._0x15450c[_0x13240e(0x274,'#0R$')]}}:{}}));if(_0x282f3f[_0x13240e(0x186,'EROh')](_0xfd2c01=>_0xfd2c01[_0x13240e(0x18e,'sH5u')]))fillLayerOut(_0x282f3f,_0x431e38);if(_0x282f3f[_0x13240e(0x23e,'6o71')](_0x107e49=>_0x107e49[_0x13240e(0x1ff,'anlS')]!==undefined)){const _0x4f6219=moduleCycles(_0x282f3f,_0x431e38);for(const _0xb786fc of _0x282f3f)_0xb786fc[_0x13240e(0x205,'qlc3')]=_0x4f6219[_0x13240e(0x272,'Jp#G')](_0xb786fc['id'])??null;}return{'nodes':_0x282f3f,'edges':_0x431e38};}export function graphPayload(_0x51d6a9){const _0x5f23c7=a5_0x236334,_0x1404c9=capGraph(_0x51d6a9);return{'nodes':_0x1404c9[_0x5f23c7(0x191,'6o71')][_0x5f23c7(0x1fc,'x@pN')](_0x2eca1a=>{const _0x37b716=_0x5f23c7,_0x4733b6={'id':_0x2eca1a['id'],'name':_0x2eca1a[_0x37b716(0x105,'C7]m')],'layer':_0x2eca1a[_0x37b716(0x25a,'EROh')],'files':_0x2eca1a[_0x37b716(0x11e,'kr5j')]};if(_0x2eca1a[_0x37b716(0x10d,'6o71')]!==undefined)_0x4733b6[_0x37b716(0x264,'%REJ')]=_0x2eca1a[_0x37b716(0xeb,'wBp!')];if(_0x2eca1a[_0x37b716(0x100,'gEDc')])_0x4733b6[_0x37b716(0xf4,'BEYS')]=_0x2eca1a[_0x37b716(0x10e,'[BBh')][_0x37b716(0xf3,'acFo')]();if(_0x2eca1a[_0x37b716(0x101,'Xa)V')])_0x4733b6[_0x37b716(0x211,'%REJ')]={'dupL1':_0x2eca1a[_0x37b716(0x1d9,'24L3')][_0x37b716(0x285,'x@pN')],'dupL2':_0x2eca1a[_0x37b716(0x101,'Xa)V')][_0x37b716(0x1fe,'CHF9')],'orphans':_0x2eca1a[_0x37b716(0x1a5,'HmoW')][_0x37b716(0x1a3,'CHF9')],'layerOut':_0x2eca1a[_0x37b716(0x14a,'76t7')][_0x37b716(0x248,'fO1E')],'constraints':_0x2eca1a[_0x37b716(0x18e,'sH5u')][_0x37b716(0xfd,'SFS)')]};if(_0x2eca1a[_0x37b716(0xef,'gEDc')]!==undefined)_0x4733b6[_0x37b716(0x112,'WYpx')]=_0x2eca1a[_0x37b716(0x1cf,'ymUK')];return _0x4733b6;}),'edges':_0x1404c9[_0x5f23c7(0xff,'cRMS')][_0x5f23c7(0x1f6,'EROh')](_0x6182f6=>({'from':_0x6182f6[_0x5f23c7(0x1b3,'@BaU')],'to':_0x6182f6['to'],'kind':_0x6182f6[_0x5f23c7(0x226,'fO1E')],'count':_0x6182f6[_0x5f23c7(0x18d,'#0R$')],'violation':_0x6182f6[_0x5f23c7(0x1c6,'C7]m')]}))};}export function archGraphPath(_0x3ec47a){const _0x116115=a5_0x236334;return a5_0x30cc37[_0x116115(0x12f,'6o71')](_0x3ec47a,_0x116115(0x288,'C7]m'));}export async function configArchGraph(_0x51be20,_0xbe06dd={}){const _0x4d3f9e=a5_0x236334,{buildWorkspace:_0x49b2ae}=await import(_0x4d3f9e(0x20d,'$DdD')),_0x35496e=_0x49b2ae(_0x51be20,{'workspace':_0xbe06dd[_0x4d3f9e(0xe2,'anlS')]??![]}),_0x1dea6b=computeArchGraph(_0x35496e);if(_0x35496e[_0x4d3f9e(0x190,'lW5g')][_0x4d3f9e(0x19f,'76t7')])return{'file':'','graph':_0x1dea6b,'writeRefused':_0x35496e[_0x4d3f9e(0x1cb,'@BaU')]};const _0x45c3fb=archGraphPath(_0x35496e[_0x4d3f9e(0x1ed,'C7]m')][_0x4d3f9e(0x180,'c8z7')]);return writeJsonAtomic(_0x45c3fb,_0x1dea6b),{'file':_0x45c3fb,'graph':_0x1dea6b};}export function readArchGraph(_0x5ab351){const _0x3cd93c=a5_0x236334;try{return JSON[_0x3cd93c(0x18c,'qlc3')](a5_0x4865c4[_0x3cd93c(0x183,'sH5u')](archGraphPath(_0x5ab351),_0x3cd93c(0x220,'BEYS')));}catch{return null;}}
1
+ import*as a8a from'path';import{DEFAULT_LAYERS}from'./link.js';import{evalForbidDependency}from'./shape-eval.js';import{readJson,writeJsonAtomic}from'./index-store.js';import{tarjan}from'./scc.js';export const MAX_NODES=0x28;const SPLIT_SHARE=0.3,SPLIT_MIN_FILES=0x8;export const UPLOAD_MAX_NODES=0x190;export const UPLOAD_MAX_EDGES=0xaf0;const SERVER_MAX_EDGES=0xbb8;export function commonDirPrefix(a){if(!a['length'])return[];let b=a[0x0]['split']('/')['slice'](0x0,-0x1);for(const c of a){const e=c['split']('/')['slice'](0x0,-0x1);let g=0x0;while(g<b['length']&&g<e['length']&&b[g]===e[g])g++;b=b['slice'](0x0,g);}return b;}export function directoryModules(a,b=MAX_NODES){const c=Array['from'](new Set(a))['sort'](),e=new Map();if(!c['length'])return e;const g=commonDirPrefix(c)['length'],h=(n,o)=>{const p=n['split']('/')['slice'](0x0,-0x1),q=p['slice'](0x0,Math['min'](p['length'],g+o));return q['length']?q['join']('/'):'.';},i=new Map(),j=new Map();for(const n of c){const o=h(n,0x1);!j['has'](o)&&(j['set'](o,[]),i['set'](o,0x1)),j['get'](o)['push'](n);}const l=c['length'];for(let p=0x0;p<0x100&&j['size']<b;p++){const q=Array['from'](j['entries']())['sort']((s,t)=>t[0x1]['length']-s[0x1]['length']||s[0x0]['localeCompare'](t[0x0]));let r=![];for(const [s,t]of q){if(t['length']<SPLIT_MIN_FILES||t['length']<l*SPLIT_SHARE)break;const u=(i['get'](s)??0x1)+0x1,v=new Map();for(const w of t){const x=h(w,u);if(!v['has'](x))v['set'](x,[]);v['get'](x)['push'](w);}if(v['size']<0x2||j['size']-0x1+v['size']>b)continue;j['delete'](s);for(const [y,z]of v){j['set'](y,z),i['set'](y,u);}r=!![];break;}if(!r)break;}let m=Array['from'](j['entries']())['sort']((A,B)=>B[0x1]['length']-A[0x1]['length']||A[0x0]['localeCompare'](B[0x0]));if(m['length']>b){const A=m['slice'](0x0,b-0x1),B=m['slice'](b-0x1)['flatMap'](C=>C[0x1]);m=[...A,['(기타)',B]];}for(const [C,D]of m)for(const E of D)e['set'](E,C);return e;}function dominantLayer(a,b,c){const d=new Map();for(const g of a){const h=b['layerOf'](g);if(h)d['set'](h,(d['get'](h)??0x0)+0x1);}if(!d['size'])return null;const e=j=>{const k=c['indexOf'](j);return k<0x0?c['length']:k;};return Array['from'](d['entries']())['sort']((i,j)=>j[0x1]-i[0x1]||e(i[0x0])-e(j[0x0])||i[0x0]['localeCompare'](j[0x0]))[0x0][0x0];}function mostFrequent(a){const b=new Map();for(const c of a)b['set'](c,(b['get'](c)??0x0)+0x1);return Array['from'](b['entries']())['sort']((d,e)=>e[0x1]-d[0x1]||d[0x0]['localeCompare'](e[0x0]))[0x0]?.[0x0];}function secondLevelDir(a,b){const c=a['split']('/')['slice'](0x0,-0x1);let d=c['slice'](b);if(d[0x0]==='src'&&d['length']>0x1)d=d['slice'](0x1);return d[0x0]??c[b-0x1]??'.';}const AREA_SPLIT=0x1e;function partLabel(a){return a['replace'](/^(pkg|seed):/,'')||'.';}function directoryArea(a,b){if(a==='.'||a==='(기타)')return a;const c=a['split']('/');return c[b]??c[c['length']-0x1];}export function moduleCycles(a,b){const c=new Map();for(const h of a)c['set'](h['id'],new Set());for(const i of b)if(i['kind']==='import'&&c['has'](i['from'])&&c['has'](i['to'])&&i['from']!==i['to'])c['get'](i['from'])['add'](i['to']);const d=tarjan(c)['sort']((j,k)=>j[0x0]['localeCompare'](k[0x0])),f=new Map(a['map'](j=>[j['id'],null]));return d['forEach']((j,k)=>{for(const l of j)f['set'](l,k+0x1);}),f;}function fillLayerOut(a,b){const c=new Map();for(const d of b)if(d['violation'])c['set'](d['from'],(c['get'](d['from'])??0x0)+0x1);for(const f of a)if(f['issues'])f['issues']['layerOut']=c['get'](f['id'])??0x0;}function fileOfCi(a){return new Map(a['cis']['map'](b=>[b['id'],b['file']]));}export function computeArchGraph(a,b={}){const g=a['baseline']['layers']?.['order']??DEFAULT_LAYERS['order'],h=a['primaryOnly']?a['members']['slice'](0x0,0x1):a['members'],l=h['length']>0x1,q=h[0x0],r=new Map(),s=new Map(),t=(H,I)=>H+'\x00'+I;let u='directories';const w=b['modulesDir']??a8a['join'](a['primary']['storeDir'],'architect'),y=readJson(a8a['join'](w,'modules.json'))?.['modules']??[],z=readJson(a8a['join'](w,'names.json'))?.['names']??{};for(const H of h){const I=Array['from'](H['facts']['keys']())['sort'](),J=l?H['name']+':':'',K=new Set();if(H===q&&y['length']){u='modules';const N=new Set(I),O=new Map();for(const R of y['slice']()['sort']((S,T)=>S['id']['localeCompare'](T['id']))){const S='mod:'+J+R['id'];for(const T of R['files']['slice']()['sort']()){if(!N['has'](T)||K['has'](T))continue;K['add'](T),r['set'](t(H['name'],T),S),!s['has'](S)&&(s['set'](S,{'name':J+(z[R['id']]?.['name']||R['label']||R['id']),'member':H,'files':[],'area':''}),O['set'](S,R['partition']??'')),s['get'](S)['files']['push'](T);}}const P=new Set(Array['from'](O['values']())['filter'](Boolean)),Q=new Map();for(const [U,V]of O){const W=P['size']>0x1?V:'';(Q['get'](W)??Q['set'](W,[])['get'](W))['push'](U);}for(const [X,Y]of Q){const Z=partLabel(X),a0=!X||Y['length']>AREA_SPLIT,a1=a0?commonDirPrefix(Y['flatMap'](a2=>s['get'](a2)['files']))['length']:0x0;for(const a2 of Y){const a3=s['get'](a2),a4=a0?mostFrequent(a3['files']['map'](a5=>secondLevelDir(a5,a1)))??'.':'';a3['area']=J+(!X?a4:a0?Z+'\x20›\x20'+a4:Z);}}}const L=I['filter'](a5=>!K['has'](a5)),M=commonDirPrefix(L)['length'];for(const [a5,a6]of directoryModules(L)){const a7='dir:'+J+a6;r['set'](t(H['name'],a5),a7);if(!s['has'](a7))s['set'](a7,{'name':J+a6,'member':H,'files':[],'area':J+directoryArea(a6,M)});s['get'](a7)['files']['push'](a5);}}const A=new Map(),B=(a8,a9,aa,ab,ac)=>{if(!a8||!a9||a8===a9)return;const ad=a8+'\x00'+a9+'\x00'+aa;let ae=A['get'](ad);!ae&&(ae={'from':a8,'to':a9,'kind':aa,'pairs':new Set(),'violation':![]},A['set'](ad,ae));ae['pairs']['add'](ab);if(ac)ae['violation']=!![];},C=(a['baseline']['constraints']??[])['filter'](a8=>a8['rule']['type']==='forbid-dependency');for(const a8 of h){const a9=new Set();for(const ac of a8['deps']){if(ac['typeOnly']||ac['to']['kind']!=='ci')continue;const ad=ac['fromFile']+'>'+ac['to']['file'];if(ac['fromLayer']&&ac['to']['layer']){const ae=g['indexOf'](ac['fromLayer']),af=g['indexOf'](ac['to']['layer']);if(ae>=0x0&&af>=0x0&&af!==ae&&af!==ae+0x1)a9['add'](ad);}if(!a9['has'](ad)&&C['some'](ag=>evalForbidDependency(ag,[ac])['some'](ah=>ah['status']==='violated')))a9['add'](ad);}const aa=new Set();for(const [ag,ah]of a8['fileGraph'])for(const ai of ah)aa['add'](ag+'>'+ai);for(const aj of a8['deps'])if(!aj['typeOnly']&&aj['to']['kind']==='ci'&&aj['to']['file']&&aj['to']['file']!==aj['fromFile'])aa['add'](aj['fromFile']+'>'+aj['to']['file']);for(const ak of Array['from'](aa)['sort']()){const [al,am]=ak['split']('>');B(r['get'](t(a8['name'],al)),r['get'](t(a8['name'],am)),'import',a8['name']+'|'+ak,a9['has'](ak));}const ab=fileOfCi(a8);for(const an of a8['edges']){if(an['type']!=='http')continue;const ao=ab['get'](an['from']);let ap=a8,aq=an['to'];const ar=a['members']['find'](at=>at!==a8&&an['to']['startsWith'](at['name']+':'));ar&&(ap=ar,aq=an['to']['slice'](ar['name']['length']+0x1));const as=(ap===a8?ab:fileOfCi(ap))['get'](aq);if(!ao||!as)continue;B(r['get'](t(a8['name'],ao)),r['get'](t(ap['name'],as)),'http',a8['name']+'|'+an['from']+'>'+an['to'],![]);}}let D=null;if(b['audit']){const at=new Map(),au=(av,aw,ax)=>{const ay=r['get'](t(av,aw));if(!ay)return;let az=at['get'](ay);!az&&(az={'dupL1':0x0,'dupL2':0x0,'orphans':0x0,'layerOut':0x0,'constraints':0x0},at['set'](ay,az)),az[ax]++;};for(const av of b['audit']['dupL1'])for(const aw of av['members'])au(aw['member'],aw['file'],'dupL1');for(const ax of b['audit']['dupL2'])for(const ay of ax['members'])au(ay['member'],ay['file'],'dupL2');for(const az of b['audit']['orphans'])au(az['member'],az['file'],'orphans');for(const aA of b['audit']['constraintFindings'])if(aA['status']==='violated')au(aA['member'],aA['file'],'constraints');D=aB=>at['get'](aB)??{'dupL1':0x0,'dupL2':0x0,'orphans':0x0,'layerOut':0x0,'constraints':0x0};}const E=Array['from'](A['values']())['map'](aB=>({'from':aB['from'],'to':aB['to'],'kind':aB['kind'],'count':aB['pairs']['size'],'violation':aB['violation']}))['sort'](edgeOrder),F=Array['from'](s['entries']())['map'](([aB,aC])=>{const aD={'id':aB,'name':aC['name'],'layer':dominantLayer(aC['files'],aC['member'],g),'files':aC['files']['length'],'area':aC['area'],'fileList':aC['files']['slice']()['sort']()};if(D)aD['issues']=D(aB);return aD;})['sort']((aB,aC)=>aB['id']['localeCompare'](aC['id']));if(D)fillLayerOut(F,E);const G=moduleCycles(F,E);for(const aB of F)aB['cycle']=G['get'](aB['id'])??null;return{'version':0x1,'repoKey':a['primary']['repoKey'],'scopeRel':a['primary']['scopeRel'],'source':u,'layers':g['slice'](),'nodes':F,'edges':E};}const edgeOrder=(c,d)=>c['from']['localeCompare'](d['from'])||c['to']['localeCompare'](d['to'])||c['kind']['localeCompare'](d['kind']);export function capGraph(b,d=UPLOAD_MAX_NODES,f=UPLOAD_MAX_EDGES){if(b['nodes']['length']<=d&&b['edges']['length']<=f)return b;let h=b['nodes'],i=b['edges'];if(h['length']>d){const j=h['slice']()['sort']((w,y)=>w['files']-y['files']||w['id']['localeCompare'](y['id'])),l=w=>w['area']??'',m=new Map();let o=0x0,p=-0x1;for(let w=0x1;w<=j['length'];w++){const y=l(j[w-0x1]),z=(m['get'](y)??0x0)+0x1;m['set'](y,z);if(z>=0x2)o++;if(h['length']-o<=d){p=w;break;}}const q=new Map();if(p>0x0){const A=j['slice'](0x0,p),B=new Map();for(const C of A)B['set'](l(C),(B['get'](l(C))??0x0)+0x1);for(const D of A)if(B['get'](l(D))>=0x2)q['set'](D['id'],l(D));}else{for(const E of j['slice'](0x0,j['length']-(d-0x1)))q['set'](E['id'],'\x00');}const r=new Map();for(const F of j){const G=q['get'](F['id']);if(G!==undefined){if(!r['has'](G))r['set'](G,[]);r['get'](G)['push'](F);}}const s=H=>H==='\x00'?'etc:':'etc:'+H,t=h['filter'](H=>!q['has'](H['id']))['map'](H=>({...H,...H['issues']?{'issues':{...H['issues']}}:{}}));for(const [H,I]of r){const J=new Map();for(const M of I)if(M['layer'])J['set'](M['layer'],(J['get'](M['layer'])??0x0)+M['files']);const K=Array['from'](J['entries']())['sort']((N,O)=>O[0x1]-N[0x1]||N[0x0]['localeCompare'](O[0x0]))[0x0]?.[0x0]??null,L={'id':s(H),'name':'(기타\x20·\x20'+I['length']+'개\x20모듈)','layer':K,'files':I['reduce']((N,O)=>N+O['files'],0x0)};if(H!=='\x00'&&I['some'](N=>N['area']!==undefined))L['area']=H;if(I['some'](N=>N['fileList']))L['fileList']=I['flatMap'](N=>N['fileList']??[])['sort']();if(I['some'](N=>N['issues'])){L['issues']={'dupL1':0x0,'dupL2':0x0,'orphans':0x0,'layerOut':0x0,'constraints':0x0};for(const N of I)N['issues']&&(L['issues']['dupL1']+=N['issues']['dupL1'],L['issues']['dupL2']+=N['issues']['dupL2'],L['issues']['orphans']+=N['issues']['orphans'],L['issues']['constraints']+=N['issues']['constraints']);}t['push'](L);}h=t['sort']((O,P)=>O['id']['localeCompare'](P['id']));const u=O=>{const P=q['get'](O);return P===undefined?O:s(P);},v=new Map();for(const O of i){const P=u(O['from']),Q=u(O['to']);if(P===Q)continue;const R=P+'\x00'+Q+'\x00'+O['kind'],S=v['get'](R);if(S)S['count']+=O['count'],S['violation']=S['violation']||O['violation'];else v['set'](R,{'from':P,'to':Q,'kind':O['kind'],'count':O['count'],'violation':O['violation']});}i=Array['from'](v['values']())['sort'](edgeOrder);}if(i['length']>f){const T=(W,X)=>X['count']-W['count']||edgeOrder(W,X);let U=i['filter'](W=>W['violation']);if(U['length']>SERVER_MAX_EDGES)U=U['slice']()['sort'](T)['slice'](0x0,SERVER_MAX_EDGES);const V=i['filter'](W=>!W['violation'])['sort'](T)['slice'](0x0,Math['max'](0x0,f-U['length']));i=[...U,...V]['sort'](edgeOrder);}if(h===b['nodes'])h=h['map'](W=>({...W,...W['issues']?{'issues':{...W['issues']}}:{}}));if(h['some'](W=>W['issues']))fillLayerOut(h,i);if(h['some'](W=>W['cycle']!==undefined)){const W=moduleCycles(h,i);for(const X of h)X['cycle']=W['get'](X['id'])??null;}return{'nodes':h,'edges':i};}export function graphPayload(a){const b=capGraph(a);return{'nodes':b['nodes']['map'](d=>{const e={'id':d['id'],'name':d['name'],'layer':d['layer'],'files':d['files']};if(d['area']!==undefined)e['area']=d['area'];if(d['fileList'])e['fileList']=d['fileList']['slice']();if(d['issues'])e['issues']={'dupL1':d['issues']['dupL1'],'dupL2':d['issues']['dupL2'],'orphans':d['issues']['orphans'],'layerOut':d['issues']['layerOut'],'constraints':d['issues']['constraints']};if(d['cycle']!==undefined)e['cycle']=d['cycle'];return e;}),'edges':b['edges']['map'](d=>({'from':d['from'],'to':d['to'],'kind':d['kind'],'count':d['count'],'violation':d['violation']}))};}export function archGraphPath(a){return a8a['join'](a,'arch-graph.json');}export async function configArchGraph(a,b={}){const {buildWorkspace:c}=await import('./store.js'),d=c(a,{'workspace':b['workspace']??![]}),e=computeArchGraph(d);if(d['primary']['readOnly'])return{'file':'','graph':e,'writeRefused':d['writeRefused']};const f=archGraphPath(d['primary']['storeDir']);return writeJsonAtomic(f,e),{'file':f,'graph':e};}