@treasuredata/tdx 2026.3.4 → 2026.3.6

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 (231) 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.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.d.ts.map +1 -1
  12. package/dist/commands/auth-command.js +1 -1
  13. package/dist/commands/auth-command.js.map +1 -1
  14. package/dist/commands/auth-login-command.d.ts +29 -0
  15. package/dist/commands/auth-login-command.d.ts.map +1 -0
  16. package/dist/commands/auth-login-command.js +1 -0
  17. package/dist/commands/auth-login-command.js.map +1 -0
  18. package/dist/commands/chat-command.js +1 -1
  19. package/dist/commands/claude-command.js +1 -1
  20. package/dist/commands/claude-statusline-command.js +1 -1
  21. package/dist/commands/claude-usage-command.js +1 -1
  22. package/dist/commands/command.js +1 -1
  23. package/dist/commands/connection-command.js +1 -1
  24. package/dist/commands/databases.js +1 -1
  25. package/dist/commands/delivery-command.js +1 -1
  26. package/dist/commands/describe.js +1 -1
  27. package/dist/commands/engage-campaign-pull-command.js +1 -1
  28. package/dist/commands/engage-campaign-push-command.js +1 -1
  29. package/dist/commands/engage-campaign-validate-command.js +1 -1
  30. package/dist/commands/engage-command.js +1 -1
  31. package/dist/commands/engage-template-pull-command.js +1 -1
  32. package/dist/commands/engage-template-push-command.js +1 -1
  33. package/dist/commands/engage-template-validate-command.js +1 -1
  34. package/dist/commands/job-command.js +1 -1
  35. package/dist/commands/journey-command.js +1 -1
  36. package/dist/commands/journey-validate-command.js +1 -1
  37. package/dist/commands/llm-command.js +1 -1
  38. package/dist/commands/mcp-command.d.ts.map +1 -1
  39. package/dist/commands/mcp-command.js +1 -1
  40. package/dist/commands/mcp-command.js.map +1 -1
  41. package/dist/commands/parent-segment-command.js +1 -1
  42. package/dist/commands/profile-command.d.ts.map +1 -1
  43. package/dist/commands/profile-command.js +1 -1
  44. package/dist/commands/profile-command.js.map +1 -1
  45. package/dist/commands/profiles-command.js +1 -1
  46. package/dist/commands/query-command.js +1 -1
  47. package/dist/commands/schedule-command.js +1 -1
  48. package/dist/commands/segment-command.js +1 -1
  49. package/dist/commands/segment-create-command.js +1 -1
  50. package/dist/commands/segment-fields-command.js +1 -1
  51. package/dist/commands/segment-pull-command.js +1 -1
  52. package/dist/commands/segment-push-command.js +1 -1
  53. package/dist/commands/segment-update-command.js +1 -1
  54. package/dist/commands/segment-use-command.js +1 -1
  55. package/dist/commands/segment-validate-command.js +1 -1
  56. package/dist/commands/segments.js +1 -1
  57. package/dist/commands/show.js +1 -1
  58. package/dist/commands/status-command.d.ts.map +1 -1
  59. package/dist/commands/status-command.js +1 -1
  60. package/dist/commands/status-command.js.map +1 -1
  61. package/dist/commands/tables.js +1 -1
  62. package/dist/commands/unset-command.js +1 -1
  63. package/dist/commands/upgrade-command.js +1 -1
  64. package/dist/commands/use-command.js +1 -1
  65. package/dist/commands/user-command.js +1 -1
  66. package/dist/commands/workflow-command.js +1 -1
  67. package/dist/core/auth.js +1 -1
  68. package/dist/core/command-output.js +1 -1
  69. package/dist/core/config.js +1 -1
  70. package/dist/core/connection-cache.js +1 -1
  71. package/dist/core/constants.d.ts +11 -0
  72. package/dist/core/constants.d.ts.map +1 -1
  73. package/dist/core/constants.js +1 -1
  74. package/dist/core/constants.js.map +1 -1
  75. package/dist/core/credential-cache.js +1 -1
  76. package/dist/core/global-context.d.ts.map +1 -1
  77. package/dist/core/global-context.js +1 -1
  78. package/dist/core/global-context.js.map +1 -1
  79. package/dist/core/keychain.js +1 -1
  80. package/dist/core/oauth-keychain.d.ts +32 -0
  81. package/dist/core/oauth-keychain.d.ts.map +1 -0
  82. package/dist/core/oauth-keychain.js +1 -0
  83. package/dist/core/oauth-keychain.js.map +1 -0
  84. package/dist/core/oauth.d.ts +112 -0
  85. package/dist/core/oauth.d.ts.map +1 -0
  86. package/dist/core/oauth.js +1 -0
  87. package/dist/core/oauth.js.map +1 -0
  88. package/dist/core/profile.js +1 -1
  89. package/dist/core/project-config.js +1 -1
  90. package/dist/core/session.js +1 -1
  91. package/dist/core/user-cache.js +1 -1
  92. package/dist/core/version.js +1 -1
  93. package/dist/index.js +1 -1
  94. package/dist/mcp/server.js +1 -1
  95. package/dist/mcp/tools/index.js +1 -1
  96. package/dist/mcp/tools/tdx-run.js +1 -1
  97. package/dist/mcp/tools/tdx-search.js +1 -1
  98. package/dist/mcp/utils.js +1 -1
  99. package/dist/proxy/claude-usage-tracker.js +1 -1
  100. package/dist/proxy/passthrough-server.js +1 -1
  101. package/dist/proxy/sse-usage-parser.js +1 -1
  102. package/dist/sdk/agent/agent-config.js +1 -1
  103. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  104. package/dist/sdk/agent/agent-yaml.js +1 -1
  105. package/dist/sdk/agent/test/evaluator.js +1 -1
  106. package/dist/sdk/agent/test/executor.js +1 -1
  107. package/dist/sdk/agent/test/index.js +1 -1
  108. package/dist/sdk/agent/test/output.js +1 -1
  109. package/dist/sdk/agent/test/parser.js +1 -1
  110. package/dist/sdk/agent/tool-target-registry.js +1 -1
  111. package/dist/sdk/api.js +1 -1
  112. package/dist/sdk/client/cdp-api-client.js +1 -1
  113. package/dist/sdk/client/delivery-api-client.js +1 -1
  114. package/dist/sdk/client/endpoints.js +1 -1
  115. package/dist/sdk/client/endpoints.js.map +1 -1
  116. package/dist/sdk/client/engage-api-client.js +1 -1
  117. package/dist/sdk/client/http-client.js +1 -1
  118. package/dist/sdk/client/llm-api-client.js +1 -1
  119. package/dist/sdk/client/oauth-refresh.d.ts +16 -0
  120. package/dist/sdk/client/oauth-refresh.d.ts.map +1 -0
  121. package/dist/sdk/client/oauth-refresh.js +1 -0
  122. package/dist/sdk/client/oauth-refresh.js.map +1 -0
  123. package/dist/sdk/client/rate-limiter.js +1 -1
  124. package/dist/sdk/client/td-api-client.js +1 -1
  125. package/dist/sdk/client/trino-api-client.js +1 -1
  126. package/dist/sdk/client/workflow-client.js +1 -1
  127. package/dist/sdk/connection-validator.js +1 -1
  128. package/dist/sdk/connection.js +1 -1
  129. package/dist/sdk/delivery.js +1 -1
  130. package/dist/sdk/engage/campaign-pull.js +1 -1
  131. package/dist/sdk/engage/campaign-push.js +1 -1
  132. package/dist/sdk/engage/campaign-validator.js +1 -1
  133. package/dist/sdk/engage/campaign-yaml.js +1 -1
  134. package/dist/sdk/engage/template-pull.js +1 -1
  135. package/dist/sdk/engage/template-push.js +1 -1
  136. package/dist/sdk/engage/template-validator.js +1 -1
  137. package/dist/sdk/engage/template-yaml.js +1 -1
  138. package/dist/sdk/engage/types/campaign-def.js +1 -1
  139. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  140. package/dist/sdk/engage/types/template-schema.js +1 -1
  141. package/dist/sdk/engage.js +1 -1
  142. package/dist/sdk/errors.js +1 -1
  143. package/dist/sdk/index.js +1 -1
  144. package/dist/sdk/io/index.js +1 -1
  145. package/dist/sdk/io/node-filesystem.js +1 -1
  146. package/dist/sdk/job.js +1 -1
  147. package/dist/sdk/journey.js +1 -1
  148. package/dist/sdk/llm/chat-cache.js +1 -1
  149. package/dist/sdk/llm/index.js +1 -1
  150. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  151. package/dist/sdk/llm/model-factors.d.ts.map +1 -1
  152. package/dist/sdk/llm/model-factors.js +1 -1
  153. package/dist/sdk/llm/model-factors.js.map +1 -1
  154. package/dist/sdk/personalization.js +1 -1
  155. package/dist/sdk/query/index.js +1 -1
  156. package/dist/sdk/query/sql-parser.js +1 -1
  157. package/dist/sdk/realtime.js +1 -1
  158. package/dist/sdk/schedule.js +1 -1
  159. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  160. package/dist/sdk/segment/fields-display.js +1 -1
  161. package/dist/sdk/segment/file-discovery.js +1 -1
  162. package/dist/sdk/segment/journey-utils.js +1 -1
  163. package/dist/sdk/segment/journey-validator.js +1 -1
  164. package/dist/sdk/segment/journey-yaml.js +1 -1
  165. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  166. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  167. package/dist/sdk/segment/pull-workflow.js +1 -1
  168. package/dist/sdk/segment/push-recovery.js +1 -1
  169. package/dist/sdk/segment/push-workflow.js +1 -1
  170. package/dist/sdk/segment/resolution-context.js +1 -1
  171. package/dist/sdk/segment/segment-path-parser.js +1 -1
  172. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  173. package/dist/sdk/segment/segment-validator.js +1 -1
  174. package/dist/sdk/segment/target-resolution.js +1 -1
  175. package/dist/sdk/segment/tdx-config.js +1 -1
  176. package/dist/sdk/segment/types/activation-schema.js +1 -1
  177. package/dist/sdk/segment/types/journey-def.js +1 -1
  178. package/dist/sdk/segment/types/journey-schema.js +1 -1
  179. package/dist/sdk/segment/types/segment-def.js +1 -1
  180. package/dist/sdk/segment/types/segment-schema.js +1 -1
  181. package/dist/sdk/segment/validate-files.js +1 -1
  182. package/dist/sdk/segment/yaml-validator.js +1 -1
  183. package/dist/sdk/segment.js +1 -1
  184. package/dist/sdk/types/index.js +1 -1
  185. package/dist/sdk/types/progress.js +1 -1
  186. package/dist/sdk/user.js +1 -1
  187. package/dist/sdk/util/format-detector.js +1 -1
  188. package/dist/sdk/util/formatters.js +1 -1
  189. package/dist/sdk/util/index.js +1 -1
  190. package/dist/sdk/util/paginate.js +1 -1
  191. package/dist/sdk/util/tree-formatter.js +1 -1
  192. package/dist/sdk/workflow/archive-validation.js +1 -1
  193. package/dist/sdk/workflow/clone-workflow.js +1 -1
  194. package/dist/sdk/workflow/index.js +1 -1
  195. package/dist/sdk/workflow/pull-workflow.js +1 -1
  196. package/dist/sdk/workflow/push-workflow.js +1 -1
  197. package/dist/sdk/workflow/tdx-config.js +1 -1
  198. package/dist/sdk/workflow/workflow-utils.js +1 -1
  199. package/dist/test-utils/command-runner.js +1 -1
  200. package/dist/test-utils/factories.js +1 -1
  201. package/dist/test-utils/fixtures.js +1 -1
  202. package/dist/test-utils/http-mock.js +1 -1
  203. package/dist/test-utils/index.js +1 -1
  204. package/dist/utils/async.js +1 -1
  205. package/dist/utils/colors.js +1 -1
  206. package/dist/utils/diff.js +1 -1
  207. package/dist/utils/file-permissions.js +1 -1
  208. package/dist/utils/file-reader.js +1 -1
  209. package/dist/utils/github-releases.js +1 -1
  210. package/dist/utils/global-cache.js +1 -1
  211. package/dist/utils/json-loader.js +1 -1
  212. package/dist/utils/local-cache.js +1 -1
  213. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  214. package/dist/utils/logger/formatters/index.js +1 -1
  215. package/dist/utils/logger/handlers/console-handler.js +1 -1
  216. package/dist/utils/logger/handlers/file-handler.js +1 -1
  217. package/dist/utils/logger/handlers/index.js +1 -1
  218. package/dist/utils/logger/handlers/null-handler.js +1 -1
  219. package/dist/utils/logger/index.js +1 -1
  220. package/dist/utils/logger/logger.js +1 -1
  221. package/dist/utils/logger/types.js +1 -1
  222. package/dist/utils/option-validation.js +1 -1
  223. package/dist/utils/process.js +1 -1
  224. package/dist/utils/prompt.js +1 -1
  225. package/dist/utils/spinner.js +1 -1
  226. package/dist/utils/sse-parser.js +1 -1
  227. package/dist/utils/string-utils.js +1 -1
  228. package/dist/utils/table-ref-parser.js +1 -1
  229. package/dist/utils/tdx-logger.js +1 -1
  230. package/dist/utils/version-check.js +1 -1
  231. package/package.json +1 -1
