@treasuredata/tdx 0.28.8 β 0.29.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.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.d.ts.map +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-push-command.js.map +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.d.ts.map +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-validator.js.map +1 -1
- package/dist/sdk/engage/campaign-yaml.d.ts.map +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js.map +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.d.ts +1 -1
- package/dist/sdk/segment/push-workflow.d.ts.map +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js.map +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.d.ts +33 -0
- package/dist/sdk/segment/segment-validator.d.ts.map +1 -0
- package/dist/sdk/segment/segment-validator.js +1 -0
- package/dist/sdk/segment/segment-validator.js.map +1 -0
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/segment-def.d.ts +5 -179
- package/dist/sdk/segment/types/segment-def.d.ts.map +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-def.js.map +1 -1
- package/dist/sdk/segment/types/segment-schema.d.ts +259 -0
- package/dist/sdk/segment/types/segment-schema.d.ts.map +1 -0
- package/dist/sdk/segment/types/segment-schema.js +1 -0
- package/dist/sdk/segment/types/segment-schema.js.map +1 -0
- package/dist/sdk/segment/validate-files.d.ts.map +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/validate-files.js.map +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts +27 -10
- package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment/yaml-validator.js.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/cdp.d.ts +11 -2
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x47a0c9=a19_0x23e5;function a19_0x23e5(_0x8abc4e,_0x36cbf3){_0x8abc4e=_0x8abc4e-0x1e6;const _0x5db3d5=a19_0x5db3();let _0x23e53e=_0x5db3d5[_0x8abc4e];return _0x23e53e;}(function(_0x19c694,_0x5c2d40){const _0x36a736=a19_0x23e5,_0x4ce46d=_0x19c694();while(!![]){try{const _0x591854=parseInt(_0x36a736(0x201))/0x1+-parseInt(_0x36a736(0x1fc))/0x2*(parseInt(_0x36a736(0x209))/0x3)+-parseInt(_0x36a736(0x1e6))/0x4*(parseInt(_0x36a736(0x20a))/0x5)+-parseInt(_0x36a736(0x1fd))/0x6+-parseInt(_0x36a736(0x212))/0x7*(-parseInt(_0x36a736(0x213))/0x8)+parseInt(_0x36a736(0x214))/0x9+parseInt(_0x36a736(0x1f2))/0xa*(parseInt(_0x36a736(0x211))/0xb);if(_0x591854===_0x5c2d40)break;else _0x4ce46d['push'](_0x4ce46d['shift']());}catch(_0x466bc9){_0x4ce46d['push'](_0x4ce46d['shift']());}}}(a19_0x5db3,0xce920));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a19_0x3688e4 from'chalk';import a19_0x562629 from'path';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageCampaignValidateCommand extends BaseCommand{[a19_0x47a0c9(0x1ff)]=a19_0x47a0c9(0x1ea);[a19_0x47a0c9(0x1fb)]=a19_0x47a0c9(0x217);async[a19_0x47a0c9(0x20c)](_0x20ea1f){const _0x18f0d4=a19_0x47a0c9,{options:_0x22e815,args:_0x68295c}=_0x20ea1f,_0x5b6457=_0x22e815,_0xe0282b=_0x68295c[0x0],_0x208d37=_0xe0282b?a19_0x562629['resolve'](_0xe0282b):undefined,_0x7dc70=_0x208d37?isYamlFile(_0x208d37):![];let _0x39d9ea,_0x60f980;if(_0x7dc70&&_0x208d37)_0x39d9ea=a19_0x562629[_0x18f0d4(0x1ee)](_0x208d37),_0x60f980=_0x208d37;else _0x208d37?_0x39d9ea=_0x208d37:_0x39d9ea=process['cwd']();if(!_0x60f980&&!existsSync(_0x39d9ea))return console['error'](a19_0x3688e4[_0x18f0d4(0x1ef)](_0x18f0d4(0x206)+_0x39d9ea+'\x0a')),0x1;let _0x14f7bc;if(_0x60f980){if(!_0x60f980[_0x18f0d4(0x1f6)](_0x18f0d4(0x210))&&!_0x60f980[_0x18f0d4(0x1f6)](_0x18f0d4(0x20d)))return console[_0x18f0d4(0x202)](a19_0x3688e4['red'](_0x18f0d4(0x205)+_0x60f980+'\x0a')),0x1;_0x14f7bc=[_0x60f980];}else _0x14f7bc=findYamlFiles(_0x39d9ea);if(_0x14f7bc['length']===0x0)return console['error'](a19_0x3688e4[_0x18f0d4(0x1ef)](_0x18f0d4(0x20e)+_0x39d9ea+'\x0a')),0x1;const _0x258a1e=validateYamlFiles(_0x14f7bc,_0x39d9ea,{'filterType':'campaign'}),_0x193ce1=calculateSummary(_0x258a1e),_0x801457=_0x258a1e[_0x18f0d4(0x1f4)](isValidationResult);if(_0x801457['length']===0x0)return console[_0x18f0d4(0x202)](a19_0x3688e4['yellow'](_0x18f0d4(0x1fe)+_0x39d9ea+'\x0a')),_0x193ce1[_0x18f0d4(0x1ed)]>0x0&&console['error'](a19_0x3688e4['dim']('('+_0x193ce1[_0x18f0d4(0x1ed)]+_0x18f0d4(0x1f5))),0x0;for(const _0x52cf25 of _0x258a1e){if(!isValidationResult(_0x52cf25)){_0x5b6457[_0x18f0d4(0x1f8)]&&console['log'](a19_0x3688e4[_0x18f0d4(0x1e7)]('-\x20'+_0x52cf25['relativePath']+_0x18f0d4(0x203)+_0x52cf25[_0x18f0d4(0x1f9)]+')'));continue;}const {relativePath:_0x4cdfd5,source:_0x473a45,result:_0x95af8b}=_0x52cf25;if(_0x95af8b[_0x18f0d4(0x1fa)]&&_0x95af8b[_0x18f0d4(0x1f3)][_0x18f0d4(0x1ec)]===0x0)_0x5b6457[_0x18f0d4(0x1f8)]&&console[_0x18f0d4(0x204)](a19_0x3688e4[_0x18f0d4(0x1e8)]('β\x20'+_0x4cdfd5));else _0x95af8b[_0x18f0d4(0x1fa)]?(console[_0x18f0d4(0x204)](a19_0x3688e4['yellow']('β \x20'+_0x4cdfd5+':\x20'+_0x95af8b['warnings'][_0x18f0d4(0x1ec)]+_0x18f0d4(0x218))),console[_0x18f0d4(0x204)](formatValidationResult(_0x95af8b,_0x473a45,_0x4cdfd5))):(console[_0x18f0d4(0x204)](a19_0x3688e4['red']('β\x20'+_0x4cdfd5+':\x20'+_0x95af8b[_0x18f0d4(0x1eb)]['length']+_0x18f0d4(0x20b))),console[_0x18f0d4(0x204)](formatValidationResult(_0x95af8b,_0x473a45,_0x4cdfd5)));}return console[_0x18f0d4(0x204)](''),_0x193ce1[_0x18f0d4(0x215)]?(console[_0x18f0d4(0x204)](a19_0x3688e4[_0x18f0d4(0x1ef)](_0x18f0d4(0x1f7)+_0x193ce1[_0x18f0d4(0x208)]+_0x18f0d4(0x207)+_0x193ce1[_0x18f0d4(0x200)]+'\x20valid')),_0x193ce1[_0x18f0d4(0x20f)]>0x0&&console[_0x18f0d4(0x204)](a19_0x3688e4[_0x18f0d4(0x216)](_0x193ce1[_0x18f0d4(0x20f)]+_0x18f0d4(0x1e9))),_0x193ce1[_0x18f0d4(0x1ed)]>0x0&&console['log'](a19_0x3688e4[_0x18f0d4(0x1e7)](_0x193ce1[_0x18f0d4(0x1ed)]+_0x18f0d4(0x1f0))),0x1):(console[_0x18f0d4(0x204)](a19_0x3688e4['green']('β\x20All\x20'+_0x193ce1[_0x18f0d4(0x200)]+_0x18f0d4(0x1f1))),_0x193ce1[_0x18f0d4(0x20f)]>0x0&&console[_0x18f0d4(0x204)](a19_0x3688e4[_0x18f0d4(0x216)](_0x193ce1['warningCount']+_0x18f0d4(0x1e9))),_0x193ce1[_0x18f0d4(0x1ed)]>0x0&&console[_0x18f0d4(0x204)](a19_0x3688e4['dim'](_0x193ce1[_0x18f0d4(0x1ed)]+_0x18f0d4(0x1f0))),0x0);}}function a19_0x5db3(){const _0x1c4998=['No\x20campaign\x20YAML\x20files\x20found\x20in\x20','name','validCount','142829TCmlxy','error','\x20(skipped:\x20','log','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Error:\x20Directory\x20not\x20found:\x20','\x20campaign(s)\x20with\x20errors,\x20','invalidCount','790071LJahbp','5udjMLV','\x20error(s)','execute','.yaml','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','warningCount','.yml','13519GlEmle','5805506mwpYFT','8WQSQLy','490347UAZRyH','hasErrors','yellow','Validate\x20campaign\x20YAML\x20files','\x20warning(s)','1976404oxrAlf','dim','green','\x20warning(s)\x20found','engage:campaign:validate','errors','length','skippedCount','dirname','red','\x20non-campaign\x20file(s)\x20skipped','\x20campaign(s)\x20valid','19850zoDPmG','warnings','filter','\x20non-campaign\x20file(s)\x20skipped)','endsWith','Validation\x20failed:\x20','verbose','reason','valid','description','4wVaHBh','9595848CXjTmG'];a19_0x5db3=function(){return _0x1c4998;};return a19_0x5db3();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a20_0x33cdc2=a20_0x2557;(function(_0x1f3682,_0x3b4a5e){const _0x2a5447=a20_0x2557,_0x4a09c2=_0x1f3682();while(!![]){try{const _0x219d7d=-parseInt(_0x2a5447(0x1ca))/0x1*(parseInt(_0x2a5447(0x1e6))/0x2)+-parseInt(_0x2a5447(0x178))/0x3+parseInt(_0x2a5447(0x207))/0x4+parseInt(_0x2a5447(0x20c))/0x5*(parseInt(_0x2a5447(0x187))/0x6)+parseInt(_0x2a5447(0x17f))/0x7+-parseInt(_0x2a5447(0x1ae))/0x8+parseInt(_0x2a5447(0x1d6))/0x9;if(_0x219d7d===_0x3b4a5e)break;else _0x4a09c2['push'](_0x4a09c2['shift']());}catch(_0x5d377e){_0x4a09c2['push'](_0x4a09c2['shift']());}}}(a20_0x5f36,0x4dc2e));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';function a20_0x2557(_0x399d65,_0x5b087a){_0x399d65=_0x399d65-0x172;const _0x5f3662=a20_0x5f36();let _0x255731=_0x5f3662[_0x399d65];return _0x255731;}import{readFileContent}from'../utils/file-reader.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{getCampaignUrl}from'../sdk/client/endpoints.js';export async function resolveWorkspaceIdFromOptions(_0x18c336,_0x544a05,_0x25c07a=![]){const _0x21271d=a20_0x2557;if(_0x18c336[_0x21271d(0x18a)])return await _0x544a05['engage'][_0x21271d(0x1c7)](_0x18c336['workspace']);const _0x46dd36=loadSessionContext(_0x18c336['session']);if(_0x46dd36?.[_0x21271d(0x1b5)])return await _0x544a05['engage'][_0x21271d(0x1c7)](_0x46dd36[_0x21271d(0x1b5)]);if(_0x25c07a)throw new SDKError(ErrorCode[_0x21271d(0x1b0)],_0x21271d(0x18d),undefined,{'helpText':_0x21271d(0x1be)});return undefined;}async function resolveSegmentFromOptions(_0x116573,_0x280da2){const _0x5bee9a=a20_0x2557;if(!_0x116573[_0x5bee9a(0x1ba)])return{};const _0x3c8d40=_0x116573[_0x5bee9a(0x1ba)],_0x3d503c=await _0x280da2[_0x5bee9a(0x1ba)][_0x5bee9a(0x1bf)](_0x3c8d40);return{'audienceId':_0x3d503c[_0x5bee9a(0x1d9)],'audienceName':_0x3d503c['parentName'],..._0x3d503c[_0x5bee9a(0x1af)]&&{'segmentId':_0x3d503c[_0x5bee9a(0x1af)],'segmentName':_0x3d503c[_0x5bee9a(0x1fa)]}};}function buildConnectorConfig(_0x20bd47){const _0x18a1c1=a20_0x2557,_0x3104c1=_0x20bd47[_0x18a1c1(0x172)],_0x43533f=_0x20bd47[_0x18a1c1(0x1a2)];if(!_0x3104c1&&!_0x43533f)return undefined;return{..._0x3104c1&&{'emailSenderId':_0x3104c1},..._0x43533f&&{'jsonColumns':_0x43533f}};}export class EngageCampaignsCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]=a20_0x33cdc2(0x19f);['description']='List\x20campaigns';async[a20_0x33cdc2(0x1eb)](_0x3d5d8c){const _0x3524d3=a20_0x33cdc2,{options:_0x425c05,args:_0x3e7ff8,tdx:_0x3b5cec}=_0x3d5d8c,_0x10adad=_0x3e7ff8[0x0],_0x50a666=resolveLimit(_0x425c05['limit'],DEFAULT_LLM_LIMIT),_0x43effe=_0x425c05,_0x1224b9=_0x43effe['type'],_0xe6a5be=_0x43effe[_0x3524d3(0x1d5)],_0x22dd38=await resolveWorkspaceIdFromOptions(_0x43effe,_0x3b5cec),_0x5eeb0f=await withSpinner(_0x3524d3(0x1f8),()=>_0x3b5cec[_0x3524d3(0x1bc)]['listCampaigns']({'type':_0x1224b9,'status':_0xe6a5be,'workspaceId':_0x22dd38,'limit':_0x50a666}),{'verbose':_0x425c05[_0x3524d3(0x176)]});let _0x2f2d9d=_0x5eeb0f[_0x3524d3(0x1ac)];_0x10adad&&(_0x2f2d9d=_0x5eeb0f[_0x3524d3(0x1ac)][_0x3524d3(0x175)](_0x19ec6d=>matchGlobPattern(_0x19ec6d[_0x3524d3(0x1c2)],_0x10adad)));const _0x5ec584=_0x425c05['site'];if(_0x425c05[_0x3524d3(0x1ff)]===_0x3524d3(0x1e7)||_0x425c05[_0x3524d3(0x1ff)]===_0x3524d3(0x201)){const _0x554c8f=_0x2f2d9d[_0x3524d3(0x1ab)](_0x57701e=>({..._0x57701e,'url':_0x57701e[_0x3524d3(0x1b7)]?getCampaignUrl(_0x5ec584,_0x57701e[_0x3524d3(0x1b7)],_0x57701e['id']):undefined}));await handleSDKOutput(_0x554c8f,_0x425c05);}else await handleSDKOutput(_0x2f2d9d,_0x425c05);return 0x0;}}export class EngageCampaignShowCommand extends BaseCommand{['name']=a20_0x33cdc2(0x1b4);['description']=a20_0x33cdc2(0x1a3);async[a20_0x33cdc2(0x1eb)](_0x198433){const _0x4b6403=a20_0x33cdc2,{options:_0x2ebee9,args:_0x2761ae,tdx:_0x50d924}=_0x198433;if(_0x2761ae[_0x4b6403(0x1b3)]===0x0)return console[_0x4b6403(0x183)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x4b6403(0x183)](_0x4b6403(0x199)),0x1;const _0xf78855=_0x2761ae[0x0],_0x430b4d=_0x2ebee9,_0x5874e0=await resolveWorkspaceIdFromOptions(_0x430b4d,_0x50d924),_0x5eed04=_0x430b4d['full'],_0x1f785d=_0x2ebee9['site'];if(_0x5eed04){const _0x50643=await withSpinner('Fetching\x20campaign\x20\x27'+_0xf78855+_0x4b6403(0x1ad),()=>_0x50d924['engage'][_0x4b6403(0x173)](_0xf78855,_0x5874e0),{'verbose':_0x2ebee9['verbose']}),_0x362be9=_0x50643[_0x4b6403(0x1ac)],_0x217129=_0x362be9['attributes']['workspaceId']?getCampaignUrl(_0x1f785d,_0x362be9[_0x4b6403(0x1a4)]['workspaceId'],_0x362be9['id']):undefined;await handleSDKOutput([{..._0x362be9,..._0x217129&&{'url':_0x217129}}],_0x2ebee9);}else{const _0xefd169=await withSpinner(_0x4b6403(0x1b8)+_0xf78855+'\x27...',()=>_0x50d924[_0x4b6403(0x1bc)][_0x4b6403(0x200)](_0xf78855,_0x5874e0),{'verbose':_0x2ebee9[_0x4b6403(0x176)]}),_0xab83ce=_0xefd169[_0x4b6403(0x1ac)],_0x28cc68=_0xab83ce[_0x4b6403(0x1b7)]?getCampaignUrl(_0x1f785d,_0xab83ce[_0x4b6403(0x1b7)],_0xab83ce['id']):undefined;await handleSingleObjectOutput({..._0xab83ce,..._0x28cc68&&{'url':_0x28cc68}},_0x2ebee9);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]=a20_0x33cdc2(0x181);[a20_0x33cdc2(0x1d3)]=a20_0x33cdc2(0x179);async[a20_0x33cdc2(0x1eb)](_0x3eb4aa){const _0x3f8785=a20_0x33cdc2,{options:_0x1cceb5,tdx:_0x111a32}=_0x3eb4aa,_0x2d0b67=_0x1cceb5,_0xeb8071=_0x2d0b67['name'],_0x4d7f55=_0x2d0b67[_0x3f8785(0x1c0)];if(!_0xeb8071)return console['error']('Error:\x20--name\x20is\x20required'),console['error'](_0x3f8785(0x1e1)),0x1;if(!_0x4d7f55)return console['error'](_0x3f8785(0x1ce)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;const _0x4e42e1=await resolveWorkspaceIdFromOptions(_0x2d0b67,_0x111a32,!![]),_0x4b70a8=await resolveSegmentFromOptions(_0x2d0b67,_0x111a32),_0x42165c=buildConnectorConfig(_0x2d0b67),_0x429e58={'name':_0xeb8071,'campaignType':_0x4d7f55,'workspaceId':_0x4e42e1,'description':_0x2d0b67[_0x3f8785(0x1d3)],..._0x4b70a8,'connectorConfig':_0x42165c,'startAt':_0x2d0b67[_0x3f8785(0x198)],'timezone':_0x2d0b67[_0x3f8785(0x1db)]},_0x4983b5=await withSpinner(_0x3f8785(0x1dd)+_0xeb8071+_0x3f8785(0x1ad),()=>_0x111a32[_0x3f8785(0x1bc)][_0x3f8785(0x1e9)](_0x429e58));return await handleSDKOutput([_0x4983b5[_0x3f8785(0x1ac)]],_0x1cceb5),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{['name']='engage:campaign:update';[a20_0x33cdc2(0x1d3)]='Update\x20a\x20campaign';async[a20_0x33cdc2(0x1eb)](_0x28dd5d){const _0x344039=a20_0x33cdc2,{options:_0x160ecb,args:_0x4e608c,tdx:_0x5165a3}=_0x28dd5d;if(_0x4e608c['length']===0x0)return console[_0x344039(0x183)](_0x344039(0x191)),console[_0x344039(0x183)](_0x344039(0x1f1)),0x1;const _0x2d4674=_0x4e608c[0x0],_0x3a8c0e=_0x160ecb,_0x30fc8e=await resolveWorkspaceIdFromOptions(_0x3a8c0e,_0x5165a3),_0x1a8595=await resolveSegmentFromOptions(_0x3a8c0e,_0x5165a3),_0x367303=buildConnectorConfig(_0x3a8c0e),_0x4432aa={'name':_0x3a8c0e['name'],'description':_0x3a8c0e[_0x344039(0x1d3)],..._0x1a8595,'connectorConfig':_0x367303,'startAt':_0x3a8c0e[_0x344039(0x198)],'timezone':_0x3a8c0e[_0x344039(0x1db)]},_0x25596e=Object[_0x344039(0x1f4)](Object['entries'](_0x4432aa)[_0x344039(0x175)](([,_0x186d2f])=>_0x186d2f!==undefined));if(Object['keys'](_0x25596e)['length']===0x0)return console[_0x344039(0x183)](_0x344039(0x1c1)),console[_0x344039(0x183)](_0x344039(0x1a9)),0x1;const _0x4ca839=await withSpinner('Updating\x20campaign\x20\x27'+_0x2d4674+_0x344039(0x1ad),()=>_0x5165a3[_0x344039(0x1bc)][_0x344039(0x18b)](_0x2d4674,_0x25596e,_0x30fc8e),{'verbose':_0x160ecb[_0x344039(0x176)]});return await handleSDKOutput([_0x4ca839[_0x344039(0x1ac)]],_0x160ecb),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]=a20_0x33cdc2(0x184);[a20_0x33cdc2(0x1d3)]=a20_0x33cdc2(0x18f);async['execute'](_0x3a2739){const _0x315237=a20_0x33cdc2,{options:_0x3c6f5d,args:_0x2f0ea8,tdx:_0x3a409a}=_0x3a2739;if(_0x2f0ea8[_0x315237(0x1b3)]===0x0)return console['error'](_0x315237(0x191)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>'),0x1;const _0x3451ce=_0x2f0ea8[0x0],_0x16c148=_0x3c6f5d,_0x2bf52f=await resolveWorkspaceIdFromOptions(_0x16c148,_0x3a409a);if(!_0x3c6f5d[_0x315237(0x1ef)]){const _0xf32371=await confirm(_0x315237(0x204)+_0x3451ce+_0x315237(0x1cd));if(!_0xf32371)return console[_0x315237(0x17c)](_0x315237(0x1c9)),0x0;}return await withSpinner(_0x315237(0x17d)+_0x3451ce+_0x315237(0x1ad),()=>_0x3a409a['engage'][_0x315237(0x1e3)](_0x3451ce,_0x2bf52f),{'verbose':_0x3c6f5d[_0x315237(0x176)]}),console[_0x315237(0x17c)]('Campaign\x20\x27'+_0x3451ce+_0x315237(0x208)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]=a20_0x33cdc2(0x1f2);[a20_0x33cdc2(0x1d3)]=a20_0x33cdc2(0x1de);async[a20_0x33cdc2(0x1eb)](_0x5976a8){const _0x4683b8=a20_0x33cdc2,{options:_0x361d81,args:_0xfb4d8c,tdx:_0x4f2ec5}=_0x5976a8;if(_0xfb4d8c[_0x4683b8(0x1b3)]===0x0)return console[_0x4683b8(0x183)](_0x4683b8(0x191)),console[_0x4683b8(0x183)](_0x4683b8(0x1d1)),0x1;const _0x44dcab=_0xfb4d8c[0x0],_0x2ef164=_0x361d81,_0x3f2aaf=await resolveWorkspaceIdFromOptions(_0x2ef164,_0x4f2ec5);return await withSpinner('Launching\x20campaign\x20\x27'+_0x44dcab+_0x4683b8(0x1ad),()=>_0x4f2ec5['engage'][_0x4683b8(0x209)](_0x44dcab,_0x3f2aaf),{'verbose':_0x361d81[_0x4683b8(0x176)]}),console[_0x4683b8(0x17c)](_0x4683b8(0x1ed)+_0x44dcab+'\x27\x20launched\x20successfully'),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{['name']=a20_0x33cdc2(0x193);['description']=a20_0x33cdc2(0x17a);async[a20_0x33cdc2(0x1eb)](_0x369f94){const _0xc635ae=a20_0x33cdc2,{options:_0xf8c570,args:_0x2abffe,tdx:_0x1ae5f5}=_0x369f94;if(_0x2abffe[_0xc635ae(0x1b3)]===0x0)return console[_0xc635ae(0x183)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0xc635ae(0x183)]('Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>'),0x1;const _0x2ec1f1=_0x2abffe[0x0],_0x16aee2=_0xf8c570,_0x208d01=await resolveWorkspaceIdFromOptions(_0x16aee2,_0x1ae5f5);return await withSpinner(_0xc635ae(0x1da)+_0x2ec1f1+_0xc635ae(0x1ad),()=>_0x1ae5f5['engage'][_0xc635ae(0x1aa)](_0x2ec1f1,_0x208d01),{'verbose':_0xf8c570[_0xc635ae(0x176)]}),console['log'](_0xc635ae(0x1ed)+_0x2ec1f1+'\x27\x20paused\x20successfully'),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]='engage:campaign:resume';[a20_0x33cdc2(0x1d3)]=a20_0x33cdc2(0x1a7);async[a20_0x33cdc2(0x1eb)](_0x1b5606){const _0x50132=a20_0x33cdc2,{options:_0xca0376,args:_0x1acb62,tdx:_0x1ea252}=_0x1b5606;if(_0x1acb62['length']===0x0)return console[_0x50132(0x183)](_0x50132(0x191)),console[_0x50132(0x183)](_0x50132(0x1b6)),0x1;const _0x306053=_0x1acb62[0x0],_0x41de07=_0xca0376,_0x560c11=await resolveWorkspaceIdFromOptions(_0x41de07,_0x1ea252);return await withSpinner(_0x50132(0x1fe)+_0x306053+_0x50132(0x1ad),()=>_0x1ea252[_0x50132(0x1bc)]['resumeCampaign'](_0x306053,_0x560c11),{'verbose':_0xca0376[_0x50132(0x176)]}),console[_0x50132(0x17c)](_0x50132(0x1ed)+_0x306053+_0x50132(0x1e0)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]=a20_0x33cdc2(0x1e4);[a20_0x33cdc2(0x1d3)]=a20_0x33cdc2(0x1df);async[a20_0x33cdc2(0x1eb)](_0x13762b){const _0x2bf79c=a20_0x33cdc2,{options:_0xacdf4d,args:_0xb31df7,tdx:_0x1a9906}=_0x13762b;if(_0xb31df7[_0x2bf79c(0x1b3)]===0x0)return console[_0x2bf79c(0x183)](_0x2bf79c(0x191)),console[_0x2bf79c(0x183)](_0x2bf79c(0x190)),0x1;const _0x1cbb99=_0xb31df7[0x0],_0x3588be=_0xacdf4d,_0x166e8d=await resolveWorkspaceIdFromOptions(_0x3588be,_0x1a9906),_0x1f46b4=await withSpinner(_0x2bf79c(0x205)+_0x1cbb99+_0x2bf79c(0x1ad),()=>_0x1a9906[_0x2bf79c(0x1bc)][_0x2bf79c(0x1d7)](_0x1cbb99,_0x166e8d),{'verbose':_0xacdf4d[_0x2bf79c(0x176)]});return await handleSDKOutput([_0x1f46b4[_0x2bf79c(0x1ac)]],_0xacdf4d),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]=a20_0x33cdc2(0x1c8);[a20_0x33cdc2(0x1d3)]=a20_0x33cdc2(0x1b1);async['execute'](_0x50aa9b){const _0x1a2afd=a20_0x33cdc2,{options:_0x56e01c,args:_0x4d1172,tdx:_0x5efe71}=_0x50aa9b,_0x1c230c=_0x4d1172[0x0],_0x1a587a=resolveLimit(_0x56e01c[_0x1a2afd(0x19a)],DEFAULT_LLM_LIMIT),_0x4508ff=_0x56e01c,_0x338831=await resolveWorkspaceIdFromOptions(_0x4508ff,_0x5efe71),_0x80e9de=await withSpinner(_0x1a2afd(0x1f7),()=>_0x5efe71[_0x1a2afd(0x1bc)][_0x1a2afd(0x20a)]({'workspaceId':_0x338831,'limit':_0x1a587a}),{'verbose':_0x56e01c['verbose']});let _0x440038=_0x80e9de[_0x1a2afd(0x1ac)];return _0x1c230c&&(_0x440038=_0x80e9de['data'][_0x1a2afd(0x175)](_0x35fe4=>matchGlobPattern(_0x35fe4[_0x1a2afd(0x1c2)],_0x1c230c))),await handleSDKOutput(_0x440038,_0x56e01c),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]=a20_0x33cdc2(0x18e);['description']=a20_0x33cdc2(0x20b);async[a20_0x33cdc2(0x1eb)](_0x5e7f84){const _0x414c81=a20_0x33cdc2,{options:_0x2fc27f,args:_0x1c6dbf,tdx:_0x4f8d12}=_0x5e7f84;if(_0x1c6dbf[_0x414c81(0x1b3)]===0x0)return console[_0x414c81(0x183)](_0x414c81(0x188)),console[_0x414c81(0x183)](_0x414c81(0x1b2)),0x1;const _0x35b48a=_0x1c6dbf[0x0],_0x1bdb9d=_0x2fc27f,_0x49e85f=await resolveWorkspaceIdFromOptions(_0x1bdb9d,_0x4f8d12),_0x33c1e9=_0x1bdb9d[_0x414c81(0x1e2)];if(_0x33c1e9){const _0x1c6e7a=await withSpinner(_0x414c81(0x19b)+_0x35b48a+_0x414c81(0x1ad),()=>_0x4f8d12[_0x414c81(0x1bc)]['getTemplateFull'](_0x35b48a,_0x49e85f),{'verbose':_0x2fc27f[_0x414c81(0x176)]});await handleSDKOutput([_0x1c6e7a],_0x2fc27f);}else{const _0x4d2ae7=await withSpinner(_0x414c81(0x19b)+_0x35b48a+_0x414c81(0x1ad),()=>_0x4f8d12[_0x414c81(0x1bc)][_0x414c81(0x1b9)](_0x35b48a,_0x49e85f),{'verbose':_0x2fc27f['verbose']});await handleSDKOutput([_0x4d2ae7],_0x2fc27f);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]=a20_0x33cdc2(0x17e);[a20_0x33cdc2(0x1d3)]=a20_0x33cdc2(0x1fc);async[a20_0x33cdc2(0x1eb)](_0x31c870){const _0x16699b=a20_0x33cdc2,{options:_0x5b665e,tdx:_0x1f256c}=_0x31c870,_0x27ec27=_0x5b665e,_0x106bf4=_0x27ec27['name'],_0x211c09=_0x27ec27[_0x16699b(0x192)],_0x1d5d13=_0x27ec27[_0x16699b(0x1bd)],_0x32fc78=_0x27ec27[_0x16699b(0x1ec)];if(!_0x106bf4)return console[_0x16699b(0x183)](_0x16699b(0x1d8)),console[_0x16699b(0x183)]('Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>'),0x1;if(!_0x211c09)return console[_0x16699b(0x183)](_0x16699b(0x1cc)),0x1;if(_0x1d5d13&&_0x32fc78)return console[_0x16699b(0x183)](_0x16699b(0x1f5)),0x1;const _0x242c22=_0x32fc78?readFileContent(_0x32fc78):_0x1d5d13;if(!_0x242c22)return console[_0x16699b(0x183)](_0x16699b(0x1ee)),0x1;const _0x29ff11=await resolveWorkspaceIdFromOptions(_0x27ec27,_0x1f256c,!![]),_0x1ced63={'name':_0x106bf4,'subjectTemplate':_0x211c09,'htmlTemplate':_0x242c22,'workspaceId':_0x29ff11,'plaintextTemplate':_0x27ec27[_0x16699b(0x1a8)],'editorType':_0x27ec27[_0x16699b(0x1c6)]},_0x69a784=await withSpinner(_0x16699b(0x189)+_0x106bf4+_0x16699b(0x1ad),()=>_0x1f256c[_0x16699b(0x1bc)][_0x16699b(0x1f3)](_0x1ced63));return await handleSDKOutput([_0x69a784['data']],_0x5b665e),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]=a20_0x33cdc2(0x182);[a20_0x33cdc2(0x1d3)]='Update\x20an\x20email\x20template';async[a20_0x33cdc2(0x1eb)](_0x3dce75){const _0x433528=a20_0x33cdc2,{options:_0x161d97,args:_0x5430c9,tdx:_0x5cb3ed}=_0x3dce75;if(_0x5430c9[_0x433528(0x1b3)]===0x0)return console['error'](_0x433528(0x188)),console[_0x433528(0x183)](_0x433528(0x1d0)),0x1;const _0x1e7fb8=_0x5430c9[0x0],_0x4e3c77=_0x161d97,_0x21feb0=_0x4e3c77['html'],_0x4de053=_0x4e3c77[_0x433528(0x1ec)];if(_0x21feb0&&_0x4de053)return console[_0x433528(0x183)]('Error:\x20Cannot\x20specify\x20both\x20--html\x20and\x20--html-file'),0x1;const _0x2259f0=_0x4de053?readFileContent(_0x4de053):_0x21feb0,_0x15eb09=await resolveWorkspaceIdFromOptions(_0x4e3c77,_0x5cb3ed),_0x42b29f={'name':_0x4e3c77[_0x433528(0x1c2)],'subjectTemplate':_0x4e3c77[_0x433528(0x192)],'htmlTemplate':_0x2259f0,'plaintextTemplate':_0x4e3c77[_0x433528(0x1a8)]},_0x4f8351=Object[_0x433528(0x1f4)](Object[_0x433528(0x1f9)](_0x42b29f)[_0x433528(0x175)](([,_0x32eef8])=>_0x32eef8!==undefined));if(Object[_0x433528(0x1f6)](_0x4f8351)[_0x433528(0x1b3)]===0x0)return console[_0x433528(0x183)](_0x433528(0x1c1)),console['error'](_0x433528(0x18c)),0x1;const _0x4898e8=await withSpinner(_0x433528(0x196)+_0x1e7fb8+_0x433528(0x1ad),()=>_0x5cb3ed[_0x433528(0x1bc)][_0x433528(0x17b)](_0x1e7fb8,_0x4f8351,_0x15eb09),{'verbose':_0x161d97[_0x433528(0x176)]});return await handleSDKOutput([_0x4898e8[_0x433528(0x1ac)]],_0x161d97),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{['name']=a20_0x33cdc2(0x1e8);[a20_0x33cdc2(0x1d3)]='Delete\x20an\x20email\x20template';async[a20_0x33cdc2(0x1eb)](_0xb570e9){const _0x5d6112=a20_0x33cdc2,{options:_0x586ca1,args:_0xff7da,tdx:_0x435a12}=_0xb570e9;if(_0xff7da[_0x5d6112(0x1b3)]===0x0)return console['error'](_0x5d6112(0x188)),console[_0x5d6112(0x183)]('Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>'),0x1;const _0xffb99f=_0xff7da[0x0],_0x396fe8=_0x586ca1,_0x193710=await resolveWorkspaceIdFromOptions(_0x396fe8,_0x435a12);if(!_0x586ca1[_0x5d6112(0x1ef)]){const _0x596404=await confirm(_0x5d6112(0x1d4)+_0xffb99f+_0x5d6112(0x1cd));if(!_0x596404)return console['log'](_0x5d6112(0x1c9)),0x0;}return await withSpinner('Deleting\x20template\x20\x27'+_0xffb99f+'\x27...',()=>_0x435a12['engage'][_0x5d6112(0x1a0)](_0xffb99f,_0x193710),{'verbose':_0x586ca1['verbose']}),console[_0x5d6112(0x17c)](_0x5d6112(0x203)+_0xffb99f+_0x5d6112(0x208)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]='engage:workspaces';['description']=a20_0x33cdc2(0x19e);async[a20_0x33cdc2(0x1eb)](_0x11a216){const _0x40e402=a20_0x33cdc2,{options:_0x780f7,args:_0x467345,tdx:_0x8e5eb0}=_0x11a216,_0x55bdfe=_0x467345[0x0],_0x9a2983=resolveLimit(_0x780f7['limit'],DEFAULT_LLM_LIMIT),_0x2324bb=await withSpinner(_0x40e402(0x1c5),()=>_0x8e5eb0[_0x40e402(0x1bc)][_0x40e402(0x19c)]({'limit':_0x9a2983}),{'verbose':_0x780f7[_0x40e402(0x176)]});let _0x202bae=_0x2324bb[_0x40e402(0x1ac)];return _0x55bdfe&&(_0x202bae=_0x2324bb[_0x40e402(0x1ac)]['filter'](_0xdb400f=>matchGlobPattern(_0xdb400f[_0x40e402(0x1c2)],_0x55bdfe))),await handleSDKOutput(_0x202bae,_0x780f7),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]=a20_0x33cdc2(0x1f0);['description']=a20_0x33cdc2(0x194);async[a20_0x33cdc2(0x1eb)](_0x26919b){const _0x1c064c=a20_0x33cdc2,{options:_0x1ac186,args:_0x230a53,tdx:_0x4f68c4}=_0x26919b;if(_0x230a53['length']===0x0)return console['error']('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x1c064c(0x183)]('Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>'),0x1;const _0x57f6bd=_0x230a53[0x0],_0xcda20e=_0x1ac186,_0x22bead=_0xcda20e['full'];if(_0x22bead){const _0x404150=await withSpinner(_0x1c064c(0x1dc)+_0x57f6bd+_0x1c064c(0x1ad),()=>_0x4f68c4[_0x1c064c(0x1bc)][_0x1c064c(0x177)](_0x57f6bd),{'verbose':_0x1ac186['verbose']});await handleSDKOutput([_0x404150],_0x1ac186);}else{const _0x39db7e=await withSpinner(_0x1c064c(0x1dc)+_0x57f6bd+_0x1c064c(0x1ad),()=>_0x4f68c4[_0x1c064c(0x1bc)][_0x1c064c(0x195)](_0x57f6bd),{'verbose':_0x1ac186[_0x1c064c(0x176)]});await handleSDKOutput([_0x39db7e],_0x1ac186);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]=a20_0x33cdc2(0x1fd);['description']='Create\x20a\x20workspace';async['execute'](_0x2bd2c0){const _0x60b5c8=a20_0x33cdc2,{options:_0x34247f,tdx:_0x2aefcd}=_0x2bd2c0,_0x1e54a4=_0x34247f,_0x3cd15a=_0x1e54a4[_0x60b5c8(0x1c2)];if(!_0x3cd15a)return console[_0x60b5c8(0x183)]('Error:\x20--name\x20is\x20required'),console[_0x60b5c8(0x183)]('Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]'),0x1;const _0x184ec7={'name':_0x3cd15a,'description':_0x1e54a4[_0x60b5c8(0x1d3)]},_0x3c3d3c=await withSpinner(_0x60b5c8(0x1a1)+_0x3cd15a+_0x60b5c8(0x1ad),()=>_0x2aefcd[_0x60b5c8(0x1bc)][_0x60b5c8(0x1ea)](_0x184ec7));return await handleSDKOutput([_0x3c3d3c[_0x60b5c8(0x1ac)]],_0x34247f),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]=a20_0x33cdc2(0x185);[a20_0x33cdc2(0x1d3)]=a20_0x33cdc2(0x1fb);async[a20_0x33cdc2(0x1eb)](_0x49af47){const _0x14c932=a20_0x33cdc2,{options:_0x154452,args:_0x5c136e,tdx:_0x40d210}=_0x49af47;if(_0x5c136e[_0x14c932(0x1b3)]===0x0)return console[_0x14c932(0x183)](_0x14c932(0x1c4)),console['error'](_0x14c932(0x1cf)),0x1;const _0x49ca32=_0x5c136e[0x0],_0x135548=_0x154452,_0x41d47b={'name':_0x135548[_0x14c932(0x1c2)],'description':_0x135548[_0x14c932(0x1d3)]},_0x5b9d73=Object['fromEntries'](Object['entries'](_0x41d47b)[_0x14c932(0x175)](([,_0x1fd7cb])=>_0x1fd7cb!==undefined));if(Object[_0x14c932(0x1f6)](_0x5b9d73)[_0x14c932(0x1b3)]===0x0)return console['error'](_0x14c932(0x1c1)),console[_0x14c932(0x183)](_0x14c932(0x19d)),0x1;const _0x6c14a8=await withSpinner(_0x14c932(0x206)+_0x49ca32+_0x14c932(0x1ad),()=>_0x40d210[_0x14c932(0x1bc)][_0x14c932(0x1c3)](_0x49ca32,_0x5b9d73),{'verbose':_0x154452[_0x14c932(0x176)]});return await handleSDKOutput([_0x6c14a8[_0x14c932(0x1ac)]],_0x154452),0x0;}}function a20_0x5f36(){const _0x3c4683=['Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','description','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','status','3480840DxvHaq','duplicateCampaign','Error:\x20--name\x20is\x20required','parentId','Pausing\x20campaign\x20\x27','timezone','Fetching\x20workspace\x20\x27','Creating\x20campaign\x20\x27','Launch\x20a\x20campaign','Duplicate\x20a\x20campaign','\x27\x20resumed\x20successfully','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','full','deleteCampaign','engage:campaign:duplicate','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','46cNQxLQ','json','engage:template:delete','createCampaign','createWorkspace','execute','htmlFile','Campaign\x20\x27','Error:\x20Either\x20--html\x20or\x20--html-file\x20is\x20required','yes','engage:workspace:show','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','engage:campaign:launch','createTemplate','fromEntries','Error:\x20Cannot\x20specify\x20both\x20--html\x20and\x20--html-file','keys','Fetching\x20templates...','Fetching\x20campaigns...','entries','segmentName','Update\x20a\x20workspace','Create\x20an\x20email\x20template','engage:workspace:create','Resuming\x20campaign\x20\x27','format','getCampaign','jsonl','Delete\x20a\x20workspace','Template\x20\x27','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','Duplicating\x20campaign\x20\x27','Updating\x20workspace\x20\x27','2029348tqyhle','\x27\x20deleted\x20successfully','launchCampaign','listTemplates','Show\x20email\x20template\x20details','1770005dHWgul','emailSenderId','getCampaignFull','Deleting\x20workspace\x20\x27','filter','verbose','getWorkspaceFull','1411680HrXrcK','Create\x20a\x20new\x20campaign','Pause\x20a\x20campaign','updateTemplate','log','Deleting\x20campaign\x20\x27','engage:template:create','992747CGugQU','Engage\x20workspace\x20set\x20to:\x20','engage:campaign:create','engage:template:update','error','engage:campaign:delete','engage:workspace:update','Set\x20workspace\x20context\x20for\x20Engage\x20commands','6GWgtNd','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','Creating\x20template\x20\x27','workspace','updateCampaign','Options:\x20--name,\x20--subject,\x20--html,\x20--html-file,\x20--plaintext','Workspace\x20is\x20required\x20for\x20this\x20operation','engage:template:show','Delete\x20a\x20campaign','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','subject','engage:campaign:pause','Show\x20workspace\x20details','getWorkspace','Updating\x20template\x20\x27','session','startAt','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','limit','Fetching\x20template\x20\x27','listWorkspaces','Options:\x20--name,\x20--description','List\x20workspaces','engage:campaigns','deleteTemplate','Creating\x20workspace\x20\x27','jsonColumns','Show\x20campaign\x20details','attributes','Error:\x20Workspace\x20name\x20is\x20required','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','Resume\x20a\x20paused\x20campaign','plaintext','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','pauseCampaign','map','data','\x27...','3601040YoudUj','segmentId','MISSING_ARGUMENT','List\x20email\x20templates','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','length','engage:campaign:show','engage_workspace','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','workspaceId','Fetching\x20campaign\x20\x27','getTemplate','segment','Workspace\x20\x27','engage','html','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','resolvePathToResource','type','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','name','updateWorkspace','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','Fetching\x20workspaces...','editorType','resolveWorkspaceId','engage:templates','Operation\x20cancelled','6553SnhAwe','engage:workspace:use','Error:\x20--subject\x20is\x20required','\x27?\x20This\x20cannot\x20be\x20undone.','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'];a20_0x5f36=function(){return _0x3c4683;};return a20_0x5f36();}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a20_0x33cdc2(0x1c2)]='engage:workspace:delete';[a20_0x33cdc2(0x1d3)]=a20_0x33cdc2(0x202);async[a20_0x33cdc2(0x1eb)](_0x157124){const _0x28c4a2=a20_0x33cdc2,{options:_0x2bfbef,args:_0x3e200f,tdx:_0x4a2167}=_0x157124;if(_0x3e200f['length']===0x0)return console['error'](_0x28c4a2(0x1c4)),console['error'](_0x28c4a2(0x1a6)),0x1;const _0x1dc015=_0x3e200f[0x0];if(!_0x2bfbef[_0x28c4a2(0x1ef)]){const _0x287380=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27'+_0x1dc015+_0x28c4a2(0x1cd));if(!_0x287380)return console['log'](_0x28c4a2(0x1c9)),0x0;}return await withSpinner(_0x28c4a2(0x174)+_0x1dc015+_0x28c4a2(0x1ad),()=>_0x4a2167[_0x28c4a2(0x1bc)]['deleteWorkspace'](_0x1dc015),{'verbose':_0x2bfbef[_0x28c4a2(0x176)]}),console[_0x28c4a2(0x17c)](_0x28c4a2(0x1bb)+_0x1dc015+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{['name']=a20_0x33cdc2(0x1cb);[a20_0x33cdc2(0x1d3)]=a20_0x33cdc2(0x186);async[a20_0x33cdc2(0x1eb)](_0x2bc02e){const _0x26635b=a20_0x33cdc2,{options:_0x5db2aa,args:_0x4154a8,tdx:_0x4374cb}=_0x2bc02e;if(_0x4154a8[_0x26635b(0x1b3)]===0x0)return console['error'](_0x26635b(0x1a5)),console['error'](_0x26635b(0x1e5)),0x1;const _0x207f97=_0x4154a8[0x0];await withSpinner('Verifying\x20workspace\x20\x27'+_0x207f97+_0x26635b(0x1ad),()=>_0x4374cb[_0x26635b(0x1bc)][_0x26635b(0x1c7)](_0x207f97));const _0x4fee81=_0x5db2aa[_0x26635b(0x197)]||undefined;return saveSessionContext({'engage_workspace':_0x207f97},_0x4fee81),console[_0x26635b(0x17c)](_0x26635b(0x180)+_0x207f97),console[_0x26635b(0x17c)](_0x26635b(0x1d2)),0x0;}}
|
|
1
|
+
const a20_0x5043dd=a20_0x6223;(function(_0x1138b8,_0xc59d7e){const _0x208dde=a20_0x6223,_0x569e01=_0x1138b8();while(!![]){try{const _0x29da95=-parseInt(_0x208dde(0x103))/0x1*(parseInt(_0x208dde(0x15f))/0x2)+parseInt(_0x208dde(0x14e))/0x3*(-parseInt(_0x208dde(0x157))/0x4)+-parseInt(_0x208dde(0x168))/0x5*(-parseInt(_0x208dde(0x124))/0x6)+parseInt(_0x208dde(0x184))/0x7*(-parseInt(_0x208dde(0x14b))/0x8)+-parseInt(_0x208dde(0x111))/0x9+parseInt(_0x208dde(0x106))/0xa*(-parseInt(_0x208dde(0x155))/0xb)+parseInt(_0x208dde(0xff))/0xc*(parseInt(_0x208dde(0x12c))/0xd);if(_0x29da95===_0xc59d7e)break;else _0x569e01['push'](_0x569e01['shift']());}catch(_0x165bdc){_0x569e01['push'](_0x569e01['shift']());}}}(a20_0x5761,0x36d1d));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{readFileContent}from'../utils/file-reader.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{getCampaignUrl}from'../sdk/client/endpoints.js';export async function resolveWorkspaceIdFromOptions(_0xade471,_0x34ec6b,_0x42530a=![]){const _0x4626ba=a20_0x6223;if(_0xade471['workspace'])return await _0x34ec6b[_0x4626ba(0x183)][_0x4626ba(0x133)](_0xade471['workspace']);const _0x2b1b90=loadSessionContext(_0xade471[_0x4626ba(0x17e)]);if(_0x2b1b90?.[_0x4626ba(0x113)])return await _0x34ec6b['engage'][_0x4626ba(0x133)](_0x2b1b90[_0x4626ba(0x113)]);if(_0x42530a)throw new SDKError(ErrorCode['MISSING_ARGUMENT'],_0x4626ba(0x126),undefined,{'helpText':_0x4626ba(0x146)});return undefined;}async function resolveSegmentFromOptions(_0x1210d4,_0x5d6125){const _0x128b9e=a20_0x6223;if(!_0x1210d4[_0x128b9e(0x151)])return{};const _0x5c6937=_0x1210d4['segment'],_0x5d6270=await _0x5d6125[_0x128b9e(0x151)][_0x128b9e(0x178)](_0x5c6937);return{'audienceId':_0x5d6270['parentId'],'audienceName':_0x5d6270[_0x128b9e(0x12e)],..._0x5d6270[_0x128b9e(0xfc)]&&{'segmentId':_0x5d6270[_0x128b9e(0xfc)],'segmentName':_0x5d6270['segmentName']}};}function buildConnectorConfig(_0x227f3a){const _0x3870a9=a20_0x6223,_0x20eaac=_0x227f3a[_0x3870a9(0x158)],_0x2e79f=_0x227f3a[_0x3870a9(0x156)];if(!_0x20eaac&&!_0x2e79f)return undefined;return{..._0x20eaac&&{'emailSenderId':_0x20eaac},..._0x2e79f&&{'jsonColumns':_0x2e79f}};}export class EngageCampaignsCommand extends BaseCommand{[a20_0x5043dd(0x114)]=a20_0x5043dd(0x12f);[a20_0x5043dd(0x18c)]='List\x20campaigns';async[a20_0x5043dd(0x11b)](_0x584a06){const _0x463c66=a20_0x5043dd,{options:_0x2edd8e,args:_0x2196b8,tdx:_0x14c97d}=_0x584a06,_0x58c3da=_0x2196b8[0x0],_0x20ba83=resolveLimit(_0x2edd8e[_0x463c66(0x18a)],DEFAULT_LLM_LIMIT),_0x1cda98=_0x2edd8e,_0x21a525=_0x1cda98['type'],_0xfa68f0=_0x1cda98[_0x463c66(0x107)],_0x15036d=await resolveWorkspaceIdFromOptions(_0x1cda98,_0x14c97d),_0x3494ea=await withSpinner(_0x463c66(0x10e),()=>_0x14c97d[_0x463c66(0x183)][_0x463c66(0x115)]({'type':_0x21a525,'status':_0xfa68f0,'workspaceId':_0x15036d,'limit':_0x20ba83}),{'verbose':_0x2edd8e['verbose']});let _0x12663c=_0x3494ea[_0x463c66(0x121)];_0x58c3da&&(_0x12663c=_0x3494ea[_0x463c66(0x121)][_0x463c66(0x16d)](_0x1f5652=>matchGlobPattern(_0x1f5652['name'],_0x58c3da)));const _0x476e63=_0x2edd8e[_0x463c66(0x13b)];if(_0x2edd8e['format']===_0x463c66(0x169)||_0x2edd8e[_0x463c66(0x119)]===_0x463c66(0x10f)){const _0x2ce81d=_0x12663c[_0x463c66(0x188)](_0x5b746d=>({..._0x5b746d,'url':_0x5b746d[_0x463c66(0x14a)]?getCampaignUrl(_0x476e63,_0x5b746d[_0x463c66(0x14a)],_0x5b746d['id']):undefined}));await handleSDKOutput(_0x2ce81d,_0x2edd8e);}else await handleSDKOutput(_0x12663c,_0x2edd8e);return 0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a20_0x5043dd(0x114)]=a20_0x5043dd(0x174);[a20_0x5043dd(0x18c)]=a20_0x5043dd(0x147);async['execute'](_0x590bc3){const _0x190869=a20_0x5043dd,{options:_0x56e042,args:_0x212481,tdx:_0x3ab1fe}=_0x590bc3;if(_0x212481['length']===0x0)return console['error'](_0x190869(0x152)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>'),0x1;const _0xd3d620=_0x212481[0x0],_0x1fe5e1=_0x56e042,_0x58d132=await resolveWorkspaceIdFromOptions(_0x1fe5e1,_0x3ab1fe),_0x3671cd=_0x1fe5e1[_0x190869(0x138)],_0x3f27d0=_0x56e042[_0x190869(0x13b)];if(_0x3671cd){const _0x2164e3=await withSpinner(_0x190869(0x18f)+_0xd3d620+_0x190869(0x129),()=>_0x3ab1fe[_0x190869(0x183)][_0x190869(0x161)](_0xd3d620,_0x58d132),{'verbose':_0x56e042[_0x190869(0x154)]}),_0x5048ca=_0x2164e3[_0x190869(0x121)],_0x5d7382=_0x5048ca[_0x190869(0x16e)]['workspaceId']?getCampaignUrl(_0x3f27d0,_0x5048ca[_0x190869(0x16e)][_0x190869(0x14a)],_0x5048ca['id']):undefined;await handleSDKOutput([{..._0x5048ca,..._0x5d7382&&{'url':_0x5d7382}}],_0x56e042);}else{const _0x162a27=await withSpinner(_0x190869(0x18f)+_0xd3d620+_0x190869(0x129),()=>_0x3ab1fe[_0x190869(0x183)][_0x190869(0x172)](_0xd3d620,_0x58d132),{'verbose':_0x56e042['verbose']}),_0x1aa18d=_0x162a27['data'],_0x2080c1=_0x1aa18d['workspaceId']?getCampaignUrl(_0x3f27d0,_0x1aa18d['workspaceId'],_0x1aa18d['id']):undefined;await handleSingleObjectOutput({..._0x1aa18d,..._0x2080c1&&{'url':_0x2080c1}},_0x56e042);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{['name']='engage:campaign:create';[a20_0x5043dd(0x18c)]=a20_0x5043dd(0x116);async[a20_0x5043dd(0x11b)](_0x3cc82e){const _0x55513b=a20_0x5043dd,{options:_0x3c1193,tdx:_0x3dfdda}=_0x3cc82e,_0x2762b1=_0x3c1193,_0x494cc2=_0x2762b1[_0x55513b(0x114)],_0x56ac17=_0x2762b1[_0x55513b(0x108)];if(!_0x494cc2)return console[_0x55513b(0x11d)]('Error:\x20--name\x20is\x20required'),console['error'](_0x55513b(0x135)),0x1;if(!_0x56ac17)return console[_0x55513b(0x11d)](_0x55513b(0x140)),console[_0x55513b(0x11d)](_0x55513b(0x135)),0x1;const _0x351bc8=await resolveWorkspaceIdFromOptions(_0x2762b1,_0x3dfdda,!![]),_0x1cd5c1=await resolveSegmentFromOptions(_0x2762b1,_0x3dfdda),_0x4e1d81=buildConnectorConfig(_0x2762b1),_0x5e2f1f={'name':_0x494cc2,'campaignType':_0x56ac17,'workspaceId':_0x351bc8,'description':_0x2762b1['description'],..._0x1cd5c1,'connectorConfig':_0x4e1d81,'startAt':_0x2762b1['startAt'],'timezone':_0x2762b1[_0x55513b(0x17d)]},_0x11a0aa=await withSpinner(_0x55513b(0x132)+_0x494cc2+_0x55513b(0x129),()=>_0x3dfdda[_0x55513b(0x183)][_0x55513b(0x181)](_0x5e2f1f));return await handleSDKOutput([_0x11a0aa['data']],_0x3c1193),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a20_0x5043dd(0x114)]='engage:campaign:update';[a20_0x5043dd(0x18c)]=a20_0x5043dd(0x16c);async[a20_0x5043dd(0x11b)](_0x19f438){const _0x4427f7=a20_0x5043dd,{options:_0x1b5b8c,args:_0x3d8001,tdx:_0x1e55a8}=_0x19f438;if(_0x3d8001[_0x4427f7(0x109)]===0x0)return console[_0x4427f7(0x11d)](_0x4427f7(0x152)),console['error'](_0x4427f7(0x102)),0x1;const _0x5d62b6=_0x3d8001[0x0],_0x3fb1f6=_0x1b5b8c,_0xdfa99f=await resolveWorkspaceIdFromOptions(_0x3fb1f6,_0x1e55a8),_0x534234=await resolveSegmentFromOptions(_0x3fb1f6,_0x1e55a8),_0x1334e9=buildConnectorConfig(_0x3fb1f6),_0x4ed9df={'name':_0x3fb1f6['name'],'description':_0x3fb1f6[_0x4427f7(0x18c)],..._0x534234,'connectorConfig':_0x1334e9,'startAt':_0x3fb1f6[_0x4427f7(0x139)],'timezone':_0x3fb1f6[_0x4427f7(0x17d)]},_0x22f0aa=Object['fromEntries'](Object['entries'](_0x4ed9df)['filter'](([,_0x27fdc3])=>_0x27fdc3!==undefined));if(Object['keys'](_0x22f0aa)[_0x4427f7(0x109)]===0x0)return console[_0x4427f7(0x11d)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console['error'](_0x4427f7(0x11e)),0x1;const _0x14a6f9=await withSpinner('Updating\x20campaign\x20\x27'+_0x5d62b6+'\x27...',()=>_0x1e55a8[_0x4427f7(0x183)]['updateCampaign'](_0x5d62b6,_0x22f0aa,_0xdfa99f),{'verbose':_0x1b5b8c[_0x4427f7(0x154)]});return await handleSDKOutput([_0x14a6f9[_0x4427f7(0x121)]],_0x1b5b8c),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a20_0x5043dd(0x114)]=a20_0x5043dd(0x185);[a20_0x5043dd(0x18c)]=a20_0x5043dd(0x10a);async['execute'](_0x4793a6){const _0x304a30=a20_0x5043dd,{options:_0x19f654,args:_0x2ee37d,tdx:_0x46f3e9}=_0x4793a6;if(_0x2ee37d[_0x304a30(0x109)]===0x0)return console['error'](_0x304a30(0x152)),console[_0x304a30(0x11d)]('Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>'),0x1;const _0x1bdbd9=_0x2ee37d[0x0],_0x4d1a86=_0x19f654,_0x322127=await resolveWorkspaceIdFromOptions(_0x4d1a86,_0x46f3e9);if(!_0x19f654[_0x304a30(0x16a)]){const _0x4ee401=await confirm(_0x304a30(0x17c)+_0x1bdbd9+_0x304a30(0x12d));if(!_0x4ee401)return console[_0x304a30(0x142)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x304a30(0x164)+_0x1bdbd9+_0x304a30(0x129),()=>_0x46f3e9['engage'][_0x304a30(0x165)](_0x1bdbd9,_0x322127),{'verbose':_0x19f654[_0x304a30(0x154)]}),console[_0x304a30(0x142)](_0x304a30(0x180)+_0x1bdbd9+'\x27\x20deleted\x20successfully'),0x0;}}function a20_0x6223(_0x54efad,_0x4fb7d6){_0x54efad=_0x54efad-0xfc;const _0x5761b6=a20_0x5761();let _0x6223e9=_0x5761b6[_0x54efad];return _0x6223e9;}export class EngageCampaignLaunchCommand extends BaseCommand{[a20_0x5043dd(0x114)]='engage:campaign:launch';[a20_0x5043dd(0x18c)]=a20_0x5043dd(0x171);async[a20_0x5043dd(0x11b)](_0x22936a){const _0x58f510=a20_0x5043dd,{options:_0x888896,args:_0x278d48,tdx:_0x51f48f}=_0x22936a;if(_0x278d48[_0x58f510(0x109)]===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x58f510(0x11d)](_0x58f510(0x125)),0x1;const _0x395e2d=_0x278d48[0x0],_0x5e6dc2=_0x888896,_0x565f92=await resolveWorkspaceIdFromOptions(_0x5e6dc2,_0x51f48f);return await withSpinner('Launching\x20campaign\x20\x27'+_0x395e2d+_0x58f510(0x129),()=>_0x51f48f[_0x58f510(0x183)][_0x58f510(0x187)](_0x395e2d,_0x565f92),{'verbose':_0x888896[_0x58f510(0x154)]}),console[_0x58f510(0x142)](_0x58f510(0x180)+_0x395e2d+'\x27\x20launched\x20successfully'),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{['name']=a20_0x5043dd(0x101);[a20_0x5043dd(0x18c)]='Pause\x20a\x20campaign';async['execute'](_0x545970){const _0x18cb6e=a20_0x5043dd,{options:_0x151898,args:_0x33beb9,tdx:_0x812a3e}=_0x545970;if(_0x33beb9[_0x18cb6e(0x109)]===0x0)return console[_0x18cb6e(0x11d)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x18cb6e(0x11d)]('Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>'),0x1;const _0xea52d4=_0x33beb9[0x0],_0x16e40d=_0x151898,_0x579406=await resolveWorkspaceIdFromOptions(_0x16e40d,_0x812a3e);return await withSpinner(_0x18cb6e(0x117)+_0xea52d4+_0x18cb6e(0x129),()=>_0x812a3e[_0x18cb6e(0x183)][_0x18cb6e(0x170)](_0xea52d4,_0x579406),{'verbose':_0x151898['verbose']}),console['log'](_0x18cb6e(0x180)+_0xea52d4+_0x18cb6e(0x162)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a20_0x5043dd(0x114)]=a20_0x5043dd(0x16f);[a20_0x5043dd(0x18c)]=a20_0x5043dd(0x166);async['execute'](_0x101212){const _0xc0e115=a20_0x5043dd,{options:_0x4f5da3,args:_0x293a39,tdx:_0x19a84b}=_0x101212;if(_0x293a39[_0xc0e115(0x109)]===0x0)return console[_0xc0e115(0x11d)](_0xc0e115(0x152)),console[_0xc0e115(0x11d)]('Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>'),0x1;const _0x194442=_0x293a39[0x0],_0x5c2dc3=_0x4f5da3,_0x628b7b=await resolveWorkspaceIdFromOptions(_0x5c2dc3,_0x19a84b);return await withSpinner(_0xc0e115(0x128)+_0x194442+_0xc0e115(0x129),()=>_0x19a84b[_0xc0e115(0x183)][_0xc0e115(0x10d)](_0x194442,_0x628b7b),{'verbose':_0x4f5da3[_0xc0e115(0x154)]}),console[_0xc0e115(0x142)](_0xc0e115(0x180)+_0x194442+_0xc0e115(0x136)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a20_0x5043dd(0x114)]=a20_0x5043dd(0x112);['description']=a20_0x5043dd(0x118);async['execute'](_0x1a1764){const _0x48938b=a20_0x5043dd,{options:_0x47a95c,args:_0x23ba64,tdx:_0x3e84c9}=_0x1a1764;if(_0x23ba64[_0x48938b(0x109)]===0x0)return console[_0x48938b(0x11d)](_0x48938b(0x152)),console['error'](_0x48938b(0x189)),0x1;const _0x438c14=_0x23ba64[0x0],_0x918390=_0x47a95c,_0x2a25f7=await resolveWorkspaceIdFromOptions(_0x918390,_0x3e84c9),_0xe9e97e=await withSpinner(_0x48938b(0x15e)+_0x438c14+_0x48938b(0x129),()=>_0x3e84c9[_0x48938b(0x183)][_0x48938b(0x179)](_0x438c14,_0x2a25f7),{'verbose':_0x47a95c[_0x48938b(0x154)]});return await handleSDKOutput([_0xe9e97e[_0x48938b(0x121)]],_0x47a95c),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a20_0x5043dd(0x114)]=a20_0x5043dd(0x16b);[a20_0x5043dd(0x18c)]='List\x20email\x20templates';async[a20_0x5043dd(0x11b)](_0x148eb3){const _0x464a53=a20_0x5043dd,{options:_0x174c65,args:_0x191584,tdx:_0x12ec8c}=_0x148eb3,_0x2ef509=_0x191584[0x0],_0x28a441=resolveLimit(_0x174c65[_0x464a53(0x18a)],DEFAULT_LLM_LIMIT),_0x4d8c88=_0x174c65,_0x4fa443=await resolveWorkspaceIdFromOptions(_0x4d8c88,_0x12ec8c),_0x4e7733=await withSpinner(_0x464a53(0x13f),()=>_0x12ec8c[_0x464a53(0x183)][_0x464a53(0x14f)]({'workspaceId':_0x4fa443,'limit':_0x28a441}),{'verbose':_0x174c65[_0x464a53(0x154)]});let _0x4485c8=_0x4e7733[_0x464a53(0x121)];return _0x2ef509&&(_0x4485c8=_0x4e7733['data'][_0x464a53(0x16d)](_0x497de2=>matchGlobPattern(_0x497de2[_0x464a53(0x114)],_0x2ef509))),await handleSDKOutput(_0x4485c8,_0x174c65),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a20_0x5043dd(0x114)]='engage:template:show';[a20_0x5043dd(0x18c)]='Show\x20email\x20template\x20details';async[a20_0x5043dd(0x11b)](_0x2efb81){const _0x2d96ab=a20_0x5043dd,{options:_0x188b55,args:_0x4afda3,tdx:_0xfb5ee2}=_0x2efb81;if(_0x4afda3[_0x2d96ab(0x109)]===0x0)return console[_0x2d96ab(0x11d)](_0x2d96ab(0x159)),console[_0x2d96ab(0x11d)]('Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>'),0x1;const _0x31500c=_0x4afda3[0x0],_0xacdd5=_0x188b55,_0x1dc245=await resolveWorkspaceIdFromOptions(_0xacdd5,_0xfb5ee2),_0x2278e8=_0xacdd5[_0x2d96ab(0x138)];if(_0x2278e8){const _0x30ccd4=await withSpinner(_0x2d96ab(0x13d)+_0x31500c+_0x2d96ab(0x129),()=>_0xfb5ee2['engage'][_0x2d96ab(0x131)](_0x31500c,_0x1dc245),{'verbose':_0x188b55['verbose']});await handleSDKOutput([_0x30ccd4],_0x188b55);}else{const _0xd7fef9=await withSpinner(_0x2d96ab(0x13d)+_0x31500c+'\x27...',()=>_0xfb5ee2[_0x2d96ab(0x183)][_0x2d96ab(0xfd)](_0x31500c,_0x1dc245),{'verbose':_0x188b55['verbose']});await handleSDKOutput([_0xd7fef9],_0x188b55);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a20_0x5043dd(0x114)]=a20_0x5043dd(0x10b);[a20_0x5043dd(0x18c)]=a20_0x5043dd(0x17b);async[a20_0x5043dd(0x11b)](_0x594db9){const _0x318ff9=a20_0x5043dd,{options:_0x21dcb5,tdx:_0x124c6c}=_0x594db9,_0x5d095d=_0x21dcb5,_0x46331b=_0x5d095d[_0x318ff9(0x114)],_0x167d26=_0x5d095d[_0x318ff9(0x176)],_0x517f31=_0x5d095d['html'],_0x2f3036=_0x5d095d[_0x318ff9(0x167)];if(!_0x46331b)return console[_0x318ff9(0x11d)](_0x318ff9(0x175)),console[_0x318ff9(0x11d)](_0x318ff9(0x120)),0x1;if(!_0x167d26)return console['error']('Error:\x20--subject\x20is\x20required'),0x1;if(_0x517f31&&_0x2f3036)return console[_0x318ff9(0x11d)](_0x318ff9(0x13a)),0x1;const _0x589f02=_0x2f3036?readFileContent(_0x2f3036):_0x517f31;if(!_0x589f02)return console[_0x318ff9(0x11d)](_0x318ff9(0x182)),0x1;const _0x1d3c91=await resolveWorkspaceIdFromOptions(_0x5d095d,_0x124c6c,!![]),_0x5d868a={'name':_0x46331b,'subjectTemplate':_0x167d26,'htmlTemplate':_0x589f02,'workspaceId':_0x1d3c91,'plaintextTemplate':_0x5d095d[_0x318ff9(0x14d)],'editorType':_0x5d095d[_0x318ff9(0x110)]},_0x8a39fe=await withSpinner(_0x318ff9(0x173)+_0x46331b+_0x318ff9(0x129),()=>_0x124c6c[_0x318ff9(0x183)]['createTemplate'](_0x5d868a));return await handleSDKOutput([_0x8a39fe[_0x318ff9(0x121)]],_0x21dcb5),0x0;}}function a20_0x5761(){const _0x41a565=['151NxpkYp','Update\x20an\x20email\x20template','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','3833030wnWiSe','status','type','length','Delete\x20a\x20campaign','engage:template:create','Updating\x20template\x20\x27','resumeCampaign','Fetching\x20campaigns...','jsonl','editorType','1809918LcyRPE','engage:campaign:duplicate','engage_workspace','name','listCampaigns','Create\x20a\x20new\x20campaign','Pausing\x20campaign\x20\x27','Duplicate\x20a\x20campaign','format','Update\x20a\x20workspace','execute','Create\x20a\x20workspace','error','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','engage:workspace:update','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','data','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','listWorkspaces','1726782qIuHtB','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','Workspace\x20is\x20required\x20for\x20this\x20operation','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','Resuming\x20campaign\x20\x27','\x27...','Template\x20\x27','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','4433hAbhVL','\x27?\x20This\x20cannot\x20be\x20undone.','parentName','engage:campaigns','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','getTemplateFull','Creating\x20campaign\x20\x27','resolveWorkspaceId','Updating\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','\x27\x20resumed\x20successfully','Set\x20workspace\x20context\x20for\x20Engage\x20commands','full','startAt','Error:\x20Cannot\x20specify\x20both\x20--html\x20and\x20--html-file','site','updateWorkspace','Fetching\x20template\x20\x27','Creating\x20workspace\x20\x27','Fetching\x20templates...','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','Fetching\x20workspaces...','log','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','deleteWorkspace','Verifying\x20workspace\x20\x27','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','Show\x20campaign\x20details','html','engage:workspaces','workspaceId','8pOiCkz','Options:\x20--name,\x20--description','plaintext','28686kcMTGZ','listTemplates','\x27\x20deleted\x20successfully','segment','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','deleteTemplate','verbose','11pVakzL','jsonColumns','96FpRRzH','emailSenderId','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Delete\x20an\x20email\x20template','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','engage:workspace:show','Duplicating\x20campaign\x20\x27','1006ARRdiC','Deleting\x20template\x20\x27','getCampaignFull','\x27\x20paused\x20successfully','Delete\x20a\x20workspace','Deleting\x20campaign\x20\x27','deleteCampaign','Resume\x20a\x20paused\x20campaign','htmlFile','5prTvGk','json','yes','engage:templates','Update\x20a\x20campaign','filter','attributes','engage:campaign:resume','pauseCampaign','Launch\x20a\x20campaign','getCampaign','Creating\x20template\x20\x27','engage:campaign:show','Error:\x20--name\x20is\x20required','subject','entries','resolvePathToResource','duplicateCampaign','engage:workspace:use','Create\x20an\x20email\x20template','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','timezone','session','Operation\x20cancelled','Campaign\x20\x27','createCampaign','Error:\x20Either\x20--html\x20or\x20--html-file\x20is\x20required','engage','2565983yZlObj','engage:campaign:delete','List\x20workspaces','launchCampaign','map','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','limit','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','description','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','fromEntries','Fetching\x20campaign\x20\x27','getWorkspaceFull','Workspace\x20\x27','segmentId','getTemplate','Fetching\x20workspace\x20\x27','41988DgjlhE','keys','engage:campaign:pause','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'];a20_0x5761=function(){return _0x41a565;};return a20_0x5761();}export class EngageTemplateUpdateCommand extends BaseCommand{[a20_0x5043dd(0x114)]='engage:template:update';[a20_0x5043dd(0x18c)]=a20_0x5043dd(0x104);async[a20_0x5043dd(0x11b)](_0x2bf84a){const _0x4796cc=a20_0x5043dd,{options:_0x7c7297,args:_0x571128,tdx:_0x37efb2}=_0x2bf84a;if(_0x571128[_0x4796cc(0x109)]===0x0)return console[_0x4796cc(0x11d)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x4796cc(0x11d)](_0x4796cc(0x18b)),0x1;const _0x408ec9=_0x571128[0x0],_0x5bca07=_0x7c7297,_0x2d590f=_0x5bca07[_0x4796cc(0x148)],_0xb7139=_0x5bca07[_0x4796cc(0x167)];if(_0x2d590f&&_0xb7139)return console['error'](_0x4796cc(0x13a)),0x1;const _0xe57802=_0xb7139?readFileContent(_0xb7139):_0x2d590f,_0x366263=await resolveWorkspaceIdFromOptions(_0x5bca07,_0x37efb2),_0x425a1d={'name':_0x5bca07['name'],'subjectTemplate':_0x5bca07['subject'],'htmlTemplate':_0xe57802,'plaintextTemplate':_0x5bca07[_0x4796cc(0x14d)]},_0x536b72=Object[_0x4796cc(0x18e)](Object[_0x4796cc(0x177)](_0x425a1d)[_0x4796cc(0x16d)](([,_0x165e1a])=>_0x165e1a!==undefined));if(Object[_0x4796cc(0x100)](_0x536b72)[_0x4796cc(0x109)]===0x0)return console[_0x4796cc(0x11d)](_0x4796cc(0x105)),console[_0x4796cc(0x11d)]('Options:\x20--name,\x20--subject,\x20--html,\x20--html-file,\x20--plaintext'),0x1;const _0x2aecaf=await withSpinner(_0x4796cc(0x10c)+_0x408ec9+_0x4796cc(0x129),()=>_0x37efb2[_0x4796cc(0x183)]['updateTemplate'](_0x408ec9,_0x536b72,_0x366263),{'verbose':_0x7c7297[_0x4796cc(0x154)]});return await handleSDKOutput([_0x2aecaf['data']],_0x7c7297),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a20_0x5043dd(0x114)]='engage:template:delete';[a20_0x5043dd(0x18c)]=a20_0x5043dd(0x15b);async[a20_0x5043dd(0x11b)](_0x558e07){const _0x54b5f7=a20_0x5043dd,{options:_0x42175d,args:_0x363afc,tdx:_0x2a42c0}=_0x558e07;if(_0x363afc[_0x54b5f7(0x109)]===0x0)return console[_0x54b5f7(0x11d)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x54b5f7(0x11d)](_0x54b5f7(0x143)),0x1;const _0x2f90bf=_0x363afc[0x0],_0x392d16=_0x42175d,_0x4beb57=await resolveWorkspaceIdFromOptions(_0x392d16,_0x2a42c0);if(!_0x42175d[_0x54b5f7(0x16a)]){const _0x546eaf=await confirm(_0x54b5f7(0x12b)+_0x2f90bf+_0x54b5f7(0x12d));if(!_0x546eaf)return console[_0x54b5f7(0x142)](_0x54b5f7(0x17f)),0x0;}return await withSpinner(_0x54b5f7(0x160)+_0x2f90bf+_0x54b5f7(0x129),()=>_0x2a42c0[_0x54b5f7(0x183)][_0x54b5f7(0x153)](_0x2f90bf,_0x4beb57),{'verbose':_0x42175d[_0x54b5f7(0x154)]}),console[_0x54b5f7(0x142)](_0x54b5f7(0x12a)+_0x2f90bf+_0x54b5f7(0x150)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a20_0x5043dd(0x114)]=a20_0x5043dd(0x149);[a20_0x5043dd(0x18c)]=a20_0x5043dd(0x186);async['execute'](_0x20b1a5){const _0x38b4a7=a20_0x5043dd,{options:_0xb95695,args:_0x52ee5e,tdx:_0x1628dc}=_0x20b1a5,_0xf00366=_0x52ee5e[0x0],_0x2c23f4=resolveLimit(_0xb95695[_0x38b4a7(0x18a)],DEFAULT_LLM_LIMIT),_0x52a6ce=await withSpinner(_0x38b4a7(0x141),()=>_0x1628dc['engage'][_0x38b4a7(0x123)]({'limit':_0x2c23f4}),{'verbose':_0xb95695['verbose']});let _0x445e81=_0x52a6ce[_0x38b4a7(0x121)];return _0xf00366&&(_0x445e81=_0x52a6ce[_0x38b4a7(0x121)][_0x38b4a7(0x16d)](_0x58185c=>matchGlobPattern(_0x58185c[_0x38b4a7(0x114)],_0xf00366))),await handleSDKOutput(_0x445e81,_0xb95695),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{['name']=a20_0x5043dd(0x15d);[a20_0x5043dd(0x18c)]='Show\x20workspace\x20details';async[a20_0x5043dd(0x11b)](_0x138fe8){const _0x349fec=a20_0x5043dd,{options:_0x198010,args:_0x118c99,tdx:_0x3b38a6}=_0x138fe8;if(_0x118c99[_0x349fec(0x109)]===0x0)return console[_0x349fec(0x11d)](_0x349fec(0x130)),console['error'](_0x349fec(0x122)),0x1;const _0x3f521c=_0x118c99[0x0],_0x51efe0=_0x198010,_0x410f6c=_0x51efe0[_0x349fec(0x138)];if(_0x410f6c){const _0x253d01=await withSpinner(_0x349fec(0xfe)+_0x3f521c+_0x349fec(0x129),()=>_0x3b38a6['engage'][_0x349fec(0x190)](_0x3f521c),{'verbose':_0x198010[_0x349fec(0x154)]});await handleSDKOutput([_0x253d01],_0x198010);}else{const _0x3d45c9=await withSpinner(_0x349fec(0xfe)+_0x3f521c+'\x27...',()=>_0x3b38a6[_0x349fec(0x183)]['getWorkspace'](_0x3f521c),{'verbose':_0x198010[_0x349fec(0x154)]});await handleSDKOutput([_0x3d45c9],_0x198010);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{['name']='engage:workspace:create';[a20_0x5043dd(0x18c)]=a20_0x5043dd(0x11c);async[a20_0x5043dd(0x11b)](_0x309a12){const _0x3172f3=a20_0x5043dd,{options:_0x1ec46c,tdx:_0x1750e7}=_0x309a12,_0x4307c0=_0x1ec46c,_0x2b921f=_0x4307c0['name'];if(!_0x2b921f)return console[_0x3172f3(0x11d)](_0x3172f3(0x175)),console[_0x3172f3(0x11d)]('Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]'),0x1;const _0x175f79={'name':_0x2b921f,'description':_0x4307c0['description']},_0x48b48c=await withSpinner(_0x3172f3(0x13e)+_0x2b921f+_0x3172f3(0x129),()=>_0x1750e7['engage']['createWorkspace'](_0x175f79));return await handleSDKOutput([_0x48b48c[_0x3172f3(0x121)]],_0x1ec46c),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a20_0x5043dd(0x114)]=a20_0x5043dd(0x11f);[a20_0x5043dd(0x18c)]=a20_0x5043dd(0x11a);async[a20_0x5043dd(0x11b)](_0x5c524f){const _0x229bfd=a20_0x5043dd,{options:_0x3d6bd9,args:_0x25d33b,tdx:_0x1eccc5}=_0x5c524f;if(_0x25d33b[_0x229bfd(0x109)]===0x0)return console[_0x229bfd(0x11d)](_0x229bfd(0x130)),console['error'](_0x229bfd(0x15a)),0x1;const _0x45dc81=_0x25d33b[0x0],_0x348941=_0x3d6bd9,_0x342946={'name':_0x348941[_0x229bfd(0x114)],'description':_0x348941['description']},_0x1ad1d0=Object[_0x229bfd(0x18e)](Object[_0x229bfd(0x177)](_0x342946)[_0x229bfd(0x16d)](([,_0x3495cc])=>_0x3495cc!==undefined));if(Object[_0x229bfd(0x100)](_0x1ad1d0)[_0x229bfd(0x109)]===0x0)return console[_0x229bfd(0x11d)](_0x229bfd(0x105)),console[_0x229bfd(0x11d)](_0x229bfd(0x14c)),0x1;const _0x397550=await withSpinner(_0x229bfd(0x134)+_0x45dc81+_0x229bfd(0x129),()=>_0x1eccc5[_0x229bfd(0x183)][_0x229bfd(0x13c)](_0x45dc81,_0x1ad1d0),{'verbose':_0x3d6bd9['verbose']});return await handleSDKOutput([_0x397550[_0x229bfd(0x121)]],_0x3d6bd9),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a20_0x5043dd(0x114)]='engage:workspace:delete';[a20_0x5043dd(0x18c)]=a20_0x5043dd(0x163);async[a20_0x5043dd(0x11b)](_0x4aa108){const _0x46c87d=a20_0x5043dd,{options:_0x114eff,args:_0x1fb36b,tdx:_0x2e5a6b}=_0x4aa108;if(_0x1fb36b[_0x46c87d(0x109)]===0x0)return console[_0x46c87d(0x11d)](_0x46c87d(0x130)),console[_0x46c87d(0x11d)](_0x46c87d(0x127)),0x1;const _0x1f00df=_0x1fb36b[0x0];if(!_0x114eff[_0x46c87d(0x16a)]){const _0x25c199=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27'+_0x1f00df+_0x46c87d(0x12d));if(!_0x25c199)return console['log'](_0x46c87d(0x17f)),0x0;}return await withSpinner('Deleting\x20workspace\x20\x27'+_0x1f00df+'\x27...',()=>_0x2e5a6b[_0x46c87d(0x183)][_0x46c87d(0x144)](_0x1f00df),{'verbose':_0x114eff[_0x46c87d(0x154)]}),console[_0x46c87d(0x142)](_0x46c87d(0x191)+_0x1f00df+_0x46c87d(0x150)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a20_0x5043dd(0x114)]=a20_0x5043dd(0x17a);[a20_0x5043dd(0x18c)]=a20_0x5043dd(0x137);async[a20_0x5043dd(0x11b)](_0x52d46e){const _0x312d3c=a20_0x5043dd,{options:_0x2336ef,args:_0x32310c,tdx:_0xb846b2}=_0x52d46e;if(_0x32310c[_0x312d3c(0x109)]===0x0)return console[_0x312d3c(0x11d)]('Error:\x20Workspace\x20name\x20is\x20required'),console[_0x312d3c(0x11d)](_0x312d3c(0x18d)),0x1;const _0x1621f7=_0x32310c[0x0];await withSpinner(_0x312d3c(0x145)+_0x1621f7+'\x27...',()=>_0xb846b2['engage'][_0x312d3c(0x133)](_0x1621f7));const _0x2fb08c=_0x2336ef[_0x312d3c(0x17e)]||undefined;return saveSessionContext({'engage_workspace':_0x1621f7},_0x2fb08c),console[_0x312d3c(0x142)]('Engage\x20workspace\x20set\x20to:\x20'+_0x1621f7),console[_0x312d3c(0x142)](_0x312d3c(0x15c)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a21_0x49c5(){const _0x7dbc97=['data','yes','\x20row','Get\x20job\x20results','β\x20Retrieved\x20','priority','Status\x20filter:\x20','query','map','β\x20Kill\x20request\x20submitted\x20for\x20job\x20','submit','length','result','\x20jobs','2823304hnivKO','type','debug','trino','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Submit\x20a\x20job','args','\x20\x20Job\x20ID:\x20','verbose','3VupXWU','execute','No\x20SQL\x20statements\x20found\x20in\x20file','279EajBfr','Submitting\x20kill\x20request...','limit','Query\x20is\x20required\x0aUsage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>','jobType','538474yBRgpb','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20show\x20<job-id>','INVALID_ARGUMENT','job_id','user_name','file','3664338MRvQQh','job:kill','β\x20Found\x20','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20kill\x20<job-id>','\x20job','Job\x20ID\x20is\x20required\x0aUsage:\x20job\x20result\x20<job-id>','Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','created_at','Query:\x20','jobs','start_at','description','\x27\x20to\x20verify\x20the\x20job\x20status','status','Listing\x20jobs...','3178145tAmZVh','getTime','name','Getting\x20job\x20results...','information_schema','database','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','Cancelled','error','183016JrzaUM','end_at','Show\x20job\x20details','Kill\x20a\x20job','kill','Job\x20type:\x20','hive','...','validate','1975074vMuXiC','url','3756557NFdsOT'];a21_0x49c5=function(){return _0x7dbc97;};return a21_0x49c5();}const a21_0x4e8061=a21_0x54a5;(function(_0x4b6cbb,_0x3e2682){const _0x5d234d=a21_0x54a5,_0x1e217f=_0x4b6cbb();while(!![]){try{const _0x1da775=parseInt(_0x5d234d(0xaa))/0x1*(-parseInt(_0x5d234d(0xb2))/0x2)+parseInt(_0x5d234d(0xb8))/0x3+parseInt(_0x5d234d(0xa1))/0x4+-parseInt(_0x5d234d(0xc7))/0x5+parseInt(_0x5d234d(0xd9))/0x6+parseInt(_0x5d234d(0xdb))/0x7+parseInt(_0x5d234d(0xd0))/0x8*(-parseInt(_0x5d234d(0xad))/0x9);if(_0x1da775===_0x3e2682)break;else _0x1e217f['push'](_0x1e217f['shift']());}catch(_0x76a606){_0x1e217f['push'](_0x1e217f['shift']());}}}(a21_0x49c5,0x9c63f));function a21_0x54a5(_0x5a24c5,_0x53c534){_0x5a24c5=_0x5a24c5-0xa0;const _0x49c55b=a21_0x49c5();let _0x54a536=_0x49c55b[_0x5a24c5];return _0x54a536;}import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';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{[a21_0x4e8061(0xc9)]=a21_0x4e8061(0xc1);[a21_0x4e8061(0xc3)]='List\x20jobs';async['execute'](_0x509c6b){const _0x5b5773=a21_0x4e8061,{options:_0x97e520,tdx:_0x32fef7}=_0x509c6b,_0x4bdecd=resolveLimit(_0x97e520[_0x5b5773(0xaf)],DEFAULT_DISPLAY_LIMIT),_0x194dbb=_0x97e520[_0x5b5773(0xc5)];_0x97e520[_0x5b5773(0xa9)]&&(console['error']('Limit:\x20'+_0x4bdecd+_0x5b5773(0xa0)),_0x194dbb&&console['error'](_0x5b5773(0xe2)+_0x194dbb));const _0x10a847=await withSpinner(_0x5b5773(0xc6),()=>_0x32fef7['jobs']['list']({'from':0x0,'to':_0x4bdecd-0x1,'status':_0x194dbb}),{'verbose':_0x97e520[_0x5b5773(0xa9)]}),_0x193257=_0x10a847[_0x5b5773(0xdc)];console[_0x5b5773(0xcf)](_0x5b5773(0xba)+_0x193257['length']+_0x5b5773(0xbc)+(_0x193257[_0x5b5773(0xe7)]!==0x1?'s':''));const _0xd811fc=_0x193257[_0x5b5773(0xe4)](_0x3f89bb=>{const _0x2c3242=_0x5b5773;let _0x38dfc7;if(_0x3f89bb[_0x2c3242(0xc2)]&&_0x3f89bb['end_at']){const _0x5f36c8=new Date(_0x3f89bb[_0x2c3242(0xc2)])[_0x2c3242(0xc8)](),_0x3375a9=new Date(_0x3f89bb[_0x2c3242(0xd1)])[_0x2c3242(0xc8)]();_0x38dfc7=Math['round']((_0x3375a9-_0x5f36c8)/0x3e8);}return{'job_id':_0x3f89bb[_0x2c3242(0xb5)],'type':_0x3f89bb['type'],'status':_0x3f89bb[_0x2c3242(0xc5)],'user_name':_0x3f89bb[_0x2c3242(0xb6)],'duration_sec':_0x38dfc7,'created_at':_0x3f89bb[_0x2c3242(0xbf)],'started_at':_0x3f89bb['start_at'],'end_at':_0x3f89bb[_0x2c3242(0xd1)]};});return await handleSDKOutput(_0xd811fc,_0x97e520),0x0;}}export class JobShowCommand extends BaseCommand{[a21_0x4e8061(0xc9)]='job:show';[a21_0x4e8061(0xc3)]=a21_0x4e8061(0xd2);[a21_0x4e8061(0xd8)](_0x32e6b0){const _0x239157=a21_0x4e8061,_0x530d58=_0x32e6b0[_0x239157(0xa7)][0x0];if(!_0x530d58)return _0x239157(0xb3);return undefined;}async[a21_0x4e8061(0xab)](_0x504dfe){const _0x4a8712=a21_0x4e8061,{options:_0x267fc1,args:_0x26caae,tdx:_0x561688}=_0x504dfe,_0x27f271=_0x26caae[0x0],_0x2fbdad=await withSpinner('Getting\x20job\x20details...',()=>_0x561688['jobs']['show'](_0x27f271),{'verbose':_0x267fc1[_0x4a8712(0xa9)]}),_0x436fd7=_0x2fbdad[_0x4a8712(0xdc)];let _0x58324f;if(_0x436fd7[_0x4a8712(0xc2)]&&_0x436fd7[_0x4a8712(0xd1)]){const _0x5aa818=new Date(_0x436fd7[_0x4a8712(0xc2)])[_0x4a8712(0xc8)](),_0x473c4f=new Date(_0x436fd7[_0x4a8712(0xd1)])['getTime']();_0x58324f=Math['round']((_0x473c4f-_0x5aa818)/0x3e8);}const _0x236d31={'job_id':_0x436fd7['job_id'],'type':_0x436fd7[_0x4a8712(0xa2)],'status':_0x436fd7['status'],..._0x436fd7[_0x4a8712(0xb6)]&&{'user_name':_0x436fd7['user_name']},..._0x58324f!==undefined&&{'duration_sec':_0x58324f},..._0x436fd7[_0x4a8712(0xbf)]&&{'created_at':_0x436fd7[_0x4a8712(0xbf)]},..._0x436fd7['start_at']&&{'started_at':_0x436fd7[_0x4a8712(0xc2)]},..._0x436fd7['end_at']&&{'end_at':_0x436fd7['end_at']},..._0x436fd7['database']&&{'database':_0x436fd7[_0x4a8712(0xcc)]},..._0x436fd7[_0x4a8712(0xe1)]!==undefined&&{'priority':_0x436fd7[_0x4a8712(0xe1)]},..._0x436fd7[_0x4a8712(0xda)]&&{'url':_0x436fd7['url']},..._0x436fd7['query']&&{'query':_0x436fd7[_0x4a8712(0xe3)]},..._0x436fd7[_0x4a8712(0xa3)]&&{'debug':_0x436fd7[_0x4a8712(0xa3)]}};return await handleSingleObjectOutput(_0x236d31,_0x267fc1),0x0;}}export class JobKillCommand extends BaseCommand{[a21_0x4e8061(0xc9)]=a21_0x4e8061(0xb9);[a21_0x4e8061(0xc3)]=a21_0x4e8061(0xd3);[a21_0x4e8061(0xd8)](_0x561983){const _0x46aa68=a21_0x4e8061,_0x4e7e4e=_0x561983[_0x46aa68(0xa7)][0x0];if(!_0x4e7e4e)return _0x46aa68(0xbb);return undefined;}async[a21_0x4e8061(0xab)](_0x35508e){const _0x38d450=a21_0x4e8061,{options:_0x236af2,args:_0xb0182,tdx:_0x202f66}=_0x35508e,_0xcdf64a=_0xb0182[0x0];if(!_0x236af2[_0x38d450(0xdd)]){const _0x44e878=await confirm(_0x38d450(0xa5)+_0xcdf64a+'?');if(!_0x44e878)return console[_0x38d450(0xcf)](_0x38d450(0xce)),0x0;}return await withSpinner(_0x38d450(0xae),()=>_0x202f66[_0x38d450(0xc1)][_0x38d450(0xd4)](_0xcdf64a),{'verbose':_0x236af2[_0x38d450(0xa9)]}),console[_0x38d450(0xcf)](_0x38d450(0xe5)+_0xcdf64a),console[_0x38d450(0xcf)](_0x38d450(0xcd)+_0xcdf64a+_0x38d450(0xc4)),0x0;}}export class JobSubmitCommand extends BaseCommand{[a21_0x4e8061(0xc9)]='job:submit';['description']=a21_0x4e8061(0xa6);async[a21_0x4e8061(0xab)](_0xcd0d71){const _0x18f30f=a21_0x4e8061,{options:_0x27d7c7,args:_0x314ccd,tdx:_0xcab54c}=_0xcd0d71,_0x207fbd=_0x27d7c7[_0x18f30f(0xb1)]||'trino',_0x1991c1=_0x27d7c7[_0x18f30f(0xb7)],_0x32e7e4=_0x27d7c7[_0x18f30f(0xcc)]||_0x18f30f(0xcb),_0x3d1f08=_0x27d7c7[_0x18f30f(0xe8)];if(_0x207fbd!==_0x18f30f(0xa4)&&_0x207fbd!==_0x18f30f(0xd6))throw new SDKError(ErrorCode[_0x18f30f(0xb4)],'--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22');let _0x16730e;if(_0x1991c1){if(_0x314ccd[0x0])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x18f30f(0xbe));const _0x57ca49=readSqlStatementsFromFile(_0x1991c1);if(_0x57ca49[_0x18f30f(0xe7)]===0x0)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x18f30f(0xac));if(_0x57ca49['length']>0x1)throw new SDKError(ErrorCode[_0x18f30f(0xb4)],'Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.');_0x16730e=_0x57ca49[0x0];}else{if(!_0x314ccd[0x0])throw new SDKError(ErrorCode[_0x18f30f(0xb4)],_0x18f30f(0xb0));_0x16730e=_0x314ccd[0x0];}_0x27d7c7[_0x18f30f(0xa9)]&&(console[_0x18f30f(0xcf)](_0x18f30f(0xd5)+_0x207fbd),console['error']('Database:\x20'+_0x32e7e4),console['error'](_0x18f30f(0xc0)+_0x16730e['substring'](0x0,0x64)+(_0x16730e['length']>0x64?_0x18f30f(0xd7):'')));const _0x376043=await withSpinner('Submitting\x20job...',()=>_0xcab54c[_0x18f30f(0xc1)][_0x18f30f(0xe6)](_0x32e7e4,_0x16730e,_0x207fbd,_0x3d1f08),{'verbose':_0x27d7c7[_0x18f30f(0xa9)]}),_0x540628=_0x376043['data'];return console[_0x18f30f(0xcf)]('β\x20Job\x20submitted'),console[_0x18f30f(0xcf)](_0x18f30f(0xa8)+_0x540628['job_id']),await handleSDKOutput([_0x540628],_0x27d7c7),0x0;}}export class JobResultCommand extends BaseCommand{[a21_0x4e8061(0xc9)]='job:result';[a21_0x4e8061(0xc3)]=a21_0x4e8061(0xdf);['validate'](_0x412990){const _0x50a82a=a21_0x4e8061,_0x146730=_0x412990['args'][0x0];if(!_0x146730)return _0x50a82a(0xbd);return undefined;}async[a21_0x4e8061(0xab)](_0x351510){const _0xf10ab4=a21_0x4e8061,{options:_0x55d6c6,args:_0x1cd63e,tdx:_0x357902}=_0x351510,_0x44d9a8=_0x1cd63e[0x0],_0x2d75b3=await withSpinner(_0xf10ab4(0xca),()=>_0x357902['jobs'][_0xf10ab4(0xe8)](_0x44d9a8),{'verbose':_0x55d6c6['verbose']}),_0xa1870a=_0x2d75b3[_0xf10ab4(0xdc)];return console[_0xf10ab4(0xcf)](_0xf10ab4(0xe0)+_0xa1870a[_0xf10ab4(0xe7)]+_0xf10ab4(0xde)+(_0xa1870a[_0xf10ab4(0xe7)]!==0x1?'s':'')),await handleSDKOutput(_0xa1870a,_0x55d6c6),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a22_0x1d6769=a22_0x5d71;function a22_0x4c2c(){const _0x27a4df=['journeyName','limit','error','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','8wwMDcB','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','Resuming\x20journey...','database','Target\x20directory:\x20','diff','map','parent_segment','List\x20all\x20versions\x20of\x20a\x20journey','description','history','3DVZEqE','\x20changed\x20files','reentryMode','folders','activation','includeHistory','\x20journey\x20files\x20to\x20','No\x20statistics\x20available\x20for\x20journey:\x20','session','versionNumber','blue','replace','message','filter','/j/da','-\x20no\x20files\x20written','green','pause','root\x20folder','β\x20Journey\x20\x22','Fetching\x20users\x20and\x20connections...','β\x20Context\x20set:\x20','audienceId','journey:versions','(paused)','Folder\x20path:\x20','\x20journeys','Export\x20journey(s)\x20as\x20YAML\x20files','Getting\x20journey\x20traffic\x20data...','Usage:\x20journey\x20<subcommand>\x20<name-or-path>','segmentPushCommand','Found\x20','Pause\x20a\x20running\x20journey','renderStats','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x22\x20paused','(draft)','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','β\x20Pulled\x20','table','base','\x20journey','all','Error:\x20Version\x20','(root)','Error:\x20Invalid\x20--type\x20\x22','\x20not\x20found.\x20Available:\x20','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','Show\x20journey\x20details','repeat','9743328RsSnZp','getParentFull','add','user','Parent\x20segment:\x20','tsv','type','stageNameMap','Resolved\x20YAML\x20file:\x20','Getting\x20version\x20','\x0aChanges\x20to\x20\x27','Warning:\x20Could\x20not\x20resolve\x20segment\x20','length','\x0aPull\x20summary:','dim','paused','bold','Fetching\x20','state','activationParams','execute','List\x20activations\x20for\x20a\x20journey','no_parent','kind','Resolving\x20version...','push','4294612VNdnlI','createVersion','β\x20Found\x20','launched','journey','yes','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','...','connector_config','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','data','json','View\x20a\x20specific\x20version\x20of\x20a\x20journey','find','journey:list','sort','entries','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','isNew','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','(archived)','journeyId','Getting\x20journey\x20statistics...','version','then','folderId','journeyBundleName','\x20Created\x20v','journey:pause','web','\x20(ID:\x20','exitOrJumpRate','Pausing\x20journey...','13782411GvzuES','stringify','\x20unchanged\x20files','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','has','\x20\x20Name:\x20','goal','Listing\x20journey\x20activations...','utf-8','stages','325PzIomU','buildIdToEmailMap','log','file','\x20\x20Statistics\x20not\x20available','resourceName','listActivationsFlat','Write\x20','1050524qCHkdH','Pattern:\x20','errorCode','Input:\x20','Error:\x20Stage\x20\x22','updatedAt','getColumnMapping','values','Getting\x20journey\x20details...','setPhase','attributes','listJourneysWithFolders','Resolving\x20parent\x20segment...','conversion','1608710CyoOJO','\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.','Fetching\x20journeys\x20and\x20folders...','segment','absolutePath','createdAt','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','\x20=\x20','List\x20journeys\x20in\x20current\x20context','resolveJourneyId','.yml','goalSize','set','getActivation','π\x20','πΊοΈ\x20','\x20->\x20','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','enteredSize','format','Available\x20stages:\x20','name','/j/da/je','cyan','journey:view','Error:\x20Journey\x20not\x20found:\x20','journey:push','stage','Show\x20journey\x20table\x20column\x20mapping','No\x20journeys\x20found','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20versions)','\x20Opening\x20','helpText','args','exitOrJumpSize','completed','INVALID_ARGUMENT','\x20\x20Preserving\x20local\x20segment\x20name:\x20','\x20details...','filePath','get','\x20\x20Journey\x20ID:\x20','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','hasPeriod','\x5c$&','Show\x20journey\x20statistics','options','journeyBundleId','Cancelled','\x20\x20Consolidating\x20duplicate\x20segment:\x20','\x22\x20resumed','\x20\x20Folder\x20path:\x20','journey:traffic','connection','red','\x20(rule\x20match)','toLowerCase','relative','\x20\x20Target:\x20','jsonl','rule','test','completionRate','targetDir','/e/','163110lAlBFR','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','(running)','yellow','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','buildIdToNameMap','tdx.json','β\x20All\x20files\x20are\x20up\x20to\x20date','segments','Listing\x20journeys...','77797840xWQxtj','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)','Resume\x20a\x20paused\x20journey','\x0aError:','segmentName','listVersions','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','journey:version:create','resolveParentId','site','parentName','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','resume','\x20\x20-\x20','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','getLatestJourneyId','/app/ps/','Journey\x20name:\x20','verbose','rootFolderId','cwd','Target\x20file:\x20','localeCompare','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Warning:\x20Could\x20not\x20resolve\x20activation\x20','getStatistics','folderPath','join','Resolving\x20journey...','\x20new\x20files','Creating\x20new\x20version...','journey:columns','journey:activations','from','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','getJourney','activation_','journeyStages','\x20(draft)\x20β\x20\x22','dryRun','size','Database:\x20','Error:\x20Invalid\x20version\x20number:\x20','hasChanges','split','parentSegment','journey:resume'];a22_0x4c2c=function(){return _0x27a4df;};return a22_0x4c2c();}(function(_0x3ee55d,_0xb38946){const _0x462fc3=a22_0x5d71,_0x41cf3c=_0x3ee55d();while(!![]){try{const _0x472225=-parseInt(_0x462fc3(0x1b3))/0x1+parseInt(_0x462fc3(0x1a5))/0x2+-parseInt(_0x462fc3(0x126))/0x3*(parseInt(_0x462fc3(0x172))/0x4)+-parseInt(_0x462fc3(0x19d))/0x5*(parseInt(_0x462fc3(0x1f6))/0x6)+-parseInt(_0x462fc3(0x158))/0x7+-parseInt(_0x462fc3(0x235))/0x8*(parseInt(_0x462fc3(0x193))/0x9)+parseInt(_0x462fc3(0x200))/0xa;if(_0x472225===_0xb38946)break;else _0x41cf3c['push'](_0x41cf3c['shift']());}catch(_0x432076){_0x41cf3c['push'](_0x41cf3c['shift']());}}}(a22_0x4c2c,0xe3a17));import a22_0x4d1f82 from'chalk';import a22_0x3db790 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x2fd44e){const _0x5bc5a2=a22_0x5d71;return!_0x2fd44e&&(console[_0x5bc5a2(0x232)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console['error'](_0x5bc5a2(0x143))),!!_0x2fd44e;}function withJsonFormat(_0x2a12c1){const _0x3f68d6=a22_0x5d71;if(!_0x2a12c1['format']&&!_0x2a12c1[_0x3f68d6(0x17d)]&&!_0x2a12c1[_0x3f68d6(0x1f0)]&&!_0x2a12c1[_0x3f68d6(0x15d)])return{..._0x2a12c1,'format':'json','json':!![]};return _0x2a12c1;}function formatJourneyState(_0x227b5e){const _0x119890=a22_0x5d71;switch(_0x227b5e){case _0x119890(0x175):return a22_0x4d1f82[_0x119890(0x136)](_0x119890(0x1f8));case'draft':return a22_0x4d1f82[_0x119890(0x166)](_0x119890(0x14a));case _0x119890(0x167):return a22_0x4d1f82['yellow'](_0x119890(0x13e));case _0x119890(0x1d8):return a22_0x4d1f82[_0x119890(0x130)]('(completed)');case'archived':return a22_0x4d1f82[_0x119890(0x166)](_0x119890(0x186));default:return'('+_0x227b5e+')';}}function formatJourneyItem(_0x324ea9,_0x4bf9ce='',_0x488ed5){const _0x492c5b=a22_0x5d71,_0x39fbe8=formatJourneyState(_0x324ea9[_0x492c5b(0x16a)]),_0x5ef2f7=_0x488ed5?hyperlink(_0x324ea9[_0x492c5b(0x18c)],_0x488ed5):_0x324ea9[_0x492c5b(0x18c)];return _0x4bf9ce+_0x492c5b(0x1c2)+_0x5ef2f7+'\x20'+_0x39fbe8;}function escapeRegex(_0x49febe){const _0x31dfef=a22_0x5d71;return _0x49febe[_0x31dfef(0x131)](/[.*+?^${}()|[\]\\]/g,_0x31dfef(0x1e1));}function globToRegex(_0xd903f3){const _0x25d760=a22_0x5d71,_0x38e0da=_0xd903f3[_0x25d760(0x22d)]('*')[_0x25d760(0x23b)](escapeRegex);return new RegExp(_0x38e0da[_0x25d760(0x21c)]('.*'),'i');}function buildRuleToNameMapping(_0x26518b){const _0xd5a950=a22_0x5d71,_0x2429c1=new Map();if(_0x26518b[_0xd5a950(0x1fe)])for(const [_0x25d42a,_0x355cfb]of Object[_0xd5a950(0x182)](_0x26518b[_0xd5a950(0x1fe)])){if(_0x355cfb['rule']){const _0x352aae=serializeRule(_0x355cfb[_0xd5a950(0x1f1)]),_0xab9c7b=_0x2429c1['get'](_0x352aae);_0xab9c7b?_0xab9c7b[_0xd5a950(0x171)](_0x25d42a):_0x2429c1[_0xd5a950(0x1bf)](_0x352aae,[_0x25d42a]);}}return _0x2429c1;}async function resolveJourneyIdFromInput(_0x26dc21,_0x5180f9,_0x55f325){const _0x127dd0=a22_0x5d71,_0x4678ed=await resolveJourneyTarget(_0x26dc21,_0x5180f9[_0x127dd0(0x22e)],_0x5180f9[_0x127dd0(0x213)]),_0x7eb2b3=_0x4678ed['parentSegment'];if(!_0x7eb2b3)throw new SDKError(ErrorCode[_0x127dd0(0x1d9)],_0x127dd0(0x218));const _0x101c00=await withSpinner(_0x127dd0(0x1b1),()=>_0x55f325[_0x127dd0(0x1b6)][_0x127dd0(0x209)](_0x7eb2b3),{'verbose':_0x5180f9[_0x127dd0(0x213)]}),_0x5eb003=_0x101c00[_0x127dd0(0x17c)],_0x45e4e0=await withSpinner(_0x127dd0(0x21d),()=>_0x55f325[_0x127dd0(0x176)][_0x127dd0(0x1bc)](_0x5eb003,_0x4678ed[_0x127dd0(0x230)]),{'verbose':_0x5180f9[_0x127dd0(0x213)]});return{'journeyId':_0x45e4e0[_0x127dd0(0x17c)],'journeyName':_0x4678ed[_0x127dd0(0x230)],'parentSegmentId':_0x5eb003};}async function resolveJourneyTarget(_0x227999,_0x8998da,_0x5de2c0){const _0x5b3424=a22_0x5d71;if(isYamlFilePath(_0x227999))try{const _0x33f7d5=await resolveYamlFilePath(_0x227999);return _0x5de2c0&&(console['error'](_0x5b3424(0x160)+_0x227999),console[_0x5b3424(0x232)]('\x20\x20Parent\x20segment:\x20'+_0x33f7d5[_0x5b3424(0x22e)]),console[_0x5b3424(0x232)](_0x5b3424(0x198)+_0x33f7d5[_0x5b3424(0x204)]),console[_0x5b3424(0x232)](_0x5b3424(0x1e8)+(_0x33f7d5[_0x5b3424(0x21b)]||_0x5b3424(0x152)))),{'journeyName':_0x33f7d5[_0x5b3424(0x204)],'parentSegment':_0x33f7d5['parentSegment'],'resolved':_0x33f7d5};}catch(_0x41f801){throw new SDKError(ErrorCode[_0x5b3424(0x1d9)],_0x5b3424(0x207)+_0x41f801[_0x5b3424(0x132)]);}if(!_0x8998da)throw new SDKError(ErrorCode[_0x5b3424(0x1d9)],_0x5b3424(0x148));return{'journeyName':_0x227999,'parentSegment':_0x8998da};}export class JourneyListCommand extends BaseCommand{[a22_0x1d6769(0x1c9)]=a22_0x1d6769(0x180);['description']=a22_0x1d6769(0x1bb);async[a22_0x1d6769(0x16c)](_0x2e5f6a){const _0x41f36c=a22_0x1d6769,{options:_0x13317d,args:_0x4b9964,tdx:_0x37b973}=_0x2e5f6a,_0x21687c=_0x4b9964[0x0],_0x15d5e9=_0x13317d[_0x41f36c(0x22e)];if(!_0x15d5e9)return console['error']('Error:\x20Parent\x20segment\x20context\x20required'),console['error'](_0x41f36c(0x1b9)),0x1;const _0x40a62e=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x37b973[_0x41f36c(0x1b6)]['resolveParentId'](_0x15d5e9),{'verbose':_0x13317d[_0x41f36c(0x213)]}),_0x59572b=_0x40a62e[_0x41f36c(0x17c)];_0x13317d[_0x41f36c(0x213)]&&(console[_0x41f36c(0x232)](_0x41f36c(0x15c)+_0x15d5e9+_0x41f36c(0x190)+_0x59572b+')'),_0x21687c&&console[_0x41f36c(0x232)](_0x41f36c(0x1a6)+_0x21687c));const _0x19886a=await withSpinner('Fetching\x20parent\x20segment...',()=>_0x37b973['segment'][_0x41f36c(0x159)](_0x59572b),{'verbose':_0x13317d['verbose']}),_0x4fb8a2=_0x19886a['data'],_0x2ca7f9=_0x4fb8a2[_0x41f36c(0x214)],_0x129313=await withSpinner(_0x41f36c(0x1ff),()=>_0x37b973[_0x41f36c(0x176)][_0x41f36c(0x1b0)](_0x59572b,_0x2ca7f9),{'verbose':_0x13317d[_0x41f36c(0x213)]});let _0x1cd286=_0x129313['data']['journeys'];const _0x2b5120=_0x129313[_0x41f36c(0x17c)][_0x41f36c(0x129)],_0x274cfe=new Map();for(const _0x602239 of _0x2b5120){_0x274cfe[_0x41f36c(0x1bf)](_0x602239['id'],_0x602239['name']);}if(_0x21687c){const _0x3d5ac9=globToRegex(_0x21687c);_0x1cd286=_0x1cd286[_0x41f36c(0x133)](_0x147710=>_0x3d5ac9[_0x41f36c(0x1f2)](_0x147710[_0x41f36c(0x18c)]));}console[_0x41f36c(0x232)](_0x41f36c(0x174)+_0x1cd286[_0x41f36c(0x164)]+_0x41f36c(0x14f)+(_0x1cd286[_0x41f36c(0x164)]!==0x1?'s':''));const _0x5e6d22=_0x558ab6=>{const _0x2affd7=_0x41f36c;return getConsoleNextUrl(_0x13317d['site'],_0x2affd7(0x211)+_0x59572b+'/e/'+_0x558ab6+_0x2affd7(0x134));};if(_0x13317d[_0x41f36c(0x1c7)]===_0x41f36c(0x14d))await handleSDKOutput(_0x1cd286,_0x13317d);else{if(_0x13317d[_0x41f36c(0x1c7)]===_0x41f36c(0x17d)){const _0x32d5d9=_0x1cd286['map'](_0xd35b66=>({..._0xd35b66,'url':_0x5e6d22(_0xd35b66['id'])}));await handleSDKOutput(_0x32d5d9,_0x13317d);}else{console[_0x41f36c(0x19f)]('['+_0x15d5e9+']');const _0x10f948=new Map(),_0x30177f=[];for(const _0x1b42e4 of _0x1cd286){if(!_0x1b42e4[_0x41f36c(0x18b)]||_0x1b42e4[_0x41f36c(0x18b)]===_0x2ca7f9)_0x30177f[_0x41f36c(0x171)](_0x1b42e4);else{const _0x1c4224=_0x10f948[_0x41f36c(0x1dd)](_0x1b42e4[_0x41f36c(0x18b)])||[];_0x1c4224[_0x41f36c(0x171)](_0x1b42e4),_0x10f948[_0x41f36c(0x1bf)](_0x1b42e4[_0x41f36c(0x18b)],_0x1c4224);}}const _0x51088c=(_0x4e0609,_0x5921ca)=>_0x4e0609[_0x41f36c(0x18c)][_0x41f36c(0x217)](_0x5921ca['journeyBundleName'],undefined,{'sensitivity':_0x41f36c(0x14e)});_0x30177f['sort'](_0x51088c);for(const _0x496ffb of _0x30177f){console[_0x41f36c(0x19f)](formatJourneyItem(_0x496ffb,'',_0x5e6d22(_0x496ffb['id'])));}const _0x3d73b8=[..._0x10f948[_0x41f36c(0x182)]()][_0x41f36c(0x181)]((_0xb43dd,_0xbbf766)=>{const _0x292818=_0x41f36c,_0x27e9d0=_0x274cfe[_0x292818(0x1dd)](_0xb43dd[0x0])||_0xb43dd[0x0],_0x4c8a8f=_0x274cfe['get'](_0xbbf766[0x0])||_0xbbf766[0x0];return _0x27e9d0['localeCompare'](_0x4c8a8f,undefined,{'sensitivity':'base'});});for(const [_0x6bede5,_0x4cfcab]of _0x3d73b8){const _0x518c0d=_0x274cfe[_0x41f36c(0x1dd)](_0x6bede5)||_0x6bede5;console[_0x41f36c(0x19f)](_0x41f36c(0x1c1)+_0x518c0d),_0x4cfcab[_0x41f36c(0x181)](_0x51088c);for(const _0x11921e of _0x4cfcab){console[_0x41f36c(0x19f)](formatJourneyItem(_0x11921e,'\x20\x20',_0x5e6d22(_0x11921e['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a22_0x1d6769(0x1c9)]=a22_0x1d6769(0x1cc);[a22_0x1d6769(0x23e)]=a22_0x1d6769(0x156);async[a22_0x1d6769(0x16c)](_0x465d7a){const _0x3e8734=a22_0x1d6769,{options:_0x443ca8,args:_0x1d8f1e,tdx:_0x44f54f}=_0x465d7a,_0x526d68=_0x1d8f1e[0x0];if(!_0x526d68)return console[_0x3e8734(0x232)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x3e8734(0x232)](_0x3e8734(0x20c)),console[_0x3e8734(0x232)]('Options:'),console[_0x3e8734(0x232)](_0x3e8734(0x183)),0x1;_0x443ca8[_0x3e8734(0x213)]&&console['error'](_0x3e8734(0x1a8)+_0x526d68);const {journeyId:_0x3412f0,parentSegmentId:_0x39289e}=await resolveJourneyIdFromInput(_0x526d68,_0x443ca8,_0x44f54f);if(_0x443ca8[_0x3e8734(0x18f)]){const _0x5f135a=getConsoleNextUrl(_0x443ca8[_0x3e8734(0x20a)],'/app/ps/'+_0x39289e+_0x3e8734(0x1f5)+_0x3412f0+_0x3e8734(0x1ca));return console[_0x3e8734(0x232)](a22_0x4d1f82['green']('β')+_0x3e8734(0x1d4)+a22_0x4d1f82[_0x3e8734(0x1cb)](_0x5f135a)),openBrowser(_0x5f135a),0x0;}const _0x25b09d=await withSpinner(_0x3e8734(0x1ad),()=>_0x44f54f[_0x3e8734(0x176)][_0x3e8734(0x224)](_0x3412f0),{'verbose':_0x443ca8[_0x3e8734(0x213)]}),_0x9b3b16=_0x25b09d['data'],_0x31e196=_0x443ca8['includeStats'];let _0x5d5940;if(_0x31e196)try{const _0xadf673=await withSpinner(_0x3e8734(0x188),()=>_0x44f54f[_0x3e8734(0x176)]['getStatistics'](_0x3412f0),{'verbose':_0x443ca8[_0x3e8734(0x213)]});_0x5d5940=_0xadf673[_0x3e8734(0x17c)];}catch{_0x443ca8[_0x3e8734(0x213)]&&console[_0x3e8734(0x232)](_0x3e8734(0x1a1));}const _0x339ea1=getConsoleNextUrl(_0x443ca8[_0x3e8734(0x20a)],_0x3e8734(0x211)+_0x39289e+_0x3e8734(0x1f5)+_0x3412f0+_0x3e8734(0x1ca)),_0x315778={'id':_0x9b3b16['id'],'name':_0x9b3b16[_0x3e8734(0x1af)][_0x3e8734(0x1c9)],'description':_0x9b3b16['attributes'][_0x3e8734(0x23e)],'state':_0x9b3b16[_0x3e8734(0x1af)][_0x3e8734(0x16a)],'paused':_0x9b3b16['attributes']['paused'],'reentry_mode':_0x9b3b16['attributes']['reentryMode'],'stages':_0x9b3b16[_0x3e8734(0x1af)][_0x3e8734(0x226)]?.[_0x3e8734(0x164)]||0x0,..._0x9b3b16['attributes'][_0x3e8734(0x199)]&&{'goal':_0x9b3b16[_0x3e8734(0x1af)]['goal']['name']},..._0x5d5940&&{'statistics':{'size':_0x5d5940[_0x3e8734(0x229)],'entered':_0x5d5940['enteredSize'],'goal_achieved':_0x5d5940[_0x3e8734(0x1be)],'completion_rate':_0x5d5940[_0x3e8734(0x1f3)],'exit_or_jump':_0x5d5940['exitOrJumpSize'],'exit_or_jump_rate':_0x5d5940['exitOrJumpRate'],'stages':_0x5d5940['stages']}},'url':_0x339ea1};return await handleSingleObjectOutput(_0x315778,_0x443ca8),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a22_0x1d6769(0x1c9)]='journey:stats';[a22_0x1d6769(0x23e)]=a22_0x1d6769(0x1e2);async[a22_0x1d6769(0x16c)](_0x2079b6){const _0x1655c6=a22_0x1d6769,{options:_0x3fe7a9,args:_0x314480,tdx:_0x4e5ce1}=_0x2079b6,_0x54ddb1=_0x314480[0x0];if(!requireNameOrPath(_0x54ddb1))return 0x1;_0x3fe7a9[_0x1655c6(0x213)]&&console[_0x1655c6(0x232)]('Input:\x20'+_0x54ddb1);const _0x4612e6=_0x3fe7a9,_0x1eb991=_0x4612e6[_0x1655c6(0x222)],_0x97565e=_0x4612e6['to'],_0x15835d=_0x4612e6[_0x1655c6(0x12b)],_0x376441=_0x4612e6[_0x1655c6(0x1cf)];_0x15835d&&!_0x1eb991&&!_0x97565e&&console[_0x1655c6(0x232)]('Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history');const _0x5cac0d=_0x15835d?withJsonFormat(_0x3fe7a9):_0x3fe7a9,{journeyId:_0x235410,journeyName:_0x3d03f7}=await resolveJourneyIdFromInput(_0x54ddb1,_0x5cac0d,_0x4e5ce1),_0x3a00e4=_0x1eb991||_0x97565e?{'from':_0x1eb991,'to':_0x97565e}:undefined,_0x3ec855=await withSpinner(_0x1655c6(0x188),()=>Promise[_0x1655c6(0x150)]([_0x4e5ce1[_0x1655c6(0x176)][_0x1655c6(0x224)](_0x235410),_0x4e5ce1[_0x1655c6(0x176)][_0x1655c6(0x21a)](_0x235410,_0x3a00e4)]),{'verbose':_0x5cac0d[_0x1655c6(0x213)]}),[_0x596de6,_0x269e5e]=_0x3ec855[_0x1655c6(0x17c)];if(!_0x269e5e||_0x269e5e[_0x1655c6(0x187)]===null)return console[_0x1655c6(0x232)](_0x1655c6(0x12d)+_0x3d03f7),console[_0x1655c6(0x232)](_0x1655c6(0x236)),0x0;const _0x13a614=buildStageNameMap(_0x596de6),_0x3a7ba8=!!(_0x3a00e4&&_0x269e5e[_0x1655c6(0x125)]?.[_0x1655c6(0x164)]),_0x42b936={'stageNameMap':_0x13a614,'hasPeriod':_0x3a7ba8,'includeHistory':!!_0x15835d};if(_0x376441&&_0x269e5e[_0x1655c6(0x19c)]){const _0x4348c1=_0x269e5e['stages'][_0x1655c6(0x17f)](_0x1581d2=>{const _0x15c90d=_0x1655c6,_0x55c8c3=_0x13a614[_0x15c90d(0x1dd)](_0x1581d2['id'])??'';return _0x55c8c3[_0x15c90d(0x1ed)]()===_0x376441['toLowerCase']();});if(_0x4348c1)return await handleSingleObjectOutput(formatStageStats(_0x4348c1,_0x42b936),_0x5cac0d),0x0;const _0x19cc51=_0x269e5e['stages'][_0x1655c6(0x23b)](_0x2424ad=>_0x13a614[_0x1655c6(0x1dd)](_0x2424ad['id'])??_0x2424ad['id']);return console[_0x1655c6(0x232)](_0x1655c6(0x1a9)+_0x376441+'\x22\x20not\x20found'),console['error'](_0x1655c6(0x1c8)+_0x19cc51[_0x1655c6(0x21c)](',\x20')),0x1;}const _0x12f7a3=_0x269e5e[_0x1655c6(0x19c)]?.[_0x1655c6(0x23b)](_0x50d385=>formatStageStats(_0x50d385,_0x42b936)),_0x4471f0=assembleJourneyStats(_0x269e5e,{'from':_0x1eb991,'to':_0x97565e,'includeHistory':_0x15835d});return await this[_0x1655c6(0x147)](_0x4471f0,_0x12f7a3??[],_0x5cac0d),0x0;}async[a22_0x1d6769(0x147)](_0x2d4d3e,_0x2bd9cd,_0x262fc7){const _0x20e4c5=a22_0x1d6769,_0x901791=_0x262fc7['format']===_0x20e4c5(0x17d)||_0x262fc7[_0x20e4c5(0x1c7)]==='jsonl'||_0x262fc7[_0x20e4c5(0x17d)]||_0x262fc7[_0x20e4c5(0x1f0)];if(_0x901791){_0x2d4d3e[_0x20e4c5(0x19c)]=_0x2bd9cd,await handleSingleObjectOutput(_0x2d4d3e,_0x262fc7);return;}await handleSingleObjectOutput(_0x2d4d3e,_0x262fc7);for(const _0x3502cc of _0x2bd9cd){console[_0x20e4c5(0x19f)](''),console[_0x20e4c5(0x19f)](String(a22_0x4d1f82['cyan'][_0x20e4c5(0x168)]('['+_0x3502cc['name']+']'))+a22_0x4d1f82[_0x20e4c5(0x166)]('\x20'+_0x3502cc['id']));const {id:_0x4c5ffe,name:_0xd270f7,..._0x5f6a3a}=_0x3502cc;await handleSingleObjectOutput(_0x5f6a3a,_0x262fc7);}}}export class JourneyTrafficCommand extends BaseCommand{[a22_0x1d6769(0x1c9)]=a22_0x1d6769(0x1e9);[a22_0x1d6769(0x23e)]=a22_0x1d6769(0x1c5);async[a22_0x1d6769(0x16c)](_0x190d27){const _0xb5c4c1=a22_0x1d6769,{options:_0x40cbc3,args:_0x486ea2,tdx:_0x3ae74c}=_0x190d27,_0x181cd3=_0x486ea2[0x0];if(!requireNameOrPath(_0x181cd3))return 0x1;_0x40cbc3[_0xb5c4c1(0x213)]&&console[_0xb5c4c1(0x232)](_0xb5c4c1(0x1a8)+_0x181cd3);const _0x174cb7=_0x40cbc3,_0x20236a=_0x174cb7[_0xb5c4c1(0x15e)],_0x111366=_0x174cb7[_0xb5c4c1(0x222)],_0x1e55dd=_0x174cb7['to'],_0x1f3e90=_0x174cb7[_0xb5c4c1(0x231)];if(_0x20236a&&_0x20236a!==_0xb5c4c1(0x1b2)&&_0x20236a!=='activation')return console[_0xb5c4c1(0x232)](_0xb5c4c1(0x153)+_0x20236a+_0xb5c4c1(0x1b4)),0x1;const _0x1968f2=withJsonFormat(_0x40cbc3),{journeyId:_0x15d29f,journeyName:_0x263c78}=await resolveJourneyIdFromInput(_0x181cd3,_0x1968f2,_0x3ae74c),_0x4fb645={'type':_0x20236a,'from':_0x111366,'to':_0x1e55dd,'limit':_0x1f3e90},_0x5775ac=await withSpinner(_0xb5c4c1(0x142),()=>_0x3ae74c[_0xb5c4c1(0x176)]['getTrafficData'](_0x15d29f,_0x4fb645),{'verbose':_0x1968f2[_0xb5c4c1(0x213)]}),_0x2553b7=_0x5775ac[_0xb5c4c1(0x17c)],_0x2bc7ed=_0x2553b7[_0xb5c4c1(0x1b2)]&&(_0x2553b7[_0xb5c4c1(0x1b2)]['nodes'][_0xb5c4c1(0x164)]>0x0||_0x2553b7[_0xb5c4c1(0x1b2)]['links'][_0xb5c4c1(0x164)]>0x0),_0x475a85=_0x2553b7[_0xb5c4c1(0x12a)]&&_0x2553b7[_0xb5c4c1(0x12a)][_0xb5c4c1(0x164)]>0x0;if(!_0x2bc7ed&&!_0x475a85)return console['error'](_0xb5c4c1(0x196)+_0x263c78),console[_0xb5c4c1(0x232)](_0xb5c4c1(0x178)),_0x111366&&_0x1e55dd&&console[_0xb5c4c1(0x232)](_0xb5c4c1(0x1f7)),0x0;return await handleSingleObjectOutput(_0x2553b7,_0x1968f2),0x0;}}function formatStageStats(_0x2c42bf,_0x44c89b){const _0x72e2cf=a22_0x1d6769,_0x3976b6=_0x44c89b['hasPeriod']&&_0x2c42bf[_0x72e2cf(0x125)]?.[_0x72e2cf(0x164)]?aggregateStageHistory(_0x2c42bf['history']):{'size':_0x2c42bf[_0x72e2cf(0x229)],'entered':_0x2c42bf[_0x72e2cf(0x1c6)],'milestone':_0x2c42bf['milestoneSize'],'milestone_rate':_0x2c42bf['completeMilestoneRate'],'exit_or_jump':_0x2c42bf[_0x72e2cf(0x1d7)],'exit_or_jump_rate':_0x2c42bf[_0x72e2cf(0x191)]},_0x385d22={'id':_0x2c42bf['id'],'name':_0x44c89b[_0x72e2cf(0x15f)][_0x72e2cf(0x1dd)](_0x2c42bf['id'])??_0x2c42bf['id'],..._0x3976b6};return _0x44c89b[_0x72e2cf(0x1e0)]&&_0x44c89b[_0x72e2cf(0x12b)]&&_0x2c42bf['history']&&(_0x385d22[_0x72e2cf(0x125)]=_0x2c42bf[_0x72e2cf(0x125)]),_0x385d22;}export class JourneyPauseCommand extends BaseCommand{[a22_0x1d6769(0x1c9)]=a22_0x1d6769(0x18e);['description']=a22_0x1d6769(0x146);async[a22_0x1d6769(0x16c)](_0x2bb5c4){const _0x2626e6=a22_0x1d6769,{options:_0x56032f,args:_0x4b7cdb,tdx:_0x546195}=_0x2bb5c4,_0x1c8e12=_0x4b7cdb[0x0];if(!requireNameOrPath(_0x1c8e12))return 0x1;_0x56032f[_0x2626e6(0x213)]&&console['error'](_0x2626e6(0x1a8)+_0x1c8e12);const {journeyId:_0x567d03,journeyName:_0x502988}=await resolveJourneyIdFromInput(_0x1c8e12,_0x56032f,_0x546195);if(!_0x56032f[_0x2626e6(0x177)]){const _0x5433b1=await confirm(_0x2626e6(0x223)+_0x502988+'\x22?');if(!_0x5433b1)return console[_0x2626e6(0x232)](_0x2626e6(0x1e5)),0x0;}const _0x1296c5=await withSpinner(_0x2626e6(0x192),()=>_0x546195['journey'][_0x2626e6(0x137)](_0x567d03),{'verbose':_0x56032f[_0x2626e6(0x213)]}),_0x4e2157=_0x1296c5[_0x2626e6(0x17c)];return console['error'](_0x2626e6(0x139)+_0x4e2157[_0x2626e6(0x1af)][_0x2626e6(0x1c9)]+_0x2626e6(0x149)),0x0;}}export class JourneyResumeCommand extends BaseCommand{['name']=a22_0x1d6769(0x22f);[a22_0x1d6769(0x23e)]=a22_0x1d6769(0x202);async[a22_0x1d6769(0x16c)](_0x37b003){const _0x10919f=a22_0x1d6769,{options:_0x5dabc2,args:_0x2f1bbe,tdx:_0x134f24}=_0x37b003,_0x55a096=_0x2f1bbe[0x0];if(!requireNameOrPath(_0x55a096))return 0x1;_0x5dabc2['verbose']&&console['error'](_0x10919f(0x1a8)+_0x55a096);const {journeyId:_0x31889a,journeyName:_0x485893}=await resolveJourneyIdFromInput(_0x55a096,_0x5dabc2,_0x134f24);if(!_0x5dabc2[_0x10919f(0x177)]){const _0x3f51b9=await confirm(_0x10919f(0x14b)+_0x485893+'\x22?');if(!_0x3f51b9)return console[_0x10919f(0x232)](_0x10919f(0x1e5)),0x0;}const _0x20602c=await withSpinner(_0x10919f(0x237),()=>_0x134f24[_0x10919f(0x176)][_0x10919f(0x20d)](_0x31889a),{'verbose':_0x5dabc2[_0x10919f(0x213)]}),_0x10c03a=_0x20602c['data'];return console['error'](_0x10919f(0x139)+_0x10c03a[_0x10919f(0x1af)][_0x10919f(0x1c9)]+_0x10919f(0x1e7)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a22_0x1d6769(0x1c9)]='journey:pull';['description']=a22_0x1d6769(0x141);async[a22_0x1d6769(0x16c)](_0x396e22){const _0x3316be=a22_0x1d6769,{options:_0x37d45c,args:_0x143101,tdx:_0x3f74c5}=_0x396e22,_0xf119b6=_0x37d45c,_0x25b708=_0x143101[0x0],_0x48b431=_0x25b708&&isYamlFilePath(_0x25b708),_0x58f81e=await resolveTarget({'arg':_0x48b431?_0x25b708:undefined,'contextParent':_0x37d45c[_0x3316be(0x22e)],'cwd':process[_0x3316be(0x215)]()});if(!isSuccessfulResolution(_0x58f81e))return _0x58f81e[_0x3316be(0x1a7)]===_0x3316be(0x16e)?(console[_0x3316be(0x232)](a22_0x4d1f82['yellow'](_0x3316be(0x185))),console['error'](_0x3316be(0x201)),console[_0x3316be(0x232)](_0x3316be(0x1fa)),console[_0x3316be(0x232)](_0x3316be(0x233)),console[_0x3316be(0x232)](_0x3316be(0x206))):(console[_0x3316be(0x232)](a22_0x4d1f82[_0x3316be(0x1eb)]('Error:\x20'+_0x58f81e[_0x3316be(0x132)]+'\x0a')),_0x58f81e[_0x3316be(0x1d5)]&&console[_0x3316be(0x232)](a22_0x4d1f82[_0x3316be(0x1cb)](_0x58f81e[_0x3316be(0x1d5)]))),0x1;let _0x1d1594=_0x48b431?undefined:_0x25b708,_0x1b9382,_0x13ae69;_0x58f81e[_0x3316be(0x15e)]==='file'&&(_0x1d1594=_0x58f81e[_0x3316be(0x1a2)],_0x1b9382=_0x58f81e[_0x3316be(0x1dc)],_0x13ae69=_0x58f81e[_0x3316be(0x21b)]);const _0x20047b=_0x58f81e[_0x3316be(0x20b)],_0x543d2e=_0x58f81e[_0x3316be(0x1f4)];_0xf119b6[_0x3316be(0x213)]&&(console[_0x3316be(0x232)]('Parent\x20segment:\x20'+_0x20047b),console['error'](_0x3316be(0x239)+_0x543d2e),_0x1d1594&&console[_0x3316be(0x232)](_0x3316be(0x212)+_0x1d1594),_0x1b9382&&console[_0x3316be(0x232)](_0x3316be(0x216)+_0x1b9382),_0x13ae69&&console[_0x3316be(0x232)](_0x3316be(0x13f)+_0x13ae69));const _0x537091=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x3f74c5[_0x3316be(0x1b6)][_0x3316be(0x209)](_0x20047b),{'verbose':_0x37d45c[_0x3316be(0x213)]}),_0x85d107=_0x537091[_0x3316be(0x17c)],{journeys:_0x1830b1,folders:_0x3cd384}=await withSpinner(_0x3316be(0x1b5),async()=>{const _0x471d21=_0x3316be,[_0x3f99c0,_0x4126a4]=await Promise['all']([_0x3f74c5[_0x471d21(0x176)]['listJourneysFromParentSegment'](_0x85d107,undefined,{'includeAllVersions':!![]}),_0x3f74c5[_0x471d21(0x1b6)]['listFolders'](_0x85d107)]);return{'journeys':_0x3f99c0,'folders':_0x4126a4};},{'verbose':_0x37d45c[_0x3316be(0x213)]})[_0x3316be(0x18a)](_0x469c13=>_0x469c13[_0x3316be(0x17c)]);let _0x2fa207=_0x1830b1;const _0x4f93ea=buildFolderIdToPathMap(_0x3cd384);if(_0x1d1594){const _0x5bfeff=_0x2fa207[_0x3316be(0x133)](_0x98407c=>_0x98407c['journeyBundleName'][_0x3316be(0x1ed)]()===_0x1d1594[_0x3316be(0x1ed)]());if(_0x5bfeff[_0x3316be(0x164)]===0x0)return console[_0x3316be(0x232)](_0x3316be(0x1cd)+_0x1d1594),console[_0x3316be(0x232)](_0x3316be(0x20f)),0x1;_0x2fa207=_0x5bfeff;}if(_0x13ae69!==undefined){const _0x1d2d7c=_0x2fa207[_0x3316be(0x133)](_0x11f870=>{const _0x421b54=_0x3316be,_0x11b6b9=_0x11f870[_0x421b54(0x18b)]?_0x4f93ea[_0x421b54(0x1dd)](_0x11f870['folderId'])||'':'';return _0x11b6b9===_0x13ae69;});if(_0x1d2d7c[_0x3316be(0x164)]===0x0&&_0x2fa207[_0x3316be(0x164)]>0x0){console[_0x3316be(0x232)]('Error:\x20Journey\x20\x27'+_0x1d1594+'\x27\x20not\x20found\x20in\x20'+(_0x13ae69||_0x3316be(0x138))),console['error'](_0x3316be(0x234));for(const _0x21022e of _0x2fa207){const _0x11e810=_0x21022e[_0x3316be(0x18b)]?_0x4f93ea[_0x3316be(0x1dd)](_0x21022e[_0x3316be(0x18b)])||'':'';console['error'](_0x3316be(0x20e)+(_0x11e810||_0x3316be(0x152))+'/'+_0x21022e[_0x3316be(0x18c)]);}return 0x1;}_0x2fa207=_0x1d2d7c;}if(_0x2fa207[_0x3316be(0x164)]===0x0)return console[_0x3316be(0x232)](_0x3316be(0x1d1)),0x0;const _0x466a6e=new Map();for(const _0x192789 of _0x2fa207){const _0x1c9e65=_0x192789['journeyBundleId'];!_0x466a6e[_0x3316be(0x197)](_0x1c9e65)&&_0x466a6e[_0x3316be(0x1bf)](_0x1c9e65,[]),_0x466a6e[_0x3316be(0x1dd)](_0x1c9e65)[_0x3316be(0x171)](_0x192789);}for(const _0xa39551 of _0x466a6e['values']()){_0xa39551[_0x3316be(0x181)]((_0x1c0108,_0x118f10)=>(_0x1c0108[_0x3316be(0x12f)]||0x0)-(_0x118f10[_0x3316be(0x12f)]||0x0));}const _0xe5d1b0=[],{idToEmailMap:_0x2b4ae0,connectionIdToNameMap:_0x4420ad}=await withSpinner(_0x3316be(0x13a),async()=>{const _0x4a1ab0=_0x3316be,[_0x3627f2,_0x1d9d3c]=await Promise[_0x4a1ab0(0x150)]([_0x3f74c5[_0x4a1ab0(0x15b)][_0x4a1ab0(0x19e)](),_0x3f74c5[_0x4a1ab0(0x1ea)][_0x4a1ab0(0x1fb)]()]);return{'idToEmailMap':_0x3627f2,'connectionIdToNameMap':_0x1d9d3c};},{'verbose':_0x37d45c[_0x3316be(0x213)]})['then'](_0x129f19=>_0x129f19[_0x3316be(0x17c)]);for(const _0x3cbe37 of _0x466a6e[_0x3316be(0x1ac)]()){const _0x5d7f48=_0x3cbe37[0x0][_0x3316be(0x18c)],_0x35291b=_0x3cbe37[0x0][_0x3316be(0x18b)],_0x227b92=_0x35291b?_0x4f93ea[_0x3316be(0x1dd)](_0x35291b)||'':'',_0x29545c=_0x227b92?a22_0x3db790[_0x3316be(0x21c)](_0x543d2e,_0x227b92):_0x543d2e,_0x1728c9=_0x1b9382||a22_0x3db790[_0x3316be(0x21c)](_0x29545c,sanitizeFileName(_0x5d7f48)+_0x3316be(0x1bd));let _0x38b063,_0x5d0b4e;if(existsSync(_0x1728c9))try{const _0x98e82=readFileSync(_0x1728c9,_0x3316be(0x19b)),_0x203ddc=parseYamlString(_0x98e82);_0x5d0b4e=_0x203ddc,_0x38b063=buildRuleToNameMapping(_0x203ddc),_0xf119b6[_0x3316be(0x213)]&&_0x38b063[_0x3316be(0x229)]>0x0&&console[_0x3316be(0x232)](_0x3316be(0x145)+_0x38b063[_0x3316be(0x229)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x5d7f48);}catch(_0x32ec62){_0xf119b6[_0x3316be(0x213)]&&console[_0x3316be(0x232)](_0x3316be(0x17b)+_0x32ec62['message']);}const _0x242feb=[],_0x5cdb8=new Set(),_0x1767cc=new Map(),_0x554292=new Map(),_0x4029ca=new Set(),_0xe618f3=new Map(),_0x1bb9aa=new Map(),_0x453c39=createJumpTargetCache();await withProgressSpinner(_0x3316be(0x169)+_0x5d7f48+_0x3316be(0x179),async _0x5b43c8=>{const _0x2a3da3=_0x3316be;for(const _0x150467 of _0x3cbe37){const _0x574483=_0x3cbe37['length']>0x1?_0x150467['journeyBundleName']+'\x20v'+(_0x150467[_0x2a3da3(0x12f)]||0x1):_0x150467[_0x2a3da3(0x18c)];_0x5b43c8[_0x2a3da3(0x1ae)](_0x2a3da3(0x169)+_0x574483);const _0x14b576=await _0x3f74c5[_0x2a3da3(0x176)][_0x2a3da3(0x224)](_0x150467['id']),_0x20d70f=_0x14b576[_0x2a3da3(0x1af)]?.[_0x2a3da3(0x13c)],_0x23b516={'resolveSegment':async _0x52d3dc=>{const _0x5b3219=_0x2a3da3;if(!_0x20d70f)return{'name':_0x52d3dc,'isJourneyLocal':![]};const _0x1828f7=_0x1767cc[_0x5b3219(0x1dd)](_0x52d3dc);if(_0x1828f7)return _0x1828f7;try{const _0x2d2add=await _0x3f74c5[_0x5b3219(0x1b6)]['getSegment'](_0x20d70f,_0x52d3dc),_0x43e886=_0x2d2add[_0x5b3219(0x16f)]===SEGMENT_KIND_JOURNEY;let _0x22a05d,_0x5a1e5c=_0x2d2add[_0x5b3219(0x1c9)];if(_0x43e886&&_0x2d2add['rule']){const _0x416301=await segmentResponseToDef(_0x2d2add,{'resolveSegmentName':async _0x9e7d35=>{const _0xa94f20=_0x5b3219,_0x52efa8=_0x1767cc['get'](_0x9e7d35);if(_0x52efa8)return _0x52efa8['name'];const _0x563d25=await _0x23b516['resolveSegment'](_0x9e7d35);return _0x563d25[_0xa94f20(0x1c9)];}}),_0x1d2bbb=_0x416301[_0x5b3219(0x1f1)];_0x22a05d={'description':_0x2d2add[_0x5b3219(0x23e)],'rule':_0x1d2bbb};const _0x589edd=serializeRule(_0x1d2bbb),_0x7303aa=_0x554292[_0x5b3219(0x1dd)](_0x589edd);if(_0x7303aa)_0x5a1e5c=_0x7303aa,_0x22a05d=undefined,_0xf119b6[_0x5b3219(0x213)]&&console[_0x5b3219(0x232)](_0x5b3219(0x1e6)+_0x2d2add['name']+_0x5b3219(0x1c3)+_0x7303aa);else{let _0x1dc788=![];if(_0x38b063){const _0x38ca15=_0x38b063[_0x5b3219(0x1dd)](_0x589edd);if(_0x38ca15){const _0x34ea60=_0x38ca15['find'](_0x273591=>!_0x5cdb8['has'](_0x273591));_0x34ea60&&(_0x5a1e5c=_0x34ea60,_0x5cdb8[_0x5b3219(0x15a)](_0x34ea60),_0x554292[_0x5b3219(0x1bf)](_0x589edd,_0x34ea60),_0x1dc788=!![],_0xf119b6[_0x5b3219(0x213)]&&console[_0x5b3219(0x232)](_0x5b3219(0x1da)+_0x34ea60+_0x5b3219(0x1ec)));}}if(!_0x1dc788){const _0x216cfb=generateJourneyLocalName(_0x2d2add[_0x5b3219(0x1c9)]);_0x216cfb&&(_0x5a1e5c=_0x216cfb);let _0x3c4718=_0x5a1e5c,_0x68ad72=0x2;while(_0x5cdb8[_0x5b3219(0x197)](_0x3c4718)){_0x3c4718=_0x5a1e5c+'_'+_0x68ad72,_0x68ad72++;}_0x5cdb8[_0x5b3219(0x15a)](_0x3c4718),_0x554292[_0x5b3219(0x1bf)](_0x589edd,_0x3c4718),_0x5a1e5c=_0x3c4718;}}}const _0x306f49={'name':_0x5a1e5c,'isJourneyLocal':_0x43e886,'definition':_0x22a05d};return _0x1767cc[_0x5b3219(0x1bf)](_0x52d3dc,_0x306f49),_0x306f49;}catch(_0x4854dd){return _0x37d45c[_0x5b3219(0x213)]&&console[_0x5b3219(0x232)](_0x5b3219(0x163)+_0x52d3dc+':\x20'+_0x4854dd['message']),{'name':_0x52d3dc,'isJourneyLocal':![]};}},'resolveActivation':async _0x38a292=>{const _0x3205dc=_0x2a3da3,_0x231bf6=_0xe618f3['get'](_0x38a292);if(_0x231bf6)return _0x231bf6;try{const _0x17d1ea=await _0x3f74c5[_0x3205dc(0x176)][_0x3205dc(0x1c0)](_0x150467['id'],_0x38a292),_0x18b729=journeyActivationStepToYaml(_0x17d1ea,_0x2b4ae0,_0x4420ad),_0x4b39d0=JSON[_0x3205dc(0x194)]({'name':_0x18b729[_0x3205dc(0x1c9)],'connection':_0x18b729[_0x3205dc(0x1ea)],'connector_config':_0x18b729[_0x3205dc(0x17a)]}),_0xc192ea=_0x1bb9aa[_0x3205dc(0x1dd)](_0x4b39d0);if(_0xc192ea){const _0x5a3ac4={'name':_0xc192ea,'isJourneyLocal':!![],'definition':_0x18b729};return _0xe618f3['set'](_0x38a292,_0x5a3ac4),_0x5a3ac4;}const _0x3955e2=_0x17d1ea['attributes'][_0x3205dc(0x16b)][_0x3205dc(0x1c9)]||_0x38a292,_0x2a9bad=sanitizeYamlKey(_0x3955e2)||_0x3205dc(0x225)+_0x38a292;let _0x996feb=_0x2a9bad,_0x4fadee=0x2;while(_0x4029ca[_0x3205dc(0x197)](_0x996feb)){_0x996feb=_0x2a9bad+'_'+_0x4fadee,_0x4fadee++;}_0x4029ca[_0x3205dc(0x15a)](_0x996feb),_0x1bb9aa[_0x3205dc(0x1bf)](_0x4b39d0,_0x996feb);const _0x1261d5={'name':_0x996feb,'isJourneyLocal':!![],'definition':_0x18b729};return _0xe618f3[_0x3205dc(0x1bf)](_0x38a292,_0x1261d5),_0x1261d5;}catch(_0x14ef05){return _0x37d45c[_0x3205dc(0x213)]&&console[_0x3205dc(0x232)](_0x3205dc(0x219)+_0x38a292+':\x20'+_0x14ef05[_0x3205dc(0x132)]),{'name':_0x38a292,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x1875e8,_0x506e26)=>{const _0xb9617=_0x2a3da3;return resolveJumpTarget(_0x1875e8,_0x506e26,_0x453c39,_0x20e24f=>_0x3f74c5[_0xb9617(0x176)]['getJourney'](_0x20e24f));}},_0x8d5297=await journeyResponseToDef(_0x14b576,_0x23b516);_0x242feb['push']({'item':_0x150467,'yaml':_0x8d5297});}},{'verbose':_0x37d45c[_0x3316be(0x213)]});const _0x4989e6=await _0x3f74c5['journey'][_0x3316be(0x210)](_0x3cbe37[0x0][_0x3316be(0x1e4)]),_0x3c8abc=buildMergedJourneyDef(_0x242feb,_0x38b063,_0x4989e6),_0x4e955b=normalizeJourneyDef(_0x3c8abc,_0x5d0b4e),_0x278a2f=toYamlString(_0x4e955b),_0x425dbd=_0x1b9382||a22_0x3db790['join'](_0x29545c,sanitizeFileName(_0x5d7f48)+_0x3316be(0x1bd));!_0x1b9382&&_0x227b92&&!existsSync(_0x29545c)&&mkdirSync(_0x29545c,{'recursive':!![]});const _0x555db4=a22_0x3db790[_0x3316be(0x1ee)](process['cwd'](),_0x425dbd);if(existsSync(_0x425dbd)){const _0x39b9d3=readFileSync(_0x425dbd,_0x3316be(0x19b)),_0x1234bb=generateDiff(_0x39b9d3,_0x278a2f),_0x335cbb=hasChanges(_0x1234bb);_0xe5d1b0['push']({'relativePath':_0x555db4,'absolutePath':_0x425dbd,'content':_0x278a2f,'isNew':![],'hasChanges':_0x335cbb,'diff':_0x335cbb?formatDiffWithColors(_0x1234bb):undefined});}else _0xe5d1b0['push']({'relativePath':_0x555db4,'absolutePath':_0x425dbd,'content':_0x278a2f,'isNew':!![],'hasChanges':![]});}const _0x13cbcc=_0xe5d1b0[_0x3316be(0x133)](_0x4753a6=>_0x4753a6['isNew']),_0x1c3ea3=_0xe5d1b0[_0x3316be(0x133)](_0x190c83=>!_0x190c83[_0x3316be(0x184)]&&_0x190c83['hasChanges']),_0x1c2723=_0xe5d1b0[_0x3316be(0x133)](_0x42df29=>!_0x42df29['isNew']&&!_0x42df29['hasChanges']),_0x4e9aa1=_0x2fa207['length'],_0x328929=_0x466a6e['size'],_0x55f659=_0x4e9aa1>_0x328929?'\x20('+_0x4e9aa1+_0x3316be(0x1d3):'';console[_0x3316be(0x232)](_0x3316be(0x165)),console[_0x3316be(0x232)]('\x20\x20'+a22_0x4d1f82[_0x3316be(0x1cb)](_0x328929+_0x3316be(0x140))+a22_0x4d1f82['dim'](_0x55f659)),console[_0x3316be(0x232)]('\x20\x20'+a22_0x4d1f82[_0x3316be(0x136)]('+\x20'+_0x13cbcc[_0x3316be(0x164)]+_0x3316be(0x21e))),console[_0x3316be(0x232)]('\x20\x20'+a22_0x4d1f82[_0x3316be(0x1f9)]('~\x20'+_0x1c3ea3[_0x3316be(0x164)]+_0x3316be(0x127))),console['error']('\x20\x20'+a22_0x4d1f82[_0x3316be(0x166)]('=\x20'+_0x1c2723[_0x3316be(0x164)]+_0x3316be(0x195))),console[_0x3316be(0x232)](_0x3316be(0x1ef)+a22_0x4d1f82['cyan'](_0x543d2e)+'\x0a');if(_0x1c3ea3['length']>0x0)for(const _0x3f6294 of _0x1c3ea3){console[_0x3316be(0x232)](_0x3316be(0x162)+_0x3f6294['relativePath']+'\x27:'),console['error']('β'[_0x3316be(0x157)](0x3c)),console[_0x3316be(0x232)](_0x3f6294[_0x3316be(0x23a)]),console[_0x3316be(0x232)]('β'['repeat'](0x3c));}if(_0xf119b6[_0x3316be(0x228)])return console[_0x3316be(0x232)](a22_0x4d1f82[_0x3316be(0x1f9)](_0x3316be(0x1d2))),0x0;if(_0x13cbcc[_0x3316be(0x164)]===0x0&&_0x1c3ea3[_0x3316be(0x164)]===0x0)return console[_0x3316be(0x232)](a22_0x4d1f82[_0x3316be(0x136)](_0x3316be(0x1fd))),saveSessionContext({'parent_segment':_0x20047b},_0xf119b6[_0x3316be(0x12e)]),console[_0x3316be(0x232)](a22_0x4d1f82[_0x3316be(0x136)](_0x3316be(0x13b)+a22_0x4d1f82['dim'](_0x3316be(0x23c))+'\x20=\x20'+a22_0x4d1f82[_0x3316be(0x1cb)](_0x20047b))),0x0;if(!_0xf119b6[_0x3316be(0x177)]&&(_0x13cbcc[_0x3316be(0x164)]>0x0||_0x1c3ea3['length']>0x0)){if(!isInteractive())return console[_0x3316be(0x232)](a22_0x4d1f82[_0x3316be(0x1eb)](_0x3316be(0x203)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3316be(0x232)](a22_0x4d1f82[_0x3316be(0x166)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5bbc96=await confirmKey(_0x3316be(0x1a4)+(_0x13cbcc[_0x3316be(0x164)]+_0x1c3ea3['length'])+'\x20files?');if(!_0x5bbc96)return console[_0x3316be(0x232)](a22_0x4d1f82[_0x3316be(0x1f9)]('Aborted.'),_0x3316be(0x135)),0x1;}!existsSync(_0x543d2e)&&mkdirSync(_0x543d2e,{'recursive':!![]});const _0x36276f=a22_0x3db790[_0x3316be(0x21c)](_0x543d2e,_0x3316be(0x1fc));writeFileSync(_0x36276f,createTdxConfigContent(_0x20047b),_0x3316be(0x19b));for(const _0x1a3ce0 of _0xe5d1b0){(_0x1a3ce0[_0x3316be(0x184)]||_0x1a3ce0[_0x3316be(0x22c)])&&writeFileSync(_0x1a3ce0[_0x3316be(0x1b7)],_0x1a3ce0['content'],_0x3316be(0x19b));}return console['error'](a22_0x4d1f82[_0x3316be(0x136)](_0x3316be(0x14c)+(_0x13cbcc[_0x3316be(0x164)]+_0x1c3ea3['length'])+_0x3316be(0x12c)+_0x543d2e)),saveSessionContext({'parent_segment':_0x20047b},_0xf119b6[_0x3316be(0x12e)]),console[_0x3316be(0x232)](a22_0x4d1f82[_0x3316be(0x136)](_0x3316be(0x13b)+a22_0x4d1f82[_0x3316be(0x166)](_0x3316be(0x23c))+_0x3316be(0x1ba)+a22_0x4d1f82['cyan'](_0x20047b))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{[a22_0x1d6769(0x1c9)]=a22_0x1d6769(0x220);[a22_0x1d6769(0x23e)]=a22_0x1d6769(0x1d0);async['execute'](_0x3bffd7){const _0x14c23d=a22_0x1d6769,{options:_0x1860ac,args:_0xc96399,tdx:_0x55810e}=_0x3bffd7,_0x3648aa=_0xc96399[0x0];if(!requireNameOrPath(_0x3648aa))return 0x1;_0x1860ac[_0x14c23d(0x213)]&&console[_0x14c23d(0x232)](_0x14c23d(0x1a8)+_0x3648aa);const {journeyId:_0x547b83}=await resolveJourneyIdFromInput(_0x3648aa,_0x1860ac,_0x55810e),_0x5a8d93=await withSpinner('Getting\x20column\x20mapping...',()=>_0x55810e['journey'][_0x14c23d(0x1ab)](_0x547b83),{'verbose':_0x1860ac[_0x14c23d(0x213)]}),_0x221bc1=_0x5a8d93[_0x14c23d(0x17c)];return console[_0x14c23d(0x19f)](_0x14c23d(0x22a)+_0x221bc1[_0x14c23d(0x238)]),console[_0x14c23d(0x19f)]('Table:\x20'+_0x221bc1[_0x14c23d(0x14d)]),await handleSDKOutput(_0x221bc1['columns'],_0x1860ac),0x0;}}export class JourneyActivationsCommand extends BaseCommand{[a22_0x1d6769(0x1c9)]=a22_0x1d6769(0x221);[a22_0x1d6769(0x23e)]=a22_0x1d6769(0x16d);async[a22_0x1d6769(0x16c)](_0x419c3d){const _0x40df1e=a22_0x1d6769,{options:_0x1bf70d,args:_0x1bb8ca,tdx:_0x6bce64}=_0x419c3d,_0x1e812d=_0x1bb8ca[0x0];if(!requireNameOrPath(_0x1e812d))return 0x1;_0x1bf70d['verbose']&&console[_0x40df1e(0x232)]('Input:\x20'+_0x1e812d);const {journeyId:_0x1773cf}=await resolveJourneyIdFromInput(_0x1e812d,_0x1bf70d,_0x6bce64),_0x2fad8b=await withSpinner(_0x40df1e(0x19a),()=>_0x6bce64[_0x40df1e(0x176)][_0x40df1e(0x1a3)](_0x1773cf),{'verbose':_0x1bf70d[_0x40df1e(0x213)]}),_0xbf87c8=_0x2fad8b[_0x40df1e(0x17c)];return console[_0x40df1e(0x232)]('Found\x20'+_0xbf87c8[_0x40df1e(0x164)]+'\x20activation'+(_0xbf87c8[_0x40df1e(0x164)]!==0x1?'s':'')),await handleSDKOutput(_0xbf87c8,_0x1bf70d),0x0;}}export class JourneyPushCommand extends BaseCommand{[a22_0x1d6769(0x1c9)]=a22_0x1d6769(0x1ce);['description']=a22_0x1d6769(0x1c4);[a22_0x1d6769(0x144)]=new SegmentPushCommand();async[a22_0x1d6769(0x16c)](_0x2aaff4){const _0x3731d9=a22_0x1d6769,_0x15a01e=_0x2aaff4[_0x3731d9(0x1d6)][0x0];let _0x44b0ac;if(_0x15a01e){const _0x25763a=await resolveTarget({'arg':_0x15a01e,'contextParent':_0x2aaff4[_0x3731d9(0x1e3)][_0x3731d9(0x22e)],'cwd':process['cwd']()});isSuccessfulResolution(_0x25763a)&&_0x25763a[_0x3731d9(0x15e)]===_0x3731d9(0x1a0)&&(_0x44b0ac=_0x25763a[_0x3731d9(0x1dc)]);}const _0x544f09={..._0x2aaff4,'options':{..._0x2aaff4['options'],'journeysOnly':!![],..._0x44b0ac&&{'singleFilePath':_0x44b0ac}}};return this[_0x3731d9(0x144)][_0x3731d9(0x16c)](_0x544f09);}}export class JourneyVersionsCommand extends BaseCommand{['name']=a22_0x1d6769(0x13d);[a22_0x1d6769(0x23e)]=a22_0x1d6769(0x23d);async['execute'](_0x160974){const _0x1c4a7d=a22_0x1d6769,{options:_0x2c37a4,args:_0xcb91c8,tdx:_0x4bf4ee}=_0x160974,_0x17df0a=_0xcb91c8[0x0];if(!requireNameOrPath(_0x17df0a))return 0x1;if(_0x2c37a4[_0x1c4a7d(0x213)])console[_0x1c4a7d(0x232)](_0x1c4a7d(0x1a8)+_0x17df0a);const {journeyId:_0x2dba66}=await resolveJourneyIdFromInput(_0x17df0a,_0x2c37a4,_0x4bf4ee),_0x42e391=await withSpinner('Listing\x20journey\x20versions...',()=>_0x4bf4ee['journey'][_0x1c4a7d(0x205)](_0x2dba66),{'verbose':_0x2c37a4[_0x1c4a7d(0x213)]}),{bundleName:_0x2d041a,versions:_0xcb3b27,latestJourneyId:_0x439c91}=_0x42e391[_0x1c4a7d(0x17c)];console[_0x1c4a7d(0x232)](_0x2d041a+':\x20'+_0xcb3b27[_0x1c4a7d(0x164)]+'\x20version'+(_0xcb3b27[_0x1c4a7d(0x164)]!==0x1?'s':''));const _0x2ea9e8=_0xcb3b27[_0x1c4a7d(0x23b)](_0x1264cb=>({'version':_0x1264cb[_0x1c4a7d(0x12f)],'journey_id':_0x1264cb[_0x1c4a7d(0x187)],'name':_0x1264cb['name'],'state':_0x1264cb['state'],'paused':_0x1264cb[_0x1c4a7d(0x167)],'latest':_0x1264cb[_0x1c4a7d(0x187)]===_0x439c91,'created_at':_0x1264cb[_0x1c4a7d(0x1b8)]}));return await handleSDKOutput(_0x2ea9e8,_0x2c37a4),0x0;}}function a22_0x5d71(_0x5bfa9f,_0x295648){_0x5bfa9f=_0x5bfa9f-0x125;const _0x4c2c80=a22_0x4c2c();let _0x5d714a=_0x4c2c80[_0x5bfa9f];return _0x5d714a;}export class JourneyVersionCreateCommand extends BaseCommand{[a22_0x1d6769(0x1c9)]=a22_0x1d6769(0x208);[a22_0x1d6769(0x23e)]='Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey';async[a22_0x1d6769(0x16c)](_0x338d4e){const _0x69c482=a22_0x1d6769,{options:_0x42435f,args:_0x54f9b3,tdx:_0x30f3d0}=_0x338d4e,_0x1a38db=_0x54f9b3[0x0];if(!requireNameOrPath(_0x1a38db))return 0x1;if(_0x42435f[_0x69c482(0x213)])console[_0x69c482(0x232)](_0x69c482(0x1a8)+_0x1a38db);const {journeyId:_0x542a7c,journeyName:_0x3637d3}=await resolveJourneyIdFromInput(_0x1a38db,_0x42435f,_0x30f3d0);if(!_0x42435f[_0x69c482(0x177)]){const _0x338210=await confirm(_0x69c482(0x1df)+_0x3637d3+'\x22?');if(!_0x338210)return console['error']('Cancelled'),0x0;}const _0x3a8c40=await withSpinner(_0x69c482(0x21f),()=>_0x30f3d0[_0x69c482(0x176)][_0x69c482(0x173)](_0x542a7c),{'verbose':_0x42435f['verbose']}),_0x24c212=_0x3a8c40[_0x69c482(0x17c)];return console[_0x69c482(0x232)](a22_0x4d1f82[_0x69c482(0x136)]('β')+_0x69c482(0x18d)+_0x24c212[_0x69c482(0x1af)]['versionNumber']+_0x69c482(0x227)+_0x24c212[_0x69c482(0x1af)][_0x69c482(0x1c9)]+'\x22'),console['error'](_0x69c482(0x1de)+_0x24c212['id']),await handleSingleObjectOutput({'id':_0x24c212['id'],'name':_0x24c212[_0x69c482(0x1af)]['name'],'version':_0x24c212[_0x69c482(0x1af)][_0x69c482(0x12f)],'state':_0x24c212['attributes'][_0x69c482(0x16a)],'bundle_id':_0x24c212['attributes'][_0x69c482(0x1e4)],'created_at':_0x24c212['attributes'][_0x69c482(0x1b8)]},_0x42435f),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{[a22_0x1d6769(0x1c9)]='journey:version:view';[a22_0x1d6769(0x23e)]=a22_0x1d6769(0x17e);async[a22_0x1d6769(0x16c)](_0x47b275){const _0x1ba6f7=a22_0x1d6769,{options:_0x244e27,args:_0x2aa9f4,tdx:_0x44bdda}=_0x47b275,_0x294df3=_0x2aa9f4[0x0];if(!requireNameOrPath(_0x294df3))return 0x1;const _0x203d7c=_0x244e27[_0x1ba6f7(0x189)];if(!_0x203d7c)return console['error']('Error:\x20--version\x20option\x20is\x20required'),console[_0x1ba6f7(0x232)](_0x1ba6f7(0x155)),0x1;const _0x3d5f74=parseInt(_0x203d7c,0xa);if(isNaN(_0x3d5f74)||_0x3d5f74<0x1)return console['error'](_0x1ba6f7(0x22b)+_0x203d7c),0x1;if(_0x244e27[_0x1ba6f7(0x213)])console[_0x1ba6f7(0x232)](_0x1ba6f7(0x1a8)+_0x294df3+',\x20version:\x20'+_0x3d5f74);const {journeyId:_0x5c1e70,parentSegmentId:_0x293ddb}=await resolveJourneyIdFromInput(_0x294df3,_0x244e27,_0x44bdda),_0x48f4c6=await withSpinner(_0x1ba6f7(0x170),()=>_0x44bdda[_0x1ba6f7(0x176)][_0x1ba6f7(0x205)](_0x5c1e70),{'verbose':_0x244e27[_0x1ba6f7(0x213)]}),{versions:_0x3c2133,latestJourneyId:_0x31fccd}=_0x48f4c6[_0x1ba6f7(0x17c)],_0x47d3c7=_0x3c2133[_0x1ba6f7(0x17f)](_0xda92cd=>_0xda92cd[_0x1ba6f7(0x12f)]===_0x3d5f74);if(!_0x47d3c7){const _0x52188a=_0x3c2133[_0x1ba6f7(0x23b)](_0x4a5b60=>'v'+_0x4a5b60['versionNumber'])[_0x1ba6f7(0x21c)](',\x20');return console[_0x1ba6f7(0x232)](_0x1ba6f7(0x151)+_0x3d5f74+_0x1ba6f7(0x154)+_0x52188a),0x1;}const _0x2c2b8f=await withSpinner(_0x1ba6f7(0x161)+_0x3d5f74+_0x1ba6f7(0x1db),()=>_0x44bdda['journey']['getJourney'](_0x47d3c7['journeyId']),{'verbose':_0x244e27[_0x1ba6f7(0x213)]}),_0x541c99=_0x2c2b8f['data'],_0x3f5089=getConsoleNextUrl(_0x244e27[_0x1ba6f7(0x20a)],'/app/ps/'+_0x293ddb+_0x1ba6f7(0x1f5)+_0x47d3c7[_0x1ba6f7(0x187)]+_0x1ba6f7(0x1ca));return await handleSingleObjectOutput({'id':_0x541c99['id'],'name':_0x541c99[_0x1ba6f7(0x1af)][_0x1ba6f7(0x1c9)],'version':_0x541c99[_0x1ba6f7(0x1af)][_0x1ba6f7(0x12f)],'description':_0x541c99[_0x1ba6f7(0x1af)][_0x1ba6f7(0x23e)],'state':_0x541c99[_0x1ba6f7(0x1af)][_0x1ba6f7(0x16a)],'paused':_0x541c99[_0x1ba6f7(0x1af)][_0x1ba6f7(0x167)],'reentry_mode':_0x541c99[_0x1ba6f7(0x1af)][_0x1ba6f7(0x128)],'stages':_0x541c99[_0x1ba6f7(0x1af)]['journeyStages']?.['length']||0x0,..._0x541c99[_0x1ba6f7(0x1af)][_0x1ba6f7(0x199)]&&{'goal':_0x541c99[_0x1ba6f7(0x1af)][_0x1ba6f7(0x199)][_0x1ba6f7(0x1c9)]},'latest':_0x47d3c7[_0x1ba6f7(0x187)]===_0x31fccd,'created_at':_0x541c99[_0x1ba6f7(0x1af)][_0x1ba6f7(0x1b8)],'updated_at':_0x541c99['attributes'][_0x1ba6f7(0x1aa)],'url':_0x3f5089},_0x244e27),0x0;}}
|
|
1
|
+
const a22_0x5e4339=a22_0x4e19;(function(_0x5a0c10,_0x3dc87d){const _0x2a0d42=a22_0x4e19,_0xebec22=_0x5a0c10();while(!![]){try{const _0x5d69e5=parseInt(_0x2a0d42(0x81))/0x1+parseInt(_0x2a0d42(0x144))/0x2+-parseInt(_0x2a0d42(0x160))/0x3+-parseInt(_0x2a0d42(0xb0))/0x4*(-parseInt(_0x2a0d42(0xb5))/0x5)+parseInt(_0x2a0d42(0x12f))/0x6+-parseInt(_0x2a0d42(0x165))/0x7+-parseInt(_0x2a0d42(0x13d))/0x8;if(_0x5d69e5===_0x3dc87d)break;else _0xebec22['push'](_0xebec22['shift']());}catch(_0x25f048){_0xebec22['push'](_0xebec22['shift']());}}}(a22_0x3026,0x2ffb3));import a22_0x117952 from'chalk';import a22_0x373cff from'path';function a22_0x4e19(_0x457a2f,_0x5734c1){_0x457a2f=_0x457a2f-0x72;const _0x302644=a22_0x3026();let _0x4e1997=_0x302644[_0x457a2f];return _0x4e1997;}import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{aggregateStageHistory,assembleJourneyStats,buildStageNameMap}from'../sdk/journey.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{confirm,confirmKey,isInteractive}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{journeyResponseToDef,toYamlString,parseYamlString,normalizeJourneyDef}from'../sdk/segment/journey-yaml.js';import{segmentResponseToDef,journeyActivationStepToYaml,serializeRule}from'../sdk/segment/child-segment-yaml.js';import{saveSessionContext}from'../core/session.js';import{sanitizeFileName}from'../utils/string-utils.js';import{SegmentPushCommand}from'./segment-push-command.js';import{buildFolderIdToPathMap}from'../sdk/segment/resolution-context.js';import{createTdxConfigContent}from'../sdk/segment/tdx-config.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,createJumpTargetCache,resolveJumpTarget}from'../sdk/segment/journey-utils.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import{hyperlink}from'../sdk/util/formatters.js';function requireNameOrPath(_0x4b0e3a){const _0xe7dc52=a22_0x4e19;return!_0x4b0e3a&&(console[_0xe7dc52(0xaa)](_0xe7dc52(0x13c)),console[_0xe7dc52(0xaa)]('Usage:\x20journey\x20<subcommand>\x20<name-or-path>')),!!_0x4b0e3a;}function withJsonFormat(_0xf440d3){const _0x342f41=a22_0x4e19;if(!_0xf440d3[_0x342f41(0xab)]&&!_0xf440d3[_0x342f41(0x12d)]&&!_0xf440d3[_0x342f41(0x150)]&&!_0xf440d3['tsv'])return{..._0xf440d3,'format':_0x342f41(0x12d),'json':!![]};return _0xf440d3;}function formatJourneyState(_0x4c1f9b){const _0xa3a1c5=a22_0x4e19;switch(_0x4c1f9b){case _0xa3a1c5(0xf4):return a22_0x117952[_0xa3a1c5(0xe2)](_0xa3a1c5(0x83));case'draft':return a22_0x117952[_0xa3a1c5(0x100)](_0xa3a1c5(0x10a));case _0xa3a1c5(0x169):return a22_0x117952[_0xa3a1c5(0x166)](_0xa3a1c5(0xb4));case _0xa3a1c5(0x102):return a22_0x117952[_0xa3a1c5(0x156)](_0xa3a1c5(0x93));case _0xa3a1c5(0x13a):return a22_0x117952[_0xa3a1c5(0x100)]('(archived)');default:return'('+_0x4c1f9b+')';}}function a22_0x3026(){const _0x5d1a43=['Create\x20a\x20new\x20draft\x20version\x20of\x20a\x20journey','versionNumber','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Getting\x20column\x20mapping...','\x20new\x20files','parentSegment','Could\x20not\x20resolve\x20parent\x20segment.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','file','set','description','\x0aChanges\x20to\x20\x27','absolutePath','push','\x20\x20Statistics\x20not\x20available','\x20details...','localeCompare','cyan','links','\x20\x20Preserving\x20local\x20segment\x20name:\x20','Export\x20journey(s)\x20as\x20YAML\x20files','Resolving\x20parent\x20segment...','/e/','getTrafficData','\x20\x20-\x20','hasChanges','\x0aPull\x20summary:','test','journeyStages','Input:\x20','\x20\x20Consolidating\x20duplicate\x20segment:\x20','nodes','Push\x20journey\x20YAML\x20files\x20to\x20Treasure\x20Data','isNew','session','green','.yml','execute','\x22\x20not\x20found','table','Usage:\x20journey\x20version\x20view\x20<name-or-path>\x20--version\x20N','name','setPhase','stageNameMap','enteredSize','No\x20statistics\x20available\x20for\x20journey:\x20','all','journey:activations','map','π\x20','β\x20Pulled\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20path/to/journey.yml\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20journey\x20by\x20file','journeyId','launched','\x20versions)','site','folderPath','Listing\x20journey\x20versions...','journey:version:create','journeys','\x20Created\x20v','\x20\x20Journey\x20ID:\x20','Cancelled','args','entries','dim','rule','completed','Target\x20file:\x20','\x20Opening\x20','hasPeriod','resourceName','journey:pull','utf-8','resolveParentId','(draft)','activation_','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','If\x20the\x20journey\x20is\x20active,\x20the\x20date\x20range\x20may\x20be\x20too\x20wide.\x20Try\x20a\x20shorter\x20period\x20(max\x20~90\x20days).','Traffic\x20data\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','journey:view','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Create\x20a\x20new\x20draft\x20version\x20of\x20journey\x20\x22','segmentName','pause','Found\x20','type','folders','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','diff','sort','No\x20journeys\x20found','Resolving\x20version...','\x20version','\x20journey','join','data','length','INVALID_ARGUMENT','Found\x20journeys\x20with\x20this\x20name\x20in\x20other\x20folders:','journeyBundleId','dryRun','Show\x20journey\x20details','β\x20Journey\x20\x22','filter','Getting\x20version\x20','Show\x20journey\x20table\x20column\x20mapping','getSegment','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','verbose','json','createdAt','1971192dvSkCk','base','segment','then','Fetching\x20users\x20and\x20connections...','red','journeyName','Fetching\x20journeys\x20and\x20folders...','history','Fetching\x20parent\x20segment...','yes','archived','get','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','3280184bsuunm',',\x20version:\x20','conversion','listFolders','buildIdToEmailMap','toLowerCase','from','378292JaMhpV','no_parent','getJourney','resolveSegment','List\x20journeys\x20in\x20current\x20context','options','πΊοΈ\x20','journey:resume','\x20\x20-w,\x20--web\x20\x20Open\x20journey\x20in\x20web\x20browser','segmentPushCommand','Resolving\x20journey...','\x20\x20Folder\x20path:\x20','jsonl','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','Fetching\x20','journeyBundleName','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','segments','blue','folderId','No\x20traffic\x20data\x20available\x20for\x20journey:\x20','relativePath','filePath','helpText','\x20(rule\x20match)','View\x20a\x20specific\x20version\x20of\x20a\x20journey','getParentFull','targetDir','661830eBdbJS','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','journey:stats','\x5c$&','...','338877TrrhST','yellow','stages','values','paused','β\x20Context\x20set:\x20','Get\x20journey\x20traffic\x20data\x20(Sankey\x20charts)','Error:\x20Invalid\x20--type\x20\x22','repeat','Show\x20journey\x20statistics','Usage:\x20journey\x20view\x20<name-or-path>\x20[-w]','buildIdToNameMap','goal','completionRate','replace','/j/da/je','cwd','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','Pause\x20a\x20running\x20journey','state','add','content','has','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x22\x20paused','/app/ps/','Error:\x20--version\x20option\x20is\x20required','resolveJourneyId','journey:push','\x20(draft)\x20β\x20\x22','exitOrJumpSize','log','103030KOCPGH','\x20files?','(running)','Write\x20','Resume\x20a\x20paused\x20journey','\x20(ID:\x20','(root)','Error:\x20Version\x20','attributes','reentryMode','connector_config','includeHistory','\x20\x20Name:\x20','activation','find','parent_segment','connection','journey:version:view','(completed)','Error:\x20Journey\x20\x27','parentName','-\x20no\x20files\x20written','Warning:\x20--include-history\x20without\x20--from/--to\x20may\x20return\x20all-time\x20history','List\x20all\x20versions\x20of\x20a\x20journey','Options:','database','Warning:\x20Could\x20not\x20parse\x20existing\x20file\x20for\x20segment\x20name\x20preservation:\x20','Journey\x20name:\x20','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','listActivationsFlat','Getting\x20journey\x20statistics...','Listing\x20journeys...','size','Table:\x20','renderStats','message','getStatistics','journey:columns','listVersions','milestoneSize','root\x20folder','error','format','\x20\x20Parent\x20segment:\x20','errorCode','β\x20Found\x20','version','1019468oKgJiQ','listJourneysWithFolders','journey','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)','(paused)','5mmDUqm','/j/da','Aborted.','stage','\x20=\x20','\x0aError:','bold','updatedAt','listJourneysFromParentSegment','tdx.json','Pattern:\x20'];a22_0x3026=function(){return _0x5d1a43;};return a22_0x3026();}function formatJourneyItem(_0x1b2c0f,_0x1d1f88='',_0x132af1){const _0x345217=a22_0x4e19,_0x2e6dfa=formatJourneyState(_0x1b2c0f[_0x345217(0x74)]),_0x206a96=_0x132af1?hyperlink(_0x1b2c0f[_0x345217(0x153)],_0x132af1):_0x1b2c0f[_0x345217(0x153)];return _0x1d1f88+_0x345217(0x14a)+_0x206a96+'\x20'+_0x2e6dfa;}function escapeRegex(_0x2d1f1e){const _0x487e9b=a22_0x4e19;return _0x2d1f1e[_0x487e9b(0x173)](/[.*+?^${}()|[\]\\]/g,_0x487e9b(0x163));}function globToRegex(_0x138ea6){const _0x499912=a22_0x4e19,_0x15c178=_0x138ea6['split']('*')[_0x499912(0xef)](escapeRegex);return new RegExp(_0x15c178[_0x499912(0x11e)]('.*'),'i');}function buildRuleToNameMapping(_0x5c271f){const _0x5decf4=a22_0x4e19,_0xc2a91f=new Map();if(_0x5c271f['segments'])for(const [_0x15a3cc,_0x691d83]of Object[_0x5decf4(0xff)](_0x5c271f[_0x5decf4(0x155)])){if(_0x691d83[_0x5decf4(0x101)]){const _0x409dc8=serializeRule(_0x691d83[_0x5decf4(0x101)]),_0x144e8d=_0xc2a91f[_0x5decf4(0x13b)](_0x409dc8);_0x144e8d?_0x144e8d[_0x5decf4(0xcc)](_0x15a3cc):_0xc2a91f[_0x5decf4(0xc8)](_0x409dc8,[_0x15a3cc]);}}return _0xc2a91f;}async function resolveJourneyIdFromInput(_0x5c1146,_0x2d4686,_0x1867f8){const _0x8d9ea6=a22_0x4e19,_0x2a0513=await resolveJourneyTarget(_0x5c1146,_0x2d4686[_0x8d9ea6(0xc5)],_0x2d4686[_0x8d9ea6(0x12c)]),_0x2fa15e=_0x2a0513[_0x8d9ea6(0xc5)];if(!_0x2fa15e)throw new SDKError(ErrorCode[_0x8d9ea6(0x121)],_0x8d9ea6(0xc6));const _0xadf781=await withSpinner(_0x8d9ea6(0xd4),()=>_0x1867f8[_0x8d9ea6(0x131)][_0x8d9ea6(0x109)](_0x2fa15e),{'verbose':_0x2d4686['verbose']}),_0xcd0c59=_0xadf781[_0x8d9ea6(0x11f)],_0x193ee8=await withSpinner(_0x8d9ea6(0x14e),()=>_0x1867f8[_0x8d9ea6(0xb2)][_0x8d9ea6(0x7c)](_0xcd0c59,_0x2a0513[_0x8d9ea6(0x135)]),{'verbose':_0x2d4686[_0x8d9ea6(0x12c)]});return{'journeyId':_0x193ee8[_0x8d9ea6(0x11f)],'journeyName':_0x2a0513[_0x8d9ea6(0x135)],'parentSegmentId':_0xcd0c59};}async function resolveJourneyTarget(_0x21eb46,_0x523cc6,_0x557767){const _0x297fe6=a22_0x4e19;if(isYamlFilePath(_0x21eb46))try{const _0x910214=await resolveYamlFilePath(_0x21eb46);return _0x557767&&(console[_0x297fe6(0xaa)]('Resolved\x20YAML\x20file:\x20'+_0x21eb46),console[_0x297fe6(0xaa)](_0x297fe6(0xac)+_0x910214[_0x297fe6(0xc5)]),console[_0x297fe6(0xaa)](_0x297fe6(0x8d)+_0x910214[_0x297fe6(0x112)]),console[_0x297fe6(0xaa)](_0x297fe6(0x14f)+(_0x910214[_0x297fe6(0xf7)]||_0x297fe6(0x87)))),{'journeyName':_0x910214[_0x297fe6(0x112)],'parentSegment':_0x910214[_0x297fe6(0xc5)],'resolved':_0x910214};}catch(_0x4fddb6){throw new SDKError(ErrorCode[_0x297fe6(0x121)],_0x297fe6(0x10c)+_0x4fddb6[_0x297fe6(0xa4)]);}if(!_0x523cc6)throw new SDKError(ErrorCode[_0x297fe6(0x121)],_0x297fe6(0xc2));return{'journeyName':_0x21eb46,'parentSegment':_0x523cc6};}export class JourneyListCommand extends BaseCommand{[a22_0x5e4339(0xe8)]='journey:list';[a22_0x5e4339(0xc9)]=a22_0x5e4339(0x148);async[a22_0x5e4339(0xe4)](_0x371efa){const _0x318b02=a22_0x5e4339,{options:_0x2c5f5e,args:_0x19724b,tdx:_0x13d2d0}=_0x371efa,_0x36f342=_0x19724b[0x0],_0x21c254=_0x2c5f5e['parentSegment'];if(!_0x21c254)return console['error']('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x318b02(0xaa)](_0x318b02(0x72)),0x1;const _0x50dea6=await withSpinner(_0x318b02(0xd4),()=>_0x13d2d0[_0x318b02(0x131)]['resolveParentId'](_0x21c254),{'verbose':_0x2c5f5e[_0x318b02(0x12c)]}),_0x530683=_0x50dea6[_0x318b02(0x11f)];_0x2c5f5e['verbose']&&(console[_0x318b02(0xaa)]('Parent\x20segment:\x20'+_0x21c254+_0x318b02(0x86)+_0x530683+')'),_0x36f342&&console[_0x318b02(0xaa)](_0x318b02(0xbf)+_0x36f342));const _0x36ee7d=await withSpinner(_0x318b02(0x138),()=>_0x13d2d0[_0x318b02(0x131)][_0x318b02(0x15e)](_0x530683),{'verbose':_0x2c5f5e['verbose']}),_0x5416cd=_0x36ee7d[_0x318b02(0x11f)],_0x3d43b6=_0x5416cd['rootFolderId'],_0x41b2eb=await withSpinner(_0x318b02(0xa0),()=>_0x13d2d0[_0x318b02(0xb2)][_0x318b02(0xb1)](_0x530683,_0x3d43b6),{'verbose':_0x2c5f5e[_0x318b02(0x12c)]});let _0x405182=_0x41b2eb[_0x318b02(0x11f)][_0x318b02(0xfa)];const _0x199d7b=_0x41b2eb[_0x318b02(0x11f)][_0x318b02(0x116)],_0x2e1f24=new Map();for(const _0x4aa996 of _0x199d7b){_0x2e1f24[_0x318b02(0xc8)](_0x4aa996['id'],_0x4aa996[_0x318b02(0xe8)]);}if(_0x36f342){const _0x2d6f4b=globToRegex(_0x36f342);_0x405182=_0x405182[_0x318b02(0x127)](_0x287ec9=>_0x2d6f4b[_0x318b02(0xda)](_0x287ec9[_0x318b02(0x153)]));}console[_0x318b02(0xaa)](_0x318b02(0xae)+_0x405182[_0x318b02(0x120)]+_0x318b02(0x11d)+(_0x405182[_0x318b02(0x120)]!==0x1?'s':''));const _0x23898f=_0x2eb052=>{const _0xac74c4=_0x318b02;return getConsoleNextUrl(_0x2c5f5e[_0xac74c4(0xf6)],_0xac74c4(0x7a)+_0x530683+_0xac74c4(0xd5)+_0x2eb052+_0xac74c4(0xb6));};if(_0x2c5f5e[_0x318b02(0xab)]===_0x318b02(0xe6))await handleSDKOutput(_0x405182,_0x2c5f5e);else{if(_0x2c5f5e[_0x318b02(0xab)]===_0x318b02(0x12d)){const _0x5bb29f=_0x405182[_0x318b02(0xef)](_0x1e47a3=>({..._0x1e47a3,'url':_0x23898f(_0x1e47a3['id'])}));await handleSDKOutput(_0x5bb29f,_0x2c5f5e);}else{console[_0x318b02(0x80)]('['+_0x21c254+']');const _0x4242b7=new Map(),_0x225afd=[];for(const _0x4fc0fa of _0x405182){if(!_0x4fc0fa[_0x318b02(0x157)]||_0x4fc0fa['folderId']===_0x3d43b6)_0x225afd[_0x318b02(0xcc)](_0x4fc0fa);else{const _0x63ca0a=_0x4242b7['get'](_0x4fc0fa['folderId'])||[];_0x63ca0a[_0x318b02(0xcc)](_0x4fc0fa),_0x4242b7[_0x318b02(0xc8)](_0x4fc0fa[_0x318b02(0x157)],_0x63ca0a);}}const _0x366dd8=(_0x1f67c3,_0x5acd14)=>_0x1f67c3[_0x318b02(0x153)][_0x318b02(0xcf)](_0x5acd14['journeyBundleName'],undefined,{'sensitivity':_0x318b02(0x130)});_0x225afd['sort'](_0x366dd8);for(const _0x6bd078 of _0x225afd){console[_0x318b02(0x80)](formatJourneyItem(_0x6bd078,'',_0x23898f(_0x6bd078['id'])));}const _0x2837f0=[..._0x4242b7[_0x318b02(0xff)]()][_0x318b02(0x119)]((_0x5b97f8,_0x1ad0a8)=>{const _0x5c6788=_0x318b02,_0x59005c=_0x2e1f24[_0x5c6788(0x13b)](_0x5b97f8[0x0])||_0x5b97f8[0x0],_0x56926f=_0x2e1f24[_0x5c6788(0x13b)](_0x1ad0a8[0x0])||_0x1ad0a8[0x0];return _0x59005c['localeCompare'](_0x56926f,undefined,{'sensitivity':_0x5c6788(0x130)});});for(const [_0x8746c3,_0x460a3a]of _0x2837f0){const _0x3a43c9=_0x2e1f24[_0x318b02(0x13b)](_0x8746c3)||_0x8746c3;console['log'](_0x318b02(0xf0)+_0x3a43c9),_0x460a3a[_0x318b02(0x119)](_0x366dd8);for(const _0x45be64 of _0x460a3a){console[_0x318b02(0x80)](formatJourneyItem(_0x45be64,'\x20\x20',_0x23898f(_0x45be64['id'])));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a22_0x5e4339(0xe8)]=a22_0x5e4339(0x10f);[a22_0x5e4339(0xc9)]=a22_0x5e4339(0x125);async[a22_0x5e4339(0xe4)](_0x3c1423){const _0x2ecc00=a22_0x5e4339,{options:_0x56fae7,args:_0x1fab3a,tdx:_0x9113ba}=_0x3c1423,_0x5777b1=_0x1fab3a[0x0];if(!_0x5777b1)return console[_0x2ecc00(0xaa)]('Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required'),console[_0x2ecc00(0xaa)](_0x2ecc00(0x16f)),console[_0x2ecc00(0xaa)](_0x2ecc00(0x99)),console['error'](_0x2ecc00(0x14c)),0x1;_0x56fae7[_0x2ecc00(0x12c)]&&console['error'](_0x2ecc00(0xdc)+_0x5777b1);const {journeyId:_0xbcfea6,parentSegmentId:_0x54e0b1}=await resolveJourneyIdFromInput(_0x5777b1,_0x56fae7,_0x9113ba);if(_0x56fae7['web']){const _0x357155=getConsoleNextUrl(_0x56fae7[_0x2ecc00(0xf6)],'/app/ps/'+_0x54e0b1+_0x2ecc00(0xd5)+_0xbcfea6+_0x2ecc00(0x174));return console[_0x2ecc00(0xaa)](a22_0x117952[_0x2ecc00(0xe2)]('β')+_0x2ecc00(0x104)+a22_0x117952[_0x2ecc00(0xd0)](_0x357155)),openBrowser(_0x357155),0x0;}const _0x2f3603=await withSpinner('Getting\x20journey\x20details...',()=>_0x9113ba['journey'][_0x2ecc00(0x146)](_0xbcfea6),{'verbose':_0x56fae7[_0x2ecc00(0x12c)]}),_0x4c2613=_0x2f3603[_0x2ecc00(0x11f)],_0x4ea5a5=_0x56fae7['includeStats'];let _0x275269;if(_0x4ea5a5)try{const _0x606ae3=await withSpinner(_0x2ecc00(0x9f),()=>_0x9113ba[_0x2ecc00(0xb2)][_0x2ecc00(0xa5)](_0xbcfea6),{'verbose':_0x56fae7[_0x2ecc00(0x12c)]});_0x275269=_0x606ae3[_0x2ecc00(0x11f)];}catch{_0x56fae7['verbose']&&console['error'](_0x2ecc00(0xcd));}const _0x2e0f5a=getConsoleNextUrl(_0x56fae7[_0x2ecc00(0xf6)],'/app/ps/'+_0x54e0b1+'/e/'+_0xbcfea6+_0x2ecc00(0x174)),_0xcaecdd={'id':_0x4c2613['id'],'name':_0x4c2613[_0x2ecc00(0x89)][_0x2ecc00(0xe8)],'description':_0x4c2613['attributes']['description'],'state':_0x4c2613[_0x2ecc00(0x89)][_0x2ecc00(0x74)],'paused':_0x4c2613['attributes']['paused'],'reentry_mode':_0x4c2613[_0x2ecc00(0x89)]['reentryMode'],'stages':_0x4c2613[_0x2ecc00(0x89)][_0x2ecc00(0xdb)]?.[_0x2ecc00(0x120)]||0x0,..._0x4c2613[_0x2ecc00(0x89)]['goal']&&{'goal':_0x4c2613[_0x2ecc00(0x89)][_0x2ecc00(0x171)][_0x2ecc00(0xe8)]},..._0x275269&&{'statistics':{'size':_0x275269[_0x2ecc00(0xa1)],'entered':_0x275269[_0x2ecc00(0xeb)],'goal_achieved':_0x275269['goalSize'],'completion_rate':_0x275269[_0x2ecc00(0x172)],'exit_or_jump':_0x275269[_0x2ecc00(0x7f)],'exit_or_jump_rate':_0x275269['exitOrJumpRate'],'stages':_0x275269[_0x2ecc00(0x167)]}},'url':_0x2e0f5a};return await handleSingleObjectOutput(_0xcaecdd,_0x56fae7),0x0;}}export class JourneyStatsCommand extends BaseCommand{[a22_0x5e4339(0xe8)]=a22_0x5e4339(0x162);[a22_0x5e4339(0xc9)]=a22_0x5e4339(0x16e);async[a22_0x5e4339(0xe4)](_0x249b05){const _0xf52008=a22_0x5e4339,{options:_0x563c10,args:_0x12d504,tdx:_0x436219}=_0x249b05,_0x314cc1=_0x12d504[0x0];if(!requireNameOrPath(_0x314cc1))return 0x1;_0x563c10['verbose']&&console[_0xf52008(0xaa)](_0xf52008(0xdc)+_0x314cc1);const _0x4e4b5e=_0x563c10,_0x5e586a=_0x4e4b5e[_0xf52008(0x143)],_0x1f3b15=_0x4e4b5e['to'],_0x21a148=_0x4e4b5e[_0xf52008(0x8c)],_0xa3f258=_0x4e4b5e[_0xf52008(0xb8)];_0x21a148&&!_0x5e586a&&!_0x1f3b15&&console[_0xf52008(0xaa)](_0xf52008(0x97));const _0x33589f=_0x21a148?withJsonFormat(_0x563c10):_0x563c10,{journeyId:_0x31ce14,journeyName:_0x3f00f0}=await resolveJourneyIdFromInput(_0x314cc1,_0x33589f,_0x436219),_0x2e8f5f=_0x5e586a||_0x1f3b15?{'from':_0x5e586a,'to':_0x1f3b15}:undefined,_0xb8be0d=await withSpinner('Getting\x20journey\x20statistics...',()=>Promise[_0xf52008(0xed)]([_0x436219[_0xf52008(0xb2)][_0xf52008(0x146)](_0x31ce14),_0x436219['journey'][_0xf52008(0xa5)](_0x31ce14,_0x2e8f5f)]),{'verbose':_0x33589f[_0xf52008(0x12c)]}),[_0x20ba8e,_0x510019]=_0xb8be0d[_0xf52008(0x11f)];if(!_0x510019||_0x510019[_0xf52008(0xf3)]===null)return console['error'](_0xf52008(0xec)+_0x3f00f0),console['error'](_0xf52008(0x9d)),0x0;const _0x493b90=buildStageNameMap(_0x20ba8e),_0x5b3d2c=!!(_0x2e8f5f&&_0x510019[_0xf52008(0x137)]?.[_0xf52008(0x120)]),_0xa737ad={'stageNameMap':_0x493b90,'hasPeriod':_0x5b3d2c,'includeHistory':!!_0x21a148};if(_0xa3f258&&_0x510019[_0xf52008(0x167)]){const _0x49587a=_0x510019['stages'][_0xf52008(0x8f)](_0x1c9a63=>{const _0x13fd6a=_0xf52008,_0x3c2757=_0x493b90[_0x13fd6a(0x13b)](_0x1c9a63['id'])??'';return _0x3c2757[_0x13fd6a(0x142)]()===_0xa3f258['toLowerCase']();});if(_0x49587a)return await handleSingleObjectOutput(formatStageStats(_0x49587a,_0xa737ad),_0x33589f),0x0;const _0x3f8ab3=_0x510019[_0xf52008(0x167)][_0xf52008(0xef)](_0x1508c4=>_0x493b90[_0xf52008(0x13b)](_0x1508c4['id'])??_0x1508c4['id']);return console['error']('Error:\x20Stage\x20\x22'+_0xa3f258+_0xf52008(0xe5)),console['error']('Available\x20stages:\x20'+_0x3f8ab3[_0xf52008(0x11e)](',\x20')),0x1;}const _0x2c51a2=_0x510019[_0xf52008(0x167)]?.['map'](_0x2bea9d=>formatStageStats(_0x2bea9d,_0xa737ad)),_0x142017=assembleJourneyStats(_0x510019,{'from':_0x5e586a,'to':_0x1f3b15,'includeHistory':_0x21a148});return await this[_0xf52008(0xa3)](_0x142017,_0x2c51a2??[],_0x33589f),0x0;}async['renderStats'](_0x596ae1,_0x7938ce,_0x5002c9){const _0x2f463c=a22_0x5e4339,_0x34726d=_0x5002c9[_0x2f463c(0xab)]===_0x2f463c(0x12d)||_0x5002c9[_0x2f463c(0xab)]===_0x2f463c(0x150)||_0x5002c9[_0x2f463c(0x12d)]||_0x5002c9[_0x2f463c(0x150)];if(_0x34726d){_0x596ae1['stages']=_0x7938ce,await handleSingleObjectOutput(_0x596ae1,_0x5002c9);return;}await handleSingleObjectOutput(_0x596ae1,_0x5002c9);for(const _0x297d2e of _0x7938ce){console[_0x2f463c(0x80)](''),console[_0x2f463c(0x80)](String(a22_0x117952[_0x2f463c(0xd0)][_0x2f463c(0xbb)]('['+_0x297d2e['name']+']'))+a22_0x117952[_0x2f463c(0x100)]('\x20'+_0x297d2e['id']));const {id:_0x14b09d,name:_0x297b1b,..._0x119710}=_0x297d2e;await handleSingleObjectOutput(_0x119710,_0x5002c9);}}}export class JourneyTrafficCommand extends BaseCommand{['name']='journey:traffic';[a22_0x5e4339(0xc9)]=a22_0x5e4339(0x16b);async[a22_0x5e4339(0xe4)](_0x5103d1){const _0x2c0bf9=a22_0x5e4339,{options:_0x457140,args:_0x2f50ee,tdx:_0x41b325}=_0x5103d1,_0x184b6d=_0x2f50ee[0x0];if(!requireNameOrPath(_0x184b6d))return 0x1;_0x457140[_0x2c0bf9(0x12c)]&&console[_0x2c0bf9(0xaa)](_0x2c0bf9(0xdc)+_0x184b6d);const _0x3bab7f=_0x457140,_0x2991ac=_0x3bab7f[_0x2c0bf9(0x115)],_0xc5eabd=_0x3bab7f[_0x2c0bf9(0x143)],_0x1b3bea=_0x3bab7f['to'],_0x136a35=_0x3bab7f['limit'];if(_0x2991ac&&_0x2991ac!==_0x2c0bf9(0x13f)&&_0x2991ac!=='activation')return console['error'](_0x2c0bf9(0x16c)+_0x2991ac+'\x22.\x20Must\x20be\x20\x22conversion\x22\x20or\x20\x22activation\x22.'),0x1;const _0x413744=withJsonFormat(_0x457140),{journeyId:_0x1cf264,journeyName:_0x4db2f4}=await resolveJourneyIdFromInput(_0x184b6d,_0x413744,_0x41b325),_0x28980e={'type':_0x2991ac,'from':_0xc5eabd,'to':_0x1b3bea,'limit':_0x136a35},_0x49a23f=await withSpinner('Getting\x20journey\x20traffic\x20data...',()=>_0x41b325['journey'][_0x2c0bf9(0xd6)](_0x1cf264,_0x28980e),{'verbose':_0x413744['verbose']}),_0x30bc69=_0x49a23f[_0x2c0bf9(0x11f)],_0x4dfef8=_0x30bc69['conversion']&&(_0x30bc69[_0x2c0bf9(0x13f)][_0x2c0bf9(0xde)][_0x2c0bf9(0x120)]>0x0||_0x30bc69[_0x2c0bf9(0x13f)][_0x2c0bf9(0xd1)]['length']>0x0),_0x31c549=_0x30bc69[_0x2c0bf9(0x8e)]&&_0x30bc69[_0x2c0bf9(0x8e)][_0x2c0bf9(0x120)]>0x0;if(!_0x4dfef8&&!_0x31c549)return console[_0x2c0bf9(0xaa)](_0x2c0bf9(0x158)+_0x4db2f4),console['error'](_0x2c0bf9(0x10e)),_0xc5eabd&&_0x1b3bea&&console[_0x2c0bf9(0xaa)](_0x2c0bf9(0x10d)),0x0;return await handleSingleObjectOutput(_0x30bc69,_0x413744),0x0;}}function formatStageStats(_0x46ece5,_0x522aec){const _0x934911=a22_0x5e4339,_0x47a384=_0x522aec[_0x934911(0x105)]&&_0x46ece5[_0x934911(0x137)]?.[_0x934911(0x120)]?aggregateStageHistory(_0x46ece5[_0x934911(0x137)]):{'size':_0x46ece5[_0x934911(0xa1)],'entered':_0x46ece5[_0x934911(0xeb)],'milestone':_0x46ece5[_0x934911(0xa8)],'milestone_rate':_0x46ece5['completeMilestoneRate'],'exit_or_jump':_0x46ece5['exitOrJumpSize'],'exit_or_jump_rate':_0x46ece5['exitOrJumpRate']},_0x173220={'id':_0x46ece5['id'],'name':_0x522aec[_0x934911(0xea)][_0x934911(0x13b)](_0x46ece5['id'])??_0x46ece5['id'],..._0x47a384};return _0x522aec[_0x934911(0x105)]&&_0x522aec[_0x934911(0x8c)]&&_0x46ece5[_0x934911(0x137)]&&(_0x173220['history']=_0x46ece5[_0x934911(0x137)]),_0x173220;}export class JourneyPauseCommand extends BaseCommand{[a22_0x5e4339(0xe8)]='journey:pause';[a22_0x5e4339(0xc9)]=a22_0x5e4339(0x73);async[a22_0x5e4339(0xe4)](_0x5e5081){const _0x2776c9=a22_0x5e4339,{options:_0x12cbcf,args:_0x57b9c6,tdx:_0x386f90}=_0x5e5081,_0x5bfd72=_0x57b9c6[0x0];if(!requireNameOrPath(_0x5bfd72))return 0x1;_0x12cbcf['verbose']&&console[_0x2776c9(0xaa)]('Input:\x20'+_0x5bfd72);const {journeyId:_0x2a87fd,journeyName:_0x3f95e1}=await resolveJourneyIdFromInput(_0x5bfd72,_0x12cbcf,_0x386f90);if(!_0x12cbcf['yes']){const _0x126632=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22'+_0x3f95e1+'\x22?');if(!_0x126632)return console['error'](_0x2776c9(0xfd)),0x0;}const _0x1b7b00=await withSpinner('Pausing\x20journey...',()=>_0x386f90[_0x2776c9(0xb2)][_0x2776c9(0x113)](_0x2a87fd),{'verbose':_0x12cbcf['verbose']}),_0x388be7=_0x1b7b00['data'];return console[_0x2776c9(0xaa)]('β\x20Journey\x20\x22'+_0x388be7[_0x2776c9(0x89)]['name']+_0x2776c9(0x79)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a22_0x5e4339(0xe8)]=a22_0x5e4339(0x14b);[a22_0x5e4339(0xc9)]=a22_0x5e4339(0x85);async[a22_0x5e4339(0xe4)](_0xc1f095){const _0x5c0dbe=a22_0x5e4339,{options:_0x2fcb41,args:_0x13eb5f,tdx:_0x47e48a}=_0xc1f095,_0x3281b7=_0x13eb5f[0x0];if(!requireNameOrPath(_0x3281b7))return 0x1;_0x2fcb41[_0x5c0dbe(0x12c)]&&console[_0x5c0dbe(0xaa)]('Input:\x20'+_0x3281b7);const {journeyId:_0x52f4bf,journeyName:_0x58775d}=await resolveJourneyIdFromInput(_0x3281b7,_0x2fcb41,_0x47e48a);if(!_0x2fcb41[_0x5c0dbe(0x139)]){const _0x10b9a2=await confirm(_0x5c0dbe(0x117)+_0x58775d+'\x22?');if(!_0x10b9a2)return console[_0x5c0dbe(0xaa)](_0x5c0dbe(0xfd)),0x0;}const _0x3caaea=await withSpinner('Resuming\x20journey...',()=>_0x47e48a[_0x5c0dbe(0xb2)]['resume'](_0x52f4bf),{'verbose':_0x2fcb41['verbose']}),_0x3e44ec=_0x3caaea[_0x5c0dbe(0x11f)];return console[_0x5c0dbe(0xaa)](_0x5c0dbe(0x126)+_0x3e44ec[_0x5c0dbe(0x89)]['name']+'\x22\x20resumed'),0x0;}}export class JourneyPullCommand extends BaseCommand{[a22_0x5e4339(0xe8)]=a22_0x5e4339(0x107);[a22_0x5e4339(0xc9)]=a22_0x5e4339(0xd3);async[a22_0x5e4339(0xe4)](_0x2b505b){const _0x460eac=a22_0x5e4339,{options:_0x8657fb,args:_0x3f0e63,tdx:_0x25b027}=_0x2b505b,_0x3b46f1=_0x8657fb,_0x46a8ea=_0x3f0e63[0x0],_0xa183b3=_0x46a8ea&&isYamlFilePath(_0x46a8ea),_0x3a40fd=await resolveTarget({'arg':_0xa183b3?_0x46a8ea:undefined,'contextParent':_0x8657fb[_0x460eac(0xc5)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x3a40fd))return _0x3a40fd[_0x460eac(0xad)]===_0x460eac(0x145)?(console[_0x460eac(0xaa)](a22_0x117952['yellow'](_0x460eac(0x12b))),console[_0x460eac(0xaa)](_0x460eac(0xb3)),console['error'](_0x460eac(0x151)),console[_0x460eac(0xaa)](_0x460eac(0xf2)),console['error'](_0x460eac(0x78))):(console[_0x460eac(0xaa)](a22_0x117952['red']('Error:\x20'+_0x3a40fd[_0x460eac(0xa4)]+'\x0a')),_0x3a40fd[_0x460eac(0x15b)]&&console[_0x460eac(0xaa)](a22_0x117952['cyan'](_0x3a40fd[_0x460eac(0x15b)]))),0x1;let _0x4ffefc=_0xa183b3?undefined:_0x46a8ea,_0x497127,_0x3796be;_0x3a40fd[_0x460eac(0x115)]==='file'&&(_0x4ffefc=_0x3a40fd[_0x460eac(0x106)],_0x497127=_0x3a40fd[_0x460eac(0x15a)],_0x3796be=_0x3a40fd[_0x460eac(0xf7)]);const _0x4a798d=_0x3a40fd[_0x460eac(0x95)],_0x592a5b=_0x3a40fd[_0x460eac(0x15f)];_0x3b46f1[_0x460eac(0x12c)]&&(console[_0x460eac(0xaa)]('Parent\x20segment:\x20'+_0x4a798d),console[_0x460eac(0xaa)]('Target\x20directory:\x20'+_0x592a5b),_0x4ffefc&&console[_0x460eac(0xaa)](_0x460eac(0x9c)+_0x4ffefc),_0x497127&&console['error'](_0x460eac(0x103)+_0x497127),_0x3796be&&console['error']('Folder\x20path:\x20'+_0x3796be));const _0x1cdd0f=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x25b027[_0x460eac(0x131)][_0x460eac(0x109)](_0x4a798d),{'verbose':_0x8657fb[_0x460eac(0x12c)]}),_0xfbca71=_0x1cdd0f[_0x460eac(0x11f)],{journeys:_0xf70a2e,folders:_0x34fe25}=await withSpinner(_0x460eac(0x136),async()=>{const _0x518592=_0x460eac,[_0xd4ea1d,_0x344c54]=await Promise[_0x518592(0xed)]([_0x25b027['journey'][_0x518592(0xbd)](_0xfbca71,undefined,{'includeAllVersions':!![]}),_0x25b027[_0x518592(0x131)][_0x518592(0x140)](_0xfbca71)]);return{'journeys':_0xd4ea1d,'folders':_0x344c54};},{'verbose':_0x8657fb['verbose']})['then'](_0x438ead=>_0x438ead['data']);let _0x4271bf=_0xf70a2e;const _0x316fd5=buildFolderIdToPathMap(_0x34fe25);if(_0x4ffefc){const _0x289559=_0x4271bf[_0x460eac(0x127)](_0x284c90=>_0x284c90['journeyBundleName'][_0x460eac(0x142)]()===_0x4ffefc[_0x460eac(0x142)]());if(_0x289559[_0x460eac(0x120)]===0x0)return console[_0x460eac(0xaa)]('Error:\x20Journey\x20not\x20found:\x20'+_0x4ffefc),console[_0x460eac(0xaa)](_0x460eac(0x154)),0x1;_0x4271bf=_0x289559;}if(_0x3796be!==undefined){const _0x26ccc0=_0x4271bf[_0x460eac(0x127)](_0x4cac1b=>{const _0x5d359d=_0x460eac,_0x23d37a=_0x4cac1b[_0x5d359d(0x157)]?_0x316fd5[_0x5d359d(0x13b)](_0x4cac1b[_0x5d359d(0x157)])||'':'';return _0x23d37a===_0x3796be;});if(_0x26ccc0['length']===0x0&&_0x4271bf[_0x460eac(0x120)]>0x0){console['error'](_0x460eac(0x94)+_0x4ffefc+'\x27\x20not\x20found\x20in\x20'+(_0x3796be||_0x460eac(0xa9))),console[_0x460eac(0xaa)](_0x460eac(0x122));for(const _0x523d35 of _0x4271bf){const _0x20e233=_0x523d35[_0x460eac(0x157)]?_0x316fd5[_0x460eac(0x13b)](_0x523d35[_0x460eac(0x157)])||'':'';console['error'](_0x460eac(0xd7)+(_0x20e233||'(root)')+'/'+_0x523d35['journeyBundleName']);}return 0x1;}_0x4271bf=_0x26ccc0;}if(_0x4271bf[_0x460eac(0x120)]===0x0)return console[_0x460eac(0xaa)](_0x460eac(0x11a)),0x0;const _0x3c959e=new Map();for(const _0xc23e78 of _0x4271bf){const _0x11fe72=_0xc23e78[_0x460eac(0x123)];!_0x3c959e[_0x460eac(0x77)](_0x11fe72)&&_0x3c959e[_0x460eac(0xc8)](_0x11fe72,[]),_0x3c959e[_0x460eac(0x13b)](_0x11fe72)[_0x460eac(0xcc)](_0xc23e78);}for(const _0xac81c5 of _0x3c959e[_0x460eac(0x168)]()){_0xac81c5[_0x460eac(0x119)]((_0x5c13de,_0xccc908)=>(_0x5c13de[_0x460eac(0xc1)]||0x0)-(_0xccc908['versionNumber']||0x0));}const _0x1cc049=[],{idToEmailMap:_0x438dcb,connectionIdToNameMap:_0xcbc904}=await withSpinner(_0x460eac(0x133),async()=>{const _0x304451=_0x460eac,[_0x2a1fe6,_0x77558f]=await Promise[_0x304451(0xed)]([_0x25b027['user'][_0x304451(0x141)](),_0x25b027['connection'][_0x304451(0x170)]()]);return{'idToEmailMap':_0x2a1fe6,'connectionIdToNameMap':_0x77558f};},{'verbose':_0x8657fb['verbose']})[_0x460eac(0x132)](_0x11f05a=>_0x11f05a['data']);for(const _0x216ebe of _0x3c959e[_0x460eac(0x168)]()){const _0x1f79b1=_0x216ebe[0x0][_0x460eac(0x153)],_0x3beb37=_0x216ebe[0x0][_0x460eac(0x157)],_0x3911ea=_0x3beb37?_0x316fd5[_0x460eac(0x13b)](_0x3beb37)||'':'',_0x16a085=_0x3911ea?a22_0x373cff[_0x460eac(0x11e)](_0x592a5b,_0x3911ea):_0x592a5b,_0x3e6e98=_0x497127||a22_0x373cff[_0x460eac(0x11e)](_0x16a085,sanitizeFileName(_0x1f79b1)+_0x460eac(0xe3));let _0x3cca4b,_0x4300c5;if(existsSync(_0x3e6e98))try{const _0x26dcf3=readFileSync(_0x3e6e98,_0x460eac(0x108)),_0x5e73c0=parseYamlString(_0x26dcf3);_0x4300c5=_0x5e73c0,_0x3cca4b=buildRuleToNameMapping(_0x5e73c0),_0x3b46f1[_0x460eac(0x12c)]&&_0x3cca4b['size']>0x0&&console[_0x460eac(0xaa)]('Found\x20'+_0x3cca4b[_0x460eac(0xa1)]+'\x20segment\x20rule(s)\x20to\x20match\x20for\x20'+_0x1f79b1);}catch(_0x35d74d){_0x3b46f1[_0x460eac(0x12c)]&&console[_0x460eac(0xaa)](_0x460eac(0x9b)+_0x35d74d['message']);}const _0x12e1e1=[],_0x40171f=new Set(),_0x3e0a72=new Map(),_0x25d9ea=new Map(),_0x3a9f7a=new Set(),_0x47909c=new Map(),_0x122205=new Map(),_0x368c48=createJumpTargetCache();await withProgressSpinner(_0x460eac(0x152)+_0x1f79b1+_0x460eac(0x164),async _0x181a73=>{const _0x51813e=_0x460eac;for(const _0x21e0a3 of _0x216ebe){const _0x3aa7a7=_0x216ebe[_0x51813e(0x120)]>0x1?_0x21e0a3[_0x51813e(0x153)]+'\x20v'+(_0x21e0a3[_0x51813e(0xc1)]||0x1):_0x21e0a3[_0x51813e(0x153)];_0x181a73[_0x51813e(0xe9)](_0x51813e(0x152)+_0x3aa7a7);const _0x5a12f5=await _0x25b027[_0x51813e(0xb2)]['getJourney'](_0x21e0a3['id']),_0x1f1e02=_0x5a12f5[_0x51813e(0x89)]?.['audienceId'],_0x7303a={'resolveSegment':async _0x144b13=>{const _0x3fb0d1=_0x51813e;if(!_0x1f1e02)return{'name':_0x144b13,'isJourneyLocal':![]};const _0x16cb07=_0x3e0a72[_0x3fb0d1(0x13b)](_0x144b13);if(_0x16cb07)return _0x16cb07;try{const _0x37b3ef=await _0x25b027[_0x3fb0d1(0x131)][_0x3fb0d1(0x12a)](_0x1f1e02,_0x144b13),_0xc7e775=_0x37b3ef['kind']===SEGMENT_KIND_JOURNEY;let _0x4437a7,_0x49fcf3=_0x37b3ef[_0x3fb0d1(0xe8)];if(_0xc7e775&&_0x37b3ef[_0x3fb0d1(0x101)]){const _0x104f62=await segmentResponseToDef(_0x37b3ef,{'resolveSegmentName':async _0x54aae4=>{const _0x57794f=_0x3fb0d1,_0x88a49d=_0x3e0a72[_0x57794f(0x13b)](_0x54aae4);if(_0x88a49d)return _0x88a49d['name'];const _0x5def5d=await _0x7303a[_0x57794f(0x147)](_0x54aae4);return _0x5def5d[_0x57794f(0xe8)];}}),_0x400e05=_0x104f62['rule'];_0x4437a7={'description':_0x37b3ef['description'],'rule':_0x400e05};const _0x26774e=serializeRule(_0x400e05),_0x3d2c54=_0x25d9ea[_0x3fb0d1(0x13b)](_0x26774e);if(_0x3d2c54)_0x49fcf3=_0x3d2c54,_0x4437a7=undefined,_0x3b46f1[_0x3fb0d1(0x12c)]&&console[_0x3fb0d1(0xaa)](_0x3fb0d1(0xdd)+_0x37b3ef[_0x3fb0d1(0xe8)]+'\x20->\x20'+_0x3d2c54);else{let _0x2eb8b7=![];if(_0x3cca4b){const _0x49292e=_0x3cca4b[_0x3fb0d1(0x13b)](_0x26774e);if(_0x49292e){const _0x364242=_0x49292e['find'](_0x4d6632=>!_0x40171f[_0x3fb0d1(0x77)](_0x4d6632));_0x364242&&(_0x49fcf3=_0x364242,_0x40171f['add'](_0x364242),_0x25d9ea['set'](_0x26774e,_0x364242),_0x2eb8b7=!![],_0x3b46f1[_0x3fb0d1(0x12c)]&&console['error'](_0x3fb0d1(0xd2)+_0x364242+_0x3fb0d1(0x15c)));}}if(!_0x2eb8b7){const _0x4abc58=generateJourneyLocalName(_0x37b3ef[_0x3fb0d1(0xe8)]);_0x4abc58&&(_0x49fcf3=_0x4abc58);let _0xe09022=_0x49fcf3,_0x2bc544=0x2;while(_0x40171f['has'](_0xe09022)){_0xe09022=_0x49fcf3+'_'+_0x2bc544,_0x2bc544++;}_0x40171f[_0x3fb0d1(0x75)](_0xe09022),_0x25d9ea[_0x3fb0d1(0xc8)](_0x26774e,_0xe09022),_0x49fcf3=_0xe09022;}}}const _0x1a02fc={'name':_0x49fcf3,'isJourneyLocal':_0xc7e775,'definition':_0x4437a7};return _0x3e0a72[_0x3fb0d1(0xc8)](_0x144b13,_0x1a02fc),_0x1a02fc;}catch(_0x20bd93){return _0x8657fb[_0x3fb0d1(0x12c)]&&console[_0x3fb0d1(0xaa)]('Warning:\x20Could\x20not\x20resolve\x20segment\x20'+_0x144b13+':\x20'+_0x20bd93[_0x3fb0d1(0xa4)]),{'name':_0x144b13,'isJourneyLocal':![]};}},'resolveActivation':async _0x1b8e12=>{const _0xec6d0d=_0x51813e,_0x349a31=_0x47909c[_0xec6d0d(0x13b)](_0x1b8e12);if(_0x349a31)return _0x349a31;try{const _0x2d58ae=await _0x25b027['journey']['getActivation'](_0x21e0a3['id'],_0x1b8e12),_0x47906f=journeyActivationStepToYaml(_0x2d58ae,_0x438dcb,_0xcbc904),_0x157b8f=JSON['stringify']({'name':_0x47906f['name'],'connection':_0x47906f[_0xec6d0d(0x91)],'connector_config':_0x47906f[_0xec6d0d(0x8b)]}),_0x38ca99=_0x122205['get'](_0x157b8f);if(_0x38ca99){const _0x43a11d={'name':_0x38ca99,'isJourneyLocal':!![],'definition':_0x47906f};return _0x47909c[_0xec6d0d(0xc8)](_0x1b8e12,_0x43a11d),_0x43a11d;}const _0x2c72e2=_0x2d58ae[_0xec6d0d(0x89)]['activationParams'][_0xec6d0d(0xe8)]||_0x1b8e12,_0x19bd91=sanitizeYamlKey(_0x2c72e2)||_0xec6d0d(0x10b)+_0x1b8e12;let _0x558622=_0x19bd91,_0x25b81b=0x2;while(_0x3a9f7a[_0xec6d0d(0x77)](_0x558622)){_0x558622=_0x19bd91+'_'+_0x25b81b,_0x25b81b++;}_0x3a9f7a[_0xec6d0d(0x75)](_0x558622),_0x122205[_0xec6d0d(0xc8)](_0x157b8f,_0x558622);const _0x4dd87e={'name':_0x558622,'isJourneyLocal':!![],'definition':_0x47906f};return _0x47909c[_0xec6d0d(0xc8)](_0x1b8e12,_0x4dd87e),_0x4dd87e;}catch(_0x1440e7){return _0x8657fb[_0xec6d0d(0x12c)]&&console[_0xec6d0d(0xaa)]('Warning:\x20Could\x20not\x20resolve\x20activation\x20'+_0x1b8e12+':\x20'+_0x1440e7[_0xec6d0d(0xa4)]),{'name':_0x1b8e12,'isJourneyLocal':![]};}},'resolveJumpTarget':async(_0x2ca48a,_0x491507)=>{const _0x5787a4=_0x51813e;return resolveJumpTarget(_0x2ca48a,_0x491507,_0x368c48,_0x15958d=>_0x25b027['journey'][_0x5787a4(0x146)](_0x15958d));}},_0x20f064=await journeyResponseToDef(_0x5a12f5,_0x7303a);_0x12e1e1[_0x51813e(0xcc)]({'item':_0x21e0a3,'yaml':_0x20f064});}},{'verbose':_0x8657fb[_0x460eac(0x12c)]});const _0x16bd3c=await _0x25b027['journey']['getLatestJourneyId'](_0x216ebe[0x0][_0x460eac(0x123)]),_0x1ce367=buildMergedJourneyDef(_0x12e1e1,_0x3cca4b,_0x16bd3c),_0x3e5ef8=normalizeJourneyDef(_0x1ce367,_0x4300c5),_0x56c442=toYamlString(_0x3e5ef8),_0x191912=_0x497127||a22_0x373cff[_0x460eac(0x11e)](_0x16a085,sanitizeFileName(_0x1f79b1)+_0x460eac(0xe3));!_0x497127&&_0x3911ea&&!existsSync(_0x16a085)&&mkdirSync(_0x16a085,{'recursive':!![]});const _0x42c149=a22_0x373cff['relative'](process[_0x460eac(0x175)](),_0x191912);if(existsSync(_0x191912)){const _0x116a10=readFileSync(_0x191912,_0x460eac(0x108)),_0x508c8d=generateDiff(_0x116a10,_0x56c442),_0x3640c0=hasChanges(_0x508c8d);_0x1cc049['push']({'relativePath':_0x42c149,'absolutePath':_0x191912,'content':_0x56c442,'isNew':![],'hasChanges':_0x3640c0,'diff':_0x3640c0?formatDiffWithColors(_0x508c8d):undefined});}else _0x1cc049[_0x460eac(0xcc)]({'relativePath':_0x42c149,'absolutePath':_0x191912,'content':_0x56c442,'isNew':!![],'hasChanges':![]});}const _0x50dadd=_0x1cc049[_0x460eac(0x127)](_0x1041b3=>_0x1041b3['isNew']),_0x4c2faf=_0x1cc049[_0x460eac(0x127)](_0x4ee2b0=>!_0x4ee2b0[_0x460eac(0xe0)]&&_0x4ee2b0['hasChanges']),_0x419973=_0x1cc049[_0x460eac(0x127)](_0x3e7c5c=>!_0x3e7c5c[_0x460eac(0xe0)]&&!_0x3e7c5c[_0x460eac(0xd8)]),_0x72693a=_0x4271bf[_0x460eac(0x120)],_0x99ff7f=_0x3c959e[_0x460eac(0xa1)],_0xf65c2f=_0x72693a>_0x99ff7f?'\x20('+_0x72693a+_0x460eac(0xf5):'';console[_0x460eac(0xaa)](_0x460eac(0xd9)),console[_0x460eac(0xaa)]('\x20\x20'+a22_0x117952[_0x460eac(0xd0)](_0x99ff7f+'\x20journeys')+a22_0x117952[_0x460eac(0x100)](_0xf65c2f)),console['error']('\x20\x20'+a22_0x117952[_0x460eac(0xe2)]('+\x20'+_0x50dadd[_0x460eac(0x120)]+_0x460eac(0xc4))),console[_0x460eac(0xaa)]('\x20\x20'+a22_0x117952[_0x460eac(0x166)]('~\x20'+_0x4c2faf[_0x460eac(0x120)]+'\x20changed\x20files')),console[_0x460eac(0xaa)]('\x20\x20'+a22_0x117952[_0x460eac(0x100)]('=\x20'+_0x419973[_0x460eac(0x120)]+'\x20unchanged\x20files')),console['error']('\x20\x20Target:\x20'+a22_0x117952[_0x460eac(0xd0)](_0x592a5b)+'\x0a');if(_0x4c2faf['length']>0x0)for(const _0x242297 of _0x4c2faf){console[_0x460eac(0xaa)](_0x460eac(0xca)+_0x242297[_0x460eac(0x159)]+'\x27:'),console[_0x460eac(0xaa)]('β'[_0x460eac(0x16d)](0x3c)),console[_0x460eac(0xaa)](_0x242297[_0x460eac(0x118)]),console[_0x460eac(0xaa)]('β'['repeat'](0x3c));}if(_0x3b46f1[_0x460eac(0x124)])return console[_0x460eac(0xaa)](a22_0x117952[_0x460eac(0x166)](_0x460eac(0x161))),0x0;if(_0x50dadd[_0x460eac(0x120)]===0x0&&_0x4c2faf[_0x460eac(0x120)]===0x0)return console['error'](a22_0x117952[_0x460eac(0xe2)]('β\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x4a798d},_0x3b46f1[_0x460eac(0xe1)]),console[_0x460eac(0xaa)](a22_0x117952['green'](_0x460eac(0x16a)+a22_0x117952['dim'](_0x460eac(0x90))+_0x460eac(0xb9)+a22_0x117952['cyan'](_0x4a798d))),0x0;if(!_0x3b46f1[_0x460eac(0x139)]&&(_0x50dadd[_0x460eac(0x120)]>0x0||_0x4c2faf[_0x460eac(0x120)]>0x0)){if(!isInteractive())return console[_0x460eac(0xaa)](a22_0x117952[_0x460eac(0x134)](_0x460eac(0xba)),_0x460eac(0x110)),console[_0x460eac(0xaa)](a22_0x117952[_0x460eac(0x100)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x4571fb=await confirmKey(_0x460eac(0x84)+(_0x50dadd[_0x460eac(0x120)]+_0x4c2faf['length'])+_0x460eac(0x82));if(!_0x4571fb)return console['error'](a22_0x117952[_0x460eac(0x166)](_0x460eac(0xb7)),_0x460eac(0x96)),0x1;}!existsSync(_0x592a5b)&&mkdirSync(_0x592a5b,{'recursive':!![]});const _0x27cb04=a22_0x373cff[_0x460eac(0x11e)](_0x592a5b,_0x460eac(0xbe));writeFileSync(_0x27cb04,createTdxConfigContent(_0x4a798d),'utf-8');for(const _0x1447d8 of _0x1cc049){(_0x1447d8[_0x460eac(0xe0)]||_0x1447d8['hasChanges'])&&writeFileSync(_0x1447d8[_0x460eac(0xcb)],_0x1447d8[_0x460eac(0x76)],_0x460eac(0x108));}return console[_0x460eac(0xaa)](a22_0x117952[_0x460eac(0xe2)](_0x460eac(0xf1)+(_0x50dadd['length']+_0x4c2faf[_0x460eac(0x120)])+'\x20journey\x20files\x20to\x20'+_0x592a5b)),saveSessionContext({'parent_segment':_0x4a798d},_0x3b46f1[_0x460eac(0xe1)]),console[_0x460eac(0xaa)](a22_0x117952[_0x460eac(0xe2)](_0x460eac(0x16a)+a22_0x117952['dim'](_0x460eac(0x90))+_0x460eac(0xb9)+a22_0x117952[_0x460eac(0xd0)](_0x4a798d))),0x0;}}export class JourneyColumnsCommand extends BaseCommand{['name']=a22_0x5e4339(0xa6);[a22_0x5e4339(0xc9)]=a22_0x5e4339(0x129);async[a22_0x5e4339(0xe4)](_0x1bda8d){const _0x3180ba=a22_0x5e4339,{options:_0x24cc69,args:_0x5c16a0,tdx:_0xff241d}=_0x1bda8d,_0x172c97=_0x5c16a0[0x0];if(!requireNameOrPath(_0x172c97))return 0x1;_0x24cc69['verbose']&&console['error'](_0x3180ba(0xdc)+_0x172c97);const {journeyId:_0x546282}=await resolveJourneyIdFromInput(_0x172c97,_0x24cc69,_0xff241d),_0x33468d=await withSpinner(_0x3180ba(0xc3),()=>_0xff241d[_0x3180ba(0xb2)]['getColumnMapping'](_0x546282),{'verbose':_0x24cc69[_0x3180ba(0x12c)]}),_0x4ce165=_0x33468d[_0x3180ba(0x11f)];return console['log']('Database:\x20'+_0x4ce165[_0x3180ba(0x9a)]),console[_0x3180ba(0x80)](_0x3180ba(0xa2)+_0x4ce165['table']),await handleSDKOutput(_0x4ce165['columns'],_0x24cc69),0x0;}}export class JourneyActivationsCommand extends BaseCommand{['name']=a22_0x5e4339(0xee);[a22_0x5e4339(0xc9)]='List\x20activations\x20for\x20a\x20journey';async[a22_0x5e4339(0xe4)](_0x2fe633){const _0x19221e=a22_0x5e4339,{options:_0x129f94,args:_0x462c86,tdx:_0x293735}=_0x2fe633,_0x9e6bff=_0x462c86[0x0];if(!requireNameOrPath(_0x9e6bff))return 0x1;_0x129f94[_0x19221e(0x12c)]&&console[_0x19221e(0xaa)]('Input:\x20'+_0x9e6bff);const {journeyId:_0x7dddd}=await resolveJourneyIdFromInput(_0x9e6bff,_0x129f94,_0x293735),_0x588781=await withSpinner('Listing\x20journey\x20activations...',()=>_0x293735['journey'][_0x19221e(0x9e)](_0x7dddd),{'verbose':_0x129f94['verbose']}),_0x8fbef9=_0x588781[_0x19221e(0x11f)];return console['error'](_0x19221e(0x114)+_0x8fbef9[_0x19221e(0x120)]+'\x20activation'+(_0x8fbef9[_0x19221e(0x120)]!==0x1?'s':'')),await handleSDKOutput(_0x8fbef9,_0x129f94),0x0;}}export class JourneyPushCommand extends BaseCommand{[a22_0x5e4339(0xe8)]=a22_0x5e4339(0x7d);['description']=a22_0x5e4339(0xdf);[a22_0x5e4339(0x14d)]=new SegmentPushCommand();async[a22_0x5e4339(0xe4)](_0x2cc92b){const _0x99543c=a22_0x5e4339,_0x3c2986=_0x2cc92b[_0x99543c(0xfe)][0x0];let _0x2d1044;if(_0x3c2986){const _0x3c6ed1=await resolveTarget({'arg':_0x3c2986,'contextParent':_0x2cc92b[_0x99543c(0x149)][_0x99543c(0xc5)],'cwd':process[_0x99543c(0x175)]()});isSuccessfulResolution(_0x3c6ed1)&&_0x3c6ed1[_0x99543c(0x115)]===_0x99543c(0xc7)&&(_0x2d1044=_0x3c6ed1[_0x99543c(0x15a)]);}const _0x2fbf70={..._0x2cc92b,'options':{..._0x2cc92b[_0x99543c(0x149)],'journeysOnly':!![],..._0x2d1044&&{'singleFilePath':_0x2d1044}}};return this[_0x99543c(0x14d)][_0x99543c(0xe4)](_0x2fbf70);}}export class JourneyVersionsCommand extends BaseCommand{['name']='journey:versions';[a22_0x5e4339(0xc9)]=a22_0x5e4339(0x98);async['execute'](_0x54fb97){const _0x9b9b34=a22_0x5e4339,{options:_0x5e4252,args:_0x3e26ce,tdx:_0x3df65b}=_0x54fb97,_0x230e07=_0x3e26ce[0x0];if(!requireNameOrPath(_0x230e07))return 0x1;if(_0x5e4252[_0x9b9b34(0x12c)])console[_0x9b9b34(0xaa)](_0x9b9b34(0xdc)+_0x230e07);const {journeyId:_0x57c956}=await resolveJourneyIdFromInput(_0x230e07,_0x5e4252,_0x3df65b),_0x48eed7=await withSpinner(_0x9b9b34(0xf8),()=>_0x3df65b['journey'][_0x9b9b34(0xa7)](_0x57c956),{'verbose':_0x5e4252[_0x9b9b34(0x12c)]}),{bundleName:_0x28f89d,versions:_0x2aa45e,latestJourneyId:_0x23d569}=_0x48eed7[_0x9b9b34(0x11f)];console[_0x9b9b34(0xaa)](_0x28f89d+':\x20'+_0x2aa45e[_0x9b9b34(0x120)]+_0x9b9b34(0x11c)+(_0x2aa45e['length']!==0x1?'s':''));const _0x396fe0=_0x2aa45e[_0x9b9b34(0xef)](_0x47bf56=>({'version':_0x47bf56[_0x9b9b34(0xc1)],'journey_id':_0x47bf56['journeyId'],'name':_0x47bf56[_0x9b9b34(0xe8)],'state':_0x47bf56[_0x9b9b34(0x74)],'paused':_0x47bf56[_0x9b9b34(0x169)],'latest':_0x47bf56[_0x9b9b34(0xf3)]===_0x23d569,'created_at':_0x47bf56[_0x9b9b34(0x12e)]}));return await handleSDKOutput(_0x396fe0,_0x5e4252),0x0;}}export class JourneyVersionCreateCommand extends BaseCommand{['name']=a22_0x5e4339(0xf9);[a22_0x5e4339(0xc9)]=a22_0x5e4339(0xc0);async[a22_0x5e4339(0xe4)](_0x1a78a0){const _0x404180=a22_0x5e4339,{options:_0xd9bc15,args:_0x184a3f,tdx:_0x331b47}=_0x1a78a0,_0x514245=_0x184a3f[0x0];if(!requireNameOrPath(_0x514245))return 0x1;if(_0xd9bc15['verbose'])console['error'](_0x404180(0xdc)+_0x514245);const {journeyId:_0x554330,journeyName:_0xc2ab9f}=await resolveJourneyIdFromInput(_0x514245,_0xd9bc15,_0x331b47);if(!_0xd9bc15['yes']){const _0x194cac=await confirm(_0x404180(0x111)+_0xc2ab9f+'\x22?');if(!_0x194cac)return console['error']('Cancelled'),0x0;}const _0x2b36f4=await withSpinner('Creating\x20new\x20version...',()=>_0x331b47[_0x404180(0xb2)]['createVersion'](_0x554330),{'verbose':_0xd9bc15[_0x404180(0x12c)]}),_0x4e09e4=_0x2b36f4['data'];return console['error'](a22_0x117952[_0x404180(0xe2)]('β')+_0x404180(0xfb)+_0x4e09e4[_0x404180(0x89)][_0x404180(0xc1)]+_0x404180(0x7e)+_0x4e09e4[_0x404180(0x89)][_0x404180(0xe8)]+'\x22'),console[_0x404180(0xaa)](_0x404180(0xfc)+_0x4e09e4['id']),await handleSingleObjectOutput({'id':_0x4e09e4['id'],'name':_0x4e09e4['attributes'][_0x404180(0xe8)],'version':_0x4e09e4[_0x404180(0x89)][_0x404180(0xc1)],'state':_0x4e09e4[_0x404180(0x89)][_0x404180(0x74)],'bundle_id':_0x4e09e4[_0x404180(0x89)][_0x404180(0x123)],'created_at':_0x4e09e4[_0x404180(0x89)][_0x404180(0x12e)]},_0xd9bc15),0x0;}}export class JourneyVersionViewCommand extends BaseCommand{['name']=a22_0x5e4339(0x92);['description']=a22_0x5e4339(0x15d);async[a22_0x5e4339(0xe4)](_0x106f8d){const _0x26ecbe=a22_0x5e4339,{options:_0x2db321,args:_0x30d871,tdx:_0x20c649}=_0x106f8d,_0x21caf8=_0x30d871[0x0];if(!requireNameOrPath(_0x21caf8))return 0x1;const _0x388be6=_0x2db321[_0x26ecbe(0xaf)];if(!_0x388be6)return console[_0x26ecbe(0xaa)](_0x26ecbe(0x7b)),console[_0x26ecbe(0xaa)](_0x26ecbe(0xe7)),0x1;const _0x1155a0=parseInt(_0x388be6,0xa);if(isNaN(_0x1155a0)||_0x1155a0<0x1)return console['error']('Error:\x20Invalid\x20version\x20number:\x20'+_0x388be6),0x1;if(_0x2db321[_0x26ecbe(0x12c)])console[_0x26ecbe(0xaa)](_0x26ecbe(0xdc)+_0x21caf8+_0x26ecbe(0x13e)+_0x1155a0);const {journeyId:_0x321e60,parentSegmentId:_0xc18c51}=await resolveJourneyIdFromInput(_0x21caf8,_0x2db321,_0x20c649),_0x10a978=await withSpinner(_0x26ecbe(0x11b),()=>_0x20c649[_0x26ecbe(0xb2)][_0x26ecbe(0xa7)](_0x321e60),{'verbose':_0x2db321['verbose']}),{versions:_0x311729,latestJourneyId:_0x269592}=_0x10a978[_0x26ecbe(0x11f)],_0x2afded=_0x311729[_0x26ecbe(0x8f)](_0x5aea2e=>_0x5aea2e[_0x26ecbe(0xc1)]===_0x1155a0);if(!_0x2afded){const _0x65d3ba=_0x311729[_0x26ecbe(0xef)](_0xefee8a=>'v'+_0xefee8a[_0x26ecbe(0xc1)])[_0x26ecbe(0x11e)](',\x20');return console[_0x26ecbe(0xaa)](_0x26ecbe(0x88)+_0x1155a0+'\x20not\x20found.\x20Available:\x20'+_0x65d3ba),0x1;}const _0x3b6164=await withSpinner(_0x26ecbe(0x128)+_0x1155a0+_0x26ecbe(0xce),()=>_0x20c649[_0x26ecbe(0xb2)][_0x26ecbe(0x146)](_0x2afded[_0x26ecbe(0xf3)]),{'verbose':_0x2db321['verbose']}),_0x165bba=_0x3b6164[_0x26ecbe(0x11f)],_0x54839c=getConsoleNextUrl(_0x2db321['site'],'/app/ps/'+_0xc18c51+_0x26ecbe(0xd5)+_0x2afded[_0x26ecbe(0xf3)]+_0x26ecbe(0x174));return await handleSingleObjectOutput({'id':_0x165bba['id'],'name':_0x165bba['attributes'][_0x26ecbe(0xe8)],'version':_0x165bba[_0x26ecbe(0x89)][_0x26ecbe(0xc1)],'description':_0x165bba[_0x26ecbe(0x89)]['description'],'state':_0x165bba[_0x26ecbe(0x89)][_0x26ecbe(0x74)],'paused':_0x165bba[_0x26ecbe(0x89)][_0x26ecbe(0x169)],'reentry_mode':_0x165bba[_0x26ecbe(0x89)][_0x26ecbe(0x8a)],'stages':_0x165bba[_0x26ecbe(0x89)]['journeyStages']?.[_0x26ecbe(0x120)]||0x0,..._0x165bba[_0x26ecbe(0x89)][_0x26ecbe(0x171)]&&{'goal':_0x165bba[_0x26ecbe(0x89)][_0x26ecbe(0x171)]['name']},'latest':_0x2afded['journeyId']===_0x269592,'created_at':_0x165bba[_0x26ecbe(0x89)]['createdAt'],'updated_at':_0x165bba[_0x26ecbe(0x89)][_0x26ecbe(0xbc)],'url':_0x54839c},_0x2db321),0x0;}}
|