@treasuredata/tdx 2026.3.34 → 2026.3.35

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 (219) 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/auth-login-command.js +1 -1
  11. package/dist/commands/cas-command.js +1 -1
  12. package/dist/commands/cas-segment-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-statusline-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/delivery-command.js +1 -1
  21. package/dist/commands/describe.js +1 -1
  22. package/dist/commands/engage-campaign-pull-command.js +1 -1
  23. package/dist/commands/engage-campaign-push-command.js +1 -1
  24. package/dist/commands/engage-campaign-validate-command.js +1 -1
  25. package/dist/commands/engage-command.js +1 -1
  26. package/dist/commands/engage-template-pull-command.js +1 -1
  27. package/dist/commands/engage-template-push-command.js +1 -1
  28. package/dist/commands/engage-template-validate-command.js +1 -1
  29. package/dist/commands/job-command.js +1 -1
  30. package/dist/commands/journey-command.js +1 -1
  31. package/dist/commands/journey-validate-command.js +1 -1
  32. package/dist/commands/llm-command.js +1 -1
  33. package/dist/commands/mcp-command.js +1 -1
  34. package/dist/commands/parent-segment-command.js +1 -1
  35. package/dist/commands/policy-command.js +1 -1
  36. package/dist/commands/profile-command.js +1 -1
  37. package/dist/commands/profiles-command.js +1 -1
  38. package/dist/commands/query-command.js +1 -1
  39. package/dist/commands/schedule-command.js +1 -1
  40. package/dist/commands/segment-command.js +1 -1
  41. package/dist/commands/segment-create-command.js +1 -1
  42. package/dist/commands/segment-fields-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js +1 -1
  44. package/dist/commands/segment-push-command.js +1 -1
  45. package/dist/commands/segment-update-command.js +1 -1
  46. package/dist/commands/segment-use-command.js +1 -1
  47. package/dist/commands/segment-validate-command.js +1 -1
  48. package/dist/commands/segments.js +1 -1
  49. package/dist/commands/show.js +1 -1
  50. package/dist/commands/status-command.js +1 -1
  51. package/dist/commands/tables.js +1 -1
  52. package/dist/commands/unset-command.js +1 -1
  53. package/dist/commands/upgrade-command.js +1 -1
  54. package/dist/commands/use-command.js +1 -1
  55. package/dist/commands/user-command.js +1 -1
  56. package/dist/commands/work-command.js +1 -1
  57. package/dist/commands/workflow-command.js +1 -1
  58. package/dist/core/auth.js +1 -1
  59. package/dist/core/command-output.js +1 -1
  60. package/dist/core/config.js +1 -1
  61. package/dist/core/connection-cache.js +1 -1
  62. package/dist/core/constants.js +1 -1
  63. package/dist/core/credential-cache.js +1 -1
  64. package/dist/core/global-context.js +1 -1
  65. package/dist/core/keychain.js +1 -1
  66. package/dist/core/oauth-keychain.js +1 -1
  67. package/dist/core/oauth.js +1 -1
  68. package/dist/core/profile.js +1 -1
  69. package/dist/core/project-config.js +1 -1
  70. package/dist/core/session.js +1 -1
  71. package/dist/core/user-cache.js +1 -1
  72. package/dist/core/version.js +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/mcp/server.js +1 -1
  75. package/dist/mcp/tools/index.js +1 -1
  76. package/dist/mcp/tools/tdx-run.js +1 -1
  77. package/dist/mcp/tools/tdx-search.js +1 -1
  78. package/dist/mcp/utils.js +1 -1
  79. package/dist/proxy/claude-usage-tracker.js +1 -1
  80. package/dist/proxy/passthrough-server.js +1 -1
  81. package/dist/proxy/sse-usage-parser.js +1 -1
  82. package/dist/sdk/agent/agent-config.js +1 -1
  83. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  84. package/dist/sdk/agent/agent-yaml.js +1 -1
  85. package/dist/sdk/agent/test/evaluator.js +1 -1
  86. package/dist/sdk/agent/test/executor.js +1 -1
  87. package/dist/sdk/agent/test/index.js +1 -1
  88. package/dist/sdk/agent/test/output.js +1 -1
  89. package/dist/sdk/agent/test/parser.js +1 -1
  90. package/dist/sdk/agent/tool-target-registry.js +1 -1
  91. package/dist/sdk/api.js +1 -1
  92. package/dist/sdk/cas/cas-api-client.js +1 -1
  93. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  94. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  95. package/dist/sdk/cas/index.js +1 -1
  96. package/dist/sdk/cas/pull-workflow.js +1 -1
  97. package/dist/sdk/cas/push-workflow.js +1 -1
  98. package/dist/sdk/client/cdp-api-client.js +1 -1
  99. package/dist/sdk/client/delivery-api-client.js +1 -1
  100. package/dist/sdk/client/endpoints.js +1 -1
  101. package/dist/sdk/client/engage-api-client.js +1 -1
  102. package/dist/sdk/client/http-client.js +1 -1
  103. package/dist/sdk/client/llm-api-client.js +1 -1
  104. package/dist/sdk/client/oauth-refresh.js +1 -1
  105. package/dist/sdk/client/rate-limiter.js +1 -1
  106. package/dist/sdk/client/td-api-client.js +1 -1
  107. package/dist/sdk/client/trino-api-client.js +1 -1
  108. package/dist/sdk/client/workflow-client.js +1 -1
  109. package/dist/sdk/connection-validator.js +1 -1
  110. package/dist/sdk/connection.js +1 -1
  111. package/dist/sdk/delivery.js +1 -1
  112. package/dist/sdk/engage/campaign-pull.js +1 -1
  113. package/dist/sdk/engage/campaign-push.js +1 -1
  114. package/dist/sdk/engage/campaign-validator.js +1 -1
  115. package/dist/sdk/engage/campaign-yaml.js +1 -1
  116. package/dist/sdk/engage/template-pull.js +1 -1
  117. package/dist/sdk/engage/template-push.js +1 -1
  118. package/dist/sdk/engage/template-validator.js +1 -1
  119. package/dist/sdk/engage/template-yaml.js +1 -1
  120. package/dist/sdk/engage/types/campaign-def.js +1 -1
  121. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  122. package/dist/sdk/engage/types/template-schema.js +1 -1
  123. package/dist/sdk/engage.js +1 -1
  124. package/dist/sdk/errors.js +1 -1
  125. package/dist/sdk/index.js +1 -1
  126. package/dist/sdk/io/index.js +1 -1
  127. package/dist/sdk/io/node-filesystem.js +1 -1
  128. package/dist/sdk/job.js +1 -1
  129. package/dist/sdk/journey.js +1 -1
  130. package/dist/sdk/llm/chat-cache.js +1 -1
  131. package/dist/sdk/llm/index.js +1 -1
  132. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  133. package/dist/sdk/llm/model-factors.js +1 -1
  134. package/dist/sdk/personalization.js +1 -1
  135. package/dist/sdk/policy.js +1 -1
  136. package/dist/sdk/query/index.js +1 -1
  137. package/dist/sdk/query/sql-parser.js +1 -1
  138. package/dist/sdk/realtime.js +1 -1
  139. package/dist/sdk/schedule.js +1 -1
  140. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  141. package/dist/sdk/segment/fields-display.js +1 -1
  142. package/dist/sdk/segment/file-discovery.js +1 -1
  143. package/dist/sdk/segment/journey-utils.js +1 -1
  144. package/dist/sdk/segment/journey-validator.js +1 -1
  145. package/dist/sdk/segment/journey-yaml.js +1 -1
  146. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  147. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/pull-workflow.js +1 -1
  149. package/dist/sdk/segment/push-recovery.js +1 -1
  150. package/dist/sdk/segment/push-workflow.js +1 -1
  151. package/dist/sdk/segment/resolution-context.js +1 -1
  152. package/dist/sdk/segment/segment-path-parser.js +1 -1
  153. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  154. package/dist/sdk/segment/segment-validator.js +1 -1
  155. package/dist/sdk/segment/target-resolution.js +1 -1
  156. package/dist/sdk/segment/tdx-config.js +1 -1
  157. package/dist/sdk/segment/types/activation-schema.js +1 -1
  158. package/dist/sdk/segment/types/journey-def.js +1 -1
  159. package/dist/sdk/segment/types/journey-schema.js +1 -1
  160. package/dist/sdk/segment/types/segment-def.js +1 -1
  161. package/dist/sdk/segment/types/segment-schema.js +1 -1
  162. package/dist/sdk/segment/validate-files.js +1 -1
  163. package/dist/sdk/segment/yaml-validator.js +1 -1
  164. package/dist/sdk/segment.js +1 -1
  165. package/dist/sdk/types/index.js +1 -1
  166. package/dist/sdk/types/progress.js +1 -1
  167. package/dist/sdk/types/workspace.js +1 -1
  168. package/dist/sdk/user.js +1 -1
  169. package/dist/sdk/util/format-detector.js +1 -1
  170. package/dist/sdk/util/formatters.js +1 -1
  171. package/dist/sdk/util/index.js +1 -1
  172. package/dist/sdk/util/paginate.js +1 -1
  173. package/dist/sdk/util/tree-formatter.js +1 -1
  174. package/dist/sdk/workflow/archive-validation.js +1 -1
  175. package/dist/sdk/workflow/clone-workflow.js +1 -1
  176. package/dist/sdk/workflow/index.js +1 -1
  177. package/dist/sdk/workflow/pull-workflow.js +1 -1
  178. package/dist/sdk/workflow/push-workflow.js +1 -1
  179. package/dist/sdk/workflow/tdx-config.js +1 -1
  180. package/dist/sdk/workflow/workflow-utils.js +1 -1
  181. package/dist/sdk/workspace/frontmatter.js +1 -1
  182. package/dist/sdk/workspace/git.js +1 -1
  183. package/dist/sdk/workspace/index.js +1 -1
  184. package/dist/sdk/workspace/templates.js +1 -1
  185. package/dist/sdk/workspace/weekly.js +1 -1
  186. package/dist/sdk/workspace/wikilinks.js +1 -1
  187. package/dist/test-utils/command-runner.js +1 -1
  188. package/dist/test-utils/factories.js +1 -1
  189. package/dist/test-utils/fixtures.js +1 -1
  190. package/dist/test-utils/http-mock.js +1 -1
  191. package/dist/test-utils/index.js +1 -1
  192. package/dist/utils/async.js +1 -1
  193. package/dist/utils/colors.js +1 -1
  194. package/dist/utils/diff.js +1 -1
  195. package/dist/utils/file-permissions.js +1 -1
  196. package/dist/utils/file-reader.js +1 -1
  197. package/dist/utils/github-releases.js +1 -1
  198. package/dist/utils/global-cache.js +1 -1
  199. package/dist/utils/json-loader.js +1 -1
  200. package/dist/utils/local-cache.js +1 -1
  201. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  202. package/dist/utils/logger/formatters/index.js +1 -1
  203. package/dist/utils/logger/handlers/console-handler.js +1 -1
  204. package/dist/utils/logger/handlers/file-handler.js +1 -1
  205. package/dist/utils/logger/handlers/index.js +1 -1
  206. package/dist/utils/logger/handlers/null-handler.js +1 -1
  207. package/dist/utils/logger/index.js +1 -1
  208. package/dist/utils/logger/logger.js +1 -1
  209. package/dist/utils/logger/types.js +1 -1
  210. package/dist/utils/option-validation.js +1 -1
  211. package/dist/utils/process.js +1 -1
  212. package/dist/utils/prompt.js +1 -1
  213. package/dist/utils/spinner.js +1 -1
  214. package/dist/utils/sse-parser.js +1 -1
  215. package/dist/utils/string-utils.js +1 -1
  216. package/dist/utils/table-ref-parser.js +1 -1
  217. package/dist/utils/tdx-logger.js +1 -1
  218. package/dist/utils/version-check.js +1 -1
  219. package/package.json +1 -1
