@treasuredata/tdx 2026.4.5 → 2026.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.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.d.ts +3 -0
  168. package/dist/sdk/types/workspace.d.ts.map +1 -1
  169. package/dist/sdk/types/workspace.js +1 -1
  170. package/dist/sdk/types/workspace.js.map +1 -1
  171. package/dist/sdk/user.js +1 -1
  172. package/dist/sdk/util/format-detector.js +1 -1
  173. package/dist/sdk/util/formatters.js +1 -1
  174. package/dist/sdk/util/index.js +1 -1
  175. package/dist/sdk/util/paginate.js +1 -1
  176. package/dist/sdk/util/tree-formatter.js +1 -1
  177. package/dist/sdk/workflow/archive-validation.js +1 -1
  178. package/dist/sdk/workflow/clone-workflow.js +1 -1
  179. package/dist/sdk/workflow/index.js +1 -1
  180. package/dist/sdk/workflow/pull-workflow.js +1 -1
  181. package/dist/sdk/workflow/push-workflow.js +1 -1
  182. package/dist/sdk/workflow/tdx-config.js +1 -1
  183. package/dist/sdk/workflow/workflow-utils.js +1 -1
  184. package/dist/sdk/workspace/access-tracker.d.ts.map +1 -1
  185. package/dist/sdk/workspace/access-tracker.js +1 -1
  186. package/dist/sdk/workspace/access-tracker.js.map +1 -1
  187. package/dist/sdk/workspace/frontmatter.js +1 -1
  188. package/dist/sdk/workspace/git.js +1 -1
  189. package/dist/sdk/workspace/index.d.ts +1 -1
  190. package/dist/sdk/workspace/index.d.ts.map +1 -1
  191. package/dist/sdk/workspace/index.js +1 -1
  192. package/dist/sdk/workspace/index.js.map +1 -1
  193. package/dist/sdk/workspace/templates.js +1 -1
  194. package/dist/sdk/workspace/weekly.js +1 -1
  195. package/dist/sdk/workspace/wikilinks.d.ts +2 -0
  196. package/dist/sdk/workspace/wikilinks.d.ts.map +1 -1
  197. package/dist/sdk/workspace/wikilinks.js +1 -1
  198. package/dist/sdk/workspace/wikilinks.js.map +1 -1
  199. package/dist/test-utils/command-runner.js +1 -1
  200. package/dist/test-utils/factories.js +1 -1
  201. package/dist/test-utils/fixtures.js +1 -1
  202. package/dist/test-utils/http-mock.js +1 -1
  203. package/dist/test-utils/index.js +1 -1
  204. package/dist/utils/async.js +1 -1
  205. package/dist/utils/colors.js +1 -1
  206. package/dist/utils/diff.js +1 -1
  207. package/dist/utils/file-permissions.js +1 -1
  208. package/dist/utils/file-reader.js +1 -1
  209. package/dist/utils/github-releases.js +1 -1
  210. package/dist/utils/global-cache.js +1 -1
  211. package/dist/utils/json-loader.js +1 -1
  212. package/dist/utils/local-cache.js +1 -1
  213. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  214. package/dist/utils/logger/formatters/index.js +1 -1
  215. package/dist/utils/logger/handlers/console-handler.js +1 -1
  216. package/dist/utils/logger/handlers/file-handler.js +1 -1
  217. package/dist/utils/logger/handlers/index.js +1 -1
  218. package/dist/utils/logger/handlers/null-handler.js +1 -1
  219. package/dist/utils/logger/index.js +1 -1
  220. package/dist/utils/logger/logger.js +1 -1
  221. package/dist/utils/logger/types.js +1 -1
  222. package/dist/utils/option-validation.js +1 -1
  223. package/dist/utils/process.js +1 -1
  224. package/dist/utils/prompt.js +1 -1
  225. package/dist/utils/spinner.js +1 -1
  226. package/dist/utils/sse-parser.js +1 -1
  227. package/dist/utils/string-utils.js +1 -1
  228. package/dist/utils/table-ref-parser.js +1 -1
  229. package/dist/utils/tdx-logger.js +1 -1
  230. package/dist/utils/version-check.js +1 -1
  231. package/package.json +1 -1
