@treasuredata/tdx 0.20.2 → 0.22.0

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 (243) hide show
  1. package/README.md +4 -13
  2. package/dist/bin.js +1 -1
  3. package/dist/build-info.json +3 -3
  4. package/dist/cli-categories.js +1 -1
  5. package/dist/cli.d.ts.map +1 -1
  6. package/dist/cli.js +1 -1
  7. package/dist/cli.js.map +1 -1
  8. package/dist/commands/activations.js +1 -1
  9. package/dist/commands/agent-command.js +1 -1
  10. package/dist/commands/agent-test-command.js +1 -1
  11. package/dist/commands/api-command.js +1 -1
  12. package/dist/commands/auth-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.d.ts +0 -1
  15. package/dist/commands/claude-command.d.ts.map +1 -1
  16. package/dist/commands/claude-command.js +1 -1
  17. package/dist/commands/claude-command.js.map +1 -1
  18. package/dist/commands/claude-statusline-command.js +1 -1
  19. package/dist/commands/claude-usage-command.js +1 -1
  20. package/dist/commands/command.js +1 -1
  21. package/dist/commands/connection-command.js +1 -1
  22. package/dist/commands/databases.js +1 -1
  23. package/dist/commands/describe.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/job-command.js +1 -1
  26. package/dist/commands/journey-command.js +1 -1
  27. package/dist/commands/journey-validate-command.js +1 -1
  28. package/dist/commands/llm-command.js +1 -1
  29. package/dist/commands/mcp-command.js +1 -1
  30. package/dist/commands/parent-segment-command.js +1 -1
  31. package/dist/commands/profile-command.js +1 -1
  32. package/dist/commands/profile-command.js.map +1 -1
  33. package/dist/commands/profiles-command.js +1 -1
  34. package/dist/commands/query-command.js +1 -1
  35. package/dist/commands/schedule-command.js +1 -1
  36. package/dist/commands/segment-command.js +1 -1
  37. package/dist/commands/segment-create-command.js +1 -1
  38. package/dist/commands/segment-fields-command.js +1 -1
  39. package/dist/commands/segment-pull-command.js +1 -1
  40. package/dist/commands/segment-push-command.js +1 -1
  41. package/dist/commands/segment-update-command.js +1 -1
  42. package/dist/commands/segment-use-command.js +1 -1
  43. package/dist/commands/segment-validate-command.js +1 -1
  44. package/dist/commands/segments.js +1 -1
  45. package/dist/commands/show.js +1 -1
  46. package/dist/commands/status-command.js +1 -1
  47. package/dist/commands/tables.js +1 -1
  48. package/dist/commands/unset-command.js +1 -1
  49. package/dist/commands/unset-command.js.map +1 -1
  50. package/dist/commands/use-command.js +1 -1
  51. package/dist/commands/use-command.js.map +1 -1
  52. package/dist/commands/user-command.js +1 -1
  53. package/dist/commands/workflow-command.js +1 -1
  54. package/dist/core/auth.js +1 -1
  55. package/dist/core/command-output.js +1 -1
  56. package/dist/core/config.d.ts +13 -0
  57. package/dist/core/config.d.ts.map +1 -1
  58. package/dist/core/config.js +1 -1
  59. package/dist/core/config.js.map +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.d.ts +1 -0
  64. package/dist/core/global-context.d.ts.map +1 -1
  65. package/dist/core/global-context.js +1 -1
  66. package/dist/core/global-context.js.map +1 -1
  67. package/dist/core/keychain.js +1 -1
  68. package/dist/core/profile.d.ts +1 -1
  69. package/dist/core/profile.js +1 -1
  70. package/dist/core/project-config.js +1 -1
  71. package/dist/core/session.d.ts.map +1 -1
  72. package/dist/core/session.js +1 -1
  73. package/dist/core/session.js.map +1 -1
  74. package/dist/core/user-cache.js +1 -1
  75. package/dist/core/version.js +1 -1
  76. package/dist/index.js +1 -1
  77. package/dist/mcp/server.js +1 -1
  78. package/dist/mcp/tools/index.js +1 -1
  79. package/dist/mcp/tools/tdx-run.js +1 -1
  80. package/dist/mcp/tools/tdx-run.js.map +1 -1
  81. package/dist/mcp/tools/tdx-search.js +1 -1
  82. package/dist/mcp/utils.d.ts.map +1 -1
  83. package/dist/mcp/utils.js +1 -1
  84. package/dist/mcp/utils.js.map +1 -1
  85. package/dist/proxy/claude-usage-tracker.js +1 -1
  86. package/dist/proxy/passthrough-server.js +1 -1
  87. package/dist/proxy/sse-usage-parser.js +1 -1
  88. package/dist/sdk/agent/agent-config.js +1 -1
  89. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  90. package/dist/sdk/agent/agent-yaml.js +1 -1
  91. package/dist/sdk/agent/test/evaluator.js +1 -1
  92. package/dist/sdk/agent/test/executor.js +1 -1
  93. package/dist/sdk/agent/test/index.js +1 -1
  94. package/dist/sdk/agent/test/output.js +1 -1
  95. package/dist/sdk/agent/test/parser.js +1 -1
  96. package/dist/sdk/api.d.ts.map +1 -1
  97. package/dist/sdk/api.js +1 -1
  98. package/dist/sdk/api.js.map +1 -1
  99. package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
  100. package/dist/sdk/client/cdp-api-client.js +1 -1
  101. package/dist/sdk/client/cdp-api-client.js.map +1 -1
  102. package/dist/sdk/client/endpoints.js +1 -1
  103. package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
  104. package/dist/sdk/client/engage-api-client.js +1 -1
  105. package/dist/sdk/client/engage-api-client.js.map +1 -1
  106. package/dist/sdk/client/http-client.d.ts +45 -2
  107. package/dist/sdk/client/http-client.d.ts.map +1 -1
  108. package/dist/sdk/client/http-client.js +1 -1
  109. package/dist/sdk/client/http-client.js.map +1 -1
  110. package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
  111. package/dist/sdk/client/llm-api-client.js +1 -1
  112. package/dist/sdk/client/llm-api-client.js.map +1 -1
  113. package/dist/sdk/client/rate-limiter.js +1 -1
  114. package/dist/sdk/client/td-api-client.d.ts.map +1 -1
  115. package/dist/sdk/client/td-api-client.js +1 -1
  116. package/dist/sdk/client/td-api-client.js.map +1 -1
  117. package/dist/sdk/client/trino-api-client.d.ts.map +1 -1
  118. package/dist/sdk/client/trino-api-client.js +1 -1
  119. package/dist/sdk/client/trino-api-client.js.map +1 -1
  120. package/dist/sdk/client/workflow-client.d.ts.map +1 -1
  121. package/dist/sdk/client/workflow-client.js +1 -1
  122. package/dist/sdk/client/workflow-client.js.map +1 -1
  123. package/dist/sdk/connection-validator.js +1 -1
  124. package/dist/sdk/connection.js +1 -1
  125. package/dist/sdk/engage.js +1 -1
  126. package/dist/sdk/errors.d.ts +2 -0
  127. package/dist/sdk/errors.d.ts.map +1 -1
  128. package/dist/sdk/errors.js +1 -1
  129. package/dist/sdk/errors.js.map +1 -1
  130. package/dist/sdk/index.d.ts +18 -0
  131. package/dist/sdk/index.d.ts.map +1 -1
  132. package/dist/sdk/index.js +1 -1
  133. package/dist/sdk/index.js.map +1 -1
  134. package/dist/sdk/io/index.js +1 -1
  135. package/dist/sdk/io/node-filesystem.js +1 -1
  136. package/dist/sdk/job.js +1 -1
  137. package/dist/sdk/journey.js +1 -1
  138. package/dist/sdk/llm/chat-cache.js +1 -1
  139. package/dist/sdk/llm/index.js +1 -1
  140. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  141. package/dist/sdk/llm/model-factors.d.ts +4 -4
  142. package/dist/sdk/llm/model-factors.d.ts.map +1 -1
  143. package/dist/sdk/llm/model-factors.js +1 -1
  144. package/dist/sdk/llm/model-factors.js.map +1 -1
  145. package/dist/sdk/query/index.js +1 -1
  146. package/dist/sdk/query/sql-parser.js +1 -1
  147. package/dist/sdk/schedule.js +1 -1
  148. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  149. package/dist/sdk/segment/fields-display.js +1 -1
  150. package/dist/sdk/segment/file-discovery.js +1 -1
  151. package/dist/sdk/segment/journey-utils.js +1 -1
  152. package/dist/sdk/segment/journey-yaml.js +1 -1
  153. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  154. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  155. package/dist/sdk/segment/pull-workflow.js +1 -1
  156. package/dist/sdk/segment/push-workflow.js +1 -1
  157. package/dist/sdk/segment/resolution-context.js +1 -1
  158. package/dist/sdk/segment/segment-path-parser.js +1 -1
  159. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  160. package/dist/sdk/segment/target-resolution.js +1 -1
  161. package/dist/sdk/segment/tdx-config.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/user.js +1 -1
  168. package/dist/sdk/util/format-detector.js +1 -1
  169. package/dist/sdk/util/formatters.js +1 -1
  170. package/dist/sdk/util/index.js +1 -1
  171. package/dist/sdk/util/tree-formatter.js +1 -1
  172. package/dist/sdk/workflow/archive-validation.js +1 -1
  173. package/dist/sdk/workflow/clone-workflow.js +1 -1
  174. package/dist/sdk/workflow/index.js +1 -1
  175. package/dist/sdk/workflow/pull-workflow.js +1 -1
  176. package/dist/sdk/workflow/push-workflow.js +1 -1
  177. package/dist/sdk/workflow/tdx-config.js +1 -1
  178. package/dist/sdk/workflow/workflow-utils.js +1 -1
  179. package/dist/test-utils/command-runner.js +1 -1
  180. package/dist/test-utils/factories.js +1 -1
  181. package/dist/test-utils/fixtures.js +1 -1
  182. package/dist/test-utils/http-mock.js +1 -1
  183. package/dist/test-utils/index.js +1 -1
  184. package/dist/utils/async.js +1 -1
  185. package/dist/utils/colors.js +1 -1
  186. package/dist/utils/diff.js +1 -1
  187. package/dist/utils/file-permissions.js +1 -1
  188. package/dist/utils/global-cache.js +1 -1
  189. package/dist/utils/json-loader.js +1 -1
  190. package/dist/utils/local-cache.js +1 -1
  191. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  192. package/dist/utils/logger/formatters/index.js +1 -1
  193. package/dist/utils/logger/handlers/console-handler.js +1 -1
  194. package/dist/utils/logger/handlers/file-handler.js +1 -1
  195. package/dist/utils/logger/handlers/index.js +1 -1
  196. package/dist/utils/logger/handlers/null-handler.js +1 -1
  197. package/dist/utils/logger/index.js +1 -1
  198. package/dist/utils/logger/logger.js +1 -1
  199. package/dist/utils/logger/types.js +1 -1
  200. package/dist/utils/option-validation.js +1 -1
  201. package/dist/utils/port.js +1 -1
  202. package/dist/utils/process.js +1 -1
  203. package/dist/utils/process.js.map +1 -1
  204. package/dist/utils/prompt.js +1 -1
  205. package/dist/utils/spinner.js +1 -1
  206. package/dist/utils/sse-parser.js +1 -1
  207. package/dist/utils/string-utils.js +1 -1
  208. package/dist/utils/table-ref-parser.js +1 -1
  209. package/dist/utils/tdx-logger.js +1 -1
  210. package/dist/utils/version-check.js +1 -1
  211. package/package.json +3 -2
  212. package/dist/commands/llm-proxy.d.ts +0 -25
  213. package/dist/commands/llm-proxy.d.ts.map +0 -1
  214. package/dist/commands/llm-proxy.js +0 -1
  215. package/dist/commands/llm-proxy.js.map +0 -1
  216. package/dist/proxy/anthropic-adapter.d.ts +0 -125
  217. package/dist/proxy/anthropic-adapter.d.ts.map +0 -1
  218. package/dist/proxy/anthropic-adapter.js +0 -1
  219. package/dist/proxy/anthropic-adapter.js.map +0 -1
  220. package/dist/proxy/context-signature.d.ts +0 -17
  221. package/dist/proxy/context-signature.d.ts.map +0 -1
  222. package/dist/proxy/context-signature.js +0 -1
  223. package/dist/proxy/context-signature.js.map +0 -1
  224. package/dist/proxy/conversation-utils.d.ts +0 -48
  225. package/dist/proxy/conversation-utils.d.ts.map +0 -1
  226. package/dist/proxy/conversation-utils.js +0 -1
  227. package/dist/proxy/conversation-utils.js.map +0 -1
  228. package/dist/proxy/server.d.ts +0 -76
  229. package/dist/proxy/server.d.ts.map +0 -1
  230. package/dist/proxy/server.js +0 -1
  231. package/dist/proxy/server.js.map +0 -1
  232. package/dist/proxy/session-cache.d.ts +0 -74
  233. package/dist/proxy/session-cache.d.ts.map +0 -1
  234. package/dist/proxy/session-cache.js +0 -1
  235. package/dist/proxy/session-cache.js.map +0 -1
  236. package/dist/sdk/llm/model-aliases.d.ts +0 -40
  237. package/dist/sdk/llm/model-aliases.d.ts.map +0 -1
  238. package/dist/sdk/llm/model-aliases.js +0 -1
  239. package/dist/sdk/llm/model-aliases.js.map +0 -1
  240. package/dist/sdk/types/anthropic.d.ts +0 -148
  241. package/dist/sdk/types/anthropic.d.ts.map +0 -1
  242. package/dist/sdk/types/anthropic.js +0 -1
  243. package/dist/sdk/types/anthropic.js.map +0 -1
