@treasuredata/tdx 2026.4.15 → 2026.4.17

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 (220) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/tools/work-create-item.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/access-tracker.js +1 -1
  182. package/dist/sdk/workspace/frontmatter.js +1 -1
  183. package/dist/sdk/workspace/git.js +1 -1
  184. package/dist/sdk/workspace/index.js +1 -1
  185. package/dist/sdk/workspace/templates.js +1 -1
  186. package/dist/sdk/workspace/weekly.js +1 -1
  187. package/dist/sdk/workspace/wikilinks.js +1 -1
  188. package/dist/test-utils/command-runner.js +1 -1
  189. package/dist/test-utils/factories.js +1 -1
  190. package/dist/test-utils/fixtures.js +1 -1
  191. package/dist/test-utils/http-mock.js +1 -1
  192. package/dist/test-utils/index.js +1 -1
  193. package/dist/utils/async.js +1 -1
  194. package/dist/utils/colors.js +1 -1
  195. package/dist/utils/diff.js +1 -1
  196. package/dist/utils/file-permissions.js +1 -1
  197. package/dist/utils/file-reader.js +1 -1
  198. package/dist/utils/github-releases.js +1 -1
  199. package/dist/utils/global-cache.js +1 -1
  200. package/dist/utils/json-loader.js +1 -1
  201. package/dist/utils/local-cache.js +1 -1
  202. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  203. package/dist/utils/logger/formatters/index.js +1 -1
  204. package/dist/utils/logger/handlers/console-handler.js +1 -1
  205. package/dist/utils/logger/handlers/file-handler.js +1 -1
  206. package/dist/utils/logger/handlers/index.js +1 -1
  207. package/dist/utils/logger/handlers/null-handler.js +1 -1
  208. package/dist/utils/logger/index.js +1 -1
  209. package/dist/utils/logger/logger.js +1 -1
  210. package/dist/utils/logger/types.js +1 -1
  211. package/dist/utils/option-validation.js +1 -1
  212. package/dist/utils/process.js +1 -1
  213. package/dist/utils/prompt.js +1 -1
  214. package/dist/utils/spinner.js +1 -1
  215. package/dist/utils/sse-parser.js +1 -1
  216. package/dist/utils/string-utils.js +1 -1
  217. package/dist/utils/table-ref-parser.js +1 -1
  218. package/dist/utils/tdx-logger.js +1 -1
  219. package/dist/utils/version-check.js +1 -1
  220. package/package.json +1 -1