@@ -1 +1 @@
1
- const a24_0x19fa20=a24_0xb1f6;(function(_0x185b5a,_0x344b43){const _0x205839=a24_0xb1f6,_0x113507=_0x185b5a();while(!![]){try{const _0x45bddf=parseInt(_0x205839(0x117))/0x1+-parseInt(_0x205839(0xe5))/0x2*(parseInt(_0x205839(0xd6))/0x3)+-parseInt(_0x205839(0xe2))/0x4*(parseInt(_0x205839(0xf8))/0x5)+parseInt(_0x205839(0xff))/0x6*(parseInt(_0x205839(0xee))/0x7)+-parseInt(_0x205839(0xf3))/0x8+-parseInt(_0x205839(0xca))/0x9+parseInt(_0x205839(0x103))/0xa*(parseInt(_0x205839(0xc0))/0xb);if(_0x45bddf===_0x344b43)break;else _0x113507['push'](_0x113507['shift']());}catch(_0x355d5d){_0x113507['push'](_0x113507['shift']());}}}(a24_0x4932,0xf1b3e));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';function a24_0xb1f6(_0x1263bc,_0x5e4214){_0x1263bc=_0x1263bc-0xc0;const _0x49323e=a24_0x4932();let _0xb1f6aa=_0x49323e[_0x1263bc];return _0xb1f6aa;}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 a24_0x4038fd from'chalk';function a24_0x4932(){const _0x446611=['status','args','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','d\x20ago','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','error','verbose','trino','yes','kill','m\x20ago','now','push','debug','\x20\x20Job\x20ID:\x20','Show\x20job\x20details','Getting\x20job\x20details...','1201882dEuESw','priority','execute','name','floor','job:show','374PkXtPm','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','length','hive','✔\x20Found\x20','limit','map','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','information_schema','result','7020333xzexRs','presto','log','url','job_id','getTime','created_at','\x27\x20to\x20verify\x20the\x20job\x20status','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','round','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','data','1551387OqeVNj','Submit\x20a\x20job','\x20jobs','abs','red','just\x20now','query','jobs','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','Cancelled','user_name','Submitting\x20job...','474604cRyzac','Get\x20job\x20results','job:submit','2ULQuzE','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','INVALID_ARGUMENT','Getting\x20job\x20results...','success','end_at','...','jobType','\x20job','7YTVOnL','start_at','job:result','Job\x20type:\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','14366008ARcsEx','\x20row','Listing\x20jobs...','✔\x20Retrieved\x20','description','10AdcDBb','green','file','type','database','validate','site','8700642CqeZpJ','list','Query:\x20','show','490660vGZySp','No\x20SQL\x20statements\x20found\x20in\x20file','dim'];a24_0x4932=function(){return _0x446611;};return a24_0x4932();}function formatDuration(_0x391569){const _0x3b745e=a24_0xb1f6;if(_0x391569<0x3c)return _0x391569+'s';if(_0x391569<0xe10)return Math[_0x3b745e(0x11b)](_0x391569/0x3c)+'m\x20'+_0x391569%0x3c+'s';const _0x3b1fc5=Math['floor'](_0x391569/0xe10),_0x24ff56=Math['floor'](_0x391569%0xe10/0x3c);return _0x24ff56>0x0?_0x3b1fc5+'h\x20'+_0x24ff56+'m':_0x3b1fc5+'h';}function formatRelativeTime(_0xb2139a){const _0x4e529b=a24_0xb1f6,_0x45e07e=Date[_0x4e529b(0x111)]()-_0xb2139a['getTime'](),_0x60238c=Math[_0x4e529b(0x11b)](Math[_0x4e529b(0xd9)](_0x45e07e)/0x3e8);if(_0x60238c<0x3c)return _0x4e529b(0xdb);const _0x1fd3f6=Math['floor'](_0x60238c/0x3c);if(_0x1fd3f6<0x3c)return _0x1fd3f6+_0x4e529b(0x110);const _0x1dbd79=Math[_0x4e529b(0x11b)](_0x1fd3f6/0x3c);if(_0x1dbd79<0x18)return _0x1dbd79+'h\x20ago';const _0x162a71=Math[_0x4e529b(0x11b)](_0x1dbd79/0x18);if(_0x162a71<0x1e)return _0x162a71+_0x4e529b(0x109);return Math[_0x4e529b(0x11b)](_0x162a71/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{[a24_0x19fa20(0x11a)]=a24_0x19fa20(0xdd);['description']='List\x20jobs';async[a24_0x19fa20(0x119)](_0x511193){const _0x5be2a0=a24_0x19fa20,{options:_0x54ecdc,tdx:_0x2060b6}=_0x511193,_0x19085c=resolveLimit(_0x54ecdc[_0x5be2a0(0xc5)],DEFAULT_DISPLAY_LIMIT),_0x173ef1=_0x54ecdc[_0x5be2a0(0x106)];_0x54ecdc[_0x5be2a0(0x10c)]&&(console[_0x5be2a0(0x10b)]('Limit:\x20'+_0x19085c+_0x5be2a0(0xd8)),_0x173ef1&&console['error']('Status\x20filter:\x20'+_0x173ef1));const _0x3e2dc9=await withSpinner(_0x5be2a0(0xf5),()=>_0x2060b6[_0x5be2a0(0xdd)][_0x5be2a0(0x100)]({'from':0x0,'to':_0x19085c-0x1,'status':_0x173ef1}),{'verbose':_0x54ecdc['verbose']}),_0x1249b4=_0x3e2dc9[_0x5be2a0(0xd5)];console[_0x5be2a0(0x10b)](_0x5be2a0(0xc4)+_0x1249b4[_0x5be2a0(0xc2)]+_0x5be2a0(0xed)+(_0x1249b4['length']!==0x1?'s':''));const _0x2e5943=_0x54ecdc[_0x5be2a0(0xfe)];if(isStructuredFormat(_0x54ecdc)){const _0xabe504=_0x1249b4[_0x5be2a0(0xc6)](_0x3fa20e=>{const _0x46d8a4=_0x5be2a0;let _0x2dfd91;if(_0x3fa20e['start_at']&&_0x3fa20e[_0x46d8a4(0xea)]){const _0xd4bca1=new Date(_0x3fa20e[_0x46d8a4(0xef)])[_0x46d8a4(0xcf)](),_0x24e1e7=new Date(_0x3fa20e[_0x46d8a4(0xea)])[_0x46d8a4(0xcf)]();_0x2dfd91=Math[_0x46d8a4(0xd3)]((_0x24e1e7-_0xd4bca1)/0x3e8);}return{'job_id':_0x3fa20e['job_id'],'type':_0x3fa20e[_0x46d8a4(0xfb)]===_0x46d8a4(0xcb)?_0x46d8a4(0x10d):_0x3fa20e[_0x46d8a4(0xfb)],'status':_0x3fa20e[_0x46d8a4(0x106)],'user_name':_0x3fa20e[_0x46d8a4(0xe0)],'duration_sec':_0x2dfd91,'created_at':_0x3fa20e[_0x46d8a4(0xd0)],'started_at':_0x3fa20e[_0x46d8a4(0xef)],'end_at':_0x3fa20e[_0x46d8a4(0xea)]};});await handleSDKOutput(_0xabe504,_0x54ecdc);}else for(const _0x584138 of _0x1249b4){const _0x3f9ea3=_0x584138[_0x5be2a0(0x106)]===_0x5be2a0(0xe9)?a24_0x4038fd[_0x5be2a0(0xf9)]:_0x584138[_0x5be2a0(0x106)]===_0x5be2a0(0x10b)?a24_0x4038fd[_0x5be2a0(0xda)]:a24_0x4038fd[_0x5be2a0(0x105)],_0x5bc05c=_0x3f9ea3(_0x584138[_0x5be2a0(0x106)]),_0xd70110=getJobUrl(_0x2e5943,_0x584138[_0x5be2a0(0xce)]),_0x4ded72=hyperlink(_0x584138[_0x5be2a0(0xce)],_0xd70110),_0x2dd19c=a24_0x4038fd[_0x5be2a0(0x105)](_0x584138[_0x5be2a0(0xfb)]===_0x5be2a0(0xcb)?'trino':_0x584138['type']),_0x209af4=[];if(_0x584138[_0x5be2a0(0xef)]&&_0x584138[_0x5be2a0(0xea)]){const _0x560ca4=Math[_0x5be2a0(0xd3)]((new Date(_0x584138[_0x5be2a0(0xea)])['getTime']()-new Date(_0x584138[_0x5be2a0(0xef)])[_0x5be2a0(0xcf)]())/0x3e8);_0x209af4[_0x5be2a0(0x112)](formatDuration(_0x560ca4));}if(_0x584138[_0x5be2a0(0xea)])_0x209af4[_0x5be2a0(0x112)](formatRelativeTime(new Date(_0x584138[_0x5be2a0(0xea)])));else _0x584138[_0x5be2a0(0xef)]&&_0x209af4[_0x5be2a0(0x112)](formatRelativeTime(new Date(_0x584138['start_at'])));const _0x3efa1d=_0x209af4['length']>0x0?a24_0x4038fd[_0x5be2a0(0x105)]('\x20'+_0x209af4['join'](',\x20')):'';console[_0x5be2a0(0xcc)]('⚡\x20'+_0x4ded72+'\x20'+_0x2dd19c+'\x20'+_0x5bc05c+_0x3efa1d);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']=a24_0x19fa20(0x11c);[a24_0x19fa20(0xf7)]=a24_0x19fa20(0x115);[a24_0x19fa20(0xfd)](_0x1c21b2){const _0x4f5206=a24_0x19fa20,_0x3396c8=_0x1c21b2['args'][0x0];if(!_0x3396c8)return _0x4f5206(0xc1);return undefined;}async[a24_0x19fa20(0x119)](_0x25cf29){const _0x51d07c=a24_0x19fa20,{options:_0x3e0302,args:_0x1c4596,tdx:_0x511484}=_0x25cf29,_0x1bb3e7=_0x1c4596[0x0],_0x4c9014=await withSpinner(_0x51d07c(0x116),()=>_0x511484[_0x51d07c(0xdd)][_0x51d07c(0x102)](_0x1bb3e7),{'verbose':_0x3e0302[_0x51d07c(0x10c)]}),_0x824360=_0x4c9014[_0x51d07c(0xd5)];let _0x40dda1;if(_0x824360[_0x51d07c(0xef)]&&_0x824360[_0x51d07c(0xea)]){const _0x3ee1d2=new Date(_0x824360['start_at'])[_0x51d07c(0xcf)](),_0x21a40b=new Date(_0x824360[_0x51d07c(0xea)])[_0x51d07c(0xcf)]();_0x40dda1=Math[_0x51d07c(0xd3)]((_0x21a40b-_0x3ee1d2)/0x3e8);}const _0x2f4c2a={'job_id':_0x824360[_0x51d07c(0xce)],'type':_0x824360[_0x51d07c(0xfb)],'status':_0x824360[_0x51d07c(0x106)],..._0x824360[_0x51d07c(0xe0)]&&{'user_name':_0x824360[_0x51d07c(0xe0)]},..._0x40dda1!==undefined&&{'duration_sec':_0x40dda1},..._0x824360[_0x51d07c(0xd0)]&&{'created_at':_0x824360[_0x51d07c(0xd0)]},..._0x824360[_0x51d07c(0xef)]&&{'started_at':_0x824360[_0x51d07c(0xef)]},..._0x824360[_0x51d07c(0xea)]&&{'end_at':_0x824360[_0x51d07c(0xea)]},..._0x824360[_0x51d07c(0xfc)]&&{'database':_0x824360['database']},..._0x824360[_0x51d07c(0x118)]!==undefined&&{'priority':_0x824360[_0x51d07c(0x118)]},..._0x824360[_0x51d07c(0xcd)]&&{'url':_0x824360['url']},..._0x824360['query']&&{'query':_0x824360[_0x51d07c(0xdc)]},..._0x824360[_0x51d07c(0x113)]&&{'debug':_0x824360[_0x51d07c(0x113)]}};return await handleSingleObjectOutput(_0x2f4c2a,_0x3e0302),0x0;}}export class JobKillCommand extends BaseCommand{[a24_0x19fa20(0x11a)]='job:kill';[a24_0x19fa20(0xf7)]='Kill\x20a\x20job';[a24_0x19fa20(0xfd)](_0x198ea1){const _0xdcc4c9=a24_0x19fa20,_0x48be8b=_0x198ea1[_0xdcc4c9(0x107)][0x0];if(!_0x48be8b)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>';return undefined;}async[a24_0x19fa20(0x119)](_0x22e3f6){const _0x14dd89=a24_0x19fa20,{options:_0x4d91c6,args:_0x41e03f,tdx:_0x3af05f}=_0x22e3f6,_0x1449be=_0x41e03f[0x0];if(!_0x4d91c6[_0x14dd89(0x10e)]){const _0x80bc2f=await confirm(_0x14dd89(0xd2)+_0x1449be+'?');if(!_0x80bc2f)return console[_0x14dd89(0x10b)](_0x14dd89(0xdf)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x3af05f[_0x14dd89(0xdd)][_0x14dd89(0x10f)](_0x1449be),{'verbose':_0x4d91c6['verbose']}),console[_0x14dd89(0x10b)](_0x14dd89(0xd4)+_0x1449be),console[_0x14dd89(0x10b)](_0x14dd89(0x10a)+_0x1449be+_0x14dd89(0xd1)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a24_0x19fa20(0x11a)]=a24_0x19fa20(0xe4);[a24_0x19fa20(0xf7)]=a24_0x19fa20(0xd7);async[a24_0x19fa20(0x119)](_0x245299){const _0x586ed4=a24_0x19fa20,{options:_0x22fc5a,args:_0x2c1e8d,tdx:_0x50bc3d}=_0x245299,_0x3eed62=_0x22fc5a[_0x586ed4(0xec)]||'trino',_0xdad251=_0x22fc5a[_0x586ed4(0xfa)],_0x3ea7c3=_0x22fc5a[_0x586ed4(0xfc)]||_0x586ed4(0xc8),_0x3c257a=_0x22fc5a[_0x586ed4(0xc9)];if(_0x3eed62!==_0x586ed4(0x10d)&&_0x3eed62!==_0x586ed4(0xc3))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x586ed4(0xc7));let _0x59e83a;if(_0xdad251){if(_0x2c1e8d[0x0])throw new SDKError(ErrorCode[_0x586ed4(0xe7)],_0x586ed4(0xde));const _0x207c8b=readSqlStatementsFromFile(_0xdad251);if(_0x207c8b['length']===0x0)throw new SDKError(ErrorCode[_0x586ed4(0xe7)],_0x586ed4(0x104));if(_0x207c8b['length']>0x1)throw new SDKError(ErrorCode[_0x586ed4(0xe7)],_0x586ed4(0x108));_0x59e83a=_0x207c8b[0x0];}else{if(!_0x2c1e8d[0x0])throw new SDKError(ErrorCode[_0x586ed4(0xe7)],_0x586ed4(0xe6));_0x59e83a=_0x2c1e8d[0x0];}_0x22fc5a[_0x586ed4(0x10c)]&&(console[_0x586ed4(0x10b)](_0x586ed4(0xf1)+_0x3eed62),console[_0x586ed4(0x10b)]('Database:\x20'+_0x3ea7c3),console['error'](_0x586ed4(0x101)+_0x59e83a['substring'](0x0,0x64)+(_0x59e83a[_0x586ed4(0xc2)]>0x64?_0x586ed4(0xeb):'')));const _0x68474d=await withSpinner(_0x586ed4(0xe1),()=>_0x50bc3d[_0x586ed4(0xdd)]['submit'](_0x3ea7c3,_0x59e83a,_0x3eed62,_0x3c257a),{'verbose':_0x22fc5a[_0x586ed4(0x10c)]}),_0x473cbb=_0x68474d['data'];return console[_0x586ed4(0x10b)]('✔\x20Job\x20submitted'),console[_0x586ed4(0x10b)](_0x586ed4(0x114)+_0x473cbb[_0x586ed4(0xce)]),await handleSDKOutput([_0x473cbb],_0x22fc5a),0x0;}}export class JobResultCommand extends BaseCommand{[a24_0x19fa20(0x11a)]=a24_0x19fa20(0xf0);[a24_0x19fa20(0xf7)]=a24_0x19fa20(0xe3);[a24_0x19fa20(0xfd)](_0x48bd81){const _0x4c12bf=a24_0x19fa20,_0x264998=_0x48bd81[_0x4c12bf(0x107)][0x0];if(!_0x264998)return _0x4c12bf(0xf2);return undefined;}async[a24_0x19fa20(0x119)](_0x416a31){const _0x90f5c5=a24_0x19fa20,{options:_0x1f9ece,args:_0x1330fb,tdx:_0x1c4be8}=_0x416a31,_0x581416=_0x1330fb[0x0],_0x200465=await withSpinner(_0x90f5c5(0xe8),()=>_0x1c4be8['jobs'][_0x90f5c5(0xc9)](_0x581416),{'verbose':_0x1f9ece['verbose']}),_0x2c591d=_0x200465[_0x90f5c5(0xd5)];return console[_0x90f5c5(0x10b)](_0x90f5c5(0xf6)+_0x2c591d[_0x90f5c5(0xc2)]+_0x90f5c5(0xf4)+(_0x2c591d['length']!==0x1?'s':'')),await handleSDKOutput(_0x2c591d,_0x1f9ece),0x0;}}
1
+ function a25_0x4c82(_0x19b602,_0x59ed91){_0x19b602=_0x19b602-0xd8;const _0x4ca130=a25_0x4ca1();let _0x4c827b=_0x4ca130[_0x19b602];return _0x4c827b;}const a25_0x12cf62=a25_0x4c82;(function(_0x4bb757,_0x3f9161){const _0x3d28dc=a25_0x4c82,_0x1b593c=_0x4bb757();while(!![]){try{const _0x15a92e=parseInt(_0x3d28dc(0x125))/0x1*(-parseInt(_0x3d28dc(0x114))/0x2)+parseInt(_0x3d28dc(0xf8))/0x3*(parseInt(_0x3d28dc(0xff))/0x4)+parseInt(_0x3d28dc(0x10f))/0x5+parseInt(_0x3d28dc(0x111))/0x6+parseInt(_0x3d28dc(0x117))/0x7*(-parseInt(_0x3d28dc(0xf1))/0x8)+parseInt(_0x3d28dc(0x11b))/0x9+-parseInt(_0x3d28dc(0x104))/0xa*(parseInt(_0x3d28dc(0x126))/0xb);if(_0x15a92e===_0x3f9161)break;else _0x1b593c['push'](_0x1b593c['shift']());}catch(_0x524795){_0x1b593c['push'](_0x1b593c['shift']());}}}(a25_0x4ca1,0x42f8f));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';import a25_0x3ffe73 from'chalk';function formatDuration(_0x5ef297){const _0xafeba9=a25_0x4c82;if(_0x5ef297<0x3c)return _0x5ef297+'s';if(_0x5ef297<0xe10)return Math[_0xafeba9(0x112)](_0x5ef297/0x3c)+'m\x20'+_0x5ef297%0x3c+'s';const _0x328add=Math['floor'](_0x5ef297/0xe10),_0x6ea24d=Math[_0xafeba9(0x112)](_0x5ef297%0xe10/0x3c);return _0x6ea24d>0x0?_0x328add+'h\x20'+_0x6ea24d+'m':_0x328add+'h';}function formatRelativeTime(_0x36bac2){const _0x4a44ed=a25_0x4c82,_0x40f91a=Date['now']()-_0x36bac2[_0x4a44ed(0x10e)](),_0x22f6de=Math[_0x4a44ed(0x112)](Math[_0x4a44ed(0x123)](_0x40f91a)/0x3e8);if(_0x22f6de<0x3c)return _0x4a44ed(0x12c);const _0xae4875=Math[_0x4a44ed(0x112)](_0x22f6de/0x3c);if(_0xae4875<0x3c)return _0xae4875+_0x4a44ed(0xe8);const _0x233c7d=Math[_0x4a44ed(0x112)](_0xae4875/0x3c);if(_0x233c7d<0x18)return _0x233c7d+_0x4a44ed(0xe2);const _0x39fdd4=Math[_0x4a44ed(0x112)](_0x233c7d/0x18);if(_0x39fdd4<0x1e)return _0x39fdd4+'d\x20ago';return Math[_0x4a44ed(0x112)](_0x39fdd4/0x1e)+_0x4a44ed(0x102);}function a25_0x4ca1(){const _0x30c7b0=['created_at','190238EIwBfi','List\x20jobs','show','14zBdNok','\x20job','trino','Get\x20job\x20results','4815171UkTqRb','\x20row','round','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','Job\x20type:\x20','Cancelled','Database:\x20','job_id','abs','join','5uHOung','195239BNhLRu','data','job:result','Status\x20filter:\x20','description','kill','just\x20now','length','Submit\x20a\x20job','execute','verbose','Kill\x20a\x20job','\x20jobs','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','presto','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','jobs','url','h\x20ago','\x27\x20to\x20verify\x20the\x20job\x20status','name','user_name','status','result','m\x20ago','args','✔\x20Retrieved\x20','✔\x20Job\x20submitted','start_at','Submitting\x20kill\x20request...','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','error','list','629544xfjWre','Listing\x20jobs...','validate','hive','Limit:\x20','INVALID_ARGUMENT','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','28278RMHFml','log','\x20\x20Job\x20ID:\x20','information_schema','dim','site','debug','68fCxUcx','No\x20SQL\x20statements\x20found\x20in\x20file','jobType','mo\x20ago','Submitting\x20job...','170CUfiqc','Getting\x20job\x20results...','query','database','submit','end_at','Getting\x20job\x20details...','limit','type','job:show','getTime','1507120KiCNop','push','1274088MHpZcr','floor'];a25_0x4ca1=function(){return _0x30c7b0;};return a25_0x4ca1();}export class JobListCommand extends BaseCommand{[a25_0x12cf62(0xe4)]=a25_0x12cf62(0xe0);['description']=a25_0x12cf62(0x115);async[a25_0x12cf62(0xd9)](_0x12f9a4){const _0x35ef7b=a25_0x12cf62,{options:_0x3acbc0,tdx:_0x5f168e}=_0x12f9a4,_0x22f74e=resolveLimit(_0x3acbc0[_0x35ef7b(0x10b)],DEFAULT_DISPLAY_LIMIT),_0x2a1564=_0x3acbc0[_0x35ef7b(0xe6)];_0x3acbc0[_0x35ef7b(0xda)]&&(console[_0x35ef7b(0xef)](_0x35ef7b(0xf5)+_0x22f74e+_0x35ef7b(0xdc)),_0x2a1564&&console[_0x35ef7b(0xef)](_0x35ef7b(0x129)+_0x2a1564));const _0x47dd40=await withSpinner(_0x35ef7b(0xf2),()=>_0x5f168e['jobs'][_0x35ef7b(0xf0)]({'from':0x0,'to':_0x22f74e-0x1,'status':_0x2a1564}),{'verbose':_0x3acbc0[_0x35ef7b(0xda)]}),_0x3d64b3=_0x47dd40[_0x35ef7b(0x127)];console[_0x35ef7b(0xef)]('✔\x20Found\x20'+_0x3d64b3['length']+_0x35ef7b(0x118)+(_0x3d64b3['length']!==0x1?'s':''));const _0x4b7dbe=_0x3acbc0[_0x35ef7b(0xfd)];if(isStructuredFormat(_0x3acbc0)){const _0x3ba6d7=_0x3d64b3['map'](_0x34f46a=>{const _0x142eae=_0x35ef7b;let _0x9087e7;if(_0x34f46a['start_at']&&_0x34f46a[_0x142eae(0x109)]){const _0x32d2ee=new Date(_0x34f46a[_0x142eae(0xec)])[_0x142eae(0x10e)](),_0x1bd3fc=new Date(_0x34f46a[_0x142eae(0x109)])[_0x142eae(0x10e)]();_0x9087e7=Math['round']((_0x1bd3fc-_0x32d2ee)/0x3e8);}return{'job_id':_0x34f46a[_0x142eae(0x122)],'type':_0x34f46a[_0x142eae(0x10c)]===_0x142eae(0xde)?'trino':_0x34f46a[_0x142eae(0x10c)],'status':_0x34f46a[_0x142eae(0xe6)],'user_name':_0x34f46a[_0x142eae(0xe5)],'duration_sec':_0x9087e7,'created_at':_0x34f46a['created_at'],'started_at':_0x34f46a[_0x142eae(0xec)],'end_at':_0x34f46a[_0x142eae(0x109)]};});await handleSDKOutput(_0x3ba6d7,_0x3acbc0);}else for(const _0x53e5f7 of _0x3d64b3){const _0x46a40e=_0x53e5f7[_0x35ef7b(0xe6)]==='success'?a25_0x3ffe73['green']:_0x53e5f7[_0x35ef7b(0xe6)]===_0x35ef7b(0xef)?a25_0x3ffe73['red']:a25_0x3ffe73[_0x35ef7b(0xfc)],_0x7834b8=_0x46a40e(_0x53e5f7['status']),_0xf7dac5=getJobUrl(_0x4b7dbe,_0x53e5f7[_0x35ef7b(0x122)]),_0x244cf4=hyperlink(_0x53e5f7[_0x35ef7b(0x122)],_0xf7dac5),_0x12125d=a25_0x3ffe73['dim'](_0x53e5f7[_0x35ef7b(0x10c)]==='presto'?'trino':_0x53e5f7[_0x35ef7b(0x10c)]),_0x20ffe1=[];if(_0x53e5f7[_0x35ef7b(0xec)]&&_0x53e5f7[_0x35ef7b(0x109)]){const _0x3cd7be=Math['round']((new Date(_0x53e5f7[_0x35ef7b(0x109)])[_0x35ef7b(0x10e)]()-new Date(_0x53e5f7['start_at'])[_0x35ef7b(0x10e)]())/0x3e8);_0x20ffe1['push'](formatDuration(_0x3cd7be));}if(_0x53e5f7['end_at'])_0x20ffe1[_0x35ef7b(0x110)](formatRelativeTime(new Date(_0x53e5f7['end_at'])));else _0x53e5f7[_0x35ef7b(0xec)]&&_0x20ffe1[_0x35ef7b(0x110)](formatRelativeTime(new Date(_0x53e5f7[_0x35ef7b(0xec)])));const _0x6326b2=_0x20ffe1[_0x35ef7b(0x12d)]>0x0?a25_0x3ffe73[_0x35ef7b(0xfc)]('\x20'+_0x20ffe1[_0x35ef7b(0x124)](',\x20')):'';console[_0x35ef7b(0xf9)]('⚡\x20'+_0x244cf4+'\x20'+_0x12125d+'\x20'+_0x7834b8+_0x6326b2);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a25_0x12cf62(0xe4)]=a25_0x12cf62(0x10d);[a25_0x12cf62(0x12a)]='Show\x20job\x20details';[a25_0x12cf62(0xf3)](_0x2ebe02){const _0x5016eb=_0x2ebe02['args'][0x0];if(!_0x5016eb)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>';return undefined;}async[a25_0x12cf62(0xd9)](_0x144484){const _0x348598=a25_0x12cf62,{options:_0x1c35c5,args:_0x4b3d6e,tdx:_0x363fa7}=_0x144484,_0x390e04=_0x4b3d6e[0x0],_0x3eb659=await withSpinner(_0x348598(0x10a),()=>_0x363fa7['jobs'][_0x348598(0x116)](_0x390e04),{'verbose':_0x1c35c5[_0x348598(0xda)]}),_0x472e27=_0x3eb659[_0x348598(0x127)];let _0x539223;if(_0x472e27[_0x348598(0xec)]&&_0x472e27[_0x348598(0x109)]){const _0xe19366=new Date(_0x472e27[_0x348598(0xec)])[_0x348598(0x10e)](),_0x1a965e=new Date(_0x472e27[_0x348598(0x109)])[_0x348598(0x10e)]();_0x539223=Math[_0x348598(0x11d)]((_0x1a965e-_0xe19366)/0x3e8);}const _0x580b05={'job_id':_0x472e27[_0x348598(0x122)],'type':_0x472e27[_0x348598(0x10c)],'status':_0x472e27[_0x348598(0xe6)],..._0x472e27[_0x348598(0xe5)]&&{'user_name':_0x472e27[_0x348598(0xe5)]},..._0x539223!==undefined&&{'duration_sec':_0x539223},..._0x472e27[_0x348598(0x113)]&&{'created_at':_0x472e27['created_at']},..._0x472e27[_0x348598(0xec)]&&{'started_at':_0x472e27[_0x348598(0xec)]},..._0x472e27['end_at']&&{'end_at':_0x472e27[_0x348598(0x109)]},..._0x472e27[_0x348598(0x107)]&&{'database':_0x472e27[_0x348598(0x107)]},..._0x472e27['priority']!==undefined&&{'priority':_0x472e27['priority']},..._0x472e27['url']&&{'url':_0x472e27[_0x348598(0xe1)]},..._0x472e27[_0x348598(0x106)]&&{'query':_0x472e27[_0x348598(0x106)]},..._0x472e27[_0x348598(0xfe)]&&{'debug':_0x472e27['debug']}};return await handleSingleObjectOutput(_0x580b05,_0x1c35c5),0x0;}}export class JobKillCommand extends BaseCommand{['name']='job:kill';['description']=a25_0x12cf62(0xdb);[a25_0x12cf62(0xf3)](_0x33d1e3){const _0x3d219f=a25_0x12cf62,_0x24713d=_0x33d1e3[_0x3d219f(0xe9)][0x0];if(!_0x24713d)return _0x3d219f(0x11e);return undefined;}async['execute'](_0xdee40b){const _0x24cde3=a25_0x12cf62,{options:_0x4cd6f5,args:_0x4d1941,tdx:_0x3f3b33}=_0xdee40b,_0x2d7878=_0x4d1941[0x0];if(!_0x4cd6f5['yes']){const _0x1383cb=await confirm(_0x24cde3(0xf7)+_0x2d7878+'?');if(!_0x1383cb)return console[_0x24cde3(0xef)](_0x24cde3(0x120)),0x0;}return await withSpinner(_0x24cde3(0xed),()=>_0x3f3b33[_0x24cde3(0xe0)][_0x24cde3(0x12b)](_0x2d7878),{'verbose':_0x4cd6f5[_0x24cde3(0xda)]}),console[_0x24cde3(0xef)]('✔\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0x2d7878),console[_0x24cde3(0xef)](_0x24cde3(0xdf)+_0x2d7878+_0x24cde3(0xe3)),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']='job:submit';[a25_0x12cf62(0x12a)]=a25_0x12cf62(0xd8);async[a25_0x12cf62(0xd9)](_0x158baa){const _0x208429=a25_0x12cf62,{options:_0x4c50ef,args:_0x18cd3e,tdx:_0x128e54}=_0x158baa,_0x564636=_0x4c50ef[_0x208429(0x101)]||_0x208429(0x119),_0x47e684=_0x4c50ef['file'],_0x5041a1=_0x4c50ef[_0x208429(0x107)]||_0x208429(0xfb),_0x396660=_0x4c50ef['result'];if(_0x564636!==_0x208429(0x119)&&_0x564636!==_0x208429(0xf4))throw new SDKError(ErrorCode[_0x208429(0xf6)],'--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22');let _0x4d165d;if(_0x47e684){if(_0x18cd3e[0x0])throw new SDKError(ErrorCode[_0x208429(0xf6)],_0x208429(0xee));const _0x18a95e=readSqlStatementsFromFile(_0x47e684);if(_0x18a95e[_0x208429(0x12d)]===0x0)throw new SDKError(ErrorCode[_0x208429(0xf6)],_0x208429(0x100));if(_0x18a95e['length']>0x1)throw new SDKError(ErrorCode[_0x208429(0xf6)],_0x208429(0xdd));_0x4d165d=_0x18a95e[0x0];}else{if(!_0x18cd3e[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>');_0x4d165d=_0x18cd3e[0x0];}_0x4c50ef[_0x208429(0xda)]&&(console[_0x208429(0xef)](_0x208429(0x11f)+_0x564636),console['error'](_0x208429(0x121)+_0x5041a1),console[_0x208429(0xef)]('Query:\x20'+_0x4d165d['substring'](0x0,0x64)+(_0x4d165d[_0x208429(0x12d)]>0x64?'...':'')));const _0x52265e=await withSpinner(_0x208429(0x103),()=>_0x128e54['jobs'][_0x208429(0x108)](_0x5041a1,_0x4d165d,_0x564636,_0x396660),{'verbose':_0x4c50ef[_0x208429(0xda)]}),_0x352ea0=_0x52265e['data'];return console[_0x208429(0xef)](_0x208429(0xeb)),console[_0x208429(0xef)](_0x208429(0xfa)+_0x352ea0['job_id']),await handleSDKOutput([_0x352ea0],_0x4c50ef),0x0;}}export class JobResultCommand extends BaseCommand{[a25_0x12cf62(0xe4)]=a25_0x12cf62(0x128);[a25_0x12cf62(0x12a)]=a25_0x12cf62(0x11a);[a25_0x12cf62(0xf3)](_0x1da829){const _0x5e3e09=a25_0x12cf62,_0x17246d=_0x1da829[_0x5e3e09(0xe9)][0x0];if(!_0x17246d)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async['execute'](_0xbab898){const _0x5b656e=a25_0x12cf62,{options:_0x5aeb21,args:_0x1897cb,tdx:_0x28cf92}=_0xbab898,_0x1fb7c2=_0x1897cb[0x0],_0x491b6f=await withSpinner(_0x5b656e(0x105),()=>_0x28cf92['jobs'][_0x5b656e(0xe7)](_0x1fb7c2),{'verbose':_0x5aeb21[_0x5b656e(0xda)]}),_0x2e45ca=_0x491b6f['data'];return console[_0x5b656e(0xef)](_0x5b656e(0xea)+_0x2e45ca[_0x5b656e(0x12d)]+_0x5b656e(0x11c)+(_0x2e45ca[_0x5b656e(0x12d)]!==0x1?'s':'')),await handleSDKOutput(_0x2e45ca,_0x5aeb21),0x0;}}
@@ -1 +1 @@
1
- const a25_0x3a3145=a25_0x4229;(function(_0x121362,_0x18ef69){const _0x143163=a25_0x4229,_0x58fbfe=_0x121362();while(!![]){try{const _0x1bc962=-parseInt(_0x143163(0x247))/0x1*(parseInt(_0x143163(0x270))/0x2)+parseInt(_0x143163(0x2b2))/0x3*(parseInt(_0x143163(0x27b))/0x4)+parseInt(_0x143163(0x232))/0x5*(-parseInt(_0x143163(0x209))/0x6)+-parseInt(_0x143163(0x211))/0x7+-parseInt(_0x143163(0x2c4))/0x8*(parseInt(_0x143163(0x234))/0x9)+parseInt(_0x143163(0x2c0))/0xa*(parseInt(_0x143163(0x2b1))/0xb)+parseInt(_0x143163(0x1d7))/0xc;if(_0x1bc962===_0x18ef69)break;else _0x58fbfe['push'](_0x58fbfe['shift']());}catch(_0x39a1d5){_0x58fbfe['push'](_0x58fbfe['shift']());}}}(a25_0x4f22,0xe53de));import a25_0x341266 from'chalk';import a25_0x4921f9 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';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';function a25_0x4229(_0x2bf24d,_0x39b902){_0x2bf24d=_0x2bf24d-0x1c5;const _0x4f22a3=a25_0x4f22();let _0x4229bc=_0x4f22a3[_0x2bf24d];return _0x4229bc;}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(_0x5767f1){const _0x4be8ce=a25_0x4229;return!_0x5767f1&&(console['error'](_0x4be8ce(0x297)),console[_0x4be8ce(0x29c)](_0x4be8ce(0x282))),!!_0x5767f1;}function withJsonFormat(_0x4e418d){const _0x28a513=a25_0x4229;if(!_0x4e418d[_0x28a513(0x1d5)]&&!_0x4e418d[_0x28a513(0x2ca)]&&!_0x4e418d[_0x28a513(0x26c)]&&!_0x4e418d['tsv'])return{..._0x4e418d,'format':_0x28a513(0x2ca),'json':!![]};return _0x4e418d;}function a25_0x4f22(){const _0x250313=['Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','blue','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','links','all','dryRun','completed','journeyBundleId','site','activation','(paused)','stageNameMap','\x20(draft)\x20—\x20\x22','Pause\x20a\x20running\x20journey','\x20new\x20files','archived','helpText','getParentFull','pause','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','Available\x20stages:\x20','journey:version:create','draft','1878wrVWob','message','no_parent','List\x20all\x20versions\x20of\x20a\x20journey','Error:\x20Stage\x20\x22','buildIdToNameMap','folderId','\x20Opening\x20','5943105yjsDUR','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','completionRate','kind','\x20\x20Name:\x20','has','Error:\x20','type','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','reentryMode','set','\x20(rule\x20match)','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','isNew','No\x20journeys\x20found','goal','verbose','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','View\x20a\x20specific\x20version\x20of\x20a\x20journey','journeys','from','options','\x20\x20Consolidating\x20duplicate\x20segment:\x20','cwd','Resolving\x20parent\x20segment...','execute','journey:columns','Input:\x20','yellow','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','Getting\x20column\x20mapping...','session','20525KeFUIY','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','1441953ZvKdvP','get','Write\x20','(running)','(archived)','Aborted.','state','resolveParentId','hasChanges','getLatestJourneyId','listFolders','Target\x20directory:\x20','\x20\x20Statistics\x20not\x20available','journey:pull','\x20activation','(completed)','getColumnMapping','stringify','-\x20no\x20files\x20written','10464SHqLGc','attributes','createVersion','versionNumber','values','getStatistics','journey:pause','\x20journey\x20files\x20to\x20','Error:\x20Invalid\x20version\x20number:\x20','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','journey','diff','size','absolutePath','connection','Export\x20journey(s)\x20as\x20YAML\x20files','find','data','List\x20activations\x20for\x20a\x20journey','rootFolderId','conversion','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)','\x20\x20Preserving\x20local\x20segment\x20name:\x20','Getting\x20journey\x20traffic\x20data...','Table:\x20','goalSize','\x20Created\x20v','journeyBundleName','history','filePath','listActivationsFlat','milestoneSize','resourceName','paused','journeyId','Fetching\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','jsonl','Parent\x20segment:\x20','Error:\x20Journey\x20not\x20found:\x20','Journey\x20name:\x20','148AaDYhE','web','activation_','journey:push','Show\x20journey\x20details','journeyName','journey:stats','split','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','Show\x20journey\x20table\x20column\x20mapping','cyan','100jlEfjI','content','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','\x22\x20not\x20found','\x22\x20resumed','parent_segment','tdx.json','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','green','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','version','completeMilestoneRate','Getting\x20journey\x20details...','\x20versions)','map','\x27\x20not\x20found\x20in\x20','args','push','getJourney','Error:\x20Invalid\x20--type\x20\x22','(root)','\x20version','listVersions','buildIdToEmailMap','join','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','resume','List\x20journeys\x20in\x20current\x20context','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','parentSegment','parentName','add','includeStats','error','bold','utf-8','enteredSize','Pausing\x20journey...','hasPeriod','\x20\x20-\x20','journey:resume','/app/ps/','sort','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','errorCode','\x20\x20Parent\x20segment:\x20','length','base','.yml','journey:traffic','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Getting\x20journey\x20statistics...','journey:list','Target\x20file:\x20','16654yTlQrA','203907ghNQIN','dim','\x20unchanged\x20files','yes','\x20\x20Folder\x20path:\x20','description','stage','Error:\x20Parent\x20segment\x20context\x20required','/j/da/je','Error:\x20Version\x20','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20journey','Resolving\x20version...','\x20->\x20','11980HkcTmu','listJourneysFromParentSegment','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','32MteNhe','log','rule','setPhase','Fetching\x20journeys\x20and\x20folders...','then','json','connector_config','\x0aChanges\x20to\x20\x27','nodes','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','✔\x20All\x20files\x20are\x20up\x20to\x20date','/e/','No\x20statistics\x20available\x20for\x20journey:\x20','segments','folderPath','\x20not\x20found.\x20Available:\x20','✔\x20Journey\x20\x22','root\x20folder','includeHistory','columns','renderStats','database','Found\x20','format','repeat','11700732SWUUQp','Listing\x20journey\x20activations...','\x5c$&','folders','getActivation','getSegment','✔\x20Context\x20set:\x20','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','stages','resolveJourneyId','Warning:\x20Could\x20not\x20resolve\x20segment\x20','launched','red','journey:version:view','📁\x20','Options:','name','filter','relative','Fetching\x20parent\x20segment...','toLowerCase','Cancelled','table','segment','journeyStages','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','file'];a25_0x4f22=function(){return _0x250313;};return a25_0x4f22();}function formatJourneyState(_0x39f184){const _0x3eda10=a25_0x4229;switch(_0x39f184){case _0x3eda10(0x1e2):return a25_0x341266[_0x3eda10(0x283)](_0x3eda10(0x237));case _0x3eda10(0x208):return a25_0x341266[_0x3eda10(0x2b3)]('(draft)');case _0x3eda10(0x268):return a25_0x341266['yellow'](_0x3eda10(0x1fc));case _0x3eda10(0x1f8):return a25_0x341266[_0x3eda10(0x1f3)](_0x3eda10(0x243));case _0x3eda10(0x201):return a25_0x341266[_0x3eda10(0x2b3)](_0x3eda10(0x238));default:return'('+_0x39f184+')';}}function formatJourneyItem(_0x439936,_0x3200fc='',_0x515283){const _0x132d46=a25_0x4229,_0x4461d7=formatJourneyState(_0x439936[_0x132d46(0x23a)]),_0xa24e60=_0x515283?hyperlink(_0x439936[_0x132d46(0x262)],_0x515283):_0x439936['journeyBundleName'];return _0x3200fc+'🗺️\x20'+_0xa24e60+'\x20'+_0x4461d7;}function escapeRegex(_0x5238d9){const _0x5d09f1=a25_0x4229;return _0x5238d9['replace'](/[.*+?^${}()|[\]\\]/g,_0x5d09f1(0x1d9));}function globToRegex(_0x41dbe1){const _0x4edcb6=a25_0x4229,_0x4fd842=_0x41dbe1[_0x4edcb6(0x277)]('*')[_0x4edcb6(0x289)](escapeRegex);return new RegExp(_0x4fd842['join']('.*'),'i');}function buildRuleToNameMapping(_0xffa186){const _0x10daec=a25_0x4229,_0x410329=new Map();if(_0xffa186[_0x10daec(0x1cb)])for(const [_0x526f33,_0x5425c7]of Object['entries'](_0xffa186[_0x10daec(0x1cb)])){if(_0x5425c7[_0x10daec(0x2c6)]){const _0x4c0459=serializeRule(_0x5425c7['rule']),_0x2b3290=_0x410329['get'](_0x4c0459);_0x2b3290?_0x2b3290[_0x10daec(0x28c)](_0x526f33):_0x410329[_0x10daec(0x21b)](_0x4c0459,[_0x526f33]);}}return _0x410329;}async function resolveJourneyIdFromInput(_0x227881,_0x516af8,_0x2bd747){const _0x461a9c=a25_0x4229,_0x24bc07=await resolveJourneyTarget(_0x227881,_0x516af8[_0x461a9c(0x298)],_0x516af8['verbose']),_0x153dc7=_0x24bc07[_0x461a9c(0x298)];if(!_0x153dc7)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x461a9c(0x2bc));const _0x533897=await withSpinner(_0x461a9c(0x22a),()=>_0x2bd747[_0x461a9c(0x1ee)][_0x461a9c(0x23b)](_0x153dc7),{'verbose':_0x516af8[_0x461a9c(0x222)]}),_0x5b53f2=_0x533897[_0x461a9c(0x258)],_0x36c172=await withSpinner('Resolving\x20journey...',()=>_0x2bd747['journey'][_0x461a9c(0x1e0)](_0x5b53f2,_0x24bc07[_0x461a9c(0x275)]),{'verbose':_0x516af8[_0x461a9c(0x222)]});return{'journeyId':_0x36c172[_0x461a9c(0x258)],'journeyName':_0x24bc07[_0x461a9c(0x275)],'parentSegmentId':_0x5b53f2};}async function resolveJourneyTarget(_0x3f57ff,_0x29f4fe,_0x1606b3){const _0x118d6c=a25_0x4229;if(isYamlFilePath(_0x3f57ff))try{const _0x4b6741=await resolveYamlFilePath(_0x3f57ff);return _0x1606b3&&(console[_0x118d6c(0x29c)]('Resolved\x20YAML\x20file:\x20'+_0x3f57ff),console[_0x118d6c(0x29c)](_0x118d6c(0x2a8)+_0x4b6741[_0x118d6c(0x298)]),console[_0x118d6c(0x29c)](_0x118d6c(0x215)+_0x4b6741['segmentName']),console[_0x118d6c(0x29c)](_0x118d6c(0x2b6)+(_0x4b6741[_0x118d6c(0x1cc)]||_0x118d6c(0x28f)))),{'journeyName':_0x4b6741['segmentName'],'parentSegment':_0x4b6741[_0x118d6c(0x298)],'resolved':_0x4b6741};}catch(_0x4a4703){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x118d6c(0x2ad)+_0x4a4703['message']);}if(!_0x29f4fe)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x3f57ff,'parentSegment':_0x29f4fe};}export class JourneyListCommand extends BaseCommand{[a25_0x3a3145(0x1e7)]=a25_0x3a3145(0x2af);[a25_0x3a3145(0x2b7)]=a25_0x3a3145(0x296);async[a25_0x3a3145(0x22b)](_0x41825d){const _0x18a3c3=a25_0x3a3145,{options:_0x317a05,args:_0x447d3a,tdx:_0x73a472}=_0x41825d,_0x3e8821=_0x447d3a[0x0],_0x33799e=_0x317a05['parentSegment'];if(!_0x33799e)return console[_0x18a3c3(0x29c)](_0x18a3c3(0x2b9)),console[_0x18a3c3(0x29c)](_0x18a3c3(0x2c3)),0x1;const _0x2294ee=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x73a472[_0x18a3c3(0x1ee)][_0x18a3c3(0x23b)](_0x33799e),{'verbose':_0x317a05[_0x18a3c3(0x222)]}),_0x4e0c64=_0x2294ee[_0x18a3c3(0x258)];_0x317a05['verbose']&&(console[_0x18a3c3(0x29c)](_0x18a3c3(0x26d)+_0x33799e+'\x20(ID:\x20'+_0x4e0c64+')'),_0x3e8821&&console[_0x18a3c3(0x29c)]('Pattern:\x20'+_0x3e8821));const _0x5d4117=await withSpinner(_0x18a3c3(0x1ea),()=>_0x73a472[_0x18a3c3(0x1ee)][_0x18a3c3(0x203)](_0x4e0c64),{'verbose':_0x317a05[_0x18a3c3(0x222)]}),_0x5b25c6=_0x5d4117[_0x18a3c3(0x258)],_0x22b77d=_0x5b25c6[_0x18a3c3(0x25a)],_0x3f73a0=await withSpinner('Listing\x20journeys...',()=>_0x73a472['journey']['listJourneysWithFolders'](_0x4e0c64,_0x22b77d),{'verbose':_0x317a05[_0x18a3c3(0x222)]});let _0xf5e6eb=_0x3f73a0[_0x18a3c3(0x258)][_0x18a3c3(0x225)];const _0x1bf159=_0x3f73a0[_0x18a3c3(0x258)][_0x18a3c3(0x1da)],_0x6463ee=new Map();for(const _0x19055a of _0x1bf159){_0x6463ee[_0x18a3c3(0x21b)](_0x19055a['id'],_0x19055a[_0x18a3c3(0x1e7)]);}if(_0x3e8821){const _0x24645a=globToRegex(_0x3e8821);_0xf5e6eb=_0xf5e6eb[_0x18a3c3(0x1e8)](_0x53eb06=>_0x24645a['test'](_0x53eb06['journeyBundleName']));}console[_0x18a3c3(0x29c)]('✔\x20Found\x20'+_0xf5e6eb[_0x18a3c3(0x2a9)]+_0x18a3c3(0x2bd)+(_0xf5e6eb[_0x18a3c3(0x2a9)]!==0x1?'s':''));const _0x570919=_0x14c387=>{const _0x2a2d78=_0x18a3c3;return getConsoleNextUrl(_0x317a05[_0x2a2d78(0x1fa)],'/app/ps/'+_0x4e0c64+_0x2a2d78(0x1c9)+_0x14c387+'/j/da');};if(_0x317a05[_0x18a3c3(0x1d5)]===_0x18a3c3(0x1ed))await handleSDKOutput(_0xf5e6eb,_0x317a05);else{if(_0x317a05[_0x18a3c3(0x1d5)]===_0x18a3c3(0x2ca)){const _0x18ca65=_0xf5e6eb[_0x18a3c3(0x289)](_0x596346=>({..._0x596346,'url':_0x570919(_0x596346['id'])}));await handleSDKOutput(_0x18ca65,_0x317a05);}else{console[_0x18a3c3(0x2c5)]('['+_0x33799e+']');const _0x296ff6=new Map(),_0x59dc2f=[];for(const _0x2af382 of _0xf5e6eb){if(!_0x2af382['folderId']||_0x2af382['folderId']===_0x22b77d)_0x59dc2f[_0x18a3c3(0x28c)](_0x2af382);else{const _0x56dd92=_0x296ff6[_0x18a3c3(0x235)](_0x2af382[_0x18a3c3(0x20f)])||[];_0x56dd92['push'](_0x2af382),_0x296ff6[_0x18a3c3(0x21b)](_0x2af382[_0x18a3c3(0x20f)],_0x56dd92);}}const _0x5868b9=(_0x2aa22b,_0x1c2479)=>_0x2aa22b[_0x18a3c3(0x262)]['localeCompare'](_0x1c2479[_0x18a3c3(0x262)],undefined,{'sensitivity':_0x18a3c3(0x2aa)});_0x59dc2f[_0x18a3c3(0x2a5)](_0x5868b9);for(const _0x365cc0 of _0x59dc2f){console[_0x18a3c3(0x2c5)](formatJourneyItem(_0x365cc0,'',_0x570919(_0x365cc0['id'])));}const _0x1d4ad2=[..._0x296ff6['entries']()][_0x18a3c3(0x2a5)]((_0x20c501,_0xe4d4d3)=>{const _0x2a1e8e=_0x18a3c3,_0x24ebed=_0x6463ee[_0x2a1e8e(0x235)](_0x20c501[0x0])||_0x20c501[0x0],_0xed9b28=_0x6463ee[_0x2a1e8e(0x235)](_0xe4d4d3[0x0])||_0xe4d4d3[0x0];return _0x24ebed['localeCompare'](_0xed9b28,undefined,{'sensitivity':_0x2a1e8e(0x2aa)});});for(const [_0x275c97,_0x2df76b]of _0x1d4ad2){const _0x4f1c12=_0x6463ee[_0x18a3c3(0x235)](_0x275c97)||_0x275c97;console[_0x18a3c3(0x2c5)](_0x18a3c3(0x1e5)+_0x4f1c12),_0x2df76b[_0x18a3c3(0x2a5)](_0x5868b9);for(const _0x2274db of _0x2df76b){console[_0x18a3c3(0x2c5)](formatJourneyItem(_0x2274db,'\x20\x20',_0x570919(_0x2274db['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']='journey:view';[a25_0x3a3145(0x2b7)]=a25_0x3a3145(0x274);async[a25_0x3a3145(0x22b)](_0x536439){const _0x98c0c5=a25_0x3a3145,{options:_0x4bed48,args:_0x3e2670,tdx:_0x165864}=_0x536439,_0x3f7a22=_0x3e2670[0x0];if(!_0x3f7a22)return console['error'](_0x98c0c5(0x297)),console['error'](_0x98c0c5(0x250)),console[_0x98c0c5(0x29c)](_0x98c0c5(0x1e6)),console[_0x98c0c5(0x29c)](_0x98c0c5(0x27d)),0x1;_0x4bed48['verbose']&&console[_0x98c0c5(0x29c)](_0x98c0c5(0x22d)+_0x3f7a22);const {journeyId:_0x26344d,parentSegmentId:_0x24c61a}=await resolveJourneyIdFromInput(_0x3f7a22,_0x4bed48,_0x165864);if(_0x4bed48[_0x98c0c5(0x271)]){const _0x116f4e=getConsoleNextUrl(_0x4bed48[_0x98c0c5(0x1fa)],_0x98c0c5(0x2a4)+_0x24c61a+_0x98c0c5(0x1c9)+_0x26344d+_0x98c0c5(0x2ba));return console['error'](a25_0x341266['green']('✔')+_0x98c0c5(0x210)+a25_0x341266[_0x98c0c5(0x27a)](_0x116f4e)),openBrowser(_0x116f4e),0x0;}const _0x30009d=await withSpinner(_0x98c0c5(0x287),()=>_0x165864[_0x98c0c5(0x251)][_0x98c0c5(0x28d)](_0x26344d),{'verbose':_0x4bed48[_0x98c0c5(0x222)]}),_0x1aa235=_0x30009d[_0x98c0c5(0x258)],_0x1b5605=_0x4bed48[_0x98c0c5(0x29b)];let _0x3401c7;if(_0x1b5605)try{const _0x265d38=await withSpinner(_0x98c0c5(0x2ae),()=>_0x165864[_0x98c0c5(0x251)][_0x98c0c5(0x24c)](_0x26344d),{'verbose':_0x4bed48[_0x98c0c5(0x222)]});_0x3401c7=_0x265d38[_0x98c0c5(0x258)];}catch{_0x4bed48['verbose']&&console[_0x98c0c5(0x29c)](_0x98c0c5(0x240));}const _0x48c532=getConsoleNextUrl(_0x4bed48['site'],_0x98c0c5(0x2a4)+_0x24c61a+'/e/'+_0x26344d+'/j/da/je'),_0x563c39={'id':_0x1aa235['id'],'name':_0x1aa235[_0x98c0c5(0x248)][_0x98c0c5(0x1e7)],'description':_0x1aa235[_0x98c0c5(0x248)][_0x98c0c5(0x2b7)],'state':_0x1aa235['attributes']['state'],'paused':_0x1aa235[_0x98c0c5(0x248)][_0x98c0c5(0x268)],'reentry_mode':_0x1aa235[_0x98c0c5(0x248)][_0x98c0c5(0x21a)],'stages':_0x1aa235[_0x98c0c5(0x248)][_0x98c0c5(0x1ef)]?.[_0x98c0c5(0x2a9)]||0x0,..._0x1aa235[_0x98c0c5(0x248)]['goal']&&{'goal':_0x1aa235[_0x98c0c5(0x248)][_0x98c0c5(0x221)][_0x98c0c5(0x1e7)]},..._0x3401c7&&{'statistics':{'size':_0x3401c7['size'],'entered':_0x3401c7[_0x98c0c5(0x29f)],'goal_achieved':_0x3401c7[_0x98c0c5(0x260)],'completion_rate':_0x3401c7[_0x98c0c5(0x213)],'exit_or_jump':_0x3401c7['exitOrJumpSize'],'exit_or_jump_rate':_0x3401c7['exitOrJumpRate'],'stages':_0x3401c7[_0x98c0c5(0x1df)]}},'url':_0x48c532};return await handleSingleObjectOutput(_0x563c39,_0x4bed48),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a25_0x3a3145(0x1e7)]=a25_0x3a3145(0x276);[a25_0x3a3145(0x2b7)]='Show\x20journey\x20statistics';async['execute'](_0x2c8e6b){const _0x4373c3=a25_0x3a3145,{options:_0x67738d,args:_0x482246,tdx:_0x76430b}=_0x2c8e6b,_0x312da1=_0x482246[0x0];if(!requireNameOrPath(_0x312da1))return 0x1;_0x67738d[_0x4373c3(0x222)]&&console[_0x4373c3(0x29c)](_0x4373c3(0x22d)+_0x312da1);const _0x164a0f=_0x67738d,_0x11968f=_0x164a0f[_0x4373c3(0x226)],_0x2a6a9d=_0x164a0f['to'],_0x3fce83=_0x164a0f['includeHistory'],_0x5d0c9=_0x164a0f[_0x4373c3(0x2b8)];_0x3fce83&&!_0x11968f&&!_0x2a6a9d&&console[_0x4373c3(0x29c)](_0x4373c3(0x212));const _0x46a7b8=_0x3fce83?withJsonFormat(_0x67738d):_0x67738d,{journeyId:_0x5c5ff3,journeyName:_0x861e72}=await resolveJourneyIdFromInput(_0x312da1,_0x46a7b8,_0x76430b),_0x298760=_0x11968f||_0x2a6a9d?{'from':_0x11968f,'to':_0x2a6a9d}:undefined,_0x10af39=await withSpinner(_0x4373c3(0x2ae),()=>Promise[_0x4373c3(0x1f6)]([_0x76430b['journey']['getJourney'](_0x5c5ff3),_0x76430b[_0x4373c3(0x251)][_0x4373c3(0x24c)](_0x5c5ff3,_0x298760)]),{'verbose':_0x46a7b8[_0x4373c3(0x222)]}),[_0x459842,_0x432494]=_0x10af39[_0x4373c3(0x258)];if(!_0x432494||_0x432494[_0x4373c3(0x269)]===null)return console[_0x4373c3(0x29c)](_0x4373c3(0x1ca)+_0x861e72),console['error'](_0x4373c3(0x1de)),0x0;const _0x2332d3=buildStageNameMap(_0x459842),_0x485575=!!(_0x298760&&_0x432494[_0x4373c3(0x263)]?.[_0x4373c3(0x2a9)]),_0x5017e3={'stageNameMap':_0x2332d3,'hasPeriod':_0x485575,'includeHistory':!!_0x3fce83};if(_0x5d0c9&&_0x432494[_0x4373c3(0x1df)]){const _0x1802b5=_0x432494[_0x4373c3(0x1df)][_0x4373c3(0x257)](_0x42fb49=>{const _0x28f508=_0x4373c3,_0x1b7698=_0x2332d3[_0x28f508(0x235)](_0x42fb49['id'])??'';return _0x1b7698['toLowerCase']()===_0x5d0c9['toLowerCase']();});if(_0x1802b5)return await handleSingleObjectOutput(formatStageStats(_0x1802b5,_0x5017e3),_0x46a7b8),0x0;const _0x5c61fe=_0x432494['stages'][_0x4373c3(0x289)](_0x4f2761=>_0x2332d3['get'](_0x4f2761['id'])??_0x4f2761['id']);return console['error'](_0x4373c3(0x20d)+_0x5d0c9+_0x4373c3(0x27e)),console[_0x4373c3(0x29c)](_0x4373c3(0x206)+_0x5c61fe[_0x4373c3(0x293)](',\x20')),0x1;}const _0x53489b=_0x432494['stages']?.['map'](_0x2b0d3b=>formatStageStats(_0x2b0d3b,_0x5017e3)),_0x3cadba=assembleJourneyStats(_0x432494,{'from':_0x11968f,'to':_0x2a6a9d,'includeHistory':_0x3fce83});return await this[_0x4373c3(0x1d2)](_0x3cadba,_0x53489b??[],_0x46a7b8),0x0;}async[a25_0x3a3145(0x1d2)](_0x4ae917,_0x12f9b9,_0x4514cf){const _0x1360d9=a25_0x3a3145,_0x52c92c=_0x4514cf[_0x1360d9(0x1d5)]===_0x1360d9(0x2ca)||_0x4514cf['format']===_0x1360d9(0x26c)||_0x4514cf[_0x1360d9(0x2ca)]||_0x4514cf[_0x1360d9(0x26c)];if(_0x52c92c){_0x4ae917[_0x1360d9(0x1df)]=_0x12f9b9,await handleSingleObjectOutput(_0x4ae917,_0x4514cf);return;}await handleSingleObjectOutput(_0x4ae917,_0x4514cf);for(const _0x50acd3 of _0x12f9b9){console[_0x1360d9(0x2c5)](''),console[_0x1360d9(0x2c5)](String(a25_0x341266[_0x1360d9(0x27a)][_0x1360d9(0x29d)]('['+_0x50acd3[_0x1360d9(0x1e7)]+']'))+a25_0x341266[_0x1360d9(0x2b3)]('\x20'+_0x50acd3['id']));const {id:_0x1c748b,name:_0x3c79a7,..._0x20ee4d}=_0x50acd3;await handleSingleObjectOutput(_0x20ee4d,_0x4514cf);}}}export class JourneyTrafficCommand extends BaseCommand{['name']=a25_0x3a3145(0x2ac);[a25_0x3a3145(0x2b7)]=a25_0x3a3145(0x22f);async[a25_0x3a3145(0x22b)](_0x1cdb03){const _0xcbd8f9=a25_0x3a3145,{options:_0x2600a6,args:_0x83b3b3,tdx:_0x22ab53}=_0x1cdb03,_0x413d59=_0x83b3b3[0x0];if(!requireNameOrPath(_0x413d59))return 0x1;_0x2600a6['verbose']&&console[_0xcbd8f9(0x29c)]('Input:\x20'+_0x413d59);const _0xe636f8=_0x2600a6,_0x455193=_0xe636f8[_0xcbd8f9(0x218)],_0x3896e1=_0xe636f8['from'],_0x34b668=_0xe636f8['to'],_0x4df0dc=_0xe636f8['limit'];if(_0x455193&&_0x455193!==_0xcbd8f9(0x25b)&&_0x455193!==_0xcbd8f9(0x1fb))return console[_0xcbd8f9(0x29c)](_0xcbd8f9(0x28e)+_0x455193+_0xcbd8f9(0x233)),0x1;const _0x4516be=withJsonFormat(_0x2600a6),{journeyId:_0x489025,journeyName:_0x11cd68}=await resolveJourneyIdFromInput(_0x413d59,_0x4516be,_0x22ab53),_0x511dc9={'type':_0x455193,'from':_0x3896e1,'to':_0x34b668,'limit':_0x4df0dc},_0xc24db3=await withSpinner(_0xcbd8f9(0x25e),()=>_0x22ab53['journey']['getTrafficData'](_0x489025,_0x511dc9),{'verbose':_0x4516be[_0xcbd8f9(0x222)]}),_0x29097f=_0xc24db3['data'],_0x37294c=_0x29097f[_0xcbd8f9(0x25b)]&&(_0x29097f[_0xcbd8f9(0x25b)][_0xcbd8f9(0x1c6)][_0xcbd8f9(0x2a9)]>0x0||_0x29097f['conversion'][_0xcbd8f9(0x1f5)][_0xcbd8f9(0x2a9)]>0x0),_0x3d5015=_0x29097f[_0xcbd8f9(0x1fb)]&&_0x29097f[_0xcbd8f9(0x1fb)]['length']>0x0;if(!_0x37294c&&!_0x3d5015)return console['error'](_0xcbd8f9(0x219)+_0x11cd68),console[_0xcbd8f9(0x29c)](_0xcbd8f9(0x2a6)),_0x3896e1&&_0x34b668&&console[_0xcbd8f9(0x29c)](_0xcbd8f9(0x205)),0x0;return await handleSingleObjectOutput(_0x29097f,_0x4516be),0x0;}}function formatStageStats(_0x2e76a8,_0x4b238f){const _0x4adcfb=a25_0x3a3145,_0x52d61d=_0x4b238f[_0x4adcfb(0x2a1)]&&_0x2e76a8[_0x4adcfb(0x263)]?.[_0x4adcfb(0x2a9)]?aggregateStageHistory(_0x2e76a8[_0x4adcfb(0x263)]):{'size':_0x2e76a8[_0x4adcfb(0x253)],'entered':_0x2e76a8[_0x4adcfb(0x29f)],'milestone':_0x2e76a8[_0x4adcfb(0x266)],'milestone_rate':_0x2e76a8[_0x4adcfb(0x286)],'exit_or_jump':_0x2e76a8['exitOrJumpSize'],'exit_or_jump_rate':_0x2e76a8['exitOrJumpRate']},_0x496341={'id':_0x2e76a8['id'],'name':_0x4b238f[_0x4adcfb(0x1fd)][_0x4adcfb(0x235)](_0x2e76a8['id'])??_0x2e76a8['id'],..._0x52d61d};return _0x4b238f['hasPeriod']&&_0x4b238f[_0x4adcfb(0x1d0)]&&_0x2e76a8[_0x4adcfb(0x263)]&&(_0x496341[_0x4adcfb(0x263)]=_0x2e76a8['history']),_0x496341;}export class JourneyPauseCommand extends BaseCommand{['name']=a25_0x3a3145(0x24d);[a25_0x3a3145(0x2b7)]=a25_0x3a3145(0x1ff);async[a25_0x3a3145(0x22b)](_0x55a06b){const _0x21386e=a25_0x3a3145,{options:_0x1939b9,args:_0xaf22ed,tdx:_0x5cfe15}=_0x55a06b,_0x3d85f4=_0xaf22ed[0x0];if(!requireNameOrPath(_0x3d85f4))return 0x1;_0x1939b9[_0x21386e(0x222)]&&console[_0x21386e(0x29c)](_0x21386e(0x22d)+_0x3d85f4);const {journeyId:_0x3d9446,journeyName:_0x1ad9ee}=await resolveJourneyIdFromInput(_0x3d85f4,_0x1939b9,_0x5cfe15);if(!_0x1939b9[_0x21386e(0x2b5)]){const _0x52a81c=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x1ad9ee+'\x22?');if(!_0x52a81c)return console[_0x21386e(0x29c)](_0x21386e(0x1ec)),0x0;}const _0x11ecad=await withSpinner(_0x21386e(0x2a0),()=>_0x5cfe15[_0x21386e(0x251)][_0x21386e(0x204)](_0x3d9446),{'verbose':_0x1939b9[_0x21386e(0x222)]}),_0x45dd2c=_0x11ecad[_0x21386e(0x258)];return console[_0x21386e(0x29c)](_0x21386e(0x1ce)+_0x45dd2c[_0x21386e(0x248)][_0x21386e(0x1e7)]+'\x22\x20paused'),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a25_0x3a3145(0x1e7)]=a25_0x3a3145(0x2a3);[a25_0x3a3145(0x2b7)]='Resume\x20a\x20paused\x20journey';async[a25_0x3a3145(0x22b)](_0x542866){const _0x2d00b2=a25_0x3a3145,{options:_0x4344b9,args:_0x4522df,tdx:_0x3ce1c5}=_0x542866,_0x5e9a61=_0x4522df[0x0];if(!requireNameOrPath(_0x5e9a61))return 0x1;_0x4344b9[_0x2d00b2(0x222)]&&console[_0x2d00b2(0x29c)](_0x2d00b2(0x22d)+_0x5e9a61);const {journeyId:_0x4be0c9,journeyName:_0x461f1a}=await resolveJourneyIdFromInput(_0x5e9a61,_0x4344b9,_0x3ce1c5);if(!_0x4344b9['yes']){const _0x194d22=await confirm(_0x2d00b2(0x1f4)+_0x461f1a+'\x22?');if(!_0x194d22)return console[_0x2d00b2(0x29c)]('Cancelled'),0x0;}const _0x447d95=await withSpinner('Resuming\x20journey...',()=>_0x3ce1c5[_0x2d00b2(0x251)][_0x2d00b2(0x295)](_0x4be0c9),{'verbose':_0x4344b9['verbose']}),_0x3a1627=_0x447d95[_0x2d00b2(0x258)];return console[_0x2d00b2(0x29c)](_0x2d00b2(0x1ce)+_0x3a1627[_0x2d00b2(0x248)]['name']+_0x2d00b2(0x27f)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a25_0x3a3145(0x1e7)]=a25_0x3a3145(0x241);[a25_0x3a3145(0x2b7)]=a25_0x3a3145(0x256);async[a25_0x3a3145(0x22b)](_0x157577){const _0xb79b8c=a25_0x3a3145,{options:_0x571b6a,args:_0x296efb,tdx:_0x89c48a}=_0x157577,_0x1d2194=_0x571b6a,_0x491661=_0x296efb[0x0],_0x514460=_0x491661&&isYamlFilePath(_0x491661),_0x5e012b=await resolveTarget({'arg':_0x514460?_0x491661:undefined,'contextParent':_0x571b6a[_0xb79b8c(0x298)],'cwd':process[_0xb79b8c(0x229)]()});if(!isSuccessfulResolution(_0x5e012b))return _0x5e012b[_0xb79b8c(0x2a7)]===_0xb79b8c(0x20b)?(console[_0xb79b8c(0x29c)](a25_0x341266[_0xb79b8c(0x22e)](_0xb79b8c(0x294))),console[_0xb79b8c(0x29c)](_0xb79b8c(0x25c)),console[_0xb79b8c(0x29c)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console[_0xb79b8c(0x29c)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console[_0xb79b8c(0x29c)](_0xb79b8c(0x284))):(console[_0xb79b8c(0x29c)](a25_0x341266[_0xb79b8c(0x1e3)](_0xb79b8c(0x217)+_0x5e012b[_0xb79b8c(0x20a)]+'\x0a')),_0x5e012b[_0xb79b8c(0x202)]&&console['error'](a25_0x341266['cyan'](_0x5e012b[_0xb79b8c(0x202)]))),0x1;let _0x37851d=_0x514460?undefined:_0x491661,_0x383491,_0x5f1c0d;_0x5e012b[_0xb79b8c(0x218)]===_0xb79b8c(0x1f1)&&(_0x37851d=_0x5e012b[_0xb79b8c(0x267)],_0x383491=_0x5e012b[_0xb79b8c(0x264)],_0x5f1c0d=_0x5e012b[_0xb79b8c(0x1cc)]);const _0xfd3e28=_0x5e012b[_0xb79b8c(0x299)],_0x160732=_0x5e012b['targetDir'];_0x1d2194[_0xb79b8c(0x222)]&&(console[_0xb79b8c(0x29c)](_0xb79b8c(0x26d)+_0xfd3e28),console[_0xb79b8c(0x29c)](_0xb79b8c(0x23f)+_0x160732),_0x37851d&&console[_0xb79b8c(0x29c)](_0xb79b8c(0x26f)+_0x37851d),_0x383491&&console['error'](_0xb79b8c(0x2b0)+_0x383491),_0x5f1c0d&&console['error']('Folder\x20path:\x20'+_0x5f1c0d));const _0x38f9db=await withSpinner(_0xb79b8c(0x22a),()=>_0x89c48a[_0xb79b8c(0x1ee)]['resolveParentId'](_0xfd3e28),{'verbose':_0x571b6a[_0xb79b8c(0x222)]}),_0x4a1c25=_0x38f9db[_0xb79b8c(0x258)],{journeys:_0x7ce57e,folders:_0x1afc0c}=await withSpinner(_0xb79b8c(0x2c8),async()=>{const _0x18efa2=_0xb79b8c,[_0x309962,_0x806d0f]=await Promise['all']([_0x89c48a['journey'][_0x18efa2(0x2c1)](_0x4a1c25,undefined,{'includeAllVersions':!![]}),_0x89c48a['segment'][_0x18efa2(0x23e)](_0x4a1c25)]);return{'journeys':_0x309962,'folders':_0x806d0f};},{'verbose':_0x571b6a[_0xb79b8c(0x222)]})['then'](_0x2874e7=>_0x2874e7[_0xb79b8c(0x258)]);let _0x44db28=_0x7ce57e;const _0x2ef763=buildFolderIdToPathMap(_0x1afc0c);if(_0x37851d){const _0x49dc94=_0x44db28[_0xb79b8c(0x1e8)](_0x118fee=>_0x118fee[_0xb79b8c(0x262)]['toLowerCase']()===_0x37851d[_0xb79b8c(0x1eb)]());if(_0x49dc94[_0xb79b8c(0x2a9)]===0x0)return console['error'](_0xb79b8c(0x26e)+_0x37851d),console[_0xb79b8c(0x29c)](_0xb79b8c(0x2c2)),0x1;_0x44db28=_0x49dc94;}if(_0x5f1c0d!==undefined){const _0x4d50c7=_0x44db28['filter'](_0x3174fc=>{const _0x13b919=_0xb79b8c,_0x27f041=_0x3174fc[_0x13b919(0x20f)]?_0x2ef763[_0x13b919(0x235)](_0x3174fc['folderId'])||'':'';return _0x27f041===_0x5f1c0d;});if(_0x4d50c7['length']===0x0&&_0x44db28[_0xb79b8c(0x2a9)]>0x0){console[_0xb79b8c(0x29c)]('Error:\x20Journey\x20\x27'+_0x37851d+_0xb79b8c(0x28a)+(_0x5f1c0d||_0xb79b8c(0x1cf))),console['error'](_0xb79b8c(0x1c7));for(const _0x4590db of _0x44db28){const _0x31a8b4=_0x4590db['folderId']?_0x2ef763[_0xb79b8c(0x235)](_0x4590db['folderId'])||'':'';console[_0xb79b8c(0x29c)](_0xb79b8c(0x2a2)+(_0x31a8b4||_0xb79b8c(0x28f))+'/'+_0x4590db[_0xb79b8c(0x262)]);}return 0x1;}_0x44db28=_0x4d50c7;}if(_0x44db28[_0xb79b8c(0x2a9)]===0x0)return console[_0xb79b8c(0x29c)](_0xb79b8c(0x220)),0x0;const _0x1912e0=new Map();for(const _0x54526c of _0x44db28){const _0x370f0e=_0x54526c[_0xb79b8c(0x1f9)];!_0x1912e0[_0xb79b8c(0x216)](_0x370f0e)&&_0x1912e0[_0xb79b8c(0x21b)](_0x370f0e,[]),_0x1912e0[_0xb79b8c(0x235)](_0x370f0e)[_0xb79b8c(0x28c)](_0x54526c);}for(const _0x5c2771 of _0x1912e0[_0xb79b8c(0x24b)]()){_0x5c2771['sort']((_0x5adfef,_0x44481f)=>(_0x5adfef['versionNumber']||0x0)-(_0x44481f[_0xb79b8c(0x24a)]||0x0));}const _0xe689f0=[],{idToEmailMap:_0x858c6a,connectionIdToNameMap:_0x31cdc4}=await withSpinner('Fetching\x20users\x20and\x20connections...',async()=>{const _0x41e21f=_0xb79b8c,[_0x418525,_0x30849d]=await Promise[_0x41e21f(0x1f6)]([_0x89c48a['user'][_0x41e21f(0x292)](),_0x89c48a[_0x41e21f(0x255)][_0x41e21f(0x20e)]()]);return{'idToEmailMap':_0x418525,'connectionIdToNameMap':_0x30849d};},{'verbose':_0x571b6a[_0xb79b8c(0x222)]})[_0xb79b8c(0x2c9)](_0x4ba6ba=>_0x4ba6ba['data']);for(const _0x3a5764 of _0x1912e0[_0xb79b8c(0x24b)]()){const _0x299351=_0x3a5764[0x0][_0xb79b8c(0x262)],_0x1e1b35=_0x3a5764[0x0][_0xb79b8c(0x20f)],_0x5d3826=_0x1e1b35?_0x2ef763[_0xb79b8c(0x235)](_0x1e1b35)||'':'',_0x475362=_0x5d3826?a25_0x4921f9[_0xb79b8c(0x293)](_0x160732,_0x5d3826):_0x160732,_0xe53660=_0x383491||a25_0x4921f9[_0xb79b8c(0x293)](_0x475362,sanitizeFileName(_0x299351)+_0xb79b8c(0x2ab));let _0x1c6f2e,_0x4c7381;if(existsSync(_0xe53660))try{const _0xe89b2c=readFileSync(_0xe53660,_0xb79b8c(0x29e)),_0x43ea3a=parseYamlString(_0xe89b2c);_0x4c7381=_0x43ea3a,_0x1c6f2e=buildRuleToNameMapping(_0x43ea3a),_0x1d2194[_0xb79b8c(0x222)]&&_0x1c6f2e[_0xb79b8c(0x253)]>0x0&&console[_0xb79b8c(0x29c)](_0xb79b8c(0x1d4)+_0x1c6f2e[_0xb79b8c(0x253)]+_0xb79b8c(0x21e)+_0x299351);}catch(_0x2ffc6f){_0x1d2194[_0xb79b8c(0x222)]&&console[_0xb79b8c(0x29c)](_0xb79b8c(0x223)+_0x2ffc6f[_0xb79b8c(0x20a)]);}const _0x4b043b=[],_0x2dc247=new Set(),_0x18d7e2=new Map(),_0xeda879=new Map(),_0x2ea089=new Set(),_0x2c65fc=new Map(),_0x445e42=new Map(),_0x2f5dc5=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x299351+'...',async _0x27919d=>{const _0x24d06f=_0xb79b8c;for(const _0x22499d of _0x3a5764){const _0x2f4de0=_0x3a5764[_0x24d06f(0x2a9)]>0x1?_0x22499d[_0x24d06f(0x262)]+'\x20v'+(_0x22499d[_0x24d06f(0x24a)]||0x1):_0x22499d[_0x24d06f(0x262)];_0x27919d[_0x24d06f(0x2c7)](_0x24d06f(0x26a)+_0x2f4de0);const _0xecac9f=await _0x89c48a[_0x24d06f(0x251)]['getJourney'](_0x22499d['id']),_0x227304=_0xecac9f[_0x24d06f(0x248)]?.['audienceId'],_0x12db8d={'resolveSegment':async _0x1c1bed=>{const _0x18f3db=_0x24d06f;if(!_0x227304)return{'name':_0x1c1bed,'isJourneyLocal':![]};const _0x2850fa=_0x18d7e2[_0x18f3db(0x235)](_0x1c1bed);if(_0x2850fa)return _0x2850fa;try{const _0x3aaec0=await _0x89c48a[_0x18f3db(0x1ee)][_0x18f3db(0x1dc)](_0x227304,_0x1c1bed),_0x25c72a=_0x3aaec0[_0x18f3db(0x214)]===SEGMENT_KIND_JOURNEY;let _0x3df22,_0x4d91aa=_0x3aaec0[_0x18f3db(0x1e7)];if(_0x25c72a&&_0x3aaec0[_0x18f3db(0x2c6)]){const _0x29db6d=await segmentResponseToDef(_0x3aaec0,{'resolveSegmentName':async _0x3e28b4=>{const _0x5de8bb=_0x18f3db,_0x491444=_0x18d7e2['get'](_0x3e28b4);if(_0x491444)return _0x491444[_0x5de8bb(0x1e7)];const _0xfc5095=await _0x12db8d['resolveSegment'](_0x3e28b4);return _0xfc5095[_0x5de8bb(0x1e7)];}}),_0x3c95a1=_0x29db6d[_0x18f3db(0x2c6)];_0x3df22={'description':_0x3aaec0['description'],'rule':_0x3c95a1};const _0x3b5980=serializeRule(_0x3c95a1),_0x4d4724=_0xeda879[_0x18f3db(0x235)](_0x3b5980);if(_0x4d4724)_0x4d91aa=_0x4d4724,_0x3df22=undefined,_0x1d2194[_0x18f3db(0x222)]&&console['error'](_0x18f3db(0x228)+_0x3aaec0[_0x18f3db(0x1e7)]+_0x18f3db(0x2bf)+_0x4d4724);else{let _0x5fb6c0=![];if(_0x1c6f2e){const _0x2ae84c=_0x1c6f2e['get'](_0x3b5980);if(_0x2ae84c){const _0x33fedd=_0x2ae84c['find'](_0x41b640=>!_0x2dc247['has'](_0x41b640));_0x33fedd&&(_0x4d91aa=_0x33fedd,_0x2dc247[_0x18f3db(0x29a)](_0x33fedd),_0xeda879[_0x18f3db(0x21b)](_0x3b5980,_0x33fedd),_0x5fb6c0=!![],_0x1d2194[_0x18f3db(0x222)]&&console['error'](_0x18f3db(0x25d)+_0x33fedd+_0x18f3db(0x21c)));}}if(!_0x5fb6c0){const _0x4fe5ec=generateJourneyLocalName(_0x3aaec0[_0x18f3db(0x1e7)]);_0x4fe5ec&&(_0x4d91aa=_0x4fe5ec);let _0x2dc47a=_0x4d91aa,_0x24ccce=0x2;while(_0x2dc247[_0x18f3db(0x216)](_0x2dc47a)){_0x2dc47a=_0x4d91aa+'_'+_0x24ccce,_0x24ccce++;}_0x2dc247[_0x18f3db(0x29a)](_0x2dc47a),_0xeda879[_0x18f3db(0x21b)](_0x3b5980,_0x2dc47a),_0x4d91aa=_0x2dc47a;}}}const _0x2940b4={'name':_0x4d91aa,'isJourneyLocal':_0x25c72a,'definition':_0x3df22};return _0x18d7e2[_0x18f3db(0x21b)](_0x1c1bed,_0x2940b4),_0x2940b4;}catch(_0x5a5df3){return _0x571b6a[_0x18f3db(0x222)]&&console[_0x18f3db(0x29c)](_0x18f3db(0x1e1)+_0x1c1bed+':\x20'+_0x5a5df3['message']),{'name':_0x1c1bed,'isJourneyLocal':![]};}},'resolveActivation':async _0x198d72=>{const _0x5eeb6f=_0x24d06f,_0x23edee=_0x2c65fc['get'](_0x198d72);if(_0x23edee)return _0x23edee;try{const _0x2f6e00=await _0x89c48a[_0x5eeb6f(0x251)][_0x5eeb6f(0x1db)](_0x22499d['id'],_0x198d72),_0x46abe1=journeyActivationStepToYaml(_0x2f6e00,_0x858c6a,_0x31cdc4),_0x5c7696=JSON[_0x5eeb6f(0x245)]({'name':_0x46abe1['name'],'connection':_0x46abe1[_0x5eeb6f(0x255)],'connector_config':_0x46abe1[_0x5eeb6f(0x2cb)]}),_0x28c688=_0x445e42['get'](_0x5c7696);if(_0x28c688){const _0x46f360={'name':_0x28c688,'isJourneyLocal':!![],'definition':_0x46abe1};return _0x2c65fc['set'](_0x198d72,_0x46f360),_0x46f360;}const _0x51d0b1=_0x2f6e00[_0x5eeb6f(0x248)]['activationParams'][_0x5eeb6f(0x1e7)]||_0x198d72,_0x4622d5=sanitizeYamlKey(_0x51d0b1)||_0x5eeb6f(0x272)+_0x198d72;let _0x14060c=_0x4622d5,_0x94021b=0x2;while(_0x2ea089[_0x5eeb6f(0x216)](_0x14060c)){_0x14060c=_0x4622d5+'_'+_0x94021b,_0x94021b++;}_0x2ea089['add'](_0x14060c),_0x445e42['set'](_0x5c7696,_0x14060c);const _0x4b3205={'name':_0x14060c,'isJourneyLocal':!![],'definition':_0x46abe1};return _0x2c65fc['set'](_0x198d72,_0x4b3205),_0x4b3205;}catch(_0x5da13d){return _0x571b6a[_0x5eeb6f(0x222)]&&console['error']('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x198d72+':\x20'+_0x5da13d[_0x5eeb6f(0x20a)]),{'name':_0x198d72,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x594828,_0x377d79)=>{const _0x3d8ef7=_0x24d06f;return resolveJumpTarget(_0x594828,_0x377d79,_0x2f5dc5,_0x114144=>_0x89c48a[_0x3d8ef7(0x251)][_0x3d8ef7(0x28d)](_0x114144));}},_0xc540e1=await journeyResponseToDef(_0xecac9f,_0x12db8d);_0x4b043b['push']({'item':_0x22499d,'yaml':_0xc540e1});}},{'verbose':_0x571b6a[_0xb79b8c(0x222)]});const _0x3520b2=await _0x89c48a[_0xb79b8c(0x251)][_0xb79b8c(0x23d)](_0x3a5764[0x0][_0xb79b8c(0x1f9)]),_0x65415=buildMergedJourneyDef(_0x4b043b,_0x1c6f2e,_0x3520b2),_0x12c29e=normalizeJourneyDef(_0x65415,_0x4c7381),_0x5dc8cc=toYamlString(_0x12c29e),_0x2cc0c9=_0x383491||a25_0x4921f9[_0xb79b8c(0x293)](_0x475362,sanitizeFileName(_0x299351)+_0xb79b8c(0x2ab));!_0x383491&&_0x5d3826&&!existsSync(_0x475362)&&mkdirSync(_0x475362,{'recursive':!![]});const _0x42e633=a25_0x4921f9[_0xb79b8c(0x1e9)](process[_0xb79b8c(0x229)](),_0x2cc0c9);if(existsSync(_0x2cc0c9)){const _0x2336f8=readFileSync(_0x2cc0c9,_0xb79b8c(0x29e)),_0x5934df=generateDiff(_0x2336f8,_0x5dc8cc),_0x3dcc83=hasChanges(_0x5934df);_0xe689f0[_0xb79b8c(0x28c)]({'relativePath':_0x42e633,'absolutePath':_0x2cc0c9,'content':_0x5dc8cc,'isNew':![],'hasChanges':_0x3dcc83,'diff':_0x3dcc83?formatDiffWithColors(_0x5934df):undefined});}else _0xe689f0['push']({'relativePath':_0x42e633,'absolutePath':_0x2cc0c9,'content':_0x5dc8cc,'isNew':!![],'hasChanges':![]});}const _0x5e59f5=_0xe689f0['filter'](_0x45bc05=>_0x45bc05['isNew']),_0x98fd30=_0xe689f0['filter'](_0x322ff5=>!_0x322ff5['isNew']&&_0x322ff5['hasChanges']),_0xda0a0f=_0xe689f0[_0xb79b8c(0x1e8)](_0x1b1e92=>!_0x1b1e92[_0xb79b8c(0x21f)]&&!_0x1b1e92[_0xb79b8c(0x23c)]),_0x5b369c=_0x44db28['length'],_0x2291eb=_0x1912e0[_0xb79b8c(0x253)],_0x505477=_0x5b369c>_0x2291eb?'\x20('+_0x5b369c+_0xb79b8c(0x288):'';console[_0xb79b8c(0x29c)]('\x0aPull\x20summary:'),console['error']('\x20\x20'+a25_0x341266['cyan'](_0x2291eb+'\x20journeys')+a25_0x341266[_0xb79b8c(0x2b3)](_0x505477)),console[_0xb79b8c(0x29c)]('\x20\x20'+a25_0x341266[_0xb79b8c(0x283)]('+\x20'+_0x5e59f5[_0xb79b8c(0x2a9)]+_0xb79b8c(0x200))),console['error']('\x20\x20'+a25_0x341266[_0xb79b8c(0x22e)]('~\x20'+_0x98fd30[_0xb79b8c(0x2a9)]+'\x20changed\x20files')),console[_0xb79b8c(0x29c)]('\x20\x20'+a25_0x341266[_0xb79b8c(0x2b3)]('=\x20'+_0xda0a0f[_0xb79b8c(0x2a9)]+_0xb79b8c(0x2b4))),console[_0xb79b8c(0x29c)]('\x20\x20Target:\x20'+a25_0x341266[_0xb79b8c(0x27a)](_0x160732)+'\x0a');if(_0x98fd30['length']>0x0)for(const _0x356f4d of _0x98fd30){console[_0xb79b8c(0x29c)](_0xb79b8c(0x1c5)+_0x356f4d['relativePath']+'\x27:'),console[_0xb79b8c(0x29c)]('─'[_0xb79b8c(0x1d6)](0x3c)),console['error'](_0x356f4d[_0xb79b8c(0x252)]),console[_0xb79b8c(0x29c)]('─'[_0xb79b8c(0x1d6)](0x3c));}if(_0x1d2194[_0xb79b8c(0x1f7)])return console[_0xb79b8c(0x29c)](a25_0x341266[_0xb79b8c(0x22e)](_0xb79b8c(0x26b))),0x0;if(_0x5e59f5[_0xb79b8c(0x2a9)]===0x0&&_0x98fd30['length']===0x0)return console[_0xb79b8c(0x29c)](a25_0x341266['green'](_0xb79b8c(0x1c8))),saveSessionContext({'parent_segment':_0xfd3e28},_0x1d2194['session']),console[_0xb79b8c(0x29c)](a25_0x341266[_0xb79b8c(0x283)](_0xb79b8c(0x1dd)+a25_0x341266[_0xb79b8c(0x2b3)](_0xb79b8c(0x280))+'\x20=\x20'+a25_0x341266['cyan'](_0xfd3e28))),0x0;if(!_0x1d2194['yes']&&(_0x5e59f5[_0xb79b8c(0x2a9)]>0x0||_0x98fd30[_0xb79b8c(0x2a9)]>0x0)){if(!isInteractive())return console['error'](a25_0x341266['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0xb79b8c(0x29c)](a25_0x341266['dim'](_0xb79b8c(0x1f0))),0x1;const _0x222855=await confirmKey(_0xb79b8c(0x236)+(_0x5e59f5[_0xb79b8c(0x2a9)]+_0x98fd30[_0xb79b8c(0x2a9)])+'\x20files?');if(!_0x222855)return console[_0xb79b8c(0x29c)](a25_0x341266[_0xb79b8c(0x22e)](_0xb79b8c(0x239)),_0xb79b8c(0x246)),0x1;}!existsSync(_0x160732)&&mkdirSync(_0x160732,{'recursive':!![]});const _0x3c447d=a25_0x4921f9[_0xb79b8c(0x293)](_0x160732,_0xb79b8c(0x281));writeFileSync(_0x3c447d,createTdxConfigContent(_0xfd3e28),'utf-8');for(const _0x68e6cf of _0xe689f0){(_0x68e6cf[_0xb79b8c(0x21f)]||_0x68e6cf[_0xb79b8c(0x23c)])&&writeFileSync(_0x68e6cf[_0xb79b8c(0x254)],_0x68e6cf[_0xb79b8c(0x27c)],_0xb79b8c(0x29e));}return console[_0xb79b8c(0x29c)](a25_0x341266[_0xb79b8c(0x283)]('✔\x20Pulled\x20'+(_0x5e59f5[_0xb79b8c(0x2a9)]+_0x98fd30[_0xb79b8c(0x2a9)])+_0xb79b8c(0x24e)+_0x160732)),saveSessionContext({'parent_segment':_0xfd3e28},_0x1d2194[_0xb79b8c(0x231)]),console['error'](a25_0x341266['green'](_0xb79b8c(0x1dd)+a25_0x341266[_0xb79b8c(0x2b3)]('parent_segment')+'\x20=\x20'+a25_0x341266[_0xb79b8c(0x27a)](_0xfd3e28))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a25_0x3a3145(0x1e7)]=a25_0x3a3145(0x22c);['description']=a25_0x3a3145(0x279);async[a25_0x3a3145(0x22b)](_0x2eba3e){const _0xcc1318=a25_0x3a3145,{options:_0x3ed4dd,args:_0x413806,tdx:_0x1acb30}=_0x2eba3e,_0x274287=_0x413806[0x0];if(!requireNameOrPath(_0x274287))return 0x1;_0x3ed4dd[_0xcc1318(0x222)]&&console[_0xcc1318(0x29c)](_0xcc1318(0x22d)+_0x274287);const {journeyId:_0x2ba999}=await resolveJourneyIdFromInput(_0x274287,_0x3ed4dd,_0x1acb30),_0x2f338f=await withSpinner(_0xcc1318(0x230),()=>_0x1acb30['journey'][_0xcc1318(0x244)](_0x2ba999),{'verbose':_0x3ed4dd['verbose']}),_0x21b3cd=_0x2f338f['data'];return console['log']('Database:\x20'+_0x21b3cd[_0xcc1318(0x1d3)]),console['log'](_0xcc1318(0x25f)+_0x21b3cd['table']),await handleSDKOutput(_0x21b3cd[_0xcc1318(0x1d1)],_0x3ed4dd),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a25_0x3a3145(0x1e7)]='journey:activations';[a25_0x3a3145(0x2b7)]=a25_0x3a3145(0x259);async['execute'](_0x1a9613){const _0x1f2104=a25_0x3a3145,{options:_0x5a3f7d,args:_0x5520b8,tdx:_0x1b6119}=_0x1a9613,_0xed3f0e=_0x5520b8[0x0];if(!requireNameOrPath(_0xed3f0e))return 0x1;_0x5a3f7d[_0x1f2104(0x222)]&&console[_0x1f2104(0x29c)](_0x1f2104(0x22d)+_0xed3f0e);const {journeyId:_0x306753}=await resolveJourneyIdFromInput(_0xed3f0e,_0x5a3f7d,_0x1b6119),_0x4f21a9=await withSpinner(_0x1f2104(0x1d8),()=>_0x1b6119[_0x1f2104(0x251)][_0x1f2104(0x265)](_0x306753),{'verbose':_0x5a3f7d[_0x1f2104(0x222)]}),_0x4e6e21=_0x4f21a9[_0x1f2104(0x258)];return console[_0x1f2104(0x29c)](_0x1f2104(0x1d4)+_0x4e6e21[_0x1f2104(0x2a9)]+_0x1f2104(0x242)+(_0x4e6e21[_0x1f2104(0x2a9)]!==0x1?'s':'')),await handleSDKOutput(_0x4e6e21,_0x5a3f7d),0x0;}}export class JourneyPushCommand extends BaseCommand{[a25_0x3a3145(0x1e7)]=a25_0x3a3145(0x273);[a25_0x3a3145(0x2b7)]=a25_0x3a3145(0x1f2);['segmentPushCommand']=new SegmentPushCommand();async['execute'](_0x5b9d6a){const _0xb3e88e=a25_0x3a3145,_0x321c05=_0x5b9d6a[_0xb3e88e(0x28b)][0x0];let _0x3a72d1;if(_0x321c05){const _0x446dfb=await resolveTarget({'arg':_0x321c05,'contextParent':_0x5b9d6a[_0xb3e88e(0x227)][_0xb3e88e(0x298)],'cwd':process[_0xb3e88e(0x229)]()});isSuccessfulResolution(_0x446dfb)&&_0x446dfb[_0xb3e88e(0x218)]==='file'&&(_0x3a72d1=_0x446dfb[_0xb3e88e(0x264)]);}const _0x2c49fb={..._0x5b9d6a,'options':{..._0x5b9d6a['options'],'journeysOnly':!![],..._0x3a72d1&&{'singleFilePath':_0x3a72d1}}};return this['segmentPushCommand'][_0xb3e88e(0x22b)](_0x2c49fb);}}export class JourneyVersionsCommand extends BaseCommand{[a25_0x3a3145(0x1e7)]='journey:versions';[a25_0x3a3145(0x2b7)]=a25_0x3a3145(0x20c);async['execute'](_0x354874){const _0x2f69da=a25_0x3a3145,{options:_0x5a718c,args:_0x4571a4,tdx:_0xebfae5}=_0x354874,_0x2c06f9=_0x4571a4[0x0];if(!requireNameOrPath(_0x2c06f9))return 0x1;if(_0x5a718c['verbose'])console[_0x2f69da(0x29c)](_0x2f69da(0x22d)+_0x2c06f9);const {journeyId:_0x46247b}=await resolveJourneyIdFromInput(_0x2c06f9,_0x5a718c,_0xebfae5),_0x423007=await withSpinner('Listing\x20journey\x20versions...',()=>_0xebfae5[_0x2f69da(0x251)][_0x2f69da(0x291)](_0x46247b),{'verbose':_0x5a718c[_0x2f69da(0x222)]}),{bundleName:_0x3914d4,versions:_0x4451f2,latestJourneyId:_0x4f9ce8}=_0x423007['data'];console[_0x2f69da(0x29c)](_0x3914d4+':\x20'+_0x4451f2[_0x2f69da(0x2a9)]+_0x2f69da(0x290)+(_0x4451f2[_0x2f69da(0x2a9)]!==0x1?'s':''));const _0x58d5b6=_0x4451f2['map'](_0x373134=>({'version':_0x373134[_0x2f69da(0x24a)],'journey_id':_0x373134[_0x2f69da(0x269)],'name':_0x373134['name'],'state':_0x373134[_0x2f69da(0x23a)],'paused':_0x373134['paused'],'latest':_0x373134[_0x2f69da(0x269)]===_0x4f9ce8,'created_at':_0x373134['createdAt']}));return await handleSDKOutput(_0x58d5b6,_0x5a718c),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a25_0x3a3145(0x1e7)]=a25_0x3a3145(0x207);[a25_0x3a3145(0x2b7)]='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a25_0x3a3145(0x22b)](_0x1dd191){const _0x508982=a25_0x3a3145,{options:_0x136799,args:_0x6802e5,tdx:_0x32cf68}=_0x1dd191,_0x70e88a=_0x6802e5[0x0];if(!requireNameOrPath(_0x70e88a))return 0x1;if(_0x136799[_0x508982(0x222)])console[_0x508982(0x29c)](_0x508982(0x22d)+_0x70e88a);const {journeyId:_0x3b623f,journeyName:_0x4436df}=await resolveJourneyIdFromInput(_0x70e88a,_0x136799,_0x32cf68);if(!_0x136799[_0x508982(0x2b5)]){const _0x586cdb=await confirm(_0x508982(0x278)+_0x4436df+'\x22?');if(!_0x586cdb)return console['error'](_0x508982(0x1ec)),0x0;}const _0x280867=await withSpinner('Creating\x20new\x20version...',()=>_0x32cf68['journey'][_0x508982(0x249)](_0x3b623f),{'verbose':_0x136799['verbose']}),_0x2c30c8=_0x280867[_0x508982(0x258)];return console['error'](a25_0x341266['green']('✔')+_0x508982(0x261)+_0x2c30c8['attributes'][_0x508982(0x24a)]+_0x508982(0x1fe)+_0x2c30c8[_0x508982(0x248)][_0x508982(0x1e7)]+'\x22'),console[_0x508982(0x29c)]('\x20\x20Journey\x20ID:\x20'+_0x2c30c8['id']),await handleSingleObjectOutput({'id':_0x2c30c8['id'],'name':_0x2c30c8['attributes'][_0x508982(0x1e7)],'version':_0x2c30c8[_0x508982(0x248)][_0x508982(0x24a)],'state':_0x2c30c8['attributes']['state'],'bundle_id':_0x2c30c8[_0x508982(0x248)][_0x508982(0x1f9)],'created_at':_0x2c30c8[_0x508982(0x248)]['createdAt']},_0x136799),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a25_0x3a3145(0x1e7)]=a25_0x3a3145(0x1e4);['description']=a25_0x3a3145(0x224);async[a25_0x3a3145(0x22b)](_0x5bb711){const _0x2af271=a25_0x3a3145,{options:_0x5f06f2,args:_0x2d2242,tdx:_0x4355e9}=_0x5bb711,_0x31c446=_0x2d2242[0x0];if(!requireNameOrPath(_0x31c446))return 0x1;const _0x1ce0c6=_0x5f06f2[_0x2af271(0x285)];if(!_0x1ce0c6)return console[_0x2af271(0x29c)]('Error:\x20--version\x20option\x20is\x20required'),console[_0x2af271(0x29c)](_0x2af271(0x21d)),0x1;const _0x352607=parseInt(_0x1ce0c6,0xa);if(isNaN(_0x352607)||_0x352607<0x1)return console[_0x2af271(0x29c)](_0x2af271(0x24f)+_0x1ce0c6),0x1;if(_0x5f06f2[_0x2af271(0x222)])console[_0x2af271(0x29c)](_0x2af271(0x22d)+_0x31c446+',\x20version:\x20'+_0x352607);const {journeyId:_0x359386,parentSegmentId:_0x57457f}=await resolveJourneyIdFromInput(_0x31c446,_0x5f06f2,_0x4355e9),_0x51c479=await withSpinner(_0x2af271(0x2be),()=>_0x4355e9[_0x2af271(0x251)][_0x2af271(0x291)](_0x359386),{'verbose':_0x5f06f2[_0x2af271(0x222)]}),{versions:_0x4b7f7b,latestJourneyId:_0xc3affe}=_0x51c479[_0x2af271(0x258)],_0x51dfeb=_0x4b7f7b[_0x2af271(0x257)](_0x58ef40=>_0x58ef40[_0x2af271(0x24a)]===_0x352607);if(!_0x51dfeb){const _0x107eb9=_0x4b7f7b[_0x2af271(0x289)](_0x18c653=>'v'+_0x18c653[_0x2af271(0x24a)])[_0x2af271(0x293)](',\x20');return console[_0x2af271(0x29c)](_0x2af271(0x2bb)+_0x352607+_0x2af271(0x1cd)+_0x107eb9),0x1;}const _0x2c1032=await withSpinner('Getting\x20version\x20'+_0x352607+'\x20details...',()=>_0x4355e9[_0x2af271(0x251)][_0x2af271(0x28d)](_0x51dfeb['journeyId']),{'verbose':_0x5f06f2[_0x2af271(0x222)]}),_0xe98bcf=_0x2c1032['data'],_0x56eb=getConsoleNextUrl(_0x5f06f2[_0x2af271(0x1fa)],'/app/ps/'+_0x57457f+_0x2af271(0x1c9)+_0x51dfeb[_0x2af271(0x269)]+'/j/da/je');return await handleSingleObjectOutput({'id':_0xe98bcf['id'],'name':_0xe98bcf['attributes'][_0x2af271(0x1e7)],'version':_0xe98bcf[_0x2af271(0x248)][_0x2af271(0x24a)],'description':_0xe98bcf[_0x2af271(0x248)][_0x2af271(0x2b7)],'state':_0xe98bcf[_0x2af271(0x248)][_0x2af271(0x23a)],'paused':_0xe98bcf[_0x2af271(0x248)][_0x2af271(0x268)],'reentry_mode':_0xe98bcf['attributes']['reentryMode'],'stages':_0xe98bcf[_0x2af271(0x248)][_0x2af271(0x1ef)]?.[_0x2af271(0x2a9)]||0x0,..._0xe98bcf['attributes'][_0x2af271(0x221)]&&{'goal':_0xe98bcf[_0x2af271(0x248)][_0x2af271(0x221)][_0x2af271(0x1e7)]},'latest':_0x51dfeb[_0x2af271(0x269)]===_0xc3affe,'created_at':_0xe98bcf[_0x2af271(0x248)]['createdAt'],'updated_at':_0xe98bcf[_0x2af271(0x248)]['updatedAt'],'url':_0x56eb},_0x5f06f2),0x0;}}
1
+ const a26_0x35994b=a26_0x5e8e;(function(_0x54dd46,_0x2055b7){const _0x3c644a=a26_0x5e8e,_0x52c9c8=_0x54dd46();while(!![]){try{const _0x1b42c5=parseInt(_0x3c644a(0x235))/0x1*(parseInt(_0x3c644a(0x26c))/0x2)+parseInt(_0x3c644a(0x247))/0x3*(-parseInt(_0x3c644a(0x1a1))/0x4)+-parseInt(_0x3c644a(0x1ea))/0x5+-parseInt(_0x3c644a(0x246))/0x6+parseInt(_0x3c644a(0x223))/0x7+-parseInt(_0x3c644a(0x1b9))/0x8+parseInt(_0x3c644a(0x27a))/0x9;if(_0x1b42c5===_0x2055b7)break;else _0x52c9c8['push'](_0x52c9c8['shift']());}catch(_0x3ed4ff){_0x52c9c8['push'](_0x52c9c8['shift']());}}}(a26_0x3db2,0x25ebc));import a26_0x44a323 from'chalk';import a26_0x2d0323 from'path';function a26_0x5e8e(_0x104021,_0x313915){_0x104021=_0x104021-0x183;const _0x3db2ef=a26_0x3db2();let _0x5e8eea=_0x3db2ef[_0x104021];return _0x5e8eea;}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';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';function a26_0x3db2(){const _0x462574=['-\x20no\x20files\x20written','log','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)','push','goalSize','\x20(ID:\x20','List\x20activations\x20for\x20a\x20journey','localeCompare','704900htXpQB','(archived)','red','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','activationParams','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','renderStats','folderPath','✔\x20Journey\x20\x22','completed','journey:pause','getStatistics','Pause\x20a\x20running\x20journey','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','journeyId','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','filter','Aborted.','12WqiZqy','root\x20folder','Parent\x20segment:\x20','Table:\x20','folders','base','\x20->\x20','(running)','goal','updatedAt','rule','✔\x20All\x20files\x20are\x20up\x20to\x20date','buildIdToEmailMap','map','\x20=\x20','version','journey:push','24396TBCfze','6822fNhsIk','Getting\x20journey\x20statistics...','journey:traffic','length','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','/e/','journeyName','\x20\x20Parent\x20segment:\x20','\x20new\x20files','relativePath','segmentName','dryRun','size','createdAt','journey:versions','Error:\x20Invalid\x20version\x20number:\x20','(root)','\x20\x20Consolidating\x20duplicate\x20segment:\x20','yes','jsonl','\x20journey\x20files\x20to\x20','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','/app/ps/','INVALID_ARGUMENT','Show\x20journey\x20statistics','session','tsv','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','parentName','journey:pull','listVersions','...','listActivationsFlat','set','name','segments','23246XRMltt','database','Target\x20directory:\x20','\x20\x20Name:\x20','getTrafficData','stage','Getting\x20column\x20mapping...','hasChanges','Target\x20file:\x20','resolveParentId','View\x20a\x20specific\x20version\x20of\x20a\x20journey','Journey\x20name:\x20','has','content','2019771yixPwh','completionRate','listJourneysWithFolders','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','table','toLowerCase','json','Fetching\x20users\x20and\x20connections...','helpText','attributes','user','createVersion','split','\x20\x20Statistics\x20not\x20available','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','exitOrJumpRate','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','(completed)','file','Write\x20','getJourney','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','getActivation','Resolving\x20parent\x20segment...','from','📁\x20','test','bold','Fetching\x20','kind','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','\x22\x20resumed','Fetching\x20parent\x20segment...','verbose','Error:\x20Invalid\x20--type\x20\x22','\x20\x20Preserving\x20local\x20segment\x20name:\x20','limit','history','/j/da/je','activation_','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','Getting\x20journey\x20traffic\x20data...','message','yellow','\x22\x20not\x20found','getColumnMapping','paused',',\x20version:\x20','description','Options:','journeyBundleName','state','filePath','journey:stats','Resuming\x20journey...','380KLjNxt','\x20\x20Folder\x20path:\x20','error','Error:\x20Version\x20','versionNumber','entries','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','blue','site','resolveJourneyId','listJourneysFromParentSegment','(paused)','\x20versions)','options','folderId','nodes','green','List\x20all\x20versions\x20of\x20a\x20journey','data','cwd','journeys','✔\x20Found\x20','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','getParentFull','165752wzYHlN','journey:version:create','format','resume','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Getting\x20version\x20','audienceId','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','journeyBundleId','segmentPushCommand','setPhase','Resolved\x20YAML\x20file:\x20','diff','Export\x20journey(s)\x20as\x20YAML\x20files','\x20\x20Target:\x20','milestoneSize','activation','Database:\x20','segment','\x20changed\x20files','stringify','Input:\x20','connection','includeHistory','find','\x20activation','archived','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','Listing\x20journey\x20versions...','Cancelled','\x20version','relative','web','journey:activations','replace','listFolders','.yml','journey','get','launched','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20journeys','✔\x20Pulled\x20','\x20unchanged\x20files','Warning:\x20Could\x20not\x20resolve\x20segment\x20','Error:\x20Parent\x20segment\x20context\x20required','journey:resume','journeyStages','all','342280WLXgZR','add','repeat','List\x20journeys\x20in\x20current\x20context','No\x20journeys\x20found','buildIdToNameMap','pause','execute','utf-8','Found\x20','targetDir','reentryMode','conversion','join','journey:list','\x20files?','Show\x20journey\x20table\x20column\x20mapping','absolutePath','\x0aError:','\x20details...','No\x20statistics\x20available\x20for\x20journey:\x20','exitOrJumpSize','\x20Opening\x20','stages','cyan','columns','journey:version:view','Fetching\x20journeys\x20and\x20folders...','isNew','Available\x20stages:\x20','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','\x0aPull\x20summary:','getSegment','Resume\x20a\x20paused\x20journey','dim','parent_segment','then','Getting\x20journey\x20details...','Error:\x20Journey\x20\x27','Listing\x20journeys...','enteredSize','parentSegment','\x20\x20-\x20','sort','✔\x20Context\x20set:\x20','values','tdx.json','connector_config','type'];a26_0x3db2=function(){return _0x462574;};return a26_0x3db2();}import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x18061b){const _0x409fe5=a26_0x5e8e;return!_0x18061b&&(console[_0x409fe5(0x1a3)](_0x409fe5(0x1d4)),console[_0x409fe5(0x1a3)](_0x409fe5(0x25d))),!!_0x18061b;}function withJsonFormat(_0x39e951){const _0x3c2070=a26_0x5e8e;if(!_0x39e951['format']&&!_0x39e951[_0x3c2070(0x280)]&&!_0x39e951[_0x3c2070(0x25a)]&&!_0x39e951[_0x3c2070(0x262)])return{..._0x39e951,'format':_0x3c2070(0x280),'json':!![]};return _0x39e951;}function formatJourneyState(_0x17e303){const _0xacd23c=a26_0x5e8e;switch(_0x17e303){case _0xacd23c(0x1e0):return a26_0x44a323[_0xacd23c(0x1b1)](_0xacd23c(0x23c));case'draft':return a26_0x44a323['dim']('(draft)');case _0xacd23c(0x198):return a26_0x44a323[_0xacd23c(0x195)](_0xacd23c(0x1ac));case _0xacd23c(0x22c):return a26_0x44a323[_0xacd23c(0x1a8)](_0xacd23c(0x28b));case _0xacd23c(0x1d3):return a26_0x44a323[_0xacd23c(0x20c)](_0xacd23c(0x224));default:return'('+_0x17e303+')';}}function formatJourneyItem(_0x4b2834,_0x493776='',_0x181b83){const _0x5ea5c3=a26_0x5e8e,_0x1abe7c=formatJourneyState(_0x4b2834[_0x5ea5c3(0x19d)]),_0x35c513=_0x181b83?hyperlink(_0x4b2834[_0x5ea5c3(0x19c)],_0x181b83):_0x4b2834['journeyBundleName'];return _0x493776+'🗺️\x20'+_0x35c513+'\x20'+_0x1abe7c;}function escapeRegex(_0x238bc4){const _0x3d1584=a26_0x5e8e;return _0x238bc4[_0x3d1584(0x1db)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}function globToRegex(_0x351dce){const _0x362e25=a26_0x5e8e,_0x1af23b=_0x351dce[_0x362e25(0x286)]('*')[_0x362e25(0x242)](escapeRegex);return new RegExp(_0x1af23b[_0x362e25(0x1f7)]('.*'),'i');}function buildRuleToNameMapping(_0x456f58){const _0x1b9ed8=a26_0x5e8e,_0x8bf5d0=new Map();if(_0x456f58[_0x1b9ed8(0x26b)])for(const [_0x2e2e45,_0x1e69eb]of Object[_0x1b9ed8(0x1a6)](_0x456f58[_0x1b9ed8(0x26b)])){if(_0x1e69eb[_0x1b9ed8(0x23f)]){const _0x372e7e=serializeRule(_0x1e69eb[_0x1b9ed8(0x23f)]),_0x39b160=_0x8bf5d0['get'](_0x372e7e);_0x39b160?_0x39b160['push'](_0x2e2e45):_0x8bf5d0[_0x1b9ed8(0x269)](_0x372e7e,[_0x2e2e45]);}}return _0x8bf5d0;}async function resolveJourneyIdFromInput(_0x1b2cf2,_0x3b4ff0,_0x2accc7){const _0x136c29=a26_0x5e8e,_0x3e302c=await resolveJourneyTarget(_0x1b2cf2,_0x3b4ff0[_0x136c29(0x213)],_0x3b4ff0[_0x136c29(0x18b)]),_0x2c4a1e=_0x3e302c[_0x136c29(0x213)];if(!_0x2c4a1e)throw new SDKError(ErrorCode[_0x136c29(0x25f)],_0x136c29(0x230));const _0x2ecdf7=await withSpinner(_0x136c29(0x291),()=>_0x2accc7[_0x136c29(0x1cb)][_0x136c29(0x275)](_0x2c4a1e),{'verbose':_0x3b4ff0[_0x136c29(0x18b)]}),_0x302c27=_0x2ecdf7[_0x136c29(0x1b3)],_0x298794=await withSpinner('Resolving\x20journey...',()=>_0x2accc7[_0x136c29(0x1de)][_0x136c29(0x1aa)](_0x302c27,_0x3e302c[_0x136c29(0x24d)]),{'verbose':_0x3b4ff0[_0x136c29(0x18b)]});return{'journeyId':_0x298794[_0x136c29(0x1b3)],'journeyName':_0x3e302c[_0x136c29(0x24d)],'parentSegmentId':_0x302c27};}async function resolveJourneyTarget(_0x12aa2d,_0x39ebed,_0x516124){const _0x1aebea=a26_0x5e8e;if(isYamlFilePath(_0x12aa2d))try{const _0x4adc50=await resolveYamlFilePath(_0x12aa2d);return _0x516124&&(console[_0x1aebea(0x1a3)](_0x1aebea(0x1c4)+_0x12aa2d),console['error'](_0x1aebea(0x24e)+_0x4adc50['parentSegment']),console['error'](_0x1aebea(0x26f)+_0x4adc50[_0x1aebea(0x251)]),console['error'](_0x1aebea(0x1a2)+(_0x4adc50[_0x1aebea(0x22a)]||_0x1aebea(0x257)))),{'journeyName':_0x4adc50[_0x1aebea(0x251)],'parentSegment':_0x4adc50[_0x1aebea(0x213)],'resolved':_0x4adc50};}catch(_0x582e60){throw new SDKError(ErrorCode[_0x1aebea(0x25f)],_0x1aebea(0x27d)+_0x582e60[_0x1aebea(0x194)]);}if(!_0x39ebed)throw new SDKError(ErrorCode[_0x1aebea(0x25f)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x12aa2d,'parentSegment':_0x39ebed};}export class JourneyListCommand extends BaseCommand{['name']=a26_0x35994b(0x1f8);['description']=a26_0x35994b(0x1ed);async[a26_0x35994b(0x1f1)](_0x14199f){const _0x5b0300=a26_0x35994b,{options:_0x452b1f,args:_0x1d0cab,tdx:_0x36a18d}=_0x14199f,_0x258c18=_0x1d0cab[0x0],_0x387bd0=_0x452b1f[_0x5b0300(0x213)];if(!_0x387bd0)return console[_0x5b0300(0x1a3)](_0x5b0300(0x1e6)),console[_0x5b0300(0x1a3)](_0x5b0300(0x226)),0x1;const _0x3f55ed=await withSpinner(_0x5b0300(0x291),()=>_0x36a18d[_0x5b0300(0x1cb)][_0x5b0300(0x275)](_0x387bd0),{'verbose':_0x452b1f[_0x5b0300(0x18b)]}),_0x35cb21=_0x3f55ed[_0x5b0300(0x1b3)];_0x452b1f[_0x5b0300(0x18b)]&&(console[_0x5b0300(0x1a3)]('Parent\x20segment:\x20'+_0x387bd0+_0x5b0300(0x220)+_0x35cb21+')'),_0x258c18&&console[_0x5b0300(0x1a3)]('Pattern:\x20'+_0x258c18));const _0x2acc1f=await withSpinner(_0x5b0300(0x18a),()=>_0x36a18d['segment'][_0x5b0300(0x1b8)](_0x35cb21),{'verbose':_0x452b1f[_0x5b0300(0x18b)]}),_0xfbbf92=_0x2acc1f['data'],_0x3ffeda=_0xfbbf92['rootFolderId'],_0x2fcc93=await withSpinner(_0x5b0300(0x211),()=>_0x36a18d[_0x5b0300(0x1de)][_0x5b0300(0x27c)](_0x35cb21,_0x3ffeda),{'verbose':_0x452b1f[_0x5b0300(0x18b)]});let _0x14843e=_0x2fcc93[_0x5b0300(0x1b3)][_0x5b0300(0x1b5)];const _0x932322=_0x2fcc93[_0x5b0300(0x1b3)][_0x5b0300(0x239)],_0x3959aa=new Map();for(const _0x1b68a0 of _0x932322){_0x3959aa[_0x5b0300(0x269)](_0x1b68a0['id'],_0x1b68a0[_0x5b0300(0x26a)]);}if(_0x258c18){const _0xc25fd=globToRegex(_0x258c18);_0x14843e=_0x14843e[_0x5b0300(0x233)](_0x233682=>_0xc25fd[_0x5b0300(0x184)](_0x233682[_0x5b0300(0x19c)]));}console[_0x5b0300(0x1a3)](_0x5b0300(0x1b6)+_0x14843e[_0x5b0300(0x24a)]+'\x20journey'+(_0x14843e[_0x5b0300(0x24a)]!==0x1?'s':''));const _0x4e0bc6=_0x1d6a1d=>{const _0x31bff7=_0x5b0300;return getConsoleNextUrl(_0x452b1f[_0x31bff7(0x1a9)],'/app/ps/'+_0x35cb21+_0x31bff7(0x24c)+_0x1d6a1d+'/j/da');};if(_0x452b1f[_0x5b0300(0x1bb)]===_0x5b0300(0x27e))await handleSDKOutput(_0x14843e,_0x452b1f);else{if(_0x452b1f[_0x5b0300(0x1bb)]===_0x5b0300(0x280)){const _0x163bbc=_0x14843e[_0x5b0300(0x242)](_0x4a1c03=>({..._0x4a1c03,'url':_0x4e0bc6(_0x4a1c03['id'])}));await handleSDKOutput(_0x163bbc,_0x452b1f);}else{console[_0x5b0300(0x21c)]('['+_0x387bd0+']');const _0x1d5d95=new Map(),_0x466993=[];for(const _0x497130 of _0x14843e){if(!_0x497130[_0x5b0300(0x1af)]||_0x497130['folderId']===_0x3ffeda)_0x466993['push'](_0x497130);else{const _0x4d083e=_0x1d5d95[_0x5b0300(0x1df)](_0x497130['folderId'])||[];_0x4d083e[_0x5b0300(0x21e)](_0x497130),_0x1d5d95[_0x5b0300(0x269)](_0x497130[_0x5b0300(0x1af)],_0x4d083e);}}const _0x553586=(_0x34a4f9,_0xe3cd31)=>_0x34a4f9[_0x5b0300(0x19c)]['localeCompare'](_0xe3cd31[_0x5b0300(0x19c)],undefined,{'sensitivity':_0x5b0300(0x23a)});_0x466993[_0x5b0300(0x215)](_0x553586);for(const _0x160022 of _0x466993){console['log'](formatJourneyItem(_0x160022,'',_0x4e0bc6(_0x160022['id'])));}const _0x3283ac=[..._0x1d5d95[_0x5b0300(0x1a6)]()][_0x5b0300(0x215)]((_0x342e17,_0x23f655)=>{const _0x3c12e0=_0x5b0300,_0x3a763a=_0x3959aa['get'](_0x342e17[0x0])||_0x342e17[0x0],_0x27206b=_0x3959aa[_0x3c12e0(0x1df)](_0x23f655[0x0])||_0x23f655[0x0];return _0x3a763a[_0x3c12e0(0x222)](_0x27206b,undefined,{'sensitivity':_0x3c12e0(0x23a)});});for(const [_0x2fa270,_0x3666f7]of _0x3283ac){const _0x52c196=_0x3959aa[_0x5b0300(0x1df)](_0x2fa270)||_0x2fa270;console[_0x5b0300(0x21c)](_0x5b0300(0x183)+_0x52c196),_0x3666f7['sort'](_0x553586);for(const _0x311264 of _0x3666f7){console['log'](formatJourneyItem(_0x311264,'\x20\x20',_0x4e0bc6(_0x311264['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a26_0x35994b(0x26a)]='journey:view';[a26_0x35994b(0x19a)]='Show\x20journey\x20details';async[a26_0x35994b(0x1f1)](_0x4a8395){const _0x468f79=a26_0x35994b,{options:_0x3f79a8,args:_0x1a1b4f,tdx:_0x47b7a5}=_0x4a8395,_0x5b0fd5=_0x1a1b4f[0x0];if(!_0x5b0fd5)return console[_0x468f79(0x1a3)](_0x468f79(0x1d4)),console[_0x468f79(0x1a3)](_0x468f79(0x1bd)),console[_0x468f79(0x1a3)](_0x468f79(0x19b)),console[_0x468f79(0x1a3)]('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x3f79a8[_0x468f79(0x18b)]&&console[_0x468f79(0x1a3)](_0x468f79(0x1ce)+_0x5b0fd5);const {journeyId:_0x3b23e6,parentSegmentId:_0x441c9e}=await resolveJourneyIdFromInput(_0x5b0fd5,_0x3f79a8,_0x47b7a5);if(_0x3f79a8[_0x468f79(0x1d9)]){const _0x547399=getConsoleNextUrl(_0x3f79a8[_0x468f79(0x1a9)],'/app/ps/'+_0x441c9e+_0x468f79(0x24c)+_0x3b23e6+_0x468f79(0x190));return console[_0x468f79(0x1a3)](a26_0x44a323[_0x468f79(0x1b1)]('✔')+_0x468f79(0x200)+a26_0x44a323[_0x468f79(0x202)](_0x547399)),openBrowser(_0x547399),0x0;}const _0xafaad8=await withSpinner(_0x468f79(0x20f),()=>_0x47b7a5['journey'][_0x468f79(0x28e)](_0x3b23e6),{'verbose':_0x3f79a8[_0x468f79(0x18b)]}),_0x204248=_0xafaad8[_0x468f79(0x1b3)],_0x171721=_0x3f79a8['includeStats'];let _0x291ea1;if(_0x171721)try{const _0xd2680a=await withSpinner(_0x468f79(0x248),()=>_0x47b7a5[_0x468f79(0x1de)][_0x468f79(0x22e)](_0x3b23e6),{'verbose':_0x3f79a8['verbose']});_0x291ea1=_0xd2680a[_0x468f79(0x1b3)];}catch{_0x3f79a8[_0x468f79(0x18b)]&&console['error'](_0x468f79(0x287));}const _0x427081=getConsoleNextUrl(_0x3f79a8[_0x468f79(0x1a9)],_0x468f79(0x25e)+_0x441c9e+'/e/'+_0x3b23e6+_0x468f79(0x190)),_0x51e095={'id':_0x204248['id'],'name':_0x204248[_0x468f79(0x283)]['name'],'description':_0x204248[_0x468f79(0x283)][_0x468f79(0x19a)],'state':_0x204248[_0x468f79(0x283)][_0x468f79(0x19d)],'paused':_0x204248[_0x468f79(0x283)][_0x468f79(0x198)],'reentry_mode':_0x204248[_0x468f79(0x283)][_0x468f79(0x1f5)],'stages':_0x204248[_0x468f79(0x283)][_0x468f79(0x1e8)]?.['length']||0x0,..._0x204248[_0x468f79(0x283)]['goal']&&{'goal':_0x204248['attributes'][_0x468f79(0x23d)]['name']},..._0x291ea1&&{'statistics':{'size':_0x291ea1[_0x468f79(0x253)],'entered':_0x291ea1['enteredSize'],'goal_achieved':_0x291ea1[_0x468f79(0x21f)],'completion_rate':_0x291ea1[_0x468f79(0x27b)],'exit_or_jump':_0x291ea1[_0x468f79(0x1ff)],'exit_or_jump_rate':_0x291ea1['exitOrJumpRate'],'stages':_0x291ea1[_0x468f79(0x201)]}},'url':_0x427081};return await handleSingleObjectOutput(_0x51e095,_0x3f79a8),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a26_0x35994b(0x26a)]=a26_0x35994b(0x19f);[a26_0x35994b(0x19a)]=a26_0x35994b(0x260);async['execute'](_0x383239){const _0x4405a2=a26_0x35994b,{options:_0x34a498,args:_0x9f1312,tdx:_0x7ea5dc}=_0x383239,_0x5a052b=_0x9f1312[0x0];if(!requireNameOrPath(_0x5a052b))return 0x1;_0x34a498[_0x4405a2(0x18b)]&&console[_0x4405a2(0x1a3)]('Input:\x20'+_0x5a052b);const _0x351cc0=_0x34a498,_0x5272b8=_0x351cc0[_0x4405a2(0x292)],_0x1ae882=_0x351cc0['to'],_0x4f7a3e=_0x351cc0[_0x4405a2(0x1d0)],_0x5ccb12=_0x351cc0[_0x4405a2(0x271)];_0x4f7a3e&&!_0x5272b8&&!_0x1ae882&&console[_0x4405a2(0x1a3)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0xdc255a=_0x4f7a3e?withJsonFormat(_0x34a498):_0x34a498,{journeyId:_0x415841,journeyName:_0x4cf1a6}=await resolveJourneyIdFromInput(_0x5a052b,_0xdc255a,_0x7ea5dc),_0x2bb9d5=_0x5272b8||_0x1ae882?{'from':_0x5272b8,'to':_0x1ae882}:undefined,_0x7a307d=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise[_0x4405a2(0x1e9)]([_0x7ea5dc[_0x4405a2(0x1de)][_0x4405a2(0x28e)](_0x415841),_0x7ea5dc[_0x4405a2(0x1de)][_0x4405a2(0x22e)](_0x415841,_0x2bb9d5)]),{'verbose':_0xdc255a[_0x4405a2(0x18b)]}),[_0x45c96c,_0x5b2526]=_0x7a307d['data'];if(!_0x5b2526||_0x5b2526[_0x4405a2(0x231)]===null)return console['error'](_0x4405a2(0x1fe)+_0x4cf1a6),console[_0x4405a2(0x1a3)](_0x4405a2(0x1c0)),0x0;const _0x533a86=buildStageNameMap(_0x45c96c),_0xaea401=!!(_0x2bb9d5&&_0x5b2526['history']?.[_0x4405a2(0x24a)]),_0x30e0cc={'stageNameMap':_0x533a86,'hasPeriod':_0xaea401,'includeHistory':!!_0x4f7a3e};if(_0x5ccb12&&_0x5b2526[_0x4405a2(0x201)]){const _0x5372ac=_0x5b2526[_0x4405a2(0x201)]['find'](_0x5ca5f7=>{const _0x4a254c=_0x4405a2,_0xe409eb=_0x533a86[_0x4a254c(0x1df)](_0x5ca5f7['id'])??'';return _0xe409eb[_0x4a254c(0x27f)]()===_0x5ccb12[_0x4a254c(0x27f)]();});if(_0x5372ac)return await handleSingleObjectOutput(formatStageStats(_0x5372ac,_0x30e0cc),_0xdc255a),0x0;const _0x4b07dc=_0x5b2526[_0x4405a2(0x201)][_0x4405a2(0x242)](_0x480bb7=>_0x533a86[_0x4405a2(0x1df)](_0x480bb7['id'])??_0x480bb7['id']);return console['error']('Error:\x20Stage\x20\x22'+_0x5ccb12+_0x4405a2(0x196)),console[_0x4405a2(0x1a3)](_0x4405a2(0x207)+_0x4b07dc[_0x4405a2(0x1f7)](',\x20')),0x1;}const _0x3bbda1=_0x5b2526[_0x4405a2(0x201)]?.[_0x4405a2(0x242)](_0x4ee3bc=>formatStageStats(_0x4ee3bc,_0x30e0cc)),_0x4a7130=assembleJourneyStats(_0x5b2526,{'from':_0x5272b8,'to':_0x1ae882,'includeHistory':_0x4f7a3e});return await this[_0x4405a2(0x229)](_0x4a7130,_0x3bbda1??[],_0xdc255a),0x0;}async['renderStats'](_0x4a8f5c,_0x388404,_0x2ba3bc){const _0x51347f=a26_0x35994b,_0x1cebc2=_0x2ba3bc[_0x51347f(0x1bb)]==='json'||_0x2ba3bc[_0x51347f(0x1bb)]===_0x51347f(0x25a)||_0x2ba3bc[_0x51347f(0x280)]||_0x2ba3bc[_0x51347f(0x25a)];if(_0x1cebc2){_0x4a8f5c['stages']=_0x388404,await handleSingleObjectOutput(_0x4a8f5c,_0x2ba3bc);return;}await handleSingleObjectOutput(_0x4a8f5c,_0x2ba3bc);for(const _0x4f28c0 of _0x388404){console[_0x51347f(0x21c)](''),console[_0x51347f(0x21c)](String(a26_0x44a323[_0x51347f(0x202)][_0x51347f(0x185)]('['+_0x4f28c0['name']+']'))+a26_0x44a323[_0x51347f(0x20c)]('\x20'+_0x4f28c0['id']));const {id:_0x4cb996,name:_0x1f1bcb,..._0x54d458}=_0x4f28c0;await handleSingleObjectOutput(_0x54d458,_0x2ba3bc);}}}export class JourneyTrafficCommand extends BaseCommand{[a26_0x35994b(0x26a)]=a26_0x35994b(0x249);[a26_0x35994b(0x19a)]=a26_0x35994b(0x25c);async[a26_0x35994b(0x1f1)](_0x4810c4){const _0xd14e72=a26_0x35994b,{options:_0x22cf40,args:_0x552dec,tdx:_0x4f882f}=_0x4810c4,_0x33dc9c=_0x552dec[0x0];if(!requireNameOrPath(_0x33dc9c))return 0x1;_0x22cf40[_0xd14e72(0x18b)]&&console[_0xd14e72(0x1a3)](_0xd14e72(0x1ce)+_0x33dc9c);const _0x4e4952=_0x22cf40,_0x27465a=_0x4e4952[_0xd14e72(0x21a)],_0x11cb17=_0x4e4952['from'],_0x451a66=_0x4e4952['to'],_0x23532e=_0x4e4952[_0xd14e72(0x18e)];if(_0x27465a&&_0x27465a!=='conversion'&&_0x27465a!=='activation')return console['error'](_0xd14e72(0x18c)+_0x27465a+_0xd14e72(0x288)),0x1;const _0xc4d18f=withJsonFormat(_0x22cf40),{journeyId:_0x9b4099,journeyName:_0x2f5547}=await resolveJourneyIdFromInput(_0x33dc9c,_0xc4d18f,_0x4f882f),_0x499e64={'type':_0x27465a,'from':_0x11cb17,'to':_0x451a66,'limit':_0x23532e},_0x3c1208=await withSpinner(_0xd14e72(0x193),()=>_0x4f882f[_0xd14e72(0x1de)][_0xd14e72(0x270)](_0x9b4099,_0x499e64),{'verbose':_0xc4d18f['verbose']}),_0x5cd2f6=_0x3c1208['data'],_0x3d4079=_0x5cd2f6[_0xd14e72(0x1f6)]&&(_0x5cd2f6[_0xd14e72(0x1f6)][_0xd14e72(0x1b0)][_0xd14e72(0x24a)]>0x0||_0x5cd2f6[_0xd14e72(0x1f6)]['links'][_0xd14e72(0x24a)]>0x0),_0xb83c50=_0x5cd2f6[_0xd14e72(0x1c9)]&&_0x5cd2f6[_0xd14e72(0x1c9)][_0xd14e72(0x24a)]>0x0;if(!_0x3d4079&&!_0xb83c50)return console[_0xd14e72(0x1a3)](_0xd14e72(0x188)+_0x2f5547),console[_0xd14e72(0x1a3)](_0xd14e72(0x28f)),_0x11cb17&&_0x451a66&&console[_0xd14e72(0x1a3)](_0xd14e72(0x232)),0x0;return await handleSingleObjectOutput(_0x5cd2f6,_0xc4d18f),0x0;}}function formatStageStats(_0x1ed0b6,_0x171e89){const _0x4280cc=a26_0x35994b,_0x6ac3d2=_0x171e89['hasPeriod']&&_0x1ed0b6['history']?.[_0x4280cc(0x24a)]?aggregateStageHistory(_0x1ed0b6[_0x4280cc(0x18f)]):{'size':_0x1ed0b6[_0x4280cc(0x253)],'entered':_0x1ed0b6[_0x4280cc(0x212)],'milestone':_0x1ed0b6[_0x4280cc(0x1c8)],'milestone_rate':_0x1ed0b6['completeMilestoneRate'],'exit_or_jump':_0x1ed0b6['exitOrJumpSize'],'exit_or_jump_rate':_0x1ed0b6[_0x4280cc(0x289)]},_0xecf233={'id':_0x1ed0b6['id'],'name':_0x171e89['stageNameMap'][_0x4280cc(0x1df)](_0x1ed0b6['id'])??_0x1ed0b6['id'],..._0x6ac3d2};return _0x171e89['hasPeriod']&&_0x171e89['includeHistory']&&_0x1ed0b6['history']&&(_0xecf233['history']=_0x1ed0b6['history']),_0xecf233;}export class JourneyPauseCommand extends BaseCommand{[a26_0x35994b(0x26a)]=a26_0x35994b(0x22d);[a26_0x35994b(0x19a)]=a26_0x35994b(0x22f);async[a26_0x35994b(0x1f1)](_0x108024){const _0x5285c9=a26_0x35994b,{options:_0x4abae5,args:_0x40019a,tdx:_0x580264}=_0x108024,_0xc7425d=_0x40019a[0x0];if(!requireNameOrPath(_0xc7425d))return 0x1;_0x4abae5['verbose']&&console[_0x5285c9(0x1a3)](_0x5285c9(0x1ce)+_0xc7425d);const {journeyId:_0x52821b,journeyName:_0x53957b}=await resolveJourneyIdFromInput(_0xc7425d,_0x4abae5,_0x580264);if(!_0x4abae5['yes']){const _0x49618b=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x53957b+'\x22?');if(!_0x49618b)return console[_0x5285c9(0x1a3)]('Cancelled'),0x0;}const _0x1f868c=await withSpinner('Pausing\x20journey...',()=>_0x580264['journey'][_0x5285c9(0x1f0)](_0x52821b),{'verbose':_0x4abae5[_0x5285c9(0x18b)]}),_0x370add=_0x1f868c[_0x5285c9(0x1b3)];return console[_0x5285c9(0x1a3)](_0x5285c9(0x22b)+_0x370add[_0x5285c9(0x283)]['name']+'\x22\x20paused'),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a26_0x35994b(0x26a)]=a26_0x35994b(0x1e7);[a26_0x35994b(0x19a)]=a26_0x35994b(0x20b);async['execute'](_0x4831af){const _0x43a23a=a26_0x35994b,{options:_0x6f7707,args:_0x262ab4,tdx:_0x595a5e}=_0x4831af,_0x273bbc=_0x262ab4[0x0];if(!requireNameOrPath(_0x273bbc))return 0x1;_0x6f7707['verbose']&&console['error'](_0x43a23a(0x1ce)+_0x273bbc);const {journeyId:_0x495976,journeyName:_0x5564d0}=await resolveJourneyIdFromInput(_0x273bbc,_0x6f7707,_0x595a5e);if(!_0x6f7707[_0x43a23a(0x259)]){const _0x1abf0e=await confirm(_0x43a23a(0x263)+_0x5564d0+'\x22?');if(!_0x1abf0e)return console['error'](_0x43a23a(0x1d6)),0x0;}const _0x170bf9=await withSpinner(_0x43a23a(0x1a0),()=>_0x595a5e[_0x43a23a(0x1de)][_0x43a23a(0x1bc)](_0x495976),{'verbose':_0x6f7707[_0x43a23a(0x18b)]}),_0x216825=_0x170bf9[_0x43a23a(0x1b3)];return console[_0x43a23a(0x1a3)](_0x43a23a(0x22b)+_0x216825[_0x43a23a(0x283)][_0x43a23a(0x26a)]+_0x43a23a(0x189)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a26_0x35994b(0x26a)]=a26_0x35994b(0x265);['description']=a26_0x35994b(0x1c6);async[a26_0x35994b(0x1f1)](_0x272c01){const _0x1f2553=a26_0x35994b,{options:_0x578dfc,args:_0x43b29c,tdx:_0x39e6f6}=_0x272c01,_0x177173=_0x578dfc,_0x5b8f2f=_0x43b29c[0x0],_0x939e94=_0x5b8f2f&&isYamlFilePath(_0x5b8f2f),_0x2ecfd9=await resolveTarget({'arg':_0x939e94?_0x5b8f2f:undefined,'contextParent':_0x578dfc[_0x1f2553(0x213)],'cwd':process[_0x1f2553(0x1b4)]()});if(!isSuccessfulResolution(_0x2ecfd9))return _0x2ecfd9['errorCode']==='no_parent'?(console['error'](a26_0x44a323[_0x1f2553(0x195)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x1f2553(0x1a3)](_0x1f2553(0x21d)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console[_0x1f2553(0x1a3)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console['error']('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console[_0x1f2553(0x1a3)](a26_0x44a323[_0x1f2553(0x225)]('Error:\x20'+_0x2ecfd9[_0x1f2553(0x194)]+'\x0a')),_0x2ecfd9['helpText']&&console['error'](a26_0x44a323['cyan'](_0x2ecfd9[_0x1f2553(0x282)]))),0x1;let _0x18b990=_0x939e94?undefined:_0x5b8f2f,_0x51ab26,_0x496c2d;_0x2ecfd9[_0x1f2553(0x21a)]===_0x1f2553(0x28c)&&(_0x18b990=_0x2ecfd9['resourceName'],_0x51ab26=_0x2ecfd9['filePath'],_0x496c2d=_0x2ecfd9[_0x1f2553(0x22a)]);const _0x24fcb6=_0x2ecfd9[_0x1f2553(0x264)],_0x212739=_0x2ecfd9[_0x1f2553(0x1f4)];_0x177173['verbose']&&(console[_0x1f2553(0x1a3)](_0x1f2553(0x237)+_0x24fcb6),console[_0x1f2553(0x1a3)](_0x1f2553(0x26e)+_0x212739),_0x18b990&&console[_0x1f2553(0x1a3)](_0x1f2553(0x277)+_0x18b990),_0x51ab26&&console[_0x1f2553(0x1a3)](_0x1f2553(0x274)+_0x51ab26),_0x496c2d&&console[_0x1f2553(0x1a3)]('Folder\x20path:\x20'+_0x496c2d));const _0x4aabc5=await withSpinner(_0x1f2553(0x291),()=>_0x39e6f6[_0x1f2553(0x1cb)][_0x1f2553(0x275)](_0x24fcb6),{'verbose':_0x578dfc[_0x1f2553(0x18b)]}),_0x3fc285=_0x4aabc5[_0x1f2553(0x1b3)],{journeys:_0x321b40,folders:_0x4a4458}=await withSpinner(_0x1f2553(0x205),async()=>{const _0x12fa7c=_0x1f2553,[_0x908af0,_0x496ce]=await Promise['all']([_0x39e6f6[_0x12fa7c(0x1de)][_0x12fa7c(0x1ab)](_0x3fc285,undefined,{'includeAllVersions':!![]}),_0x39e6f6[_0x12fa7c(0x1cb)][_0x12fa7c(0x1dc)](_0x3fc285)]);return{'journeys':_0x908af0,'folders':_0x496ce};},{'verbose':_0x578dfc[_0x1f2553(0x18b)]})[_0x1f2553(0x20e)](_0x3bb729=>_0x3bb729[_0x1f2553(0x1b3)]);let _0x4649ad=_0x321b40;const _0x5d5abd=buildFolderIdToPathMap(_0x4a4458);if(_0x18b990){const _0x5a2dbd=_0x4649ad[_0x1f2553(0x233)](_0x9b1b5f=>_0x9b1b5f[_0x1f2553(0x19c)]['toLowerCase']()===_0x18b990[_0x1f2553(0x27f)]());if(_0x5a2dbd[_0x1f2553(0x24a)]===0x0)return console['error']('Error:\x20Journey\x20not\x20found:\x20'+_0x18b990),console[_0x1f2553(0x1a3)](_0x1f2553(0x228)),0x1;_0x4649ad=_0x5a2dbd;}if(_0x496c2d!==undefined){const _0xd83a9a=_0x4649ad['filter'](_0x1159fe=>{const _0x5c6a0f=_0x1f2553,_0x461025=_0x1159fe['folderId']?_0x5d5abd[_0x5c6a0f(0x1df)](_0x1159fe[_0x5c6a0f(0x1af)])||'':'';return _0x461025===_0x496c2d;});if(_0xd83a9a[_0x1f2553(0x24a)]===0x0&&_0x4649ad[_0x1f2553(0x24a)]>0x0){console[_0x1f2553(0x1a3)](_0x1f2553(0x210)+_0x18b990+'\x27\x20not\x20found\x20in\x20'+(_0x496c2d||_0x1f2553(0x236))),console[_0x1f2553(0x1a3)](_0x1f2553(0x1a7));for(const _0x36b07a of _0x4649ad){const _0x134717=_0x36b07a[_0x1f2553(0x1af)]?_0x5d5abd['get'](_0x36b07a[_0x1f2553(0x1af)])||'':'';console[_0x1f2553(0x1a3)](_0x1f2553(0x214)+(_0x134717||_0x1f2553(0x257))+'/'+_0x36b07a[_0x1f2553(0x19c)]);}return 0x1;}_0x4649ad=_0xd83a9a;}if(_0x4649ad[_0x1f2553(0x24a)]===0x0)return console[_0x1f2553(0x1a3)](_0x1f2553(0x1ee)),0x0;const _0x173959=new Map();for(const _0x1fd151 of _0x4649ad){const _0x428ca8=_0x1fd151[_0x1f2553(0x1c1)];!_0x173959[_0x1f2553(0x278)](_0x428ca8)&&_0x173959['set'](_0x428ca8,[]),_0x173959[_0x1f2553(0x1df)](_0x428ca8)[_0x1f2553(0x21e)](_0x1fd151);}for(const _0x4e4438 of _0x173959[_0x1f2553(0x217)]()){_0x4e4438['sort']((_0x1c6a22,_0x50e951)=>(_0x1c6a22['versionNumber']||0x0)-(_0x50e951[_0x1f2553(0x1a5)]||0x0));}const _0x3e7ee2=[],{idToEmailMap:_0x5a60fd,connectionIdToNameMap:_0x4c29df}=await withSpinner(_0x1f2553(0x281),async()=>{const _0x3fd1e1=_0x1f2553,[_0x4976fc,_0x8fccc9]=await Promise['all']([_0x39e6f6[_0x3fd1e1(0x284)][_0x3fd1e1(0x241)](),_0x39e6f6[_0x3fd1e1(0x1cf)][_0x3fd1e1(0x1ef)]()]);return{'idToEmailMap':_0x4976fc,'connectionIdToNameMap':_0x8fccc9};},{'verbose':_0x578dfc[_0x1f2553(0x18b)]})[_0x1f2553(0x20e)](_0x99ba98=>_0x99ba98[_0x1f2553(0x1b3)]);for(const _0x584b3d of _0x173959[_0x1f2553(0x217)]()){const _0x352b8c=_0x584b3d[0x0][_0x1f2553(0x19c)],_0x4fae84=_0x584b3d[0x0][_0x1f2553(0x1af)],_0xd1fd91=_0x4fae84?_0x5d5abd['get'](_0x4fae84)||'':'',_0x27f3fe=_0xd1fd91?a26_0x2d0323[_0x1f2553(0x1f7)](_0x212739,_0xd1fd91):_0x212739,_0x33143c=_0x51ab26||a26_0x2d0323[_0x1f2553(0x1f7)](_0x27f3fe,sanitizeFileName(_0x352b8c)+_0x1f2553(0x1dd));let _0x2fe4e1,_0x5d54a6;if(existsSync(_0x33143c))try{const _0x39afbb=readFileSync(_0x33143c,_0x1f2553(0x1f2)),_0x318103=parseYamlString(_0x39afbb);_0x5d54a6=_0x318103,_0x2fe4e1=buildRuleToNameMapping(_0x318103),_0x177173[_0x1f2553(0x18b)]&&_0x2fe4e1[_0x1f2553(0x253)]>0x0&&console[_0x1f2553(0x1a3)](_0x1f2553(0x1f3)+_0x2fe4e1[_0x1f2553(0x253)]+_0x1f2553(0x208)+_0x352b8c);}catch(_0x394ea8){_0x177173['verbose']&&console[_0x1f2553(0x1a3)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x394ea8[_0x1f2553(0x194)]);}const _0x5c6e8b=[],_0x1c625d=new Set(),_0x4d596b=new Map(),_0x3772d2=new Map(),_0x1d651e=new Set(),_0x27f38f=new Map(),_0x20a2ae=new Map(),_0x37b3ae=createJumpTargetCache();await withProgressSpinner(_0x1f2553(0x186)+_0x352b8c+_0x1f2553(0x267),async _0x48c79f=>{const _0x34ff3c=_0x1f2553;for(const _0x4f360d of _0x584b3d){const _0x120205=_0x584b3d['length']>0x1?_0x4f360d['journeyBundleName']+'\x20v'+(_0x4f360d[_0x34ff3c(0x1a5)]||0x1):_0x4f360d[_0x34ff3c(0x19c)];_0x48c79f[_0x34ff3c(0x1c3)](_0x34ff3c(0x186)+_0x120205);const _0x2ea9de=await _0x39e6f6[_0x34ff3c(0x1de)][_0x34ff3c(0x28e)](_0x4f360d['id']),_0x546ef3=_0x2ea9de[_0x34ff3c(0x283)]?.[_0x34ff3c(0x1bf)],_0x9880b={'resolveSegment':async _0x186d6c=>{const _0x405e8e=_0x34ff3c;if(!_0x546ef3)return{'name':_0x186d6c,'isJourneyLocal':![]};const _0x34bb4b=_0x4d596b[_0x405e8e(0x1df)](_0x186d6c);if(_0x34bb4b)return _0x34bb4b;try{const _0x4d6b69=await _0x39e6f6[_0x405e8e(0x1cb)][_0x405e8e(0x20a)](_0x546ef3,_0x186d6c),_0x406ee5=_0x4d6b69[_0x405e8e(0x187)]===SEGMENT_KIND_JOURNEY;let _0x1f4e3a,_0x207a66=_0x4d6b69['name'];if(_0x406ee5&&_0x4d6b69[_0x405e8e(0x23f)]){const _0xa2be2e=await segmentResponseToDef(_0x4d6b69,{'resolveSegmentName':async _0x5a1fde=>{const _0x178b65=_0x405e8e,_0x577511=_0x4d596b[_0x178b65(0x1df)](_0x5a1fde);if(_0x577511)return _0x577511[_0x178b65(0x26a)];const _0x66b4db=await _0x9880b['resolveSegment'](_0x5a1fde);return _0x66b4db[_0x178b65(0x26a)];}}),_0x591220=_0xa2be2e['rule'];_0x1f4e3a={'description':_0x4d6b69['description'],'rule':_0x591220};const _0x30ae8a=serializeRule(_0x591220),_0x45db64=_0x3772d2[_0x405e8e(0x1df)](_0x30ae8a);if(_0x45db64)_0x207a66=_0x45db64,_0x1f4e3a=undefined,_0x177173[_0x405e8e(0x18b)]&&console['error'](_0x405e8e(0x258)+_0x4d6b69[_0x405e8e(0x26a)]+_0x405e8e(0x23b)+_0x45db64);else{let _0x3df31a=![];if(_0x2fe4e1){const _0x56958d=_0x2fe4e1[_0x405e8e(0x1df)](_0x30ae8a);if(_0x56958d){const _0x22bf9e=_0x56958d[_0x405e8e(0x1d1)](_0x4e29e5=>!_0x1c625d[_0x405e8e(0x278)](_0x4e29e5));_0x22bf9e&&(_0x207a66=_0x22bf9e,_0x1c625d[_0x405e8e(0x1eb)](_0x22bf9e),_0x3772d2['set'](_0x30ae8a,_0x22bf9e),_0x3df31a=!![],_0x177173[_0x405e8e(0x18b)]&&console[_0x405e8e(0x1a3)](_0x405e8e(0x18d)+_0x22bf9e+'\x20(rule\x20match)'));}}if(!_0x3df31a){const _0x584fa3=generateJourneyLocalName(_0x4d6b69[_0x405e8e(0x26a)]);_0x584fa3&&(_0x207a66=_0x584fa3);let _0x476ad0=_0x207a66,_0x300ac5=0x2;while(_0x1c625d[_0x405e8e(0x278)](_0x476ad0)){_0x476ad0=_0x207a66+'_'+_0x300ac5,_0x300ac5++;}_0x1c625d[_0x405e8e(0x1eb)](_0x476ad0),_0x3772d2[_0x405e8e(0x269)](_0x30ae8a,_0x476ad0),_0x207a66=_0x476ad0;}}}const _0x185dc5={'name':_0x207a66,'isJourneyLocal':_0x406ee5,'definition':_0x1f4e3a};return _0x4d596b['set'](_0x186d6c,_0x185dc5),_0x185dc5;}catch(_0x59fd29){return _0x578dfc[_0x405e8e(0x18b)]&&console['error'](_0x405e8e(0x1e5)+_0x186d6c+':\x20'+_0x59fd29[_0x405e8e(0x194)]),{'name':_0x186d6c,'isJourneyLocal':![]};}},'resolveActivation':async _0x555427=>{const _0x1555db=_0x34ff3c,_0x1da321=_0x27f38f[_0x1555db(0x1df)](_0x555427);if(_0x1da321)return _0x1da321;try{const _0x453938=await _0x39e6f6[_0x1555db(0x1de)][_0x1555db(0x290)](_0x4f360d['id'],_0x555427),_0x1d0b0d=journeyActivationStepToYaml(_0x453938,_0x5a60fd,_0x4c29df),_0x494b87=JSON[_0x1555db(0x1cd)]({'name':_0x1d0b0d[_0x1555db(0x26a)],'connection':_0x1d0b0d['connection'],'connector_config':_0x1d0b0d[_0x1555db(0x219)]}),_0x291f3e=_0x20a2ae[_0x1555db(0x1df)](_0x494b87);if(_0x291f3e){const _0x3f15e7={'name':_0x291f3e,'isJourneyLocal':!![],'definition':_0x1d0b0d};return _0x27f38f[_0x1555db(0x269)](_0x555427,_0x3f15e7),_0x3f15e7;}const _0x2b3a00=_0x453938[_0x1555db(0x283)][_0x1555db(0x227)][_0x1555db(0x26a)]||_0x555427,_0xfc9c77=sanitizeYamlKey(_0x2b3a00)||_0x1555db(0x191)+_0x555427;let _0x2e966d=_0xfc9c77,_0x5289fd=0x2;while(_0x1d651e['has'](_0x2e966d)){_0x2e966d=_0xfc9c77+'_'+_0x5289fd,_0x5289fd++;}_0x1d651e[_0x1555db(0x1eb)](_0x2e966d),_0x20a2ae[_0x1555db(0x269)](_0x494b87,_0x2e966d);const _0x284b79={'name':_0x2e966d,'isJourneyLocal':!![],'definition':_0x1d0b0d};return _0x27f38f[_0x1555db(0x269)](_0x555427,_0x284b79),_0x284b79;}catch(_0x4a3293){return _0x578dfc[_0x1555db(0x18b)]&&console[_0x1555db(0x1a3)]('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x555427+':\x20'+_0x4a3293['message']),{'name':_0x555427,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x313fe4,_0x3c7fd1)=>{const _0x4eb045=_0x34ff3c;return resolveJumpTarget(_0x313fe4,_0x3c7fd1,_0x37b3ae,_0x8ce1b3=>_0x39e6f6[_0x4eb045(0x1de)][_0x4eb045(0x28e)](_0x8ce1b3));}},_0x4686f5=await journeyResponseToDef(_0x2ea9de,_0x9880b);_0x5c6e8b[_0x34ff3c(0x21e)]({'item':_0x4f360d,'yaml':_0x4686f5});}},{'verbose':_0x578dfc['verbose']});const _0x53dcd8=await _0x39e6f6[_0x1f2553(0x1de)]['getLatestJourneyId'](_0x584b3d[0x0][_0x1f2553(0x1c1)]),_0x4cf215=buildMergedJourneyDef(_0x5c6e8b,_0x2fe4e1,_0x53dcd8),_0x530d6a=normalizeJourneyDef(_0x4cf215,_0x5d54a6),_0x28a0de=toYamlString(_0x530d6a),_0xaf7c7e=_0x51ab26||a26_0x2d0323[_0x1f2553(0x1f7)](_0x27f3fe,sanitizeFileName(_0x352b8c)+_0x1f2553(0x1dd));!_0x51ab26&&_0xd1fd91&&!existsSync(_0x27f3fe)&&mkdirSync(_0x27f3fe,{'recursive':!![]});const _0x4c6c98=a26_0x2d0323[_0x1f2553(0x1d8)](process[_0x1f2553(0x1b4)](),_0xaf7c7e);if(existsSync(_0xaf7c7e)){const _0x4fd495=readFileSync(_0xaf7c7e,'utf-8'),_0x10cd52=generateDiff(_0x4fd495,_0x28a0de),_0x5d91ba=hasChanges(_0x10cd52);_0x3e7ee2['push']({'relativePath':_0x4c6c98,'absolutePath':_0xaf7c7e,'content':_0x28a0de,'isNew':![],'hasChanges':_0x5d91ba,'diff':_0x5d91ba?formatDiffWithColors(_0x10cd52):undefined});}else _0x3e7ee2[_0x1f2553(0x21e)]({'relativePath':_0x4c6c98,'absolutePath':_0xaf7c7e,'content':_0x28a0de,'isNew':!![],'hasChanges':![]});}const _0x2e4357=_0x3e7ee2['filter'](_0x426d45=>_0x426d45[_0x1f2553(0x206)]),_0x2ac13a=_0x3e7ee2['filter'](_0x5c0d91=>!_0x5c0d91[_0x1f2553(0x206)]&&_0x5c0d91[_0x1f2553(0x273)]),_0xa28bad=_0x3e7ee2['filter'](_0x298ff3=>!_0x298ff3[_0x1f2553(0x206)]&&!_0x298ff3[_0x1f2553(0x273)]),_0x31ab16=_0x4649ad[_0x1f2553(0x24a)],_0x10ca36=_0x173959['size'],_0x403268=_0x31ab16>_0x10ca36?'\x20('+_0x31ab16+_0x1f2553(0x1ad):'';console['error'](_0x1f2553(0x209)),console[_0x1f2553(0x1a3)]('\x20\x20'+a26_0x44a323[_0x1f2553(0x202)](_0x10ca36+_0x1f2553(0x1e2))+a26_0x44a323[_0x1f2553(0x20c)](_0x403268)),console[_0x1f2553(0x1a3)]('\x20\x20'+a26_0x44a323[_0x1f2553(0x1b1)]('+\x20'+_0x2e4357['length']+_0x1f2553(0x24f))),console['error']('\x20\x20'+a26_0x44a323[_0x1f2553(0x195)]('~\x20'+_0x2ac13a[_0x1f2553(0x24a)]+_0x1f2553(0x1cc))),console[_0x1f2553(0x1a3)]('\x20\x20'+a26_0x44a323[_0x1f2553(0x20c)]('=\x20'+_0xa28bad[_0x1f2553(0x24a)]+_0x1f2553(0x1e4))),console[_0x1f2553(0x1a3)](_0x1f2553(0x1c7)+a26_0x44a323[_0x1f2553(0x202)](_0x212739)+'\x0a');if(_0x2ac13a[_0x1f2553(0x24a)]>0x0)for(const _0x3b5e6e of _0x2ac13a){console[_0x1f2553(0x1a3)]('\x0aChanges\x20to\x20\x27'+_0x3b5e6e[_0x1f2553(0x250)]+'\x27:'),console[_0x1f2553(0x1a3)]('─'['repeat'](0x3c)),console[_0x1f2553(0x1a3)](_0x3b5e6e[_0x1f2553(0x1c5)]),console[_0x1f2553(0x1a3)]('─'[_0x1f2553(0x1ec)](0x3c));}if(_0x177173[_0x1f2553(0x252)])return console['error'](a26_0x44a323[_0x1f2553(0x195)](_0x1f2553(0x28a))),0x0;if(_0x2e4357[_0x1f2553(0x24a)]===0x0&&_0x2ac13a[_0x1f2553(0x24a)]===0x0)return console[_0x1f2553(0x1a3)](a26_0x44a323[_0x1f2553(0x1b1)](_0x1f2553(0x240))),saveSessionContext({'parent_segment':_0x24fcb6},_0x177173[_0x1f2553(0x261)]),console['error'](a26_0x44a323['green'](_0x1f2553(0x216)+a26_0x44a323[_0x1f2553(0x20c)](_0x1f2553(0x20d))+_0x1f2553(0x243)+a26_0x44a323[_0x1f2553(0x202)](_0x24fcb6))),0x0;if(!_0x177173[_0x1f2553(0x259)]&&(_0x2e4357[_0x1f2553(0x24a)]>0x0||_0x2ac13a[_0x1f2553(0x24a)]>0x0)){if(!isInteractive())return console[_0x1f2553(0x1a3)](a26_0x44a323['red'](_0x1f2553(0x1fc)),_0x1f2553(0x1b7)),console[_0x1f2553(0x1a3)](a26_0x44a323[_0x1f2553(0x20c)](_0x1f2553(0x1e1))),0x1;const _0x16b88b=await confirmKey(_0x1f2553(0x28d)+(_0x2e4357['length']+_0x2ac13a[_0x1f2553(0x24a)])+_0x1f2553(0x1f9));if(!_0x16b88b)return console[_0x1f2553(0x1a3)](a26_0x44a323['yellow'](_0x1f2553(0x234)),_0x1f2553(0x21b)),0x1;}!existsSync(_0x212739)&&mkdirSync(_0x212739,{'recursive':!![]});const _0x76ac63=a26_0x2d0323[_0x1f2553(0x1f7)](_0x212739,_0x1f2553(0x218));writeFileSync(_0x76ac63,createTdxConfigContent(_0x24fcb6),'utf-8');for(const _0x2d091b of _0x3e7ee2){(_0x2d091b[_0x1f2553(0x206)]||_0x2d091b['hasChanges'])&&writeFileSync(_0x2d091b[_0x1f2553(0x1fb)],_0x2d091b[_0x1f2553(0x279)],'utf-8');}return console[_0x1f2553(0x1a3)](a26_0x44a323[_0x1f2553(0x1b1)](_0x1f2553(0x1e3)+(_0x2e4357[_0x1f2553(0x24a)]+_0x2ac13a[_0x1f2553(0x24a)])+_0x1f2553(0x25b)+_0x212739)),saveSessionContext({'parent_segment':_0x24fcb6},_0x177173[_0x1f2553(0x261)]),console[_0x1f2553(0x1a3)](a26_0x44a323['green'](_0x1f2553(0x216)+a26_0x44a323[_0x1f2553(0x20c)]('parent_segment')+_0x1f2553(0x243)+a26_0x44a323[_0x1f2553(0x202)](_0x24fcb6))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a26_0x35994b(0x26a)]='journey:columns';['description']=a26_0x35994b(0x1fa);async[a26_0x35994b(0x1f1)](_0x4431fe){const _0x114496=a26_0x35994b,{options:_0x4888ed,args:_0xee0a09,tdx:_0x280f14}=_0x4431fe,_0x1ba9d7=_0xee0a09[0x0];if(!requireNameOrPath(_0x1ba9d7))return 0x1;_0x4888ed[_0x114496(0x18b)]&&console[_0x114496(0x1a3)](_0x114496(0x1ce)+_0x1ba9d7);const {journeyId:_0x24f66e}=await resolveJourneyIdFromInput(_0x1ba9d7,_0x4888ed,_0x280f14),_0x425acf=await withSpinner(_0x114496(0x272),()=>_0x280f14[_0x114496(0x1de)][_0x114496(0x197)](_0x24f66e),{'verbose':_0x4888ed[_0x114496(0x18b)]}),_0x2fb07d=_0x425acf['data'];return console[_0x114496(0x21c)](_0x114496(0x1ca)+_0x2fb07d[_0x114496(0x26d)]),console[_0x114496(0x21c)](_0x114496(0x238)+_0x2fb07d[_0x114496(0x27e)]),await handleSDKOutput(_0x2fb07d[_0x114496(0x203)],_0x4888ed),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a26_0x35994b(0x26a)]=a26_0x35994b(0x1da);[a26_0x35994b(0x19a)]=a26_0x35994b(0x221);async['execute'](_0x35f26d){const _0x213c8e=a26_0x35994b,{options:_0x1c2904,args:_0xf0d9ae,tdx:_0x1b3567}=_0x35f26d,_0x174632=_0xf0d9ae[0x0];if(!requireNameOrPath(_0x174632))return 0x1;_0x1c2904[_0x213c8e(0x18b)]&&console[_0x213c8e(0x1a3)]('Input:\x20'+_0x174632);const {journeyId:_0x101a0d}=await resolveJourneyIdFromInput(_0x174632,_0x1c2904,_0x1b3567),_0xac74bb=await withSpinner('Listing\x20journey\x20activations...',()=>_0x1b3567[_0x213c8e(0x1de)][_0x213c8e(0x268)](_0x101a0d),{'verbose':_0x1c2904['verbose']}),_0x31f6af=_0xac74bb[_0x213c8e(0x1b3)];return console['error'](_0x213c8e(0x1f3)+_0x31f6af['length']+_0x213c8e(0x1d2)+(_0x31f6af[_0x213c8e(0x24a)]!==0x1?'s':'')),await handleSDKOutput(_0x31f6af,_0x1c2904),0x0;}}export class JourneyPushCommand extends BaseCommand{[a26_0x35994b(0x26a)]=a26_0x35994b(0x245);[a26_0x35994b(0x19a)]=a26_0x35994b(0x24b);[a26_0x35994b(0x1c2)]=new SegmentPushCommand();async[a26_0x35994b(0x1f1)](_0x5d1cf3){const _0x69bc99=a26_0x35994b,_0x26eabb=_0x5d1cf3['args'][0x0];let _0x534505;if(_0x26eabb){const _0x47910e=await resolveTarget({'arg':_0x26eabb,'contextParent':_0x5d1cf3[_0x69bc99(0x1ae)][_0x69bc99(0x213)],'cwd':process[_0x69bc99(0x1b4)]()});isSuccessfulResolution(_0x47910e)&&_0x47910e[_0x69bc99(0x21a)]===_0x69bc99(0x28c)&&(_0x534505=_0x47910e[_0x69bc99(0x19e)]);}const _0x48bbac={..._0x5d1cf3,'options':{..._0x5d1cf3[_0x69bc99(0x1ae)],'journeysOnly':!![],..._0x534505&&{'singleFilePath':_0x534505}}};return this[_0x69bc99(0x1c2)]['execute'](_0x48bbac);}}export class JourneyVersionsCommand extends BaseCommand{[a26_0x35994b(0x26a)]=a26_0x35994b(0x255);[a26_0x35994b(0x19a)]=a26_0x35994b(0x1b2);async[a26_0x35994b(0x1f1)](_0xc7adf7){const _0xad3bcc=a26_0x35994b,{options:_0x478df1,args:_0x4c3b92,tdx:_0x20bf6a}=_0xc7adf7,_0x1895d5=_0x4c3b92[0x0];if(!requireNameOrPath(_0x1895d5))return 0x1;if(_0x478df1[_0xad3bcc(0x18b)])console[_0xad3bcc(0x1a3)](_0xad3bcc(0x1ce)+_0x1895d5);const {journeyId:_0x1aade4}=await resolveJourneyIdFromInput(_0x1895d5,_0x478df1,_0x20bf6a),_0x191f82=await withSpinner(_0xad3bcc(0x1d5),()=>_0x20bf6a[_0xad3bcc(0x1de)][_0xad3bcc(0x266)](_0x1aade4),{'verbose':_0x478df1[_0xad3bcc(0x18b)]}),{bundleName:_0x1aa912,versions:_0x3c020d,latestJourneyId:_0x2d3738}=_0x191f82[_0xad3bcc(0x1b3)];console['error'](_0x1aa912+':\x20'+_0x3c020d[_0xad3bcc(0x24a)]+_0xad3bcc(0x1d7)+(_0x3c020d[_0xad3bcc(0x24a)]!==0x1?'s':''));const _0x909904=_0x3c020d['map'](_0x38e394=>({'version':_0x38e394['versionNumber'],'journey_id':_0x38e394[_0xad3bcc(0x231)],'name':_0x38e394['name'],'state':_0x38e394['state'],'paused':_0x38e394[_0xad3bcc(0x198)],'latest':_0x38e394['journeyId']===_0x2d3738,'created_at':_0x38e394[_0xad3bcc(0x254)]}));return await handleSDKOutput(_0x909904,_0x478df1),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']=a26_0x35994b(0x1ba);[a26_0x35994b(0x19a)]=a26_0x35994b(0x192);async[a26_0x35994b(0x1f1)](_0x4535f3){const _0x44e0e1=a26_0x35994b,{options:_0x567483,args:_0x1c76c1,tdx:_0x352d7e}=_0x4535f3,_0x487c8a=_0x1c76c1[0x0];if(!requireNameOrPath(_0x487c8a))return 0x1;if(_0x567483[_0x44e0e1(0x18b)])console[_0x44e0e1(0x1a3)](_0x44e0e1(0x1ce)+_0x487c8a);const {journeyId:_0x2b2125,journeyName:_0xaed696}=await resolveJourneyIdFromInput(_0x487c8a,_0x567483,_0x352d7e);if(!_0x567483[_0x44e0e1(0x259)]){const _0x31bf5b=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0xaed696+'\x22?');if(!_0x31bf5b)return console[_0x44e0e1(0x1a3)]('Cancelled'),0x0;}const _0x2f53d9=await withSpinner('Creating\x20new\x20version...',()=>_0x352d7e['journey'][_0x44e0e1(0x285)](_0x2b2125),{'verbose':_0x567483[_0x44e0e1(0x18b)]}),_0x13647a=_0x2f53d9['data'];return console[_0x44e0e1(0x1a3)](a26_0x44a323['green']('✔')+'\x20Created\x20v'+_0x13647a['attributes']['versionNumber']+'\x20(draft)\x20—\x20\x22'+_0x13647a[_0x44e0e1(0x283)][_0x44e0e1(0x26a)]+'\x22'),console[_0x44e0e1(0x1a3)]('\x20\x20Journey\x20ID:\x20'+_0x13647a['id']),await handleSingleObjectOutput({'id':_0x13647a['id'],'name':_0x13647a[_0x44e0e1(0x283)]['name'],'version':_0x13647a[_0x44e0e1(0x283)][_0x44e0e1(0x1a5)],'state':_0x13647a[_0x44e0e1(0x283)][_0x44e0e1(0x19d)],'bundle_id':_0x13647a[_0x44e0e1(0x283)][_0x44e0e1(0x1c1)],'created_at':_0x13647a[_0x44e0e1(0x283)][_0x44e0e1(0x254)]},_0x567483),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a26_0x35994b(0x26a)]=a26_0x35994b(0x204);['description']=a26_0x35994b(0x276);async['execute'](_0x4d6cdb){const _0x3ed7d8=a26_0x35994b,{options:_0x5991c1,args:_0x2a9820,tdx:_0x455f51}=_0x4d6cdb,_0x54c004=_0x2a9820[0x0];if(!requireNameOrPath(_0x54c004))return 0x1;const _0x5ab83b=_0x5991c1[_0x3ed7d8(0x244)];if(!_0x5ab83b)return console[_0x3ed7d8(0x1a3)]('Error:\x20--version\x20option\x20is\x20required'),console[_0x3ed7d8(0x1a3)]('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x3baf26=parseInt(_0x5ab83b,0xa);if(isNaN(_0x3baf26)||_0x3baf26<0x1)return console['error'](_0x3ed7d8(0x256)+_0x5ab83b),0x1;if(_0x5991c1[_0x3ed7d8(0x18b)])console[_0x3ed7d8(0x1a3)]('Input:\x20'+_0x54c004+_0x3ed7d8(0x199)+_0x3baf26);const {journeyId:_0x50cab8,parentSegmentId:_0x3a9aee}=await resolveJourneyIdFromInput(_0x54c004,_0x5991c1,_0x455f51),_0x200efb=await withSpinner('Resolving\x20version...',()=>_0x455f51[_0x3ed7d8(0x1de)]['listVersions'](_0x50cab8),{'verbose':_0x5991c1[_0x3ed7d8(0x18b)]}),{versions:_0x11b410,latestJourneyId:_0xb9643e}=_0x200efb['data'],_0x52c879=_0x11b410[_0x3ed7d8(0x1d1)](_0x1ab9a8=>_0x1ab9a8['versionNumber']===_0x3baf26);if(!_0x52c879){const _0xf9d0d=_0x11b410[_0x3ed7d8(0x242)](_0x441951=>'v'+_0x441951[_0x3ed7d8(0x1a5)])[_0x3ed7d8(0x1f7)](',\x20');return console[_0x3ed7d8(0x1a3)](_0x3ed7d8(0x1a4)+_0x3baf26+'\x20not\x20found.\x20Available:\x20'+_0xf9d0d),0x1;}const _0x152abe=await withSpinner(_0x3ed7d8(0x1be)+_0x3baf26+_0x3ed7d8(0x1fd),()=>_0x455f51[_0x3ed7d8(0x1de)][_0x3ed7d8(0x28e)](_0x52c879[_0x3ed7d8(0x231)]),{'verbose':_0x5991c1['verbose']}),_0x28b9f2=_0x152abe[_0x3ed7d8(0x1b3)],_0x5b0f82=getConsoleNextUrl(_0x5991c1['site'],_0x3ed7d8(0x25e)+_0x3a9aee+'/e/'+_0x52c879[_0x3ed7d8(0x231)]+_0x3ed7d8(0x190));return await handleSingleObjectOutput({'id':_0x28b9f2['id'],'name':_0x28b9f2['attributes']['name'],'version':_0x28b9f2[_0x3ed7d8(0x283)][_0x3ed7d8(0x1a5)],'description':_0x28b9f2['attributes']['description'],'state':_0x28b9f2[_0x3ed7d8(0x283)]['state'],'paused':_0x28b9f2[_0x3ed7d8(0x283)][_0x3ed7d8(0x198)],'reentry_mode':_0x28b9f2['attributes']['reentryMode'],'stages':_0x28b9f2[_0x3ed7d8(0x283)][_0x3ed7d8(0x1e8)]?.[_0x3ed7d8(0x24a)]||0x0,..._0x28b9f2[_0x3ed7d8(0x283)]['goal']&&{'goal':_0x28b9f2[_0x3ed7d8(0x283)][_0x3ed7d8(0x23d)][_0x3ed7d8(0x26a)]},'latest':_0x52c879[_0x3ed7d8(0x231)]===_0xb9643e,'created_at':_0x28b9f2[_0x3ed7d8(0x283)][_0x3ed7d8(0x254)],'updated_at':_0x28b9f2[_0x3ed7d8(0x283)][_0x3ed7d8(0x23e)],'url':_0x5b0f82},_0x5991c1),0x0;}}
@@ -1 +1 @@
1
- const a26_0x10a324=a26_0x33f3;(function(_0x22e93f,_0x5dd3e1){const _0x59ce78=a26_0x33f3,_0x45bc91=_0x22e93f();while(!![]){try{const _0x491312=-parseInt(_0x59ce78(0x1df))/0x1*(parseInt(_0x59ce78(0x1c8))/0x2)+-parseInt(_0x59ce78(0x1c7))/0x3*(parseInt(_0x59ce78(0x1d9))/0x4)+parseInt(_0x59ce78(0x1d2))/0x5+-parseInt(_0x59ce78(0x1d5))/0x6+-parseInt(_0x59ce78(0x1d0))/0x7*(parseInt(_0x59ce78(0x1ee))/0x8)+parseInt(_0x59ce78(0x1d8))/0x9*(parseInt(_0x59ce78(0x1de))/0xa)+parseInt(_0x59ce78(0x1d3))/0xb*(parseInt(_0x59ce78(0x1b7))/0xc);if(_0x491312===_0x5dd3e1)break;else _0x45bc91['push'](_0x45bc91['shift']());}catch(_0x3ce964){_0x45bc91['push'](_0x45bc91['shift']());}}}(a26_0x2a5d,0x7bfb7));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 a26_0x322aa8 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a26_0x33f3(_0xe8a108,_0x439990){_0xe8a108=_0xe8a108-0x1b3;const _0x2a5d92=a26_0x2a5d();let _0x33f383=_0x2a5d92[_0xe8a108];return _0x33f383;}function a26_0x2a5d(){const _0x1c8297=['9tbFAVz','204NPRWRo','errorCode','\x20(skipped:\x20','relativePath','validCount','9354140XuAWmI','7jSNjuB','yellow','Validation\x20failed:\x20','parentSegment','errors','\x20warning(s)','reason','verbose','No\x20journey\x20YAML\x20files\x20found\x20in\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','skippedCount','log','error','endsWith','warningCount','336DkRXYV','length','name','dim','execute','\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','148788MoDEKu','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','cwd','\x20segment\x20file(s)\x20skipped)','green','Validate\x20journey\x20YAML\x20files','\x20error(s)','Error:\x20','\x20journey(s)\x20valid','journey:validate','no_parent','type','\x20segment\x20file(s)\x20skipped','helpText','valid','.yml','50763mFVpYS','148518axEtbO','targetDir','\x20warning(s)\x20found','description','.yaml','invalidCount','warnings','filePath','118279ahwLMD','Error:\x20Directory\x20not\x20found:\x20','379810zTmqma','1991MYbIgI','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','3931836aHkIqU','journey','red'];a26_0x2a5d=function(){return _0x1c8297;};return a26_0x2a5d();}export class JourneyValidateCommand extends BaseCommand{[a26_0x10a324(0x1b3)]=a26_0x10a324(0x1c0);[a26_0x10a324(0x1cb)]=a26_0x10a324(0x1bc);async[a26_0x10a324(0x1b5)](_0x40e703){const _0x481371=a26_0x10a324,{options:_0x33dde9,args:_0x40e2bf}=_0x40e703,_0x14a8d2=_0x33dde9,_0x2a9126=await resolveTarget({'arg':_0x40e2bf[0x0],'contextParent':_0x33dde9[_0x481371(0x1e2)],'cwd':process[_0x481371(0x1b9)]()});if(!isSuccessfulResolution(_0x2a9126))return _0x2a9126[_0x481371(0x1da)]===_0x481371(0x1c1)?(console[_0x481371(0x1eb)](a26_0x322aa8['yellow'](_0x481371(0x1e8))),console[_0x481371(0x1eb)]('Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x481371(0x1eb)](_0x481371(0x1b6)),console[_0x481371(0x1eb)](_0x481371(0x1d4))):(console[_0x481371(0x1eb)](a26_0x322aa8[_0x481371(0x1d7)](_0x481371(0x1be)+_0x2a9126['message']+'\x0a')),_0x2a9126[_0x481371(0x1c4)]&&console[_0x481371(0x1eb)](a26_0x322aa8['cyan'](_0x2a9126[_0x481371(0x1c4)]))),0x1;const _0x3d0bc2=_0x2a9126[_0x481371(0x1c9)],_0x16be28=_0x2a9126[_0x481371(0x1c2)]==='file'?_0x2a9126[_0x481371(0x1cf)]:undefined;if(!_0x16be28&&!existsSync(_0x3d0bc2))return console[_0x481371(0x1eb)](a26_0x322aa8[_0x481371(0x1d7)](_0x481371(0x1d1)+_0x3d0bc2+'\x0a')),0x1;let _0x21ad74;if(_0x16be28){if(!_0x16be28[_0x481371(0x1ec)](_0x481371(0x1c6))&&!_0x16be28[_0x481371(0x1ec)](_0x481371(0x1cc)))return console[_0x481371(0x1eb)](a26_0x322aa8[_0x481371(0x1d7)](_0x481371(0x1b8)+_0x16be28+'\x0a')),0x1;_0x21ad74=[_0x16be28];}else _0x21ad74=findYamlFiles(_0x3d0bc2);if(_0x21ad74['length']===0x0)return console['error'](a26_0x322aa8['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x3d0bc2+'\x0a')),0x1;const _0x3ba98c=validateYamlFiles(_0x21ad74,_0x3d0bc2,{'filterType':_0x481371(0x1d6)}),_0x4a0d6b=calculateSummary(_0x3ba98c),_0xb663e1=_0x3ba98c['filter'](isValidationResult);if(_0xb663e1[_0x481371(0x1ef)]===0x0)return console['error'](a26_0x322aa8['yellow'](_0x481371(0x1e7)+_0x3d0bc2+'\x0a')),_0x4a0d6b[_0x481371(0x1e9)]>0x0&&console['error'](a26_0x322aa8[_0x481371(0x1b4)]('('+_0x4a0d6b[_0x481371(0x1e9)]+_0x481371(0x1ba))),0x0;for(const _0x348772 of _0x3ba98c){if(!isValidationResult(_0x348772)){_0x14a8d2[_0x481371(0x1e6)]&&console[_0x481371(0x1ea)](a26_0x322aa8['dim']('-\x20'+_0x348772[_0x481371(0x1dc)]+_0x481371(0x1db)+_0x348772[_0x481371(0x1e5)]+')'));continue;}const {relativePath:_0x114512,source:_0x88c67b,result:_0x168de3}=_0x348772;if(_0x168de3[_0x481371(0x1c5)]&&_0x168de3[_0x481371(0x1ce)]['length']===0x0)_0x14a8d2['verbose']&&console['log'](a26_0x322aa8[_0x481371(0x1bb)]('✔\x20'+_0x114512));else _0x168de3['valid']?(console[_0x481371(0x1ea)](a26_0x322aa8[_0x481371(0x1e0)]('⚠\x20'+_0x114512+':\x20'+_0x168de3[_0x481371(0x1ce)][_0x481371(0x1ef)]+_0x481371(0x1e4))),console[_0x481371(0x1ea)](formatValidationResult(_0x168de3,_0x88c67b,_0x114512))):(console[_0x481371(0x1ea)](a26_0x322aa8['red']('✖\x20'+_0x114512+':\x20'+_0x168de3[_0x481371(0x1e3)]['length']+_0x481371(0x1bd))),console[_0x481371(0x1ea)](formatValidationResult(_0x168de3,_0x88c67b,_0x114512)));}return console[_0x481371(0x1ea)](''),_0x4a0d6b['hasErrors']?(console[_0x481371(0x1ea)](a26_0x322aa8[_0x481371(0x1d7)](_0x481371(0x1e1)+_0x4a0d6b[_0x481371(0x1cd)]+'\x20journey(s)\x20with\x20errors,\x20'+_0x4a0d6b[_0x481371(0x1dd)]+'\x20valid')),_0x4a0d6b['warningCount']>0x0&&console[_0x481371(0x1ea)](a26_0x322aa8['yellow'](_0x4a0d6b['warningCount']+_0x481371(0x1ca))),_0x4a0d6b[_0x481371(0x1e9)]>0x0&&console['log'](a26_0x322aa8['dim'](_0x4a0d6b[_0x481371(0x1e9)]+'\x20segment\x20file(s)\x20skipped')),0x1):(console['log'](a26_0x322aa8['green']('✔\x20All\x20'+_0x4a0d6b['validCount']+_0x481371(0x1bf))),_0x4a0d6b[_0x481371(0x1ed)]>0x0&&console[_0x481371(0x1ea)](a26_0x322aa8[_0x481371(0x1e0)](_0x4a0d6b[_0x481371(0x1ed)]+_0x481371(0x1ca))),_0x4a0d6b[_0x481371(0x1e9)]>0x0&&console[_0x481371(0x1ea)](a26_0x322aa8[_0x481371(0x1b4)](_0x4a0d6b['skippedCount']+_0x481371(0x1c3))),0x0);}}
1
+ const a27_0x405c87=a27_0x2054;function a27_0x2054(_0x4f7b0f,_0x37f104){_0x4f7b0f=_0x4f7b0f-0x15c;const _0x27c0b0=a27_0x27c0();let _0x205406=_0x27c0b0[_0x4f7b0f];return _0x205406;}(function(_0x216ada,_0x57c509){const _0x213500=a27_0x2054,_0x165d72=_0x216ada();while(!![]){try{const _0x33b9c9=parseInt(_0x213500(0x163))/0x1+parseInt(_0x213500(0x186))/0x2+parseInt(_0x213500(0x184))/0x3*(parseInt(_0x213500(0x170))/0x4)+parseInt(_0x213500(0x16d))/0x5+-parseInt(_0x213500(0x16e))/0x6*(parseInt(_0x213500(0x187))/0x7)+parseInt(_0x213500(0x17e))/0x8*(-parseInt(_0x213500(0x196))/0x9)+-parseInt(_0x213500(0x16c))/0xa;if(_0x33b9c9===_0x57c509)break;else _0x165d72['push'](_0x165d72['shift']());}catch(_0x5861d9){_0x165d72['push'](_0x165d72['shift']());}}}(a27_0x27c0,0x6aa9c));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 a27_0x20437d from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a27_0x27c0(){const _0x5a0441=['type','errors','261CzPRUf','green','red','yellow','targetDir','invalidCount','dim','warnings','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','\x20(skipped:\x20','292924ZgaBVD','reason','validCount','.yml','warningCount','helpText','filePath','✔\x20All\x20','hasErrors','11524030XetAys','4181095WgVIAH','8538jUBMzz','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','4hkcqUt','No\x20journey\x20YAML\x20files\x20found\x20in\x20','verbose','parentSegment','.yaml','length','Error:\x20','skippedCount','message','\x20valid','error','Validation\x20failed:\x20','execute','journey:validate','10248gQIVxB','file','no_parent','\x20journey(s)\x20with\x20errors,\x20','cwd','journey','1624017ZwYRCt','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','358746UcmjKf','1099UhFPnH','description','log','filter','name','\x20warning(s)','cyan','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','\x20journey(s)\x20valid','Error:\x20Directory\x20not\x20found:\x20','endsWith','valid','\x20warning(s)\x20found'];a27_0x27c0=function(){return _0x5a0441;};return a27_0x27c0();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a27_0x405c87(0x18b)]=a27_0x405c87(0x17d);[a27_0x405c87(0x188)]='Validate\x20journey\x20YAML\x20files';async[a27_0x405c87(0x17c)](_0x34a713){const _0x571f2c=a27_0x405c87,{options:_0x128a0b,args:_0x300eb1}=_0x34a713,_0x23aa82=_0x128a0b,_0x38df70=await resolveTarget({'arg':_0x300eb1[0x0],'contextParent':_0x128a0b[_0x571f2c(0x173)],'cwd':process[_0x571f2c(0x182)]()});if(!isSuccessfulResolution(_0x38df70))return _0x38df70['errorCode']===_0x571f2c(0x180)?(console['error'](a27_0x20437d[_0x571f2c(0x15c)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x571f2c(0x17a)](_0x571f2c(0x18e)),console[_0x571f2c(0x17a)]('\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[_0x571f2c(0x17a)](_0x571f2c(0x161))):(console[_0x571f2c(0x17a)](a27_0x20437d[_0x571f2c(0x198)](_0x571f2c(0x176)+_0x38df70[_0x571f2c(0x178)]+'\x0a')),_0x38df70[_0x571f2c(0x168)]&&console[_0x571f2c(0x17a)](a27_0x20437d[_0x571f2c(0x18d)](_0x38df70['helpText']))),0x1;const _0x58abb2=_0x38df70[_0x571f2c(0x15d)],_0x573790=_0x38df70[_0x571f2c(0x194)]===_0x571f2c(0x17f)?_0x38df70[_0x571f2c(0x169)]:undefined;if(!_0x573790&&!existsSync(_0x58abb2))return console[_0x571f2c(0x17a)](a27_0x20437d[_0x571f2c(0x198)](_0x571f2c(0x190)+_0x58abb2+'\x0a')),0x1;let _0x25aeb1;if(_0x573790){if(!_0x573790[_0x571f2c(0x191)](_0x571f2c(0x166))&&!_0x573790['endsWith'](_0x571f2c(0x174)))return console[_0x571f2c(0x17a)](a27_0x20437d[_0x571f2c(0x198)](_0x571f2c(0x16f)+_0x573790+'\x0a')),0x1;_0x25aeb1=[_0x573790];}else _0x25aeb1=findYamlFiles(_0x58abb2);if(_0x25aeb1[_0x571f2c(0x175)]===0x0)return console['error'](a27_0x20437d[_0x571f2c(0x198)](_0x571f2c(0x185)+_0x58abb2+'\x0a')),0x1;const _0x21d39b=validateYamlFiles(_0x25aeb1,_0x58abb2,{'filterType':_0x571f2c(0x183)}),_0x1b767b=calculateSummary(_0x21d39b),_0x4bdaaf=_0x21d39b[_0x571f2c(0x18a)](isValidationResult);if(_0x4bdaaf[_0x571f2c(0x175)]===0x0)return console[_0x571f2c(0x17a)](a27_0x20437d[_0x571f2c(0x15c)](_0x571f2c(0x171)+_0x58abb2+'\x0a')),_0x1b767b[_0x571f2c(0x177)]>0x0&&console[_0x571f2c(0x17a)](a27_0x20437d[_0x571f2c(0x15f)]('('+_0x1b767b['skippedCount']+'\x20segment\x20file(s)\x20skipped)')),0x0;for(const _0x1f347d of _0x21d39b){if(!isValidationResult(_0x1f347d)){_0x23aa82['verbose']&&console['log'](a27_0x20437d['dim']('-\x20'+_0x1f347d['relativePath']+_0x571f2c(0x162)+_0x1f347d[_0x571f2c(0x164)]+')'));continue;}const {relativePath:_0x49c29b,source:_0x44de94,result:_0x53660c}=_0x1f347d;if(_0x53660c[_0x571f2c(0x192)]&&_0x53660c[_0x571f2c(0x160)][_0x571f2c(0x175)]===0x0)_0x23aa82[_0x571f2c(0x172)]&&console[_0x571f2c(0x189)](a27_0x20437d['green']('✔\x20'+_0x49c29b));else _0x53660c[_0x571f2c(0x192)]?(console['log'](a27_0x20437d[_0x571f2c(0x15c)]('⚠\x20'+_0x49c29b+':\x20'+_0x53660c[_0x571f2c(0x160)][_0x571f2c(0x175)]+_0x571f2c(0x18c))),console['log'](formatValidationResult(_0x53660c,_0x44de94,_0x49c29b))):(console[_0x571f2c(0x189)](a27_0x20437d['red']('✖\x20'+_0x49c29b+':\x20'+_0x53660c[_0x571f2c(0x195)][_0x571f2c(0x175)]+'\x20error(s)')),console[_0x571f2c(0x189)](formatValidationResult(_0x53660c,_0x44de94,_0x49c29b)));}return console[_0x571f2c(0x189)](''),_0x1b767b[_0x571f2c(0x16b)]?(console[_0x571f2c(0x189)](a27_0x20437d[_0x571f2c(0x198)](_0x571f2c(0x17b)+_0x1b767b[_0x571f2c(0x15e)]+_0x571f2c(0x181)+_0x1b767b[_0x571f2c(0x165)]+_0x571f2c(0x179))),_0x1b767b[_0x571f2c(0x167)]>0x0&&console[_0x571f2c(0x189)](a27_0x20437d['yellow'](_0x1b767b[_0x571f2c(0x167)]+'\x20warning(s)\x20found')),_0x1b767b[_0x571f2c(0x177)]>0x0&&console[_0x571f2c(0x189)](a27_0x20437d[_0x571f2c(0x15f)](_0x1b767b['skippedCount']+'\x20segment\x20file(s)\x20skipped')),0x1):(console['log'](a27_0x20437d[_0x571f2c(0x197)](_0x571f2c(0x16a)+_0x1b767b['validCount']+_0x571f2c(0x18f))),_0x1b767b['warningCount']>0x0&&console[_0x571f2c(0x189)](a27_0x20437d[_0x571f2c(0x15c)](_0x1b767b['warningCount']+_0x571f2c(0x193))),_0x1b767b[_0x571f2c(0x177)]>0x0&&console[_0x571f2c(0x189)](a27_0x20437d[_0x571f2c(0x15f)](_0x1b767b['skippedCount']+'\x20segment\x20file(s)\x20skipped')),0x0);}}