@@ -1 +1 @@
1
- const a26_0x1980be=a26_0x5d9a;(function(_0x2a7729,_0x28a63c){const _0x6255c6=a26_0x5d9a,_0x583bf4=_0x2a7729();while(!![]){try{const _0x257a32=parseInt(_0x6255c6(0x1ad))/0x1*(-parseInt(_0x6255c6(0x1a2))/0x2)+-parseInt(_0x6255c6(0x1b0))/0x3*(-parseInt(_0x6255c6(0x19d))/0x4)+-parseInt(_0x6255c6(0x1c0))/0x5*(-parseInt(_0x6255c6(0x1a4))/0x6)+parseInt(_0x6255c6(0x1aa))/0x7*(parseInt(_0x6255c6(0x1a5))/0x8)+parseInt(_0x6255c6(0x199))/0x9*(-parseInt(_0x6255c6(0x19f))/0xa)+-parseInt(_0x6255c6(0x18d))/0xb*(-parseInt(_0x6255c6(0x18b))/0xc)+parseInt(_0x6255c6(0x1a3))/0xd*(-parseInt(_0x6255c6(0x1a0))/0xe);if(_0x257a32===_0x28a63c)break;else _0x583bf4['push'](_0x583bf4['shift']());}catch(_0x24ec0a){_0x583bf4['push'](_0x583bf4['shift']());}}}(a26_0x1d38,0x2ceb7));import{BaseCommand}from'./command.js';function a26_0x5d9a(_0x1add11,_0xe3cc8c){_0x1add11=_0x1add11-0x189;const _0x1d387d=a26_0x1d38();let _0x5d9a6c=_0x1d387d[_0x1add11];return _0x5d9a6c;}import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';function a26_0x1d38(){const _0x4e67bb=['13139csDmSw','yellow','.yml','68067jtDbCW','\x20template(s)\x20with\x20errors,\x20','warningCount','18NKwWTP','\x20non-template\x20file(s)\x20skipped','cwd','template','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','valid','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20template(s)\x20valid','reason','hasErrors','engage:template:validate','resolve','dim','relativePath','.yaml','\x20warning(s)\x20found','5lTzfDI','Validation\x20failed:\x20','\x20(skipped:\x20','64548MqPrGA','warnings','704UEqvGx','name','validCount','green','No\x20template\x20YAML\x20files\x20found\x20in\x20','errors','endsWith','length','verbose','✔\x20All\x20','log','\x20valid','1179ANCcSu','description','filter','Validate\x20template\x20YAML\x20files','235588OZjMCA','skippedCount','19420gMkwJy','14upgMDh','error','8UBIlBg','1424839NBQexG','105084OEiBmc','448UBAsBK','Error:\x20Directory\x20not\x20found:\x20','\x20error(s)','\x20non-template\x20file(s)\x20skipped)','red'];a26_0x1d38=function(){return _0x4e67bb;};return a26_0x1d38();}import{existsSync}from'fs';import a26_0x54e1a9 from'chalk';import a26_0x26af47 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a26_0x1980be(0x18e)]=a26_0x1980be(0x1ba);[a26_0x1980be(0x19a)]=a26_0x1980be(0x19c);async['execute'](_0x54c637){const _0x478d18=a26_0x1980be,{options:_0x328c07,args:_0x8e689d}=_0x54c637,_0x2907cc=_0x328c07,_0x3a0f20=_0x8e689d[0x0],_0x1bd3fc=_0x3a0f20?a26_0x26af47[_0x478d18(0x1bb)](_0x3a0f20):undefined,_0x3d9e6c=_0x1bd3fc?isYamlFile(_0x1bd3fc):![];let _0x1e7c7c,_0xe7c17a;if(_0x3d9e6c&&_0x1bd3fc)_0x1e7c7c=a26_0x26af47['dirname'](_0x1bd3fc),_0xe7c17a=_0x1bd3fc;else _0x1bd3fc?_0x1e7c7c=_0x1bd3fc:_0x1e7c7c=process[_0x478d18(0x1b2)]();if(!_0xe7c17a&&!existsSync(_0x1e7c7c))return console[_0x478d18(0x1a1)](a26_0x54e1a9[_0x478d18(0x1a9)](_0x478d18(0x1a6)+_0x1e7c7c+'\x0a')),0x1;let _0x4da411;if(_0xe7c17a){if(!_0xe7c17a[_0x478d18(0x193)](_0x478d18(0x1ac))&&!_0xe7c17a[_0x478d18(0x193)](_0x478d18(0x1be)))return console['error'](a26_0x54e1a9[_0x478d18(0x1a9)](_0x478d18(0x1b4)+_0xe7c17a+'\x0a')),0x1;_0x4da411=[_0xe7c17a];}else _0x4da411=findYamlFiles(_0x1e7c7c);if(_0x4da411[_0x478d18(0x194)]===0x0)return console['error'](a26_0x54e1a9[_0x478d18(0x1a9)](_0x478d18(0x1b6)+_0x1e7c7c+'\x0a')),0x1;const _0x598c22=validateYamlFiles(_0x4da411,_0x1e7c7c,{'filterType':_0x478d18(0x1b3)}),_0x481317=calculateSummary(_0x598c22),_0x137b57=_0x598c22[_0x478d18(0x19b)](isValidationResult);if(_0x137b57[_0x478d18(0x194)]===0x0)return console[_0x478d18(0x1a1)](a26_0x54e1a9['yellow'](_0x478d18(0x191)+_0x1e7c7c+'\x0a')),_0x481317['skippedCount']>0x0&&console[_0x478d18(0x1a1)](a26_0x54e1a9[_0x478d18(0x1bc)]('('+_0x481317['skippedCount']+_0x478d18(0x1a8))),0x0;for(const _0xcb2b41 of _0x598c22){if(!isValidationResult(_0xcb2b41)){_0x2907cc[_0x478d18(0x195)]&&console[_0x478d18(0x197)](a26_0x54e1a9[_0x478d18(0x1bc)]('-\x20'+_0xcb2b41[_0x478d18(0x1bd)]+_0x478d18(0x18a)+_0xcb2b41[_0x478d18(0x1b8)]+')'));continue;}const {relativePath:_0x3873b5,source:_0x5b35e0,result:_0x2c789f}=_0xcb2b41;if(_0x2c789f[_0x478d18(0x1b5)]&&_0x2c789f[_0x478d18(0x18c)][_0x478d18(0x194)]===0x0)_0x2907cc[_0x478d18(0x195)]&&console['log'](a26_0x54e1a9[_0x478d18(0x190)]('✔\x20'+_0x3873b5));else _0x2c789f[_0x478d18(0x1b5)]?(console[_0x478d18(0x197)](a26_0x54e1a9[_0x478d18(0x1ab)]('⚠\x20'+_0x3873b5+':\x20'+_0x2c789f['warnings'][_0x478d18(0x194)]+'\x20warning(s)')),console[_0x478d18(0x197)](formatValidationResult(_0x2c789f,_0x5b35e0,_0x3873b5))):(console[_0x478d18(0x197)](a26_0x54e1a9['red']('✖\x20'+_0x3873b5+':\x20'+_0x2c789f[_0x478d18(0x192)][_0x478d18(0x194)]+_0x478d18(0x1a7))),console[_0x478d18(0x197)](formatValidationResult(_0x2c789f,_0x5b35e0,_0x3873b5)));}return console[_0x478d18(0x197)](''),_0x481317[_0x478d18(0x1b9)]?(console['log'](a26_0x54e1a9[_0x478d18(0x1a9)](_0x478d18(0x189)+_0x481317['invalidCount']+_0x478d18(0x1ae)+_0x481317[_0x478d18(0x18f)]+_0x478d18(0x198))),_0x481317[_0x478d18(0x1af)]>0x0&&console['log'](a26_0x54e1a9[_0x478d18(0x1ab)](_0x481317[_0x478d18(0x1af)]+_0x478d18(0x1bf))),_0x481317['skippedCount']>0x0&&console[_0x478d18(0x197)](a26_0x54e1a9['dim'](_0x481317['skippedCount']+_0x478d18(0x1b1))),0x1):(console['log'](a26_0x54e1a9[_0x478d18(0x190)](_0x478d18(0x196)+_0x481317[_0x478d18(0x18f)]+_0x478d18(0x1b7))),_0x481317['warningCount']>0x0&&console[_0x478d18(0x197)](a26_0x54e1a9[_0x478d18(0x1ab)](_0x481317[_0x478d18(0x1af)]+_0x478d18(0x1bf))),_0x481317['skippedCount']>0x0&&console['log'](a26_0x54e1a9['dim'](_0x481317[_0x478d18(0x19e)]+_0x478d18(0x1b1))),0x0);}}
1
+ const a26_0x462633=a26_0x1037;(function(_0x13787f,_0x4e3406){const _0x42e8a4=a26_0x1037,_0x5f3266=_0x13787f();while(!![]){try{const _0x4d5b23=parseInt(_0x42e8a4(0x101))/0x1*(-parseInt(_0x42e8a4(0xfb))/0x2)+parseInt(_0x42e8a4(0x11a))/0x3+parseInt(_0x42e8a4(0x102))/0x4+parseInt(_0x42e8a4(0x106))/0x5*(parseInt(_0x42e8a4(0x112))/0x6)+-parseInt(_0x42e8a4(0x110))/0x7+-parseInt(_0x42e8a4(0xfa))/0x8*(parseInt(_0x42e8a4(0xfe))/0x9)+parseInt(_0x42e8a4(0x128))/0xa;if(_0x4d5b23===_0x4e3406)break;else _0x5f3266['push'](_0x5f3266['shift']());}catch(_0xccd5a5){_0x5f3266['push'](_0x5f3266['shift']());}}}(a26_0x5d82,0xba140));import{BaseCommand}from'./command.js';function a26_0x5d82(){const _0x39d3ef=['error','Validation\x20failed:\x20','980775jUrFUO','engage:template:validate','dirname','validCount','description','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','red','Validate\x20template\x20YAML\x20files','errors','\x20non-template\x20file(s)\x20skipped','8761795dqipCf','valid','36ZacegL','filter','execute','cwd','Error:\x20Directory\x20not\x20found:\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20valid','yellow','2662035qsAbjB','\x20template(s)\x20valid','warningCount','\x20warning(s)\x20found','\x20template(s)\x20with\x20errors,\x20','verbose','template','\x20(skipped:\x20','\x20non-template\x20file(s)\x20skipped)','.yml','warnings','length','hasErrors','name','15693790UGFBzm','.yaml','dim','resolve','log','1247504uGdXIG','2ddSfJN','\x20error(s)','endsWith','72qQUUki','✔\x20All\x20','skippedCount','1428782rGLpnq','4225972MtcNIp','reason'];a26_0x5d82=function(){return _0x39d3ef;};return a26_0x5d82();}import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';function a26_0x1037(_0x5cbfb2,_0xa6fd6c){_0x5cbfb2=_0x5cbfb2-0xf9;const _0x5d8277=a26_0x5d82();let _0x10375d=_0x5d8277[_0x5cbfb2];return _0x10375d;}import{existsSync}from'fs';import a26_0x22ed22 from'chalk';import a26_0x392d84 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageTemplateValidateCommand extends BaseCommand{[a26_0x462633(0x127)]=a26_0x462633(0x107);[a26_0x462633(0x10a)]=a26_0x462633(0x10d);async[a26_0x462633(0x114)](_0x32b6a9){const _0x57d925=a26_0x462633,{options:_0x50531d,args:_0x2734c6}=_0x32b6a9,_0x32ca77=_0x50531d,_0x5a9f3a=_0x2734c6[0x0],_0x1cecf5=_0x5a9f3a?a26_0x392d84[_0x57d925(0x12b)](_0x5a9f3a):undefined,_0x5369f6=_0x1cecf5?isYamlFile(_0x1cecf5):![];let _0x2a6529,_0x55ae2e;if(_0x5369f6&&_0x1cecf5)_0x2a6529=a26_0x392d84[_0x57d925(0x108)](_0x1cecf5),_0x55ae2e=_0x1cecf5;else _0x1cecf5?_0x2a6529=_0x1cecf5:_0x2a6529=process[_0x57d925(0x115)]();if(!_0x55ae2e&&!existsSync(_0x2a6529))return console[_0x57d925(0x104)](a26_0x22ed22[_0x57d925(0x10c)](_0x57d925(0x116)+_0x2a6529+'\x0a')),0x1;let _0x229778;if(_0x55ae2e){if(!_0x55ae2e[_0x57d925(0xfd)](_0x57d925(0x123))&&!_0x55ae2e['endsWith'](_0x57d925(0x129)))return console[_0x57d925(0x104)](a26_0x22ed22['red'](_0x57d925(0x117)+_0x55ae2e+'\x0a')),0x1;_0x229778=[_0x55ae2e];}else _0x229778=findYamlFiles(_0x2a6529);if(_0x229778[_0x57d925(0x125)]===0x0)return console[_0x57d925(0x104)](a26_0x22ed22[_0x57d925(0x10c)](_0x57d925(0x10b)+_0x2a6529+'\x0a')),0x1;const _0x5a49f0=validateYamlFiles(_0x229778,_0x2a6529,{'filterType':_0x57d925(0x120)}),_0x4eac21=calculateSummary(_0x5a49f0),_0x3043f6=_0x5a49f0[_0x57d925(0x113)](isValidationResult);if(_0x3043f6['length']===0x0)return console['error'](a26_0x22ed22[_0x57d925(0x119)]('No\x20template\x20YAML\x20files\x20found\x20in\x20'+_0x2a6529+'\x0a')),_0x4eac21[_0x57d925(0x100)]>0x0&&console[_0x57d925(0x104)](a26_0x22ed22['dim']('('+_0x4eac21[_0x57d925(0x100)]+_0x57d925(0x122))),0x0;for(const _0x11ba26 of _0x5a49f0){if(!isValidationResult(_0x11ba26)){_0x32ca77[_0x57d925(0x11f)]&&console[_0x57d925(0xf9)](a26_0x22ed22[_0x57d925(0x12a)]('-\x20'+_0x11ba26['relativePath']+_0x57d925(0x121)+_0x11ba26[_0x57d925(0x103)]+')'));continue;}const {relativePath:_0x1ad33d,source:_0x13a42b,result:_0x44d229}=_0x11ba26;if(_0x44d229[_0x57d925(0x111)]&&_0x44d229[_0x57d925(0x124)]['length']===0x0)_0x32ca77[_0x57d925(0x11f)]&&console['log'](a26_0x22ed22['green']('✔\x20'+_0x1ad33d));else _0x44d229['valid']?(console[_0x57d925(0xf9)](a26_0x22ed22[_0x57d925(0x119)]('⚠\x20'+_0x1ad33d+':\x20'+_0x44d229[_0x57d925(0x124)][_0x57d925(0x125)]+'\x20warning(s)')),console['log'](formatValidationResult(_0x44d229,_0x13a42b,_0x1ad33d))):(console[_0x57d925(0xf9)](a26_0x22ed22['red']('✖\x20'+_0x1ad33d+':\x20'+_0x44d229[_0x57d925(0x10e)][_0x57d925(0x125)]+_0x57d925(0xfc))),console['log'](formatValidationResult(_0x44d229,_0x13a42b,_0x1ad33d)));}return console[_0x57d925(0xf9)](''),_0x4eac21[_0x57d925(0x126)]?(console[_0x57d925(0xf9)](a26_0x22ed22['red'](_0x57d925(0x105)+_0x4eac21['invalidCount']+_0x57d925(0x11e)+_0x4eac21['validCount']+_0x57d925(0x118))),_0x4eac21[_0x57d925(0x11c)]>0x0&&console[_0x57d925(0xf9)](a26_0x22ed22['yellow'](_0x4eac21[_0x57d925(0x11c)]+_0x57d925(0x11d))),_0x4eac21['skippedCount']>0x0&&console[_0x57d925(0xf9)](a26_0x22ed22[_0x57d925(0x12a)](_0x4eac21[_0x57d925(0x100)]+_0x57d925(0x10f))),0x1):(console[_0x57d925(0xf9)](a26_0x22ed22['green'](_0x57d925(0xff)+_0x4eac21[_0x57d925(0x109)]+_0x57d925(0x11b))),_0x4eac21[_0x57d925(0x11c)]>0x0&&console[_0x57d925(0xf9)](a26_0x22ed22[_0x57d925(0x119)](_0x4eac21['warningCount']+_0x57d925(0x11d))),_0x4eac21['skippedCount']>0x0&&console[_0x57d925(0xf9)](a26_0x22ed22[_0x57d925(0x12a)](_0x4eac21[_0x57d925(0x100)]+_0x57d925(0x10f))),0x0);}}
@@ -1 +1 @@
1
- const a27_0x3a1f23=a27_0x47cc;function a27_0x47cc(_0x54a56b,_0x16441c){_0x54a56b=_0x54a56b-0xb9;const _0x117792=a27_0x1177();let _0x47cc7d=_0x117792[_0x54a56b];return _0x47cc7d;}(function(_0x164be6,_0x444db6){const _0x4a5092=a27_0x47cc,_0x2c6763=_0x164be6();while(!![]){try{const _0x52f3b8=-parseInt(_0x4a5092(0xcd))/0x1*(parseInt(_0x4a5092(0xdd))/0x2)+-parseInt(_0x4a5092(0x104))/0x3*(-parseInt(_0x4a5092(0xe3))/0x4)+-parseInt(_0x4a5092(0xdf))/0x5+-parseInt(_0x4a5092(0xef))/0x6+parseInt(_0x4a5092(0xda))/0x7+-parseInt(_0x4a5092(0x109))/0x8+-parseInt(_0x4a5092(0xbd))/0x9*(-parseInt(_0x4a5092(0x105))/0xa);if(_0x52f3b8===_0x444db6)break;else _0x2c6763['push'](_0x2c6763['shift']());}catch(_0x8630d7){_0x2c6763['push'](_0x2c6763['shift']());}}}(a27_0x1177,0xf3a69));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a27_0x5be4ff from'chalk';function formatDuration(_0x17af83){const _0x10ccac=a27_0x47cc;if(_0x17af83<0x3c)return _0x17af83+'s';if(_0x17af83<0xe10)return Math['floor'](_0x17af83/0x3c)+'m\x20'+_0x17af83%0x3c+'s';const _0x533331=Math[_0x10ccac(0xc2)](_0x17af83/0xe10),_0xcdfef0=Math['floor'](_0x17af83%0xe10/0x3c);return _0xcdfef0>0x0?_0x533331+'h\x20'+_0xcdfef0+'m':_0x533331+'h';}function a27_0x1177(){const _0x4d8c50=['verbose','length','jobs','trino','success','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','3846VZUEXA','10rDtVDS','Query:\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','end_at','12246928DOBMaQ','\x20job','file','\x20row','name','getTime','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','Kill\x20a\x20job','information_schema','log','Getting\x20job\x20details...','Submitting\x20job...','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','job:result','m\x20ago','Listing\x20jobs...','debug','41317407jogfRC','Limit:\x20','just\x20now','yes','abs','floor','Status\x20filter:\x20','round','✔\x20Job\x20submitted','job_id','args','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','site','\x20jobs','push','presto','3pQrEdL','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','user_name','list','priority','result','start_at','No\x20SQL\x20statements\x20found\x20in\x20file','Submit\x20a\x20job','show','status','validate','job:show','384776pTGquc','d\x20ago','green','87732IrnxIC','\x20\x20Job\x20ID:\x20','9795545BLCPif','kill','submit','database','1228WudlJa','query','error','Get\x20job\x20results','✔\x20Retrieved\x20','job:kill','INVALID_ARGUMENT','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','description','now','Show\x20job\x20details','join','2518794FIeFJR','red','data','substring','execute','\x27\x20to\x20verify\x20the\x20job\x20status','List\x20jobs','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','Cancelled','dim','type','created_at','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','...','url'];a27_0x1177=function(){return _0x4d8c50;};return a27_0x1177();}function formatRelativeTime(_0x435c6f){const _0x35cd88=a27_0x47cc,_0x8ab0de=Date[_0x35cd88(0xec)]()-_0x435c6f['getTime'](),_0x12721c=Math['floor'](Math[_0x35cd88(0xc1)](_0x8ab0de)/0x3e8);if(_0x12721c<0x3c)return _0x35cd88(0xbf);const _0x1be853=Math['floor'](_0x12721c/0x3c);if(_0x1be853<0x3c)return _0x1be853+_0x35cd88(0xba);const _0x2acdcb=Math[_0x35cd88(0xc2)](_0x1be853/0x3c);if(_0x2acdcb<0x18)return _0x2acdcb+'h\x20ago';const _0x4c5901=Math[_0x35cd88(0xc2)](_0x2acdcb/0x18);if(_0x4c5901<0x1e)return _0x4c5901+_0x35cd88(0xdb);return Math['floor'](_0x4c5901/0x1e)+'mo\x20ago';}export class JobListCommand extends BaseCommand{[a27_0x3a1f23(0x10d)]=a27_0x3a1f23(0x100);['description']=a27_0x3a1f23(0xf5);async['execute'](_0x484fca){const _0x579016=a27_0x3a1f23,{options:_0x559115,tdx:_0x5982cf}=_0x484fca,_0x118958=resolveLimit(_0x559115['limit'],DEFAULT_DISPLAY_LIMIT),_0x57b4bc=_0x559115[_0x579016(0xd7)];_0x559115['verbose']&&(console['error'](_0x579016(0xbe)+_0x118958+_0x579016(0xca)),_0x57b4bc&&console['error'](_0x579016(0xc3)+_0x57b4bc));const _0x21ad68=await withSpinner(_0x579016(0xbb),()=>_0x5982cf[_0x579016(0x100)][_0x579016(0xd0)]({'from':0x0,'to':_0x118958-0x1,'status':_0x57b4bc}),{'verbose':_0x559115[_0x579016(0xfe)]}),_0x29f6b2=_0x21ad68['data'];console[_0x579016(0xe5)]('✔\x20Found\x20'+_0x29f6b2[_0x579016(0xff)]+_0x579016(0x10a)+(_0x29f6b2['length']!==0x1?'s':''));const _0x266017=_0x559115[_0x579016(0xc9)];if(isStructuredFormat(_0x559115)){const _0x3f2be9=_0x29f6b2['map'](_0x443ba2=>{const _0x236ead=_0x579016;let _0x56aa51;if(_0x443ba2[_0x236ead(0xd3)]&&_0x443ba2[_0x236ead(0x108)]){const _0x3673c9=new Date(_0x443ba2[_0x236ead(0xd3)])[_0x236ead(0x10e)](),_0x45d5e9=new Date(_0x443ba2[_0x236ead(0x108)])[_0x236ead(0x10e)]();_0x56aa51=Math[_0x236ead(0xc4)]((_0x45d5e9-_0x3673c9)/0x3e8);}return{'job_id':_0x443ba2[_0x236ead(0xc6)],'type':_0x443ba2['type']==='presto'?_0x236ead(0x101):_0x443ba2[_0x236ead(0xf9)],'status':_0x443ba2['status'],'user_name':_0x443ba2[_0x236ead(0xcf)],'duration_sec':_0x56aa51,'created_at':_0x443ba2[_0x236ead(0xfa)],'started_at':_0x443ba2[_0x236ead(0xd3)],'end_at':_0x443ba2[_0x236ead(0x108)]};});await handleSDKOutput(_0x3f2be9,_0x559115);}else for(const _0x49f548 of _0x29f6b2){const _0x33a558=_0x49f548[_0x579016(0xd7)]===_0x579016(0x102)?a27_0x5be4ff[_0x579016(0xdc)]:_0x49f548[_0x579016(0xd7)]===_0x579016(0xe5)?a27_0x5be4ff[_0x579016(0xf0)]:a27_0x5be4ff['dim'],_0x3d32c3=_0x33a558(_0x49f548[_0x579016(0xd7)]),_0x104837=getJobUrl(_0x266017,_0x49f548['job_id']),_0x14afbf=hyperlink(_0x49f548[_0x579016(0xc6)],_0x104837),_0x1c43ac=a27_0x5be4ff[_0x579016(0xf8)](_0x49f548[_0x579016(0xf9)]===_0x579016(0xcc)?_0x579016(0x101):_0x49f548[_0x579016(0xf9)]),_0x4cb8b4=[];if(_0x49f548['start_at']&&_0x49f548[_0x579016(0x108)]){const _0x2015a3=Math[_0x579016(0xc4)]((new Date(_0x49f548['end_at'])[_0x579016(0x10e)]()-new Date(_0x49f548[_0x579016(0xd3)])[_0x579016(0x10e)]())/0x3e8);_0x4cb8b4[_0x579016(0xcb)](formatDuration(_0x2015a3));}if(_0x49f548[_0x579016(0x108)])_0x4cb8b4['push'](formatRelativeTime(new Date(_0x49f548[_0x579016(0x108)])));else _0x49f548['start_at']&&_0x4cb8b4['push'](formatRelativeTime(new Date(_0x49f548[_0x579016(0xd3)])));const _0x261911=_0x4cb8b4[_0x579016(0xff)]>0x0?a27_0x5be4ff['dim']('\x20'+_0x4cb8b4[_0x579016(0xee)](',\x20')):'';console[_0x579016(0x112)]('⚡\x20'+_0x14afbf+'\x20'+_0x1c43ac+'\x20'+_0x3d32c3+_0x261911);}return 0x0;}}export class JobShowCommand extends BaseCommand{[a27_0x3a1f23(0x10d)]=a27_0x3a1f23(0xd9);[a27_0x3a1f23(0xeb)]=a27_0x3a1f23(0xed);[a27_0x3a1f23(0xd8)](_0x52417){const _0x34c942=a27_0x3a1f23,_0x47ecaf=_0x52417[_0x34c942(0xc7)][0x0];if(!_0x47ecaf)return _0x34c942(0xea);return undefined;}async[a27_0x3a1f23(0xf3)](_0x2f7027){const _0x4eda61=a27_0x3a1f23,{options:_0x26818e,args:_0x5ec631,tdx:_0x17b7c2}=_0x2f7027,_0x51d9c2=_0x5ec631[0x0],_0x35fb0a=await withSpinner(_0x4eda61(0x113),()=>_0x17b7c2[_0x4eda61(0x100)][_0x4eda61(0xd6)](_0x51d9c2),{'verbose':_0x26818e[_0x4eda61(0xfe)]}),_0x17f393=_0x35fb0a['data'];let _0x4308a0;if(_0x17f393[_0x4eda61(0xd3)]&&_0x17f393[_0x4eda61(0x108)]){const _0x5079bf=new Date(_0x17f393[_0x4eda61(0xd3)])['getTime'](),_0x2104e3=new Date(_0x17f393[_0x4eda61(0x108)])[_0x4eda61(0x10e)]();_0x4308a0=Math[_0x4eda61(0xc4)]((_0x2104e3-_0x5079bf)/0x3e8);}const _0x3bf383={'job_id':_0x17f393[_0x4eda61(0xc6)],'type':_0x17f393['type'],'status':_0x17f393[_0x4eda61(0xd7)],..._0x17f393[_0x4eda61(0xcf)]&&{'user_name':_0x17f393[_0x4eda61(0xcf)]},..._0x4308a0!==undefined&&{'duration_sec':_0x4308a0},..._0x17f393[_0x4eda61(0xfa)]&&{'created_at':_0x17f393['created_at']},..._0x17f393['start_at']&&{'started_at':_0x17f393['start_at']},..._0x17f393[_0x4eda61(0x108)]&&{'end_at':_0x17f393['end_at']},..._0x17f393['database']&&{'database':_0x17f393[_0x4eda61(0xe2)]},..._0x17f393[_0x4eda61(0xd1)]!==undefined&&{'priority':_0x17f393[_0x4eda61(0xd1)]},..._0x17f393[_0x4eda61(0xfd)]&&{'url':_0x17f393[_0x4eda61(0xfd)]},..._0x17f393[_0x4eda61(0xe4)]&&{'query':_0x17f393[_0x4eda61(0xe4)]},..._0x17f393[_0x4eda61(0xbc)]&&{'debug':_0x17f393[_0x4eda61(0xbc)]}};return await handleSingleObjectOutput(_0x3bf383,_0x26818e),0x0;}}export class JobKillCommand extends BaseCommand{[a27_0x3a1f23(0x10d)]=a27_0x3a1f23(0xe8);[a27_0x3a1f23(0xeb)]=a27_0x3a1f23(0x110);[a27_0x3a1f23(0xd8)](_0x36ab59){const _0x2cc145=a27_0x3a1f23,_0x4721e=_0x36ab59['args'][0x0];if(!_0x4721e)return _0x2cc145(0xf6);return undefined;}async[a27_0x3a1f23(0xf3)](_0xe3d9b7){const _0x2f0589=a27_0x3a1f23,{options:_0x2c906b,args:_0xd63c38,tdx:_0x2b1bad}=_0xe3d9b7,_0x455889=_0xd63c38[0x0];if(!_0x2c906b[_0x2f0589(0xc0)]){const _0x3b4bd7=await confirm(_0x2f0589(0xfb)+_0x455889+'?');if(!_0x3b4bd7)return console['error'](_0x2f0589(0xf7)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x2b1bad[_0x2f0589(0x100)][_0x2f0589(0xe0)](_0x455889),{'verbose':_0x2c906b[_0x2f0589(0xfe)]}),console[_0x2f0589(0xe5)](_0x2f0589(0xc8)+_0x455889),console['error'](_0x2f0589(0x103)+_0x455889+_0x2f0589(0xf4)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a27_0x3a1f23(0x10d)]='job:submit';['description']=a27_0x3a1f23(0xd5);async[a27_0x3a1f23(0xf3)](_0x31d990){const _0x3a231f=a27_0x3a1f23,{options:_0x36b158,args:_0x2a5ee2,tdx:_0x5ce0fb}=_0x31d990,_0x6616cc=_0x36b158['jobType']||_0x3a231f(0x101),_0x215163=_0x36b158[_0x3a231f(0x10b)],_0x9930e5=_0x36b158[_0x3a231f(0xe2)]||_0x3a231f(0x111),_0x40e440=_0x36b158[_0x3a231f(0xd2)];if(_0x6616cc!=='trino'&&_0x6616cc!=='hive')throw new SDKError(ErrorCode[_0x3a231f(0xe9)],_0x3a231f(0x10f));let _0x89b8a;if(_0x215163){if(_0x2a5ee2[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3a231f(0xce));const _0x38c7fa=readSqlStatementsFromFile(_0x215163);if(_0x38c7fa[_0x3a231f(0xff)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3a231f(0xd4));if(_0x38c7fa['length']>0x1)throw new SDKError(ErrorCode[_0x3a231f(0xe9)],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x89b8a=_0x38c7fa[0x0];}else{if(!_0x2a5ee2[0x0])throw new SDKError(ErrorCode[_0x3a231f(0xe9)],_0x3a231f(0x115));_0x89b8a=_0x2a5ee2[0x0];}_0x36b158[_0x3a231f(0xfe)]&&(console[_0x3a231f(0xe5)]('Job\x20type:\x20'+_0x6616cc),console[_0x3a231f(0xe5)]('Database:\x20'+_0x9930e5),console['error'](_0x3a231f(0x106)+_0x89b8a[_0x3a231f(0xf2)](0x0,0x64)+(_0x89b8a['length']>0x64?_0x3a231f(0xfc):'')));const _0x2ad675=await withSpinner(_0x3a231f(0x114),()=>_0x5ce0fb[_0x3a231f(0x100)][_0x3a231f(0xe1)](_0x9930e5,_0x89b8a,_0x6616cc,_0x40e440),{'verbose':_0x36b158['verbose']}),_0x3bd794=_0x2ad675[_0x3a231f(0xf1)];return console[_0x3a231f(0xe5)](_0x3a231f(0xc5)),console[_0x3a231f(0xe5)](_0x3a231f(0xde)+_0x3bd794[_0x3a231f(0xc6)]),await handleSDKOutput([_0x3bd794],_0x36b158),0x0;}}export class JobResultCommand extends BaseCommand{[a27_0x3a1f23(0x10d)]=a27_0x3a1f23(0xb9);[a27_0x3a1f23(0xeb)]=a27_0x3a1f23(0xe6);['validate'](_0x35095d){const _0x12e5db=a27_0x3a1f23,_0x1b94de=_0x35095d[_0x12e5db(0xc7)][0x0];if(!_0x1b94de)return _0x12e5db(0x107);return undefined;}async[a27_0x3a1f23(0xf3)](_0x248bb2){const _0x556be8=a27_0x3a1f23,{options:_0x2b6b38,args:_0x1eb123,tdx:_0x563ae7}=_0x248bb2,_0xa7cfe3=_0x1eb123[0x0],_0x464dfa=await withSpinner('Getting\x20job\x20results...',()=>_0x563ae7[_0x556be8(0x100)][_0x556be8(0xd2)](_0xa7cfe3),{'verbose':_0x2b6b38[_0x556be8(0xfe)]}),_0x48981d=_0x464dfa[_0x556be8(0xf1)];return console[_0x556be8(0xe5)](_0x556be8(0xe7)+_0x48981d[_0x556be8(0xff)]+_0x556be8(0x10c)+(_0x48981d[_0x556be8(0xff)]!==0x1?'s':'')),await handleSDKOutput(_0x48981d,_0x2b6b38),0x0;}}
1
+ const a27_0x42d217=a27_0x2376;(function(_0x2e036f,_0x5794d7){const _0x4b3176=a27_0x2376,_0x382eca=_0x2e036f();while(!![]){try{const _0x2a8ca7=-parseInt(_0x4b3176(0x19d))/0x1*(parseInt(_0x4b3176(0x161))/0x2)+parseInt(_0x4b3176(0x1b7))/0x3*(parseInt(_0x4b3176(0x164))/0x4)+-parseInt(_0x4b3176(0x19e))/0x5*(-parseInt(_0x4b3176(0x165))/0x6)+-parseInt(_0x4b3176(0x189))/0x7*(-parseInt(_0x4b3176(0x1b4))/0x8)+parseInt(_0x4b3176(0x160))/0x9*(-parseInt(_0x4b3176(0x1a8))/0xa)+-parseInt(_0x4b3176(0x167))/0xb+parseInt(_0x4b3176(0x1a0))/0xc*(-parseInt(_0x4b3176(0x1a2))/0xd);if(_0x2a8ca7===_0x5794d7)break;else _0x382eca['push'](_0x382eca['shift']());}catch(_0x4e0835){_0x382eca['push'](_0x382eca['shift']());}}}(a27_0x48be,0x602f6));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../sdk/query/sql-parser.js';import{confirm}from'../utils/prompt.js';function a27_0x2376(_0x302ef2,_0x442fec){_0x302ef2=_0x302ef2-0x15e;const _0x48beca=a27_0x48be();let _0x237625=_0x48beca[_0x302ef2];return _0x237625;}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{getJobUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';import a27_0x523ee9 from'chalk';function formatDuration(_0x36762f){const _0x3ac6bd=a27_0x2376;if(_0x36762f<0x3c)return _0x36762f+'s';if(_0x36762f<0xe10)return Math[_0x3ac6bd(0x18a)](_0x36762f/0x3c)+'m\x20'+_0x36762f%0x3c+'s';const _0x488b89=Math[_0x3ac6bd(0x18a)](_0x36762f/0xe10),_0x151bc2=Math[_0x3ac6bd(0x18a)](_0x36762f%0xe10/0x3c);return _0x151bc2>0x0?_0x488b89+'h\x20'+_0x151bc2+'m':_0x488b89+'h';}function formatRelativeTime(_0x68b7fe){const _0x28b5ad=a27_0x2376,_0x4a55fc=Date[_0x28b5ad(0x17c)]()-_0x68b7fe[_0x28b5ad(0x1a7)](),_0x239db6=Math['floor'](Math[_0x28b5ad(0x16b)](_0x4a55fc)/0x3e8);if(_0x239db6<0x3c)return'just\x20now';const _0x149873=Math[_0x28b5ad(0x18a)](_0x239db6/0x3c);if(_0x149873<0x3c)return _0x149873+_0x28b5ad(0x1bb);const _0x421b4d=Math[_0x28b5ad(0x18a)](_0x149873/0x3c);if(_0x421b4d<0x18)return _0x421b4d+'h\x20ago';const _0xb020fd=Math[_0x28b5ad(0x18a)](_0x421b4d/0x18);if(_0xb020fd<0x1e)return _0xb020fd+_0x28b5ad(0x18e);return Math['floor'](_0xb020fd/0x1e)+_0x28b5ad(0x180);}export class JobListCommand extends BaseCommand{[a27_0x42d217(0x183)]=a27_0x42d217(0x1a5);['description']='List\x20jobs';async[a27_0x42d217(0x1bc)](_0x2d3142){const _0x3ce7bd=a27_0x42d217,{options:_0x1cb0e2,tdx:_0x50d448}=_0x2d3142,_0x3f8998=resolveLimit(_0x1cb0e2['limit'],DEFAULT_DISPLAY_LIMIT),_0x34e4ee=_0x1cb0e2['status'];_0x1cb0e2[_0x3ce7bd(0x193)]&&(console[_0x3ce7bd(0x18d)](_0x3ce7bd(0x16c)+_0x3f8998+_0x3ce7bd(0x195)),_0x34e4ee&&console['error'](_0x3ce7bd(0x197)+_0x34e4ee));const _0x1edadf=await withSpinner(_0x3ce7bd(0x1b6),()=>_0x50d448['jobs'][_0x3ce7bd(0x198)]({'from':0x0,'to':_0x3f8998-0x1,'status':_0x34e4ee}),{'verbose':_0x1cb0e2[_0x3ce7bd(0x193)]}),_0x140c3f=_0x1edadf[_0x3ce7bd(0x192)];console[_0x3ce7bd(0x18d)](_0x3ce7bd(0x1ae)+_0x140c3f[_0x3ce7bd(0x190)]+_0x3ce7bd(0x1a6)+(_0x140c3f[_0x3ce7bd(0x190)]!==0x1?'s':''));const _0x1e4949=_0x1cb0e2['site'];if(isStructuredFormat(_0x1cb0e2)){const _0x400bfe=_0x140c3f['map'](_0x346873=>{const _0x33f066=_0x3ce7bd;let _0x1c984a;if(_0x346873['start_at']&&_0x346873[_0x33f066(0x178)]){const _0x111cab=new Date(_0x346873[_0x33f066(0x15e)])[_0x33f066(0x1a7)](),_0x38b4c9=new Date(_0x346873[_0x33f066(0x178)])[_0x33f066(0x1a7)]();_0x1c984a=Math[_0x33f066(0x174)]((_0x38b4c9-_0x111cab)/0x3e8);}return{'job_id':_0x346873[_0x33f066(0x17e)],'type':_0x346873[_0x33f066(0x18c)]===_0x33f066(0x191)?_0x33f066(0x1a3):_0x346873[_0x33f066(0x18c)],'status':_0x346873[_0x33f066(0x1b5)],'user_name':_0x346873[_0x33f066(0x1b8)],'duration_sec':_0x1c984a,'created_at':_0x346873[_0x33f066(0x173)],'started_at':_0x346873[_0x33f066(0x15e)],'end_at':_0x346873['end_at']};});await handleSDKOutput(_0x400bfe,_0x1cb0e2);}else for(const _0x211afa of _0x140c3f){const _0x13279b=_0x211afa[_0x3ce7bd(0x1b5)]===_0x3ce7bd(0x163)?a27_0x523ee9[_0x3ce7bd(0x1a1)]:_0x211afa[_0x3ce7bd(0x1b5)]==='error'?a27_0x523ee9[_0x3ce7bd(0x162)]:a27_0x523ee9[_0x3ce7bd(0x187)],_0x2b1cd1=_0x13279b(_0x211afa['status']),_0x644b79=getJobUrl(_0x1e4949,_0x211afa[_0x3ce7bd(0x17e)]),_0x32e9d9=hyperlink(_0x211afa['job_id'],_0x644b79),_0x2c0266=a27_0x523ee9[_0x3ce7bd(0x187)](_0x211afa[_0x3ce7bd(0x18c)]==='presto'?'trino':_0x211afa['type']),_0x185b8d=[];if(_0x211afa[_0x3ce7bd(0x15e)]&&_0x211afa[_0x3ce7bd(0x178)]){const _0x183d1e=Math['round']((new Date(_0x211afa[_0x3ce7bd(0x178)])[_0x3ce7bd(0x1a7)]()-new Date(_0x211afa[_0x3ce7bd(0x15e)])[_0x3ce7bd(0x1a7)]())/0x3e8);_0x185b8d[_0x3ce7bd(0x1b2)](formatDuration(_0x183d1e));}if(_0x211afa[_0x3ce7bd(0x178)])_0x185b8d['push'](formatRelativeTime(new Date(_0x211afa[_0x3ce7bd(0x178)])));else _0x211afa[_0x3ce7bd(0x15e)]&&_0x185b8d[_0x3ce7bd(0x1b2)](formatRelativeTime(new Date(_0x211afa['start_at'])));const _0x51bfc6=_0x185b8d[_0x3ce7bd(0x190)]>0x0?a27_0x523ee9[_0x3ce7bd(0x187)]('\x20'+_0x185b8d[_0x3ce7bd(0x1b9)](',\x20')):'';console[_0x3ce7bd(0x1ba)]('⚡\x20'+_0x32e9d9+'\x20'+_0x2c0266+'\x20'+_0x2b1cd1+_0x51bfc6);}return 0x0;}}function a27_0x48be(){const _0x412d87=['job:kill','type','error','d\x20ago','submit','length','presto','data','verbose','args','\x20jobs','priority','Status\x20filter:\x20','list','query','Get\x20job\x20results','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','\x27\x20to\x20verify\x20the\x20job\x20status','1368AEQhpI','5dylAnA','✔\x20Job\x20submitted','3618396CbTkve','green','13fOpYaA','trino','Cancelled','jobs','\x20job','getTime','10OKoqsG','hive','\x20\x20Job\x20ID:\x20','result','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','yes','✔\x20Found\x20','show','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','push','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','1911872xxmraT','status','Listing\x20jobs...','1282221jABzvE','user_name','join','log','m\x20ago','execute','Getting\x20job\x20details...','Submitting\x20kill\x20request...','start_at','debug','3871323DVthRc','178SiBtir','red','success','4uFkgFg','2423874IKqUEJ','job:submit','681428UNYfHw','✔\x20Kill\x20request\x20submitted\x20for\x20job\x20','file','\x20row','abs','Limit:\x20','Kill\x20a\x20job','database','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','...','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','url','created_at','round','Getting\x20job\x20results...','validate','Submit\x20a\x20job','end_at','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','INVALID_ARGUMENT','job:show','now','job:result','job_id','kill','mo\x20ago','Submitting\x20job...','jobType','name','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','No\x20SQL\x20statements\x20found\x20in\x20file','description','dim','substring','14XZIaTa','floor'];a27_0x48be=function(){return _0x412d87;};return a27_0x48be();}export class JobShowCommand extends BaseCommand{[a27_0x42d217(0x183)]=a27_0x42d217(0x17b);[a27_0x42d217(0x186)]='Show\x20job\x20details';[a27_0x42d217(0x176)](_0x9cda29){const _0x4acb83=a27_0x42d217,_0xbfa604=_0x9cda29[_0x4acb83(0x194)][0x0];if(!_0xbfa604)return _0x4acb83(0x1b0);return undefined;}async[a27_0x42d217(0x1bc)](_0x400292){const _0x2ec3c7=a27_0x42d217,{options:_0x2355c0,args:_0x48741d,tdx:_0x482d8a}=_0x400292,_0x45750b=_0x48741d[0x0],_0x5ab690=await withSpinner(_0x2ec3c7(0x1bd),()=>_0x482d8a[_0x2ec3c7(0x1a5)][_0x2ec3c7(0x1af)](_0x45750b),{'verbose':_0x2355c0['verbose']}),_0x140885=_0x5ab690[_0x2ec3c7(0x192)];let _0x15853b;if(_0x140885[_0x2ec3c7(0x15e)]&&_0x140885['end_at']){const _0x34666c=new Date(_0x140885[_0x2ec3c7(0x15e)])['getTime'](),_0xd90d9b=new Date(_0x140885[_0x2ec3c7(0x178)])[_0x2ec3c7(0x1a7)]();_0x15853b=Math[_0x2ec3c7(0x174)]((_0xd90d9b-_0x34666c)/0x3e8);}const _0x2440e5={'job_id':_0x140885[_0x2ec3c7(0x17e)],'type':_0x140885[_0x2ec3c7(0x18c)],'status':_0x140885['status'],..._0x140885[_0x2ec3c7(0x1b8)]&&{'user_name':_0x140885[_0x2ec3c7(0x1b8)]},..._0x15853b!==undefined&&{'duration_sec':_0x15853b},..._0x140885['created_at']&&{'created_at':_0x140885[_0x2ec3c7(0x173)]},..._0x140885[_0x2ec3c7(0x15e)]&&{'started_at':_0x140885[_0x2ec3c7(0x15e)]},..._0x140885[_0x2ec3c7(0x178)]&&{'end_at':_0x140885[_0x2ec3c7(0x178)]},..._0x140885[_0x2ec3c7(0x16e)]&&{'database':_0x140885[_0x2ec3c7(0x16e)]},..._0x140885[_0x2ec3c7(0x196)]!==undefined&&{'priority':_0x140885[_0x2ec3c7(0x196)]},..._0x140885[_0x2ec3c7(0x172)]&&{'url':_0x140885[_0x2ec3c7(0x172)]},..._0x140885[_0x2ec3c7(0x199)]&&{'query':_0x140885[_0x2ec3c7(0x199)]},..._0x140885['debug']&&{'debug':_0x140885[_0x2ec3c7(0x15f)]}};return await handleSingleObjectOutput(_0x2440e5,_0x2355c0),0x0;}}export class JobKillCommand extends BaseCommand{[a27_0x42d217(0x183)]=a27_0x42d217(0x18b);[a27_0x42d217(0x186)]=a27_0x42d217(0x16d);[a27_0x42d217(0x176)](_0x1a16ce){const _0x4194c8=a27_0x42d217,_0x229216=_0x1a16ce['args'][0x0];if(!_0x229216)return _0x4194c8(0x179);return undefined;}async[a27_0x42d217(0x1bc)](_0x51274e){const _0x147f97=a27_0x42d217,{options:_0x2440f8,args:_0x37861a,tdx:_0x3cfbdc}=_0x51274e,_0x92f940=_0x37861a[0x0];if(!_0x2440f8[_0x147f97(0x1ad)]){const _0x2bf66b=await confirm(_0x147f97(0x171)+_0x92f940+'?');if(!_0x2bf66b)return console['error'](_0x147f97(0x1a4)),0x0;}return await withSpinner(_0x147f97(0x1be),()=>_0x3cfbdc[_0x147f97(0x1a5)][_0x147f97(0x17f)](_0x92f940),{'verbose':_0x2440f8[_0x147f97(0x193)]}),console['error'](_0x147f97(0x168)+_0x92f940),console['error'](_0x147f97(0x16f)+_0x92f940+_0x147f97(0x19c)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a27_0x42d217(0x183)]=a27_0x42d217(0x166);[a27_0x42d217(0x186)]=a27_0x42d217(0x177);async[a27_0x42d217(0x1bc)](_0x14cbae){const _0x5096f8=a27_0x42d217,{options:_0x2a5fcd,args:_0x5ee89f,tdx:_0x1df2fc}=_0x14cbae,_0xdfa449=_0x2a5fcd[_0x5096f8(0x182)]||_0x5096f8(0x1a3),_0x1f7487=_0x2a5fcd[_0x5096f8(0x169)],_0x5b37c8=_0x2a5fcd[_0x5096f8(0x16e)]||'information_schema',_0xb98e55=_0x2a5fcd[_0x5096f8(0x1ab)];if(_0xdfa449!==_0x5096f8(0x1a3)&&_0xdfa449!==_0x5096f8(0x1a9))throw new SDKError(ErrorCode[_0x5096f8(0x17a)],_0x5096f8(0x184));let _0x5c7ef5;if(_0x1f7487){if(_0x5ee89f[0x0])throw new SDKError(ErrorCode[_0x5096f8(0x17a)],_0x5096f8(0x19b));const _0x17caf5=readSqlStatementsFromFile(_0x1f7487);if(_0x17caf5['length']===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x5096f8(0x185));if(_0x17caf5[_0x5096f8(0x190)]>0x1)throw new SDKError(ErrorCode[_0x5096f8(0x17a)],_0x5096f8(0x1b3));_0x5c7ef5=_0x17caf5[0x0];}else{if(!_0x5ee89f[0x0])throw new SDKError(ErrorCode[_0x5096f8(0x17a)],_0x5096f8(0x1b1));_0x5c7ef5=_0x5ee89f[0x0];}_0x2a5fcd[_0x5096f8(0x193)]&&(console[_0x5096f8(0x18d)]('Job\x20type:\x20'+_0xdfa449),console[_0x5096f8(0x18d)]('Database:\x20'+_0x5b37c8),console[_0x5096f8(0x18d)]('Query:\x20'+_0x5c7ef5[_0x5096f8(0x188)](0x0,0x64)+(_0x5c7ef5[_0x5096f8(0x190)]>0x64?_0x5096f8(0x170):'')));const _0x4c9edf=await withSpinner(_0x5096f8(0x181),()=>_0x1df2fc[_0x5096f8(0x1a5)][_0x5096f8(0x18f)](_0x5b37c8,_0x5c7ef5,_0xdfa449,_0xb98e55),{'verbose':_0x2a5fcd['verbose']}),_0x1f40dd=_0x4c9edf[_0x5096f8(0x192)];return console[_0x5096f8(0x18d)](_0x5096f8(0x19f)),console['error'](_0x5096f8(0x1aa)+_0x1f40dd[_0x5096f8(0x17e)]),await handleSDKOutput([_0x1f40dd],_0x2a5fcd),0x0;}}export class JobResultCommand extends BaseCommand{[a27_0x42d217(0x183)]=a27_0x42d217(0x17d);[a27_0x42d217(0x186)]=a27_0x42d217(0x19a);['validate'](_0x4cf67d){const _0xc62aba=a27_0x42d217,_0x3d23d0=_0x4cf67d[_0xc62aba(0x194)][0x0];if(!_0x3d23d0)return _0xc62aba(0x1ac);return undefined;}async[a27_0x42d217(0x1bc)](_0x521547){const _0x2a9b4a=a27_0x42d217,{options:_0x9fc269,args:_0x199697,tdx:_0x317921}=_0x521547,_0x307fe2=_0x199697[0x0],_0x4ff00f=await withSpinner(_0x2a9b4a(0x175),()=>_0x317921['jobs'][_0x2a9b4a(0x1ab)](_0x307fe2),{'verbose':_0x9fc269[_0x2a9b4a(0x193)]}),_0x2fd2a4=_0x4ff00f[_0x2a9b4a(0x192)];return console[_0x2a9b4a(0x18d)]('✔\x20Retrieved\x20'+_0x2fd2a4['length']+_0x2a9b4a(0x16a)+(_0x2fd2a4[_0x2a9b4a(0x190)]!==0x1?'s':'')),await handleSDKOutput(_0x2fd2a4,_0x9fc269),0x0;}}
@@ -1 +1 @@
1
- const a28_0xdd66dd=a28_0x187d;(function(_0x4ebe83,_0x1b7e20){const _0x38def2=a28_0x187d,_0x16b38c=_0x4ebe83();while(!![]){try{const _0x3f9d8c=parseInt(_0x38def2(0x1cb))/0x1+parseInt(_0x38def2(0x145))/0x2*(parseInt(_0x38def2(0x18e))/0x3)+-parseInt(_0x38def2(0x19f))/0x4*(parseInt(_0x38def2(0x1a3))/0x5)+parseInt(_0x38def2(0x1e1))/0x6*(-parseInt(_0x38def2(0x135))/0x7)+-parseInt(_0x38def2(0x119))/0x8*(-parseInt(_0x38def2(0x18a))/0x9)+parseInt(_0x38def2(0x1e9))/0xa+-parseInt(_0x38def2(0x101))/0xb*(parseInt(_0x38def2(0x140))/0xc);if(_0x3f9d8c===_0x1b7e20)break;else _0x16b38c['push'](_0x16b38c['shift']());}catch(_0x166a19){_0x16b38c['push'](_0x16b38c['shift']());}}}(a28_0x4df2,0x68fc2));import a28_0x1f0e80 from'chalk';import a28_0x16999a 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';function a28_0x187d(_0xe54cbd,_0xb8a120){_0xe54cbd=_0xe54cbd-0xe7;const _0x4df25e=a28_0x4df2();let _0x187dfb=_0x4df25e[_0xe54cbd];return _0x187dfb;}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(_0x306fb4){const _0x3fe459=a28_0x187d;return!_0x306fb4&&(console[_0x3fe459(0x139)](_0x3fe459(0x120)),console[_0x3fe459(0x139)](_0x3fe459(0x162))),!!_0x306fb4;}function withJsonFormat(_0x57f9a5){const _0x51a475=a28_0x187d;if(!_0x57f9a5[_0x51a475(0x16d)]&&!_0x57f9a5[_0x51a475(0x197)]&&!_0x57f9a5['jsonl']&&!_0x57f9a5[_0x51a475(0x11c)])return{..._0x57f9a5,'format':'json','json':!![]};return _0x57f9a5;}function formatJourneyState(_0x3f612d){const _0x148058=a28_0x187d;switch(_0x3f612d){case _0x148058(0x111):return a28_0x1f0e80['green'](_0x148058(0xf6));case _0x148058(0x1a0):return a28_0x1f0e80['dim'](_0x148058(0x17e));case _0x148058(0x127):return a28_0x1f0e80['yellow'](_0x148058(0x128));case _0x148058(0x1c7):return a28_0x1f0e80[_0x148058(0xe7)]('(completed)');case _0x148058(0x156):return a28_0x1f0e80[_0x148058(0xff)](_0x148058(0x15a));default:return'('+_0x3f612d+')';}}function formatJourneyItem(_0x8e9060,_0x311861='',_0x1fd5d5){const _0x5c6692=a28_0x187d,_0x23a1d3=formatJourneyState(_0x8e9060['state']),_0x4a7bc3=_0x1fd5d5?hyperlink(_0x8e9060[_0x5c6692(0x131)],_0x1fd5d5):_0x8e9060[_0x5c6692(0x131)];return _0x311861+'🗺️\x20'+_0x4a7bc3+'\x20'+_0x23a1d3;}function escapeRegex(_0x2c8b16){const _0x4a84cb=a28_0x187d;return _0x2c8b16[_0x4a84cb(0xea)](/[.*+?^${}()|[\]\\]/g,_0x4a84cb(0x14c));}function globToRegex(_0x36ceb8){const _0x5cefd9=a28_0x187d,_0x482664=_0x36ceb8[_0x5cefd9(0x14f)]('*')[_0x5cefd9(0x19a)](escapeRegex);return new RegExp(_0x482664[_0x5cefd9(0x1c6)]('.*'),'i');}function buildRuleToNameMapping(_0x5e3f0e){const _0xb78c7b=a28_0x187d,_0x1dba9d=new Map();if(_0x5e3f0e['segments'])for(const [_0x295749,_0x46b0af]of Object[_0xb78c7b(0x16a)](_0x5e3f0e[_0xb78c7b(0xeb)])){if(_0x46b0af[_0xb78c7b(0x147)]){const _0x47beb8=serializeRule(_0x46b0af['rule']),_0x56e2f6=_0x1dba9d[_0xb78c7b(0x122)](_0x47beb8);_0x56e2f6?_0x56e2f6[_0xb78c7b(0x163)](_0x295749):_0x1dba9d[_0xb78c7b(0x13f)](_0x47beb8,[_0x295749]);}}return _0x1dba9d;}async function resolveJourneyIdFromInput(_0x4480e1,_0x3fca8c,_0xf7e1e7){const _0x429bb9=a28_0x187d,_0x4d093f=await resolveJourneyTarget(_0x4480e1,_0x3fca8c[_0x429bb9(0xfe)],_0x3fca8c['verbose']),_0x25d5a6=_0x4d093f['parentSegment'];if(!_0x25d5a6)throw new SDKError(ErrorCode[_0x429bb9(0x123)],_0x429bb9(0x138));const _0x343207=await withSpinner(_0x429bb9(0x1e2),()=>_0xf7e1e7[_0x429bb9(0x105)][_0x429bb9(0x142)](_0x25d5a6),{'verbose':_0x3fca8c['verbose']}),_0x2b0ec1=_0x343207[_0x429bb9(0x14d)],_0x2c3a0a=await withSpinner(_0x429bb9(0x1a8),()=>_0xf7e1e7[_0x429bb9(0x1bf)][_0x429bb9(0x1e6)](_0x2b0ec1,_0x4d093f['journeyName']),{'verbose':_0x3fca8c[_0x429bb9(0x1bc)]});return{'journeyId':_0x2c3a0a[_0x429bb9(0x14d)],'journeyName':_0x4d093f[_0x429bb9(0x155)],'parentSegmentId':_0x2b0ec1};}async function resolveJourneyTarget(_0x1178d8,_0x235cc3,_0x1a5c57){const _0x1b0ba9=a28_0x187d;if(isYamlFilePath(_0x1178d8))try{const _0xd009f=await resolveYamlFilePath(_0x1178d8);return _0x1a5c57&&(console[_0x1b0ba9(0x139)](_0x1b0ba9(0x1b2)+_0x1178d8),console[_0x1b0ba9(0x139)](_0x1b0ba9(0x164)+_0xd009f['parentSegment']),console[_0x1b0ba9(0x139)]('\x20\x20Name:\x20'+_0xd009f[_0x1b0ba9(0x1f5)]),console[_0x1b0ba9(0x139)]('\x20\x20Folder\x20path:\x20'+(_0xd009f[_0x1b0ba9(0x14b)]||_0x1b0ba9(0x12d)))),{'journeyName':_0xd009f[_0x1b0ba9(0x1f5)],'parentSegment':_0xd009f[_0x1b0ba9(0xfe)],'resolved':_0xd009f};}catch(_0x12d6fd){throw new SDKError(ErrorCode[_0x1b0ba9(0x123)],_0x1b0ba9(0x1da)+_0x12d6fd[_0x1b0ba9(0x110)]);}if(!_0x235cc3)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x1b0ba9(0xf1));return{'journeyName':_0x1178d8,'parentSegment':_0x235cc3};}export class JourneyListCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x18f);[a28_0xdd66dd(0x1a4)]='List\x20journeys\x20in\x20current\x20context';async[a28_0xdd66dd(0x1b1)](_0x2a053d){const _0x141376=a28_0xdd66dd,{options:_0xd61c91,args:_0x6b2ddb,tdx:_0x242f62}=_0x2a053d,_0x313fc0=_0x6b2ddb[0x0],_0x4376da=_0xd61c91[_0x141376(0xfe)];if(!_0x4376da)return console[_0x141376(0x139)](_0x141376(0x15e)),console['error'](_0x141376(0x134)),0x1;const _0x5a65d0=await withSpinner(_0x141376(0x1e2),()=>_0x242f62[_0x141376(0x105)]['resolveParentId'](_0x4376da),{'verbose':_0xd61c91[_0x141376(0x1bc)]}),_0x4a1dce=_0x5a65d0['data'];_0xd61c91[_0x141376(0x1bc)]&&(console[_0x141376(0x139)](_0x141376(0x149)+_0x4376da+'\x20(ID:\x20'+_0x4a1dce+')'),_0x313fc0&&console[_0x141376(0x139)](_0x141376(0x182)+_0x313fc0));const _0x73ea9=await withSpinner(_0x141376(0x1ee),()=>_0x242f62['segment'][_0x141376(0x12a)](_0x4a1dce),{'verbose':_0xd61c91[_0x141376(0x1bc)]}),_0x1bc91f=_0x73ea9[_0x141376(0x14d)],_0xfe038f=_0x1bc91f['rootFolderId'],_0x1e506e=await withSpinner('Listing\x20journeys...',()=>_0x242f62[_0x141376(0x1bf)]['listJourneysWithFolders'](_0x4a1dce,_0xfe038f),{'verbose':_0xd61c91[_0x141376(0x1bc)]});let _0x4b9399=_0x1e506e[_0x141376(0x14d)][_0x141376(0x1c5)];const _0x5e9555=_0x1e506e[_0x141376(0x14d)][_0x141376(0x17b)],_0x4bb7fd=new Map();for(const _0x2a1441 of _0x5e9555){_0x4bb7fd[_0x141376(0x13f)](_0x2a1441['id'],_0x2a1441[_0x141376(0x10b)]);}if(_0x313fc0){const _0xeccb60=globToRegex(_0x313fc0);_0x4b9399=_0x4b9399[_0x141376(0x10e)](_0x5410a6=>_0xeccb60['test'](_0x5410a6[_0x141376(0x131)]));}console[_0x141376(0x139)](_0x141376(0x195)+_0x4b9399[_0x141376(0x1b6)]+_0x141376(0x1d3)+(_0x4b9399['length']!==0x1?'s':''));const _0x7ee818=_0x42bec3=>{const _0xcb3a3a=_0x141376;return getConsoleNextUrl(_0xd61c91['site'],_0xcb3a3a(0x104)+_0x4a1dce+_0xcb3a3a(0x1c3)+_0x42bec3+_0xcb3a3a(0x161));};if(_0xd61c91[_0x141376(0x16d)]===_0x141376(0x1c4))await handleSDKOutput(_0x4b9399,_0xd61c91);else{if(_0xd61c91[_0x141376(0x16d)]==='json'){const _0x16c4fc=_0x4b9399[_0x141376(0x19a)](_0x2fae5e=>({..._0x2fae5e,'url':_0x7ee818(_0x2fae5e['id'])}));await handleSDKOutput(_0x16c4fc,_0xd61c91);}else{console['log']('['+_0x4376da+']');const _0x4e8d4f=new Map(),_0x2aae63=[];for(const _0x2a1018 of _0x4b9399){if(!_0x2a1018[_0x141376(0x191)]||_0x2a1018[_0x141376(0x191)]===_0xfe038f)_0x2aae63[_0x141376(0x163)](_0x2a1018);else{const _0x5f32f4=_0x4e8d4f[_0x141376(0x122)](_0x2a1018[_0x141376(0x191)])||[];_0x5f32f4[_0x141376(0x163)](_0x2a1018),_0x4e8d4f[_0x141376(0x13f)](_0x2a1018['folderId'],_0x5f32f4);}}const _0x2343c1=(_0x55aeec,_0x395a29)=>_0x55aeec[_0x141376(0x131)]['localeCompare'](_0x395a29[_0x141376(0x131)],undefined,{'sensitivity':_0x141376(0x190)});_0x2aae63[_0x141376(0x148)](_0x2343c1);for(const _0x2ff21b of _0x2aae63){console[_0x141376(0x169)](formatJourneyItem(_0x2ff21b,'',_0x7ee818(_0x2ff21b['id'])));}const _0x313ac9=[..._0x4e8d4f[_0x141376(0x16a)]()][_0x141376(0x148)]((_0x27eac9,_0x48614c)=>{const _0x2313bf=_0x141376,_0x1334d4=_0x4bb7fd['get'](_0x27eac9[0x0])||_0x27eac9[0x0],_0x4f8f7b=_0x4bb7fd[_0x2313bf(0x122)](_0x48614c[0x0])||_0x48614c[0x0];return _0x1334d4[_0x2313bf(0x1a6)](_0x4f8f7b,undefined,{'sensitivity':_0x2313bf(0x190)});});for(const [_0x52ba94,_0x2f71f1]of _0x313ac9){const _0x354e9d=_0x4bb7fd['get'](_0x52ba94)||_0x52ba94;console[_0x141376(0x169)](_0x141376(0x13e)+_0x354e9d),_0x2f71f1[_0x141376(0x148)](_0x2343c1);for(const _0x354699 of _0x2f71f1){console['log'](formatJourneyItem(_0x354699,'\x20\x20',_0x7ee818(_0x354699['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x1f4);[a28_0xdd66dd(0x1a4)]=a28_0xdd66dd(0x1f6);async[a28_0xdd66dd(0x1b1)](_0x1e9556){const _0x61943a=a28_0xdd66dd,{options:_0xda01dd,args:_0x4538d4,tdx:_0x534d91}=_0x1e9556,_0x1b44b0=_0x4538d4[0x0];if(!_0x1b44b0)return console['error'](_0x61943a(0x120)),console['error'](_0x61943a(0x196)),console[_0x61943a(0x139)](_0x61943a(0x154)),console['error'](_0x61943a(0x150)),0x1;_0xda01dd[_0x61943a(0x1bc)]&&console['error'](_0x61943a(0x1ce)+_0x1b44b0);const {journeyId:_0x3af257,parentSegmentId:_0x46a301}=await resolveJourneyIdFromInput(_0x1b44b0,_0xda01dd,_0x534d91);if(_0xda01dd[_0x61943a(0x1ec)]){const _0x26413c=getConsoleNextUrl(_0xda01dd[_0x61943a(0x1db)],'/app/ps/'+_0x46a301+_0x61943a(0x1c3)+_0x3af257+'/j/da/je');return console[_0x61943a(0x139)](a28_0x1f0e80['green']('✔')+_0x61943a(0x17a)+a28_0x1f0e80[_0x61943a(0x1f1)](_0x26413c)),openBrowser(_0x26413c),0x0;}const _0xdcb42c=await withSpinner(_0x61943a(0x170),()=>_0x534d91[_0x61943a(0x1bf)]['getJourney'](_0x3af257),{'verbose':_0xda01dd[_0x61943a(0x1bc)]}),_0x2ddadc=_0xdcb42c[_0x61943a(0x14d)],_0x40794a=_0xda01dd[_0x61943a(0x1dd)];let _0x5ccd86;if(_0x40794a)try{const _0x55ea28=await withSpinner(_0x61943a(0x1d1),()=>_0x534d91[_0x61943a(0x1bf)][_0x61943a(0x1f0)](_0x3af257),{'verbose':_0xda01dd[_0x61943a(0x1bc)]});_0x5ccd86=_0x55ea28['data'];}catch{_0xda01dd[_0x61943a(0x1bc)]&&console['error'](_0x61943a(0xec));}const _0x511450=getConsoleNextUrl(_0xda01dd[_0x61943a(0x1db)],_0x61943a(0x104)+_0x46a301+_0x61943a(0x1c3)+_0x3af257+'/j/da/je'),_0x1fac0d={'id':_0x2ddadc['id'],'name':_0x2ddadc[_0x61943a(0x158)][_0x61943a(0x10b)],'description':_0x2ddadc['attributes']['description'],'state':_0x2ddadc[_0x61943a(0x158)][_0x61943a(0x1d6)],'paused':_0x2ddadc[_0x61943a(0x158)]['paused'],'reentry_mode':_0x2ddadc[_0x61943a(0x158)]['reentryMode'],'stages':_0x2ddadc['attributes']['journeyStages']?.[_0x61943a(0x1b6)]||0x0,..._0x2ddadc[_0x61943a(0x158)][_0x61943a(0x179)]&&{'goal':_0x2ddadc[_0x61943a(0x158)]['goal']['name']},..._0x5ccd86&&{'statistics':{'size':_0x5ccd86[_0x61943a(0x146)],'entered':_0x5ccd86[_0x61943a(0x1c1)],'goal_achieved':_0x5ccd86[_0x61943a(0x19d)],'completion_rate':_0x5ccd86[_0x61943a(0x130)],'exit_or_jump':_0x5ccd86[_0x61943a(0xfd)],'exit_or_jump_rate':_0x5ccd86[_0x61943a(0x10a)],'stages':_0x5ccd86['stages']}},'url':_0x511450};return await handleSingleObjectOutput(_0x1fac0d,_0xda01dd),0x0;}}export class JourneyStatsCommand extends BaseCommand{['name']=a28_0xdd66dd(0x1f8);[a28_0xdd66dd(0x1a4)]='Show\x20journey\x20statistics';async[a28_0xdd66dd(0x1b1)](_0x4f70b0){const _0x39d189=a28_0xdd66dd,{options:_0x44ffa8,args:_0x3a287e,tdx:_0x318c32}=_0x4f70b0,_0x4cee97=_0x3a287e[0x0];if(!requireNameOrPath(_0x4cee97))return 0x1;_0x44ffa8[_0x39d189(0x1bc)]&&console[_0x39d189(0x139)]('Input:\x20'+_0x4cee97);const _0x32d7ae=_0x44ffa8,_0x393410=_0x32d7ae['from'],_0x598ebd=_0x32d7ae['to'],_0x229e01=_0x32d7ae[_0x39d189(0x157)],_0x5dd969=_0x32d7ae[_0x39d189(0x125)];_0x229e01&&!_0x393410&&!_0x598ebd&&console['error'](_0x39d189(0x11b));const _0x36757d=_0x229e01?withJsonFormat(_0x44ffa8):_0x44ffa8,{journeyId:_0x10f04c,journeyName:_0x5067b5}=await resolveJourneyIdFromInput(_0x4cee97,_0x36757d,_0x318c32),_0x44a140=_0x393410||_0x598ebd?{'from':_0x393410,'to':_0x598ebd}:undefined,_0x50de06=await withSpinner(_0x39d189(0x1d1),()=>Promise[_0x39d189(0x12b)]([_0x318c32['journey'][_0x39d189(0x11d)](_0x10f04c),_0x318c32[_0x39d189(0x1bf)][_0x39d189(0x1f0)](_0x10f04c,_0x44a140)]),{'verbose':_0x36757d[_0x39d189(0x1bc)]}),[_0xf29cae,_0x863319]=_0x50de06[_0x39d189(0x14d)];if(!_0x863319||_0x863319[_0x39d189(0x103)]===null)return console[_0x39d189(0x139)]('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x5067b5),console[_0x39d189(0x139)](_0x39d189(0xee)),0x0;const _0x1a5161=buildStageNameMap(_0xf29cae),_0x4662fe=!!(_0x44a140&&_0x863319['history']?.['length']),_0x176976={'stageNameMap':_0x1a5161,'hasPeriod':_0x4662fe,'includeHistory':!!_0x229e01};if(_0x5dd969&&_0x863319[_0x39d189(0x1ed)]){const _0xb15ea0=_0x863319[_0x39d189(0x1ed)][_0x39d189(0x16b)](_0x46529c=>{const _0x45395e=_0x39d189,_0x24abbb=_0x1a5161['get'](_0x46529c['id'])??'';return _0x24abbb['toLowerCase']()===_0x5dd969[_0x45395e(0x1ab)]();});if(_0xb15ea0)return await handleSingleObjectOutput(formatStageStats(_0xb15ea0,_0x176976),_0x36757d),0x0;const _0x36061a=_0x863319[_0x39d189(0x1ed)][_0x39d189(0x19a)](_0x47ac22=>_0x1a5161[_0x39d189(0x122)](_0x47ac22['id'])??_0x47ac22['id']);return console['error'](_0x39d189(0x1e8)+_0x5dd969+_0x39d189(0x1d0)),console[_0x39d189(0x139)](_0x39d189(0xfc)+_0x36061a[_0x39d189(0x1c6)](',\x20')),0x1;}const _0x50e127=_0x863319[_0x39d189(0x1ed)]?.['map'](_0x2695b0=>formatStageStats(_0x2695b0,_0x176976)),_0x4fbd51=assembleJourneyStats(_0x863319,{'from':_0x393410,'to':_0x598ebd,'includeHistory':_0x229e01});return await this[_0x39d189(0x114)](_0x4fbd51,_0x50e127??[],_0x36757d),0x0;}async[a28_0xdd66dd(0x114)](_0x316c87,_0xa2bbf1,_0x142d42){const _0x251c4f=a28_0xdd66dd,_0x3b0509=_0x142d42[_0x251c4f(0x16d)]===_0x251c4f(0x197)||_0x142d42[_0x251c4f(0x16d)]===_0x251c4f(0x1cd)||_0x142d42['json']||_0x142d42[_0x251c4f(0x1cd)];if(_0x3b0509){_0x316c87['stages']=_0xa2bbf1,await handleSingleObjectOutput(_0x316c87,_0x142d42);return;}await handleSingleObjectOutput(_0x316c87,_0x142d42);for(const _0x18f447 of _0xa2bbf1){console[_0x251c4f(0x169)](''),console[_0x251c4f(0x169)](String(a28_0x1f0e80['cyan'][_0x251c4f(0x1c2)]('['+_0x18f447[_0x251c4f(0x10b)]+']'))+a28_0x1f0e80['dim']('\x20'+_0x18f447['id']));const {id:_0x27c55e,name:_0x1cde37,..._0x48757a}=_0x18f447;await handleSingleObjectOutput(_0x48757a,_0x142d42);}}}export class JourneyTrafficCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x121);[a28_0xdd66dd(0x1a4)]=a28_0xdd66dd(0x16c);async[a28_0xdd66dd(0x1b1)](_0x1ea6f5){const _0x104606=a28_0xdd66dd,{options:_0x3f0599,args:_0x11d040,tdx:_0x10b23a}=_0x1ea6f5,_0x3a16ce=_0x11d040[0x0];if(!requireNameOrPath(_0x3a16ce))return 0x1;_0x3f0599['verbose']&&console[_0x104606(0x139)](_0x104606(0x1ce)+_0x3a16ce);const _0x2bb78d=_0x3f0599,_0x553f22=_0x2bb78d[_0x104606(0xf4)],_0x5c5af1=_0x2bb78d[_0x104606(0x13d)],_0x2aadb5=_0x2bb78d['to'],_0x45956f=_0x2bb78d['limit'];if(_0x553f22&&_0x553f22!==_0x104606(0x1ae)&&_0x553f22!==_0x104606(0x1a7))return console[_0x104606(0x139)](_0x104606(0x1c8)+_0x553f22+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x36d386=withJsonFormat(_0x3f0599),{journeyId:_0xdd462f,journeyName:_0x2727d4}=await resolveJourneyIdFromInput(_0x3a16ce,_0x36d386,_0x10b23a),_0x5ac7e9={'type':_0x553f22,'from':_0x5c5af1,'to':_0x2aadb5,'limit':_0x45956f},_0x4a82b0=await withSpinner(_0x104606(0x1cf),()=>_0x10b23a[_0x104606(0x1bf)][_0x104606(0x143)](_0xdd462f,_0x5ac7e9),{'verbose':_0x36d386[_0x104606(0x1bc)]}),_0x1511a1=_0x4a82b0[_0x104606(0x14d)],_0x20c387=_0x1511a1[_0x104606(0x1ae)]&&(_0x1511a1[_0x104606(0x1ae)][_0x104606(0x177)][_0x104606(0x1b6)]>0x0||_0x1511a1['conversion'][_0x104606(0x11e)][_0x104606(0x1b6)]>0x0),_0x3a8cba=_0x1511a1[_0x104606(0x1a7)]&&_0x1511a1['activation'][_0x104606(0x1b6)]>0x0;if(!_0x20c387&&!_0x3a8cba)return console[_0x104606(0x139)](_0x104606(0x1e4)+_0x2727d4),console['error'](_0x104606(0xe9)),_0x5c5af1&&_0x2aadb5&&console[_0x104606(0x139)]('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(_0x1511a1,_0x36d386),0x0;}}function formatStageStats(_0x31cdd1,_0x49e7a0){const _0x159a56=a28_0xdd66dd,_0x56cebe=_0x49e7a0[_0x159a56(0x189)]&&_0x31cdd1[_0x159a56(0x1dc)]?.['length']?aggregateStageHistory(_0x31cdd1[_0x159a56(0x1dc)]):{'size':_0x31cdd1[_0x159a56(0x146)],'entered':_0x31cdd1[_0x159a56(0x1c1)],'milestone':_0x31cdd1[_0x159a56(0x167)],'milestone_rate':_0x31cdd1[_0x159a56(0x1a9)],'exit_or_jump':_0x31cdd1[_0x159a56(0xfd)],'exit_or_jump_rate':_0x31cdd1['exitOrJumpRate']},_0x407655={'id':_0x31cdd1['id'],'name':_0x49e7a0['stageNameMap'][_0x159a56(0x122)](_0x31cdd1['id'])??_0x31cdd1['id'],..._0x56cebe};return _0x49e7a0['hasPeriod']&&_0x49e7a0[_0x159a56(0x157)]&&_0x31cdd1[_0x159a56(0x1dc)]&&(_0x407655['history']=_0x31cdd1[_0x159a56(0x1dc)]),_0x407655;}function a28_0x4df2(){const _0x5f2be7=['sort','Parent\x20segment:\x20','segmentPushCommand','folderPath','\x5c$&','data','utf-8','split','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','relativePath','\x20(rule\x20match)','Journey\x20name:\x20','Options:','journeyName','archived','includeHistory','attributes','args','(archived)','journeyStages','Error:\x20--version\x20option\x20is\x20required','Fetching\x20users\x20and\x20connections...','Error:\x20Parent\x20segment\x20context\x20required','resourceName','No\x20journeys\x20found','/j/da','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','push','\x20\x20Parent\x20segment:\x20','setPhase','activation_','milestoneSize','List\x20activations\x20for\x20a\x20journey','log','entries','find','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','format','journey:pull','then','Getting\x20journey\x20details...','Found\x20','Getting\x20column\x20mapping...','journeyBundleId','database','yellow','isNew','nodes','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','goal','\x20Opening\x20','folders','repeat','Listing\x20journey\x20activations...','(draft)','List\x20all\x20versions\x20of\x20a\x20journey','reentryMode','file','Pattern:\x20','\x20->\x20','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','Folder\x20path:\x20','listJourneysFromParentSegment','Cancelled','Table:\x20','hasPeriod','62388TWgYeW','\x20(draft)\x20—\x20\x22','\x20journey\x20files\x20to\x20','createdAt','52755KXdjpd','journey:list','base','folderId','buildIdToNameMap','\x20versions)','✔\x20Context\x20set:\x20','✔\x20Found\x20','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','json','Pause\x20a\x20running\x20journey','filePath','map','user',',\x20version:\x20','goalSize','tdx.json','32QJhacU','draft','yes','Warning:\x20Could\x20not\x20resolve\x20activation\x20','121015GlDSWh','description','targetDir','localeCompare','activation','Resolving\x20journey...','completeMilestoneRate','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','toLowerCase','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x22\x20resumed','conversion','journey:version:view','connection','execute','Resolved\x20YAML\x20file:\x20','\x20Created\x20v','/j/da/je','Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','length','Error:\x20Invalid\x20version\x20number:\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','getLatestJourneyId','audienceId','\x20version','verbose','✔\x20Journey\x20\x22','red','journey','green','enteredSize','bold','/e/','table','journeys','join','completed','Error:\x20Invalid\x20--type\x20\x22','journey:resume','\x20not\x20found.\x20Available:\x20','463084NpmEza','no_parent','jsonl','Input:\x20','Getting\x20journey\x20traffic\x20data...','\x22\x20not\x20found','Getting\x20journey\x20statistics...','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','\x20journey','parent_segment','\x20\x20Journey\x20ID:\x20','state','journey:versions','Show\x20journey\x20table\x20column\x20mapping','Fetching\x20','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','site','history','includeStats','root\x20folder','.yml','\x20=\x20','14754BrPQUt','Resolving\x20parent\x20segment...','\x20details...','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','diff','resolveJourneyId','\x20\x20-\x20','Error:\x20Stage\x20\x22','5402020hwWCjs','\x0aPull\x20summary:','Resume\x20a\x20paused\x20journey','web','stages','Fetching\x20parent\x20segment...','has','getStatistics','cyan','✔\x20Pulled\x20','\x0aChanges\x20to\x20\x27','journey:view','segmentName','Show\x20journey\x20details','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','journey:stats','journey:columns','blue','relative','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','replace','segments','\x20\x20Statistics\x20not\x20available','hasChanges','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','\x20activation','listFolders','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Error:\x20Journey\x20\x27','buildIdToEmailMap','type','Getting\x20version\x20','(running)','\x20files?','values','Creating\x20new\x20version...','listVersions','session','Available\x20stages:\x20','exitOrJumpSize','parentSegment','dim','Aborted.','22zKzJUK','helpText','journeyId','/app/ps/','segment','\x20journeys','...','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','\x22\x20paused','exitOrJumpRate','name','getColumnMapping','\x20\x20Target:\x20','filter','versionNumber','message','launched','content','\x20unchanged\x20files','renderStats','version','parentName','errorCode','stringify','16YjsWEd','journey:push','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','tsv','getJourney','links','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','journey:traffic','get','INVALID_ARGUMENT','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','stage','\x20new\x20files','paused','(paused)','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','getParentFull','all','connector_config','(root)','options','Error:\x20','completionRate','journeyBundleName','cwd','Pausing\x20journey...','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','651RWidUw','journey:activations','Warning:\x20Could\x20not\x20resolve\x20segment\x20','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','error','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','kind','add','from','📁\x20','set','1094436ZdjVwZ','\x27\x20not\x20found\x20in\x20','resolveParentId','getTrafficData','activationParams','2bIUOQU','size','rule'];a28_0x4df2=function(){return _0x5f2be7;};return a28_0x4df2();}export class JourneyPauseCommand extends BaseCommand{['name']='journey:pause';[a28_0xdd66dd(0x1a4)]=a28_0xdd66dd(0x198);async[a28_0xdd66dd(0x1b1)](_0x38ddbe){const _0x34de6c=a28_0xdd66dd,{options:_0x1c9e0a,args:_0x32e70b,tdx:_0x289a93}=_0x38ddbe,_0x5745b8=_0x32e70b[0x0];if(!requireNameOrPath(_0x5745b8))return 0x1;_0x1c9e0a['verbose']&&console[_0x34de6c(0x139)]('Input:\x20'+_0x5745b8);const {journeyId:_0x597d0c,journeyName:_0x4181a9}=await resolveJourneyIdFromInput(_0x5745b8,_0x1c9e0a,_0x289a93);if(!_0x1c9e0a[_0x34de6c(0x1a1)]){const _0x2167b5=await confirm(_0x34de6c(0x108)+_0x4181a9+'\x22?');if(!_0x2167b5)return console[_0x34de6c(0x139)]('Cancelled'),0x0;}const _0x53b052=await withSpinner(_0x34de6c(0x133),()=>_0x289a93[_0x34de6c(0x1bf)]['pause'](_0x597d0c),{'verbose':_0x1c9e0a[_0x34de6c(0x1bc)]}),_0xdd4c91=_0x53b052[_0x34de6c(0x14d)];return console[_0x34de6c(0x139)](_0x34de6c(0x1bd)+_0xdd4c91[_0x34de6c(0x158)][_0x34de6c(0x10b)]+_0x34de6c(0x109)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x1c9);[a28_0xdd66dd(0x1a4)]=a28_0xdd66dd(0x1eb);async[a28_0xdd66dd(0x1b1)](_0x68c3ca){const _0x3e79bb=a28_0xdd66dd,{options:_0x25ff15,args:_0x28a1e0,tdx:_0x430897}=_0x68c3ca,_0x268df0=_0x28a1e0[0x0];if(!requireNameOrPath(_0x268df0))return 0x1;_0x25ff15[_0x3e79bb(0x1bc)]&&console[_0x3e79bb(0x139)](_0x3e79bb(0x1ce)+_0x268df0);const {journeyId:_0xaf5754,journeyName:_0x4eda48}=await resolveJourneyIdFromInput(_0x268df0,_0x25ff15,_0x430897);if(!_0x25ff15['yes']){const _0x3fd60c=await confirm(_0x3e79bb(0x178)+_0x4eda48+'\x22?');if(!_0x3fd60c)return console['error'](_0x3e79bb(0x187)),0x0;}const _0x45a715=await withSpinner('Resuming\x20journey...',()=>_0x430897['journey']['resume'](_0xaf5754),{'verbose':_0x25ff15[_0x3e79bb(0x1bc)]}),_0x357086=_0x45a715['data'];return console['error'](_0x3e79bb(0x1bd)+_0x357086[_0x3e79bb(0x158)]['name']+_0x3e79bb(0x1ad)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x16e);[a28_0xdd66dd(0x1a4)]='Export\x20journey(s)\x20as\x20YAML\x20files';async['execute'](_0x6ef1ca){const _0x319a88=a28_0xdd66dd,{options:_0x295521,args:_0x1e2f85,tdx:_0x36638e}=_0x6ef1ca,_0x5097b6=_0x295521,_0x5a9afe=_0x1e2f85[0x0],_0x217d59=_0x5a9afe&&isYamlFilePath(_0x5a9afe),_0x410d9d=await resolveTarget({'arg':_0x217d59?_0x5a9afe:undefined,'contextParent':_0x295521[_0x319a88(0xfe)],'cwd':process[_0x319a88(0x132)]()});if(!isSuccessfulResolution(_0x410d9d))return _0x410d9d[_0x319a88(0x117)]===_0x319a88(0x1cc)?(console[_0x319a88(0x139)](a28_0x1f0e80[_0x319a88(0x175)](_0x319a88(0x1f7))),console[_0x319a88(0x139)]('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[_0x319a88(0x139)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console[_0x319a88(0x139)](_0x319a88(0x1d2)),console[_0x319a88(0x139)](_0x319a88(0x11f))):(console[_0x319a88(0x139)](a28_0x1f0e80['red'](_0x319a88(0x12f)+_0x410d9d[_0x319a88(0x110)]+'\x0a')),_0x410d9d[_0x319a88(0x102)]&&console[_0x319a88(0x139)](a28_0x1f0e80[_0x319a88(0x1f1)](_0x410d9d['helpText']))),0x1;let _0x2de97b=_0x217d59?undefined:_0x5a9afe,_0x503319,_0x202464;_0x410d9d[_0x319a88(0xf4)]===_0x319a88(0x181)&&(_0x2de97b=_0x410d9d[_0x319a88(0x15f)],_0x503319=_0x410d9d[_0x319a88(0x199)],_0x202464=_0x410d9d['folderPath']);const _0x304681=_0x410d9d[_0x319a88(0x116)],_0x4bee6=_0x410d9d[_0x319a88(0x1a5)];_0x5097b6['verbose']&&(console[_0x319a88(0x139)](_0x319a88(0x149)+_0x304681),console['error']('Target\x20directory:\x20'+_0x4bee6),_0x2de97b&&console[_0x319a88(0x139)](_0x319a88(0x153)+_0x2de97b),_0x503319&&console[_0x319a88(0x139)]('Target\x20file:\x20'+_0x503319),_0x202464&&console[_0x319a88(0x139)](_0x319a88(0x185)+_0x202464));const _0x14086a=await withSpinner(_0x319a88(0x1e2),()=>_0x36638e[_0x319a88(0x105)]['resolveParentId'](_0x304681),{'verbose':_0x295521[_0x319a88(0x1bc)]}),_0x27cdcb=_0x14086a[_0x319a88(0x14d)],{journeys:_0x3bbd3e,folders:_0x5a8bf3}=await withSpinner('Fetching\x20journeys\x20and\x20folders...',async()=>{const _0x8f8ade=_0x319a88,[_0x11cefe,_0x3ecd65]=await Promise[_0x8f8ade(0x12b)]([_0x36638e[_0x8f8ade(0x1bf)][_0x8f8ade(0x186)](_0x27cdcb,undefined,{'includeAllVersions':!![]}),_0x36638e[_0x8f8ade(0x105)][_0x8f8ade(0xf0)](_0x27cdcb)]);return{'journeys':_0x11cefe,'folders':_0x3ecd65};},{'verbose':_0x295521[_0x319a88(0x1bc)]})[_0x319a88(0x16f)](_0x14fa00=>_0x14fa00[_0x319a88(0x14d)]);let _0x358d23=_0x3bbd3e;const _0x43b3b1=buildFolderIdToPathMap(_0x5a8bf3);if(_0x2de97b){const _0x1765cd=_0x358d23['filter'](_0x5d15f9=>_0x5d15f9['journeyBundleName']['toLowerCase']()===_0x2de97b['toLowerCase']());if(_0x1765cd['length']===0x0)return console[_0x319a88(0x139)]('Error:\x20Journey\x20not\x20found:\x20'+_0x2de97b),console[_0x319a88(0x139)](_0x319a88(0x124)),0x1;_0x358d23=_0x1765cd;}if(_0x202464!==undefined){const _0xe82a90=_0x358d23[_0x319a88(0x10e)](_0xbb65bb=>{const _0x4f1a03=_0x319a88,_0x50341d=_0xbb65bb[_0x4f1a03(0x191)]?_0x43b3b1[_0x4f1a03(0x122)](_0xbb65bb['folderId'])||'':'';return _0x50341d===_0x202464;});if(_0xe82a90[_0x319a88(0x1b6)]===0x0&&_0x358d23['length']>0x0){console[_0x319a88(0x139)](_0x319a88(0xf2)+_0x2de97b+_0x319a88(0x141)+(_0x202464||_0x319a88(0x1de))),console['error']('Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:');for(const _0x8532d0 of _0x358d23){const _0xc3f517=_0x8532d0['folderId']?_0x43b3b1[_0x319a88(0x122)](_0x8532d0[_0x319a88(0x191)])||'':'';console[_0x319a88(0x139)](_0x319a88(0x1e7)+(_0xc3f517||_0x319a88(0x12d))+'/'+_0x8532d0[_0x319a88(0x131)]);}return 0x1;}_0x358d23=_0xe82a90;}if(_0x358d23['length']===0x0)return console[_0x319a88(0x139)](_0x319a88(0x160)),0x0;const _0xab4efa=new Map();for(const _0x575029 of _0x358d23){const _0x3f4f3b=_0x575029[_0x319a88(0x173)];!_0xab4efa[_0x319a88(0x1ef)](_0x3f4f3b)&&_0xab4efa['set'](_0x3f4f3b,[]),_0xab4efa['get'](_0x3f4f3b)[_0x319a88(0x163)](_0x575029);}for(const _0xc64383 of _0xab4efa[_0x319a88(0xf8)]()){_0xc64383['sort']((_0x237e1a,_0x129659)=>(_0x237e1a[_0x319a88(0x10f)]||0x0)-(_0x129659[_0x319a88(0x10f)]||0x0));}const _0x28c9f8=[],{idToEmailMap:_0x5b94a1,connectionIdToNameMap:_0x3ef929}=await withSpinner(_0x319a88(0x15d),async()=>{const _0x2b16a0=_0x319a88,[_0x2a4daf,_0x178ce7]=await Promise[_0x2b16a0(0x12b)]([_0x36638e[_0x2b16a0(0x19b)][_0x2b16a0(0xf3)](),_0x36638e[_0x2b16a0(0x1b0)][_0x2b16a0(0x192)]()]);return{'idToEmailMap':_0x2a4daf,'connectionIdToNameMap':_0x178ce7};},{'verbose':_0x295521[_0x319a88(0x1bc)]})['then'](_0x46dcf1=>_0x46dcf1['data']);for(const _0x8aada3 of _0xab4efa[_0x319a88(0xf8)]()){const _0x1fdb3e=_0x8aada3[0x0][_0x319a88(0x131)],_0x36f412=_0x8aada3[0x0][_0x319a88(0x191)],_0x15b6f3=_0x36f412?_0x43b3b1[_0x319a88(0x122)](_0x36f412)||'':'',_0x4feb5c=_0x15b6f3?a28_0x16999a['join'](_0x4bee6,_0x15b6f3):_0x4bee6,_0x599b33=_0x503319||a28_0x16999a[_0x319a88(0x1c6)](_0x4feb5c,sanitizeFileName(_0x1fdb3e)+_0x319a88(0x1df));let _0x2fb054,_0x57c690;if(existsSync(_0x599b33))try{const _0x44c4da=readFileSync(_0x599b33,_0x319a88(0x14e)),_0x540aee=parseYamlString(_0x44c4da);_0x57c690=_0x540aee,_0x2fb054=buildRuleToNameMapping(_0x540aee),_0x5097b6['verbose']&&_0x2fb054['size']>0x0&&console['error'](_0x319a88(0x171)+_0x2fb054[_0x319a88(0x146)]+_0x319a88(0x1aa)+_0x1fdb3e);}catch(_0x3476f7){_0x5097b6[_0x319a88(0x1bc)]&&console[_0x319a88(0x139)](_0x319a88(0x184)+_0x3476f7[_0x319a88(0x110)]);}const _0x191575=[],_0x10a970=new Set(),_0x545933=new Map(),_0x1965cf=new Map(),_0xc15d9f=new Set(),_0x1dd76a=new Map(),_0x1580d6=new Map(),_0x2da72e=createJumpTargetCache();await withProgressSpinner(_0x319a88(0x1d9)+_0x1fdb3e+_0x319a88(0x107),async _0x3acf67=>{const _0x31bf95=_0x319a88;for(const _0x564650 of _0x8aada3){const _0x539dff=_0x8aada3['length']>0x1?_0x564650[_0x31bf95(0x131)]+'\x20v'+(_0x564650['versionNumber']||0x1):_0x564650[_0x31bf95(0x131)];_0x3acf67[_0x31bf95(0x165)](_0x31bf95(0x1d9)+_0x539dff);const _0x2e6980=await _0x36638e[_0x31bf95(0x1bf)][_0x31bf95(0x11d)](_0x564650['id']),_0x5b03dd=_0x2e6980[_0x31bf95(0x158)]?.[_0x31bf95(0x1ba)],_0x323dde={'resolveSegment':async _0x2bf6f6=>{const _0x528466=_0x31bf95;if(!_0x5b03dd)return{'name':_0x2bf6f6,'isJourneyLocal':![]};const _0x2e105d=_0x545933[_0x528466(0x122)](_0x2bf6f6);if(_0x2e105d)return _0x2e105d;try{const _0x1a78c1=await _0x36638e[_0x528466(0x105)]['getSegment'](_0x5b03dd,_0x2bf6f6),_0x5cdd28=_0x1a78c1[_0x528466(0x13b)]===SEGMENT_KIND_JOURNEY;let _0x273ce1,_0x472d25=_0x1a78c1[_0x528466(0x10b)];if(_0x5cdd28&&_0x1a78c1[_0x528466(0x147)]){const _0x4a2d2d=await segmentResponseToDef(_0x1a78c1,{'resolveSegmentName':async _0x50fc27=>{const _0x88930d=_0x528466,_0x27afc9=_0x545933[_0x88930d(0x122)](_0x50fc27);if(_0x27afc9)return _0x27afc9[_0x88930d(0x10b)];const _0x18c429=await _0x323dde['resolveSegment'](_0x50fc27);return _0x18c429['name'];}}),_0x4cb2f9=_0x4a2d2d[_0x528466(0x147)];_0x273ce1={'description':_0x1a78c1[_0x528466(0x1a4)],'rule':_0x4cb2f9};const _0x445c6a=serializeRule(_0x4cb2f9),_0x3f4245=_0x1965cf[_0x528466(0x122)](_0x445c6a);if(_0x3f4245)_0x472d25=_0x3f4245,_0x273ce1=undefined,_0x5097b6[_0x528466(0x1bc)]&&console[_0x528466(0x139)]('\x20\x20Consolidating\x20duplicate\x20segment:\x20'+_0x1a78c1['name']+_0x528466(0x183)+_0x3f4245);else{let _0x50c728=![];if(_0x2fb054){const _0x110a2f=_0x2fb054['get'](_0x445c6a);if(_0x110a2f){const _0x22be6c=_0x110a2f[_0x528466(0x16b)](_0x49aea8=>!_0x10a970[_0x528466(0x1ef)](_0x49aea8));_0x22be6c&&(_0x472d25=_0x22be6c,_0x10a970['add'](_0x22be6c),_0x1965cf[_0x528466(0x13f)](_0x445c6a,_0x22be6c),_0x50c728=!![],_0x5097b6[_0x528466(0x1bc)]&&console[_0x528466(0x139)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x22be6c+_0x528466(0x152)));}}if(!_0x50c728){const _0x2989d2=generateJourneyLocalName(_0x1a78c1[_0x528466(0x10b)]);_0x2989d2&&(_0x472d25=_0x2989d2);let _0x4deee4=_0x472d25,_0xcb741=0x2;while(_0x10a970[_0x528466(0x1ef)](_0x4deee4)){_0x4deee4=_0x472d25+'_'+_0xcb741,_0xcb741++;}_0x10a970[_0x528466(0x13c)](_0x4deee4),_0x1965cf[_0x528466(0x13f)](_0x445c6a,_0x4deee4),_0x472d25=_0x4deee4;}}}const _0x59e86b={'name':_0x472d25,'isJourneyLocal':_0x5cdd28,'definition':_0x273ce1};return _0x545933[_0x528466(0x13f)](_0x2bf6f6,_0x59e86b),_0x59e86b;}catch(_0x108fa9){return _0x295521[_0x528466(0x1bc)]&&console[_0x528466(0x139)](_0x528466(0x137)+_0x2bf6f6+':\x20'+_0x108fa9['message']),{'name':_0x2bf6f6,'isJourneyLocal':![]};}},'resolveActivation':async _0x4985de=>{const _0x4ecfe1=_0x31bf95,_0x214780=_0x1dd76a['get'](_0x4985de);if(_0x214780)return _0x214780;try{const _0x2aa56d=await _0x36638e[_0x4ecfe1(0x1bf)]['getActivation'](_0x564650['id'],_0x4985de),_0x376d67=journeyActivationStepToYaml(_0x2aa56d,_0x5b94a1,_0x3ef929),_0x203284=JSON[_0x4ecfe1(0x118)]({'name':_0x376d67['name'],'connection':_0x376d67[_0x4ecfe1(0x1b0)],'connector_config':_0x376d67[_0x4ecfe1(0x12c)]}),_0x260410=_0x1580d6[_0x4ecfe1(0x122)](_0x203284);if(_0x260410){const _0x5d2159={'name':_0x260410,'isJourneyLocal':!![],'definition':_0x376d67};return _0x1dd76a['set'](_0x4985de,_0x5d2159),_0x5d2159;}const _0x383324=_0x2aa56d['attributes'][_0x4ecfe1(0x144)]['name']||_0x4985de,_0x294faa=sanitizeYamlKey(_0x383324)||_0x4ecfe1(0x166)+_0x4985de;let _0x557153=_0x294faa,_0x5ee1a4=0x2;while(_0xc15d9f['has'](_0x557153)){_0x557153=_0x294faa+'_'+_0x5ee1a4,_0x5ee1a4++;}_0xc15d9f[_0x4ecfe1(0x13c)](_0x557153),_0x1580d6[_0x4ecfe1(0x13f)](_0x203284,_0x557153);const _0x1262c3={'name':_0x557153,'isJourneyLocal':!![],'definition':_0x376d67};return _0x1dd76a['set'](_0x4985de,_0x1262c3),_0x1262c3;}catch(_0x2e1ae2){return _0x295521[_0x4ecfe1(0x1bc)]&&console[_0x4ecfe1(0x139)](_0x4ecfe1(0x1a2)+_0x4985de+':\x20'+_0x2e1ae2[_0x4ecfe1(0x110)]),{'name':_0x4985de,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x2d3c1e,_0x31bca7)=>{const _0x24d35b=_0x31bf95;return resolveJumpTarget(_0x2d3c1e,_0x31bca7,_0x2da72e,_0x492c10=>_0x36638e[_0x24d35b(0x1bf)][_0x24d35b(0x11d)](_0x492c10));}},_0x3175f8=await journeyResponseToDef(_0x2e6980,_0x323dde);_0x191575['push']({'item':_0x564650,'yaml':_0x3175f8});}},{'verbose':_0x295521['verbose']});const _0x195433=await _0x36638e[_0x319a88(0x1bf)][_0x319a88(0x1b9)](_0x8aada3[0x0][_0x319a88(0x173)]),_0x42b796=buildMergedJourneyDef(_0x191575,_0x2fb054,_0x195433),_0x13c9ed=normalizeJourneyDef(_0x42b796,_0x57c690),_0x287738=toYamlString(_0x13c9ed),_0x145492=_0x503319||a28_0x16999a['join'](_0x4feb5c,sanitizeFileName(_0x1fdb3e)+'.yml');!_0x503319&&_0x15b6f3&&!existsSync(_0x4feb5c)&&mkdirSync(_0x4feb5c,{'recursive':!![]});const _0x1f844d=a28_0x16999a[_0x319a88(0xe8)](process['cwd'](),_0x145492);if(existsSync(_0x145492)){const _0x3e346e=readFileSync(_0x145492,_0x319a88(0x14e)),_0x5661ef=generateDiff(_0x3e346e,_0x287738),_0x16dda1=hasChanges(_0x5661ef);_0x28c9f8[_0x319a88(0x163)]({'relativePath':_0x1f844d,'absolutePath':_0x145492,'content':_0x287738,'isNew':![],'hasChanges':_0x16dda1,'diff':_0x16dda1?formatDiffWithColors(_0x5661ef):undefined});}else _0x28c9f8[_0x319a88(0x163)]({'relativePath':_0x1f844d,'absolutePath':_0x145492,'content':_0x287738,'isNew':!![],'hasChanges':![]});}const _0x55d5f5=_0x28c9f8[_0x319a88(0x10e)](_0x415c6c=>_0x415c6c[_0x319a88(0x176)]),_0x1f6cc4=_0x28c9f8['filter'](_0x8c231c=>!_0x8c231c[_0x319a88(0x176)]&&_0x8c231c[_0x319a88(0xed)]),_0x237154=_0x28c9f8['filter'](_0x52b35f=>!_0x52b35f[_0x319a88(0x176)]&&!_0x52b35f[_0x319a88(0xed)]),_0x5043b0=_0x358d23[_0x319a88(0x1b6)],_0x3d4f48=_0xab4efa[_0x319a88(0x146)],_0x346af8=_0x5043b0>_0x3d4f48?'\x20('+_0x5043b0+_0x319a88(0x193):'';console[_0x319a88(0x139)](_0x319a88(0x1ea)),console[_0x319a88(0x139)]('\x20\x20'+a28_0x1f0e80[_0x319a88(0x1f1)](_0x3d4f48+_0x319a88(0x106))+a28_0x1f0e80[_0x319a88(0xff)](_0x346af8)),console['error']('\x20\x20'+a28_0x1f0e80[_0x319a88(0x1c0)]('+\x20'+_0x55d5f5['length']+_0x319a88(0x126))),console[_0x319a88(0x139)]('\x20\x20'+a28_0x1f0e80[_0x319a88(0x175)]('~\x20'+_0x1f6cc4[_0x319a88(0x1b6)]+'\x20changed\x20files')),console[_0x319a88(0x139)]('\x20\x20'+a28_0x1f0e80['dim']('=\x20'+_0x237154[_0x319a88(0x1b6)]+_0x319a88(0x113))),console[_0x319a88(0x139)](_0x319a88(0x10d)+a28_0x1f0e80['cyan'](_0x4bee6)+'\x0a');if(_0x1f6cc4[_0x319a88(0x1b6)]>0x0)for(const _0x31c8b7 of _0x1f6cc4){console['error'](_0x319a88(0x1f3)+_0x31c8b7[_0x319a88(0x151)]+'\x27:'),console['error']('─'[_0x319a88(0x17c)](0x3c)),console['error'](_0x31c8b7[_0x319a88(0x1e5)]),console['error']('─'[_0x319a88(0x17c)](0x3c));}if(_0x5097b6['dryRun'])return console['error'](a28_0x1f0e80[_0x319a88(0x175)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x55d5f5[_0x319a88(0x1b6)]===0x0&&_0x1f6cc4[_0x319a88(0x1b6)]===0x0)return console['error'](a28_0x1f0e80['green'](_0x319a88(0x1b8))),saveSessionContext({'parent_segment':_0x304681},_0x5097b6['session']),console[_0x319a88(0x139)](a28_0x1f0e80[_0x319a88(0x1c0)](_0x319a88(0x194)+a28_0x1f0e80['dim'](_0x319a88(0x1d4))+'\x20=\x20'+a28_0x1f0e80[_0x319a88(0x1f1)](_0x304681))),0x0;if(!_0x5097b6[_0x319a88(0x1a1)]&&(_0x55d5f5[_0x319a88(0x1b6)]>0x0||_0x1f6cc4['length']>0x0)){if(!isInteractive())return console[_0x319a88(0x139)](a28_0x1f0e80[_0x319a88(0x1be)]('\x0aError:'),_0x319a88(0x1ac)),console[_0x319a88(0x139)](a28_0x1f0e80[_0x319a88(0xff)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2d2313=await confirmKey('Write\x20'+(_0x55d5f5['length']+_0x1f6cc4[_0x319a88(0x1b6)])+_0x319a88(0xf7));if(!_0x2d2313)return console[_0x319a88(0x139)](a28_0x1f0e80[_0x319a88(0x175)](_0x319a88(0x100)),'-\x20no\x20files\x20written'),0x1;}!existsSync(_0x4bee6)&&mkdirSync(_0x4bee6,{'recursive':!![]});const _0x28251d=a28_0x16999a[_0x319a88(0x1c6)](_0x4bee6,_0x319a88(0x19e));writeFileSync(_0x28251d,createTdxConfigContent(_0x304681),_0x319a88(0x14e));for(const _0x40de64 of _0x28c9f8){(_0x40de64['isNew']||_0x40de64['hasChanges'])&&writeFileSync(_0x40de64['absolutePath'],_0x40de64[_0x319a88(0x112)],_0x319a88(0x14e));}return console['error'](a28_0x1f0e80[_0x319a88(0x1c0)](_0x319a88(0x1f2)+(_0x55d5f5[_0x319a88(0x1b6)]+_0x1f6cc4['length'])+_0x319a88(0x18c)+_0x4bee6)),saveSessionContext({'parent_segment':_0x304681},_0x5097b6[_0x319a88(0xfb)]),console[_0x319a88(0x139)](a28_0x1f0e80['green'](_0x319a88(0x194)+a28_0x1f0e80[_0x319a88(0xff)](_0x319a88(0x1d4))+_0x319a88(0x1e0)+a28_0x1f0e80['cyan'](_0x304681))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x1f9);['description']=a28_0xdd66dd(0x1d8);async[a28_0xdd66dd(0x1b1)](_0x5433ea){const _0x3c3e0d=a28_0xdd66dd,{options:_0x1a08c0,args:_0x423937,tdx:_0x2ef318}=_0x5433ea,_0x3fde14=_0x423937[0x0];if(!requireNameOrPath(_0x3fde14))return 0x1;_0x1a08c0['verbose']&&console['error'](_0x3c3e0d(0x1ce)+_0x3fde14);const {journeyId:_0x48f845}=await resolveJourneyIdFromInput(_0x3fde14,_0x1a08c0,_0x2ef318),_0x4b6419=await withSpinner(_0x3c3e0d(0x172),()=>_0x2ef318[_0x3c3e0d(0x1bf)][_0x3c3e0d(0x10c)](_0x48f845),{'verbose':_0x1a08c0[_0x3c3e0d(0x1bc)]}),_0x2e3f44=_0x4b6419[_0x3c3e0d(0x14d)];return console['log']('Database:\x20'+_0x2e3f44[_0x3c3e0d(0x174)]),console['log'](_0x3c3e0d(0x188)+_0x2e3f44[_0x3c3e0d(0x1c4)]),await handleSDKOutput(_0x2e3f44['columns'],_0x1a08c0),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x136);['description']=a28_0xdd66dd(0x168);async[a28_0xdd66dd(0x1b1)](_0xbb5d8){const _0x584050=a28_0xdd66dd,{options:_0x28e11b,args:_0x2ca170,tdx:_0x13e801}=_0xbb5d8,_0x4c0865=_0x2ca170[0x0];if(!requireNameOrPath(_0x4c0865))return 0x1;_0x28e11b[_0x584050(0x1bc)]&&console[_0x584050(0x139)]('Input:\x20'+_0x4c0865);const {journeyId:_0x4e33f0}=await resolveJourneyIdFromInput(_0x4c0865,_0x28e11b,_0x13e801),_0x28a6b9=await withSpinner(_0x584050(0x17d),()=>_0x13e801[_0x584050(0x1bf)]['listActivationsFlat'](_0x4e33f0),{'verbose':_0x28e11b[_0x584050(0x1bc)]}),_0x390b32=_0x28a6b9[_0x584050(0x14d)];return console[_0x584050(0x139)](_0x584050(0x171)+_0x390b32[_0x584050(0x1b6)]+_0x584050(0xef)+(_0x390b32[_0x584050(0x1b6)]!==0x1?'s':'')),await handleSDKOutput(_0x390b32,_0x28e11b),0x0;}}export class JourneyPushCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x11a);[a28_0xdd66dd(0x1a4)]='Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data';[a28_0xdd66dd(0x14a)]=new SegmentPushCommand();async[a28_0xdd66dd(0x1b1)](_0x207916){const _0x386057=a28_0xdd66dd,_0x457e6d=_0x207916[_0x386057(0x159)][0x0];let _0x5691bb;if(_0x457e6d){const _0x885b92=await resolveTarget({'arg':_0x457e6d,'contextParent':_0x207916[_0x386057(0x12e)][_0x386057(0xfe)],'cwd':process[_0x386057(0x132)]()});isSuccessfulResolution(_0x885b92)&&_0x885b92[_0x386057(0xf4)]===_0x386057(0x181)&&(_0x5691bb=_0x885b92['filePath']);}const _0x46e8aa={..._0x207916,'options':{..._0x207916[_0x386057(0x12e)],'journeysOnly':!![],..._0x5691bb&&{'singleFilePath':_0x5691bb}}};return this[_0x386057(0x14a)]['execute'](_0x46e8aa);}}export class JourneyVersionsCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x1d7);[a28_0xdd66dd(0x1a4)]=a28_0xdd66dd(0x17f);async[a28_0xdd66dd(0x1b1)](_0x3585ec){const _0x105aee=a28_0xdd66dd,{options:_0x3a287a,args:_0x3d92d1,tdx:_0xc0a5cc}=_0x3585ec,_0x13b5fe=_0x3d92d1[0x0];if(!requireNameOrPath(_0x13b5fe))return 0x1;if(_0x3a287a['verbose'])console['error'](_0x105aee(0x1ce)+_0x13b5fe);const {journeyId:_0x3c4bc4}=await resolveJourneyIdFromInput(_0x13b5fe,_0x3a287a,_0xc0a5cc),_0x661352=await withSpinner('Listing\x20journey\x20versions...',()=>_0xc0a5cc[_0x105aee(0x1bf)][_0x105aee(0xfa)](_0x3c4bc4),{'verbose':_0x3a287a[_0x105aee(0x1bc)]}),{bundleName:_0x441a31,versions:_0xab4e93,latestJourneyId:_0x55bde9}=_0x661352['data'];console[_0x105aee(0x139)](_0x441a31+':\x20'+_0xab4e93[_0x105aee(0x1b6)]+_0x105aee(0x1bb)+(_0xab4e93['length']!==0x1?'s':''));const _0x1d5dee=_0xab4e93[_0x105aee(0x19a)](_0x36ddef=>({'version':_0x36ddef[_0x105aee(0x10f)],'journey_id':_0x36ddef[_0x105aee(0x103)],'name':_0x36ddef[_0x105aee(0x10b)],'state':_0x36ddef[_0x105aee(0x1d6)],'paused':_0x36ddef[_0x105aee(0x127)],'latest':_0x36ddef[_0x105aee(0x103)]===_0x55bde9,'created_at':_0x36ddef['createdAt']}));return await handleSDKOutput(_0x1d5dee,_0x3a287a),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]='journey:version:create';['description']=a28_0xdd66dd(0x1b5);async['execute'](_0x57024a){const _0x815f1e=a28_0xdd66dd,{options:_0x35d942,args:_0x585782,tdx:_0x4ce160}=_0x57024a,_0x39fa07=_0x585782[0x0];if(!requireNameOrPath(_0x39fa07))return 0x1;if(_0x35d942[_0x815f1e(0x1bc)])console[_0x815f1e(0x139)](_0x815f1e(0x1ce)+_0x39fa07);const {journeyId:_0x1d36a2,journeyName:_0x2da028}=await resolveJourneyIdFromInput(_0x39fa07,_0x35d942,_0x4ce160);if(!_0x35d942[_0x815f1e(0x1a1)]){const _0x1d9e36=await confirm(_0x815f1e(0x13a)+_0x2da028+'\x22?');if(!_0x1d9e36)return console[_0x815f1e(0x139)](_0x815f1e(0x187)),0x0;}const _0x2ff36d=await withSpinner(_0x815f1e(0xf9),()=>_0x4ce160[_0x815f1e(0x1bf)]['createVersion'](_0x1d36a2),{'verbose':_0x35d942[_0x815f1e(0x1bc)]}),_0x3f8221=_0x2ff36d[_0x815f1e(0x14d)];return console[_0x815f1e(0x139)](a28_0x1f0e80[_0x815f1e(0x1c0)]('✔')+_0x815f1e(0x1b3)+_0x3f8221[_0x815f1e(0x158)][_0x815f1e(0x10f)]+_0x815f1e(0x18b)+_0x3f8221[_0x815f1e(0x158)]['name']+'\x22'),console[_0x815f1e(0x139)](_0x815f1e(0x1d5)+_0x3f8221['id']),await handleSingleObjectOutput({'id':_0x3f8221['id'],'name':_0x3f8221[_0x815f1e(0x158)][_0x815f1e(0x10b)],'version':_0x3f8221[_0x815f1e(0x158)][_0x815f1e(0x10f)],'state':_0x3f8221[_0x815f1e(0x158)][_0x815f1e(0x1d6)],'bundle_id':_0x3f8221[_0x815f1e(0x158)][_0x815f1e(0x173)],'created_at':_0x3f8221[_0x815f1e(0x158)][_0x815f1e(0x18d)]},_0x35d942),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a28_0xdd66dd(0x10b)]=a28_0xdd66dd(0x1af);['description']='View\x20a\x20specific\x20version\x20of\x20a\x20journey';async[a28_0xdd66dd(0x1b1)](_0x5cf458){const _0x4dd3f9=a28_0xdd66dd,{options:_0x5d65fb,args:_0x3026fd,tdx:_0x172a97}=_0x5cf458,_0x5dabca=_0x3026fd[0x0];if(!requireNameOrPath(_0x5dabca))return 0x1;const _0x121c19=_0x5d65fb[_0x4dd3f9(0x115)];if(!_0x121c19)return console[_0x4dd3f9(0x139)](_0x4dd3f9(0x15c)),console[_0x4dd3f9(0x139)](_0x4dd3f9(0x129)),0x1;const _0x4727df=parseInt(_0x121c19,0xa);if(isNaN(_0x4727df)||_0x4727df<0x1)return console[_0x4dd3f9(0x139)](_0x4dd3f9(0x1b7)+_0x121c19),0x1;if(_0x5d65fb[_0x4dd3f9(0x1bc)])console['error']('Input:\x20'+_0x5dabca+_0x4dd3f9(0x19c)+_0x4727df);const {journeyId:_0x500aab,parentSegmentId:_0x36ed6c}=await resolveJourneyIdFromInput(_0x5dabca,_0x5d65fb,_0x172a97),_0xbac605=await withSpinner('Resolving\x20version...',()=>_0x172a97[_0x4dd3f9(0x1bf)][_0x4dd3f9(0xfa)](_0x500aab),{'verbose':_0x5d65fb['verbose']}),{versions:_0x3190e0,latestJourneyId:_0x246e32}=_0xbac605['data'],_0x3359ea=_0x3190e0[_0x4dd3f9(0x16b)](_0x21f906=>_0x21f906['versionNumber']===_0x4727df);if(!_0x3359ea){const _0x10bf8b=_0x3190e0['map'](_0x477733=>'v'+_0x477733[_0x4dd3f9(0x10f)])['join'](',\x20');return console['error']('Error:\x20Version\x20'+_0x4727df+_0x4dd3f9(0x1ca)+_0x10bf8b),0x1;}const _0x22ad67=await withSpinner(_0x4dd3f9(0xf5)+_0x4727df+_0x4dd3f9(0x1e3),()=>_0x172a97[_0x4dd3f9(0x1bf)][_0x4dd3f9(0x11d)](_0x3359ea[_0x4dd3f9(0x103)]),{'verbose':_0x5d65fb[_0x4dd3f9(0x1bc)]}),_0x4b85b5=_0x22ad67[_0x4dd3f9(0x14d)],_0x4f3a79=getConsoleNextUrl(_0x5d65fb[_0x4dd3f9(0x1db)],_0x4dd3f9(0x104)+_0x36ed6c+_0x4dd3f9(0x1c3)+_0x3359ea[_0x4dd3f9(0x103)]+_0x4dd3f9(0x1b4));return await handleSingleObjectOutput({'id':_0x4b85b5['id'],'name':_0x4b85b5[_0x4dd3f9(0x158)][_0x4dd3f9(0x10b)],'version':_0x4b85b5['attributes'][_0x4dd3f9(0x10f)],'description':_0x4b85b5[_0x4dd3f9(0x158)]['description'],'state':_0x4b85b5['attributes']['state'],'paused':_0x4b85b5['attributes']['paused'],'reentry_mode':_0x4b85b5[_0x4dd3f9(0x158)][_0x4dd3f9(0x180)],'stages':_0x4b85b5[_0x4dd3f9(0x158)][_0x4dd3f9(0x15b)]?.[_0x4dd3f9(0x1b6)]||0x0,..._0x4b85b5[_0x4dd3f9(0x158)]['goal']&&{'goal':_0x4b85b5[_0x4dd3f9(0x158)][_0x4dd3f9(0x179)][_0x4dd3f9(0x10b)]},'latest':_0x3359ea['journeyId']===_0x246e32,'created_at':_0x4b85b5[_0x4dd3f9(0x158)][_0x4dd3f9(0x18d)],'updated_at':_0x4b85b5[_0x4dd3f9(0x158)]['updatedAt'],'url':_0x4f3a79},_0x5d65fb),0x0;}}
1
+ const a28_0x35a506=a28_0x5c6b;(function(_0x10fa3b,_0x15dad7){const _0x3b5a7a=a28_0x5c6b,_0x43d651=_0x10fa3b();while(!![]){try{const _0x5ba9c1=parseInt(_0x3b5a7a(0x16e))/0x1*(parseInt(_0x3b5a7a(0x20f))/0x2)+-parseInt(_0x3b5a7a(0x1f9))/0x3*(-parseInt(_0x3b5a7a(0x1a9))/0x4)+-parseInt(_0x3b5a7a(0x1df))/0x5*(parseInt(_0x3b5a7a(0x252))/0x6)+-parseInt(_0x3b5a7a(0x240))/0x7*(-parseInt(_0x3b5a7a(0x16b))/0x8)+-parseInt(_0x3b5a7a(0x20a))/0x9*(-parseInt(_0x3b5a7a(0x248))/0xa)+parseInt(_0x3b5a7a(0x153))/0xb*(parseInt(_0x3b5a7a(0x1ae))/0xc)+-parseInt(_0x3b5a7a(0x23c))/0xd*(parseInt(_0x3b5a7a(0x20e))/0xe);if(_0x5ba9c1===_0x15dad7)break;else _0x43d651['push'](_0x43d651['shift']());}catch(_0xffd775){_0x43d651['push'](_0x43d651['shift']());}}}(a28_0x592c,0xd6d0a));import a28_0x35ee26 from'chalk';import a28_0x3ba9f6 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';function a28_0x5c6b(_0x1728b7,_0x2bebe9){_0x1728b7=_0x1728b7-0x14f;const _0x592c35=a28_0x592c();let _0x5c6b8c=_0x592c35[_0x1728b7];return _0x5c6b8c;}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(_0x2d6238){const _0x1833b2=a28_0x5c6b;return!_0x2d6238&&(console[_0x1833b2(0x15a)](_0x1833b2(0x15f)),console[_0x1833b2(0x15a)](_0x1833b2(0x1ab))),!!_0x2d6238;}function withJsonFormat(_0x3bc8b3){const _0x140db0=a28_0x5c6b;if(!_0x3bc8b3[_0x140db0(0x241)]&&!_0x3bc8b3[_0x140db0(0x236)]&&!_0x3bc8b3[_0x140db0(0x1e8)]&&!_0x3bc8b3[_0x140db0(0x224)])return{..._0x3bc8b3,'format':_0x140db0(0x236),'json':!![]};return _0x3bc8b3;}function formatJourneyState(_0x5d1e26){const _0x504a8f=a28_0x5c6b;switch(_0x5d1e26){case _0x504a8f(0x1b5):return a28_0x35ee26[_0x504a8f(0x169)]('(running)');case _0x504a8f(0x150):return a28_0x35ee26[_0x504a8f(0x258)](_0x504a8f(0x198));case'paused':return a28_0x35ee26[_0x504a8f(0x187)]('(paused)');case _0x504a8f(0x185):return a28_0x35ee26[_0x504a8f(0x1f4)](_0x504a8f(0x175));case _0x504a8f(0x1f1):return a28_0x35ee26[_0x504a8f(0x258)](_0x504a8f(0x209));default:return'('+_0x5d1e26+')';}}function formatJourneyItem(_0x267eb4,_0x23c260='',_0x4b3c0a){const _0x4b9c72=a28_0x5c6b,_0x4594ee=formatJourneyState(_0x267eb4[_0x4b9c72(0x22f)]),_0x1c717e=_0x4b3c0a?hyperlink(_0x267eb4['journeyBundleName'],_0x4b3c0a):_0x267eb4[_0x4b9c72(0x158)];return _0x23c260+'🗺️\x20'+_0x1c717e+'\x20'+_0x4594ee;}function escapeRegex(_0x9858d7){const _0x2f9634=a28_0x5c6b;return _0x9858d7[_0x2f9634(0x21a)](/[.*+?^${}()|[\]\\]/g,_0x2f9634(0x179));}function globToRegex(_0x40edd2){const _0x4bbc66=a28_0x5c6b,_0x4ada25=_0x40edd2[_0x4bbc66(0x257)]('*')[_0x4bbc66(0x253)](escapeRegex);return new RegExp(_0x4ada25['join']('.*'),'i');}function buildRuleToNameMapping(_0x59a5e8){const _0x27b368=a28_0x5c6b,_0x507293=new Map();if(_0x59a5e8[_0x27b368(0x15c)])for(const [_0xc5659d,_0x7bc669]of Object['entries'](_0x59a5e8[_0x27b368(0x15c)])){if(_0x7bc669[_0x27b368(0x15d)]){const _0x3a7e88=serializeRule(_0x7bc669[_0x27b368(0x15d)]),_0x539352=_0x507293[_0x27b368(0x199)](_0x3a7e88);_0x539352?_0x539352['push'](_0xc5659d):_0x507293['set'](_0x3a7e88,[_0xc5659d]);}}return _0x507293;}async function resolveJourneyIdFromInput(_0x42c74d,_0x54a9d1,_0x3c752c){const _0x321939=a28_0x5c6b,_0x5594ed=await resolveJourneyTarget(_0x42c74d,_0x54a9d1['parentSegment'],_0x54a9d1[_0x321939(0x19e)]),_0x386787=_0x5594ed[_0x321939(0x25a)];if(!_0x386787)throw new SDKError(ErrorCode[_0x321939(0x184)],_0x321939(0x1f6));const _0x549eb5=await withSpinner(_0x321939(0x1d8),()=>_0x3c752c['segment'][_0x321939(0x22c)](_0x386787),{'verbose':_0x54a9d1[_0x321939(0x19e)]}),_0x6710e4=_0x549eb5[_0x321939(0x1ca)],_0x104004=await withSpinner(_0x321939(0x196),()=>_0x3c752c[_0x321939(0x1f3)][_0x321939(0x251)](_0x6710e4,_0x5594ed['journeyName']),{'verbose':_0x54a9d1[_0x321939(0x19e)]});return{'journeyId':_0x104004['data'],'journeyName':_0x5594ed[_0x321939(0x1d4)],'parentSegmentId':_0x6710e4};}async function resolveJourneyTarget(_0x529a37,_0x59fc2d,_0xfb485b){const _0x27fef4=a28_0x5c6b;if(isYamlFilePath(_0x529a37))try{const _0x2363ab=await resolveYamlFilePath(_0x529a37);return _0xfb485b&&(console[_0x27fef4(0x15a)]('Resolved\x20YAML\x20file:\x20'+_0x529a37),console[_0x27fef4(0x15a)](_0x27fef4(0x1d3)+_0x2363ab['parentSegment']),console['error'](_0x27fef4(0x1d7)+_0x2363ab[_0x27fef4(0x1b6)]),console[_0x27fef4(0x15a)](_0x27fef4(0x1c2)+(_0x2363ab[_0x27fef4(0x1c5)]||_0x27fef4(0x214)))),{'journeyName':_0x2363ab[_0x27fef4(0x1b6)],'parentSegment':_0x2363ab[_0x27fef4(0x25a)],'resolved':_0x2363ab};}catch(_0x25e575){throw new SDKError(ErrorCode[_0x27fef4(0x184)],_0x27fef4(0x152)+_0x25e575['message']);}if(!_0x59fc2d)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x529a37,'parentSegment':_0x59fc2d};}function a28_0x592c(){const _0x52c824=['✔\x20Pulled\x20','name','journey:push','user','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','journey:pull','activationParams','/app/ps/','Resolving\x20journey...','isNew','(draft)','get','Aborted.','listJourneysWithFolders','localeCompare','options','verbose','\x20unchanged\x20files',',\x20version:\x20','parentName','has','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','description','\x20=\x20','journey:pause','Show\x20journey\x20statistics','Found\x20','4xcbnBa','Pausing\x20journey...','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','journey:versions','132FnmEdj','Show\x20journey\x20details','segment','Fetching\x20users\x20and\x20connections...','Error:\x20Invalid\x20--type\x20\x22','getActivation','journey:list','launched','segmentName','completionRate','dryRun','length','goal','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','goalSize','\x22\x20paused','\x20\x20-\x20','Getting\x20version\x20','List\x20activations\x20for\x20a\x20journey','absolutePath','\x20\x20Folder\x20path:\x20','Resolving\x20version...','table','folderPath','parent_segment','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','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)','data','web','Getting\x20journey\x20statistics...','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','size','Warning:\x20Could\x20not\x20resolve\x20activation\x20','type','message','diff','\x20\x20Parent\x20segment:\x20','journeyName','createdAt','\x20files?','\x20\x20Name:\x20','Resolving\x20parent\x20segment...','Creating\x20new\x20version...','conversion','Options:','activation_','Error:\x20Journey\x20\x27','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','35CXpUNg','cwd','\x0aChanges\x20to\x20\x27','exitOrJumpSize','completeMilestoneRate','Fetching\x20parent\x20segment...','List\x20all\x20versions\x20of\x20a\x20journey','values','\x20version','jsonl','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','stageNameMap','join','Error:\x20Parent\x20segment\x20context\x20required','yes','milestoneSize','journey:version:create','Error:\x20Version\x20','archived','journey:activations','journey','blue','relative','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','hasPeriod','tdx.json','2486742dLxUNn','base','\x0aPull\x20summary:','then','resolveSegment','getTrafficData','find','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','Error:\x20Stage\x20\x22','journeys','set','.yml','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','\x20\x20Statistics\x20not\x20available','Pattern:\x20','enteredSize','(archived)','55449skgFVD','toLowerCase','Cancelled','attributes','1498JlsnvQ','6rKFxcX','red','\x20\x20Journey\x20ID:\x20','\x0aError:','✔\x20Context\x20set:\x20','(root)','getLatestJourneyId','site','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','updatedAt','Available\x20stages:\x20','replace','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','repeat','history','getColumnMapping','Error:\x20Invalid\x20version\x20number:\x20','\x20->\x20','journey:version:view','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','Getting\x20journey\x20traffic\x20data...','tsv','content','journeyBundleId','connector_config','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','Pause\x20a\x20running\x20journey','execute','Target\x20file:\x20','resolveParentId','log','stages','state','add','reentryMode','push','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','✔\x20All\x20files\x20are\x20up\x20to\x20date','test','json','filter','listVersions','✔\x20Journey\x20\x22','Fetching\x20journeys\x20and\x20folders...','Table:\x20','245349VSTLvP','no_parent','utf-8','\x20\x20Target:\x20','17780lmyGrF','format','Fetching\x20','filePath','buildIdToEmailMap','\x20versions)','No\x20journeys\x20found','\x20journey\x20files\x20to\x20','2120QHWDYe','\x22\x20resumed','Input:\x20','Target\x20directory:\x20','hasChanges','cyan','from','✔\x20Found\x20','exitOrJumpRate','resolveJourneyId','1427352vuoxxF','map','Parent\x20segment:\x20','Listing\x20journeys...','\x20not\x20found.\x20Available:\x20','split','dim','folders','parentSegment','renderStats','Listing\x20journey\x20activations...','file','listFolders','Journey\x20name:\x20','journeyStages','\x20activation','/j/da','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','draft','stage','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','229977TLgaZq','args','all','getJourney','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','journeyBundleName','📁\x20','error','pause','segments','rule','Error:\x20Journey\x20not\x20found:\x20','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','\x20\x20Consolidating\x20duplicate\x20segment:\x20','/j/da/je','...','Resuming\x20journey...','buildIdToNameMap','root\x20folder','sort','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','/e/','green','-\x20no\x20files\x20written','2752ezahFE','\x20(draft)\x20—\x20\x22','getStatistics','441918NWLtxd','\x20\x20Preserving\x20local\x20segment\x20name:\x20','Folder\x20path:\x20','Getting\x20journey\x20details...','Database:\x20','versionNumber','Show\x20journey\x20table\x20column\x20mapping','(completed)','View\x20a\x20specific\x20version\x20of\x20a\x20journey','journeyId','\x20(rule\x20match)','\x5c$&','targetDir','segmentPushCommand','resume','connection','folderId','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','limit','Write\x20','\x20(ID:\x20','\x22\x20not\x20found','INVALID_ARGUMENT','completed','includeHistory','yellow','session','getSegment','\x20Created\x20v','Error:\x20--version\x20option\x20is\x20required','paused','getParentFull'];a28_0x592c=function(){return _0x52c824;};return a28_0x592c();}export class JourneyListCommand extends BaseCommand{['name']=a28_0x35a506(0x1b4);[a28_0x35a506(0x1a4)]='List\x20journeys\x20in\x20current\x20context';async[a28_0x35a506(0x22a)](_0x2c60a8){const _0x56090e=a28_0x35a506,{options:_0x5c2612,args:_0x26b707,tdx:_0x1d6157}=_0x2c60a8,_0x1051ec=_0x26b707[0x0],_0x1c2dbf=_0x5c2612['parentSegment'];if(!_0x1c2dbf)return console[_0x56090e(0x15a)](_0x56090e(0x1ec)),console[_0x56090e(0x15a)](_0x56090e(0x222)),0x1;const _0x123819=await withSpinner(_0x56090e(0x1d8),()=>_0x1d6157['segment'][_0x56090e(0x22c)](_0x1c2dbf),{'verbose':_0x5c2612[_0x56090e(0x19e)]}),_0x3ffa80=_0x123819[_0x56090e(0x1ca)];_0x5c2612['verbose']&&(console[_0x56090e(0x15a)](_0x56090e(0x254)+_0x1c2dbf+_0x56090e(0x182)+_0x3ffa80+')'),_0x1051ec&&console[_0x56090e(0x15a)](_0x56090e(0x207)+_0x1051ec));const _0x49ee66=await withSpinner(_0x56090e(0x1e4),()=>_0x1d6157[_0x56090e(0x1b0)][_0x56090e(0x18d)](_0x3ffa80),{'verbose':_0x5c2612[_0x56090e(0x19e)]}),_0x1ce32d=_0x49ee66[_0x56090e(0x1ca)],_0x5cd72e=_0x1ce32d['rootFolderId'],_0x5292b1=await withSpinner(_0x56090e(0x255),()=>_0x1d6157[_0x56090e(0x1f3)][_0x56090e(0x19b)](_0x3ffa80,_0x5cd72e),{'verbose':_0x5c2612[_0x56090e(0x19e)]});let _0xb45402=_0x5292b1[_0x56090e(0x1ca)][_0x56090e(0x202)];const _0x4583a7=_0x5292b1[_0x56090e(0x1ca)][_0x56090e(0x259)],_0x5b21cd=new Map();for(const _0x9575df of _0x4583a7){_0x5b21cd[_0x56090e(0x203)](_0x9575df['id'],_0x9575df[_0x56090e(0x18f)]);}if(_0x1051ec){const _0x4ffe8a=globToRegex(_0x1051ec);_0xb45402=_0xb45402[_0x56090e(0x237)](_0x165393=>_0x4ffe8a[_0x56090e(0x235)](_0x165393['journeyBundleName']));}console['error'](_0x56090e(0x24f)+_0xb45402[_0x56090e(0x1b9)]+'\x20journey'+(_0xb45402[_0x56090e(0x1b9)]!==0x1?'s':''));const _0x1345d1=_0x3ab3dc=>{const _0x2956f0=_0x56090e;return getConsoleNextUrl(_0x5c2612[_0x2956f0(0x216)],_0x2956f0(0x195)+_0x3ffa80+_0x2956f0(0x168)+_0x3ab3dc+_0x2956f0(0x262));};if(_0x5c2612[_0x56090e(0x241)]==='table')await handleSDKOutput(_0xb45402,_0x5c2612);else{if(_0x5c2612[_0x56090e(0x241)]===_0x56090e(0x236)){const _0x1864f6=_0xb45402[_0x56090e(0x253)](_0x18bcb3=>({..._0x18bcb3,'url':_0x1345d1(_0x18bcb3['id'])}));await handleSDKOutput(_0x1864f6,_0x5c2612);}else{console['log']('['+_0x1c2dbf+']');const _0x3d7d88=new Map(),_0x283348=[];for(const _0x2bdc4a of _0xb45402){if(!_0x2bdc4a[_0x56090e(0x17e)]||_0x2bdc4a[_0x56090e(0x17e)]===_0x5cd72e)_0x283348[_0x56090e(0x232)](_0x2bdc4a);else{const _0x5e307e=_0x3d7d88[_0x56090e(0x199)](_0x2bdc4a[_0x56090e(0x17e)])||[];_0x5e307e[_0x56090e(0x232)](_0x2bdc4a),_0x3d7d88[_0x56090e(0x203)](_0x2bdc4a[_0x56090e(0x17e)],_0x5e307e);}}const _0xea8bf5=(_0x42a033,_0x12b7ca)=>_0x42a033[_0x56090e(0x158)][_0x56090e(0x19c)](_0x12b7ca[_0x56090e(0x158)],undefined,{'sensitivity':_0x56090e(0x1fa)});_0x283348[_0x56090e(0x166)](_0xea8bf5);for(const _0x3d1099 of _0x283348){console[_0x56090e(0x22d)](formatJourneyItem(_0x3d1099,'',_0x1345d1(_0x3d1099['id'])));}const _0x2e1afa=[..._0x3d7d88['entries']()][_0x56090e(0x166)]((_0x1e382e,_0x20dd55)=>{const _0x3a8d2d=_0x56090e,_0x39c62c=_0x5b21cd[_0x3a8d2d(0x199)](_0x1e382e[0x0])||_0x1e382e[0x0],_0x3eef97=_0x5b21cd['get'](_0x20dd55[0x0])||_0x20dd55[0x0];return _0x39c62c[_0x3a8d2d(0x19c)](_0x3eef97,undefined,{'sensitivity':'base'});});for(const [_0x149bbc,_0x4488a2]of _0x2e1afa){const _0x5632d2=_0x5b21cd[_0x56090e(0x199)](_0x149bbc)||_0x149bbc;console[_0x56090e(0x22d)](_0x56090e(0x159)+_0x5632d2),_0x4488a2[_0x56090e(0x166)](_0xea8bf5);for(const _0x2b594b of _0x4488a2){console['log'](formatJourneyItem(_0x2b594b,'\x20\x20',_0x1345d1(_0x2b594b['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a28_0x35a506(0x18f)]='journey:view';['description']=a28_0x35a506(0x1af);async['execute'](_0x497128){const _0x36d5ed=a28_0x35a506,{options:_0x522c4d,args:_0x283925,tdx:_0xedaf2e}=_0x497128,_0x20cf29=_0x283925[0x0];if(!_0x20cf29)return console[_0x36d5ed(0x15a)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x36d5ed(0x15a)]('Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]'),console[_0x36d5ed(0x15a)](_0x36d5ed(0x1db)),console['error'](_0x36d5ed(0x1ac)),0x1;_0x522c4d[_0x36d5ed(0x19e)]&&console['error'](_0x36d5ed(0x24a)+_0x20cf29);const {journeyId:_0x33ec35,parentSegmentId:_0x2041a6}=await resolveJourneyIdFromInput(_0x20cf29,_0x522c4d,_0xedaf2e);if(_0x522c4d[_0x36d5ed(0x1cb)]){const _0x4b5c63=getConsoleNextUrl(_0x522c4d['site'],_0x36d5ed(0x195)+_0x2041a6+_0x36d5ed(0x168)+_0x33ec35+'/j/da/je');return console['error'](a28_0x35ee26[_0x36d5ed(0x169)]('✔')+'\x20Opening\x20'+a28_0x35ee26['cyan'](_0x4b5c63)),openBrowser(_0x4b5c63),0x0;}const _0x477906=await withSpinner(_0x36d5ed(0x171),()=>_0xedaf2e['journey']['getJourney'](_0x33ec35),{'verbose':_0x522c4d[_0x36d5ed(0x19e)]}),_0x26c5af=_0x477906[_0x36d5ed(0x1ca)],_0x15fb92=_0x522c4d['includeStats'];let _0x59e0e2;if(_0x15fb92)try{const _0x12dc89=await withSpinner(_0x36d5ed(0x1cc),()=>_0xedaf2e[_0x36d5ed(0x1f3)]['getStatistics'](_0x33ec35),{'verbose':_0x522c4d[_0x36d5ed(0x19e)]});_0x59e0e2=_0x12dc89['data'];}catch{_0x522c4d[_0x36d5ed(0x19e)]&&console[_0x36d5ed(0x15a)](_0x36d5ed(0x206));}const _0x28fb5e=getConsoleNextUrl(_0x522c4d[_0x36d5ed(0x216)],_0x36d5ed(0x195)+_0x2041a6+'/e/'+_0x33ec35+'/j/da/je'),_0x579143={'id':_0x26c5af['id'],'name':_0x26c5af['attributes'][_0x36d5ed(0x18f)],'description':_0x26c5af[_0x36d5ed(0x20d)][_0x36d5ed(0x1a4)],'state':_0x26c5af[_0x36d5ed(0x20d)]['state'],'paused':_0x26c5af[_0x36d5ed(0x20d)][_0x36d5ed(0x18c)],'reentry_mode':_0x26c5af[_0x36d5ed(0x20d)][_0x36d5ed(0x231)],'stages':_0x26c5af[_0x36d5ed(0x20d)][_0x36d5ed(0x260)]?.[_0x36d5ed(0x1b9)]||0x0,..._0x26c5af[_0x36d5ed(0x20d)][_0x36d5ed(0x1ba)]&&{'goal':_0x26c5af[_0x36d5ed(0x20d)][_0x36d5ed(0x1ba)][_0x36d5ed(0x18f)]},..._0x59e0e2&&{'statistics':{'size':_0x59e0e2[_0x36d5ed(0x1ce)],'entered':_0x59e0e2[_0x36d5ed(0x208)],'goal_achieved':_0x59e0e2[_0x36d5ed(0x1bc)],'completion_rate':_0x59e0e2[_0x36d5ed(0x1b7)],'exit_or_jump':_0x59e0e2[_0x36d5ed(0x1e2)],'exit_or_jump_rate':_0x59e0e2[_0x36d5ed(0x250)],'stages':_0x59e0e2[_0x36d5ed(0x22e)]}},'url':_0x28fb5e};return await handleSingleObjectOutput(_0x579143,_0x522c4d),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a28_0x35a506(0x18f)]='journey:stats';['description']=a28_0x35a506(0x1a7);async['execute'](_0x51e726){const _0x3f3e14=a28_0x35a506,{options:_0x4c7dfa,args:_0x359f72,tdx:_0x273fc6}=_0x51e726,_0xdd61b1=_0x359f72[0x0];if(!requireNameOrPath(_0xdd61b1))return 0x1;_0x4c7dfa[_0x3f3e14(0x19e)]&&console[_0x3f3e14(0x15a)](_0x3f3e14(0x24a)+_0xdd61b1);const _0x458fb6=_0x4c7dfa,_0x3b6df9=_0x458fb6[_0x3f3e14(0x24e)],_0x37b093=_0x458fb6['to'],_0x5d0b37=_0x458fb6[_0x3f3e14(0x186)],_0x59d578=_0x458fb6[_0x3f3e14(0x151)];_0x5d0b37&&!_0x3b6df9&&!_0x37b093&&console[_0x3f3e14(0x15a)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x5111c7=_0x5d0b37?withJsonFormat(_0x4c7dfa):_0x4c7dfa,{journeyId:_0x44cf92,journeyName:_0x4fb6f3}=await resolveJourneyIdFromInput(_0xdd61b1,_0x5111c7,_0x273fc6),_0x38fdeb=_0x3b6df9||_0x37b093?{'from':_0x3b6df9,'to':_0x37b093}:undefined,_0x3ceaec=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise['all']([_0x273fc6[_0x3f3e14(0x1f3)][_0x3f3e14(0x156)](_0x44cf92),_0x273fc6[_0x3f3e14(0x1f3)][_0x3f3e14(0x16d)](_0x44cf92,_0x38fdeb)]),{'verbose':_0x5111c7['verbose']}),[_0x3cbd99,_0x2731b5]=_0x3ceaec[_0x3f3e14(0x1ca)];if(!_0x2731b5||_0x2731b5[_0x3f3e14(0x177)]===null)return console[_0x3f3e14(0x15a)]('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x4fb6f3),console[_0x3f3e14(0x15a)](_0x3f3e14(0x21b)),0x0;const _0xf4286e=buildStageNameMap(_0x3cbd99),_0x27d2a4=!!(_0x38fdeb&&_0x2731b5[_0x3f3e14(0x21d)]?.[_0x3f3e14(0x1b9)]),_0x316446={'stageNameMap':_0xf4286e,'hasPeriod':_0x27d2a4,'includeHistory':!!_0x5d0b37};if(_0x59d578&&_0x2731b5[_0x3f3e14(0x22e)]){const _0x1fd950=_0x2731b5[_0x3f3e14(0x22e)][_0x3f3e14(0x1ff)](_0x4a15f4=>{const _0x5eb1b4=_0x3f3e14,_0x40b8f1=_0xf4286e[_0x5eb1b4(0x199)](_0x4a15f4['id'])??'';return _0x40b8f1[_0x5eb1b4(0x20b)]()===_0x59d578[_0x5eb1b4(0x20b)]();});if(_0x1fd950)return await handleSingleObjectOutput(formatStageStats(_0x1fd950,_0x316446),_0x5111c7),0x0;const _0x1e9721=_0x2731b5[_0x3f3e14(0x22e)]['map'](_0x2ee43c=>_0xf4286e[_0x3f3e14(0x199)](_0x2ee43c['id'])??_0x2ee43c['id']);return console['error'](_0x3f3e14(0x201)+_0x59d578+_0x3f3e14(0x183)),console[_0x3f3e14(0x15a)](_0x3f3e14(0x219)+_0x1e9721[_0x3f3e14(0x1eb)](',\x20')),0x1;}const _0x391163=_0x2731b5[_0x3f3e14(0x22e)]?.[_0x3f3e14(0x253)](_0x2b0877=>formatStageStats(_0x2b0877,_0x316446)),_0x476af8=assembleJourneyStats(_0x2731b5,{'from':_0x3b6df9,'to':_0x37b093,'includeHistory':_0x5d0b37});return await this[_0x3f3e14(0x25b)](_0x476af8,_0x391163??[],_0x5111c7),0x0;}async['renderStats'](_0x3c93e8,_0x281b74,_0x4031a0){const _0x1f0912=a28_0x35a506,_0x494e43=_0x4031a0[_0x1f0912(0x241)]===_0x1f0912(0x236)||_0x4031a0[_0x1f0912(0x241)]===_0x1f0912(0x1e8)||_0x4031a0[_0x1f0912(0x236)]||_0x4031a0[_0x1f0912(0x1e8)];if(_0x494e43){_0x3c93e8[_0x1f0912(0x22e)]=_0x281b74,await handleSingleObjectOutput(_0x3c93e8,_0x4031a0);return;}await handleSingleObjectOutput(_0x3c93e8,_0x4031a0);for(const _0x24dd67 of _0x281b74){console[_0x1f0912(0x22d)](''),console[_0x1f0912(0x22d)](String(a28_0x35ee26[_0x1f0912(0x24d)]['bold']('['+_0x24dd67['name']+']'))+a28_0x35ee26[_0x1f0912(0x258)]('\x20'+_0x24dd67['id']));const {id:_0x1f89ae,name:_0x2e36a8,..._0x19551d}=_0x24dd67;await handleSingleObjectOutput(_0x19551d,_0x4031a0);}}}export class JourneyTrafficCommand extends BaseCommand{['name']='journey:traffic';[a28_0x35a506(0x1a4)]=a28_0x35a506(0x1c7);async[a28_0x35a506(0x22a)](_0x593025){const _0x3fc6e5=a28_0x35a506,{options:_0x2b83a9,args:_0x26f5d2,tdx:_0x5a5225}=_0x593025,_0x11d421=_0x26f5d2[0x0];if(!requireNameOrPath(_0x11d421))return 0x1;_0x2b83a9[_0x3fc6e5(0x19e)]&&console[_0x3fc6e5(0x15a)](_0x3fc6e5(0x24a)+_0x11d421);const _0x19af03=_0x2b83a9,_0x41eb13=_0x19af03[_0x3fc6e5(0x1d0)],_0x8afb52=_0x19af03[_0x3fc6e5(0x24e)],_0x105103=_0x19af03['to'],_0x418948=_0x19af03[_0x3fc6e5(0x180)];if(_0x41eb13&&_0x41eb13!==_0x3fc6e5(0x1da)&&_0x41eb13!=='activation')return console[_0x3fc6e5(0x15a)](_0x3fc6e5(0x1b2)+_0x41eb13+_0x3fc6e5(0x217)),0x1;const _0x42c232=withJsonFormat(_0x2b83a9),{journeyId:_0x3a5b72,journeyName:_0xb47949}=await resolveJourneyIdFromInput(_0x11d421,_0x42c232,_0x5a5225),_0x2e2f1b={'type':_0x41eb13,'from':_0x8afb52,'to':_0x105103,'limit':_0x418948},_0x41988b=await withSpinner(_0x3fc6e5(0x223),()=>_0x5a5225[_0x3fc6e5(0x1f3)][_0x3fc6e5(0x1fe)](_0x3a5b72,_0x2e2f1b),{'verbose':_0x42c232['verbose']}),_0x856f99=_0x41988b[_0x3fc6e5(0x1ca)],_0x231ad0=_0x856f99['conversion']&&(_0x856f99[_0x3fc6e5(0x1da)]['nodes']['length']>0x0||_0x856f99[_0x3fc6e5(0x1da)]['links']['length']>0x0),_0x16e3b0=_0x856f99['activation']&&_0x856f99['activation'][_0x3fc6e5(0x1b9)]>0x0;if(!_0x231ad0&&!_0x16e3b0)return console[_0x3fc6e5(0x15a)](_0x3fc6e5(0x1e9)+_0xb47949),console[_0x3fc6e5(0x15a)](_0x3fc6e5(0x17f)),_0x8afb52&&_0x105103&&console[_0x3fc6e5(0x15a)](_0x3fc6e5(0x1cd)),0x0;return await handleSingleObjectOutput(_0x856f99,_0x42c232),0x0;}}function formatStageStats(_0x5b363c,_0x28caa9){const _0x2f7d34=a28_0x35a506,_0x296126=_0x28caa9[_0x2f7d34(0x1f7)]&&_0x5b363c[_0x2f7d34(0x21d)]?.['length']?aggregateStageHistory(_0x5b363c[_0x2f7d34(0x21d)]):{'size':_0x5b363c['size'],'entered':_0x5b363c[_0x2f7d34(0x208)],'milestone':_0x5b363c[_0x2f7d34(0x1ee)],'milestone_rate':_0x5b363c[_0x2f7d34(0x1e3)],'exit_or_jump':_0x5b363c[_0x2f7d34(0x1e2)],'exit_or_jump_rate':_0x5b363c[_0x2f7d34(0x250)]},_0x326fff={'id':_0x5b363c['id'],'name':_0x28caa9[_0x2f7d34(0x1ea)][_0x2f7d34(0x199)](_0x5b363c['id'])??_0x5b363c['id'],..._0x296126};return _0x28caa9[_0x2f7d34(0x1f7)]&&_0x28caa9['includeHistory']&&_0x5b363c[_0x2f7d34(0x21d)]&&(_0x326fff[_0x2f7d34(0x21d)]=_0x5b363c[_0x2f7d34(0x21d)]),_0x326fff;}export class JourneyPauseCommand extends BaseCommand{['name']=a28_0x35a506(0x1a6);[a28_0x35a506(0x1a4)]=a28_0x35a506(0x229);async[a28_0x35a506(0x22a)](_0x561ee3){const _0x590eb5=a28_0x35a506,{options:_0x1a2826,args:_0x31e0df,tdx:_0x47d9a1}=_0x561ee3,_0x18c2f5=_0x31e0df[0x0];if(!requireNameOrPath(_0x18c2f5))return 0x1;_0x1a2826[_0x590eb5(0x19e)]&&console[_0x590eb5(0x15a)](_0x590eb5(0x24a)+_0x18c2f5);const {journeyId:_0x286c44,journeyName:_0x35ce60}=await resolveJourneyIdFromInput(_0x18c2f5,_0x1a2826,_0x47d9a1);if(!_0x1a2826[_0x590eb5(0x1ed)]){const _0x5c1d1e=await confirm(_0x590eb5(0x200)+_0x35ce60+'\x22?');if(!_0x5c1d1e)return console['error'](_0x590eb5(0x20c)),0x0;}const _0x54dbc9=await withSpinner(_0x590eb5(0x1aa),()=>_0x47d9a1[_0x590eb5(0x1f3)][_0x590eb5(0x15b)](_0x286c44),{'verbose':_0x1a2826[_0x590eb5(0x19e)]}),_0x4fa5be=_0x54dbc9[_0x590eb5(0x1ca)];return console[_0x590eb5(0x15a)](_0x590eb5(0x239)+_0x4fa5be[_0x590eb5(0x20d)][_0x590eb5(0x18f)]+_0x590eb5(0x1bd)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a28_0x35a506(0x18f)]='journey:resume';[a28_0x35a506(0x1a4)]='Resume\x20a\x20paused\x20journey';async[a28_0x35a506(0x22a)](_0x1ed973){const _0x2ac3c4=a28_0x35a506,{options:_0x1a61ca,args:_0x8fecaf,tdx:_0x329db6}=_0x1ed973,_0x406e86=_0x8fecaf[0x0];if(!requireNameOrPath(_0x406e86))return 0x1;_0x1a61ca[_0x2ac3c4(0x19e)]&&console['error']('Input:\x20'+_0x406e86);const {journeyId:_0x251f4d,journeyName:_0x48ae5f}=await resolveJourneyIdFromInput(_0x406e86,_0x1a61ca,_0x329db6);if(!_0x1a61ca[_0x2ac3c4(0x1ed)]){const _0x467af6=await confirm(_0x2ac3c4(0x1c8)+_0x48ae5f+'\x22?');if(!_0x467af6)return console[_0x2ac3c4(0x15a)]('Cancelled'),0x0;}const _0x5de4db=await withSpinner(_0x2ac3c4(0x163),()=>_0x329db6[_0x2ac3c4(0x1f3)][_0x2ac3c4(0x17c)](_0x251f4d),{'verbose':_0x1a61ca[_0x2ac3c4(0x19e)]}),_0x1d7ca3=_0x5de4db[_0x2ac3c4(0x1ca)];return console[_0x2ac3c4(0x15a)](_0x2ac3c4(0x239)+_0x1d7ca3[_0x2ac3c4(0x20d)]['name']+_0x2ac3c4(0x249)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a28_0x35a506(0x18f)]=a28_0x35a506(0x193);[a28_0x35a506(0x1a4)]='Export\x20journey(s)\x20as\x20YAML\x20files';async[a28_0x35a506(0x22a)](_0x4c1b06){const _0x3bd2c9=a28_0x35a506,{options:_0x4c1b9a,args:_0xee4706,tdx:_0x45e3d4}=_0x4c1b06,_0x41bf22=_0x4c1b9a,_0x4a461e=_0xee4706[0x0],_0x48f325=_0x4a461e&&isYamlFilePath(_0x4a461e),_0x2525fe=await resolveTarget({'arg':_0x48f325?_0x4a461e:undefined,'contextParent':_0x4c1b9a['parentSegment'],'cwd':process[_0x3bd2c9(0x1e0)]()});if(!isSuccessfulResolution(_0x2525fe))return _0x2525fe['errorCode']===_0x3bd2c9(0x23d)?(console[_0x3bd2c9(0x15a)](a28_0x35ee26[_0x3bd2c9(0x187)](_0x3bd2c9(0x14f))),console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x1c9)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file'),console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x1a3))):(console[_0x3bd2c9(0x15a)](a28_0x35ee26[_0x3bd2c9(0x210)]('Error:\x20'+_0x2525fe['message']+'\x0a')),_0x2525fe['helpText']&&console[_0x3bd2c9(0x15a)](a28_0x35ee26[_0x3bd2c9(0x24d)](_0x2525fe['helpText']))),0x1;let _0x38b518=_0x48f325?undefined:_0x4a461e,_0x3f1d3e,_0x656254;_0x2525fe[_0x3bd2c9(0x1d0)]===_0x3bd2c9(0x25d)&&(_0x38b518=_0x2525fe['resourceName'],_0x3f1d3e=_0x2525fe[_0x3bd2c9(0x243)],_0x656254=_0x2525fe[_0x3bd2c9(0x1c5)]);const _0x2cc5be=_0x2525fe[_0x3bd2c9(0x1a1)],_0x1d8755=_0x2525fe[_0x3bd2c9(0x17a)];_0x41bf22['verbose']&&(console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x254)+_0x2cc5be),console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x24b)+_0x1d8755),_0x38b518&&console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x25f)+_0x38b518),_0x3f1d3e&&console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x22b)+_0x3f1d3e),_0x656254&&console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x170)+_0x656254));const _0x237894=await withSpinner(_0x3bd2c9(0x1d8),()=>_0x45e3d4[_0x3bd2c9(0x1b0)][_0x3bd2c9(0x22c)](_0x2cc5be),{'verbose':_0x4c1b9a[_0x3bd2c9(0x19e)]}),_0x5b5901=_0x237894[_0x3bd2c9(0x1ca)],{journeys:_0xe9f18b,folders:_0x4e709b}=await withSpinner(_0x3bd2c9(0x23a),async()=>{const _0x4a2961=_0x3bd2c9,[_0x2b9b1a,_0x2f9bf0]=await Promise['all']([_0x45e3d4['journey']['listJourneysFromParentSegment'](_0x5b5901,undefined,{'includeAllVersions':!![]}),_0x45e3d4['segment'][_0x4a2961(0x25e)](_0x5b5901)]);return{'journeys':_0x2b9b1a,'folders':_0x2f9bf0};},{'verbose':_0x4c1b9a['verbose']})['then'](_0x94abc5=>_0x94abc5[_0x3bd2c9(0x1ca)]);let _0x2c7ea5=_0xe9f18b;const _0xb483c1=buildFolderIdToPathMap(_0x4e709b);if(_0x38b518){const _0x3fd0a2=_0x2c7ea5[_0x3bd2c9(0x237)](_0x338014=>_0x338014[_0x3bd2c9(0x158)]['toLowerCase']()===_0x38b518[_0x3bd2c9(0x20b)]());if(_0x3fd0a2[_0x3bd2c9(0x1b9)]===0x0)return console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x15e)+_0x38b518),console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x1bb)),0x1;_0x2c7ea5=_0x3fd0a2;}if(_0x656254!==undefined){const _0x408014=_0x2c7ea5[_0x3bd2c9(0x237)](_0x4be564=>{const _0x5694d0=_0x3bd2c9,_0x11fec1=_0x4be564[_0x5694d0(0x17e)]?_0xb483c1['get'](_0x4be564[_0x5694d0(0x17e)])||'':'';return _0x11fec1===_0x656254;});if(_0x408014[_0x3bd2c9(0x1b9)]===0x0&&_0x2c7ea5['length']>0x0){console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x1dd)+_0x38b518+'\x27\x20not\x20found\x20in\x20'+(_0x656254||_0x3bd2c9(0x165))),console['error'](_0x3bd2c9(0x1de));for(const _0x68d68f of _0x2c7ea5){const _0x384fa2=_0x68d68f[_0x3bd2c9(0x17e)]?_0xb483c1[_0x3bd2c9(0x199)](_0x68d68f[_0x3bd2c9(0x17e)])||'':'';console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x1be)+(_0x384fa2||_0x3bd2c9(0x214))+'/'+_0x68d68f[_0x3bd2c9(0x158)]);}return 0x1;}_0x2c7ea5=_0x408014;}if(_0x2c7ea5[_0x3bd2c9(0x1b9)]===0x0)return console['error'](_0x3bd2c9(0x246)),0x0;const _0x526a9d=new Map();for(const _0x1e52de of _0x2c7ea5){const _0x3f1dd5=_0x1e52de['journeyBundleId'];!_0x526a9d[_0x3bd2c9(0x1a2)](_0x3f1dd5)&&_0x526a9d['set'](_0x3f1dd5,[]),_0x526a9d[_0x3bd2c9(0x199)](_0x3f1dd5)[_0x3bd2c9(0x232)](_0x1e52de);}for(const _0x18c1ad of _0x526a9d['values']()){_0x18c1ad[_0x3bd2c9(0x166)]((_0x3a6c02,_0x1a289b)=>(_0x3a6c02[_0x3bd2c9(0x173)]||0x0)-(_0x1a289b[_0x3bd2c9(0x173)]||0x0));}const _0x241dcb=[],{idToEmailMap:_0x4beea1,connectionIdToNameMap:_0x278361}=await withSpinner(_0x3bd2c9(0x1b1),async()=>{const _0x3c1985=_0x3bd2c9,[_0x593e98,_0x3109f5]=await Promise[_0x3c1985(0x155)]([_0x45e3d4[_0x3c1985(0x191)][_0x3c1985(0x244)](),_0x45e3d4[_0x3c1985(0x17d)][_0x3c1985(0x164)]()]);return{'idToEmailMap':_0x593e98,'connectionIdToNameMap':_0x3109f5};},{'verbose':_0x4c1b9a[_0x3bd2c9(0x19e)]})[_0x3bd2c9(0x1fc)](_0x50cb8a=>_0x50cb8a[_0x3bd2c9(0x1ca)]);for(const _0x5e6e27 of _0x526a9d[_0x3bd2c9(0x1e6)]()){const _0x4052c6=_0x5e6e27[0x0][_0x3bd2c9(0x158)],_0x41e57f=_0x5e6e27[0x0]['folderId'],_0x3e0136=_0x41e57f?_0xb483c1[_0x3bd2c9(0x199)](_0x41e57f)||'':'',_0x257725=_0x3e0136?a28_0x3ba9f6[_0x3bd2c9(0x1eb)](_0x1d8755,_0x3e0136):_0x1d8755,_0x497f55=_0x3f1d3e||a28_0x3ba9f6[_0x3bd2c9(0x1eb)](_0x257725,sanitizeFileName(_0x4052c6)+_0x3bd2c9(0x204));let _0x3349dc,_0x4f6272;if(existsSync(_0x497f55))try{const _0x54d753=readFileSync(_0x497f55,_0x3bd2c9(0x23e)),_0x4a2f08=parseYamlString(_0x54d753);_0x4f6272=_0x4a2f08,_0x3349dc=buildRuleToNameMapping(_0x4a2f08),_0x41bf22['verbose']&&_0x3349dc[_0x3bd2c9(0x1ce)]>0x0&&console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x1a8)+_0x3349dc[_0x3bd2c9(0x1ce)]+_0x3bd2c9(0x233)+_0x4052c6);}catch(_0x3b290d){_0x41bf22[_0x3bd2c9(0x19e)]&&console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x192)+_0x3b290d[_0x3bd2c9(0x1d1)]);}const _0x2890f4=[],_0x35c190=new Set(),_0x2b1fc6=new Map(),_0x30b7ec=new Map(),_0x3f8bf6=new Set(),_0x126044=new Map(),_0x50ecf3=new Map(),_0x1ce9d3=createJumpTargetCache();await withProgressSpinner(_0x3bd2c9(0x242)+_0x4052c6+_0x3bd2c9(0x162),async _0x29071b=>{const _0xd7d193=_0x3bd2c9;for(const _0x2fb4d7 of _0x5e6e27){const _0x518b93=_0x5e6e27[_0xd7d193(0x1b9)]>0x1?_0x2fb4d7[_0xd7d193(0x158)]+'\x20v'+(_0x2fb4d7['versionNumber']||0x1):_0x2fb4d7[_0xd7d193(0x158)];_0x29071b['setPhase'](_0xd7d193(0x242)+_0x518b93);const _0x10a684=await _0x45e3d4['journey'][_0xd7d193(0x156)](_0x2fb4d7['id']),_0x14304d=_0x10a684[_0xd7d193(0x20d)]?.['audienceId'],_0x2244f1={'resolveSegment':async _0x49f8a3=>{const _0x38de4d=_0xd7d193;if(!_0x14304d)return{'name':_0x49f8a3,'isJourneyLocal':![]};const _0x1aa50c=_0x2b1fc6['get'](_0x49f8a3);if(_0x1aa50c)return _0x1aa50c;try{const _0x9cfb7a=await _0x45e3d4[_0x38de4d(0x1b0)][_0x38de4d(0x189)](_0x14304d,_0x49f8a3),_0x3c19a4=_0x9cfb7a['kind']===SEGMENT_KIND_JOURNEY;let _0x193e95,_0x38cc53=_0x9cfb7a['name'];if(_0x3c19a4&&_0x9cfb7a[_0x38de4d(0x15d)]){const _0x4afe57=await segmentResponseToDef(_0x9cfb7a,{'resolveSegmentName':async _0x487bfc=>{const _0x5d803e=_0x38de4d,_0x3e68de=_0x2b1fc6[_0x5d803e(0x199)](_0x487bfc);if(_0x3e68de)return _0x3e68de[_0x5d803e(0x18f)];const _0x708af7=await _0x2244f1[_0x5d803e(0x1fd)](_0x487bfc);return _0x708af7['name'];}}),_0x2b536f=_0x4afe57[_0x38de4d(0x15d)];_0x193e95={'description':_0x9cfb7a['description'],'rule':_0x2b536f};const _0x5f3098=serializeRule(_0x2b536f),_0x17507b=_0x30b7ec['get'](_0x5f3098);if(_0x17507b)_0x38cc53=_0x17507b,_0x193e95=undefined,_0x41bf22[_0x38de4d(0x19e)]&&console['error'](_0x38de4d(0x160)+_0x9cfb7a[_0x38de4d(0x18f)]+_0x38de4d(0x220)+_0x17507b);else{let _0x446fa7=![];if(_0x3349dc){const _0x60cf39=_0x3349dc['get'](_0x5f3098);if(_0x60cf39){const _0x546c53=_0x60cf39[_0x38de4d(0x1ff)](_0x51624a=>!_0x35c190[_0x38de4d(0x1a2)](_0x51624a));_0x546c53&&(_0x38cc53=_0x546c53,_0x35c190[_0x38de4d(0x230)](_0x546c53),_0x30b7ec[_0x38de4d(0x203)](_0x5f3098,_0x546c53),_0x446fa7=!![],_0x41bf22[_0x38de4d(0x19e)]&&console[_0x38de4d(0x15a)](_0x38de4d(0x16f)+_0x546c53+_0x38de4d(0x178)));}}if(!_0x446fa7){const _0x27151a=generateJourneyLocalName(_0x9cfb7a[_0x38de4d(0x18f)]);_0x27151a&&(_0x38cc53=_0x27151a);let _0x3ca508=_0x38cc53,_0x35e1d6=0x2;while(_0x35c190[_0x38de4d(0x1a2)](_0x3ca508)){_0x3ca508=_0x38cc53+'_'+_0x35e1d6,_0x35e1d6++;}_0x35c190[_0x38de4d(0x230)](_0x3ca508),_0x30b7ec[_0x38de4d(0x203)](_0x5f3098,_0x3ca508),_0x38cc53=_0x3ca508;}}}const _0x4a8782={'name':_0x38cc53,'isJourneyLocal':_0x3c19a4,'definition':_0x193e95};return _0x2b1fc6[_0x38de4d(0x203)](_0x49f8a3,_0x4a8782),_0x4a8782;}catch(_0x4438d5){return _0x4c1b9a['verbose']&&console[_0x38de4d(0x15a)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x49f8a3+':\x20'+_0x4438d5['message']),{'name':_0x49f8a3,'isJourneyLocal':![]};}},'resolveActivation':async _0x6a3bf6=>{const _0x5f3087=_0xd7d193,_0x1c3126=_0x126044[_0x5f3087(0x199)](_0x6a3bf6);if(_0x1c3126)return _0x1c3126;try{const _0x50989a=await _0x45e3d4[_0x5f3087(0x1f3)][_0x5f3087(0x1b3)](_0x2fb4d7['id'],_0x6a3bf6),_0x12d774=journeyActivationStepToYaml(_0x50989a,_0x4beea1,_0x278361),_0x830751=JSON['stringify']({'name':_0x12d774['name'],'connection':_0x12d774[_0x5f3087(0x17d)],'connector_config':_0x12d774[_0x5f3087(0x227)]}),_0x420fd3=_0x50ecf3[_0x5f3087(0x199)](_0x830751);if(_0x420fd3){const _0x33301e={'name':_0x420fd3,'isJourneyLocal':!![],'definition':_0x12d774};return _0x126044[_0x5f3087(0x203)](_0x6a3bf6,_0x33301e),_0x33301e;}const _0x1a97db=_0x50989a[_0x5f3087(0x20d)][_0x5f3087(0x194)]['name']||_0x6a3bf6,_0x527f21=sanitizeYamlKey(_0x1a97db)||_0x5f3087(0x1dc)+_0x6a3bf6;let _0x394cd0=_0x527f21,_0x2f4c7f=0x2;while(_0x3f8bf6[_0x5f3087(0x1a2)](_0x394cd0)){_0x394cd0=_0x527f21+'_'+_0x2f4c7f,_0x2f4c7f++;}_0x3f8bf6[_0x5f3087(0x230)](_0x394cd0),_0x50ecf3[_0x5f3087(0x203)](_0x830751,_0x394cd0);const _0x6d071c={'name':_0x394cd0,'isJourneyLocal':!![],'definition':_0x12d774};return _0x126044[_0x5f3087(0x203)](_0x6a3bf6,_0x6d071c),_0x6d071c;}catch(_0x8d9233){return _0x4c1b9a[_0x5f3087(0x19e)]&&console[_0x5f3087(0x15a)](_0x5f3087(0x1cf)+_0x6a3bf6+':\x20'+_0x8d9233[_0x5f3087(0x1d1)]),{'name':_0x6a3bf6,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x258751,_0x1bf204)=>{const _0x2df604=_0xd7d193;return resolveJumpTarget(_0x258751,_0x1bf204,_0x1ce9d3,_0x59cdb3=>_0x45e3d4[_0x2df604(0x1f3)][_0x2df604(0x156)](_0x59cdb3));}},_0x3e66a0=await journeyResponseToDef(_0x10a684,_0x2244f1);_0x2890f4[_0xd7d193(0x232)]({'item':_0x2fb4d7,'yaml':_0x3e66a0});}},{'verbose':_0x4c1b9a[_0x3bd2c9(0x19e)]});const _0x2d0928=await _0x45e3d4[_0x3bd2c9(0x1f3)][_0x3bd2c9(0x215)](_0x5e6e27[0x0]['journeyBundleId']),_0x135f2e=buildMergedJourneyDef(_0x2890f4,_0x3349dc,_0x2d0928),_0x316c6c=normalizeJourneyDef(_0x135f2e,_0x4f6272),_0x4545b3=toYamlString(_0x316c6c),_0x3a4ded=_0x3f1d3e||a28_0x3ba9f6[_0x3bd2c9(0x1eb)](_0x257725,sanitizeFileName(_0x4052c6)+_0x3bd2c9(0x204));!_0x3f1d3e&&_0x3e0136&&!existsSync(_0x257725)&&mkdirSync(_0x257725,{'recursive':!![]});const _0x312379=a28_0x3ba9f6[_0x3bd2c9(0x1f5)](process[_0x3bd2c9(0x1e0)](),_0x3a4ded);if(existsSync(_0x3a4ded)){const _0x212da1=readFileSync(_0x3a4ded,_0x3bd2c9(0x23e)),_0xd9b575=generateDiff(_0x212da1,_0x4545b3),_0x4cad6c=hasChanges(_0xd9b575);_0x241dcb[_0x3bd2c9(0x232)]({'relativePath':_0x312379,'absolutePath':_0x3a4ded,'content':_0x4545b3,'isNew':![],'hasChanges':_0x4cad6c,'diff':_0x4cad6c?formatDiffWithColors(_0xd9b575):undefined});}else _0x241dcb[_0x3bd2c9(0x232)]({'relativePath':_0x312379,'absolutePath':_0x3a4ded,'content':_0x4545b3,'isNew':!![],'hasChanges':![]});}const _0x10b1ca=_0x241dcb[_0x3bd2c9(0x237)](_0x174e58=>_0x174e58[_0x3bd2c9(0x197)]),_0xeaa7c2=_0x241dcb['filter'](_0x3fbce7=>!_0x3fbce7[_0x3bd2c9(0x197)]&&_0x3fbce7[_0x3bd2c9(0x24c)]),_0x5d0201=_0x241dcb['filter'](_0x46e1e5=>!_0x46e1e5[_0x3bd2c9(0x197)]&&!_0x46e1e5[_0x3bd2c9(0x24c)]),_0x598a88=_0x2c7ea5[_0x3bd2c9(0x1b9)],_0x5ef3a4=_0x526a9d['size'],_0x4d53b5=_0x598a88>_0x5ef3a4?'\x20('+_0x598a88+_0x3bd2c9(0x245):'';console['error'](_0x3bd2c9(0x1fb)),console[_0x3bd2c9(0x15a)]('\x20\x20'+a28_0x35ee26[_0x3bd2c9(0x24d)](_0x5ef3a4+'\x20journeys')+a28_0x35ee26['dim'](_0x4d53b5)),console[_0x3bd2c9(0x15a)]('\x20\x20'+a28_0x35ee26['green']('+\x20'+_0x10b1ca[_0x3bd2c9(0x1b9)]+'\x20new\x20files')),console[_0x3bd2c9(0x15a)]('\x20\x20'+a28_0x35ee26['yellow']('~\x20'+_0xeaa7c2[_0x3bd2c9(0x1b9)]+'\x20changed\x20files')),console[_0x3bd2c9(0x15a)]('\x20\x20'+a28_0x35ee26[_0x3bd2c9(0x258)]('=\x20'+_0x5d0201[_0x3bd2c9(0x1b9)]+_0x3bd2c9(0x19f))),console['error'](_0x3bd2c9(0x23f)+a28_0x35ee26[_0x3bd2c9(0x24d)](_0x1d8755)+'\x0a');if(_0xeaa7c2[_0x3bd2c9(0x1b9)]>0x0)for(const _0x16143b of _0xeaa7c2){console[_0x3bd2c9(0x15a)](_0x3bd2c9(0x1e1)+_0x16143b['relativePath']+'\x27:'),console['error']('─'['repeat'](0x3c)),console[_0x3bd2c9(0x15a)](_0x16143b[_0x3bd2c9(0x1d2)]),console[_0x3bd2c9(0x15a)]('─'[_0x3bd2c9(0x21c)](0x3c));}if(_0x41bf22[_0x3bd2c9(0x1b8)])return console[_0x3bd2c9(0x15a)](a28_0x35ee26[_0x3bd2c9(0x187)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x10b1ca['length']===0x0&&_0xeaa7c2[_0x3bd2c9(0x1b9)]===0x0)return console[_0x3bd2c9(0x15a)](a28_0x35ee26[_0x3bd2c9(0x169)](_0x3bd2c9(0x234))),saveSessionContext({'parent_segment':_0x2cc5be},_0x41bf22[_0x3bd2c9(0x188)]),console[_0x3bd2c9(0x15a)](a28_0x35ee26['green'](_0x3bd2c9(0x213)+a28_0x35ee26[_0x3bd2c9(0x258)](_0x3bd2c9(0x1c6))+'\x20=\x20'+a28_0x35ee26[_0x3bd2c9(0x24d)](_0x2cc5be))),0x0;if(!_0x41bf22[_0x3bd2c9(0x1ed)]&&(_0x10b1ca[_0x3bd2c9(0x1b9)]>0x0||_0xeaa7c2[_0x3bd2c9(0x1b9)]>0x0)){if(!isInteractive())return console[_0x3bd2c9(0x15a)](a28_0x35ee26[_0x3bd2c9(0x210)](_0x3bd2c9(0x212)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3bd2c9(0x15a)](a28_0x35ee26[_0x3bd2c9(0x258)](_0x3bd2c9(0x167))),0x1;const _0x35a9c1=await confirmKey(_0x3bd2c9(0x181)+(_0x10b1ca[_0x3bd2c9(0x1b9)]+_0xeaa7c2['length'])+_0x3bd2c9(0x1d6));if(!_0x35a9c1)return console[_0x3bd2c9(0x15a)](a28_0x35ee26[_0x3bd2c9(0x187)](_0x3bd2c9(0x19a)),_0x3bd2c9(0x16a)),0x1;}!existsSync(_0x1d8755)&&mkdirSync(_0x1d8755,{'recursive':!![]});const _0x285b80=a28_0x3ba9f6[_0x3bd2c9(0x1eb)](_0x1d8755,_0x3bd2c9(0x1f8));writeFileSync(_0x285b80,createTdxConfigContent(_0x2cc5be),_0x3bd2c9(0x23e));for(const _0x564a72 of _0x241dcb){(_0x564a72[_0x3bd2c9(0x197)]||_0x564a72[_0x3bd2c9(0x24c)])&&writeFileSync(_0x564a72[_0x3bd2c9(0x1c1)],_0x564a72[_0x3bd2c9(0x225)],'utf-8');}return console[_0x3bd2c9(0x15a)](a28_0x35ee26['green'](_0x3bd2c9(0x18e)+(_0x10b1ca['length']+_0xeaa7c2['length'])+_0x3bd2c9(0x247)+_0x1d8755)),saveSessionContext({'parent_segment':_0x2cc5be},_0x41bf22['session']),console[_0x3bd2c9(0x15a)](a28_0x35ee26[_0x3bd2c9(0x169)]('✔\x20Context\x20set:\x20'+a28_0x35ee26[_0x3bd2c9(0x258)](_0x3bd2c9(0x1c6))+_0x3bd2c9(0x1a5)+a28_0x35ee26[_0x3bd2c9(0x24d)](_0x2cc5be))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a28_0x35a506(0x18f)]='journey:columns';['description']=a28_0x35a506(0x174);async[a28_0x35a506(0x22a)](_0x3cfd6b){const _0x424f31=a28_0x35a506,{options:_0x408df7,args:_0xbb0513,tdx:_0x5b4bce}=_0x3cfd6b,_0x397849=_0xbb0513[0x0];if(!requireNameOrPath(_0x397849))return 0x1;_0x408df7[_0x424f31(0x19e)]&&console[_0x424f31(0x15a)](_0x424f31(0x24a)+_0x397849);const {journeyId:_0x2f9c4d}=await resolveJourneyIdFromInput(_0x397849,_0x408df7,_0x5b4bce),_0x61d48f=await withSpinner('Getting\x20column\x20mapping...',()=>_0x5b4bce['journey'][_0x424f31(0x21e)](_0x2f9c4d),{'verbose':_0x408df7[_0x424f31(0x19e)]}),_0x3bdc9b=_0x61d48f[_0x424f31(0x1ca)];return console[_0x424f31(0x22d)](_0x424f31(0x172)+_0x3bdc9b['database']),console[_0x424f31(0x22d)](_0x424f31(0x23b)+_0x3bdc9b[_0x424f31(0x1c4)]),await handleSDKOutput(_0x3bdc9b['columns'],_0x408df7),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a28_0x35a506(0x18f)]=a28_0x35a506(0x1f2);[a28_0x35a506(0x1a4)]=a28_0x35a506(0x1c0);async[a28_0x35a506(0x22a)](_0x579893){const _0x4581a1=a28_0x35a506,{options:_0x3f1d39,args:_0x56a9cf,tdx:_0x491499}=_0x579893,_0x54e4cd=_0x56a9cf[0x0];if(!requireNameOrPath(_0x54e4cd))return 0x1;_0x3f1d39[_0x4581a1(0x19e)]&&console['error'](_0x4581a1(0x24a)+_0x54e4cd);const {journeyId:_0x4089ed}=await resolveJourneyIdFromInput(_0x54e4cd,_0x3f1d39,_0x491499),_0x235e1e=await withSpinner(_0x4581a1(0x25c),()=>_0x491499['journey']['listActivationsFlat'](_0x4089ed),{'verbose':_0x3f1d39[_0x4581a1(0x19e)]}),_0x36a21b=_0x235e1e[_0x4581a1(0x1ca)];return console[_0x4581a1(0x15a)]('Found\x20'+_0x36a21b[_0x4581a1(0x1b9)]+_0x4581a1(0x261)+(_0x36a21b[_0x4581a1(0x1b9)]!==0x1?'s':'')),await handleSDKOutput(_0x36a21b,_0x3f1d39),0x0;}}export class JourneyPushCommand extends BaseCommand{[a28_0x35a506(0x18f)]=a28_0x35a506(0x190);[a28_0x35a506(0x1a4)]=a28_0x35a506(0x205);['segmentPushCommand']=new SegmentPushCommand();async['execute'](_0x24e040){const _0x41f1ba=a28_0x35a506,_0x1ba4af=_0x24e040[_0x41f1ba(0x154)][0x0];let _0x190513;if(_0x1ba4af){const _0x3bed3a=await resolveTarget({'arg':_0x1ba4af,'contextParent':_0x24e040[_0x41f1ba(0x19d)][_0x41f1ba(0x25a)],'cwd':process[_0x41f1ba(0x1e0)]()});isSuccessfulResolution(_0x3bed3a)&&_0x3bed3a[_0x41f1ba(0x1d0)]===_0x41f1ba(0x25d)&&(_0x190513=_0x3bed3a['filePath']);}const _0x387fc9={..._0x24e040,'options':{..._0x24e040[_0x41f1ba(0x19d)],'journeysOnly':!![],..._0x190513&&{'singleFilePath':_0x190513}}};return this[_0x41f1ba(0x17b)]['execute'](_0x387fc9);}}export class JourneyVersionsCommand extends BaseCommand{[a28_0x35a506(0x18f)]=a28_0x35a506(0x1ad);[a28_0x35a506(0x1a4)]=a28_0x35a506(0x1e5);async['execute'](_0x343fb3){const _0x25e3ce=a28_0x35a506,{options:_0x38f912,args:_0x17af6e,tdx:_0x272103}=_0x343fb3,_0x42413a=_0x17af6e[0x0];if(!requireNameOrPath(_0x42413a))return 0x1;if(_0x38f912[_0x25e3ce(0x19e)])console[_0x25e3ce(0x15a)](_0x25e3ce(0x24a)+_0x42413a);const {journeyId:_0x1890d0}=await resolveJourneyIdFromInput(_0x42413a,_0x38f912,_0x272103),_0x16db31=await withSpinner('Listing\x20journey\x20versions...',()=>_0x272103[_0x25e3ce(0x1f3)]['listVersions'](_0x1890d0),{'verbose':_0x38f912[_0x25e3ce(0x19e)]}),{bundleName:_0x551207,versions:_0x147168,latestJourneyId:_0x53558d}=_0x16db31[_0x25e3ce(0x1ca)];console[_0x25e3ce(0x15a)](_0x551207+':\x20'+_0x147168[_0x25e3ce(0x1b9)]+_0x25e3ce(0x1e7)+(_0x147168[_0x25e3ce(0x1b9)]!==0x1?'s':''));const _0x458794=_0x147168['map'](_0x4d5704=>({'version':_0x4d5704[_0x25e3ce(0x173)],'journey_id':_0x4d5704[_0x25e3ce(0x177)],'name':_0x4d5704['name'],'state':_0x4d5704[_0x25e3ce(0x22f)],'paused':_0x4d5704[_0x25e3ce(0x18c)],'latest':_0x4d5704[_0x25e3ce(0x177)]===_0x53558d,'created_at':_0x4d5704['createdAt']}));return await handleSDKOutput(_0x458794,_0x38f912),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{[a28_0x35a506(0x18f)]=a28_0x35a506(0x1ef);['description']='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a28_0x35a506(0x22a)](_0x4cdbb8){const _0x39209e=a28_0x35a506,{options:_0x436d74,args:_0x2374a0,tdx:_0x123bec}=_0x4cdbb8,_0x220d76=_0x2374a0[0x0];if(!requireNameOrPath(_0x220d76))return 0x1;if(_0x436d74['verbose'])console['error']('Input:\x20'+_0x220d76);const {journeyId:_0x5ea91b,journeyName:_0x897b22}=await resolveJourneyIdFromInput(_0x220d76,_0x436d74,_0x123bec);if(!_0x436d74[_0x39209e(0x1ed)]){const _0x24c7eb=await confirm(_0x39209e(0x157)+_0x897b22+'\x22?');if(!_0x24c7eb)return console[_0x39209e(0x15a)](_0x39209e(0x20c)),0x0;}const _0x368a2d=await withSpinner(_0x39209e(0x1d9),()=>_0x123bec[_0x39209e(0x1f3)]['createVersion'](_0x5ea91b),{'verbose':_0x436d74['verbose']}),_0x1dd375=_0x368a2d[_0x39209e(0x1ca)];return console[_0x39209e(0x15a)](a28_0x35ee26[_0x39209e(0x169)]('✔')+_0x39209e(0x18a)+_0x1dd375['attributes'][_0x39209e(0x173)]+_0x39209e(0x16c)+_0x1dd375[_0x39209e(0x20d)][_0x39209e(0x18f)]+'\x22'),console[_0x39209e(0x15a)](_0x39209e(0x211)+_0x1dd375['id']),await handleSingleObjectOutput({'id':_0x1dd375['id'],'name':_0x1dd375[_0x39209e(0x20d)]['name'],'version':_0x1dd375[_0x39209e(0x20d)][_0x39209e(0x173)],'state':_0x1dd375[_0x39209e(0x20d)][_0x39209e(0x22f)],'bundle_id':_0x1dd375['attributes'][_0x39209e(0x226)],'created_at':_0x1dd375[_0x39209e(0x20d)]['createdAt']},_0x436d74),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a28_0x35a506(0x18f)]=a28_0x35a506(0x221);[a28_0x35a506(0x1a4)]=a28_0x35a506(0x176);async[a28_0x35a506(0x22a)](_0x1ccd7f){const _0x42868a=a28_0x35a506,{options:_0x16695a,args:_0x187444,tdx:_0x1e0bf7}=_0x1ccd7f,_0x274554=_0x187444[0x0];if(!requireNameOrPath(_0x274554))return 0x1;const _0x3d0183=_0x16695a['version'];if(!_0x3d0183)return console[_0x42868a(0x15a)](_0x42868a(0x18b)),console[_0x42868a(0x15a)](_0x42868a(0x228)),0x1;const _0x1e0283=parseInt(_0x3d0183,0xa);if(isNaN(_0x1e0283)||_0x1e0283<0x1)return console[_0x42868a(0x15a)](_0x42868a(0x21f)+_0x3d0183),0x1;if(_0x16695a['verbose'])console[_0x42868a(0x15a)](_0x42868a(0x24a)+_0x274554+_0x42868a(0x1a0)+_0x1e0283);const {journeyId:_0x29bd77,parentSegmentId:_0x3198f2}=await resolveJourneyIdFromInput(_0x274554,_0x16695a,_0x1e0bf7),_0x508eec=await withSpinner(_0x42868a(0x1c3),()=>_0x1e0bf7['journey'][_0x42868a(0x238)](_0x29bd77),{'verbose':_0x16695a[_0x42868a(0x19e)]}),{versions:_0x38cede,latestJourneyId:_0xb276e1}=_0x508eec[_0x42868a(0x1ca)],_0x53b6d9=_0x38cede[_0x42868a(0x1ff)](_0x675b14=>_0x675b14[_0x42868a(0x173)]===_0x1e0283);if(!_0x53b6d9){const _0x19c59e=_0x38cede[_0x42868a(0x253)](_0x586b1b=>'v'+_0x586b1b['versionNumber'])[_0x42868a(0x1eb)](',\x20');return console[_0x42868a(0x15a)](_0x42868a(0x1f0)+_0x1e0283+_0x42868a(0x256)+_0x19c59e),0x1;}const _0x1814c6=await withSpinner(_0x42868a(0x1bf)+_0x1e0283+'\x20details...',()=>_0x1e0bf7[_0x42868a(0x1f3)]['getJourney'](_0x53b6d9[_0x42868a(0x177)]),{'verbose':_0x16695a[_0x42868a(0x19e)]}),_0x31c203=_0x1814c6[_0x42868a(0x1ca)],_0xff3a6d=getConsoleNextUrl(_0x16695a[_0x42868a(0x216)],_0x42868a(0x195)+_0x3198f2+_0x42868a(0x168)+_0x53b6d9[_0x42868a(0x177)]+_0x42868a(0x161));return await handleSingleObjectOutput({'id':_0x31c203['id'],'name':_0x31c203[_0x42868a(0x20d)]['name'],'version':_0x31c203[_0x42868a(0x20d)]['versionNumber'],'description':_0x31c203[_0x42868a(0x20d)][_0x42868a(0x1a4)],'state':_0x31c203[_0x42868a(0x20d)][_0x42868a(0x22f)],'paused':_0x31c203[_0x42868a(0x20d)][_0x42868a(0x18c)],'reentry_mode':_0x31c203['attributes'][_0x42868a(0x231)],'stages':_0x31c203[_0x42868a(0x20d)][_0x42868a(0x260)]?.['length']||0x0,..._0x31c203[_0x42868a(0x20d)][_0x42868a(0x1ba)]&&{'goal':_0x31c203[_0x42868a(0x20d)][_0x42868a(0x1ba)][_0x42868a(0x18f)]},'latest':_0x53b6d9[_0x42868a(0x177)]===_0xb276e1,'created_at':_0x31c203[_0x42868a(0x20d)][_0x42868a(0x1d5)],'updated_at':_0x31c203[_0x42868a(0x20d)][_0x42868a(0x218)],'url':_0xff3a6d},_0x16695a),0x0;}}
@@ -1 +1 @@
1
- const a29_0x20675a=a29_0x38b1;(function(_0x3b5943,_0x583c6a){const _0x2b9e4d=a29_0x38b1,_0x151666=_0x3b5943();while(!![]){try{const _0xa13aa4=-parseInt(_0x2b9e4d(0x1ea))/0x1*(-parseInt(_0x2b9e4d(0x1d0))/0x2)+-parseInt(_0x2b9e4d(0x1cc))/0x3+-parseInt(_0x2b9e4d(0x1b7))/0x4+parseInt(_0x2b9e4d(0x1d5))/0x5*(-parseInt(_0x2b9e4d(0x1c8))/0x6)+parseInt(_0x2b9e4d(0x1c9))/0x7*(-parseInt(_0x2b9e4d(0x1e3))/0x8)+parseInt(_0x2b9e4d(0x1b2))/0x9+parseInt(_0x2b9e4d(0x1e1))/0xa;if(_0xa13aa4===_0x583c6a)break;else _0x151666['push'](_0x151666['shift']());}catch(_0x42f47e){_0x151666['push'](_0x151666['shift']());}}}(a29_0x5207,0x4b171));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 a29_0x512f6d from'chalk';function a29_0x38b1(_0x83d1a4,_0x51df41){_0x83d1a4=_0x83d1a4-0x1b1;const _0x5207a6=a29_0x5207();let _0x38b1a4=_0x5207a6[_0x83d1a4];return _0x38b1a4;}function a29_0x5207(){const _0x986fdc=['8011160NDxBFK','\x20journey(s)\x20with\x20errors,\x20','8192EUCUym','✔\x20All\x20','reason','warningCount','red','\x20valid','\x20warning(s)\x20found','3GBCOkB','\x20error(s)','2984850NRLgeM','filePath','verbose','green','helpText','1670392HrIpSB','Error:\x20','invalidCount','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','error','endsWith','\x20journey(s)\x20valid','relativePath','validCount','warnings','description','yellow','filter','log','parentSegment','\x20warning(s)','\x20segment\x20file(s)\x20skipped','44634sIblHt','3801eawbfo','file','errors','472047XffwgS','message','.yml','cwd','342716GLYlxD','skippedCount','targetDir','length','\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','140TKfYoA','\x20segment\x20file(s)\x20skipped)','Validation\x20failed:\x20','dim','Error:\x20Directory\x20not\x20found:\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','valid','No\x20journey\x20YAML\x20files\x20found\x20in\x20','cyan','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','journey:validate','.yaml'];a29_0x5207=function(){return _0x986fdc;};return a29_0x5207();}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{['name']=a29_0x20675a(0x1df);[a29_0x20675a(0x1c1)]='Validate\x20journey\x20YAML\x20files';async['execute'](_0x2c8509){const _0x363cb0=a29_0x20675a,{options:_0xdc1849,args:_0x4cff08}=_0x2c8509,_0x1afbee=_0xdc1849,_0x3c3aef=await resolveTarget({'arg':_0x4cff08[0x0],'contextParent':_0xdc1849[_0x363cb0(0x1c5)],'cwd':process[_0x363cb0(0x1cf)]()});if(!isSuccessfulResolution(_0x3c3aef))return _0x3c3aef['errorCode']==='no_parent'?(console[_0x363cb0(0x1bb)](a29_0x512f6d[_0x363cb0(0x1c2)](_0x363cb0(0x1da))),console['error']('Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console['error'](_0x363cb0(0x1d4)),console[_0x363cb0(0x1bb)](_0x363cb0(0x1de))):(console[_0x363cb0(0x1bb)](a29_0x512f6d[_0x363cb0(0x1e7)](_0x363cb0(0x1b8)+_0x3c3aef[_0x363cb0(0x1cd)]+'\x0a')),_0x3c3aef[_0x363cb0(0x1b6)]&&console[_0x363cb0(0x1bb)](a29_0x512f6d[_0x363cb0(0x1dd)](_0x3c3aef[_0x363cb0(0x1b6)]))),0x1;const _0x159dc6=_0x3c3aef[_0x363cb0(0x1d2)],_0x16fe76=_0x3c3aef['type']===_0x363cb0(0x1ca)?_0x3c3aef[_0x363cb0(0x1b3)]:undefined;if(!_0x16fe76&&!existsSync(_0x159dc6))return console[_0x363cb0(0x1bb)](a29_0x512f6d['red'](_0x363cb0(0x1d9)+_0x159dc6+'\x0a')),0x1;let _0x1ae597;if(_0x16fe76){if(!_0x16fe76[_0x363cb0(0x1bc)](_0x363cb0(0x1ce))&&!_0x16fe76['endsWith'](_0x363cb0(0x1e0)))return console[_0x363cb0(0x1bb)](a29_0x512f6d[_0x363cb0(0x1e7)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x16fe76+'\x0a')),0x1;_0x1ae597=[_0x16fe76];}else _0x1ae597=findYamlFiles(_0x159dc6);if(_0x1ae597[_0x363cb0(0x1d3)]===0x0)return console['error'](a29_0x512f6d[_0x363cb0(0x1e7)](_0x363cb0(0x1ba)+_0x159dc6+'\x0a')),0x1;const _0x3c9879=validateYamlFiles(_0x1ae597,_0x159dc6,{'filterType':'journey'}),_0x24b982=calculateSummary(_0x3c9879),_0xd6970a=_0x3c9879[_0x363cb0(0x1c3)](isValidationResult);if(_0xd6970a['length']===0x0)return console[_0x363cb0(0x1bb)](a29_0x512f6d['yellow'](_0x363cb0(0x1dc)+_0x159dc6+'\x0a')),_0x24b982[_0x363cb0(0x1d1)]>0x0&&console[_0x363cb0(0x1bb)](a29_0x512f6d[_0x363cb0(0x1d8)]('('+_0x24b982[_0x363cb0(0x1d1)]+_0x363cb0(0x1d6))),0x0;for(const _0x59afb8 of _0x3c9879){if(!isValidationResult(_0x59afb8)){_0x1afbee[_0x363cb0(0x1b4)]&&console[_0x363cb0(0x1c4)](a29_0x512f6d['dim']('-\x20'+_0x59afb8[_0x363cb0(0x1be)]+'\x20(skipped:\x20'+_0x59afb8[_0x363cb0(0x1e5)]+')'));continue;}const {relativePath:_0x2801f9,source:_0x4d4cb1,result:_0x36a227}=_0x59afb8;if(_0x36a227[_0x363cb0(0x1db)]&&_0x36a227[_0x363cb0(0x1c0)][_0x363cb0(0x1d3)]===0x0)_0x1afbee['verbose']&&console[_0x363cb0(0x1c4)](a29_0x512f6d[_0x363cb0(0x1b5)]('✔\x20'+_0x2801f9));else _0x36a227[_0x363cb0(0x1db)]?(console[_0x363cb0(0x1c4)](a29_0x512f6d[_0x363cb0(0x1c2)]('⚠\x20'+_0x2801f9+':\x20'+_0x36a227[_0x363cb0(0x1c0)][_0x363cb0(0x1d3)]+_0x363cb0(0x1c6))),console[_0x363cb0(0x1c4)](formatValidationResult(_0x36a227,_0x4d4cb1,_0x2801f9))):(console[_0x363cb0(0x1c4)](a29_0x512f6d['red']('✖\x20'+_0x2801f9+':\x20'+_0x36a227[_0x363cb0(0x1cb)][_0x363cb0(0x1d3)]+_0x363cb0(0x1b1))),console[_0x363cb0(0x1c4)](formatValidationResult(_0x36a227,_0x4d4cb1,_0x2801f9)));}return console[_0x363cb0(0x1c4)](''),_0x24b982['hasErrors']?(console[_0x363cb0(0x1c4)](a29_0x512f6d[_0x363cb0(0x1e7)](_0x363cb0(0x1d7)+_0x24b982[_0x363cb0(0x1b9)]+_0x363cb0(0x1e2)+_0x24b982[_0x363cb0(0x1bf)]+_0x363cb0(0x1e8))),_0x24b982[_0x363cb0(0x1e6)]>0x0&&console[_0x363cb0(0x1c4)](a29_0x512f6d[_0x363cb0(0x1c2)](_0x24b982[_0x363cb0(0x1e6)]+_0x363cb0(0x1e9))),_0x24b982[_0x363cb0(0x1d1)]>0x0&&console['log'](a29_0x512f6d['dim'](_0x24b982[_0x363cb0(0x1d1)]+_0x363cb0(0x1c7))),0x1):(console[_0x363cb0(0x1c4)](a29_0x512f6d[_0x363cb0(0x1b5)](_0x363cb0(0x1e4)+_0x24b982['validCount']+_0x363cb0(0x1bd))),_0x24b982['warningCount']>0x0&&console[_0x363cb0(0x1c4)](a29_0x512f6d['yellow'](_0x24b982['warningCount']+_0x363cb0(0x1e9))),_0x24b982[_0x363cb0(0x1d1)]>0x0&&console[_0x363cb0(0x1c4)](a29_0x512f6d['dim'](_0x24b982[_0x363cb0(0x1d1)]+_0x363cb0(0x1c7))),0x0);}}
1
+ const a29_0x22ec99=a29_0x35e1;(function(_0x24b7fd,_0xacd395){const _0x2418c2=a29_0x35e1,_0x5bb9ff=_0x24b7fd();while(!![]){try{const _0x5f25b7=-parseInt(_0x2418c2(0x1da))/0x1+parseInt(_0x2418c2(0x1df))/0x2+parseInt(_0x2418c2(0x1fd))/0x3+-parseInt(_0x2418c2(0x1e9))/0x4*(parseInt(_0x2418c2(0x1e5))/0x5)+parseInt(_0x2418c2(0x20d))/0x6*(-parseInt(_0x2418c2(0x1d6))/0x7)+parseInt(_0x2418c2(0x1ec))/0x8*(-parseInt(_0x2418c2(0x203))/0x9)+-parseInt(_0x2418c2(0x1f1))/0xa*(-parseInt(_0x2418c2(0x202))/0xb);if(_0x5f25b7===_0xacd395)break;else _0x5bb9ff['push'](_0x5bb9ff['shift']());}catch(_0x48f73e){_0x5bb9ff['push'](_0x5bb9ff['shift']());}}}(a29_0x4093,0xe44de));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a29_0x4093(){const _0x33d3b2=['22TYTdsi','5360778AWHEGm','reason','.yml','warnings','relativePath','Error:\x20','skippedCount','\x20warning(s)','filter','type','456yIqUSe','validCount','31339qWtvUn','filePath','targetDir','log','1735906hlxsVP','error','name','file','Validation\x20failed:\x20','2302728mPMiPs','yellow','\x20segment\x20file(s)\x20skipped','execute','journey:validate','helpText','20645nimPmY','endsWith','No\x20journey\x20YAML\x20files\x20found\x20in\x20','invalidCount','1124BeHKFO','verbose','cwd','24beSaIs','green','length','Error:\x20Directory\x20not\x20found:\x20','\x20error(s)','20076730GrdSvR','no_parent','hasErrors','\x20warning(s)\x20found','red','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','\x20valid','parentSegment','\x20(skipped:\x20','Validate\x20journey\x20YAML\x20files','valid','2375271DUvmGi','errors','warningCount','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','dim'];a29_0x4093=function(){return _0x33d3b2;};return a29_0x4093();}import a29_0x38579b from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a29_0x35e1(_0x13343d,_0x21b978){_0x13343d=_0x13343d-0x1d6;const _0x409306=a29_0x4093();let _0x35e131=_0x409306[_0x13343d];return _0x35e131;}export class JourneyValidateCommand extends BaseCommand{[a29_0x22ec99(0x1dc)]=a29_0x22ec99(0x1e3);['description']=a29_0x22ec99(0x1fb);async[a29_0x22ec99(0x1e2)](_0x226528){const _0x1c0a2c=a29_0x22ec99,{options:_0x511b75,args:_0x2d0b3d}=_0x226528,_0x2433ce=_0x511b75,_0x269805=await resolveTarget({'arg':_0x2d0b3d[0x0],'contextParent':_0x511b75[_0x1c0a2c(0x1f9)],'cwd':process[_0x1c0a2c(0x1eb)]()});if(!isSuccessfulResolution(_0x269805))return _0x269805['errorCode']===_0x1c0a2c(0x1f2)?(console[_0x1c0a2c(0x1db)](a29_0x38579b[_0x1c0a2c(0x1e0)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x1c0a2c(0x1db)](_0x1c0a2c(0x200)),console[_0x1c0a2c(0x1db)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console[_0x1c0a2c(0x1db)](_0x1c0a2c(0x1f7))):(console[_0x1c0a2c(0x1db)](a29_0x38579b[_0x1c0a2c(0x1f5)](_0x1c0a2c(0x208)+_0x269805['message']+'\x0a')),_0x269805[_0x1c0a2c(0x1e4)]&&console['error'](a29_0x38579b['cyan'](_0x269805[_0x1c0a2c(0x1e4)]))),0x1;const _0x55bd2d=_0x269805[_0x1c0a2c(0x1d8)],_0xe4eeae=_0x269805[_0x1c0a2c(0x20c)]===_0x1c0a2c(0x1dd)?_0x269805[_0x1c0a2c(0x1d7)]:undefined;if(!_0xe4eeae&&!existsSync(_0x55bd2d))return console[_0x1c0a2c(0x1db)](a29_0x38579b[_0x1c0a2c(0x1f5)](_0x1c0a2c(0x1ef)+_0x55bd2d+'\x0a')),0x1;let _0x3efab7;if(_0xe4eeae){if(!_0xe4eeae[_0x1c0a2c(0x1e6)](_0x1c0a2c(0x205))&&!_0xe4eeae[_0x1c0a2c(0x1e6)]('.yaml'))return console[_0x1c0a2c(0x1db)](a29_0x38579b[_0x1c0a2c(0x1f5)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0xe4eeae+'\x0a')),0x1;_0x3efab7=[_0xe4eeae];}else _0x3efab7=findYamlFiles(_0x55bd2d);if(_0x3efab7[_0x1c0a2c(0x1ee)]===0x0)return console[_0x1c0a2c(0x1db)](a29_0x38579b['red'](_0x1c0a2c(0x1f6)+_0x55bd2d+'\x0a')),0x1;const _0xdcdf97=validateYamlFiles(_0x3efab7,_0x55bd2d,{'filterType':'journey'}),_0xeac104=calculateSummary(_0xdcdf97),_0x56f6c0=_0xdcdf97[_0x1c0a2c(0x20b)](isValidationResult);if(_0x56f6c0[_0x1c0a2c(0x1ee)]===0x0)return console[_0x1c0a2c(0x1db)](a29_0x38579b[_0x1c0a2c(0x1e0)](_0x1c0a2c(0x1e7)+_0x55bd2d+'\x0a')),_0xeac104[_0x1c0a2c(0x209)]>0x0&&console[_0x1c0a2c(0x1db)](a29_0x38579b[_0x1c0a2c(0x201)]('('+_0xeac104[_0x1c0a2c(0x209)]+'\x20segment\x20file(s)\x20skipped)')),0x0;for(const _0x1aaa1e of _0xdcdf97){if(!isValidationResult(_0x1aaa1e)){_0x2433ce[_0x1c0a2c(0x1ea)]&&console[_0x1c0a2c(0x1d9)](a29_0x38579b[_0x1c0a2c(0x201)]('-\x20'+_0x1aaa1e[_0x1c0a2c(0x207)]+_0x1c0a2c(0x1fa)+_0x1aaa1e[_0x1c0a2c(0x204)]+')'));continue;}const {relativePath:_0xa2bbfa,source:_0x3912fa,result:_0x5912aa}=_0x1aaa1e;if(_0x5912aa['valid']&&_0x5912aa['warnings'][_0x1c0a2c(0x1ee)]===0x0)_0x2433ce[_0x1c0a2c(0x1ea)]&&console[_0x1c0a2c(0x1d9)](a29_0x38579b[_0x1c0a2c(0x1ed)]('✔\x20'+_0xa2bbfa));else _0x5912aa[_0x1c0a2c(0x1fc)]?(console['log'](a29_0x38579b['yellow']('⚠\x20'+_0xa2bbfa+':\x20'+_0x5912aa[_0x1c0a2c(0x206)][_0x1c0a2c(0x1ee)]+_0x1c0a2c(0x20a))),console['log'](formatValidationResult(_0x5912aa,_0x3912fa,_0xa2bbfa))):(console[_0x1c0a2c(0x1d9)](a29_0x38579b[_0x1c0a2c(0x1f5)]('✖\x20'+_0xa2bbfa+':\x20'+_0x5912aa[_0x1c0a2c(0x1fe)][_0x1c0a2c(0x1ee)]+_0x1c0a2c(0x1f0))),console[_0x1c0a2c(0x1d9)](formatValidationResult(_0x5912aa,_0x3912fa,_0xa2bbfa)));}return console['log'](''),_0xeac104[_0x1c0a2c(0x1f3)]?(console[_0x1c0a2c(0x1d9)](a29_0x38579b[_0x1c0a2c(0x1f5)](_0x1c0a2c(0x1de)+_0xeac104[_0x1c0a2c(0x1e8)]+'\x20journey(s)\x20with\x20errors,\x20'+_0xeac104[_0x1c0a2c(0x20e)]+_0x1c0a2c(0x1f8))),_0xeac104[_0x1c0a2c(0x1ff)]>0x0&&console['log'](a29_0x38579b[_0x1c0a2c(0x1e0)](_0xeac104[_0x1c0a2c(0x1ff)]+_0x1c0a2c(0x1f4))),_0xeac104[_0x1c0a2c(0x209)]>0x0&&console[_0x1c0a2c(0x1d9)](a29_0x38579b[_0x1c0a2c(0x201)](_0xeac104[_0x1c0a2c(0x209)]+_0x1c0a2c(0x1e1))),0x1):(console[_0x1c0a2c(0x1d9)](a29_0x38579b[_0x1c0a2c(0x1ed)]('✔\x20All\x20'+_0xeac104['validCount']+'\x20journey(s)\x20valid')),_0xeac104[_0x1c0a2c(0x1ff)]>0x0&&console['log'](a29_0x38579b['yellow'](_0xeac104[_0x1c0a2c(0x1ff)]+_0x1c0a2c(0x1f4))),_0xeac104[_0x1c0a2c(0x209)]>0x0&&console[_0x1c0a2c(0x1d9)](a29_0x38579b['dim'](_0xeac104[_0x1c0a2c(0x209)]+'\x20segment\x20file(s)\x20skipped')),0x0);}}