@@ -1 +1 @@
1
- const a24_0x3dd453=a24_0x28c5;(function(_0x182333,_0x55c1e6){const _0x188b91=a24_0x28c5,_0x466ed1=_0x182333();while(!![]){try{const _0x57c45a=parseInt(_0x188b91(0x117))/0x1*(parseInt(_0x188b91(0x10e))/0x2)+-parseInt(_0x188b91(0xf7))/0x3+-parseInt(_0x188b91(0x126))/0x4*(-parseInt(_0x188b91(0x104))/0x5)+parseInt(_0x188b91(0xfc))/0x6+parseInt(_0x188b91(0x129))/0x7*(-parseInt(_0x188b91(0x121))/0x8)+-parseInt(_0x188b91(0x122))/0x9*(-parseInt(_0x188b91(0x11a))/0xa)+-parseInt(_0x188b91(0x11b))/0xb*(parseInt(_0x188b91(0x12f))/0xc);if(_0x57c45a===_0x55c1e6)break;else _0x466ed1['push'](_0x466ed1['shift']());}catch(_0x363731){_0x466ed1['push'](_0x466ed1['shift']());}}}(a24_0x9b33,0xf3147));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a24_0x392d5d from'chalk';import a24_0x142476 from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';function a24_0x28c5(_0x1f50f1,_0x2940ee){_0x1f50f1=_0x1f50f1-0xf4;const _0x9b33e4=a24_0x9b33();let _0x28c531=_0x9b33e4[_0x1f50f1];return _0x28c531;}function a24_0x9b33(){const _0x269a9e=['workspace','1949640piMlWC','\x20template\x20files','Aborted.','dim','Push\x20','9298110prqBWy','filter','config','created','\x20templates','\x0aError:','create','relativePath','213640YxRITV','\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','updated','name','configDir','\x27...','site','error','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','\x20new\x20templates:','323708vbTMZS','resolve','yellow','✔\x20All\x20templates\x20are\x20up\x20to\x20date','Workspace\x20is\x20required.','templateId','message','✔\x20Created\x20','session','2rCfxaU','engage','red','6532190YkHuPk','979iFRjdF','length','\x0aValidation\x20errors\x20in\x20','def','-\x20no\x20changes\x20applied','verbose','106256otcQUP','9ARIZtF','engage:template:push','1\x20template\x20file:\x20','resolveWorkspaceId','132LoglrH','execute','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','644YzVrrb','data','green','path','errors','engage_workspace','144156tQppEu','dirname','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','action','description','setPhase','results','\x20errors:','warnings','\x20\x20\x20\x20','Resolving\x20references...','cwd','yes','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)'];a24_0x9b33=function(){return _0x269a9e;};return a24_0x9b33();}import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{['name']=a24_0x3dd453(0x123);[a24_0x3dd453(0x134)]='Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates';async[a24_0x3dd453(0x127)](_0x3b3656){const _0x5272cd=a24_0x3dd453,{options:_0x192971,args:_0x1e93f5,tdx:_0x450bf7}=_0x3b3656,_0x1397b2=_0x192971,_0x5283c8=_0x1e93f5[0x0],_0x725a15=_0x5283c8?a24_0x142476[_0x5272cd(0x10f)](_0x5283c8):undefined,_0x2f356c=_0x725a15?isYamlFile(_0x725a15):![];let _0x1f999c;if(_0x2f356c&&_0x725a15)_0x1f999c=a24_0x142476[_0x5272cd(0x130)](_0x725a15);else _0x725a15?_0x1f999c=_0x725a15:_0x1f999c=process[_0x5272cd(0x13b)]();let _0x2154ce;const _0x58d2d2=tryFindTdxConfig(_0x1f999c);_0x58d2d2?.[_0x5272cd(0xfe)][_0x5272cd(0x12e)]&&(_0x2154ce=_0x58d2d2[_0x5272cd(0xfe)]['engage_workspace'],!_0x2f356c&&(_0x1f999c=_0x58d2d2[_0x5272cd(0x108)]));_0x1397b2[_0x5272cd(0xf6)]&&(_0x2154ce=_0x1397b2[_0x5272cd(0xf6)]);if(!_0x2154ce){const _0x107c8a=loadSessionContext(_0x1397b2[_0x5272cd(0x116)]);_0x107c8a?.['engage_workspace']&&(_0x2154ce=_0x107c8a['engage_workspace']);}if(!_0x2154ce)return console[_0x5272cd(0x10b)](a24_0x392d5d[_0x5272cd(0x110)](_0x5272cd(0x112))),console['error'](_0x5272cd(0x105)),console[_0x5272cd(0x10b)](_0x5272cd(0xf5)),console[_0x5272cd(0x10b)](_0x5272cd(0x132)),console[_0x5272cd(0x10b)](_0x5272cd(0x131)),0x1;let _0x31dfc4;_0x2f356c&&_0x725a15?_0x31dfc4=[parseTemplateFile(_0x725a15,a24_0x142476['dirname'](_0x725a15))]:_0x31dfc4=discoverAndParseTemplateFiles(_0x1f999c);if(_0x31dfc4['length']===0x0)return console[_0x5272cd(0x10b)](a24_0x392d5d[_0x5272cd(0x110)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x1f999c)),console[_0x5272cd(0x10b)](a24_0x392d5d[_0x5272cd(0xfa)](_0x5272cd(0x128))),0x1;const _0x22e56a=_0x31dfc4[_0x5272cd(0x11c)]===0x1?_0x5272cd(0x124)+_0x31dfc4[0x0]['def'][_0x5272cd(0x107)]:_0x31dfc4[_0x5272cd(0x11c)]+_0x5272cd(0xf8);console[_0x5272cd(0x10b)]('Found\x20'+a24_0x392d5d['cyan'](_0x22e56a));let _0x46f3a3=![];for(const _0x18f872 of _0x31dfc4){const _0x5757c0=validateTemplateDef(_0x18f872[_0x5272cd(0x11e)]);if(!_0x5757c0['valid']){_0x46f3a3=!![],console[_0x5272cd(0x10b)](a24_0x392d5d[_0x5272cd(0x119)](_0x5272cd(0x11d)+_0x18f872[_0x5272cd(0x103)]+':'));for(const _0x563a2f of _0x5757c0[_0x5272cd(0x12d)]){console[_0x5272cd(0x10b)]('\x20\x20'+a24_0x392d5d[_0x5272cd(0x119)]('✗')+'\x20'+_0x563a2f[_0x5272cd(0x12c)]+':\x20'+_0x563a2f['message']);}}for(const _0x16b2bc of _0x5757c0[_0x5272cd(0x138)]){console['error']('\x20\x20'+a24_0x392d5d[_0x5272cd(0x110)]('⚠')+'\x20'+_0x16b2bc[_0x5272cd(0x12c)]+':\x20'+_0x16b2bc[_0x5272cd(0x114)]);}}if(_0x46f3a3)return console['error'](a24_0x392d5d[_0x5272cd(0x119)](_0x5272cd(0x10c))),0x1;const _0x960f43=await _0x450bf7[_0x5272cd(0x118)][_0x5272cd(0x125)](_0x2154ce),_0x1bb277=await withProgressSpinner('Preparing\x20push\x20to\x20workspace\x20\x27'+_0x2154ce+_0x5272cd(0x109),_0x476616=>preparePush({'engage':_0x450bf7[_0x5272cd(0x118)]},_0x31dfc4,_0x960f43,{'progress':{'update':_0x24c72d=>_0x476616[_0x5272cd(0x135)](_0x24c72d)}}),{'verbose':_0x1397b2[_0x5272cd(0x120)]}),_0x58f9af=_0x1bb277[_0x5272cd(0x12a)];await withProgressSpinner(_0x5272cd(0x13a),_0x404083=>resolveAndBuildInputs({'engage':_0x450bf7[_0x5272cd(0x118)]},_0x58f9af,_0x960f43,{'progress':{'update':_0x26c786=>_0x404083[_0x5272cd(0x135)](_0x26c786)}}),{'verbose':_0x1397b2[_0x5272cd(0x120)]});const _0x5d3947=_0x58f9af[_0x5272cd(0xfd)](_0xe6ca30=>_0xe6ca30[_0x5272cd(0x133)]===_0x5272cd(0x102)),_0x38fec1=_0x58f9af['filter'](_0x156a74=>_0x156a74['action']==='update');console[_0x5272cd(0x10b)]('\x0aPush\x20summary\x20for\x20workspace\x20\x27'+_0x2154ce+'\x27:');if(_0x5d3947[_0x5272cd(0x11c)]>0x0){console['error']('\x20\x20'+a24_0x392d5d[_0x5272cd(0x12b)]('+\x20'+_0x5d3947['length']+_0x5272cd(0x10d)));for(const _0x4b8026 of _0x5d3947){console[_0x5272cd(0x10b)]('\x20\x20\x20\x20'+a24_0x392d5d[_0x5272cd(0x12b)]('+')+'\x20'+_0x4b8026['def'][_0x5272cd(0x107)]);}}if(_0x38fec1['length']>0x0){console[_0x5272cd(0x10b)]('\x20\x20'+a24_0x392d5d['yellow']('~\x20'+_0x38fec1[_0x5272cd(0x11c)]+'\x20templates\x20to\x20update:'));for(const _0x18d7e6 of _0x38fec1){console[_0x5272cd(0x10b)](_0x5272cd(0x139)+a24_0x392d5d['yellow']('~')+'\x20'+_0x18d7e6[_0x5272cd(0x11e)][_0x5272cd(0x107)]);}}if(_0x5d3947[_0x5272cd(0x11c)]===0x0&&_0x38fec1[_0x5272cd(0x11c)]===0x0)return console[_0x5272cd(0x10b)](a24_0x392d5d[_0x5272cd(0x12b)](_0x5272cd(0x111))),0x0;if(_0x1397b2['dryRun'])return console[_0x5272cd(0x10b)](a24_0x392d5d[_0x5272cd(0x110)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied')),0x0;if(!_0x1397b2[_0x5272cd(0xf4)]){if(!isInteractive())return console[_0x5272cd(0x10b)](a24_0x392d5d[_0x5272cd(0x119)](_0x5272cd(0x101)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x5272cd(0x10b)](a24_0x392d5d[_0x5272cd(0xfa)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x54ea41=await confirmKey(_0x5272cd(0xfb)+(_0x5d3947[_0x5272cd(0x11c)]+_0x38fec1['length'])+'\x20templates?');if(!_0x54ea41)return console[_0x5272cd(0x10b)](a24_0x392d5d[_0x5272cd(0x110)](_0x5272cd(0xf9)),_0x5272cd(0x11f)),0x1;}const _0x33628a=await withProgressSpinner('Pushing\x20templates...',_0x286f3a=>executePush({'engage':_0x450bf7[_0x5272cd(0x118)]},_0x58f9af,{'progress':{'update':_0x504fb0=>_0x286f3a[_0x5272cd(0x135)](_0x504fb0)}}),{'verbose':_0x1397b2[_0x5272cd(0x120)]}),_0x5f0b70=_0x33628a[_0x5272cd(0x12a)];for(const _0x48e8fe of _0x5f0b70[_0x5272cd(0x136)]){if(_0x48e8fe[_0x5272cd(0x113)]&&(_0x48e8fe['action']===_0x5272cd(0xff)||_0x48e8fe[_0x5272cd(0x133)]===_0x5272cd(0x106))){const _0x1ab8da=getTemplateUrl(_0x1397b2[_0x5272cd(0x10a)],_0x960f43,_0x48e8fe[_0x5272cd(0x113)]),_0x582fcf=_0x48e8fe[_0x5272cd(0x133)]==='created'?'+':'~',_0x3fdbc6=_0x48e8fe[_0x5272cd(0x133)]==='created'?a24_0x392d5d[_0x5272cd(0x12b)](_0x582fcf):a24_0x392d5d['yellow'](_0x582fcf);console[_0x5272cd(0x10b)]('\x20\x20'+_0x3fdbc6+'\x20'+hyperlink(_0x48e8fe['name'],_0x1ab8da)+'\x20'+a24_0x392d5d[_0x5272cd(0xfa)](_0x1ab8da));}}_0x5f0b70[_0x5272cd(0xff)]>0x0&&console[_0x5272cd(0x10b)](a24_0x392d5d[_0x5272cd(0x12b)](_0x5272cd(0x115)+_0x5f0b70[_0x5272cd(0xff)]+_0x5272cd(0x100)));_0x5f0b70[_0x5272cd(0x106)]>0x0&&console[_0x5272cd(0x10b)](a24_0x392d5d[_0x5272cd(0x12b)]('✔\x20Updated\x20'+_0x5f0b70['updated']+_0x5272cd(0x100)));if(_0x5f0b70[_0x5272cd(0x12d)][_0x5272cd(0x11c)]>0x0){console[_0x5272cd(0x10b)](a24_0x392d5d[_0x5272cd(0x119)]('✘\x20'+_0x5f0b70[_0x5272cd(0x12d)][_0x5272cd(0x11c)]+_0x5272cd(0x137)));for(const _0x37260c of _0x5f0b70['errors']){console[_0x5272cd(0x10b)]('\x20\x20'+a24_0x392d5d[_0x5272cd(0x119)](_0x37260c[_0x5272cd(0x107)])+':\x20'+_0x37260c[_0x5272cd(0x10b)]);}}return saveSessionContext({'engage_workspace':_0x2154ce},_0x1397b2[_0x5272cd(0x116)]),_0x5f0b70[_0x5272cd(0x12d)][_0x5272cd(0x11c)]>0x0?0x1:0x0;}}
1
+ const a24_0x56546c=a24_0x3ebf;(function(_0x136c30,_0x3e9975){const _0x28caf4=a24_0x3ebf,_0xbb59a1=_0x136c30();while(!![]){try{const _0x423322=-parseInt(_0x28caf4(0x140))/0x1*(parseInt(_0x28caf4(0x17a))/0x2)+parseInt(_0x28caf4(0x161))/0x3+-parseInt(_0x28caf4(0x159))/0x4*(parseInt(_0x28caf4(0x17e))/0x5)+-parseInt(_0x28caf4(0x143))/0x6*(-parseInt(_0x28caf4(0x138))/0x7)+parseInt(_0x28caf4(0x172))/0x8*(-parseInt(_0x28caf4(0x13b))/0x9)+parseInt(_0x28caf4(0x162))/0xa*(parseInt(_0x28caf4(0x147))/0xb)+parseInt(_0x28caf4(0x164))/0xc*(parseInt(_0x28caf4(0x155))/0xd);if(_0x423322===_0x3e9975)break;else _0xbb59a1['push'](_0xbb59a1['shift']());}catch(_0x9e98c0){_0xbb59a1['push'](_0xbb59a1['shift']());}}}(a24_0x4644,0xca359));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';function a24_0x3ebf(_0x451771,_0x4421f7){_0x451771=_0x451771-0x134;const _0x4644f6=a24_0x4644();let _0x3ebf1e=_0x4644f6[_0x451771];return _0x3ebf1e;}import a24_0x3d15b1 from'chalk';import a24_0x131880 from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{[a24_0x56546c(0x14d)]=a24_0x56546c(0x13d);[a24_0x56546c(0x13f)]=a24_0x56546c(0x17d);async['execute'](_0x5c60e6){const _0x2b67a0=a24_0x56546c,{options:_0x300857,args:_0x2b51fb,tdx:_0x3a7eef}=_0x5c60e6,_0x4a27b9=_0x300857,_0x185155=_0x2b51fb[0x0],_0x38f952=_0x185155?a24_0x131880[_0x2b67a0(0x17b)](_0x185155):undefined,_0x337df5=_0x38f952?isYamlFile(_0x38f952):![];let _0x1e2eb1;if(_0x337df5&&_0x38f952)_0x1e2eb1=a24_0x131880[_0x2b67a0(0x13a)](_0x38f952);else _0x38f952?_0x1e2eb1=_0x38f952:_0x1e2eb1=process[_0x2b67a0(0x14c)]();let _0x341496;const _0x1c43d6=tryFindTdxConfig(_0x1e2eb1);_0x1c43d6?.[_0x2b67a0(0x154)]['engage_workspace']&&(_0x341496=_0x1c43d6[_0x2b67a0(0x154)][_0x2b67a0(0x156)],!_0x337df5&&(_0x1e2eb1=_0x1c43d6['configDir']));_0x4a27b9['workspace']&&(_0x341496=_0x4a27b9['workspace']);if(!_0x341496){const _0xb75eee=loadSessionContext(_0x4a27b9[_0x2b67a0(0x14a)]);_0xb75eee?.[_0x2b67a0(0x156)]&&(_0x341496=_0xb75eee[_0x2b67a0(0x156)]);}if(!_0x341496)return console['error'](a24_0x3d15b1['yellow'](_0x2b67a0(0x174))),console['error'](_0x2b67a0(0x142)),console[_0x2b67a0(0x171)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)'),console[_0x2b67a0(0x171)](_0x2b67a0(0x13e)),console[_0x2b67a0(0x171)]('\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>'),0x1;let _0x1451a1;_0x337df5&&_0x38f952?_0x1451a1=[parseTemplateFile(_0x38f952,a24_0x131880['dirname'](_0x38f952))]:_0x1451a1=discoverAndParseTemplateFiles(_0x1e2eb1);if(_0x1451a1[_0x2b67a0(0x175)]===0x0)return console['error'](a24_0x3d15b1[_0x2b67a0(0x15f)](_0x2b67a0(0x167)+_0x1e2eb1)),console['error'](a24_0x3d15b1[_0x2b67a0(0x157)](_0x2b67a0(0x151))),0x1;const _0xea5cf7=_0x1451a1['length']===0x1?'1\x20template\x20file:\x20'+_0x1451a1[0x0][_0x2b67a0(0x165)]['name']:_0x1451a1[_0x2b67a0(0x175)]+'\x20template\x20files';console['error'](_0x2b67a0(0x14f)+a24_0x3d15b1[_0x2b67a0(0x144)](_0xea5cf7));let _0x56130f=![];for(const _0x3e5cc7 of _0x1451a1){const _0x11ad5d=validateTemplateDef(_0x3e5cc7[_0x2b67a0(0x165)]);if(!_0x11ad5d['valid']){_0x56130f=!![],console['error'](a24_0x3d15b1['red'](_0x2b67a0(0x134)+_0x3e5cc7[_0x2b67a0(0x15d)]+':'));for(const _0x7695ab of _0x11ad5d[_0x2b67a0(0x163)]){console[_0x2b67a0(0x171)]('\x20\x20'+a24_0x3d15b1[_0x2b67a0(0x170)]('✗')+'\x20'+_0x7695ab[_0x2b67a0(0x14b)]+':\x20'+_0x7695ab[_0x2b67a0(0x15c)]);}}for(const _0x5c6cae of _0x11ad5d[_0x2b67a0(0x169)]){console['error']('\x20\x20'+a24_0x3d15b1[_0x2b67a0(0x15f)]('⚠')+'\x20'+_0x5c6cae[_0x2b67a0(0x14b)]+':\x20'+_0x5c6cae[_0x2b67a0(0x15c)]);}}if(_0x56130f)return console[_0x2b67a0(0x171)](a24_0x3d15b1['red'](_0x2b67a0(0x14e))),0x1;const _0x247156=await _0x3a7eef[_0x2b67a0(0x16d)][_0x2b67a0(0x146)](_0x341496),_0x154b62=await withProgressSpinner(_0x2b67a0(0x17c)+_0x341496+_0x2b67a0(0x15e),_0x1614b5=>preparePush({'engage':_0x3a7eef[_0x2b67a0(0x16d)]},_0x1451a1,_0x247156,{'progress':{'update':_0x13332d=>_0x1614b5['setPhase'](_0x13332d)}}),{'verbose':_0x4a27b9[_0x2b67a0(0x137)]}),_0x15a842=_0x154b62['data'];await withProgressSpinner(_0x2b67a0(0x179),_0x3a8bf3=>resolveAndBuildInputs({'engage':_0x3a7eef[_0x2b67a0(0x16d)]},_0x15a842,_0x247156,{'progress':{'update':_0x3f7374=>_0x3a8bf3['setPhase'](_0x3f7374)}}),{'verbose':_0x4a27b9[_0x2b67a0(0x137)]});const _0x4bba34=_0x15a842[_0x2b67a0(0x16f)](_0x18c6b2=>_0x18c6b2[_0x2b67a0(0x152)]===_0x2b67a0(0x168)),_0x1f3547=_0x15a842['filter'](_0x454c22=>_0x454c22['action']===_0x2b67a0(0x173));console[_0x2b67a0(0x171)](_0x2b67a0(0x153)+_0x341496+'\x27:');if(_0x4bba34['length']>0x0){console['error']('\x20\x20'+a24_0x3d15b1[_0x2b67a0(0x149)]('+\x20'+_0x4bba34[_0x2b67a0(0x175)]+_0x2b67a0(0x13c)));for(const _0x5ecb91 of _0x4bba34){console['error']('\x20\x20\x20\x20'+a24_0x3d15b1[_0x2b67a0(0x149)]('+')+'\x20'+_0x5ecb91[_0x2b67a0(0x165)][_0x2b67a0(0x14d)]);}}if(_0x1f3547[_0x2b67a0(0x175)]>0x0){console[_0x2b67a0(0x171)]('\x20\x20'+a24_0x3d15b1[_0x2b67a0(0x15f)]('~\x20'+_0x1f3547['length']+'\x20templates\x20to\x20update:'));for(const _0x239edb of _0x1f3547){console[_0x2b67a0(0x171)](_0x2b67a0(0x15a)+a24_0x3d15b1[_0x2b67a0(0x15f)]('~')+'\x20'+_0x239edb['def'][_0x2b67a0(0x14d)]);}}if(_0x4bba34[_0x2b67a0(0x175)]===0x0&&_0x1f3547[_0x2b67a0(0x175)]===0x0)return console[_0x2b67a0(0x171)](a24_0x3d15b1['green'](_0x2b67a0(0x15b))),0x0;if(_0x4a27b9[_0x2b67a0(0x16c)])return console[_0x2b67a0(0x171)](a24_0x3d15b1['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied')),0x0;if(!_0x4a27b9['yes']){if(!isInteractive())return console[_0x2b67a0(0x171)](a24_0x3d15b1['red'](_0x2b67a0(0x139)),_0x2b67a0(0x178)),console['error'](a24_0x3d15b1[_0x2b67a0(0x157)](_0x2b67a0(0x16e))),0x1;const _0x5b39e0=await confirmKey(_0x2b67a0(0x158)+(_0x4bba34[_0x2b67a0(0x175)]+_0x1f3547[_0x2b67a0(0x175)])+'\x20templates?');if(!_0x5b39e0)return console[_0x2b67a0(0x171)](a24_0x3d15b1[_0x2b67a0(0x15f)](_0x2b67a0(0x16b)),_0x2b67a0(0x166)),0x1;}const _0x554a25=await withProgressSpinner(_0x2b67a0(0x177),_0x22cb89=>executePush({'engage':_0x3a7eef['engage']},_0x15a842,{'progress':{'update':_0x21f1d9=>_0x22cb89['setPhase'](_0x21f1d9)}}),{'verbose':_0x4a27b9[_0x2b67a0(0x137)]}),_0x543871=_0x554a25[_0x2b67a0(0x150)];for(const _0x3f823a of _0x543871[_0x2b67a0(0x141)]){if(_0x3f823a[_0x2b67a0(0x148)]&&(_0x3f823a[_0x2b67a0(0x152)]===_0x2b67a0(0x16a)||_0x3f823a[_0x2b67a0(0x152)]===_0x2b67a0(0x136))){const _0x35ac03=getTemplateUrl(_0x4a27b9[_0x2b67a0(0x176)],_0x247156,_0x3f823a[_0x2b67a0(0x148)]),_0x3d92b9=_0x3f823a['action']===_0x2b67a0(0x16a)?'+':'~',_0x3d0bf4=_0x3f823a['action']===_0x2b67a0(0x16a)?a24_0x3d15b1[_0x2b67a0(0x149)](_0x3d92b9):a24_0x3d15b1[_0x2b67a0(0x15f)](_0x3d92b9);console[_0x2b67a0(0x171)]('\x20\x20'+_0x3d0bf4+'\x20'+hyperlink(_0x3f823a[_0x2b67a0(0x14d)],_0x35ac03)+'\x20'+a24_0x3d15b1['dim'](_0x35ac03));}}_0x543871[_0x2b67a0(0x16a)]>0x0&&console[_0x2b67a0(0x171)](a24_0x3d15b1['green']('✔\x20Created\x20'+_0x543871[_0x2b67a0(0x16a)]+_0x2b67a0(0x135)));_0x543871[_0x2b67a0(0x136)]>0x0&&console[_0x2b67a0(0x171)](a24_0x3d15b1[_0x2b67a0(0x149)](_0x2b67a0(0x145)+_0x543871[_0x2b67a0(0x136)]+'\x20templates'));if(_0x543871[_0x2b67a0(0x163)][_0x2b67a0(0x175)]>0x0){console['error'](a24_0x3d15b1[_0x2b67a0(0x170)]('✘\x20'+_0x543871[_0x2b67a0(0x163)][_0x2b67a0(0x175)]+_0x2b67a0(0x160)));for(const _0x35bf29 of _0x543871[_0x2b67a0(0x163)]){console[_0x2b67a0(0x171)]('\x20\x20'+a24_0x3d15b1[_0x2b67a0(0x170)](_0x35bf29[_0x2b67a0(0x14d)])+':\x20'+_0x35bf29[_0x2b67a0(0x171)]);}}return saveSessionContext({'engage_workspace':_0x341496},_0x4a27b9[_0x2b67a0(0x14a)]),_0x543871['errors'][_0x2b67a0(0x175)]>0x0?0x1:0x0;}}function a24_0x4644(){const _0x5afdfe=['resolveWorkspaceId','121hiyRYu','templateId','green','session','path','cwd','name','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','Found\x20','data','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','action','\x0aPush\x20summary\x20for\x20workspace\x20\x27','config','100061VlIRht','engage_workspace','dim','Push\x20','20LandJW','\x20\x20\x20\x20','✔\x20All\x20templates\x20are\x20up\x20to\x20date','message','relativePath','\x27...','yellow','\x20errors:','2962317lMPUWL','647030mDIKIh','errors','528fXXbif','def','-\x20no\x20changes\x20applied','No\x20template\x20YAML\x20files\x20found\x20in\x20','create','warnings','created','Aborted.','dryRun','engage','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','filter','red','error','144syPGHa','update','Workspace\x20is\x20required.','length','site','Pushing\x20templates...','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Resolving\x20references...','10FKTihe','resolve','Preparing\x20push\x20to\x20workspace\x20\x27','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','1509665jsYRvl','\x0aValidation\x20errors\x20in\x20','\x20templates','updated','verbose','12845ohYFuT','\x0aError:','dirname','54783MeKyPw','\x20new\x20templates:','engage:template:push','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','description','21933gypaJM','results','\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','1698XOfIfG','cyan','✔\x20Updated\x20'];a24_0x4644=function(){return _0x5afdfe;};return a24_0x4644();}
@@ -1 +1 @@
1
- const a25_0x381878=a25_0x2bf1;(function(_0x49dfe9,_0xd7047a){const _0xcc4362=a25_0x2bf1,_0x56c20d=_0x49dfe9();while(!![]){try{const _0x196705=parseInt(_0xcc4362(0x1cc))/0x1*(parseInt(_0xcc4362(0x1d0))/0x2)+-parseInt(_0xcc4362(0x1e8))/0x3*(parseInt(_0xcc4362(0x1eb))/0x4)+parseInt(_0xcc4362(0x1d8))/0x5+parseInt(_0xcc4362(0x1cb))/0x6+parseInt(_0xcc4362(0x1e9))/0x7+-parseInt(_0xcc4362(0x1e3))/0x8*(-parseInt(_0xcc4362(0x1cd))/0x9)+parseInt(_0xcc4362(0x1ce))/0xa*(-parseInt(_0xcc4362(0x1e1))/0xb);if(_0x196705===_0xd7047a)break;else _0x56c20d['push'](_0x56c20d['shift']());}catch(_0x22bfd8){_0x56c20d['push'](_0x56c20d['shift']());}}}(a25_0x1bf7,0xa1134));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a25_0x13d9e1 from'chalk';import a25_0x26320c from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a25_0x2bf1(_0x238da8,_0x5a3cac){_0x238da8=_0x238da8-0x1c9;const _0x1bf781=a25_0x1bf7();let _0x2bf1a2=_0x1bf781[_0x238da8];return _0x2bf1a2;}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a25_0x381878(0x1f6)]=a25_0x381878(0x1ca);[a25_0x381878(0x1ec)]=a25_0x381878(0x1df);async[a25_0x381878(0x1f4)](_0x23f4db){const _0x236081=a25_0x381878,{options:_0x3c7bb6,args:_0x2cbc8c}=_0x23f4db,_0x4b2502=_0x3c7bb6,_0x3d643e=_0x2cbc8c[0x0],_0x5bc546=_0x3d643e?a25_0x26320c[_0x236081(0x1d2)](_0x3d643e):undefined,_0x52fdfc=_0x5bc546?isYamlFile(_0x5bc546):![];let _0x54484e,_0x213ff9;if(_0x52fdfc&&_0x5bc546)_0x54484e=a25_0x26320c[_0x236081(0x1d3)](_0x5bc546),_0x213ff9=_0x5bc546;else _0x5bc546?_0x54484e=_0x5bc546:_0x54484e=process[_0x236081(0x1e5)]();if(!_0x213ff9&&!existsSync(_0x54484e))return console[_0x236081(0x1e7)](a25_0x13d9e1[_0x236081(0x1fa)](_0x236081(0x1da)+_0x54484e+'\x0a')),0x1;let _0x52c403;if(_0x213ff9){if(!_0x213ff9[_0x236081(0x1f7)](_0x236081(0x1e2))&&!_0x213ff9[_0x236081(0x1f7)]('.yaml'))return console['error'](a25_0x13d9e1[_0x236081(0x1fa)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x213ff9+'\x0a')),0x1;_0x52c403=[_0x213ff9];}else _0x52c403=findYamlFiles(_0x54484e);if(_0x52c403[_0x236081(0x1fc)]===0x0)return console['error'](a25_0x13d9e1[_0x236081(0x1fa)](_0x236081(0x1e4)+_0x54484e+'\x0a')),0x1;const _0x576bc3=validateYamlFiles(_0x52c403,_0x54484e,{'filterType':_0x236081(0x1f5)}),_0x21d798=calculateSummary(_0x576bc3),_0x39e646=_0x576bc3[_0x236081(0x1ed)](isValidationResult);if(_0x39e646['length']===0x0)return console[_0x236081(0x1e7)](a25_0x13d9e1[_0x236081(0x1dc)](_0x236081(0x1e6)+_0x54484e+'\x0a')),_0x21d798[_0x236081(0x1ea)]>0x0&&console[_0x236081(0x1e7)](a25_0x13d9e1['dim']('('+_0x21d798['skippedCount']+_0x236081(0x1ef))),0x0;for(const _0x59ab77 of _0x576bc3){if(!isValidationResult(_0x59ab77)){_0x4b2502[_0x236081(0x1d6)]&&console[_0x236081(0x1dd)](a25_0x13d9e1['dim']('-\x20'+_0x59ab77['relativePath']+_0x236081(0x1cf)+_0x59ab77[_0x236081(0x1f3)]+')'));continue;}const {relativePath:_0xbada21,source:_0x17c29e,result:_0x1ffce0}=_0x59ab77;if(_0x1ffce0[_0x236081(0x1e0)]&&_0x1ffce0[_0x236081(0x1f2)][_0x236081(0x1fc)]===0x0)_0x4b2502['verbose']&&console[_0x236081(0x1dd)](a25_0x13d9e1[_0x236081(0x1d4)]('✔\x20'+_0xbada21));else _0x1ffce0['valid']?(console[_0x236081(0x1dd)](a25_0x13d9e1['yellow']('⚠\x20'+_0xbada21+':\x20'+_0x1ffce0[_0x236081(0x1f2)][_0x236081(0x1fc)]+'\x20warning(s)')),console['log'](formatValidationResult(_0x1ffce0,_0x17c29e,_0xbada21))):(console[_0x236081(0x1dd)](a25_0x13d9e1[_0x236081(0x1fa)]('✖\x20'+_0xbada21+':\x20'+_0x1ffce0[_0x236081(0x1ee)][_0x236081(0x1fc)]+_0x236081(0x1d7))),console[_0x236081(0x1dd)](formatValidationResult(_0x1ffce0,_0x17c29e,_0xbada21)));}return console[_0x236081(0x1dd)](''),_0x21d798[_0x236081(0x1d5)]?(console['log'](a25_0x13d9e1[_0x236081(0x1fa)]('Validation\x20failed:\x20'+_0x21d798[_0x236081(0x1db)]+_0x236081(0x1fb)+_0x21d798[_0x236081(0x1de)]+_0x236081(0x1d9))),_0x21d798[_0x236081(0x1c9)]>0x0&&console[_0x236081(0x1dd)](a25_0x13d9e1[_0x236081(0x1dc)](_0x21d798[_0x236081(0x1c9)]+_0x236081(0x1f9))),_0x21d798['skippedCount']>0x0&&console['log'](a25_0x13d9e1[_0x236081(0x1f8)](_0x21d798['skippedCount']+_0x236081(0x1d1))),0x1):(console['log'](a25_0x13d9e1[_0x236081(0x1d4)](_0x236081(0x1f0)+_0x21d798[_0x236081(0x1de)]+_0x236081(0x1f1))),_0x21d798[_0x236081(0x1c9)]>0x0&&console[_0x236081(0x1dd)](a25_0x13d9e1[_0x236081(0x1dc)](_0x21d798[_0x236081(0x1c9)]+_0x236081(0x1f9))),_0x21d798['skippedCount']>0x0&&console[_0x236081(0x1dd)](a25_0x13d9e1[_0x236081(0x1f8)](_0x21d798['skippedCount']+_0x236081(0x1d1))),0x0);}}function a25_0x1bf7(){const _0x3e2bb7=['cwd','No\x20template\x20YAML\x20files\x20found\x20in\x20','error','3mtSUeR','7226429BVJXnD','skippedCount','914236YsDnPC','description','filter','errors','\x20non-template\x20file(s)\x20skipped)','✔\x20All\x20','\x20template(s)\x20valid','warnings','reason','execute','template','name','endsWith','dim','\x20warning(s)\x20found','red','\x20template(s)\x20with\x20errors,\x20','length','warningCount','engage:template:validate','4477116UnEctX','4tSFsMl','192159GGxyxm','260mYSMoR','\x20(skipped:\x20','485868cRjvhA','\x20non-template\x20file(s)\x20skipped','resolve','dirname','green','hasErrors','verbose','\x20error(s)','4466105aeUxBQ','\x20valid','Error:\x20Directory\x20not\x20found:\x20','invalidCount','yellow','log','validCount','Validate\x20template\x20YAML\x20files','valid','1590204AjiLNm','.yml','376kwJhAe','Error:\x20No\x20YAML\x20files\x20found\x20in\x20'];a25_0x1bf7=function(){return _0x3e2bb7;};return a25_0x1bf7();}
1
+ const a25_0x364dfe=a25_0x4a39;(function(_0x27224d,_0x23a26a){const _0x169017=a25_0x4a39,_0x51d24b=_0x27224d();while(!![]){try{const _0x155fa3=-parseInt(_0x169017(0xea))/0x1+parseInt(_0x169017(0x101))/0x2*(parseInt(_0x169017(0x105))/0x3)+-parseInt(_0x169017(0xee))/0x4+parseInt(_0x169017(0xe3))/0x5*(-parseInt(_0x169017(0xf9))/0x6)+parseInt(_0x169017(0x10f))/0x7+-parseInt(_0x169017(0x104))/0x8+-parseInt(_0x169017(0xf4))/0x9*(-parseInt(_0x169017(0xed))/0xa);if(_0x155fa3===_0x23a26a)break;else _0x51d24b['push'](_0x51d24b['shift']());}catch(_0x3a9fa8){_0x51d24b['push'](_0x51d24b['shift']());}}}(a25_0x5d6a,0x225e3));import{BaseCommand}from'./command.js';function a25_0x4a39(_0x2808de,_0x225c40){_0x2808de=_0x2808de-0xe0;const _0x5d6a57=a25_0x5d6a();let _0x4a3940=_0x5d6a57[_0x2808de];return _0x4a3940;}import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a25_0xc223c8 from'chalk';import a25_0x5c1c46 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a25_0x5d6a(){const _0x16ed71=['\x20warning(s)\x20found','invalidCount','\x20non-template\x20file(s)\x20skipped','green','resolve','\x20non-template\x20file(s)\x20skipped)','warnings','validCount','1109710pyyvMo','description','template','relativePath','✔\x20All\x20','error','yellow','skippedCount','filter','45jGwPic','Error:\x20Directory\x20not\x20found:\x20','\x20warning(s)','.yml','Validate\x20template\x20YAML\x20files','\x20template(s)\x20valid','name','134461ECgkoz','.yaml','warningCount','6259370ijHEfx','829652FgiTaN','engage:template:validate','\x20(skipped:\x20','Validation\x20failed:\x20','No\x20template\x20YAML\x20files\x20found\x20in\x20','errors','9VvGcyg','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','valid','\x20template(s)\x20with\x20errors,\x20','verbose','182964OOpuCX','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20valid','endsWith','reason','red','length','dim','166256mVbBxT','log','\x20error(s)','2214080fAXURa','9spRqgm','cwd'];a25_0x5d6a=function(){return _0x16ed71;};return a25_0x5d6a();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a25_0x364dfe(0xe9)]=a25_0x364dfe(0xef);[a25_0x364dfe(0x110)]=a25_0x364dfe(0xe7);async['execute'](_0x3d9417){const _0x2297bf=a25_0x364dfe,{options:_0x4fd727,args:_0x2cb635}=_0x3d9417,_0x17b1f2=_0x4fd727,_0x3ab05e=_0x2cb635[0x0],_0x459592=_0x3ab05e?a25_0x5c1c46[_0x2297bf(0x10b)](_0x3ab05e):undefined,_0x1c523c=_0x459592?isYamlFile(_0x459592):![];let _0x2df53e,_0xd9f0c5;if(_0x1c523c&&_0x459592)_0x2df53e=a25_0x5c1c46['dirname'](_0x459592),_0xd9f0c5=_0x459592;else _0x459592?_0x2df53e=_0x459592:_0x2df53e=process[_0x2297bf(0x106)]();if(!_0xd9f0c5&&!existsSync(_0x2df53e))return console[_0x2297bf(0x114)](a25_0xc223c8[_0x2297bf(0xfe)](_0x2297bf(0xe4)+_0x2df53e+'\x0a')),0x1;let _0x32e3ad;if(_0xd9f0c5){if(!_0xd9f0c5[_0x2297bf(0xfc)](_0x2297bf(0xe6))&&!_0xd9f0c5[_0x2297bf(0xfc)](_0x2297bf(0xeb)))return console[_0x2297bf(0x114)](a25_0xc223c8['red'](_0x2297bf(0xf5)+_0xd9f0c5+'\x0a')),0x1;_0x32e3ad=[_0xd9f0c5];}else _0x32e3ad=findYamlFiles(_0x2df53e);if(_0x32e3ad[_0x2297bf(0xff)]===0x0)return console[_0x2297bf(0x114)](a25_0xc223c8[_0x2297bf(0xfe)](_0x2297bf(0xfa)+_0x2df53e+'\x0a')),0x1;const _0x2d21aa=validateYamlFiles(_0x32e3ad,_0x2df53e,{'filterType':_0x2297bf(0x111)}),_0x11a413=calculateSummary(_0x2d21aa),_0x1d7c1c=_0x2d21aa[_0x2297bf(0xe2)](isValidationResult);if(_0x1d7c1c[_0x2297bf(0xff)]===0x0)return console[_0x2297bf(0x114)](a25_0xc223c8[_0x2297bf(0xe0)](_0x2297bf(0xf2)+_0x2df53e+'\x0a')),_0x11a413[_0x2297bf(0xe1)]>0x0&&console[_0x2297bf(0x114)](a25_0xc223c8[_0x2297bf(0x100)]('('+_0x11a413[_0x2297bf(0xe1)]+_0x2297bf(0x10c))),0x0;for(const _0x32baec of _0x2d21aa){if(!isValidationResult(_0x32baec)){_0x17b1f2[_0x2297bf(0xf8)]&&console[_0x2297bf(0x102)](a25_0xc223c8[_0x2297bf(0x100)]('-\x20'+_0x32baec[_0x2297bf(0x112)]+_0x2297bf(0xf0)+_0x32baec[_0x2297bf(0xfd)]+')'));continue;}const {relativePath:_0x32895d,source:_0x3d9daa,result:_0x196c0b}=_0x32baec;if(_0x196c0b['valid']&&_0x196c0b[_0x2297bf(0x10d)]['length']===0x0)_0x17b1f2['verbose']&&console[_0x2297bf(0x102)](a25_0xc223c8[_0x2297bf(0x10a)]('✔\x20'+_0x32895d));else _0x196c0b[_0x2297bf(0xf6)]?(console['log'](a25_0xc223c8[_0x2297bf(0xe0)]('⚠\x20'+_0x32895d+':\x20'+_0x196c0b[_0x2297bf(0x10d)][_0x2297bf(0xff)]+_0x2297bf(0xe5))),console[_0x2297bf(0x102)](formatValidationResult(_0x196c0b,_0x3d9daa,_0x32895d))):(console['log'](a25_0xc223c8[_0x2297bf(0xfe)]('✖\x20'+_0x32895d+':\x20'+_0x196c0b[_0x2297bf(0xf3)]['length']+_0x2297bf(0x103))),console[_0x2297bf(0x102)](formatValidationResult(_0x196c0b,_0x3d9daa,_0x32895d)));}return console['log'](''),_0x11a413['hasErrors']?(console[_0x2297bf(0x102)](a25_0xc223c8[_0x2297bf(0xfe)](_0x2297bf(0xf1)+_0x11a413[_0x2297bf(0x108)]+_0x2297bf(0xf7)+_0x11a413[_0x2297bf(0x10e)]+_0x2297bf(0xfb))),_0x11a413[_0x2297bf(0xec)]>0x0&&console[_0x2297bf(0x102)](a25_0xc223c8[_0x2297bf(0xe0)](_0x11a413['warningCount']+_0x2297bf(0x107))),_0x11a413['skippedCount']>0x0&&console[_0x2297bf(0x102)](a25_0xc223c8[_0x2297bf(0x100)](_0x11a413[_0x2297bf(0xe1)]+_0x2297bf(0x109))),0x1):(console[_0x2297bf(0x102)](a25_0xc223c8['green'](_0x2297bf(0x113)+_0x11a413['validCount']+_0x2297bf(0xe8))),_0x11a413[_0x2297bf(0xec)]>0x0&&console[_0x2297bf(0x102)](a25_0xc223c8['yellow'](_0x11a413[_0x2297bf(0xec)]+_0x2297bf(0x107))),_0x11a413['skippedCount']>0x0&&console[_0x2297bf(0x102)](a25_0xc223c8[_0x2297bf(0x100)](_0x11a413['skippedCount']+_0x2297bf(0x109))),0x0);}}
@@ -1 +1 @@
1
- const a26_0x394b02=a26_0x5eb3;(function(_0x172f18,_0xd7bf34){const _0xb9d374=a26_0x5eb3,_0x44327c=_0x172f18();while(!![]){try{const _0x5dfb5a=parseInt(_0xb9d374(0x10e))/0x1*(parseInt(_0xb9d374(0x13a))/0x2)+parseInt(_0xb9d374(0x10d))/0x3+-parseInt(_0xb9d374(0x148))/0x4*(parseInt(_0xb9d374(0x14f))/0x5)+parseInt(_0xb9d374(0x134))/0x6*(-parseInt(_0xb9d374(0x12f))/0x7)+-parseInt(_0xb9d374(0x133))/0x8+-parseInt(_0xb9d374(0x117))/0x9*(parseInt(_0xb9d374(0x135))/0xa)+-parseInt(_0xb9d374(0x13e))/0xb*(-parseInt(_0xb9d374(0x12b))/0xc);if(_0x5dfb5a===_0xd7bf34)break;else _0x44327c['push'](_0x44327c['shift']());}catch(_0x1d9c45){_0x44327c['push'](_0x44327c['shift']());}}}(a26_0x2487,0x92f31));function a26_0x5eb3(_0x191e31,_0x29bfa2){_0x191e31=_0x191e31-0xfc;const _0x24877c=a26_0x2487();let _0x5eb3d4=_0x24877c[_0x191e31];return _0x5eb3d4;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';function a26_0x2487(){const _0x2fc345=['161NIVRdq','status','Show\x20job\x20details','...','1116224gfDHJR','249654HrgxCG','789130BeyzbL','data','description','show','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','2qtVrmB','start_at','submit','job_id','11reOLAY','d\x20ago','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','Cancelled','list','mo\x20ago','join','url','abs','type','60488kweMnB','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','args','job:kill','site','trino','error','175wkjYuz','Database:\x20','file','query','now','Getting\x20job\x20results...','INVALID_ARGUMENT','\x27\x20to\x20verify\x20the\x20job\x20status','hive','List\x20jobs','✔\x20Retrieved\x20','Get\x20job\x20results','created_at','presto','end_at','Submit\x20a\x20job','round','name','Submitting\x20job...','dim','Listing\x20jobs...','result','Job\x20type:\x20','m\x20ago','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','2605170YSWuSl','810386DESKzH','\x20jobs','jobs','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','debug','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','getTime','\x20\x20Job\x20ID:\x20','81GQUIUu','h\x20ago','substring','push','map','validate','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Submitting\x20kill\x20request...','verbose','user_name','information_schema','floor','limit','No\x20SQL\x20statements\x20found\x20in\x20file','database','log','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','jobType','\x20row','Query:\x20','15109812XsWSno','priority','length','execute'];a26_0x2487=function(){return _0x2fc345;};return a26_0x2487();}import{hyperlink}from'../sdk/util/formatters.js';import a26_0x146252 from'chalk';function formatDuration(_0x20928a){const _0xbda6b5=a26_0x5eb3;if(_0x20928a<0x3c)return _0x20928a+'s';if(_0x20928a<0xe10)return Math['floor'](_0x20928a/0x3c)+'m\x20'+_0x20928a%0x3c+'s';const _0x5dcf1f=Math[_0xbda6b5(0x122)](_0x20928a/0xe10),_0xf2c65=Math[_0xbda6b5(0x122)](_0x20928a%0xe10/0x3c);return _0xf2c65>0x0?_0x5dcf1f+'h\x20'+_0xf2c65+'m':_0x5dcf1f+'h';}function formatRelativeTime(_0x562f5d){const _0x548189=a26_0x5eb3,_0x37d09d=Date[_0x548189(0x153)]()-_0x562f5d[_0x548189(0x115)](),_0x5418c4=Math['floor'](Math[_0x548189(0x146)](_0x37d09d)/0x3e8);if(_0x5418c4<0x3c)return'just\x20now';const _0x2f5e8d=Math[_0x548189(0x122)](_0x5418c4/0x3c);if(_0x2f5e8d<0x3c)return _0x2f5e8d+_0x548189(0x10b);const _0xfc7f87=Math['floor'](_0x2f5e8d/0x3c);if(_0xfc7f87<0x18)return _0xfc7f87+_0x548189(0x118);const _0x2d63fd=Math[_0x548189(0x122)](_0xfc7f87/0x18);if(_0x2d63fd<0x1e)return _0x2d63fd+_0x548189(0x13f);return Math[_0x548189(0x122)](_0x2d63fd/0x1e)+_0x548189(0x143);}export class JobListCommand extends BaseCommand{[a26_0x394b02(0x105)]=a26_0x394b02(0x110);[a26_0x394b02(0x137)]=a26_0x394b02(0xfd);async['execute'](_0x52812a){const _0x4fb657=a26_0x394b02,{options:_0x20fdbb,tdx:_0xf92fad}=_0x52812a,_0x1ec020=resolveLimit(_0x20fdbb[_0x4fb657(0x123)],DEFAULT_DISPLAY_LIMIT),_0x4a5438=_0x20fdbb[_0x4fb657(0x130)];_0x20fdbb[_0x4fb657(0x11f)]&&(console[_0x4fb657(0x14e)]('Limit:\x20'+_0x1ec020+_0x4fb657(0x10f)),_0x4a5438&&console[_0x4fb657(0x14e)]('Status\x20filter:\x20'+_0x4a5438));const _0x332e47=await withSpinner(_0x4fb657(0x108),()=>_0xf92fad[_0x4fb657(0x110)][_0x4fb657(0x142)]({'from':0x0,'to':_0x1ec020-0x1,'status':_0x4a5438}),{'verbose':_0x20fdbb[_0x4fb657(0x11f)]}),_0x4b6391=_0x332e47['data'];console[_0x4fb657(0x14e)]('✔\x20Found\x20'+_0x4b6391[_0x4fb657(0x12d)]+'\x20job'+(_0x4b6391[_0x4fb657(0x12d)]!==0x1?'s':''));const _0x55cf7a=_0x20fdbb[_0x4fb657(0x14c)];if(isStructuredFormat(_0x20fdbb)){const _0x482a23=_0x4b6391[_0x4fb657(0x11b)](_0x20318a=>{const _0x226c55=_0x4fb657;let _0x4a9bde;if(_0x20318a[_0x226c55(0x13b)]&&_0x20318a[_0x226c55(0x102)]){const _0x4d116c=new Date(_0x20318a[_0x226c55(0x13b)])[_0x226c55(0x115)](),_0x9d5292=new Date(_0x20318a[_0x226c55(0x102)])['getTime']();_0x4a9bde=Math[_0x226c55(0x104)]((_0x9d5292-_0x4d116c)/0x3e8);}return{'job_id':_0x20318a['job_id'],'type':_0x20318a[_0x226c55(0x147)]===_0x226c55(0x101)?_0x226c55(0x14d):_0x20318a[_0x226c55(0x147)],'status':_0x20318a[_0x226c55(0x130)],'user_name':_0x20318a[_0x226c55(0x120)],'duration_sec':_0x4a9bde,'created_at':_0x20318a[_0x226c55(0x100)],'started_at':_0x20318a[_0x226c55(0x13b)],'end_at':_0x20318a[_0x226c55(0x102)]};});await handleSDKOutput(_0x482a23,_0x20fdbb);}else for(const _0x5c4104 of _0x4b6391){const _0x113b3d=_0x5c4104['status']==='success'?a26_0x146252['green']:_0x5c4104[_0x4fb657(0x130)]===_0x4fb657(0x14e)?a26_0x146252['red']:a26_0x146252['dim'],_0x2e6e80=_0x113b3d(_0x5c4104['status']),_0x35ad67=getJobUrl(_0x55cf7a,_0x5c4104['job_id']),_0xbc739f=hyperlink(_0x5c4104[_0x4fb657(0x13d)],_0x35ad67),_0x1e0764=a26_0x146252[_0x4fb657(0x107)](_0x5c4104[_0x4fb657(0x147)]===_0x4fb657(0x101)?_0x4fb657(0x14d):_0x5c4104[_0x4fb657(0x147)]),_0x2d1296=[];if(_0x5c4104[_0x4fb657(0x13b)]&&_0x5c4104[_0x4fb657(0x102)]){const _0x3f68b2=Math['round']((new Date(_0x5c4104[_0x4fb657(0x102)])[_0x4fb657(0x115)]()-new Date(_0x5c4104[_0x4fb657(0x13b)])[_0x4fb657(0x115)]())/0x3e8);_0x2d1296['push'](formatDuration(_0x3f68b2));}if(_0x5c4104['end_at'])_0x2d1296[_0x4fb657(0x11a)](formatRelativeTime(new Date(_0x5c4104[_0x4fb657(0x102)])));else _0x5c4104['start_at']&&_0x2d1296[_0x4fb657(0x11a)](formatRelativeTime(new Date(_0x5c4104[_0x4fb657(0x13b)])));const _0x5aefbf=_0x2d1296['length']>0x0?a26_0x146252[_0x4fb657(0x107)]('\x20'+_0x2d1296[_0x4fb657(0x144)](',\x20')):'';console[_0x4fb657(0x126)]('⚡\x20'+_0xbc739f+'\x20'+_0x1e0764+'\x20'+_0x2e6e80+_0x5aefbf);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0x394b02(0x105)]='job:show';['description']=a26_0x394b02(0x131);['validate'](_0x1f305c){const _0x50c7b6=a26_0x394b02,_0x54a71f=_0x1f305c['args'][0x0];if(!_0x54a71f)return _0x50c7b6(0x111);return undefined;}async[a26_0x394b02(0x12e)](_0x4de1fc){const _0x1f5ac0=a26_0x394b02,{options:_0x31976b,args:_0x588d80,tdx:_0x2edd09}=_0x4de1fc,_0x95aa84=_0x588d80[0x0],_0x1b74ce=await withSpinner('Getting\x20job\x20details...',()=>_0x2edd09[_0x1f5ac0(0x110)][_0x1f5ac0(0x138)](_0x95aa84),{'verbose':_0x31976b['verbose']}),_0x45a27e=_0x1b74ce[_0x1f5ac0(0x136)];let _0x1c477a;if(_0x45a27e[_0x1f5ac0(0x13b)]&&_0x45a27e[_0x1f5ac0(0x102)]){const _0x3084ad=new Date(_0x45a27e['start_at'])[_0x1f5ac0(0x115)](),_0x41a997=new Date(_0x45a27e[_0x1f5ac0(0x102)])['getTime']();_0x1c477a=Math[_0x1f5ac0(0x104)]((_0x41a997-_0x3084ad)/0x3e8);}const _0x58b032={'job_id':_0x45a27e['job_id'],'type':_0x45a27e['type'],'status':_0x45a27e[_0x1f5ac0(0x130)],..._0x45a27e[_0x1f5ac0(0x120)]&&{'user_name':_0x45a27e[_0x1f5ac0(0x120)]},..._0x1c477a!==undefined&&{'duration_sec':_0x1c477a},..._0x45a27e['created_at']&&{'created_at':_0x45a27e[_0x1f5ac0(0x100)]},..._0x45a27e[_0x1f5ac0(0x13b)]&&{'started_at':_0x45a27e['start_at']},..._0x45a27e[_0x1f5ac0(0x102)]&&{'end_at':_0x45a27e[_0x1f5ac0(0x102)]},..._0x45a27e[_0x1f5ac0(0x125)]&&{'database':_0x45a27e[_0x1f5ac0(0x125)]},..._0x45a27e['priority']!==undefined&&{'priority':_0x45a27e[_0x1f5ac0(0x12c)]},..._0x45a27e['url']&&{'url':_0x45a27e[_0x1f5ac0(0x145)]},..._0x45a27e[_0x1f5ac0(0x152)]&&{'query':_0x45a27e[_0x1f5ac0(0x152)]},..._0x45a27e['debug']&&{'debug':_0x45a27e[_0x1f5ac0(0x112)]}};return await handleSingleObjectOutput(_0x58b032,_0x31976b),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0x394b02(0x105)]=a26_0x394b02(0x14b);[a26_0x394b02(0x137)]='Kill\x20a\x20job';[a26_0x394b02(0x11c)](_0xcdeb5f){const _0x154e83=a26_0x394b02,_0x2c4be1=_0xcdeb5f[_0x154e83(0x14a)][0x0];if(!_0x2c4be1)return _0x154e83(0x140);return undefined;}async['execute'](_0x140e16){const _0xf86ed9=a26_0x394b02,{options:_0x53d5c1,args:_0x53f55d,tdx:_0x51b379}=_0x140e16,_0x57bb95=_0x53f55d[0x0];if(!_0x53d5c1['yes']){const _0x3192c8=await confirm(_0xf86ed9(0x11d)+_0x57bb95+'?');if(!_0x3192c8)return console[_0xf86ed9(0x14e)](_0xf86ed9(0x141)),0x0;}return await withSpinner(_0xf86ed9(0x11e),()=>_0x51b379[_0xf86ed9(0x110)]['kill'](_0x57bb95),{'verbose':_0x53d5c1[_0xf86ed9(0x11f)]}),console[_0xf86ed9(0x14e)](_0xf86ed9(0x10c)+_0x57bb95),console['error'](_0xf86ed9(0x139)+_0x57bb95+_0xf86ed9(0x156)),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']='job:submit';[a26_0x394b02(0x137)]=a26_0x394b02(0x103);async['execute'](_0x183a54){const _0xff1e9e=a26_0x394b02,{options:_0x250cd,args:_0x21bcb9,tdx:_0x5e1b50}=_0x183a54,_0x488d85=_0x250cd[_0xff1e9e(0x128)]||'trino',_0x2c1703=_0x250cd[_0xff1e9e(0x151)],_0x3f8f0b=_0x250cd[_0xff1e9e(0x125)]||_0xff1e9e(0x121),_0x323d9d=_0x250cd[_0xff1e9e(0x109)];if(_0x488d85!==_0xff1e9e(0x14d)&&_0x488d85!==_0xff1e9e(0xfc))throw new SDKError(ErrorCode[_0xff1e9e(0x155)],_0xff1e9e(0x114));let _0x13db36;if(_0x2c1703){if(_0x21bcb9[0x0])throw new SDKError(ErrorCode[_0xff1e9e(0x155)],'Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option');const _0x3151db=readSqlStatementsFromFile(_0x2c1703);if(_0x3151db[_0xff1e9e(0x12d)]===0x0)throw new SDKError(ErrorCode[_0xff1e9e(0x155)],_0xff1e9e(0x124));if(_0x3151db[_0xff1e9e(0x12d)]>0x1)throw new SDKError(ErrorCode[_0xff1e9e(0x155)],_0xff1e9e(0x149));_0x13db36=_0x3151db[0x0];}else{if(!_0x21bcb9[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xff1e9e(0x127));_0x13db36=_0x21bcb9[0x0];}_0x250cd[_0xff1e9e(0x11f)]&&(console['error'](_0xff1e9e(0x10a)+_0x488d85),console[_0xff1e9e(0x14e)](_0xff1e9e(0x150)+_0x3f8f0b),console[_0xff1e9e(0x14e)](_0xff1e9e(0x12a)+_0x13db36[_0xff1e9e(0x119)](0x0,0x64)+(_0x13db36[_0xff1e9e(0x12d)]>0x64?_0xff1e9e(0x132):'')));const _0xcdb0d6=await withSpinner(_0xff1e9e(0x106),()=>_0x5e1b50[_0xff1e9e(0x110)][_0xff1e9e(0x13c)](_0x3f8f0b,_0x13db36,_0x488d85,_0x323d9d),{'verbose':_0x250cd[_0xff1e9e(0x11f)]}),_0x4beba9=_0xcdb0d6[_0xff1e9e(0x136)];return console[_0xff1e9e(0x14e)]('✔\x20Job\x20submitted'),console[_0xff1e9e(0x14e)](_0xff1e9e(0x116)+_0x4beba9[_0xff1e9e(0x13d)]),await handleSDKOutput([_0x4beba9],_0x250cd),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0x394b02(0x105)]='job:result';[a26_0x394b02(0x137)]=a26_0x394b02(0xff);[a26_0x394b02(0x11c)](_0x4381f6){const _0x5bb9aa=a26_0x394b02,_0x171949=_0x4381f6[_0x5bb9aa(0x14a)][0x0];if(!_0x171949)return _0x5bb9aa(0x113);return undefined;}async[a26_0x394b02(0x12e)](_0x5ed690){const _0x2a0617=a26_0x394b02,{options:_0x40a5f2,args:_0x501b0c,tdx:_0x596bdf}=_0x5ed690,_0x2fa875=_0x501b0c[0x0],_0x466b63=await withSpinner(_0x2a0617(0x154),()=>_0x596bdf['jobs']['result'](_0x2fa875),{'verbose':_0x40a5f2[_0x2a0617(0x11f)]}),_0x4634e4=_0x466b63[_0x2a0617(0x136)];return console[_0x2a0617(0x14e)](_0x2a0617(0xfe)+_0x4634e4[_0x2a0617(0x12d)]+_0x2a0617(0x129)+(_0x4634e4[_0x2a0617(0x12d)]!==0x1?'s':'')),await handleSDKOutput(_0x4634e4,_0x40a5f2),0x0;}}
1
+ const a26_0xbf4631=a26_0x161d;(function(_0x6069e4,_0x512e7d){const _0x48ef06=a26_0x161d,_0x5ab66e=_0x6069e4();while(!![]){try{const _0x40fec4=parseInt(_0x48ef06(0x18e))/0x1+parseInt(_0x48ef06(0x1a0))/0x2*(parseInt(_0x48ef06(0x1c3))/0x3)+parseInt(_0x48ef06(0x1b5))/0x4*(-parseInt(_0x48ef06(0x1a3))/0x5)+-parseInt(_0x48ef06(0x18f))/0x6*(-parseInt(_0x48ef06(0x1d2))/0x7)+-parseInt(_0x48ef06(0x1c0))/0x8*(-parseInt(_0x48ef06(0x1a9))/0x9)+-parseInt(_0x48ef06(0x180))/0xa*(parseInt(_0x48ef06(0x1b2))/0xb)+-parseInt(_0x48ef06(0x196))/0xc*(parseInt(_0x48ef06(0x19e))/0xd);if(_0x40fec4===_0x512e7d)break;else _0x5ab66e['push'](_0x5ab66e['shift']());}catch(_0x377fbe){_0x5ab66e['push'](_0x5ab66e['shift']());}}}(a26_0x3253,0xd6802));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';function a26_0x3253(){const _0x115919=['Show\x20job\x20details','url','kill','Getting\x20job\x20details...','user_name','List\x20jobs','execute','hive','11lkdbLS','error','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','4xetUHH','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','jobType','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','trino','type','Database:\x20','database','just\x20now','Getting\x20job\x20results...','yes','32ZSXaMq','\x27\x20to\x20verify\x20the\x20job\x20status','floor','3014733lAHRnJ','file','Listing\x20jobs...','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','now','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','map','No\x20SQL\x20statements\x20found\x20in\x20file','log','args','verbose','created_at','Cancelled','site','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','8308839vSBMPB','result','\x20row','end_at','getTime','✔\x20Job\x20submitted','query','Query:\x20','Submitting\x20job...','data','job_id','Kill\x20a\x20job','length','push','priority','h\x20ago','6244510gjQzte','Status\x20filter:\x20','\x20jobs','mo\x20ago','...','jobs','Submit\x20a\x20job','submit','name','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','INVALID_ARGUMENT','show','start_at','round','775185PwkwAM','6xVUJaD','abs','\x20job','job:submit','✔\x20Found\x20','debug','status','22745748jKIJUN','Submitting\x20kill\x20request...','presto','Job\x20type:\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','red','description','join','13HmlkOF','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','2lTEQmw','job:result','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','1779185mbUUdk','substring','validate','Limit:\x20','dim','limit','1771398zwcGOd'];a26_0x3253=function(){return _0x115919;};return a26_0x3253();}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_0x161d(_0x46234b,_0x3c43ad){_0x46234b=_0x46234b-0x179;const _0x325318=a26_0x3253();let _0x161ddb=_0x325318[_0x46234b];return _0x161ddb;}import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a26_0x46d3ab from'chalk';function formatDuration(_0x1926f7){const _0x4e8c73=a26_0x161d;if(_0x1926f7<0x3c)return _0x1926f7+'s';if(_0x1926f7<0xe10)return Math['floor'](_0x1926f7/0x3c)+'m\x20'+_0x1926f7%0x3c+'s';const _0x3e4697=Math[_0x4e8c73(0x1c2)](_0x1926f7/0xe10),_0x7ba71a=Math[_0x4e8c73(0x1c2)](_0x1926f7%0xe10/0x3c);return _0x7ba71a>0x0?_0x3e4697+'h\x20'+_0x7ba71a+'m':_0x3e4697+'h';}function formatRelativeTime(_0xd6a20d){const _0xf54111=a26_0x161d,_0x3033b7=Date[_0xf54111(0x1c7)]()-_0xd6a20d[_0xf54111(0x1d6)](),_0x37d489=Math['floor'](Math[_0xf54111(0x190)](_0x3033b7)/0x3e8);if(_0x37d489<0x3c)return _0xf54111(0x1bd);const _0x28fa24=Math[_0xf54111(0x1c2)](_0x37d489/0x3c);if(_0x28fa24<0x3c)return _0x28fa24+'m\x20ago';const _0x705900=Math[_0xf54111(0x1c2)](_0x28fa24/0x3c);if(_0x705900<0x18)return _0x705900+_0xf54111(0x17f);const _0x375aae=Math[_0xf54111(0x1c2)](_0x705900/0x18);if(_0x375aae<0x1e)return _0x375aae+'d\x20ago';return Math[_0xf54111(0x1c2)](_0x375aae/0x1e)+_0xf54111(0x183);}export class JobListCommand extends BaseCommand{[a26_0xbf4631(0x188)]='jobs';[a26_0xbf4631(0x19c)]=a26_0xbf4631(0x1af);async[a26_0xbf4631(0x1b0)](_0x5241ff){const _0x4a45d1=a26_0xbf4631,{options:_0x10aa16,tdx:_0x4ff72e}=_0x5241ff,_0x4ef32d=resolveLimit(_0x10aa16[_0x4a45d1(0x1a8)],DEFAULT_DISPLAY_LIMIT),_0x148e17=_0x10aa16[_0x4a45d1(0x195)];_0x10aa16['verbose']&&(console['error'](_0x4a45d1(0x1a6)+_0x4ef32d+_0x4a45d1(0x182)),_0x148e17&&console[_0x4a45d1(0x1b3)](_0x4a45d1(0x181)+_0x148e17));const _0x2842d2=await withSpinner(_0x4a45d1(0x1c5),()=>_0x4ff72e[_0x4a45d1(0x185)]['list']({'from':0x0,'to':_0x4ef32d-0x1,'status':_0x148e17}),{'verbose':_0x10aa16[_0x4a45d1(0x1cd)]}),_0x559055=_0x2842d2['data'];console[_0x4a45d1(0x1b3)](_0x4a45d1(0x193)+_0x559055[_0x4a45d1(0x17c)]+_0x4a45d1(0x191)+(_0x559055[_0x4a45d1(0x17c)]!==0x1?'s':''));const _0x2d5537=_0x10aa16[_0x4a45d1(0x1d0)];if(isStructuredFormat(_0x10aa16)){const _0x5ce3ad=_0x559055[_0x4a45d1(0x1c9)](_0x27c946=>{const _0x456363=_0x4a45d1;let _0x49f25f;if(_0x27c946[_0x456363(0x18c)]&&_0x27c946[_0x456363(0x1d5)]){const _0x4ab9c1=new Date(_0x27c946['start_at'])[_0x456363(0x1d6)](),_0x1dc06f=new Date(_0x27c946[_0x456363(0x1d5)])['getTime']();_0x49f25f=Math[_0x456363(0x18d)]((_0x1dc06f-_0x4ab9c1)/0x3e8);}return{'job_id':_0x27c946[_0x456363(0x17a)],'type':_0x27c946[_0x456363(0x1ba)]===_0x456363(0x198)?_0x456363(0x1b9):_0x27c946['type'],'status':_0x27c946['status'],'user_name':_0x27c946[_0x456363(0x1ae)],'duration_sec':_0x49f25f,'created_at':_0x27c946['created_at'],'started_at':_0x27c946[_0x456363(0x18c)],'end_at':_0x27c946[_0x456363(0x1d5)]};});await handleSDKOutput(_0x5ce3ad,_0x10aa16);}else for(const _0x1da066 of _0x559055){const _0x20ddfd=_0x1da066[_0x4a45d1(0x195)]==='success'?a26_0x46d3ab['green']:_0x1da066[_0x4a45d1(0x195)]==='error'?a26_0x46d3ab[_0x4a45d1(0x19b)]:a26_0x46d3ab['dim'],_0x1bcd7b=_0x20ddfd(_0x1da066[_0x4a45d1(0x195)]),_0x3e363b=getJobUrl(_0x2d5537,_0x1da066[_0x4a45d1(0x17a)]),_0x44d179=hyperlink(_0x1da066[_0x4a45d1(0x17a)],_0x3e363b),_0x4632f4=a26_0x46d3ab[_0x4a45d1(0x1a7)](_0x1da066[_0x4a45d1(0x1ba)]===_0x4a45d1(0x198)?_0x4a45d1(0x1b9):_0x1da066['type']),_0x41809f=[];if(_0x1da066[_0x4a45d1(0x18c)]&&_0x1da066[_0x4a45d1(0x1d5)]){const _0x629820=Math[_0x4a45d1(0x18d)]((new Date(_0x1da066[_0x4a45d1(0x1d5)])[_0x4a45d1(0x1d6)]()-new Date(_0x1da066[_0x4a45d1(0x18c)])[_0x4a45d1(0x1d6)]())/0x3e8);_0x41809f[_0x4a45d1(0x17d)](formatDuration(_0x629820));}if(_0x1da066[_0x4a45d1(0x1d5)])_0x41809f[_0x4a45d1(0x17d)](formatRelativeTime(new Date(_0x1da066[_0x4a45d1(0x1d5)])));else _0x1da066[_0x4a45d1(0x18c)]&&_0x41809f[_0x4a45d1(0x17d)](formatRelativeTime(new Date(_0x1da066[_0x4a45d1(0x18c)])));const _0xa19224=_0x41809f[_0x4a45d1(0x17c)]>0x0?a26_0x46d3ab[_0x4a45d1(0x1a7)]('\x20'+_0x41809f[_0x4a45d1(0x19d)](',\x20')):'';console[_0x4a45d1(0x1cb)]('⚡\x20'+_0x44d179+'\x20'+_0x4632f4+'\x20'+_0x1bcd7b+_0xa19224);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a26_0xbf4631(0x188)]='job:show';['description']=a26_0xbf4631(0x1aa);[a26_0xbf4631(0x1a5)](_0x4a1a5c){const _0x3e2ad2=a26_0xbf4631,_0xad1900=_0x4a1a5c[_0x3e2ad2(0x1cc)][0x0];if(!_0xad1900)return _0x3e2ad2(0x19a);return undefined;}async[a26_0xbf4631(0x1b0)](_0x1f8db2){const _0x31fc3f=a26_0xbf4631,{options:_0x2835d8,args:_0x5e59b6,tdx:_0x253b98}=_0x1f8db2,_0x4aea2a=_0x5e59b6[0x0],_0x56dbf0=await withSpinner(_0x31fc3f(0x1ad),()=>_0x253b98[_0x31fc3f(0x185)][_0x31fc3f(0x18b)](_0x4aea2a),{'verbose':_0x2835d8[_0x31fc3f(0x1cd)]}),_0x238d53=_0x56dbf0[_0x31fc3f(0x179)];let _0x233a64;if(_0x238d53[_0x31fc3f(0x18c)]&&_0x238d53[_0x31fc3f(0x1d5)]){const _0x46082d=new Date(_0x238d53[_0x31fc3f(0x18c)])[_0x31fc3f(0x1d6)](),_0x5370d7=new Date(_0x238d53[_0x31fc3f(0x1d5)])[_0x31fc3f(0x1d6)]();_0x233a64=Math[_0x31fc3f(0x18d)]((_0x5370d7-_0x46082d)/0x3e8);}const _0xa8447a={'job_id':_0x238d53[_0x31fc3f(0x17a)],'type':_0x238d53['type'],'status':_0x238d53['status'],..._0x238d53[_0x31fc3f(0x1ae)]&&{'user_name':_0x238d53[_0x31fc3f(0x1ae)]},..._0x233a64!==undefined&&{'duration_sec':_0x233a64},..._0x238d53[_0x31fc3f(0x1ce)]&&{'created_at':_0x238d53['created_at']},..._0x238d53[_0x31fc3f(0x18c)]&&{'started_at':_0x238d53[_0x31fc3f(0x18c)]},..._0x238d53[_0x31fc3f(0x1d5)]&&{'end_at':_0x238d53[_0x31fc3f(0x1d5)]},..._0x238d53[_0x31fc3f(0x1bc)]&&{'database':_0x238d53[_0x31fc3f(0x1bc)]},..._0x238d53[_0x31fc3f(0x17e)]!==undefined&&{'priority':_0x238d53[_0x31fc3f(0x17e)]},..._0x238d53[_0x31fc3f(0x1ab)]&&{'url':_0x238d53['url']},..._0x238d53['query']&&{'query':_0x238d53[_0x31fc3f(0x1d8)]},..._0x238d53[_0x31fc3f(0x194)]&&{'debug':_0x238d53['debug']}};return await handleSingleObjectOutput(_0xa8447a,_0x2835d8),0x0;}}export class JobKillCommand extends BaseCommand{[a26_0xbf4631(0x188)]='job:kill';[a26_0xbf4631(0x19c)]=a26_0xbf4631(0x17b);[a26_0xbf4631(0x1a5)](_0x4fbda8){const _0x315b9a=a26_0xbf4631,_0x19f719=_0x4fbda8[_0x315b9a(0x1cc)][0x0];if(!_0x19f719)return _0x315b9a(0x1d1);return undefined;}async[a26_0xbf4631(0x1b0)](_0x4c18aa){const _0x2eb680=a26_0xbf4631,{options:_0x47dcff,args:_0xe61619,tdx:_0x2d608f}=_0x4c18aa,_0x4567eb=_0xe61619[0x0];if(!_0x47dcff[_0x2eb680(0x1bf)]){const _0x2bee90=await confirm(_0x2eb680(0x189)+_0x4567eb+'?');if(!_0x2bee90)return console['error'](_0x2eb680(0x1cf)),0x0;}return await withSpinner(_0x2eb680(0x197),()=>_0x2d608f['jobs'][_0x2eb680(0x1ac)](_0x4567eb),{'verbose':_0x47dcff[_0x2eb680(0x1cd)]}),console['error'](_0x2eb680(0x1b4)+_0x4567eb),console[_0x2eb680(0x1b3)](_0x2eb680(0x19f)+_0x4567eb+_0x2eb680(0x1c1)),0x0;}}export class JobSubmitCommand extends BaseCommand{['name']=a26_0xbf4631(0x192);['description']=a26_0xbf4631(0x186);async[a26_0xbf4631(0x1b0)](_0x385d2c){const _0x47f361=a26_0xbf4631,{options:_0xf7b5c8,args:_0x58a7fa,tdx:_0x48ddb4}=_0x385d2c,_0x40eb4c=_0xf7b5c8[_0x47f361(0x1b7)]||_0x47f361(0x1b9),_0x5c6d1b=_0xf7b5c8[_0x47f361(0x1c4)],_0x439cd0=_0xf7b5c8[_0x47f361(0x1bc)]||'information_schema',_0x2c9214=_0xf7b5c8[_0x47f361(0x1d3)];if(_0x40eb4c!==_0x47f361(0x1b9)&&_0x40eb4c!==_0x47f361(0x1b1))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x47f361(0x1c6));let _0x3ee933;if(_0x5c6d1b){if(_0x58a7fa[0x0])throw new SDKError(ErrorCode[_0x47f361(0x18a)],_0x47f361(0x1a2));const _0x29dd93=readSqlStatementsFromFile(_0x5c6d1b);if(_0x29dd93['length']===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x47f361(0x1ca));if(_0x29dd93['length']>0x1)throw new SDKError(ErrorCode[_0x47f361(0x18a)],_0x47f361(0x1b8));_0x3ee933=_0x29dd93[0x0];}else{if(!_0x58a7fa[0x0])throw new SDKError(ErrorCode[_0x47f361(0x18a)],_0x47f361(0x1b6));_0x3ee933=_0x58a7fa[0x0];}_0xf7b5c8[_0x47f361(0x1cd)]&&(console[_0x47f361(0x1b3)](_0x47f361(0x199)+_0x40eb4c),console[_0x47f361(0x1b3)](_0x47f361(0x1bb)+_0x439cd0),console[_0x47f361(0x1b3)](_0x47f361(0x1d9)+_0x3ee933[_0x47f361(0x1a4)](0x0,0x64)+(_0x3ee933[_0x47f361(0x17c)]>0x64?_0x47f361(0x184):'')));const _0xc71531=await withSpinner(_0x47f361(0x1da),()=>_0x48ddb4[_0x47f361(0x185)][_0x47f361(0x187)](_0x439cd0,_0x3ee933,_0x40eb4c,_0x2c9214),{'verbose':_0xf7b5c8[_0x47f361(0x1cd)]}),_0x4c1807=_0xc71531[_0x47f361(0x179)];return console[_0x47f361(0x1b3)](_0x47f361(0x1d7)),console[_0x47f361(0x1b3)]('\x20\x20Job\x20ID:\x20'+_0x4c1807[_0x47f361(0x17a)]),await handleSDKOutput([_0x4c1807],_0xf7b5c8),0x0;}}export class JobResultCommand extends BaseCommand{[a26_0xbf4631(0x188)]=a26_0xbf4631(0x1a1);['description']='Get\x20job\x20results';['validate'](_0x2554a0){const _0x4c7db5=a26_0xbf4631,_0x272bf8=_0x2554a0['args'][0x0];if(!_0x272bf8)return _0x4c7db5(0x1c8);return undefined;}async['execute'](_0x13d587){const _0x37b97f=a26_0xbf4631,{options:_0x538f33,args:_0x1a6ca6,tdx:_0x43ce14}=_0x13d587,_0x3ec72c=_0x1a6ca6[0x0],_0x37cf02=await withSpinner(_0x37b97f(0x1be),()=>_0x43ce14[_0x37b97f(0x185)][_0x37b97f(0x1d3)](_0x3ec72c),{'verbose':_0x538f33[_0x37b97f(0x1cd)]}),_0x4a7b22=_0x37cf02[_0x37b97f(0x179)];return console[_0x37b97f(0x1b3)]('✔\x20Retrieved\x20'+_0x4a7b22['length']+_0x37b97f(0x1d4)+(_0x4a7b22[_0x37b97f(0x17c)]!==0x1?'s':'')),await handleSDKOutput(_0x4a7b22,_0x538f33),0x0;}}
@@ -1 +1 @@
1
- const a27_0x389c24=a27_0x237f;(function(_0x4611af,_0x4f5848){const _0x2b9905=a27_0x237f,_0x5292fb=_0x4611af();while(!![]){try{const _0x13a39d=-parseInt(_0x2b9905(0x16d))/0x1+parseInt(_0x2b9905(0x192))/0x2+parseInt(_0x2b9905(0x1d2))/0x3+parseInt(_0x2b9905(0x1fd))/0x4+parseInt(_0x2b9905(0x13e))/0x5+-parseInt(_0x2b9905(0x1d6))/0x6+parseInt(_0x2b9905(0x1e4))/0x7*(parseInt(_0x2b9905(0x1ed))/0x8);if(_0x13a39d===_0x4f5848)break;else _0x5292fb['push'](_0x5292fb['shift']());}catch(_0xc2b17e){_0x5292fb['push'](_0x5292fb['shift']());}}}(a27_0x1b4f,0x6943d));import a27_0x25db00 from'chalk';import a27_0x2f4303 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';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(_0x2652d4){const _0x1ac0d7=a27_0x237f;return!_0x2652d4&&(console[_0x1ac0d7(0x212)](_0x1ac0d7(0x227)),console[_0x1ac0d7(0x212)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x2652d4;}function withJsonFormat(_0x4ebf8d){const _0x2bda52=a27_0x237f;if(!_0x4ebf8d[_0x2bda52(0x194)]&&!_0x4ebf8d[_0x2bda52(0x1b1)]&&!_0x4ebf8d[_0x2bda52(0x210)]&&!_0x4ebf8d['tsv'])return{..._0x4ebf8d,'format':_0x2bda52(0x1b1),'json':!![]};return _0x4ebf8d;}function a27_0x237f(_0xe6d776,_0x538d3e){_0xe6d776=_0xe6d776-0x12c;const _0x1b4f54=a27_0x1b4f();let _0x237f56=_0x1b4f54[_0xe6d776];return _0x237f56;}function formatJourneyState(_0x22e721){const _0x13d1eb=a27_0x237f;switch(_0x22e721){case _0x13d1eb(0x1c0):return a27_0x25db00[_0x13d1eb(0x1e8)]('(running)');case _0x13d1eb(0x1c7):return a27_0x25db00[_0x13d1eb(0x18f)](_0x13d1eb(0x170));case _0x13d1eb(0x15b):return a27_0x25db00[_0x13d1eb(0x1b4)](_0x13d1eb(0x232));case _0x13d1eb(0x205):return a27_0x25db00[_0x13d1eb(0x23a)](_0x13d1eb(0x156));case _0x13d1eb(0x166):return a27_0x25db00[_0x13d1eb(0x18f)](_0x13d1eb(0x12f));default:return'('+_0x22e721+')';}}function formatJourneyItem(_0x213766,_0x2c3da6='',_0x4de315){const _0x1c0cc0=a27_0x237f,_0x146760=formatJourneyState(_0x213766[_0x1c0cc0(0x183)]),_0x86db93=_0x4de315?hyperlink(_0x213766[_0x1c0cc0(0x16c)],_0x4de315):_0x213766[_0x1c0cc0(0x16c)];return _0x2c3da6+_0x1c0cc0(0x229)+_0x86db93+'\x20'+_0x146760;}function a27_0x1b4f(){const _0xa039c4=['568ojEYqo','\x20\x20-\x20','activation','✔\x20Journey\x20\x22','Error:\x20--version\x20option\x20is\x20required','name','Getting\x20version\x20','has','activationParams','diff','listVersions','exitOrJumpRate','Listing\x20journey\x20activations...','kind','Resolving\x20version...','audienceId','443604KffMAQ','values','segment','get','goal','\x22\x20paused','verbose','Resolving\x20parent\x20segment...','completed','helpText','getJourney','Found\x20',',\x20version:\x20','No\x20journeys\x20found','Fetching\x20parent\x20segment...','file','stages','split','push','jsonl','parent_segment','error','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x5c$&','segmentName','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','completionRate','stringify','List\x20activations\x20for\x20a\x20journey','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','journeyName','\x20journey','List\x20all\x20versions\x20of\x20a\x20journey','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','\x20details...','journey:resume','attributes','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','site','pause','database','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','includeHistory','🗺️\x20','journeyBundleId','options','version','journey:list','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','history','createdAt','connector_config','(paused)','Options:','all','Table:\x20','cwd','Error:\x20Invalid\x20version\x20number:\x20','resourceName','View\x20a\x20specific\x20version\x20of\x20a\x20journey','blue','relative','\x20(rule\x20match)','Resume\x20a\x20paused\x20journey','(archived)','yes','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','/j/da/je','stage','journeys','Input:\x20','map','\x0aPull\x20summary:','content','📁\x20','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','filter','(root)','resolveJourneyId','3412345jIvfHV','Fetching\x20','Show\x20journey\x20table\x20column\x20mapping','segmentPushCommand','getParentFull','INVALID_ARGUMENT','limit','repeat','then','\x22\x20not\x20found','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x22\x20resumed','\x0aError:','Parent\x20segment:\x20','listJourneysFromParentSegment','✔\x20Found\x20','Warning:\x20Could\x20not\x20resolve\x20activation\x20','versionNumber','\x20(ID:\x20','List\x20journeys\x20in\x20current\x20context','type','size','journey:view','Error:\x20Journey\x20\x27','(completed)','\x20version','Creating\x20new\x20version...','length','Getting\x20journey\x20traffic\x20data...','paused','\x20\x20Parent\x20segment:\x20','from','Getting\x20journey\x20statistics...','red','args','Fetching\x20journeys\x20and\x20folders...','Error:\x20Version\x20','\x20unchanged\x20files','folders','\x20->\x20','archived','Pattern:\x20','toLowerCase','✔\x20Context\x20set:\x20','updatedAt','\x20journeys','journeyBundleName','737630lHatCN','data','Listing\x20journeys...','(draft)','journeyId','execute','errorCode','log','/app/ps/','activation_','\x20\x20Folder\x20path:\x20','test','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Show\x20journey\x20details','journeyStages','journey:version:view','Show\x20journey\x20statistics','nodes','buildIdToEmailMap','journey','getLatestJourneyId','description','state','Export\x20journey(s)\x20as\x20YAML\x20files','stageNameMap','utf-8','conversion','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','parentSegment','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','targetDir','journey:push','Fetching\x20users\x20and\x20connections...','dim','resume','segments','32758PPPTtB','session','format','milestoneSize','message','entries','-\x20no\x20files\x20written','\x20files?','Write\x20','Getting\x20journey\x20details...','\x20\x20Statistics\x20not\x20available','journey:version:create','base','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','\x20\x20Consolidating\x20duplicate\x20segment:\x20','\x0aChanges\x20to\x20\x27','createVersion','set','links','\x20\x20Name:\x20','\x20changed\x20files','\x20not\x20found.\x20Available:\x20','add','Journey\x20name:\x20','.yml','relativePath','root\x20folder','Getting\x20column\x20mapping...','Error:\x20','getStatistics','Resolving\x20journey...','json','Pausing\x20journey...','/j/da','yellow','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20Journey\x20ID:\x20','Cancelled','hasPeriod','\x20journey\x20files\x20to\x20','filePath','hasChanges','\x20\x20Preserving\x20local\x20segment\x20name:\x20','\x20(draft)\x20—\x20\x22','Available\x20stages:\x20','folderId','launched','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','rule','isNew','connection','Error:\x20Parent\x20segment\x20context\x20required','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','draft','No\x20statistics\x20available\x20for\x20journey:\x20','localeCompare','table','Error:\x20Journey\x20not\x20found:\x20','listActivationsFlat','getColumnMapping','cyan','dryRun','setPhase','find','2454723PtVDja','Error:\x20Invalid\x20--type\x20\x22','listJourneysWithFolders','\x27\x20not\x20found\x20in\x20','2792232zCXCOd','absolutePath','getTrafficData','resolveParentId','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','rootFolderId','folderPath','bold','✔\x20Pulled\x20','reentryMode','getActivation','join','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','\x20activation','609QwucwK','sort','/e/','exitOrJumpSize','green','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','Pause\x20a\x20running\x20journey','Database:\x20','renderStats'];a27_0x1b4f=function(){return _0xa039c4;};return a27_0x1b4f();}function escapeRegex(_0x54721c){const _0x1fee39=a27_0x237f;return _0x54721c['replace'](/[.*+?^${}()|[\]\\]/g,_0x1fee39(0x214));}function globToRegex(_0x47492e){const _0x15a12f=a27_0x237f,_0x3b4363=_0x47492e[_0x15a12f(0x20e)]('*')[_0x15a12f(0x136)](escapeRegex);return new RegExp(_0x3b4363[_0x15a12f(0x1e1)]('.*'),'i');}function buildRuleToNameMapping(_0x42460d){const _0x3d75ef=a27_0x237f,_0x50578a=new Map();if(_0x42460d[_0x3d75ef(0x191)])for(const [_0x8e0736,_0x31b2a1]of Object[_0x3d75ef(0x197)](_0x42460d['segments'])){if(_0x31b2a1[_0x3d75ef(0x1c2)]){const _0x9a5f2c=serializeRule(_0x31b2a1[_0x3d75ef(0x1c2)]),_0x4062fb=_0x50578a[_0x3d75ef(0x200)](_0x9a5f2c);_0x4062fb?_0x4062fb[_0x3d75ef(0x20f)](_0x8e0736):_0x50578a[_0x3d75ef(0x1a3)](_0x9a5f2c,[_0x8e0736]);}}return _0x50578a;}async function resolveJourneyIdFromInput(_0x3df4f8,_0x5bc7ac,_0x33811d){const _0xa7eedb=a27_0x237f,_0x42c4ac=await resolveJourneyTarget(_0x3df4f8,_0x5bc7ac[_0xa7eedb(0x189)],_0x5bc7ac[_0xa7eedb(0x203)]),_0x4eec44=_0x42c4ac[_0xa7eedb(0x189)];if(!_0x4eec44)throw new SDKError(ErrorCode[_0xa7eedb(0x143)],_0xa7eedb(0x213));const _0x761335=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x33811d[_0xa7eedb(0x1ff)][_0xa7eedb(0x1d9)](_0x4eec44),{'verbose':_0x5bc7ac[_0xa7eedb(0x203)]}),_0x189ae1=_0x761335['data'],_0x166e34=await withSpinner(_0xa7eedb(0x1b0),()=>_0x33811d[_0xa7eedb(0x180)][_0xa7eedb(0x13d)](_0x189ae1,_0x42c4ac[_0xa7eedb(0x21b)]),{'verbose':_0x5bc7ac[_0xa7eedb(0x203)]});return{'journeyId':_0x166e34[_0xa7eedb(0x16e)],'journeyName':_0x42c4ac[_0xa7eedb(0x21b)],'parentSegmentId':_0x189ae1};}async function resolveJourneyTarget(_0x304205,_0x1e7b8d,_0x1f7153){const _0x28c983=a27_0x237f;if(isYamlFilePath(_0x304205))try{const _0x4c46c3=await resolveYamlFilePath(_0x304205);return _0x1f7153&&(console[_0x28c983(0x212)]('Resolved\x20YAML\x20file:\x20'+_0x304205),console[_0x28c983(0x212)](_0x28c983(0x15c)+_0x4c46c3[_0x28c983(0x189)]),console[_0x28c983(0x212)](_0x28c983(0x1a5)+_0x4c46c3[_0x28c983(0x215)]),console[_0x28c983(0x212)](_0x28c983(0x177)+(_0x4c46c3[_0x28c983(0x1dc)]||_0x28c983(0x13c)))),{'journeyName':_0x4c46c3[_0x28c983(0x215)],'parentSegment':_0x4c46c3[_0x28c983(0x189)],'resolved':_0x4c46c3};}catch(_0x146d6a){throw new SDKError(ErrorCode[_0x28c983(0x143)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x146d6a[_0x28c983(0x196)]);}if(!_0x1e7b8d)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x28c983(0x1b5));return{'journeyName':_0x304205,'parentSegment':_0x1e7b8d};}export class JourneyListCommand extends BaseCommand{[a27_0x389c24(0x1f2)]=a27_0x389c24(0x22d);[a27_0x389c24(0x182)]=a27_0x389c24(0x151);async['execute'](_0x5885a3){const _0x1ea56e=a27_0x389c24,{options:_0xb4111e,args:_0x8d6374,tdx:_0x265d20}=_0x5885a3,_0x3cbde2=_0x8d6374[0x0],_0xd9fa8a=_0xb4111e[_0x1ea56e(0x189)];if(!_0xd9fa8a)return console[_0x1ea56e(0x212)](_0x1ea56e(0x1c5)),console[_0x1ea56e(0x212)]('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0xab2d5b=await withSpinner(_0x1ea56e(0x204),()=>_0x265d20['segment'][_0x1ea56e(0x1d9)](_0xd9fa8a),{'verbose':_0xb4111e[_0x1ea56e(0x203)]}),_0x3d2a95=_0xab2d5b[_0x1ea56e(0x16e)];_0xb4111e[_0x1ea56e(0x203)]&&(console[_0x1ea56e(0x212)](_0x1ea56e(0x14b)+_0xd9fa8a+_0x1ea56e(0x150)+_0x3d2a95+')'),_0x3cbde2&&console[_0x1ea56e(0x212)](_0x1ea56e(0x167)+_0x3cbde2));const _0xffc92c=await withSpinner(_0x1ea56e(0x20b),()=>_0x265d20[_0x1ea56e(0x1ff)][_0x1ea56e(0x142)](_0x3d2a95),{'verbose':_0xb4111e[_0x1ea56e(0x203)]}),_0x32bc32=_0xffc92c[_0x1ea56e(0x16e)],_0x36a205=_0x32bc32[_0x1ea56e(0x1db)],_0x5779ed=await withSpinner(_0x1ea56e(0x16f),()=>_0x265d20[_0x1ea56e(0x180)][_0x1ea56e(0x1d4)](_0x3d2a95,_0x36a205),{'verbose':_0xb4111e[_0x1ea56e(0x203)]});let _0x55cdf4=_0x5779ed[_0x1ea56e(0x16e)][_0x1ea56e(0x134)];const _0x5f4330=_0x5779ed['data'][_0x1ea56e(0x164)],_0x3e7696=new Map();for(const _0x38859f of _0x5f4330){_0x3e7696[_0x1ea56e(0x1a3)](_0x38859f['id'],_0x38859f[_0x1ea56e(0x1f2)]);}if(_0x3cbde2){const _0x3594d4=globToRegex(_0x3cbde2);_0x55cdf4=_0x55cdf4[_0x1ea56e(0x13b)](_0x589fe0=>_0x3594d4[_0x1ea56e(0x178)](_0x589fe0['journeyBundleName']));}console[_0x1ea56e(0x212)](_0x1ea56e(0x14d)+_0x55cdf4['length']+_0x1ea56e(0x21c)+(_0x55cdf4['length']!==0x1?'s':''));const _0x24304d=_0x1c6a30=>{const _0x4cd7e1=_0x1ea56e;return getConsoleNextUrl(_0xb4111e['site'],_0x4cd7e1(0x175)+_0x3d2a95+'/e/'+_0x1c6a30+_0x4cd7e1(0x1b3));};if(_0xb4111e[_0x1ea56e(0x194)]===_0x1ea56e(0x1ca))await handleSDKOutput(_0x55cdf4,_0xb4111e);else{if(_0xb4111e[_0x1ea56e(0x194)]==='json'){const _0x1fbe19=_0x55cdf4[_0x1ea56e(0x136)](_0x3c9326=>({..._0x3c9326,'url':_0x24304d(_0x3c9326['id'])}));await handleSDKOutput(_0x1fbe19,_0xb4111e);}else{console[_0x1ea56e(0x174)]('['+_0xd9fa8a+']');const _0x414847=new Map(),_0xcc1ded=[];for(const _0xa964e of _0x55cdf4){if(!_0xa964e[_0x1ea56e(0x1bf)]||_0xa964e[_0x1ea56e(0x1bf)]===_0x36a205)_0xcc1ded[_0x1ea56e(0x20f)](_0xa964e);else{const _0x2273f6=_0x414847[_0x1ea56e(0x200)](_0xa964e[_0x1ea56e(0x1bf)])||[];_0x2273f6[_0x1ea56e(0x20f)](_0xa964e),_0x414847[_0x1ea56e(0x1a3)](_0xa964e['folderId'],_0x2273f6);}}const _0x408f24=(_0x64ffcd,_0x3c91cb)=>_0x64ffcd['journeyBundleName'][_0x1ea56e(0x1c9)](_0x3c91cb[_0x1ea56e(0x16c)],undefined,{'sensitivity':_0x1ea56e(0x19e)});_0xcc1ded[_0x1ea56e(0x1e5)](_0x408f24);for(const _0x42ea83 of _0xcc1ded){console['log'](formatJourneyItem(_0x42ea83,'',_0x24304d(_0x42ea83['id'])));}const _0x236d90=[..._0x414847[_0x1ea56e(0x197)]()][_0x1ea56e(0x1e5)]((_0x392c8b,_0x4d416a)=>{const _0x1d7ace=_0x1ea56e,_0x4a27b3=_0x3e7696[_0x1d7ace(0x200)](_0x392c8b[0x0])||_0x392c8b[0x0],_0x2f769c=_0x3e7696[_0x1d7ace(0x200)](_0x4d416a[0x0])||_0x4d416a[0x0];return _0x4a27b3['localeCompare'](_0x2f769c,undefined,{'sensitivity':_0x1d7ace(0x19e)});});for(const [_0x38d464,_0x376b87]of _0x236d90){const _0x56af2e=_0x3e7696[_0x1ea56e(0x200)](_0x38d464)||_0x38d464;console[_0x1ea56e(0x174)](_0x1ea56e(0x139)+_0x56af2e),_0x376b87[_0x1ea56e(0x1e5)](_0x408f24);for(const _0x1ff58d of _0x376b87){console[_0x1ea56e(0x174)](formatJourneyItem(_0x1ff58d,'\x20\x20',_0x24304d(_0x1ff58d['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x389c24(0x1f2)]=a27_0x389c24(0x154);[a27_0x389c24(0x182)]=a27_0x389c24(0x17a);async[a27_0x389c24(0x172)](_0x13b287){const _0x357cfe=a27_0x389c24,{options:_0x2be04c,args:_0x50cccd,tdx:_0x404ba4}=_0x13b287,_0x3b4a01=_0x50cccd[0x0];if(!_0x3b4a01)return console[_0x357cfe(0x212)](_0x357cfe(0x227)),console[_0x357cfe(0x212)](_0x357cfe(0x18b)),console[_0x357cfe(0x212)](_0x357cfe(0x233)),console['error'](_0x357cfe(0x1e9)),0x1;_0x2be04c['verbose']&&console[_0x357cfe(0x212)](_0x357cfe(0x135)+_0x3b4a01);const {journeyId:_0x2168e0,parentSegmentId:_0x26c2d8}=await resolveJourneyIdFromInput(_0x3b4a01,_0x2be04c,_0x404ba4);if(_0x2be04c['web']){const _0xaf5475=getConsoleNextUrl(_0x2be04c[_0x357cfe(0x223)],_0x357cfe(0x175)+_0x26c2d8+_0x357cfe(0x1e6)+_0x2168e0+_0x357cfe(0x132));return console[_0x357cfe(0x212)](a27_0x25db00[_0x357cfe(0x1e8)]('✔')+'\x20Opening\x20'+a27_0x25db00['cyan'](_0xaf5475)),openBrowser(_0xaf5475),0x0;}const _0x1877c4=await withSpinner(_0x357cfe(0x19b),()=>_0x404ba4['journey'][_0x357cfe(0x207)](_0x2168e0),{'verbose':_0x2be04c[_0x357cfe(0x203)]}),_0x3f9ff3=_0x1877c4[_0x357cfe(0x16e)],_0x396cce=_0x2be04c['includeStats'];let _0x415731;if(_0x396cce)try{const _0x426a9d=await withSpinner(_0x357cfe(0x15e),()=>_0x404ba4[_0x357cfe(0x180)][_0x357cfe(0x1af)](_0x2168e0),{'verbose':_0x2be04c[_0x357cfe(0x203)]});_0x415731=_0x426a9d[_0x357cfe(0x16e)];}catch{_0x2be04c[_0x357cfe(0x203)]&&console[_0x357cfe(0x212)](_0x357cfe(0x19c));}const _0x171d85=getConsoleNextUrl(_0x2be04c[_0x357cfe(0x223)],_0x357cfe(0x175)+_0x26c2d8+_0x357cfe(0x1e6)+_0x2168e0+_0x357cfe(0x132)),_0x1cd092={'id':_0x3f9ff3['id'],'name':_0x3f9ff3['attributes'][_0x357cfe(0x1f2)],'description':_0x3f9ff3[_0x357cfe(0x221)][_0x357cfe(0x182)],'state':_0x3f9ff3[_0x357cfe(0x221)][_0x357cfe(0x183)],'paused':_0x3f9ff3[_0x357cfe(0x221)][_0x357cfe(0x15b)],'reentry_mode':_0x3f9ff3['attributes'][_0x357cfe(0x1df)],'stages':_0x3f9ff3[_0x357cfe(0x221)][_0x357cfe(0x17b)]?.[_0x357cfe(0x159)]||0x0,..._0x3f9ff3[_0x357cfe(0x221)][_0x357cfe(0x201)]&&{'goal':_0x3f9ff3['attributes'][_0x357cfe(0x201)][_0x357cfe(0x1f2)]},..._0x415731&&{'statistics':{'size':_0x415731[_0x357cfe(0x153)],'entered':_0x415731['enteredSize'],'goal_achieved':_0x415731['goalSize'],'completion_rate':_0x415731[_0x357cfe(0x217)],'exit_or_jump':_0x415731[_0x357cfe(0x1e7)],'exit_or_jump_rate':_0x415731[_0x357cfe(0x1f8)],'stages':_0x415731[_0x357cfe(0x20d)]}},'url':_0x171d85};return await handleSingleObjectOutput(_0x1cd092,_0x2be04c),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x389c24(0x1f2)]='journey:stats';['description']=a27_0x389c24(0x17d);async[a27_0x389c24(0x172)](_0x28d5e7){const _0x315fdf=a27_0x389c24,{options:_0x19438d,args:_0x269f9c,tdx:_0x5c3c2c}=_0x28d5e7,_0x32295e=_0x269f9c[0x0];if(!requireNameOrPath(_0x32295e))return 0x1;_0x19438d[_0x315fdf(0x203)]&&console['error']('Input:\x20'+_0x32295e);const _0x2eabef=_0x19438d,_0x2fc472=_0x2eabef[_0x315fdf(0x15d)],_0x359a1b=_0x2eabef['to'],_0x22861e=_0x2eabef[_0x315fdf(0x228)],_0x593ec8=_0x2eabef[_0x315fdf(0x133)];_0x22861e&&!_0x2fc472&&!_0x359a1b&&console[_0x315fdf(0x212)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x2316f5=_0x22861e?withJsonFormat(_0x19438d):_0x19438d,{journeyId:_0x238002,journeyName:_0x8d8b33}=await resolveJourneyIdFromInput(_0x32295e,_0x2316f5,_0x5c3c2c),_0x4046a5=_0x2fc472||_0x359a1b?{'from':_0x2fc472,'to':_0x359a1b}:undefined,_0x4b7b1f=await withSpinner(_0x315fdf(0x15e),()=>Promise[_0x315fdf(0x234)]([_0x5c3c2c['journey'][_0x315fdf(0x207)](_0x238002),_0x5c3c2c[_0x315fdf(0x180)][_0x315fdf(0x1af)](_0x238002,_0x4046a5)]),{'verbose':_0x2316f5[_0x315fdf(0x203)]}),[_0xe62bf3,_0x2c38c7]=_0x4b7b1f[_0x315fdf(0x16e)];if(!_0x2c38c7||_0x2c38c7[_0x315fdf(0x171)]===null)return console['error'](_0x315fdf(0x1c8)+_0x8d8b33),console[_0x315fdf(0x212)](_0x315fdf(0x1c1)),0x0;const _0xcbab20=buildStageNameMap(_0xe62bf3),_0x5d6e8d=!!(_0x4046a5&&_0x2c38c7[_0x315fdf(0x22f)]?.['length']),_0x388318={'stageNameMap':_0xcbab20,'hasPeriod':_0x5d6e8d,'includeHistory':!!_0x22861e};if(_0x593ec8&&_0x2c38c7[_0x315fdf(0x20d)]){const _0x5ef31a=_0x2c38c7[_0x315fdf(0x20d)]['find'](_0x58eee3=>{const _0x4b41d9=_0x315fdf,_0x5bfeef=_0xcbab20['get'](_0x58eee3['id'])??'';return _0x5bfeef[_0x4b41d9(0x168)]()===_0x593ec8[_0x4b41d9(0x168)]();});if(_0x5ef31a)return await handleSingleObjectOutput(formatStageStats(_0x5ef31a,_0x388318),_0x2316f5),0x0;const _0x579b90=_0x2c38c7[_0x315fdf(0x20d)][_0x315fdf(0x136)](_0x6f7065=>_0xcbab20['get'](_0x6f7065['id'])??_0x6f7065['id']);return console[_0x315fdf(0x212)]('Error:\x20Stage\x20\x22'+_0x593ec8+_0x315fdf(0x147)),console[_0x315fdf(0x212)](_0x315fdf(0x1be)+_0x579b90['join'](',\x20')),0x1;}const _0x152587=_0x2c38c7[_0x315fdf(0x20d)]?.[_0x315fdf(0x136)](_0x57b9ab=>formatStageStats(_0x57b9ab,_0x388318)),_0x7ecce8=assembleJourneyStats(_0x2c38c7,{'from':_0x2fc472,'to':_0x359a1b,'includeHistory':_0x22861e});return await this['renderStats'](_0x7ecce8,_0x152587??[],_0x2316f5),0x0;}async[a27_0x389c24(0x1ec)](_0x1cbbbe,_0x47ffae,_0x4247da){const _0x34aebd=a27_0x389c24,_0x4c58a3=_0x4247da[_0x34aebd(0x194)]===_0x34aebd(0x1b1)||_0x4247da[_0x34aebd(0x194)]===_0x34aebd(0x210)||_0x4247da[_0x34aebd(0x1b1)]||_0x4247da['jsonl'];if(_0x4c58a3){_0x1cbbbe[_0x34aebd(0x20d)]=_0x47ffae,await handleSingleObjectOutput(_0x1cbbbe,_0x4247da);return;}await handleSingleObjectOutput(_0x1cbbbe,_0x4247da);for(const _0x28651c of _0x47ffae){console[_0x34aebd(0x174)](''),console[_0x34aebd(0x174)](String(a27_0x25db00[_0x34aebd(0x1ce)][_0x34aebd(0x1dd)]('['+_0x28651c['name']+']'))+a27_0x25db00[_0x34aebd(0x18f)]('\x20'+_0x28651c['id']));const {id:_0x56b6d3,name:_0x4ae9fc,..._0x1fb02f}=_0x28651c;await handleSingleObjectOutput(_0x1fb02f,_0x4247da);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x389c24(0x1f2)]='journey:traffic';[a27_0x389c24(0x182)]=a27_0x389c24(0x1c6);async[a27_0x389c24(0x172)](_0x1d6130){const _0x3d985f=a27_0x389c24,{options:_0x5eaa7a,args:_0x4c0591,tdx:_0x7280e5}=_0x1d6130,_0xde7d6e=_0x4c0591[0x0];if(!requireNameOrPath(_0xde7d6e))return 0x1;_0x5eaa7a['verbose']&&console['error'](_0x3d985f(0x135)+_0xde7d6e);const _0xa14abd=_0x5eaa7a,_0x84b71e=_0xa14abd[_0x3d985f(0x152)],_0x1291dd=_0xa14abd[_0x3d985f(0x15d)],_0x202e69=_0xa14abd['to'],_0x1165f7=_0xa14abd[_0x3d985f(0x144)];if(_0x84b71e&&_0x84b71e!==_0x3d985f(0x187)&&_0x84b71e!=='activation')return console[_0x3d985f(0x212)](_0x3d985f(0x1d3)+_0x84b71e+_0x3d985f(0x222)),0x1;const _0x457fe2=withJsonFormat(_0x5eaa7a),{journeyId:_0x28b109,journeyName:_0x2a0bc5}=await resolveJourneyIdFromInput(_0xde7d6e,_0x457fe2,_0x7280e5),_0x12d63={'type':_0x84b71e,'from':_0x1291dd,'to':_0x202e69,'limit':_0x1165f7},_0x58ea5b=await withSpinner(_0x3d985f(0x15a),()=>_0x7280e5[_0x3d985f(0x180)][_0x3d985f(0x1d8)](_0x28b109,_0x12d63),{'verbose':_0x457fe2['verbose']}),_0x457aa2=_0x58ea5b['data'],_0x364218=_0x457aa2[_0x3d985f(0x187)]&&(_0x457aa2[_0x3d985f(0x187)][_0x3d985f(0x17e)][_0x3d985f(0x159)]>0x0||_0x457aa2[_0x3d985f(0x187)][_0x3d985f(0x1a4)][_0x3d985f(0x159)]>0x0),_0x2bb54b=_0x457aa2[_0x3d985f(0x1ef)]&&_0x457aa2['activation'][_0x3d985f(0x159)]>0x0;if(!_0x364218&&!_0x2bb54b)return console[_0x3d985f(0x212)]('No\x20traffic\x20data\x20available\x20for\x20journey:\x20'+_0x2a0bc5),console[_0x3d985f(0x212)](_0x3d985f(0x21e)),_0x1291dd&&_0x202e69&&console[_0x3d985f(0x212)]('If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).'),0x0;return await handleSingleObjectOutput(_0x457aa2,_0x457fe2),0x0;}}function formatStageStats(_0x3dee4e,_0x5c76a6){const _0x4548fb=a27_0x389c24,_0x290385=_0x5c76a6[_0x4548fb(0x1b8)]&&_0x3dee4e[_0x4548fb(0x22f)]?.[_0x4548fb(0x159)]?aggregateStageHistory(_0x3dee4e[_0x4548fb(0x22f)]):{'size':_0x3dee4e[_0x4548fb(0x153)],'entered':_0x3dee4e['enteredSize'],'milestone':_0x3dee4e[_0x4548fb(0x195)],'milestone_rate':_0x3dee4e['completeMilestoneRate'],'exit_or_jump':_0x3dee4e[_0x4548fb(0x1e7)],'exit_or_jump_rate':_0x3dee4e['exitOrJumpRate']},_0x2301b1={'id':_0x3dee4e['id'],'name':_0x5c76a6[_0x4548fb(0x185)][_0x4548fb(0x200)](_0x3dee4e['id'])??_0x3dee4e['id'],..._0x290385};return _0x5c76a6[_0x4548fb(0x1b8)]&&_0x5c76a6[_0x4548fb(0x228)]&&_0x3dee4e['history']&&(_0x2301b1[_0x4548fb(0x22f)]=_0x3dee4e[_0x4548fb(0x22f)]),_0x2301b1;}export class JourneyPauseCommand extends BaseCommand{[a27_0x389c24(0x1f2)]='journey:pause';[a27_0x389c24(0x182)]=a27_0x389c24(0x1ea);async[a27_0x389c24(0x172)](_0x2fdd59){const _0x4b167d=a27_0x389c24,{options:_0x58875f,args:_0x54dbaa,tdx:_0x35a30d}=_0x2fdd59,_0x3c2fb6=_0x54dbaa[0x0];if(!requireNameOrPath(_0x3c2fb6))return 0x1;_0x58875f[_0x4b167d(0x203)]&&console[_0x4b167d(0x212)]('Input:\x20'+_0x3c2fb6);const {journeyId:_0x355881,journeyName:_0x28da31}=await resolveJourneyIdFromInput(_0x3c2fb6,_0x58875f,_0x35a30d);if(!_0x58875f[_0x4b167d(0x130)]){const _0x1431f7=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x28da31+'\x22?');if(!_0x1431f7)return console[_0x4b167d(0x212)](_0x4b167d(0x1b7)),0x0;}const _0x208b91=await withSpinner(_0x4b167d(0x1b2),()=>_0x35a30d['journey'][_0x4b167d(0x224)](_0x355881),{'verbose':_0x58875f[_0x4b167d(0x203)]}),_0x177ad9=_0x208b91[_0x4b167d(0x16e)];return console[_0x4b167d(0x212)](_0x4b167d(0x1f0)+_0x177ad9[_0x4b167d(0x221)][_0x4b167d(0x1f2)]+_0x4b167d(0x202)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x389c24(0x1f2)]=a27_0x389c24(0x220);[a27_0x389c24(0x182)]=a27_0x389c24(0x12e);async['execute'](_0x47100e){const _0x38ba28=a27_0x389c24,{options:_0x4617c3,args:_0x3a96f7,tdx:_0x3ff74b}=_0x47100e,_0x2b48d7=_0x3a96f7[0x0];if(!requireNameOrPath(_0x2b48d7))return 0x1;_0x4617c3[_0x38ba28(0x203)]&&console[_0x38ba28(0x212)](_0x38ba28(0x135)+_0x2b48d7);const {journeyId:_0x5bdc05,journeyName:_0x2bb230}=await resolveJourneyIdFromInput(_0x2b48d7,_0x4617c3,_0x3ff74b);if(!_0x4617c3[_0x38ba28(0x130)]){const _0x163c76=await confirm(_0x38ba28(0x21a)+_0x2bb230+'\x22?');if(!_0x163c76)return console['error'](_0x38ba28(0x1b7)),0x0;}const _0x34842f=await withSpinner('Resuming\x20journey...',()=>_0x3ff74b[_0x38ba28(0x180)][_0x38ba28(0x190)](_0x5bdc05),{'verbose':_0x4617c3['verbose']}),_0x23b73a=_0x34842f['data'];return console[_0x38ba28(0x212)](_0x38ba28(0x1f0)+_0x23b73a[_0x38ba28(0x221)][_0x38ba28(0x1f2)]+_0x38ba28(0x149)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a27_0x389c24(0x1f2)]='journey:pull';[a27_0x389c24(0x182)]=a27_0x389c24(0x184);async['execute'](_0x3cc04f){const _0x10a4f7=a27_0x389c24,{options:_0x1f1492,args:_0x42993b,tdx:_0x14b493}=_0x3cc04f,_0x479413=_0x1f1492,_0x4c25ce=_0x42993b[0x0],_0x318687=_0x4c25ce&&isYamlFilePath(_0x4c25ce),_0xb3f7e4=await resolveTarget({'arg':_0x318687?_0x4c25ce:undefined,'contextParent':_0x1f1492[_0x10a4f7(0x189)],'cwd':process[_0x10a4f7(0x236)]()});if(!isSuccessfulResolution(_0xb3f7e4))return _0xb3f7e4[_0x10a4f7(0x173)]==='no_parent'?(console[_0x10a4f7(0x212)](a27_0x25db00[_0x10a4f7(0x1b4)](_0x10a4f7(0x179))),console['error']('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[_0x10a4f7(0x212)](_0x10a4f7(0x1e2)),console['error'](_0x10a4f7(0x1da)),console[_0x10a4f7(0x212)]('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console[_0x10a4f7(0x212)](a27_0x25db00['red'](_0x10a4f7(0x1ae)+_0xb3f7e4[_0x10a4f7(0x196)]+'\x0a')),_0xb3f7e4[_0x10a4f7(0x206)]&&console[_0x10a4f7(0x212)](a27_0x25db00['cyan'](_0xb3f7e4['helpText']))),0x1;let _0x3e2d13=_0x318687?undefined:_0x4c25ce,_0x3d524c,_0x4e79cc;_0xb3f7e4[_0x10a4f7(0x152)]===_0x10a4f7(0x20c)&&(_0x3e2d13=_0xb3f7e4[_0x10a4f7(0x238)],_0x3d524c=_0xb3f7e4[_0x10a4f7(0x1ba)],_0x4e79cc=_0xb3f7e4['folderPath']);const _0x1474a2=_0xb3f7e4['parentName'],_0x468286=_0xb3f7e4[_0x10a4f7(0x18c)];_0x479413[_0x10a4f7(0x203)]&&(console[_0x10a4f7(0x212)](_0x10a4f7(0x14b)+_0x1474a2),console[_0x10a4f7(0x212)]('Target\x20directory:\x20'+_0x468286),_0x3e2d13&&console['error'](_0x10a4f7(0x1a9)+_0x3e2d13),_0x3d524c&&console[_0x10a4f7(0x212)]('Target\x20file:\x20'+_0x3d524c),_0x4e79cc&&console[_0x10a4f7(0x212)]('Folder\x20path:\x20'+_0x4e79cc));const _0x28b4da=await withSpinner(_0x10a4f7(0x204),()=>_0x14b493[_0x10a4f7(0x1ff)]['resolveParentId'](_0x1474a2),{'verbose':_0x1f1492[_0x10a4f7(0x203)]}),_0x3939e2=_0x28b4da[_0x10a4f7(0x16e)],{journeys:_0x44d24b,folders:_0x23d6d8}=await withSpinner(_0x10a4f7(0x161),async()=>{const _0x258194=_0x10a4f7,[_0x33317c,_0x12b8c1]=await Promise['all']([_0x14b493['journey'][_0x258194(0x14c)](_0x3939e2,undefined,{'includeAllVersions':!![]}),_0x14b493[_0x258194(0x1ff)]['listFolders'](_0x3939e2)]);return{'journeys':_0x33317c,'folders':_0x12b8c1};},{'verbose':_0x1f1492['verbose']})[_0x10a4f7(0x146)](_0xb2cf2c=>_0xb2cf2c[_0x10a4f7(0x16e)]);let _0x3061ae=_0x44d24b;const _0xce72dd=buildFolderIdToPathMap(_0x23d6d8);if(_0x3e2d13){const _0x4f7abf=_0x3061ae[_0x10a4f7(0x13b)](_0x2747ac=>_0x2747ac[_0x10a4f7(0x16c)][_0x10a4f7(0x168)]()===_0x3e2d13[_0x10a4f7(0x168)]());if(_0x4f7abf[_0x10a4f7(0x159)]===0x0)return console[_0x10a4f7(0x212)](_0x10a4f7(0x1cb)+_0x3e2d13),console[_0x10a4f7(0x212)](_0x10a4f7(0x13a)),0x1;_0x3061ae=_0x4f7abf;}if(_0x4e79cc!==undefined){const _0x56278e=_0x3061ae['filter'](_0x20aeb9=>{const _0x52e3ba=_0x10a4f7,_0x48acdc=_0x20aeb9[_0x52e3ba(0x1bf)]?_0xce72dd[_0x52e3ba(0x200)](_0x20aeb9['folderId'])||'':'';return _0x48acdc===_0x4e79cc;});if(_0x56278e[_0x10a4f7(0x159)]===0x0&&_0x3061ae['length']>0x0){console[_0x10a4f7(0x212)](_0x10a4f7(0x155)+_0x3e2d13+_0x10a4f7(0x1d5)+(_0x4e79cc||_0x10a4f7(0x1ac))),console[_0x10a4f7(0x212)](_0x10a4f7(0x18a));for(const _0xde39b1 of _0x3061ae){const _0x225bb3=_0xde39b1[_0x10a4f7(0x1bf)]?_0xce72dd[_0x10a4f7(0x200)](_0xde39b1[_0x10a4f7(0x1bf)])||'':'';console[_0x10a4f7(0x212)](_0x10a4f7(0x1ee)+(_0x225bb3||'(root)')+'/'+_0xde39b1['journeyBundleName']);}return 0x1;}_0x3061ae=_0x56278e;}if(_0x3061ae[_0x10a4f7(0x159)]===0x0)return console['error'](_0x10a4f7(0x20a)),0x0;const _0x5ed4e0=new Map();for(const _0x3da9d2 of _0x3061ae){const _0x1cf6ed=_0x3da9d2['journeyBundleId'];!_0x5ed4e0['has'](_0x1cf6ed)&&_0x5ed4e0['set'](_0x1cf6ed,[]),_0x5ed4e0[_0x10a4f7(0x200)](_0x1cf6ed)[_0x10a4f7(0x20f)](_0x3da9d2);}for(const _0x47777c of _0x5ed4e0[_0x10a4f7(0x1fe)]()){_0x47777c['sort']((_0x483f8a,_0x139554)=>(_0x483f8a[_0x10a4f7(0x14f)]||0x0)-(_0x139554[_0x10a4f7(0x14f)]||0x0));}const _0x457fe8=[],{idToEmailMap:_0x1c0f42,connectionIdToNameMap:_0x49e14a}=await withSpinner(_0x10a4f7(0x18e),async()=>{const _0x539e78=_0x10a4f7,[_0x13aa6e,_0x342626]=await Promise[_0x539e78(0x234)]([_0x14b493['user'][_0x539e78(0x17f)](),_0x14b493['connection']['buildIdToNameMap']()]);return{'idToEmailMap':_0x13aa6e,'connectionIdToNameMap':_0x342626};},{'verbose':_0x1f1492[_0x10a4f7(0x203)]})[_0x10a4f7(0x146)](_0x17c4a2=>_0x17c4a2[_0x10a4f7(0x16e)]);for(const _0x5f1232 of _0x5ed4e0[_0x10a4f7(0x1fe)]()){const _0x459f68=_0x5f1232[0x0][_0x10a4f7(0x16c)],_0x14af8d=_0x5f1232[0x0][_0x10a4f7(0x1bf)],_0x36fe8c=_0x14af8d?_0xce72dd['get'](_0x14af8d)||'':'',_0x23002c=_0x36fe8c?a27_0x2f4303[_0x10a4f7(0x1e1)](_0x468286,_0x36fe8c):_0x468286,_0x386971=_0x3d524c||a27_0x2f4303[_0x10a4f7(0x1e1)](_0x23002c,sanitizeFileName(_0x459f68)+_0x10a4f7(0x1aa));let _0x2e3e8f,_0x30c7b2;if(existsSync(_0x386971))try{const _0x4f8c48=readFileSync(_0x386971,'utf-8'),_0x3e9b5e=parseYamlString(_0x4f8c48);_0x30c7b2=_0x3e9b5e,_0x2e3e8f=buildRuleToNameMapping(_0x3e9b5e),_0x479413[_0x10a4f7(0x203)]&&_0x2e3e8f['size']>0x0&&console[_0x10a4f7(0x212)](_0x10a4f7(0x208)+_0x2e3e8f[_0x10a4f7(0x153)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x459f68);}catch(_0x5331c0){_0x479413[_0x10a4f7(0x203)]&&console[_0x10a4f7(0x212)]('Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20'+_0x5331c0[_0x10a4f7(0x196)]);}const _0x5dba8f=[],_0x570244=new Set(),_0x2598af=new Map(),_0x1ca5e4=new Map(),_0x1fd555=new Set(),_0x44f41d=new Map(),_0x5d0b87=new Map(),_0x303a5e=createJumpTargetCache();await withProgressSpinner(_0x10a4f7(0x13f)+_0x459f68+'...',async _0x5e86a8=>{const _0x4b1bb7=_0x10a4f7;for(const _0x249894 of _0x5f1232){const _0x3b35a9=_0x5f1232[_0x4b1bb7(0x159)]>0x1?_0x249894[_0x4b1bb7(0x16c)]+'\x20v'+(_0x249894[_0x4b1bb7(0x14f)]||0x1):_0x249894[_0x4b1bb7(0x16c)];_0x5e86a8[_0x4b1bb7(0x1d0)](_0x4b1bb7(0x13f)+_0x3b35a9);const _0x61386f=await _0x14b493[_0x4b1bb7(0x180)][_0x4b1bb7(0x207)](_0x249894['id']),_0x145098=_0x61386f['attributes']?.[_0x4b1bb7(0x1fc)],_0xd744ab={'resolveSegment':async _0xd5064d=>{const _0x3fd2ec=_0x4b1bb7;if(!_0x145098)return{'name':_0xd5064d,'isJourneyLocal':![]};const _0x130615=_0x2598af[_0x3fd2ec(0x200)](_0xd5064d);if(_0x130615)return _0x130615;try{const _0x5143ae=await _0x14b493['segment']['getSegment'](_0x145098,_0xd5064d),_0x1a4409=_0x5143ae[_0x3fd2ec(0x1fa)]===SEGMENT_KIND_JOURNEY;let _0x360b30,_0x5cb38c=_0x5143ae[_0x3fd2ec(0x1f2)];if(_0x1a4409&&_0x5143ae[_0x3fd2ec(0x1c2)]){const _0x2ab437=await segmentResponseToDef(_0x5143ae,{'resolveSegmentName':async _0x3858a4=>{const _0x697461=_0x3fd2ec,_0x29e3e8=_0x2598af[_0x697461(0x200)](_0x3858a4);if(_0x29e3e8)return _0x29e3e8[_0x697461(0x1f2)];const _0x22d039=await _0xd744ab['resolveSegment'](_0x3858a4);return _0x22d039[_0x697461(0x1f2)];}}),_0x3845c1=_0x2ab437[_0x3fd2ec(0x1c2)];_0x360b30={'description':_0x5143ae['description'],'rule':_0x3845c1};const _0x1e32bb=serializeRule(_0x3845c1),_0x40aca0=_0x1ca5e4[_0x3fd2ec(0x200)](_0x1e32bb);if(_0x40aca0)_0x5cb38c=_0x40aca0,_0x360b30=undefined,_0x479413['verbose']&&console[_0x3fd2ec(0x212)](_0x3fd2ec(0x1a0)+_0x5143ae['name']+_0x3fd2ec(0x165)+_0x40aca0);else{let _0x16e1c7=![];if(_0x2e3e8f){const _0x5e2773=_0x2e3e8f['get'](_0x1e32bb);if(_0x5e2773){const _0x1c51d1=_0x5e2773[_0x3fd2ec(0x1d1)](_0x3ab6c8=>!_0x570244[_0x3fd2ec(0x1f4)](_0x3ab6c8));_0x1c51d1&&(_0x5cb38c=_0x1c51d1,_0x570244[_0x3fd2ec(0x1a8)](_0x1c51d1),_0x1ca5e4[_0x3fd2ec(0x1a3)](_0x1e32bb,_0x1c51d1),_0x16e1c7=!![],_0x479413['verbose']&&console['error'](_0x3fd2ec(0x1bc)+_0x1c51d1+_0x3fd2ec(0x12d)));}}if(!_0x16e1c7){const _0x2a6a7e=generateJourneyLocalName(_0x5143ae['name']);_0x2a6a7e&&(_0x5cb38c=_0x2a6a7e);let _0x3c015c=_0x5cb38c,_0x58cef1=0x2;while(_0x570244[_0x3fd2ec(0x1f4)](_0x3c015c)){_0x3c015c=_0x5cb38c+'_'+_0x58cef1,_0x58cef1++;}_0x570244['add'](_0x3c015c),_0x1ca5e4['set'](_0x1e32bb,_0x3c015c),_0x5cb38c=_0x3c015c;}}}const _0x58512f={'name':_0x5cb38c,'isJourneyLocal':_0x1a4409,'definition':_0x360b30};return _0x2598af['set'](_0xd5064d,_0x58512f),_0x58512f;}catch(_0x216b50){return _0x1f1492[_0x3fd2ec(0x203)]&&console[_0x3fd2ec(0x212)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0xd5064d+':\x20'+_0x216b50[_0x3fd2ec(0x196)]),{'name':_0xd5064d,'isJourneyLocal':![]};}},'resolveActivation':async _0x526990=>{const _0x2ab26a=_0x4b1bb7,_0x2ff250=_0x44f41d[_0x2ab26a(0x200)](_0x526990);if(_0x2ff250)return _0x2ff250;try{const _0x743e94=await _0x14b493[_0x2ab26a(0x180)][_0x2ab26a(0x1e0)](_0x249894['id'],_0x526990),_0x48503e=journeyActivationStepToYaml(_0x743e94,_0x1c0f42,_0x49e14a),_0x50b612=JSON[_0x2ab26a(0x218)]({'name':_0x48503e[_0x2ab26a(0x1f2)],'connection':_0x48503e[_0x2ab26a(0x1c4)],'connector_config':_0x48503e[_0x2ab26a(0x231)]}),_0x4fa12b=_0x5d0b87[_0x2ab26a(0x200)](_0x50b612);if(_0x4fa12b){const _0xd5fe62={'name':_0x4fa12b,'isJourneyLocal':!![],'definition':_0x48503e};return _0x44f41d[_0x2ab26a(0x1a3)](_0x526990,_0xd5fe62),_0xd5fe62;}const _0x5a54c6=_0x743e94[_0x2ab26a(0x221)][_0x2ab26a(0x1f5)]['name']||_0x526990,_0x224860=sanitizeYamlKey(_0x5a54c6)||_0x2ab26a(0x176)+_0x526990;let _0x17862d=_0x224860,_0x26377e=0x2;while(_0x1fd555['has'](_0x17862d)){_0x17862d=_0x224860+'_'+_0x26377e,_0x26377e++;}_0x1fd555['add'](_0x17862d),_0x5d0b87[_0x2ab26a(0x1a3)](_0x50b612,_0x17862d);const _0x1ee7ab={'name':_0x17862d,'isJourneyLocal':!![],'definition':_0x48503e};return _0x44f41d[_0x2ab26a(0x1a3)](_0x526990,_0x1ee7ab),_0x1ee7ab;}catch(_0x55a788){return _0x1f1492[_0x2ab26a(0x203)]&&console[_0x2ab26a(0x212)](_0x2ab26a(0x14e)+_0x526990+':\x20'+_0x55a788[_0x2ab26a(0x196)]),{'name':_0x526990,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x5461e3,_0xf32f)=>{const _0x34294e=_0x4b1bb7;return resolveJumpTarget(_0x5461e3,_0xf32f,_0x303a5e,_0x1904f7=>_0x14b493[_0x34294e(0x180)][_0x34294e(0x207)](_0x1904f7));}},_0x500f04=await journeyResponseToDef(_0x61386f,_0xd744ab);_0x5dba8f[_0x4b1bb7(0x20f)]({'item':_0x249894,'yaml':_0x500f04});}},{'verbose':_0x1f1492['verbose']});const _0x218f8c=await _0x14b493[_0x10a4f7(0x180)][_0x10a4f7(0x181)](_0x5f1232[0x0][_0x10a4f7(0x22a)]),_0x415f00=buildMergedJourneyDef(_0x5dba8f,_0x2e3e8f,_0x218f8c),_0x3a6114=normalizeJourneyDef(_0x415f00,_0x30c7b2),_0x25b39a=toYamlString(_0x3a6114),_0x24c73b=_0x3d524c||a27_0x2f4303['join'](_0x23002c,sanitizeFileName(_0x459f68)+_0x10a4f7(0x1aa));!_0x3d524c&&_0x36fe8c&&!existsSync(_0x23002c)&&mkdirSync(_0x23002c,{'recursive':!![]});const _0xc4f219=a27_0x2f4303[_0x10a4f7(0x12c)](process['cwd'](),_0x24c73b);if(existsSync(_0x24c73b)){const _0x5a3f3b=readFileSync(_0x24c73b,_0x10a4f7(0x186)),_0xb472e8=generateDiff(_0x5a3f3b,_0x25b39a),_0xf6f23e=hasChanges(_0xb472e8);_0x457fe8[_0x10a4f7(0x20f)]({'relativePath':_0xc4f219,'absolutePath':_0x24c73b,'content':_0x25b39a,'isNew':![],'hasChanges':_0xf6f23e,'diff':_0xf6f23e?formatDiffWithColors(_0xb472e8):undefined});}else _0x457fe8[_0x10a4f7(0x20f)]({'relativePath':_0xc4f219,'absolutePath':_0x24c73b,'content':_0x25b39a,'isNew':!![],'hasChanges':![]});}const _0x3a2ec0=_0x457fe8[_0x10a4f7(0x13b)](_0x4dbe90=>_0x4dbe90[_0x10a4f7(0x1c3)]),_0x3fa594=_0x457fe8[_0x10a4f7(0x13b)](_0x36261a=>!_0x36261a['isNew']&&_0x36261a[_0x10a4f7(0x1bb)]),_0x28ec26=_0x457fe8[_0x10a4f7(0x13b)](_0x125fd6=>!_0x125fd6['isNew']&&!_0x125fd6[_0x10a4f7(0x1bb)]),_0x4780fe=_0x3061ae[_0x10a4f7(0x159)],_0x501a1b=_0x5ed4e0[_0x10a4f7(0x153)],_0x3eedb5=_0x4780fe>_0x501a1b?'\x20('+_0x4780fe+'\x20versions)':'';console[_0x10a4f7(0x212)](_0x10a4f7(0x137)),console[_0x10a4f7(0x212)]('\x20\x20'+a27_0x25db00[_0x10a4f7(0x1ce)](_0x501a1b+_0x10a4f7(0x16b))+a27_0x25db00[_0x10a4f7(0x18f)](_0x3eedb5)),console['error']('\x20\x20'+a27_0x25db00['green']('+\x20'+_0x3a2ec0[_0x10a4f7(0x159)]+'\x20new\x20files')),console[_0x10a4f7(0x212)]('\x20\x20'+a27_0x25db00['yellow']('~\x20'+_0x3fa594['length']+_0x10a4f7(0x1a6))),console[_0x10a4f7(0x212)]('\x20\x20'+a27_0x25db00[_0x10a4f7(0x18f)]('=\x20'+_0x28ec26['length']+_0x10a4f7(0x163))),console['error']('\x20\x20Target:\x20'+a27_0x25db00['cyan'](_0x468286)+'\x0a');if(_0x3fa594[_0x10a4f7(0x159)]>0x0)for(const _0x4907d7 of _0x3fa594){console[_0x10a4f7(0x212)](_0x10a4f7(0x1a1)+_0x4907d7[_0x10a4f7(0x1ab)]+'\x27:'),console['error']('─'[_0x10a4f7(0x145)](0x3c)),console['error'](_0x4907d7[_0x10a4f7(0x1f6)]),console[_0x10a4f7(0x212)]('─'[_0x10a4f7(0x145)](0x3c));}if(_0x479413[_0x10a4f7(0x1cf)])return console[_0x10a4f7(0x212)](a27_0x25db00['yellow'](_0x10a4f7(0x148))),0x0;if(_0x3a2ec0[_0x10a4f7(0x159)]===0x0&&_0x3fa594[_0x10a4f7(0x159)]===0x0)return console[_0x10a4f7(0x212)](a27_0x25db00[_0x10a4f7(0x1e8)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x1474a2},_0x479413['session']),console['error'](a27_0x25db00[_0x10a4f7(0x1e8)](_0x10a4f7(0x169)+a27_0x25db00['dim']('parent_segment')+'\x20=\x20'+a27_0x25db00['cyan'](_0x1474a2))),0x0;if(!_0x479413[_0x10a4f7(0x130)]&&(_0x3a2ec0[_0x10a4f7(0x159)]>0x0||_0x3fa594[_0x10a4f7(0x159)]>0x0)){if(!isInteractive())return console['error'](a27_0x25db00[_0x10a4f7(0x15f)](_0x10a4f7(0x14a)),_0x10a4f7(0x226)),console['error'](a27_0x25db00[_0x10a4f7(0x18f)](_0x10a4f7(0x22e))),0x1;const _0x25605a=await confirmKey(_0x10a4f7(0x19a)+(_0x3a2ec0[_0x10a4f7(0x159)]+_0x3fa594['length'])+_0x10a4f7(0x199));if(!_0x25605a)return console[_0x10a4f7(0x212)](a27_0x25db00[_0x10a4f7(0x1b4)]('Aborted.'),_0x10a4f7(0x198)),0x1;}!existsSync(_0x468286)&&mkdirSync(_0x468286,{'recursive':!![]});const _0x938000=a27_0x2f4303[_0x10a4f7(0x1e1)](_0x468286,'tdx.json');writeFileSync(_0x938000,createTdxConfigContent(_0x1474a2),_0x10a4f7(0x186));for(const _0x2944c1 of _0x457fe8){(_0x2944c1[_0x10a4f7(0x1c3)]||_0x2944c1['hasChanges'])&&writeFileSync(_0x2944c1[_0x10a4f7(0x1d7)],_0x2944c1[_0x10a4f7(0x138)],'utf-8');}return console[_0x10a4f7(0x212)](a27_0x25db00[_0x10a4f7(0x1e8)](_0x10a4f7(0x1de)+(_0x3a2ec0[_0x10a4f7(0x159)]+_0x3fa594[_0x10a4f7(0x159)])+_0x10a4f7(0x1b9)+_0x468286)),saveSessionContext({'parent_segment':_0x1474a2},_0x479413[_0x10a4f7(0x193)]),console[_0x10a4f7(0x212)](a27_0x25db00[_0x10a4f7(0x1e8)](_0x10a4f7(0x169)+a27_0x25db00[_0x10a4f7(0x18f)](_0x10a4f7(0x211))+'\x20=\x20'+a27_0x25db00['cyan'](_0x1474a2))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']='journey:columns';[a27_0x389c24(0x182)]=a27_0x389c24(0x140);async[a27_0x389c24(0x172)](_0x1de04f){const _0x5065ae=a27_0x389c24,{options:_0x3b8105,args:_0x5466e0,tdx:_0x531312}=_0x1de04f,_0x1d7fe5=_0x5466e0[0x0];if(!requireNameOrPath(_0x1d7fe5))return 0x1;_0x3b8105[_0x5065ae(0x203)]&&console[_0x5065ae(0x212)](_0x5065ae(0x135)+_0x1d7fe5);const {journeyId:_0x4edd84}=await resolveJourneyIdFromInput(_0x1d7fe5,_0x3b8105,_0x531312),_0x156b21=await withSpinner(_0x5065ae(0x1ad),()=>_0x531312['journey'][_0x5065ae(0x1cd)](_0x4edd84),{'verbose':_0x3b8105[_0x5065ae(0x203)]}),_0x2e9ef7=_0x156b21[_0x5065ae(0x16e)];return console[_0x5065ae(0x174)](_0x5065ae(0x1eb)+_0x2e9ef7[_0x5065ae(0x225)]),console[_0x5065ae(0x174)](_0x5065ae(0x235)+_0x2e9ef7[_0x5065ae(0x1ca)]),await handleSDKOutput(_0x2e9ef7['columns'],_0x3b8105),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x389c24(0x1f2)]='journey:activations';[a27_0x389c24(0x182)]=a27_0x389c24(0x219);async[a27_0x389c24(0x172)](_0x58e823){const _0x63e3e5=a27_0x389c24,{options:_0x5a2386,args:_0x59928c,tdx:_0x44d853}=_0x58e823,_0x1f3b5c=_0x59928c[0x0];if(!requireNameOrPath(_0x1f3b5c))return 0x1;_0x5a2386[_0x63e3e5(0x203)]&&console[_0x63e3e5(0x212)](_0x63e3e5(0x135)+_0x1f3b5c);const {journeyId:_0x1217c7}=await resolveJourneyIdFromInput(_0x1f3b5c,_0x5a2386,_0x44d853),_0x569ffb=await withSpinner(_0x63e3e5(0x1f9),()=>_0x44d853[_0x63e3e5(0x180)][_0x63e3e5(0x1cc)](_0x1217c7),{'verbose':_0x5a2386['verbose']}),_0xc872ca=_0x569ffb[_0x63e3e5(0x16e)];return console[_0x63e3e5(0x212)](_0x63e3e5(0x208)+_0xc872ca[_0x63e3e5(0x159)]+_0x63e3e5(0x1e3)+(_0xc872ca[_0x63e3e5(0x159)]!==0x1?'s':'')),await handleSDKOutput(_0xc872ca,_0x5a2386),0x0;}}export class JourneyPushCommand extends BaseCommand{['name']=a27_0x389c24(0x18d);[a27_0x389c24(0x182)]=a27_0x389c24(0x188);[a27_0x389c24(0x141)]=new SegmentPushCommand();async['execute'](_0x115dff){const _0x1ff9ad=a27_0x389c24,_0x4c977d=_0x115dff[_0x1ff9ad(0x160)][0x0];let _0x406ed0;if(_0x4c977d){const _0x3475e0=await resolveTarget({'arg':_0x4c977d,'contextParent':_0x115dff[_0x1ff9ad(0x22b)]['parentSegment'],'cwd':process[_0x1ff9ad(0x236)]()});isSuccessfulResolution(_0x3475e0)&&_0x3475e0[_0x1ff9ad(0x152)]===_0x1ff9ad(0x20c)&&(_0x406ed0=_0x3475e0[_0x1ff9ad(0x1ba)]);}const _0x283588={..._0x115dff,'options':{..._0x115dff[_0x1ff9ad(0x22b)],'journeysOnly':!![],..._0x406ed0&&{'singleFilePath':_0x406ed0}}};return this['segmentPushCommand'][_0x1ff9ad(0x172)](_0x283588);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x389c24(0x1f2)]='journey:versions';[a27_0x389c24(0x182)]=a27_0x389c24(0x21d);async[a27_0x389c24(0x172)](_0x575dce){const _0x555f59=a27_0x389c24,{options:_0x12d8a6,args:_0xbf3382,tdx:_0x252ec3}=_0x575dce,_0x51ab13=_0xbf3382[0x0];if(!requireNameOrPath(_0x51ab13))return 0x1;if(_0x12d8a6[_0x555f59(0x203)])console['error'](_0x555f59(0x135)+_0x51ab13);const {journeyId:_0x19faff}=await resolveJourneyIdFromInput(_0x51ab13,_0x12d8a6,_0x252ec3),_0x75b500=await withSpinner('Listing\x20journey\x20versions...',()=>_0x252ec3[_0x555f59(0x180)][_0x555f59(0x1f7)](_0x19faff),{'verbose':_0x12d8a6[_0x555f59(0x203)]}),{bundleName:_0x17e765,versions:_0x259794,latestJourneyId:_0x1d3057}=_0x75b500['data'];console[_0x555f59(0x212)](_0x17e765+':\x20'+_0x259794[_0x555f59(0x159)]+_0x555f59(0x157)+(_0x259794['length']!==0x1?'s':''));const _0x41de46=_0x259794[_0x555f59(0x136)](_0x315eac=>({'version':_0x315eac[_0x555f59(0x14f)],'journey_id':_0x315eac[_0x555f59(0x171)],'name':_0x315eac[_0x555f59(0x1f2)],'state':_0x315eac['state'],'paused':_0x315eac['paused'],'latest':_0x315eac[_0x555f59(0x171)]===_0x1d3057,'created_at':_0x315eac['createdAt']}));return await handleSDKOutput(_0x41de46,_0x12d8a6),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a27_0x389c24(0x1f2)]=a27_0x389c24(0x19d);[a27_0x389c24(0x182)]=a27_0x389c24(0x216);async[a27_0x389c24(0x172)](_0x59f6e5){const _0x485917=a27_0x389c24,{options:_0x5a57bf,args:_0x3a4e31,tdx:_0x14b6e4}=_0x59f6e5,_0x51fe19=_0x3a4e31[0x0];if(!requireNameOrPath(_0x51fe19))return 0x1;if(_0x5a57bf[_0x485917(0x203)])console[_0x485917(0x212)](_0x485917(0x135)+_0x51fe19);const {journeyId:_0x303762,journeyName:_0x45ed64}=await resolveJourneyIdFromInput(_0x51fe19,_0x5a57bf,_0x14b6e4);if(!_0x5a57bf[_0x485917(0x130)]){const _0x5dbb66=await confirm(_0x485917(0x19f)+_0x45ed64+'\x22?');if(!_0x5dbb66)return console['error']('Cancelled'),0x0;}const _0x378ac3=await withSpinner(_0x485917(0x158),()=>_0x14b6e4[_0x485917(0x180)][_0x485917(0x1a2)](_0x303762),{'verbose':_0x5a57bf[_0x485917(0x203)]}),_0xb39362=_0x378ac3[_0x485917(0x16e)];return console['error'](a27_0x25db00[_0x485917(0x1e8)]('✔')+'\x20Created\x20v'+_0xb39362['attributes']['versionNumber']+_0x485917(0x1bd)+_0xb39362[_0x485917(0x221)][_0x485917(0x1f2)]+'\x22'),console[_0x485917(0x212)](_0x485917(0x1b6)+_0xb39362['id']),await handleSingleObjectOutput({'id':_0xb39362['id'],'name':_0xb39362[_0x485917(0x221)][_0x485917(0x1f2)],'version':_0xb39362[_0x485917(0x221)][_0x485917(0x14f)],'state':_0xb39362[_0x485917(0x221)]['state'],'bundle_id':_0xb39362[_0x485917(0x221)][_0x485917(0x22a)],'created_at':_0xb39362[_0x485917(0x221)][_0x485917(0x230)]},_0x5a57bf),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']=a27_0x389c24(0x17c);[a27_0x389c24(0x182)]=a27_0x389c24(0x239);async[a27_0x389c24(0x172)](_0x51064d){const _0x200119=a27_0x389c24,{options:_0x1d8032,args:_0x46edf6,tdx:_0x53b394}=_0x51064d,_0xff004f=_0x46edf6[0x0];if(!requireNameOrPath(_0xff004f))return 0x1;const _0x3b18cf=_0x1d8032[_0x200119(0x22c)];if(!_0x3b18cf)return console[_0x200119(0x212)](_0x200119(0x1f1)),console[_0x200119(0x212)](_0x200119(0x131)),0x1;const _0x1ac7d5=parseInt(_0x3b18cf,0xa);if(isNaN(_0x1ac7d5)||_0x1ac7d5<0x1)return console[_0x200119(0x212)](_0x200119(0x237)+_0x3b18cf),0x1;if(_0x1d8032[_0x200119(0x203)])console[_0x200119(0x212)](_0x200119(0x135)+_0xff004f+_0x200119(0x209)+_0x1ac7d5);const {journeyId:_0x2c362f,parentSegmentId:_0x497b61}=await resolveJourneyIdFromInput(_0xff004f,_0x1d8032,_0x53b394),_0x3de0f3=await withSpinner(_0x200119(0x1fb),()=>_0x53b394[_0x200119(0x180)]['listVersions'](_0x2c362f),{'verbose':_0x1d8032[_0x200119(0x203)]}),{versions:_0x4dc241,latestJourneyId:_0x487bc4}=_0x3de0f3[_0x200119(0x16e)],_0x747008=_0x4dc241[_0x200119(0x1d1)](_0x1c5e49=>_0x1c5e49[_0x200119(0x14f)]===_0x1ac7d5);if(!_0x747008){const _0x364ba8=_0x4dc241[_0x200119(0x136)](_0x5ece9a=>'v'+_0x5ece9a[_0x200119(0x14f)])[_0x200119(0x1e1)](',\x20');return console[_0x200119(0x212)](_0x200119(0x162)+_0x1ac7d5+_0x200119(0x1a7)+_0x364ba8),0x1;}const _0x3f996d=await withSpinner(_0x200119(0x1f3)+_0x1ac7d5+_0x200119(0x21f),()=>_0x53b394[_0x200119(0x180)][_0x200119(0x207)](_0x747008['journeyId']),{'verbose':_0x1d8032[_0x200119(0x203)]}),_0x474253=_0x3f996d[_0x200119(0x16e)],_0x497ead=getConsoleNextUrl(_0x1d8032[_0x200119(0x223)],_0x200119(0x175)+_0x497b61+_0x200119(0x1e6)+_0x747008[_0x200119(0x171)]+_0x200119(0x132));return await handleSingleObjectOutput({'id':_0x474253['id'],'name':_0x474253['attributes'][_0x200119(0x1f2)],'version':_0x474253[_0x200119(0x221)][_0x200119(0x14f)],'description':_0x474253[_0x200119(0x221)][_0x200119(0x182)],'state':_0x474253[_0x200119(0x221)][_0x200119(0x183)],'paused':_0x474253[_0x200119(0x221)]['paused'],'reentry_mode':_0x474253['attributes'][_0x200119(0x1df)],'stages':_0x474253[_0x200119(0x221)][_0x200119(0x17b)]?.[_0x200119(0x159)]||0x0,..._0x474253[_0x200119(0x221)][_0x200119(0x201)]&&{'goal':_0x474253[_0x200119(0x221)][_0x200119(0x201)]['name']},'latest':_0x747008[_0x200119(0x171)]===_0x487bc4,'created_at':_0x474253['attributes'][_0x200119(0x230)],'updated_at':_0x474253[_0x200119(0x221)][_0x200119(0x16a)],'url':_0x497ead},_0x1d8032),0x0;}}
1
+ const a27_0x3d26ae=a27_0x2150;(function(_0xacad7c,_0x36d645){const _0x431c28=a27_0x2150,_0xd7a9fb=_0xacad7c();while(!![]){try{const _0x37b6c3=parseInt(_0x431c28(0x13d))/0x1*(-parseInt(_0x431c28(0x1af))/0x2)+parseInt(_0x431c28(0x1a5))/0x3+parseInt(_0x431c28(0x17e))/0x4*(-parseInt(_0x431c28(0x154))/0x5)+-parseInt(_0x431c28(0x18f))/0x6*(-parseInt(_0x431c28(0x1d4))/0x7)+parseInt(_0x431c28(0x144))/0x8+-parseInt(_0x431c28(0x164))/0x9*(-parseInt(_0x431c28(0x153))/0xa)+parseInt(_0x431c28(0x17b))/0xb;if(_0x37b6c3===_0x36d645)break;else _0xd7a9fb['push'](_0xd7a9fb['shift']());}catch(_0x6e1afe){_0xd7a9fb['push'](_0xd7a9fb['shift']());}}}(a27_0x117b,0xcc54d));import a27_0x36bf62 from'chalk';import a27_0x745048 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';function a27_0x2150(_0x1fdd06,_0x3e5995){_0x1fdd06=_0x1fdd06-0xfb;const _0x117b3b=a27_0x117b();let _0x215037=_0x117b3b[_0x1fdd06];return _0x215037;}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(_0x1d031b){const _0x18c68=a27_0x2150;return!_0x1d031b&&(console[_0x18c68(0x14b)](_0x18c68(0x19e)),console['error']('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x1d031b;}function withJsonFormat(_0x2da335){const _0x31e27f=a27_0x2150;if(!_0x2da335[_0x31e27f(0x143)]&&!_0x2da335[_0x31e27f(0x1b7)]&&!_0x2da335[_0x31e27f(0x148)]&&!_0x2da335[_0x31e27f(0x108)])return{..._0x2da335,'format':_0x31e27f(0x1b7),'json':!![]};return _0x2da335;}function formatJourneyState(_0x42b868){const _0x538b2f=a27_0x2150;switch(_0x42b868){case _0x538b2f(0x188):return a27_0x36bf62[_0x538b2f(0x1f5)]('(running)');case _0x538b2f(0x171):return a27_0x36bf62[_0x538b2f(0x10c)](_0x538b2f(0x1bc));case'paused':return a27_0x36bf62[_0x538b2f(0x18c)](_0x538b2f(0x109));case _0x538b2f(0x13b):return a27_0x36bf62['blue'](_0x538b2f(0x1a0));case _0x538b2f(0x166):return a27_0x36bf62[_0x538b2f(0x10c)]('(archived)');default:return'('+_0x42b868+')';}}function formatJourneyItem(_0xd8f4de,_0x1124ee='',_0x1e62af){const _0x569873=a27_0x2150,_0x181566=formatJourneyState(_0xd8f4de[_0x569873(0x1f0)]),_0x306138=_0x1e62af?hyperlink(_0xd8f4de[_0x569873(0x17d)],_0x1e62af):_0xd8f4de[_0x569873(0x17d)];return _0x1124ee+_0x569873(0x111)+_0x306138+'\x20'+_0x181566;}function escapeRegex(_0x2d9e46){const _0x3ff062=a27_0x2150;return _0x2d9e46['replace'](/[.*+?^${}()|[\]\\]/g,_0x3ff062(0x14c));}function globToRegex(_0x50b613){const _0x22e416=a27_0x2150,_0x569685=_0x50b613['split']('*')[_0x22e416(0x150)](escapeRegex);return new RegExp(_0x569685[_0x22e416(0x134)]('.*'),'i');}function buildRuleToNameMapping(_0x151a9a){const _0x143c0d=a27_0x2150,_0x4d3efd=new Map();if(_0x151a9a[_0x143c0d(0x1c9)])for(const [_0x23b083,_0x32908a]of Object['entries'](_0x151a9a[_0x143c0d(0x1c9)])){if(_0x32908a['rule']){const _0x86e96=serializeRule(_0x32908a['rule']),_0x12f6ad=_0x4d3efd[_0x143c0d(0x173)](_0x86e96);_0x12f6ad?_0x12f6ad['push'](_0x23b083):_0x4d3efd['set'](_0x86e96,[_0x23b083]);}}return _0x4d3efd;}async function resolveJourneyIdFromInput(_0x11dee6,_0x477e70,_0x119ce0){const _0x38e224=a27_0x2150,_0x256615=await resolveJourneyTarget(_0x11dee6,_0x477e70[_0x38e224(0x1ec)],_0x477e70[_0x38e224(0x1e3)]),_0x4f39a2=_0x256615[_0x38e224(0x1ec)];if(!_0x4f39a2)throw new SDKError(ErrorCode[_0x38e224(0x1db)],_0x38e224(0x162));const _0x1cff55=await withSpinner(_0x38e224(0x1e2),()=>_0x119ce0[_0x38e224(0x1aa)][_0x38e224(0x13a)](_0x4f39a2),{'verbose':_0x477e70[_0x38e224(0x1e3)]}),_0x5ac3ca=_0x1cff55['data'],_0x57dd5b=await withSpinner(_0x38e224(0x1c3),()=>_0x119ce0[_0x38e224(0x15c)][_0x38e224(0x106)](_0x5ac3ca,_0x256615[_0x38e224(0x189)]),{'verbose':_0x477e70[_0x38e224(0x1e3)]});return{'journeyId':_0x57dd5b['data'],'journeyName':_0x256615[_0x38e224(0x189)],'parentSegmentId':_0x5ac3ca};}async function resolveJourneyTarget(_0x17f8fb,_0x1a432d,_0x3c6bd9){const _0x505ba2=a27_0x2150;if(isYamlFilePath(_0x17f8fb))try{const _0x455614=await resolveYamlFilePath(_0x17f8fb);return _0x3c6bd9&&(console[_0x505ba2(0x14b)](_0x505ba2(0x1fc)+_0x17f8fb),console[_0x505ba2(0x14b)](_0x505ba2(0x198)+_0x455614[_0x505ba2(0x1ec)]),console[_0x505ba2(0x14b)](_0x505ba2(0x176)+_0x455614[_0x505ba2(0x205)]),console['error']('\x20\x20Folder\x20path:\x20'+(_0x455614[_0x505ba2(0x104)]||_0x505ba2(0x137)))),{'journeyName':_0x455614[_0x505ba2(0x205)],'parentSegment':_0x455614['parentSegment'],'resolved':_0x455614};}catch(_0x4d220d){throw new SDKError(ErrorCode[_0x505ba2(0x1db)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x4d220d[_0x505ba2(0x1a6)]);}if(!_0x1a432d)throw new SDKError(ErrorCode[_0x505ba2(0x1db)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x17f8fb,'parentSegment':_0x1a432d};}function a27_0x117b(){const _0x534858=['96022xMFrXa','journey:traffic','Getting\x20column\x20mapping...','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Cancelled','\x20\x20Preserving\x20local\x20segment\x20name:\x20','format','6590976RzjGSM','stageNameMap','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','args','jsonl','Database:\x20','relative','error','\x5c$&','Show\x20journey\x20table\x20column\x20mapping','Error:\x20Journey\x20\x27','file','map','stringify','then','10ALVIwU','220lRxOel','no_parent','resolveSegment','yes','session','values','utf-8','Parent\x20segment:\x20','journey','Warning:\x20Could\x20not\x20resolve\x20segment\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','journeyStages','kind','Resuming\x20journey...','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','find','4778523afuWIe','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','archived','createdAt','Error:\x20','hasChanges','journey:version:create','getJourney','buildIdToEmailMap','✔\x20Journey\x20\x22','\x0aError:','cwd','\x20(ID:\x20','draft','/app/ps/','get','version','set','\x20\x20Name:\x20','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','listJourneysFromParentSegment','folderId','\x20Opening\x20','7212667DSZldB','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)','journeyBundleName','93344frLlDp','✔\x20Found\x20','Error:\x20Version\x20','Input:\x20','Creating\x20new\x20version...','Found\x20','base','buildIdToNameMap','localeCompare','description','launched','journeyName','No\x20journeys\x20found','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','yellow','Error:\x20Stage\x20\x22','pause','1734168hRiFSW','web','size','/j/da/je','activation','journey:version:view','\x27\x20not\x20found\x20in\x20','getTrafficData','Pattern:\x20','\x20\x20Parent\x20segment:\x20','Fetching\x20journeys\x20and\x20folders...','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','resume','Available\x20stages:\x20','journey:pause','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','Write\x20','(completed)','\x22\x20resumed','conversion','targetDir','completionRate','2149335kPIqKz','message','journey:columns','limit','rule','segment','reentryMode','site','journey:push','listActivationsFlat','24TxuEnS','includeHistory','resourceName','✔\x20Pulled\x20','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','database','\x20=\x20','content','json','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','options','paused','Show\x20journey\x20details','(draft)','all','\x20version','/e/','\x20versions)','journey:activations','\x20Created\x20v','Resolving\x20journey...','journeyId','push','attributes','cyan','tdx.json','segments','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','\x20not\x20found.\x20Available:\x20','rootFolderId','has','Show\x20journey\x20statistics','enteredSize','sort','helpText','Folder\x20path:\x20','Getting\x20journey\x20details...','7sToDMa','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','listJourneysWithFolders','segmentPushCommand','List\x20journeys\x20in\x20current\x20context','repeat','versionNumber','INVALID_ARGUMENT','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','red','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','relativePath','journey:versions','from','Resolving\x20parent\x20segment...','verbose','folders','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','goalSize','entries','\x20details...','\x20journeys','\x0aChanges\x20to\x20\x27','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','parentSegment','List\x20activations\x20for\x20a\x20journey','renderStats','Fetching\x20','state','updatedAt','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','getActivation',',\x20version:\x20','green','bold','Warning:\x20Could\x20not\x20resolve\x20activation\x20','Listing\x20journey\x20activations...','journey:view','/j/da','stages','Resolved\x20YAML\x20file:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','createVersion','listFolders','Error:\x20Invalid\x20version\x20number:\x20','goal','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','Target\x20directory:\x20','journeyBundleId','segmentName','Options:','Getting\x20journey\x20traffic\x20data...','\x20\x20Consolidating\x20duplicate\x20segment:\x20','name','columns','links','milestoneSize','Error:\x20Invalid\x20--type\x20\x22','getSegment','type','execute','history','folderPath','-\x20no\x20files\x20written','resolveJourneyId','\x20\x20Target:\x20','tsv','(paused)','absolutePath','\x20activation','dim','exitOrJumpRate','dryRun','isNew','Getting\x20journey\x20statistics...','🗺️\x20','parent_segment','getLatestJourneyId','Resume\x20a\x20paused\x20journey','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Pause\x20a\x20running\x20journey','toLowerCase','Error:\x20Journey\x20not\x20found:\x20','data','filter','journey:resume','connection','\x20(draft)\x20—\x20\x22','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Target\x20file:\x20','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','\x20(rule\x20match)','Fetching\x20parent\x20segment...','✔\x20Context\x20set:\x20','user','includeStats','connector_config','table','add','root\x20folder','length','test','listVersions','No\x20statistics\x20available\x20for\x20journey:\x20','.yml','\x20\x20-\x20','log','journeys','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','View\x20a\x20specific\x20version\x20of\x20a\x20journey','join','\x22\x20not\x20found','Journey\x20name:\x20','(root)','getColumnMapping','getStatistics','resolveParentId','completed','hasPeriod'];a27_0x117b=function(){return _0x534858;};return a27_0x117b();}export class JourneyListCommand extends BaseCommand{[a27_0x3d26ae(0xfb)]='journey:list';[a27_0x3d26ae(0x187)]=a27_0x3d26ae(0x1d8);async['execute'](_0x54a925){const _0xb4119c=a27_0x3d26ae,{options:_0x5d8dfa,args:_0xaf4adb,tdx:_0x2c3e23}=_0x54a925,_0x3d2ae7=_0xaf4adb[0x0],_0x5beb08=_0x5d8dfa[_0xb4119c(0x1ec)];if(!_0x5beb08)return console[_0xb4119c(0x14b)]('Error:\x20Parent\x20segment\x20context\x20required'),console['error']('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x3a4fd3=await withSpinner(_0xb4119c(0x1e2),()=>_0x2c3e23[_0xb4119c(0x1aa)][_0xb4119c(0x13a)](_0x5beb08),{'verbose':_0x5d8dfa[_0xb4119c(0x1e3)]}),_0x48376c=_0x3a4fd3[_0xb4119c(0x119)];_0x5d8dfa[_0xb4119c(0x1e3)]&&(console[_0xb4119c(0x14b)](_0xb4119c(0x15b)+_0x5beb08+_0xb4119c(0x170)+_0x48376c+')'),_0x3d2ae7&&console[_0xb4119c(0x14b)](_0xb4119c(0x197)+_0x3d2ae7));const _0x816aa0=await withSpinner(_0xb4119c(0x122),()=>_0x2c3e23[_0xb4119c(0x1aa)]['getParentFull'](_0x48376c),{'verbose':_0x5d8dfa['verbose']}),_0x121518=_0x816aa0[_0xb4119c(0x119)],_0x5a80a5=_0x121518[_0xb4119c(0x1cc)],_0x4adcf4=await withSpinner('Listing\x20journeys...',()=>_0x2c3e23[_0xb4119c(0x15c)][_0xb4119c(0x1d6)](_0x48376c,_0x5a80a5),{'verbose':_0x5d8dfa[_0xb4119c(0x1e3)]});let _0x3c745e=_0x4adcf4[_0xb4119c(0x119)][_0xb4119c(0x131)];const _0x16882b=_0x4adcf4['data'][_0xb4119c(0x1e4)],_0x50808b=new Map();for(const _0x278723 of _0x16882b){_0x50808b[_0xb4119c(0x175)](_0x278723['id'],_0x278723[_0xb4119c(0xfb)]);}if(_0x3d2ae7){const _0x59dd67=globToRegex(_0x3d2ae7);_0x3c745e=_0x3c745e[_0xb4119c(0x11a)](_0x543638=>_0x59dd67[_0xb4119c(0x12b)](_0x543638['journeyBundleName']));}console['error'](_0xb4119c(0x17f)+_0x3c745e['length']+'\x20journey'+(_0x3c745e['length']!==0x1?'s':''));const _0x2f9d08=_0x1182f1=>{const _0x4ea209=_0xb4119c;return getConsoleNextUrl(_0x5d8dfa['site'],'/app/ps/'+_0x48376c+_0x4ea209(0x1bf)+_0x1182f1+_0x4ea209(0x1fa));};if(_0x5d8dfa['format']===_0xb4119c(0x127))await handleSDKOutput(_0x3c745e,_0x5d8dfa);else{if(_0x5d8dfa[_0xb4119c(0x143)]===_0xb4119c(0x1b7)){const _0x3dc36c=_0x3c745e['map'](_0x409eff=>({..._0x409eff,'url':_0x2f9d08(_0x409eff['id'])}));await handleSDKOutput(_0x3dc36c,_0x5d8dfa);}else{console[_0xb4119c(0x130)]('['+_0x5beb08+']');const _0x4e8cc6=new Map(),_0x41598b=[];for(const _0x4a4b99 of _0x3c745e){if(!_0x4a4b99['folderId']||_0x4a4b99['folderId']===_0x5a80a5)_0x41598b[_0xb4119c(0x1c5)](_0x4a4b99);else{const _0x324cda=_0x4e8cc6['get'](_0x4a4b99['folderId'])||[];_0x324cda[_0xb4119c(0x1c5)](_0x4a4b99),_0x4e8cc6[_0xb4119c(0x175)](_0x4a4b99['folderId'],_0x324cda);}}const _0x31d707=(_0x5edf5e,_0x6aafb8)=>_0x5edf5e['journeyBundleName']['localeCompare'](_0x6aafb8[_0xb4119c(0x17d)],undefined,{'sensitivity':_0xb4119c(0x184)});_0x41598b[_0xb4119c(0x1d0)](_0x31d707);for(const _0x42159a of _0x41598b){console[_0xb4119c(0x130)](formatJourneyItem(_0x42159a,'',_0x2f9d08(_0x42159a['id'])));}const _0x223a05=[..._0x4e8cc6[_0xb4119c(0x1e7)]()][_0xb4119c(0x1d0)]((_0x9458f7,_0x1c2bf0)=>{const _0x198f93=_0xb4119c,_0x35f641=_0x50808b['get'](_0x9458f7[0x0])||_0x9458f7[0x0],_0x44378e=_0x50808b[_0x198f93(0x173)](_0x1c2bf0[0x0])||_0x1c2bf0[0x0];return _0x35f641[_0x198f93(0x186)](_0x44378e,undefined,{'sensitivity':_0x198f93(0x184)});});for(const [_0x35f46a,_0x1e87f5]of _0x223a05){const _0x53614f=_0x50808b[_0xb4119c(0x173)](_0x35f46a)||_0x35f46a;console[_0xb4119c(0x130)]('📁\x20'+_0x53614f),_0x1e87f5[_0xb4119c(0x1d0)](_0x31d707);for(const _0x3b3a02 of _0x1e87f5){console['log'](formatJourneyItem(_0x3b3a02,'\x20\x20',_0x2f9d08(_0x3b3a02['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a27_0x3d26ae(0xfb)]=a27_0x3d26ae(0x1f9);['description']=a27_0x3d26ae(0x1bb);async[a27_0x3d26ae(0x102)](_0x30b336){const _0x6350a2=a27_0x3d26ae,{options:_0x129434,args:_0x26658b,tdx:_0x73e9cb}=_0x30b336,_0x6b77c8=_0x26658b[0x0];if(!_0x6b77c8)return console[_0x6350a2(0x14b)](_0x6350a2(0x19e)),console['error'](_0x6350a2(0x146)),console[_0x6350a2(0x14b)](_0x6350a2(0x206)),console[_0x6350a2(0x14b)](_0x6350a2(0x1eb)),0x1;_0x129434[_0x6350a2(0x1e3)]&&console[_0x6350a2(0x14b)](_0x6350a2(0x181)+_0x6b77c8);const {journeyId:_0x55c476,parentSegmentId:_0xac8857}=await resolveJourneyIdFromInput(_0x6b77c8,_0x129434,_0x73e9cb);if(_0x129434[_0x6350a2(0x190)]){const _0x1906e7=getConsoleNextUrl(_0x129434['site'],_0x6350a2(0x172)+_0xac8857+_0x6350a2(0x1bf)+_0x55c476+'/j/da/je');return console[_0x6350a2(0x14b)](a27_0x36bf62['green']('✔')+_0x6350a2(0x17a)+a27_0x36bf62[_0x6350a2(0x1c7)](_0x1906e7)),openBrowser(_0x1906e7),0x0;}const _0x3fd26d=await withSpinner(_0x6350a2(0x1d3),()=>_0x73e9cb[_0x6350a2(0x15c)][_0x6350a2(0x16b)](_0x55c476),{'verbose':_0x129434['verbose']}),_0x19ec39=_0x3fd26d[_0x6350a2(0x119)],_0x75071=_0x129434[_0x6350a2(0x125)];let _0x209027;if(_0x75071)try{const _0x5b0449=await withSpinner(_0x6350a2(0x110),()=>_0x73e9cb['journey']['getStatistics'](_0x55c476),{'verbose':_0x129434[_0x6350a2(0x1e3)]});_0x209027=_0x5b0449[_0x6350a2(0x119)];}catch{_0x129434['verbose']&&console[_0x6350a2(0x14b)]('\x20\x20Statistics\x20not\x20available');}const _0x15620b=getConsoleNextUrl(_0x129434[_0x6350a2(0x1ac)],_0x6350a2(0x172)+_0xac8857+_0x6350a2(0x1bf)+_0x55c476+_0x6350a2(0x192)),_0x503585={'id':_0x19ec39['id'],'name':_0x19ec39[_0x6350a2(0x1c6)][_0x6350a2(0xfb)],'description':_0x19ec39[_0x6350a2(0x1c6)][_0x6350a2(0x187)],'state':_0x19ec39['attributes'][_0x6350a2(0x1f0)],'paused':_0x19ec39[_0x6350a2(0x1c6)][_0x6350a2(0x1ba)],'reentry_mode':_0x19ec39['attributes'][_0x6350a2(0x1ab)],'stages':_0x19ec39[_0x6350a2(0x1c6)][_0x6350a2(0x15f)]?.[_0x6350a2(0x12a)]||0x0,..._0x19ec39[_0x6350a2(0x1c6)][_0x6350a2(0x201)]&&{'goal':_0x19ec39['attributes'][_0x6350a2(0x201)]['name']},..._0x209027&&{'statistics':{'size':_0x209027[_0x6350a2(0x191)],'entered':_0x209027[_0x6350a2(0x1cf)],'goal_achieved':_0x209027[_0x6350a2(0x1e6)],'completion_rate':_0x209027[_0x6350a2(0x1a4)],'exit_or_jump':_0x209027['exitOrJumpSize'],'exit_or_jump_rate':_0x209027[_0x6350a2(0x10d)],'stages':_0x209027['stages']}},'url':_0x15620b};return await handleSingleObjectOutput(_0x503585,_0x129434),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a27_0x3d26ae(0xfb)]='journey:stats';['description']=a27_0x3d26ae(0x1ce);async[a27_0x3d26ae(0x102)](_0x31a7f9){const _0x16ed56=a27_0x3d26ae,{options:_0x1fd87b,args:_0x28bc6b,tdx:_0x2d9afe}=_0x31a7f9,_0x2ec8c1=_0x28bc6b[0x0];if(!requireNameOrPath(_0x2ec8c1))return 0x1;_0x1fd87b[_0x16ed56(0x1e3)]&&console['error'](_0x16ed56(0x181)+_0x2ec8c1);const _0x43187e=_0x1fd87b,_0x3d6120=_0x43187e[_0x16ed56(0x1e1)],_0x5d5f7d=_0x43187e['to'],_0x46c04e=_0x43187e[_0x16ed56(0x1b0)],_0x4debfb=_0x43187e['stage'];_0x46c04e&&!_0x3d6120&&!_0x5d5f7d&&console[_0x16ed56(0x14b)](_0x16ed56(0x1d5));const _0x326bd3=_0x46c04e?withJsonFormat(_0x1fd87b):_0x1fd87b,{journeyId:_0x2a1007,journeyName:_0x3263e1}=await resolveJourneyIdFromInput(_0x2ec8c1,_0x326bd3,_0x2d9afe),_0x47a473=_0x3d6120||_0x5d5f7d?{'from':_0x3d6120,'to':_0x5d5f7d}:undefined,_0x5df003=await withSpinner(_0x16ed56(0x110),()=>Promise[_0x16ed56(0x1bd)]([_0x2d9afe[_0x16ed56(0x15c)][_0x16ed56(0x16b)](_0x2a1007),_0x2d9afe['journey'][_0x16ed56(0x139)](_0x2a1007,_0x47a473)]),{'verbose':_0x326bd3['verbose']}),[_0x49ac73,_0x20d9a1]=_0x5df003[_0x16ed56(0x119)];if(!_0x20d9a1||_0x20d9a1[_0x16ed56(0x1c4)]===null)return console[_0x16ed56(0x14b)](_0x16ed56(0x12d)+_0x3263e1),console[_0x16ed56(0x14b)](_0x16ed56(0x140)),0x0;const _0x4bf2f9=buildStageNameMap(_0x49ac73),_0x3a4f94=!!(_0x47a473&&_0x20d9a1['history']?.[_0x16ed56(0x12a)]),_0x461d80={'stageNameMap':_0x4bf2f9,'hasPeriod':_0x3a4f94,'includeHistory':!!_0x46c04e};if(_0x4debfb&&_0x20d9a1['stages']){const _0x1e65d2=_0x20d9a1['stages'][_0x16ed56(0x163)](_0x41f8cd=>{const _0x2d67fc=_0x16ed56,_0x11239d=_0x4bf2f9['get'](_0x41f8cd['id'])??'';return _0x11239d[_0x2d67fc(0x117)]()===_0x4debfb[_0x2d67fc(0x117)]();});if(_0x1e65d2)return await handleSingleObjectOutput(formatStageStats(_0x1e65d2,_0x461d80),_0x326bd3),0x0;const _0x2aa95d=_0x20d9a1[_0x16ed56(0x1fb)][_0x16ed56(0x150)](_0x3033d7=>_0x4bf2f9['get'](_0x3033d7['id'])??_0x3033d7['id']);return console[_0x16ed56(0x14b)](_0x16ed56(0x18d)+_0x4debfb+_0x16ed56(0x135)),console[_0x16ed56(0x14b)](_0x16ed56(0x19c)+_0x2aa95d[_0x16ed56(0x134)](',\x20')),0x1;}const _0x53b581=_0x20d9a1[_0x16ed56(0x1fb)]?.[_0x16ed56(0x150)](_0x170ea2=>formatStageStats(_0x170ea2,_0x461d80)),_0x46fa3a=assembleJourneyStats(_0x20d9a1,{'from':_0x3d6120,'to':_0x5d5f7d,'includeHistory':_0x46c04e});return await this[_0x16ed56(0x1ee)](_0x46fa3a,_0x53b581??[],_0x326bd3),0x0;}async[a27_0x3d26ae(0x1ee)](_0x532c58,_0x5168e1,_0x5c5f81){const _0x2de5b2=a27_0x3d26ae,_0x15abb6=_0x5c5f81[_0x2de5b2(0x143)]===_0x2de5b2(0x1b7)||_0x5c5f81[_0x2de5b2(0x143)]===_0x2de5b2(0x148)||_0x5c5f81[_0x2de5b2(0x1b7)]||_0x5c5f81[_0x2de5b2(0x148)];if(_0x15abb6){_0x532c58[_0x2de5b2(0x1fb)]=_0x5168e1,await handleSingleObjectOutput(_0x532c58,_0x5c5f81);return;}await handleSingleObjectOutput(_0x532c58,_0x5c5f81);for(const _0x53f0de of _0x5168e1){console['log'](''),console[_0x2de5b2(0x130)](String(a27_0x36bf62[_0x2de5b2(0x1c7)][_0x2de5b2(0x1f6)]('['+_0x53f0de['name']+']'))+a27_0x36bf62[_0x2de5b2(0x10c)]('\x20'+_0x53f0de['id']));const {id:_0x281ea9,name:_0x276b94,..._0x49d5df}=_0x53f0de;await handleSingleObjectOutput(_0x49d5df,_0x5c5f81);}}}export class JourneyTrafficCommand extends BaseCommand{[a27_0x3d26ae(0xfb)]=a27_0x3d26ae(0x13e);['description']=a27_0x3d26ae(0x120);async['execute'](_0x34ec9f){const _0x10a549=a27_0x3d26ae,{options:_0xfe6344,args:_0x40abf7,tdx:_0x310f69}=_0x34ec9f,_0x2b3110=_0x40abf7[0x0];if(!requireNameOrPath(_0x2b3110))return 0x1;_0xfe6344['verbose']&&console[_0x10a549(0x14b)](_0x10a549(0x181)+_0x2b3110);const _0x49dc6f=_0xfe6344,_0x320e65=_0x49dc6f['type'],_0x315ef6=_0x49dc6f[_0x10a549(0x1e1)],_0x26d548=_0x49dc6f['to'],_0x55d7ce=_0x49dc6f[_0x10a549(0x1a8)];if(_0x320e65&&_0x320e65!==_0x10a549(0x1a2)&&_0x320e65!==_0x10a549(0x193))return console[_0x10a549(0x14b)](_0x10a549(0xff)+_0x320e65+_0x10a549(0x165)),0x1;const _0x4e5f22=withJsonFormat(_0xfe6344),{journeyId:_0x45676d,journeyName:_0x147b5f}=await resolveJourneyIdFromInput(_0x2b3110,_0x4e5f22,_0x310f69),_0x9f702d={'type':_0x320e65,'from':_0x315ef6,'to':_0x26d548,'limit':_0x55d7ce},_0x32c187=await withSpinner(_0x10a549(0x207),()=>_0x310f69[_0x10a549(0x15c)][_0x10a549(0x196)](_0x45676d,_0x9f702d),{'verbose':_0x4e5f22['verbose']}),_0x5316f2=_0x32c187[_0x10a549(0x119)],_0x542e56=_0x5316f2[_0x10a549(0x1a2)]&&(_0x5316f2[_0x10a549(0x1a2)]['nodes'][_0x10a549(0x12a)]>0x0||_0x5316f2[_0x10a549(0x1a2)][_0x10a549(0xfd)][_0x10a549(0x12a)]>0x0),_0x4183e5=_0x5316f2[_0x10a549(0x193)]&&_0x5316f2[_0x10a549(0x193)][_0x10a549(0x12a)]>0x0;if(!_0x542e56&&!_0x4183e5)return console[_0x10a549(0x14b)](_0x10a549(0x1dc)+_0x147b5f),console[_0x10a549(0x14b)](_0x10a549(0x1b8)),_0x315ef6&&_0x26d548&&console[_0x10a549(0x14b)](_0x10a549(0x1f2)),0x0;return await handleSingleObjectOutput(_0x5316f2,_0x4e5f22),0x0;}}function formatStageStats(_0x5df9f2,_0x1adda5){const _0x19e205=a27_0x3d26ae,_0x5db753=_0x1adda5[_0x19e205(0x13c)]&&_0x5df9f2[_0x19e205(0x103)]?.[_0x19e205(0x12a)]?aggregateStageHistory(_0x5df9f2['history']):{'size':_0x5df9f2['size'],'entered':_0x5df9f2[_0x19e205(0x1cf)],'milestone':_0x5df9f2[_0x19e205(0xfe)],'milestone_rate':_0x5df9f2['completeMilestoneRate'],'exit_or_jump':_0x5df9f2['exitOrJumpSize'],'exit_or_jump_rate':_0x5df9f2[_0x19e205(0x10d)]},_0x33f5e0={'id':_0x5df9f2['id'],'name':_0x1adda5[_0x19e205(0x145)][_0x19e205(0x173)](_0x5df9f2['id'])??_0x5df9f2['id'],..._0x5db753};return _0x1adda5['hasPeriod']&&_0x1adda5[_0x19e205(0x1b0)]&&_0x5df9f2[_0x19e205(0x103)]&&(_0x33f5e0[_0x19e205(0x103)]=_0x5df9f2['history']),_0x33f5e0;}export class JourneyPauseCommand extends BaseCommand{[a27_0x3d26ae(0xfb)]=a27_0x3d26ae(0x19d);[a27_0x3d26ae(0x187)]=a27_0x3d26ae(0x116);async[a27_0x3d26ae(0x102)](_0xecf025){const _0x75872b=a27_0x3d26ae,{options:_0x1f8202,args:_0x53d939,tdx:_0x241383}=_0xecf025,_0x438777=_0x53d939[0x0];if(!requireNameOrPath(_0x438777))return 0x1;_0x1f8202['verbose']&&console[_0x75872b(0x14b)]('Input:\x20'+_0x438777);const {journeyId:_0xd2e6fc,journeyName:_0x2cce55}=await resolveJourneyIdFromInput(_0x438777,_0x1f8202,_0x241383);if(!_0x1f8202[_0x75872b(0x157)]){const _0x22793d=await confirm(_0x75872b(0x1fd)+_0x2cce55+'\x22?');if(!_0x22793d)return console[_0x75872b(0x14b)](_0x75872b(0x141)),0x0;}const _0x172fa6=await withSpinner('Pausing\x20journey...',()=>_0x241383[_0x75872b(0x15c)][_0x75872b(0x18e)](_0xd2e6fc),{'verbose':_0x1f8202['verbose']}),_0x197667=_0x172fa6[_0x75872b(0x119)];return console[_0x75872b(0x14b)]('✔\x20Journey\x20\x22'+_0x197667[_0x75872b(0x1c6)][_0x75872b(0xfb)]+'\x22\x20paused'),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a27_0x3d26ae(0xfb)]=a27_0x3d26ae(0x11b);[a27_0x3d26ae(0x187)]=a27_0x3d26ae(0x114);async[a27_0x3d26ae(0x102)](_0x383b1a){const _0x226b44=a27_0x3d26ae,{options:_0x267535,args:_0x59f9c1,tdx:_0x25fa27}=_0x383b1a,_0x4a2c23=_0x59f9c1[0x0];if(!requireNameOrPath(_0x4a2c23))return 0x1;_0x267535['verbose']&&console[_0x226b44(0x14b)](_0x226b44(0x181)+_0x4a2c23);const {journeyId:_0x18d4e6,journeyName:_0x5d9447}=await resolveJourneyIdFromInput(_0x4a2c23,_0x267535,_0x25fa27);if(!_0x267535[_0x226b44(0x157)]){const _0x1787af=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22'+_0x5d9447+'\x22?');if(!_0x1787af)return console[_0x226b44(0x14b)](_0x226b44(0x141)),0x0;}const _0x79a60f=await withSpinner(_0x226b44(0x161),()=>_0x25fa27[_0x226b44(0x15c)][_0x226b44(0x19b)](_0x18d4e6),{'verbose':_0x267535[_0x226b44(0x1e3)]}),_0x51366b=_0x79a60f[_0x226b44(0x119)];return console[_0x226b44(0x14b)](_0x226b44(0x16d)+_0x51366b[_0x226b44(0x1c6)][_0x226b44(0xfb)]+_0x226b44(0x1a1)),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']='journey:pull';['description']='Export\x20journey(s)\x20as\x20YAML\x20files';async[a27_0x3d26ae(0x102)](_0x171988){const _0x202a22=a27_0x3d26ae,{options:_0x44d3f9,args:_0x3306c7,tdx:_0x493a32}=_0x171988,_0x5388fd=_0x44d3f9,_0x56e4da=_0x3306c7[0x0],_0x383751=_0x56e4da&&isYamlFilePath(_0x56e4da),_0x317bbc=await resolveTarget({'arg':_0x383751?_0x56e4da:undefined,'contextParent':_0x44d3f9[_0x202a22(0x1ec)],'cwd':process[_0x202a22(0x16f)]()});if(!isSuccessfulResolution(_0x317bbc))return _0x317bbc['errorCode']===_0x202a22(0x155)?(console[_0x202a22(0x14b)](a27_0x36bf62[_0x202a22(0x18c)](_0x202a22(0x1e5))),console[_0x202a22(0x14b)](_0x202a22(0x17c)),console['error'](_0x202a22(0x15e)),console[_0x202a22(0x14b)](_0x202a22(0x19a)),console['error']('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')):(console[_0x202a22(0x14b)](a27_0x36bf62[_0x202a22(0x1dd)](_0x202a22(0x168)+_0x317bbc[_0x202a22(0x1a6)]+'\x0a')),_0x317bbc['helpText']&&console[_0x202a22(0x14b)](a27_0x36bf62[_0x202a22(0x1c7)](_0x317bbc[_0x202a22(0x1d1)]))),0x1;let _0x542ebf=_0x383751?undefined:_0x56e4da,_0x215eaa,_0x239464;_0x317bbc['type']===_0x202a22(0x14f)&&(_0x542ebf=_0x317bbc[_0x202a22(0x1b1)],_0x215eaa=_0x317bbc['filePath'],_0x239464=_0x317bbc[_0x202a22(0x104)]);const _0x54d989=_0x317bbc['parentName'],_0x58ee80=_0x317bbc[_0x202a22(0x1a3)];_0x5388fd[_0x202a22(0x1e3)]&&(console[_0x202a22(0x14b)](_0x202a22(0x15b)+_0x54d989),console[_0x202a22(0x14b)](_0x202a22(0x203)+_0x58ee80),_0x542ebf&&console[_0x202a22(0x14b)](_0x202a22(0x136)+_0x542ebf),_0x215eaa&&console[_0x202a22(0x14b)](_0x202a22(0x11f)+_0x215eaa),_0x239464&&console['error'](_0x202a22(0x1d2)+_0x239464));const _0xc0a784=await withSpinner(_0x202a22(0x1e2),()=>_0x493a32[_0x202a22(0x1aa)][_0x202a22(0x13a)](_0x54d989),{'verbose':_0x44d3f9[_0x202a22(0x1e3)]}),_0x9eb97e=_0xc0a784['data'],{journeys:_0x2313bb,folders:_0x58322d}=await withSpinner(_0x202a22(0x199),async()=>{const _0xc53e7f=_0x202a22,[_0x5d9bdd,_0x21b8c6]=await Promise[_0xc53e7f(0x1bd)]([_0x493a32[_0xc53e7f(0x15c)][_0xc53e7f(0x178)](_0x9eb97e,undefined,{'includeAllVersions':!![]}),_0x493a32[_0xc53e7f(0x1aa)][_0xc53e7f(0x1ff)](_0x9eb97e)]);return{'journeys':_0x5d9bdd,'folders':_0x21b8c6};},{'verbose':_0x44d3f9['verbose']})[_0x202a22(0x152)](_0x57a5ac=>_0x57a5ac['data']);let _0x6ff93d=_0x2313bb;const _0x4f85e7=buildFolderIdToPathMap(_0x58322d);if(_0x542ebf){const _0x662f9d=_0x6ff93d[_0x202a22(0x11a)](_0x353ea6=>_0x353ea6[_0x202a22(0x17d)][_0x202a22(0x117)]()===_0x542ebf['toLowerCase']());if(_0x662f9d[_0x202a22(0x12a)]===0x0)return console['error'](_0x202a22(0x118)+_0x542ebf),console['error'](_0x202a22(0x1de)),0x1;_0x6ff93d=_0x662f9d;}if(_0x239464!==undefined){const _0xfd0be6=_0x6ff93d[_0x202a22(0x11a)](_0x5576c3=>{const _0x35a68e=_0x202a22,_0x439617=_0x5576c3['folderId']?_0x4f85e7[_0x35a68e(0x173)](_0x5576c3['folderId'])||'':'';return _0x439617===_0x239464;});if(_0xfd0be6[_0x202a22(0x12a)]===0x0&&_0x6ff93d['length']>0x0){console['error'](_0x202a22(0x14e)+_0x542ebf+_0x202a22(0x195)+(_0x239464||_0x202a22(0x129))),console[_0x202a22(0x14b)](_0x202a22(0x202));for(const _0x114d9e of _0x6ff93d){const _0x36751b=_0x114d9e[_0x202a22(0x179)]?_0x4f85e7['get'](_0x114d9e[_0x202a22(0x179)])||'':'';console[_0x202a22(0x14b)](_0x202a22(0x12f)+(_0x36751b||_0x202a22(0x137))+'/'+_0x114d9e[_0x202a22(0x17d)]);}return 0x1;}_0x6ff93d=_0xfd0be6;}if(_0x6ff93d[_0x202a22(0x12a)]===0x0)return console['error'](_0x202a22(0x18a)),0x0;const _0x1b588e=new Map();for(const _0x2f090d of _0x6ff93d){const _0x304d98=_0x2f090d['journeyBundleId'];!_0x1b588e[_0x202a22(0x1cd)](_0x304d98)&&_0x1b588e['set'](_0x304d98,[]),_0x1b588e[_0x202a22(0x173)](_0x304d98)[_0x202a22(0x1c5)](_0x2f090d);}for(const _0x3adc2b of _0x1b588e[_0x202a22(0x159)]()){_0x3adc2b['sort']((_0x3fae87,_0x528c39)=>(_0x3fae87[_0x202a22(0x1da)]||0x0)-(_0x528c39[_0x202a22(0x1da)]||0x0));}const _0x4fe3a7=[],{idToEmailMap:_0x222b45,connectionIdToNameMap:_0x14267b}=await withSpinner('Fetching\x20users\x20and\x20connections...',async()=>{const _0x1eb7a4=_0x202a22,[_0x3794ae,_0x3df635]=await Promise['all']([_0x493a32[_0x1eb7a4(0x124)][_0x1eb7a4(0x16c)](),_0x493a32['connection'][_0x1eb7a4(0x185)]()]);return{'idToEmailMap':_0x3794ae,'connectionIdToNameMap':_0x3df635};},{'verbose':_0x44d3f9[_0x202a22(0x1e3)]})['then'](_0x2d8020=>_0x2d8020[_0x202a22(0x119)]);for(const _0x4617bc of _0x1b588e[_0x202a22(0x159)]()){const _0x5ce9bb=_0x4617bc[0x0][_0x202a22(0x17d)],_0x346a5a=_0x4617bc[0x0][_0x202a22(0x179)],_0x1a48b1=_0x346a5a?_0x4f85e7[_0x202a22(0x173)](_0x346a5a)||'':'',_0x3694f8=_0x1a48b1?a27_0x745048[_0x202a22(0x134)](_0x58ee80,_0x1a48b1):_0x58ee80,_0x52fc24=_0x215eaa||a27_0x745048[_0x202a22(0x134)](_0x3694f8,sanitizeFileName(_0x5ce9bb)+_0x202a22(0x12e));let _0x35f346,_0x3caeec;if(existsSync(_0x52fc24))try{const _0x224651=readFileSync(_0x52fc24,_0x202a22(0x15a)),_0x1a2b38=parseYamlString(_0x224651);_0x3caeec=_0x1a2b38,_0x35f346=buildRuleToNameMapping(_0x1a2b38),_0x5388fd[_0x202a22(0x1e3)]&&_0x35f346[_0x202a22(0x191)]>0x0&&console[_0x202a22(0x14b)](_0x202a22(0x183)+_0x35f346[_0x202a22(0x191)]+_0x202a22(0x1b3)+_0x5ce9bb);}catch(_0x568b10){_0x5388fd[_0x202a22(0x1e3)]&&console[_0x202a22(0x14b)](_0x202a22(0x18b)+_0x568b10['message']);}const _0x2ec686=[],_0x5ec7dd=new Set(),_0x28ef57=new Map(),_0x9ed35f=new Map(),_0x32678d=new Set(),_0x2f0a3a=new Map(),_0x309a3c=new Map(),_0x21e78a=createJumpTargetCache();await withProgressSpinner(_0x202a22(0x1ef)+_0x5ce9bb+'...',async _0x100eac=>{const _0x477e1e=_0x202a22;for(const _0x368817 of _0x4617bc){const _0x182465=_0x4617bc[_0x477e1e(0x12a)]>0x1?_0x368817[_0x477e1e(0x17d)]+'\x20v'+(_0x368817[_0x477e1e(0x1da)]||0x1):_0x368817['journeyBundleName'];_0x100eac['setPhase']('Fetching\x20'+_0x182465);const _0x39b67b=await _0x493a32[_0x477e1e(0x15c)][_0x477e1e(0x16b)](_0x368817['id']),_0x1d6954=_0x39b67b[_0x477e1e(0x1c6)]?.['audienceId'],_0x53942={'resolveSegment':async _0x27758c=>{const _0x2b4136=_0x477e1e;if(!_0x1d6954)return{'name':_0x27758c,'isJourneyLocal':![]};const _0x5785bf=_0x28ef57[_0x2b4136(0x173)](_0x27758c);if(_0x5785bf)return _0x5785bf;try{const _0xa13c2b=await _0x493a32['segment'][_0x2b4136(0x100)](_0x1d6954,_0x27758c),_0x2495c1=_0xa13c2b[_0x2b4136(0x160)]===SEGMENT_KIND_JOURNEY;let _0x5ceeb9,_0x7a208f=_0xa13c2b['name'];if(_0x2495c1&&_0xa13c2b[_0x2b4136(0x1a9)]){const _0x748c84=await segmentResponseToDef(_0xa13c2b,{'resolveSegmentName':async _0x1b6030=>{const _0x2e0b7f=_0x2b4136,_0x4a6398=_0x28ef57['get'](_0x1b6030);if(_0x4a6398)return _0x4a6398['name'];const _0x34b275=await _0x53942[_0x2e0b7f(0x156)](_0x1b6030);return _0x34b275[_0x2e0b7f(0xfb)];}}),_0x51abfe=_0x748c84[_0x2b4136(0x1a9)];_0x5ceeb9={'description':_0xa13c2b[_0x2b4136(0x187)],'rule':_0x51abfe};const _0x14f686=serializeRule(_0x51abfe),_0x403e27=_0x9ed35f['get'](_0x14f686);if(_0x403e27)_0x7a208f=_0x403e27,_0x5ceeb9=undefined,_0x5388fd['verbose']&&console[_0x2b4136(0x14b)](_0x2b4136(0x208)+_0xa13c2b['name']+'\x20->\x20'+_0x403e27);else{let _0x2d0ae7=![];if(_0x35f346){const _0x341905=_0x35f346[_0x2b4136(0x173)](_0x14f686);if(_0x341905){const _0xe2544a=_0x341905[_0x2b4136(0x163)](_0x41d7e2=>!_0x5ec7dd[_0x2b4136(0x1cd)](_0x41d7e2));_0xe2544a&&(_0x7a208f=_0xe2544a,_0x5ec7dd[_0x2b4136(0x128)](_0xe2544a),_0x9ed35f[_0x2b4136(0x175)](_0x14f686,_0xe2544a),_0x2d0ae7=!![],_0x5388fd[_0x2b4136(0x1e3)]&&console['error'](_0x2b4136(0x142)+_0xe2544a+_0x2b4136(0x121)));}}if(!_0x2d0ae7){const _0x18a73e=generateJourneyLocalName(_0xa13c2b[_0x2b4136(0xfb)]);_0x18a73e&&(_0x7a208f=_0x18a73e);let _0x8f02a5=_0x7a208f,_0x49d1bb=0x2;while(_0x5ec7dd[_0x2b4136(0x1cd)](_0x8f02a5)){_0x8f02a5=_0x7a208f+'_'+_0x49d1bb,_0x49d1bb++;}_0x5ec7dd[_0x2b4136(0x128)](_0x8f02a5),_0x9ed35f['set'](_0x14f686,_0x8f02a5),_0x7a208f=_0x8f02a5;}}}const _0x3c5ef8={'name':_0x7a208f,'isJourneyLocal':_0x2495c1,'definition':_0x5ceeb9};return _0x28ef57[_0x2b4136(0x175)](_0x27758c,_0x3c5ef8),_0x3c5ef8;}catch(_0x184f10){return _0x44d3f9['verbose']&&console[_0x2b4136(0x14b)](_0x2b4136(0x15d)+_0x27758c+':\x20'+_0x184f10[_0x2b4136(0x1a6)]),{'name':_0x27758c,'isJourneyLocal':![]};}},'resolveActivation':async _0x268bb3=>{const _0x3eb2f4=_0x477e1e,_0xef0042=_0x2f0a3a[_0x3eb2f4(0x173)](_0x268bb3);if(_0xef0042)return _0xef0042;try{const _0x319133=await _0x493a32[_0x3eb2f4(0x15c)][_0x3eb2f4(0x1f3)](_0x368817['id'],_0x268bb3),_0x1c5dd3=journeyActivationStepToYaml(_0x319133,_0x222b45,_0x14267b),_0x103c45=JSON[_0x3eb2f4(0x151)]({'name':_0x1c5dd3['name'],'connection':_0x1c5dd3[_0x3eb2f4(0x11c)],'connector_config':_0x1c5dd3[_0x3eb2f4(0x126)]}),_0xfa73c3=_0x309a3c[_0x3eb2f4(0x173)](_0x103c45);if(_0xfa73c3){const _0x1e2db2={'name':_0xfa73c3,'isJourneyLocal':!![],'definition':_0x1c5dd3};return _0x2f0a3a['set'](_0x268bb3,_0x1e2db2),_0x1e2db2;}const _0x24b252=_0x319133[_0x3eb2f4(0x1c6)]['activationParams']['name']||_0x268bb3,_0x1426af=sanitizeYamlKey(_0x24b252)||'activation_'+_0x268bb3;let _0x2c58bd=_0x1426af,_0x568fd6=0x2;while(_0x32678d[_0x3eb2f4(0x1cd)](_0x2c58bd)){_0x2c58bd=_0x1426af+'_'+_0x568fd6,_0x568fd6++;}_0x32678d['add'](_0x2c58bd),_0x309a3c[_0x3eb2f4(0x175)](_0x103c45,_0x2c58bd);const _0x33b93e={'name':_0x2c58bd,'isJourneyLocal':!![],'definition':_0x1c5dd3};return _0x2f0a3a[_0x3eb2f4(0x175)](_0x268bb3,_0x33b93e),_0x33b93e;}catch(_0x5c5c97){return _0x44d3f9['verbose']&&console[_0x3eb2f4(0x14b)](_0x3eb2f4(0x1f7)+_0x268bb3+':\x20'+_0x5c5c97[_0x3eb2f4(0x1a6)]),{'name':_0x268bb3,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x58d386,_0x3ddfcd)=>{const _0x4b3b7d=_0x477e1e;return resolveJumpTarget(_0x58d386,_0x3ddfcd,_0x21e78a,_0x344ed1=>_0x493a32[_0x4b3b7d(0x15c)][_0x4b3b7d(0x16b)](_0x344ed1));}},_0x455806=await journeyResponseToDef(_0x39b67b,_0x53942);_0x2ec686['push']({'item':_0x368817,'yaml':_0x455806});}},{'verbose':_0x44d3f9[_0x202a22(0x1e3)]});const _0x505a63=await _0x493a32[_0x202a22(0x15c)][_0x202a22(0x113)](_0x4617bc[0x0][_0x202a22(0x204)]),_0x312380=buildMergedJourneyDef(_0x2ec686,_0x35f346,_0x505a63),_0x32dd16=normalizeJourneyDef(_0x312380,_0x3caeec),_0x51a7de=toYamlString(_0x32dd16),_0x17e8b5=_0x215eaa||a27_0x745048[_0x202a22(0x134)](_0x3694f8,sanitizeFileName(_0x5ce9bb)+_0x202a22(0x12e));!_0x215eaa&&_0x1a48b1&&!existsSync(_0x3694f8)&&mkdirSync(_0x3694f8,{'recursive':!![]});const _0x5ec409=a27_0x745048[_0x202a22(0x14a)](process[_0x202a22(0x16f)](),_0x17e8b5);if(existsSync(_0x17e8b5)){const _0x4bf217=readFileSync(_0x17e8b5,'utf-8'),_0x141ef0=generateDiff(_0x4bf217,_0x51a7de),_0x18e41e=hasChanges(_0x141ef0);_0x4fe3a7[_0x202a22(0x1c5)]({'relativePath':_0x5ec409,'absolutePath':_0x17e8b5,'content':_0x51a7de,'isNew':![],'hasChanges':_0x18e41e,'diff':_0x18e41e?formatDiffWithColors(_0x141ef0):undefined});}else _0x4fe3a7[_0x202a22(0x1c5)]({'relativePath':_0x5ec409,'absolutePath':_0x17e8b5,'content':_0x51a7de,'isNew':!![],'hasChanges':![]});}const _0x582f9f=_0x4fe3a7[_0x202a22(0x11a)](_0x26d7d2=>_0x26d7d2['isNew']),_0x21dc21=_0x4fe3a7[_0x202a22(0x11a)](_0x2cd640=>!_0x2cd640[_0x202a22(0x10f)]&&_0x2cd640[_0x202a22(0x169)]),_0x4d3b43=_0x4fe3a7[_0x202a22(0x11a)](_0x59e8aa=>!_0x59e8aa[_0x202a22(0x10f)]&&!_0x59e8aa[_0x202a22(0x169)]),_0x318b27=_0x6ff93d[_0x202a22(0x12a)],_0x4e31c3=_0x1b588e[_0x202a22(0x191)],_0x1a92f8=_0x318b27>_0x4e31c3?'\x20('+_0x318b27+_0x202a22(0x1c0):'';console[_0x202a22(0x14b)]('\x0aPull\x20summary:'),console[_0x202a22(0x14b)]('\x20\x20'+a27_0x36bf62[_0x202a22(0x1c7)](_0x4e31c3+_0x202a22(0x1e9))+a27_0x36bf62[_0x202a22(0x10c)](_0x1a92f8)),console[_0x202a22(0x14b)]('\x20\x20'+a27_0x36bf62[_0x202a22(0x1f5)]('+\x20'+_0x582f9f['length']+'\x20new\x20files')),console[_0x202a22(0x14b)]('\x20\x20'+a27_0x36bf62[_0x202a22(0x18c)]('~\x20'+_0x21dc21[_0x202a22(0x12a)]+'\x20changed\x20files')),console[_0x202a22(0x14b)]('\x20\x20'+a27_0x36bf62['dim']('=\x20'+_0x4d3b43[_0x202a22(0x12a)]+'\x20unchanged\x20files')),console[_0x202a22(0x14b)](_0x202a22(0x107)+a27_0x36bf62[_0x202a22(0x1c7)](_0x58ee80)+'\x0a');if(_0x21dc21['length']>0x0)for(const _0x11ece4 of _0x21dc21){console[_0x202a22(0x14b)](_0x202a22(0x1ea)+_0x11ece4[_0x202a22(0x1df)]+'\x27:'),console[_0x202a22(0x14b)]('─'[_0x202a22(0x1d9)](0x3c)),console['error'](_0x11ece4['diff']),console[_0x202a22(0x14b)]('─'[_0x202a22(0x1d9)](0x3c));}if(_0x5388fd[_0x202a22(0x10e)])return console[_0x202a22(0x14b)](a27_0x36bf62['yellow'](_0x202a22(0x11e))),0x0;if(_0x582f9f['length']===0x0&&_0x21dc21['length']===0x0)return console[_0x202a22(0x14b)](a27_0x36bf62['green']('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x54d989},_0x5388fd[_0x202a22(0x158)]),console[_0x202a22(0x14b)](a27_0x36bf62[_0x202a22(0x1f5)]('✔\x20Context\x20set:\x20'+a27_0x36bf62[_0x202a22(0x10c)](_0x202a22(0x112))+_0x202a22(0x1b5)+a27_0x36bf62[_0x202a22(0x1c7)](_0x54d989))),0x0;if(!_0x5388fd[_0x202a22(0x157)]&&(_0x582f9f[_0x202a22(0x12a)]>0x0||_0x21dc21[_0x202a22(0x12a)]>0x0)){if(!isInteractive())return console[_0x202a22(0x14b)](a27_0x36bf62[_0x202a22(0x1dd)](_0x202a22(0x16e)),_0x202a22(0x115)),console[_0x202a22(0x14b)](a27_0x36bf62[_0x202a22(0x10c)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x13d86e=await confirmKey(_0x202a22(0x19f)+(_0x582f9f[_0x202a22(0x12a)]+_0x21dc21[_0x202a22(0x12a)])+'\x20files?');if(!_0x13d86e)return console['error'](a27_0x36bf62[_0x202a22(0x18c)]('Aborted.'),_0x202a22(0x105)),0x1;}!existsSync(_0x58ee80)&&mkdirSync(_0x58ee80,{'recursive':!![]});const _0x15a2b9=a27_0x745048[_0x202a22(0x134)](_0x58ee80,_0x202a22(0x1c8));writeFileSync(_0x15a2b9,createTdxConfigContent(_0x54d989),_0x202a22(0x15a));for(const _0x5b67aa of _0x4fe3a7){(_0x5b67aa[_0x202a22(0x10f)]||_0x5b67aa[_0x202a22(0x169)])&&writeFileSync(_0x5b67aa[_0x202a22(0x10a)],_0x5b67aa[_0x202a22(0x1b6)],_0x202a22(0x15a));}return console['error'](a27_0x36bf62[_0x202a22(0x1f5)](_0x202a22(0x1b2)+(_0x582f9f[_0x202a22(0x12a)]+_0x21dc21['length'])+'\x20journey\x20files\x20to\x20'+_0x58ee80)),saveSessionContext({'parent_segment':_0x54d989},_0x5388fd[_0x202a22(0x158)]),console[_0x202a22(0x14b)](a27_0x36bf62[_0x202a22(0x1f5)](_0x202a22(0x123)+a27_0x36bf62['dim']('parent_segment')+_0x202a22(0x1b5)+a27_0x36bf62[_0x202a22(0x1c7)](_0x54d989))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']=a27_0x3d26ae(0x1a7);[a27_0x3d26ae(0x187)]=a27_0x3d26ae(0x14d);async[a27_0x3d26ae(0x102)](_0x2d93ca){const _0x5b0790=a27_0x3d26ae,{options:_0x4837bd,args:_0x50582f,tdx:_0x3dcd2c}=_0x2d93ca,_0x3e02fa=_0x50582f[0x0];if(!requireNameOrPath(_0x3e02fa))return 0x1;_0x4837bd[_0x5b0790(0x1e3)]&&console[_0x5b0790(0x14b)](_0x5b0790(0x181)+_0x3e02fa);const {journeyId:_0x5dfa38}=await resolveJourneyIdFromInput(_0x3e02fa,_0x4837bd,_0x3dcd2c),_0x48bdd1=await withSpinner(_0x5b0790(0x13f),()=>_0x3dcd2c[_0x5b0790(0x15c)][_0x5b0790(0x138)](_0x5dfa38),{'verbose':_0x4837bd[_0x5b0790(0x1e3)]}),_0x4e4911=_0x48bdd1[_0x5b0790(0x119)];return console[_0x5b0790(0x130)](_0x5b0790(0x149)+_0x4e4911[_0x5b0790(0x1b4)]),console[_0x5b0790(0x130)]('Table:\x20'+_0x4e4911[_0x5b0790(0x127)]),await handleSDKOutput(_0x4e4911[_0x5b0790(0xfc)],_0x4837bd),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a27_0x3d26ae(0xfb)]=a27_0x3d26ae(0x1c1);[a27_0x3d26ae(0x187)]=a27_0x3d26ae(0x1ed);async[a27_0x3d26ae(0x102)](_0x567c98){const _0x438b00=a27_0x3d26ae,{options:_0x3ab812,args:_0x2469b2,tdx:_0x243abf}=_0x567c98,_0x3ebec2=_0x2469b2[0x0];if(!requireNameOrPath(_0x3ebec2))return 0x1;_0x3ab812[_0x438b00(0x1e3)]&&console[_0x438b00(0x14b)]('Input:\x20'+_0x3ebec2);const {journeyId:_0x360b0f}=await resolveJourneyIdFromInput(_0x3ebec2,_0x3ab812,_0x243abf),_0x5abd7c=await withSpinner(_0x438b00(0x1f8),()=>_0x243abf[_0x438b00(0x15c)][_0x438b00(0x1ae)](_0x360b0f),{'verbose':_0x3ab812['verbose']}),_0xfcd1ce=_0x5abd7c[_0x438b00(0x119)];return console[_0x438b00(0x14b)]('Found\x20'+_0xfcd1ce[_0x438b00(0x12a)]+_0x438b00(0x10b)+(_0xfcd1ce[_0x438b00(0x12a)]!==0x1?'s':'')),await handleSDKOutput(_0xfcd1ce,_0x3ab812),0x0;}}export class JourneyPushCommand extends BaseCommand{['name']=a27_0x3d26ae(0x1ad);[a27_0x3d26ae(0x187)]=a27_0x3d26ae(0x1ca);[a27_0x3d26ae(0x1d7)]=new SegmentPushCommand();async[a27_0x3d26ae(0x102)](_0x3b087f){const _0x5d080d=a27_0x3d26ae,_0x5af19d=_0x3b087f[_0x5d080d(0x147)][0x0];let _0x1419e9;if(_0x5af19d){const _0x1c1bbb=await resolveTarget({'arg':_0x5af19d,'contextParent':_0x3b087f[_0x5d080d(0x1b9)]['parentSegment'],'cwd':process[_0x5d080d(0x16f)]()});isSuccessfulResolution(_0x1c1bbb)&&_0x1c1bbb[_0x5d080d(0x101)]===_0x5d080d(0x14f)&&(_0x1419e9=_0x1c1bbb['filePath']);}const _0x2f31a2={..._0x3b087f,'options':{..._0x3b087f[_0x5d080d(0x1b9)],'journeysOnly':!![],..._0x1419e9&&{'singleFilePath':_0x1419e9}}};return this[_0x5d080d(0x1d7)][_0x5d080d(0x102)](_0x2f31a2);}}export class JourneyVersionsCommand extends BaseCommand{[a27_0x3d26ae(0xfb)]=a27_0x3d26ae(0x1e0);[a27_0x3d26ae(0x187)]='List\x20all\x20versions\x20of\x20a\x20journey';async[a27_0x3d26ae(0x102)](_0x1372e8){const _0x272940=a27_0x3d26ae,{options:_0x49fe25,args:_0x10c2c2,tdx:_0xabeb00}=_0x1372e8,_0xc8f7a3=_0x10c2c2[0x0];if(!requireNameOrPath(_0xc8f7a3))return 0x1;if(_0x49fe25['verbose'])console[_0x272940(0x14b)](_0x272940(0x181)+_0xc8f7a3);const {journeyId:_0x54f819}=await resolveJourneyIdFromInput(_0xc8f7a3,_0x49fe25,_0xabeb00),_0x457a7b=await withSpinner('Listing\x20journey\x20versions...',()=>_0xabeb00[_0x272940(0x15c)][_0x272940(0x12c)](_0x54f819),{'verbose':_0x49fe25[_0x272940(0x1e3)]}),{bundleName:_0x58f1af,versions:_0x15f742,latestJourneyId:_0x590a2f}=_0x457a7b['data'];console[_0x272940(0x14b)](_0x58f1af+':\x20'+_0x15f742[_0x272940(0x12a)]+_0x272940(0x1be)+(_0x15f742[_0x272940(0x12a)]!==0x1?'s':''));const _0x1918d7=_0x15f742[_0x272940(0x150)](_0xe1f991=>({'version':_0xe1f991[_0x272940(0x1da)],'journey_id':_0xe1f991['journeyId'],'name':_0xe1f991['name'],'state':_0xe1f991[_0x272940(0x1f0)],'paused':_0xe1f991['paused'],'latest':_0xe1f991[_0x272940(0x1c4)]===_0x590a2f,'created_at':_0xe1f991[_0x272940(0x167)]}));return await handleSDKOutput(_0x1918d7,_0x49fe25),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']=a27_0x3d26ae(0x16a);[a27_0x3d26ae(0x187)]=a27_0x3d26ae(0x132);async[a27_0x3d26ae(0x102)](_0x3af4fc){const _0x33ecd1=a27_0x3d26ae,{options:_0xb071d0,args:_0x42d78d,tdx:_0x13c57c}=_0x3af4fc,_0x44057e=_0x42d78d[0x0];if(!requireNameOrPath(_0x44057e))return 0x1;if(_0xb071d0[_0x33ecd1(0x1e3)])console[_0x33ecd1(0x14b)](_0x33ecd1(0x181)+_0x44057e);const {journeyId:_0x1bc1b5,journeyName:_0x11c946}=await resolveJourneyIdFromInput(_0x44057e,_0xb071d0,_0x13c57c);if(!_0xb071d0[_0x33ecd1(0x157)]){const _0x27af06=await confirm('Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22'+_0x11c946+'\x22?');if(!_0x27af06)return console[_0x33ecd1(0x14b)](_0x33ecd1(0x141)),0x0;}const _0x597021=await withSpinner(_0x33ecd1(0x182),()=>_0x13c57c[_0x33ecd1(0x15c)][_0x33ecd1(0x1fe)](_0x1bc1b5),{'verbose':_0xb071d0[_0x33ecd1(0x1e3)]}),_0x30ddf9=_0x597021['data'];return console[_0x33ecd1(0x14b)](a27_0x36bf62[_0x33ecd1(0x1f5)]('✔')+_0x33ecd1(0x1c2)+_0x30ddf9['attributes'][_0x33ecd1(0x1da)]+_0x33ecd1(0x11d)+_0x30ddf9[_0x33ecd1(0x1c6)][_0x33ecd1(0xfb)]+'\x22'),console[_0x33ecd1(0x14b)]('\x20\x20Journey\x20ID:\x20'+_0x30ddf9['id']),await handleSingleObjectOutput({'id':_0x30ddf9['id'],'name':_0x30ddf9[_0x33ecd1(0x1c6)][_0x33ecd1(0xfb)],'version':_0x30ddf9['attributes'][_0x33ecd1(0x1da)],'state':_0x30ddf9[_0x33ecd1(0x1c6)][_0x33ecd1(0x1f0)],'bundle_id':_0x30ddf9['attributes']['journeyBundleId'],'created_at':_0x30ddf9[_0x33ecd1(0x1c6)][_0x33ecd1(0x167)]},_0xb071d0),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a27_0x3d26ae(0xfb)]=a27_0x3d26ae(0x194);['description']=a27_0x3d26ae(0x133);async[a27_0x3d26ae(0x102)](_0x469b24){const _0x5f0894=a27_0x3d26ae,{options:_0x563b67,args:_0x16954b,tdx:_0xd02701}=_0x469b24,_0x213827=_0x16954b[0x0];if(!requireNameOrPath(_0x213827))return 0x1;const _0x4182e7=_0x563b67[_0x5f0894(0x174)];if(!_0x4182e7)return console['error']('Error:\x20--version\x20option\x20is\x20required'),console[_0x5f0894(0x14b)](_0x5f0894(0x177)),0x1;const _0x129636=parseInt(_0x4182e7,0xa);if(isNaN(_0x129636)||_0x129636<0x1)return console[_0x5f0894(0x14b)](_0x5f0894(0x200)+_0x4182e7),0x1;if(_0x563b67['verbose'])console[_0x5f0894(0x14b)]('Input:\x20'+_0x213827+_0x5f0894(0x1f4)+_0x129636);const {journeyId:_0x238217,parentSegmentId:_0x4d5fd8}=await resolveJourneyIdFromInput(_0x213827,_0x563b67,_0xd02701),_0x6a14ee=await withSpinner('Resolving\x20version...',()=>_0xd02701[_0x5f0894(0x15c)][_0x5f0894(0x12c)](_0x238217),{'verbose':_0x563b67[_0x5f0894(0x1e3)]}),{versions:_0x37faa3,latestJourneyId:_0x5a0ad4}=_0x6a14ee['data'],_0x1a2c0a=_0x37faa3[_0x5f0894(0x163)](_0x5c366f=>_0x5c366f[_0x5f0894(0x1da)]===_0x129636);if(!_0x1a2c0a){const _0x2646eb=_0x37faa3[_0x5f0894(0x150)](_0x10b49b=>'v'+_0x10b49b['versionNumber'])[_0x5f0894(0x134)](',\x20');return console[_0x5f0894(0x14b)](_0x5f0894(0x180)+_0x129636+_0x5f0894(0x1cb)+_0x2646eb),0x1;}const _0x454b1a=await withSpinner('Getting\x20version\x20'+_0x129636+_0x5f0894(0x1e8),()=>_0xd02701[_0x5f0894(0x15c)][_0x5f0894(0x16b)](_0x1a2c0a[_0x5f0894(0x1c4)]),{'verbose':_0x563b67[_0x5f0894(0x1e3)]}),_0xdfc86=_0x454b1a[_0x5f0894(0x119)],_0x1b974d=getConsoleNextUrl(_0x563b67['site'],_0x5f0894(0x172)+_0x4d5fd8+'/e/'+_0x1a2c0a[_0x5f0894(0x1c4)]+'/j/da/je');return await handleSingleObjectOutput({'id':_0xdfc86['id'],'name':_0xdfc86[_0x5f0894(0x1c6)][_0x5f0894(0xfb)],'version':_0xdfc86['attributes'][_0x5f0894(0x1da)],'description':_0xdfc86[_0x5f0894(0x1c6)][_0x5f0894(0x187)],'state':_0xdfc86[_0x5f0894(0x1c6)][_0x5f0894(0x1f0)],'paused':_0xdfc86[_0x5f0894(0x1c6)]['paused'],'reentry_mode':_0xdfc86[_0x5f0894(0x1c6)][_0x5f0894(0x1ab)],'stages':_0xdfc86[_0x5f0894(0x1c6)][_0x5f0894(0x15f)]?.[_0x5f0894(0x12a)]||0x0,..._0xdfc86[_0x5f0894(0x1c6)][_0x5f0894(0x201)]&&{'goal':_0xdfc86[_0x5f0894(0x1c6)][_0x5f0894(0x201)]['name']},'latest':_0x1a2c0a[_0x5f0894(0x1c4)]===_0x5a0ad4,'created_at':_0xdfc86[_0x5f0894(0x1c6)]['createdAt'],'updated_at':_0xdfc86[_0x5f0894(0x1c6)][_0x5f0894(0x1f1)],'url':_0x1b974d},_0x563b67),0x0;}}
@@ -1 +1 @@
1
- const a28_0x5d75f0=a28_0x4e57;(function(_0x581896,_0x339fca){const _0x29f5f6=a28_0x4e57,_0x5b3209=_0x581896();while(!![]){try{const _0x4aa2c4=-parseInt(_0x29f5f6(0x1a7))/0x1+parseInt(_0x29f5f6(0x19c))/0x2+parseInt(_0x29f5f6(0x1a6))/0x3+parseInt(_0x29f5f6(0x1a0))/0x4+parseInt(_0x29f5f6(0x1b4))/0x5+parseInt(_0x29f5f6(0x1b1))/0x6*(-parseInt(_0x29f5f6(0x1c2))/0x7)+-parseInt(_0x29f5f6(0x195))/0x8;if(_0x4aa2c4===_0x339fca)break;else _0x5b3209['push'](_0x5b3209['shift']());}catch(_0x5d6513){_0x5b3209['push'](_0x5b3209['shift']());}}}(a28_0x21ca,0xcbb48));import{BaseCommand}from'./command.js';function a28_0x4e57(_0x44e576,_0x3b9a09){_0x44e576=_0x44e576-0x193;const _0x21ca22=a28_0x21ca();let _0x4e57c2=_0x21ca22[_0x44e576];return _0x4e57c2;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a28_0x21ca(){const _0x4717bb=['log','errorCode','Validate\x20journey\x20YAML\x20files','error','\x20warning(s)\x20found','type','verbose','106236EZcgXW','Validation\x20failed:\x20','red','6628350mMXWvM','validCount','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','name','filter','errors','\x20journey(s)\x20with\x20errors,\x20','\x20segment\x20file(s)\x20skipped)','targetDir','endsWith','\x20error(s)','No\x20journey\x20YAML\x20files\x20found\x20in\x20','\x20journey(s)\x20valid','238EmPKAe','✔\x20All\x20','no_parent','dim','green','Error:\x20','helpText','.yaml','21971872WprDYe','relativePath','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','length','reason','yellow','warnings','2861832hiXyrV','parentSegment','journey','\x20valid','5520556NxCtxh','skippedCount','hasErrors','\x20segment\x20file(s)\x20skipped','\x20(skipped:\x20','warningCount','3171951HryEWZ','1011178YCwQTU','\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','valid'];a28_0x21ca=function(){return _0x4717bb;};return a28_0x21ca();}import a28_0x25d040 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_0x5d75f0(0x1b8)]='journey:validate';['description']=a28_0x5d75f0(0x1ac);async['execute'](_0x3934e5){const _0x37c747=a28_0x5d75f0,{options:_0x2c8e65,args:_0x24bf9e}=_0x3934e5,_0x9eaf4b=_0x2c8e65,_0x560586=await resolveTarget({'arg':_0x24bf9e[0x0],'contextParent':_0x2c8e65[_0x37c747(0x19d)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x560586))return _0x560586[_0x37c747(0x1ab)]===_0x37c747(0x1c4)?(console['error'](a28_0x25d040['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x37c747(0x1ad)](_0x37c747(0x1b7)),console['error'](_0x37c747(0x1a8)),console[_0x37c747(0x1ad)](_0x37c747(0x1b6))):(console['error'](a28_0x25d040[_0x37c747(0x1b3)](_0x37c747(0x1c7)+_0x560586['message']+'\x0a')),_0x560586['helpText']&&console[_0x37c747(0x1ad)](a28_0x25d040['cyan'](_0x560586[_0x37c747(0x193)]))),0x1;const _0x4d32db=_0x560586[_0x37c747(0x1bd)],_0x5c7574=_0x560586[_0x37c747(0x1af)]==='file'?_0x560586['filePath']:undefined;if(!_0x5c7574&&!existsSync(_0x4d32db))return console[_0x37c747(0x1ad)](a28_0x25d040[_0x37c747(0x1b3)]('Error:\x20Directory\x20not\x20found:\x20'+_0x4d32db+'\x0a')),0x1;let _0x4a2932;if(_0x5c7574){if(!_0x5c7574['endsWith']('.yml')&&!_0x5c7574[_0x37c747(0x1be)](_0x37c747(0x194)))return console[_0x37c747(0x1ad)](a28_0x25d040[_0x37c747(0x1b3)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x5c7574+'\x0a')),0x1;_0x4a2932=[_0x5c7574];}else _0x4a2932=findYamlFiles(_0x4d32db);if(_0x4a2932[_0x37c747(0x198)]===0x0)return console[_0x37c747(0x1ad)](a28_0x25d040['red'](_0x37c747(0x197)+_0x4d32db+'\x0a')),0x1;const _0x2a33b2=validateYamlFiles(_0x4a2932,_0x4d32db,{'filterType':_0x37c747(0x19e)}),_0x30706e=calculateSummary(_0x2a33b2),_0x57f5b7=_0x2a33b2[_0x37c747(0x1b9)](isValidationResult);if(_0x57f5b7[_0x37c747(0x198)]===0x0)return console['error'](a28_0x25d040[_0x37c747(0x19a)](_0x37c747(0x1c0)+_0x4d32db+'\x0a')),_0x30706e[_0x37c747(0x1a1)]>0x0&&console['error'](a28_0x25d040[_0x37c747(0x1c5)]('('+_0x30706e[_0x37c747(0x1a1)]+_0x37c747(0x1bc))),0x0;for(const _0x2f4f87 of _0x2a33b2){if(!isValidationResult(_0x2f4f87)){_0x9eaf4b[_0x37c747(0x1b0)]&&console['log'](a28_0x25d040[_0x37c747(0x1c5)]('-\x20'+_0x2f4f87[_0x37c747(0x196)]+_0x37c747(0x1a4)+_0x2f4f87[_0x37c747(0x199)]+')'));continue;}const {relativePath:_0x17b606,source:_0x5bacc6,result:_0x4a65c6}=_0x2f4f87;if(_0x4a65c6[_0x37c747(0x1a9)]&&_0x4a65c6[_0x37c747(0x19b)][_0x37c747(0x198)]===0x0)_0x9eaf4b[_0x37c747(0x1b0)]&&console['log'](a28_0x25d040['green']('✔\x20'+_0x17b606));else _0x4a65c6[_0x37c747(0x1a9)]?(console['log'](a28_0x25d040[_0x37c747(0x19a)]('⚠\x20'+_0x17b606+':\x20'+_0x4a65c6['warnings'][_0x37c747(0x198)]+'\x20warning(s)')),console[_0x37c747(0x1aa)](formatValidationResult(_0x4a65c6,_0x5bacc6,_0x17b606))):(console[_0x37c747(0x1aa)](a28_0x25d040[_0x37c747(0x1b3)]('✖\x20'+_0x17b606+':\x20'+_0x4a65c6[_0x37c747(0x1ba)][_0x37c747(0x198)]+_0x37c747(0x1bf))),console[_0x37c747(0x1aa)](formatValidationResult(_0x4a65c6,_0x5bacc6,_0x17b606)));}return console['log'](''),_0x30706e[_0x37c747(0x1a2)]?(console[_0x37c747(0x1aa)](a28_0x25d040[_0x37c747(0x1b3)](_0x37c747(0x1b2)+_0x30706e['invalidCount']+_0x37c747(0x1bb)+_0x30706e[_0x37c747(0x1b5)]+_0x37c747(0x19f))),_0x30706e[_0x37c747(0x1a5)]>0x0&&console['log'](a28_0x25d040[_0x37c747(0x19a)](_0x30706e[_0x37c747(0x1a5)]+_0x37c747(0x1ae))),_0x30706e[_0x37c747(0x1a1)]>0x0&&console['log'](a28_0x25d040['dim'](_0x30706e['skippedCount']+'\x20segment\x20file(s)\x20skipped')),0x1):(console[_0x37c747(0x1aa)](a28_0x25d040[_0x37c747(0x1c6)](_0x37c747(0x1c3)+_0x30706e[_0x37c747(0x1b5)]+_0x37c747(0x1c1))),_0x30706e[_0x37c747(0x1a5)]>0x0&&console[_0x37c747(0x1aa)](a28_0x25d040[_0x37c747(0x19a)](_0x30706e[_0x37c747(0x1a5)]+_0x37c747(0x1ae))),_0x30706e[_0x37c747(0x1a1)]>0x0&&console[_0x37c747(0x1aa)](a28_0x25d040[_0x37c747(0x1c5)](_0x30706e[_0x37c747(0x1a1)]+_0x37c747(0x1a3))),0x0);}}
1
+ function a28_0x39a4(_0xe3671d,_0x22e0c6){_0xe3671d=_0xe3671d-0x76;const _0x4a84fb=a28_0x4a84();let _0x39a469=_0x4a84fb[_0xe3671d];return _0x39a469;}function a28_0x4a84(){const _0x5991e2=['2682WKwxCT','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','3320MBuhWt','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','\x20(skipped:\x20','\x20segment\x20file(s)\x20skipped)','warningCount','skippedCount','2190gFHCCd','18oewlHp','\x20segment\x20file(s)\x20skipped','targetDir','parentSegment','red','length','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','hasErrors','1382695DmeaaQ','error','filter','No\x20journey\x20YAML\x20files\x20found\x20in\x20','dim','invalidCount','\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','validCount','log','53505ALhJBP','journey','execute','warnings','53027SLfJiN','yellow','errors','helpText','Error:\x20','Validation\x20failed:\x20','journey:validate','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20warning(s)\x20found','.yml','861kwWoso','file','\x20warning(s)','name','\x20error(s)','1416MkYxtA','reason','12972663zdchql','\x20journey(s)\x20with\x20errors,\x20','green','cwd','cyan','\x20valid','4092PUMiMb','verbose','3303UHnbjy','filePath','Validate\x20journey\x20YAML\x20files','9170jTCqiR','\x20journey(s)\x20valid','errorCode'];a28_0x4a84=function(){return _0x5991e2;};return a28_0x4a84();}const a28_0x1bc89a=a28_0x39a4;(function(_0x3f6a51,_0x79e127){const _0x9983c8=a28_0x39a4,_0x214695=_0x3f6a51();while(!![]){try{const _0x34d51c=parseInt(_0x9983c8(0xa4))/0x1*(parseInt(_0x9983c8(0x7c))/0x2)+-parseInt(_0x9983c8(0x76))/0x3*(-parseInt(_0x9983c8(0xb1))/0x4)+parseInt(_0x9983c8(0x8d))/0x5*(parseInt(_0x9983c8(0x85))/0x6)+-parseInt(_0x9983c8(0x79))/0x7*(-parseInt(_0x9983c8(0x7e))/0x8)+-parseInt(_0x9983c8(0x96))/0x9*(parseInt(_0x9983c8(0x84))/0xa)+-parseInt(_0x9983c8(0xab))/0xb+-parseInt(_0x9983c8(0xa9))/0xc*(parseInt(_0x9983c8(0x9a))/0xd);if(_0x34d51c===_0x79e127)break;else _0x214695['push'](_0x214695['shift']());}catch(_0x17d715){_0x214695['push'](_0x214695['shift']());}}}(a28_0x4a84,0xa8d7d));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a28_0x263e70 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_0x1bc89a(0xa7)]=a28_0x1bc89a(0xa0);['description']=a28_0x1bc89a(0x78);async[a28_0x1bc89a(0x98)](_0x193bd6){const _0x3ae007=a28_0x1bc89a,{options:_0x5d54cc,args:_0x9214ae}=_0x193bd6,_0x3cd71e=_0x5d54cc,_0x2e317e=await resolveTarget({'arg':_0x9214ae[0x0],'contextParent':_0x5d54cc[_0x3ae007(0x88)],'cwd':process[_0x3ae007(0xae)]()});if(!isSuccessfulResolution(_0x2e317e))return _0x2e317e[_0x3ae007(0x7b)]==='no_parent'?(console[_0x3ae007(0x8e)](a28_0x263e70['yellow'](_0x3ae007(0x8b))),console[_0x3ae007(0x8e)](_0x3ae007(0x7d)),console[_0x3ae007(0x8e)](_0x3ae007(0x93)),console['error'](_0x3ae007(0x7f))):(console[_0x3ae007(0x8e)](a28_0x263e70[_0x3ae007(0x89)](_0x3ae007(0x9e)+_0x2e317e['message']+'\x0a')),_0x2e317e[_0x3ae007(0x9d)]&&console['error'](a28_0x263e70[_0x3ae007(0xaf)](_0x2e317e['helpText']))),0x1;const _0x85b5bc=_0x2e317e[_0x3ae007(0x87)],_0x6b3c76=_0x2e317e['type']===_0x3ae007(0xa5)?_0x2e317e[_0x3ae007(0x77)]:undefined;if(!_0x6b3c76&&!existsSync(_0x85b5bc))return console[_0x3ae007(0x8e)](a28_0x263e70[_0x3ae007(0x89)]('Error:\x20Directory\x20not\x20found:\x20'+_0x85b5bc+'\x0a')),0x1;let _0x4f8d9;if(_0x6b3c76){if(!_0x6b3c76['endsWith'](_0x3ae007(0xa3))&&!_0x6b3c76['endsWith']('.yaml'))return console['error'](a28_0x263e70[_0x3ae007(0x89)](_0x3ae007(0xa1)+_0x6b3c76+'\x0a')),0x1;_0x4f8d9=[_0x6b3c76];}else _0x4f8d9=findYamlFiles(_0x85b5bc);if(_0x4f8d9[_0x3ae007(0x8a)]===0x0)return console['error'](a28_0x263e70[_0x3ae007(0x89)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x85b5bc+'\x0a')),0x1;const _0x58d48d=validateYamlFiles(_0x4f8d9,_0x85b5bc,{'filterType':_0x3ae007(0x97)}),_0x8f8291=calculateSummary(_0x58d48d),_0x79e420=_0x58d48d[_0x3ae007(0x8f)](isValidationResult);if(_0x79e420[_0x3ae007(0x8a)]===0x0)return console['error'](a28_0x263e70[_0x3ae007(0x9b)](_0x3ae007(0x90)+_0x85b5bc+'\x0a')),_0x8f8291[_0x3ae007(0x83)]>0x0&&console[_0x3ae007(0x8e)](a28_0x263e70[_0x3ae007(0x91)]('('+_0x8f8291[_0x3ae007(0x83)]+_0x3ae007(0x81))),0x0;for(const _0x46593f of _0x58d48d){if(!isValidationResult(_0x46593f)){_0x3cd71e[_0x3ae007(0xb2)]&&console[_0x3ae007(0x95)](a28_0x263e70[_0x3ae007(0x91)]('-\x20'+_0x46593f['relativePath']+_0x3ae007(0x80)+_0x46593f[_0x3ae007(0xaa)]+')'));continue;}const {relativePath:_0x395415,source:_0x2c369c,result:_0x541950}=_0x46593f;if(_0x541950['valid']&&_0x541950['warnings']['length']===0x0)_0x3cd71e['verbose']&&console[_0x3ae007(0x95)](a28_0x263e70[_0x3ae007(0xad)]('✔\x20'+_0x395415));else _0x541950['valid']?(console[_0x3ae007(0x95)](a28_0x263e70[_0x3ae007(0x9b)]('⚠\x20'+_0x395415+':\x20'+_0x541950[_0x3ae007(0x99)][_0x3ae007(0x8a)]+_0x3ae007(0xa6))),console[_0x3ae007(0x95)](formatValidationResult(_0x541950,_0x2c369c,_0x395415))):(console[_0x3ae007(0x95)](a28_0x263e70[_0x3ae007(0x89)]('✖\x20'+_0x395415+':\x20'+_0x541950[_0x3ae007(0x9c)][_0x3ae007(0x8a)]+_0x3ae007(0xa8))),console['log'](formatValidationResult(_0x541950,_0x2c369c,_0x395415)));}return console[_0x3ae007(0x95)](''),_0x8f8291[_0x3ae007(0x8c)]?(console[_0x3ae007(0x95)](a28_0x263e70[_0x3ae007(0x89)](_0x3ae007(0x9f)+_0x8f8291[_0x3ae007(0x92)]+_0x3ae007(0xac)+_0x8f8291[_0x3ae007(0x94)]+_0x3ae007(0xb0))),_0x8f8291[_0x3ae007(0x82)]>0x0&&console['log'](a28_0x263e70[_0x3ae007(0x9b)](_0x8f8291['warningCount']+_0x3ae007(0xa2))),_0x8f8291[_0x3ae007(0x83)]>0x0&&console[_0x3ae007(0x95)](a28_0x263e70[_0x3ae007(0x91)](_0x8f8291[_0x3ae007(0x83)]+_0x3ae007(0x86))),0x1):(console['log'](a28_0x263e70['green']('✔\x20All\x20'+_0x8f8291['validCount']+_0x3ae007(0x7a))),_0x8f8291[_0x3ae007(0x82)]>0x0&&console['log'](a28_0x263e70[_0x3ae007(0x9b)](_0x8f8291[_0x3ae007(0x82)]+_0x3ae007(0xa2))),_0x8f8291[_0x3ae007(0x83)]>0x0&&console[_0x3ae007(0x95)](a28_0x263e70[_0x3ae007(0x91)](_0x8f8291[_0x3ae007(0x83)]+_0x3ae007(0x86))),0x0);}}