@@ -1 +1 @@
1
- const a25_0x6f718f=a25_0x4946;(function(_0x2e7f67,_0x41951b){const _0x5df441=a25_0x4946,_0x539564=_0x2e7f67();while(!![]){try{const _0x5343b5=-parseInt(_0x5df441(0x1cf))/0x1*(parseInt(_0x5df441(0x1cd))/0x2)+-parseInt(_0x5df441(0x1a1))/0x3*(parseInt(_0x5df441(0x1c6))/0x4)+parseInt(_0x5df441(0x1c8))/0x5*(parseInt(_0x5df441(0x1b7))/0x6)+parseInt(_0x5df441(0x1aa))/0x7*(parseInt(_0x5df441(0x1a6))/0x8)+parseInt(_0x5df441(0x1a5))/0x9*(parseInt(_0x5df441(0x1c7))/0xa)+parseInt(_0x5df441(0x1ad))/0xb*(parseInt(_0x5df441(0x1af))/0xc)+parseInt(_0x5df441(0x1bf))/0xd*(-parseInt(_0x5df441(0x1ac))/0xe);if(_0x5343b5===_0x41951b)break;else _0x539564['push'](_0x539564['shift']());}catch(_0x28e4a8){_0x539564['push'](_0x539564['shift']());}}}(a25_0x8fb6,0x2629e));function a25_0x8fb6(){const _0xf986e8=['execute','Validate\x20template\x20YAML\x20files','green','\x20template(s)\x20valid','19773lSUPfV','red','reason','engage:template:validate','resolve','dim','warnings','4hNGDKZ','1239220OPweFR','1420wAcnKz','\x20warning(s)\x20found','hasErrors','No\x20template\x20YAML\x20files\x20found\x20in\x20','Validation\x20failed:\x20','28AIMcxm','\x20template(s)\x20with\x20errors,\x20','20795kAXkeF','endsWith','skippedCount','546501ZJUhHU','\x20warning(s)','warningCount','name','9OXCDvr','41896HTTuJN','yellow','Error:\x20Directory\x20not\x20found:\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','364DKEuoE','dirname','2506MJhozm','669614lTbwYh','error','48KeDDhj','validCount','verbose','relativePath','\x20non-template\x20file(s)\x20skipped','valid','\x20(skipped:\x20','log','5538qJxMMO','length','invalidCount','Error:\x20No\x20YAML\x20files\x20found\x20in\x20'];a25_0x8fb6=function(){return _0xf986e8;};return a25_0x8fb6();}import{BaseCommand}from'./command.js';function a25_0x4946(_0x18e3d3,_0x30a9f3){_0x18e3d3=_0x18e3d3-0x19f;const _0x8fb61b=a25_0x8fb6();let _0x4946a4=_0x8fb61b[_0x18e3d3];return _0x4946a4;}import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a25_0x4bc9d6 from'chalk';import a25_0x455875 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a25_0x6f718f(0x1a4)]=a25_0x6f718f(0x1c2);['description']=a25_0x6f718f(0x1bc);async[a25_0x6f718f(0x1bb)](_0x14c3dd){const _0x224349=a25_0x6f718f,{options:_0x2fd546,args:_0x61415e}=_0x14c3dd,_0x50a963=_0x2fd546,_0x56c324=_0x61415e[0x0],_0x558285=_0x56c324?a25_0x455875[_0x224349(0x1c3)](_0x56c324):undefined,_0x5230bb=_0x558285?isYamlFile(_0x558285):![];let _0x19da5c,_0x566696;if(_0x5230bb&&_0x558285)_0x19da5c=a25_0x455875[_0x224349(0x1ab)](_0x558285),_0x566696=_0x558285;else _0x558285?_0x19da5c=_0x558285:_0x19da5c=process['cwd']();if(!_0x566696&&!existsSync(_0x19da5c))return console[_0x224349(0x1ae)](a25_0x4bc9d6['red'](_0x224349(0x1a8)+_0x19da5c+'\x0a')),0x1;let _0x37217a;if(_0x566696){if(!_0x566696[_0x224349(0x19f)]('.yml')&&!_0x566696['endsWith']('.yaml'))return console['error'](a25_0x4bc9d6[_0x224349(0x1c0)](_0x224349(0x1a9)+_0x566696+'\x0a')),0x1;_0x37217a=[_0x566696];}else _0x37217a=findYamlFiles(_0x19da5c);if(_0x37217a[_0x224349(0x1b8)]===0x0)return console[_0x224349(0x1ae)](a25_0x4bc9d6['red'](_0x224349(0x1ba)+_0x19da5c+'\x0a')),0x1;const _0x4cef6f=validateYamlFiles(_0x37217a,_0x19da5c,{'filterType':'template'}),_0xbb18ea=calculateSummary(_0x4cef6f),_0x18f5b3=_0x4cef6f['filter'](isValidationResult);if(_0x18f5b3[_0x224349(0x1b8)]===0x0)return console[_0x224349(0x1ae)](a25_0x4bc9d6[_0x224349(0x1a7)](_0x224349(0x1cb)+_0x19da5c+'\x0a')),_0xbb18ea[_0x224349(0x1a0)]>0x0&&console[_0x224349(0x1ae)](a25_0x4bc9d6[_0x224349(0x1c4)]('('+_0xbb18ea[_0x224349(0x1a0)]+'\x20non-template\x20file(s)\x20skipped)')),0x0;for(const _0x22d8ad of _0x4cef6f){if(!isValidationResult(_0x22d8ad)){_0x50a963[_0x224349(0x1b1)]&&console[_0x224349(0x1b6)](a25_0x4bc9d6[_0x224349(0x1c4)]('-\x20'+_0x22d8ad[_0x224349(0x1b2)]+_0x224349(0x1b5)+_0x22d8ad[_0x224349(0x1c1)]+')'));continue;}const {relativePath:_0xd81f05,source:_0xc6292f,result:_0x485288}=_0x22d8ad;if(_0x485288[_0x224349(0x1b4)]&&_0x485288['warnings'][_0x224349(0x1b8)]===0x0)_0x50a963['verbose']&&console[_0x224349(0x1b6)](a25_0x4bc9d6['green']('✔\x20'+_0xd81f05));else _0x485288[_0x224349(0x1b4)]?(console[_0x224349(0x1b6)](a25_0x4bc9d6['yellow']('⚠\x20'+_0xd81f05+':\x20'+_0x485288[_0x224349(0x1c5)][_0x224349(0x1b8)]+_0x224349(0x1a2))),console[_0x224349(0x1b6)](formatValidationResult(_0x485288,_0xc6292f,_0xd81f05))):(console[_0x224349(0x1b6)](a25_0x4bc9d6[_0x224349(0x1c0)]('✖\x20'+_0xd81f05+':\x20'+_0x485288['errors']['length']+'\x20error(s)')),console[_0x224349(0x1b6)](formatValidationResult(_0x485288,_0xc6292f,_0xd81f05)));}return console['log'](''),_0xbb18ea[_0x224349(0x1ca)]?(console[_0x224349(0x1b6)](a25_0x4bc9d6[_0x224349(0x1c0)](_0x224349(0x1cc)+_0xbb18ea[_0x224349(0x1b9)]+_0x224349(0x1ce)+_0xbb18ea[_0x224349(0x1b0)]+'\x20valid')),_0xbb18ea[_0x224349(0x1a3)]>0x0&&console[_0x224349(0x1b6)](a25_0x4bc9d6[_0x224349(0x1a7)](_0xbb18ea[_0x224349(0x1a3)]+_0x224349(0x1c9))),_0xbb18ea[_0x224349(0x1a0)]>0x0&&console[_0x224349(0x1b6)](a25_0x4bc9d6['dim'](_0xbb18ea[_0x224349(0x1a0)]+'\x20non-template\x20file(s)\x20skipped')),0x1):(console['log'](a25_0x4bc9d6[_0x224349(0x1bd)]('✔\x20All\x20'+_0xbb18ea[_0x224349(0x1b0)]+_0x224349(0x1be))),_0xbb18ea[_0x224349(0x1a3)]>0x0&&console[_0x224349(0x1b6)](a25_0x4bc9d6['yellow'](_0xbb18ea[_0x224349(0x1a3)]+_0x224349(0x1c9))),_0xbb18ea[_0x224349(0x1a0)]>0x0&&console[_0x224349(0x1b6)](a25_0x4bc9d6[_0x224349(0x1c4)](_0xbb18ea['skippedCount']+_0x224349(0x1b3))),0x0);}}
1
+ const a25_0x3c3440=a25_0x3aba;(function(_0x5d17d7,_0x146ada){const _0x5b103e=a25_0x3aba,_0x44ee30=_0x5d17d7();while(!![]){try{const _0x451237=-parseInt(_0x5b103e(0x1d9))/0x1*(parseInt(_0x5b103e(0x1da))/0x2)+-parseInt(_0x5b103e(0x1c8))/0x3*(-parseInt(_0x5b103e(0x1c4))/0x4)+parseInt(_0x5b103e(0x1bf))/0x5+-parseInt(_0x5b103e(0x1ce))/0x6+parseInt(_0x5b103e(0x1c2))/0x7*(-parseInt(_0x5b103e(0x1d3))/0x8)+parseInt(_0x5b103e(0x1ca))/0x9*(parseInt(_0x5b103e(0x1d1))/0xa)+-parseInt(_0x5b103e(0x1dc))/0xb*(-parseInt(_0x5b103e(0x1b7))/0xc);if(_0x451237===_0x146ada)break;else _0x44ee30['push'](_0x44ee30['shift']());}catch(_0xe99ee2){_0x44ee30['push'](_0x44ee30['shift']());}}}(a25_0x3b8c,0xed830));function a25_0x3aba(_0x498e5c,_0x3ff427){_0x498e5c=_0x498e5c-0x1aa;const _0x3b8cee=a25_0x3b8c();let _0x3aba30=_0x3b8cee[_0x498e5c];return _0x3aba30;}import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a25_0x4aeb7c from'chalk';import a25_0x55227e from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a25_0x3c3440(0x1b4)]=a25_0x3c3440(0x1b1);[a25_0x3c3440(0x1b8)]=a25_0x3c3440(0x1b0);async['execute'](_0x47b893){const _0x2ed22a=a25_0x3c3440,{options:_0xad8686,args:_0x296d1d}=_0x47b893,_0x5d8990=_0xad8686,_0x1cd4bb=_0x296d1d[0x0],_0xccf0a5=_0x1cd4bb?a25_0x55227e[_0x2ed22a(0x1c0)](_0x1cd4bb):undefined,_0xc9c7ca=_0xccf0a5?isYamlFile(_0xccf0a5):![];let _0x5d1f21,_0x1884a4;if(_0xc9c7ca&&_0xccf0a5)_0x5d1f21=a25_0x55227e[_0x2ed22a(0x1d8)](_0xccf0a5),_0x1884a4=_0xccf0a5;else _0xccf0a5?_0x5d1f21=_0xccf0a5:_0x5d1f21=process[_0x2ed22a(0x1b2)]();if(!_0x1884a4&&!existsSync(_0x5d1f21))return console['error'](a25_0x4aeb7c[_0x2ed22a(0x1cc)](_0x2ed22a(0x1aa)+_0x5d1f21+'\x0a')),0x1;let _0x4a38bc;if(_0x1884a4){if(!_0x1884a4['endsWith']('.yml')&&!_0x1884a4[_0x2ed22a(0x1b5)](_0x2ed22a(0x1dd)))return console[_0x2ed22a(0x1d5)](a25_0x4aeb7c[_0x2ed22a(0x1cc)](_0x2ed22a(0x1d0)+_0x1884a4+'\x0a')),0x1;_0x4a38bc=[_0x1884a4];}else _0x4a38bc=findYamlFiles(_0x5d1f21);if(_0x4a38bc[_0x2ed22a(0x1ae)]===0x0)return console[_0x2ed22a(0x1d5)](a25_0x4aeb7c[_0x2ed22a(0x1cc)](_0x2ed22a(0x1d4)+_0x5d1f21+'\x0a')),0x1;const _0x3225d8=validateYamlFiles(_0x4a38bc,_0x5d1f21,{'filterType':_0x2ed22a(0x1bc)}),_0x10a2cd=calculateSummary(_0x3225d8),_0x17f0a1=_0x3225d8[_0x2ed22a(0x1d2)](isValidationResult);if(_0x17f0a1[_0x2ed22a(0x1ae)]===0x0)return console[_0x2ed22a(0x1d5)](a25_0x4aeb7c[_0x2ed22a(0x1be)](_0x2ed22a(0x1cf)+_0x5d1f21+'\x0a')),_0x10a2cd['skippedCount']>0x0&&console[_0x2ed22a(0x1d5)](a25_0x4aeb7c[_0x2ed22a(0x1d7)]('('+_0x10a2cd[_0x2ed22a(0x1c1)]+_0x2ed22a(0x1ac))),0x0;for(const _0x503e46 of _0x3225d8){if(!isValidationResult(_0x503e46)){_0x5d8990['verbose']&&console[_0x2ed22a(0x1bb)](a25_0x4aeb7c[_0x2ed22a(0x1d7)]('-\x20'+_0x503e46[_0x2ed22a(0x1b3)]+_0x2ed22a(0x1b6)+_0x503e46['reason']+')'));continue;}const {relativePath:_0x36570d,source:_0x360c86,result:_0x76cbc1}=_0x503e46;if(_0x76cbc1['valid']&&_0x76cbc1[_0x2ed22a(0x1ba)][_0x2ed22a(0x1ae)]===0x0)_0x5d8990[_0x2ed22a(0x1c3)]&&console[_0x2ed22a(0x1bb)](a25_0x4aeb7c[_0x2ed22a(0x1cd)]('✔\x20'+_0x36570d));else _0x76cbc1[_0x2ed22a(0x1c5)]?(console[_0x2ed22a(0x1bb)](a25_0x4aeb7c[_0x2ed22a(0x1be)]('⚠\x20'+_0x36570d+':\x20'+_0x76cbc1['warnings'][_0x2ed22a(0x1ae)]+_0x2ed22a(0x1c6))),console[_0x2ed22a(0x1bb)](formatValidationResult(_0x76cbc1,_0x360c86,_0x36570d))):(console[_0x2ed22a(0x1bb)](a25_0x4aeb7c[_0x2ed22a(0x1cc)]('✖\x20'+_0x36570d+':\x20'+_0x76cbc1[_0x2ed22a(0x1af)][_0x2ed22a(0x1ae)]+'\x20error(s)')),console['log'](formatValidationResult(_0x76cbc1,_0x360c86,_0x36570d)));}return console[_0x2ed22a(0x1bb)](''),_0x10a2cd[_0x2ed22a(0x1b9)]?(console['log'](a25_0x4aeb7c[_0x2ed22a(0x1cc)](_0x2ed22a(0x1bd)+_0x10a2cd['invalidCount']+_0x2ed22a(0x1d6)+_0x10a2cd[_0x2ed22a(0x1cb)]+_0x2ed22a(0x1c7))),_0x10a2cd['warningCount']>0x0&&console['log'](a25_0x4aeb7c[_0x2ed22a(0x1be)](_0x10a2cd[_0x2ed22a(0x1c9)]+_0x2ed22a(0x1ab))),_0x10a2cd[_0x2ed22a(0x1c1)]>0x0&&console['log'](a25_0x4aeb7c[_0x2ed22a(0x1d7)](_0x10a2cd[_0x2ed22a(0x1c1)]+'\x20non-template\x20file(s)\x20skipped')),0x1):(console[_0x2ed22a(0x1bb)](a25_0x4aeb7c[_0x2ed22a(0x1cd)](_0x2ed22a(0x1ad)+_0x10a2cd['validCount']+'\x20template(s)\x20valid')),_0x10a2cd[_0x2ed22a(0x1c9)]>0x0&&console[_0x2ed22a(0x1bb)](a25_0x4aeb7c['yellow'](_0x10a2cd['warningCount']+'\x20warning(s)\x20found')),_0x10a2cd[_0x2ed22a(0x1c1)]>0x0&&console[_0x2ed22a(0x1bb)](a25_0x4aeb7c[_0x2ed22a(0x1d7)](_0x10a2cd[_0x2ed22a(0x1c1)]+_0x2ed22a(0x1db))),0x0);}}function a25_0x3b8c(){const _0xec19b2=['\x20non-template\x20file(s)\x20skipped','176FlGnWk','.yaml','Error:\x20Directory\x20not\x20found:\x20','\x20warning(s)\x20found','\x20non-template\x20file(s)\x20skipped)','✔\x20All\x20','length','errors','Validate\x20template\x20YAML\x20files','engage:template:validate','cwd','relativePath','name','endsWith','\x20(skipped:\x20','1807956xzdFxo','description','hasErrors','warnings','log','template','Validation\x20failed:\x20','yellow','3037710BNLGTd','resolve','skippedCount','12145PUossJ','verbose','3530592KBJkZA','valid','\x20warning(s)','\x20valid','3YhckRJ','warningCount','12142674BXjrzn','validCount','red','green','6995460pMzHjf','No\x20template\x20YAML\x20files\x20found\x20in\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','10YWHhnD','filter','5528crdXTL','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','error','\x20template(s)\x20with\x20errors,\x20','dim','dirname','1912341DhdUrx','2yauzFk'];a25_0x3b8c=function(){return _0xec19b2;};return a25_0x3b8c();}
@@ -1 +1 @@
1
- const a26_0x1c5d7a=a26_0x15ca;(function(_0x4b9d22,_0xe53b88){const _0xdef022=a26_0x15ca,_0x20a7f5=_0x4b9d22();while(!![]){try{const _0x3a95ee=parseInt(_0xdef022(0x171))/0x1*(parseInt(_0xdef022(0x172))/0x2)+-parseInt(_0xdef022(0x1c4))/0x3*(parseInt(_0xdef022(0x196))/0x4)+parseInt(_0xdef022(0x199))/0x5+-parseInt(_0xdef022(0x181))/0x6+-parseInt(_0xdef022(0x17e))/0x7*(parseInt(_0xdef022(0x17c))/0x8)+-parseInt(_0xdef022(0x184))/0x9+parseInt(_0xdef022(0x18f))/0xa*(parseInt(_0xdef022(0x179))/0xb);if(_0x3a95ee===_0xe53b88)break;else _0x20a7f5['push'](_0x20a7f5['shift']());}catch(_0x439865){_0x20a7f5['push'](_0x20a7f5['shift']());}}}(a26_0x1667,0x2a82b));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 a26_0x86c6b7 from'chalk';function formatDuration(_0x17c590){const _0x102f58=a26_0x15ca;if(_0x17c590<0x3c)return _0x17c590+'s';if(_0x17c590<0xe10)return Math[_0x102f58(0x1b7)](_0x17c590/0x3c)+'m\x20'+_0x17c590%0x3c+'s';const _0x195227=Math['floor'](_0x17c590/0xe10),_0x28392a=Math['floor'](_0x17c590%0xe10/0x3c);return _0x28392a>0x0?_0x195227+'h\x20'+_0x28392a+'m':_0x195227+'h';}function formatRelativeTime(_0x41f3d1){const _0x483ff7=a26_0x15ca,_0x219781=Date[_0x483ff7(0x1ac)]()-_0x41f3d1['getTime'](),_0x5ba276=Math['floor'](Math[_0x483ff7(0x17f)](_0x219781)/0x3e8);if(_0x5ba276<0x3c)return _0x483ff7(0x198);const _0x591592=Math[_0x483ff7(0x1b7)](_0x5ba276/0x3c);if(_0x591592<0x3c)return _0x591592+_0x483ff7(0x1a2);const _0x1d8f5c=Math[_0x483ff7(0x1b7)](_0x591592/0x3c);if(_0x1d8f5c<0x18)return _0x1d8f5c+_0x483ff7(0x1be);const _0xd92733=Math['floor'](_0x1d8f5c/0x18);if(_0xd92733<0x1e)return _0xd92733+_0x483ff7(0x1a9);return Math['floor'](_0xd92733/0x1e)+'mo\x20ago';}function a26_0x15ca(_0x50e865,_0x13cfc3){_0x50e865=_0x50e865-0x16a;const _0x166737=a26_0x1667();let _0x15caf6=_0x166737[_0x50e865];return _0x15caf6;}export class JobListCommand extends BaseCommand{[a26_0x1c5d7a(0x175)]=a26_0x1c5d7a(0x18e);[a26_0x1c5d7a(0x1b1)]=a26_0x1c5d7a(0x197);async[a26_0x1c5d7a(0x1a1)](_0x4374b5){const _0x31cd4c=a26_0x1c5d7a,{options:_0x505ddd,tdx:_0x341ca3}=_0x4374b5,_0x8d9cf=resolveLimit(_0x505ddd['limit'],DEFAULT_DISPLAY_LIMIT),_0x45ebff=_0x505ddd['status'];_0x505ddd[_0x31cd4c(0x1c0)]&&(console['error'](_0x31cd4c(0x176)+_0x8d9cf+_0x31cd4c(0x17b)),_0x45ebff&&console[_0x31cd4c(0x1ad)](_0x31cd4c(0x1b5)+_0x45ebff));const _0x4aca3a=await withSpinner(_0x31cd4c(0x1b4),()=>_0x341ca3[_0x31cd4c(0x18e)][_0x31cd4c(0x1b9)]({'from':0x0,'to':_0x8d9cf-0x1,'status':_0x45ebff}),{'verbose':_0x505ddd[_0x31cd4c(0x1c0)]}),_0x5a0054=_0x4aca3a[_0x31cd4c(0x16b)];console[_0x31cd4c(0x1ad)](_0x31cd4c(0x1c5)+_0x5a0054['length']+'\x20job'+(_0x5a0054[_0x31cd4c(0x18c)]!==0x1?'s':''));const _0x285ced=_0x505ddd[_0x31cd4c(0x187)];if(isStructuredFormat(_0x505ddd)){const _0x28ecda=_0x5a0054[_0x31cd4c(0x16e)](_0x3406cc=>{const _0x24c9ec=_0x31cd4c;let _0x3bf25b;if(_0x3406cc[_0x24c9ec(0x194)]&&_0x3406cc['end_at']){const _0x49551a=new Date(_0x3406cc[_0x24c9ec(0x194)])['getTime'](),_0x130666=new Date(_0x3406cc[_0x24c9ec(0x1a4)])[_0x24c9ec(0x1bc)]();_0x3bf25b=Math['round']((_0x130666-_0x49551a)/0x3e8);}return{'job_id':_0x3406cc[_0x24c9ec(0x1b2)],'type':_0x3406cc[_0x24c9ec(0x189)]===_0x24c9ec(0x1b3)?'trino':_0x3406cc[_0x24c9ec(0x189)],'status':_0x3406cc['status'],'user_name':_0x3406cc[_0x24c9ec(0x1aa)],'duration_sec':_0x3bf25b,'created_at':_0x3406cc[_0x24c9ec(0x1ba)],'started_at':_0x3406cc[_0x24c9ec(0x194)],'end_at':_0x3406cc[_0x24c9ec(0x1a4)]};});await handleSDKOutput(_0x28ecda,_0x505ddd);}else for(const _0x8e7357 of _0x5a0054){const _0x374810=_0x8e7357['status']==='success'?a26_0x86c6b7['green']:_0x8e7357[_0x31cd4c(0x1b6)]===_0x31cd4c(0x1ad)?a26_0x86c6b7['red']:a26_0x86c6b7['dim'],_0x430736=_0x374810(_0x8e7357[_0x31cd4c(0x1b6)]),_0x38f720=getJobUrl(_0x285ced,_0x8e7357['job_id']),_0x432556=hyperlink(_0x8e7357[_0x31cd4c(0x1b2)],_0x38f720),_0x4fcc1c=a26_0x86c6b7[_0x31cd4c(0x195)](_0x8e7357[_0x31cd4c(0x189)]===_0x31cd4c(0x1b3)?_0x31cd4c(0x1b8):_0x8e7357[_0x31cd4c(0x189)]),_0x2d42cc=[];if(_0x8e7357['start_at']&&_0x8e7357[_0x31cd4c(0x1a4)]){const _0x411254=Math[_0x31cd4c(0x170)]((new Date(_0x8e7357['end_at'])['getTime']()-new Date(_0x8e7357[_0x31cd4c(0x194)])[_0x31cd4c(0x1bc)]())/0x3e8);_0x2d42cc[_0x31cd4c(0x1c2)](formatDuration(_0x411254));}if(_0x8e7357[_0x31cd4c(0x1a4)])_0x2d42cc[_0x31cd4c(0x1c2)](formatRelativeTime(new Date(_0x8e7357[_0x31cd4c(0x1a4)])));else _0x8e7357[_0x31cd4c(0x194)]&&_0x2d42cc[_0x31cd4c(0x1c2)](formatRelativeTime(new Date(_0x8e7357[_0x31cd4c(0x194)])));const _0x3e9146=_0x2d42cc[_0x31cd4c(0x18c)]>0x0?a26_0x86c6b7[_0x31cd4c(0x195)]('\x20'+_0x2d42cc['join'](',\x20')):'';console[_0x31cd4c(0x186)]('⚡\x20'+_0x432556+'\x20'+_0x4fcc1c+'\x20'+_0x430736+_0x3e9146);}return 0x0;}}export class JobShowCommand extends BaseCommand{['name']=a26_0x1c5d7a(0x19a);[a26_0x1c5d7a(0x1b1)]='Show\x20job\x20details';['validate'](_0x3c7def){const _0x2ee969=a26_0x1c5d7a,_0x471a26=_0x3c7def['args'][0x0];if(!_0x471a26)return _0x2ee969(0x1a0);return undefined;}async[a26_0x1c5d7a(0x1a1)](_0x48ab9a){const _0x5dd5bb=a26_0x1c5d7a,{options:_0x555ef6,args:_0x4fa100,tdx:_0x4dae61}=_0x48ab9a,_0xffc6d8=_0x4fa100[0x0],_0x3ca7cb=await withSpinner(_0x5dd5bb(0x190),()=>_0x4dae61[_0x5dd5bb(0x18e)]['show'](_0xffc6d8),{'verbose':_0x555ef6[_0x5dd5bb(0x1c0)]}),_0x57b5d7=_0x3ca7cb[_0x5dd5bb(0x16b)];let _0x347123;if(_0x57b5d7[_0x5dd5bb(0x194)]&&_0x57b5d7[_0x5dd5bb(0x1a4)]){const _0x1f050a=new Date(_0x57b5d7[_0x5dd5bb(0x194)])[_0x5dd5bb(0x1bc)](),_0x495cb1=new Date(_0x57b5d7[_0x5dd5bb(0x1a4)])[_0x5dd5bb(0x1bc)]();_0x347123=Math['round']((_0x495cb1-_0x1f050a)/0x3e8);}const _0x5ce454={'job_id':_0x57b5d7[_0x5dd5bb(0x1b2)],'type':_0x57b5d7[_0x5dd5bb(0x189)],'status':_0x57b5d7[_0x5dd5bb(0x1b6)],..._0x57b5d7[_0x5dd5bb(0x1aa)]&&{'user_name':_0x57b5d7[_0x5dd5bb(0x1aa)]},..._0x347123!==undefined&&{'duration_sec':_0x347123},..._0x57b5d7[_0x5dd5bb(0x1ba)]&&{'created_at':_0x57b5d7[_0x5dd5bb(0x1ba)]},..._0x57b5d7['start_at']&&{'started_at':_0x57b5d7['start_at']},..._0x57b5d7[_0x5dd5bb(0x1a4)]&&{'end_at':_0x57b5d7[_0x5dd5bb(0x1a4)]},..._0x57b5d7[_0x5dd5bb(0x174)]&&{'database':_0x57b5d7[_0x5dd5bb(0x174)]},..._0x57b5d7['priority']!==undefined&&{'priority':_0x57b5d7[_0x5dd5bb(0x1bb)]},..._0x57b5d7['url']&&{'url':_0x57b5d7[_0x5dd5bb(0x16a)]},..._0x57b5d7[_0x5dd5bb(0x1a6)]&&{'query':_0x57b5d7[_0x5dd5bb(0x1a6)]},..._0x57b5d7[_0x5dd5bb(0x17a)]&&{'debug':_0x57b5d7[_0x5dd5bb(0x17a)]}};return await handleSingleObjectOutput(_0x5ce454,_0x555ef6),0x0;}}function a26_0x1667(){const _0x5d999e=['2071926VhMxIe','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','log','site','job:result','type','INVALID_ARGUMENT','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','length','Query:\x20','jobs','23990AnSgLo','Getting\x20job\x20details...','jobType','job:submit','job:kill','start_at','dim','1492nvDYUf','List\x20jobs','just\x20now','740265wCQcfa','job:show','Database:\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','Kill\x20a\x20job','args','Job\x20type:\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','execute','m\x20ago','Submitting\x20job...','end_at','validate','query','hive','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','d\x20ago','user_name','Getting\x20job\x20results...','now','error','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','Get\x20job\x20results','\x27\x20to\x20verify\x20the\x20job\x20status','description','job_id','presto','Listing\x20jobs...','Status\x20filter:\x20','status','floor','trino','list','created_at','priority','getTime','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','h\x20ago','...','verbose','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','push','✔\x20Retrieved\x20','141NsHbLT','✔\x20Found\x20','url','data','result','information_schema','map','kill','round','2UMRkqO','291580kunYVm','submit','database','name','Limit:\x20','Cancelled','No\x20SQL\x20statements\x20found\x20in\x20file','1650dgwIiB','debug','\x20jobs','8vuIgfl','\x20\x20Job\x20ID:\x20','1574181mLPkec','abs','file','916392xeNsMz','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','Submitting\x20kill\x20request...'];a26_0x1667=function(){return _0x5d999e;};return a26_0x1667();}export class JobKillCommand extends BaseCommand{[a26_0x1c5d7a(0x175)]=a26_0x1c5d7a(0x193);[a26_0x1c5d7a(0x1b1)]=a26_0x1c5d7a(0x19d);['validate'](_0x330b17){const _0x3b30ec=a26_0x1c5d7a,_0x57a19d=_0x330b17[_0x3b30ec(0x19e)][0x0];if(!_0x57a19d)return _0x3b30ec(0x19c);return undefined;}async['execute'](_0x53cb06){const _0x20404c=a26_0x1c5d7a,{options:_0x55b151,args:_0x59f173,tdx:_0x1492b3}=_0x53cb06,_0x2a5334=_0x59f173[0x0];if(!_0x55b151['yes']){const _0x375bcc=await confirm(_0x20404c(0x18b)+_0x2a5334+'?');if(!_0x375bcc)return console['error'](_0x20404c(0x177)),0x0;}return await withSpinner(_0x20404c(0x183),()=>_0x1492b3[_0x20404c(0x18e)][_0x20404c(0x16f)](_0x2a5334),{'verbose':_0x55b151[_0x20404c(0x1c0)]}),console[_0x20404c(0x1ad)](_0x20404c(0x1ae)+_0x2a5334),console[_0x20404c(0x1ad)](_0x20404c(0x1bd)+_0x2a5334+_0x20404c(0x1b0)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x1c5d7a(0x175)]=a26_0x1c5d7a(0x192);[a26_0x1c5d7a(0x1b1)]='Submit\x20a\x20job';async['execute'](_0x38efcc){const _0x3d2b5a=a26_0x1c5d7a,{options:_0x3b2f82,args:_0x5a506b,tdx:_0x21f0fb}=_0x38efcc,_0x343a9b=_0x3b2f82[_0x3d2b5a(0x191)]||_0x3d2b5a(0x1b8),_0x4a776f=_0x3b2f82[_0x3d2b5a(0x180)],_0x2b068f=_0x3b2f82['database']||_0x3d2b5a(0x16d),_0xd0d2e1=_0x3b2f82[_0x3d2b5a(0x16c)];if(_0x343a9b!==_0x3d2b5a(0x1b8)&&_0x343a9b!==_0x3d2b5a(0x1a7))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3d2b5a(0x185));let _0x52f74e;if(_0x4a776f){if(_0x5a506b[0x0])throw new SDKError(ErrorCode[_0x3d2b5a(0x18a)],_0x3d2b5a(0x1a8));const _0x251f40=readSqlStatementsFromFile(_0x4a776f);if(_0x251f40[_0x3d2b5a(0x18c)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3d2b5a(0x178));if(_0x251f40[_0x3d2b5a(0x18c)]>0x1)throw new SDKError(ErrorCode[_0x3d2b5a(0x18a)],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x52f74e=_0x251f40[0x0];}else{if(!_0x5a506b[0x0])throw new SDKError(ErrorCode[_0x3d2b5a(0x18a)],_0x3d2b5a(0x1c1));_0x52f74e=_0x5a506b[0x0];}_0x3b2f82[_0x3d2b5a(0x1c0)]&&(console[_0x3d2b5a(0x1ad)](_0x3d2b5a(0x19f)+_0x343a9b),console[_0x3d2b5a(0x1ad)](_0x3d2b5a(0x19b)+_0x2b068f),console[_0x3d2b5a(0x1ad)](_0x3d2b5a(0x18d)+_0x52f74e['substring'](0x0,0x64)+(_0x52f74e[_0x3d2b5a(0x18c)]>0x64?_0x3d2b5a(0x1bf):'')));const _0x3db1ab=await withSpinner(_0x3d2b5a(0x1a3),()=>_0x21f0fb[_0x3d2b5a(0x18e)][_0x3d2b5a(0x173)](_0x2b068f,_0x52f74e,_0x343a9b,_0xd0d2e1),{'verbose':_0x3b2f82[_0x3d2b5a(0x1c0)]}),_0x1430c3=_0x3db1ab[_0x3d2b5a(0x16b)];return console['error']('✔\x20Job\x20submitted'),console[_0x3d2b5a(0x1ad)](_0x3d2b5a(0x17d)+_0x1430c3[_0x3d2b5a(0x1b2)]),await handleSDKOutput([_0x1430c3],_0x3b2f82),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x1c5d7a(0x175)]=a26_0x1c5d7a(0x188);[a26_0x1c5d7a(0x1b1)]=a26_0x1c5d7a(0x1af);[a26_0x1c5d7a(0x1a5)](_0x276926){const _0x22fea4=a26_0x1c5d7a,_0x376db2=_0x276926['args'][0x0];if(!_0x376db2)return _0x22fea4(0x182);return undefined;}async[a26_0x1c5d7a(0x1a1)](_0x483c04){const _0x46901e=a26_0x1c5d7a,{options:_0x201d6c,args:_0x492825,tdx:_0x3d0436}=_0x483c04,_0x3e4ca7=_0x492825[0x0],_0x1a80c8=await withSpinner(_0x46901e(0x1ab),()=>_0x3d0436['jobs'][_0x46901e(0x16c)](_0x3e4ca7),{'verbose':_0x201d6c[_0x46901e(0x1c0)]}),_0xd15f19=_0x1a80c8['data'];return console['error'](_0x46901e(0x1c3)+_0xd15f19['length']+'\x20row'+(_0xd15f19[_0x46901e(0x18c)]!==0x1?'s':'')),await handleSDKOutput(_0xd15f19,_0x201d6c),0x0;}}
1
+ const a26_0x4c8fab=a26_0x12d6;(function(_0x26e790,_0x227ac6){const _0x5579f7=a26_0x12d6,_0x4fa1bf=_0x26e790();while(!![]){try{const _0xb49d78=parseInt(_0x5579f7(0x111))/0x1+parseInt(_0x5579f7(0x113))/0x2*(-parseInt(_0x5579f7(0xec))/0x3)+-parseInt(_0x5579f7(0x122))/0x4+-parseInt(_0x5579f7(0x11c))/0x5+-parseInt(_0x5579f7(0xf9))/0x6*(-parseInt(_0x5579f7(0x127))/0x7)+parseInt(_0x5579f7(0x116))/0x8+parseInt(_0x5579f7(0x12a))/0x9;if(_0xb49d78===_0x227ac6)break;else _0x4fa1bf['push'](_0x4fa1bf['shift']());}catch(_0x309081){_0x4fa1bf['push'](_0x4fa1bf['shift']());}}}(a26_0x4461,0xcb63d));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a26_0x4461(){const _0x5282e1=['4606301hfCfaU','map','job:submit','6789663hJYOUd','Database:\x20','information_schema','verbose','created_at','Show\x20job\x20details','length','start_at','dim','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','url','...','trino','presto','validate','debug','floor','description','job_id','name','end_at','limit','1321959ytAdvs','now','priority','Limit:\x20','kill','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','job:result','h\x20ago','✔\x20Retrieved\x20','database','submit','✔\x20Job\x20submitted','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','6efEkWo','green','\x20jobs','Kill\x20a\x20job','error','getTime','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','INVALID_ARGUMENT','Query:\x20','Status\x20filter:\x20','execute','status','args','abs','round','job:show','\x20row','Job\x20type:\x20','Getting\x20job\x20details...','red','substring','\x27\x20to\x20verify\x20the\x20job\x20status','just\x20now','data','870938BUdAvr','✔\x20Found\x20','2KKMyiy','Submitting\x20kill\x20request...','result','7058768FLiGVL','query','jobs','file','type','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','3276540HYcclC','jobType','job:kill','m\x20ago','yes','push','4946752yKhiSm','No\x20SQL\x20statements\x20found\x20in\x20file','show','hive','success'];a26_0x4461=function(){return _0x5282e1;};return a26_0x4461();}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 a26_0x5f26be from'chalk';function formatDuration(_0x25c88a){const _0x140105=a26_0x12d6;if(_0x25c88a<0x3c)return _0x25c88a+'s';if(_0x25c88a<0xe10)return Math[_0x140105(0xe6)](_0x25c88a/0x3c)+'m\x20'+_0x25c88a%0x3c+'s';const _0x1fede5=Math[_0x140105(0xe6)](_0x25c88a/0xe10),_0x1db484=Math[_0x140105(0xe6)](_0x25c88a%0xe10/0x3c);return _0x1db484>0x0?_0x1fede5+'h\x20'+_0x1db484+'m':_0x1fede5+'h';}function formatRelativeTime(_0x1f1869){const _0x5bbbff=a26_0x12d6,_0x31e744=Date[_0x5bbbff(0xed)]()-_0x1f1869['getTime'](),_0x1ba0f7=Math['floor'](Math[_0x5bbbff(0x106)](_0x31e744)/0x3e8);if(_0x1ba0f7<0x3c)return _0x5bbbff(0x10f);const _0x321a74=Math[_0x5bbbff(0xe6)](_0x1ba0f7/0x3c);if(_0x321a74<0x3c)return _0x321a74+_0x5bbbff(0x11f);const _0x1d2ceb=Math[_0x5bbbff(0xe6)](_0x321a74/0x3c);if(_0x1d2ceb<0x18)return _0x1d2ceb+_0x5bbbff(0xf3);const _0x202601=Math[_0x5bbbff(0xe6)](_0x1d2ceb/0x18);if(_0x202601<0x1e)return _0x202601+'d\x20ago';return Math[_0x5bbbff(0xe6)](_0x202601/0x1e)+'mo\x20ago';}function a26_0x12d6(_0x3a7451,_0x125f56){_0x3a7451=_0x3a7451-0xde;const _0x44612f=a26_0x4461();let _0x12d68b=_0x44612f[_0x3a7451];return _0x12d68b;}export class JobListCommand extends BaseCommand{[a26_0x4c8fab(0xe9)]=a26_0x4c8fab(0x118);[a26_0x4c8fab(0xe7)]='List\x20jobs';async['execute'](_0x116a26){const _0x4239ad=a26_0x4c8fab,{options:_0x279404,tdx:_0x4835d1}=_0x116a26,_0x4470a3=resolveLimit(_0x279404[_0x4239ad(0xeb)],DEFAULT_DISPLAY_LIMIT),_0x1d07c2=_0x279404[_0x4239ad(0x104)];_0x279404[_0x4239ad(0x12d)]&&(console['error'](_0x4239ad(0xef)+_0x4470a3+_0x4239ad(0xfb)),_0x1d07c2&&console[_0x4239ad(0xfd)](_0x4239ad(0x102)+_0x1d07c2));const _0x37eb50=await withSpinner('Listing\x20jobs...',()=>_0x4835d1[_0x4239ad(0x118)]['list']({'from':0x0,'to':_0x4470a3-0x1,'status':_0x1d07c2}),{'verbose':_0x279404[_0x4239ad(0x12d)]}),_0x32dca0=_0x37eb50[_0x4239ad(0x110)];console[_0x4239ad(0xfd)](_0x4239ad(0x112)+_0x32dca0[_0x4239ad(0x130)]+'\x20job'+(_0x32dca0['length']!==0x1?'s':''));const _0xfe4674=_0x279404['site'];if(isStructuredFormat(_0x279404)){const _0xa1b50b=_0x32dca0[_0x4239ad(0x128)](_0x4c18c2=>{const _0x419dec=_0x4239ad;let _0x5bd094;if(_0x4c18c2['start_at']&&_0x4c18c2['end_at']){const _0x397cc5=new Date(_0x4c18c2[_0x419dec(0x131)])[_0x419dec(0xfe)](),_0x268761=new Date(_0x4c18c2[_0x419dec(0xea)])['getTime']();_0x5bd094=Math[_0x419dec(0x107)]((_0x268761-_0x397cc5)/0x3e8);}return{'job_id':_0x4c18c2[_0x419dec(0xe8)],'type':_0x4c18c2[_0x419dec(0x11a)]===_0x419dec(0xe3)?_0x419dec(0xe2):_0x4c18c2[_0x419dec(0x11a)],'status':_0x4c18c2[_0x419dec(0x104)],'user_name':_0x4c18c2['user_name'],'duration_sec':_0x5bd094,'created_at':_0x4c18c2[_0x419dec(0x12e)],'started_at':_0x4c18c2[_0x419dec(0x131)],'end_at':_0x4c18c2[_0x419dec(0xea)]};});await handleSDKOutput(_0xa1b50b,_0x279404);}else for(const _0x1e138e of _0x32dca0){const _0x5f4058=_0x1e138e['status']===_0x4239ad(0x126)?a26_0x5f26be[_0x4239ad(0xfa)]:_0x1e138e[_0x4239ad(0x104)]==='error'?a26_0x5f26be[_0x4239ad(0x10c)]:a26_0x5f26be[_0x4239ad(0xde)],_0x14a2e7=_0x5f4058(_0x1e138e['status']),_0x24c83d=getJobUrl(_0xfe4674,_0x1e138e[_0x4239ad(0xe8)]),_0x2ace94=hyperlink(_0x1e138e['job_id'],_0x24c83d),_0x5e1005=a26_0x5f26be['dim'](_0x1e138e[_0x4239ad(0x11a)]===_0x4239ad(0xe3)?_0x4239ad(0xe2):_0x1e138e[_0x4239ad(0x11a)]),_0x112989=[];if(_0x1e138e[_0x4239ad(0x131)]&&_0x1e138e['end_at']){const _0x3a1cb1=Math[_0x4239ad(0x107)]((new Date(_0x1e138e[_0x4239ad(0xea)])[_0x4239ad(0xfe)]()-new Date(_0x1e138e[_0x4239ad(0x131)])[_0x4239ad(0xfe)]())/0x3e8);_0x112989[_0x4239ad(0x121)](formatDuration(_0x3a1cb1));}if(_0x1e138e['end_at'])_0x112989[_0x4239ad(0x121)](formatRelativeTime(new Date(_0x1e138e[_0x4239ad(0xea)])));else _0x1e138e[_0x4239ad(0x131)]&&_0x112989[_0x4239ad(0x121)](formatRelativeTime(new Date(_0x1e138e['start_at'])));const _0x126e7e=_0x112989[_0x4239ad(0x130)]>0x0?a26_0x5f26be[_0x4239ad(0xde)]('\x20'+_0x112989['join'](',\x20')):'';console['log']('⚡\x20'+_0x2ace94+'\x20'+_0x5e1005+'\x20'+_0x14a2e7+_0x126e7e);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x4c8fab(0xe9)]=a26_0x4c8fab(0x108);['description']=a26_0x4c8fab(0x12f);[a26_0x4c8fab(0xe4)](_0x590696){const _0x47cfd7=a26_0x4c8fab,_0x26e128=_0x590696[_0x47cfd7(0x105)][0x0];if(!_0x26e128)return _0x47cfd7(0xdf);return undefined;}async[a26_0x4c8fab(0x103)](_0x2a4095){const _0x949871=a26_0x4c8fab,{options:_0x5e8243,args:_0x4d6cb9,tdx:_0xa26c5}=_0x2a4095,_0x2d3813=_0x4d6cb9[0x0],_0x558a2b=await withSpinner(_0x949871(0x10b),()=>_0xa26c5[_0x949871(0x118)][_0x949871(0x124)](_0x2d3813),{'verbose':_0x5e8243[_0x949871(0x12d)]}),_0x53bf9b=_0x558a2b[_0x949871(0x110)];let _0x4c8787;if(_0x53bf9b[_0x949871(0x131)]&&_0x53bf9b[_0x949871(0xea)]){const _0x24bb83=new Date(_0x53bf9b['start_at'])[_0x949871(0xfe)](),_0x11e7c9=new Date(_0x53bf9b[_0x949871(0xea)])['getTime']();_0x4c8787=Math[_0x949871(0x107)]((_0x11e7c9-_0x24bb83)/0x3e8);}const _0x7c2afc={'job_id':_0x53bf9b['job_id'],'type':_0x53bf9b[_0x949871(0x11a)],'status':_0x53bf9b['status'],..._0x53bf9b['user_name']&&{'user_name':_0x53bf9b['user_name']},..._0x4c8787!==undefined&&{'duration_sec':_0x4c8787},..._0x53bf9b['created_at']&&{'created_at':_0x53bf9b[_0x949871(0x12e)]},..._0x53bf9b[_0x949871(0x131)]&&{'started_at':_0x53bf9b['start_at']},..._0x53bf9b[_0x949871(0xea)]&&{'end_at':_0x53bf9b[_0x949871(0xea)]},..._0x53bf9b[_0x949871(0xf5)]&&{'database':_0x53bf9b[_0x949871(0xf5)]},..._0x53bf9b[_0x949871(0xee)]!==undefined&&{'priority':_0x53bf9b[_0x949871(0xee)]},..._0x53bf9b['url']&&{'url':_0x53bf9b[_0x949871(0xe0)]},..._0x53bf9b[_0x949871(0x117)]&&{'query':_0x53bf9b['query']},..._0x53bf9b[_0x949871(0xe5)]&&{'debug':_0x53bf9b[_0x949871(0xe5)]}};return await handleSingleObjectOutput(_0x7c2afc,_0x5e8243),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x4c8fab(0xe9)]=a26_0x4c8fab(0x11e);['description']=a26_0x4c8fab(0xfc);['validate'](_0x5d9eab){const _0x96af31=a26_0x4c8fab,_0x3f1dd=_0x5d9eab[_0x96af31(0x105)][0x0];if(!_0x3f1dd)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>';return undefined;}async[a26_0x4c8fab(0x103)](_0x3991ac){const _0x3896f6=a26_0x4c8fab,{options:_0x1283ae,args:_0x4e2d00,tdx:_0x18628a}=_0x3991ac,_0x212bb2=_0x4e2d00[0x0];if(!_0x1283ae[_0x3896f6(0x120)]){const _0x360a7b=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20'+_0x212bb2+'?');if(!_0x360a7b)return console[_0x3896f6(0xfd)]('Cancelled'),0x0;}return await withSpinner(_0x3896f6(0x114),()=>_0x18628a[_0x3896f6(0x118)][_0x3896f6(0xf0)](_0x212bb2),{'verbose':_0x1283ae['verbose']}),console[_0x3896f6(0xfd)](_0x3896f6(0xf1)+_0x212bb2),console[_0x3896f6(0xfd)]('\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20'+_0x212bb2+_0x3896f6(0x10e)),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']=a26_0x4c8fab(0x129);['description']='Submit\x20a\x20job';async[a26_0x4c8fab(0x103)](_0x4c531f){const _0x203b27=a26_0x4c8fab,{options:_0x17122b,args:_0x52e150,tdx:_0x5da3bd}=_0x4c531f,_0x258810=_0x17122b[_0x203b27(0x11d)]||'trino',_0x270e22=_0x17122b[_0x203b27(0x119)],_0x14ffc3=_0x17122b[_0x203b27(0xf5)]||_0x203b27(0x12c),_0x159802=_0x17122b['result'];if(_0x258810!==_0x203b27(0xe2)&&_0x258810!==_0x203b27(0x125))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22');let _0x5ee610;if(_0x270e22){if(_0x52e150[0x0])throw new SDKError(ErrorCode[_0x203b27(0x100)],_0x203b27(0x11b));const _0x4e2005=readSqlStatementsFromFile(_0x270e22);if(_0x4e2005['length']===0x0)throw new SDKError(ErrorCode[_0x203b27(0x100)],_0x203b27(0x123));if(_0x4e2005[_0x203b27(0x130)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x203b27(0xff));_0x5ee610=_0x4e2005[0x0];}else{if(!_0x52e150[0x0])throw new SDKError(ErrorCode[_0x203b27(0x100)],'Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>');_0x5ee610=_0x52e150[0x0];}_0x17122b['verbose']&&(console[_0x203b27(0xfd)](_0x203b27(0x10a)+_0x258810),console[_0x203b27(0xfd)](_0x203b27(0x12b)+_0x14ffc3),console[_0x203b27(0xfd)](_0x203b27(0x101)+_0x5ee610[_0x203b27(0x10d)](0x0,0x64)+(_0x5ee610[_0x203b27(0x130)]>0x64?_0x203b27(0xe1):'')));const _0x5b0dd6=await withSpinner('Submitting\x20job...',()=>_0x5da3bd[_0x203b27(0x118)][_0x203b27(0xf6)](_0x14ffc3,_0x5ee610,_0x258810,_0x159802),{'verbose':_0x17122b['verbose']}),_0x242d4e=_0x5b0dd6[_0x203b27(0x110)];return console[_0x203b27(0xfd)](_0x203b27(0xf7)),console[_0x203b27(0xfd)]('\x20\x20Job\x20ID:\x20'+_0x242d4e[_0x203b27(0xe8)]),await handleSDKOutput([_0x242d4e],_0x17122b),0x0;}}export class JobResultCommand extends BaseCommand{['name']=a26_0x4c8fab(0xf2);[a26_0x4c8fab(0xe7)]='Get\x20job\x20results';[a26_0x4c8fab(0xe4)](_0x57f6d5){const _0x20e30d=a26_0x4c8fab,_0xcb3f9=_0x57f6d5[_0x20e30d(0x105)][0x0];if(!_0xcb3f9)return _0x20e30d(0xf8);return undefined;}async[a26_0x4c8fab(0x103)](_0x14c3e5){const _0x133220=a26_0x4c8fab,{options:_0x1aca60,args:_0x14a6ab,tdx:_0x2a53e5}=_0x14c3e5,_0x3591f0=_0x14a6ab[0x0],_0x286f7e=await withSpinner('Getting\x20job\x20results...',()=>_0x2a53e5['jobs'][_0x133220(0x115)](_0x3591f0),{'verbose':_0x1aca60[_0x133220(0x12d)]}),_0x44d01f=_0x286f7e[_0x133220(0x110)];return console[_0x133220(0xfd)](_0x133220(0xf4)+_0x44d01f[_0x133220(0x130)]+_0x133220(0x109)+(_0x44d01f[_0x133220(0x130)]!==0x1?'s':'')),await handleSDKOutput(_0x44d01f,_0x1aca60),0x0;}}
@@ -1 +1 @@
1
- const a27_0x57c5c2=a27_0x3061;(function(_0x353b19,_0x2ea4d8){const _0x4226bc=a27_0x3061,_0x35b484=_0x353b19();while(!![]){try{const _0x409cec=-parseInt(_0x4226bc(0x161))/0x1+parseInt(_0x4226bc(0x1a4))/0x2+parseInt(_0x4226bc(0x1e4))/0x3*(parseInt(_0x4226bc(0x1b6))/0x4)+-parseInt(_0x4226bc(0x1de))/0x5+-parseInt(_0x4226bc(0x1b0))/0x6*(parseInt(_0x4226bc(0x155))/0x7)+-parseInt(_0x4226bc(0x190))/0x8*(-parseInt(_0x4226bc(0x189))/0x9)+-parseInt(_0x4226bc(0x1a0))/0xa*(parseInt(_0x4226bc(0x208))/0xb);if(_0x409cec===_0x2ea4d8)break;else _0x35b484['push'](_0x35b484['shift']());}catch(_0x2d0412){_0x35b484['push'](_0x35b484['shift']());}}}(a27_0x4d3e,0x830d9));import a27_0x53b983 from'chalk';import a27_0xbd78d4 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';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';function a27_0x3061(_0x2aa08c,_0x212af5){_0x2aa08c=_0x2aa08c-0x10e;const _0x4d3e7b=a27_0x4d3e();let _0x306117=_0x4d3e7b[_0x2aa08c];return _0x306117;}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(_0x400980){const _0x1a4da3=a27_0x3061;return!_0x400980&&(console['error'](_0x1a4da3(0x225)),console[_0x1a4da3(0x12a)](_0x1a4da3(0x135))),!!_0x400980;}function withJsonFormat(_0x1aabda){const _0x466548=a27_0x3061;if(!_0x1aabda[_0x466548(0x13a)]&&!_0x1aabda['json']&&!_0x1aabda[_0x466548(0x15a)]&&!_0x1aabda[_0x466548(0x146)])return{..._0x1aabda,'format':_0x466548(0x1ab),'json':!![]};return _0x1aabda;}function formatJourneyState(_0x2cfc7a){const _0x4b02b8=a27_0x3061;switch(_0x2cfc7a){case _0x4b02b8(0x1c9):return a27_0x53b983['green'](_0x4b02b8(0x140));case _0x4b02b8(0x16e):return a27_0x53b983[_0x4b02b8(0x1ef)](_0x4b02b8(0x19f));case _0x4b02b8(0x117):return a27_0x53b983['yellow'](_0x4b02b8(0x151));case _0x4b02b8(0x1c4):return a27_0x53b983[_0x4b02b8(0x1f6)]('(completed)');case _0x4b02b8(0x205):return a27_0x53b983[_0x4b02b8(0x1ef)](_0x4b02b8(0x1d1));default:return'('+_0x2cfc7a+')';}}function formatJourneyItem(_0x15257d,_0x2039a1='',_0x25b05e){const _0x154bae=a27_0x3061,_0x52845d=formatJourneyState(_0x15257d[_0x154bae(0x181)]),_0x2ab5c3=_0x25b05e?hyperlink(_0x15257d[_0x154bae(0x1bc)],_0x25b05e):_0x15257d['journeyBundleName'];return _0x2039a1+_0x154bae(0x129)+_0x2ab5c3+'\x20'+_0x52845d;}function escapeRegex(_0xea1849){const _0x1b2929=a27_0x3061;return _0xea1849[_0x1b2929(0x19b)](/[.*+?^${}()|[\]\\]/g,_0x1b2929(0x1d4));}function globToRegex(_0x3beb16){const _0x24c94c=a27_0x3061,_0x2c2e4c=_0x3beb16['split']('*')[_0x24c94c(0x197)](escapeRegex);return new RegExp(_0x2c2e4c[_0x24c94c(0x18a)]('.*'),'i');}function buildRuleToNameMapping(_0x36b52b){const _0x5a7fee=a27_0x3061,_0x518afd=new Map();if(_0x36b52b[_0x5a7fee(0x152)])for(const [_0x66af5,_0x35c156]of Object[_0x5a7fee(0x1cf)](_0x36b52b[_0x5a7fee(0x152)])){if(_0x35c156[_0x5a7fee(0x1aa)]){const _0x358ca3=serializeRule(_0x35c156[_0x5a7fee(0x1aa)]),_0x1dc69d=_0x518afd[_0x5a7fee(0x1f3)](_0x358ca3);_0x1dc69d?_0x1dc69d[_0x5a7fee(0x222)](_0x66af5):_0x518afd[_0x5a7fee(0x20c)](_0x358ca3,[_0x66af5]);}}return _0x518afd;}async function resolveJourneyIdFromInput(_0x8061d3,_0x10d10d,_0x5e376c){const _0x5ca70f=a27_0x3061,_0x2f3e49=await resolveJourneyTarget(_0x8061d3,_0x10d10d[_0x5ca70f(0x1e8)],_0x10d10d[_0x5ca70f(0x128)]),_0x17cac3=_0x2f3e49[_0x5ca70f(0x1e8)];if(!_0x17cac3)throw new SDKError(ErrorCode[_0x5ca70f(0x165)],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0x291369=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x5e376c[_0x5ca70f(0x17c)][_0x5ca70f(0x142)](_0x17cac3),{'verbose':_0x10d10d[_0x5ca70f(0x128)]}),_0x3c6500=_0x291369[_0x5ca70f(0x125)],_0x12ecc9=await withSpinner(_0x5ca70f(0x1bf),()=>_0x5e376c[_0x5ca70f(0x17b)][_0x5ca70f(0x1d0)](_0x3c6500,_0x2f3e49['journeyName']),{'verbose':_0x10d10d[_0x5ca70f(0x128)]});return{'journeyId':_0x12ecc9[_0x5ca70f(0x125)],'journeyName':_0x2f3e49['journeyName'],'parentSegmentId':_0x3c6500};}async function resolveJourneyTarget(_0x3dd537,_0x52b46f,_0x4ca208){const _0x433aec=a27_0x3061;if(isYamlFilePath(_0x3dd537))try{const _0x1a1374=await resolveYamlFilePath(_0x3dd537);return _0x4ca208&&(console[_0x433aec(0x12a)](_0x433aec(0x176)+_0x3dd537),console[_0x433aec(0x12a)](_0x433aec(0x1e1)+_0x1a1374[_0x433aec(0x1e8)]),console[_0x433aec(0x12a)](_0x433aec(0x1ad)+_0x1a1374['segmentName']),console[_0x433aec(0x12a)](_0x433aec(0x1f0)+(_0x1a1374[_0x433aec(0x124)]||_0x433aec(0x206)))),{'journeyName':_0x1a1374[_0x433aec(0x182)],'parentSegment':_0x1a1374[_0x433aec(0x1e8)],'resolved':_0x1a1374};}catch(_0x2f446d){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x433aec(0x11b)+_0x2f446d[_0x433aec(0x1ae)]);}if(!_0x52b46f)throw new SDKError(ErrorCode[_0x433aec(0x165)],_0x433aec(0x224));return{'journeyName':_0x3dd537,'parentSegment':_0x52b46f};}export class JourneyListCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]=a27_0x57c5c2(0x1ed);[a27_0x57c5c2(0x20b)]=a27_0x57c5c2(0x1ac);async['execute'](_0x56fb3d){const _0x2b4266=a27_0x57c5c2,{options:_0x395e8b,args:_0x48ea4b,tdx:_0x438dd4}=_0x56fb3d,_0x5a55b6=_0x48ea4b[0x0],_0x4e7c30=_0x395e8b['parentSegment'];if(!_0x4e7c30)return console['error'](_0x2b4266(0x112)),console[_0x2b4266(0x12a)](_0x2b4266(0x1f5)),0x1;const _0x420108=await withSpinner(_0x2b4266(0x170),()=>_0x438dd4[_0x2b4266(0x17c)]['resolveParentId'](_0x4e7c30),{'verbose':_0x395e8b[_0x2b4266(0x128)]}),_0x84c4eb=_0x420108['data'];_0x395e8b[_0x2b4266(0x128)]&&(console[_0x2b4266(0x12a)](_0x2b4266(0x15f)+_0x4e7c30+_0x2b4266(0x1c3)+_0x84c4eb+')'),_0x5a55b6&&console[_0x2b4266(0x12a)]('Pattern:\x20'+_0x5a55b6));const _0x9f633=await withSpinner(_0x2b4266(0x114),()=>_0x438dd4[_0x2b4266(0x17c)][_0x2b4266(0x10e)](_0x84c4eb),{'verbose':_0x395e8b['verbose']}),_0x30fc09=_0x9f633[_0x2b4266(0x125)],_0x4d71af=_0x30fc09[_0x2b4266(0x175)],_0x45f84a=await withSpinner(_0x2b4266(0x186),()=>_0x438dd4[_0x2b4266(0x17b)][_0x2b4266(0x1ca)](_0x84c4eb,_0x4d71af),{'verbose':_0x395e8b[_0x2b4266(0x128)]});let _0x558964=_0x45f84a[_0x2b4266(0x125)][_0x2b4266(0x13e)];const _0x39c1ca=_0x45f84a['data'][_0x2b4266(0x15d)],_0x238a97=new Map();for(const _0x43d8d3 of _0x39c1ca){_0x238a97[_0x2b4266(0x20c)](_0x43d8d3['id'],_0x43d8d3[_0x2b4266(0x1c8)]);}if(_0x5a55b6){const _0x5bdb70=globToRegex(_0x5a55b6);_0x558964=_0x558964[_0x2b4266(0x1f4)](_0x255f90=>_0x5bdb70[_0x2b4266(0x171)](_0x255f90[_0x2b4266(0x1bc)]));}console[_0x2b4266(0x12a)](_0x2b4266(0x144)+_0x558964[_0x2b4266(0x157)]+_0x2b4266(0x19c)+(_0x558964[_0x2b4266(0x157)]!==0x1?'s':''));const _0x4280c1=_0x37f7ef=>{const _0x14c185=_0x2b4266;return getConsoleNextUrl(_0x395e8b['site'],_0x14c185(0x1ff)+_0x84c4eb+_0x14c185(0x18f)+_0x37f7ef+'/j/da');};if(_0x395e8b[_0x2b4266(0x13a)]===_0x2b4266(0x118))await handleSDKOutput(_0x558964,_0x395e8b);else{if(_0x395e8b[_0x2b4266(0x13a)]===_0x2b4266(0x1ab)){const _0x74a83e=_0x558964['map'](_0x51442c=>({..._0x51442c,'url':_0x4280c1(_0x51442c['id'])}));await handleSDKOutput(_0x74a83e,_0x395e8b);}else{console['log']('['+_0x4e7c30+']');const _0x179d3a=new Map(),_0x811f14=[];for(const _0x3e3ead of _0x558964){if(!_0x3e3ead[_0x2b4266(0x17a)]||_0x3e3ead[_0x2b4266(0x17a)]===_0x4d71af)_0x811f14[_0x2b4266(0x222)](_0x3e3ead);else{const _0x55c6f3=_0x179d3a['get'](_0x3e3ead[_0x2b4266(0x17a)])||[];_0x55c6f3['push'](_0x3e3ead),_0x179d3a[_0x2b4266(0x20c)](_0x3e3ead['folderId'],_0x55c6f3);}}const _0x336f5a=(_0xb7ad42,_0x361a09)=>_0xb7ad42[_0x2b4266(0x1bc)][_0x2b4266(0x134)](_0x361a09[_0x2b4266(0x1bc)],undefined,{'sensitivity':_0x2b4266(0x14c)});_0x811f14[_0x2b4266(0x1cd)](_0x336f5a);for(const _0x56b7be of _0x811f14){console[_0x2b4266(0x200)](formatJourneyItem(_0x56b7be,'',_0x4280c1(_0x56b7be['id'])));}const _0x4e5507=[..._0x179d3a[_0x2b4266(0x1cf)]()]['sort']((_0x40f155,_0x5df531)=>{const _0x33a12d=_0x2b4266,_0x254a3b=_0x238a97[_0x33a12d(0x1f3)](_0x40f155[0x0])||_0x40f155[0x0],_0x4ae699=_0x238a97['get'](_0x5df531[0x0])||_0x5df531[0x0];return _0x254a3b[_0x33a12d(0x134)](_0x4ae699,undefined,{'sensitivity':_0x33a12d(0x14c)});});for(const [_0x1ca67e,_0x54dc15]of _0x4e5507){const _0x294263=_0x238a97[_0x2b4266(0x1f3)](_0x1ca67e)||_0x1ca67e;console[_0x2b4266(0x200)](_0x2b4266(0x1bd)+_0x294263),_0x54dc15[_0x2b4266(0x1cd)](_0x336f5a);for(const _0x309c93 of _0x54dc15){console[_0x2b4266(0x200)](formatJourneyItem(_0x309c93,'\x20\x20',_0x4280c1(_0x309c93['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]=a27_0x57c5c2(0x164);[a27_0x57c5c2(0x20b)]=a27_0x57c5c2(0x20e);async['execute'](_0x128f51){const _0x352174=a27_0x57c5c2,{options:_0x3f3670,args:_0x5d6f91,tdx:_0x4cf457}=_0x128f51,_0x456c6e=_0x5d6f91[0x0];if(!_0x456c6e)return console[_0x352174(0x12a)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x352174(0x12a)]('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console[_0x352174(0x12a)]('Options:'),console[_0x352174(0x12a)](_0x352174(0x207)),0x1;_0x3f3670[_0x352174(0x128)]&&console['error'](_0x352174(0x1be)+_0x456c6e);const {journeyId:_0x428c9c,parentSegmentId:_0x54f639}=await resolveJourneyIdFromInput(_0x456c6e,_0x3f3670,_0x4cf457);if(_0x3f3670[_0x352174(0x1f9)]){const _0x34eab7=getConsoleNextUrl(_0x3f3670[_0x352174(0x1f8)],_0x352174(0x1ff)+_0x54f639+_0x352174(0x18f)+_0x428c9c+_0x352174(0x209));return console['error'](a27_0x53b983[_0x352174(0x1f2)]('✔')+'\x20Opening\x20'+a27_0x53b983[_0x352174(0x153)](_0x34eab7)),openBrowser(_0x34eab7),0x0;}const _0x4d8771=await withSpinner(_0x352174(0x11e),()=>_0x4cf457[_0x352174(0x17b)][_0x352174(0x14e)](_0x428c9c),{'verbose':_0x3f3670['verbose']}),_0x1fede7=_0x4d8771['data'],_0x162ac6=_0x3f3670['includeStats'];let _0x13c21b;if(_0x162ac6)try{const _0x1d80f6=await withSpinner(_0x352174(0x136),()=>_0x4cf457[_0x352174(0x17b)][_0x352174(0x184)](_0x428c9c),{'verbose':_0x3f3670[_0x352174(0x128)]});_0x13c21b=_0x1d80f6['data'];}catch{_0x3f3670['verbose']&&console[_0x352174(0x12a)](_0x352174(0x1d6));}const _0x211634=getConsoleNextUrl(_0x3f3670['site'],_0x352174(0x1ff)+_0x54f639+'/e/'+_0x428c9c+_0x352174(0x209)),_0x23ac06={'id':_0x1fede7['id'],'name':_0x1fede7[_0x352174(0x216)][_0x352174(0x1c8)],'description':_0x1fede7['attributes'][_0x352174(0x20b)],'state':_0x1fede7[_0x352174(0x216)][_0x352174(0x181)],'paused':_0x1fede7['attributes']['paused'],'reentry_mode':_0x1fede7[_0x352174(0x216)]['reentryMode'],'stages':_0x1fede7[_0x352174(0x216)]['journeyStages']?.[_0x352174(0x157)]||0x0,..._0x1fede7[_0x352174(0x216)]['goal']&&{'goal':_0x1fede7[_0x352174(0x216)][_0x352174(0x143)][_0x352174(0x1c8)]},..._0x13c21b&&{'statistics':{'size':_0x13c21b[_0x352174(0x16b)],'entered':_0x13c21b[_0x352174(0x1da)],'goal_achieved':_0x13c21b[_0x352174(0x1df)],'completion_rate':_0x13c21b[_0x352174(0x14d)],'exit_or_jump':_0x13c21b['exitOrJumpSize'],'exit_or_jump_rate':_0x13c21b[_0x352174(0x13c)],'stages':_0x13c21b[_0x352174(0x21b)]}},'url':_0x211634};return await handleSingleObjectOutput(_0x23ac06,_0x3f3670),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]=a27_0x57c5c2(0x1fe);[a27_0x57c5c2(0x20b)]=a27_0x57c5c2(0x138);async[a27_0x57c5c2(0x120)](_0x38cb1c){const _0x105238=a27_0x57c5c2,{options:_0x14c0d3,args:_0xe237f0,tdx:_0x29421d}=_0x38cb1c,_0x26d9aa=_0xe237f0[0x0];if(!requireNameOrPath(_0x26d9aa))return 0x1;_0x14c0d3[_0x105238(0x128)]&&console[_0x105238(0x12a)](_0x105238(0x1be)+_0x26d9aa);const _0x539ba3=_0x14c0d3,_0x52ac78=_0x539ba3[_0x105238(0x179)],_0xc4707f=_0x539ba3['to'],_0x2e0ffb=_0x539ba3[_0x105238(0x14a)],_0xc650eb=_0x539ba3[_0x105238(0x132)];_0x2e0ffb&&!_0x52ac78&&!_0xc4707f&&console[_0x105238(0x12a)](_0x105238(0x1b3));const _0x57c155=_0x2e0ffb?withJsonFormat(_0x14c0d3):_0x14c0d3,{journeyId:_0x583a55,journeyName:_0x3556e2}=await resolveJourneyIdFromInput(_0x26d9aa,_0x57c155,_0x29421d),_0x120028=_0x52ac78||_0xc4707f?{'from':_0x52ac78,'to':_0xc4707f}:undefined,_0x527182=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise['all']([_0x29421d['journey'][_0x105238(0x14e)](_0x583a55),_0x29421d[_0x105238(0x17b)][_0x105238(0x184)](_0x583a55,_0x120028)]),{'verbose':_0x57c155['verbose']}),[_0xc175c9,_0x53ebe3]=_0x527182['data'];if(!_0x53ebe3||_0x53ebe3[_0x105238(0x1a5)]===null)return console['error']('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x3556e2),console[_0x105238(0x12a)](_0x105238(0x21d)),0x0;const _0x2f3e64=buildStageNameMap(_0xc175c9),_0x4c0fc4=!!(_0x120028&&_0x53ebe3[_0x105238(0x12e)]?.[_0x105238(0x157)]),_0x435d9d={'stageNameMap':_0x2f3e64,'hasPeriod':_0x4c0fc4,'includeHistory':!!_0x2e0ffb};if(_0xc650eb&&_0x53ebe3[_0x105238(0x21b)]){const _0x1205c2=_0x53ebe3['stages'][_0x105238(0x19d)](_0xb9c23=>{const _0x58d0d2=_0x105238,_0x45ec4a=_0x2f3e64['get'](_0xb9c23['id'])??'';return _0x45ec4a[_0x58d0d2(0x198)]()===_0xc650eb['toLowerCase']();});if(_0x1205c2)return await handleSingleObjectOutput(formatStageStats(_0x1205c2,_0x435d9d),_0x57c155),0x0;const _0x58bd8e=_0x53ebe3[_0x105238(0x21b)][_0x105238(0x197)](_0x3a4d4c=>_0x2f3e64[_0x105238(0x1f3)](_0x3a4d4c['id'])??_0x3a4d4c['id']);return console[_0x105238(0x12a)](_0x105238(0x1e2)+_0xc650eb+'\x22\x20not\x20found'),console[_0x105238(0x12a)](_0x105238(0x123)+_0x58bd8e['join'](',\x20')),0x1;}const _0x22a5ca=_0x53ebe3['stages']?.[_0x105238(0x197)](_0x188e3d=>formatStageStats(_0x188e3d,_0x435d9d)),_0x5b9e57=assembleJourneyStats(_0x53ebe3,{'from':_0x52ac78,'to':_0xc4707f,'includeHistory':_0x2e0ffb});return await this[_0x105238(0x17f)](_0x5b9e57,_0x22a5ca??[],_0x57c155),0x0;}async[a27_0x57c5c2(0x17f)](_0x40183b,_0x4a4a4b,_0x49f96c){const _0x3c5d72=a27_0x57c5c2,_0x103180=_0x49f96c[_0x3c5d72(0x13a)]==='json'||_0x49f96c[_0x3c5d72(0x13a)]==='jsonl'||_0x49f96c['json']||_0x49f96c[_0x3c5d72(0x15a)];if(_0x103180){_0x40183b[_0x3c5d72(0x21b)]=_0x4a4a4b,await handleSingleObjectOutput(_0x40183b,_0x49f96c);return;}await handleSingleObjectOutput(_0x40183b,_0x49f96c);for(const _0x251897 of _0x4a4a4b){console[_0x3c5d72(0x200)](''),console[_0x3c5d72(0x200)](String(a27_0x53b983[_0x3c5d72(0x153)][_0x3c5d72(0x16a)]('['+_0x251897[_0x3c5d72(0x1c8)]+']'))+a27_0x53b983['dim']('\x20'+_0x251897['id']));const {id:_0x63d054,name:_0xc38462,..._0x5ddc3b}=_0x251897;await handleSingleObjectOutput(_0x5ddc3b,_0x49f96c);}}}function a27_0x4d3e(){const _0x35b440=['session','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','rule','json','List\x20journeys\x20in\x20current\x20context','\x20\x20Name:\x20','message','\x20\x20-\x20','2441502XCxOky','Pausing\x20journey...','resume','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','\x20(rule\x20match)','getSegment','554348nGqZnS','listFolders','...','hasPeriod','\x22\x20paused','Warning:\x20Could\x20not\x20resolve\x20segment\x20','journeyBundleName','📁\x20','Input:\x20','Resolving\x20journey...','Resuming\x20journey...','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','connection','\x20(ID:\x20','completed','cwd','journey:version:create','\x20journeys','name','launched','listJourneysWithFolders','Creating\x20new\x20version...','journey:pull','sort','tdx.json','entries','resolveJourneyId','(archived)','no_parent','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)','\x5c$&','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','\x20\x20Statistics\x20not\x20available','activation','listActivationsFlat','\x20journey\x20files\x20to\x20','enteredSize','file','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','options','1423040Hvyhnp','goalSize','diff','\x20\x20Parent\x20segment:\x20','Error:\x20Stage\x20\x22','nodes','21xNLRhe','Write\x20','.yml','Listing\x20journey\x20versions...','parentSegment','filePath','\x20\x20Target:\x20','\x20->\x20','args','journey:list','isNew','dim','\x20\x20Folder\x20path:\x20','exitOrJumpSize','green','get','filter','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','blue','repeat','site','web','createVersion','has','stageNameMap','Fetching\x20users\x20and\x20connections...','journey:stats','/app/ps/','log','\x20\x20Journey\x20ID:\x20','values','pause','journey:resume','archived','(root)','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','77QEsIzc','/j/da/je','links','description','set','completeMilestoneRate','Show\x20journey\x20details','\x20version','journey:columns','Target\x20directory:\x20','getLatestJourneyId','\x20\x20Preserving\x20local\x20segment\x20name:\x20','relative','parent_segment','attributes','database','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','absolutePath','red','stages','Warning:\x20Could\x20not\x20resolve\x20activation\x20','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','all','Aborted.','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','versionNumber','push','columns','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','then','getParentFull','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','-\x20no\x20files\x20written','version','Error:\x20Parent\x20segment\x20context\x20required','milestoneSize','Fetching\x20parent\x20segment...','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','getColumnMapping','paused','table','type','getActivation','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','List\x20activations\x20for\x20a\x20journey','Journey\x20name:\x20','Getting\x20journey\x20details...','journey:versions','execute','\x20versions)','journeyBundleId','Available\x20stages:\x20','folderPath','data','Error:\x20','updatedAt','verbose','🗺️\x20','error','helpText','Listing\x20journey\x20activations...','Table:\x20','history','Pause\x20a\x20running\x20journey','Resolving\x20version...','getTrafficData','stage',',\x20version:\x20','localeCompare','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','Getting\x20journey\x20statistics...','\x0aError:','Show\x20journey\x20statistics','parentName','format','journey:activations','exitOrJumpRate','✔\x20Journey\x20\x22','journeys','Fetching\x20','(running)','\x20(draft)\x20—\x20\x22','resolveParentId','goal','✔\x20Found\x20','relativePath','tsv','Database:\x20','setPhase','utf-8','includeHistory','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','base','completionRate','getJourney','listJourneysFromParentSegment','\x20changed\x20files','(paused)','segments','cyan','\x20activation','7TUAiMc','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','length','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','createdAt','jsonl','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','yes','folders','No\x20journeys\x20found','Parent\x20segment:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','536472qUwrsd','Getting\x20journey\x20traffic\x20data...','Fetching\x20journeys\x20and\x20folders...','journey:view','INVALID_ARGUMENT','errorCode','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','Target\x20file:\x20','Cancelled','bold','size','Error:\x20--version\x20option\x20is\x20required','kind','draft','\x0aChanges\x20to\x20\x27','Resolving\x20parent\x20segment...','test','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','Resume\x20a\x20paused\x20journey','resolveSegment','rootFolderId','Resolved\x20YAML\x20file:\x20','Error:\x20Version\x20','\x0aPull\x20summary:','from','folderId','journey','segment','dryRun','\x20Created\x20v','renderStats','journeyStages','state','segmentName','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','getStatistics','activation_','Listing\x20journeys...','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','\x20new\x20files','8181TAYoYl','join','✔\x20Pulled\x20','activationParams','Found\x20','Show\x20journey\x20table\x20column\x20mapping','/e/','3272xfCZBH','✔\x20Context\x20set:\x20','yellow','stringify','content','root\x20folder','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','map','toLowerCase','journey:pause','conversion','replace','\x20journey','find','buildIdToNameMap','(draft)','55050tkVUJx','add','\x20files?','user','922870eRiLzy','journeyId','targetDir','buildIdToEmailMap'];a27_0x4d3e=function(){return _0x35b440;};return a27_0x4d3e();}export class JourneyTrafficCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]='journey:traffic';['description']=a27_0x57c5c2(0x172);async['execute'](_0x251b94){const _0x5324e4=a27_0x57c5c2,{options:_0x5a568d,args:_0x38182c,tdx:_0x62a035}=_0x251b94,_0x30f536=_0x38182c[0x0];if(!requireNameOrPath(_0x30f536))return 0x1;_0x5a568d['verbose']&&console[_0x5324e4(0x12a)](_0x5324e4(0x1be)+_0x30f536);const _0x5aa87c=_0x5a568d,_0x46b153=_0x5aa87c[_0x5324e4(0x119)],_0x2b7383=_0x5aa87c['from'],_0x40b5ef=_0x5aa87c['to'],_0x88b85f=_0x5aa87c['limit'];if(_0x46b153&&_0x46b153!==_0x5324e4(0x19a)&&_0x46b153!==_0x5324e4(0x1d7))return console[_0x5324e4(0x12a)]('Error:\x20Invalid\x20--type\x20\x22'+_0x46b153+_0x5324e4(0x196)),0x1;const _0x11ee36=withJsonFormat(_0x5a568d),{journeyId:_0x57f564,journeyName:_0x5048c5}=await resolveJourneyIdFromInput(_0x30f536,_0x11ee36,_0x62a035),_0x3aa1b2={'type':_0x46b153,'from':_0x2b7383,'to':_0x40b5ef,'limit':_0x88b85f},_0x2dc1f8=await withSpinner(_0x5324e4(0x162),()=>_0x62a035[_0x5324e4(0x17b)][_0x5324e4(0x131)](_0x57f564,_0x3aa1b2),{'verbose':_0x11ee36['verbose']}),_0x39483d=_0x2dc1f8[_0x5324e4(0x125)],_0x1080cd=_0x39483d[_0x5324e4(0x19a)]&&(_0x39483d[_0x5324e4(0x19a)][_0x5324e4(0x1e3)][_0x5324e4(0x157)]>0x0||_0x39483d['conversion'][_0x5324e4(0x20a)][_0x5324e4(0x157)]>0x0),_0x10ca10=_0x39483d[_0x5324e4(0x1d7)]&&_0x39483d['activation'][_0x5324e4(0x157)]>0x0;if(!_0x1080cd&&!_0x10ca10)return console['error'](_0x5324e4(0x183)+_0x5048c5),console[_0x5324e4(0x12a)](_0x5324e4(0x187)),_0x2b7383&&_0x40b5ef&&console[_0x5324e4(0x12a)](_0x5324e4(0x167)),0x0;return await handleSingleObjectOutput(_0x39483d,_0x11ee36),0x0;}}function formatStageStats(_0xebd35d,_0x3e5af6){const _0x40aba3=a27_0x57c5c2,_0x11a748=_0x3e5af6[_0x40aba3(0x1b9)]&&_0xebd35d[_0x40aba3(0x12e)]?.[_0x40aba3(0x157)]?aggregateStageHistory(_0xebd35d['history']):{'size':_0xebd35d[_0x40aba3(0x16b)],'entered':_0xebd35d[_0x40aba3(0x1da)],'milestone':_0xebd35d[_0x40aba3(0x113)],'milestone_rate':_0xebd35d[_0x40aba3(0x20d)],'exit_or_jump':_0xebd35d[_0x40aba3(0x1f1)],'exit_or_jump_rate':_0xebd35d['exitOrJumpRate']},_0x2d3198={'id':_0xebd35d['id'],'name':_0x3e5af6[_0x40aba3(0x1fc)]['get'](_0xebd35d['id'])??_0xebd35d['id'],..._0x11a748};return _0x3e5af6[_0x40aba3(0x1b9)]&&_0x3e5af6[_0x40aba3(0x14a)]&&_0xebd35d[_0x40aba3(0x12e)]&&(_0x2d3198[_0x40aba3(0x12e)]=_0xebd35d['history']),_0x2d3198;}export class JourneyPauseCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]=a27_0x57c5c2(0x199);['description']=a27_0x57c5c2(0x12f);async[a27_0x57c5c2(0x120)](_0x2bb190){const _0x4b296b=a27_0x57c5c2,{options:_0x14aa42,args:_0x479be9,tdx:_0x4c6133}=_0x2bb190,_0x2f4184=_0x479be9[0x0];if(!requireNameOrPath(_0x2f4184))return 0x1;_0x14aa42[_0x4b296b(0x128)]&&console[_0x4b296b(0x12a)]('Input:\x20'+_0x2f4184);const {journeyId:_0x463ac6,journeyName:_0x11c5ba}=await resolveJourneyIdFromInput(_0x2f4184,_0x14aa42,_0x4c6133);if(!_0x14aa42[_0x4b296b(0x15c)]){const _0x421c2c=await confirm(_0x4b296b(0x1a9)+_0x11c5ba+'\x22?');if(!_0x421c2c)return console[_0x4b296b(0x12a)]('Cancelled'),0x0;}const _0x1d792c=await withSpinner(_0x4b296b(0x1b1),()=>_0x4c6133['journey'][_0x4b296b(0x203)](_0x463ac6),{'verbose':_0x14aa42['verbose']}),_0x5857b6=_0x1d792c[_0x4b296b(0x125)];return console[_0x4b296b(0x12a)](_0x4b296b(0x13d)+_0x5857b6[_0x4b296b(0x216)]['name']+_0x4b296b(0x1ba)),0x0;}}export class JourneyResumeCommand extends BaseCommand{['name']=a27_0x57c5c2(0x204);['description']=a27_0x57c5c2(0x173);async[a27_0x57c5c2(0x120)](_0x3c7967){const _0x3e2a62=a27_0x57c5c2,{options:_0x46be7f,args:_0x308278,tdx:_0x3b3813}=_0x3c7967,_0x12965f=_0x308278[0x0];if(!requireNameOrPath(_0x12965f))return 0x1;_0x46be7f[_0x3e2a62(0x128)]&&console[_0x3e2a62(0x12a)](_0x3e2a62(0x1be)+_0x12965f);const {journeyId:_0xe0625c,journeyName:_0x39ba22}=await resolveJourneyIdFromInput(_0x12965f,_0x46be7f,_0x3b3813);if(!_0x46be7f['yes']){const _0x4ea588=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22'+_0x39ba22+'\x22?');if(!_0x4ea588)return console[_0x3e2a62(0x12a)](_0x3e2a62(0x169)),0x0;}const _0x4455dc=await withSpinner(_0x3e2a62(0x1c0),()=>_0x3b3813[_0x3e2a62(0x17b)][_0x3e2a62(0x1b2)](_0xe0625c),{'verbose':_0x46be7f[_0x3e2a62(0x128)]}),_0x2a3bc7=_0x4455dc[_0x3e2a62(0x125)];return console['error'](_0x3e2a62(0x13d)+_0x2a3bc7['attributes'][_0x3e2a62(0x1c8)]+'\x22\x20resumed'),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']=a27_0x57c5c2(0x1cc);[a27_0x57c5c2(0x20b)]='Export\x20journey(s)\x20as\x20YAML\x20files';async[a27_0x57c5c2(0x120)](_0x3f64ba){const _0x43c685=a27_0x57c5c2,{options:_0x1d1cbb,args:_0x38289c,tdx:_0x4f806a}=_0x3f64ba,_0x7735c3=_0x1d1cbb,_0x5d5078=_0x38289c[0x0],_0x47978e=_0x5d5078&&isYamlFilePath(_0x5d5078),_0x1eef57=await resolveTarget({'arg':_0x47978e?_0x5d5078:undefined,'contextParent':_0x1d1cbb[_0x43c685(0x1e8)],'cwd':process[_0x43c685(0x1c5)]()});if(!isSuccessfulResolution(_0x1eef57))return _0x1eef57[_0x43c685(0x166)]===_0x43c685(0x1d2)?(console[_0x43c685(0x12a)](a27_0x53b983['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x43c685(0x1d3)),console[_0x43c685(0x12a)](_0x43c685(0x1d5)),console[_0x43c685(0x12a)](_0x43c685(0x160)),console[_0x43c685(0x12a)](_0x43c685(0x14b))):(console[_0x43c685(0x12a)](a27_0x53b983[_0x43c685(0x21a)](_0x43c685(0x126)+_0x1eef57[_0x43c685(0x1ae)]+'\x0a')),_0x1eef57[_0x43c685(0x12b)]&&console['error'](a27_0x53b983[_0x43c685(0x153)](_0x1eef57['helpText']))),0x1;let _0x1d9c93=_0x47978e?undefined:_0x5d5078,_0x4e2ee3,_0x38ce18;_0x1eef57[_0x43c685(0x119)]===_0x43c685(0x1db)&&(_0x1d9c93=_0x1eef57['resourceName'],_0x4e2ee3=_0x1eef57[_0x43c685(0x1e9)],_0x38ce18=_0x1eef57[_0x43c685(0x124)]);const _0x4a676a=_0x1eef57[_0x43c685(0x139)],_0x144e89=_0x1eef57[_0x43c685(0x1a6)];_0x7735c3['verbose']&&(console[_0x43c685(0x12a)]('Parent\x20segment:\x20'+_0x4a676a),console[_0x43c685(0x12a)](_0x43c685(0x211)+_0x144e89),_0x1d9c93&&console[_0x43c685(0x12a)](_0x43c685(0x11d)+_0x1d9c93),_0x4e2ee3&&console[_0x43c685(0x12a)](_0x43c685(0x168)+_0x4e2ee3),_0x38ce18&&console[_0x43c685(0x12a)]('Folder\x20path:\x20'+_0x38ce18));const _0x433c61=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x4f806a[_0x43c685(0x17c)]['resolveParentId'](_0x4a676a),{'verbose':_0x1d1cbb[_0x43c685(0x128)]}),_0x2699cc=_0x433c61[_0x43c685(0x125)],{journeys:_0x1557a2,folders:_0x3a79cd}=await withSpinner(_0x43c685(0x163),async()=>{const _0x97da88=_0x43c685,[_0x240ca7,_0x884532]=await Promise[_0x97da88(0x21e)]([_0x4f806a[_0x97da88(0x17b)][_0x97da88(0x14f)](_0x2699cc,undefined,{'includeAllVersions':!![]}),_0x4f806a['segment'][_0x97da88(0x1b7)](_0x2699cc)]);return{'journeys':_0x240ca7,'folders':_0x884532};},{'verbose':_0x1d1cbb['verbose']})[_0x43c685(0x226)](_0x4ebebc=>_0x4ebebc[_0x43c685(0x125)]);let _0x228c1c=_0x1557a2;const _0x5abe63=buildFolderIdToPathMap(_0x3a79cd);if(_0x1d9c93){const _0x180487=_0x228c1c[_0x43c685(0x1f4)](_0x45b397=>_0x45b397[_0x43c685(0x1bc)][_0x43c685(0x198)]()===_0x1d9c93[_0x43c685(0x198)]());if(_0x180487[_0x43c685(0x157)]===0x0)return console[_0x43c685(0x12a)]('Error:\x20Journey\x20not\x20found:\x20'+_0x1d9c93),console[_0x43c685(0x12a)](_0x43c685(0x218)),0x1;_0x228c1c=_0x180487;}if(_0x38ce18!==undefined){const _0x17dbf0=_0x228c1c[_0x43c685(0x1f4)](_0x1d7dcb=>{const _0x544471=_0x43c685,_0x58316b=_0x1d7dcb['folderId']?_0x5abe63[_0x544471(0x1f3)](_0x1d7dcb[_0x544471(0x17a)])||'':'';return _0x58316b===_0x38ce18;});if(_0x17dbf0[_0x43c685(0x157)]===0x0&&_0x228c1c[_0x43c685(0x157)]>0x0){console[_0x43c685(0x12a)]('Error:\x20Journey\x20\x27'+_0x1d9c93+'\x27\x20not\x20found\x20in\x20'+(_0x38ce18||_0x43c685(0x195))),console[_0x43c685(0x12a)](_0x43c685(0x158));for(const _0xcf2412 of _0x228c1c){const _0x18a20d=_0xcf2412['folderId']?_0x5abe63['get'](_0xcf2412['folderId'])||'':'';console['error'](_0x43c685(0x1af)+(_0x18a20d||_0x43c685(0x206))+'/'+_0xcf2412['journeyBundleName']);}return 0x1;}_0x228c1c=_0x17dbf0;}if(_0x228c1c[_0x43c685(0x157)]===0x0)return console[_0x43c685(0x12a)](_0x43c685(0x15e)),0x0;const _0x850035=new Map();for(const _0x5d8050 of _0x228c1c){const _0x396b6b=_0x5d8050[_0x43c685(0x122)];!_0x850035[_0x43c685(0x1fb)](_0x396b6b)&&_0x850035[_0x43c685(0x20c)](_0x396b6b,[]),_0x850035[_0x43c685(0x1f3)](_0x396b6b)[_0x43c685(0x222)](_0x5d8050);}for(const _0x37e0a7 of _0x850035[_0x43c685(0x202)]()){_0x37e0a7[_0x43c685(0x1cd)]((_0x111ced,_0x2f0a2e)=>(_0x111ced[_0x43c685(0x221)]||0x0)-(_0x2f0a2e['versionNumber']||0x0));}const _0x447a7a=[],{idToEmailMap:_0x3a7fc2,connectionIdToNameMap:_0x4cf942}=await withSpinner(_0x43c685(0x1fd),async()=>{const _0x1380e2=_0x43c685,[_0x1ed021,_0x427915]=await Promise[_0x1380e2(0x21e)]([_0x4f806a[_0x1380e2(0x1a3)][_0x1380e2(0x1a7)](),_0x4f806a[_0x1380e2(0x1c2)][_0x1380e2(0x19e)]()]);return{'idToEmailMap':_0x1ed021,'connectionIdToNameMap':_0x427915};},{'verbose':_0x1d1cbb[_0x43c685(0x128)]})[_0x43c685(0x226)](_0x439323=>_0x439323[_0x43c685(0x125)]);for(const _0x4372b2 of _0x850035[_0x43c685(0x202)]()){const _0x3c184c=_0x4372b2[0x0][_0x43c685(0x1bc)],_0x408f28=_0x4372b2[0x0]['folderId'],_0x21d23c=_0x408f28?_0x5abe63['get'](_0x408f28)||'':'',_0x528492=_0x21d23c?a27_0xbd78d4[_0x43c685(0x18a)](_0x144e89,_0x21d23c):_0x144e89,_0x35b420=_0x4e2ee3||a27_0xbd78d4[_0x43c685(0x18a)](_0x528492,sanitizeFileName(_0x3c184c)+_0x43c685(0x1e6));let _0x50fa21,_0x2dd9f1;if(existsSync(_0x35b420))try{const _0x36181b=readFileSync(_0x35b420,'utf-8'),_0x4cf465=parseYamlString(_0x36181b);_0x2dd9f1=_0x4cf465,_0x50fa21=buildRuleToNameMapping(_0x4cf465),_0x7735c3[_0x43c685(0x128)]&&_0x50fa21[_0x43c685(0x16b)]>0x0&&console['error'](_0x43c685(0x18d)+_0x50fa21[_0x43c685(0x16b)]+_0x43c685(0x15b)+_0x3c184c);}catch(_0x2128f4){_0x7735c3['verbose']&&console[_0x43c685(0x12a)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x2128f4[_0x43c685(0x1ae)]);}const _0x3529a1=[],_0x119c6c=new Set(),_0x509cd8=new Map(),_0x208c38=new Map(),_0xadb3d5=new Set(),_0x186385=new Map(),_0x53ad7d=new Map(),_0x2e3c02=createJumpTargetCache();await withProgressSpinner(_0x43c685(0x13f)+_0x3c184c+_0x43c685(0x1b8),async _0x320fe9=>{const _0x4c7bd0=_0x43c685;for(const _0x2a46bf of _0x4372b2){const _0x16d353=_0x4372b2['length']>0x1?_0x2a46bf[_0x4c7bd0(0x1bc)]+'\x20v'+(_0x2a46bf[_0x4c7bd0(0x221)]||0x1):_0x2a46bf[_0x4c7bd0(0x1bc)];_0x320fe9[_0x4c7bd0(0x148)]('Fetching\x20'+_0x16d353);const _0xd4c80=await _0x4f806a['journey'][_0x4c7bd0(0x14e)](_0x2a46bf['id']),_0x114b61=_0xd4c80[_0x4c7bd0(0x216)]?.['audienceId'],_0x593ea4={'resolveSegment':async _0x5a1b8c=>{const _0xa0f063=_0x4c7bd0;if(!_0x114b61)return{'name':_0x5a1b8c,'isJourneyLocal':![]};const _0x4b5111=_0x509cd8[_0xa0f063(0x1f3)](_0x5a1b8c);if(_0x4b5111)return _0x4b5111;try{const _0x143270=await _0x4f806a[_0xa0f063(0x17c)][_0xa0f063(0x1b5)](_0x114b61,_0x5a1b8c),_0x4c809f=_0x143270[_0xa0f063(0x16d)]===SEGMENT_KIND_JOURNEY;let _0x5d3451,_0x48ecee=_0x143270[_0xa0f063(0x1c8)];if(_0x4c809f&&_0x143270[_0xa0f063(0x1aa)]){const _0x251571=await segmentResponseToDef(_0x143270,{'resolveSegmentName':async _0xa203e7=>{const _0x4d359e=_0xa0f063,_0x3ccda3=_0x509cd8['get'](_0xa203e7);if(_0x3ccda3)return _0x3ccda3[_0x4d359e(0x1c8)];const _0x1ef3a6=await _0x593ea4[_0x4d359e(0x174)](_0xa203e7);return _0x1ef3a6['name'];}}),_0x4c33ed=_0x251571['rule'];_0x5d3451={'description':_0x143270[_0xa0f063(0x20b)],'rule':_0x4c33ed};const _0x2b4eee=serializeRule(_0x4c33ed),_0x218152=_0x208c38[_0xa0f063(0x1f3)](_0x2b4eee);if(_0x218152)_0x48ecee=_0x218152,_0x5d3451=undefined,_0x7735c3[_0xa0f063(0x128)]&&console[_0xa0f063(0x12a)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x143270[_0xa0f063(0x1c8)]+_0xa0f063(0x1eb)+_0x218152);else{let _0x305dd7=![];if(_0x50fa21){const _0x39528e=_0x50fa21[_0xa0f063(0x1f3)](_0x2b4eee);if(_0x39528e){const _0x1ba63d=_0x39528e[_0xa0f063(0x19d)](_0x49e278=>!_0x119c6c[_0xa0f063(0x1fb)](_0x49e278));_0x1ba63d&&(_0x48ecee=_0x1ba63d,_0x119c6c[_0xa0f063(0x1a1)](_0x1ba63d),_0x208c38[_0xa0f063(0x20c)](_0x2b4eee,_0x1ba63d),_0x305dd7=!![],_0x7735c3['verbose']&&console[_0xa0f063(0x12a)](_0xa0f063(0x213)+_0x1ba63d+_0xa0f063(0x1b4)));}}if(!_0x305dd7){const _0x5db57a=generateJourneyLocalName(_0x143270['name']);_0x5db57a&&(_0x48ecee=_0x5db57a);let _0x58cc90=_0x48ecee,_0x495447=0x2;while(_0x119c6c[_0xa0f063(0x1fb)](_0x58cc90)){_0x58cc90=_0x48ecee+'_'+_0x495447,_0x495447++;}_0x119c6c[_0xa0f063(0x1a1)](_0x58cc90),_0x208c38['set'](_0x2b4eee,_0x58cc90),_0x48ecee=_0x58cc90;}}}const _0x2aee61={'name':_0x48ecee,'isJourneyLocal':_0x4c809f,'definition':_0x5d3451};return _0x509cd8['set'](_0x5a1b8c,_0x2aee61),_0x2aee61;}catch(_0x10a6ec){return _0x1d1cbb['verbose']&&console[_0xa0f063(0x12a)](_0xa0f063(0x1bb)+_0x5a1b8c+':\x20'+_0x10a6ec['message']),{'name':_0x5a1b8c,'isJourneyLocal':![]};}},'resolveActivation':async _0x53b083=>{const _0x5ec8ee=_0x4c7bd0,_0x56dcd8=_0x186385[_0x5ec8ee(0x1f3)](_0x53b083);if(_0x56dcd8)return _0x56dcd8;try{const _0x568c44=await _0x4f806a[_0x5ec8ee(0x17b)][_0x5ec8ee(0x11a)](_0x2a46bf['id'],_0x53b083),_0x48c58c=journeyActivationStepToYaml(_0x568c44,_0x3a7fc2,_0x4cf942),_0x8de2ef=JSON[_0x5ec8ee(0x193)]({'name':_0x48c58c[_0x5ec8ee(0x1c8)],'connection':_0x48c58c[_0x5ec8ee(0x1c2)],'connector_config':_0x48c58c['connector_config']}),_0x20381c=_0x53ad7d['get'](_0x8de2ef);if(_0x20381c){const _0x3cf44a={'name':_0x20381c,'isJourneyLocal':!![],'definition':_0x48c58c};return _0x186385[_0x5ec8ee(0x20c)](_0x53b083,_0x3cf44a),_0x3cf44a;}const _0xd75130=_0x568c44['attributes'][_0x5ec8ee(0x18c)][_0x5ec8ee(0x1c8)]||_0x53b083,_0xf4a1f3=sanitizeYamlKey(_0xd75130)||_0x5ec8ee(0x185)+_0x53b083;let _0x595fd5=_0xf4a1f3,_0x248a85=0x2;while(_0xadb3d5[_0x5ec8ee(0x1fb)](_0x595fd5)){_0x595fd5=_0xf4a1f3+'_'+_0x248a85,_0x248a85++;}_0xadb3d5[_0x5ec8ee(0x1a1)](_0x595fd5),_0x53ad7d['set'](_0x8de2ef,_0x595fd5);const _0x349114={'name':_0x595fd5,'isJourneyLocal':!![],'definition':_0x48c58c};return _0x186385['set'](_0x53b083,_0x349114),_0x349114;}catch(_0x366a99){return _0x1d1cbb[_0x5ec8ee(0x128)]&&console['error'](_0x5ec8ee(0x21c)+_0x53b083+':\x20'+_0x366a99[_0x5ec8ee(0x1ae)]),{'name':_0x53b083,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x29e055,_0x5b8d5f)=>{const _0x1e23aa=_0x4c7bd0;return resolveJumpTarget(_0x29e055,_0x5b8d5f,_0x2e3c02,_0x58ab1d=>_0x4f806a[_0x1e23aa(0x17b)][_0x1e23aa(0x14e)](_0x58ab1d));}},_0xdd16c7=await journeyResponseToDef(_0xd4c80,_0x593ea4);_0x3529a1[_0x4c7bd0(0x222)]({'item':_0x2a46bf,'yaml':_0xdd16c7});}},{'verbose':_0x1d1cbb[_0x43c685(0x128)]});const _0x1bd69c=await _0x4f806a[_0x43c685(0x17b)][_0x43c685(0x212)](_0x4372b2[0x0][_0x43c685(0x122)]),_0x5b016a=buildMergedJourneyDef(_0x3529a1,_0x50fa21,_0x1bd69c),_0x2765a0=normalizeJourneyDef(_0x5b016a,_0x2dd9f1),_0x5a7d2f=toYamlString(_0x2765a0),_0x5a7a0c=_0x4e2ee3||a27_0xbd78d4[_0x43c685(0x18a)](_0x528492,sanitizeFileName(_0x3c184c)+_0x43c685(0x1e6));!_0x4e2ee3&&_0x21d23c&&!existsSync(_0x528492)&&mkdirSync(_0x528492,{'recursive':!![]});const _0x32c888=a27_0xbd78d4[_0x43c685(0x214)](process[_0x43c685(0x1c5)](),_0x5a7a0c);if(existsSync(_0x5a7a0c)){const _0x3fcd9f=readFileSync(_0x5a7a0c,_0x43c685(0x149)),_0xdd4e38=generateDiff(_0x3fcd9f,_0x5a7d2f),_0x538ced=hasChanges(_0xdd4e38);_0x447a7a['push']({'relativePath':_0x32c888,'absolutePath':_0x5a7a0c,'content':_0x5a7d2f,'isNew':![],'hasChanges':_0x538ced,'diff':_0x538ced?formatDiffWithColors(_0xdd4e38):undefined});}else _0x447a7a[_0x43c685(0x222)]({'relativePath':_0x32c888,'absolutePath':_0x5a7a0c,'content':_0x5a7d2f,'isNew':!![],'hasChanges':![]});}const _0xbb5e2=_0x447a7a['filter'](_0x40de10=>_0x40de10[_0x43c685(0x1ee)]),_0x30df77=_0x447a7a[_0x43c685(0x1f4)](_0x5693ce=>!_0x5693ce['isNew']&&_0x5693ce['hasChanges']),_0x4c7130=_0x447a7a[_0x43c685(0x1f4)](_0x3d67c0=>!_0x3d67c0['isNew']&&!_0x3d67c0['hasChanges']),_0x596e86=_0x228c1c['length'],_0x40419a=_0x850035[_0x43c685(0x16b)],_0x232480=_0x596e86>_0x40419a?'\x20('+_0x596e86+_0x43c685(0x121):'';console[_0x43c685(0x12a)](_0x43c685(0x178)),console[_0x43c685(0x12a)]('\x20\x20'+a27_0x53b983['cyan'](_0x40419a+_0x43c685(0x1c7))+a27_0x53b983['dim'](_0x232480)),console['error']('\x20\x20'+a27_0x53b983['green']('+\x20'+_0xbb5e2[_0x43c685(0x157)]+_0x43c685(0x188))),console[_0x43c685(0x12a)]('\x20\x20'+a27_0x53b983[_0x43c685(0x192)]('~\x20'+_0x30df77[_0x43c685(0x157)]+_0x43c685(0x150))),console[_0x43c685(0x12a)]('\x20\x20'+a27_0x53b983['dim']('=\x20'+_0x4c7130[_0x43c685(0x157)]+'\x20unchanged\x20files')),console['error'](_0x43c685(0x1ea)+a27_0x53b983['cyan'](_0x144e89)+'\x0a');if(_0x30df77[_0x43c685(0x157)]>0x0)for(const _0x1a49a5 of _0x30df77){console[_0x43c685(0x12a)](_0x43c685(0x16f)+_0x1a49a5[_0x43c685(0x145)]+'\x27:'),console[_0x43c685(0x12a)]('─'[_0x43c685(0x1f7)](0x3c)),console['error'](_0x1a49a5[_0x43c685(0x1e0)]),console[_0x43c685(0x12a)]('─'[_0x43c685(0x1f7)](0x3c));}if(_0x7735c3[_0x43c685(0x17d)])return console['error'](a27_0x53b983[_0x43c685(0x192)](_0x43c685(0x1dc))),0x0;if(_0xbb5e2[_0x43c685(0x157)]===0x0&&_0x30df77['length']===0x0)return console['error'](a27_0x53b983[_0x43c685(0x1f2)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x4a676a},_0x7735c3['session']),console['error'](a27_0x53b983[_0x43c685(0x1f2)]('✔\x20Context\x20set:\x20'+a27_0x53b983[_0x43c685(0x1ef)]('parent_segment')+'\x20=\x20'+a27_0x53b983[_0x43c685(0x153)](_0x4a676a))),0x0;if(!_0x7735c3['yes']&&(_0xbb5e2[_0x43c685(0x157)]>0x0||_0x30df77[_0x43c685(0x157)]>0x0)){if(!isInteractive())return console['error'](a27_0x53b983[_0x43c685(0x21a)](_0x43c685(0x137)),_0x43c685(0x1c1)),console[_0x43c685(0x12a)](a27_0x53b983[_0x43c685(0x1ef)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x18f170=await confirmKey(_0x43c685(0x1e5)+(_0xbb5e2[_0x43c685(0x157)]+_0x30df77[_0x43c685(0x157)])+_0x43c685(0x1a2));if(!_0x18f170)return console[_0x43c685(0x12a)](a27_0x53b983[_0x43c685(0x192)](_0x43c685(0x21f)),_0x43c685(0x110)),0x1;}!existsSync(_0x144e89)&&mkdirSync(_0x144e89,{'recursive':!![]});const _0xa50277=a27_0xbd78d4['join'](_0x144e89,_0x43c685(0x1ce));writeFileSync(_0xa50277,createTdxConfigContent(_0x4a676a),_0x43c685(0x149));for(const _0x3e7caf of _0x447a7a){(_0x3e7caf[_0x43c685(0x1ee)]||_0x3e7caf['hasChanges'])&&writeFileSync(_0x3e7caf[_0x43c685(0x219)],_0x3e7caf[_0x43c685(0x194)],'utf-8');}return console[_0x43c685(0x12a)](a27_0x53b983[_0x43c685(0x1f2)](_0x43c685(0x18b)+(_0xbb5e2[_0x43c685(0x157)]+_0x30df77[_0x43c685(0x157)])+_0x43c685(0x1d9)+_0x144e89)),saveSessionContext({'parent_segment':_0x4a676a},_0x7735c3[_0x43c685(0x1a8)]),console[_0x43c685(0x12a)](a27_0x53b983['green'](_0x43c685(0x191)+a27_0x53b983[_0x43c685(0x1ef)](_0x43c685(0x215))+'\x20=\x20'+a27_0x53b983[_0x43c685(0x153)](_0x4a676a))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]=a27_0x57c5c2(0x210);[a27_0x57c5c2(0x20b)]=a27_0x57c5c2(0x18e);async['execute'](_0xdd65dc){const _0x374faf=a27_0x57c5c2,{options:_0xe3cf5f,args:_0x2f96a9,tdx:_0x81922e}=_0xdd65dc,_0x32cdd2=_0x2f96a9[0x0];if(!requireNameOrPath(_0x32cdd2))return 0x1;_0xe3cf5f['verbose']&&console[_0x374faf(0x12a)](_0x374faf(0x1be)+_0x32cdd2);const {journeyId:_0x38ed5d}=await resolveJourneyIdFromInput(_0x32cdd2,_0xe3cf5f,_0x81922e),_0x3522a6=await withSpinner('Getting\x20column\x20mapping...',()=>_0x81922e[_0x374faf(0x17b)][_0x374faf(0x116)](_0x38ed5d),{'verbose':_0xe3cf5f[_0x374faf(0x128)]}),_0x4fddf1=_0x3522a6[_0x374faf(0x125)];return console['log'](_0x374faf(0x147)+_0x4fddf1[_0x374faf(0x217)]),console[_0x374faf(0x200)](_0x374faf(0x12d)+_0x4fddf1[_0x374faf(0x118)]),await handleSDKOutput(_0x4fddf1[_0x374faf(0x223)],_0xe3cf5f),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]=a27_0x57c5c2(0x13b);[a27_0x57c5c2(0x20b)]=a27_0x57c5c2(0x11c);async['execute'](_0xde75ad){const _0x282a1d=a27_0x57c5c2,{options:_0x2ada02,args:_0x46d326,tdx:_0xe86e85}=_0xde75ad,_0x3b2b22=_0x46d326[0x0];if(!requireNameOrPath(_0x3b2b22))return 0x1;_0x2ada02[_0x282a1d(0x128)]&&console['error'](_0x282a1d(0x1be)+_0x3b2b22);const {journeyId:_0x1d30d7}=await resolveJourneyIdFromInput(_0x3b2b22,_0x2ada02,_0xe86e85),_0x13285d=await withSpinner(_0x282a1d(0x12c),()=>_0xe86e85['journey'][_0x282a1d(0x1d8)](_0x1d30d7),{'verbose':_0x2ada02[_0x282a1d(0x128)]}),_0x15e180=_0x13285d[_0x282a1d(0x125)];return console[_0x282a1d(0x12a)](_0x282a1d(0x18d)+_0x15e180[_0x282a1d(0x157)]+_0x282a1d(0x154)+(_0x15e180[_0x282a1d(0x157)]!==0x1?'s':'')),await handleSDKOutput(_0x15e180,_0x2ada02),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]='journey:push';[a27_0x57c5c2(0x20b)]=a27_0x57c5c2(0x10f);['segmentPushCommand']=new SegmentPushCommand();async[a27_0x57c5c2(0x120)](_0x3e99b3){const _0x1fcd9f=a27_0x57c5c2,_0xf6b0cc=_0x3e99b3[_0x1fcd9f(0x1ec)][0x0];let _0x5ea492;if(_0xf6b0cc){const _0x495407=await resolveTarget({'arg':_0xf6b0cc,'contextParent':_0x3e99b3[_0x1fcd9f(0x1dd)][_0x1fcd9f(0x1e8)],'cwd':process[_0x1fcd9f(0x1c5)]()});isSuccessfulResolution(_0x495407)&&_0x495407['type']==='file'&&(_0x5ea492=_0x495407[_0x1fcd9f(0x1e9)]);}const _0x1dc9e3={..._0x3e99b3,'options':{..._0x3e99b3[_0x1fcd9f(0x1dd)],'journeysOnly':!![],..._0x5ea492&&{'singleFilePath':_0x5ea492}}};return this['segmentPushCommand'][_0x1fcd9f(0x120)](_0x1dc9e3);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]=a27_0x57c5c2(0x11f);['description']='List\x20all\x20versions\x20of\x20a\x20journey';async[a27_0x57c5c2(0x120)](_0x25bed8){const _0x1879a5=a27_0x57c5c2,{options:_0x8a5422,args:_0x54cfbf,tdx:_0xacfc48}=_0x25bed8,_0x54d11f=_0x54cfbf[0x0];if(!requireNameOrPath(_0x54d11f))return 0x1;if(_0x8a5422[_0x1879a5(0x128)])console[_0x1879a5(0x12a)]('Input:\x20'+_0x54d11f);const {journeyId:_0x5eb2a5}=await resolveJourneyIdFromInput(_0x54d11f,_0x8a5422,_0xacfc48),_0x162b7f=await withSpinner(_0x1879a5(0x1e7),()=>_0xacfc48['journey']['listVersions'](_0x5eb2a5),{'verbose':_0x8a5422[_0x1879a5(0x128)]}),{bundleName:_0x3f6e4b,versions:_0x51b54f,latestJourneyId:_0xeedd47}=_0x162b7f[_0x1879a5(0x125)];console[_0x1879a5(0x12a)](_0x3f6e4b+':\x20'+_0x51b54f[_0x1879a5(0x157)]+_0x1879a5(0x20f)+(_0x51b54f[_0x1879a5(0x157)]!==0x1?'s':''));const _0x4ee272=_0x51b54f['map'](_0x566818=>({'version':_0x566818['versionNumber'],'journey_id':_0x566818[_0x1879a5(0x1a5)],'name':_0x566818[_0x1879a5(0x1c8)],'state':_0x566818['state'],'paused':_0x566818['paused'],'latest':_0x566818[_0x1879a5(0x1a5)]===_0xeedd47,'created_at':_0x566818[_0x1879a5(0x159)]}));return await handleSDKOutput(_0x4ee272,_0x8a5422),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]=a27_0x57c5c2(0x1c6);[a27_0x57c5c2(0x20b)]=a27_0x57c5c2(0x156);async['execute'](_0x4cc67f){const _0xfdbf62=a27_0x57c5c2,{options:_0x3be08d,args:_0x597f01,tdx:_0x31eb85}=_0x4cc67f,_0x42eb95=_0x597f01[0x0];if(!requireNameOrPath(_0x42eb95))return 0x1;if(_0x3be08d[_0xfdbf62(0x128)])console[_0xfdbf62(0x12a)](_0xfdbf62(0x1be)+_0x42eb95);const {journeyId:_0x373b7b,journeyName:_0x1e2d53}=await resolveJourneyIdFromInput(_0x42eb95,_0x3be08d,_0x31eb85);if(!_0x3be08d[_0xfdbf62(0x15c)]){const _0x1d1e20=await confirm(_0xfdbf62(0x115)+_0x1e2d53+'\x22?');if(!_0x1d1e20)return console[_0xfdbf62(0x12a)](_0xfdbf62(0x169)),0x0;}const _0x42f851=await withSpinner(_0xfdbf62(0x1cb),()=>_0x31eb85[_0xfdbf62(0x17b)][_0xfdbf62(0x1fa)](_0x373b7b),{'verbose':_0x3be08d[_0xfdbf62(0x128)]}),_0x251cbb=_0x42f851['data'];return console[_0xfdbf62(0x12a)](a27_0x53b983[_0xfdbf62(0x1f2)]('✔')+_0xfdbf62(0x17e)+_0x251cbb[_0xfdbf62(0x216)][_0xfdbf62(0x221)]+_0xfdbf62(0x141)+_0x251cbb[_0xfdbf62(0x216)][_0xfdbf62(0x1c8)]+'\x22'),console['error'](_0xfdbf62(0x201)+_0x251cbb['id']),await handleSingleObjectOutput({'id':_0x251cbb['id'],'name':_0x251cbb['attributes']['name'],'version':_0x251cbb[_0xfdbf62(0x216)]['versionNumber'],'state':_0x251cbb[_0xfdbf62(0x216)][_0xfdbf62(0x181)],'bundle_id':_0x251cbb['attributes'][_0xfdbf62(0x122)],'created_at':_0x251cbb[_0xfdbf62(0x216)][_0xfdbf62(0x159)]},_0x3be08d),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x57c5c2(0x1c8)]='journey:version:view';[a27_0x57c5c2(0x20b)]='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async['execute'](_0x201343){const _0x2247e6=a27_0x57c5c2,{options:_0x2c9c17,args:_0x5111aa,tdx:_0x3479cf}=_0x201343,_0x193265=_0x5111aa[0x0];if(!requireNameOrPath(_0x193265))return 0x1;const _0x51063f=_0x2c9c17[_0x2247e6(0x111)];if(!_0x51063f)return console[_0x2247e6(0x12a)](_0x2247e6(0x16c)),console['error'](_0x2247e6(0x220)),0x1;const _0x1839be=parseInt(_0x51063f,0xa);if(isNaN(_0x1839be)||_0x1839be<0x1)return console[_0x2247e6(0x12a)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x51063f),0x1;if(_0x2c9c17[_0x2247e6(0x128)])console[_0x2247e6(0x12a)](_0x2247e6(0x1be)+_0x193265+_0x2247e6(0x133)+_0x1839be);const {journeyId:_0xcd2abe,parentSegmentId:_0x2ee560}=await resolveJourneyIdFromInput(_0x193265,_0x2c9c17,_0x3479cf),_0x36717e=await withSpinner(_0x2247e6(0x130),()=>_0x3479cf[_0x2247e6(0x17b)]['listVersions'](_0xcd2abe),{'verbose':_0x2c9c17['verbose']}),{versions:_0xdfe536,latestJourneyId:_0x4a1312}=_0x36717e[_0x2247e6(0x125)],_0xe37df0=_0xdfe536[_0x2247e6(0x19d)](_0x5a1a2d=>_0x5a1a2d[_0x2247e6(0x221)]===_0x1839be);if(!_0xe37df0){const _0xcba30d=_0xdfe536[_0x2247e6(0x197)](_0xbb6adf=>'v'+_0xbb6adf['versionNumber'])[_0x2247e6(0x18a)](',\x20');return console[_0x2247e6(0x12a)](_0x2247e6(0x177)+_0x1839be+'\x20not\x20found.\x20Available:\x20'+_0xcba30d),0x1;}const _0x403165=await withSpinner('Getting\x20version\x20'+_0x1839be+'\x20details...',()=>_0x3479cf[_0x2247e6(0x17b)][_0x2247e6(0x14e)](_0xe37df0[_0x2247e6(0x1a5)]),{'verbose':_0x2c9c17[_0x2247e6(0x128)]}),_0x936a9=_0x403165[_0x2247e6(0x125)],_0x1c6c65=getConsoleNextUrl(_0x2c9c17[_0x2247e6(0x1f8)],_0x2247e6(0x1ff)+_0x2ee560+'/e/'+_0xe37df0['journeyId']+_0x2247e6(0x209));return await handleSingleObjectOutput({'id':_0x936a9['id'],'name':_0x936a9[_0x2247e6(0x216)][_0x2247e6(0x1c8)],'version':_0x936a9[_0x2247e6(0x216)][_0x2247e6(0x221)],'description':_0x936a9[_0x2247e6(0x216)]['description'],'state':_0x936a9[_0x2247e6(0x216)]['state'],'paused':_0x936a9['attributes']['paused'],'reentry_mode':_0x936a9['attributes']['reentryMode'],'stages':_0x936a9['attributes'][_0x2247e6(0x180)]?.[_0x2247e6(0x157)]||0x0,..._0x936a9[_0x2247e6(0x216)][_0x2247e6(0x143)]&&{'goal':_0x936a9[_0x2247e6(0x216)][_0x2247e6(0x143)]['name']},'latest':_0xe37df0['journeyId']===_0x4a1312,'created_at':_0x936a9[_0x2247e6(0x216)][_0x2247e6(0x159)],'updated_at':_0x936a9[_0x2247e6(0x216)][_0x2247e6(0x127)],'url':_0x1c6c65},_0x2c9c17),0x0;}}
1
+ const a27_0x7040e8=a27_0x519e;(function(_0x2ae6ac,_0xe9ed29){const _0x226406=a27_0x519e,_0x5a6fe2=_0x2ae6ac();while(!![]){try{const _0xb59779=parseInt(_0x226406(0x1cb))/0x1*(parseInt(_0x226406(0x23b))/0x2)+-parseInt(_0x226406(0x1d1))/0x3+-parseInt(_0x226406(0x293))/0x4*(parseInt(_0x226406(0x1ca))/0x5)+parseInt(_0x226406(0x278))/0x6*(-parseInt(_0x226406(0x1ec))/0x7)+parseInt(_0x226406(0x1ef))/0x8+parseInt(_0x226406(0x280))/0x9*(-parseInt(_0x226406(0x221))/0xa)+parseInt(_0x226406(0x204))/0xb;if(_0xb59779===_0xe9ed29)break;else _0x5a6fe2['push'](_0x5a6fe2['shift']());}catch(_0x293666){_0x5a6fe2['push'](_0x5a6fe2['shift']());}}}(a27_0x1c43,0x53ba8));import a27_0x740456 from'chalk';import a27_0x1966d1 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';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';function a27_0x1c43(){const _0x43c00f=['journeyStages','List\x20all\x20versions\x20of\x20a\x20journey','goal','(draft)','createdAt','Found\x20','\x0aChanges\x20to\x20\x27','map','...','listActivationsFlat','\x20\x20Consolidating\x20duplicate\x20segment:\x20','buildIdToNameMap','Warning:\x20Could\x20not\x20resolve\x20segment\x20','\x27\x20not\x20found\x20in\x20','\x20(rule\x20match)','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','Target\x20file:\x20','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','Fetching\x20','folderId','\x20journey','215vFBHjb','7XblMVZ','bold','parent_segment','stageNameMap','pause','\x20version','668394GLfpSC','\x20\x20Target:\x20','log','dim','✔\x20Pulled\x20','conversion','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','No\x20journeys\x20found','stages','resolveParentId','enteredSize','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','resolveSegment','getLatestJourneyId','activation','📁\x20','getStatistics','updatedAt','length','journey:version:view','site','table','audienceId','🗺️\x20','draft','\x20not\x20found.\x20Available:\x20','completed','4283321rTMoYU','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','segment','2053760tBSVQs','journeyBundleName','Resume\x20a\x20paused\x20journey','session','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','error','find','hasChanges','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','replace','history','Show\x20journey\x20details','parentSegment','filePath','Error:\x20Journey\x20\x27','database','journey:pause','absolutePath','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','activation_','exitOrJumpSize','10516715PBSfyN','description','Error:\x20Invalid\x20--type\x20\x22','stringify','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','journey','buildIdToEmailMap','Table:\x20','columns','Resolving\x20parent\x20segment...','List\x20activations\x20for\x20a\x20journey','\x20details...','add','Getting\x20journey\x20details...','Resolving\x20version...','size','Pattern:\x20','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x0aPull\x20summary:','journeyName','version','versionNumber','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','\x20\x20Journey\x20ID:\x20','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Fetching\x20journeys\x20and\x20folders...','rule','journey:list','tsv','10lWoBmL','Resolved\x20YAML\x20file:\x20','from','Error:\x20Journey\x20not\x20found:\x20','Write\x20','red','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','Database:\x20','yes','journey:versions','getActivation','stage','web','Error:\x20--version\x20option\x20is\x20required','Cancelled','isNew','getJourney','✔\x20All\x20files\x20are\x20up\x20to\x20date','✔\x20Found\x20','format','yellow','Options:','journey:view','verbose','hasPeriod','goalSize','167492KcvEDi','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','segmentPushCommand','args','includeStats','-\x20no\x20files\x20written','Show\x20journey\x20statistics','\x20changed\x20files','rootFolderId','\x20new\x20files','completionRate','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','data','push','state','type','Error:\x20Stage\x20\x22','base','attributes','getColumnMapping','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','\x20\x20Parent\x20segment:\x20','exitOrJumpRate','errorCode','Error:\x20','\x22\x20paused','Listing\x20journey\x20activations...','has','\x20->\x20','Parent\x20segment:\x20','utf-8','Resolving\x20journey...','file','milestoneSize','links','journey:activations','all','\x20\x20-\x20','segmentName','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','.yml','Getting\x20version\x20','(running)','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','listJourneysWithFolders','Input:\x20','values','cwd','archived','\x22\x20resumed','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Aborted.','/j/da','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','folders','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','localeCompare','Error:\x20Parent\x20segment\x20context\x20required','cyan','getTrafficData','content','6TjhBlh','completeMilestoneRate','Getting\x20column\x20mapping...','name','Journey\x20name:\x20','listVersions','\x20versions)','relative','829377KrDHOX','split','folderPath','launched','journeyId','root\x20folder','user','tdx.json','/j/da/je','\x20Opening\x20','(root)','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','test','segments','No\x20statistics\x20available\x20for\x20journey:\x20','\x20segment\x20rule(s)\x20to\x20match\x20for\x20',',\x20version:\x20','journey:resume','renderStats','49228MajzTM','get','INVALID_ARGUMENT','\x5c$&','journeyBundleId','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','Export\x20journey(s)\x20as\x20YAML\x20files','resourceName','paused','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','execute','helpText','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','resume','\x20journey\x20files\x20to\x20','\x20Created\x20v','listJourneysFromParentSegment','View\x20a\x20specific\x20version\x20of\x20a\x20journey','connection','✔\x20Journey\x20\x22','Getting\x20journey\x20statistics...','message','diff','join','json','\x20unchanged\x20files','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','green','Show\x20journey\x20table\x20column\x20mapping','sort','Target\x20directory:\x20','Fetching\x20users\x20and\x20connections...','filter','Folder\x20path:\x20','\x20\x20Name:\x20','getSegment','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','set','no_parent','\x20=\x20','/e/','toLowerCase','/app/ps/','targetDir','parentName','✔\x20Context\x20set:\x20','\x22\x20not\x20found','\x20(ID:\x20','Listing\x20journey\x20versions...','options','\x20journeys','then','Error:\x20Version\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'];a27_0x1c43=function(){return _0x43c00f;};return a27_0x1c43();}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(_0x2b08bd){const _0x16344a=a27_0x519e;return!_0x2b08bd&&(console['error']('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x16344a(0x1f4)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x2b08bd;}function withJsonFormat(_0x6d9354){const _0x4c6b6a=a27_0x519e;if(!_0x6d9354[_0x4c6b6a(0x234)]&&!_0x6d9354['json']&&!_0x6d9354['jsonl']&&!_0x6d9354[_0x4c6b6a(0x220)])return{..._0x6d9354,'format':_0x4c6b6a(0x2ab),'json':!![]};return _0x6d9354;}function formatJourneyState(_0x169d2c){const _0x591467=a27_0x519e;switch(_0x169d2c){case _0x591467(0x283):return a27_0x740456['green'](_0x591467(0x265));case _0x591467(0x1e9):return a27_0x740456[_0x591467(0x1d4)](_0x591467(0x1b8));case _0x591467(0x29b):return a27_0x740456[_0x591467(0x235)]('(paused)');case _0x591467(0x1eb):return a27_0x740456['blue']('(completed)');case _0x591467(0x26b):return a27_0x740456[_0x591467(0x1d4)]('(archived)');default:return'('+_0x169d2c+')';}}function a27_0x519e(_0x382eca,_0x4b54b7){_0x382eca=_0x382eca-0x1ae;const _0x1c437f=a27_0x1c43();let _0x519eea=_0x1c437f[_0x382eca];return _0x519eea;}function formatJourneyItem(_0x49718b,_0x1becee='',_0x329b83){const _0x2945c8=a27_0x519e,_0x109ffd=formatJourneyState(_0x49718b[_0x2945c8(0x249)]),_0x582d5d=_0x329b83?hyperlink(_0x49718b[_0x2945c8(0x1f0)],_0x329b83):_0x49718b[_0x2945c8(0x1f0)];return _0x1becee+_0x2945c8(0x1e8)+_0x582d5d+'\x20'+_0x109ffd;}function escapeRegex(_0x45061b){const _0x307cd2=a27_0x519e;return _0x45061b[_0x307cd2(0x1f8)](/[.*+?^${}()|[\]\\]/g,_0x307cd2(0x296));}function globToRegex(_0x5bb441){const _0x5bbece=a27_0x519e,_0x3771b8=_0x5bb441[_0x5bbece(0x281)]('*')[_0x5bbece(0x1bc)](escapeRegex);return new RegExp(_0x3771b8[_0x5bbece(0x2aa)]('.*'),'i');}function buildRuleToNameMapping(_0x45937c){const _0x1fce09=a27_0x519e,_0x59b9d3=new Map();if(_0x45937c[_0x1fce09(0x28d)])for(const [_0xa8344d,_0x42577e]of Object['entries'](_0x45937c['segments'])){if(_0x42577e['rule']){const _0x53e5ff=serializeRule(_0x42577e[_0x1fce09(0x21e)]),_0x412d6e=_0x59b9d3[_0x1fce09(0x294)](_0x53e5ff);_0x412d6e?_0x412d6e[_0x1fce09(0x248)](_0xa8344d):_0x59b9d3[_0x1fce09(0x2b8)](_0x53e5ff,[_0xa8344d]);}}return _0x59b9d3;}async function resolveJourneyIdFromInput(_0x41ca69,_0x32940d,_0x539288){const _0x4b7eb8=a27_0x519e,_0x57f1bf=await resolveJourneyTarget(_0x41ca69,_0x32940d[_0x4b7eb8(0x1fb)],_0x32940d[_0x4b7eb8(0x238)]),_0x3a2b0e=_0x57f1bf[_0x4b7eb8(0x1fb)];if(!_0x3a2b0e)throw new SDKError(ErrorCode[_0x4b7eb8(0x295)],_0x4b7eb8(0x1f3));const _0x229c57=await withSpinner(_0x4b7eb8(0x20d),()=>_0x539288[_0x4b7eb8(0x1ee)][_0x4b7eb8(0x1da)](_0x3a2b0e),{'verbose':_0x32940d[_0x4b7eb8(0x238)]}),_0xcba439=_0x229c57[_0x4b7eb8(0x247)],_0x23ccf8=await withSpinner(_0x4b7eb8(0x25a),()=>_0x539288['journey']['resolveJourneyId'](_0xcba439,_0x57f1bf[_0x4b7eb8(0x217)]),{'verbose':_0x32940d['verbose']});return{'journeyId':_0x23ccf8[_0x4b7eb8(0x247)],'journeyName':_0x57f1bf[_0x4b7eb8(0x217)],'parentSegmentId':_0xcba439};}async function resolveJourneyTarget(_0x2a8b5c,_0x5c3690,_0x11d20e){const _0x537f9c=a27_0x519e;if(isYamlFilePath(_0x2a8b5c))try{const _0x153838=await resolveYamlFilePath(_0x2a8b5c);return _0x11d20e&&(console[_0x537f9c(0x1f4)](_0x537f9c(0x222)+_0x2a8b5c),console['error'](_0x537f9c(0x250)+_0x153838[_0x537f9c(0x1fb)]),console[_0x537f9c(0x1f4)](_0x537f9c(0x2b5)+_0x153838[_0x537f9c(0x261)]),console['error']('\x20\x20Folder\x20path:\x20'+(_0x153838[_0x537f9c(0x282)]||_0x537f9c(0x28a)))),{'journeyName':_0x153838['segmentName'],'parentSegment':_0x153838[_0x537f9c(0x1fb)],'resolved':_0x153838};}catch(_0x12ec2a){throw new SDKError(ErrorCode[_0x537f9c(0x295)],_0x537f9c(0x272)+_0x12ec2a[_0x537f9c(0x2a8)]);}if(!_0x5c3690)throw new SDKError(ErrorCode[_0x537f9c(0x295)],_0x537f9c(0x215));return{'journeyName':_0x2a8b5c,'parentSegment':_0x5c3690};}export class JourneyListCommand extends BaseCommand{[a27_0x7040e8(0x27b)]=a27_0x7040e8(0x21f);[a27_0x7040e8(0x205)]='List\x20journeys\x20in\x20current\x20context';async[a27_0x7040e8(0x29d)](_0x5c9bf7){const _0x448e19=a27_0x7040e8,{options:_0x3adc2a,args:_0x373259,tdx:_0x3fd68f}=_0x5c9bf7,_0x32df96=_0x373259[0x0],_0x51e244=_0x3adc2a[_0x448e19(0x1fb)];if(!_0x51e244)return console['error'](_0x448e19(0x274)),console[_0x448e19(0x1f4)](_0x448e19(0x208)),0x1;const _0x5097f3=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x3fd68f[_0x448e19(0x1ee)][_0x448e19(0x1da)](_0x51e244),{'verbose':_0x3adc2a[_0x448e19(0x238)]}),_0x32cb59=_0x5097f3['data'];_0x3adc2a['verbose']&&(console[_0x448e19(0x1f4)](_0x448e19(0x258)+_0x51e244+_0x448e19(0x1ae)+_0x32cb59+')'),_0x32df96&&console['error'](_0x448e19(0x214)+_0x32df96));const _0x13c408=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x3fd68f[_0x448e19(0x1ee)]['getParentFull'](_0x32cb59),{'verbose':_0x3adc2a[_0x448e19(0x238)]}),_0xadf2=_0x13c408['data'],_0x26fb58=_0xadf2[_0x448e19(0x243)],_0x13ce5d=await withSpinner('Listing\x20journeys...',()=>_0x3fd68f[_0x448e19(0x209)][_0x448e19(0x267)](_0x32cb59,_0x26fb58),{'verbose':_0x3adc2a[_0x448e19(0x238)]});let _0x532773=_0x13ce5d['data']['journeys'];const _0x1dc8c0=_0x13ce5d['data'][_0x448e19(0x271)],_0x49c3e5=new Map();for(const _0x90bea0 of _0x1dc8c0){_0x49c3e5['set'](_0x90bea0['id'],_0x90bea0[_0x448e19(0x27b)]);}if(_0x32df96){const _0xda982a=globToRegex(_0x32df96);_0x532773=_0x532773[_0x448e19(0x2b3)](_0x40e61=>_0xda982a[_0x448e19(0x28c)](_0x40e61['journeyBundleName']));}console[_0x448e19(0x1f4)](_0x448e19(0x233)+_0x532773[_0x448e19(0x1e3)]+_0x448e19(0x1c9)+(_0x532773[_0x448e19(0x1e3)]!==0x1?'s':''));const _0x1282ee=_0x123a6d=>{const _0x4c82e5=_0x448e19;return getConsoleNextUrl(_0x3adc2a[_0x4c82e5(0x1e5)],'/app/ps/'+_0x32cb59+'/e/'+_0x123a6d+_0x4c82e5(0x26f));};if(_0x3adc2a[_0x448e19(0x234)]===_0x448e19(0x1e6))await handleSDKOutput(_0x532773,_0x3adc2a);else{if(_0x3adc2a[_0x448e19(0x234)]===_0x448e19(0x2ab)){const _0x71fd60=_0x532773[_0x448e19(0x1bc)](_0x259d79=>({..._0x259d79,'url':_0x1282ee(_0x259d79['id'])}));await handleSDKOutput(_0x71fd60,_0x3adc2a);}else{console['log']('['+_0x51e244+']');const _0xc3d5b7=new Map(),_0xcfa688=[];for(const _0x2e0ad4 of _0x532773){if(!_0x2e0ad4[_0x448e19(0x1c8)]||_0x2e0ad4['folderId']===_0x26fb58)_0xcfa688['push'](_0x2e0ad4);else{const _0x439bcc=_0xc3d5b7['get'](_0x2e0ad4[_0x448e19(0x1c8)])||[];_0x439bcc[_0x448e19(0x248)](_0x2e0ad4),_0xc3d5b7[_0x448e19(0x2b8)](_0x2e0ad4[_0x448e19(0x1c8)],_0x439bcc);}}const _0x1e4152=(_0x14a1ea,_0x21b7db)=>_0x14a1ea[_0x448e19(0x1f0)]['localeCompare'](_0x21b7db[_0x448e19(0x1f0)],undefined,{'sensitivity':_0x448e19(0x24c)});_0xcfa688[_0x448e19(0x2b0)](_0x1e4152);for(const _0x332eed of _0xcfa688){console[_0x448e19(0x1d3)](formatJourneyItem(_0x332eed,'',_0x1282ee(_0x332eed['id'])));}const _0x246990=[..._0xc3d5b7['entries']()]['sort']((_0x10fb96,_0x40732c)=>{const _0x1bd394=_0x448e19,_0x5aac5d=_0x49c3e5[_0x1bd394(0x294)](_0x10fb96[0x0])||_0x10fb96[0x0],_0x5d28a0=_0x49c3e5['get'](_0x40732c[0x0])||_0x40732c[0x0];return _0x5aac5d[_0x1bd394(0x273)](_0x5d28a0,undefined,{'sensitivity':'base'});});for(const [_0x1c0867,_0x37c1c7]of _0x246990){const _0x43d30f=_0x49c3e5[_0x448e19(0x294)](_0x1c0867)||_0x1c0867;console['log'](_0x448e19(0x1e0)+_0x43d30f),_0x37c1c7[_0x448e19(0x2b0)](_0x1e4152);for(const _0x545b4e of _0x37c1c7){console[_0x448e19(0x1d3)](formatJourneyItem(_0x545b4e,'\x20\x20',_0x1282ee(_0x545b4e['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x7040e8(0x27b)]=a27_0x7040e8(0x237);[a27_0x7040e8(0x205)]=a27_0x7040e8(0x1fa);async[a27_0x7040e8(0x29d)](_0x1dde9e){const _0x3d2412=a27_0x7040e8,{options:_0x26556f,args:_0x51f619,tdx:_0x3361bf}=_0x1dde9e,_0xbb7456=_0x51f619[0x0];if(!_0xbb7456)return console[_0x3d2412(0x1f4)](_0x3d2412(0x21a)),console['error'](_0x3d2412(0x266)),console['error'](_0x3d2412(0x236)),console[_0x3d2412(0x1f4)](_0x3d2412(0x1ed)),0x1;_0x26556f['verbose']&&console['error']('Input:\x20'+_0xbb7456);const {journeyId:_0xe40a7,parentSegmentId:_0x2bf133}=await resolveJourneyIdFromInput(_0xbb7456,_0x26556f,_0x3361bf);if(_0x26556f[_0x3d2412(0x22d)]){const _0x431163=getConsoleNextUrl(_0x26556f[_0x3d2412(0x1e5)],'/app/ps/'+_0x2bf133+_0x3d2412(0x2bb)+_0xe40a7+_0x3d2412(0x288));return console[_0x3d2412(0x1f4)](a27_0x740456[_0x3d2412(0x2ae)]('✔')+_0x3d2412(0x289)+a27_0x740456['cyan'](_0x431163)),openBrowser(_0x431163),0x0;}const _0x5df931=await withSpinner(_0x3d2412(0x211),()=>_0x3361bf[_0x3d2412(0x209)][_0x3d2412(0x231)](_0xe40a7),{'verbose':_0x26556f[_0x3d2412(0x238)]}),_0x3c8d10=_0x5df931['data'],_0x7b9811=_0x26556f[_0x3d2412(0x23f)];let _0x45086a;if(_0x7b9811)try{const _0x422d69=await withSpinner(_0x3d2412(0x2a7),()=>_0x3361bf[_0x3d2412(0x209)][_0x3d2412(0x1e1)](_0xe40a7),{'verbose':_0x26556f[_0x3d2412(0x238)]});_0x45086a=_0x422d69[_0x3d2412(0x247)];}catch{_0x26556f[_0x3d2412(0x238)]&&console[_0x3d2412(0x1f4)]('\x20\x20Statistics\x20not\x20available');}const _0x2286da=getConsoleNextUrl(_0x26556f[_0x3d2412(0x1e5)],_0x3d2412(0x2bd)+_0x2bf133+'/e/'+_0xe40a7+_0x3d2412(0x288)),_0x30c919={'id':_0x3c8d10['id'],'name':_0x3c8d10[_0x3d2412(0x24d)]['name'],'description':_0x3c8d10['attributes'][_0x3d2412(0x205)],'state':_0x3c8d10[_0x3d2412(0x24d)]['state'],'paused':_0x3c8d10[_0x3d2412(0x24d)][_0x3d2412(0x29b)],'reentry_mode':_0x3c8d10[_0x3d2412(0x24d)]['reentryMode'],'stages':_0x3c8d10[_0x3d2412(0x24d)][_0x3d2412(0x1b5)]?.[_0x3d2412(0x1e3)]||0x0,..._0x3c8d10[_0x3d2412(0x24d)]['goal']&&{'goal':_0x3c8d10['attributes'][_0x3d2412(0x1b7)][_0x3d2412(0x27b)]},..._0x45086a&&{'statistics':{'size':_0x45086a[_0x3d2412(0x213)],'entered':_0x45086a['enteredSize'],'goal_achieved':_0x45086a[_0x3d2412(0x23a)],'completion_rate':_0x45086a[_0x3d2412(0x245)],'exit_or_jump':_0x45086a[_0x3d2412(0x203)],'exit_or_jump_rate':_0x45086a[_0x3d2412(0x251)],'stages':_0x45086a['stages']}},'url':_0x2286da};return await handleSingleObjectOutput(_0x30c919,_0x26556f),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x7040e8(0x27b)]='journey:stats';['description']=a27_0x7040e8(0x241);async[a27_0x7040e8(0x29d)](_0x157065){const _0x29a016=a27_0x7040e8,{options:_0x26c527,args:_0x46fc76,tdx:_0x16f041}=_0x157065,_0x3b17d5=_0x46fc76[0x0];if(!requireNameOrPath(_0x3b17d5))return 0x1;_0x26c527[_0x29a016(0x238)]&&console[_0x29a016(0x1f4)](_0x29a016(0x268)+_0x3b17d5);const _0x2b794c=_0x26c527,_0x275a0e=_0x2b794c[_0x29a016(0x223)],_0x390563=_0x2b794c['to'],_0x32d75=_0x2b794c['includeHistory'],_0x54b36c=_0x2b794c[_0x29a016(0x22c)];_0x32d75&&!_0x275a0e&&!_0x390563&&console['error'](_0x29a016(0x1dc));const _0x34645b=_0x32d75?withJsonFormat(_0x26c527):_0x26c527,{journeyId:_0x2d1eee,journeyName:_0x3b4108}=await resolveJourneyIdFromInput(_0x3b17d5,_0x34645b,_0x16f041),_0x1b8515=_0x275a0e||_0x390563?{'from':_0x275a0e,'to':_0x390563}:undefined,_0x407db2=await withSpinner(_0x29a016(0x2a7),()=>Promise[_0x29a016(0x25f)]([_0x16f041[_0x29a016(0x209)][_0x29a016(0x231)](_0x2d1eee),_0x16f041[_0x29a016(0x209)][_0x29a016(0x1e1)](_0x2d1eee,_0x1b8515)]),{'verbose':_0x34645b[_0x29a016(0x238)]}),[_0x3683fb,_0x442ae8]=_0x407db2[_0x29a016(0x247)];if(!_0x442ae8||_0x442ae8[_0x29a016(0x284)]===null)return console['error'](_0x29a016(0x28e)+_0x3b4108),console['error'](_0x29a016(0x21c)),0x0;const _0x3c3aa8=buildStageNameMap(_0x3683fb),_0x5722f7=!!(_0x1b8515&&_0x442ae8[_0x29a016(0x1f9)]?.[_0x29a016(0x1e3)]),_0x482508={'stageNameMap':_0x3c3aa8,'hasPeriod':_0x5722f7,'includeHistory':!!_0x32d75};if(_0x54b36c&&_0x442ae8[_0x29a016(0x1d9)]){const _0x2a69ef=_0x442ae8['stages']['find'](_0x2ed4eb=>{const _0xd59727=_0x29a016,_0x4c20dc=_0x3c3aa8['get'](_0x2ed4eb['id'])??'';return _0x4c20dc[_0xd59727(0x2bc)]()===_0x54b36c[_0xd59727(0x2bc)]();});if(_0x2a69ef)return await handleSingleObjectOutput(formatStageStats(_0x2a69ef,_0x482508),_0x34645b),0x0;const _0x2c6f9c=_0x442ae8[_0x29a016(0x1d9)][_0x29a016(0x1bc)](_0x3b7115=>_0x3c3aa8[_0x29a016(0x294)](_0x3b7115['id'])??_0x3b7115['id']);return console['error'](_0x29a016(0x24b)+_0x54b36c+_0x29a016(0x2c1)),console[_0x29a016(0x1f4)]('Available\x20stages:\x20'+_0x2c6f9c['join'](',\x20')),0x1;}const _0x285085=_0x442ae8['stages']?.[_0x29a016(0x1bc)](_0x14ce19=>formatStageStats(_0x14ce19,_0x482508)),_0x38aad5=assembleJourneyStats(_0x442ae8,{'from':_0x275a0e,'to':_0x390563,'includeHistory':_0x32d75});return await this[_0x29a016(0x292)](_0x38aad5,_0x285085??[],_0x34645b),0x0;}async['renderStats'](_0x232bd7,_0x2b329d,_0x36937f){const _0x772c84=a27_0x7040e8,_0x34940c=_0x36937f[_0x772c84(0x234)]===_0x772c84(0x2ab)||_0x36937f[_0x772c84(0x234)]==='jsonl'||_0x36937f['json']||_0x36937f['jsonl'];if(_0x34940c){_0x232bd7['stages']=_0x2b329d,await handleSingleObjectOutput(_0x232bd7,_0x36937f);return;}await handleSingleObjectOutput(_0x232bd7,_0x36937f);for(const _0x5d59ef of _0x2b329d){console[_0x772c84(0x1d3)](''),console['log'](String(a27_0x740456[_0x772c84(0x275)][_0x772c84(0x1cc)]('['+_0x5d59ef[_0x772c84(0x27b)]+']'))+a27_0x740456[_0x772c84(0x1d4)]('\x20'+_0x5d59ef['id']));const {id:_0x3ff165,name:_0x51522d,..._0x53e765}=_0x5d59ef;await handleSingleObjectOutput(_0x53e765,_0x36937f);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x7040e8(0x27b)]='journey:traffic';[a27_0x7040e8(0x205)]=a27_0x7040e8(0x1c4);async[a27_0x7040e8(0x29d)](_0x3120a1){const _0x59b24e=a27_0x7040e8,{options:_0x17fa3e,args:_0x53e19c,tdx:_0xaf81d9}=_0x3120a1,_0x2cc9b0=_0x53e19c[0x0];if(!requireNameOrPath(_0x2cc9b0))return 0x1;_0x17fa3e[_0x59b24e(0x238)]&&console[_0x59b24e(0x1f4)](_0x59b24e(0x268)+_0x2cc9b0);const _0xed181a=_0x17fa3e,_0x4b69bf=_0xed181a['type'],_0x56d707=_0xed181a[_0x59b24e(0x223)],_0x53614b=_0xed181a['to'],_0x2e59a5=_0xed181a['limit'];if(_0x4b69bf&&_0x4b69bf!==_0x59b24e(0x1d6)&&_0x4b69bf!=='activation')return console['error'](_0x59b24e(0x206)+_0x4b69bf+_0x59b24e(0x29f)),0x1;const _0x1eaa19=withJsonFormat(_0x17fa3e),{journeyId:_0x416a37,journeyName:_0x1809fc}=await resolveJourneyIdFromInput(_0x2cc9b0,_0x1eaa19,_0xaf81d9),_0x11a098={'type':_0x4b69bf,'from':_0x56d707,'to':_0x53614b,'limit':_0x2e59a5},_0x41bae9=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0xaf81d9['journey'][_0x59b24e(0x276)](_0x416a37,_0x11a098),{'verbose':_0x1eaa19[_0x59b24e(0x238)]}),_0x6471e7=_0x41bae9['data'],_0x50baa7=_0x6471e7[_0x59b24e(0x1d6)]&&(_0x6471e7['conversion']['nodes'][_0x59b24e(0x1e3)]>0x0||_0x6471e7['conversion'][_0x59b24e(0x25d)][_0x59b24e(0x1e3)]>0x0),_0x13f629=_0x6471e7[_0x59b24e(0x1df)]&&_0x6471e7['activation'][_0x59b24e(0x1e3)]>0x0;if(!_0x50baa7&&!_0x13f629)return console[_0x59b24e(0x1f4)](_0x59b24e(0x29c)+_0x1809fc),console['error'](_0x59b24e(0x2b7)),_0x56d707&&_0x53614b&&console[_0x59b24e(0x1f4)](_0x59b24e(0x298)),0x0;return await handleSingleObjectOutput(_0x6471e7,_0x1eaa19),0x0;}}function formatStageStats(_0x5bdd5b,_0x59375b){const _0x59aef0=a27_0x7040e8,_0x42f536=_0x59375b['hasPeriod']&&_0x5bdd5b[_0x59aef0(0x1f9)]?.['length']?aggregateStageHistory(_0x5bdd5b[_0x59aef0(0x1f9)]):{'size':_0x5bdd5b[_0x59aef0(0x213)],'entered':_0x5bdd5b[_0x59aef0(0x1db)],'milestone':_0x5bdd5b[_0x59aef0(0x25c)],'milestone_rate':_0x5bdd5b[_0x59aef0(0x279)],'exit_or_jump':_0x5bdd5b['exitOrJumpSize'],'exit_or_jump_rate':_0x5bdd5b[_0x59aef0(0x251)]},_0x415382={'id':_0x5bdd5b['id'],'name':_0x59375b[_0x59aef0(0x1ce)][_0x59aef0(0x294)](_0x5bdd5b['id'])??_0x5bdd5b['id'],..._0x42f536};return _0x59375b[_0x59aef0(0x239)]&&_0x59375b['includeHistory']&&_0x5bdd5b[_0x59aef0(0x1f9)]&&(_0x415382[_0x59aef0(0x1f9)]=_0x5bdd5b[_0x59aef0(0x1f9)]),_0x415382;}export class JourneyPauseCommand extends BaseCommand{[a27_0x7040e8(0x27b)]=a27_0x7040e8(0x1ff);[a27_0x7040e8(0x205)]='Pause\x20a\x20running\x20journey';async['execute'](_0x3e0d29){const _0x58ac90=a27_0x7040e8,{options:_0x401293,args:_0x4dcc34,tdx:_0x44f01c}=_0x3e0d29,_0x384148=_0x4dcc34[0x0];if(!requireNameOrPath(_0x384148))return 0x1;_0x401293[_0x58ac90(0x238)]&&console['error']('Input:\x20'+_0x384148);const {journeyId:_0xf47132,journeyName:_0x14f93f}=await resolveJourneyIdFromInput(_0x384148,_0x401293,_0x44f01c);if(!_0x401293[_0x58ac90(0x229)]){const _0x1f4734=await confirm(_0x58ac90(0x1b4)+_0x14f93f+'\x22?');if(!_0x1f4734)return console[_0x58ac90(0x1f4)](_0x58ac90(0x22f)),0x0;}const _0x3cfe64=await withSpinner('Pausing\x20journey...',()=>_0x44f01c[_0x58ac90(0x209)][_0x58ac90(0x1cf)](_0xf47132),{'verbose':_0x401293[_0x58ac90(0x238)]}),_0x1f567f=_0x3cfe64[_0x58ac90(0x247)];return console[_0x58ac90(0x1f4)](_0x58ac90(0x2a6)+_0x1f567f[_0x58ac90(0x24d)][_0x58ac90(0x27b)]+_0x58ac90(0x254)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x7040e8(0x27b)]=a27_0x7040e8(0x291);['description']=a27_0x7040e8(0x1f1);async['execute'](_0x4edc43){const _0x504f1a=a27_0x7040e8,{options:_0x27100a,args:_0x3a97b7,tdx:_0x14caf3}=_0x4edc43,_0x4ce006=_0x3a97b7[0x0];if(!requireNameOrPath(_0x4ce006))return 0x1;_0x27100a[_0x504f1a(0x238)]&&console[_0x504f1a(0x1f4)](_0x504f1a(0x268)+_0x4ce006);const {journeyId:_0x5054a2,journeyName:_0x1b7c46}=await resolveJourneyIdFromInput(_0x4ce006,_0x27100a,_0x14caf3);if(!_0x27100a['yes']){const _0x3425bf=await confirm(_0x504f1a(0x24f)+_0x1b7c46+'\x22?');if(!_0x3425bf)return console['error'](_0x504f1a(0x22f)),0x0;}const _0x190f3e=await withSpinner('Resuming\x20journey...',()=>_0x14caf3['journey'][_0x504f1a(0x2a0)](_0x5054a2),{'verbose':_0x27100a[_0x504f1a(0x238)]}),_0x7445a7=_0x190f3e[_0x504f1a(0x247)];return console[_0x504f1a(0x1f4)]('✔\x20Journey\x20\x22'+_0x7445a7[_0x504f1a(0x24d)]['name']+_0x504f1a(0x26c)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x7040e8(0x27b)]='journey:pull';['description']=a27_0x7040e8(0x299);async[a27_0x7040e8(0x29d)](_0x195411){const _0x2f12be=a27_0x7040e8,{options:_0x2beb84,args:_0x179f7a,tdx:_0x3e958c}=_0x195411,_0x16a450=_0x2beb84,_0x5de339=_0x179f7a[0x0],_0x571619=_0x5de339&&isYamlFilePath(_0x5de339),_0x35163d=await resolveTarget({'arg':_0x571619?_0x5de339:undefined,'contextParent':_0x2beb84[_0x2f12be(0x1fb)],'cwd':process[_0x2f12be(0x26a)]()});if(!isSuccessfulResolution(_0x35163d))return _0x35163d[_0x2f12be(0x252)]===_0x2f12be(0x2b9)?(console['error'](a27_0x740456[_0x2f12be(0x235)](_0x2f12be(0x1f7))),console[_0x2f12be(0x1f4)]('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)'),console['error'](_0x2f12be(0x246)),console[_0x2f12be(0x1f4)](_0x2f12be(0x23c)),console[_0x2f12be(0x1f4)](_0x2f12be(0x26d))):(console[_0x2f12be(0x1f4)](a27_0x740456['red'](_0x2f12be(0x253)+_0x35163d[_0x2f12be(0x2a8)]+'\x0a')),_0x35163d['helpText']&&console['error'](a27_0x740456[_0x2f12be(0x275)](_0x35163d[_0x2f12be(0x29e)]))),0x1;let _0x296ec7=_0x571619?undefined:_0x5de339,_0x1fb33e,_0x38dd93;_0x35163d[_0x2f12be(0x24a)]==='file'&&(_0x296ec7=_0x35163d[_0x2f12be(0x29a)],_0x1fb33e=_0x35163d[_0x2f12be(0x1fc)],_0x38dd93=_0x35163d[_0x2f12be(0x282)]);const _0x220727=_0x35163d[_0x2f12be(0x2bf)],_0x4d5d4d=_0x35163d[_0x2f12be(0x2be)];_0x16a450[_0x2f12be(0x238)]&&(console[_0x2f12be(0x1f4)](_0x2f12be(0x258)+_0x220727),console[_0x2f12be(0x1f4)](_0x2f12be(0x2b1)+_0x4d5d4d),_0x296ec7&&console['error'](_0x2f12be(0x27c)+_0x296ec7),_0x1fb33e&&console[_0x2f12be(0x1f4)](_0x2f12be(0x1c5)+_0x1fb33e),_0x38dd93&&console[_0x2f12be(0x1f4)](_0x2f12be(0x2b4)+_0x38dd93));const _0x1ffe15=await withSpinner(_0x2f12be(0x20d),()=>_0x3e958c[_0x2f12be(0x1ee)][_0x2f12be(0x1da)](_0x220727),{'verbose':_0x2beb84[_0x2f12be(0x238)]}),_0x29498f=_0x1ffe15[_0x2f12be(0x247)],{journeys:_0x54d7bd,folders:_0x14b740}=await withSpinner(_0x2f12be(0x21d),async()=>{const _0x34cff9=_0x2f12be,[_0x34ae28,_0x224074]=await Promise['all']([_0x3e958c[_0x34cff9(0x209)][_0x34cff9(0x2a3)](_0x29498f,undefined,{'includeAllVersions':!![]}),_0x3e958c['segment']['listFolders'](_0x29498f)]);return{'journeys':_0x34ae28,'folders':_0x224074};},{'verbose':_0x2beb84['verbose']})['then'](_0x2c5736=>_0x2c5736[_0x2f12be(0x247)]);let _0x120a3b=_0x54d7bd;const _0x41f235=buildFolderIdToPathMap(_0x14b740);if(_0x296ec7){const _0x43ea6a=_0x120a3b[_0x2f12be(0x2b3)](_0x283325=>_0x283325[_0x2f12be(0x1f0)][_0x2f12be(0x2bc)]()===_0x296ec7[_0x2f12be(0x2bc)]());if(_0x43ea6a['length']===0x0)return console[_0x2f12be(0x1f4)](_0x2f12be(0x224)+_0x296ec7),console['error'](_0x2f12be(0x227)),0x1;_0x120a3b=_0x43ea6a;}if(_0x38dd93!==undefined){const _0x1f9786=_0x120a3b['filter'](_0x3515da=>{const _0x25bb83=_0x2f12be,_0x316ee4=_0x3515da[_0x25bb83(0x1c8)]?_0x41f235[_0x25bb83(0x294)](_0x3515da[_0x25bb83(0x1c8)])||'':'';return _0x316ee4===_0x38dd93;});if(_0x1f9786[_0x2f12be(0x1e3)]===0x0&&_0x120a3b[_0x2f12be(0x1e3)]>0x0){console[_0x2f12be(0x1f4)](_0x2f12be(0x1fd)+_0x296ec7+_0x2f12be(0x1c2)+(_0x38dd93||_0x2f12be(0x285))),console[_0x2f12be(0x1f4)](_0x2f12be(0x1d7));for(const _0x397cb4 of _0x120a3b){const _0x130fa0=_0x397cb4[_0x2f12be(0x1c8)]?_0x41f235[_0x2f12be(0x294)](_0x397cb4['folderId'])||'':'';console[_0x2f12be(0x1f4)](_0x2f12be(0x260)+(_0x130fa0||_0x2f12be(0x28a))+'/'+_0x397cb4[_0x2f12be(0x1f0)]);}return 0x1;}_0x120a3b=_0x1f9786;}if(_0x120a3b['length']===0x0)return console[_0x2f12be(0x1f4)](_0x2f12be(0x1d8)),0x0;const _0x1901fa=new Map();for(const _0x2e7cf6 of _0x120a3b){const _0x25d7cc=_0x2e7cf6['journeyBundleId'];!_0x1901fa['has'](_0x25d7cc)&&_0x1901fa['set'](_0x25d7cc,[]),_0x1901fa[_0x2f12be(0x294)](_0x25d7cc)[_0x2f12be(0x248)](_0x2e7cf6);}for(const _0xfea9ef of _0x1901fa[_0x2f12be(0x269)]()){_0xfea9ef[_0x2f12be(0x2b0)]((_0x3a2502,_0x160acb)=>(_0x3a2502[_0x2f12be(0x219)]||0x0)-(_0x160acb[_0x2f12be(0x219)]||0x0));}const _0x23a8c0=[],{idToEmailMap:_0x284b04,connectionIdToNameMap:_0x336b68}=await withSpinner(_0x2f12be(0x2b2),async()=>{const _0x344826=_0x2f12be,[_0x352388,_0x2e979a]=await Promise['all']([_0x3e958c[_0x344826(0x286)][_0x344826(0x20a)](),_0x3e958c[_0x344826(0x2a5)][_0x344826(0x1c0)]()]);return{'idToEmailMap':_0x352388,'connectionIdToNameMap':_0x2e979a};},{'verbose':_0x2beb84[_0x2f12be(0x238)]})[_0x2f12be(0x1b2)](_0x1f5c7f=>_0x1f5c7f[_0x2f12be(0x247)]);for(const _0x175804 of _0x1901fa[_0x2f12be(0x269)]()){const _0x3fd1db=_0x175804[0x0]['journeyBundleName'],_0x4c1475=_0x175804[0x0]['folderId'],_0x57c1ff=_0x4c1475?_0x41f235[_0x2f12be(0x294)](_0x4c1475)||'':'',_0x50ff85=_0x57c1ff?a27_0x1966d1['join'](_0x4d5d4d,_0x57c1ff):_0x4d5d4d,_0xc32203=_0x1fb33e||a27_0x1966d1['join'](_0x50ff85,sanitizeFileName(_0x3fd1db)+_0x2f12be(0x263));let _0x37a7a4,_0x3c3790;if(existsSync(_0xc32203))try{const _0x3fe1ab=readFileSync(_0xc32203,_0x2f12be(0x259)),_0x489832=parseYamlString(_0x3fe1ab);_0x3c3790=_0x489832,_0x37a7a4=buildRuleToNameMapping(_0x489832),_0x16a450['verbose']&&_0x37a7a4[_0x2f12be(0x213)]>0x0&&console[_0x2f12be(0x1f4)]('Found\x20'+_0x37a7a4[_0x2f12be(0x213)]+_0x2f12be(0x28f)+_0x3fd1db);}catch(_0x44cf1b){_0x16a450['verbose']&&console['error'](_0x2f12be(0x201)+_0x44cf1b[_0x2f12be(0x2a8)]);}const _0x65a9f3=[],_0x3184d8=new Set(),_0x4cccf1=new Map(),_0x5cf3cc=new Map(),_0x24e385=new Set(),_0x1e48cf=new Map(),_0x4b5255=new Map(),_0x4ebc6d=createJumpTargetCache();await withProgressSpinner(_0x2f12be(0x1c7)+_0x3fd1db+_0x2f12be(0x1bd),async _0x3338e5=>{const _0x41de16=_0x2f12be;for(const _0x595ded of _0x175804){const _0x1fa27e=_0x175804[_0x41de16(0x1e3)]>0x1?_0x595ded[_0x41de16(0x1f0)]+'\x20v'+(_0x595ded[_0x41de16(0x219)]||0x1):_0x595ded['journeyBundleName'];_0x3338e5['setPhase'](_0x41de16(0x1c7)+_0x1fa27e);const _0xed4958=await _0x3e958c[_0x41de16(0x209)][_0x41de16(0x231)](_0x595ded['id']),_0x4ef465=_0xed4958[_0x41de16(0x24d)]?.[_0x41de16(0x1e7)],_0x2dd5e0={'resolveSegment':async _0x389e55=>{const _0x426e2b=_0x41de16;if(!_0x4ef465)return{'name':_0x389e55,'isJourneyLocal':![]};const _0x142121=_0x4cccf1[_0x426e2b(0x294)](_0x389e55);if(_0x142121)return _0x142121;try{const _0x512c38=await _0x3e958c[_0x426e2b(0x1ee)][_0x426e2b(0x2b6)](_0x4ef465,_0x389e55),_0x45e6fd=_0x512c38['kind']===SEGMENT_KIND_JOURNEY;let _0x19aacd,_0x484b2e=_0x512c38[_0x426e2b(0x27b)];if(_0x45e6fd&&_0x512c38[_0x426e2b(0x21e)]){const _0x5d8b54=await segmentResponseToDef(_0x512c38,{'resolveSegmentName':async _0x3664fb=>{const _0x36902f=_0x426e2b,_0x343403=_0x4cccf1['get'](_0x3664fb);if(_0x343403)return _0x343403[_0x36902f(0x27b)];const _0x24cc7e=await _0x2dd5e0[_0x36902f(0x1dd)](_0x3664fb);return _0x24cc7e[_0x36902f(0x27b)];}}),_0x27c62b=_0x5d8b54[_0x426e2b(0x21e)];_0x19aacd={'description':_0x512c38[_0x426e2b(0x205)],'rule':_0x27c62b};const _0x3a3bc3=serializeRule(_0x27c62b),_0x562fe8=_0x5cf3cc[_0x426e2b(0x294)](_0x3a3bc3);if(_0x562fe8)_0x484b2e=_0x562fe8,_0x19aacd=undefined,_0x16a450[_0x426e2b(0x238)]&&console[_0x426e2b(0x1f4)](_0x426e2b(0x1bf)+_0x512c38['name']+_0x426e2b(0x257)+_0x562fe8);else{let _0xbb958=![];if(_0x37a7a4){const _0x2e52e7=_0x37a7a4[_0x426e2b(0x294)](_0x3a3bc3);if(_0x2e52e7){const _0x5ac642=_0x2e52e7[_0x426e2b(0x1f5)](_0x573c82=>!_0x3184d8[_0x426e2b(0x256)](_0x573c82));_0x5ac642&&(_0x484b2e=_0x5ac642,_0x3184d8[_0x426e2b(0x210)](_0x5ac642),_0x5cf3cc['set'](_0x3a3bc3,_0x5ac642),_0xbb958=!![],_0x16a450[_0x426e2b(0x238)]&&console[_0x426e2b(0x1f4)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x5ac642+_0x426e2b(0x1c3)));}}if(!_0xbb958){const _0x23ad05=generateJourneyLocalName(_0x512c38['name']);_0x23ad05&&(_0x484b2e=_0x23ad05);let _0x30828e=_0x484b2e,_0x5b3d61=0x2;while(_0x3184d8[_0x426e2b(0x256)](_0x30828e)){_0x30828e=_0x484b2e+'_'+_0x5b3d61,_0x5b3d61++;}_0x3184d8['add'](_0x30828e),_0x5cf3cc[_0x426e2b(0x2b8)](_0x3a3bc3,_0x30828e),_0x484b2e=_0x30828e;}}}const _0x4fff6f={'name':_0x484b2e,'isJourneyLocal':_0x45e6fd,'definition':_0x19aacd};return _0x4cccf1[_0x426e2b(0x2b8)](_0x389e55,_0x4fff6f),_0x4fff6f;}catch(_0x4ed8cd){return _0x2beb84[_0x426e2b(0x238)]&&console['error'](_0x426e2b(0x1c1)+_0x389e55+':\x20'+_0x4ed8cd[_0x426e2b(0x2a8)]),{'name':_0x389e55,'isJourneyLocal':![]};}},'resolveActivation':async _0x308bb8=>{const _0x2f03c1=_0x41de16,_0x3a4df2=_0x1e48cf[_0x2f03c1(0x294)](_0x308bb8);if(_0x3a4df2)return _0x3a4df2;try{const _0x2f05cc=await _0x3e958c[_0x2f03c1(0x209)][_0x2f03c1(0x22b)](_0x595ded['id'],_0x308bb8),_0x38a734=journeyActivationStepToYaml(_0x2f05cc,_0x284b04,_0x336b68),_0x5a68a0=JSON[_0x2f03c1(0x207)]({'name':_0x38a734[_0x2f03c1(0x27b)],'connection':_0x38a734[_0x2f03c1(0x2a5)],'connector_config':_0x38a734['connector_config']}),_0x3752b5=_0x4b5255[_0x2f03c1(0x294)](_0x5a68a0);if(_0x3752b5){const _0x3cef74={'name':_0x3752b5,'isJourneyLocal':!![],'definition':_0x38a734};return _0x1e48cf[_0x2f03c1(0x2b8)](_0x308bb8,_0x3cef74),_0x3cef74;}const _0xc28c5b=_0x2f05cc[_0x2f03c1(0x24d)]['activationParams']['name']||_0x308bb8,_0x4c72a9=sanitizeYamlKey(_0xc28c5b)||_0x2f03c1(0x202)+_0x308bb8;let _0x2aeb1a=_0x4c72a9,_0x20de4f=0x2;while(_0x24e385[_0x2f03c1(0x256)](_0x2aeb1a)){_0x2aeb1a=_0x4c72a9+'_'+_0x20de4f,_0x20de4f++;}_0x24e385['add'](_0x2aeb1a),_0x4b5255[_0x2f03c1(0x2b8)](_0x5a68a0,_0x2aeb1a);const _0x36f8cb={'name':_0x2aeb1a,'isJourneyLocal':!![],'definition':_0x38a734};return _0x1e48cf[_0x2f03c1(0x2b8)](_0x308bb8,_0x36f8cb),_0x36f8cb;}catch(_0x59f707){return _0x2beb84[_0x2f03c1(0x238)]&&console[_0x2f03c1(0x1f4)]('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x308bb8+':\x20'+_0x59f707['message']),{'name':_0x308bb8,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x6f921f,_0x325312)=>{const _0x57e958=_0x41de16;return resolveJumpTarget(_0x6f921f,_0x325312,_0x4ebc6d,_0x505c0d=>_0x3e958c[_0x57e958(0x209)][_0x57e958(0x231)](_0x505c0d));}},_0x41d61f=await journeyResponseToDef(_0xed4958,_0x2dd5e0);_0x65a9f3[_0x41de16(0x248)]({'item':_0x595ded,'yaml':_0x41d61f});}},{'verbose':_0x2beb84[_0x2f12be(0x238)]});const _0x17851e=await _0x3e958c[_0x2f12be(0x209)][_0x2f12be(0x1de)](_0x175804[0x0][_0x2f12be(0x297)]),_0x4ece53=buildMergedJourneyDef(_0x65a9f3,_0x37a7a4,_0x17851e),_0x324886=normalizeJourneyDef(_0x4ece53,_0x3c3790),_0x1ff4d2=toYamlString(_0x324886),_0x5108ca=_0x1fb33e||a27_0x1966d1[_0x2f12be(0x2aa)](_0x50ff85,sanitizeFileName(_0x3fd1db)+_0x2f12be(0x263));!_0x1fb33e&&_0x57c1ff&&!existsSync(_0x50ff85)&&mkdirSync(_0x50ff85,{'recursive':!![]});const _0x450ccf=a27_0x1966d1[_0x2f12be(0x27f)](process[_0x2f12be(0x26a)](),_0x5108ca);if(existsSync(_0x5108ca)){const _0x3d31db=readFileSync(_0x5108ca,'utf-8'),_0x3178eb=generateDiff(_0x3d31db,_0x1ff4d2),_0x526186=hasChanges(_0x3178eb);_0x23a8c0['push']({'relativePath':_0x450ccf,'absolutePath':_0x5108ca,'content':_0x1ff4d2,'isNew':![],'hasChanges':_0x526186,'diff':_0x526186?formatDiffWithColors(_0x3178eb):undefined});}else _0x23a8c0[_0x2f12be(0x248)]({'relativePath':_0x450ccf,'absolutePath':_0x5108ca,'content':_0x1ff4d2,'isNew':!![],'hasChanges':![]});}const _0x36150a=_0x23a8c0[_0x2f12be(0x2b3)](_0x16b49b=>_0x16b49b[_0x2f12be(0x230)]),_0xaf34d8=_0x23a8c0[_0x2f12be(0x2b3)](_0x1b0bf3=>!_0x1b0bf3[_0x2f12be(0x230)]&&_0x1b0bf3['hasChanges']),_0x38f4cf=_0x23a8c0[_0x2f12be(0x2b3)](_0x26b839=>!_0x26b839[_0x2f12be(0x230)]&&!_0x26b839[_0x2f12be(0x1f6)]),_0x3eef38=_0x120a3b[_0x2f12be(0x1e3)],_0x155c15=_0x1901fa[_0x2f12be(0x213)],_0x41d980=_0x3eef38>_0x155c15?'\x20('+_0x3eef38+_0x2f12be(0x27e):'';console[_0x2f12be(0x1f4)](_0x2f12be(0x216)),console[_0x2f12be(0x1f4)]('\x20\x20'+a27_0x740456['cyan'](_0x155c15+_0x2f12be(0x1b1))+a27_0x740456[_0x2f12be(0x1d4)](_0x41d980)),console[_0x2f12be(0x1f4)]('\x20\x20'+a27_0x740456[_0x2f12be(0x2ae)]('+\x20'+_0x36150a['length']+_0x2f12be(0x244))),console[_0x2f12be(0x1f4)]('\x20\x20'+a27_0x740456['yellow']('~\x20'+_0xaf34d8[_0x2f12be(0x1e3)]+_0x2f12be(0x242))),console[_0x2f12be(0x1f4)]('\x20\x20'+a27_0x740456[_0x2f12be(0x1d4)]('=\x20'+_0x38f4cf[_0x2f12be(0x1e3)]+_0x2f12be(0x2ac))),console[_0x2f12be(0x1f4)](_0x2f12be(0x1d2)+a27_0x740456[_0x2f12be(0x275)](_0x4d5d4d)+'\x0a');if(_0xaf34d8[_0x2f12be(0x1e3)]>0x0)for(const _0x348984 of _0xaf34d8){console[_0x2f12be(0x1f4)](_0x2f12be(0x1bb)+_0x348984['relativePath']+'\x27:'),console[_0x2f12be(0x1f4)]('─'['repeat'](0x3c)),console[_0x2f12be(0x1f4)](_0x348984[_0x2f12be(0x2a9)]),console[_0x2f12be(0x1f4)]('─'['repeat'](0x3c));}if(_0x16a450['dryRun'])return console['error'](a27_0x740456[_0x2f12be(0x235)](_0x2f12be(0x262))),0x0;if(_0x36150a[_0x2f12be(0x1e3)]===0x0&&_0xaf34d8[_0x2f12be(0x1e3)]===0x0)return console['error'](a27_0x740456[_0x2f12be(0x2ae)](_0x2f12be(0x232))),saveSessionContext({'parent_segment':_0x220727},_0x16a450[_0x2f12be(0x1f2)]),console[_0x2f12be(0x1f4)](a27_0x740456[_0x2f12be(0x2ae)](_0x2f12be(0x2c0)+a27_0x740456[_0x2f12be(0x1d4)](_0x2f12be(0x1cd))+_0x2f12be(0x2ba)+a27_0x740456[_0x2f12be(0x275)](_0x220727))),0x0;if(!_0x16a450[_0x2f12be(0x229)]&&(_0x36150a[_0x2f12be(0x1e3)]>0x0||_0xaf34d8[_0x2f12be(0x1e3)]>0x0)){if(!isInteractive())return console[_0x2f12be(0x1f4)](a27_0x740456[_0x2f12be(0x226)]('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x2f12be(0x1f4)](a27_0x740456[_0x2f12be(0x1d4)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2058cd=await confirmKey(_0x2f12be(0x225)+(_0x36150a[_0x2f12be(0x1e3)]+_0xaf34d8[_0x2f12be(0x1e3)])+'\x20files?');if(!_0x2058cd)return console[_0x2f12be(0x1f4)](a27_0x740456[_0x2f12be(0x235)](_0x2f12be(0x26e)),_0x2f12be(0x240)),0x1;}!existsSync(_0x4d5d4d)&&mkdirSync(_0x4d5d4d,{'recursive':!![]});const _0x1a5107=a27_0x1966d1[_0x2f12be(0x2aa)](_0x4d5d4d,_0x2f12be(0x287));writeFileSync(_0x1a5107,createTdxConfigContent(_0x220727),_0x2f12be(0x259));for(const _0x5418f1 of _0x23a8c0){(_0x5418f1[_0x2f12be(0x230)]||_0x5418f1[_0x2f12be(0x1f6)])&&writeFileSync(_0x5418f1[_0x2f12be(0x200)],_0x5418f1[_0x2f12be(0x277)],_0x2f12be(0x259));}return console[_0x2f12be(0x1f4)](a27_0x740456[_0x2f12be(0x2ae)](_0x2f12be(0x1d5)+(_0x36150a['length']+_0xaf34d8['length'])+_0x2f12be(0x2a1)+_0x4d5d4d)),saveSessionContext({'parent_segment':_0x220727},_0x16a450['session']),console[_0x2f12be(0x1f4)](a27_0x740456[_0x2f12be(0x2ae)](_0x2f12be(0x2c0)+a27_0x740456[_0x2f12be(0x1d4)](_0x2f12be(0x1cd))+'\x20=\x20'+a27_0x740456[_0x2f12be(0x275)](_0x220727))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x7040e8(0x27b)]='journey:columns';[a27_0x7040e8(0x205)]=a27_0x7040e8(0x2af);async[a27_0x7040e8(0x29d)](_0x1ca079){const _0xcebc4e=a27_0x7040e8,{options:_0x1bbae5,args:_0x139bae,tdx:_0x31f575}=_0x1ca079,_0x28fb45=_0x139bae[0x0];if(!requireNameOrPath(_0x28fb45))return 0x1;_0x1bbae5[_0xcebc4e(0x238)]&&console[_0xcebc4e(0x1f4)](_0xcebc4e(0x268)+_0x28fb45);const {journeyId:_0x3f446c}=await resolveJourneyIdFromInput(_0x28fb45,_0x1bbae5,_0x31f575),_0x29ce03=await withSpinner(_0xcebc4e(0x27a),()=>_0x31f575[_0xcebc4e(0x209)][_0xcebc4e(0x24e)](_0x3f446c),{'verbose':_0x1bbae5[_0xcebc4e(0x238)]}),_0x1ad5eb=_0x29ce03['data'];return console[_0xcebc4e(0x1d3)](_0xcebc4e(0x228)+_0x1ad5eb[_0xcebc4e(0x1fe)]),console[_0xcebc4e(0x1d3)](_0xcebc4e(0x20b)+_0x1ad5eb[_0xcebc4e(0x1e6)]),await handleSDKOutput(_0x1ad5eb[_0xcebc4e(0x20c)],_0x1bbae5),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a27_0x7040e8(0x25e);[a27_0x7040e8(0x205)]=a27_0x7040e8(0x20e);async['execute'](_0xd61947){const _0x38a90c=a27_0x7040e8,{options:_0x1c9691,args:_0x31486e,tdx:_0x453554}=_0xd61947,_0x1f790a=_0x31486e[0x0];if(!requireNameOrPath(_0x1f790a))return 0x1;_0x1c9691['verbose']&&console[_0x38a90c(0x1f4)]('Input:\x20'+_0x1f790a);const {journeyId:_0x290278}=await resolveJourneyIdFromInput(_0x1f790a,_0x1c9691,_0x453554),_0x20a09c=await withSpinner(_0x38a90c(0x255),()=>_0x453554['journey'][_0x38a90c(0x1be)](_0x290278),{'verbose':_0x1c9691[_0x38a90c(0x238)]}),_0x2a867b=_0x20a09c['data'];return console[_0x38a90c(0x1f4)](_0x38a90c(0x1ba)+_0x2a867b[_0x38a90c(0x1e3)]+'\x20activation'+(_0x2a867b[_0x38a90c(0x1e3)]!==0x1?'s':'')),await handleSDKOutput(_0x2a867b,_0x1c9691),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x7040e8(0x27b)]='journey:push';[a27_0x7040e8(0x205)]=a27_0x7040e8(0x2ad);['segmentPushCommand']=new SegmentPushCommand();async[a27_0x7040e8(0x29d)](_0x32d033){const _0x5d7eaa=a27_0x7040e8,_0x41b059=_0x32d033[_0x5d7eaa(0x23e)][0x0];let _0x3099f8;if(_0x41b059){const _0x46b1d4=await resolveTarget({'arg':_0x41b059,'contextParent':_0x32d033[_0x5d7eaa(0x1b0)][_0x5d7eaa(0x1fb)],'cwd':process[_0x5d7eaa(0x26a)]()});isSuccessfulResolution(_0x46b1d4)&&_0x46b1d4[_0x5d7eaa(0x24a)]===_0x5d7eaa(0x25b)&&(_0x3099f8=_0x46b1d4[_0x5d7eaa(0x1fc)]);}const _0x14bf38={..._0x32d033,'options':{..._0x32d033['options'],'journeysOnly':!![],..._0x3099f8&&{'singleFilePath':_0x3099f8}}};return this[_0x5d7eaa(0x23d)][_0x5d7eaa(0x29d)](_0x14bf38);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x7040e8(0x27b)]=a27_0x7040e8(0x22a);[a27_0x7040e8(0x205)]=a27_0x7040e8(0x1b6);async[a27_0x7040e8(0x29d)](_0x5d51cc){const _0x531d4b=a27_0x7040e8,{options:_0x27e9ea,args:_0x4556f8,tdx:_0x63c747}=_0x5d51cc,_0x3894d1=_0x4556f8[0x0];if(!requireNameOrPath(_0x3894d1))return 0x1;if(_0x27e9ea[_0x531d4b(0x238)])console['error'](_0x531d4b(0x268)+_0x3894d1);const {journeyId:_0x1b6763}=await resolveJourneyIdFromInput(_0x3894d1,_0x27e9ea,_0x63c747),_0x4b5b31=await withSpinner(_0x531d4b(0x1af),()=>_0x63c747[_0x531d4b(0x209)][_0x531d4b(0x27d)](_0x1b6763),{'verbose':_0x27e9ea[_0x531d4b(0x238)]}),{bundleName:_0x37a6fc,versions:_0x43ce22,latestJourneyId:_0x121486}=_0x4b5b31['data'];console[_0x531d4b(0x1f4)](_0x37a6fc+':\x20'+_0x43ce22['length']+_0x531d4b(0x1d0)+(_0x43ce22['length']!==0x1?'s':''));const _0x49c436=_0x43ce22['map'](_0x498983=>({'version':_0x498983[_0x531d4b(0x219)],'journey_id':_0x498983['journeyId'],'name':_0x498983[_0x531d4b(0x27b)],'state':_0x498983[_0x531d4b(0x249)],'paused':_0x498983[_0x531d4b(0x29b)],'latest':_0x498983[_0x531d4b(0x284)]===_0x121486,'created_at':_0x498983[_0x531d4b(0x1b9)]}));return await handleSDKOutput(_0x49c436,_0x27e9ea),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']='journey:version:create';[a27_0x7040e8(0x205)]=a27_0x7040e8(0x270);async[a27_0x7040e8(0x29d)](_0x11ead0){const _0x41f6cb=a27_0x7040e8,{options:_0x15b579,args:_0x2dc163,tdx:_0xca58f5}=_0x11ead0,_0x4e17c1=_0x2dc163[0x0];if(!requireNameOrPath(_0x4e17c1))return 0x1;if(_0x15b579['verbose'])console['error']('Input:\x20'+_0x4e17c1);const {journeyId:_0x4d64a0,journeyName:_0x4d566f}=await resolveJourneyIdFromInput(_0x4e17c1,_0x15b579,_0xca58f5);if(!_0x15b579['yes']){const _0xf93d0d=await confirm(_0x41f6cb(0x1c6)+_0x4d566f+'\x22?');if(!_0xf93d0d)return console[_0x41f6cb(0x1f4)](_0x41f6cb(0x22f)),0x0;}const _0x1ba6ab=await withSpinner('Creating\x20new\x20version...',()=>_0xca58f5[_0x41f6cb(0x209)]['createVersion'](_0x4d64a0),{'verbose':_0x15b579[_0x41f6cb(0x238)]}),_0x5c6bd7=_0x1ba6ab[_0x41f6cb(0x247)];return console[_0x41f6cb(0x1f4)](a27_0x740456['green']('✔')+_0x41f6cb(0x2a2)+_0x5c6bd7[_0x41f6cb(0x24d)][_0x41f6cb(0x219)]+'\x20(draft)\x20—\x20\x22'+_0x5c6bd7[_0x41f6cb(0x24d)][_0x41f6cb(0x27b)]+'\x22'),console['error'](_0x41f6cb(0x21b)+_0x5c6bd7['id']),await handleSingleObjectOutput({'id':_0x5c6bd7['id'],'name':_0x5c6bd7[_0x41f6cb(0x24d)]['name'],'version':_0x5c6bd7[_0x41f6cb(0x24d)][_0x41f6cb(0x219)],'state':_0x5c6bd7['attributes'][_0x41f6cb(0x249)],'bundle_id':_0x5c6bd7[_0x41f6cb(0x24d)][_0x41f6cb(0x297)],'created_at':_0x5c6bd7[_0x41f6cb(0x24d)][_0x41f6cb(0x1b9)]},_0x15b579),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x7040e8(0x27b)]=a27_0x7040e8(0x1e4);[a27_0x7040e8(0x205)]=a27_0x7040e8(0x2a4);async['execute'](_0x52d0ee){const _0x223a71=a27_0x7040e8,{options:_0xc2c6b3,args:_0x99408f,tdx:_0x46aa8e}=_0x52d0ee,_0x314112=_0x99408f[0x0];if(!requireNameOrPath(_0x314112))return 0x1;const _0x4f458b=_0xc2c6b3[_0x223a71(0x218)];if(!_0x4f458b)return console[_0x223a71(0x1f4)](_0x223a71(0x22e)),console[_0x223a71(0x1f4)](_0x223a71(0x28b)),0x1;const _0x1ee1eb=parseInt(_0x4f458b,0xa);if(isNaN(_0x1ee1eb)||_0x1ee1eb<0x1)return console[_0x223a71(0x1f4)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x4f458b),0x1;if(_0xc2c6b3[_0x223a71(0x238)])console['error'](_0x223a71(0x268)+_0x314112+_0x223a71(0x290)+_0x1ee1eb);const {journeyId:_0x229e5c,parentSegmentId:_0x5ac117}=await resolveJourneyIdFromInput(_0x314112,_0xc2c6b3,_0x46aa8e),_0x11d4fd=await withSpinner(_0x223a71(0x212),()=>_0x46aa8e['journey'][_0x223a71(0x27d)](_0x229e5c),{'verbose':_0xc2c6b3['verbose']}),{versions:_0x5ce1ef,latestJourneyId:_0x55e1d0}=_0x11d4fd[_0x223a71(0x247)],_0x1a99e1=_0x5ce1ef[_0x223a71(0x1f5)](_0x3a364d=>_0x3a364d['versionNumber']===_0x1ee1eb);if(!_0x1a99e1){const _0x2e2e5a=_0x5ce1ef[_0x223a71(0x1bc)](_0x2c39c1=>'v'+_0x2c39c1['versionNumber'])['join'](',\x20');return console[_0x223a71(0x1f4)](_0x223a71(0x1b3)+_0x1ee1eb+_0x223a71(0x1ea)+_0x2e2e5a),0x1;}const _0xcba8ea=await withSpinner(_0x223a71(0x264)+_0x1ee1eb+_0x223a71(0x20f),()=>_0x46aa8e['journey'][_0x223a71(0x231)](_0x1a99e1[_0x223a71(0x284)]),{'verbose':_0xc2c6b3[_0x223a71(0x238)]}),_0x57f4e8=_0xcba8ea[_0x223a71(0x247)],_0x46cb92=getConsoleNextUrl(_0xc2c6b3[_0x223a71(0x1e5)],_0x223a71(0x2bd)+_0x5ac117+'/e/'+_0x1a99e1[_0x223a71(0x284)]+_0x223a71(0x288));return await handleSingleObjectOutput({'id':_0x57f4e8['id'],'name':_0x57f4e8['attributes']['name'],'version':_0x57f4e8[_0x223a71(0x24d)][_0x223a71(0x219)],'description':_0x57f4e8['attributes']['description'],'state':_0x57f4e8[_0x223a71(0x24d)]['state'],'paused':_0x57f4e8[_0x223a71(0x24d)][_0x223a71(0x29b)],'reentry_mode':_0x57f4e8[_0x223a71(0x24d)]['reentryMode'],'stages':_0x57f4e8['attributes']['journeyStages']?.[_0x223a71(0x1e3)]||0x0,..._0x57f4e8[_0x223a71(0x24d)]['goal']&&{'goal':_0x57f4e8[_0x223a71(0x24d)][_0x223a71(0x1b7)][_0x223a71(0x27b)]},'latest':_0x1a99e1[_0x223a71(0x284)]===_0x55e1d0,'created_at':_0x57f4e8[_0x223a71(0x24d)][_0x223a71(0x1b9)],'updated_at':_0x57f4e8['attributes'][_0x223a71(0x1e2)],'url':_0x46cb92},_0xc2c6b3),0x0;}}
@@ -1 +1 @@
1
- const a28_0x2d6957=a28_0xfe80;(function(_0x378ee3,_0x4069fe){const _0x486df3=a28_0xfe80,_0x2da594=_0x378ee3();while(!![]){try{const _0x179a9a=-parseInt(_0x486df3(0x202))/0x1+-parseInt(_0x486df3(0x1d9))/0x2*(-parseInt(_0x486df3(0x200))/0x3)+parseInt(_0x486df3(0x1dc))/0x4+-parseInt(_0x486df3(0x212))/0x5+parseInt(_0x486df3(0x1f3))/0x6*(-parseInt(_0x486df3(0x1e0))/0x7)+-parseInt(_0x486df3(0x1ee))/0x8*(-parseInt(_0x486df3(0x1ed))/0x9)+parseInt(_0x486df3(0x20c))/0xa;if(_0x179a9a===_0x4069fe)break;else _0x2da594['push'](_0x2da594['shift']());}catch(_0x573373){_0x2da594['push'](_0x2da594['shift']());}}}(a28_0x4e03,0xbe1c6));function a28_0xfe80(_0x4d299c,_0x1849e5){_0x4d299c=_0x4d299c-0x1d6;const _0x4e03e2=a28_0x4e03();let _0xfe80fd=_0x4e03e2[_0x4d299c];return _0xfe80fd;}import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a28_0x4e03(){const _0x3a565e=['cwd','No\x20journey\x20YAML\x20files\x20found\x20in\x20','6fthNeI','hasErrors','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','valid','warnings','\x20warning(s)\x20found','helpText','\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','targetDir','Error:\x20','relativePath','journey','\x20journey(s)\x20with\x20errors,\x20','6hQbwDt','length','1515934yNvQoh','execute','message','.yaml','\x20segment\x20file(s)\x20skipped)','filter','filePath','reason','validCount','warningCount','14365570ztGJtg','\x20(skipped:\x20','errors','\x20error(s)','cyan','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','4273630LRwOUV','verbose','Error:\x20Directory\x20not\x20found:\x20','name','\x20journey(s)\x20valid','1171828EwghjU','\x20valid','error','318392yqkUMG','\x20segment\x20file(s)\x20skipped','dim','file','2536877PVlSkN','type','Validation\x20failed:\x20','green','invalidCount','✔\x20All\x20','log','skippedCount','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','endsWith','red','journey:validate','errorCode','4518Lniunr','13128ZBuJIl','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','yellow'];a28_0x4e03=function(){return _0x3a565e;};return a28_0x4e03();}import{existsSync}from'fs';import a28_0xab2b70 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a28_0x2d6957(0x1d7)]=a28_0x2d6957(0x1eb);['description']='Validate\x20journey\x20YAML\x20files';async[a28_0x2d6957(0x203)](_0x253d77){const _0x433e1f=a28_0x2d6957,{options:_0x17f37e,args:_0x27a52c}=_0x253d77,_0x27b823=_0x17f37e,_0x4d9e6b=await resolveTarget({'arg':_0x27a52c[0x0],'contextParent':_0x17f37e['parentSegment'],'cwd':process[_0x433e1f(0x1f1)]()});if(!isSuccessfulResolution(_0x4d9e6b))return _0x4d9e6b[_0x433e1f(0x1ec)]==='no_parent'?(console[_0x433e1f(0x1db)](a28_0xab2b70[_0x433e1f(0x1f0)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error'](_0x433e1f(0x1ef)),console[_0x433e1f(0x1db)](_0x433e1f(0x1fa)),console[_0x433e1f(0x1db)](_0x433e1f(0x1e8))):(console['error'](a28_0xab2b70[_0x433e1f(0x1ea)](_0x433e1f(0x1fc)+_0x4d9e6b[_0x433e1f(0x204)]+'\x0a')),_0x4d9e6b[_0x433e1f(0x1f9)]&&console['error'](a28_0xab2b70[_0x433e1f(0x210)](_0x4d9e6b['helpText']))),0x1;const _0x53dec6=_0x4d9e6b[_0x433e1f(0x1fb)],_0x42ffb9=_0x4d9e6b[_0x433e1f(0x1e1)]===_0x433e1f(0x1df)?_0x4d9e6b[_0x433e1f(0x208)]:undefined;if(!_0x42ffb9&&!existsSync(_0x53dec6))return console[_0x433e1f(0x1db)](a28_0xab2b70[_0x433e1f(0x1ea)](_0x433e1f(0x1d6)+_0x53dec6+'\x0a')),0x1;let _0x328b2b;if(_0x42ffb9){if(!_0x42ffb9[_0x433e1f(0x1e9)]('.yml')&&!_0x42ffb9[_0x433e1f(0x1e9)](_0x433e1f(0x205)))return console[_0x433e1f(0x1db)](a28_0xab2b70[_0x433e1f(0x1ea)](_0x433e1f(0x1f5)+_0x42ffb9+'\x0a')),0x1;_0x328b2b=[_0x42ffb9];}else _0x328b2b=findYamlFiles(_0x53dec6);if(_0x328b2b[_0x433e1f(0x201)]===0x0)return console[_0x433e1f(0x1db)](a28_0xab2b70[_0x433e1f(0x1ea)](_0x433e1f(0x211)+_0x53dec6+'\x0a')),0x1;const _0x31a565=validateYamlFiles(_0x328b2b,_0x53dec6,{'filterType':_0x433e1f(0x1fe)}),_0x3cb17e=calculateSummary(_0x31a565),_0xfd86bd=_0x31a565[_0x433e1f(0x207)](isValidationResult);if(_0xfd86bd[_0x433e1f(0x201)]===0x0)return console[_0x433e1f(0x1db)](a28_0xab2b70[_0x433e1f(0x1f0)](_0x433e1f(0x1f2)+_0x53dec6+'\x0a')),_0x3cb17e['skippedCount']>0x0&&console[_0x433e1f(0x1db)](a28_0xab2b70[_0x433e1f(0x1de)]('('+_0x3cb17e[_0x433e1f(0x1e7)]+_0x433e1f(0x206))),0x0;for(const _0x4ebabf of _0x31a565){if(!isValidationResult(_0x4ebabf)){_0x27b823[_0x433e1f(0x213)]&&console[_0x433e1f(0x1e6)](a28_0xab2b70[_0x433e1f(0x1de)]('-\x20'+_0x4ebabf[_0x433e1f(0x1fd)]+_0x433e1f(0x20d)+_0x4ebabf[_0x433e1f(0x209)]+')'));continue;}const {relativePath:_0x59594b,source:_0x1a4a6f,result:_0x48c6e1}=_0x4ebabf;if(_0x48c6e1['valid']&&_0x48c6e1['warnings'][_0x433e1f(0x201)]===0x0)_0x27b823['verbose']&&console[_0x433e1f(0x1e6)](a28_0xab2b70['green']('✔\x20'+_0x59594b));else _0x48c6e1[_0x433e1f(0x1f6)]?(console[_0x433e1f(0x1e6)](a28_0xab2b70[_0x433e1f(0x1f0)]('⚠\x20'+_0x59594b+':\x20'+_0x48c6e1[_0x433e1f(0x1f7)]['length']+'\x20warning(s)')),console[_0x433e1f(0x1e6)](formatValidationResult(_0x48c6e1,_0x1a4a6f,_0x59594b))):(console['log'](a28_0xab2b70[_0x433e1f(0x1ea)]('✖\x20'+_0x59594b+':\x20'+_0x48c6e1[_0x433e1f(0x20e)]['length']+_0x433e1f(0x20f))),console[_0x433e1f(0x1e6)](formatValidationResult(_0x48c6e1,_0x1a4a6f,_0x59594b)));}return console[_0x433e1f(0x1e6)](''),_0x3cb17e[_0x433e1f(0x1f4)]?(console[_0x433e1f(0x1e6)](a28_0xab2b70['red'](_0x433e1f(0x1e2)+_0x3cb17e[_0x433e1f(0x1e4)]+_0x433e1f(0x1ff)+_0x3cb17e[_0x433e1f(0x20a)]+_0x433e1f(0x1da))),_0x3cb17e[_0x433e1f(0x20b)]>0x0&&console[_0x433e1f(0x1e6)](a28_0xab2b70[_0x433e1f(0x1f0)](_0x3cb17e['warningCount']+_0x433e1f(0x1f8))),_0x3cb17e[_0x433e1f(0x1e7)]>0x0&&console[_0x433e1f(0x1e6)](a28_0xab2b70[_0x433e1f(0x1de)](_0x3cb17e[_0x433e1f(0x1e7)]+_0x433e1f(0x1dd))),0x1):(console[_0x433e1f(0x1e6)](a28_0xab2b70[_0x433e1f(0x1e3)](_0x433e1f(0x1e5)+_0x3cb17e[_0x433e1f(0x20a)]+_0x433e1f(0x1d8))),_0x3cb17e[_0x433e1f(0x20b)]>0x0&&console['log'](a28_0xab2b70[_0x433e1f(0x1f0)](_0x3cb17e[_0x433e1f(0x20b)]+'\x20warning(s)\x20found')),_0x3cb17e[_0x433e1f(0x1e7)]>0x0&&console['log'](a28_0xab2b70[_0x433e1f(0x1de)](_0x3cb17e[_0x433e1f(0x1e7)]+_0x433e1f(0x1dd))),0x0);}}
1
+ const a28_0x2636e1=a28_0x55c1;(function(_0x25517a,_0x17f295){const _0x635f38=a28_0x55c1,_0x5534fe=_0x25517a();while(!![]){try{const _0x1ed771=-parseInt(_0x635f38(0x15d))/0x1+parseInt(_0x635f38(0x146))/0x2*(parseInt(_0x635f38(0x157))/0x3)+-parseInt(_0x635f38(0x13e))/0x4*(-parseInt(_0x635f38(0x12e))/0x5)+-parseInt(_0x635f38(0x159))/0x6+-parseInt(_0x635f38(0x139))/0x7*(parseInt(_0x635f38(0x15a))/0x8)+parseInt(_0x635f38(0x133))/0x9+-parseInt(_0x635f38(0x156))/0xa;if(_0x1ed771===_0x17f295)break;else _0x5534fe['push'](_0x5534fe['shift']());}catch(_0x4551a6){_0x5534fe['push'](_0x5534fe['shift']());}}}(a28_0x25b5,0x8c55c));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';function a28_0x55c1(_0x4b0829,_0x109123){_0x4b0829=_0x4b0829-0x125;const _0x25b592=a28_0x25b5();let _0x55c196=_0x25b592[_0x4b0829];return _0x55c196;}import a28_0x53e9e7 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a28_0x25b5(){const _0x463200=['\x20(skipped:\x20','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','\x20error(s)','filter','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','errors','warnings','No\x20journey\x20YAML\x20files\x20found\x20in\x20','red','35jVmhNu','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','reason','Validation\x20failed:\x20','cwd','5086197qiOGeI','Error:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20segment\x20file(s)\x20skipped','warningCount','3507LxHuBj','yellow','length','\x20warning(s)\x20found','.yaml','277232uAgusn','description','journey','parentSegment','name','error','filePath','message','186246jsHRHP','dim','\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','skippedCount','file','journey:validate','relativePath','log','\x20warning(s)','helpText','verbose','Validate\x20journey\x20YAML\x20files','.yml','endsWith','\x20segment\x20file(s)\x20skipped)','green','4165930HAhwQi','15cKTkcM','type','1579884WFjmwm','544XsfQix','validCount','\x20journey(s)\x20with\x20errors,\x20','227117Ikacmm','no_parent','✔\x20All\x20','execute','valid'];a28_0x25b5=function(){return _0x463200;};return a28_0x25b5();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a28_0x2636e1(0x142)]=a28_0x2636e1(0x14b);[a28_0x2636e1(0x13f)]=a28_0x2636e1(0x151);async[a28_0x2636e1(0x160)](_0x3b1d58){const _0x4dc8aa=a28_0x2636e1,{options:_0x52b6e1,args:_0x316503}=_0x3b1d58,_0x16e5ed=_0x52b6e1,_0x2f63da=await resolveTarget({'arg':_0x316503[0x0],'contextParent':_0x52b6e1[_0x4dc8aa(0x141)],'cwd':process[_0x4dc8aa(0x132)]()});if(!isSuccessfulResolution(_0x2f63da))return _0x2f63da['errorCode']===_0x4dc8aa(0x15e)?(console[_0x4dc8aa(0x143)](a28_0x53e9e7[_0x4dc8aa(0x13a)](_0x4dc8aa(0x135))),console[_0x4dc8aa(0x143)](_0x4dc8aa(0x126)),console[_0x4dc8aa(0x143)](_0x4dc8aa(0x148)),console['error'](_0x4dc8aa(0x12f))):(console[_0x4dc8aa(0x143)](a28_0x53e9e7['red'](_0x4dc8aa(0x134)+_0x2f63da[_0x4dc8aa(0x145)]+'\x0a')),_0x2f63da[_0x4dc8aa(0x14f)]&&console['error'](a28_0x53e9e7['cyan'](_0x2f63da['helpText']))),0x1;const _0x12afd4=_0x2f63da['targetDir'],_0x21f463=_0x2f63da[_0x4dc8aa(0x158)]===_0x4dc8aa(0x14a)?_0x2f63da[_0x4dc8aa(0x144)]:undefined;if(!_0x21f463&&!existsSync(_0x12afd4))return console['error'](a28_0x53e9e7[_0x4dc8aa(0x12d)]('Error:\x20Directory\x20not\x20found:\x20'+_0x12afd4+'\x0a')),0x1;let _0x22cdde;if(_0x21f463){if(!_0x21f463['endsWith'](_0x4dc8aa(0x152))&&!_0x21f463[_0x4dc8aa(0x153)](_0x4dc8aa(0x13d)))return console['error'](a28_0x53e9e7[_0x4dc8aa(0x12d)](_0x4dc8aa(0x129)+_0x21f463+'\x0a')),0x1;_0x22cdde=[_0x21f463];}else _0x22cdde=findYamlFiles(_0x12afd4);if(_0x22cdde[_0x4dc8aa(0x13b)]===0x0)return console['error'](a28_0x53e9e7[_0x4dc8aa(0x12d)](_0x4dc8aa(0x136)+_0x12afd4+'\x0a')),0x1;const _0x14d864=validateYamlFiles(_0x22cdde,_0x12afd4,{'filterType':_0x4dc8aa(0x140)}),_0x1b5f41=calculateSummary(_0x14d864),_0x57000f=_0x14d864[_0x4dc8aa(0x128)](isValidationResult);if(_0x57000f['length']===0x0)return console[_0x4dc8aa(0x143)](a28_0x53e9e7[_0x4dc8aa(0x13a)](_0x4dc8aa(0x12c)+_0x12afd4+'\x0a')),_0x1b5f41[_0x4dc8aa(0x149)]>0x0&&console[_0x4dc8aa(0x143)](a28_0x53e9e7['dim']('('+_0x1b5f41['skippedCount']+_0x4dc8aa(0x154))),0x0;for(const _0x2b9576 of _0x14d864){if(!isValidationResult(_0x2b9576)){_0x16e5ed[_0x4dc8aa(0x150)]&&console[_0x4dc8aa(0x14d)](a28_0x53e9e7[_0x4dc8aa(0x147)]('-\x20'+_0x2b9576[_0x4dc8aa(0x14c)]+_0x4dc8aa(0x125)+_0x2b9576[_0x4dc8aa(0x130)]+')'));continue;}const {relativePath:_0x53fe7f,source:_0x20dcb1,result:_0xb973eb}=_0x2b9576;if(_0xb973eb[_0x4dc8aa(0x161)]&&_0xb973eb[_0x4dc8aa(0x12b)][_0x4dc8aa(0x13b)]===0x0)_0x16e5ed[_0x4dc8aa(0x150)]&&console[_0x4dc8aa(0x14d)](a28_0x53e9e7[_0x4dc8aa(0x155)]('✔\x20'+_0x53fe7f));else _0xb973eb['valid']?(console[_0x4dc8aa(0x14d)](a28_0x53e9e7[_0x4dc8aa(0x13a)]('⚠\x20'+_0x53fe7f+':\x20'+_0xb973eb[_0x4dc8aa(0x12b)][_0x4dc8aa(0x13b)]+_0x4dc8aa(0x14e))),console[_0x4dc8aa(0x14d)](formatValidationResult(_0xb973eb,_0x20dcb1,_0x53fe7f))):(console['log'](a28_0x53e9e7[_0x4dc8aa(0x12d)]('✖\x20'+_0x53fe7f+':\x20'+_0xb973eb[_0x4dc8aa(0x12a)][_0x4dc8aa(0x13b)]+_0x4dc8aa(0x127))),console[_0x4dc8aa(0x14d)](formatValidationResult(_0xb973eb,_0x20dcb1,_0x53fe7f)));}return console[_0x4dc8aa(0x14d)](''),_0x1b5f41['hasErrors']?(console[_0x4dc8aa(0x14d)](a28_0x53e9e7[_0x4dc8aa(0x12d)](_0x4dc8aa(0x131)+_0x1b5f41['invalidCount']+_0x4dc8aa(0x15c)+_0x1b5f41[_0x4dc8aa(0x15b)]+'\x20valid')),_0x1b5f41[_0x4dc8aa(0x138)]>0x0&&console[_0x4dc8aa(0x14d)](a28_0x53e9e7[_0x4dc8aa(0x13a)](_0x1b5f41[_0x4dc8aa(0x138)]+_0x4dc8aa(0x13c))),_0x1b5f41['skippedCount']>0x0&&console['log'](a28_0x53e9e7[_0x4dc8aa(0x147)](_0x1b5f41[_0x4dc8aa(0x149)]+_0x4dc8aa(0x137))),0x1):(console[_0x4dc8aa(0x14d)](a28_0x53e9e7[_0x4dc8aa(0x155)](_0x4dc8aa(0x15f)+_0x1b5f41[_0x4dc8aa(0x15b)]+'\x20journey(s)\x20valid')),_0x1b5f41[_0x4dc8aa(0x138)]>0x0&&console[_0x4dc8aa(0x14d)](a28_0x53e9e7[_0x4dc8aa(0x13a)](_0x1b5f41[_0x4dc8aa(0x138)]+_0x4dc8aa(0x13c))),_0x1b5f41[_0x4dc8aa(0x149)]>0x0&&console[_0x4dc8aa(0x14d)](a28_0x53e9e7[_0x4dc8aa(0x147)](_0x1b5f41[_0x4dc8aa(0x149)]+_0x4dc8aa(0x137))),0x0);}}