@treasuredata/tdx 2026.4.12 → 2026.4.14

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_0x1a5222=a25_0x33be;(function(_0x2c1290,_0x3fbb13){const _0x401566=a25_0x33be,_0x51ba5b=_0x2c1290();while(!![]){try{const _0x4e25d7=-parseInt(_0x401566(0x13b))/0x1*(parseInt(_0x401566(0x132))/0x2)+parseInt(_0x401566(0x147))/0x3+parseInt(_0x401566(0x153))/0x4*(parseInt(_0x401566(0x131))/0x5)+parseInt(_0x401566(0x139))/0x6+parseInt(_0x401566(0x138))/0x7*(parseInt(_0x401566(0x133))/0x8)+parseInt(_0x401566(0x134))/0x9+-parseInt(_0x401566(0x148))/0xa;if(_0x4e25d7===_0x3fbb13)break;else _0x51ba5b['push'](_0x51ba5b['shift']());}catch(_0x3e63b7){_0x51ba5b['push'](_0x51ba5b['shift']());}}}(a25_0x5ca5,0x41716));import{BaseCommand}from'./command.js';function a25_0x5ca5(){const _0x4fe902=['validCount','199437MLdGHs','1038306MtmQQF','errors','40785OvDFbT','red','description','\x20non-template\x20file(s)\x20skipped','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','.yml','engage:template:validate','error','\x20template(s)\x20with\x20errors,\x20','hasErrors','relativePath','valid','910479JBkapp','10900000VaXBHB','\x20warning(s)\x20found','dirname','skippedCount','.yaml','template','invalidCount','endsWith','✔\x20All\x20','cwd','\x20(skipped:\x20','9304hCWxxe','warningCount','yellow','log','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','warnings','\x20template(s)\x20valid','\x20non-template\x20file(s)\x20skipped)','length','dim','\x20warning(s)','green','\x20valid','1005vgZmQO','2IPicPW','40wnoYJV','2810826WYHHgU','Validate\x20template\x20YAML\x20files','name'];a25_0x5ca5=function(){return _0x4fe902;};return a25_0x5ca5();}import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';function a25_0x33be(_0x1d9437,_0x2d1608){_0x1d9437=_0x1d9437-0x127;const _0x5ca549=a25_0x5ca5();let _0x33be08=_0x5ca549[_0x1d9437];return _0x33be08;}import{existsSync}from'fs';import a25_0x506ad8 from'chalk';import a25_0x3b9e7d 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_0x1a5222(0x136)]=a25_0x1a5222(0x141);[a25_0x1a5222(0x13d)]=a25_0x1a5222(0x135);async['execute'](_0x437511){const _0x496021=a25_0x1a5222,{options:_0x5568ef,args:_0x4525f3}=_0x437511,_0x3571a7=_0x5568ef,_0x4e1bd0=_0x4525f3[0x0],_0xfbd574=_0x4e1bd0?a25_0x3b9e7d['resolve'](_0x4e1bd0):undefined,_0x5462f1=_0xfbd574?isYamlFile(_0xfbd574):![];let _0x1ff680,_0x585bc4;if(_0x5462f1&&_0xfbd574)_0x1ff680=a25_0x3b9e7d[_0x496021(0x14a)](_0xfbd574),_0x585bc4=_0xfbd574;else _0xfbd574?_0x1ff680=_0xfbd574:_0x1ff680=process[_0x496021(0x151)]();if(!_0x585bc4&&!existsSync(_0x1ff680))return console[_0x496021(0x142)](a25_0x506ad8['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x1ff680+'\x0a')),0x1;let _0x42a0a6;if(_0x585bc4){if(!_0x585bc4[_0x496021(0x14f)](_0x496021(0x140))&&!_0x585bc4[_0x496021(0x14f)](_0x496021(0x14c)))return console[_0x496021(0x142)](a25_0x506ad8['red'](_0x496021(0x13f)+_0x585bc4+'\x0a')),0x1;_0x42a0a6=[_0x585bc4];}else _0x42a0a6=findYamlFiles(_0x1ff680);if(_0x42a0a6[_0x496021(0x12c)]===0x0)return console[_0x496021(0x142)](a25_0x506ad8[_0x496021(0x13c)](_0x496021(0x128)+_0x1ff680+'\x0a')),0x1;const _0x4ec7f4=validateYamlFiles(_0x42a0a6,_0x1ff680,{'filterType':_0x496021(0x14d)}),_0x181cf5=calculateSummary(_0x4ec7f4),_0x39cb2c=_0x4ec7f4['filter'](isValidationResult);if(_0x39cb2c[_0x496021(0x12c)]===0x0)return console['error'](a25_0x506ad8[_0x496021(0x155)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x1ff680+'\x0a')),_0x181cf5['skippedCount']>0x0&&console[_0x496021(0x142)](a25_0x506ad8['dim']('('+_0x181cf5[_0x496021(0x14b)]+_0x496021(0x12b))),0x0;for(const _0x5aaa61 of _0x4ec7f4){if(!isValidationResult(_0x5aaa61)){_0x3571a7['verbose']&&console['log'](a25_0x506ad8[_0x496021(0x12d)]('-\x20'+_0x5aaa61[_0x496021(0x145)]+_0x496021(0x152)+_0x5aaa61['reason']+')'));continue;}const {relativePath:_0x186656,source:_0x58e49f,result:_0x468378}=_0x5aaa61;if(_0x468378[_0x496021(0x146)]&&_0x468378['warnings'][_0x496021(0x12c)]===0x0)_0x3571a7['verbose']&&console[_0x496021(0x127)](a25_0x506ad8['green']('✔\x20'+_0x186656));else _0x468378[_0x496021(0x146)]?(console[_0x496021(0x127)](a25_0x506ad8[_0x496021(0x155)]('⚠\x20'+_0x186656+':\x20'+_0x468378[_0x496021(0x129)]['length']+_0x496021(0x12e))),console['log'](formatValidationResult(_0x468378,_0x58e49f,_0x186656))):(console[_0x496021(0x127)](a25_0x506ad8['red']('✖\x20'+_0x186656+':\x20'+_0x468378[_0x496021(0x13a)][_0x496021(0x12c)]+'\x20error(s)')),console['log'](formatValidationResult(_0x468378,_0x58e49f,_0x186656)));}return console['log'](''),_0x181cf5[_0x496021(0x144)]?(console[_0x496021(0x127)](a25_0x506ad8[_0x496021(0x13c)]('Validation\x20failed:\x20'+_0x181cf5[_0x496021(0x14e)]+_0x496021(0x143)+_0x181cf5[_0x496021(0x137)]+_0x496021(0x130))),_0x181cf5[_0x496021(0x154)]>0x0&&console['log'](a25_0x506ad8[_0x496021(0x155)](_0x181cf5[_0x496021(0x154)]+_0x496021(0x149))),_0x181cf5['skippedCount']>0x0&&console[_0x496021(0x127)](a25_0x506ad8['dim'](_0x181cf5[_0x496021(0x14b)]+_0x496021(0x13e))),0x1):(console['log'](a25_0x506ad8[_0x496021(0x12f)](_0x496021(0x150)+_0x181cf5['validCount']+_0x496021(0x12a))),_0x181cf5[_0x496021(0x154)]>0x0&&console['log'](a25_0x506ad8[_0x496021(0x155)](_0x181cf5[_0x496021(0x154)]+_0x496021(0x149))),_0x181cf5[_0x496021(0x14b)]>0x0&&console['log'](a25_0x506ad8['dim'](_0x181cf5[_0x496021(0x14b)]+'\x20non-template\x20file(s)\x20skipped')),0x0);}}
1
+ function a25_0x15e6(){const _0x7460b9=['warnings','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','length','\x20valid','\x20(skipped:\x20','\x20non-template\x20file(s)\x20skipped','execute','7960644jUkexQ','\x20template(s)\x20valid','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','✔\x20All\x20','5788mDhHvU','endsWith','valid','2190FmjsZd','hasErrors','reason','5476968lbZyGT','\x20error(s)','No\x20template\x20YAML\x20files\x20found\x20in\x20','\x20warning(s)','error','4831140CsHFoO','skippedCount','\x20template(s)\x20with\x20errors,\x20','resolve','log','dirname','validCount','green','template','6jVXFqC','\x20non-template\x20file(s)\x20skipped)','relativePath','545450NsBDYT','filter','yellow','dim','.yaml','490966HGTgyT','\x20warning(s)\x20found','errors','cwd','Validate\x20template\x20YAML\x20files','1494008lbGbkz','description','136SFwXFa','.yml','Error:\x20Directory\x20not\x20found:\x20','invalidCount','verbose','name','warningCount','red'];a25_0x15e6=function(){return _0x7460b9;};return a25_0x15e6();}const a25_0x51aaba=a25_0x329e;(function(_0x3dc17e,_0x12e737){const _0x5d38d3=a25_0x329e,_0x5b50c5=_0x3dc17e();while(!![]){try{const _0x5b6ed3=parseInt(_0x5d38d3(0x1d2))/0x1+-parseInt(_0x5d38d3(0x1c8))/0x2*(-parseInt(_0x5d38d3(0x1c5))/0x3)+parseInt(_0x5d38d3(0x1e7))/0x4*(parseInt(_0x5d38d3(0x1ea))/0x5)+-parseInt(_0x5d38d3(0x1ed))/0x6+parseInt(_0x5d38d3(0x1cd))/0x7*(-parseInt(_0x5d38d3(0x1d4))/0x8)+parseInt(_0x5d38d3(0x1e3))/0x9+-parseInt(_0x5d38d3(0x1f2))/0xa;if(_0x5b6ed3===_0x12e737)break;else _0x5b50c5['push'](_0x5b50c5['shift']());}catch(_0x3866f3){_0x5b50c5['push'](_0x5b50c5['shift']());}}}(a25_0x15e6,0xecb00));import{BaseCommand}from'./command.js';function a25_0x329e(_0x20d01c,_0x38dc2a){_0x20d01c=_0x20d01c-0x1c2;const _0x15e604=a25_0x15e6();let _0x329e04=_0x15e604[_0x20d01c];return _0x329e04;}import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a25_0x7cc156 from'chalk';import a25_0x2176af 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_0x51aaba(0x1d9)]='engage:template:validate';[a25_0x51aaba(0x1d3)]=a25_0x51aaba(0x1d1);async[a25_0x51aaba(0x1e2)](_0x210a9a){const _0x4be7f9=a25_0x51aaba,{options:_0x38c530,args:_0x109b7b}=_0x210a9a,_0x49eeb4=_0x38c530,_0x362128=_0x109b7b[0x0],_0x378794=_0x362128?a25_0x2176af[_0x4be7f9(0x1f5)](_0x362128):undefined,_0x34845a=_0x378794?isYamlFile(_0x378794):![];let _0x31e9a1,_0x42c377;if(_0x34845a&&_0x378794)_0x31e9a1=a25_0x2176af[_0x4be7f9(0x1f7)](_0x378794),_0x42c377=_0x378794;else _0x378794?_0x31e9a1=_0x378794:_0x31e9a1=process[_0x4be7f9(0x1d0)]();if(!_0x42c377&&!existsSync(_0x31e9a1))return console[_0x4be7f9(0x1f1)](a25_0x7cc156[_0x4be7f9(0x1db)](_0x4be7f9(0x1d6)+_0x31e9a1+'\x0a')),0x1;let _0xb1aee6;if(_0x42c377){if(!_0x42c377[_0x4be7f9(0x1e8)](_0x4be7f9(0x1d5))&&!_0x42c377['endsWith'](_0x4be7f9(0x1cc)))return console[_0x4be7f9(0x1f1)](a25_0x7cc156[_0x4be7f9(0x1db)](_0x4be7f9(0x1e5)+_0x42c377+'\x0a')),0x1;_0xb1aee6=[_0x42c377];}else _0xb1aee6=findYamlFiles(_0x31e9a1);if(_0xb1aee6[_0x4be7f9(0x1de)]===0x0)return console[_0x4be7f9(0x1f1)](a25_0x7cc156[_0x4be7f9(0x1db)](_0x4be7f9(0x1dd)+_0x31e9a1+'\x0a')),0x1;const _0x36a4c7=validateYamlFiles(_0xb1aee6,_0x31e9a1,{'filterType':_0x4be7f9(0x1c4)}),_0x491faf=calculateSummary(_0x36a4c7),_0x4e1a99=_0x36a4c7[_0x4be7f9(0x1c9)](isValidationResult);if(_0x4e1a99['length']===0x0)return console[_0x4be7f9(0x1f1)](a25_0x7cc156['yellow'](_0x4be7f9(0x1ef)+_0x31e9a1+'\x0a')),_0x491faf[_0x4be7f9(0x1f3)]>0x0&&console['error'](a25_0x7cc156[_0x4be7f9(0x1cb)]('('+_0x491faf[_0x4be7f9(0x1f3)]+_0x4be7f9(0x1c6))),0x0;for(const _0x5a744c of _0x36a4c7){if(!isValidationResult(_0x5a744c)){_0x49eeb4[_0x4be7f9(0x1d8)]&&console['log'](a25_0x7cc156[_0x4be7f9(0x1cb)]('-\x20'+_0x5a744c[_0x4be7f9(0x1c7)]+_0x4be7f9(0x1e0)+_0x5a744c[_0x4be7f9(0x1ec)]+')'));continue;}const {relativePath:_0x46ed35,source:_0x3b3bcf,result:_0x386dbe}=_0x5a744c;if(_0x386dbe['valid']&&_0x386dbe[_0x4be7f9(0x1dc)]['length']===0x0)_0x49eeb4[_0x4be7f9(0x1d8)]&&console[_0x4be7f9(0x1f6)](a25_0x7cc156[_0x4be7f9(0x1c3)]('✔\x20'+_0x46ed35));else _0x386dbe[_0x4be7f9(0x1e9)]?(console[_0x4be7f9(0x1f6)](a25_0x7cc156[_0x4be7f9(0x1ca)]('⚠\x20'+_0x46ed35+':\x20'+_0x386dbe[_0x4be7f9(0x1dc)][_0x4be7f9(0x1de)]+_0x4be7f9(0x1f0))),console[_0x4be7f9(0x1f6)](formatValidationResult(_0x386dbe,_0x3b3bcf,_0x46ed35))):(console[_0x4be7f9(0x1f6)](a25_0x7cc156[_0x4be7f9(0x1db)]('✖\x20'+_0x46ed35+':\x20'+_0x386dbe[_0x4be7f9(0x1cf)][_0x4be7f9(0x1de)]+_0x4be7f9(0x1ee))),console['log'](formatValidationResult(_0x386dbe,_0x3b3bcf,_0x46ed35)));}return console[_0x4be7f9(0x1f6)](''),_0x491faf[_0x4be7f9(0x1eb)]?(console[_0x4be7f9(0x1f6)](a25_0x7cc156['red']('Validation\x20failed:\x20'+_0x491faf[_0x4be7f9(0x1d7)]+_0x4be7f9(0x1f4)+_0x491faf[_0x4be7f9(0x1c2)]+_0x4be7f9(0x1df))),_0x491faf[_0x4be7f9(0x1da)]>0x0&&console[_0x4be7f9(0x1f6)](a25_0x7cc156[_0x4be7f9(0x1ca)](_0x491faf[_0x4be7f9(0x1da)]+_0x4be7f9(0x1ce))),_0x491faf[_0x4be7f9(0x1f3)]>0x0&&console[_0x4be7f9(0x1f6)](a25_0x7cc156[_0x4be7f9(0x1cb)](_0x491faf[_0x4be7f9(0x1f3)]+_0x4be7f9(0x1e1))),0x1):(console[_0x4be7f9(0x1f6)](a25_0x7cc156[_0x4be7f9(0x1c3)](_0x4be7f9(0x1e6)+_0x491faf[_0x4be7f9(0x1c2)]+_0x4be7f9(0x1e4))),_0x491faf[_0x4be7f9(0x1da)]>0x0&&console[_0x4be7f9(0x1f6)](a25_0x7cc156[_0x4be7f9(0x1ca)](_0x491faf['warningCount']+_0x4be7f9(0x1ce))),_0x491faf[_0x4be7f9(0x1f3)]>0x0&&console[_0x4be7f9(0x1f6)](a25_0x7cc156[_0x4be7f9(0x1cb)](_0x491faf[_0x4be7f9(0x1f3)]+_0x4be7f9(0x1e1))),0x0);}}
@@ -1 +1 @@
1
- const a26_0x15ed47=a26_0x441f;(function(_0x2f939d,_0x259fca){const _0x1f30ed=a26_0x441f,_0x15b813=_0x2f939d();while(!![]){try{const _0x2780c0=-parseInt(_0x1f30ed(0x162))/0x1+parseInt(_0x1f30ed(0x17a))/0x2*(-parseInt(_0x1f30ed(0x161))/0x3)+parseInt(_0x1f30ed(0x175))/0x4*(-parseInt(_0x1f30ed(0x195))/0x5)+parseInt(_0x1f30ed(0x1ad))/0x6*(-parseInt(_0x1f30ed(0x19d))/0x7)+-parseInt(_0x1f30ed(0x196))/0x8+-parseInt(_0x1f30ed(0x17e))/0x9+parseInt(_0x1f30ed(0x18b))/0xa;if(_0x2780c0===_0x259fca)break;else _0x15b813['push'](_0x15b813['shift']());}catch(_0x20a637){_0x15b813['push'](_0x15b813['shift']());}}}(a26_0x3956,0xdd648));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';function a26_0x3956(){const _0xeea68=['Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','job_id','url','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','created_at','substring','success','jobType','268572ieHaLP','debug','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','INVALID_ARGUMENT','now','2hNJvrS','information_schema','job:kill','file','10171683eFjJQR','validate','\x20row','yes','Query:\x20','data','user_name','red','error','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','getTime','Submitting\x20job...','log','80603530dcDCXY','length','✔\x20Retrieved\x20','trino','just\x20now','site','h\x20ago','Getting\x20job\x20results...','verbose','dim','30JtITxo','6344344laVAoW','result','kill','List\x20jobs','...','database','Limit:\x20','1570506MbAKBv','green','jobs','job:submit','submit','\x20\x20Job\x20ID:\x20','start_at','push','name','join','args','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','floor','end_at','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','48VYBFHf','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','Submitting\x20kill\x20request...','round','mo\x20ago','Listing\x20jobs...','query','✔\x20Job\x20submitted','description','Getting\x20job\x20details...','Status\x20filter:\x20','map','4678644JELemv','1473029QlNYCh','Job\x20type:\x20','Submit\x20a\x20job','execute','Get\x20job\x20results','job:show','status','✔\x20Found\x20','type','priority','abs'];a26_0x3956=function(){return _0xeea68;};return a26_0x3956();}import{getJobUrl}from'../sdk/client/endpoints.js';function a26_0x441f(_0x580599,_0x388d46){_0x580599=_0x580599-0x158;const _0x395694=a26_0x3956();let _0x441f4b=_0x395694[_0x580599];return _0x441f4b;}import{hyperlink}from'../sdk/util/formatters.js';import a26_0x139651 from'chalk';function formatDuration(_0x41dffc){const _0xb3a063=a26_0x441f;if(_0x41dffc<0x3c)return _0x41dffc+'s';if(_0x41dffc<0xe10)return Math[_0xb3a063(0x1aa)](_0x41dffc/0x3c)+'m\x20'+_0x41dffc%0x3c+'s';const _0x3d04e4=Math[_0xb3a063(0x1aa)](_0x41dffc/0xe10),_0x3eb6ec=Math[_0xb3a063(0x1aa)](_0x41dffc%0xe10/0x3c);return _0x3eb6ec>0x0?_0x3d04e4+'h\x20'+_0x3eb6ec+'m':_0x3d04e4+'h';}function formatRelativeTime(_0x4598e1){const _0x112b33=a26_0x441f,_0x5f310e=Date[_0x112b33(0x179)]()-_0x4598e1[_0x112b33(0x188)](),_0x10a6ff=Math[_0x112b33(0x1aa)](Math[_0x112b33(0x16c)](_0x5f310e)/0x3e8);if(_0x10a6ff<0x3c)return _0x112b33(0x18f);const _0x36f629=Math[_0x112b33(0x1aa)](_0x10a6ff/0x3c);if(_0x36f629<0x3c)return _0x36f629+'m\x20ago';const _0x50a0cd=Math[_0x112b33(0x1aa)](_0x36f629/0x3c);if(_0x50a0cd<0x18)return _0x50a0cd+_0x112b33(0x191);const _0x2df986=Math[_0x112b33(0x1aa)](_0x50a0cd/0x18);if(_0x2df986<0x1e)return _0x2df986+'d\x20ago';return Math[_0x112b33(0x1aa)](_0x2df986/0x1e)+_0x112b33(0x159);}export class JobListCommand extends BaseCommand{[a26_0x15ed47(0x1a5)]=a26_0x15ed47(0x19f);['description']=a26_0x15ed47(0x199);async['execute'](_0xd5047d){const _0x4ba03e=a26_0x15ed47,{options:_0x3e78c3,tdx:_0x163a4f}=_0xd5047d,_0x39f0f8=resolveLimit(_0x3e78c3['limit'],DEFAULT_DISPLAY_LIMIT),_0x310cf3=_0x3e78c3[_0x4ba03e(0x168)];_0x3e78c3['verbose']&&(console[_0x4ba03e(0x186)](_0x4ba03e(0x19c)+_0x39f0f8+'\x20jobs'),_0x310cf3&&console['error'](_0x4ba03e(0x15f)+_0x310cf3));const _0x5615dd=await withSpinner(_0x4ba03e(0x15a),()=>_0x163a4f[_0x4ba03e(0x19f)]['list']({'from':0x0,'to':_0x39f0f8-0x1,'status':_0x310cf3}),{'verbose':_0x3e78c3[_0x4ba03e(0x193)]}),_0x2777fc=_0x5615dd[_0x4ba03e(0x183)];console[_0x4ba03e(0x186)](_0x4ba03e(0x169)+_0x2777fc[_0x4ba03e(0x18c)]+'\x20job'+(_0x2777fc[_0x4ba03e(0x18c)]!==0x1?'s':''));const _0x1f09d1=_0x3e78c3[_0x4ba03e(0x190)];if(isStructuredFormat(_0x3e78c3)){const _0x10a81b=_0x2777fc[_0x4ba03e(0x160)](_0x3fb419=>{const _0x93da33=_0x4ba03e;let _0x5dc4b4;if(_0x3fb419[_0x93da33(0x1a3)]&&_0x3fb419[_0x93da33(0x1ab)]){const _0x2a4b9a=new Date(_0x3fb419[_0x93da33(0x1a3)])['getTime'](),_0x12fbea=new Date(_0x3fb419[_0x93da33(0x1ab)])[_0x93da33(0x188)]();_0x5dc4b4=Math[_0x93da33(0x158)]((_0x12fbea-_0x2a4b9a)/0x3e8);}return{'job_id':_0x3fb419[_0x93da33(0x16e)],'type':_0x3fb419['type']==='presto'?_0x93da33(0x18e):_0x3fb419[_0x93da33(0x16a)],'status':_0x3fb419['status'],'user_name':_0x3fb419[_0x93da33(0x184)],'duration_sec':_0x5dc4b4,'created_at':_0x3fb419['created_at'],'started_at':_0x3fb419[_0x93da33(0x1a3)],'end_at':_0x3fb419[_0x93da33(0x1ab)]};});await handleSDKOutput(_0x10a81b,_0x3e78c3);}else for(const _0x2e438c of _0x2777fc){const _0x34eddc=_0x2e438c[_0x4ba03e(0x168)]===_0x4ba03e(0x173)?a26_0x139651[_0x4ba03e(0x19e)]:_0x2e438c[_0x4ba03e(0x168)]===_0x4ba03e(0x186)?a26_0x139651[_0x4ba03e(0x185)]:a26_0x139651[_0x4ba03e(0x194)],_0x48f6eb=_0x34eddc(_0x2e438c[_0x4ba03e(0x168)]),_0x4b8f3e=getJobUrl(_0x1f09d1,_0x2e438c['job_id']),_0x4fe026=hyperlink(_0x2e438c[_0x4ba03e(0x16e)],_0x4b8f3e),_0x3b1185=a26_0x139651[_0x4ba03e(0x194)](_0x2e438c[_0x4ba03e(0x16a)]==='presto'?_0x4ba03e(0x18e):_0x2e438c['type']),_0x402f89=[];if(_0x2e438c[_0x4ba03e(0x1a3)]&&_0x2e438c[_0x4ba03e(0x1ab)]){const _0x2dbe98=Math[_0x4ba03e(0x158)]((new Date(_0x2e438c[_0x4ba03e(0x1ab)])['getTime']()-new Date(_0x2e438c[_0x4ba03e(0x1a3)])['getTime']())/0x3e8);_0x402f89[_0x4ba03e(0x1a4)](formatDuration(_0x2dbe98));}if(_0x2e438c[_0x4ba03e(0x1ab)])_0x402f89[_0x4ba03e(0x1a4)](formatRelativeTime(new Date(_0x2e438c['end_at'])));else _0x2e438c[_0x4ba03e(0x1a3)]&&_0x402f89[_0x4ba03e(0x1a4)](formatRelativeTime(new Date(_0x2e438c[_0x4ba03e(0x1a3)])));const _0x5334bc=_0x402f89[_0x4ba03e(0x18c)]>0x0?a26_0x139651[_0x4ba03e(0x194)]('\x20'+_0x402f89[_0x4ba03e(0x1a6)](',\x20')):'';console[_0x4ba03e(0x18a)]('⚡\x20'+_0x4fe026+'\x20'+_0x3b1185+'\x20'+_0x48f6eb+_0x5334bc);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x15ed47(0x1a5)]=a26_0x15ed47(0x167);[a26_0x15ed47(0x15d)]='Show\x20job\x20details';['validate'](_0x2d96b3){const _0x4846aa=a26_0x15ed47,_0x206755=_0x2d96b3[_0x4846aa(0x1a7)][0x0];if(!_0x206755)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>';return undefined;}async[a26_0x15ed47(0x165)](_0x35101b){const _0xd8d800=a26_0x15ed47,{options:_0x219d09,args:_0x3ca8c6,tdx:_0x2b6f05}=_0x35101b,_0x293252=_0x3ca8c6[0x0],_0x56be8b=await withSpinner(_0xd8d800(0x15e),()=>_0x2b6f05[_0xd8d800(0x19f)]['show'](_0x293252),{'verbose':_0x219d09[_0xd8d800(0x193)]}),_0xd02e01=_0x56be8b[_0xd8d800(0x183)];let _0x4a1dab;if(_0xd02e01[_0xd8d800(0x1a3)]&&_0xd02e01[_0xd8d800(0x1ab)]){const _0x1d7a8d=new Date(_0xd02e01['start_at'])['getTime'](),_0x3d35cf=new Date(_0xd02e01[_0xd8d800(0x1ab)])['getTime']();_0x4a1dab=Math[_0xd8d800(0x158)]((_0x3d35cf-_0x1d7a8d)/0x3e8);}const _0x1db267={'job_id':_0xd02e01['job_id'],'type':_0xd02e01[_0xd8d800(0x16a)],'status':_0xd02e01[_0xd8d800(0x168)],..._0xd02e01[_0xd8d800(0x184)]&&{'user_name':_0xd02e01[_0xd8d800(0x184)]},..._0x4a1dab!==undefined&&{'duration_sec':_0x4a1dab},..._0xd02e01[_0xd8d800(0x171)]&&{'created_at':_0xd02e01['created_at']},..._0xd02e01['start_at']&&{'started_at':_0xd02e01[_0xd8d800(0x1a3)]},..._0xd02e01[_0xd8d800(0x1ab)]&&{'end_at':_0xd02e01[_0xd8d800(0x1ab)]},..._0xd02e01[_0xd8d800(0x19b)]&&{'database':_0xd02e01[_0xd8d800(0x19b)]},..._0xd02e01[_0xd8d800(0x16b)]!==undefined&&{'priority':_0xd02e01[_0xd8d800(0x16b)]},..._0xd02e01[_0xd8d800(0x16f)]&&{'url':_0xd02e01[_0xd8d800(0x16f)]},..._0xd02e01[_0xd8d800(0x15b)]&&{'query':_0xd02e01['query']},..._0xd02e01[_0xd8d800(0x176)]&&{'debug':_0xd02e01['debug']}};return await handleSingleObjectOutput(_0x1db267,_0x219d09),0x0;}}export class JobKillCommand extends BaseCommand{['name']=a26_0x15ed47(0x17c);['description']='Kill\x20a\x20job';['validate'](_0x5882cd){const _0x1fd88b=a26_0x15ed47,_0x33ae56=_0x5882cd[_0x1fd88b(0x1a7)][0x0];if(!_0x33ae56)return _0x1fd88b(0x170);return undefined;}async['execute'](_0xd781b){const _0x3b8dfb=a26_0x15ed47,{options:_0x227777,args:_0x4408f3,tdx:_0x41a841}=_0xd781b,_0x5790db=_0x4408f3[0x0];if(!_0x227777[_0x3b8dfb(0x181)]){const _0x2ed42c=await confirm(_0x3b8dfb(0x177)+_0x5790db+'?');if(!_0x2ed42c)return console[_0x3b8dfb(0x186)]('Cancelled'),0x0;}return await withSpinner(_0x3b8dfb(0x1af),()=>_0x41a841['jobs'][_0x3b8dfb(0x198)](_0x5790db),{'verbose':_0x227777['verbose']}),console[_0x3b8dfb(0x186)]('✔\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0x5790db),console[_0x3b8dfb(0x186)](_0x3b8dfb(0x1a8)+_0x5790db+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x15ed47(0x1a5)]=a26_0x15ed47(0x1a0);[a26_0x15ed47(0x15d)]=a26_0x15ed47(0x164);async['execute'](_0x1ecccb){const _0x16e6f2=a26_0x15ed47,{options:_0x83cd82,args:_0x52bf41,tdx:_0x480fec}=_0x1ecccb,_0x3f5f9b=_0x83cd82[_0x16e6f2(0x174)]||_0x16e6f2(0x18e),_0x470d9d=_0x83cd82[_0x16e6f2(0x17d)],_0x225e2a=_0x83cd82[_0x16e6f2(0x19b)]||_0x16e6f2(0x17b),_0x21e05b=_0x83cd82[_0x16e6f2(0x197)];if(_0x3f5f9b!=='trino'&&_0x3f5f9b!=='hive')throw new SDKError(ErrorCode[_0x16e6f2(0x178)],_0x16e6f2(0x187));let _0x7b0daa;if(_0x470d9d){if(_0x52bf41[0x0])throw new SDKError(ErrorCode[_0x16e6f2(0x178)],_0x16e6f2(0x1ae));const _0x391f7b=readSqlStatementsFromFile(_0x470d9d);if(_0x391f7b[_0x16e6f2(0x18c)]===0x0)throw new SDKError(ErrorCode[_0x16e6f2(0x178)],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x391f7b[_0x16e6f2(0x18c)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x16e6f2(0x1a9));_0x7b0daa=_0x391f7b[0x0];}else{if(!_0x52bf41[0x0])throw new SDKError(ErrorCode[_0x16e6f2(0x178)],_0x16e6f2(0x16d));_0x7b0daa=_0x52bf41[0x0];}_0x83cd82[_0x16e6f2(0x193)]&&(console[_0x16e6f2(0x186)](_0x16e6f2(0x163)+_0x3f5f9b),console['error']('Database:\x20'+_0x225e2a),console[_0x16e6f2(0x186)](_0x16e6f2(0x182)+_0x7b0daa[_0x16e6f2(0x172)](0x0,0x64)+(_0x7b0daa[_0x16e6f2(0x18c)]>0x64?_0x16e6f2(0x19a):'')));const _0x26c54c=await withSpinner(_0x16e6f2(0x189),()=>_0x480fec[_0x16e6f2(0x19f)][_0x16e6f2(0x1a1)](_0x225e2a,_0x7b0daa,_0x3f5f9b,_0x21e05b),{'verbose':_0x83cd82[_0x16e6f2(0x193)]}),_0x44a5a4=_0x26c54c[_0x16e6f2(0x183)];return console[_0x16e6f2(0x186)](_0x16e6f2(0x15c)),console[_0x16e6f2(0x186)](_0x16e6f2(0x1a2)+_0x44a5a4[_0x16e6f2(0x16e)]),await handleSDKOutput([_0x44a5a4],_0x83cd82),0x0;}}export class JobResultCommand extends BaseCommand{['name']='job:result';[a26_0x15ed47(0x15d)]=a26_0x15ed47(0x166);[a26_0x15ed47(0x17f)](_0x1d1d97){const _0x287bcb=a26_0x15ed47,_0x2c65f8=_0x1d1d97[_0x287bcb(0x1a7)][0x0];if(!_0x2c65f8)return _0x287bcb(0x1ac);return undefined;}async[a26_0x15ed47(0x165)](_0x448982){const _0x185fd2=a26_0x15ed47,{options:_0x2d61b6,args:_0x5c3d98,tdx:_0x41a907}=_0x448982,_0x552ce2=_0x5c3d98[0x0],_0x1a9224=await withSpinner(_0x185fd2(0x192),()=>_0x41a907[_0x185fd2(0x19f)]['result'](_0x552ce2),{'verbose':_0x2d61b6[_0x185fd2(0x193)]}),_0x17702a=_0x1a9224[_0x185fd2(0x183)];return console[_0x185fd2(0x186)](_0x185fd2(0x18d)+_0x17702a[_0x185fd2(0x18c)]+_0x185fd2(0x180)+(_0x17702a[_0x185fd2(0x18c)]!==0x1?'s':'')),await handleSDKOutput(_0x17702a,_0x2d61b6),0x0;}}
1
+ const a26_0x3d6011=a26_0x451f;(function(_0x1e99e8,_0x337984){const _0x37b6e3=a26_0x451f,_0x1d5e6b=_0x1e99e8();while(!![]){try{const _0x996d4=-parseInt(_0x37b6e3(0x1d0))/0x1*(-parseInt(_0x37b6e3(0x1a2))/0x2)+-parseInt(_0x37b6e3(0x1dc))/0x3*(parseInt(_0x37b6e3(0x1d3))/0x4)+parseInt(_0x37b6e3(0x1bb))/0x5*(-parseInt(_0x37b6e3(0x199))/0x6)+parseInt(_0x37b6e3(0x1e1))/0x7*(parseInt(_0x37b6e3(0x19f))/0x8)+parseInt(_0x37b6e3(0x1d9))/0x9+parseInt(_0x37b6e3(0x18b))/0xa*(parseInt(_0x37b6e3(0x1b6))/0xb)+-parseInt(_0x37b6e3(0x1cf))/0xc;if(_0x996d4===_0x337984)break;else _0x1d5e6b['push'](_0x1d5e6b['shift']());}catch(_0x24b188){_0x1d5e6b['push'](_0x1d5e6b['shift']());}}}(a26_0x28d9,0xaf13d));function a26_0x28d9(){const _0x553ae8=['\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','12846987NnNsWE','job:submit','file','38715PmkDER','Submitting\x20job...','hive','result','description','6814094pylnEg','✔\x20Job\x20submitted','Get\x20job\x20results','yes','Submitting\x20kill\x20request...','20eJLryq','database','red','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','dim','trino','error','presto','d\x20ago','Cancelled','round','execute','Status\x20filter:\x20','...','1558074LSZQJk','validate','Getting\x20job\x20results...','green','✔\x20Retrieved\x20','join','8uMxvFR','floor','\x20jobs','1075034jpxDJN','limit','created_at','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','Database:\x20','length','status','push','log','Getting\x20job\x20details...','debug','Listing\x20jobs...','type','job:result','map','kill','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','user_name','verbose','success','3827351uiZtNw','No\x20SQL\x20statements\x20found\x20in\x20file','show','\x20job','now','15okEAHP','url','list','name','site','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','query','Job\x20type:\x20','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','INVALID_ARGUMENT','args','start_at','getTime','Submit\x20a\x20job','jobs','end_at','Limit:\x20','Kill\x20a\x20job','abs','data','8777820YvLfjH','1YCBFOx','job_id','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','436WjtibU','priority','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','submit','Query:\x20'];a26_0x28d9=function(){return _0x553ae8;};return a26_0x28d9();}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_0x3d985a from'chalk';function formatDuration(_0xe20bbd){const _0x3dcaa8=a26_0x451f;if(_0xe20bbd<0x3c)return _0xe20bbd+'s';if(_0xe20bbd<0xe10)return Math[_0x3dcaa8(0x1a0)](_0xe20bbd/0x3c)+'m\x20'+_0xe20bbd%0x3c+'s';const _0x4babde=Math[_0x3dcaa8(0x1a0)](_0xe20bbd/0xe10),_0x27d816=Math[_0x3dcaa8(0x1a0)](_0xe20bbd%0xe10/0x3c);return _0x27d816>0x0?_0x4babde+'h\x20'+_0x27d816+'m':_0x4babde+'h';}function formatRelativeTime(_0x482962){const _0x5e833a=a26_0x451f,_0x55de50=Date[_0x5e833a(0x1ba)]()-_0x482962[_0x5e833a(0x1c7)](),_0xc0d3d8=Math['floor'](Math[_0x5e833a(0x1cd)](_0x55de50)/0x3e8);if(_0xc0d3d8<0x3c)return'just\x20now';const _0x2087bc=Math[_0x5e833a(0x1a0)](_0xc0d3d8/0x3c);if(_0x2087bc<0x3c)return _0x2087bc+'m\x20ago';const _0x3e2cbe=Math['floor'](_0x2087bc/0x3c);if(_0x3e2cbe<0x18)return _0x3e2cbe+'h\x20ago';const _0x181116=Math[_0x5e833a(0x1a0)](_0x3e2cbe/0x18);if(_0x181116<0x1e)return _0x181116+_0x5e833a(0x193);return Math[_0x5e833a(0x1a0)](_0x181116/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{[a26_0x3d6011(0x1be)]=a26_0x3d6011(0x1c9);[a26_0x3d6011(0x1e0)]='List\x20jobs';async[a26_0x3d6011(0x196)](_0x352ea7){const _0x1c91b1=a26_0x3d6011,{options:_0xe51d0a,tdx:_0x147b48}=_0x352ea7,_0x1c8313=resolveLimit(_0xe51d0a[_0x1c91b1(0x1a3)],DEFAULT_DISPLAY_LIMIT),_0x2db7f3=_0xe51d0a[_0x1c91b1(0x1a8)];_0xe51d0a[_0x1c91b1(0x1b4)]&&(console[_0x1c91b1(0x191)](_0x1c91b1(0x1cb)+_0x1c8313+_0x1c91b1(0x1a1)),_0x2db7f3&&console['error'](_0x1c91b1(0x197)+_0x2db7f3));const _0x5aabf7=await withSpinner(_0x1c91b1(0x1ad),()=>_0x147b48['jobs'][_0x1c91b1(0x1bd)]({'from':0x0,'to':_0x1c8313-0x1,'status':_0x2db7f3}),{'verbose':_0xe51d0a[_0x1c91b1(0x1b4)]}),_0x40fe7e=_0x5aabf7[_0x1c91b1(0x1ce)];console[_0x1c91b1(0x191)]('✔\x20Found\x20'+_0x40fe7e[_0x1c91b1(0x1a7)]+_0x1c91b1(0x1b9)+(_0x40fe7e[_0x1c91b1(0x1a7)]!==0x1?'s':''));const _0x384106=_0xe51d0a[_0x1c91b1(0x1bf)];if(isStructuredFormat(_0xe51d0a)){const _0x30c730=_0x40fe7e[_0x1c91b1(0x1b0)](_0x5d10b0=>{const _0x3fe2b1=_0x1c91b1;let _0x24c151;if(_0x5d10b0[_0x3fe2b1(0x1c6)]&&_0x5d10b0[_0x3fe2b1(0x1ca)]){const _0x2bf440=new Date(_0x5d10b0[_0x3fe2b1(0x1c6)])[_0x3fe2b1(0x1c7)](),_0x5603b0=new Date(_0x5d10b0[_0x3fe2b1(0x1ca)])['getTime']();_0x24c151=Math[_0x3fe2b1(0x195)]((_0x5603b0-_0x2bf440)/0x3e8);}return{'job_id':_0x5d10b0[_0x3fe2b1(0x1d1)],'type':_0x5d10b0[_0x3fe2b1(0x1ae)]===_0x3fe2b1(0x192)?_0x3fe2b1(0x190):_0x5d10b0[_0x3fe2b1(0x1ae)],'status':_0x5d10b0['status'],'user_name':_0x5d10b0[_0x3fe2b1(0x1b3)],'duration_sec':_0x24c151,'created_at':_0x5d10b0[_0x3fe2b1(0x1a4)],'started_at':_0x5d10b0['start_at'],'end_at':_0x5d10b0[_0x3fe2b1(0x1ca)]};});await handleSDKOutput(_0x30c730,_0xe51d0a);}else for(const _0x405045 of _0x40fe7e){const _0x5e5026=_0x405045[_0x1c91b1(0x1a8)]===_0x1c91b1(0x1b5)?a26_0x3d985a[_0x1c91b1(0x19c)]:_0x405045[_0x1c91b1(0x1a8)]===_0x1c91b1(0x191)?a26_0x3d985a[_0x1c91b1(0x18d)]:a26_0x3d985a[_0x1c91b1(0x18f)],_0x4cb222=_0x5e5026(_0x405045['status']),_0x14dd93=getJobUrl(_0x384106,_0x405045[_0x1c91b1(0x1d1)]),_0x48e0b6=hyperlink(_0x405045[_0x1c91b1(0x1d1)],_0x14dd93),_0x5d91b3=a26_0x3d985a[_0x1c91b1(0x18f)](_0x405045[_0x1c91b1(0x1ae)]===_0x1c91b1(0x192)?'trino':_0x405045[_0x1c91b1(0x1ae)]),_0x45d680=[];if(_0x405045[_0x1c91b1(0x1c6)]&&_0x405045[_0x1c91b1(0x1ca)]){const _0xee6f33=Math[_0x1c91b1(0x195)]((new Date(_0x405045[_0x1c91b1(0x1ca)])['getTime']()-new Date(_0x405045[_0x1c91b1(0x1c6)])['getTime']())/0x3e8);_0x45d680['push'](formatDuration(_0xee6f33));}if(_0x405045[_0x1c91b1(0x1ca)])_0x45d680['push'](formatRelativeTime(new Date(_0x405045[_0x1c91b1(0x1ca)])));else _0x405045[_0x1c91b1(0x1c6)]&&_0x45d680[_0x1c91b1(0x1a9)](formatRelativeTime(new Date(_0x405045[_0x1c91b1(0x1c6)])));const _0x9aa916=_0x45d680[_0x1c91b1(0x1a7)]>0x0?a26_0x3d985a[_0x1c91b1(0x18f)]('\x20'+_0x45d680[_0x1c91b1(0x19e)](',\x20')):'';console[_0x1c91b1(0x1aa)]('⚡\x20'+_0x48e0b6+'\x20'+_0x5d91b3+'\x20'+_0x4cb222+_0x9aa916);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x3d6011(0x1be)]='job:show';[a26_0x3d6011(0x1e0)]='Show\x20job\x20details';[a26_0x3d6011(0x19a)](_0x3e4a96){const _0x3b96e6=a26_0x3d6011,_0x423502=_0x3e4a96[_0x3b96e6(0x1c5)][0x0];if(!_0x423502)return _0x3b96e6(0x1b2);return undefined;}async[a26_0x3d6011(0x196)](_0x39bb43){const _0x58b661=a26_0x3d6011,{options:_0x5860a4,args:_0x3c77c8,tdx:_0x3bf2f3}=_0x39bb43,_0x376dc7=_0x3c77c8[0x0],_0xc8a9cf=await withSpinner(_0x58b661(0x1ab),()=>_0x3bf2f3[_0x58b661(0x1c9)][_0x58b661(0x1b8)](_0x376dc7),{'verbose':_0x5860a4[_0x58b661(0x1b4)]}),_0x581076=_0xc8a9cf['data'];let _0x29fc16;if(_0x581076[_0x58b661(0x1c6)]&&_0x581076['end_at']){const _0x4b190d=new Date(_0x581076[_0x58b661(0x1c6)])[_0x58b661(0x1c7)](),_0x4bd7c6=new Date(_0x581076[_0x58b661(0x1ca)])['getTime']();_0x29fc16=Math[_0x58b661(0x195)]((_0x4bd7c6-_0x4b190d)/0x3e8);}const _0x48bca0={'job_id':_0x581076['job_id'],'type':_0x581076['type'],'status':_0x581076[_0x58b661(0x1a8)],..._0x581076[_0x58b661(0x1b3)]&&{'user_name':_0x581076[_0x58b661(0x1b3)]},..._0x29fc16!==undefined&&{'duration_sec':_0x29fc16},..._0x581076[_0x58b661(0x1a4)]&&{'created_at':_0x581076['created_at']},..._0x581076[_0x58b661(0x1c6)]&&{'started_at':_0x581076['start_at']},..._0x581076['end_at']&&{'end_at':_0x581076[_0x58b661(0x1ca)]},..._0x581076[_0x58b661(0x18c)]&&{'database':_0x581076[_0x58b661(0x18c)]},..._0x581076[_0x58b661(0x1d4)]!==undefined&&{'priority':_0x581076[_0x58b661(0x1d4)]},..._0x581076[_0x58b661(0x1bc)]&&{'url':_0x581076[_0x58b661(0x1bc)]},..._0x581076['query']&&{'query':_0x581076[_0x58b661(0x1c1)]},..._0x581076[_0x58b661(0x1ac)]&&{'debug':_0x581076[_0x58b661(0x1ac)]}};return await handleSingleObjectOutput(_0x48bca0,_0x5860a4),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x3d6011(0x1be)]='job:kill';[a26_0x3d6011(0x1e0)]=a26_0x3d6011(0x1cc);[a26_0x3d6011(0x19a)](_0x4ee3ba){const _0x17193c=a26_0x3d6011,_0x21fc8c=_0x4ee3ba[_0x17193c(0x1c5)][0x0];if(!_0x21fc8c)return _0x17193c(0x1c0);return undefined;}async[a26_0x3d6011(0x196)](_0x12ea32){const _0x421bb9=a26_0x3d6011,{options:_0x1dcf6d,args:_0x4e32da,tdx:_0x4bf95d}=_0x12ea32,_0x41aa50=_0x4e32da[0x0];if(!_0x1dcf6d[_0x421bb9(0x1e4)]){const _0x1acbd0=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20'+_0x41aa50+'?');if(!_0x1acbd0)return console[_0x421bb9(0x191)](_0x421bb9(0x194)),0x0;}return await withSpinner(_0x421bb9(0x1e5),()=>_0x4bf95d[_0x421bb9(0x1c9)][_0x421bb9(0x1b1)](_0x41aa50),{'verbose':_0x1dcf6d['verbose']}),console[_0x421bb9(0x191)](_0x421bb9(0x1a5)+_0x41aa50),console[_0x421bb9(0x191)](_0x421bb9(0x1d8)+_0x41aa50+'\x27\x20to\x20verify\x20the\x20job\x20status'),0x0;}}function a26_0x451f(_0x53e3a3,_0x39f9c1){_0x53e3a3=_0x53e3a3-0x18b;const _0x28d943=a26_0x28d9();let _0x451fae=_0x28d943[_0x53e3a3];return _0x451fae;}export class JobSubmitCommand extends BaseCommand{['name']=a26_0x3d6011(0x1da);[a26_0x3d6011(0x1e0)]=a26_0x3d6011(0x1c8);async[a26_0x3d6011(0x196)](_0x367e95){const _0x111a5e=a26_0x3d6011,{options:_0x5ce5f2,args:_0xe92ca6,tdx:_0x5296f6}=_0x367e95,_0x1ce1ec=_0x5ce5f2['jobType']||_0x111a5e(0x190),_0x289eee=_0x5ce5f2[_0x111a5e(0x1db)],_0x158bdb=_0x5ce5f2[_0x111a5e(0x18c)]||'information_schema',_0x1fd693=_0x5ce5f2[_0x111a5e(0x1df)];if(_0x1ce1ec!==_0x111a5e(0x190)&&_0x1ce1ec!==_0x111a5e(0x1de))throw new SDKError(ErrorCode[_0x111a5e(0x1c4)],'--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22');let _0x44744f;if(_0x289eee){if(_0xe92ca6[0x0])throw new SDKError(ErrorCode[_0x111a5e(0x1c4)],_0x111a5e(0x1c3));const _0xfcdbcc=readSqlStatementsFromFile(_0x289eee);if(_0xfcdbcc['length']===0x0)throw new SDKError(ErrorCode[_0x111a5e(0x1c4)],_0x111a5e(0x1b7));if(_0xfcdbcc[_0x111a5e(0x1a7)]>0x1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x111a5e(0x1d5));_0x44744f=_0xfcdbcc[0x0];}else{if(!_0xe92ca6[0x0])throw new SDKError(ErrorCode[_0x111a5e(0x1c4)],_0x111a5e(0x1d2));_0x44744f=_0xe92ca6[0x0];}_0x5ce5f2[_0x111a5e(0x1b4)]&&(console[_0x111a5e(0x191)](_0x111a5e(0x1c2)+_0x1ce1ec),console['error'](_0x111a5e(0x1a6)+_0x158bdb),console[_0x111a5e(0x191)](_0x111a5e(0x1d7)+_0x44744f['substring'](0x0,0x64)+(_0x44744f[_0x111a5e(0x1a7)]>0x64?_0x111a5e(0x198):'')));const _0x576d6f=await withSpinner(_0x111a5e(0x1dd),()=>_0x5296f6[_0x111a5e(0x1c9)][_0x111a5e(0x1d6)](_0x158bdb,_0x44744f,_0x1ce1ec,_0x1fd693),{'verbose':_0x5ce5f2[_0x111a5e(0x1b4)]}),_0x43cfe5=_0x576d6f[_0x111a5e(0x1ce)];return console['error'](_0x111a5e(0x1e2)),console[_0x111a5e(0x191)]('\x20\x20Job\x20ID:\x20'+_0x43cfe5[_0x111a5e(0x1d1)]),await handleSDKOutput([_0x43cfe5],_0x5ce5f2),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x3d6011(0x1be)]=a26_0x3d6011(0x1af);[a26_0x3d6011(0x1e0)]=a26_0x3d6011(0x1e3);[a26_0x3d6011(0x19a)](_0x29339e){const _0xe2b3be=a26_0x3d6011,_0x4dfb8d=_0x29339e[_0xe2b3be(0x1c5)][0x0];if(!_0x4dfb8d)return _0xe2b3be(0x18e);return undefined;}async[a26_0x3d6011(0x196)](_0x5c1c0a){const _0x20cdf7=a26_0x3d6011,{options:_0x5d2507,args:_0x3a6a84,tdx:_0x1ed9a2}=_0x5c1c0a,_0x74f128=_0x3a6a84[0x0],_0x4788db=await withSpinner(_0x20cdf7(0x19b),()=>_0x1ed9a2[_0x20cdf7(0x1c9)][_0x20cdf7(0x1df)](_0x74f128),{'verbose':_0x5d2507['verbose']}),_0x426167=_0x4788db['data'];return console[_0x20cdf7(0x191)](_0x20cdf7(0x19d)+_0x426167[_0x20cdf7(0x1a7)]+'\x20row'+(_0x426167[_0x20cdf7(0x1a7)]!==0x1?'s':'')),await handleSDKOutput(_0x426167,_0x5d2507),0x0;}}
@@ -1 +1 @@
1
- const a27_0x19f833=a27_0x3cf7;(function(_0xf3ff5d,_0x333eed){const _0x54b230=a27_0x3cf7,_0x31ad23=_0xf3ff5d();while(!![]){try{const _0x45de78=parseInt(_0x54b230(0x209))/0x1*(-parseInt(_0x54b230(0x27e))/0x2)+parseInt(_0x54b230(0x22c))/0x3+parseInt(_0x54b230(0x1fd))/0x4*(parseInt(_0x54b230(0x24f))/0x5)+parseInt(_0x54b230(0x2a8))/0x6+parseInt(_0x54b230(0x1c8))/0x7*(-parseInt(_0x54b230(0x1f8))/0x8)+-parseInt(_0x54b230(0x205))/0x9*(-parseInt(_0x54b230(0x1f1))/0xa)+-parseInt(_0x54b230(0x2b0))/0xb*(parseInt(_0x54b230(0x247))/0xc);if(_0x45de78===_0x333eed)break;else _0x31ad23['push'](_0x31ad23['shift']());}catch(_0x22e268){_0x31ad23['push'](_0x31ad23['shift']());}}}(a27_0x1d5e,0x4eba4));import a27_0x50d849 from'chalk';import a27_0x3be399 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';function a27_0x3cf7(_0x961c97,_0x35ad6e){_0x961c97=_0x961c97-0x1aa;const _0x1d5ee1=a27_0x1d5e();let _0x3cf780=_0x1d5ee1[_0x961c97];return _0x3cf780;}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';function a27_0x1d5e(){const _0x3d6eae=['Options:','✔\x20Journey\x20\x22','tdx.json','enteredSize','sort','\x22\x20paused','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','\x20details...','Error:\x20Journey\x20not\x20found:\x20','then','Resolving\x20journey...','journeyStages','archived','content','journey:stats','entries','parentSegment','isNew','.yml','paused','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','journey:view','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','getActivation','message','push','utf-8','relativePath','\x27\x20not\x20found\x20in\x20','492834YFqTZZ','journey:activations','Error:\x20Invalid\x20version\x20number:\x20','history','no_parent','includeHistory','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','pause','segment','journey:versions','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','/e/','user','journey','file','\x20Created\x20v','reentryMode','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','journeyBundleName','listJourneysWithFolders','cwd','\x20journeys','rootFolderId','Resolving\x20parent\x20segment...','args','json','136308HMbzGA','Getting\x20journey\x20statistics...','setPhase','has','Database:\x20','error','helpText','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','1616245WTpWHp','replace','conversion','table','\x20\x20Consolidating\x20duplicate\x20segment:\x20','Listing\x20journeys...','limit','yes','\x20(draft)\x20—\x20\x22','versionNumber','absolutePath','toLowerCase','stringify','rule','size','Getting\x20journey\x20details...','\x20=\x20','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','dryRun','journeyBundleId','Fetching\x20journeys\x20and\x20folders...','Write\x20','connection','Found\x20','resolveJourneyId','goal','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Warning:\x20Could\x20not\x20resolve\x20segment\x20','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)','Folder\x20path:\x20','\x20Opening\x20','Table:\x20','Parent\x20segment:\x20','updatedAt','name','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','relative','\x20\x20Name:\x20','Resuming\x20journey...','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','journeyId','\x20\x20Folder\x20path:\x20','targetDir','listFolders','type','1025578MWbLdv','state','site','\x20\x20Journey\x20ID:\x20','journey:version:view','\x20->\x20','\x20not\x20found.\x20Available:\x20','blue','dim','\x20changed\x20files','description','parent_segment','Cancelled','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','bold','log','getLatestJourneyId','-\x20no\x20files\x20written','List\x20activations\x20for\x20a\x20journey','execute','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','Show\x20journey\x20details','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','Fetching\x20','options','find','createVersion','folderId','yellow','jsonl','map','completionRate','No\x20journeys\x20found','Show\x20journey\x20statistics','from','Journey\x20name:\x20','\x20activation','journey:traffic','Target\x20directory:\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','completed','Error:\x20Parent\x20segment\x20context\x20required','2044530GwBVSa','links','\x20version','/j/da/je','✔\x20Pulled\x20','getJourney','\x5c$&','\x20\x20Preserving\x20local\x20segment\x20name:\x20','253QRgTXp','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','base','journey:pause','kind','attributes','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','listVersions','\x20versions)','stages','segments','getParentFull','(running)','filePath','List\x20all\x20versions\x20of\x20a\x20journey','parentName','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','getTrafficData','Getting\x20version\x20','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','activation','split','Resolved\x20YAML\x20file:\x20','exitOrJumpRate','launched','root\x20folder','database','folderPath','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','Getting\x20journey\x20traffic\x20data...','createdAt','(draft)','folders','renderStats','\x20(ID:\x20','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','filter','buildIdToNameMap','Fetching\x20users\x20and\x20connections...','\x0aChanges\x20to\x20\x27','join','413497sOZtFR','\x0aPull\x20summary:','session','getStatistics','Listing\x20journey\x20versions...','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','resolveSegment','segmentPushCommand','resume','draft','values','\x20journey\x20files\x20to\x20','🗺️\x20','INVALID_ARGUMENT','journey:columns','getColumnMapping','\x20\x20Target:\x20','✔\x20Found\x20','(completed)','segmentName','cyan','Input:\x20','web','format','columns','Aborted.','Available\x20stages:\x20','stage',',\x20version:\x20','get','resolveParentId','List\x20journeys\x20in\x20current\x20context','tsv','Error:\x20--version\x20option\x20is\x20required','add','Error:\x20Version\x20','hasChanges','\x20(rule\x20match)','green','(root)','getSegment','110ZKAVxU','errorCode','journey:resume','set','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','stageNameMap','\x20journey','24zzUjWf','data','localeCompare','all','exitOrJumpSize','4jwteFP','\x22\x20resumed','milestoneSize','View\x20a\x20specific\x20version\x20of\x20a\x20journey','red','resourceName','\x20files?','verbose','364455kWyRvN','length','\x22\x20not\x20found','Export\x20journey(s)\x20as\x20YAML\x20files','1JvjhMh','journey:pull','/app/ps/','Pausing\x20journey...','Error:\x20Invalid\x20--type\x20\x22','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)'];a27_0x1d5e=function(){return _0x3d6eae;};return a27_0x1d5e();}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(_0x14612f){const _0x26dd17=a27_0x3cf7;return!_0x14612f&&(console[_0x26dd17(0x24c)](_0x26dd17(0x292)),console[_0x26dd17(0x24c)](_0x26dd17(0x1cd))),!!_0x14612f;}function withJsonFormat(_0x337a0d){const _0x1dacaa=a27_0x3cf7;if(!_0x337a0d['format']&&!_0x337a0d['json']&&!_0x337a0d[_0x1dacaa(0x29b)]&&!_0x337a0d[_0x1dacaa(0x1e8)])return{..._0x337a0d,'format':_0x1dacaa(0x246),'json':!![]};return _0x337a0d;}function formatJourneyState(_0x6119d0){const _0x4cb83b=a27_0x3cf7;switch(_0x6119d0){case _0x4cb83b(0x1b7):return a27_0x50d849['green'](_0x4cb83b(0x1ab));case _0x4cb83b(0x1d1):return a27_0x50d849[_0x4cb83b(0x286)](_0x4cb83b(0x1be));case _0x4cb83b(0x222):return a27_0x50d849['yellow']('(paused)');case _0x4cb83b(0x2a6):return a27_0x50d849[_0x4cb83b(0x285)](_0x4cb83b(0x1da));case _0x4cb83b(0x21b):return a27_0x50d849[_0x4cb83b(0x286)]('(archived)');default:return'('+_0x6119d0+')';}}function formatJourneyItem(_0x179471,_0x98ad4c='',_0x3befc0){const _0x326fb5=a27_0x3cf7,_0x4863a9=formatJourneyState(_0x179471[_0x326fb5(0x27f)]),_0x179589=_0x3befc0?hyperlink(_0x179471[_0x326fb5(0x23f)],_0x3befc0):_0x179471[_0x326fb5(0x23f)];return _0x98ad4c+_0x326fb5(0x1d4)+_0x179589+'\x20'+_0x4863a9;}function escapeRegex(_0x13be22){const _0xfc2e73=a27_0x3cf7;return _0x13be22[_0xfc2e73(0x250)](/[.*+?^${}()|[\]\\]/g,_0xfc2e73(0x2ae));}function globToRegex(_0x559bf7){const _0x3901b=a27_0x3cf7,_0x410265=_0x559bf7[_0x3901b(0x1b4)]('*')[_0x3901b(0x29c)](escapeRegex);return new RegExp(_0x410265[_0x3901b(0x1c7)]('.*'),'i');}function buildRuleToNameMapping(_0x7bc18){const _0x3411d5=a27_0x3cf7,_0x3cfca8=new Map();if(_0x7bc18['segments'])for(const [_0x18dde4,_0x18679a]of Object['entries'](_0x7bc18[_0x3411d5(0x2ba)])){if(_0x18679a[_0x3411d5(0x25c)]){const _0x422868=serializeRule(_0x18679a[_0x3411d5(0x25c)]),_0x124491=_0x3cfca8[_0x3411d5(0x1e5)](_0x422868);_0x124491?_0x124491[_0x3411d5(0x228)](_0x18dde4):_0x3cfca8[_0x3411d5(0x1f4)](_0x422868,[_0x18dde4]);}}return _0x3cfca8;}async function resolveJourneyIdFromInput(_0x2949c0,_0x1c308a,_0x194fa2){const _0x19a016=a27_0x3cf7,_0x1c307b=await resolveJourneyTarget(_0x2949c0,_0x1c308a['parentSegment'],_0x1c308a[_0x19a016(0x204)]),_0x43a3ef=_0x1c307b[_0x19a016(0x21f)];if(!_0x43a3ef)throw new SDKError(ErrorCode[_0x19a016(0x1d5)],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0x386498=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x194fa2['segment'][_0x19a016(0x1e6)](_0x43a3ef),{'verbose':_0x1c308a[_0x19a016(0x204)]}),_0x39e596=_0x386498[_0x19a016(0x1f9)],_0x3030b9=await withSpinner(_0x19a016(0x219),()=>_0x194fa2[_0x19a016(0x23a)][_0x19a016(0x267)](_0x39e596,_0x1c307b['journeyName']),{'verbose':_0x1c308a[_0x19a016(0x204)]});return{'journeyId':_0x3030b9['data'],'journeyName':_0x1c307b['journeyName'],'parentSegmentId':_0x39e596};}async function resolveJourneyTarget(_0x28f4ee,_0xfca37a,_0x11eff0){const _0x1f725d=a27_0x3cf7;if(isYamlFilePath(_0x28f4ee))try{const _0x1243d3=await resolveYamlFilePath(_0x28f4ee);return _0x11eff0&&(console[_0x1f725d(0x24c)](_0x1f725d(0x1b5)+_0x28f4ee),console[_0x1f725d(0x24c)]('\x20\x20Parent\x20segment:\x20'+_0x1243d3[_0x1f725d(0x21f)]),console[_0x1f725d(0x24c)](_0x1f725d(0x276)+_0x1243d3[_0x1f725d(0x1db)]),console[_0x1f725d(0x24c)](_0x1f725d(0x27a)+(_0x1243d3[_0x1f725d(0x1ba)]||_0x1f725d(0x1ef)))),{'journeyName':_0x1243d3[_0x1f725d(0x1db)],'parentSegment':_0x1243d3[_0x1f725d(0x21f)],'resolved':_0x1243d3};}catch(_0x1dfa69){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x1dfa69['message']);}if(!_0xfca37a)throw new SDKError(ErrorCode[_0x1f725d(0x1d5)],_0x1f725d(0x232));return{'journeyName':_0x28f4ee,'parentSegment':_0xfca37a};}export class JourneyListCommand extends BaseCommand{['name']='journey:list';[a27_0x19f833(0x288)]=a27_0x19f833(0x1e7);async[a27_0x19f833(0x291)](_0x1d90c3){const _0x237628=a27_0x19f833,{options:_0x11bfdf,args:_0x203c74,tdx:_0x22d633}=_0x1d90c3,_0xa1021a=_0x203c74[0x0],_0x2ff624=_0x11bfdf['parentSegment'];if(!_0x2ff624)return console[_0x237628(0x24c)](_0x237628(0x2a7)),console[_0x237628(0x24c)]('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x196aa6=await withSpinner(_0x237628(0x244),()=>_0x22d633[_0x237628(0x235)][_0x237628(0x1e6)](_0x2ff624),{'verbose':_0x11bfdf[_0x237628(0x204)]}),_0x5e132c=_0x196aa6[_0x237628(0x1f9)];_0x11bfdf[_0x237628(0x204)]&&(console['error'](_0x237628(0x271)+_0x2ff624+_0x237628(0x1c1)+_0x5e132c+')'),_0xa1021a&&console[_0x237628(0x24c)]('Pattern:\x20'+_0xa1021a));const _0xe4644f=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x22d633[_0x237628(0x235)][_0x237628(0x1aa)](_0x5e132c),{'verbose':_0x11bfdf[_0x237628(0x204)]}),_0xa54110=_0xe4644f[_0x237628(0x1f9)],_0x12ef51=_0xa54110[_0x237628(0x243)],_0x5017db=await withSpinner(_0x237628(0x254),()=>_0x22d633[_0x237628(0x23a)][_0x237628(0x240)](_0x5e132c,_0x12ef51),{'verbose':_0x11bfdf[_0x237628(0x204)]});let _0x559bc8=_0x5017db['data']['journeys'];const _0x9a4269=_0x5017db[_0x237628(0x1f9)][_0x237628(0x1bf)],_0xc58194=new Map();for(const _0x5bca8e of _0x9a4269){_0xc58194[_0x237628(0x1f4)](_0x5bca8e['id'],_0x5bca8e['name']);}if(_0xa1021a){const _0x7341a1=globToRegex(_0xa1021a);_0x559bc8=_0x559bc8[_0x237628(0x1c3)](_0x1c98f9=>_0x7341a1['test'](_0x1c98f9[_0x237628(0x23f)]));}console[_0x237628(0x24c)](_0x237628(0x1d9)+_0x559bc8['length']+_0x237628(0x1f7)+(_0x559bc8[_0x237628(0x206)]!==0x1?'s':''));const _0x168d05=_0x2f8451=>{const _0x5706ed=_0x237628;return getConsoleNextUrl(_0x11bfdf['site'],_0x5706ed(0x20b)+_0x5e132c+'/e/'+_0x2f8451+'/j/da');};if(_0x11bfdf[_0x237628(0x1df)]===_0x237628(0x252))await handleSDKOutput(_0x559bc8,_0x11bfdf);else{if(_0x11bfdf[_0x237628(0x1df)]===_0x237628(0x246)){const _0x2640a0=_0x559bc8[_0x237628(0x29c)](_0x543a3a=>({..._0x543a3a,'url':_0x168d05(_0x543a3a['id'])}));await handleSDKOutput(_0x2640a0,_0x11bfdf);}else{console[_0x237628(0x28d)]('['+_0x2ff624+']');const _0x4bd55b=new Map(),_0x39eb88=[];for(const _0x367352 of _0x559bc8){if(!_0x367352[_0x237628(0x299)]||_0x367352['folderId']===_0x12ef51)_0x39eb88[_0x237628(0x228)](_0x367352);else{const _0x158e2a=_0x4bd55b['get'](_0x367352[_0x237628(0x299)])||[];_0x158e2a[_0x237628(0x228)](_0x367352),_0x4bd55b[_0x237628(0x1f4)](_0x367352['folderId'],_0x158e2a);}}const _0x1f8ac3=(_0x60d0a7,_0x3cce2e)=>_0x60d0a7['journeyBundleName'][_0x237628(0x1fa)](_0x3cce2e[_0x237628(0x23f)],undefined,{'sensitivity':_0x237628(0x2b2)});_0x39eb88[_0x237628(0x213)](_0x1f8ac3);for(const _0x4fe321 of _0x39eb88){console[_0x237628(0x28d)](formatJourneyItem(_0x4fe321,'',_0x168d05(_0x4fe321['id'])));}const _0x3cda2e=[..._0x4bd55b[_0x237628(0x21e)]()][_0x237628(0x213)]((_0x491388,_0x308203)=>{const _0x409dbe=_0x237628,_0xbfbdd2=_0xc58194[_0x409dbe(0x1e5)](_0x491388[0x0])||_0x491388[0x0],_0x4ea57f=_0xc58194['get'](_0x308203[0x0])||_0x308203[0x0];return _0xbfbdd2[_0x409dbe(0x1fa)](_0x4ea57f,undefined,{'sensitivity':'base'});});for(const [_0x2051e3,_0x3d5dc1]of _0x3cda2e){const _0xebc31a=_0xc58194[_0x237628(0x1e5)](_0x2051e3)||_0x2051e3;console[_0x237628(0x28d)]('📁\x20'+_0xebc31a),_0x3d5dc1[_0x237628(0x213)](_0x1f8ac3);for(const _0x3f4a0e of _0x3d5dc1){console[_0x237628(0x28d)](formatJourneyItem(_0x3f4a0e,'\x20\x20',_0x168d05(_0x3f4a0e['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x19f833(0x273)]=a27_0x19f833(0x224);[a27_0x19f833(0x288)]=a27_0x19f833(0x293);async[a27_0x19f833(0x291)](_0x410666){const _0x9744c5=a27_0x19f833,{options:_0x267b32,args:_0x1d671c,tdx:_0x2759c8}=_0x410666,_0x2d93a3=_0x1d671c[0x0];if(!_0x2d93a3)return console[_0x9744c5(0x24c)](_0x9744c5(0x292)),console[_0x9744c5(0x24c)](_0x9744c5(0x26a)),console[_0x9744c5(0x24c)](_0x9744c5(0x20f)),console[_0x9744c5(0x24c)](_0x9744c5(0x1c2)),0x1;_0x267b32[_0x9744c5(0x204)]&&console[_0x9744c5(0x24c)](_0x9744c5(0x1dd)+_0x2d93a3);const {journeyId:_0x3ab156,parentSegmentId:_0x5cdf08}=await resolveJourneyIdFromInput(_0x2d93a3,_0x267b32,_0x2759c8);if(_0x267b32[_0x9744c5(0x1de)]){const _0x3955a2=getConsoleNextUrl(_0x267b32[_0x9744c5(0x280)],_0x9744c5(0x20b)+_0x5cdf08+'/e/'+_0x3ab156+_0x9744c5(0x2ab));return console[_0x9744c5(0x24c)](a27_0x50d849['green']('✔')+_0x9744c5(0x26f)+a27_0x50d849[_0x9744c5(0x1dc)](_0x3955a2)),openBrowser(_0x3955a2),0x0;}const _0x335685=await withSpinner(_0x9744c5(0x25e),()=>_0x2759c8[_0x9744c5(0x23a)][_0x9744c5(0x2ad)](_0x3ab156),{'verbose':_0x267b32[_0x9744c5(0x204)]}),_0x2c0d08=_0x335685['data'],_0x16c1ca=_0x267b32['includeStats'];let _0x1cd588;if(_0x16c1ca)try{const _0x29d0ae=await withSpinner(_0x9744c5(0x248),()=>_0x2759c8[_0x9744c5(0x23a)]['getStatistics'](_0x3ab156),{'verbose':_0x267b32[_0x9744c5(0x204)]});_0x1cd588=_0x29d0ae[_0x9744c5(0x1f9)];}catch{_0x267b32[_0x9744c5(0x204)]&&console[_0x9744c5(0x24c)]('\x20\x20Statistics\x20not\x20available');}const _0x3b32e6=getConsoleNextUrl(_0x267b32[_0x9744c5(0x280)],_0x9744c5(0x20b)+_0x5cdf08+_0x9744c5(0x238)+_0x3ab156+_0x9744c5(0x2ab)),_0x10f5c2={'id':_0x2c0d08['id'],'name':_0x2c0d08[_0x9744c5(0x2b5)][_0x9744c5(0x273)],'description':_0x2c0d08['attributes'][_0x9744c5(0x288)],'state':_0x2c0d08['attributes'][_0x9744c5(0x27f)],'paused':_0x2c0d08[_0x9744c5(0x2b5)][_0x9744c5(0x222)],'reentry_mode':_0x2c0d08['attributes'][_0x9744c5(0x23d)],'stages':_0x2c0d08[_0x9744c5(0x2b5)]['journeyStages']?.[_0x9744c5(0x206)]||0x0,..._0x2c0d08[_0x9744c5(0x2b5)][_0x9744c5(0x268)]&&{'goal':_0x2c0d08['attributes'][_0x9744c5(0x268)][_0x9744c5(0x273)]},..._0x1cd588&&{'statistics':{'size':_0x1cd588['size'],'entered':_0x1cd588['enteredSize'],'goal_achieved':_0x1cd588['goalSize'],'completion_rate':_0x1cd588[_0x9744c5(0x29d)],'exit_or_jump':_0x1cd588['exitOrJumpSize'],'exit_or_jump_rate':_0x1cd588[_0x9744c5(0x1b6)],'stages':_0x1cd588[_0x9744c5(0x2b9)]}},'url':_0x3b32e6};return await handleSingleObjectOutput(_0x10f5c2,_0x267b32),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x19f833(0x273)]=a27_0x19f833(0x21d);['description']=a27_0x19f833(0x29f);async[a27_0x19f833(0x291)](_0x5d3240){const _0x503828=a27_0x19f833,{options:_0x3562fe,args:_0x442c80,tdx:_0x202e8f}=_0x5d3240,_0x3b38b6=_0x442c80[0x0];if(!requireNameOrPath(_0x3b38b6))return 0x1;_0x3562fe[_0x503828(0x204)]&&console[_0x503828(0x24c)](_0x503828(0x1dd)+_0x3b38b6);const _0x55fbcc=_0x3562fe,_0x52f25b=_0x55fbcc['from'],_0x12a920=_0x55fbcc['to'],_0x55621f=_0x55fbcc[_0x503828(0x231)],_0x105b99=_0x55fbcc[_0x503828(0x1e3)];_0x55621f&&!_0x52f25b&&!_0x12a920&&console[_0x503828(0x24c)](_0x503828(0x260));const _0x2a3f28=_0x55621f?withJsonFormat(_0x3562fe):_0x3562fe,{journeyId:_0xd19a76,journeyName:_0x2e8613}=await resolveJourneyIdFromInput(_0x3b38b6,_0x2a3f28,_0x202e8f),_0x49ede8=_0x52f25b||_0x12a920?{'from':_0x52f25b,'to':_0x12a920}:undefined,_0x2cb44c=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise[_0x503828(0x1fb)]([_0x202e8f[_0x503828(0x23a)][_0x503828(0x2ad)](_0xd19a76),_0x202e8f['journey'][_0x503828(0x1cb)](_0xd19a76,_0x49ede8)]),{'verbose':_0x2a3f28['verbose']}),[_0x3ff106,_0x5992d3]=_0x2cb44c['data'];if(!_0x5992d3||_0x5992d3[_0x503828(0x279)]===null)return console[_0x503828(0x24c)]('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x2e8613),console['error'](_0x503828(0x23e)),0x0;const _0x1f34ce=buildStageNameMap(_0x3ff106),_0x5ba849=!!(_0x49ede8&&_0x5992d3[_0x503828(0x22f)]?.['length']),_0x1f4cf5={'stageNameMap':_0x1f34ce,'hasPeriod':_0x5ba849,'includeHistory':!!_0x55621f};if(_0x105b99&&_0x5992d3[_0x503828(0x2b9)]){const _0x12cc48=_0x5992d3['stages'][_0x503828(0x297)](_0x29e75b=>{const _0x18be80=_0x503828,_0x3fdc07=_0x1f34ce['get'](_0x29e75b['id'])??'';return _0x3fdc07[_0x18be80(0x25a)]()===_0x105b99[_0x18be80(0x25a)]();});if(_0x12cc48)return await handleSingleObjectOutput(formatStageStats(_0x12cc48,_0x1f4cf5),_0x2a3f28),0x0;const _0x2acde0=_0x5992d3['stages'][_0x503828(0x29c)](_0x14485d=>_0x1f34ce[_0x503828(0x1e5)](_0x14485d['id'])??_0x14485d['id']);return console[_0x503828(0x24c)]('Error:\x20Stage\x20\x22'+_0x105b99+_0x503828(0x207)),console['error'](_0x503828(0x1e2)+_0x2acde0[_0x503828(0x1c7)](',\x20')),0x1;}const _0x269cdd=_0x5992d3[_0x503828(0x2b9)]?.['map'](_0x1f7b12=>formatStageStats(_0x1f7b12,_0x1f4cf5)),_0x2926b6=assembleJourneyStats(_0x5992d3,{'from':_0x52f25b,'to':_0x12a920,'includeHistory':_0x55621f});return await this[_0x503828(0x1c0)](_0x2926b6,_0x269cdd??[],_0x2a3f28),0x0;}async[a27_0x19f833(0x1c0)](_0x6e816a,_0x1d0604,_0x2e4a37){const _0x5ad736=a27_0x19f833,_0x3f12fc=_0x2e4a37[_0x5ad736(0x1df)]==='json'||_0x2e4a37[_0x5ad736(0x1df)]===_0x5ad736(0x29b)||_0x2e4a37[_0x5ad736(0x246)]||_0x2e4a37[_0x5ad736(0x29b)];if(_0x3f12fc){_0x6e816a[_0x5ad736(0x2b9)]=_0x1d0604,await handleSingleObjectOutput(_0x6e816a,_0x2e4a37);return;}await handleSingleObjectOutput(_0x6e816a,_0x2e4a37);for(const _0x1ca9da of _0x1d0604){console[_0x5ad736(0x28d)](''),console[_0x5ad736(0x28d)](String(a27_0x50d849[_0x5ad736(0x1dc)][_0x5ad736(0x28c)]('['+_0x1ca9da[_0x5ad736(0x273)]+']'))+a27_0x50d849[_0x5ad736(0x286)]('\x20'+_0x1ca9da['id']));const {id:_0x97b37c,name:_0x3ee12b,..._0x393063}=_0x1ca9da;await handleSingleObjectOutput(_0x393063,_0x2e4a37);}}}export class JourneyTrafficCommand extends BaseCommand{['name']=a27_0x19f833(0x2a3);[a27_0x19f833(0x288)]=a27_0x19f833(0x20e);async['execute'](_0x4c1b78){const _0x152bdf=a27_0x19f833,{options:_0x50dd14,args:_0x126d36,tdx:_0x14594c}=_0x4c1b78,_0xd26a57=_0x126d36[0x0];if(!requireNameOrPath(_0xd26a57))return 0x1;_0x50dd14[_0x152bdf(0x204)]&&console[_0x152bdf(0x24c)](_0x152bdf(0x1dd)+_0xd26a57);const _0x5e3da1=_0x50dd14,_0x408f8b=_0x5e3da1[_0x152bdf(0x27d)],_0x570c32=_0x5e3da1[_0x152bdf(0x2a0)],_0x1de7e5=_0x5e3da1['to'],_0x9d8d66=_0x5e3da1[_0x152bdf(0x255)];if(_0x408f8b&&_0x408f8b!=='conversion'&&_0x408f8b!=='activation')return console[_0x152bdf(0x24c)](_0x152bdf(0x20d)+_0x408f8b+_0x152bdf(0x223)),0x1;const _0x5d4a52=withJsonFormat(_0x50dd14),{journeyId:_0x35f3bc,journeyName:_0x5bbf21}=await resolveJourneyIdFromInput(_0xd26a57,_0x5d4a52,_0x14594c),_0x2968e1={'type':_0x408f8b,'from':_0x570c32,'to':_0x1de7e5,'limit':_0x9d8d66},_0xc9a37a=await withSpinner(_0x152bdf(0x1bc),()=>_0x14594c['journey'][_0x152bdf(0x1b0)](_0x35f3bc,_0x2968e1),{'verbose':_0x5d4a52['verbose']}),_0x151095=_0xc9a37a[_0x152bdf(0x1f9)],_0x3acf4d=_0x151095[_0x152bdf(0x251)]&&(_0x151095[_0x152bdf(0x251)]['nodes'][_0x152bdf(0x206)]>0x0||_0x151095[_0x152bdf(0x251)][_0x152bdf(0x2a9)][_0x152bdf(0x206)]>0x0),_0x2cb60b=_0x151095[_0x152bdf(0x1b3)]&&_0x151095['activation'][_0x152bdf(0x206)]>0x0;if(!_0x3acf4d&&!_0x2cb60b)return console[_0x152bdf(0x24c)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x5bbf21),console['error'](_0x152bdf(0x237)),_0x570c32&&_0x1de7e5&&console[_0x152bdf(0x24c)](_0x152bdf(0x1af)),0x0;return await handleSingleObjectOutput(_0x151095,_0x5d4a52),0x0;}}function formatStageStats(_0x541f28,_0x516dfb){const _0x35260c=a27_0x19f833,_0x523d6e=_0x516dfb['hasPeriod']&&_0x541f28['history']?.[_0x35260c(0x206)]?aggregateStageHistory(_0x541f28[_0x35260c(0x22f)]):{'size':_0x541f28['size'],'entered':_0x541f28[_0x35260c(0x212)],'milestone':_0x541f28[_0x35260c(0x1ff)],'milestone_rate':_0x541f28['completeMilestoneRate'],'exit_or_jump':_0x541f28[_0x35260c(0x1fc)],'exit_or_jump_rate':_0x541f28[_0x35260c(0x1b6)]},_0x45fb4e={'id':_0x541f28['id'],'name':_0x516dfb[_0x35260c(0x1f6)][_0x35260c(0x1e5)](_0x541f28['id'])??_0x541f28['id'],..._0x523d6e};return _0x516dfb['hasPeriod']&&_0x516dfb[_0x35260c(0x231)]&&_0x541f28['history']&&(_0x45fb4e[_0x35260c(0x22f)]=_0x541f28[_0x35260c(0x22f)]),_0x45fb4e;}export class JourneyPauseCommand extends BaseCommand{[a27_0x19f833(0x273)]=a27_0x19f833(0x2b3);[a27_0x19f833(0x288)]='Pause\x20a\x20running\x20journey';async['execute'](_0x34ee15){const _0x3bd639=a27_0x19f833,{options:_0x3a33eb,args:_0x2f9640,tdx:_0x2cb894}=_0x34ee15,_0x80ea91=_0x2f9640[0x0];if(!requireNameOrPath(_0x80ea91))return 0x1;_0x3a33eb[_0x3bd639(0x204)]&&console['error']('Input:\x20'+_0x80ea91);const {journeyId:_0x40d73d,journeyName:_0x1435ac}=await resolveJourneyIdFromInput(_0x80ea91,_0x3a33eb,_0x2cb894);if(!_0x3a33eb['yes']){const _0x50e644=await confirm(_0x3bd639(0x24e)+_0x1435ac+'\x22?');if(!_0x50e644)return console[_0x3bd639(0x24c)](_0x3bd639(0x28a)),0x0;}const _0x509214=await withSpinner(_0x3bd639(0x20c),()=>_0x2cb894[_0x3bd639(0x23a)][_0x3bd639(0x234)](_0x40d73d),{'verbose':_0x3a33eb[_0x3bd639(0x204)]}),_0x7a1279=_0x509214[_0x3bd639(0x1f9)];return console[_0x3bd639(0x24c)]('✔\x20Journey\x20\x22'+_0x7a1279[_0x3bd639(0x2b5)][_0x3bd639(0x273)]+_0x3bd639(0x214)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x19f833(0x273)]=a27_0x19f833(0x1f3);[a27_0x19f833(0x288)]='Resume\x20a\x20paused\x20journey';async[a27_0x19f833(0x291)](_0x54121e){const _0x44e5ba=a27_0x19f833,{options:_0x1df14d,args:_0x3fb439,tdx:_0x1e96fa}=_0x54121e,_0x1dc42e=_0x3fb439[0x0];if(!requireNameOrPath(_0x1dc42e))return 0x1;_0x1df14d['verbose']&&console['error'](_0x44e5ba(0x1dd)+_0x1dc42e);const {journeyId:_0x177b9a,journeyName:_0x285788}=await resolveJourneyIdFromInput(_0x1dc42e,_0x1df14d,_0x1e96fa);if(!_0x1df14d[_0x44e5ba(0x256)]){const _0x2c60b9=await confirm(_0x44e5ba(0x274)+_0x285788+'\x22?');if(!_0x2c60b9)return console[_0x44e5ba(0x24c)](_0x44e5ba(0x28a)),0x0;}const _0x512405=await withSpinner(_0x44e5ba(0x277),()=>_0x1e96fa['journey'][_0x44e5ba(0x1d0)](_0x177b9a),{'verbose':_0x1df14d['verbose']}),_0x52b065=_0x512405[_0x44e5ba(0x1f9)];return console[_0x44e5ba(0x24c)](_0x44e5ba(0x210)+_0x52b065['attributes'][_0x44e5ba(0x273)]+_0x44e5ba(0x1fe)),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']=a27_0x19f833(0x20a);[a27_0x19f833(0x288)]=a27_0x19f833(0x208);async[a27_0x19f833(0x291)](_0x128b9a){const _0x17f7c7=a27_0x19f833,{options:_0x1430f0,args:_0x2128fa,tdx:_0x52ade8}=_0x128b9a,_0x42603a=_0x1430f0,_0x4a94a0=_0x2128fa[0x0],_0x1b5f6f=_0x4a94a0&&isYamlFilePath(_0x4a94a0),_0x5c6970=await resolveTarget({'arg':_0x1b5f6f?_0x4a94a0:undefined,'contextParent':_0x1430f0[_0x17f7c7(0x21f)],'cwd':process[_0x17f7c7(0x241)]()});if(!isSuccessfulResolution(_0x5c6970))return _0x5c6970[_0x17f7c7(0x1f2)]===_0x17f7c7(0x230)?(console[_0x17f7c7(0x24c)](a27_0x50d849[_0x17f7c7(0x29a)](_0x17f7c7(0x2b6))),console[_0x17f7c7(0x24c)](_0x17f7c7(0x26d)),console['error'](_0x17f7c7(0x1bb)),console[_0x17f7c7(0x24c)](_0x17f7c7(0x278)),console['error'](_0x17f7c7(0x28b))):(console[_0x17f7c7(0x24c)](a27_0x50d849[_0x17f7c7(0x201)]('Error:\x20'+_0x5c6970[_0x17f7c7(0x227)]+'\x0a')),_0x5c6970[_0x17f7c7(0x24d)]&&console[_0x17f7c7(0x24c)](a27_0x50d849[_0x17f7c7(0x1dc)](_0x5c6970['helpText']))),0x1;let _0x380e14=_0x1b5f6f?undefined:_0x4a94a0,_0x56710a,_0x3b320a;_0x5c6970[_0x17f7c7(0x27d)]===_0x17f7c7(0x23b)&&(_0x380e14=_0x5c6970[_0x17f7c7(0x202)],_0x56710a=_0x5c6970[_0x17f7c7(0x1ac)],_0x3b320a=_0x5c6970['folderPath']);const _0x4a2652=_0x5c6970[_0x17f7c7(0x1ae)],_0x27d0ee=_0x5c6970[_0x17f7c7(0x27b)];_0x42603a['verbose']&&(console[_0x17f7c7(0x24c)](_0x17f7c7(0x271)+_0x4a2652),console[_0x17f7c7(0x24c)](_0x17f7c7(0x2a4)+_0x27d0ee),_0x380e14&&console[_0x17f7c7(0x24c)](_0x17f7c7(0x2a1)+_0x380e14),_0x56710a&&console[_0x17f7c7(0x24c)]('Target\x20file:\x20'+_0x56710a),_0x3b320a&&console[_0x17f7c7(0x24c)](_0x17f7c7(0x26e)+_0x3b320a));const _0x1ecc95=await withSpinner(_0x17f7c7(0x244),()=>_0x52ade8[_0x17f7c7(0x235)][_0x17f7c7(0x1e6)](_0x4a2652),{'verbose':_0x1430f0[_0x17f7c7(0x204)]}),_0x592679=_0x1ecc95['data'],{journeys:_0x2ee82d,folders:_0x1b35a0}=await withSpinner(_0x17f7c7(0x263),async()=>{const _0x2ee45e=_0x17f7c7,[_0x57f0ba,_0x14f452]=await Promise[_0x2ee45e(0x1fb)]([_0x52ade8[_0x2ee45e(0x23a)]['listJourneysFromParentSegment'](_0x592679,undefined,{'includeAllVersions':!![]}),_0x52ade8['segment'][_0x2ee45e(0x27c)](_0x592679)]);return{'journeys':_0x57f0ba,'folders':_0x14f452};},{'verbose':_0x1430f0['verbose']})[_0x17f7c7(0x218)](_0x456718=>_0x456718[_0x17f7c7(0x1f9)]);let _0x44aae5=_0x2ee82d;const _0x2c010c=buildFolderIdToPathMap(_0x1b35a0);if(_0x380e14){const _0x36bacb=_0x44aae5[_0x17f7c7(0x1c3)](_0x4d6870=>_0x4d6870[_0x17f7c7(0x23f)]['toLowerCase']()===_0x380e14[_0x17f7c7(0x25a)]());if(_0x36bacb['length']===0x0)return console[_0x17f7c7(0x24c)](_0x17f7c7(0x217)+_0x380e14),console[_0x17f7c7(0x24c)](_0x17f7c7(0x1b2)),0x1;_0x44aae5=_0x36bacb;}if(_0x3b320a!==undefined){const _0xa282e=_0x44aae5[_0x17f7c7(0x1c3)](_0x2493dc=>{const _0x26994c=_0x17f7c7,_0x28aa48=_0x2493dc['folderId']?_0x2c010c[_0x26994c(0x1e5)](_0x2493dc[_0x26994c(0x299)])||'':'';return _0x28aa48===_0x3b320a;});if(_0xa282e[_0x17f7c7(0x206)]===0x0&&_0x44aae5[_0x17f7c7(0x206)]>0x0){console['error']('Error:\x20Journey\x20\x27'+_0x380e14+_0x17f7c7(0x22b)+(_0x3b320a||_0x17f7c7(0x1b8))),console[_0x17f7c7(0x24c)](_0x17f7c7(0x225));for(const _0x3a30e7 of _0x44aae5){const _0x558429=_0x3a30e7[_0x17f7c7(0x299)]?_0x2c010c[_0x17f7c7(0x1e5)](_0x3a30e7[_0x17f7c7(0x299)])||'':'';console[_0x17f7c7(0x24c)]('\x20\x20-\x20'+(_0x558429||_0x17f7c7(0x1ef))+'/'+_0x3a30e7[_0x17f7c7(0x23f)]);}return 0x1;}_0x44aae5=_0xa282e;}if(_0x44aae5[_0x17f7c7(0x206)]===0x0)return console[_0x17f7c7(0x24c)](_0x17f7c7(0x29e)),0x0;const _0x48e3f8=new Map();for(const _0x3e2a66 of _0x44aae5){const _0x2873f4=_0x3e2a66[_0x17f7c7(0x262)];!_0x48e3f8[_0x17f7c7(0x24a)](_0x2873f4)&&_0x48e3f8[_0x17f7c7(0x1f4)](_0x2873f4,[]),_0x48e3f8[_0x17f7c7(0x1e5)](_0x2873f4)[_0x17f7c7(0x228)](_0x3e2a66);}for(const _0x772000 of _0x48e3f8[_0x17f7c7(0x1d2)]()){_0x772000['sort']((_0x3cfa54,_0x34cd1c)=>(_0x3cfa54['versionNumber']||0x0)-(_0x34cd1c[_0x17f7c7(0x258)]||0x0));}const _0x35991f=[],{idToEmailMap:_0x5098dc,connectionIdToNameMap:_0x9f6c1f}=await withSpinner(_0x17f7c7(0x1c5),async()=>{const _0x7e412f=_0x17f7c7,[_0x293e7f,_0x23c2d1]=await Promise['all']([_0x52ade8[_0x7e412f(0x239)]['buildIdToEmailMap'](),_0x52ade8[_0x7e412f(0x265)][_0x7e412f(0x1c4)]()]);return{'idToEmailMap':_0x293e7f,'connectionIdToNameMap':_0x23c2d1};},{'verbose':_0x1430f0[_0x17f7c7(0x204)]})[_0x17f7c7(0x218)](_0x1b8782=>_0x1b8782[_0x17f7c7(0x1f9)]);for(const _0x317e03 of _0x48e3f8['values']()){const _0x1abb6d=_0x317e03[0x0][_0x17f7c7(0x23f)],_0x684a5=_0x317e03[0x0][_0x17f7c7(0x299)],_0x586dd6=_0x684a5?_0x2c010c[_0x17f7c7(0x1e5)](_0x684a5)||'':'',_0x4b783e=_0x586dd6?a27_0x3be399[_0x17f7c7(0x1c7)](_0x27d0ee,_0x586dd6):_0x27d0ee,_0x439a0a=_0x56710a||a27_0x3be399[_0x17f7c7(0x1c7)](_0x4b783e,sanitizeFileName(_0x1abb6d)+_0x17f7c7(0x221));let _0x43dba8,_0x2bdee3;if(existsSync(_0x439a0a))try{const _0x2634ad=readFileSync(_0x439a0a,'utf-8'),_0x5131f8=parseYamlString(_0x2634ad);_0x2bdee3=_0x5131f8,_0x43dba8=buildRuleToNameMapping(_0x5131f8),_0x42603a[_0x17f7c7(0x204)]&&_0x43dba8[_0x17f7c7(0x25d)]>0x0&&console[_0x17f7c7(0x24c)](_0x17f7c7(0x266)+_0x43dba8[_0x17f7c7(0x25d)]+_0x17f7c7(0x2b1)+_0x1abb6d);}catch(_0x2463cd){_0x42603a[_0x17f7c7(0x204)]&&console['error'](_0x17f7c7(0x294)+_0x2463cd[_0x17f7c7(0x227)]);}const _0x3911c9=[],_0x3d4a39=new Set(),_0x13b5c9=new Map(),_0x162602=new Map(),_0x132b0e=new Set(),_0x415e5f=new Map(),_0x5763f5=new Map(),_0x39ac59=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x1abb6d+'...',async _0x24c1a2=>{const _0x3c7ca5=_0x17f7c7;for(const _0x33ba3f of _0x317e03){const _0x5d5171=_0x317e03['length']>0x1?_0x33ba3f[_0x3c7ca5(0x23f)]+'\x20v'+(_0x33ba3f[_0x3c7ca5(0x258)]||0x1):_0x33ba3f[_0x3c7ca5(0x23f)];_0x24c1a2[_0x3c7ca5(0x249)](_0x3c7ca5(0x295)+_0x5d5171);const _0x21d4d0=await _0x52ade8['journey'][_0x3c7ca5(0x2ad)](_0x33ba3f['id']),_0x273797=_0x21d4d0['attributes']?.['audienceId'],_0x4352a0={'resolveSegment':async _0x3a9249=>{const _0x380baa=_0x3c7ca5;if(!_0x273797)return{'name':_0x3a9249,'isJourneyLocal':![]};const _0x1e06ba=_0x13b5c9['get'](_0x3a9249);if(_0x1e06ba)return _0x1e06ba;try{const _0x3b654d=await _0x52ade8[_0x380baa(0x235)][_0x380baa(0x1f0)](_0x273797,_0x3a9249),_0x3c720a=_0x3b654d[_0x380baa(0x2b4)]===SEGMENT_KIND_JOURNEY;let _0x5d9870,_0x5f3957=_0x3b654d[_0x380baa(0x273)];if(_0x3c720a&&_0x3b654d['rule']){const _0x40a868=await segmentResponseToDef(_0x3b654d,{'resolveSegmentName':async _0xb508f4=>{const _0x46aacd=_0x380baa,_0x14a74d=_0x13b5c9[_0x46aacd(0x1e5)](_0xb508f4);if(_0x14a74d)return _0x14a74d[_0x46aacd(0x273)];const _0x164119=await _0x4352a0[_0x46aacd(0x1ce)](_0xb508f4);return _0x164119[_0x46aacd(0x273)];}}),_0x528685=_0x40a868[_0x380baa(0x25c)];_0x5d9870={'description':_0x3b654d['description'],'rule':_0x528685};const _0x14f23f=serializeRule(_0x528685),_0x1e7270=_0x162602['get'](_0x14f23f);if(_0x1e7270)_0x5f3957=_0x1e7270,_0x5d9870=undefined,_0x42603a[_0x380baa(0x204)]&&console['error'](_0x380baa(0x253)+_0x3b654d[_0x380baa(0x273)]+_0x380baa(0x283)+_0x1e7270);else{let _0xacffb7=![];if(_0x43dba8){const _0x1a69fc=_0x43dba8[_0x380baa(0x1e5)](_0x14f23f);if(_0x1a69fc){const _0x3d6e5e=_0x1a69fc['find'](_0x3cc225=>!_0x3d4a39[_0x380baa(0x24a)](_0x3cc225));_0x3d6e5e&&(_0x5f3957=_0x3d6e5e,_0x3d4a39[_0x380baa(0x1ea)](_0x3d6e5e),_0x162602[_0x380baa(0x1f4)](_0x14f23f,_0x3d6e5e),_0xacffb7=!![],_0x42603a['verbose']&&console[_0x380baa(0x24c)](_0x380baa(0x2af)+_0x3d6e5e+_0x380baa(0x1ed)));}}if(!_0xacffb7){const _0x415f8d=generateJourneyLocalName(_0x3b654d[_0x380baa(0x273)]);_0x415f8d&&(_0x5f3957=_0x415f8d);let _0x54bf11=_0x5f3957,_0x37b71e=0x2;while(_0x3d4a39[_0x380baa(0x24a)](_0x54bf11)){_0x54bf11=_0x5f3957+'_'+_0x37b71e,_0x37b71e++;}_0x3d4a39[_0x380baa(0x1ea)](_0x54bf11),_0x162602[_0x380baa(0x1f4)](_0x14f23f,_0x54bf11),_0x5f3957=_0x54bf11;}}}const _0x551b13={'name':_0x5f3957,'isJourneyLocal':_0x3c720a,'definition':_0x5d9870};return _0x13b5c9['set'](_0x3a9249,_0x551b13),_0x551b13;}catch(_0x12a642){return _0x1430f0[_0x380baa(0x204)]&&console[_0x380baa(0x24c)](_0x380baa(0x26c)+_0x3a9249+':\x20'+_0x12a642[_0x380baa(0x227)]),{'name':_0x3a9249,'isJourneyLocal':![]};}},'resolveActivation':async _0x20556b=>{const _0xadb995=_0x3c7ca5,_0x3922c0=_0x415e5f[_0xadb995(0x1e5)](_0x20556b);if(_0x3922c0)return _0x3922c0;try{const _0x2c7611=await _0x52ade8[_0xadb995(0x23a)][_0xadb995(0x226)](_0x33ba3f['id'],_0x20556b),_0x4dfc1d=journeyActivationStepToYaml(_0x2c7611,_0x5098dc,_0x9f6c1f),_0x3a7d03=JSON[_0xadb995(0x25b)]({'name':_0x4dfc1d[_0xadb995(0x273)],'connection':_0x4dfc1d[_0xadb995(0x265)],'connector_config':_0x4dfc1d['connector_config']}),_0x604f7=_0x5763f5[_0xadb995(0x1e5)](_0x3a7d03);if(_0x604f7){const _0xcadbde={'name':_0x604f7,'isJourneyLocal':!![],'definition':_0x4dfc1d};return _0x415e5f[_0xadb995(0x1f4)](_0x20556b,_0xcadbde),_0xcadbde;}const _0x4cdf2d=_0x2c7611[_0xadb995(0x2b5)]['activationParams']['name']||_0x20556b,_0x44dbb0=sanitizeYamlKey(_0x4cdf2d)||'activation_'+_0x20556b;let _0x31ead7=_0x44dbb0,_0x5272ed=0x2;while(_0x132b0e[_0xadb995(0x24a)](_0x31ead7)){_0x31ead7=_0x44dbb0+'_'+_0x5272ed,_0x5272ed++;}_0x132b0e[_0xadb995(0x1ea)](_0x31ead7),_0x5763f5[_0xadb995(0x1f4)](_0x3a7d03,_0x31ead7);const _0x4069f5={'name':_0x31ead7,'isJourneyLocal':!![],'definition':_0x4dfc1d};return _0x415e5f[_0xadb995(0x1f4)](_0x20556b,_0x4069f5),_0x4069f5;}catch(_0x392e67){return _0x1430f0['verbose']&&console[_0xadb995(0x24c)]('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x20556b+':\x20'+_0x392e67['message']),{'name':_0x20556b,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x194b01,_0x223e7a)=>{const _0x51bb6e=_0x3c7ca5;return resolveJumpTarget(_0x194b01,_0x223e7a,_0x39ac59,_0x24855b=>_0x52ade8[_0x51bb6e(0x23a)]['getJourney'](_0x24855b));}},_0x3e7db7=await journeyResponseToDef(_0x21d4d0,_0x4352a0);_0x3911c9[_0x3c7ca5(0x228)]({'item':_0x33ba3f,'yaml':_0x3e7db7});}},{'verbose':_0x1430f0[_0x17f7c7(0x204)]});const _0x580f17=await _0x52ade8[_0x17f7c7(0x23a)][_0x17f7c7(0x28e)](_0x317e03[0x0][_0x17f7c7(0x262)]),_0x303afa=buildMergedJourneyDef(_0x3911c9,_0x43dba8,_0x580f17),_0x9eff4d=normalizeJourneyDef(_0x303afa,_0x2bdee3),_0x322544=toYamlString(_0x9eff4d),_0xe67ffb=_0x56710a||a27_0x3be399[_0x17f7c7(0x1c7)](_0x4b783e,sanitizeFileName(_0x1abb6d)+'.yml');!_0x56710a&&_0x586dd6&&!existsSync(_0x4b783e)&&mkdirSync(_0x4b783e,{'recursive':!![]});const _0x3762fc=a27_0x3be399[_0x17f7c7(0x275)](process['cwd'](),_0xe67ffb);if(existsSync(_0xe67ffb)){const _0x3d035b=readFileSync(_0xe67ffb,_0x17f7c7(0x229)),_0x42d9e8=generateDiff(_0x3d035b,_0x322544),_0x142a5a=hasChanges(_0x42d9e8);_0x35991f[_0x17f7c7(0x228)]({'relativePath':_0x3762fc,'absolutePath':_0xe67ffb,'content':_0x322544,'isNew':![],'hasChanges':_0x142a5a,'diff':_0x142a5a?formatDiffWithColors(_0x42d9e8):undefined});}else _0x35991f['push']({'relativePath':_0x3762fc,'absolutePath':_0xe67ffb,'content':_0x322544,'isNew':!![],'hasChanges':![]});}const _0x81c9f=_0x35991f[_0x17f7c7(0x1c3)](_0x537651=>_0x537651['isNew']),_0x5b6695=_0x35991f['filter'](_0x5461b8=>!_0x5461b8[_0x17f7c7(0x220)]&&_0x5461b8[_0x17f7c7(0x1ec)]),_0x5aa4a3=_0x35991f[_0x17f7c7(0x1c3)](_0x503666=>!_0x503666[_0x17f7c7(0x220)]&&!_0x503666[_0x17f7c7(0x1ec)]),_0x538fea=_0x44aae5[_0x17f7c7(0x206)],_0x369eb1=_0x48e3f8[_0x17f7c7(0x25d)],_0x12408c=_0x538fea>_0x369eb1?'\x20('+_0x538fea+_0x17f7c7(0x2b8):'';console[_0x17f7c7(0x24c)](_0x17f7c7(0x1c9)),console[_0x17f7c7(0x24c)]('\x20\x20'+a27_0x50d849['cyan'](_0x369eb1+_0x17f7c7(0x242))+a27_0x50d849['dim'](_0x12408c)),console[_0x17f7c7(0x24c)]('\x20\x20'+a27_0x50d849['green']('+\x20'+_0x81c9f['length']+'\x20new\x20files')),console['error']('\x20\x20'+a27_0x50d849[_0x17f7c7(0x29a)]('~\x20'+_0x5b6695[_0x17f7c7(0x206)]+_0x17f7c7(0x287))),console[_0x17f7c7(0x24c)]('\x20\x20'+a27_0x50d849['dim']('=\x20'+_0x5aa4a3[_0x17f7c7(0x206)]+'\x20unchanged\x20files')),console[_0x17f7c7(0x24c)](_0x17f7c7(0x1d8)+a27_0x50d849[_0x17f7c7(0x1dc)](_0x27d0ee)+'\x0a');if(_0x5b6695[_0x17f7c7(0x206)]>0x0)for(const _0x1c5a96 of _0x5b6695){console[_0x17f7c7(0x24c)](_0x17f7c7(0x1c6)+_0x1c5a96[_0x17f7c7(0x22a)]+'\x27:'),console[_0x17f7c7(0x24c)]('─'['repeat'](0x3c)),console[_0x17f7c7(0x24c)](_0x1c5a96['diff']),console[_0x17f7c7(0x24c)]('─'['repeat'](0x3c));}if(_0x42603a[_0x17f7c7(0x261)])return console['error'](a27_0x50d849[_0x17f7c7(0x29a)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x81c9f[_0x17f7c7(0x206)]===0x0&&_0x5b6695[_0x17f7c7(0x206)]===0x0)return console[_0x17f7c7(0x24c)](a27_0x50d849[_0x17f7c7(0x1ee)](_0x17f7c7(0x2a5))),saveSessionContext({'parent_segment':_0x4a2652},_0x42603a[_0x17f7c7(0x1ca)]),console[_0x17f7c7(0x24c)](a27_0x50d849[_0x17f7c7(0x1ee)]('✔\x20Context\x20set:\x20'+a27_0x50d849[_0x17f7c7(0x286)](_0x17f7c7(0x289))+_0x17f7c7(0x25f)+a27_0x50d849['cyan'](_0x4a2652))),0x0;if(!_0x42603a[_0x17f7c7(0x256)]&&(_0x81c9f[_0x17f7c7(0x206)]>0x0||_0x5b6695['length']>0x0)){if(!isInteractive())return console['error'](a27_0x50d849[_0x17f7c7(0x201)]('\x0aError:'),_0x17f7c7(0x26b)),console['error'](a27_0x50d849[_0x17f7c7(0x286)](_0x17f7c7(0x233))),0x1;const _0x1133ab=await confirmKey(_0x17f7c7(0x264)+(_0x81c9f[_0x17f7c7(0x206)]+_0x5b6695['length'])+_0x17f7c7(0x203));if(!_0x1133ab)return console['error'](a27_0x50d849[_0x17f7c7(0x29a)](_0x17f7c7(0x1e1)),_0x17f7c7(0x28f)),0x1;}!existsSync(_0x27d0ee)&&mkdirSync(_0x27d0ee,{'recursive':!![]});const _0x291ce9=a27_0x3be399[_0x17f7c7(0x1c7)](_0x27d0ee,_0x17f7c7(0x211));writeFileSync(_0x291ce9,createTdxConfigContent(_0x4a2652),_0x17f7c7(0x229));for(const _0x4e69bb of _0x35991f){(_0x4e69bb[_0x17f7c7(0x220)]||_0x4e69bb['hasChanges'])&&writeFileSync(_0x4e69bb[_0x17f7c7(0x259)],_0x4e69bb[_0x17f7c7(0x21c)],'utf-8');}return console['error'](a27_0x50d849['green'](_0x17f7c7(0x2ac)+(_0x81c9f[_0x17f7c7(0x206)]+_0x5b6695[_0x17f7c7(0x206)])+_0x17f7c7(0x1d3)+_0x27d0ee)),saveSessionContext({'parent_segment':_0x4a2652},_0x42603a['session']),console[_0x17f7c7(0x24c)](a27_0x50d849[_0x17f7c7(0x1ee)]('✔\x20Context\x20set:\x20'+a27_0x50d849[_0x17f7c7(0x286)](_0x17f7c7(0x289))+_0x17f7c7(0x25f)+a27_0x50d849[_0x17f7c7(0x1dc)](_0x4a2652))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']=a27_0x19f833(0x1d6);[a27_0x19f833(0x288)]='Show\x20journey\x20table\x20column\x20mapping';async[a27_0x19f833(0x291)](_0x1e1e7e){const _0x49f550=a27_0x19f833,{options:_0x2781f2,args:_0x3a8d55,tdx:_0x27703d}=_0x1e1e7e,_0x28135e=_0x3a8d55[0x0];if(!requireNameOrPath(_0x28135e))return 0x1;_0x2781f2[_0x49f550(0x204)]&&console[_0x49f550(0x24c)]('Input:\x20'+_0x28135e);const {journeyId:_0x54add4}=await resolveJourneyIdFromInput(_0x28135e,_0x2781f2,_0x27703d),_0x542645=await withSpinner('Getting\x20column\x20mapping...',()=>_0x27703d[_0x49f550(0x23a)][_0x49f550(0x1d7)](_0x54add4),{'verbose':_0x2781f2[_0x49f550(0x204)]}),_0x2bf590=_0x542645[_0x49f550(0x1f9)];return console[_0x49f550(0x28d)](_0x49f550(0x24b)+_0x2bf590[_0x49f550(0x1b9)]),console[_0x49f550(0x28d)](_0x49f550(0x270)+_0x2bf590[_0x49f550(0x252)]),await handleSDKOutput(_0x2bf590[_0x49f550(0x1e0)],_0x2781f2),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x19f833(0x273)]=a27_0x19f833(0x22d);[a27_0x19f833(0x288)]=a27_0x19f833(0x290);async[a27_0x19f833(0x291)](_0x554135){const _0x54eb29=a27_0x19f833,{options:_0x2a5c3c,args:_0x297d94,tdx:_0x2f8d45}=_0x554135,_0xd6b5b8=_0x297d94[0x0];if(!requireNameOrPath(_0xd6b5b8))return 0x1;_0x2a5c3c[_0x54eb29(0x204)]&&console[_0x54eb29(0x24c)](_0x54eb29(0x1dd)+_0xd6b5b8);const {journeyId:_0x33b700}=await resolveJourneyIdFromInput(_0xd6b5b8,_0x2a5c3c,_0x2f8d45),_0x1feebe=await withSpinner('Listing\x20journey\x20activations...',()=>_0x2f8d45[_0x54eb29(0x23a)]['listActivationsFlat'](_0x33b700),{'verbose':_0x2a5c3c[_0x54eb29(0x204)]}),_0x5a70fa=_0x1feebe['data'];return console[_0x54eb29(0x24c)](_0x54eb29(0x266)+_0x5a70fa[_0x54eb29(0x206)]+_0x54eb29(0x2a2)+(_0x5a70fa[_0x54eb29(0x206)]!==0x1?'s':'')),await handleSDKOutput(_0x5a70fa,_0x2a5c3c),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x19f833(0x273)]='journey:push';[a27_0x19f833(0x288)]=a27_0x19f833(0x269);[a27_0x19f833(0x1cf)]=new SegmentPushCommand();async['execute'](_0x23975d){const _0x321d76=a27_0x19f833,_0x20ab19=_0x23975d[_0x321d76(0x245)][0x0];let _0x529c83;if(_0x20ab19){const _0x202dd3=await resolveTarget({'arg':_0x20ab19,'contextParent':_0x23975d[_0x321d76(0x296)][_0x321d76(0x21f)],'cwd':process[_0x321d76(0x241)]()});isSuccessfulResolution(_0x202dd3)&&_0x202dd3[_0x321d76(0x27d)]==='file'&&(_0x529c83=_0x202dd3[_0x321d76(0x1ac)]);}const _0x32d0d0={..._0x23975d,'options':{..._0x23975d['options'],'journeysOnly':!![],..._0x529c83&&{'singleFilePath':_0x529c83}}};return this['segmentPushCommand'][_0x321d76(0x291)](_0x32d0d0);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x19f833(0x273)]=a27_0x19f833(0x236);[a27_0x19f833(0x288)]=a27_0x19f833(0x1ad);async[a27_0x19f833(0x291)](_0x48c85a){const _0x3b3e0c=a27_0x19f833,{options:_0x193e06,args:_0x160f0d,tdx:_0x1f99bf}=_0x48c85a,_0xa8191d=_0x160f0d[0x0];if(!requireNameOrPath(_0xa8191d))return 0x1;if(_0x193e06[_0x3b3e0c(0x204)])console[_0x3b3e0c(0x24c)](_0x3b3e0c(0x1dd)+_0xa8191d);const {journeyId:_0x254a4d}=await resolveJourneyIdFromInput(_0xa8191d,_0x193e06,_0x1f99bf),_0x38695d=await withSpinner(_0x3b3e0c(0x1cc),()=>_0x1f99bf[_0x3b3e0c(0x23a)]['listVersions'](_0x254a4d),{'verbose':_0x193e06['verbose']}),{bundleName:_0x25e71a,versions:_0x1b1021,latestJourneyId:_0x5a19f3}=_0x38695d[_0x3b3e0c(0x1f9)];console['error'](_0x25e71a+':\x20'+_0x1b1021[_0x3b3e0c(0x206)]+_0x3b3e0c(0x2aa)+(_0x1b1021[_0x3b3e0c(0x206)]!==0x1?'s':''));const _0x3f7eb7=_0x1b1021[_0x3b3e0c(0x29c)](_0x2ee19c=>({'version':_0x2ee19c['versionNumber'],'journey_id':_0x2ee19c[_0x3b3e0c(0x279)],'name':_0x2ee19c[_0x3b3e0c(0x273)],'state':_0x2ee19c['state'],'paused':_0x2ee19c['paused'],'latest':_0x2ee19c[_0x3b3e0c(0x279)]===_0x5a19f3,'created_at':_0x2ee19c['createdAt']}));return await handleSDKOutput(_0x3f7eb7,_0x193e06),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']='journey:version:create';[a27_0x19f833(0x288)]=a27_0x19f833(0x1f5);async[a27_0x19f833(0x291)](_0x55209b){const _0x11fa03=a27_0x19f833,{options:_0x5ab5e2,args:_0x2b0b39,tdx:_0x16ba5a}=_0x55209b,_0x5b038e=_0x2b0b39[0x0];if(!requireNameOrPath(_0x5b038e))return 0x1;if(_0x5ab5e2[_0x11fa03(0x204)])console[_0x11fa03(0x24c)](_0x11fa03(0x1dd)+_0x5b038e);const {journeyId:_0x1c7205,journeyName:_0x54b24c}=await resolveJourneyIdFromInput(_0x5b038e,_0x5ab5e2,_0x16ba5a);if(!_0x5ab5e2[_0x11fa03(0x256)]){const _0x3a24ca=await confirm(_0x11fa03(0x215)+_0x54b24c+'\x22?');if(!_0x3a24ca)return console['error']('Cancelled'),0x0;}const _0x2b5817=await withSpinner('Creating\x20new\x20version...',()=>_0x16ba5a[_0x11fa03(0x23a)][_0x11fa03(0x298)](_0x1c7205),{'verbose':_0x5ab5e2[_0x11fa03(0x204)]}),_0x245e0e=_0x2b5817[_0x11fa03(0x1f9)];return console[_0x11fa03(0x24c)](a27_0x50d849['green']('✔')+_0x11fa03(0x23c)+_0x245e0e['attributes'][_0x11fa03(0x258)]+_0x11fa03(0x257)+_0x245e0e[_0x11fa03(0x2b5)][_0x11fa03(0x273)]+'\x22'),console[_0x11fa03(0x24c)](_0x11fa03(0x281)+_0x245e0e['id']),await handleSingleObjectOutput({'id':_0x245e0e['id'],'name':_0x245e0e[_0x11fa03(0x2b5)][_0x11fa03(0x273)],'version':_0x245e0e[_0x11fa03(0x2b5)][_0x11fa03(0x258)],'state':_0x245e0e[_0x11fa03(0x2b5)][_0x11fa03(0x27f)],'bundle_id':_0x245e0e[_0x11fa03(0x2b5)][_0x11fa03(0x262)],'created_at':_0x245e0e[_0x11fa03(0x2b5)][_0x11fa03(0x1bd)]},_0x5ab5e2),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x19f833(0x273)]=a27_0x19f833(0x282);[a27_0x19f833(0x288)]=a27_0x19f833(0x200);async['execute'](_0x24b66c){const _0x19dbf3=a27_0x19f833,{options:_0x1623ca,args:_0x52ba31,tdx:_0x23aa84}=_0x24b66c,_0x229b40=_0x52ba31[0x0];if(!requireNameOrPath(_0x229b40))return 0x1;const _0x1291f1=_0x1623ca['version'];if(!_0x1291f1)return console[_0x19dbf3(0x24c)](_0x19dbf3(0x1e9)),console[_0x19dbf3(0x24c)]('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x18b584=parseInt(_0x1291f1,0xa);if(isNaN(_0x18b584)||_0x18b584<0x1)return console[_0x19dbf3(0x24c)](_0x19dbf3(0x22e)+_0x1291f1),0x1;if(_0x1623ca[_0x19dbf3(0x204)])console['error'](_0x19dbf3(0x1dd)+_0x229b40+_0x19dbf3(0x1e4)+_0x18b584);const {journeyId:_0x2d4f02,parentSegmentId:_0x24f63c}=await resolveJourneyIdFromInput(_0x229b40,_0x1623ca,_0x23aa84),_0x45038b=await withSpinner('Resolving\x20version...',()=>_0x23aa84[_0x19dbf3(0x23a)][_0x19dbf3(0x2b7)](_0x2d4f02),{'verbose':_0x1623ca[_0x19dbf3(0x204)]}),{versions:_0x49773,latestJourneyId:_0x2c86ea}=_0x45038b[_0x19dbf3(0x1f9)],_0x1165e6=_0x49773[_0x19dbf3(0x297)](_0x4b5574=>_0x4b5574[_0x19dbf3(0x258)]===_0x18b584);if(!_0x1165e6){const _0x1e0874=_0x49773[_0x19dbf3(0x29c)](_0x8c653e=>'v'+_0x8c653e['versionNumber'])[_0x19dbf3(0x1c7)](',\x20');return console[_0x19dbf3(0x24c)](_0x19dbf3(0x1eb)+_0x18b584+_0x19dbf3(0x284)+_0x1e0874),0x1;}const _0x132947=await withSpinner(_0x19dbf3(0x1b1)+_0x18b584+_0x19dbf3(0x216),()=>_0x23aa84[_0x19dbf3(0x23a)][_0x19dbf3(0x2ad)](_0x1165e6[_0x19dbf3(0x279)]),{'verbose':_0x1623ca[_0x19dbf3(0x204)]}),_0x1b39bb=_0x132947[_0x19dbf3(0x1f9)],_0x5e6168=getConsoleNextUrl(_0x1623ca['site'],'/app/ps/'+_0x24f63c+_0x19dbf3(0x238)+_0x1165e6['journeyId']+_0x19dbf3(0x2ab));return await handleSingleObjectOutput({'id':_0x1b39bb['id'],'name':_0x1b39bb[_0x19dbf3(0x2b5)]['name'],'version':_0x1b39bb['attributes'][_0x19dbf3(0x258)],'description':_0x1b39bb[_0x19dbf3(0x2b5)][_0x19dbf3(0x288)],'state':_0x1b39bb[_0x19dbf3(0x2b5)][_0x19dbf3(0x27f)],'paused':_0x1b39bb[_0x19dbf3(0x2b5)]['paused'],'reentry_mode':_0x1b39bb[_0x19dbf3(0x2b5)]['reentryMode'],'stages':_0x1b39bb[_0x19dbf3(0x2b5)][_0x19dbf3(0x21a)]?.[_0x19dbf3(0x206)]||0x0,..._0x1b39bb[_0x19dbf3(0x2b5)][_0x19dbf3(0x268)]&&{'goal':_0x1b39bb[_0x19dbf3(0x2b5)][_0x19dbf3(0x268)][_0x19dbf3(0x273)]},'latest':_0x1165e6[_0x19dbf3(0x279)]===_0x2c86ea,'created_at':_0x1b39bb[_0x19dbf3(0x2b5)][_0x19dbf3(0x1bd)],'updated_at':_0x1b39bb['attributes'][_0x19dbf3(0x272)],'url':_0x5e6168},_0x1623ca),0x0;}}
1
+ const a27_0x2ff97d=a27_0x50cd;(function(_0x5a619b,_0xec379d){const _0x505315=a27_0x50cd,_0x230d70=_0x5a619b();while(!![]){try{const _0x5d92eb=-parseInt(_0x505315(0x17d))/0x1+-parseInt(_0x505315(0x1b7))/0x2+parseInt(_0x505315(0x1c6))/0x3+-parseInt(_0x505315(0x16b))/0x4*(parseInt(_0x505315(0x1dc))/0x5)+-parseInt(_0x505315(0x1c9))/0x6*(-parseInt(_0x505315(0x1ba))/0x7)+parseInt(_0x505315(0x204))/0x8*(-parseInt(_0x505315(0x267))/0x9)+-parseInt(_0x505315(0x255))/0xa*(-parseInt(_0x505315(0x1bf))/0xb);if(_0x5d92eb===_0xec379d)break;else _0x230d70['push'](_0x230d70['shift']());}catch(_0x531654){_0x230d70['push'](_0x230d70['shift']());}}}(a27_0x2f42,0x75089));import a27_0x128894 from'chalk';import a27_0x4955f1 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';function a27_0x50cd(_0x141541,_0x558fcf){_0x141541=_0x141541-0x165;const _0x2f4233=a27_0x2f42();let _0x50cdfd=_0x2f4233[_0x141541];return _0x50cdfd;}import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x1555a3){const _0x5a439f=a27_0x50cd;return!_0x1555a3&&(console['error'](_0x5a439f(0x219)),console[_0x5a439f(0x23f)](_0x5a439f(0x262))),!!_0x1555a3;}function withJsonFormat(_0x25f22d){const _0x5c787b=a27_0x50cd;if(!_0x25f22d['format']&&!_0x25f22d[_0x5c787b(0x1e7)]&&!_0x25f22d[_0x5c787b(0x1d3)]&&!_0x25f22d[_0x5c787b(0x24a)])return{..._0x25f22d,'format':'json','json':!![]};return _0x25f22d;}function formatJourneyState(_0x5da3c8){const _0x163553=a27_0x50cd;switch(_0x5da3c8){case _0x163553(0x199):return a27_0x128894[_0x163553(0x233)]('(running)');case'draft':return a27_0x128894[_0x163553(0x173)](_0x163553(0x21f));case'paused':return a27_0x128894[_0x163553(0x1a3)](_0x163553(0x1ff));case'completed':return a27_0x128894[_0x163553(0x25b)]('(completed)');case'archived':return a27_0x128894[_0x163553(0x173)]('(archived)');default:return'('+_0x5da3c8+')';}}function formatJourneyItem(_0x2a8c73,_0x4001c3='',_0x36d383){const _0xb5d76f=a27_0x50cd,_0x34ca6b=formatJourneyState(_0x2a8c73['state']),_0x113adf=_0x36d383?hyperlink(_0x2a8c73[_0xb5d76f(0x1b8)],_0x36d383):_0x2a8c73['journeyBundleName'];return _0x4001c3+_0xb5d76f(0x180)+_0x113adf+'\x20'+_0x34ca6b;}function escapeRegex(_0x3ab8d6){const _0x134639=a27_0x50cd;return _0x3ab8d6['replace'](/[.*+?^${}()|[\]\\]/g,_0x134639(0x1ef));}function globToRegex(_0x3ed598){const _0x481b5d=a27_0x50cd,_0x17f402=_0x3ed598['split']('*')['map'](escapeRegex);return new RegExp(_0x17f402[_0x481b5d(0x19b)]('.*'),'i');}function buildRuleToNameMapping(_0x11fe1e){const _0x5ae3b2=a27_0x50cd,_0x1e1cb0=new Map();if(_0x11fe1e[_0x5ae3b2(0x18b)])for(const [_0x38bd63,_0x4fe00c]of Object[_0x5ae3b2(0x266)](_0x11fe1e[_0x5ae3b2(0x18b)])){if(_0x4fe00c[_0x5ae3b2(0x1f2)]){const _0x1217a1=serializeRule(_0x4fe00c[_0x5ae3b2(0x1f2)]),_0x5e2cc6=_0x1e1cb0[_0x5ae3b2(0x191)](_0x1217a1);_0x5e2cc6?_0x5e2cc6[_0x5ae3b2(0x16a)](_0x38bd63):_0x1e1cb0[_0x5ae3b2(0x222)](_0x1217a1,[_0x38bd63]);}}return _0x1e1cb0;}async function resolveJourneyIdFromInput(_0x1ba021,_0x5c64ca,_0x820038){const _0x3d8f20=a27_0x50cd,_0x458076=await resolveJourneyTarget(_0x1ba021,_0x5c64ca[_0x3d8f20(0x1f8)],_0x5c64ca[_0x3d8f20(0x237)]),_0x736fdb=_0x458076['parentSegment'];if(!_0x736fdb)throw new SDKError(ErrorCode[_0x3d8f20(0x21a)],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0x118b3c=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x820038['segment'][_0x3d8f20(0x1ca)](_0x736fdb),{'verbose':_0x5c64ca[_0x3d8f20(0x237)]}),_0x1a3292=_0x118b3c['data'],_0x26f067=await withSpinner('Resolving\x20journey...',()=>_0x820038[_0x3d8f20(0x1d7)]['resolveJourneyId'](_0x1a3292,_0x458076[_0x3d8f20(0x216)]),{'verbose':_0x5c64ca[_0x3d8f20(0x237)]});return{'journeyId':_0x26f067['data'],'journeyName':_0x458076[_0x3d8f20(0x216)],'parentSegmentId':_0x1a3292};}async function resolveJourneyTarget(_0x12a4dc,_0x920a78,_0x46ca57){const _0x4480e6=a27_0x50cd;if(isYamlFilePath(_0x12a4dc))try{const _0x2b30e9=await resolveYamlFilePath(_0x12a4dc);return _0x46ca57&&(console[_0x4480e6(0x23f)]('Resolved\x20YAML\x20file:\x20'+_0x12a4dc),console[_0x4480e6(0x23f)](_0x4480e6(0x195)+_0x2b30e9[_0x4480e6(0x1f8)]),console['error']('\x20\x20Name:\x20'+_0x2b30e9[_0x4480e6(0x24e)]),console[_0x4480e6(0x23f)](_0x4480e6(0x1f5)+(_0x2b30e9[_0x4480e6(0x1da)]||_0x4480e6(0x1fe)))),{'journeyName':_0x2b30e9['segmentName'],'parentSegment':_0x2b30e9['parentSegment'],'resolved':_0x2b30e9};}catch(_0xb74c47){throw new SDKError(ErrorCode[_0x4480e6(0x21a)],_0x4480e6(0x25f)+_0xb74c47[_0x4480e6(0x212)]);}if(!_0x920a78)throw new SDKError(ErrorCode[_0x4480e6(0x21a)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x12a4dc,'parentSegment':_0x920a78};}export class JourneyListCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]=a27_0x2ff97d(0x189);[a27_0x2ff97d(0x1c7)]=a27_0x2ff97d(0x23d);async['execute'](_0x5115c6){const _0x285163=a27_0x2ff97d,{options:_0x10a208,args:_0x3bb6bc,tdx:_0x41552c}=_0x5115c6,_0x2b8fa4=_0x3bb6bc[0x0],_0x4de2b5=_0x10a208['parentSegment'];if(!_0x4de2b5)return console[_0x285163(0x23f)](_0x285163(0x170)),console[_0x285163(0x23f)](_0x285163(0x181)),0x1;const _0x40470d=await withSpinner(_0x285163(0x1c5),()=>_0x41552c['segment']['resolveParentId'](_0x4de2b5),{'verbose':_0x10a208['verbose']}),_0x1ead40=_0x40470d[_0x285163(0x1ed)];_0x10a208[_0x285163(0x237)]&&(console['error'](_0x285163(0x254)+_0x4de2b5+_0x285163(0x24d)+_0x1ead40+')'),_0x2b8fa4&&console[_0x285163(0x23f)](_0x285163(0x198)+_0x2b8fa4));const _0x1e3f53=await withSpinner(_0x285163(0x214),()=>_0x41552c[_0x285163(0x258)][_0x285163(0x25d)](_0x1ead40),{'verbose':_0x10a208[_0x285163(0x237)]}),_0x1550be=_0x1e3f53[_0x285163(0x1ed)],_0x20a11b=_0x1550be['rootFolderId'],_0x11d0ab=await withSpinner(_0x285163(0x1aa),()=>_0x41552c[_0x285163(0x1d7)][_0x285163(0x241)](_0x1ead40,_0x20a11b),{'verbose':_0x10a208[_0x285163(0x237)]});let _0xbe3165=_0x11d0ab[_0x285163(0x1ed)][_0x285163(0x22d)];const _0x1266eb=_0x11d0ab[_0x285163(0x1ed)]['folders'],_0x348b9c=new Map();for(const _0x31bdab of _0x1266eb){_0x348b9c[_0x285163(0x222)](_0x31bdab['id'],_0x31bdab[_0x285163(0x1e0)]);}if(_0x2b8fa4){const _0x2a72fd=globToRegex(_0x2b8fa4);_0xbe3165=_0xbe3165[_0x285163(0x168)](_0x181d23=>_0x2a72fd[_0x285163(0x1c3)](_0x181d23[_0x285163(0x1b8)]));}console[_0x285163(0x23f)](_0x285163(0x1fd)+_0xbe3165['length']+_0x285163(0x1e8)+(_0xbe3165[_0x285163(0x16c)]!==0x1?'s':''));const _0x352751=_0x29bbd9=>{const _0xec3182=_0x285163;return getConsoleNextUrl(_0x10a208[_0xec3182(0x16e)],_0xec3182(0x176)+_0x1ead40+'/e/'+_0x29bbd9+_0xec3182(0x1a5));};if(_0x10a208['format']===_0x285163(0x184))await handleSDKOutput(_0xbe3165,_0x10a208);else{if(_0x10a208[_0x285163(0x185)]===_0x285163(0x1e7)){const _0x24c126=_0xbe3165[_0x285163(0x256)](_0x983e3f=>({..._0x983e3f,'url':_0x352751(_0x983e3f['id'])}));await handleSDKOutput(_0x24c126,_0x10a208);}else{console['log']('['+_0x4de2b5+']');const _0x14d736=new Map(),_0x437566=[];for(const _0x3f228a of _0xbe3165){if(!_0x3f228a[_0x285163(0x1a6)]||_0x3f228a['folderId']===_0x20a11b)_0x437566['push'](_0x3f228a);else{const _0x141923=_0x14d736[_0x285163(0x191)](_0x3f228a[_0x285163(0x1a6)])||[];_0x141923[_0x285163(0x16a)](_0x3f228a),_0x14d736[_0x285163(0x222)](_0x3f228a[_0x285163(0x1a6)],_0x141923);}}const _0xf6d262=(_0x4bc3d7,_0x4109d3)=>_0x4bc3d7[_0x285163(0x1b8)][_0x285163(0x19f)](_0x4109d3['journeyBundleName'],undefined,{'sensitivity':_0x285163(0x172)});_0x437566[_0x285163(0x240)](_0xf6d262);for(const _0x31f9db of _0x437566){console['log'](formatJourneyItem(_0x31f9db,'',_0x352751(_0x31f9db['id'])));}const _0x1131de=[..._0x14d736['entries']()][_0x285163(0x240)]((_0x2b2de8,_0x5cee02)=>{const _0x1f5299=_0x285163,_0x1d9dd6=_0x348b9c['get'](_0x2b2de8[0x0])||_0x2b2de8[0x0],_0xa016b2=_0x348b9c['get'](_0x5cee02[0x0])||_0x5cee02[0x0];return _0x1d9dd6[_0x1f5299(0x19f)](_0xa016b2,undefined,{'sensitivity':_0x1f5299(0x172)});});for(const [_0xa501ae,_0x3999d8]of _0x1131de){const _0x56709d=_0x348b9c[_0x285163(0x191)](_0xa501ae)||_0xa501ae;console[_0x285163(0x223)](_0x285163(0x1d5)+_0x56709d),_0x3999d8[_0x285163(0x240)](_0xf6d262);for(const _0x1a9368 of _0x3999d8){console[_0x285163(0x223)](formatJourneyItem(_0x1a9368,'\x20\x20',_0x352751(_0x1a9368['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]=a27_0x2ff97d(0x251);[a27_0x2ff97d(0x1c7)]=a27_0x2ff97d(0x1c4);async['execute'](_0x2fc80d){const _0x2a5297=a27_0x2ff97d,{options:_0x520115,args:_0x13c196,tdx:_0x115633}=_0x2fc80d,_0x1bf9b3=_0x13c196[0x0];if(!_0x1bf9b3)return console[_0x2a5297(0x23f)](_0x2a5297(0x219)),console[_0x2a5297(0x23f)](_0x2a5297(0x220)),console[_0x2a5297(0x23f)](_0x2a5297(0x217)),console['error']('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x520115['verbose']&&console[_0x2a5297(0x23f)](_0x2a5297(0x23c)+_0x1bf9b3);const {journeyId:_0x4bcec6,parentSegmentId:_0x5beb21}=await resolveJourneyIdFromInput(_0x1bf9b3,_0x520115,_0x115633);if(_0x520115['web']){const _0x4d0d24=getConsoleNextUrl(_0x520115['site'],'/app/ps/'+_0x5beb21+_0x2a5297(0x23b)+_0x4bcec6+_0x2a5297(0x1b4));return console[_0x2a5297(0x23f)](a27_0x128894[_0x2a5297(0x233)]('✔')+_0x2a5297(0x20a)+a27_0x128894['cyan'](_0x4d0d24)),openBrowser(_0x4d0d24),0x0;}const _0x2f8b5c=await withSpinner(_0x2a5297(0x179),()=>_0x115633[_0x2a5297(0x1d7)][_0x2a5297(0x186)](_0x4bcec6),{'verbose':_0x520115[_0x2a5297(0x237)]}),_0x4379ac=_0x2f8b5c[_0x2a5297(0x1ed)],_0x396643=_0x520115[_0x2a5297(0x201)];let _0x2e2b5f;if(_0x396643)try{const _0x36f81c=await withSpinner(_0x2a5297(0x1ea),()=>_0x115633[_0x2a5297(0x1d7)][_0x2a5297(0x245)](_0x4bcec6),{'verbose':_0x520115[_0x2a5297(0x237)]});_0x2e2b5f=_0x36f81c[_0x2a5297(0x1ed)];}catch{_0x520115['verbose']&&console[_0x2a5297(0x23f)]('\x20\x20Statistics\x20not\x20available');}const _0x41aa2a=getConsoleNextUrl(_0x520115[_0x2a5297(0x16e)],'/app/ps/'+_0x5beb21+_0x2a5297(0x23b)+_0x4bcec6+'/j/da/je'),_0x3838a0={'id':_0x4379ac['id'],'name':_0x4379ac[_0x2a5297(0x238)][_0x2a5297(0x1e0)],'description':_0x4379ac['attributes'][_0x2a5297(0x1c7)],'state':_0x4379ac[_0x2a5297(0x238)][_0x2a5297(0x22f)],'paused':_0x4379ac['attributes']['paused'],'reentry_mode':_0x4379ac[_0x2a5297(0x238)]['reentryMode'],'stages':_0x4379ac[_0x2a5297(0x238)][_0x2a5297(0x213)]?.[_0x2a5297(0x16c)]||0x0,..._0x4379ac[_0x2a5297(0x238)]['goal']&&{'goal':_0x4379ac['attributes']['goal'][_0x2a5297(0x1e0)]},..._0x2e2b5f&&{'statistics':{'size':_0x2e2b5f[_0x2a5297(0x196)],'entered':_0x2e2b5f[_0x2a5297(0x177)],'goal_achieved':_0x2e2b5f[_0x2a5297(0x1a0)],'completion_rate':_0x2e2b5f[_0x2a5297(0x175)],'exit_or_jump':_0x2e2b5f[_0x2a5297(0x261)],'exit_or_jump_rate':_0x2e2b5f[_0x2a5297(0x187)],'stages':_0x2e2b5f['stages']}},'url':_0x41aa2a};return await handleSingleObjectOutput(_0x3838a0,_0x520115),0x0;}}export class JourneyStatsCommand extends BaseCommand{['name']=a27_0x2ff97d(0x1e4);['description']=a27_0x2ff97d(0x21b);async[a27_0x2ff97d(0x183)](_0x233997){const _0x3142ec=a27_0x2ff97d,{options:_0x41140f,args:_0x4d0818,tdx:_0x34acd6}=_0x233997,_0x43b907=_0x4d0818[0x0];if(!requireNameOrPath(_0x43b907))return 0x1;_0x41140f[_0x3142ec(0x237)]&&console[_0x3142ec(0x23f)](_0x3142ec(0x23c)+_0x43b907);const _0x7eae86=_0x41140f,_0x1398ac=_0x7eae86[_0x3142ec(0x24f)],_0xde4524=_0x7eae86['to'],_0x2ddf28=_0x7eae86[_0x3142ec(0x1d6)],_0x5f0a36=_0x7eae86[_0x3142ec(0x208)];_0x2ddf28&&!_0x1398ac&&!_0xde4524&&console[_0x3142ec(0x23f)](_0x3142ec(0x1ec));const _0x156de1=_0x2ddf28?withJsonFormat(_0x41140f):_0x41140f,{journeyId:_0xd9c77e,journeyName:_0x6f1d3c}=await resolveJourneyIdFromInput(_0x43b907,_0x156de1,_0x34acd6),_0x581ea0=_0x1398ac||_0xde4524?{'from':_0x1398ac,'to':_0xde4524}:undefined,_0x13a117=await withSpinner(_0x3142ec(0x1ea),()=>Promise[_0x3142ec(0x234)]([_0x34acd6[_0x3142ec(0x1d7)][_0x3142ec(0x186)](_0xd9c77e),_0x34acd6[_0x3142ec(0x1d7)]['getStatistics'](_0xd9c77e,_0x581ea0)]),{'verbose':_0x156de1[_0x3142ec(0x237)]}),[_0x3ddb60,_0x3bb7e6]=_0x13a117[_0x3142ec(0x1ed)];if(!_0x3bb7e6||_0x3bb7e6['journeyId']===null)return console[_0x3142ec(0x23f)]('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x6f1d3c),console[_0x3142ec(0x23f)]('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x3e7101=buildStageNameMap(_0x3ddb60),_0x504300=!!(_0x581ea0&&_0x3bb7e6[_0x3142ec(0x1f6)]?.[_0x3142ec(0x16c)]),_0x54b60c={'stageNameMap':_0x3e7101,'hasPeriod':_0x504300,'includeHistory':!!_0x2ddf28};if(_0x5f0a36&&_0x3bb7e6[_0x3142ec(0x1e5)]){const _0x3bac93=_0x3bb7e6[_0x3142ec(0x1e5)]['find'](_0x470630=>{const _0x161d2a=_0x3142ec,_0x486f91=_0x3e7101[_0x161d2a(0x191)](_0x470630['id'])??'';return _0x486f91[_0x161d2a(0x1be)]()===_0x5f0a36[_0x161d2a(0x1be)]();});if(_0x3bac93)return await handleSingleObjectOutput(formatStageStats(_0x3bac93,_0x54b60c),_0x156de1),0x0;const _0x19457d=_0x3bb7e6[_0x3142ec(0x1e5)][_0x3142ec(0x256)](_0x434764=>_0x3e7101[_0x3142ec(0x191)](_0x434764['id'])??_0x434764['id']);return console[_0x3142ec(0x23f)](_0x3142ec(0x1a9)+_0x5f0a36+_0x3142ec(0x227)),console[_0x3142ec(0x23f)]('Available\x20stages:\x20'+_0x19457d[_0x3142ec(0x19b)](',\x20')),0x1;}const _0xf1b966=_0x3bb7e6['stages']?.[_0x3142ec(0x256)](_0x5bdb5d=>formatStageStats(_0x5bdb5d,_0x54b60c)),_0x564563=assembleJourneyStats(_0x3bb7e6,{'from':_0x1398ac,'to':_0xde4524,'includeHistory':_0x2ddf28});return await this[_0x3142ec(0x19e)](_0x564563,_0xf1b966??[],_0x156de1),0x0;}async[a27_0x2ff97d(0x19e)](_0x30d327,_0x60bb06,_0x344366){const _0x55b144=a27_0x2ff97d,_0x1459e1=_0x344366[_0x55b144(0x185)]===_0x55b144(0x1e7)||_0x344366[_0x55b144(0x185)]===_0x55b144(0x1d3)||_0x344366[_0x55b144(0x1e7)]||_0x344366['jsonl'];if(_0x1459e1){_0x30d327[_0x55b144(0x1e5)]=_0x60bb06,await handleSingleObjectOutput(_0x30d327,_0x344366);return;}await handleSingleObjectOutput(_0x30d327,_0x344366);for(const _0x52418a of _0x60bb06){console[_0x55b144(0x223)](''),console[_0x55b144(0x223)](String(a27_0x128894[_0x55b144(0x226)][_0x55b144(0x174)]('['+_0x52418a[_0x55b144(0x1e0)]+']'))+a27_0x128894[_0x55b144(0x173)]('\x20'+_0x52418a['id']));const {id:_0x8b73bf,name:_0x1b7a9b,..._0x20a9ed}=_0x52418a;await handleSingleObjectOutput(_0x20a9ed,_0x344366);}}}export class JourneyTrafficCommand extends BaseCommand{['name']='journey:traffic';[a27_0x2ff97d(0x1c7)]=a27_0x2ff97d(0x1d4);async[a27_0x2ff97d(0x183)](_0x329a5d){const _0x2ebc52=a27_0x2ff97d,{options:_0x4ff0fc,args:_0x2597e2,tdx:_0x52d7f8}=_0x329a5d,_0x1e4105=_0x2597e2[0x0];if(!requireNameOrPath(_0x1e4105))return 0x1;_0x4ff0fc[_0x2ebc52(0x237)]&&console[_0x2ebc52(0x23f)](_0x2ebc52(0x23c)+_0x1e4105);const _0x3237f8=_0x4ff0fc,_0xde32f3=_0x3237f8[_0x2ebc52(0x218)],_0x598283=_0x3237f8[_0x2ebc52(0x24f)],_0x19f7bc=_0x3237f8['to'],_0x5a029=_0x3237f8['limit'];if(_0xde32f3&&_0xde32f3!==_0x2ebc52(0x19c)&&_0xde32f3!==_0x2ebc52(0x20d))return console[_0x2ebc52(0x23f)](_0x2ebc52(0x25e)+_0xde32f3+_0x2ebc52(0x18a)),0x1;const _0x4a5269=withJsonFormat(_0x4ff0fc),{journeyId:_0x3687a1,journeyName:_0x1f51c6}=await resolveJourneyIdFromInput(_0x1e4105,_0x4a5269,_0x52d7f8),_0x1624fa={'type':_0xde32f3,'from':_0x598283,'to':_0x19f7bc,'limit':_0x5a029},_0xa93689=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x52d7f8[_0x2ebc52(0x1d7)][_0x2ebc52(0x263)](_0x3687a1,_0x1624fa),{'verbose':_0x4a5269[_0x2ebc52(0x237)]}),_0x2b4cbf=_0xa93689[_0x2ebc52(0x1ed)],_0x536a23=_0x2b4cbf[_0x2ebc52(0x19c)]&&(_0x2b4cbf['conversion'][_0x2ebc52(0x1b0)][_0x2ebc52(0x16c)]>0x0||_0x2b4cbf['conversion'][_0x2ebc52(0x19d)][_0x2ebc52(0x16c)]>0x0),_0x3af562=_0x2b4cbf[_0x2ebc52(0x20d)]&&_0x2b4cbf[_0x2ebc52(0x20d)]['length']>0x0;if(!_0x536a23&&!_0x3af562)return console[_0x2ebc52(0x23f)](_0x2ebc52(0x1ce)+_0x1f51c6),console[_0x2ebc52(0x23f)](_0x2ebc52(0x21d)),_0x598283&&_0x19f7bc&&console[_0x2ebc52(0x23f)](_0x2ebc52(0x207)),0x0;return await handleSingleObjectOutput(_0x2b4cbf,_0x4a5269),0x0;}}function formatStageStats(_0x331888,_0x17cf0e){const _0x4d51ac=a27_0x2ff97d,_0x651496=_0x17cf0e[_0x4d51ac(0x1b2)]&&_0x331888[_0x4d51ac(0x1f6)]?.['length']?aggregateStageHistory(_0x331888[_0x4d51ac(0x1f6)]):{'size':_0x331888[_0x4d51ac(0x196)],'entered':_0x331888[_0x4d51ac(0x177)],'milestone':_0x331888['milestoneSize'],'milestone_rate':_0x331888['completeMilestoneRate'],'exit_or_jump':_0x331888[_0x4d51ac(0x261)],'exit_or_jump_rate':_0x331888[_0x4d51ac(0x187)]},_0x5140c7={'id':_0x331888['id'],'name':_0x17cf0e[_0x4d51ac(0x1ee)][_0x4d51ac(0x191)](_0x331888['id'])??_0x331888['id'],..._0x651496};return _0x17cf0e['hasPeriod']&&_0x17cf0e[_0x4d51ac(0x1d6)]&&_0x331888[_0x4d51ac(0x1f6)]&&(_0x5140c7['history']=_0x331888['history']),_0x5140c7;}export class JourneyPauseCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]=a27_0x2ff97d(0x197);[a27_0x2ff97d(0x1c7)]=a27_0x2ff97d(0x1af);async[a27_0x2ff97d(0x183)](_0x3c6f86){const _0x162397=a27_0x2ff97d,{options:_0x993c91,args:_0x51272c,tdx:_0x366098}=_0x3c6f86,_0x37af60=_0x51272c[0x0];if(!requireNameOrPath(_0x37af60))return 0x1;_0x993c91[_0x162397(0x237)]&&console['error']('Input:\x20'+_0x37af60);const {journeyId:_0x4c0dc3,journeyName:_0x5694ac}=await resolveJourneyIdFromInput(_0x37af60,_0x993c91,_0x366098);if(!_0x993c91[_0x162397(0x1e2)]){const _0x34198c=await confirm(_0x162397(0x1db)+_0x5694ac+'\x22?');if(!_0x34198c)return console[_0x162397(0x23f)](_0x162397(0x236)),0x0;}const _0x553eba=await withSpinner(_0x162397(0x1e3),()=>_0x366098[_0x162397(0x1d7)][_0x162397(0x1f9)](_0x4c0dc3),{'verbose':_0x993c91[_0x162397(0x237)]}),_0x1fae85=_0x553eba[_0x162397(0x1ed)];return console[_0x162397(0x23f)](_0x162397(0x1cc)+_0x1fae85[_0x162397(0x238)][_0x162397(0x1e0)]+_0x162397(0x230)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]=a27_0x2ff97d(0x1bc);[a27_0x2ff97d(0x1c7)]='Resume\x20a\x20paused\x20journey';async[a27_0x2ff97d(0x183)](_0x5f51b8){const _0x228c89=a27_0x2ff97d,{options:_0x3fd457,args:_0x20417a,tdx:_0x31ff11}=_0x5f51b8,_0x3b0047=_0x20417a[0x0];if(!requireNameOrPath(_0x3b0047))return 0x1;_0x3fd457[_0x228c89(0x237)]&&console['error'](_0x228c89(0x23c)+_0x3b0047);const {journeyId:_0x3e21ed,journeyName:_0x33ac3b}=await resolveJourneyIdFromInput(_0x3b0047,_0x3fd457,_0x31ff11);if(!_0x3fd457[_0x228c89(0x1e2)]){const _0x2afd65=await confirm(_0x228c89(0x1e9)+_0x33ac3b+'\x22?');if(!_0x2afd65)return console[_0x228c89(0x23f)](_0x228c89(0x236)),0x0;}const _0x676d6a=await withSpinner(_0x228c89(0x1df),()=>_0x31ff11[_0x228c89(0x1d7)][_0x228c89(0x225)](_0x3e21ed),{'verbose':_0x3fd457[_0x228c89(0x237)]}),_0xc40a92=_0x676d6a[_0x228c89(0x1ed)];return console['error'](_0x228c89(0x1cc)+_0xc40a92[_0x228c89(0x238)][_0x228c89(0x1e0)]+_0x228c89(0x17e)),0x0;}}function a27_0x2f42(){const _0x51bfe5=['getActivation','\x20files?','\x20(ID:\x20','segmentName','from','Journey\x20name:\x20','journey:view','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','journey:version:view','Parent\x20segment:\x20','1205690cHPTDR','map','Folder\x20path:\x20','segment','journeyBundleId','createdAt','blue','repeat','getParentFull','Error:\x20Invalid\x20--type\x20\x22','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Export\x20journey(s)\x20as\x20YAML\x20files','exitOrJumpSize','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','getTrafficData','List\x20activations\x20for\x20a\x20journey','utf-8','entries','153vuWKnJ','listActivationsFlat','✔\x20Pulled\x20','cwd','filter','Warning:\x20Could\x20not\x20resolve\x20segment\x20','push','324008lJOzqj','length','List\x20all\x20versions\x20of\x20a\x20journey','site','hasChanges','Error:\x20Parent\x20segment\x20context\x20required','stringify','base','dim','bold','completionRate','/app/ps/','enteredSize','-\x20no\x20files\x20written','Getting\x20journey\x20details...','activationParams','Getting\x20version\x20','\x20(draft)\x20—\x20\x22','842401wJlEjS','\x22\x20resumed','resourceName','🗺️\x20','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','\x20journey\x20files\x20to\x20','execute','table','format','getJourney','exitOrJumpRate','Target\x20file:\x20','journey:list','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','segments','Write\x20','audienceId','Table:\x20','relativePath','buildIdToNameMap','get','Error:\x20Journey\x20\x27','segmentPushCommand','\x20\x20Target:\x20','\x20\x20Parent\x20segment:\x20','size','journey:pause','Pattern:\x20','launched','content','join','conversion','links','renderStats','localeCompare','goalSize','errorCode','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','yellow','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','/j/da','folderId','✔\x20All\x20files\x20are\x20up\x20to\x20date','parent_segment','Error:\x20Stage\x20\x22','Listing\x20journeys...','\x0aChanges\x20to\x20\x27','✔\x20Context\x20set:\x20','listVersions','\x20versions)','Pause\x20a\x20running\x20journey','nodes','find','hasPeriod','session','/j/da/je','relative','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','703802cfrGWr','journeyBundleName','options','3916143BgAEWv','\x20=\x20','journey:resume','versionNumber','toLowerCase','121oqNzzy','connection','Fetching\x20users\x20and\x20connections...','red','test','Show\x20journey\x20details','Resolving\x20parent\x20segment...','1747719KVJoTP','description','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','6HOxUAi','resolveParentId','listJourneysFromParentSegment','✔\x20Journey\x20\x22','activation_','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','diff','\x20unchanged\x20files','reentryMode','user','jsonl','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','📁\x20','includeHistory','journey','args','journeyId','folderPath','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','35deFqhb','filePath','\x20\x20Preserving\x20local\x20segment\x20name:\x20','Resuming\x20journey...','name','file','yes','Pausing\x20journey...','journey:stats','stages','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','json','\x20journey','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','Getting\x20journey\x20statistics...','helpText','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','data','stageNameMap','\x5c$&','connector_config','listFolders','rule','then','Creating\x20new\x20version...','\x20\x20Folder\x20path:\x20','history','\x20\x20-\x20','parentSegment','pause','\x20journeys','isNew','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','✔\x20Found\x20','(root)','(paused)','Fetching\x20','includeStats','\x20version','goal','107104KWuBGC','has','\x20->\x20','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','stage','columns','\x20Opening\x20','journey:versions','\x20\x20Journey\x20ID:\x20','activation','\x20changed\x20files','Fetching\x20journeys\x20and\x20folders...','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','targetDir','message','journeyStages','Fetching\x20parent\x20segment...','\x20(rule\x20match)','journeyName','Options:','type','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','INVALID_ARGUMENT','Show\x20journey\x20statistics','journey:pull','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Error:\x20--version\x20option\x20is\x20required','(draft)','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','Getting\x20column\x20mapping...','set','log','\x20\x20Consolidating\x20duplicate\x20segment:\x20','resume','cyan','\x22\x20not\x20found','No\x20journeys\x20found','Found\x20','dryRun','tdx.json','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','journeys','resolveSegment','state','\x22\x20paused','.yml','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','green','all','journey:activations','Cancelled','verbose','attributes','Aborted.','Database:\x20','/e/','Input:\x20','List\x20journeys\x20in\x20current\x20context','journey:push','error','sort','listJourneysWithFolders','updatedAt','paused','database','getStatistics','kind','values','add','getSegment','tsv'];a27_0x2f42=function(){return _0x51bfe5;};return a27_0x2f42();}export class JourneyPullCommand extends BaseCommand{['name']=a27_0x2ff97d(0x21c);['description']=a27_0x2ff97d(0x260);async[a27_0x2ff97d(0x183)](_0x1e61a8){const _0x3b574a=a27_0x2ff97d,{options:_0x103ab3,args:_0x7470fa,tdx:_0x39ea32}=_0x1e61a8,_0x201317=_0x103ab3,_0x167c11=_0x7470fa[0x0],_0x3a8b30=_0x167c11&&isYamlFilePath(_0x167c11),_0x148cd7=await resolveTarget({'arg':_0x3a8b30?_0x167c11:undefined,'contextParent':_0x103ab3[_0x3b574a(0x1f8)],'cwd':process[_0x3b574a(0x167)]()});if(!isSuccessfulResolution(_0x148cd7))return _0x148cd7[_0x3b574a(0x1a1)]==='no_parent'?(console['error'](a27_0x128894[_0x3b574a(0x1a3)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x3b574a(0x23f)]('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'](_0x3b574a(0x210)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console[_0x3b574a(0x23f)](_0x3b574a(0x1b6))):(console[_0x3b574a(0x23f)](a27_0x128894[_0x3b574a(0x1c2)]('Error:\x20'+_0x148cd7['message']+'\x0a')),_0x148cd7[_0x3b574a(0x1eb)]&&console[_0x3b574a(0x23f)](a27_0x128894[_0x3b574a(0x226)](_0x148cd7['helpText']))),0x1;let _0x158875=_0x3a8b30?undefined:_0x167c11,_0x4d4be0,_0x3b757b;_0x148cd7[_0x3b574a(0x218)]===_0x3b574a(0x1e1)&&(_0x158875=_0x148cd7[_0x3b574a(0x17f)],_0x4d4be0=_0x148cd7[_0x3b574a(0x1dd)],_0x3b757b=_0x148cd7[_0x3b574a(0x1da)]);const _0x2ea014=_0x148cd7['parentName'],_0x55b9fc=_0x148cd7[_0x3b574a(0x211)];_0x201317[_0x3b574a(0x237)]&&(console[_0x3b574a(0x23f)](_0x3b574a(0x254)+_0x2ea014),console[_0x3b574a(0x23f)]('Target\x20directory:\x20'+_0x55b9fc),_0x158875&&console[_0x3b574a(0x23f)](_0x3b574a(0x250)+_0x158875),_0x4d4be0&&console[_0x3b574a(0x23f)](_0x3b574a(0x188)+_0x4d4be0),_0x3b757b&&console[_0x3b574a(0x23f)](_0x3b574a(0x257)+_0x3b757b));const _0xba89a3=await withSpinner(_0x3b574a(0x1c5),()=>_0x39ea32['segment'][_0x3b574a(0x1ca)](_0x2ea014),{'verbose':_0x103ab3['verbose']}),_0x52ea67=_0xba89a3[_0x3b574a(0x1ed)],{journeys:_0x3c5e83,folders:_0x2cdafe}=await withSpinner(_0x3b574a(0x20f),async()=>{const _0xa34258=_0x3b574a,[_0x2d3d84,_0x7f2071]=await Promise['all']([_0x39ea32[_0xa34258(0x1d7)][_0xa34258(0x1cb)](_0x52ea67,undefined,{'includeAllVersions':!![]}),_0x39ea32[_0xa34258(0x258)][_0xa34258(0x1f1)](_0x52ea67)]);return{'journeys':_0x2d3d84,'folders':_0x7f2071};},{'verbose':_0x103ab3[_0x3b574a(0x237)]})[_0x3b574a(0x1f3)](_0x1fb0a0=>_0x1fb0a0[_0x3b574a(0x1ed)]);let _0x2a5d73=_0x3c5e83;const _0x2b1119=buildFolderIdToPathMap(_0x2cdafe);if(_0x158875){const _0x1e71d9=_0x2a5d73['filter'](_0x55babf=>_0x55babf[_0x3b574a(0x1b8)][_0x3b574a(0x1be)]()===_0x158875['toLowerCase']());if(_0x1e71d9[_0x3b574a(0x16c)]===0x0)return console[_0x3b574a(0x23f)]('Error:\x20Journey\x20not\x20found:\x20'+_0x158875),console['error'](_0x3b574a(0x1fc)),0x1;_0x2a5d73=_0x1e71d9;}if(_0x3b757b!==undefined){const _0x2e5a98=_0x2a5d73[_0x3b574a(0x168)](_0x2ec28a=>{const _0x3b2859=_0x3b574a,_0x3bd30e=_0x2ec28a[_0x3b2859(0x1a6)]?_0x2b1119['get'](_0x2ec28a['folderId'])||'':'';return _0x3bd30e===_0x3b757b;});if(_0x2e5a98['length']===0x0&&_0x2a5d73['length']>0x0){console['error'](_0x3b574a(0x192)+_0x158875+'\x27\x20not\x20found\x20in\x20'+(_0x3b757b||'root\x20folder')),console[_0x3b574a(0x23f)](_0x3b574a(0x1a2));for(const _0xdab3e1 of _0x2a5d73){const _0x42d75f=_0xdab3e1[_0x3b574a(0x1a6)]?_0x2b1119[_0x3b574a(0x191)](_0xdab3e1[_0x3b574a(0x1a6)])||'':'';console[_0x3b574a(0x23f)](_0x3b574a(0x1f7)+(_0x42d75f||_0x3b574a(0x1fe))+'/'+_0xdab3e1[_0x3b574a(0x1b8)]);}return 0x1;}_0x2a5d73=_0x2e5a98;}if(_0x2a5d73[_0x3b574a(0x16c)]===0x0)return console['error'](_0x3b574a(0x228)),0x0;const _0x425597=new Map();for(const _0x58a1e0 of _0x2a5d73){const _0x493aae=_0x58a1e0[_0x3b574a(0x259)];!_0x425597[_0x3b574a(0x205)](_0x493aae)&&_0x425597['set'](_0x493aae,[]),_0x425597[_0x3b574a(0x191)](_0x493aae)[_0x3b574a(0x16a)](_0x58a1e0);}for(const _0xa458fe of _0x425597[_0x3b574a(0x247)]()){_0xa458fe[_0x3b574a(0x240)]((_0x5a6163,_0x1b2e50)=>(_0x5a6163[_0x3b574a(0x1bd)]||0x0)-(_0x1b2e50[_0x3b574a(0x1bd)]||0x0));}const _0x35a0c2=[],{idToEmailMap:_0x31b14d,connectionIdToNameMap:_0x52bf46}=await withSpinner(_0x3b574a(0x1c1),async()=>{const _0x125656=_0x3b574a,[_0x493cc7,_0x477e39]=await Promise[_0x125656(0x234)]([_0x39ea32[_0x125656(0x1d2)]['buildIdToEmailMap'](),_0x39ea32[_0x125656(0x1c0)][_0x125656(0x190)]()]);return{'idToEmailMap':_0x493cc7,'connectionIdToNameMap':_0x477e39};},{'verbose':_0x103ab3[_0x3b574a(0x237)]})[_0x3b574a(0x1f3)](_0xa737ff=>_0xa737ff[_0x3b574a(0x1ed)]);for(const _0x20dd4e of _0x425597['values']()){const _0x3cac6e=_0x20dd4e[0x0][_0x3b574a(0x1b8)],_0x5cc789=_0x20dd4e[0x0][_0x3b574a(0x1a6)],_0xfadc2a=_0x5cc789?_0x2b1119['get'](_0x5cc789)||'':'',_0x5b382b=_0xfadc2a?a27_0x4955f1[_0x3b574a(0x19b)](_0x55b9fc,_0xfadc2a):_0x55b9fc,_0x5bafdd=_0x4d4be0||a27_0x4955f1['join'](_0x5b382b,sanitizeFileName(_0x3cac6e)+'.yml');let _0x336c05,_0x343ace;if(existsSync(_0x5bafdd))try{const _0x5429e1=readFileSync(_0x5bafdd,_0x3b574a(0x265)),_0x5bd12e=parseYamlString(_0x5429e1);_0x343ace=_0x5bd12e,_0x336c05=buildRuleToNameMapping(_0x5bd12e),_0x201317['verbose']&&_0x336c05[_0x3b574a(0x196)]>0x0&&console[_0x3b574a(0x23f)](_0x3b574a(0x229)+_0x336c05[_0x3b574a(0x196)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x3cac6e);}catch(_0x58da49){_0x201317['verbose']&&console[_0x3b574a(0x23f)](_0x3b574a(0x22c)+_0x58da49['message']);}const _0x1a1ef9=[],_0x3d8937=new Set(),_0x55d234=new Map(),_0x3a8eb0=new Map(),_0x15e001=new Set(),_0x1a61e6=new Map(),_0x33e0a5=new Map(),_0x597b6a=createJumpTargetCache();await withProgressSpinner('Fetching\x20'+_0x3cac6e+'...',async _0x3fb3f0=>{const _0x45e403=_0x3b574a;for(const _0xadcacc of _0x20dd4e){const _0x2db678=_0x20dd4e['length']>0x1?_0xadcacc[_0x45e403(0x1b8)]+'\x20v'+(_0xadcacc[_0x45e403(0x1bd)]||0x1):_0xadcacc[_0x45e403(0x1b8)];_0x3fb3f0['setPhase'](_0x45e403(0x200)+_0x2db678);const _0x36506d=await _0x39ea32[_0x45e403(0x1d7)][_0x45e403(0x186)](_0xadcacc['id']),_0x507782=_0x36506d['attributes']?.[_0x45e403(0x18d)],_0x1b39e0={'resolveSegment':async _0x1482b9=>{const _0x51456d=_0x45e403;if(!_0x507782)return{'name':_0x1482b9,'isJourneyLocal':![]};const _0x505244=_0x55d234[_0x51456d(0x191)](_0x1482b9);if(_0x505244)return _0x505244;try{const _0xaf4ef4=await _0x39ea32[_0x51456d(0x258)][_0x51456d(0x249)](_0x507782,_0x1482b9),_0x5b7821=_0xaf4ef4[_0x51456d(0x246)]===SEGMENT_KIND_JOURNEY;let _0x3148ce,_0x5e9160=_0xaf4ef4[_0x51456d(0x1e0)];if(_0x5b7821&&_0xaf4ef4[_0x51456d(0x1f2)]){const _0x524192=await segmentResponseToDef(_0xaf4ef4,{'resolveSegmentName':async _0x2c230a=>{const _0x227b1a=_0x51456d,_0x2c2542=_0x55d234[_0x227b1a(0x191)](_0x2c230a);if(_0x2c2542)return _0x2c2542['name'];const _0x292151=await _0x1b39e0[_0x227b1a(0x22e)](_0x2c230a);return _0x292151[_0x227b1a(0x1e0)];}}),_0xae106c=_0x524192['rule'];_0x3148ce={'description':_0xaf4ef4[_0x51456d(0x1c7)],'rule':_0xae106c};const _0x1b1b8a=serializeRule(_0xae106c),_0xdd6814=_0x3a8eb0[_0x51456d(0x191)](_0x1b1b8a);if(_0xdd6814)_0x5e9160=_0xdd6814,_0x3148ce=undefined,_0x201317['verbose']&&console[_0x51456d(0x23f)](_0x51456d(0x224)+_0xaf4ef4[_0x51456d(0x1e0)]+_0x51456d(0x206)+_0xdd6814);else{let _0x40f913=![];if(_0x336c05){const _0x3695f0=_0x336c05[_0x51456d(0x191)](_0x1b1b8a);if(_0x3695f0){const _0x257108=_0x3695f0[_0x51456d(0x1b1)](_0x38f6de=>!_0x3d8937[_0x51456d(0x205)](_0x38f6de));_0x257108&&(_0x5e9160=_0x257108,_0x3d8937[_0x51456d(0x248)](_0x257108),_0x3a8eb0['set'](_0x1b1b8a,_0x257108),_0x40f913=!![],_0x201317[_0x51456d(0x237)]&&console['error'](_0x51456d(0x1de)+_0x257108+_0x51456d(0x215)));}}if(!_0x40f913){const _0x5ac7b6=generateJourneyLocalName(_0xaf4ef4[_0x51456d(0x1e0)]);_0x5ac7b6&&(_0x5e9160=_0x5ac7b6);let _0x2f2457=_0x5e9160,_0x231012=0x2;while(_0x3d8937[_0x51456d(0x205)](_0x2f2457)){_0x2f2457=_0x5e9160+'_'+_0x231012,_0x231012++;}_0x3d8937[_0x51456d(0x248)](_0x2f2457),_0x3a8eb0[_0x51456d(0x222)](_0x1b1b8a,_0x2f2457),_0x5e9160=_0x2f2457;}}}const _0x403757={'name':_0x5e9160,'isJourneyLocal':_0x5b7821,'definition':_0x3148ce};return _0x55d234[_0x51456d(0x222)](_0x1482b9,_0x403757),_0x403757;}catch(_0x14dd09){return _0x103ab3['verbose']&&console[_0x51456d(0x23f)](_0x51456d(0x169)+_0x1482b9+':\x20'+_0x14dd09[_0x51456d(0x212)]),{'name':_0x1482b9,'isJourneyLocal':![]};}},'resolveActivation':async _0x214454=>{const _0x146ae2=_0x45e403,_0x4fb4f9=_0x1a61e6[_0x146ae2(0x191)](_0x214454);if(_0x4fb4f9)return _0x4fb4f9;try{const _0x4695d3=await _0x39ea32[_0x146ae2(0x1d7)][_0x146ae2(0x24b)](_0xadcacc['id'],_0x214454),_0x59594d=journeyActivationStepToYaml(_0x4695d3,_0x31b14d,_0x52bf46),_0x143257=JSON[_0x146ae2(0x171)]({'name':_0x59594d['name'],'connection':_0x59594d['connection'],'connector_config':_0x59594d[_0x146ae2(0x1f0)]}),_0x270f80=_0x33e0a5[_0x146ae2(0x191)](_0x143257);if(_0x270f80){const _0x5f59c9={'name':_0x270f80,'isJourneyLocal':!![],'definition':_0x59594d};return _0x1a61e6[_0x146ae2(0x222)](_0x214454,_0x5f59c9),_0x5f59c9;}const _0x23755b=_0x4695d3['attributes'][_0x146ae2(0x17a)][_0x146ae2(0x1e0)]||_0x214454,_0x1d5259=sanitizeYamlKey(_0x23755b)||_0x146ae2(0x1cd)+_0x214454;let _0x4da57a=_0x1d5259,_0x3c5a0d=0x2;while(_0x15e001[_0x146ae2(0x205)](_0x4da57a)){_0x4da57a=_0x1d5259+'_'+_0x3c5a0d,_0x3c5a0d++;}_0x15e001[_0x146ae2(0x248)](_0x4da57a),_0x33e0a5[_0x146ae2(0x222)](_0x143257,_0x4da57a);const _0x228c22={'name':_0x4da57a,'isJourneyLocal':!![],'definition':_0x59594d};return _0x1a61e6[_0x146ae2(0x222)](_0x214454,_0x228c22),_0x228c22;}catch(_0xd6be2d){return _0x103ab3[_0x146ae2(0x237)]&&console['error']('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x214454+':\x20'+_0xd6be2d['message']),{'name':_0x214454,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x4b404,_0x13ba94)=>{const _0x5896b5=_0x45e403;return resolveJumpTarget(_0x4b404,_0x13ba94,_0x597b6a,_0x10fa8a=>_0x39ea32[_0x5896b5(0x1d7)]['getJourney'](_0x10fa8a));}},_0x46efe0=await journeyResponseToDef(_0x36506d,_0x1b39e0);_0x1a1ef9[_0x45e403(0x16a)]({'item':_0xadcacc,'yaml':_0x46efe0});}},{'verbose':_0x103ab3[_0x3b574a(0x237)]});const _0x4b1ae5=await _0x39ea32['journey']['getLatestJourneyId'](_0x20dd4e[0x0][_0x3b574a(0x259)]),_0x2771d8=buildMergedJourneyDef(_0x1a1ef9,_0x336c05,_0x4b1ae5),_0x3d7ba2=normalizeJourneyDef(_0x2771d8,_0x343ace),_0x20e532=toYamlString(_0x3d7ba2),_0x24ad1b=_0x4d4be0||a27_0x4955f1[_0x3b574a(0x19b)](_0x5b382b,sanitizeFileName(_0x3cac6e)+_0x3b574a(0x231));!_0x4d4be0&&_0xfadc2a&&!existsSync(_0x5b382b)&&mkdirSync(_0x5b382b,{'recursive':!![]});const _0x1b653e=a27_0x4955f1[_0x3b574a(0x1b5)](process[_0x3b574a(0x167)](),_0x24ad1b);if(existsSync(_0x24ad1b)){const _0x552afe=readFileSync(_0x24ad1b,_0x3b574a(0x265)),_0x108cf8=generateDiff(_0x552afe,_0x20e532),_0x41d2b6=hasChanges(_0x108cf8);_0x35a0c2[_0x3b574a(0x16a)]({'relativePath':_0x1b653e,'absolutePath':_0x24ad1b,'content':_0x20e532,'isNew':![],'hasChanges':_0x41d2b6,'diff':_0x41d2b6?formatDiffWithColors(_0x108cf8):undefined});}else _0x35a0c2[_0x3b574a(0x16a)]({'relativePath':_0x1b653e,'absolutePath':_0x24ad1b,'content':_0x20e532,'isNew':!![],'hasChanges':![]});}const _0x548e3a=_0x35a0c2[_0x3b574a(0x168)](_0x218677=>_0x218677[_0x3b574a(0x1fb)]),_0x558dfd=_0x35a0c2['filter'](_0x4b5d3c=>!_0x4b5d3c[_0x3b574a(0x1fb)]&&_0x4b5d3c[_0x3b574a(0x16f)]),_0x504ce0=_0x35a0c2['filter'](_0x3e6975=>!_0x3e6975['isNew']&&!_0x3e6975[_0x3b574a(0x16f)]),_0x1c8efe=_0x2a5d73['length'],_0x4252b1=_0x425597[_0x3b574a(0x196)],_0x6d36e=_0x1c8efe>_0x4252b1?'\x20('+_0x1c8efe+_0x3b574a(0x1ae):'';console[_0x3b574a(0x23f)]('\x0aPull\x20summary:'),console[_0x3b574a(0x23f)]('\x20\x20'+a27_0x128894[_0x3b574a(0x226)](_0x4252b1+_0x3b574a(0x1fa))+a27_0x128894['dim'](_0x6d36e)),console[_0x3b574a(0x23f)]('\x20\x20'+a27_0x128894[_0x3b574a(0x233)]('+\x20'+_0x548e3a['length']+'\x20new\x20files')),console[_0x3b574a(0x23f)]('\x20\x20'+a27_0x128894['yellow']('~\x20'+_0x558dfd[_0x3b574a(0x16c)]+_0x3b574a(0x20e))),console[_0x3b574a(0x23f)]('\x20\x20'+a27_0x128894['dim']('=\x20'+_0x504ce0[_0x3b574a(0x16c)]+_0x3b574a(0x1d0))),console[_0x3b574a(0x23f)](_0x3b574a(0x194)+a27_0x128894[_0x3b574a(0x226)](_0x55b9fc)+'\x0a');if(_0x558dfd['length']>0x0)for(const _0x49bddd of _0x558dfd){console[_0x3b574a(0x23f)](_0x3b574a(0x1ab)+_0x49bddd[_0x3b574a(0x18f)]+'\x27:'),console[_0x3b574a(0x23f)]('─'['repeat'](0x3c)),console[_0x3b574a(0x23f)](_0x49bddd[_0x3b574a(0x1cf)]),console[_0x3b574a(0x23f)]('─'[_0x3b574a(0x25c)](0x3c));}if(_0x201317[_0x3b574a(0x22a)])return console[_0x3b574a(0x23f)](a27_0x128894[_0x3b574a(0x1a3)](_0x3b574a(0x232))),0x0;if(_0x548e3a[_0x3b574a(0x16c)]===0x0&&_0x558dfd[_0x3b574a(0x16c)]===0x0)return console[_0x3b574a(0x23f)](a27_0x128894[_0x3b574a(0x233)](_0x3b574a(0x1a7))),saveSessionContext({'parent_segment':_0x2ea014},_0x201317[_0x3b574a(0x1b3)]),console[_0x3b574a(0x23f)](a27_0x128894[_0x3b574a(0x233)](_0x3b574a(0x1ac)+a27_0x128894['dim']('parent_segment')+'\x20=\x20'+a27_0x128894[_0x3b574a(0x226)](_0x2ea014))),0x0;if(!_0x201317['yes']&&(_0x548e3a[_0x3b574a(0x16c)]>0x0||_0x558dfd['length']>0x0)){if(!isInteractive())return console[_0x3b574a(0x23f)](a27_0x128894[_0x3b574a(0x1c2)]('\x0aError:'),_0x3b574a(0x1e6)),console[_0x3b574a(0x23f)](a27_0x128894[_0x3b574a(0x173)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x90da7c=await confirmKey(_0x3b574a(0x18c)+(_0x548e3a[_0x3b574a(0x16c)]+_0x558dfd[_0x3b574a(0x16c)])+_0x3b574a(0x24c));if(!_0x90da7c)return console['error'](a27_0x128894[_0x3b574a(0x1a3)](_0x3b574a(0x239)),_0x3b574a(0x178)),0x1;}!existsSync(_0x55b9fc)&&mkdirSync(_0x55b9fc,{'recursive':!![]});const _0x2c82cd=a27_0x4955f1[_0x3b574a(0x19b)](_0x55b9fc,_0x3b574a(0x22b));writeFileSync(_0x2c82cd,createTdxConfigContent(_0x2ea014),_0x3b574a(0x265));for(const _0x34a731 of _0x35a0c2){(_0x34a731[_0x3b574a(0x1fb)]||_0x34a731['hasChanges'])&&writeFileSync(_0x34a731['absolutePath'],_0x34a731[_0x3b574a(0x19a)],_0x3b574a(0x265));}return console[_0x3b574a(0x23f)](a27_0x128894['green'](_0x3b574a(0x166)+(_0x548e3a[_0x3b574a(0x16c)]+_0x558dfd[_0x3b574a(0x16c)])+_0x3b574a(0x182)+_0x55b9fc)),saveSessionContext({'parent_segment':_0x2ea014},_0x201317[_0x3b574a(0x1b3)]),console[_0x3b574a(0x23f)](a27_0x128894[_0x3b574a(0x233)](_0x3b574a(0x1ac)+a27_0x128894['dim'](_0x3b574a(0x1a8))+_0x3b574a(0x1bb)+a27_0x128894['cyan'](_0x2ea014))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]='journey:columns';[a27_0x2ff97d(0x1c7)]='Show\x20journey\x20table\x20column\x20mapping';async[a27_0x2ff97d(0x183)](_0x84862c){const _0x1b7fbb=a27_0x2ff97d,{options:_0x564d23,args:_0x41752d,tdx:_0x3849cb}=_0x84862c,_0x1a76d4=_0x41752d[0x0];if(!requireNameOrPath(_0x1a76d4))return 0x1;_0x564d23[_0x1b7fbb(0x237)]&&console[_0x1b7fbb(0x23f)](_0x1b7fbb(0x23c)+_0x1a76d4);const {journeyId:_0x5289db}=await resolveJourneyIdFromInput(_0x1a76d4,_0x564d23,_0x3849cb),_0x94218c=await withSpinner(_0x1b7fbb(0x221),()=>_0x3849cb[_0x1b7fbb(0x1d7)]['getColumnMapping'](_0x5289db),{'verbose':_0x564d23[_0x1b7fbb(0x237)]}),_0x4688aa=_0x94218c[_0x1b7fbb(0x1ed)];return console[_0x1b7fbb(0x223)](_0x1b7fbb(0x23a)+_0x4688aa[_0x1b7fbb(0x244)]),console[_0x1b7fbb(0x223)](_0x1b7fbb(0x18e)+_0x4688aa[_0x1b7fbb(0x184)]),await handleSDKOutput(_0x4688aa[_0x1b7fbb(0x209)],_0x564d23),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]=a27_0x2ff97d(0x235);[a27_0x2ff97d(0x1c7)]=a27_0x2ff97d(0x264);async[a27_0x2ff97d(0x183)](_0x1b254f){const _0x3e67fe=a27_0x2ff97d,{options:_0x1ea7a8,args:_0x17c6d7,tdx:_0x6f959f}=_0x1b254f,_0xa8e0a=_0x17c6d7[0x0];if(!requireNameOrPath(_0xa8e0a))return 0x1;_0x1ea7a8[_0x3e67fe(0x237)]&&console['error']('Input:\x20'+_0xa8e0a);const {journeyId:_0x4be0db}=await resolveJourneyIdFromInput(_0xa8e0a,_0x1ea7a8,_0x6f959f),_0x4adc61=await withSpinner('Listing\x20journey\x20activations...',()=>_0x6f959f[_0x3e67fe(0x1d7)][_0x3e67fe(0x165)](_0x4be0db),{'verbose':_0x1ea7a8[_0x3e67fe(0x237)]}),_0x27cb70=_0x4adc61['data'];return console[_0x3e67fe(0x23f)]('Found\x20'+_0x27cb70[_0x3e67fe(0x16c)]+'\x20activation'+(_0x27cb70[_0x3e67fe(0x16c)]!==0x1?'s':'')),await handleSDKOutput(_0x27cb70,_0x1ea7a8),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]=a27_0x2ff97d(0x23e);['description']=a27_0x2ff97d(0x1a4);['segmentPushCommand']=new SegmentPushCommand();async['execute'](_0xea7217){const _0x17bbc9=a27_0x2ff97d,_0xf52eee=_0xea7217[_0x17bbc9(0x1d8)][0x0];let _0x212a9d;if(_0xf52eee){const _0x568684=await resolveTarget({'arg':_0xf52eee,'contextParent':_0xea7217[_0x17bbc9(0x1b9)][_0x17bbc9(0x1f8)],'cwd':process[_0x17bbc9(0x167)]()});isSuccessfulResolution(_0x568684)&&_0x568684[_0x17bbc9(0x218)]==='file'&&(_0x212a9d=_0x568684['filePath']);}const _0x239f7c={..._0xea7217,'options':{..._0xea7217['options'],'journeysOnly':!![],..._0x212a9d&&{'singleFilePath':_0x212a9d}}};return this[_0x17bbc9(0x193)][_0x17bbc9(0x183)](_0x239f7c);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]=a27_0x2ff97d(0x20b);[a27_0x2ff97d(0x1c7)]=a27_0x2ff97d(0x16d);async[a27_0x2ff97d(0x183)](_0x34aaa2){const _0xbb1a3c=a27_0x2ff97d,{options:_0x1b1701,args:_0x66c221,tdx:_0x171819}=_0x34aaa2,_0x3d2095=_0x66c221[0x0];if(!requireNameOrPath(_0x3d2095))return 0x1;if(_0x1b1701[_0xbb1a3c(0x237)])console[_0xbb1a3c(0x23f)]('Input:\x20'+_0x3d2095);const {journeyId:_0x9348f9}=await resolveJourneyIdFromInput(_0x3d2095,_0x1b1701,_0x171819),_0x4deba2=await withSpinner('Listing\x20journey\x20versions...',()=>_0x171819[_0xbb1a3c(0x1d7)][_0xbb1a3c(0x1ad)](_0x9348f9),{'verbose':_0x1b1701[_0xbb1a3c(0x237)]}),{bundleName:_0xdb9179,versions:_0x44260f,latestJourneyId:_0x1b083b}=_0x4deba2[_0xbb1a3c(0x1ed)];console[_0xbb1a3c(0x23f)](_0xdb9179+':\x20'+_0x44260f[_0xbb1a3c(0x16c)]+_0xbb1a3c(0x202)+(_0x44260f[_0xbb1a3c(0x16c)]!==0x1?'s':''));const _0x25cf82=_0x44260f['map'](_0x4d8931=>({'version':_0x4d8931[_0xbb1a3c(0x1bd)],'journey_id':_0x4d8931[_0xbb1a3c(0x1d9)],'name':_0x4d8931[_0xbb1a3c(0x1e0)],'state':_0x4d8931[_0xbb1a3c(0x22f)],'paused':_0x4d8931[_0xbb1a3c(0x243)],'latest':_0x4d8931[_0xbb1a3c(0x1d9)]===_0x1b083b,'created_at':_0x4d8931[_0xbb1a3c(0x25a)]}));return await handleSDKOutput(_0x25cf82,_0x1b1701),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]='journey:version:create';['description']=a27_0x2ff97d(0x1c8);async[a27_0x2ff97d(0x183)](_0x102e59){const _0x11e246=a27_0x2ff97d,{options:_0x37da5a,args:_0x34b852,tdx:_0x2fbfd3}=_0x102e59,_0x62ae68=_0x34b852[0x0];if(!requireNameOrPath(_0x62ae68))return 0x1;if(_0x37da5a[_0x11e246(0x237)])console[_0x11e246(0x23f)](_0x11e246(0x23c)+_0x62ae68);const {journeyId:_0x80b503,journeyName:_0x1e2777}=await resolveJourneyIdFromInput(_0x62ae68,_0x37da5a,_0x2fbfd3);if(!_0x37da5a[_0x11e246(0x1e2)]){const _0x394bc7=await confirm(_0x11e246(0x252)+_0x1e2777+'\x22?');if(!_0x394bc7)return console[_0x11e246(0x23f)]('Cancelled'),0x0;}const _0x1dcf17=await withSpinner(_0x11e246(0x1f4),()=>_0x2fbfd3['journey']['createVersion'](_0x80b503),{'verbose':_0x37da5a['verbose']}),_0x3477e0=_0x1dcf17[_0x11e246(0x1ed)];return console[_0x11e246(0x23f)](a27_0x128894[_0x11e246(0x233)]('✔')+'\x20Created\x20v'+_0x3477e0[_0x11e246(0x238)][_0x11e246(0x1bd)]+_0x11e246(0x17c)+_0x3477e0[_0x11e246(0x238)]['name']+'\x22'),console[_0x11e246(0x23f)](_0x11e246(0x20c)+_0x3477e0['id']),await handleSingleObjectOutput({'id':_0x3477e0['id'],'name':_0x3477e0[_0x11e246(0x238)][_0x11e246(0x1e0)],'version':_0x3477e0['attributes'][_0x11e246(0x1bd)],'state':_0x3477e0['attributes'][_0x11e246(0x22f)],'bundle_id':_0x3477e0[_0x11e246(0x238)][_0x11e246(0x259)],'created_at':_0x3477e0[_0x11e246(0x238)][_0x11e246(0x25a)]},_0x37da5a),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x2ff97d(0x1e0)]=a27_0x2ff97d(0x253);[a27_0x2ff97d(0x1c7)]='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async[a27_0x2ff97d(0x183)](_0x342d52){const _0x24d6cc=a27_0x2ff97d,{options:_0x2eef61,args:_0x52433b,tdx:_0x520cad}=_0x342d52,_0x1dbee7=_0x52433b[0x0];if(!requireNameOrPath(_0x1dbee7))return 0x1;const _0x1470f3=_0x2eef61['version'];if(!_0x1470f3)return console['error'](_0x24d6cc(0x21e)),console['error']('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x5dbb0b=parseInt(_0x1470f3,0xa);if(isNaN(_0x5dbb0b)||_0x5dbb0b<0x1)return console[_0x24d6cc(0x23f)]('Error:\x20Invalid\x20version\x20number:\x20'+_0x1470f3),0x1;if(_0x2eef61[_0x24d6cc(0x237)])console[_0x24d6cc(0x23f)](_0x24d6cc(0x23c)+_0x1dbee7+',\x20version:\x20'+_0x5dbb0b);const {journeyId:_0x4d8573,parentSegmentId:_0xfd7dea}=await resolveJourneyIdFromInput(_0x1dbee7,_0x2eef61,_0x520cad),_0x3b7aed=await withSpinner('Resolving\x20version...',()=>_0x520cad[_0x24d6cc(0x1d7)][_0x24d6cc(0x1ad)](_0x4d8573),{'verbose':_0x2eef61['verbose']}),{versions:_0x583b40,latestJourneyId:_0xead98f}=_0x3b7aed['data'],_0x39b22f=_0x583b40[_0x24d6cc(0x1b1)](_0x2e5099=>_0x2e5099[_0x24d6cc(0x1bd)]===_0x5dbb0b);if(!_0x39b22f){const _0x4e68f4=_0x583b40['map'](_0x204ef7=>'v'+_0x204ef7[_0x24d6cc(0x1bd)])[_0x24d6cc(0x19b)](',\x20');return console['error']('Error:\x20Version\x20'+_0x5dbb0b+'\x20not\x20found.\x20Available:\x20'+_0x4e68f4),0x1;}const _0x201960=await withSpinner(_0x24d6cc(0x17b)+_0x5dbb0b+'\x20details...',()=>_0x520cad[_0x24d6cc(0x1d7)][_0x24d6cc(0x186)](_0x39b22f['journeyId']),{'verbose':_0x2eef61['verbose']}),_0x570e50=_0x201960[_0x24d6cc(0x1ed)],_0x5caffe=getConsoleNextUrl(_0x2eef61[_0x24d6cc(0x16e)],_0x24d6cc(0x176)+_0xfd7dea+_0x24d6cc(0x23b)+_0x39b22f['journeyId']+_0x24d6cc(0x1b4));return await handleSingleObjectOutput({'id':_0x570e50['id'],'name':_0x570e50[_0x24d6cc(0x238)][_0x24d6cc(0x1e0)],'version':_0x570e50[_0x24d6cc(0x238)][_0x24d6cc(0x1bd)],'description':_0x570e50[_0x24d6cc(0x238)][_0x24d6cc(0x1c7)],'state':_0x570e50[_0x24d6cc(0x238)][_0x24d6cc(0x22f)],'paused':_0x570e50[_0x24d6cc(0x238)][_0x24d6cc(0x243)],'reentry_mode':_0x570e50['attributes'][_0x24d6cc(0x1d1)],'stages':_0x570e50[_0x24d6cc(0x238)]['journeyStages']?.[_0x24d6cc(0x16c)]||0x0,..._0x570e50[_0x24d6cc(0x238)]['goal']&&{'goal':_0x570e50['attributes'][_0x24d6cc(0x203)]['name']},'latest':_0x39b22f[_0x24d6cc(0x1d9)]===_0xead98f,'created_at':_0x570e50[_0x24d6cc(0x238)][_0x24d6cc(0x25a)],'updated_at':_0x570e50['attributes'][_0x24d6cc(0x242)],'url':_0x5caffe},_0x2eef61),0x0;}}
@@ -1 +1 @@
1
- const a28_0xa4d9a4=a28_0xac02;(function(_0x977a3f,_0x27171a){const _0x3b0ae0=a28_0xac02,_0x1272e2=_0x977a3f();while(!![]){try{const _0x5feded=parseInt(_0x3b0ae0(0xe8))/0x1*(-parseInt(_0x3b0ae0(0xc7))/0x2)+-parseInt(_0x3b0ae0(0xcb))/0x3*(-parseInt(_0x3b0ae0(0xcd))/0x4)+parseInt(_0x3b0ae0(0xd3))/0x5*(parseInt(_0x3b0ae0(0xf4))/0x6)+parseInt(_0x3b0ae0(0xe4))/0x7+parseInt(_0x3b0ae0(0xec))/0x8*(-parseInt(_0x3b0ae0(0xe3))/0x9)+parseInt(_0x3b0ae0(0xe1))/0xa*(parseInt(_0x3b0ae0(0xd5))/0xb)+-parseInt(_0x3b0ae0(0xe9))/0xc*(parseInt(_0x3b0ae0(0xfb))/0xd);if(_0x5feded===_0x27171a)break;else _0x1272e2['push'](_0x1272e2['shift']());}catch(_0x3cbf77){_0x1272e2['push'](_0x1272e2['shift']());}}}(a28_0x33cc,0x4f242));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a28_0x33cc(){const _0x214e75=['395DQhKgT','\x20warning(s)\x20found','1157739SGBgdY','validCount','length','reason','Error:\x20Directory\x20not\x20found:\x20','cyan','yellow','cwd','error','filter','warningCount','\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','10AVCqvs','.yml','3123fiwWge','3978030mdQTDK','journey:validate','errors','warnings','12433XturGk','170748VLOSzV','skippedCount','helpText','11576RzHFoY','verbose','name','log','\x20journey(s)\x20with\x20errors,\x20','Validate\x20journey\x20YAML\x20files','\x20(skipped:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','35466xRsNyZ','red','targetDir','\x20segment\x20file(s)\x20skipped','No\x20journey\x20YAML\x20files\x20found\x20in\x20','valid','file','52VWYHzO','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','\x20valid','description','type','no_parent','46WteZQS','parentSegment','\x20segment\x20file(s)\x20skipped)','endsWith','9ZSbQYG','dim','38184PrPyaz','invalidCount','errorCode','✔\x20All\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a'];a28_0x33cc=function(){return _0x214e75;};return a28_0x33cc();}import{existsSync}from'fs';import a28_0x511ef6 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a28_0xac02(_0x5b493d,_0x3440a8){_0x5b493d=_0x5b493d-0xc6;const _0x33cce6=a28_0x33cc();let _0xac023d=_0x33cce6[_0x5b493d];return _0xac023d;}export class JourneyValidateCommand extends BaseCommand{[a28_0xa4d9a4(0xee)]=a28_0xa4d9a4(0xe5);[a28_0xa4d9a4(0xfe)]=a28_0xa4d9a4(0xf1);async['execute'](_0x3df3c8){const _0x523619=a28_0xa4d9a4,{options:_0x1383c6,args:_0x190dbf}=_0x3df3c8,_0x2acee3=_0x1383c6,_0x2f7448=await resolveTarget({'arg':_0x190dbf[0x0],'contextParent':_0x1383c6[_0x523619(0xc8)],'cwd':process[_0x523619(0xdc)]()});if(!isSuccessfulResolution(_0x2f7448))return _0x2f7448[_0x523619(0xcf)]===_0x523619(0xc6)?(console['error'](a28_0x511ef6[_0x523619(0xdb)](_0x523619(0xd2))),console[_0x523619(0xdd)](_0x523619(0xfc)),console[_0x523619(0xdd)](_0x523619(0xe0)),console[_0x523619(0xdd)](_0x523619(0xf3))):(console['error'](a28_0x511ef6[_0x523619(0xf5)]('Error:\x20'+_0x2f7448['message']+'\x0a')),_0x2f7448[_0x523619(0xeb)]&&console[_0x523619(0xdd)](a28_0x511ef6[_0x523619(0xda)](_0x2f7448[_0x523619(0xeb)]))),0x1;const _0x4b3ea7=_0x2f7448[_0x523619(0xf6)],_0x42fc57=_0x2f7448[_0x523619(0xff)]===_0x523619(0xfa)?_0x2f7448['filePath']:undefined;if(!_0x42fc57&&!existsSync(_0x4b3ea7))return console[_0x523619(0xdd)](a28_0x511ef6[_0x523619(0xf5)](_0x523619(0xd9)+_0x4b3ea7+'\x0a')),0x1;let _0x3017d8;if(_0x42fc57){if(!_0x42fc57[_0x523619(0xca)](_0x523619(0xe2))&&!_0x42fc57[_0x523619(0xca)]('.yaml'))return console[_0x523619(0xdd)](a28_0x511ef6['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x42fc57+'\x0a')),0x1;_0x3017d8=[_0x42fc57];}else _0x3017d8=findYamlFiles(_0x4b3ea7);if(_0x3017d8[_0x523619(0xd7)]===0x0)return console[_0x523619(0xdd)](a28_0x511ef6[_0x523619(0xf5)](_0x523619(0xd1)+_0x4b3ea7+'\x0a')),0x1;const _0x585c68=validateYamlFiles(_0x3017d8,_0x4b3ea7,{'filterType':'journey'}),_0x2852c1=calculateSummary(_0x585c68),_0x8e9329=_0x585c68[_0x523619(0xde)](isValidationResult);if(_0x8e9329['length']===0x0)return console[_0x523619(0xdd)](a28_0x511ef6['yellow'](_0x523619(0xf8)+_0x4b3ea7+'\x0a')),_0x2852c1[_0x523619(0xea)]>0x0&&console[_0x523619(0xdd)](a28_0x511ef6[_0x523619(0xcc)]('('+_0x2852c1[_0x523619(0xea)]+_0x523619(0xc9))),0x0;for(const _0x21e0e8 of _0x585c68){if(!isValidationResult(_0x21e0e8)){_0x2acee3['verbose']&&console['log'](a28_0x511ef6['dim']('-\x20'+_0x21e0e8['relativePath']+_0x523619(0xf2)+_0x21e0e8[_0x523619(0xd8)]+')'));continue;}const {relativePath:_0x3231fa,source:_0x561608,result:_0xcab201}=_0x21e0e8;if(_0xcab201['valid']&&_0xcab201['warnings'][_0x523619(0xd7)]===0x0)_0x2acee3[_0x523619(0xed)]&&console[_0x523619(0xef)](a28_0x511ef6['green']('✔\x20'+_0x3231fa));else _0xcab201[_0x523619(0xf9)]?(console['log'](a28_0x511ef6[_0x523619(0xdb)]('⚠\x20'+_0x3231fa+':\x20'+_0xcab201[_0x523619(0xe7)][_0x523619(0xd7)]+'\x20warning(s)')),console[_0x523619(0xef)](formatValidationResult(_0xcab201,_0x561608,_0x3231fa))):(console['log'](a28_0x511ef6[_0x523619(0xf5)]('✖\x20'+_0x3231fa+':\x20'+_0xcab201[_0x523619(0xe6)][_0x523619(0xd7)]+'\x20error(s)')),console['log'](formatValidationResult(_0xcab201,_0x561608,_0x3231fa)));}return console['log'](''),_0x2852c1['hasErrors']?(console[_0x523619(0xef)](a28_0x511ef6['red']('Validation\x20failed:\x20'+_0x2852c1[_0x523619(0xce)]+_0x523619(0xf0)+_0x2852c1[_0x523619(0xd6)]+_0x523619(0xfd))),_0x2852c1['warningCount']>0x0&&console['log'](a28_0x511ef6[_0x523619(0xdb)](_0x2852c1[_0x523619(0xdf)]+_0x523619(0xd4))),_0x2852c1[_0x523619(0xea)]>0x0&&console[_0x523619(0xef)](a28_0x511ef6['dim'](_0x2852c1[_0x523619(0xea)]+_0x523619(0xf7))),0x1):(console[_0x523619(0xef)](a28_0x511ef6['green'](_0x523619(0xd0)+_0x2852c1[_0x523619(0xd6)]+'\x20journey(s)\x20valid')),_0x2852c1['warningCount']>0x0&&console[_0x523619(0xef)](a28_0x511ef6[_0x523619(0xdb)](_0x2852c1['warningCount']+_0x523619(0xd4))),_0x2852c1['skippedCount']>0x0&&console[_0x523619(0xef)](a28_0x511ef6[_0x523619(0xcc)](_0x2852c1[_0x523619(0xea)]+_0x523619(0xf7))),0x0);}}
1
+ const a28_0x3e3d27=a28_0x443a;(function(_0x205f5,_0x33a171){const _0x4a8ae5=a28_0x443a,_0x578e1a=_0x205f5();while(!![]){try{const _0x5a6645=-parseInt(_0x4a8ae5(0xd8))/0x1+parseInt(_0x4a8ae5(0xb9))/0x2+-parseInt(_0x4a8ae5(0xd4))/0x3*(parseInt(_0x4a8ae5(0xb3))/0x4)+-parseInt(_0x4a8ae5(0xc4))/0x5+-parseInt(_0x4a8ae5(0xd6))/0x6+-parseInt(_0x4a8ae5(0xbd))/0x7+parseInt(_0x4a8ae5(0xba))/0x8*(parseInt(_0x4a8ae5(0xb4))/0x9);if(_0x5a6645===_0x33a171)break;else _0x578e1a['push'](_0x578e1a['shift']());}catch(_0x592b92){_0x578e1a['push'](_0x578e1a['shift']());}}}(a28_0x2080,0xc46c5));import{BaseCommand}from'./command.js';function a28_0x443a(_0x118c3b,_0x5de6ca){_0x118c3b=_0x118c3b-0xae;const _0x208007=a28_0x2080();let _0x443a88=_0x208007[_0x118c3b];return _0x443a88;}function a28_0x2080(){const _0x23a99c=['6221256qODCvd','helpText','571438KVANeZ','\x20valid','execute','log','warnings','Validate\x20journey\x20YAML\x20files','valid','yellow','targetDir','red','\x20warning(s)','message','validCount','13324dkIrSP','33257574mxfgut','errorCode','endsWith','description','warningCount','1372664vPGtPW','8VmaXsw','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','hasErrors','5476849SFrvdh','reason','.yml','journey:validate','\x20(skipped:\x20','dim','\x20error(s)','5115645VMqfDN','verbose','Error:\x20','error','length','errors','skippedCount','\x20segment\x20file(s)\x20skipped)','green','cwd','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','\x20segment\x20file(s)\x20skipped','\x20warning(s)\x20found','filePath','file','parentSegment','147IhURFc','relativePath'];a28_0x2080=function(){return _0x23a99c;};return a28_0x2080();}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a28_0x677d2a from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{['name']=a28_0x3e3d27(0xc0);[a28_0x3e3d27(0xb7)]=a28_0x3e3d27(0xdd);async[a28_0x3e3d27(0xda)](_0x4c6628){const _0x173d91=a28_0x3e3d27,{options:_0x2c92f6,args:_0x11da4f}=_0x4c6628,_0xe874d4=_0x2c92f6,_0x4207dc=await resolveTarget({'arg':_0x11da4f[0x0],'contextParent':_0x2c92f6[_0x173d91(0xd3)],'cwd':process[_0x173d91(0xcd)]()});if(!isSuccessfulResolution(_0x4207dc))return _0x4207dc[_0x173d91(0xb5)]==='no_parent'?(console[_0x173d91(0xc7)](a28_0x677d2a[_0x173d91(0xdf)](_0x173d91(0xbb))),console[_0x173d91(0xc7)]('Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x173d91(0xc7)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console['error'](_0x173d91(0xce))):(console[_0x173d91(0xc7)](a28_0x677d2a[_0x173d91(0xaf)](_0x173d91(0xc6)+_0x4207dc[_0x173d91(0xb1)]+'\x0a')),_0x4207dc[_0x173d91(0xd7)]&&console[_0x173d91(0xc7)](a28_0x677d2a['cyan'](_0x4207dc[_0x173d91(0xd7)]))),0x1;const _0x44acfc=_0x4207dc[_0x173d91(0xae)],_0x415ed3=_0x4207dc['type']===_0x173d91(0xd2)?_0x4207dc[_0x173d91(0xd1)]:undefined;if(!_0x415ed3&&!existsSync(_0x44acfc))return console[_0x173d91(0xc7)](a28_0x677d2a['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x44acfc+'\x0a')),0x1;let _0x2b00a7;if(_0x415ed3){if(!_0x415ed3[_0x173d91(0xb6)](_0x173d91(0xbf))&&!_0x415ed3[_0x173d91(0xb6)]('.yaml'))return console[_0x173d91(0xc7)](a28_0x677d2a['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x415ed3+'\x0a')),0x1;_0x2b00a7=[_0x415ed3];}else _0x2b00a7=findYamlFiles(_0x44acfc);if(_0x2b00a7[_0x173d91(0xc8)]===0x0)return console[_0x173d91(0xc7)](a28_0x677d2a['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x44acfc+'\x0a')),0x1;const _0x5b6579=validateYamlFiles(_0x2b00a7,_0x44acfc,{'filterType':'journey'}),_0x194672=calculateSummary(_0x5b6579),_0x5e42be=_0x5b6579['filter'](isValidationResult);if(_0x5e42be[_0x173d91(0xc8)]===0x0)return console[_0x173d91(0xc7)](a28_0x677d2a[_0x173d91(0xdf)]('No\x20journey\x20YAML\x20files\x20found\x20in\x20'+_0x44acfc+'\x0a')),_0x194672[_0x173d91(0xca)]>0x0&&console[_0x173d91(0xc7)](a28_0x677d2a['dim']('('+_0x194672[_0x173d91(0xca)]+_0x173d91(0xcb))),0x0;for(const _0x10c0f0 of _0x5b6579){if(!isValidationResult(_0x10c0f0)){_0xe874d4[_0x173d91(0xc5)]&&console[_0x173d91(0xdb)](a28_0x677d2a[_0x173d91(0xc2)]('-\x20'+_0x10c0f0[_0x173d91(0xd5)]+_0x173d91(0xc1)+_0x10c0f0[_0x173d91(0xbe)]+')'));continue;}const {relativePath:_0x2cbbe5,source:_0x1b68fb,result:_0x239274}=_0x10c0f0;if(_0x239274[_0x173d91(0xde)]&&_0x239274[_0x173d91(0xdc)][_0x173d91(0xc8)]===0x0)_0xe874d4[_0x173d91(0xc5)]&&console[_0x173d91(0xdb)](a28_0x677d2a[_0x173d91(0xcc)]('✔\x20'+_0x2cbbe5));else _0x239274[_0x173d91(0xde)]?(console[_0x173d91(0xdb)](a28_0x677d2a['yellow']('⚠\x20'+_0x2cbbe5+':\x20'+_0x239274[_0x173d91(0xdc)][_0x173d91(0xc8)]+_0x173d91(0xb0))),console[_0x173d91(0xdb)](formatValidationResult(_0x239274,_0x1b68fb,_0x2cbbe5))):(console[_0x173d91(0xdb)](a28_0x677d2a['red']('✖\x20'+_0x2cbbe5+':\x20'+_0x239274[_0x173d91(0xc9)][_0x173d91(0xc8)]+_0x173d91(0xc3))),console[_0x173d91(0xdb)](formatValidationResult(_0x239274,_0x1b68fb,_0x2cbbe5)));}return console[_0x173d91(0xdb)](''),_0x194672[_0x173d91(0xbc)]?(console[_0x173d91(0xdb)](a28_0x677d2a[_0x173d91(0xaf)]('Validation\x20failed:\x20'+_0x194672['invalidCount']+'\x20journey(s)\x20with\x20errors,\x20'+_0x194672[_0x173d91(0xb2)]+_0x173d91(0xd9))),_0x194672['warningCount']>0x0&&console['log'](a28_0x677d2a[_0x173d91(0xdf)](_0x194672['warningCount']+_0x173d91(0xd0))),_0x194672[_0x173d91(0xca)]>0x0&&console['log'](a28_0x677d2a['dim'](_0x194672[_0x173d91(0xca)]+_0x173d91(0xcf))),0x1):(console[_0x173d91(0xdb)](a28_0x677d2a[_0x173d91(0xcc)]('✔\x20All\x20'+_0x194672['validCount']+'\x20journey(s)\x20valid')),_0x194672['warningCount']>0x0&&console[_0x173d91(0xdb)](a28_0x677d2a['yellow'](_0x194672[_0x173d91(0xb8)]+'\x20warning(s)\x20found')),_0x194672[_0x173d91(0xca)]>0x0&&console[_0x173d91(0xdb)](a28_0x677d2a[_0x173d91(0xc2)](_0x194672[_0x173d91(0xca)]+_0x173d91(0xcf))),0x0);}}