@treasuredata/tdx 2026.3.42 → 2026.3.43

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 (219) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/cas-command.js +1 -1
  12. package/dist/commands/cas-segment-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-statusline-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/delivery-command.js +1 -1
  21. package/dist/commands/describe.js +1 -1
  22. package/dist/commands/engage-campaign-pull-command.js +1 -1
  23. package/dist/commands/engage-campaign-push-command.js +1 -1
  24. package/dist/commands/engage-campaign-validate-command.js +1 -1
  25. package/dist/commands/engage-command.js +1 -1
  26. package/dist/commands/engage-template-pull-command.js +1 -1
  27. package/dist/commands/engage-template-push-command.js +1 -1
  28. package/dist/commands/engage-template-validate-command.js +1 -1
  29. package/dist/commands/job-command.js +1 -1
  30. package/dist/commands/journey-command.js +1 -1
  31. package/dist/commands/journey-validate-command.js +1 -1
  32. package/dist/commands/llm-command.js +1 -1
  33. package/dist/commands/mcp-command.js +1 -1
  34. package/dist/commands/parent-segment-command.js +1 -1
  35. package/dist/commands/policy-command.js +1 -1
  36. package/dist/commands/profile-command.js +1 -1
  37. package/dist/commands/profiles-command.js +1 -1
  38. package/dist/commands/query-command.js +1 -1
  39. package/dist/commands/schedule-command.js +1 -1
  40. package/dist/commands/segment-command.js +1 -1
  41. package/dist/commands/segment-create-command.js +1 -1
  42. package/dist/commands/segment-fields-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js +1 -1
  44. package/dist/commands/segment-push-command.js +1 -1
  45. package/dist/commands/segment-update-command.js +1 -1
  46. package/dist/commands/segment-use-command.js +1 -1
  47. package/dist/commands/segment-validate-command.js +1 -1
  48. package/dist/commands/segments.js +1 -1
  49. package/dist/commands/show.js +1 -1
  50. package/dist/commands/status-command.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/upgrade-command.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.js +1 -1
  56. package/dist/commands/work-command.js +1 -1
  57. package/dist/commands/workflow-command.js +1 -1
  58. package/dist/core/auth.js +1 -1
  59. package/dist/core/command-output.js +1 -1
  60. package/dist/core/config.js +1 -1
  61. package/dist/core/connection-cache.js +1 -1
  62. package/dist/core/constants.js +1 -1
  63. package/dist/core/credential-cache.js +1 -1
  64. package/dist/core/global-context.js +1 -1
  65. package/dist/core/keychain.js +1 -1
  66. package/dist/core/oauth-keychain.js +1 -1
  67. package/dist/core/oauth.js +1 -1
  68. package/dist/core/profile.js +1 -1
  69. package/dist/core/project-config.js +1 -1
  70. package/dist/core/session.js +1 -1
  71. package/dist/core/user-cache.js +1 -1
  72. package/dist/core/version.js +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/mcp/server.js +1 -1
  75. package/dist/mcp/tools/index.js +1 -1
  76. package/dist/mcp/tools/tdx-run.js +1 -1
  77. package/dist/mcp/tools/tdx-search.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/frontmatter.js +1 -1
  182. package/dist/sdk/workspace/git.js +1 -1
  183. package/dist/sdk/workspace/index.js +1 -1
  184. package/dist/sdk/workspace/templates.js +1 -1
  185. package/dist/sdk/workspace/weekly.js +1 -1
  186. package/dist/sdk/workspace/wikilinks.js +1 -1
  187. package/dist/test-utils/command-runner.js +1 -1
  188. package/dist/test-utils/factories.js +1 -1
  189. package/dist/test-utils/fixtures.js +1 -1
  190. package/dist/test-utils/http-mock.js +1 -1
  191. package/dist/test-utils/index.js +1 -1
  192. package/dist/utils/async.js +1 -1
  193. package/dist/utils/colors.js +1 -1
  194. package/dist/utils/diff.js +1 -1
  195. package/dist/utils/file-permissions.js +1 -1
  196. package/dist/utils/file-reader.js +1 -1
  197. package/dist/utils/github-releases.js +1 -1
  198. package/dist/utils/global-cache.js +1 -1
  199. package/dist/utils/json-loader.js +1 -1
  200. package/dist/utils/local-cache.js +1 -1
  201. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  202. package/dist/utils/logger/formatters/index.js +1 -1
  203. package/dist/utils/logger/handlers/console-handler.js +1 -1
  204. package/dist/utils/logger/handlers/file-handler.js +1 -1
  205. package/dist/utils/logger/handlers/index.js +1 -1
  206. package/dist/utils/logger/handlers/null-handler.js +1 -1
  207. package/dist/utils/logger/index.js +1 -1
  208. package/dist/utils/logger/logger.js +1 -1
  209. package/dist/utils/logger/types.js +1 -1
  210. package/dist/utils/option-validation.js +1 -1
  211. package/dist/utils/process.js +1 -1
  212. package/dist/utils/prompt.js +1 -1
  213. package/dist/utils/spinner.js +1 -1
  214. package/dist/utils/sse-parser.js +1 -1
  215. package/dist/utils/string-utils.js +1 -1
  216. package/dist/utils/table-ref-parser.js +1 -1
  217. package/dist/utils/tdx-logger.js +1 -1
  218. package/dist/utils/version-check.js +1 -1
  219. package/package.json +1 -1