@@ -1 +1 @@
1
- const a16_0x2fcde2=a16_0x5ed7;(function(_0x505654,_0x53eeda){const _0x2efaff=a16_0x5ed7,_0xd3663b=_0x505654();while(!![]){try{const _0x1c1ee8=parseInt(_0x2efaff(0x109))/0x1*(parseInt(_0x2efaff(0x133))/0x2)+-parseInt(_0x2efaff(0x12e))/0x3*(-parseInt(_0x2efaff(0x125))/0x4)+parseInt(_0x2efaff(0x10d))/0x5*(parseInt(_0x2efaff(0xfe))/0x6)+-parseInt(_0x2efaff(0x157))/0x7*(-parseInt(_0x2efaff(0x140))/0x8)+-parseInt(_0x2efaff(0xff))/0x9+-parseInt(_0x2efaff(0x15a))/0xa+-parseInt(_0x2efaff(0x16a))/0xb;if(_0x1c1ee8===_0x53eeda)break;else _0xd3663b['push'](_0xd3663b['shift']());}catch(_0xdef616){_0xd3663b['push'](_0xd3663b['shift']());}}}(a16_0x594b,0x52a4b));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';function a16_0x594b(){const _0x2cd2ec=['listCampaigns','Create\x20an\x20email\x20template','\x27\x20deleted\x20successfully','1721200BZFhNy','segment','createWorkspace','session','engage:campaign:create','filter','deleteWorkspace','Set\x20workspace\x20context\x20for\x20Engage\x20commands','Update\x20a\x20campaign','Duplicate\x20a\x20campaign','engage:campaign:update','Updating\x20workspace\x20\x27','Duplicating\x20campaign\x20\x27','engage:workspace:update','entries','updateCampaign','engage:workspace:delete','Fetching\x20templates...','Deleting\x20campaign\x20\x27','engage_workspace','listTemplates','workspace','Error:\x20--subject\x20is\x20required','14TjITgG','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','engage:campaign:resume','471180VbVrrQ','Pause\x20a\x20campaign','\x27\x20resumed\x20successfully','getTemplateFull','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','description','createCampaign','log','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','engage:workspace:show','deleteTemplate','Fetching\x20template\x20\x27','engage:workspaces','data','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','11019833pUkmfM','Operation\x20cancelled','Error:\x20--html\x20is\x20required','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','Show\x20campaign\x20details','Resuming\x20campaign\x20\x27','editorType','Fetching\x20campaign\x20\x27','segmentId','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','engage:template:show','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','Resume\x20a\x20paused\x20campaign','getWorkspace','Create\x20a\x20new\x20campaign','parentName','listWorkspaces','updateWorkspace','resolvePathToResource','\x27...','execute','MISSING_ARGUMENT','Create\x20a\x20workspace','getTemplate','duplicateCampaign','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','keys','engage:templates','Error:\x20Workspace\x20name\x20is\x20required','Update\x20a\x20workspace','Deleting\x20workspace\x20\x27','plaintext','launchCampaign','deleteCampaign','3968346jfPvwR','5543694ijvOAX','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','emailSenderId','updateTemplate','Creating\x20campaign\x20\x27','pauseCampaign','full','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','html','4871xvQbCS','startAt','Verifying\x20workspace\x20\x27','Fetching\x20campaigns...','5DPnoXr','\x27\x20paused\x20successfully','resolveWorkspaceId','getWorkspaceFull','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','engage:campaign:pause','yes','error','type','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','Creating\x20template\x20\x27','jsonColumns','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','limit','engage:workspace:use','engage:template:delete','getCampaign','Delete\x20a\x20workspace','Launch\x20a\x20campaign','Campaign\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Options:\x20--name,\x20--description','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','15828dHubfe','name','Workspace\x20is\x20required\x20for\x20this\x20operation','Fetching\x20workspace\x20\x27','Delete\x20an\x20email\x20template','verbose','Update\x20an\x20email\x20template','timezone','\x27?\x20This\x20cannot\x20be\x20undone.','381hCtvVc','Show\x20workspace\x20details','engage','engage:campaign:duplicate','resumeCampaign','168ZWracz','Error:\x20--name\x20is\x20required','segmentName','length','engage:template:update','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','engage:campaigns','status','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','subject'];a16_0x594b=function(){return _0x2cd2ec;};return a16_0x594b();}import{loadSessionContext,saveSessionContext}from'../core/session.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';async function resolveWorkspaceIdFromOptions(_0x5b4ca0,_0x1d8251,_0x410892=![]){const _0x26bf05=a16_0x5ed7;if(_0x5b4ca0[_0x26bf05(0x155)])return await _0x1d8251[_0x26bf05(0x130)][_0x26bf05(0x10f)](_0x5b4ca0[_0x26bf05(0x155)]);const _0x47f186=loadSessionContext(_0x5b4ca0[_0x26bf05(0x143)]);if(_0x47f186?.[_0x26bf05(0x153)])return await _0x1d8251[_0x26bf05(0x130)][_0x26bf05(0x10f)](_0x47f186[_0x26bf05(0x153)]);if(_0x410892)throw new SDKError(ErrorCode[_0x26bf05(0xf1)],_0x26bf05(0x127),undefined,{'helpText':_0x26bf05(0x124)});return undefined;}async function resolveSegmentFromOptions(_0x3e74bb,_0x572a51){const _0x5b542e=a16_0x5ed7;if(!_0x3e74bb['segment'])return{};const _0x371f2a=_0x3e74bb[_0x5b542e(0x141)],_0x1f1e4a=await _0x572a51[_0x5b542e(0x141)][_0x5b542e(0xee)](_0x371f2a);return{'audienceId':_0x1f1e4a['parentId'],'audienceName':_0x1f1e4a[_0x5b542e(0xeb)],..._0x1f1e4a[_0x5b542e(0x172)]&&{'segmentId':_0x1f1e4a[_0x5b542e(0x172)],'segmentName':_0x1f1e4a[_0x5b542e(0x135)]}};}function buildConnectorConfig(_0x15023a){const _0x28c806=a16_0x5ed7,_0x5c8b72=_0x15023a[_0x28c806(0x101)],_0x5454d4=_0x15023a[_0x28c806(0x119)];if(!_0x5c8b72&&!_0x5454d4)return undefined;return{..._0x5c8b72&&{'emailSenderId':_0x5c8b72},..._0x5454d4&&{'jsonColumns':_0x5454d4}};}export class EngageCampaignsCommand extends BaseCommand{[a16_0x2fcde2(0x126)]=a16_0x2fcde2(0x139);[a16_0x2fcde2(0x15f)]='List\x20campaigns';async['execute'](_0xb11978){const _0x187a1e=a16_0x2fcde2,{options:_0x24dc8a,args:_0x29191d,tdx:_0x1aec22}=_0xb11978,_0x468036=_0x29191d[0x0],_0x1d1307=resolveLimit(_0x24dc8a[_0x187a1e(0x11b)],DEFAULT_LLM_LIMIT),_0x55c875=_0x24dc8a,_0x380381=_0x55c875['type'],_0x4c23c5=_0x55c875[_0x187a1e(0x13a)],_0x2fb5d2=await resolveWorkspaceIdFromOptions(_0x55c875,_0x1aec22),_0x2b10be=await withSpinner(_0x187a1e(0x10c),()=>_0x1aec22[_0x187a1e(0x130)][_0x187a1e(0x13d)]({'type':_0x380381,'status':_0x4c23c5,'workspaceId':_0x2fb5d2,'limit':_0x1d1307}),{'verbose':_0x24dc8a[_0x187a1e(0x12a)]});let _0x5e0f54=_0x2b10be['data'];return _0x468036&&(_0x5e0f54=_0x2b10be[_0x187a1e(0x168)][_0x187a1e(0x145)](_0x22af29=>matchGlobPattern(_0x22af29[_0x187a1e(0x126)],_0x468036))),await handleSDKOutput(_0x5e0f54,_0x24dc8a),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a16_0x2fcde2(0x126)]='engage:campaign:show';['description']=a16_0x2fcde2(0x16e);async[a16_0x2fcde2(0xf0)](_0x2e541b){const _0xd33c10=a16_0x2fcde2,{options:_0x4cd465,args:_0x3d92a7,tdx:_0x57147b}=_0x2e541b;if(_0x3d92a7[_0xd33c10(0x136)]===0x0)return console[_0xd33c10(0x114)](_0xd33c10(0x163)),console[_0xd33c10(0x114)]('Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>'),0x1;const _0x5018a9=_0x3d92a7[0x0],_0xced9dd=_0x4cd465,_0x57e5b7=await resolveWorkspaceIdFromOptions(_0xced9dd,_0x57147b),_0x46252e=_0xced9dd['full'];if(_0x46252e){const _0x51515d=await withSpinner(_0xd33c10(0x171)+_0x5018a9+_0xd33c10(0xef),()=>_0x57147b[_0xd33c10(0x130)]['getCampaignFull'](_0x5018a9,_0x57e5b7),{'verbose':_0x4cd465[_0xd33c10(0x12a)]});await handleSDKOutput([_0x51515d],_0x4cd465);}else{const _0x3b8fca=await withSpinner('Fetching\x20campaign\x20\x27'+_0x5018a9+_0xd33c10(0xef),()=>_0x57147b['engage'][_0xd33c10(0x11e)](_0x5018a9,_0x57e5b7),{'verbose':_0x4cd465[_0xd33c10(0x12a)]});await handleSDKOutput([_0x3b8fca],_0x4cd465);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{['name']=a16_0x2fcde2(0x144);[a16_0x2fcde2(0x15f)]=a16_0x2fcde2(0xea);async[a16_0x2fcde2(0xf0)](_0x4cacad){const _0x4f5cf2=a16_0x2fcde2,{options:_0x5cc9b6,tdx:_0x4074bf}=_0x4cacad,_0x1572dc=_0x5cc9b6,_0x4ca2cd=_0x1572dc['name'],_0x3df5f8=_0x1572dc[_0x4f5cf2(0x115)];if(!_0x4ca2cd)return console[_0x4f5cf2(0x114)]('Error:\x20--name\x20is\x20required'),console[_0x4f5cf2(0x114)](_0x4f5cf2(0x16d)),0x1;if(!_0x3df5f8)return console[_0x4f5cf2(0x114)](_0x4f5cf2(0x138)),console[_0x4f5cf2(0x114)](_0x4f5cf2(0x16d)),0x1;const _0x50f449=await resolveWorkspaceIdFromOptions(_0x1572dc,_0x4074bf,!![]),_0x2f6268=await resolveSegmentFromOptions(_0x1572dc,_0x4074bf),_0xbbf7ae=buildConnectorConfig(_0x1572dc),_0x1737a0={'name':_0x4ca2cd,'campaignType':_0x3df5f8,'workspaceId':_0x50f449,'description':_0x1572dc['description'],..._0x2f6268,'connectorConfig':_0xbbf7ae,'startAt':_0x1572dc['startAt'],'timezone':_0x1572dc[_0x4f5cf2(0x12c)]},_0x7865c9=await withSpinner(_0x4f5cf2(0x103)+_0x4ca2cd+'\x27...',()=>_0x4074bf[_0x4f5cf2(0x130)][_0x4f5cf2(0x160)](_0x1737a0));return await handleSDKOutput([_0x7865c9[_0x4f5cf2(0x168)]],_0x5cc9b6),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a16_0x2fcde2(0x126)]=a16_0x2fcde2(0x14a);['description']=a16_0x2fcde2(0x148);async[a16_0x2fcde2(0xf0)](_0x56caca){const _0x2decba=a16_0x2fcde2,{options:_0x3842a4,args:_0x56eba8,tdx:_0x191d48}=_0x56caca;if(_0x56eba8['length']===0x0)return console[_0x2decba(0x114)](_0x2decba(0x163)),console[_0x2decba(0x114)](_0x2decba(0x100)),0x1;const _0x53a3e6=_0x56eba8[0x0],_0x28fa07=_0x3842a4,_0x462276=await resolveWorkspaceIdFromOptions(_0x28fa07,_0x191d48),_0x4a40dc=await resolveSegmentFromOptions(_0x28fa07,_0x191d48),_0x595125=buildConnectorConfig(_0x28fa07),_0x570f3e={'name':_0x28fa07[_0x2decba(0x126)],'description':_0x28fa07[_0x2decba(0x15f)],..._0x4a40dc,'connectorConfig':_0x595125,'startAt':_0x28fa07[_0x2decba(0x10a)],'timezone':_0x28fa07[_0x2decba(0x12c)]},_0x1003ac=Object['fromEntries'](Object[_0x2decba(0x14e)](_0x570f3e)[_0x2decba(0x145)](([,_0x4ec350])=>_0x4ec350!==undefined));if(Object[_0x2decba(0xf6)](_0x1003ac)[_0x2decba(0x136)]===0x0)return console[_0x2decba(0x114)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x2decba(0x114)]('Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone'),0x1;const _0x5db608=await withSpinner('Updating\x20campaign\x20\x27'+_0x53a3e6+'\x27...',()=>_0x191d48['engage'][_0x2decba(0x14f)](_0x53a3e6,_0x1003ac,_0x462276),{'verbose':_0x3842a4[_0x2decba(0x12a)]});return await handleSDKOutput([_0x5db608[_0x2decba(0x168)]],_0x3842a4),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{['name']='engage:campaign:delete';['description']='Delete\x20a\x20campaign';async['execute'](_0x5449b2){const _0x208823=a16_0x2fcde2,{options:_0x359967,args:_0x45add5,tdx:_0x297199}=_0x5449b2;if(_0x45add5[_0x208823(0x136)]===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x208823(0x175)),0x1;const _0x5cc46=_0x45add5[0x0],_0x370a64=_0x359967,_0x401546=await resolveWorkspaceIdFromOptions(_0x370a64,_0x297199);if(!_0x359967[_0x208823(0x113)]){const _0x5e0cd7=await confirm(_0x208823(0xf5)+_0x5cc46+_0x208823(0x12d));if(!_0x5e0cd7)return console[_0x208823(0x161)](_0x208823(0x16b)),0x0;}return await withSpinner(_0x208823(0x152)+_0x5cc46+'\x27...',()=>_0x297199['engage'][_0x208823(0xfd)](_0x5cc46,_0x401546),{'verbose':_0x359967['verbose']}),console[_0x208823(0x161)](_0x208823(0x121)+_0x5cc46+_0x208823(0x13f)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a16_0x2fcde2(0x126)]='engage:campaign:launch';[a16_0x2fcde2(0x15f)]=a16_0x2fcde2(0x120);async[a16_0x2fcde2(0xf0)](_0x588fce){const _0x1f79c9=a16_0x2fcde2,{options:_0x4aeffb,args:_0x22fb65,tdx:_0x291ed6}=_0x588fce;if(_0x22fb65[_0x1f79c9(0x136)]===0x0)return console[_0x1f79c9(0x114)](_0x1f79c9(0x163)),console[_0x1f79c9(0x114)](_0x1f79c9(0x176)),0x1;const _0xa2beea=_0x22fb65[0x0],_0x4f7131=_0x4aeffb,_0x2dfc75=await resolveWorkspaceIdFromOptions(_0x4f7131,_0x291ed6);return await withSpinner('Launching\x20campaign\x20\x27'+_0xa2beea+_0x1f79c9(0xef),()=>_0x291ed6[_0x1f79c9(0x130)][_0x1f79c9(0xfc)](_0xa2beea,_0x2dfc75),{'verbose':_0x4aeffb[_0x1f79c9(0x12a)]}),console['log'](_0x1f79c9(0x121)+_0xa2beea+'\x27\x20launched\x20successfully'),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a16_0x2fcde2(0x126)]=a16_0x2fcde2(0x112);[a16_0x2fcde2(0x15f)]=a16_0x2fcde2(0x15b);async['execute'](_0x2d8d74){const _0x3b6271=a16_0x2fcde2,{options:_0x1b3888,args:_0x14dbe0,tdx:_0x248f2c}=_0x2d8d74;if(_0x14dbe0[_0x3b6271(0x136)]===0x0)return console[_0x3b6271(0x114)](_0x3b6271(0x163)),console[_0x3b6271(0x114)]('Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>'),0x1;const _0xcafeb=_0x14dbe0[0x0],_0x59f16d=_0x1b3888,_0xe6eccd=await resolveWorkspaceIdFromOptions(_0x59f16d,_0x248f2c);return await withSpinner('Pausing\x20campaign\x20\x27'+_0xcafeb+_0x3b6271(0xef),()=>_0x248f2c[_0x3b6271(0x130)][_0x3b6271(0x104)](_0xcafeb,_0xe6eccd),{'verbose':_0x1b3888[_0x3b6271(0x12a)]}),console['log'](_0x3b6271(0x121)+_0xcafeb+_0x3b6271(0x10e)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a16_0x2fcde2(0x126)]=a16_0x2fcde2(0x159);[a16_0x2fcde2(0x15f)]=a16_0x2fcde2(0x177);async['execute'](_0x1d46a1){const _0x3a0e98=a16_0x2fcde2,{options:_0x3895e9,args:_0x4cfba1,tdx:_0x4a3f7e}=_0x1d46a1;if(_0x4cfba1[_0x3a0e98(0x136)]===0x0)return console['error'](_0x3a0e98(0x163)),console[_0x3a0e98(0x114)]('Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>'),0x1;const _0x458d5f=_0x4cfba1[0x0],_0x434665=_0x3895e9,_0x32bc16=await resolveWorkspaceIdFromOptions(_0x434665,_0x4a3f7e);return await withSpinner(_0x3a0e98(0x16f)+_0x458d5f+_0x3a0e98(0xef),()=>_0x4a3f7e[_0x3a0e98(0x130)][_0x3a0e98(0x132)](_0x458d5f,_0x32bc16),{'verbose':_0x3895e9[_0x3a0e98(0x12a)]}),console['log']('Campaign\x20\x27'+_0x458d5f+_0x3a0e98(0x15c)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a16_0x2fcde2(0x126)]=a16_0x2fcde2(0x131);[a16_0x2fcde2(0x15f)]=a16_0x2fcde2(0x149);async[a16_0x2fcde2(0xf0)](_0x390804){const _0x4c1902=a16_0x2fcde2,{options:_0xfd2872,args:_0x4f5d1e,tdx:_0x59f99c}=_0x390804;if(_0x4f5d1e[_0x4c1902(0x136)]===0x0)return console[_0x4c1902(0x114)](_0x4c1902(0x163)),console[_0x4c1902(0x114)](_0x4c1902(0x106)),0x1;const _0x1908fd=_0x4f5d1e[0x0],_0x1ac9b5=_0xfd2872,_0x1b151a=await resolveWorkspaceIdFromOptions(_0x1ac9b5,_0x59f99c),_0x44dd76=await withSpinner(_0x4c1902(0x14c)+_0x1908fd+_0x4c1902(0xef),()=>_0x59f99c[_0x4c1902(0x130)][_0x4c1902(0xf4)](_0x1908fd,_0x1b151a),{'verbose':_0xfd2872['verbose']});return await handleSDKOutput([_0x44dd76[_0x4c1902(0x168)]],_0xfd2872),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a16_0x2fcde2(0x126)]=a16_0x2fcde2(0xf7);[a16_0x2fcde2(0x15f)]='List\x20email\x20templates';async[a16_0x2fcde2(0xf0)](_0x47ebf9){const _0x157cfa=a16_0x2fcde2,{options:_0xb7439,args:_0x11ec0c,tdx:_0x3ca592}=_0x47ebf9,_0x3b4245=_0x11ec0c[0x0],_0x342296=resolveLimit(_0xb7439['limit'],DEFAULT_LLM_LIMIT),_0x2dc574=_0xb7439,_0x4ae512=await resolveWorkspaceIdFromOptions(_0x2dc574,_0x3ca592),_0xcfb3c4=await withSpinner(_0x157cfa(0x151),()=>_0x3ca592['engage'][_0x157cfa(0x154)]({'workspaceId':_0x4ae512,'limit':_0x342296}),{'verbose':_0xb7439[_0x157cfa(0x12a)]});let _0x9be05=_0xcfb3c4['data'];return _0x3b4245&&(_0x9be05=_0xcfb3c4['data']['filter'](_0x2b304f=>matchGlobPattern(_0x2b304f['name'],_0x3b4245))),await handleSDKOutput(_0x9be05,_0xb7439),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a16_0x2fcde2(0x126)]=a16_0x2fcde2(0x174);[a16_0x2fcde2(0x15f)]='Show\x20email\x20template\x20details';async['execute'](_0x4da607){const _0x295d01=a16_0x2fcde2,{options:_0x4e9b8d,args:_0x1b5900,tdx:_0x4d8f06}=_0x4da607;if(_0x1b5900['length']===0x0)return console[_0x295d01(0x114)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x295d01(0x117)),0x1;const _0x18a67a=_0x1b5900[0x0],_0x38d29=_0x4e9b8d,_0x30d9b3=await resolveWorkspaceIdFromOptions(_0x38d29,_0x4d8f06),_0x3a94f9=_0x38d29[_0x295d01(0x105)];if(_0x3a94f9){const _0x4ca975=await withSpinner('Fetching\x20template\x20\x27'+_0x18a67a+'\x27...',()=>_0x4d8f06[_0x295d01(0x130)][_0x295d01(0x15d)](_0x18a67a,_0x30d9b3),{'verbose':_0x4e9b8d['verbose']});await handleSDKOutput([_0x4ca975],_0x4e9b8d);}else{const _0x5363af=await withSpinner(_0x295d01(0x166)+_0x18a67a+_0x295d01(0xef),()=>_0x4d8f06[_0x295d01(0x130)][_0x295d01(0xf3)](_0x18a67a,_0x30d9b3),{'verbose':_0x4e9b8d['verbose']});await handleSDKOutput([_0x5363af],_0x4e9b8d);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{['name']='engage:template:create';[a16_0x2fcde2(0x15f)]=a16_0x2fcde2(0x13e);async[a16_0x2fcde2(0xf0)](_0xf76c86){const _0x2b57e0=a16_0x2fcde2,{options:_0x47aacf,tdx:_0x3fe628}=_0xf76c86,_0x30955f=_0x47aacf,_0x40a98b=_0x30955f['name'],_0x3cd7d1=_0x30955f[_0x2b57e0(0x13c)],_0x1d92a2=_0x30955f[_0x2b57e0(0x108)];if(!_0x40a98b)return console['error'](_0x2b57e0(0x134)),console['error']('Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>'),0x1;if(!_0x3cd7d1)return console['error'](_0x2b57e0(0x156)),0x1;if(!_0x1d92a2)return console[_0x2b57e0(0x114)](_0x2b57e0(0x16c)),0x1;const _0x3acf86=await resolveWorkspaceIdFromOptions(_0x30955f,_0x3fe628,!![]),_0x582a74={'name':_0x40a98b,'subjectTemplate':_0x3cd7d1,'htmlTemplate':_0x1d92a2,'workspaceId':_0x3acf86,'plaintextTemplate':_0x30955f[_0x2b57e0(0xfb)],'editorType':_0x30955f[_0x2b57e0(0x170)]},_0x1da347=await withSpinner(_0x2b57e0(0x118)+_0x40a98b+_0x2b57e0(0xef),()=>_0x3fe628[_0x2b57e0(0x130)]['createTemplate'](_0x582a74));return await handleSDKOutput([_0x1da347[_0x2b57e0(0x168)]],_0x47aacf),0x0;}}function a16_0x5ed7(_0x3cc830,_0x1675b0){_0x3cc830=_0x3cc830-0xe9;const _0x594bf4=a16_0x594b();let _0x5ed761=_0x594bf4[_0x3cc830];return _0x5ed761;}export class EngageTemplateUpdateCommand extends BaseCommand{[a16_0x2fcde2(0x126)]=a16_0x2fcde2(0x137);['description']=a16_0x2fcde2(0x12b);async[a16_0x2fcde2(0xf0)](_0x30e437){const _0x28c92c=a16_0x2fcde2,{options:_0x146b97,args:_0x29109d,tdx:_0x1acd0a}=_0x30e437;if(_0x29109d[_0x28c92c(0x136)]===0x0)return console[_0x28c92c(0x114)](_0x28c92c(0x107)),console['error']('Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x5ec80e=_0x29109d[0x0],_0x1450ec=_0x146b97,_0x4ba611=await resolveWorkspaceIdFromOptions(_0x1450ec,_0x1acd0a),_0x2d74cf={'name':_0x1450ec['name'],'subjectTemplate':_0x1450ec[_0x28c92c(0x13c)],'htmlTemplate':_0x1450ec['html'],'plaintextTemplate':_0x1450ec['plaintext']},_0x2aae05=Object['fromEntries'](Object[_0x28c92c(0x14e)](_0x2d74cf)[_0x28c92c(0x145)](([,_0x420b53])=>_0x420b53!==undefined));if(Object[_0x28c92c(0xf6)](_0x2aae05)['length']===0x0)return console[_0x28c92c(0x114)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console['error'](_0x28c92c(0x111)),0x1;const _0x8f5d96=await withSpinner('Updating\x20template\x20\x27'+_0x5ec80e+'\x27...',()=>_0x1acd0a[_0x28c92c(0x130)][_0x28c92c(0x102)](_0x5ec80e,_0x2aae05,_0x4ba611),{'verbose':_0x146b97[_0x28c92c(0x12a)]});return await handleSDKOutput([_0x8f5d96[_0x28c92c(0x168)]],_0x146b97),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a16_0x2fcde2(0x126)]=a16_0x2fcde2(0x11d);[a16_0x2fcde2(0x15f)]=a16_0x2fcde2(0x129);async['execute'](_0x4cd6fe){const _0x44d520=a16_0x2fcde2,{options:_0x62b417,args:_0xd179e5,tdx:_0x228502}=_0x4cd6fe;if(_0xd179e5['length']===0x0)return console['error'](_0x44d520(0x107)),console[_0x44d520(0x114)](_0x44d520(0x15e)),0x1;const _0x180806=_0xd179e5[0x0],_0x4c80a8=_0x62b417,_0x5184b4=await resolveWorkspaceIdFromOptions(_0x4c80a8,_0x228502);if(!_0x62b417[_0x44d520(0x113)]){const _0x18b71d=await confirm(_0x44d520(0x169)+_0x180806+_0x44d520(0x12d));if(!_0x18b71d)return console[_0x44d520(0x161)]('Operation\x20cancelled'),0x0;}return await withSpinner('Deleting\x20template\x20\x27'+_0x180806+'\x27...',()=>_0x228502[_0x44d520(0x130)][_0x44d520(0x165)](_0x180806,_0x5184b4),{'verbose':_0x62b417[_0x44d520(0x12a)]}),console[_0x44d520(0x161)]('Template\x20\x27'+_0x180806+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a16_0x2fcde2(0x126)]=a16_0x2fcde2(0x167);[a16_0x2fcde2(0x15f)]='List\x20workspaces';async[a16_0x2fcde2(0xf0)](_0x1cf6fa){const _0x30236d=a16_0x2fcde2,{options:_0x34f5d0,args:_0x1d0154,tdx:_0x16da02}=_0x1cf6fa,_0x48e3a0=_0x1d0154[0x0],_0xb2a55e=resolveLimit(_0x34f5d0['limit'],DEFAULT_LLM_LIMIT),_0x1ade19=await withSpinner('Fetching\x20workspaces...',()=>_0x16da02['engage'][_0x30236d(0xec)]({'limit':_0xb2a55e}),{'verbose':_0x34f5d0[_0x30236d(0x12a)]});let _0x44eccb=_0x1ade19['data'];return _0x48e3a0&&(_0x44eccb=_0x1ade19['data'][_0x30236d(0x145)](_0x595910=>matchGlobPattern(_0x595910['name'],_0x48e3a0))),await handleSDKOutput(_0x44eccb,_0x34f5d0),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a16_0x2fcde2(0x126)]=a16_0x2fcde2(0x164);[a16_0x2fcde2(0x15f)]=a16_0x2fcde2(0x12f);async['execute'](_0x28c08e){const _0xb7fe25=a16_0x2fcde2,{options:_0x5e3062,args:_0x702350,tdx:_0x393b0b}=_0x28c08e;if(_0x702350[_0xb7fe25(0x136)]===0x0)return console[_0xb7fe25(0x114)](_0xb7fe25(0x158)),console[_0xb7fe25(0x114)](_0xb7fe25(0x13b)),0x1;const _0x5c228c=_0x702350[0x0],_0x1af027=_0x5e3062,_0x502b91=_0x1af027[_0xb7fe25(0x105)];if(_0x502b91){const _0x4de30a=await withSpinner('Fetching\x20workspace\x20\x27'+_0x5c228c+'\x27...',()=>_0x393b0b[_0xb7fe25(0x130)][_0xb7fe25(0x110)](_0x5c228c),{'verbose':_0x5e3062['verbose']});await handleSDKOutput([_0x4de30a],_0x5e3062);}else{const _0x34760c=await withSpinner(_0xb7fe25(0x128)+_0x5c228c+_0xb7fe25(0xef),()=>_0x393b0b[_0xb7fe25(0x130)][_0xb7fe25(0xe9)](_0x5c228c),{'verbose':_0x5e3062[_0xb7fe25(0x12a)]});await handleSDKOutput([_0x34760c],_0x5e3062);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a16_0x2fcde2(0x126)]='engage:workspace:create';[a16_0x2fcde2(0x15f)]=a16_0x2fcde2(0xf2);async['execute'](_0x1a17e1){const _0x3ae5c8=a16_0x2fcde2,{options:_0x95c137,tdx:_0x8cad55}=_0x1a17e1,_0x3c4636=_0x95c137,_0x13e851=_0x3c4636['name'];if(!_0x13e851)return console[_0x3ae5c8(0x114)](_0x3ae5c8(0x134)),console[_0x3ae5c8(0x114)](_0x3ae5c8(0x11a)),0x1;const _0x1a3a01={'name':_0x13e851,'description':_0x3c4636[_0x3ae5c8(0x15f)]},_0x24342b=await withSpinner('Creating\x20workspace\x20\x27'+_0x13e851+_0x3ae5c8(0xef),()=>_0x8cad55[_0x3ae5c8(0x130)][_0x3ae5c8(0x142)](_0x1a3a01));return await handleSDKOutput([_0x24342b['data']],_0x95c137),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{['name']=a16_0x2fcde2(0x14d);[a16_0x2fcde2(0x15f)]=a16_0x2fcde2(0xf9);async[a16_0x2fcde2(0xf0)](_0x37649a){const _0xd9b61c=a16_0x2fcde2,{options:_0xb477f2,args:_0x42b464,tdx:_0x48241a}=_0x37649a;if(_0x42b464[_0xd9b61c(0x136)]===0x0)return console[_0xd9b61c(0x114)](_0xd9b61c(0x158)),console[_0xd9b61c(0x114)](_0xd9b61c(0x122)),0x1;const _0x30177d=_0x42b464[0x0],_0x5775b9=_0xb477f2,_0x4e5699={'name':_0x5775b9['name'],'description':_0x5775b9[_0xd9b61c(0x15f)]},_0x5e36f0=Object['fromEntries'](Object[_0xd9b61c(0x14e)](_0x4e5699)[_0xd9b61c(0x145)](([,_0x5c0855])=>_0x5c0855!==undefined));if(Object[_0xd9b61c(0xf6)](_0x5e36f0)[_0xd9b61c(0x136)]===0x0)return console[_0xd9b61c(0x114)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0xd9b61c(0x114)](_0xd9b61c(0x123)),0x1;const _0x5cdc5c=await withSpinner(_0xd9b61c(0x14b)+_0x30177d+'\x27...',()=>_0x48241a[_0xd9b61c(0x130)][_0xd9b61c(0xed)](_0x30177d,_0x5e36f0),{'verbose':_0xb477f2[_0xd9b61c(0x12a)]});return await handleSDKOutput([_0x5cdc5c['data']],_0xb477f2),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a16_0x2fcde2(0x126)]=a16_0x2fcde2(0x150);[a16_0x2fcde2(0x15f)]=a16_0x2fcde2(0x11f);async[a16_0x2fcde2(0xf0)](_0x40d69a){const _0x519426=a16_0x2fcde2,{options:_0x4b497b,args:_0x69b20d,tdx:_0x4ed13a}=_0x40d69a;if(_0x69b20d[_0x519426(0x136)]===0x0)return console[_0x519426(0x114)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x519426(0x114)](_0x519426(0x162)),0x1;const _0x4efcff=_0x69b20d[0x0];if(!_0x4b497b[_0x519426(0x113)]){const _0x3f819e=await confirm(_0x519426(0x116)+_0x4efcff+_0x519426(0x12d));if(!_0x3f819e)return console[_0x519426(0x161)](_0x519426(0x16b)),0x0;}return await withSpinner(_0x519426(0xfa)+_0x4efcff+_0x519426(0xef),()=>_0x4ed13a['engage'][_0x519426(0x146)](_0x4efcff),{'verbose':_0x4b497b[_0x519426(0x12a)]}),console[_0x519426(0x161)]('Workspace\x20\x27'+_0x4efcff+_0x519426(0x13f)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{['name']=a16_0x2fcde2(0x11c);[a16_0x2fcde2(0x15f)]=a16_0x2fcde2(0x147);async[a16_0x2fcde2(0xf0)](_0x58ee09){const _0x4d30a8=a16_0x2fcde2,{options:_0x3b4c5e,args:_0x293320,tdx:_0x2010e0}=_0x58ee09;if(_0x293320[_0x4d30a8(0x136)]===0x0)return console[_0x4d30a8(0x114)](_0x4d30a8(0xf8)),console[_0x4d30a8(0x114)]('Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>'),0x1;const _0x3a2139=_0x293320[0x0];await withSpinner(_0x4d30a8(0x10b)+_0x3a2139+'\x27...',()=>_0x2010e0['engage'][_0x4d30a8(0x10f)](_0x3a2139));const _0x14d3ed=_0x3b4c5e[_0x4d30a8(0x143)]||undefined;return saveSessionContext({'engage_workspace':_0x3a2139},_0x14d3ed),console[_0x4d30a8(0x161)]('Engage\x20workspace\x20set\x20to:\x20'+_0x3a2139),console[_0x4d30a8(0x161)](_0x4d30a8(0x173)),0x0;}}
1
+ const a16_0x159aef=a16_0x5dbe;(function(_0xb627b7,_0x232422){const _0x121af4=a16_0x5dbe,_0x2445d3=_0xb627b7();while(!![]){try{const _0x4d30e1=-parseInt(_0x121af4(0x1c3))/0x1*(parseInt(_0x121af4(0x202))/0x2)+parseInt(_0x121af4(0x238))/0x3+parseInt(_0x121af4(0x1fa))/0x4+-parseInt(_0x121af4(0x1d0))/0x5+-parseInt(_0x121af4(0x1b1))/0x6*(parseInt(_0x121af4(0x220))/0x7)+-parseInt(_0x121af4(0x1ea))/0x8*(-parseInt(_0x121af4(0x200))/0x9)+parseInt(_0x121af4(0x1e6))/0xa*(parseInt(_0x121af4(0x1fb))/0xb);if(_0x4d30e1===_0x232422)break;else _0x2445d3['push'](_0x2445d3['shift']());}catch(_0x1efd40){_0x2445d3['push'](_0x2445d3['shift']());}}}(a16_0x3edc,0x8bb38));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a16_0x3edc(){const _0xddcdb=['Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Campaign\x20\x27','Resume\x20a\x20paused\x20campaign','segmentId','filter','engage:workspaces','getCampaignFull','createTemplate','updateWorkspace','getTemplate','updateTemplate','name','Pause\x20a\x20campaign','html','engage:campaign:show','Creating\x20template\x20\x27','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','yes','\x27\x20resumed\x20successfully','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','1465677aOxHBa','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','engage','deleteWorkspace','Launch\x20a\x20campaign','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','6IWqiqC','Template\x20\x27','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','engage:campaign:duplicate','listCampaigns','subject','resumeCampaign','entries','Show\x20campaign\x20details','session','Update\x20a\x20workspace','timezone','execute','MISSING_ARGUMENT','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','updateCampaign','Launching\x20campaign\x20\x27','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','169926KDlbcf','getWorkspace','verbose','error','getTemplateFull','workspace','Updating\x20workspace\x20\x27','log','Deleting\x20campaign\x20\x27','segmentName','Error:\x20--subject\x20is\x20required','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','3350155LFpvvt','limit','segment','Workspace\x20\x27','type','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','engage:campaign:resume','listTemplates','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','Create\x20a\x20new\x20campaign','engage:workspace:use','Error:\x20--name\x20is\x20required','editorType','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','Delete\x20a\x20workspace','List\x20campaigns','\x27\x20launched\x20successfully','length','Fetching\x20template\x20\x27','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Operation\x20cancelled','description','13276840FaeorO','getWorkspaceFull','engage:campaign:pause','\x27?\x20This\x20cannot\x20be\x20undone.','1359112hvlFGx','engage:template:update','deleteTemplate','Fetching\x20templates...','engage:campaign:update','Options:\x20--name,\x20--description','data','Duplicate\x20a\x20campaign','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','resolveWorkspaceId','\x27...','launchCampaign','engage:workspace:delete','engage:campaigns','Set\x20workspace\x20context\x20for\x20Engage\x20commands','engage:template:delete','3641776PZCHyM','11cDPrXx','startAt','\x27\x20deleted\x20successfully','Delete\x20an\x20email\x20template','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','27RNgYrl','plaintext','12oBkldX','Create\x20a\x20workspace','Delete\x20a\x20campaign','\x27\x20paused\x20successfully','jsonColumns','createWorkspace','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','Fetching\x20campaigns...','Duplicating\x20campaign\x20\x27','Fetching\x20workspace\x20\x27','listWorkspaces','Creating\x20workspace\x20\x27','createCampaign','List\x20workspaces','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','Updating\x20campaign\x20\x27','Update\x20an\x20email\x20template','status','Workspace\x20is\x20required\x20for\x20this\x20operation','keys','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','engage:template:create','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','Creating\x20campaign\x20\x27','full','engage:workspace:show','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','engage_workspace','fromEntries','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','6821857XqGJZd','Show\x20email\x20template\x20details'];a16_0x3edc=function(){return _0xddcdb;};return a16_0x3edc();}import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';async function resolveWorkspaceIdFromOptions(_0x132478,_0x2655b8,_0x33fa9c=![]){const _0x30302c=a16_0x5dbe;if(_0x132478['workspace'])return await _0x2655b8[_0x30302c(0x1ad)]['resolveWorkspaceId'](_0x132478[_0x30302c(0x1c8)]);const _0x4620b2=loadSessionContext(_0x132478[_0x30302c(0x1ba)]);if(_0x4620b2?.[_0x30302c(0x21d)])return await _0x2655b8[_0x30302c(0x1ad)][_0x30302c(0x1f3)](_0x4620b2['engage_workspace']);if(_0x33fa9c)throw new SDKError(ErrorCode[_0x30302c(0x1be)],_0x30302c(0x214),undefined,{'helpText':_0x30302c(0x237)});return undefined;}async function resolveSegmentFromOptions(_0x59f501,_0x767faa){const _0x43250c=a16_0x5dbe;if(!_0x59f501[_0x43250c(0x1d2)])return{};const _0x36f42f=_0x59f501[_0x43250c(0x1d2)],_0x349326=await _0x767faa[_0x43250c(0x1d2)]['resolvePathToResource'](_0x36f42f);return{'audienceId':_0x349326['parentId'],'audienceName':_0x349326['parentName'],..._0x349326['segmentId']&&{'segmentId':_0x349326[_0x43250c(0x225)],'segmentName':_0x349326[_0x43250c(0x1cc)]}};}function buildConnectorConfig(_0x32b383){const _0x518018=a16_0x5dbe,_0x4799f2=_0x32b383['emailSenderId'],_0x10ef1b=_0x32b383[_0x518018(0x206)];if(!_0x4799f2&&!_0x10ef1b)return undefined;return{..._0x4799f2&&{'emailSenderId':_0x4799f2},..._0x10ef1b&&{'jsonColumns':_0x10ef1b}};}export class EngageCampaignsCommand extends BaseCommand{[a16_0x159aef(0x22d)]=a16_0x159aef(0x1f7);[a16_0x159aef(0x1e5)]=a16_0x159aef(0x1df);async['execute'](_0x277ee6){const _0x4edc75=a16_0x159aef,{options:_0x12cacd,args:_0x52e39a,tdx:_0x4ce411}=_0x277ee6,_0x194c11=_0x52e39a[0x0],_0x13e194=resolveLimit(_0x12cacd[_0x4edc75(0x1d1)],DEFAULT_LLM_LIMIT),_0x5126d0=_0x12cacd,_0x2ee795=_0x5126d0['type'],_0x26dd38=_0x5126d0[_0x4edc75(0x213)],_0xd4fa01=await resolveWorkspaceIdFromOptions(_0x5126d0,_0x4ce411),_0x1385fd=await withSpinner(_0x4edc75(0x209),()=>_0x4ce411[_0x4edc75(0x1ad)][_0x4edc75(0x1b5)]({'type':_0x2ee795,'status':_0x26dd38,'workspaceId':_0xd4fa01,'limit':_0x13e194}),{'verbose':_0x12cacd[_0x4edc75(0x1c5)]});let _0x1dc8ca=_0x1385fd[_0x4edc75(0x1f0)];return _0x194c11&&(_0x1dc8ca=_0x1385fd[_0x4edc75(0x1f0)]['filter'](_0x2d8dc2=>matchGlobPattern(_0x2d8dc2[_0x4edc75(0x22d)],_0x194c11))),await handleSDKOutput(_0x1dc8ca,_0x12cacd),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a16_0x159aef(0x22d)]=a16_0x159aef(0x230);[a16_0x159aef(0x1e5)]=a16_0x159aef(0x1b9);async[a16_0x159aef(0x1bd)](_0x241a6e){const _0x27d5be=a16_0x159aef,{options:_0x1b2e28,args:_0x3a33ed,tdx:_0x2c9e86}=_0x241a6e;if(_0x3a33ed[_0x27d5be(0x1e1)]===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x27d5be(0x1c6)]('Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>'),0x1;const _0x9fa55a=_0x3a33ed[0x0],_0x51357e=_0x1b2e28,_0x11b003=await resolveWorkspaceIdFromOptions(_0x51357e,_0x2c9e86),_0x2fee22=_0x51357e[_0x27d5be(0x21a)];if(_0x2fee22){const _0x22e77d=await withSpinner('Fetching\x20campaign\x20\x27'+_0x9fa55a+_0x27d5be(0x1f4),()=>_0x2c9e86['engage'][_0x27d5be(0x228)](_0x9fa55a,_0x11b003),{'verbose':_0x1b2e28[_0x27d5be(0x1c5)]});await handleSDKOutput([_0x22e77d],_0x1b2e28);}else{const _0x1c348a=await withSpinner('Fetching\x20campaign\x20\x27'+_0x9fa55a+'\x27...',()=>_0x2c9e86[_0x27d5be(0x1ad)]['getCampaign'](_0x9fa55a,_0x11b003),{'verbose':_0x1b2e28[_0x27d5be(0x1c5)]});await handleSDKOutput([_0x1c348a],_0x1b2e28);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{['name']='engage:campaign:create';['description']=a16_0x159aef(0x1d9);async['execute'](_0x478f35){const _0x59dd98=a16_0x159aef,{options:_0x587153,tdx:_0x1b9f31}=_0x478f35,_0x48719e=_0x587153,_0xb2aa30=_0x48719e[_0x59dd98(0x22d)],_0x37a94d=_0x48719e[_0x59dd98(0x1d4)];if(!_0xb2aa30)return console[_0x59dd98(0x1c6)](_0x59dd98(0x1db)),console['error'](_0x59dd98(0x1f2)),0x1;if(!_0x37a94d)return console['error'](_0x59dd98(0x1b3)),console[_0x59dd98(0x1c6)](_0x59dd98(0x1f2)),0x1;const _0x23faa9=await resolveWorkspaceIdFromOptions(_0x48719e,_0x1b9f31,!![]),_0x1f4d5b=await resolveSegmentFromOptions(_0x48719e,_0x1b9f31),_0x4b11de=buildConnectorConfig(_0x48719e),_0x4a9aee={'name':_0xb2aa30,'campaignType':_0x37a94d,'workspaceId':_0x23faa9,'description':_0x48719e[_0x59dd98(0x1e5)],..._0x1f4d5b,'connectorConfig':_0x4b11de,'startAt':_0x48719e[_0x59dd98(0x1fc)],'timezone':_0x48719e[_0x59dd98(0x1bc)]},_0x2ae82d=await withSpinner(_0x59dd98(0x219)+_0xb2aa30+_0x59dd98(0x1f4),()=>_0x1b9f31[_0x59dd98(0x1ad)][_0x59dd98(0x20e)](_0x4a9aee));return await handleSDKOutput([_0x2ae82d[_0x59dd98(0x1f0)]],_0x587153),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{['name']=a16_0x159aef(0x1ee);[a16_0x159aef(0x1e5)]='Update\x20a\x20campaign';async['execute'](_0x4b0018){const _0x4411d1=a16_0x159aef,{options:_0x4677b4,args:_0x1c52d1,tdx:_0x3e0b75}=_0x4b0018;if(_0x1c52d1[_0x4411d1(0x1e1)]===0x0)return console['error'](_0x4411d1(0x1bf)),console[_0x4411d1(0x1c6)](_0x4411d1(0x233)),0x1;const _0x48d57d=_0x1c52d1[0x0],_0x8e5099=_0x4677b4,_0x4fc043=await resolveWorkspaceIdFromOptions(_0x8e5099,_0x3e0b75),_0x418f78=await resolveSegmentFromOptions(_0x8e5099,_0x3e0b75),_0x2cd38d=buildConnectorConfig(_0x8e5099),_0x286dfd={'name':_0x8e5099[_0x4411d1(0x22d)],'description':_0x8e5099[_0x4411d1(0x1e5)],..._0x418f78,'connectorConfig':_0x2cd38d,'startAt':_0x8e5099[_0x4411d1(0x1fc)],'timezone':_0x8e5099[_0x4411d1(0x1bc)]},_0x330303=Object[_0x4411d1(0x21e)](Object[_0x4411d1(0x1b8)](_0x286dfd)['filter'](([,_0x263399])=>_0x263399!==undefined));if(Object[_0x4411d1(0x215)](_0x330303)['length']===0x0)return console[_0x4411d1(0x1c6)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x4411d1(0x1c6)](_0x4411d1(0x1ac)),0x1;const _0x4cd751=await withSpinner(_0x4411d1(0x211)+_0x48d57d+_0x4411d1(0x1f4),()=>_0x3e0b75[_0x4411d1(0x1ad)][_0x4411d1(0x1c0)](_0x48d57d,_0x330303,_0x4fc043),{'verbose':_0x4677b4[_0x4411d1(0x1c5)]});return await handleSDKOutput([_0x4cd751[_0x4411d1(0x1f0)]],_0x4677b4),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a16_0x159aef(0x22d)]='engage:campaign:delete';[a16_0x159aef(0x1e5)]=a16_0x159aef(0x204);async[a16_0x159aef(0x1bd)](_0x575fdb){const _0x426de0=a16_0x159aef,{options:_0x5a5cb9,args:_0x103995,tdx:_0x2430c5}=_0x575fdb;if(_0x103995[_0x426de0(0x1e1)]===0x0)return console[_0x426de0(0x1c6)](_0x426de0(0x1bf)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>'),0x1;const _0x145450=_0x103995[0x0],_0x1ba05d=_0x5a5cb9,_0x4a4f96=await resolveWorkspaceIdFromOptions(_0x1ba05d,_0x2430c5);if(!_0x5a5cb9['yes']){const _0x2c0ebc=await confirm(_0x426de0(0x1c2)+_0x145450+_0x426de0(0x1e9));if(!_0x2c0ebc)return console['log']('Operation\x20cancelled'),0x0;}return await withSpinner(_0x426de0(0x1cb)+_0x145450+_0x426de0(0x1f4),()=>_0x2430c5['engage']['deleteCampaign'](_0x145450,_0x4a4f96),{'verbose':_0x5a5cb9[_0x426de0(0x1c5)]}),console[_0x426de0(0x1ca)](_0x426de0(0x223)+_0x145450+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{['name']='engage:campaign:launch';[a16_0x159aef(0x1e5)]=a16_0x159aef(0x1af);async[a16_0x159aef(0x1bd)](_0x35c4ec){const _0x51cb9c=a16_0x159aef,{options:_0x46f769,args:_0x1dbbab,tdx:_0x3dcb44}=_0x35c4ec;if(_0x1dbbab['length']===0x0)return console[_0x51cb9c(0x1c6)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x51cb9c(0x1ce)),0x1;const _0x3f98c6=_0x1dbbab[0x0],_0x4ebcea=_0x46f769,_0x5217b8=await resolveWorkspaceIdFromOptions(_0x4ebcea,_0x3dcb44);return await withSpinner(_0x51cb9c(0x1c1)+_0x3f98c6+_0x51cb9c(0x1f4),()=>_0x3dcb44[_0x51cb9c(0x1ad)][_0x51cb9c(0x1f5)](_0x3f98c6,_0x5217b8),{'verbose':_0x46f769[_0x51cb9c(0x1c5)]}),console[_0x51cb9c(0x1ca)]('Campaign\x20\x27'+_0x3f98c6+_0x51cb9c(0x1e0)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a16_0x159aef(0x22d)]=a16_0x159aef(0x1e8);[a16_0x159aef(0x1e5)]=a16_0x159aef(0x22e);async[a16_0x159aef(0x1bd)](_0x5aaaa5){const _0x20b8ad=a16_0x159aef,{options:_0xe6fe8a,args:_0x12decf,tdx:_0x564592}=_0x5aaaa5;if(_0x12decf[_0x20b8ad(0x1e1)]===0x0)return console[_0x20b8ad(0x1c6)](_0x20b8ad(0x1bf)),console[_0x20b8ad(0x1c6)](_0x20b8ad(0x1cf)),0x1;const _0x8fe282=_0x12decf[0x0],_0x170b56=_0xe6fe8a,_0x34e079=await resolveWorkspaceIdFromOptions(_0x170b56,_0x564592);return await withSpinner('Pausing\x20campaign\x20\x27'+_0x8fe282+_0x20b8ad(0x1f4),()=>_0x564592[_0x20b8ad(0x1ad)]['pauseCampaign'](_0x8fe282,_0x34e079),{'verbose':_0xe6fe8a['verbose']}),console[_0x20b8ad(0x1ca)](_0x20b8ad(0x223)+_0x8fe282+_0x20b8ad(0x205)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a16_0x159aef(0x22d)]=a16_0x159aef(0x1d6);[a16_0x159aef(0x1e5)]=a16_0x159aef(0x224);async['execute'](_0x28caeb){const _0x587bfb=a16_0x159aef,{options:_0x57c220,args:_0x4042ee,tdx:_0x1336d0}=_0x28caeb;if(_0x4042ee['length']===0x0)return console['error'](_0x587bfb(0x1bf)),console[_0x587bfb(0x1c6)](_0x587bfb(0x218)),0x1;const _0x1a970d=_0x4042ee[0x0],_0x17f768=_0x57c220,_0x43fdfc=await resolveWorkspaceIdFromOptions(_0x17f768,_0x1336d0);return await withSpinner('Resuming\x20campaign\x20\x27'+_0x1a970d+_0x587bfb(0x1f4),()=>_0x1336d0[_0x587bfb(0x1ad)][_0x587bfb(0x1b7)](_0x1a970d,_0x43fdfc),{'verbose':_0x57c220[_0x587bfb(0x1c5)]}),console[_0x587bfb(0x1ca)](_0x587bfb(0x223)+_0x1a970d+_0x587bfb(0x236)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a16_0x159aef(0x22d)]=a16_0x159aef(0x1b4);[a16_0x159aef(0x1e5)]=a16_0x159aef(0x1f1);async[a16_0x159aef(0x1bd)](_0x136453){const _0x38fcb9=a16_0x159aef,{options:_0x527df9,args:_0x2aa3eb,tdx:_0x181e91}=_0x136453;if(_0x2aa3eb[_0x38fcb9(0x1e1)]===0x0)return console[_0x38fcb9(0x1c6)](_0x38fcb9(0x1bf)),console[_0x38fcb9(0x1c6)]('Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>'),0x1;const _0x1ad03f=_0x2aa3eb[0x0],_0x1098b0=_0x527df9,_0x3b2a3c=await resolveWorkspaceIdFromOptions(_0x1098b0,_0x181e91),_0x3a7e60=await withSpinner(_0x38fcb9(0x20a)+_0x1ad03f+_0x38fcb9(0x1f4),()=>_0x181e91[_0x38fcb9(0x1ad)]['duplicateCampaign'](_0x1ad03f,_0x3b2a3c),{'verbose':_0x527df9['verbose']});return await handleSDKOutput([_0x3a7e60[_0x38fcb9(0x1f0)]],_0x527df9),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a16_0x159aef(0x22d)]='engage:templates';['description']='List\x20email\x20templates';async[a16_0x159aef(0x1bd)](_0x3b0155){const _0x5ce173=a16_0x159aef,{options:_0x47b6b6,args:_0x5263e7,tdx:_0x1e4a43}=_0x3b0155,_0x3984fe=_0x5263e7[0x0],_0x482aa2=resolveLimit(_0x47b6b6[_0x5ce173(0x1d1)],DEFAULT_LLM_LIMIT),_0x15c384=_0x47b6b6,_0xe1c62d=await resolveWorkspaceIdFromOptions(_0x15c384,_0x1e4a43),_0x2449e6=await withSpinner(_0x5ce173(0x1ed),()=>_0x1e4a43[_0x5ce173(0x1ad)][_0x5ce173(0x1d7)]({'workspaceId':_0xe1c62d,'limit':_0x482aa2}),{'verbose':_0x47b6b6['verbose']});let _0x190acc=_0x2449e6[_0x5ce173(0x1f0)];return _0x3984fe&&(_0x190acc=_0x2449e6['data'][_0x5ce173(0x226)](_0x568e9b=>matchGlobPattern(_0x568e9b[_0x5ce173(0x22d)],_0x3984fe))),await handleSDKOutput(_0x190acc,_0x47b6b6),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a16_0x159aef(0x22d)]='engage:template:show';[a16_0x159aef(0x1e5)]=a16_0x159aef(0x221);async['execute'](_0x7ab16){const _0x2503c6=a16_0x159aef,{options:_0x4f09b3,args:_0x1bb185,tdx:_0xbb6063}=_0x7ab16;if(_0x1bb185[_0x2503c6(0x1e1)]===0x0)return console[_0x2503c6(0x1c6)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x2503c6(0x1c6)](_0x2503c6(0x232)),0x1;const _0x2f3395=_0x1bb185[0x0],_0x9ee8bc=_0x4f09b3,_0x383919=await resolveWorkspaceIdFromOptions(_0x9ee8bc,_0xbb6063),_0x29de90=_0x9ee8bc[_0x2503c6(0x21a)];if(_0x29de90){const _0x5b1618=await withSpinner(_0x2503c6(0x1e2)+_0x2f3395+_0x2503c6(0x1f4),()=>_0xbb6063[_0x2503c6(0x1ad)][_0x2503c6(0x1c7)](_0x2f3395,_0x383919),{'verbose':_0x4f09b3['verbose']});await handleSDKOutput([_0x5b1618],_0x4f09b3);}else{const _0x12a1e2=await withSpinner(_0x2503c6(0x1e2)+_0x2f3395+_0x2503c6(0x1f4),()=>_0xbb6063[_0x2503c6(0x1ad)][_0x2503c6(0x22b)](_0x2f3395,_0x383919),{'verbose':_0x4f09b3['verbose']});await handleSDKOutput([_0x12a1e2],_0x4f09b3);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a16_0x159aef(0x22d)]=a16_0x159aef(0x217);[a16_0x159aef(0x1e5)]='Create\x20an\x20email\x20template';async[a16_0x159aef(0x1bd)](_0x10273a){const _0x49c9e5=a16_0x159aef,{options:_0x5142df,tdx:_0x5e329b}=_0x10273a,_0xf9e8cf=_0x5142df,_0x4c3dac=_0xf9e8cf['name'],_0x5bd774=_0xf9e8cf[_0x49c9e5(0x1b6)],_0x52c5cf=_0xf9e8cf['html'];if(!_0x4c3dac)return console[_0x49c9e5(0x1c6)](_0x49c9e5(0x1db)),console[_0x49c9e5(0x1c6)](_0x49c9e5(0x1d5)),0x1;if(!_0x5bd774)return console[_0x49c9e5(0x1c6)](_0x49c9e5(0x1cd)),0x1;if(!_0x52c5cf)return console[_0x49c9e5(0x1c6)]('Error:\x20--html\x20is\x20required'),0x1;const _0x1eb392=await resolveWorkspaceIdFromOptions(_0xf9e8cf,_0x5e329b,!![]),_0x5cb3ee={'name':_0x4c3dac,'subjectTemplate':_0x5bd774,'htmlTemplate':_0x52c5cf,'workspaceId':_0x1eb392,'plaintextTemplate':_0xf9e8cf[_0x49c9e5(0x201)],'editorType':_0xf9e8cf[_0x49c9e5(0x1dc)]},_0x130cd0=await withSpinner(_0x49c9e5(0x231)+_0x4c3dac+'\x27...',()=>_0x5e329b[_0x49c9e5(0x1ad)][_0x49c9e5(0x229)](_0x5cb3ee));return await handleSDKOutput([_0x130cd0[_0x49c9e5(0x1f0)]],_0x5142df),0x0;}}function a16_0x5dbe(_0x3c2e0a,_0x34aea5){_0x3c2e0a=_0x3c2e0a-0x1ac;const _0x3edc5b=a16_0x3edc();let _0x5dbe7a=_0x3edc5b[_0x3c2e0a];return _0x5dbe7a;}export class EngageTemplateUpdateCommand extends BaseCommand{['name']=a16_0x159aef(0x1eb);[a16_0x159aef(0x1e5)]=a16_0x159aef(0x212);async[a16_0x159aef(0x1bd)](_0x467534){const _0x391d6b=a16_0x159aef,{options:_0x51b1cc,args:_0xea67da,tdx:_0x586eb2}=_0x467534;if(_0xea67da[_0x391d6b(0x1e1)]===0x0)return console[_0x391d6b(0x1c6)](_0x391d6b(0x1d8)),console[_0x391d6b(0x1c6)](_0x391d6b(0x222)),0x1;const _0x214dfc=_0xea67da[0x0],_0x4b64a1=_0x51b1cc,_0x56ea3e=await resolveWorkspaceIdFromOptions(_0x4b64a1,_0x586eb2),_0x2d60cc={'name':_0x4b64a1[_0x391d6b(0x22d)],'subjectTemplate':_0x4b64a1['subject'],'htmlTemplate':_0x4b64a1[_0x391d6b(0x22f)],'plaintextTemplate':_0x4b64a1[_0x391d6b(0x201)]},_0x5b8445=Object[_0x391d6b(0x21e)](Object['entries'](_0x2d60cc)[_0x391d6b(0x226)](([,_0x25c6b5])=>_0x25c6b5!==undefined));if(Object[_0x391d6b(0x215)](_0x5b8445)['length']===0x0)return console[_0x391d6b(0x1c6)](_0x391d6b(0x1b0)),console[_0x391d6b(0x1c6)](_0x391d6b(0x1dd)),0x1;const _0x552a56=await withSpinner('Updating\x20template\x20\x27'+_0x214dfc+_0x391d6b(0x1f4),()=>_0x586eb2[_0x391d6b(0x1ad)][_0x391d6b(0x22c)](_0x214dfc,_0x5b8445,_0x56ea3e),{'verbose':_0x51b1cc[_0x391d6b(0x1c5)]});return await handleSDKOutput([_0x552a56['data']],_0x51b1cc),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{['name']=a16_0x159aef(0x1f9);[a16_0x159aef(0x1e5)]=a16_0x159aef(0x1fe);async[a16_0x159aef(0x1bd)](_0x23d641){const _0x4fe36f=a16_0x159aef,{options:_0x16a7c6,args:_0xfbecab,tdx:_0x250d46}=_0x23d641;if(_0xfbecab[_0x4fe36f(0x1e1)]===0x0)return console[_0x4fe36f(0x1c6)](_0x4fe36f(0x1d8)),console[_0x4fe36f(0x1c6)](_0x4fe36f(0x21f)),0x1;const _0x57a3fb=_0xfbecab[0x0],_0x29ad62=_0x16a7c6,_0xd46629=await resolveWorkspaceIdFromOptions(_0x29ad62,_0x250d46);if(!_0x16a7c6[_0x4fe36f(0x235)]){const _0xc9db97=await confirm(_0x4fe36f(0x1ff)+_0x57a3fb+_0x4fe36f(0x1e9));if(!_0xc9db97)return console['log'](_0x4fe36f(0x1e4)),0x0;}return await withSpinner('Deleting\x20template\x20\x27'+_0x57a3fb+_0x4fe36f(0x1f4),()=>_0x250d46[_0x4fe36f(0x1ad)][_0x4fe36f(0x1ec)](_0x57a3fb,_0xd46629),{'verbose':_0x16a7c6[_0x4fe36f(0x1c5)]}),console[_0x4fe36f(0x1ca)](_0x4fe36f(0x1b2)+_0x57a3fb+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a16_0x159aef(0x22d)]=a16_0x159aef(0x227);[a16_0x159aef(0x1e5)]=a16_0x159aef(0x20f);async[a16_0x159aef(0x1bd)](_0x4d00e4){const _0x31bd15=a16_0x159aef,{options:_0x3f56d1,args:_0x187510,tdx:_0x32b024}=_0x4d00e4,_0x58d8f7=_0x187510[0x0],_0xe17540=resolveLimit(_0x3f56d1[_0x31bd15(0x1d1)],DEFAULT_LLM_LIMIT),_0x27e8ec=await withSpinner('Fetching\x20workspaces...',()=>_0x32b024[_0x31bd15(0x1ad)][_0x31bd15(0x20c)]({'limit':_0xe17540}),{'verbose':_0x3f56d1['verbose']});let _0x181880=_0x27e8ec[_0x31bd15(0x1f0)];return _0x58d8f7&&(_0x181880=_0x27e8ec[_0x31bd15(0x1f0)][_0x31bd15(0x226)](_0x35299a=>matchGlobPattern(_0x35299a[_0x31bd15(0x22d)],_0x58d8f7))),await handleSDKOutput(_0x181880,_0x3f56d1),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a16_0x159aef(0x22d)]=a16_0x159aef(0x21b);[a16_0x159aef(0x1e5)]='Show\x20workspace\x20details';async['execute'](_0x54ff38){const _0x20597d=a16_0x159aef,{options:_0x160258,args:_0x29e951,tdx:_0x1ff4f9}=_0x54ff38;if(_0x29e951[_0x20597d(0x1e1)]===0x0)return console[_0x20597d(0x1c6)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x20597d(0x1c6)](_0x20597d(0x208)),0x1;const _0x37eaaa=_0x29e951[0x0],_0x42d5e6=_0x160258,_0xa69a8a=_0x42d5e6['full'];if(_0xa69a8a){const _0x4700e3=await withSpinner('Fetching\x20workspace\x20\x27'+_0x37eaaa+_0x20597d(0x1f4),()=>_0x1ff4f9[_0x20597d(0x1ad)][_0x20597d(0x1e7)](_0x37eaaa),{'verbose':_0x160258['verbose']});await handleSDKOutput([_0x4700e3],_0x160258);}else{const _0x23eaac=await withSpinner(_0x20597d(0x20b)+_0x37eaaa+_0x20597d(0x1f4),()=>_0x1ff4f9[_0x20597d(0x1ad)][_0x20597d(0x1c4)](_0x37eaaa),{'verbose':_0x160258['verbose']});await handleSDKOutput([_0x23eaac],_0x160258);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a16_0x159aef(0x22d)]='engage:workspace:create';[a16_0x159aef(0x1e5)]=a16_0x159aef(0x203);async[a16_0x159aef(0x1bd)](_0x402d2b){const _0x23df08=a16_0x159aef,{options:_0x201ce8,tdx:_0x992f40}=_0x402d2b,_0x32d95d=_0x201ce8,_0x142f89=_0x32d95d['name'];if(!_0x142f89)return console[_0x23df08(0x1c6)](_0x23df08(0x1db)),console[_0x23df08(0x1c6)](_0x23df08(0x216)),0x1;const _0x50ff1b={'name':_0x142f89,'description':_0x32d95d[_0x23df08(0x1e5)]},_0x33810f=await withSpinner(_0x23df08(0x20d)+_0x142f89+'\x27...',()=>_0x992f40['engage'][_0x23df08(0x207)](_0x50ff1b));return await handleSDKOutput([_0x33810f[_0x23df08(0x1f0)]],_0x201ce8),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a16_0x159aef(0x22d)]='engage:workspace:update';[a16_0x159aef(0x1e5)]=a16_0x159aef(0x1bb);async['execute'](_0x5219f0){const _0x17e693=a16_0x159aef,{options:_0xd51ccb,args:_0x186624,tdx:_0x3b1d97}=_0x5219f0;if(_0x186624[_0x17e693(0x1e1)]===0x0)return console[_0x17e693(0x1c6)](_0x17e693(0x210)),console[_0x17e693(0x1c6)]('Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x257ec8=_0x186624[0x0],_0x17d3d1=_0xd51ccb,_0x2fa1c8={'name':_0x17d3d1[_0x17e693(0x22d)],'description':_0x17d3d1['description']},_0xfe2185=Object[_0x17e693(0x21e)](Object[_0x17e693(0x1b8)](_0x2fa1c8)['filter'](([,_0xe764f3])=>_0xe764f3!==undefined));if(Object['keys'](_0xfe2185)['length']===0x0)return console[_0x17e693(0x1c6)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console['error'](_0x17e693(0x1ef)),0x1;const _0x41075b=await withSpinner(_0x17e693(0x1c9)+_0x257ec8+_0x17e693(0x1f4),()=>_0x3b1d97['engage'][_0x17e693(0x22a)](_0x257ec8,_0xfe2185),{'verbose':_0xd51ccb[_0x17e693(0x1c5)]});return await handleSDKOutput([_0x41075b[_0x17e693(0x1f0)]],_0xd51ccb),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{['name']=a16_0x159aef(0x1f6);[a16_0x159aef(0x1e5)]=a16_0x159aef(0x1de);async['execute'](_0x2c0a3c){const _0x32b40b=a16_0x159aef,{options:_0x11eae3,args:_0x56dfc2,tdx:_0x12b00b}=_0x2c0a3c;if(_0x56dfc2['length']===0x0)return console['error'](_0x32b40b(0x210)),console['error'](_0x32b40b(0x234)),0x1;const _0x563ef6=_0x56dfc2[0x0];if(!_0x11eae3[_0x32b40b(0x235)]){const _0x5eb3dc=await confirm(_0x32b40b(0x21c)+_0x563ef6+_0x32b40b(0x1e9));if(!_0x5eb3dc)return console['log'](_0x32b40b(0x1e4)),0x0;}return await withSpinner('Deleting\x20workspace\x20\x27'+_0x563ef6+'\x27...',()=>_0x12b00b[_0x32b40b(0x1ad)][_0x32b40b(0x1ae)](_0x563ef6),{'verbose':_0x11eae3[_0x32b40b(0x1c5)]}),console[_0x32b40b(0x1ca)](_0x32b40b(0x1d3)+_0x563ef6+_0x32b40b(0x1fd)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{['name']=a16_0x159aef(0x1da);['description']=a16_0x159aef(0x1f8);async[a16_0x159aef(0x1bd)](_0x32b06a){const _0x580c45=a16_0x159aef,{options:_0x1d79dc,args:_0x239633,tdx:_0x5e8335}=_0x32b06a;if(_0x239633[_0x580c45(0x1e1)]===0x0)return console[_0x580c45(0x1c6)]('Error:\x20Workspace\x20name\x20is\x20required'),console['error']('Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>'),0x1;const _0x7d35a7=_0x239633[0x0];await withSpinner('Verifying\x20workspace\x20\x27'+_0x7d35a7+'\x27...',()=>_0x5e8335['engage'][_0x580c45(0x1f3)](_0x7d35a7));const _0x4ae6de=_0x1d79dc[_0x580c45(0x1ba)]||undefined;return saveSessionContext({'engage_workspace':_0x7d35a7},_0x4ae6de),console[_0x580c45(0x1ca)]('Engage\x20workspace\x20set\x20to:\x20'+_0x7d35a7),console['log'](_0x580c45(0x1e3)),0x0;}}
@@ -1 +1 @@
1
- function a17_0x5226(_0x210a4e,_0x3e8828){_0x210a4e=_0x210a4e-0x1bd;const _0x2a731a=a17_0x2a73();let _0x52260c=_0x2a731a[_0x210a4e];return _0x52260c;}const a17_0x31ea58=a17_0x5226;(function(_0x283ac1,_0x2dcbb4){const _0x1b1cbf=a17_0x5226,_0xffb5d4=_0x283ac1();while(!![]){try{const _0x484a94=-parseInt(_0x1b1cbf(0x1c9))/0x1+-parseInt(_0x1b1cbf(0x1ee))/0x2+parseInt(_0x1b1cbf(0x201))/0x3+parseInt(_0x1b1cbf(0x1c8))/0x4*(parseInt(_0x1b1cbf(0x1e9))/0x5)+-parseInt(_0x1b1cbf(0x1c6))/0x6*(parseInt(_0x1b1cbf(0x1db))/0x7)+parseInt(_0x1b1cbf(0x1eb))/0x8*(-parseInt(_0x1b1cbf(0x1c0))/0x9)+parseInt(_0x1b1cbf(0x1c7))/0xa;if(_0x484a94===_0x2dcbb4)break;else _0xffb5d4['push'](_0xffb5d4['shift']());}catch(_0x2d9a94){_0xffb5d4['push'](_0xffb5d4['shift']());}}}(a17_0x2a73,0x903f9));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';function a17_0x2a73(){const _0xfa2f0c=['job:kill','end_at','Query:\x20','✔\x20Found\x20','show','trino','start_at','905kffjyD','...','8BqjTvx','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','Listing\x20jobs...','2302514tjPHYy','Submit\x20a\x20job','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Submitting\x20job...','yes','created_at','result','limit','round','Kill\x20a\x20job','description','\x20row','debug','validate','Show\x20job\x20details','query','job:show','No\x20SQL\x20statements\x20found\x20in\x20file','Getting\x20job\x20details...','2866914ZwCTdT','submit','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','map','priority','jobType','\x20jobs','10590561EWSJYX','status','Database:\x20','jobs','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','hive','3180006rLpMIk','34161170dNKEUF','12lSTLLq','923470oclnIZ','job_id','data','name','getTime','substring','user_name','args','job:submit','verbose','\x20\x20Job\x20ID:\x20','type','database','url','length','\x27\x20to\x20verify\x20the\x20job\x20status','error','execute','7bQtZsA','kill','list','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','INVALID_ARGUMENT','file','✔\x20Job\x20submitted'];a17_0x2a73=function(){return _0xfa2f0c;};return a17_0x2a73();}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';export class JobListCommand extends BaseCommand{['name']='jobs';[a17_0x31ea58(0x1f8)]='List\x20jobs';async[a17_0x31ea58(0x1da)](_0x2c7812){const _0x23bc00=a17_0x31ea58,{options:_0x1594da,tdx:_0x2bbf0a}=_0x2c7812,_0x4fcdf2=resolveLimit(_0x1594da[_0x23bc00(0x1f5)],DEFAULT_DISPLAY_LIMIT),_0x28dda2=_0x1594da[_0x23bc00(0x1c1)];_0x1594da['verbose']&&(console[_0x23bc00(0x1d9)]('Limit:\x20'+_0x4fcdf2+_0x23bc00(0x1bf)),_0x28dda2&&console['error']('Status\x20filter:\x20'+_0x28dda2));const _0xaed273=await withSpinner(_0x23bc00(0x1ed),()=>_0x2bbf0a[_0x23bc00(0x1c3)][_0x23bc00(0x1dd)]({'from':0x0,'to':_0x4fcdf2-0x1,'status':_0x28dda2}),{'verbose':_0x1594da[_0x23bc00(0x1d2)]}),_0xe39ba9=_0xaed273['data'];console['error'](_0x23bc00(0x1e5)+_0xe39ba9[_0x23bc00(0x1d7)]+'\x20job'+(_0xe39ba9[_0x23bc00(0x1d7)]!==0x1?'s':''));const _0x46964f=_0xe39ba9[_0x23bc00(0x206)](_0xc0a38=>{const _0x264e3a=_0x23bc00;let _0x1070c5;if(_0xc0a38[_0x264e3a(0x1e8)]&&_0xc0a38[_0x264e3a(0x1e3)]){const _0x32e8bf=new Date(_0xc0a38[_0x264e3a(0x1e8)])['getTime'](),_0x1a3ba=new Date(_0xc0a38[_0x264e3a(0x1e3)])[_0x264e3a(0x1cd)]();_0x1070c5=Math[_0x264e3a(0x1f6)]((_0x1a3ba-_0x32e8bf)/0x3e8);}return{'job_id':_0xc0a38['job_id'],'type':_0xc0a38[_0x264e3a(0x1d4)],'status':_0xc0a38['status'],'user_name':_0xc0a38['user_name'],'duration_sec':_0x1070c5,'created_at':_0xc0a38[_0x264e3a(0x1f3)],'started_at':_0xc0a38[_0x264e3a(0x1e8)],'end_at':_0xc0a38[_0x264e3a(0x1e3)]};});return await handleSDKOutput(_0x46964f,_0x1594da),0x0;}}export class JobShowCommand extends BaseCommand{[a17_0x31ea58(0x1cc)]=a17_0x31ea58(0x1fe);['description']=a17_0x31ea58(0x1fc);[a17_0x31ea58(0x1fb)](_0xd846b1){const _0x3d8583=a17_0x31ea58,_0xf183c4=_0xd846b1[_0x3d8583(0x1d0)][0x0];if(!_0xf183c4)return _0x3d8583(0x1c4);return undefined;}async[a17_0x31ea58(0x1da)](_0x1f3d74){const _0x3f3e9e=a17_0x31ea58,{options:_0x3a6b0d,args:_0x1a7f64,tdx:_0x497e04}=_0x1f3d74,_0x1d5ce5=_0x1a7f64[0x0],_0x591e09=await withSpinner(_0x3f3e9e(0x200),()=>_0x497e04[_0x3f3e9e(0x1c3)][_0x3f3e9e(0x1e6)](_0x1d5ce5),{'verbose':_0x3a6b0d[_0x3f3e9e(0x1d2)]}),_0x3c3f46=_0x591e09[_0x3f3e9e(0x1cb)];let _0x5e78cf;if(_0x3c3f46['start_at']&&_0x3c3f46[_0x3f3e9e(0x1e3)]){const _0xe6eb9f=new Date(_0x3c3f46[_0x3f3e9e(0x1e8)])[_0x3f3e9e(0x1cd)](),_0x3693dc=new Date(_0x3c3f46[_0x3f3e9e(0x1e3)])[_0x3f3e9e(0x1cd)]();_0x5e78cf=Math[_0x3f3e9e(0x1f6)]((_0x3693dc-_0xe6eb9f)/0x3e8);}const _0x57783c={'job_id':_0x3c3f46['job_id'],'type':_0x3c3f46[_0x3f3e9e(0x1d4)],'status':_0x3c3f46[_0x3f3e9e(0x1c1)],..._0x3c3f46[_0x3f3e9e(0x1cf)]&&{'user_name':_0x3c3f46['user_name']},..._0x5e78cf!==undefined&&{'duration_sec':_0x5e78cf},..._0x3c3f46[_0x3f3e9e(0x1f3)]&&{'created_at':_0x3c3f46[_0x3f3e9e(0x1f3)]},..._0x3c3f46[_0x3f3e9e(0x1e8)]&&{'started_at':_0x3c3f46[_0x3f3e9e(0x1e8)]},..._0x3c3f46[_0x3f3e9e(0x1e3)]&&{'end_at':_0x3c3f46[_0x3f3e9e(0x1e3)]},..._0x3c3f46[_0x3f3e9e(0x1d5)]&&{'database':_0x3c3f46[_0x3f3e9e(0x1d5)]},..._0x3c3f46[_0x3f3e9e(0x1bd)]!==undefined&&{'priority':_0x3c3f46[_0x3f3e9e(0x1bd)]},..._0x3c3f46[_0x3f3e9e(0x1d6)]&&{'url':_0x3c3f46[_0x3f3e9e(0x1d6)]},..._0x3c3f46[_0x3f3e9e(0x1fd)]&&{'query':_0x3c3f46[_0x3f3e9e(0x1fd)]},..._0x3c3f46[_0x3f3e9e(0x1fa)]&&{'debug':_0x3c3f46[_0x3f3e9e(0x1fa)]}};return await handleSingleObjectOutput(_0x57783c,_0x3a6b0d),0x0;}}export class JobKillCommand extends BaseCommand{[a17_0x31ea58(0x1cc)]=a17_0x31ea58(0x1e2);['description']=a17_0x31ea58(0x1f7);[a17_0x31ea58(0x1fb)](_0x10efeb){const _0xd3b16a=a17_0x31ea58,_0x35684a=_0x10efeb['args'][0x0];if(!_0x35684a)return _0xd3b16a(0x205);return undefined;}async[a17_0x31ea58(0x1da)](_0xa3c3ef){const _0x4ba75e=a17_0x31ea58,{options:_0x4d2acd,args:_0x358b82,tdx:_0x313af7}=_0xa3c3ef,_0xcff84f=_0x358b82[0x0];if(!_0x4d2acd[_0x4ba75e(0x1f2)]){const _0x2f439d=await confirm(_0x4ba75e(0x1f0)+_0xcff84f+'?');if(!_0x2f439d)return console[_0x4ba75e(0x1d9)]('Cancelled'),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x313af7[_0x4ba75e(0x1c3)][_0x4ba75e(0x1dc)](_0xcff84f),{'verbose':_0x4d2acd[_0x4ba75e(0x1d2)]}),console[_0x4ba75e(0x1d9)]('✔\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0xcff84f),console[_0x4ba75e(0x1d9)](_0x4ba75e(0x204)+_0xcff84f+_0x4ba75e(0x1d8)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a17_0x31ea58(0x1cc)]=a17_0x31ea58(0x1d1);[a17_0x31ea58(0x1f8)]=a17_0x31ea58(0x1ef);async[a17_0x31ea58(0x1da)](_0x59b949){const _0x9e24ab=a17_0x31ea58,{options:_0x3e6bf2,args:_0x418aa1,tdx:_0x3d070f}=_0x59b949,_0x3fcd9c=_0x3e6bf2[_0x9e24ab(0x1be)]||_0x9e24ab(0x1e7),_0x56d122=_0x3e6bf2[_0x9e24ab(0x1e0)],_0x535af6=_0x3e6bf2[_0x9e24ab(0x1d5)]||'information_schema';if(_0x3fcd9c!==_0x9e24ab(0x1e7)&&_0x3fcd9c!==_0x9e24ab(0x1c5))throw new SDKError(ErrorCode[_0x9e24ab(0x1df)],_0x9e24ab(0x203));let _0x45e274;if(_0x56d122){if(_0x418aa1[0x0])throw new SDKError(ErrorCode[_0x9e24ab(0x1df)],_0x9e24ab(0x1de));const _0x3248d2=readSqlStatementsFromFile(_0x56d122);if(_0x3248d2[_0x9e24ab(0x1d7)]===0x0)throw new SDKError(ErrorCode[_0x9e24ab(0x1df)],_0x9e24ab(0x1ff));if(_0x3248d2[_0x9e24ab(0x1d7)]>0x1)throw new SDKError(ErrorCode[_0x9e24ab(0x1df)],_0x9e24ab(0x1ec));_0x45e274=_0x3248d2[0x0];}else{if(!_0x418aa1[0x0])throw new SDKError(ErrorCode[_0x9e24ab(0x1df)],'Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>');_0x45e274=_0x418aa1[0x0];}_0x3e6bf2[_0x9e24ab(0x1d2)]&&(console['error']('Job\x20type:\x20'+_0x3fcd9c),console[_0x9e24ab(0x1d9)](_0x9e24ab(0x1c2)+_0x535af6),console['error'](_0x9e24ab(0x1e4)+_0x45e274[_0x9e24ab(0x1ce)](0x0,0x64)+(_0x45e274[_0x9e24ab(0x1d7)]>0x64?_0x9e24ab(0x1ea):'')));const _0x3d6d5d=await withSpinner(_0x9e24ab(0x1f1),()=>_0x3d070f[_0x9e24ab(0x1c3)][_0x9e24ab(0x202)](_0x535af6,_0x45e274,_0x3fcd9c),{'verbose':_0x3e6bf2['verbose']}),_0x75705a=_0x3d6d5d[_0x9e24ab(0x1cb)];return console[_0x9e24ab(0x1d9)](_0x9e24ab(0x1e1)),console[_0x9e24ab(0x1d9)](_0x9e24ab(0x1d3)+_0x75705a[_0x9e24ab(0x1ca)]),await handleSDKOutput([_0x75705a],_0x3e6bf2),0x0;}}export class JobResultCommand extends BaseCommand{[a17_0x31ea58(0x1cc)]='job:result';[a17_0x31ea58(0x1f8)]='Get\x20job\x20results';[a17_0x31ea58(0x1fb)](_0x2af8e8){const _0x1296b7=a17_0x31ea58,_0x19e15f=_0x2af8e8[_0x1296b7(0x1d0)][0x0];if(!_0x19e15f)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a17_0x31ea58(0x1da)](_0x16f640){const _0x4925c8=a17_0x31ea58,{options:_0x3734ae,args:_0xfd1b81,tdx:_0xfb4141}=_0x16f640,_0x2aca92=_0xfd1b81[0x0],_0x4a6990=await withSpinner('Getting\x20job\x20results...',()=>_0xfb4141[_0x4925c8(0x1c3)][_0x4925c8(0x1f4)](_0x2aca92),{'verbose':_0x3734ae[_0x4925c8(0x1d2)]}),_0x3c59c0=_0x4a6990[_0x4925c8(0x1cb)];return console['error']('✔\x20Retrieved\x20'+_0x3c59c0['length']+_0x4925c8(0x1f9)+(_0x3c59c0[_0x4925c8(0x1d7)]!==0x1?'s':'')),await handleSDKOutput(_0x3c59c0,_0x3734ae),0x0;}}
1
+ const a17_0x3b9a88=a17_0x491a;(function(_0xfb480b,_0x27ab17){const _0x1f2248=a17_0x491a,_0x35b249=_0xfb480b();while(!![]){try{const _0x436be3=-parseInt(_0x1f2248(0x164))/0x1*(-parseInt(_0x1f2248(0x16f))/0x2)+-parseInt(_0x1f2248(0x14b))/0x3*(-parseInt(_0x1f2248(0x15b))/0x4)+-parseInt(_0x1f2248(0x13b))/0x5*(-parseInt(_0x1f2248(0x178))/0x6)+parseInt(_0x1f2248(0x16b))/0x7*(parseInt(_0x1f2248(0x176))/0x8)+-parseInt(_0x1f2248(0x161))/0x9+parseInt(_0x1f2248(0x14e))/0xa+-parseInt(_0x1f2248(0x152))/0xb*(parseInt(_0x1f2248(0x14f))/0xc);if(_0x436be3===_0x27ab17)break;else _0x35b249['push'](_0x35b249['shift']());}catch(_0x28f2f7){_0x35b249['push'](_0x35b249['shift']());}}}(a17_0xd8fa,0xce4a1));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a17_0x491a(_0x555d83,_0x2c6631){_0x555d83=_0x555d83-0x139;const _0xd8fa98=a17_0xd8fa();let _0x491a09=_0xd8fa98[_0x555d83];return _0x491a09;}import{handleSDKOutput,handleSingleObjectOutput}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';export class JobListCommand extends BaseCommand{[a17_0x3b9a88(0x183)]=a17_0x3b9a88(0x16a);[a17_0x3b9a88(0x16e)]=a17_0x3b9a88(0x151);async[a17_0x3b9a88(0x13f)](_0x3d6e7b){const _0x32ae23=a17_0x3b9a88,{options:_0x105c34,tdx:_0x2e592c}=_0x3d6e7b,_0x27d977=resolveLimit(_0x105c34[_0x32ae23(0x172)],DEFAULT_DISPLAY_LIMIT),_0x368424=_0x105c34['status'];_0x105c34[_0x32ae23(0x163)]&&(console['error'](_0x32ae23(0x150)+_0x27d977+_0x32ae23(0x14c)),_0x368424&&console[_0x32ae23(0x145)]('Status\x20filter:\x20'+_0x368424));const _0x579de0=await withSpinner(_0x32ae23(0x165),()=>_0x2e592c[_0x32ae23(0x16a)][_0x32ae23(0x170)]({'from':0x0,'to':_0x27d977-0x1,'status':_0x368424}),{'verbose':_0x105c34[_0x32ae23(0x163)]}),_0x180fe3=_0x579de0['data'];console[_0x32ae23(0x145)]('✔\x20Found\x20'+_0x180fe3[_0x32ae23(0x159)]+_0x32ae23(0x185)+(_0x180fe3[_0x32ae23(0x159)]!==0x1?'s':''));const _0x5c8cc2=_0x180fe3['map'](_0x2453b5=>{const _0x5a386e=_0x32ae23;let _0x15be1f;if(_0x2453b5[_0x5a386e(0x17f)]&&_0x2453b5[_0x5a386e(0x154)]){const _0x468326=new Date(_0x2453b5[_0x5a386e(0x17f)])[_0x5a386e(0x16c)](),_0x49c1a9=new Date(_0x2453b5[_0x5a386e(0x154)])[_0x5a386e(0x16c)]();_0x15be1f=Math[_0x5a386e(0x173)]((_0x49c1a9-_0x468326)/0x3e8);}return{'job_id':_0x2453b5[_0x5a386e(0x17e)],'type':_0x2453b5[_0x5a386e(0x182)],'status':_0x2453b5[_0x5a386e(0x15d)],'user_name':_0x2453b5['user_name'],'duration_sec':_0x15be1f,'created_at':_0x2453b5[_0x5a386e(0x140)],'started_at':_0x2453b5['start_at'],'end_at':_0x2453b5[_0x5a386e(0x154)]};});return await handleSDKOutput(_0x5c8cc2,_0x105c34),0x0;}}export class JobShowCommand extends BaseCommand{[a17_0x3b9a88(0x183)]=a17_0x3b9a88(0x158);[a17_0x3b9a88(0x16e)]=a17_0x3b9a88(0x17d);[a17_0x3b9a88(0x17a)](_0x4975d7){const _0x8bb476=a17_0x3b9a88,_0x3ce46e=_0x4975d7[_0x8bb476(0x153)][0x0];if(!_0x3ce46e)return _0x8bb476(0x14d);return undefined;}async[a17_0x3b9a88(0x13f)](_0xd93893){const _0x4f3f3f=a17_0x3b9a88,{options:_0x2c62e6,args:_0x40076f,tdx:_0x560c52}=_0xd93893,_0x584e4e=_0x40076f[0x0],_0x733470=await withSpinner('Getting\x20job\x20details...',()=>_0x560c52[_0x4f3f3f(0x16a)][_0x4f3f3f(0x144)](_0x584e4e),{'verbose':_0x2c62e6[_0x4f3f3f(0x163)]}),_0x66993f=_0x733470['data'];let _0x5631a5;if(_0x66993f['start_at']&&_0x66993f['end_at']){const _0xe6a966=new Date(_0x66993f[_0x4f3f3f(0x17f)])[_0x4f3f3f(0x16c)](),_0x1f852f=new Date(_0x66993f[_0x4f3f3f(0x154)])[_0x4f3f3f(0x16c)]();_0x5631a5=Math['round']((_0x1f852f-_0xe6a966)/0x3e8);}const _0x41fd35={'job_id':_0x66993f[_0x4f3f3f(0x17e)],'type':_0x66993f['type'],'status':_0x66993f['status'],..._0x66993f[_0x4f3f3f(0x16d)]&&{'user_name':_0x66993f['user_name']},..._0x5631a5!==undefined&&{'duration_sec':_0x5631a5},..._0x66993f[_0x4f3f3f(0x140)]&&{'created_at':_0x66993f[_0x4f3f3f(0x140)]},..._0x66993f[_0x4f3f3f(0x17f)]&&{'started_at':_0x66993f[_0x4f3f3f(0x17f)]},..._0x66993f[_0x4f3f3f(0x154)]&&{'end_at':_0x66993f['end_at']},..._0x66993f[_0x4f3f3f(0x162)]&&{'database':_0x66993f[_0x4f3f3f(0x162)]},..._0x66993f[_0x4f3f3f(0x146)]!==undefined&&{'priority':_0x66993f['priority']},..._0x66993f[_0x4f3f3f(0x14a)]&&{'url':_0x66993f[_0x4f3f3f(0x14a)]},..._0x66993f[_0x4f3f3f(0x181)]&&{'query':_0x66993f[_0x4f3f3f(0x181)]},..._0x66993f[_0x4f3f3f(0x142)]&&{'debug':_0x66993f[_0x4f3f3f(0x142)]}};return await handleSingleObjectOutput(_0x41fd35,_0x2c62e6),0x0;}}export class JobKillCommand extends BaseCommand{[a17_0x3b9a88(0x183)]='job:kill';[a17_0x3b9a88(0x16e)]=a17_0x3b9a88(0x147);[a17_0x3b9a88(0x17a)](_0x102aca){const _0x1d2a5c=a17_0x3b9a88,_0x3d8e68=_0x102aca[_0x1d2a5c(0x153)][0x0];if(!_0x3d8e68)return _0x1d2a5c(0x171);return undefined;}async[a17_0x3b9a88(0x13f)](_0x4642f5){const _0x339460=a17_0x3b9a88,{options:_0x48c12a,args:_0x13df11,tdx:_0x5c37b7}=_0x4642f5,_0x3555ad=_0x13df11[0x0];if(!_0x48c12a['yes']){const _0x5eba09=await confirm(_0x339460(0x13c)+_0x3555ad+'?');if(!_0x5eba09)return console[_0x339460(0x145)]('Cancelled'),0x0;}return await withSpinner(_0x339460(0x139),()=>_0x5c37b7[_0x339460(0x16a)][_0x339460(0x160)](_0x3555ad),{'verbose':_0x48c12a[_0x339460(0x163)]}),console[_0x339460(0x145)]('✔\x20Kill\x20request\x20submitted\x20for\x20job\x20'+_0x3555ad),console[_0x339460(0x145)](_0x339460(0x177)+_0x3555ad+_0x339460(0x175)),0x0;}}function a17_0xd8fa(){const _0x5075ed=['\x20\x20Job\x20ID:\x20','jobType','jobs','1101534TrsBGe','getTime','user_name','description','2jdASEQ','list','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','limit','round','Query:\x20','\x27\x20to\x20verify\x20the\x20job\x20status','64TMwwyd','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','7338XrmiZY','Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','validate','Getting\x20job\x20results...','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','Show\x20job\x20details','job_id','start_at','INVALID_ARGUMENT','query','type','name','Submitting\x20job...','\x20job','Submitting\x20kill\x20request...','result','5140smfKSt','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','execute','created_at','\x20row','debug','...','show','error','priority','Kill\x20a\x20job','data','job:result','url','37047LfiURL','\x20jobs','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','7248670CNGyki','52248516KUGEkL','Limit:\x20','List\x20jobs','11oQfYlz','args','end_at','hive','Get\x20job\x20results','Job\x20type:\x20','job:show','length','Database:\x20','316eeVKcB','job:submit','status','Submit\x20a\x20job','submit','kill','3410460Rbgwzf','database','verbose','1361366XaBuyg','Listing\x20jobs...','file','trino'];a17_0xd8fa=function(){return _0x5075ed;};return a17_0xd8fa();}export class JobSubmitCommand extends BaseCommand{[a17_0x3b9a88(0x183)]=a17_0x3b9a88(0x15c);[a17_0x3b9a88(0x16e)]=a17_0x3b9a88(0x15e);async[a17_0x3b9a88(0x13f)](_0x1ebc9f){const _0x397760=a17_0x3b9a88,{options:_0x139629,args:_0xbd6dbb,tdx:_0x28eefe}=_0x1ebc9f,_0x1a9d3c=_0x139629[_0x397760(0x169)]||_0x397760(0x167),_0x1a0e2d=_0x139629[_0x397760(0x166)],_0x1d2ea9=_0x139629[_0x397760(0x162)]||'information_schema';if(_0x1a9d3c!=='trino'&&_0x1a9d3c!==_0x397760(0x155))throw new SDKError(ErrorCode[_0x397760(0x180)],_0x397760(0x13e));let _0x2c88d0;if(_0x1a0e2d){if(_0xbd6dbb[0x0])throw new SDKError(ErrorCode[_0x397760(0x180)],_0x397760(0x17c));const _0x42dd7c=readSqlStatementsFromFile(_0x1a0e2d);if(_0x42dd7c[_0x397760(0x159)]===0x0)throw new SDKError(ErrorCode[_0x397760(0x180)],'No\x20SQL\x20statements\x20found\x20in\x20file');if(_0x42dd7c[_0x397760(0x159)]>0x1)throw new SDKError(ErrorCode[_0x397760(0x180)],_0x397760(0x179));_0x2c88d0=_0x42dd7c[0x0];}else{if(!_0xbd6dbb[0x0])throw new SDKError(ErrorCode[_0x397760(0x180)],_0x397760(0x13d));_0x2c88d0=_0xbd6dbb[0x0];}_0x139629[_0x397760(0x163)]&&(console[_0x397760(0x145)](_0x397760(0x157)+_0x1a9d3c),console[_0x397760(0x145)](_0x397760(0x15a)+_0x1d2ea9),console['error'](_0x397760(0x174)+_0x2c88d0['substring'](0x0,0x64)+(_0x2c88d0[_0x397760(0x159)]>0x64?_0x397760(0x143):'')));const _0x250db9=await withSpinner(_0x397760(0x184),()=>_0x28eefe[_0x397760(0x16a)][_0x397760(0x15f)](_0x1d2ea9,_0x2c88d0,_0x1a9d3c),{'verbose':_0x139629[_0x397760(0x163)]}),_0x1bcf96=_0x250db9[_0x397760(0x148)];return console[_0x397760(0x145)]('✔\x20Job\x20submitted'),console['error'](_0x397760(0x168)+_0x1bcf96[_0x397760(0x17e)]),await handleSDKOutput([_0x1bcf96],_0x139629),0x0;}}export class JobResultCommand extends BaseCommand{[a17_0x3b9a88(0x183)]=a17_0x3b9a88(0x149);[a17_0x3b9a88(0x16e)]=a17_0x3b9a88(0x156);[a17_0x3b9a88(0x17a)](_0x1c1fa6){const _0xbc1bb1=a17_0x3b9a88,_0x13f4cf=_0x1c1fa6[_0xbc1bb1(0x153)][0x0];if(!_0x13f4cf)return'Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>';return undefined;}async[a17_0x3b9a88(0x13f)](_0x2d6fb8){const _0x178776=a17_0x3b9a88,{options:_0x5d0ea5,args:_0x6cea83,tdx:_0x34012b}=_0x2d6fb8,_0x5acde7=_0x6cea83[0x0],_0x5df752=await withSpinner(_0x178776(0x17b),()=>_0x34012b[_0x178776(0x16a)][_0x178776(0x13a)](_0x5acde7),{'verbose':_0x5d0ea5['verbose']}),_0x45b9eb=_0x5df752[_0x178776(0x148)];return console[_0x178776(0x145)]('✔\x20Retrieved\x20'+_0x45b9eb[_0x178776(0x159)]+_0x178776(0x141)+(_0x45b9eb[_0x178776(0x159)]!==0x1?'s':'')),await handleSDKOutput(_0x45b9eb,_0x5d0ea5),0x0;}}
@@ -1 +1 @@
1
- const a18_0x1fcda0=a18_0x4108;(function(_0x45304c,_0x3c6e82){const _0x1401aa=a18_0x4108,_0x4207e1=_0x45304c();while(!![]){try{const _0x474a88=-parseInt(_0x1401aa(0x180))/0x1+parseInt(_0x1401aa(0x16f))/0x2+parseInt(_0x1401aa(0x1b8))/0x3+-parseInt(_0x1401aa(0x1a0))/0x4*(parseInt(_0x1401aa(0x143))/0x5)+parseInt(_0x1401aa(0x1fd))/0x6+-parseInt(_0x1401aa(0x1e2))/0x7+parseInt(_0x1401aa(0x1d1))/0x8;if(_0x474a88===_0x3c6e82)break;else _0x4207e1['push'](_0x4207e1['shift']());}catch(_0x3805a8){_0x4207e1['push'](_0x4207e1['shift']());}}}(a18_0x41af,0xab710));import a18_0x3c81c0 from'chalk';import a18_0x13943b from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{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';function a18_0x4108(_0x5c50c4,_0x1a6a37){_0x5c50c4=_0x5c50c4-0x13c;const _0x41afc2=a18_0x41af();let _0x4108cf=_0x41afc2[_0x5c50c4];return _0x4108cf;}import{hyperlink}from'../sdk/util/formatters.js';function a18_0x41af(){const _0x22ae6e=['Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','error','journey:resume','segmentName','folderPath','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','archived','getStatistics','totalEntered','sort','session','3356217XJFAFt','red','log','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','\x20files?','map','✔\x20All\x20files\x20are\x20up\x20to\x20date','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)','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','entered','parentSegment','Resolved\x20YAML\x20file:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','No\x20statistics\x20available\x20for\x20journey:\x20','cyan','filter','rule','connection','Resolving\x20journey...','Getting\x20journey\x20statistics...','Listing\x20folders...','filePath','\x20\x20Parent\x20segment:\x20','Fetching\x20parent\x20segment...','segmentPushCommand','10030920HGYqTE','description','hasChanges','(paused)','journeyName','dryRun','Listing\x20journeys...','verbose','journey:view','Usage:\x20journey\x20pause\x20<name-or-path>','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','resolveJourneyId','Usage:\x20journey\x20stats\x20<name-or-path>','yellow','user','state','(archived)','3650927juoQqZ','toLowerCase','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','launched','replace','kind','parent_segment','(running)','folderId','helpText','-\x20no\x20files\x20written','...','site','blue','\x20\x20Folder\x20path:\x20','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','dim','\x22\x20paused','Pattern:\x20','Journey\x20name:\x20','utf-8','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','activation_','\x20->\x20','has','stages','get','3469428MEJELh','reentryMode','diff','options','versionNumber','/j/da','totalGoalAchieved','Pausing\x20journey...','entries','audienceId','.yml','no_parent','Error:\x20Journey\x20not\x20found:\x20','\x20\x20-\x20','getActivation','paused','\x20\x20Target:\x20','base','activationParams','✔\x20Found\x20','push','web','Target\x20directory:\x20','conversionRate','✔\x20Journey\x20\x22','all','(root)','\x0aError:','\x20\x20Name:\x20','\x20versions)','9035PWVIiq','stageName','data','journeyId','file','Warning:\x20Could\x20not\x20resolve\x20segment\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','journey:pause','segment','isNew','INVALID_ARGUMENT','relative','goal','Pause\x20a\x20running\x20journey','Fetching\x20','localeCompare','Resume\x20a\x20paused\x20journey','listJourneysFromParentSegment','/app/ps/','/e/','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','args','✔\x20Context\x20set:\x20','rootFolderId','Target\x20file:\x20','\x20\x20Consolidating\x20duplicate\x20segment:\x20','\x27\x20not\x20found\x20in\x20','No\x20journeys\x20found','table','pause','listFolders','journey','includeStats','journeyBundleName','Error:\x20Parent\x20segment\x20context\x20required','Fetching\x20users\x20for\x20email\x20resolution...','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20journey\x20files\x20to\x20','format','Warning:\x20Could\x20not\x20resolve\x20activation\x20','add','journeys','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','164900yArqNP','Aborted.','values','find','/j/da/je','Options:','Show\x20journey\x20details','goalRate','journeyBundleId','\x0aPull\x20summary:','\x20journeys','yes','targetDir','journey:list','getParentFull','setPhase','Parent\x20segment:\x20','1393897febPMh','set','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','Input:\x20','\x20=\x20','Cancelled','Export\x20journey(s)\x20as\x20YAML\x20files','journeyStages','then','join','attributes','green','root\x20folder','cwd','relativePath','segments','buildIdToEmailMap','resolveSegment','getSegment','content','message','size','execute','exited','Resuming\x20journey...','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','\x20changed\x20files','Show\x20journey\x20statistics','List\x20journeys\x20in\x20current\x20context','resolveParentId','Error:\x20','920IAqMxj','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','length','population','repeat','type','resume','stage','name','\x20unchanged\x20files','connector_config','Resolving\x20parent\x20segment...','\x22\x20resumed'];a18_0x41af=function(){return _0x22ae6e;};return a18_0x41af();}function formatJourneyState(_0x6d5d24){const _0x9ff456=a18_0x4108;switch(_0x6d5d24){case _0x9ff456(0x1e5):return a18_0x3c81c0[_0x9ff456(0x18b)](_0x9ff456(0x1e9));case'draft':return a18_0x3c81c0[_0x9ff456(0x1f2)]('(draft)');case _0x9ff456(0x20c):return a18_0x3c81c0[_0x9ff456(0x1de)](_0x9ff456(0x1d4));case'completed':return a18_0x3c81c0[_0x9ff456(0x1ef)]('(completed)');case _0x9ff456(0x1b3):return a18_0x3c81c0[_0x9ff456(0x1f2)](_0x9ff456(0x1e1));default:return'('+_0x6d5d24+')';}}function formatJourneyItem(_0x518113,_0xa35ab7='',_0x4de690){const _0x1a51a2=a18_0x4108,_0x570b7d=formatJourneyState(_0x518113[_0x1a51a2(0x1e0)]),_0x11ac8c=_0x4de690?hyperlink(_0x518113['journeyBundleName'],_0x4de690):_0x518113[_0x1a51a2(0x164)];return _0xa35ab7+'🗺️\x20'+_0x11ac8c+'\x20'+_0x570b7d;}function escapeRegex(_0x3eea8a){const _0x27d02d=a18_0x4108;return _0x3eea8a[_0x27d02d(0x1e6)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}function globToRegex(_0x337b41){const _0x27bee8=a18_0x4108,_0x50851b=_0x337b41['split']('*')[_0x27bee8(0x1bd)](escapeRegex);return new RegExp(_0x50851b[_0x27bee8(0x189)]('.*'),'i');}function buildRuleToNameMapping(_0x1a2a4e){const _0x21517b=a18_0x4108,_0x39f4b1=new Map();if(_0x1a2a4e[_0x21517b(0x18f)])for(const [_0x36e0aa,_0x4546d7]of Object[_0x21517b(0x205)](_0x1a2a4e['segments'])){if(_0x4546d7['rule']){const _0x2698ae=serializeRule(_0x4546d7[_0x21517b(0x1c8)]),_0x2ab7c5=_0x39f4b1['get'](_0x2698ae);_0x2ab7c5?_0x2ab7c5['push'](_0x36e0aa):_0x39f4b1[_0x21517b(0x181)](_0x2698ae,[_0x36e0aa]);}}return _0x39f4b1;}async function resolveJourneyTarget(_0x37f029,_0x5be165,_0x33c1ad){const _0x33b26a=a18_0x4108;if(isYamlFilePath(_0x37f029))try{const _0x392b01=await resolveYamlFilePath(_0x37f029);return _0x33c1ad&&(console[_0x33b26a(0x1ae)](_0x33b26a(0x1c3)+_0x37f029),console[_0x33b26a(0x1ae)](_0x33b26a(0x1ce)+_0x392b01[_0x33b26a(0x1c2)]),console[_0x33b26a(0x1ae)](_0x33b26a(0x141)+_0x392b01[_0x33b26a(0x1b0)]),console['error'](_0x33b26a(0x1f0)+(_0x392b01[_0x33b26a(0x1b1)]||_0x33b26a(0x13f)))),{'journeyName':_0x392b01[_0x33b26a(0x1b0)],'parentSegment':_0x392b01[_0x33b26a(0x1c2)],'resolved':_0x392b01};}catch(_0x570932){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x33b26a(0x199)+_0x570932['message']);}if(!_0x5be165)throw new SDKError(ErrorCode[_0x33b26a(0x14d)],_0x33b26a(0x167));return{'journeyName':_0x37f029,'parentSegment':_0x5be165};}export class JourneyListCommand extends BaseCommand{[a18_0x1fcda0(0x1a8)]=a18_0x1fcda0(0x17c);[a18_0x1fcda0(0x1d2)]=a18_0x1fcda0(0x19d);async['execute'](_0x5ed6fc){const _0x4184df=a18_0x1fcda0,{options:_0x47342f,args:_0x5f51e5,tdx:_0x520536}=_0x5ed6fc,_0x1b5d7f=_0x5f51e5[0x0],_0x481da0=_0x47342f[_0x4184df(0x1c2)];if(!_0x481da0)return console[_0x4184df(0x1ae)](_0x4184df(0x165)),console[_0x4184df(0x1ae)](_0x4184df(0x1c0)),0x1;const _0x480f34=await withSpinner(_0x4184df(0x1ab),()=>_0x520536[_0x4184df(0x14b)]['resolveParentId'](_0x481da0),{'verbose':_0x47342f[_0x4184df(0x1d8)]}),_0x23184f=_0x480f34[_0x4184df(0x145)];_0x47342f['verbose']&&(console[_0x4184df(0x1ae)](_0x4184df(0x17f)+_0x481da0+'\x20(ID:\x20'+_0x23184f+')'),_0x1b5d7f&&console[_0x4184df(0x1ae)](_0x4184df(0x1f4)+_0x1b5d7f));const _0x36e38a=await withSpinner(_0x4184df(0x1cf),()=>_0x520536[_0x4184df(0x14b)][_0x4184df(0x17d)](_0x23184f),{'verbose':_0x47342f[_0x4184df(0x1d8)]}),_0x29c84b=_0x36e38a[_0x4184df(0x145)],_0x3cd158=_0x29c84b[_0x4184df(0x15a)],_0x2d0278=await withSpinner('Listing\x20journeys...',()=>_0x520536[_0x4184df(0x162)]['listJourneysWithFolders'](_0x23184f,_0x3cd158),{'verbose':_0x47342f['verbose']});let _0x9dbfc9=_0x2d0278[_0x4184df(0x145)][_0x4184df(0x16c)];const _0x5306cc=_0x2d0278[_0x4184df(0x145)]['folders'],_0x174783=new Map();for(const _0x3442fe of _0x5306cc){_0x174783[_0x4184df(0x181)](_0x3442fe['id'],_0x3442fe[_0x4184df(0x1a8)]);}if(_0x1b5d7f){const _0x20950d=globToRegex(_0x1b5d7f);_0x9dbfc9=_0x9dbfc9[_0x4184df(0x1c7)](_0x5230a4=>_0x20950d['test'](_0x5230a4[_0x4184df(0x164)]));}console['error'](_0x4184df(0x210)+_0x9dbfc9[_0x4184df(0x1a2)]+'\x20journey'+(_0x9dbfc9[_0x4184df(0x1a2)]!==0x1?'s':''));const _0xcdb66a=_0x19b660=>{const _0x1caa68=_0x4184df;return getConsoleNextUrl(_0x47342f[_0x1caa68(0x1ee)],'/app/ps/'+_0x23184f+_0x1caa68(0x156)+_0x19b660+_0x1caa68(0x202));};if(_0x47342f[_0x4184df(0x169)]===_0x4184df(0x15f))await handleSDKOutput(_0x9dbfc9,_0x47342f);else{if(_0x47342f[_0x4184df(0x169)]==='json'){const _0x12ead5=_0x9dbfc9['map'](_0x32f0e2=>({..._0x32f0e2,'url':_0xcdb66a(_0x32f0e2['id'])}));await handleSDKOutput(_0x12ead5,_0x47342f);}else{console[_0x4184df(0x1ba)]('['+_0x481da0+']');const _0x293f12=new Map(),_0x173b66=[];for(const _0x150eb2 of _0x9dbfc9){if(!_0x150eb2[_0x4184df(0x1ea)]||_0x150eb2[_0x4184df(0x1ea)]===_0x3cd158)_0x173b66[_0x4184df(0x211)](_0x150eb2);else{const _0x31bd2b=_0x293f12['get'](_0x150eb2[_0x4184df(0x1ea)])||[];_0x31bd2b[_0x4184df(0x211)](_0x150eb2),_0x293f12[_0x4184df(0x181)](_0x150eb2[_0x4184df(0x1ea)],_0x31bd2b);}}const _0x568fda=(_0x2f6cc1,_0x51fa39)=>_0x2f6cc1[_0x4184df(0x164)][_0x4184df(0x152)](_0x51fa39[_0x4184df(0x164)],undefined,{'sensitivity':_0x4184df(0x20e)});_0x173b66[_0x4184df(0x1b6)](_0x568fda);for(const _0x537507 of _0x173b66){console[_0x4184df(0x1ba)](formatJourneyItem(_0x537507,'',_0xcdb66a(_0x537507['id'])));}const _0x82947d=[..._0x293f12['entries']()]['sort']((_0x1222c4,_0x25ee16)=>{const _0xd33c10=_0x4184df,_0x4abdc3=_0x174783[_0xd33c10(0x1fc)](_0x1222c4[0x0])||_0x1222c4[0x0],_0x2220dc=_0x174783[_0xd33c10(0x1fc)](_0x25ee16[0x0])||_0x25ee16[0x0];return _0x4abdc3[_0xd33c10(0x152)](_0x2220dc,undefined,{'sensitivity':'base'});});for(const [_0x448f01,_0x1cc381]of _0x82947d){const _0x64d767=_0x174783[_0x4184df(0x1fc)](_0x448f01)||_0x448f01;console[_0x4184df(0x1ba)]('📁\x20'+_0x64d767),_0x1cc381['sort'](_0x568fda);for(const _0x3aee02 of _0x1cc381){console['log'](formatJourneyItem(_0x3aee02,'\x20\x20',_0xcdb66a(_0x3aee02['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']=a18_0x1fcda0(0x1d9);[a18_0x1fcda0(0x1d2)]=a18_0x1fcda0(0x175);async[a18_0x1fcda0(0x196)](_0x4cd948){const _0x2f08e9=a18_0x1fcda0,{options:_0x323d8a,args:_0x28be4e,tdx:_0x9ccf82}=_0x4cd948,_0x2a42e1=_0x28be4e[0x0];if(!_0x2a42e1)return console['error'](_0x2f08e9(0x1b2)),console[_0x2f08e9(0x1ae)](_0x2f08e9(0x1db)),console[_0x2f08e9(0x1ae)](_0x2f08e9(0x174)),console[_0x2f08e9(0x1ae)](_0x2f08e9(0x1bb)),0x1;_0x323d8a[_0x2f08e9(0x1d8)]&&console[_0x2f08e9(0x1ae)](_0x2f08e9(0x183)+_0x2a42e1);const _0x39de46=await resolveJourneyTarget(_0x2a42e1,_0x323d8a['parentSegment'],_0x323d8a[_0x2f08e9(0x1d8)]),_0x4dae22=await withSpinner(_0x2f08e9(0x1ab),()=>_0x9ccf82[_0x2f08e9(0x14b)][_0x2f08e9(0x19e)](_0x39de46[_0x2f08e9(0x1c2)]),{'verbose':_0x323d8a[_0x2f08e9(0x1d8)]}),_0x18cf2a=_0x4dae22[_0x2f08e9(0x145)],_0x13539a=await withSpinner(_0x2f08e9(0x1ca),()=>_0x9ccf82[_0x2f08e9(0x162)][_0x2f08e9(0x1dc)](_0x18cf2a,_0x39de46[_0x2f08e9(0x1d5)]),{'verbose':_0x323d8a[_0x2f08e9(0x1d8)]}),_0x164f86=_0x13539a['data'];if(_0x323d8a[_0x2f08e9(0x212)]){const _0x19b433=getConsoleNextUrl(_0x323d8a['site'],'/app/ps/'+_0x18cf2a+'/e/'+_0x164f86+_0x2f08e9(0x173));return console[_0x2f08e9(0x1ae)](a18_0x3c81c0[_0x2f08e9(0x18b)]('✔')+'\x20Opening\x20'+a18_0x3c81c0['cyan'](_0x19b433)),openBrowser(_0x19b433),0x0;}const _0x116fc7=await withSpinner('Getting\x20journey\x20details...',()=>_0x9ccf82[_0x2f08e9(0x162)]['getJourney'](_0x164f86),{'verbose':_0x323d8a['verbose']}),_0x4a20b3=_0x116fc7[_0x2f08e9(0x145)],_0x236b7e=_0x323d8a[_0x2f08e9(0x163)];let _0x3cf420;if(_0x236b7e)try{const _0x4f0646=await withSpinner(_0x2f08e9(0x1cb),()=>_0x9ccf82[_0x2f08e9(0x162)][_0x2f08e9(0x1b4)](_0x164f86),{'verbose':_0x323d8a[_0x2f08e9(0x1d8)]});_0x3cf420=_0x4f0646[_0x2f08e9(0x145)];}catch{_0x323d8a['verbose']&&console['error']('\x20\x20Statistics\x20not\x20available');}const _0x540032=getConsoleNextUrl(_0x323d8a[_0x2f08e9(0x1ee)],_0x2f08e9(0x155)+_0x18cf2a+_0x2f08e9(0x156)+_0x164f86+_0x2f08e9(0x173)),_0x5d50e2={'id':_0x4a20b3['id'],'name':_0x4a20b3[_0x2f08e9(0x18a)][_0x2f08e9(0x1a8)],'description':_0x4a20b3['attributes'][_0x2f08e9(0x1d2)],'state':_0x4a20b3[_0x2f08e9(0x18a)]['state'],'paused':_0x4a20b3[_0x2f08e9(0x18a)]['paused'],'reentry_mode':_0x4a20b3[_0x2f08e9(0x18a)][_0x2f08e9(0x1fe)],'stages':_0x4a20b3[_0x2f08e9(0x18a)][_0x2f08e9(0x187)]?.['length']||0x0,..._0x4a20b3[_0x2f08e9(0x18a)][_0x2f08e9(0x14f)]&&{'goal':_0x4a20b3[_0x2f08e9(0x18a)][_0x2f08e9(0x14f)][_0x2f08e9(0x1a8)]},..._0x3cf420&&{'statistics':{'total_entered':_0x3cf420[_0x2f08e9(0x1b5)],'goal_achieved':_0x3cf420[_0x2f08e9(0x203)],'goal_rate':_0x3cf420[_0x2f08e9(0x176)],'stages':_0x3cf420[_0x2f08e9(0x1fb)]}},'url':_0x540032};return await handleSingleObjectOutput(_0x5d50e2,_0x323d8a),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a18_0x1fcda0(0x1a8)]='journey:stats';[a18_0x1fcda0(0x1d2)]=a18_0x1fcda0(0x19c);async['execute'](_0x940373){const _0x4ecff3=a18_0x1fcda0,{options:_0x400cdc,args:_0x2a74c6,tdx:_0x5c87da}=_0x940373,_0x3fb295=_0x2a74c6[0x0];if(!_0x3fb295)return console[_0x4ecff3(0x1ae)](_0x4ecff3(0x1b2)),console['error'](_0x4ecff3(0x1dd)),0x1;_0x400cdc[_0x4ecff3(0x1d8)]&&console[_0x4ecff3(0x1ae)](_0x4ecff3(0x183)+_0x3fb295);const _0x26a3f3=await resolveJourneyTarget(_0x3fb295,_0x400cdc[_0x4ecff3(0x1c2)],_0x400cdc[_0x4ecff3(0x1d8)]),_0x589c2b=await withSpinner(_0x4ecff3(0x1ab),()=>_0x5c87da['segment'][_0x4ecff3(0x19e)](_0x26a3f3['parentSegment']),{'verbose':_0x400cdc[_0x4ecff3(0x1d8)]}),_0x5950e0=_0x589c2b[_0x4ecff3(0x145)],_0x442bfb=await withSpinner('Resolving\x20journey...',()=>_0x5c87da[_0x4ecff3(0x162)][_0x4ecff3(0x1dc)](_0x5950e0,_0x26a3f3[_0x4ecff3(0x1d5)]),{'verbose':_0x400cdc['verbose']}),_0x16c4eb=_0x442bfb[_0x4ecff3(0x145)],_0x4235c0=await withSpinner('Getting\x20journey\x20statistics...',()=>_0x5c87da['journey']['getStatistics'](_0x16c4eb),{'verbose':_0x400cdc[_0x4ecff3(0x1d8)]}),_0x306336=_0x4235c0[_0x4ecff3(0x145)];if(!_0x306336||_0x306336[_0x4ecff3(0x146)]===null)return console[_0x4ecff3(0x1ae)](_0x4ecff3(0x1c5)+_0x26a3f3[_0x4ecff3(0x1d5)]),console[_0x4ecff3(0x1ae)](_0x4ecff3(0x1e4)),0x0;const _0x16476f={'journey_id':_0x306336[_0x4ecff3(0x146)],'total_entered':_0x306336['totalEntered'],'goal_achieved':_0x306336[_0x4ecff3(0x203)],'goal_rate':_0x306336[_0x4ecff3(0x176)],'stages':_0x306336[_0x4ecff3(0x1fb)]?.[_0x4ecff3(0x1bd)](_0x39325d=>({'name':_0x39325d['stageName'],'population':_0x39325d['population'],'entered':_0x39325d[_0x4ecff3(0x1c1)],'exited':_0x39325d[_0x4ecff3(0x197)],'conversion_rate':_0x39325d[_0x4ecff3(0x13c)]}))},_0x5e59cb=_0x400cdc[_0x4ecff3(0x1a7)];if(_0x5e59cb&&_0x306336[_0x4ecff3(0x1fb)]){const _0x5006b6=_0x306336[_0x4ecff3(0x1fb)]['find'](_0x163ea3=>_0x163ea3[_0x4ecff3(0x144)][_0x4ecff3(0x1e3)]()===_0x5e59cb[_0x4ecff3(0x1e3)]());if(_0x5006b6)return await handleSingleObjectOutput({'stage_name':_0x5006b6['stageName'],'population':_0x5006b6[_0x4ecff3(0x1a3)],'entered':_0x5006b6[_0x4ecff3(0x1c1)],'exited':_0x5006b6[_0x4ecff3(0x197)],'conversion_rate':_0x5006b6[_0x4ecff3(0x13c)]},_0x400cdc),0x0;console[_0x4ecff3(0x1ae)]('Warning:\x20Stage\x20\x22'+_0x5e59cb+'\x22\x20not\x20found');}return await handleSingleObjectOutput(_0x16476f,_0x400cdc),0x0;}}export class JourneyPauseCommand extends BaseCommand{['name']=a18_0x1fcda0(0x14a);[a18_0x1fcda0(0x1d2)]=a18_0x1fcda0(0x150);async['execute'](_0x4d6aef){const _0x354515=a18_0x1fcda0,{options:_0x43dc8d,args:_0x146c86,tdx:_0x41977f}=_0x4d6aef,_0x5192d3=_0x146c86[0x0];if(!_0x5192d3)return console[_0x354515(0x1ae)](_0x354515(0x1b2)),console[_0x354515(0x1ae)](_0x354515(0x1da)),0x1;_0x43dc8d[_0x354515(0x1d8)]&&console['error'](_0x354515(0x183)+_0x5192d3);const _0xdb3ef5=await resolveJourneyTarget(_0x5192d3,_0x43dc8d[_0x354515(0x1c2)],_0x43dc8d[_0x354515(0x1d8)]),_0x595285=await withSpinner(_0x354515(0x1ab),()=>_0x41977f[_0x354515(0x14b)][_0x354515(0x19e)](_0xdb3ef5[_0x354515(0x1c2)]),{'verbose':_0x43dc8d[_0x354515(0x1d8)]}),_0x11ef66=_0x595285[_0x354515(0x145)],_0x23a243=await withSpinner(_0x354515(0x1ca),()=>_0x41977f['journey'][_0x354515(0x1dc)](_0x11ef66,_0xdb3ef5[_0x354515(0x1d5)]),{'verbose':_0x43dc8d[_0x354515(0x1d8)]}),_0x5997e2=_0x23a243[_0x354515(0x145)];if(!_0x43dc8d[_0x354515(0x17a)]){const _0x374a89=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0xdb3ef5[_0x354515(0x1d5)]+'\x22?');if(!_0x374a89)return console[_0x354515(0x1ae)]('Cancelled'),0x0;}const _0x4a7096=await withSpinner(_0x354515(0x204),()=>_0x41977f[_0x354515(0x162)][_0x354515(0x160)](_0x5997e2),{'verbose':_0x43dc8d['verbose']}),_0x470e61=_0x4a7096[_0x354515(0x145)];return console[_0x354515(0x1ae)](_0x354515(0x13d)+_0x470e61[_0x354515(0x18a)][_0x354515(0x1a8)]+_0x354515(0x1f3)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a18_0x1fcda0(0x1a8)]=a18_0x1fcda0(0x1af);['description']=a18_0x1fcda0(0x153);async['execute'](_0x6e961){const _0xb54807=a18_0x1fcda0,{options:_0x51e37f,args:_0x1e1bfc,tdx:_0x437fb5}=_0x6e961,_0x5825d4=_0x1e1bfc[0x0];if(!_0x5825d4)return console['error'](_0xb54807(0x1b2)),console[_0xb54807(0x1ae)]('Usage:\x20journey\x20resume\x20<name-or-path>'),0x1;_0x51e37f[_0xb54807(0x1d8)]&&console[_0xb54807(0x1ae)]('Input:\x20'+_0x5825d4);const _0x3ebb81=await resolveJourneyTarget(_0x5825d4,_0x51e37f[_0xb54807(0x1c2)],_0x51e37f[_0xb54807(0x1d8)]),_0x35d3a6=await withSpinner(_0xb54807(0x1ab),()=>_0x437fb5[_0xb54807(0x14b)]['resolveParentId'](_0x3ebb81['parentSegment']),{'verbose':_0x51e37f[_0xb54807(0x1d8)]}),_0x1ae15d=_0x35d3a6[_0xb54807(0x145)],_0x53c521=await withSpinner(_0xb54807(0x1ca),()=>_0x437fb5['journey'][_0xb54807(0x1dc)](_0x1ae15d,_0x3ebb81[_0xb54807(0x1d5)]),{'verbose':_0x51e37f['verbose']}),_0x3ccde1=_0x53c521['data'];if(!_0x51e37f[_0xb54807(0x17a)]){const _0x272d5e=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22'+_0x3ebb81[_0xb54807(0x1d5)]+'\x22?');if(!_0x272d5e)return console[_0xb54807(0x1ae)](_0xb54807(0x185)),0x0;}const _0x45b5f3=await withSpinner(_0xb54807(0x198),()=>_0x437fb5[_0xb54807(0x162)][_0xb54807(0x1a6)](_0x3ccde1),{'verbose':_0x51e37f[_0xb54807(0x1d8)]}),_0x303a98=_0x45b5f3['data'];return console[_0xb54807(0x1ae)](_0xb54807(0x13d)+_0x303a98['attributes'][_0xb54807(0x1a8)]+_0xb54807(0x1ac)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a18_0x1fcda0(0x1a8)]='journey:pull';[a18_0x1fcda0(0x1d2)]=a18_0x1fcda0(0x186);async[a18_0x1fcda0(0x196)](_0x299048){const _0x241f21=a18_0x1fcda0,{options:_0x16c8cf,args:_0x5e5739,tdx:_0x473619}=_0x299048,_0x12933f=_0x16c8cf,_0x4c041e=_0x5e5739[0x0],_0xc72ceb=_0x4c041e&&isYamlFilePath(_0x4c041e),_0x2634db=await resolveTarget({'arg':_0xc72ceb?_0x4c041e:undefined,'contextParent':_0x16c8cf['parentSegment'],'cwd':process[_0x241f21(0x18d)]()});if(!isSuccessfulResolution(_0x2634db))return _0x2634db['errorCode']===_0x241f21(0x208)?(console[_0x241f21(0x1ae)](a18_0x3c81c0[_0x241f21(0x1de)](_0x241f21(0x1a1))),console['error'](_0x241f21(0x1bf)),console[_0x241f21(0x1ae)](_0x241f21(0x149)),console[_0x241f21(0x1ae)](_0x241f21(0x157)),console['error'](_0x241f21(0x1f1))):(console[_0x241f21(0x1ae)](a18_0x3c81c0['red'](_0x241f21(0x19f)+_0x2634db[_0x241f21(0x194)]+'\x0a')),_0x2634db[_0x241f21(0x1eb)]&&console[_0x241f21(0x1ae)](a18_0x3c81c0[_0x241f21(0x1c6)](_0x2634db['helpText']))),0x1;let _0x2f3133=_0xc72ceb?undefined:_0x4c041e,_0x56bf9f,_0x2f3823;_0x2634db[_0x241f21(0x1a5)]===_0x241f21(0x147)&&(_0x2f3133=_0x2634db['resourceName'],_0x56bf9f=_0x2634db[_0x241f21(0x1cd)],_0x2f3823=_0x2634db['folderPath']);const _0x4ef883=_0x2634db['parentName'],_0x43ec8b=_0x2634db[_0x241f21(0x17b)];_0x12933f[_0x241f21(0x1d8)]&&(console[_0x241f21(0x1ae)]('Parent\x20segment:\x20'+_0x4ef883),console[_0x241f21(0x1ae)](_0x241f21(0x213)+_0x43ec8b),_0x2f3133&&console[_0x241f21(0x1ae)](_0x241f21(0x1f5)+_0x2f3133),_0x56bf9f&&console[_0x241f21(0x1ae)](_0x241f21(0x15b)+_0x56bf9f),_0x2f3823&&console[_0x241f21(0x1ae)]('Folder\x20path:\x20'+_0x2f3823));const _0x54d960=await withSpinner(_0x241f21(0x1ab),()=>_0x473619[_0x241f21(0x14b)][_0x241f21(0x19e)](_0x4ef883),{'verbose':_0x16c8cf[_0x241f21(0x1d8)]}),_0x2331e8=_0x54d960['data'],[_0xbeda95,_0x151327]=await Promise[_0x241f21(0x13e)]([withSpinner(_0x241f21(0x1d7),()=>_0x473619[_0x241f21(0x162)][_0x241f21(0x154)](_0x2331e8,undefined,{'includeAllVersions':!![]}),{'verbose':_0x16c8cf[_0x241f21(0x1d8)]}),withSpinner(_0x241f21(0x1cc),()=>_0x473619[_0x241f21(0x14b)][_0x241f21(0x161)](_0x2331e8),{'verbose':_0x16c8cf[_0x241f21(0x1d8)]})]);let _0x420d7c=_0xbeda95[_0x241f21(0x145)];const _0x2d2863=_0x151327['data'],_0x40d022=buildFolderIdToPathMap(_0x2d2863);if(_0x2f3133){const _0x37a667=_0x420d7c[_0x241f21(0x1c7)](_0x4b0709=>_0x4b0709[_0x241f21(0x164)][_0x241f21(0x1e3)]()===_0x2f3133[_0x241f21(0x1e3)]());if(_0x37a667[_0x241f21(0x1a2)]===0x0)return console[_0x241f21(0x1ae)](_0x241f21(0x209)+_0x2f3133),console[_0x241f21(0x1ae)](_0x241f21(0x182)),0x1;_0x420d7c=_0x37a667;}if(_0x2f3823!==undefined){const _0x4c9b52=_0x420d7c[_0x241f21(0x1c7)](_0xe4f3c8=>{const _0x48cbf7=_0x241f21,_0x158f53=_0xe4f3c8[_0x48cbf7(0x1ea)]?_0x40d022[_0x48cbf7(0x1fc)](_0xe4f3c8[_0x48cbf7(0x1ea)])||'':'';return _0x158f53===_0x2f3823;});if(_0x4c9b52[_0x241f21(0x1a2)]===0x0&&_0x420d7c[_0x241f21(0x1a2)]>0x0){console['error']('Error:\x20Journey\x20\x27'+_0x2f3133+_0x241f21(0x15d)+(_0x2f3823||_0x241f21(0x18c))),console['error'](_0x241f21(0x1f7));for(const _0x53c92f of _0x420d7c){const _0x4bc1c0=_0x53c92f[_0x241f21(0x1ea)]?_0x40d022['get'](_0x53c92f[_0x241f21(0x1ea)])||'':'';console[_0x241f21(0x1ae)](_0x241f21(0x20a)+(_0x4bc1c0||_0x241f21(0x13f))+'/'+_0x53c92f['journeyBundleName']);}return 0x1;}_0x420d7c=_0x4c9b52;}if(_0x420d7c[_0x241f21(0x1a2)]===0x0)return console[_0x241f21(0x1ae)](_0x241f21(0x15e)),0x0;const _0x3e17ce=new Map();for(const _0x1e805a of _0x420d7c){const _0x59262f=_0x1e805a[_0x241f21(0x177)];!_0x3e17ce[_0x241f21(0x1fa)](_0x59262f)&&_0x3e17ce[_0x241f21(0x181)](_0x59262f,[]),_0x3e17ce[_0x241f21(0x1fc)](_0x59262f)['push'](_0x1e805a);}for(const _0x1dec8f of _0x3e17ce[_0x241f21(0x171)]()){_0x1dec8f[_0x241f21(0x1b6)]((_0x32fdf2,_0xc646d)=>(_0x32fdf2[_0x241f21(0x201)]||0x0)-(_0xc646d[_0x241f21(0x201)]||0x0));}const _0x53ee3c=[],[_0x3bd76c,_0x76435b]=await Promise[_0x241f21(0x13e)]([withSpinner(_0x241f21(0x166),()=>_0x473619[_0x241f21(0x1df)][_0x241f21(0x190)](),{'verbose':_0x16c8cf[_0x241f21(0x1d8)]})['then'](_0x33614a=>_0x33614a[_0x241f21(0x145)]),withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',()=>_0x473619[_0x241f21(0x1c9)]['buildIdToNameMap'](),{'verbose':_0x16c8cf[_0x241f21(0x1d8)]})[_0x241f21(0x188)](_0x1ca6df=>_0x1ca6df[_0x241f21(0x145)])]);for(const _0xab0ff4 of _0x3e17ce[_0x241f21(0x171)]()){const _0x280e75=_0xab0ff4[0x0][_0x241f21(0x164)],_0x3c2349=_0xab0ff4[0x0][_0x241f21(0x1ea)],_0x3beec5=_0x3c2349?_0x40d022[_0x241f21(0x1fc)](_0x3c2349)||'':'',_0x31a84e=_0x3beec5?a18_0x13943b[_0x241f21(0x189)](_0x43ec8b,_0x3beec5):_0x43ec8b,_0x47fc15=_0x56bf9f||a18_0x13943b[_0x241f21(0x189)](_0x31a84e,sanitizeFileName(_0x280e75)+_0x241f21(0x207));let _0x2bdb0b,_0x2639d5;if(existsSync(_0x47fc15))try{const _0xdfe212=readFileSync(_0x47fc15,_0x241f21(0x1f6)),_0x503205=parseYamlString(_0xdfe212);_0x2639d5=_0x503205,_0x2bdb0b=buildRuleToNameMapping(_0x503205),_0x12933f[_0x241f21(0x1d8)]&&_0x2bdb0b['size']>0x0&&console['error']('Found\x20'+_0x2bdb0b[_0x241f21(0x195)]+_0x241f21(0x19a)+_0x280e75);}catch(_0x8abc34){_0x12933f[_0x241f21(0x1d8)]&&console['error'](_0x241f21(0x16d)+_0x8abc34[_0x241f21(0x194)]);}const _0x11400e=[],_0x212a13=new Set(),_0x9fc070=new Map(),_0xd39302=new Map(),_0xd668ee=new Set(),_0x36c109=new Map(),_0x3cc289=new Map(),_0x330bce=createJumpTargetCache();await withProgressSpinner(_0x241f21(0x151)+_0x280e75+_0x241f21(0x1ed),async _0x338970=>{const _0x1ab43f=_0x241f21;for(const _0x123fc2 of _0xab0ff4){const _0x80e394=_0xab0ff4['length']>0x1?_0x123fc2[_0x1ab43f(0x164)]+'\x20v'+(_0x123fc2['versionNumber']||0x1):_0x123fc2['journeyBundleName'];_0x338970[_0x1ab43f(0x17e)](_0x1ab43f(0x151)+_0x80e394);const _0x1c1abe=await _0x473619[_0x1ab43f(0x162)]['getJourney'](_0x123fc2['id']),_0x2b6a98=_0x1c1abe[_0x1ab43f(0x18a)]?.[_0x1ab43f(0x206)],_0x1efb0c={'resolveSegment':async _0x41973b=>{const _0x17b35e=_0x1ab43f;if(!_0x2b6a98)return{'name':_0x41973b,'isJourneyLocal':![]};const _0x1bbe12=_0x9fc070[_0x17b35e(0x1fc)](_0x41973b);if(_0x1bbe12)return _0x1bbe12;try{const _0x3bda31=await _0x473619[_0x17b35e(0x14b)][_0x17b35e(0x192)](_0x2b6a98,_0x41973b),_0x66d269=_0x3bda31[_0x17b35e(0x1e7)]===SEGMENT_KIND_JOURNEY;let _0x51052c,_0x3d89a8=_0x3bda31[_0x17b35e(0x1a8)];if(_0x66d269&&_0x3bda31['rule']){const _0x3828af=await segmentResponseToDef(_0x3bda31,{'resolveSegmentName':async _0x14dd54=>{const _0x2fe29a=_0x17b35e,_0x3dbceb=_0x9fc070['get'](_0x14dd54);if(_0x3dbceb)return _0x3dbceb[_0x2fe29a(0x1a8)];const _0x16e01e=await _0x1efb0c[_0x2fe29a(0x191)](_0x14dd54);return _0x16e01e[_0x2fe29a(0x1a8)];}}),_0x3efd9f=_0x3828af[_0x17b35e(0x1c8)];_0x51052c={'description':_0x3bda31['description'],'rule':_0x3efd9f};const _0x5e8ea7=serializeRule(_0x3efd9f),_0x313543=_0xd39302['get'](_0x5e8ea7);if(_0x313543)_0x3d89a8=_0x313543,_0x51052c=undefined,_0x12933f[_0x17b35e(0x1d8)]&&console[_0x17b35e(0x1ae)](_0x17b35e(0x15c)+_0x3bda31[_0x17b35e(0x1a8)]+_0x17b35e(0x1f9)+_0x313543);else{let _0x590394=![];if(_0x2bdb0b){const _0x43a9c5=_0x2bdb0b[_0x17b35e(0x1fc)](_0x5e8ea7);if(_0x43a9c5){const _0x1e3312=_0x43a9c5[_0x17b35e(0x172)](_0x3eaf58=>!_0x212a13[_0x17b35e(0x1fa)](_0x3eaf58));_0x1e3312&&(_0x3d89a8=_0x1e3312,_0x212a13[_0x17b35e(0x16b)](_0x1e3312),_0xd39302[_0x17b35e(0x181)](_0x5e8ea7,_0x1e3312),_0x590394=!![],_0x12933f[_0x17b35e(0x1d8)]&&console[_0x17b35e(0x1ae)]('\x20\x20Preserving\x20local\x20segment\x20name:\x20'+_0x1e3312+'\x20(rule\x20match)'));}}if(!_0x590394){const _0x18a175=generateJourneyLocalName(_0x3bda31[_0x17b35e(0x1a8)]);_0x18a175&&(_0x3d89a8=_0x18a175);let _0xbcaf47=_0x3d89a8,_0x57cc9a=0x2;while(_0x212a13[_0x17b35e(0x1fa)](_0xbcaf47)){_0xbcaf47=_0x3d89a8+'_'+_0x57cc9a,_0x57cc9a++;}_0x212a13[_0x17b35e(0x16b)](_0xbcaf47),_0xd39302['set'](_0x5e8ea7,_0xbcaf47),_0x3d89a8=_0xbcaf47;}}}const _0x30f422={'name':_0x3d89a8,'isJourneyLocal':_0x66d269,'definition':_0x51052c};return _0x9fc070[_0x17b35e(0x181)](_0x41973b,_0x30f422),_0x30f422;}catch(_0x3992a2){return _0x16c8cf[_0x17b35e(0x1d8)]&&console[_0x17b35e(0x1ae)](_0x17b35e(0x148)+_0x41973b+':\x20'+_0x3992a2[_0x17b35e(0x194)]),{'name':_0x41973b,'isJourneyLocal':![]};}},'resolveActivation':async _0x55bfd3=>{const _0x3c2281=_0x1ab43f,_0x56a495=_0x36c109[_0x3c2281(0x1fc)](_0x55bfd3);if(_0x56a495)return _0x56a495;try{const _0x1e3f65=await _0x473619[_0x3c2281(0x162)][_0x3c2281(0x20b)](_0x123fc2['id'],_0x55bfd3),_0x3fe6e5=journeyActivationStepToYaml(_0x1e3f65,_0x3bd76c,_0x76435b),_0x1b2e66=JSON['stringify']({'name':_0x3fe6e5[_0x3c2281(0x1a8)],'connection':_0x3fe6e5[_0x3c2281(0x1c9)],'connector_config':_0x3fe6e5[_0x3c2281(0x1aa)]}),_0xd91727=_0x3cc289[_0x3c2281(0x1fc)](_0x1b2e66);if(_0xd91727){const _0x4bc674={'name':_0xd91727,'isJourneyLocal':!![],'definition':_0x3fe6e5};return _0x36c109[_0x3c2281(0x181)](_0x55bfd3,_0x4bc674),_0x4bc674;}const _0x1f94e7=_0x1e3f65[_0x3c2281(0x18a)][_0x3c2281(0x20f)][_0x3c2281(0x1a8)]||_0x55bfd3,_0x500ab8=sanitizeYamlKey(_0x1f94e7)||_0x3c2281(0x1f8)+_0x55bfd3;let _0x4a526a=_0x500ab8,_0x138a81=0x2;while(_0xd668ee[_0x3c2281(0x1fa)](_0x4a526a)){_0x4a526a=_0x500ab8+'_'+_0x138a81,_0x138a81++;}_0xd668ee[_0x3c2281(0x16b)](_0x4a526a),_0x3cc289[_0x3c2281(0x181)](_0x1b2e66,_0x4a526a);const _0x52c6e0={'name':_0x4a526a,'isJourneyLocal':!![],'definition':_0x3fe6e5};return _0x36c109['set'](_0x55bfd3,_0x52c6e0),_0x52c6e0;}catch(_0x16a487){return _0x16c8cf[_0x3c2281(0x1d8)]&&console[_0x3c2281(0x1ae)](_0x3c2281(0x16a)+_0x55bfd3+':\x20'+_0x16a487[_0x3c2281(0x194)]),{'name':_0x55bfd3,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x15268d,_0x596734)=>{return resolveJumpTarget(_0x15268d,_0x596734,_0x330bce,_0x4789b8=>_0x473619['journey']['getJourney'](_0x4789b8));}},_0x3cf728=await journeyResponseToDef(_0x1c1abe,_0x1efb0c);_0x11400e[_0x1ab43f(0x211)]({'item':_0x123fc2,'yaml':_0x3cf728});}},{'verbose':_0x16c8cf[_0x241f21(0x1d8)]});const _0x461b92=buildMergedJourneyDef(_0x11400e,_0x2bdb0b),_0x1aeaa1=normalizeJourneyDef(_0x461b92,_0x2639d5),_0x5789f0=toYamlString(_0x1aeaa1),_0x41e65d=_0x56bf9f||a18_0x13943b[_0x241f21(0x189)](_0x31a84e,sanitizeFileName(_0x280e75)+_0x241f21(0x207));!_0x56bf9f&&_0x3beec5&&!existsSync(_0x31a84e)&&mkdirSync(_0x31a84e,{'recursive':!![]});const _0x1c6f04=a18_0x13943b[_0x241f21(0x14e)](process[_0x241f21(0x18d)](),_0x41e65d);if(existsSync(_0x41e65d)){const _0x357c2f=readFileSync(_0x41e65d,'utf-8'),_0x2f17ee=generateDiff(_0x357c2f,_0x5789f0),_0x71c0b2=hasChanges(_0x2f17ee);_0x53ee3c[_0x241f21(0x211)]({'relativePath':_0x1c6f04,'absolutePath':_0x41e65d,'content':_0x5789f0,'isNew':![],'hasChanges':_0x71c0b2,'diff':_0x71c0b2?formatDiffWithColors(_0x2f17ee):undefined});}else _0x53ee3c[_0x241f21(0x211)]({'relativePath':_0x1c6f04,'absolutePath':_0x41e65d,'content':_0x5789f0,'isNew':!![],'hasChanges':![]});}const _0x539ef2=_0x53ee3c[_0x241f21(0x1c7)](_0x279aa4=>_0x279aa4[_0x241f21(0x14c)]),_0xab10cf=_0x53ee3c['filter'](_0xdfc600=>!_0xdfc600[_0x241f21(0x14c)]&&_0xdfc600[_0x241f21(0x1d3)]),_0x10b13d=_0x53ee3c[_0x241f21(0x1c7)](_0x285fbe=>!_0x285fbe['isNew']&&!_0x285fbe[_0x241f21(0x1d3)]),_0x451fe5=_0x420d7c[_0x241f21(0x1a2)],_0x3c1f94=_0x3e17ce[_0x241f21(0x195)],_0x1067bb=_0x451fe5>_0x3c1f94?'\x20('+_0x451fe5+_0x241f21(0x142):'';console[_0x241f21(0x1ae)](_0x241f21(0x178)),console[_0x241f21(0x1ae)]('\x20\x20'+a18_0x3c81c0['cyan'](_0x3c1f94+_0x241f21(0x179))+a18_0x3c81c0[_0x241f21(0x1f2)](_0x1067bb)),console[_0x241f21(0x1ae)]('\x20\x20'+a18_0x3c81c0['green']('+\x20'+_0x539ef2['length']+'\x20new\x20files')),console[_0x241f21(0x1ae)]('\x20\x20'+a18_0x3c81c0[_0x241f21(0x1de)]('~\x20'+_0xab10cf[_0x241f21(0x1a2)]+_0x241f21(0x19b))),console['error']('\x20\x20'+a18_0x3c81c0[_0x241f21(0x1f2)]('=\x20'+_0x10b13d[_0x241f21(0x1a2)]+_0x241f21(0x1a9))),console[_0x241f21(0x1ae)](_0x241f21(0x20d)+a18_0x3c81c0['cyan'](_0x43ec8b)+'\x0a');if(_0xab10cf[_0x241f21(0x1a2)]>0x0)for(const _0x306b01 of _0xab10cf){console[_0x241f21(0x1ae)]('\x0aChanges\x20to\x20\x27'+_0x306b01[_0x241f21(0x18e)]+'\x27:'),console[_0x241f21(0x1ae)]('─'[_0x241f21(0x1a4)](0x3c)),console[_0x241f21(0x1ae)](_0x306b01[_0x241f21(0x1ff)]),console[_0x241f21(0x1ae)]('─'[_0x241f21(0x1a4)](0x3c));}if(_0x12933f[_0x241f21(0x1d6)])return console[_0x241f21(0x1ae)](a18_0x3c81c0[_0x241f21(0x1de)](_0x241f21(0x16e))),0x0;if(_0x539ef2[_0x241f21(0x1a2)]===0x0&&_0xab10cf[_0x241f21(0x1a2)]===0x0)return console[_0x241f21(0x1ae)](a18_0x3c81c0['green'](_0x241f21(0x1be))),saveSessionContext({'parent_segment':_0x4ef883},_0x12933f[_0x241f21(0x1b7)]),console[_0x241f21(0x1ae)](a18_0x3c81c0['green'](_0x241f21(0x159)+a18_0x3c81c0[_0x241f21(0x1f2)]('parent_segment')+_0x241f21(0x184)+a18_0x3c81c0[_0x241f21(0x1c6)](_0x4ef883))),0x0;if(!_0x12933f[_0x241f21(0x17a)]&&(_0x539ef2[_0x241f21(0x1a2)]>0x0||_0xab10cf['length']>0x0)){if(!isInteractive())return console['error'](a18_0x3c81c0[_0x241f21(0x1b9)](_0x241f21(0x140)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a18_0x3c81c0[_0x241f21(0x1f2)](_0x241f21(0x1c4))),0x1;const _0x146988=await confirmKey('Write\x20'+(_0x539ef2[_0x241f21(0x1a2)]+_0xab10cf[_0x241f21(0x1a2)])+_0x241f21(0x1bc));if(!_0x146988)return console['error'](a18_0x3c81c0[_0x241f21(0x1de)](_0x241f21(0x170)),_0x241f21(0x1ec)),0x1;}!existsSync(_0x43ec8b)&&mkdirSync(_0x43ec8b,{'recursive':!![]});for(const _0x59971c of _0x53ee3c){(_0x59971c['isNew']||_0x59971c[_0x241f21(0x1d3)])&&writeFileSync(_0x59971c['absolutePath'],_0x59971c[_0x241f21(0x193)],_0x241f21(0x1f6));}return console['error'](a18_0x3c81c0[_0x241f21(0x18b)]('✔\x20Pulled\x20'+(_0x539ef2[_0x241f21(0x1a2)]+_0xab10cf['length'])+_0x241f21(0x168)+_0x43ec8b)),saveSessionContext({'parent_segment':_0x4ef883},_0x12933f[_0x241f21(0x1b7)]),console[_0x241f21(0x1ae)](a18_0x3c81c0[_0x241f21(0x18b)](_0x241f21(0x159)+a18_0x3c81c0['dim'](_0x241f21(0x1e8))+_0x241f21(0x184)+a18_0x3c81c0[_0x241f21(0x1c6)](_0x4ef883))),0x0;}}export class JourneyPushCommand extends BaseCommand{[a18_0x1fcda0(0x1a8)]='journey:push';[a18_0x1fcda0(0x1d2)]=a18_0x1fcda0(0x1ad);[a18_0x1fcda0(0x1d0)]=new SegmentPushCommand();async[a18_0x1fcda0(0x196)](_0x8c38f4){const _0x4d31cc=a18_0x1fcda0,_0x21b053=_0x8c38f4[_0x4d31cc(0x158)][0x0];let _0x8327df;if(_0x21b053){const _0x311d88=await resolveTarget({'arg':_0x21b053,'contextParent':_0x8c38f4[_0x4d31cc(0x200)][_0x4d31cc(0x1c2)],'cwd':process[_0x4d31cc(0x18d)]()});isSuccessfulResolution(_0x311d88)&&_0x311d88[_0x4d31cc(0x1a5)]===_0x4d31cc(0x147)&&(_0x8327df=_0x311d88[_0x4d31cc(0x1cd)]);}const _0x2cec8f={..._0x8c38f4,'options':{..._0x8c38f4['options'],'journeysOnly':!![],..._0x8327df&&{'singleFilePath':_0x8327df}}};return this[_0x4d31cc(0x1d0)]['execute'](_0x2cec8f);}}
1
+ const a18_0x3c18e6=a18_0x328f;(function(_0x3402c3,_0x2dc7a7){const _0x50105d=a18_0x328f,_0x3ecedc=_0x3402c3();while(!![]){try{const _0x42bfa9=parseInt(_0x50105d(0x228))/0x1*(-parseInt(_0x50105d(0x244))/0x2)+-parseInt(_0x50105d(0x1dd))/0x3*(parseInt(_0x50105d(0x20b))/0x4)+parseInt(_0x50105d(0x23e))/0x5+-parseInt(_0x50105d(0x250))/0x6*(parseInt(_0x50105d(0x21e))/0x7)+-parseInt(_0x50105d(0x18b))/0x8+parseInt(_0x50105d(0x183))/0x9+-parseInt(_0x50105d(0x18c))/0xa*(-parseInt(_0x50105d(0x188))/0xb);if(_0x42bfa9===_0x2dc7a7)break;else _0x3ecedc['push'](_0x3ecedc['shift']());}catch(_0x1e28b1){_0x3ecedc['push'](_0x3ecedc['shift']());}}}(a18_0x1049,0x571c5));import a18_0x54cf4b from'chalk';import a18_0x146da4 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{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 formatJourneyState(_0x29ed41){const _0x12397b=a18_0x328f;switch(_0x29ed41){case _0x12397b(0x1f7):return a18_0x54cf4b[_0x12397b(0x254)](_0x12397b(0x1fb));case _0x12397b(0x1ba):return a18_0x54cf4b['dim']('(draft)');case _0x12397b(0x21d):return a18_0x54cf4b['yellow']('(paused)');case _0x12397b(0x24f):return a18_0x54cf4b[_0x12397b(0x1e2)](_0x12397b(0x1c2));case _0x12397b(0x1b1):return a18_0x54cf4b[_0x12397b(0x1c4)]('(archived)');default:return'('+_0x29ed41+')';}}function a18_0x1049(){const _0x2d646e=['segments','Getting\x20journey\x20details...','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','journey:list','json','goalRate','then','Listing\x20journeys...','\x20journey\x20files\x20to\x20','/app/ps/','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','isNew','population','journey:pause','map','root\x20folder','find','table','goal','Options:','\x20new\x20files','journey:resume','✔\x20Pulled\x20','entries','conversionRate','Found\x20','INVALID_ARGUMENT','.yml','\x22\x20not\x20found','hasChanges','journey:push','description','journey:view','segment','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','stringify','archived','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20=\x20','activationParams','base','folderPath','\x20\x20Preserving\x20local\x20segment\x20name:\x20','format','\x20\x20Target:\x20','draft','getParentFull','Pattern:\x20','journeyBundleName','getActivation','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','relative','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','(completed)','-\x20no\x20files\x20written','dim','🗺️\x20','verbose','size','resolveJourneyId','Target\x20directory:\x20','Aborted.','parentSegment','user','journeyId','listFolders','Error:\x20Parent\x20segment\x20context\x20required','\x20\x20Consolidating\x20duplicate\x20segment:\x20','Usage:\x20journey\x20pause\x20<name-or-path>','yes','\x22\x20resumed','length','Error:\x20Journey\x20\x27','\x20(ID:\x20','Resolving\x20journey...','has','folderId','parent_segment','activation_','stage','262869RXhdiB','✔\x20Journey\x20\x22','Warning:\x20Could\x20not\x20resolve\x20segment\x20','sort','connector_config','blue','Folder\x20path:\x20','exited','\x20\x20Folder\x20path:\x20','localeCompare','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)','type','\x20->\x20','file','totalEntered','\x20journey','get','getStatistics','\x20changed\x20files','versionNumber','cyan','Pausing\x20journey...','journeyBundleId','all','Pause\x20a\x20running\x20journey','Target\x20file:\x20','launched','no_parent','set','repeat','(running)','add','✔\x20Found\x20','stageName','Resolved\x20YAML\x20file:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','\x22\x20paused','errorCode','(root)','absolutePath','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','filter','Usage:\x20journey\x20resume\x20<name-or-path>','/j/da/je','cwd','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','4HLelDd','\x20\x20Name:\x20','Input:\x20','\x0aChanges\x20to\x20\x27','push','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','Cancelled','resume','log','No\x20journeys\x20found','execute','folders','resolveSegment','session','journeyName','rootFolderId','journey','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','paused','1784594yeKzMF','totalGoalAchieved','stages','\x20\x20Parent\x20segment:\x20','journey:stats','segmentPushCommand','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','parentName','join','✔\x20Context\x20set:\x20','537808gsXslJ','...','helpText','includeStats','site','options','filePath','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','values','args','error','Fetching\x20','\x20unchanged\x20files','data','/j/da','\x20journeys','attributes','\x20segment\x20rule(s)\x20to\x20match\x20for\x20','Getting\x20journey\x20statistics...','\x20\x20Statistics\x20not\x20available','buildIdToEmailMap','listJourneysFromParentSegment','1251255WQsmZM','getJourney','Parent\x20segment:\x20','split','\x20Opening\x20','Fetching\x20connections\x20for\x20name\x20resolution...','2yQMOpc','entered','connection','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','toLowerCase','red','journeys','message','📁\x20','\x0aError:','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','completed','6tdWcgu','Write\x20','Usage:\x20journey\x20stats\x20<name-or-path>','replace','green','name','test','state','buildIdToNameMap','kind','Resolving\x20parent\x20segment...','journeyStages','resolveParentId','journey:pull','yellow','4142169REITnn','rule','Fetching\x20parent\x20segment...','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','9074846ZrteCp','/e/','\x27\x20not\x20found\x20in\x20','2386400BNLkad','10tbaOBy'];a18_0x1049=function(){return _0x2d646e;};return a18_0x1049();}function formatJourneyItem(_0x5eb86c,_0x4189db='',_0x1bacf5){const _0x140e78=a18_0x328f,_0x6c2c6f=formatJourneyState(_0x5eb86c[_0x140e78(0x257)]),_0x43fdd5=_0x1bacf5?hyperlink(_0x5eb86c[_0x140e78(0x1bd)],_0x1bacf5):_0x5eb86c[_0x140e78(0x1bd)];return _0x4189db+_0x140e78(0x1c5)+_0x43fdd5+'\x20'+_0x6c2c6f;}function escapeRegex(_0x4b848f){const _0x379b5a=a18_0x328f;return _0x4b848f[_0x379b5a(0x253)](/[.*+?^${}()|[\]\\]/g,'\x5c$&');}function globToRegex(_0x3f0cc6){const _0x4f7f1e=a18_0x328f,_0x4697dd=_0x3f0cc6[_0x4f7f1e(0x241)]('*')['map'](escapeRegex);return new RegExp(_0x4697dd[_0x4f7f1e(0x226)]('.*'),'i');}function buildRuleToNameMapping(_0x1b0acf){const _0x254a6d=a18_0x328f,_0x3de1ee=new Map();if(_0x1b0acf[_0x254a6d(0x18d)])for(const [_0x31728b,_0x4959d0]of Object[_0x254a6d(0x1a4)](_0x1b0acf['segments'])){if(_0x4959d0[_0x254a6d(0x184)]){const _0x387fc5=serializeRule(_0x4959d0[_0x254a6d(0x184)]),_0x2d5eb5=_0x3de1ee[_0x254a6d(0x1ed)](_0x387fc5);_0x2d5eb5?_0x2d5eb5['push'](_0x31728b):_0x3de1ee['set'](_0x387fc5,[_0x31728b]);}}return _0x3de1ee;}async function resolveJourneyTarget(_0xc81cd,_0x51f370,_0x39a3e7){const _0x1468eb=a18_0x328f;if(isYamlFilePath(_0xc81cd))try{const _0xdc8fd2=await resolveYamlFilePath(_0xc81cd);return _0x39a3e7&&(console[_0x1468eb(0x232)](_0x1468eb(0x1ff)+_0xc81cd),console['error'](_0x1468eb(0x221)+_0xdc8fd2[_0x1468eb(0x1cb)]),console[_0x1468eb(0x232)](_0x1468eb(0x20c)+_0xdc8fd2['segmentName']),console[_0x1468eb(0x232)](_0x1468eb(0x1e5)+(_0xdc8fd2[_0x1468eb(0x1b6)]||_0x1468eb(0x203)))),{'journeyName':_0xdc8fd2['segmentName'],'parentSegment':_0xdc8fd2[_0x1468eb(0x1cb)],'resolved':_0xdc8fd2};}catch(_0x39907a){throw new SDKError(ErrorCode[_0x1468eb(0x1a7)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x39907a['message']);}if(!_0x51f370)throw new SDKError(ErrorCode[_0x1468eb(0x1a7)],_0x1468eb(0x197));return{'journeyName':_0xc81cd,'parentSegment':_0x51f370};}export class JourneyListCommand extends BaseCommand{['name']=a18_0x3c18e6(0x190);[a18_0x3c18e6(0x1ac)]='List\x20journeys\x20in\x20current\x20context';async[a18_0x3c18e6(0x215)](_0x51e512){const _0x513748=a18_0x3c18e6,{options:_0x20a27f,args:_0x42d05a,tdx:_0x91733c}=_0x51e512,_0x49950d=_0x42d05a[0x0],_0x636f42=_0x20a27f[_0x513748(0x1cb)];if(!_0x636f42)return console['error'](_0x513748(0x1cf)),console[_0x513748(0x232)]('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x19b4d8=await withSpinner(_0x513748(0x25a),()=>_0x91733c['segment'][_0x513748(0x25c)](_0x636f42),{'verbose':_0x20a27f[_0x513748(0x1c6)]}),_0x44917e=_0x19b4d8[_0x513748(0x235)];_0x20a27f[_0x513748(0x1c6)]&&(console[_0x513748(0x232)](_0x513748(0x240)+_0x636f42+_0x513748(0x1d6)+_0x44917e+')'),_0x49950d&&console['error'](_0x513748(0x1bc)+_0x49950d));const _0x6d721a=await withSpinner(_0x513748(0x185),()=>_0x91733c[_0x513748(0x1ae)][_0x513748(0x1bb)](_0x44917e),{'verbose':_0x20a27f['verbose']}),_0x32c725=_0x6d721a[_0x513748(0x235)],_0x12afe7=_0x32c725[_0x513748(0x21a)],_0x3b45a5=await withSpinner(_0x513748(0x194),()=>_0x91733c[_0x513748(0x21b)]['listJourneysWithFolders'](_0x44917e,_0x12afe7),{'verbose':_0x20a27f[_0x513748(0x1c6)]});let _0x4f2f91=_0x3b45a5[_0x513748(0x235)][_0x513748(0x24a)];const _0x41f637=_0x3b45a5[_0x513748(0x235)][_0x513748(0x216)],_0x163b3a=new Map();for(const _0x2cffd5 of _0x41f637){_0x163b3a[_0x513748(0x1f9)](_0x2cffd5['id'],_0x2cffd5[_0x513748(0x255)]);}if(_0x49950d){const _0x328fef=globToRegex(_0x49950d);_0x4f2f91=_0x4f2f91[_0x513748(0x206)](_0x54753b=>_0x328fef[_0x513748(0x256)](_0x54753b[_0x513748(0x1bd)]));}console[_0x513748(0x232)](_0x513748(0x1fd)+_0x4f2f91[_0x513748(0x1d4)]+_0x513748(0x1ec)+(_0x4f2f91[_0x513748(0x1d4)]!==0x1?'s':''));const _0x5e184d=_0x9fa90=>{const _0x544bac=_0x513748;return getConsoleNextUrl(_0x20a27f[_0x544bac(0x22c)],'/app/ps/'+_0x44917e+'/e/'+_0x9fa90+_0x544bac(0x236));};if(_0x20a27f[_0x513748(0x1b8)]===_0x513748(0x19e))await handleSDKOutput(_0x4f2f91,_0x20a27f);else{if(_0x20a27f['format']===_0x513748(0x191)){const _0x26942a=_0x4f2f91[_0x513748(0x19b)](_0x12d81f=>({..._0x12d81f,'url':_0x5e184d(_0x12d81f['id'])}));await handleSDKOutput(_0x26942a,_0x20a27f);}else{console['log']('['+_0x636f42+']');const _0x5f5493=new Map(),_0x268bc7=[];for(const _0x58d51b of _0x4f2f91){if(!_0x58d51b[_0x513748(0x1d9)]||_0x58d51b[_0x513748(0x1d9)]===_0x12afe7)_0x268bc7[_0x513748(0x20f)](_0x58d51b);else{const _0x3a7014=_0x5f5493[_0x513748(0x1ed)](_0x58d51b[_0x513748(0x1d9)])||[];_0x3a7014[_0x513748(0x20f)](_0x58d51b),_0x5f5493['set'](_0x58d51b['folderId'],_0x3a7014);}}const _0x48d059=(_0x446dc1,_0x32b8cf)=>_0x446dc1['journeyBundleName'][_0x513748(0x1e6)](_0x32b8cf[_0x513748(0x1bd)],undefined,{'sensitivity':'base'});_0x268bc7[_0x513748(0x1e0)](_0x48d059);for(const _0x21be5c of _0x268bc7){console[_0x513748(0x213)](formatJourneyItem(_0x21be5c,'',_0x5e184d(_0x21be5c['id'])));}const _0x4f0110=[..._0x5f5493[_0x513748(0x1a4)]()]['sort']((_0x36d031,_0x389096)=>{const _0x5d6168=_0x513748,_0x39176e=_0x163b3a[_0x5d6168(0x1ed)](_0x36d031[0x0])||_0x36d031[0x0],_0x4a5929=_0x163b3a[_0x5d6168(0x1ed)](_0x389096[0x0])||_0x389096[0x0];return _0x39176e[_0x5d6168(0x1e6)](_0x4a5929,undefined,{'sensitivity':_0x5d6168(0x1b5)});});for(const [_0x4deeab,_0x3b90e1]of _0x4f0110){const _0x5aab99=_0x163b3a[_0x513748(0x1ed)](_0x4deeab)||_0x4deeab;console[_0x513748(0x213)](_0x513748(0x24c)+_0x5aab99),_0x3b90e1[_0x513748(0x1e0)](_0x48d059);for(const _0x2774b9 of _0x3b90e1){console['log'](formatJourneyItem(_0x2774b9,'\x20\x20',_0x5e184d(_0x2774b9['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a18_0x3c18e6(0x255)]=a18_0x3c18e6(0x1ad);[a18_0x3c18e6(0x1ac)]='Show\x20journey\x20details';async[a18_0x3c18e6(0x215)](_0x37d0ef){const _0x3f690a=a18_0x3c18e6,{options:_0x217df7,args:_0x270965,tdx:_0x1208fb}=_0x37d0ef,_0x1634ef=_0x270965[0x0];if(!_0x1634ef)return console[_0x3f690a(0x232)](_0x3f690a(0x1bf)),console['error'](_0x3f690a(0x224)),console[_0x3f690a(0x232)](_0x3f690a(0x1a0)),console[_0x3f690a(0x232)](_0x3f690a(0x1af)),0x1;_0x217df7[_0x3f690a(0x1c6)]&&console[_0x3f690a(0x232)](_0x3f690a(0x20d)+_0x1634ef);const _0xd70d7f=await resolveJourneyTarget(_0x1634ef,_0x217df7[_0x3f690a(0x1cb)],_0x217df7[_0x3f690a(0x1c6)]),_0x291a62=await withSpinner(_0x3f690a(0x25a),()=>_0x1208fb[_0x3f690a(0x1ae)][_0x3f690a(0x25c)](_0xd70d7f[_0x3f690a(0x1cb)]),{'verbose':_0x217df7[_0x3f690a(0x1c6)]}),_0x56643c=_0x291a62[_0x3f690a(0x235)],_0x26dd4a=await withSpinner('Resolving\x20journey...',()=>_0x1208fb[_0x3f690a(0x21b)][_0x3f690a(0x1c8)](_0x56643c,_0xd70d7f['journeyName']),{'verbose':_0x217df7['verbose']}),_0x51370a=_0x26dd4a[_0x3f690a(0x235)];if(_0x217df7['web']){const _0x4acca8=getConsoleNextUrl(_0x217df7['site'],'/app/ps/'+_0x56643c+_0x3f690a(0x189)+_0x51370a+'/j/da/je');return console[_0x3f690a(0x232)](a18_0x54cf4b[_0x3f690a(0x254)]('✔')+_0x3f690a(0x242)+a18_0x54cf4b[_0x3f690a(0x1f1)](_0x4acca8)),openBrowser(_0x4acca8),0x0;}const _0x2d4fcf=await withSpinner(_0x3f690a(0x18e),()=>_0x1208fb['journey'][_0x3f690a(0x23f)](_0x51370a),{'verbose':_0x217df7[_0x3f690a(0x1c6)]}),_0x303a11=_0x2d4fcf[_0x3f690a(0x235)],_0x65109a=_0x217df7[_0x3f690a(0x22b)];let _0x4aa7c7;if(_0x65109a)try{const _0x549485=await withSpinner(_0x3f690a(0x23a),()=>_0x1208fb['journey']['getStatistics'](_0x51370a),{'verbose':_0x217df7[_0x3f690a(0x1c6)]});_0x4aa7c7=_0x549485[_0x3f690a(0x235)];}catch{_0x217df7[_0x3f690a(0x1c6)]&&console[_0x3f690a(0x232)](_0x3f690a(0x23b));}const _0x5cd7df=getConsoleNextUrl(_0x217df7[_0x3f690a(0x22c)],_0x3f690a(0x196)+_0x56643c+'/e/'+_0x51370a+_0x3f690a(0x208)),_0x3a41a6={'id':_0x303a11['id'],'name':_0x303a11[_0x3f690a(0x238)][_0x3f690a(0x255)],'description':_0x303a11[_0x3f690a(0x238)][_0x3f690a(0x1ac)],'state':_0x303a11[_0x3f690a(0x238)]['state'],'paused':_0x303a11[_0x3f690a(0x238)]['paused'],'reentry_mode':_0x303a11['attributes']['reentryMode'],'stages':_0x303a11[_0x3f690a(0x238)][_0x3f690a(0x25b)]?.[_0x3f690a(0x1d4)]||0x0,..._0x303a11[_0x3f690a(0x238)][_0x3f690a(0x19f)]&&{'goal':_0x303a11[_0x3f690a(0x238)]['goal']['name']},..._0x4aa7c7&&{'statistics':{'total_entered':_0x4aa7c7[_0x3f690a(0x1eb)],'goal_achieved':_0x4aa7c7[_0x3f690a(0x21f)],'goal_rate':_0x4aa7c7[_0x3f690a(0x192)],'stages':_0x4aa7c7[_0x3f690a(0x220)]}},'url':_0x5cd7df};return await handleSingleObjectOutput(_0x3a41a6,_0x217df7),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a18_0x3c18e6(0x255)]=a18_0x3c18e6(0x222);[a18_0x3c18e6(0x1ac)]='Show\x20journey\x20statistics';async[a18_0x3c18e6(0x215)](_0x4c5980){const _0x23473a=a18_0x3c18e6,{options:_0x1c692e,args:_0x520587,tdx:_0x1295ff}=_0x4c5980,_0x5667bb=_0x520587[0x0];if(!_0x5667bb)return console[_0x23473a(0x232)](_0x23473a(0x1bf)),console[_0x23473a(0x232)](_0x23473a(0x252)),0x1;_0x1c692e['verbose']&&console[_0x23473a(0x232)]('Input:\x20'+_0x5667bb);const _0x22ed69=await resolveJourneyTarget(_0x5667bb,_0x1c692e[_0x23473a(0x1cb)],_0x1c692e[_0x23473a(0x1c6)]),_0xcffc24=await withSpinner(_0x23473a(0x25a),()=>_0x1295ff[_0x23473a(0x1ae)]['resolveParentId'](_0x22ed69[_0x23473a(0x1cb)]),{'verbose':_0x1c692e[_0x23473a(0x1c6)]}),_0x4cbf04=_0xcffc24[_0x23473a(0x235)],_0x20aee2=await withSpinner(_0x23473a(0x1d7),()=>_0x1295ff['journey'][_0x23473a(0x1c8)](_0x4cbf04,_0x22ed69['journeyName']),{'verbose':_0x1c692e[_0x23473a(0x1c6)]}),_0x339395=_0x20aee2[_0x23473a(0x235)],_0x139648=await withSpinner(_0x23473a(0x23a),()=>_0x1295ff[_0x23473a(0x21b)][_0x23473a(0x1ee)](_0x339395),{'verbose':_0x1c692e[_0x23473a(0x1c6)]}),_0x43eedd=_0x139648[_0x23473a(0x235)];if(!_0x43eedd||_0x43eedd[_0x23473a(0x1cd)]===null)return console[_0x23473a(0x232)]('No\x20statistics\x20available\x20for\x20journey:\x20'+_0x22ed69[_0x23473a(0x219)]),console[_0x23473a(0x232)](_0x23473a(0x20a)),0x0;const _0x226aa7={'journey_id':_0x43eedd[_0x23473a(0x1cd)],'total_entered':_0x43eedd['totalEntered'],'goal_achieved':_0x43eedd[_0x23473a(0x21f)],'goal_rate':_0x43eedd[_0x23473a(0x192)],'stages':_0x43eedd['stages']?.[_0x23473a(0x19b)](_0x1238a5=>({'name':_0x1238a5[_0x23473a(0x1fe)],'population':_0x1238a5[_0x23473a(0x199)],'entered':_0x1238a5[_0x23473a(0x245)],'exited':_0x1238a5[_0x23473a(0x1e4)],'conversion_rate':_0x1238a5[_0x23473a(0x1a5)]}))},_0x500e00=_0x1c692e[_0x23473a(0x1dc)];if(_0x500e00&&_0x43eedd[_0x23473a(0x220)]){const _0x564398=_0x43eedd[_0x23473a(0x220)]['find'](_0x282c96=>_0x282c96[_0x23473a(0x1fe)][_0x23473a(0x248)]()===_0x500e00[_0x23473a(0x248)]());if(_0x564398)return await handleSingleObjectOutput({'stage_name':_0x564398[_0x23473a(0x1fe)],'population':_0x564398[_0x23473a(0x199)],'entered':_0x564398[_0x23473a(0x245)],'exited':_0x564398['exited'],'conversion_rate':_0x564398[_0x23473a(0x1a5)]},_0x1c692e),0x0;console[_0x23473a(0x232)]('Warning:\x20Stage\x20\x22'+_0x500e00+_0x23473a(0x1a9));}return await handleSingleObjectOutput(_0x226aa7,_0x1c692e),0x0;}}export class JourneyPauseCommand extends BaseCommand{[a18_0x3c18e6(0x255)]=a18_0x3c18e6(0x19a);['description']=a18_0x3c18e6(0x1f5);async[a18_0x3c18e6(0x215)](_0x12b288){const _0x333ac1=a18_0x3c18e6,{options:_0x116081,args:_0x127adf,tdx:_0x3d44a1}=_0x12b288,_0x2f3e51=_0x127adf[0x0];if(!_0x2f3e51)return console['error'](_0x333ac1(0x1bf)),console[_0x333ac1(0x232)](_0x333ac1(0x1d1)),0x1;_0x116081[_0x333ac1(0x1c6)]&&console['error'](_0x333ac1(0x20d)+_0x2f3e51);const _0x388968=await resolveJourneyTarget(_0x2f3e51,_0x116081[_0x333ac1(0x1cb)],_0x116081['verbose']),_0x3996c=await withSpinner(_0x333ac1(0x25a),()=>_0x3d44a1['segment'][_0x333ac1(0x25c)](_0x388968[_0x333ac1(0x1cb)]),{'verbose':_0x116081[_0x333ac1(0x1c6)]}),_0x3965f0=_0x3996c['data'],_0x48077d=await withSpinner('Resolving\x20journey...',()=>_0x3d44a1[_0x333ac1(0x21b)]['resolveJourneyId'](_0x3965f0,_0x388968[_0x333ac1(0x219)]),{'verbose':_0x116081[_0x333ac1(0x1c6)]}),_0x49a900=_0x48077d['data'];if(!_0x116081[_0x333ac1(0x1d2)]){const _0x5731ec=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x388968[_0x333ac1(0x219)]+'\x22?');if(!_0x5731ec)return console[_0x333ac1(0x232)](_0x333ac1(0x211)),0x0;}const _0x15183b=await withSpinner(_0x333ac1(0x1f2),()=>_0x3d44a1[_0x333ac1(0x21b)]['pause'](_0x49a900),{'verbose':_0x116081['verbose']}),_0x544c0a=_0x15183b['data'];return console['error'](_0x333ac1(0x1de)+_0x544c0a[_0x333ac1(0x238)][_0x333ac1(0x255)]+_0x333ac1(0x201)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a18_0x3c18e6(0x255)]=a18_0x3c18e6(0x1a2);[a18_0x3c18e6(0x1ac)]='Resume\x20a\x20paused\x20journey';async[a18_0x3c18e6(0x215)](_0x48835a){const _0x2ddbc9=a18_0x3c18e6,{options:_0x22093f,args:_0x3bf760,tdx:_0x13e8a1}=_0x48835a,_0x3e0fef=_0x3bf760[0x0];if(!_0x3e0fef)return console[_0x2ddbc9(0x232)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console['error'](_0x2ddbc9(0x207)),0x1;_0x22093f[_0x2ddbc9(0x1c6)]&&console[_0x2ddbc9(0x232)](_0x2ddbc9(0x20d)+_0x3e0fef);const _0x22ed7d=await resolveJourneyTarget(_0x3e0fef,_0x22093f[_0x2ddbc9(0x1cb)],_0x22093f[_0x2ddbc9(0x1c6)]),_0x47d4a0=await withSpinner(_0x2ddbc9(0x25a),()=>_0x13e8a1[_0x2ddbc9(0x1ae)][_0x2ddbc9(0x25c)](_0x22ed7d[_0x2ddbc9(0x1cb)]),{'verbose':_0x22093f[_0x2ddbc9(0x1c6)]}),_0x3f3dba=_0x47d4a0[_0x2ddbc9(0x235)],_0x4280a0=await withSpinner(_0x2ddbc9(0x1d7),()=>_0x13e8a1[_0x2ddbc9(0x21b)][_0x2ddbc9(0x1c8)](_0x3f3dba,_0x22ed7d[_0x2ddbc9(0x219)]),{'verbose':_0x22093f[_0x2ddbc9(0x1c6)]}),_0xaeb5f6=_0x4280a0[_0x2ddbc9(0x235)];if(!_0x22093f[_0x2ddbc9(0x1d2)]){const _0x30c875=await confirm(_0x2ddbc9(0x22f)+_0x22ed7d[_0x2ddbc9(0x219)]+'\x22?');if(!_0x30c875)return console[_0x2ddbc9(0x232)](_0x2ddbc9(0x211)),0x0;}const _0x5d0320=await withSpinner('Resuming\x20journey...',()=>_0x13e8a1[_0x2ddbc9(0x21b)][_0x2ddbc9(0x212)](_0xaeb5f6),{'verbose':_0x22093f[_0x2ddbc9(0x1c6)]}),_0x5efc53=_0x5d0320[_0x2ddbc9(0x235)];return console['error'](_0x2ddbc9(0x1de)+_0x5efc53[_0x2ddbc9(0x238)][_0x2ddbc9(0x255)]+_0x2ddbc9(0x1d3)),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']=a18_0x3c18e6(0x25d);[a18_0x3c18e6(0x1ac)]='Export\x20journey(s)\x20as\x20YAML\x20files';async['execute'](_0x55ca49){const _0x826ec9=a18_0x3c18e6,{options:_0x404fbf,args:_0x463803,tdx:_0x2134e6}=_0x55ca49,_0x245818=_0x404fbf,_0x231b41=_0x463803[0x0],_0x69e3a1=_0x231b41&&isYamlFilePath(_0x231b41),_0x356dff=await resolveTarget({'arg':_0x69e3a1?_0x231b41:undefined,'contextParent':_0x404fbf[_0x826ec9(0x1cb)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x356dff))return _0x356dff[_0x826ec9(0x202)]===_0x826ec9(0x1f8)?(console[_0x826ec9(0x232)](a18_0x54cf4b[_0x826ec9(0x25e)](_0x826ec9(0x205))),console['error'](_0x826ec9(0x1e7)),console['error'](_0x826ec9(0x186)),console['error'](_0x826ec9(0x200)),console['error'](_0x826ec9(0x18f))):(console['error'](a18_0x54cf4b[_0x826ec9(0x249)]('Error:\x20'+_0x356dff['message']+'\x0a')),_0x356dff[_0x826ec9(0x22a)]&&console['error'](a18_0x54cf4b[_0x826ec9(0x1f1)](_0x356dff[_0x826ec9(0x22a)]))),0x1;let _0x573df8=_0x69e3a1?undefined:_0x231b41,_0x5cbd9c,_0x7ec4f9;_0x356dff[_0x826ec9(0x1e8)]==='file'&&(_0x573df8=_0x356dff['resourceName'],_0x5cbd9c=_0x356dff[_0x826ec9(0x22e)],_0x7ec4f9=_0x356dff[_0x826ec9(0x1b6)]);const _0x20c793=_0x356dff[_0x826ec9(0x225)],_0x4723a8=_0x356dff['targetDir'];_0x245818['verbose']&&(console[_0x826ec9(0x232)](_0x826ec9(0x240)+_0x20c793),console['error'](_0x826ec9(0x1c9)+_0x4723a8),_0x573df8&&console[_0x826ec9(0x232)]('Journey\x20name:\x20'+_0x573df8),_0x5cbd9c&&console[_0x826ec9(0x232)](_0x826ec9(0x1f6)+_0x5cbd9c),_0x7ec4f9&&console[_0x826ec9(0x232)](_0x826ec9(0x1e3)+_0x7ec4f9));const _0x209605=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x2134e6[_0x826ec9(0x1ae)][_0x826ec9(0x25c)](_0x20c793),{'verbose':_0x404fbf[_0x826ec9(0x1c6)]}),_0x421fbb=_0x209605[_0x826ec9(0x235)],[_0x58376e,_0x30b745]=await Promise[_0x826ec9(0x1f4)]([withSpinner('Listing\x20journeys...',()=>_0x2134e6['journey'][_0x826ec9(0x23d)](_0x421fbb,undefined,{'includeAllVersions':!![]}),{'verbose':_0x404fbf[_0x826ec9(0x1c6)]}),withSpinner('Listing\x20folders...',()=>_0x2134e6[_0x826ec9(0x1ae)][_0x826ec9(0x1ce)](_0x421fbb),{'verbose':_0x404fbf[_0x826ec9(0x1c6)]})]);let _0x1ca899=_0x58376e[_0x826ec9(0x235)];const _0x1b61e6=_0x30b745[_0x826ec9(0x235)],_0x17fecb=buildFolderIdToPathMap(_0x1b61e6);if(_0x573df8){const _0xb0d066=_0x1ca899[_0x826ec9(0x206)](_0x3c4e67=>_0x3c4e67[_0x826ec9(0x1bd)]['toLowerCase']()===_0x573df8[_0x826ec9(0x248)]());if(_0xb0d066[_0x826ec9(0x1d4)]===0x0)return console['error']('Error:\x20Journey\x20not\x20found:\x20'+_0x573df8),console[_0x826ec9(0x232)](_0x826ec9(0x187)),0x1;_0x1ca899=_0xb0d066;}if(_0x7ec4f9!==undefined){const _0x5c1856=_0x1ca899['filter'](_0x2d6ee1=>{const _0x2af8f2=_0x826ec9,_0x4e9f54=_0x2d6ee1[_0x2af8f2(0x1d9)]?_0x17fecb[_0x2af8f2(0x1ed)](_0x2d6ee1[_0x2af8f2(0x1d9)])||'':'';return _0x4e9f54===_0x7ec4f9;});if(_0x5c1856[_0x826ec9(0x1d4)]===0x0&&_0x1ca899[_0x826ec9(0x1d4)]>0x0){console[_0x826ec9(0x232)](_0x826ec9(0x1d5)+_0x573df8+_0x826ec9(0x18a)+(_0x7ec4f9||_0x826ec9(0x19c))),console[_0x826ec9(0x232)](_0x826ec9(0x24e));for(const _0x47ff3e of _0x1ca899){const _0x1b15cd=_0x47ff3e[_0x826ec9(0x1d9)]?_0x17fecb[_0x826ec9(0x1ed)](_0x47ff3e[_0x826ec9(0x1d9)])||'':'';console[_0x826ec9(0x232)]('\x20\x20-\x20'+(_0x1b15cd||'(root)')+'/'+_0x47ff3e['journeyBundleName']);}return 0x1;}_0x1ca899=_0x5c1856;}if(_0x1ca899[_0x826ec9(0x1d4)]===0x0)return console[_0x826ec9(0x232)](_0x826ec9(0x214)),0x0;const _0x598903=new Map();for(const _0x52749a of _0x1ca899){const _0x33857f=_0x52749a[_0x826ec9(0x1f3)];!_0x598903[_0x826ec9(0x1d8)](_0x33857f)&&_0x598903[_0x826ec9(0x1f9)](_0x33857f,[]),_0x598903['get'](_0x33857f)[_0x826ec9(0x20f)](_0x52749a);}for(const _0x5a1058 of _0x598903['values']()){_0x5a1058['sort']((_0x444248,_0x548494)=>(_0x444248['versionNumber']||0x0)-(_0x548494[_0x826ec9(0x1f0)]||0x0));}const _0x16f115=[],[_0x43183a,_0x4292be]=await Promise['all']([withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x2134e6[_0x826ec9(0x1cc)][_0x826ec9(0x23c)](),{'verbose':_0x404fbf['verbose']})[_0x826ec9(0x193)](_0x4703ed=>_0x4703ed[_0x826ec9(0x235)]),withSpinner(_0x826ec9(0x243),()=>_0x2134e6[_0x826ec9(0x246)][_0x826ec9(0x258)](),{'verbose':_0x404fbf['verbose']})['then'](_0x2118b8=>_0x2118b8[_0x826ec9(0x235)])]);for(const _0x280fb8 of _0x598903[_0x826ec9(0x230)]()){const _0x38ea87=_0x280fb8[0x0][_0x826ec9(0x1bd)],_0x128fe1=_0x280fb8[0x0][_0x826ec9(0x1d9)],_0x27ec99=_0x128fe1?_0x17fecb[_0x826ec9(0x1ed)](_0x128fe1)||'':'',_0x36c5af=_0x27ec99?a18_0x146da4['join'](_0x4723a8,_0x27ec99):_0x4723a8,_0x11cb13=_0x5cbd9c||a18_0x146da4['join'](_0x36c5af,sanitizeFileName(_0x38ea87)+_0x826ec9(0x1a8));let _0x16613b,_0x488af7;if(existsSync(_0x11cb13))try{const _0x26e383=readFileSync(_0x11cb13,'utf-8'),_0x4f06ea=parseYamlString(_0x26e383);_0x488af7=_0x4f06ea,_0x16613b=buildRuleToNameMapping(_0x4f06ea),_0x245818['verbose']&&_0x16613b[_0x826ec9(0x1c7)]>0x0&&console[_0x826ec9(0x232)](_0x826ec9(0x1a6)+_0x16613b[_0x826ec9(0x1c7)]+_0x826ec9(0x239)+_0x38ea87);}catch(_0x594a12){_0x245818['verbose']&&console['error'](_0x826ec9(0x1c1)+_0x594a12['message']);}const _0x5449f0=[],_0x4595c8=new Set(),_0x4c6bf4=new Map(),_0x392cbd=new Map(),_0x348086=new Set(),_0x1ddce1=new Map(),_0x51719a=new Map(),_0x193e77=createJumpTargetCache();await withProgressSpinner(_0x826ec9(0x233)+_0x38ea87+_0x826ec9(0x229),async _0x5e99d1=>{const _0x470d0d=_0x826ec9;for(const _0x4266eb of _0x280fb8){const _0x6db0ab=_0x280fb8[_0x470d0d(0x1d4)]>0x1?_0x4266eb[_0x470d0d(0x1bd)]+'\x20v'+(_0x4266eb[_0x470d0d(0x1f0)]||0x1):_0x4266eb['journeyBundleName'];_0x5e99d1['setPhase'](_0x470d0d(0x233)+_0x6db0ab);const _0x17c17e=await _0x2134e6[_0x470d0d(0x21b)][_0x470d0d(0x23f)](_0x4266eb['id']),_0x54ebd4=_0x17c17e[_0x470d0d(0x238)]?.['audienceId'],_0x4d1788={'resolveSegment':async _0x3d2a51=>{const _0x13f209=_0x470d0d;if(!_0x54ebd4)return{'name':_0x3d2a51,'isJourneyLocal':![]};const _0x4f51c7=_0x4c6bf4[_0x13f209(0x1ed)](_0x3d2a51);if(_0x4f51c7)return _0x4f51c7;try{const _0x44275f=await _0x2134e6[_0x13f209(0x1ae)]['getSegment'](_0x54ebd4,_0x3d2a51),_0x218e13=_0x44275f[_0x13f209(0x259)]===SEGMENT_KIND_JOURNEY;let _0x26fca8,_0x1e186d=_0x44275f['name'];if(_0x218e13&&_0x44275f['rule']){const _0x5debd2=await segmentResponseToDef(_0x44275f,{'resolveSegmentName':async _0x2d2714=>{const _0x9fc37a=_0x13f209,_0x4bb0f6=_0x4c6bf4['get'](_0x2d2714);if(_0x4bb0f6)return _0x4bb0f6[_0x9fc37a(0x255)];const _0x37cfa0=await _0x4d1788[_0x9fc37a(0x217)](_0x2d2714);return _0x37cfa0['name'];}}),_0x1cb48d=_0x5debd2['rule'];_0x26fca8={'description':_0x44275f['description'],'rule':_0x1cb48d};const _0x540a63=serializeRule(_0x1cb48d),_0x4b1e84=_0x392cbd[_0x13f209(0x1ed)](_0x540a63);if(_0x4b1e84)_0x1e186d=_0x4b1e84,_0x26fca8=undefined,_0x245818[_0x13f209(0x1c6)]&&console[_0x13f209(0x232)](_0x13f209(0x1d0)+_0x44275f[_0x13f209(0x255)]+_0x13f209(0x1e9)+_0x4b1e84);else{let _0xdfb5be=![];if(_0x16613b){const _0x5b34f7=_0x16613b[_0x13f209(0x1ed)](_0x540a63);if(_0x5b34f7){const _0x438aa5=_0x5b34f7[_0x13f209(0x19d)](_0x4cfee6=>!_0x4595c8[_0x13f209(0x1d8)](_0x4cfee6));_0x438aa5&&(_0x1e186d=_0x438aa5,_0x4595c8[_0x13f209(0x1fc)](_0x438aa5),_0x392cbd[_0x13f209(0x1f9)](_0x540a63,_0x438aa5),_0xdfb5be=!![],_0x245818[_0x13f209(0x1c6)]&&console[_0x13f209(0x232)](_0x13f209(0x1b7)+_0x438aa5+'\x20(rule\x20match)'));}}if(!_0xdfb5be){const _0x52271e=generateJourneyLocalName(_0x44275f[_0x13f209(0x255)]);_0x52271e&&(_0x1e186d=_0x52271e);let _0x12070d=_0x1e186d,_0x4daf85=0x2;while(_0x4595c8['has'](_0x12070d)){_0x12070d=_0x1e186d+'_'+_0x4daf85,_0x4daf85++;}_0x4595c8[_0x13f209(0x1fc)](_0x12070d),_0x392cbd['set'](_0x540a63,_0x12070d),_0x1e186d=_0x12070d;}}}const _0x4f33b5={'name':_0x1e186d,'isJourneyLocal':_0x218e13,'definition':_0x26fca8};return _0x4c6bf4['set'](_0x3d2a51,_0x4f33b5),_0x4f33b5;}catch(_0x537bea){return _0x404fbf[_0x13f209(0x1c6)]&&console[_0x13f209(0x232)](_0x13f209(0x1df)+_0x3d2a51+':\x20'+_0x537bea['message']),{'name':_0x3d2a51,'isJourneyLocal':![]};}},'resolveActivation':async _0x38e51e=>{const _0x3e9ada=_0x470d0d,_0x549cd3=_0x1ddce1['get'](_0x38e51e);if(_0x549cd3)return _0x549cd3;try{const _0x5f0574=await _0x2134e6['journey'][_0x3e9ada(0x1be)](_0x4266eb['id'],_0x38e51e),_0x651ff0=journeyActivationStepToYaml(_0x5f0574,_0x43183a,_0x4292be),_0x36b429=JSON[_0x3e9ada(0x1b0)]({'name':_0x651ff0['name'],'connection':_0x651ff0[_0x3e9ada(0x246)],'connector_config':_0x651ff0[_0x3e9ada(0x1e1)]}),_0x384290=_0x51719a['get'](_0x36b429);if(_0x384290){const _0xe04154={'name':_0x384290,'isJourneyLocal':!![],'definition':_0x651ff0};return _0x1ddce1[_0x3e9ada(0x1f9)](_0x38e51e,_0xe04154),_0xe04154;}const _0x324cb6=_0x5f0574[_0x3e9ada(0x238)][_0x3e9ada(0x1b4)][_0x3e9ada(0x255)]||_0x38e51e,_0x2de376=sanitizeYamlKey(_0x324cb6)||_0x3e9ada(0x1db)+_0x38e51e;let _0x6f2057=_0x2de376,_0x1921df=0x2;while(_0x348086[_0x3e9ada(0x1d8)](_0x6f2057)){_0x6f2057=_0x2de376+'_'+_0x1921df,_0x1921df++;}_0x348086['add'](_0x6f2057),_0x51719a['set'](_0x36b429,_0x6f2057);const _0x3a5e32={'name':_0x6f2057,'isJourneyLocal':!![],'definition':_0x651ff0};return _0x1ddce1[_0x3e9ada(0x1f9)](_0x38e51e,_0x3a5e32),_0x3a5e32;}catch(_0xd05750){return _0x404fbf[_0x3e9ada(0x1c6)]&&console[_0x3e9ada(0x232)]('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x38e51e+':\x20'+_0xd05750[_0x3e9ada(0x24b)]),{'name':_0x38e51e,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x3837ab,_0x229d7d)=>{return resolveJumpTarget(_0x3837ab,_0x229d7d,_0x193e77,_0x141ead=>_0x2134e6['journey']['getJourney'](_0x141ead));}},_0x18e6cc=await journeyResponseToDef(_0x17c17e,_0x4d1788);_0x5449f0[_0x470d0d(0x20f)]({'item':_0x4266eb,'yaml':_0x18e6cc});}},{'verbose':_0x404fbf['verbose']});const _0x1beaef=buildMergedJourneyDef(_0x5449f0,_0x16613b),_0x4a67b6=normalizeJourneyDef(_0x1beaef,_0x488af7),_0x3a77da=toYamlString(_0x4a67b6),_0xca9333=_0x5cbd9c||a18_0x146da4[_0x826ec9(0x226)](_0x36c5af,sanitizeFileName(_0x38ea87)+_0x826ec9(0x1a8));!_0x5cbd9c&&_0x27ec99&&!existsSync(_0x36c5af)&&mkdirSync(_0x36c5af,{'recursive':!![]});const _0x45e017=a18_0x146da4[_0x826ec9(0x1c0)](process['cwd'](),_0xca9333);if(existsSync(_0xca9333)){const _0x3318bd=readFileSync(_0xca9333,'utf-8'),_0x2aa641=generateDiff(_0x3318bd,_0x3a77da),_0x654e2b=hasChanges(_0x2aa641);_0x16f115['push']({'relativePath':_0x45e017,'absolutePath':_0xca9333,'content':_0x3a77da,'isNew':![],'hasChanges':_0x654e2b,'diff':_0x654e2b?formatDiffWithColors(_0x2aa641):undefined});}else _0x16f115[_0x826ec9(0x20f)]({'relativePath':_0x45e017,'absolutePath':_0xca9333,'content':_0x3a77da,'isNew':!![],'hasChanges':![]});}const _0x4cbdbb=_0x16f115[_0x826ec9(0x206)](_0x2cad07=>_0x2cad07[_0x826ec9(0x198)]),_0x40a2a2=_0x16f115[_0x826ec9(0x206)](_0x4cb361=>!_0x4cb361[_0x826ec9(0x198)]&&_0x4cb361[_0x826ec9(0x1aa)]),_0x467cc6=_0x16f115['filter'](_0x2f21e3=>!_0x2f21e3['isNew']&&!_0x2f21e3['hasChanges']),_0x1f0188=_0x1ca899['length'],_0x484fc0=_0x598903['size'],_0x1df331=_0x1f0188>_0x484fc0?'\x20('+_0x1f0188+'\x20versions)':'';console['error']('\x0aPull\x20summary:'),console[_0x826ec9(0x232)]('\x20\x20'+a18_0x54cf4b[_0x826ec9(0x1f1)](_0x484fc0+_0x826ec9(0x237))+a18_0x54cf4b['dim'](_0x1df331)),console['error']('\x20\x20'+a18_0x54cf4b[_0x826ec9(0x254)]('+\x20'+_0x4cbdbb['length']+_0x826ec9(0x1a1))),console[_0x826ec9(0x232)]('\x20\x20'+a18_0x54cf4b[_0x826ec9(0x25e)]('~\x20'+_0x40a2a2[_0x826ec9(0x1d4)]+_0x826ec9(0x1ef))),console['error']('\x20\x20'+a18_0x54cf4b[_0x826ec9(0x1c4)]('=\x20'+_0x467cc6[_0x826ec9(0x1d4)]+_0x826ec9(0x234))),console['error'](_0x826ec9(0x1b9)+a18_0x54cf4b[_0x826ec9(0x1f1)](_0x4723a8)+'\x0a');if(_0x40a2a2[_0x826ec9(0x1d4)]>0x0)for(const _0x21fa16 of _0x40a2a2){console[_0x826ec9(0x232)](_0x826ec9(0x20e)+_0x21fa16['relativePath']+'\x27:'),console[_0x826ec9(0x232)]('─'['repeat'](0x3c)),console['error'](_0x21fa16['diff']),console['error']('─'[_0x826ec9(0x1fa)](0x3c));}if(_0x245818['dryRun'])return console[_0x826ec9(0x232)](a18_0x54cf4b[_0x826ec9(0x25e)](_0x826ec9(0x247))),0x0;if(_0x4cbdbb[_0x826ec9(0x1d4)]===0x0&&_0x40a2a2[_0x826ec9(0x1d4)]===0x0)return console[_0x826ec9(0x232)](a18_0x54cf4b[_0x826ec9(0x254)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x20c793},_0x245818[_0x826ec9(0x218)]),console[_0x826ec9(0x232)](a18_0x54cf4b[_0x826ec9(0x254)](_0x826ec9(0x227)+a18_0x54cf4b[_0x826ec9(0x1c4)](_0x826ec9(0x1da))+_0x826ec9(0x1b3)+a18_0x54cf4b[_0x826ec9(0x1f1)](_0x20c793))),0x0;if(!_0x245818['yes']&&(_0x4cbdbb[_0x826ec9(0x1d4)]>0x0||_0x40a2a2[_0x826ec9(0x1d4)]>0x0)){if(!isInteractive())return console[_0x826ec9(0x232)](a18_0x54cf4b['red'](_0x826ec9(0x24d)),_0x826ec9(0x21c)),console[_0x826ec9(0x232)](a18_0x54cf4b['dim'](_0x826ec9(0x1b2))),0x1;const _0x5f3be1=await confirmKey(_0x826ec9(0x251)+(_0x4cbdbb['length']+_0x40a2a2['length'])+'\x20files?');if(!_0x5f3be1)return console[_0x826ec9(0x232)](a18_0x54cf4b[_0x826ec9(0x25e)](_0x826ec9(0x1ca)),_0x826ec9(0x1c3)),0x1;}!existsSync(_0x4723a8)&&mkdirSync(_0x4723a8,{'recursive':!![]});for(const _0x3aa298 of _0x16f115){(_0x3aa298[_0x826ec9(0x198)]||_0x3aa298['hasChanges'])&&writeFileSync(_0x3aa298[_0x826ec9(0x204)],_0x3aa298['content'],'utf-8');}return console[_0x826ec9(0x232)](a18_0x54cf4b[_0x826ec9(0x254)](_0x826ec9(0x1a3)+(_0x4cbdbb['length']+_0x40a2a2[_0x826ec9(0x1d4)])+_0x826ec9(0x195)+_0x4723a8)),saveSessionContext({'parent_segment':_0x20c793},_0x245818[_0x826ec9(0x218)]),console[_0x826ec9(0x232)](a18_0x54cf4b[_0x826ec9(0x254)](_0x826ec9(0x227)+a18_0x54cf4b[_0x826ec9(0x1c4)]('parent_segment')+'\x20=\x20'+a18_0x54cf4b['cyan'](_0x20c793))),0x0;}}function a18_0x328f(_0x4a820a,_0x3566ac){_0x4a820a=_0x4a820a-0x183;const _0x10495d=a18_0x1049();let _0x328ff9=_0x10495d[_0x4a820a];return _0x328ff9;}export class JourneyPushCommand extends BaseCommand{[a18_0x3c18e6(0x255)]=a18_0x3c18e6(0x1ab);[a18_0x3c18e6(0x1ac)]=a18_0x3c18e6(0x210);[a18_0x3c18e6(0x223)]=new SegmentPushCommand();async['execute'](_0x1ba537){const _0x401fdd=a18_0x3c18e6,_0x40a516=_0x1ba537[_0x401fdd(0x231)][0x0];let _0x4635c7;if(_0x40a516){const _0x4d6132=await resolveTarget({'arg':_0x40a516,'contextParent':_0x1ba537[_0x401fdd(0x22d)][_0x401fdd(0x1cb)],'cwd':process[_0x401fdd(0x209)]()});isSuccessfulResolution(_0x4d6132)&&_0x4d6132[_0x401fdd(0x1e8)]===_0x401fdd(0x1ea)&&(_0x4635c7=_0x4d6132[_0x401fdd(0x22e)]);}const _0x307745={..._0x1ba537,'options':{..._0x1ba537[_0x401fdd(0x22d)],'journeysOnly':!![],..._0x4635c7&&{'singleFilePath':_0x4635c7}}};return this[_0x401fdd(0x223)][_0x401fdd(0x215)](_0x307745);}}
@@ -1 +1 @@
1
- const a19_0x113c9e=a19_0x3707;(function(_0x2174c6,_0x4fc31b){const _0x532f0b=a19_0x3707,_0x1a7d3f=_0x2174c6();while(!![]){try{const _0x36f6e6=-parseInt(_0x532f0b(0x184))/0x1+-parseInt(_0x532f0b(0x180))/0x2+-parseInt(_0x532f0b(0x17e))/0x3*(-parseInt(_0x532f0b(0x191))/0x4)+parseInt(_0x532f0b(0x190))/0x5*(-parseInt(_0x532f0b(0x176))/0x6)+-parseInt(_0x532f0b(0x17c))/0x7*(parseInt(_0x532f0b(0x19a))/0x8)+-parseInt(_0x532f0b(0x160))/0x9+parseInt(_0x532f0b(0x166))/0xa;if(_0x36f6e6===_0x4fc31b)break;else _0x1a7d3f['push'](_0x1a7d3f['shift']());}catch(_0x1fd9fe){_0x1a7d3f['push'](_0x1a7d3f['shift']());}}}(a19_0xada6,0x70351));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 a19_0xada6(){const _0x493fae=['\x20segment\x20file(s)\x20skipped)','cyan','3025070HAoTfY','653176COZnPV','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','helpText','yellow','reason','hasErrors','warningCount','errors','invalidCount','320WgEejo','parentSegment','\x20valid','relativePath','validCount','4139046pydAVG','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','\x20(skipped:\x20','✔\x20All\x20','filePath','type','24529050pUXHsZ','no_parent','\x20warning(s)','errorCode','\x20warning(s)\x20found','.yaml','\x20segment\x20file(s)\x20skipped','description','skippedCount','valid','Error:\x20Directory\x20not\x20found:\x20','\x20journey(s)\x20with\x20errors,\x20','endsWith','length','Error:\x20','red','6cktkHN','journey:validate','\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','log','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','filter','95298wGwpkl','execute','12OqFqlU','green','1199686LLtFyz','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','.yml','Validation\x20failed:\x20','437169gEaWQP','dim','journey','error','message','cwd','\x20error(s)','file','verbose','warnings'];a19_0xada6=function(){return _0x493fae;};return a19_0xada6();}function a19_0x3707(_0x1bed85,_0x5d36af){_0x1bed85=_0x1bed85-0x160;const _0xada62f=a19_0xada6();let _0x3707a7=_0xada62f[_0x1bed85];return _0x3707a7;}import a19_0x4552a2 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{['name']=a19_0x113c9e(0x177);[a19_0x113c9e(0x16d)]='Validate\x20journey\x20YAML\x20files';async[a19_0x113c9e(0x17d)](_0x2b5436){const _0x4cfdbd=a19_0x113c9e,{options:_0x32c20a,args:_0x5ae8ab}=_0x2b5436,_0x3e670b=_0x32c20a,_0x57fa75=await resolveTarget({'arg':_0x5ae8ab[0x0],'contextParent':_0x32c20a[_0x4cfdbd(0x19b)],'cwd':process[_0x4cfdbd(0x189)]()});if(!isSuccessfulResolution(_0x57fa75))return _0x57fa75[_0x4cfdbd(0x169)]===_0x4cfdbd(0x167)?(console['error'](a19_0x4552a2[_0x4cfdbd(0x194)](_0x4cfdbd(0x192))),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[_0x4cfdbd(0x187)](_0x4cfdbd(0x178)),console[_0x4cfdbd(0x187)](_0x4cfdbd(0x161))):(console[_0x4cfdbd(0x187)](a19_0x4552a2['red'](_0x4cfdbd(0x174)+_0x57fa75[_0x4cfdbd(0x188)]+'\x0a')),_0x57fa75['helpText']&&console[_0x4cfdbd(0x187)](a19_0x4552a2[_0x4cfdbd(0x18f)](_0x57fa75[_0x4cfdbd(0x193)]))),0x1;const _0x1db1e9=_0x57fa75['targetDir'],_0x1a25fe=_0x57fa75[_0x4cfdbd(0x165)]===_0x4cfdbd(0x18b)?_0x57fa75[_0x4cfdbd(0x164)]:undefined;if(!_0x1a25fe&&!existsSync(_0x1db1e9))return console[_0x4cfdbd(0x187)](a19_0x4552a2[_0x4cfdbd(0x175)](_0x4cfdbd(0x170)+_0x1db1e9+'\x0a')),0x1;let _0x5ba09c;if(_0x1a25fe){if(!_0x1a25fe[_0x4cfdbd(0x172)](_0x4cfdbd(0x182))&&!_0x1a25fe[_0x4cfdbd(0x172)](_0x4cfdbd(0x16b)))return console[_0x4cfdbd(0x187)](a19_0x4552a2[_0x4cfdbd(0x175)](_0x4cfdbd(0x181)+_0x1a25fe+'\x0a')),0x1;_0x5ba09c=[_0x1a25fe];}else _0x5ba09c=findYamlFiles(_0x1db1e9);if(_0x5ba09c[_0x4cfdbd(0x173)]===0x0)return console[_0x4cfdbd(0x187)](a19_0x4552a2[_0x4cfdbd(0x175)](_0x4cfdbd(0x17a)+_0x1db1e9+'\x0a')),0x1;const _0x589a90=validateYamlFiles(_0x5ba09c,_0x1db1e9,{'filterType':_0x4cfdbd(0x186)}),_0x44b94b=calculateSummary(_0x589a90),_0xb7b484=_0x589a90[_0x4cfdbd(0x17b)](isValidationResult);if(_0xb7b484['length']===0x0)return console[_0x4cfdbd(0x187)](a19_0x4552a2['yellow']('No\x20journey\x20YAML\x20files\x20found\x20in\x20'+_0x1db1e9+'\x0a')),_0x44b94b[_0x4cfdbd(0x16e)]>0x0&&console[_0x4cfdbd(0x187)](a19_0x4552a2[_0x4cfdbd(0x185)]('('+_0x44b94b[_0x4cfdbd(0x16e)]+_0x4cfdbd(0x18e))),0x0;for(const _0x24a010 of _0x589a90){if(!isValidationResult(_0x24a010)){_0x3e670b[_0x4cfdbd(0x18c)]&&console[_0x4cfdbd(0x179)](a19_0x4552a2[_0x4cfdbd(0x185)]('-\x20'+_0x24a010[_0x4cfdbd(0x19d)]+_0x4cfdbd(0x162)+_0x24a010[_0x4cfdbd(0x195)]+')'));continue;}const {relativePath:_0x5a9901,source:_0x17af42,result:_0x5b9141}=_0x24a010;if(_0x5b9141[_0x4cfdbd(0x16f)]&&_0x5b9141[_0x4cfdbd(0x18d)][_0x4cfdbd(0x173)]===0x0)_0x3e670b['verbose']&&console[_0x4cfdbd(0x179)](a19_0x4552a2[_0x4cfdbd(0x17f)]('✔\x20'+_0x5a9901));else _0x5b9141[_0x4cfdbd(0x16f)]?(console[_0x4cfdbd(0x179)](a19_0x4552a2['yellow']('⚠\x20'+_0x5a9901+':\x20'+_0x5b9141['warnings'][_0x4cfdbd(0x173)]+_0x4cfdbd(0x168))),console[_0x4cfdbd(0x179)](formatValidationResult(_0x5b9141,_0x17af42,_0x5a9901))):(console[_0x4cfdbd(0x179)](a19_0x4552a2['red']('✖\x20'+_0x5a9901+':\x20'+_0x5b9141[_0x4cfdbd(0x198)][_0x4cfdbd(0x173)]+_0x4cfdbd(0x18a))),console[_0x4cfdbd(0x179)](formatValidationResult(_0x5b9141,_0x17af42,_0x5a9901)));}return console[_0x4cfdbd(0x179)](''),_0x44b94b[_0x4cfdbd(0x196)]?(console[_0x4cfdbd(0x179)](a19_0x4552a2[_0x4cfdbd(0x175)](_0x4cfdbd(0x183)+_0x44b94b[_0x4cfdbd(0x199)]+_0x4cfdbd(0x171)+_0x44b94b[_0x4cfdbd(0x19e)]+_0x4cfdbd(0x19c))),_0x44b94b[_0x4cfdbd(0x197)]>0x0&&console[_0x4cfdbd(0x179)](a19_0x4552a2[_0x4cfdbd(0x194)](_0x44b94b['warningCount']+_0x4cfdbd(0x16a))),_0x44b94b[_0x4cfdbd(0x16e)]>0x0&&console[_0x4cfdbd(0x179)](a19_0x4552a2[_0x4cfdbd(0x185)](_0x44b94b['skippedCount']+_0x4cfdbd(0x16c))),0x1):(console[_0x4cfdbd(0x179)](a19_0x4552a2[_0x4cfdbd(0x17f)](_0x4cfdbd(0x163)+_0x44b94b[_0x4cfdbd(0x19e)]+'\x20journey(s)\x20valid')),_0x44b94b[_0x4cfdbd(0x197)]>0x0&&console[_0x4cfdbd(0x179)](a19_0x4552a2['yellow'](_0x44b94b[_0x4cfdbd(0x197)]+_0x4cfdbd(0x16a))),_0x44b94b[_0x4cfdbd(0x16e)]>0x0&&console['log'](a19_0x4552a2[_0x4cfdbd(0x185)](_0x44b94b[_0x4cfdbd(0x16e)]+'\x20segment\x20file(s)\x20skipped')),0x0);}}
1
+ const a19_0x53601e=a19_0x1654;(function(_0x3fdab4,_0x371f96){const _0x2371ca=a19_0x1654,_0x11e4ce=_0x3fdab4();while(!![]){try{const _0x3e5117=-parseInt(_0x2371ca(0xa3))/0x1*(parseInt(_0x2371ca(0x75))/0x2)+-parseInt(_0x2371ca(0x7b))/0x3*(-parseInt(_0x2371ca(0x93))/0x4)+-parseInt(_0x2371ca(0x8f))/0x5*(parseInt(_0x2371ca(0x8b))/0x6)+parseInt(_0x2371ca(0x78))/0x7*(-parseInt(_0x2371ca(0xa2))/0x8)+-parseInt(_0x2371ca(0x9f))/0x9+-parseInt(_0x2371ca(0x6d))/0xa*(-parseInt(_0x2371ca(0x9d))/0xb)+parseInt(_0x2371ca(0x70))/0xc;if(_0x3e5117===_0x371f96)break;else _0x11e4ce['push'](_0x11e4ce['shift']());}catch(_0x22edf1){_0x11e4ce['push'](_0x11e4ce['shift']());}}}(a19_0x44f2,0x9bb57));import{BaseCommand}from'./command.js';function a19_0x44f2(){const _0x1366d0=['warnings','10YreLJl','.yml','\x20valid','38418012JylPAD','no_parent','filePath','Error:\x20Directory\x20not\x20found:\x20','\x20segment\x20file(s)\x20skipped)','2PgRxNv','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','dim','10801MzPueE','file','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','144723zmTLyK','helpText','validCount','filter','\x20warning(s)','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','skippedCount','red','log','errors','Usage:\x20tdx\x20journey\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','\x20error(s)','\x20(skipped:\x20','No\x20journey\x20YAML\x20files\x20found\x20in\x20','\x20segment\x20file(s)\x20skipped','description','72168wqsIax','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','error','yellow','305aigwWA','Error:\x20','invalidCount','verbose','60bhEiDE','valid','.yaml','targetDir','\x20warning(s)\x20found','warningCount','type','execute','cyan','\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','4659842ibBdLB','endsWith','10296549PjzxCU','message','green','4984UmJPCm','871897CfRWob','reason','journey','\x20journey(s)\x20with\x20errors,\x20','relativePath','length','\x20journey(s)\x20valid'];a19_0x44f2=function(){return _0x1366d0;};return a19_0x44f2();}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a19_0x1654(_0x136a2d,_0x743659){_0x136a2d=_0x136a2d-0x6b;const _0x44f2ac=a19_0x44f2();let _0x1654db=_0x44f2ac[_0x136a2d];return _0x1654db;}import a19_0x1af155 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class JourneyValidateCommand extends BaseCommand{['name']='journey:validate';[a19_0x53601e(0x8a)]='Validate\x20journey\x20YAML\x20files';async[a19_0x53601e(0x9a)](_0x8d1087){const _0xf09c9e=a19_0x53601e,{options:_0x532bd5,args:_0x21f8d}=_0x8d1087,_0x1ce2d6=_0x532bd5,_0x3adec8=await resolveTarget({'arg':_0x21f8d[0x0],'contextParent':_0x532bd5['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x3adec8))return _0x3adec8['errorCode']===_0xf09c9e(0x71)?(console[_0xf09c9e(0x8d)](a19_0x1af155[_0xf09c9e(0x8e)](_0xf09c9e(0x7a))),console[_0xf09c9e(0x8d)](_0xf09c9e(0x85)),console['error'](_0xf09c9e(0x9c)),console[_0xf09c9e(0x8d)](_0xf09c9e(0x80))):(console['error'](a19_0x1af155[_0xf09c9e(0x82)](_0xf09c9e(0x90)+_0x3adec8[_0xf09c9e(0xa0)]+'\x0a')),_0x3adec8['helpText']&&console['error'](a19_0x1af155[_0xf09c9e(0x9b)](_0x3adec8[_0xf09c9e(0x7c)]))),0x1;const _0x2ec2fe=_0x3adec8[_0xf09c9e(0x96)],_0x37adfe=_0x3adec8[_0xf09c9e(0x99)]===_0xf09c9e(0x79)?_0x3adec8[_0xf09c9e(0x72)]:undefined;if(!_0x37adfe&&!existsSync(_0x2ec2fe))return console['error'](a19_0x1af155['red'](_0xf09c9e(0x73)+_0x2ec2fe+'\x0a')),0x1;let _0xc2ae40;if(_0x37adfe){if(!_0x37adfe[_0xf09c9e(0x9e)](_0xf09c9e(0x6e))&&!_0x37adfe[_0xf09c9e(0x9e)](_0xf09c9e(0x95)))return console['error'](a19_0x1af155['red'](_0xf09c9e(0x76)+_0x37adfe+'\x0a')),0x1;_0xc2ae40=[_0x37adfe];}else _0xc2ae40=findYamlFiles(_0x2ec2fe);if(_0xc2ae40[_0xf09c9e(0xa8)]===0x0)return console[_0xf09c9e(0x8d)](a19_0x1af155[_0xf09c9e(0x82)](_0xf09c9e(0x8c)+_0x2ec2fe+'\x0a')),0x1;const _0x4643b4=validateYamlFiles(_0xc2ae40,_0x2ec2fe,{'filterType':_0xf09c9e(0xa5)}),_0x149d62=calculateSummary(_0x4643b4),_0x15d8fb=_0x4643b4[_0xf09c9e(0x7e)](isValidationResult);if(_0x15d8fb[_0xf09c9e(0xa8)]===0x0)return console[_0xf09c9e(0x8d)](a19_0x1af155[_0xf09c9e(0x8e)](_0xf09c9e(0x88)+_0x2ec2fe+'\x0a')),_0x149d62[_0xf09c9e(0x81)]>0x0&&console[_0xf09c9e(0x8d)](a19_0x1af155['dim']('('+_0x149d62[_0xf09c9e(0x81)]+_0xf09c9e(0x74))),0x0;for(const _0x4e4b36 of _0x4643b4){if(!isValidationResult(_0x4e4b36)){_0x1ce2d6[_0xf09c9e(0x92)]&&console[_0xf09c9e(0x83)](a19_0x1af155[_0xf09c9e(0x77)]('-\x20'+_0x4e4b36[_0xf09c9e(0xa7)]+_0xf09c9e(0x87)+_0x4e4b36[_0xf09c9e(0xa4)]+')'));continue;}const {relativePath:_0xd960b,source:_0x5578d3,result:_0x13635c}=_0x4e4b36;if(_0x13635c[_0xf09c9e(0x94)]&&_0x13635c[_0xf09c9e(0x6c)][_0xf09c9e(0xa8)]===0x0)_0x1ce2d6[_0xf09c9e(0x92)]&&console[_0xf09c9e(0x83)](a19_0x1af155[_0xf09c9e(0xa1)]('✔\x20'+_0xd960b));else _0x13635c['valid']?(console[_0xf09c9e(0x83)](a19_0x1af155[_0xf09c9e(0x8e)]('⚠\x20'+_0xd960b+':\x20'+_0x13635c['warnings']['length']+_0xf09c9e(0x7f))),console[_0xf09c9e(0x83)](formatValidationResult(_0x13635c,_0x5578d3,_0xd960b))):(console['log'](a19_0x1af155[_0xf09c9e(0x82)]('✖\x20'+_0xd960b+':\x20'+_0x13635c[_0xf09c9e(0x84)][_0xf09c9e(0xa8)]+_0xf09c9e(0x86))),console[_0xf09c9e(0x83)](formatValidationResult(_0x13635c,_0x5578d3,_0xd960b)));}return console['log'](''),_0x149d62['hasErrors']?(console[_0xf09c9e(0x83)](a19_0x1af155['red']('Validation\x20failed:\x20'+_0x149d62[_0xf09c9e(0x91)]+_0xf09c9e(0xa6)+_0x149d62['validCount']+_0xf09c9e(0x6f))),_0x149d62[_0xf09c9e(0x98)]>0x0&&console[_0xf09c9e(0x83)](a19_0x1af155[_0xf09c9e(0x8e)](_0x149d62['warningCount']+_0xf09c9e(0x97))),_0x149d62[_0xf09c9e(0x81)]>0x0&&console[_0xf09c9e(0x83)](a19_0x1af155[_0xf09c9e(0x77)](_0x149d62[_0xf09c9e(0x81)]+_0xf09c9e(0x89))),0x1):(console['log'](a19_0x1af155[_0xf09c9e(0xa1)]('✔\x20All\x20'+_0x149d62[_0xf09c9e(0x7d)]+_0xf09c9e(0x6b))),_0x149d62[_0xf09c9e(0x98)]>0x0&&console['log'](a19_0x1af155['yellow'](_0x149d62[_0xf09c9e(0x98)]+_0xf09c9e(0x97))),_0x149d62[_0xf09c9e(0x81)]>0x0&&console[_0xf09c9e(0x83)](a19_0x1af155[_0xf09c9e(0x77)](_0x149d62[_0xf09c9e(0x81)]+_0xf09c9e(0x89))),0x0);}}