@treasuredata/tdx 2026.4.12 → 2026.4.13

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
+ const a25_0x4a4d66=a25_0xfd22;(function(_0x496a74,_0x5786e6){const _0x3f5a23=a25_0xfd22,_0x568651=_0x496a74();while(!![]){try{const _0x293353=parseInt(_0x3f5a23(0xa2))/0x1*(parseInt(_0x3f5a23(0x91))/0x2)+-parseInt(_0x3f5a23(0x84))/0x3*(-parseInt(_0x3f5a23(0x80))/0x4)+-parseInt(_0x3f5a23(0x95))/0x5*(-parseInt(_0x3f5a23(0x99))/0x6)+parseInt(_0x3f5a23(0x85))/0x7*(-parseInt(_0x3f5a23(0x8e))/0x8)+-parseInt(_0x3f5a23(0x88))/0x9*(parseInt(_0x3f5a23(0x98))/0xa)+-parseInt(_0x3f5a23(0x96))/0xb+-parseInt(_0x3f5a23(0x75))/0xc*(-parseInt(_0x3f5a23(0x86))/0xd);if(_0x293353===_0x5786e6)break;else _0x568651['push'](_0x568651['shift']());}catch(_0x31304f){_0x568651['push'](_0x568651['shift']());}}}(a25_0x22d7,0x99c9a));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a25_0x1a2f67 from'chalk';import a25_0x49e305 from'path';function a25_0xfd22(_0x49527c,_0x6cfba2){_0x49527c=_0x49527c-0x72;const _0x22d756=a25_0x22d7();let _0xfd2245=_0x22d756[_0x49527c];return _0xfd2245;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a25_0x4a4d66(0x7e)]='engage:template:validate';[a25_0x4a4d66(0x7f)]=a25_0x4a4d66(0x7a);async['execute'](_0x48830f){const _0x375691=a25_0x4a4d66,{options:_0x1627e0,args:_0x5c72e1}=_0x48830f,_0x4c76a1=_0x1627e0,_0x5874aa=_0x5c72e1[0x0],_0x2cc7da=_0x5874aa?a25_0x49e305[_0x375691(0x76)](_0x5874aa):undefined,_0x5ee82f=_0x2cc7da?isYamlFile(_0x2cc7da):![];let _0x38297e,_0x2d643a;if(_0x5ee82f&&_0x2cc7da)_0x38297e=a25_0x49e305[_0x375691(0x94)](_0x2cc7da),_0x2d643a=_0x2cc7da;else _0x2cc7da?_0x38297e=_0x2cc7da:_0x38297e=process['cwd']();if(!_0x2d643a&&!existsSync(_0x38297e))return console[_0x375691(0xa3)](a25_0x1a2f67['red'](_0x375691(0x9e)+_0x38297e+'\x0a')),0x1;let _0x2a7199;if(_0x2d643a){if(!_0x2d643a[_0x375691(0x8f)]('.yml')&&!_0x2d643a[_0x375691(0x8f)](_0x375691(0x90)))return console[_0x375691(0xa3)](a25_0x1a2f67[_0x375691(0x79)](_0x375691(0x92)+_0x2d643a+'\x0a')),0x1;_0x2a7199=[_0x2d643a];}else _0x2a7199=findYamlFiles(_0x38297e);if(_0x2a7199[_0x375691(0x9a)]===0x0)return console[_0x375691(0xa3)](a25_0x1a2f67[_0x375691(0x79)](_0x375691(0x78)+_0x38297e+'\x0a')),0x1;const _0x3189de=validateYamlFiles(_0x2a7199,_0x38297e,{'filterType':_0x375691(0x7b)}),_0x2344df=calculateSummary(_0x3189de),_0x46ef69=_0x3189de[_0x375691(0x7d)](isValidationResult);if(_0x46ef69['length']===0x0)return console[_0x375691(0xa3)](a25_0x1a2f67['yellow'](_0x375691(0x9b)+_0x38297e+'\x0a')),_0x2344df[_0x375691(0x82)]>0x0&&console['error'](a25_0x1a2f67[_0x375691(0xa1)]('('+_0x2344df[_0x375691(0x82)]+'\x20non-template\x20file(s)\x20skipped)')),0x0;for(const _0x335d67 of _0x3189de){if(!isValidationResult(_0x335d67)){_0x4c76a1['verbose']&&console['log'](a25_0x1a2f67[_0x375691(0xa1)]('-\x20'+_0x335d67['relativePath']+_0x375691(0x73)+_0x335d67[_0x375691(0x83)]+')'));continue;}const {relativePath:_0x4421ce,source:_0x460cd8,result:_0x3fa568}=_0x335d67;if(_0x3fa568['valid']&&_0x3fa568[_0x375691(0x8b)]['length']===0x0)_0x4c76a1[_0x375691(0x9c)]&&console['log'](a25_0x1a2f67['green']('✔\x20'+_0x4421ce));else _0x3fa568[_0x375691(0xa0)]?(console[_0x375691(0x89)](a25_0x1a2f67[_0x375691(0x8d)]('⚠\x20'+_0x4421ce+':\x20'+_0x3fa568[_0x375691(0x8b)]['length']+_0x375691(0x74))),console[_0x375691(0x89)](formatValidationResult(_0x3fa568,_0x460cd8,_0x4421ce))):(console[_0x375691(0x89)](a25_0x1a2f67[_0x375691(0x79)]('✖\x20'+_0x4421ce+':\x20'+_0x3fa568['errors']['length']+_0x375691(0x81))),console[_0x375691(0x89)](formatValidationResult(_0x3fa568,_0x460cd8,_0x4421ce)));}return console['log'](''),_0x2344df[_0x375691(0x97)]?(console[_0x375691(0x89)](a25_0x1a2f67[_0x375691(0x79)]('Validation\x20failed:\x20'+_0x2344df[_0x375691(0x9d)]+_0x375691(0x9f)+_0x2344df[_0x375691(0x77)]+'\x20valid')),_0x2344df[_0x375691(0x8a)]>0x0&&console[_0x375691(0x89)](a25_0x1a2f67[_0x375691(0x8d)](_0x2344df[_0x375691(0x8a)]+_0x375691(0x7c))),_0x2344df['skippedCount']>0x0&&console[_0x375691(0x89)](a25_0x1a2f67[_0x375691(0xa1)](_0x2344df['skippedCount']+_0x375691(0x8c))),0x1):(console[_0x375691(0x89)](a25_0x1a2f67[_0x375691(0x72)](_0x375691(0x93)+_0x2344df[_0x375691(0x77)]+_0x375691(0x87))),_0x2344df[_0x375691(0x8a)]>0x0&&console[_0x375691(0x89)](a25_0x1a2f67[_0x375691(0x8d)](_0x2344df[_0x375691(0x8a)]+_0x375691(0x7c))),_0x2344df[_0x375691(0x82)]>0x0&&console[_0x375691(0x89)](a25_0x1a2f67[_0x375691(0xa1)](_0x2344df[_0x375691(0x82)]+_0x375691(0x8c))),0x0);}}function a25_0x22d7(){const _0x5df251=['verbose','invalidCount','Error:\x20Directory\x20not\x20found:\x20','\x20template(s)\x20with\x20errors,\x20','valid','dim','453221SUwKmA','error','green','\x20(skipped:\x20','\x20warning(s)','144kgohJg','resolve','validCount','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','red','Validate\x20template\x20YAML\x20files','template','\x20warning(s)\x20found','filter','name','description','182524WxsueP','\x20error(s)','skippedCount','reason','24LkIvhi','14iWLTJl','978289oJUWiv','\x20template(s)\x20valid','4851prAgJr','log','warningCount','warnings','\x20non-template\x20file(s)\x20skipped','yellow','921328LzrPZp','endsWith','.yaml','2WOLMaF','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','✔\x20All\x20','dirname','1282165rdowYg','10273670ctWsjW','hasErrors','12920kHPvtE','18JIBVtl','length','No\x20template\x20YAML\x20files\x20found\x20in\x20'];a25_0x22d7=function(){return _0x5df251;};return a25_0x22d7();}
@@ -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_0x4a4b11=a26_0xc52b;(function(_0x38f3b5,_0x450a98){const _0x582976=a26_0xc52b,_0x1e76f1=_0x38f3b5();while(!![]){try{const _0x55c57c=-parseInt(_0x582976(0xdf))/0x1*(-parseInt(_0x582976(0xe3))/0x2)+parseInt(_0x582976(0xc6))/0x3*(-parseInt(_0x582976(0xe7))/0x4)+-parseInt(_0x582976(0xf5))/0x5+-parseInt(_0x582976(0xc3))/0x6*(-parseInt(_0x582976(0xd6))/0x7)+-parseInt(_0x582976(0xf4))/0x8+-parseInt(_0x582976(0xdd))/0x9+parseInt(_0x582976(0x10e))/0xa*(parseInt(_0x582976(0x104))/0xb);if(_0x55c57c===_0x450a98)break;else _0x1e76f1['push'](_0x1e76f1['shift']());}catch(_0x513ff5){_0x1e76f1['push'](_0x1e76f1['shift']());}}}(a26_0x1c1f,0xb518c));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';function a26_0xc52b(_0x173897,_0x292d4d){_0x173897=_0x173897-0xc1;const _0x1c1f1a=a26_0x1c1f();let _0xc52b1=_0x1c1f1a[_0x173897];return _0xc52b1;}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_0x2ccbcc from'chalk';function formatDuration(_0x4377bf){const _0x2664f3=a26_0xc52b;if(_0x4377bf<0x3c)return _0x4377bf+'s';if(_0x4377bf<0xe10)return Math['floor'](_0x4377bf/0x3c)+'m\x20'+_0x4377bf%0x3c+'s';const _0xb39ad6=Math[_0x2664f3(0xee)](_0x4377bf/0xe10),_0x4388e8=Math['floor'](_0x4377bf%0xe10/0x3c);return _0x4388e8>0x0?_0xb39ad6+'h\x20'+_0x4388e8+'m':_0xb39ad6+'h';}function formatRelativeTime(_0x43cdcf){const _0x109bc4=a26_0xc52b,_0x25e783=Date[_0x109bc4(0xcb)]()-_0x43cdcf[_0x109bc4(0x100)](),_0x45898e=Math['floor'](Math[_0x109bc4(0xfc)](_0x25e783)/0x3e8);if(_0x45898e<0x3c)return'just\x20now';const _0x405694=Math[_0x109bc4(0xee)](_0x45898e/0x3c);if(_0x405694<0x3c)return _0x405694+_0x109bc4(0xe6);const _0x38dfa1=Math['floor'](_0x405694/0x3c);if(_0x38dfa1<0x18)return _0x38dfa1+_0x109bc4(0xf8);const _0x5712b3=Math[_0x109bc4(0xee)](_0x38dfa1/0x18);if(_0x5712b3<0x1e)return _0x5712b3+_0x109bc4(0x109);return Math[_0x109bc4(0xee)](_0x5712b3/0x1e)+_0x109bc4(0x103);}export class JobListCommand extends BaseCommand{[a26_0x4a4b11(0xfa)]=a26_0x4a4b11(0xd9);[a26_0x4a4b11(0x112)]=a26_0x4a4b11(0x117);async['execute'](_0x8680fb){const _0x5a38e3=a26_0x4a4b11,{options:_0x4c714c,tdx:_0x3d1d83}=_0x8680fb,_0x52b31c=resolveLimit(_0x4c714c[_0x5a38e3(0x101)],DEFAULT_DISPLAY_LIMIT),_0x2d166b=_0x4c714c[_0x5a38e3(0xfe)];_0x4c714c[_0x5a38e3(0xd3)]&&(console[_0x5a38e3(0xf1)](_0x5a38e3(0xe5)+_0x52b31c+_0x5a38e3(0xc9)),_0x2d166b&&console['error'](_0x5a38e3(0xd8)+_0x2d166b));const _0x536969=await withSpinner(_0x5a38e3(0xf7),()=>_0x3d1d83['jobs'][_0x5a38e3(0xe1)]({'from':0x0,'to':_0x52b31c-0x1,'status':_0x2d166b}),{'verbose':_0x4c714c[_0x5a38e3(0xd3)]}),_0x20f0ce=_0x536969['data'];console[_0x5a38e3(0xf1)]('✔\x20Found\x20'+_0x20f0ce[_0x5a38e3(0x10a)]+_0x5a38e3(0x110)+(_0x20f0ce[_0x5a38e3(0x10a)]!==0x1?'s':''));const _0x396f1f=_0x4c714c[_0x5a38e3(0x106)];if(isStructuredFormat(_0x4c714c)){const _0x33a390=_0x20f0ce[_0x5a38e3(0x10c)](_0x2daf8c=>{const _0x22bc39=_0x5a38e3;let _0x437119;if(_0x2daf8c['start_at']&&_0x2daf8c['end_at']){const _0xdcdbb=new Date(_0x2daf8c[_0x22bc39(0x119)])['getTime'](),_0x5ba4fe=new Date(_0x2daf8c['end_at'])[_0x22bc39(0x100)]();_0x437119=Math[_0x22bc39(0xec)]((_0x5ba4fe-_0xdcdbb)/0x3e8);}return{'job_id':_0x2daf8c[_0x22bc39(0xf3)],'type':_0x2daf8c[_0x22bc39(0xe9)]===_0x22bc39(0xde)?_0x22bc39(0x115):_0x2daf8c[_0x22bc39(0xe9)],'status':_0x2daf8c[_0x22bc39(0xfe)],'user_name':_0x2daf8c[_0x22bc39(0x10d)],'duration_sec':_0x437119,'created_at':_0x2daf8c[_0x22bc39(0xd5)],'started_at':_0x2daf8c[_0x22bc39(0x119)],'end_at':_0x2daf8c[_0x22bc39(0x105)]};});await handleSDKOutput(_0x33a390,_0x4c714c);}else for(const _0x3aa177 of _0x20f0ce){const _0x3a7469=_0x3aa177['status']===_0x5a38e3(0xf2)?a26_0x2ccbcc[_0x5a38e3(0x118)]:_0x3aa177[_0x5a38e3(0xfe)]===_0x5a38e3(0xf1)?a26_0x2ccbcc['red']:a26_0x2ccbcc['dim'],_0x431080=_0x3a7469(_0x3aa177[_0x5a38e3(0xfe)]),_0x302052=getJobUrl(_0x396f1f,_0x3aa177[_0x5a38e3(0xf3)]),_0x2004ab=hyperlink(_0x3aa177[_0x5a38e3(0xf3)],_0x302052),_0x4273da=a26_0x2ccbcc['dim'](_0x3aa177[_0x5a38e3(0xe9)]===_0x5a38e3(0xde)?'trino':_0x3aa177[_0x5a38e3(0xe9)]),_0x3fe392=[];if(_0x3aa177[_0x5a38e3(0x119)]&&_0x3aa177['end_at']){const _0x53dc2f=Math[_0x5a38e3(0xec)]((new Date(_0x3aa177[_0x5a38e3(0x105)])[_0x5a38e3(0x100)]()-new Date(_0x3aa177[_0x5a38e3(0x119)])['getTime']())/0x3e8);_0x3fe392[_0x5a38e3(0xc7)](formatDuration(_0x53dc2f));}if(_0x3aa177[_0x5a38e3(0x105)])_0x3fe392[_0x5a38e3(0xc7)](formatRelativeTime(new Date(_0x3aa177[_0x5a38e3(0x105)])));else _0x3aa177[_0x5a38e3(0x119)]&&_0x3fe392['push'](formatRelativeTime(new Date(_0x3aa177[_0x5a38e3(0x119)])));const _0xa86211=_0x3fe392['length']>0x0?a26_0x2ccbcc['dim']('\x20'+_0x3fe392[_0x5a38e3(0xf0)](',\x20')):'';console['log']('⚡\x20'+_0x2004ab+'\x20'+_0x4273da+'\x20'+_0x431080+_0xa86211);}return 0x0;}}function a26_0x1c1f(){const _0x4c77cb=['Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','Listing\x20jobs...','h\x20ago','✔\x20Job\x20submitted','name','submit','abs','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','status','debug','getTime','limit','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','mo\x20ago','11iKBfTr','end_at','site','kill','substring','d\x20ago','length','INVALID_ARGUMENT','map','user_name','25249330SxDBiZ','priority','\x20job','\x27\x20to\x20verify\x20the\x20job\x20status','description','validate','args','trino','Submitting\x20kill\x20request...','List\x20jobs','green','start_at','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','Getting\x20job\x20results...','\x20\x20Job\x20ID:\x20','2224608sfdIaS','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','job:kill','19785iMbbAB','push','Cancelled','\x20jobs','data','now','url','query','\x20row','information_schema','Submitting\x20job...','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','No\x20SQL\x20statements\x20found\x20in\x20file','verbose','job:submit','created_at','14mTKwFw','Getting\x20job\x20details...','Status\x20filter:\x20','jobs','result','database','Submit\x20a\x20job','9687096dJfQqU','presto','1msBuEg','yes','list','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','1089078ADtQnz','job:show','Limit:\x20','m\x20ago','148IuvoPQ','Kill\x20a\x20job','type','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','jobType','round','execute','floor','Database:\x20','join','error','success','job_id','8693344YscjZa','3311045OurBQW'];a26_0x1c1f=function(){return _0x4c77cb;};return a26_0x1c1f();}export class JobShowCommand extends BaseCommand{[a26_0x4a4b11(0xfa)]=a26_0x4a4b11(0xe4);['description']='Show\x20job\x20details';[a26_0x4a4b11(0x113)](_0xa17042){const _0x4aa310=a26_0x4a4b11,_0xf46b64=_0xa17042[_0x4aa310(0x114)][0x0];if(!_0xf46b64)return _0x4aa310(0xf6);return undefined;}async['execute'](_0x1642bf){const _0x43444a=a26_0x4a4b11,{options:_0x1a4bda,args:_0x1d6de3,tdx:_0x318402}=_0x1642bf,_0x5954ac=_0x1d6de3[0x0],_0x51e862=await withSpinner(_0x43444a(0xd7),()=>_0x318402['jobs']['show'](_0x5954ac),{'verbose':_0x1a4bda[_0x43444a(0xd3)]}),_0x5b429c=_0x51e862[_0x43444a(0xca)];let _0x389e45;if(_0x5b429c['start_at']&&_0x5b429c[_0x43444a(0x105)]){const _0x5cff4d=new Date(_0x5b429c[_0x43444a(0x119)])[_0x43444a(0x100)](),_0x5b808a=new Date(_0x5b429c[_0x43444a(0x105)])[_0x43444a(0x100)]();_0x389e45=Math[_0x43444a(0xec)]((_0x5b808a-_0x5cff4d)/0x3e8);}const _0x343221={'job_id':_0x5b429c[_0x43444a(0xf3)],'type':_0x5b429c[_0x43444a(0xe9)],'status':_0x5b429c[_0x43444a(0xfe)],..._0x5b429c[_0x43444a(0x10d)]&&{'user_name':_0x5b429c[_0x43444a(0x10d)]},..._0x389e45!==undefined&&{'duration_sec':_0x389e45},..._0x5b429c[_0x43444a(0xd5)]&&{'created_at':_0x5b429c['created_at']},..._0x5b429c[_0x43444a(0x119)]&&{'started_at':_0x5b429c[_0x43444a(0x119)]},..._0x5b429c[_0x43444a(0x105)]&&{'end_at':_0x5b429c['end_at']},..._0x5b429c[_0x43444a(0xdb)]&&{'database':_0x5b429c[_0x43444a(0xdb)]},..._0x5b429c[_0x43444a(0x10f)]!==undefined&&{'priority':_0x5b429c[_0x43444a(0x10f)]},..._0x5b429c[_0x43444a(0xcc)]&&{'url':_0x5b429c[_0x43444a(0xcc)]},..._0x5b429c[_0x43444a(0xcd)]&&{'query':_0x5b429c[_0x43444a(0xcd)]},..._0x5b429c[_0x43444a(0xff)]&&{'debug':_0x5b429c[_0x43444a(0xff)]}};return await handleSingleObjectOutput(_0x343221,_0x1a4bda),0x0;}}export class JobKillCommand extends BaseCommand{['name']=a26_0x4a4b11(0xc5);[a26_0x4a4b11(0x112)]=a26_0x4a4b11(0xe8);[a26_0x4a4b11(0x113)](_0x417864){const _0x26a624=a26_0x4a4b11,_0x45af19=_0x417864['args'][0x0];if(!_0x45af19)return _0x26a624(0x102);return undefined;}async['execute'](_0x232310){const _0x429cb6=a26_0x4a4b11,{options:_0x21b3ec,args:_0x4b1be1,tdx:_0x47d761}=_0x232310,_0x5599cc=_0x4b1be1[0x0];if(!_0x21b3ec[_0x429cb6(0xe0)]){const _0xb5c902=await confirm(_0x429cb6(0xea)+_0x5599cc+'?');if(!_0xb5c902)return console['error'](_0x429cb6(0xc8)),0x0;}return await withSpinner(_0x429cb6(0x116),()=>_0x47d761[_0x429cb6(0xd9)][_0x429cb6(0x107)](_0x5599cc),{'verbose':_0x21b3ec[_0x429cb6(0xd3)]}),console[_0x429cb6(0xf1)](_0x429cb6(0x11a)+_0x5599cc),console[_0x429cb6(0xf1)](_0x429cb6(0xe2)+_0x5599cc+_0x429cb6(0x111)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a26_0x4a4b11(0xfa)]=a26_0x4a4b11(0xd4);[a26_0x4a4b11(0x112)]=a26_0x4a4b11(0xdc);async[a26_0x4a4b11(0xed)](_0x50c363){const _0x446f78=a26_0x4a4b11,{options:_0x1ea501,args:_0x555e37,tdx:_0x12eb19}=_0x50c363,_0x2c9664=_0x1ea501[_0x446f78(0xeb)]||_0x446f78(0x115),_0x179c31=_0x1ea501['file'],_0x4027e6=_0x1ea501[_0x446f78(0xdb)]||_0x446f78(0xcf),_0x267606=_0x1ea501[_0x446f78(0xda)];if(_0x2c9664!==_0x446f78(0x115)&&_0x2c9664!=='hive')throw new SDKError(ErrorCode[_0x446f78(0x10b)],_0x446f78(0xfd));let _0x404e03;if(_0x179c31){if(_0x555e37[0x0])throw new SDKError(ErrorCode[_0x446f78(0x10b)],'Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option');const _0x40a118=readSqlStatementsFromFile(_0x179c31);if(_0x40a118[_0x446f78(0x10a)]===0x0)throw new SDKError(ErrorCode[_0x446f78(0x10b)],_0x446f78(0xd2));if(_0x40a118['length']>0x1)throw new SDKError(ErrorCode[_0x446f78(0x10b)],_0x446f78(0xc4));_0x404e03=_0x40a118[0x0];}else{if(!_0x555e37[0x0])throw new SDKError(ErrorCode[_0x446f78(0x10b)],_0x446f78(0xd1));_0x404e03=_0x555e37[0x0];}_0x1ea501[_0x446f78(0xd3)]&&(console[_0x446f78(0xf1)]('Job\x20type:\x20'+_0x2c9664),console[_0x446f78(0xf1)](_0x446f78(0xef)+_0x4027e6),console[_0x446f78(0xf1)]('Query:\x20'+_0x404e03[_0x446f78(0x108)](0x0,0x64)+(_0x404e03[_0x446f78(0x10a)]>0x64?'...':'')));const _0x2532e4=await withSpinner(_0x446f78(0xd0),()=>_0x12eb19['jobs'][_0x446f78(0xfb)](_0x4027e6,_0x404e03,_0x2c9664,_0x267606),{'verbose':_0x1ea501[_0x446f78(0xd3)]}),_0x5a2da6=_0x2532e4[_0x446f78(0xca)];return console['error'](_0x446f78(0xf9)),console['error'](_0x446f78(0xc2)+_0x5a2da6[_0x446f78(0xf3)]),await handleSDKOutput([_0x5a2da6],_0x1ea501),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x4a4b11(0xfa)]='job:result';[a26_0x4a4b11(0x112)]='Get\x20job\x20results';[a26_0x4a4b11(0x113)](_0x1dfa9c){const _0x345493=_0x1dfa9c['args'][0x0];if(!_0x345493)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a26_0x4a4b11(0xed)](_0x5aa265){const _0x21521b=a26_0x4a4b11,{options:_0x1586cf,args:_0x4cc82f,tdx:_0x202828}=_0x5aa265,_0x4bc2ce=_0x4cc82f[0x0],_0x462d3d=await withSpinner(_0x21521b(0xc1),()=>_0x202828[_0x21521b(0xd9)][_0x21521b(0xda)](_0x4bc2ce),{'verbose':_0x1586cf[_0x21521b(0xd3)]}),_0x36d3c5=_0x462d3d[_0x21521b(0xca)];return console[_0x21521b(0xf1)]('✔\x20Retrieved\x20'+_0x36d3c5['length']+_0x21521b(0xce)+(_0x36d3c5[_0x21521b(0x10a)]!==0x1?'s':'')),await handleSDKOutput(_0x36d3c5,_0x1586cf),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_0x36855a=a27_0x8afc;(function(_0x47c143,_0x3a8765){const _0x5b8dcd=a27_0x8afc,_0x1fd050=_0x47c143();while(!![]){try{const _0x1f8535=parseInt(_0x5b8dcd(0x1ed))/0x1+-parseInt(_0x5b8dcd(0x2ad))/0x2+-parseInt(_0x5b8dcd(0x28a))/0x3*(-parseInt(_0x5b8dcd(0x1f0))/0x4)+parseInt(_0x5b8dcd(0x207))/0x5*(-parseInt(_0x5b8dcd(0x1f2))/0x6)+parseInt(_0x5b8dcd(0x281))/0x7*(-parseInt(_0x5b8dcd(0x288))/0x8)+parseInt(_0x5b8dcd(0x24e))/0x9*(-parseInt(_0x5b8dcd(0x275))/0xa)+parseInt(_0x5b8dcd(0x2b0))/0xb;if(_0x1f8535===_0x3a8765)break;else _0x1fd050['push'](_0x1fd050['shift']());}catch(_0x5ea8a4){_0x1fd050['push'](_0x1fd050['shift']());}}}(a27_0xe32a,0x23544));import a27_0x1988d7 from'chalk';import a27_0x17c755 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';function a27_0x8afc(_0x7517eb,_0x13bc83){_0x7517eb=_0x7517eb-0x1b7;const _0xe32a05=a27_0xe32a();let _0x8afc1a=_0xe32a05[_0x7517eb];return _0x8afc1a;}import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x3d6752){const _0x1782d3=a27_0x8afc;return!_0x3d6752&&(console[_0x1782d3(0x1df)](_0x1782d3(0x26a)),console[_0x1782d3(0x1df)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x3d6752;}function withJsonFormat(_0x107d31){const _0x377d99=a27_0x8afc;if(!_0x107d31[_0x377d99(0x250)]&&!_0x107d31['json']&&!_0x107d31[_0x377d99(0x21d)]&&!_0x107d31[_0x377d99(0x1d0)])return{..._0x107d31,'format':_0x377d99(0x1f7),'json':!![]};return _0x107d31;}function formatJourneyState(_0x2e8773){const _0x3c4be0=a27_0x8afc;switch(_0x2e8773){case _0x3c4be0(0x1ee):return a27_0x1988d7['green'](_0x3c4be0(0x296));case'draft':return a27_0x1988d7[_0x3c4be0(0x249)]('(draft)');case _0x3c4be0(0x231):return a27_0x1988d7['yellow'](_0x3c4be0(0x1c3));case _0x3c4be0(0x211):return a27_0x1988d7[_0x3c4be0(0x20b)](_0x3c4be0(0x241));case _0x3c4be0(0x1d8):return a27_0x1988d7[_0x3c4be0(0x249)](_0x3c4be0(0x204));default:return'('+_0x2e8773+')';}}function formatJourneyItem(_0x5c7782,_0x91ec7b='',_0x1a14ca){const _0x221383=a27_0x8afc,_0x3c8dc0=formatJourneyState(_0x5c7782[_0x221383(0x233)]),_0x1afe60=_0x1a14ca?hyperlink(_0x5c7782['journeyBundleName'],_0x1a14ca):_0x5c7782[_0x221383(0x1cf)];return _0x91ec7b+_0x221383(0x1e1)+_0x1afe60+'\x20'+_0x3c8dc0;}function escapeRegex(_0x13bd1c){const _0x5aef97=a27_0x8afc;return _0x13bd1c[_0x5aef97(0x26b)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}function a27_0xe32a(){const _0x1cd488=['buildIdToEmailMap','Getting\x20column\x20mapping...','journey','find','\x20\x20Statistics\x20not\x20available','journeyStages','(completed)','resolveJourneyId','getSegment','getTrafficData','verbose','Warning:\x20Could\x20not\x20resolve\x20segment\x20','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','journey:pause','dim','tdx.json','description','\x0aError:','map','1251aQSflm','activation','format','entries','Aborted.','Resolving\x20version...','folderId','\x20activation','\x22\x20resumed','stages','execute','journeys','parentName','get','\x20(rule\x20match)','journey:view','journey:list','kind','List\x20journeys\x20in\x20current\x20context','INVALID_ARGUMENT','No\x20statistics\x20available\x20for\x20journey:\x20','renderStats','yes','has','set','Input:\x20','no_parent','goal','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','replace','\x22\x20paused','hasPeriod','Error:\x20--version\x20option\x20is\x20required','Resuming\x20journey...','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','List\x20activations\x20for\x20a\x20journey','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error:\x20Parent\x20segment\x20context\x20required','List\x20all\x20versions\x20of\x20a\x20journey','5690QggeYw','exitOrJumpSize','from','attributes','resolveParentId','\x20journey\x20files\x20to\x20','\x20not\x20found.\x20Available:\x20','milestoneSize','\x20version','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','connection','repeat','1675303TkSorX','listJourneysFromParentSegment','Fetching\x20','links','journey:stats','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','user','8PRAdFq','isNew','44496JlKTbL','Parent\x20segment:\x20','segments','nodes',',\x20version:\x20','audienceId','activationParams','createVersion','Folder\x20path:\x20','web','\x20\x20Parent\x20segment:\x20','Export\x20journey(s)\x20as\x20YAML\x20files','(running)','Creating\x20new\x20version...','message','segment','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','journey:version:view','resolveSegment','-\x20no\x20files\x20written','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','/e/','getColumnMapping','Resolving\x20journey...','\x20Opening\x20','goalSize','values','getActivation','Target\x20file:\x20','setPhase','journeyName','\x0aChanges\x20to\x20\x27','Fetching\x20parent\x20segment...','segmentPushCommand','550228hRwpFR','getJourney','journey:columns','7057919yBnBRx','✔\x20Found\x20','Getting\x20journey\x20details...','conversion','journey:activations','green','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','sort','relativePath','getStatistics','site','Show\x20journey\x20table\x20column\x20mapping','options','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','rule','versionNumber','journeyBundleId','✔\x20Context\x20set:\x20','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','buildIdToNameMap','data','journey:pull','.yml','(paused)','utf-8','name','Fetching\x20users\x20and\x20connections...','type','\x20files?','Resolved\x20YAML\x20file:\x20','✔\x20Journey\x20\x22','cwd','\x20->\x20','log','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','journeyBundleName','tsv','updatedAt','all','Error:\x20Version\x20','filter','relative','localeCompare','stringify','archived','Error:\x20Invalid\x20version\x20number:\x20','listFolders','Resume\x20a\x20paused\x20journey','hasChanges','📁\x20','add','error','Table:\x20','🗺️\x20','/j/da/je','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','createdAt','folders','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Pattern:\x20','Database:\x20','Pausing\x20journey...','args','getParentFull','resume','229101hTwfAX','launched','stage','40oqWXnO','red','24syNuad','journeyId','helpText','absolutePath','No\x20journeys\x20found','json','join','parentSegment','View\x20a\x20specific\x20version\x20of\x20a\x20journey','toLowerCase','database','yellow','Pause\x20a\x20running\x20journey','Show\x20journey\x20statistics','version','Resolving\x20parent\x20segment...','Show\x20journey\x20details','file','(archived)','parent_segment','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','351010IAUEoL','Available\x20stages:\x20','Write\x20','Warning:\x20Could\x20not\x20resolve\x20activation\x20','blue','/j/da','\x20changed\x20files','Error:\x20','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','dryRun','completed','(root)','Error:\x20Stage\x20\x22','\x20Created\x20v','journey:versions','includeHistory','getLatestJourneyId','length','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','cyan','listActivationsFlat','push','jsonl','segmentName','journey:push','Found\x20','enteredSize','\x20\x20Target:\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','bold','\x20\x20Consolidating\x20duplicate\x20segment:\x20','Cancelled','\x20versions)','filePath','history','Getting\x20version\x20','base','...','size','rootFolderId','\x20\x20Folder\x20path:\x20','\x20\x20-\x20','paused','\x22\x20not\x20found','state','\x20new\x20files','root\x20folder','pause','\x20details...','exitOrJumpRate','includeStats','/app/ps/'];a27_0xe32a=function(){return _0x1cd488;};return a27_0xe32a();}function globToRegex(_0x21c1a9){const _0x2c6782=a27_0x8afc,_0x3b4be8=_0x21c1a9['split']('*')[_0x2c6782(0x24d)](escapeRegex);return new RegExp(_0x3b4be8[_0x2c6782(0x1f8)]('.*'),'i');}function buildRuleToNameMapping(_0x1c92ba){const _0x1a2cda=a27_0x8afc,_0x26ad53=new Map();if(_0x1c92ba[_0x1a2cda(0x28c)])for(const [_0x4d2271,_0x42a8dc]of Object[_0x1a2cda(0x251)](_0x1c92ba['segments'])){if(_0x42a8dc[_0x1a2cda(0x1ba)]){const _0x1973aa=serializeRule(_0x42a8dc[_0x1a2cda(0x1ba)]),_0x509647=_0x26ad53[_0x1a2cda(0x25b)](_0x1973aa);_0x509647?_0x509647['push'](_0x4d2271):_0x26ad53['set'](_0x1973aa,[_0x4d2271]);}}return _0x26ad53;}async function resolveJourneyIdFromInput(_0x8b3bd5,_0x28617d,_0x533597){const _0x3d2fcc=a27_0x8afc,_0x3f2acd=await resolveJourneyTarget(_0x8b3bd5,_0x28617d[_0x3d2fcc(0x1f9)],_0x28617d[_0x3d2fcc(0x245)]),_0x5486e1=_0x3f2acd[_0x3d2fcc(0x1f9)];if(!_0x5486e1)throw new SDKError(ErrorCode[_0x3d2fcc(0x261)],'Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');const _0x46e583=await withSpinner(_0x3d2fcc(0x201),()=>_0x533597[_0x3d2fcc(0x299)][_0x3d2fcc(0x279)](_0x5486e1),{'verbose':_0x28617d['verbose']}),_0x2c6644=_0x46e583[_0x3d2fcc(0x1c0)],_0x57d414=await withSpinner(_0x3d2fcc(0x2a2),()=>_0x533597[_0x3d2fcc(0x23d)][_0x3d2fcc(0x242)](_0x2c6644,_0x3f2acd['journeyName']),{'verbose':_0x28617d['verbose']});return{'journeyId':_0x57d414['data'],'journeyName':_0x3f2acd[_0x3d2fcc(0x2a9)],'parentSegmentId':_0x2c6644};}async function resolveJourneyTarget(_0x53ce79,_0x6d360,_0x156298){const _0x4d41a8=a27_0x8afc;if(isYamlFilePath(_0x53ce79))try{const _0xf04d4a=await resolveYamlFilePath(_0x53ce79);return _0x156298&&(console[_0x4d41a8(0x1df)](_0x4d41a8(0x1c9)+_0x53ce79),console[_0x4d41a8(0x1df)](_0x4d41a8(0x294)+_0xf04d4a[_0x4d41a8(0x1f9)]),console[_0x4d41a8(0x1df)]('\x20\x20Name:\x20'+_0xf04d4a[_0x4d41a8(0x21e)]),console[_0x4d41a8(0x1df)](_0x4d41a8(0x22f)+(_0xf04d4a['folderPath']||_0x4d41a8(0x212)))),{'journeyName':_0xf04d4a[_0x4d41a8(0x21e)],'parentSegment':_0xf04d4a['parentSegment'],'resolved':_0xf04d4a};}catch(_0x5d42f0){throw new SDKError(ErrorCode[_0x4d41a8(0x261)],_0x4d41a8(0x219)+_0x5d42f0[_0x4d41a8(0x298)]);}if(!_0x6d360)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4d41a8(0x1e6));return{'journeyName':_0x53ce79,'parentSegment':_0x6d360};}export class JourneyListCommand extends BaseCommand{[a27_0x36855a(0x1c5)]=a27_0x36855a(0x25e);['description']=a27_0x36855a(0x260);async['execute'](_0x278b24){const _0x6c53ab=a27_0x36855a,{options:_0x2f40e3,args:_0x1ab208,tdx:_0x4bf984}=_0x278b24,_0x4a6f62=_0x1ab208[0x0],_0x521001=_0x2f40e3[_0x6c53ab(0x1f9)];if(!_0x521001)return console['error'](_0x6c53ab(0x273)),console['error'](_0x6c53ab(0x270)),0x1;const _0x3bab00=await withSpinner(_0x6c53ab(0x201),()=>_0x4bf984[_0x6c53ab(0x299)][_0x6c53ab(0x279)](_0x521001),{'verbose':_0x2f40e3['verbose']}),_0x20692d=_0x3bab00['data'];_0x2f40e3[_0x6c53ab(0x245)]&&(console[_0x6c53ab(0x1df)]('Parent\x20segment:\x20'+_0x521001+'\x20(ID:\x20'+_0x20692d+')'),_0x4a6f62&&console[_0x6c53ab(0x1df)](_0x6c53ab(0x1e7)+_0x4a6f62));const _0x312f42=await withSpinner(_0x6c53ab(0x2ab),()=>_0x4bf984[_0x6c53ab(0x299)][_0x6c53ab(0x1eb)](_0x20692d),{'verbose':_0x2f40e3['verbose']}),_0x378393=_0x312f42['data'],_0x38f756=_0x378393[_0x6c53ab(0x22e)],_0x7e7efa=await withSpinner('Listing\x20journeys...',()=>_0x4bf984[_0x6c53ab(0x23d)]['listJourneysWithFolders'](_0x20692d,_0x38f756),{'verbose':_0x2f40e3[_0x6c53ab(0x245)]});let _0x381222=_0x7e7efa['data'][_0x6c53ab(0x259)];const _0x14e613=_0x7e7efa[_0x6c53ab(0x1c0)][_0x6c53ab(0x1e5)],_0x3bf9f4=new Map();for(const _0x1f1c6b of _0x14e613){_0x3bf9f4[_0x6c53ab(0x266)](_0x1f1c6b['id'],_0x1f1c6b[_0x6c53ab(0x1c5)]);}if(_0x4a6f62){const _0x4d948f=globToRegex(_0x4a6f62);_0x381222=_0x381222['filter'](_0x3221f7=>_0x4d948f['test'](_0x3221f7[_0x6c53ab(0x1cf)]));}console[_0x6c53ab(0x1df)](_0x6c53ab(0x2b1)+_0x381222['length']+'\x20journey'+(_0x381222[_0x6c53ab(0x218)]!==0x1?'s':''));const _0x1291a4=_0xb909d6=>{const _0x48d77b=_0x6c53ab;return getConsoleNextUrl(_0x2f40e3[_0x48d77b(0x2ba)],_0x48d77b(0x23a)+_0x20692d+_0x48d77b(0x2a0)+_0xb909d6+_0x48d77b(0x20c));};if(_0x2f40e3[_0x6c53ab(0x250)]==='table')await handleSDKOutput(_0x381222,_0x2f40e3);else{if(_0x2f40e3['format']===_0x6c53ab(0x1f7)){const _0x5c7741=_0x381222[_0x6c53ab(0x24d)](_0xdf497c=>({..._0xdf497c,'url':_0x1291a4(_0xdf497c['id'])}));await handleSDKOutput(_0x5c7741,_0x2f40e3);}else{console[_0x6c53ab(0x1cd)]('['+_0x521001+']');const _0x1f0b84=new Map(),_0x1972d6=[];for(const _0x5018d7 of _0x381222){if(!_0x5018d7[_0x6c53ab(0x254)]||_0x5018d7['folderId']===_0x38f756)_0x1972d6[_0x6c53ab(0x21c)](_0x5018d7);else{const _0x1a04b2=_0x1f0b84[_0x6c53ab(0x25b)](_0x5018d7[_0x6c53ab(0x254)])||[];_0x1a04b2[_0x6c53ab(0x21c)](_0x5018d7),_0x1f0b84[_0x6c53ab(0x266)](_0x5018d7[_0x6c53ab(0x254)],_0x1a04b2);}}const _0x322094=(_0xcdbf80,_0x17ff7e)=>_0xcdbf80[_0x6c53ab(0x1cf)][_0x6c53ab(0x1d6)](_0x17ff7e['journeyBundleName'],undefined,{'sensitivity':_0x6c53ab(0x22b)});_0x1972d6[_0x6c53ab(0x2b7)](_0x322094);for(const _0x133626 of _0x1972d6){console[_0x6c53ab(0x1cd)](formatJourneyItem(_0x133626,'',_0x1291a4(_0x133626['id'])));}const _0x2ef66f=[..._0x1f0b84[_0x6c53ab(0x251)]()][_0x6c53ab(0x2b7)]((_0x35e29e,_0x385e74)=>{const _0x4af872=_0x6c53ab,_0xc962d3=_0x3bf9f4[_0x4af872(0x25b)](_0x35e29e[0x0])||_0x35e29e[0x0],_0x29a422=_0x3bf9f4[_0x4af872(0x25b)](_0x385e74[0x0])||_0x385e74[0x0];return _0xc962d3[_0x4af872(0x1d6)](_0x29a422,undefined,{'sensitivity':_0x4af872(0x22b)});});for(const [_0x545ac1,_0x16678b]of _0x2ef66f){const _0x52698d=_0x3bf9f4[_0x6c53ab(0x25b)](_0x545ac1)||_0x545ac1;console[_0x6c53ab(0x1cd)](_0x6c53ab(0x1dd)+_0x52698d),_0x16678b[_0x6c53ab(0x2b7)](_0x322094);for(const _0x21b14e of _0x16678b){console[_0x6c53ab(0x1cd)](formatJourneyItem(_0x21b14e,'\x20\x20',_0x1291a4(_0x21b14e['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x36855a(0x1c5)]=a27_0x36855a(0x25d);[a27_0x36855a(0x24b)]=a27_0x36855a(0x202);async['execute'](_0x2897aa){const _0x2e15e5=a27_0x36855a,{options:_0x1ed0e7,args:_0x5a6b56,tdx:_0x3a6be2}=_0x2897aa,_0x208ba4=_0x5a6b56[0x0];if(!_0x208ba4)return console[_0x2e15e5(0x1df)](_0x2e15e5(0x26a)),console[_0x2e15e5(0x1df)](_0x2e15e5(0x29f)),console[_0x2e15e5(0x1df)]('Options:'),console[_0x2e15e5(0x1df)]('\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser'),0x1;_0x1ed0e7[_0x2e15e5(0x245)]&&console[_0x2e15e5(0x1df)](_0x2e15e5(0x267)+_0x208ba4);const {journeyId:_0x1d6436,parentSegmentId:_0x443574}=await resolveJourneyIdFromInput(_0x208ba4,_0x1ed0e7,_0x3a6be2);if(_0x1ed0e7[_0x2e15e5(0x293)]){const _0x4ab1df=getConsoleNextUrl(_0x1ed0e7[_0x2e15e5(0x2ba)],'/app/ps/'+_0x443574+_0x2e15e5(0x2a0)+_0x1d6436+_0x2e15e5(0x1e2));return console[_0x2e15e5(0x1df)](a27_0x1988d7[_0x2e15e5(0x2b5)]('✔')+_0x2e15e5(0x2a3)+a27_0x1988d7['cyan'](_0x4ab1df)),openBrowser(_0x4ab1df),0x0;}const _0x291d33=await withSpinner(_0x2e15e5(0x2b2),()=>_0x3a6be2[_0x2e15e5(0x23d)][_0x2e15e5(0x2ae)](_0x1d6436),{'verbose':_0x1ed0e7[_0x2e15e5(0x245)]}),_0x31b899=_0x291d33[_0x2e15e5(0x1c0)],_0x2ccfe8=_0x1ed0e7[_0x2e15e5(0x239)];let _0xebfccb;if(_0x2ccfe8)try{const _0x210009=await withSpinner('Getting\x20journey\x20statistics...',()=>_0x3a6be2['journey']['getStatistics'](_0x1d6436),{'verbose':_0x1ed0e7[_0x2e15e5(0x245)]});_0xebfccb=_0x210009[_0x2e15e5(0x1c0)];}catch{_0x1ed0e7[_0x2e15e5(0x245)]&&console[_0x2e15e5(0x1df)](_0x2e15e5(0x23f));}const _0x36d6a5=getConsoleNextUrl(_0x1ed0e7[_0x2e15e5(0x2ba)],_0x2e15e5(0x23a)+_0x443574+_0x2e15e5(0x2a0)+_0x1d6436+'/j/da/je'),_0x25489f={'id':_0x31b899['id'],'name':_0x31b899['attributes'][_0x2e15e5(0x1c5)],'description':_0x31b899[_0x2e15e5(0x278)][_0x2e15e5(0x24b)],'state':_0x31b899[_0x2e15e5(0x278)][_0x2e15e5(0x233)],'paused':_0x31b899[_0x2e15e5(0x278)][_0x2e15e5(0x231)],'reentry_mode':_0x31b899[_0x2e15e5(0x278)]['reentryMode'],'stages':_0x31b899['attributes']['journeyStages']?.['length']||0x0,..._0x31b899[_0x2e15e5(0x278)][_0x2e15e5(0x269)]&&{'goal':_0x31b899[_0x2e15e5(0x278)][_0x2e15e5(0x269)][_0x2e15e5(0x1c5)]},..._0xebfccb&&{'statistics':{'size':_0xebfccb['size'],'entered':_0xebfccb[_0x2e15e5(0x221)],'goal_achieved':_0xebfccb[_0x2e15e5(0x2a4)],'completion_rate':_0xebfccb['completionRate'],'exit_or_jump':_0xebfccb['exitOrJumpSize'],'exit_or_jump_rate':_0xebfccb[_0x2e15e5(0x238)],'stages':_0xebfccb[_0x2e15e5(0x257)]}},'url':_0x36d6a5};return await handleSingleObjectOutput(_0x25489f,_0x1ed0e7),0x0;}}export class JourneyStatsCommand extends BaseCommand{['name']=a27_0x36855a(0x285);['description']=a27_0x36855a(0x1ff);async[a27_0x36855a(0x258)](_0x37d889){const _0x4f4510=a27_0x36855a,{options:_0x411bc8,args:_0xb55df,tdx:_0x5b533b}=_0x37d889,_0x58e772=_0xb55df[0x0];if(!requireNameOrPath(_0x58e772))return 0x1;_0x411bc8['verbose']&&console[_0x4f4510(0x1df)](_0x4f4510(0x267)+_0x58e772);const _0x18b902=_0x411bc8,_0x28bca8=_0x18b902[_0x4f4510(0x277)],_0x1563f9=_0x18b902['to'],_0x2bef90=_0x18b902[_0x4f4510(0x216)],_0x22b716=_0x18b902[_0x4f4510(0x1ef)];_0x2bef90&&!_0x28bca8&&!_0x1563f9&&console['error'](_0x4f4510(0x2b6));const _0xe1625b=_0x2bef90?withJsonFormat(_0x411bc8):_0x411bc8,{journeyId:_0x59afeb,journeyName:_0x573da6}=await resolveJourneyIdFromInput(_0x58e772,_0xe1625b,_0x5b533b),_0x3a3bbc=_0x28bca8||_0x1563f9?{'from':_0x28bca8,'to':_0x1563f9}:undefined,_0x16c5f9=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise[_0x4f4510(0x1d2)]([_0x5b533b[_0x4f4510(0x23d)][_0x4f4510(0x2ae)](_0x59afeb),_0x5b533b['journey'][_0x4f4510(0x2b9)](_0x59afeb,_0x3a3bbc)]),{'verbose':_0xe1625b['verbose']}),[_0x3451d0,_0x1f14d5]=_0x16c5f9[_0x4f4510(0x1c0)];if(!_0x1f14d5||_0x1f14d5[_0x4f4510(0x1f3)]===null)return console[_0x4f4510(0x1df)](_0x4f4510(0x262)+_0x573da6),console[_0x4f4510(0x1df)](_0x4f4510(0x27e)),0x0;const _0x4f1e29=buildStageNameMap(_0x3451d0),_0x12973d=!!(_0x3a3bbc&&_0x1f14d5[_0x4f4510(0x229)]?.['length']),_0x5a93ba={'stageNameMap':_0x4f1e29,'hasPeriod':_0x12973d,'includeHistory':!!_0x2bef90};if(_0x22b716&&_0x1f14d5[_0x4f4510(0x257)]){const _0x3253b8=_0x1f14d5[_0x4f4510(0x257)][_0x4f4510(0x23e)](_0x102d59=>{const _0x42bc54=_0x4f4510,_0x239275=_0x4f1e29[_0x42bc54(0x25b)](_0x102d59['id'])??'';return _0x239275[_0x42bc54(0x1fb)]()===_0x22b716[_0x42bc54(0x1fb)]();});if(_0x3253b8)return await handleSingleObjectOutput(formatStageStats(_0x3253b8,_0x5a93ba),_0xe1625b),0x0;const _0x373786=_0x1f14d5['stages'][_0x4f4510(0x24d)](_0x5a6454=>_0x4f1e29[_0x4f4510(0x25b)](_0x5a6454['id'])??_0x5a6454['id']);return console[_0x4f4510(0x1df)](_0x4f4510(0x213)+_0x22b716+_0x4f4510(0x232)),console[_0x4f4510(0x1df)](_0x4f4510(0x208)+_0x373786[_0x4f4510(0x1f8)](',\x20')),0x1;}const _0x3be3be=_0x1f14d5[_0x4f4510(0x257)]?.[_0x4f4510(0x24d)](_0x4ed41d=>formatStageStats(_0x4ed41d,_0x5a93ba)),_0x36d4b0=assembleJourneyStats(_0x1f14d5,{'from':_0x28bca8,'to':_0x1563f9,'includeHistory':_0x2bef90});return await this[_0x4f4510(0x263)](_0x36d4b0,_0x3be3be??[],_0xe1625b),0x0;}async[a27_0x36855a(0x263)](_0x465566,_0x3c2814,_0x346832){const _0x325caa=a27_0x36855a,_0x102e37=_0x346832['format']==='json'||_0x346832[_0x325caa(0x250)]===_0x325caa(0x21d)||_0x346832[_0x325caa(0x1f7)]||_0x346832[_0x325caa(0x21d)];if(_0x102e37){_0x465566[_0x325caa(0x257)]=_0x3c2814,await handleSingleObjectOutput(_0x465566,_0x346832);return;}await handleSingleObjectOutput(_0x465566,_0x346832);for(const _0x5e55a8 of _0x3c2814){console[_0x325caa(0x1cd)](''),console['log'](String(a27_0x1988d7[_0x325caa(0x21a)][_0x325caa(0x224)]('['+_0x5e55a8[_0x325caa(0x1c5)]+']'))+a27_0x1988d7[_0x325caa(0x249)]('\x20'+_0x5e55a8['id']));const {id:_0x564f92,name:_0x596b13,..._0x468a64}=_0x5e55a8;await handleSingleObjectOutput(_0x468a64,_0x346832);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x36855a(0x1c5)]='journey:traffic';[a27_0x36855a(0x24b)]=a27_0x36855a(0x1b9);async[a27_0x36855a(0x258)](_0x4dbf9d){const _0x28eb6e=a27_0x36855a,{options:_0x2a52e6,args:_0x182b40,tdx:_0x18aee5}=_0x4dbf9d,_0x11aff0=_0x182b40[0x0];if(!requireNameOrPath(_0x11aff0))return 0x1;_0x2a52e6[_0x28eb6e(0x245)]&&console['error'](_0x28eb6e(0x267)+_0x11aff0);const _0x57b753=_0x2a52e6,_0x1d3162=_0x57b753['type'],_0x4d631a=_0x57b753[_0x28eb6e(0x277)],_0x295e1f=_0x57b753['to'],_0xcf83e7=_0x57b753['limit'];if(_0x1d3162&&_0x1d3162!==_0x28eb6e(0x2b3)&&_0x1d3162!=='activation')return console['error']('Error:\x20Invalid\x20--type\x20\x22'+_0x1d3162+_0x28eb6e(0x1b8)),0x1;const _0xcf1d69=withJsonFormat(_0x2a52e6),{journeyId:_0x437dc9,journeyName:_0x4e7b2e}=await resolveJourneyIdFromInput(_0x11aff0,_0xcf1d69,_0x18aee5),_0x2119b8={'type':_0x1d3162,'from':_0x4d631a,'to':_0x295e1f,'limit':_0xcf83e7},_0x40e1fe=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x18aee5[_0x28eb6e(0x23d)][_0x28eb6e(0x244)](_0x437dc9,_0x2119b8),{'verbose':_0xcf1d69[_0x28eb6e(0x245)]}),_0x46d63c=_0x40e1fe[_0x28eb6e(0x1c0)],_0x153998=_0x46d63c[_0x28eb6e(0x2b3)]&&(_0x46d63c[_0x28eb6e(0x2b3)][_0x28eb6e(0x28d)]['length']>0x0||_0x46d63c['conversion'][_0x28eb6e(0x284)][_0x28eb6e(0x218)]>0x0),_0x522a86=_0x46d63c[_0x28eb6e(0x24f)]&&_0x46d63c[_0x28eb6e(0x24f)][_0x28eb6e(0x218)]>0x0;if(!_0x153998&&!_0x522a86)return console[_0x28eb6e(0x1df)](_0x28eb6e(0x247)+_0x4e7b2e),console['error'](_0x28eb6e(0x20f)),_0x4d631a&&_0x295e1f&&console[_0x28eb6e(0x1df)](_0x28eb6e(0x206)),0x0;return await handleSingleObjectOutput(_0x46d63c,_0xcf1d69),0x0;}}function formatStageStats(_0x2435d2,_0xbe71cf){const _0x2bfae4=a27_0x36855a,_0x25bd80=_0xbe71cf[_0x2bfae4(0x26d)]&&_0x2435d2[_0x2bfae4(0x229)]?.['length']?aggregateStageHistory(_0x2435d2[_0x2bfae4(0x229)]):{'size':_0x2435d2[_0x2bfae4(0x22d)],'entered':_0x2435d2[_0x2bfae4(0x221)],'milestone':_0x2435d2[_0x2bfae4(0x27c)],'milestone_rate':_0x2435d2['completeMilestoneRate'],'exit_or_jump':_0x2435d2[_0x2bfae4(0x276)],'exit_or_jump_rate':_0x2435d2[_0x2bfae4(0x238)]},_0x13a059={'id':_0x2435d2['id'],'name':_0xbe71cf['stageNameMap'][_0x2bfae4(0x25b)](_0x2435d2['id'])??_0x2435d2['id'],..._0x25bd80};return _0xbe71cf[_0x2bfae4(0x26d)]&&_0xbe71cf[_0x2bfae4(0x216)]&&_0x2435d2[_0x2bfae4(0x229)]&&(_0x13a059[_0x2bfae4(0x229)]=_0x2435d2[_0x2bfae4(0x229)]),_0x13a059;}export class JourneyPauseCommand extends BaseCommand{['name']=a27_0x36855a(0x248);[a27_0x36855a(0x24b)]=a27_0x36855a(0x1fe);async[a27_0x36855a(0x258)](_0x5d0b27){const _0xf6268f=a27_0x36855a,{options:_0x351b07,args:_0x4e1880,tdx:_0x18d329}=_0x5d0b27,_0x5cf2b1=_0x4e1880[0x0];if(!requireNameOrPath(_0x5cf2b1))return 0x1;_0x351b07[_0xf6268f(0x245)]&&console[_0xf6268f(0x1df)](_0xf6268f(0x267)+_0x5cf2b1);const {journeyId:_0x9ac15,journeyName:_0x514705}=await resolveJourneyIdFromInput(_0x5cf2b1,_0x351b07,_0x18d329);if(!_0x351b07[_0xf6268f(0x264)]){const _0x4747dc=await confirm(_0xf6268f(0x286)+_0x514705+'\x22?');if(!_0x4747dc)return console[_0xf6268f(0x1df)](_0xf6268f(0x226)),0x0;}const _0xdf815e=await withSpinner(_0xf6268f(0x1e9),()=>_0x18d329['journey'][_0xf6268f(0x236)](_0x9ac15),{'verbose':_0x351b07['verbose']}),_0x37008d=_0xdf815e[_0xf6268f(0x1c0)];return console[_0xf6268f(0x1df)](_0xf6268f(0x1ca)+_0x37008d['attributes'][_0xf6268f(0x1c5)]+_0xf6268f(0x26c)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x36855a(0x1c5)]='journey:resume';[a27_0x36855a(0x24b)]=a27_0x36855a(0x1db);async['execute'](_0x2e2e02){const _0x14a3b4=a27_0x36855a,{options:_0x45a29e,args:_0x8b42ea,tdx:_0x31393e}=_0x2e2e02,_0x324a23=_0x8b42ea[0x0];if(!requireNameOrPath(_0x324a23))return 0x1;_0x45a29e[_0x14a3b4(0x245)]&&console[_0x14a3b4(0x1df)](_0x14a3b4(0x267)+_0x324a23);const {journeyId:_0x327343,journeyName:_0x70feec}=await resolveJourneyIdFromInput(_0x324a23,_0x45a29e,_0x31393e);if(!_0x45a29e[_0x14a3b4(0x264)]){const _0x1ebbe1=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22'+_0x70feec+'\x22?');if(!_0x1ebbe1)return console['error']('Cancelled'),0x0;}const _0x11799d=await withSpinner(_0x14a3b4(0x26f),()=>_0x31393e[_0x14a3b4(0x23d)][_0x14a3b4(0x1ec)](_0x327343),{'verbose':_0x45a29e['verbose']}),_0x4c5d4f=_0x11799d['data'];return console[_0x14a3b4(0x1df)](_0x14a3b4(0x1ca)+_0x4c5d4f[_0x14a3b4(0x278)][_0x14a3b4(0x1c5)]+_0x14a3b4(0x256)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x36855a(0x1c5)]=a27_0x36855a(0x1c1);[a27_0x36855a(0x24b)]=a27_0x36855a(0x295);async['execute'](_0x3efb6b){const _0x2a1edd=a27_0x36855a,{options:_0x19086a,args:_0x376694,tdx:_0x5acc01}=_0x3efb6b,_0x38e7b0=_0x19086a,_0x2fc548=_0x376694[0x0],_0x5a357=_0x2fc548&&isYamlFilePath(_0x2fc548),_0x570006=await resolveTarget({'arg':_0x5a357?_0x2fc548:undefined,'contextParent':_0x19086a[_0x2a1edd(0x1f9)],'cwd':process[_0x2a1edd(0x1cb)]()});if(!isSuccessfulResolution(_0x570006))return _0x570006['errorCode']===_0x2a1edd(0x268)?(console[_0x2a1edd(0x1df)](a27_0x1988d7[_0x2a1edd(0x1fd)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x2a1edd(0x1df)]('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[_0x2a1edd(0x1df)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console[_0x2a1edd(0x1df)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console[_0x2a1edd(0x1df)](_0x2a1edd(0x29a))):(console['error'](a27_0x1988d7[_0x2a1edd(0x1f1)](_0x2a1edd(0x20e)+_0x570006['message']+'\x0a')),_0x570006[_0x2a1edd(0x1f4)]&&console['error'](a27_0x1988d7[_0x2a1edd(0x21a)](_0x570006[_0x2a1edd(0x1f4)]))),0x1;let _0x1fc4ed=_0x5a357?undefined:_0x2fc548,_0x3a6cb5,_0x5ecad5;_0x570006['type']===_0x2a1edd(0x203)&&(_0x1fc4ed=_0x570006['resourceName'],_0x3a6cb5=_0x570006[_0x2a1edd(0x228)],_0x5ecad5=_0x570006['folderPath']);const _0x37e519=_0x570006[_0x2a1edd(0x25a)],_0x10515f=_0x570006['targetDir'];_0x38e7b0[_0x2a1edd(0x245)]&&(console['error'](_0x2a1edd(0x28b)+_0x37e519),console['error']('Target\x20directory:\x20'+_0x10515f),_0x1fc4ed&&console[_0x2a1edd(0x1df)]('Journey\x20name:\x20'+_0x1fc4ed),_0x3a6cb5&&console[_0x2a1edd(0x1df)](_0x2a1edd(0x2a7)+_0x3a6cb5),_0x5ecad5&&console['error'](_0x2a1edd(0x292)+_0x5ecad5));const _0x329e41=await withSpinner(_0x2a1edd(0x201),()=>_0x5acc01[_0x2a1edd(0x299)][_0x2a1edd(0x279)](_0x37e519),{'verbose':_0x19086a[_0x2a1edd(0x245)]}),_0x780f8=_0x329e41[_0x2a1edd(0x1c0)],{journeys:_0x32d1e1,folders:_0x179c87}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0x191881=_0x2a1edd,[_0x345385,_0x3696fe]=await Promise[_0x191881(0x1d2)]([_0x5acc01['journey'][_0x191881(0x282)](_0x780f8,undefined,{'includeAllVersions':!![]}),_0x5acc01[_0x191881(0x299)][_0x191881(0x1da)](_0x780f8)]);return{'journeys':_0x345385,'folders':_0x3696fe};},{'verbose':_0x19086a[_0x2a1edd(0x245)]})['then'](_0x247794=>_0x247794[_0x2a1edd(0x1c0)]);let _0x1b5b22=_0x32d1e1;const _0x27c04d=buildFolderIdToPathMap(_0x179c87);if(_0x1fc4ed){const _0x9cec4a=_0x1b5b22[_0x2a1edd(0x1d4)](_0x5bc1e0=>_0x5bc1e0['journeyBundleName']['toLowerCase']()===_0x1fc4ed[_0x2a1edd(0x1fb)]());if(_0x9cec4a[_0x2a1edd(0x218)]===0x0)return console[_0x2a1edd(0x1df)]('Error:\x20Journey\x20not\x20found:\x20'+_0x1fc4ed),console[_0x2a1edd(0x1df)]('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x1b5b22=_0x9cec4a;}if(_0x5ecad5!==undefined){const _0x3d5e2d=_0x1b5b22[_0x2a1edd(0x1d4)](_0x5a7aca=>{const _0x45febc=_0x2a1edd,_0x1a5a5d=_0x5a7aca[_0x45febc(0x254)]?_0x27c04d['get'](_0x5a7aca['folderId'])||'':'';return _0x1a5a5d===_0x5ecad5;});if(_0x3d5e2d[_0x2a1edd(0x218)]===0x0&&_0x1b5b22['length']>0x0){console[_0x2a1edd(0x1df)]('Error:\x20Journey\x20\x27'+_0x1fc4ed+'\x27\x20not\x20found\x20in\x20'+(_0x5ecad5||_0x2a1edd(0x235))),console['error']('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x1c6f41 of _0x1b5b22){const _0x3dadc3=_0x1c6f41[_0x2a1edd(0x254)]?_0x27c04d['get'](_0x1c6f41['folderId'])||'':'';console['error'](_0x2a1edd(0x230)+(_0x3dadc3||_0x2a1edd(0x212))+'/'+_0x1c6f41['journeyBundleName']);}return 0x1;}_0x1b5b22=_0x3d5e2d;}if(_0x1b5b22[_0x2a1edd(0x218)]===0x0)return console[_0x2a1edd(0x1df)](_0x2a1edd(0x1f6)),0x0;const _0x4261a7=new Map();for(const _0x3bbf74 of _0x1b5b22){const _0x4db4a3=_0x3bbf74[_0x2a1edd(0x1bc)];!_0x4261a7[_0x2a1edd(0x265)](_0x4db4a3)&&_0x4261a7[_0x2a1edd(0x266)](_0x4db4a3,[]),_0x4261a7['get'](_0x4db4a3)[_0x2a1edd(0x21c)](_0x3bbf74);}for(const _0x4181b0 of _0x4261a7[_0x2a1edd(0x2a5)]()){_0x4181b0[_0x2a1edd(0x2b7)]((_0x25d57e,_0x1a6d3e)=>(_0x25d57e[_0x2a1edd(0x1bb)]||0x0)-(_0x1a6d3e[_0x2a1edd(0x1bb)]||0x0));}const _0x506c47=[],{idToEmailMap:_0x4be529,connectionIdToNameMap:_0x201f25}=await withSpinner(_0x2a1edd(0x1c6),async()=>{const _0x20be18=_0x2a1edd,[_0x3462f5,_0x54e5ad]=await Promise[_0x20be18(0x1d2)]([_0x5acc01[_0x20be18(0x287)][_0x20be18(0x23b)](),_0x5acc01[_0x20be18(0x27f)][_0x20be18(0x1bf)]()]);return{'idToEmailMap':_0x3462f5,'connectionIdToNameMap':_0x54e5ad};},{'verbose':_0x19086a[_0x2a1edd(0x245)]})['then'](_0x3aba73=>_0x3aba73[_0x2a1edd(0x1c0)]);for(const _0x3a572b of _0x4261a7['values']()){const _0xce2631=_0x3a572b[0x0][_0x2a1edd(0x1cf)],_0x3c1d76=_0x3a572b[0x0]['folderId'],_0x2578e8=_0x3c1d76?_0x27c04d['get'](_0x3c1d76)||'':'',_0x4d4634=_0x2578e8?a27_0x17c755[_0x2a1edd(0x1f8)](_0x10515f,_0x2578e8):_0x10515f,_0x1b55e2=_0x3a6cb5||a27_0x17c755[_0x2a1edd(0x1f8)](_0x4d4634,sanitizeFileName(_0xce2631)+_0x2a1edd(0x1c2));let _0x52e4b1,_0x26f89d;if(existsSync(_0x1b55e2))try{const _0x472bf9=readFileSync(_0x1b55e2,_0x2a1edd(0x1c4)),_0x179e93=parseYamlString(_0x472bf9);_0x26f89d=_0x179e93,_0x52e4b1=buildRuleToNameMapping(_0x179e93),_0x38e7b0[_0x2a1edd(0x245)]&&_0x52e4b1[_0x2a1edd(0x22d)]>0x0&&console[_0x2a1edd(0x1df)](_0x2a1edd(0x220)+_0x52e4b1['size']+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0xce2631);}catch(_0xb1c482){_0x38e7b0[_0x2a1edd(0x245)]&&console[_0x2a1edd(0x1df)](_0x2a1edd(0x1be)+_0xb1c482[_0x2a1edd(0x298)]);}const _0x4ee353=[],_0x395d58=new Set(),_0x2fa0fb=new Map(),_0x1fe30e=new Map(),_0x4324c8=new Set(),_0x1e474c=new Map(),_0x2e1883=new Map(),_0xbab6ab=createJumpTargetCache();await withProgressSpinner(_0x2a1edd(0x283)+_0xce2631+_0x2a1edd(0x22c),async _0x127b81=>{const _0x369d48=_0x2a1edd;for(const _0x5138c3 of _0x3a572b){const _0x3575a2=_0x3a572b[_0x369d48(0x218)]>0x1?_0x5138c3[_0x369d48(0x1cf)]+'\x20v'+(_0x5138c3[_0x369d48(0x1bb)]||0x1):_0x5138c3['journeyBundleName'];_0x127b81[_0x369d48(0x2a8)]('Fetching\x20'+_0x3575a2);const _0x2f7002=await _0x5acc01[_0x369d48(0x23d)][_0x369d48(0x2ae)](_0x5138c3['id']),_0x13a1bb=_0x2f7002[_0x369d48(0x278)]?.[_0x369d48(0x28f)],_0x5cfe95={'resolveSegment':async _0x3d899f=>{const _0x24a193=_0x369d48;if(!_0x13a1bb)return{'name':_0x3d899f,'isJourneyLocal':![]};const _0x3cd8d3=_0x2fa0fb[_0x24a193(0x25b)](_0x3d899f);if(_0x3cd8d3)return _0x3cd8d3;try{const _0x590183=await _0x5acc01['segment'][_0x24a193(0x243)](_0x13a1bb,_0x3d899f),_0x2ef338=_0x590183[_0x24a193(0x25f)]===SEGMENT_KIND_JOURNEY;let _0x57b210,_0x252e0e=_0x590183[_0x24a193(0x1c5)];if(_0x2ef338&&_0x590183['rule']){const _0x103a62=await segmentResponseToDef(_0x590183,{'resolveSegmentName':async _0x1fb22b=>{const _0x11a0c7=_0x24a193,_0x11030a=_0x2fa0fb[_0x11a0c7(0x25b)](_0x1fb22b);if(_0x11030a)return _0x11030a[_0x11a0c7(0x1c5)];const _0x29c0df=await _0x5cfe95[_0x11a0c7(0x29c)](_0x1fb22b);return _0x29c0df[_0x11a0c7(0x1c5)];}}),_0x55fced=_0x103a62['rule'];_0x57b210={'description':_0x590183[_0x24a193(0x24b)],'rule':_0x55fced};const _0xc58f9=serializeRule(_0x55fced),_0x55f2af=_0x1fe30e[_0x24a193(0x25b)](_0xc58f9);if(_0x55f2af)_0x252e0e=_0x55f2af,_0x57b210=undefined,_0x38e7b0['verbose']&&console[_0x24a193(0x1df)](_0x24a193(0x225)+_0x590183['name']+_0x24a193(0x1cc)+_0x55f2af);else{let _0x2d519f=![];if(_0x52e4b1){const _0x4c214d=_0x52e4b1[_0x24a193(0x25b)](_0xc58f9);if(_0x4c214d){const _0xb323d5=_0x4c214d[_0x24a193(0x23e)](_0x2edb61=>!_0x395d58[_0x24a193(0x265)](_0x2edb61));_0xb323d5&&(_0x252e0e=_0xb323d5,_0x395d58[_0x24a193(0x1de)](_0xb323d5),_0x1fe30e['set'](_0xc58f9,_0xb323d5),_0x2d519f=!![],_0x38e7b0[_0x24a193(0x245)]&&console[_0x24a193(0x1df)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0xb323d5+_0x24a193(0x25c)));}}if(!_0x2d519f){const _0x16f012=generateJourneyLocalName(_0x590183[_0x24a193(0x1c5)]);_0x16f012&&(_0x252e0e=_0x16f012);let _0x3f91c0=_0x252e0e,_0x535c6d=0x2;while(_0x395d58['has'](_0x3f91c0)){_0x3f91c0=_0x252e0e+'_'+_0x535c6d,_0x535c6d++;}_0x395d58[_0x24a193(0x1de)](_0x3f91c0),_0x1fe30e[_0x24a193(0x266)](_0xc58f9,_0x3f91c0),_0x252e0e=_0x3f91c0;}}}const _0x5320f7={'name':_0x252e0e,'isJourneyLocal':_0x2ef338,'definition':_0x57b210};return _0x2fa0fb[_0x24a193(0x266)](_0x3d899f,_0x5320f7),_0x5320f7;}catch(_0x31e068){return _0x19086a[_0x24a193(0x245)]&&console['error'](_0x24a193(0x246)+_0x3d899f+':\x20'+_0x31e068[_0x24a193(0x298)]),{'name':_0x3d899f,'isJourneyLocal':![]};}},'resolveActivation':async _0x321179=>{const _0xb68904=_0x369d48,_0x10f851=_0x1e474c[_0xb68904(0x25b)](_0x321179);if(_0x10f851)return _0x10f851;try{const _0x2d1885=await _0x5acc01[_0xb68904(0x23d)][_0xb68904(0x2a6)](_0x5138c3['id'],_0x321179),_0x54cd5d=journeyActivationStepToYaml(_0x2d1885,_0x4be529,_0x201f25),_0xd99f6d=JSON[_0xb68904(0x1d7)]({'name':_0x54cd5d['name'],'connection':_0x54cd5d[_0xb68904(0x27f)],'connector_config':_0x54cd5d['connector_config']}),_0x9fb796=_0x2e1883[_0xb68904(0x25b)](_0xd99f6d);if(_0x9fb796){const _0x55ff45={'name':_0x9fb796,'isJourneyLocal':!![],'definition':_0x54cd5d};return _0x1e474c[_0xb68904(0x266)](_0x321179,_0x55ff45),_0x55ff45;}const _0x2dda48=_0x2d1885['attributes'][_0xb68904(0x290)][_0xb68904(0x1c5)]||_0x321179,_0x55dad3=sanitizeYamlKey(_0x2dda48)||'activation_'+_0x321179;let _0x3295cd=_0x55dad3,_0x3139f1=0x2;while(_0x4324c8[_0xb68904(0x265)](_0x3295cd)){_0x3295cd=_0x55dad3+'_'+_0x3139f1,_0x3139f1++;}_0x4324c8[_0xb68904(0x1de)](_0x3295cd),_0x2e1883[_0xb68904(0x266)](_0xd99f6d,_0x3295cd);const _0x1f0fd0={'name':_0x3295cd,'isJourneyLocal':!![],'definition':_0x54cd5d};return _0x1e474c[_0xb68904(0x266)](_0x321179,_0x1f0fd0),_0x1f0fd0;}catch(_0x3fca07){return _0x19086a[_0xb68904(0x245)]&&console[_0xb68904(0x1df)](_0xb68904(0x20a)+_0x321179+':\x20'+_0x3fca07[_0xb68904(0x298)]),{'name':_0x321179,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x4568b5,_0x5c9c52)=>{const _0x1e379d=_0x369d48;return resolveJumpTarget(_0x4568b5,_0x5c9c52,_0xbab6ab,_0x56f8fa=>_0x5acc01[_0x1e379d(0x23d)]['getJourney'](_0x56f8fa));}},_0x38124b=await journeyResponseToDef(_0x2f7002,_0x5cfe95);_0x4ee353[_0x369d48(0x21c)]({'item':_0x5138c3,'yaml':_0x38124b});}},{'verbose':_0x19086a[_0x2a1edd(0x245)]});const _0xec1eae=await _0x5acc01[_0x2a1edd(0x23d)][_0x2a1edd(0x217)](_0x3a572b[0x0]['journeyBundleId']),_0x35e68b=buildMergedJourneyDef(_0x4ee353,_0x52e4b1,_0xec1eae),_0x3c2b62=normalizeJourneyDef(_0x35e68b,_0x26f89d),_0x33d32d=toYamlString(_0x3c2b62),_0x105e75=_0x3a6cb5||a27_0x17c755['join'](_0x4d4634,sanitizeFileName(_0xce2631)+_0x2a1edd(0x1c2));!_0x3a6cb5&&_0x2578e8&&!existsSync(_0x4d4634)&&mkdirSync(_0x4d4634,{'recursive':!![]});const _0x49dcb7=a27_0x17c755[_0x2a1edd(0x1d5)](process[_0x2a1edd(0x1cb)](),_0x105e75);if(existsSync(_0x105e75)){const _0x5898ba=readFileSync(_0x105e75,'utf-8'),_0x1eb172=generateDiff(_0x5898ba,_0x33d32d),_0x162940=hasChanges(_0x1eb172);_0x506c47[_0x2a1edd(0x21c)]({'relativePath':_0x49dcb7,'absolutePath':_0x105e75,'content':_0x33d32d,'isNew':![],'hasChanges':_0x162940,'diff':_0x162940?formatDiffWithColors(_0x1eb172):undefined});}else _0x506c47[_0x2a1edd(0x21c)]({'relativePath':_0x49dcb7,'absolutePath':_0x105e75,'content':_0x33d32d,'isNew':!![],'hasChanges':![]});}const _0x5e5ad1=_0x506c47[_0x2a1edd(0x1d4)](_0x4cecbc=>_0x4cecbc[_0x2a1edd(0x289)]),_0x2639a1=_0x506c47[_0x2a1edd(0x1d4)](_0x1726a1=>!_0x1726a1[_0x2a1edd(0x289)]&&_0x1726a1[_0x2a1edd(0x1dc)]),_0x217302=_0x506c47[_0x2a1edd(0x1d4)](_0x3286e0=>!_0x3286e0[_0x2a1edd(0x289)]&&!_0x3286e0[_0x2a1edd(0x1dc)]),_0x1776be=_0x1b5b22['length'],_0x2911ac=_0x4261a7[_0x2a1edd(0x22d)],_0x140786=_0x1776be>_0x2911ac?'\x20('+_0x1776be+_0x2a1edd(0x227):'';console[_0x2a1edd(0x1df)]('\x0aPull\x20summary:'),console['error']('\x20\x20'+a27_0x1988d7[_0x2a1edd(0x21a)](_0x2911ac+'\x20journeys')+a27_0x1988d7[_0x2a1edd(0x249)](_0x140786)),console['error']('\x20\x20'+a27_0x1988d7[_0x2a1edd(0x2b5)]('+\x20'+_0x5e5ad1[_0x2a1edd(0x218)]+_0x2a1edd(0x234))),console['error']('\x20\x20'+a27_0x1988d7[_0x2a1edd(0x1fd)]('~\x20'+_0x2639a1[_0x2a1edd(0x218)]+_0x2a1edd(0x20d))),console[_0x2a1edd(0x1df)]('\x20\x20'+a27_0x1988d7[_0x2a1edd(0x249)]('=\x20'+_0x217302[_0x2a1edd(0x218)]+'\x20unchanged\x20files')),console[_0x2a1edd(0x1df)](_0x2a1edd(0x222)+a27_0x1988d7['cyan'](_0x10515f)+'\x0a');if(_0x2639a1['length']>0x0)for(const _0x3c9f2c of _0x2639a1){console[_0x2a1edd(0x1df)](_0x2a1edd(0x2aa)+_0x3c9f2c[_0x2a1edd(0x2b8)]+'\x27:'),console['error']('─'[_0x2a1edd(0x280)](0x3c)),console['error'](_0x3c9f2c['diff']),console[_0x2a1edd(0x1df)]('─'[_0x2a1edd(0x280)](0x3c));}if(_0x38e7b0[_0x2a1edd(0x210)])return console[_0x2a1edd(0x1df)](a27_0x1988d7['yellow'](_0x2a1edd(0x29e))),0x0;if(_0x5e5ad1['length']===0x0&&_0x2639a1['length']===0x0)return console[_0x2a1edd(0x1df)](a27_0x1988d7['green'](_0x2a1edd(0x223))),saveSessionContext({'parent_segment':_0x37e519},_0x38e7b0['session']),console[_0x2a1edd(0x1df)](a27_0x1988d7[_0x2a1edd(0x2b5)](_0x2a1edd(0x1bd)+a27_0x1988d7[_0x2a1edd(0x249)](_0x2a1edd(0x205))+'\x20=\x20'+a27_0x1988d7['cyan'](_0x37e519))),0x0;if(!_0x38e7b0[_0x2a1edd(0x264)]&&(_0x5e5ad1['length']>0x0||_0x2639a1['length']>0x0)){if(!isInteractive())return console[_0x2a1edd(0x1df)](a27_0x1988d7[_0x2a1edd(0x1f1)](_0x2a1edd(0x24c)),_0x2a1edd(0x1e3)),console[_0x2a1edd(0x1df)](a27_0x1988d7['dim'](_0x2a1edd(0x272))),0x1;const _0x1296c5=await confirmKey(_0x2a1edd(0x209)+(_0x5e5ad1[_0x2a1edd(0x218)]+_0x2639a1[_0x2a1edd(0x218)])+_0x2a1edd(0x1c8));if(!_0x1296c5)return console[_0x2a1edd(0x1df)](a27_0x1988d7['yellow'](_0x2a1edd(0x252)),_0x2a1edd(0x29d)),0x1;}!existsSync(_0x10515f)&&mkdirSync(_0x10515f,{'recursive':!![]});const _0x2e0ee9=a27_0x17c755[_0x2a1edd(0x1f8)](_0x10515f,_0x2a1edd(0x24a));writeFileSync(_0x2e0ee9,createTdxConfigContent(_0x37e519),_0x2a1edd(0x1c4));for(const _0xee4639 of _0x506c47){(_0xee4639[_0x2a1edd(0x289)]||_0xee4639[_0x2a1edd(0x1dc)])&&writeFileSync(_0xee4639[_0x2a1edd(0x1f5)],_0xee4639['content'],_0x2a1edd(0x1c4));}return console[_0x2a1edd(0x1df)](a27_0x1988d7[_0x2a1edd(0x2b5)]('✔\x20Pulled\x20'+(_0x5e5ad1['length']+_0x2639a1['length'])+_0x2a1edd(0x27a)+_0x10515f)),saveSessionContext({'parent_segment':_0x37e519},_0x38e7b0['session']),console[_0x2a1edd(0x1df)](a27_0x1988d7[_0x2a1edd(0x2b5)](_0x2a1edd(0x1bd)+a27_0x1988d7[_0x2a1edd(0x249)](_0x2a1edd(0x205))+'\x20=\x20'+a27_0x1988d7[_0x2a1edd(0x21a)](_0x37e519))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a27_0x36855a(0x1c5)]=a27_0x36855a(0x2af);[a27_0x36855a(0x24b)]=a27_0x36855a(0x2bb);async[a27_0x36855a(0x258)](_0x4813d7){const _0x56879b=a27_0x36855a,{options:_0x2fa121,args:_0xbe4d43,tdx:_0x55c9a8}=_0x4813d7,_0x2fd919=_0xbe4d43[0x0];if(!requireNameOrPath(_0x2fd919))return 0x1;_0x2fa121[_0x56879b(0x245)]&&console[_0x56879b(0x1df)](_0x56879b(0x267)+_0x2fd919);const {journeyId:_0x3625a1}=await resolveJourneyIdFromInput(_0x2fd919,_0x2fa121,_0x55c9a8),_0xe12267=await withSpinner(_0x56879b(0x23c),()=>_0x55c9a8[_0x56879b(0x23d)][_0x56879b(0x2a1)](_0x3625a1),{'verbose':_0x2fa121[_0x56879b(0x245)]}),_0x572410=_0xe12267['data'];return console[_0x56879b(0x1cd)](_0x56879b(0x1e8)+_0x572410[_0x56879b(0x1fc)]),console['log'](_0x56879b(0x1e0)+_0x572410['table']),await handleSDKOutput(_0x572410['columns'],_0x2fa121),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x36855a(0x1c5)]=a27_0x36855a(0x2b4);[a27_0x36855a(0x24b)]=a27_0x36855a(0x271);async[a27_0x36855a(0x258)](_0xbe13ca){const _0x3f500a=a27_0x36855a,{options:_0x132aa,args:_0x45a689,tdx:_0x5bd147}=_0xbe13ca,_0x1ccaf0=_0x45a689[0x0];if(!requireNameOrPath(_0x1ccaf0))return 0x1;_0x132aa[_0x3f500a(0x245)]&&console[_0x3f500a(0x1df)](_0x3f500a(0x267)+_0x1ccaf0);const {journeyId:_0x55e870}=await resolveJourneyIdFromInput(_0x1ccaf0,_0x132aa,_0x5bd147),_0x11fa77=await withSpinner('Listing\x20journey\x20activations...',()=>_0x5bd147['journey'][_0x3f500a(0x21b)](_0x55e870),{'verbose':_0x132aa[_0x3f500a(0x245)]}),_0x36f536=_0x11fa77['data'];return console[_0x3f500a(0x1df)](_0x3f500a(0x220)+_0x36f536['length']+_0x3f500a(0x255)+(_0x36f536[_0x3f500a(0x218)]!==0x1?'s':'')),await handleSDKOutput(_0x36f536,_0x132aa),0x0;}}export class JourneyPushCommand extends BaseCommand{[a27_0x36855a(0x1c5)]=a27_0x36855a(0x21f);[a27_0x36855a(0x24b)]='Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data';['segmentPushCommand']=new SegmentPushCommand();async[a27_0x36855a(0x258)](_0x46495e){const _0x2fd857=a27_0x36855a,_0x59fff7=_0x46495e[_0x2fd857(0x1ea)][0x0];let _0x5b2395;if(_0x59fff7){const _0x2d9d66=await resolveTarget({'arg':_0x59fff7,'contextParent':_0x46495e['options']['parentSegment'],'cwd':process[_0x2fd857(0x1cb)]()});isSuccessfulResolution(_0x2d9d66)&&_0x2d9d66[_0x2fd857(0x1c7)]==='file'&&(_0x5b2395=_0x2d9d66[_0x2fd857(0x228)]);}const _0x2a4782={..._0x46495e,'options':{..._0x46495e[_0x2fd857(0x1b7)],'journeysOnly':!![],..._0x5b2395&&{'singleFilePath':_0x5b2395}}};return this[_0x2fd857(0x2ac)][_0x2fd857(0x258)](_0x2a4782);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x36855a(0x1c5)]=a27_0x36855a(0x215);[a27_0x36855a(0x24b)]=a27_0x36855a(0x274);async[a27_0x36855a(0x258)](_0x2364f5){const _0x16c802=a27_0x36855a,{options:_0x334338,args:_0x7a83f7,tdx:_0x4750c0}=_0x2364f5,_0x3ed4df=_0x7a83f7[0x0];if(!requireNameOrPath(_0x3ed4df))return 0x1;if(_0x334338['verbose'])console['error'](_0x16c802(0x267)+_0x3ed4df);const {journeyId:_0x79c669}=await resolveJourneyIdFromInput(_0x3ed4df,_0x334338,_0x4750c0),_0x188cac=await withSpinner('Listing\x20journey\x20versions...',()=>_0x4750c0[_0x16c802(0x23d)]['listVersions'](_0x79c669),{'verbose':_0x334338[_0x16c802(0x245)]}),{bundleName:_0x4fb0b7,versions:_0x47a3ca,latestJourneyId:_0x4eed50}=_0x188cac[_0x16c802(0x1c0)];console[_0x16c802(0x1df)](_0x4fb0b7+':\x20'+_0x47a3ca[_0x16c802(0x218)]+_0x16c802(0x27d)+(_0x47a3ca[_0x16c802(0x218)]!==0x1?'s':''));const _0x2c5d2b=_0x47a3ca['map'](_0x523538=>({'version':_0x523538[_0x16c802(0x1bb)],'journey_id':_0x523538[_0x16c802(0x1f3)],'name':_0x523538['name'],'state':_0x523538['state'],'paused':_0x523538[_0x16c802(0x231)],'latest':_0x523538[_0x16c802(0x1f3)]===_0x4eed50,'created_at':_0x523538[_0x16c802(0x1e4)]}));return await handleSDKOutput(_0x2c5d2b,_0x334338),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x36855a(0x1c5)]='journey:version:create';['description']='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async['execute'](_0x1b9ecc){const _0x186013=a27_0x36855a,{options:_0x90c2da,args:_0x5b5f0a,tdx:_0xd7cc1f}=_0x1b9ecc,_0x5886cd=_0x5b5f0a[0x0];if(!requireNameOrPath(_0x5886cd))return 0x1;if(_0x90c2da['verbose'])console[_0x186013(0x1df)](_0x186013(0x267)+_0x5886cd);const {journeyId:_0x310ec8,journeyName:_0x3f2701}=await resolveJourneyIdFromInput(_0x5886cd,_0x90c2da,_0xd7cc1f);if(!_0x90c2da['yes']){const _0x541ebe=await confirm(_0x186013(0x1ce)+_0x3f2701+'\x22?');if(!_0x541ebe)return console[_0x186013(0x1df)]('Cancelled'),0x0;}const _0x2b69e5=await withSpinner(_0x186013(0x297),()=>_0xd7cc1f['journey'][_0x186013(0x291)](_0x310ec8),{'verbose':_0x90c2da[_0x186013(0x245)]}),_0x27c102=_0x2b69e5[_0x186013(0x1c0)];return console[_0x186013(0x1df)](a27_0x1988d7[_0x186013(0x2b5)]('✔')+_0x186013(0x214)+_0x27c102['attributes'][_0x186013(0x1bb)]+'\x20(draft)\x20—\x20\x22'+_0x27c102[_0x186013(0x278)][_0x186013(0x1c5)]+'\x22'),console[_0x186013(0x1df)]('\x20\x20Journey\x20ID:\x20'+_0x27c102['id']),await handleSingleObjectOutput({'id':_0x27c102['id'],'name':_0x27c102['attributes'][_0x186013(0x1c5)],'version':_0x27c102[_0x186013(0x278)][_0x186013(0x1bb)],'state':_0x27c102[_0x186013(0x278)][_0x186013(0x233)],'bundle_id':_0x27c102[_0x186013(0x278)][_0x186013(0x1bc)],'created_at':_0x27c102[_0x186013(0x278)][_0x186013(0x1e4)]},_0x90c2da),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x36855a(0x1c5)]=a27_0x36855a(0x29b);[a27_0x36855a(0x24b)]=a27_0x36855a(0x1fa);async['execute'](_0x1de5d1){const _0x3a1f2d=a27_0x36855a,{options:_0x290d33,args:_0x38b4d3,tdx:_0x5625ce}=_0x1de5d1,_0x1e69e5=_0x38b4d3[0x0];if(!requireNameOrPath(_0x1e69e5))return 0x1;const _0x19c64c=_0x290d33[_0x3a1f2d(0x200)];if(!_0x19c64c)return console[_0x3a1f2d(0x1df)](_0x3a1f2d(0x26e)),console['error']('Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N'),0x1;const _0x4c0bc6=parseInt(_0x19c64c,0xa);if(isNaN(_0x4c0bc6)||_0x4c0bc6<0x1)return console[_0x3a1f2d(0x1df)](_0x3a1f2d(0x1d9)+_0x19c64c),0x1;if(_0x290d33['verbose'])console['error'](_0x3a1f2d(0x267)+_0x1e69e5+_0x3a1f2d(0x28e)+_0x4c0bc6);const {journeyId:_0x4adc81,parentSegmentId:_0x17b249}=await resolveJourneyIdFromInput(_0x1e69e5,_0x290d33,_0x5625ce),_0x583216=await withSpinner(_0x3a1f2d(0x253),()=>_0x5625ce[_0x3a1f2d(0x23d)]['listVersions'](_0x4adc81),{'verbose':_0x290d33['verbose']}),{versions:_0x16d47f,latestJourneyId:_0x57057a}=_0x583216[_0x3a1f2d(0x1c0)],_0x3c67d0=_0x16d47f[_0x3a1f2d(0x23e)](_0x80e750=>_0x80e750['versionNumber']===_0x4c0bc6);if(!_0x3c67d0){const _0x8048e4=_0x16d47f[_0x3a1f2d(0x24d)](_0x354718=>'v'+_0x354718['versionNumber'])[_0x3a1f2d(0x1f8)](',\x20');return console['error'](_0x3a1f2d(0x1d3)+_0x4c0bc6+_0x3a1f2d(0x27b)+_0x8048e4),0x1;}const _0x7c841=await withSpinner(_0x3a1f2d(0x22a)+_0x4c0bc6+_0x3a1f2d(0x237),()=>_0x5625ce[_0x3a1f2d(0x23d)][_0x3a1f2d(0x2ae)](_0x3c67d0[_0x3a1f2d(0x1f3)]),{'verbose':_0x290d33[_0x3a1f2d(0x245)]}),_0x1add2f=_0x7c841['data'],_0x1d89ec=getConsoleNextUrl(_0x290d33[_0x3a1f2d(0x2ba)],'/app/ps/'+_0x17b249+_0x3a1f2d(0x2a0)+_0x3c67d0['journeyId']+_0x3a1f2d(0x1e2));return await handleSingleObjectOutput({'id':_0x1add2f['id'],'name':_0x1add2f[_0x3a1f2d(0x278)][_0x3a1f2d(0x1c5)],'version':_0x1add2f[_0x3a1f2d(0x278)][_0x3a1f2d(0x1bb)],'description':_0x1add2f[_0x3a1f2d(0x278)][_0x3a1f2d(0x24b)],'state':_0x1add2f['attributes'][_0x3a1f2d(0x233)],'paused':_0x1add2f[_0x3a1f2d(0x278)][_0x3a1f2d(0x231)],'reentry_mode':_0x1add2f['attributes']['reentryMode'],'stages':_0x1add2f[_0x3a1f2d(0x278)][_0x3a1f2d(0x240)]?.[_0x3a1f2d(0x218)]||0x0,..._0x1add2f[_0x3a1f2d(0x278)][_0x3a1f2d(0x269)]&&{'goal':_0x1add2f[_0x3a1f2d(0x278)][_0x3a1f2d(0x269)][_0x3a1f2d(0x1c5)]},'latest':_0x3c67d0[_0x3a1f2d(0x1f3)]===_0x57057a,'created_at':_0x1add2f[_0x3a1f2d(0x278)][_0x3a1f2d(0x1e4)],'updated_at':_0x1add2f[_0x3a1f2d(0x278)][_0x3a1f2d(0x1d1)],'url':_0x1d89ec},_0x290d33),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_0x53cd68=a28_0x24a3;(function(_0x425395,_0x3377be){const _0x1104b0=a28_0x24a3,_0x555322=_0x425395();while(!![]){try{const _0x5643d5=-parseInt(_0x1104b0(0x13e))/0x1+-parseInt(_0x1104b0(0x116))/0x2*(-parseInt(_0x1104b0(0x122))/0x3)+-parseInt(_0x1104b0(0x110))/0x4+parseInt(_0x1104b0(0x136))/0x5+-parseInt(_0x1104b0(0x141))/0x6*(parseInt(_0x1104b0(0x148))/0x7)+parseInt(_0x1104b0(0x13b))/0x8*(-parseInt(_0x1104b0(0x133))/0x9)+-parseInt(_0x1104b0(0x134))/0xa*(-parseInt(_0x1104b0(0x119))/0xb);if(_0x5643d5===_0x3377be)break;else _0x555322['push'](_0x555322['shift']());}catch(_0x2f4538){_0x555322['push'](_0x555322['shift']());}}}(a28_0x48c6,0x64eee));import{BaseCommand}from'./command.js';function a28_0x48c6(){const _0x2b8abe=['40344taVwKv','Validation\x20failed:\x20','execute','636227lECvyW','Validate\x20journey\x20YAML\x20files','error','6JhVzST','filePath','red','✔\x20All\x20','verbose','parentSegment','dim','5316745ZdOioG','1120152VVhale','.yaml','validCount','skippedCount','journey:validate','\x20journey(s)\x20valid','8GozShg','\x20valid','journey','214027BCDPoR','relativePath','type','\x20warning(s)','\x20journey(s)\x20with\x20errors,\x20','green','warnings','\x20segment\x20file(s)\x20skipped)','helpText','419961rcJXkU','reason','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','log','warningCount','name','\x20warning(s)\x20found','yellow','\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','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','hasErrors','endsWith','No\x20journey\x20YAML\x20files\x20found\x20in\x20','valid','length','.yml','\x20error(s)','1341sPXJyt','1160tvTAsS','message','118345yVDDtn','\x20segment\x20file(s)\x20skipped','errors','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','filter'];a28_0x48c6=function(){return _0x2b8abe;};return a28_0x48c6();}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a28_0x24a3(_0x344d98,_0x12410c){_0x344d98=_0x344d98-0x110;const _0x48c6e5=a28_0x48c6();let _0x24a39d=_0x48c6e5[_0x344d98];return _0x24a39d;}import a28_0x1732ed from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{[a28_0x53cd68(0x127)]=a28_0x53cd68(0x114);['description']=a28_0x53cd68(0x13f);async[a28_0x53cd68(0x13d)](_0x23ac62){const _0x52c5b0=a28_0x53cd68,{options:_0x56c98e,args:_0x55c1ab}=_0x23ac62,_0x2a4c4b=_0x56c98e,_0x1522a4=await resolveTarget({'arg':_0x55c1ab[0x0],'contextParent':_0x56c98e[_0x52c5b0(0x146)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x1522a4))return _0x1522a4['errorCode']==='no_parent'?(console[_0x52c5b0(0x140)](a28_0x1732ed[_0x52c5b0(0x129)](_0x52c5b0(0x124))),console['error'](_0x52c5b0(0x139)),console[_0x52c5b0(0x140)](_0x52c5b0(0x12a)),console[_0x52c5b0(0x140)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x52c5b0(0x140)](a28_0x1732ed['red']('Error:\x20'+_0x1522a4[_0x52c5b0(0x135)]+'\x0a')),_0x1522a4[_0x52c5b0(0x121)]&&console[_0x52c5b0(0x140)](a28_0x1732ed['cyan'](_0x1522a4[_0x52c5b0(0x121)]))),0x1;const _0x309788=_0x1522a4['targetDir'],_0x2a7bb8=_0x1522a4[_0x52c5b0(0x11b)]==='file'?_0x1522a4[_0x52c5b0(0x142)]:undefined;if(!_0x2a7bb8&&!existsSync(_0x309788))return console[_0x52c5b0(0x140)](a28_0x1732ed['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x309788+'\x0a')),0x1;let _0x1a2d51;if(_0x2a7bb8){if(!_0x2a7bb8['endsWith'](_0x52c5b0(0x131))&&!_0x2a7bb8[_0x52c5b0(0x12d)](_0x52c5b0(0x111)))return console[_0x52c5b0(0x140)](a28_0x1732ed['red'](_0x52c5b0(0x12b)+_0x2a7bb8+'\x0a')),0x1;_0x1a2d51=[_0x2a7bb8];}else _0x1a2d51=findYamlFiles(_0x309788);if(_0x1a2d51[_0x52c5b0(0x130)]===0x0)return console['error'](a28_0x1732ed[_0x52c5b0(0x143)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x309788+'\x0a')),0x1;const _0x225686=validateYamlFiles(_0x1a2d51,_0x309788,{'filterType':_0x52c5b0(0x118)}),_0x31de65=calculateSummary(_0x225686),_0x4367e9=_0x225686[_0x52c5b0(0x13a)](isValidationResult);if(_0x4367e9[_0x52c5b0(0x130)]===0x0)return console[_0x52c5b0(0x140)](a28_0x1732ed[_0x52c5b0(0x129)](_0x52c5b0(0x12e)+_0x309788+'\x0a')),_0x31de65['skippedCount']>0x0&&console[_0x52c5b0(0x140)](a28_0x1732ed[_0x52c5b0(0x147)]('('+_0x31de65[_0x52c5b0(0x113)]+_0x52c5b0(0x120))),0x0;for(const _0x2c10c4 of _0x225686){if(!isValidationResult(_0x2c10c4)){_0x2a4c4b[_0x52c5b0(0x145)]&&console[_0x52c5b0(0x125)](a28_0x1732ed[_0x52c5b0(0x147)]('-\x20'+_0x2c10c4[_0x52c5b0(0x11a)]+'\x20(skipped:\x20'+_0x2c10c4[_0x52c5b0(0x123)]+')'));continue;}const {relativePath:_0x497a69,source:_0x3d9aa6,result:_0x2a061c}=_0x2c10c4;if(_0x2a061c[_0x52c5b0(0x12f)]&&_0x2a061c[_0x52c5b0(0x11f)]['length']===0x0)_0x2a4c4b['verbose']&&console['log'](a28_0x1732ed[_0x52c5b0(0x11e)]('✔\x20'+_0x497a69));else _0x2a061c['valid']?(console[_0x52c5b0(0x125)](a28_0x1732ed[_0x52c5b0(0x129)]('⚠\x20'+_0x497a69+':\x20'+_0x2a061c[_0x52c5b0(0x11f)]['length']+_0x52c5b0(0x11c))),console['log'](formatValidationResult(_0x2a061c,_0x3d9aa6,_0x497a69))):(console[_0x52c5b0(0x125)](a28_0x1732ed['red']('✖\x20'+_0x497a69+':\x20'+_0x2a061c[_0x52c5b0(0x138)]['length']+_0x52c5b0(0x132))),console['log'](formatValidationResult(_0x2a061c,_0x3d9aa6,_0x497a69)));}return console[_0x52c5b0(0x125)](''),_0x31de65[_0x52c5b0(0x12c)]?(console['log'](a28_0x1732ed['red'](_0x52c5b0(0x13c)+_0x31de65['invalidCount']+_0x52c5b0(0x11d)+_0x31de65[_0x52c5b0(0x112)]+_0x52c5b0(0x117))),_0x31de65[_0x52c5b0(0x126)]>0x0&&console['log'](a28_0x1732ed[_0x52c5b0(0x129)](_0x31de65[_0x52c5b0(0x126)]+_0x52c5b0(0x128))),_0x31de65[_0x52c5b0(0x113)]>0x0&&console['log'](a28_0x1732ed[_0x52c5b0(0x147)](_0x31de65[_0x52c5b0(0x113)]+'\x20segment\x20file(s)\x20skipped')),0x1):(console[_0x52c5b0(0x125)](a28_0x1732ed[_0x52c5b0(0x11e)](_0x52c5b0(0x144)+_0x31de65[_0x52c5b0(0x112)]+_0x52c5b0(0x115))),_0x31de65[_0x52c5b0(0x126)]>0x0&&console[_0x52c5b0(0x125)](a28_0x1732ed[_0x52c5b0(0x129)](_0x31de65[_0x52c5b0(0x126)]+_0x52c5b0(0x128))),_0x31de65[_0x52c5b0(0x113)]>0x0&&console[_0x52c5b0(0x125)](a28_0x1732ed[_0x52c5b0(0x147)](_0x31de65[_0x52c5b0(0x113)]+_0x52c5b0(0x137))),0x0);}}