@@ -1 +1 @@
1
- const a26_0x2d7754=a26_0x5914;(function(_0x5cbce2,_0x5d81e8){const _0x23d442=a26_0x5914,_0x343bb2=_0x5cbce2();while(!![]){try{const _0x29e8df=-parseInt(_0x23d442(0xd0))/0x1+-parseInt(_0x23d442(0xa9))/0x2*(parseInt(_0x23d442(0xbb))/0x3)+-parseInt(_0x23d442(0xc5))/0x4*(-parseInt(_0x23d442(0xdb))/0x5)+-parseInt(_0x23d442(0xc6))/0x6+-parseInt(_0x23d442(0xac))/0x7*(-parseInt(_0x23d442(0xb1))/0x8)+-parseInt(_0x23d442(0xc2))/0x9+parseInt(_0x23d442(0xcb))/0xa*(parseInt(_0x23d442(0xae))/0xb);if(_0x29e8df===_0x5d81e8)break;else _0x343bb2['push'](_0x343bb2['shift']());}catch(_0x3f7d4d){_0x343bb2['push'](_0x343bb2['shift']());}}}(a26_0x2f4f,0xcf9a0));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a26_0x2f4f(){const _0x45f3b5=['hasErrors','error','cwd','execute','filter','2328vwCGct','length','\x20warning(s)\x20found','verbose','template','No\x20template\x20YAML\x20files\x20found\x20in\x20','description','7347006kYjIYy','log','Validation\x20failed:\x20','16JkzbUi','4234830hUccaE','Error:\x20Directory\x20not\x20found:\x20','valid','name','engage:template:validate','160ESsWRY','\x20error(s)','.yml','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20valid','1349473DkHjAy','dim','\x20template(s)\x20with\x20errors,\x20','skippedCount','errors','validCount','✔\x20All\x20','resolve','endsWith','red','\x20non-template\x20file(s)\x20skipped','1319510mKXotC','warnings','green','342epLjWL','.yaml','invalidCount','346801qBnULU','yellow','1243121CNrAFN','\x20template(s)\x20valid','\x20non-template\x20file(s)\x20skipped)','160eNLIqn','dirname','warningCount','Validate\x20template\x20YAML\x20files','reason'];a26_0x2f4f=function(){return _0x45f3b5;};return a26_0x2f4f();}import a26_0xe6cef2 from'chalk';import a26_0x503501 from'path';function a26_0x5914(_0xb82cc7,_0x5751d6){_0xb82cc7=_0xb82cc7-0xa9;const _0x2f4f87=a26_0x2f4f();let _0x59148e=_0x2f4f87[_0xb82cc7];return _0x59148e;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a26_0x2d7754(0xc9)]=a26_0x2d7754(0xca);[a26_0x2d7754(0xc1)]=a26_0x2d7754(0xb4);async[a26_0x2d7754(0xb9)](_0xc15817){const _0x3f6621=a26_0x2d7754,{options:_0x59df3c,args:_0xae0a51}=_0xc15817,_0x42ac19=_0x59df3c,_0x323b93=_0xae0a51[0x0],_0x1c904c=_0x323b93?a26_0x503501[_0x3f6621(0xd7)](_0x323b93):undefined,_0x28ecae=_0x1c904c?isYamlFile(_0x1c904c):![];let _0x5854da,_0x4d195b;if(_0x28ecae&&_0x1c904c)_0x5854da=a26_0x503501[_0x3f6621(0xb2)](_0x1c904c),_0x4d195b=_0x1c904c;else _0x1c904c?_0x5854da=_0x1c904c:_0x5854da=process[_0x3f6621(0xb8)]();if(!_0x4d195b&&!existsSync(_0x5854da))return console['error'](a26_0xe6cef2[_0x3f6621(0xd9)](_0x3f6621(0xc7)+_0x5854da+'\x0a')),0x1;let _0x241e9d;if(_0x4d195b){if(!_0x4d195b[_0x3f6621(0xd8)](_0x3f6621(0xcd))&&!_0x4d195b[_0x3f6621(0xd8)](_0x3f6621(0xaa)))return console[_0x3f6621(0xb7)](a26_0xe6cef2[_0x3f6621(0xd9)](_0x3f6621(0xce)+_0x4d195b+'\x0a')),0x1;_0x241e9d=[_0x4d195b];}else _0x241e9d=findYamlFiles(_0x5854da);if(_0x241e9d['length']===0x0)return console[_0x3f6621(0xb7)](a26_0xe6cef2[_0x3f6621(0xd9)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x5854da+'\x0a')),0x1;const _0x36f965=validateYamlFiles(_0x241e9d,_0x5854da,{'filterType':_0x3f6621(0xbf)}),_0x284d8f=calculateSummary(_0x36f965),_0x4d6932=_0x36f965[_0x3f6621(0xba)](isValidationResult);if(_0x4d6932[_0x3f6621(0xbc)]===0x0)return console[_0x3f6621(0xb7)](a26_0xe6cef2[_0x3f6621(0xad)](_0x3f6621(0xc0)+_0x5854da+'\x0a')),_0x284d8f['skippedCount']>0x0&&console[_0x3f6621(0xb7)](a26_0xe6cef2['dim']('('+_0x284d8f[_0x3f6621(0xd3)]+_0x3f6621(0xb0))),0x0;for(const _0x47f058 of _0x36f965){if(!isValidationResult(_0x47f058)){_0x42ac19[_0x3f6621(0xbe)]&&console['log'](a26_0xe6cef2[_0x3f6621(0xd1)]('-\x20'+_0x47f058['relativePath']+'\x20(skipped:\x20'+_0x47f058[_0x3f6621(0xb5)]+')'));continue;}const {relativePath:_0x588840,source:_0x3d7b71,result:_0x51dc70}=_0x47f058;if(_0x51dc70[_0x3f6621(0xc8)]&&_0x51dc70[_0x3f6621(0xdc)]['length']===0x0)_0x42ac19[_0x3f6621(0xbe)]&&console[_0x3f6621(0xc3)](a26_0xe6cef2[_0x3f6621(0xdd)]('✔\x20'+_0x588840));else _0x51dc70[_0x3f6621(0xc8)]?(console[_0x3f6621(0xc3)](a26_0xe6cef2['yellow']('⚠\x20'+_0x588840+':\x20'+_0x51dc70['warnings']['length']+'\x20warning(s)')),console[_0x3f6621(0xc3)](formatValidationResult(_0x51dc70,_0x3d7b71,_0x588840))):(console[_0x3f6621(0xc3)](a26_0xe6cef2[_0x3f6621(0xd9)]('✖\x20'+_0x588840+':\x20'+_0x51dc70[_0x3f6621(0xd4)][_0x3f6621(0xbc)]+_0x3f6621(0xcc))),console[_0x3f6621(0xc3)](formatValidationResult(_0x51dc70,_0x3d7b71,_0x588840)));}return console['log'](''),_0x284d8f[_0x3f6621(0xb6)]?(console[_0x3f6621(0xc3)](a26_0xe6cef2['red'](_0x3f6621(0xc4)+_0x284d8f[_0x3f6621(0xab)]+_0x3f6621(0xd2)+_0x284d8f['validCount']+_0x3f6621(0xcf))),_0x284d8f[_0x3f6621(0xb3)]>0x0&&console[_0x3f6621(0xc3)](a26_0xe6cef2[_0x3f6621(0xad)](_0x284d8f[_0x3f6621(0xb3)]+_0x3f6621(0xbd))),_0x284d8f[_0x3f6621(0xd3)]>0x0&&console[_0x3f6621(0xc3)](a26_0xe6cef2[_0x3f6621(0xd1)](_0x284d8f[_0x3f6621(0xd3)]+_0x3f6621(0xda))),0x1):(console[_0x3f6621(0xc3)](a26_0xe6cef2[_0x3f6621(0xdd)](_0x3f6621(0xd6)+_0x284d8f[_0x3f6621(0xd5)]+_0x3f6621(0xaf))),_0x284d8f[_0x3f6621(0xb3)]>0x0&&console[_0x3f6621(0xc3)](a26_0xe6cef2[_0x3f6621(0xad)](_0x284d8f[_0x3f6621(0xb3)]+_0x3f6621(0xbd))),_0x284d8f['skippedCount']>0x0&&console['log'](a26_0xe6cef2[_0x3f6621(0xd1)](_0x284d8f[_0x3f6621(0xd3)]+'\x20non-template\x20file(s)\x20skipped')),0x0);}}
1
+ const a26_0x113cfe=a26_0x2a2d;(function(_0x49410d,_0x298f70){const _0x25caf9=a26_0x2a2d,_0x7ccfb0=_0x49410d();while(!![]){try{const _0x913edf=-parseInt(_0x25caf9(0xe2))/0x1*(-parseInt(_0x25caf9(0xe4))/0x2)+parseInt(_0x25caf9(0xec))/0x3*(-parseInt(_0x25caf9(0xe1))/0x4)+parseInt(_0x25caf9(0x10b))/0x5*(-parseInt(_0x25caf9(0xf1))/0x6)+-parseInt(_0x25caf9(0x10c))/0x7+parseInt(_0x25caf9(0xe8))/0x8+parseInt(_0x25caf9(0x101))/0x9+parseInt(_0x25caf9(0xf4))/0xa;if(_0x913edf===_0x298f70)break;else _0x7ccfb0['push'](_0x7ccfb0['shift']());}catch(_0x1b5d84){_0x7ccfb0['push'](_0x7ccfb0['shift']());}}}(a26_0x1258,0xc64a0));function a26_0x1258(){const _0x2290f8=['warnings','execute','10905669fSMWGe','validCount','filter','green','.yml','length','relativePath','Error:\x20Directory\x20not\x20found:\x20','valid','errors','135oSWhKh','5531092htSlXd','endsWith','resolve','dim','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','68LtxNdL','13WDRQzN','red','130898oQsOdp','yellow','\x20template(s)\x20valid','\x20warning(s)','2422976xBfLSI','reason','\x20(skipped:\x20','\x20error(s)','72936LhKpiz','dirname','description','Validation\x20failed:\x20','verbose','197514zetVSG','✔\x20All\x20','skippedCount','5390150DbIWSw','engage:template:validate','template','\x20warning(s)\x20found','\x20non-template\x20file(s)\x20skipped','Validate\x20template\x20YAML\x20files','No\x20template\x20YAML\x20files\x20found\x20in\x20','log','warningCount','\x20template(s)\x20with\x20errors,\x20','error'];a26_0x1258=function(){return _0x2290f8;};return a26_0x1258();}import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';function a26_0x2a2d(_0x4b9d70,_0x15e24b){_0x4b9d70=_0x4b9d70-0xde;const _0x125847=a26_0x1258();let _0x2a2deb=_0x125847[_0x4b9d70];return _0x2a2deb;}import{existsSync}from'fs';import a26_0x17f386 from'chalk';import a26_0x5147d1 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{['name']=a26_0x113cfe(0xf5);[a26_0x113cfe(0xee)]=a26_0x113cfe(0xf9);async[a26_0x113cfe(0x100)](_0x315a80){const _0x13be43=a26_0x113cfe,{options:_0x446548,args:_0x19d1ad}=_0x315a80,_0x2b10c5=_0x446548,_0x45dbba=_0x19d1ad[0x0],_0x1129c6=_0x45dbba?a26_0x5147d1[_0x13be43(0xde)](_0x45dbba):undefined,_0x397b27=_0x1129c6?isYamlFile(_0x1129c6):![];let _0x55a89b,_0x44e52b;if(_0x397b27&&_0x1129c6)_0x55a89b=a26_0x5147d1[_0x13be43(0xed)](_0x1129c6),_0x44e52b=_0x1129c6;else _0x1129c6?_0x55a89b=_0x1129c6:_0x55a89b=process['cwd']();if(!_0x44e52b&&!existsSync(_0x55a89b))return console['error'](a26_0x17f386['red'](_0x13be43(0x108)+_0x55a89b+'\x0a')),0x1;let _0x40e14e;if(_0x44e52b){if(!_0x44e52b[_0x13be43(0x10d)](_0x13be43(0x105))&&!_0x44e52b[_0x13be43(0x10d)]('.yaml'))return console['error'](a26_0x17f386[_0x13be43(0xe3)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x44e52b+'\x0a')),0x1;_0x40e14e=[_0x44e52b];}else _0x40e14e=findYamlFiles(_0x55a89b);if(_0x40e14e['length']===0x0)return console[_0x13be43(0xfe)](a26_0x17f386[_0x13be43(0xe3)](_0x13be43(0xe0)+_0x55a89b+'\x0a')),0x1;const _0x304a80=validateYamlFiles(_0x40e14e,_0x55a89b,{'filterType':_0x13be43(0xf6)}),_0x4a4057=calculateSummary(_0x304a80),_0x211404=_0x304a80[_0x13be43(0x103)](isValidationResult);if(_0x211404[_0x13be43(0x106)]===0x0)return console[_0x13be43(0xfe)](a26_0x17f386['yellow'](_0x13be43(0xfa)+_0x55a89b+'\x0a')),_0x4a4057[_0x13be43(0xf3)]>0x0&&console['error'](a26_0x17f386['dim']('('+_0x4a4057[_0x13be43(0xf3)]+'\x20non-template\x20file(s)\x20skipped)')),0x0;for(const _0x258273 of _0x304a80){if(!isValidationResult(_0x258273)){_0x2b10c5[_0x13be43(0xf0)]&&console[_0x13be43(0xfb)](a26_0x17f386[_0x13be43(0xdf)]('-\x20'+_0x258273[_0x13be43(0x107)]+_0x13be43(0xea)+_0x258273[_0x13be43(0xe9)]+')'));continue;}const {relativePath:_0x12e94f,source:_0x4220b2,result:_0x212a9b}=_0x258273;if(_0x212a9b[_0x13be43(0x109)]&&_0x212a9b[_0x13be43(0xff)][_0x13be43(0x106)]===0x0)_0x2b10c5[_0x13be43(0xf0)]&&console[_0x13be43(0xfb)](a26_0x17f386['green']('✔\x20'+_0x12e94f));else _0x212a9b['valid']?(console[_0x13be43(0xfb)](a26_0x17f386[_0x13be43(0xe5)]('⚠\x20'+_0x12e94f+':\x20'+_0x212a9b[_0x13be43(0xff)][_0x13be43(0x106)]+_0x13be43(0xe7))),console['log'](formatValidationResult(_0x212a9b,_0x4220b2,_0x12e94f))):(console[_0x13be43(0xfb)](a26_0x17f386['red']('✖\x20'+_0x12e94f+':\x20'+_0x212a9b[_0x13be43(0x10a)][_0x13be43(0x106)]+_0x13be43(0xeb))),console['log'](formatValidationResult(_0x212a9b,_0x4220b2,_0x12e94f)));}return console[_0x13be43(0xfb)](''),_0x4a4057['hasErrors']?(console['log'](a26_0x17f386[_0x13be43(0xe3)](_0x13be43(0xef)+_0x4a4057['invalidCount']+_0x13be43(0xfd)+_0x4a4057[_0x13be43(0x102)]+'\x20valid')),_0x4a4057[_0x13be43(0xfc)]>0x0&&console[_0x13be43(0xfb)](a26_0x17f386['yellow'](_0x4a4057[_0x13be43(0xfc)]+_0x13be43(0xf7))),_0x4a4057[_0x13be43(0xf3)]>0x0&&console[_0x13be43(0xfb)](a26_0x17f386[_0x13be43(0xdf)](_0x4a4057['skippedCount']+'\x20non-template\x20file(s)\x20skipped')),0x1):(console[_0x13be43(0xfb)](a26_0x17f386[_0x13be43(0x104)](_0x13be43(0xf2)+_0x4a4057[_0x13be43(0x102)]+_0x13be43(0xe6))),_0x4a4057[_0x13be43(0xfc)]>0x0&&console[_0x13be43(0xfb)](a26_0x17f386[_0x13be43(0xe5)](_0x4a4057[_0x13be43(0xfc)]+_0x13be43(0xf7))),_0x4a4057[_0x13be43(0xf3)]>0x0&&console[_0x13be43(0xfb)](a26_0x17f386[_0x13be43(0xdf)](_0x4a4057['skippedCount']+_0x13be43(0xf8))),0x0);}}
@@ -1 +1 @@
1
- const a27_0x3dfdcc=a27_0x2ad4;(function(_0x413557,_0x269def){const _0x4e0813=a27_0x2ad4,_0x114594=_0x413557();while(!![]){try{const _0x30c528=-parseInt(_0x4e0813(0x191))/0x1+parseInt(_0x4e0813(0x1ad))/0x2*(parseInt(_0x4e0813(0x1b8))/0x3)+parseInt(_0x4e0813(0x188))/0x4*(parseInt(_0x4e0813(0x1b5))/0x5)+parseInt(_0x4e0813(0x184))/0x6*(parseInt(_0x4e0813(0x19e))/0x7)+-parseInt(_0x4e0813(0x187))/0x8*(-parseInt(_0x4e0813(0x19c))/0x9)+-parseInt(_0x4e0813(0x1a9))/0xa+-parseInt(_0x4e0813(0x1c4))/0xb;if(_0x30c528===_0x269def)break;else _0x114594['push'](_0x114594['shift']());}catch(_0x299b28){_0x114594['push'](_0x114594['shift']());}}}(a27_0x217e,0x51f26));import{BaseCommand}from'./command.js';function a27_0x2ad4(_0x436b10,_0x4d0ff7){_0x436b10=_0x436b10-0x170;const _0x217e72=a27_0x217e();let _0x2ad4a6=_0x217e72[_0x436b10];return _0x2ad4a6;}import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a27_0x3467e6 from'chalk';function formatDuration(_0x2414c4){const _0x3564d7=a27_0x2ad4;if(_0x2414c4<0x3c)return _0x2414c4+'s';if(_0x2414c4<0xe10)return Math[_0x3564d7(0x1b1)](_0x2414c4/0x3c)+'m\x20'+_0x2414c4%0x3c+'s';const _0x3b2faa=Math['floor'](_0x2414c4/0xe10),_0x350d0f=Math[_0x3564d7(0x1b1)](_0x2414c4%0xe10/0x3c);return _0x350d0f>0x0?_0x3b2faa+'h\x20'+_0x350d0f+'m':_0x3b2faa+'h';}function formatRelativeTime(_0x358d5e){const _0x2c0980=a27_0x2ad4,_0x25b220=Date[_0x2c0980(0x17a)]()-_0x358d5e[_0x2c0980(0x1a4)](),_0x49fe0d=Math[_0x2c0980(0x1b1)](Math[_0x2c0980(0x174)](_0x25b220)/0x3e8);if(_0x49fe0d<0x3c)return _0x2c0980(0x170);const _0x232c47=Math['floor'](_0x49fe0d/0x3c);if(_0x232c47<0x3c)return _0x232c47+'m\x20ago';const _0x3479c0=Math[_0x2c0980(0x1b1)](_0x232c47/0x3c);if(_0x3479c0<0x18)return _0x3479c0+_0x2c0980(0x17c);const _0xfd808b=Math[_0x2c0980(0x1b1)](_0x3479c0/0x18);if(_0xfd808b<0x1e)return _0xfd808b+'d\x20ago';return Math[_0x2c0980(0x1b1)](_0xfd808b/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{[a27_0x3dfdcc(0x1b0)]=a27_0x3dfdcc(0x193);['description']=a27_0x3dfdcc(0x192);async[a27_0x3dfdcc(0x1b6)](_0x3e214f){const _0x1c7619=a27_0x3dfdcc,{options:_0x37ec34,tdx:_0xd7f9fb}=_0x3e214f,_0x1cdc94=resolveLimit(_0x37ec34[_0x1c7619(0x1aa)],DEFAULT_DISPLAY_LIMIT),_0x45d1e9=_0x37ec34[_0x1c7619(0x171)];_0x37ec34[_0x1c7619(0x199)]&&(console[_0x1c7619(0x1a1)]('Limit:\x20'+_0x1cdc94+'\x20jobs'),_0x45d1e9&&console[_0x1c7619(0x1a1)](_0x1c7619(0x1bc)+_0x45d1e9));const _0x10f783=await withSpinner(_0x1c7619(0x18d),()=>_0xd7f9fb[_0x1c7619(0x193)][_0x1c7619(0x176)]({'from':0x0,'to':_0x1cdc94-0x1,'status':_0x45d1e9}),{'verbose':_0x37ec34[_0x1c7619(0x199)]}),_0x2f7965=_0x10f783[_0x1c7619(0x1a2)];console[_0x1c7619(0x1a1)]('✔\x20Found\x20'+_0x2f7965['length']+'\x20job'+(_0x2f7965[_0x1c7619(0x1b2)]!==0x1?'s':''));const _0x29bd6d=_0x37ec34[_0x1c7619(0x189)];if(isStructuredFormat(_0x37ec34)){const _0x5e9084=_0x2f7965[_0x1c7619(0x1c0)](_0xed9585=>{const _0x4a0850=_0x1c7619;let _0x47066c;if(_0xed9585[_0x4a0850(0x186)]&&_0xed9585['end_at']){const _0x3d7b1e=new Date(_0xed9585[_0x4a0850(0x186)])[_0x4a0850(0x1a4)](),_0xf672b5=new Date(_0xed9585['end_at'])[_0x4a0850(0x1a4)]();_0x47066c=Math[_0x4a0850(0x18b)]((_0xf672b5-_0x3d7b1e)/0x3e8);}return{'job_id':_0xed9585[_0x4a0850(0x1a6)],'type':_0xed9585[_0x4a0850(0x1be)]===_0x4a0850(0x172)?_0x4a0850(0x1bb):_0xed9585[_0x4a0850(0x1be)],'status':_0xed9585[_0x4a0850(0x171)],'user_name':_0xed9585[_0x4a0850(0x1ba)],'duration_sec':_0x47066c,'created_at':_0xed9585['created_at'],'started_at':_0xed9585[_0x4a0850(0x186)],'end_at':_0xed9585[_0x4a0850(0x179)]};});await handleSDKOutput(_0x5e9084,_0x37ec34);}else for(const _0x1839dc of _0x2f7965){const _0xd27cc6=_0x1839dc[_0x1c7619(0x171)]===_0x1c7619(0x175)?a27_0x3467e6[_0x1c7619(0x198)]:_0x1839dc[_0x1c7619(0x171)]===_0x1c7619(0x1a1)?a27_0x3467e6[_0x1c7619(0x1af)]:a27_0x3467e6[_0x1c7619(0x1bf)],_0x18bb5b=_0xd27cc6(_0x1839dc[_0x1c7619(0x171)]),_0x1eaf84=getJobUrl(_0x29bd6d,_0x1839dc[_0x1c7619(0x1a6)]),_0x401fba=hyperlink(_0x1839dc[_0x1c7619(0x1a6)],_0x1eaf84),_0x44236e=a27_0x3467e6[_0x1c7619(0x1bf)](_0x1839dc[_0x1c7619(0x1be)]===_0x1c7619(0x172)?_0x1c7619(0x1bb):_0x1839dc[_0x1c7619(0x1be)]),_0x4aa0a7=[];if(_0x1839dc[_0x1c7619(0x186)]&&_0x1839dc[_0x1c7619(0x179)]){const _0x1ff89c=Math[_0x1c7619(0x18b)]((new Date(_0x1839dc[_0x1c7619(0x179)])[_0x1c7619(0x1a4)]()-new Date(_0x1839dc[_0x1c7619(0x186)])[_0x1c7619(0x1a4)]())/0x3e8);_0x4aa0a7[_0x1c7619(0x1ae)](formatDuration(_0x1ff89c));}if(_0x1839dc[_0x1c7619(0x179)])_0x4aa0a7[_0x1c7619(0x1ae)](formatRelativeTime(new Date(_0x1839dc[_0x1c7619(0x179)])));else _0x1839dc['start_at']&&_0x4aa0a7[_0x1c7619(0x1ae)](formatRelativeTime(new Date(_0x1839dc[_0x1c7619(0x186)])));const _0x2b752e=_0x4aa0a7[_0x1c7619(0x1b2)]>0x0?a27_0x3467e6['dim']('\x20'+_0x4aa0a7[_0x1c7619(0x1b9)](',\x20')):'';console[_0x1c7619(0x1a7)]('⚡\x20'+_0x401fba+'\x20'+_0x44236e+'\x20'+_0x18bb5b+_0x2b752e);}return 0x0;}}function a27_0x217e(){const _0x33f514=['just\x20now','status','presto','database','abs','success','list','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','Getting\x20job\x20details...','end_at','now','Database:\x20','h\x20ago','jobType','Show\x20job\x20details','\x20\x20Job\x20ID:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Submitting\x20kill\x20request...','description','show','722754Gjebgo','job:kill','start_at','152rNVctn','1099108DJtCIT','site','hive','round','Submit\x20a\x20job','Listing\x20jobs...','Kill\x20a\x20job','query','\x27\x20to\x20verify\x20the\x20job\x20status','172920lyXjeI','List\x20jobs','jobs','Job\x20type:\x20','priority','Get\x20job\x20results','yes','green','verbose','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','debug','163341nAAudm','url','7ZllXvl','args','information_schema','error','data','Submitting\x20job...','getTime','validate','job_id','log','result','1892160MqymwM','limit','INVALID_ARGUMENT','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','2ROelUM','push','red','name','floor','length','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','...','10zsCBjT','execute','job:result','1859961uZobeX','join','user_name','trino','Status\x20filter:\x20','kill','type','dim','map','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','file','job:show','10307451IOcBXi'];a27_0x217e=function(){return _0x33f514;};return a27_0x217e();}export class JobShowCommand extends BaseCommand{[a27_0x3dfdcc(0x1b0)]=a27_0x3dfdcc(0x1c3);[a27_0x3dfdcc(0x182)]=a27_0x3dfdcc(0x17e);[a27_0x3dfdcc(0x1a5)](_0x37b583){const _0x390241=a27_0x3dfdcc,_0x2d5a1b=_0x37b583[_0x390241(0x19f)][0x0];if(!_0x2d5a1b)return _0x390241(0x1b3);return undefined;}async['execute'](_0x5b85a8){const _0x32ad6a=a27_0x3dfdcc,{options:_0x5bbf7a,args:_0x1bc6f8,tdx:_0x30f26c}=_0x5b85a8,_0x3cc446=_0x1bc6f8[0x0],_0x436454=await withSpinner(_0x32ad6a(0x178),()=>_0x30f26c[_0x32ad6a(0x193)][_0x32ad6a(0x183)](_0x3cc446),{'verbose':_0x5bbf7a[_0x32ad6a(0x199)]}),_0x396116=_0x436454[_0x32ad6a(0x1a2)];let _0x4bdb51;if(_0x396116['start_at']&&_0x396116[_0x32ad6a(0x179)]){const _0x29f301=new Date(_0x396116[_0x32ad6a(0x186)])[_0x32ad6a(0x1a4)](),_0x4e0492=new Date(_0x396116[_0x32ad6a(0x179)])[_0x32ad6a(0x1a4)]();_0x4bdb51=Math[_0x32ad6a(0x18b)]((_0x4e0492-_0x29f301)/0x3e8);}const _0xc4db9e={'job_id':_0x396116[_0x32ad6a(0x1a6)],'type':_0x396116['type'],'status':_0x396116[_0x32ad6a(0x171)],..._0x396116[_0x32ad6a(0x1ba)]&&{'user_name':_0x396116[_0x32ad6a(0x1ba)]},..._0x4bdb51!==undefined&&{'duration_sec':_0x4bdb51},..._0x396116['created_at']&&{'created_at':_0x396116['created_at']},..._0x396116[_0x32ad6a(0x186)]&&{'started_at':_0x396116['start_at']},..._0x396116['end_at']&&{'end_at':_0x396116[_0x32ad6a(0x179)]},..._0x396116[_0x32ad6a(0x173)]&&{'database':_0x396116[_0x32ad6a(0x173)]},..._0x396116[_0x32ad6a(0x195)]!==undefined&&{'priority':_0x396116[_0x32ad6a(0x195)]},..._0x396116[_0x32ad6a(0x19d)]&&{'url':_0x396116[_0x32ad6a(0x19d)]},..._0x396116[_0x32ad6a(0x18f)]&&{'query':_0x396116[_0x32ad6a(0x18f)]},..._0x396116[_0x32ad6a(0x19b)]&&{'debug':_0x396116['debug']}};return await handleSingleObjectOutput(_0xc4db9e,_0x5bbf7a),0x0;}}export class JobKillCommand extends BaseCommand{[a27_0x3dfdcc(0x1b0)]=a27_0x3dfdcc(0x185);['description']=a27_0x3dfdcc(0x18e);[a27_0x3dfdcc(0x1a5)](_0x3b1c5f){const _0x2e3a4f=a27_0x3dfdcc,_0x50d8fb=_0x3b1c5f[_0x2e3a4f(0x19f)][0x0];if(!_0x50d8fb)return _0x2e3a4f(0x1c1);return undefined;}async[a27_0x3dfdcc(0x1b6)](_0x2b4134){const _0x34967b=a27_0x3dfdcc,{options:_0x435d4f,args:_0x16588d,tdx:_0x531c1b}=_0x2b4134,_0x4e725c=_0x16588d[0x0];if(!_0x435d4f[_0x34967b(0x197)]){const _0x317c40=await confirm(_0x34967b(0x180)+_0x4e725c+'?');if(!_0x317c40)return console[_0x34967b(0x1a1)]('Cancelled'),0x0;}return await withSpinner(_0x34967b(0x181),()=>_0x531c1b[_0x34967b(0x193)][_0x34967b(0x1bd)](_0x4e725c),{'verbose':_0x435d4f[_0x34967b(0x199)]}),console[_0x34967b(0x1a1)]('✔\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0x4e725c),console[_0x34967b(0x1a1)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x4e725c+_0x34967b(0x190)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a27_0x3dfdcc(0x1b0)]='job:submit';['description']=a27_0x3dfdcc(0x18c);async[a27_0x3dfdcc(0x1b6)](_0x530d06){const _0x3e6930=a27_0x3dfdcc,{options:_0x28cc18,args:_0x824e23,tdx:_0x1e6683}=_0x530d06,_0x14c90e=_0x28cc18[_0x3e6930(0x17d)]||'trino',_0xda0bae=_0x28cc18[_0x3e6930(0x1c2)],_0x13a74f=_0x28cc18[_0x3e6930(0x173)]||_0x3e6930(0x1a0),_0x27f17c=_0x28cc18[_0x3e6930(0x1a8)];if(_0x14c90e!==_0x3e6930(0x1bb)&&_0x14c90e!==_0x3e6930(0x18a))throw new SDKError(ErrorCode[_0x3e6930(0x1ab)],_0x3e6930(0x1ac));let _0x586cf5;if(_0xda0bae){if(_0x824e23[0x0])throw new SDKError(ErrorCode[_0x3e6930(0x1ab)],'Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option');const _0x160507=readSqlStatementsFromFile(_0xda0bae);if(_0x160507[_0x3e6930(0x1b2)]===0x0)throw new SDKError(ErrorCode[_0x3e6930(0x1ab)],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x160507['length']>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3e6930(0x177));_0x586cf5=_0x160507[0x0];}else{if(!_0x824e23[0x0])throw new SDKError(ErrorCode[_0x3e6930(0x1ab)],'Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>');_0x586cf5=_0x824e23[0x0];}_0x28cc18[_0x3e6930(0x199)]&&(console[_0x3e6930(0x1a1)](_0x3e6930(0x194)+_0x14c90e),console[_0x3e6930(0x1a1)](_0x3e6930(0x17b)+_0x13a74f),console[_0x3e6930(0x1a1)]('Query:\x20'+_0x586cf5['substring'](0x0,0x64)+(_0x586cf5['length']>0x64?_0x3e6930(0x1b4):'')));const _0xb46ef9=await withSpinner(_0x3e6930(0x1a3),()=>_0x1e6683['jobs']['submit'](_0x13a74f,_0x586cf5,_0x14c90e,_0x27f17c),{'verbose':_0x28cc18[_0x3e6930(0x199)]}),_0x11c838=_0xb46ef9[_0x3e6930(0x1a2)];return console[_0x3e6930(0x1a1)]('✔\x20Job\x20submitted'),console[_0x3e6930(0x1a1)](_0x3e6930(0x17f)+_0x11c838['job_id']),await handleSDKOutput([_0x11c838],_0x28cc18),0x0;}}export class JobResultCommand extends BaseCommand{[a27_0x3dfdcc(0x1b0)]=a27_0x3dfdcc(0x1b7);[a27_0x3dfdcc(0x182)]=a27_0x3dfdcc(0x196);[a27_0x3dfdcc(0x1a5)](_0x2fb187){const _0x258016=a27_0x3dfdcc,_0x56351b=_0x2fb187[_0x258016(0x19f)][0x0];if(!_0x56351b)return _0x258016(0x19a);return undefined;}async[a27_0x3dfdcc(0x1b6)](_0x2f7b2d){const _0x157bee=a27_0x3dfdcc,{options:_0x3c533c,args:_0x4917dc,tdx:_0x4b2428}=_0x2f7b2d,_0x57c96a=_0x4917dc[0x0],_0x171f15=await withSpinner('Getting\x20job\x20results...',()=>_0x4b2428['jobs'][_0x157bee(0x1a8)](_0x57c96a),{'verbose':_0x3c533c['verbose']}),_0x3a7f9f=_0x171f15[_0x157bee(0x1a2)];return console[_0x157bee(0x1a1)]('✔\x20Retrieved\x20'+_0x3a7f9f[_0x157bee(0x1b2)]+'\x20row'+(_0x3a7f9f[_0x157bee(0x1b2)]!==0x1?'s':'')),await handleSDKOutput(_0x3a7f9f,_0x3c533c),0x0;}}
1
+ const a27_0x8f726d=a27_0x3b32;(function(_0x1fa7de,_0x38aeb8){const _0x5e1c25=a27_0x3b32,_0x24be83=_0x1fa7de();while(!![]){try{const _0x59d345=-parseInt(_0x5e1c25(0x127))/0x1*(-parseInt(_0x5e1c25(0x133))/0x2)+parseInt(_0x5e1c25(0x160))/0x3+parseInt(_0x5e1c25(0x14f))/0x4+parseInt(_0x5e1c25(0x161))/0x5*(-parseInt(_0x5e1c25(0x162))/0x6)+-parseInt(_0x5e1c25(0x129))/0x7+-parseInt(_0x5e1c25(0x15f))/0x8+-parseInt(_0x5e1c25(0x159))/0x9;if(_0x59d345===_0x38aeb8)break;else _0x24be83['push'](_0x24be83['shift']());}catch(_0x49bfea){_0x24be83['push'](_0x24be83['shift']());}}}(a27_0x315f,0xa3eab));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';function a27_0x3b32(_0x2fb0b1,_0x3fe87a){_0x2fb0b1=_0x2fb0b1-0x115;const _0x315f29=a27_0x315f();let _0x3b3211=_0x315f29[_0x2fb0b1];return _0x3b3211;}import a27_0x3450cb from'chalk';function formatDuration(_0x4befc7){const _0x5f41d9=a27_0x3b32;if(_0x4befc7<0x3c)return _0x4befc7+'s';if(_0x4befc7<0xe10)return Math['floor'](_0x4befc7/0x3c)+'m\x20'+_0x4befc7%0x3c+'s';const _0x49f2eb=Math[_0x5f41d9(0x11f)](_0x4befc7/0xe10),_0x45a2f1=Math[_0x5f41d9(0x11f)](_0x4befc7%0xe10/0x3c);return _0x45a2f1>0x0?_0x49f2eb+'h\x20'+_0x45a2f1+'m':_0x49f2eb+'h';}function formatRelativeTime(_0x3b8e5b){const _0x44f6d7=a27_0x3b32,_0x5a648e=Date[_0x44f6d7(0x15b)]()-_0x3b8e5b[_0x44f6d7(0x116)](),_0x12e254=Math[_0x44f6d7(0x11f)](Math[_0x44f6d7(0x15c)](_0x5a648e)/0x3e8);if(_0x12e254<0x3c)return _0x44f6d7(0x144);const _0x29da9d=Math[_0x44f6d7(0x11f)](_0x12e254/0x3c);if(_0x29da9d<0x3c)return _0x29da9d+_0x44f6d7(0x16c);const _0x59bc21=Math['floor'](_0x29da9d/0x3c);if(_0x59bc21<0x18)return _0x59bc21+_0x44f6d7(0x13d);const _0x6eaeb2=Math[_0x44f6d7(0x11f)](_0x59bc21/0x18);if(_0x6eaeb2<0x1e)return _0x6eaeb2+_0x44f6d7(0x140);return Math[_0x44f6d7(0x11f)](_0x6eaeb2/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{[a27_0x8f726d(0x131)]=a27_0x8f726d(0x12a);[a27_0x8f726d(0x12f)]=a27_0x8f726d(0x11c);async['execute'](_0x319567){const _0x3c2069=a27_0x8f726d,{options:_0x4d0eab,tdx:_0x1f71ad}=_0x319567,_0x20ca90=resolveLimit(_0x4d0eab['limit'],DEFAULT_DISPLAY_LIMIT),_0x4e8340=_0x4d0eab[_0x3c2069(0x149)];_0x4d0eab[_0x3c2069(0x156)]&&(console['error'](_0x3c2069(0x130)+_0x20ca90+_0x3c2069(0x135)),_0x4e8340&&console['error'](_0x3c2069(0x151)+_0x4e8340));const _0x279e2b=await withSpinner(_0x3c2069(0x122),()=>_0x1f71ad[_0x3c2069(0x12a)][_0x3c2069(0x141)]({'from':0x0,'to':_0x20ca90-0x1,'status':_0x4e8340}),{'verbose':_0x4d0eab[_0x3c2069(0x156)]}),_0x13b517=_0x279e2b[_0x3c2069(0x148)];console[_0x3c2069(0x154)](_0x3c2069(0x171)+_0x13b517[_0x3c2069(0x139)]+_0x3c2069(0x137)+(_0x13b517[_0x3c2069(0x139)]!==0x1?'s':''));const _0x303d9b=_0x4d0eab[_0x3c2069(0x14b)];if(isStructuredFormat(_0x4d0eab)){const _0x40805e=_0x13b517[_0x3c2069(0x16b)](_0x50ce18=>{const _0x202b79=_0x3c2069;let _0xd9a79;if(_0x50ce18['start_at']&&_0x50ce18[_0x202b79(0x158)]){const _0x5828a1=new Date(_0x50ce18['start_at'])[_0x202b79(0x116)](),_0x3cb191=new Date(_0x50ce18['end_at'])['getTime']();_0xd9a79=Math[_0x202b79(0x143)]((_0x3cb191-_0x5828a1)/0x3e8);}return{'job_id':_0x50ce18['job_id'],'type':_0x50ce18[_0x202b79(0x169)]===_0x202b79(0x128)?'trino':_0x50ce18['type'],'status':_0x50ce18[_0x202b79(0x149)],'user_name':_0x50ce18['user_name'],'duration_sec':_0xd9a79,'created_at':_0x50ce18[_0x202b79(0x115)],'started_at':_0x50ce18[_0x202b79(0x125)],'end_at':_0x50ce18['end_at']};});await handleSDKOutput(_0x40805e,_0x4d0eab);}else for(const _0xfa2471 of _0x13b517){const _0x3ab8dd=_0xfa2471[_0x3c2069(0x149)]===_0x3c2069(0x13a)?a27_0x3450cb[_0x3c2069(0x13b)]:_0xfa2471[_0x3c2069(0x149)]===_0x3c2069(0x154)?a27_0x3450cb[_0x3c2069(0x16e)]:a27_0x3450cb[_0x3c2069(0x166)],_0x1f9a0c=_0x3ab8dd(_0xfa2471[_0x3c2069(0x149)]),_0x58199a=getJobUrl(_0x303d9b,_0xfa2471['job_id']),_0x1d4078=hyperlink(_0xfa2471[_0x3c2069(0x13c)],_0x58199a),_0x86653f=a27_0x3450cb[_0x3c2069(0x166)](_0xfa2471[_0x3c2069(0x169)]===_0x3c2069(0x128)?_0x3c2069(0x164):_0xfa2471[_0x3c2069(0x169)]),_0x21fe88=[];if(_0xfa2471[_0x3c2069(0x125)]&&_0xfa2471[_0x3c2069(0x158)]){const _0x4b5209=Math[_0x3c2069(0x143)]((new Date(_0xfa2471[_0x3c2069(0x158)])[_0x3c2069(0x116)]()-new Date(_0xfa2471[_0x3c2069(0x125)])[_0x3c2069(0x116)]())/0x3e8);_0x21fe88['push'](formatDuration(_0x4b5209));}if(_0xfa2471['end_at'])_0x21fe88[_0x3c2069(0x120)](formatRelativeTime(new Date(_0xfa2471[_0x3c2069(0x158)])));else _0xfa2471[_0x3c2069(0x125)]&&_0x21fe88['push'](formatRelativeTime(new Date(_0xfa2471['start_at'])));const _0xb4dadf=_0x21fe88[_0x3c2069(0x139)]>0x0?a27_0x3450cb[_0x3c2069(0x166)]('\x20'+_0x21fe88['join'](',\x20')):'';console[_0x3c2069(0x11a)]('⚡\x20'+_0x1d4078+'\x20'+_0x86653f+'\x20'+_0x1f9a0c+_0xb4dadf);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a27_0x8f726d(0x131)]=a27_0x8f726d(0x14c);['description']=a27_0x8f726d(0x123);['validate'](_0x2f997f){const _0x16832a=a27_0x8f726d,_0x5e5b5e=_0x2f997f[_0x16832a(0x155)][0x0];if(!_0x5e5b5e)return _0x16832a(0x12e);return undefined;}async[a27_0x8f726d(0x13e)](_0x2f31a5){const _0x34bc9c=a27_0x8f726d,{options:_0x3aee3c,args:_0x294f1e,tdx:_0x8213da}=_0x2f31a5,_0xa8aac8=_0x294f1e[0x0],_0x13bff2=await withSpinner('Getting\x20job\x20details...',()=>_0x8213da[_0x34bc9c(0x12a)][_0x34bc9c(0x146)](_0xa8aac8),{'verbose':_0x3aee3c['verbose']}),_0x51a501=_0x13bff2['data'];let _0x951c2b;if(_0x51a501['start_at']&&_0x51a501[_0x34bc9c(0x158)]){const _0x44fa53=new Date(_0x51a501['start_at'])[_0x34bc9c(0x116)](),_0x510340=new Date(_0x51a501[_0x34bc9c(0x158)])[_0x34bc9c(0x116)]();_0x951c2b=Math[_0x34bc9c(0x143)]((_0x510340-_0x44fa53)/0x3e8);}const _0x254e6b={'job_id':_0x51a501[_0x34bc9c(0x13c)],'type':_0x51a501[_0x34bc9c(0x169)],'status':_0x51a501[_0x34bc9c(0x149)],..._0x51a501[_0x34bc9c(0x12b)]&&{'user_name':_0x51a501[_0x34bc9c(0x12b)]},..._0x951c2b!==undefined&&{'duration_sec':_0x951c2b},..._0x51a501['created_at']&&{'created_at':_0x51a501['created_at']},..._0x51a501[_0x34bc9c(0x125)]&&{'started_at':_0x51a501[_0x34bc9c(0x125)]},..._0x51a501[_0x34bc9c(0x158)]&&{'end_at':_0x51a501[_0x34bc9c(0x158)]},..._0x51a501[_0x34bc9c(0x152)]&&{'database':_0x51a501[_0x34bc9c(0x152)]},..._0x51a501['priority']!==undefined&&{'priority':_0x51a501[_0x34bc9c(0x170)]},..._0x51a501['url']&&{'url':_0x51a501['url']},..._0x51a501[_0x34bc9c(0x13f)]&&{'query':_0x51a501['query']},..._0x51a501['debug']&&{'debug':_0x51a501['debug']}};return await handleSingleObjectOutput(_0x254e6b,_0x3aee3c),0x0;}}export class JobKillCommand extends BaseCommand{[a27_0x8f726d(0x131)]='job:kill';[a27_0x8f726d(0x12f)]=a27_0x8f726d(0x136);[a27_0x8f726d(0x118)](_0x4f6e08){const _0xc116f2=a27_0x8f726d,_0x21e03c=_0x4f6e08['args'][0x0];if(!_0x21e03c)return _0xc116f2(0x14e);return undefined;}async[a27_0x8f726d(0x13e)](_0x3efc52){const _0x1cedfe=a27_0x8f726d,{options:_0x178a57,args:_0x4e9203,tdx:_0x432a2c}=_0x3efc52,_0x4a64b5=_0x4e9203[0x0];if(!_0x178a57['yes']){const _0x279143=await confirm(_0x1cedfe(0x12c)+_0x4a64b5+'?');if(!_0x279143)return console['error'](_0x1cedfe(0x16d)),0x0;}return await withSpinner(_0x1cedfe(0x138),()=>_0x432a2c[_0x1cedfe(0x12a)][_0x1cedfe(0x134)](_0x4a64b5),{'verbose':_0x178a57[_0x1cedfe(0x156)]}),console['error'](_0x1cedfe(0x14a)+_0x4a64b5),console['error']('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x4a64b5+_0x1cedfe(0x12d)),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']=a27_0x8f726d(0x147);['description']=a27_0x8f726d(0x163);async[a27_0x8f726d(0x13e)](_0x59d8ae){const _0x12a35e=a27_0x8f726d,{options:_0x4636cc,args:_0x5e584e,tdx:_0x251eb7}=_0x59d8ae,_0x178caf=_0x4636cc[_0x12a35e(0x172)]||_0x12a35e(0x164),_0xcdcbb=_0x4636cc[_0x12a35e(0x121)],_0x764369=_0x4636cc[_0x12a35e(0x152)]||_0x12a35e(0x157),_0x5b6d1d=_0x4636cc[_0x12a35e(0x11b)];if(_0x178caf!==_0x12a35e(0x164)&&_0x178caf!==_0x12a35e(0x16a))throw new SDKError(ErrorCode[_0x12a35e(0x165)],_0x12a35e(0x153));let _0xb6a214;if(_0xcdcbb){if(_0x5e584e[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x12a35e(0x124));const _0x5cc27f=readSqlStatementsFromFile(_0xcdcbb);if(_0x5cc27f['length']===0x0)throw new SDKError(ErrorCode[_0x12a35e(0x165)],_0x12a35e(0x15a));if(_0x5cc27f[_0x12a35e(0x139)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x12a35e(0x14d));_0xb6a214=_0x5cc27f[0x0];}else{if(!_0x5e584e[0x0])throw new SDKError(ErrorCode[_0x12a35e(0x165)],'Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>');_0xb6a214=_0x5e584e[0x0];}_0x4636cc[_0x12a35e(0x156)]&&(console['error'](_0x12a35e(0x168)+_0x178caf),console[_0x12a35e(0x154)](_0x12a35e(0x142)+_0x764369),console[_0x12a35e(0x154)](_0x12a35e(0x145)+_0xb6a214[_0x12a35e(0x119)](0x0,0x64)+(_0xb6a214['length']>0x64?_0x12a35e(0x150):'')));const _0x504b3d=await withSpinner(_0x12a35e(0x167),()=>_0x251eb7[_0x12a35e(0x12a)][_0x12a35e(0x16f)](_0x764369,_0xb6a214,_0x178caf,_0x5b6d1d),{'verbose':_0x4636cc['verbose']}),_0xe33368=_0x504b3d['data'];return console[_0x12a35e(0x154)](_0x12a35e(0x11d)),console[_0x12a35e(0x154)](_0x12a35e(0x15d)+_0xe33368[_0x12a35e(0x13c)]),await handleSDKOutput([_0xe33368],_0x4636cc),0x0;}}export class JobResultCommand extends BaseCommand{['name']=a27_0x8f726d(0x15e);['description']='Get\x20job\x20results';['validate'](_0x490c98){const _0x2cec1d=a27_0x8f726d,_0x5dd29b=_0x490c98[_0x2cec1d(0x155)][0x0];if(!_0x5dd29b)return _0x2cec1d(0x126);return undefined;}async[a27_0x8f726d(0x13e)](_0x53cebd){const _0x594a0d=a27_0x8f726d,{options:_0x15e535,args:_0x170edc,tdx:_0x2c2f6f}=_0x53cebd,_0x575b42=_0x170edc[0x0],_0x543b70=await withSpinner(_0x594a0d(0x117),()=>_0x2c2f6f['jobs'][_0x594a0d(0x11b)](_0x575b42),{'verbose':_0x15e535[_0x594a0d(0x156)]}),_0x2cdb3a=_0x543b70[_0x594a0d(0x148)];return console[_0x594a0d(0x154)](_0x594a0d(0x11e)+_0x2cdb3a[_0x594a0d(0x139)]+_0x594a0d(0x132)+(_0x2cdb3a[_0x594a0d(0x139)]!==0x1?'s':'')),await handleSDKOutput(_0x2cdb3a,_0x15e535),0x0;}}function a27_0x315f(){const _0x4a2522=['h\x20ago','execute','query','d\x20ago','list','Database:\x20','round','just\x20now','Query:\x20','show','job:submit','data','status','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','site','job:show','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','5352312wxAIIU','...','Status\x20filter:\x20','database','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','error','args','verbose','information_schema','end_at','4433616SpBvrn','No\x20SQL\x20statements\x20found\x20in\x20file','now','abs','\x20\x20Job\x20ID:\x20','job:result','2179248xaOmWg','2316882XlzryU','15jnxAoV','1084836NxhUyZ','Submit\x20a\x20job','trino','INVALID_ARGUMENT','dim','Submitting\x20job...','Job\x20type:\x20','type','hive','map','m\x20ago','Cancelled','red','submit','priority','✔\x20Found\x20','jobType','created_at','getTime','Getting\x20job\x20results...','validate','substring','log','result','List\x20jobs','✔\x20Job\x20submitted','✔\x20Retrieved\x20','floor','push','file','Listing\x20jobs...','Show\x20job\x20details','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','start_at','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','1UONGGS','presto','8638658ZqXkCl','jobs','user_name','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','\x27\x20to\x20verify\x20the\x20job\x20status','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','description','Limit:\x20','name','\x20row','2205146ymTBHz','kill','\x20jobs','Kill\x20a\x20job','\x20job','Submitting\x20kill\x20request...','length','success','green','job_id'];a27_0x315f=function(){return _0x4a2522;};return a27_0x315f();}
@@ -1 +1 @@
1
- const a28_0x30f7ad=a28_0x47d7;(function(_0x46583d,_0x2faaf4){const _0x39961d=a28_0x47d7,_0x2f36f0=_0x46583d();while(!![]){try{const _0x4cd5a9=-parseInt(_0x39961d(0x241))/0x1*(-parseInt(_0x39961d(0x191))/0x2)+-parseInt(_0x39961d(0x1ef))/0x3*(parseInt(_0x39961d(0x19d))/0x4)+parseInt(_0x39961d(0x27a))/0x5*(parseInt(_0x39961d(0x25d))/0x6)+parseInt(_0x39961d(0x1cd))/0x7*(parseInt(_0x39961d(0x20e))/0x8)+parseInt(_0x39961d(0x1b3))/0x9+-parseInt(_0x39961d(0x254))/0xa+parseInt(_0x39961d(0x1de))/0xb*(-parseInt(_0x39961d(0x18e))/0xc);if(_0x4cd5a9===_0x2faaf4)break;else _0x2f36f0['push'](_0x2f36f0['shift']());}catch(_0x5e8df9){_0x2f36f0['push'](_0x2f36f0['shift']());}}}(a28_0xa595,0x3c0f5));import a28_0x263096 from'chalk';import a28_0x242512 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a28_0x47d7(_0x159b63,_0x19f04f){_0x159b63=_0x159b63-0x17e;const _0xa59599=a28_0xa595();let _0x47d7ae=_0xa59599[_0x159b63];return _0x47d7ae;}import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';function a28_0xa595(){const _0x5221b6=['split','No\x20statistics\x20available\x20for\x20journey:\x20','Getting\x20journey\x20traffic\x20data...','Write\x20','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','Target\x20directory:\x20','\x20\x20Consolidating\x20duplicate\x20segment:\x20','\x0aError:','milestoneSize','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','\x22\x20paused','segmentPushCommand','hasChanges','📁\x20','user','nodes','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','stringify','\x20(rule\x20match)','Input:\x20','resourceName','resolveParentId','folders','listVersions','renderStats','424648McFOQT','journeyBundleName','Creating\x20new\x20version...','entries','data','journey:version:create','Fetching\x20users\x20and\x20connections...','push','conversion','filePath','\x20changed\x20files','(completed)','createVersion','(archived)','jsonl','dim','no_parent','bold','options','Table:\x20','targetDir','buildIdToEmailMap','\x20\x20Name:\x20','Getting\x20version\x20','\x20\x20Statistics\x20not\x20available','journey:columns','buildIdToNameMap','Aborted.','description','folderId','relativePath','absolutePath','Error:\x20Parent\x20segment\x20context\x20required','repeat','journey:resume','stage','\x20version','reentryMode','args','\x20journey','journey:pause','activation_','journey:push','\x20\x20-\x20','blue','session','state','cwd','Target\x20file:\x20','Error:\x20','Fetching\x20','12Dnupuv','completed','✔\x20Context\x20set:\x20','all','diff','...','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','goal','journey:traffic','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','join','\x20\x20Preserving\x20local\x20segment\x20name:\x20','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','verbose','Options:','cyan','Getting\x20journey\x20details...','\x20\x20Journey\x20ID:\x20','type','2442010qwDBmZ','listFolders','add','Warning:\x20Could\x20not\x20resolve\x20segment\x20','journeys','sort','Listing\x20journeys...','Folder\x20path:\x20','json','897054cCEoFo','journeyId','includeStats','set','Resuming\x20journey...','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','setPhase','(paused)','execute','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','journey','\x20\x20Parent\x20segment:\x20','✔\x20Found\x20','Error:\x20--version\x20option\x20is\x20required','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','journeyBundleId','test','isNew','segmentName','hasPeriod','root\x20folder','getStatistics','journey:list','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)','parentSegment','red','10kJtpvZ','\x20Opening\x20','listJourneysWithFolders','has','helpText','INVALID_ARGUMENT','folderPath','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','Pattern:\x20','site','Fetching\x20parent\x20segment...','.yml','journeyStages','format','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','updatedAt','getSegment','Pausing\x20journey...','table','versionNumber','\x20activation','Cancelled','Database:\x20','log','utf-8','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','file','\x20versions)','listActivationsFlat','2836680QznzWy','filter','map','46228nHHMdR','yellow','errorCode','version','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Fetching\x20journeys\x20and\x20folders...','(root)','/j/da','history','\x20journey\x20files\x20to\x20','completionRate','error','200nxhCri','🗺️\x20','\x20journeys','yes','exitOrJumpRate','\x22\x20not\x20found','getJourney','Export\x20journey(s)\x20as\x20YAML\x20files','draft','Resolving\x20version...','getActivation','kind','/e/','createdAt','attributes','/app/ps/','audienceId','journeyName','includeHistory','toLowerCase','dryRun','\x20=\x20','3690936ZuGRkc','launched','green','Parent\x20segment:\x20','then','Getting\x20journey\x20statistics...','name','\x20(ID:\x20','connector_config','(draft)','Resolving\x20parent\x20segment...','List\x20journeys\x20in\x20current\x20context','stages','Journey\x20name:\x20','journey:version:view','getColumnMapping','-\x20no\x20files\x20written','journey:stats','Error:\x20Invalid\x20--type\x20\x22','web','journey:pull','connection','/j/da/je','Available\x20stages:\x20','Found\x20','\x27\x20not\x20found\x20in\x20','42ZtsDng','rule','rootFolderId','values','exitOrJumpSize','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','paused','\x20\x20Target:\x20','No\x20journeys\x20found','Resume\x20a\x20paused\x20journey','segment','enteredSize','Error:\x20Version\x20','Error:\x20Stage\x20\x22','resume','length','listJourneysFromParentSegment','33iKdGBs','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','size','relative','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','✔\x20Journey\x20\x22','\x20details...','\x20\x20Folder\x20path:\x20','\x22\x20resumed','from','\x20Created\x20v','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','get','base','List\x20activations\x20for\x20a\x20journey',',\x20version:\x20','message','6336OzIQWQ','localeCompare','pause','activation','find','database'];a28_0xa595=function(){return _0x5221b6;};return a28_0xa595();}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x17a46f){const _0x1e9bd9=a28_0x47d7;return!_0x17a46f&&(console[_0x1e9bd9(0x19c)](_0x1e9bd9(0x276)),console[_0x1e9bd9(0x19c)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x17a46f;}function withJsonFormat(_0xe2b12a){const _0x3dead6=a28_0x47d7;if(!_0xe2b12a[_0x3dead6(0x17e)]&&!_0xe2b12a[_0x3dead6(0x25c)]&&!_0xe2b12a['jsonl']&&!_0xe2b12a['tsv'])return{..._0xe2b12a,'format':_0x3dead6(0x25c),'json':!![]};return _0xe2b12a;}function formatJourneyState(_0x2a2dc5){const _0x272d3c=a28_0x47d7;switch(_0x2a2dc5){case _0x272d3c(0x1b4):return a28_0x263096[_0x272d3c(0x1b5)]('(running)');case _0x272d3c(0x1a5):return a28_0x263096[_0x272d3c(0x21d)](_0x272d3c(0x1bc));case _0x272d3c(0x1d3):return a28_0x263096['yellow'](_0x272d3c(0x264));case _0x272d3c(0x242):return a28_0x263096[_0x272d3c(0x23a)](_0x272d3c(0x219));case'archived':return a28_0x263096[_0x272d3c(0x21d)](_0x272d3c(0x21b));default:return'('+_0x2a2dc5+')';}}function formatJourneyItem(_0x455002,_0x42d38f='',_0xfa5403){const _0x4ca639=a28_0x47d7,_0x3d1a43=formatJourneyState(_0x455002[_0x4ca639(0x23c)]),_0x491a1f=_0xfa5403?hyperlink(_0x455002['journeyBundleName'],_0xfa5403):_0x455002[_0x4ca639(0x20f)];return _0x42d38f+_0x4ca639(0x19e)+_0x491a1f+'\x20'+_0x3d1a43;}function escapeRegex(_0x429fc1){return _0x429fc1['replace'](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}function globToRegex(_0x40ec65){const _0x3f7097=a28_0x47d7,_0x472028=_0x40ec65[_0x3f7097(0x1f5)]('*')[_0x3f7097(0x190)](escapeRegex);return new RegExp(_0x472028[_0x3f7097(0x24b)]('.*'),'i');}function buildRuleToNameMapping(_0x5f2eb0){const _0x22751a=a28_0x47d7,_0x5d6aa9=new Map();if(_0x5f2eb0['segments'])for(const [_0x21ac63,_0x20c90f]of Object[_0x22751a(0x211)](_0x5f2eb0['segments'])){if(_0x20c90f[_0x22751a(0x1ce)]){const _0x36ca79=serializeRule(_0x20c90f['rule']),_0x798707=_0x5d6aa9['get'](_0x36ca79);_0x798707?_0x798707[_0x22751a(0x215)](_0x21ac63):_0x5d6aa9[_0x22751a(0x260)](_0x36ca79,[_0x21ac63]);}}return _0x5d6aa9;}async function resolveJourneyIdFromInput(_0x54f1b8,_0x4d9cad,_0x305af0){const _0x1ac315=a28_0x47d7,_0x21150c=await resolveJourneyTarget(_0x54f1b8,_0x4d9cad['parentSegment'],_0x4d9cad[_0x1ac315(0x24e)]),_0x43a98a=_0x21150c[_0x1ac315(0x278)];if(!_0x43a98a)throw new SDKError(ErrorCode[_0x1ac315(0x27f)],_0x1ac315(0x247));const _0x584215=await withSpinner(_0x1ac315(0x1bd),()=>_0x305af0[_0x1ac315(0x1d7)][_0x1ac315(0x20a)](_0x43a98a),{'verbose':_0x4d9cad[_0x1ac315(0x24e)]}),_0x1608bf=_0x584215[_0x1ac315(0x212)],_0x348d8d=await withSpinner('Resolving\x20journey...',()=>_0x305af0[_0x1ac315(0x269)]['resolveJourneyId'](_0x1608bf,_0x21150c[_0x1ac315(0x1ae)]),{'verbose':_0x4d9cad['verbose']});return{'journeyId':_0x348d8d[_0x1ac315(0x212)],'journeyName':_0x21150c[_0x1ac315(0x1ae)],'parentSegmentId':_0x1608bf};}async function resolveJourneyTarget(_0x30a087,_0x15bdfb,_0x563006){const _0x1a0ff8=a28_0x47d7;if(isYamlFilePath(_0x30a087))try{const _0x257985=await resolveYamlFilePath(_0x30a087);return _0x563006&&(console[_0x1a0ff8(0x19c)]('Resolved\x20YAML\x20file:\x20'+_0x30a087),console[_0x1a0ff8(0x19c)](_0x1a0ff8(0x26a)+_0x257985['parentSegment']),console['error'](_0x1a0ff8(0x224)+_0x257985['segmentName']),console[_0x1a0ff8(0x19c)](_0x1a0ff8(0x1e5)+(_0x257985['folderPath']||'(root)'))),{'journeyName':_0x257985[_0x1a0ff8(0x271)],'parentSegment':_0x257985[_0x1a0ff8(0x278)],'resolved':_0x257985};}catch(_0x3decd1){throw new SDKError(ErrorCode[_0x1a0ff8(0x27f)],_0x1a0ff8(0x268)+_0x3decd1[_0x1a0ff8(0x1ee)]);}if(!_0x15bdfb)throw new SDKError(ErrorCode[_0x1a0ff8(0x27f)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x30a087,'parentSegment':_0x15bdfb};}export class JourneyListCommand extends BaseCommand{[a28_0x30f7ad(0x1b9)]=a28_0x30f7ad(0x275);[a28_0x30f7ad(0x22a)]=a28_0x30f7ad(0x1be);async[a28_0x30f7ad(0x265)](_0x514662){const _0x4366da=a28_0x30f7ad,{options:_0x512d67,args:_0x29c2d0,tdx:_0x196ed3}=_0x514662,_0xb75c18=_0x29c2d0[0x0],_0x7325f0=_0x512d67[_0x4366da(0x278)];if(!_0x7325f0)return console[_0x4366da(0x19c)](_0x4366da(0x22e)),console[_0x4366da(0x19c)](_0x4366da(0x1e9)),0x1;const _0x2845a4=await withSpinner(_0x4366da(0x1bd),()=>_0x196ed3[_0x4366da(0x1d7)][_0x4366da(0x20a)](_0x7325f0),{'verbose':_0x512d67[_0x4366da(0x24e)]}),_0x32e6e2=_0x2845a4[_0x4366da(0x212)];_0x512d67[_0x4366da(0x24e)]&&(console[_0x4366da(0x19c)](_0x4366da(0x1b6)+_0x7325f0+_0x4366da(0x1ba)+_0x32e6e2+')'),_0xb75c18&&console[_0x4366da(0x19c)](_0x4366da(0x282)+_0xb75c18));const _0x2a1a74=await withSpinner(_0x4366da(0x284),()=>_0x196ed3['segment']['getParentFull'](_0x32e6e2),{'verbose':_0x512d67[_0x4366da(0x24e)]}),_0x236b3b=_0x2a1a74[_0x4366da(0x212)],_0x3a5a42=_0x236b3b[_0x4366da(0x1cf)],_0x5e48e9=await withSpinner(_0x4366da(0x25a),()=>_0x196ed3[_0x4366da(0x269)][_0x4366da(0x27c)](_0x32e6e2,_0x3a5a42),{'verbose':_0x512d67[_0x4366da(0x24e)]});let _0x37d8a8=_0x5e48e9['data'][_0x4366da(0x258)];const _0x26c4ee=_0x5e48e9[_0x4366da(0x212)][_0x4366da(0x20b)],_0x4fd587=new Map();for(const _0x1def7b of _0x26c4ee){_0x4fd587[_0x4366da(0x260)](_0x1def7b['id'],_0x1def7b[_0x4366da(0x1b9)]);}if(_0xb75c18){const _0x3b81e6=globToRegex(_0xb75c18);_0x37d8a8=_0x37d8a8[_0x4366da(0x18f)](_0x16d2a2=>_0x3b81e6[_0x4366da(0x26f)](_0x16d2a2[_0x4366da(0x20f)]));}console['error'](_0x4366da(0x26b)+_0x37d8a8['length']+_0x4366da(0x235)+(_0x37d8a8[_0x4366da(0x1dc)]!==0x1?'s':''));const _0x4a6c25=_0x4bbe55=>{const _0x1caf5f=_0x4366da;return getConsoleNextUrl(_0x512d67[_0x1caf5f(0x283)],'/app/ps/'+_0x32e6e2+_0x1caf5f(0x1a9)+_0x4bbe55+_0x1caf5f(0x198));};if(_0x512d67[_0x4366da(0x17e)]===_0x4366da(0x183))await handleSDKOutput(_0x37d8a8,_0x512d67);else{if(_0x512d67[_0x4366da(0x17e)]===_0x4366da(0x25c)){const _0x1d3a7b=_0x37d8a8[_0x4366da(0x190)](_0x9f0ae7=>({..._0x9f0ae7,'url':_0x4a6c25(_0x9f0ae7['id'])}));await handleSDKOutput(_0x1d3a7b,_0x512d67);}else{console[_0x4366da(0x188)]('['+_0x7325f0+']');const _0x4e3498=new Map(),_0x267c95=[];for(const _0x55a0cf of _0x37d8a8){if(!_0x55a0cf['folderId']||_0x55a0cf['folderId']===_0x3a5a42)_0x267c95[_0x4366da(0x215)](_0x55a0cf);else{const _0x4c98bf=_0x4e3498[_0x4366da(0x1ea)](_0x55a0cf[_0x4366da(0x22b)])||[];_0x4c98bf[_0x4366da(0x215)](_0x55a0cf),_0x4e3498[_0x4366da(0x260)](_0x55a0cf['folderId'],_0x4c98bf);}}const _0x456f15=(_0x1f93b6,_0x56154c)=>_0x1f93b6['journeyBundleName'][_0x4366da(0x1f0)](_0x56154c[_0x4366da(0x20f)],undefined,{'sensitivity':_0x4366da(0x1eb)});_0x267c95['sort'](_0x456f15);for(const _0x4fd493 of _0x267c95){console[_0x4366da(0x188)](formatJourneyItem(_0x4fd493,'',_0x4a6c25(_0x4fd493['id'])));}const _0x3ca3f3=[..._0x4e3498[_0x4366da(0x211)]()][_0x4366da(0x259)]((_0x4a9054,_0x1218b2)=>{const _0x48f5a0=_0x4366da,_0x477e5d=_0x4fd587[_0x48f5a0(0x1ea)](_0x4a9054[0x0])||_0x4a9054[0x0],_0x7d36f0=_0x4fd587[_0x48f5a0(0x1ea)](_0x1218b2[0x0])||_0x1218b2[0x0];return _0x477e5d[_0x48f5a0(0x1f0)](_0x7d36f0,undefined,{'sensitivity':'base'});});for(const [_0x55239a,_0x1db925]of _0x3ca3f3){const _0x163d5b=_0x4fd587[_0x4366da(0x1ea)](_0x55239a)||_0x55239a;console[_0x4366da(0x188)](_0x4366da(0x202)+_0x163d5b),_0x1db925[_0x4366da(0x259)](_0x456f15);for(const _0x5d0cb3 of _0x1db925){console['log'](formatJourneyItem(_0x5d0cb3,'\x20\x20',_0x4a6c25(_0x5d0cb3['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a28_0x30f7ad(0x1b9)]='journey:view';[a28_0x30f7ad(0x22a)]='Show\x20journey\x20details';async[a28_0x30f7ad(0x265)](_0xbc2c7){const _0x1f43ea=a28_0x30f7ad,{options:_0xb8e89f,args:_0x5120b7,tdx:_0x5e3e65}=_0xbc2c7,_0x5dfae6=_0x5120b7[0x0];if(!_0x5dfae6)return console['error']('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console['error'](_0x1f43ea(0x1fe)),console['error'](_0x1f43ea(0x24f)),console[_0x1f43ea(0x19c)]('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0xb8e89f['verbose']&&console[_0x1f43ea(0x19c)](_0x1f43ea(0x208)+_0x5dfae6);const {journeyId:_0x107c85,parentSegmentId:_0x1c50d8}=await resolveJourneyIdFromInput(_0x5dfae6,_0xb8e89f,_0x5e3e65);if(_0xb8e89f[_0x1f43ea(0x1c6)]){const _0x18cca2=getConsoleNextUrl(_0xb8e89f['site'],_0x1f43ea(0x1ac)+_0x1c50d8+_0x1f43ea(0x1a9)+_0x107c85+_0x1f43ea(0x1c9));return console[_0x1f43ea(0x19c)](a28_0x263096[_0x1f43ea(0x1b5)]('✔')+_0x1f43ea(0x27b)+a28_0x263096[_0x1f43ea(0x250)](_0x18cca2)),openBrowser(_0x18cca2),0x0;}const _0x4cd3e5=await withSpinner(_0x1f43ea(0x251),()=>_0x5e3e65[_0x1f43ea(0x269)][_0x1f43ea(0x1a3)](_0x107c85),{'verbose':_0xb8e89f[_0x1f43ea(0x24e)]}),_0x35418a=_0x4cd3e5['data'],_0x3477af=_0xb8e89f[_0x1f43ea(0x25f)];let _0x26be94;if(_0x3477af)try{const _0x51b721=await withSpinner(_0x1f43ea(0x1b8),()=>_0x5e3e65['journey'][_0x1f43ea(0x274)](_0x107c85),{'verbose':_0xb8e89f[_0x1f43ea(0x24e)]});_0x26be94=_0x51b721[_0x1f43ea(0x212)];}catch{_0xb8e89f['verbose']&&console['error'](_0x1f43ea(0x226));}const _0x3218c2=getConsoleNextUrl(_0xb8e89f[_0x1f43ea(0x283)],_0x1f43ea(0x1ac)+_0x1c50d8+_0x1f43ea(0x1a9)+_0x107c85+_0x1f43ea(0x1c9)),_0x26b257={'id':_0x35418a['id'],'name':_0x35418a[_0x1f43ea(0x1ab)][_0x1f43ea(0x1b9)],'description':_0x35418a[_0x1f43ea(0x1ab)][_0x1f43ea(0x22a)],'state':_0x35418a[_0x1f43ea(0x1ab)][_0x1f43ea(0x23c)],'paused':_0x35418a[_0x1f43ea(0x1ab)][_0x1f43ea(0x1d3)],'reentry_mode':_0x35418a[_0x1f43ea(0x1ab)][_0x1f43ea(0x233)],'stages':_0x35418a[_0x1f43ea(0x1ab)][_0x1f43ea(0x286)]?.[_0x1f43ea(0x1dc)]||0x0,..._0x35418a[_0x1f43ea(0x1ab)][_0x1f43ea(0x248)]&&{'goal':_0x35418a[_0x1f43ea(0x1ab)][_0x1f43ea(0x248)]['name']},..._0x26be94&&{'statistics':{'size':_0x26be94[_0x1f43ea(0x1e0)],'entered':_0x26be94[_0x1f43ea(0x1d8)],'goal_achieved':_0x26be94['goalSize'],'completion_rate':_0x26be94[_0x1f43ea(0x19b)],'exit_or_jump':_0x26be94[_0x1f43ea(0x1d1)],'exit_or_jump_rate':_0x26be94[_0x1f43ea(0x1a1)],'stages':_0x26be94[_0x1f43ea(0x1bf)]}},'url':_0x3218c2};return await handleSingleObjectOutput(_0x26b257,_0xb8e89f),0x0;}}export class JourneyStatsCommand extends BaseCommand{['name']=a28_0x30f7ad(0x1c4);[a28_0x30f7ad(0x22a)]='Show\x20journey\x20statistics';async['execute'](_0x5beb96){const _0xed3a2d=a28_0x30f7ad,{options:_0x33fe27,args:_0x22baa0,tdx:_0x2b8682}=_0x5beb96,_0x21771b=_0x22baa0[0x0];if(!requireNameOrPath(_0x21771b))return 0x1;_0x33fe27['verbose']&&console['error']('Input:\x20'+_0x21771b);const _0x34d39c=_0x33fe27,_0x3583a3=_0x34d39c['from'],_0x5779fc=_0x34d39c['to'],_0x140584=_0x34d39c['includeHistory'],_0x5709ee=_0x34d39c[_0xed3a2d(0x231)];_0x140584&&!_0x3583a3&&!_0x5779fc&&console[_0xed3a2d(0x19c)](_0xed3a2d(0x1f9));const _0x532d3a=_0x140584?withJsonFormat(_0x33fe27):_0x33fe27,{journeyId:_0x54a9c5,journeyName:_0x230114}=await resolveJourneyIdFromInput(_0x21771b,_0x532d3a,_0x2b8682),_0x20cb1a=_0x3583a3||_0x5779fc?{'from':_0x3583a3,'to':_0x5779fc}:undefined,_0x4c5fef=await withSpinner(_0xed3a2d(0x1b8),()=>Promise[_0xed3a2d(0x244)]([_0x2b8682['journey']['getJourney'](_0x54a9c5),_0x2b8682[_0xed3a2d(0x269)][_0xed3a2d(0x274)](_0x54a9c5,_0x20cb1a)]),{'verbose':_0x532d3a[_0xed3a2d(0x24e)]}),[_0x4ec4e2,_0x3de72e]=_0x4c5fef[_0xed3a2d(0x212)];if(!_0x3de72e||_0x3de72e[_0xed3a2d(0x25e)]===null)return console[_0xed3a2d(0x19c)](_0xed3a2d(0x1f6)+_0x230114),console['error'](_0xed3a2d(0x24d)),0x0;const _0x102634=buildStageNameMap(_0x4ec4e2),_0xfa1bd6=!!(_0x20cb1a&&_0x3de72e['history']?.[_0xed3a2d(0x1dc)]),_0x31d625={'stageNameMap':_0x102634,'hasPeriod':_0xfa1bd6,'includeHistory':!!_0x140584};if(_0x5709ee&&_0x3de72e[_0xed3a2d(0x1bf)]){const _0x1b4b8c=_0x3de72e[_0xed3a2d(0x1bf)][_0xed3a2d(0x1f3)](_0x1a67c5=>{const _0x23894d=_0xed3a2d,_0x3582bf=_0x102634[_0x23894d(0x1ea)](_0x1a67c5['id'])??'';return _0x3582bf[_0x23894d(0x1b0)]()===_0x5709ee[_0x23894d(0x1b0)]();});if(_0x1b4b8c)return await handleSingleObjectOutput(formatStageStats(_0x1b4b8c,_0x31d625),_0x532d3a),0x0;const _0x3b2aca=_0x3de72e[_0xed3a2d(0x1bf)]['map'](_0x168d13=>_0x102634[_0xed3a2d(0x1ea)](_0x168d13['id'])??_0x168d13['id']);return console[_0xed3a2d(0x19c)](_0xed3a2d(0x1da)+_0x5709ee+_0xed3a2d(0x1a2)),console[_0xed3a2d(0x19c)](_0xed3a2d(0x1ca)+_0x3b2aca[_0xed3a2d(0x24b)](',\x20')),0x1;}const _0x1aab43=_0x3de72e[_0xed3a2d(0x1bf)]?.[_0xed3a2d(0x190)](_0x452245=>formatStageStats(_0x452245,_0x31d625)),_0x506ee0=assembleJourneyStats(_0x3de72e,{'from':_0x3583a3,'to':_0x5779fc,'includeHistory':_0x140584});return await this['renderStats'](_0x506ee0,_0x1aab43??[],_0x532d3a),0x0;}async[a28_0x30f7ad(0x20d)](_0xa551b8,_0x4082e9,_0x1a5a7e){const _0x2f2d20=a28_0x30f7ad,_0x3d75fd=_0x1a5a7e[_0x2f2d20(0x17e)]==='json'||_0x1a5a7e[_0x2f2d20(0x17e)]==='jsonl'||_0x1a5a7e['json']||_0x1a5a7e[_0x2f2d20(0x21c)];if(_0x3d75fd){_0xa551b8[_0x2f2d20(0x1bf)]=_0x4082e9,await handleSingleObjectOutput(_0xa551b8,_0x1a5a7e);return;}await handleSingleObjectOutput(_0xa551b8,_0x1a5a7e);for(const _0x2e0ece of _0x4082e9){console[_0x2f2d20(0x188)](''),console[_0x2f2d20(0x188)](String(a28_0x263096[_0x2f2d20(0x250)][_0x2f2d20(0x21f)]('['+_0x2e0ece[_0x2f2d20(0x1b9)]+']'))+a28_0x263096[_0x2f2d20(0x21d)]('\x20'+_0x2e0ece['id']));const {id:_0x2ca55e,name:_0x24ae7f,..._0x41678f}=_0x2e0ece;await handleSingleObjectOutput(_0x41678f,_0x1a5a7e);}}}export class JourneyTrafficCommand extends BaseCommand{[a28_0x30f7ad(0x1b9)]=a28_0x30f7ad(0x249);[a28_0x30f7ad(0x22a)]='Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)';async[a28_0x30f7ad(0x265)](_0x3e0a82){const _0x40cb25=a28_0x30f7ad,{options:_0x408d38,args:_0x4ad784,tdx:_0xa70942}=_0x3e0a82,_0x24e6e0=_0x4ad784[0x0];if(!requireNameOrPath(_0x24e6e0))return 0x1;_0x408d38[_0x40cb25(0x24e)]&&console[_0x40cb25(0x19c)]('Input:\x20'+_0x24e6e0);const _0x1bc0c1=_0x408d38,_0x2bdec0=_0x1bc0c1['type'],_0x5d015d=_0x1bc0c1[_0x40cb25(0x1e7)],_0x425a23=_0x1bc0c1['to'],_0x3cf0fa=_0x1bc0c1['limit'];if(_0x2bdec0&&_0x2bdec0!==_0x40cb25(0x216)&&_0x2bdec0!==_0x40cb25(0x1f2))return console['error'](_0x40cb25(0x1c5)+_0x2bdec0+_0x40cb25(0x266)),0x1;const _0x37f098=withJsonFormat(_0x408d38),{journeyId:_0x4d6e56,journeyName:_0x34fad6}=await resolveJourneyIdFromInput(_0x24e6e0,_0x37f098,_0xa70942),_0x20b091={'type':_0x2bdec0,'from':_0x5d015d,'to':_0x425a23,'limit':_0x3cf0fa},_0x47d43c=await withSpinner(_0x40cb25(0x1f7),()=>_0xa70942[_0x40cb25(0x269)]['getTrafficData'](_0x4d6e56,_0x20b091),{'verbose':_0x37f098[_0x40cb25(0x24e)]}),_0x2e7691=_0x47d43c[_0x40cb25(0x212)],_0x5ac6c9=_0x2e7691[_0x40cb25(0x216)]&&(_0x2e7691['conversion'][_0x40cb25(0x204)][_0x40cb25(0x1dc)]>0x0||_0x2e7691[_0x40cb25(0x216)]['links'][_0x40cb25(0x1dc)]>0x0),_0x438bd0=_0x2e7691['activation']&&_0x2e7691[_0x40cb25(0x1f2)]['length']>0x0;if(!_0x5ac6c9&&!_0x438bd0)return console[_0x40cb25(0x19c)](_0x40cb25(0x1e2)+_0x34fad6),console[_0x40cb25(0x19c)](_0x40cb25(0x18a)),_0x5d015d&&_0x425a23&&console[_0x40cb25(0x19c)](_0x40cb25(0x1d2)),0x0;return await handleSingleObjectOutput(_0x2e7691,_0x37f098),0x0;}}function formatStageStats(_0x5e7c41,_0x572026){const _0x144de5=a28_0x30f7ad,_0xde30b6=_0x572026[_0x144de5(0x272)]&&_0x5e7c41[_0x144de5(0x199)]?.[_0x144de5(0x1dc)]?aggregateStageHistory(_0x5e7c41[_0x144de5(0x199)]):{'size':_0x5e7c41[_0x144de5(0x1e0)],'entered':_0x5e7c41[_0x144de5(0x1d8)],'milestone':_0x5e7c41[_0x144de5(0x1fd)],'milestone_rate':_0x5e7c41['completeMilestoneRate'],'exit_or_jump':_0x5e7c41[_0x144de5(0x1d1)],'exit_or_jump_rate':_0x5e7c41[_0x144de5(0x1a1)]},_0x161f85={'id':_0x5e7c41['id'],'name':_0x572026['stageNameMap']['get'](_0x5e7c41['id'])??_0x5e7c41['id'],..._0xde30b6};return _0x572026[_0x144de5(0x272)]&&_0x572026[_0x144de5(0x1af)]&&_0x5e7c41[_0x144de5(0x199)]&&(_0x161f85['history']=_0x5e7c41[_0x144de5(0x199)]),_0x161f85;}export class JourneyPauseCommand extends BaseCommand{[a28_0x30f7ad(0x1b9)]=a28_0x30f7ad(0x236);[a28_0x30f7ad(0x22a)]='Pause\x20a\x20running\x20journey';async[a28_0x30f7ad(0x265)](_0x55f8fb){const _0x39c279=a28_0x30f7ad,{options:_0x2d3852,args:_0x300d17,tdx:_0x21439b}=_0x55f8fb,_0x2cf2e6=_0x300d17[0x0];if(!requireNameOrPath(_0x2cf2e6))return 0x1;_0x2d3852[_0x39c279(0x24e)]&&console[_0x39c279(0x19c)]('Input:\x20'+_0x2cf2e6);const {journeyId:_0xf216e9,journeyName:_0x454af4}=await resolveJourneyIdFromInput(_0x2cf2e6,_0x2d3852,_0x21439b);if(!_0x2d3852[_0x39c279(0x1a0)]){const _0x4b633f=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x454af4+'\x22?');if(!_0x4b633f)return console[_0x39c279(0x19c)](_0x39c279(0x186)),0x0;}const _0x1704ba=await withSpinner(_0x39c279(0x182),()=>_0x21439b[_0x39c279(0x269)][_0x39c279(0x1f1)](_0xf216e9),{'verbose':_0x2d3852['verbose']}),_0x2e699a=_0x1704ba[_0x39c279(0x212)];return console[_0x39c279(0x19c)](_0x39c279(0x1e3)+_0x2e699a[_0x39c279(0x1ab)][_0x39c279(0x1b9)]+_0x39c279(0x1ff)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a28_0x30f7ad(0x1b9)]=a28_0x30f7ad(0x230);[a28_0x30f7ad(0x22a)]=a28_0x30f7ad(0x1d6);async[a28_0x30f7ad(0x265)](_0x57a723){const _0x31b967=a28_0x30f7ad,{options:_0x2a5055,args:_0x351a69,tdx:_0x264f0e}=_0x57a723,_0x257f98=_0x351a69[0x0];if(!requireNameOrPath(_0x257f98))return 0x1;_0x2a5055[_0x31b967(0x24e)]&&console['error'](_0x31b967(0x208)+_0x257f98);const {journeyId:_0x12fb50,journeyName:_0x411aa1}=await resolveJourneyIdFromInput(_0x257f98,_0x2a5055,_0x264f0e);if(!_0x2a5055[_0x31b967(0x1a0)]){const _0x43ee04=await confirm(_0x31b967(0x17f)+_0x411aa1+'\x22?');if(!_0x43ee04)return console[_0x31b967(0x19c)](_0x31b967(0x186)),0x0;}const _0x59d471=await withSpinner(_0x31b967(0x261),()=>_0x264f0e[_0x31b967(0x269)][_0x31b967(0x1db)](_0x12fb50),{'verbose':_0x2a5055['verbose']}),_0x37fcbe=_0x59d471[_0x31b967(0x212)];return console[_0x31b967(0x19c)]('✔\x20Journey\x20\x22'+_0x37fcbe[_0x31b967(0x1ab)][_0x31b967(0x1b9)]+_0x31b967(0x1e6)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a28_0x30f7ad(0x1b9)]=a28_0x30f7ad(0x1c7);[a28_0x30f7ad(0x22a)]=a28_0x30f7ad(0x1a4);async[a28_0x30f7ad(0x265)](_0x313cd3){const _0x5cd730=a28_0x30f7ad,{options:_0x4981b9,args:_0x2fda37,tdx:_0x4e8ff2}=_0x313cd3,_0x4fbd85=_0x4981b9,_0x19811a=_0x2fda37[0x0],_0xc6eb4b=_0x19811a&&isYamlFilePath(_0x19811a),_0x144aff=await resolveTarget({'arg':_0xc6eb4b?_0x19811a:undefined,'contextParent':_0x4981b9[_0x5cd730(0x278)],'cwd':process[_0x5cd730(0x23d)]()});if(!isSuccessfulResolution(_0x144aff))return _0x144aff[_0x5cd730(0x193)]===_0x5cd730(0x21e)?(console[_0x5cd730(0x19c)](a28_0x263096[_0x5cd730(0x192)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x5cd730(0x19c)](_0x5cd730(0x277)),console[_0x5cd730(0x19c)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console[_0x5cd730(0x19c)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console[_0x5cd730(0x19c)](_0x5cd730(0x26d))):(console['error'](a28_0x263096[_0x5cd730(0x279)](_0x5cd730(0x23f)+_0x144aff[_0x5cd730(0x1ee)]+'\x0a')),_0x144aff[_0x5cd730(0x27e)]&&console[_0x5cd730(0x19c)](a28_0x263096[_0x5cd730(0x250)](_0x144aff[_0x5cd730(0x27e)]))),0x1;let _0x2ba1b0=_0xc6eb4b?undefined:_0x19811a,_0x459521,_0x3b0009;_0x144aff[_0x5cd730(0x253)]===_0x5cd730(0x18b)&&(_0x2ba1b0=_0x144aff[_0x5cd730(0x209)],_0x459521=_0x144aff[_0x5cd730(0x217)],_0x3b0009=_0x144aff[_0x5cd730(0x280)]);const _0x52cecc=_0x144aff['parentName'],_0xf85eb7=_0x144aff[_0x5cd730(0x222)];_0x4fbd85[_0x5cd730(0x24e)]&&(console[_0x5cd730(0x19c)]('Parent\x20segment:\x20'+_0x52cecc),console['error'](_0x5cd730(0x1fa)+_0xf85eb7),_0x2ba1b0&&console[_0x5cd730(0x19c)](_0x5cd730(0x1c0)+_0x2ba1b0),_0x459521&&console[_0x5cd730(0x19c)](_0x5cd730(0x23e)+_0x459521),_0x3b0009&&console[_0x5cd730(0x19c)](_0x5cd730(0x25b)+_0x3b0009));const _0x9887d5=await withSpinner(_0x5cd730(0x1bd),()=>_0x4e8ff2[_0x5cd730(0x1d7)]['resolveParentId'](_0x52cecc),{'verbose':_0x4981b9[_0x5cd730(0x24e)]}),_0x38ae1c=_0x9887d5['data'],{journeys:_0x36ebbf,folders:_0x2027d9}=await withSpinner(_0x5cd730(0x196),async()=>{const _0x3cf2b7=_0x5cd730,[_0x26c9ad,_0x4940a3]=await Promise[_0x3cf2b7(0x244)]([_0x4e8ff2[_0x3cf2b7(0x269)][_0x3cf2b7(0x1dd)](_0x38ae1c,undefined,{'includeAllVersions':!![]}),_0x4e8ff2[_0x3cf2b7(0x1d7)][_0x3cf2b7(0x255)](_0x38ae1c)]);return{'journeys':_0x26c9ad,'folders':_0x4940a3};},{'verbose':_0x4981b9[_0x5cd730(0x24e)]})[_0x5cd730(0x1b7)](_0x3b2618=>_0x3b2618['data']);let _0x9e4cb8=_0x36ebbf;const _0x5a50e0=buildFolderIdToPathMap(_0x2027d9);if(_0x2ba1b0){const _0x457c7e=_0x9e4cb8[_0x5cd730(0x18f)](_0x2b61f0=>_0x2b61f0['journeyBundleName']['toLowerCase']()===_0x2ba1b0[_0x5cd730(0x1b0)]());if(_0x457c7e[_0x5cd730(0x1dc)]===0x0)return console[_0x5cd730(0x19c)]('Error:\x20Journey\x20not\x20found:\x20'+_0x2ba1b0),console[_0x5cd730(0x19c)](_0x5cd730(0x281)),0x1;_0x9e4cb8=_0x457c7e;}if(_0x3b0009!==undefined){const _0x2de957=_0x9e4cb8['filter'](_0x3a9be4=>{const _0x2f525f=_0x5cd730,_0x18f720=_0x3a9be4[_0x2f525f(0x22b)]?_0x5a50e0[_0x2f525f(0x1ea)](_0x3a9be4[_0x2f525f(0x22b)])||'':'';return _0x18f720===_0x3b0009;});if(_0x2de957[_0x5cd730(0x1dc)]===0x0&&_0x9e4cb8[_0x5cd730(0x1dc)]>0x0){console['error']('Error:\x20Journey\x20\x27'+_0x2ba1b0+_0x5cd730(0x1cc)+(_0x3b0009||_0x5cd730(0x273))),console[_0x5cd730(0x19c)](_0x5cd730(0x1df));for(const _0x5c73a8 of _0x9e4cb8){const _0x355f4d=_0x5c73a8['folderId']?_0x5a50e0[_0x5cd730(0x1ea)](_0x5c73a8[_0x5cd730(0x22b)])||'':'';console[_0x5cd730(0x19c)](_0x5cd730(0x239)+(_0x355f4d||_0x5cd730(0x197))+'/'+_0x5c73a8['journeyBundleName']);}return 0x1;}_0x9e4cb8=_0x2de957;}if(_0x9e4cb8[_0x5cd730(0x1dc)]===0x0)return console[_0x5cd730(0x19c)](_0x5cd730(0x1d5)),0x0;const _0x3fb129=new Map();for(const _0x49d081 of _0x9e4cb8){const _0x44cf92=_0x49d081[_0x5cd730(0x26e)];!_0x3fb129[_0x5cd730(0x27d)](_0x44cf92)&&_0x3fb129[_0x5cd730(0x260)](_0x44cf92,[]),_0x3fb129[_0x5cd730(0x1ea)](_0x44cf92)[_0x5cd730(0x215)](_0x49d081);}for(const _0x5726f2 of _0x3fb129[_0x5cd730(0x1d0)]()){_0x5726f2[_0x5cd730(0x259)]((_0x143a5d,_0x5333f0)=>(_0x143a5d[_0x5cd730(0x184)]||0x0)-(_0x5333f0[_0x5cd730(0x184)]||0x0));}const _0x4bfb73=[],{idToEmailMap:_0x4c7449,connectionIdToNameMap:_0x28951e}=await withSpinner(_0x5cd730(0x214),async()=>{const _0x448940=_0x5cd730,[_0x5076b,_0x1aea86]=await Promise[_0x448940(0x244)]([_0x4e8ff2[_0x448940(0x203)][_0x448940(0x223)](),_0x4e8ff2[_0x448940(0x1c8)][_0x448940(0x228)]()]);return{'idToEmailMap':_0x5076b,'connectionIdToNameMap':_0x1aea86};},{'verbose':_0x4981b9[_0x5cd730(0x24e)]})[_0x5cd730(0x1b7)](_0xd4ba85=>_0xd4ba85['data']);for(const _0x1a994f of _0x3fb129[_0x5cd730(0x1d0)]()){const _0x4b9b8e=_0x1a994f[0x0][_0x5cd730(0x20f)],_0x4100d1=_0x1a994f[0x0][_0x5cd730(0x22b)],_0x411bc6=_0x4100d1?_0x5a50e0[_0x5cd730(0x1ea)](_0x4100d1)||'':'',_0x44ad68=_0x411bc6?a28_0x242512['join'](_0xf85eb7,_0x411bc6):_0xf85eb7,_0x4d1f8f=_0x459521||a28_0x242512[_0x5cd730(0x24b)](_0x44ad68,sanitizeFileName(_0x4b9b8e)+'.yml');let _0x1e4211,_0x5e6b7a;if(existsSync(_0x4d1f8f))try{const _0x57b099=readFileSync(_0x4d1f8f,'utf-8'),_0x3a0182=parseYamlString(_0x57b099);_0x5e6b7a=_0x3a0182,_0x1e4211=buildRuleToNameMapping(_0x3a0182),_0x4fbd85['verbose']&&_0x1e4211[_0x5cd730(0x1e0)]>0x0&&console[_0x5cd730(0x19c)](_0x5cd730(0x1cb)+_0x1e4211[_0x5cd730(0x1e0)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x4b9b8e);}catch(_0x10a0d5){_0x4fbd85['verbose']&&console[_0x5cd730(0x19c)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x10a0d5[_0x5cd730(0x1ee)]);}const _0x493513=[],_0x596bd2=new Set(),_0x23cf38=new Map(),_0x43c461=new Map(),_0x1da0a9=new Set(),_0x10d8a6=new Map(),_0x356179=new Map(),_0x36a50d=createJumpTargetCache();await withProgressSpinner(_0x5cd730(0x240)+_0x4b9b8e+_0x5cd730(0x246),async _0xd5f687=>{const _0x2f5314=_0x5cd730;for(const _0x335b30 of _0x1a994f){const _0xafc51d=_0x1a994f['length']>0x1?_0x335b30[_0x2f5314(0x20f)]+'\x20v'+(_0x335b30[_0x2f5314(0x184)]||0x1):_0x335b30['journeyBundleName'];_0xd5f687[_0x2f5314(0x263)](_0x2f5314(0x240)+_0xafc51d);const _0x320eba=await _0x4e8ff2['journey'][_0x2f5314(0x1a3)](_0x335b30['id']),_0x333c96=_0x320eba['attributes']?.[_0x2f5314(0x1ad)],_0x12e611={'resolveSegment':async _0x388f59=>{const _0x2d516f=_0x2f5314;if(!_0x333c96)return{'name':_0x388f59,'isJourneyLocal':![]};const _0x370f5e=_0x23cf38[_0x2d516f(0x1ea)](_0x388f59);if(_0x370f5e)return _0x370f5e;try{const _0x5499ae=await _0x4e8ff2[_0x2d516f(0x1d7)][_0x2d516f(0x181)](_0x333c96,_0x388f59),_0x5b7665=_0x5499ae[_0x2d516f(0x1a8)]===SEGMENT_KIND_JOURNEY;let _0x5c6c77,_0x5f14a2=_0x5499ae[_0x2d516f(0x1b9)];if(_0x5b7665&&_0x5499ae[_0x2d516f(0x1ce)]){const _0x548fa1=await segmentResponseToDef(_0x5499ae,{'resolveSegmentName':async _0x1e03cc=>{const _0x2c1263=_0x2d516f,_0x9c4fd3=_0x23cf38['get'](_0x1e03cc);if(_0x9c4fd3)return _0x9c4fd3[_0x2c1263(0x1b9)];const _0x50697b=await _0x12e611['resolveSegment'](_0x1e03cc);return _0x50697b['name'];}}),_0x4b6e18=_0x548fa1[_0x2d516f(0x1ce)];_0x5c6c77={'description':_0x5499ae[_0x2d516f(0x22a)],'rule':_0x4b6e18};const _0x2f364b=serializeRule(_0x4b6e18),_0x565fb3=_0x43c461[_0x2d516f(0x1ea)](_0x2f364b);if(_0x565fb3)_0x5f14a2=_0x565fb3,_0x5c6c77=undefined,_0x4fbd85[_0x2d516f(0x24e)]&&console[_0x2d516f(0x19c)](_0x2d516f(0x1fb)+_0x5499ae['name']+'\x20->\x20'+_0x565fb3);else{let _0x333009=![];if(_0x1e4211){const _0xe906c0=_0x1e4211[_0x2d516f(0x1ea)](_0x2f364b);if(_0xe906c0){const _0x21bc54=_0xe906c0['find'](_0x3ff59a=>!_0x596bd2[_0x2d516f(0x27d)](_0x3ff59a));_0x21bc54&&(_0x5f14a2=_0x21bc54,_0x596bd2[_0x2d516f(0x256)](_0x21bc54),_0x43c461[_0x2d516f(0x260)](_0x2f364b,_0x21bc54),_0x333009=!![],_0x4fbd85[_0x2d516f(0x24e)]&&console[_0x2d516f(0x19c)](_0x2d516f(0x24c)+_0x21bc54+_0x2d516f(0x207)));}}if(!_0x333009){const _0x26ffcd=generateJourneyLocalName(_0x5499ae['name']);_0x26ffcd&&(_0x5f14a2=_0x26ffcd);let _0x9b8bc=_0x5f14a2,_0x13c04e=0x2;while(_0x596bd2[_0x2d516f(0x27d)](_0x9b8bc)){_0x9b8bc=_0x5f14a2+'_'+_0x13c04e,_0x13c04e++;}_0x596bd2['add'](_0x9b8bc),_0x43c461[_0x2d516f(0x260)](_0x2f364b,_0x9b8bc),_0x5f14a2=_0x9b8bc;}}}const _0x4aa2f8={'name':_0x5f14a2,'isJourneyLocal':_0x5b7665,'definition':_0x5c6c77};return _0x23cf38[_0x2d516f(0x260)](_0x388f59,_0x4aa2f8),_0x4aa2f8;}catch(_0x3612f1){return _0x4981b9[_0x2d516f(0x24e)]&&console[_0x2d516f(0x19c)](_0x2d516f(0x257)+_0x388f59+':\x20'+_0x3612f1[_0x2d516f(0x1ee)]),{'name':_0x388f59,'isJourneyLocal':![]};}},'resolveActivation':async _0x2d737f=>{const _0x30e4e2=_0x2f5314,_0x1907fa=_0x10d8a6[_0x30e4e2(0x1ea)](_0x2d737f);if(_0x1907fa)return _0x1907fa;try{const _0x48f1ae=await _0x4e8ff2[_0x30e4e2(0x269)][_0x30e4e2(0x1a7)](_0x335b30['id'],_0x2d737f),_0x1042d5=journeyActivationStepToYaml(_0x48f1ae,_0x4c7449,_0x28951e),_0x52f5ac=JSON[_0x30e4e2(0x206)]({'name':_0x1042d5[_0x30e4e2(0x1b9)],'connection':_0x1042d5[_0x30e4e2(0x1c8)],'connector_config':_0x1042d5[_0x30e4e2(0x1bb)]}),_0x403b77=_0x356179[_0x30e4e2(0x1ea)](_0x52f5ac);if(_0x403b77){const _0x301aac={'name':_0x403b77,'isJourneyLocal':!![],'definition':_0x1042d5};return _0x10d8a6[_0x30e4e2(0x260)](_0x2d737f,_0x301aac),_0x301aac;}const _0x1dcbe1=_0x48f1ae[_0x30e4e2(0x1ab)]['activationParams'][_0x30e4e2(0x1b9)]||_0x2d737f,_0x1408e5=sanitizeYamlKey(_0x1dcbe1)||_0x30e4e2(0x237)+_0x2d737f;let _0x3a02b5=_0x1408e5,_0x2f6236=0x2;while(_0x1da0a9['has'](_0x3a02b5)){_0x3a02b5=_0x1408e5+'_'+_0x2f6236,_0x2f6236++;}_0x1da0a9['add'](_0x3a02b5),_0x356179[_0x30e4e2(0x260)](_0x52f5ac,_0x3a02b5);const _0x33ac3b={'name':_0x3a02b5,'isJourneyLocal':!![],'definition':_0x1042d5};return _0x10d8a6[_0x30e4e2(0x260)](_0x2d737f,_0x33ac3b),_0x33ac3b;}catch(_0x8f79e){return _0x4981b9[_0x30e4e2(0x24e)]&&console[_0x30e4e2(0x19c)]('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x2d737f+':\x20'+_0x8f79e[_0x30e4e2(0x1ee)]),{'name':_0x2d737f,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x28b8fd,_0x4b8c1c)=>{const _0x5c065b=_0x2f5314;return resolveJumpTarget(_0x28b8fd,_0x4b8c1c,_0x36a50d,_0x2c0dc1=>_0x4e8ff2[_0x5c065b(0x269)][_0x5c065b(0x1a3)](_0x2c0dc1));}},_0x1292f0=await journeyResponseToDef(_0x320eba,_0x12e611);_0x493513['push']({'item':_0x335b30,'yaml':_0x1292f0});}},{'verbose':_0x4981b9[_0x5cd730(0x24e)]});const _0x19b179=await _0x4e8ff2[_0x5cd730(0x269)]['getLatestJourneyId'](_0x1a994f[0x0][_0x5cd730(0x26e)]),_0x5e5d5a=buildMergedJourneyDef(_0x493513,_0x1e4211,_0x19b179),_0x4a117b=normalizeJourneyDef(_0x5e5d5a,_0x5e6b7a),_0x3f548d=toYamlString(_0x4a117b),_0x4766bd=_0x459521||a28_0x242512['join'](_0x44ad68,sanitizeFileName(_0x4b9b8e)+_0x5cd730(0x285));!_0x459521&&_0x411bc6&&!existsSync(_0x44ad68)&&mkdirSync(_0x44ad68,{'recursive':!![]});const _0x30c874=a28_0x242512[_0x5cd730(0x1e1)](process[_0x5cd730(0x23d)](),_0x4766bd);if(existsSync(_0x4766bd)){const _0x5221b5=readFileSync(_0x4766bd,_0x5cd730(0x189)),_0x388761=generateDiff(_0x5221b5,_0x3f548d),_0xb83a1a=hasChanges(_0x388761);_0x4bfb73['push']({'relativePath':_0x30c874,'absolutePath':_0x4766bd,'content':_0x3f548d,'isNew':![],'hasChanges':_0xb83a1a,'diff':_0xb83a1a?formatDiffWithColors(_0x388761):undefined});}else _0x4bfb73[_0x5cd730(0x215)]({'relativePath':_0x30c874,'absolutePath':_0x4766bd,'content':_0x3f548d,'isNew':!![],'hasChanges':![]});}const _0x51f61b=_0x4bfb73[_0x5cd730(0x18f)](_0x5330e2=>_0x5330e2[_0x5cd730(0x270)]),_0x5b0311=_0x4bfb73[_0x5cd730(0x18f)](_0x24af8a=>!_0x24af8a[_0x5cd730(0x270)]&&_0x24af8a[_0x5cd730(0x201)]),_0x3411d6=_0x4bfb73['filter'](_0xf107f8=>!_0xf107f8['isNew']&&!_0xf107f8[_0x5cd730(0x201)]),_0x57d597=_0x9e4cb8[_0x5cd730(0x1dc)],_0x373524=_0x3fb129[_0x5cd730(0x1e0)],_0x1880f5=_0x57d597>_0x373524?'\x20('+_0x57d597+_0x5cd730(0x18c):'';console[_0x5cd730(0x19c)]('\x0aPull\x20summary:'),console['error']('\x20\x20'+a28_0x263096[_0x5cd730(0x250)](_0x373524+_0x5cd730(0x19f))+a28_0x263096['dim'](_0x1880f5)),console[_0x5cd730(0x19c)]('\x20\x20'+a28_0x263096[_0x5cd730(0x1b5)]('+\x20'+_0x51f61b[_0x5cd730(0x1dc)]+'\x20new\x20files')),console[_0x5cd730(0x19c)]('\x20\x20'+a28_0x263096[_0x5cd730(0x192)]('~\x20'+_0x5b0311['length']+_0x5cd730(0x218))),console[_0x5cd730(0x19c)]('\x20\x20'+a28_0x263096[_0x5cd730(0x21d)]('=\x20'+_0x3411d6['length']+'\x20unchanged\x20files')),console[_0x5cd730(0x19c)](_0x5cd730(0x1d4)+a28_0x263096[_0x5cd730(0x250)](_0xf85eb7)+'\x0a');if(_0x5b0311[_0x5cd730(0x1dc)]>0x0)for(const _0x8163ca of _0x5b0311){console['error']('\x0aChanges\x20to\x20\x27'+_0x8163ca[_0x5cd730(0x22c)]+'\x27:'),console[_0x5cd730(0x19c)]('─'[_0x5cd730(0x22f)](0x3c)),console[_0x5cd730(0x19c)](_0x8163ca[_0x5cd730(0x245)]),console['error']('─'[_0x5cd730(0x22f)](0x3c));}if(_0x4fbd85[_0x5cd730(0x1b1)])return console[_0x5cd730(0x19c)](a28_0x263096['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x51f61b[_0x5cd730(0x1dc)]===0x0&&_0x5b0311[_0x5cd730(0x1dc)]===0x0)return console[_0x5cd730(0x19c)](a28_0x263096[_0x5cd730(0x1b5)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x52cecc},_0x4fbd85[_0x5cd730(0x23b)]),console[_0x5cd730(0x19c)](a28_0x263096[_0x5cd730(0x1b5)](_0x5cd730(0x243)+a28_0x263096[_0x5cd730(0x21d)]('parent_segment')+_0x5cd730(0x1b2)+a28_0x263096[_0x5cd730(0x250)](_0x52cecc))),0x0;if(!_0x4fbd85[_0x5cd730(0x1a0)]&&(_0x51f61b[_0x5cd730(0x1dc)]>0x0||_0x5b0311[_0x5cd730(0x1dc)]>0x0)){if(!isInteractive())return console[_0x5cd730(0x19c)](a28_0x263096['red'](_0x5cd730(0x1fc)),_0x5cd730(0x195)),console[_0x5cd730(0x19c)](a28_0x263096[_0x5cd730(0x21d)](_0x5cd730(0x267))),0x1;const _0xfca0a1=await confirmKey(_0x5cd730(0x1f8)+(_0x51f61b[_0x5cd730(0x1dc)]+_0x5b0311['length'])+'\x20files?');if(!_0xfca0a1)return console[_0x5cd730(0x19c)](a28_0x263096['yellow'](_0x5cd730(0x229)),_0x5cd730(0x1c3)),0x1;}!existsSync(_0xf85eb7)&&mkdirSync(_0xf85eb7,{'recursive':!![]});const _0x3d8f71=a28_0x242512[_0x5cd730(0x24b)](_0xf85eb7,'tdx.json');writeFileSync(_0x3d8f71,createTdxConfigContent(_0x52cecc),_0x5cd730(0x189));for(const _0x54714e of _0x4bfb73){(_0x54714e[_0x5cd730(0x270)]||_0x54714e[_0x5cd730(0x201)])&&writeFileSync(_0x54714e[_0x5cd730(0x22d)],_0x54714e['content'],_0x5cd730(0x189));}return console[_0x5cd730(0x19c)](a28_0x263096[_0x5cd730(0x1b5)]('✔\x20Pulled\x20'+(_0x51f61b[_0x5cd730(0x1dc)]+_0x5b0311[_0x5cd730(0x1dc)])+_0x5cd730(0x19a)+_0xf85eb7)),saveSessionContext({'parent_segment':_0x52cecc},_0x4fbd85[_0x5cd730(0x23b)]),console[_0x5cd730(0x19c)](a28_0x263096[_0x5cd730(0x1b5)]('✔\x20Context\x20set:\x20'+a28_0x263096[_0x5cd730(0x21d)]('parent_segment')+_0x5cd730(0x1b2)+a28_0x263096[_0x5cd730(0x250)](_0x52cecc))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a28_0x30f7ad(0x1b9)]=a28_0x30f7ad(0x227);[a28_0x30f7ad(0x22a)]='Show\x20journey\x20table\x20column\x20mapping';async[a28_0x30f7ad(0x265)](_0x306fdb){const _0xdd196a=a28_0x30f7ad,{options:_0x328e97,args:_0x3f4ace,tdx:_0x275cfe}=_0x306fdb,_0x4d6170=_0x3f4ace[0x0];if(!requireNameOrPath(_0x4d6170))return 0x1;_0x328e97['verbose']&&console[_0xdd196a(0x19c)]('Input:\x20'+_0x4d6170);const {journeyId:_0x7fbe43}=await resolveJourneyIdFromInput(_0x4d6170,_0x328e97,_0x275cfe),_0x1a05df=await withSpinner('Getting\x20column\x20mapping...',()=>_0x275cfe[_0xdd196a(0x269)][_0xdd196a(0x1c2)](_0x7fbe43),{'verbose':_0x328e97['verbose']}),_0x25c92d=_0x1a05df[_0xdd196a(0x212)];return console[_0xdd196a(0x188)](_0xdd196a(0x187)+_0x25c92d[_0xdd196a(0x1f4)]),console[_0xdd196a(0x188)](_0xdd196a(0x221)+_0x25c92d['table']),await handleSDKOutput(_0x25c92d['columns'],_0x328e97),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']='journey:activations';[a28_0x30f7ad(0x22a)]=a28_0x30f7ad(0x1ec);async[a28_0x30f7ad(0x265)](_0x3a435d){const _0x24b7d5=a28_0x30f7ad,{options:_0x255be3,args:_0x542c5e,tdx:_0x1e0421}=_0x3a435d,_0x3055b6=_0x542c5e[0x0];if(!requireNameOrPath(_0x3055b6))return 0x1;_0x255be3[_0x24b7d5(0x24e)]&&console[_0x24b7d5(0x19c)](_0x24b7d5(0x208)+_0x3055b6);const {journeyId:_0x91e75e}=await resolveJourneyIdFromInput(_0x3055b6,_0x255be3,_0x1e0421),_0x173d77=await withSpinner('Listing\x20journey\x20activations...',()=>_0x1e0421[_0x24b7d5(0x269)][_0x24b7d5(0x18d)](_0x91e75e),{'verbose':_0x255be3[_0x24b7d5(0x24e)]}),_0x47e6e0=_0x173d77[_0x24b7d5(0x212)];return console[_0x24b7d5(0x19c)](_0x24b7d5(0x1cb)+_0x47e6e0[_0x24b7d5(0x1dc)]+_0x24b7d5(0x185)+(_0x47e6e0['length']!==0x1?'s':'')),await handleSDKOutput(_0x47e6e0,_0x255be3),0x0;}}export class JourneyPushCommand extends BaseCommand{['name']=a28_0x30f7ad(0x238);['description']=a28_0x30f7ad(0x24a);[a28_0x30f7ad(0x200)]=new SegmentPushCommand();async[a28_0x30f7ad(0x265)](_0x3862b2){const _0x2e781c=a28_0x30f7ad,_0x569f2b=_0x3862b2[_0x2e781c(0x234)][0x0];let _0x116a13;if(_0x569f2b){const _0x43b60f=await resolveTarget({'arg':_0x569f2b,'contextParent':_0x3862b2[_0x2e781c(0x220)]['parentSegment'],'cwd':process['cwd']()});isSuccessfulResolution(_0x43b60f)&&_0x43b60f[_0x2e781c(0x253)]===_0x2e781c(0x18b)&&(_0x116a13=_0x43b60f['filePath']);}const _0x1da5a2={..._0x3862b2,'options':{..._0x3862b2['options'],'journeysOnly':!![],..._0x116a13&&{'singleFilePath':_0x116a13}}};return this[_0x2e781c(0x200)]['execute'](_0x1da5a2);}}export class JourneyVersionsCommand extends BaseCommand{[a28_0x30f7ad(0x1b9)]='journey:versions';[a28_0x30f7ad(0x22a)]='List\x20all\x20versions\x20of\x20a\x20journey';async[a28_0x30f7ad(0x265)](_0x76b2f0){const _0x1a4881=a28_0x30f7ad,{options:_0x30a85b,args:_0xbb2382,tdx:_0x298d5b}=_0x76b2f0,_0x2834db=_0xbb2382[0x0];if(!requireNameOrPath(_0x2834db))return 0x1;if(_0x30a85b[_0x1a4881(0x24e)])console[_0x1a4881(0x19c)](_0x1a4881(0x208)+_0x2834db);const {journeyId:_0x3e71f5}=await resolveJourneyIdFromInput(_0x2834db,_0x30a85b,_0x298d5b),_0x58d648=await withSpinner('Listing\x20journey\x20versions...',()=>_0x298d5b['journey']['listVersions'](_0x3e71f5),{'verbose':_0x30a85b[_0x1a4881(0x24e)]}),{bundleName:_0x1b54ac,versions:_0x1d0f94,latestJourneyId:_0x1da01f}=_0x58d648['data'];console['error'](_0x1b54ac+':\x20'+_0x1d0f94[_0x1a4881(0x1dc)]+_0x1a4881(0x232)+(_0x1d0f94[_0x1a4881(0x1dc)]!==0x1?'s':''));const _0x41b982=_0x1d0f94[_0x1a4881(0x190)](_0x37a329=>({'version':_0x37a329['versionNumber'],'journey_id':_0x37a329[_0x1a4881(0x25e)],'name':_0x37a329[_0x1a4881(0x1b9)],'state':_0x37a329[_0x1a4881(0x23c)],'paused':_0x37a329[_0x1a4881(0x1d3)],'latest':_0x37a329['journeyId']===_0x1da01f,'created_at':_0x37a329[_0x1a4881(0x1aa)]}));return await handleSDKOutput(_0x41b982,_0x30a85b),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a28_0x30f7ad(0x1b9)]=a28_0x30f7ad(0x213);[a28_0x30f7ad(0x22a)]=a28_0x30f7ad(0x262);async['execute'](_0x22daab){const _0x3dab05=a28_0x30f7ad,{options:_0x2d7fbd,args:_0x4a9eb0,tdx:_0x4acd61}=_0x22daab,_0x2c5270=_0x4a9eb0[0x0];if(!requireNameOrPath(_0x2c5270))return 0x1;if(_0x2d7fbd[_0x3dab05(0x24e)])console[_0x3dab05(0x19c)]('Input:\x20'+_0x2c5270);const {journeyId:_0x4ddbe4,journeyName:_0x3bd9d5}=await resolveJourneyIdFromInput(_0x2c5270,_0x2d7fbd,_0x4acd61);if(!_0x2d7fbd['yes']){const _0x53e07e=await confirm(_0x3dab05(0x205)+_0x3bd9d5+'\x22?');if(!_0x53e07e)return console[_0x3dab05(0x19c)](_0x3dab05(0x186)),0x0;}const _0x235b58=await withSpinner(_0x3dab05(0x210),()=>_0x4acd61['journey'][_0x3dab05(0x21a)](_0x4ddbe4),{'verbose':_0x2d7fbd['verbose']}),_0x2a0ce6=_0x235b58[_0x3dab05(0x212)];return console['error'](a28_0x263096[_0x3dab05(0x1b5)]('✔')+_0x3dab05(0x1e8)+_0x2a0ce6['attributes']['versionNumber']+'\x20(draft)\x20—\x20\x22'+_0x2a0ce6[_0x3dab05(0x1ab)][_0x3dab05(0x1b9)]+'\x22'),console[_0x3dab05(0x19c)](_0x3dab05(0x252)+_0x2a0ce6['id']),await handleSingleObjectOutput({'id':_0x2a0ce6['id'],'name':_0x2a0ce6[_0x3dab05(0x1ab)][_0x3dab05(0x1b9)],'version':_0x2a0ce6[_0x3dab05(0x1ab)][_0x3dab05(0x184)],'state':_0x2a0ce6['attributes'][_0x3dab05(0x23c)],'bundle_id':_0x2a0ce6['attributes'][_0x3dab05(0x26e)],'created_at':_0x2a0ce6['attributes'][_0x3dab05(0x1aa)]},_0x2d7fbd),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a28_0x30f7ad(0x1b9)]=a28_0x30f7ad(0x1c1);[a28_0x30f7ad(0x22a)]='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async[a28_0x30f7ad(0x265)](_0x57bbcc){const _0x212f2e=a28_0x30f7ad,{options:_0x9036ba,args:_0x1000c9,tdx:_0x3df9ab}=_0x57bbcc,_0x1c7a3f=_0x1000c9[0x0];if(!requireNameOrPath(_0x1c7a3f))return 0x1;const _0x51f86a=_0x9036ba[_0x212f2e(0x194)];if(!_0x51f86a)return console['error'](_0x212f2e(0x26c)),console['error']('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x220c73=parseInt(_0x51f86a,0xa);if(isNaN(_0x220c73)||_0x220c73<0x1)return console[_0x212f2e(0x19c)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x51f86a),0x1;if(_0x9036ba[_0x212f2e(0x24e)])console[_0x212f2e(0x19c)](_0x212f2e(0x208)+_0x1c7a3f+_0x212f2e(0x1ed)+_0x220c73);const {journeyId:_0x9d2960,parentSegmentId:_0x2c72a6}=await resolveJourneyIdFromInput(_0x1c7a3f,_0x9036ba,_0x3df9ab),_0x274267=await withSpinner(_0x212f2e(0x1a6),()=>_0x3df9ab[_0x212f2e(0x269)][_0x212f2e(0x20c)](_0x9d2960),{'verbose':_0x9036ba['verbose']}),{versions:_0x4365ce,latestJourneyId:_0xc3a0b1}=_0x274267['data'],_0x3e979c=_0x4365ce['find'](_0x2e0279=>_0x2e0279[_0x212f2e(0x184)]===_0x220c73);if(!_0x3e979c){const _0x1bb153=_0x4365ce['map'](_0x55b50c=>'v'+_0x55b50c[_0x212f2e(0x184)])[_0x212f2e(0x24b)](',\x20');return console['error'](_0x212f2e(0x1d9)+_0x220c73+'\x20not\x20found.\x20Available:\x20'+_0x1bb153),0x1;}const _0x3f7351=await withSpinner(_0x212f2e(0x225)+_0x220c73+_0x212f2e(0x1e4),()=>_0x3df9ab[_0x212f2e(0x269)][_0x212f2e(0x1a3)](_0x3e979c['journeyId']),{'verbose':_0x9036ba['verbose']}),_0x425f3d=_0x3f7351[_0x212f2e(0x212)],_0x183410=getConsoleNextUrl(_0x9036ba['site'],'/app/ps/'+_0x2c72a6+'/e/'+_0x3e979c[_0x212f2e(0x25e)]+_0x212f2e(0x1c9));return await handleSingleObjectOutput({'id':_0x425f3d['id'],'name':_0x425f3d['attributes']['name'],'version':_0x425f3d[_0x212f2e(0x1ab)][_0x212f2e(0x184)],'description':_0x425f3d[_0x212f2e(0x1ab)][_0x212f2e(0x22a)],'state':_0x425f3d[_0x212f2e(0x1ab)][_0x212f2e(0x23c)],'paused':_0x425f3d['attributes'][_0x212f2e(0x1d3)],'reentry_mode':_0x425f3d[_0x212f2e(0x1ab)][_0x212f2e(0x233)],'stages':_0x425f3d['attributes'][_0x212f2e(0x286)]?.['length']||0x0,..._0x425f3d[_0x212f2e(0x1ab)][_0x212f2e(0x248)]&&{'goal':_0x425f3d[_0x212f2e(0x1ab)][_0x212f2e(0x248)]['name']},'latest':_0x3e979c['journeyId']===_0xc3a0b1,'created_at':_0x425f3d[_0x212f2e(0x1ab)]['createdAt'],'updated_at':_0x425f3d[_0x212f2e(0x1ab)][_0x212f2e(0x180)],'url':_0x183410},_0x9036ba),0x0;}}
1
+ const a28_0x444827=a28_0x319a;(function(_0x2a3622,_0x3de7a1){const _0x287045=a28_0x319a,_0x43d891=_0x2a3622();while(!![]){try{const _0x48d3c1=-parseInt(_0x287045(0x157))/0x1*(parseInt(_0x287045(0x169))/0x2)+-parseInt(_0x287045(0x1a3))/0x3+-parseInt(_0x287045(0x1da))/0x4+parseInt(_0x287045(0x13f))/0x5+parseInt(_0x287045(0x1e7))/0x6+-parseInt(_0x287045(0x102))/0x7+-parseInt(_0x287045(0x151))/0x8*(-parseInt(_0x287045(0x1c3))/0x9);if(_0x48d3c1===_0x3de7a1)break;else _0x43d891['push'](_0x43d891['shift']());}catch(_0x530504){_0x43d891['push'](_0x43d891['shift']());}}}(a28_0xbb2e,0xece27));import a28_0x1bce51 from'chalk';import a28_0x492a08 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';function a28_0x319a(_0x2bae2f,_0x2ddd33){_0x2bae2f=_0x2bae2f-0xd8;const _0xbb2e03=a28_0xbb2e();let _0x319a5c=_0xbb2e03[_0x2bae2f];return _0x319a5c;}import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x2d15c4){const _0x167c08=a28_0x319a;return!_0x2d15c4&&(console[_0x167c08(0x19a)](_0x167c08(0x1dc)),console[_0x167c08(0x19a)](_0x167c08(0x1b5))),!!_0x2d15c4;}function withJsonFormat(_0x1e7e02){const _0x4fcb2e=a28_0x319a;if(!_0x1e7e02[_0x4fcb2e(0x178)]&&!_0x1e7e02[_0x4fcb2e(0x123)]&&!_0x1e7e02[_0x4fcb2e(0x143)]&&!_0x1e7e02[_0x4fcb2e(0x17f)])return{..._0x1e7e02,'format':_0x4fcb2e(0x123),'json':!![]};return _0x1e7e02;}function formatJourneyState(_0x3c021a){const _0x15a293=a28_0x319a;switch(_0x3c021a){case _0x15a293(0x186):return a28_0x1bce51[_0x15a293(0x17a)](_0x15a293(0xef));case'draft':return a28_0x1bce51[_0x15a293(0xdc)](_0x15a293(0x175));case _0x15a293(0xdd):return a28_0x1bce51[_0x15a293(0xf1)](_0x15a293(0x11b));case'completed':return a28_0x1bce51[_0x15a293(0x12d)](_0x15a293(0x121));case'archived':return a28_0x1bce51[_0x15a293(0xdc)](_0x15a293(0xf3));default:return'('+_0x3c021a+')';}}function formatJourneyItem(_0x4e5d0a,_0x82198='',_0x56cd71){const _0x48e9f5=a28_0x319a,_0x542e09=formatJourneyState(_0x4e5d0a[_0x48e9f5(0x1de)]),_0x5203ac=_0x56cd71?hyperlink(_0x4e5d0a['journeyBundleName'],_0x56cd71):_0x4e5d0a[_0x48e9f5(0x193)];return _0x82198+_0x48e9f5(0x14f)+_0x5203ac+'\x20'+_0x542e09;}function escapeRegex(_0x2bf818){const _0x19382b=a28_0x319a;return _0x2bf818[_0x19382b(0x118)](/[.*+?^${}()|[\]\\]/g,_0x19382b(0x1c9));}function a28_0xbb2e(){const _0x50dae8=['\x22\x20resumed','no_parent','folderId','\x20Created\x20v','listActivationsFlat','diff','setPhase','8390142FrShXM','root\x20folder','segment','\x20unchanged\x20files','\x22\x20not\x20found','journey:version:create','getStatistics','dim','paused','Getting\x20column\x20mapping...','Target\x20file:\x20','journeys','Write\x20','join','then','journey:versions','execute','map','Aborted.','buildIdToEmailMap','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','values','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','\x20new\x20files','absolutePath','Error:\x20','(running)','Error:\x20Invalid\x20--type\x20\x22','yellow','reentryMode','(archived)','size','parentName','filePath','Resuming\x20journey...','Error:\x20Parent\x20segment\x20context\x20required','listJourneysWithFolders','tdx.json','\x20files?','versionNumber','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','message','yes','site','sort','7617099uLcxsC','kind','journey:view','Fetching\x20','Resolving\x20parent\x20segment...','INVALID_ARGUMENT','push','Input:\x20','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','listFolders','goalSize','Error:\x20--version\x20option\x20is\x20required','\x0aError:','attributes','\x20\x20Name:\x20','completeMilestoneRate','Error:\x20Version\x20','getJourney','getSegment','journeyId','segmentPushCommand','List\x20journeys\x20in\x20current\x20context','replace','📁\x20','localeCompare','(paused)','base','has','name','Pattern:\x20','Fetching\x20parent\x20segment...','(completed)','activationParams','json','version','...','Warning:\x20Could\x20not\x20resolve\x20segment\x20','hasChanges','includeStats','journeyStages','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','Warning:\x20Could\x20not\x20resolve\x20activation\x20','limit','blue','\x20versions)','✔\x20Found\x20','journey','journey:version:view','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','✔\x20Pulled\x20','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','\x20=\x20','✔\x20Context\x20set:\x20','Found\x20','listVersions','\x20journey','description','relative','\x20(draft)\x20—\x20\x22','2361415axCiyt','/app/ps/','\x20\x20Folder\x20path:\x20','Pausing\x20journey...','jsonl','getParentFull','Options:','hasPeriod','Getting\x20journey\x20statistics...','Parent\x20segment:\x20','/j/da/je','activation','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','stage','renderStats','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','🗺️\x20','stages','176488uYoYlJ','Cancelled','Fetching\x20journeys\x20and\x20folders...','segmentName','Creating\x20new\x20version...','file','213071fFPZIg','\x20(ID:\x20','log','listJourneysFromParentSegment','/e/','\x22\x20paused','\x20journeys','toLowerCase','Listing\x20journeys...','parent_segment','resolveParentId','Listing\x20journey\x20versions...','Table:\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','\x27\x20not\x20found\x20in\x20','Error:\x20Stage\x20\x22','Resolved\x20YAML\x20file:\x20','length','6uNytQT','utf-8','cyan','✔\x20Journey\x20\x22','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','cwd','No\x20statistics\x20available\x20for\x20journey:\x20','resolveSegment','table','conversion','Show\x20journey\x20statistics','getColumnMapping','(draft)','segments','List\x20activations\x20for\x20a\x20journey','format','\x0aChanges\x20to\x20\x27','green','red','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','resume','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','tsv','Show\x20journey\x20details','activation_','\x20\x20Journey\x20ID:\x20','Available\x20stages:\x20','\x20activation','Error:\x20Invalid\x20version\x20number:\x20','launched','/j/da','stringify','add','pause','Getting\x20journey\x20traffic\x20data...','(root)','filter','repeat','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','args','Target\x20directory:\x20','test','journeyBundleName','\x20\x20-\x20','Database:\x20','verbose','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','.yml','getTrafficData','error',',\x20version:\x20','bold','columns','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','List\x20all\x20versions\x20of\x20a\x20journey','journeyBundleId','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','connection','4611258fEIZWe','journey:traffic','buildIdToNameMap','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','folderPath','get','\x20\x20Target:\x20','helpText','enteredSize','stageNameMap','Folder\x20path:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','\x20details...','Show\x20journey\x20table\x20column\x20mapping','rule','web','exitOrJumpRate','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','createdAt','history','Getting\x20version\x20','options','createVersion','\x20journey\x20files\x20to\x20','isNew','all','journeyName','content','data','Resolving\x20version...','type','1503NLCnSP','Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)','links','entries','journey:columns','set','\x5c$&','milestoneSize','\x20\x20Statistics\x20not\x20available','journey:resume','audienceId','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','rootFolderId','split','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','find','goal','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','journey:push','session','nodes','exitOrJumpSize','includeHistory','5280368BZIjup','parentSegment','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','\x20not\x20found.\x20Available:\x20','state','getLatestJourneyId'];a28_0xbb2e=function(){return _0x50dae8;};return a28_0xbb2e();}function globToRegex(_0x54103d){const _0x143bd5=a28_0x319a,_0x33c256=_0x54103d[_0x143bd5(0x1d0)]('*')[_0x143bd5(0xe6)](escapeRegex);return new RegExp(_0x33c256[_0x143bd5(0xe2)]('.*'),'i');}function buildRuleToNameMapping(_0x230601){const _0x203247=a28_0x319a,_0x4536e9=new Map();if(_0x230601[_0x203247(0x176)])for(const [_0x1245a0,_0x24c2d0]of Object[_0x203247(0x1c6)](_0x230601['segments'])){if(_0x24c2d0[_0x203247(0x1b1)]){const _0x52bb7d=serializeRule(_0x24c2d0['rule']),_0x2157dc=_0x4536e9[_0x203247(0x1a8)](_0x52bb7d);_0x2157dc?_0x2157dc[_0x203247(0x108)](_0x1245a0):_0x4536e9[_0x203247(0x1c8)](_0x52bb7d,[_0x1245a0]);}}return _0x4536e9;}async function resolveJourneyIdFromInput(_0x2647f5,_0x5c875f,_0x119729){const _0x592441=a28_0x319a,_0x4665e0=await resolveJourneyTarget(_0x2647f5,_0x5c875f[_0x592441(0x1db)],_0x5c875f[_0x592441(0x196)]),_0x2defef=_0x4665e0[_0x592441(0x1db)];if(!_0x2defef)throw new SDKError(ErrorCode[_0x592441(0x107)],_0x592441(0x134));const _0x24501f=await withSpinner(_0x592441(0x106),()=>_0x119729[_0x592441(0x1e9)][_0x592441(0x161)](_0x2defef),{'verbose':_0x5c875f[_0x592441(0x196)]}),_0x9a087f=_0x24501f[_0x592441(0x1c0)],_0x4f7b18=await withSpinner('Resolving\x20journey...',()=>_0x119729['journey']['resolveJourneyId'](_0x9a087f,_0x4665e0[_0x592441(0x1be)]),{'verbose':_0x5c875f[_0x592441(0x196)]});return{'journeyId':_0x4f7b18[_0x592441(0x1c0)],'journeyName':_0x4665e0[_0x592441(0x1be)],'parentSegmentId':_0x9a087f};}async function resolveJourneyTarget(_0x5dc90a,_0x252d2d,_0x603230){const _0x561963=a28_0x319a;if(isYamlFilePath(_0x5dc90a))try{const _0xf5de41=await resolveYamlFilePath(_0x5dc90a);return _0x603230&&(console['error'](_0x561963(0x167)+_0x5dc90a),console['error']('\x20\x20Parent\x20segment:\x20'+_0xf5de41[_0x561963(0x1db)]),console[_0x561963(0x19a)](_0x561963(0x110)+_0xf5de41[_0x561963(0x154)]),console['error'](_0x561963(0x141)+(_0xf5de41[_0x561963(0x1a7)]||_0x561963(0x18c)))),{'journeyName':_0xf5de41['segmentName'],'parentSegment':_0xf5de41[_0x561963(0x1db)],'resolved':_0xf5de41};}catch(_0x4c9545){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x561963(0x17e)+_0x4c9545[_0x561963(0xfe)]);}if(!_0x252d2d)throw new SDKError(ErrorCode[_0x561963(0x107)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x5dc90a,'parentSegment':_0x252d2d};}export class JourneyListCommand extends BaseCommand{[a28_0x444827(0x11e)]='journey:list';[a28_0x444827(0x13c)]=a28_0x444827(0x117);async[a28_0x444827(0xe5)](_0x432c3a){const _0x596a0e=a28_0x444827,{options:_0x1ccd64,args:_0x342af8,tdx:_0x532211}=_0x432c3a,_0x3c8b34=_0x342af8[0x0],_0x206ff7=_0x1ccd64['parentSegment'];if(!_0x206ff7)return console['error'](_0x596a0e(0xf8)),console[_0x596a0e(0x19a)](_0x596a0e(0x135)),0x1;const _0x287c6b=await withSpinner(_0x596a0e(0x106),()=>_0x532211[_0x596a0e(0x1e9)][_0x596a0e(0x161)](_0x206ff7),{'verbose':_0x1ccd64[_0x596a0e(0x196)]}),_0x4d6385=_0x287c6b['data'];_0x1ccd64[_0x596a0e(0x196)]&&(console[_0x596a0e(0x19a)](_0x596a0e(0x148)+_0x206ff7+_0x596a0e(0x158)+_0x4d6385+')'),_0x3c8b34&&console['error'](_0x596a0e(0x11f)+_0x3c8b34));const _0x2ab5c1=await withSpinner(_0x596a0e(0x120),()=>_0x532211[_0x596a0e(0x1e9)][_0x596a0e(0x144)](_0x4d6385),{'verbose':_0x1ccd64['verbose']}),_0x64e39b=_0x2ab5c1[_0x596a0e(0x1c0)],_0x2ed488=_0x64e39b[_0x596a0e(0x1cf)],_0x4ff24c=await withSpinner(_0x596a0e(0x15f),()=>_0x532211[_0x596a0e(0x130)][_0x596a0e(0xf9)](_0x4d6385,_0x2ed488),{'verbose':_0x1ccd64[_0x596a0e(0x196)]});let _0x30d1da=_0x4ff24c[_0x596a0e(0x1c0)][_0x596a0e(0xe0)];const _0x19cfe5=_0x4ff24c[_0x596a0e(0x1c0)]['folders'],_0x257c96=new Map();for(const _0x2c0988 of _0x19cfe5){_0x257c96[_0x596a0e(0x1c8)](_0x2c0988['id'],_0x2c0988['name']);}if(_0x3c8b34){const _0x2f6b6f=globToRegex(_0x3c8b34);_0x30d1da=_0x30d1da[_0x596a0e(0x18d)](_0x8ae365=>_0x2f6b6f[_0x596a0e(0x192)](_0x8ae365[_0x596a0e(0x193)]));}console[_0x596a0e(0x19a)](_0x596a0e(0x12f)+_0x30d1da['length']+_0x596a0e(0x13b)+(_0x30d1da[_0x596a0e(0x168)]!==0x1?'s':''));const _0x35bc1f=_0x8dde95=>{const _0x5452e1=_0x596a0e;return getConsoleNextUrl(_0x1ccd64[_0x5452e1(0x100)],_0x5452e1(0x140)+_0x4d6385+'/e/'+_0x8dde95+_0x5452e1(0x187));};if(_0x1ccd64[_0x596a0e(0x178)]===_0x596a0e(0x171))await handleSDKOutput(_0x30d1da,_0x1ccd64);else{if(_0x1ccd64[_0x596a0e(0x178)]===_0x596a0e(0x123)){const _0x45b75b=_0x30d1da[_0x596a0e(0xe6)](_0xad0318=>({..._0xad0318,'url':_0x35bc1f(_0xad0318['id'])}));await handleSDKOutput(_0x45b75b,_0x1ccd64);}else{console[_0x596a0e(0x159)]('['+_0x206ff7+']');const _0x1208fd=new Map(),_0x4e4375=[];for(const _0x2ea573 of _0x30d1da){if(!_0x2ea573[_0x596a0e(0x1e2)]||_0x2ea573[_0x596a0e(0x1e2)]===_0x2ed488)_0x4e4375[_0x596a0e(0x108)](_0x2ea573);else{const _0x4a916f=_0x1208fd['get'](_0x2ea573[_0x596a0e(0x1e2)])||[];_0x4a916f[_0x596a0e(0x108)](_0x2ea573),_0x1208fd[_0x596a0e(0x1c8)](_0x2ea573[_0x596a0e(0x1e2)],_0x4a916f);}}const _0x5c9853=(_0x595a87,_0x345df2)=>_0x595a87[_0x596a0e(0x193)][_0x596a0e(0x11a)](_0x345df2[_0x596a0e(0x193)],undefined,{'sensitivity':_0x596a0e(0x11c)});_0x4e4375[_0x596a0e(0x101)](_0x5c9853);for(const _0x104bb1 of _0x4e4375){console[_0x596a0e(0x159)](formatJourneyItem(_0x104bb1,'',_0x35bc1f(_0x104bb1['id'])));}const _0x1b9e55=[..._0x1208fd[_0x596a0e(0x1c6)]()]['sort']((_0x23a45e,_0x5dcb1b)=>{const _0x53b42d=_0x596a0e,_0xdfe466=_0x257c96['get'](_0x23a45e[0x0])||_0x23a45e[0x0],_0x5e3a7c=_0x257c96[_0x53b42d(0x1a8)](_0x5dcb1b[0x0])||_0x5dcb1b[0x0];return _0xdfe466['localeCompare'](_0x5e3a7c,undefined,{'sensitivity':_0x53b42d(0x11c)});});for(const [_0x3ed9f6,_0x4fb88b]of _0x1b9e55){const _0x13af4b=_0x257c96['get'](_0x3ed9f6)||_0x3ed9f6;console[_0x596a0e(0x159)](_0x596a0e(0x119)+_0x13af4b),_0x4fb88b[_0x596a0e(0x101)](_0x5c9853);for(const _0x1da854 of _0x4fb88b){console[_0x596a0e(0x159)](formatJourneyItem(_0x1da854,'\x20\x20',_0x35bc1f(_0x1da854['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a28_0x444827(0x104);[a28_0x444827(0x13c)]=a28_0x444827(0x180);async[a28_0x444827(0xe5)](_0x2480e6){const _0x30ab47=a28_0x444827,{options:_0x1a73a9,args:_0xac8ec1,tdx:_0x2b2e5b}=_0x2480e6,_0x236637=_0xac8ec1[0x0];if(!_0x236637)return console['error'](_0x30ab47(0x1dc)),console[_0x30ab47(0x19a)](_0x30ab47(0x1ce)),console[_0x30ab47(0x19a)](_0x30ab47(0x145)),console['error'](_0x30ab47(0xe9)),0x1;_0x1a73a9[_0x30ab47(0x196)]&&console[_0x30ab47(0x19a)]('Input:\x20'+_0x236637);const {journeyId:_0x572ce6,parentSegmentId:_0x59afcb}=await resolveJourneyIdFromInput(_0x236637,_0x1a73a9,_0x2b2e5b);if(_0x1a73a9[_0x30ab47(0x1b2)]){const _0x38f316=getConsoleNextUrl(_0x1a73a9['site'],_0x30ab47(0x140)+_0x59afcb+_0x30ab47(0x15b)+_0x572ce6+'/j/da/je');return console[_0x30ab47(0x19a)](a28_0x1bce51[_0x30ab47(0x17a)]('✔')+'\x20Opening\x20'+a28_0x1bce51['cyan'](_0x38f316)),openBrowser(_0x38f316),0x0;}const _0xd0192c=await withSpinner('Getting\x20journey\x20details...',()=>_0x2b2e5b[_0x30ab47(0x130)][_0x30ab47(0x113)](_0x572ce6),{'verbose':_0x1a73a9[_0x30ab47(0x196)]}),_0x2a9597=_0xd0192c[_0x30ab47(0x1c0)],_0x2c36f5=_0x1a73a9[_0x30ab47(0x128)];let _0x328afc;if(_0x2c36f5)try{const _0x46d06c=await withSpinner(_0x30ab47(0x147),()=>_0x2b2e5b[_0x30ab47(0x130)][_0x30ab47(0xdb)](_0x572ce6),{'verbose':_0x1a73a9['verbose']});_0x328afc=_0x46d06c[_0x30ab47(0x1c0)];}catch{_0x1a73a9[_0x30ab47(0x196)]&&console[_0x30ab47(0x19a)](_0x30ab47(0x1cb));}const _0x53dfcc=getConsoleNextUrl(_0x1a73a9[_0x30ab47(0x100)],_0x30ab47(0x140)+_0x59afcb+_0x30ab47(0x15b)+_0x572ce6+_0x30ab47(0x149)),_0x2a37ae={'id':_0x2a9597['id'],'name':_0x2a9597[_0x30ab47(0x10f)][_0x30ab47(0x11e)],'description':_0x2a9597[_0x30ab47(0x10f)][_0x30ab47(0x13c)],'state':_0x2a9597['attributes'][_0x30ab47(0x1de)],'paused':_0x2a9597[_0x30ab47(0x10f)][_0x30ab47(0xdd)],'reentry_mode':_0x2a9597[_0x30ab47(0x10f)][_0x30ab47(0xf2)],'stages':_0x2a9597['attributes'][_0x30ab47(0x129)]?.[_0x30ab47(0x168)]||0x0,..._0x2a9597[_0x30ab47(0x10f)][_0x30ab47(0x1d3)]&&{'goal':_0x2a9597[_0x30ab47(0x10f)][_0x30ab47(0x1d3)][_0x30ab47(0x11e)]},..._0x328afc&&{'statistics':{'size':_0x328afc[_0x30ab47(0xf4)],'entered':_0x328afc['enteredSize'],'goal_achieved':_0x328afc[_0x30ab47(0x10c)],'completion_rate':_0x328afc['completionRate'],'exit_or_jump':_0x328afc[_0x30ab47(0x1d8)],'exit_or_jump_rate':_0x328afc['exitOrJumpRate'],'stages':_0x328afc[_0x30ab47(0x150)]}},'url':_0x53dfcc};return await handleSingleObjectOutput(_0x2a37ae,_0x1a73a9),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a28_0x444827(0x11e)]='journey:stats';[a28_0x444827(0x13c)]=a28_0x444827(0x173);async[a28_0x444827(0xe5)](_0x1dfd46){const _0x30fa5=a28_0x444827,{options:_0x2906a2,args:_0x187202,tdx:_0x10b6f3}=_0x1dfd46,_0x2ce249=_0x187202[0x0];if(!requireNameOrPath(_0x2ce249))return 0x1;_0x2906a2[_0x30fa5(0x196)]&&console[_0x30fa5(0x19a)](_0x30fa5(0x109)+_0x2ce249);const _0x4d4934=_0x2906a2,_0xd42383=_0x4d4934['from'],_0x39abc6=_0x4d4934['to'],_0x125384=_0x4d4934[_0x30fa5(0x1d9)],_0x5a1ba6=_0x4d4934[_0x30fa5(0x14c)];_0x125384&&!_0xd42383&&!_0x39abc6&&console[_0x30fa5(0x19a)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x588b23=_0x125384?withJsonFormat(_0x2906a2):_0x2906a2,{journeyId:_0x3a00a2,journeyName:_0x2a665e}=await resolveJourneyIdFromInput(_0x2ce249,_0x588b23,_0x10b6f3),_0x2c065f=_0xd42383||_0x39abc6?{'from':_0xd42383,'to':_0x39abc6}:undefined,_0x1b7c5f=await withSpinner(_0x30fa5(0x147),()=>Promise[_0x30fa5(0x1bd)]([_0x10b6f3[_0x30fa5(0x130)][_0x30fa5(0x113)](_0x3a00a2),_0x10b6f3[_0x30fa5(0x130)]['getStatistics'](_0x3a00a2,_0x2c065f)]),{'verbose':_0x588b23['verbose']}),[_0x46f122,_0x535b3d]=_0x1b7c5f['data'];if(!_0x535b3d||_0x535b3d[_0x30fa5(0x115)]===null)return console[_0x30fa5(0x19a)](_0x30fa5(0x16f)+_0x2a665e),console[_0x30fa5(0x19a)](_0x30fa5(0x14b)),0x0;const _0x30cd0a=buildStageNameMap(_0x46f122),_0x306f30=!!(_0x2c065f&&_0x535b3d[_0x30fa5(0x1b7)]?.[_0x30fa5(0x168)]),_0x4b029a={'stageNameMap':_0x30cd0a,'hasPeriod':_0x306f30,'includeHistory':!!_0x125384};if(_0x5a1ba6&&_0x535b3d['stages']){const _0x5eb632=_0x535b3d['stages'][_0x30fa5(0x1d2)](_0x50c7bd=>{const _0x5d31af=_0x30fa5,_0x56dcf7=_0x30cd0a['get'](_0x50c7bd['id'])??'';return _0x56dcf7[_0x5d31af(0x15e)]()===_0x5a1ba6[_0x5d31af(0x15e)]();});if(_0x5eb632)return await handleSingleObjectOutput(formatStageStats(_0x5eb632,_0x4b029a),_0x588b23),0x0;const _0x3e60f7=_0x535b3d[_0x30fa5(0x150)][_0x30fa5(0xe6)](_0x2d83c0=>_0x30cd0a[_0x30fa5(0x1a8)](_0x2d83c0['id'])??_0x2d83c0['id']);return console[_0x30fa5(0x19a)](_0x30fa5(0x166)+_0x5a1ba6+_0x30fa5(0xd9)),console[_0x30fa5(0x19a)](_0x30fa5(0x183)+_0x3e60f7[_0x30fa5(0xe2)](',\x20')),0x1;}const _0x42ea26=_0x535b3d[_0x30fa5(0x150)]?.[_0x30fa5(0xe6)](_0x4300de=>formatStageStats(_0x4300de,_0x4b029a)),_0xcae855=assembleJourneyStats(_0x535b3d,{'from':_0xd42383,'to':_0x39abc6,'includeHistory':_0x125384});return await this[_0x30fa5(0x14d)](_0xcae855,_0x42ea26??[],_0x588b23),0x0;}async[a28_0x444827(0x14d)](_0x337ae9,_0x438192,_0x5036f3){const _0x53a62f=a28_0x444827,_0x2dbc37=_0x5036f3[_0x53a62f(0x178)]==='json'||_0x5036f3[_0x53a62f(0x178)]===_0x53a62f(0x143)||_0x5036f3['json']||_0x5036f3['jsonl'];if(_0x2dbc37){_0x337ae9['stages']=_0x438192,await handleSingleObjectOutput(_0x337ae9,_0x5036f3);return;}await handleSingleObjectOutput(_0x337ae9,_0x5036f3);for(const _0x2c1007 of _0x438192){console['log'](''),console[_0x53a62f(0x159)](String(a28_0x1bce51[_0x53a62f(0x16b)][_0x53a62f(0x19c)]('['+_0x2c1007[_0x53a62f(0x11e)]+']'))+a28_0x1bce51['dim']('\x20'+_0x2c1007['id']));const {id:_0x19a025,name:_0x53687c,..._0x2b7cba}=_0x2c1007;await handleSingleObjectOutput(_0x2b7cba,_0x5036f3);}}}export class JourneyTrafficCommand extends BaseCommand{[a28_0x444827(0x11e)]=a28_0x444827(0x1a4);[a28_0x444827(0x13c)]=a28_0x444827(0x12a);async[a28_0x444827(0xe5)](_0x560d88){const _0x4628d1=a28_0x444827,{options:_0x569192,args:_0x437597,tdx:_0x24def7}=_0x560d88,_0x338c81=_0x437597[0x0];if(!requireNameOrPath(_0x338c81))return 0x1;_0x569192[_0x4628d1(0x196)]&&console[_0x4628d1(0x19a)](_0x4628d1(0x109)+_0x338c81);const _0x1d8060=_0x569192,_0x3eee53=_0x1d8060[_0x4628d1(0x1c2)],_0x31f7b6=_0x1d8060['from'],_0xa86a20=_0x1d8060['to'],_0x18b228=_0x1d8060[_0x4628d1(0x12c)];if(_0x3eee53&&_0x3eee53!==_0x4628d1(0x172)&&_0x3eee53!==_0x4628d1(0x14a))return console['error'](_0x4628d1(0xf0)+_0x3eee53+_0x4628d1(0x10a)),0x1;const _0x51d83d=withJsonFormat(_0x569192),{journeyId:_0x51d2dd,journeyName:_0xab895b}=await resolveJourneyIdFromInput(_0x338c81,_0x51d83d,_0x24def7),_0x51ebd3={'type':_0x3eee53,'from':_0x31f7b6,'to':_0xa86a20,'limit':_0x18b228},_0x50c55f=await withSpinner(_0x4628d1(0x18b),()=>_0x24def7[_0x4628d1(0x130)][_0x4628d1(0x199)](_0x51d2dd,_0x51ebd3),{'verbose':_0x51d83d[_0x4628d1(0x196)]}),_0x54f34d=_0x50c55f['data'],_0x27d6a=_0x54f34d[_0x4628d1(0x172)]&&(_0x54f34d[_0x4628d1(0x172)][_0x4628d1(0x1d7)]['length']>0x0||_0x54f34d[_0x4628d1(0x172)][_0x4628d1(0x1c5)][_0x4628d1(0x168)]>0x0),_0x5abcbb=_0x54f34d[_0x4628d1(0x14a)]&&_0x54f34d['activation'][_0x4628d1(0x168)]>0x0;if(!_0x27d6a&&!_0x5abcbb)return console[_0x4628d1(0x19a)](_0x4628d1(0x18f)+_0xab895b),console[_0x4628d1(0x19a)](_0x4628d1(0x1d4)),_0x31f7b6&&_0xa86a20&&console['error'](_0x4628d1(0x14e)),0x0;return await handleSingleObjectOutput(_0x54f34d,_0x51d83d),0x0;}}function formatStageStats(_0x177e84,_0x19f7fc){const _0x385f70=a28_0x444827,_0x2745a0=_0x19f7fc[_0x385f70(0x146)]&&_0x177e84[_0x385f70(0x1b7)]?.[_0x385f70(0x168)]?aggregateStageHistory(_0x177e84[_0x385f70(0x1b7)]):{'size':_0x177e84[_0x385f70(0xf4)],'entered':_0x177e84[_0x385f70(0x1ab)],'milestone':_0x177e84[_0x385f70(0x1ca)],'milestone_rate':_0x177e84[_0x385f70(0x111)],'exit_or_jump':_0x177e84[_0x385f70(0x1d8)],'exit_or_jump_rate':_0x177e84[_0x385f70(0x1b3)]},_0x1819b3={'id':_0x177e84['id'],'name':_0x19f7fc[_0x385f70(0x1ac)][_0x385f70(0x1a8)](_0x177e84['id'])??_0x177e84['id'],..._0x2745a0};return _0x19f7fc[_0x385f70(0x146)]&&_0x19f7fc[_0x385f70(0x1d9)]&&_0x177e84['history']&&(_0x1819b3['history']=_0x177e84['history']),_0x1819b3;}export class JourneyPauseCommand extends BaseCommand{[a28_0x444827(0x11e)]='journey:pause';['description']='Pause\x20a\x20running\x20journey';async[a28_0x444827(0xe5)](_0xba1a5a){const _0x539747=a28_0x444827,{options:_0x292db5,args:_0x4b4717,tdx:_0x5abbfb}=_0xba1a5a,_0x4d0e1a=_0x4b4717[0x0];if(!requireNameOrPath(_0x4d0e1a))return 0x1;_0x292db5[_0x539747(0x196)]&&console[_0x539747(0x19a)](_0x539747(0x109)+_0x4d0e1a);const {journeyId:_0x7db8dd,journeyName:_0x1e9275}=await resolveJourneyIdFromInput(_0x4d0e1a,_0x292db5,_0x5abbfb);if(!_0x292db5['yes']){const _0x2daa0f=await confirm(_0x539747(0xeb)+_0x1e9275+'\x22?');if(!_0x2daa0f)return console[_0x539747(0x19a)](_0x539747(0x152)),0x0;}const _0xcaa2ef=await withSpinner(_0x539747(0x142),()=>_0x5abbfb[_0x539747(0x130)][_0x539747(0x18a)](_0x7db8dd),{'verbose':_0x292db5[_0x539747(0x196)]}),_0x2dc7db=_0xcaa2ef[_0x539747(0x1c0)];return console[_0x539747(0x19a)](_0x539747(0x16c)+_0x2dc7db[_0x539747(0x10f)][_0x539747(0x11e)]+_0x539747(0x15c)),0x0;}}export class JourneyResumeCommand extends BaseCommand{['name']=a28_0x444827(0x1cc);['description']='Resume\x20a\x20paused\x20journey';async[a28_0x444827(0xe5)](_0x122a93){const _0x58a239=a28_0x444827,{options:_0x57f8f2,args:_0x3dc9d7,tdx:_0x463833}=_0x122a93,_0x4e1b92=_0x3dc9d7[0x0];if(!requireNameOrPath(_0x4e1b92))return 0x1;_0x57f8f2[_0x58a239(0x196)]&&console[_0x58a239(0x19a)](_0x58a239(0x109)+_0x4e1b92);const {journeyId:_0x29abf4,journeyName:_0x43de15}=await resolveJourneyIdFromInput(_0x4e1b92,_0x57f8f2,_0x463833);if(!_0x57f8f2[_0x58a239(0xff)]){const _0x4500d9=await confirm(_0x58a239(0x197)+_0x43de15+'\x22?');if(!_0x4500d9)return console[_0x58a239(0x19a)]('Cancelled'),0x0;}const _0x10f66f=await withSpinner(_0x58a239(0xf7),()=>_0x463833[_0x58a239(0x130)][_0x58a239(0x17d)](_0x29abf4),{'verbose':_0x57f8f2[_0x58a239(0x196)]}),_0x46ec9b=_0x10f66f[_0x58a239(0x1c0)];return console[_0x58a239(0x19a)]('✔\x20Journey\x20\x22'+_0x46ec9b[_0x58a239(0x10f)]['name']+_0x58a239(0x1e0)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a28_0x444827(0x11e)]='journey:pull';['description']='Export\x20journey(s)\x20as\x20YAML\x20files';async['execute'](_0x51d06a){const _0x434bf5=a28_0x444827,{options:_0x4cf269,args:_0x448d2f,tdx:_0x3235ad}=_0x51d06a,_0x3226d0=_0x4cf269,_0x21af4c=_0x448d2f[0x0],_0xd36fb8=_0x21af4c&&isYamlFilePath(_0x21af4c),_0x4c8891=await resolveTarget({'arg':_0xd36fb8?_0x21af4c:undefined,'contextParent':_0x4cf269[_0x434bf5(0x1db)],'cwd':process[_0x434bf5(0x16e)]()});if(!isSuccessfulResolution(_0x4c8891))return _0x4c8891['errorCode']===_0x434bf5(0x1e1)?(console[_0x434bf5(0x19a)](a28_0x1bce51[_0x434bf5(0xf1)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x434bf5(0x1c4)),console[_0x434bf5(0x19a)](_0x434bf5(0x1a6)),console[_0x434bf5(0x19a)](_0x434bf5(0x1ae)),console[_0x434bf5(0x19a)](_0x434bf5(0x17c))):(console['error'](a28_0x1bce51[_0x434bf5(0x17b)](_0x434bf5(0xee)+_0x4c8891[_0x434bf5(0xfe)]+'\x0a')),_0x4c8891['helpText']&&console[_0x434bf5(0x19a)](a28_0x1bce51[_0x434bf5(0x16b)](_0x4c8891[_0x434bf5(0x1aa)]))),0x1;let _0x12ac75=_0xd36fb8?undefined:_0x21af4c,_0x4499da,_0x42877d;_0x4c8891[_0x434bf5(0x1c2)]==='file'&&(_0x12ac75=_0x4c8891['resourceName'],_0x4499da=_0x4c8891['filePath'],_0x42877d=_0x4c8891[_0x434bf5(0x1a7)]);const _0x3ab39f=_0x4c8891[_0x434bf5(0xf5)],_0x3eadde=_0x4c8891['targetDir'];_0x3226d0[_0x434bf5(0x196)]&&(console[_0x434bf5(0x19a)](_0x434bf5(0x148)+_0x3ab39f),console[_0x434bf5(0x19a)](_0x434bf5(0x191)+_0x3eadde),_0x12ac75&&console['error']('Journey\x20name:\x20'+_0x12ac75),_0x4499da&&console[_0x434bf5(0x19a)](_0x434bf5(0xdf)+_0x4499da),_0x42877d&&console['error'](_0x434bf5(0x1ad)+_0x42877d));const _0xd01414=await withSpinner(_0x434bf5(0x106),()=>_0x3235ad['segment']['resolveParentId'](_0x3ab39f),{'verbose':_0x4cf269[_0x434bf5(0x196)]}),_0x59492a=_0xd01414[_0x434bf5(0x1c0)],{journeys:_0x24a538,folders:_0x132f91}=await withSpinner(_0x434bf5(0x153),async()=>{const _0x264298=_0x434bf5,[_0x58432b,_0x8a1fd3]=await Promise['all']([_0x3235ad[_0x264298(0x130)][_0x264298(0x15a)](_0x59492a,undefined,{'includeAllVersions':!![]}),_0x3235ad[_0x264298(0x1e9)][_0x264298(0x10b)](_0x59492a)]);return{'journeys':_0x58432b,'folders':_0x8a1fd3};},{'verbose':_0x4cf269[_0x434bf5(0x196)]})[_0x434bf5(0xe3)](_0x224ffe=>_0x224ffe[_0x434bf5(0x1c0)]);let _0x22a73c=_0x24a538;const _0x14f261=buildFolderIdToPathMap(_0x132f91);if(_0x12ac75){const _0x20a32a=_0x22a73c[_0x434bf5(0x18d)](_0x19c189=>_0x19c189[_0x434bf5(0x193)][_0x434bf5(0x15e)]()===_0x12ac75[_0x434bf5(0x15e)]());if(_0x20a32a[_0x434bf5(0x168)]===0x0)return console[_0x434bf5(0x19a)]('Error:\x20Journey\x20not\x20found:\x20'+_0x12ac75),console[_0x434bf5(0x19a)]('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x22a73c=_0x20a32a;}if(_0x42877d!==undefined){const _0x3c1853=_0x22a73c[_0x434bf5(0x18d)](_0xd61df7=>{const _0x4850e9=_0x434bf5,_0x27a77a=_0xd61df7['folderId']?_0x14f261[_0x4850e9(0x1a8)](_0xd61df7[_0x4850e9(0x1e2)])||'':'';return _0x27a77a===_0x42877d;});if(_0x3c1853[_0x434bf5(0x168)]===0x0&&_0x22a73c['length']>0x0){console[_0x434bf5(0x19a)]('Error:\x20Journey\x20\x27'+_0x12ac75+_0x434bf5(0x165)+(_0x42877d||_0x434bf5(0x1e8))),console[_0x434bf5(0x19a)](_0x434bf5(0x1a1));for(const _0x396087 of _0x22a73c){const _0x5b7cc8=_0x396087[_0x434bf5(0x1e2)]?_0x14f261[_0x434bf5(0x1a8)](_0x396087[_0x434bf5(0x1e2)])||'':'';console[_0x434bf5(0x19a)](_0x434bf5(0x194)+(_0x5b7cc8||'(root)')+'/'+_0x396087[_0x434bf5(0x193)]);}return 0x1;}_0x22a73c=_0x3c1853;}if(_0x22a73c[_0x434bf5(0x168)]===0x0)return console[_0x434bf5(0x19a)]('No\x20journeys\x20found'),0x0;const _0x1788a0=new Map();for(const _0x55a433 of _0x22a73c){const _0x1f346e=_0x55a433[_0x434bf5(0x1a0)];!_0x1788a0[_0x434bf5(0x11d)](_0x1f346e)&&_0x1788a0[_0x434bf5(0x1c8)](_0x1f346e,[]),_0x1788a0['get'](_0x1f346e)[_0x434bf5(0x108)](_0x55a433);}for(const _0x14b7e6 of _0x1788a0[_0x434bf5(0xea)]()){_0x14b7e6[_0x434bf5(0x101)]((_0xb31e89,_0x43ff04)=>(_0xb31e89[_0x434bf5(0xfc)]||0x0)-(_0x43ff04[_0x434bf5(0xfc)]||0x0));}const _0x28ca35=[],{idToEmailMap:_0x4b9e39,connectionIdToNameMap:_0x2b58ee}=await withSpinner('Fetching\x20users\x20and\x20connections...',async()=>{const _0x21f2a3=_0x434bf5,[_0x1f35ea,_0x56bc52]=await Promise['all']([_0x3235ad['user'][_0x21f2a3(0xe8)](),_0x3235ad[_0x21f2a3(0x1a2)][_0x21f2a3(0x1a5)]()]);return{'idToEmailMap':_0x1f35ea,'connectionIdToNameMap':_0x56bc52};},{'verbose':_0x4cf269[_0x434bf5(0x196)]})[_0x434bf5(0xe3)](_0x125430=>_0x125430[_0x434bf5(0x1c0)]);for(const _0x5dd839 of _0x1788a0[_0x434bf5(0xea)]()){const _0x2aefe6=_0x5dd839[0x0][_0x434bf5(0x193)],_0x44aa36=_0x5dd839[0x0][_0x434bf5(0x1e2)],_0x5953b0=_0x44aa36?_0x14f261[_0x434bf5(0x1a8)](_0x44aa36)||'':'',_0x524c99=_0x5953b0?a28_0x492a08[_0x434bf5(0xe2)](_0x3eadde,_0x5953b0):_0x3eadde,_0x27bdba=_0x4499da||a28_0x492a08[_0x434bf5(0xe2)](_0x524c99,sanitizeFileName(_0x2aefe6)+'.yml');let _0x5cb5b5,_0x3262c9;if(existsSync(_0x27bdba))try{const _0x4d02ce=readFileSync(_0x27bdba,_0x434bf5(0x16a)),_0x583eb0=parseYamlString(_0x4d02ce);_0x3262c9=_0x583eb0,_0x5cb5b5=buildRuleToNameMapping(_0x583eb0),_0x3226d0[_0x434bf5(0x196)]&&_0x5cb5b5['size']>0x0&&console['error']('Found\x20'+_0x5cb5b5['size']+_0x434bf5(0x132)+_0x2aefe6);}catch(_0x349c31){_0x3226d0[_0x434bf5(0x196)]&&console[_0x434bf5(0x19a)](_0x434bf5(0x19e)+_0x349c31[_0x434bf5(0xfe)]);}const _0x91cbc8=[],_0x20b8fd=new Set(),_0x5bb619=new Map(),_0x54fe47=new Map(),_0x4dd35d=new Set(),_0x3e0fc8=new Map(),_0x2b6fb6=new Map(),_0x4e0e69=createJumpTargetCache();await withProgressSpinner(_0x434bf5(0x105)+_0x2aefe6+_0x434bf5(0x125),async _0x9f78d0=>{const _0x26053e=_0x434bf5;for(const _0x4e73c0 of _0x5dd839){const _0x41f20c=_0x5dd839[_0x26053e(0x168)]>0x1?_0x4e73c0['journeyBundleName']+'\x20v'+(_0x4e73c0['versionNumber']||0x1):_0x4e73c0[_0x26053e(0x193)];_0x9f78d0[_0x26053e(0x1e6)](_0x26053e(0x105)+_0x41f20c);const _0x1cd8f4=await _0x3235ad[_0x26053e(0x130)]['getJourney'](_0x4e73c0['id']),_0x3506f5=_0x1cd8f4[_0x26053e(0x10f)]?.[_0x26053e(0x1cd)],_0x46e556={'resolveSegment':async _0x43d9ab=>{const _0x48f16f=_0x26053e;if(!_0x3506f5)return{'name':_0x43d9ab,'isJourneyLocal':![]};const _0x3a29b5=_0x5bb619['get'](_0x43d9ab);if(_0x3a29b5)return _0x3a29b5;try{const _0x4a70b6=await _0x3235ad['segment'][_0x48f16f(0x114)](_0x3506f5,_0x43d9ab),_0x206d7d=_0x4a70b6[_0x48f16f(0x103)]===SEGMENT_KIND_JOURNEY;let _0x2806ac,_0x14adb2=_0x4a70b6[_0x48f16f(0x11e)];if(_0x206d7d&&_0x4a70b6[_0x48f16f(0x1b1)]){const _0x5a6f94=await segmentResponseToDef(_0x4a70b6,{'resolveSegmentName':async _0x3a99d2=>{const _0x428568=_0x48f16f,_0x2b3224=_0x5bb619[_0x428568(0x1a8)](_0x3a99d2);if(_0x2b3224)return _0x2b3224['name'];const _0x447e41=await _0x46e556[_0x428568(0x170)](_0x3a99d2);return _0x447e41['name'];}}),_0x4d0c92=_0x5a6f94[_0x48f16f(0x1b1)];_0x2806ac={'description':_0x4a70b6['description'],'rule':_0x4d0c92};const _0x50da2b=serializeRule(_0x4d0c92),_0x5a15bb=_0x54fe47[_0x48f16f(0x1a8)](_0x50da2b);if(_0x5a15bb)_0x14adb2=_0x5a15bb,_0x2806ac=undefined,_0x3226d0[_0x48f16f(0x196)]&&console[_0x48f16f(0x19a)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x4a70b6[_0x48f16f(0x11e)]+'\x20->\x20'+_0x5a15bb);else{let _0x10006c=![];if(_0x5cb5b5){const _0x182e5b=_0x5cb5b5['get'](_0x50da2b);if(_0x182e5b){const _0x40c47d=_0x182e5b[_0x48f16f(0x1d2)](_0x8f41ce=>!_0x20b8fd['has'](_0x8f41ce));_0x40c47d&&(_0x14adb2=_0x40c47d,_0x20b8fd[_0x48f16f(0x189)](_0x40c47d),_0x54fe47['set'](_0x50da2b,_0x40c47d),_0x10006c=!![],_0x3226d0[_0x48f16f(0x196)]&&console[_0x48f16f(0x19a)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x40c47d+'\x20(rule\x20match)'));}}if(!_0x10006c){const _0x272717=generateJourneyLocalName(_0x4a70b6[_0x48f16f(0x11e)]);_0x272717&&(_0x14adb2=_0x272717);let _0x3e1023=_0x14adb2,_0x5d7c9c=0x2;while(_0x20b8fd[_0x48f16f(0x11d)](_0x3e1023)){_0x3e1023=_0x14adb2+'_'+_0x5d7c9c,_0x5d7c9c++;}_0x20b8fd[_0x48f16f(0x189)](_0x3e1023),_0x54fe47[_0x48f16f(0x1c8)](_0x50da2b,_0x3e1023),_0x14adb2=_0x3e1023;}}}const _0xb61ce={'name':_0x14adb2,'isJourneyLocal':_0x206d7d,'definition':_0x2806ac};return _0x5bb619[_0x48f16f(0x1c8)](_0x43d9ab,_0xb61ce),_0xb61ce;}catch(_0x55dc54){return _0x4cf269[_0x48f16f(0x196)]&&console[_0x48f16f(0x19a)](_0x48f16f(0x126)+_0x43d9ab+':\x20'+_0x55dc54[_0x48f16f(0xfe)]),{'name':_0x43d9ab,'isJourneyLocal':![]};}},'resolveActivation':async _0x15c601=>{const _0x3366ae=_0x26053e,_0xde9550=_0x3e0fc8[_0x3366ae(0x1a8)](_0x15c601);if(_0xde9550)return _0xde9550;try{const _0x4bf5e6=await _0x3235ad[_0x3366ae(0x130)]['getActivation'](_0x4e73c0['id'],_0x15c601),_0xaae78b=journeyActivationStepToYaml(_0x4bf5e6,_0x4b9e39,_0x2b58ee),_0x47c208=JSON[_0x3366ae(0x188)]({'name':_0xaae78b['name'],'connection':_0xaae78b[_0x3366ae(0x1a2)],'connector_config':_0xaae78b['connector_config']}),_0x1846bf=_0x2b6fb6[_0x3366ae(0x1a8)](_0x47c208);if(_0x1846bf){const _0x1047fd={'name':_0x1846bf,'isJourneyLocal':!![],'definition':_0xaae78b};return _0x3e0fc8[_0x3366ae(0x1c8)](_0x15c601,_0x1047fd),_0x1047fd;}const _0x40e777=_0x4bf5e6[_0x3366ae(0x10f)][_0x3366ae(0x122)][_0x3366ae(0x11e)]||_0x15c601,_0x166440=sanitizeYamlKey(_0x40e777)||_0x3366ae(0x181)+_0x15c601;let _0x55e48a=_0x166440,_0x4dfea9=0x2;while(_0x4dd35d[_0x3366ae(0x11d)](_0x55e48a)){_0x55e48a=_0x166440+'_'+_0x4dfea9,_0x4dfea9++;}_0x4dd35d[_0x3366ae(0x189)](_0x55e48a),_0x2b6fb6['set'](_0x47c208,_0x55e48a);const _0xc52484={'name':_0x55e48a,'isJourneyLocal':!![],'definition':_0xaae78b};return _0x3e0fc8[_0x3366ae(0x1c8)](_0x15c601,_0xc52484),_0xc52484;}catch(_0x4ccbd1){return _0x4cf269[_0x3366ae(0x196)]&&console[_0x3366ae(0x19a)](_0x3366ae(0x12b)+_0x15c601+':\x20'+_0x4ccbd1['message']),{'name':_0x15c601,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x4506fb,_0x429a25)=>{const _0x282c04=_0x26053e;return resolveJumpTarget(_0x4506fb,_0x429a25,_0x4e0e69,_0x3c07d5=>_0x3235ad[_0x282c04(0x130)][_0x282c04(0x113)](_0x3c07d5));}},_0x37f5f5=await journeyResponseToDef(_0x1cd8f4,_0x46e556);_0x91cbc8['push']({'item':_0x4e73c0,'yaml':_0x37f5f5});}},{'verbose':_0x4cf269[_0x434bf5(0x196)]});const _0x37015b=await _0x3235ad[_0x434bf5(0x130)][_0x434bf5(0x1df)](_0x5dd839[0x0][_0x434bf5(0x1a0)]),_0x543f5c=buildMergedJourneyDef(_0x91cbc8,_0x5cb5b5,_0x37015b),_0x8f4c2f=normalizeJourneyDef(_0x543f5c,_0x3262c9),_0x14e073=toYamlString(_0x8f4c2f),_0x1383df=_0x4499da||a28_0x492a08[_0x434bf5(0xe2)](_0x524c99,sanitizeFileName(_0x2aefe6)+_0x434bf5(0x198));!_0x4499da&&_0x5953b0&&!existsSync(_0x524c99)&&mkdirSync(_0x524c99,{'recursive':!![]});const _0x111aaf=a28_0x492a08[_0x434bf5(0x13d)](process[_0x434bf5(0x16e)](),_0x1383df);if(existsSync(_0x1383df)){const _0x29d1ac=readFileSync(_0x1383df,_0x434bf5(0x16a)),_0x66a46f=generateDiff(_0x29d1ac,_0x14e073),_0x1a98aa=hasChanges(_0x66a46f);_0x28ca35[_0x434bf5(0x108)]({'relativePath':_0x111aaf,'absolutePath':_0x1383df,'content':_0x14e073,'isNew':![],'hasChanges':_0x1a98aa,'diff':_0x1a98aa?formatDiffWithColors(_0x66a46f):undefined});}else _0x28ca35[_0x434bf5(0x108)]({'relativePath':_0x111aaf,'absolutePath':_0x1383df,'content':_0x14e073,'isNew':!![],'hasChanges':![]});}const _0x5d8a35=_0x28ca35['filter'](_0xc16bce=>_0xc16bce[_0x434bf5(0x1bc)]),_0x4d33a9=_0x28ca35['filter'](_0x3af9af=>!_0x3af9af[_0x434bf5(0x1bc)]&&_0x3af9af['hasChanges']),_0x554daf=_0x28ca35['filter'](_0x4b3035=>!_0x4b3035[_0x434bf5(0x1bc)]&&!_0x4b3035[_0x434bf5(0x127)]),_0x222ce6=_0x22a73c[_0x434bf5(0x168)],_0x37ba08=_0x1788a0[_0x434bf5(0xf4)],_0x24bdef=_0x222ce6>_0x37ba08?'\x20('+_0x222ce6+_0x434bf5(0x12e):'';console['error']('\x0aPull\x20summary:'),console[_0x434bf5(0x19a)]('\x20\x20'+a28_0x1bce51[_0x434bf5(0x16b)](_0x37ba08+_0x434bf5(0x15d))+a28_0x1bce51['dim'](_0x24bdef)),console[_0x434bf5(0x19a)]('\x20\x20'+a28_0x1bce51['green']('+\x20'+_0x5d8a35[_0x434bf5(0x168)]+_0x434bf5(0xec))),console[_0x434bf5(0x19a)]('\x20\x20'+a28_0x1bce51[_0x434bf5(0xf1)]('~\x20'+_0x4d33a9['length']+'\x20changed\x20files')),console[_0x434bf5(0x19a)]('\x20\x20'+a28_0x1bce51['dim']('=\x20'+_0x554daf[_0x434bf5(0x168)]+_0x434bf5(0xd8))),console['error'](_0x434bf5(0x1a9)+a28_0x1bce51[_0x434bf5(0x16b)](_0x3eadde)+'\x0a');if(_0x4d33a9[_0x434bf5(0x168)]>0x0)for(const _0x5af739 of _0x4d33a9){console['error'](_0x434bf5(0x179)+_0x5af739['relativePath']+'\x27:'),console[_0x434bf5(0x19a)]('─'[_0x434bf5(0x18e)](0x3c)),console[_0x434bf5(0x19a)](_0x5af739[_0x434bf5(0x1e5)]),console['error']('─'[_0x434bf5(0x18e)](0x3c));}if(_0x3226d0['dryRun'])return console[_0x434bf5(0x19a)](a28_0x1bce51[_0x434bf5(0xf1)](_0x434bf5(0x16d))),0x0;if(_0x5d8a35[_0x434bf5(0x168)]===0x0&&_0x4d33a9['length']===0x0)return console[_0x434bf5(0x19a)](a28_0x1bce51['green'](_0x434bf5(0x164))),saveSessionContext({'parent_segment':_0x3ab39f},_0x3226d0[_0x434bf5(0x1d6)]),console[_0x434bf5(0x19a)](a28_0x1bce51['green'](_0x434bf5(0x138)+a28_0x1bce51[_0x434bf5(0xdc)](_0x434bf5(0x160))+_0x434bf5(0x137)+a28_0x1bce51['cyan'](_0x3ab39f))),0x0;if(!_0x3226d0[_0x434bf5(0xff)]&&(_0x5d8a35['length']>0x0||_0x4d33a9[_0x434bf5(0x168)]>0x0)){if(!isInteractive())return console['error'](a28_0x1bce51['red'](_0x434bf5(0x10e)),_0x434bf5(0x1d1)),console[_0x434bf5(0x19a)](a28_0x1bce51[_0x434bf5(0xdc)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x42dff3=await confirmKey(_0x434bf5(0xe1)+(_0x5d8a35[_0x434bf5(0x168)]+_0x4d33a9['length'])+_0x434bf5(0xfb));if(!_0x42dff3)return console['error'](a28_0x1bce51[_0x434bf5(0xf1)](_0x434bf5(0xe7)),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x3eadde)&&mkdirSync(_0x3eadde,{'recursive':!![]});const _0xa01bd1=a28_0x492a08[_0x434bf5(0xe2)](_0x3eadde,_0x434bf5(0xfa));writeFileSync(_0xa01bd1,createTdxConfigContent(_0x3ab39f),_0x434bf5(0x16a));for(const _0x447a1c of _0x28ca35){(_0x447a1c[_0x434bf5(0x1bc)]||_0x447a1c[_0x434bf5(0x127)])&&writeFileSync(_0x447a1c[_0x434bf5(0xed)],_0x447a1c[_0x434bf5(0x1bf)],'utf-8');}return console['error'](a28_0x1bce51[_0x434bf5(0x17a)](_0x434bf5(0x133)+(_0x5d8a35[_0x434bf5(0x168)]+_0x4d33a9[_0x434bf5(0x168)])+_0x434bf5(0x1bb)+_0x3eadde)),saveSessionContext({'parent_segment':_0x3ab39f},_0x3226d0[_0x434bf5(0x1d6)]),console[_0x434bf5(0x19a)](a28_0x1bce51[_0x434bf5(0x17a)](_0x434bf5(0x138)+a28_0x1bce51['dim'](_0x434bf5(0x160))+_0x434bf5(0x137)+a28_0x1bce51[_0x434bf5(0x16b)](_0x3ab39f))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a28_0x444827(0x11e)]=a28_0x444827(0x1c7);[a28_0x444827(0x13c)]=a28_0x444827(0x1b0);async[a28_0x444827(0xe5)](_0x332054){const _0x12bf12=a28_0x444827,{options:_0xa38946,args:_0x2ee65b,tdx:_0x202e67}=_0x332054,_0x39f3d1=_0x2ee65b[0x0];if(!requireNameOrPath(_0x39f3d1))return 0x1;_0xa38946[_0x12bf12(0x196)]&&console[_0x12bf12(0x19a)](_0x12bf12(0x109)+_0x39f3d1);const {journeyId:_0x467d5c}=await resolveJourneyIdFromInput(_0x39f3d1,_0xa38946,_0x202e67),_0x43396e=await withSpinner(_0x12bf12(0xde),()=>_0x202e67[_0x12bf12(0x130)][_0x12bf12(0x174)](_0x467d5c),{'verbose':_0xa38946[_0x12bf12(0x196)]}),_0xa1dd3f=_0x43396e['data'];return console[_0x12bf12(0x159)](_0x12bf12(0x195)+_0xa1dd3f['database']),console[_0x12bf12(0x159)](_0x12bf12(0x163)+_0xa1dd3f[_0x12bf12(0x171)]),await handleSDKOutput(_0xa1dd3f[_0x12bf12(0x19d)],_0xa38946),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a28_0x444827(0x11e)]='journey:activations';[a28_0x444827(0x13c)]=a28_0x444827(0x177);async[a28_0x444827(0xe5)](_0x297bf8){const _0x2484f1=a28_0x444827,{options:_0x23b3b0,args:_0x3eaf40,tdx:_0x5a7b20}=_0x297bf8,_0xa26169=_0x3eaf40[0x0];if(!requireNameOrPath(_0xa26169))return 0x1;_0x23b3b0[_0x2484f1(0x196)]&&console[_0x2484f1(0x19a)]('Input:\x20'+_0xa26169);const {journeyId:_0x2ad910}=await resolveJourneyIdFromInput(_0xa26169,_0x23b3b0,_0x5a7b20),_0x48d16f=await withSpinner('Listing\x20journey\x20activations...',()=>_0x5a7b20[_0x2484f1(0x130)][_0x2484f1(0x1e4)](_0x2ad910),{'verbose':_0x23b3b0['verbose']}),_0x25dd07=_0x48d16f[_0x2484f1(0x1c0)];return console[_0x2484f1(0x19a)](_0x2484f1(0x139)+_0x25dd07['length']+_0x2484f1(0x184)+(_0x25dd07['length']!==0x1?'s':'')),await handleSDKOutput(_0x25dd07,_0x23b3b0),0x0;}}export class JourneyPushCommand extends BaseCommand{[a28_0x444827(0x11e)]=a28_0x444827(0x1d5);[a28_0x444827(0x13c)]=a28_0x444827(0x1b4);[a28_0x444827(0x116)]=new SegmentPushCommand();async[a28_0x444827(0xe5)](_0x1ec8db){const _0x402898=a28_0x444827,_0xa1cfa1=_0x1ec8db[_0x402898(0x190)][0x0];let _0x5b5121;if(_0xa1cfa1){const _0x19d278=await resolveTarget({'arg':_0xa1cfa1,'contextParent':_0x1ec8db[_0x402898(0x1b9)][_0x402898(0x1db)],'cwd':process[_0x402898(0x16e)]()});isSuccessfulResolution(_0x19d278)&&_0x19d278[_0x402898(0x1c2)]===_0x402898(0x156)&&(_0x5b5121=_0x19d278[_0x402898(0xf6)]);}const _0x26a75a={..._0x1ec8db,'options':{..._0x1ec8db[_0x402898(0x1b9)],'journeysOnly':!![],..._0x5b5121&&{'singleFilePath':_0x5b5121}}};return this[_0x402898(0x116)][_0x402898(0xe5)](_0x26a75a);}}export class JourneyVersionsCommand extends BaseCommand{['name']=a28_0x444827(0xe4);['description']=a28_0x444827(0x19f);async[a28_0x444827(0xe5)](_0x172b99){const _0x5bd694=a28_0x444827,{options:_0x3aa165,args:_0x25e483,tdx:_0x1404b6}=_0x172b99,_0x550477=_0x25e483[0x0];if(!requireNameOrPath(_0x550477))return 0x1;if(_0x3aa165[_0x5bd694(0x196)])console[_0x5bd694(0x19a)](_0x5bd694(0x109)+_0x550477);const {journeyId:_0x3a5bc7}=await resolveJourneyIdFromInput(_0x550477,_0x3aa165,_0x1404b6),_0x34b88f=await withSpinner(_0x5bd694(0x162),()=>_0x1404b6[_0x5bd694(0x130)]['listVersions'](_0x3a5bc7),{'verbose':_0x3aa165['verbose']}),{bundleName:_0x3cc24d,versions:_0x44182b,latestJourneyId:_0x1d33ff}=_0x34b88f[_0x5bd694(0x1c0)];console[_0x5bd694(0x19a)](_0x3cc24d+':\x20'+_0x44182b[_0x5bd694(0x168)]+'\x20version'+(_0x44182b[_0x5bd694(0x168)]!==0x1?'s':''));const _0x1d75dc=_0x44182b[_0x5bd694(0xe6)](_0x3a039f=>({'version':_0x3a039f[_0x5bd694(0xfc)],'journey_id':_0x3a039f[_0x5bd694(0x115)],'name':_0x3a039f[_0x5bd694(0x11e)],'state':_0x3a039f[_0x5bd694(0x1de)],'paused':_0x3a039f[_0x5bd694(0xdd)],'latest':_0x3a039f[_0x5bd694(0x115)]===_0x1d33ff,'created_at':_0x3a039f['createdAt']}));return await handleSDKOutput(_0x1d75dc,_0x3aa165),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a28_0x444827(0x11e)]=a28_0x444827(0xda);['description']=a28_0x444827(0x136);async[a28_0x444827(0xe5)](_0x10763f){const _0x505c6f=a28_0x444827,{options:_0xe72178,args:_0x53f321,tdx:_0x17b344}=_0x10763f,_0x503f0e=_0x53f321[0x0];if(!requireNameOrPath(_0x503f0e))return 0x1;if(_0xe72178[_0x505c6f(0x196)])console['error']('Input:\x20'+_0x503f0e);const {journeyId:_0x2a4ab1,journeyName:_0xdef7e3}=await resolveJourneyIdFromInput(_0x503f0e,_0xe72178,_0x17b344);if(!_0xe72178[_0x505c6f(0xff)]){const _0x37f3a6=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0xdef7e3+'\x22?');if(!_0x37f3a6)return console[_0x505c6f(0x19a)](_0x505c6f(0x152)),0x0;}const _0x1e1d3b=await withSpinner(_0x505c6f(0x155),()=>_0x17b344['journey'][_0x505c6f(0x1ba)](_0x2a4ab1),{'verbose':_0xe72178[_0x505c6f(0x196)]}),_0x50039b=_0x1e1d3b[_0x505c6f(0x1c0)];return console[_0x505c6f(0x19a)](a28_0x1bce51[_0x505c6f(0x17a)]('✔')+_0x505c6f(0x1e3)+_0x50039b[_0x505c6f(0x10f)][_0x505c6f(0xfc)]+_0x505c6f(0x13e)+_0x50039b[_0x505c6f(0x10f)][_0x505c6f(0x11e)]+'\x22'),console[_0x505c6f(0x19a)](_0x505c6f(0x182)+_0x50039b['id']),await handleSingleObjectOutput({'id':_0x50039b['id'],'name':_0x50039b[_0x505c6f(0x10f)][_0x505c6f(0x11e)],'version':_0x50039b[_0x505c6f(0x10f)]['versionNumber'],'state':_0x50039b['attributes']['state'],'bundle_id':_0x50039b[_0x505c6f(0x10f)][_0x505c6f(0x1a0)],'created_at':_0x50039b[_0x505c6f(0x10f)]['createdAt']},_0xe72178),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a28_0x444827(0x11e)]=a28_0x444827(0x131);[a28_0x444827(0x13c)]='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async[a28_0x444827(0xe5)](_0x3ad1d8){const _0x1f628e=a28_0x444827,{options:_0x1cb661,args:_0x4459c4,tdx:_0x1ff0db}=_0x3ad1d8,_0x11b5cc=_0x4459c4[0x0];if(!requireNameOrPath(_0x11b5cc))return 0x1;const _0x474b37=_0x1cb661[_0x1f628e(0x124)];if(!_0x474b37)return console[_0x1f628e(0x19a)](_0x1f628e(0x10d)),console[_0x1f628e(0x19a)](_0x1f628e(0xfd)),0x1;const _0x2695f6=parseInt(_0x474b37,0xa);if(isNaN(_0x2695f6)||_0x2695f6<0x1)return console[_0x1f628e(0x19a)](_0x1f628e(0x185)+_0x474b37),0x1;if(_0x1cb661[_0x1f628e(0x196)])console[_0x1f628e(0x19a)](_0x1f628e(0x109)+_0x11b5cc+_0x1f628e(0x19b)+_0x2695f6);const {journeyId:_0x40785a,parentSegmentId:_0x16a308}=await resolveJourneyIdFromInput(_0x11b5cc,_0x1cb661,_0x1ff0db),_0x468dcf=await withSpinner(_0x1f628e(0x1c1),()=>_0x1ff0db['journey'][_0x1f628e(0x13a)](_0x40785a),{'verbose':_0x1cb661[_0x1f628e(0x196)]}),{versions:_0x2b154b,latestJourneyId:_0x3716b7}=_0x468dcf[_0x1f628e(0x1c0)],_0x5459e3=_0x2b154b[_0x1f628e(0x1d2)](_0x2dc746=>_0x2dc746[_0x1f628e(0xfc)]===_0x2695f6);if(!_0x5459e3){const _0x3b3b1a=_0x2b154b[_0x1f628e(0xe6)](_0xbb380b=>'v'+_0xbb380b[_0x1f628e(0xfc)])[_0x1f628e(0xe2)](',\x20');return console['error'](_0x1f628e(0x112)+_0x2695f6+_0x1f628e(0x1dd)+_0x3b3b1a),0x1;}const _0x5c38f8=await withSpinner(_0x1f628e(0x1b8)+_0x2695f6+_0x1f628e(0x1af),()=>_0x1ff0db[_0x1f628e(0x130)][_0x1f628e(0x113)](_0x5459e3[_0x1f628e(0x115)]),{'verbose':_0x1cb661[_0x1f628e(0x196)]}),_0x1364d4=_0x5c38f8['data'],_0x160367=getConsoleNextUrl(_0x1cb661[_0x1f628e(0x100)],_0x1f628e(0x140)+_0x16a308+_0x1f628e(0x15b)+_0x5459e3[_0x1f628e(0x115)]+_0x1f628e(0x149));return await handleSingleObjectOutput({'id':_0x1364d4['id'],'name':_0x1364d4[_0x1f628e(0x10f)][_0x1f628e(0x11e)],'version':_0x1364d4[_0x1f628e(0x10f)][_0x1f628e(0xfc)],'description':_0x1364d4[_0x1f628e(0x10f)][_0x1f628e(0x13c)],'state':_0x1364d4['attributes'][_0x1f628e(0x1de)],'paused':_0x1364d4[_0x1f628e(0x10f)][_0x1f628e(0xdd)],'reentry_mode':_0x1364d4[_0x1f628e(0x10f)][_0x1f628e(0xf2)],'stages':_0x1364d4[_0x1f628e(0x10f)][_0x1f628e(0x129)]?.[_0x1f628e(0x168)]||0x0,..._0x1364d4[_0x1f628e(0x10f)][_0x1f628e(0x1d3)]&&{'goal':_0x1364d4['attributes']['goal'][_0x1f628e(0x11e)]},'latest':_0x5459e3['journeyId']===_0x3716b7,'created_at':_0x1364d4[_0x1f628e(0x10f)][_0x1f628e(0x1b6)],'updated_at':_0x1364d4[_0x1f628e(0x10f)]['updatedAt'],'url':_0x160367},_0x1cb661),0x0;}}
@@ -1 +1 @@
1
- const a29_0x50cfe4=a29_0x5971;(function(_0x9195e,_0x1eb3b3){const _0x427b04=a29_0x5971,_0x314a5d=_0x9195e();while(!![]){try{const _0x13a9bf=parseInt(_0x427b04(0x13a))/0x1*(-parseInt(_0x427b04(0x142))/0x2)+-parseInt(_0x427b04(0x16e))/0x3+-parseInt(_0x427b04(0x166))/0x4*(-parseInt(_0x427b04(0x144))/0x5)+-parseInt(_0x427b04(0x137))/0x6+parseInt(_0x427b04(0x157))/0x7+-parseInt(_0x427b04(0x156))/0x8*(parseInt(_0x427b04(0x15d))/0x9)+parseInt(_0x427b04(0x13d))/0xa*(parseInt(_0x427b04(0x141))/0xb);if(_0x13a9bf===_0x1eb3b3)break;else _0x314a5d['push'](_0x314a5d['shift']());}catch(_0xa83087){_0x314a5d['push'](_0x314a5d['shift']());}}}(a29_0x6a58,0x29bfe));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a29_0x8e9865 from'chalk';function a29_0x6a58(){const _0x40b282=['description','journey','.yaml','681939ImcadY','cwd','execute','395394tFaCYQ','error','No\x20journey\x20YAML\x20files\x20found\x20in\x20','2UxgURP','.yml','\x20warning(s)\x20found','4603160FHKbmn','warnings','verbose','filePath','11HlSNVI','87404AojtEM','targetDir','40uIbmpT','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','yellow','green','length','Error:\x20Directory\x20not\x20found:\x20','endsWith','valid','Error:\x20','helpText','invalidCount','\x20journey(s)\x20with\x20errors,\x20','\x20valid','\x20error(s)','\x20journey(s)\x20valid','Validate\x20journey\x20YAML\x20files','filter','red','104dHftRe','1318905GfJLkr','errorCode','cyan','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20segment\x20file(s)\x20skipped','log','71721QypOAv','\x20(skipped:\x20','✔\x20All\x20','\x20warning(s)','Validation\x20failed:\x20','warningCount','hasErrors','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','errors','3244WXstDf','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','name','skippedCount','dim'];a29_0x6a58=function(){return _0x40b282;};return a29_0x6a58();}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a29_0x5971(_0x212589,_0x37f6a3){_0x212589=_0x212589-0x137;const _0x6a5820=a29_0x6a58();let _0x597158=_0x6a5820[_0x212589];return _0x597158;}export class JourneyValidateCommand extends BaseCommand{[a29_0x50cfe4(0x168)]='journey:validate';[a29_0x50cfe4(0x16b)]=a29_0x50cfe4(0x153);async[a29_0x50cfe4(0x170)](_0x1737b4){const _0x52cdf5=a29_0x50cfe4,{options:_0x340458,args:_0x1e32da}=_0x1737b4,_0x687734=_0x340458,_0x148a67=await resolveTarget({'arg':_0x1e32da[0x0],'contextParent':_0x340458['parentSegment'],'cwd':process[_0x52cdf5(0x16f)]()});if(!isSuccessfulResolution(_0x148a67))return _0x148a67[_0x52cdf5(0x158)]==='no_parent'?(console[_0x52cdf5(0x138)](a29_0x8e9865['yellow'](_0x52cdf5(0x167))),console['error']('Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x52cdf5(0x138)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console[_0x52cdf5(0x138)](_0x52cdf5(0x145))):(console[_0x52cdf5(0x138)](a29_0x8e9865[_0x52cdf5(0x155)](_0x52cdf5(0x14c)+_0x148a67['message']+'\x0a')),_0x148a67[_0x52cdf5(0x14d)]&&console[_0x52cdf5(0x138)](a29_0x8e9865[_0x52cdf5(0x159)](_0x148a67[_0x52cdf5(0x14d)]))),0x1;const _0x28fc7b=_0x148a67[_0x52cdf5(0x143)],_0x37c0f9=_0x148a67['type']==='file'?_0x148a67[_0x52cdf5(0x140)]:undefined;if(!_0x37c0f9&&!existsSync(_0x28fc7b))return console['error'](a29_0x8e9865[_0x52cdf5(0x155)](_0x52cdf5(0x149)+_0x28fc7b+'\x0a')),0x1;let _0x19d89c;if(_0x37c0f9){if(!_0x37c0f9['endsWith'](_0x52cdf5(0x13b))&&!_0x37c0f9[_0x52cdf5(0x14a)](_0x52cdf5(0x16d)))return console[_0x52cdf5(0x138)](a29_0x8e9865[_0x52cdf5(0x155)](_0x52cdf5(0x15a)+_0x37c0f9+'\x0a')),0x1;_0x19d89c=[_0x37c0f9];}else _0x19d89c=findYamlFiles(_0x28fc7b);if(_0x19d89c[_0x52cdf5(0x148)]===0x0)return console[_0x52cdf5(0x138)](a29_0x8e9865['red'](_0x52cdf5(0x164)+_0x28fc7b+'\x0a')),0x1;const _0x35bb03=validateYamlFiles(_0x19d89c,_0x28fc7b,{'filterType':_0x52cdf5(0x16c)}),_0xe9db6f=calculateSummary(_0x35bb03),_0x25cdf6=_0x35bb03[_0x52cdf5(0x154)](isValidationResult);if(_0x25cdf6['length']===0x0)return console['error'](a29_0x8e9865[_0x52cdf5(0x146)](_0x52cdf5(0x139)+_0x28fc7b+'\x0a')),_0xe9db6f[_0x52cdf5(0x169)]>0x0&&console['error'](a29_0x8e9865[_0x52cdf5(0x16a)]('('+_0xe9db6f[_0x52cdf5(0x169)]+'\x20segment\x20file(s)\x20skipped)')),0x0;for(const _0x1098d2 of _0x35bb03){if(!isValidationResult(_0x1098d2)){_0x687734[_0x52cdf5(0x13f)]&&console[_0x52cdf5(0x15c)](a29_0x8e9865[_0x52cdf5(0x16a)]('-\x20'+_0x1098d2['relativePath']+_0x52cdf5(0x15e)+_0x1098d2['reason']+')'));continue;}const {relativePath:_0x360f8d,source:_0x3af450,result:_0x150633}=_0x1098d2;if(_0x150633[_0x52cdf5(0x14b)]&&_0x150633[_0x52cdf5(0x13e)][_0x52cdf5(0x148)]===0x0)_0x687734['verbose']&&console[_0x52cdf5(0x15c)](a29_0x8e9865[_0x52cdf5(0x147)]('✔\x20'+_0x360f8d));else _0x150633[_0x52cdf5(0x14b)]?(console['log'](a29_0x8e9865['yellow']('⚠\x20'+_0x360f8d+':\x20'+_0x150633['warnings'][_0x52cdf5(0x148)]+_0x52cdf5(0x160))),console[_0x52cdf5(0x15c)](formatValidationResult(_0x150633,_0x3af450,_0x360f8d))):(console['log'](a29_0x8e9865[_0x52cdf5(0x155)]('✖\x20'+_0x360f8d+':\x20'+_0x150633[_0x52cdf5(0x165)][_0x52cdf5(0x148)]+_0x52cdf5(0x151))),console[_0x52cdf5(0x15c)](formatValidationResult(_0x150633,_0x3af450,_0x360f8d)));}return console[_0x52cdf5(0x15c)](''),_0xe9db6f[_0x52cdf5(0x163)]?(console[_0x52cdf5(0x15c)](a29_0x8e9865[_0x52cdf5(0x155)](_0x52cdf5(0x161)+_0xe9db6f[_0x52cdf5(0x14e)]+_0x52cdf5(0x14f)+_0xe9db6f['validCount']+_0x52cdf5(0x150))),_0xe9db6f[_0x52cdf5(0x162)]>0x0&&console[_0x52cdf5(0x15c)](a29_0x8e9865[_0x52cdf5(0x146)](_0xe9db6f[_0x52cdf5(0x162)]+_0x52cdf5(0x13c))),_0xe9db6f['skippedCount']>0x0&&console[_0x52cdf5(0x15c)](a29_0x8e9865[_0x52cdf5(0x16a)](_0xe9db6f[_0x52cdf5(0x169)]+'\x20segment\x20file(s)\x20skipped')),0x1):(console[_0x52cdf5(0x15c)](a29_0x8e9865[_0x52cdf5(0x147)](_0x52cdf5(0x15f)+_0xe9db6f['validCount']+_0x52cdf5(0x152))),_0xe9db6f['warningCount']>0x0&&console[_0x52cdf5(0x15c)](a29_0x8e9865[_0x52cdf5(0x146)](_0xe9db6f[_0x52cdf5(0x162)]+_0x52cdf5(0x13c))),_0xe9db6f[_0x52cdf5(0x169)]>0x0&&console['log'](a29_0x8e9865[_0x52cdf5(0x16a)](_0xe9db6f['skippedCount']+_0x52cdf5(0x15b))),0x0);}}
1
+ function a29_0x3228(_0x16984f,_0xfc310a){_0x16984f=_0x16984f-0x1de;const _0x21625b=a29_0x2162();let _0x322813=_0x21625b[_0x16984f];return _0x322813;}const a29_0x1581b5=a29_0x3228;function a29_0x2162(){const _0xe62534=['verbose','targetDir','error','507180GtREMV','helpText','execute','\x20error(s)','log','4474593aOMqwr','hasErrors','cwd','errorCode','\x20valid','green','skippedCount','no_parent','cyan','relativePath','warnings','Validate\x20journey\x20YAML\x20files','84TKIpja','\x20journey(s)\x20with\x20errors,\x20','.yml','\x20(skipped:\x20','1469010JhQwCp','validCount','Error:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','\x20warning(s)','1258392FePZVu','invalidCount','warningCount','valid','endsWith','2129422YJaMOW','yellow','52fFFAjO','journey:validate','Error:\x20Directory\x20not\x20found:\x20','filePath','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','5863984pOtOgu','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','type','\x20warning(s)\x20found','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','file','.yaml','red','\x20segment\x20file(s)\x20skipped','length','392493CuEsFY','dim'];a29_0x2162=function(){return _0xe62534;};return a29_0x2162();}(function(_0x115425,_0x42adea){const _0x1904ec=a29_0x3228,_0x4b787e=_0x115425();while(!![]){try{const _0x49c8f0=parseInt(_0x1904ec(0x201))/0x1+-parseInt(_0x1904ec(0x20b))/0x2+parseInt(_0x1904ec(0x1e7))/0x3*(parseInt(_0x1904ec(0x20d))/0x4)+-parseInt(_0x1904ec(0x1ec))/0x5*(parseInt(_0x1904ec(0x1fd))/0x6)+parseInt(_0x1904ec(0x212))/0x7+-parseInt(_0x1904ec(0x206))/0x8+-parseInt(_0x1904ec(0x1f1))/0x9;if(_0x49c8f0===_0x42adea)break;else _0x4b787e['push'](_0x4b787e['shift']());}catch(_0xe604bd){_0x4b787e['push'](_0x4b787e['shift']());}}}(a29_0x2162,0xd3f8a));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a29_0x5db17e from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{['name']=a29_0x1581b5(0x20e);['description']=a29_0x1581b5(0x1fc);async[a29_0x1581b5(0x1ee)](_0x206580){const _0x38c59c=a29_0x1581b5,{options:_0x486860,args:_0xc7a0af}=_0x206580,_0x57b7e7=_0x486860,_0x4f9874=await resolveTarget({'arg':_0xc7a0af[0x0],'contextParent':_0x486860['parentSegment'],'cwd':process[_0x38c59c(0x1f3)]()});if(!isSuccessfulResolution(_0x4f9874))return _0x4f9874[_0x38c59c(0x1f4)]===_0x38c59c(0x1f8)?(console[_0x38c59c(0x1eb)](a29_0x5db17e[_0x38c59c(0x20c)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x38c59c(0x1eb)](_0x38c59c(0x1e1)),console[_0x38c59c(0x1eb)](_0x38c59c(0x1de)),console[_0x38c59c(0x1eb)](_0x38c59c(0x204))):(console[_0x38c59c(0x1eb)](a29_0x5db17e[_0x38c59c(0x1e4)](_0x38c59c(0x203)+_0x4f9874['message']+'\x0a')),_0x4f9874['helpText']&&console[_0x38c59c(0x1eb)](a29_0x5db17e[_0x38c59c(0x1f9)](_0x4f9874[_0x38c59c(0x1ed)]))),0x1;const _0x8a62db=_0x4f9874[_0x38c59c(0x1ea)],_0x11ccf6=_0x4f9874[_0x38c59c(0x1df)]===_0x38c59c(0x1e2)?_0x4f9874[_0x38c59c(0x210)]:undefined;if(!_0x11ccf6&&!existsSync(_0x8a62db))return console[_0x38c59c(0x1eb)](a29_0x5db17e[_0x38c59c(0x1e4)](_0x38c59c(0x20f)+_0x8a62db+'\x0a')),0x1;let _0x5284b9;if(_0x11ccf6){if(!_0x11ccf6['endsWith'](_0x38c59c(0x1ff))&&!_0x11ccf6[_0x38c59c(0x20a)](_0x38c59c(0x1e3)))return console[_0x38c59c(0x1eb)](a29_0x5db17e[_0x38c59c(0x1e4)](_0x38c59c(0x211)+_0x11ccf6+'\x0a')),0x1;_0x5284b9=[_0x11ccf6];}else _0x5284b9=findYamlFiles(_0x8a62db);if(_0x5284b9['length']===0x0)return console['error'](a29_0x5db17e[_0x38c59c(0x1e4)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x8a62db+'\x0a')),0x1;const _0x466d9b=validateYamlFiles(_0x5284b9,_0x8a62db,{'filterType':'journey'}),_0x3ac6c6=calculateSummary(_0x466d9b),_0x34c816=_0x466d9b['filter'](isValidationResult);if(_0x34c816['length']===0x0)return console[_0x38c59c(0x1eb)](a29_0x5db17e['yellow']('No\x20journey\x20YAML\x20files\x20found\x20in\x20'+_0x8a62db+'\x0a')),_0x3ac6c6[_0x38c59c(0x1f7)]>0x0&&console['error'](a29_0x5db17e[_0x38c59c(0x1e8)]('('+_0x3ac6c6['skippedCount']+'\x20segment\x20file(s)\x20skipped)')),0x0;for(const _0x51c76f of _0x466d9b){if(!isValidationResult(_0x51c76f)){_0x57b7e7[_0x38c59c(0x1e9)]&&console[_0x38c59c(0x1f0)](a29_0x5db17e['dim']('-\x20'+_0x51c76f[_0x38c59c(0x1fa)]+_0x38c59c(0x200)+_0x51c76f['reason']+')'));continue;}const {relativePath:_0x17d3ce,source:_0x37dcd5,result:_0x25b02d}=_0x51c76f;if(_0x25b02d[_0x38c59c(0x209)]&&_0x25b02d[_0x38c59c(0x1fb)][_0x38c59c(0x1e6)]===0x0)_0x57b7e7[_0x38c59c(0x1e9)]&&console['log'](a29_0x5db17e[_0x38c59c(0x1f6)]('✔\x20'+_0x17d3ce));else _0x25b02d[_0x38c59c(0x209)]?(console['log'](a29_0x5db17e[_0x38c59c(0x20c)]('⚠\x20'+_0x17d3ce+':\x20'+_0x25b02d[_0x38c59c(0x1fb)][_0x38c59c(0x1e6)]+_0x38c59c(0x205))),console[_0x38c59c(0x1f0)](formatValidationResult(_0x25b02d,_0x37dcd5,_0x17d3ce))):(console[_0x38c59c(0x1f0)](a29_0x5db17e[_0x38c59c(0x1e4)]('✖\x20'+_0x17d3ce+':\x20'+_0x25b02d['errors'][_0x38c59c(0x1e6)]+_0x38c59c(0x1ef))),console[_0x38c59c(0x1f0)](formatValidationResult(_0x25b02d,_0x37dcd5,_0x17d3ce)));}return console[_0x38c59c(0x1f0)](''),_0x3ac6c6[_0x38c59c(0x1f2)]?(console[_0x38c59c(0x1f0)](a29_0x5db17e['red']('Validation\x20failed:\x20'+_0x3ac6c6[_0x38c59c(0x207)]+_0x38c59c(0x1fe)+_0x3ac6c6['validCount']+_0x38c59c(0x1f5))),_0x3ac6c6[_0x38c59c(0x208)]>0x0&&console[_0x38c59c(0x1f0)](a29_0x5db17e[_0x38c59c(0x20c)](_0x3ac6c6[_0x38c59c(0x208)]+'\x20warning(s)\x20found')),_0x3ac6c6['skippedCount']>0x0&&console['log'](a29_0x5db17e[_0x38c59c(0x1e8)](_0x3ac6c6[_0x38c59c(0x1f7)]+_0x38c59c(0x1e5))),0x1):(console[_0x38c59c(0x1f0)](a29_0x5db17e[_0x38c59c(0x1f6)]('✔\x20All\x20'+_0x3ac6c6[_0x38c59c(0x202)]+'\x20journey(s)\x20valid')),_0x3ac6c6[_0x38c59c(0x208)]>0x0&&console[_0x38c59c(0x1f0)](a29_0x5db17e[_0x38c59c(0x20c)](_0x3ac6c6[_0x38c59c(0x208)]+_0x38c59c(0x1e0))),_0x3ac6c6[_0x38c59c(0x1f7)]>0x0&&console[_0x38c59c(0x1f0)](a29_0x5db17e[_0x38c59c(0x1e8)](_0x3ac6c6[_0x38c59c(0x1f7)]+_0x38c59c(0x1e5))),0x0);}}